aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.editorconfig18
-rw-r--r--.github/CONTRIBUTING.md6
-rw-r--r--.github/PULL_REQUEST_TEMPLATE.md10
-rw-r--r--.gitignore17
-rw-r--r--.jscsrc78
-rw-r--r--.jshintrc25
-rw-r--r--.travis.yml65
-rw-r--r--README.md18
-rw-r--r--build/build.xml191
-rwxr-xr-xbuild/build_announcement.php50
-rwxr-xr-xbuild/build_changelog.php12
-rw-r--r--build/build_helper.php75
-rw-r--r--build/code_sniffer/phpbb/Sniffs/Commenting/FileCommentSniff.php232
-rw-r--r--build/code_sniffer/phpbb/Sniffs/ControlStructures/OpeningBraceBsdAllmanSniff.php143
-rw-r--r--build/code_sniffer/phpbb/Sniffs/ControlStructures/OpeningParenthesisSniff.php60
-rw-r--r--build/code_sniffer/phpbb/Sniffs/Namespaces/UnusedUseSniff.php248
-rw-r--r--build/code_sniffer/ruleset-minimum.xml18
-rw-r--r--build/code_sniffer/ruleset-php-extensions.xml8
-rw-r--r--build/code_sniffer/ruleset-php-legacy-core.xml11
-rw-r--r--build/code_sniffer/ruleset-php-legacy.xml92
-rw-r--r--build/code_sniffer/ruleset-php-strict-core.xml9
-rw-r--r--build/code_sniffer/ruleset-php-strict.xml48
-rwxr-xr-xbuild/package.php142
-rw-r--r--build/sami-all.conf.php2
-rwxr-xr-xcomposer.pharbin1038928 -> 1585196 bytes
-rwxr-xr-xgit-tools/commit-msg-hook-range.sh9
-rwxr-xr-xgit-tools/merge.php10
-rwxr-xr-xgit-tools/setup_github_network.php288
-rw-r--r--phpBB/.htaccess34
-rw-r--r--phpBB/adm/images/alert_close.pngbin0 -> 2097 bytes
-rw-r--r--phpBB/adm/images/arrow_down.gifbin113 -> 51 bytes
-rw-r--r--phpBB/adm/images/arrow_left.gifbin111 -> 49 bytes
-rw-r--r--phpBB/adm/images/arrow_right.gifbin111 -> 49 bytes
-rw-r--r--phpBB/adm/images/arrow_up.gifbin113 -> 51 bytes
-rw-r--r--phpBB/adm/images/bg_tabs1.gifbin2325 -> 0 bytes
-rw-r--r--phpBB/adm/images/bg_tabs2.gifbin541 -> 0 bytes
-rw-r--r--phpBB/adm/images/corners_left.gifbin796 -> 0 bytes
-rw-r--r--phpBB/adm/images/corners_left2.gifbin55 -> 0 bytes
-rw-r--r--phpBB/adm/images/corners_right.gifbin175 -> 0 bytes
-rw-r--r--phpBB/adm/images/corners_right2.gifbin56 -> 0 bytes
-rw-r--r--phpBB/adm/images/icon_folder.gifbin688 -> 662 bytes
-rw-r--r--phpBB/adm/images/icon_folder_link.gifbin734 -> 708 bytes
-rw-r--r--phpBB/adm/images/icon_folder_lock.gifbin707 -> 681 bytes
-rw-r--r--phpBB/adm/images/icon_subfolder.gifbin751 -> 725 bytes
-rw-r--r--phpBB/adm/images/loading.gifbin0 -> 1320 bytes
-rw-r--r--phpBB/adm/images/no_avatar.gifbin474 -> 930 bytes
-rw-r--r--phpBB/adm/images/toggle.gifbin788 -> 0 bytes
-rw-r--r--phpBB/adm/index.php582
-rw-r--r--phpBB/adm/style/acp_attachments.html156
-rw-r--r--phpBB/adm/style/acp_avatar_options_gravatar.html11
-rw-r--r--phpBB/adm/style/acp_avatar_options_local.html20
-rw-r--r--phpBB/adm/style/acp_avatar_options_remote.html11
-rw-r--r--phpBB/adm/style/acp_avatar_options_upload.html11
-rw-r--r--phpBB/adm/style/acp_ban.html59
-rw-r--r--phpBB/adm/style/acp_bbcodes.html14
-rw-r--r--phpBB/adm/style/acp_board.html9
-rw-r--r--phpBB/adm/style/acp_bots.html22
-rw-r--r--phpBB/adm/style/acp_captcha.html28
-rw-r--r--phpBB/adm/style/acp_contact.html76
-rw-r--r--phpBB/adm/style/acp_database.html14
-rw-r--r--phpBB/adm/style/acp_disallow.html6
-rw-r--r--phpBB/adm/style/acp_email.html22
-rw-r--r--phpBB/adm/style/acp_ext_delete_data.html40
-rw-r--r--phpBB/adm/style/acp_ext_details.html141
-rw-r--r--phpBB/adm/style/acp_ext_disable.html34
-rw-r--r--phpBB/adm/style/acp_ext_enable.html40
-rw-r--r--phpBB/adm/style/acp_ext_list.html121
-rw-r--r--phpBB/adm/style/acp_forums.html190
-rw-r--r--phpBB/adm/style/acp_forums_copy_perm.html2
-rw-r--r--phpBB/adm/style/acp_groups.html158
-rw-r--r--phpBB/adm/style/acp_groups_position.html175
-rw-r--r--phpBB/adm/style/acp_icons.html50
-rw-r--r--phpBB/adm/style/acp_inactive.html27
-rw-r--r--phpBB/adm/style/acp_jabber.html37
-rw-r--r--phpBB/adm/style/acp_language.html209
-rw-r--r--phpBB/adm/style/acp_logs.html37
-rw-r--r--phpBB/adm/style/acp_main.html96
-rw-r--r--phpBB/adm/style/acp_modules.html47
-rw-r--r--phpBB/adm/style/acp_permission_roles.html41
-rw-r--r--phpBB/adm/style/acp_permissions.html40
-rw-r--r--phpBB/adm/style/acp_php_info.html4
-rw-r--r--phpBB/adm/style/acp_posting_buttons.html71
-rw-r--r--phpBB/adm/style/acp_profile.html80
-rw-r--r--phpBB/adm/style/acp_prune_forums.html24
-rw-r--r--phpBB/adm/style/acp_prune_users.html47
-rw-r--r--phpBB/adm/style/acp_ranks.html33
-rw-r--r--phpBB/adm/style/acp_reasons.html26
-rw-r--r--phpBB/adm/style/acp_search.html46
-rw-r--r--phpBB/adm/style/acp_send_statistics.html19
-rw-r--r--phpBB/adm/style/acp_styles.html610
-rw-r--r--phpBB/adm/style/acp_update.html92
-rw-r--r--phpBB/adm/style/acp_users.html46
-rw-r--r--phpBB/adm/style/acp_users_avatar.html92
-rw-r--r--phpBB/adm/style/acp_users_feedback.html21
-rw-r--r--phpBB/adm/style/acp_users_overview.html56
-rw-r--r--phpBB/adm/style/acp_users_prefs.html81
-rw-r--r--phpBB/adm/style/acp_users_profile.html52
-rw-r--r--phpBB/adm/style/acp_users_signature.html80
-rw-r--r--phpBB/adm/style/acp_users_warnings.html4
-rw-r--r--phpBB/adm/style/acp_words.html8
-rw-r--r--phpBB/adm/style/admin.css1334
-rw-r--r--phpBB/adm/style/admin.js250
-rw-r--r--phpBB/adm/style/ajax.js221
-rw-r--r--phpBB/adm/style/auth_provider_ldap.html35
-rw-r--r--phpBB/adm/style/auth_provider_oauth.html18
-rw-r--r--phpBB/adm/style/captcha_default_acp_demo.html2
-rw-r--r--phpBB/adm/style/captcha_gd_acp.html18
-rw-r--r--phpBB/adm/style/captcha_qa_acp.html14
-rw-r--r--phpBB/adm/style/captcha_qa_acp_demo.html2
-rw-r--r--phpBB/adm/style/captcha_recaptcha_acp.html6
-rw-r--r--phpBB/adm/style/colour_swatch.html78
-rw-r--r--phpBB/adm/style/confirm_body.html14
-rw-r--r--phpBB/adm/style/confirm_body_prune.html28
-rw-r--r--phpBB/adm/style/custom_profile_fields.html32
-rw-r--r--phpBB/adm/style/editor.js403
-rw-r--r--phpBB/adm/style/install_convert.html8
-rw-r--r--phpBB/adm/style/install_error.html2
-rw-r--r--phpBB/adm/style/install_footer.html21
-rw-r--r--phpBB/adm/style/install_header.html57
-rw-r--r--phpBB/adm/style/install_install.html4
-rw-r--r--phpBB/adm/style/install_main.html2
-rw-r--r--phpBB/adm/style/install_update.html283
-rw-r--r--phpBB/adm/style/install_update_diff.html31
-rw-r--r--phpBB/adm/style/message_body.html2
-rw-r--r--phpBB/adm/style/overall_footer.html52
-rw-r--r--phpBB/adm/style/overall_header.html132
-rw-r--r--phpBB/adm/style/pagination.html12
-rw-r--r--phpBB/adm/style/permission_forum_copy.html6
-rw-r--r--phpBB/adm/style/permission_mask.html10
-rw-r--r--phpBB/adm/style/permission_roles_mask.html8
-rw-r--r--phpBB/adm/style/permission_trace.html4
-rw-r--r--phpBB/adm/style/permissions.js195
-rw-r--r--phpBB/adm/style/profilefields/bool.html7
-rw-r--r--phpBB/adm/style/profilefields/date.html5
-rw-r--r--phpBB/adm/style/profilefields/dropdown.html5
-rw-r--r--phpBB/adm/style/profilefields/int.html3
-rw-r--r--phpBB/adm/style/profilefields/string.html3
-rw-r--r--phpBB/adm/style/profilefields/text.html3
-rw-r--r--phpBB/adm/style/profilefields/url.html3
-rw-r--r--phpBB/adm/style/progress_bar.html2
-rw-r--r--phpBB/adm/style/simple_body.html2
-rw-r--r--phpBB/adm/style/simple_footer.html7
-rw-r--r--phpBB/adm/style/simple_header.html48
-rw-r--r--phpBB/adm/style/timezone.js13
-rw-r--r--phpBB/adm/style/timezone_option.html27
-rw-r--r--phpBB/adm/style/tooltip.js102
-rw-r--r--phpBB/adm/style/viewsource.html21
-rw-r--r--phpBB/adm/swatch.php53
-rw-r--r--phpBB/app.php35
-rw-r--r--phpBB/assets/javascript/core.js1675
-rw-r--r--phpBB/assets/javascript/editor.js369
-rw-r--r--phpBB/assets/javascript/jquery.min.js4
-rw-r--r--phpBB/assets/javascript/plupload.js657
-rw-r--r--phpBB/assets/plupload/plupload.full.min.js29
-rwxr-xr-xphpBB/bin/phpbbcli.php69
-rwxr-xr-x[-rw-r--r--]phpBB/cache/.htaccess0
-rwxr-xr-x[-rw-r--r--]phpBB/cache/index.htm0
-rw-r--r--phpBB/common.php108
-rw-r--r--phpBB/composer.json55
-rw-r--r--phpBB/composer.lock1666
-rw-r--r--phpBB/config/.htaccess4
-rw-r--r--phpBB/config/auth.yml101
-rw-r--r--phpBB/config/avatar.yml68
-rw-r--r--phpBB/config/captcha.yml59
-rw-r--r--phpBB/config/console.yml162
-rw-r--r--phpBB/config/content.yml72
-rw-r--r--phpBB/config/cron.yml162
-rw-r--r--phpBB/config/db.yml76
-rw-r--r--phpBB/config/event.yml41
-rw-r--r--phpBB/config/feed.yml113
-rw-r--r--phpBB/config/mimetype_guesser.yml36
-rw-r--r--phpBB/config/notification.yml390
-rw-r--r--phpBB/config/parameters.yml20
-rw-r--r--phpBB/config/password.yml131
-rw-r--r--phpBB/config/profilefield.yml102
-rw-r--r--phpBB/config/routing.yml9
-rw-r--r--phpBB/config/services.yml188
-rw-r--r--phpBB/config/tables.yml23
-rw-r--r--phpBB/config/user.yml19
-rw-r--r--phpBB/cron.php227
-rw-r--r--phpBB/develop/add_permissions.php19
-rw-r--r--phpBB/develop/adjust_avatars.php2
-rw-r--r--phpBB/develop/adjust_bbcodes.php2
-rw-r--r--phpBB/develop/adjust_magic_urls.php2
-rw-r--r--phpBB/develop/adjust_sizes.php2
-rw-r--r--phpBB/develop/adjust_smilies.php2
-rw-r--r--phpBB/develop/adjust_uids.php1
-rw-r--r--phpBB/develop/adjust_usernames.php2
-rw-r--r--phpBB/develop/benchmark.php26
-rw-r--r--phpBB/develop/blank.gif (renamed from phpBB/language/en/mods/index.htm)0
-rw-r--r--phpBB/develop/blank.jpg (renamed from phpBB/styles/prosilver/imageset/de/index.htm)0
-rw-r--r--phpBB/develop/calc_email_hash.php12
-rw-r--r--phpBB/develop/change_smiley_ref.php12
-rw-r--r--phpBB/develop/check_flash_bbcodes.php14
-rw-r--r--phpBB/develop/create_schema_files.php2116
-rw-r--r--phpBB/develop/create_search_index.php11
-rw-r--r--phpBB/develop/create_variable_overview.php28
-rw-r--r--phpBB/develop/export_events_for_wiki.php138
-rw-r--r--phpBB/develop/fill.php18
-rw-r--r--phpBB/develop/generate_utf_casefold.php12
-rw-r--r--phpBB/develop/generate_utf_confusables.php12
-rw-r--r--phpBB/develop/generate_utf_tables.php12
-rw-r--r--phpBB/develop/imageset_to_css.php374
-rw-r--r--phpBB/develop/lang_duplicates.php9
-rw-r--r--phpBB/develop/merge_attachment_tables.php14
-rw-r--r--phpBB/develop/merge_post_tables.php20
-rw-r--r--phpBB/develop/mysql_upgrader.php1245
-rw-r--r--phpBB/develop/namespacify.php194
-rw-r--r--phpBB/develop/nuke-db.php2
-rw-r--r--phpBB/develop/regex.php2
-rw-r--r--phpBB/develop/regex_idn.php151
-rwxr-xr-xphpBB/develop/remove-php-end-tags.py65
-rw-r--r--phpBB/develop/rename_interfaces.php56
-rw-r--r--phpBB/develop/repair_bots.php4
-rw-r--r--phpBB/develop/search_fill.php6
-rwxr-xr-xphpBB/develop/strip_icc_profiles.sh9
-rw-r--r--phpBB/develop/unicode_testing.php2
-rw-r--r--phpBB/develop/update_email_hash.php1
-rw-r--r--phpBB/develop/utf_normalizer_test.php12
-rw-r--r--phpBB/docs/AUTHORS89
-rw-r--r--phpBB/docs/CHANGELOG.html2916
-rw-r--r--phpBB/docs/CREDITS.txt102
-rw-r--r--phpBB/docs/FAQ.html105
-rw-r--r--phpBB/docs/INSTALL.html214
-rw-r--r--phpBB/docs/LICENSE.txt (renamed from phpBB/docs/COPYING)0
-rw-r--r--phpBB/docs/README.html159
-rw-r--r--phpBB/docs/assets/css/stylesheet.css337
-rw-r--r--phpBB/docs/assets/images/bg_header.gif (renamed from phpBB/docs/bg_header.gif)bin690 -> 690 bytes
-rw-r--r--phpBB/docs/assets/images/icon_back_top.gif (renamed from phpBB/styles/prosilver/imageset/icon_back_top.gif)bin204 -> 204 bytes
-rw-r--r--phpBB/docs/assets/images/site_logo.gif (renamed from phpBB/styles/prosilver/imageset/site_logo.gif)bin5070 -> 5070 bytes
-rw-r--r--phpBB/docs/auth_api.html82
-rw-r--r--phpBB/docs/coding-guidelines.html820
-rw-r--r--phpBB/docs/corners_left.gifbin55 -> 0 bytes
-rw-r--r--phpBB/docs/corners_left.pngbin195 -> 0 bytes
-rw-r--r--phpBB/docs/corners_right.gifbin56 -> 0 bytes
-rw-r--r--phpBB/docs/corners_right.pngbin201 -> 0 bytes
-rw-r--r--phpBB/docs/events.md2952
-rw-r--r--phpBB/docs/hook_system.html889
-rw-r--r--phpBB/docs/lighttpd.sample.conf25
-rw-r--r--phpBB/docs/nginx.sample.conf27
-rw-r--r--phpBB/docs/site_logo.gifbin3430 -> 0 bytes
-rw-r--r--phpBB/docs/sphinx.sample.conf100
-rw-r--r--phpBB/docs/stylesheet.css352
-rw-r--r--phpBB/download/file.php695
-rw-r--r--phpBB/ext/index.htm (renamed from phpBB/includes/auth/index.htm)0
-rw-r--r--phpBB/faq.php48
-rw-r--r--phpBB/feed.php1309
-rw-r--r--phpBB/includes/acm/acm_apc.php84
-rw-r--r--phpBB/includes/acm/acm_eaccelerator.php121
-rw-r--r--phpBB/includes/acm/acm_file.php732
-rw-r--r--phpBB/includes/acm/acm_memcache.php138
-rw-r--r--phpBB/includes/acm/acm_memory.php451
-rw-r--r--phpBB/includes/acm/acm_null.php156
-rw-r--r--phpBB/includes/acm/acm_redis.php145
-rw-r--r--phpBB/includes/acm/acm_wincache.php84
-rw-r--r--phpBB/includes/acm/acm_xcache.php121
-rw-r--r--phpBB/includes/acp/acp_attachments.php357
-rw-r--r--phpBB/includes/acp/acp_ban.php163
-rw-r--r--phpBB/includes/acp/acp_bbcodes.php169
-rw-r--r--phpBB/includes/acp/acp_board.php514
-rw-r--r--phpBB/includes/acp/acp_bots.php57
-rw-r--r--phpBB/includes/acp/acp_captcha.php105
-rw-r--r--phpBB/includes/acp/acp_contact.php134
-rw-r--r--phpBB/includes/acp/acp_database.php511
-rw-r--r--phpBB/includes/acp/acp_disallow.php20
-rw-r--r--phpBB/includes/acp/acp_email.php144
-rw-r--r--phpBB/includes/acp/acp_extensions.php603
-rw-r--r--phpBB/includes/acp/acp_forums.php292
-rw-r--r--phpBB/includes/acp/acp_groups.php574
-rw-r--r--phpBB/includes/acp/acp_icons.php111
-rw-r--r--phpBB/includes/acp/acp_inactive.php59
-rw-r--r--phpBB/includes/acp/acp_jabber.php56
-rw-r--r--phpBB/includes/acp/acp_language.php1145
-rw-r--r--phpBB/includes/acp/acp_logs.php60
-rw-r--r--phpBB/includes/acp/acp_main.php154
-rw-r--r--phpBB/includes/acp/acp_modules.php198
-rw-r--r--phpBB/includes/acp/acp_permission_roles.php127
-rw-r--r--phpBB/includes/acp/acp_permissions.php122
-rw-r--r--phpBB/includes/acp/acp_php_info.php18
-rw-r--r--phpBB/includes/acp/acp_profile.php905
-rw-r--r--phpBB/includes/acp/acp_prune.php249
-rw-r--r--phpBB/includes/acp/acp_ranks.php85
-rw-r--r--phpBB/includes/acp/acp_reasons.php58
-rw-r--r--phpBB/includes/acp/acp_search.php120
-rw-r--r--phpBB/includes/acp/acp_send_statistics.php25
-rw-r--r--phpBB/includes/acp/acp_styles.php4394
-rw-r--r--phpBB/includes/acp/acp_update.php91
-rw-r--r--phpBB/includes/acp/acp_users.php649
-rw-r--r--phpBB/includes/acp/acp_words.php17
-rw-r--r--phpBB/includes/acp/auth.php91
-rw-r--r--phpBB/includes/acp/info/acp_attachments.php19
-rw-r--r--phpBB/includes/acp/info/acp_ban.php16
-rw-r--r--phpBB/includes/acp/info/acp_bbcodes.php16
-rw-r--r--phpBB/includes/acp/info/acp_board.php16
-rw-r--r--phpBB/includes/acp/info/acp_bots.php17
-rw-r--r--phpBB/includes/acp/info/acp_captcha.php16
-rw-r--r--phpBB/includes/acp/info/acp_contact.php30
-rw-r--r--phpBB/includes/acp/info/acp_database.php16
-rw-r--r--phpBB/includes/acp/info/acp_disallow.php17
-rw-r--r--phpBB/includes/acp/info/acp_email.php17
-rw-r--r--phpBB/includes/acp/info/acp_extensions.php35
-rw-r--r--phpBB/includes/acp/info/acp_forums.php16
-rw-r--r--phpBB/includes/acp/info/acp_groups.php17
-rw-r--r--phpBB/includes/acp/info/acp_icons.php16
-rw-r--r--phpBB/includes/acp/info/acp_inactive.php16
-rw-r--r--phpBB/includes/acp/info/acp_jabber.php15
-rw-r--r--phpBB/includes/acp/info/acp_language.php18
-rw-r--r--phpBB/includes/acp/info/acp_logs.php43
-rw-r--r--phpBB/includes/acp/info/acp_main.php16
-rw-r--r--phpBB/includes/acp/info/acp_modules.php16
-rw-r--r--phpBB/includes/acp/info/acp_permission_roles.php16
-rw-r--r--phpBB/includes/acp/info/acp_permissions.php16
-rw-r--r--phpBB/includes/acp/info/acp_php_info.php16
-rw-r--r--phpBB/includes/acp/info/acp_profile.php16
-rw-r--r--phpBB/includes/acp/info/acp_prune.php18
-rw-r--r--phpBB/includes/acp/info/acp_ranks.php16
-rw-r--r--phpBB/includes/acp/info/acp_reasons.php16
-rw-r--r--phpBB/includes/acp/info/acp_search.php16
-rw-r--r--phpBB/includes/acp/info/acp_send_statistics.php16
-rw-r--r--phpBB/includes/acp/info/acp_styles.php22
-rw-r--r--phpBB/includes/acp/info/acp_update.php16
-rw-r--r--phpBB/includes/acp/info/acp_users.php16
-rw-r--r--phpBB/includes/acp/info/acp_words.php16
-rw-r--r--phpBB/includes/auth.php1064
-rw-r--r--phpBB/includes/auth/auth_apache.php249
-rw-r--r--phpBB/includes/auth/auth_db.php276
-rw-r--r--phpBB/includes/auth/auth_ldap.php359
-rw-r--r--phpBB/includes/bbcode.php100
-rw-r--r--phpBB/includes/cache.php437
-rw-r--r--phpBB/includes/captcha/captcha_factory.php100
-rw-r--r--phpBB/includes/captcha/captcha_gd.php2640
-rw-r--r--phpBB/includes/captcha/captcha_gd_wave.php845
-rw-r--r--phpBB/includes/captcha/captcha_non_gd.php392
-rw-r--r--phpBB/includes/captcha/plugins/captcha_abstract.php380
-rw-r--r--phpBB/includes/captcha/plugins/phpbb_captcha_gd_plugin.php165
-rw-r--r--phpBB/includes/captcha/plugins/phpbb_captcha_gd_wave_plugin.php83
-rw-r--r--phpBB/includes/captcha/plugins/phpbb_captcha_nogd_plugin.php72
-rw-r--r--phpBB/includes/captcha/plugins/phpbb_captcha_qa_plugin.php1022
-rw-r--r--phpBB/includes/captcha/plugins/phpbb_recaptcha_plugin.php345
-rw-r--r--phpBB/includes/compatibility_globals.php47
-rw-r--r--phpBB/includes/constants.php38
-rw-r--r--phpBB/includes/db/db_tools.php2525
-rw-r--r--phpBB/includes/db/dbal.php1000
-rw-r--r--phpBB/includes/db/firebird.php526
-rw-r--r--phpBB/includes/db/mssql.php476
-rw-r--r--phpBB/includes/db/mssql_odbc.php422
-rw-r--r--phpBB/includes/db/mssqlnative.php652
-rw-r--r--phpBB/includes/db/mysql.php591
-rw-r--r--phpBB/includes/db/mysqli.php581
-rw-r--r--phpBB/includes/db/oracle.php808
-rw-r--r--phpBB/includes/db/postgres.php485
-rw-r--r--phpBB/includes/db/sqlite.php370
-rw-r--r--phpBB/includes/diff/diff.php28
-rw-r--r--phpBB/includes/diff/engine.php15
-rw-r--r--phpBB/includes/diff/renderer.php15
-rw-r--r--phpBB/includes/error_collector.php63
-rw-r--r--phpBB/includes/functions.php3081
-rw-r--r--phpBB/includes/functions_acp.php717
-rw-r--r--phpBB/includes/functions_admin.php1214
-rw-r--r--phpBB/includes/functions_compatibility.php198
-rw-r--r--phpBB/includes/functions_compress.php77
-rw-r--r--phpBB/includes/functions_content.php518
-rw-r--r--phpBB/includes/functions_convert.php102
-rw-r--r--phpBB/includes/functions_database_helper.php18
-rw-r--r--phpBB/includes/functions_display.php858
-rw-r--r--phpBB/includes/functions_download.php774
-rw-r--r--phpBB/includes/functions_install.php345
-rw-r--r--phpBB/includes/functions_jabber.php76
-rw-r--r--phpBB/includes/functions_mcp.php725
-rw-r--r--phpBB/includes/functions_messenger.php492
-rw-r--r--phpBB/includes/functions_module.php436
-rw-r--r--phpBB/includes/functions_posting.php1660
-rw-r--r--phpBB/includes/functions_privmsgs.php371
-rw-r--r--phpBB/includes/functions_profile_fields.php1185
-rw-r--r--phpBB/includes/functions_template.php814
-rw-r--r--phpBB/includes/functions_transfer.php28
-rw-r--r--phpBB/includes/functions_upload.php244
-rw-r--r--phpBB/includes/functions_url_matcher.php112
-rw-r--r--phpBB/includes/functions_user.php1474
-rw-r--r--phpBB/includes/hooks/index.php14
-rw-r--r--phpBB/includes/mcp/info/mcp_ban.php16
-rw-r--r--phpBB/includes/mcp/info/mcp_logs.php16
-rw-r--r--phpBB/includes/mcp/info/mcp_main.php16
-rw-r--r--phpBB/includes/mcp/info/mcp_notes.php16
-rw-r--r--phpBB/includes/mcp/info/mcp_pm_reports.php22
-rw-r--r--phpBB/includes/mcp/info/mcp_queue.php18
-rw-r--r--phpBB/includes/mcp/info/mcp_reports.php16
-rw-r--r--phpBB/includes/mcp/info/mcp_warn.php16
-rw-r--r--phpBB/includes/mcp/mcp_ban.php153
-rw-r--r--phpBB/includes/mcp/mcp_forum.php187
-rw-r--r--phpBB/includes/mcp/mcp_front.php211
-rw-r--r--phpBB/includes/mcp/mcp_logs.php55
-rw-r--r--phpBB/includes/mcp/mcp_main.php922
-rw-r--r--phpBB/includes/mcp/mcp_notes.php30
-rw-r--r--phpBB/includes/mcp/mcp_pm_reports.php51
-rw-r--r--phpBB/includes/mcp/mcp_post.php261
-rw-r--r--phpBB/includes/mcp/mcp_queue.php1379
-rw-r--r--phpBB/includes/mcp/mcp_reports.php215
-rw-r--r--phpBB/includes/mcp/mcp_topic.php296
-rw-r--r--phpBB/includes/mcp/mcp_warn.php219
-rw-r--r--phpBB/includes/message_parser.php392
-rw-r--r--phpBB/includes/questionnaire/questionnaire.php47
-rw-r--r--phpBB/includes/search/fulltext_mysql.php943
-rw-r--r--phpBB/includes/search/fulltext_native.php1742
-rw-r--r--phpBB/includes/search/search.php320
-rw-r--r--phpBB/includes/session.php2473
-rw-r--r--phpBB/includes/sphinxapi.php1712
-rw-r--r--phpBB/includes/startup.php114
-rw-r--r--phpBB/includes/template.php692
-rw-r--r--phpBB/includes/ucp/info/ucp_attachments.php16
-rw-r--r--phpBB/includes/ucp/info/ucp_auth_link.php35
-rw-r--r--phpBB/includes/ucp/info/ucp_groups.php16
-rw-r--r--phpBB/includes/ucp/info/ucp_main.php16
-rw-r--r--phpBB/includes/ucp/info/ucp_notifications.php36
-rw-r--r--phpBB/includes/ucp/info/ucp_pm.php18
-rw-r--r--phpBB/includes/ucp/info/ucp_prefs.php16
-rw-r--r--phpBB/includes/ucp/info/ucp_profile.php21
-rw-r--r--phpBB/includes/ucp/info/ucp_zebra.php16
-rw-r--r--phpBB/includes/ucp/ucp_activate.php33
-rw-r--r--phpBB/includes/ucp/ucp_attachments.php26
-rw-r--r--phpBB/includes/ucp/ucp_auth_link.php147
-rw-r--r--phpBB/includes/ucp/ucp_confirm.php20
-rw-r--r--phpBB/includes/ucp/ucp_groups.php274
-rw-r--r--phpBB/includes/ucp/ucp_login_link.php246
-rw-r--r--phpBB/includes/ucp/ucp_main.php260
-rw-r--r--phpBB/includes/ucp/ucp_notifications.php239
-rw-r--r--phpBB/includes/ucp/ucp_pm.php81
-rw-r--r--phpBB/includes/ucp/ucp_pm_compose.php281
-rw-r--r--phpBB/includes/ucp/ucp_pm_options.php41
-rw-r--r--phpBB/includes/ucp/ucp_pm_viewfolder.php114
-rw-r--r--phpBB/includes/ucp/ucp_pm_viewmessage.php204
-rw-r--r--phpBB/includes/ucp/ucp_prefs.php219
-rw-r--r--phpBB/includes/ucp/ucp_profile.php461
-rw-r--r--phpBB/includes/ucp/ucp_register.php303
-rw-r--r--phpBB/includes/ucp/ucp_remind.php66
-rw-r--r--phpBB/includes/ucp/ucp_resend.php19
-rw-r--r--phpBB/includes/ucp/ucp_zebra.php65
-rw-r--r--phpBB/includes/utf/data/case_fold_c.php2
-rw-r--r--phpBB/includes/utf/data/case_fold_f.php2
-rw-r--r--phpBB/includes/utf/data/case_fold_s.php2
-rw-r--r--phpBB/includes/utf/data/confusables.php2
-rw-r--r--phpBB/includes/utf/data/recode_basic.php2
-rw-r--r--phpBB/includes/utf/data/recode_cjk.php2
-rw-r--r--phpBB/includes/utf/data/search_indexer_0.php2
-rw-r--r--phpBB/includes/utf/data/search_indexer_1.php2
-rw-r--r--phpBB/includes/utf/data/search_indexer_19.php2
-rw-r--r--phpBB/includes/utf/data/search_indexer_2.php2
-rw-r--r--phpBB/includes/utf/data/search_indexer_20.php2
-rw-r--r--phpBB/includes/utf/data/search_indexer_21.php2
-rw-r--r--phpBB/includes/utf/data/search_indexer_26.php2
-rw-r--r--phpBB/includes/utf/data/search_indexer_3.php2
-rw-r--r--phpBB/includes/utf/data/search_indexer_31.php2
-rw-r--r--phpBB/includes/utf/data/search_indexer_32.php2
-rw-r--r--phpBB/includes/utf/data/search_indexer_33.php2
-rw-r--r--phpBB/includes/utf/data/search_indexer_36.php2
-rw-r--r--phpBB/includes/utf/data/search_indexer_4.php2
-rw-r--r--phpBB/includes/utf/data/search_indexer_448.php2
-rw-r--r--phpBB/includes/utf/data/search_indexer_5.php2
-rw-r--r--phpBB/includes/utf/data/search_indexer_58.php2
-rw-r--r--phpBB/includes/utf/data/search_indexer_6.php2
-rw-r--r--phpBB/includes/utf/data/search_indexer_64.php2
-rw-r--r--phpBB/includes/utf/data/search_indexer_84.php2
-rw-r--r--phpBB/includes/utf/data/search_indexer_9.php2
-rw-r--r--phpBB/includes/utf/data/search_indexer_95.php2
-rw-r--r--phpBB/includes/utf/data/utf_canonical_comp.php2
-rw-r--r--phpBB/includes/utf/data/utf_canonical_decomp.php2
-rw-r--r--phpBB/includes/utf/data/utf_compatibility_decomp.php2
-rw-r--r--phpBB/includes/utf/data/utf_nfc_qc.php2
-rw-r--r--phpBB/includes/utf/data/utf_nfkc_qc.php2
-rw-r--r--phpBB/includes/utf/data/utf_normalizer_common.php2
-rw-r--r--phpBB/includes/utf/utf_normalizer.php35
-rw-r--r--phpBB/includes/utf/utf_tools.php207
-rw-r--r--phpBB/index.php181
-rw-r--r--phpBB/install/convertors/convert_phpbb20.php87
-rw-r--r--phpBB/install/convertors/functions_phpbb20.php159
-rw-r--r--phpBB/install/data/confusables.php13
-rw-r--r--phpBB/install/data/new_normalizer.php13
-rw-r--r--phpBB/install/database_update.php2330
-rw-r--r--phpBB/install/index.php228
-rw-r--r--phpBB/install/install_convert.php253
-rw-r--r--phpBB/install/install_install.php527
-rw-r--r--phpBB/install/install_main.php16
-rw-r--r--phpBB/install/install_update.php348
-rw-r--r--phpBB/install/phpinfo.php13
-rw-r--r--phpBB/install/schemas/firebird_schema.sql1471
-rw-r--r--phpBB/install/schemas/mssql_schema.sql1796
-rw-r--r--phpBB/install/schemas/mysql_40_schema.sql1034
-rw-r--r--phpBB/install/schemas/mysql_41_schema.sql1034
-rw-r--r--phpBB/install/schemas/oracle_schema.sql1887
-rw-r--r--phpBB/install/schemas/postgres_schema.sql1234
-rw-r--r--phpBB/install/schemas/schema_data.sql178
-rw-r--r--phpBB/install/schemas/sqlite_schema.sql1003
-rw-r--r--phpBB/language/en/acp/attachments.php29
-rw-r--r--phpBB/language/en/acp/ban.php27
-rw-r--r--phpBB/language/en/acp/board.php197
-rw-r--r--phpBB/language/en/acp/bots.php13
-rw-r--r--phpBB/language/en/acp/common.php154
-rw-r--r--phpBB/language/en/acp/database.php13
-rw-r--r--phpBB/language/en/acp/email.php19
-rw-r--r--phpBB/language/en/acp/extensions.php132
-rw-r--r--phpBB/language/en/acp/forums.php19
-rw-r--r--phpBB/language/en/acp/groups.php41
-rw-r--r--phpBB/language/en/acp/language.php55
-rw-r--r--phpBB/language/en/acp/modules.php13
-rw-r--r--phpBB/language/en/acp/permissions.php104
-rw-r--r--phpBB/language/en/acp/permissions_phpbb.php349
-rw-r--r--phpBB/language/en/acp/posting.php59
-rw-r--r--phpBB/language/en/acp/profile.php32
-rw-r--r--phpBB/language/en/acp/prune.php28
-rw-r--r--phpBB/language/en/acp/search.php59
-rw-r--r--phpBB/language/en/acp/styles.php412
-rw-r--r--phpBB/language/en/acp/users.php19
-rw-r--r--phpBB/language/en/app.php48
-rw-r--r--phpBB/language/en/captcha_qa.php15
-rw-r--r--phpBB/language/en/captcha_recaptcha.php16
-rw-r--r--phpBB/language/en/cli.php90
-rw-r--r--phpBB/language/en/common.php928
-rw-r--r--phpBB/language/en/email/admin_activate.txt3
-rw-r--r--phpBB/language/en/email/admin_send_email.txt5
-rw-r--r--phpBB/language/en/email/admin_welcome_activated.txt2
-rw-r--r--phpBB/language/en/email/admin_welcome_inactive.txt4
-rw-r--r--phpBB/language/en/email/bookmark.txt20
-rw-r--r--phpBB/language/en/email/contact_admin.txt23
-rw-r--r--phpBB/language/en/email/coppa_resend_inactive.txt2
-rw-r--r--phpBB/language/en/email/coppa_welcome_inactive.txt2
-rw-r--r--phpBB/language/en/email/email_notify.txt8
-rw-r--r--phpBB/language/en/email/forum_notify.txt2
-rw-r--r--phpBB/language/en/email/group_approved.txt10
-rw-r--r--phpBB/language/en/email/installed.txt4
-rw-r--r--phpBB/language/en/email/newtopic_notify.txt4
-rw-r--r--phpBB/language/en/email/pm_report_closed.txt3
-rw-r--r--phpBB/language/en/email/pm_report_deleted.txt3
-rw-r--r--phpBB/language/en/email/post_approved.txt3
-rw-r--r--phpBB/language/en/email/post_disapproved.txt3
-rw-r--r--phpBB/language/en/email/post_in_queue.txt13
-rw-r--r--phpBB/language/en/email/privmsg_notify.txt2
-rw-r--r--phpBB/language/en/email/profile_send_email.txt4
-rw-r--r--phpBB/language/en/email/quote.txt20
-rw-r--r--phpBB/language/en/email/report_closed.txt3
-rw-r--r--phpBB/language/en/email/report_deleted.txt3
-rw-r--r--phpBB/language/en/email/report_pm.txt10
-rw-r--r--phpBB/language/en/email/report_post.txt13
-rw-r--r--phpBB/language/en/email/short/bookmark.txt20
-rw-r--r--phpBB/language/en/email/short/newtopic_notify.txt13
-rw-r--r--phpBB/language/en/email/short/post_approved.txt13
-rw-r--r--phpBB/language/en/email/short/post_disapproved.txt11
-rw-r--r--phpBB/language/en/email/short/post_in_queue.txt13
-rw-r--r--phpBB/language/en/email/short/privmsg_notify.txt15
-rw-r--r--phpBB/language/en/email/short/quote.txt20
-rw-r--r--phpBB/language/en/email/short/report_pm.txt10
-rw-r--r--phpBB/language/en/email/short/report_post.txt13
-rw-r--r--phpBB/language/en/email/short/topic_approved.txt10
-rw-r--r--phpBB/language/en/email/short/topic_disapproved.txt11
-rw-r--r--phpBB/language/en/email/short/topic_in_queue.txt13
-rw-r--r--phpBB/language/en/email/short/topic_notify.txt20
-rw-r--r--phpBB/language/en/email/topic_approved.txt3
-rw-r--r--phpBB/language/en/email/topic_disapproved.txt3
-rw-r--r--phpBB/language/en/email/topic_in_queue.txt13
-rw-r--r--phpBB/language/en/email/topic_notify.txt4
-rw-r--r--phpBB/language/en/email/user_activate.txt2
-rw-r--r--phpBB/language/en/email/user_activate_inactive.txt2
-rw-r--r--phpBB/language/en/email/user_activate_passwd.txt2
-rw-r--r--phpBB/language/en/email/user_reactivate_account.txt5
-rw-r--r--phpBB/language/en/email/user_remind_inactive.txt2
-rw-r--r--phpBB/language/en/email/user_resend_inactive.txt5
-rw-r--r--phpBB/language/en/email/user_welcome.txt4
-rw-r--r--phpBB/language/en/email/user_welcome_inactive.txt4
-rw-r--r--phpBB/language/en/groups.php15
-rw-r--r--phpBB/language/en/help_bbcode.php23
-rw-r--r--phpBB/language/en/help_faq.php113
-rw-r--r--phpBB/language/en/install.php89
-rw-r--r--phpBB/language/en/iso.txt2
-rw-r--r--phpBB/language/en/mcp.php83
-rw-r--r--phpBB/language/en/memberlist.php69
-rw-r--r--phpBB/language/en/migrator.php73
-rw-r--r--phpBB/language/en/plupload.php79
-rw-r--r--phpBB/language/en/posting.php113
-rw-r--r--phpBB/language/en/search.php47
-rw-r--r--phpBB/language/en/search_ignore_words.php272
-rw-r--r--phpBB/language/en/search_synonyms.php191
-rw-r--r--phpBB/language/en/ucp.php239
-rw-r--r--phpBB/language/en/viewforum.php19
-rw-r--r--phpBB/language/en/viewtopic.php47
-rw-r--r--phpBB/mcp.php764
-rw-r--r--phpBB/memberlist.php1161
-rw-r--r--phpBB/phpbb/auth/auth.php1121
-rw-r--r--phpBB/phpbb/auth/index.htm (renamed from phpBB/includes/db/index.htm)0
-rw-r--r--phpBB/phpbb/auth/provider/apache.php264
-rw-r--r--phpBB/phpbb/auth/provider/base.php108
-rw-r--r--phpBB/phpbb/auth/provider/db.php239
-rw-r--r--phpBB/phpbb/auth/provider/index.htm (renamed from phpBB/includes/search/index.htm)0
-rw-r--r--phpBB/phpbb/auth/provider/ldap.php348
-rw-r--r--phpBB/phpbb/auth/provider/oauth/oauth.php672
-rw-r--r--phpBB/phpbb/auth/provider/oauth/service/base.php51
-rw-r--r--phpBB/phpbb/auth/provider/oauth/service/bitly.php94
-rw-r--r--phpBB/phpbb/auth/provider/oauth/service/exception.php21
-rw-r--r--phpBB/phpbb/auth/provider/oauth/service/facebook.php94
-rw-r--r--phpBB/phpbb/auth/provider/oauth/service/google.php105
-rw-r--r--phpBB/phpbb/auth/provider/oauth/service/service_interface.php73
-rw-r--r--phpBB/phpbb/auth/provider/oauth/token_storage.php364
-rw-r--r--phpBB/phpbb/auth/provider/provider_interface.php197
-rw-r--r--phpBB/phpbb/auth/provider_collection.php67
-rw-r--r--phpBB/phpbb/avatar/driver/driver.php147
-rw-r--r--phpBB/phpbb/avatar/driver/driver_interface.php127
-rw-r--r--phpBB/phpbb/avatar/driver/gravatar.php198
-rw-r--r--phpBB/phpbb/avatar/driver/local.php205
-rw-r--r--phpBB/phpbb/avatar/driver/remote.php224
-rw-r--r--phpBB/phpbb/avatar/driver/upload.php307
-rw-r--r--phpBB/phpbb/avatar/manager.php354
-rw-r--r--phpBB/phpbb/cache/driver/apc.php70
-rw-r--r--phpBB/phpbb/cache/driver/base.php236
-rw-r--r--phpBB/phpbb/cache/driver/driver_interface.php167
-rw-r--r--phpBB/phpbb/cache/driver/eaccelerator.php105
-rw-r--r--phpBB/phpbb/cache/driver/file.php606
-rw-r--r--phpBB/phpbb/cache/driver/memcache.php122
-rw-r--r--phpBB/phpbb/cache/driver/memcached.php134
-rw-r--r--phpBB/phpbb/cache/driver/memory.php281
-rw-r--r--phpBB/phpbb/cache/driver/null.php151
-rw-r--r--phpBB/phpbb/cache/driver/redis.php158
-rw-r--r--phpBB/phpbb/cache/driver/wincache.php73
-rw-r--r--phpBB/phpbb/cache/driver/xcache.php107
-rw-r--r--phpBB/phpbb/cache/service.php390
-rw-r--r--phpBB/phpbb/captcha/char_cube3d.php277
-rw-r--r--phpBB/phpbb/captcha/colour_manager.php527
-rw-r--r--phpBB/phpbb/captcha/factory.php88
-rw-r--r--phpBB/phpbb/captcha/gd.php1847
-rw-r--r--phpBB/phpbb/captcha/gd_wave.php845
-rw-r--r--phpBB/phpbb/captcha/non_gd.php386
-rw-r--r--phpBB/phpbb/captcha/plugins/captcha_abstract.php390
-rw-r--r--phpBB/phpbb/captcha/plugins/gd.php130
-rw-r--r--phpBB/phpbb/captcha/plugins/gd_wave.php42
-rw-r--r--phpBB/phpbb/captcha/plugins/nogd.php42
-rw-r--r--phpBB/phpbb/captcha/plugins/qa.php1039
-rw-r--r--phpBB/phpbb/captcha/plugins/recaptcha.php332
-rw-r--r--phpBB/phpbb/class_loader.php164
-rw-r--r--phpBB/phpbb/composer.json32
-rw-r--r--phpBB/phpbb/config/config.php167
-rw-r--r--phpBB/phpbb/config/db.php204
-rw-r--r--phpBB/phpbb/config/db_text.php159
-rw-r--r--phpBB/phpbb/config_php_file.php160
-rw-r--r--phpBB/phpbb/console/application.php120
-rw-r--r--phpBB/phpbb/console/command/cache/purge.php89
-rw-r--r--phpBB/phpbb/console/command/command.php31
-rw-r--r--phpBB/phpbb/console/command/config/command.php26
-rw-r--r--phpBB/phpbb/console/command/config/delete.php63
-rw-r--r--phpBB/phpbb/console/command/config/get.php72
-rw-r--r--phpBB/phpbb/console/command/config/increment.php70
-rw-r--r--phpBB/phpbb/console/command/config/set.php70
-rw-r--r--phpBB/phpbb/console/command/config/set_atomic.php84
-rw-r--r--phpBB/phpbb/console/command/cron/cron_list.php111
-rw-r--r--phpBB/phpbb/console/command/cron/run.php172
-rw-r--r--phpBB/phpbb/console/command/db/console_migrator_output_handler.php69
-rw-r--r--phpBB/phpbb/console/command/db/migrate.php107
-rw-r--r--phpBB/phpbb/console/command/dev/migration_tips.php64
-rw-r--r--phpBB/phpbb/console/command/extension/command.php30
-rw-r--r--phpBB/phpbb/console/command/extension/disable.php52
-rw-r--r--phpBB/phpbb/console/command/extension/enable.php52
-rw-r--r--phpBB/phpbb/console/command/extension/purge.php52
-rw-r--r--phpBB/phpbb/console/command/extension/show.php62
-rw-r--r--phpBB/phpbb/console/command/fixup/fix_left_right_ids.php134
-rw-r--r--phpBB/phpbb/console/command/fixup/recalculate_email_hash.php75
-rw-r--r--phpBB/phpbb/console/command/fixup/update_hashes.php117
-rw-r--r--phpBB/phpbb/content_visibility.php863
-rw-r--r--phpBB/phpbb/controller/exception.php21
-rw-r--r--phpBB/phpbb/controller/helper.php267
-rw-r--r--phpBB/phpbb/controller/provider.php92
-rw-r--r--phpBB/phpbb/controller/resolver.php175
-rw-r--r--phpBB/phpbb/cron/manager.php147
-rw-r--r--phpBB/phpbb/cron/task/base.php72
-rw-r--r--phpBB/phpbb/cron/task/core/prune_all_forums.php89
-rw-r--r--phpBB/phpbb/cron/task/core/prune_forum.php159
-rw-r--r--phpBB/phpbb/cron/task/core/prune_notifications.php61
-rw-r--r--phpBB/phpbb/cron/task/core/prune_shadow_topics.php200
-rw-r--r--phpBB/phpbb/cron/task/core/queue.php78
-rw-r--r--phpBB/phpbb/cron/task/core/tidy_cache.php72
-rw-r--r--phpBB/phpbb/cron/task/core/tidy_database.php66
-rw-r--r--phpBB/phpbb/cron/task/core/tidy_plupload.php118
-rw-r--r--phpBB/phpbb/cron/task/core/tidy_search.php133
-rw-r--r--phpBB/phpbb/cron/task/core/tidy_sessions.php59
-rw-r--r--phpBB/phpbb/cron/task/core/tidy_warnings.php80
-rw-r--r--phpBB/phpbb/cron/task/core/update_hashes.php130
-rw-r--r--phpBB/phpbb/cron/task/parametrized.php48
-rw-r--r--phpBB/phpbb/cron/task/task.php52
-rw-r--r--phpBB/phpbb/cron/task/wrapper.php106
-rw-r--r--phpBB/phpbb/datetime.php168
-rw-r--r--phpBB/phpbb/db/driver/driver.php1078
-rw-r--r--phpBB/phpbb/db/driver/driver_interface.php453
-rw-r--r--phpBB/phpbb/db/driver/factory.php443
-rw-r--r--phpBB/phpbb/db/driver/mssql.php476
-rw-r--r--phpBB/phpbb/db/driver/mssql_base.php71
-rw-r--r--phpBB/phpbb/db/driver/mssql_odbc.php377
-rw-r--r--phpBB/phpbb/db/driver/mssqlnative.php442
-rw-r--r--phpBB/phpbb/db/driver/mysql.php485
-rw-r--r--phpBB/phpbb/db/driver/mysql_base.php138
-rw-r--r--phpBB/phpbb/db/driver/mysqli.php475
-rw-r--r--phpBB/phpbb/db/driver/oracle.php807
-rw-r--r--phpBB/phpbb/db/driver/postgres.php490
-rw-r--r--phpBB/phpbb/db/driver/sqlite.php378
-rw-r--r--phpBB/phpbb/db/driver/sqlite3.php405
-rw-r--r--phpBB/phpbb/db/html_migrator_output_handler.php48
-rw-r--r--phpBB/phpbb/db/log_wrapper_migrator_output_handler.php95
-rw-r--r--phpBB/phpbb/db/migration/container_aware_migration.php36
-rw-r--r--phpBB/phpbb/db/migration/data/v30x/.htaccess33
-rw-r--r--phpBB/phpbb/db/migration/data/v30x/local_url_bbcode.php70
-rw-r--r--phpBB/phpbb/db/migration/data/v30x/release_3_0_0.php1181
-rw-r--r--phpBB/phpbb/db/migration/data/v30x/release_3_0_1.php34
-rw-r--r--phpBB/phpbb/db/migration/data/v30x/release_3_0_10.php34
-rw-r--r--phpBB/phpbb/db/migration/data/v30x/release_3_0_10_rc1.php36
-rw-r--r--phpBB/phpbb/db/migration/data/v30x/release_3_0_10_rc2.php34
-rw-r--r--phpBB/phpbb/db/migration/data/v30x/release_3_0_10_rc3.php34
-rw-r--r--phpBB/phpbb/db/migration/data/v30x/release_3_0_11.php34
-rw-r--r--phpBB/phpbb/db/migration/data/v30x/release_3_0_11_rc1.php101
-rw-r--r--phpBB/phpbb/db/migration/data/v30x/release_3_0_11_rc2.php56
-rw-r--r--phpBB/phpbb/db/migration/data/v30x/release_3_0_12.php37
-rw-r--r--phpBB/phpbb/db/migration/data/v30x/release_3_0_12_rc1.php72
-rw-r--r--phpBB/phpbb/db/migration/data/v30x/release_3_0_12_rc2.php37
-rw-r--r--phpBB/phpbb/db/migration/data/v30x/release_3_0_12_rc3.php37
-rw-r--r--phpBB/phpbb/db/migration/data/v30x/release_3_0_13.php37
-rw-r--r--phpBB/phpbb/db/migration/data/v30x/release_3_0_13_pl1.php37
-rw-r--r--phpBB/phpbb/db/migration/data/v30x/release_3_0_13_rc1.php37
-rw-r--r--phpBB/phpbb/db/migration/data/v30x/release_3_0_14.php37
-rw-r--r--phpBB/phpbb/db/migration/data/v30x/release_3_0_14_rc1.php37
-rw-r--r--phpBB/phpbb/db/migration/data/v30x/release_3_0_1_rc1.php119
-rw-r--r--phpBB/phpbb/db/migration/data/v30x/release_3_0_2.php34
-rw-r--r--phpBB/phpbb/db/migration/data/v30x/release_3_0_2_rc1.php38
-rw-r--r--phpBB/phpbb/db/migration/data/v30x/release_3_0_2_rc2.php86
-rw-r--r--phpBB/phpbb/db/migration/data/v30x/release_3_0_3.php34
-rw-r--r--phpBB/phpbb/db/migration/data/v30x/release_3_0_3_rc1.php89
-rw-r--r--phpBB/phpbb/db/migration/data/v30x/release_3_0_4.php55
-rw-r--r--phpBB/phpbb/db/migration/data/v30x/release_3_0_4_rc1.php129
-rw-r--r--phpBB/phpbb/db/migration/data/v30x/release_3_0_5.php34
-rw-r--r--phpBB/phpbb/db/migration/data/v30x/release_3_0_5_rc1.php133
-rw-r--r--phpBB/phpbb/db/migration/data/v30x/release_3_0_5_rc1part2.php48
-rw-r--r--phpBB/phpbb/db/migration/data/v30x/release_3_0_6.php34
-rw-r--r--phpBB/phpbb/db/migration/data/v30x/release_3_0_6_rc1.php330
-rw-r--r--phpBB/phpbb/db/migration/data/v30x/release_3_0_6_rc2.php34
-rw-r--r--phpBB/phpbb/db/migration/data/v30x/release_3_0_6_rc3.php46
-rw-r--r--phpBB/phpbb/db/migration/data/v30x/release_3_0_6_rc4.php34
-rw-r--r--phpBB/phpbb/db/migration/data/v30x/release_3_0_7.php34
-rw-r--r--phpBB/phpbb/db/migration/data/v30x/release_3_0_7_pl1.php34
-rw-r--r--phpBB/phpbb/db/migration/data/v30x/release_3_0_7_rc1.php82
-rw-r--r--phpBB/phpbb/db/migration/data/v30x/release_3_0_7_rc2.php79
-rw-r--r--phpBB/phpbb/db/migration/data/v30x/release_3_0_8.php34
-rw-r--r--phpBB/phpbb/db/migration/data/v30x/release_3_0_8_rc1.php162
-rw-r--r--phpBB/phpbb/db/migration/data/v30x/release_3_0_9.php34
-rw-r--r--phpBB/phpbb/db/migration/data/v30x/release_3_0_9_rc1.php130
-rw-r--r--phpBB/phpbb/db/migration/data/v30x/release_3_0_9_rc2.php34
-rw-r--r--phpBB/phpbb/db/migration/data/v30x/release_3_0_9_rc3.php34
-rw-r--r--phpBB/phpbb/db/migration/data/v30x/release_3_0_9_rc4.php34
-rw-r--r--phpBB/phpbb/db/migration/data/v310/.htaccess33
-rw-r--r--phpBB/phpbb/db/migration/data/v310/acp_prune_users_module.php81
-rw-r--r--phpBB/phpbb/db/migration/data/v310/acp_style_components_module.php46
-rw-r--r--phpBB/phpbb/db/migration/data/v310/allow_cdn.php37
-rw-r--r--phpBB/phpbb/db/migration/data/v310/alpha1.php53
-rw-r--r--phpBB/phpbb/db/migration/data/v310/alpha2.php37
-rw-r--r--phpBB/phpbb/db/migration/data/v310/alpha3.php39
-rw-r--r--phpBB/phpbb/db/migration/data/v310/auth_provider_oauth.php77
-rw-r--r--phpBB/phpbb/db/migration/data/v310/auth_provider_oauth2.php44
-rw-r--r--phpBB/phpbb/db/migration/data/v310/avatar_types.php64
-rw-r--r--phpBB/phpbb/db/migration/data/v310/avatars.php95
-rw-r--r--phpBB/phpbb/db/migration/data/v310/beta1.php42
-rw-r--r--phpBB/phpbb/db/migration/data/v310/beta2.php38
-rw-r--r--phpBB/phpbb/db/migration/data/v310/beta3.php41
-rw-r--r--phpBB/phpbb/db/migration/data/v310/beta4.php38
-rw-r--r--phpBB/phpbb/db/migration/data/v310/board_contact_name.php34
-rw-r--r--phpBB/phpbb/db/migration/data/v310/boardindex.php29
-rw-r--r--phpBB/phpbb/db/migration/data/v310/bot_update.php150
-rw-r--r--phpBB/phpbb/db/migration/data/v310/captcha_plugins.php48
-rw-r--r--phpBB/phpbb/db/migration/data/v310/config_db_text.php51
-rw-r--r--phpBB/phpbb/db/migration/data/v310/contact_admin_acp_module.php31
-rw-r--r--phpBB/phpbb/db/migration/data/v310/contact_admin_form.php46
-rw-r--r--phpBB/phpbb/db/migration/data/v310/dev.php415
-rw-r--r--phpBB/phpbb/db/migration/data/v310/extensions.php75
-rw-r--r--phpBB/phpbb/db/migration/data/v310/extensions_version_check_force_unstable.php29
-rw-r--r--phpBB/phpbb/db/migration/data/v310/forgot_password.php34
-rw-r--r--phpBB/phpbb/db/migration/data/v310/gold.php37
-rw-r--r--phpBB/phpbb/db/migration/data/v310/jquery_update.php37
-rw-r--r--phpBB/phpbb/db/migration/data/v310/jquery_update2.php37
-rw-r--r--phpBB/phpbb/db/migration/data/v310/live_searches_config.php29
-rw-r--r--phpBB/phpbb/db/migration/data/v310/migrations_table.php51
-rw-r--r--phpBB/phpbb/db/migration/data/v310/mod_rewrite.php31
-rw-r--r--phpBB/phpbb/db/migration/data/v310/mysql_fulltext_drop.php80
-rw-r--r--phpBB/phpbb/db/migration/data/v310/namespaces.php34
-rw-r--r--phpBB/phpbb/db/migration/data/v310/notification_options_reconvert.php142
-rw-r--r--phpBB/phpbb/db/migration/data/v310/notifications.php102
-rw-r--r--phpBB/phpbb/db/migration/data/v310/notifications_cron.php31
-rw-r--r--phpBB/phpbb/db/migration/data/v310/notifications_cron_p2.php31
-rw-r--r--phpBB/phpbb/db/migration/data/v310/notifications_schema_fix.php98
-rw-r--r--phpBB/phpbb/db/migration/data/v310/notifications_use_full_name.php184
-rw-r--r--phpBB/phpbb/db/migration/data/v310/passwords.php50
-rw-r--r--phpBB/phpbb/db/migration/data/v310/passwords_convert_p1.php81
-rw-r--r--phpBB/phpbb/db/migration/data/v310/passwords_convert_p2.php49
-rw-r--r--phpBB/phpbb/db/migration/data/v310/passwords_p2.php44
-rw-r--r--phpBB/phpbb/db/migration/data/v310/plupload.php36
-rw-r--r--phpBB/phpbb/db/migration/data/v310/postgres_fulltext_drop.php80
-rw-r--r--phpBB/phpbb/db/migration/data/v310/profilefield_aol.php55
-rw-r--r--phpBB/phpbb/db/migration/data/v310/profilefield_aol_cleanup.php51
-rw-r--r--phpBB/phpbb/db/migration/data/v310/profilefield_change_load_settings.php34
-rw-r--r--phpBB/phpbb/db/migration/data/v310/profilefield_cleanup.php55
-rw-r--r--phpBB/phpbb/db/migration/data/v310/profilefield_contact_field.php55
-rw-r--r--phpBB/phpbb/db/migration/data/v310/profilefield_facebook.php61
-rw-r--r--phpBB/phpbb/db/migration/data/v310/profilefield_field_validation_length.php90
-rw-r--r--phpBB/phpbb/db/migration/data/v310/profilefield_googleplus.php61
-rw-r--r--phpBB/phpbb/db/migration/data/v310/profilefield_icq.php54
-rw-r--r--phpBB/phpbb/db/migration/data/v310/profilefield_icq_cleanup.php51
-rw-r--r--phpBB/phpbb/db/migration/data/v310/profilefield_interests.php52
-rw-r--r--phpBB/phpbb/db/migration/data/v310/profilefield_location.php52
-rw-r--r--phpBB/phpbb/db/migration/data/v310/profilefield_location_cleanup.php51
-rw-r--r--phpBB/phpbb/db/migration/data/v310/profilefield_occupation.php51
-rw-r--r--phpBB/phpbb/db/migration/data/v310/profilefield_on_memberlist.php51
-rw-r--r--phpBB/phpbb/db/migration/data/v310/profilefield_show_novalue.php49
-rw-r--r--phpBB/phpbb/db/migration/data/v310/profilefield_skype.php61
-rw-r--r--phpBB/phpbb/db/migration/data/v310/profilefield_twitter.php61
-rw-r--r--phpBB/phpbb/db/migration/data/v310/profilefield_types.php110
-rw-r--r--phpBB/phpbb/db/migration/data/v310/profilefield_website.php56
-rw-r--r--phpBB/phpbb/db/migration/data/v310/profilefield_website_cleanup.php51
-rw-r--r--phpBB/phpbb/db/migration/data/v310/profilefield_wlm.php55
-rw-r--r--phpBB/phpbb/db/migration/data/v310/profilefield_wlm_cleanup.php51
-rw-r--r--phpBB/phpbb/db/migration/data/v310/profilefield_yahoo.php55
-rw-r--r--phpBB/phpbb/db/migration/data/v310/profilefield_yahoo_cleanup.php51
-rw-r--r--phpBB/phpbb/db/migration/data/v310/profilefield_youtube.php61
-rw-r--r--phpBB/phpbb/db/migration/data/v310/prune_shadow_topics.php50
-rw-r--r--phpBB/phpbb/db/migration/data/v310/rc1.php44
-rw-r--r--phpBB/phpbb/db/migration/data/v310/rc2.php36
-rw-r--r--phpBB/phpbb/db/migration/data/v310/rc3.php40
-rw-r--r--phpBB/phpbb/db/migration/data/v310/rc4.php37
-rw-r--r--phpBB/phpbb/db/migration/data/v310/rc5.php38
-rw-r--r--phpBB/phpbb/db/migration/data/v310/rc6.php36
-rw-r--r--phpBB/phpbb/db/migration/data/v310/remove_acp_styles_cache.php51
-rw-r--r--phpBB/phpbb/db/migration/data/v310/rename_too_long_indexes.php38
-rw-r--r--phpBB/phpbb/db/migration/data/v310/reported_posts_display.php53
-rw-r--r--phpBB/phpbb/db/migration/data/v310/reset_missing_captcha_plugin.php38
-rw-r--r--phpBB/phpbb/db/migration/data/v310/search_type.php34
-rw-r--r--phpBB/phpbb/db/migration/data/v310/signature_module_auth.php57
-rw-r--r--phpBB/phpbb/db/migration/data/v310/soft_delete_mod_convert.php127
-rw-r--r--phpBB/phpbb/db/migration/data/v310/soft_delete_mod_convert2.php66
-rw-r--r--phpBB/phpbb/db/migration/data/v310/softdelete_mcp_modules.php61
-rw-r--r--phpBB/phpbb/db/migration/data/v310/softdelete_p1.php211
-rw-r--r--phpBB/phpbb/db/migration/data/v310/softdelete_p2.php78
-rw-r--r--phpBB/phpbb/db/migration/data/v310/style_update_p1.php191
-rw-r--r--phpBB/phpbb/db/migration/data/v310/style_update_p2.php151
-rw-r--r--phpBB/phpbb/db/migration/data/v310/teampage.php110
-rw-r--r--phpBB/phpbb/db/migration/data/v310/timezone.php194
-rw-r--r--phpBB/phpbb/db/migration/data/v310/timezone_p2.php49
-rw-r--r--phpBB/phpbb/db/migration/data/v310/topic_sort_username.php44
-rw-r--r--phpBB/phpbb/db/migration/data/v310/ucp_popuppm_module.php46
-rw-r--r--phpBB/phpbb/db/migration/data/v31x/.htaccess33
-rw-r--r--phpBB/phpbb/db/migration/data/v31x/add_jabber_ssl_context_config_options.php32
-rw-r--r--phpBB/phpbb/db/migration/data/v31x/add_latest_topics_index.php51
-rw-r--r--phpBB/phpbb/db/migration/data/v31x/add_log_time_index.php46
-rw-r--r--phpBB/phpbb/db/migration/data/v31x/add_smtp_ssl_context_config_options.php32
-rw-r--r--phpBB/phpbb/db/migration/data/v31x/increase_size_of_dateformat.php35
-rw-r--r--phpBB/phpbb/db/migration/data/v31x/increase_size_of_emotion.php46
-rw-r--r--phpBB/phpbb/db/migration/data/v31x/m_pm_report.php64
-rw-r--r--phpBB/phpbb/db/migration/data/v31x/m_softdelete_global.php31
-rw-r--r--phpBB/phpbb/db/migration/data/v31x/plupload_last_gc_dynamic.php31
-rw-r--r--phpBB/phpbb/db/migration/data/v31x/profilefield_remove_underscore_from_alpha.php47
-rw-r--r--phpBB/phpbb/db/migration/data/v31x/profilefield_yahoo_update_url.php38
-rw-r--r--phpBB/phpbb/db/migration/data/v31x/remove_duplicate_migrations.php77
-rw-r--r--phpBB/phpbb/db/migration/data/v31x/style_update.php136
-rw-r--r--phpBB/phpbb/db/migration/data/v31x/update_custom_bbcodes_with_idn.php70
-rw-r--r--phpBB/phpbb/db/migration/data/v31x/update_hashes.php33
-rw-r--r--phpBB/phpbb/db/migration/data/v31x/v311.php37
-rw-r--r--phpBB/phpbb/db/migration/data/v31x/v3110.php36
-rw-r--r--phpBB/phpbb/db/migration/data/v31x/v3110rc1.php36
-rw-r--r--phpBB/phpbb/db/migration/data/v31x/v3111.php36
-rw-r--r--phpBB/phpbb/db/migration/data/v31x/v3111rc1.php43
-rw-r--r--phpBB/phpbb/db/migration/data/v31x/v312.php36
-rw-r--r--phpBB/phpbb/db/migration/data/v31x/v312rc1.php37
-rw-r--r--phpBB/phpbb/db/migration/data/v31x/v313.php36
-rw-r--r--phpBB/phpbb/db/migration/data/v31x/v313rc1.php40
-rw-r--r--phpBB/phpbb/db/migration/data/v31x/v313rc2.php37
-rw-r--r--phpBB/phpbb/db/migration/data/v31x/v314.php37
-rw-r--r--phpBB/phpbb/db/migration/data/v31x/v314rc1.php36
-rw-r--r--phpBB/phpbb/db/migration/data/v31x/v314rc2.php37
-rw-r--r--phpBB/phpbb/db/migration/data/v31x/v315.php36
-rw-r--r--phpBB/phpbb/db/migration/data/v31x/v315rc1.php36
-rw-r--r--phpBB/phpbb/db/migration/data/v31x/v316.php36
-rw-r--r--phpBB/phpbb/db/migration/data/v31x/v316rc1.php36
-rw-r--r--phpBB/phpbb/db/migration/data/v31x/v317.php36
-rw-r--r--phpBB/phpbb/db/migration/data/v31x/v317pl1.php36
-rw-r--r--phpBB/phpbb/db/migration/data/v31x/v317rc1.php37
-rw-r--r--phpBB/phpbb/db/migration/data/v31x/v318.php36
-rw-r--r--phpBB/phpbb/db/migration/data/v31x/v318rc1.php37
-rw-r--r--phpBB/phpbb/db/migration/data/v31x/v319.php36
-rw-r--r--phpBB/phpbb/db/migration/data/v31x/v319rc1.php36
-rw-r--r--phpBB/phpbb/db/migration/exception.php75
-rw-r--r--phpBB/phpbb/db/migration/helper.php116
-rw-r--r--phpBB/phpbb/db/migration/migration.php186
-rw-r--r--phpBB/phpbb/db/migration/profilefield_base_migration.php247
-rw-r--r--phpBB/phpbb/db/migration/schema_generator.php235
-rw-r--r--phpBB/phpbb/db/migration/tool/config.php165
-rw-r--r--phpBB/phpbb/db/migration/tool/config_text.php130
-rw-r--r--phpBB/phpbb/db/migration/tool/module.php563
-rw-r--r--phpBB/phpbb/db/migration/tool/permission.php652
-rw-r--r--phpBB/phpbb/db/migration/tool/tool_interface.php37
-rw-r--r--phpBB/phpbb/db/migrator.php924
-rw-r--r--phpBB/phpbb/db/migrator_output_handler_interface.php31
-rw-r--r--phpBB/phpbb/db/null_migrator_output_handler.php24
-rw-r--r--phpBB/phpbb/db/sql_insert_buffer.php146
-rw-r--r--phpBB/phpbb/db/tools.php2840
-rw-r--r--phpBB/phpbb/di/container_builder.php418
-rw-r--r--phpBB/phpbb/di/extension/config.php83
-rw-r--r--phpBB/phpbb/di/extension/core.php67
-rw-r--r--phpBB/phpbb/di/extension/ext.php67
-rw-r--r--phpBB/phpbb/di/pass/collection_pass.php44
-rw-r--r--phpBB/phpbb/di/service_collection.php79
-rw-r--r--phpBB/phpbb/di/service_collection_iterator.php46
-rw-r--r--phpBB/phpbb/error_collector.php73
-rw-r--r--phpBB/phpbb/event/data.php66
-rw-r--r--phpBB/phpbb/event/dispatcher.php78
-rw-r--r--phpBB/phpbb/event/dispatcher_interface.php50
-rw-r--r--phpBB/phpbb/event/kernel_exception_subscriber.php123
-rw-r--r--phpBB/phpbb/event/kernel_request_subscriber.php82
-rw-r--r--phpBB/phpbb/event/kernel_terminate_subscriber.php41
-rw-r--r--phpBB/phpbb/event/md_exporter.php565
-rw-r--r--phpBB/phpbb/event/php_exporter.php718
-rw-r--r--phpBB/phpbb/event/recursive_event_filter_iterator.php71
-rw-r--r--phpBB/phpbb/exception/exception_interface.php29
-rw-r--r--phpBB/phpbb/exception/http_exception.php70
-rw-r--r--phpBB/phpbb/exception/runtime_exception.php52
-rw-r--r--phpBB/phpbb/extension/base.php142
-rw-r--r--phpBB/phpbb/extension/exception.php25
-rw-r--r--phpBB/phpbb/extension/extension_interface.php70
-rw-r--r--phpBB/phpbb/extension/manager.php592
-rw-r--r--phpBB/phpbb/extension/metadata_manager.php343
-rw-r--r--phpBB/phpbb/extension/provider.php72
-rw-r--r--phpBB/phpbb/feed/attachments_base.php97
-rw-r--r--phpBB/phpbb/feed/base.php296
-rw-r--r--phpBB/phpbb/feed/factory.php127
-rw-r--r--phpBB/phpbb/feed/forum.php146
-rw-r--r--phpBB/phpbb/feed/forums.php68
-rw-r--r--phpBB/phpbb/feed/helper.php179
-rw-r--r--phpBB/phpbb/feed/news.php109
-rw-r--r--phpBB/phpbb/feed/overall.php88
-rw-r--r--phpBB/phpbb/feed/post_base.php55
-rw-r--r--phpBB/phpbb/feed/topic.php123
-rw-r--r--phpBB/phpbb/feed/topic_base.php70
-rw-r--r--phpBB/phpbb/feed/topics.php88
-rw-r--r--phpBB/phpbb/feed/topics_active.php133
-rw-r--r--phpBB/phpbb/file_downloader.php120
-rw-r--r--phpBB/phpbb/filesystem.php50
-rw-r--r--phpBB/phpbb/finder.php547
-rw-r--r--phpBB/phpbb/groupposition/exception.php18
-rw-r--r--phpBB/phpbb/groupposition/groupposition_interface.php80
-rw-r--r--phpBB/phpbb/groupposition/legend.php243
-rw-r--r--phpBB/phpbb/groupposition/teampage.php597
-rw-r--r--phpBB/phpbb/hook/finder.php80
-rw-r--r--phpBB/phpbb/json_response.php38
-rw-r--r--phpBB/phpbb/lock/db.php146
-rw-r--r--phpBB/phpbb/lock/flock.php141
-rw-r--r--phpBB/phpbb/log/log.php982
-rw-r--r--phpBB/phpbb/log/log_interface.php114
-rw-r--r--phpBB/phpbb/log/null.php81
-rw-r--r--phpBB/phpbb/message/admin_form.php192
-rw-r--r--phpBB/phpbb/message/form.php175
-rw-r--r--phpBB/phpbb/message/message.php282
-rw-r--r--phpBB/phpbb/message/topic_form.php158
-rw-r--r--phpBB/phpbb/message/user_form.php136
-rw-r--r--phpBB/phpbb/mimetype/content_guesser.php33
-rw-r--r--phpBB/phpbb/mimetype/extension_guesser.php509
-rw-r--r--phpBB/phpbb/mimetype/guesser.php156
-rw-r--r--phpBB/phpbb/mimetype/guesser_base.php38
-rw-r--r--phpBB/phpbb/mimetype/guesser_interface.php50
-rw-r--r--phpBB/phpbb/notification/exception.php26
-rw-r--r--phpBB/phpbb/notification/manager.php990
-rw-r--r--phpBB/phpbb/notification/method/base.php113
-rw-r--r--phpBB/phpbb/notification/method/email.php49
-rw-r--r--phpBB/phpbb/notification/method/jabber.php66
-rw-r--r--phpBB/phpbb/notification/method/messenger_base.php96
-rw-r--r--phpBB/phpbb/notification/method/method_interface.php45
-rw-r--r--phpBB/phpbb/notification/type/admin_activate_user.php169
-rw-r--r--phpBB/phpbb/notification/type/approve_post.php146
-rw-r--r--phpBB/phpbb/notification/type/approve_topic.php136
-rw-r--r--phpBB/phpbb/notification/type/base.php569
-rw-r--r--phpBB/phpbb/notification/type/bookmark.php132
-rw-r--r--phpBB/phpbb/notification/type/disapprove_post.php156
-rw-r--r--phpBB/phpbb/notification/type/disapprove_topic.php156
-rw-r--r--phpBB/phpbb/notification/type/group_request.php161
-rw-r--r--phpBB/phpbb/notification/type/group_request_approved.php116
-rw-r--r--phpBB/phpbb/notification/type/pm.php195
-rw-r--r--phpBB/phpbb/notification/type/post.php452
-rw-r--r--phpBB/phpbb/notification/type/post_in_queue.php160
-rw-r--r--phpBB/phpbb/notification/type/quote.php190
-rw-r--r--phpBB/phpbb/notification/type/report_pm.php259
-rw-r--r--phpBB/phpbb/notification/type/report_pm_closed.php165
-rw-r--r--phpBB/phpbb/notification/type/report_post.php230
-rw-r--r--phpBB/phpbb/notification/type/report_post_closed.php172
-rw-r--r--phpBB/phpbb/notification/type/topic.php295
-rw-r--r--phpBB/phpbb/notification/type/topic_in_queue.php152
-rw-r--r--phpBB/phpbb/notification/type/type_interface.php214
-rw-r--r--phpBB/phpbb/pagination.php357
-rw-r--r--phpBB/phpbb/passwords/driver/base.php62
-rw-r--r--phpBB/phpbb/passwords/driver/bcrypt.php105
-rw-r--r--phpBB/phpbb/passwords/driver/bcrypt_2y.php35
-rw-r--r--phpBB/phpbb/passwords/driver/bcrypt_wcf2.php84
-rw-r--r--phpBB/phpbb/passwords/driver/convert_password.php43
-rw-r--r--phpBB/phpbb/passwords/driver/driver_interface.php69
-rw-r--r--phpBB/phpbb/passwords/driver/helper.php177
-rw-r--r--phpBB/phpbb/passwords/driver/md5_mybb.php60
-rw-r--r--phpBB/phpbb/passwords/driver/md5_phpbb2.php123
-rw-r--r--phpBB/phpbb/passwords/driver/md5_vb.php60
-rw-r--r--phpBB/phpbb/passwords/driver/phpass.php27
-rw-r--r--phpBB/phpbb/passwords/driver/salted_md5.php169
-rw-r--r--phpBB/phpbb/passwords/driver/sha1.php52
-rw-r--r--phpBB/phpbb/passwords/driver/sha1_smf.php51
-rw-r--r--phpBB/phpbb/passwords/driver/sha1_wcf1.php60
-rw-r--r--phpBB/phpbb/passwords/driver/sha_xf1.php68
-rw-r--r--phpBB/phpbb/passwords/helper.php104
-rw-r--r--phpBB/phpbb/passwords/manager.php366
-rw-r--r--phpBB/phpbb/path_helper.php492
-rw-r--r--phpBB/phpbb/permissions.php362
-rw-r--r--phpBB/phpbb/php/ini.php171
-rw-r--r--phpBB/phpbb/plupload/plupload.php402
-rw-r--r--phpBB/phpbb/profilefields/lang_helper.php140
-rw-r--r--phpBB/phpbb/profilefields/manager.php502
-rw-r--r--phpBB/phpbb/profilefields/type/type_base.php206
-rw-r--r--phpBB/phpbb/profilefields/type/type_bool.php415
-rw-r--r--phpBB/phpbb/profilefields/type/type_date.php374
-rw-r--r--phpBB/phpbb/profilefields/type/type_dropdown.php325
-rw-r--r--phpBB/phpbb/profilefields/type/type_googleplus.php66
-rw-r--r--phpBB/phpbb/profilefields/type/type_int.php249
-rw-r--r--phpBB/phpbb/profilefields/type/type_interface.php226
-rw-r--r--phpBB/phpbb/profilefields/type/type_string.php159
-rw-r--r--phpBB/phpbb/profilefields/type/type_string_common.php147
-rw-r--r--phpBB/phpbb/profilefields/type/type_text.php204
-rw-r--r--phpBB/phpbb/profilefields/type/type_url.php74
-rw-r--r--phpBB/phpbb/recursive_dot_prefix_filter_iterator.php30
-rw-r--r--phpBB/phpbb/request/deactivated_super_global.php116
-rw-r--r--phpBB/phpbb/request/request.php438
-rw-r--r--phpBB/phpbb/request/request_interface.php155
-rw-r--r--phpBB/phpbb/request/type_cast_helper.php190
-rw-r--r--phpBB/phpbb/request/type_cast_helper_interface.php59
-rw-r--r--phpBB/phpbb/search/base.php292
-rw-r--r--phpBB/phpbb/search/fulltext_mysql.php1141
-rw-r--r--phpBB/phpbb/search/fulltext_native.php1996
-rw-r--r--phpBB/phpbb/search/fulltext_postgres.php1106
-rw-r--r--phpBB/phpbb/search/fulltext_sphinx.php973
-rw-r--r--phpBB/phpbb/search/index.htm10
-rw-r--r--phpBB/phpbb/search/sphinx/config.php284
-rw-r--r--phpBB/phpbb/search/sphinx/config_comment.php47
-rw-r--r--phpBB/phpbb/search/sphinx/config_section.php160
-rw-r--r--phpBB/phpbb/search/sphinx/config_variable.php78
-rw-r--r--phpBB/phpbb/session.php1617
-rw-r--r--phpBB/phpbb/symfony_request.php39
-rw-r--r--phpBB/phpbb/template/asset.php205
-rw-r--r--phpBB/phpbb/template/base.php164
-rw-r--r--phpBB/phpbb/template/context.php540
-rw-r--r--phpBB/phpbb/template/template.php199
-rw-r--r--phpBB/phpbb/template/twig/definition.php69
-rw-r--r--phpBB/phpbb/template/twig/environment.php205
-rw-r--r--phpBB/phpbb/template/twig/extension.php184
-rw-r--r--phpBB/phpbb/template/twig/lexer.php354
-rw-r--r--phpBB/phpbb/template/twig/loader.php148
-rw-r--r--phpBB/phpbb/template/twig/node/definenode.php57
-rw-r--r--phpBB/phpbb/template/twig/node/event.php82
-rw-r--r--phpBB/phpbb/template/twig/node/expression/binary/equalequal.php22
-rw-r--r--phpBB/phpbb/template/twig/node/expression/binary/notequalequal.php22
-rw-r--r--phpBB/phpbb/template/twig/node/includeasset.php81
-rw-r--r--phpBB/phpbb/template/twig/node/includecss.php37
-rw-r--r--phpBB/phpbb/template/twig/node/includejs.php39
-rw-r--r--phpBB/phpbb/template/twig/node/includenode.php53
-rw-r--r--phpBB/phpbb/template/twig/node/includephp.php91
-rw-r--r--phpBB/phpbb/template/twig/node/php.php52
-rw-r--r--phpBB/phpbb/template/twig/tokenparser/defineparser.php76
-rw-r--r--phpBB/phpbb/template/twig/tokenparser/event.php44
-rw-r--r--phpBB/phpbb/template/twig/tokenparser/includecss.php44
-rw-r--r--phpBB/phpbb/template/twig/tokenparser/includejs.php44
-rw-r--r--phpBB/phpbb/template/twig/tokenparser/includeparser.php44
-rw-r--r--phpBB/phpbb/template/twig/tokenparser/includephp.php55
-rw-r--r--phpBB/phpbb/template/twig/tokenparser/php.php52
-rw-r--r--phpBB/phpbb/template/twig/twig.php389
-rw-r--r--phpBB/phpbb/tree/nestedset.php877
-rw-r--r--phpBB/phpbb/tree/nestedset_forum.php44
-rw-r--r--phpBB/phpbb/tree/tree_interface.php120
-rw-r--r--phpBB/phpbb/user.php936
-rw-r--r--phpBB/phpbb/user_loader.php229
-rw-r--r--phpBB/phpbb/version_helper.php520
-rw-r--r--phpBB/phpbb/viewonline_helper.php54
-rw-r--r--phpBB/posting.php776
-rw-r--r--phpBB/report.php90
-rw-r--r--phpBB/search.php653
-rw-r--r--phpBB/style.php293
-rw-r--r--phpBB/styles/prosilver/imageset/announce_read.gifbin754 -> 0 bytes
-rw-r--r--phpBB/styles/prosilver/imageset/announce_read_mine.gifbin750 -> 0 bytes
-rw-r--r--phpBB/styles/prosilver/imageset/announce_unread.gifbin756 -> 0 bytes
-rw-r--r--phpBB/styles/prosilver/imageset/announce_unread_mine.gifbin791 -> 0 bytes
-rw-r--r--phpBB/styles/prosilver/imageset/en/button_pm_forward.gifbin2168 -> 0 bytes
-rw-r--r--phpBB/styles/prosilver/imageset/en/button_pm_new.gifbin2005 -> 0 bytes
-rw-r--r--phpBB/styles/prosilver/imageset/en/button_pm_reply.gifbin2126 -> 0 bytes
-rw-r--r--phpBB/styles/prosilver/imageset/en/button_topic_locked.gifbin1923 -> 0 bytes
-rw-r--r--phpBB/styles/prosilver/imageset/en/button_topic_new.gifbin2737 -> 0 bytes
-rw-r--r--phpBB/styles/prosilver/imageset/en/button_topic_reply.gifbin2135 -> 0 bytes
-rw-r--r--phpBB/styles/prosilver/imageset/en/icon_contact_pm.gifbin677 -> 0 bytes
-rw-r--r--phpBB/styles/prosilver/imageset/en/icon_post_edit.gifbin853 -> 0 bytes
-rw-r--r--phpBB/styles/prosilver/imageset/en/icon_post_quote.gifbin1109 -> 0 bytes
-rw-r--r--phpBB/styles/prosilver/imageset/en/imageset.cfg35
-rw-r--r--phpBB/styles/prosilver/imageset/forum_link.gifbin734 -> 0 bytes
-rw-r--r--phpBB/styles/prosilver/imageset/forum_read.gifbin688 -> 0 bytes
-rw-r--r--phpBB/styles/prosilver/imageset/forum_read_locked.gifbin707 -> 0 bytes
-rw-r--r--phpBB/styles/prosilver/imageset/forum_read_subforum.gifbin751 -> 0 bytes
-rw-r--r--phpBB/styles/prosilver/imageset/forum_unread.gifbin693 -> 0 bytes
-rw-r--r--phpBB/styles/prosilver/imageset/forum_unread_subforum.gifbin751 -> 0 bytes
-rw-r--r--phpBB/styles/prosilver/imageset/icon_contact_aim.gifbin546 -> 0 bytes
-rw-r--r--phpBB/styles/prosilver/imageset/icon_contact_email.gifbin523 -> 0 bytes
-rw-r--r--phpBB/styles/prosilver/imageset/icon_contact_icq.gifbin562 -> 0 bytes
-rw-r--r--phpBB/styles/prosilver/imageset/icon_contact_jabber.gifbin1014 -> 0 bytes
-rw-r--r--phpBB/styles/prosilver/imageset/icon_contact_msnm.gifbin588 -> 0 bytes
-rw-r--r--phpBB/styles/prosilver/imageset/icon_contact_www.gifbin590 -> 0 bytes
-rw-r--r--phpBB/styles/prosilver/imageset/icon_contact_yahoo.gifbin541 -> 0 bytes
-rw-r--r--phpBB/styles/prosilver/imageset/icon_offline.gifbin384 -> 0 bytes
-rw-r--r--phpBB/styles/prosilver/imageset/icon_online.gifbin393 -> 0 bytes
-rw-r--r--phpBB/styles/prosilver/imageset/icon_post_delete.gifbin528 -> 0 bytes
-rw-r--r--phpBB/styles/prosilver/imageset/icon_post_info.gifbin501 -> 0 bytes
-rw-r--r--phpBB/styles/prosilver/imageset/icon_post_report.gifbin474 -> 0 bytes
-rw-r--r--phpBB/styles/prosilver/imageset/icon_post_target.gifbin186 -> 0 bytes
-rw-r--r--phpBB/styles/prosilver/imageset/icon_post_target_unread.gifbin151 -> 0 bytes
-rw-r--r--phpBB/styles/prosilver/imageset/icon_topic_attach.gifbin144 -> 0 bytes
-rw-r--r--phpBB/styles/prosilver/imageset/icon_topic_latest.gifbin186 -> 0 bytes
-rw-r--r--phpBB/styles/prosilver/imageset/icon_topic_newest.gifbin155 -> 0 bytes
-rw-r--r--phpBB/styles/prosilver/imageset/icon_user_warn.gifbin481 -> 0 bytes
-rw-r--r--phpBB/styles/prosilver/imageset/imageset.cfg116
-rw-r--r--phpBB/styles/prosilver/imageset/sticky_read.gifbin651 -> 0 bytes
-rw-r--r--phpBB/styles/prosilver/imageset/sticky_read_mine.gifbin659 -> 0 bytes
-rw-r--r--phpBB/styles/prosilver/imageset/sticky_unread.gifbin648 -> 0 bytes
-rw-r--r--phpBB/styles/prosilver/imageset/sticky_unread_mine.gifbin669 -> 0 bytes
-rw-r--r--phpBB/styles/prosilver/imageset/topic_moved.gifbin693 -> 0 bytes
-rw-r--r--phpBB/styles/prosilver/imageset/topic_read.gifbin679 -> 0 bytes
-rw-r--r--phpBB/styles/prosilver/imageset/topic_read_locked.gifbin748 -> 0 bytes
-rw-r--r--phpBB/styles/prosilver/imageset/topic_read_locked_mine.gifbin749 -> 0 bytes
-rw-r--r--phpBB/styles/prosilver/imageset/topic_read_mine.gifbin695 -> 0 bytes
-rw-r--r--phpBB/styles/prosilver/imageset/topic_unread.gifbin678 -> 0 bytes
-rw-r--r--phpBB/styles/prosilver/imageset/topic_unread_locked.gifbin745 -> 0 bytes
-rw-r--r--phpBB/styles/prosilver/imageset/topic_unread_locked_mine.gifbin764 -> 0 bytes
-rw-r--r--phpBB/styles/prosilver/imageset/topic_unread_mine.gifbin704 -> 0 bytes
-rw-r--r--phpBB/styles/prosilver/style.cfg22
-rw-r--r--phpBB/styles/prosilver/template/ajax.js394
-rw-r--r--phpBB/styles/prosilver/template/attachment.html11
-rw-r--r--phpBB/styles/prosilver/template/bbcode.html14
-rw-r--r--phpBB/styles/prosilver/template/captcha_default.html12
-rw-r--r--phpBB/styles/prosilver/template/captcha_qa.html12
-rw-r--r--phpBB/styles/prosilver/template/captcha_recaptcha.html27
-rw-r--r--phpBB/styles/prosilver/template/confirm_body.html25
-rw-r--r--phpBB/styles/prosilver/template/confirm_delete_body.html70
-rw-r--r--phpBB/styles/prosilver/template/custom_profile_fields.html31
-rw-r--r--phpBB/styles/prosilver/template/drafts.html31
-rw-r--r--phpBB/styles/prosilver/template/editor.js459
-rw-r--r--phpBB/styles/prosilver/template/faq_body.html16
-rw-r--r--phpBB/styles/prosilver/template/forum_fn.js1103
-rw-r--r--phpBB/styles/prosilver/template/forumlist_body.html74
-rw-r--r--phpBB/styles/prosilver/template/index_body.html77
-rw-r--r--phpBB/styles/prosilver/template/jumpbox.html57
-rw-r--r--phpBB/styles/prosilver/template/login_body.html30
-rw-r--r--phpBB/styles/prosilver/template/login_body_oauth.html8
-rw-r--r--phpBB/styles/prosilver/template/login_forum.html14
-rw-r--r--phpBB/styles/prosilver/template/mcp_approve.html42
-rw-r--r--phpBB/styles/prosilver/template/mcp_ban.html67
-rw-r--r--phpBB/styles/prosilver/template/mcp_footer.html5
-rw-r--r--phpBB/styles/prosilver/template/mcp_forum.html100
-rw-r--r--phpBB/styles/prosilver/template/mcp_front.html86
-rw-r--r--phpBB/styles/prosilver/template/mcp_header.html32
-rw-r--r--phpBB/styles/prosilver/template/mcp_logs.html63
-rw-r--r--phpBB/styles/prosilver/template/mcp_message.html4
-rw-r--r--phpBB/styles/prosilver/template/mcp_move.html49
-rw-r--r--phpBB/styles/prosilver/template/mcp_notes_front.html8
-rw-r--r--phpBB/styles/prosilver/template/mcp_notes_user.html84
-rw-r--r--phpBB/styles/prosilver/template/mcp_post.html138
-rw-r--r--phpBB/styles/prosilver/template/mcp_queue.html91
-rw-r--r--phpBB/styles/prosilver/template/mcp_reports.html76
-rw-r--r--phpBB/styles/prosilver/template/mcp_topic.html134
-rw-r--r--phpBB/styles/prosilver/template/mcp_viewlogs.html53
-rw-r--r--phpBB/styles/prosilver/template/mcp_warn_front.html26
-rw-r--r--phpBB/styles/prosilver/template/mcp_warn_list.html48
-rw-r--r--phpBB/styles/prosilver/template/mcp_warn_post.html28
-rw-r--r--phpBB/styles/prosilver/template/mcp_warn_user.html24
-rw-r--r--phpBB/styles/prosilver/template/mcp_whois.html10
-rw-r--r--phpBB/styles/prosilver/template/memberlist_body.html113
-rw-r--r--phpBB/styles/prosilver/template/memberlist_email.html74
-rw-r--r--phpBB/styles/prosilver/template/memberlist_im.html136
-rw-r--r--phpBB/styles/prosilver/template/memberlist_leaders.html76
-rw-r--r--phpBB/styles/prosilver/template/memberlist_search.html109
-rw-r--r--phpBB/styles/prosilver/template/memberlist_team.html47
-rw-r--r--phpBB/styles/prosilver/template/memberlist_view.html110
-rw-r--r--phpBB/styles/prosilver/template/message_body.html8
-rw-r--r--phpBB/styles/prosilver/template/navbar_footer.html27
-rw-r--r--phpBB/styles/prosilver/template/navbar_header.html116
-rw-r--r--phpBB/styles/prosilver/template/notification_dropdown.html45
-rw-r--r--phpBB/styles/prosilver/template/overall_footer.html55
-rw-r--r--phpBB/styles/prosilver/template/overall_header.html239
-rw-r--r--phpBB/styles/prosilver/template/pagination.html30
-rw-r--r--phpBB/styles/prosilver/template/plupload.html69
-rw-r--r--phpBB/styles/prosilver/template/posting_attach_body.html80
-rw-r--r--phpBB/styles/prosilver/template/posting_buttons.html75
-rw-r--r--phpBB/styles/prosilver/template/posting_editor.html210
-rw-r--r--phpBB/styles/prosilver/template/posting_layout.html34
-rw-r--r--phpBB/styles/prosilver/template/posting_pm_header.html83
-rw-r--r--phpBB/styles/prosilver/template/posting_pm_layout.html20
-rw-r--r--phpBB/styles/prosilver/template/posting_poll_body.html41
-rw-r--r--phpBB/styles/prosilver/template/posting_preview.html14
-rw-r--r--phpBB/styles/prosilver/template/posting_review.html10
-rw-r--r--phpBB/styles/prosilver/template/posting_smilies.html18
-rw-r--r--phpBB/styles/prosilver/template/posting_topic_review.html41
-rw-r--r--phpBB/styles/prosilver/template/profilefields/bool.html7
-rw-r--r--phpBB/styles/prosilver/template/profilefields/date.html5
-rw-r--r--phpBB/styles/prosilver/template/profilefields/dropdown.html5
-rw-r--r--phpBB/styles/prosilver/template/profilefields/int.html3
-rw-r--r--phpBB/styles/prosilver/template/profilefields/string.html3
-rw-r--r--phpBB/styles/prosilver/template/profilefields/text.html3
-rw-r--r--phpBB/styles/prosilver/template/profilefields/url.html3
-rw-r--r--phpBB/styles/prosilver/template/quickreply_editor.html80
-rw-r--r--phpBB/styles/prosilver/template/report_body.html16
-rw-r--r--phpBB/styles/prosilver/template/search_body.html64
-rw-r--r--phpBB/styles/prosilver/template/search_results.html166
-rw-r--r--phpBB/styles/prosilver/template/simple_footer.html28
-rw-r--r--phpBB/styles/prosilver/template/simple_header.html95
-rw-r--r--phpBB/styles/prosilver/template/styleswitcher.js193
-rw-r--r--phpBB/styles/prosilver/template/template.cfg30
-rw-r--r--phpBB/styles/prosilver/template/timezone.js20
-rw-r--r--phpBB/styles/prosilver/template/timezone_option.html28
-rw-r--r--phpBB/styles/prosilver/template/ucp_agreement.html21
-rw-r--r--phpBB/styles/prosilver/template/ucp_attachments.html57
-rw-r--r--phpBB/styles/prosilver/template/ucp_auth_link.html15
-rw-r--r--phpBB/styles/prosilver/template/ucp_auth_link_oauth.html29
-rw-r--r--phpBB/styles/prosilver/template/ucp_avatar_options.html87
-rw-r--r--phpBB/styles/prosilver/template/ucp_avatar_options_gravatar.html11
-rw-r--r--phpBB/styles/prosilver/template/ucp_avatar_options_local.html20
-rw-r--r--phpBB/styles/prosilver/template/ucp_avatar_options_remote.html11
-rw-r--r--phpBB/styles/prosilver/template/ucp_avatar_options_upload.html11
-rw-r--r--phpBB/styles/prosilver/template/ucp_footer.html5
-rw-r--r--phpBB/styles/prosilver/template/ucp_groups_manage.html77
-rw-r--r--phpBB/styles/prosilver/template/ucp_groups_membership.html78
-rw-r--r--phpBB/styles/prosilver/template/ucp_header.html18
-rw-r--r--phpBB/styles/prosilver/template/ucp_login_link.html58
-rw-r--r--phpBB/styles/prosilver/template/ucp_main_bookmarks.html75
-rw-r--r--phpBB/styles/prosilver/template/ucp_main_drafts.html30
-rw-r--r--phpBB/styles/prosilver/template/ucp_main_front.html57
-rw-r--r--phpBB/styles/prosilver/template/ucp_main_subscribed.html109
-rw-r--r--phpBB/styles/prosilver/template/ucp_notifications.html122
-rw-r--r--phpBB/styles/prosilver/template/ucp_pm_history.html30
-rw-r--r--phpBB/styles/prosilver/template/ucp_pm_message_header.html63
-rw-r--r--phpBB/styles/prosilver/template/ucp_pm_options.html30
-rw-r--r--phpBB/styles/prosilver/template/ucp_pm_popup.html25
-rw-r--r--phpBB/styles/prosilver/template/ucp_pm_viewfolder.html69
-rw-r--r--phpBB/styles/prosilver/template/ucp_pm_viewmessage.html163
-rw-r--r--phpBB/styles/prosilver/template/ucp_pm_viewmessage_print.html23
-rw-r--r--phpBB/styles/prosilver/template/ucp_prefs_personal.html86
-rw-r--r--phpBB/styles/prosilver/template/ucp_prefs_post.html16
-rw-r--r--phpBB/styles/prosilver/template/ucp_prefs_view.html34
-rw-r--r--phpBB/styles/prosilver/template/ucp_profile_autologin_keys.html45
-rw-r--r--phpBB/styles/prosilver/template/ucp_profile_avatar.html12
-rw-r--r--phpBB/styles/prosilver/template/ucp_profile_profile_info.html64
-rw-r--r--phpBB/styles/prosilver/template/ucp_profile_reg_details.html34
-rw-r--r--phpBB/styles/prosilver/template/ucp_profile_signature.html12
-rw-r--r--phpBB/styles/prosilver/template/ucp_register.html59
-rw-r--r--phpBB/styles/prosilver/template/ucp_remind.html12
-rw-r--r--phpBB/styles/prosilver/template/ucp_resend.html12
-rw-r--r--phpBB/styles/prosilver/template/ucp_zebra_foes.html10
-rw-r--r--phpBB/styles/prosilver/template/ucp_zebra_friends.html12
-rw-r--r--phpBB/styles/prosilver/template/viewforum_body.html189
-rw-r--r--phpBB/styles/prosilver/template/viewonline_body.html42
-rw-r--r--phpBB/styles/prosilver/template/viewonline_whois.html12
-rw-r--r--phpBB/styles/prosilver/template/viewtopic_body.html409
-rw-r--r--phpBB/styles/prosilver/template/viewtopic_print.html25
-rw-r--r--phpBB/styles/prosilver/template/viewtopic_topic_tools.html25
-rw-r--r--phpBB/styles/prosilver/theme/bidi.css625
-rw-r--r--phpBB/styles/prosilver/theme/buttons.css337
-rw-r--r--phpBB/styles/prosilver/theme/colours.css691
-rw-r--r--phpBB/styles/prosilver/theme/common.css1148
-rw-r--r--phpBB/styles/prosilver/theme/content.css468
-rw-r--r--phpBB/styles/prosilver/theme/cp.css356
-rw-r--r--phpBB/styles/prosilver/theme/en/icon_user_online.gif (renamed from phpBB/styles/prosilver/imageset/de/icon_user_online.gif)bin423 -> 423 bytes
-rw-r--r--phpBB/styles/prosilver/theme/en/stylesheet.css8
-rw-r--r--phpBB/styles/prosilver/theme/forms.css165
-rw-r--r--phpBB/styles/prosilver/theme/images/Mageia_logo.png (renamed from phpBB/styles/prosilver/imageset/Mageia_logo.png)bin7295 -> 7295 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/alert_close.pngbin0 -> 2097 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/announce_read.gifbin0 -> 728 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/announce_read_locked.gif (renamed from phpBB/styles/prosilver/imageset/announce_read_locked.gif)bin738 -> 738 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/announce_read_locked_mine.gif (renamed from phpBB/styles/prosilver/imageset/announce_read_locked_mine.gif)bin753 -> 753 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/announce_read_mine.gifbin0 -> 724 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/announce_unread.gifbin0 -> 730 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/announce_unread_locked.gif (renamed from phpBB/styles/prosilver/imageset/announce_unread_locked.gif)bin745 -> 745 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/announce_unread_locked_mine.gif (renamed from phpBB/styles/prosilver/imageset/announce_unread_locked_mine.gif)bin755 -> 755 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/announce_unread_mine.gifbin0 -> 765 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/arrow_down.gifbin113 -> 51 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/arrow_left.gifbin111 -> 49 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/arrow_right.gifbin111 -> 49 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/arrow_up.gifbin113 -> 51 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/bg_menu.gifbin354 -> 0 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/bg_menu_rtl.gifbin345 -> 0 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/bg_tabs1.gifbin1520 -> 0 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/bg_tabs2.gifbin420 -> 0 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/corners_left.gifbin55 -> 0 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/corners_left.pngbin195 -> 0 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/corners_left2.gifbin112 -> 0 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/corners_right.gifbin56 -> 0 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/corners_right.pngbin201 -> 0 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/corners_right2.gifbin111 -> 0 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/created_by.jpgbin52977 -> 0 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/de/button_pm_forward.gif (renamed from phpBB/styles/prosilver/imageset/de/button_pm_forward.gif)bin2306 -> 2306 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/de/button_pm_new.gif (renamed from phpBB/styles/prosilver/imageset/de/button_pm_new.gif)bin2446 -> 2446 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/de/button_pm_reply.gif (renamed from phpBB/styles/prosilver/imageset/de/button_pm_reply.gif)bin2728 -> 2728 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/de/button_topic_locked.gif (renamed from phpBB/styles/prosilver/imageset/de/button_topic_locked.gif)bin2476 -> 2476 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/de/button_topic_new.gif (renamed from phpBB/styles/prosilver/imageset/de/button_topic_new.gif)bin2951 -> 2951 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/de/button_topic_reply.gif (renamed from phpBB/styles/prosilver/imageset/de/button_topic_reply.gif)bin2728 -> 2728 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/de/icon_contact_pm.gif (renamed from phpBB/styles/prosilver/imageset/de/icon_contact_pm.gif)bin1473 -> 1473 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/de/icon_post_edit.gif (renamed from phpBB/styles/prosilver/imageset/de/icon_post_edit.gif)bin1833 -> 1833 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/de/icon_post_quote.gif (renamed from phpBB/styles/prosilver/imageset/de/icon_post_quote.gif)bin1880 -> 1880 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/de/icon_user_online.gif (renamed from phpBB/styles/prosilver/imageset/de_x_sie/icon_user_online.gif)bin423 -> 423 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/de/imageset.cfg (renamed from phpBB/styles/prosilver/imageset/de/imageset.cfg)0
-rw-r--r--phpBB/styles/prosilver/theme/images/de/index.htm (renamed from phpBB/styles/prosilver/imageset/de_x_sie/index.htm)0
-rw-r--r--phpBB/styles/prosilver/theme/images/de_x_sie/button_pm_forward.gif (renamed from phpBB/styles/prosilver/imageset/de_x_sie/button_pm_forward.gif)bin2306 -> 2306 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/de_x_sie/button_pm_new.gif (renamed from phpBB/styles/prosilver/imageset/de_x_sie/button_pm_new.gif)bin2446 -> 2446 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/de_x_sie/button_pm_reply.gif (renamed from phpBB/styles/prosilver/imageset/de_x_sie/button_pm_reply.gif)bin2728 -> 2728 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/de_x_sie/button_topic_locked.gif (renamed from phpBB/styles/prosilver/imageset/de_x_sie/button_topic_locked.gif)bin2476 -> 2476 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/de_x_sie/button_topic_new.gif (renamed from phpBB/styles/prosilver/imageset/de_x_sie/button_topic_new.gif)bin2951 -> 2951 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/de_x_sie/button_topic_reply.gif (renamed from phpBB/styles/prosilver/imageset/de_x_sie/button_topic_reply.gif)bin2728 -> 2728 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/de_x_sie/icon_contact_pm.gif (renamed from phpBB/styles/prosilver/imageset/de_x_sie/icon_contact_pm.gif)bin1473 -> 1473 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/de_x_sie/icon_post_edit.gif (renamed from phpBB/styles/prosilver/imageset/de_x_sie/icon_post_edit.gif)bin1833 -> 1833 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/de_x_sie/icon_post_quote.gif (renamed from phpBB/styles/prosilver/imageset/de_x_sie/icon_post_quote.gif)bin1880 -> 1880 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/de_x_sie/icon_user_online.gif (renamed from phpBB/styles/prosilver/imageset/en/icon_user_online.gif)bin423 -> 423 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/de_x_sie/imageset.cfg (renamed from phpBB/styles/prosilver/imageset/de_x_sie/imageset.cfg)0
-rw-r--r--phpBB/styles/prosilver/theme/images/de_x_sie/index.htm (renamed from phpBB/styles/prosilver/imageset/en/index.htm)0
-rw-r--r--phpBB/styles/prosilver/theme/images/forum_link.gifbin0 -> 708 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/forum_read.gifbin0 -> 662 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/forum_read_locked.gifbin0 -> 681 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/forum_read_subforum.gifbin0 -> 725 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/forum_unread.gifbin0 -> 667 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/forum_unread_locked.gif (renamed from phpBB/styles/prosilver/imageset/forum_unread_locked.gif)bin677 -> 677 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/forum_unread_subforum.gifbin0 -> 725 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/fr/button_pm_forward.gif (renamed from phpBB/styles/prosilver/imageset/fr/button_pm_forward.gif)bin2934 -> 2934 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/fr/button_pm_new.gif (renamed from phpBB/styles/prosilver/imageset/fr/button_pm_new.gif)bin2749 -> 2749 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/fr/button_pm_reply.gif (renamed from phpBB/styles/prosilver/imageset/fr/button_pm_reply.gif)bin2612 -> 2612 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/fr/button_topic_locked.gif (renamed from phpBB/styles/prosilver/imageset/fr/button_topic_locked.gif)bin2742 -> 2742 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/fr/button_topic_new.gif (renamed from phpBB/styles/prosilver/imageset/fr/button_topic_new.gif)bin2749 -> 2749 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/fr/button_topic_reply.gif (renamed from phpBB/styles/prosilver/imageset/fr/button_topic_reply.gif)bin2612 -> 2612 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/fr/icon_contact_pm.gif (renamed from phpBB/styles/prosilver/imageset/fr/icon_contact_pm.gif)bin1487 -> 1487 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/fr/icon_post_edit.gif (renamed from phpBB/styles/prosilver/imageset/fr/icon_post_edit.gif)bin1770 -> 1770 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/fr/icon_post_quote.gif (renamed from phpBB/styles/prosilver/imageset/fr/icon_post_quote.gif)bin1814 -> 1814 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/fr/icon_user_online.gif (renamed from phpBB/styles/prosilver/imageset/fr/icon_user_online.gif)bin702 -> 702 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/fr/imageset.cfg (renamed from phpBB/styles/prosilver/imageset/fr/imageset.cfg)0
-rw-r--r--phpBB/styles/prosilver/theme/images/fr/index.htm (renamed from phpBB/styles/prosilver/imageset/fr/index.htm)0
-rw-r--r--phpBB/styles/prosilver/theme/images/icon_acp.gifbin0 -> 389 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/icon_back_top.gifbin0 -> 204 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/icon_contact.pngbin0 -> 340 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/icon_delete_cookies.gifbin0 -> 108 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/icon_download.gifbin0 -> 198 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/icon_fontsize.gifbin559 -> 0 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/icon_mark.gifbin0 -> 360 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/icon_mcp.gifbin0 -> 342 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/icon_notification.gifbin0 -> 551 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/icon_offline.gifbin0 -> 322 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/icon_online.gifbin0 -> 331 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/icon_pages.gifbin167 -> 105 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/icon_pm.gifbin0 -> 576 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/icon_post_target.gifbin0 -> 124 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/icon_post_target_unread.gifbin0 -> 89 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/icon_print.gifbin424 -> 204 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/icon_profile.gifbin0 -> 538 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/icon_rate_bad.gif (renamed from phpBB/styles/prosilver/imageset/icon_rate_bad.gif)bin465 -> 465 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/icon_rate_good.gif (renamed from phpBB/styles/prosilver/imageset/icon_rate_good.gif)bin462 -> 462 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/icon_sendemail.gifbin531 -> 303 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/icon_team.gifbin0 -> 1009 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/icon_topic_attach.gifbin0 -> 82 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/icon_topic_deleted.pngbin0 -> 1205 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/icon_topic_latest.gifbin0 -> 124 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/icon_topic_newest.gifbin0 -> 93 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/icon_topic_poll.gifbin0 -> 120 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/icon_topic_reported.gif (renamed from phpBB/styles/prosilver/imageset/icon_topic_reported.gif)bin246 -> 246 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/icon_topic_unapproved.gif (renamed from phpBB/styles/prosilver/imageset/icon_topic_unapproved.gif)bin253 -> 253 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/icons_button.pngbin0 -> 8037 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/icons_contact.pngbin0 -> 8507 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/icons_pagination.pngbin0 -> 1043 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/loading.gifbin0 -> 1320 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/no_avatar.gifbin474 -> 930 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/plupload/done.gifbin0 -> 1024 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/plupload/error.gifbin0 -> 994 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/plupload/throbber.gifbin0 -> 1922 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/site_logo.gifbin0 -> 5070 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/sticky_read.gifbin0 -> 625 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/sticky_read_locked.gif (renamed from phpBB/styles/prosilver/imageset/sticky_read_locked.gif)bin646 -> 646 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/sticky_read_locked_mine.gif (renamed from phpBB/styles/prosilver/imageset/sticky_read_locked_mine.gif)bin662 -> 662 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/sticky_read_mine.gifbin0 -> 633 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/sticky_unread.gifbin0 -> 622 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/sticky_unread_locked.gif (renamed from phpBB/styles/prosilver/imageset/sticky_unread_locked.gif)bin626 -> 626 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/sticky_unread_locked_mine.gif (renamed from phpBB/styles/prosilver/imageset/sticky_unread_locked_mine.gif)bin682 -> 682 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/sticky_unread_mine.gifbin0 -> 643 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/subforum_read.gif (renamed from phpBB/styles/prosilver/imageset/subforum_read.gif)bin124 -> 124 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/subforum_unread.gif (renamed from phpBB/styles/prosilver/imageset/subforum_unread.gif)bin124 -> 124 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/topic_moved.gifbin0 -> 667 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/topic_read.gifbin0 -> 653 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/topic_read_hot.gif (renamed from phpBB/styles/prosilver/imageset/topic_read_hot.gif)bin1469 -> 1469 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/topic_read_hot_mine.gif (renamed from phpBB/styles/prosilver/imageset/topic_read_hot_mine.gif)bin1519 -> 1519 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/topic_read_locked.gifbin0 -> 722 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/topic_read_locked_mine.gifbin0 -> 723 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/topic_read_mine.gifbin0 -> 669 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/topic_unread.gifbin0 -> 652 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/topic_unread_hot.gif (renamed from phpBB/styles/prosilver/imageset/topic_unread_hot.gif)bin1431 -> 1431 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/topic_unread_hot_mine.gif (renamed from phpBB/styles/prosilver/imageset/topic_unread_hot_mine.gif)bin1364 -> 1364 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/topic_unread_locked.gifbin0 -> 719 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/topic_unread_locked_mine.gifbin0 -> 738 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/topic_unread_mine.gifbin0 -> 678 bytes
-rw-r--r--phpBB/styles/prosilver/theme/imageset.css376
-rw-r--r--phpBB/styles/prosilver/theme/large.css3
-rw-r--r--phpBB/styles/prosilver/theme/links.css139
-rw-r--r--phpBB/styles/prosilver/theme/medium.css3
-rw-r--r--phpBB/styles/prosilver/theme/normal.css3
-rw-r--r--phpBB/styles/prosilver/theme/plupload.css86
-rw-r--r--phpBB/styles/prosilver/theme/print.css12
-rw-r--r--phpBB/styles/prosilver/theme/responsive.css574
-rw-r--r--phpBB/styles/prosilver/theme/stylesheet.css6
-rw-r--r--phpBB/styles/prosilver/theme/theme.cfg35
-rw-r--r--phpBB/styles/prosilver/theme/tweaks.css114
-rw-r--r--phpBB/styles/subsilver2/imageset/en/icon_contact_msnm.gifbin622 -> 0 bytes
-rw-r--r--phpBB/styles/subsilver2/imageset/fr/imageset.cfg47
-rw-r--r--phpBB/styles/subsilver2/imageset/imageset.cfg100
-rw-r--r--phpBB/styles/subsilver2/style.cfg22
-rw-r--r--phpBB/styles/subsilver2/template/attachment.html10
-rw-r--r--phpBB/styles/subsilver2/template/bbcode.html12
-rw-r--r--phpBB/styles/subsilver2/template/breadcrumbs.html10
-rw-r--r--phpBB/styles/subsilver2/template/captcha_default.html2
-rw-r--r--phpBB/styles/subsilver2/template/captcha_qa.html2
-rw-r--r--phpBB/styles/subsilver2/template/captcha_recaptcha.html2
-rw-r--r--phpBB/styles/subsilver2/template/confirm_body.html4
-rw-r--r--phpBB/styles/subsilver2/template/confirm_delete_body.html55
-rw-r--r--phpBB/styles/subsilver2/template/custom_profile_fields.html31
-rw-r--r--phpBB/styles/subsilver2/template/editor.js462
-rw-r--r--phpBB/styles/subsilver2/template/faq_body.html6
-rw-r--r--phpBB/styles/subsilver2/template/forumlist_body.html42
-rw-r--r--phpBB/styles/subsilver2/template/index.htm2
-rw-r--r--phpBB/styles/subsilver2/template/index_body.html63
-rw-r--r--phpBB/styles/subsilver2/template/jumpbox.html6
-rw-r--r--phpBB/styles/subsilver2/template/login_body.html9
-rw-r--r--phpBB/styles/subsilver2/template/login_body_oauth.html7
-rw-r--r--phpBB/styles/subsilver2/template/login_forum.html6
-rw-r--r--phpBB/styles/subsilver2/template/mcp_approve.html6
-rw-r--r--phpBB/styles/subsilver2/template/mcp_ban.html57
-rw-r--r--phpBB/styles/subsilver2/template/mcp_footer.html4
-rw-r--r--phpBB/styles/subsilver2/template/mcp_forum.html20
-rw-r--r--phpBB/styles/subsilver2/template/mcp_front.html36
-rw-r--r--phpBB/styles/subsilver2/template/mcp_header.html21
-rw-r--r--phpBB/styles/subsilver2/template/mcp_jumpbox.html18
-rw-r--r--phpBB/styles/subsilver2/template/mcp_logs.html6
-rw-r--r--phpBB/styles/subsilver2/template/mcp_message.html2
-rw-r--r--phpBB/styles/subsilver2/template/mcp_move.html13
-rw-r--r--phpBB/styles/subsilver2/template/mcp_notes_front.html4
-rw-r--r--phpBB/styles/subsilver2/template/mcp_notes_user.html12
-rw-r--r--phpBB/styles/subsilver2/template/mcp_post.html42
-rw-r--r--phpBB/styles/subsilver2/template/mcp_queue.html46
-rw-r--r--phpBB/styles/subsilver2/template/mcp_reports.html14
-rw-r--r--phpBB/styles/subsilver2/template/mcp_topic.html26
-rw-r--r--phpBB/styles/subsilver2/template/mcp_viewlogs.html52
-rw-r--r--phpBB/styles/subsilver2/template/mcp_warn_front.html8
-rw-r--r--phpBB/styles/subsilver2/template/mcp_warn_list.html6
-rw-r--r--phpBB/styles/subsilver2/template/mcp_warn_post.html7
-rw-r--r--phpBB/styles/subsilver2/template/mcp_warn_user.html13
-rw-r--r--phpBB/styles/subsilver2/template/mcp_whois.html2
-rw-r--r--phpBB/styles/subsilver2/template/memberlist_body.html24
-rw-r--r--phpBB/styles/subsilver2/template/memberlist_email.html66
-rw-r--r--phpBB/styles/subsilver2/template/memberlist_group.html8
-rw-r--r--phpBB/styles/subsilver2/template/memberlist_im.html116
-rw-r--r--phpBB/styles/subsilver2/template/memberlist_leaders.html71
-rw-r--r--phpBB/styles/subsilver2/template/memberlist_search.html86
-rw-r--r--phpBB/styles/subsilver2/template/memberlist_team.html50
-rw-r--r--phpBB/styles/subsilver2/template/memberlist_view.html104
-rw-r--r--phpBB/styles/subsilver2/template/message_body.html2
-rw-r--r--phpBB/styles/subsilver2/template/overall_footer.html21
-rw-r--r--phpBB/styles/subsilver2/template/overall_header.html121
-rw-r--r--phpBB/styles/subsilver2/template/pagination.html12
-rw-r--r--phpBB/styles/subsilver2/template/posting_attach_body.html2
-rw-r--r--phpBB/styles/subsilver2/template/posting_body.html98
-rw-r--r--phpBB/styles/subsilver2/template/posting_buttons.html47
-rw-r--r--phpBB/styles/subsilver2/template/posting_poll_body.html17
-rw-r--r--phpBB/styles/subsilver2/template/posting_preview.html5
-rw-r--r--phpBB/styles/subsilver2/template/posting_review.html12
-rw-r--r--phpBB/styles/subsilver2/template/posting_smilies.html19
-rw-r--r--phpBB/styles/subsilver2/template/posting_topic_review.html23
-rw-r--r--phpBB/styles/subsilver2/template/profilefields/bool.html7
-rw-r--r--phpBB/styles/subsilver2/template/profilefields/date.html5
-rw-r--r--phpBB/styles/subsilver2/template/profilefields/dropdown.html5
-rw-r--r--phpBB/styles/subsilver2/template/profilefields/int.html3
-rw-r--r--phpBB/styles/subsilver2/template/profilefields/string.html3
-rw-r--r--phpBB/styles/subsilver2/template/profilefields/text.html3
-rw-r--r--phpBB/styles/subsilver2/template/profilefields/url.html3
-rw-r--r--phpBB/styles/subsilver2/template/quickreply_editor.html19
-rw-r--r--phpBB/styles/subsilver2/template/report_body.html8
-rw-r--r--phpBB/styles/subsilver2/template/search_body.html39
-rw-r--r--phpBB/styles/subsilver2/template/search_results.html59
-rw-r--r--phpBB/styles/subsilver2/template/searchbox.html2
-rw-r--r--phpBB/styles/subsilver2/template/simple_footer.html8
-rw-r--r--phpBB/styles/subsilver2/template/simple_header.html30
-rw-r--r--phpBB/styles/subsilver2/template/template.cfg27
-rw-r--r--phpBB/styles/subsilver2/template/timezone.js21
-rw-r--r--phpBB/styles/subsilver2/template/timezone_option.html28
-rw-r--r--phpBB/styles/subsilver2/template/ucp_agreement.html5
-rw-r--r--phpBB/styles/subsilver2/template/ucp_attachments.html8
-rw-r--r--phpBB/styles/subsilver2/template/ucp_auth_link.html19
-rw-r--r--phpBB/styles/subsilver2/template/ucp_auth_link_oauth.html34
-rw-r--r--phpBB/styles/subsilver2/template/ucp_avatar_options_gravatar.html13
-rw-r--r--phpBB/styles/subsilver2/template/ucp_avatar_options_local.html42
-rw-r--r--phpBB/styles/subsilver2/template/ucp_avatar_options_remote.html10
-rw-r--r--phpBB/styles/subsilver2/template/ucp_avatar_options_upload.html12
-rw-r--r--phpBB/styles/subsilver2/template/ucp_footer.html2
-rw-r--r--phpBB/styles/subsilver2/template/ucp_groups_manage.html118
-rw-r--r--phpBB/styles/subsilver2/template/ucp_groups_membership.html4
-rw-r--r--phpBB/styles/subsilver2/template/ucp_header.html8
-rw-r--r--phpBB/styles/subsilver2/template/ucp_login_link.html74
-rw-r--r--phpBB/styles/subsilver2/template/ucp_main_bookmarks.html17
-rw-r--r--phpBB/styles/subsilver2/template/ucp_main_drafts.html17
-rw-r--r--phpBB/styles/subsilver2/template/ucp_main_front.html16
-rw-r--r--phpBB/styles/subsilver2/template/ucp_main_subscribed.html25
-rw-r--r--phpBB/styles/subsilver2/template/ucp_notifications.html141
-rw-r--r--phpBB/styles/subsilver2/template/ucp_pm_history.html21
-rw-r--r--phpBB/styles/subsilver2/template/ucp_pm_message_footer.html2
-rw-r--r--phpBB/styles/subsilver2/template/ucp_pm_options.html16
-rw-r--r--phpBB/styles/subsilver2/template/ucp_pm_popup.html37
-rw-r--r--phpBB/styles/subsilver2/template/ucp_pm_viewfolder.html8
-rw-r--r--phpBB/styles/subsilver2/template/ucp_pm_viewmessage.html28
-rw-r--r--phpBB/styles/subsilver2/template/ucp_pm_viewmessage_print.html19
-rw-r--r--phpBB/styles/subsilver2/template/ucp_prefs_personal.html69
-rw-r--r--phpBB/styles/subsilver2/template/ucp_prefs_post.html12
-rw-r--r--phpBB/styles/subsilver2/template/ucp_prefs_view.html30
-rw-r--r--phpBB/styles/subsilver2/template/ucp_profile_autologin_keys.html50
-rw-r--r--phpBB/styles/subsilver2/template/ucp_profile_avatar.html83
-rw-r--r--phpBB/styles/subsilver2/template/ucp_profile_profile_info.html54
-rw-r--r--phpBB/styles/subsilver2/template/ucp_profile_reg_details.html26
-rw-r--r--phpBB/styles/subsilver2/template/ucp_profile_signature.html9
-rw-r--r--phpBB/styles/subsilver2/template/ucp_register.html40
-rw-r--r--phpBB/styles/subsilver2/template/ucp_remind.html8
-rw-r--r--phpBB/styles/subsilver2/template/ucp_resend.html8
-rw-r--r--phpBB/styles/subsilver2/template/ucp_zebra_foes.html6
-rw-r--r--phpBB/styles/subsilver2/template/ucp_zebra_friends.html8
-rw-r--r--phpBB/styles/subsilver2/template/viewforum_body.html104
-rw-r--r--phpBB/styles/subsilver2/template/viewonline_body.html12
-rw-r--r--phpBB/styles/subsilver2/template/viewonline_whois.html2
-rw-r--r--phpBB/styles/subsilver2/template/viewtopic_body.html174
-rw-r--r--phpBB/styles/subsilver2/template/viewtopic_print.html21
-rw-r--r--phpBB/styles/subsilver2/theme/en/button_pm_new.gif (renamed from phpBB/styles/subsilver2/imageset/en/button_pm_new.gif)bin1135 -> 1135 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/en/button_pm_reply.gif (renamed from phpBB/styles/subsilver2/imageset/en/button_pm_reply.gif)bin1667 -> 1667 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/en/button_topic_locked.gif (renamed from phpBB/styles/subsilver2/imageset/en/button_topic_locked.gif)bin1101 -> 1101 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/en/button_topic_new.gif (renamed from phpBB/styles/subsilver2/imageset/en/button_topic_new.gif)bin1164 -> 1164 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/en/button_topic_reply.gif (renamed from phpBB/styles/subsilver2/imageset/en/button_topic_reply.gif)bin1234 -> 1234 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/en/icon_contact_aim.gif (renamed from phpBB/styles/subsilver2/imageset/en/icon_contact_aim.gif)bin580 -> 580 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/en/icon_contact_email.gif (renamed from phpBB/styles/subsilver2/imageset/en/icon_contact_email.gif)bin659 -> 659 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/en/icon_contact_icq.gif (renamed from phpBB/styles/subsilver2/imageset/en/icon_contact_icq.gif)bin574 -> 574 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/en/icon_contact_jabber.gif (renamed from phpBB/styles/subsilver2/imageset/en/icon_contact_jabber.gif)bin674 -> 674 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/en/icon_contact_msnm.gifbin0 -> 1503 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/en/icon_contact_pm.gif (renamed from phpBB/styles/subsilver2/imageset/en/icon_contact_pm.gif)bin706 -> 706 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/en/icon_contact_www.gif (renamed from phpBB/styles/subsilver2/imageset/en/icon_contact_www.gif)bin604 -> 604 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/en/icon_contact_yahoo.gif (renamed from phpBB/styles/subsilver2/imageset/en/icon_contact_yahoo.gif)bin663 -> 663 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/en/icon_post_delete.gif (renamed from phpBB/styles/subsilver2/imageset/en/icon_post_delete.gif)bin314 -> 314 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/en/icon_post_edit.gif (renamed from phpBB/styles/subsilver2/imageset/en/icon_post_edit.gif)bin662 -> 662 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/en/icon_post_info.gif (renamed from phpBB/styles/subsilver2/imageset/en/icon_post_info.gif)bin305 -> 305 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/en/icon_post_quote.gif (renamed from phpBB/styles/subsilver2/imageset/en/icon_post_quote.gif)bin666 -> 666 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/en/icon_post_report.gif (renamed from phpBB/styles/subsilver2/imageset/en/icon_post_report.gif)bin308 -> 308 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/en/icon_user_offline.gif (renamed from phpBB/styles/subsilver2/imageset/en/icon_user_offline.gif)bin547 -> 547 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/en/icon_user_online.gif (renamed from phpBB/styles/subsilver2/imageset/en/icon_user_online.gif)bin520 -> 520 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/en/icon_user_profile.gif (renamed from phpBB/styles/subsilver2/imageset/en/icon_user_profile.gif)bin667 -> 667 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/en/icon_user_search.gif (renamed from phpBB/styles/subsilver2/imageset/en/icon_user_search.gif)bin608 -> 608 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/en/icon_user_warn.gif (renamed from phpBB/styles/subsilver2/imageset/en/icon_user_warn.gif)bin673 -> 673 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/en/stylesheet.css116
-rw-r--r--phpBB/styles/subsilver2/theme/images/announce_read.gif (renamed from phpBB/styles/subsilver2/imageset/announce_read.gif)bin307 -> 307 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/announce_read_locked.gif (renamed from phpBB/styles/subsilver2/imageset/announce_read_locked.gif)bin304 -> 304 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/announce_read_locked_mine.gif (renamed from phpBB/styles/subsilver2/imageset/announce_read_locked_mine.gif)bin324 -> 324 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/announce_read_mine.gif (renamed from phpBB/styles/subsilver2/imageset/announce_read_mine.gif)bin328 -> 328 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/announce_unread.gif (renamed from phpBB/styles/subsilver2/imageset/announce_unread.gif)bin289 -> 289 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/announce_unread_locked.gif (renamed from phpBB/styles/subsilver2/imageset/announce_unread_locked.gif)bin292 -> 292 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/announce_unread_locked_mine.gif (renamed from phpBB/styles/subsilver2/imageset/announce_unread_locked_mine.gif)bin308 -> 308 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/announce_unread_mine.gif (renamed from phpBB/styles/subsilver2/imageset/announce_unread_mine.gif)bin305 -> 305 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/de/button_pm_new.gif (renamed from phpBB/styles/subsilver2/imageset/de/button_pm_new.gif)bin1495 -> 1495 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/de/button_pm_reply.gif (renamed from phpBB/styles/subsilver2/imageset/de/button_pm_reply.gif)bin1181 -> 1181 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/de/button_topic_locked.gif (renamed from phpBB/styles/subsilver2/imageset/de/button_topic_locked.gif)bin1366 -> 1366 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/de/button_topic_new.gif (renamed from phpBB/styles/subsilver2/imageset/de/button_topic_new.gif)bin1430 -> 1430 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/de/button_topic_reply.gif (renamed from phpBB/styles/subsilver2/imageset/de/button_topic_reply.gif)bin1407 -> 1407 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/de/icon_contact_aim.gif (renamed from phpBB/styles/subsilver2/imageset/de/icon_contact_aim.gif)bin939 -> 939 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/de/icon_contact_email.gif (renamed from phpBB/styles/subsilver2/imageset/de/icon_contact_email.gif)bin1015 -> 1015 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/de/icon_contact_icq.gif (renamed from phpBB/styles/subsilver2/imageset/de/icon_contact_icq.gif)bin689 -> 689 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/de/icon_contact_jabber.gif (renamed from phpBB/styles/subsilver2/imageset/de/icon_contact_jabber.gif)bin1015 -> 1015 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/de/icon_contact_msnm.gif (renamed from phpBB/styles/subsilver2/imageset/de/icon_contact_msnm.gif)bin985 -> 985 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/de/icon_contact_pm.gif (renamed from phpBB/styles/subsilver2/imageset/de/icon_contact_pm.gif)bin821 -> 821 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/de/icon_contact_www.gif (renamed from phpBB/styles/subsilver2/imageset/de/icon_contact_www.gif)bin954 -> 954 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/de/icon_contact_yahoo.gif (renamed from phpBB/styles/subsilver2/imageset/de/icon_contact_yahoo.gif)bin778 -> 778 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/de/icon_post_delete.gif (renamed from phpBB/styles/subsilver2/imageset/de/icon_post_delete.gif)bin292 -> 292 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/de/icon_post_edit.gif (renamed from phpBB/styles/subsilver2/imageset/de/icon_post_edit.gif)bin1101 -> 1101 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/de/icon_post_info.gif (renamed from phpBB/styles/subsilver2/imageset/de/icon_post_info.gif)bin285 -> 285 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/de/icon_post_quote.gif (renamed from phpBB/styles/subsilver2/imageset/de/icon_post_quote.gif)bin1080 -> 1080 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/de/icon_post_report.gif (renamed from phpBB/styles/subsilver2/imageset/de/icon_post_report.gif)bin283 -> 283 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/de/icon_user_offline.gif (renamed from phpBB/styles/subsilver2/imageset/de/icon_user_offline.gif)bin524 -> 524 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/de/icon_user_online.gif (renamed from phpBB/styles/subsilver2/imageset/de/icon_user_online.gif)bin505 -> 505 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/de/icon_user_profile.gif (renamed from phpBB/styles/subsilver2/imageset/de/icon_user_profile.gif)bin754 -> 754 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/de/icon_user_search.gif (renamed from phpBB/styles/subsilver2/imageset/de/icon_user_search.gif)bin994 -> 994 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/de/icon_user_warn.gif (renamed from phpBB/styles/subsilver2/imageset/de/icon_user_warn.gif)bin441 -> 441 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/de/imageset.cfg (renamed from phpBB/styles/subsilver2/imageset/de/imageset.cfg)0
-rw-r--r--phpBB/styles/subsilver2/theme/images/de_x_sie/button_pm_new.gif (renamed from phpBB/styles/subsilver2/imageset/de_x_sie/button_pm_new.gif)bin1495 -> 1495 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/de_x_sie/button_pm_reply.gif (renamed from phpBB/styles/subsilver2/imageset/de_x_sie/button_pm_reply.gif)bin1181 -> 1181 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/de_x_sie/button_topic_locked.gif (renamed from phpBB/styles/subsilver2/imageset/de_x_sie/button_topic_locked.gif)bin1366 -> 1366 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/de_x_sie/button_topic_new.gif (renamed from phpBB/styles/subsilver2/imageset/de_x_sie/button_topic_new.gif)bin1430 -> 1430 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/de_x_sie/button_topic_reply.gif (renamed from phpBB/styles/subsilver2/imageset/de_x_sie/button_topic_reply.gif)bin1407 -> 1407 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/de_x_sie/icon_contact_aim.gif (renamed from phpBB/styles/subsilver2/imageset/de_x_sie/icon_contact_aim.gif)bin939 -> 939 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/de_x_sie/icon_contact_email.gif (renamed from phpBB/styles/subsilver2/imageset/de_x_sie/icon_contact_email.gif)bin1015 -> 1015 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/de_x_sie/icon_contact_icq.gif (renamed from phpBB/styles/subsilver2/imageset/de_x_sie/icon_contact_icq.gif)bin689 -> 689 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/de_x_sie/icon_contact_jabber.gif (renamed from phpBB/styles/subsilver2/imageset/de_x_sie/icon_contact_jabber.gif)bin1015 -> 1015 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/de_x_sie/icon_contact_msnm.gif (renamed from phpBB/styles/subsilver2/imageset/de_x_sie/icon_contact_msnm.gif)bin985 -> 985 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/de_x_sie/icon_contact_pm.gif (renamed from phpBB/styles/subsilver2/imageset/de_x_sie/icon_contact_pm.gif)bin821 -> 821 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/de_x_sie/icon_contact_www.gif (renamed from phpBB/styles/subsilver2/imageset/de_x_sie/icon_contact_www.gif)bin954 -> 954 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/de_x_sie/icon_contact_yahoo.gif (renamed from phpBB/styles/subsilver2/imageset/de_x_sie/icon_contact_yahoo.gif)bin778 -> 778 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/de_x_sie/icon_post_delete.gif (renamed from phpBB/styles/subsilver2/imageset/de_x_sie/icon_post_delete.gif)bin292 -> 292 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/de_x_sie/icon_post_edit.gif (renamed from phpBB/styles/subsilver2/imageset/de_x_sie/icon_post_edit.gif)bin1101 -> 1101 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/de_x_sie/icon_post_info.gif (renamed from phpBB/styles/subsilver2/imageset/de_x_sie/icon_post_info.gif)bin285 -> 285 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/de_x_sie/icon_post_quote.gif (renamed from phpBB/styles/subsilver2/imageset/de_x_sie/icon_post_quote.gif)bin1080 -> 1080 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/de_x_sie/icon_post_report.gif (renamed from phpBB/styles/subsilver2/imageset/de_x_sie/icon_post_report.gif)bin283 -> 283 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/de_x_sie/icon_user_offline.gif (renamed from phpBB/styles/subsilver2/imageset/de_x_sie/icon_user_offline.gif)bin524 -> 524 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/de_x_sie/icon_user_online.gif (renamed from phpBB/styles/subsilver2/imageset/de_x_sie/icon_user_online.gif)bin505 -> 505 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/de_x_sie/icon_user_profile.gif (renamed from phpBB/styles/subsilver2/imageset/de_x_sie/icon_user_profile.gif)bin754 -> 754 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/de_x_sie/icon_user_search.gif (renamed from phpBB/styles/subsilver2/imageset/de_x_sie/icon_user_search.gif)bin994 -> 994 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/de_x_sie/icon_user_warn.gif (renamed from phpBB/styles/subsilver2/imageset/de_x_sie/icon_user_warn.gif)bin441 -> 441 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/de_x_sie/imageset.cfg (renamed from phpBB/styles/subsilver2/imageset/de_x_sie/imageset.cfg)0
-rw-r--r--phpBB/styles/subsilver2/theme/images/forum_link.gif (renamed from phpBB/styles/subsilver2/imageset/forum_link.gif)bin714 -> 714 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/forum_read.gif (renamed from phpBB/styles/subsilver2/imageset/forum_read.gif)bin677 -> 677 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/forum_read_locked.gif (renamed from phpBB/styles/subsilver2/imageset/forum_read_locked.gif)bin673 -> 673 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/forum_read_subforum.gif (renamed from phpBB/styles/subsilver2/imageset/forum_read_subforum.gif)bin705 -> 705 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/forum_unread.gif (renamed from phpBB/styles/subsilver2/imageset/forum_unread.gif)bin663 -> 663 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/forum_unread_locked.gif (renamed from phpBB/styles/subsilver2/imageset/forum_unread_locked.gif)bin660 -> 660 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/forum_unread_subforum.gif (renamed from phpBB/styles/subsilver2/imageset/forum_unread_subforum.gif)bin688 -> 688 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/fr/button_pm_new.gif (renamed from phpBB/styles/subsilver2/imageset/fr/button_pm_new.gif)bin1367 -> 1367 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/fr/button_pm_reply.gif (renamed from phpBB/styles/subsilver2/imageset/fr/button_pm_reply.gif)bin1833 -> 1833 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/fr/button_topic_locked.gif (renamed from phpBB/styles/subsilver2/imageset/fr/button_topic_locked.gif)bin1467 -> 1467 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/fr/button_topic_new.gif (renamed from phpBB/styles/subsilver2/imageset/fr/button_topic_new.gif)bin1367 -> 1367 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/fr/button_topic_reply.gif (renamed from phpBB/styles/subsilver2/imageset/fr/button_topic_reply.gif)bin1497 -> 1497 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/fr/icon_contact_aim.gif (renamed from phpBB/styles/subsilver2/imageset/fr/icon_contact_aim.gif)bin580 -> 580 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/fr/icon_contact_email.gif (renamed from phpBB/styles/subsilver2/imageset/fr/icon_contact_email.gif)bin1007 -> 1007 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/fr/icon_contact_icq.gif (renamed from phpBB/styles/subsilver2/imageset/fr/icon_contact_icq.gif)bin574 -> 574 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/fr/icon_contact_jabber.gif (renamed from phpBB/styles/subsilver2/imageset/fr/icon_contact_jabber.gif)bin1020 -> 1020 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/fr/icon_contact_msnm.gif (renamed from phpBB/styles/subsilver2/imageset/fr/icon_contact_msnm.gif)bin1000 -> 1000 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/fr/icon_contact_pm.gif (renamed from phpBB/styles/subsilver2/imageset/fr/icon_contact_pm.gif)bin1066 -> 1066 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/fr/icon_contact_www.gif (renamed from phpBB/styles/subsilver2/imageset/fr/icon_contact_www.gif)bin604 -> 604 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/fr/icon_contact_yahoo.gif (renamed from phpBB/styles/subsilver2/imageset/fr/icon_contact_yahoo.gif)bin663 -> 663 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/fr/icon_post_delete.gif (renamed from phpBB/styles/subsilver2/imageset/fr/icon_post_delete.gif)bin314 -> 314 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/fr/icon_post_edit.gif (renamed from phpBB/styles/subsilver2/imageset/fr/icon_post_edit.gif)bin1089 -> 1089 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/fr/icon_post_info.gif (renamed from phpBB/styles/subsilver2/imageset/fr/icon_post_info.gif)bin305 -> 305 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/fr/icon_post_quote.gif (renamed from phpBB/styles/subsilver2/imageset/fr/icon_post_quote.gif)bin1015 -> 1015 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/fr/icon_post_report.gif (renamed from phpBB/styles/subsilver2/imageset/fr/icon_post_report.gif)bin308 -> 308 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/fr/icon_user_offline.gif (renamed from phpBB/styles/subsilver2/imageset/fr/icon_user_offline.gif)bin1046 -> 1046 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/fr/icon_user_online.gif (renamed from phpBB/styles/subsilver2/imageset/fr/icon_user_online.gif)bin956 -> 956 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/fr/icon_user_profile.gif (renamed from phpBB/styles/subsilver2/imageset/fr/icon_user_profile.gif)bin1012 -> 1012 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/fr/icon_user_search.gif (renamed from phpBB/styles/subsilver2/imageset/fr/icon_user_search.gif)bin1055 -> 1055 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/fr/icon_user_warn.gif (renamed from phpBB/styles/subsilver2/imageset/fr/icon_user_warn.gif)bin673 -> 673 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/fr/imageset.cfg (renamed from phpBB/styles/subsilver2/imageset/en/imageset.cfg)0
-rw-r--r--phpBB/styles/subsilver2/theme/images/fr/index.htm (renamed from phpBB/styles/subsilver2/imageset/fr/index.htm)0
-rw-r--r--phpBB/styles/subsilver2/theme/images/icon_mini_notification.gifbin0 -> 543 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/icon_post_target.gif (renamed from phpBB/styles/subsilver2/imageset/icon_post_target.gif)bin122 -> 122 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/icon_post_target_unread.gif (renamed from phpBB/styles/subsilver2/imageset/icon_post_target_unread.gif)bin122 -> 122 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/icon_topic_attach.gif (renamed from phpBB/styles/subsilver2/imageset/icon_topic_attach.gif)bin217 -> 217 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/icon_topic_deleted.pngbin0 -> 1205 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/icon_topic_latest.gif (renamed from phpBB/styles/subsilver2/imageset/icon_topic_latest.gif)bin135 -> 135 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/icon_topic_newest.gif (renamed from phpBB/styles/subsilver2/imageset/icon_topic_newest.gif)bin133 -> 133 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/icon_topic_reported.gif (renamed from phpBB/styles/subsilver2/imageset/icon_topic_reported.gif)bin462 -> 462 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/icon_topic_unapproved.gif (renamed from phpBB/styles/subsilver2/imageset/icon_topic_unapproved.gif)bin334 -> 334 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/index.htm2
-rw-r--r--phpBB/styles/subsilver2/theme/images/no_avatar.gifbin474 -> 930 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/poll_center.gif (renamed from phpBB/styles/subsilver2/imageset/poll_center.gif)bin92 -> 92 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/poll_left.gif (renamed from phpBB/styles/subsilver2/imageset/poll_left.gif)bin113 -> 113 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/poll_right.gif (renamed from phpBB/styles/subsilver2/imageset/poll_right.gif)bin113 -> 113 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/site_logo.gif (renamed from phpBB/styles/subsilver2/imageset/site_logo.gif)bin7151 -> 7151 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/sticky_read.gif (renamed from phpBB/styles/subsilver2/imageset/sticky_read.gif)bin344 -> 344 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/sticky_read_locked.gif (renamed from phpBB/styles/subsilver2/imageset/sticky_read_locked.gif)bin338 -> 338 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/sticky_read_locked_mine.gif (renamed from phpBB/styles/subsilver2/imageset/sticky_read_locked_mine.gif)bin336 -> 336 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/sticky_read_mine.gif (renamed from phpBB/styles/subsilver2/imageset/sticky_read_mine.gif)bin352 -> 352 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/sticky_unread.gif (renamed from phpBB/styles/subsilver2/imageset/sticky_unread.gif)bin325 -> 325 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/sticky_unread_locked.gif (renamed from phpBB/styles/subsilver2/imageset/sticky_unread_locked.gif)bin324 -> 324 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/sticky_unread_locked_mine.gif (renamed from phpBB/styles/subsilver2/imageset/sticky_unread_locked_mine.gif)bin336 -> 336 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/sticky_unread_mine.gif (renamed from phpBB/styles/subsilver2/imageset/sticky_unread_mine.gif)bin339 -> 339 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/topic_moved.gif (renamed from phpBB/styles/subsilver2/imageset/topic_moved.gif)bin660 -> 660 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/topic_read.gif (renamed from phpBB/styles/subsilver2/imageset/topic_read.gif)bin344 -> 344 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/topic_read_hot.gif (renamed from phpBB/styles/subsilver2/imageset/topic_read_hot.gif)bin1902 -> 1902 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/topic_read_hot_mine.gif (renamed from phpBB/styles/subsilver2/imageset/topic_read_hot_mine.gif)bin1903 -> 1903 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/topic_read_locked.gif (renamed from phpBB/styles/subsilver2/imageset/topic_read_locked.gif)bin333 -> 333 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/topic_read_locked_mine.gif (renamed from phpBB/styles/subsilver2/imageset/topic_read_locked_mine.gif)bin337 -> 337 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/topic_read_mine.gif (renamed from phpBB/styles/subsilver2/imageset/topic_read_mine.gif)bin350 -> 350 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/topic_unread.gif (renamed from phpBB/styles/subsilver2/imageset/topic_unread.gif)bin336 -> 336 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/topic_unread_hot.gif (renamed from phpBB/styles/subsilver2/imageset/topic_unread_hot.gif)bin1888 -> 1888 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/topic_unread_hot_mine.gif (renamed from phpBB/styles/subsilver2/imageset/topic_unread_hot_mine.gif)bin1895 -> 1895 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/topic_unread_locked.gif (renamed from phpBB/styles/subsilver2/imageset/topic_unread_locked.gif)bin459 -> 459 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/topic_unread_locked_mine.gif (renamed from phpBB/styles/subsilver2/imageset/topic_unread_locked_mine.gif)bin334 -> 334 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/topic_unread_mine.gif (renamed from phpBB/styles/subsilver2/imageset/topic_unread_mine.gif)bin350 -> 350 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/upload_bar.gif (renamed from phpBB/styles/subsilver2/imageset/upload_bar.gif)bin12892 -> 12892 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/stylesheet.css576
-rw-r--r--phpBB/styles/subsilver2/theme/theme.cfg35
-rw-r--r--phpBB/ucp.php133
-rw-r--r--phpBB/viewforum.php497
-rw-r--r--phpBB/viewonline.php199
-rw-r--r--phpBB/viewtopic.php1158
-rw-r--r--phpBB/web.config15
-rw-r--r--phpunit.xml.dist8
-rw-r--r--tests/RUNNING_TESTS.md33
-rw-r--r--tests/acp_board/auth_provider/invalid.php19
-rw-r--r--tests/acp_board/auth_provider/valid.php22
-rw-r--r--tests/acp_board/select_auth_method_test.php52
-rw-r--r--tests/auth/fixtures/oauth_tokens.xml16
-rw-r--r--tests/auth/fixtures/user.xml39
-rw-r--r--tests/auth/fixtures/user_533.xml39
-rw-r--r--tests/auth/phpbb_not_a_token.php23
-rw-r--r--tests/auth/provider_apache_test.php229
-rw-r--r--tests/auth/provider_db_test.php95
-rw-r--r--tests/auth/provider_oauth_token_storage_test.php229
-rw-r--r--tests/avatar/driver/barfoo.php26
-rw-r--r--tests/avatar/driver/foobar.php26
-rw-r--r--tests/avatar/fixtures/users.xml61
-rw-r--r--tests/avatar/manager_test.php430
-rw-r--r--tests/bbcode/parser_test.php269
-rw-r--r--tests/bbcode/url_bbcode_test.php14
-rw-r--r--tests/bootstrap.php40
-rw-r--r--tests/cache/apc_driver_test.php57
-rw-r--r--tests/cache/cache_memory.php20
-rw-r--r--tests/cache/cache_memory_test.php24
-rw-r--r--tests/cache/common_test_case.php102
-rw-r--r--tests/cache/file_driver_test.php73
-rw-r--r--tests/cache/fixtures/cache_memory.xml8
-rw-r--r--tests/cache/fixtures/config.xml18
-rw-r--r--tests/cache/null_driver_test.php77
-rw-r--r--tests/cache/redis_driver_test.php53
-rw-r--r--tests/captcha/qa_test.php94
-rw-r--r--tests/class_loader/class_loader_test.php101
-rw-r--r--tests/class_loader/phpbb/class_name.php8
-rw-r--r--tests/class_loader/phpbb/dir/class_name.php8
-rw-r--r--tests/class_loader/phpbb/dir/subdir/class_name.php8
-rw-r--r--tests/class_loader/phpbb/dir2/dir2.php8
-rw-r--r--tests/composer.json5
-rw-r--r--tests/composer.lock63
-rw-r--r--tests/compress/compress_test.php31
-rw-r--r--tests/config/config_test.php124
-rw-r--r--tests/config/db_test.php168
-rw-r--r--tests/config/db_text_test.php127
-rw-r--r--tests/config/fixtures/config.xml18
-rw-r--r--tests/config/fixtures/config_text.xml19
-rw-r--r--tests/config_php_file_test.php40
-rw-r--r--tests/console/cache/purge_test.php95
-rw-r--r--tests/console/config/config_test.php251
-rw-r--r--tests/console/cron/cron_list_test.php103
-rw-r--r--tests/console/cron/fixtures/config.xml8
-rw-r--r--tests/console/cron/run_test.php158
-rw-r--r--tests/console/cron/tasks/simple.php27
-rw-r--r--tests/console/cron/tasks/simple_not_ready.php13
-rw-r--r--tests/console/cron/tasks/simple_ready.php8
-rw-r--r--tests/content_visibility/delete_post_test.php350
-rw-r--r--tests/content_visibility/fixtures/delete_post.xml163
-rw-r--r--tests/content_visibility/fixtures/get_forums_visibility_sql.xml133
-rw-r--r--tests/content_visibility/fixtures/get_visibility_sql.xml55
-rw-r--r--tests/content_visibility/fixtures/set_post_visibility.xml238
-rw-r--r--tests/content_visibility/fixtures/set_topic_visibility.xml132
-rw-r--r--tests/content_visibility/get_forums_visibility_sql_test.php149
-rw-r--r--tests/content_visibility/get_global_visibility_sql_test.php149
-rw-r--r--tests/content_visibility/get_visibility_sql_test.php96
-rw-r--r--tests/content_visibility/set_post_visibility_test.php192
-rw-r--r--tests/content_visibility/set_topic_visibility_test.php113
-rw-r--r--tests/controller/common_helper_route.php467
-rw-r--r--tests/controller/config/routing.yml3
-rw-r--r--tests/controller/config/services.yml3
-rw-r--r--tests/controller/controller_test.php88
-rw-r--r--tests/controller/ext/vendor2/foo/config/routing.yml7
-rw-r--r--tests/controller/ext/vendor2/foo/config/routing_2.yml6
-rw-r--r--tests/controller/ext/vendor2/foo/config/services.yml3
-rw-r--r--tests/controller/ext/vendor2/foo/controller.php18
-rw-r--r--tests/controller/ext/vendor2/foo/subfolder/config/routing.yml3
-rw-r--r--tests/controller/helper_route_adm_subdir_test.php33
-rw-r--r--tests/controller/helper_route_adm_test.php33
-rw-r--r--tests/controller/helper_route_other_app.php37
-rw-r--r--tests/controller/helper_route_root_test.php33
-rw-r--r--tests/controller/helper_route_slash_test.php43
-rw-r--r--tests/controller/helper_route_unclean_path_test.php33
-rw-r--r--tests/controller/phpbb/controller/foo.php18
-rw-r--r--tests/cron/ext/testext/cron/dummy_task.php32
-rw-r--r--tests/cron/includes/cron/task/core/dummy_task.php32
-rw-r--r--tests/cron/includes/cron/task/core/second_dummy_task.php32
-rw-r--r--tests/cron/manager_test.php80
-rw-r--r--tests/cron/tasks/simple_not_runnable.php18
-rw-r--r--tests/cron/tasks/simple_ready.php13
-rw-r--r--tests/cron/tasks/simple_should_not_run.php18
-rw-r--r--tests/datetime/from_format_test.php126
-rw-r--r--tests/dbal/auto_increment_test.php13
-rw-r--r--tests/dbal/case_test.php73
-rw-r--r--tests/dbal/concatenate_test.php68
-rw-r--r--tests/dbal/connect_test.php14
-rw-r--r--tests/dbal/cross_join_test.php10
-rw-r--r--tests/dbal/db_tools_test.php110
-rw-r--r--tests/dbal/fixtures/massmail_crossjoin.xml8
-rw-r--r--tests/dbal/fixtures/migrator.xml29
-rw-r--r--tests/dbal/fixtures/migrator_config_text.xml7
-rw-r--r--tests/dbal/fixtures/migrator_module.xml133
-rw-r--r--tests/dbal/fixtures/migrator_permission.xml165
-rw-r--r--tests/dbal/fixtures/styles.xml34
-rw-r--r--tests/dbal/fixtures/three_users.xml8
-rw-r--r--tests/dbal/migration/dummy.php31
-rw-r--r--tests/dbal/migration/dummy_order.php30
-rw-r--r--tests/dbal/migration/dummy_order_0.php26
-rw-r--r--tests/dbal/migration/dummy_order_1.php26
-rw-r--r--tests/dbal/migration/dummy_order_2.php26
-rw-r--r--tests/dbal/migration/dummy_order_3.php26
-rw-r--r--tests/dbal/migration/dummy_order_4.php26
-rw-r--r--tests/dbal/migration/dummy_order_5.php27
-rw-r--r--tests/dbal/migration/fail.php45
-rw-r--r--tests/dbal/migration/if.php48
-rw-r--r--tests/dbal/migration/installed.php34
-rw-r--r--tests/dbal/migration/recall.php42
-rw-r--r--tests/dbal/migration/revert.php52
-rw-r--r--tests/dbal/migration/revert_with_dependency.php20
-rw-r--r--tests/dbal/migration/schema.php48
-rw-r--r--tests/dbal/migration/unfulfillable.php30
-rw-r--r--tests/dbal/migrator_test.php315
-rw-r--r--tests/dbal/migrator_tool_config_test.php90
-rw-r--r--tests/dbal/migrator_tool_config_text_test.php75
-rw-r--r--tests/dbal/migrator_tool_module_test.php305
-rw-r--r--tests/dbal/migrator_tool_permission_test.php223
-rw-r--r--tests/dbal/order_lower_test.php39
-rw-r--r--tests/dbal/schema_test.php42
-rw-r--r--tests/dbal/select_test.php86
-rw-r--r--tests/dbal/sql_affected_rows_test.php68
-rw-r--r--tests/dbal/sql_insert_buffer_test.php120
-rw-r--r--tests/dbal/write_sequence_test.php16
-rw-r--r--tests/dbal/write_test.php16
-rw-r--r--tests/di/create_container_test.php205
-rw-r--r--tests/di/fixtures/config.php11
-rw-r--r--tests/di/fixtures/config/services.yml17
-rw-r--r--tests/di/fixtures/ext/vendor/available/config/services.yml2
-rw-r--r--tests/di/fixtures/ext/vendor/disabled/config/services.yml2
-rw-r--r--tests/di/fixtures/ext/vendor/enabled/config/services.yml2
-rw-r--r--tests/di/fixtures/other_config/services.yml17
-rw-r--r--tests/download/http_byte_range_test.php68
-rw-r--r--tests/download/http_user_agent_test.php134
-rw-r--r--tests/error_collector_test.php41
-rw-r--r--tests/event/dispatcher_test.php33
-rw-r--r--tests/event/exception_listener_test.php100
-rw-r--r--tests/event/export_php_test.php49
-rw-r--r--tests/event/fixtures/adm/style/acp_bbcodes.html (renamed from phpBB/styles/prosilver/imageset/index.htm)0
-rw-r--r--tests/event/fixtures/default.test9
-rw-r--r--tests/event/fixtures/duplicate_event.test19
-rw-r--r--tests/event/fixtures/extra_description.test11
-rw-r--r--tests/event/fixtures/missing_var.test17
-rw-r--r--tests/event/fixtures/none.test6
-rw-r--r--tests/event/fixtures/normal_events.md.test20
-rw-r--r--tests/event/fixtures/trigger.test15
-rw-r--r--tests/event/fixtures/trigger_many_vars.test65
-rw-r--r--tests/event/fixtures/trigger_wspace.test15
-rw-r--r--tests/event/md_exporter_test.php160
-rw-r--r--tests/event/php_exporter_test.php740
-rw-r--r--tests/extension/ext/barfoo/composer.json24
-rw-r--r--tests/extension/ext/barfoo/ext.php7
-rw-r--r--tests/extension/ext/vendor/moo/composer.json24
-rw-r--r--tests/extension/ext/vendor/moo/ext.php15
-rw-r--r--tests/extension/ext/vendor/moo/feature_class.php7
-rw-r--r--tests/extension/ext/vendor2/bar/acp/a_info.php18
-rw-r--r--tests/extension/ext/vendor2/bar/acp/a_module.php7
-rw-r--r--tests/extension/ext/vendor2/bar/composer.json23
-rw-r--r--tests/extension/ext/vendor2/bar/ext.php26
-rw-r--r--tests/extension/ext/vendor2/bar/migrations/migration.php18
-rw-r--r--tests/extension/ext/vendor2/foo/a_class.php7
-rw-r--r--tests/extension/ext/vendor2/foo/acp/a_info.php18
-rw-r--r--tests/extension/ext/vendor2/foo/acp/a_module.php7
-rw-r--r--tests/extension/ext/vendor2/foo/acp/fail_info.php22
-rw-r--r--tests/extension/ext/vendor2/foo/acp/fail_module.php11
-rw-r--r--tests/extension/ext/vendor2/foo/b_class.php7
-rw-r--r--tests/extension/ext/vendor2/foo/composer.json23
-rw-r--r--tests/extension/ext/vendor2/foo/ext.php15
-rw-r--r--tests/extension/ext/vendor2/foo/mcp/a_info.php18
-rw-r--r--tests/extension/ext/vendor2/foo/mcp/a_module.php7
-rw-r--r--tests/extension/ext/vendor2/foo/sub/type/alternative.php7
-rw-r--r--tests/extension/ext/vendor2/foo/type/alternative.php7
-rw-r--r--tests/extension/ext/vendor2/foo/type/dummy/empty.txt0
-rw-r--r--tests/extension/ext/vendor2/foo/typewrong/error.php7
-rw-r--r--tests/extension/ext/vendor3/bar/ext.php26
-rw-r--r--tests/extension/ext/vendor3/bar/my/hidden_class.php7
-rw-r--r--tests/extension/ext/vendor3/bar/styles/prosilver/template/foobar_body.html1
-rw-r--r--tests/extension/ext/vendor3/foo/composer.json23
-rw-r--r--tests/extension/ext/vendor3/foo/ext.php20
-rw-r--r--tests/extension/ext/vendor4/bar/composer.json23
-rw-r--r--tests/extension/ext/vendor4/bar/styles/all/template/foobar_body.html1
-rw-r--r--tests/extension/extension_base_test.php79
-rw-r--r--tests/extension/finder_test.php309
-rw-r--r--tests/extension/fixtures/extensions.xml18
-rw-r--r--tests/extension/includes/acp/acp_foobar.php29
-rw-r--r--tests/extension/includes/acp/info/acp_foobar.php27
-rw-r--r--tests/extension/manager_test.php187
-rw-r--r--tests/extension/metadata_manager_test.php343
-rw-r--r--tests/extension/modules_test.php238
-rw-r--r--tests/extension/phpbb/default/implementation.php5
-rw-r--r--tests/feed/attachments_base_test.php94
-rw-r--r--tests/feed/attachments_mock_feed.php31
-rw-r--r--tests/filesystem/clean_path_test.php54
-rw-r--r--tests/fixtures/config.php3
-rw-r--r--tests/fixtures/config_other.php3
-rw-r--r--tests/functional/acp_groups_test.php113
-rw-r--r--tests/functional/acp_permissions_test.php127
-rw-r--r--tests/functional/acp_profile_field_test.php71
-rw-r--r--tests/functional/acp_registration_test.php55
-rw-r--r--tests/functional/acp_users_test.php10
-rw-r--r--tests/functional/auth_test.php44
-rw-r--r--tests/functional/avatar_acp_groups_test.php85
-rw-r--r--tests/functional/avatar_acp_users_test.php65
-rw-r--r--tests/functional/avatar_ucp_groups_test.php74
-rw-r--r--tests/functional/avatar_ucp_users_test.php73
-rw-r--r--tests/functional/browse_test.php17
-rw-r--r--tests/functional/common_avatar_test_case.php97
-rw-r--r--tests/functional/common_groups_test.php93
-rw-r--r--tests/functional/common_groups_test_case.php117
-rw-r--r--tests/functional/download_test.php296
-rw-r--r--tests/functional/extension_acp_test.php237
-rw-r--r--tests/functional/extension_controller_test.php181
-rw-r--r--tests/functional/extension_global_lang_test.php75
-rw-r--r--tests/functional/extension_module_test.php136
-rw-r--r--tests/functional/extension_permission_lang_test.php86
-rw-r--r--tests/functional/feed_test.php1503
-rw-r--r--tests/functional/fileupload_form_test.php145
-rw-r--r--tests/functional/fileupload_remote_test.php79
-rw-r--r--tests/functional/fixtures/ext/foo/bar/acp/main_info.php37
-rw-r--r--tests/functional/fixtures/ext/foo/bar/acp/main_module.php33
-rw-r--r--tests/functional/fixtures/ext/foo/bar/adm/style/foobar.html3
-rw-r--r--tests/functional/fixtures/ext/foo/bar/composer.json24
-rw-r--r--tests/functional/fixtures/ext/foo/bar/config/routing.yml35
-rw-r--r--tests/functional/fixtures/ext/foo/bar/config/services.yml20
-rw-r--r--tests/functional/fixtures/ext/foo/bar/controller/controller.php109
-rw-r--r--tests/functional/fixtures/ext/foo/bar/event/permission.php36
-rw-r--r--tests/functional/fixtures/ext/foo/bar/event/user_setup.php39
-rw-r--r--tests/functional/fixtures/ext/foo/bar/ext.php8
-rw-r--r--tests/functional/fixtures/ext/foo/bar/language/en/foo_global.php5
-rw-r--r--tests/functional/fixtures/ext/foo/bar/language/en/permissions_foo.php5
-rw-r--r--tests/functional/fixtures/ext/foo/bar/styles/prosilver/template/foo_bar_body.html3
-rw-r--r--tests/functional/fixtures/ext/foo/bar/styles/prosilver/template/foobar.html3
-rw-r--r--tests/functional/fixtures/ext/foo/bar/styles/prosilver/template/redirect_body.html8
-rw-r--r--tests/functional/fixtures/ext/foo/bar/ucp/main_info.php29
-rw-r--r--tests/functional/fixtures/ext/foo/bar/ucp/main_module.php25
-rw-r--r--tests/functional/fixtures/ext/foo/foo/composer.json24
-rw-r--r--tests/functional/fixtures/ext/foo/foo/config/resource.yml3
-rw-r--r--tests/functional/fixtures/ext/foo/foo/config/routing.yml3
-rw-r--r--tests/functional/fixtures/ext/foo/foo/config/services.yml3
-rw-r--r--tests/functional/fixtures/ext/foo/foo/controller/controller.php13
-rw-r--r--tests/functional/fixtures/ext/foo/foo/ext.php8
-rw-r--r--tests/functional/fixtures/files/disallowed.jpgbin0 -> 559 bytes
-rw-r--r--tests/functional/fixtures/files/empty.png0
-rw-r--r--tests/functional/fixtures/files/illegal-extension.bifbin0 -> 519 bytes
-rw-r--r--tests/functional/fixtures/files/too-large.pngbin0 -> 284717 bytes
-rw-r--r--tests/functional/fixtures/files/valid.jpgbin0 -> 554 bytes
-rw-r--r--tests/functional/forgot_password_test.php61
-rw-r--r--tests/functional/forum_password_test.php59
-rw-r--r--tests/functional/forum_style_test.php10
-rw-r--r--tests/functional/group_create_test.php35
-rw-r--r--tests/functional/jumpbox_test.php35
-rw-r--r--tests/functional/lang_test.php10
-rw-r--r--tests/functional/mcp_test.php32
-rw-r--r--tests/functional/memberlist_test.php137
-rw-r--r--tests/functional/metadata_manager_test.php94
-rw-r--r--tests/functional/notification_test.php88
-rw-r--r--tests/functional/paging_test.php43
-rw-r--r--tests/functional/plupload_test.php154
-rw-r--r--tests/functional/posting_test.php134
-rw-r--r--tests/functional/private_messages_test.php10
-rw-r--r--tests/functional/prune_shadow_topic_test.php211
-rw-r--r--tests/functional/registration_test.php67
-rw-r--r--tests/functional/report_post_captcha_test.php16
-rw-r--r--tests/functional/search/base.php108
-rw-r--r--tests/functional/search/mysql_test.php23
-rw-r--r--tests/functional/search/native_test.php22
-rw-r--r--tests/functional/search/postgres_test.php23
-rw-r--r--tests/functional/search/sphinx_test.php27
-rw-r--r--tests/functional/ucp_allow_pm_test.php74
-rw-r--r--tests/functional/ucp_groups_test.php46
-rw-r--r--tests/functional/ucp_pm_test.php52
-rw-r--r--tests/functional/ucp_preferences_test.php85
-rw-r--r--tests/functional/ucp_profile_test.php49
-rw-r--r--tests/functional/user_password_reset_test.php169
-rw-r--r--tests/functional/viewforum_paging_test.php256
-rw-r--r--tests/functional/visibility_disapprove_test.php323
-rw-r--r--tests/functional/visibility_reapprove_test.php419
-rw-r--r--tests/functional/visibility_softdelete_test.php841
-rw-r--r--tests/functions/build_hidden_fields_for_query_params_test.php75
-rw-r--r--tests/functions/build_url_test.php92
-rw-r--r--tests/functions/clean_path_test.php44
-rw-r--r--tests/functions/convert_30_dbms_to_31_test.php44
-rw-r--r--tests/functions/fixtures/banned_users.xml38
-rw-r--r--tests/functions/fixtures/obtain_online.xml22
-rw-r--r--tests/functions/fixtures/style_select.xml4
-rw-r--r--tests/functions/fixtures/user_delete.xml46
-rw-r--r--tests/functions/fixtures/validate_email.xml4
-rw-r--r--tests/functions/fixtures/validate_username.xml6
-rw-r--r--tests/functions/generate_string_list.php64
-rw-r--r--tests/functions/get_formatted_filesize_test.php10
-rw-r--r--tests/functions/get_preg_expression_test.php40
-rw-r--r--tests/functions/get_remote_file_test.php14
-rw-r--r--tests/functions/is_absolute_test.php12
-rw-r--r--tests/functions/language_select_test.php10
-rw-r--r--tests/functions/make_clickable_email_test.php222
-rw-r--r--tests/functions/make_clickable_test.php180
-rw-r--r--tests/functions/obtain_online_test.php55
-rw-r--r--tests/functions/parse_cfg_file_test.php27
-rw-r--r--tests/functions/phpbb_get_banned_user_ids.php62
-rw-r--r--tests/functions/quoteattr_test.php48
-rw-r--r--tests/functions/style_select_test.php10
-rw-r--r--tests/functions/user_delete_test.php113
-rw-r--r--tests/functions/validate_data_helper.php10
-rw-r--r--tests/functions/validate_date_test.php10
-rw-r--r--tests/functions/validate_email_test.php72
-rw-r--r--tests/functions/validate_hex_colour_test.php10
-rw-r--r--tests/functions/validate_jabber_test.php10
-rw-r--r--tests/functions/validate_lang_iso_test.php10
-rw-r--r--tests/functions/validate_match_test.php10
-rw-r--r--tests/functions/validate_num_test.php10
-rw-r--r--tests/functions/validate_password_test.php11
-rw-r--r--tests/functions/validate_string_test.php10
-rw-r--r--tests/functions/validate_user_email_test.php106
-rw-r--r--tests/functions/validate_username_test.php11
-rw-r--r--tests/functions/validate_with_method_test.php43
-rw-r--r--tests/functions_acp/build_cfg_template_test.php291
-rw-r--r--tests/functions_acp/build_select_test.php65
-rw-r--r--tests/functions_acp/h_radio_test.php130
-rw-r--r--tests/functions_acp/insert_config_array_test.php144
-rw-r--r--tests/functions_acp/validate_config_vars_test.php261
-rw-r--r--tests/functions_acp/validate_range_test.php168
-rw-r--r--tests/functions_content/get_username_string_test.php29
-rw-r--r--tests/functions_content/phpbb_clean_search_string_test.php10
-rw-r--r--tests/functions_database_helper/update_rows_avoiding_duplicates_notify_status_test.php10
-rw-r--r--tests/functions_database_helper/update_rows_avoiding_duplicates_test.php10
-rw-r--r--tests/functions_install/ignore_new_file_on_update_test.php45
-rw-r--r--tests/functions_user/delete_user_test.php80
-rw-r--r--tests/functions_user/fixtures/delete_user.xml32
-rw-r--r--tests/functions_user/fixtures/group_user_attributes.xml113
-rw-r--r--tests/functions_user/group_user_attributes_test.php162
-rw-r--r--tests/groupposition/fixtures/legend.xml23
-rw-r--r--tests/groupposition/fixtures/teampage.xml102
-rw-r--r--tests/groupposition/legend_test.php407
-rw-r--r--tests/groupposition/teampage_test.php645
-rw-r--r--tests/lint_test.php61
-rw-r--r--tests/lock/db_test.php101
-rw-r--r--tests/lock/fixtures/config.xml13
-rw-r--r--tests/lock/flock_test.php124
-rw-r--r--tests/log/add_test.php101
-rw-r--r--tests/log/delete_test.php157
-rw-r--r--tests/log/fixtures/delete_log.xml232
-rw-r--r--tests/log/fixtures/empty_log.xml15
-rw-r--r--tests/log/fixtures/full_log.xml184
-rw-r--r--tests/log/function_add_log_test.php197
-rw-r--r--tests/log/function_view_log_test.php409
-rw-r--r--tests/mcp/fixtures/post_ip.xml73
-rw-r--r--tests/mcp/post_ip_test.php67
-rw-r--r--tests/migrator/convert_timezones_test.php98
-rw-r--r--tests/migrator/fixtures/convert_timezones.xml66
-rw-r--r--tests/migrator/get_schema_steps_test.php204
-rw-r--r--tests/migrator/reverse_update_data_test.php56
-rw-r--r--tests/migrator/schema_generator_test.php138
-rw-r--r--tests/mimetype/fixtures/jpgbin0 -> 519 bytes
-rw-r--r--tests/mimetype/guesser_test.php230
-rw-r--r--tests/mimetype/incorrect_guesser.php22
-rw-r--r--tests/mimetype/null_guesser.php34
-rw-r--r--tests/mock/auth_provider.php27
-rw-r--r--tests/mock/cache.php113
-rw-r--r--tests/mock/container_builder.php183
-rw-r--r--tests/mock/controller_helper.php34
-rw-r--r--tests/mock/event_dispatcher.php29
-rw-r--r--tests/mock/extension_manager.php26
-rw-r--r--tests/mock/file_downloader.php27
-rw-r--r--tests/mock/filespec.php36
-rw-r--r--tests/mock/filesystem_extension_manager.php36
-rw-r--r--tests/mock/fileupload.php27
-rw-r--r--tests/mock/lang.php42
-rw-r--r--tests/mock/metadata_manager.php27
-rw-r--r--tests/mock/migrator.php55
-rw-r--r--tests/mock/notification_manager.php97
-rw-r--r--tests/mock/notification_type_post.php40
-rw-r--r--tests/mock/notifications_auth.php44
-rw-r--r--tests/mock/null_cache.php15
-rw-r--r--tests/mock/phpbb_di_container_builder.php20
-rw-r--r--tests/mock/request.php138
-rw-r--r--tests/mock/search.php27
-rw-r--r--tests/mock/session_testable.php19
-rw-r--r--tests/mock/sql_insert_buffer.php25
-rw-r--r--tests/mock/user.php15
-rw-r--r--tests/network/checkdnsrr_test.php10
-rw-r--r--tests/network/ftp_fsock_pasv_epsv_test.php10
-rw-r--r--tests/network/inet_ntop_pton_test.php58
-rw-r--r--tests/network/ip_normalise_test.php68
-rw-r--r--tests/notification/base.php140
-rw-r--r--tests/notification/convert_test.php112
-rw-r--r--tests/notification/ext/test/notification/type/test.php91
-rw-r--r--tests/notification/fixtures/convert.xml66
-rw-r--r--tests/notification/fixtures/group_request.xml24
-rw-r--r--tests/notification/fixtures/notification.xml13
-rw-r--r--tests/notification/fixtures/submit_post_notification.type.bookmark.xml161
-rw-r--r--tests/notification/fixtures/submit_post_notification.type.post.xml205
-rw-r--r--tests/notification/fixtures/submit_post_notification.type.post_in_queue.xml159
-rw-r--r--tests/notification/fixtures/submit_post_notification.type.quote.xml133
-rw-r--r--tests/notification/fixtures/submit_post_notification.type.topic.xml134
-rw-r--r--tests/notification/fixtures/user_list_trim.xml51
-rw-r--r--tests/notification/group_request_test.php114
-rw-r--r--tests/notification/manager_helper.php71
-rw-r--r--tests/notification/notification_test.php330
-rw-r--r--tests/notification/submit_post_base.php154
-rw-r--r--tests/notification/submit_post_type_bookmark_test.php94
-rw-r--r--tests/notification/submit_post_type_post_in_queue_test.php111
-rw-r--r--tests/notification/submit_post_type_post_test.php100
-rw-r--r--tests/notification/submit_post_type_quote_test.php118
-rw-r--r--tests/notification/submit_post_type_topic_test.php153
-rw-r--r--tests/notification/user_list_trim_test.php143
-rw-r--r--tests/pagination/config/routing.yml6
-rw-r--r--tests/pagination/pagination_test.php331
-rw-r--r--tests/pagination/templates/pagination.html15
-rw-r--r--tests/pagination/templates/pagination_double_nested.html19
-rw-r--r--tests/pagination/templates/pagination_sub.html17
-rw-r--r--tests/passwords/drivers_test.php416
-rw-r--r--tests/passwords/manager_test.php347
-rw-r--r--tests/path_helper/path_helper_test.php464
-rw-r--r--tests/plupload/plupload_test.php53
-rw-r--r--tests/privmsgs/delete_user_pms_test.php15
-rw-r--r--tests/privmsgs/fixtures/delete_user_pms.xml10
-rw-r--r--tests/profile/custom_test.php55
-rw-r--r--tests/profile/fixtures/profile_fields.xml31
-rw-r--r--tests/profile/get_profile_value_test.php42
-rw-r--r--tests/profilefields/type_bool_test.php195
-rw-r--r--tests/profilefields/type_date_test.php228
-rw-r--r--tests/profilefields/type_dropdown_test.php235
-rw-r--r--tests/profilefields/type_googleplus_test.php94
-rw-r--r--tests/profilefields/type_int_test.php236
-rw-r--r--tests/profilefields/type_string_test.php353
-rw-r--r--tests/profilefields/type_url_test.php181
-rw-r--r--tests/random/gen_rand_string_test.php10
-rw-r--r--tests/regex/censor_test.php10
-rw-r--r--tests/regex/email_test.php10
-rw-r--r--tests/regex/ipv4_test.php10
-rw-r--r--tests/regex/ipv6_test.php10
-rw-r--r--tests/regex/password_complexity_test.php11
-rw-r--r--tests/regex/table_prefix_test.php10
-rw-r--r--tests/regex/url_test.php12
-rw-r--r--tests/request/deactivated_super_global_test.php25
-rw-r--r--tests/request/request_test.php271
-rw-r--r--tests/request/request_var_test.php108
-rw-r--r--tests/request/type_cast_helper_test.php74
-rw-r--r--tests/search/common_test_case.php208
-rw-r--r--tests/search/fixtures/posts.xml53
-rw-r--r--tests/search/mysql_test.php45
-rw-r--r--tests/search/native_test.php262
-rw-r--r--tests/search/postgres_test.php45
-rw-r--r--tests/security/base.php54
-rw-r--r--tests/security/extract_current_page_test.php44
-rw-r--r--tests/security/hash_test.php37
-rw-r--r--tests/security/redirect_test.php105
-rw-r--r--tests/security/trailing_path_test.php60
-rw-r--r--tests/session/append_sid_test.php14
-rw-r--r--tests/session/check_ban_test.php82
-rw-r--r--tests/session/check_isvalid_test.php65
-rw-r--r--tests/session/continue_test.php121
-rw-r--r--tests/session/create_test.php47
-rw-r--r--tests/session/creation_test.php57
-rw-r--r--tests/session/extract_hostname_test.php55
-rw-r--r--tests/session/extract_page_test.php172
-rw-r--r--tests/session/fixtures/sessions_banlist.xml62
-rw-r--r--tests/session/fixtures/sessions_empty.xml8
-rw-r--r--tests/session/fixtures/sessions_full.xml11
-rw-r--r--tests/session/fixtures/sessions_garbage.xml54
-rw-r--r--tests/session/fixtures/sessions_key.xml39
-rw-r--r--tests/session/garbage_collection_test.php71
-rw-r--r--tests/session/session_key_test.php62
-rw-r--r--tests/session/testable_facade.php130
-rw-r--r--tests/session/testable_factory.php72
-rw-r--r--tests/session/unset_admin_test.php52
-rw-r--r--tests/session/validate_referrer_test.php74
-rw-r--r--tests/template/datasets/event_inheritance/ext/kappa/styles/all/template/event/test.html1
-rw-r--r--tests/template/datasets/event_inheritance/ext/kappa/styles/silver/template/event/test.html1
-rw-r--r--tests/template/datasets/event_inheritance/ext/kappa/styles/silver_inherit/template/event/test.html1
-rw-r--r--tests/template/datasets/event_inheritance/ext/omega/styles/all/template/event/test.html1
-rw-r--r--tests/template/datasets/event_inheritance/ext/omega/styles/silver/template/event/test.html1
-rw-r--r--tests/template/datasets/event_inheritance/ext/omega/styles/silver/template/event/two.html1
-rw-r--r--tests/template/datasets/event_inheritance/ext/zeta/styles/all/template/event/test.html1
-rw-r--r--tests/template/datasets/event_inheritance/styles/silver/template/event_test.html1
-rw-r--r--tests/template/datasets/event_inheritance/styles/silver/template/event_two.html1
-rw-r--r--tests/template/datasets/event_inheritance/styles/silver_inherit/template/event_test.html1
-rw-r--r--tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/event_variable_spacing.html6
-rw-r--r--tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/test_event_loop.html1
-rw-r--r--tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/test_event_subloop.html2
-rw-r--r--tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/universal.html1
-rw-r--r--tests/template/datasets/ext_trivial/ext/trivial/styles/silver/template/event/simple.html1
-rw-r--r--tests/template/datasets/ext_trivial/styles/silver/template/event_loop.html3
-rw-r--r--tests/template/datasets/ext_trivial/styles/silver/template/event_simple.html1
-rw-r--r--tests/template/datasets/ext_trivial/styles/silver/template/event_subloop.html3
-rw-r--r--tests/template/datasets/ext_trivial/styles/silver/template/event_universal.html1
-rw-r--r--tests/template/datasets/ext_trivial/styles/silver/template/variable_spacing.html1
-rw-r--r--tests/template/ext/include/css/styles/all/theme/child_only.css0
-rw-r--r--tests/template/ext/include/css/styles/all/theme/test.css0
-rw-r--r--tests/template/includephp_test.php60
-rw-r--r--tests/template/parent_templates/parent_and_child.html1
-rw-r--r--tests/template/parent_templates/parent_and_child.js1
-rw-r--r--tests/template/parent_templates/parent_only.css0
-rw-r--r--tests/template/parent_templates/parent_only.html1
-rw-r--r--tests/template/parent_templates/parent_only.js1
-rw-r--r--tests/template/subdir/includephp_from_subdir_test.php31
-rw-r--r--tests/template/template_allfolder_test.php59
-rw-r--r--tests/template/template_events_test.php153
-rw-r--r--tests/template/template_includecss_test.php97
-rw-r--r--tests/template/template_includejs_test.php109
-rw-r--r--tests/template/template_inheritance_test.php59
-rw-r--r--tests/template/template_parser_test.php33
-rw-r--r--tests/template/template_test.php707
-rw-r--r--tests/template/template_test_case.php132
-rw-r--r--tests/template/template_test_case_with_tree.php40
-rw-r--r--tests/template/templates/basic.html3
-rw-r--r--tests/template/templates/child_only.css0
-rw-r--r--tests/template/templates/child_only.html1
-rw-r--r--tests/template/templates/child_only.js1
-rw-r--r--tests/template/templates/define.html33
-rw-r--r--tests/template/templates/define_advanced.html12
-rw-r--r--tests/template/templates/define_error.html2
-rw-r--r--tests/template/templates/define_include.html3
-rw-r--r--tests/template/templates/define_include2.html11
-rw-r--r--tests/template/templates/events.html4
-rw-r--r--tests/template/templates/expressions.html29
-rw-r--r--tests/template/templates/if.html20
-rw-r--r--tests/template/templates/if_nested_tags.html1
-rw-r--r--tests/template/templates/include_define_variable.html6
-rw-r--r--tests/template/templates/include_loop.html4
-rw-r--r--tests/template/templates/include_loop1.html1
-rw-r--r--tests/template/templates/include_loop2.html1
-rw-r--r--tests/template/templates/include_loop3.html1
-rw-r--r--tests/template/templates/include_loop_define.html6
-rw-r--r--tests/template/templates/include_variable.html1
-rw-r--r--tests/template/templates/include_variables.html1
-rw-r--r--tests/template/templates/includecss.html10
-rw-r--r--tests/template/templates/includejs.html36
-rw-r--r--tests/template/templates/includephp.html1
-rw-r--r--tests/template/templates/includephp_relative.html2
-rw-r--r--tests/template/templates/includephp_variables.html2
-rw-r--r--tests/template/templates/invalid/endif_without_if.html1
-rw-r--r--tests/template/templates/invalid/output/endif_without_if.html1
-rw-r--r--tests/template/templates/invalid/output/include_nonexistent_file.html1
-rw-r--r--tests/template/templates/invalid/output/unknown_tag.html1
-rw-r--r--tests/template/templates/lang.html2
-rw-r--r--tests/template/templates/loop.html14
-rw-r--r--tests/template/templates/loop_advanced.html20
-rw-r--r--tests/template/templates/loop_expressions.html11
-rw-r--r--tests/template/templates/loop_include.html4
-rw-r--r--tests/template/templates/loop_include1.html1
-rw-r--r--tests/template/templates/loop_nested.html10
-rw-r--r--tests/template/templates/loop_nested2.html6
-rw-r--r--tests/template/templates/loop_nested_deep_multilevel_ref.html13
-rw-r--r--tests/template/templates/loop_nested_include.html4
-rw-r--r--tests/template/templates/loop_nested_include1.html5
-rw-r--r--tests/template/templates/loop_nested_multilevel_ref.html10
-rw-r--r--tests/template/templates/loop_reuse.html6
-rw-r--r--tests/template/templates/loop_size.html39
-rw-r--r--tests/template/templates/loop_underscore.html21
-rw-r--r--tests/template/templates/loop_vars.html26
-rw-r--r--tests/template/templates/parent_and_child.html1
-rw-r--r--tests/template/templates/parent_and_child.js1
-rw-r--r--tests/template/templates/subdir/parent_only.js0
-rw-r--r--tests/template/templates/subdir/subsubdir/parent_only.js0
-rw-r--r--tests/template/templates/subdir/variable.html1
-rw-r--r--tests/template/templates/trivial.html1
-rw-r--r--tests/template/templates/twig.html6
-rw-r--r--tests/template/templates/twig_parent.html7
-rw-r--r--tests/template/templates/variable_spacing.html6
-rw-r--r--tests/test_framework/phpbb_database_connection_odbc_pdo_wrapper.php12
-rw-r--r--tests/test_framework/phpbb_database_test_case.php117
-rw-r--r--tests/test_framework/phpbb_database_test_connection_manager.php213
-rw-r--r--tests/test_framework/phpbb_functional_test_case.php697
-rw-r--r--tests/test_framework/phpbb_search_test_case.php33
-rw-r--r--tests/test_framework/phpbb_session_test_case.php60
-rw-r--r--tests/test_framework/phpbb_test_case.php12
-rw-r--r--tests/test_framework/phpbb_test_case_helpers.php204
-rw-r--r--tests/test_framework/phpbb_ui_test_case.php571
-rw-r--r--tests/text_processing/censor_text_test.php16
-rw-r--r--tests/text_processing/generate_text_for_display_test.php14
-rw-r--r--tests/text_processing/make_clickable_test.php57
-rw-r--r--tests/tree/fixtures/phpbb_forums.xml13
-rw-r--r--tests/tree/nestedset_forum_base.php121
-rw-r--r--tests/tree/nestedset_forum_get_data_test.php139
-rw-r--r--tests/tree/nestedset_forum_insert_delete_test.php124
-rw-r--r--tests/tree/nestedset_forum_move_test.php573
-rw-r--r--tests/tree/nestedset_forum_regenerate_test.php76
-rw-r--r--tests/tree/nestedset_forum_test.php120
-rw-r--r--tests/ui/quick_links_test.php27
-rw-r--r--tests/upload/filespec_test.php338
-rw-r--r--tests/upload/fileupload_test.php149
-rw-r--r--tests/upload/fixture/copies/.gitkeep0
-rw-r--r--tests/upload/fixture/gifbin0 -> 35 bytes
-rw-r--r--tests/upload/fixture/jpgbin0 -> 519 bytes
-rw-r--r--tests/upload/fixture/pngbin0 -> 69 bytes
-rw-r--r--tests/upload/fixture/tifbin0 -> 256 bytes
-rw-r--r--tests/upload/fixture/txt2
-rw-r--r--tests/user/fixtures/user_loader.xml31
-rw-r--r--tests/user/lang_test.php73
-rw-r--r--tests/user/user_loader_test.php67
-rw-r--r--tests/utf/normalizer_test.php10
-rw-r--r--tests/utf/utf8_clean_string_test.php12
-rw-r--r--tests/utf/utf8_wordwrap_test.php10
-rw-r--r--tests/version/version_fetch_test.php63
-rw-r--r--tests/version/version_helper_remote_test.php216
-rw-r--r--tests/version/version_test.php827
-rw-r--r--tests/viewonline/helper_test.php46
-rw-r--r--tests/wrapper/gmgetdate_test.php60
-rw-r--r--tests/wrapper/mt_rand_test.php10
-rw-r--r--tests/wrapper/phpbb_php_ini_fake.php20
-rw-r--r--tests/wrapper/phpbb_php_ini_test.php90
-rw-r--r--tests/wrapper/version_compare_test.php10
-rwxr-xr-xtravis/check-executable-files.sh68
-rwxr-xr-xtravis/check-image-icc-profiles.sh20
-rwxr-xr-xtravis/check-sami-parse-errors.sh33
-rwxr-xr-xtravis/ext-sniff.sh27
-rwxr-xr-xtravis/install-phpbb-test-dependencies.sh16
-rwxr-xr-xtravis/phing-sniff.sh22
-rw-r--r--travis/phpunit-mariadb-travis.xml4
-rw-r--r--travis/phpunit-mysql-travis.xml10
-rw-r--r--travis/phpunit-mysqli-travis.xml46
-rw-r--r--travis/phpunit-postgres-travis.xml9
-rw-r--r--travis/phpunit-sqlite3-travis.xml46
-rwxr-xr-xtravis/prepare-extension.sh22
-rwxr-xr-xtravis/setup-database.sh31
-rwxr-xr-xtravis/setup-exiftool.sh14
-rwxr-xr-xtravis/setup-mariadb.sh9
-rwxr-xr-xtravis/setup-php-extensions.sh59
-rwxr-xr-xtravis/setup-phpbb.sh46
-rwxr-xr-xtravis/setup-unbuffer.sh14
-rwxr-xr-xtravis/setup-webserver.sh26
2316 files changed, 187268 insertions, 79314 deletions
diff --git a/.editorconfig b/.editorconfig
new file mode 100644
index 0000000000..0e7d70f2a7
--- /dev/null
+++ b/.editorconfig
@@ -0,0 +1,18 @@
+# This file is for standardising the coding style between different editors
+# http://editorconfig.org/
+
+root = true
+
+[*]
+end_of_line = lf
+indent_size = 4
+indent_style = tab
+insert_final_newline = true
+trim_trailing_whitespace = true
+
+[*.md]
+trim_trailing_whitespace = false
+
+[*.yml]
+indent_size = 4
+indent_style = space
diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md
new file mode 100644
index 0000000000..3fceabda10
--- /dev/null
+++ b/.github/CONTRIBUTING.md
@@ -0,0 +1,6 @@
+## CONTRIBUTE
+
+1. [Create an account on phpBB.com](http://www.phpbb.com/community/ucp.php?mode=register)
+2. [Create a ticket (unless there already is one)](http://tracker.phpbb.com/secure/CreateIssue!default.jspa)
+3. Read our [Coding guidelines](https://wiki.phpbb.com/Coding_guidelines) and [Git Contribution Guidelines](http://wiki.phpbb.com/Git)
+4. Send us a pull request
diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md
new file mode 100644
index 0000000000..39eb83e454
--- /dev/null
+++ b/.github/PULL_REQUEST_TEMPLATE.md
@@ -0,0 +1,10 @@
+Checklist:
+
+- [ ] Correct branch: master for new features; 3.2.x, 3.1.x for fixes
+- [ ] Tests pass
+- [ ] Code follows coding guidelines: [master / 3.2.x](https://area51.phpbb.com/docs/master/coding-guidelines.html), [3.1.x](https://area51.phpbb.com/docs/31x/coding-guidelines.html)
+- [ ] Commit follows commit message [format](https://wiki.phpbb.com/Git#Commit_Messages)
+
+Tracker ticket (set the ticket ID to **your ticket ID**):
+
+https://tracker.phpbb.com/browse/PHPBB3-12345
diff --git a/.gitignore b/.gitignore
index 06f50e9c4e..606b9c1daf 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,16 +1,25 @@
*~
/phpunit.xml
-/phpBB/cache/*.html
-/phpBB/cache/*.php
-/phpBB/cache/*.lock
+/phpBB/cache/*
+!/phpBB/cache/.htaccess
+!/phpBB/cache/index.html
/phpBB/composer.phar
/phpBB/config*.php
/phpBB/ext/*
+/phpBB/cache/*
/phpBB/files/*
/phpBB/images/avatars/gallery/*
/phpBB/images/avatars/upload/*
+/phpBB/images/ranks/*
+/phpBB/install/schemas/schema.json
+/phpBB/language/*
+!/phpBB/language/en
/phpBB/store/*
+/phpBB/styles/*
+!/phpBB/styles/prosilver
+!/phpBB/styles/subsilver2
/phpBB/vendor
-/tests/phpbb_unit_tests.sqlite2
+/tests/phpbb_unit_tests.sqlite*
/tests/test_config*.php
/tests/tmp/*
+/tests/vendor
diff --git a/.jscsrc b/.jscsrc
new file mode 100644
index 0000000000..9dd5ab82e6
--- /dev/null
+++ b/.jscsrc
@@ -0,0 +1,78 @@
+
+{
+ "excludeFiles": ["node_modules/**", "**/build/**"],
+ "requireCurlyBraces": [
+ "if", "else", "for", "while", "do", "try", "catch"
+ ],
+ "requireSpaceBeforeKeywords": [
+ "else", "while", "catch"
+ ],
+ "requireSpaceAfterKeywords": [
+ "do", "for", "if", "else", "switch", "case", "try", "catch", "while", "return", "typeof"
+ ],
+ "requireSpaceBeforeBlockStatements": true,
+ "requireParenthesesAroundIIFE": true,
+ "requireSpacesInConditionalExpression": {
+ "afterTest": true,
+ "beforeConsequent": true,
+ "afterConsequent": true,
+ "beforeAlternate": true
+ },
+ "requireSpacesInAnonymousFunctionExpression": {
+ "beforeOpeningCurlyBrace": true
+ },
+ "disallowSpacesInNamedFunctionExpression": {
+ "beforeOpeningRoundBrace": true
+ },
+ "requireSpacesInFunction": {
+ "beforeOpeningCurlyBrace": true
+ },
+ "disallowSpacesInCallExpression": true,
+ "requireBlocksOnNewline": true,
+ "requirePaddingNewlinesBeforeKeywords": ["case"],
+ "disallowEmptyBlocks": true,
+ "disallowSpacesInsideArrayBrackets": "nested",
+ "disallowSpacesInsideParentheses": true,
+ "requireSpacesInsideObjectBrackets": "all",
+ "disallowQuotedKeysInObjects": "allButReserved",
+ "disallowSpaceAfterObjectKeys": true,
+ "requireSpaceBeforeObjectValues": true,
+ "requireCommaBeforeLineBreak": true,
+ "requireOperatorBeforeLineBreak": [
+ "?", "=", "+", "-", "/", "*", "===", "!==", ">", ">=", "<", "<="
+ ],
+ "disallowSpaceAfterPrefixUnaryOperators": ["++", "--", "+", "-", "~", "!"],
+ "disallowSpaceBeforePostfixUnaryOperators": ["++", "--"],
+ "requireSpaceBeforeBinaryOperators": [
+ "=", "+", "+=", "-", "-=", "/", "/=", "*", "*=", "===", "!==", "<", "<=", ">", ">="
+ ],
+ "requireSpaceAfterBinaryOperators": [
+ "=", "+", "+=", "-", "-=", "/", "/=", "*", "*=", "===", "!==", "<", "<=", ">", ">="
+ ],
+ "disallowKeywords": ["with"],
+ "disallowMultipleLineStrings": true,
+ "disallowMixedSpacesAndTabs": "smart",
+ "disallowTrailingWhitespace": true,
+ "disallowTrailingComma": true,
+ "disallowKeywordsOnNewLine": ["else"],
+ "requireLineFeedAtFileEnd": true,
+ "maximumLineLength": {
+ "value": 120,
+ "tabSize": 4,
+ "allowUrlComments": true,
+ "allowRegex": true
+ },
+ "requireCapitalizedConstructors": true,
+ "requireDotNotation": true,
+ "disallowYodaConditions": true,
+ "requireSpaceAfterLineComment": {
+ "allExcept": ["#", "="]
+ },
+ "disallowNewlineBeforeBlockStatements": true,
+ "validateQuoteMarks": {
+ "mark": "'",
+ "escape": true
+ },
+ "validateParameterSeparator": ", ",
+ "safeContextKeyword": ["that"]
+}
diff --git a/.jshintrc b/.jshintrc
new file mode 100644
index 0000000000..c1efecd573
--- /dev/null
+++ b/.jshintrc
@@ -0,0 +1,25 @@
+
+{
+ "bitwise": true,
+ "curly": true,
+ "eqeqeq": true,
+ "es3": true,
+ "forin": false,
+ "freeze": true,
+ "newcap": true,
+ "noarg": true,
+ "noempty": true,
+ "nonbsp": true,
+ "undef": true,
+ "unused": true,
+ "strict": true,
+
+ "browser": true,
+ "devel": true,
+ "jquery": true,
+
+ "globals": {
+ "JSON": true,
+ "phpbb": true
+ }
+}
diff --git a/.travis.yml b/.travis.yml
index bb8f13c400..a46d825612 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,38 +1,49 @@
language: php
-php:
- - 5.3.3
- - 5.3
- - 5.4
- - 5.5
- - 5.6
- - hhvm
-
-env:
- - DB=mysql
-
-before_script:
- - sh -c "if [ '$DB' = 'postgres' ]; then psql -c 'DROP DATABASE IF EXISTS phpbb_tests;' -U postgres; fi"
- - sh -c "if [ '$DB' = 'postgres' ]; then psql -c 'create database phpbb_tests;' -U postgres; fi"
- - sh -c "if [ '$DB' = 'mariadb' ]; then travis/setup-mariadb.sh; fi"
- - sh -c "if [ '$TRAVIS_PHP_VERSION' = '5.3' -a '$DB' = 'mysql' ]; then mysql -e 'SET GLOBAL storage_engine=MyISAM;'; fi"
- - sh -c "if [ '$DB' = 'mysql' -o '$DB' = 'mariadb' ]; then mysql -e 'create database IF NOT EXISTS phpbb_tests;'; fi"
- - cd phpBB
- - php ../composer.phar install --dev --no-interaction --prefer-source
- - cd ..
- - sh -c "if [ `php -r "echo (int) version_compare(PHP_VERSION, '5.3.19', '>=');"` = "1" ]; then travis/setup-webserver.sh; fi"
- - sh -c "if [ '$TRAVIS_PHP_VERSION' = '5.3.3' -a '$DB' = 'mysql' ]; then sudo apt-get update; sudo apt-get install -y parallel libimage-exiftool-perl; fi"
-
-script:
- - phpBB/vendor/bin/phpunit --configuration travis/phpunit-$DB-travis.xml
- - sh -c "if [ '$TRAVIS_PHP_VERSION' = '5.3.3' -a '$DB' = 'mysql' -a '$TRAVIS_PULL_REQUEST' != 'false' ]; then git-tools/commit-msg-hook-range.sh origin/$TRAVIS_BRANCH..FETCH_HEAD; fi"
- - sh -c "if [ '$TRAVIS_PHP_VERSION' = '5.3.3' -a '$DB' = 'mysql' ]; then find . -type f -not -path './phpBB/vendor/*' -iregex '.*\.\(gif\|jpg\|jpeg\|png\)$' | parallel --gnu --keep-order 'phpBB/develop/strip_icc_profiles.sh {}' || exit 1; fi"
matrix:
include:
+ - php: 5.3.3
+ env: DB=mysqli
+ - php: 5.3
+ env: DB=mysqli # MyISAM
+ - php: 5.4
+ env: DB=mysqli
+ - php: 5.4
+ env: DB=mysql
- php: 5.4
env: DB=mariadb
- php: 5.4
env: DB=postgres
+ - php: 5.4
+ env: DB=sqlite3
+ - php: 5.4
+ env: DB=mysqli;SLOWTESTS=1
+ - php: 5.5
+ env: DB=mysqli
+ - php: 5.6
+ env: DB=mysqli
+ - php: hhvm
+ env: DB=mysqli
allow_failures:
- php: hhvm
fast_finish: true
+
+services:
+ - redis-server
+
+install:
+ - travis/setup-phpbb.sh $DB $TRAVIS_PHP_VERSION
+
+before_script:
+ - travis/setup-database.sh $DB $TRAVIS_PHP_VERSION
+ - phantomjs --webdriver=8910 > /dev/null &
+
+script:
+ - travis/phing-sniff.sh $DB $TRAVIS_PHP_VERSION
+ - travis/check-sami-parse-errors.sh $DB $TRAVIS_PHP_VERSION
+ - travis/check-image-icc-profiles.sh $DB $TRAVIS_PHP_VERSION
+ - travis/check-executable-files.sh $DB $TRAVIS_PHP_VERSION ./
+ - sh -c "if [ '$SLOWTESTS' != '1' -a '$DB' = 'mysqli' ]; then phpBB/vendor/bin/phpunit tests/lint_test.php; fi"
+ - sh -c "if [ '$SLOWTESTS' != '1' ]; then phpBB/vendor/bin/phpunit --configuration travis/phpunit-$DB-travis.xml; fi"
+ - sh -c "if [ '$SLOWTESTS' = '1' ]; then phpBB/vendor/bin/phpunit --configuration travis/phpunit-$DB-travis.xml --group slow; fi"
+ - sh -c "if [ '$TRAVIS_PHP_VERSION' = '5.3.3' -a '$DB' = 'mysqli' -a '$TRAVIS_PULL_REQUEST' != 'false' ]; then git-tools/commit-msg-hook-range.sh origin/$TRAVIS_BRANCH..FETCH_HEAD; fi"
diff --git a/README.md b/README.md
index 0c2af7a009..f465d7496e 100644
--- a/README.md
+++ b/README.md
@@ -2,26 +2,34 @@
## ABOUT
-phpBB is a free bulletin board written in PHP.
+phpBB is a free open-source bulletin board written in PHP.
## COMMUNITY
-Find support and lots more on [phpBB.com](http://www.phpbb.com)! Discuss the development on [area51](http://area51.phpbb.com/phpBB/index.php).
+Get your copy of phpBB, find support and lots more on [phpBB.com](http://www.phpbb.com)! Discuss the development on [area51](http://area51.phpbb.com/phpBB/index.php).
+
+## INSTALLING DEPENDENCIES
+
+To be able to run an installation from the repo (and not from a pre-built package) you need to run the following commands to install phpBB's dependencies.
+
+ cd phpBB
+ php ../composer.phar install
+
## CONTRIBUTE
1. [Create an account on phpBB.com](http://www.phpbb.com/community/ucp.php?mode=register)
2. [Create a ticket (unless there already is one)](http://tracker.phpbb.com/secure/CreateIssue!default.jspa)
-3. [Read our Git Contribution Guidelines](http://wiki.phpbb.com/Git); if you're new to git, also read [the introduction guide](http://wiki.phpbb.com/display/DEV/Working+with+Git)
+3. Read our [Coding guidelines](https://wiki.phpbb.com/Coding_guidelines) and [Git Contribution Guidelines](http://wiki.phpbb.com/Git)
4. Send us a pull request
## AUTOMATED TESTING
-We have unit and functional tests in order to prevent regressions. You can view the bamboo continuous integration [here](http://bamboo.phpbb.com) or check our travis build below:
+We have unit and functional tests in order to prevent regressions. You can view the bamboo continuous integration [here](http://bamboo.phpbb.com) or check our travis builds below:
* [![Build Status](https://secure.travis-ci.org/phpbb/phpbb.png?branch=master)](http://travis-ci.org/phpbb/phpbb) **master** - Latest development version
+* [![Build Status](https://secure.travis-ci.org/phpbb/phpbb.png?branch=3.2.x)](http://travis-ci.org/phpbb/phpbb) **3.2.x** - Development of version 3.2.x
* [![Build Status](https://secure.travis-ci.org/phpbb/phpbb.png?branch=3.1.x)](http://travis-ci.org/phpbb/phpbb) **3.1.x** - Development of version 3.1.x
-* [![Build Status](https://secure.travis-ci.org/phpbb/phpbb.png?branch=3.0.x)](http://travis-ci.org/phpbb/phpbb) **3.0.x** - Development of version 3.0.x
## LICENSE
diff --git a/build/build.xml b/build/build.xml
index ea98842f85..20ecfefc61 100644
--- a/build/build.xml
+++ b/build/build.xml
@@ -2,9 +2,9 @@
<project name="phpBB" description="The phpBB forum software" default="all" basedir="../">
<!-- a few settings for the build -->
- <property name="newversion" value="3.0.14" />
- <property name="prevversion" value="3.0.14-RC1" />
- <property name="olderversions" value="3.0.2, 3.0.3, 3.0.4, 3.0.5, 3.0.6, 3.0.7, 3.0.7-PL1, 3.0.8, 3.0.9, 3.0.10, 3.0.11, 3.0.12, 3.0.13, 3.0.13-PL1" />
+ <property name="newversion" value="3.1.11" />
+ <property name="prevversion" value="3.1.10" />
+ <property name="olderversions" value="3.0.14, 3.1.0, 3.1.1, 3.1.2, 3.1.3, 3.1.4, 3.1.5, 3.1.6, 3.1.7, 3.1.7-pl1, 3.1.8, 3.1.9, 3.1.11-RC1" />
<!-- no configuration should be needed beyond this point -->
<property name="oldversions" value="${olderversions}, ${prevversion}" />
@@ -49,7 +49,7 @@
-->
<target name="composer">
<exec dir="phpBB"
- command="php ../composer.phar install --dev"
+ command="php ../composer.phar install --ignore-platform-reqs"
checkreturn="true"
passthru="true" />
</target>
@@ -73,6 +73,50 @@
passthru="true" />
</target>
+ <target name="sniff">
+ <exec command="phpBB/vendor/bin/phpcs
+ -s -p
+ --extensions=php
+ --standard=build/code_sniffer/ruleset-php-strict-core.xml
+ --ignore=${project.basedir}/phpBB/phpbb/db/migration/data/v30x/*
+ phpBB/phpbb"
+ dir="." returnProperty="retval-php-strict" passthru="true" />
+ <exec command="phpBB/vendor/bin/phpcs
+ -s -p
+ --extensions=php
+ --standard=build/code_sniffer/ruleset-php-legacy-core.xml
+ --ignore=${project.basedir}/phpBB/cache/*
+ --ignore=${project.basedir}/phpBB/develop/*
+ --ignore=${project.basedir}/phpBB/ext/*
+ --ignore=${project.basedir}/phpBB/includes/diff/*.php
+ --ignore=${project.basedir}/phpBB/includes/sphinxapi.php
+ --ignore=${project.basedir}/phpBB/includes/utf/data/*
+ --ignore=${project.basedir}/phpBB/install/data/*
+ --ignore=${project.basedir}/phpBB/install/database_update.php
+ --ignore=${project.basedir}/phpBB/phpbb/*
+ --ignore=${project.basedir}/phpBB/vendor/*
+ phpBB"
+ dir="." returnProperty="retval-php-legacy" passthru="true" />
+ <exec command="phpBB/vendor/bin/phpcs
+ -s -p
+ --extensions=php
+ --standard=build/code_sniffer/ruleset-php-extensions.xml
+ --ignore=${project.basedir}/phpBB/ext/*/tests/*
+ --ignore=${project.basedir}/phpBB/ext/*/vendor/*
+ phpBB/ext"
+ dir="." returnProperty="retval-php-ext" passthru="true" />
+ <if>
+ <or>
+ <not><equals arg1="${retval-php-strict}" arg2="0" /></not>
+ <not><equals arg1="${retval-php-legacy}" arg2="0" /></not>
+ <not><equals arg1="${retval-php-ext}" arg2="0" /></not>
+ </or>
+ <then>
+ <fail message="PHP Code Sniffer failed." />
+ </then>
+ </if>
+ </target>
+
<!-- Builds docs for current branch into build/api/output/master -->
<target name="docs">
<exec dir="."
@@ -99,14 +143,16 @@
<phingcall target="export">
<property name="revision" value="release-${version}" />
<property name="dir" value="build/old_versions/release-${version}" />
+ <property name="skip-composer" value="true" />
</phingcall>
<phingcall target="clean-diff-dir">
<property name="dir" value="build/old_versions/release-${version}" />
</phingcall>
- <exec dir="build/old_versions" command="LC_ALL=C diff -crNEBwd release-${version} release-${newversion} >
+ <exec dir="build/old_versions" command="LC_ALL=C diff -crNEBZbd release-${version} release-${newversion} >
../new_version/patches/phpBB-${version}_to_${newversion}.patch" escape="false" />
+ <exec dir="build/old_versions" command="LC_ALL=C diff -qr release-${version} release-${newversion} | grep 'Only in release-${version}' > ../new_version/patches/phpBB-${version}_to_${newversion}.deleted" escape="false" />
</target>
<target name="prepare-new-version">
@@ -132,13 +178,13 @@
<target name="package" depends="clean,prepare,prepare-new-version,old-version-diffs">
<exec dir="build" command="php -f package.php '${versions}' > logs/package.log" escape="false" />
<exec dir="build" escape="false"
- command="diff -crNEBwd old_versions/release-${prevversion}/language new_version/phpBB3/language >
+ command="LC_ALL=C diff -crNEBZbd old_versions/release-${prevversion}/language new_version/phpBB3/language >
save/phpbb-${prevversion}_to_${newversion}_language.patch" />
<exec dir="build" escape="false"
- command="diff -crNEBwd old_versions/release-${prevversion}/styles/prosilver new_version/phpBB3/styles/prosilver >
+ command="LC_ALL=C diff -crNEBZbd old_versions/release-${prevversion}/styles/prosilver new_version/phpBB3/styles/prosilver >
save/phpbb-${prevversion}_to_${newversion}_prosilver.patch" />
<exec dir="build" escape="false"
- command="diff -crNEBwd old_versions/release-${prevversion}/styles/subsilver2 new_version/phpBB3/styles/subsilver2 >
+ command="LC_ALL=C diff -crNEBZbd old_versions/release-${prevversion}/styles/subsilver2 new_version/phpBB3/styles/subsilver2 >
save/phpbb-${prevversion}_to_${newversion}_subsilver2.patch" />
<exec dir="build" escape="false"
@@ -206,26 +252,35 @@
<equals arg1="${composer-has-dependencies}" arg2="1" trim="true" />
<then>
<!-- We have non-dev composer dependencies -->
- <exec dir="."
- command="git ls-tree ${revision} composer.phar"
- checkreturn="true"
- outputProperty='composer-ls-tree-output' />
<if>
- <equals arg1="${composer-ls-tree-output}" arg2="" trim="true" />
+ <not><isset property="skip-composer" /></not>
<then>
- <fail message="There are composer dependencies, but composer.phar is missing." />
- </then>
- <else>
- <!-- Export the phar, install dependencies, delete phar. -->
<exec dir="."
- command="git archive ${revision} composer.phar | tar -xf - -C ${dir}"
- checkreturn="true" />
- <exec dir="${dir}"
- command="php composer.phar install --no-dev"
+ command="git ls-tree ${revision} composer.phar"
checkreturn="true"
- passthru="true" />
- <delete file="${dir}/composer.phar" />
- </else>
+ outputProperty='composer-ls-tree-output' />
+ <if>
+ <equals arg1="${composer-ls-tree-output}" arg2="" trim="true" />
+ <then>
+ <fail message="There are composer dependencies, but composer.phar is missing." />
+ </then>
+ <else>
+ <!-- Export the phar, install dependencies, delete phar. -->
+ <exec dir="."
+ command="git archive ${revision} composer.phar | tar -xf - -C ${dir}"
+ checkreturn="true" />
+ <exec dir="${dir}"
+ command="php composer.phar install --no-dev --optimize-autoloader --ignore-platform-reqs"
+ checkreturn="true"
+ passthru="true" />
+ <delete file="${dir}/composer.phar" />
+
+ <phingcall target="clean-vendor-dir">
+ <property name="dir" value="${dir}" />
+ </phingcall>
+ </else>
+ </if>
+ </then>
</if>
</then>
<else>
@@ -235,6 +290,9 @@
</else>
</if>
+ <!-- Create schema.json -->
+ <exec dir="${dir}" command="php develop/create_schema_files.php" />
+
<delete file="${dir}/config.php" />
<delete dir="${dir}/develop" />
<delete dir="${dir}/install/data" />
@@ -250,6 +308,91 @@
<chmod mode="0777" file="${dir}/images/avatars/upload" />
</target>
+ <target name="clean-vendor-dir">
+ <!-- Delete unrelated files from vendor/, see PHPBB3-12390 -->
+ <delete dir="${dir}/vendor/lusitanian/oauth/examples" />
+ <delete dir="${dir}/vendor/lusitanian/oauth/tests" />
+ <delete file="${dir}/vendor/lusitanian/oauth/.gitignore" />
+ <delete file="${dir}/vendor/lusitanian/oauth/.scrutinizer.yml" />
+ <delete file="${dir}/vendor/lusitanian/oauth/.travis.yml" />
+ <delete file="${dir}/vendor/lusitanian/oauth/phpunit.xml.dist" />
+ <delete file="${dir}/vendor/lusitanian/oauth/README.md" />
+
+ <delete dir="${dir}/vendor/psr/log/Psr/Log/Test" />
+ <delete file="${dir}/vendor/psr/log/.gitignore" />
+ <delete file="${dir}/vendor/psr/log/README.md" />
+
+ <delete dir="${dir}/vendor/symfony/config/Symfony/Component/Config/Tests" />
+ <delete file="${dir}/vendor/symfony/config/Symfony/Component/Config/.gitignore" />
+ <delete file="${dir}/vendor/symfony/config/Symfony/Component/Config/CHANGELOG.md" />
+ <delete file="${dir}/vendor/symfony/config/Symfony/Component/Config/README.md" />
+ <delete file="${dir}/vendor/symfony/config/Symfony/Component/Config/phpunit.xml.dist" />
+
+ <delete dir="${dir}/vendor/symfony/console/Symfony/Component/Console/Tests" />
+ <delete file="${dir}/vendor/symfony/console/Symfony/Component/Console/.gitignore" />
+ <delete file="${dir}/vendor/symfony/console/Symfony/Component/Console/CHANGELOG.md" />
+ <delete file="${dir}/vendor/symfony/console/Symfony/Component/Console/README.md" />
+ <delete file="${dir}/vendor/symfony/console/Symfony/Component/Console/phpunit.xml.dist" />
+
+ <delete dir="${dir}/vendor/symfony/debug/Symfony/Component/Debug/Tests" />
+ <delete file="${dir}/vendor/symfony/debug/Symfony/Component/Debug/.gitignore" />
+ <delete file="${dir}/vendor/symfony/debug/Symfony/Component/Debug/CHANGELOG.md" />
+ <delete file="${dir}/vendor/symfony/debug/Symfony/Component/Debug/README.md" />
+ <delete file="${dir}/vendor/symfony/debug/Symfony/Component/Debug/phpunit.xml.dist" />
+
+ <delete dir="${dir}/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests" />
+ <delete file="${dir}/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/.gitignore" />
+ <delete file="${dir}/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/CHANGELOG.md" />
+ <delete file="${dir}/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/README.md" />
+ <delete file="${dir}/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/phpunit.xml.dist" />
+
+ <delete dir="${dir}/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Tests" />
+ <delete file="${dir}/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/.gitignore" />
+ <delete file="${dir}/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/CHANGELOG.md" />
+ <delete file="${dir}/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/README.md" />
+ <delete file="${dir}/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/phpunit.xml.dist" />
+
+ <delete dir="${dir}/vendor/symfony/filesystem/Symfony/Component/Filesystem/Tests" />
+ <delete file="${dir}/vendor/symfony/filesystem/Symfony/Component/Filesystem/.gitignore" />
+ <delete file="${dir}/vendor/symfony/filesystem/Symfony/Component/Filesystem/CHANGELOG.md" />
+ <delete file="${dir}/vendor/symfony/filesystem/Symfony/Component/Filesystem/README.md" />
+ <delete file="${dir}/vendor/symfony/filesystem/Symfony/Component/Filesystem/phpunit.xml.dist" />
+
+ <delete dir="${dir}/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests" />
+ <delete file="${dir}/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/.gitignore" />
+ <delete file="${dir}/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/CHANGELOG.md" />
+ <delete file="${dir}/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/README.md" />
+ <delete file="${dir}/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/phpunit.xml.dist" />
+
+ <delete dir="${dir}/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests" />
+ <delete file="${dir}/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/.gitignore" />
+ <delete file="${dir}/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/CHANGELOG.md" />
+ <delete file="${dir}/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/README.md" />
+ <delete file="${dir}/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/phpunit.xml.dist" />
+
+ <delete dir="${dir}/vendor/symfony/routing/Symfony/Component/Routing/Tests" />
+ <delete file="${dir}/vendor/symfony/routing/Symfony/Component/Routing/.gitignore" />
+ <delete file="${dir}/vendor/symfony/routing/Symfony/Component/Routing/CHANGELOG.md" />
+ <delete file="${dir}/vendor/symfony/routing/Symfony/Component/Routing/README.md" />
+ <delete file="${dir}/vendor/symfony/routing/Symfony/Component/Routing/phpunit.xml.dist" />
+
+ <delete dir="${dir}/vendor/symfony/yaml/Symfony/Component/Yaml/Tests" />
+ <delete file="${dir}/vendor/symfony/yaml/Symfony/Component/Yaml/.gitignore" />
+ <delete file="${dir}/vendor/symfony/yaml/Symfony/Component/Yaml/CHANGELOG.md" />
+ <delete file="${dir}/vendor/symfony/yaml/Symfony/Component/Yaml/README.md" />
+ <delete file="${dir}/vendor/symfony/yaml/Symfony/Component/Yaml/phpunit.xml.dist" />
+
+ <delete dir="${dir}/vendor/twig/twig/doc" />
+ <delete dir="${dir}/vendor/twig/twig/ext" />
+ <delete dir="${dir}/vendor/twig/twig/test" />
+ <delete file="${dir}/vendor/twig/twig/.editorconfig" />
+ <delete file="${dir}/vendor/twig/twig/.gitignore" />
+ <delete file="${dir}/vendor/twig/twig/.travis.yml" />
+ <delete file="${dir}/vendor/twig/twig/CHANGELOG" />
+ <delete file="${dir}/vendor/twig/twig/phpunit.xml.dist" />
+ <delete file="${dir}/vendor/twig/twig/README.rst" />
+ </target>
+
<target name="clean-diff-dir">
<delete dir="${dir}/cache" />
<delete dir="${dir}/docs" />
diff --git a/build/build_announcement.php b/build/build_announcement.php
index 3ee96fc67d..0718bbc82a 100755
--- a/build/build_announcement.php
+++ b/build/build_announcement.php
@@ -2,9 +2,13 @@
<?php
/**
*
-* @package build
-* @copyright (c) 2013 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -22,16 +26,20 @@ $checksum_algorithm = $_SERVER['argv'][4];
$series_version = substr($version, 0, 3);
$base_url = "https://download.phpbb.com/pub/release/$series_version";
-if (strpos($version, 'RC') === false)
+if (version_compare($version, "$series_version.0", '<'))
+{
+ // Everything before 3.x.0, i.e. unstable (e.g. alpha, beta, rc)
+ $url = "$base_url/unstable/$version";
+}
+else if (strpos($version, 'RC') !== false)
{
- // Final release
- $install_url = "$base_url/$version";
- $update_url = "$base_url/update/to_$version";
+ // Release candidate of stable release
+ $url = "$base_url/qa/$version";
}
else
{
- $install_url = "$base_url/release_candidates/$version";
- $update_url = "$base_url/release_candidates/update/other_to_$version";
+ // Stable release (e.g. 3.x.0, 3.x.1, 3.x.2, 3.x.3-PL1)
+ $url = "$base_url/$version";
}
if ($mode === 'bbcode')
@@ -58,41 +66,19 @@ function phpbb_string_ends_with($haystack, $needle)
return substr($haystack, -strlen($needle)) === $needle;
}
-function phpbb_is_update_file($filename)
-{
- return strpos($filename, '_to_') !== false;
-}
-
function phpbb_get_checksum($checksum_file)
{
return array_shift(explode(' ', file_get_contents($checksum_file)));
}
-$install_files = $update_files = array();
foreach (phpbb_rnatsort(array_diff(scandir($root), array('.', '..'))) as $filename)
{
if (phpbb_string_ends_with($filename, $checksum_algorithm))
{
continue;
}
- else if (phpbb_is_update_file($filename))
- {
- $update_files[] = $filename;
- }
else
{
- $install_files[] = $filename;
+ printf($template, $url, $filename, phpbb_get_checksum("$root/$filename.$checksum_algorithm"));
}
}
-
-foreach ($install_files as $filename)
-{
- printf($template, $install_url, $filename, phpbb_get_checksum("$root/$filename.$checksum_algorithm"));
-}
-
-echo "\n";
-
-foreach ($update_files as $filename)
-{
- printf($template, $update_url, $filename, phpbb_get_checksum("$root/$filename.$checksum_algorithm"));
-}
diff --git a/build/build_changelog.php b/build/build_changelog.php
index 1e80959adf..2d38480f9f 100755
--- a/build/build_changelog.php
+++ b/build/build_changelog.php
@@ -2,9 +2,13 @@
<?php
/**
*
-* @package build
-* @copyright (c) 2011 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -16,7 +20,7 @@ if ($_SERVER['argc'] != 2)
$fixVersion = $_SERVER['argv'][1];
-$query = 'project = PHPBB3
+$query = 'project IN (PHPBB3, SECURITY)
AND resolution = Fixed
AND fixVersion = "' . $fixVersion . '"
AND status IN ("Unverified Fix", Closed)';
diff --git a/build/build_helper.php b/build/build_helper.php
index d6169b913b..3ff1b89eab 100644
--- a/build/build_helper.php
+++ b/build/build_helper.php
@@ -1,9 +1,13 @@
<?php
/**
*
-* @package build
-* @copyright (c) 2010 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -18,11 +22,11 @@ class build_package
// -r - compare recursive
// -N - Treat missing files as empty
// -E - Ignore tab expansions
- // not used: -b - Ignore space changes.
- // -w - Ignore all whitespace
+ // -Z - Ignore white space at line end.
+ // -b - Ignore changes in the amount of white space.
// -B - Ignore blank lines
// -d - Try to find smaller set of changes
- var $diff_options = '-crNEBwd';
+ var $diff_options = '-crNEBZbd';
var $diff_options_long = '-x images -crNEB'; // -x fonts -x imageset //imageset not used here, because it includes the imageset.cfg file. ;)
var $verbose = false;
@@ -312,4 +316,63 @@ class build_package
return $result;
}
+
+ /**
+ * Collect the list of the deleted files from a list of deleted files and folders.
+ *
+ * @param string $deleted_filename The full path to a file containing the list of deleted files and directories
+ * @param string $package_name The name of the package
+ * @return array
+ */
+ public function collect_deleted_files($deleted_filename, $package_name)
+ {
+ $result = array();
+ $file_contents = file($deleted_filename);
+
+ foreach ($file_contents as $filename)
+ {
+ $filename = trim($filename);
+
+ if (!$filename)
+ {
+ continue;
+ }
+
+ $filename = str_replace('Only in ' . $package_name, '', $filename);
+ $filename = ltrim($filename, '/');
+
+ if (substr($filename, 0, 1) == ':')
+ {
+ $replace = '';
+ }
+ else
+ {
+ $replace = '/';
+ }
+
+ $filename = str_replace(': ', $replace, $filename);
+
+ if (is_dir("{$this->locations['old_versions']}{$package_name}/{$filename}"))
+ {
+ $iterator = new \RecursiveIteratorIterator(
+ new \RecursiveDirectoryIterator(
+ "{$this->locations['old_versions']}{$package_name}/{$filename}",
+ \FilesystemIterator::UNIX_PATHS | \FilesystemIterator::SKIP_DOTS
+ ),
+ \RecursiveIteratorIterator::LEAVES_ONLY
+ );
+
+ foreach ($iterator as $file_info)
+ {
+ $result[] = "{$filename}/{$iterator->getSubPathname()}";
+ }
+ }
+ else
+ {
+ $result[] = $filename;
+ }
+ }
+
+ return $result;
+ }
}
diff --git a/build/code_sniffer/phpbb/Sniffs/Commenting/FileCommentSniff.php b/build/code_sniffer/phpbb/Sniffs/Commenting/FileCommentSniff.php
new file mode 100644
index 0000000000..8c0ec853ff
--- /dev/null
+++ b/build/code_sniffer/phpbb/Sniffs/Commenting/FileCommentSniff.php
@@ -0,0 +1,232 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+/**
+* Checks that each PHP source file contains a valid header as defined by the
+* phpBB Coding Guidelines.
+*
+* @package code_sniffer
+* @author Manuel Pichler <mapi@phpundercontrol.org>
+*/
+class phpbb_Sniffs_Commenting_FileCommentSniff implements PHP_CodeSniffer_Sniff
+{
+ /**
+ * Returns an array of tokens this test wants to listen for.
+ *
+ * @return array
+ */
+ public function register()
+ {
+ return array(T_OPEN_TAG);
+ }
+
+ /**
+ * Processes this test, when one of its tokens is encountered.
+ *
+ * @param PHP_CodeSniffer_File $phpcsFile The file being scanned.
+ * @param int $stackPtr The position of the current token
+ * in the stack passed in $tokens.
+ *
+ * @return null
+ */
+ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
+ {
+ // We are only interested in the first file comment.
+ if ($stackPtr !== 0)
+ {
+ if ($phpcsFile->findPrevious(T_OPEN_TAG, $stackPtr - 1) !== false)
+ {
+ return;
+ }
+ }
+
+ // Fetch next non whitespace token
+ $tokens = $phpcsFile->getTokens();
+ $start = $phpcsFile->findNext(T_WHITESPACE, $stackPtr + 1, null, true);
+
+ // Skip empty files
+ if ($tokens[$start]['code'] === T_CLOSE_TAG)
+ {
+ return;
+ }
+ // Mark as error if this is not a doc comment
+ else if ($start === false || $tokens[$start]['code'] !== T_DOC_COMMENT_OPEN_TAG)
+ {
+ $phpcsFile->addError('Missing required file doc comment.', $stackPtr);
+ return;
+ }
+
+ // Find comment end token
+ $end = $tokens[$start]['comment_closer'];
+
+ // If there is no end, skip processing here
+ if ($end === false)
+ {
+ return;
+ }
+
+ // check comment lines without the first(/**) an last(*/) line
+ for ($token = $start + 1, $c = $end - 2; $token <= $c; ++$token)
+ {
+ // Check that each line starts with a '*'
+ if ($tokens[$token]['column'] === 1 && (($tokens[$token]['content'] !== '*' && $tokens[$token]['content'] !== ' ') || ($tokens[$token]['content'] === ' ' && $tokens[$token + 1]['content'] !== '*')))
+ {
+ $message = 'The file doc comment should not be indented.';
+ $phpcsFile->addWarning($message, $token);
+ }
+ }
+
+ // Check that the first and last line is empty
+ // /**T_WHITESPACE
+ // (T_WHITESPACE)*T_WHITESPACE
+ // (T_WHITESPACE)* ...
+ // (T_WHITESPACE)*T_WHITESPACE
+ // T_WHITESPACE*/
+ if (!(($tokens[$start + 2]['content'] !== '*' && $tokens[$start + 4]['content'] !== '*') || ($tokens[$start + 3]['content'] !== '*' && $tokens[$start + 6]['content'] !== '*')))
+ {
+ $message = 'The first file comment line should be empty.';
+ $phpcsFile->addWarning($message, ($start + 1));
+ }
+
+ if ($tokens[$end - 3]['content'] !== '*' && $tokens[$end - 6]['content'] !== '*')
+ {
+ $message = 'The last file comment line should be empty.';
+ $phpcsFile->addWarning($message, $end - 1);
+ }
+
+ //$this->processPackage($phpcsFile, $start, $tags);
+ //$this->processVersion($phpcsFile, $start, $tags);
+ $this->processCopyright($phpcsFile, $start, $tokens[$start]['comment_tags']);
+ $this->processLicense($phpcsFile, $start, $tokens[$start]['comment_tags']);
+ }
+
+ /**
+ * Checks that the tags array contains a valid package tag
+ *
+ * @param PHP_CodeSniffer_File $phpcsFile The context source file instance.
+ * @param integer The stack pointer for the first comment token.
+ * @param array(string=>array) $tags The found file doc comment tags.
+ *
+ * @return null
+ */
+ protected function processPackage(PHP_CodeSniffer_File $phpcsFile, $ptr, $tags)
+ {
+ if (!isset($tags['package']))
+ {
+ $message = 'Missing require @package tag in file doc comment.';
+ $phpcsFile->addError($message, $ptr);
+ }
+ else if (preg_match('/^([\w]+)$/', $tags['package'][0]) === 0)
+ {
+ $message = 'Invalid content found for @package tag.';
+ $phpcsFile->addWarning($message, $tags['package'][1]);
+ }
+ }
+
+ /**
+ * Checks that the tags array contains a valid version tag
+ *
+ * @param PHP_CodeSniffer_File $phpcsFile The context source file instance.
+ * @param integer The stack pointer for the first comment token.
+ * @param array(string=>array) $tags The found file doc comment tags.
+ *
+ * @return null
+ */
+ protected function processVersion(PHP_CodeSniffer_File $phpcsFile, $ptr, $tags)
+ {
+ if (!isset($tags['version']))
+ {
+ $message = 'Missing require @version tag in file doc comment.';
+ $phpcsFile->addError($message, $ptr);
+ }
+ else if (preg_match('/^\$Id:[^\$]+\$$/', $tags['version'][0]) === 0)
+ {
+ $message = 'Invalid content found for @version tag, use "$Id: $".';
+ $phpcsFile->addError($message, $tags['version'][1]);
+ }
+ }
+
+ /**
+ * Checks that the tags array contains a valid copyright tag
+ *
+ * @param PHP_CodeSniffer_File $phpcsFile The context source file instance.
+ * @param integer The stack pointer for the first comment token.
+ * @param array(string=>array) $tags The found file doc comment tags.
+ *
+ * @return null
+ */
+ protected function processCopyright(PHP_CodeSniffer_File $phpcsFile, $ptr, $tags)
+ {
+ $copyright = '(c) phpBB Limited <https://www.phpbb.com>';
+ $tokens = $phpcsFile->getTokens();
+
+ foreach ($tags as $tag)
+ {
+ if ($tokens[$tag]['content'] === '@copyright')
+ {
+ if ($tokens[$tag + 2]['content'] !== $copyright)
+ {
+ $message = 'Invalid content found for the first @copyright tag, use "' . $copyright . '".';
+ $phpcsFile->addError($message, $tags['copyright'][0][1]);
+ }
+
+ return;
+ }
+ }
+
+ $message = 'Missing require @copyright tag in file doc comment.';
+ $phpcsFile->addError($message, $ptr);
+ }
+
+ /**
+ * Checks that the tags array contains a valid license tag
+ *
+ * @param PHP_CodeSniffer_File $phpcsFile The context source file instance.
+ * @param integer The stack pointer for the first comment token.
+ * @param array(string=>array) $tags The found file doc comment tags.
+ *
+ * @return null
+ */
+ protected function processLicense(PHP_CodeSniffer_File $phpcsFile, $ptr, $tags)
+ {
+ $license = 'GNU General Public License, version 2 (GPL-2.0)';
+ $tokens = $phpcsFile->getTokens();
+
+ $found = false;
+ foreach ($tags as $tag)
+ {
+ if ($tokens[$tag]['content'] === '@license')
+ {
+ if ($found)
+ {
+ $message = 'It must be only one @license tag in file doc comment.';
+ $phpcsFile->addError($message, $ptr);
+ }
+
+ $found = true;
+
+ if ($tokens[$tag + 2]['content'] !== $license)
+ {
+ $message = 'Invalid content found for @license tag, use "' . $license . '".';
+ $phpcsFile->addError($message, $tags['license'][0][1]);
+ }
+ }
+ }
+
+ if (!$found)
+ {
+ $message = 'Missing require @license tag in file doc comment.';
+ $phpcsFile->addError($message, $ptr);
+ }
+ }
+}
diff --git a/build/code_sniffer/phpbb/Sniffs/ControlStructures/OpeningBraceBsdAllmanSniff.php b/build/code_sniffer/phpbb/Sniffs/ControlStructures/OpeningBraceBsdAllmanSniff.php
new file mode 100644
index 0000000000..885c38c5b4
--- /dev/null
+++ b/build/code_sniffer/phpbb/Sniffs/ControlStructures/OpeningBraceBsdAllmanSniff.php
@@ -0,0 +1,143 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+/**
+ * Checks that the opening brace of a control structures is on the line after.
+ * From Generic_Sniffs_Functions_OpeningFunctionBraceBsdAllmanSniff
+ */
+class phpbb_Sniffs_ControlStructures_OpeningBraceBsdAllmanSniff implements PHP_CodeSniffer_Sniff
+{
+ /**
+ * Registers the tokens that this sniff wants to listen for.
+ */
+ public function register()
+ {
+ return array(
+ T_IF,
+ T_ELSE,
+ T_FOREACH,
+ T_WHILE,
+ T_DO,
+ T_FOR,
+ T_SWITCH,
+ );
+ }
+
+ /**
+ * Processes this test, when one of its tokens is encountered.
+ *
+ * @param PHP_CodeSniffer_File $phpcsFile The file being scanned.
+ * @param int $stackPtr The position of the current token in the
+ * stack passed in $tokens.
+ *
+ * @return void
+ */
+ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
+ {
+ $tokens = $phpcsFile->getTokens();
+
+ if (isset($tokens[$stackPtr]['scope_opener']) === false)
+ {
+ return;
+ }
+
+ /*
+ * ...
+ * }
+ * else if ()
+ * {
+ * ...
+ */
+ if ($tokens[$stackPtr]['code'] === T_ELSE && $tokens[$stackPtr + 2]['code'] === T_IF)
+ {
+ return;
+ }
+
+ $openingBrace = $tokens[$stackPtr]['scope_opener'];
+
+ /*
+ * ...
+ * do
+ * {
+ * <code>
+ * } while();
+ * ...
+ * }
+ * else
+ * {
+ * ...
+ */
+ if ($tokens[$stackPtr]['code'] === T_DO ||$tokens[$stackPtr]['code'] === T_ELSE)
+ {
+ $cs_line = $tokens[$stackPtr]['line'];
+ }
+ else
+ {
+ // The end of the function occurs at the end of the argument list. Its
+ // like this because some people like to break long function declarations
+ // over multiple lines.
+ $cs_line = $tokens[$tokens[$stackPtr]['parenthesis_closer']]['line'];
+ }
+
+ $braceLine = $tokens[$openingBrace]['line'];
+
+ $lineDifference = ($braceLine - $cs_line);
+
+ if ($lineDifference === 0)
+ {
+ $error = 'Opening brace should be on a new line';
+ $phpcsFile->addError($error, $openingBrace, 'BraceOnSameLine');
+ return;
+ }
+
+ if ($lineDifference > 1)
+ {
+ $error = 'Opening brace should be on the line after the declaration; found %s blank line(s)';
+ $data = array(($lineDifference - 1));
+ $phpcsFile->addError($error, $openingBrace, 'BraceSpacing', $data);
+ return;
+ }
+
+ // We need to actually find the first piece of content on this line,
+ // as if this is a method with tokens before it (public, static etc)
+ // or an if with an else before it, then we need to start the scope
+ // checking from there, rather than the current token.
+ $lineStart = $stackPtr;
+ while (($lineStart = $phpcsFile->findPrevious(array(T_WHITESPACE), ($lineStart - 1), null, false)) !== false)
+ {
+ if (strpos($tokens[$lineStart]['content'], $phpcsFile->eolChar) !== false)
+ {
+ break;
+ }
+ }
+
+ // We found a new line, now go forward and find the first non-whitespace
+ // token.
+ $lineStart = $phpcsFile->findNext(array(T_WHITESPACE), $lineStart, null, true);
+
+ // The opening brace is on the correct line, now it needs to be
+ // checked to be correctly indented.
+ $startColumn = $tokens[$lineStart]['column'];
+ $braceIndent = $tokens[$openingBrace]['column'];
+
+ if ($braceIndent !== $startColumn)
+ {
+ $error = 'Opening brace indented incorrectly; expected %s spaces, found %s';
+ $data = array(
+ ($startColumn - 1),
+ ($braceIndent - 1),
+ );
+ $phpcsFile->addError($error, $openingBrace, 'BraceIndent', $data);
+ }
+ }
+}
diff --git a/build/code_sniffer/phpbb/Sniffs/ControlStructures/OpeningParenthesisSniff.php b/build/code_sniffer/phpbb/Sniffs/ControlStructures/OpeningParenthesisSniff.php
new file mode 100644
index 0000000000..349bccbb02
--- /dev/null
+++ b/build/code_sniffer/phpbb/Sniffs/ControlStructures/OpeningParenthesisSniff.php
@@ -0,0 +1,60 @@
+<?php
+/**
+ *
+ * This file is part of the phpBB Forum Software package.
+ *
+ * @copyright (c) phpBB Limited <https://www.phpbb.com>
+ * @license GNU General Public License, version 2 (GPL-2.0)
+ *
+ * For full copyright and license information, please see
+ * the docs/CREDITS.txt file.
+ *
+ */
+
+/**
+ * Checks that there is exactly one space between the keyword and the opening
+ * parenthesis of a control structures.
+ */
+class phpbb_Sniffs_ControlStructures_OpeningParenthesisSniff implements PHP_CodeSniffer_Sniff
+{
+ /**
+ * Registers the tokens that this sniff wants to listen for.
+ */
+ public function register()
+ {
+ return array(
+ T_IF,
+ T_FOREACH,
+ T_WHILE,
+ T_FOR,
+ T_SWITCH,
+ T_ELSEIF,
+ T_CATCH,
+ );
+ }
+
+ /**
+ * Processes this test, when one of its tokens is encountered.
+ *
+ * @param PHP_CodeSniffer_File $phpcsFile The file being scanned.
+ * @param int $stackPtr The position of the current token in the
+ * stack passed in $tokens.
+ *
+ * @return void
+ */
+ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
+ {
+ $tokens = $phpcsFile->getTokens();
+
+ if ($tokens[$stackPtr + 1]['content'] === '(')
+ {
+ $error = 'There should be exactly one space between the keyword and opening parenthesis';
+ $phpcsFile->addError($error, $stackPtr, 'NoSpaceBeforeOpeningParenthesis');
+ }
+ else if ($tokens[$stackPtr + 1]['content'] !== ' ')
+ {
+ $error = 'There should be exactly one space between the keyword and opening parenthesis';
+ $phpcsFile->addError($error, $stackPtr, 'IncorrectSpaceBeforeOpeningParenthesis');
+ }
+ }
+}
diff --git a/build/code_sniffer/phpbb/Sniffs/Namespaces/UnusedUseSniff.php b/build/code_sniffer/phpbb/Sniffs/Namespaces/UnusedUseSniff.php
new file mode 100644
index 0000000000..3125e4f05f
--- /dev/null
+++ b/build/code_sniffer/phpbb/Sniffs/Namespaces/UnusedUseSniff.php
@@ -0,0 +1,248 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+/**
+* Checks that each use statement is used.
+*/
+class phpbb_Sniffs_Namespaces_UnusedUseSniff implements PHP_CodeSniffer_Sniff
+{
+ /**
+ * {@inheritdoc}
+ */
+ public function register()
+ {
+ return array(T_USE);
+ }
+
+ protected function check($phpcsFile, $found_name, $full_name, $short_name, $line)
+ {
+
+ if ($found_name === $full_name)
+ {
+ $error = 'Either use statement or full name must be used.';
+ $phpcsFile->addError($error, $line, 'FullName');
+ }
+
+ if ($found_name === $short_name)
+ {
+ return true;
+ }
+
+ return false;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
+ {
+ if ($this->should_ignore_use($phpcsFile, $stackPtr) === true)
+ {
+ return;
+ }
+
+ $tokens = $phpcsFile->getTokens();
+
+ $class_name_start = $phpcsFile->findNext(array(T_NS_SEPARATOR, T_STRING), ($stackPtr + 1));
+
+ $find = array(
+ T_NS_SEPARATOR,
+ T_STRING,
+ T_WHITESPACE,
+ );
+
+ $class_name_end = $phpcsFile->findNext($find, ($stackPtr + 1), null, true);
+
+ $aliasing_as_position = $phpcsFile->findNext(T_AS, $class_name_end, null, false, null, true);
+ if ($aliasing_as_position !== false)
+ {
+ $alias_position = $phpcsFile->findNext(T_STRING, $aliasing_as_position, null, false, null, true);
+ $class_name_short = $tokens[$alias_position]['content'];
+ $class_name_full = $phpcsFile->getTokensAsString($class_name_start, ($class_name_end - $class_name_start - 1));
+ }
+ else
+ {
+ $class_name_full = $phpcsFile->getTokensAsString($class_name_start, ($class_name_end - $class_name_start));
+ $class_name_short = $tokens[$class_name_end - 1]['content'];
+ }
+
+ $ok = false;
+
+ // Checks in simple statements (new, instanceof and extends)
+ foreach (array(T_INSTANCEOF, T_NEW, T_EXTENDS) as $keyword)
+ {
+ $old_simple_statement = $stackPtr;
+ while (($simple_statement = $phpcsFile->findNext($keyword, ($old_simple_statement + 1))) !== false)
+ {
+ $old_simple_statement = $simple_statement;
+
+ $simple_class_name_start = $phpcsFile->findNext(array(T_NS_SEPARATOR, T_STRING), ($simple_statement + 1));
+ $simple_class_name_end = $phpcsFile->findNext($find, ($simple_statement + 1), null, true);
+
+ $simple_class_name = trim($phpcsFile->getTokensAsString($simple_class_name_start, ($simple_class_name_end - $simple_class_name_start)));
+
+ $ok = $this->check($phpcsFile, $simple_class_name, $class_name_full, $class_name_short, $simple_statement) ? true : $ok;
+ }
+ }
+
+ // Checks paamayim nekudotayim
+ $old_paamayim_nekudotayim = $stackPtr;
+ while (($paamayim_nekudotayim = $phpcsFile->findNext(T_PAAMAYIM_NEKUDOTAYIM, ($old_paamayim_nekudotayim + 1))) !== false)
+ {
+ $old_paamayim_nekudotayim = $paamayim_nekudotayim;
+
+ $paamayim_nekudotayim_class_name_start = $phpcsFile->findPrevious($find, $paamayim_nekudotayim - 1, null, true);
+ $paamayim_nekudotayim_class_name_end = $paamayim_nekudotayim - 1;
+
+ $paamayim_nekudotayim_class_name = trim($phpcsFile->getTokensAsString($paamayim_nekudotayim_class_name_start + 1, ($paamayim_nekudotayim_class_name_end - $paamayim_nekudotayim_class_name_start)));
+
+ $ok = $this->check($phpcsFile, $paamayim_nekudotayim_class_name, $class_name_full, $class_name_short, $paamayim_nekudotayim) ? true : $ok;
+ }
+
+ // Checks in implements
+ $old_implements = $stackPtr;
+ while (($implements = $phpcsFile->findNext(T_IMPLEMENTS, ($old_implements + 1))) !== false)
+ {
+ $old_implements = $implements;
+
+ $old_implemented_class = $implements;
+ while (($implemented_class = $phpcsFile->findNext(T_STRING, ($old_implemented_class + 1), null, false, null, true)) !== false)
+ {
+ $old_implemented_class = $implemented_class;
+
+ $implements_class_name_start = $phpcsFile->findNext(array(T_NS_SEPARATOR, T_STRING), ($implemented_class - 1));
+ $implements_class_name_end = $phpcsFile->findNext($find, ($implemented_class - 1), null, true);
+
+ $implements_class_name = trim($phpcsFile->getTokensAsString($implements_class_name_start, ($implements_class_name_end - $implements_class_name_start)));
+
+ $ok = $this->check($phpcsFile, $implements_class_name, $class_name_full, $class_name_short, $implements) ? true : $ok;
+ }
+ }
+
+ $old_docblock = $stackPtr;
+ while (($docblock = $phpcsFile->findNext(T_DOC_COMMENT_CLOSE_TAG, ($old_docblock + 1))) !== false)
+ {
+ $old_docblock = $docblock;
+ $ok = $this->checkDocblock($phpcsFile, $docblock, $tokens, $class_name_full, $class_name_short) ? true : $ok;
+ }
+
+ // Checks in type hinting
+ $old_function_declaration = $stackPtr;
+ while (($function_declaration = $phpcsFile->findNext(T_FUNCTION, ($old_function_declaration + 1))) !== false)
+ {
+ $old_function_declaration = $function_declaration;
+
+ // Check type hint
+ $params = $phpcsFile->getMethodParameters($function_declaration);
+ foreach ($params as $param)
+ {
+ $ok = $this->check($phpcsFile, $param['type_hint'], $class_name_full, $class_name_short, $function_declaration) ? true : $ok;
+ }
+ }
+
+ // Checks in catch blocks
+ $old_catch = $stackPtr;
+ while (($catch = $phpcsFile->findNext(T_CATCH, ($old_catch + 1))) !== false)
+ {
+ $old_catch = $catch;
+
+ $caught_class_name_start = $phpcsFile->findNext(array(T_NS_SEPARATOR, T_STRING), $catch + 1);
+ $caught_class_name_end = $phpcsFile->findNext($find, $caught_class_name_start + 1, null, true);
+
+ $caught_class_name = trim($phpcsFile->getTokensAsString($caught_class_name_start, ($caught_class_name_end - $caught_class_name_start)));
+
+ $ok = $this->check($phpcsFile, $caught_class_name, $class_name_full, $class_name_short, $catch) ? true : $ok;
+ }
+
+ if (!$ok)
+ {
+ $error = 'There must not be unused USE statements.';
+ $phpcsFile->addError($error, $stackPtr, 'Unused');
+ }
+ }
+
+ /**
+ * Check if this use statement is part of the namespace block.
+ *
+ * @param PHP_CodeSniffer_File $phpcsFile The file being scanned.
+ * @param int $stackPtr The position of the current token in
+ * the stack passed in $tokens.
+ *
+ * @return bool
+ */
+ private function should_ignore_use(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
+ {
+ $tokens = $phpcsFile->getTokens();
+
+ // Ignore USE keywords inside closures.
+ $next = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true);
+ if ($tokens[$next]['code'] === T_OPEN_PARENTHESIS)
+ {
+ return true;
+ }
+
+ // Ignore USE keywords for traits.
+ if ($phpcsFile->hasCondition($stackPtr, array(T_CLASS, T_TRAIT)) === true)
+ {
+ return true;
+ }
+
+ return false;
+
+ }
+
+ /**
+ * @param PHP_CodeSniffer_File $phpcsFile
+ * @param int $field
+ * @param array $tokens
+ * @param string $class_name_full
+ * @param string $class_name_short
+ * @param bool $ok
+ *
+ * @return bool
+ */
+ private function checkDocblock(PHP_CodeSniffer_File $phpcsFile, $comment_end, $tokens, $class_name_full, $class_name_short)
+ {
+ $ok = false;
+
+ $comment_start = $tokens[$comment_end]['comment_opener'];
+ foreach ($tokens[$comment_start]['comment_tags'] as $tag)
+ {
+ if (!in_array($tokens[$tag]['content'], array('@param', '@var', '@return', '@throws'), true))
+ {
+ continue;
+ }
+
+ $classes = $tokens[($tag + 2)]['content'];
+ $space = strpos($classes, ' ');
+ if ($space !== false)
+ {
+ $classes = substr($classes, 0, $space);
+ }
+
+ $tab = strpos($classes, "\t");
+ if ($tab !== false)
+ {
+ $classes = substr($classes, 0, $tab);
+ }
+
+ $classes = explode('|', str_replace('[]', '', $classes));
+ foreach ($classes as $class)
+ {
+ $ok = $this->check($phpcsFile, $class, $class_name_full, $class_name_short, $tokens[$tag + 2]['line']) ? true : $ok;
+ }
+ }
+
+ return $ok;
+ }
+}
diff --git a/build/code_sniffer/ruleset-minimum.xml b/build/code_sniffer/ruleset-minimum.xml
new file mode 100644
index 0000000000..13f122cae7
--- /dev/null
+++ b/build/code_sniffer/ruleset-minimum.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0"?>
+<ruleset name="phpBB Minimum Standard">
+
+ <description>phpBB minimum coding standard</description>
+
+ <!-- All code files MUST use only UTF-8 without BOM. -->
+ <rule ref="Generic.Files.ByteOrderMark" />
+
+ <!-- All code files MUST use the Unix LF (linefeed) line ending. -->
+ <rule ref="Generic.Files.LineEndings" />
+
+ <!-- Tabs MUST be used for indentation -->
+ <rule ref="Generic.WhiteSpace.DisallowSpaceIndent" />
+
+ <!-- ALL braces MUST be on their own lines. -->
+ <rule ref="./phpbb/Sniffs/ControlStructures/OpeningBraceBsdAllmanSniff.php" />
+
+</ruleset>
diff --git a/build/code_sniffer/ruleset-php-extensions.xml b/build/code_sniffer/ruleset-php-extensions.xml
new file mode 100644
index 0000000000..2d388103c3
--- /dev/null
+++ b/build/code_sniffer/ruleset-php-extensions.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0"?>
+<ruleset name="phpBB PHP Strict Standard Extensions">
+
+ <description>phpBB coding standard for PHP files of phpBB extensions</description>
+
+ <rule ref="./ruleset-php-strict.xml" />
+
+</ruleset>
diff --git a/build/code_sniffer/ruleset-php-legacy-core.xml b/build/code_sniffer/ruleset-php-legacy-core.xml
new file mode 100644
index 0000000000..55f2461a04
--- /dev/null
+++ b/build/code_sniffer/ruleset-php-legacy-core.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0"?>
+<ruleset name="phpBB PHP Legacy Standard Core">
+
+ <description>phpBB legacy coding standard for PHP files of phpBB core</description>
+
+ <rule ref="./ruleset-php-legacy.xml" />
+
+ <!-- Each file MUST start with a valid header as defined by the Coding Guidelines -->
+ <rule ref="./phpbb/Sniffs/Commenting/FileCommentSniff.php" />
+
+</ruleset>
diff --git a/build/code_sniffer/ruleset-php-legacy.xml b/build/code_sniffer/ruleset-php-legacy.xml
new file mode 100644
index 0000000000..c740c6080f
--- /dev/null
+++ b/build/code_sniffer/ruleset-php-legacy.xml
@@ -0,0 +1,92 @@
+<?xml version="1.0"?>
+<ruleset name="phpBB PHP Legacy Standard">
+
+ <description>phpBB legacy coding standard for PHP files</description>
+
+ <rule ref="./ruleset-minimum.xml" />
+
+ <!-- "for (; bar; )" should be "while (bar)" instead -->
+ <rule ref="Generic.CodeAnalysis.ForLoopShouldBeWhileLoop" />
+
+ <!-- A method MUST not only call its parent -->
+ <rule ref="Generic.CodeAnalysis.UselessOverridingMethod" />
+
+ <!-- The body of each structure MUST be enclosed by braces. -->
+ <rule ref="Generic.ControlStructures.InlineControlStructure" />
+
+ <!-- There MUST not be more than one statement per line. -->
+ <rule ref="Generic.Formatting.DisallowMultipleStatements" />
+
+ <!-- Call-time pass-by-reference MUST not be used. -->
+ <rule ref="Generic.Functions.CallTimePassByReference.NotAllowed" />
+
+ <!-- Filenames MUST be lowercase. -->
+ <rule ref="Generic.Files.LowercasedFilename" />
+
+ <!-- The function brace MUST be on the line following the function declaration
+ and MUST be indented to the same column as the start of the function declaration. -->
+ <rule ref="Generic.Functions.OpeningFunctionBraceBsdAllman" />
+
+ <!-- There MUST be exactly one space after a cast. -->
+ <rule ref="Generic.Formatting.SpaceAfterCast" />
+
+ <!-- Class constants MUST be declared in all upper case with underscore separators. -->
+ <rule ref="Generic.NamingConventions.UpperCaseConstantName" />
+
+ <!-- Only <?php, no short tags. -->
+ <rule ref="Generic.PHP.DisallowShortOpenTag.EchoFound" />
+
+ <!-- Method arguments with default values MUST go at the end of the argument list. -->
+ <rule ref="PEAR.Functions.ValidDefaultValue" />
+
+ <!-- Each file MUST end with exactly one newline character -->
+ <rule ref="PSR2.Files.EndFileNewline" />
+
+ <!-- When referencing arrays there MUST NOT be any whitespace around the opening bracket
+ or before the closing bracket. -->
+ <rule ref="Squiz.Arrays.ArrayBracketSpacing" />
+
+ <!-- The "else if" statement MUST be written with a space between the words else and if. -->
+ <rule ref="Squiz.ControlStructures.ElseIfDeclaration" />
+
+ <!-- There MUST be a space between each element of a foreach loop. -->
+ <rule ref="Squiz.ControlStructures.ForEachLoopDeclaration" />
+
+ <!-- In a for loop declaration, there MUST be no space inside the brackets
+ and there MUST be 0 spaces before and 1 space after semicolons. -->
+ <rule ref="Squiz.ControlStructures.ForLoopDeclaration" />
+
+ <!-- In the argument list, there MUST NOT be a space before each comma,
+ and there MUST be one space after each comma. -->
+ <rule ref="Squiz.Functions.FunctionDeclarationArgumentSpacing">
+ <properties>
+ <property name="equalsSpacing" value="1"/>
+ </properties>
+ </rule>
+ <rule ref="Squiz.Functions.FunctionDeclarationArgumentSpacing.SpacingAfterHint" />
+
+ <!-- All built-in PHP functions MUST be called lowercased. -->
+ <rule ref="Squiz.Functions.LowercaseFunctionKeywords" />
+
+ <!-- The eval() function MUST NOT be used. -->
+ <rule ref="Squiz.PHP.Eval" />
+
+ <!-- There MUST NOT be trailing whitespace at the end of lines. -->
+ <rule ref="Squiz.WhiteSpace.SuperfluousWhitespace" />
+
+ <!-- There MUST NOT be whitespace before the first content of a file -->
+ <rule ref="Squiz.WhiteSpace.SuperfluousWhitespace.StartFile" />
+
+ <!-- There MUST NOT be whitespace after the last content of a file -->
+ <rule ref="Squiz.WhiteSpace.SuperfluousWhitespace.EndFile" />
+
+ <!-- Functions MUST NOT contain multiple empty lines in a row -->
+ <rule ref="Squiz.WhiteSpace.SuperfluousWhitespace.EmptyLines" />
+
+ <!-- The ?> closing tag MUST be omitted from files containing only PHP. -->
+ <rule ref="Zend.Files.ClosingTag" />
+
+ <!-- There MUST be one space between control structure and opening parenthesis -->
+ <rule ref="./phpbb/Sniffs/ControlStructures/OpeningParenthesisSniff.php" />
+
+</ruleset>
diff --git a/build/code_sniffer/ruleset-php-strict-core.xml b/build/code_sniffer/ruleset-php-strict-core.xml
new file mode 100644
index 0000000000..5ca4d0cf1e
--- /dev/null
+++ b/build/code_sniffer/ruleset-php-strict-core.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0"?>
+<ruleset name="phpBB PHP Strict Standard Core">
+
+ <description>phpBB coding standard for PHP files of phpBB core</description>
+
+ <rule ref="./ruleset-php-legacy-core.xml" />
+ <rule ref="./ruleset-php-strict.xml" />
+
+</ruleset>
diff --git a/build/code_sniffer/ruleset-php-strict.xml b/build/code_sniffer/ruleset-php-strict.xml
new file mode 100644
index 0000000000..9e2f0664d8
--- /dev/null
+++ b/build/code_sniffer/ruleset-php-strict.xml
@@ -0,0 +1,48 @@
+<?xml version="1.0"?>
+<ruleset name="phpBB PHP Strict Standard">
+
+ <description>phpBB coding standard for PHP files</description>
+
+ <rule ref="./ruleset-php-legacy.xml" />
+
+ <!-- There SHOULD NOT be more than 80 characters per line
+ There MUST NOT be more than 120 characters per line -->
+ <!--
+ <rule ref="Generic.Files.LineLength">
+ <properties>
+ <property name="lineLimit" value="80"/>
+ <property name="absoluteLineLimit" value="120"/>
+ </properties>
+ </rule>
+ -->
+
+ <!-- The PHP constants true, false, and null MUST be in lower case. -->
+ <rule ref="Generic.PHP.LowerCaseConstant" />
+
+ <!-- PHP keywords MUST be in lower case. -->
+ <rule ref="Generic.PHP.LowerCaseKeyword" />
+
+ <!-- Constructors MUST be called __construct() instead of after the class. -->
+ <rule ref="Generic.NamingConventions.ConstructorName" />
+
+ <!-- Classes etc. MUST be namespaced -->
+ <rule ref="PSR1.Classes.ClassDeclaration.MissingNamespace" />
+
+ <!-- A file MUST not contain more than one class/interface -->
+ <rule ref="PSR1.Classes.ClassDeclaration.MultipleClasses" />
+
+ <!-- Files containing classes MUST not have any side-effects -->
+ <rule ref="PSR1.Files.SideEffects.FoundWithSymbols" />
+
+ <!-- When present, all use declarations MUST go after the namespace declaration.
+ There MUST be one use keyword per declaration.
+ There MUST be one blank line after the use block. -->
+ <rule ref="PSR2.Namespaces.UseDeclaration" />
+
+ <!-- There MUST be one blank line after the namespace declaration -->
+ <rule ref="PSR2.Namespaces.NamespaceDeclaration" />
+
+ <!-- There MUST NOT be unused use statements. -->
+ <rule ref="./phpbb/Sniffs/Namespaces/UnusedUseSniff.php" />
+
+</ruleset>
diff --git a/build/package.php b/build/package.php
index 22ea4e52af..d168957ca5 100755
--- a/build/package.php
+++ b/build/package.php
@@ -2,9 +2,13 @@
<?php
/**
*
-* @package build
-* @copyright (c) 2010 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -45,6 +49,10 @@ if (sizeof($package->old_packages))
$package->get('patch_directory') . '/phpBB-' . $dest_package_filename . $package->get('new_version_number') . '.patch',
$_package_name
);
+ $diff_file_changes[$_package_name]['deleted'] = $package->collect_deleted_files(
+ $package->get('patch_directory') . '/phpBB-' . $dest_package_filename . $package->get('new_version_number') . '.deleted',
+ $_package_name
+ );
}
// Now put those files determined within the correct directories
@@ -121,6 +129,7 @@ if (sizeof($package->old_packages))
$package->run_command('cp -Rp ' . $package->get('dest_dir') . '/docs ' . $dest_filename_dir);
$package->run_command('cp -Rp ' . $package->get('dest_dir') . '/install ' . $dest_filename_dir);
+ $package->run_command('cp -Rp ' . $package->get('dest_dir') . '/vendor ' . $dest_filename_dir);
$package->run_command('mkdir ' . $dest_filename_dir . '/install/update');
$package->run_command('mkdir ' . $dest_filename_dir . '/install/update/old');
@@ -138,6 +147,12 @@ if (sizeof($package->old_packages))
{
unset($file_contents['all'][$index]);
}
+
+ $source_filename = $package->locations['old_versions'] . $package->get('simple_name') . '/' . $file;
+ if (!file_exists($source_filename))
+ {
+ unset($file_contents['all'][$index]);
+ }
}
// First of all, fill the 'old' directory
@@ -173,16 +188,27 @@ if (sizeof($package->old_packages))
$package->run_command('cp ' . $source_filename . ' ' . $dest_filename);
}
+ /**
+ * We try to keep the update packages as small as possible while creating them.
+ * However, we sometimes need to include additional files that are not included
+ * in the diff in order to be able to correctly include the relatively
+ * referenced files from the same or subsequent directories.
+ */
+ $copy_relative_directories = array(
+ 'config/' => array(
+ 'copied' => false,
+ 'copy' => array(
+ 'config/*.yml' => 'config',
+ ),
+ ),
+ );
+
// Then fill the 'new' directory
foreach ($file_contents['all'] as $file)
{
$source_filename = $package->locations['old_versions'] . $package->get('simple_name') . '/' . $file;
$dest_filename = $dest_filename_dir . '/install/update/new/' . $file;
-
- if (!file_exists($source_filename))
- {
- continue;
- }
+ $filename = $file;
// Create Directories along the way?
$file = explode('/', $file);
@@ -204,6 +230,73 @@ if (sizeof($package->old_packages))
}
$package->run_command('cp ' . $source_filename . ' ' . $dest_filename);
+
+ foreach ($copy_relative_directories as $reference => $data)
+ {
+ // Copy all relative referenced files if needed
+ if (strpos($filename, $reference) === 0 && !$data['copied'])
+ {
+ foreach ($data['copy'] as $source_dir_files => $destination_dir)
+ {
+ // Create directories along the way?
+ $directories = explode('/', $destination_dir);
+
+ chdir($dest_filename_dir . '/install/update/new');
+ foreach ($directories as $dir)
+ {
+ $dir = trim($dir);
+ if ($dir)
+ {
+ if (!file_exists('./' . $dir))
+ {
+ $package->run_command('mkdir ' . $dir);
+ }
+ chdir('./' . $dir);
+ }
+ }
+ $source_dir_files = $package->locations['old_versions'] . $package->get('simple_name') . '/' . $source_dir_files;
+ $destination_dir = $dest_filename_dir . '/install/update/new/' . $destination_dir;
+ $package->run_command('cp ' . $source_dir_files . ' ' . $destination_dir);
+ }
+ $copy_relative_directories[$reference]['copied'] = true;
+ }
+ }
+ }
+
+ /**
+ * We need to always copy the template and asset files that we need in
+ * the update, to ensure that the page is displayed correctly.
+ */
+ $copy_update_files = array(
+ 'adm/images/*' => 'adm/images',
+ 'adm/style/admin.css' => 'adm/style',
+ 'adm/style/admin.js' => 'adm/style',
+ 'adm/style/ajax.js' => 'adm/style',
+ 'adm/style/install_*' => 'adm/style',
+ 'assets/javascript/*' => 'assets/javascript',
+ );
+
+ foreach ($copy_update_files as $source_files => $destination_dir)
+ {
+ // Create directories along the way?
+ $directories = explode('/', $destination_dir);
+
+ chdir($dest_filename_dir . '/install/update/new');
+ foreach ($directories as $dir)
+ {
+ $dir = trim($dir);
+ if ($dir)
+ {
+ if (!file_exists('./' . $dir))
+ {
+ $package->run_command('mkdir ' . $dir);
+ }
+ chdir('./' . $dir);
+ }
+ }
+ $source_dir_files = $package->locations['old_versions'] . $package->get('simple_name') . '/' . $source_files;
+ $destination_dir = $dest_filename_dir . '/install/update/new/' . $destination_dir;
+ $package->run_command('cp ' . $source_dir_files . ' ' . $destination_dir);
}
// Build index.php file for holding the file structure
@@ -221,29 +314,32 @@ $update_info = array(
if (sizeof($file_contents['all']))
{
- $index_contents .= '\'files\' => array(\'' . implode("',\n\t'", $file_contents['all']) . '\'),
-';
+ $index_contents .= "\t'files' => array(\n\t\t'" . implode("',\n\t\t'", $file_contents['all']) . "',\n\t),\n";
}
else
{
- $index_contents .= '\'files\' => array(),
-';
+ $index_contents .= "\t'files' => array(),\n";
}
if (sizeof($file_contents['binary']))
{
- $index_contents .= '\'binary\' => array(\'' . implode("',\n\t'", $file_contents['binary']) . '\'),
-';
+ $index_contents .= "\t'binary' => array(\n\t\t'" . implode("',\n\t\t'", $file_contents['binary']) . "',\n\t),\n";
}
else
{
- $index_contents .= '\'binary\' => array(),
-';
+ $index_contents .= "\t'binary' => array(),\n";
}
- $index_contents .= ');
+ if (sizeof($file_contents['deleted']))
+ {
+ $index_contents .= "\t'deleted' => array(\n\t\t'" . implode("',\n\t\t'", $file_contents['deleted']) . "',\n\t),\n";
+ }
+ else
+ {
+ $index_contents .= "\t'deleted' => array(),\n";
+ }
-?' . '>';
+ $index_contents .= ");\n";
$fp = fopen($dest_filename_dir . '/install/update/index.php', 'wt');
fwrite($fp, $index_contents);
@@ -256,6 +352,7 @@ $update_info = array(
// Copy the install files to their respective locations
$package->run_command('cp -Rp ' . $package->get('dest_dir') . '/docs ' . $package->get('patch_directory'));
$package->run_command('cp -Rp ' . $package->get('dest_dir') . '/install ' . $package->get('patch_directory'));
+ $package->run_command('cp -Rp ' . $package->get('dest_dir') . '/vendor ' . $package->get('patch_directory'));
// Remove some files
chdir($package->get('patch_directory') . '/install');
@@ -297,6 +394,7 @@ if (sizeof($package->old_packages))
$package->run_command('mkdir ' . $package->get('files_directory') . '/release');
$package->run_command('cp -Rp ' . $package->get('dest_dir') . '/docs ' . $package->get('files_directory') . '/release');
$package->run_command('cp -Rp ' . $package->get('dest_dir') . '/install ' . $package->get('files_directory') . '/release');
+ $package->run_command('cp -Rp ' . $package->get('dest_dir') . '/vendor ' . $package->get('files_directory') . '/release');
$package->run_command('rm -v ' . $package->get('files_directory') . '/release/install/install_install.php');
$package->run_command('rm -v ' . $package->get('files_directory') . '/release/install/install_update.php');
@@ -372,14 +470,22 @@ chdir($package->get('dest_dir') . '/install');
// $package->run_command('rm -v database_update.php');
$package->run_command('rm -v install_update.php');
+chdir($package->get('dest_dir'));
+$package->run_command('mv -v styles/subsilver2 ../subsilver2');
+$package->run_command('cp -p docs/COPYING ../subsilver2/license.txt');
+
chdir($package->locations['package_dir']);
foreach ($compress_programs as $extension => $compress_command)
{
$package->begin_status('Packaging phpBB for ' . $extension);
$package->run_command('rm -v ./release_files/' . $package->get('release_filename') . ".{$extension}");
+ $package->run_command('rm -v ./release_files/subsilver2_' . $package->get('new_version_number') . ".{$extension}");
// Build Package
$package->run_command("$compress_command ./release_files/" . $package->get('release_filename') . '.' . $extension . ' ' . $package->get('package_name'));
+
+ // Build subSilver2 Package
+ $package->run_command("$compress_command ./release_files/subsilver2_" . $package->get('new_version_number') . '.' . $extension . ' subsilver2');
}
// Microsoft Web PI packaging
diff --git a/build/sami-all.conf.php b/build/sami-all.conf.php
index fb1a269206..4bf812eb02 100644
--- a/build/sami-all.conf.php
+++ b/build/sami-all.conf.php
@@ -25,6 +25,8 @@ $config['versions'] = Sami\Version\GitVersionCollection::create(__DIR__ . '/../'
*/
->add('3.0.x')
->add('3.1.x')
+ ->add('3.2.x')
+ ->add('master')
;
return new Sami\Sami($iterator, $config);
diff --git a/composer.phar b/composer.phar
index b00eef5a3e..fca2a8d72d 100755
--- a/composer.phar
+++ b/composer.phar
Binary files differ
diff --git a/git-tools/commit-msg-hook-range.sh b/git-tools/commit-msg-hook-range.sh
index 2b408c3e79..91f7577eb5 100755
--- a/git-tools/commit-msg-hook-range.sh
+++ b/git-tools/commit-msg-hook-range.sh
@@ -1,7 +1,12 @@
#!/bin/bash
#
-# @copyright (c) 2014 phpBB Group
-# @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+# This file is part of the phpBB Forum Software package.
+#
+# @copyright (c) phpBB Limited <https://www.phpbb.com>
+# @license GNU General Public License, version 2 (GPL-2.0)
+#
+# For full copyright and license information, please see
+# the docs/CREDITS.txt file.
#
# Calls the git commit-msg hook on all non-merge commits in a given commit range.
#
diff --git a/git-tools/merge.php b/git-tools/merge.php
index f6142095fb..a9bb051401 100755
--- a/git-tools/merge.php
+++ b/git-tools/merge.php
@@ -2,9 +2,13 @@
<?php
/**
*
-* @package phpBB3
-* @copyright (c) 2011 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
diff --git a/git-tools/setup_github_network.php b/git-tools/setup_github_network.php
deleted file mode 100755
index 4e144edae6..0000000000
--- a/git-tools/setup_github_network.php
+++ /dev/null
@@ -1,288 +0,0 @@
-#!/usr/bin/env php
-<?php
-/**
-*
-* @package phpBB3
-* @copyright (c) 2011 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
-*
-*/
-
-function show_usage()
-{
- $filename = basename(__FILE__);
-
- echo "$filename adds repositories of a github network as remotes to a local git repository.\n";
- echo "\n";
-
- echo "Usage: [php] $filename -s collaborators|organisation|contributors|forks [OPTIONS]\n";
- echo "\n";
-
- echo "Scopes:\n";
- echo " collaborators Repositories of people who have push access to the specified repository\n";
- echo " contributors Repositories of people who have contributed to the specified repository\n";
- echo " organisation Repositories of members of the organisation at github\n";
- echo " forks All repositories of the whole github network\n";
- echo "\n";
-
- echo "Options:\n";
- echo " -s scope See description above (mandatory)\n";
- echo " -u github_username Overwrites the github username (optional)\n";
- echo " -r repository_name Overwrites the repository name (optional)\n";
- echo " -m your_github_username Sets up ssh:// instead of git:// for pushable repositories (optional)\n";
- echo " -d Outputs the commands instead of running them (optional)\n";
- echo " -h This help text\n";
-
- exit(1);
-}
-
-// Handle arguments
-$opts = getopt('s:u:r:m:dh');
-
-if (empty($opts) || isset($opts['h']))
-{
- show_usage();
-}
-
-$scope = get_arg($opts, 's', '');
-$username = get_arg($opts, 'u', 'phpbb');
-$repository = get_arg($opts, 'r', 'phpbb3');
-$developer = get_arg($opts, 'm', '');
-$dry_run = !get_arg($opts, 'd', true);
-run(null, $dry_run);
-exit(work($scope, $username, $repository, $developer));
-
-function work($scope, $username, $repository, $developer)
-{
- // Get some basic data
- $forks = get_forks($username, $repository);
- $collaborators = get_collaborators($username, $repository);
-
- if ($forks === false || $collaborators === false)
- {
- echo "Error: failed to retrieve forks or collaborators\n";
- return 1;
- }
-
- switch ($scope)
- {
- case 'collaborators':
- $remotes = array_intersect_key($forks, $collaborators);
- break;
-
- case 'organisation':
- $remotes = array_intersect_key($forks, get_organisation_members($username));
- break;
-
- case 'contributors':
- $remotes = array_intersect_key($forks, get_contributors($username, $repository));
- break;
-
- case 'forks':
- $remotes = $forks;
- break;
-
- default:
- show_usage();
- }
-
- if (file_exists('.git'))
- {
- add_remote($username, $repository, isset($collaborators[$developer]));
- }
- else
- {
- clone_repository($username, $repository, isset($collaborators[$developer]));
- }
-
- // Add private security repository for developers
- if ($username == 'phpbb' && $repository == 'phpbb3' && isset($collaborators[$developer]))
- {
- run("git remote add $username-security " . get_repository_url($username, "$repository-security", true));
- }
-
- // Skip blessed repository.
- unset($remotes[$username]);
-
- foreach ($remotes as $remote)
- {
- add_remote($remote['username'], $remote['repository'], $remote['username'] == $developer);
- }
-
- run('git remote update');
-}
-
-function clone_repository($username, $repository, $pushable = false)
-{
- $url = get_repository_url($username, $repository, false);
- run("git clone $url ./ --origin $username");
-
- if ($pushable)
- {
- $ssh_url = get_repository_url($username, $repository, true);
- run("git remote set-url --push $username $ssh_url");
- }
-}
-
-function add_remote($username, $repository, $pushable = false)
-{
- $url = get_repository_url($username, $repository, false);
- run("git remote add $username $url");
-
- if ($pushable)
- {
- $ssh_url = get_repository_url($username, $repository, true);
- run("git remote set-url --push $username $ssh_url");
- }
-}
-
-function get_repository_url($username, $repository, $ssh = false)
-{
- $url_base = ($ssh) ? 'git@github.com:' : 'git://github.com/';
-
- return $url_base . $username . '/' . $repository . '.git';
-}
-
-function api_request($query)
-{
- return api_url_request("https://api.github.com/$query?per_page=100");
-}
-
-function api_url_request($url)
-{
- $contents = file_get_contents($url, false, stream_context_create(array(
- 'http' => array(
- 'header' => "User-Agent: phpBB/1.0\r\n",
- ),
- )));
-
- $sub_request_result = array();
- // Check headers for pagination links
- if (!empty($http_response_header))
- {
- foreach ($http_response_header as $header_element)
- {
- // Find Link Header which gives us a link to the next page
- if (strpos($header_element, 'Link: ') === 0)
- {
- list($head, $header_content) = explode(': ', $header_element);
- foreach (explode(', ', $header_content) as $links)
- {
- list($url, $rel) = explode('; ', $links);
- if ($rel == 'rel="next"')
- {
- // Found a next link, follow it and merge the results
- $sub_request_result = api_url_request(substr($url, 1, -1));
- }
- }
- }
- }
- }
-
- if ($contents === false)
- {
- return false;
- }
- $contents = json_decode($contents);
-
- if (isset($contents->message) && strpos($contents->message, 'API Rate Limit') === 0)
- {
- throw new RuntimeException('Reached github API Rate Limit. Please try again later' . "\n", 4);
- }
-
- return ($sub_request_result) ? array_merge($sub_request_result, $contents) : $contents;
-}
-
-function get_contributors($username, $repository)
-{
- $request = api_request("repos/$username/$repository/stats/contributors");
- if ($request === false)
- {
- return false;
- }
-
- $usernames = array();
- foreach ($request as $contribution)
- {
- $usernames[$contribution->author->login] = $contribution->author->login;
- }
-
- return $usernames;
-}
-
-function get_organisation_members($username)
-{
- $request = api_request("orgs/$username/public_members");
- if ($request === false)
- {
- return false;
- }
-
- $usernames = array();
- foreach ($request as $member)
- {
- $usernames[$member->login] = $member->login;
- }
-
- return $usernames;
-}
-
-function get_collaborators($username, $repository)
-{
- $request = api_request("repos/$username/$repository/collaborators");
- if ($request === false)
- {
- return false;
- }
-
- $usernames = array();
- foreach ($request as $collaborator)
- {
- $usernames[$collaborator->login] = $collaborator->login;
- }
-
- return $usernames;
-}
-
-function get_forks($username, $repository)
-{
- $request = api_request("repos/$username/$repository/forks");
- if ($request === false)
- {
- return false;
- }
-
- $usernames = array();
- foreach ($request as $fork)
- {
- $usernames[$fork->owner->login] = array(
- 'username' => $fork->owner->login,
- 'repository' => $fork->name,
- );
- }
-
- return $usernames;
-}
-
-function get_arg($array, $index, $default)
-{
- return isset($array[$index]) ? $array[$index] : $default;
-}
-
-function run($cmd, $dry = false)
-{
- static $dry_run;
-
- if (is_null($cmd))
- {
- $dry_run = $dry;
- }
- else if (!empty($dry_run))
- {
- echo "$cmd\n";
- }
- else
- {
- passthru(escapeshellcmd($cmd));
- }
-}
diff --git a/phpBB/.htaccess b/phpBB/.htaccess
index ad5e24d642..53bce762ea 100644
--- a/phpBB/.htaccess
+++ b/phpBB/.htaccess
@@ -1,12 +1,40 @@
+<IfModule mod_rewrite.c>
+RewriteEngine on
+
+#
+# Uncomment the statement below if URL rewriting doesn't
+# work properly. If you installed phpBB in a subdirectory
+# of your site, properly set the argument for the statement.
+# e.g.: if your domain is test.com and you installed phpBB
+# in http://www.test.com/phpBB/index.php you have to set
+# the statement RewriteBase /phpBB/
+#
+#RewriteBase /
+
#
# Uncomment the statement below if you want to make use of
# HTTP authentication and it does not already work.
# This could be required if you are for example using PHP via Apache CGI.
#
-#<IfModule mod_rewrite.c>
-#RewriteEngine on
#RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
-#</IfModule>
+
+#
+# The following 3 lines will rewrite URLs passed through the front controller
+# to not require app.php in the actual URL. In other words, a controller is
+# by default accessed at /app.php/my/controller, but can also be accessed at
+# /my/controller
+#
+RewriteCond %{REQUEST_FILENAME} !-f
+RewriteCond %{REQUEST_FILENAME} !-d
+RewriteRule ^(.*)$ app.php [QSA,L]
+
+#
+# If symbolic links are not already being followed,
+# uncomment the line below.
+# http://anothersysadmin.wordpress.com/2008/06/10/mod_rewrite-forbidden-403-with-apache-228/
+#
+#Options +FollowSymLinks
+</IfModule>
# With Apache 2.4 the "Order, Deny" syntax has been deprecated and moved from
# module mod_authz_host to a new module called mod_access_compat (which may be
diff --git a/phpBB/adm/images/alert_close.png b/phpBB/adm/images/alert_close.png
new file mode 100644
index 0000000000..79750a013c
--- /dev/null
+++ b/phpBB/adm/images/alert_close.png
Binary files differ
diff --git a/phpBB/adm/images/arrow_down.gif b/phpBB/adm/images/arrow_down.gif
index e45c365ecc..b7fbf7e276 100644
--- a/phpBB/adm/images/arrow_down.gif
+++ b/phpBB/adm/images/arrow_down.gif
Binary files differ
diff --git a/phpBB/adm/images/arrow_left.gif b/phpBB/adm/images/arrow_left.gif
index 076a5596f1..ac92cb4971 100644
--- a/phpBB/adm/images/arrow_left.gif
+++ b/phpBB/adm/images/arrow_left.gif
Binary files differ
diff --git a/phpBB/adm/images/arrow_right.gif b/phpBB/adm/images/arrow_right.gif
index c5827a401f..3a080ffdfe 100644
--- a/phpBB/adm/images/arrow_right.gif
+++ b/phpBB/adm/images/arrow_right.gif
Binary files differ
diff --git a/phpBB/adm/images/arrow_up.gif b/phpBB/adm/images/arrow_up.gif
index 38b5a62c17..0ff5872182 100644
--- a/phpBB/adm/images/arrow_up.gif
+++ b/phpBB/adm/images/arrow_up.gif
Binary files differ
diff --git a/phpBB/adm/images/bg_tabs1.gif b/phpBB/adm/images/bg_tabs1.gif
deleted file mode 100644
index d129365661..0000000000
--- a/phpBB/adm/images/bg_tabs1.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/adm/images/bg_tabs2.gif b/phpBB/adm/images/bg_tabs2.gif
deleted file mode 100644
index 0aace9b6db..0000000000
--- a/phpBB/adm/images/bg_tabs2.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/adm/images/corners_left.gif b/phpBB/adm/images/corners_left.gif
deleted file mode 100644
index bacd276495..0000000000
--- a/phpBB/adm/images/corners_left.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/adm/images/corners_left2.gif b/phpBB/adm/images/corners_left2.gif
deleted file mode 100644
index 206e50368d..0000000000
--- a/phpBB/adm/images/corners_left2.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/adm/images/corners_right.gif b/phpBB/adm/images/corners_right.gif
deleted file mode 100644
index bcb5bd7d14..0000000000
--- a/phpBB/adm/images/corners_right.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/adm/images/corners_right2.gif b/phpBB/adm/images/corners_right2.gif
deleted file mode 100644
index 0ba66d50b2..0000000000
--- a/phpBB/adm/images/corners_right2.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/adm/images/icon_folder.gif b/phpBB/adm/images/icon_folder.gif
index 82ceee0784..845618c1a2 100644
--- a/phpBB/adm/images/icon_folder.gif
+++ b/phpBB/adm/images/icon_folder.gif
Binary files differ
diff --git a/phpBB/adm/images/icon_folder_link.gif b/phpBB/adm/images/icon_folder_link.gif
index 01fb1c4e1e..efeaf0a11f 100644
--- a/phpBB/adm/images/icon_folder_link.gif
+++ b/phpBB/adm/images/icon_folder_link.gif
Binary files differ
diff --git a/phpBB/adm/images/icon_folder_lock.gif b/phpBB/adm/images/icon_folder_lock.gif
index 450bf28c3c..7afb092a8f 100644
--- a/phpBB/adm/images/icon_folder_lock.gif
+++ b/phpBB/adm/images/icon_folder_lock.gif
Binary files differ
diff --git a/phpBB/adm/images/icon_subfolder.gif b/phpBB/adm/images/icon_subfolder.gif
index 5e97bc94ce..7119486539 100644
--- a/phpBB/adm/images/icon_subfolder.gif
+++ b/phpBB/adm/images/icon_subfolder.gif
Binary files differ
diff --git a/phpBB/adm/images/loading.gif b/phpBB/adm/images/loading.gif
new file mode 100644
index 0000000000..e1ed0883e0
--- /dev/null
+++ b/phpBB/adm/images/loading.gif
Binary files differ
diff --git a/phpBB/adm/images/no_avatar.gif b/phpBB/adm/images/no_avatar.gif
index 80539c8c71..ad73330e71 100644
--- a/phpBB/adm/images/no_avatar.gif
+++ b/phpBB/adm/images/no_avatar.gif
Binary files differ
diff --git a/phpBB/adm/images/toggle.gif b/phpBB/adm/images/toggle.gif
deleted file mode 100644
index 8af6861bd1..0000000000
--- a/phpBB/adm/images/toggle.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/adm/index.php b/phpBB/adm/index.php
index 49c4be09dc..519f6c8310 100644
--- a/phpBB/adm/index.php
+++ b/phpBB/adm/index.php
@@ -1,10 +1,13 @@
<?php
/**
*
-* @package acp
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -18,6 +21,7 @@ define('NEED_SID', true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './../';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
require($phpbb_root_path . 'common.' . $phpEx);
+require($phpbb_root_path . 'includes/functions_acp.' . $phpEx);
require($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
require($phpbb_root_path . 'includes/functions_module.' . $phpEx);
@@ -42,7 +46,6 @@ if (!$auth->acl_get('a_'))
// We define the admin variables now, because the user is now able to use the admin related features...
define('IN_ADMIN', true);
-$phpbb_admin_path = (defined('PHPBB_ADMIN_PATH')) ? PHPBB_ADMIN_PATH : './';
// Some oft used variables
$safe_mode = (@ini_get('safe_mode') == '1' || strtolower(@ini_get('safe_mode')) === 'on') ? true : false;
@@ -50,12 +53,16 @@ $file_uploads = (@ini_get('file_uploads') == '1' || strtolower(@ini_get('file_up
$module_id = request_var('i', '');
$mode = request_var('mode', '');
-// Set custom template for admin area
-$template->set_custom_template($phpbb_admin_path . 'style', 'admin');
-$template->assign_var('T_TEMPLATE_PATH', $phpbb_admin_path . 'style');
+// Set custom style for admin area
+$template->set_custom_style(array(
+ array(
+ 'name' => 'adm',
+ 'ext_path' => 'adm/style/',
+ ),
+), $phpbb_admin_path . 'style');
-// the acp template is never stored in the database
-$user->theme['template_storedb'] = false;
+$template->assign_var('T_ASSETS_PATH', $phpbb_root_path . 'assets');
+$template->assign_var('T_TEMPLATE_PATH', $phpbb_admin_path . 'style');
// Instantiate new module
$module = new p_master();
@@ -81,558 +88,3 @@ $template->set_filenames(array(
));
adm_page_footer();
-
-/**
-* Header for acp pages
-*/
-function adm_page_header($page_title)
-{
- global $config, $db, $user, $template;
- global $phpbb_root_path, $phpbb_admin_path, $phpEx, $SID, $_SID;
-
- if (defined('HEADER_INC'))
- {
- return;
- }
-
- define('HEADER_INC', true);
-
- // gzip_compression
- if ($config['gzip_compress'])
- {
- if (@extension_loaded('zlib') && !headers_sent())
- {
- ob_start('ob_gzhandler');
- }
- }
-
- $template->assign_vars(array(
- 'PAGE_TITLE' => $page_title,
- 'USERNAME' => $user->data['username'],
-
- 'SID' => $SID,
- '_SID' => $_SID,
- 'SESSION_ID' => $user->session_id,
- 'ROOT_PATH' => $phpbb_admin_path,
-
- 'U_LOGOUT' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=logout'),
- 'U_ADM_LOGOUT' => append_sid("{$phpbb_admin_path}index.$phpEx", 'action=admlogout'),
- 'U_ADM_INDEX' => append_sid("{$phpbb_admin_path}index.$phpEx"),
- 'U_INDEX' => append_sid("{$phpbb_root_path}index.$phpEx"),
-
- 'T_IMAGES_PATH' => "{$phpbb_root_path}images/",
- 'T_SMILIES_PATH' => "{$phpbb_root_path}{$config['smilies_path']}/",
- 'T_AVATAR_PATH' => "{$phpbb_root_path}{$config['avatar_path']}/",
- 'T_AVATAR_GALLERY_PATH' => "{$phpbb_root_path}{$config['avatar_gallery_path']}/",
- 'T_ICONS_PATH' => "{$phpbb_root_path}{$config['icons_path']}/",
- 'T_RANKS_PATH' => "{$phpbb_root_path}{$config['ranks_path']}/",
- 'T_UPLOAD_PATH' => "{$phpbb_root_path}{$config['upload_path']}/",
-
- 'ICON_MOVE_UP' => '<img src="' . $phpbb_admin_path . 'images/icon_up.gif" alt="' . $user->lang['MOVE_UP'] . '" title="' . $user->lang['MOVE_UP'] . '" />',
- 'ICON_MOVE_UP_DISABLED' => '<img src="' . $phpbb_admin_path . 'images/icon_up_disabled.gif" alt="' . $user->lang['MOVE_UP'] . '" title="' . $user->lang['MOVE_UP'] . '" />',
- 'ICON_MOVE_DOWN' => '<img src="' . $phpbb_admin_path . 'images/icon_down.gif" alt="' . $user->lang['MOVE_DOWN'] . '" title="' . $user->lang['MOVE_DOWN'] . '" />',
- 'ICON_MOVE_DOWN_DISABLED' => '<img src="' . $phpbb_admin_path . 'images/icon_down_disabled.gif" alt="' . $user->lang['MOVE_DOWN'] . '" title="' . $user->lang['MOVE_DOWN'] . '" />',
- 'ICON_EDIT' => '<img src="' . $phpbb_admin_path . 'images/icon_edit.gif" alt="' . $user->lang['EDIT'] . '" title="' . $user->lang['EDIT'] . '" />',
- 'ICON_EDIT_DISABLED' => '<img src="' . $phpbb_admin_path . 'images/icon_edit_disabled.gif" alt="' . $user->lang['EDIT'] . '" title="' . $user->lang['EDIT'] . '" />',
- 'ICON_DELETE' => '<img src="' . $phpbb_admin_path . 'images/icon_delete.gif" alt="' . $user->lang['DELETE'] . '" title="' . $user->lang['DELETE'] . '" />',
- 'ICON_DELETE_DISABLED' => '<img src="' . $phpbb_admin_path . 'images/icon_delete_disabled.gif" alt="' . $user->lang['DELETE'] . '" title="' . $user->lang['DELETE'] . '" />',
- 'ICON_SYNC' => '<img src="' . $phpbb_admin_path . 'images/icon_sync.gif" alt="' . $user->lang['RESYNC'] . '" title="' . $user->lang['RESYNC'] . '" />',
- 'ICON_SYNC_DISABLED' => '<img src="' . $phpbb_admin_path . 'images/icon_sync_disabled.gif" alt="' . $user->lang['RESYNC'] . '" title="' . $user->lang['RESYNC'] . '" />',
-
- 'S_USER_LANG' => $user->lang['USER_LANG'],
- 'S_CONTENT_DIRECTION' => $user->lang['DIRECTION'],
- 'S_CONTENT_ENCODING' => 'UTF-8',
- 'S_CONTENT_FLOW_BEGIN' => ($user->lang['DIRECTION'] == 'ltr') ? 'left' : 'right',
- 'S_CONTENT_FLOW_END' => ($user->lang['DIRECTION'] == 'ltr') ? 'right' : 'left',
- ));
-
- // application/xhtml+xml not used because of IE
- header('Content-type: text/html; charset=UTF-8');
-
- header('Cache-Control: private, no-cache="set-cookie"');
- header('Expires: 0');
- header('Pragma: no-cache');
-
- return;
-}
-
-/**
-* Page footer for acp pages
-*/
-function adm_page_footer($copyright_html = true)
-{
- global $db, $config, $template, $user, $auth, $cache;
- global $starttime, $phpbb_root_path, $phpbb_admin_path, $phpEx;
-
- // Output page creation time
- if (defined('DEBUG'))
- {
- $mtime = explode(' ', microtime());
- $totaltime = $mtime[0] + $mtime[1] - $starttime;
-
- if (!empty($_REQUEST['explain']) && $auth->acl_get('a_') && defined('DEBUG_EXTRA') && method_exists($db, 'sql_report'))
- {
- $db->sql_report('display');
- }
-
- $debug_output = sprintf('Time : %.3fs | ' . $db->sql_num_queries() . ' Queries | GZIP : ' . (($config['gzip_compress']) ? 'On' : 'Off') . (($user->load) ? ' | Load : ' . $user->load : ''), $totaltime);
-
- if ($auth->acl_get('a_') && defined('DEBUG_EXTRA'))
- {
- if (function_exists('memory_get_usage'))
- {
- if ($memory_usage = memory_get_usage())
- {
- global $base_memory_usage;
- $memory_usage -= $base_memory_usage;
- $memory_usage = get_formatted_filesize($memory_usage);
-
- $debug_output .= ' | Memory Usage: ' . $memory_usage;
- }
- }
-
- $debug_output .= ' | <a href="' . build_url() . '&amp;explain=1">Explain</a>';
- }
- }
-
- $template->assign_vars(array(
- 'DEBUG_OUTPUT' => (defined('DEBUG')) ? $debug_output : '',
- 'TRANSLATION_INFO' => (!empty($user->lang['TRANSLATION_INFO'])) ? $user->lang['TRANSLATION_INFO'] : '',
- 'S_COPYRIGHT_HTML' => $copyright_html,
- 'CREDIT_LINE' => $user->lang('POWERED_BY', '<a href="https://www.phpbb.com/">phpBB</a>&reg; Forum Software &copy; phpBB Group'),
- 'VERSION' => $config['version'])
- );
-
- $template->display('body');
-
- garbage_collection();
- exit_handler();
-}
-
-/**
-* Generate back link for acp pages
-*/
-function adm_back_link($u_action)
-{
- global $user;
- return '<br /><br /><a href="' . $u_action . '">&laquo; ' . $user->lang['BACK_TO_PREV'] . '</a>';
-}
-
-/**
-* Build select field options in acp pages
-*/
-function build_select($option_ary, $option_default = false)
-{
- global $user;
-
- $html = '';
- foreach ($option_ary as $value => $title)
- {
- $selected = ($option_default !== false && $value == $option_default) ? ' selected="selected"' : '';
- $html .= '<option value="' . $value . '"' . $selected . '>' . $user->lang[$title] . '</option>';
- }
-
- return $html;
-}
-
-/**
-* Build radio fields in acp pages
-*/
-function h_radio($name, $input_ary, $input_default = false, $id = false, $key = false, $separator = '')
-{
- global $user;
-
- $html = '';
- $id_assigned = false;
- foreach ($input_ary as $value => $title)
- {
- $selected = ($input_default !== false && $value == $input_default) ? ' checked="checked"' : '';
- $html .= '<label><input type="radio" name="' . $name . '"' . (($id && !$id_assigned) ? ' id="' . $id . '"' : '') . ' value="' . $value . '"' . $selected . (($key) ? ' accesskey="' . $key . '"' : '') . ' class="radio" /> ' . $user->lang[$title] . '</label>' . $separator;
- $id_assigned = true;
- }
-
- return $html;
-}
-
-/**
-* Build configuration template for acp configuration pages
-*/
-function build_cfg_template($tpl_type, $key, &$new, $config_key, $vars)
-{
- global $user, $module;
-
- $tpl = '';
- $name = 'config[' . $config_key . ']';
-
- // Make sure there is no notice printed out for non-existent config options (we simply set them)
- if (!isset($new[$config_key]))
- {
- $new[$config_key] = '';
- }
-
- switch ($tpl_type[0])
- {
- case 'text':
- case 'password':
- $size = (int) $tpl_type[1];
- $maxlength = (int) $tpl_type[2];
-
- $tpl = '<input id="' . $key . '" type="' . $tpl_type[0] . '"' . (($size) ? ' size="' . $size . '"' : '') . ' maxlength="' . (($maxlength) ? $maxlength : 255) . '" name="' . $name . '" value="' . $new[$config_key] . '"' . (($tpl_type[0] === 'password') ? ' autocomplete="off"' : '') . ' />';
- break;
-
- case 'dimension':
- $size = (int) $tpl_type[1];
- $maxlength = (int) $tpl_type[2];
-
- $tpl = '<input id="' . $key . '" type="text"' . (($size) ? ' size="' . $size . '"' : '') . ' maxlength="' . (($maxlength) ? $maxlength : 255) . '" name="config[' . $config_key . '_width]" value="' . $new[$config_key . '_width'] . '" /> x <input type="text"' . (($size) ? ' size="' . $size . '"' : '') . ' maxlength="' . (($maxlength) ? $maxlength : 255) . '" name="config[' . $config_key . '_height]" value="' . $new[$config_key . '_height'] . '" />';
- break;
-
- case 'textarea':
- $rows = (int) $tpl_type[1];
- $cols = (int) $tpl_type[2];
-
- $tpl = '<textarea id="' . $key . '" name="' . $name . '" rows="' . $rows . '" cols="' . $cols . '">' . $new[$config_key] . '</textarea>';
- break;
-
- case 'radio':
- $key_yes = ($new[$config_key]) ? ' checked="checked"' : '';
- $key_no = (!$new[$config_key]) ? ' checked="checked"' : '';
-
- $tpl_type_cond = explode('_', $tpl_type[1]);
- $type_no = ($tpl_type_cond[0] == 'disabled' || $tpl_type_cond[0] == 'enabled') ? false : true;
-
- $tpl_no = '<label><input type="radio" name="' . $name . '" value="0"' . $key_no . ' class="radio" /> ' . (($type_no) ? $user->lang['NO'] : $user->lang['DISABLED']) . '</label>';
- $tpl_yes = '<label><input type="radio" id="' . $key . '" name="' . $name . '" value="1"' . $key_yes . ' class="radio" /> ' . (($type_no) ? $user->lang['YES'] : $user->lang['ENABLED']) . '</label>';
-
- $tpl = ($tpl_type_cond[0] == 'yes' || $tpl_type_cond[0] == 'enabled') ? $tpl_yes . $tpl_no : $tpl_no . $tpl_yes;
- break;
-
- case 'select':
- case 'custom':
-
- $return = '';
-
- if (isset($vars['method']))
- {
- $call = array($module->module, $vars['method']);
- }
- else if (isset($vars['function']))
- {
- $call = $vars['function'];
- }
- else
- {
- break;
- }
-
- if (isset($vars['params']))
- {
- $args = array();
- foreach ($vars['params'] as $value)
- {
- switch ($value)
- {
- case '{CONFIG_VALUE}':
- $value = $new[$config_key];
- break;
-
- case '{KEY}':
- $value = $key;
- break;
- }
-
- $args[] = $value;
- }
- }
- else
- {
- $args = array($new[$config_key], $key);
- }
-
- $return = call_user_func_array($call, $args);
-
- if ($tpl_type[0] == 'select')
- {
- $tpl = '<select id="' . $key . '" name="' . $name . '">' . $return . '</select>';
- }
- else
- {
- $tpl = $return;
- }
-
- break;
-
- default:
- break;
- }
-
- if (isset($vars['append']))
- {
- $tpl .= $vars['append'];
- }
-
- return $tpl;
-}
-
-/**
-* Going through a config array and validate values, writing errors to $error. The validation method accepts parameters separated by ':' for string and int.
-* The first parameter defines the type to be used, the second the lower bound and the third the upper bound. Only the type is required.
-*/
-function validate_config_vars($config_vars, &$cfg_array, &$error)
-{
- global $phpbb_root_path, $user;
- $type = 0;
- $min = 1;
- $max = 2;
-
- foreach ($config_vars as $config_name => $config_definition)
- {
- if (!isset($cfg_array[$config_name]) || strpos($config_name, 'legend') !== false)
- {
- continue;
- }
-
- if (!isset($config_definition['validate']))
- {
- continue;
- }
-
- $validator = explode(':', $config_definition['validate']);
-
- // Validate a bit. ;) (0 = type, 1 = min, 2= max)
- switch ($validator[$type])
- {
- case 'string':
- $length = utf8_strlen($cfg_array[$config_name]);
-
- // the column is a VARCHAR
- $validator[$max] = (isset($validator[$max])) ? min(255, $validator[$max]) : 255;
-
- if (isset($validator[$min]) && $length < $validator[$min])
- {
- $error[] = sprintf($user->lang['SETTING_TOO_SHORT'], $user->lang[$config_definition['lang']], $validator[$min]);
- }
- else if (isset($validator[$max]) && $length > $validator[2])
- {
- $error[] = sprintf($user->lang['SETTING_TOO_LONG'], $user->lang[$config_definition['lang']], $validator[$max]);
- }
- break;
-
- case 'bool':
- $cfg_array[$config_name] = ($cfg_array[$config_name]) ? 1 : 0;
- break;
-
- case 'int':
- $cfg_array[$config_name] = (int) $cfg_array[$config_name];
-
- if (isset($validator[$min]) && $cfg_array[$config_name] < $validator[$min])
- {
- $error[] = sprintf($user->lang['SETTING_TOO_LOW'], $user->lang[$config_definition['lang']], $validator[$min]);
- }
- else if (isset($validator[$max]) && $cfg_array[$config_name] > $validator[$max])
- {
- $error[] = sprintf($user->lang['SETTING_TOO_BIG'], $user->lang[$config_definition['lang']], $validator[$max]);
- }
-
- if (strpos($config_name, '_max') !== false)
- {
- // Min/max pairs of settings should ensure that min <= max
- // Replace _max with _min to find the name of the minimum
- // corresponding configuration variable
- $min_name = str_replace('_max', '_min', $config_name);
-
- if (isset($cfg_array[$min_name]) && is_numeric($cfg_array[$min_name]) && $cfg_array[$config_name] < $cfg_array[$min_name])
- {
- // A minimum value exists and the maximum value is less than it
- $error[] = sprintf($user->lang['SETTING_TOO_LOW'], $user->lang[$config_definition['lang']], (int) $cfg_array[$min_name]);
- }
- }
- break;
-
- case 'email':
- if (!preg_match('/^' . get_preg_expression('email') . '$/i', $cfg_array[$config_name]))
- {
- $error[] = $user->lang['EMAIL_INVALID_EMAIL'];
- }
- break;
-
- // Absolute path
- case 'script_path':
- if (!$cfg_array[$config_name])
- {
- break;
- }
-
- $destination = str_replace('\\', '/', $cfg_array[$config_name]);
-
- if ($destination !== '/')
- {
- // Adjust destination path (no trailing slash)
- if (substr($destination, -1, 1) == '/')
- {
- $destination = substr($destination, 0, -1);
- }
-
- $destination = str_replace(array('../', './'), '', $destination);
-
- if ($destination[0] != '/')
- {
- $destination = '/' . $destination;
- }
- }
-
- $cfg_array[$config_name] = trim($destination);
-
- break;
-
- // Absolute path
- case 'lang':
- if (!$cfg_array[$config_name])
- {
- break;
- }
-
- $cfg_array[$config_name] = basename($cfg_array[$config_name]);
-
- if (!file_exists($phpbb_root_path . 'language/' . $cfg_array[$config_name] . '/'))
- {
- $error[] = $user->lang['WRONG_DATA_LANG'];
- }
- break;
-
- // Relative path (appended $phpbb_root_path)
- case 'rpath':
- case 'rwpath':
- if (!$cfg_array[$config_name])
- {
- break;
- }
-
- $destination = $cfg_array[$config_name];
-
- // Adjust destination path (no trailing slash)
- if (substr($destination, -1, 1) == '/' || substr($destination, -1, 1) == '\\')
- {
- $destination = substr($destination, 0, -1);
- }
-
- $destination = str_replace(array('../', '..\\', './', '.\\'), '', $destination);
- if ($destination && ($destination[0] == '/' || $destination[0] == "\\"))
- {
- $destination = '';
- }
-
- $cfg_array[$config_name] = trim($destination);
-
- // Absolute file path
- case 'absolute_path':
- case 'absolute_path_writable':
- // Path being relative (still prefixed by phpbb_root_path), but with the ability to escape the root dir...
- case 'path':
- case 'wpath':
-
- if (!$cfg_array[$config_name])
- {
- break;
- }
-
- $cfg_array[$config_name] = trim($cfg_array[$config_name]);
-
- // Make sure no NUL byte is present...
- if (strpos($cfg_array[$config_name], "\0") !== false || strpos($cfg_array[$config_name], '%00') !== false)
- {
- $cfg_array[$config_name] = '';
- break;
- }
-
- $path = in_array($config_definition['validate'], array('wpath', 'path', 'rpath', 'rwpath')) ? $phpbb_root_path . $cfg_array[$config_name] : $cfg_array[$config_name];
-
- if (!file_exists($path))
- {
- $error[] = sprintf($user->lang['DIRECTORY_DOES_NOT_EXIST'], $cfg_array[$config_name]);
- }
-
- if (file_exists($path) && !is_dir($path))
- {
- $error[] = sprintf($user->lang['DIRECTORY_NOT_DIR'], $cfg_array[$config_name]);
- }
-
- // Check if the path is writable
- if ($config_definition['validate'] == 'wpath' || $config_definition['validate'] == 'rwpath' || $config_definition['validate'] === 'absolute_path_writable')
- {
- if (file_exists($path) && !phpbb_is_writable($path))
- {
- $error[] = sprintf($user->lang['DIRECTORY_NOT_WRITABLE'], $cfg_array[$config_name]);
- }
- }
-
- break;
- }
- }
-
- return;
-}
-
-/**
-* Checks whatever or not a variable is OK for use in the Database
-* param mixed $value_ary An array of the form array(array('lang' => ..., 'value' => ..., 'column_type' =>))'
-* param mixed $error The error array
-*/
-function validate_range($value_ary, &$error)
-{
- global $user;
-
- $column_types = array(
- 'BOOL' => array('php_type' => 'int', 'min' => 0, 'max' => 1),
- 'USINT' => array('php_type' => 'int', 'min' => 0, 'max' => 65535),
- 'UINT' => array('php_type' => 'int', 'min' => 0, 'max' => (int) 0x7fffffff),
- // Do not use (int) 0x80000000 - it evaluates to different
- // values on 32-bit and 64-bit systems.
- // Apparently -2147483648 is a float on 32-bit systems,
- // despite fitting in an int, thus explicit cast is needed.
- 'INT' => array('php_type' => 'int', 'min' => (int) -2147483648, 'max' => (int) 0x7fffffff),
- 'TINT' => array('php_type' => 'int', 'min' => -128, 'max' => 127),
-
- 'VCHAR' => array('php_type' => 'string', 'min' => 0, 'max' => 255),
- );
- foreach ($value_ary as $value)
- {
- $column = explode(':', $value['column_type']);
- $max = $min = 0;
- $type = 0;
- if (!isset($column_types[$column[0]]))
- {
- continue;
- }
- else
- {
- $type = $column_types[$column[0]];
- }
-
- switch ($type['php_type'])
- {
- case 'string' :
- $max = (isset($column[1])) ? min($column[1],$type['max']) : $type['max'];
- if (utf8_strlen($value['value']) > $max)
- {
- $error[] = sprintf($user->lang['SETTING_TOO_LONG'], $user->lang[$value['lang']], $max);
- }
- break;
-
- case 'int':
- $min = (isset($column[1])) ? max($column[1],$type['min']) : $type['min'];
- $max = (isset($column[2])) ? min($column[2],$type['max']) : $type['max'];
- if ($value['value'] < $min)
- {
- $error[] = sprintf($user->lang['SETTING_TOO_LOW'], $user->lang[$value['lang']], $min);
- }
- else if ($value['value'] > $max)
- {
- $error[] = sprintf($user->lang['SETTING_TOO_BIG'], $user->lang[$value['lang']], $max);
- }
- break;
- }
- }
-}
-
-?> \ No newline at end of file
diff --git a/phpBB/adm/style/acp_attachments.html b/phpBB/adm/style/acp_attachments.html
index 9573c34248..e1f7f140c9 100644
--- a/phpBB/adm/style/acp_attachments.html
+++ b/phpBB/adm/style/acp_attachments.html
@@ -1,6 +1,6 @@
<!-- INCLUDE overall_header.html -->
-<a name="maincontent"></a>
+<a id="maincontent"></a>
<!-- IF U_BACK -->
<a href="{U_BACK}" style="float: {S_CONTENT_FLOW_END};">&laquo; {L_BACK}</a>
@@ -54,7 +54,7 @@
<!-- ELSE -->
<dl>
- <dt><label for="{options.KEY}">{options.TITLE}:</label><!-- IF options.S_EXPLAIN --><br /><span>{options.TITLE_EXPLAIN}</span><!-- ENDIF --></dt>
+ <dt><label for="{options.KEY}">{options.TITLE}{L_COLON}</label><!-- IF options.S_EXPLAIN --><br /><span>{options.TITLE_EXPLAIN}</span><!-- ENDIF --></dt>
<dd>{options.CONTENT}</dd>
</dl>
@@ -78,11 +78,11 @@
<legend>{L_SECURE_TITLE}</legend>
<p>{L_DOWNLOAD_ADD_IPS_EXPLAIN}</p>
<dl>
- <dt><label for="ip_hostname">{L_IP_HOSTNAME}:</label></dt>
+ <dt><label for="ip_hostname">{L_IP_HOSTNAME}{L_COLON}</label></dt>
<dd><textarea id="ip_hostname" cols="40" rows="3" name="ips"></textarea></dd>
</dl>
<dl>
- <dt><label for="exclude">{L_IP_EXCLUDE}:</label><br /><span>{L_EXCLUDE_ENTERED_IP}</span></dt>
+ <dt><label for="exclude">{L_IP_EXCLUDE}{L_COLON}</label><br /><span>{L_EXCLUDE_ENTERED_IP}</span></dt>
<dd><label><input type="radio" id="exclude" name="ipexclude" value="1" class="radio" /> {L_YES}</label>
<label><input type="radio" name="ipexclude" value="0" checked="checked" class="radio" /> {L_NO}</label></dd>
</dl>
@@ -97,7 +97,7 @@
<!-- IF S_DEFINED_IPS -->
<p>{L_DOWNLOAD_REMOVE_IPS_EXPLAIN}</p>
<dl>
- <dt><label for="remove_ip_hostname">{L_IP_HOSTNAME}:</label></dt>
+ <dt><label for="remove_ip_hostname">{L_IP_HOSTNAME}{L_COLON}</label></dt>
<dd><select name="unip[]" id="remove_ip_hostname" multiple="multiple" size="10">{DEFINED_IPS}</select></dd>
</dl>
@@ -122,11 +122,11 @@
{
if (newimage == 'no_image')
{
- document.getElementById('image_upload_icon').src = "{PHPBB_ROOT_PATH}images/spacer.gif";
+ document.getElementById('image_upload_icon').src = "{ROOT_PATH}images/spacer.gif";
}
else
{
- document.getElementById('image_upload_icon').src = "{PHPBB_ROOT_PATH}{IMG_PATH}/" + newimage;
+ document.getElementById('image_upload_icon').src = "{ROOT_PATH}{IMG_PATH}/" + newimage;
}
}
@@ -172,41 +172,41 @@
<legend>{L_LEGEND}</legend>
<dl>
- <dt><label for="group_name">{L_GROUP_NAME}:</label></dt>
+ <dt><label for="group_name">{L_GROUP_NAME}{L_COLON}</label></dt>
<dd><input type="text" id="group_name" size="20" maxlength="100" name="group_name" value="{GROUP_NAME}" /></dd>
</dl>
<dl>
- <dt><label for="category">{L_SPECIAL_CATEGORY}:</label><br /><span>{L_SPECIAL_CATEGORY_EXPLAIN}</span></dt>
+ <dt><label for="category">{L_SPECIAL_CATEGORY}{L_COLON}</label><br /><span>{L_SPECIAL_CATEGORY_EXPLAIN}</span></dt>
<dd>{S_CATEGORY_SELECT}</dd>
</dl>
<dl>
- <dt><label for="allowed">{L_ALLOWED}:</label></dt>
+ <dt><label for="allowed">{L_ALLOWED}{L_COLON}</label></dt>
<dd><input type="checkbox" class="radio" id="allowed" name="allow_group" value="1"<!-- IF ALLOW_GROUP --> checked="checked"<!-- ENDIF --> /></dd>
</dl>
<dl>
- <dt><label for="allow_in_pm">{L_ALLOW_IN_PM}:</label></dt>
+ <dt><label for="allow_in_pm">{L_ALLOW_IN_PM}{L_COLON}</label></dt>
<dd><input type="checkbox" class="radio" id="allow_in_pm" name="allow_in_pm" value="1"<!-- IF ALLOW_IN_PM --> checked="checked"<!-- ENDIF --> /></dd>
</dl>
<dl>
- <dt><label for="upload_icon">{L_UPLOAD_ICON}:</label></dt>
+ <dt><label for="upload_icon">{L_UPLOAD_ICON}{L_COLON}</label></dt>
<dd><select name="upload_icon" id="upload_icon" onchange="update_image(this.options[selectedIndex].value);">
<option value="no_image"<!-- IF S_NO_IMAGE --> selected="selected"<!-- ENDIF -->>{L_NO_IMAGE}</option>{S_FILENAME_LIST}
</select></dd>
- <dd>&nbsp;<img <!-- IF S_NO_IMAGE -->src="{PHPBB_ROOT_PATH}images/spacer.gif"<!-- ELSE -->src="{UPLOAD_ICON_SRC}"<!-- ENDIF --> id="image_upload_icon" alt="" title="" />&nbsp;</dd>
+ <dd>&nbsp;<img <!-- IF S_NO_IMAGE -->src="{ROOT_PATH}images/spacer.gif"<!-- ELSE -->src="{UPLOAD_ICON_SRC}"<!-- ENDIF --> id="image_upload_icon" alt="" title="" />&nbsp;</dd>
</dl>
<dl>
- <dt><label for="extgroup_filesize">{L_MAX_EXTGROUP_FILESIZE}:</label></dt>
- <dd><input type="text" id="extgroup_filesize" size="3" maxlength="15" name="max_filesize" value="{EXTGROUP_FILESIZE}" /> <select name="size_select">{S_EXT_GROUP_SIZE_OPTIONS}</select></dd>
+ <dt><label for="extgroup_filesize">{L_MAX_EXTGROUP_FILESIZE}{L_COLON}</label></dt>
+ <dd><input type="number" id="extgroup_filesize" min="0" max="999999999999999" step="any" name="max_filesize" value="{EXTGROUP_FILESIZE}" /> <select name="size_select">{S_EXT_GROUP_SIZE_OPTIONS}</select></dd>
</dl>
<dl>
- <dt><label for="assigned_extensions">{L_ASSIGNED_EXTENSIONS}:</label></dt>
+ <dt><label for="assigned_extensions">{L_ASSIGNED_EXTENSIONS}{L_COLON}</label></dt>
<dd><div id="ext">{ASSIGNED_EXTENSIONS}</div> <span>[<a href="{U_EXTENSIONS}">{L_GO_TO_EXTENSIONS}</a> ]</span></dd>
<dd><select name="extensions[]" id="assigned_extensions" class="narrow" onchange="show_extensions(this);" multiple="multiple" size="8">{S_EXTENSION_OPTIONS}</select></dd>
</dl>
<dl>
- <dt><label for="allowed_forums">{L_ALLOWED_FORUMS}:</label><br /><span>{L_ALLOWED_FORUMS_EXPLAIN}</span></dt>
- <dd><label><input type="radio" id="allowed_forums" class="radio" name="forum_select" value="0"<!-- IF not S_FORUM_IDS --> checked="checked"<!-- ENDIF --> /> {L_ALLOW_ALL_FORUMS}</label>
- <label><input type="radio" class="radio" name="forum_select" value="1"<!-- IF S_FORUM_IDS --> checked="checked"<!-- ENDIF --> /> {L_ALLOW_SELECTED_FORUMS}</label></dd>
+ <dt><label for="allowed_forums">{L_ALLOWED_FORUMS}{L_COLON}</label><br /><span>{L_ALLOWED_FORUMS_EXPLAIN}</span></dt>
+ <dd><label><input type="radio" id="allowed_forums" class="radio" name="forum_select" value="0"<!-- IF not S_FORUM_IDS --> checked="checked"<!-- ENDIF --> /> {L_ALLOW_ALL_FORUMS}</label></dd>
+ <dd><label><input type="radio" class="radio" name="forum_select" value="1"<!-- IF S_FORUM_IDS --> checked="checked"<!-- ENDIF --> /> {L_ALLOW_SELECTED_FORUMS}</label></dd>
<dd><select name="allowed_forums[]" multiple="multiple" size="8">{S_FORUM_ID_OPTIONS}</select></dd>
</dl>
@@ -224,7 +224,7 @@
<fieldset class="tabulated">
<legend>{L_TITLE}</legend>
- <table cellspacing="1">
+ <table class="table1">
<col class="row1" /><col class="row1" /><col class="row2" />
<thead>
<tr>
@@ -248,13 +248,13 @@
<!-- ELSE --><br /><span>&raquo; {L_ALLOWED_IN_PM_POST}</span><!-- ENDIF -->
</td>
<td>{groups.CATEGORY}</td>
- <td align="center" valign="middle" style="white-space: nowrap;">&nbsp;<a href="{groups.U_EDIT}">{ICON_EDIT}</a>&nbsp;&nbsp;<a href="{groups.U_DELETE}">{ICON_DELETE}</a>&nbsp;</td>
+ <td align="center" valign="middle" style="white-space: nowrap;">&nbsp;<a href="{groups.U_EDIT}">{ICON_EDIT}</a>&nbsp;&nbsp;<a href="{groups.U_DELETE}" data-ajax="row_delete">{ICON_DELETE}</a>&nbsp;</td>
</tr>
<!-- END groups -->
</tbody>
</table>
<p class="quick">
- {L_CREATE_GROUP}: <input type="text" name="group_name" maxlength="30" />
+ {L_CREATE_GROUP}{L_COLON} <input type="text" name="group_name" maxlength="30" />
<input class="button2" name="add" type="submit" value="{L_SUBMIT}" />
</p>
{S_FORM_TOKEN}
@@ -284,14 +284,12 @@
</fieldset>
</form>
- <br />
-
<form id="change_ext" method="post" action="{U_ACTION}">
<fieldset class="tabulated">
<legend>{L_TITLE}</legend>
- <table cellspacing="1">
+ <table class="table1">
<col class="row1" /><col class="row1" /><col class="row2" />
<thead>
<tr>
@@ -331,24 +329,24 @@
<fieldset class="tabulated">
<legend>{L_TITLE}</legend>
- <table cellspacing="1">
+ <table class="table1 zebra-table fixed-width-table">
<thead>
<tr>
<th>{L_FILENAME}</th>
- <th>{L_FILEDATE}</th>
- <th>{L_FILESIZE}</th>
- <th>{L_ATTACH_POST_ID}</th>
- <th>{L_ATTACH_TO_POST}</th>
- <th>{L_DELETE}</th>
+ <th style="width: 15%;">{L_FILEDATE}</th>
+ <th style="width: 15%;">{L_FILESIZE}</th>
+ <th style="width: 15%;">{L_ATTACH_POST_ID}</th>
+ <th style="width: 15%;">{L_ATTACH_TO_POST}</th>
+ <th style="width: 15%;">{L_DELETE}</th>
</tr>
</thead>
<tbody>
<!-- BEGIN orphan -->
- <!-- IF orphan.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
+ <tr>
<td><a href="{orphan.U_FILE}">{orphan.REAL_FILENAME}</a></td>
<td>{orphan.FILETIME}</td>
<td>{orphan.FILESIZE}</td>
- <td><strong>{L_ATTACH_ID}: </strong><input type="text" name="post_id[{orphan.ATTACH_ID}]" size="7" maxlength="10" value="{orphan.POST_ID}" /></td>
+ <td><strong>{L_ATTACH_ID}{L_COLON} </strong><input type="number" min="0" max="9999999999" name="post_id[{orphan.ATTACH_ID}]" value="{orphan.POST_ID}" style="width: 75%;" /></td>
<td><input type="checkbox" class="radio" name="add[{orphan.ATTACH_ID}]" /></td>
<td><input type="checkbox" class="radio" name="delete[{orphan.ATTACH_ID}]" /></td>
</tr>
@@ -371,6 +369,96 @@
</fieldset>
</form>
+<!-- ELSEIF S_MANAGE -->
+
+ <form id="attachments" method="post" action="{U_ACTION}">
+
+ <fieldset class="tabulated">
+ <legend>{L_TITLE}</legend>
+
+ <div class="pagination top-pagination">
+ <!-- IF .pagination or TOTAL_FILES -->
+ {L_NUMBER_FILES}{L_COLON} {TOTAL_FILES} &bull; {L_TOTAL_SIZE}{L_COLON} {TOTAL_SIZE}
+ <!-- IF .pagination -->
+ &bull; <!-- INCLUDE pagination.html -->
+ <!-- ELSE -->
+ &bull; {PAGE_NUMBER}
+ <!-- ENDIF -->
+ <!-- ENDIF -->
+ </div>
+
+<!-- IF .attachments -->
+ <table class="table1 zebra-table fixed-width-table">
+ <thead>
+ <tr>
+ <th>{L_FILENAME}</th>
+ <th style="width: 15%;">{L_POSTED}</th>
+ <th style="width: 15%;" class="centered-text">{L_FILESIZE}</th>
+ <th style="width: 10%;" class="centered-text">{L_MARK}</th>
+ </tr>
+ </thead>
+ <tbody>
+ <!-- BEGIN attachments -->
+ <tr>
+ <td>
+ <!-- IF attachments.S_IN_MESSAGE -->{L_EXTENSION_GROUP}{L_COLON} <strong><!-- IF attachments.EXT_GROUP_NAME -->{attachments.EXT_GROUP_NAME}<!-- ELSE -->{L_NO_EXT_GROUP}<!-- ENDIF --></strong><br />{attachments.L_DOWNLOAD_COUNT}<br />{L_IN} {L_PRIVATE_MESSAGE}
+ <!-- ELSE --><a href="{attachments.U_FILE}" style="font-weight: bold;">{attachments.REAL_FILENAME}</a><br /><!-- IF attachments.COMMENT -->{attachments.COMMENT}<br /><!-- ENDIF -->{attachments.L_DOWNLOAD_COUNT}<br />{L_TOPIC}{L_COLON} <a href="{attachments.U_VIEW_TOPIC}">{attachments.TOPIC_TITLE}</a><!-- ENDIF -->
+ </td>
+ <td>{attachments.FILETIME}<br />{L_POST_BY_AUTHOR} {attachments.ATTACHMENT_POSTER}</td>
+ <td class="centered-text">{attachments.FILESIZE}</td>
+ <td class="centered-text"><input type="checkbox" class="radio" name="delete[{attachments.ATTACH_ID}]" /></td>
+ </tr>
+ <!-- END attachments -->
+ </tbody>
+ </table>
+<!-- ELSE -->
+ <div class="errorbox">
+ <p>{L_NO_ATTACHMENTS}</p>
+ </div>
+<!-- ENDIF -->
+
+ <!-- IF TOTAL_FILES -->
+ <div class="pagination">
+ {L_NUMBER_FILES}{L_COLON} {TOTAL_FILES} &bull; {L_TOTAL_SIZE}{L_COLON} {TOTAL_SIZE}
+ <!-- IF .pagination -->
+ &bull; <!-- INCLUDE pagination.html -->
+ <!-- ELSE -->
+ &bull; {PAGE_NUMBER}
+ <!-- ENDIF -->
+ </div>
+ <!-- ENDIF -->
+
+ <fieldset class="display-options">
+ {L_DISPLAY_LOG}{L_COLON} &nbsp;{S_LIMIT_DAYS}&nbsp;{L_SORT_BY}{L_COLON} {S_SORT_KEY} {S_SORT_DIR}
+ <input class="button2" type="submit" value="{L_GO}" name="sort" />
+ </fieldset>
+
+ <hr />
+
+<!-- IF .attachments -->
+ <fieldset class="quick">
+ <input class="button2" type="submit" name="submit" value="{L_DELETE_MARKED}" /><br />
+ <p class="small">
+ <a href="#" onclick="marklist('attachments', 'delete', true); return false;">{L_MARK_ALL}</a> &bull;
+ <a href="#" onclick="marklist('attachments', 'delete', false); return false;">{L_UNMARK_ALL}</a>
+ </p>
+ </fieldset>
+<!-- ENDIF -->
+ {S_FORM_TOKEN}
+ </fieldset>
+ </form>
+
+ <!-- IF S_ACTION_OPTIONS -->
+ <fieldset>
+ <legend>{L_RESYNC_STATS}</legend>
+ <form id="action_stats_form" method="post" action="{U_ACTION}">
+ <dl>
+ <dt><label for="action_stats">{L_RESYNC_FILES_STATS}</label><br /><span>{L_RESYNC_FILES_STATS_EXPLAIN}</span></dt>
+ <dd><input type="hidden" name="action" value="stats" /><input class="button2" type="submit" id="action_stats" name="action_stats" value="{L_RUN}" /></dd>
+ </dl>
+ </form>
+ </fieldset>
+ <!-- ENDIF -->
<!-- ENDIF -->
-<!-- INCLUDE overall_footer.html --> \ No newline at end of file
+<!-- INCLUDE overall_footer.html -->
diff --git a/phpBB/adm/style/acp_avatar_options_gravatar.html b/phpBB/adm/style/acp_avatar_options_gravatar.html
new file mode 100644
index 0000000000..d5906ba87d
--- /dev/null
+++ b/phpBB/adm/style/acp_avatar_options_gravatar.html
@@ -0,0 +1,11 @@
+<dl>
+ <dt><label for="avatar_gravatar_email">{L_GRAVATAR_AVATAR_EMAIL}{L_COLON}</label><br /><span>{L_GRAVATAR_AVATAR_EMAIL_EXPLAIN}</span></dt>
+ <dd><input type="email" name="avatar_gravatar_email" id="avatar_gravatar_email" value="{AVATAR_GRAVATAR_EMAIL}" class="inputbox" /></dd>
+</dl>
+<dl>
+ <dt><label for="avatar_gravatar_width">{L_GRAVATAR_AVATAR_SIZE}{L_COLON}</label><br /><span>{L_GRAVATAR_AVATAR_SIZE_EXPLAIN}</span></dt>
+ <dd>
+ <input type="number" name="avatar_gravatar_width" id="avatar_gravatar_width" min="{AVATAR_MIN_WIDTH}" max="{AVATAR_MAX_WIDTH}" value="{AVATAR_GRAVATAR_WIDTH}" class="inputbox autowidth" /> {L_PIXEL} &times;&nbsp;
+ <input type="number" name="avatar_gravatar_height" id="avatar_gravatar_height" min="{AVATAR_MIN_HEIGHT}" max="{AVATAR_MAX_HEIGHT}" value="{AVATAR_GRAVATAR_HEIGHT}" class="inputbox autowidth" /> {L_PIXEL}
+ </dd>
+</dl>
diff --git a/phpBB/adm/style/acp_avatar_options_local.html b/phpBB/adm/style/acp_avatar_options_local.html
new file mode 100644
index 0000000000..bee3c57ea0
--- /dev/null
+++ b/phpBB/adm/style/acp_avatar_options_local.html
@@ -0,0 +1,20 @@
+<dl>
+ <dt><label for="category">{L_AVATAR_CATEGORY}{L_COLON}</label></dt>
+ <dd><select name="avatar_local_cat" id="category">
+ <!-- BEGIN avatar_local_cats -->
+ <option value="{avatar_local_cats.NAME}"<!-- IF avatar_local_cats.SELECTED --> selected="selected"<!-- ENDIF -->>{avatar_local_cats.NAME}</option>
+ <!-- END avatar_local_cats -->
+ </select>&nbsp;<input type="submit" value="{L_GO}" name="avatar_local_go" class="button2" /></dd>
+</dl>
+ <!-- IF AVATAR_LOCAL_SHOW -->
+ <ul id="gallery">
+ <!-- BEGIN avatar_local_row -->
+ <!-- BEGIN avatar_local_col -->
+ <li>
+ <label for="av-{avatar_local_row.S_ROW_COUNT}-{avatar_local_row.avatar_local_col.S_ROW_COUNT}"><img src="{avatar_local_row.avatar_local_col.AVATAR_IMAGE}" alt="" /><br />
+ <input type="radio" name="avatar_local_file" id="av-{avatar_local_row.S_ROW_COUNT}-{avatar_local_row.avatar_local_col.S_ROW_COUNT}" value="{avatar_local_row.avatar_local_col.AVATAR_FILE}"<!-- IF avatar_local_row.avatar_local_col.CHECKED -->checked="checked"<!-- ENDIF --> /></label>
+ </li>
+ <!-- END avatar_local_col -->
+ <!-- END avatar_local_row -->
+ </ul>
+ <!-- ENDIF -->
diff --git a/phpBB/adm/style/acp_avatar_options_remote.html b/phpBB/adm/style/acp_avatar_options_remote.html
new file mode 100644
index 0000000000..e64d13686c
--- /dev/null
+++ b/phpBB/adm/style/acp_avatar_options_remote.html
@@ -0,0 +1,11 @@
+<dl>
+ <dt><label for="avatar_remote_url">{L_LINK_REMOTE_AVATAR}{L_COLON}</label><br /><span>{L_LINK_REMOTE_AVATAR_EXPLAIN}</span></dt>
+ <dd><input type="url" name="avatar_remote_url" id="avatar_remote_url" value="{AVATAR_REMOTE_URL}" class="inputbox" /></dd>
+</dl>
+<dl>
+ <dt><label for="avatar_remote_width">{L_LINK_REMOTE_SIZE}{L_COLON}</label><br /><span>{L_LINK_REMOTE_SIZE_EXPLAIN}</span></dt>
+ <dd>
+ <input type="number" name="avatar_remote_width" id="avatar_remote_width" min="{AVATAR_MIN_WIDTH}" max="{AVATAR_MAX_WIDTH}" value="{AVATAR_REMOTE_WIDTH}" class="inputbox autowidth" /> {L_PIXEL} &times;&nbsp;
+ <input type="number" name="avatar_remote_height" id="avatar_remote_height" min="{AVATAR_MIN_HEIGHT}" max="{AVATAR_MAX_HEIGHT}" value="{AVATAR_REMOTE_HEIGHT}" class="inputbox autowidth" /> {L_PIXEL}
+ </dd>
+</dl>
diff --git a/phpBB/adm/style/acp_avatar_options_upload.html b/phpBB/adm/style/acp_avatar_options_upload.html
new file mode 100644
index 0000000000..63a734ea7d
--- /dev/null
+++ b/phpBB/adm/style/acp_avatar_options_upload.html
@@ -0,0 +1,11 @@
+<dl>
+ <dt><label for="avatar_upload_file">{L_UPLOAD_AVATAR_FILE}{L_COLON}</label></dt>
+ <dd><input type="hidden" name="MAX_FILE_SIZE" value="{AVATAR_UPLOAD_SIZE}" /><input type="file" name="avatar_upload_file" id="avatar_upload_file" class="inputbox autowidth" /></dd>
+</dl>
+
+<!-- IF S_UPLOAD_AVATAR_URL -->
+ <dl>
+ <dt><label for="avatar_upload_url">{L_UPLOAD_AVATAR_URL}{L_COLON}</label><br /><span>{L_UPLOAD_AVATAR_URL_EXPLAIN}</span></dt>
+ <dd><input type="url" name="avatar_upload_url" id="avatar_upload_url" value="" class="inputbox" /></dd>
+ </dl>
+<!-- ENDIF -->
diff --git a/phpBB/adm/style/acp_ban.html b/phpBB/adm/style/acp_ban.html
index 0e2e71822e..f2249941a5 100644
--- a/phpBB/adm/style/acp_ban.html
+++ b/phpBB/adm/style/acp_ban.html
@@ -1,6 +1,6 @@
<!-- INCLUDE overall_header.html -->
-<a name="maincontent"></a>
+<a id="maincontent"></a>
<p>{L_ACP_BAN_EXPLAIN}</p>
@@ -13,27 +13,34 @@
var ban_length = new Array();
ban_length[-1] = '';
- <!-- BEGIN ban_length -->
- ban_length['{ban_length.BAN_ID}'] = '{ban_length.A_LENGTH}';
- <!-- END ban_length -->
-
var ban_reason = new Array();
ban_reason[-1] = '';
- <!-- BEGIN ban_reason -->
- ban_reason['{ban_reason.BAN_ID}'] = '{ban_reason.A_REASON}';
- <!-- END ban_reason -->
-
var ban_give_reason = new Array();
ban_give_reason[-1] = '';
- <!-- BEGIN ban_give_reason -->
- ban_give_reason['{ban_give_reason.BAN_ID}'] = '{ban_give_reason.A_REASON}';
- <!-- END ban_give_reason -->
+
+ <!-- BEGIN bans -->
+ ban_length['{bans.BAN_ID}'] = '{bans.A_LENGTH}';
+ <!-- IF bans.A_REASON -->
+ ban_reason['{bans.BAN_ID}'] = '{bans.A_REASON}';
+ <!-- ENDIF -->
+ <!-- IF bans.A_GIVE_REASON -->
+ ban_give_reason['{bans.BAN_ID}'] = '{bans.A_GIVE_REASON}';
+ <!-- ENDIF -->
+ <!-- END bans -->
function display_details(option)
{
- document.getElementById('acp_unban').unbangivereason.innerHTML = ban_give_reason[option];
- document.getElementById('acp_unban').unbanreason.innerHTML = ban_reason[option];
- document.getElementById('acp_unban').unbanlength.value = ban_length[option];
+ document.getElementById('unbanlength').value = ban_length[option];
+ if (option in ban_reason) {
+ document.getElementById('unbanreason').innerHTML = ban_reason[option];
+ } else {
+ document.getElementById('unbanreason').innerHTML = '';
+ }
+ if (option in ban_give_reason) {
+ document.getElementById('unbangivereason').innerHTML = ban_give_reason[option];
+ } else {
+ document.getElementById('unbangivereason').innerHTML = '';
+ }
}
// ]]>
@@ -44,26 +51,26 @@
<fieldset>
<legend>{L_TITLE}</legend>
<dl>
- <dt><label for="ban">{L_BAN_CELL}:</label></dt>
- <dd><textarea name="ban" cols="40" rows="3" id="ban"></textarea></dd>
+ <dt><label for="ban">{L_BAN_CELL}{L_COLON}</label></dt>
+ <dd><!-- EVENT acp_ban_cell_prepend --><textarea name="ban" cols="40" rows="3" id="ban"></textarea><!-- EVENT acp_ban_cell_append --></dd>
<!-- IF S_USERNAME_BAN --><dd>[ <a href="{U_FIND_USERNAME}" onclick="find_username(this.href); return false;">{L_FIND_USERNAME}</a> ]</dd><!-- ENDIF -->
</dl>
<dl>
- <dt><label for="banlength">{L_BAN_LENGTH}:</label></dt>
+ <dt><label for="banlength">{L_BAN_LENGTH}{L_COLON}</label></dt>
<dd><label for="banlength"><select name="banlength" id="banlength" onchange="if(this.value==-1){document.getElementById('banlengthother').style.display = 'block';}else{document.getElementById('banlengthother').style.display='none';}">{S_BAN_END_OPTIONS}</select></label></dd>
<dd id="banlengthother" style="display: none;"><label><input type="text" name="banlengthother" class="inputbox" /><br /><span>{L_YEAR_MONTH_DAY}</span></label></dd>
</dl>
<dl>
- <dt><label for="banexclude">{L_BAN_EXCLUDE}:</label><br /><span>{L_BAN_EXCLUDE_EXPLAIN}</span></dt>
+ <dt><label for="banexclude">{L_BAN_EXCLUDE}{L_COLON}</label><br /><span>{L_BAN_EXCLUDE_EXPLAIN}</span></dt>
<dd><label><input type="radio" name="banexclude" value="1" class="radio" /> {L_YES}</label>
<label><input type="radio" name="banexclude" id="banexclude" value="0" checked="checked" class="radio" /> {L_NO}</label></dd>
</dl>
<dl>
- <dt><label for="banreason">{L_BAN_REASON}:</label></dt>
+ <dt><label for="banreason">{L_BAN_REASON}{L_COLON}</label></dt>
<dd><input name="banreason" type="text" class="text medium" maxlength="255" id="banreason" /></dd>
</dl>
<dl>
- <dt><label for="bangivereason">{L_BAN_GIVE_REASON}:</label></dt>
+ <dt><label for="bangivereason">{L_BAN_GIVE_REASON}{L_COLON}</label></dt>
<dd><input name="bangivereason" type="text" class="text medium" maxlength="255" id="bangivereason" /></dd>
</dl>
@@ -88,19 +95,19 @@
<!-- IF S_BANNED_OPTIONS -->
<dl>
- <dt><label for="unban">{L_BAN_CELL}:</label></dt>
+ <dt><label for="unban">{L_BAN_CELL}{L_COLON}</label></dt>
<dd><select id="unban" name="unban[]" multiple="multiple" size="10" style="width: 50%" onchange="if (this.selectedIndex > -1) display_details(this.options[this.selectedIndex].value); else display_details(-1);">{BANNED_OPTIONS}</select></dd>
</dl>
<dl>
- <dt><label for="unbanlength">{L_BAN_LENGTH}:</label></dt>
+ <dt><label for="unbanlength">{L_BAN_LENGTH}{L_COLON}</label></dt>
<dd><input style="border: 0;" type="text" class="text full" readonly="readonly" name="unbanlength" id="unbanlength" /></dd>
</dl>
<dl>
- <dt><label for="unbanreason">{L_BAN_REASON}:</label></dt>
+ <dt><label for="unbanreason">{L_BAN_REASON}{L_COLON}</label></dt>
<dd><textarea style="border: 0;" class="text full" readonly="readonly" name="unbanreason" id="unbanreason" rows="5" cols="80">&nbsp;</textarea></dd>
</dl>
<dl>
- <dt><label for="unbangivereason">{L_BAN_GIVE_REASON}:</label></dt>
+ <dt><label for="unbangivereason">{L_BAN_GIVE_REASON}{L_COLON}</label></dt>
<dd><textarea style="border: 0;" class="text full" readonly="readonly" name="unbangivereason" id="unbangivereason" rows="5" cols="80">&nbsp;</textarea></dd>
</dl>
@@ -121,4 +128,4 @@
</form>
-<!-- INCLUDE overall_footer.html --> \ No newline at end of file
+<!-- INCLUDE overall_footer.html -->
diff --git a/phpBB/adm/style/acp_bbcodes.html b/phpBB/adm/style/acp_bbcodes.html
index c81c198fd5..8c8b805975 100644
--- a/phpBB/adm/style/acp_bbcodes.html
+++ b/phpBB/adm/style/acp_bbcodes.html
@@ -1,6 +1,6 @@
<!-- INCLUDE overall_header.html -->
-<a name="maincontent"></a>
+<a id="maincontent"></a>
<!-- IF S_EDIT_BBCODE -->
@@ -47,6 +47,8 @@
</dl>
</fieldset>
+ <!-- EVENT acp_bbcodes_edit_fieldsets_after -->
+
<fieldset class="submit-buttons">
<legend>{L_SUBMIT}</legend>
<input class="button1" type="submit" id="submit" name="submit" value="{L_SUBMIT}" />&nbsp;
@@ -56,7 +58,7 @@
<br />
- <table cellspacing="1" id="down">
+ <table class="table1" id="down">
<thead>
<tr>
<th colspan="2">{L_TOKENS}</th>
@@ -71,7 +73,7 @@
</thead>
<tbody>
<!-- BEGIN token -->
- <tr valign="top">
+ <tr style="vertical-align: top;">
<td class="row1">{token.TOKEN}</td>
<td class="row2">{token.EXPLAIN}</td>
</tr>
@@ -90,7 +92,7 @@
<fieldset class="tabulated">
<legend>{L_ACP_BBCODES}</legend>
- <table cellspacing="1" id="down">
+ <table class="table1 zebra-table" id="down">
<thead>
<tr>
<th>{L_BBCODE_TAG}</th>
@@ -99,9 +101,9 @@
</thead>
<tbody>
<!-- BEGIN bbcodes -->
- <!-- IF bbcodes.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
+ <tr>
<td style="text-align: center;">{bbcodes.BBCODE_TAG}</td>
- <td style="text-align: right; width: 40px;"><a href="{bbcodes.U_EDIT}">{ICON_EDIT}</a> <a href="{bbcodes.U_DELETE}">{ICON_DELETE}</a></td>
+ <td class="actions"><!-- EVENT acp_bbcodes_actions_prepend --> <a href="{bbcodes.U_EDIT}">{ICON_EDIT}</a> <a href="{bbcodes.U_DELETE}" data-ajax="row_delete">{ICON_DELETE}</a> <!-- EVENT acp_bbcodes_actions_append --></td>
</tr>
<!-- BEGINELSE -->
<tr class="row3">
diff --git a/phpBB/adm/style/acp_board.html b/phpBB/adm/style/acp_board.html
index bb16204801..64592a5de2 100644
--- a/phpBB/adm/style/acp_board.html
+++ b/phpBB/adm/style/acp_board.html
@@ -1,6 +1,6 @@
<!-- INCLUDE overall_header.html -->
-<a name="maincontent"></a>
+<a id="maincontent"></a>
<h1>{L_TITLE}</h1>
@@ -25,7 +25,7 @@
<!-- ELSE -->
<dl>
- <dt><label for="{options.KEY}">{options.TITLE}:</label><!-- IF options.S_EXPLAIN --><br /><span>{options.TITLE_EXPLAIN}</span><!-- ENDIF --></dt>
+ <dt><label for="{options.KEY}">{options.TITLE}{L_COLON}</label><!-- IF options.S_EXPLAIN --><br /><span>{options.TITLE_EXPLAIN}</span><!-- ENDIF --></dt>
<dd>{options.CONTENT}</dd>
</dl>
@@ -33,9 +33,12 @@
<!-- END options -->
<!-- IF S_AUTH -->
+ </fieldset>
<!-- BEGIN auth_tpl -->
- {auth_tpl.TPL}
+ <!-- INCLUDE {auth_tpl.TEMPLATE_FILE} -->
<!-- END auth_tpl -->
+ <fieldset>
+ <legend>{L_ACP_SUBMIT_CHANGES}</legend>
<!-- ENDIF -->
<p class="submit-buttons">
diff --git a/phpBB/adm/style/acp_bots.html b/phpBB/adm/style/acp_bots.html
index 7783356574..b0e61015b6 100644
--- a/phpBB/adm/style/acp_bots.html
+++ b/phpBB/adm/style/acp_bots.html
@@ -1,6 +1,6 @@
<!-- INCLUDE overall_header.html -->
-<a name="maincontent"></a>
+<a id="maincontent"></a>
<!-- IF S_EDIT_BOT -->
@@ -22,27 +22,27 @@
<fieldset>
<legend>{L_TITLE}</legend>
<dl>
- <dt><label for="bot_name">{L_BOT_NAME}:</label><br /><span>{L_BOT_NAME_EXPLAIN}</span></dt>
+ <dt><label for="bot_name">{L_BOT_NAME}{L_COLON}</label><br /><span>{L_BOT_NAME_EXPLAIN}</span></dt>
<dd><input name="bot_name" type="text" id="bot_name" value="{BOT_NAME}" maxlength="255" /></dd>
</dl>
<dl>
- <dt><label for="bot_style">{L_BOT_STYLE}:</label><br /><span>{L_BOT_STYLE_EXPLAIN}</span></dt>
+ <dt><label for="bot_style">{L_BOT_STYLE}{L_COLON}</label><br /><span>{L_BOT_STYLE_EXPLAIN}</span></dt>
<dd><select id="bot_style" name="bot_style">{S_STYLE_OPTIONS}</select></dd>
</dl>
<dl>
- <dt><label for="bot_lang">{L_BOT_LANG}:</label><br /><span>{L_BOT_LANG_EXPLAIN}</span></dt>
+ <dt><label for="bot_lang">{L_BOT_LANG}{L_COLON}</label><br /><span>{L_BOT_LANG_EXPLAIN}</span></dt>
<dd><select id="bot_lang" name="bot_lang">{S_LANG_OPTIONS}</select></dd>
</dl>
<dl>
- <dt><label for="bot_active">{L_BOT_ACTIVE}:</label></dt>
+ <dt><label for="bot_active">{L_BOT_ACTIVE}{L_COLON}</label></dt>
<dd><select id="bot_active" name="bot_active">{S_ACTIVE_OPTIONS}</select></dd>
</dl>
<dl>
- <dt><label for="bot_agent">{L_BOT_AGENT}:</label><br /><span>{L_BOT_AGENT_EXPLAIN}</span></dt>
+ <dt><label for="bot_agent">{L_BOT_AGENT}{L_COLON}</label><br /><span>{L_BOT_AGENT_EXPLAIN}</span></dt>
<dd><input name="bot_agent" type="text" id="bot_agent" value="{BOT_AGENT}" maxlength="255" /></dd>
</dl>
<dl>
- <dt><label for="bot_ip">{L_BOT_IP}:</label><br /><span>{L_BOT_IP_EXPLAIN}</span></dt>
+ <dt><label for="bot_ip">{L_BOT_IP}{L_COLON}</label><br /><span>{L_BOT_IP_EXPLAIN}</span></dt>
<dd><input name="bot_ip" type="text" id="bot_ip" value="{BOT_IP}" maxlength="255" /></dd>
</dl>
@@ -62,7 +62,7 @@
<form id="acp_bots" method="post" action="{U_ACTION}">
- <table cellspacing="1">
+ <table class="table1 zebra-table">
<thead>
<tr>
<th>{L_BOT_NAME}</th>
@@ -73,12 +73,12 @@
</thead>
<tbody>
<!-- BEGIN bots -->
- <!-- IF bots.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
+ <tr>
<td style="width: 50%;">{bots.BOT_NAME}</td>
<td style="width: 15%; white-space: nowrap;" align="center">&nbsp;{bots.LAST_VISIT}&nbsp;</td>
- <td style="text-align: center;">&nbsp;<a href="{bots.U_ACTIVATE_DEACTIVATE}">{bots.L_ACTIVATE_DEACTIVATE}</a>&nbsp;</td>
+ <td style="text-align: center;">&nbsp;<a href="{bots.U_ACTIVATE_DEACTIVATE}" data-ajax="activate_deactivate">{bots.L_ACTIVATE_DEACTIVATE}</a>&nbsp;</td>
<td style="text-align: center;">&nbsp;<a href="{bots.U_EDIT}">{L_EDIT}</a>&nbsp;</td>
- <td style="text-align: center;">&nbsp;<a href="{bots.U_DELETE}">{L_DELETE}</a>&nbsp;</td>
+ <td style="text-align: center;">&nbsp;<a href="{bots.U_DELETE}" data-ajax="row_delete">{L_DELETE}</a>&nbsp;</td>
<td style="text-align: center;"><input type="checkbox" class="radio" name="mark[]" value="{bots.BOT_ID}" /></td>
</tr>
<!-- END bots -->
diff --git a/phpBB/adm/style/acp_captcha.html b/phpBB/adm/style/acp_captcha.html
index 8eee370284..4353becd2f 100644
--- a/phpBB/adm/style/acp_captcha.html
+++ b/phpBB/adm/style/acp_captcha.html
@@ -1,11 +1,19 @@
<!-- INCLUDE overall_header.html -->
-<a name="maincontent"></a>
+<a id="maincontent"></a>
<h1>{L_ACP_VC_SETTINGS}</h1>
<p>{L_ACP_VC_SETTINGS_EXPLAIN}</p>
+<p>{L_ACP_VC_EXT_GET_MORE}</p>
+
+<!-- IF ERROR_MSG -->
+<div class="errorbox">
+ <h3>{L_WARNING}</h3>
+ <p>{ERROR_MSG}</p>
+</div>
+<!-- ENDIF -->
<form id="acp_captcha" method="post" action="{U_ACTION}">
@@ -13,25 +21,25 @@
<legend>{L_GENERAL_OPTIONS}</legend>
<dl>
- <dt><label for="enable_confirm">{L_VISUAL_CONFIRM_REG}:</label><br /><span>{L_VISUAL_CONFIRM_REG_EXPLAIN}</span></dt>
+ <dt><label for="enable_confirm">{L_VISUAL_CONFIRM_REG}{L_COLON}</label><br /><span>{L_VISUAL_CONFIRM_REG_EXPLAIN}</span></dt>
<dd><label><input type="radio" class="radio" id="enable_confirm" name="enable_confirm" value="1"<!-- IF REG_ENABLE --> checked="checked"<!-- ENDIF --> /> {L_ENABLED}</label>
<label><input type="radio" class="radio" name="enable_confirm" value="0"<!-- IF not REG_ENABLE --> checked="checked"<!-- ENDIF --> /> {L_DISABLED}</label></dd>
</dl>
<dl>
- <dt><label for="max_reg_attempts">{L_REG_LIMIT}:</label><br /><span>{L_REG_LIMIT_EXPLAIN}</span></dt>
- <dd><input id="max_reg_attempts" type="text" size="4" maxlength="4" name="max_reg_attempts" value="{REG_LIMIT}" /></dd>
+ <dt><label for="max_reg_attempts">{L_REG_LIMIT}{L_COLON}</label><br /><span>{L_REG_LIMIT_EXPLAIN}</span></dt>
+ <dd><input id="max_reg_attempts" type="number" min="0" max="9999" name="max_reg_attempts" value="{REG_LIMIT}" /></dd>
</dl>
<dl>
- <dt><label for="max_login_attempts">{L_MAX_LOGIN_ATTEMPTS}:</label><br /><span>{L_MAX_LOGIN_ATTEMPTS_EXPLAIN}</span></dt>
- <dd><input id="max_login_attempts" type="text" size="4" maxlength="4" name="max_login_attempts" value="{MAX_LOGIN_ATTEMPTS}" /></dd>
+ <dt><label for="max_login_attempts">{L_MAX_LOGIN_ATTEMPTS}{L_COLON}</label><br /><span>{L_MAX_LOGIN_ATTEMPTS_EXPLAIN}</span></dt>
+ <dd><input id="max_login_attempts" type="number" min="0" max="9999" name="max_login_attempts" value="{MAX_LOGIN_ATTEMPTS}" /></dd>
</dl>
<dl>
- <dt><label for="enable_post_confirm">{L_VISUAL_CONFIRM_POST}:</label><br /><span>{L_VISUAL_CONFIRM_POST_EXPLAIN}</span></dt>
+ <dt><label for="enable_post_confirm">{L_VISUAL_CONFIRM_POST}{L_COLON}</label><br /><span>{L_VISUAL_CONFIRM_POST_EXPLAIN}</span></dt>
<dd><label><input type="radio" class="radio" id="enable_post_confirm" name="enable_post_confirm" value="1"<!-- IF POST_ENABLE --> checked="checked"<!-- ENDIF --> /> {L_ENABLED}</label>
<label><input type="radio" class="radio" name="enable_post_confirm" value="0"<!-- IF not POST_ENABLE --> checked="checked"<!-- ENDIF --> /> {L_DISABLED}</label></dd>
</dl>
<dl>
- <dt><label for="confirm_refresh">{L_VISUAL_CONFIRM_REFRESH}:</label><br /><span>{L_VISUAL_CONFIRM_REFRESH_EXPLAIN}</span></dt>
+ <dt><label for="confirm_refresh">{L_VISUAL_CONFIRM_REFRESH}{L_COLON}</label><br /><span>{L_VISUAL_CONFIRM_REFRESH_EXPLAIN}</span></dt>
<dd><label><input type="radio" class="radio" id="confirm_refresh" name="confirm_refresh" value="1"<!-- IF CONFIRM_REFRESH --> checked="checked"<!-- ENDIF --> /> {L_ENABLED}</label>
<label><input type="radio" class="radio" name="confirm_refresh" value="0"<!-- IF not CONFIRM_REFRESH --> checked="checked"<!-- ENDIF --> /> {L_DISABLED}</label></dd>
</dl>
@@ -40,12 +48,12 @@
<fieldset>
<legend>{L_AVAILABLE_CAPTCHAS}</legend>
<dl>
- <dt><label for="captcha_select">{L_CAPTCHA_SELECT}:</label><br /><span>{L_CAPTCHA_SELECT_EXPLAIN}</span></dt>
+ <dt><label for="captcha_select">{L_CAPTCHA_SELECT}{L_COLON}</label><br /><span>{L_CAPTCHA_SELECT_EXPLAIN}</span></dt>
<dd><select id="captcha_select" name="select_captcha" onchange="(document.getElementById('acp_captcha')).submit()" >{CAPTCHA_SELECT}</select></dd>
</dl>
<!-- IF S_CAPTCHA_HAS_CONFIG -->
<dl>
- <dt><label for="configure">{L_CAPTCHA_CONFIGURE}:</label><br /><span>{L_CAPTCHA_CONFIGURE_EXPLAIN}</span></dt>
+ <dt><label for="configure">{L_CAPTCHA_CONFIGURE}{L_COLON}</label><br /><span>{L_CAPTCHA_CONFIGURE_EXPLAIN}</span></dt>
<dd><input class="button2" type="submit" id="configure" name="configure" value="{L_CONFIGURE}" /></dd>
</dl>
<!-- ENDIF -->
diff --git a/phpBB/adm/style/acp_contact.html b/phpBB/adm/style/acp_contact.html
new file mode 100644
index 0000000000..828fd4b659
--- /dev/null
+++ b/phpBB/adm/style/acp_contact.html
@@ -0,0 +1,76 @@
+<!-- INCLUDE overall_header.html -->
+
+<script type="text/javascript">
+// <![CDATA[
+
+ var form_name = 'acp_contact';
+ var text_name = 'contact_admin_info';
+ var load_draft = false;
+ var upload = false;
+ var imageTag = false;
+
+// ]]>
+</script>
+
+<a id="maincontent"></a>
+
+<h1>{L_ACP_CONTACT_SETTINGS}</h1>
+
+<p>{L_ACP_CONTACT_SETTINGS_EXPLAIN}</p>
+
+<form id="acp_contact" method="post" action="{U_ACTION}">
+ <fieldset>
+ <legend>{L_GENERAL_OPTIONS}</legend>
+ <dl>
+ <dt><label for="contact_admin_form_enable">{L_CONTACT_US_ENABLE}{L_COLON}</label><br /><span>{L_CONTACT_US_ENABLE_EXPLAIN}</span></dt>
+ <dd>
+ <label><input type="radio" class="radio" id="contact_admin_form_enable" name="contact_admin_form_enable" value="1"<!-- IF CONTACT_ENABLED --> checked="checked"<!-- ENDIF --> /> {L_ENABLED}</label>
+ <label><input type="radio" class="radio" name="contact_admin_form_enable" value="0"<!-- IF not CONTACT_ENABLED --> checked="checked"<!-- ENDIF --> /> {L_DISABLED}</label>
+ </dd>
+ </dl>
+ </fieldset>
+
+ <!-- IF CONTACT_US_INFO_PREVIEW -->
+ <fieldset>
+ <legend>{L_CONTACT_US_INFO_PREVIEW}</legend>
+ <p>{CONTACT_US_INFO_PREVIEW}</p>
+ </fieldset>
+ <!-- ENDIF -->
+
+ <fieldset>
+ <legend>{L_CONTACT_US_INFO}</legend>
+ <p>{L_CONTACT_US_INFO_EXPLAIN}</p>
+
+ <!-- INCLUDE acp_posting_buttons.html -->
+
+ <dl class="responsive-columns">
+ <dt style="width: 90px;" id="color_palette_placeholder" data-orientation="v" data-height="12" data-width="15" data-bbcode="true">
+ </dt>
+
+ <dd style="margin-{S_CONTENT_FLOW_BEGIN}: 90px;">
+ <textarea name="contact_admin_info" rows="10" cols="60" style="width: 95%;" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);" onfocus="initInsertions();" data-bbcode="true">{CONTACT_US_INFO}</textarea>
+ </dd>
+
+ <dd style="margin-{S_CONTENT_FLOW_BEGIN}: 90px; margin-top: 5px;">
+ <!-- IF S_BBCODE_ALLOWED -->
+ <label><input type="checkbox" class="radio" name="disable_bbcode"<!-- IF S_BBCODE_DISABLE_CHECKED --> checked="checked"<!-- ENDIF --> /> {L_DISABLE_BBCODE}</label>
+ <!-- ENDIF -->
+ <!-- IF S_SMILIES_ALLOWED -->
+ <label><input type="checkbox" class="radio" name="disable_smilies"<!-- IF S_SMILIES_DISABLE_CHECKED --> checked="checked"<!-- ENDIF --> /> {L_DISABLE_SMILIES}</label>
+ <!-- ENDIF -->
+ <!-- IF S_LINKS_ALLOWED -->
+ <label><input type="checkbox" class="radio" name="disable_magic_url"<!-- IF S_MAGIC_URL_DISABLE_CHECKED --> checked="checked"<!-- ENDIF --> /> {L_DISABLE_MAGIC_URL}</label>
+ <!-- ENDIF -->
+ </dd>
+ <dd style="margin-{S_CONTENT_FLOW_BEGIN}: 90px; margin-top: 10px;"><strong>{L_OPTIONS}{L_COLON} </strong>{BBCODE_STATUS} :: {IMG_STATUS} :: {FLASH_STATUS} :: {URL_STATUS} :: {SMILIES_STATUS}</dd>
+ </dl>
+ </fieldset>
+
+ <fieldset class="submit-buttons">
+ <input class="button1" type="submit" id="submit" name="submit" value="{L_SUBMIT}" />&nbsp;
+ <input class="button2" type="submit" name="preview" value="{L_PREVIEW}" />
+ {S_FORM_TOKEN}
+ </fieldset>
+</form>
+
+<!-- INCLUDE overall_footer.html -->
diff --git a/phpBB/adm/style/acp_database.html b/phpBB/adm/style/acp_database.html
index de02ac6dbe..39f06319f9 100644
--- a/phpBB/adm/style/acp_database.html
+++ b/phpBB/adm/style/acp_database.html
@@ -1,6 +1,6 @@
<!-- INCLUDE overall_header.html -->
-<a name="maincontent"></a>
+<a id="maincontent"></a>
<!-- IF MODE eq 'restore' -->
<h1>{L_ACP_RESTORE}</h1>
@@ -13,8 +13,8 @@
<fieldset>
<legend>{L_RESTORE_OPTIONS}</legend>
<dl>
- <dt><label for="file">{L_SELECT_FILE}:</label></dt>
- <dd><select id="file" name="file" size="10"><!-- BEGIN files --><option value="{files.FILE}"<!-- IF files.S_LAST_ROW --> selected="selected"<!-- ENDIF -->>{files.NAME}</option><!-- END files --></select></dd>
+ <dt><label for="file">{L_SELECT_FILE}{L_COLON}</label></dt>
+ <dd><select id="file" name="file" size="10"><!-- BEGIN files --><option value="{files.FILE}"<!-- IF files.S_FIRST_ROW --> selected="selected"<!-- ENDIF -->>{files.NAME}</option><!-- END files --></select></dd>
</dl>
<p class="submit-buttons">
@@ -57,26 +57,26 @@
<fieldset>
<legend>{L_BACKUP_OPTIONS}</legend>
<dl>
- <dt><label for="type">{L_BACKUP_TYPE}:</label></dt>
+ <dt><label for="type">{L_BACKUP_TYPE}{L_COLON}</label></dt>
<dd><label><input type="radio" class="radio" name="type" value="full" id="type" checked="checked" /> {L_FULL_BACKUP}</label>
<label><input type="radio" name="type" class="radio" value="structure" /> {L_STRUCTURE_ONLY}</label>
<label><input type="radio" class="radio" name="type" value="data" /> {L_DATA_ONLY}</label></dd>
</dl>
<dl>
- <dt><label for="method">{L_FILE_TYPE}:</label></dt>
+ <dt><label for="method">{L_FILE_TYPE}{L_COLON}</label></dt>
<dd><!-- BEGIN methods -->
<label><input name="method"<!-- IF methods.S_FIRST_ROW --> id="method" checked="checked"<!-- ENDIF --> type="radio" class="radio" value="{methods.TYPE}" /> {methods.TYPE}</label>
<!-- END methods --></dd>
</dl>
<dl>
- <dt><label for="where">{L_ACTION}:</label></dt>
+ <dt><label for="where">{L_ACTION}{L_COLON}</label></dt>
<dd>
<label><input id="where" type="radio" class="radio" name="where" value="store" checked="checked" /> {L_STORE_LOCAL}</label>
<label><input type="radio" class="radio" name="where" value="download" /> {L_DOWNLOAD}</label>
</dd>
</dl>
<dl>
- <dt><label for="table">{L_TABLE_SELECT}:</label></dt>
+ <dt><label for="table">{L_TABLE_SELECT}{L_COLON}</label></dt>
<dd><select id="table" name="table[]" size="10" multiple="multiple">
<!-- BEGIN tables -->
<option value="{tables.TABLE}">{tables.TABLE}</option>
diff --git a/phpBB/adm/style/acp_disallow.html b/phpBB/adm/style/acp_disallow.html
index b68d3ab3c0..0608f29474 100644
--- a/phpBB/adm/style/acp_disallow.html
+++ b/phpBB/adm/style/acp_disallow.html
@@ -1,6 +1,6 @@
<!-- INCLUDE overall_header.html -->
-<a name="maincontent"></a>
+<a id="maincontent"></a>
<h1>{L_ACP_DISALLOW_USERNAMES}</h1>
@@ -11,7 +11,7 @@
<fieldset>
<legend>{L_ADD_DISALLOW_TITLE}</legend>
<dl>
- <dt><label for="user">{L_USERNAME}:</label><br /><span>{L_ADD_DISALLOW_EXPLAIN}</span></dt>
+ <dt><label for="user">{L_USERNAME}{L_COLON}</label><br /><span>{L_ADD_DISALLOW_EXPLAIN}</span></dt>
<dd><input id="user" type="text" class="text medium" maxlength="255" name="disallowed_user" /></dd>
</dl>
@@ -28,7 +28,7 @@
<legend>{L_DELETE_DISALLOW_TITLE}</legend>
<!-- IF S_DISALLOWED_NAMES -->
<dl>
- <dt><label for="disallowed">{L_USERNAME}:</label></dt>
+ <dt><label for="disallowed">{L_USERNAME}{L_COLON}</label></dt>
<dd><select name="disallowed_id" id="disallowed">{S_DISALLOWED_NAMES}</select></dd>
</dl>
diff --git a/phpBB/adm/style/acp_email.html b/phpBB/adm/style/acp_email.html
index ff52500dca..e14c56ab47 100644
--- a/phpBB/adm/style/acp_email.html
+++ b/phpBB/adm/style/acp_email.html
@@ -1,6 +1,6 @@
<!-- INCLUDE overall_header.html -->
-<a name="maincontent"></a>
+<a id="maincontent"></a>
<h1>{L_ACP_MASS_EMAIL}</h1>
@@ -18,35 +18,39 @@
<fieldset>
<legend>{L_COMPOSE}</legend>
<dl>
- <dt><label for="group">{L_SEND_TO_GROUP}:</label></dt>
+ <dt><label for="group">{L_SEND_TO_GROUP}{L_COLON}</label></dt>
+ <!-- EVENT acp_email_group_options_prepend -->
<dd><select id="group" name="g">{S_GROUP_OPTIONS}</select></dd>
+ <!-- EVENT acp_email_group_options_append -->
</dl>
<dl>
- <dt><label for="usernames">{L_SEND_TO_USERS}:</label><br /><span>{L_SEND_TO_USERS_EXPLAIN}</span></dt>
+ <dt><label for="usernames">{L_SEND_TO_USERS}{L_COLON}</label><br /><span>{L_SEND_TO_USERS_EXPLAIN}</span></dt>
<dd><textarea name="usernames" id="usernames" rows="5" cols="40">{USERNAMES}</textarea></dd>
- <dd>[ <a href="{U_FIND_USERNAME}" onclick="find_username(this.href); return false;">{L_FIND_USERNAME}</a> ]</dd>
+ <dd><!-- EVENT acp_email_find_username_prepend -->[ <a href="{U_FIND_USERNAME}" onclick="find_username(this.href); return false;">{L_FIND_USERNAME}</a> ]<!-- EVENT acp_email_find_username_append --></dd>
</dl>
<dl>
- <dt><label for="subject">{L_SUBJECT}:</label></dt>
+ <dt><label for="subject">{L_SUBJECT}{L_COLON}</label></dt>
<dd><input name="subject" type="text" id="subject" value="{SUBJECT}" /></dd>
</dl>
<dl>
- <dt><label for="message">{L_MASS_MESSAGE}:</label><br /><span>{L_MASS_MESSAGE_EXPLAIN}</span></dt>
+ <dt><label for="message">{L_MASS_MESSAGE}{L_COLON}</label><br /><span>{L_MASS_MESSAGE_EXPLAIN}</span></dt>
<dd><textarea id="message" name="message" rows="10" cols="60">{MESSAGE}</textarea></dd>
</dl>
<dl>
- <dt><label for="priority">{L_MAIL_PRIORITY}:</label></dt>
+ <dt><label for="priority">{L_MAIL_PRIORITY}{L_COLON}</label></dt>
<dd><select id="priority" name="mail_priority_flag">{S_PRIORITY_OPTIONS}</select></dd>
</dl>
<dl>
- <dt><label for="banned">{L_MAIL_BANNED}:</label><br /><span>{L_MAIL_BANNED_EXPLAIN}</span></dt>
+ <dt><label for="banned">{L_MAIL_BANNED}{L_COLON}</label><br /><span>{L_MAIL_BANNED_EXPLAIN}</span></dt>
<dd><input id="banned" name="mail_banned_flag" type="checkbox" class="radio" /></dd>
</dl>
<dl>
- <dt><label for="send">{L_SEND_IMMEDIATELY}:</label></dt>
+ <dt><label for="send">{L_SEND_IMMEDIATELY}{L_COLON}</label></dt>
<dd><input id="send" type="checkbox" class="radio" name="send_immediately" checked="checked" /></dd>
</dl>
+<!-- EVENT acp_email_options_after -->
+
<p class="submit-buttons">
<input class="button1" type="submit" id="submit" name="submit" value="{L_SEND_EMAIL}" />&nbsp;
<input class="button2" type="reset" id="reset" name="reset" value="{L_RESET}" />
diff --git a/phpBB/adm/style/acp_ext_delete_data.html b/phpBB/adm/style/acp_ext_delete_data.html
new file mode 100644
index 0000000000..0f3adb7cfe
--- /dev/null
+++ b/phpBB/adm/style/acp_ext_delete_data.html
@@ -0,0 +1,40 @@
+<!-- INCLUDE overall_header.html -->
+
+ <a id="maincontent"></a>
+
+ <h1>{L_EXTENSIONS_ADMIN}</h1>
+
+ <p>{L_EXTENSIONS_EXPLAIN}</p>
+ <p>{L_EXTENSION_DELETE_DATA_EXPLAIN}</p>
+
+ <!-- IF MIGRATOR_ERROR -->
+ <div class="errorbox">
+ <p><strong>{L_MIGRATION_EXCEPTION_ERROR}</strong></p>
+ <p>{MIGRATOR_ERROR}</p>
+ <p><a href="{U_RETURN}">{L_RETURN_TO_EXTENSION_LIST}</a></p>
+ </div>
+ <!-- ELSEIF PRE -->
+ <div class="errorbox">
+ <p>{L_CONFIRM_MESSAGE}</p>
+ </div>
+
+ <form id="acp_extensions" method="post" action="{U_PURGE}">
+ <fieldset class="submit-buttons">
+ <legend>{L_EXTENSION_DELETE_DATA}</legend>
+ <input class="button1" type="submit" name="delete_data" value="{L_EXTENSION_DELETE_DATA}" />
+ <input class="button2" type="submit" name="cancel" value="{L_CANCEL}" />
+ </fieldset>
+ </form>
+ <!-- ELSEIF S_NEXT_STEP -->
+ <div class="errorbox">
+ <p>{L_EXTENSION_DELETE_DATA_IN_PROGRESS}</p>
+ </div>
+ <!-- ELSE -->
+ <div class="successbox">
+ <p>{L_EXTENSION_DELETE_DATA_SUCCESS}</p>
+ <br />
+ <p><a href="{U_RETURN}">{L_RETURN_TO_EXTENSION_LIST}</a></p>
+ </div>
+ <!-- ENDIF -->
+
+<!-- INCLUDE overall_footer.html -->
diff --git a/phpBB/adm/style/acp_ext_details.html b/phpBB/adm/style/acp_ext_details.html
new file mode 100644
index 0000000000..bd9eca623a
--- /dev/null
+++ b/phpBB/adm/style/acp_ext_details.html
@@ -0,0 +1,141 @@
+<!-- INCLUDE overall_header.html -->
+
+<a id="maincontent"></a>
+
+ <a href="{U_BACK}" style="float: {S_CONTENT_FLOW_END};">&laquo; {L_BACK}</a>
+
+ <h1>{L_EXTENSIONS_ADMIN}</h1>
+
+ <!-- IF S_VERSIONCHECK -->
+ <div class="<!-- IF S_UP_TO_DATE -->successbox<!-- ELSE -->errorbox<!-- ENDIF -->">
+ <p>{UP_TO_DATE_MSG} - <a href="{U_VERSIONCHECK_FORCE}">{L_VERSIONCHECK_FORCE_UPDATE}</a></p>
+ </div>
+ <!-- ELSE IF S_VERSIONCHECK_STATUS == 0 -->
+ <div class="errorbox notice">
+ <p>{L_VERSIONCHECK_FAIL}</p>
+ <p>{VERSIONCHECK_FAIL_REASON}</p>
+ <p><a href="{U_VERSIONCHECK_FORCE}">{L_VERSIONCHECK_FORCE_UPDATE}</a></p>
+ </div>
+ <!-- ELSE IF S_VERSIONCHECK_STATUS == 1 -->
+ <div class="errorbox notice">
+ <p>{VERSIONCHECK_FAIL_REASON}</p>
+ </div>
+ <!-- ENDIF -->
+<!-- EVENT acp_ext_details_notice -->
+
+ <fieldset>
+ <legend>{L_EXT_DETAILS}</legend>
+ <!-- IF META_DISPLAY_NAME -->
+ <dl>
+ <dt><label>{L_DISPLAY_NAME}{L_COLON}</label></dt>
+ <dd><strong id="meta_display_name">{META_DISPLAY_NAME}</strong></dd>
+ </dl>
+ <!-- ENDIF -->
+ <dl>
+ <dt><label>{L_CLEAN_NAME}{L_COLON}</label></dt>
+ <dd><strong id="meta_name">{META_NAME}</strong></dd>
+ </dl>
+ <!-- IF META_DESCRIPTION -->
+ <dl>
+ <dt><label>{L_DESCRIPTION}{L_COLON}</label></dt>
+ <dd><span id="meta_description">{META_DESCRIPTION}</span></dd>
+ </dl>
+ <!-- ENDIF -->
+ <dl>
+ <dt><label>{L_VERSION}{L_COLON}</label></dt>
+ <dd><span id="meta_version">{META_VERSION}</span></dd>
+ </dl>
+ <!-- IF META_HOMEPAGE -->
+ <dl>
+ <dt><label>{L_HOMEPAGE}{L_COLON}</label></dt>
+ <dd><strong id="meta_homepage"><a href="{META_HOMEPAGE}">{META_HOMEPAGE}</a></strong></dd>
+ </dl>
+ <!-- ENDIF -->
+ <!-- IF META_TIME -->
+ <dl>
+ <dt><label>{L_TIME}{L_COLON}</label></dt>
+ <dd><span id="meta_time">{META_TIME}</span></dd>
+ </dl>
+ <!-- ENDIF -->
+ <dl>
+ <dt><label>{L_LICENSE}{L_COLON}</label></dt>
+ <dd><span id="meta_license">{META_LICENSE}</span></dd>
+ </dl>
+ </fieldset>
+
+ <!-- IF S_VERSIONCHECK && not S_UP_TO_DATE -->
+ <fieldset>
+ <legend>{L_LATEST_VERSION}</legend>
+ <!-- BEGIN updates_available -->
+ <fieldset>
+ <dl>
+ <dt><label>{L_VERSION}{L_COLON}</label></dt>
+ <dd><strong>{updates_available.current}</strong></dd>
+ </dl>
+ <!-- IF updates_available.download-->
+ <dl>
+ <dt><label>{L_DOWNLOAD_LATEST}</label></dt>
+ <dd><strong><a href="{updates_available.download}">{L_DOWNLOAD} {META_NAME} {LATEST_VERSION}</a></strong></dd>
+ </dl>
+ <!-- ENDIF -->
+ <!-- IF updates_available.announcement -->
+ <dl>
+ <dt><label>{L_ANNOUNCEMENT_TOPIC}</label></dt>
+ <dd><strong><a href="{updates_available.announcement}">{L_RELEASE_ANNOUNCEMENT}</a></strong></dd>
+ </dl>
+ <!-- ENDIF -->
+ </fieldset>
+ <!-- END updates_available -->
+ </fieldset>
+ <!-- ENDIF -->
+
+ <!-- IF META_REQUIRE_PHPBB || META_REQUIRE_PHP -->
+ <fieldset>
+ <legend>{L_REQUIREMENTS}</legend>
+ <!-- IF META_REQUIRE_PHPBB -->
+ <dl<!-- IF META_REQUIRE_PHPBB_FAIL --> class="requirements_not_met"<!-- ENDIF -->>
+ <dt><label>{L_PHPBB_VERSION}{L_COLON}</label></dt>
+ <dd><span id="require_phpbb">{META_REQUIRE_PHPBB}</span></dd>
+ </dl>
+ <!-- ENDIF -->
+ <!-- IF META_REQUIRE_PHP -->
+ <dl<!-- IF META_REQUIRE_PHP_FAIL --> class="requirements_not_met"<!-- ENDIF -->>
+ <dt><label>{L_PHP_VERSION}{L_COLON}</label></dt>
+ <dd><span id="require_php">{META_REQUIRE_PHP}</span></dd>
+ </dl>
+ <!-- ENDIF -->
+ </fieldset>
+ <!-- ENDIF -->
+
+ <fieldset>
+ <legend>{L_AUTHOR_INFORMATION}</legend>
+ <!-- BEGIN meta_authors -->
+ <fieldset>
+ <dl>
+ <dt><label>{L_AUTHOR_NAME}{L_COLON}</label></dt>
+ <dd><strong>{meta_authors.AUTHOR_NAME}</strong></dd>
+ </dl>
+ <!-- IF meta_authors.AUTHOR_EMAIL -->
+ <dl>
+ <dt><label>{L_AUTHOR_EMAIL}{L_COLON}</label></dt>
+ <dd><strong><a href="mailto:{meta_authors.AUTHOR_EMAIL}">{meta_authors.AUTHOR_EMAIL}</a></strong></dd>
+ </dl>
+ <!-- ENDIF -->
+ <!-- IF meta_authors.AUTHOR_HOMEPAGE -->
+ <dl>
+ <dt><label>{L_AUTHOR_HOMEPAGE}{L_COLON}</label></dt>
+ <dd><strong><a href="{meta_authors.AUTHOR_HOMEPAGE}">{meta_authors.AUTHOR_HOMEPAGE}</a></strong></dd>
+ </dl>
+ <!-- ENDIF -->
+ <!-- IF meta_authors.AUTHOR_ROLE -->
+ <dl>
+ <dt><label>{L_AUTHOR_ROLE}{L_COLON}</label></dt>
+ <dd><strong>{meta_authors.AUTHOR_ROLE}</strong></dd>
+ </dl>
+ <!-- ENDIF -->
+ </fieldset>
+ <!-- END meta_authors -->
+ </fieldset>
+
+ <!-- EVENT acp_ext_details_end -->
+<!-- INCLUDE overall_footer.html -->
diff --git a/phpBB/adm/style/acp_ext_disable.html b/phpBB/adm/style/acp_ext_disable.html
new file mode 100644
index 0000000000..d2b5c46fe8
--- /dev/null
+++ b/phpBB/adm/style/acp_ext_disable.html
@@ -0,0 +1,34 @@
+<!-- INCLUDE overall_header.html -->
+
+ <a id="maincontent"></a>
+
+ <h1>{L_EXTENSIONS_ADMIN}</h1>
+
+ <p>{L_EXTENSIONS_EXPLAIN}</p>
+ <p>{L_EXTENSION_DISABLE_EXPLAIN}</p>
+
+ <!-- IF PRE -->
+ <fieldset>
+ <h2>{L_CONFIRM}</h2>
+ <p>{L_CONFIRM_MESSAGE}</p>
+ </fieldset>
+
+ <form id="acp_extensions" method="post" action="{U_DISABLE}">
+ <fieldset class="submit-buttons">
+ <input class="button1" type="submit" name="disable" value="{L_EXTENSION_DISABLE}" />
+ <input class="button2" type="submit" name="cancel" value="{L_CANCEL}" />
+ </fieldset>
+ </form>
+ <!-- ELSEIF S_NEXT_STEP -->
+ <div class="successbox notice">
+ <p>{L_EXTENSION_DISABLE_IN_PROGRESS}</p>
+ </div>
+ <!-- ELSE -->
+ <div class="successbox">
+ <p>{L_EXTENSION_DISABLE_SUCCESS}</p>
+ <br />
+ <p><a href="{U_RETURN}">{L_RETURN_TO_EXTENSION_LIST}</a></p>
+ </div>
+ <!-- ENDIF -->
+
+<!-- INCLUDE overall_footer.html -->
diff --git a/phpBB/adm/style/acp_ext_enable.html b/phpBB/adm/style/acp_ext_enable.html
new file mode 100644
index 0000000000..8a4a35359e
--- /dev/null
+++ b/phpBB/adm/style/acp_ext_enable.html
@@ -0,0 +1,40 @@
+<!-- INCLUDE overall_header.html -->
+
+ <a id="maincontent"></a>
+
+ <h1>{L_EXTENSIONS_ADMIN}</h1>
+
+ <p>{L_EXTENSIONS_EXPLAIN}</p>
+ <p>{L_EXTENSION_ENABLE_EXPLAIN}</p>
+
+ <!-- IF MIGRATOR_ERROR -->
+ <div class="errorbox">
+ <p><strong>{L_MIGRATION_EXCEPTION_ERROR}</strong></p>
+ <p>{MIGRATOR_ERROR}</p>
+ <p><a href="{U_RETURN}">{L_RETURN_TO_EXTENSION_LIST}</a></p>
+ </div>
+ <!-- ELSEIF PRE -->
+ <fieldset>
+ <h2>{L_CONFIRM}</h2>
+ <p>{L_CONFIRM_MESSAGE}</p>
+ </fieldset>
+
+ <form id="acp_extensions" method="post" action="{U_ENABLE}">
+ <fieldset class="submit-buttons">
+ <input class="button1" type="submit" name="enable" value="{L_EXTENSION_ENABLE}" />
+ <input class="button2" type="submit" name="cancel" value="{L_CANCEL}" />
+ </fieldset>
+ </form>
+ <!-- ELSEIF S_NEXT_STEP -->
+ <div class="successbox notice">
+ <p>{L_EXTENSION_ENABLE_IN_PROGRESS}</p>
+ </div>
+ <!-- ELSE -->
+ <div class="successbox">
+ <p>{L_EXTENSION_ENABLE_SUCCESS}</p>
+ <br />
+ <p><a href="{U_RETURN}">{L_RETURN_TO_EXTENSION_LIST}</a></p>
+ </div>
+ <!-- ENDIF -->
+
+<!-- INCLUDE overall_footer.html -->
diff --git a/phpBB/adm/style/acp_ext_list.html b/phpBB/adm/style/acp_ext_list.html
new file mode 100644
index 0000000000..af9e00a614
--- /dev/null
+++ b/phpBB/adm/style/acp_ext_list.html
@@ -0,0 +1,121 @@
+<!-- INCLUDE overall_header.html -->
+
+<a id="maincontent"></a>
+
+ <h1>{L_EXTENSIONS_ADMIN}</h1>
+
+ <p>{L_EXTENSIONS_EXPLAIN}</p>
+
+ <fieldset class="quick">
+ <span class="small"><a href="https://www.phpbb.com/go/customise/extensions/3.1" target="_blank">{L_BROWSE_EXTENSIONS_DATABASE}</a> &bull; <a href="{U_VERSIONCHECK_FORCE}">{L_VERSIONCHECK_FORCE_UPDATE_ALL}</a> &bull; <a href="javascript:phpbb.toggleDisplay('version_check_settings');">{L_SETTINGS}</a></span>
+ </fieldset>
+
+ <form id="version_check_settings" method="post" action="{U_ACTION}" style="display:none">
+
+ <fieldset>
+ <legend>{L_EXTENSIONS_VERSION_CHECK_SETTINGS}</legend>
+ <dl>
+ <dt><label for="force_unstable">{L_FORCE_UNSTABLE}{L_COLON}</label></dt>
+ <dd>
+ <label><input type="radio" id="force_unstable" name="force_unstable" class="radio" value="1"<!-- IF FORCE_UNSTABLE --> checked="checked"<!-- ENDIF --> /> {L_YES}</label>
+ <label><input type="radio" name="force_unstable" class="radio" value="0"<!-- IF not FORCE_UNSTABLE --> checked="checked"<!-- ENDIF --> /> {L_NO}</label>
+ </dd>
+ </dl>
+
+ <p class="submit-buttons">
+ <input class="button1" type="submit" name="update" value="{L_SUBMIT}" />&nbsp;
+ <input class="button2" type="reset" name="reset" value="{L_RESET}" />
+ <input type="hidden" name="action" value="set_config_version_check_force_unstable" />
+ {S_FORM_TOKEN}
+ </p>
+ </fieldset>
+ </form>
+
+ <table class="table1">
+ <col class="row1" ><col class="row1" ><col class="row2" ><col class="row2" >
+ <thead>
+ <tr>
+ <th>{L_EXTENSION_NAME}</th>
+ <th style="text-align: center; width: 20%;">{L_CURRENT_VERSION}</th>
+ <th style="text-align: center; width: 10%;">{L_EXTENSION_OPTIONS}</th>
+ <th style="text-align: center; width: 25%;">{L_EXTENSION_ACTIONS}</th>
+ </tr>
+ </thead>
+ <tbody>
+ <!-- IF .enabled -->
+ <tr>
+ <td class="row3" colspan="4"><strong>{L_EXTENSIONS_ENABLED}</strong><!-- EVENT acp_ext_list_enabled_title_after --></td>
+ </tr>
+ <!-- BEGIN enabled -->
+ <tr class="ext_enabled row-highlight">
+ <td><strong title="{enabled.NAME}">{enabled.META_DISPLAY_NAME}</strong><!-- EVENT acp_ext_list_enabled_name_after --></td>
+ <td style="text-align: center;">
+ <!-- IF enabled.S_VERSIONCHECK -->
+ <strong <!-- IF enabled.S_UP_TO_DATE -->style="color: #228822;"<!-- ELSE -->style="color: #BC2A4D;"<!-- ENDIF -->>{enabled.META_VERSION}</strong>
+ <!-- ELSE -->
+ {enabled.META_VERSION}
+ <!-- ENDIF -->
+ </td>
+ <td style="text-align: center;"><a href="{enabled.U_DETAILS}">{L_DETAILS}</a></td>
+ <td style="text-align: center;">
+ <!-- BEGIN actions -->
+ <a href="{enabled.actions.U_ACTION}"<!-- IF enabled.actions.L_ACTION_EXPLAIN --> title="{enabled.actions.L_ACTION_EXPLAIN}"<!-- ENDIF -->>{enabled.actions.L_ACTION}</a>
+ <!-- IF not enabled.actions.S_LAST_ROW -->&nbsp;|&nbsp;<!-- ENDIF -->
+ <!-- END actions -->
+ </td>
+ </tr>
+ <!-- END enabled -->
+ <!-- ENDIF -->
+
+ <!-- IF .disabled -->
+ <tr>
+ <td class="row3" colspan="4"><strong>{L_EXTENSIONS_DISABLED}</strong><!-- EVENT acp_ext_list_disabled_title_after --></td>
+ </tr>
+ <!-- BEGIN disabled -->
+ <tr class="ext_disabled row-highlight">
+ <td><strong title="{disabled.NAME}">{disabled.META_DISPLAY_NAME}</strong><!-- EVENT acp_ext_list_disabled_name_after --></td>
+ <td style="text-align: center;">
+ <!-- IF disabled.S_VERSIONCHECK -->
+ <strong <!-- IF disabled.S_UP_TO_DATE -->style="color: #228822;"<!-- ELSE -->style="color: #BC2A4D;"<!-- ENDIF -->>{disabled.META_VERSION}</strong>
+ <!-- ELSE -->
+ {disabled.META_VERSION}
+ <!-- ENDIF -->
+ </td>
+ <td style="text-align: center;">
+ <!-- IF disabled.U_DETAILS --><a href="{disabled.U_DETAILS}">{L_DETAILS}</a><!-- ENDIF -->
+ </td>
+ <td style="text-align: center;">
+ <!-- BEGIN actions -->
+ <a href="{disabled.actions.U_ACTION}"<!-- IF disabled.actions.L_ACTION_EXPLAIN --> title="{disabled.actions.L_ACTION_EXPLAIN}"<!-- ENDIF -->>{disabled.actions.L_ACTION}</a>
+ <!-- IF not disabled.actions.S_LAST_ROW -->&nbsp;|&nbsp;<!-- ENDIF -->
+ <!-- END actions -->
+ </td>
+ </tr>
+ <!-- END disabled -->
+ <!-- ENDIF -->
+ </tbody>
+ </table>
+
+ <table class="table1">
+ <tr>
+ <th>{L_EXTENSION_INSTALL_HEADLINE}</th>
+ </tr>
+ <tr>
+ <td class="row3">{L_EXTENSION_INSTALL_EXPLAIN}</td>
+ </tr>
+ <tr>
+ <th>{L_EXTENSION_UPDATE_HEADLINE}</th>
+ </tr>
+ <tr>
+ <td class="row3">{L_EXTENSION_UPDATE_EXPLAIN}</td>
+ </tr>
+ <tr>
+ <th>{L_EXTENSION_REMOVE_HEADLINE}</th>
+ </tr>
+ <tr>
+ <td class="row3">{L_EXTENSION_REMOVE_EXPLAIN}</td>
+ </tr>
+ </tbody>
+ </table>
+
+<!-- INCLUDE overall_footer.html -->
diff --git a/phpBB/adm/style/acp_forums.html b/phpBB/adm/style/acp_forums.html
index 8577c08860..965438ff67 100644
--- a/phpBB/adm/style/acp_forums.html
+++ b/phpBB/adm/style/acp_forums.html
@@ -1,6 +1,6 @@
<!-- INCLUDE overall_header.html -->
-<a name="maincontent"></a>
+<a id="maincontent"></a>
<!-- IF S_EDIT_FORUM -->
@@ -14,45 +14,45 @@
<!-- IF not S_ADD_ACTION and S_FORUM_ORIG_POST -->
if (value == {FORUM_POST})
{
- dE('type_actions', -1);
+ phpbb.toggleDisplay('type_actions', -1);
}
else
{
- dE('type_actions', 1);
+ phpbb.toggleDisplay('type_actions', 1);
}
<!-- ENDIF -->
<!-- IF not S_ADD_ACTION and S_FORUM_ORIG_CAT and S_HAS_SUBFORUMS -->
if (value == {FORUM_LINK})
{
- dE('cat_to_link_actions', 1);
+ phpbb.toggleDisplay('cat_to_link_actions', 1);
}
else
{
- dE('cat_to_link_actions', -1);
+ phpbb.toggleDisplay('cat_to_link_actions', -1);
}
<!-- ENDIF -->
if (value == {FORUM_POST})
{
- dE('forum_post_options', 1);
- dE('forum_link_options', -1);
- dE('forum_rules_options', 1);
- dE('forum_cat_options', -1);
+ phpbb.toggleDisplay('forum_post_options', 1);
+ phpbb.toggleDisplay('forum_link_options', -1);
+ phpbb.toggleDisplay('forum_rules_options', 1);
+ phpbb.toggleDisplay('forum_cat_options', -1);
}
else if (value == {FORUM_LINK})
{
- dE('forum_post_options', -1);
- dE('forum_link_options', 1);
- dE('forum_rules_options', -1);
- dE('forum_cat_options', -1);
+ phpbb.toggleDisplay('forum_post_options', -1);
+ phpbb.toggleDisplay('forum_link_options', 1);
+ phpbb.toggleDisplay('forum_rules_options', -1);
+ phpbb.toggleDisplay('forum_cat_options', -1);
}
else if (value == {FORUM_CAT})
{
- dE('forum_post_options', -1);
- dE('forum_link_options', -1);
- dE('forum_rules_options', 1);
- dE('forum_cat_options', 1);
+ phpbb.toggleDisplay('forum_post_options', -1);
+ phpbb.toggleDisplay('forum_link_options', -1);
+ phpbb.toggleDisplay('forum_rules_options', 1);
+ phpbb.toggleDisplay('forum_cat_options', 1);
}
}
@@ -64,30 +64,30 @@
{
<!-- IF not S_ADD_ACTION and S_FORUM_ORIG_POST -->
<!-- IF S_FORUM_POST -->
- dE('type_actions', -1);
+ phpbb.toggleDisplay('type_actions', -1);
<!-- ENDIF -->
<!-- ENDIF -->
<!-- IF not S_ADD_ACTION and S_FORUM_ORIG_CAT and S_HAS_SUBFORUMS -->
<!-- IF S_FORUM_CAT -->
- dE('cat_to_link_actions', -1);
+ phpbb.toggleDisplay('cat_to_link_actions', -1);
<!-- ENDIF -->
<!-- ENDIF -->
<!-- IF not S_FORUM_POST -->
- dE('forum_post_options', -1);
+ phpbb.toggleDisplay('forum_post_options', -1);
<!-- ENDIF -->
<!-- IF not S_FORUM_CAT -->
- dE('forum_cat_options', -1);
+ phpbb.toggleDisplay('forum_cat_options', -1);
<!-- ENDIF -->
<!-- IF not S_FORUM_LINK -->
- dE('forum_link_options', -1);
+ phpbb.toggleDisplay('forum_link_options', -1);
<!-- ENDIF -->
<!-- IF S_FORUM_LINK -->
- dE('forum_rules_options', -1);
+ phpbb.toggleDisplay('forum_rules_options', -1);
<!-- ENDIF -->
}
@@ -111,14 +111,15 @@
<fieldset>
<legend>{L_FORUM_SETTINGS}</legend>
+ <!-- EVENT acp_forums_main_settings_prepend -->
<dl>
- <dt><label for="forum_type">{L_FORUM_TYPE}:</label></dt>
+ <dt><label for="forum_type">{L_FORUM_TYPE}{L_COLON}</label></dt>
<dd><select id="forum_type" name="forum_type" onchange="display_options(this.options[this.selectedIndex].value);">{S_FORUM_TYPE_OPTIONS}</select></dd>
</dl>
<!-- IF not S_ADD_ACTION and S_FORUM_ORIG_POST -->
<div id="type_actions">
<dl>
- <dt><label for="type_action">{L_DECIDE_MOVE_DELETE_CONTENT}:</label></dt>
+ <dt><label for="type_action">{L_DECIDE_MOVE_DELETE_CONTENT}{L_COLON}</label></dt>
<dd><label><input type="radio" class="radio" name="type_action" value="delete"<!-- IF not S_MOVE_FORUM_OPTIONS --> checked="checked" id="type_action"<!-- ENDIF --> /> {L_DELETE_ALL_POSTS}</label></dd>
<!-- IF S_MOVE_FORUM_OPTIONS --><dd><label><input type="radio" class="radio" name="type_action" id="type_action" value="move" checked="checked" /> {L_MOVE_POSTS_TO}</label> <select name="to_forum_id">{S_MOVE_FORUM_OPTIONS}</select></dd><!-- ENDIF -->
</dl>
@@ -127,7 +128,7 @@
<!-- IF not S_ADD_ACTION and S_FORUM_ORIG_CAT and S_HAS_SUBFORUMS -->
<div id="cat_to_link_actions">
<dl>
- <dt><label for="action_subforums">{L_DECIDE_MOVE_DELETE_SUBFORUMS}:</label></dt>
+ <dt><label for="action_subforums">{L_DECIDE_MOVE_DELETE_SUBFORUMS}{L_COLON}</label></dt>
<!-- IF S_FORUMS_LIST -->
<dd><label><input type="radio" class="radio" id="action_subforums" name="action_subforums" value="move" checked="checked" /> {L_MOVE_SUBFORUMS_TO}</label> <select name="subforums_to_id">{S_FORUMS_LIST}</select></dd>
<!-- ELSE -->
@@ -137,58 +138,59 @@
</div>
<!-- ENDIF -->
<dl>
- <dt><label for="parent">{L_FORUM_PARENT}:</label></dt>
+ <dt><label for="parent">{L_FORUM_PARENT}{L_COLON}</label></dt>
<dd><select id="parent" name="forum_parent_id"><option value="0"<!-- IF not S_FORUM_PARENT_ID --> selected="selected"<!-- ENDIF -->>{L_NO_PARENT}</option>{S_PARENT_OPTIONS}</select></dd>
</dl>
<!-- IF S_CAN_COPY_PERMISSIONS -->
<dl>
- <dt><label for="forum_perm_from">{L_COPY_PERMISSIONS}:</label><br /><span>{L_COPY_PERMISSIONS_EXPLAIN}</span></dt>
+ <dt><label for="forum_perm_from">{L_COPY_PERMISSIONS}{L_COLON}</label><br /><span>{L_COPY_PERMISSIONS_EXPLAIN}</span></dt>
<dd><select id="forum_perm_from" name="forum_perm_from"><option value="0">{L_NO_PERMISSIONS}</option>{S_FORUM_OPTIONS}</select></dd>
</dl>
<!-- ENDIF -->
<dl>
- <dt><label for="forum_name">{L_FORUM_NAME}:</label></dt>
+ <dt><label for="forum_name">{L_FORUM_NAME}{L_COLON}</label></dt>
<dd><input class="text medium" type="text" id="forum_name" name="forum_name" value="{FORUM_NAME}" maxlength="255" /></dd>
</dl>
<dl>
- <dt><label for="forum_desc">{L_FORUM_DESC}:</label><br /><span>{L_FORUM_DESC_EXPLAIN}</span></dt>
- <dd><textarea id="forum_desc" name="forum_desc" rows="5" cols="45">{FORUM_DESC}</textarea></dd>
+ <dt><label for="forum_desc">{L_FORUM_DESC}{L_COLON}</label><br /><span>{L_FORUM_DESC_EXPLAIN}</span></dt>
+ <dd><textarea id="forum_desc" name="forum_desc" rows="5" cols="45" data-bbcode="true">{FORUM_DESC}</textarea></dd>
<dd><label><input type="checkbox" class="radio" name="desc_parse_bbcode"<!-- IF S_DESC_BBCODE_CHECKED --> checked="checked"<!-- ENDIF --> /> {L_PARSE_BBCODE}</label>
<label><input type="checkbox" class="radio" name="desc_parse_smilies"<!-- IF S_DESC_SMILIES_CHECKED --> checked="checked"<!-- ENDIF --> /> {L_PARSE_SMILIES}</label>
<label><input type="checkbox" class="radio" name="desc_parse_urls"<!-- IF S_DESC_URLS_CHECKED --> checked="checked"<!-- ENDIF --> /> {L_PARSE_URLS}</label></dd>
</dl>
<dl>
- <dt><label for="forum_image">{L_FORUM_IMAGE}:</label><br /><span>{L_FORUM_IMAGE_EXPLAIN}</span></dt>
+ <dt><label for="forum_image">{L_FORUM_IMAGE}{L_COLON}</label><br /><span>{L_FORUM_IMAGE_EXPLAIN}</span></dt>
<dd><input class="text medium" type="text" id="forum_image" name="forum_image" value="{FORUM_IMAGE}" maxlength="255" /></dd>
<!-- IF FORUM_IMAGE_SRC -->
<dd><img src="{FORUM_IMAGE_SRC}" alt="{L_FORUM_IMAGE}" /></dd>
<!-- ENDIF -->
</dl>
<dl>
- <dt><label for="forum_password">{L_FORUM_PASSWORD}:</label><br /><span>{L_FORUM_PASSWORD_EXPLAIN}</span></dt>
+ <dt><label for="forum_password">{L_FORUM_PASSWORD}{L_COLON}</label><br /><span>{L_FORUM_PASSWORD_EXPLAIN}</span></dt>
<dd><input type="password" id="forum_password" name="forum_password" value="<!-- IF S_FORUM_PASSWORD_SET -->&#x20;&#x20;&#x20;&#x20;&#x20;&#x20;<!-- ENDIF -->" autocomplete="off" /></dd>
</dl>
<dl>
- <dt><label for="forum_password_confirm">{L_FORUM_PASSWORD_CONFIRM}:</label><br /><span>{L_FORUM_PASSWORD_CONFIRM_EXPLAIN}</span></dt>
+ <dt><label for="forum_password_confirm">{L_FORUM_PASSWORD_CONFIRM}{L_COLON}</label><br /><span>{L_FORUM_PASSWORD_CONFIRM_EXPLAIN}</span></dt>
<dd><input type="password" id="forum_password_confirm" name="forum_password_confirm" value="<!-- IF S_FORUM_PASSWORD_SET -->&#x20;&#x20;&#x20;&#x20;&#x20;&#x20;<!-- ENDIF -->" autocomplete="off" /></dd>
</dl>
<!-- IF S_FORUM_PASSWORD_SET -->
<dl>
- <dt><label for="forum_password_unset">{L_FORUM_PASSWORD_UNSET}:</label><br /><span>{L_FORUM_PASSWORD_UNSET_EXPLAIN}</span></dt>
+ <dt><label for="forum_password_unset">{L_FORUM_PASSWORD_UNSET}{L_COLON}</label><br /><span>{L_FORUM_PASSWORD_UNSET_EXPLAIN}</span></dt>
<dd><input id="forum_password_unset" name="forum_password_unset" type="checkbox" /></dd>
</dl>
<!-- ENDIF -->
<dl>
- <dt><label for="forum_style">{L_FORUM_STYLE}:</label></dt>
+ <dt><label for="forum_style">{L_FORUM_STYLE}{L_COLON}</label></dt>
<dd><select id="forum_style" name="forum_style"><option value="0">{L_DEFAULT_STYLE}</option>{S_STYLES_OPTIONS}</select></dd>
</dl>
+ <!-- EVENT acp_forums_main_settings_append -->
</fieldset>
<div id="forum_cat_options">
<fieldset>
<legend>{L_GENERAL_FORUM_SETTINGS}</legend>
<dl>
- <dt><label for="display_active">{L_DISPLAY_ACTIVE_TOPICS}:</label><br /><span>{L_DISPLAY_ACTIVE_TOPICS_EXPLAIN}</span></dt>
+ <dt><label for="display_active">{L_DISPLAY_ACTIVE_TOPICS}{L_COLON}</label><br /><span>{L_DISPLAY_ACTIVE_TOPICS_EXPLAIN}</span></dt>
<dd><label><input type="radio" class="radio" name="display_active" value="1"<!-- IF S_ENABLE_ACTIVE_TOPICS --> id="display_active" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
<label><input type="radio" class="radio" name="display_active" value="0"<!-- IF not S_ENABLE_ACTIVE_TOPICS --> id="display_active" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd>
</dl>
@@ -198,85 +200,102 @@
<div id="forum_post_options">
<fieldset>
<legend>{L_GENERAL_FORUM_SETTINGS}</legend>
+ <!-- EVENT acp_forums_normal_settings_prepend -->
<dl>
- <dt><label for="forum_status">{L_FORUM_STATUS}:</label></dt>
+ <dt><label for="forum_status">{L_FORUM_STATUS}{L_COLON}</label></dt>
<dd><select id="forum_status" name="forum_status">{S_STATUS_OPTIONS}</select></dd>
</dl>
<dl>
- <dt><label for="display_subforum_list">{L_LIST_SUBFORUMS}:</label><br /><span>{L_LIST_SUBFORUMS_EXPLAIN}</span></dt>
+ <dt><label for="display_subforum_list">{L_LIST_SUBFORUMS}{L_COLON}</label><br /><span>{L_LIST_SUBFORUMS_EXPLAIN}</span></dt>
<dd><label><input type="radio" class="radio" name="display_subforum_list" value="1"<!-- IF S_DISPLAY_SUBFORUM_LIST --> id="display_subforum_list" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
<label><input type="radio" class="radio" name="display_subforum_list" value="0"<!-- IF not S_DISPLAY_SUBFORUM_LIST --> id="display_subforum_list" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd>
</dl>
<dl>
- <dt><label for="display_on_index">{L_LIST_INDEX}:</label><br /><span>{L_LIST_INDEX_EXPLAIN}</span></dt>
+ <dt><label for="display_on_index">{L_LIST_INDEX}{L_COLON}</label><br /><span>{L_LIST_INDEX_EXPLAIN}</span></dt>
<dd><label><input type="radio" class="radio" name="display_on_index" value="1"<!-- IF S_DISPLAY_ON_INDEX --> id="display_on_index" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
<label><input type="radio" class="radio" name="display_on_index" value="0"<!-- IF not S_DISPLAY_ON_INDEX --> id="display_on_index" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd>
</dl>
<dl>
- <dt><label for="enable_post_review">{L_ENABLE_POST_REVIEW}:</label><br /><span>{L_ENABLE_POST_REVIEW_EXPLAIN}</span></dt>
+ <dt><label for="enable_post_review">{L_ENABLE_POST_REVIEW}{L_COLON}</label><br /><span>{L_ENABLE_POST_REVIEW_EXPLAIN}</span></dt>
<dd><label><input type="radio" class="radio" name="enable_post_review" value="1"<!-- IF S_ENABLE_POST_REVIEW --> id="enable_post_review" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
<label><input type="radio" class="radio" name="enable_post_review" value="0"<!-- IF not S_ENABLE_POST_REVIEW --> id="enable_post_review" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd>
</dl>
<dl>
- <dt><label for="enable_quick_reply">{L_ENABLE_QUICK_REPLY}:</label><br /><span>{L_ENABLE_QUICK_REPLY_EXPLAIN}</span></dt>
+ <dt><label for="enable_quick_reply">{L_ENABLE_QUICK_REPLY}{L_COLON}</label><br /><span>{L_ENABLE_QUICK_REPLY_EXPLAIN}</span></dt>
<dd><label><input type="radio" class="radio" name="enable_quick_reply" value="1"<!-- IF S_ENABLE_QUICK_REPLY --> id="enable_quick_reply" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
<label><input type="radio" class="radio" name="enable_quick_reply" value="0"<!-- IF not S_ENABLE_QUICK_REPLY --> id="enable_quick_reply" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd>
</dl>
<dl>
- <dt><label for="enable_indexing">{L_ENABLE_INDEXING}:</label><br /><span>{L_ENABLE_INDEXING_EXPLAIN}</span></dt>
+ <dt><label for="enable_indexing">{L_ENABLE_INDEXING}{L_COLON}</label><br /><span>{L_ENABLE_INDEXING_EXPLAIN}</span></dt>
<dd><label><input type="radio" class="radio" name="enable_indexing" value="1"<!-- IF S_ENABLE_INDEXING --> id="enable_indexing" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
<label><input type="radio" class="radio" name="enable_indexing" value="0"<!-- IF not S_ENABLE_INDEXING --> id="enable_indexing" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd>
</dl>
<dl>
- <dt><label for="enable_icons">{L_ENABLE_TOPIC_ICONS}:</label></dt>
+ <dt><label for="enable_icons">{L_ENABLE_TOPIC_ICONS}{L_COLON}</label></dt>
<dd><label><input type="radio" class="radio" name="enable_icons" value="1"<!-- IF S_TOPIC_ICONS --> id="enable_icons" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
<label><input type="radio" class="radio" name="enable_icons" value="0"<!-- IF not S_TOPIC_ICONS --> id="enable_icons" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd>
</dl>
<dl>
- <dt><label for="display_recent">{L_ENABLE_RECENT}:</label><br /><span>{L_ENABLE_RECENT_EXPLAIN}</span></dt>
+ <dt><label for="display_recent">{L_ENABLE_RECENT}{L_COLON}</label><br /><span>{L_ENABLE_RECENT_EXPLAIN}</span></dt>
<dd><label><input type="radio" class="radio" name="display_recent" value="1"<!-- IF S_DISPLAY_ACTIVE_TOPICS --> id="display_recent" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
<label><input type="radio" class="radio" name="display_recent" value="0"<!-- IF not S_DISPLAY_ACTIVE_TOPICS --> id="display_recent" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd>
</dl>
<dl>
- <dt><label for="topics_per_page">{L_FORUM_TOPICS_PAGE}:</label><br /><span>{L_FORUM_TOPICS_PAGE_EXPLAIN}</span></dt>
- <dd><input type="text" id="topics_per_page" name="topics_per_page" value="{TOPICS_PER_PAGE}" size="4" maxlength="4" /></dd>
+ <dt><label for="topics_per_page">{L_FORUM_TOPICS_PAGE}{L_COLON}</label><br /><span>{L_FORUM_TOPICS_PAGE_EXPLAIN}</span></dt>
+ <dd><input type="number" id="topics_per_page" name="topics_per_page" value="{TOPICS_PER_PAGE}" min="0" max="9999" /></dd>
</dl>
+ <!-- EVENT acp_forums_normal_settings_append -->
</fieldset>
<fieldset>
<legend>{L_FORUM_PRUNE_SETTINGS}</legend>
+ <!-- EVENT acp_forums_prune_settings_prepend -->
<dl>
- <dt><label for="enable_prune">{L_FORUM_AUTO_PRUNE}:</label><br /><span>{L_FORUM_AUTO_PRUNE_EXPLAIN}</span></dt>
+ <dt><label for="enable_prune">{L_FORUM_AUTO_PRUNE}{L_COLON}</label><br /><span>{L_FORUM_AUTO_PRUNE_EXPLAIN}</span></dt>
<dd><label><input type="radio" class="radio" name="enable_prune" value="1"<!-- IF S_PRUNE_ENABLE --> id="enable_prune" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
<label><input type="radio" class="radio" name="enable_prune" value="0"<!-- IF not S_PRUNE_ENABLE --> id="enable_prune" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd>
</dl>
<dl>
- <dt><label for="prune_freq">{L_AUTO_PRUNE_FREQ}:</label><br /><span>{L_AUTO_PRUNE_FREQ_EXPLAIN}</span></dt>
- <dd><input type="text" id="prune_freq" name="prune_freq" value="{PRUNE_FREQ}" maxlength="4" size="4" /> {L_DAYS}</dd>
+ <dt><label for="prune_freq">{L_AUTO_PRUNE_FREQ}{L_COLON}</label><br /><span>{L_AUTO_PRUNE_FREQ_EXPLAIN}</span></dt>
+ <dd><input type="number" id="prune_freq" name="prune_freq" value="{PRUNE_FREQ}" min="0" max="9999" /> {L_DAYS}</dd>
</dl>
<dl>
- <dt><label for="prune_days">{L_AUTO_PRUNE_DAYS}:</label><br /><span>{L_AUTO_PRUNE_DAYS_EXPLAIN}</span></dt>
- <dd><input type="text" id="prune_days" name="prune_days" value="{PRUNE_DAYS}" maxlength="4" size="4" /> {L_DAYS}</dd>
+ <dt><label for="prune_days">{L_AUTO_PRUNE_DAYS}{L_COLON}</label><br /><span>{L_AUTO_PRUNE_DAYS_EXPLAIN}</span></dt>
+ <dd><input type="number" id="prune_days" name="prune_days" value="{PRUNE_DAYS}" min="0" max="9999" /> {L_DAYS}</dd>
</dl>
<dl>
- <dt><label for="prune_viewed">{L_AUTO_PRUNE_VIEWED}:</label><br /><span>{L_AUTO_PRUNE_VIEWED_EXPLAIN}</span></dt>
- <dd><input type="text" id="prune_viewed" name="prune_viewed" value="{PRUNE_VIEWED}" maxlength="4" size="4" /> {L_DAYS}</dd>
+ <dt><label for="prune_viewed">{L_AUTO_PRUNE_VIEWED}{L_COLON}</label><br /><span>{L_AUTO_PRUNE_VIEWED_EXPLAIN}</span></dt>
+ <dd><input type="number" id="prune_viewed" name="prune_viewed" value="{PRUNE_VIEWED}" min="0" max="9999" /> {L_DAYS}</dd>
</dl>
<dl>
- <dt><label for="prune_old_polls">{L_PRUNE_OLD_POLLS}:</label><br /><span>{L_PRUNE_OLD_POLLS_EXPLAIN}</span></dt>
+ <dt><label for="prune_old_polls">{L_PRUNE_OLD_POLLS}{L_COLON}</label><br /><span>{L_PRUNE_OLD_POLLS_EXPLAIN}</span></dt>
<dd><label><input type="radio" class="radio" name="prune_old_polls" value="1"<!-- IF S_PRUNE_OLD_POLLS --> id="prune_old_polls" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
<label><input type="radio" class="radio" name="prune_old_polls" value="0"<!-- IF not S_PRUNE_OLD_POLLS --> id="prune_old_polls" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd>
</dl>
<dl>
- <dt><label for="prune_announce">{L_PRUNE_ANNOUNCEMENTS}:</label></dt>
+ <dt><label for="prune_announce">{L_PRUNE_ANNOUNCEMENTS}{L_COLON}</label></dt>
<dd><label><input type="radio" class="radio" name="prune_announce" value="1"<!-- IF S_PRUNE_ANNOUNCE --> id="prune_announce" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
<label><input type="radio" class="radio" name="prune_announce" value="0"<!-- IF not S_PRUNE_ANNOUNCE --> id="prune_announce" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd>
</dl>
<dl>
- <dt><label for="prune_sticky">{L_PRUNE_STICKY}:</label></dt>
+ <dt><label for="prune_sticky">{L_PRUNE_STICKY}{L_COLON}</label></dt>
<dd><label><input type="radio" class="radio" name="prune_sticky" value="1"<!-- IF S_PRUNE_STICKY --> id="prune_sticky" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
<label><input type="radio" class="radio" name="prune_sticky" value="0"<!-- IF not S_PRUNE_STICKY --> id="prune_sticky" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd>
</dl>
+ <dl>
+ <dt><label for="enable_shadow_prune">{L_FORUM_PRUNE_SHADOW}{L_COLON}</label><br /><span>{L_FORUM_PRUNE_SHADOW_EXPLAIN}</span></dt>
+ <dd><label><input type="radio" class="radio" name="enable_shadow_prune" value="1"<!-- IF S_PRUNE_SHADOW_ENABLE --> id="enable_shadow_prune" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
+ <label><input type="radio" class="radio" name="enable_shadow_prune" value="0"<!-- IF not S_PRUNE_SHADOW_ENABLE --> id="enable_shadow_prune" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd>
+ </dl>
+ <dl>
+ <dt><label for="prune_shadow_freq">{L_AUTO_PRUNE_SHADOW_FREQ}{L_COLON}</label><br /><span>{L_AUTO_PRUNE_SHADOW_FREQ_EXPLAIN}</span></dt>
+ <dd><input type="number" id="prune_shadow_freq" name="prune_shadow_freq" value="{PRUNE_SHADOW_FREQ}" min="0" max="9999" /> {L_DAYS}</dd>
+ </dl>
+ <dl>
+ <dt><label for="prune_shadow_days">{L_AUTO_PRUNE_SHADOW_DAYS}{L_COLON}</label><br /><span>{L_AUTO_PRUNE_SHADOW_DAYS_EXPLAIN}</span></dt>
+ <dd><input type="number" id="prune_shadow_days" name="prune_shadow_days" value="{PRUNE_SHADOW_DAYS}" min="0" max="9999" /> {L_DAYS}</dd>
+ </dl>
+ <!-- EVENT acp_forums_prune_settings_append -->
</fieldset>
</div>
@@ -284,16 +303,16 @@
<fieldset>
<legend>{L_GENERAL_FORUM_SETTINGS}</legend>
<dl>
- <dt><label for="link_display_on_index">{L_LIST_INDEX}:</label><br /><span>{L_LIST_INDEX_EXPLAIN}</span></dt>
+ <dt><label for="link_display_on_index">{L_LIST_INDEX}{L_COLON}</label><br /><span>{L_LIST_INDEX_EXPLAIN}</span></dt>
<dd><label><input type="radio" class="radio" name="link_display_on_index" value="1"<!-- IF S_DISPLAY_ON_INDEX --> id="link_display_on_index" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
<label><input type="radio" class="radio" name="link_display_on_index" value="0"<!-- IF not S_DISPLAY_ON_INDEX --> id="link_display_on_index" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd>
</dl>
<dl>
- <dt><label for="forum_link">{L_FORUM_LINK}:</label><br /><span>{L_FORUM_LINK_EXPLAIN}</span></dt>
+ <dt><label for="forum_link">{L_FORUM_LINK}{L_COLON}</label><br /><span>{L_FORUM_LINK_EXPLAIN}</span></dt>
<dd><input class="text medium" type="text" id="forum_link" name="forum_link" value="{FORUM_DATA_LINK}" maxlength="255" /></dd>
</dl>
<dl>
- <dt><label for="forum_link_track">{L_FORUM_LINK_TRACK}:</label><br /><span>{L_FORUM_LINK_TRACK_EXPLAIN}</span></dt>
+ <dt><label for="forum_link_track">{L_FORUM_LINK_TRACK}{L_COLON}</label><br /><span>{L_FORUM_LINK_TRACK_EXPLAIN}</span></dt>
<dd><label><input type="radio" class="radio" name="forum_link_track" value="1"<!-- IF S_FORUM_LINK_TRACK --> id="forum_link_track" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
<label><input type="radio" class="radio" name="forum_link_track" value="0"<!-- IF not S_FORUM_LINK_TRACK --> id="forum_link_track" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd>
</dl>
@@ -303,25 +322,29 @@
<div id="forum_rules_options">
<fieldset>
<legend>{L_FORUM_RULES}</legend>
+ <!-- EVENT acp_forums_rules_settings_prepend -->
<dl>
- <dt><label for="forum_rules_link">{L_FORUM_RULES_LINK}:</label><br /><span>{L_FORUM_RULES_LINK_EXPLAIN}</span></dt>
+ <dt><label for="forum_rules_link">{L_FORUM_RULES_LINK}{L_COLON}</label><br /><span>{L_FORUM_RULES_LINK_EXPLAIN}</span></dt>
<dd><input class="text medium" type="text" id="forum_rules_link" name="forum_rules_link" value="{FORUM_RULES_LINK}" maxlength="255" /></dd>
</dl>
<!-- IF FORUM_RULES_PREVIEW -->
<dl>
- <dt><label>{L_FORUM_RULES_PREVIEW}:</label></dt>
+ <dt><label>{L_FORUM_RULES_PREVIEW}{L_COLON}</label></dt>
<dd>{FORUM_RULES_PREVIEW}</dd>
</dl>
<!-- ENDIF -->
<dl>
- <dt><label for="forum_rules">{L_FORUM_RULES}:</label><br /><span>{L_FORUM_RULES_EXPLAIN}</span></dt>
- <dd><textarea id="forum_rules" name="forum_rules" rows="4" cols="70">{FORUM_RULES_PLAIN}</textarea></dd>
+ <dt><label for="forum_rules">{L_FORUM_RULES}{L_COLON}</label><br /><span>{L_FORUM_RULES_EXPLAIN}</span></dt>
+ <dd><textarea id="forum_rules" name="forum_rules" rows="4" cols="70" data-bbcode="true">{FORUM_RULES_PLAIN}</textarea></dd>
<dd><label><input type="checkbox" class="radio" name="rules_parse_bbcode"<!-- IF S_BBCODE_CHECKED --> checked="checked"<!-- ENDIF --> /> {L_PARSE_BBCODE}</label>
<label><input type="checkbox" class="radio" name="rules_parse_smilies"<!-- IF S_SMILIES_CHECKED --> checked="checked"<!-- ENDIF --> /> {L_PARSE_SMILIES}</label>
<label><input type="checkbox" class="radio" name="rules_parse_urls"<!-- IF S_URLS_CHECKED --> checked="checked"<!-- ENDIF --> /> {L_PARSE_URLS}</label></dd>
</dl>
+ <!-- EVENT acp_forums_rules_settings_append -->
</fieldset>
</div>
+
+ <!-- EVENT acp_forums_custom_settings -->
<fieldset class="submit-buttons">
<legend>{L_SUBMIT}</legend>
@@ -351,12 +374,12 @@
<fieldset>
<legend>{L_FORUM_DELETE}</legend>
<dl>
- <dt><label>{L_FORUM_NAME}:</label></dt>
+ <dt><label>{L_FORUM_NAME}{L_COLON}</label></dt>
<dd><strong>{FORUM_NAME}</strong></dd>
</dl>
<!-- IF S_FORUM_POST -->
<dl>
- <dt><label for="delete_action">{L_ACTION}:</label></dt>
+ <dt><label for="delete_action">{L_ACTION}{L_COLON}</label></dt>
<dd><label><input type="radio" class="radio" id="delete_action" name="action_posts" value="delete" checked="checked" /> {L_DELETE_ALL_POSTS}</label></dd>
<!-- IF S_MOVE_FORUM_OPTIONS -->
<dd><label><input type="radio" class="radio" name="action_posts" value="move" /> {L_MOVE_POSTS_TO}</label> <select name="posts_to_id">{S_MOVE_FORUM_OPTIONS}</select></dd>
@@ -365,7 +388,7 @@
<!-- ENDIF -->
<!-- IF S_HAS_SUBFORUMS -->
<dl>
- <dt><label for="sub_delete_action">{L_ACTION}:</label></dt>
+ <dt><label for="sub_delete_action">{L_ACTION}{L_COLON}</label></dt>
<dd><label><input type="radio" class="radio" id="sub_delete_action" name="action_subforums" value="delete" checked="checked" /> {L_DELETE_SUBFORUMS}</label></dd>
<!-- IF S_FORUMS_LIST -->
<dd><label><input type="radio" class="radio" name="action_subforums" value="move" /> {L_MOVE_SUBFORUMS_TO}</label> <select name="subforums_to_id">{S_FORUMS_LIST}</select></dd>
@@ -436,35 +459,26 @@
</div>
<!-- ENDIF -->
- <p><strong>{NAVIGATION}<!-- IF S_NO_FORUMS --> [<a href="{U_EDIT}">{L_EDIT}</a> | <a href="{U_DELETE}">{L_DELETE}</a><!-- IF not S_LINK --> | <a href="{U_SYNC}">{L_RESYNC}</a><!-- ENDIF --->]<!-- ENDIF --></strong></p>
+ <p><strong>{NAVIGATION}<!-- IF S_NO_FORUMS --> [<a href="{U_EDIT}">{L_EDIT}</a> | <a href="{U_DELETE}">{L_DELETE}</a><!-- IF not S_LINK --> | <a href="{U_SYNC}">{L_RESYNC}</a><!-- ENDIF -->]<!-- ENDIF --></strong></p>
<!-- IF .forums -->
- <table cellspacing="1">
+ <table class="table1 forums">
<col class="row1" /><col class="row1" /><col class="row2" />
<tbody>
<!-- BEGIN forums -->
<tr>
- <td style="width: 5%; text-align: center;">{forums.FOLDER_IMAGE}</td>
- <td>
+ <td class="folder">{forums.FOLDER_IMAGE}</td>
+ <td class="forum-desc">
<!-- IF forums.FORUM_IMAGE --><div style="float: {S_CONTENT_FLOW_BEGIN}; margin-right: 5px;">{forums.FORUM_IMAGE}</div><!-- ENDIF -->
<strong><!-- IF forums.S_FORUM_LINK -->{forums.FORUM_NAME}<!-- ELSE --><a href="{forums.U_FORUM}">{forums.FORUM_NAME}</a><!-- ENDIF --></strong>
<!-- IF forums.FORUM_DESCRIPTION --><br /><span>{forums.FORUM_DESCRIPTION}</span><!-- ENDIF -->
- <!-- IF forums.S_FORUM_POST --><br /><br /><span>{L_TOPICS}: <strong>{forums.FORUM_TOPICS}</strong> / {L_POSTS}: <strong>{forums.FORUM_POSTS}</strong></span><!-- ENDIF -->
+ <!-- IF forums.S_FORUM_POST --><br /><br /><span>{L_TOPICS}{L_COLON} <strong>{forums.FORUM_TOPICS}</strong> / {L_POSTS}{L_COLON} <strong>{forums.FORUM_POSTS}</strong></span><!-- ENDIF -->
</td>
- <td style="vertical-align: top; width: 100px; text-align: right; white-space: nowrap;">
- <!-- IF forums.S_FIRST_ROW && not forums.S_LAST_ROW -->
- {ICON_MOVE_UP_DISABLED}
- <a href="{forums.U_MOVE_DOWN}">{ICON_MOVE_DOWN}</a>
- <!-- ELSEIF not forums.S_FIRST_ROW && not forums.S_LAST_ROW -->
- <a href="{forums.U_MOVE_UP}">{ICON_MOVE_UP}</a>
- <a href="{forums.U_MOVE_DOWN}">{ICON_MOVE_DOWN}</a>
- <!-- ELSEIF forums.S_LAST_ROW && not forums.S_FIRST_ROW -->
- <a href="{forums.U_MOVE_UP}">{ICON_MOVE_UP}</a>
- {ICON_MOVE_DOWN_DISABLED}
- <!-- ELSE -->
- {ICON_MOVE_UP_DISABLED}
- {ICON_MOVE_DOWN_DISABLED}
- <!-- ENDIF -->
+ <td class="actions">
+ <span class="up-disabled" style="display:none;">{ICON_MOVE_UP_DISABLED}</span>
+ <span class="up"><a href="{forums.U_MOVE_UP}" data-ajax="row_up">{ICON_MOVE_UP}</a></span>
+ <span class="down-disabled" style="display:none;">{ICON_MOVE_DOWN_DISABLED}</span>
+ <span class="down"><a href="{forums.U_MOVE_DOWN}" data-ajax="row_down">{ICON_MOVE_DOWN}</a></span>
<a href="{forums.U_EDIT}">{ICON_EDIT}</a>
<!-- IF not forums.S_FORUM_LINK -->
<a href="{forums.U_SYNC}" onclick="popup_progress_bar();">{ICON_SYNC}</a>
@@ -482,9 +496,9 @@
<form id="fselect" method="post" action="{U_SEL_ACTION}">
<fieldset class="quick">
- {L_SELECT_FORUM}: <select name="parent_id" onchange="if(this.options[this.selectedIndex].value != -1){ this.form.submit(); }">{FORUM_BOX}</select>
+ {L_SELECT_FORUM}{L_COLON} <select name="parent_id" onchange="if(this.options[this.selectedIndex].value != -1){ this.form.submit(); }">{FORUM_BOX}</select>
- <input class="button2" type="submit" value="{L_GO}" />
+ <!-- EVENT acp_forums_quick_select_button_prepend --><input class="button2" type="submit" value="{L_GO}" /><!-- EVENT acp_forums_quick_select_button_append -->
{S_FORM_TOKEN}
</fieldset>
</form>
diff --git a/phpBB/adm/style/acp_forums_copy_perm.html b/phpBB/adm/style/acp_forums_copy_perm.html
index acec3c1967..1fcf2f62a4 100644
--- a/phpBB/adm/style/acp_forums_copy_perm.html
+++ b/phpBB/adm/style/acp_forums_copy_perm.html
@@ -9,7 +9,7 @@
<fieldset>
<dl>
- <dt><label for="forum_perm_from">{L_COPY_PERMISSIONS}:</label><br /><span>{L_COPY_PERMISSIONS_EXPLAIN}</span></dt>
+ <dt><label for="forum_perm_from">{L_COPY_PERMISSIONS}{L_COLON}</label><br /><span>{L_COPY_PERMISSIONS_EXPLAIN}</span></dt>
<dd><select id="forum_perm_from" name="forum_perm_from"><option value="0">{L_NO_PERMISSIONS}</option>{S_FORUM_OPTIONS}</select></dd>
</dl>
<div style="text-align: center;">{S_FORM_TOKEN}{S_HIDDEN_FIELDS}
diff --git a/phpBB/adm/style/acp_groups.html b/phpBB/adm/style/acp_groups.html
index 07f7d072e8..1412744cc9 100644
--- a/phpBB/adm/style/acp_groups.html
+++ b/phpBB/adm/style/acp_groups.html
@@ -1,6 +1,6 @@
<!-- INCLUDE overall_header.html -->
-<a name="maincontent"></a>
+<a id="maincontent"></a>
<!-- IF S_EDIT -->
@@ -17,16 +17,16 @@
</div>
<!-- ENDIF -->
- <form id="settings" method="post" action="{U_ACTION}"<!-- IF S_CAN_UPLOAD --> enctype="multipart/form-data"<!-- ENDIF -->>
+ <form id="settings" method="post" action="{U_ACTION}" enctype="multipart/form-data">
<fieldset>
<legend>{L_GROUP_DETAILS}</legend>
<dl>
- <dt><label<!-- IF not S_SPECIAL_GROUP --> for="group_name"<!-- ENDIF -->>{L_GROUP_NAME}:</label></dt>
+ <dt><label<!-- IF not S_SPECIAL_GROUP --> for="group_name"<!-- ENDIF -->>{L_GROUP_NAME}{L_COLON}</label></dt>
<dd><!-- IF S_SPECIAL_GROUP --><strong>{GROUP_NAME}</strong><!-- ENDIF --><input name="group_name" type="<!-- IF S_SPECIAL_GROUP -->hidden<!-- ELSE -->text<!-- ENDIF -->" id="group_name" value="{GROUP_INTERNAL_NAME}" /></dd>
</dl>
<dl>
- <dt><label for="group_desc">{L_GROUP_DESC}:</label></dt>
+ <dt><label for="group_desc">{L_GROUP_DESC}{L_COLON}</label></dt>
<dd><textarea id="group_desc" name="group_desc" rows="5" cols="45">{GROUP_DESC}</textarea></dd>
<dd><label><input type="checkbox" class="radio" name="desc_parse_bbcode"<!-- IF S_DESC_BBCODE_CHECKED --> checked="checked"<!-- ENDIF --> /> {L_PARSE_BBCODE}</label>
<label><input type="checkbox" class="radio" name="desc_parse_smilies"<!-- IF S_DESC_SMILIES_CHECKED --> checked="checked"<!-- ENDIF --> /> {L_PARSE_SMILIES}</label>
@@ -34,7 +34,7 @@
</dl>
<!-- IF not S_SPECIAL_GROUP -->
<dl>
- <dt><label for="group_type">{L_GROUP_TYPE}:</label><br /><span>{L_GROUP_TYPE_EXPLAIN}</span></dt>
+ <dt><label for="group_type">{L_GROUP_TYPE}{L_COLON}</label><br /><span>{L_GROUP_TYPE_EXPLAIN}</span></dt>
<dd>
<label><input name="group_type" type="radio" class="radio" id="group_type" value="{GROUP_TYPE_FREE}"{GROUP_FREE} /> {L_GROUP_OPEN}</label>
<label><input name="group_type" type="radio" class="radio" value="{GROUP_TYPE_OPEN}"{GROUP_OPEN} /> {L_GROUP_REQUEST}</label>
@@ -48,7 +48,7 @@
<!-- IF S_ADD_GROUP and S_GROUP_PERM -->
<dl>
- <dt><label for="group_perm_from">{L_COPY_PERMISSIONS}:</label><br /><span>{L_COPY_PERMISSIONS_EXPLAIN}</span></dt>
+ <dt><label for="group_perm_from">{L_COPY_PERMISSIONS}{L_COLON}</label><br /><span>{L_COPY_PERMISSIONS_EXPLAIN}</span></dt>
<dd><select id="group_perm_from" name="group_perm_from"><option value="0">{L_NO_PERMISSIONS}</option>{S_GROUP_OPTIONS}</select></dd>
</dl>
<!-- ENDIF -->
@@ -56,42 +56,53 @@
<fieldset>
<legend>{L_GROUP_OPTIONS_SAVE}</legend>
+ <!-- EVENT acp_group_options_before -->
<!-- IF S_USER_FOUNDER -->
<dl>
- <dt><label for="group_founder_manage">{L_GROUP_FOUNDER_MANAGE}:</label><br /><span>{L_GROUP_FOUNDER_MANAGE_EXPLAIN}</span></dt>
+ <dt><label for="group_founder_manage">{L_GROUP_FOUNDER_MANAGE}{L_COLON}</label><br /><span>{L_GROUP_FOUNDER_MANAGE_EXPLAIN}</span></dt>
<dd><input name="group_founder_manage" type="checkbox" value="1" class="radio" id="group_founder_manage"{GROUP_FOUNDER_MANAGE} /></dd>
</dl>
<!-- ENDIF -->
<dl>
- <dt><label for="group_skip_auth">{L_GROUP_SKIP_AUTH}:</label><br /><span>{L_GROUP_SKIP_AUTH_EXPLAIN}</span></dt>
+ <dt><label for="group_skip_auth">{L_GROUP_SKIP_AUTH}{L_COLON}</label><br /><span>{L_GROUP_SKIP_AUTH_EXPLAIN}</span></dt>
<dd><input name="group_skip_auth" type="checkbox" value="1" class="radio" id="group_skip_auth"{GROUP_SKIP_AUTH} /></dd>
</dl>
<dl>
- <dt><label for="group_legend">{L_GROUP_LEGEND}:</label></dt>
+ <dt><label for="group_legend">{L_GROUP_LEGEND}{L_COLON}</label></dt>
<dd><input name="group_legend" type="checkbox" value="1" class="radio" id="group_legend"{GROUP_LEGEND} /></dd>
</dl>
<dl>
- <dt><label for="group_receive_pm">{L_GROUP_RECEIVE_PM}:</label><br /><span>{L_GROUP_RECEIVE_PM_EXPLAIN}</span></dt>
+ <dt><label for="group_teampage">{L_GROUP_TEAMPAGE}{L_COLON}</label></dt>
+ <dd><input name="group_teampage" type="checkbox" value="1" class="radio" id="group_teampage"{GROUP_TEAMPAGE} /></dd>
+ </dl>
+ <dl>
+ <dt><label for="group_receive_pm">{L_GROUP_RECEIVE_PM}{L_COLON}</label><br /><span>{L_GROUP_RECEIVE_PM_EXPLAIN}</span></dt>
<dd><input name="group_receive_pm" type="checkbox" value="1" class="radio" id="group_receive_pm"{GROUP_RECEIVE_PM} /></dd>
</dl>
+ <!-- EVENT acp_group_options_after -->
</fieldset>
<fieldset>
<legend>{L_GROUP_SETTINGS_SAVE}</legend>
<dl>
- <dt><label for="group_message_limit">{L_GROUP_MESSAGE_LIMIT}:</label><br /><span>{L_GROUP_MESSAGE_LIMIT_EXPLAIN}</span></dt>
- <dd><input name="group_message_limit" type="text" id="group_message_limit" maxlength="4" size="4" value="{GROUP_MESSAGE_LIMIT}" /></dd>
+ <dt><label for="group_message_limit">{L_GROUP_MESSAGE_LIMIT}{L_COLON}</label><br /><span>{L_GROUP_MESSAGE_LIMIT_EXPLAIN}</span></dt>
+ <dd><input name="group_message_limit" type="number" id="group_message_limit" min="0" max="9999" value="{GROUP_MESSAGE_LIMIT}" /></dd>
</dl>
<dl>
- <dt><label for="group_max_recipients">{L_GROUP_MAX_RECIPIENTS}:</label><br /><span>{L_GROUP_MAX_RECIPIENTS_EXPLAIN}</span></dt>
- <dd><input name="group_max_recipients" type="text" id="group_max_recipients" maxlength="10" size="4" value="{GROUP_MAX_RECIPIENTS}" /></dd>
+ <dt><label for="group_max_recipients">{L_GROUP_MAX_RECIPIENTS}{L_COLON}</label><br /><span>{L_GROUP_MAX_RECIPIENTS_EXPLAIN}</span></dt>
+ <dd><input name="group_max_recipients" type="number" id="group_max_recipients" min="0" max="9999" value="{GROUP_MAX_RECIPIENTS}" /></dd>
</dl>
<dl>
- <dt><label for="group_colour">{L_GROUP_COLOR}:</label><br /><span>{L_GROUP_COLOR_EXPLAIN}</span></dt>
- <dd><input name="group_colour" type="text" id="group_colour" value="{GROUP_COLOUR}" size="6" maxlength="6" /><!-- IF GROUP_COLOUR -->&nbsp;<span style="background-color: #{GROUP_COLOUR}">&nbsp; &nbsp;</span><!-- ENDIF -->&nbsp;&nbsp;<span>[ <a href="{U_SWATCH}" onclick="popup(this.href, 636, 150, '_swatch'); return false">{L_COLOUR_SWATCH}</a> ]</span></dd>
+ <dt><label for="group_colour">{L_GROUP_COLOR}{L_COLON}</label><br /><span>{L_GROUP_COLOR_EXPLAIN}</span></dt>
+ <dd>
+ <input name="group_colour" type="text" id="group_colour" value="{GROUP_COLOUR}" size="6" maxlength="6" />
+ <!-- IF GROUP_COLOUR -->&nbsp;<span style="background-color: #{GROUP_COLOUR}">&nbsp; &nbsp;</span><!-- ENDIF -->&nbsp;&nbsp;<span>
+ [ <a href="#" id="color_palette_toggle">{L_COLOUR_SWATCH}</a> ]</span>
+ <div id="color_palette_placeholder" style="display: none;" data-orientation="h" data-height="12" data-width="15" data-target="#group_colour"></div>
+ </dd>
</dl>
<dl>
- <dt><label for="group_rank">{L_GROUP_RANK}:</label></dt>
+ <dt><label for="group_rank">{L_GROUP_RANK}{L_COLON}</label></dt>
<dd><select name="group_rank" id="group_rank">{S_RANK_OPTIONS}</select></dd>
</dl>
</fieldset>
@@ -99,67 +110,26 @@
<fieldset>
<legend>{L_GROUP_AVATAR}</legend>
<dl>
- <dt><label>{L_CURRENT_IMAGE}:</label><br /><span>{L_AVATAR_EXPLAIN}</span></dt>
- <dd>{AVATAR_IMAGE}</dd>
- <dd><label><input type="checkbox" class="radio" name="delete" /> {L_DELETE_AVATAR}</label></dd>
+ <dt><label>{L_CURRENT_IMAGE}{L_COLON}</label><br /><span>{L_AVATAR_EXPLAIN}</span></dt>
+ <dd>{AVATAR}</dd>
+ <dd><label for="avatar_delete"><input type="checkbox" name="avatar_delete" id="avatar_delete" /> {L_DELETE_AVATAR}</label></dd>
</dl>
- <!-- IF not S_IN_AVATAR_GALLERY -->
- <!-- IF S_CAN_UPLOAD -->
- <dl>
- <dt><label for="uploadfile">{L_UPLOAD_AVATAR_FILE}:</label></dt>
- <dd><input type="file" id="uploadfile" name="uploadfile" /></dd>
- </dl>
- <dl>
- <dt><label for="uploadurl">{L_UPLOAD_AVATAR_URL}:</label><br /><span>{L_UPLOAD_AVATAR_URL_EXPLAIN}</span></dt>
- <dd><input name="uploadurl" type="text" id="uploadurl" value="" /></dd>
- </dl>
- <!-- ENDIF -->
- <dl>
- <dt><label for="remotelink">{L_LINK_REMOTE_AVATAR}:</label><br /><span>{L_LINK_REMOTE_AVATAR_EXPLAIN}</span></dt>
- <dd><input name="remotelink" type="text" id="remotelink" value="" /></dd>
- </dl>
- <dl>
- <dt><label for="width">{L_LINK_REMOTE_SIZE}:</label><br /><span>{L_LINK_REMOTE_SIZE_EXPLAIN}</span></dt>
- <dd><input name="width" type="text" id="width" size="3" value="{AVATAR_WIDTH}" /> <span>{L_PIXEL} &times; </span> <input type="text" name="height" size="3" value="{AVATAR_HEIGHT}" /> <span>{L_PIXEL}</span></dd>
- </dl>
- <!-- IF S_DISPLAY_GALLERY -->
- <dl>
- <dt><label>{L_AVATAR_GALLERY}:</label></dt>
- <dd><input class="button2" type="submit" name="display_gallery" value="{L_DISPLAY_GALLERY}" /></dd>
- </dl>
- <!-- ENDIF -->
- <!-- ELSE -->
- </fieldset>
-
- <fieldset>
- <legend>{L_AVATAR_GALLERY}</legend>
- <dl>
- <dt><label for="category">{L_AVATAR_CATEGORY}:</label></dt>
- <dd><select name="category" id="category">{S_CAT_OPTIONS}</select>&nbsp;<input class="button2" type="submit" value="{L_GO}" name="display_gallery" /></dd>
- </dl>
- <dl>
- <table cellspacing="1">
- <!-- BEGIN avatar_row -->
- <tr>
- <!-- BEGIN avatar_column -->
- <td class="row1" style="text-align: center;"><img src="{avatar_row.avatar_column.AVATAR_IMAGE}" alt="{avatar_row.avatar_column.AVATAR_NAME}" title="{avatar_row.avatar_column.AVATAR_NAME}" /></td>
- <!-- END avatar_column -->
- </tr>
- <tr>
- <!-- BEGIN avatar_option_column -->
- <td class="row2" style="text-align: center;"><input type="radio" class="radio" name="avatar_select" value="{avatar_row.avatar_option_column.S_OPTIONS_AVATAR}" /></td>
- <!-- END avatar_option_column -->
- </tr>
- <!-- END avatar_row -->
- </table>
- </dl>
- </fieldset>
-
- <fieldset class="quick" style="margin-top: -15px;">
- <input class="button2" type="submit" name="cancel" value="{L_CANCEL}" />
- </fieldset>
-
- <!-- ENDIF -->
+ <dl>
+ <dt><label>{L_AVATAR_TYPE}{L_COLON}</label></dt>
+ <dd><select name="avatar_driver" id="avatar_driver" data-togglable-settings="true">
+ <!-- BEGIN avatar_drivers -->
+ <option value="{avatar_drivers.DRIVER}"<!-- IF avatar_drivers.SELECTED --> selected="selected"<!-- ENDIF --> data-toggle-setting="#avatar_option_{avatar_drivers.DRIVER}">{avatar_drivers.L_TITLE}</option>
+ <!-- END avatar_drivers -->
+ </select></dd>
+ </dl>
+ <div id="avatar_options">
+ <!-- BEGIN avatar_drivers -->
+ <div id="avatar_option_{avatar_drivers.DRIVER}">
+ <p>{avatar_drivers.L_EXPLAIN}</p>
+ {avatar_drivers.OUTPUT}
+ </div>
+ <!-- END avatar_drivers -->
+ </div>
</fieldset>
<fieldset class="submit-buttons">
@@ -184,7 +154,7 @@
<a href="{U_DEFAULT_ALL}">&raquo; {L_MAKE_DEFAULT_FOR_ALL}</a>
</fieldset>
- <table cellspacing="1">
+ <table class="table1 zebra-table">
<thead>
<tr>
<th>{L_USERNAME}</th>
@@ -199,7 +169,7 @@
<td class="row3" colspan="5"><strong>{L_GROUP_LEAD}</strong></td>
</tr>
<!-- BEGIN leader -->
- <!-- IF leader.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
+ <tr>
<td><!-- IF leader.USERNAME_COLOUR --><a href="{leader.U_USER_EDIT}" style="color: #{leader.USERNAME_COLOUR};" class="username-coloured">{leader.USERNAME}</a><!-- ELSE --><a href="{leader.U_USER_EDIT}">{leader.USERNAME}</a><!-- ENDIF --></td>
<td style="text-align: center;"><!-- IF leader.S_GROUP_DEFAULT -->{L_YES}<!-- ELSE -->{L_NO}<!-- ENDIF --></td>
<td style="text-align: center;">{leader.JOINED}</td>
@@ -208,7 +178,7 @@
</tr>
<!-- BEGINELSE -->
<tr>
- <td class="row1" colspan="5" style="text-align: center;">{L_GROUPS_NO_MODS}</td>
+ <td colspan="5" style="text-align: center;">{L_GROUPS_NO_MODS}</td>
</tr>
<!-- END leader -->
<tr>
@@ -220,7 +190,7 @@
<td class="row3" colspan="5"><strong>{L_GROUP_PENDING}</strong></td>
</tr>
<!-- ELSE -->
- <!-- IF member.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
+ <tr>
<td><!-- IF member.USERNAME_COLOUR --><a href="{member.U_USER_EDIT}" style="color: #{member.USERNAME_COLOUR};" class="username-coloured">{member.USERNAME}</a><!-- ELSE --><a href="{member.U_USER_EDIT}">{member.USERNAME}</a><!-- ENDIF --></td>
<td style="text-align: center;"><!-- IF member.S_GROUP_DEFAULT -->{L_YES}<!-- ELSE -->{L_NO}<!-- ENDIF --></td>
<td style="text-align: center;">{member.JOINED}</td>
@@ -230,16 +200,16 @@
<!-- ENDIF -->
<!-- BEGINELSE -->
<tr>
- <td class="row1" colspan="5" style="text-align: center;">{L_GROUPS_NO_MEMBERS}</td>
+ <td colspan="5" style="text-align: center;">{L_GROUPS_NO_MEMBERS}</td>
</tr>
<!-- END member -->
</tbody>
</table>
- <!-- IF PAGINATION -->
<div class="pagination">
- <a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{S_ON_PAGE}</a> &bull; <span>{PAGINATION}</span>
- </div>
+ <!-- IF .pagination -->
+ <!-- INCLUDE pagination.html -->
<!-- ENDIF -->
+ </div>
<fieldset class="quick">
<select name="action"><option class="sep" value="">{L_SELECT_OPTION}</option>{S_ACTION_OPTIONS}</select>
@@ -254,19 +224,19 @@
<fieldset>
<legend>{L_ADD_USERS}</legend>
<dl>
- <dt><label for="leader">{L_USER_GROUP_LEADER}:</label></dt>
+ <dt><label for="leader">{L_USER_GROUP_LEADER}{L_COLON}</label></dt>
<dd><label><input name="leader" type="radio" class="radio" value="1" /> {L_YES}</label>
<label><input name="leader" type="radio" class="radio" id="leader" value="0" checked="checked" /> {L_NO}</label></dd>
</dl>
<dl>
- <dt><label for="default">{L_USER_GROUP_DEFAULT}:</label><br /><span>{L_USER_GROUP_DEFAULT_EXPLAIN}</span></dt>
+ <dt><label for="default">{L_USER_GROUP_DEFAULT}{L_COLON}</label><br /><span>{L_USER_GROUP_DEFAULT_EXPLAIN}</span></dt>
<dd><label><input name="default" type="radio" class="radio" value="1" /> {L_YES}</label>
<label><input name="default" type="radio" class="radio" id="default" value="0" checked="checked" /> {L_NO}</label></dd>
</dl>
<dl>
- <dt><label for="usernames">{L_USERNAME}:</label><br /><span>{L_USERNAMES_EXPLAIN}</span></dt>
+ <dt><label for="usernames">{L_USERNAME}{L_COLON}</label><br /><span>{L_USERNAMES_EXPLAIN}</span></dt>
<dd><textarea id="usernames" name="usernames" cols="40" rows="5"></textarea></dd>
- <dd>[ <a href="{U_FIND_USERNAME}" onclick="find_username(this.href); return false;">{L_FIND_USERNAME}</a> ]</dd>
+ <dd><!-- EVENT acp_groups_find_username_prepend -->[ <a href="{U_FIND_USERNAME}" onclick="find_username(this.href); return false;">{L_FIND_USERNAME}</a> ]<!-- EVENT acp_groups_find_username_append --></dd>
</dl>
<p class="quick">
@@ -295,7 +265,8 @@
<form id="acp_groups" method="post" action="{U_ACTION}">
- <table cellspacing="1">
+ <!-- EVENT acp_groups_manage_before -->
+ <table class="table1">
<col class="col1" /><col class="col1" /><col class="col2" /><col class="col2" /><col class="col2" />
<thead>
<tr>
@@ -315,10 +286,11 @@
<!-- ENDIF -->
</tbody>
</table>
+ <!-- EVENT acp_groups_manage_after -->
<fieldset class="quick">
<!-- IF S_GROUP_ADD -->
- {L_CREATE_GROUP}: <input type="text" name="group_name" value="" /> <input class="button2" type="submit" name="submit" value="{L_SUBMIT}" />
+ {L_CREATE_GROUP}{L_COLON} <input type="text" name="group_name" value="" /> <input class="button2" type="submit" name="submit" value="{L_SUBMIT}" />
<input type="hidden" name="add" value="1" />
<!-- ENDIF -->
{S_FORM_TOKEN}
@@ -329,7 +301,7 @@
<p>{L_SPECIAL_GROUPS_EXPLAIN}</p>
- <table cellspacing="1">
+ <table class="table1">
<col class="col1" /><col class="col1" /><col class="col2" /><col class="col2" /><col class="col2" />
<thead>
<tr>
@@ -346,7 +318,7 @@
<td style="text-align: center;">{groups.TOTAL_MEMBERS}</td>
<td style="text-align: center;"><a href="{groups.U_EDIT}">{L_SETTINGS}</a></td>
<td style="text-align: center;"><a href="{groups.U_LIST}">{L_MEMBERS}</a></td>
- <td style="text-align: center;"><!-- IF not groups.S_GROUP_SPECIAL and groups.U_DELETE --><a href="{groups.U_DELETE}">{L_DELETE}</a><!-- ELSE -->{L_DELETE}<!-- ENDIF --></td>
+ <td style="text-align: center;"><!-- IF not groups.S_GROUP_SPECIAL and groups.U_DELETE --><a href="{groups.U_DELETE}" data-ajax="row_delete">{L_DELETE}</a><!-- ELSE -->{L_DELETE}<!-- ENDIF --></td>
</tr>
<!-- ENDIF -->
<!-- END groups -->
diff --git a/phpBB/adm/style/acp_groups_position.html b/phpBB/adm/style/acp_groups_position.html
new file mode 100644
index 0000000000..20ed9521f0
--- /dev/null
+++ b/phpBB/adm/style/acp_groups_position.html
@@ -0,0 +1,175 @@
+<!-- INCLUDE overall_header.html -->
+
+<a id="maincontent"></a>
+
+ <h1>{L_MANAGE_LEGEND}</h1>
+
+ <form id="legend_settings" method="post" action="{U_ACTION}"<!-- IF S_CAN_UPLOAD --> enctype="multipart/form-data"<!-- ENDIF -->>
+
+ <fieldset>
+ <legend>{L_LEGEND_SETTINGS}</legend>
+ <dl>
+ <dt><label for="legend_sort_groupname">{L_LEGEND_SORT_GROUPNAME}{L_COLON}</label><br /><span>{L_LEGEND_SORT_GROUPNAME_EXPLAIN}</span></dt>
+ <dd>
+ <label><input type="radio" name="legend_sort_groupname" class="radio" value="1"<!-- IF LEGEND_SORT_GROUPNAME --> checked="checked"<!-- ENDIF --> /> {L_YES}</label>
+ <label><input type="radio" name="legend_sort_groupname" class="radio" value="0"<!-- IF not LEGEND_SORT_GROUPNAME --> checked="checked"<!-- ENDIF --> /> {L_NO}</label>
+ </dd>
+ </dl>
+
+ <p class="submit-buttons">
+ <input class="button1" type="submit" name="update" value="{L_SUBMIT}" />&nbsp;
+ <input class="button2" type="reset" name="reset" value="{L_RESET}" />
+ <input type="hidden" name="action" value="set_config_legend" />
+ {S_FORM_TOKEN}
+ </p>
+ </fieldset>
+ </form>
+
+ <p>{L_LEGEND_EXPLAIN}</p>
+
+ <table class="table1">
+ <col class="col1" /><col class="col2" /><col class="col2" />
+ <thead>
+ <tr>
+ <th style="width: 50%">{L_GROUP}</th>
+ <th>{L_GROUP_TYPE}</th>
+ <th>{L_ACTION}</th>
+ </tr>
+ </thead>
+ <tbody>
+ <!-- BEGIN legend -->
+ <tr>
+ <td><strong<!-- IF legend.GROUP_COLOUR --> style="color: {legend.GROUP_COLOUR}"<!-- ENDIF -->>{legend.GROUP_NAME}</strong></td>
+ <td style="text-align: center;">{legend.GROUP_TYPE}</td>
+ <td class="actions">
+ <span class="up-disabled" style="display: none;">{ICON_MOVE_UP_DISABLED}</span>
+ <span class="up"><a href="{legend.U_MOVE_UP}" data-ajax="row_up">{ICON_MOVE_UP}</a></span>
+ <span class="down-disabled" style="display:none;">{ICON_MOVE_DOWN_DISABLED}</span>
+ <span class="down"><a href="{legend.U_MOVE_DOWN}" data-ajax="row_down">{ICON_MOVE_DOWN}</a></span>
+ <a href="{legend.U_DELETE}">{ICON_DELETE}</a>
+ </td>
+ </tr>
+ <!-- BEGINELSE -->
+ <tr>
+ <td colspan="3" class="row3">{L_NO_GROUPS_ADDED}</td>
+ </tr>
+ <!-- END legend -->
+ </tbody>
+ </table>
+
+ <form id="legend_add_group" method="post" action="{U_ACTION_LEGEND}">
+ <fieldset class="quick">
+ <select name="g">
+ <option value="0">{L_SELECT_GROUP}</option>
+ <!-- BEGIN add_legend -->
+ <option<!-- IF add_legend.GROUP_SPECIAL --> class="sep"<!-- ENDIF --> value="{add_legend.GROUP_ID}">{add_legend.GROUP_NAME}</option>
+ <!-- END add_legend -->
+ </select>
+ <!-- EVENT acp_groups_position_legend_add_button_before -->
+ <input class="button2" type="submit" name="submit" value="{L_ADD}" />
+ <input type="hidden" name="action" value="add" />
+ <!-- EVENT acp_groups_position_legend_add_button_after -->
+ {S_FORM_TOKEN}
+ </fieldset>
+ </form>
+
+ <h1>{L_MANAGE_TEAMPAGE}</h1>
+
+ <form id="teampage_settings" method="post" action="{U_ACTION}"<!-- IF S_CAN_UPLOAD --> enctype="multipart/form-data"<!-- ENDIF -->>
+
+ <fieldset>
+ <legend>{L_TEAMPAGE_SETTINGS}</legend>
+ <dl>
+ <dt><label for="teampage_memberships">{L_TEAMPAGE_MEMBERSHIPS}{L_COLON}</label></dt>
+ <dd>
+ <label><input type="radio" name="teampage_memberships" class="radio" value="0"<!-- IF DISPLAY_MEMBERSHIPS == 0 --> checked="checked"<!-- ENDIF --> /> {L_TEAMPAGE_DISP_FIRST}</label><br />
+ <label><input type="radio" name="teampage_memberships" class="radio" value="1"<!-- IF DISPLAY_MEMBERSHIPS == 1 --> checked="checked"<!-- ENDIF --> /> {L_TEAMPAGE_DISP_DEFAULT}</label><br />
+ <label><input type="radio" name="teampage_memberships" class="radio" value="2"<!-- IF DISPLAY_MEMBERSHIPS == 2 --> checked="checked"<!-- ENDIF --> /> {L_TEAMPAGE_DISP_ALL}</label>
+ </dd>
+ </dl>
+ <dl>
+ <dt><label for="teampage_forums">{L_TEAMPAGE_FORUMS}{L_COLON}</label><br /><span>{L_TEAMPAGE_FORUMS_EXPLAIN}</span></dt>
+ <dd>
+ <label><input type="radio" name="teampage_forums" class="radio" value="1"<!-- IF DISPLAY_FORUMS --> checked="checked"<!-- ENDIF --> /> {L_YES}</label>
+ <label><input type="radio" name="teampage_forums" class="radio" value="0"<!-- IF not DISPLAY_FORUMS --> checked="checked"<!-- ENDIF --> /> {L_NO}</label>
+ </dd>
+ </dl>
+
+ <p class="submit-buttons">
+ <input class="button1" type="submit" name="update" value="{L_SUBMIT}" />&nbsp;
+ <input class="button2" type="reset" name="reset" value="{L_RESET}" />
+ <input type="hidden" name="action" value="set_config_teampage" />
+ {S_FORM_TOKEN}
+ </p>
+ </fieldset>
+ </form>
+
+ <p>{L_TEAMPAGE_EXPLAIN}</p>
+
+ <!-- IF S_TEAMPAGE_CATEGORY and CURRENT_CATEGORY_NAME --><p><strong><a href="{U_ACTION}">{L_TEAMPAGE}</a> &raquo; {CURRENT_CATEGORY_NAME}</strong></p><!-- ENDIF -->
+
+ <table class="table1">
+ <col class="col1" /><col class="col2" /><col class="col2" />
+ <thead>
+ <tr>
+ <th style="width: 50%">{L_GROUP}</th>
+ <th>{L_GROUP_TYPE}</th>
+ <th>{L_ACTION}</th>
+ </tr>
+ </thead>
+ <tbody>
+ <!-- BEGIN teampage -->
+ <tr>
+ <td>
+ <!-- IF teampage.U_CATEGORY -->
+ <a href="{teampage.U_CATEGORY}">{teampage.GROUP_NAME}</a>
+ <!-- ELSE -->
+ <strong<!-- IF teampage.GROUP_COLOUR --> style="color: {teampage.GROUP_COLOUR}"<!-- ENDIF -->>{teampage.GROUP_NAME}</strong>
+ <!-- ENDIF -->
+ </td>
+ <td style="text-align: center;"><!-- IF teampage.GROUP_TYPE -->{teampage.GROUP_TYPE}<!-- ELSE -->-<!-- ENDIF -->
+ </td></td>
+ <td class="actions">
+ <span class="up-disabled" style="display: none;">{ICON_MOVE_UP_DISABLED}</span>
+ <span class="up"><a href="{teampage.U_MOVE_UP}" data-ajax="row_up">{ICON_MOVE_UP}</a></span>
+ <span class="down-disabled" style="display:none;">{ICON_MOVE_DOWN_DISABLED}</span>
+ <span class="down"><a href="{teampage.U_MOVE_DOWN}" data-ajax="row_down">{ICON_MOVE_DOWN}</a></span>
+ <a href="{teampage.U_DELETE}">{ICON_DELETE}</a>
+ </td>
+ </tr>
+ <!-- BEGINELSE -->
+ <tr>
+ <td colspan="3" class="row3">{L_NO_GROUPS_ADDED}</td>
+ </tr>
+ <!-- END teampage -->
+ </tbody>
+ </table>
+
+ <!-- IF not S_TEAMPAGE_CATEGORY -->
+ <form id="teampage_add_category" method="post" action="{U_ACTION_TEAMPAGE}">
+ <fieldset class="quick">
+ <input class="inputbox autowidth" type="text" maxlength="255" name="category_name" placeholder="{L_GROUP_CATEGORY_NAME}" />
+ <input class="button2" type="submit" name="submit" value="{L_ADD_GROUP_CATEGORY}" />
+ <input type="hidden" name="action" value="add_category" />
+ {S_FORM_TOKEN}
+ </fieldset>
+ </form>
+ <!-- ENDIF -->
+
+ <form id="teampage_add_group" method="post" action="{U_ACTION_TEAMPAGE}">
+ <fieldset class="quick">
+ <select name="g">
+ <option value="0">{L_SELECT_GROUP}</option>
+ <!-- BEGIN add_teampage -->
+ <option<!-- IF add_teampage.GROUP_SPECIAL --> class="sep"<!-- ENDIF --> value="{add_teampage.GROUP_ID}">{add_teampage.GROUP_NAME}</option>
+ <!-- END add_teampage -->
+ </select>
+ <!-- EVENT acp_groups_position_teampage_add_button_before -->
+ <input class="button2" type="submit" name="submit" value="{L_ADD}" />
+ <input type="hidden" name="action" value="add" />
+ <!-- EVENT acp_groups_position_teampage_add_button_after -->
+ {S_FORM_TOKEN}
+ </fieldset>
+ </form>
+
+<!-- INCLUDE overall_footer.html -->
diff --git a/phpBB/adm/style/acp_icons.html b/phpBB/adm/style/acp_icons.html
index a34a91043c..e0d2840bb5 100644
--- a/phpBB/adm/style/acp_icons.html
+++ b/phpBB/adm/style/acp_icons.html
@@ -1,13 +1,13 @@
<!-- INCLUDE overall_header.html -->
-<a name="maincontent"></a>
+<a id="maincontent"></a>
<!-- IF S_EDIT -->
<script type="text/javascript" defer="defer">
// <![CDATA[
<!-- IF S_ADD_CODE -->
-
+
var smiley = Array();
<!-- BEGIN smile -->
smiley['{smile.SMILEY_URL}'] = Array();
@@ -22,7 +22,7 @@
{
var use_element = smiley[newimage];
- document.getElementById('add_image_src').src = '{PHPBB_ROOT_PATH}{IMG_PATH}/' + encodeURI(newimage);
+ document.getElementById('add_image_src').src = '{ROOT_PATH}{IMG_PATH}/' + encodeURI(newimage);
document.getElementById('add_code').value = use_element['code'];
document.getElementById('add_emotion').value = use_element['emotion'];
document.getElementById('add_width').value = use_element['width'];
@@ -37,10 +37,10 @@
}
}
}
-
+
<!-- ENDIF -->
-
+
function toggle_select(icon, display, select)
{
var disp = document.getElementById('order_disp_' + select);
@@ -74,7 +74,7 @@
<fieldset class="tabulated">
<legend>{L_TITLE}</legend>
- <table cellspacing="1" id="smilies">
+ <table class="table1 zebra-table" id="smilies">
<thead>
<tr>
<th colspan="{COLSPAN}">{L_CONFIG}</th>
@@ -100,16 +100,16 @@
</thead>
<tbody>
<!-- BEGIN items -->
- <!-- IF items.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
-
+ <tr>
+
<td style="text-align: center;"><img src="{items.IMG_SRC}" alt="" title="" /><input type="hidden" name="image[{items.IMG}]" value="1" /></td>
<td style="vertical-align: top;">[{items.IMG}]</td>
<!-- IF S_SMILIES -->
<td><input class="text post" type="text" name="code[{items.IMG}]" value="{items.CODE}" size="10" maxlength="50" /></td>
<td><input class="text post" type="text" name="emotion[{items.IMG}]" value="{items.EMOTION}" size="10" maxlength="50" /></td>
<!-- ENDIF -->
- <td><input class="text post" type="text" size="3" name="width[{items.IMG}]" value="{items.WIDTH}" /></td>
- <td><input class="text post" type="text" size="3" name="height[{items.IMG}]" value="{items.HEIGHT}" /></td>
+ <td><input class="text post" type="number" min="0" max="999" name="width[{items.IMG}]" value="{items.WIDTH}" /></td>
+ <td><input class="text post" type="number" min="0" max="999" name="height[{items.IMG}]" value="{items.HEIGHT}" /></td>
<td>
<input type="checkbox" class="radio" name="display_on_posting[{items.IMG}]"{items.POSTING_CHECKED} onclick="toggle_select('{items.A_IMG}', this.checked, '{items.S_ROW_COUNT}');"/>
<!-- IF items.S_ID -->
@@ -121,7 +121,7 @@
<optgroup id="order_disp_{items.S_ROW_COUNT}" label="{L_DISPLAY_POSTING}" <!-- IF not items.POSTING_CHECKED -->disabled="disabled" class="disabled-options" <!-- ENDIF -->>{S_ORDER_LIST_DISPLAY}</optgroup>
<optgroup id="order_no_disp_{items.S_ROW_COUNT}" label="{L_DISPLAY_POSTING_NO}" <!-- IF items.POSTING_CHECKED -->disabled="disabled" class="disabled-options" <!-- ENDIF -->>{S_ORDER_LIST_UNDISPLAY}</optgroup>
</select></td>
- <!-- ENDIF -->
+ <!-- ENDIF -->
<!-- IF S_ADD -->
<td><input type="checkbox" class="radio" name="add_img[{items.IMG}]" value="1" /></td>
<!-- ENDIF -->
@@ -136,8 +136,8 @@
<td style="vertical-align: top;"><img src="{IMG_SRC}" id="add_image_src" alt="" title="" /></td>
<td><input class="text post" type="text" name="add_code" id="add_code" value="{CODE}" size="10" maxlength="50" /></td>
<td><input class="text post" type="text" name="add_emotion" id="add_emotion" value="{EMOTION}" size="10" maxlength="50" /></td>
- <td><input class="text post" type="text" size="3" name="add_width" id="add_width" value="{WIDTH}" /></td>
- <td><input class="text post" type="text" size="3" name="add_height" id="add_height" value="{HEIGHT}" /></td>
+ <td><input class="text post" type="number" min="0" max="999" name="add_width" id="add_width" value="{WIDTH}" /></td>
+ <td><input class="text post" type="number" min="0" max="999" name="add_height" id="add_height" value="{HEIGHT}" /></td>
<td><input type="checkbox" class="radio" name="add_display_on_posting" checked="checked" onclick="toggle_select('add', this.checked, 'add_order');"/></td>
<td><select id="order_add_order" name="add_order">
<optgroup id="order_disp_add_order" label="{L_DISPLAY_POSTING}">{S_ADD_ORDER_LIST_DISPLAY}</optgroup>
@@ -147,6 +147,8 @@
</tr>
<!-- ENDIF -->
<!-- ELSE -->
+ </thead>
+ <tbody>
<tr class="row3">
<td colspan="{COLSPAN}">{L_NO_ICONS}</td>
</tr>
@@ -174,7 +176,7 @@
<fieldset>
<legend>{L_IMPORT}</legend>
-
+
<!-- IF not S_PAK_OPTIONS -->
<p>{L_NO_PAK_OPTIONS}</p>
@@ -218,7 +220,7 @@
<legend>{L_TITLE}</legend>
- <table cellspacing="1">
+ <table class="table1 zebra-table">
<thead>
<tr>
<th>{L_TITLE}</th>
@@ -236,16 +238,18 @@
<td class="row3" colspan="{COLSPAN}" style="text-align: center;">{L_NOT_DISPLAYED}</td>
</tr>
<!-- ENDIF -->
- <!-- IF items.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
+ <tr>
<td style="width: 85%; text-align: center;"><img src="{items.IMG_SRC}" width="{items.WIDTH}" height="{items.HEIGHT}" alt="{items.ALT_TEXT}" title="{items.ALT_TEXT}" /></td>
<!-- IF S_SMILIES -->
<td style="text-align: center;">{items.CODE}</td>
<td style="text-align: center;">{items.EMOTION}</td>
<!-- ENDIF -->
- <td style="text-align: right; white-space: nowrap;">
- <!-- IF items.S_FIRST_ROW and not PREVIOUS_PAGE -->{ICON_MOVE_UP_DISABLED}<!-- ELSE --><a href="{items.U_MOVE_UP}">{ICON_MOVE_UP}</a><!-- ENDIF -->&nbsp;
- <!-- IF items.S_LAST_ROW and not NEXT_PAGE -->{ICON_MOVE_DOWN_DISABLED}<!-- ELSE --><a href="{items.U_MOVE_DOWN}">{ICON_MOVE_DOWN}</a><!-- ENDIF -->
- &nbsp;<a href="{items.U_EDIT}">{ICON_EDIT}</a> <a href="{items.U_DELETE}">{ICON_DELETE}</a>
+ <td class="actions" style="text-align: right;">
+ <span class="up-disabled" style="display:none;">{ICON_MOVE_UP_DISABLED}</span>
+ <span class="up"><a href="{items.U_MOVE_UP}" data-ajax="row_up">{ICON_MOVE_UP}</a></span>
+ <span class="down-disabled" style="display:none;">{ICON_MOVE_DOWN_DISABLED}</span>
+ <span class="down"><a href="{items.U_MOVE_DOWN}" data-ajax="row_down">{ICON_MOVE_DOWN}</a></span>
+ <a href="{items.U_EDIT}">{ICON_EDIT}</a> <a href="{items.U_DELETE}" data-ajax="row_delete">{ICON_DELETE}</a>
</td>
</tr>
<!-- BEGINELSE -->
@@ -255,7 +259,11 @@
<!-- END items -->
</tbody>
</table>
- <div>{PAGINATION}</div>
+ <div class="pagination">
+ <!-- IF .pagination -->
+ <!-- INCLUDE pagination.html -->
+ <!-- ENDIF -->
+ </div>
<p class="quick">
<input class="button2" name="add" type="submit" value="{L_ICON_ADD}" />&nbsp; &nbsp;<input class="button2" type="submit" name="edit" value="{L_ICON_EDIT}" />
</p>
diff --git a/phpBB/adm/style/acp_inactive.html b/phpBB/adm/style/acp_inactive.html
index b8e46a6e53..2e17bea47d 100644
--- a/phpBB/adm/style/acp_inactive.html
+++ b/phpBB/adm/style/acp_inactive.html
@@ -1,25 +1,24 @@
<!-- INCLUDE overall_header.html -->
-<a name="maincontent"></a>
+<a id="maincontent"></a>
-<h2>{L_INACTIVE_USERS}</h2>
+<h1>{L_INACTIVE_USERS}</h1>
<p>{L_INACTIVE_USERS_EXPLAIN}</p>
<form id="inactive" method="post" action="{U_ACTION}">
-<div class="clearfix"></div>
-
-<!-- IF PAGINATION -->
+<!-- IF .pagination -->
<div class="pagination">
- <a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{S_ON_PAGE}</a> &bull; <span>{PAGINATION}</span>
+ <!-- INCLUDE pagination.html -->
</div>
<!-- ENDIF -->
-<table cellspacing="1">
+<table class="table1 zebra-table">
<thead>
<tr>
<th>{L_USERNAME}</th>
+ <th>{L_EMAIL}</th>
<th>{L_JOINED}</th>
<th>{L_INACTIVE_DATE}</th>
<th>{L_LAST_VISIT}</th>
@@ -29,12 +28,12 @@
</thead>
<tbody>
<!-- BEGIN inactive -->
- <!-- IF inactive.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
-
+ <tr>
<td style="vertical-align: top;">
{inactive.USERNAME_FULL}
- <!-- IF inactive.POSTS --><br />{L_POSTS}: <strong>{inactive.POSTS}</strong> [<a href="{inactive.U_SEARCH_USER}">{L_SEARCH_USER_POSTS}</a>]<!-- ENDIF -->
+ <!-- IF inactive.POSTS --><br />{L_POSTS}{L_COLON} <strong>{inactive.POSTS}</strong> [<a href="{inactive.U_SEARCH_USER}">{L_SEARCH_USER_POSTS}</a>]<!-- ENDIF -->
</td>
+ <td style="vertical-align: top;">{inactive.USER_EMAIL}</td>
<td style="vertical-align: top;">{inactive.JOINED}</td>
<td style="vertical-align: top;">{inactive.INACTIVE_DATE}</td>
<td style="vertical-align: top;">{inactive.LAST_VISIT}</td>
@@ -53,15 +52,15 @@
</table>
<fieldset class="display-options">
- {L_DISPLAY_LOG}: &nbsp;{S_LIMIT_DAYS}&nbsp;{L_SORT_BY}: {S_SORT_KEY} {S_SORT_DIR}<!-- IF PAGINATION -->&nbsp;{L_USERS_PER_PAGE}: <input class="inputbox autowidth" type="text" name="users_per_page" id="users_per_page" size="3" value="{USERS_PER_PAGE}" /><!-- ENDIF -->
+ {L_DISPLAY_LOG}{L_COLON} &nbsp;{S_LIMIT_DAYS}&nbsp;{L_SORT_BY}{L_COLON} {S_SORT_KEY} {S_SORT_DIR}<!-- IF .pagination -->&nbsp;{L_USERS_PER_PAGE}{L_COLON} <input class="inputbox autowidth" type="number" name="users_per_page" id="users_per_page" min="0" max="999" value="{USERS_PER_PAGE}" /><!-- ENDIF -->
<input class="button2" type="submit" value="{L_GO}" name="sort" />
</fieldset>
<hr />
-<!-- IF PAGINATION -->
+<!-- IF .pagination -->
<div class="pagination">
- <a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{S_ON_PAGE}</a> &bull; <span>{PAGINATION}</span>
+ <!-- INCLUDE pagination.html -->
</div>
<!-- ENDIF -->
@@ -74,4 +73,4 @@
</form>
-<!-- INCLUDE overall_footer.html --> \ No newline at end of file
+<!-- INCLUDE overall_footer.html -->
diff --git a/phpBB/adm/style/acp_jabber.html b/phpBB/adm/style/acp_jabber.html
index 0c4512ba98..e76c9a0323 100644
--- a/phpBB/adm/style/acp_jabber.html
+++ b/phpBB/adm/style/acp_jabber.html
@@ -1,6 +1,6 @@
<!-- INCLUDE overall_header.html -->
-<a name="maincontent"></a>
+<a id="maincontent"></a>
<h1>{L_ACP_JABBER_SETTINGS}</h1>
@@ -21,36 +21,51 @@
<p>{L_JAB_GTALK_NOTE}</p>
<!-- ENDIF -->
<dl>
- <dt><label for="jab_enable">{L_JAB_ENABLE}:</label><br /><span>{L_JAB_ENABLE_EXPLAIN}</span></dt>
+ <dt><label for="jab_enable">{L_JAB_ENABLE}{L_COLON}</label><br /><span>{L_JAB_ENABLE_EXPLAIN}</span></dt>
<dd><label><input type="radio" class="radio" id="jab_enable" name="jab_enable" value="1"<!-- IF JAB_ENABLE --> checked="checked"<!-- ENDIF --> /> {L_ENABLED}</label>
<label><input type="radio" class="radio" name="jab_enable" value="0"<!-- IF not JAB_ENABLE --> checked="checked"<!-- ENDIF --> /> {L_DISABLED}</label></dd>
</dl>
<dl>
- <dt><label for="jab_host">{L_JAB_SERVER}:</label><br /><span>{L_JAB_SERVER_EXPLAIN}</span></dt>
+ <dt><label for="jab_host">{L_JAB_SERVER}{L_COLON}</label><br /><span>{L_JAB_SERVER_EXPLAIN}</span></dt>
<dd><input type="text" id="jab_host" name="jab_host" value="{JAB_HOST}" /></dd>
</dl>
<dl>
- <dt><label for="jab_port">{L_JAB_PORT}:</label><br /><span>{L_JAB_PORT_EXPLAIN}</span></dt>
- <dd><input type="text" id="jab_port" name="jab_port" value="{JAB_PORT}" maxlength="5" size="5" /></dd>
+ <dt><label for="jab_port">{L_JAB_PORT}{L_COLON}</label><br /><span>{L_JAB_PORT_EXPLAIN}</span></dt>
+ <dd><input type="number" id="jab_port" name="jab_port" value="{JAB_PORT}" min="0" max="99999" /></dd>
</dl>
<dl>
- <dt><label for="jab_username">{L_JAB_USERNAME}:</label><br /><span>{L_JAB_USERNAME_EXPLAIN}</span></dt>
+ <dt><label for="jab_username">{L_JAB_USERNAME}{L_COLON}</label><br /><span>{L_JAB_USERNAME_EXPLAIN}</span></dt>
<dd><input type="text" id="jab_username" name="jab_username" value="{JAB_USERNAME}" /></dd>
</dl>
<dl>
- <dt><label for="jab_password">{L_JAB_PASSWORD}:</label><br /><span>{L_JAB_PASSWORD_EXPLAIN}</span></dt>
- <dd><input type="password" id="jab_password" name="jab_password" value="{JAB_PASSWORD}" /></dd>
+ <dt><label for="jab_password">{L_JAB_PASSWORD}{L_COLON}</label><br /><span>{L_JAB_PASSWORD_EXPLAIN}</span></dt>
+ <dd><input type="password" id="jab_password" name="jab_password" value="{JAB_PASSWORD}" autocomplete="off" /></dd>
</dl>
<!-- IF S_CAN_USE_SSL -->
<dl>
- <dt><label for="jab_use_ssl">{L_JAB_USE_SSL}:</label><br /><span>{L_JAB_USE_SSL_EXPLAIN}</span></dt>
+ <dt><label for="jab_use_ssl">{L_JAB_USE_SSL}{L_COLON}</label><br /><span>{L_JAB_USE_SSL_EXPLAIN}</span></dt>
<dd><label><input type="radio" class="radio" id="jab_use_ssl" name="jab_use_ssl" value="1"<!-- IF JAB_USE_SSL --> checked="checked"<!-- ENDIF --> /> {L_YES}</label>
<label><input type="radio" class="radio" name="jab_use_ssl" value="0"<!-- IF not JAB_USE_SSL --> checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd>
</dl>
+<dl>
+ <dt><label for="jab_verify_peer">{L_JAB_VERIFY_PEER}{L_COLON}</label><br /><span>{L_JAB_VERIFY_PEER_EXPLAIN}</span></dt>
+ <dd><label><input type="radio" class="radio" id="jab_verify_peer" name="jab_verify_peer" value="1"<!-- IF JAB_VERIFY_PEER --> checked="checked"<!-- ENDIF --> /> {L_YES}</label>
+ <label><input type="radio" class="radio" name="jab_verify_peer" value="0"<!-- IF not JAB_VERIFY_PEER --> checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd>
+</dl>
+<dl>
+ <dt><label for="jab_verify_peer_name">{L_JAB_VERIFY_PEER_NAME}{L_COLON}</label><br /><span>{L_JAB_VERIFY_PEER_NAME_EXPLAIN}</span></dt>
+ <dd><label><input type="radio" class="radio" id="jab_verify_peer_name" name="jab_verify_peer_name" value="1"<!-- IF JAB_VERIFY_PEER_NAME --> checked="checked"<!-- ENDIF --> /> {L_YES}</label>
+ <label><input type="radio" class="radio" name="jab_verify_peer_name" value="0"<!-- IF not JAB_VERIFY_PEER_NAME --> checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd>
+</dl>
+<dl>
+ <dt><label for="jab_allow_self_signed">{L_JAB_ALLOW_SELF_SIGNED}{L_COLON}</label><br /><span>{L_JAB_ALLOW_SELF_SIGNED_EXPLAIN}</span></dt>
+ <dd><label><input type="radio" class="radio" id="jab_allow_self_signed" name="jab_allow_self_signed" value="1"<!-- IF JAB_ALLOW_SELF_SIGNED --> checked="checked"<!-- ENDIF --> /> {L_YES}</label>
+ <label><input type="radio" class="radio" name="jab_allow_self_signed" value="0"<!-- IF not JAB_ALLOW_SELF_SIGNED --> checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd>
+</dl>
<!-- ENDIF -->
<dl>
- <dt><label for="jab_package_size">{L_JAB_PACKAGE_SIZE}:</label><br /><span>{L_JAB_PACKAGE_SIZE_EXPLAIN}</span></dt>
- <dd><input type="text" id="jab_package_size" name="jab_package_size" value="{JAB_PACKAGE_SIZE}" maxlength="5" size="5" /></dd>
+ <dt><label for="jab_package_size">{L_JAB_PACKAGE_SIZE}{L_COLON}</label><br /><span>{L_JAB_PACKAGE_SIZE_EXPLAIN}</span></dt>
+ <dd><input type="number" id="jab_package_size" name="jab_package_size" value="{JAB_PACKAGE_SIZE}" min="0" max="99999" /></dd>
</dl>
</fieldset>
diff --git a/phpBB/adm/style/acp_language.html b/phpBB/adm/style/acp_language.html
index 95ac1d5852..f708eb1508 100644
--- a/phpBB/adm/style/acp_language.html
+++ b/phpBB/adm/style/acp_language.html
@@ -1,30 +1,8 @@
<!-- INCLUDE overall_header.html -->
-<a name="maincontent"></a>
+<a id="maincontent"></a>
-<!-- IF S_SELECT_METHOD -->
-
- <a href="{U_BACK}" style="float: {S_CONTENT_FLOW_END};">&laquo; {L_BACK}</a>
-
- <h1>{L_SELECT_DOWNLOAD_FORMAT}</h1>
-
- <form id="selectmethod" method="post" action="{U_ACTION}">
-
- <fieldset>
- <legend>{L_DOWNLOAD_AS}</legend>
- <dl>
- <dt><label for="use_method">{L_DOWNLOAD_AS}:</label></dt>
- <dd>{RADIO_BUTTONS}</dd>
- </dl>
-
- <p class="quick">
- <input type="submit" class="button2" value="{L_DOWNLOAD}" name="download" />
- </p>
- </fieldset>
-
- </form>
-
-<!-- ELSEIF S_DETAILS -->
+<!-- IF S_DETAILS -->
<a href="{U_BACK}" style="float: {S_CONTENT_FLOW_END};">&laquo; {L_BACK}</a>
@@ -35,19 +13,19 @@
<fieldset>
<legend>{LANG_LOCAL_NAME}</legend>
<dl>
- <dt><label for="lang_english_name">{L_LANG_ENGLISH_NAME}:</label></dt>
+ <dt><label for="lang_english_name">{L_LANG_ENGLISH_NAME}{L_COLON}</label></dt>
<dd><input type="text" id="lang_english_name" name="lang_english_name" value="{LANG_ENGLISH_NAME}" maxlength="100" /></dd>
</dl>
<dl>
- <dt><label for="lang_local_name">{L_LANG_LOCAL_NAME}:</label></dt>
+ <dt><label for="lang_local_name">{L_LANG_LOCAL_NAME}{L_COLON}</label></dt>
<dd><input type="text" id="lang_local_name" name="lang_local_name" value="{LANG_LOCAL_NAME}" maxlength="255" /></dd>
</dl>
<dl>
- <dt><label>{L_LANG_ISO_CODE}:</label></dt>
+ <dt><label>{L_LANG_ISO_CODE}{L_COLON}</label></dt>
<dd><strong>{LANG_ISO}</strong></dd>
</dl>
<dl>
- <dt><label for="lang_author">{L_LANG_AUTHOR}:</label></dt>
+ <dt><label for="lang_author">{L_LANG_AUTHOR}{L_COLON}</label></dt>
<dd><input type="text" id="lang_author" name="lang_author" value="{LANG_AUTHOR}" maxlength="255" /></dd>
</dl>
@@ -58,160 +36,43 @@
</fieldset>
</form>
- <br /><br />
-
- <!-- IF S_MISSING_FILES -->
- <div class="errorbox">
- <h3>{L_MISSING_FILES}</h3>
- <p>{MISSING_FILES}</p>
- </div>
- <br /><br />
- <!-- ENDIF -->
-
- <!-- IF S_MISSING_VARS -->
- <h1>{L_MISSING_LANG_VARIABLES}</h1>
-
- <p>{L_MISSING_VARS_EXPLAIN}</p>
-
- <form id="missing" method="post" action="{U_MISSING_ACTION}">
-
- <table cellspacing="1">
- <thead>
- <tr>
- <th>{L_LANGUAGE_KEY}</th>
- <th>{L_LANGUAGE_VARIABLE}</th>
- </tr>
- </thead>
- <tbody>
- <!-- BEGIN missing -->
- <tr class="row4">
- <td><strong>{missing.FILE}</strong></td>
- <td style="text-align: right;"><input type="submit" name="missing_file[{missing.KEY}]" value="{L_SELECT}" class="button2" /></td>
- </tr>
- {missing.TPL}
- <!-- END missing -->
- </tbody>
- </table>
- <div>{S_FORM_TOKEN}</div>
- </form>
-
- <br /><br />
- <!-- ENDIF -->
-
- <a name="entries"></a>
-
- <h1>{L_LANGUAGE_ENTRIES}</h1>
+ <!-- IF .missing_files -->
+ <h3 class="error">{L_MISSING_FILES}</h3>
- <p>{L_LANGUAGE_ENTRIES_EXPLAIN}</p>
-
- <form id="lang_entries" method="post" action="{U_ENTRY_ACTION}">
-
- <!-- IF S_FROM_STORE -->
- <fieldset class="quick" style="float: {S_CONTENT_FLOW_BEGIN};">
- <input type="submit" name="remove_store" value="{L_REMOVE_FROM_STORAGE_FOLDER}" class="button2" />
+ <fieldset>
+ <legend>{L_MISSING_LANG_FILES}</legend>
+ <!-- BEGIN missing_files -->
+ &raquo; {missing_files.FILE_NAME}<br />
+ <!-- END missing_files -->
</fieldset>
<!-- ENDIF -->
- <fieldset class="quick" style="float: {S_CONTENT_FLOW_END};">
- <select name="language_file">{S_LANG_OPTIONS}</select>&nbsp;<input type="submit" class="button2" name="change" value="{L_SELECT}" />
- </fieldset>
-
- <p>&nbsp;<br />&nbsp;</p>
-
-
- <!--[if lt IE 8]>
- <style type="text/css">
- /* <![CDATA[ */
- input.langvalue, textarea.langvalue {
- width: 450px;
- }
- /* ]]> */
- </style>
- <![endif]-->
-
- <table cellspacing="1">
- <thead>
- <!-- IF S_EMAIL_FILE -->
- <tr>
- <th colspan="2">{L_FILE_CONTENTS}</th>
- </tr>
- <!-- ELSE -->
- <tr>
- <th>{L_LANGUAGE_KEY}</th>
- <th>{L_LANGUAGE_VARIABLE}</th>
- </tr>
- <!-- ENDIF -->
- <tr>
- <td rowspan="2" class="row3"><strong>{PRINT_MESSAGE}<!-- IF S_FROM_STORE --><br /><span style="color: red;">{L_FILE_FROM_STORAGE}</span><!-- ENDIF --></strong></td>
- <td class="row3" style="text-align: right;"><input type="submit" name="download_file" class="button2" value="{L_SUBMIT_AND_DOWNLOAD}" />&nbsp;&nbsp;<input type="submit" name="submit_file" class="button2" value="{L_SUBMIT}" /></td>
- </tr>
- <tr>
- <td class="row3" style="text-align: right;">
- <!-- IF ALLOW_UPLOAD -->&nbsp;&nbsp;{L_UPLOAD_METHOD}:&nbsp;<!-- BEGIN buttons--><input type="radio" class="radio"<!-- IF buttons.S_FIRST_ROW --> id="method" checked="checked"<!-- ENDIF --> value="{buttons.VALUE}" name="method" />&nbsp;{buttons.VALUE}&nbsp;<!-- END buttons --><input type="submit" name="upload_file" class="button2" value="{L_SUBMIT_AND_UPLOAD}" /><!-- ENDIF --></td>
- </tr>
- </thead>
- <tbody>
- <!-- IF S_EMAIL_FILE -->
- <tr>
- <td class="row2" colspan="2" style="text-align: center;"><textarea name="entry" id="entry" cols="80" rows="20">{LANG}</textarea></td>
- </tr>
- <!-- ELSE -->
- {TPL}
- <!-- ENDIF -->
- <tr>
- <td class="row3" colspan="3" style="text-align: right;">{S_FORM_TOKEN}<input type="submit" name="download_file" class="button2" value="{L_SUBMIT_AND_DOWNLOAD}" />&nbsp;&nbsp;<input type="submit" name="submit_file" class="button2" value="{L_SUBMIT}" /></td>
- </tr>
- </tbody>
- </table>
- </form>
-
-<!-- ELSEIF S_UPLOAD -->
-
- <a href="{U_BACK}" style="float: {S_CONTENT_FLOW_END};">&laquo; {L_BACK}</a>
-
- <h1>{L_UPLOAD_SETTINGS}</h1>
-
- <form id="upload" method="post" action="{U_ACTION}">
-
- <!-- IF S_CONNECTION_SUCCESS -->
- <div class="successbox">
- <p>{L_CONNECTION_SUCCESS}</p>
- </div>
- <!-- ELSEIF S_CONNECTION_FAILED -->
- <div class="errorbox">
- <p>{L_CONNECTION_FAILED}</p>
- </div>
+ <!-- IF .missing_varfile -->
+ <h3 class="error">{L_MISSING_VARS_EXPLAIN}</h3>
+
+ <fieldset>
+ <legend>{L_MISSING_LANG_VARIABLES}</legend>
+ <!-- BEGIN missing_varfile -->
+ <dl>
+ <dt><label>{missing_varfile.FILE_NAME}</label></dt>
+ <!-- BEGIN variable -->
+ <dd>{missing_varfile.variable.VAR_NAME}</dd>
+ <!-- END variable -->
+ </dl>
+ <!-- END missing_varfile -->
+ </fieldset>
<!-- ENDIF -->
-
- <fieldset>
- <legend>{L_UPLOAD_SETTINGS}</legend>
- <dl>
- <dt><label>{L_UPLOAD_METHOD}:</label></dt>
- <dd><strong>{NAME}</strong></dd>
- </dl>
- <!-- BEGIN data -->
- <dl>
- <dt><label for="{data.DATA}">{data.NAME}:</label><br /><span>{data.EXPLAIN}</span></dt>
- <dd><input type="<!-- IF data.DATA == 'password' -->password<!-- ELSE -->text<!-- ENDIF -->" id="{data.DATA}" name="{data.DATA}" value="{data.DEFAULT}" /></dd>
- </dl>
- <!-- END data -->
- </fieldset>
-
- <fieldset class="quick">
- {HIDDEN}
- {S_FORM_TOKEN}
- <input class="button1" type="submit" name="update" value="{L_SUBMIT}" />
- <input class="button1" type="submit" name="test_connection" value="{L_TEST_CONNECTION}" />
- </fieldset>
- </form>
-
<!-- ELSE -->
<h1>{L_ACP_LANGUAGE_PACKS}</h1>
<p>{L_ACP_LANGUAGE_PACKS_EXPLAIN}</p>
- <table cellspacing="1">
+ <fieldset class="quick">
+ <span class="small"><a href="https://www.phpbb.com/go/customise/language-packs/3.1" target="_blank">{L_BROWSE_LANGUAGE_PACKS_DATABASE}</a></span>
+ </fieldset>
+
+ <table class="table1 zebra-table">
<thead>
<tr>
<th>{L_LANGUAGE_PACK_NAME}</th>
@@ -226,12 +87,12 @@
<td class="row3" colspan="5"><strong>{L_INSTALLED_LANGUAGE_PACKS}</strong></td>
</tr>
<!-- BEGIN lang -->
- <!-- IF lang.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
+ <tr>
<td><a href="{lang.U_DETAILS}">{lang.ENGLISH_NAME}</a> {lang.TAG}</td>
<td>{lang.LOCAL_NAME}</td>
<td style="text-align: center;"><strong>{lang.ISO}</strong></td>
<td style="text-align: center;">{lang.USED_BY}</td>
- <td style="text-align: center;">&nbsp;<a href="{lang.U_DOWNLOAD}">{L_DOWNLOAD}</a>&nbsp;|&nbsp;<a href="{lang.U_DELETE}">{L_DELETE}</a></td>
+ <td style="text-align: center;"><a href="{lang.U_DELETE}">{L_DELETE}</a></td>
</tr>
<!-- END lang -->
<!-- IF .notinst -->
@@ -240,7 +101,7 @@
</tr>
<!-- ENDIF -->
<!-- BEGIN notinst -->
- <!-- IF notinst.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
+ <tr>
<td>{notinst.NAME}</td>
<td>{notinst.LOCAL_NAME}</td>
<td style="text-align: center;"><strong>{notinst.ISO}</strong></td>
diff --git a/phpBB/adm/style/acp_logs.html b/phpBB/adm/style/acp_logs.html
index f2fa5dbc26..cb15a8f51d 100644
--- a/phpBB/adm/style/acp_logs.html
+++ b/phpBB/adm/style/acp_logs.html
@@ -1,6 +1,6 @@
<!-- INCLUDE overall_header.html -->
-<a name="maincontent"></a>
+<a id="maincontent"></a>
<h1>{L_TITLE}</h1>
@@ -8,35 +8,32 @@
<form id="list" method="post" action="{U_ACTION}">
-<fieldset class="display-options" style="float: left">
- {L_SEARCH_KEYWORDS}: <input type="text" name="keywords" value="{S_KEYWORDS}" />&nbsp;<input type="submit" class="button2" name="filter" value="{L_SEARCH}" />
+<fieldset class="display-options search-box">
+ {L_SEARCH_KEYWORDS}{L_COLON} <input type="text" name="keywords" value="{S_KEYWORDS}" />&nbsp;<input type="submit" class="button2" name="filter" value="{L_SEARCH}" />
</fieldset>
-<!-- IF PAGINATION -->
-<div class="pagination" style="float: right; margin: 15px 0 2px 0">
- <a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{S_ON_PAGE}</a> &bull; <span>{PAGINATION}</span>
+<!-- IF .pagination -->
+<div class="pagination top-pagination">
+ <!-- INCLUDE pagination.html -->
</div>
<!-- ENDIF -->
-<div class="clearfix">&nbsp;</div>
-<div><br style="clear: both;" /></div>
-
<!-- IF .log -->
- <table cellspacing="1">
+ <table class="table1 zebra-table fixed-width-table">
<thead>
<tr>
- <th>{L_USERNAME}</th>
- <th>{L_IP}</th>
- <th>{L_TIME}</th>
+ <th style="width: 15%;">{L_USERNAME}</th>
+ <th style="width: 15%;">{L_IP}</th>
+ <th style="width: 20%;">{L_TIME}</th>
<th>{L_ACTION}</th>
<!-- IF S_CLEARLOGS -->
- <th>{L_MARK}</th>
+ <th style="width: 50px;">{L_MARK}</th>
<!-- ENDIF -->
</tr>
</thead>
<tbody>
<!-- BEGIN log -->
- <!-- IF log.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
+ <tr>
<td>
{log.USERNAME}
<!-- IF log.REPORTEE_USERNAME -->
@@ -54,9 +51,9 @@
</tbody>
</table>
-<!-- IF PAGINATION -->
+<!-- IF .pagination -->
<div class="pagination">
- <a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{S_ON_PAGE}</a> &bull; <span>{PAGINATION}</span>
+ <!-- INCLUDE pagination.html -->
</div>
<!-- ENDIF -->
@@ -67,7 +64,7 @@
<!-- ENDIF -->
<fieldset class="display-options">
- {L_DISPLAY_LOG}: &nbsp;{S_LIMIT_DAYS}&nbsp;{L_SORT_BY}: {S_SORT_KEY} {S_SORT_DIR}
+ {L_DISPLAY_LOG}{L_COLON} &nbsp;{S_LIMIT_DAYS}&nbsp;{L_SORT_BY}{L_COLON} {S_SORT_KEY} {S_SORT_DIR}
<input class="button2" type="submit" value="{L_GO}" name="sort" />
{S_FORM_TOKEN}
</fieldset>
@@ -75,8 +72,8 @@
<!-- IF S_SHOW_FORUMS -->
<fieldset class="quick">
- {L_SELECT_FORUM}: <select name="f" onchange="if(this.options[this.selectedIndex].value != -1){ this.form.submit(); }">{S_FORUM_BOX}</select>
- <input class="button2" type="submit" value="{L_GO}" />
+ {L_SELECT_FORUM}{L_COLON} <select name="f" onchange="if(this.options[this.selectedIndex].value != -1){ this.form.submit(); }">{S_FORUM_BOX}</select>
+ <!-- EVENT acp_logs_quick_select_forum_button_prepend --><input class="button2" type="submit" value="{L_GO}" /><!-- EVENT acp_logs_quick_select_forum_button_append -->
</fieldset>
<!-- ENDIF -->
diff --git a/phpBB/adm/style/acp_main.html b/phpBB/adm/style/acp_main.html
index c665c9d893..1bdb7b8d2a 100644
--- a/phpBB/adm/style/acp_main.html
+++ b/phpBB/adm/style/acp_main.html
@@ -1,6 +1,6 @@
<!-- INCLUDE overall_header.html -->
-<a name="maincontent"></a>
+<a id="maincontent"></a>
<!-- IF S_RESTORE_PERMISSIONS -->
@@ -14,9 +14,14 @@
<p>{L_ADMIN_INTRO}</p>
- <!-- IF S_VERSIONCHECK_FAIL -->
+ <!-- IF S_UPDATE_INCOMPLETE -->
+ <div class="errorbox">
+ <p>{L_UPDATE_INCOMPLETE} <a href="{U_VERSIONCHECK}">{L_MORE_INFORMATION}</a></p>
+ </div>
+ <!-- ELSEIF S_VERSIONCHECK_FAIL -->
<div class="errorbox notice">
<p>{L_VERSIONCHECK_FAIL}</p>
+ <p>{VERSIONCHECK_FAIL_REASON}</p>
<p><a href="{U_VERSIONCHECK_FORCE}">{L_VERSIONCHECK_FORCE_UPDATE}</a> &middot; <a href="{U_VERSIONCHECK}">{L_MORE_INFORMATION}</a></p>
</div>
<!-- ELSEIF not S_VERSION_UP_TO_DATE -->
@@ -25,7 +30,18 @@
<p><a href="{U_VERSIONCHECK_FORCE}">{L_VERSIONCHECK_FORCE_UPDATE}</a> &middot; <a href="{U_VERSIONCHECK}">{L_MORE_INFORMATION}</a></p>
</div>
<!-- ENDIF -->
+ <!-- IF S_VERSION_UPGRADEABLE -->
+ <div class="errorbox notice">
+ <p>{UPGRADE_INSTRUCTIONS}</p>
+ </div>
+ <!-- ENDIF -->
+ <!-- IF S_SEARCH_INDEX_MISSING -->
+ <div class="errorbox">
+ <h3>{L_WARNING}</h3>
+ <p>{L_NO_SEARCH_INDEX}</p>
+ </div>
+ <!-- ENDIF -->
<!-- IF S_REMOVE_INSTALL -->
<div class="errorbox">
@@ -76,7 +92,9 @@
</div>
<!-- ENDIF -->
- <table cellspacing="1">
+ <!-- EVENT acp_main_notice_after -->
+
+ <table class="table1 two-columns no-header" data-no-responsive-header="true">
<caption>{L_FORUM_STATS}</caption>
<col class="col1" /><col class="col2" /><col class="col1" /><col class="col2" />
<thead>
@@ -89,62 +107,67 @@
</thead>
<tbody>
<tr>
- <td>{L_NUMBER_POSTS}: </td>
+ <td>{L_NUMBER_POSTS}{L_COLON} </td>
<td><strong>{TOTAL_POSTS}</strong></td>
- <td>{L_POSTS_PER_DAY}: </td>
+ <td>{L_POSTS_PER_DAY}{L_COLON} </td>
<td><strong>{POSTS_PER_DAY}</strong></td>
</tr>
<tr>
- <td>{L_NUMBER_TOPICS}: </td>
+ <td>{L_NUMBER_TOPICS}{L_COLON} </td>
<td><strong>{TOTAL_TOPICS}</strong></td>
- <td>{L_TOPICS_PER_DAY}: </td>
+ <td>{L_TOPICS_PER_DAY}{L_COLON} </td>
<td><strong>{TOPICS_PER_DAY}</strong></td>
</tr>
<tr>
- <td>{L_NUMBER_USERS}: </td>
+ <td>{L_NUMBER_USERS}{L_COLON} </td>
<td><strong>{TOTAL_USERS}</strong></td>
- <td>{L_USERS_PER_DAY}: </td>
+ <td>{L_USERS_PER_DAY}{L_COLON} </td>
<td><strong>{USERS_PER_DAY}</strong></td>
</tr>
<tr>
- <td>{L_NUMBER_FILES}: </td>
+ <td>{L_NUMBER_FILES}{L_COLON} </td>
<td><strong>{TOTAL_FILES}</strong></td>
- <td>{L_FILES_PER_DAY}: </td>
+ <td>{L_FILES_PER_DAY}{L_COLON} </td>
<td><strong>{FILES_PER_DAY}</strong></td>
</tr>
<tr>
- <td>{L_BOARD_STARTED}: </td>
+ <td>{L_BOARD_STARTED}{L_COLON} </td>
<td><strong>{START_DATE}</strong></td>
- <td>{L_AVATAR_DIR_SIZE}: </td>
+ <td>{L_AVATAR_DIR_SIZE}{L_COLON} </td>
<td><strong>{AVATAR_DIR_SIZE}</strong></td>
</tr>
<tr>
- <td>{L_DATABASE_SIZE}: </td>
+ <td>{L_DATABASE_SIZE}{L_COLON} </td>
<td><strong>{DBSIZE}</strong></td>
- <td>{L_UPLOAD_DIR_SIZE}: </td>
+ <td>{L_UPLOAD_DIR_SIZE}{L_COLON} </td>
<td><strong>{UPLOAD_DIR_SIZE}</strong></td>
</tr>
<tr>
- <td>{L_DATABASE_SERVER_INFO}: </td>
+ <td>{L_DATABASE_SERVER_INFO}{L_COLON} </td>
<td><strong>{DATABASE_INFO}</strong></td>
- <td>{L_GZIP_COMPRESSION}: </td>
+ <td>{L_GZIP_COMPRESSION}{L_COLON} </td>
<td><strong>{GZIP_COMPRESSION}</strong></td>
</tr>
+ <!-- IF S_TOTAL_ORPHAN or S_VERSIONCHECK -->
<tr>
- <td>{L_BOARD_VERSION}: </td>
+ <!-- IF S_VERSIONCHECK -->
+ <td>{L_BOARD_VERSION}{L_COLON} </td>
<td>
- <strong><a href="{U_VERSIONCHECK}" <!-- IF S_VERSION_UP_TO_DATE -->style="color: #228822;"<!-- ELSE -->style="color: #BC2A4D;"<!-- ENDIF --> title="{L_MORE_INFORMATION}">{BOARD_VERSION}</a></strong> [&nbsp;<a href="{U_VERSIONCHECK_FORCE}">{L_VERSIONCHECK_FORCE_UPDATE}</a>&nbsp;]
+ <strong><a href="{U_VERSIONCHECK}" <!-- IF S_VERSION_UP_TO_DATE -->style="color: #228822;" <!-- ELSEIF not S_VERSIONCHECK_FAIL -->style="color: #BC2A4D;" <!-- ENDIF -->title="{L_MORE_INFORMATION}">{BOARD_VERSION}</a></strong> [&nbsp;<a href="{U_VERSIONCHECK_FORCE}">{L_VERSIONCHECK_FORCE_UPDATE}</a>&nbsp;]
</td>
+ <!-- ENDIF -->
<!-- IF S_TOTAL_ORPHAN -->
- <td>{L_NUMBER_ORPHAN}: </td>
+ <td>{L_NUMBER_ORPHAN}{L_COLON} </td>
<td><strong>{TOTAL_ORPHAN}</strong></td>
- <!-- ELSE -->
+ <!-- ENDIF -->
+ <!-- IF not S_TOTAL_ORPHAN or not S_VERSIONCHECK -->
<td>&nbsp;</td>
<td>&nbsp;</td>
<!-- ENDIF -->
</tr>
+ <!-- ENDIF -->
</tbody>
</table>
@@ -152,14 +175,14 @@
<fieldset>
<legend>{L_STATISTIC_RESYNC_OPTIONS}</legend>
- <form id="action_online_form" method="post" action="{U_ACTION}">
+ <form id="action_online_form" method="post" action="{U_ACTION}" data-ajax="true">
<dl>
<dt><label for="action_online">{L_RESET_ONLINE}</label><br /><span>&nbsp;</span></dt>
<dd><input type="hidden" name="action" value="online" /><input class="button2" type="submit" id="action_online" name="action_online" value="{L_RUN}" /></dd>
</dl>
</form>
- <form id="action_date_form" method="post" action="{U_ACTION}">
+ <form id="action_date_form" method="post" action="{U_ACTION}" data-ajax="true">
<dl>
<dt><label for="action_date">{L_RESET_DATE}</label><br /><span>&nbsp;</span></dt>
<dd><input type="hidden" name="action" value="date" /><input class="button2" type="submit" id="action_date" name="action_date" value="{L_RUN}" /></dd>
@@ -188,19 +211,22 @@
</form>
<!-- IF S_FOUNDER -->
- <form id="action_purge_sessions_form" method="post" action="{U_ACTION}">
+ <form id="action_purge_sessions_form" method="post" action="{U_ACTION}" data-ajax="true">
<dl>
<dt><label for="action_purge_sessions">{L_PURGE_SESSIONS}</label><br /><span>{L_PURGE_SESSIONS_EXPLAIN}</span></dt>
<dd><input type="hidden" name="action" value="purge_sessions" /><input class="button2" type="submit" id="action_purge_sessions" name="action_purge_sessions" value="{L_RUN}" /></dd>
</dl>
</form>
- <form id="action_purge_cache_form" method="post" action="{U_ACTION}">
+ <!-- ENDIF -->
+
+ <form id="action_purge_cache_form" method="post" action="{U_ACTION}" data-ajax="true">
<dl>
<dt><label for="action_purge_cache">{L_PURGE_CACHE}</label><br /><span>{L_PURGE_CACHE_EXPLAIN}</span></dt>
<dd><input type="hidden" name="action" value="purge_cache" /><input class="button2" type="submit" id="action_purge_cache" name="action_purge_cache" value="{L_RUN}" /></dd>
</dl>
</form>
- <!-- ENDIF -->
+
+ <!-- EVENT acp_main_actions_append -->
</fieldset>
<!-- ENDIF -->
@@ -211,7 +237,7 @@
<div style="text-align: right;"><a href="{U_ADMIN_LOG}">&raquo; {L_VIEW_ADMIN_LOG}</a></div>
- <table cellspacing="1">
+ <table class="table1 zebra-table">
<thead>
<tr>
<th>{L_USERNAME}</th>
@@ -222,8 +248,7 @@
</thead>
<tbody>
<!-- BEGIN log -->
- <!-- IF log.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
-
+ <tr>
<td>{log.USERNAME}</td>
<td style="text-align: center;">{log.IP}</td>
<td style="text-align: center;">{log.DATE}</td>
@@ -232,9 +257,6 @@
<!-- END log -->
</tbody>
</table>
-
- <br />
-
<!-- ENDIF -->
<!-- IF S_INACTIVE_USERS -->
@@ -244,7 +266,7 @@
<div style="text-align: right;"><a href="{U_INACTIVE_USERS}">&raquo; {L_VIEW_INACTIVE_USERS}</a></div>
- <table cellspacing="1">
+ <table class="table1 zebra-table">
<thead>
<tr>
<th>{L_USERNAME}</th>
@@ -256,11 +278,10 @@
</thead>
<tbody>
<!-- BEGIN inactive -->
- <!-- IF inactive.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
-
+ <tr>
<td style="vertical-align: top;">
{inactive.USERNAME_FULL}
- <!-- IF inactive.POSTS --><br />{L_POSTS}: <strong>{inactive.POSTS}</strong> [<a href="{inactive.U_SEARCH_USER}">{L_SEARCH_USER_POSTS}</a>]<!-- ENDIF -->
+ <!-- IF inactive.POSTS --><br />{L_POSTS}{L_COLON} <strong>{inactive.POSTS}</strong> [<a href="{inactive.U_SEARCH_USER}">{L_SEARCH_USER_POSTS}</a>]<!-- ENDIF -->
</td>
<td style="vertical-align: top;">{inactive.JOINED}</td>
<td style="vertical-align: top;">{inactive.INACTIVE_DATE}</td>
@@ -277,9 +298,8 @@
<!-- END inactive -->
</tbody>
</table>
-
<!-- ENDIF -->
<!-- ENDIF -->
-<!-- INCLUDE overall_footer.html --> \ No newline at end of file
+<!-- INCLUDE overall_footer.html -->
diff --git a/phpBB/adm/style/acp_modules.html b/phpBB/adm/style/acp_modules.html
index 5396e78557..3c97706e6a 100644
--- a/phpBB/adm/style/acp_modules.html
+++ b/phpBB/adm/style/acp_modules.html
@@ -1,6 +1,6 @@
<!-- INCLUDE overall_header.html -->
-<a name="maincontent"></a>
+<a id="maincontent"></a>
<!-- IF S_EDIT_MODULE -->
@@ -10,11 +10,11 @@
{
if (value == 'category')
{
- dE('modoptions', -1);
+ phpbb.toggleDisplay('modoptions', -1);
}
else
{
- dE('modoptions', 1);
+ phpbb.toggleDisplay('modoptions', 1);
}
}
@@ -72,37 +72,37 @@
<fieldset>
<legend>{L_GENERAL_OPTIONS}</legend>
<dl>
- <dt><label for="module_langname">{L_MODULE_LANGNAME}:</label><br />
+ <dt><label for="module_langname">{L_MODULE_LANGNAME}{L_COLON}</label><br />
<span>{L_MODULE_LANGNAME_EXPLAIN}</span></dt>
<dd><input name="module_langname" type="text" class="text medium" id="module_langname" value="{MODULE_LANGNAME}" /></dd>
</dl>
<dl>
- <dt><label for="module_type">{L_MODULE_TYPE}:</label></dt>
+ <dt><label for="module_type">{L_MODULE_TYPE}{L_COLON}</label></dt>
<dd><select name="module_type" id="module_type" onchange="display_options(this.value);"><option value="category"<!-- IF S_IS_CAT --> selected="selected"<!-- ENDIF -->>{L_CATEGORY}</option><option value="module"<!-- IF not S_IS_CAT --> selected="selected"<!-- ENDIF -->>{L_MODULE}</option></select></dd>
</dl>
<dl>
- <dt><label for="parent_id">{L_PARENT}:</label></dt>
+ <dt><label for="parent_id">{L_PARENT}{L_COLON}</label></dt>
<dd><select name="module_parent_id" id="parent_id">{S_CAT_OPTIONS}</select></dd>
</dl>
<hr />
<dl>
- <dt><label for="module_enabled">{L_MODULE_ENABLED}:</label></dt>
+ <dt><label for="module_enabled">{L_MODULE_ENABLED}{L_COLON}</label></dt>
<dd><label><input type="radio" class="radio" name="module_enabled" id="module_enabled" value="1"<!-- IF MODULE_ENABLED --> checked="checked"<!-- ENDIF --> /> {L_YES}</label>
<label><input type="radio" class="radio" name="module_enabled" value="0"<!-- IF not MODULE_ENABLED --> checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd>
</dl>
<div id="modoptions"<!-- IF S_IS_CAT --> style="display: none;"<!-- ENDIF -->>
<dl>
- <dt><label for="module_display">{L_MODULE_DISPLAYED}:</label><br /><span>{L_MODULE_DISPLAYED_EXPLAIN}</span></dt>
+ <dt><label for="module_display">{L_MODULE_DISPLAYED}{L_COLON}</label><br /><span>{L_MODULE_DISPLAYED_EXPLAIN}</span></dt>
<dd><label><input type="radio" class="radio" name="module_display" id="module_display" value="1"<!-- IF MODULE_DISPLAY --> checked="checked"<!-- ENDIF --> /> {L_YES}</label>
<label><input type="radio" class="radio" name="module_display" value="0"<!-- IF not MODULE_DISPLAY --> checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd>
</dl>
<dl>
- <dt><label for="module_basename">{L_CHOOSE_MODULE}:</label><br />
+ <dt><label for="module_basename">{L_CHOOSE_MODULE}{L_COLON}</label><br />
<span>{L_CHOOSE_MODULE_EXPLAIN}</span></dt>
<dd><select name="module_basename" id="module_basename" onchange="display_modes(this.value);">{S_MODULE_NAMES}</select></dd>
</dl>
<dl>
- <dt><label for="module_mode">{L_CHOOSE_MODE}:</label><br />
+ <dt><label for="module_mode">{L_CHOOSE_MODE}{L_COLON}</label><br />
<span>{L_CHOOSE_MODE_EXPLAIN}</span></dt>
<dd><select name="module_mode" id="module_mode">{S_MODULE_MODES}</select></dd>
</dl>
@@ -132,7 +132,7 @@
</div>
<!-- ENDIF -->
- <table cellspacing="1">
+ <table class="table1">
<tbody>
<tr>
<td class="row3">{NAVIGATION}<!-- IF S_NO_MODULES --> [<a href="{U_EDIT}">{L_EDIT}</a> | <a href="{U_DELETE}">{L_DELETE}</a> | <!-- IF MODULE_ENABLED --><a href="{U_DISABLE}">{L_DISABLE}</a><!-- ELSE --><a href="{U_ENABLE}">{L_ENABLE}</a><!-- ENDIF -->]<!-- ENDIF --></td>
@@ -141,7 +141,7 @@
</table>
<!-- IF .modules -->
- <table cellspacing="1">
+ <table class="table1">
<col class="row1" /><col class="row1" /><col class="row2" /><col class="row2" />
<tbody>
<!-- BEGIN modules -->
@@ -149,22 +149,13 @@
<td style="width: 5%; text-align: center;">{modules.MODULE_IMAGE}</td>
<td><a href="{modules.U_MODULE}">{modules.MODULE_TITLE}</a><!-- IF not modules.MODULE_DISPLAYED --> <span class="small">[{L_HIDDEN_MODULE}]</span><!-- ENDIF --></td>
<td style="width: 15%; white-space: nowrap; text-align: center; vertical-align: middle;">&nbsp;<!-- IF modules.MODULE_ENABLED --><a href="{modules.U_DISABLE}">{L_DISABLE}</a><!-- ELSE --><a href="{modules.U_ENABLE}">{L_ENABLE}</a><!-- ENDIF -->&nbsp;</td>
- <td style="width:90px; white-space: nowrap; text-align: right; vertical-align: middle;">
- <!-- IF modules.S_FIRST_ROW && not modules.S_LAST_ROW -->
- {ICON_MOVE_UP_DISABLED}
- <a href="{modules.U_MOVE_DOWN}">{ICON_MOVE_DOWN}</a>
- <!-- ELSEIF not modules.S_FIRST_ROW && not modules.S_LAST_ROW-->
- <a href="{modules.U_MOVE_UP}">{ICON_MOVE_UP}</a>
- <a href="{modules.U_MOVE_DOWN}">{ICON_MOVE_DOWN}</a>
- <!-- ELSEIF modules.S_LAST_ROW && not modules.S_FIRST_ROW -->
- <a href="{modules.U_MOVE_UP}">{ICON_MOVE_UP}</a>
- {ICON_MOVE_DOWN_DISABLED}
- <!-- ELSE -->
- {ICON_MOVE_UP_DISABLED}
- {ICON_MOVE_DOWN_DISABLED}
- <!-- ENDIF -->
+ <td class="actions">
+ <span class="up-disabled" style="display:none;">{ICON_MOVE_UP_DISABLED}</span>
+ <span class="up"><a href="{modules.U_MOVE_UP}" data-ajax="row_up">{ICON_MOVE_UP}</a></span>
+ <span class="down-disabled" style="display:none;">{ICON_MOVE_DOWN_DISABLED}</span>
+ <span class="down"><a href="{modules.U_MOVE_DOWN}" data-ajax="row_down">{ICON_MOVE_DOWN}</a></span>
<a href="{modules.U_EDIT}">{ICON_EDIT}</a>
- <a href="{modules.U_DELETE}">{ICON_DELETE}</a>
+ <a href="{modules.U_DELETE}" data-ajax="row_delete">{ICON_DELETE}</a>
</td>
</tr>
<!-- END modules -->
@@ -201,7 +192,7 @@
<form id="mselect" method="post" action="{U_SEL_ACTION}">
<fieldset class="quick">
- {L_SELECT_MODULE}: <select name="parent_id" onchange="if(this.options[this.selectedIndex].value != -1){ this.form.submit(); }">{MODULE_BOX}</select>
+ {L_SELECT_MODULE}{L_COLON} <select name="parent_id" onchange="if(this.options[this.selectedIndex].value != -1){ this.form.submit(); }">{MODULE_BOX}</select>
<input class="button2" type="submit" value="{L_GO}" />
</fieldset>
diff --git a/phpBB/adm/style/acp_permission_roles.html b/phpBB/adm/style/acp_permission_roles.html
index 220e7dafbe..b3137f134c 100644
--- a/phpBB/adm/style/acp_permission_roles.html
+++ b/phpBB/adm/style/acp_permission_roles.html
@@ -1,6 +1,6 @@
<!-- INCLUDE overall_header.html -->
-<a name="maincontent"></a>
+<a id="maincontent"></a>
<!-- IF S_EDIT -->
@@ -36,11 +36,11 @@
<fieldset>
<legend>{L_ROLE_DETAILS}</legend>
<dl>
- <dt><label for="role_name">{L_ROLE_NAME}:</label></dt>
+ <dt><label for="role_name">{L_ROLE_NAME}{L_COLON}</label></dt>
<dd><input name="role_name" type="text" id="role_name" value="{ROLE_NAME}" maxlength="255" /></dd>
</dl>
<dl>
- <dt><label for="role_description">{L_ROLE_DESCRIPTION}:</label><br /><span>{L_ROLE_DESCRIPTION_EXPLAIN}</span></dt>
+ <dt><label for="role_description">{L_ROLE_DESCRIPTION}{L_COLON}</label><br /><span>{L_ROLE_DESCRIPTION_EXPLAIN}</span></dt>
<dd><textarea id="role_description" name="role_description" rows="3" cols="45">{ROLE_DESCRIPTION}</textarea></dd>
</dl>
@@ -60,7 +60,7 @@
<p>
- <a name="acl"></a>
+ <a id="acl"></a>
<a href="#maincontent">&raquo; {L_BACK_TO_TOP}</a><br />
<br /><br />
@@ -90,9 +90,8 @@
</div>
<!-- BEGIN auth -->
<div class="permissions-panel" id="options00{auth.S_ROW_COUNT}"<!-- IF auth.S_FIRST_ROW --><!-- ELSE --> style="display: none;"<!-- ENDIF -->>
- <span class="corners-top"><span></span></span>
<div class="tablewrap">
- <table id="table00{auth.S_ROW_COUNT}" cellspacing="1">
+ <table id="table00{auth.S_ROW_COUNT}" class="table1 not-responsive">
<colgroup>
<col class="permissions-name" />
<col class="permissions-yes" />
@@ -120,7 +119,6 @@
</tbody>
</table>
</div>
- <span class="corners-bottom"><span></span></span>
</div>
<!-- END auth -->
</div>
@@ -144,7 +142,7 @@
<form id="acp_roles" method="post" action="{U_ACTION}">
- <table cellspacing="1">
+ <table class="table1">
<col class="col2" /><col class="col2" /><col class="col1" /><col class="col2" /><col class="col2" />
<thead>
<tr>
@@ -159,22 +157,13 @@
<!-- IF roles.ROLE_DESCRIPTION --><br /><span>{roles.ROLE_DESCRIPTION}</span><!-- ENDIF -->
</td>
<td style="width: 30%; text-align: center; vertical-align: top; white-space: nowrap;"><!-- IF roles.U_DISPLAY_ITEMS --><a href="{roles.U_DISPLAY_ITEMS}">{L_VIEW_ASSIGNED_ITEMS}</a><!-- ELSE -->{L_VIEW_ASSIGNED_ITEMS}<!-- ENDIF --></td>
- <td style="width: 80px; text-align: right; vertical-align: top; white-space: nowrap;">
- <!-- IF roles.S_FIRST_ROW && not roles.S_LAST_ROW -->
- {ICON_MOVE_UP_DISABLED}
- <a href="{roles.U_MOVE_DOWN}">{ICON_MOVE_DOWN}</a>
- <!-- ELSEIF not roles.S_FIRST_ROW && not roles.S_LAST_ROW-->
- <a href="{roles.U_MOVE_UP}">{ICON_MOVE_UP}</a>
- <a href="{roles.U_MOVE_DOWN}">{ICON_MOVE_DOWN}</a>
- <!-- ELSEIF roles.S_LAST_ROW && not roles.S_FIRST_ROW -->
- <a href="{roles.U_MOVE_UP}">{ICON_MOVE_UP}</a>
- {ICON_MOVE_DOWN_DISABLED}
- <!-- ELSE -->
- {ICON_MOVE_UP_DISABLED}
- {ICON_MOVE_DOWN_DISABLED}
- <!-- ENDIF -->
+ <td class="actions">
+ <span class="up-disabled" style="display:none;">{ICON_MOVE_UP_DISABLED}</span>
+ <span class="up"><a href="{roles.U_MOVE_UP}" data-ajax="row_up">{ICON_MOVE_UP}</a></span>
+ <span class="down-disabled" style="display:none;">{ICON_MOVE_DOWN_DISABLED}</span>
+ <span class="down"><a href="{roles.U_MOVE_DOWN}" data-ajax="row_down">{ICON_MOVE_DOWN}</a></span>
<a href="{roles.U_EDIT}" title="{L_EDIT_ROLE}">{ICON_EDIT}</a>
- <a href="{roles.U_REMOVE}" title="{L_REMOVE_ROLE}">{ICON_DELETE}</a>
+ <a href="{roles.U_REMOVE}" title="{L_REMOVE_ROLE}" data-ajax="row_delete">{ICON_DELETE}</a>
</td>
</tr>
<!-- END roles -->
@@ -182,14 +171,14 @@
</table>
<fieldset class="quick">
- {L_CREATE_ROLE}: <input type="text" name="role_name" value="" maxlength="255" /><!-- IF S_ROLE_OPTIONS --> <select name="options_from"><option value="0" selected="selected">{L_CREATE_ROLE_FROM}</option>{S_ROLE_OPTIONS}</select><!-- ENDIF --> <input class="button2" type="submit" name="add" value="{L_SUBMIT}" /><br />
+ {L_CREATE_ROLE}{L_COLON} <input type="text" name="role_name" value="" maxlength="255" /><!-- IF S_ROLE_OPTIONS --> <select name="options_from"><option value="0" selected="selected">{L_CREATE_ROLE_FROM}</option>{S_ROLE_OPTIONS}</select><!-- ENDIF --> <input class="button2" type="submit" name="add" value="{L_SUBMIT}" /><br />
{S_FORM_TOKEN}
</fieldset>
</form>
<!-- IF S_DISPLAY_ROLE_MASK -->
- <a name="assigned_to"></a>
+ <a id="assigned_to"></a>
<h1>{L_ROLE_ASSIGNED_TO}</h1>
@@ -199,4 +188,4 @@
<!-- ENDIF -->
-<!-- INCLUDE overall_footer.html --> \ No newline at end of file
+<!-- INCLUDE overall_footer.html -->
diff --git a/phpBB/adm/style/acp_permissions.html b/phpBB/adm/style/acp_permissions.html
index 63583093b0..a4d33ed78b 100644
--- a/phpBB/adm/style/acp_permissions.html
+++ b/phpBB/adm/style/acp_permissions.html
@@ -1,6 +1,6 @@
<!-- INCLUDE overall_header.html -->
-<a name="maincontent"></a>
+<a id="maincontent"></a>
<!-- IF S_INTRO -->
@@ -19,7 +19,7 @@
<p>{L_EXPLAIN}</p>
<!-- IF S_FORUM_NAMES -->
- <p><strong>{L_FORUMS}:</strong> {FORUM_NAMES}</p>
+ <p><strong>{L_FORUMS}{L_COLON}</strong> {FORUM_NAMES}</p>
<!-- ENDIF -->
<!-- IF S_SELECT_FORUM -->
@@ -30,7 +30,7 @@
<legend>{L_LOOK_UP_FORUM}</legend>
<!-- IF S_FORUM_MULTIPLE --><p>{L_LOOK_UP_FORUMS_EXPLAIN}</p><!-- ENDIF -->
<dl>
- <dt><label for="forum">{L_LOOK_UP_FORUM}:</label></dt>
+ <dt><!-- EVENT acp_permissions_select_multiple_forum_prepend --><label for="forum">{L_LOOK_UP_FORUM}{L_COLON}</label><!-- EVENT acp_permissions_select_multiple_forum_append --></dt>
<dd><select id="forum" name="forum_id[]"<!-- IF S_FORUM_MULTIPLE --> multiple="multiple"<!-- ENDIF --> size="10">{S_FORUM_OPTIONS}</select></dd>
<!-- IF S_FORUM_ALL --><dd><label><input type="checkbox" class="radio" name="all_forums" value="1" /> {L_ALL_FORUMS}</label></dd><!-- ENDIF -->
</dl>
@@ -52,7 +52,7 @@
<legend>{L_LOOK_UP_FORUM}</legend>
<p>{L_SELECT_FORUM_SUBFORUM_EXPLAIN}</p>
<dl>
- <dt><label for="sforum">{L_LOOK_UP_FORUM}:</label></dt>
+ <dt><!-- EVENT acp_permissions_select_forum_prepend --><label for="sforum">{L_LOOK_UP_FORUM}{L_COLON}</label><!-- EVENT acp_permissions_select_forum_append --></dt>
<dd><select id="sforum" name="subforum_id">{S_SUBFORUM_OPTIONS}</select></dd>
</dl>
@@ -74,7 +74,7 @@
<fieldset>
<legend>{L_LOOK_UP_USER}</legend>
<dl>
- <dt><label for="username">{L_FIND_USERNAME}:</label></dt>
+ <dt><label for="username">{L_FIND_USERNAME}{L_COLON}</label></dt>
<dd><input class="text medium" type="text" id="username" name="username[]" /></dd>
<dd>[ <a href="{U_FIND_USERNAME}" onclick="find_username(this.href); return false;">{L_FIND_USERNAME}</a> ]</dd>
<dd class="full" style="text-align: left;"><label><input type="checkbox" class="radio" id="anonymous" name="user_id[]" value="{ANONYMOUS_USER_ID}" /> {L_SELECT_ANONYMOUS}</label></dd>
@@ -95,7 +95,7 @@
<fieldset>
<legend>{L_LOOK_UP_GROUP}</legend>
<dl>
- <dt><label for="group">{L_LOOK_UP_GROUP}:</label></dt>
+ <dt><!-- EVENT acp_permissions_select_group_prepend --><label for="group">{L_LOOK_UP_GROUP}{L_COLON}</label><!-- EVENT acp_permissions_select_group_append --></dt>
<dd><select name="group_id[]" id="group">{S_GROUP_OPTIONS}</select></dd>
</dl>
@@ -110,7 +110,7 @@
<!-- ELSEIF S_SELECT_USERGROUP -->
- <div style="float: {S_CONTENT_FLOW_BEGIN}; width: 48%;">
+ <div class="column1">
<!-- IF S_CAN_SELECT_USER -->
@@ -140,7 +140,7 @@
<p>{L_USERNAMES_EXPLAIN}</p>
<dl>
<dd class="full"><textarea id="username" name="usernames" rows="5" cols="5" style="width: 100%; height: 60px;"></textarea></dd>
- <dd class="full" style="text-align: left;"><div style="float: {S_CONTENT_FLOW_END};">[ <a href="{U_FIND_USERNAME}" onclick="find_username(this.href); return false;">{L_FIND_USERNAME}</a> ]</div><label><input type="checkbox" class="radio" id="anonymous" name="user_id[]" value="{ANONYMOUS_USER_ID}" /> {L_SELECT_ANONYMOUS}</label></dd>
+ <dd class="full" style="text-align: left;"><!-- EVENT acp_permissions_find_username_prepend --><div style="float: {S_CONTENT_FLOW_END};">[ <a href="{U_FIND_USERNAME}" onclick="find_username(this.href); return false;">{L_FIND_USERNAME}</a> ]</div><!-- EVENT acp_permissions_find_username_append --><label><input type="checkbox" class="radio" id="anonymous" name="user_id[]" value="{ANONYMOUS_USER_ID}" /> {L_SELECT_ANONYMOUS}</label></dd>
</dl>
</fieldset>
@@ -155,7 +155,7 @@
</div>
- <div style="float: {S_CONTENT_FLOW_END}; width: 48%">
+ <div class="column2">
<!-- IF S_CAN_SELECT_GROUP -->
@@ -183,7 +183,7 @@
<fieldset>
<legend>{L_ADD_GROUPS}</legend>
<dl>
- <dd class="full"><select name="group_id[]" style="width: 100%; height: 107px;" multiple="multiple">{S_ADD_GROUP_OPTIONS}</select></dd>
+ <dd class="full"><!-- EVENT acp_permissions_add_group_options_prepend --><select name="group_id[]" style="width: 100%; height: 107px;" multiple="multiple">{S_ADD_GROUP_OPTIONS}</select><!-- EVENT acp_permissions_add_group_options_append --></dd>
</dl>
</fieldset>
@@ -200,7 +200,7 @@
<!-- ELSEIF S_SELECT_USERGROUP_VIEW -->
- <div style="float: {S_CONTENT_FLOW_BEGIN}; width: 48%;">
+ <div class="column1">
<h1>{L_USERS}</h1>
@@ -225,7 +225,7 @@
<fieldset>
<legend>{L_LOOK_UP_USER}</legend>
<dl>
- <dt><label for="username">{L_FIND_USERNAME}:</label></dt>
+ <dt><label for="username">{L_FIND_USERNAME}{L_COLON}</label></dt>
<dd><input type="text" id="username" name="username[]" /></dd>
<dd>[ <a href="{U_FIND_USERNAME}" onclick="find_username(this.href); return false;">{L_FIND_USERNAME}</a> ]</dd>
<dd class="full" style="text-align: left;"><label><input type="checkbox" class="radio" id="anonymous" name="user_id[]" value="{ANONYMOUS_USER_ID}" /> {L_SELECT_ANONYMOUS}</label></dd>
@@ -241,7 +241,7 @@
</div>
- <div style="float: {S_CONTENT_FLOW_END}; width: 48%">
+ <div class="column2">
<h1>{L_USERGROUPS}</h1>
@@ -266,8 +266,10 @@
<fieldset>
<legend>{L_LOOK_UP_GROUP}</legend>
<dl>
- <dt><label for="group_select">{L_LOOK_UP_GROUP}:</label></dt>
+ <dt><label for="group_select">{L_LOOK_UP_GROUP}{L_COLON}</label></dt>
+ <!-- EVENT acp_permissions_select_group_before -->
<dd><select name="group_id[]" id="group_select">{S_ADD_GROUP_OPTIONS}</select></dd>
+ <!-- EVENT acp_permissions_select_group_after -->
<dd>&nbsp;</dd>
</dl>
</fieldset>
@@ -317,14 +319,14 @@
<fieldset class="quick" style="float: {S_CONTENT_FLOW_BEGIN};">
{S_HIDDEN_FIELDS}
{S_FORM_TOKEN}
- {L_SELECT_TYPE}: <select name="type">{S_PERMISSION_DROPDOWN}</select>
+ {L_SELECT_TYPE}{L_COLON} <select name="type">{S_PERMISSION_DROPDOWN}</select>
<input class="button2" type="submit" name="submit" value="{L_GO}" />
</fieldset>
</form>
<!-- ENDIF -->
- <br /><br />
+ <br class="responsive-hide" /><br class="responsive-hide" />
<!-- include tooltip file -->
<script type="text/javascript" src="style/tooltip.js"></script>
@@ -340,7 +342,7 @@
<!-- INCLUDE permission_mask.html -->
- <br /><br />
+ <br class="responsive-hide" /><br class="responsive-hide" />
<fieldset class="quick" style="float: {S_CONTENT_FLOW_END};">
<input class="button1" type="submit" name="action[apply_all_permissions]" value="{L_APPLY_ALL_PERMISSIONS}" />
@@ -348,10 +350,10 @@
{S_FORM_TOKEN}
</fieldset>
- <br /><br />
+ <br class="responsive-hide" /><br class="responsive-hide" />
</form>
<!-- ENDIF -->
-<!-- INCLUDE overall_footer.html --> \ No newline at end of file
+<!-- INCLUDE overall_footer.html -->
diff --git a/phpBB/adm/style/acp_php_info.html b/phpBB/adm/style/acp_php_info.html
index de065c4896..760cd0e9f6 100644
--- a/phpBB/adm/style/acp_php_info.html
+++ b/phpBB/adm/style/acp_php_info.html
@@ -1,6 +1,6 @@
<!-- INCLUDE overall_header.html -->
-<a name="maincontent"></a>
+<a id="maincontent"></a>
<h1>{L_ACP_PHP_INFO}</h1>
@@ -10,4 +10,4 @@
{PHPINFO}
</div>
-<!-- INCLUDE overall_footer.html --> \ No newline at end of file
+<!-- INCLUDE overall_footer.html -->
diff --git a/phpBB/adm/style/acp_posting_buttons.html b/phpBB/adm/style/acp_posting_buttons.html
new file mode 100644
index 0000000000..c3c42f8e82
--- /dev/null
+++ b/phpBB/adm/style/acp_posting_buttons.html
@@ -0,0 +1,71 @@
+<script type="text/javascript">
+// <![CDATA[
+
+ // Define the bbCode tags
+ var bbcode = new Array();
+ var bbtags = new Array('[b]','[/b]','[i]','[/i]','[u]','[/u]','[quote]','[/quote]','[code]','[/code]','[list]','[/list]','[list=]','[/list]','[img]','[/img]','[url]','[/url]','[flash=]', '[/flash]','[size=]','[/size]'<!-- BEGIN custom_tags -->, {custom_tags.BBCODE_NAME}<!-- END custom_tags -->);
+
+ // Helpline messages
+ var help_line = {
+ b: '{LA_BBCODE_B_HELP}',
+ i: '{LA_BBCODE_I_HELP}',
+ u: '{LA_BBCODE_U_HELP}',
+ q: '{LA_BBCODE_Q_HELP}',
+ c: '{LA_BBCODE_C_HELP}',
+ l: '{LA_BBCODE_L_HELP}',
+ o: '{LA_BBCODE_O_HELP}',
+ p: '{LA_BBCODE_P_HELP}',
+ w: '{LA_BBCODE_W_HELP}',
+ a: '{LA_BBCODE_A_HELP}',
+ s: '{LA_BBCODE_S_HELP}',
+ f: '{LA_BBCODE_F_HELP}',
+ y: '{LA_BBCODE_Y_HELP}',
+ d: '{LA_BBCODE_D_HELP}'
+ <!-- BEGIN custom_tags -->
+ ,cb_{custom_tags.BBCODE_ID}{L_COLON} '{custom_tags.A_BBCODE_HELPLINE}'
+ <!-- END custom_tags -->
+ }
+
+// ]]>
+</script>
+
+<!-- INCLUDEJS {T_ASSETS_PATH}/javascript/editor.js -->
+
+<!-- EVENT acp_posting_buttons_before -->
+<div id="format-buttons">
+ <input type="button" class="button2" accesskey="b" name="addbbcode0" value=" B " style="font-weight:bold; width: 30px" onclick="bbstyle(0)" title="{L_BBCODE_B_HELP}" />
+ <input type="button" class="button2" accesskey="i" name="addbbcode2" value=" i " style="font-style:italic; width: 30px" onclick="bbstyle(2)" title="{L_BBCODE_I_HELP}" />
+ <input type="button" class="button2" accesskey="u" name="addbbcode4" value=" u " style="text-decoration: underline; width: 30px" onclick="bbstyle(4)" title="{L_BBCODE_U_HELP}" />
+ <!-- IF S_BBCODE_QUOTE -->
+ <input type="button" class="button2" accesskey="q" name="addbbcode6" value="Quote" style="width: 50px" onclick="bbstyle(6)" title="{L_BBCODE_Q_HELP}" />
+ <!-- ENDIF -->
+ <input type="button" class="button2" accesskey="c" name="addbbcode8" value="Code" style="width: 40px" onclick="bbstyle(8)" title="{L_BBCODE_C_HELP}" />
+ <input type="button" class="button2" accesskey="l" name="addbbcode10" value="List" style="width: 40px" onclick="bbstyle(10)" title="{L_BBCODE_L_HELP}" />
+ <input type="button" class="button2" accesskey="o" name="addbbcode12" value="List=" style="width: 40px" onclick="bbstyle(12)" title="{L_BBCODE_O_HELP}" />
+ <input type="button" class="button2" accesskey="y" name="addlistitem" value="[*]" style="width: 40px" onclick="bbstyle(-1)" title="{L_BBCODE_LISTITEM_HELP}" />
+ <!-- IF S_BBCODE_IMG -->
+ <input type="button" class="button2" accesskey="p" name="addbbcode14" value="Img" style="width: 40px" onclick="bbstyle(14)" title="{L_BBCODE_P_HELP}" />
+ <!-- ENDIF -->
+ <!-- IF S_LINKS_ALLOWED -->
+ <input type="button" class="button2" accesskey="w" name="addbbcode16" value="URL" style="text-decoration: underline; width: 40px" onclick="bbstyle(16)" title="{L_BBCODE_W_HELP}" />
+ <!-- ENDIF -->
+ <!-- IF S_BBCODE_FLASH -->
+ <input type="button" class="button2" accesskey="d" name="addbbcode18" value="Flash" onclick="bbstyle(18)" title="{L_BBCODE_D_HELP}" />
+ <!-- ENDIF -->
+ <select name="addbbcode20" onchange="bbfontstyle('[size=' + this.form.addbbcode20.options[this.form.addbbcode20.selectedIndex].value + ']', '[/size]');this.form.addbbcode20.selectedIndex = 2;" title="{L_BBCODE_F_HELP}">
+ <option value="50">{L_FONT_TINY}</option>
+ <option value="85">{L_FONT_SMALL}</option>
+ <option value="100" selected="selected">{L_FONT_NORMAL}</option>
+ <!-- IF not MAX_FONT_SIZE or MAX_FONT_SIZE >= 150 -->
+ <option value="150">{L_FONT_LARGE}</option>
+ <!-- IF not MAX_FONT_SIZE or MAX_FONT_SIZE >= 200 -->
+ <option value="200">{L_FONT_HUGE}</option>
+ <!-- ENDIF -->
+ <!-- ENDIF -->
+ </select>
+ <!-- EVENT acp_posting_buttons_custom_tags_before -->
+ <!-- BEGIN custom_tags -->
+ <input type="button" class="button2" name="addbbcode{custom_tags.BBCODE_ID}" value="{custom_tags.BBCODE_TAG}" onclick="bbstyle({custom_tags.BBCODE_ID})" title="{custom_tags.BBCODE_HELPLINE}" />
+ <!-- END custom_tags -->
+</div>
+<!-- EVENT acp_posting_buttons_after -->
diff --git a/phpBB/adm/style/acp_profile.html b/phpBB/adm/style/acp_profile.html
index 1c9c038f8f..bd3935b464 100644
--- a/phpBB/adm/style/acp_profile.html
+++ b/phpBB/adm/style/acp_profile.html
@@ -1,6 +1,6 @@
<!-- INCLUDE overall_header.html -->
-<a name="maincontent"></a>
+<a id="maincontent"></a>
<!-- IF S_EDIT -->
@@ -17,29 +17,29 @@
</div>
<!-- ENDIF -->
- <form id="add_profile_field" method="post" action="{U_ACTION}">
+ <form id="add_profile_field" method="post" action="{U_ACTION}"{S_FORM_ENCTYPE}>
<!-- IF S_STEP_ONE -->
<fieldset>
<legend>{L_TITLE}</legend>
<dl>
- <dt><label>{L_FIELD_TYPE}:</label><br /><span>{L_FIELD_TYPE_EXPLAIN}</span></dt>
+ <dt><label>{L_FIELD_TYPE}{L_COLON}</label><br /><span>{L_FIELD_TYPE_EXPLAIN}</span></dt>
<dd><strong>{FIELD_TYPE}</strong></dd>
</dl>
<!-- IF S_EDIT_MODE -->
<dl>
- <dt><label>{L_FIELD_IDENT}:</label><br /><span>{L_FIELD_IDENT_EXPLAIN}</span></dt>
+ <dt><label>{L_FIELD_IDENT}{L_COLON}</label><br /><span>{L_FIELD_IDENT_EXPLAIN}</span></dt>
<dd><input type="hidden" name="field_ident" value="{FIELD_IDENT}" /><strong>{FIELD_IDENT}</strong></dd>
</dl>
<!-- ELSE -->
<dl>
- <dt><label for="field_ident">{L_FIELD_IDENT}:</label><br /><span>{L_FIELD_IDENT_EXPLAIN}</span></dt>
+ <dt><label for="field_ident">{L_FIELD_IDENT}{L_COLON}</label><br /><span>{L_FIELD_IDENT_EXPLAIN}</span></dt>
<dd><input class="text medium" type="text" id="field_ident" name="field_ident" value="{FIELD_IDENT}" /></dd>
</dl>
<!-- ENDIF -->
<dl>
- <dt><label for="field_no_view">{L_DISPLAY_PROFILE_FIELD}:</label><br /><span>{L_DISPLAY_PROFILE_FIELD_EXPLAIN}</span></dt>
+ <dt><label for="field_no_view">{L_DISPLAY_PROFILE_FIELD}{L_COLON}</label><br /><span>{L_DISPLAY_PROFILE_FIELD_EXPLAIN}</span></dt>
<dd><label><input type="radio" class="radio" id="field_no_view" name="field_no_view" value="0"<!-- IF not S_FIELD_NO_VIEW --> checked="checked"<!-- ENDIF --> /> {L_YES}</label>
<label><input type="radio" class="radio" name="field_no_view" value="1"<!-- IF S_FIELD_NO_VIEW --> checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd>
</dl>
@@ -48,29 +48,45 @@
<fieldset>
<legend>{L_VISIBILITY_OPTION}</legend>
<dl>
- <dt><label for="field_show_profile">{L_DISPLAY_AT_PROFILE}:</label><br /><span>{L_DISPLAY_AT_PROFILE_EXPLAIN}</span></dt>
+ <dt><label for="field_show_profile">{L_DISPLAY_AT_PROFILE}{L_COLON}</label><br /><span>{L_DISPLAY_AT_PROFILE_EXPLAIN}</span></dt>
<dd><input type="checkbox" class="radio" id="field_show_profile" name="field_show_profile" value="1"<!-- IF S_SHOW_PROFILE --> checked="checked"<!-- ENDIF --> /></dd>
</dl>
<dl>
- <dt><label for="field_show_on_reg">{L_DISPLAY_AT_REGISTER}:</label><br /><span>{L_DISPLAY_AT_REGISTER_EXPLAIN}</span></dt>
+ <dt><label for="field_show_on_reg">{L_DISPLAY_AT_REGISTER}{L_COLON}</label><br /><span>{L_DISPLAY_AT_REGISTER_EXPLAIN}</span></dt>
<dd><input type="checkbox" class="radio" id="field_show_on_reg" name="field_show_on_reg" value="1"<!-- IF S_SHOW_ON_REG --> checked="checked"<!-- ENDIF --> /></dd>
</dl>
<dl>
- <dt><label for="field_show_on_vt">{L_DISPLAY_ON_VT}:</label><br /><span>{L_DISPLAY_ON_VT_EXPLAIN}</span></dt>
+ <dt><label for="field_show_on_pm">{L_DISPLAY_ON_PM}{L_COLON}</label><br /><span>{L_DISPLAY_ON_PM_EXPLAIN}</span></dt>
+ <dd><input type="checkbox" class="radio" id="field_show_on_pm" name="field_show_on_pm" value="1"<!-- IF S_SHOW_ON_PM --> checked="checked"<!-- ENDIF --> /></dd>
+ </dl>
+ <dl>
+ <dt><label for="field_show_on_vt">{L_DISPLAY_ON_VT}{L_COLON}</label><br /><span>{L_DISPLAY_ON_VT_EXPLAIN}</span></dt>
<dd><input type="checkbox" class="radio" id="field_show_on_vt" name="field_show_on_vt" value="1"<!-- IF S_SHOW_ON_VT --> checked="checked"<!-- ENDIF --> /></dd>
</dl>
<dl>
- <dt><label for="field_required">{L_REQUIRED_FIELD}:</label><br /><span>{L_REQUIRED_FIELD_EXPLAIN}</span></dt>
+ <dt><label for="field_show_on_ml">{L_DISPLAY_ON_MEMBERLIST}{L_COLON}</label><br /><span>{L_DISPLAY_ON_MEMBERLIST_EXPLAIN}</span></dt>
+ <dd><input type="checkbox" class="radio" id="field_show_on_ml" name="field_show_on_ml" value="1"<!-- IF S_SHOW_ON_MEMBERLIST --> checked="checked"<!-- ENDIF --> /></dd>
+ </dl>
+ <dl>
+ <dt><label for="field_required">{L_REQUIRED_FIELD}{L_COLON}</label><br /><span>{L_REQUIRED_FIELD_EXPLAIN}</span></dt>
<dd><input type="checkbox" class="radio" id="field_required" name="field_required" value="1"<!-- IF S_FIELD_REQUIRED --> checked="checked"<!-- ENDIF --> /></dd>
</dl>
<dl>
- <dt><label for="field_show_novalue">{L_SHOW_NOVALUE_FIELD}:</label><br /><span>{L_SHOW_NOVALUE_FIELD_EXPLAIN}</span></dt>
+ <dt><label for="field_show_novalue">{L_SHOW_NOVALUE_FIELD}{L_COLON}</label><br /><span>{L_SHOW_NOVALUE_FIELD_EXPLAIN}</span></dt>
<dd><input type="checkbox" class="radio" id="field_show_novalue" name="field_show_novalue" value="1"<!-- IF S_FIELD_SHOW_NOVALUE --> checked="checked"<!-- ENDIF --> /></dd>
</dl>
<dl>
- <dt><label for="field_hide">{L_HIDE_PROFILE_FIELD}:</label><br /><span>{L_HIDE_PROFILE_FIELD_EXPLAIN}</span></dt>
+ <dt><label for="field_hide">{L_HIDE_PROFILE_FIELD}{L_COLON}</label><br /><span>{L_HIDE_PROFILE_FIELD_EXPLAIN}</span></dt>
<dd><input type="checkbox" class="radio" id="field_hide" name="field_hide" value="1"<!-- IF S_FIELD_HIDE --> checked="checked"<!-- ENDIF --> /></dd>
</dl>
+ <!-- EVENT acp_profile_contact_before -->
+ <dl>
+ <dt><label for="field_is_contact">{L_FIELD_IS_CONTACT}{L_COLON}</label><br /><span>{L_FIELD_IS_CONTACT_EXPLAIN}</span></dt>
+ <dd><input type="checkbox" class="radio" id="field_is_contact" name="field_is_contact" value="1"<!-- IF S_FIELD_CONTACT --> checked="checked"<!-- ENDIF --> /></dd>
+ <dd><input class="text medium" type="text" name="field_contact_desc" id="field_contact_desc" value="{FIELD_CONTACT_DESC}" /> <label for="field_contact_desc">{L_FIELD_CONTACT_DESC}</label></dd>
+ <dd><input class="text medium" type="text" name="field_contact_url" id="field_contact_url" value="{FIELD_CONTACT_URL}" /> <label for="field_contact_url">{L_FIELD_CONTACT_URL}</label></dd>
+ <!-- EVENT acp_profile_contact_last -->
+ </dl>
</fieldset>
<!-- IF S_EDIT_MODE -->
@@ -82,22 +98,22 @@
<fieldset>
<legend>{L_LANG_SPECIFIC}</legend>
<dl>
- <dt><label for="lang_name">{L_USER_FIELD_NAME}:</label></dt>
+ <dt><label for="lang_name">{L_USER_FIELD_NAME}{L_COLON}</label></dt>
<dd><input class="text medium" type="text" id="lang_name" name="lang_name" value="{LANG_NAME}" /></dd>
</dl>
<dl>
- <dt><label for="lang_explain">{L_FIELD_DESCRIPTION}:</label><br /><span>{L_FIELD_DESCRIPTION_EXPLAIN}</span></dt>
+ <dt><label for="lang_explain">{L_FIELD_DESCRIPTION}{L_COLON}</label><br /><span>{L_FIELD_DESCRIPTION_EXPLAIN}</span></dt>
<dd><textarea id="lang_explain" name="lang_explain" rows="3" cols="80">{LANG_EXPLAIN}</textarea></dd>
</dl>
<!-- IF S_TEXT or S_STRING -->
<dl>
- <dt><label for="lang_default_value">{L_DEFAULT_VALUE}:</label><br /><span>{L_DEFAULT_VALUE_EXPLAIN}</span></dt>
+ <dt><label for="lang_default_value">{L_DEFAULT_VALUE}{L_COLON}</label><br /><span>{L_DEFAULT_VALUE_EXPLAIN}</span></dt>
<dd><!-- IF S_STRING --><input class="text medium" type="text" id="lang_default_value" name="lang_default_value" value="{LANG_DEFAULT_VALUE}" /><!-- ELSE --><textarea id="lang_default_value" name="lang_default_value" rows="5" cols="80">{LANG_DEFAULT_VALUE}</textarea><!-- ENDIF --></dd>
</dl>
<!-- ENDIF -->
<!-- IF S_BOOL or S_DROPDOWN -->
<dl>
- <dt><label for="lang_options">{L_ENTRIES}:</label>
+ <dt><label for="lang_options">{L_ENTRIES}{L_COLON}</label>
<!-- IF S_EDIT_MODE and S_DROPDOWN -->
<br /><span>{L_EDIT_DROPDOWN_LANG_EXPLAIN}</span>
<!-- ELSE -->
@@ -112,6 +128,7 @@
<!-- ENDIF -->
</dl>
<!-- ENDIF -->
+ <!-- EVENT acp_profile_step_one_lang_after -->
</fieldset>
<fieldset class="quick">
@@ -126,7 +143,7 @@
<legend>{L_TITLE}</legend>
<!-- BEGIN option -->
<dl>
- <dt><label>{option.TITLE}:</label><!-- IF option.EXPLAIN --><br /><span>{option.EXPLAIN}</span><!-- ENDIF --></dt>
+ <dt><label>{option.TITLE}{L_COLON}</label><!-- IF option.EXPLAIN --><br /><span>{option.EXPLAIN}</span><!-- ENDIF --></dt>
<dd>{option.FIELD}</dd>
</dl>
<!-- END option -->
@@ -149,7 +166,7 @@
<legend>{options.LANGUAGE}</legend>
<!-- BEGIN field -->
<dl>
- <dt><label>{options.field.L_TITLE}:</label><!-- IF options.field.L_EXPLAIN --><br /><span>{options.field.L_EXPLAIN}</span><!-- ENDIF --></dt>
+ <dt><label>{options.field.L_TITLE}{L_COLON}</label><!-- IF options.field.L_EXPLAIN --><br /><span>{options.field.L_EXPLAIN}</span><!-- ENDIF --></dt>
{options.field.FIELD}
</dl>
<!-- END field -->
@@ -181,7 +198,7 @@
</div>
<!-- ENDIF -->
- <table cellspacing="1">
+ <table class="table1 zebra-table">
<thead>
<tr>
<th>{L_FIELD_IDENT}</th>
@@ -191,29 +208,22 @@
</thead>
<tbody>
<!-- BEGIN fields -->
- <!-- IF fields.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
-
+ <tr>
<td>{fields.FIELD_IDENT}</td>
<td>{fields.FIELD_TYPE}</td>
- <td style="text-align: center;"><a href="{fields.U_ACTIVATE_DEACTIVATE}">{fields.L_ACTIVATE_DEACTIVATE}</a><!-- IF fields.S_NEED_EDIT --> | <a href="{fields.U_TRANSLATE}" style="color: red;">{L_TRANSLATE}</a><!-- ENDIF --></td>
-
- <td style="width: 80px; text-align: right; white-space: nowrap;">
- <!-- IF fields.S_FIRST_ROW && not fields.S_LAST_ROW -->
- {ICON_MOVE_UP_DISABLED}
- <a href="{fields.U_MOVE_DOWN}">{ICON_MOVE_DOWN}</a>
- <!-- ELSEIF not fields.S_FIRST_ROW && not fields.S_LAST_ROW-->
- <a href="{fields.U_MOVE_UP}">{ICON_MOVE_UP}</a>
- <a href="{fields.U_MOVE_DOWN}">{ICON_MOVE_DOWN}</a>
- <!-- ELSEIF fields.S_LAST_ROW && not fields.S_FIRST_ROW -->
- <a href="{fields.U_MOVE_UP}">{ICON_MOVE_UP}</a>
- {ICON_MOVE_DOWN_DISABLED}
- <!-- ENDIF -->
+ <td style="text-align: center;"><a href="{fields.U_ACTIVATE_DEACTIVATE}" data-ajax="activate_deactivate">{fields.L_ACTIVATE_DEACTIVATE}</a><!-- IF fields.S_NEED_EDIT --> | <a href="{fields.U_TRANSLATE}" style="color: red;">{L_TRANSLATE}</a><!-- ENDIF --></td>
+
+ <td class="actions" style="width: 80px;">
+ <span class="up-disabled" style="display:none;">{ICON_MOVE_UP_DISABLED}</span>
+ <span class="up"><a href="{fields.U_MOVE_UP}" data-ajax="row_up">{ICON_MOVE_UP}</a></span>
+ <span class="down-disabled" style="display:none;">{ICON_MOVE_DOWN_DISABLED}</span>
+ <span class="down"><a href="{fields.U_MOVE_DOWN}" data-ajax="row_down">{ICON_MOVE_DOWN}</a></span>
<!-- IF not fields.S_NEED_EDIT -->
<a href="{fields.U_EDIT}">{ICON_EDIT}</a>
<!-- ELSE -->
{ICON_EDIT_DISABLED}
<!-- ENDIF -->
- <a href="{fields.U_DELETE}">{ICON_DELETE}</a>
+ <a href="{fields.U_DELETE}" data-ajax="row_delete">{ICON_DELETE}</a>
</td>
</tr>
diff --git a/phpBB/adm/style/acp_prune_forums.html b/phpBB/adm/style/acp_prune_forums.html
index 069d2c91c3..b8c681ea00 100644
--- a/phpBB/adm/style/acp_prune_forums.html
+++ b/phpBB/adm/style/acp_prune_forums.html
@@ -1,6 +1,6 @@
<!-- INCLUDE overall_header.html -->
-<a name="maincontent"></a>
+<a id="maincontent"></a>
<!-- IF S_PRUNED -->
@@ -8,7 +8,7 @@
<p>{L_PRUNE_SUCCESS}</p>
- <table cellspacing="1">
+ <table class="table1 zebra-table">
<thead>
<tr>
<th>{L_FORUM}</th>
@@ -18,7 +18,7 @@
</thead>
<tbody>
<!-- BEGIN pruned -->
- <!-- IF pruned.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
+ <tr>
<td style="text-align: center;">{pruned.FORUM_NAME}</td>
<td style="text-align: center;">{pruned.NUM_TOPICS}</td>
<td style="text-align: center;">{pruned.NUM_POSTS}</td>
@@ -43,7 +43,7 @@
<legend>{L_SELECT_FORUM}</legend>
<p>{L_LOOK_UP_FORUMS_EXPLAIN}</p>
<dl>
- <dt><label for="forum">{L_LOOK_UP_FORUM}:</label></dt>
+ <dt><!-- EVENT acp_prune_forums_prepend --><label for="forum">{L_LOOK_UP_FORUM}{L_COLON}</label><!-- EVENT acp_prune_forums_append --></dt>
<dd><select id="forum" name="f[]" multiple="multiple" size="10">{S_FORUM_OPTIONS}</select></dd>
<dd><label><input type="checkbox" class="radio" name="all_forums" value="1" /> {L_ALL_FORUMS}</label></dd>
</dl>
@@ -65,32 +65,32 @@
<h2>{L_FORUM}</h2>
- <p>{L_SELECTED_FORUMS}: {FORUM_LIST}</p>
+ <p>{L_SELECTED_FORUMS}{L_COLON} {FORUM_LIST}</p>
<form id="acp_prune" method="post" action="{U_ACTION}">
<fieldset>
<legend>{L_FORUM_PRUNE}</legend>
<dl>
- <dt><label for="prune_days">{L_PRUNE_NOT_POSTED}:</label></dt>
- <dd><input type="text" id="prune_days" name="prune_days" /></dd>
+ <dt><label for="prune_days">{L_PRUNE_NOT_POSTED}{L_COLON}</label></dt>
+ <dd><input type="number" id="prune_days" name="prune_days" /></dd>
</dl>
<dl>
- <dt><label for="prune_vieweddays">{L_PRUNE_NOT_VIEWED}:</label></dt>
- <dd><input type="text" id="prune_vieweddays" name="prune_vieweddays" /></dd>
+ <dt><label for="prune_vieweddays">{L_PRUNE_NOT_VIEWED}{L_COLON}</label></dt>
+ <dd><input type="number" id="prune_vieweddays" name="prune_vieweddays" /></dd>
</dl>
<dl>
- <dt><label for="polls">{L_PRUNE_OLD_POLLS}:</label><br /><span>{L_PRUNE_OLD_POLLS_EXPLAIN}</span></dt>
+ <dt><label for="polls">{L_PRUNE_OLD_POLLS}{L_COLON}</label><br /><span>{L_PRUNE_OLD_POLLS_EXPLAIN}</span></dt>
<dd><label><input type="radio" class="radio" name="prune_old_polls" value="1" /> {L_YES}</label>
<label><input type="radio" class="radio" id="polls" name="prune_old_polls" value="0" checked="checked" /> {L_NO}</label></dd>
</dl>
<dl>
- <dt><label for="announce">{L_PRUNE_ANNOUNCEMENTS}:</label></dt>
+ <dt><label for="announce">{L_PRUNE_ANNOUNCEMENTS}{L_COLON}</label></dt>
<dd><label><input type="radio" class="radio" name="prune_announce" value="1" /> {L_YES}</label>
<label><input type="radio" class="radio" id="announce" name="prune_announce" value="0" checked="checked" /> {L_NO}</label></dd>
</dl>
<dl>
- <dt><label for="sticky">{L_PRUNE_STICKY}:</label></dt>
+ <dt><label for="sticky">{L_PRUNE_STICKY}{L_COLON}</label></dt>
<dd><label><input type="radio" class="radio" name="prune_sticky" value="1" /> {L_YES}</label>
<label><input type="radio" class="radio" id="sticky" name="prune_sticky" value="0" checked="checked" /> {L_NO}</label></dd>
</dl>
diff --git a/phpBB/adm/style/acp_prune_users.html b/phpBB/adm/style/acp_prune_users.html
index 0f2b23dcef..6e8b2e4214 100644
--- a/phpBB/adm/style/acp_prune_users.html
+++ b/phpBB/adm/style/acp_prune_users.html
@@ -1,6 +1,6 @@
<!-- INCLUDE overall_header.html -->
-<a name="maincontent"></a>
+<a id="maincontent"></a>
<h1>{L_ACP_PRUNE_USERS}</h1>
@@ -9,39 +9,60 @@
<form id="acp_prune" method="post" action="{U_ACTION}">
<fieldset>
- <legend>{L_ACP_PRUNE_USERS}</legend>
+ <legend>{L_CRITERIA}</legend>
<dl>
- <dt><label for="username">{L_USERNAME}:</label></dt>
+ <dt><label for="username">{L_USERNAME}{L_COLON}</label></dt>
<dd><input type="text" id="username" name="username" /></dd>
</dl>
<dl>
- <dt><label for="email">{L_EMAIL}:</label></dt>
+ <dt><label for="email">{L_EMAIL}{L_COLON}</label></dt>
<dd><input type="text" id="email" name="email" /></dd>
</dl>
<dl>
- <dt><label for="joined">{L_JOINED}:</label><br /><span>{L_JOINED_EXPLAIN}</span></dt>
- <dd><select name="joined_select">{S_JOINED_OPTIONS}</select> <input type="text" id="joined" name="joined" /></dd>
+ <dt><label for="joined_after">{L_JOINED}{L_COLON}</label><br /><span>{L_JOINED_EXPLAIN}</span></dt>
+ <dd>
+ <strong>{L_AFTER}</strong> <input type="text" id="joined_after" name="joined_after" />
+ <br /> <br /> <strong>{L_BEFORE}</strong> <input type="text" id="joined_before" name="joined_before" />
+ </dd>
</dl>
<dl>
- <dt><label for="active">{L_LAST_ACTIVE}:</label><br /><span>{L_LAST_ACTIVE_EXPLAIN}</span></dt>
+ <dt><label for="active">{L_LAST_ACTIVE}{L_COLON}</label><br /><span>{L_LAST_ACTIVE_EXPLAIN}</span></dt>
<dd><select name="active_select">{S_ACTIVE_OPTIONS}</select> <input type="text" id="active" name="active" /></dd>
</dl>
<dl>
- <dt><label for="count">{L_POSTS}:</label></dt>
- <dd><select name="count_select">{S_COUNT_OPTIONS}</select> <input type="text" id="count" name="count" /></dd>
+ <dt><label for="count">{L_POSTS}{L_COLON}</label></dt>
+ <dd><select name="count_select">{S_COUNT_OPTIONS}</select> <input type="number" id="count" name="count" /></dd>
</dl>
<dl>
- <dt><label for="users">{L_ACP_PRUNE_USERS}:</label><br /><span>{L_SELECT_USERS_EXPLAIN}</span></dt>
+ <dt><label for="posts_on_queue">{L_POSTS_ON_QUEUE}{L_COLON}</label></dt>
+ <dd><select name="queue_select">{S_COUNT_OPTIONS}</select> <input type="number" id="posts_on_queue" name="posts_on_queue" /></dd>
+</dl>
+<!-- IF S_GROUP_LIST -->
+<dl>
+ <dt><label for="group_id">{L_GROUP}{L_COLON}</label><br /><span>{L_PRUNE_USERS_GROUP_EXPLAIN}</span></dt>
+ <dd><select id="group_id" name="group_id">{S_GROUP_LIST}</select></dd>
+</dl>
+<!-- ENDIF -->
+</fieldset>
+
+<fieldset>
+ <legend>{L_USERNAMES}</legend>
+<dl>
+ <dt><label for="users">{L_ACP_PRUNE_USERS}{L_COLON}</label><br /><span>{L_SELECT_USERS_EXPLAIN}</span></dt>
<dd><textarea id="users" name="users" cols="40" rows="5"></textarea></dd>
- <dd>[ <a href="{U_FIND_USERNAME}" onclick="find_username(this.href); return false;">{L_FIND_USERNAME}</a> ]</dd>
+ <dd><!-- EVENT acp_prune_users_find_username_prepend -->[ <a href="{U_FIND_USERNAME}" onclick="find_username(this.href); return false;">{L_FIND_USERNAME}</a> ]<!-- EVENT acp_prune_users_find_username_append --></dd>
</dl>
+</fieldset>
+
+<fieldset>
+ <legend>{L_OPTIONS}</legend>
<dl>
- <dt><label for="deleteposts">{L_DELETE_USER_POSTS}:</label><br /><span>{L_DELETE_USER_POSTS_EXPLAIN}</span></dt>
+ <dt><label for="deleteposts">{L_DELETE_USER_POSTS}{L_COLON}</label><br /><span>{L_DELETE_USER_POSTS_EXPLAIN}</span></dt>
<dd><label><input type="radio" class="radio" name="deleteposts" value="1" /> {L_YES}</label>
<label><input type="radio" class="radio" id="deleteposts" name="deleteposts" value="0" checked="checked" /> {L_NO}</label></dd>
</dl>
<dl>
- <dt><label for="deactivate">{L_DEACTIVATE_DELETE}:</label><br /><span>{L_DEACTIVATE_DELETE_EXPLAIN}</span></dt>
+ <dt><label for="deactivate">{L_DEACTIVATE_DELETE}{L_COLON}</label><br /><span>{L_DEACTIVATE_DELETE_EXPLAIN}</span></dt>
<dd><label><input type="radio" class="radio" name="action" value="delete" /> {L_DELETE_USERS}</label>
<label><input type="radio" class="radio" id="deactivate" name="action" value="deactivate" checked="checked" /> {L_DEACTIVATE}</label></dd>
</dl>
diff --git a/phpBB/adm/style/acp_ranks.html b/phpBB/adm/style/acp_ranks.html
index 1f45109517..e67c9acd80 100644
--- a/phpBB/adm/style/acp_ranks.html
+++ b/phpBB/adm/style/acp_ranks.html
@@ -1,6 +1,6 @@
<!-- INCLUDE overall_header.html -->
-<a name="maincontent"></a>
+<a id="maincontent"></a>
<!-- IF S_EDIT -->
@@ -24,27 +24,32 @@
<fieldset>
<legend>{L_ACP_RANKS}</legend>
+
+ <!-- EVENT acp_ranks_edit_before -->
+
<dl>
- <dt><label for="title">{L_RANK_TITLE}:</label></dt>
+ <dt><label for="title">{L_RANK_TITLE}{L_COLON}</label></dt>
<dd><input name="title" type="text" id="title" value="{RANK_TITLE}" maxlength="255" /></dd>
</dl>
<dl>
- <dt><label for="rank_image">{L_RANK_IMAGE}:</label></dt>
+ <dt><label for="rank_image">{L_RANK_IMAGE}{L_COLON}</label></dt>
<dd><select name="rank_image" id="rank_image" onchange="update_image(this.options[selectedIndex].value);">{S_FILENAME_LIST}</select></dd>
<dd><img src="{RANK_IMAGE}" id="image" alt="" /></dd>
</dl>
<dl>
- <dt><label for="special_rank">{L_RANK_SPECIAL}:</label></dt>
- <dd><label><input onclick="dE('posts', -1)" type="radio" class="radio" name="special_rank" value="1" id="special_rank"<!-- IF S_SPECIAL_RANK --> checked="checked"<!-- ENDIF --> /> {L_YES}</label>
- <label><input onclick="dE('posts', 1)" type="radio" class="radio" name="special_rank" value="0"<!-- IF not S_SPECIAL_RANK --> checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd>
+ <dt><label for="special_rank">{L_RANK_SPECIAL}{L_COLON}</label></dt>
+ <dd><label><input onclick="phpbb.toggleDisplay('posts', -1)" type="radio" class="radio" name="special_rank" value="1" id="special_rank"<!-- IF S_SPECIAL_RANK --> checked="checked"<!-- ENDIF --> /> {L_YES}</label>
+ <label><input onclick="phpbb.toggleDisplay('posts', 1)" type="radio" class="radio" name="special_rank" value="0"<!-- IF not S_SPECIAL_RANK --> checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd>
</dl>
- <!-- IF S_SPECIAL_RANK --><div id="posts" style="display: none;"><!-- ELSE --><div id="posts"><!-- ENDIF -->
+ <div id="posts"<!-- IF S_SPECIAL_RANK --> style="display: none;"<!-- ENDIF -->>
<dl>
- <dt><label for="min_posts">{L_RANK_MINIMUM}:</label></dt>
- <dd><input name="min_posts" type="text" id="min_posts" maxlength="10" value="{MIN_POSTS}" /></dd>
+ <dt><label for="min_posts">{L_RANK_MINIMUM}{L_COLON}</label></dt>
+ <dd><input name="min_posts" type="number" id="min_posts" min="0" max="9999999999" value="{MIN_POSTS}" /></dd>
</dl>
</div>
+ <!-- EVENT acp_ranks_edit_after -->
+
<p class="submit-buttons">
<input type="hidden" name="action" value="save" />
@@ -65,22 +70,26 @@
<fieldset class="tabulated">
<legend>{L_ACP_MANAGE_RANKS}</legend>
- <table cellspacing="1">
+ <table class="table1 zebra-table">
<thead>
<tr>
+ <!-- EVENT acp_ranks_list_header_before -->
<th>{L_RANK_IMAGE}</th>
<th>{L_RANK_TITLE}</th>
<th>{L_RANK_MINIMUM}</th>
+ <!-- EVENT acp_ranks_list_header_after -->
<th>{L_ACTION}</th>
</tr>
</thead>
<tbody>
<!-- BEGIN ranks -->
- <!-- IF ranks.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
+ <tr>
+ <!-- EVENT acp_ranks_list_column_before -->
<td style="text-align: center;"><!-- IF ranks.S_RANK_IMAGE --><img src="{ranks.RANK_IMAGE}" alt="{ranks.RANK_TITLE}" title="{ranks.RANK_TITLE}" /><!-- ELSE -->&nbsp; - &nbsp;<!-- ENDIF --></td>
<td style="text-align: center;">{ranks.RANK_TITLE}</td>
<td style="text-align: center;"><!-- IF ranks.S_SPECIAL_RANK -->&nbsp; - &nbsp;<!-- ELSE -->{ranks.MIN_POSTS}<!-- ENDIF --></td>
- <td style="text-align: center;"><a href="{ranks.U_EDIT}">{ICON_EDIT}</a> <a href="{ranks.U_DELETE}">{ICON_DELETE}</a></td>
+ <!-- EVENT acp_ranks_list_column_after -->
+ <td style="text-align: center;"><a href="{ranks.U_EDIT}">{ICON_EDIT}</a> <a href="{ranks.U_DELETE}" data-ajax="row_delete">{ICON_DELETE}</a></td>
</tr>
<!-- END ranks -->
</tbody>
diff --git a/phpBB/adm/style/acp_reasons.html b/phpBB/adm/style/acp_reasons.html
index 23fcfbdeb8..d629a9553f 100644
--- a/phpBB/adm/style/acp_reasons.html
+++ b/phpBB/adm/style/acp_reasons.html
@@ -1,6 +1,6 @@
<!-- INCLUDE overall_header.html -->
-<a name="maincontent"></a>
+<a id="maincontent"></a>
<!-- IF S_EDIT_REASON -->
@@ -29,7 +29,7 @@
<legend>{L_TITLE}</legend>
<p><!-- IF S_TRANSLATED -->{L_IS_TRANSLATED_EXPLAIN}<!-- ELSE -->{L_IS_NOT_TRANSLATED_EXPLAIN}<!-- ENDIF --></p>
<dl>
- <dt><label for="reason_title">{L_REASON_TITLE}:</label></dt>
+ <dt><label for="reason_title">{L_REASON_TITLE}{L_COLON}</label></dt>
<dd><input name="reason_title" type="text" id="reason_title" value="{REASON_TITLE}" maxlength="255" /></dd>
</dl>
<!-- IF S_TRANSLATED -->
@@ -39,7 +39,7 @@
</dl>
<!-- ENDIF -->
<dl>
- <dt><label for="reason_description">{L_REASON_DESCRIPTION}:</label></dt>
+ <dt><label for="reason_description">{L_REASON_DESCRIPTION}{L_COLON}</label></dt>
<dd><textarea name="reason_description" id="reason_description" rows="8" cols="80">{REASON_DESCRIPTION}</textarea></dd>
</dl>
<!-- IF S_TRANSLATED -->
@@ -68,7 +68,7 @@
<legend>{L_ACP_REASONS}</legend>
<!-- IF .reasons -->
- <table cellspacing="1">
+ <table class="table1">
<col class="row1" /><col class="row1" /><col class="row2" />
<thead>
<tr>
@@ -86,20 +86,14 @@
<br /><span>{reasons.REASON_DESCRIPTION}</span>
</td>
<td style="width: 100px;">{reasons.REASON_COUNT}</td>
- <td style="width: 80px; text-align: right; white-space: nowrap;">
- <!-- IF reasons.S_FIRST_ROW && not reasons.S_LAST_ROW -->
- {ICON_MOVE_UP_DISABLED}
- <a href="{reasons.U_MOVE_DOWN}">{ICON_MOVE_DOWN}</a>
- <!-- ELSEIF not reasons.S_FIRST_ROW && not reasons.S_LAST_ROW-->
- <a href="{reasons.U_MOVE_UP}">{ICON_MOVE_UP}</a>
- <a href="{reasons.U_MOVE_DOWN}">{ICON_MOVE_DOWN}</a>
- <!-- ELSEIF reasons.S_LAST_ROW && not reasons.S_FIRST_ROW -->
- <a href="{reasons.U_MOVE_UP}">{ICON_MOVE_UP}</a>
- {ICON_MOVE_DOWN_DISABLED}
- <!-- ENDIF -->
+ <td class="actions" style="width: 80px;">
+ <span class="up-disabled" style="display:none;">{ICON_MOVE_UP_DISABLED}</span>
+ <span class="up"><a href="{reasons.U_MOVE_UP}" data-ajax="row_up">{ICON_MOVE_UP}</a></span>
+ <span class="down-disabled" style="display:none;">{ICON_MOVE_DOWN_DISABLED}</span>
+ <span class="down"><a href="{reasons.U_MOVE_DOWN}" data-ajax="row_down">{ICON_MOVE_DOWN}</a></span>
<a href="{reasons.U_EDIT}">{ICON_EDIT}</a>
<!-- IF reasons.U_DELETE -->
- <a href="{reasons.U_DELETE}">{ICON_DELETE}</a>
+ <a href="{reasons.U_DELETE}" data-ajax="row_delete">{ICON_DELETE}</a>
<!-- ELSE -->
{ICON_DELETE_DISABLED}
<!-- ENDIF -->
diff --git a/phpBB/adm/style/acp_search.html b/phpBB/adm/style/acp_search.html
index 5fd7a23d97..f7ad3c5e89 100644
--- a/phpBB/adm/style/acp_search.html
+++ b/phpBB/adm/style/acp_search.html
@@ -1,6 +1,6 @@
<!-- INCLUDE overall_header.html -->
-<a name="maincontent"></a>
+<a id="maincontent"></a>
<!-- IF S_SETTINGS -->
<h1>{L_ACP_SEARCH_SETTINGS}</h1>
@@ -12,47 +12,47 @@
<fieldset>
<legend>{L_GENERAL_SEARCH_SETTINGS}</legend>
<dl>
- <dt><label for="load_search">{L_YES_SEARCH}:</label><br /><span>{L_YES_SEARCH_EXPLAIN}</span></dt>
+ <dt><label for="load_search">{L_YES_SEARCH}{L_COLON}</label><br /><span>{L_YES_SEARCH_EXPLAIN}</span></dt>
<dd><label><input type="radio" class="radio" id="load_search" name="config[load_search]" value="1"<!-- IF S_YES_SEARCH --> checked="checked"<!-- ENDIF --> /> {L_YES}</label>
<label><input type="radio" class="radio" name="config[load_search]" value="0"<!-- IF not S_YES_SEARCH --> checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd>
</dl>
<dl>
- <dt><label for="search_interval">{L_SEARCH_INTERVAL}:</label><br /><span>{L_SEARCH_INTERVAL_EXPLAIN}</span></dt>
- <dd><input id="search_interval" type="text" size="4" maxlength="4" name="config[search_interval]" value="{SEARCH_INTERVAL}" /> {L_SECONDS}</dd>
+ <dt><label for="search_interval">{L_SEARCH_INTERVAL}{L_COLON}</label><br /><span>{L_SEARCH_INTERVAL_EXPLAIN}</span></dt>
+ <dd><input id="search_interval" type="number" min="0" max="9999" name="config[search_interval]" value="{SEARCH_INTERVAL}" /> {L_SECONDS}</dd>
</dl>
<dl>
- <dt><label for="search_anonymous_interval">{L_SEARCH_GUEST_INTERVAL}:</label><br /><span>{L_SEARCH_GUEST_INTERVAL_EXPLAIN}</span></dt>
- <dd><input id="search_anonymous_interval" type="text" size="4" maxlength="4" name="config[search_anonymous_interval]" value="{SEARCH_GUEST_INTERVAL}" /> {L_SECONDS}</dd>
+ <dt><label for="search_anonymous_interval">{L_SEARCH_GUEST_INTERVAL}{L_COLON}</label><br /><span>{L_SEARCH_GUEST_INTERVAL_EXPLAIN}</span></dt>
+ <dd><input id="search_anonymous_interval" type="number" min="0" max="9999" name="config[search_anonymous_interval]" value="{SEARCH_GUEST_INTERVAL}" /> {L_SECONDS}</dd>
</dl>
<dl>
- <dt><label for="limit_search_load">{L_LIMIT_SEARCH_LOAD}:</label><br /><span>{L_LIMIT_SEARCH_LOAD_EXPLAIN}</span></dt>
+ <dt><label for="limit_search_load">{L_LIMIT_SEARCH_LOAD}{L_COLON}</label><br /><span>{L_LIMIT_SEARCH_LOAD_EXPLAIN}</span></dt>
<dd><input id="limit_search_load" type="text" size="4" maxlength="4" name="config[limit_search_load]" value="{LIMIT_SEARCH_LOAD}" /></dd>
</dl>
<dl>
- <dt><label for="min_search_author_chars">{L_MIN_SEARCH_AUTHOR_CHARS}:</label><br /><span>{L_MIN_SEARCH_AUTHOR_CHARS_EXPLAIN}</span></dt>
- <dd><input id="min_search_author_chars" type="text" size="4" maxlength="4" name="config[min_search_author_chars]" value="{MIN_SEARCH_AUTHOR_CHARS}" /></dd>
+ <dt><label for="min_search_author_chars">{L_MIN_SEARCH_AUTHOR_CHARS}{L_COLON}</label><br /><span>{L_MIN_SEARCH_AUTHOR_CHARS_EXPLAIN}</span></dt>
+ <dd><input id="min_search_author_chars" type="number" min="0" max="9999" name="config[min_search_author_chars]" value="{MIN_SEARCH_AUTHOR_CHARS}" /></dd>
</dl>
<dl>
- <dt><label for="max_num_search_keywords">{L_MAX_NUM_SEARCH_KEYWORDS}:</label><br /><span>{L_MAX_NUM_SEARCH_KEYWORDS_EXPLAIN}</span></dt>
- <dd><input id="max_num_search_keywords" type="text" size="4" maxlength="4" name="config[max_num_search_keywords]" value="{MAX_NUM_SEARCH_KEYWORDS}" /></dd>
+ <dt><label for="max_num_search_keywords">{L_MAX_NUM_SEARCH_KEYWORDS}{L_COLON}</label><br /><span>{L_MAX_NUM_SEARCH_KEYWORDS_EXPLAIN}</span></dt>
+ <dd><input id="max_num_search_keywords" type="number" min="0" max="9999" name="config[max_num_search_keywords]" value="{MAX_NUM_SEARCH_KEYWORDS}" /></dd>
</dl>
<dl>
- <dt><label for="search_store_results">{L_SEARCH_STORE_RESULTS}:</label><br /><span>{L_SEARCH_STORE_RESULTS_EXPLAIN}</span></dt>
- <dd><input id="search_store_results" type="text" size="4" maxlength="6" name="config[search_store_results]" value="{SEARCH_STORE_RESULTS}" /> {L_SECONDS}</dd>
+ <dt><label for="search_store_results">{L_SEARCH_STORE_RESULTS}{L_COLON}</label><br /><span>{L_SEARCH_STORE_RESULTS_EXPLAIN}</span></dt>
+ <dd><input id="search_store_results" type="number" min="0" max="999999" name="config[search_store_results]" value="{SEARCH_STORE_RESULTS}" /> {L_SECONDS}</dd>
</dl>
</fieldset>
<fieldset>
<legend>{L_SEARCH_TYPE}</legend>
<dl>
- <dt><label for="search_type">{L_SEARCH_TYPE}:</label><br /><span>{L_SEARCH_TYPE_EXPLAIN}</span></dt>
- <dd><select id="search_type" name="config[search_type]">{S_SEARCH_TYPES}</select></dd>
+ <dt><label for="search_type">{L_SEARCH_TYPE}{L_COLON}</label><br /><span>{L_SEARCH_TYPE_EXPLAIN}</span></dt>
+ <dd><select id="search_type" name="config[search_type]" data-togglable-settings="true">{S_SEARCH_TYPES}</select></dd>
</dl>
</fieldset>
<!-- BEGIN backend -->
- <fieldset>
+ <fieldset id="search_{backend.IDENTIFIER}_settings">
<legend>{backend.NAME}</legend>
{backend.SETTINGS}
</fieldset>
@@ -110,9 +110,9 @@
{backend.S_HIDDEN_FIELDS}
- <legend>{L_INDEX_STATS}: {backend.L_NAME} <!-- IF backend.S_ACTIVE -->({L_ACTIVE}) <!-- ENDIF --></legend>
+ <legend>{L_INDEX_STATS}{L_COLON} {backend.L_NAME} <!-- IF backend.S_ACTIVE -->({L_ACTIVE}) <!-- ENDIF --></legend>
- <table cellspacing="1">
+ <table class="table1">
<caption>{backend.L_NAME} <!-- IF backend.S_ACTIVE -->({L_ACTIVE}) <!-- ENDIF --></caption>
<col class="col1" /><col class="col2" /><col class="col1" /><col class="col2" />
<thead>
@@ -126,9 +126,9 @@
<tbody>
<!-- BEGIN data -->
<tr>
- <td>{backend.data.STATISTIC_1}:</td>
+ <td>{backend.data.STATISTIC_1}{L_COLON}</td>
<td>{backend.data.VALUE_1}</td>
- <td>{backend.data.STATISTIC_2}<!-- IF backend.data.STATISTIC_2 -->:<!-- ENDIF --></td>
+ <td>{backend.data.STATISTIC_2}<!-- IF backend.data.STATISTIC_2 -->{L_COLON}<!-- ENDIF --></td>
<td>{backend.data.VALUE_2}</td>
</tr>
<!-- END data -->
@@ -139,9 +139,11 @@
<p class="quick">
<!-- IF backend.S_INDEXED -->
- <input class="button2" type="submit" name="action[delete]" value="{L_DELETE_INDEX}" onclick="popup_progress_bar('delete');" />
+ <input type="hidden" name="action" value="delete" />
+ <input class="button2" type="submit" value="{L_DELETE_INDEX}" onclick="popup_progress_bar('delete');" />
<!-- ELSE -->
- <input class="button2" type="submit" name="action[create]" value="{L_CREATE_INDEX}" onclick="popup_progress_bar('create');" />
+ <input type="hidden" name="action" value="create" />
+ <input class="button2" type="submit" value="{L_CREATE_INDEX}" onclick="popup_progress_bar('create');" />
<!-- ENDIF -->
</p>
{S_FORM_TOKEN}
diff --git a/phpBB/adm/style/acp_send_statistics.html b/phpBB/adm/style/acp_send_statistics.html
index 2a9b61f314..480e438e1f 100644
--- a/phpBB/adm/style/acp_send_statistics.html
+++ b/phpBB/adm/style/acp_send_statistics.html
@@ -1,6 +1,6 @@
<!-- INCLUDE overall_header.html -->
-<a name="maincontent"></a>
+<a id="maincontent"></a>
<h1>{L_SEND_STATISTICS}</h1>
@@ -17,8 +17,8 @@ function iframe_updated()
return;
}
- dE('questionnaire-form', -1);
- dE('questionnaire-thanks', 1);
+ phpbb.toggleDisplay('questionnaire-form', -1);
+ phpbb.toggleDisplay('questionnaire-thanks', 1);
}
//]]>
</script>
@@ -31,10 +31,10 @@ function iframe_updated()
<p>{L_EXPLAIN_SHOW_STATISTICS}</p>
- <p id="show-button"><input type="button" class="button2" onclick="dE('configlist', 1); dE('show-button', -1);" value="{L_SHOW_STATISTICS}" /></p>
+ <p id="show-button"><input type="button" class="button2" onclick="phpbb.toggleDisplay('configlist', 1); phpbb.toggleDisplay('show-button', -1);" value="{L_SHOW_STATISTICS}" /></p>
<div id="configlist">
- <input type="button" class="button2" onclick="dE('show-button', 1); dE('configlist', -1);" value="{L_HIDE_STATISTICS}" />
+ <input type="button" class="button2" onclick="phpbb.toggleDisplay('show-button', 1); phpbb.toggleDisplay('configlist', -1);" value="{L_HIDE_STATISTICS}" />
<p class="submit-buttons">
<input class="button1" type="submit" id="submit" name="submit" value="{L_SEND_STATISTICS}" />
</p>
@@ -61,11 +61,4 @@ function iframe_updated()
<p><strong>{L_THANKS_SEND_STATISTICS}</strong><br /><br /><a href="{U_ACP_MAIN}">&laquo; {L_GO_ACP_MAIN}</a></p>
</div>
-<script type="text/javascript">
-//<![CDATA[
- dE('configlist', -1);
- dE('questionnaire-thanks', -1);
-//]]>
-</script>
-
-<!-- INCLUDE overall_footer.html --> \ No newline at end of file
+<!-- INCLUDE overall_footer.html -->
diff --git a/phpBB/adm/style/acp_styles.html b/phpBB/adm/style/acp_styles.html
index 6aa1c0ccc9..43c2f96a65 100644
--- a/phpBB/adm/style/acp_styles.html
+++ b/phpBB/adm/style/acp_styles.html
@@ -1,541 +1,173 @@
<!-- INCLUDE overall_header.html -->
-<a name="maincontent"></a>
+<a id="maincontent"></a>
-<!-- IF S_DELETE -->
-
- <a href="{U_BACK}" style="float: {S_CONTENT_FLOW_END};">&laquo; {L_BACK}</a>
-
- <h1>{L_TITLE}</h1>
-
- <p>{L_EXPLAIN}</p>
+<!-- IF S_STYLE_DETAILS -->
+ <a href="{U_ACTION}" style="float: {S_CONTENT_FLOW_END};">&laquo; {L_BACK}</a>
+<!-- ENDIF -->
- <form id="acp_styles" method="post" action="{U_ACTION}">
+<!-- IF S_CONFIRM_ACTION -->
+<form id="confirm" method="post" action="{S_CONFIRM_ACTION}">
- <fieldset>
- <legend>{L_TITLE}</legend>
- <dl>
- <dt><label>{L_NAME}:</label></dt>
- <dd><strong>{NAME}</strong></dd>
- </dl>
- <dl>
- <dt><label for="new_id">{L_REPLACE}:</label><br /><span>{L_REPLACE_EXPLAIN}</span></dt>
- <dd><select id="new_id" name="new_id">{S_REPLACE_OPTIONS}</select></dd>
- </dl>
- <!-- IF S_DELETE_STYLE -->
- <hr />
- <dl>
- <dt><label for="new_template_id">{L_DELETE_TEMPLATE}:</label><br /><span>{L_REPLACE_TEMPLATE_EXPLAIN}</span></dt>
- <dd><select id="new_template_id" name="new_template_id">{S_REPLACE_TEMPLATE_OPTIONS}</select></dd>
- </dl>
- <dl>
- <dt><label for="new_theme_id">{L_DELETE_THEME}:</label><br /><span>{L_REPLACE_THEME_EXPLAIN}</span></dt>
- <dd><select id="new_theme_id" name="new_theme_id">{S_REPLACE_THEME_OPTIONS}</select></dd>
- </dl>
- <dl>
- <dt><label for="new_imageset_id">{L_DELETE_IMAGESET}:</label><br /><span>{L_REPLACE_IMAGESET_EXPLAIN}</span></dt>
- <dd><select id="new_imageset_id" name="new_imageset_id">{S_REPLACE_IMAGESET_OPTIONS}</select></dd>
- </dl>
+<fieldset>
+ <h1>{MESSAGE_TITLE}</h1>
+ <p>{MESSAGE_TEXT}</p>
+ <!-- IF S_CONFIRM_DELETE -->
+ <label><input type="checkbox" class="checkbox" name="confirm_delete_files" /> {L_DELETE_FROM_FS}</label>
<!-- ENDIF -->
- <p class="quick">
- <input class="button1" type="submit" name="update" value="{L_DELETE}" />
- {S_FORM_TOKEN}
- </p>
- </fieldset>
- </form>
-
-<!-- ELSEIF S_EDIT_IMAGESET -->
-
- <a href="{U_BACK}" style="float: {S_CONTENT_FLOW_END};">&laquo; {L_BACK}</a>
+ {S_HIDDEN_FIELDS}
- <h1>{L_TITLE}</h1>
-
- <p>{L_EXPLAIN}</p>
+ <div style="text-align: center;">
+ <input type="submit" name="confirm" value="{L_YES}" class="button2" />&nbsp;
+ <input type="submit" name="cancel" value="{L_NO}" class="button2" />
+ </div>
- <!-- IF SUCCESS -->
- <div class="successbox">
- <p>{L_IMAGESET_UPDATED}</p>
- </div>
- <!-- ENDIF -->
+</fieldset>
- <!-- IF ERROR -->
- <div class="errorbox">
- <p>{L_NO_IMAGE}</p>
- </div>
- <!-- ENDIF -->
+</form>
+<!-- ELSE -->
- <script type="text/javascript" defer="defer">
- // <![CDATA[
- function update_image(newimage)
- {
- document.getElementById('newimg').src = (newimage) ? '../styles/{A_PATH}/imageset/' + encodeURI(newimage) : 'images/no_image.png';
- }
- // ]]>
- </script>
- <script type="text/javascript">
- // <![CDATA[
- /**
- * Handle displaying/hiding the dimension fields
- */
- function display_options(value)
- {
- if (value == 0)
- {
- dE('img_dimensions', -1);
- }
- else
- {
- dE('img_dimensions', 1);
- }
- }
+<!-- IF L_TITLE --><h1>{L_TITLE}</h1><!-- ENDIF -->
- /**
- * Init the wanted display functionality if javascript is enabled.
- * If javascript is not available, the user is still able to properly administer.
- */
- onload = function()
- {
- <!-- IF not IMAGE_SIZE -->
- dE('img_dimensions', -1);
- <!-- ENDIF -->
- }
- // ]]>
- </script>
+<!-- IF L_EXPLAIN --><p>{L_EXPLAIN}</p><!-- ENDIF -->
- <form method="post" action="{U_ACTION}">
+<fieldset class="quick">
+ <span class="small"><a href="https://www.phpbb.com/go/customise/styles/3.1" target="_blank">{L_BROWSE_STYLES_DATABASE}</a></span>
+</fieldset>
- <fieldset class="quick" style="text-align: left;">
- <legend>{L_SELECT_IMAGE}</legend>
- {L_SELECT_IMAGE}: <select name="imgname" onchange="this.form.submit();">
- <!-- BEGIN category -->
- <option class="sep" value="" disabled="disabled">{category.NAME}</option>
- <!-- BEGIN images --><option value="{category.images.VALUE}"<!-- IF category.images.SELECTED--> selected="selected"<!-- ENDIF -->>&nbsp;&nbsp;&nbsp;&nbsp;{category.images.TEXT}</option>
- <!-- END images -->
- <!-- END category -->
- </select>&nbsp; <input class="button1" type="submit" value="{L_SELECT}" tabindex="100" />
- </fieldset>
+<form id="acp_styles" method="post" action="{U_ACTION}">
+{S_HIDDEN_FIELDS}
+{S_FORM_TOKEN}
+<!-- IF S_STYLE_DETAILS -->
+ <input type="hidden" name="id" value="{STYLE_ID}" />
<fieldset>
- <legend>{L_EDIT_IMAGESET}</legend>
<dl>
- <dt><label>{L_CURRENT_IMAGE}:</label></dt>
- <dd><img src="<!-- IF IMAGE_REQUEST -->{IMAGE_REQUEST}<!-- ELSE -->images/no_image.png<!-- ENDIF -->" alt="" /></dd>
+ <dt><label for="name">{L_STYLE_NAME}{L_COLON}</label></dt>
+ <dd><input type="text" id="name" name="style_name" value="{STYLE_NAME}" /></dd>
</dl>
<dl>
- <dt><label>{L_SELECTED_IMAGE}:</label></dt>
- <dd><img src="{IMG_SRC}" id="newimg" alt="" /></dd>
+ <dt><label>{L_STYLE_PATH}{L_COLON}</label></dt>
+ <dd><strong>{STYLE_PATH}</strong></dd>
</dl>
- </fieldset>
-
- <fieldset>
- <legend>{L_IMAGE}</legend>
<dl>
- <dt><label for="imgpath">{L_IMAGE}:</label></dt>
- <dd><select id="imgpath" name="imgpath" onchange="update_image(this.options[selectedIndex].value);"><option value=""<!-- IF not IMAGE_SELECT--> selected="selected"<!-- ENDIF -->>{L_NO_IMAGE}</option>
- <!-- BEGIN imagesetlist -->
- <option class="sep" value=""><!-- IF imagesetlist.TYPE -->{L_LOCALISED_IMAGES}<!-- ELSE -->{L_GLOBAL_IMAGES}<!-- ENDIF --></option>
- <!-- BEGIN images -->
- <option value="{imagesetlist.images.VALUE}"<!-- IF imagesetlist.images.SELECTED--> selected="selected"<!-- ENDIF -->>{imagesetlist.images.TEXT}</option>
- <!-- END images -->
- <!-- END imagesetlist -->
- </select>
- </dd>
+ <dt><label>{L_STYLE_VERSION}{L_COLON}</label></dt>
+ <dd><strong>{STYLE_VERSION}</strong></dd>
</dl>
<dl>
- <dt><label for="imgsize">{L_INCLUDE_DIMENSIONS}:</label><br /><span>{L_DIMENSIONS_EXPLAIN}</span></dt>
- <dd><label><input type="radio" class="radio" name="imgsize" id="imgsize" onclick="display_options(1);" value="1"<!-- IF IMAGE_SIZE --> checked="checked"<!-- ENDIF --> /> {L_YES}</label>
- <label><input type="radio" class="radio" name="imgsize" onclick="display_options(0);" value="0"<!-- IF not IMAGE_SIZE --> checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd>
+ <dt><label for="name">{L_COPYRIGHT}{L_COLON}</label></dt>
+ <dd><strong>{STYLE_COPYRIGHT}</strong></dd>
</dl>
- <div id="img_dimensions">
- <dl>
- <dt><label for="imgwidth">{L_IMAGE_WIDTH}:</label><br /><span>{L_AUTOMATIC_EXPLAIN}</span></dt>
- <dd><input id="imgwidth" type="text" name="imgwidth" value="{IMAGE_SIZE}" /></dd>
- </dl>
- <dl>
- <dt><label for="imgheight">{L_IMAGE_HEIGHT}:</label><br /><span>{L_AUTOMATIC_EXPLAIN}</span></dt>
- <dd><input id="imgheight" type="text" name="imgheight" value="{IMAGE_HEIGHT}" /></dd>
- </dl>
- </div>
- </fieldset>
-
- <fieldset class="submit-buttons">
- <legend>{L_SUBMIT}</legend>
- <input class="button1" type="submit" name="update" value="{L_SUBMIT}" />&nbsp;&nbsp;<input class="button2" type="reset" value="{L_RESET}" />
- {S_FORM_TOKEN}
- </fieldset>
- </form>
-
-<!-- ELSEIF S_EDIT_TEMPLATE or S_EDIT_THEME -->
-
- <a href="{U_BACK}" style="float: {S_CONTENT_FLOW_END};">&laquo; {L_BACK}</a>
-
- <h1>{L_EDIT}</h1>
-
- <p>{L_EDIT_EXPLAIN}</p>
-
- <p>{L_SELECTED}: <strong>{SELECTED_TEMPLATE}</strong></p>
-
- <form id="acp_styles" method="post" action="{U_ACTION}">
-
- <!-- IF S_EDIT_TEMPLATE or (S_EDIT_THEME and not S_THEME_IN_DB) -->
- <fieldset>
- <legend>{L_SELECT}</legend>
<dl>
- <dt><label for="template_file">{L_FILE}:</label></dt>
- <dd><select id="template_file" name="template_file" onchange="if (this.options[this.selectedIndex].value != '') this.form.submit();">{S_TEMPLATES}</select> <input class="button2" type="submit" value="{L_SELECT}" /></dd>
+ <dt><label for="style_parent">{L_INHERITING_FROM}{L_COLON}</label></dt>
+ <dd><select id="style_parent" name="style_parent">
+ <option value=""<!-- IF STYLE_PARENT == 0 --> selected="selected"<!-- ENDIF -->> - </option>
+ <!-- BEGIN parent_styles -->
+ <option value="{parent_styles.STYLE_ID}"<!-- IF parent_styles.STYLE_ID == STYLE_PARENT --> selected="selected"<!-- ENDIF -->>{parent_styles.SPACER}{parent_styles.STYLE_NAME}</option>
+ <!-- END parent_styles -->
+ </select></dd>
</dl>
- {S_FORM_TOKEN}
- </fieldset>
- <!-- ENDIF -->
- </form>
-
- <!-- IF TEMPLATE_FILE or (S_EDIT_THEME and S_THEME_IN_DB) -->
- <script type="text/javascript" defer="defer">
- // <![CDATA[
-
- function change_editor_height(height)
- {
- height = Number(height);
-
- if (isNaN(height))
- {
- return;
- }
-
- editor = document.getElementById('template_data');
- editor.rows = Math.max(5, Math.min(height, 999));
-
- append_text_rows('acp_styles', height);
- append_text_rows('acp_template', height);
- }
-
- function append_text_rows(form_name, value)
- {
- value = Number(value);
-
- if (isNaN(value))
- {
- return;
- }
-
- url = document.getElementById(form_name).action;
-
- // Make sure &amp; is actually... &
- url = url.replace(/&amp;/g, '&');
-
- var_start = url.indexOf('&text_rows=');
- if (var_start == -1)
- {
- document.getElementById(form_name).action = url + "&text_rows=" + value;
- }
- else
- {
- url_start = url.substring(0, var_start + 1);
- var_end = url.substring(var_start + 1).indexOf('&');
- if (var_end == -1)
- {
- document.getElementById(form_name).action = url_start + "text_rows=" + value;
- }
- else
- {
- document.getElementById(form_name).action = url_start + url.substring(var_end + var_start + 2) + "&text_rows=" + value;
- }
- }
- }
-
- // ]]>
- </script>
-
- <form id="acp_template" method="post" action="{U_ACTION}">
-
- <fieldset>
- <legend>{L_EDITOR}</legend>
- <!-- IF S_EDIT_TEMPLATE or (S_EDIT_THEME and not S_THEME_IN_DB) -->
- <dl>
- <dt><label>{L_SELECTED_FILE}:</label></dt>
- <dd>{TEMPLATE_FILE}</dd>
- </dl>
- <!-- ENDIF -->
- <dl>
- <dt><label for="text_rows">{L_EDITOR_HEIGHT}:</label></dt>
- <dd><input id="text_rows" type="text" maxlength="3" value="{TEXT_ROWS}" /> <input class="button2" type="button" name="update" onclick="change_editor_height(this.form.text_rows.value);" value="{L_UPDATE}" /></dd>
- </dl>
- <textarea id="template_data" name="template_data" style="font-family:'Courier New', monospace;font-size:9pt;line-height:125%;width:100%;" cols="80" rows="{TEXT_ROWS}">{TEMPLATE_DATA}</textarea>
- </fieldset>
-
- <fieldset class="submit-buttons">
- <legend>{L_SUBMIT}</legend>
- {S_HIDDEN_FIELDS}
- {S_FORM_TOKEN}
- <input class="button1" id="save" type="submit" name="save" value="{L_SUBMIT}" />
- </fieldset>
- </form>
- <!-- ENDIF -->
-
-<!-- ELSEIF S_CACHE -->
-
- <a href="{U_BACK}" style="float: {S_CONTENT_FLOW_END};">&laquo; {L_BACK}</a>
-
- <h1>{L_TEMPLATE_CACHE}</h1>
-
- <p>{L_TEMPLATE_CACHE_EXPLAIN}</p>
-
- <form id="acp_styles" method="post" action="{U_ACTION}">
- <fieldset class="tabulated">
- <legend>{L_TEMPLATE_CACHE}</legend>
-
- <table cellspacing="1">
- <thead>
- <tr>
- <th>{L_CACHE_FILENAME}</th>
- <th>{L_CACHE_FILESIZE}</th>
- <th>{L_CACHE_CACHED}</th>
- <th>{L_CACHE_MODIFIED}</th>
- <th>{L_MARK}</th>
- </tr>
- </thead>
- <tbody>
- <!-- BEGIN file -->
- <!-- IF file.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
- <td><a href="{file.U_VIEWSOURCE}" onclick="popup(this.href, 750, 550, '_source'); return false;">{file.FILENAME_PATH}</a></td>
- <td>{file.FILESIZE}</td>
- <td>{file.CACHED}</td>
- <td>{file.MODIFIED}</td>
- <td><input type="checkbox" class="radio" name="delete[]" value="{file.FILENAME}" /></td>
- </tr>
- <!-- BEGINELSE -->
- <tr class="row1">
- <td colspan="5">{L_TEMPLATE_CACHE_EMPTY}</td>
- </tr>
- <!-- END file -->
- </tbody>
- </table>
-
- <p class="quick">
- <span class="small"><a href="#" onclick="marklist('acp_styles', 'delete', true); return false;">{L_MARK_ALL}</a> :: <a href="#" onclick="marklist('acp_styles', 'delete', false); return false;">{L_UNMARK_ALL}</a></span><br />
- {S_FORM_TOKEN}
- <input class="button1" type="submit" id="submit" name="submit" value="{L_DELETE_MARKED}" />
- </p>
- </fieldset>
- </form>
-
-<!-- ELSEIF S_EXPORT -->
-
- <a href="{U_BACK}" style="float: {S_CONTENT_FLOW_END};">&laquo; {L_BACK}</a>
-
- <h1>{L_TITLE}</h1>
-
- <p>{L_EXPLAIN}</p>
-
- <!-- IF S_ERROR_MSG -->
- <div class="errorbox">
- <h3>{L_WARNING}</h3>
- <p>{ERROR_MSG}</p>
- </div>
- <!-- ENDIF -->
-
- <form id="acp_styles" method="post" action="{U_ACTION}">
-
- <fieldset>
- <legend>{L_TITLE}</legend>
<dl>
- <dt><label>{L_NAME}:</label></dt>
- <dd><strong>{NAME}</strong></dd>
+ <dt><label for="style_active">{L_STYLE_ACTIVE}{L_COLON}</label></dt>
+ <dd><label><input type="radio" class="radio" name="style_active" value="1"<!-- IF S_STYLE_ACTIVE --> id="style_active" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
+ <label><input type="radio" class="radio" name="style_active" value="0"<!-- IF not S_STYLE_ACTIVE --> id="style_active" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd>
</dl>
- <!-- IF S_STYLE -->
+ <!-- IF not S_STYLE_DEFAULT -->
<dl>
- <dt><label for="inc_template">{L_INCLUDE_TEMPLATE}:</label></dt>
- <dd><label><input type="radio" class="radio" id="inc_template" name="inc_template" value="1" checked="checked" /> {L_YES}</label>
- <label><input type="radio" class="radio" name="inc_template" value="0" /> {L_NO}</label></dd>
- </dl>
- <dl>
- <dt><label for="inc_theme">{L_INCLUDE_THEME}:</label></dt>
- <dd><label><input type="radio" class="radio" id="inc_theme" name="inc_theme" value="1" checked="checked" /> {L_YES}</label>
- <label><input type="radio" class="radio" name="inc_theme" value="0" /> {L_NO}</label></dd>
- </dl>
- <dl>
- <dt><label for="inc_imageset">{L_INCLUDE_IMAGESET}:</label></dt>
- <dd><label><input type="radio" class="radio" id="inc_imageset" name="inc_imageset" value="1" checked="checked" /> {L_YES}</label>
- <label><input type="radio" class="radio" name="inc_imageset" value="0" /> {L_NO}</label></dd>
+ <dt><label for="style_default">{L_STYLE_DEFAULT}{L_COLON}</label></dt>
+ <dd><label><input type="radio" class="radio" name="style_default" value="1" /> {L_YES}</label>
+ <label><input type="radio" class="radio" id="style_default" name="style_default" value="0" checked="checked" /> {L_NO}</label></dd>
</dl>
<!-- ENDIF -->
- <dl>
- <dt><label for="store">{L_DOWNLOAD_STORE}:</label><br /><span>{L_DOWNLOAD_STORE_EXPLAIN}</span></dt>
- <dd><label><input type="radio" class="radio" id="store" name="store" value="1" checked="checked" /> {L_EXPORT_STORE}</label>
- <label><input type="radio" class="radio" name="store" value="0" /> {L_EXPORT_DOWNLOAD}</label></dd>
- </dl>
- <dl>
- <dt><label for="format">{L_ARCHIVE_FORMAT}:</label></dt>
- <dd>{FORMAT_BUTTONS}</dd>
- </dl>
+ </fieldset>
- <p class="quick">
+ <fieldset class="submit-buttons">
+ <legend>{L_SUBMIT}</legend>
+ <input class="button1" type="submit" name="update" value="{L_SUBMIT}" />&nbsp;
+ <input class="button2" type="reset" id="reset" name="reset" value="{L_RESET}" />
{S_FORM_TOKEN}
- <input class="button1" type="submit" name="update" value="{L_SUBMIT}" />
- </p>
</fieldset>
+<!-- ENDIF -->
-
- </form>
-
-<!-- ELSEIF S_FRONTEND -->
-
- <h1>{L_TITLE}</h1>
-
- <p>{L_EXPLAIN}</p>
-
- <!-- IF S_STYLE --> <!-- DEFINE $COLSPAN = 5 --> <!-- ELSE --> <!-- DEFINE $COLSPAN = 4 --> <!-- ENDIF -->
-
- <table cellspacing="1">
- <col class="row1" /><!-- IF S_STYLE --><col class="row1" /><!-- ENDIF --><col class="row2" /><col class="row2" />
+<!-- IF .styles_list -->
+ <!-- EVENT acp_styles_list_before -->
+ <table class="table1 styles">
<thead>
<tr>
- <th>{L_NAME}</th>
- <!-- IF S_STYLE --><th>{L_STYLE_USED_BY}</th><!-- ENDIF -->
- <th>{L_OPTIONS}</th>
- <th>{L_ACTIONS}</th>
+ <th>{L_STYLE_NAME}</th>
+ <!-- IF not STYLES_LIST_HIDE_COUNT --><th width="10%" style="white-space: nowrap; text-align: center;">{L_STYLE_USED_BY}</th><!-- ENDIF -->
+ <th width="25%" style="white-space: nowrap; text-align: center;">{L_ACTIONS}</th>
+ {STYLES_LIST_EXTRA}
+ <th>&nbsp;</th>
</tr>
</thead>
- <tbody>
- <tr>
- <td class="row3" colspan="{$COLSPAN}"><strong>{L_INSTALLED}</strong></td>
- </tr>
- <!-- BEGIN installed -->
- <!-- IF installed.S_INACTIVE and not $INACTIVE_STYLES -->
- <!-- DEFINE $INACTIVE_STYLES = 1 -->
- <tr>
- <td class="row3" colspan="{$COLSPAN}"><strong>{L_INACTIVE_STYLES}</strong></td>
- </tr>
- <!-- ENDIF -->
- <tr>
- <td><strong>{installed.NAME}</strong><!-- IF installed.S_DEFAULT_STYLE --> *<!-- ENDIF --></td>
- <!-- IF S_STYLE -->
- <td style="text-align: center;">{installed.STYLE_COUNT}</td>
+ <!-- BEGIN styles_list -->
+ <tbody id="styles-list-{styles_list.S_ROW_COUNT}">
+ <tr class="row-highlight<!-- IF styles_list.STYLE_ID and not styles_list.STYLE_ACTIVE --> row-inactive<!-- ENDIF -->">
+ <!-- IF styles_list.LEVEL is odd -->
+ <!-- IF $ROW_CLASS == 'row1a' --><!-- DEFINE $ROW_CLASS = 'row1b' --><!-- ELSE --><!-- DEFINE $ROW_CLASS = 'row1a' --><!-- ENDIF -->
+ <!-- ELSE -->
+ <!-- IF $ROW_CLASS == 'row2a' --><!-- DEFINE $ROW_CLASS = 'row2b' --><!-- ELSE --><!-- DEFINE $ROW_CLASS = 'row2a' --><!-- ENDIF -->
<!-- ENDIF -->
- <td style="text-align: center;">
- {installed.S_OPTIONS}
- </td>
- <td style="text-align: center;">
- <!-- IF S_STYLE -->
- <a href="{installed.U_STYLE_ACT_DEACT}">{installed.L_STYLE_ACT_DEACT}</a> |
+ <td class="{$ROW_CLASS}" style="padding-{S_CONTENT_FLOW_BEGIN}: {styles_list.PADDING}px;">
+ <!-- IF styles_list.STYLE_ID and styles_list.COMMENT == '' and styles_list.STYLE_ACTIVE -->
+ <div class="default-style" style="display: none; float: {S_CONTENT_FLOW_END};">
+ <input class="radio" type="radio" name="default" value="{styles_list.STYLE_ID}"<!-- IF styles_list.DEFAULT --> checked="checked"<!-- ELSE --><!-- DEFINE $S_DEFAULT = 1 --><!-- ENDIF --> title="{L_STYLE_DEFAULT}" />
+ </div>
+ <!-- ENDIF -->
+ <!-- IF styles_list.DEFAULT or styles_list.SHOW_COPYRIGHT -->
+ <strong>{styles_list.STYLE_NAME}</strong>
+ <!-- IF styles_list.SHOW_COPYRIGHT and styles_list.COMMENT == '' --><span><br />{styles_list.STYLE_COPYRIGHT}</span><!-- ENDIF -->
+ <!-- ELSE -->
+ <span>{styles_list.STYLE_NAME}</span>
+ <!-- ENDIF -->
+ <!-- IF styles_list.COMMENT != '' -->
+ <span class="error"><br />{styles_list.COMMENT}</span>
<!-- ENDIF -->
- {installed.S_ACTIONS}
- <!-- IF S_STYLE -->
- | <a href="{installed.U_PREVIEW}">{L_PREVIEW}</a>
+ <!-- IF not styles_list.STYLE_ID and styles_list.COMMENT == '' -->
+ <span class="style-path"><br />{L_STYLE_PATH}{L_COLON} {styles_list.STYLE_PATH_FULL}</span>
+ <!-- ENDIF -->
+ </td>
+ <!-- IF not STYLES_LIST_HIDE_COUNT -->
+ <td class="{$ROW_CLASS} users">{styles_list.USERS}</td>
+ <!-- ENDIF -->
+ <td class="{$ROW_CLASS} actions">
+ <!-- BEGIN actions -->
+ <!-- IF styles_list.actions.S_ROW_COUNT > 0 --> | <!-- ENDIF -->
+ <!-- IF styles_list.actions.U_ACTION -->
+ <a href="{styles_list.actions.U_ACTION}"{styles_list.actions.U_ACTION_ATTR}>{styles_list.actions.L_ACTION}</a>
+ <!-- ENDIF -->
+ {styles_list.actions.HTML}
+ <!-- END actions -->
+ </td>
+ {styles_list.EXTRA}
+ <td class="{$ROW_CLASS} mark" width="20">
+ <!-- IF styles_list.STYLE_ID -->
+ <input class="checkbox" type="checkbox" name="ids[]" value="{styles_list.STYLE_ID}" />
+ <!-- ELSE -->
+ <!-- IF styles_list.COMMENT != '' -->
+ &nbsp;
+ <!-- ELSE -->
+ <input class="checkbox" type="checkbox" name="dirs[]" value="{styles_list.STYLE_PATH}" />
+ <!-- ENDIF -->
<!-- ENDIF -->
</td>
</tr>
- <!-- END installed -->
- <tr>
- <td class="row3" colspan="{$COLSPAN}"><strong>{L_UNINSTALLED}</strong></td>
- </tr>
- <!-- IF not .uninstalled -->
- <tr>
- <td class="row1" colspan="{$COLSPAN}" style="text-align: center;">{L_NO_UNINSTALLED}</td>
- </tr>
- <!-- ENDIF -->
- <!-- BEGIN uninstalled -->
- <tr>
- <td<!-- IF S_STYLE --> colspan="2"<!-- ENDIF -->><strong>{uninstalled.NAME}</strong><br /><span>{L_COPYRIGHT}: {uninstalled.COPYRIGHT}</span></td>
- <td style="text-align: center;" colspan="2"><a href="{uninstalled.U_INSTALL}">{L_INSTALL}</a></td>
- </tr>
- <!-- END uninstalled -->
</tbody>
+ <!-- END styles_list -->
</table>
+<!-- ENDIF -->
- <!-- IF S_STYLE -->
- <form id="acp_styles" method="post" action="{U_ACTION}">
-
- <fieldset class="quick">
- <legend>{L_CREATE}</legend>
- {L_CREATE}: <input type="text" name="name" value="" /> {L_FROM} <select name="basis">{S_BASIS_OPTIONS}</select> <input class="button2" type="submit" name="add" value="{L_SUBMIT}" />
- </fieldset>
-
- </form>
- <!-- ENDIF -->
-
-<!-- ELSEIF S_DETAILS -->
-
- <a href="{U_BACK}" style="float: {S_CONTENT_FLOW_END};">&laquo; {L_BACK}</a>
-
- <h1>{L_TITLE}</h1>
-
- <p>{L_EXPLAIN}</p>
-
- <!-- IF S_ERROR_MSG -->
- <div class="errorbox">
- <h3>{L_WARNING}</h3>
- <p>{ERROR_MSG}</p>
- </div>
- <!-- ENDIF -->
-
- <form id="acp_styles" method="post" action="{U_ACTION}">
-
- <fieldset>
- <legend>{L_TITLE}</legend>
- <dl>
- <dt><label for="name">{L_NAME}:</label></dt>
- <dd><!-- IF S_INSTALL --><strong id="name">{NAME}</strong><!-- ELSE --><input type="text" id="name" name="name" value="{NAME}" /><!-- ENDIF --></dd>
- </dl>
- <dl>
- <dt><label for="copyright">{L_COPYRIGHT}:</label></dt>
- <dd><!-- IF S_INSTALL --><strong id="copyright">{COPYRIGHT}</strong><!-- ELSE --><input type="text" id="copyright" name="copyright" value="{COPYRIGHT}" /><!-- ENDIF --></dd>
- </dl>
- <!-- IF S_SUPERTEMPLATE -->
- <dl>
- <dt><label for="inheriting">{L_INHERITING_FROM}:</label></dt>
- <dd><strong id="inheriting">{S_SUPERTEMPLATE}</strong></dd>
- </dl>
- <!-- ENDIF -->
- <!-- IF S_STYLE and not S_BASIS -->
- <dl>
- <dt><label for="template_id">{L_STYLE_TEMPLATE}:</label></dt>
- <dd><!-- IF S_INSTALL --><strong id="template_id">{TEMPLATE_NAME}</strong><!-- ELSE --><select id="template_id" name="template_id">{S_TEMPLATE_OPTIONS}</select><!-- ENDIF --></dd>
- </dl>
- <dl>
- <dt><label for="theme_id">{L_STYLE_THEME}:</label></dt>
- <dd><!-- IF S_INSTALL --><strong id="theme_id">{THEME_NAME}</strong><!-- ELSE --><select id="theme_id" name="theme_id">{S_THEME_OPTIONS}</select><!-- ENDIF --></dd>
- </dl>
- <dl>
- <dt><label for="imageset_id">{L_STYLE_IMAGESET}:</label></dt>
- <dd><!-- IF S_INSTALL --><strong id="imageset_id">{IMAGESET_NAME}</strong><!-- ELSE --><select id="imageset_id" name="imageset_id">{S_IMAGESET_OPTIONS}</select><!-- ENDIF --></dd>
- </dl>
- <!-- ENDIF -->
- <!-- IF (S_TEMPLATE or S_THEME) and (S_LOCATION or not S_INSTALL) -->
- <dl>
- <dt><label for="store_db">{L_LOCATION}:</label><br /><span><!-- IF S_STORE_DB_DISABLED -->{L_LOCATION_DISABLED_EXPLAIN}<!-- ELSE -->{L_LOCATION_EXPLAIN}<!-- ENDIF --></span></dt>
- <dd><label><input type="radio" class="radio" name="store_db" value="0"<!-- IF not S_STORE_DB --> id="store_db" checked="checked"<!-- ENDIF --> <!-- IF S_STORE_DB_DISABLED -->disabled="disabled" <!-- ENDIF --> />{L_STORE_FILESYSTEM}</label>
- <label><input type="radio" class="radio" name="store_db" value="1"<!-- IF S_STORE_DB --> id="store_db" checked="checked"<!-- ENDIF --> <!-- IF S_STORE_DB_DISABLED -->disabled="disabled" <!-- ENDIF -->/> {L_STORE_DATABASE}</label></dd>
- </dl>
- <!-- ENDIF -->
- <!-- IF S_STYLE -->
- </fieldset>
-
- <fieldset>
- <legend>{L_OPTIONS}</legend>
- <dl>
- <dt><label for="style_active">{L_STYLE_ACTIVE}:</label></dt>
- <dd><label><input type="radio" class="radio" name="style_active" value="1"<!-- IF S_STYLE_ACTIVE --> id="style_active" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
- <label><input type="radio" class="radio" name="style_active" value="0"<!-- IF not S_STYLE_ACTIVE --> id="style_active" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd>
- </dl>
- <!-- IF not S_STYLE_DEFAULT -->
- <dl>
- <dt><label for="style_default">{L_STYLE_DEFAULT}:</label></dt>
- <dd><label><input type="radio" class="radio" name="style_default" value="1" /> {L_YES}</label>
- <label><input type="radio" class="radio" id="style_default" name="style_default" value="0" checked="checked" /> {L_NO}</label></dd>
- </dl>
- <!-- ENDIF -->
- <!-- ENDIF -->
- </fieldset>
-
- <fieldset class="submit-buttons">
- <legend>{L_SUBMIT}</legend>
- <input class="button1" type="submit" name="update" value="{L_SUBMIT}" />
- {S_FORM_TOKEN}
+<!-- IF .extra_actions -->
+ <fieldset class="quick">
+ <!-- BEGIN extra_actions -->
+ <input type="submit" name="{extra_actions.ACTION_NAME}" class="button2" value="{extra_actions.L_ACTION}" />
+ <!-- END extra_actions -->
</fieldset>
+<!-- ENDIF -->
- </form>
+</form>
<!-- ENDIF -->
diff --git a/phpBB/adm/style/acp_update.html b/phpBB/adm/style/acp_update.html
index a087dc914a..5288833d05 100644
--- a/phpBB/adm/style/acp_update.html
+++ b/phpBB/adm/style/acp_update.html
@@ -1,52 +1,72 @@
<!-- INCLUDE overall_header.html -->
-<a name="maincontent"></a>
-
-<!-- IF S_VERSION_CHECK -->
+<a id="maincontent"></a>
- <h1>{L_VERSION_CHECK}</h1>
+<h1>{L_VERSION_CHECK}</h1>
- <p>{L_VERSION_CHECK_EXPLAIN}</p>
+<p>{L_VERSION_CHECK_EXPLAIN}</p>
- <!-- IF S_UP_TO_DATE and S_UP_TO_DATE_AUTO -->
- <div class="successbox">
- <p>{L_VERSION_UP_TO_DATE_ACP} - <a href="{U_VERSIONCHECK_FORCE}">{L_VERSIONCHECK_FORCE_UPDATE}</a></p>
- </div>
- <!-- ELSE -->
- <div class="errorbox">
- <p>{L_VERSION_NOT_UP_TO_DATE_ACP} - <a href="{U_VERSIONCHECK_FORCE}">{L_VERSIONCHECK_FORCE_UPDATE}</a></p>
- </div>
- <!-- ENDIF -->
-
- <!-- IF NEXT_FEATURE_VERSION -->
- <div class="errorbox notice">
- <p>{UPGRADE_INSTRUCTIONS}</p>
- </div>
- <!-- ENDIF -->
+<!-- IF S_UPDATE_INCOMPLETE -->
+ <div class="errorbox">
+ <p>{L_UPDATE_INCOMPLETE} {L_UPDATE_INCOMPLETE_MORE}</p>
+ </div>
+<!-- ENDIF -->
+<!-- IF S_UP_TO_DATE -->
+ <div class="successbox">
+ <p>{L_VERSION_UP_TO_DATE_ACP} - <a href="{U_VERSIONCHECK_FORCE}">{L_VERSIONCHECK_FORCE_UPDATE}</a></p>
+ </div>
+<!-- ELSEIF not S_UPDATE_INCOMPLETE -->
+ <div class="errorbox">
+ <p>{L_VERSION_NOT_UP_TO_DATE_ACP} - <a href="{U_VERSIONCHECK_FORCE}">{L_VERSIONCHECK_FORCE_UPDATE}</a></p>
+ </div>
+<!-- ENDIF -->
+<!-- IF S_VERSION_UPGRADEABLE -->
+ <div class="errorbox notice">
+ <p>{UPGRADE_INSTRUCTIONS}</p>
+ </div>
+<!-- ENDIF -->
- <fieldset>
- <legend></legend>
+<fieldset>
+ <legend></legend>
+ <!-- IF not S_UPDATE_INCOMPLETE -->
<dl>
<dt><label>{L_CURRENT_VERSION}</label></dt>
- <dd><strong><!-- IF S_UP_TO_DATE and not S_UP_TO_DATE_AUTO -->{AUTO_VERSION}<!-- ELSE -->{CURRENT_VERSION}<!-- ENDIF --></strong></dd>
+ <dd><strong>{CURRENT_VERSION}</strong></dd>
</dl>
+ <!-- ELSE -->
<dl>
- <dt><label>{L_LATEST_VERSION}</label></dt>
- <dd><strong>{LATEST_VERSION}</strong></dd>
+ <dt><label>{L_FILES_VERSION}</label></dt>
+ <dd><strong>{FILES_VERSION}</strong></dd>
</dl>
+ <dl>
+ <dt><label>{L_DATABASE_VERSION}</label></dt>
+ <dd><strong>{CURRENT_VERSION}</strong></dd>
+ </dl>
+ <!-- ENDIF -->
+</fieldset>
+
+<!-- BEGIN updates_available -->
+ <fieldset>
+ <legend></legend>
+ <dl>
+ <dt><label>{L_LATEST_VERSION}</label></dt>
+ <dd><strong>{updates_available.current}</strong></dd>
+ </dl>
+ <dl>
+ <dt><label>{L_RELEASE_ANNOUNCEMENT}</label></dt>
+ <dd><strong><a href="{updates_available.announcement}">{updates_available.announcement}</a></strong></dd>
+ </dl>
</fieldset>
+<!-- END updates_available -->
- <!-- IF S_UP_TO_DATE and not S_UP_TO_DATE_AUTO -->
- {L_UPDATE_INSTRUCTIONS_INCOMPLETE}
- <br /><br />
- {UPDATE_INSTRUCTIONS}
- <br /><br />
- <!-- ENDIF -->
- <!-- IF not S_UP_TO_DATE -->
- {UPDATE_INSTRUCTIONS}
- <br /><br />
- <!-- ENDIF -->
+<!-- IF S_UPDATE_INCOMPLETE -->
+ {INCOMPLETE_INSTRUCTIONS}
+ <br>
+<!-- ENDIF -->
+<!-- IF not S_UP_TO_DATE -->
+ {UPDATE_INSTRUCTIONS}
+ <br /><br />
<!-- ENDIF -->
-<!-- INCLUDE overall_footer.html --> \ No newline at end of file
+<!-- INCLUDE overall_footer.html -->
diff --git a/phpBB/adm/style/acp_users.html b/phpBB/adm/style/acp_users.html
index d5a29a21cc..18c3d84f96 100644
--- a/phpBB/adm/style/acp_users.html
+++ b/phpBB/adm/style/acp_users.html
@@ -1,6 +1,6 @@
<!-- INCLUDE overall_header.html -->
-<a name="maincontent"></a>
+<a id="maincontent"></a>
<!-- IF S_SELECT_USER -->
@@ -13,7 +13,7 @@
<fieldset>
<legend>{L_SELECT_USER}</legend>
<dl>
- <dt><label for="username">{L_ENTER_USERNAME}:</label></dt>
+ <dt><label for="username">{L_ENTER_USERNAME}{L_COLON}</label></dt>
<dd><input class="text medium" type="text" id="username" name="username" /></dd>
<dd>[ <a href="{U_FIND_USERNAME}" onclick="find_username(this.href); return false;">{L_FIND_USERNAME}</a> ]</dd>
<dd class="full" style="text-align: left;"><label><input type="checkbox" class="radio" id="anonymous" name="u" value="{ANONYMOUS_USER_ID}" /> {L_SELECT_ANONYMOUS}</label></dd>
@@ -68,7 +68,7 @@
<form id="mode_select" method="post" action="{U_MODE_SELECT}">
<fieldset class="quick">
- {L_SELECT_FORM}: <select name="mode" onchange="if (this.options[this.selectedIndex].value != '') this.form.submit();">{S_FORM_OPTIONS}</select> <input class="button2" type="submit" value="{L_GO}" />
+ {L_SELECT_FORM}{L_COLON} <select name="mode" onchange="if (this.options[this.selectedIndex].value != '') this.form.submit();">{S_FORM_OPTIONS}</select> <input class="button2" type="submit" value="{L_GO}" />
{S_FORM_TOKEN}
</fieldset>
</form>
@@ -106,7 +106,7 @@
<fieldset>
<legend>{L_ACP_USER_RANK}</legend>
<dl>
- <dt><label for="user_rank">{L_USER_RANK}:</label></dt>
+ <dt><label for="user_rank">{L_USER_RANK}{L_COLON}</label></dt>
<dd><select name="user_rank" id="user_rank">{S_RANK_OPTIONS}</select></dd>
</dl>
</fieldset>
@@ -125,7 +125,7 @@
<form id="user_groups" method="post" action="{U_ACTION}">
- <table cellspacing="1">
+ <table class="table1 zebra-table">
<tbody>
<!-- BEGIN group -->
<!-- IF group.S_NEW_GROUP_TYPE -->
@@ -133,7 +133,7 @@
<td class="row3" colspan="4"><strong>{group.GROUP_TYPE}</strong></td>
</tr>
<!-- ELSE -->
- <!-- IF group.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
+ <tr>
<td><a href="{group.U_EDIT_GROUP}">{group.GROUP_NAME}</a></td>
<td><!-- IF group.S_IS_MEMBER --><!-- IF group.S_NO_DEFAULT --><a href="{group.U_DEFAULT}">{L_GROUP_DEFAULT}</a><!-- ELSE --><strong>{L_GROUP_DEFAULT}</strong><!-- ENDIF --><!-- ELSEIF not group.S_IS_MEMBER and group.U_APPROVE --><a href="{group.U_APPROVE}">{L_GROUP_APPROVE}</a><!-- ELSE -->&nbsp;<!-- ENDIF --></td>
<td><!-- IF group.S_IS_MEMBER and not group.S_SPECIAL_GROUP --><a href="{group.U_DEMOTE_PROMOTE}">{group.L_DEMOTE_PROMOTE}</a><!-- ELSE -->&nbsp;<!-- ENDIF --></td>
@@ -146,7 +146,9 @@
<!-- IF S_GROUP_OPTIONS -->
<fieldset class="quick">
- {L_USER_GROUP_ADD}: <select name="g">{S_GROUP_OPTIONS}</select> <input class="button1" type="submit" name="update" value="{L_SUBMIT}" />
+ <!-- EVENT acp_users_select_group_before -->
+ {L_USER_GROUP_ADD}{L_COLON} <select name="g">{S_GROUP_OPTIONS}</select> <input class="button1" type="submit" name="update" value="{L_SUBMIT}" />
+ <!-- EVENT acp_users_select_group_after -->
{S_FORM_TOKEN}
</fieldset>
<!-- ENDIF -->
@@ -157,27 +159,27 @@
<form id="user_attachments" method="post" action="{U_ACTION}">
- <!-- IF PAGINATION -->
<div class="pagination">
- <a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{S_ON_PAGE}</a> &bull; <span>{PAGINATION}</span>
- </div>
+ <!-- IF .pagination -->
+ <!-- INCLUDE pagination.html -->
<!-- ENDIF -->
+ </div>
<!-- IF .attach -->
- <table cellspacing="1">
+ <table class="table1 zebra-table fixed-width-table">
<thead>
<tr>
<th>{L_FILENAME}</th>
- <th>{L_POST_TIME}</th>
- <th>{L_FILESIZE}</th>
- <th>{L_DOWNLOADS}</th>
- <th>{L_MARK}</th>
+ <th style="width: 20%;">{L_POST_TIME}</th>
+ <th style="width: 20%;">{L_FILESIZE}</th>
+ <th style="width: 20%;">{L_DOWNLOADS}</th>
+ <th style="width: 50px;">{L_MARK}</th>
</tr>
</thead>
<tbody>
<!-- BEGIN attach -->
- <!-- IF attach.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
- <td><a href="{attach.U_DOWNLOAD}">{attach.REAL_FILENAME}</a><br /><span class="small"><!-- IF attach.S_IN_MESSAGE --><strong>{L_PM}: </strong><!-- ELSE --><strong>{L_POST}: </strong><!-- ENDIF --><a href="{attach.U_VIEW_TOPIC}">{attach.TOPIC_TITLE}</a></span></td>
+ <tr>
+ <td><a href="{attach.U_DOWNLOAD}">{attach.REAL_FILENAME}</a><br /><span class="small"><!-- IF attach.S_IN_MESSAGE --><strong>{L_PM}{L_COLON} </strong><!-- ELSE --><strong>{L_POST}{L_COLON} </strong><!-- ENDIF --><a href="{attach.U_VIEW_TOPIC}">{attach.TOPIC_TITLE}</a></span></td>
<td style="text-align: center">{attach.POST_TIME}</td>
<td style="text-align: center">{attach.SIZE}</td>
<td style="text-align: center">{attach.DOWNLOAD_COUNT}</td>
@@ -192,15 +194,15 @@
</div>
<!-- ENDIF -->
<fieldset class="display-options">
- {L_SORT_BY}: <select name="sk">{S_SORT_KEY}</select> <select name="sd">{S_SORT_DIR}</select>
+ {L_SORT_BY}{L_COLON} <select name="sk">{S_SORT_KEY}</select> <select name="sd">{S_SORT_DIR}</select>
<input class="button2" type="submit" value="{L_GO}" name="sort" />
</fieldset>
<hr />
- <!-- IF PAGINATION -->
<div class="pagination">
- <a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{S_ON_PAGE}</a> &bull; <span>{PAGINATION}</span>
- </div>
+ <!-- IF .pagination -->
+ <!-- INCLUDE pagination.html -->
<!-- ENDIF -->
+ </div>
<fieldset class="quick">
<input class="button2" type="submit" name="delmarked" value="{L_DELETE_MARKED}" />
@@ -219,7 +221,7 @@
<form id="select_forum" method="post" action="{U_ACTION}">
<fieldset class="quick" style="text-align: left;">
- {L_SELECT_FORUM}: <select name="f">{S_FORUM_OPTIONS}</select>
+ {L_SELECT_FORUM}{L_COLON} <select name="f">{S_FORUM_OPTIONS}</select>
<input class="button2" type="submit" value="{L_GO}" name="select" />
{S_FORM_TOKEN}
</fieldset>
diff --git a/phpBB/adm/style/acp_users_avatar.html b/phpBB/adm/style/acp_users_avatar.html
index 2b2676a19a..8466985fb3 100644
--- a/phpBB/adm/style/acp_users_avatar.html
+++ b/phpBB/adm/style/acp_users_avatar.html
@@ -1,78 +1,36 @@
- <form id="avatar_settings" method="post" action="{U_ACTION}"<!-- IF S_CAN_UPLOAD --> enctype="multipart/form-data"<!-- ENDIF -->>
+ <form id="avatar_settings" method="post" action="{U_ACTION}" enctype="multipart/form-data">
<fieldset>
<legend>{L_ACP_USER_AVATAR}</legend>
- <dl>
- <dt><label>{L_CURRENT_IMAGE}:</label><br /><span>{L_AVATAR_EXPLAIN}</span></dt>
- <dd>{AVATAR_IMAGE}</dd>
- <dd><label><input type="checkbox" class="radio" name="delete" /> {L_DELETE_AVATAR}</label></dd>
- </dl>
- <!-- IF not S_IN_AVATAR_GALLERY -->
- <!-- IF S_UPLOAD_FILE -->
- <dl>
- <dt><label for="uploadfile">{L_UPLOAD_AVATAR_FILE}:</label></dt>
- <dd><input type="hidden" name="MAX_FILE_SIZE" value="{AVATAR_MAX_FILESIZE}" /><input type="file" id="uploadfile" name="uploadfile" /></dd>
- </dl>
- <!-- ENDIF -->
- <!-- IF S_REMOTE_UPLOAD -->
- <dl>
- <dt><label for="uploadurl">{L_UPLOAD_AVATAR_URL}:</label><br /><span>{L_UPLOAD_AVATAR_URL_EXPLAIN}</span></dt>
- <dd><input name="uploadurl" type="text" id="uploadurl" value="" /></dd>
- </dl>
- <!-- ENDIF -->
- <!-- IF S_ALLOW_REMOTE -->
- <dl>
- <dt><label for="remotelink">{L_LINK_REMOTE_AVATAR}:</label><br /><span>{L_LINK_REMOTE_AVATAR_EXPLAIN}</span></dt>
- <dd><input name="remotelink" type="text" id="remotelink" value="" /></dd>
- </dl>
- <dl>
- <dt><label for="width">{L_LINK_REMOTE_SIZE}:</label><br /><span>{L_LINK_REMOTE_SIZE_EXPLAIN}</span></dt>
- <dd><input name="width" type="text" id="width" size="3" value="{USER_AVATAR_WIDTH}" /> <span>{L_PIXEL} &times; </span> <input type="text" name="height" size="3" value="{USER_AVATAR_HEIGHT}" /> <span>{L_PIXEL}</span></dd>
- </dl>
- <!-- ENDIF -->
- <!-- IF S_DISPLAY_GALLERY -->
- <dl>
- <dt><label>{L_AVATAR_GALLERY}:</label></dt>
- <dd><input class="button2" type="submit" name="display_gallery" value="{L_DISPLAY_GALLERY}" /></dd>
- </dl>
- <!-- ENDIF -->
- <!-- ELSE -->
- </fieldset>
-
- <fieldset>
- <legend>{L_AVATAR_GALLERY}</legend>
+ <!-- IF ERROR --><p class="error">{ERROR}</p><!-- ENDIF -->
<dl>
- <dt><label for="category">{L_AVATAR_CATEGORY}:</label></dt>
- <dd><select name="category" id="category">{S_CAT_OPTIONS}</select>&nbsp;<input class="button2" type="submit" value="{L_GO}" name="display_gallery" /></dd>
+ <dt><label>{L_CURRENT_IMAGE}{L_COLON}</label><br /><span>{L_AVATAR_EXPLAIN}</span></dt>
+ <dd>{AVATAR}</dd>
+ <dd><label for="avatar_delete"><input type="checkbox" name="avatar_delete" id="avatar_delete" /> {L_DELETE_AVATAR}</label></dd>
</dl>
+ </fieldset>
+ <fieldset>
+ <legend>{L_AVATAR_SELECT}</legend>
<dl>
- <table cellspacing="1">
- <!-- BEGIN avatar_row -->
- <tr>
- <!-- BEGIN avatar_column -->
- <td class="row1" style="text-align: center;"><img src="{avatar_row.avatar_column.AVATAR_IMAGE}" alt="{avatar_row.avatar_column.AVATAR_NAME}" title="{avatar_row.avatar_column.AVATAR_NAME}" /></td>
- <!-- END avatar_column -->
- </tr>
- <tr>
- <!-- BEGIN avatar_option_column -->
- <td class="row2" style="text-align: center;"><input type="radio" class="radio" name="avatar_select" value="{avatar_row.avatar_option_column.S_OPTIONS_AVATAR}" /></td>
- <!-- END avatar_option_column -->
- </tr>
- <!-- END avatar_row -->
- </table>
+ <dt><label>{L_AVATAR_TYPE}</label></dt>
+ <dd><select name="avatar_driver" id="avatar_driver" data-togglable-settings="true">
+ <!-- BEGIN avatar_drivers -->
+ <option value="{avatar_drivers.DRIVER}"<!-- IF avatar_drivers.SELECTED --> selected="selected"<!-- ENDIF --> data-toggle-setting="#avatar_option_{avatar_drivers.DRIVER}">{avatar_drivers.L_TITLE}</option>
+ <!-- END avatar_drivers -->
+ </select></dd>
</dl>
- </fieldset>
-
- <fieldset class="quick" style="margin-top: -15px;">
- <input class="button2" type="submit" name="cancel" value="{L_CANCEL}" />
- </fieldset>
-
- <!-- ENDIF -->
+ <div id="avatar_options">
+ <!-- BEGIN avatar_drivers -->
+ <div id="avatar_option_{avatar_drivers.DRIVER}">
+ <p>{avatar_drivers.L_EXPLAIN}</p>
+ {avatar_drivers.OUTPUT}
+ </div>
+ <!-- END avatar_drivers -->
+ </div>
</fieldset>
<fieldset class="quick">
- <input class="button1" type="submit" name="update" value="{L_SUBMIT}" />
- {S_FORM_TOKEN}
+ <input type="submit" name="update" value="{L_SUBMIT}" class="button1" />
+ {S_FORM_TOKEN}
</fieldset>
-
- </form> \ No newline at end of file
+ </form>
diff --git a/phpBB/adm/style/acp_users_feedback.html b/phpBB/adm/style/acp_users_feedback.html
index e11a8e6ec1..f251724cd2 100644
--- a/phpBB/adm/style/acp_users_feedback.html
+++ b/phpBB/adm/style/acp_users_feedback.html
@@ -1,13 +1,13 @@
<form id="list" method="post" action="{U_ACTION}">
- <!-- IF PAGINATION -->
<div class="pagination">
- <a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{S_ON_PAGE}</a> &bull; <span>{PAGINATION}</span>
- </div>
+ <!-- IF .pagination -->
+ <!-- INCLUDE pagination.html -->
<!-- ENDIF -->
+ </div>
<!-- IF .log -->
- <table cellspacing="1">
+ <table class="table1 zebra-table">
<thead>
<tr>
<th>{L_REPORT_BY}</th>
@@ -19,8 +19,7 @@
</thead>
<tbody>
<!-- BEGIN log -->
- <!-- IF log.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
-
+ <tr>
<td>{log.USERNAME}</td>
<td style="text-align: center;">{log.IP}</td>
<td style="text-align: center;">{log.DATE}</td>
@@ -40,15 +39,15 @@
<!-- ENDIF -->
<fieldset class="display-options">
- {L_DISPLAY_LOG}: &nbsp;{S_LIMIT_DAYS}&nbsp;{L_SORT_BY}: {S_SORT_KEY} {S_SORT_DIR}
+ {L_DISPLAY_LOG}{L_COLON} &nbsp;{S_LIMIT_DAYS}&nbsp;{L_SORT_BY}{L_COLON} {S_SORT_KEY} {S_SORT_DIR}
<input class="button2" type="submit" value="{L_GO}" name="sort" />
</fieldset>
<hr />
- <!-- IF PAGINATION -->
<div class="pagination">
- <a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{S_ON_PAGE}</a> &bull; <span>{PAGINATION}</span>
- </div>
+ <!-- IF .pagination -->
+ <!-- INCLUDE pagination.html -->
<!-- ENDIF -->
+ </div>
<!-- IF S_CLEARLOGS -->
<fieldset class="quick">
@@ -73,4 +72,4 @@
<input class="button1" type="submit" name="update" value="{L_SUBMIT}" />
</fieldset>
{S_FORM_TOKEN}
- </form> \ No newline at end of file
+ </form>
diff --git a/phpBB/adm/style/acp_users_overview.html b/phpBB/adm/style/acp_users_overview.html
index 964d6e5c17..506101c3f7 100644
--- a/phpBB/adm/style/acp_users_overview.html
+++ b/phpBB/adm/style/acp_users_overview.html
@@ -3,60 +3,70 @@
<fieldset>
<legend>{L_ACP_USER_OVERVIEW}</legend>
<dl>
- <dt><label for="user">{L_USERNAME}:</label><br /><span>{L_NAME_CHARS_EXPLAIN}</span></dt>
+ <dt><label for="user">{L_USERNAME}{L_COLON}</label><br /><span>{L_NAME_CHARS_EXPLAIN}</span></dt>
<dd><input type="text" id="user" name="user" value="{USER}" /></dd>
<!-- IF U_SWITCH_PERMISSIONS --><dd>[ <a href="{U_SWITCH_PERMISSIONS}">{L_USE_PERMISSIONS}</a> ]</dd><!-- ENDIF -->
</dl>
<!-- IF S_USER_INACTIVE -->
<dl>
- <dt><label>{L_USER_IS_INACTIVE}:</label></dt>
+ <dt><label>{L_USER_IS_INACTIVE}{L_COLON}</label></dt>
<dd><strong>{USER_INACTIVE_REASON}</strong></dd>
</dl>
<!-- ENDIF -->
<dl>
- <dt><label>{L_REGISTERED}:</label></dt>
+ <dt><label>{L_REGISTERED}{L_COLON}</label></dt>
<dd><strong>{USER_REGISTERED}</strong></dd>
</dl>
<!-- IF S_USER_IP -->
<dl>
- <dt><label>{L_REGISTERED_IP}:</label></dt>
+ <dt><label>{L_REGISTERED_IP}{L_COLON}</label></dt>
<dd><a href="{U_SHOW_IP}">{REGISTERED_IP}</a></dd>
<dd>[ <a href="{U_WHOIS}" onclick="popup(this.href, 700, 500, '_whois'); return false;">{L_WHOIS}</a> ]</dd>
</dl>
<!-- ENDIF -->
<dl>
- <dt><label>{L_LAST_ACTIVE}:</label></dt>
+ <dt><label>{L_LAST_ACTIVE}{L_COLON}</label></dt>
<dd><strong>{USER_LASTACTIVE}</strong></dd>
</dl>
<dl>
- <dt><label>{L_POSTS}:</label></dt>
- <dd><strong><!-- IF USER_HAS_POSTS and U_SEARCH_USER --><a href="{U_SEARCH_USER}">{USER_POSTS}</a><!-- ELSE -->{USER_POSTS}<!-- ENDIF --></strong><!-- IF POSTS_IN_QUEUE and U_MCP_QUEUE --> (<a href="{U_MCP_QUEUE}">{L_POSTS_IN_QUEUE}</a>)<!-- ELSEIF POSTS_IN_QUEUE --> ({L_POSTS_IN_QUEUE})<!-- ENDIF --></dd>
+ <dt><label>{L_POSTS}{L_COLON}</label></dt>
+ <dd>
+ <strong>
+ <!-- IF USER_HAS_POSTS and U_SEARCH_USER -->
+ <a href="{U_SEARCH_USER}">{USER_POSTS}</a>
+ <!-- ELSE -->
+ {USER_POSTS}
+ <!-- ENDIF -->
+ </strong>
+ <!-- IF POSTS_IN_QUEUE and U_MCP_QUEUE -->
+ (<a href="{U_MCP_QUEUE}">{L_POSTS_IN_QUEUE}</a>)
+ <!-- ELSEIF POSTS_IN_QUEUE -->
+ ({L_POSTS_IN_QUEUE})
+ <!-- ENDIF -->
+ </dd>
</dl>
<dl>
- <dt><label>{L_WARNINGS}:</label></dt>
+ <dt><label>{L_WARNINGS}{L_COLON}</label></dt>
<dd><strong>{USER_WARNINGS}</strong></dd>
</dl>
<dl>
- <dt><label for="user_founder">{L_FOUNDER}:</label><br /><span>{L_FOUNDER_EXPLAIN}</span></dt>
+ <dt><label for="user_founder">{L_FOUNDER}{L_COLON}</label><br /><span>{L_FOUNDER_EXPLAIN}</span></dt>
<dd><label><input type="radio" class="radio" name="user_founder" value="1"<!-- IF S_USER_FOUNDER --> id="user_founder" checked="checked"<!-- ENDIF --><!-- IF not S_FOUNDER --> disabled="disabled"<!-- ENDIF --> /> {L_YES}</label>
<label><input type="radio" class="radio" name="user_founder" value="0"<!-- IF not S_USER_FOUNDER --> id="user_founder" checked="checked"<!-- ENDIF --><!-- IF not S_FOUNDER --> disabled="disabled"<!-- ENDIF --> /> {L_NO}</label></dd>
</dl>
<dl>
- <dt><label for="user_email">{L_EMAIL}:</label></dt>
- <dd><input class="text medium" type="text" id="user_email" name="user_email" value="{USER_EMAIL}" autocomplete="off" /></dd>
+ <dt><label for="user_email">{L_EMAIL}{L_COLON}</label></dt>
+ <dd><input class="text medium" type="email" id="user_email" name="user_email" value="{USER_EMAIL}" autocomplete="off" /></dd>
</dl>
<dl>
- <dt><label for="email_confirm">{L_CONFIRM_EMAIL}:</label><br /><span>{L_CONFIRM_EMAIL_EXPLAIN}</span></dt>
- <dd><input class="text medium" type="text" id="email_confirm" name="email_confirm" value="" autocomplete="off" /></dd>
-</dl>
-<dl>
- <dt><label for="new_password">{L_NEW_PASSWORD}:</label><br /><span>{L_CHANGE_PASSWORD_EXPLAIN}</span></dt>
+ <dt><label for="new_password">{L_NEW_PASSWORD}{L_COLON}</label><br /><span>{L_CHANGE_PASSWORD_EXPLAIN}</span></dt>
<dd><input type="password" id="new_password" name="new_password" value="" autocomplete="off" /></dd>
</dl>
<dl>
- <dt><label for="password_confirm">{L_CONFIRM_PASSWORD}:</label><br /><span>{L_CONFIRM_PASSWORD_EXPLAIN}</span></dt>
+ <dt><label for="password_confirm">{L_CONFIRM_PASSWORD}{L_COLON}</label><br /><span>{L_CONFIRM_PASSWORD_EXPLAIN}</span></dt>
<dd><input type="password" id="password_confirm" name="password_confirm" value="" autocomplete="off" /></dd>
</dl>
+<!-- EVENT acp_users_overview_options_append -->
<p class="quick">
<input class="button1" type="submit" name="update" value="{L_SUBMIT}" />
@@ -76,11 +86,11 @@
{
if (option != 'banuser' && option != 'banemail' && option != 'banip')
{
- dE('reasons', -1);
+ phpbb.toggleDisplay('reasons', -1);
return;
}
- dE('reasons', 1);
+ phpbb.toggleDisplay('reasons', 1);
element = document.getElementById('user_quick_tools').ban_reason;
@@ -111,16 +121,16 @@
<fieldset>
<legend>{L_USER_TOOLS}</legend>
<dl>
- <dt><label for="quicktools">{L_QUICK_TOOLS}:</label></dt>
+ <dt><label for="quicktools">{L_QUICK_TOOLS}{L_COLON}</label></dt>
<dd><select id="quicktools" name="action" onchange="display_reason(this.options[this.selectedIndex].value);">{S_ACTION_OPTIONS}</select></dd>
</dl>
<div style="display: none;" id="reasons">
<dl>
- <dt><label for="ban_reason">{L_BAN_REASON}:</label></dt>
+ <dt><label for="ban_reason">{L_BAN_REASON}{L_COLON}</label></dt>
<dd><input name="ban_reason" type="text" class="text medium" maxlength="3000" id="ban_reason" /></dd>
</dl>
<dl>
- <dt><label for="ban_give_reason">{L_BAN_GIVE_REASON}:</label></dt>
+ <dt><label for="ban_give_reason">{L_BAN_GIVE_REASON}{L_COLON}</label></dt>
<dd><input name="ban_give_reason" type="text" class="text medium" maxlength="3000" id="ban_give_reason" /></dd>
</dl>
</div>
@@ -139,7 +149,7 @@
<fieldset>
<legend>{L_DELETE_USER}</legend>
<dl>
- <dt><label for="delete_type">{L_DELETE_USER}:</label><br /><span>{L_DELETE_USER_EXPLAIN}</span></dt>
+ <dt><label for="delete_type">{L_DELETE_USER}{L_COLON}</label><br /><span>{L_DELETE_USER_EXPLAIN}</span></dt>
<dd>
<!-- IF USER_HAS_POSTS -->
<select id="delete_type" name="delete_type"><option class="sep" value="">{L_SELECT_OPTION}</option><option value="retain">{L_RETAIN_POSTS}</option><option value="remove">{L_DELETE_POSTS}</option></select>
diff --git a/phpBB/adm/style/acp_users_prefs.html b/phpBB/adm/style/acp_users_prefs.html
index 07a9bc5c78..61904adc23 100644
--- a/phpBB/adm/style/acp_users_prefs.html
+++ b/phpBB/adm/style/acp_users_prefs.html
@@ -5,154 +5,147 @@
</script>
<form id="user_prefs" method="post" action="{U_ACTION}">
-
+ <!-- EVENT acp_users_prefs_prepend -->
<fieldset>
<legend>{L_UCP_PREFS_PERSONAL}</legend>
+ <!-- EVENT acp_users_prefs_personal_prepend -->
<dl>
- <dt><label for="viewemail">{L_SHOW_EMAIL}:</label></dt>
+ <dt><label for="viewemail">{L_SHOW_EMAIL}{L_COLON}</label></dt>
<dd><label><input type="radio" class="radio" name="viewemail" value="1"<!-- IF VIEW_EMAIL --> id="viewemail" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
<label><input type="radio" class="radio" name="viewemail" value="0"<!-- IF not VIEW_EMAIL --> id="viewemail" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd>
</dl>
<dl>
- <dt><label for="massemail">{L_ADMIN_EMAIL}:</label></dt>
+ <dt><label for="massemail">{L_ADMIN_EMAIL}{L_COLON}</label></dt>
<dd><label><input type="radio" class="radio" name="massemail" value="1"<!-- IF MASS_EMAIL --> id="massemail" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
<label><input type="radio" class="radio" name="massemail" value="0"<!-- IF not MASS_EMAIL --> id="massemail" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd>
</dl>
<dl>
- <dt><label for="allowpm">{L_ALLOW_PM}:</label><br /><span>{L_ALLOW_PM_EXPLAIN}</span></dt>
+ <dt><label for="allowpm">{L_ALLOW_PM}{L_COLON}</label><br /><span>{L_ALLOW_PM_EXPLAIN}</span></dt>
<dd><label><input type="radio" class="radio" name="allowpm" value="1"<!-- IF ALLOW_PM --> id="allowpm" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
<label><input type="radio" class="radio" name="allowpm" value="0"<!-- IF not ALLOW_PM --> id="allowpm" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd>
</dl>
<dl>
- <dt><label for="hideonline">{L_HIDE_ONLINE}:</label></dt>
+ <dt><label for="hideonline">{L_HIDE_ONLINE}{L_COLON}</label></dt>
<dd><label><input type="radio" class="radio" name="hideonline" value="1"<!-- IF HIDE_ONLINE --> id="hideonline" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
<label><input type="radio" class="radio" name="hideonline" value="0"<!-- IF not HIDE_ONLINE --> id="hideonline" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd>
</dl>
<dl>
- <dt><label for="notifymethod">{L_NOTIFY_METHOD}:</label><br /><span>{L_NOTIFY_METHOD_EXPLAIN}</span></dt>
+ <dt><label for="notifymethod">{L_NOTIFY_METHOD}{L_COLON}</label><br /><span>{L_NOTIFY_METHOD_EXPLAIN}</span></dt>
<dd><label><input type="radio" class="radio" name="notifymethod" value="0"<!-- IF NOTIFY_EMAIL --> id="notifymethod" checked="checked"<!-- ENDIF --> /> {L_NOTIFY_METHOD_EMAIL}</label>
<label><input type="radio" class="radio" name="notifymethod" value="1"<!-- IF NOTIFY_IM --> id="notifymethod" checked="checked"<!-- ENDIF --><!-- IF S_JABBER_DISABLED --> disabled="disabled"<!-- ENDIF --> /> {L_NOTIFY_METHOD_IM}</label>
<label><input type="radio" class="radio" name="notifymethod" value="2"<!-- IF NOTIFY_BOTH --> id="notifymethod" checked="checked"<!-- ENDIF --> /> {L_NOTIFY_METHOD_BOTH}</label></dd>
</dl>
<dl>
- <dt><label for="notifypm">{L_NOTIFY_ON_PM}:</label></dt>
+ <dt><label for="notifypm">{L_NOTIFY_ON_PM}{L_COLON}</label></dt>
<dd><label><input type="radio" class="radio" name="notifypm" value="1"<!-- IF NOTIFY_PM --> id="notifypm" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
<label><input type="radio" class="radio" name="notifypm" value="0"<!-- IF not NOTIFY_PM --> id="notifypm" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd>
</dl>
<dl>
- <dt><label for="popuppm">{L_POPUP_ON_PM}:</label></dt>
- <dd><label><input type="radio" class="radio" name="popuppm" value="1"<!-- IF POPUP_PM --> id="popuppm" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
- <label><input type="radio" class="radio" name="popuppm" value="0"<!-- IF not POPUP_PM --> id="popuppm" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd>
- </dl>
- <dl>
- <dt><label for="lang">{L_BOARD_LANGUAGE}:</label></dt>
+ <dt><label for="lang">{L_BOARD_LANGUAGE}{L_COLON}</label></dt>
<dd><select id="lang" name="lang">{S_LANG_OPTIONS}</select></dd>
</dl>
<dl>
- <dt><label for="style">{L_BOARD_STYLE}:</label></dt>
+ <dt><label for="style">{L_BOARD_STYLE}{L_COLON}</label></dt>
<dd><select id="style" name="style">{S_STYLE_OPTIONS}</select></dd>
</dl>
+ <!-- INCLUDE timezone_option.html -->
<dl>
- <dt><label for="tz">{L_BOARD_TIMEZONE}:</label></dt>
- <dd><select id="tz" name="tz" style="width: 100%;">{S_TZ_OPTIONS}</select></dd>
- </dl>
- <dl>
- <dt><label for="dst">{L_BOARD_DST}:</label></dt>
- <dd><label><input type="radio" class="radio" name="dst" value="1"<!-- IF DST --> id="dst" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
- <label><input type="radio" class="radio" name="dst" value="0"<!-- IF not DST --> id="dst" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd>
- </dl>
- <dl>
- <dt><label for="dateoptions">{L_BOARD_DATE_FORMAT}:</label><br /><span>{L_BOARD_DATE_FORMAT_EXPLAIN}</span></dt>
- <dd><select name="dateoptions" id="dateoptions" onchange="if(this.value=='custom'){dE('custom_date',1);}else{dE('custom_date',-1);} if (this.value == 'custom') { document.getElementById('dateformat').value = default_dateformat; } else { document.getElementById('dateformat').value = this.value; }">{S_DATEFORMAT_OPTIONS}</select></dd>
- <dd><div id="custom_date"<!-- IF not S_CUSTOM_DATEFORMAT --> style="display:none;"<!-- ENDIF -->><input type="text" name="dateformat" id="dateformat" value="{DATE_FORMAT}" maxlength="30" /></div></dd>
+ <dt><label for="dateoptions">{L_BOARD_DATE_FORMAT}{L_COLON}</label><br /><span>{L_BOARD_DATE_FORMAT_EXPLAIN}</span></dt>
+ <dd><select name="dateoptions" id="dateoptions" onchange="if(this.value=='custom'){phpbb.toggleDisplay('custom_date',1);}else{phpbb.toggleDisplay('custom_date',-1);} if (this.value == 'custom') { document.getElementById('dateformat').value = default_dateformat; } else { document.getElementById('dateformat').value = this.value; }">{S_DATEFORMAT_OPTIONS}</select></dd>
+ <dd><div id="custom_date"<!-- IF not S_CUSTOM_DATEFORMAT --> style="display:none;"<!-- ENDIF -->><input type="text" name="dateformat" id="dateformat" value="{DATE_FORMAT}" maxlength="64" /></div></dd>
</dl>
+ <!-- EVENT acp_users_prefs_personal_append -->
</fieldset>
<fieldset>
<legend>{L_UCP_PREFS_POST}</legend>
+ <!-- EVENT acp_users_prefs_post_prepend -->
<dl>
- <dt><label for="bbcode">{L_DEFAULT_BBCODE}:</label></dt>
+ <dt><label for="bbcode">{L_DEFAULT_BBCODE}{L_COLON}</label></dt>
<dd><label><input type="radio" class="radio" name="bbcode" value="1"<!-- IF BBCODE --> id="bbcode" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
<label><input type="radio" class="radio" name="bbcode" value="0"<!-- IF not BBCODE --> id="bbcode" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd>
</dl>
<dl>
- <dt><label for="smilies">{L_DEFAULT_SMILIES}:</label></dt>
+ <dt><label for="smilies">{L_DEFAULT_SMILIES}{L_COLON}</label></dt>
<dd><label><input type="radio" class="radio" name="smilies" value="1"<!-- IF SMILIES --> id="smilies" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
<label><input type="radio" class="radio" name="smilies" value="0"<!-- IF not SMILIES --> id="smilies" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd>
</dl>
<dl>
- <dt><label for="sig">{L_DEFAULT_ADD_SIG}:</label></dt>
+ <dt><label for="sig">{L_DEFAULT_ADD_SIG}{L_COLON}</label></dt>
<dd><label><input type="radio" class="radio" name="sig" value="1"<!-- IF ATTACH_SIG --> id="sig" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
<label><input type="radio" class="radio" name="sig" value="0"<!-- IF not ATTACH_SIG --> id="sig" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd>
</dl>
<dl>
- <dt><label for="notify">{L_DEFAULT_NOTIFY}:</label></dt>
+ <dt><label for="notify">{L_DEFAULT_NOTIFY}{L_COLON}</label></dt>
<dd><label><input type="radio" class="radio" name="notify" value="1"<!-- IF NOTIFY --> id="notify" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
<label><input type="radio" class="radio" name="notify" value="0"<!-- IF not NOTIFY --> id="notify" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd>
</dl>
+ <!-- EVENT acp_users_prefs_post_append -->
</fieldset>
<fieldset>
<legend>{L_UCP_PREFS_VIEW}</legend>
+ <!-- EVENT acp_users_prefs_view_prepend -->
<dl>
- <dt><label for="view_images">{L_VIEW_IMAGES}:</label></dt>
+ <dt><label for="view_images">{L_VIEW_IMAGES}{L_COLON}</label></dt>
<dd><label><input type="radio" class="radio" name="view_images" value="1"<!-- IF VIEW_IMAGES --> id="view_images" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
<label><input type="radio" class="radio" name="view_images" value="0"<!-- IF not VIEW_IMAGES --> id="view_images" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd>
</dl>
<dl>
- <dt><label for="view_flash">{L_VIEW_FLASH}:</label></dt>
+ <dt><label for="view_flash">{L_VIEW_FLASH}{L_COLON}</label></dt>
<dd><label><input type="radio" class="radio" name="view_flash" value="1"<!-- IF VIEW_FLASH --> id="view_flash" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
<label><input type="radio" class="radio" name="view_flash" value="0"<!-- IF not VIEW_FLASH --> id="view_flash" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd>
</dl>
<dl>
- <dt><label for="view_smilies">{L_VIEW_SMILIES}:</label></dt>
+ <dt><label for="view_smilies">{L_VIEW_SMILIES}{L_COLON}</label></dt>
<dd><label><input type="radio" class="radio" name="view_smilies" value="1"<!-- IF VIEW_SMILIES --> id="view_smilies" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
<label><input type="radio" class="radio" name="view_smilies" value="0"<!-- IF not VIEW_SMILIES --> id="view_smilies" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd>
</dl>
<dl>
- <dt><label for="view_sigs">{L_VIEW_SIGS}:</label></dt>
+ <dt><label for="view_sigs">{L_VIEW_SIGS}{L_COLON}</label></dt>
<dd><label><input type="radio" class="radio" name="view_sigs" value="1"<!-- IF VIEW_SIGS --> id="view_sigs" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
<label><input type="radio" class="radio" name="view_sigs" value="0"<!-- IF not VIEW_SIGS --> id="view_sigss" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd>
</dl>
<dl>
- <dt><label for="view_avatars">{L_VIEW_AVATARS}:</label></dt>
+ <dt><label for="view_avatars">{L_VIEW_AVATARS}{L_COLON}</label></dt>
<dd><label><input type="radio" class="radio" name="view_avatars" value="1"<!-- IF VIEW_AVATARS --> id="view_avatars" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
<label><input type="radio" class="radio" name="view_avatars" value="0"<!-- IF not VIEW_AVATARS --> id="view_avatars" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd>
</dl>
<dl>
- <dt><label for="view_wordcensor">{L_DISABLE_CENSORS}:</label></dt>
+ <dt><label for="view_wordcensor">{L_DISABLE_CENSORS}{L_COLON}</label></dt>
<dd><label><input type="radio" class="radio" name="view_wordcensor" value="1"<!-- IF VIEW_WORDCENSOR --> id="view_wordcensor" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
<label><input type="radio" class="radio" name="view_wordcensor" value="0"<!-- IF not VIEW_WORDCENSOR --> id="view_wordcensor" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd>
</dl>
<dl>
- <dt><label>{L_VIEW_TOPICS_DAYS}:</label></dt>
+ <dt><label>{L_VIEW_TOPICS_DAYS}{L_COLON}</label></dt>
<dd>{S_TOPIC_SORT_DAYS}</dd>
</dl>
<dl>
- <dt><label>{L_VIEW_TOPICS_KEY}:</label></dt>
+ <dt><label>{L_VIEW_TOPICS_KEY}{L_COLON}</label></dt>
<dd>{S_TOPIC_SORT_KEY}</dd>
</dl>
<dl>
- <dt><label>{L_VIEW_TOPICS_DIR}:</label></dt>
+ <dt><label>{L_VIEW_TOPICS_DIR}{L_COLON}</label></dt>
<dd>{S_TOPIC_SORT_DIR}</dd>
</dl>
<dl>
- <dt><label>{L_VIEW_POSTS_DAYS}:</label></dt>
+ <dt><label>{L_VIEW_POSTS_DAYS}{L_COLON}</label></dt>
<dd>{S_POST_SORT_DAYS}</dd>
</dl>
<dl>
- <dt><label>{L_VIEW_POSTS_KEY}:</label></dt>
+ <dt><label>{L_VIEW_POSTS_KEY}{L_COLON}</label></dt>
<dd>{S_POST_SORT_KEY}</dd>
</dl>
<dl>
- <dt><label>{L_VIEW_POSTS_DIR}:</label></dt>
+ <dt><label>{L_VIEW_POSTS_DIR}{L_COLON}</label></dt>
<dd>{S_POST_SORT_DIR}</dd>
</dl>
+ <!-- EVENT acp_users_prefs_view_append -->
</fieldset>
-
+ <!-- EVENT acp_users_prefs_append -->
<fieldset class="quick">
<input class="button1" type="submit" name="update" value="{L_SUBMIT}" />
{S_FORM_TOKEN}
</fieldset>
- </form> \ No newline at end of file
+ </form>
diff --git a/phpBB/adm/style/acp_users_profile.html b/phpBB/adm/style/acp_users_profile.html
index 0d1c6f8e46..9296638ff6 100644
--- a/phpBB/adm/style/acp_users_profile.html
+++ b/phpBB/adm/style/acp_users_profile.html
@@ -1,55 +1,25 @@
- <form id="user_profile" method="post" action="{U_ACTION}">
+ <form id="user_profile" method="post" action="{U_ACTION}"{S_FORM_ENCTYPE}>
<fieldset>
<legend>{L_USER_PROFILE}</legend>
+ <!-- EVENT acp_users_profile_before -->
<dl>
- <dt><label for="icq">{L_UCP_ICQ}:</label></dt>
- <dd><input type="text" id="icq" name="icq" value="{ICQ}" /></dd>
+ <dt><label for="jabber">{L_UCP_JABBER}{L_COLON}</label></dt>
+ <dd><input type="email" id="jabber" name="jabber" value="{JABBER}" /></dd>
</dl>
<dl>
- <dt><label for="aim">{L_UCP_AIM}:</label></dt>
- <dd><input type="text" id="aim" name="aim" value="{AIM}" /></dd>
- </dl>
- <dl>
- <dt><label for="msn">{L_UCP_MSNM}:</label></dt>
- <dd><input type="text" id="msn" name="msn" value="{MSN}" /></dd>
- </dl>
- <dl>
- <dt><label for="yim">{L_UCP_YIM}:</label></dt>
- <dd><input type="text" id="yim" name="yim" value="{YIM}" /></dd>
- </dl>
- <dl>
- <dt><label for="jabber">{L_UCP_JABBER}:</label></dt>
- <dd><input type="text" id="jabber" name="jabber" value="{JABBER}" /></dd>
- </dl>
- <dl>
- <dt><label for="website">{L_WEBSITE}:</label></dt>
- <dd><input type="text" id="website" name="website" value="{WEBSITE}" /></dd>
- </dl>
- <dl>
- <dt><label for="location">{L_LOCATION}:</label></dt>
- <dd><input type="text" id="location" name="location" value="{LOCATION}" /></dd>
- </dl>
- <dl>
- <dt><label for="occupation">{L_OCCUPATION}:</label></dt>
- <dd><textarea id="occupation" name="occupation" rows="3" cols="30">{OCCUPATION}</textarea></dd>
- </dl>
- <dl>
- <dt><label for="interests">{L_INTERESTS}:</label></dt>
- <dd><textarea id="interests" name="interests" rows="3" cols="30">{INTERESTS}</textarea></dd>
- </dl>
- <dl>
- <dt><label for="birthday">{L_BIRTHDAY}:</label><br /><span>{L_BIRTHDAY_EXPLAIN}</span></dt>
- <dd>{L_DAY}: <select id="birthday" name="bday_day">{S_BIRTHDAY_DAY_OPTIONS}</select> {L_MONTH}: <select name="bday_month">{S_BIRTHDAY_MONTH_OPTIONS}</select> {L_YEAR}: <select name="bday_year">{S_BIRTHDAY_YEAR_OPTIONS}</select></dd>
+ <dt><label for="birthday">{L_BIRTHDAY}{L_COLON}</label><br /><span>{L_BIRTHDAY_EXPLAIN}</span></dt>
+ <dd>{L_DAY}{L_COLON} <select id="birthday" name="bday_day">{S_BIRTHDAY_DAY_OPTIONS}</select> {L_MONTH}{L_COLON} <select name="bday_month">{S_BIRTHDAY_MONTH_OPTIONS}</select> {L_YEAR}{L_COLON} <select name="bday_year">{S_BIRTHDAY_YEAR_OPTIONS}</select></dd>
</dl>
+ <!-- EVENT acp_users_profile_after -->
</fieldset>
<!-- IF .profile_fields -->
<fieldset>
<legend>{L_USER_CUSTOM_PROFILE_FIELDS}</legend>
<!-- BEGIN profile_fields -->
- <dl>
- <dt><label<!-- IF profile_fields.FIELD_ID --> for="{profile_fields.FIELD_ID}"<!-- ENDIF -->>{profile_fields.LANG_NAME}:</label><!-- IF profile_fields.LANG_EXPLAIN --><br /><span>{profile_fields.LANG_EXPLAIN}</span><!-- ENDIF --></dt>
+ <dl>
+ <dt><label<!-- IF profile_fields.FIELD_ID --> for="{profile_fields.FIELD_ID}"<!-- ENDIF -->>{profile_fields.LANG_NAME}{L_COLON}</label><!-- IF profile_fields.LANG_EXPLAIN --><br /><span>{profile_fields.LANG_EXPLAIN}</span><!-- ENDIF --></dt>
<dd>{profile_fields.FIELD}</dd>
<!-- IF profile_fields.ERROR -->
<dd><span class="small" style="color: red;">{profile_fields.ERROR}</span></dd>
@@ -58,9 +28,9 @@
<!-- END profile_fields -->
</fieldset>
<!-- ENDIF -->
-
+ <!-- EVENT acp_users_profile_custom_after -->
<fieldset class="quick">
<input class="button1" type="submit" name="update" value="{L_SUBMIT}" />
{S_FORM_TOKEN}
</fieldset>
- </form> \ No newline at end of file
+ </form>
diff --git a/phpBB/adm/style/acp_users_signature.html b/phpBB/adm/style/acp_users_signature.html
index 0fd6c04fa5..c7ec5cc0eb 100644
--- a/phpBB/adm/style/acp_users_signature.html
+++ b/phpBB/adm/style/acp_users_signature.html
@@ -3,36 +3,12 @@
var form_name = 'user_signature';
var text_name = 'signature';
-
- // Define the bbCode tags
- var bbcode = new Array();
- var bbtags = new Array('[b]','[/b]','[i]','[/i]','[u]','[/u]','[quote]','[/quote]','[code]','[/code]','[list]','[/list]','[list=]','[/list]','[img]','[/img]','[url]','[/url]','[flash=]', '[/flash]','[size=]','[/size]'<!-- BEGIN custom_tags -->, {custom_tags.BBCODE_NAME}<!-- END custom_tags -->);
+ var load_draft = false;
+ var upload = false;
var imageTag = false;
- // Helpline messages
- var help_line = {
- b: '{LA_BBCODE_B_HELP}',
- i: '{LA_BBCODE_I_HELP}',
- u: '{LA_BBCODE_U_HELP}',
- q: '{LA_BBCODE_Q_HELP}',
- c: '{LA_BBCODE_C_HELP}',
- l: '{LA_BBCODE_L_HELP}',
- o: '{LA_BBCODE_O_HELP}',
- p: '{LA_BBCODE_P_HELP}',
- w: '{LA_BBCODE_W_HELP}',
- s: '{LA_BBCODE_S_HELP}',
- f: '{LA_BBCODE_F_HELP}',
- y: '{LA_BBCODE_Y_HELP}',
- d: '{LA_BBCODE_D_HELP}',
- tip: '{L_STYLES_TIP}'
- <!-- BEGIN custom_tags -->
- ,cb_{custom_tags.BBCODE_ID}: '{custom_tags.A_BBCODE_HELPLINE}'
- <!-- END custom_tags -->
- }
-
// ]]>
</script>
-<script type="text/javascript" src="{T_TEMPLATE_PATH}/editor.js"></script>
<form id="user_signature" method="post" action="{U_ACTION}">
@@ -47,52 +23,12 @@
<legend>{L_SIGNATURE}</legend>
<p>{L_SIGNATURE_EXPLAIN}</p>
- <div id="format-buttons">
- <input type="button" class="button2" accesskey="b" name="addbbcode0" value=" B " style="font-weight:bold; width: 30px;" onclick="bbstyle(0)" onmouseover="helpline('b')" onmouseout="helpline('tip')" />
- <input type="button" class="button2" accesskey="i" name="addbbcode2" value=" i " style="font-style:italic; width: 30px;" onclick="bbstyle(2)" onmouseover="helpline('i')" onmouseout="helpline('tip')" />
- <input type="button" class="button2" accesskey="u" name="addbbcode4" value=" u " style="text-decoration: underline; width: 30px;" onclick="bbstyle(4)" onmouseover="helpline('u')" onmouseout="helpline('tip')" />
- <input type="button" class="button2" accesskey="q" name="addbbcode6" value="Quote" style="width: 50px" onclick="bbstyle(6)" onmouseover="helpline('q')" onmouseout="helpline('tip')" />
- <input type="button" class="button2" accesskey="c" name="addbbcode8" value="Code" style="width: 40px" onclick="bbstyle(8)" onmouseover="helpline('c')" onmouseout="helpline('tip')" />
- <input type="button" class="button2" accesskey="l" name="addbbcode10" value="List" style="width: 40px" onclick="bbstyle(10)" onmouseover="helpline('l')" onmouseout="helpline('tip')" />
- <input type="button" class="button2" accesskey="o" name="addbbcode12" value="List=" style="width: 40px" onclick="bbstyle(12)" onmouseover="helpline('o')" onmouseout="helpline('tip')" />
- <input type="button" class="button2" accesskey="y" name="addlistitem" value="[*]" style="width: 40px" onclick="bbstyle(-1)" onmouseover="helpline('y')" onmouseout="helpline('tip')" />
- <!-- IF S_BBCODE_IMG -->
- <input type="button" class="button2" accesskey="p" name="addbbcode14" value="Img" style="width: 40px" onclick="bbstyle(14)" onmouseover="helpline('p')" onmouseout="helpline('tip')" />
- <!-- ENDIF -->
- <!-- IF S_LINKS_ALLOWED -->
- <input type="button" class="button2" accesskey="w" name="addbbcode16" value="URL" style="text-decoration: underline; width: 40px" onclick="bbstyle(16)" onmouseover="helpline('w')" onmouseout="helpline('tip')" />
- <!-- ENDIF -->
- <!-- IF S_BBCODE_FLASH -->
- <input type="button" class="button2" accesskey="d" name="addbbcode18" value="Flash" onclick="bbstyle(18)" onmouseover="helpline('d')" onmouseout="helpline('tip')" />
- <!-- ENDIF -->
-
- {L_FONT_SIZE}: <select name="addbbcode20" onchange="bbfontstyle('[size=' + this.form.addbbcode20.options[this.form.addbbcode20.selectedIndex].value + ']', '[/size]');this.form.addbbcode20.selectedIndex = 2;" title="{L_FONT_SIZE}" onmouseover="helpline('f')" onmouseout="helpline('tip')">
- <option value="50">{L_FONT_TINY}</option>
- <option value="85">{L_FONT_SMALL}</option>
- <option value="100" selected="selected">{L_FONT_NORMAL}</option>
- <option value="150">{L_FONT_LARGE}</option>
- <option value="200">{L_FONT_HUGE}</option>
- </select>
- <!-- IF .custom_tags -->
- <br /><br />
- <!-- BEGIN custom_tags -->
- <input type="button" class="button2" name="addbbcode{custom_tags.BBCODE_ID}" value="{custom_tags.BBCODE_TAG}" onclick="bbstyle({custom_tags.BBCODE_ID})"<!-- IF custom_tags.BBCODE_HELPLINE !== '' --> onmouseover="helpline('cb_{custom_tags.BBCODE_ID}')" onmouseout="helpline('tip')"<!-- ENDIF --> />
- <!-- END custom_tags -->
- <!-- ENDIF -->
-
- </div>
-
- <p><input type="text" class="text full" style="border: 0; background: none;" name="helpbox" value="{L_STYLES_TIP}" /></p>
+ <!-- INCLUDE acp_posting_buttons.html -->
- <dl>
- <dt style="width: 90px;">
- <script type="text/javascript">
- // <![CDATA[
- colorPalette('v', 12, 10);
- // ]]>
- </script>
+ <dl class="responsive-columns">
+ <dt style="width: 90px;" id="color_palette_placeholder" data-orientation="v" data-height="12" data-width="15" data-bbcode="true">
</dt>
- <dd style="margin-{S_CONTENT_FLOW_BEGIN}: 90px;"><textarea name="signature" rows="10" cols="60" style="width: 95%;" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);" onfocus="initInsertions();">{SIGNATURE}</textarea></dd>
+ <dd style="margin-{S_CONTENT_FLOW_BEGIN}: 90px;"><textarea name="signature" rows="10" cols="60" style="width: 95%;" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);" onfocus="initInsertions();" data-bbcode="true">{SIGNATURE}</textarea></dd>
<dd style="margin-{S_CONTENT_FLOW_BEGIN}: 90px; margin-top: 5px;">
<!-- IF S_BBCODE_ALLOWED -->
<label><input type="checkbox" class="radio" name="disable_bbcode"{S_BBCODE_CHECKED} /> {L_DISABLE_BBCODE}</label>
@@ -104,7 +40,7 @@
<label><input type="checkbox" class="radio" name="disable_magic_url"{S_MAGIC_URL_CHECKED} /> {L_DISABLE_MAGIC_URL}</label>
<!-- ENDIF -->
</dd>
- <dd style="margin-{S_CONTENT_FLOW_BEGIN}: 90px; margin-top: 10px;"><strong>{L_OPTIONS}: </strong>{BBCODE_STATUS} :: {IMG_STATUS} :: {FLASH_STATUS} :: {URL_STATUS} :: {SMILIES_STATUS}</dd>
+ <dd style="margin-{S_CONTENT_FLOW_BEGIN}: 90px; margin-top: 10px;"><strong>{L_OPTIONS}{L_COLON} </strong>{BBCODE_STATUS} :: {IMG_STATUS} :: {FLASH_STATUS} :: {URL_STATUS} :: {SMILIES_STATUS}</dd>
</dl>
</fieldset>
@@ -113,4 +49,4 @@
<input class="button2" type="submit" name="preview" value="{L_PREVIEW}" />
{S_FORM_TOKEN}
</fieldset>
-</form> \ No newline at end of file
+</form>
diff --git a/phpBB/adm/style/acp_users_warnings.html b/phpBB/adm/style/acp_users_warnings.html
index d27f3800fc..6e7f521415 100644
--- a/phpBB/adm/style/acp_users_warnings.html
+++ b/phpBB/adm/style/acp_users_warnings.html
@@ -1,7 +1,7 @@
<form id="list" method="post" action="{U_ACTION}">
<!-- IF .warn -->
- <table cellspacing="1">
+ <table class="table1 zebra-table">
<thead>
<tr>
<th>{L_REPORT_BY}</th>
@@ -12,7 +12,7 @@
</thead>
<tbody>
<!-- BEGIN warn -->
- <!-- IF warn.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
+ <tr>
<td>{warn.USERNAME}</td>
<td style="text-align: center; nowrap: nowrap;">{warn.DATE}</td>
<td>{warn.ACTION}</td>
diff --git a/phpBB/adm/style/acp_words.html b/phpBB/adm/style/acp_words.html
index 3fa4cfc91c..6038fc6161 100644
--- a/phpBB/adm/style/acp_words.html
+++ b/phpBB/adm/style/acp_words.html
@@ -1,6 +1,6 @@
<!-- INCLUDE overall_header.html -->
-<a name="maincontent"></a>
+<a id="maincontent"></a>
<!-- IF S_EDIT_WORD -->
@@ -47,7 +47,7 @@
<input class="button2" name="add" type="submit" value="{L_ADD_WORD}" />
</p>
- <table cellspacing="1">
+ <table class="table1 zebra-table">
<thead>
<tr>
<th>{L_WORD}</th>
@@ -57,10 +57,10 @@
</thead>
<tbody>
<!-- BEGIN words -->
- <!-- IF words.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
+ <tr>
<td style="text-align: center;">{words.WORD}</td>
<td style="text-align: center;">{words.REPLACEMENT}</td>
- <td>&nbsp;<a href="{words.U_EDIT}">{ICON_EDIT}</a>&nbsp;&nbsp;<a href="{words.U_DELETE}">{ICON_DELETE}</a>&nbsp;</td>
+ <td>&nbsp;<a href="{words.U_EDIT}">{ICON_EDIT}</a>&nbsp;&nbsp;<a href="{words.U_DELETE}" data-ajax="row_delete">{ICON_DELETE}</a>&nbsp;</td>
</tr>
<!-- BEGINELSE -->
<tr class="row3">
diff --git a/phpBB/adm/style/admin.css b/phpBB/adm/style/admin.css
index a0e14d65a1..0c00e5339e 100644
--- a/phpBB/adm/style/admin.css
+++ b/phpBB/adm/style/admin.css
@@ -1,7 +1,10 @@
-/* phpBB 3.0 Admin Style Sheet
+/* phpBB 3.1 Admin Style Sheet
------------------------------------------------------------------------
Original author: subBlue ( http://www.subblue.com/ )
- Copyright 2007 phpBB Group ( http://www.phpbb.com/ )
+ Copyright (c) phpBB Limited <https://www.phpbb.com>
+
+ For full copyright and license information, please see
+ the docs/CREDITS.txt file.
------------------------------------------------------------------------
*/
@@ -14,15 +17,19 @@
font-size: 100%;
}
+abbr {
+ text-decoration: none;
+}
+
body, div, p, th, td, li, dd {
font-size: x-small;
voice-family: "\"}\"";
voice-family: inherit;
- font-size: small
+ font-size: small;
}
html>body, html>div, html>p, html>th, html>td, html>li, html>dd {
- font-size: small
+ font-size: small;
}
html {
@@ -31,6 +38,7 @@ html {
/* Always show a scrollbar for short pages - stops the jump when the scrollbar appears. non-ie browsers */
height: 100%;
margin-bottom: 1px;
+ word-wrap: break-word;
}
body {
@@ -42,6 +50,10 @@ body {
margin: 10px 15px;
}
+code, samp {
+ font-size: 1.2em;
+}
+
img {
border: 0;
}
@@ -97,10 +109,43 @@ hr {
height: 1px;
}
+.centered-text {
+ text-align: center;
+}
+
+.search-box {
+ float: left;
+}
+
+.rtl .search-box {
+ float: right;
+}
+
.small {
font-size: 0.85em;
}
+.hidden {
+ display: none;
+}
+
+@media only screen and (max-width: 800px), only screen and (max-device-width: 800px)
+{
+ body {
+ margin: 5px 5px 0;
+ }
+}
+
+@media only screen and (max-width: 700px), only screen and (max-device-width: 700px)
+{
+ html, body {
+ height: auto;
+ margin: 0;
+ padding: 0;
+ }
+}
+
+
/* General links */
a:link, a:visited {
color: #105289;
@@ -121,6 +166,10 @@ a:active {
font-weight: bold;
}
+a#maincontent, a#acl, a#assigned_to {
+ display: block;
+}
+
/* List items */
ul, ol {
list-style-position: inside;
@@ -132,6 +181,7 @@ li {
list-style-type: inherit;
}
+
/* Main blocks
---------------------------------------- */
#wrap {
@@ -140,7 +190,6 @@ li {
}
#page-header {
- clear: both;
text-align: right;
background: url("../images/phpbb_logo.png") top left no-repeat;
height: 54px;
@@ -169,12 +218,10 @@ li {
}
#page-body {
- clear: both;
- min-width: 700px;
+ min-width: 650px;
}
-#page-footer {
- clear: both;
+.copyright {
font-size: 0.75em;
text-align: center;
}
@@ -191,19 +238,23 @@ li {
}
#main {
- float: left;
- width: 76%;
- margin: 0 0 0 3%;
- min-height: 350px;
+ float: right;
+ width: 100%;
+ margin: 0 0 0 -210px;
}
.rtl #main {
- float: right;
- margin: 0 3% 0 0;
+ float: left;
+ margin: 0 -210px 0 0;
+}
+
+.main {
+ margin-left: 210px;
}
-* html #main {
- height: 350px;
+.rtl .main {
+ margin-left: 0;
+ margin-right: 210px;
}
#page-body.simple-page-body {
@@ -212,186 +263,269 @@ li {
min-width: 0;
}
+@media only screen and (max-width: 700px), only screen and (max-device-width: 700px)
+{
+ #wrap, #page-body, #page-body.simple-page-body {
+ padding: 0;
+ min-width: 300px;
+ }
+
+ #page-header {
+ margin: 5px;
+ padding-left: 160px;
+ height: auto;
+ min-height: 54px;
+ overflow: hidden;
+ }
+
+ .rtl #page-header {
+ padding-right: 160px;
+ padding-left: 0;
+ }
+
+ #page-header h1 {
+ font-size: 1.2em;
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ }
+
+ #page-header fieldset {
+ margin-top: 5px;
+ }
+
+ #main, .rtl #main, .main, .rtl .main {
+ float: none;
+ width: auto;
+ margin: 0;
+ }
+
+ #content {
+ background: #F3F3F3 url("../images/innerbox_bg.gif") repeat-x top;
+ padding: 5px;
+ }
+
+ #page-footer {
+ padding: 0 5px 5px;
+ }
+}
+
+@media only screen and (max-width: 400px), only screen and (max-device-width: 400px)
+{
+ #page-header {
+ background-size: 76px 26.5px;
+ padding-left: 80px;
+ min-height: 30px;
+ }
+
+ .rtl #page-header {
+ padding-right: 80px;
+ }
+
+ #page-header h1 {
+ padding-top: 0;
+ font-size: 1.1em;
+ }
+}
+
+
/* Tabbed menu
- Based on: http://www.alistapart.com/articles/slidingdoors2/
----------------------------------------*/
#tabs {
+ font-family: Arial, Helvetica, sans-serif;
line-height: normal;
- margin: 0 0 -6px 7px;
- min-width: 600px;
-}
-
-.rtl #tabs {
- margin: 0 7px -6px 0;
+ margin: 0 7px;
+ position: relative;
+ z-index: 2;
}
-#tabs ul {
- margin:0;
- padding: 0;
+#tabs > ul {
list-style: none;
-}
-
-#tabs li {
- display: inline;
margin: 0;
padding: 0;
- font-size: 0.85em;
- font-weight: bold;
}
-#tabs a {
+#tabs .tab {
+ display: inline-block;
float: left;
- background:url("../images/bg_tabs1.gif") no-repeat 0% -34px;
- margin: 0 1px 0 0;
- padding: 0 0 0 7px;
- text-decoration: none;
- position: relative;
+ font-size: 0.85em;
+ font-weight: bold;
+ line-height: 14px;
}
-.rtl #tabs a {
+.rtl #tabs .tab {
float: right;
}
-#tabs a span {
- float: left;
- display: block;
- background: url("../images/bg_tabs2.gif") no-repeat 100% -34px;
- padding: 7px 10px 4px 4px;
+#tabs .tab > a {
+ background: #D4D6DA;
+ background: -moz-linear-gradient(top, #CACBCF 0%, #D4D6DA 100%);
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #CACBCF), color-stop(100%, #D4D6DA));
+ background: -webkit-linear-gradient(top, #CACBCF 0%, #D4D6DA 100%);
+ background: -o-linear-gradient(top, #CACBCF 0%, #D4D6DA 100%);
+ background: -ms-linear-gradient(top, #CACBCF 0%, #D4D6DA 100%);
+ background: linear-gradient(to bottom, #CACBCF 0%, #D4D6DA 100%);
+ border: 1px solid #BBB;
+ border-bottom-width: 0;
+ border-radius: 5px 5px 0 0;
color: #767676;
- white-space: nowrap;
- font-family: Arial, Helvetica, sans-serif;
- text-transform: uppercase;
+ display: block;
font-weight: bold;
+ margin: 1px 1px 2px 0;
+ padding: 6px 9px 4px;
+ position: relative;
+ text-decoration: none;
+ text-transform: uppercase;
+ white-space: nowrap;
+ cursor: pointer;
}
-.rtl #tabs a span {
- float: right;
-}
-
-/* Commented Backslash Hack hides rule from IE5-Mac \*/
-#tabs a span, .rtl #tabs a span { float:none;}
-/* End hack */
-
-#tabs a:hover span {
+#tabs .tab > a:hover {
+ background: #F1F1EE;
+ border-color: #C0BFBB;
color: #BC2A4D;
}
-#tabs #activetab a {
- background-position: 0 0;
- border-bottom: 1px solid #DCDEE2;
+#tabs .activetab > a,
+#tabs .activetab > a:hover {
+ background: #DCDEE2;
+ background: -moz-linear-gradient(top, #F2F2F2 0%, #DCDEE2 100%);
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #F2F2F2), color-stop(100%, #DCDEE2));
+ background: -webkit-linear-gradient(top, #F2F2F2 0%, #DCDEE2 100%);
+ background: -o-linear-gradient(top, #F2F2F2 0%, #DCDEE2 100%);
+ background: -ms-linear-gradient(top, #F2F2F2 0%, #DCDEE2 100%);
+ background: linear-gradient(to bottom, #F2F2F2 0%, #DCDEE2 100%);
+ border-color: #999;
+ border-bottom: 2px solid #DCDEE2;
+ box-shadow: 0 1px 1px #FFF inset;
+ color: #23649F;
+ margin: 0 1px 0 0;
+ padding: 7px 10px 4px;
}
-#tabs #activetab a span {
- background-position: 100% 0;
- padding-bottom: 5px;
- color: #23649F;
+#tabs .activetab > a:hover {
+ color: #115098;
}
-#tabs a:hover {
- background-position: 0 -69px;
+/* Responsive tabs
+----------------------------------------*/
+.responsive-tab {
+ position: relative;
}
-#tabs a:hover span {
- background-position: 100% -69px;
+.responsive-tab > a.responsive-tab-link {
+ display: block;
+ font-size: 16px;
+ position: relative;
+ width: 16px;
+ line-height: 14px;
+ text-decoration: none;
+ padding-left: 9px !important;
+ padding-right: 9px !important;
}
-#tabs #activetab a:hover span {
- color: #115098;
+.responsive-tab .responsive-tab-link:before {
+ content: '';
+ position: absolute;
+ left: 10px;
+ top: 7px;
+ height: .125em;
+ width: 14px;
+ border-bottom: 0.125em solid #767676;
+ border-top: 0.375em double #767676;
}
+.responsive-tab .responsive-tab-link:hover:before {
+ border-color: #BC2A4D;
+}
-/* Main Panel
----------------------------------------- */
-#acp {
- margin: 4px 0;
- padding: 3px 1px;
- min-width: 550px;
- background-color: #FFFFFF;
- border: 1px #999999 solid;
+.responsive-tab.activetab .responsive-tab-link:before {
+ border-color: #23649F;
}
-.panel {
- background: #F3F3F3 url("../images/innerbox_bg.gif") repeat-x top;
- padding: 0;
+.responsive-tab.activetab .responsive-tab-link:hover:before {
+ border-color: #115098;
}
-span.corners-top, span.corners-bottom,
-span.corners-top span, span.corners-bottom span {
- font-size: 1px;
- line-height: 1px;
- display: block;
- height: 5px;
- background-repeat: no-repeat;
+#tabs .dropdown, #minitabs .dropdown {
+ top: 20px;
+ margin-right: -2px;
+ font-weight: normal;
}
-span.corners-top {
- background-image: url("../images/corners_left.gif");
- background-position: 0 0;
- margin: -4px -2px 0;
+#tabs .dropdown-right .dropdown {
+ margin-left: -2px;
}
-span.corners-top span {
- background-image: url("../images/corners_right.gif");
- background-position: 100% 0;
+#tabs .dropdown-contents {
+ list-style: none;
+ margin: 0;
}
-span.corners-bottom {
- background-image: url("../images/corners_left.gif");
- background-position: 0 100%;
- margin: 0 -2px -4px;
- clear: both;
+#tabs .dropdown li {
+ border-bottom: 1px dotted #DCDCDC;
}
-span.corners-bottom span {
- background-image: url("../images/corners_right.gif");
- background-position: 100% 100%;
+#tabs .dropdown li:last-child {
+ border-bottom: none;
}
-/* WinIE tweaks \*/
-* html span.corners-top, * html span.corners-bottom { background-image: url("../images/corners_left.gif"); }
-* html span.corners-top span, * html span.corners-bottom span { background-image: url("../images/corners_right.gif"); }
-/* End tweaks */
+#tabs .dropdown a {
+ display: block;
+ padding: 4px 8px;
+ text-align: right;
+}
-/* Sub-navigation Menu
+/* Main Panel
---------------------------------------- */
-
-/* Toggle */
-#toggle {
- padding: 5px;
- width: 5%;
- height: 100px;
- position: absolute;
- left: 15%;
- top: 28px;
- margin-left: 2px;
+#acp {
+ position: relative;
+ top: -2px;
+ margin: 0 0 2px;
+ padding: 3px 1px;
+ min-width: 550px;
+ background: #F3F3F3 url("../images/innerbox_bg.gif") repeat-x top;
+ border: 1px #999999 solid;
+ border-radius: 5px;
+ box-shadow: #FFF 0 0 0 1px inset;
}
-.rtl #toggle {
- left: 75%;
- margin-right: 0;
- margin-left: 6px;
+#acp:first-child {
+ top: 0;
}
-#toggle-handle {
- display: block;
- width: 18px;
- height: 19px;
- float: right;
- background-image: url(../images/toggle.gif);
+.panel {
+ background: #F3F3F3 url("../images/innerbox_bg.gif") repeat-x top;
+ padding: 5px 0;
+ border-radius: 5px;
+ overflow: hidden;
}
-.rtl #toggle-handle {
- background-image: url(../images/toggle.gif);
- background-position: 100% 50%;
+@media only screen and (max-width: 700px), only screen and (max-device-width: 700px)
+{
+ #acp {
+ min-width: 0;
+ min-height: 0;
+ border-radius: 0;
+ border-width: 1px 0;
+ background: #fff;
+ padding: 1px 0;
+ box-shadow: none;
+ }
}
+/* Sub-navigation Menu
+---------------------------------------- */
+
/* Menu */
#menu {
float: left;
- width: 20%;
+ width: 200px;
font-size: 1.00em;
padding: 0;
border-right: 1px solid #CCCFD3;
+ position: relative;
+ z-index: 1;
}
.rtl #menu {
@@ -408,15 +542,16 @@ span.corners-bottom span {
list-style: none;
margin: 0;
padding: 0;
+ word-wrap: normal;
}
/* Default list state */
-#menu li {
+#menu li, #menu .header {
padding: 0;
margin: 0;
font-size: 0.85em;
font-weight: bold;
- display: inline;
+ display: block;
}
/* Link styles for the sub-section links */
@@ -481,7 +616,7 @@ span.corners-bottom span {
background: url("../images/arrow_down.gif") 99% 50% no-repeat;
}
-#menu li.header {
+#menu .header {
font-family: Tahoma, Helvetica, sans-serif;
display: block;
font-weight: bold;
@@ -491,8 +626,71 @@ span.corners-bottom span {
margin-top: 15px;
text-transform: uppercase;
font-size: 0.75em;
+ text-decoration: none;
+ cursor: inherit;
+ outline-style: none;
+}
+
+@media only screen and (max-width: 700px), only screen and (max-device-width: 700px)
+{
+ #menu, .rtl #menu {
+ float: none;
+ width: auto;
+ border-width: 0;
+ max-width: 200px;
+ margin: 0 auto 10px;
+ }
+
+ #menu p {
+ text-align: center;
+ }
+
+ #menu .menu-block.active {
+ margin: 0 -5px;
+ padding: 0 5px 3px;
+ background: rgba(255, 255, 255, .5);
+ border-radius: 5px;
+ }
+
+ #menu .menu-block.no-header.active {
+ padding-top: 3px;
+ }
+
+ #menu .menu-block .header {
+ margin-top: 5px;
+ cursor: pointer;
+ border-bottom-width: 0;
+ position: relative;
+ text-decoration: underline;
+ }
+
+ #menu .menu-block .header:focus, #menu .menu-block.active .header {
+ color: #D31141;
+ text-decoration: none;
+ }
+
+ #menu .menu-block ul {
+ display: none;
+ }
+
+ .nojs #menu .menu-block:hover ul, #menu .menu-block.active ul, #menu .menu-block.no-header ul {
+ display: block;
+ }
+
+ #menu .menu-block li:last-child {
+ border-bottom: 1px solid #327AA5;
+ }
+
+ #menu .menu-block:last-child li:last-child, #menu .menu-block.active li:last-child {
+ border-bottom-width: 0;
+ }
+
+ #menu .menu-block li a span {
+ border-radius: 2px;
+ }
}
+
/* Table styles
---------------------------------------- */
@@ -525,6 +723,21 @@ td {
text-align: right;
}
+.table1 {
+ border-collapse: separate;
+ border-spacing: 1px;
+ clear: both;
+}
+
+dt#color_palette_placeholder table {
+ margin-right: 5px;
+ width: 80px;
+}
+
+#color_palette_placeholder td {
+ padding: 0;
+}
+
table.type2 {
border: none;
background: none;
@@ -619,19 +832,236 @@ td.name {
text-align: right;
}
-.row1 { background-color: #F9F9F9; }
-.row2 { background-color: #DCEBFE; }
+.row1 {
+ background-color: #F9F9F9;
+}
+
+table.zebra-table tbody tr:nth-child(odd) {
+ background-color: #F9F9F9;
+}
+
+.row2 {
+ background-color: #DCEBFE;
+}
+
+table.zebra-table tbody tr:nth-child(even) {
+ background-color: #DCEBFE;
+}
+
.row3 { background-color: #DBDFE2; }
.row4 { background-color: #E4E8EB; }
.col1 { background-color: #DCEBFE; }
.col2 { background-color: #F9F9F9; }
+/* 4 row background colours for trees */
+.row1a { background-color: #F9F9F9; }
+.row1b { background-color: #F6F6F6; }
+.row2a { background-color: #E7EEF4; }
+.row2b { background-color: #E3EBF2; }
+
+tr.row-highlight:hover td { background-color: #DBDFE2; }
+
.spacer {
background-color: #DBDFE2;
height: 1px;
line-height: 1px;
}
+/* Deactivated row */
+.row-inactive {
+ color: #999;
+}
+.row-inactive a, .row-inactive strong {
+ color: #888;
+}
+.row-inactive a:hover {
+ color: #BC2A4D;
+}
+
+/* Specific tables */
+table.forums td.folder {
+ width: 27px;
+ text-align: center;
+}
+
+table td.actions {
+ vertical-align: middle;
+ width: 100px;
+ text-align: center;
+ white-space: nowrap;
+}
+
+table tr:first-child td.actions .up, table tr:last-child td.actions .down {
+ display: none;
+}
+
+table tr:first-child td.actions .up-disabled, table tr:last-child td.actions .down-disabled {
+ display: inline !important;
+}
+
+table.styles td.users, table td.mark {
+ text-align: center;
+}
+
+table.fixed-width-table {
+ table-layout: fixed;
+ word-break: break-word;
+}
+
+@media only screen and (max-width: 700px), only screen and (max-device-width: 700px)
+{
+ table.responsive, table.responsive tbody, table.responsive tr, table.responsive td {
+ display: block;
+ }
+
+ table.responsive thead, table.responsive th, table.responsive colgroup {
+ display: none;
+ }
+
+ table.responsive.show-header thead, table.responsive.show-header th:first-child, table.responsive caption {
+ display: block;
+ width: auto !important;
+ text-align: left !important;
+ margin: 0;
+ }
+
+ table.responsive {
+ background: transparent none;
+ border-width: 0;
+ padding: 0;
+ }
+
+ table.responsive caption {
+ padding: 3px 4px;
+ color: #FFFFFF;
+ background: #70AED3 url("../images/gradient2b.gif") bottom left repeat-x;
+ border-top: 1px solid #6DACD2;
+ border-bottom: 1px solid #327AA5;
+ text-align: left;
+ font-size: 0.75em;
+ font-weight: bold;
+ text-transform: uppercase;
+ }
+
+ table.responsive.show-header th:first-child span.rank-img, table.responsive.no-caption caption, table.responsive.no-header thead {
+ display: none;
+ }
+
+ table.responsive tr {
+ margin: 2px 0;
+ border: 1px solid #CCCFD3;
+ background-color: #FFFFFF;
+ padding: 1px 1px 0;
+ overflow: hidden;
+ }
+
+ table.responsive tr.row1 td { background-color: #F9F9F9; }
+ table.responsive tr.row2 td { background-color: #DCEBFE; }
+ table.responsive tr.row3 td { background-color: #DBDFE2; }
+ table.responsive tr.row4 td { background-color: #E4E8EB; }
+ table.responsive tr.col1 td { background-color: #DCEBFE; }
+ table.responsive tr.col2 td { background-color: #F9F9F9; }
+ table.responsive tr.row1a td { background-color: #F9F9F9; }
+ table.responsive tr.row1b td { background-color: #F6F6F6; }
+ table.responsive tr.row2a td { background-color: #E7EEF4; }
+ table.responsive tr.row2b td { background-color: #E3EBF2; }
+
+ table.responsive td {
+ width: auto !important;
+ text-align: left !important;
+ padding: 4px;
+ margin-bottom: 1px;
+ }
+
+ .rtl table.responsive td {
+ text-align: right !important;
+ }
+
+ table.responsive td.empty {
+ display: none !important;
+ }
+
+ table.responsive td > dfn {
+ display: inline-block !important;
+ }
+
+ table.responsive td > dfn:after {
+ content: ':';
+ padding-right: 5px;
+ }
+
+ table.responsive.two-columns td {
+ width: 50% !important;
+ float: left;
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
+ }
+
+ .rtl table.responsive.two-columns td {
+ float: right;
+ }
+
+ table.responsive.two-columns td:nth-child(2n+1) {
+ clear: left;
+ }
+
+ table.responsive span.rank-img {
+ float: none;
+ padding-right: 5px;
+ }
+
+ table.responsive#memberlist td:first-child input[type="checkbox"] {
+ float: right;
+ }
+
+ /* Specific tables */
+ table.responsive.forums td.folder {
+ float: left;
+ width: 27px;
+ background: transparent;
+ }
+ .rtl table.responsive.forums td.folder {
+ float: right;
+ }
+
+ table.responsive.forums td.forum-desc {
+ margin-left: 35px;
+ min-height: 27px;
+ background: transparent;
+ }
+
+ .rtl table.responsive.forums td.forum-desc {
+ margin-left: 0;
+ margin-right: 35px;
+ }
+
+ table.responsive td.actions {
+ clear: both;
+ text-align: right !important;
+ }
+
+ .rtl table.responsive td.actions {
+ text-align: left !important;
+ }
+
+ table.responsive.styles tr.responsive-style-row td:first-child {
+ padding-left: 4px !important;
+ padding-right: 4px !important;
+ }
+
+ table.responsive.styles td:first-child > dfn, table.responsive td.actions > dfn {
+ display: none !important;
+ }
+
+ .horizontal-palette td:nth-child(2n), .vertical-palette tr:nth-child(2n) {
+ display: none;
+ }
+
+ .colour-palette a {
+ display: inline-block !important;
+ }
+}
+
/* General form styles
----------------------------------------*/
fieldset {
@@ -643,6 +1073,11 @@ fieldset {
border-left: 1px solid #D7D7D7;
background-color: #FFFFFF;
position: relative;
+ border-radius: 3px;
+}
+
+fieldset h2 {
+ margin-top: 0;
}
.rtl fieldset {
@@ -652,10 +1087,6 @@ fieldset {
border-left: 1px solid #CCCCCC;
}
-* html fieldset {
- padding: 0 10px 5px 10px;
-}
-
fieldset p {
font-size: 0.85em;
}
@@ -674,23 +1105,10 @@ legend {
vertical-align: middle;
}
-* html legend {
- margin: 0 0 -10px -7px;
- line-height: 1em;
- font-size: .85em;
-}
-
-/* Holly hack, .rtl comes after html */
-* html .rtl legend {
- margin: 0;
- margin-right: -7px;
-}
-
input, textarea {
font-family: Verdana, Helvetica, Arial, sans-serif;
font-size: 0.90em;
font-weight: normal;
- cursor: text;
vertical-align: middle;
padding: 2px;
color: #111111;
@@ -720,12 +1138,20 @@ input.langvalue, textarea.langvalue {
width: 90%;
}
+input[type="number"] {
+ width: 60px;
+ -moz-padding-end: 0;
+}
+
optgroup, select {
+ background-color: #FAFAFA;
+ border: 1px solid #666666;
font-family: Verdana, Helvetica, Arial, sans-serif;
font-size: 0.85em;
font-weight: normal;
font-style: normal;
cursor: pointer;
+ padding: 1px;
vertical-align: middle;
width: auto;
color: #000;
@@ -811,8 +1237,8 @@ fieldset.quick legend {
fieldset.tabulated {
background: none;
margin: 0;
+ margin-top: 5px;
padding: 0;
- padding-top: 5px;
border: 0;
}
@@ -833,7 +1259,7 @@ fieldset.display-options {
border: none;
background-color: transparent;
text-align: center;
- font-size: 0.75em;
+ font-size: 0.85em;
}
fieldset.display-options select, fieldset.display-options input, fieldset.display-options label {
@@ -852,6 +1278,22 @@ select#full_folder_action {
width: 95%;
}
+@media only screen and (max-width: 700px), only screen and (max-device-width: 700px)
+{
+ fieldset {
+ padding: 5px;
+ }
+
+ fieldset.quick, p.quick {
+ float: none !important;
+ text-align: center;
+ }
+
+ fieldset.display-options {
+ clear: both;
+ }
+}
+
/* Definition list layout for forms
Other general def. list properties defined in prosilver_main.css
---------------------------------------- */
@@ -938,6 +1380,10 @@ fieldset dt {
border-left: 1px solid #CCCCCC;
}
+fieldset #color_palette_placeholder {
+ padding-top: 0;
+}
+
fieldset dd {
margin: 0 0 0 45%;
padding: 0 0 0 5px;
@@ -983,6 +1429,55 @@ input:focus, textarea:focus {
outline-style: none;
}
+@media only screen and (max-width: 700px), only screen and (max-device-width: 700px)
+{
+ fieldset dl {
+ margin-bottom: 5px;
+ padding-bottom: 5px;
+ border-bottom: 1px solid #e8e8e8;
+ }
+
+ fieldset > dl:last-child, fieldset > form:last-child > dl:last-child {
+ border-bottom-width: 0;
+ margin-bottom: 0;
+ }
+
+ fieldset dt, .rtl fieldset dt, fieldset dd, .rtl fieldset dd {
+ border-width: 0;
+ margin-left: 0;
+ margin-right: 0;
+ float: none;
+ width: auto;
+ }
+
+ fieldset .responsive-columns dt {
+ float: left;
+ }
+
+ .ltr fieldset dd {
+ padding-left: 20px;
+ }
+
+ .rtl fieldset dd {
+ padding-right: 20px;
+ }
+
+ select, dd select, dd input {
+ max-width: 300px;
+ }
+
+ input[type="number"], dd input[type="number"] {
+ max-width: 70px;
+ }
+}
+
+@media only screen and (max-width: 400px), only screen and (max-device-width: 400px)
+{
+ select, dd select, dd input {
+ max-width: 240px;
+ }
+}
+
/* Submit button fieldset or paragraph
---------------------------------------- */
fieldset.submit-buttons {
@@ -1009,14 +1504,21 @@ fieldset.submit-buttons legend {
display: none;
}
+@media only screen and (max-width: 700px), only screen and (max-device-width: 700px)
+{
+ p.submit-buttons {
+ margin-top: 0;
+ }
+}
+
/* Input field styles
---------------------------------------- */
-input.radio, input.permissions-checkbox {
+input.radio, input.checkbox, input.permissions-checkbox {
width: auto !important;
background-color: transparent;
border: none;
- cursor: default;
+ cursor: pointer;
}
input.full,
@@ -1024,7 +1526,6 @@ textarea.full {
width: 99%;
}
-* html input.full, * html textarea.full { width: 95%;}
input.medium { width: 50%;}
input.narrow { width: 25%;}
input.tiny { width: 10%;}
@@ -1033,7 +1534,7 @@ input.autowidth { width: auto !important;}
/* Form button styles
---------------------------------------- */
-a.button1, input.button1, input.button3,
+a.button1, input.button1,
a.button2, input.button2 {
width: auto !important;
padding: 1px 3px 0 3px;
@@ -1076,66 +1577,208 @@ input.disabled {
}
/* Focus states */
-input.button1:focus, input.button2:focus, input.button3:focus {
+input.button1:focus, input.button2:focus {
outline-style: none;
}
+/* jQuery popups
+---------------------------------------- */
+.phpbb_alert {
+ background-color: #FFFFFF;
+ border: 1px solid #999999;
+ position: fixed;
+ display: none;
+ top: 150px;
+ left: 0;
+ right: 0;
+ width: 620px;
+ margin: 0 auto;
+ z-index: 50;
+ padding: 25px;
+ padding: 0 25px 20px 25px;
+}
+
+.phpbb_alert .alert_close {
+ display: block;
+ float: right;
+ width: 16px;
+ height: 16px;
+ overflow: hidden;
+ text-decoration: none !important;
+ background: transparent url("../images/alert_close.png") 0 0 no-repeat;
+ margin-top: -7px;
+ margin-right: -31px;
+}
+.phpbb_alert .alert_close:hover {
+ background-position: 0 -16px;
+}
+
+
+.phpbb_alert p {
+ margin: 8px 0;
+ padding-bottom: 8px;
+}
+
+.phpbb_alert label {
+ display: block;
+ margin: 8px 0;
+ padding-bottom: 8px;
+}
+
+.phpbb_alert div.alert_text > p,
+.phpbb_alert div.alert_text > label,
+.phpbb_alert div.alert_text > select,
+.phpbb_alert div.alert_text > textarea,
+.phpbb_alert div.alert_text > input {
+ font-size: 0.9em;
+}
+
+#darkenwrapper {
+ display: none;
+ position: relative;
+ z-index: 44;
+}
+
+#darken {
+ position: fixed;
+ left: 0;
+ top: 0;
+ width: 100%;
+ height: 100%;
+ background-color: #000000;
+ opacity: 0.5;
+ z-index: 45;
+}
+
+@media only screen and (max-height: 500px), only screen and (max-device-width: 500px)
+{
+ .phpbb_alert {
+ top: 25px;
+ }
+}
+
+@media only screen and (max-width: 700px), only screen and (max-device-width: 700px)
+{
+ .phpbb_alert {
+ width: auto;
+ margin: 0 25px;
+ }
+}
+
+#loading_indicator {
+ background: #000000 url("../images/loading.gif") center center no-repeat;
+ border-radius: 5px;
+ display: none;
+ opacity: 0.8;
+ margin-top: -50px;
+ margin-left: -50px;
+ height: 50px;
+ width: 50px;
+ position: fixed;
+ left: 50%;
+ top: 50%;
+ z-index: 51;
+}
+
/* Pagination
---------------------------------------- */
.pagination {
+ font-size: .85em;
height: 1%; /* IE tweak (holly hack) */
width: auto;
text-align: right;
- margin-top: 5px;
- font-size: 0.85em;
- padding-bottom: 2px;
+ margin: 5px 0;
+}
+
+.top-pagination {
+ float: right;
+ margin: 15px 0 5px 0;
}
.rtl .pagination {
text-align: left;
+ float: left;
}
-.pagination strong,
-.pagination b {
- font-weight: normal;
+li.pagination {
+ margin-top: 0;
}
-.pagination span.page-sep {
- display:none;
+.pagination img {
+ vertical-align: middle;
}
-.pagination span strong {
- padding: 0 2px;
- margin: 0 2px;
- font-weight: normal;
- font-size: 0.85em;
- color: #FFFFFF;
- background: #4692BF;
- border: 1px solid #4692BF;
+.pagination ul {
+ display: inline-block;
+ *display: inline; /* IE7 inline-block hack */
+ *zoom: 1;
+ margin-left: 0;
+ margin-bottom: 0;
+}
+
+li.pagination ul {
+ margin-top: -2px;
+ vertical-align: middle;
+}
+
+.pagination ul li, dl .pagination ul li, dl.icon .pagination ul li {
+ display: inline;
+ padding: 0;
+ font-size: 100%;
+ line-height: normal;
}
-.pagination span a, .pagination span a:link, .pagination span a:visited, .pagination span a:active {
+.pagination li a, .pagnation li span, li .pagination li a, li .pagnation li span, .pagination li.active span, .pagination li.ellipsis span {
font-weight: normal;
- font-size: 0.85em;
text-decoration: none;
- color: #5C758C;
- margin: 0 2px;
padding: 0 2px;
- background: #ECEDEE;
- border: 1px solid #B4BAC0;
+ border: 1px solid transparent;
+ font-size: 0.9em;
+ line-height: 1.5em;
}
-.pagination span a:hover {
- border-color: #368AD2;
- background: #368AD2;
+.pagination li a, .pagination li a:link, .pagination li a:visited {
+ color: #5C758C;
+ background-color: #ECEDEE;
+ border-color: #B4BAC0;
+}
+
+.pagination li.ellipsis span {
+ background-color: transparent;
+ color: #000000;
+}
+
+.pagination li.active span {
color: #FFFFFF;
- text-decoration: none;
+ background-color: #4692BF;
+ border-color: #4692BF;
}
-.pagination img {
- vertical-align: middle;
+.pagination li a:hover, .pagination .active a:hover {
+ color: #FFFFFF;
+ background-color: #368AD2;
+ border-color: #368AD2;
+}
+
+.pagination li a:active, .pagination li.active a:active {
+ color: #5C758C;
+ background-color: #ECEDEE;
+ border-color: #B4BAC0;
}
+@media only screen and (max-width: 700px), only screen and (max-device-width: 700px)
+{
+ .pagination, .rtl .pagination {
+ float: none;
+ text-align: center;
+ margin: 5px 0;
+ }
+
+ .pagination li a, .pagination li span {
+ display: inline-block;
+ min-width: 10px;
+ }
+}
/* Action Highlighting
---------------------------------------- */
@@ -1144,6 +1787,7 @@ input.button1:focus, input.button2:focus, input.button3:focus {
margin: 10px 0;
color: #FFFFFF;
text-align: center;
+ clear: both;
}
.success {
@@ -1162,8 +1806,6 @@ input.button1:focus, input.button2:focus, input.button3:focus {
background-color: #BC2A4D;
}
-* html .errorbox, * html .successbox { height: 1%; } /* Pixel shift fix for IE */
-
.successbox h3, .errorbox h3 {
color: #FFFFFF;
margin: 0 0 0.5em;
@@ -1247,18 +1889,7 @@ input.button1:focus, input.button2:focus, input.button3:focus {
vertical-align: middle;
}
-/* Nice method for clearing floated blocks without having to insert any extra markup
- From http://www.positioniseverything.net/easyclearing.html
-.clearfix:after, #tabs:after, .row:after, #content:after, fieldset dl:after, #page-body:after {
- content: ".";
- display: block;
- height: 0;
- clear: both;
- visibility: hidden;
-}*/
-
-.clearfix, #tabs, .row, #content, fieldset dl, #page-body {
- height: 1%;
+.row, fieldset dl {
overflow: hidden;
}
@@ -1312,6 +1943,15 @@ input.button1:focus, input.button2:focus, input.button3:focus {
/* Permission interface
---------------------------------------- */
+.column1, .column2 {
+ width: 48%;
+ float: left;
+}
+
+.ltr .column2, .rtl .column1 {
+ float: right;
+}
+
fieldset.permissions legend {
text-transform: none;
}
@@ -1509,60 +2149,15 @@ fieldset.permissions .padding {
float: left;
background-color: #CADCEB;
width: 100%;
+ border-radius: 5px;
+ overflow: hidden;
+ padding: 5px 0;
}
.rtl .permissions-panel {
float: right;
}
-.permissions-panel span.corners-top {
- background-image: url("../images/corners_left2.gif");
-}
-
-.permissions-panel span.corners-top span {
- background-image: url("../images/corners_right2.gif");
-}
-
-.permissions-panel span.corners-bottom {
- background-image: url("../images/corners_left2.gif");
-}
-
-.permissions-panel span.corners-bottom span {
- background-image: url("../images/corners_right2.gif");
-}
-
-.permissions-panel span.corners-top, .permissions-panel span.corners-bottom,
-.permissions-panel span.corners-top span, .permissions-panel span.corners-bottom span {
- font-size: 1px;
- line-height: 1px;
- display: block;
- height: 5px;
- background-repeat: no-repeat;
-}
-
-.permissions-panel span.corners-top {
- background-image: url("../images/corners_left2.gif");
- background-position: 0 0;
- margin: 0 0;
-}
-
-.permissions-panel span.corners-top span {
- background-image: url("../images/corners_right2.gif");
- background-position: 100% 0;
-}
-
-.permissions-panel span.corners-bottom {
- background-image: url("../images/corners_left2.gif");
- background-position: 0 100%;
- margin: 0 0;
- clear: both;
-}
-
-.permissions-panel span.corners-bottom span {
- background-image: url("../images/corners_right2.gif");
- background-position: 100% 100%;
-}
-
/* Permission table
---------------------------------------- */
.permissions-panel .tablewrap {
@@ -1645,6 +2240,208 @@ fieldset.permissions .padding {
padding: 0;
}
+@media only screen and (max-width: 700px), only screen and (max-device-width: 700px)
+{
+ .column1, .column2 {
+ float: none !important;
+ width: auto;
+ }
+
+ .permissions-simple {
+ clear: both;
+ }
+
+ .permissions-simple td, .permissions-simple dd {
+ width: auto !important;
+ margin-left: 0 !important;
+ margin-right: 0 !important;
+ }
+
+ .permissions-simple dd {
+ margin-top: 5px;
+ }
+
+ .permissions-panel .tablewrap {
+ margin: 0 5px;
+ }
+
+ .permissions-category {
+ min-width: 0;
+ margin: 0 !important;
+ }
+
+ .permissions-category a, .permissions-category a span.tabbg {
+ display: block;
+ float: none !important;
+ background: transparent none;
+ }
+
+ .permissions-category a {
+ background: #d9e5ee;
+ margin: 5px 0;
+ padding: 0 !important;
+ border-radius: 3px;
+ text-decoration: underline;
+ }
+
+ .permissions-category .activetab a {
+ background-color: #dd6900;
+ color: #fff;
+ }
+
+ .permissions-category a span.tabbg {
+ color: inherit !important;
+ padding-top: 6px !important;
+ padding-bottom: 6px !important;
+ }
+
+ .permissions-category .activetab span.colour {
+ border-color: #fff;
+ }
+}
+
+/* Avatars gallery
+---------------------------------------- */
+#gallery {
+ display: block;
+ margin: 0 -5px;
+ padding: 0;
+ overflow: hidden;
+}
+
+#gallery li {
+ display: block;
+ float: left;
+ border: 1px solid #ccc;
+ border-radius: 2px;
+ background: #fff;
+ padding: 5px;
+ margin: 5px;
+}
+
+#gallery li:hover {
+ background-color: #eee;
+}
+
+#gallery li label {
+ display: block;
+ text-align: center;
+ padding: 0;
+}
+
+/* Dropdown menu
+----------------------------------------*/
+.dropdown {
+ position: absolute;
+ left: 0;
+ top: 22px;
+ z-index: 2;
+ border: 1px solid transparent;
+ border-radius: 5px;
+ padding: 9px 0 0;
+}
+
+.dropdown-up .dropdown {
+ top: auto;
+ bottom: 18px;
+ padding: 0 0 9px;
+}
+
+.dropdown-left .dropdown {
+ left: auto;
+ right: 0;
+}
+
+.dropdown .pointer, .dropdown .pointer-inner {
+ position: absolute;
+ width: 0;
+ height: 0;
+ border-top-width: 0;
+ border-bottom: 10px solid transparent;
+ border-left: 10px dashed transparent;
+ border-right: 10px dashed transparent;
+ -webkit-transform: rotate(360deg); /* better anti-aliasing in webkit */
+ display: block;
+}
+
+.dropdown-up .pointer, .dropdown-up .pointer-inner {
+ border-bottom-width: 0;
+ border-top: 10px solid transparent;
+}
+
+.dropdown .pointer {
+ right: auto;
+ left: 10px;
+ top: 0;
+ z-index: 3;
+}
+
+.dropdown-up .pointer {
+ bottom: 0;
+ top: auto;
+}
+
+.dropdown-left .dropdown .pointer {
+ left: auto;
+ right: 10px;
+}
+
+.dropdown .pointer-inner {
+ top: auto;
+ bottom: -11px;
+ left: -10px;
+}
+
+.dropdown-up .pointer-inner {
+ bottom: auto;
+ top: -11px;
+}
+
+.dropdown .pointer {
+ border-color: #B9B9B9 transparent;
+}
+
+.dropdown .pointer-inner {
+ border-color: #FFF transparent;
+}
+
+.dropdown .dropdown-contents {
+ z-index: 2;
+ overflow: hidden;
+ overflow-y: auto;
+ background: #fff;
+ border: 1px solid #b9b9b9;
+ border-radius: 5px;
+ padding: 5px;
+ position: relative;
+ min-width: 40px;
+ max-height: 200px;
+ box-shadow: 1px 3px 5px rgba(0, 0, 0, 0.2);
+ -webkit-box-sizing: border-box;
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
+}
+
+.dropdown-up .dropdown-contents {
+ box-shadow: 1px 0 5px rgba(0, 0, 0, 0.2);
+}
+
+.dropdown li {
+ float: none;
+ margin: 0;
+ white-space: nowrap;
+ text-align: left;
+}
+
+.wrap .dropdown li, .dropdown.wrap li {
+ white-space: normal;
+}
+
+.dropdown li:before, .dropdown li:after {
+ display: none !important;
+}
+
+
/* Classes for additional tasks
---------------------------------------- */
@@ -1657,3 +2454,38 @@ fieldset.permissions .padding {
.phpinfo td, .phpinfo th, .phpinfo h2, .phpinfo h1 {
text-align: left;
}
+
+.requirements_not_met {
+ padding: 5px;
+ background-color: #BC2A4D;
+}
+
+.requirements_not_met dt label, .requirements_not_met dd p {
+ color: #FFFFFF;
+ font-size: 1.4em;
+}
+
+@media only screen and (max-width: 700px), only screen and (max-device-width: 700px)
+{
+ .responsive-hide { display: none !important; }
+ .responsive-show { display: block !important; }
+ .responsive-show-inline { display: inline !important; }
+ .responsive-show-inline-block { display: inline-block !important; }
+}
+
+.clearfix {
+ overflow: hidden;
+}
+
+.pagination:after,
+#page-header:after,
+#page-body:after,
+#tabs:after,
+#tabs > ul:after,
+#tabs li:after,
+#acp:after,
+#content:after {
+ content: '';
+ clear: both;
+ display: block;
+}
diff --git a/phpBB/adm/style/admin.js b/phpBB/adm/style/admin.js
new file mode 100644
index 0000000000..253fd46a62
--- /dev/null
+++ b/phpBB/adm/style/admin.js
@@ -0,0 +1,250 @@
+/**
+* phpBB3 ACP functions
+*/
+
+/**
+* Parse document block
+*/
+function parse_document(container)
+{
+ var test = document.createElement('div'),
+ oldBrowser = (typeof test.style.borderRadius == 'undefined');
+
+ delete test;
+
+ /**
+ * Navigation
+ */
+ container.find('#menu').each(function() {
+ var menu = $(this),
+ blocks = menu.children('.menu-block');
+
+ if (!blocks.length) {
+ return;
+ }
+
+ // Set onclick event
+ blocks.children('a.header').click(function() {
+ var parent = $(this).parent();
+ if (!parent.hasClass('active')) {
+ parent.siblings().removeClass('active');
+ }
+ parent.toggleClass('active');
+ });
+
+ // Set active menu
+ menu.find('#activemenu').parents('.menu-block').addClass('active');
+
+ // Check if there is active menu
+ if (!blocks.filter('.active').length) {
+ blocks.filter(':first').addClass('active');
+ }
+ });
+
+ /**
+ * Responsive tables
+ */
+ container.find('table').not('.not-responsive').each(function() {
+ var $this = $(this),
+ th = $this.find('thead > tr > th'),
+ columns = th.length,
+ headers = [],
+ totalHeaders = 0,
+ i, headersLength;
+
+ // Find columns
+ $this.find('colgroup:first').children().each(function(i) {
+ var column = $(this);
+ $this.find('td:nth-child(' + (i + 1) + ')').addClass(column.prop('className'));
+ });
+
+ // Styles table
+ if ($this.hasClass('styles')) {
+ $this.find('td:first-child[style]').each(function() {
+ var style = $(this).attr('style');
+ if (style.length) {
+ $(this).parent('tr').attr('style', style.toLowerCase().replace('padding', 'margin')).addClass('responsive-style-row');
+ }
+ });
+ }
+
+ // Find each header
+ if (!$this.data('no-responsive-header'))
+ {
+ th.each(function(column) {
+ var cell = $(this),
+ colspan = parseInt(cell.attr('colspan')),
+ dfn = cell.attr('data-dfn'),
+ text = dfn ? dfn : $.trim(cell.text());
+
+ if (text == '&nbsp;') text = '';
+ colspan = isNaN(colspan) || colspan < 1 ? 1 : colspan;
+
+ for (i=0; i<colspan; i++) {
+ headers.push(text);
+ }
+ totalHeaders ++;
+
+ if (dfn && !column) {
+ $this.addClass('show-header');
+ }
+ });
+ }
+
+ headersLength = headers.length;
+
+ // Add header text to each cell as <dfn>
+ $this.addClass('responsive');
+
+ if (totalHeaders < 2) {
+ $this.addClass('show-header');
+ return;
+ }
+
+ $this.find('tbody > tr').each(function() {
+ var row = $(this),
+ cells = row.children('td'),
+ column = 0;
+
+ if (cells.length == 1) {
+ row.addClass('big-column');
+ return;
+ }
+
+ cells.each(function() {
+ var cell = $(this),
+ colspan = parseInt(cell.attr('colspan')),
+ text = $.trim(cell.text());
+
+ if (headersLength <= column) {
+ return;
+ }
+
+ if ((text.length && text !== '-') || cell.children().length) {
+ if (headers[column] != '') {
+ cell.prepend('<dfn style="display: none;">' + headers[column] + '</dfn>');
+ }
+ }
+ else {
+ cell.addClass('empty');
+ }
+
+ colspan = isNaN(colspan) || colspan < 1 ? 1 : colspan;
+ column += colspan;
+ });
+ });
+
+ // Remove <dfn> in disabled extensions list
+ $this.find('tr.ext_disabled > .empty:nth-child(2) + .empty').siblings(':first-child').children('dfn').remove();
+ });
+
+ /**
+ * Hide empty responsive tables
+ */
+ container.find('table.responsive > tbody').each(function() {
+ var items = $(this).children('tr');
+ if (items.length == 0)
+ {
+ $(this).parent('table:first').addClass('responsive-hide');
+ }
+ });
+
+ /**
+ * Fieldsets with empty <span>
+ */
+ container.find('fieldset dt > span:last-child').each(function() {
+ var $this = $(this);
+ if ($this.html() == '&nbsp;') {
+ $this.addClass('responsive-hide');
+ }
+
+ });
+
+ /**
+ * Responsive tabs
+ */
+ container.find('#tabs').not('[data-skip-responsive]').each(function() {
+ var $this = $(this),
+ $body = $('body'),
+ ul = $this.children(),
+ tabs = ul.children().not('[data-skip-responsive]'),
+ links = tabs.children('a'),
+ item = ul.append('<li class="tab responsive-tab" style="display:none;"><a href="javascript:void(0);" class="responsive-tab-link">&nbsp;</a><div class="dropdown tab-dropdown" style="display: none;"><div class="pointer"><div class="pointer-inner" /></div><ul class="dropdown-contents" /></div></li>').find('li.responsive-tab'),
+ menu = item.find('.dropdown-contents'),
+ maxHeight = 0,
+ lastWidth = false,
+ responsive = false;
+
+ links.each(function() {
+ var link = $(this);
+ maxHeight = Math.max(maxHeight, Math.max(link.outerHeight(true), link.parent().outerHeight(true)));
+ })
+
+ function check() {
+ var width = $body.width(),
+ height = $this.height();
+
+ if (arguments.length == 0 && (!responsive || width <= lastWidth) && height <= maxHeight) {
+ return;
+ }
+
+ tabs.show();
+ item.hide();
+
+ lastWidth = width;
+ height = $this.height();
+ if (height <= maxHeight) {
+ responsive = false;
+ if (item.hasClass('dropdown-visible')) {
+ phpbb.toggleDropdown.call(item.find('a.responsive-tab-link').get(0));
+ }
+ return;
+ }
+
+ responsive = true;
+ item.show();
+ menu.html('');
+
+ var availableTabs = tabs.filter(':not(.activetab, .responsive-tab)'),
+ total = availableTabs.length,
+ i, tab;
+
+ for (i = total - 1; i >= 0; i --) {
+ tab = availableTabs.eq(i);
+ menu.prepend(tab.clone(true).removeClass('tab'));
+ tab.hide();
+ if ($this.height() <= maxHeight) {
+ menu.find('a').click(function() { check(true); });
+ return;
+ }
+ }
+ menu.find('a').click(function() { check(true); });
+ }
+
+ phpbb.registerDropdown(item.find('a.responsive-tab-link'), item.find('.dropdown'), {visibleClass: 'activetab', verticalDirection: 'down'});
+
+ check(true);
+ $(window).resize(check);
+ });
+}
+
+/**
+* Run onload functions
+*/
+(function($) {
+ $(document).ready(function() {
+ // Swap .nojs and .hasjs
+ $('body.nojs').toggleClass('nojs hasjs');
+
+ // Focus forms
+ $('form[data-focus]:first').each(function() {
+ $('#' + this.getAttribute('data-focus')).focus();
+ });
+
+ parse_document($('body'));
+
+ // Hide configlist and success message in send statistics page
+ phpbb.toggleDisplay('configlist', -1);
+ phpbb.toggleDisplay('questionnaire-thanks', -1);
+ });
+})(jQuery);
diff --git a/phpBB/adm/style/ajax.js b/phpBB/adm/style/ajax.js
new file mode 100644
index 0000000000..77fd28fbe6
--- /dev/null
+++ b/phpBB/adm/style/ajax.js
@@ -0,0 +1,221 @@
+/* global phpbb */
+
+(function($) { // Avoid conflicts with other libraries
+
+'use strict';
+
+/**
+ * The following callbacks are for reording items. row_down
+ * is triggered when an item is moved down, and row_up is triggered when
+ * an item is moved up. It moves the row up or down, and deactivates /
+ * activates any up / down icons that require it (the ones at the top or bottom).
+ */
+phpbb.addAjaxCallback('row_down', function(res) {
+ if (typeof res.success === 'undefined' || !res.success) {
+ return;
+ }
+
+ var $firstTr = $(this).parents('tr'),
+ $secondTr = $firstTr.next();
+
+ $firstTr.insertAfter($secondTr);
+});
+
+phpbb.addAjaxCallback('row_up', function(res) {
+ if (typeof res.success === 'undefined' || !res.success) {
+ return;
+ }
+
+ var $secondTr = $(this).parents('tr'),
+ $firstTr = $secondTr.prev();
+
+ $secondTr.insertBefore($firstTr);
+});
+
+/**
+ * This callback replaces activate links with deactivate links and vice versa.
+ * It does this by replacing the text, and replacing all instances of "activate"
+ * in the href with "deactivate", and vice versa.
+ */
+phpbb.addAjaxCallback('activate_deactivate', function(res) {
+ var $this = $(this),
+ newHref = $this.attr('href');
+
+ $this.text(res.text);
+
+ if (newHref.indexOf('deactivate') !== -1) {
+ newHref = newHref.replace('deactivate', 'activate');
+ } else {
+ newHref = newHref.replace('activate', 'deactivate');
+ }
+
+ $this.attr('href', newHref);
+});
+
+/**
+ * The removes the parent row of the link or form that triggered the callback,
+ * and is good for stuff like the removal of forums.
+ */
+phpbb.addAjaxCallback('row_delete', function(res) {
+ if (res.SUCCESS !== false) {
+ $(this).parents('tr').remove();
+ }
+});
+
+/**
+ * Handler for submitting permissions form in chunks
+ * This call will submit permissions forms in chunks of 5 fieldsets.
+ */
+function submitPermissions() {
+ var $form = $('form#set-permissions'),
+ fieldsetList = $form.find('fieldset[id^=perm]'),
+ formDataSets = [],
+ $submitAllButton = $form.find('input[type=submit][name^=action]')[0],
+ $submitButton = $form.find('input[type=submit][data-clicked=true]')[0];
+
+ // Set proper start values for handling refresh of page
+ var permissionSubmitSize = 0,
+ permissionRequestCount = 0,
+ forumIds = [],
+ permissionSubmitFailed = false;
+
+ if ($submitAllButton !== $submitButton) {
+ fieldsetList = $form.find('fieldset#' + $submitButton.closest('fieldset.permissions').id);
+ }
+
+ $.each(fieldsetList, function (key, value) {
+ if (key % 5 === 0) {
+ formDataSets[Math.floor(key / 5)] = $form.find('fieldset#' + value.id).serialize();
+ } else {
+ formDataSets[Math.floor(key / 5)] += '&' + $form.find('fieldset#' + value.id).serialize();
+ }
+ });
+
+ permissionSubmitSize = formDataSets.length;
+
+ // Add each forum ID to forum ID list to preserve selected forums
+ $.each($form.find('input[type=hidden][name^=forum_id]'), function (key, value) {
+ if (value.name.match(/^forum_id\[([0-9]+)\]$/)) {
+ forumIds.push(value.value);
+ }
+ });
+
+ /**
+ * Handler for submitted permissions form chunk
+ *
+ * @param {object} res Object returned by AJAX call
+ */
+ function handlePermissionReturn(res) {
+ permissionRequestCount++;
+ var $dark = $('#darkenwrapper');
+
+ if (res.S_USER_WARNING) {
+ phpbb.alert(res.MESSAGE_TITLE, res.MESSAGE_TEXT);
+ permissionSubmitFailed = true;
+ } else if (!permissionSubmitFailed && res.S_USER_NOTICE) {
+ // Display success message at the end of submitting the form
+ if (permissionRequestCount >= permissionSubmitSize) {
+ var $alert = phpbb.alert(res.MESSAGE_TITLE, res.MESSAGE_TEXT);
+ var $alertBoxLink = $alert.find('p.alert_text > a');
+
+ // Create form to submit instead of normal "Back to previous page" link
+ if ($alertBoxLink) {
+ // Remove forum_id[] from URL
+ $alertBoxLink.attr('href', $alertBoxLink.attr('href').replace(/(&forum_id\[\]=[0-9]+)/g, ''));
+ var previousPageForm = '<form action="' + $alertBoxLink.attr('href') + '" method="post">';
+ $.each(forumIds, function (key, value) {
+ previousPageForm += '<input type="text" name="forum_id[]" value="' + value + '" />';
+ });
+ previousPageForm += '</form>';
+
+ $alertBoxLink.on('click', function (e) {
+ var $previousPageForm = $(previousPageForm);
+ $('body').append($previousPageForm);
+ e.preventDefault();
+ $previousPageForm.submit();
+ });
+ }
+
+ // Do not allow closing alert
+ $dark.off('click');
+ $alert.find('.alert_close').hide();
+
+ if (typeof res.REFRESH_DATA !== 'undefined') {
+ setTimeout(function () {
+ // Create forum to submit using POST. This will prevent
+ // exceeding the maximum length of URLs
+ var form = '<form action="' + res.REFRESH_DATA.url.replace(/(&forum_id\[\]=[0-9]+)/g, '') + '" method="post">';
+ $.each(forumIds, function (key, value) {
+ form += '<input type="text" name="forum_id[]" value="' + value + '" />';
+ });
+ form += '</form>';
+ $form = $(form);
+ $('body').append($form);
+
+ // Hide the alert even if we refresh the page, in case the user
+ // presses the back button.
+ $dark.fadeOut(phpbb.alertTime, function () {
+ if (typeof $alert !== 'undefined') {
+ $alert.hide();
+ }
+ });
+
+ // Submit form
+ $form.submit();
+ }, res.REFRESH_DATA.time * 1000); // Server specifies time in seconds
+ }
+ }
+ }
+ }
+
+ // Create AJAX request for each form data set
+ $.each(formDataSets, function (key, formData) {
+ $.ajax({
+ url: $form.action,
+ type: 'POST',
+ data: formData + '&' + $submitButton.name + '=' + encodeURIComponent($submitButton.value) +
+ '&creation_time=' + $form.find('input[type=hidden][name=creation_time]')[0].value +
+ '&form_token=' + $form.find('input[type=hidden][name=form_token]')[0].value +
+ '&' + $form.children('input[type=hidden]').serialize() +
+ '&' + $form.find('input[type=checkbox][name^=inherit]').serialize(),
+ success: handlePermissionReturn,
+ error: handlePermissionReturn
+ });
+ });
+}
+
+$('[data-ajax]').each(function() {
+ var $this = $(this),
+ ajax = $this.attr('data-ajax');
+
+ if (ajax !== 'false') {
+ var fn = (ajax !== 'true') ? ajax : null;
+ phpbb.ajaxify({
+ selector: this,
+ refresh: $this.attr('data-refresh') !== undefined,
+ callback: fn
+ });
+ }
+});
+
+/**
+* Automatically resize textarea
+*/
+$(function() {
+ phpbb.resizeTextArea($('textarea:not(.no-auto-resize)'), {minHeight: 75});
+
+ var $setPermissionsForm = $('form#set-permissions');
+ if ($setPermissionsForm.length) {
+ $setPermissionsForm.on('submit', function (e) {
+ submitPermissions();
+ e.preventDefault();
+ });
+ $setPermissionsForm.find('input[type=submit]').click(function() {
+ $('input[type=submit]', $(this).parents($('form#set-permissions'))).removeAttr('data-clicked');
+ $(this).attr('data-clicked', true);
+ });
+ }
+});
+
+
+})(jQuery); // Avoid conflicts with other libraries
diff --git a/phpBB/adm/style/auth_provider_ldap.html b/phpBB/adm/style/auth_provider_ldap.html
new file mode 100644
index 0000000000..97684db396
--- /dev/null
+++ b/phpBB/adm/style/auth_provider_ldap.html
@@ -0,0 +1,35 @@
+<fieldset id="auth_ldap_settings">
+ <legend>{L_LDAP}</legend>
+ <dl>
+ <dt><label for="ldap_server">{L_LDAP_SERVER}{L_COLON}</label><br /><span>{L_LDAP_SERVER_EXPLAIN}</span></dt>
+ <dd><input type="text" id="ldap_server" size="40" name="config[ldap_server]" value="{AUTH_LDAP_SERVER}" /></dd>
+ </dl>
+ <dl>
+ <dt><label for="ldap_port">{L_LDAP_PORT}{L_COLON}</label><br /><span>{L_LDAP_PORT_EXPLAIN}</span></dt>
+ <dd><input type="text" id="ldap_port" size="40" name="config[ldap_port]" value="{AUTH_LDAP_PORT}" /></dd>
+ </dl>
+ <dl>
+ <dt><label for="ldap_dn">{L_LDAP_DN}{L_COLON}</label><br /><span>{L_LDAP_DN_EXPLAIN}</span></dt>
+ <dd><input type="text" id="ldap_dn" size="40" name="config[ldap_base_dn]" value="{AUTH_LDAP_BASE_DN}" /></dd>
+ </dl>
+ <dl>
+ <dt><label for="ldap_uid">{L_LDAP_UID}{L_COLON}</label><br /><span>{L_LDAP_UID_EXPLAIN}</span></dt>
+ <dd><input type="text" id="ldap_uid" size="40" name="config[ldap_uid]" value="{AUTH_LDAP_UID}" /></dd>
+ </dl>
+ <dl>
+ <dt><label for="ldap_user_filter">{L_LDAP_USER_FILTER}{L_COLON}</label><br /><span>{L_LDAP_USER_FILTER_EXPLAIN}</span></dt>
+ <dd><input type="text" id="ldap_user_filter" size="40" name="config[ldap_user_filter]" value="{AUTH_LDAP_USER_FILTER}" /></dd>
+ </dl>
+ <dl>
+ <dt><label for="ldap_email">{L_LDAP_EMAIL}{L_COLON}</label><br /><span>{L_LDAP_EMAIL_EXPLAIN}</span></dt>
+ <dd><input type="text" id="ldap_email" size="40" name="config[ldap_email]" value="{AUTH_LDAP_EMAIL}" /></dd>
+ </dl>
+ <dl>
+ <dt><label for="ldap_user">{L_LDAP_USER}{L_COLON}</label><br /><span>{L_LDAP_USER_EXPLAIN}</span></dt>
+ <dd><input type="text" id="ldap_user" size="40" name="config[ldap_user]" value="{AUTH_LDAP_USER}" /></dd>
+ </dl>
+ <dl>
+ <dt><label for="ldap_password">{L_LDAP_PASSWORD}{L_COLON}</label><br /><span>{L_LDAP_PASSWORD_EXPLAIN}</span></dt>
+ <dd><input type="password" id="ldap_password" size="40" name="config[ldap_password]" value="{AUTH_LDAP_PASSWORD}" autocomplete="off" /></dd>
+ </dl>
+</fieldset>
diff --git a/phpBB/adm/style/auth_provider_oauth.html b/phpBB/adm/style/auth_provider_oauth.html
new file mode 100644
index 0000000000..4c8ff4d36c
--- /dev/null
+++ b/phpBB/adm/style/auth_provider_oauth.html
@@ -0,0 +1,18 @@
+
+<div id="auth_oauth_settings">
+ <p>{L_AUTH_PROVIDER_OAUTH_EXPLAIN}</p>
+
+ <!-- BEGIN oauth_services -->
+ <fieldset>
+ <legend>{oauth_services.ACTUAL_NAME}</legend>
+ <dl>
+ <dt><label for="oauth_service_{oauth_services.NAME}_key">{L_AUTH_PROVIDER_OAUTH_KEY}{L_COLON}</label></dt>
+ <dd><input type="text" id="oauth_service_{oauth_services.NAME}_key" size="40" name="config[auth_oauth_{oauth_services.NAME}_key]" value="{oauth_services.KEY}" /></dd>
+ </dl>
+ <dl>
+ <dt><label for="oauth_service_{oauth_services.NAME}_secret">{L_AUTH_PROVIDER_OAUTH_SECRET}{L_COLON}</label></dt>
+ <dd><input type="text" id="oauth_service_{oauth_services.NAME}_secret" size="40" name="config[auth_oauth_{oauth_services.NAME}_secret]" value="{oauth_services.SECRET}" /></dd>
+ </dl>
+ </fieldset>
+ <!-- END oauth_services -->
+</div>
diff --git a/phpBB/adm/style/captcha_default_acp_demo.html b/phpBB/adm/style/captcha_default_acp_demo.html
index 0b1434f7e0..0f137f28df 100644
--- a/phpBB/adm/style/captcha_default_acp_demo.html
+++ b/phpBB/adm/style/captcha_default_acp_demo.html
@@ -1,4 +1,4 @@
<dl>
- <dt><label for="captcha_preview">{L_PREVIEW}:</label><br /><span>{L_CAPTCHA_PREVIEW_EXPLAIN}</span></dt>
+ <dt><label for="captcha_preview">{L_PREVIEW}{L_COLON}</label><br /><span>{L_CAPTCHA_PREVIEW_EXPLAIN}</span></dt>
<dd><img src="{CONFIRM_IMAGE}" alt="{L_PREVIEW}" width="360" height="96" id="captcha_preview" /></dd>
</dl>
diff --git a/phpBB/adm/style/captcha_gd_acp.html b/phpBB/adm/style/captcha_gd_acp.html
index d0bb758cfe..43d54adc0b 100644
--- a/phpBB/adm/style/captcha_gd_acp.html
+++ b/phpBB/adm/style/captcha_gd_acp.html
@@ -1,6 +1,6 @@
<!-- INCLUDE overall_header.html -->
-<a name="maincontent"></a>
+<a id="maincontent"></a>
<a href="{U_ACTION}" style="float: {S_CONTENT_FLOW_END};">&laquo; {L_BACK}</a>
<h1>{L_ACP_VC_SETTINGS}</h1>
@@ -14,32 +14,32 @@
<legend>{L_GENERAL_OPTIONS}</legend>
<dl>
- <dt><label for="captcha_gd_foreground_noise">{L_CAPTCHA_GD_FOREGROUND_NOISE}:</label><br /><span>{L_CAPTCHA_GD_FOREGROUND_NOISE_EXPLAIN}</span></dt>
+ <dt><label for="captcha_gd_foreground_noise">{L_CAPTCHA_GD_FOREGROUND_NOISE}{L_COLON}</label><br /><span>{L_CAPTCHA_GD_FOREGROUND_NOISE_EXPLAIN}</span></dt>
<dd><label><input id="captcha_gd_foreground_noise" name="captcha_gd_foreground_noise" value="1" class="radio" type="radio"<!-- IF CAPTCHA_GD_FOREGROUND_NOISE --> checked="checked"<!-- ENDIF --> /> {L_YES}</label>
<label><input name="captcha_gd_foreground_noise" value="0" class="radio" type="radio"<!-- IF not CAPTCHA_GD_FOREGROUND_NOISE --> checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd>
</dl>
<dl>
- <dt><label for="captcha_gd_x_grid">{L_CAPTCHA_GD_X_GRID}:</label><br /><span>{L_CAPTCHA_GD_X_GRID_EXPLAIN}</span></dt>
- <dd><input id="captcha_gd_x_grid" name="captcha_gd_x_grid" value="{CAPTCHA_GD_X_GRID}" type="text" /></dd>
+ <dt><label for="captcha_gd_x_grid">{L_CAPTCHA_GD_X_GRID}{L_COLON}</label><br /><span>{L_CAPTCHA_GD_X_GRID_EXPLAIN}</span></dt>
+ <dd><input id="captcha_gd_x_grid" name="captcha_gd_x_grid" value="{CAPTCHA_GD_X_GRID}" type="number" /></dd>
</dl>
<dl>
- <dt><label for="captcha_gd_y_grid">{L_CAPTCHA_GD_Y_GRID}:</label><br /><span>{L_CAPTCHA_GD_Y_GRID_EXPLAIN}</span></dt>
- <dd><input id="captcha_gd_y_grid" name="captcha_gd_y_grid" value="{CAPTCHA_GD_Y_GRID}" type="text" /></dd>
+ <dt><label for="captcha_gd_y_grid">{L_CAPTCHA_GD_Y_GRID}{L_COLON}</label><br /><span>{L_CAPTCHA_GD_Y_GRID_EXPLAIN}</span></dt>
+ <dd><input id="captcha_gd_y_grid" name="captcha_gd_y_grid" value="{CAPTCHA_GD_Y_GRID}" type="number" /></dd>
</dl>
<dl>
- <dt><label for="captcha_gd_wave">{L_CAPTCHA_GD_WAVE}:</label><br /><span>{L_CAPTCHA_GD_WAVE_EXPLAIN}</span></dt>
+ <dt><label for="captcha_gd_wave">{L_CAPTCHA_GD_WAVE}{L_COLON}</label><br /><span>{L_CAPTCHA_GD_WAVE_EXPLAIN}</span></dt>
<dd><label><input id="captcha_gd_wave" name="captcha_gd_wave" value="1" class="radio" type="radio"<!-- IF CAPTCHA_GD_WAVE --> checked="checked"<!-- ENDIF --> /> {L_YES}</label>
<label><input name="captcha_gd_wave" value="0" class="radio" type="radio"<!-- IF not CAPTCHA_GD_WAVE --> checked="checked"<!-- ENDIF --> /> {L_NO}</label>
</dd>
</dl>
<dl>
- <dt><label for="captcha_gd_3d_noise">{L_CAPTCHA_GD_3D_NOISE}:</label><br /><span>{L_CAPTCHA_GD_3D_NOISE_EXPLAIN}</span></dt>
+ <dt><label for="captcha_gd_3d_noise">{L_CAPTCHA_GD_3D_NOISE}{L_COLON}</label><br /><span>{L_CAPTCHA_GD_3D_NOISE_EXPLAIN}</span></dt>
<dd><label><input id="captcha_gd_3d_noise" name="captcha_gd_3d_noise" value="1" class="radio" type="radio"<!-- IF CAPTCHA_GD_3D_NOISE --> checked="checked"<!-- ENDIF --> /> {L_YES}</label>
<label><input name="captcha_gd_3d_noise" value="0" class="radio" type="radio"<!-- IF not CAPTCHA_GD_3D_NOISE --> checked="checked"<!-- ENDIF --> /> {L_NO}</label>
</dd>
</dl>
<dl>
- <dt><label for="captcha_gd_fonts">{L_CAPTCHA_GD_FONTS}:</label><br /><span>{L_CAPTCHA_GD_FONTS_EXPLAIN}</span></dt>
+ <dt><label for="captcha_gd_fonts">{L_CAPTCHA_GD_FONTS}{L_COLON}</label><br /><span>{L_CAPTCHA_GD_FONTS_EXPLAIN}</span></dt>
<dd><label><input id="captcha_gd_fonts" name="captcha_gd_fonts" value="1" class="radio" type="radio"<!-- IF CAPTCHA_GD_FONTS == 1 --> checked="checked"<!-- ENDIF --> /> {L_CAPTCHA_FONT_DEFAULT}</label>
<label><input name="captcha_gd_fonts" value="2" class="radio" type="radio"<!-- IF CAPTCHA_GD_FONTS == 2 --> checked="checked"<!-- ENDIF --> /> {L_CAPTCHA_FONT_NEW}</label>
<label><input name="captcha_gd_fonts" value="3" class="radio" type="radio"<!-- IF CAPTCHA_GD_FONTS == 3 --> checked="checked"<!-- ENDIF --> /> {L_CAPTCHA_FONT_LOWER}</label>
diff --git a/phpBB/adm/style/captcha_qa_acp.html b/phpBB/adm/style/captcha_qa_acp.html
index e0fc6fc67e..6235f9a104 100644
--- a/phpBB/adm/style/captcha_qa_acp.html
+++ b/phpBB/adm/style/captcha_qa_acp.html
@@ -1,6 +1,6 @@
<!-- INCLUDE overall_header.html -->
-<a name="maincontent"></a>
+<a id="maincontent"></a>
<a href="<!-- IF U_LIST -->{U_LIST}<!-- ELSE -->{U_ACTION}<!-- ENDIF -->" style="float: {S_CONTENT_FLOW_END};">&laquo; {L_BACK}</a>
@@ -14,7 +14,7 @@
<fieldset class="tabulated">
<legend>{L_QUESTIONS}</legend>
- <table cellspacing="1">
+ <table class="table1 zebra-table">
<thead>
<tr>
<th colspan="3">{L_QUESTIONS}</th>
@@ -27,14 +27,12 @@
</thead>
<tbody>
<!-- BEGIN questions -->
-
- <!-- IF questions.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
-
+ <tr>
<td style="text-align: left;">{questions.QUESTION_TEXT}</td>
<td style="text-align: center;">{questions.QUESTION_LANG}</td>
<td style="text-align: center;"><a href="{questions.U_EDIT}">{ICON_EDIT}</a>&nbsp;<a href="{questions.U_DELETE}">{ICON_DELETE}</a></td>
- </tr>
- <!-- END questions -->
+ </tr>
+ <!-- END questions -->
</tbody>
</table>
<fieldset class="quick">
@@ -59,7 +57,7 @@
<fieldset>
<legend>{L_EDIT_QUESTION}</legend>
<dl>
- <dt><label for="strict">{L_QUESTION_STRICT}:</label><br /><span>{L_QUESTION_STRICT_EXPLAIN}</span></dt>
+ <dt><label for="strict">{L_QUESTION_STRICT}{L_COLON}</label><br /><span>{L_QUESTION_STRICT_EXPLAIN}</span></dt>
<dd><label><input type="radio" class="radio" name="strict" value="1"<!-- IF STRICT --> id="strict" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
<label><input type="radio" class="radio" name="strict" value="0"<!-- IF not STRICT --> id="strict" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd>
</dl>
diff --git a/phpBB/adm/style/captcha_qa_acp_demo.html b/phpBB/adm/style/captcha_qa_acp_demo.html
index 0ea2d6a024..79170e27c6 100644
--- a/phpBB/adm/style/captcha_qa_acp_demo.html
+++ b/phpBB/adm/style/captcha_qa_acp_demo.html
@@ -1,5 +1,5 @@
<dl>
- <dt><label for="answer"><!-- IF QA_CONFIRM_QUESTION --> {QA_CONFIRM_QUESTION} <!-- ELSE --> {L_CONFIRM_QUESTION} <!-- ENDIF -->:</label><br /><span>{L_CONFIRM_QUESTION_EXPLAIN}</span></dt>
+ <dt><label for="answer"><!-- IF QA_CONFIRM_QUESTION --> {QA_CONFIRM_QUESTION} <!-- ELSE --> {L_CONFIRM_QUESTION} <!-- ENDIF -->{L_COLON}</label><br /><span>{L_CONFIRM_QUESTION_EXPLAIN}</span></dt>
<dd>
<input type="text" tabindex="10" name="answer" id="answer" size="45" class="inputbox autowidth" title="{L_ANSWER}" />
diff --git a/phpBB/adm/style/captcha_recaptcha_acp.html b/phpBB/adm/style/captcha_recaptcha_acp.html
index 5b97cff984..67176ebd07 100644
--- a/phpBB/adm/style/captcha_recaptcha_acp.html
+++ b/phpBB/adm/style/captcha_recaptcha_acp.html
@@ -1,6 +1,6 @@
<!-- INCLUDE overall_header.html -->
-<a name="maincontent"></a>
+<a id="maincontent"></a>
<h1>{L_ACP_VC_SETTINGS}</h1>
@@ -13,11 +13,11 @@
<legend>{L_GENERAL_OPTIONS}</legend>
<dl>
- <dt><label for="recaptcha_pubkey">{L_RECAPTCHA_PUBLIC}:</label><br /><span>{L_RECAPTCHA_PUBLIC_EXPLAIN}</span></dt>
+ <dt><label for="recaptcha_pubkey">{L_RECAPTCHA_PUBLIC}{L_COLON}</label><br /><span>{L_RECAPTCHA_PUBLIC_EXPLAIN}</span></dt>
<dd><input id="recaptcha_pubkey" name="recaptcha_pubkey" value="{RECAPTCHA_PUBKEY}" size="50" type="text" /></dd>
</dl>
<dl>
- <dt><label for="recaptcha_privkey">{L_RECAPTCHA_PRIVATE}:</label><br /><span>{L_RECAPTCHA_PRIVATE_EXPLAIN}</span></dt>
+ <dt><label for="recaptcha_privkey">{L_RECAPTCHA_PRIVATE}{L_COLON}</label><br /><span>{L_RECAPTCHA_PRIVATE_EXPLAIN}</span></dt>
<dd><input id="recaptcha_privkey" name="recaptcha_privkey" value="{RECAPTCHA_PRIVKEY}" size="50" type="text" /></dd>
</dl>
diff --git a/phpBB/adm/style/colour_swatch.html b/phpBB/adm/style/colour_swatch.html
deleted file mode 100644
index c9e89980d8..0000000000
--- a/phpBB/adm/style/colour_swatch.html
+++ /dev/null
@@ -1,78 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" dir="{S_CONTENT_DIRECTION}" lang="{S_USER_LANG}" xml:lang="{S_USER_LANG}">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset={S_CONTENT_ENCODING}" />
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Language" content="{S_USER_LANG}" />
-<meta http-equiv="imagetoolbar" content="no" />
-<title>{L_COLOUR_SWATCH}</title>
-
-<style type="text/css">
-/* <![CDATA[ */
- body {
- background-color: #404040;
- color: #fff;
- }
-
- td {
- border: solid 1px #333;
- }
-
- .over {
- border-color: white;
- }
-
- .out {
- border-color: #333333;
- }
-
- img {
- border: 0;
- }
-/* ]]> */
-</style>
-</head>
-
-<body>
-
-<script type="text/javascript">
-// <![CDATA[
- var r = 0, g = 0, b = 0;
-
- var numberList = new Array(6);
- numberList[0] = '00';
- numberList[1] = '33';
- numberList[2] = '66';
- numberList[3] = '99';
- numberList[4] = 'CC';
- numberList[5] = 'FF';
-
- document.writeln('<table cellspacing="0" cellpadding="0" border="0">');
-
- for (r = 0; r < 6; r++)
- {
- document.writeln('<tr>');
-
- for (g = 0; g < 6; g++)
- {
- for (b = 0; b < 6; b++)
- {
- color = String(numberList[r]) + String(numberList[g]) + String(numberList[b]);
- document.write('<td style="background-color: #' + color + ';" onmouseover="this.className=\'over\'" onmouseout="this.className=\'out\'">');
- document.write('<a href="#" onclick="cell(\'' + color + '\'); return false;"><img src="{T_IMAGES_PATH}spacer.gif" width="15" height="12" alt="#' + color + '" title="#' + color + '" \/><\/a>');
- document.writeln('<\/td>');
- }
- }
- document.writeln('<\/tr>');
- }
- document.writeln('<\/table>');
-
- function cell(color)
- {
- opener.document.forms["{OPENER}"].{NAME}.value = color;
- }
-// ]]>
-</script>
-
-</body>
-</html> \ No newline at end of file
diff --git a/phpBB/adm/style/confirm_body.html b/phpBB/adm/style/confirm_body.html
index 2fbb1a60d7..d0360d1b3a 100644
--- a/phpBB/adm/style/confirm_body.html
+++ b/phpBB/adm/style/confirm_body.html
@@ -1,3 +1,15 @@
+<!-- IF S_AJAX_REQUEST -->
+
+ <h3>{MESSAGE_TITLE}</h3>
+ <p>{MESSAGE_TEXT}</p>
+
+ <fieldset class="submit-buttons">
+ <input type="button" name="confirm" value="{L_YES}" class="button2" />&nbsp;
+ <input type="button" name="cancel" value="{L_NO}" class="button2" />
+ </fieldset>
+
+<!-- ELSE -->
+
<!-- INCLUDE overall_header.html -->
<form id="confirm" method="post" action="{S_CONFIRM_ACTION}">
@@ -14,7 +26,7 @@
</div>
</fieldset>
-
</form>
<!-- INCLUDE overall_footer.html -->
+<!-- ENDIF -->
diff --git a/phpBB/adm/style/confirm_body_prune.html b/phpBB/adm/style/confirm_body_prune.html
index 9481386231..4c00ac2c3d 100644
--- a/phpBB/adm/style/confirm_body_prune.html
+++ b/phpBB/adm/style/confirm_body_prune.html
@@ -2,6 +2,23 @@
<form id="confirm" method="post" action="{S_CONFIRM_ACTION}">
+<fieldset id="userlist">
+ <h2>{L_PRUNE_USERS_LIST}</h2>
+ <!-- IF S_DEACTIVATE --><p>{L_PRUNE_USERS_LIST_DEACTIVATE}</p><!-- ELSE --><p>{L_PRUNE_USERS_LIST_DELETE}</p><!-- ENDIF -->
+
+ <br />
+ <!-- BEGIN users -->
+ &raquo; <input type="checkbox" name="user_ids[]" value="{users.USER_ID}" checked="checked" />
+ <a href="{users.U_PROFILE}">{users.USERNAME}</a>
+ <!-- IF users.U_USER_ADMIN --> [ <a href="{users.U_USER_ADMIN}">{L_USER_ADMIN}</a> ]<!-- ENDIF --><br />
+ <!-- END users -->
+ <br />
+ <span class="small">
+ <a href="#" onclick="marklist('userlist', 'user_ids', true)">{L_MARK_ALL}</a> &bull;
+ <a href="#" onclick="marklist('userlist', 'user_ids', false)">{L_UNMARK_ALL}</a>
+ </span>
+</fieldset>
+
<fieldset>
<h1>{MESSAGE_TITLE}</h1>
<p>{MESSAGE_TEXT}</p>
@@ -12,17 +29,6 @@
<input type="submit" name="confirm" value="{L_YES}" class="button2" />&nbsp;
<input type="submit" name="cancel" value="{L_NO}" class="button2" />
</div>
-
- <h2>{L_PRUNE_USERS_LIST}</h2>
- <!-- IF S_DEACTIVATE --><p>{L_PRUNE_USERS_LIST_DEACTIVATE}</p><!-- ELSE --><p>{L_PRUNE_USERS_LIST_DELETE}</p><!-- ENDIF -->
-
- <br />
- <!-- BEGIN users -->
- &raquo; <a href="{users.U_PROFILE}">{users.USERNAME}</a><!-- IF users.U_USER_ADMIN --> [<a href="{users.U_USER_ADMIN}">{L_USER_ADMIN}</a>]<!-- ENDIF --><br />
- <!-- END users -->
-
- <br /><br />
-
</fieldset>
</form>
diff --git a/phpBB/adm/style/custom_profile_fields.html b/phpBB/adm/style/custom_profile_fields.html
deleted file mode 100644
index 351397d3c7..0000000000
--- a/phpBB/adm/style/custom_profile_fields.html
+++ /dev/null
@@ -1,32 +0,0 @@
-
-<!-- BEGIN dropdown -->
- <select name="{dropdown.FIELD_IDENT}" id="{dropdown.FIELD_IDENT}">
- <!-- BEGIN options --><option value="{dropdown.options.OPTION_ID}"{dropdown.options.SELECTED}>{dropdown.options.VALUE}</option><!-- END options -->
- </select>
-<!-- END dropdown -->
-
-<!-- BEGIN text -->
- <textarea name="{text.FIELD_IDENT}" id="{text.FIELD_IDENT}" rows="{text.FIELD_ROWS}" cols="{text.FIELD_COLS}">{text.FIELD_VALUE}</textarea>
-<!-- END text -->
-
-<!-- BEGIN string -->
- <input type="text" name="{string.FIELD_IDENT}" id="{string.FIELD_IDENT}" size="{string.FIELD_LENGTH}" maxlength="{string.FIELD_MAXLEN}" value="{string.FIELD_VALUE}" />
-<!-- END string -->
-
-<!-- BEGIN bool -->
- <!-- IF bool.FIELD_LENGTH eq 1 -->
- <!-- BEGIN options --><label for="{bool.FIELD_IDENT}_{bool.options.OPTION_ID}"><input type="radio" class="radio" name="{bool.FIELD_IDENT}" id="{bool.FIELD_IDENT}_{bool.options.OPTION_ID}" value="{bool.options.OPTION_ID}"{bool.options.CHECKED} /> {bool.options.VALUE}</label> <!-- END options -->
- <!-- ELSE -->
- <input type="checkbox" class="radio" name="{bool.FIELD_IDENT}" id="{bool.FIELD_IDENT}" value="1"<!-- IF bool.FIELD_VALUE --> checked="checked"<!-- ENDIF --> />
- <!-- ENDIF -->
-<!-- END bool -->
-
-<!-- BEGIN int -->
- <input type="text" name="{int.FIELD_IDENT}" id="{int.FIELD_IDENT}" size="{int.FIELD_LENGTH}" value="{int.FIELD_VALUE}" />
-<!-- END int -->
-
-<!-- BEGIN date -->
- <span>{L_DAY}:</span> <select name="{date.FIELD_IDENT}_day" id="{date.FIELD_IDENT}_day">{date.S_DAY_OPTIONS}</select>
- <span>{L_MONTH}:</span> <select name="{date.FIELD_IDENT}_month" id="{date.FIELD_IDENT}_month">{date.S_MONTH_OPTIONS}</select>
- <span>{L_YEAR}:</span> <select name="{date.FIELD_IDENT}_year" id="{date.FIELD_IDENT}_year">{date.S_YEAR_OPTIONS}</select>
-<!-- END date -->
diff --git a/phpBB/adm/style/editor.js b/phpBB/adm/style/editor.js
deleted file mode 100644
index cad01aa9f2..0000000000
--- a/phpBB/adm/style/editor.js
+++ /dev/null
@@ -1,403 +0,0 @@
-/**
-* bbCode control by subBlue design [ www.subBlue.com ]
-* Includes unixsafe colour palette selector by SHS`
-*/
-
-// Startup variables
-var imageTag = false;
-var theSelection = false;
-
-// Check for Browser & Platform for PC & IE specific bits
-// More details from: http://www.mozilla.org/docs/web-developer/sniffer/browser_type.html
-var clientPC = navigator.userAgent.toLowerCase(); // Get client info
-var clientVer = parseInt(navigator.appVersion); // Get browser version
-
-var is_ie = ((clientPC.indexOf('msie') != -1) && (clientPC.indexOf('opera') == -1));
-var is_win = ((clientPC.indexOf('win') != -1) || (clientPC.indexOf('16bit') != -1));
-
-var baseHeight;
-
-/**
-* Shows the help messages in the helpline window
-*/
-function helpline(help)
-{
- document.forms[form_name].helpbox.value = help_line[help];
-}
-
-/**
-* Fix a bug involving the TextRange object. From
-* http://www.frostjedi.com/terra/scripts/demo/caretBug.html
-*/
-function initInsertions()
-{
- var doc;
- if(document.forms[form_name])
- {
- doc = document;
- }
- else
- {
- doc = opener.document;
- }
-
- var textarea = doc.forms[form_name].elements[text_name];
- if (is_ie && typeof(baseHeight) != 'number')
- {
- textarea.focus();
- baseHeight = doc.selection.createRange().duplicate().boundingHeight;
-
- if (!document.forms[form_name])
- {
- document.body.focus();
- }
- }
-}
-
-/**
-* bbstyle
-*/
-function bbstyle(bbnumber)
-{
- if (bbnumber != -1)
- {
- bbfontstyle(bbtags[bbnumber], bbtags[bbnumber+1]);
- }
- else
- {
- insert_text('[*]');
- document.forms[form_name].elements[text_name].focus();
- }
-}
-
-/**
-* Apply bbcodes
-*/
-function bbfontstyle(bbopen, bbclose)
-{
- theSelection = false;
-
- var textarea = document.forms[form_name].elements[text_name];
-
- textarea.focus();
-
- if ((clientVer >= 4) && is_ie && is_win)
- {
- // Get text selection
- theSelection = document.selection.createRange().text;
-
- if (theSelection)
- {
- // Add tags around selection
- document.selection.createRange().text = bbopen + theSelection + bbclose;
- document.forms[form_name].elements[text_name].focus();
- theSelection = '';
- return;
- }
- }
- else if (document.forms[form_name].elements[text_name].selectionEnd && (document.forms[form_name].elements[text_name].selectionEnd - document.forms[form_name].elements[text_name].selectionStart > 0))
- {
- mozWrap(document.forms[form_name].elements[text_name], bbopen, bbclose);
- document.forms[form_name].elements[text_name].focus();
- theSelection = '';
- return;
- }
-
- //The new position for the cursor after adding the bbcode
- var caret_pos = getCaretPosition(textarea).start;
- var new_pos = caret_pos + bbopen.length;
-
- // Open tag
- insert_text(bbopen + bbclose);
-
- // Center the cursor when we don't have a selection
- // Gecko and proper browsers
- if (!isNaN(textarea.selectionStart))
- {
- textarea.selectionStart = new_pos;
- textarea.selectionEnd = new_pos;
- }
- // IE
- else if (document.selection)
- {
- var range = textarea.createTextRange();
- range.move("character", new_pos);
- range.select();
- storeCaret(textarea);
- }
-
- textarea.focus();
- return;
-}
-
-/**
-* Insert text at position
-*/
-function insert_text(text, spaces, popup)
-{
- var textarea;
-
- if (!popup)
- {
- textarea = document.forms[form_name].elements[text_name];
- }
- else
- {
- textarea = opener.document.forms[form_name].elements[text_name];
- }
-
- if (spaces)
- {
- text = ' ' + text + ' ';
- }
-
- if (!isNaN(textarea.selectionStart))
- {
- var sel_start = textarea.selectionStart;
- var sel_end = textarea.selectionEnd;
-
- mozWrap(textarea, text, '');
- textarea.selectionStart = sel_start + text.length;
- textarea.selectionEnd = sel_end + text.length;
- }
-
- else if (textarea.createTextRange && textarea.caretPos)
- {
- if (baseHeight != textarea.caretPos.boundingHeight)
- {
- textarea.focus();
- storeCaret(textarea);
- }
- var caret_pos = textarea.caretPos;
- caret_pos.text = caret_pos.text.charAt(caret_pos.text.length - 1) == ' ' ? caret_pos.text + text + ' ' : caret_pos.text + text;
-
- }
- else
- {
- textarea.value = textarea.value + text;
- }
-
- if (!popup)
- {
- textarea.focus();
- }
-
-}
-
-/**
-* Add inline attachment at position
-*/
-function attach_inline(index, filename)
-{
- insert_text('[attachment=' + index + ']' + filename + '[/attachment]');
- document.forms[form_name].elements[text_name].focus();
-}
-
-/**
-* Add quote text to message
-*/
-function addquote(post_id, username)
-{
- var message_name = 'message_' + post_id;
- var theSelection = '';
- var divarea = false;
-
- if (document.all)
- {
- divarea = document.all[message_name];
- }
- else
- {
- divarea = document.getElementById(message_name);
- }
-
- // Get text selection - not only the post content :(
- if (window.getSelection)
- {
- theSelection = window.getSelection().toString();
- }
- else if (document.getSelection)
- {
- theSelection = document.getSelection();
- }
- else if (document.selection)
- {
- theSelection = document.selection.createRange().text;
- }
-
- if (theSelection == '' || typeof theSelection == 'undefined' || theSelection == null)
- {
- if (divarea.innerHTML)
- {
- theSelection = divarea.innerHTML.replace(/<br>/ig, '\n');
- theSelection = theSelection.replace(/<br\/>/ig, '\n');
- theSelection = theSelection.replace(/&lt\;/ig, '<');
- theSelection = theSelection.replace(/&gt\;/ig, '>');
- theSelection = theSelection.replace(/&amp\;/ig, '&');
- theSelection = theSelection.replace(/&nbsp\;/ig, ' ');
- }
- else if (document.all)
- {
- theSelection = divarea.innerText;
- }
- else if (divarea.textContent)
- {
- theSelection = divarea.textContent;
- }
- else if (divarea.firstChild.nodeValue)
- {
- theSelection = divarea.firstChild.nodeValue;
- }
- }
-
- if (theSelection)
- {
- insert_text('[quote="' + username + '"]' + theSelection + '[/quote]');
- }
-
- return;
-}
-
-/**
-* From http://www.massless.org/mozedit/
-*/
-function mozWrap(txtarea, open, close)
-{
- var selLength = (typeof(txtarea.textLength) == 'undefined') ? txtarea.value.length : txtarea.textLength;
- var selStart = txtarea.selectionStart;
- var selEnd = txtarea.selectionEnd;
- var scrollTop = txtarea.scrollTop;
-
- if (selEnd == 1 || selEnd == 2)
- {
- selEnd = selLength;
- }
-
- var s1 = (txtarea.value).substring(0,selStart);
- var s2 = (txtarea.value).substring(selStart, selEnd);
- var s3 = (txtarea.value).substring(selEnd, selLength);
-
- txtarea.value = s1 + open + s2 + close + s3;
- txtarea.selectionStart = selStart + open.length;
- txtarea.selectionEnd = selEnd + open.length;
- txtarea.focus();
- txtarea.scrollTop = scrollTop;
-
- return;
-}
-
-/**
-* Insert at Caret position. Code from
-* http://www.faqts.com/knowledge_base/view.phtml/aid/1052/fid/130
-*/
-function storeCaret(textEl)
-{
- if (textEl.createTextRange && document.selection)
- {
- textEl.caretPos = document.selection.createRange().duplicate();
- }
-}
-
-/**
-* Color pallette
-*/
-function colorPalette(dir, width, height)
-{
- var r = 0, g = 0, b = 0;
- var numberList = new Array(6);
- var color = '';
-
- numberList[0] = '00';
- numberList[1] = '40';
- numberList[2] = '80';
- numberList[3] = 'BF';
- numberList[4] = 'FF';
-
- document.writeln('<table class="type2">');
-
- for (r = 0; r < 5; r++)
- {
- if (dir == 'h')
- {
- document.writeln('<tr>');
- }
-
- for (g = 0; g < 5; g++)
- {
- if (dir == 'v')
- {
- document.writeln('<tr>');
- }
-
- for (b = 0; b < 5; b++)
- {
- color = String(numberList[r]) + String(numberList[g]) + String(numberList[b]);
- document.write('<td bgcolor="#' + color + '" style="width: ' + width + 'px; height: ' + height + 'px;">');
- document.write('<a href="#" onclick="bbfontstyle(\'[color=#' + color + ']\', \'[/color]\'); return false;"><img src="images/spacer.gif" width="' + width + '" height="' + height + '" alt="#' + color + '" title="#' + color + '" /></a>');
- document.writeln('</td>');
- }
-
- if (dir == 'v')
- {
- document.writeln('</tr>');
- }
- }
-
- if (dir == 'h')
- {
- document.writeln('</tr>');
- }
- }
- document.writeln('</table>');
-}
-
-
-/**
-* Caret Position object
-*/
-function caretPosition()
-{
- var start = null;
- var end = null;
-}
-
-
-/**
-* Get the caret position in an textarea
-*/
-function getCaretPosition(txtarea)
-{
- var caretPos = new caretPosition();
-
- // simple Gecko/Opera way
- if (txtarea.selectionStart || txtarea.selectionStart == 0)
- {
- caretPos.start = txtarea.selectionStart;
- caretPos.end = txtarea.selectionEnd;
- }
- // dirty and slow IE way
- else if (document.selection)
- {
- // get current selection
- var range = document.selection.createRange();
-
- // a new selection of the whole textarea
- var range_all = document.body.createTextRange();
- range_all.moveToElementText(txtarea);
-
- // calculate selection start point by moving beginning of range_all to beginning of range
- var sel_start;
- for (sel_start = 0; range_all.compareEndPoints('StartToStart', range) < 0; sel_start++)
- {
- range_all.moveStart('character', 1);
- }
-
- txtarea.sel_start = sel_start;
-
- // we ignore the end value for IE, this is already dirty enough and we don't need it
- caretPos.start = txtarea.sel_start;
- caretPos.end = txtarea.sel_start;
- }
-
- return caretPos;
-} \ No newline at end of file
diff --git a/phpBB/adm/style/install_convert.html b/phpBB/adm/style/install_convert.html
index 783e89d6bf..7e22404f56 100644
--- a/phpBB/adm/style/install_convert.html
+++ b/phpBB/adm/style/install_convert.html
@@ -22,7 +22,7 @@
<!-- ENDIF -->
<!-- IF S_LIST -->
- <table cellspacing="1">
+ <table class="table1">
<caption>{L_AVAILABLE_CONVERTORS}</caption>
<col class="col1" /><col class="col2" /><col class="col1" /><col class="col2" />
<thead>
@@ -86,7 +86,7 @@
<!-- ELSE -->
<dl>
- <dt><label>{checks.TITLE}:</label><!-- IF checks.S_EXPLAIN --><br /><span class="explain">{checks.TITLE_EXPLAIN}</span><!-- ENDIF --></dt>
+ <dt><label>{checks.TITLE}{L_COLON}</label><!-- IF checks.S_EXPLAIN --><br /><span class="explain">{checks.TITLE_EXPLAIN}</span><!-- ENDIF --></dt>
<dd>{checks.RESULT}</dd>
</dl>
<!-- ENDIF -->
@@ -109,7 +109,7 @@
<!-- ELSE -->
<dl>
- <dt><label for="{options.KEY}">{options.TITLE}:</label><!-- IF options.S_EXPLAIN --><br /><span class="explain">{options.TITLE_EXPLAIN}</span><!-- ENDIF --></dt>
+ <dt><label for="{options.KEY}">{options.TITLE}{L_COLON}</label><!-- IF options.S_EXPLAIN --><br /><span class="explain">{options.TITLE_EXPLAIN}</span><!-- ENDIF --></dt>
<dd>{options.CONTENT}</dd>
</dl>
@@ -131,4 +131,4 @@
</form>
<!-- ENDIF -->
-<!-- INCLUDE install_footer.html --> \ No newline at end of file
+<!-- INCLUDE install_footer.html -->
diff --git a/phpBB/adm/style/install_error.html b/phpBB/adm/style/install_error.html
index ad53433207..3f7c8b9ed4 100644
--- a/phpBB/adm/style/install_error.html
+++ b/phpBB/adm/style/install_error.html
@@ -5,4 +5,4 @@
<p>{MESSAGE_TEXT}</p>
</div>
-<!-- INCLUDE install_footer.html --> \ No newline at end of file
+<!-- INCLUDE install_footer.html -->
diff --git a/phpBB/adm/style/install_footer.html b/phpBB/adm/style/install_footer.html
index 319f7e06c7..8e7599dc3f 100644
--- a/phpBB/adm/style/install_footer.html
+++ b/phpBB/adm/style/install_footer.html
@@ -1,16 +1,21 @@
-
- </div>
+ </div>
+ </div><!-- /#main -->
</div>
- <span class="corners-bottom"><span></span></span>
- <div class="clear"></div>
- </div>
- </div>
+ </div><!-- /#acp -->
</div>
<div id="page-footer">
- Powered by <a href="https://www.phpbb.com/">phpBB</a>&reg; Forum Software &copy; phpBB Group
+ <div class="copyright">
+ Powered by <a href="https://www.phpbb.com/">phpBB</a>&reg; Forum Software &copy; phpBB Limited
+ </div>
</div>
</div>
+<script type="text/javascript" src="{T_JQUERY_LINK}"></script>
+<!-- IF S_ALLOW_CDN --><script type="text/javascript">window.jQuery || document.write('\x3Cscript src="{T_ASSETS_PATH}/javascript/jquery.min.js">\x3C/script>');</script><!-- ENDIF -->
+<script type="text/javascript" src="{T_ASSETS_PATH}/javascript/core.js?assets_version={T_ASSETS_VERSION}"></script>
+<!-- INCLUDEJS admin.js -->
+{$SCRIPTS}
+
</body>
-</html> \ No newline at end of file
+</html>
diff --git a/phpBB/adm/style/install_header.html b/phpBB/adm/style/install_header.html
index fbb6a7b409..cfafe7917f 100644
--- a/phpBB/adm/style/install_header.html
+++ b/phpBB/adm/style/install_header.html
@@ -1,73 +1,44 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" dir="{S_CONTENT_DIRECTION}" lang="{S_USER_LANG}" xml:lang="{S_USER_LANG}">
+<!DOCTYPE html>
+<html dir="{S_CONTENT_DIRECTION}" lang="{S_USER_LANG}">
<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset={S_CONTENT_ENCODING}" />
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Language" content="{S_USER_LANG}" />
-<meta http-equiv="imagetoolbar" content="no" />
+<meta charset="utf-8">
+<meta http-equiv="X-UA-Compatible" content="IE=edge">
+<meta name="viewport" content="width=device-width, initial-scale=1" />
<!-- IF META -->{META}<!-- ENDIF -->
<title>{PAGE_TITLE}</title>
-<link href="../adm/style/admin.css" rel="stylesheet" type="text/css" media="screen" />
-
-<script type="text/javascript">
-// <![CDATA[
-
-/**
-* Set display of page element
-* s[-1,0,1] = hide,toggle display,show
-*/
-function dE(n, s, type)
-{
- if (!type)
- {
- type = 'block';
- }
-
- var e = document.getElementById(n);
- if (!s)
- {
- s = (e.style.display == '' || e.style.display == 'block') ? -1 : 1;
- }
- e.style.display = (s == 1) ? type : 'none';
-}
-
-// ]]>
-</script>
-
+<link href="{T_TEMPLATE_PATH}/admin.css" rel="stylesheet" type="text/css" media="screen" />
</head>
-<body class="{S_CONTENT_DIRECTION}">
+<body class="{S_CONTENT_DIRECTION} nojs">
<div id="wrap">
<div id="page-header">
<h1>{L_INSTALL_PANEL}</h1>
<p id="skip"><a href="#acp">{L_SKIP}</a></p>
<!-- IF S_LANG_SELECT -->
- <form method="post" action="">
+ <form method="post" action="#">
<fieldset class="nobg">
- <label for="language">{L_SELECT_LANG}:</label>
+ <label for="language">{L_SELECT_LANG}{L_COLON}</label>
{S_LANG_SELECT}
<input class="button1" type="submit" id="change_lang" name="change_lang" value="{L_CHANGE}" />
</fieldset>
</form>
<!-- ENDIF -->
</div>
-
+
<div id="page-body">
<div id="tabs">
<ul>
<!-- BEGIN t_block1 -->
- <li<!-- IF t_block1.S_SELECTED --> id="activetab"<!-- ENDIF -->><a href="{t_block1.U_TITLE}"><span>{t_block1.L_TITLE}</span></a></li>
+ <li class="tab<!-- IF t_block1.S_SELECTED --> activetab<!-- ENDIF -->"><a href="{t_block1.U_TITLE}">{t_block1.L_TITLE}</a></li>
<!-- END t_block1 -->
</ul>
</div>
<div id="acp">
- <div class="panel">
- <span class="corners-top"><span></span></span>
<div id="content">
<div id="menu">
+ <div class="menu-block no-header">
<ul>
<!-- BEGIN l_block1 -->
<li<!-- IF l_block1.S_SELECTED --> id="activemenu"<!-- ENDIF -->><a href="{l_block1.U_TITLE}"><span>{l_block1.L_TITLE}</span></a></li>
@@ -76,6 +47,8 @@ function dE(n, s, type)
<li<!-- IF l_block2.S_SELECTED --> id="activemenu"<!-- ENDIF -->><span<!-- IF l_block2.S_COMPLETE --> class="completed"<!-- ENDIF -->>{l_block2.L_TITLE}</span></li>
<!-- END l_block2 -->
</ul>
+ </div>
</div>
-
+
<div id="main" class="install-body">
+ <div class="main">
diff --git a/phpBB/adm/style/install_install.html b/phpBB/adm/style/install_install.html
index 79006fba69..1a809a3588 100644
--- a/phpBB/adm/style/install_install.html
+++ b/phpBB/adm/style/install_install.html
@@ -20,7 +20,7 @@
<!-- ELSE -->
<dl>
- <dt>{checks.TITLE}:<!-- IF checks.S_EXPLAIN --><br /><span class="explain">{checks.TITLE_EXPLAIN}</span><!-- ENDIF --></dt>
+ <dt>{checks.TITLE}{L_COLON}<!-- IF checks.S_EXPLAIN --><br /><span class="explain">{checks.TITLE_EXPLAIN}</span><!-- ENDIF --></dt>
<dd>{checks.RESULT}</dd>
</dl>
<!-- ENDIF -->
@@ -43,7 +43,7 @@
<!-- ELSE -->
<dl>
- <dt><label for="{options.KEY}">{options.TITLE}:</label><!-- IF options.S_EXPLAIN --><br /><span class="explain">{options.TITLE_EXPLAIN}</span><!-- ENDIF --></dt>
+ <dt><label for="{options.KEY}">{options.TITLE}{L_COLON}</label><!-- IF options.S_EXPLAIN --><br /><span class="explain">{options.TITLE_EXPLAIN}</span><!-- ENDIF --></dt>
<dd>{options.CONTENT}</dd>
</dl>
diff --git a/phpBB/adm/style/install_main.html b/phpBB/adm/style/install_main.html
index 2c318bfd65..73e73ad578 100644
--- a/phpBB/adm/style/install_main.html
+++ b/phpBB/adm/style/install_main.html
@@ -3,4 +3,4 @@
<h1>{TITLE}</h1>
<p>{BODY}</p>
-<!-- INCLUDE install_footer.html --> \ No newline at end of file
+<!-- INCLUDE install_footer.html -->
diff --git a/phpBB/adm/style/install_update.html b/phpBB/adm/style/install_update.html
index 818889c89b..898233f72d 100644
--- a/phpBB/adm/style/install_update.html
+++ b/phpBB/adm/style/install_update.html
@@ -109,27 +109,14 @@
<!-- ENDIF -->
</fieldset>
- <!-- IF not S_UP_TO_DATE -->
-
- <form id="install_dbupdate" method="post" action="{U_DB_UPDATE_ACTION}">
-
- <fieldset class="submit-buttons">
- <p>{L_UPDATE_DATABASE_EXPLAIN}</p>
- <input class="button1" type="submit" name="db_update" value="{L_UPDATE_DATABASE}" />
- </fieldset>
-
- </form>
-
- <!-- ELSE -->
- <form id="install_update" method="post" action="{U_ACTION}">
+ <form id="install_update" method="post" action="{U_ACTION}">
- <fieldset class="submit-buttons">
- <p>{L_CHECK_FILES_UP_TO_DATE}</p>
- <input class="button1" type="submit" name="submit" value="{L_CHECK_FILES}" />
- </fieldset>
+ <fieldset class="submit-buttons">
+ <p>{L_CHECK_FILES_EXPLAIN}</p>
+ <input class="button1" type="submit" name="submit" value="{L_CHECK_FILES}" />
+ </fieldset>
- </form>
- <!-- ENDIF -->
+ </form>
<!-- ELSEIF S_DB_UPDATE -->
@@ -155,29 +142,29 @@
<!-- ELSE -->
- <h1>{L_UPDATE_DB_SUCCESS}</h1>
+ <div class="successbox">
+ <h3>{L_UPDATE_SUCCESS}</h3>
+ <p>{L_EVERYTHING_UP_TO_DATE}</p>
+ </div>
- <br /><br />
+ <!-- ENDIF -->
- <form id="install_update" method="post" action="{U_ACTION}">
+<!-- ELSEIF S_FILE_CHECK -->
- <fieldset class="submit-buttons">
- <p>{L_CHECK_FILES_EXPLAIN}</p>
- <input class="button1" type="submit" name="submit" value="{L_CHECK_FILES}" />
- </fieldset>
+ <!-- IF S_ALL_UP_TO_DATE -->
- </form>
+ <h1>{L_UPDATE_FILE_SUCCESS}</h1>
+ <p>{L_ALL_FILES_UP_TO_DATE}</p>
- <!-- ENDIF -->
+ <p>{L_UPDATE_DATABASE_EXPLAIN}</p>
-<!-- ELSEIF S_FILE_CHECK -->
+ <form id="install_dbupdate" method="post" action="{U_DB_UPDATE_ACTION}">
- <!-- IF S_ALL_UP_TO_DATE -->
+ <fieldset class="submit-buttons">
+ <input class="button1" type="submit" name="db_update" value="{L_UPDATE_DATABASE}" />
+ </fieldset>
- <div class="successbox">
- <h3>{L_UPDATE_SUCCESS}</h3>
- <p>{L_ALL_FILES_UP_TO_DATE}</p>
- </div>
+ </form>
<!-- ELSE -->
<h1>{L_COLLECTED_INFORMATION}</h1>
@@ -197,167 +184,191 @@
<form id="install_update" method="post" action="{U_UPDATE_ACTION}">
- <!-- IF .up_to_date -->
- <h2>{L_FILES_UP_TO_DATE}</h2>
- <p>{L_FILES_UP_TO_DATE_EXPLAIN}</p>
+ <!-- IF .deleted -->
+ <h2>{L_FILES_DELETED}</h2>
+ <div style="float: {S_CONTENT_FLOW_END};">&raquo; <a href="#" onclick="phpbb.toggleDisplay('deleted', 0); return false;">{L_TOGGLE_DISPLAY}</a></div>
+ <p>{L_FILES_DELETED_EXPLAIN}</p>
- <fieldset>
- <legend><img src="{T_IMAGE_PATH}file_up_to_date.gif" alt="{L_STATUS_UP_TO_DATE}" /></legend>
- <!-- BEGIN up_to_date -->
+ <fieldset id="deleted">
+ <legend><img src="{T_IMAGE_PATH}icon_delete.gif" alt="{L_STATUS_DELETED}" /></legend>
+ <!-- BEGIN deleted -->
<dl>
- <dd class="full" style="text-align: {S_CONTENT_FLOW_BEGIN};"><strong>{up_to_date.FILENAME}</strong></dd>
+ <dt style="width: 60%;"><strong><!-- IF deleted.DIR_PART -->{deleted.DIR_PART}<br /><!-- ENDIF -->{deleted.FILE_PART}</strong></dt>
+ <dd style="margin-{S_CONTENT_FLOW_BEGIN}: 60%;">
+ <!-- IF not deleted.S_BINARY -->[<a href="{deleted.U_SHOW_DIFF}" onclick="diff_popup(this.href); return false;">{deleted.L_SHOW_DIFF}</a>]<!-- ELSE -->{L_BINARY_FILE}<!-- ENDIF -->
+ </dd>
</dl>
- <!-- END up_to_date -->
+ <!-- END deleted -->
</fieldset>
<!-- ENDIF -->
- <!-- IF .new -->
- <h2>{L_FILES_NEW}</h2>
- <p>{L_FILES_NEW_EXPLAIN}</p>
+ <!-- IF .conflict -->
+ <h2>{L_FILES_CONFLICT}</h2>
+ <div style="float: {S_CONTENT_FLOW_END};">&raquo; <a href="#" onclick="phpbb.toggleDisplay('conflict', 0); return false;">{L_TOGGLE_DISPLAY}</a></div>
+ <p>{L_FILES_CONFLICT_EXPLAIN}</p>
- <fieldset>
- <legend><img src="{T_IMAGE_PATH}file_new.gif" alt="{L_STATUS_NEW}" /></legend>
- <!-- BEGIN new -->
+ <!-- BEGIN conflict -->
+ <fieldset id="conflict">
+ <legend><img src="{T_IMAGE_PATH}file_conflict.gif" alt="{L_STATUS_CONFLICT}" /></legend>
<dl>
- <dt style="width: 60%;"><strong><!-- IF new.DIR_PART -->{new.DIR_PART}<br /><!-- ENDIF -->{new.FILE_PART}</strong>
- <!-- IF new.S_CUSTOM --><br /><span><em>{L_FILE_USED}: </em>{new.CUSTOM_ORIGINAL}</span><!-- ENDIF -->
- </dt>
- <dd style="margin-{S_CONTENT_FLOW_BEGIN}: 60%;">
- <!-- IF not new.S_BINARY -->[<a href="{new.U_SHOW_DIFF}" onclick="diff_popup(this.href); return false;">{new.L_SHOW_DIFF}</a>]<!-- ELSE -->{L_BINARY_FILE}<!-- ENDIF -->
- </dd>
- <!-- IF new.S_CUSTOM -->
- <dd style="margin-{S_CONTENT_FLOW_BEGIN}: 60%;"><label><input type="checkbox" name="no_update[]" value="{new.FILENAME}" class="radio" /> {L_DO_NOT_UPDATE}</label></dd>
- <!-- ENDIF -->
+ <dt style="width: 60%;"><strong><!-- IF conflict.DIR_PART -->{conflict.DIR_PART}<br /><!-- ENDIF -->{conflict.FILE_PART}</strong>
+ <!-- IF conflict.S_CUSTOM --><br /><span><em>{L_FILE_USED}{L_COLON} </em>{conflict.CUSTOM_ORIGINAL}</span><!-- ENDIF -->
+ <!-- IF conflict.NUM_CONFLICTS --><br /><span>{L_NUM_CONFLICTS}{L_COLON} {conflict.NUM_CONFLICTS}</span><!-- ENDIF -->
+ </dt>
+ <dd style="margin-{S_CONTENT_FLOW_BEGIN}{L_COLON} 60%;">
+ <!-- IF not conflict.S_BINARY -->[<a href="{conflict.U_SHOW_DIFF}">{L_DOWNLOAD_CONFLICTS}</a>]<br />{L_DOWNLOAD_CONFLICTS_EXPLAIN}
+ <!-- ELSE -->{L_BINARY_FILE}<!-- ENDIF -->
+ </dd>
+ <!-- IF conflict.S_CUSTOM -->
+ <dd style="margin-{S_CONTENT_FLOW_BEGIN}{L_COLON} 60%;"><label><input type="checkbox" name="no_update[]" value="{conflict.FILENAME}" class="radio" /> {L_DO_NOT_UPDATE}</label></dd>
+ <!-- ENDIF -->
</dl>
- <!-- END new -->
+ <!-- IF conflict.S_BINARY -->
+ <dl>
+ <dt style="width: 60%"><label><input type="radio" class="radio" name="conflict[{conflict.FILENAME}]" value="1" checked="checked" /> {L_MERGE_NO_MERGE_NEW_OPTION}</label></dt>
+ <dd style="margin-{S_CONTENT_FLOW_BEGIN}{L_COLON} 60%;">&nbsp;</dd>
+ </dl>
+ <!-- ELSE -->
+ <dl>
+ <dt style="width: 60%"><label><input type="radio" class="radio" name="conflict[{conflict.FILENAME}]" value="3" checked="checked" /> {L_MERGE_NEW_FILE_OPTION}</label></dt>
+ <dd style="margin-{S_CONTENT_FLOW_BEGIN}{L_COLON} 60%;">[<a href="{conflict.U_VIEW_NEW_FILE}" onclick="diff_popup(this.href); return false;">{L_SHOW_DIFF_MODIFIED}</a>]</dd>
+ </dl>
+ <dl>
+ <dt style="width: 60%"><label><input type="radio" class="radio" name="conflict[{conflict.FILENAME}]" value="4" /> {L_MERGE_MOD_FILE_OPTION}</label></dt>
+ <dd style="margin-{S_CONTENT_FLOW_BEGIN}{L_COLON} 60%;">[<a href="{conflict.U_VIEW_MOD_FILE}" onclick="diff_popup(this.href); return false;">{L_SHOW_DIFF_MODIFIED}</a>]</dd>
+ </dl>
+ <dl>
+ <dt style="width: 60%"><label><input type="radio" class="radio" name="conflict[{conflict.FILENAME}]" value="1" /> {L_MERGE_NO_MERGE_NEW_OPTION}</label></dt>
+ <dd style="margin-{S_CONTENT_FLOW_BEGIN}{L_COLON} 60%;">[<a href="{conflict.U_VIEW_NO_MERGE_NEW}" onclick="diff_popup(this.href); return false;">{L_SHOW_DIFF_FINAL}</a>]</dd>
+ </dl>
+ <dl>
+ <dt style="width: 60%"><label><input type="radio" class="radio" name="conflict[{conflict.FILENAME}]" value="2" /> {L_MERGE_NO_MERGE_MOD_OPTION}</label></dt>
+ <dd style="margin-{S_CONTENT_FLOW_BEGIN}{L_COLON} 60%;">[<a href="{conflict.U_VIEW_NO_MERGE_MOD}" onclick="diff_popup(this.href); return false;">{L_SHOW_DIFF_FINAL}</a>]</dd>
+ </dl>
+ <!-- ENDIF -->
</fieldset>
+ <!-- END conflict -->
<!-- ENDIF -->
- <!-- IF .not_modified -->
- <h2>{L_FILES_NOT_MODIFIED}</h2>
- <div style="float: {S_CONTENT_FLOW_END};">&raquo; <a href="#" onclick="dE('not_modified', 0); return false;">{L_TOGGLE_DISPLAY}</a></div>
- <p>{L_FILES_NOT_MODIFIED_EXPLAIN}</p>
+ <!-- IF .new_conflict -->
+ <h2>{L_FILES_NEW_CONFLICT}</h2>
+ <div style="float: {S_CONTENT_FLOW_END};">&raquo; <a href="#" onclick="phpbb.toggleDisplay('new_conflict', 0); return false;">{L_TOGGLE_DISPLAY}</a></div>
+ <p>{L_FILES_NEW_CONFLICT_EXPLAIN}</p>
- <fieldset id="not_modified" style="display: none;">
- <legend><img src="{T_IMAGE_PATH}file_not_modified.gif" alt="{L_STATUS_NOT_MODIFIED}" /></legend>
- <!-- BEGIN not_modified -->
+ <fieldset id="new_conflict">
+ <legend><img src="{T_IMAGE_PATH}file_new_conflict.gif" alt="{L_STATUS_NEW_CONFLICT}" /></legend>
+ <!-- BEGIN new_conflict -->
<dl>
- <dt style="width: 60%;"><strong><!-- IF not_modified.DIR_PART -->{not_modified.DIR_PART}<br /><!-- ENDIF -->{not_modified.FILE_PART}</strong>
- <!-- IF not_modified.S_CUSTOM --><br /><span><em>{L_FILE_USED}: </em>{not_modified.CUSTOM_ORIGINAL}</span><!-- ENDIF -->
- </dt>
- <dd style="margin-{S_CONTENT_FLOW_BEGIN}: 60%;"><!-- IF not not_modified.S_BINARY -->[<a href="{not_modified.U_SHOW_DIFF}" onclick="diff_popup(this.href); return false;">{not_modified.L_SHOW_DIFF}</a>]<!-- ELSE -->{L_BINARY_FILE}<!-- ENDIF --></dd>
- <!-- IF not_modified.S_CUSTOM -->
- <dd style="margin-{S_CONTENT_FLOW_BEGIN}: 60%;"><label><input type="checkbox" name="no_update[]" value="{not_modified.FILENAME}" class="radio" /> {L_DO_NOT_UPDATE}</label></dd>
- <!-- ENDIF -->
+ <dt style="width: 60%;"><strong><!-- IF new_conflict.DIR_PART -->{new_conflict.DIR_PART}<br /><!-- ENDIF -->{new_conflict.FILE_PART}</strong>
+ <!-- IF new_conflict.S_CUSTOM --><br /><span><em>{L_FILE_USED}{L_COLON} </em>{new_conflict.CUSTOM_ORIGINAL}</span><!-- ENDIF -->
+ </dt>
+ <dd style="margin-{S_CONTENT_FLOW_BEGIN}{L_COLON} 60%;">
+ <!-- IF not new_conflict.S_BINARY -->[<a href="{new_conflict.U_SHOW_DIFF}" onclick="diff_popup(this.href); return false;">{new_conflict.L_SHOW_DIFF}</a>]<!-- ELSE -->{L_BINARY_FILE}<!-- ENDIF -->
+ </dd>
+ <!-- IF new_conflict.S_CUSTOM -->
+ <dd style="margin-{S_CONTENT_FLOW_BEGIN}{L_COLON} 60%;"><label><input type="checkbox" name="no_update[]" value="{new_conflict.FILENAME}" class="radio" /> {L_DO_NOT_UPDATE}</label></dd>
+ <!-- ENDIF -->
</dl>
- <!-- END not_modified -->
+ <!-- END new_conflict -->
</fieldset>
<!-- ENDIF -->
<!-- IF .modified -->
<h2>{L_FILES_MODIFIED}</h2>
+ <div style="float: {S_CONTENT_FLOW_END};">&raquo; <a href="#" onclick="phpbb.toggleDisplay('modified', 0); return false;">{L_TOGGLE_DISPLAY}</a></div>
<p>{L_FILES_MODIFIED_EXPLAIN}</p>
<!-- BEGIN modified -->
- <fieldset>
+ <fieldset id="modified">
<legend><img src="{T_IMAGE_PATH}file_modified.gif" alt="{L_STATUS_MODIFIED}" /></legend>
<dl>
<dt style="width: 60%;"><strong><!-- IF modified.DIR_PART -->{modified.DIR_PART}<br /><!-- ENDIF -->{modified.FILE_PART}</strong>
- <!-- IF modified.S_CUSTOM --><br /><span><em>{L_FILE_USED}: </em>{modified.CUSTOM_ORIGINAL}</span><!-- ENDIF -->
+ <!-- IF modified.S_CUSTOM --><br /><span><em>{L_FILE_USED}{L_COLON} </em>{modified.CUSTOM_ORIGINAL}</span><!-- ENDIF -->
</dt>
- <dd style="margin-{S_CONTENT_FLOW_BEGIN}: 60%;">&nbsp;</dd>
+ <dd style="margin-{S_CONTENT_FLOW_BEGIN}{L_COLON} 60%;">&nbsp;</dd>
<!-- IF modified.S_CUSTOM -->
- <dd style="margin-{S_CONTENT_FLOW_BEGIN}: 60%;"><label><input type="checkbox" name="no_update[]" value="{modified.FILENAME}" class="radio" /> {L_DO_NOT_UPDATE}</label></dd>
+ <dd style="margin-{S_CONTENT_FLOW_BEGIN}{L_COLON} 60%;"><label><input type="checkbox" name="no_update[]" value="{modified.FILENAME}" class="radio" /> {L_DO_NOT_UPDATE}</label></dd>
<!-- ENDIF -->
</dl>
<dl>
<dt style="width: 60%"><label><input type="radio" class="radio" name="modified[{modified.FILENAME}]" value="0" checked="checked" /> {L_MERGE_MODIFICATIONS_OPTION}</label></dt>
- <dd style="margin-{S_CONTENT_FLOW_BEGIN}: 60%;"><!-- IF not modified.S_BINARY -->[<a href="{modified.U_SHOW_DIFF}" onclick="diff_popup(this.href); return false;">{modified.L_SHOW_DIFF}</a>]<!-- ELSE -->{L_BINARY_FILE}<!-- ENDIF --></dd>
+ <dd style="margin-{S_CONTENT_FLOW_BEGIN}{L_COLON} 60%;"><!-- IF not modified.S_BINARY -->[<a href="{modified.U_SHOW_DIFF}" onclick="diff_popup(this.href); return false;">{modified.L_SHOW_DIFF}</a>]<!-- ELSE -->{L_BINARY_FILE}<!-- ENDIF --></dd>
</dl>
<dl>
<dt style="width: 60%"><label><input type="radio" class="radio" name="modified[{modified.FILENAME}]" value="1" /> {L_MERGE_NO_MERGE_NEW_OPTION}</label></dt>
- <dd style="margin-{S_CONTENT_FLOW_BEGIN}: 60%;"><!-- IF not modified.S_BINARY -->[<a href="{modified.U_VIEW_NO_MERGE_NEW}" onclick="diff_popup(this.href); return false;">{L_SHOW_DIFF_FINAL}</a>]<!-- ELSE -->&nbsp;<!-- ENDIF --></dd>
+ <dd style="margin-{S_CONTENT_FLOW_BEGIN}{L_COLON} 60%;"><!-- IF not modified.S_BINARY -->[<a href="{modified.U_VIEW_NO_MERGE_NEW}" onclick="diff_popup(this.href); return false;">{L_SHOW_DIFF_FINAL}</a>]<!-- ELSE -->&nbsp;<!-- ENDIF --></dd>
</dl>
<dl>
<dt style="width: 60%"><label><input type="radio" class="radio" name="modified[{modified.FILENAME}]" value="2" /> {L_MERGE_NO_MERGE_MOD_OPTION}</label></dt>
- <dd style="margin-{S_CONTENT_FLOW_BEGIN}: 60%;"><!-- IF not modified.S_BINARY -->[<a href="{modified.U_VIEW_NO_MERGE_MOD}" onclick="diff_popup(this.href); return false;">{L_SHOW_DIFF_FINAL}</a>]<!-- ELSE -->&nbsp;<!-- ENDIF --></dd>
+ <dd style="margin-{S_CONTENT_FLOW_BEGIN}{L_COLON} 60%;"><!-- IF not modified.S_BINARY -->[<a href="{modified.U_VIEW_NO_MERGE_MOD}" onclick="diff_popup(this.href); return false;">{L_SHOW_DIFF_FINAL}</a>]<!-- ELSE -->&nbsp;<!-- ENDIF --></dd>
</dl>
</fieldset>
<!-- END modified -->
<!-- ENDIF -->
- <!-- IF .new_conflict -->
- <h2>{L_FILES_NEW_CONFLICT}</h2>
- <p>{L_FILES_NEW_CONFLICT_EXPLAIN}</p>
+ <!-- IF .new -->
+ <h2>{L_FILES_NEW}</h2>
+ <div style="float: {S_CONTENT_FLOW_END};">&raquo; <a href="#" onclick="phpbb.toggleDisplay('new_files', 0); return false;">{L_TOGGLE_DISPLAY}</a></div>
+ <p>{L_FILES_NEW_EXPLAIN}</p>
- <fieldset>
- <legend><img src="{T_IMAGE_PATH}file_new_conflict.gif" alt="{L_STATUS_NEW_CONFLICT}" /></legend>
- <!-- BEGIN new_conflict -->
+ <fieldset id="new_files" style="display: none;">
+ <legend><img src="{T_IMAGE_PATH}file_new.gif" alt="{L_STATUS_NEW}" /></legend>
+ <!-- BEGIN new -->
<dl>
- <dt style="width: 60%;"><strong><!-- IF new_conflict.DIR_PART -->{new_conflict.DIR_PART}<br /><!-- ENDIF -->{new_conflict.FILE_PART}</strong>
- <!-- IF new_conflict.S_CUSTOM --><br /><span><em>{L_FILE_USED}: </em>{new_conflict.CUSTOM_ORIGINAL}</span><!-- ENDIF -->
+ <dt style="width: 60%;"><strong><!-- IF new.DIR_PART -->{new.DIR_PART}<br /><!-- ENDIF -->{new.FILE_PART}</strong>
+ <!-- IF new.S_CUSTOM --><br /><span><em>{L_FILE_USED}{L_COLON} </em>{new.CUSTOM_ORIGINAL}</span><!-- ENDIF -->
</dt>
- <dd style="margin-{S_CONTENT_FLOW_BEGIN}: 60%;">
- <!-- IF not new_conflict.S_BINARY -->[<a href="{new_conflict.U_SHOW_DIFF}" onclick="diff_popup(this.href); return false;">{new_conflict.L_SHOW_DIFF}</a>]<!-- ELSE -->{L_BINARY_FILE}<!-- ENDIF -->
+ <dd style="margin-{S_CONTENT_FLOW_BEGIN}{L_COLON} 60%;">
+ <!-- IF not new.S_BINARY -->[<a href="{new.U_SHOW_DIFF}" onclick="diff_popup(this.href); return false;">{new.L_SHOW_DIFF}</a>]<!-- ELSE -->{L_BINARY_FILE}<!-- ENDIF -->
</dd>
- <!-- IF new_conflict.S_CUSTOM -->
- <dd style="margin-{S_CONTENT_FLOW_BEGIN}: 60%;"><label><input type="checkbox" name="no_update[]" value="{new_conflict.FILENAME}" class="radio" /> {L_DO_NOT_UPDATE}</label></dd>
+ <!-- IF new.S_CUSTOM -->
+ <dd style="margin-{S_CONTENT_FLOW_BEGIN}{L_COLON} 60%;"><label><input type="checkbox" name="no_update[]" value="{new.FILENAME}" class="radio" /> {L_DO_NOT_UPDATE}</label></dd>
<!-- ENDIF -->
</dl>
- <!-- END new_conflict -->
+ <!-- END new -->
</fieldset>
<!-- ENDIF -->
- <!-- IF .conflict -->
- <h2>{L_FILES_CONFLICT}</h2>
- <p>{L_FILES_CONFLICT_EXPLAIN}</p>
+ <!-- IF .not_modified -->
+ <h2>{L_FILES_NOT_MODIFIED}</h2>
+ <div style="float: {S_CONTENT_FLOW_END};">&raquo; <a href="#" onclick="phpbb.toggleDisplay('not_modified', 0); return false;">{L_TOGGLE_DISPLAY}</a></div>
+ <p>{L_FILES_NOT_MODIFIED_EXPLAIN}</p>
- <!-- BEGIN conflict -->
- <fieldset>
- <legend><img src="{T_IMAGE_PATH}file_conflict.gif" alt="{L_STATUS_CONFLICT}" /></legend>
+ <fieldset id="not_modified" style="display: none;">
+ <legend><img src="{T_IMAGE_PATH}file_not_modified.gif" alt="{L_STATUS_NOT_MODIFIED}" /></legend>
+ <!-- BEGIN not_modified -->
<dl>
- <dt style="width: 60%;"><strong><!-- IF conflict.DIR_PART -->{conflict.DIR_PART}<br /><!-- ENDIF -->{conflict.FILE_PART}</strong>
- <!-- IF conflict.S_CUSTOM --><br /><span><em>{L_FILE_USED}: </em>{conflict.CUSTOM_ORIGINAL}</span><!-- ENDIF -->
- <!-- IF conflict.NUM_CONFLICTS --><br /><span>{L_NUM_CONFLICTS}: {conflict.NUM_CONFLICTS}</span><!-- ENDIF -->
+ <dt style="width: 60%;"><strong><!-- IF not_modified.DIR_PART -->{not_modified.DIR_PART}<br /><!-- ENDIF -->{not_modified.FILE_PART}</strong>
+ <!-- IF not_modified.S_CUSTOM --><br /><span><em>{L_FILE_USED}{L_COLON} </em>{not_modified.CUSTOM_ORIGINAL}</span><!-- ENDIF -->
</dt>
- <dd style="margin-{S_CONTENT_FLOW_BEGIN}: 60%;">
- <!-- IF not conflict.S_BINARY -->[<a href="{conflict.U_SHOW_DIFF}">{L_DOWNLOAD_CONFLICTS}</a>]<br />{L_DOWNLOAD_CONFLICTS_EXPLAIN}
- <!-- ELSE -->{L_BINARY_FILE}<!-- ENDIF -->
- </dd>
- <!-- IF conflict.S_CUSTOM -->
- <dd style="margin-{S_CONTENT_FLOW_BEGIN}: 60%;"><label><input type="checkbox" name="no_update[]" value="{conflict.FILENAME}" class="radio" /> {L_DO_NOT_UPDATE}</label></dd>
+ <dd style="margin-{S_CONTENT_FLOW_BEGIN}{L_COLON} 60%;"><!-- IF not not_modified.S_BINARY -->[<a href="{not_modified.U_SHOW_DIFF}" onclick="diff_popup(this.href); return false;">{not_modified.L_SHOW_DIFF}</a>]<!-- ELSE -->{L_BINARY_FILE}<!-- ENDIF --></dd>
+ <!-- IF not_modified.S_CUSTOM -->
+ <dd style="margin-{S_CONTENT_FLOW_BEGIN}{L_COLON} 60%;"><label><input type="checkbox" name="no_update[]" value="{not_modified.FILENAME}" class="radio" /> {L_DO_NOT_UPDATE}</label></dd>
<!-- ENDIF -->
</dl>
- <!-- IF conflict.S_BINARY -->
- <dl>
- <dt style="width: 60%"><label><input type="radio" class="radio" name="conflict[{conflict.FILENAME}]" value="1" checked="checked" /> {L_MERGE_NO_MERGE_NEW_OPTION}</label></dt>
- <dd style="margin-{S_CONTENT_FLOW_BEGIN}: 60%;">&nbsp;</dd>
- </dl>
- <!-- ELSE -->
- <dl>
- <dt style="width: 60%"><label><input type="radio" class="radio" name="conflict[{conflict.FILENAME}]" value="3" checked="checked" /> {L_MERGE_NEW_FILE_OPTION}</label></dt>
- <dd style="margin-{S_CONTENT_FLOW_BEGIN}: 60%;">[<a href="{conflict.U_VIEW_NEW_FILE}" onclick="diff_popup(this.href); return false;">{L_SHOW_DIFF_MODIFIED}</a>]</dd>
- </dl>
- <dl>
- <dt style="width: 60%"><label><input type="radio" class="radio" name="conflict[{conflict.FILENAME}]" value="4" /> {L_MERGE_MOD_FILE_OPTION}</label></dt>
- <dd style="margin-{S_CONTENT_FLOW_BEGIN}: 60%;">[<a href="{conflict.U_VIEW_MOD_FILE}" onclick="diff_popup(this.href); return false;">{L_SHOW_DIFF_MODIFIED}</a>]</dd>
- </dl>
- <dl>
- <dt style="width: 60%"><label><input type="radio" class="radio" name="conflict[{conflict.FILENAME}]" value="1" /> {L_MERGE_NO_MERGE_NEW_OPTION}</label></dt>
- <dd style="margin-{S_CONTENT_FLOW_BEGIN}: 60%;">[<a href="{conflict.U_VIEW_NO_MERGE_NEW}" onclick="diff_popup(this.href); return false;">{L_SHOW_DIFF_FINAL}</a>]</dd>
- </dl>
- <dl>
- <dt style="width: 60%"><label><input type="radio" class="radio" name="conflict[{conflict.FILENAME}]" value="2" /> {L_MERGE_NO_MERGE_MOD_OPTION}</label></dt>
- <dd style="margin-{S_CONTENT_FLOW_BEGIN}: 60%;">[<a href="{conflict.U_VIEW_NO_MERGE_MOD}" onclick="diff_popup(this.href); return false;">{L_SHOW_DIFF_FINAL}</a>]</dd>
- </dl>
- <!-- ENDIF -->
+ <!-- END not_modified -->
+ </fieldset>
+
+ <!-- ENDIF -->
+
+ <!-- IF .up_to_date -->
+ <h2>{L_FILES_UP_TO_DATE}</h2>
+ <div style="float: {S_CONTENT_FLOW_END};">&raquo; <a href="#" onclick="phpbb.toggleDisplay('up_to_date', 0); return false;">{L_TOGGLE_DISPLAY}</a></div>
+ <p>{L_FILES_UP_TO_DATE_EXPLAIN}</p>
+
+ <fieldset id="up_to_date" style="display: none;">
+ <legend><img src="{T_IMAGE_PATH}file_up_to_date.gif" alt="{L_STATUS_UP_TO_DATE}" /></legend>
+ <!-- BEGIN up_to_date -->
+ <dl>
+ <dd class="full" style="text-align: {S_CONTENT_FLOW_BEGIN};"><strong>{up_to_date.FILENAME}</strong></dd>
+ </dl>
+ <!-- END up_to_date -->
</fieldset>
- <!-- END conflict -->
<!-- ENDIF -->
@@ -392,7 +403,7 @@
<fieldset>
<legend>{L_SELECT_DOWNLOAD_FORMAT}</legend>
<dl>
- <dt><label for="use_method">{L_DOWNLOAD_AS}:</label></dt>
+ <dt><label for="use_method">{L_DOWNLOAD_AS}{L_COLON}</label></dt>
<dd>{RADIO_BUTTONS}</dd>
</dl>
</fieldset>
@@ -408,7 +419,7 @@
<p>{L_MAPPING_FILE_STRUCTURE}</p>
- <table cellspacing="1">
+ <table class="table1">
<col class="row1" /><col class="row2" /><col class="row1" />
<thead>
<tr>
@@ -455,12 +466,12 @@
<fieldset>
<legend>{L_FTP_SETTINGS}</legend>
<dl>
- <dt><label>{L_UPLOAD_METHOD}:</label></dt>
+ <dt><label>{L_UPLOAD_METHOD}{L_COLON}</label></dt>
<dd><strong>{UPLOAD_METHOD}</strong></dd>
</dl>
<!-- BEGIN data -->
<dl>
- <dt><label for="{data.DATA}">{data.NAME}:</label><br /><span>{data.EXPLAIN}</span></dt>
+ <dt><label for="{data.DATA}">{data.NAME}{L_COLON}</label><br /><span>{data.EXPLAIN}</span></dt>
<dd><input type="<!-- IF data.DATA == 'password' -->password<!-- ELSE -->text<!-- ENDIF -->" id="{data.DATA}" name="{data.DATA}" value="{data.DEFAULT}" /></dd>
</dl>
<!-- END data -->
diff --git a/phpBB/adm/style/install_update_diff.html b/phpBB/adm/style/install_update_diff.html
index 922b4aca31..324dc50d05 100644
--- a/phpBB/adm/style/install_update_diff.html
+++ b/phpBB/adm/style/install_update_diff.html
@@ -1,15 +1,13 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" dir="{S_CONTENT_DIRECTION}" lang="{S_USER_LANG}" xml:lang="{S_USER_LANG}">
+<!DOCTYPE html>
+<html dir="{S_CONTENT_DIRECTION}" lang="{S_USER_LANG}">
<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset={S_CONTENT_ENCODING}" />
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Language" content="{S_USER_LANG}" />
-<meta http-equiv="imagetoolbar" content="no" />
+<meta charset="utf-8">
+<meta http-equiv="X-UA-Compatible" content="IE=edge">
+<meta name="viewport" content="width=device-width, initial-scale=1" />
<!-- IF META -->{META}<!-- ENDIF -->
<title>{PAGE_TITLE}</title>
-<link href="../adm/style/admin.css" rel="stylesheet" type="text/css" media="screen" />
+<link href="{T_TEMPLATE_PATH}/admin.css" rel="stylesheet" type="text/css" media="screen" />
<script type="text/javascript">
// <![CDATA[
@@ -37,7 +35,7 @@ window.onresize = resize_panel;
<style type="text/css">
/* <![CDATA[ */
-#main {
+#main, .rtl #main {
font-size: 1em;
line-height: 0.7em;
margin: 0;
@@ -47,6 +45,7 @@ window.onresize = resize_panel;
#diff_content {
padding: 30px 10px 10px;
+ overflow: hidden;
}
<!-- IF DIFF_MODE neq 'side_by_side' and DIFF_MODE neq 'raw' -->
@@ -225,9 +224,9 @@ table.hrdiff caption span {
<!-- ENDIF -->
<!-- IF not S_DIFF_NEW_FILE -->
<p id="skip"><a href="#acp">{L_SKIP}</a></p>
- <form method="post" action="">
+ <form method="post" action="#">
<fieldset class="quick">
- <label for="diff_mode">{L_SELECT_DIFF_MODE}:</label>
+ <label for="diff_mode">{L_SELECT_DIFF_MODE}{L_COLON}</label>
<select name="diff_mode" id="diff_mode">{S_DIFF_MODE_OPTIONS}</select>
<input class="button1" type="submit" id="submit" name="submit" value="{L_CHANGE}" />
@@ -235,24 +234,22 @@ table.hrdiff caption span {
</form>
<!-- ENDIF -->
<!-- IF S_DIFF_CONFLICT_FILE -->
- <div style="float: {S_CONTENT_FLOW_BEGIN};"><strong>{L_NUM_CONFLICTS}: {NUM_CONFLICTS}</strong></div>
+ <div style="float: {S_CONTENT_FLOW_BEGIN};"><strong>{L_NUM_CONFLICTS}{L_COLON} {NUM_CONFLICTS}</strong></div>
<br style="clear: both;" />
<!-- ENDIF -->
</div>
<div id="page-body">
<div id="acp">
- <div class="panel" id="codepanel">
- <span class="corners-top"><span></span></span>
+ <div id="codepanel">
<div id="diff_content">
<div id="main">
{DIFF_CONTENT}
</div>
</div>
- <span class="corners-bottom"><span></span></span>
- </div>
+ </div>
</div>
</div>
-<!-- INCLUDE simple_footer.html --> \ No newline at end of file
+<!-- INCLUDE simple_footer.html -->
diff --git a/phpBB/adm/style/message_body.html b/phpBB/adm/style/message_body.html
index 5d907e911c..3ea9e5bc24 100644
--- a/phpBB/adm/style/message_body.html
+++ b/phpBB/adm/style/message_body.html
@@ -5,4 +5,4 @@
<p>{MESSAGE_TEXT}</p>
</div>
-<!-- INCLUDE overall_footer.html --> \ No newline at end of file
+<!-- INCLUDE overall_footer.html -->
diff --git a/phpBB/adm/style/overall_footer.html b/phpBB/adm/style/overall_footer.html
index 361d3185fd..8745286d64 100644
--- a/phpBB/adm/style/overall_footer.html
+++ b/phpBB/adm/style/overall_footer.html
@@ -1,24 +1,46 @@
-
- </div>
+ </div>
+ </div><!-- /#main -->
</div>
- <span class="corners-bottom"><span></span></span>
- <div class="clear"></div>
- </div>
- </div>
+ </div><!-- /#acp -->
</div>
<div id="page-footer">
- <!-- IF S_COPYRIGHT_HTML -->
- {CREDIT_LINE}
- <!-- IF TRANSLATION_INFO --><br />{TRANSLATION_INFO}<!-- ENDIF -->
- <!-- ENDIF -->
+ <div class="copyright">
+ <!-- IF S_COPYRIGHT_HTML -->
+ {CREDIT_LINE}
+ <!-- IF TRANSLATION_INFO --><br />{TRANSLATION_INFO}<!-- ENDIF -->
+ <!-- ENDIF -->
- <!-- IF DEBUG_OUTPUT -->
- <!-- IF S_COPYRIGHT_HTML --><br /><!-- ENDIF -->
- {DEBUG_OUTPUT}
- <!-- ENDIF -->
+ <!-- IF DEBUG_OUTPUT -->
+ <!-- IF S_COPYRIGHT_HTML --><br /><!-- ENDIF -->
+ {DEBUG_OUTPUT}
+ <!-- ENDIF -->
+ </div>
+
+ <div id="darkenwrapper" data-ajax-error-title="{L_AJAX_ERROR_TITLE}" data-ajax-error-text="{L_AJAX_ERROR_TEXT}" data-ajax-error-text-abort="{L_AJAX_ERROR_TEXT_ABORT}" data-ajax-error-text-timeout="{L_AJAX_ERROR_TEXT_TIMEOUT}" data-ajax-error-text-parsererror="{L_AJAX_ERROR_TEXT_PARSERERROR}">
+ <div id="darken">&nbsp;</div>
+ </div>
+ <div id="loading_indicator"></div>
+
+ <div id="phpbb_alert" class="phpbb_alert" data-l-err="{L_ERROR}" data-l-timeout-processing-req="{L_TIMEOUT_PROCESSING_REQ}">
+ <a href="#" class="alert_close"></a>
+ <h3 class="alert_title"></h3><p class="alert_text"></p>
+ </div>
+ <div id="phpbb_confirm" class="phpbb_alert">
+ <a href="#" class="alert_close"></a>
+ <div class="alert_text"></div>
+ </div>
</div>
</div>
+<script type="text/javascript" src="{T_JQUERY_LINK}"></script>
+<!-- IF S_ALLOW_CDN --><script type="text/javascript">window.jQuery || document.write('\x3Cscript src="{T_ASSETS_PATH}/javascript/jquery.min.js?assets_version={T_ASSETS_VERSION}">\x3C/script>');</script><!-- ENDIF -->
+<script type="text/javascript" src="{T_ASSETS_PATH}/javascript/core.js?assets_version={T_ASSETS_VERSION}"></script>
+<!-- INCLUDEJS ajax.js -->
+<!-- INCLUDEJS admin.js -->
+
+<!-- EVENT acp_overall_footer_after -->
+{$SCRIPTS}
+
</body>
-</html> \ No newline at end of file
+</html>
diff --git a/phpBB/adm/style/overall_header.html b/phpBB/adm/style/overall_header.html
index a376884507..bd8caf1443 100644
--- a/phpBB/adm/style/overall_header.html
+++ b/phpBB/adm/style/overall_header.html
@@ -1,25 +1,20 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" dir="{S_CONTENT_DIRECTION}" lang="{S_USER_LANG}" xml:lang="{S_USER_LANG}">
+<!DOCTYPE html>
+<html dir="{S_CONTENT_DIRECTION}" lang="{S_USER_LANG}">
<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset={S_CONTENT_ENCODING}" />
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Language" content="{S_USER_LANG}" />
-<meta http-equiv="imagetoolbar" content="no" />
+<meta charset="utf-8">
+<meta http-equiv="X-UA-Compatible" content="IE=edge">
+<meta name="viewport" content="width=device-width, initial-scale=1" />
<!-- IF META -->{META}<!-- ENDIF -->
<title>{PAGE_TITLE}</title>
-<link href="style/admin.css" rel="stylesheet" type="text/css" media="screen" />
+<link href="style/admin.css?assets_version={T_ASSETS_VERSION}" rel="stylesheet" type="text/css" media="screen" />
<script type="text/javascript">
// <![CDATA[
-var jump_page = '{LA_JUMP_PAGE}:';
-var on_page = '{ON_PAGE}';
+var jump_page = '{LA_JUMP_PAGE}{L_COLON}';
+var on_page = '{CURRENT_PAGE}';
var per_page = '{PER_PAGE}';
-var base_url = '{A_BASE_URL}';
-
-var menu_state = 'shown';
-
+var base_url = '{BASE_URL|e('js')}';
/**
* Jump to page
@@ -42,35 +37,12 @@ function jumpto()
}
/**
-* Set display of page element
-* s[-1,0,1] = hide,toggle display,show
-*/
-function dE(n, s, type)
-{
- if (!type)
- {
- type = 'block';
- }
-
- var e = document.getElementById(n);
- if (!s)
- {
- s = (e.style.display == '') ? -1 : 1;
- }
- e.style.display = (s == 1) ? type : 'none';
-}
-
-/**
* Mark/unmark checkboxes
* id = ID of parent container, name = name prefix, state = state [true/false]
*/
function marklist(id, name, state)
{
- var parent = document.getElementById(id);
- if (!parent)
- {
- eval('parent = document.' + id);
- }
+ var parent = document.getElementById(id) || document[id];
if (!parent)
{
@@ -81,7 +53,7 @@ function marklist(id, name, state)
for (var r = 0; r < rb.length; r++)
{
- if (rb[r].name.substr(0, name.length) == name)
+ if (rb[r].name.substr(0, name.length) == name && rb[r].disabled !== true)
{
rb[r].checked = state;
}
@@ -111,61 +83,20 @@ function popup(url, width, height, name)
return false;
}
-/**
-* Hiding/Showing the side menu
-*/
-function switch_menu()
-{
- var menu = document.getElementById('menu');
- var main = document.getElementById('main');
- var toggle = document.getElementById('toggle');
- var handle = document.getElementById('toggle-handle');
-
- switch (menu_state)
- {
- // hide
- case 'shown':
- main.style.width = '93%';
- menu_state = 'hidden';
- menu.style.display = 'none';
- toggle.style.width = '20px';
- handle.style.backgroundImage = 'url(images/toggle.gif)';
- handle.style.backgroundRepeat = 'no-repeat';
-
- <!-- IF S_CONTENT_DIRECTION eq 'rtl' -->
- handle.style.backgroundPosition = '0% 50%';
- toggle.style.left = '96%';
- <!-- ELSE -->
- handle.style.backgroundPosition = '100% 50%';
- toggle.style.left = '0';
- <!-- ENDIF -->
- break;
-
- // show
- case 'hidden':
- main.style.width = '76%';
- menu_state = 'shown';
- menu.style.display = 'block';
- toggle.style.width = '5%';
- handle.style.backgroundImage = 'url(images/toggle.gif)';
- handle.style.backgroundRepeat = 'no-repeat';
-
- <!-- IF S_CONTENT_DIRECTION eq 'rtl' -->
- handle.style.backgroundPosition = '100% 50%';
- toggle.style.left = '75%';
- <!-- ELSE -->
- handle.style.backgroundPosition = '0% 50%';
- toggle.style.left = '15%';
- <!-- ENDIF -->
- break;
- }
-}
-
// ]]>
</script>
+
+<!-- EVENT acp_overall_header_head_append -->
+
+{$STYLESHEETS}
+
+<!-- EVENT acp_overall_header_stylesheets_after -->
+
</head>
-<body class="{S_CONTENT_DIRECTION}">
+<body class="{S_CONTENT_DIRECTION} {BODY_CLASS} nojs">
+
+<!-- EVENT acp_overall_header_body_before -->
<div id="wrap">
<div id="page-header">
@@ -178,29 +109,25 @@ function switch_menu()
<div id="tabs">
<ul>
<!-- BEGIN t_block1 -->
- <li<!-- IF t_block1.S_SELECTED --> id="activetab"<!-- ENDIF -->><a href="{t_block1.U_TITLE}"><span>{t_block1.L_TITLE}</span></a></li>
+ <li class="tab<!-- IF t_block1.S_SELECTED --> activetab<!-- ENDIF -->"><a href="{t_block1.U_TITLE}">{t_block1.L_TITLE}</a></li>
<!-- END t_block1 -->
</ul>
</div>
<div id="acp">
- <div class="panel">
- <span class="corners-top"><span></span></span>
<div id="content">
- <!-- IF not S_USER_NOTICE -->
- <div id="toggle">
- <a id="toggle-handle" accesskey="m" title="{L_MENU_TOGGLE}" onclick="switch_menu(); return false;" href="#"></a></div>
- <!-- ENDIF -->
<div id="menu">
<p>{L_LOGGED_IN_AS}<br /><strong>{USERNAME}</strong> [&nbsp;<a href="{U_LOGOUT}">{L_LOGOUT}</a>&nbsp;][&nbsp;<a href="{U_ADM_LOGOUT}">{L_ADM_LOGOUT}</a>&nbsp;]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p>
- <ul>
<!-- DEFINE $LI_USED = 0 -->
<!-- BEGIN l_block1 -->
<!-- IF l_block1.S_SELECTED -->
<!-- BEGIN l_block2 -->
<!-- IF .l_block1.l_block2.l_block3 -->
- <li class="header">{l_block1.l_block2.L_TITLE}</li>
+ <!-- IF $LI_USED --></ul></div><!-- ENDIF -->
+ <div class="menu-block">
+ <a class="header" href="javascript:void(0);">{l_block1.l_block2.L_TITLE}</a>
+ <ul>
<!-- DEFINE $LI_USED = 1 -->
<!-- ENDIF -->
@@ -212,10 +139,11 @@ function switch_menu()
<!-- ENDIF -->
<!-- END l_block1 -->
- <!-- IF not $LI_USED -->
- <li></li>
+ <!-- IF $LI_USED -->
+ </ul>
+ </div>
<!-- ENDIF -->
- </ul>
</div>
<div id="main">
+ <div class="main">
diff --git a/phpBB/adm/style/pagination.html b/phpBB/adm/style/pagination.html
new file mode 100644
index 0000000000..5e755723e8
--- /dev/null
+++ b/phpBB/adm/style/pagination.html
@@ -0,0 +1,12 @@
+
+ <a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE_CLICK}">{PAGE_NUMBER}</a> &bull;
+ <ul>
+ <!-- BEGIN pagination -->
+ <!-- IF pagination.S_IS_PREV --><li><a href="{pagination.PAGE_URL}">{L_PREVIOUS}</a></li>
+ <!-- ELSEIF pagination.S_IS_CURRENT --><li class="active"><span>{pagination.PAGE_NUMBER}</span></li>
+ <!-- ELSEIF pagination.S_IS_ELLIPSIS --><li class="ellipsis"><span>{L_ELLIPSIS}</span></li>
+ <!-- ELSEIF pagination.S_IS_NEXT --><li><a href="{pagination.PAGE_URL}">{L_NEXT}</a></li>
+ <!-- ELSE --><li><a href="{pagination.PAGE_URL}">{pagination.PAGE_NUMBER}</a></li>
+ <!-- ENDIF -->
+ <!-- END pagination -->
+ </ul>
diff --git a/phpBB/adm/style/permission_forum_copy.html b/phpBB/adm/style/permission_forum_copy.html
index c919310035..b1539aff12 100644
--- a/phpBB/adm/style/permission_forum_copy.html
+++ b/phpBB/adm/style/permission_forum_copy.html
@@ -1,6 +1,6 @@
<!-- INCLUDE overall_header.html -->
-<a name="maincontent"></a>
+<a id="maincontent"></a>
<h1>{L_ACP_FORUM_PERMISSIONS_COPY}</h1>
@@ -12,7 +12,7 @@
<legend>{L_LOOK_UP_FORUM}</legend>
<dl>
- <dt><label for="src_forum">{L_COPY_PERMISSIONS_FROM}:</label><br /><span>{L_COPY_PERMISSIONS_FORUM_FROM_EXPLAIN}</span></dt>
+ <dt><!-- EVENT acp_permission_forum_copy_src_forum_prepend --><label for="src_forum">{L_COPY_PERMISSIONS_FROM}{L_COLON}</label><br /><span>{L_COPY_PERMISSIONS_FORUM_FROM_EXPLAIN}</span><!-- EVENT acp_permission_forum_copy_src_forum_append --></dt>
<dd><select id="src_forum" name="src_forum_id"><option value="0">{L_SELECT_FORUM}</option><option value="-1">------------------</option>{S_FORUM_OPTIONS}</select></dd>
</dl>
</fieldset>
@@ -22,7 +22,7 @@
<p>{L_LOOK_UP_FORUMS_EXPLAIN}</p>
<dl>
- <dt><label for="dest_forums">{L_COPY_PERMISSIONS_TO}:</label><br /><span>{L_COPY_PERMISSIONS_FORUM_TO_EXPLAIN}</span></dt>
+ <dt><!-- EVENT acp_permission_forum_copy_dest_forum_prepend --><label for="dest_forums">{L_COPY_PERMISSIONS_TO}{L_COLON}</label><br /><span>{L_COPY_PERMISSIONS_FORUM_TO_EXPLAIN}</span><!-- EVENT acp_permission_forum_copy_dest_forum_append --></dt>
<dd><select id="dest_forums" name="dest_forum_ids[]" multiple="multiple" size="10">{S_FORUM_OPTIONS}</select></dd>
</dl>
</fieldset>
diff --git a/phpBB/adm/style/permission_mask.html b/phpBB/adm/style/permission_mask.html
index e29609b8b6..7b5c071693 100644
--- a/phpBB/adm/style/permission_mask.html
+++ b/phpBB/adm/style/permission_mask.html
@@ -38,9 +38,9 @@
<a href="#" onclick="swap_options('{p_mask.S_ROW_COUNT}', '{p_mask.f_mask.S_ROW_COUNT}', '0', true); return false;">{L_ADVANCED_PERMISSIONS}</a><!-- IF not p_mask.S_VIEW and p_mask.f_mask.S_CUSTOM --> *<!-- ENDIF -->
</div>
<dl class="permissions-simple">
- <dt style="width: 20%"><label for="role{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}">{L_ROLE}:</label></dt>
+ <dt style="width: 20%"><label for="role{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}">{L_ROLE}{L_COLON}</label></dt>
<!-- IF p_mask.f_mask.S_ROLE_OPTIONS -->
- <dd style="margin-{S_CONTENT_FLOW_BEGIN}: 20%"><select id="role{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}" name="role[{p_mask.f_mask.UG_ID}][{p_mask.f_mask.FORUM_ID}]" onchange="set_role_settings(this.options[selectedIndex].value, 'advanced{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}'); init_colours('{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}')">{p_mask.f_mask.S_ROLE_OPTIONS}</select></dd>
+ <dd style="margin-{S_CONTENT_FLOW_BEGIN}{L_COLON} 20%"><select id="role{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}" name="role[{p_mask.f_mask.UG_ID}][{p_mask.f_mask.FORUM_ID}]" onchange="set_role_settings(this.options[selectedIndex].value, 'advanced{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}'); init_colours('{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}')">{p_mask.f_mask.S_ROLE_OPTIONS}</select></dd>
<!-- ELSE -->
<dd>{L_NO_ROLE_AVAILABLE}</dd>
<!-- ENDIF -->
@@ -75,9 +75,8 @@
<!-- BEGIN category -->
<div class="permissions-panel" id="options{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}{p_mask.f_mask.category.S_ROW_COUNT}" <!-- IF p_mask.S_FIRST_ROW and p_mask.f_mask.S_FIRST_ROW and p_mask.f_mask.category.S_FIRST_ROW --><!-- ELSE --> style="display: none;"<!-- ENDIF -->>
- <span class="corners-top"><span></span></span>
<div class="tablewrap">
- <table id="table{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}{p_mask.f_mask.category.S_ROW_COUNT}" cellspacing="1">
+ <table id="table{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}{p_mask.f_mask.category.S_ROW_COUNT}" class="table1 not-responsive">
<colgroup>
<col class="permissions-name" />
<col class="permissions-yes" />
@@ -118,7 +117,7 @@
</div>
<!-- IF not p_mask.S_VIEW -->
- <fieldset class="quick" style="margin-{S_CONTENT_FLOW_END}: 11px;">
+ <fieldset class="quick" style="margin-{S_CONTENT_FLOW_END}{L_COLON} 11px;">
<p class="small">{L_APPLY_PERMISSIONS_EXPLAIN}</p>
<input class="button1" type="submit" name="psubmit[{p_mask.f_mask.UG_ID}][{p_mask.f_mask.FORUM_ID}]" value="{L_APPLY_PERMISSIONS}" />
<!-- IF .p_mask.f_mask gt 1 or .p_mask gt 1 -->
@@ -128,7 +127,6 @@
<!-- ENDIF -->
- <span class="corners-bottom"><span></span></span>
</div>
<!-- END category -->
<div class="clearfix"></div>
diff --git a/phpBB/adm/style/permission_roles_mask.html b/phpBB/adm/style/permission_roles_mask.html
index e88c5fd2ba..3a14e65004 100644
--- a/phpBB/adm/style/permission_roles_mask.html
+++ b/phpBB/adm/style/permission_roles_mask.html
@@ -1,8 +1,8 @@
<!-- BEGIN role_mask -->
- <table cellspacing="1">
- <caption><!-- IF role_mask.FORUM_ID -->{L_FORUM}: <!-- ENDIF -->{role_mask.NAME}</caption>
+ <table class="table1">
+ <caption><!-- IF role_mask.FORUM_ID -->{L_FORUM}{L_COLON} <!-- ENDIF -->{role_mask.NAME}</caption>
<tbody>
<tr>
<th>{L_USERS}</th>
@@ -25,7 +25,7 @@
<a href="{role_mask.groups.U_PROFILE}">{role_mask.groups.GROUP_NAME}</a><!-- IF not role_mask.groups.S_LAST_ROW --> :: <!-- ENDIF -->
<!-- BEGINELSE -->
{L_GROUPS_NOT_ASSIGNED}
- <!-- END users -->
+ <!-- END groups -->
</td>
</tr>
</tbody>
@@ -35,4 +35,4 @@
<p>{L_ROLE_NOT_ASSIGNED}</p>
-<!-- END role_mask --> \ No newline at end of file
+<!-- END role_mask -->
diff --git a/phpBB/adm/style/permission_trace.html b/phpBB/adm/style/permission_trace.html
index 186bb28b67..7330ffee41 100644
--- a/phpBB/adm/style/permission_trace.html
+++ b/phpBB/adm/style/permission_trace.html
@@ -4,11 +4,11 @@
<!-- IF U_BACK --><a href="{U_BACK}" style="float: {S_CONTENT_FLOW_END};">&laquo; {L_BACK}</a><!-- ENDIF -->
- <h3>{L_TRACE_FOR}: {PERMISSION_USERNAME} / <!-- IF FORUM_NAME -->{FORUM_NAME} / <!-- ENDIF -->{PERMISSION} </h3>
+ <h3>{L_TRACE_FOR}{L_COLON} {PERMISSION_USERNAME} / <!-- IF FORUM_NAME -->{FORUM_NAME} / <!-- ENDIF -->{PERMISSION} </h3>
<br />
- <table cellspacing="1" class="type1">
+ <table class="table1">
<thead>
<tr>
<th>{L_TRACE_WHO}</th>
diff --git a/phpBB/adm/style/permissions.js b/phpBB/adm/style/permissions.js
index adc8995c23..9178adab50 100644
--- a/phpBB/adm/style/permissions.js
+++ b/phpBB/adm/style/permissions.js
@@ -2,35 +2,27 @@
* Hide and show all checkboxes
* status = true (show boxes), false (hide boxes)
*/
-function display_checkboxes(status)
-{
+function display_checkboxes(status) {
var form = document.getElementById('set-permissions');
var cb = document.getElementsByTagName('input');
var display;
//show
- if (status)
- {
+ if (status) {
display = 'inline';
}
//hide
- else
- {
+ else {
display = 'none';
}
-
- for (var i = 0; i < cb.length; i++ )
- {
- if (cb[i].className == 'permissions-checkbox')
- {
+
+ for (var i = 0; i < cb.length; i++ ) {
+ if (cb[i].className === 'permissions-checkbox') {
cb[i].style.display = display;
}
-
- }
-
+ }
}
-
/**
* Change opacity of element
* e = element
@@ -38,7 +30,7 @@ function display_checkboxes(status)
*/
function set_opacity(e, value) {
e.style.opacity = value/10;
-
+
//IE opacity currently turned off, because of its astronomical stupidity
//e.style.filter = 'alpha(opacity=' + value*10 + ')';
}
@@ -50,13 +42,10 @@ function set_opacity(e, value) {
function toggle_opacity(block_id) {
var cb = document.getElementById('checkbox' + block_id);
var fs = document.getElementById('perm' + block_id);
-
- if (cb.checked)
- {
+
+ if (cb.checked) {
set_opacity(fs, 5);
- }
- else
- {
+ } else {
set_opacity(fs, 10);
}
}
@@ -71,21 +60,17 @@ function reset_opacity(status, except_id) {
var fs = perm.getElementsByTagName('fieldset');
var opacity = 5;
- if (status)
- {
- opacity = 10;
+ if (status) {
+ opacity = 10;
}
-
- for (var i = 0; i < fs.length; i++ )
- {
- if (fs[i].className != 'quick')
- {
+
+ for (var i = 0; i < fs.length; i++ ) {
+ if (fs[i].className !== 'quick') {
set_opacity(fs[i], opacity);
}
}
- if (typeof(except_id) != 'undefined')
- {
+ if (typeof(except_id) !== 'undefined') {
set_opacity(document.getElementById('perm' + except_id), 10);
}
@@ -93,20 +78,15 @@ function reset_opacity(status, except_id) {
marklist('set-permissions', 'inherit', !status);
}
-
/**
* Check whether we have a full radiobutton row of true
* index = offset for the row of inputs (0 == first row, 1 == second, 2 == third),
* rb = array of radiobuttons
*/
-function get_radio_status(index, rb)
-{
- for (var i = index; i < rb.length; i = i + 3 )
- {
- if (rb[i].checked != true)
- {
- if (i > index)
- {
+function get_radio_status(index, rb) {
+ for (var i = index; i < rb.length; i = i + 3 ) {
+ if (rb[i].checked !== true) {
+ if (i > index) {
//at least one is true, but not all (custom)
return 2;
}
@@ -121,17 +101,15 @@ function get_radio_status(index, rb)
/**
* Set tab colours
-* id = panel the tab needs to be set for,
-* init = initialising on open,
+* id = panel the tab needs to be set for,
+* init = initialising on open,
* quick = If no calculation needed, this contains the colour
*/
-function set_colours(id, init, quick)
-{
+function set_colours(id, init, quick) {
var table = document.getElementById('table' + id);
var tab = document.getElementById('tab' + id);
- if (typeof(quick) != 'undefined')
- {
+ if (typeof(quick) !== 'undefined') {
tab.className = 'permissions-preset-' + quick + ' activetab';
return;
}
@@ -141,37 +119,27 @@ function set_colours(id, init, quick)
var status = get_radio_status(0, rb);
- if (status == 1)
- {
+ if (status === 1) {
colour = 'yes';
- }
- else if (status == 0)
- {
+ } else if (status === 0) {
// We move on to No
status = get_radio_status(1, rb);
- if (status == 1)
- {
+ if (status === 1) {
colour = 'no';
- }
- else if (status == 0)
- {
+ } else if (status === 0) {
// We move on to Never
status = get_radio_status(2, rb);
- if (status == 1)
- {
+ if (status === 1) {
colour = 'never';
}
}
}
- if (init)
- {
+ if (init) {
tab.className = 'permissions-preset-' + colour;
- }
- else
- {
+ } else {
tab.className = 'permissions-preset-' + colour + ' activetab';
}
}
@@ -180,16 +148,13 @@ function set_colours(id, init, quick)
* Initialise advanced tab colours on first load
* block_id = block that is opened
*/
-function init_colours(block_id)
-{
+function init_colours(block_id) {
var block = document.getElementById('advanced' + block_id);
var panels = block.getElementsByTagName('div');
var tab = document.getElementById('tab' + id);
- for (var i = 0; i < panels.length; i++)
- {
- if(panels[i].className == 'permissions-panel')
- {
+ for (var i = 0; i < panels.length; i++) {
+ if (panels[i].className === 'permissions-panel') {
set_colours(panels[i].id.replace(/options/, ''), true);
}
}
@@ -203,38 +168,32 @@ function init_colours(block_id)
* adv = we are opening advanced permissions
* view = called from view permissions
*/
-function swap_options(pmask, fmask, cat, adv, view)
-{
+function swap_options(pmask, fmask, cat, adv, view) {
id = pmask + fmask + cat;
active_option = active_pmask + active_fmask + active_cat;
- var old_tab = document.getElementById('tab' + active_option);
+ var old_tab = document.getElementById('tab' + active_option);
var new_tab = document.getElementById('tab' + id);
var adv_block = document.getElementById('advanced' + pmask + fmask);
- if (adv_block.style.display == 'block' && adv == true)
- {
- dE('advanced' + pmask + fmask, -1);
+ if (adv_block.style.display === 'block' && adv === true) {
+ phpbb.toggleDisplay('advanced' + pmask + fmask, -1);
reset_opacity(1);
display_checkboxes(false);
return;
}
// no need to set anything if we are clicking on the same tab again
- if (new_tab == old_tab && !adv)
- {
+ if (new_tab === old_tab && !adv) {
return;
}
// init colours
- if (adv && (pmask + fmask) != (active_pmask + active_fmask))
- {
+ if (adv && (pmask + fmask) !== (active_pmask + active_fmask)) {
init_colours(pmask + fmask);
display_checkboxes(true);
reset_opacity(1);
- }
- else if (adv)
- {
+ } else if (adv) {
//Checkbox might have been clicked, but we need full visibility
display_checkboxes(true);
reset_opacity(1);
@@ -244,34 +203,29 @@ function swap_options(pmask, fmask, cat, adv, view)
old_tab.className = old_tab.className.replace(/\ activetab/g, '');
new_tab.className = new_tab.className + ' activetab';
- if (id == active_option && adv != true)
- {
+ if (id === active_option && adv !== true) {
return;
}
- dE('options' + active_option, -1);
-
+ phpbb.toggleDisplay('options' + active_option, -1);
+
//hiding and showing the checkbox
- if (document.getElementById('checkbox' + active_pmask + active_fmask))
- {
- dE('checkbox' + pmask + fmask, -1);
-
- if ((pmask + fmask) != (active_pmask + active_fmask))
- {
+ if (document.getElementById('checkbox' + active_pmask + active_fmask)) {
+ phpbb.toggleDisplay('checkbox' + pmask + fmask, -1);
+
+ if ((pmask + fmask) !== (active_pmask + active_fmask)) {
document.getElementById('checkbox' + active_pmask + active_fmask).style.display = 'inline';
}
}
- if (!view)
- {
- dE('advanced' + active_pmask + active_fmask, -1);
+ if (!view) {
+ phpbb.toggleDisplay('advanced' + active_pmask + active_fmask, -1);
}
- if (!view)
- {
- dE('advanced' + pmask + fmask, 1);
+ if (!view) {
+ phpbb.toggleDisplay('advanced' + pmask + fmask, 1);
}
- dE('options' + id, 1);
+ phpbb.toggleDisplay('options' + id, 1);
active_pmask = pmask;
active_fmask = fmask;
@@ -282,41 +236,33 @@ function swap_options(pmask, fmask, cat, adv, view)
* Mark all radio buttons in one panel
* id = table ID container, s = status ['y'/'u'/'n']
*/
-function mark_options(id, s)
-{
+function mark_options(id, s) {
var t = document.getElementById(id);
- if (!t)
- {
+ if (!t) {
return;
}
var rb = t.getElementsByTagName('input');
- for (var r = 0; r < rb.length; r++)
- {
- if (rb[r].id.substr(rb[r].id.length-1) == s)
- {
+ for (var r = 0; r < rb.length; r++) {
+ if (rb[r].id.substr(rb[r].id.length-1) === s) {
rb[r].checked = true;
}
}
}
-function mark_one_option(id, field_name, s)
-{
+function mark_one_option(id, field_name, s) {
var t = document.getElementById(id);
- if (!t)
- {
+ if (!t) {
return;
}
var rb = t.getElementsByTagName('input');
- for (var r = 0; r < rb.length; r++)
- {
- if (rb[r].id.substr(rb[r].id.length-field_name.length-3, field_name.length) == field_name && rb[r].id.substr(rb[r].id.length-1) == s)
- {
+ for (var r = 0; r < rb.length; r++) {
+ if (rb[r].id.substr(rb[r].id.length-field_name.length-3, field_name.length) === field_name && rb[r].id.substr(rb[r].id.length-1) === s) {
rb[r].checked = true;
}
}
@@ -325,12 +271,10 @@ function mark_one_option(id, field_name, s)
/**
* Reset role dropdown field to Select role... if an option gets changed
*/
-function reset_role(id)
-{
+function reset_role(id) {
var t = document.getElementById(id);
- if (!t)
- {
+ if (!t) {
return;
}
@@ -340,20 +284,17 @@ function reset_role(id)
/**
* Load role and set options accordingly
*/
-function set_role_settings(role_id, target_id)
-{
+function set_role_settings(role_id, target_id) {
settings = role_options[role_id];
- if (!settings)
- {
+ if (!settings) {
return;
}
// Mark all options to no (unset) first...
mark_options(target_id, 'u');
- for (var r in settings)
- {
- mark_one_option(target_id, r, (settings[r] == 1) ? 'y' : 'n');
+ for (var r in settings) {
+ mark_one_option(target_id, r, (settings[r] === 1) ? 'y' : 'n');
}
}
diff --git a/phpBB/adm/style/profilefields/bool.html b/phpBB/adm/style/profilefields/bool.html
new file mode 100644
index 0000000000..f1d7ba75f4
--- /dev/null
+++ b/phpBB/adm/style/profilefields/bool.html
@@ -0,0 +1,7 @@
+<!-- BEGIN bool -->
+<!-- IF bool.FIELD_LENGTH eq 1 -->
+ <!-- BEGIN options --><label for="{bool.FIELD_IDENT}_{bool.options.OPTION_ID}"><input type="radio" class="radio" name="{bool.FIELD_IDENT}" id="{bool.FIELD_IDENT}_{bool.options.OPTION_ID}" value="{bool.options.OPTION_ID}"{bool.options.CHECKED} /> {bool.options.VALUE}</label> <!-- END options -->
+<!-- ELSE -->
+ <input type="checkbox" class="radio" name="{bool.FIELD_IDENT}" id="{bool.FIELD_IDENT}"<!-- IF bool.FIELD_VALUE --> checked="checked"<!-- ENDIF --> />
+<!-- ENDIF -->
+<!-- END bool -->
diff --git a/phpBB/adm/style/profilefields/date.html b/phpBB/adm/style/profilefields/date.html
new file mode 100644
index 0000000000..5d5bc04ed6
--- /dev/null
+++ b/phpBB/adm/style/profilefields/date.html
@@ -0,0 +1,5 @@
+<!-- BEGIN date -->
+<label for="{date.FIELD_IDENT}_day">{L_DAY}{L_COLON} <select name="{date.FIELD_IDENT}_day" id="{date.FIELD_IDENT}_day">{date.S_DAY_OPTIONS}</select></label>
+<label for="{date.FIELD_IDENT}_month">{L_MONTH}{L_COLON} <select name="{date.FIELD_IDENT}_month" id="{date.FIELD_IDENT}_month">{date.S_MONTH_OPTIONS}</select></label>
+<label for="{date.FIELD_IDENT}_year">{L_YEAR}{L_COLON} <select name="{date.FIELD_IDENT}_year" id="{date.FIELD_IDENT}_year">{date.S_YEAR_OPTIONS}</select></label>
+<!-- END date -->
diff --git a/phpBB/adm/style/profilefields/dropdown.html b/phpBB/adm/style/profilefields/dropdown.html
new file mode 100644
index 0000000000..243b7039da
--- /dev/null
+++ b/phpBB/adm/style/profilefields/dropdown.html
@@ -0,0 +1,5 @@
+<!-- BEGIN dropdown -->
+<select name="{dropdown.FIELD_IDENT}" id="{dropdown.FIELD_IDENT}">
+ <!-- BEGIN options --><option value="{dropdown.options.OPTION_ID}"{dropdown.options.SELECTED}>{dropdown.options.VALUE}</option><!-- END options -->
+</select>
+<!-- END dropdown -->
diff --git a/phpBB/adm/style/profilefields/int.html b/phpBB/adm/style/profilefields/int.html
new file mode 100644
index 0000000000..d047c254d8
--- /dev/null
+++ b/phpBB/adm/style/profilefields/int.html
@@ -0,0 +1,3 @@
+<!-- BEGIN int -->
+<input type="number" min="{int.FIELD_MINLEN}" max="{int.FIELD_MAXLEN}" class="autowidth" name="{int.FIELD_IDENT}" id="{int.FIELD_IDENT}" size="{int.FIELD_LENGTH}" value="{int.FIELD_VALUE}" />
+<!-- END int -->
diff --git a/phpBB/adm/style/profilefields/string.html b/phpBB/adm/style/profilefields/string.html
new file mode 100644
index 0000000000..a8855f50d8
--- /dev/null
+++ b/phpBB/adm/style/profilefields/string.html
@@ -0,0 +1,3 @@
+<!-- BEGIN string -->
+<input type="text" class="autowidth" name="{string.FIELD_IDENT}" id="{string.FIELD_IDENT}" size="{string.FIELD_LENGTH}" maxlength="{string.FIELD_MAXLEN}" value="{string.FIELD_VALUE}" />
+<!-- END string -->
diff --git a/phpBB/adm/style/profilefields/text.html b/phpBB/adm/style/profilefields/text.html
new file mode 100644
index 0000000000..6334b61926
--- /dev/null
+++ b/phpBB/adm/style/profilefields/text.html
@@ -0,0 +1,3 @@
+<!-- BEGIN text -->
+<textarea name="{text.FIELD_IDENT}" id="{text.FIELD_IDENT}" rows="{text.FIELD_ROWS}" cols="{text.FIELD_COLS}">{text.FIELD_VALUE}</textarea>
+<!-- END text -->
diff --git a/phpBB/adm/style/profilefields/url.html b/phpBB/adm/style/profilefields/url.html
new file mode 100644
index 0000000000..8dd3a90de1
--- /dev/null
+++ b/phpBB/adm/style/profilefields/url.html
@@ -0,0 +1,3 @@
+<!-- BEGIN url -->
+<input type="url" class="inputbox autowidth" name="{url.FIELD_IDENT}" id="{url.FIELD_IDENT}" size="{url.FIELD_LENGTH}" maxlength="{url.FIELD_MAXLEN}" value="{url.FIELD_VALUE}" />
+<!-- END url -->
diff --git a/phpBB/adm/style/progress_bar.html b/phpBB/adm/style/progress_bar.html
index 00e1e5e885..1822675c15 100644
--- a/phpBB/adm/style/progress_bar.html
+++ b/phpBB/adm/style/progress_bar.html
@@ -37,4 +37,4 @@
// ]]>
</script>
-<!-- INCLUDE simple_footer.html --> \ No newline at end of file
+<!-- INCLUDE simple_footer.html -->
diff --git a/phpBB/adm/style/simple_body.html b/phpBB/adm/style/simple_body.html
index 0b1e11b9a2..ca06bc4f10 100644
--- a/phpBB/adm/style/simple_body.html
+++ b/phpBB/adm/style/simple_body.html
@@ -5,4 +5,4 @@
<p>{MESSAGE_TEXT}</p>
</div>
-<!-- INCLUDE simple_footer.html --> \ No newline at end of file
+<!-- INCLUDE simple_footer.html -->
diff --git a/phpBB/adm/style/simple_footer.html b/phpBB/adm/style/simple_footer.html
index 6395eace6c..08ee0a739f 100644
--- a/phpBB/adm/style/simple_footer.html
+++ b/phpBB/adm/style/simple_footer.html
@@ -16,5 +16,12 @@
</div>
+<script type="text/javascript" src="{T_JQUERY_LINK}"></script>
+<!-- IF S_ALLOW_CDN --><script type="text/javascript">window.jQuery || document.write('\x3Cscript src="{T_ASSETS_PATH}/javascript/jquery.min.js?assets_version={T_ASSETS_VERSION}">\x3C/script>');</script><!-- ENDIF -->
+<script type="text/javascript" src="{T_ASSETS_PATH}/javascript/core.js?assets_version={T_ASSETS_VERSION}"></script>
+
+<!-- EVENT acp_simple_footer_after -->
+{$SCRIPTS}
+
</body>
</html>
diff --git a/phpBB/adm/style/simple_header.html b/phpBB/adm/style/simple_header.html
index 2339b70a93..439645a211 100644
--- a/phpBB/adm/style/simple_header.html
+++ b/phpBB/adm/style/simple_header.html
@@ -1,22 +1,20 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" dir="{S_CONTENT_DIRECTION}" lang="{S_USER_LANG}" xml:lang="{S_USER_LANG}">
+<!DOCTYPE html>
+<html dir="{S_CONTENT_DIRECTION}" lang="{S_USER_LANG}">
<head>
-
-<meta http-equiv="Content-Type" content="text/html; charset={S_CONTENT_ENCODING}" />
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Language" content="{S_USER_LANG}" />
-<meta http-equiv="imagetoolbar" content="no" />
+<meta charset="utf-8">
+<meta http-equiv="X-UA-Compatible" content="IE=edge">
+<meta name="viewport" content="width=device-width, initial-scale=1" />
<!-- IF META -->{META}<!-- ENDIF -->
<title>{PAGE_TITLE}</title>
-<link href="style/admin.css" rel="stylesheet" type="text/css" media="screen" />
+<link href="style/admin.css?assets_version={T_ASSETS_VERSION}" rel="stylesheet" type="text/css" media="screen" />
<script type="text/javascript">
// <![CDATA[
-var jump_page = '{LA_JUMP_PAGE}:';
-var on_page = '{ON_PAGE}';
+var jump_page = '{LA_JUMP_PAGE}{L_COLON}';
+var on_page = '{CURRENT_PAGE}';
var per_page = '{PER_PAGE}';
-var base_url = '{A_BASE_URL}';
+var base_url = '{BASE_URL|e('js')}';
/**
* Window popup
@@ -53,25 +51,6 @@ function jumpto()
}
/**
-* Set display of page element
-* s[-1,0,1] = hide,toggle display,show
-*/
-function dE(n, s, type)
-{
- if (!type)
- {
- type = 'block';
- }
-
- var e = document.getElementById(n);
- if (!s)
- {
- s = (e.style.display == '') ? -1 : 1;
- }
- e.style.display = (s == 1) ? type : 'none';
-}
-
-/**
* Mark/unmark checkboxes
* id = ID of parent container, name = name prefix, state = state [true/false]
*/
@@ -87,7 +66,7 @@ function marklist(id, name, state)
for (var r = 0; r < rb.length; r++)
{
- if (rb[r].name.substr(0, name.length) == name)
+ if (rb[r].name.substr(0, name.length) == name && rb[r].disabled !== true)
{
rb[r].checked = state;
}
@@ -105,8 +84,13 @@ function find_username(url)
// ]]>
</script>
+<!-- EVENT acp_simple_header_head_append -->
+{$STYLESHEETS}
+<!-- EVENT acp_simple_header_stylesheets_after -->
</head>
-<body class="{S_CONTENT_DIRECTION}">
+<body class="{S_CONTENT_DIRECTION} {BODY_CLASS}">
+
+<!-- EVENT acp_simple_header_body_before -->
<div id="page-body" class="simple-page-body">
diff --git a/phpBB/adm/style/timezone.js b/phpBB/adm/style/timezone.js
new file mode 100644
index 0000000000..b5e27c907c
--- /dev/null
+++ b/phpBB/adm/style/timezone.js
@@ -0,0 +1,13 @@
+(function($) { // Avoid conflicts with other libraries
+
+"use strict";
+
+$('#tz_date').change(function() {
+ phpbb.timezoneSwitchDate(false);
+});
+
+$(document).ready(
+ phpbb.timezoneEnableDateSelection
+);
+
+})(jQuery); // Avoid conflicts with other libraries
diff --git a/phpBB/adm/style/timezone_option.html b/phpBB/adm/style/timezone_option.html
new file mode 100644
index 0000000000..acfff30184
--- /dev/null
+++ b/phpBB/adm/style/timezone_option.html
@@ -0,0 +1,27 @@
+<dl>
+ <dt><label for="timezone">{L_BOARD_TIMEZONE}{L_COLON}</label></dt>
+ <!-- IF .timezone_date -->
+ <dd id="tz_select_date" style="display: none;">
+ <select name="tz_date" id="tz_date" class="autowidth tz_select">
+ <option value="">{L_SELECT_CURRENT_TIME}</option>
+ <!-- BEGIN timezone_date -->
+ <option value="{timezone_date.VALUE}"<!-- IF timezone_date.SELECTED --> selected="selected"<!-- ENDIF -->>{timezone_date.TITLE}</option>
+ <!-- END timezone_date -->
+ </select>
+ </dd>
+ <!-- ENDIF -->
+ <dd>
+ <select name="tz" id="timezone" class="autowidth tz_select">
+ <option value="">{L_SELECT_TIMEZONE}</option>
+ <!-- BEGIN timezone_select -->
+ <optgroup label="{timezone_select.LABEL}" data-tz-value="{timezone_select.VALUE}">
+ <!-- BEGIN timezone_options -->
+ <option title="{timezone_select.timezone_options.TITLE}" value="{timezone_select.timezone_options.VALUE}"<!-- IF timezone_select.timezone_options.SELECTED --> selected="selected"<!-- ENDIF -->>{timezone_select.timezone_options.LABEL}</option>
+ <!-- END timezone_options -->
+ </optgroup>
+ <!-- END timezone_select -->
+ </select>
+
+ <!-- INCLUDEJS timezone.js -->
+ </dd>
+</dl>
diff --git a/phpBB/adm/style/tooltip.js b/phpBB/adm/style/tooltip.js
index 20610b52fe..3a89008706 100644
--- a/phpBB/adm/style/tooltip.js
+++ b/phpBB/adm/style/tooltip.js
@@ -1,6 +1,6 @@
/*
javascript for Bubble Tooltips by Alessandro Fulciniti
-- http://pro.html.it - http://web-graphics.com
+- http://pro.html.it - http://web-graphics.com
obtained from: http://web-graphics.com/mtarchive/001717.php
phpBB Development Team:
@@ -15,14 +15,12 @@ var head_text, tooltip_mode;
/**
* Enable tooltip replacements for links
*/
-function enable_tooltips_link(id, headline, sub_id)
-{
+function enable_tooltips_link(id, headline, sub_id) {
var links, i, hold;
-
+
head_text = headline;
- if (!document.getElementById || !document.getElementsByTagName)
- {
+ if (!document.getElementById || !document.getElementsByTagName) {
return;
}
@@ -33,26 +31,18 @@ function enable_tooltips_link(id, headline, sub_id)
document.getElementsByTagName('body')[0].appendChild(hold);
- if (id == null)
- {
+ if (id === null) {
links = document.getElementsByTagName('a');
- }
- else
- {
+ } else {
links = document.getElementById(id).getElementsByTagName('a');
}
- for (i = 0; i < links.length; i++)
- {
- if (sub_id)
- {
- if (links[i].id.substr(0, sub_id.length) == sub_id)
- {
+ for (i = 0; i < links.length; i++) {
+ if (sub_id) {
+ if (links[i].id.substr(0, sub_id.length) === sub_id) {
prepare(links[i]);
}
- }
- else
- {
+ } else {
prepare(links[i]);
}
}
@@ -63,14 +53,12 @@ function enable_tooltips_link(id, headline, sub_id)
/**
* Enable tooltip replacements for selects
*/
-function enable_tooltips_select(id, headline, sub_id)
-{
+function enable_tooltips_select(id, headline, sub_id) {
var links, i, hold;
-
+
head_text = headline;
- if (!document.getElementById || !document.getElementsByTagName)
- {
+ if (!document.getElementById || !document.getElementsByTagName) {
return;
}
@@ -81,26 +69,18 @@ function enable_tooltips_select(id, headline, sub_id)
document.getElementsByTagName('body')[0].appendChild(hold);
- if (id == null)
- {
+ if (id === null) {
links = document.getElementsByTagName('option');
- }
- else
- {
+ } else {
links = document.getElementById(id).getElementsByTagName('option');
}
- for (i = 0; i < links.length; i++)
- {
- if (sub_id)
- {
- if (links[i].parentNode.id.substr(0, sub_id.length) == sub_id)
- {
+ for (i = 0; i < links.length; i++) {
+ if (sub_id) {
+ if (links[i].parentNode.id.substr(0, sub_id.length) === sub_id) {
prepare(links[i]);
}
- }
- else
- {
+ } else {
prepare(links[i]);
}
}
@@ -111,14 +91,12 @@ function enable_tooltips_select(id, headline, sub_id)
/**
* Prepare elements to replace
*/
-function prepare(element)
-{
+function prepare(element) {
var tooltip, text, desc, title;
text = element.getAttribute('title');
- if (text == null || text.length == 0)
- {
+ if (text === null || text.length === 0) {
return;
}
@@ -139,8 +117,7 @@ function prepare(element)
element.onmouseover = show_tooltip;
element.onmouseout = hide_tooltip;
- if (tooltip_mode == 'link')
- {
+ if (tooltip_mode === 'link') {
element.onmousemove = locate;
}
}
@@ -148,8 +125,7 @@ function prepare(element)
/**
* Show tooltip
*/
-function show_tooltip(e)
-{
+function show_tooltip(e) {
document.getElementById('_tooltip_container').appendChild(this.tooltip);
locate(this);
}
@@ -157,11 +133,9 @@ function show_tooltip(e)
/**
* Hide tooltip
*/
-function hide_tooltip(e)
-{
+function hide_tooltip(e) {
var d = document.getElementById('_tooltip_container');
- if (d.childNodes.length > 0)
- {
+ if (d.childNodes.length > 0) {
d.removeChild(d.firstChild);
}
}
@@ -169,8 +143,7 @@ function hide_tooltip(e)
/**
* Set opacity on tooltip element
*/
-function set_opacity(element)
-{
+function set_opacity(element) {
element.style.filter = 'alpha(opacity:95)';
element.style.KHTMLOpacity = '0.95';
element.style.MozOpacity = '0.95';
@@ -180,8 +153,7 @@ function set_opacity(element)
/**
* Create new element
*/
-function create_element(tag, c)
-{
+function create_element(tag, c) {
var x = document.createElement(tag);
x.className = c;
x.style.display = 'block';
@@ -191,34 +163,26 @@ function create_element(tag, c)
/**
* Correct positioning of tooltip container
*/
-function locate(e)
-{
+function locate(e) {
var posx = 0;
var posy = 0;
e = e.parentNode;
- if (e.offsetParent)
- {
- for (var posx = 0, posy = 0; e.offsetParent; e = e.offsetParent)
- {
+ if (e.offsetParent) {
+ for (posx = 0, posy = 0; e.offsetParent; e = e.offsetParent) {
posx += e.offsetLeft;
posy += e.offsetTop;
}
- }
- else
- {
+ } else {
posx = e.offsetLeft;
posy = e.offsetTop;
}
- if (tooltip_mode == 'link')
- {
+ if (tooltip_mode === 'link') {
document.getElementById('_tooltip_container').style.top=(posy+20) + 'px';
document.getElementById('_tooltip_container').style.left=(posx-20) + 'px';
- }
- else
- {
+ } else {
document.getElementById('_tooltip_container').style.top=(posy+30) + 'px';
document.getElementById('_tooltip_container').style.left=(posx-205) + 'px';
}
diff --git a/phpBB/adm/style/viewsource.html b/phpBB/adm/style/viewsource.html
deleted file mode 100644
index f127c9626f..0000000000
--- a/phpBB/adm/style/viewsource.html
+++ /dev/null
@@ -1,21 +0,0 @@
-<!-- INCLUDE simple_header.html -->
-<div id="acp" style="padding: 0;">
-<div class="panel" style="padding: 10px;">
-<div style="overflow: auto;">
- <h1>{FILENAME}</h1>
-
- <table class="type2">
- <tbody>
- <!-- BEGIN source -->
- <tr valign="top">
- <td class="sourcenum">{source.LINENUM}&nbsp;&nbsp;</td>
- <td class="source">{source.LINE}</td>
- </tr>
- <!-- END source -->
- </tbody>
- </table>
-
-</div>
-</div>
-</div>
-<!-- INCLUDE simple_footer.html --> \ No newline at end of file
diff --git a/phpBB/adm/swatch.php b/phpBB/adm/swatch.php
deleted file mode 100644
index e372c16b9b..0000000000
--- a/phpBB/adm/swatch.php
+++ /dev/null
@@ -1,53 +0,0 @@
-<?php
-/**
-*
-* @package phpBB3
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
-*
-*/
-
-/**
-* @ignore
-*/
-define('IN_PHPBB', true);
-define('ADMIN_START', true);
-$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './../';
-$phpEx = substr(strrchr(__FILE__, '.'), 1);
-include($phpbb_root_path . 'common.' . $phpEx);
-
-// Start session management
-$user->session_begin(false);
-$auth->acl($user->data);
-$user->setup();
-
-// Set custom template for admin area
-$template->set_custom_template($phpbb_root_path . 'adm/style', 'admin');
-
-$template->set_filenames(array(
- 'body' => 'colour_swatch.html')
-);
-
-$form = request_var('form', '');
-$name = request_var('name', '');
-
-// We validate form and name here, only id/class allowed
-$form = (!preg_match('/^[a-z0-9_-]+$/i', $form)) ? '' : $form;
-$name = (!preg_match('/^[a-z0-9_-]+$/i', $name)) ? '' : $name;
-
-$template->assign_vars(array(
- 'OPENER' => $form,
- 'NAME' => $name,
- 'T_IMAGES_PATH' => "{$phpbb_root_path}images/",
-
- 'S_USER_LANG' => $user->lang['USER_LANG'],
- 'S_CONTENT_DIRECTION' => $user->lang['DIRECTION'],
- 'S_CONTENT_ENCODING' => 'UTF-8',
-));
-
-$template->display('body');
-
-garbage_collection();
-
-?> \ No newline at end of file
diff --git a/phpBB/app.php b/phpBB/app.php
new file mode 100644
index 0000000000..d9250adc75
--- /dev/null
+++ b/phpBB/app.php
@@ -0,0 +1,35 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+/**
+*/
+
+/**
+* @ignore
+*/
+define('IN_PHPBB', true);
+$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
+$phpEx = substr(strrchr(__FILE__, '.'), 1);
+include($phpbb_root_path . 'common.' . $phpEx);
+include($phpbb_root_path . 'includes/functions_url_matcher.' . $phpEx);
+
+// Start session management
+$user->session_begin();
+$auth->acl($user->data);
+$user->setup('app');
+
+$http_kernel = $phpbb_container->get('http_kernel');
+$symfony_request = $phpbb_container->get('symfony_request');
+$response = $http_kernel->handle($symfony_request);
+$response->send();
+$http_kernel->terminate($symfony_request, $response);
diff --git a/phpBB/assets/javascript/core.js b/phpBB/assets/javascript/core.js
new file mode 100644
index 0000000000..b079043396
--- /dev/null
+++ b/phpBB/assets/javascript/core.js
@@ -0,0 +1,1675 @@
+/* global bbfontstyle */
+
+var phpbb = {};
+phpbb.alertTime = 100;
+
+(function($) { // Avoid conflicts with other libraries
+
+'use strict';
+
+// define a couple constants for keydown functions.
+var keymap = {
+ TAB: 9,
+ ENTER: 13,
+ ESC: 27
+};
+
+var $dark = $('#darkenwrapper');
+var $loadingIndicator;
+var phpbbAlertTimer = null;
+
+phpbb.isTouch = (window && typeof window.ontouchstart !== 'undefined');
+
+/**
+ * Display a loading screen
+ *
+ * @returns {object} Returns loadingIndicator.
+ */
+phpbb.loadingIndicator = function() {
+ if (!$loadingIndicator) {
+ $loadingIndicator = $('<div />', { id: 'loading_indicator' });
+ $loadingIndicator.appendTo('#page-footer');
+ }
+
+ if (!$loadingIndicator.is(':visible')) {
+ $loadingIndicator.fadeIn(phpbb.alertTime);
+ // Wait 60 seconds and display an error if nothing has been returned by then.
+ phpbb.clearLoadingTimeout();
+ phpbbAlertTimer = setTimeout(function() {
+ phpbb.showTimeoutMessage();
+ }, 60000);
+ }
+
+ return $loadingIndicator;
+};
+
+/**
+ * Show timeout message
+ */
+phpbb.showTimeoutMessage = function () {
+ var $alert = $('#phpbb_alert');
+
+ if ($loadingIndicator.is(':visible')) {
+ phpbb.alert($alert.attr('data-l-err'), $alert.attr('data-l-timeout-processing-req'));
+ }
+};
+
+/**
+ * Clear loading alert timeout
+*/
+phpbb.clearLoadingTimeout = function() {
+ if (phpbbAlertTimer !== null) {
+ clearTimeout(phpbbAlertTimer);
+ phpbbAlertTimer = null;
+ }
+};
+
+
+/**
+* Close popup alert after a specified delay
+*
+* @param {int} delay Delay in ms until darkenwrapper's click event is triggered
+*/
+phpbb.closeDarkenWrapper = function(delay) {
+ phpbbAlertTimer = setTimeout(function() {
+ $('#darkenwrapper').trigger('click');
+ }, delay);
+};
+
+/**
+ * Display a simple alert similar to JSs native alert().
+ *
+ * You can only call one alert or confirm box at any one time.
+ *
+ * @param {string} title Title of the message, eg "Information" (HTML).
+ * @param {string} msg Message to display (HTML).
+ *
+ * @returns {object} Returns the div created.
+ */
+phpbb.alert = function(title, msg) {
+ var $alert = $('#phpbb_alert');
+ $alert.find('.alert_title').html(title);
+ $alert.find('.alert_text').html(msg);
+
+ $(document).on('keydown.phpbb.alert', function(e) {
+ if (e.keyCode === keymap.ENTER || e.keyCode === keymap.ESC) {
+ phpbb.alert.close($alert, true);
+ e.preventDefault();
+ e.stopPropagation();
+ }
+ });
+ phpbb.alert.open($alert);
+
+ return $alert;
+};
+
+/**
+* Handler for opening an alert box.
+*
+* @param {jQuery} $alert jQuery object.
+*/
+phpbb.alert.open = function($alert) {
+ if (!$dark.is(':visible')) {
+ $dark.fadeIn(phpbb.alertTime);
+ }
+
+ if ($loadingIndicator && $loadingIndicator.is(':visible')) {
+ $loadingIndicator.fadeOut(phpbb.alertTime, function() {
+ $dark.append($alert);
+ $alert.fadeIn(phpbb.alertTime);
+ });
+ } else if ($dark.is(':visible')) {
+ $dark.append($alert);
+ $alert.fadeIn(phpbb.alertTime);
+ } else {
+ $dark.append($alert);
+ $alert.show();
+ $dark.fadeIn(phpbb.alertTime);
+ }
+
+ $alert.on('click', function(e) {
+ e.stopPropagation();
+ });
+
+ $dark.one('click', function(e) {
+ phpbb.alert.close($alert, true);
+ e.preventDefault();
+ e.stopPropagation();
+ });
+
+ $alert.find('.alert_close').one('click', function(e) {
+ phpbb.alert.close($alert, true);
+ e.preventDefault();
+ });
+};
+
+/**
+* Handler for closing an alert box.
+*
+* @param {jQuery} $alert jQuery object.
+* @param {bool} fadedark Whether to remove dark background.
+*/
+phpbb.alert.close = function($alert, fadedark) {
+ var $fade = (fadedark) ? $dark : $alert;
+
+ $fade.fadeOut(phpbb.alertTime, function() {
+ $alert.hide();
+ });
+
+ $alert.find('.alert_close').off('click');
+ $(document).off('keydown.phpbb.alert');
+};
+
+/**
+ * Display a simple yes / no box to the user.
+ *
+ * You can only call one alert or confirm box at any one time.
+ *
+ * @param {string} msg Message to display (HTML).
+ * @param {function} callback Callback. Bool param, whether the user pressed
+ * yes or no (or whatever their language is).
+ * @param {bool} fadedark Remove the dark background when done? Defaults
+ * to yes.
+ *
+ * @returns {object} Returns the div created.
+ */
+phpbb.confirm = function(msg, callback, fadedark) {
+ var $confirmDiv = $('#phpbb_confirm');
+ $confirmDiv.find('.alert_text').html(msg);
+ fadedark = fadedark || true;
+
+ $(document).on('keydown.phpbb.alert', function(e) {
+ if (e.keyCode === keymap.ENTER || e.keyCode === keymap.ESC) {
+ var name = (e.keyCode === keymap.ENTER) ? 'confirm' : 'cancel';
+
+ $('input[name="' + name + '"]').trigger('click');
+ e.preventDefault();
+ e.stopPropagation();
+ }
+ });
+
+ $confirmDiv.find('input[type="button"]').one('click.phpbb.confirmbox', function(e) {
+ var confirmed = this.name === 'confirm';
+
+ if (confirmed) {
+ callback(true);
+ }
+ $confirmDiv.find('input[type="button"]').off('click.phpbb.confirmbox');
+ phpbb.alert.close($confirmDiv, fadedark || !confirmed);
+
+ e.preventDefault();
+ e.stopPropagation();
+ });
+
+ phpbb.alert.open($confirmDiv);
+
+ return $confirmDiv;
+};
+
+/**
+ * Turn a querystring into an array.
+ *
+ * @argument {string} string The querystring to parse.
+ * @returns {object} The object created.
+ */
+phpbb.parseQuerystring = function(string) {
+ var params = {}, i, split;
+
+ string = string.split('&');
+ for (i = 0; i < string.length; i++) {
+ split = string[i].split('=');
+ params[split[0]] = decodeURIComponent(split[1]);
+ }
+ return params;
+};
+
+
+/**
+ * Makes a link use AJAX instead of loading an entire page.
+ *
+ * This function will work for links (both standard links and links which
+ * invoke confirm_box) and forms. It will be called automatically for links
+ * and forms with the data-ajax attribute set, and will call the necessary
+ * callback.
+ *
+ * For more info, view the following page on the phpBB wiki:
+ * http://wiki.phpbb.com/JavaScript_Function.phpbb.ajaxify
+ *
+ * @param {object} options Options.
+ */
+phpbb.ajaxify = function(options) {
+ var $elements = $(options.selector),
+ refresh = options.refresh,
+ callback = options.callback,
+ overlay = (typeof options.overlay !== 'undefined') ? options.overlay : true,
+ isForm = $elements.is('form'),
+ isText = $elements.is('input[type="text"], textarea'),
+ eventName;
+
+ if (isForm) {
+ eventName = 'submit';
+ } else if (isText) {
+ eventName = 'keyup';
+ } else {
+ eventName = 'click';
+ }
+
+ $elements.on(eventName, function(event) {
+ var action, method, data, submit, that = this, $this = $(this);
+
+ if ($this.find('input[type="submit"][data-clicked]').attr('data-ajax') === 'false') {
+ return;
+ }
+
+ /**
+ * Handler for AJAX errors
+ */
+ function errorHandler(jqXHR, textStatus, errorThrown) {
+ if (typeof console !== 'undefined' && console.log) {
+ console.log('AJAX error. status: ' + textStatus + ', message: ' + errorThrown);
+ }
+ phpbb.clearLoadingTimeout();
+ var responseText, errorText = false;
+ try {
+ responseText = JSON.parse(jqXHR.responseText);
+ responseText = responseText.message;
+ } catch (e) {}
+ if (typeof responseText === 'string' && responseText.length > 0) {
+ errorText = responseText;
+ } else if (typeof errorThrown === 'string' && errorThrown.length > 0) {
+ errorText = errorThrown;
+ } else {
+ errorText = $dark.attr('data-ajax-error-text-' + textStatus);
+ if (typeof errorText !== 'string' || !errorText.length) {
+ errorText = $dark.attr('data-ajax-error-text');
+ }
+ }
+ phpbb.alert($dark.attr('data-ajax-error-title'), errorText);
+ }
+
+ /**
+ * This is a private function used to handle the callbacks, refreshes
+ * and alert. It calls the callback, refreshes the page if necessary, and
+ * displays an alert to the user and removes it after an amount of time.
+ *
+ * It cannot be called from outside this function, and is purely here to
+ * avoid repetition of code.
+ *
+ * @param {object} res The object sent back by the server.
+ */
+ function returnHandler(res) {
+ var alert;
+
+ phpbb.clearLoadingTimeout();
+
+ // Is a confirmation required?
+ if (typeof res.S_CONFIRM_ACTION === 'undefined') {
+ // If a confirmation is not required, display an alert and call the
+ // callbacks.
+ if (typeof res.MESSAGE_TITLE !== 'undefined') {
+ alert = phpbb.alert(res.MESSAGE_TITLE, res.MESSAGE_TEXT);
+ } else {
+ $dark.fadeOut(phpbb.alertTime);
+
+ if ($loadingIndicator) {
+ $loadingIndicator.fadeOut(phpbb.alertTime);
+ }
+ }
+
+ if (typeof phpbb.ajaxCallbacks[callback] === 'function') {
+ phpbb.ajaxCallbacks[callback].call(that, res);
+ }
+
+ // If the server says to refresh the page, check whether the page should
+ // be refreshed and refresh page after specified time if required.
+ if (res.REFRESH_DATA) {
+ if (typeof refresh === 'function') {
+ refresh = refresh(res.REFRESH_DATA.url);
+ } else if (typeof refresh !== 'boolean') {
+ refresh = false;
+ }
+
+ phpbbAlertTimer = setTimeout(function() {
+ if (refresh) {
+ window.location = res.REFRESH_DATA.url;
+ }
+
+ // Hide the alert even if we refresh the page, in case the user
+ // presses the back button.
+ $dark.fadeOut(phpbb.alertTime, function() {
+ if (typeof alert !== 'undefined') {
+ alert.hide();
+ }
+ });
+ }, res.REFRESH_DATA.time * 1000); // Server specifies time in seconds
+ }
+ } else {
+ // If confirmation is required, display a dialog to the user.
+ phpbb.confirm(res.MESSAGE_BODY, function(del) {
+ if (!del) {
+ return;
+ }
+
+ phpbb.loadingIndicator();
+ data = $('<form>' + res.S_HIDDEN_FIELDS + '</form>').serialize();
+ $.ajax({
+ url: res.S_CONFIRM_ACTION,
+ type: 'POST',
+ data: data + '&confirm=' + res.YES_VALUE + '&' + $('form', '#phpbb_confirm').serialize(),
+ success: returnHandler,
+ error: errorHandler
+ });
+ }, false);
+ }
+ }
+
+ // If the element is a form, POST must be used and some extra data must
+ // be taken from the form.
+ var runFilter = (typeof options.filter === 'function');
+ data = {};
+
+ if (isForm) {
+ action = $this.attr('action').replace('&amp;', '&');
+ data = $this.serializeArray();
+ method = $this.attr('method') || 'GET';
+
+ if ($this.find('input[type="submit"][data-clicked]')) {
+ submit = $this.find('input[type="submit"][data-clicked]');
+ data.push({
+ name: submit.attr('name'),
+ value: submit.val()
+ });
+ }
+ } else if (isText) {
+ var name = $this.attr('data-name') || this.name;
+ action = $this.attr('data-url').replace('&amp;', '&');
+ data[name] = this.value;
+ method = 'POST';
+ } else {
+ action = this.href;
+ data = null;
+ method = 'GET';
+ }
+
+ var sendRequest = function() {
+ var dataOverlay = $this.attr('data-overlay');
+ if (overlay && (typeof dataOverlay === 'undefined' || dataOverlay === 'true')) {
+ phpbb.loadingIndicator();
+ }
+
+ var request = $.ajax({
+ url: action,
+ type: method,
+ data: data,
+ success: returnHandler,
+ error: errorHandler,
+ cache: false
+ });
+
+ request.always(function() {
+ if ($loadingIndicator && $loadingIndicator.is(':visible')) {
+ $loadingIndicator.fadeOut(phpbb.alertTime);
+ }
+ });
+ };
+
+ // If filter function returns false, cancel the AJAX functionality,
+ // and return true (meaning that the HTTP request will be sent normally).
+ if (runFilter && !options.filter.call(this, data, event, sendRequest)) {
+ return;
+ }
+
+ sendRequest();
+ event.preventDefault();
+ });
+
+ if (isForm) {
+ $elements.find('input:submit').click(function () {
+ var $this = $(this);
+
+ // Remove data-clicked attribute from any submit button of form
+ $this.parents('form:first').find('input:submit[data-clicked]').removeAttr('data-clicked');
+
+ $this.attr('data-clicked', 'true');
+ });
+ }
+
+ return this;
+};
+
+phpbb.search = {
+ cache: {
+ data: []
+ },
+ tpl: [],
+ container: []
+};
+
+/**
+ * Get cached search data.
+ *
+ * @param {string} id Search ID.
+ * @returns {bool|object} Cached data object. Returns false if no data exists.
+ */
+phpbb.search.cache.get = function(id) {
+ if (this.data[id]) {
+ return this.data[id];
+ }
+ return false;
+};
+
+/**
+ * Set search cache data value.
+ *
+ * @param {string} id Search ID.
+ * @param {string} key Data key.
+ * @param {string} value Data value.
+ */
+phpbb.search.cache.set = function(id, key, value) {
+ if (!this.data[id]) {
+ this.data[id] = { results: [] };
+ }
+ this.data[id][key] = value;
+};
+
+/**
+ * Cache search result.
+ *
+ * @param {string} id Search ID.
+ * @param {string} keyword Keyword.
+ * @param {Array} results Search results.
+ */
+phpbb.search.cache.setResults = function(id, keyword, results) {
+ this.data[id].results[keyword] = results;
+};
+
+/**
+ * Trim spaces from keyword and lower its case.
+ *
+ * @param {string} keyword Search keyword to clean.
+ * @returns {string} Cleaned string.
+ */
+phpbb.search.cleanKeyword = function(keyword) {
+ return $.trim(keyword).toLowerCase();
+};
+
+/**
+ * Get clean version of search keyword. If textarea supports several keywords
+ * (one per line), it fetches the current keyword based on the caret position.
+ *
+ * @param {jQuery} $input Search input|textarea.
+ * @param {string} keyword Input|textarea value.
+ * @param {bool} multiline Whether textarea supports multiple search keywords.
+ *
+ * @returns string Clean string.
+ */
+phpbb.search.getKeyword = function($input, keyword, multiline) {
+ if (multiline) {
+ var line = phpbb.search.getKeywordLine($input);
+ keyword = keyword.split('\n').splice(line, 1);
+ }
+ return phpbb.search.cleanKeyword(keyword);
+};
+
+/**
+ * Get the textarea line number on which the keyword resides - for textareas
+ * that support multiple keywords (one per line).
+ *
+ * @param {jQuery} $textarea Search textarea.
+ * @returns {int} The line number.
+ */
+phpbb.search.getKeywordLine = function ($textarea) {
+ var selectionStart = $textarea.get(0).selectionStart;
+ return $textarea.val().substr(0, selectionStart).split('\n').length - 1;
+};
+
+/**
+ * Set the value on the input|textarea. If textarea supports multiple
+ * keywords, only the active keyword is replaced.
+ *
+ * @param {jQuery} $input Search input|textarea.
+ * @param {string} value Value to set.
+ * @param {bool} multiline Whether textarea supports multiple search keywords.
+ */
+phpbb.search.setValue = function($input, value, multiline) {
+ if (multiline) {
+ var line = phpbb.search.getKeywordLine($input),
+ lines = $input.val().split('\n');
+ lines[line] = value;
+ value = lines.join('\n');
+ }
+ $input.val(value);
+};
+
+/**
+ * Sets the onclick event to set the value on the input|textarea to the
+ * selected search result.
+ *
+ * @param {jQuery} $input Search input|textarea.
+ * @param {object} value Result object.
+ * @param {jQuery} $row Result element.
+ * @param {jQuery} $container jQuery object for the search container.
+ */
+phpbb.search.setValueOnClick = function($input, value, $row, $container) {
+ $row.click(function() {
+ phpbb.search.setValue($input, value.result, $input.attr('data-multiline'));
+ $container.hide();
+ });
+};
+
+/**
+ * Runs before the AJAX search request is sent and determines whether
+ * there is a need to contact the server. If there are cached results
+ * already, those are displayed instead. Executes the AJAX request function
+ * itself due to the need to use a timeout to limit the number of requests.
+ *
+ * @param {Array} data Data to be sent to the server.
+ * @param {object} event Onkeyup event object.
+ * @param {function} sendRequest Function to execute AJAX request.
+ *
+ * @returns {bool} Returns false.
+ */
+phpbb.search.filter = function(data, event, sendRequest) {
+ var $this = $(this),
+ dataName = ($this.attr('data-name') !== undefined) ? $this.attr('data-name') : $this.attr('name'),
+ minLength = parseInt($this.attr('data-min-length'), 10),
+ searchID = $this.attr('data-results'),
+ keyword = phpbb.search.getKeyword($this, data[dataName], $this.attr('data-multiline')),
+ cache = phpbb.search.cache.get(searchID),
+ proceed = true;
+ data[dataName] = keyword;
+
+ if (cache.timeout) {
+ clearTimeout(cache.timeout);
+ }
+
+ var timeout = setTimeout(function() {
+ // Check min length and existence of cache.
+ if (minLength > keyword.length) {
+ proceed = false;
+ } else if (cache.lastSearch) {
+ // Has the keyword actually changed?
+ if (cache.lastSearch === keyword) {
+ proceed = false;
+ } else {
+ // Do we already have results for this?
+ if (cache.results[keyword]) {
+ var response = {
+ keyword: keyword,
+ results: cache.results[keyword]
+ };
+ phpbb.search.handleResponse(response, $this, true);
+ proceed = false;
+ }
+
+ // If the previous search didn't yield results and the string only had characters added to it,
+ // then we won't bother sending a request.
+ if (keyword.indexOf(cache.lastSearch) === 0 && cache.results[cache.lastSearch].length === 0) {
+ phpbb.search.cache.set(searchID, 'lastSearch', keyword);
+ phpbb.search.cache.setResults(searchID, keyword, []);
+ proceed = false;
+ }
+ }
+ }
+
+ if (proceed) {
+ sendRequest.call(this);
+ }
+ }, 350);
+ phpbb.search.cache.set(searchID, 'timeout', timeout);
+
+ return false;
+};
+
+/**
+ * Handle search result response.
+ *
+ * @param {object} res Data received from server.
+ * @param {jQuery} $input Search input|textarea.
+ * @param {bool} fromCache Whether the results are from the cache.
+ * @param {function} callback Optional callback to run when assigning each search result.
+ */
+phpbb.search.handleResponse = function(res, $input, fromCache, callback) {
+ if (typeof res !== 'object') {
+ return;
+ }
+
+ var searchID = $input.attr('data-results'),
+ $container = $(searchID);
+
+ if (this.cache.get(searchID).callback) {
+ callback = this.cache.get(searchID).callback;
+ } else if (typeof callback === 'function') {
+ this.cache.set(searchID, 'callback', callback);
+ }
+
+ if (!fromCache) {
+ this.cache.setResults(searchID, res.keyword, res.results);
+ }
+
+ this.cache.set(searchID, 'lastSearch', res.keyword);
+ this.showResults(res.results, $input, $container, callback);
+};
+
+/**
+ * Show search results.
+ *
+ * @param {Array} results Search results.
+ * @param {jQuery} $input Search input|textarea.
+ * @param {jQuery} $container Search results container element.
+ * @param {function} callback Optional callback to run when assigning each search result.
+ */
+phpbb.search.showResults = function(results, $input, $container, callback) {
+ var $resultContainer = $('.search-results', $container);
+ this.clearResults($resultContainer);
+
+ if (!results.length) {
+ $container.hide();
+ return;
+ }
+
+ var searchID = $container.attr('id'),
+ tpl,
+ row;
+
+ if (!this.tpl[searchID]) {
+ tpl = $('.search-result-tpl', $container);
+ this.tpl[searchID] = tpl.clone().removeClass('search-result-tpl');
+ tpl.remove();
+ }
+ tpl = this.tpl[searchID];
+
+ $.each(results, function(i, item) {
+ row = tpl.clone();
+ row.find('.search-result').html(item.display);
+
+ if (typeof callback === 'function') {
+ callback.call(this, $input, item, row, $container);
+ }
+ row.appendTo($resultContainer).show();
+ });
+ $container.show();
+};
+
+/**
+ * Clear search results.
+ *
+ * @param {jQuery} $container Search results container.
+ */
+phpbb.search.clearResults = function($container) {
+ $container.children(':not(.search-result-tpl)').remove();
+};
+
+$('#phpbb').click(function() {
+ var $this = $(this);
+
+ if (!$this.is('.live-search') && !$this.parents().is('.live-search')) {
+ $('.live-search').hide();
+ }
+});
+
+phpbb.history = {};
+
+/**
+* Check whether a method in the native history object is supported.
+*
+* @param {string} fn Method name.
+* @returns {bool} Returns true if the method is supported.
+*/
+phpbb.history.isSupported = function(fn) {
+ return !(typeof history === 'undefined' || typeof history[fn] === 'undefined');
+};
+
+/**
+* Wrapper for the pushState and replaceState methods of the
+* native history object.
+*
+* @param {string} mode Mode. Either push or replace.
+* @param {string} url New URL.
+* @param {string} [title] Optional page title.
+* @param {object} [obj] Optional state object.
+*/
+phpbb.history.alterUrl = function(mode, url, title, obj) {
+ var fn = mode + 'State';
+
+ if (!url || !phpbb.history.isSupported(fn)) {
+ return;
+ }
+ if (!title) {
+ title = document.title;
+ }
+ if (!obj) {
+ obj = null;
+ }
+
+ history[fn](obj, title, url);
+};
+
+/**
+* Wrapper for the native history.replaceState method.
+*
+* @param {string} url New URL.
+* @param {string} [title] Optional page title.
+* @param {object} [obj] Optional state object.
+*/
+phpbb.history.replaceUrl = function(url, title, obj) {
+ phpbb.history.alterUrl('replace', url, title, obj);
+};
+
+/**
+* Wrapper for the native history.pushState method.
+*
+* @param {string} url New URL.
+* @param {string} [title] Optional page title.
+* @param {object} [obj] Optional state object.
+*/
+phpbb.history.pushUrl = function(url, title, obj) {
+ phpbb.history.alterUrl('push', url, title, obj);
+};
+
+/**
+* Hide the optgroups that are not the selected timezone
+*
+* @param {bool} keepSelection Shall we keep the value selected, or shall the
+* user be forced to repick one.
+*/
+phpbb.timezoneSwitchDate = function(keepSelection) {
+ var $timezoneCopy = $('#timezone_copy');
+ var $timezone = $('#timezone');
+ var $tzDate = $('#tz_date');
+ var $tzSelectDateSuggest = $('#tz_select_date_suggest');
+
+ if ($timezoneCopy.length === 0) {
+ // We make a backup of the original dropdown, so we can remove optgroups
+ // instead of setting display to none, because IE and chrome will not
+ // hide options inside of optgroups and selects via css
+ $timezone.clone()
+ .attr('id', 'timezone_copy')
+ .css('display', 'none')
+ .attr('name', 'tz_copy')
+ .insertAfter('#timezone');
+ } else {
+ // Copy the content of our backup, so we can remove all unneeded options
+ $timezone.html($timezoneCopy.html());
+ }
+
+ if ($tzDate.val() !== '') {
+ $timezone.children('optgroup').remove(':not([data-tz-value="' + $tzDate.val() + '"])');
+ }
+
+ if ($tzDate.val() === $tzSelectDateSuggest.attr('data-suggested-tz')) {
+ $tzSelectDateSuggest.css('display', 'none');
+ } else {
+ $tzSelectDateSuggest.css('display', 'inline');
+ }
+
+ var $tzOptions = $timezone.children('optgroup[data-tz-value="' + $tzDate.val() + '"]').children('option');
+
+ if ($tzOptions.length === 1) {
+ // If there is only one timezone for the selected date, we just select that automatically.
+ $tzOptions.prop('selected', true);
+ keepSelection = true;
+ }
+
+ if (typeof keepSelection !== 'undefined' && !keepSelection) {
+ var $timezoneOptions = $timezone.find('optgroup option');
+ if ($timezoneOptions.filter(':selected').length <= 0) {
+ $timezoneOptions.filter(':first').prop('selected', true);
+ }
+ }
+};
+
+/**
+* Display the date/time select
+*/
+phpbb.timezoneEnableDateSelection = function() {
+ $('#tz_select_date').css('display', 'block');
+};
+
+/**
+* Preselect a date/time or suggest one, if it is not picked.
+*
+* @param {bool} forceSelector Shall we select the suggestion?
+*/
+phpbb.timezonePreselectSelect = function(forceSelector) {
+
+ // The offset returned here is in minutes and negated.
+ var offset = (new Date()).getTimezoneOffset();
+ var sign = '-';
+
+ if (offset < 0) {
+ sign = '+';
+ offset = -offset;
+ }
+
+ var minutes = offset % 60;
+ var hours = (offset - minutes) / 60;
+
+ if (hours < 10) {
+ hours = '0' + hours.toString();
+ } else {
+ hours = hours.toString();
+ }
+
+ if (minutes < 10) {
+ minutes = '0' + minutes.toString();
+ } else {
+ minutes = minutes.toString();
+ }
+
+ var prefix = 'UTC' + sign + hours + ':' + minutes;
+ var prefixLength = prefix.length;
+ var selectorOptions = $('option', '#tz_date');
+ var i;
+
+ var $tzSelectDateSuggest = $('#tz_select_date_suggest');
+
+ for (i = 0; i < selectorOptions.length; ++i) {
+ var option = selectorOptions[i];
+
+ if (option.value.substring(0, prefixLength) === prefix) {
+ if ($('#tz_date').val() !== option.value && !forceSelector) {
+ // We do not select the option for the user, but notify him,
+ // that we would suggest a different setting.
+ phpbb.timezoneSwitchDate(true);
+ $tzSelectDateSuggest.css('display', 'inline');
+ } else {
+ option.selected = true;
+ phpbb.timezoneSwitchDate(!forceSelector);
+ $tzSelectDateSuggest.css('display', 'none');
+ }
+
+ var suggestion = $tzSelectDateSuggest.attr('data-l-suggestion');
+
+ $tzSelectDateSuggest.attr('title', suggestion.replace('%s', option.innerHTML));
+ $tzSelectDateSuggest.attr('value', suggestion.replace('%s', option.innerHTML.substring(0, 9)));
+ $tzSelectDateSuggest.attr('data-suggested-tz', option.innerHTML);
+
+ // Found the suggestion, there cannot be more, so return from here.
+ return;
+ }
+ }
+};
+
+phpbb.ajaxCallbacks = {};
+
+/**
+ * Adds an AJAX callback to be used by phpbb.ajaxify.
+ *
+ * See the phpbb.ajaxify comments for information on stuff like parameters.
+ *
+ * @param {string} id The name of the callback.
+ * @param {function} callback The callback to be called.
+ */
+phpbb.addAjaxCallback = function(id, callback) {
+ if (typeof callback === 'function') {
+ phpbb.ajaxCallbacks[id] = callback;
+ }
+ return this;
+};
+
+/**
+ * This callback handles live member searches.
+ */
+phpbb.addAjaxCallback('member_search', function(res) {
+ phpbb.search.handleResponse(res, $(this), false, phpbb.getFunctionByName('phpbb.search.setValueOnClick'));
+});
+
+/**
+ * This callback alternates text - it replaces the current text with the text in
+ * the alt-text data attribute, and replaces the text in the attribute with the
+ * current text so that the process can be repeated.
+ */
+phpbb.addAjaxCallback('alt_text', function() {
+ var $anchor,
+ updateAll = $(this).data('update-all'),
+ altText;
+
+ if (updateAll !== undefined && updateAll.length) {
+ $anchor = $(updateAll);
+ } else {
+ $anchor = $(this);
+ }
+
+ $anchor.each(function() {
+ var $this = $(this);
+ altText = $this.attr('data-alt-text');
+ $this.attr('data-alt-text', $this.text());
+ $this.attr('title', $.trim(altText));
+ $this.text(altText);
+ });
+});
+
+/**
+ * This callback is based on the alt_text callback.
+ *
+ * It replaces the current text with the text in the alt-text data attribute,
+ * and replaces the text in the attribute with the current text so that the
+ * process can be repeated.
+ * Additionally it replaces the class of the link's parent
+ * and changes the link itself.
+ */
+phpbb.addAjaxCallback('toggle_link', function() {
+ var $anchor,
+ updateAll = $(this).data('update-all') ,
+ toggleText,
+ toggleUrl,
+ toggleClass;
+
+ if (updateAll !== undefined && updateAll.length) {
+ $anchor = $(updateAll);
+ } else {
+ $anchor = $(this);
+ }
+
+ $anchor.each(function() {
+ var $this = $(this);
+
+ // Toggle link text
+ toggleText = $this.attr('data-toggle-text');
+ $this.attr('data-toggle-text', $this.text());
+ $this.attr('title', $.trim(toggleText));
+ $this.text(toggleText);
+
+ // Toggle link url
+ toggleUrl = $this.attr('data-toggle-url');
+ $this.attr('data-toggle-url', $this.attr('href'));
+ $this.attr('href', toggleUrl);
+
+ // Toggle class of link parent
+ toggleClass = $this.attr('data-toggle-class');
+ $this.attr('data-toggle-class', $this.parent().attr('class'));
+ $this.parent().attr('class', toggleClass);
+ });
+});
+
+/**
+* Automatically resize textarea
+*
+* This function automatically resizes textarea elements when user
+* types text.
+*
+* @param {jQuery} $items jQuery object(s) to resize
+* @param {object} [options] Optional parameter that adjusts default
+* configuration. See configuration variable
+*
+* Optional parameters:
+* minWindowHeight {number} Minimum browser window height when textareas are resized. Default = 500
+* minHeight {number} Minimum height of textarea. Default = 200
+* maxHeight {number} Maximum height of textarea. Default = 500
+* heightDiff {number} Minimum difference between window and textarea height. Default = 200
+* resizeCallback {function} Function to call after resizing textarea
+* resetCallback {function} Function to call when resize has been canceled
+
+* Callback function format: function(item) {}
+* this points to DOM object
+* item is a jQuery object, same as this
+*/
+phpbb.resizeTextArea = function($items, options) {
+ // Configuration
+ var configuration = {
+ minWindowHeight: 500,
+ minHeight: 200,
+ maxHeight: 500,
+ heightDiff: 200,
+ resizeCallback: function() {},
+ resetCallback: function() {}
+ };
+
+ if (phpbb.isTouch) {
+ return;
+ }
+
+ if (arguments.length > 1) {
+ configuration = $.extend(configuration, options);
+ }
+
+ function resetAutoResize(item) {
+ var $item = $(item);
+ if ($item.hasClass('auto-resized')) {
+ $(item)
+ .css({ height: '', resize: '' })
+ .removeClass('auto-resized');
+ configuration.resetCallback.call(item, $item);
+ }
+ }
+
+ function autoResize(item) {
+ function setHeight(height) {
+ height += parseInt($item.css('height'), 10) - $item.innerHeight();
+ $item
+ .css({ height: height + 'px', resize: 'none' })
+ .addClass('auto-resized');
+ configuration.resizeCallback.call(item, $item);
+ }
+
+ var windowHeight = $(window).height();
+
+ if (windowHeight < configuration.minWindowHeight) {
+ resetAutoResize(item);
+ return;
+ }
+
+ var maxHeight = Math.min(
+ Math.max(windowHeight - configuration.heightDiff, configuration.minHeight),
+ configuration.maxHeight
+ ),
+ $item = $(item),
+ height = parseInt($item.innerHeight(), 10),
+ scrollHeight = (item.scrollHeight) ? item.scrollHeight : 0;
+
+ if (height < 0) {
+ return;
+ }
+
+ if (height > maxHeight) {
+ setHeight(maxHeight);
+ } else if (scrollHeight > (height + 5)) {
+ setHeight(Math.min(maxHeight, scrollHeight));
+ }
+ }
+
+ $items.on('focus change keyup', function() {
+ $(this).each(function() {
+ autoResize(this);
+ });
+ }).change();
+
+ $(window).resize(function() {
+ $items.each(function() {
+ if ($(this).hasClass('auto-resized')) {
+ autoResize(this);
+ }
+ });
+ });
+};
+
+/**
+* Check if cursor in textarea is currently inside a bbcode tag
+*
+* @param {object} textarea Textarea DOM object
+* @param {Array} startTags List of start tags to look for
+* For example, Array('[code]', '[code=')
+* @param {Array} endTags List of end tags to look for
+* For example, Array('[/code]')
+*
+* @returns {boolean} True if cursor is in bbcode tag
+*/
+phpbb.inBBCodeTag = function(textarea, startTags, endTags) {
+ var start = textarea.selectionStart,
+ lastEnd = -1,
+ lastStart = -1,
+ i, index, value;
+
+ if (typeof start !== 'number') {
+ return false;
+ }
+
+ value = textarea.value.toLowerCase();
+
+ for (i = 0; i < startTags.length; i++) {
+ var tagLength = startTags[i].length;
+ if (start >= tagLength) {
+ index = value.lastIndexOf(startTags[i], start - tagLength);
+ lastStart = Math.max(lastStart, index);
+ }
+ }
+ if (lastStart === -1) {
+ return false;
+ }
+
+ if (start > 0) {
+ for (i = 0; i < endTags.length; i++) {
+ index = value.lastIndexOf(endTags[i], start - 1);
+ lastEnd = Math.max(lastEnd, index);
+ }
+ }
+
+ return (lastEnd < lastStart);
+};
+
+
+/**
+* Adjust textarea to manage code bbcode
+*
+* This function allows to use tab characters when typing code
+* and keeps indentation of previous line of code when adding new
+* line while typing code.
+*
+* Editor's functionality is changed only when cursor is between
+* [code] and [/code] bbcode tags.
+*
+* @param {object} textarea Textarea DOM object to apply editor to
+*/
+phpbb.applyCodeEditor = function(textarea) {
+ // list of allowed start and end bbcode code tags, in lower case
+ var startTags = ['[code]', '[code='],
+ startTagsEnd = ']',
+ endTags = ['[/code]'];
+
+ if (!textarea || typeof textarea.selectionStart !== 'number') {
+ return;
+ }
+
+ if ($(textarea).data('code-editor') === true) {
+ return;
+ }
+
+ function inTag() {
+ return phpbb.inBBCodeTag(textarea, startTags, endTags);
+ }
+
+ /**
+ * Get line of text before cursor
+ *
+ * @param {boolean} stripCodeStart If true, only part of line
+ * after [code] tag will be returned.
+ *
+ * @returns {string} Line of text
+ */
+ function getLastLine(stripCodeStart) {
+ var start = textarea.selectionStart,
+ value = textarea.value,
+ index = value.lastIndexOf('\n', start - 1);
+
+ value = value.substring(index + 1, start);
+
+ if (stripCodeStart) {
+ for (var i = 0; i < startTags.length; i++) {
+ index = value.lastIndexOf(startTags[i]);
+ if (index >= 0) {
+ var tagLength = startTags[i].length;
+
+ value = value.substring(index + tagLength);
+ if (startTags[i].lastIndexOf(startTagsEnd) !== tagLength) {
+ index = value.indexOf(startTagsEnd);
+
+ if (index >= 0) {
+ value = value.substr(index + 1);
+ }
+ }
+ }
+ }
+ }
+
+ return value;
+ }
+
+ /**
+ * Append text at cursor position
+ *
+ * @param {string} text Text to append
+ */
+ function appendText(text) {
+ var start = textarea.selectionStart,
+ end = textarea.selectionEnd,
+ value = textarea.value;
+
+ textarea.value = value.substr(0, start) + text + value.substr(end);
+ textarea.selectionStart = textarea.selectionEnd = start + text.length;
+ }
+
+ $(textarea).data('code-editor', true).on('keydown', function(event) {
+ var key = event.keyCode || event.which;
+
+ // intercept tabs
+ if (key === keymap.TAB &&
+ !event.ctrlKey &&
+ !event.shiftKey &&
+ !event.altKey &&
+ !event.metaKey) {
+ if (inTag()) {
+ appendText('\t');
+ event.preventDefault();
+ return;
+ }
+ }
+
+ // intercept new line characters
+ if (key === keymap.ENTER) {
+ if (inTag()) {
+ var lastLine = getLastLine(true),
+ code = '' + /^\s*/g.exec(lastLine);
+
+ if (code.length > 0) {
+ appendText('\n' + code);
+ event.preventDefault();
+ }
+ }
+ }
+ });
+};
+
+/**
+ * Show drag and drop animation when textarea is present
+ *
+ * This function will enable the drag and drop animation for a specified
+ * textarea.
+ *
+ * @param {HTMLElement} textarea Textarea DOM object to apply editor to
+ */
+phpbb.showDragNDrop = function(textarea) {
+ if (!textarea) {
+ return;
+ }
+
+ $('body').on('dragenter dragover', function () {
+ $(textarea).addClass('drag-n-drop');
+ }).on('dragleave dragout dragend drop', function() {
+ $(textarea).removeClass('drag-n-drop');
+ });
+ $(textarea).on('dragenter dragover', function () {
+ $(textarea).addClass('drag-n-drop-highlight');
+ }).on('dragleave dragout dragend drop', function() {
+ $(textarea).removeClass('drag-n-drop-highlight');
+ });
+};
+
+/**
+* List of classes that toggle dropdown menu,
+* list of classes that contain visible dropdown menu
+*
+* Add your own classes to strings with comma (probably you
+* will never need to do that)
+*/
+phpbb.dropdownHandles = '.dropdown-container.dropdown-visible .dropdown-toggle';
+phpbb.dropdownVisibleContainers = '.dropdown-container.dropdown-visible';
+
+/**
+* Dropdown toggle event handler
+* This handler is used by phpBB.registerDropdown() and other functions
+*/
+phpbb.toggleDropdown = function() {
+ var $this = $(this),
+ options = $this.data('dropdown-options'),
+ parent = options.parent,
+ visible = parent.hasClass('dropdown-visible'),
+ direction;
+
+ if (!visible) {
+ // Hide other dropdown menus
+ $(phpbb.dropdownHandles).each(phpbb.toggleDropdown);
+
+ // Figure out direction of dropdown
+ direction = options.direction;
+ var verticalDirection = options.verticalDirection,
+ offset = $this.offset();
+
+ if (direction === 'auto') {
+ if (($(window).width() - $this.outerWidth(true)) / 2 > offset.left) {
+ direction = 'right';
+ } else {
+ direction = 'left';
+ }
+ }
+ parent.toggleClass(options.leftClass, direction === 'left')
+ .toggleClass(options.rightClass, direction === 'right');
+
+ if (verticalDirection === 'auto') {
+ var height = $(window).height(),
+ top = offset.top - $(window).scrollTop();
+
+ verticalDirection = (top < height * 0.7) ? 'down' : 'up';
+ }
+ parent.toggleClass(options.upClass, verticalDirection === 'up')
+ .toggleClass(options.downClass, verticalDirection === 'down');
+ }
+
+ options.dropdown.toggle();
+ parent.toggleClass(options.visibleClass, !visible)
+ .toggleClass('dropdown-visible', !visible);
+
+ // Check dimensions when showing dropdown
+ // !visible because variable shows state of dropdown before it was toggled
+ if (!visible) {
+ var windowWidth = $(window).width();
+
+ options.dropdown.find('.dropdown-contents').each(function() {
+ var $this = $(this);
+
+ $this.css({
+ marginLeft: 0,
+ left: 0,
+ maxWidth: (windowWidth - 4) + 'px'
+ });
+
+ var offset = $this.offset().left,
+ width = $this.outerWidth(true);
+
+ if (offset < 2) {
+ $this.css('left', (2 - offset) + 'px');
+ } else if ((offset + width + 2) > windowWidth) {
+ $this.css('margin-left', (windowWidth - offset - width - 2) + 'px');
+ }
+
+ // Check whether the vertical scrollbar is present.
+ $this.toggleClass('dropdown-nonscroll', this.scrollHeight === $this.innerHeight());
+
+ });
+ var freeSpace = parent.offset().left - 4;
+
+ if (direction === 'left') {
+ options.dropdown.css('margin-left', '-' + freeSpace + 'px');
+
+ // Try to position the notification dropdown correctly in RTL-responsive mode
+ if (options.dropdown.hasClass('dropdown-extended')) {
+ var contentWidth,
+ fullFreeSpace = freeSpace + parent.outerWidth();
+
+ options.dropdown.find('.dropdown-contents').each(function() {
+ contentWidth = parseInt($(this).outerWidth(), 10);
+ $(this).css({ marginLeft: 0, left: 0 });
+ });
+
+ var maxOffset = Math.min(contentWidth, fullFreeSpace) + 'px';
+ options.dropdown.css({
+ width: maxOffset,
+ marginLeft: -maxOffset
+ });
+ }
+ } else {
+ options.dropdown.css('margin-right', '-' + (windowWidth + freeSpace) + 'px');
+ }
+ }
+
+ // Prevent event propagation
+ if (arguments.length > 0) {
+ try {
+ var e = arguments[0];
+ e.preventDefault();
+ e.stopPropagation();
+ } catch (error) { }
+ }
+ return false;
+};
+
+/**
+* Toggle dropdown submenu
+*/
+phpbb.toggleSubmenu = function(e) {
+ $(this).siblings('.dropdown-submenu').toggle();
+ e.preventDefault();
+};
+
+/**
+* Register dropdown menu
+* Shows/hides dropdown, decides which side to open to
+*
+* @param {jQuery} toggle Link that toggles dropdown.
+* @param {jQuery} dropdown Dropdown menu.
+* @param {Object} options List of options. Optional.
+*/
+phpbb.registerDropdown = function(toggle, dropdown, options) {
+ var ops = {
+ parent: toggle.parent(), // Parent item to add classes to
+ direction: 'auto', // Direction of dropdown menu. Possible values: auto, left, right
+ verticalDirection: 'auto', // Vertical direction. Possible values: auto, up, down
+ visibleClass: 'visible', // Class to add to parent item when dropdown is visible
+ leftClass: 'dropdown-left', // Class to add to parent item when dropdown opens to left side
+ rightClass: 'dropdown-right', // Class to add to parent item when dropdown opens to right side
+ upClass: 'dropdown-up', // Class to add to parent item when dropdown opens above menu item
+ downClass: 'dropdown-down' // Class to add to parent item when dropdown opens below menu item
+ };
+ if (options) {
+ ops = $.extend(ops, options);
+ }
+ ops.dropdown = dropdown;
+
+ ops.parent.addClass('dropdown-container');
+ toggle.addClass('dropdown-toggle');
+
+ toggle.data('dropdown-options', ops);
+
+ toggle.click(phpbb.toggleDropdown);
+ $('.dropdown-toggle-submenu', ops.parent).click(phpbb.toggleSubmenu);
+};
+
+/**
+* Get the HTML for a color palette table.
+*
+* @param {string} dir Palette direction - either v or h
+* @param {int} width Palette cell width.
+* @param {int} height Palette cell height.
+*/
+phpbb.colorPalette = function(dir, width, height) {
+ var r, g, b,
+ numberList = new Array(6),
+ color = '',
+ html = '';
+
+ numberList[0] = '00';
+ numberList[1] = '40';
+ numberList[2] = '80';
+ numberList[3] = 'BF';
+ numberList[4] = 'FF';
+
+ var tableClass = (dir === 'h') ? 'horizontal-palette' : 'vertical-palette';
+ html += '<table class="not-responsive colour-palette ' + tableClass + '" style="width: auto;">';
+
+ for (r = 0; r < 5; r++) {
+ if (dir === 'h') {
+ html += '<tr>';
+ }
+
+ for (g = 0; g < 5; g++) {
+ if (dir === 'v') {
+ html += '<tr>';
+ }
+
+ for (b = 0; b < 5; b++) {
+ color = '' + numberList[r] + numberList[g] + numberList[b];
+ html += '<td style="background-color: #' + color + '; width: ' + width + 'px; height: ' +
+ height + 'px;"><a href="#" data-color="' + color + '" style="display: block; width: ' +
+ width + 'px; height: ' + height + 'px; " alt="#' + color + '" title="#' + color + '"></a>';
+ html += '</td>';
+ }
+
+ if (dir === 'v') {
+ html += '</tr>';
+ }
+ }
+
+ if (dir === 'h') {
+ html += '</tr>';
+ }
+ }
+ html += '</table>';
+ return html;
+};
+
+/**
+* Register a color palette.
+*
+* @param {jQuery} el jQuery object for the palette container.
+*/
+phpbb.registerPalette = function(el) {
+ var orientation = el.attr('data-orientation'),
+ height = el.attr('data-height'),
+ width = el.attr('data-width'),
+ target = el.attr('data-target'),
+ bbcode = el.attr('data-bbcode');
+
+ // Insert the palette HTML into the container.
+ el.html(phpbb.colorPalette(orientation, width, height));
+
+ // Add toggle control.
+ $('#color_palette_toggle').click(function(e) {
+ el.toggle();
+ e.preventDefault();
+ });
+
+ // Attach event handler when a palette cell is clicked.
+ $(el).on('click', 'a', function(e) {
+ var color = $(this).attr('data-color');
+
+ if (bbcode) {
+ bbfontstyle('[color=#' + color + ']', '[/color]');
+ } else {
+ $(target).val(color);
+ }
+ e.preventDefault();
+ });
+};
+
+/**
+* Set display of page element
+*
+* @param {string} id The ID of the element to change
+* @param {int} action Set to 0 if element display should be toggled, -1 for
+* hiding the element, and 1 for showing it.
+* @param {string} type Display type that should be used, e.g. inline, block or
+* other CSS "display" types
+*/
+phpbb.toggleDisplay = function(id, action, type) {
+ if (!type) {
+ type = 'block';
+ }
+
+ var $element = $('#' + id);
+
+ var display = $element.css('display');
+ if (!action) {
+ action = (display === '' || display === type) ? -1 : 1;
+ }
+ $element.css('display', ((action === 1) ? type : 'none'));
+};
+
+/**
+* Toggle additional settings based on the selected
+* option of select element.
+*
+* @param {jQuery} el jQuery select element object.
+*/
+phpbb.toggleSelectSettings = function(el) {
+ el.children().each(function() {
+ var $this = $(this),
+ $setting = $($this.data('toggle-setting'));
+ $setting.toggle($this.is(':selected'));
+
+ // Disable any input elements that are not visible right now
+ if ($this.is(':selected')) {
+ $($this.data('toggle-setting') + ' input').prop('disabled', false);
+ } else {
+ $($this.data('toggle-setting') + ' input').prop('disabled', true);
+ }
+ });
+};
+
+/**
+* Get function from name.
+* Based on http://stackoverflow.com/a/359910
+*
+* @param {string} functionName Function to get.
+* @returns function
+*/
+phpbb.getFunctionByName = function (functionName) {
+ var namespaces = functionName.split('.'),
+ func = namespaces.pop(),
+ context = window;
+
+ for (var i = 0; i < namespaces.length; i++) {
+ context = context[namespaces[i]];
+ }
+ return context[func];
+};
+
+/**
+* Register page dropdowns.
+*/
+phpbb.registerPageDropdowns = function() {
+ var $body = $('body');
+
+ $body.find('.dropdown-container').each(function() {
+ var $this = $(this),
+ $trigger = $this.find('.dropdown-trigger:first'),
+ $contents = $this.find('.dropdown'),
+ options = {
+ direction: 'auto',
+ verticalDirection: 'auto'
+ },
+ data;
+
+ if (!$trigger.length) {
+ data = $this.attr('data-dropdown-trigger');
+ $trigger = data ? $this.children(data) : $this.children('a:first');
+ }
+
+ if (!$contents.length) {
+ data = $this.attr('data-dropdown-contents');
+ $contents = data ? $this.children(data) : $this.children('div:first');
+ }
+
+ if (!$trigger.length || !$contents.length) {
+ return;
+ }
+
+ if ($this.hasClass('dropdown-up')) {
+ options.verticalDirection = 'up';
+ }
+ if ($this.hasClass('dropdown-down')) {
+ options.verticalDirection = 'down';
+ }
+ if ($this.hasClass('dropdown-left')) {
+ options.direction = 'left';
+ }
+ if ($this.hasClass('dropdown-right')) {
+ options.direction = 'right';
+ }
+
+ phpbb.registerDropdown($trigger, $contents, options);
+ });
+
+ // Hide active dropdowns when click event happens outside
+ $body.click(function(e) {
+ var $parents = $(e.target).parents();
+ if (!$parents.is(phpbb.dropdownVisibleContainers)) {
+ $(phpbb.dropdownHandles).each(phpbb.toggleDropdown);
+ }
+ });
+};
+
+/**
+ * Handle avatars to be lazy loaded.
+ */
+phpbb.lazyLoadAvatars = function loadAvatars() {
+ $('.avatar[data-src]').each(function () {
+ var $avatar = $(this);
+
+ $avatar
+ .attr('src', $avatar.data('src'))
+ .removeAttr('data-src');
+ });
+};
+
+$(window).load(phpbb.lazyLoadAvatars);
+
+/**
+* Apply code editor to all textarea elements with data-bbcode attribute
+*/
+$(function() {
+ $('textarea[data-bbcode]').each(function() {
+ phpbb.applyCodeEditor(this);
+ });
+
+ phpbb.registerPageDropdowns();
+
+ $('#color_palette_placeholder').each(function() {
+ phpbb.registerPalette($(this));
+ });
+
+ // Update browser history URL to point to specific post in viewtopic.php
+ // when using view=unread#unread link.
+ phpbb.history.replaceUrl($('#unread[data-url]').data('url'));
+
+ // Hide settings that are not selected via select element.
+ $('select[data-togglable-settings]').each(function() {
+ var $this = $(this);
+
+ $this.change(function() {
+ phpbb.toggleSelectSettings($this);
+ });
+ phpbb.toggleSelectSettings($this);
+ });
+});
+
+})(jQuery); // Avoid conflicts with other libraries
diff --git a/phpBB/assets/javascript/editor.js b/phpBB/assets/javascript/editor.js
new file mode 100644
index 0000000000..3abf5c84f4
--- /dev/null
+++ b/phpBB/assets/javascript/editor.js
@@ -0,0 +1,369 @@
+/**
+* bbCode control by subBlue design [ www.subBlue.com ]
+* Includes unixsafe colour palette selector by SHS`
+*/
+
+// Startup variables
+var imageTag = false;
+var theSelection = false;
+var bbcodeEnabled = true;
+
+// Check for Browser & Platform for PC & IE specific bits
+// More details from: http://www.mozilla.org/docs/web-developer/sniffer/browser_type.html
+var clientPC = navigator.userAgent.toLowerCase(); // Get client info
+var clientVer = parseInt(navigator.appVersion, 10); // Get browser version
+
+var is_ie = ((clientPC.indexOf('msie') !== -1) && (clientPC.indexOf('opera') === -1));
+var is_win = ((clientPC.indexOf('win') !== -1) || (clientPC.indexOf('16bit') !== -1));
+var baseHeight;
+
+/**
+* Shows the help messages in the helpline window
+*/
+function helpline(help) {
+ document.forms[form_name].helpbox.value = help_line[help];
+}
+
+/**
+* Fix a bug involving the TextRange object. From
+* http://www.frostjedi.com/terra/scripts/demo/caretBug.html
+*/
+function initInsertions() {
+ var doc;
+
+ if (document.forms[form_name]) {
+ doc = document;
+ } else {
+ doc = opener.document;
+ }
+
+ var textarea = doc.forms[form_name].elements[text_name];
+
+ if (is_ie && typeof(baseHeight) !== 'number') {
+ textarea.focus();
+ baseHeight = doc.selection.createRange().duplicate().boundingHeight;
+
+ if (!document.forms[form_name]) {
+ document.body.focus();
+ }
+ }
+}
+
+/**
+* bbstyle
+*/
+function bbstyle(bbnumber) {
+ if (bbnumber !== -1) {
+ bbfontstyle(bbtags[bbnumber], bbtags[bbnumber+1]);
+ } else {
+ insert_text('[*]');
+ document.forms[form_name].elements[text_name].focus();
+ }
+}
+
+/**
+* Apply bbcodes
+*/
+function bbfontstyle(bbopen, bbclose) {
+ theSelection = false;
+
+ var textarea = document.forms[form_name].elements[text_name];
+
+ textarea.focus();
+
+ if ((clientVer >= 4) && is_ie && is_win) {
+ // Get text selection
+ theSelection = document.selection.createRange().text;
+
+ if (theSelection) {
+ // Add tags around selection
+ document.selection.createRange().text = bbopen + theSelection + bbclose;
+ textarea.focus();
+ theSelection = '';
+ return;
+ }
+ } else if (textarea.selectionEnd && (textarea.selectionEnd - textarea.selectionStart > 0)) {
+ mozWrap(textarea, bbopen, bbclose);
+ textarea.focus();
+ theSelection = '';
+ return;
+ }
+
+ //The new position for the cursor after adding the bbcode
+ var caret_pos = getCaretPosition(textarea).start;
+ var new_pos = caret_pos + bbopen.length;
+
+ // Open tag
+ insert_text(bbopen + bbclose);
+
+ // Center the cursor when we don't have a selection
+ // Gecko and proper browsers
+ if (!isNaN(textarea.selectionStart)) {
+ textarea.selectionStart = new_pos;
+ textarea.selectionEnd = new_pos;
+ }
+ // IE
+ else if (document.selection) {
+ var range = textarea.createTextRange();
+ range.move("character", new_pos);
+ range.select();
+ storeCaret(textarea);
+ }
+
+ textarea.focus();
+ return;
+}
+
+/**
+* Insert text at position
+*/
+function insert_text(text, spaces, popup) {
+ var textarea;
+
+ if (!popup) {
+ textarea = document.forms[form_name].elements[text_name];
+ } else {
+ textarea = opener.document.forms[form_name].elements[text_name];
+ }
+
+ if (spaces) {
+ text = ' ' + text + ' ';
+ }
+
+ // Since IE9, IE also has textarea.selectionStart, but it still needs to be treated the old way.
+ // Therefore we simply add a !is_ie here until IE fixes the text-selection completely.
+ if (!isNaN(textarea.selectionStart) && !is_ie) {
+ var sel_start = textarea.selectionStart;
+ var sel_end = textarea.selectionEnd;
+
+ mozWrap(textarea, text, '');
+ textarea.selectionStart = sel_start + text.length;
+ textarea.selectionEnd = sel_end + text.length;
+ } else if (textarea.createTextRange && textarea.caretPos) {
+ if (baseHeight !== textarea.caretPos.boundingHeight) {
+ textarea.focus();
+ storeCaret(textarea);
+ }
+
+ var caret_pos = textarea.caretPos;
+ caret_pos.text = caret_pos.text.charAt(caret_pos.text.length - 1) === ' ' ? caret_pos.text + text + ' ' : caret_pos.text + text;
+ } else {
+ textarea.value = textarea.value + text;
+ }
+
+ if (!popup) {
+ textarea.focus();
+ }
+}
+
+/**
+* Add inline attachment at position
+*/
+function attachInline(index, filename) {
+ insert_text('[attachment=' + index + ']' + filename + '[/attachment]');
+ document.forms[form_name].elements[text_name].focus();
+}
+
+/**
+* Add quote text to message
+*/
+function addquote(post_id, username, l_wrote) {
+ var message_name = 'message_' + post_id;
+ var theSelection = '';
+ var divarea = false;
+ var i;
+
+ if (l_wrote === undefined) {
+ // Backwards compatibility
+ l_wrote = 'wrote';
+ }
+
+ if (document.all) {
+ divarea = document.all[message_name];
+ } else {
+ divarea = document.getElementById(message_name);
+ }
+
+ // Get text selection - not only the post content :(
+ // IE9 must use the document.selection method but has the *.getSelection so we just force no IE
+ if (window.getSelection && !is_ie && !window.opera) {
+ theSelection = window.getSelection().toString();
+ } else if (document.getSelection && !is_ie) {
+ theSelection = document.getSelection();
+ } else if (document.selection) {
+ theSelection = document.selection.createRange().text;
+ }
+
+ if (theSelection === '' || typeof theSelection === 'undefined' || theSelection === null) {
+ if (divarea.innerHTML) {
+ theSelection = divarea.innerHTML.replace(/<br>/ig, '\n');
+ theSelection = theSelection.replace(/<br\/>/ig, '\n');
+ theSelection = theSelection.replace(/&lt\;/ig, '<');
+ theSelection = theSelection.replace(/&gt\;/ig, '>');
+ theSelection = theSelection.replace(/&amp\;/ig, '&');
+ theSelection = theSelection.replace(/&nbsp\;/ig, ' ');
+ } else if (document.all) {
+ theSelection = divarea.innerText;
+ } else if (divarea.textContent) {
+ theSelection = divarea.textContent;
+ } else if (divarea.firstChild.nodeValue) {
+ theSelection = divarea.firstChild.nodeValue;
+ }
+ }
+
+ if (theSelection) {
+ if (bbcodeEnabled) {
+ insert_text('[quote="' + username + '"]' + theSelection + '[/quote]');
+ } else {
+ insert_text(username + ' ' + l_wrote + ':' + '\n');
+ var lines = split_lines(theSelection);
+ for (i = 0; i < lines.length; i++) {
+ insert_text('> ' + lines[i] + '\n');
+ }
+ }
+ }
+
+ return;
+}
+
+function split_lines(text) {
+ var lines = text.split('\n');
+ var splitLines = new Array();
+ var j = 0;
+ var i;
+
+ for(i = 0; i < lines.length; i++) {
+ if (lines[i].length <= 80) {
+ splitLines[j] = lines[i];
+ j++;
+ } else {
+ var line = lines[i];
+ var splitAt;
+ do {
+ splitAt = line.indexOf(' ', 80);
+
+ if (splitAt === -1) {
+ splitLines[j] = line;
+ j++;
+ } else {
+ splitLines[j] = line.substring(0, splitAt);
+ line = line.substring(splitAt);
+ j++;
+ }
+ }
+ while(splitAt !== -1);
+ }
+ }
+ return splitLines;
+}
+
+/**
+* From http://www.massless.org/mozedit/
+*/
+function mozWrap(txtarea, open, close) {
+ var selLength = (typeof(txtarea.textLength) === 'undefined') ? txtarea.value.length : txtarea.textLength;
+ var selStart = txtarea.selectionStart;
+ var selEnd = txtarea.selectionEnd;
+ var scrollTop = txtarea.scrollTop;
+
+ var s1 = (txtarea.value).substring(0,selStart);
+ var s2 = (txtarea.value).substring(selStart, selEnd);
+ var s3 = (txtarea.value).substring(selEnd, selLength);
+
+ txtarea.value = s1 + open + s2 + close + s3;
+ txtarea.selectionStart = selStart + open.length;
+ txtarea.selectionEnd = selEnd + open.length;
+ txtarea.focus();
+ txtarea.scrollTop = scrollTop;
+
+ return;
+}
+
+/**
+* Insert at Caret position. Code from
+* http://www.faqts.com/knowledge_base/view.phtml/aid/1052/fid/130
+*/
+function storeCaret(textEl) {
+ if (textEl.createTextRange && document.selection) {
+ textEl.caretPos = document.selection.createRange().duplicate();
+ }
+}
+
+/**
+* Caret Position object
+*/
+function caretPosition() {
+ var start = null;
+ var end = null;
+}
+
+/**
+* Get the caret position in an textarea
+*/
+function getCaretPosition(txtarea) {
+ var caretPos = new caretPosition();
+
+ // simple Gecko/Opera way
+ if (txtarea.selectionStart || txtarea.selectionStart === 0) {
+ caretPos.start = txtarea.selectionStart;
+ caretPos.end = txtarea.selectionEnd;
+ }
+ // dirty and slow IE way
+ else if (document.selection) {
+ // get current selection
+ var range = document.selection.createRange();
+
+ // a new selection of the whole textarea
+ var range_all = document.body.createTextRange();
+ range_all.moveToElementText(txtarea);
+
+ // calculate selection start point by moving beginning of range_all to beginning of range
+ var sel_start;
+ for (sel_start = 0; range_all.compareEndPoints('StartToStart', range) < 0; sel_start++) {
+ range_all.moveStart('character', 1);
+ }
+
+ txtarea.sel_start = sel_start;
+
+ // we ignore the end value for IE, this is already dirty enough and we don't need it
+ caretPos.start = txtarea.sel_start;
+ caretPos.end = txtarea.sel_start;
+ }
+
+ return caretPos;
+}
+
+/**
+* Allow to use tab character when typing code
+* Keep indentation of last line of code when typing code
+*/
+(function($) {
+ $(document).ready(function() {
+ var doc, textarea;
+
+ // find textarea, make sure browser supports necessary functions
+ if (document.forms[form_name]) {
+ doc = document;
+ } else {
+ doc = opener.document;
+ }
+
+ if (!doc.forms[form_name]) {
+ return;
+ }
+
+ textarea = doc.forms[form_name].elements[text_name];
+
+ phpbb.applyCodeEditor(textarea);
+ if ($('#attach-panel').length) {
+ phpbb.showDragNDrop(textarea);
+ }
+
+ $('textarea').on('keydown', function (e) {
+ if (e.which === 13 && (e.metaKey || e.ctrlKey)) {
+ $(this).closest('form').submit();
+ }
+ });
+ });
+})(jQuery);
+
diff --git a/phpBB/assets/javascript/jquery.min.js b/phpBB/assets/javascript/jquery.min.js
new file mode 100644
index 0000000000..73f33fb3aa
--- /dev/null
+++ b/phpBB/assets/javascript/jquery.min.js
@@ -0,0 +1,4 @@
+/*! jQuery v1.11.0 | (c) 2005, 2014 jQuery Foundation, Inc. | jquery.org/license */
+!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k="".trim,l={},m="1.11.0",n=function(a,b){return new n.fn.init(a,b)},o=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};n.fn=n.prototype={jquery:m,constructor:n,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return n.each(this,a,b)},map:function(a){return this.pushStack(n.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:c.sort,splice:c.splice},n.extend=n.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||n.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(e=arguments[h]))for(d in e)a=g[d],c=e[d],g!==c&&(j&&c&&(n.isPlainObject(c)||(b=n.isArray(c)))?(b?(b=!1,f=a&&n.isArray(a)?a:[]):f=a&&n.isPlainObject(a)?a:{},g[d]=n.extend(j,f,c)):void 0!==c&&(g[d]=c));return g},n.extend({expando:"jQuery"+(m+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===n.type(a)},isArray:Array.isArray||function(a){return"array"===n.type(a)},isWindow:function(a){return null!=a&&a==a.window},isNumeric:function(a){return a-parseFloat(a)>=0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},isPlainObject:function(a){var b;if(!a||"object"!==n.type(a)||a.nodeType||n.isWindow(a))return!1;try{if(a.constructor&&!j.call(a,"constructor")&&!j.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}if(l.ownLast)for(b in a)return j.call(a,b);for(b in a);return void 0===b||j.call(a,b)},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?h[i.call(a)]||"object":typeof a},globalEval:function(b){b&&n.trim(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(p,"ms-").replace(q,r)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,c){var d,e=0,f=a.length,g=s(a);if(c){if(g){for(;f>e;e++)if(d=b.apply(a[e],c),d===!1)break}else for(e in a)if(d=b.apply(a[e],c),d===!1)break}else if(g){for(;f>e;e++)if(d=b.call(a[e],e,a[e]),d===!1)break}else for(e in a)if(d=b.call(a[e],e,a[e]),d===!1)break;return a},trim:k&&!k.call("\ufeff\xa0")?function(a){return null==a?"":k.call(a)}:function(a){return null==a?"":(a+"").replace(o,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(s(Object(a))?n.merge(c,"string"==typeof a?[a]:a):f.call(c,a)),c},inArray:function(a,b,c){var d;if(b){if(g)return g.call(b,a,c);for(d=b.length,c=c?0>c?Math.max(0,d+c):c:0;d>c;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,b){var c=+b.length,d=0,e=a.length;while(c>d)a[e++]=b[d++];if(c!==c)while(void 0!==b[d])a[e++]=b[d++];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,f=0,g=a.length,h=s(a),i=[];if(h)for(;g>f;f++)d=b(a[f],f,c),null!=d&&i.push(d);else for(f in a)d=b(a[f],f,c),null!=d&&i.push(d);return e.apply([],i)},guid:1,proxy:function(a,b){var c,e,f;return"string"==typeof b&&(f=a[b],b=a,a=f),n.isFunction(a)?(c=d.call(arguments,2),e=function(){return a.apply(b||this,c.concat(d.call(arguments)))},e.guid=a.guid=a.guid||n.guid++,e):void 0},now:function(){return+new Date},support:l}),n.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){h["[object "+b+"]"]=b.toLowerCase()});function s(a){var b=a.length,c=n.type(a);return"function"===c||n.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var t=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s="sizzle"+-new Date,t=a.document,u=0,v=0,w=eb(),x=eb(),y=eb(),z=function(a,b){return a===b&&(j=!0),0},A="undefined",B=1<<31,C={}.hasOwnProperty,D=[],E=D.pop,F=D.push,G=D.push,H=D.slice,I=D.indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(this[b]===a)return b;return-1},J="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",K="[\\x20\\t\\r\\n\\f]",L="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",M=L.replace("w","w#"),N="\\["+K+"*("+L+")"+K+"*(?:([*^$|!~]?=)"+K+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+M+")|)|)"+K+"*\\]",O=":("+L+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+N.replace(3,8)+")*)|.*)\\)|)",P=new RegExp("^"+K+"+|((?:^|[^\\\\])(?:\\\\.)*)"+K+"+$","g"),Q=new RegExp("^"+K+"*,"+K+"*"),R=new RegExp("^"+K+"*([>+~]|"+K+")"+K+"*"),S=new RegExp("="+K+"*([^\\]'\"]*?)"+K+"*\\]","g"),T=new RegExp(O),U=new RegExp("^"+M+"$"),V={ID:new RegExp("^#("+L+")"),CLASS:new RegExp("^\\.("+L+")"),TAG:new RegExp("^("+L.replace("w","w*")+")"),ATTR:new RegExp("^"+N),PSEUDO:new RegExp("^"+O),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+K+"*(even|odd|(([+-]|)(\\d*)n|)"+K+"*(?:([+-]|)"+K+"*(\\d+)|))"+K+"*\\)|)","i"),bool:new RegExp("^(?:"+J+")$","i"),needsContext:new RegExp("^"+K+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+K+"*((?:-\\d)?\\d*)"+K+"*\\)|)(?=[^-]|$)","i")},W=/^(?:input|select|textarea|button)$/i,X=/^h\d$/i,Y=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,$=/[+~]/,_=/'|\\/g,ab=new RegExp("\\\\([\\da-f]{1,6}"+K+"?|("+K+")|.)","ig"),bb=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)};try{G.apply(D=H.call(t.childNodes),t.childNodes),D[t.childNodes.length].nodeType}catch(cb){G={apply:D.length?function(a,b){F.apply(a,H.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function db(a,b,d,e){var f,g,h,i,j,m,p,q,u,v;if((b?b.ownerDocument||b:t)!==l&&k(b),b=b||l,d=d||[],!a||"string"!=typeof a)return d;if(1!==(i=b.nodeType)&&9!==i)return[];if(n&&!e){if(f=Z.exec(a))if(h=f[1]){if(9===i){if(g=b.getElementById(h),!g||!g.parentNode)return d;if(g.id===h)return d.push(g),d}else if(b.ownerDocument&&(g=b.ownerDocument.getElementById(h))&&r(b,g)&&g.id===h)return d.push(g),d}else{if(f[2])return G.apply(d,b.getElementsByTagName(a)),d;if((h=f[3])&&c.getElementsByClassName&&b.getElementsByClassName)return G.apply(d,b.getElementsByClassName(h)),d}if(c.qsa&&(!o||!o.test(a))){if(q=p=s,u=b,v=9===i&&a,1===i&&"object"!==b.nodeName.toLowerCase()){m=ob(a),(p=b.getAttribute("id"))?q=p.replace(_,"\\$&"):b.setAttribute("id",q),q="[id='"+q+"'] ",j=m.length;while(j--)m[j]=q+pb(m[j]);u=$.test(a)&&mb(b.parentNode)||b,v=m.join(",")}if(v)try{return G.apply(d,u.querySelectorAll(v)),d}catch(w){}finally{p||b.removeAttribute("id")}}}return xb(a.replace(P,"$1"),b,d,e)}function eb(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function fb(a){return a[s]=!0,a}function gb(a){var b=l.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function hb(a,b){var c=a.split("|"),e=a.length;while(e--)d.attrHandle[c[e]]=b}function ib(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||B)-(~a.sourceIndex||B);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function jb(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function kb(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function lb(a){return fb(function(b){return b=+b,fb(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function mb(a){return a&&typeof a.getElementsByTagName!==A&&a}c=db.support={},f=db.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},k=db.setDocument=function(a){var b,e=a?a.ownerDocument||a:t,g=e.defaultView;return e!==l&&9===e.nodeType&&e.documentElement?(l=e,m=e.documentElement,n=!f(e),g&&g!==g.top&&(g.addEventListener?g.addEventListener("unload",function(){k()},!1):g.attachEvent&&g.attachEvent("onunload",function(){k()})),c.attributes=gb(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=gb(function(a){return a.appendChild(e.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=Y.test(e.getElementsByClassName)&&gb(function(a){return a.innerHTML="<div class='a'></div><div class='a i'></div>",a.firstChild.className="i",2===a.getElementsByClassName("i").length}),c.getById=gb(function(a){return m.appendChild(a).id=s,!e.getElementsByName||!e.getElementsByName(s).length}),c.getById?(d.find.ID=function(a,b){if(typeof b.getElementById!==A&&n){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},d.filter.ID=function(a){var b=a.replace(ab,bb);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(ab,bb);return function(a){var c=typeof a.getAttributeNode!==A&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return typeof b.getElementsByTagName!==A?b.getElementsByTagName(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return typeof b.getElementsByClassName!==A&&n?b.getElementsByClassName(a):void 0},p=[],o=[],(c.qsa=Y.test(e.querySelectorAll))&&(gb(function(a){a.innerHTML="<select t=''><option selected=''></option></select>",a.querySelectorAll("[t^='']").length&&o.push("[*^$]="+K+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||o.push("\\["+K+"*(?:value|"+J+")"),a.querySelectorAll(":checked").length||o.push(":checked")}),gb(function(a){var b=e.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&o.push("name"+K+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||o.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),o.push(",.*:")})),(c.matchesSelector=Y.test(q=m.webkitMatchesSelector||m.mozMatchesSelector||m.oMatchesSelector||m.msMatchesSelector))&&gb(function(a){c.disconnectedMatch=q.call(a,"div"),q.call(a,"[s!='']:x"),p.push("!=",O)}),o=o.length&&new RegExp(o.join("|")),p=p.length&&new RegExp(p.join("|")),b=Y.test(m.compareDocumentPosition),r=b||Y.test(m.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},z=b?function(a,b){if(a===b)return j=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===e||a.ownerDocument===t&&r(t,a)?-1:b===e||b.ownerDocument===t&&r(t,b)?1:i?I.call(i,a)-I.call(i,b):0:4&d?-1:1)}:function(a,b){if(a===b)return j=!0,0;var c,d=0,f=a.parentNode,g=b.parentNode,h=[a],k=[b];if(!f||!g)return a===e?-1:b===e?1:f?-1:g?1:i?I.call(i,a)-I.call(i,b):0;if(f===g)return ib(a,b);c=a;while(c=c.parentNode)h.unshift(c);c=b;while(c=c.parentNode)k.unshift(c);while(h[d]===k[d])d++;return d?ib(h[d],k[d]):h[d]===t?-1:k[d]===t?1:0},e):l},db.matches=function(a,b){return db(a,null,null,b)},db.matchesSelector=function(a,b){if((a.ownerDocument||a)!==l&&k(a),b=b.replace(S,"='$1']"),!(!c.matchesSelector||!n||p&&p.test(b)||o&&o.test(b)))try{var d=q.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return db(b,l,null,[a]).length>0},db.contains=function(a,b){return(a.ownerDocument||a)!==l&&k(a),r(a,b)},db.attr=function(a,b){(a.ownerDocument||a)!==l&&k(a);var e=d.attrHandle[b.toLowerCase()],f=e&&C.call(d.attrHandle,b.toLowerCase())?e(a,b,!n):void 0;return void 0!==f?f:c.attributes||!n?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},db.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},db.uniqueSort=function(a){var b,d=[],e=0,f=0;if(j=!c.detectDuplicates,i=!c.sortStable&&a.slice(0),a.sort(z),j){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return i=null,a},e=db.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=db.selectors={cacheLength:50,createPseudo:fb,match:V,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(ab,bb),a[3]=(a[4]||a[5]||"").replace(ab,bb),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||db.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&db.error(a[0]),a},PSEUDO:function(a){var b,c=!a[5]&&a[2];return V.CHILD.test(a[0])?null:(a[3]&&void 0!==a[4]?a[2]=a[4]:c&&T.test(c)&&(b=ob(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(ab,bb).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=w[a+" "];return b||(b=new RegExp("(^|"+K+")"+a+"("+K+"|$)"))&&w(a,function(a){return b.test("string"==typeof a.className&&a.className||typeof a.getAttribute!==A&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=db.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),t=!i&&!h;if(q){if(f){while(p){l=b;while(l=l[p])if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&t){k=q[s]||(q[s]={}),j=k[a]||[],n=j[0]===u&&j[1],m=j[0]===u&&j[2],l=n&&q.childNodes[n];while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if(1===l.nodeType&&++m&&l===b){k[a]=[u,n,m];break}}else if(t&&(j=(b[s]||(b[s]={}))[a])&&j[0]===u)m=j[1];else while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if((h?l.nodeName.toLowerCase()===r:1===l.nodeType)&&++m&&(t&&((l[s]||(l[s]={}))[a]=[u,m]),l===b))break;return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||db.error("unsupported pseudo: "+a);return e[s]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?fb(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=I.call(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:fb(function(a){var b=[],c=[],d=g(a.replace(P,"$1"));return d[s]?fb(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),!c.pop()}}),has:fb(function(a){return function(b){return db(a,b).length>0}}),contains:fb(function(a){return function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:fb(function(a){return U.test(a||"")||db.error("unsupported lang: "+a),a=a.replace(ab,bb).toLowerCase(),function(b){var c;do if(c=n?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===m},focus:function(a){return a===l.activeElement&&(!l.hasFocus||l.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return X.test(a.nodeName)},input:function(a){return W.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:lb(function(){return[0]}),last:lb(function(a,b){return[b-1]}),eq:lb(function(a,b,c){return[0>c?c+b:c]}),even:lb(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:lb(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:lb(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:lb(function(a,b,c){for(var d=0>c?c+b:c;++d<b;)a.push(d);return a})}},d.pseudos.nth=d.pseudos.eq;for(b in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})d.pseudos[b]=jb(b);for(b in{submit:!0,reset:!0})d.pseudos[b]=kb(b);function nb(){}nb.prototype=d.filters=d.pseudos,d.setFilters=new nb;function ob(a,b){var c,e,f,g,h,i,j,k=x[a+" "];if(k)return b?0:k.slice(0);h=a,i=[],j=d.preFilter;while(h){(!c||(e=Q.exec(h)))&&(e&&(h=h.slice(e[0].length)||h),i.push(f=[])),c=!1,(e=R.exec(h))&&(c=e.shift(),f.push({value:c,type:e[0].replace(P," ")}),h=h.slice(c.length));for(g in d.filter)!(e=V[g].exec(h))||j[g]&&!(e=j[g](e))||(c=e.shift(),f.push({value:c,type:g,matches:e}),h=h.slice(c.length));if(!c)break}return b?h.length:h?db.error(a):x(a,i).slice(0)}function pb(a){for(var b=0,c=a.length,d="";c>b;b++)d+=a[b].value;return d}function qb(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=v++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j=[u,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(i=b[s]||(b[s]={}),(h=i[d])&&h[0]===u&&h[1]===f)return j[2]=h[2];if(i[d]=j,j[2]=a(b,c,g))return!0}}}function rb(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function sb(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function tb(a,b,c,d,e,f){return d&&!d[s]&&(d=tb(d)),e&&!e[s]&&(e=tb(e,f)),fb(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||wb(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:sb(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=sb(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?I.call(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=sb(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):G.apply(g,r)})}function ub(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],i=g||d.relative[" "],j=g?1:0,k=qb(function(a){return a===b},i,!0),l=qb(function(a){return I.call(b,a)>-1},i,!0),m=[function(a,c,d){return!g&&(d||c!==h)||((b=c).nodeType?k(a,c,d):l(a,c,d))}];f>j;j++)if(c=d.relative[a[j].type])m=[qb(rb(m),c)];else{if(c=d.filter[a[j].type].apply(null,a[j].matches),c[s]){for(e=++j;f>e;e++)if(d.relative[a[e].type])break;return tb(j>1&&rb(m),j>1&&pb(a.slice(0,j-1).concat({value:" "===a[j-2].type?"*":""})).replace(P,"$1"),c,e>j&&ub(a.slice(j,e)),f>e&&ub(a=a.slice(e)),f>e&&pb(a))}m.push(c)}return rb(m)}function vb(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,i,j,k){var m,n,o,p=0,q="0",r=f&&[],s=[],t=h,v=f||e&&d.find.TAG("*",k),w=u+=null==t?1:Math.random()||.1,x=v.length;for(k&&(h=g!==l&&g);q!==x&&null!=(m=v[q]);q++){if(e&&m){n=0;while(o=a[n++])if(o(m,g,i)){j.push(m);break}k&&(u=w)}c&&((m=!o&&m)&&p--,f&&r.push(m))}if(p+=q,c&&q!==p){n=0;while(o=b[n++])o(r,s,g,i);if(f){if(p>0)while(q--)r[q]||s[q]||(s[q]=E.call(j));s=sb(s)}G.apply(j,s),k&&!f&&s.length>0&&p+b.length>1&&db.uniqueSort(j)}return k&&(u=w,h=t),r};return c?fb(f):f}g=db.compile=function(a,b){var c,d=[],e=[],f=y[a+" "];if(!f){b||(b=ob(a)),c=b.length;while(c--)f=ub(b[c]),f[s]?d.push(f):e.push(f);f=y(a,vb(e,d))}return f};function wb(a,b,c){for(var d=0,e=b.length;e>d;d++)db(a,b[d],c);return c}function xb(a,b,e,f){var h,i,j,k,l,m=ob(a);if(!f&&1===m.length){if(i=m[0]=m[0].slice(0),i.length>2&&"ID"===(j=i[0]).type&&c.getById&&9===b.nodeType&&n&&d.relative[i[1].type]){if(b=(d.find.ID(j.matches[0].replace(ab,bb),b)||[])[0],!b)return e;a=a.slice(i.shift().value.length)}h=V.needsContext.test(a)?0:i.length;while(h--){if(j=i[h],d.relative[k=j.type])break;if((l=d.find[k])&&(f=l(j.matches[0].replace(ab,bb),$.test(i[0].type)&&mb(b.parentNode)||b))){if(i.splice(h,1),a=f.length&&pb(i),!a)return G.apply(e,f),e;break}}}return g(a,m)(f,b,!n,e,$.test(a)&&mb(b.parentNode)||b),e}return c.sortStable=s.split("").sort(z).join("")===s,c.detectDuplicates=!!j,k(),c.sortDetached=gb(function(a){return 1&a.compareDocumentPosition(l.createElement("div"))}),gb(function(a){return a.innerHTML="<a href='#'></a>","#"===a.firstChild.getAttribute("href")})||hb("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&gb(function(a){return a.innerHTML="<input/>",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||hb("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),gb(function(a){return null==a.getAttribute("disabled")})||hb(J,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),db}(a);n.find=t,n.expr=t.selectors,n.expr[":"]=n.expr.pseudos,n.unique=t.uniqueSort,n.text=t.getText,n.isXMLDoc=t.isXML,n.contains=t.contains;var u=n.expr.match.needsContext,v=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,w=/^.[^:#\[\.,]*$/;function x(a,b,c){if(n.isFunction(b))return n.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return n.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(w.test(b))return n.filter(b,a,c);b=n.filter(b,a)}return n.grep(a,function(a){return n.inArray(a,b)>=0!==c})}n.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?n.find.matchesSelector(d,a)?[d]:[]:n.find.matches(a,n.grep(b,function(a){return 1===a.nodeType}))},n.fn.extend({find:function(a){var b,c=[],d=this,e=d.length;if("string"!=typeof a)return this.pushStack(n(a).filter(function(){for(b=0;e>b;b++)if(n.contains(d[b],this))return!0}));for(b=0;e>b;b++)n.find(a,d[b],c);return c=this.pushStack(e>1?n.unique(c):c),c.selector=this.selector?this.selector+" "+a:a,c},filter:function(a){return this.pushStack(x(this,a||[],!1))},not:function(a){return this.pushStack(x(this,a||[],!0))},is:function(a){return!!x(this,"string"==typeof a&&u.test(a)?n(a):a||[],!1).length}});var y,z=a.document,A=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,B=n.fn.init=function(a,b){var c,d;if(!a)return this;if("string"==typeof a){if(c="<"===a.charAt(0)&&">"===a.charAt(a.length-1)&&a.length>=3?[null,a,null]:A.exec(a),!c||!c[1]&&b)return!b||b.jquery?(b||y).find(a):this.constructor(b).find(a);if(c[1]){if(b=b instanceof n?b[0]:b,n.merge(this,n.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:z,!0)),v.test(c[1])&&n.isPlainObject(b))for(c in b)n.isFunction(this[c])?this[c](b[c]):this.attr(c,b[c]);return this}if(d=z.getElementById(c[2]),d&&d.parentNode){if(d.id!==c[2])return y.find(a);this.length=1,this[0]=d}return this.context=z,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):n.isFunction(a)?"undefined"!=typeof y.ready?y.ready(a):a(n):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),n.makeArray(a,this))};B.prototype=n.fn,y=n(z);var C=/^(?:parents|prev(?:Until|All))/,D={children:!0,contents:!0,next:!0,prev:!0};n.extend({dir:function(a,b,c){var d=[],e=a[b];while(e&&9!==e.nodeType&&(void 0===c||1!==e.nodeType||!n(e).is(c)))1===e.nodeType&&d.push(e),e=e[b];return d},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}}),n.fn.extend({has:function(a){var b,c=n(a,this),d=c.length;return this.filter(function(){for(b=0;d>b;b++)if(n.contains(this,c[b]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=u.test(a)||"string"!=typeof a?n(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&n.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?n.unique(f):f)},index:function(a){return a?"string"==typeof a?n.inArray(this[0],n(a)):n.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(n.unique(n.merge(this.get(),n(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function E(a,b){do a=a[b];while(a&&1!==a.nodeType);return a}n.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return n.dir(a,"parentNode")},parentsUntil:function(a,b,c){return n.dir(a,"parentNode",c)},next:function(a){return E(a,"nextSibling")},prev:function(a){return E(a,"previousSibling")},nextAll:function(a){return n.dir(a,"nextSibling")},prevAll:function(a){return n.dir(a,"previousSibling")},nextUntil:function(a,b,c){return n.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return n.dir(a,"previousSibling",c)},siblings:function(a){return n.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return n.sibling(a.firstChild)},contents:function(a){return n.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:n.merge([],a.childNodes)}},function(a,b){n.fn[a]=function(c,d){var e=n.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=n.filter(d,e)),this.length>1&&(D[a]||(e=n.unique(e)),C.test(a)&&(e=e.reverse())),this.pushStack(e)}});var F=/\S+/g,G={};function H(a){var b=G[a]={};return n.each(a.match(F)||[],function(a,c){b[c]=!0}),b}n.Callbacks=function(a){a="string"==typeof a?G[a]||H(a):n.extend({},a);var b,c,d,e,f,g,h=[],i=!a.once&&[],j=function(l){for(c=a.memory&&l,d=!0,f=g||0,g=0,e=h.length,b=!0;h&&e>f;f++)if(h[f].apply(l[0],l[1])===!1&&a.stopOnFalse){c=!1;break}b=!1,h&&(i?i.length&&j(i.shift()):c?h=[]:k.disable())},k={add:function(){if(h){var d=h.length;!function f(b){n.each(b,function(b,c){var d=n.type(c);"function"===d?a.unique&&k.has(c)||h.push(c):c&&c.length&&"string"!==d&&f(c)})}(arguments),b?e=h.length:c&&(g=d,j(c))}return this},remove:function(){return h&&n.each(arguments,function(a,c){var d;while((d=n.inArray(c,h,d))>-1)h.splice(d,1),b&&(e>=d&&e--,f>=d&&f--)}),this},has:function(a){return a?n.inArray(a,h)>-1:!(!h||!h.length)},empty:function(){return h=[],e=0,this},disable:function(){return h=i=c=void 0,this},disabled:function(){return!h},lock:function(){return i=void 0,c||k.disable(),this},locked:function(){return!i},fireWith:function(a,c){return!h||d&&!i||(c=c||[],c=[a,c.slice?c.slice():c],b?i.push(c):j(c)),this},fire:function(){return k.fireWith(this,arguments),this},fired:function(){return!!d}};return k},n.extend({Deferred:function(a){var b=[["resolve","done",n.Callbacks("once memory"),"resolved"],["reject","fail",n.Callbacks("once memory"),"rejected"],["notify","progress",n.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return n.Deferred(function(c){n.each(b,function(b,f){var g=n.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&n.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?n.extend(a,d):d}},e={};return d.pipe=d.then,n.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=d.call(arguments),e=c.length,f=1!==e||a&&n.isFunction(a.promise)?e:0,g=1===f?a:n.Deferred(),h=function(a,b,c){return function(e){b[a]=this,c[a]=arguments.length>1?d.call(arguments):e,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(e>1)for(i=new Array(e),j=new Array(e),k=new Array(e);e>b;b++)c[b]&&n.isFunction(c[b].promise)?c[b].promise().done(h(b,k,c)).fail(g.reject).progress(h(b,j,i)):--f;return f||g.resolveWith(k,c),g.promise()}});var I;n.fn.ready=function(a){return n.ready.promise().done(a),this},n.extend({isReady:!1,readyWait:1,holdReady:function(a){a?n.readyWait++:n.ready(!0)},ready:function(a){if(a===!0?!--n.readyWait:!n.isReady){if(!z.body)return setTimeout(n.ready);n.isReady=!0,a!==!0&&--n.readyWait>0||(I.resolveWith(z,[n]),n.fn.trigger&&n(z).trigger("ready").off("ready"))}}});function J(){z.addEventListener?(z.removeEventListener("DOMContentLoaded",K,!1),a.removeEventListener("load",K,!1)):(z.detachEvent("onreadystatechange",K),a.detachEvent("onload",K))}function K(){(z.addEventListener||"load"===event.type||"complete"===z.readyState)&&(J(),n.ready())}n.ready.promise=function(b){if(!I)if(I=n.Deferred(),"complete"===z.readyState)setTimeout(n.ready);else if(z.addEventListener)z.addEventListener("DOMContentLoaded",K,!1),a.addEventListener("load",K,!1);else{z.attachEvent("onreadystatechange",K),a.attachEvent("onload",K);var c=!1;try{c=null==a.frameElement&&z.documentElement}catch(d){}c&&c.doScroll&&!function e(){if(!n.isReady){try{c.doScroll("left")}catch(a){return setTimeout(e,50)}J(),n.ready()}}()}return I.promise(b)};var L="undefined",M;for(M in n(l))break;l.ownLast="0"!==M,l.inlineBlockNeedsLayout=!1,n(function(){var a,b,c=z.getElementsByTagName("body")[0];c&&(a=z.createElement("div"),a.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",b=z.createElement("div"),c.appendChild(a).appendChild(b),typeof b.style.zoom!==L&&(b.style.cssText="border:0;margin:0;width:1px;padding:1px;display:inline;zoom:1",(l.inlineBlockNeedsLayout=3===b.offsetWidth)&&(c.style.zoom=1)),c.removeChild(a),a=b=null)}),function(){var a=z.createElement("div");if(null==l.deleteExpando){l.deleteExpando=!0;try{delete a.test}catch(b){l.deleteExpando=!1}}a=null}(),n.acceptData=function(a){var b=n.noData[(a.nodeName+" ").toLowerCase()],c=+a.nodeType||1;return 1!==c&&9!==c?!1:!b||b!==!0&&a.getAttribute("classid")===b};var N=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,O=/([A-Z])/g;function P(a,b,c){if(void 0===c&&1===a.nodeType){var d="data-"+b.replace(O,"-$1").toLowerCase();if(c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:N.test(c)?n.parseJSON(c):c}catch(e){}n.data(a,b,c)}else c=void 0}return c}function Q(a){var b;for(b in a)if(("data"!==b||!n.isEmptyObject(a[b]))&&"toJSON"!==b)return!1;return!0}function R(a,b,d,e){if(n.acceptData(a)){var f,g,h=n.expando,i=a.nodeType,j=i?n.cache:a,k=i?a[h]:a[h]&&h;if(k&&j[k]&&(e||j[k].data)||void 0!==d||"string"!=typeof b)return k||(k=i?a[h]=c.pop()||n.guid++:h),j[k]||(j[k]=i?{}:{toJSON:n.noop}),("object"==typeof b||"function"==typeof b)&&(e?j[k]=n.extend(j[k],b):j[k].data=n.extend(j[k].data,b)),g=j[k],e||(g.data||(g.data={}),g=g.data),void 0!==d&&(g[n.camelCase(b)]=d),"string"==typeof b?(f=g[b],null==f&&(f=g[n.camelCase(b)])):f=g,f
+}}function S(a,b,c){if(n.acceptData(a)){var d,e,f=a.nodeType,g=f?n.cache:a,h=f?a[n.expando]:n.expando;if(g[h]){if(b&&(d=c?g[h]:g[h].data)){n.isArray(b)?b=b.concat(n.map(b,n.camelCase)):b in d?b=[b]:(b=n.camelCase(b),b=b in d?[b]:b.split(" ")),e=b.length;while(e--)delete d[b[e]];if(c?!Q(d):!n.isEmptyObject(d))return}(c||(delete g[h].data,Q(g[h])))&&(f?n.cleanData([a],!0):l.deleteExpando||g!=g.window?delete g[h]:g[h]=null)}}}n.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(a){return a=a.nodeType?n.cache[a[n.expando]]:a[n.expando],!!a&&!Q(a)},data:function(a,b,c){return R(a,b,c)},removeData:function(a,b){return S(a,b)},_data:function(a,b,c){return R(a,b,c,!0)},_removeData:function(a,b){return S(a,b,!0)}}),n.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=n.data(f),1===f.nodeType&&!n._data(f,"parsedAttrs"))){c=g.length;while(c--)d=g[c].name,0===d.indexOf("data-")&&(d=n.camelCase(d.slice(5)),P(f,d,e[d]));n._data(f,"parsedAttrs",!0)}return e}return"object"==typeof a?this.each(function(){n.data(this,a)}):arguments.length>1?this.each(function(){n.data(this,a,b)}):f?P(f,a,n.data(f,a)):void 0},removeData:function(a){return this.each(function(){n.removeData(this,a)})}}),n.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=n._data(a,b),c&&(!d||n.isArray(c)?d=n._data(a,b,n.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=n.queue(a,b),d=c.length,e=c.shift(),f=n._queueHooks(a,b),g=function(){n.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return n._data(a,c)||n._data(a,c,{empty:n.Callbacks("once memory").add(function(){n._removeData(a,b+"queue"),n._removeData(a,c)})})}}),n.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length<c?n.queue(this[0],a):void 0===b?this:this.each(function(){var c=n.queue(this,a,b);n._queueHooks(this,a),"fx"===a&&"inprogress"!==c[0]&&n.dequeue(this,a)})},dequeue:function(a){return this.each(function(){n.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,b){var c,d=1,e=n.Deferred(),f=this,g=this.length,h=function(){--d||e.resolveWith(f,[f])};"string"!=typeof a&&(b=a,a=void 0),a=a||"fx";while(g--)c=n._data(f[g],a+"queueHooks"),c&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}});var T=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,U=["Top","Right","Bottom","Left"],V=function(a,b){return a=b||a,"none"===n.css(a,"display")||!n.contains(a.ownerDocument,a)},W=n.access=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===n.type(c)){e=!0;for(h in c)n.access(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,n.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(n(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},X=/^(?:checkbox|radio)$/i;!function(){var a=z.createDocumentFragment(),b=z.createElement("div"),c=z.createElement("input");if(b.setAttribute("className","t"),b.innerHTML=" <link/><table></table><a href='/a'>a</a>",l.leadingWhitespace=3===b.firstChild.nodeType,l.tbody=!b.getElementsByTagName("tbody").length,l.htmlSerialize=!!b.getElementsByTagName("link").length,l.html5Clone="<:nav></:nav>"!==z.createElement("nav").cloneNode(!0).outerHTML,c.type="checkbox",c.checked=!0,a.appendChild(c),l.appendChecked=c.checked,b.innerHTML="<textarea>x</textarea>",l.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue,a.appendChild(b),b.innerHTML="<input type='radio' checked='checked' name='t'/>",l.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,l.noCloneEvent=!0,b.attachEvent&&(b.attachEvent("onclick",function(){l.noCloneEvent=!1}),b.cloneNode(!0).click()),null==l.deleteExpando){l.deleteExpando=!0;try{delete b.test}catch(d){l.deleteExpando=!1}}a=b=c=null}(),function(){var b,c,d=z.createElement("div");for(b in{submit:!0,change:!0,focusin:!0})c="on"+b,(l[b+"Bubbles"]=c in a)||(d.setAttribute(c,"t"),l[b+"Bubbles"]=d.attributes[c].expando===!1);d=null}();var Y=/^(?:input|select|textarea)$/i,Z=/^key/,$=/^(?:mouse|contextmenu)|click/,_=/^(?:focusinfocus|focusoutblur)$/,ab=/^([^.]*)(?:\.(.+)|)$/;function bb(){return!0}function cb(){return!1}function db(){try{return z.activeElement}catch(a){}}n.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=n._data(a);if(r){c.handler&&(i=c,c=i.handler,e=i.selector),c.guid||(c.guid=n.guid++),(g=r.events)||(g=r.events={}),(k=r.handle)||(k=r.handle=function(a){return typeof n===L||a&&n.event.triggered===a.type?void 0:n.event.dispatch.apply(k.elem,arguments)},k.elem=a),b=(b||"").match(F)||[""],h=b.length;while(h--)f=ab.exec(b[h])||[],o=q=f[1],p=(f[2]||"").split(".").sort(),o&&(j=n.event.special[o]||{},o=(e?j.delegateType:j.bindType)||o,j=n.event.special[o]||{},l=n.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&n.expr.match.needsContext.test(e),namespace:p.join(".")},i),(m=g[o])||(m=g[o]=[],m.delegateCount=0,j.setup&&j.setup.call(a,d,p,k)!==!1||(a.addEventListener?a.addEventListener(o,k,!1):a.attachEvent&&a.attachEvent("on"+o,k))),j.add&&(j.add.call(a,l),l.handler.guid||(l.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,l):m.push(l),n.event.global[o]=!0);a=null}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=n.hasData(a)&&n._data(a);if(r&&(k=r.events)){b=(b||"").match(F)||[""],j=b.length;while(j--)if(h=ab.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=n.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,m=k[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),i=f=m.length;while(f--)g=m[f],!e&&q!==g.origType||c&&c.guid!==g.guid||h&&!h.test(g.namespace)||d&&d!==g.selector&&("**"!==d||!g.selector)||(m.splice(f,1),g.selector&&m.delegateCount--,l.remove&&l.remove.call(a,g));i&&!m.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||n.removeEvent(a,o,r.handle),delete k[o])}else for(o in k)n.event.remove(a,o+b[j],c,d,!0);n.isEmptyObject(k)&&(delete r.handle,n._removeData(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,k,l,m,o=[d||z],p=j.call(b,"type")?b.type:b,q=j.call(b,"namespace")?b.namespace.split("."):[];if(h=l=d=d||z,3!==d.nodeType&&8!==d.nodeType&&!_.test(p+n.event.triggered)&&(p.indexOf(".")>=0&&(q=p.split("."),p=q.shift(),q.sort()),g=p.indexOf(":")<0&&"on"+p,b=b[n.expando]?b:new n.Event(p,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=q.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+q.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:n.makeArray(c,[b]),k=n.event.special[p]||{},e||!k.trigger||k.trigger.apply(d,c)!==!1)){if(!e&&!k.noBubble&&!n.isWindow(d)){for(i=k.delegateType||p,_.test(i+p)||(h=h.parentNode);h;h=h.parentNode)o.push(h),l=h;l===(d.ownerDocument||z)&&o.push(l.defaultView||l.parentWindow||a)}m=0;while((h=o[m++])&&!b.isPropagationStopped())b.type=m>1?i:k.bindType||p,f=(n._data(h,"events")||{})[b.type]&&n._data(h,"handle"),f&&f.apply(h,c),f=g&&h[g],f&&f.apply&&n.acceptData(h)&&(b.result=f.apply(h,c),b.result===!1&&b.preventDefault());if(b.type=p,!e&&!b.isDefaultPrevented()&&(!k._default||k._default.apply(o.pop(),c)===!1)&&n.acceptData(d)&&g&&d[p]&&!n.isWindow(d)){l=d[g],l&&(d[g]=null),n.event.triggered=p;try{d[p]()}catch(r){}n.event.triggered=void 0,l&&(d[g]=l)}return b.result}},dispatch:function(a){a=n.event.fix(a);var b,c,e,f,g,h=[],i=d.call(arguments),j=(n._data(this,"events")||{})[a.type]||[],k=n.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=n.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,g=0;while((e=f.handlers[g++])&&!a.isImmediatePropagationStopped())(!a.namespace_re||a.namespace_re.test(e.namespace))&&(a.handleObj=e,a.data=e.data,c=((n.event.special[e.origType]||{}).handle||e.handler).apply(f.elem,i),void 0!==c&&(a.result=c)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&(!a.button||"click"!==a.type))for(;i!=this;i=i.parentNode||this)if(1===i.nodeType&&(i.disabled!==!0||"click"!==a.type)){for(e=[],f=0;h>f;f++)d=b[f],c=d.selector+" ",void 0===e[c]&&(e[c]=d.needsContext?n(c,this).index(i)>=0:n.find(c,this,null,[i]).length),e[c]&&e.push(d);e.length&&g.push({elem:i,handlers:e})}return h<b.length&&g.push({elem:this,handlers:b.slice(h)}),g},fix:function(a){if(a[n.expando])return a;var b,c,d,e=a.type,f=a,g=this.fixHooks[e];g||(this.fixHooks[e]=g=$.test(e)?this.mouseHooks:Z.test(e)?this.keyHooks:{}),d=g.props?this.props.concat(g.props):this.props,a=new n.Event(f),b=d.length;while(b--)c=d[b],a[c]=f[c];return a.target||(a.target=f.srcElement||z),3===a.target.nodeType&&(a.target=a.target.parentNode),a.metaKey=!!a.metaKey,g.filter?g.filter(a,f):a},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){return null==a.which&&(a.which=null!=b.charCode?b.charCode:b.keyCode),a}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,b){var c,d,e,f=b.button,g=b.fromElement;return null==a.pageX&&null!=b.clientX&&(d=a.target.ownerDocument||z,e=d.documentElement,c=d.body,a.pageX=b.clientX+(e&&e.scrollLeft||c&&c.scrollLeft||0)-(e&&e.clientLeft||c&&c.clientLeft||0),a.pageY=b.clientY+(e&&e.scrollTop||c&&c.scrollTop||0)-(e&&e.clientTop||c&&c.clientTop||0)),!a.relatedTarget&&g&&(a.relatedTarget=g===a.target?b.toElement:g),a.which||void 0===f||(a.which=1&f?1:2&f?3:4&f?2:0),a}},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==db()&&this.focus)try{return this.focus(),!1}catch(a){}},delegateType:"focusin"},blur:{trigger:function(){return this===db()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return n.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):void 0},_default:function(a){return n.nodeName(a.target,"a")}},beforeunload:{postDispatch:function(a){void 0!==a.result&&(a.originalEvent.returnValue=a.result)}}},simulate:function(a,b,c,d){var e=n.extend(new n.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?n.event.trigger(e,null,b):n.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},n.removeEvent=z.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){var d="on"+b;a.detachEvent&&(typeof a[d]===L&&(a[d]=null),a.detachEvent(d,c))},n.Event=function(a,b){return this instanceof n.Event?(a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||void 0===a.defaultPrevented&&(a.returnValue===!1||a.getPreventDefault&&a.getPreventDefault())?bb:cb):this.type=a,b&&n.extend(this,b),this.timeStamp=a&&a.timeStamp||n.now(),void(this[n.expando]=!0)):new n.Event(a,b)},n.Event.prototype={isDefaultPrevented:cb,isPropagationStopped:cb,isImmediatePropagationStopped:cb,preventDefault:function(){var a=this.originalEvent;this.isDefaultPrevented=bb,a&&(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){var a=this.originalEvent;this.isPropagationStopped=bb,a&&(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=bb,this.stopPropagation()}},n.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){n.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj;return(!e||e!==d&&!n.contains(d,e))&&(a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b),c}}}),l.submitBubbles||(n.event.special.submit={setup:function(){return n.nodeName(this,"form")?!1:void n.event.add(this,"click._submit keypress._submit",function(a){var b=a.target,c=n.nodeName(b,"input")||n.nodeName(b,"button")?b.form:void 0;c&&!n._data(c,"submitBubbles")&&(n.event.add(c,"submit._submit",function(a){a._submit_bubble=!0}),n._data(c,"submitBubbles",!0))})},postDispatch:function(a){a._submit_bubble&&(delete a._submit_bubble,this.parentNode&&!a.isTrigger&&n.event.simulate("submit",this.parentNode,a,!0))},teardown:function(){return n.nodeName(this,"form")?!1:void n.event.remove(this,"._submit")}}),l.changeBubbles||(n.event.special.change={setup:function(){return Y.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(n.event.add(this,"propertychange._change",function(a){"checked"===a.originalEvent.propertyName&&(this._just_changed=!0)}),n.event.add(this,"click._change",function(a){this._just_changed&&!a.isTrigger&&(this._just_changed=!1),n.event.simulate("change",this,a,!0)})),!1):void n.event.add(this,"beforeactivate._change",function(a){var b=a.target;Y.test(b.nodeName)&&!n._data(b,"changeBubbles")&&(n.event.add(b,"change._change",function(a){!this.parentNode||a.isSimulated||a.isTrigger||n.event.simulate("change",this.parentNode,a,!0)}),n._data(b,"changeBubbles",!0))})},handle:function(a){var b=a.target;return this!==b||a.isSimulated||a.isTrigger||"radio"!==b.type&&"checkbox"!==b.type?a.handleObj.handler.apply(this,arguments):void 0},teardown:function(){return n.event.remove(this,"._change"),!Y.test(this.nodeName)}}),l.focusinBubbles||n.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){n.event.simulate(b,a.target,n.event.fix(a),!0)};n.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=n._data(d,b);e||d.addEventListener(a,c,!0),n._data(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=n._data(d,b)-1;e?n._data(d,b,e):(d.removeEventListener(a,c,!0),n._removeData(d,b))}}}),n.fn.extend({on:function(a,b,c,d,e){var f,g;if("object"==typeof a){"string"!=typeof b&&(c=c||b,b=void 0);for(f in a)this.on(f,b,c,a[f],e);return this}if(null==c&&null==d?(d=b,c=b=void 0):null==d&&("string"==typeof b?(d=c,c=void 0):(d=c,c=b,b=void 0)),d===!1)d=cb;else if(!d)return this;return 1===e&&(g=d,d=function(a){return n().off(a),g.apply(this,arguments)},d.guid=g.guid||(g.guid=n.guid++)),this.each(function(){n.event.add(this,a,d,c,b)})},one:function(a,b,c,d){return this.on(a,b,c,d,1)},off:function(a,b,c){var d,e;if(a&&a.preventDefault&&a.handleObj)return d=a.handleObj,n(a.delegateTarget).off(d.namespace?d.origType+"."+d.namespace:d.origType,d.selector,d.handler),this;if("object"==typeof a){for(e in a)this.off(e,b,a[e]);return this}return(b===!1||"function"==typeof b)&&(c=b,b=void 0),c===!1&&(c=cb),this.each(function(){n.event.remove(this,a,c,b)})},trigger:function(a,b){return this.each(function(){n.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];return c?n.event.trigger(a,b,c,!0):void 0}});function eb(a){var b=fb.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}var fb="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",gb=/ jQuery\d+="(?:null|\d+)"/g,hb=new RegExp("<(?:"+fb+")[\\s/>]","i"),ib=/^\s+/,jb=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,kb=/<([\w:]+)/,lb=/<tbody/i,mb=/<|&#?\w+;/,nb=/<(?:script|style|link)/i,ob=/checked\s*(?:[^=]|=\s*.checked.)/i,pb=/^$|\/(?:java|ecma)script/i,qb=/^true\/(.*)/,rb=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,sb={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:l.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]},tb=eb(z),ub=tb.appendChild(z.createElement("div"));sb.optgroup=sb.option,sb.tbody=sb.tfoot=sb.colgroup=sb.caption=sb.thead,sb.th=sb.td;function vb(a,b){var c,d,e=0,f=typeof a.getElementsByTagName!==L?a.getElementsByTagName(b||"*"):typeof a.querySelectorAll!==L?a.querySelectorAll(b||"*"):void 0;if(!f)for(f=[],c=a.childNodes||a;null!=(d=c[e]);e++)!b||n.nodeName(d,b)?f.push(d):n.merge(f,vb(d,b));return void 0===b||b&&n.nodeName(a,b)?n.merge([a],f):f}function wb(a){X.test(a.type)&&(a.defaultChecked=a.checked)}function xb(a,b){return n.nodeName(a,"table")&&n.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function yb(a){return a.type=(null!==n.find.attr(a,"type"))+"/"+a.type,a}function zb(a){var b=qb.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function Ab(a,b){for(var c,d=0;null!=(c=a[d]);d++)n._data(c,"globalEval",!b||n._data(b[d],"globalEval"))}function Bb(a,b){if(1===b.nodeType&&n.hasData(a)){var c,d,e,f=n._data(a),g=n._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;e>d;d++)n.event.add(b,c,h[c][d])}g.data&&(g.data=n.extend({},g.data))}}function Cb(a,b){var c,d,e;if(1===b.nodeType){if(c=b.nodeName.toLowerCase(),!l.noCloneEvent&&b[n.expando]){e=n._data(b);for(d in e.events)n.removeEvent(b,d,e.handle);b.removeAttribute(n.expando)}"script"===c&&b.text!==a.text?(yb(b).text=a.text,zb(b)):"object"===c?(b.parentNode&&(b.outerHTML=a.outerHTML),l.html5Clone&&a.innerHTML&&!n.trim(b.innerHTML)&&(b.innerHTML=a.innerHTML)):"input"===c&&X.test(a.type)?(b.defaultChecked=b.checked=a.checked,b.value!==a.value&&(b.value=a.value)):"option"===c?b.defaultSelected=b.selected=a.defaultSelected:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}}n.extend({clone:function(a,b,c){var d,e,f,g,h,i=n.contains(a.ownerDocument,a);if(l.html5Clone||n.isXMLDoc(a)||!hb.test("<"+a.nodeName+">")?f=a.cloneNode(!0):(ub.innerHTML=a.outerHTML,ub.removeChild(f=ub.firstChild)),!(l.noCloneEvent&&l.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||n.isXMLDoc(a)))for(d=vb(f),h=vb(a),g=0;null!=(e=h[g]);++g)d[g]&&Cb(e,d[g]);if(b)if(c)for(h=h||vb(a),d=d||vb(f),g=0;null!=(e=h[g]);g++)Bb(e,d[g]);else Bb(a,f);return d=vb(f,"script"),d.length>0&&Ab(d,!i&&vb(a,"script")),d=h=e=null,f},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,k,m=a.length,o=eb(b),p=[],q=0;m>q;q++)if(f=a[q],f||0===f)if("object"===n.type(f))n.merge(p,f.nodeType?[f]:f);else if(mb.test(f)){h=h||o.appendChild(b.createElement("div")),i=(kb.exec(f)||["",""])[1].toLowerCase(),k=sb[i]||sb._default,h.innerHTML=k[1]+f.replace(jb,"<$1></$2>")+k[2],e=k[0];while(e--)h=h.lastChild;if(!l.leadingWhitespace&&ib.test(f)&&p.push(b.createTextNode(ib.exec(f)[0])),!l.tbody){f="table"!==i||lb.test(f)?"<table>"!==k[1]||lb.test(f)?0:h:h.firstChild,e=f&&f.childNodes.length;while(e--)n.nodeName(j=f.childNodes[e],"tbody")&&!j.childNodes.length&&f.removeChild(j)}n.merge(p,h.childNodes),h.textContent="";while(h.firstChild)h.removeChild(h.firstChild);h=o.lastChild}else p.push(b.createTextNode(f));h&&o.removeChild(h),l.appendChecked||n.grep(vb(p,"input"),wb),q=0;while(f=p[q++])if((!d||-1===n.inArray(f,d))&&(g=n.contains(f.ownerDocument,f),h=vb(o.appendChild(f),"script"),g&&Ab(h),c)){e=0;while(f=h[e++])pb.test(f.type||"")&&c.push(f)}return h=null,o},cleanData:function(a,b){for(var d,e,f,g,h=0,i=n.expando,j=n.cache,k=l.deleteExpando,m=n.event.special;null!=(d=a[h]);h++)if((b||n.acceptData(d))&&(f=d[i],g=f&&j[f])){if(g.events)for(e in g.events)m[e]?n.event.remove(d,e):n.removeEvent(d,e,g.handle);j[f]&&(delete j[f],k?delete d[i]:typeof d.removeAttribute!==L?d.removeAttribute(i):d[i]=null,c.push(f))}}}),n.fn.extend({text:function(a){return W(this,function(a){return void 0===a?n.text(this):this.empty().append((this[0]&&this[0].ownerDocument||z).createTextNode(a))},null,a,arguments.length)},append:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=xb(this,a);b.appendChild(a)}})},prepend:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=xb(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,d=a?n.filter(a,this):this,e=0;null!=(c=d[e]);e++)b||1!==c.nodeType||n.cleanData(vb(c)),c.parentNode&&(b&&n.contains(c.ownerDocument,c)&&Ab(vb(c,"script")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++){1===a.nodeType&&n.cleanData(vb(a,!1));while(a.firstChild)a.removeChild(a.firstChild);a.options&&n.nodeName(a,"select")&&(a.options.length=0)}return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return n.clone(this,a,b)})},html:function(a){return W(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a)return 1===b.nodeType?b.innerHTML.replace(gb,""):void 0;if(!("string"!=typeof a||nb.test(a)||!l.htmlSerialize&&hb.test(a)||!l.leadingWhitespace&&ib.test(a)||sb[(kb.exec(a)||["",""])[1].toLowerCase()])){a=a.replace(jb,"<$1></$2>");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(n.cleanData(vb(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=arguments[0];return this.domManip(arguments,function(b){a=this.parentNode,n.cleanData(vb(this)),a&&a.replaceChild(b,this)}),a&&(a.length||a.nodeType)?this:this.remove()},detach:function(a){return this.remove(a,!0)},domManip:function(a,b){a=e.apply([],a);var c,d,f,g,h,i,j=0,k=this.length,m=this,o=k-1,p=a[0],q=n.isFunction(p);if(q||k>1&&"string"==typeof p&&!l.checkClone&&ob.test(p))return this.each(function(c){var d=m.eq(c);q&&(a[0]=p.call(this,c,d.html())),d.domManip(a,b)});if(k&&(i=n.buildFragment(a,this[0].ownerDocument,!1,this),c=i.firstChild,1===i.childNodes.length&&(i=c),c)){for(g=n.map(vb(i,"script"),yb),f=g.length;k>j;j++)d=i,j!==o&&(d=n.clone(d,!0,!0),f&&n.merge(g,vb(d,"script"))),b.call(this[j],d,j);if(f)for(h=g[g.length-1].ownerDocument,n.map(g,zb),j=0;f>j;j++)d=g[j],pb.test(d.type||"")&&!n._data(d,"globalEval")&&n.contains(h,d)&&(d.src?n._evalUrl&&n._evalUrl(d.src):n.globalEval((d.text||d.textContent||d.innerHTML||"").replace(rb,"")));i=c=null}return this}}),n.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){n.fn[a]=function(a){for(var c,d=0,e=[],g=n(a),h=g.length-1;h>=d;d++)c=d===h?this:this.clone(!0),n(g[d])[b](c),f.apply(e,c.get());return this.pushStack(e)}});var Db,Eb={};function Fb(b,c){var d=n(c.createElement(b)).appendTo(c.body),e=a.getDefaultComputedStyle?a.getDefaultComputedStyle(d[0]).display:n.css(d[0],"display");return d.detach(),e}function Gb(a){var b=z,c=Eb[a];return c||(c=Fb(a,b),"none"!==c&&c||(Db=(Db||n("<iframe frameborder='0' width='0' height='0'/>")).appendTo(b.documentElement),b=(Db[0].contentWindow||Db[0].contentDocument).document,b.write(),b.close(),c=Fb(a,b),Db.detach()),Eb[a]=c),c}!function(){var a,b,c=z.createElement("div"),d="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;padding:0;margin:0;border:0";c.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",a=c.getElementsByTagName("a")[0],a.style.cssText="float:left;opacity:.5",l.opacity=/^0.5/.test(a.style.opacity),l.cssFloat=!!a.style.cssFloat,c.style.backgroundClip="content-box",c.cloneNode(!0).style.backgroundClip="",l.clearCloneStyle="content-box"===c.style.backgroundClip,a=c=null,l.shrinkWrapBlocks=function(){var a,c,e,f;if(null==b){if(a=z.getElementsByTagName("body")[0],!a)return;f="border:0;width:0;height:0;position:absolute;top:0;left:-9999px",c=z.createElement("div"),e=z.createElement("div"),a.appendChild(c).appendChild(e),b=!1,typeof e.style.zoom!==L&&(e.style.cssText=d+";width:1px;padding:1px;zoom:1",e.innerHTML="<div></div>",e.firstChild.style.width="5px",b=3!==e.offsetWidth),a.removeChild(c),a=c=e=null}return b}}();var Hb=/^margin/,Ib=new RegExp("^("+T+")(?!px)[a-z%]+$","i"),Jb,Kb,Lb=/^(top|right|bottom|left)$/;a.getComputedStyle?(Jb=function(a){return a.ownerDocument.defaultView.getComputedStyle(a,null)},Kb=function(a,b,c){var d,e,f,g,h=a.style;return c=c||Jb(a),g=c?c.getPropertyValue(b)||c[b]:void 0,c&&(""!==g||n.contains(a.ownerDocument,a)||(g=n.style(a,b)),Ib.test(g)&&Hb.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=g,g=c.width,h.width=d,h.minWidth=e,h.maxWidth=f)),void 0===g?g:g+""}):z.documentElement.currentStyle&&(Jb=function(a){return a.currentStyle},Kb=function(a,b,c){var d,e,f,g,h=a.style;return c=c||Jb(a),g=c?c[b]:void 0,null==g&&h&&h[b]&&(g=h[b]),Ib.test(g)&&!Lb.test(b)&&(d=h.left,e=a.runtimeStyle,f=e&&e.left,f&&(e.left=a.currentStyle.left),h.left="fontSize"===b?"1em":g,g=h.pixelLeft+"px",h.left=d,f&&(e.left=f)),void 0===g?g:g+""||"auto"});function Mb(a,b){return{get:function(){var c=a();if(null!=c)return c?void delete this.get:(this.get=b).apply(this,arguments)}}}!function(){var b,c,d,e,f,g,h=z.createElement("div"),i="border:0;width:0;height:0;position:absolute;top:0;left:-9999px",j="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;padding:0;margin:0;border:0";h.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",b=h.getElementsByTagName("a")[0],b.style.cssText="float:left;opacity:.5",l.opacity=/^0.5/.test(b.style.opacity),l.cssFloat=!!b.style.cssFloat,h.style.backgroundClip="content-box",h.cloneNode(!0).style.backgroundClip="",l.clearCloneStyle="content-box"===h.style.backgroundClip,b=h=null,n.extend(l,{reliableHiddenOffsets:function(){if(null!=c)return c;var a,b,d,e=z.createElement("div"),f=z.getElementsByTagName("body")[0];if(f)return e.setAttribute("className","t"),e.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",a=z.createElement("div"),a.style.cssText=i,f.appendChild(a).appendChild(e),e.innerHTML="<table><tr><td></td><td>t</td></tr></table>",b=e.getElementsByTagName("td"),b[0].style.cssText="padding:0;margin:0;border:0;display:none",d=0===b[0].offsetHeight,b[0].style.display="",b[1].style.display="none",c=d&&0===b[0].offsetHeight,f.removeChild(a),e=f=null,c},boxSizing:function(){return null==d&&k(),d},boxSizingReliable:function(){return null==e&&k(),e},pixelPosition:function(){return null==f&&k(),f},reliableMarginRight:function(){var b,c,d,e;if(null==g&&a.getComputedStyle){if(b=z.getElementsByTagName("body")[0],!b)return;c=z.createElement("div"),d=z.createElement("div"),c.style.cssText=i,b.appendChild(c).appendChild(d),e=d.appendChild(z.createElement("div")),e.style.cssText=d.style.cssText=j,e.style.marginRight=e.style.width="0",d.style.width="1px",g=!parseFloat((a.getComputedStyle(e,null)||{}).marginRight),b.removeChild(c)}return g}});function k(){var b,c,h=z.getElementsByTagName("body")[0];h&&(b=z.createElement("div"),c=z.createElement("div"),b.style.cssText=i,h.appendChild(b).appendChild(c),c.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;position:absolute;display:block;padding:1px;border:1px;width:4px;margin-top:1%;top:1%",n.swap(h,null!=h.style.zoom?{zoom:1}:{},function(){d=4===c.offsetWidth}),e=!0,f=!1,g=!0,a.getComputedStyle&&(f="1%"!==(a.getComputedStyle(c,null)||{}).top,e="4px"===(a.getComputedStyle(c,null)||{width:"4px"}).width),h.removeChild(b),c=h=null)}}(),n.swap=function(a,b,c,d){var e,f,g={};for(f in b)g[f]=a.style[f],a.style[f]=b[f];e=c.apply(a,d||[]);for(f in b)a.style[f]=g[f];return e};var Nb=/alpha\([^)]*\)/i,Ob=/opacity\s*=\s*([^)]*)/,Pb=/^(none|table(?!-c[ea]).+)/,Qb=new RegExp("^("+T+")(.*)$","i"),Rb=new RegExp("^([+-])=("+T+")","i"),Sb={position:"absolute",visibility:"hidden",display:"block"},Tb={letterSpacing:0,fontWeight:400},Ub=["Webkit","O","Moz","ms"];function Vb(a,b){if(b in a)return b;var c=b.charAt(0).toUpperCase()+b.slice(1),d=b,e=Ub.length;while(e--)if(b=Ub[e]+c,b in a)return b;return d}function Wb(a,b){for(var c,d,e,f=[],g=0,h=a.length;h>g;g++)d=a[g],d.style&&(f[g]=n._data(d,"olddisplay"),c=d.style.display,b?(f[g]||"none"!==c||(d.style.display=""),""===d.style.display&&V(d)&&(f[g]=n._data(d,"olddisplay",Gb(d.nodeName)))):f[g]||(e=V(d),(c&&"none"!==c||!e)&&n._data(d,"olddisplay",e?c:n.css(d,"display"))));for(g=0;h>g;g++)d=a[g],d.style&&(b&&"none"!==d.style.display&&""!==d.style.display||(d.style.display=b?f[g]||"":"none"));return a}function Xb(a,b,c){var d=Qb.exec(b);return d?Math.max(0,d[1]-(c||0))+(d[2]||"px"):b}function Yb(a,b,c,d,e){for(var f=c===(d?"border":"content")?4:"width"===b?1:0,g=0;4>f;f+=2)"margin"===c&&(g+=n.css(a,c+U[f],!0,e)),d?("content"===c&&(g-=n.css(a,"padding"+U[f],!0,e)),"margin"!==c&&(g-=n.css(a,"border"+U[f]+"Width",!0,e))):(g+=n.css(a,"padding"+U[f],!0,e),"padding"!==c&&(g+=n.css(a,"border"+U[f]+"Width",!0,e)));return g}function Zb(a,b,c){var d=!0,e="width"===b?a.offsetWidth:a.offsetHeight,f=Jb(a),g=l.boxSizing()&&"border-box"===n.css(a,"boxSizing",!1,f);if(0>=e||null==e){if(e=Kb(a,b,f),(0>e||null==e)&&(e=a.style[b]),Ib.test(e))return e;d=g&&(l.boxSizingReliable()||e===a.style[b]),e=parseFloat(e)||0}return e+Yb(a,b,c||(g?"border":"content"),d,f)+"px"}n.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=Kb(a,"opacity");return""===c?"1":c}}}},cssNumber:{columnCount:!0,fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":l.cssFloat?"cssFloat":"styleFloat"},style:function(a,b,c,d){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var e,f,g,h=n.camelCase(b),i=a.style;if(b=n.cssProps[h]||(n.cssProps[h]=Vb(i,h)),g=n.cssHooks[b]||n.cssHooks[h],void 0===c)return g&&"get"in g&&void 0!==(e=g.get(a,!1,d))?e:i[b];if(f=typeof c,"string"===f&&(e=Rb.exec(c))&&(c=(e[1]+1)*e[2]+parseFloat(n.css(a,b)),f="number"),null!=c&&c===c&&("number"!==f||n.cssNumber[h]||(c+="px"),l.clearCloneStyle||""!==c||0!==b.indexOf("background")||(i[b]="inherit"),!(g&&"set"in g&&void 0===(c=g.set(a,c,d)))))try{i[b]="",i[b]=c}catch(j){}}},css:function(a,b,c,d){var e,f,g,h=n.camelCase(b);return b=n.cssProps[h]||(n.cssProps[h]=Vb(a.style,h)),g=n.cssHooks[b]||n.cssHooks[h],g&&"get"in g&&(f=g.get(a,!0,c)),void 0===f&&(f=Kb(a,b,d)),"normal"===f&&b in Tb&&(f=Tb[b]),""===c||c?(e=parseFloat(f),c===!0||n.isNumeric(e)?e||0:f):f}}),n.each(["height","width"],function(a,b){n.cssHooks[b]={get:function(a,c,d){return c?0===a.offsetWidth&&Pb.test(n.css(a,"display"))?n.swap(a,Sb,function(){return Zb(a,b,d)}):Zb(a,b,d):void 0},set:function(a,c,d){var e=d&&Jb(a);return Xb(a,c,d?Yb(a,b,d,l.boxSizing()&&"border-box"===n.css(a,"boxSizing",!1,e),e):0)}}}),l.opacity||(n.cssHooks.opacity={get:function(a,b){return Ob.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=n.isNumeric(b)?"alpha(opacity="+100*b+")":"",f=d&&d.filter||c.filter||"";c.zoom=1,(b>=1||""===b)&&""===n.trim(f.replace(Nb,""))&&c.removeAttribute&&(c.removeAttribute("filter"),""===b||d&&!d.filter)||(c.filter=Nb.test(f)?f.replace(Nb,e):f+" "+e)}}),n.cssHooks.marginRight=Mb(l.reliableMarginRight,function(a,b){return b?n.swap(a,{display:"inline-block"},Kb,[a,"marginRight"]):void 0}),n.each({margin:"",padding:"",border:"Width"},function(a,b){n.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];4>d;d++)e[a+U[d]+b]=f[d]||f[d-2]||f[0];return e}},Hb.test(a)||(n.cssHooks[a+b].set=Xb)}),n.fn.extend({css:function(a,b){return W(this,function(a,b,c){var d,e,f={},g=0;if(n.isArray(b)){for(d=Jb(a),e=b.length;e>g;g++)f[b[g]]=n.css(a,b[g],!1,d);return f}return void 0!==c?n.style(a,b,c):n.css(a,b)
+},a,b,arguments.length>1)},show:function(){return Wb(this,!0)},hide:function(){return Wb(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){V(this)?n(this).show():n(this).hide()})}});function $b(a,b,c,d,e){return new $b.prototype.init(a,b,c,d,e)}n.Tween=$b,$b.prototype={constructor:$b,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||"swing",this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(n.cssNumber[c]?"":"px")},cur:function(){var a=$b.propHooks[this.prop];return a&&a.get?a.get(this):$b.propHooks._default.get(this)},run:function(a){var b,c=$b.propHooks[this.prop];return this.pos=b=this.options.duration?n.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):$b.propHooks._default.set(this),this}},$b.prototype.init.prototype=$b.prototype,$b.propHooks={_default:{get:function(a){var b;return null==a.elem[a.prop]||a.elem.style&&null!=a.elem.style[a.prop]?(b=n.css(a.elem,a.prop,""),b&&"auto"!==b?b:0):a.elem[a.prop]},set:function(a){n.fx.step[a.prop]?n.fx.step[a.prop](a):a.elem.style&&(null!=a.elem.style[n.cssProps[a.prop]]||n.cssHooks[a.prop])?n.style(a.elem,a.prop,a.now+a.unit):a.elem[a.prop]=a.now}}},$b.propHooks.scrollTop=$b.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},n.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2}},n.fx=$b.prototype.init,n.fx.step={};var _b,ac,bc=/^(?:toggle|show|hide)$/,cc=new RegExp("^(?:([+-])=|)("+T+")([a-z%]*)$","i"),dc=/queueHooks$/,ec=[jc],fc={"*":[function(a,b){var c=this.createTween(a,b),d=c.cur(),e=cc.exec(b),f=e&&e[3]||(n.cssNumber[a]?"":"px"),g=(n.cssNumber[a]||"px"!==f&&+d)&&cc.exec(n.css(c.elem,a)),h=1,i=20;if(g&&g[3]!==f){f=f||g[3],e=e||[],g=+d||1;do h=h||".5",g/=h,n.style(c.elem,a,g+f);while(h!==(h=c.cur()/d)&&1!==h&&--i)}return e&&(g=c.start=+g||+d||0,c.unit=f,c.end=e[1]?g+(e[1]+1)*e[2]:+e[2]),c}]};function gc(){return setTimeout(function(){_b=void 0}),_b=n.now()}function hc(a,b){var c,d={height:a},e=0;for(b=b?1:0;4>e;e+=2-b)c=U[e],d["margin"+c]=d["padding"+c]=a;return b&&(d.opacity=d.width=a),d}function ic(a,b,c){for(var d,e=(fc[b]||[]).concat(fc["*"]),f=0,g=e.length;g>f;f++)if(d=e[f].call(c,b,a))return d}function jc(a,b,c){var d,e,f,g,h,i,j,k,m=this,o={},p=a.style,q=a.nodeType&&V(a),r=n._data(a,"fxshow");c.queue||(h=n._queueHooks(a,"fx"),null==h.unqueued&&(h.unqueued=0,i=h.empty.fire,h.empty.fire=function(){h.unqueued||i()}),h.unqueued++,m.always(function(){m.always(function(){h.unqueued--,n.queue(a,"fx").length||h.empty.fire()})})),1===a.nodeType&&("height"in b||"width"in b)&&(c.overflow=[p.overflow,p.overflowX,p.overflowY],j=n.css(a,"display"),k=Gb(a.nodeName),"none"===j&&(j=k),"inline"===j&&"none"===n.css(a,"float")&&(l.inlineBlockNeedsLayout&&"inline"!==k?p.zoom=1:p.display="inline-block")),c.overflow&&(p.overflow="hidden",l.shrinkWrapBlocks()||m.always(function(){p.overflow=c.overflow[0],p.overflowX=c.overflow[1],p.overflowY=c.overflow[2]}));for(d in b)if(e=b[d],bc.exec(e)){if(delete b[d],f=f||"toggle"===e,e===(q?"hide":"show")){if("show"!==e||!r||void 0===r[d])continue;q=!0}o[d]=r&&r[d]||n.style(a,d)}if(!n.isEmptyObject(o)){r?"hidden"in r&&(q=r.hidden):r=n._data(a,"fxshow",{}),f&&(r.hidden=!q),q?n(a).show():m.done(function(){n(a).hide()}),m.done(function(){var b;n._removeData(a,"fxshow");for(b in o)n.style(a,b,o[b])});for(d in o)g=ic(q?r[d]:0,d,m),d in r||(r[d]=g.start,q&&(g.end=g.start,g.start="width"===d||"height"===d?1:0))}}function kc(a,b){var c,d,e,f,g;for(c in a)if(d=n.camelCase(c),e=b[d],f=a[c],n.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=n.cssHooks[d],g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function lc(a,b,c){var d,e,f=0,g=ec.length,h=n.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=_b||gc(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;i>g;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),1>f&&i?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:n.extend({},b),opts:n.extend(!0,{specialEasing:{}},c),originalProperties:b,originalOptions:c,startTime:_b||gc(),duration:c.duration,tweens:[],createTween:function(b,c){var d=n.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;d>c;c++)j.tweens[c].run(1);return b?h.resolveWith(a,[j,b]):h.rejectWith(a,[j,b]),this}}),k=j.props;for(kc(k,j.opts.specialEasing);g>f;f++)if(d=ec[f].call(j,a,k,j.opts))return d;return n.map(k,ic,j),n.isFunction(j.opts.start)&&j.opts.start.call(a,j),n.fx.timer(n.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}n.Animation=n.extend(lc,{tweener:function(a,b){n.isFunction(a)?(b=a,a=["*"]):a=a.split(" ");for(var c,d=0,e=a.length;e>d;d++)c=a[d],fc[c]=fc[c]||[],fc[c].unshift(b)},prefilter:function(a,b){b?ec.unshift(a):ec.push(a)}}),n.speed=function(a,b,c){var d=a&&"object"==typeof a?n.extend({},a):{complete:c||!c&&b||n.isFunction(a)&&a,duration:a,easing:c&&b||b&&!n.isFunction(b)&&b};return d.duration=n.fx.off?0:"number"==typeof d.duration?d.duration:d.duration in n.fx.speeds?n.fx.speeds[d.duration]:n.fx.speeds._default,(null==d.queue||d.queue===!0)&&(d.queue="fx"),d.old=d.complete,d.complete=function(){n.isFunction(d.old)&&d.old.call(this),d.queue&&n.dequeue(this,d.queue)},d},n.fn.extend({fadeTo:function(a,b,c,d){return this.filter(V).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=n.isEmptyObject(a),f=n.speed(b,c,d),g=function(){var b=lc(this,n.extend({},a),f);(e||n._data(this,"finish"))&&b.stop(!0)};return g.finish=g,e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,b,c){var d=function(a){var b=a.stop;delete a.stop,b(c)};return"string"!=typeof a&&(c=b,b=a,a=void 0),b&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,e=null!=a&&a+"queueHooks",f=n.timers,g=n._data(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&dc.test(e)&&d(g[e]);for(e=f.length;e--;)f[e].elem!==this||null!=a&&f[e].queue!==a||(f[e].anim.stop(c),b=!1,f.splice(e,1));(b||!c)&&n.dequeue(this,a)})},finish:function(a){return a!==!1&&(a=a||"fx"),this.each(function(){var b,c=n._data(this),d=c[a+"queue"],e=c[a+"queueHooks"],f=n.timers,g=d?d.length:0;for(c.finish=!0,n.queue(this,a,[]),e&&e.stop&&e.stop.call(this,!0),b=f.length;b--;)f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1));for(b=0;g>b;b++)d[b]&&d[b].finish&&d[b].finish.call(this);delete c.finish})}}),n.each(["toggle","show","hide"],function(a,b){var c=n.fn[b];n.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(hc(b,!0),a,d,e)}}),n.each({slideDown:hc("show"),slideUp:hc("hide"),slideToggle:hc("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){n.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),n.timers=[],n.fx.tick=function(){var a,b=n.timers,c=0;for(_b=n.now();c<b.length;c++)a=b[c],a()||b[c]!==a||b.splice(c--,1);b.length||n.fx.stop(),_b=void 0},n.fx.timer=function(a){n.timers.push(a),a()?n.fx.start():n.timers.pop()},n.fx.interval=13,n.fx.start=function(){ac||(ac=setInterval(n.fx.tick,n.fx.interval))},n.fx.stop=function(){clearInterval(ac),ac=null},n.fx.speeds={slow:600,fast:200,_default:400},n.fn.delay=function(a,b){return a=n.fx?n.fx.speeds[a]||a:a,b=b||"fx",this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},function(){var a,b,c,d,e=z.createElement("div");e.setAttribute("className","t"),e.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",a=e.getElementsByTagName("a")[0],c=z.createElement("select"),d=c.appendChild(z.createElement("option")),b=e.getElementsByTagName("input")[0],a.style.cssText="top:1px",l.getSetAttribute="t"!==e.className,l.style=/top/.test(a.getAttribute("style")),l.hrefNormalized="/a"===a.getAttribute("href"),l.checkOn=!!b.value,l.optSelected=d.selected,l.enctype=!!z.createElement("form").enctype,c.disabled=!0,l.optDisabled=!d.disabled,b=z.createElement("input"),b.setAttribute("value",""),l.input=""===b.getAttribute("value"),b.value="t",b.setAttribute("type","radio"),l.radioValue="t"===b.value,a=b=c=d=e=null}();var mc=/\r/g;n.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=n.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,n(this).val()):a,null==e?e="":"number"==typeof e?e+="":n.isArray(e)&&(e=n.map(e,function(a){return null==a?"":a+""})),b=n.valHooks[this.type]||n.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=n.valHooks[e.type]||n.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(mc,""):null==c?"":c)}}}),n.extend({valHooks:{option:{get:function(a){var b=n.find.attr(a,"value");return null!=b?b:n.text(a)}},select:{get:function(a){for(var b,c,d=a.options,e=a.selectedIndex,f="select-one"===a.type||0>e,g=f?null:[],h=f?e+1:d.length,i=0>e?h:f?e:0;h>i;i++)if(c=d[i],!(!c.selected&&i!==e||(l.optDisabled?c.disabled:null!==c.getAttribute("disabled"))||c.parentNode.disabled&&n.nodeName(c.parentNode,"optgroup"))){if(b=n(c).val(),f)return b;g.push(b)}return g},set:function(a,b){var c,d,e=a.options,f=n.makeArray(b),g=e.length;while(g--)if(d=e[g],n.inArray(n.valHooks.option.get(d),f)>=0)try{d.selected=c=!0}catch(h){d.scrollHeight}else d.selected=!1;return c||(a.selectedIndex=-1),e}}}}),n.each(["radio","checkbox"],function(){n.valHooks[this]={set:function(a,b){return n.isArray(b)?a.checked=n.inArray(n(a).val(),b)>=0:void 0}},l.checkOn||(n.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})});var nc,oc,pc=n.expr.attrHandle,qc=/^(?:checked|selected)$/i,rc=l.getSetAttribute,sc=l.input;n.fn.extend({attr:function(a,b){return W(this,n.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){n.removeAttr(this,a)})}}),n.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(a&&3!==f&&8!==f&&2!==f)return typeof a.getAttribute===L?n.prop(a,b,c):(1===f&&n.isXMLDoc(a)||(b=b.toLowerCase(),d=n.attrHooks[b]||(n.expr.match.bool.test(b)?oc:nc)),void 0===c?d&&"get"in d&&null!==(e=d.get(a,b))?e:(e=n.find.attr(a,b),null==e?void 0:e):null!==c?d&&"set"in d&&void 0!==(e=d.set(a,c,b))?e:(a.setAttribute(b,c+""),c):void n.removeAttr(a,b))},removeAttr:function(a,b){var c,d,e=0,f=b&&b.match(F);if(f&&1===a.nodeType)while(c=f[e++])d=n.propFix[c]||c,n.expr.match.bool.test(c)?sc&&rc||!qc.test(c)?a[d]=!1:a[n.camelCase("default-"+c)]=a[d]=!1:n.attr(a,c,""),a.removeAttribute(rc?c:d)},attrHooks:{type:{set:function(a,b){if(!l.radioValue&&"radio"===b&&n.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}}}),oc={set:function(a,b,c){return b===!1?n.removeAttr(a,c):sc&&rc||!qc.test(c)?a.setAttribute(!rc&&n.propFix[c]||c,c):a[n.camelCase("default-"+c)]=a[c]=!0,c}},n.each(n.expr.match.bool.source.match(/\w+/g),function(a,b){var c=pc[b]||n.find.attr;pc[b]=sc&&rc||!qc.test(b)?function(a,b,d){var e,f;return d||(f=pc[b],pc[b]=e,e=null!=c(a,b,d)?b.toLowerCase():null,pc[b]=f),e}:function(a,b,c){return c?void 0:a[n.camelCase("default-"+b)]?b.toLowerCase():null}}),sc&&rc||(n.attrHooks.value={set:function(a,b,c){return n.nodeName(a,"input")?void(a.defaultValue=b):nc&&nc.set(a,b,c)}}),rc||(nc={set:function(a,b,c){var d=a.getAttributeNode(c);return d||a.setAttributeNode(d=a.ownerDocument.createAttribute(c)),d.value=b+="","value"===c||b===a.getAttribute(c)?b:void 0}},pc.id=pc.name=pc.coords=function(a,b,c){var d;return c?void 0:(d=a.getAttributeNode(b))&&""!==d.value?d.value:null},n.valHooks.button={get:function(a,b){var c=a.getAttributeNode(b);return c&&c.specified?c.value:void 0},set:nc.set},n.attrHooks.contenteditable={set:function(a,b,c){nc.set(a,""===b?!1:b,c)}},n.each(["width","height"],function(a,b){n.attrHooks[b]={set:function(a,c){return""===c?(a.setAttribute(b,"auto"),c):void 0}}})),l.style||(n.attrHooks.style={get:function(a){return a.style.cssText||void 0},set:function(a,b){return a.style.cssText=b+""}});var tc=/^(?:input|select|textarea|button|object)$/i,uc=/^(?:a|area)$/i;n.fn.extend({prop:function(a,b){return W(this,n.prop,a,b,arguments.length>1)},removeProp:function(a){return a=n.propFix[a]||a,this.each(function(){try{this[a]=void 0,delete this[a]}catch(b){}})}}),n.extend({propFix:{"for":"htmlFor","class":"className"},prop:function(a,b,c){var d,e,f,g=a.nodeType;if(a&&3!==g&&8!==g&&2!==g)return f=1!==g||!n.isXMLDoc(a),f&&(b=n.propFix[b]||b,e=n.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){var b=n.find.attr(a,"tabindex");return b?parseInt(b,10):tc.test(a.nodeName)||uc.test(a.nodeName)&&a.href?0:-1}}}}),l.hrefNormalized||n.each(["href","src"],function(a,b){n.propHooks[b]={get:function(a){return a.getAttribute(b,4)}}}),l.optSelected||(n.propHooks.selected={get:function(a){var b=a.parentNode;return b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex),null}}),n.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){n.propFix[this.toLowerCase()]=this}),l.enctype||(n.propFix.enctype="encoding");var vc=/[\t\r\n\f]/g;n.fn.extend({addClass:function(a){var b,c,d,e,f,g,h=0,i=this.length,j="string"==typeof a&&a;if(n.isFunction(a))return this.each(function(b){n(this).addClass(a.call(this,b,this.className))});if(j)for(b=(a||"").match(F)||[];i>h;h++)if(c=this[h],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(vc," "):" ")){f=0;while(e=b[f++])d.indexOf(" "+e+" ")<0&&(d+=e+" ");g=n.trim(d),c.className!==g&&(c.className=g)}return this},removeClass:function(a){var b,c,d,e,f,g,h=0,i=this.length,j=0===arguments.length||"string"==typeof a&&a;if(n.isFunction(a))return this.each(function(b){n(this).removeClass(a.call(this,b,this.className))});if(j)for(b=(a||"").match(F)||[];i>h;h++)if(c=this[h],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(vc," "):"")){f=0;while(e=b[f++])while(d.indexOf(" "+e+" ")>=0)d=d.replace(" "+e+" "," ");g=a?n.trim(d):"",c.className!==g&&(c.className=g)}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):this.each(n.isFunction(a)?function(c){n(this).toggleClass(a.call(this,c,this.className,b),b)}:function(){if("string"===c){var b,d=0,e=n(this),f=a.match(F)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else(c===L||"boolean"===c)&&(this.className&&n._data(this,"__className__",this.className),this.className=this.className||a===!1?"":n._data(this,"__className__")||"")})},hasClass:function(a){for(var b=" "+a+" ",c=0,d=this.length;d>c;c++)if(1===this[c].nodeType&&(" "+this[c].className+" ").replace(vc," ").indexOf(b)>=0)return!0;return!1}}),n.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){n.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),n.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)}});var wc=n.now(),xc=/\?/,yc=/(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;n.parseJSON=function(b){if(a.JSON&&a.JSON.parse)return a.JSON.parse(b+"");var c,d=null,e=n.trim(b+"");return e&&!n.trim(e.replace(yc,function(a,b,e,f){return c&&b&&(d=0),0===d?a:(c=e||b,d+=!f-!e,"")}))?Function("return "+e)():n.error("Invalid JSON: "+b)},n.parseXML=function(b){var c,d;if(!b||"string"!=typeof b)return null;try{a.DOMParser?(d=new DOMParser,c=d.parseFromString(b,"text/xml")):(c=new ActiveXObject("Microsoft.XMLDOM"),c.async="false",c.loadXML(b))}catch(e){c=void 0}return c&&c.documentElement&&!c.getElementsByTagName("parsererror").length||n.error("Invalid XML: "+b),c};var zc,Ac,Bc=/#.*$/,Cc=/([?&])_=[^&]*/,Dc=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Ec=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Fc=/^(?:GET|HEAD)$/,Gc=/^\/\//,Hc=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,Ic={},Jc={},Kc="*/".concat("*");try{Ac=location.href}catch(Lc){Ac=z.createElement("a"),Ac.href="",Ac=Ac.href}zc=Hc.exec(Ac.toLowerCase())||[];function Mc(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(F)||[];if(n.isFunction(c))while(d=f[e++])"+"===d.charAt(0)?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function Nc(a,b,c,d){var e={},f=a===Jc;function g(h){var i;return e[h]=!0,n.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function Oc(a,b){var c,d,e=n.ajaxSettings.flatOptions||{};for(d in b)void 0!==b[d]&&((e[d]?a:c||(c={}))[d]=b[d]);return c&&n.extend(!0,a,c),a}function Pc(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===e&&(e=a.mimeType||b.getResponseHeader("Content-Type"));if(e)for(g in h)if(h[g]&&h[g].test(e)){i.unshift(g);break}if(i[0]in c)f=i[0];else{for(g in c){if(!i[0]||a.converters[g+" "+i[0]]){f=g;break}d||(d=g)}f=f||d}return f?(f!==i[0]&&i.unshift(f),c[f]):void 0}function Qc(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}n.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Ac,type:"GET",isLocal:Ec.test(zc[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Kc,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":n.parseJSON,"text xml":n.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?Oc(Oc(a,n.ajaxSettings),b):Oc(n.ajaxSettings,a)},ajaxPrefilter:Mc(Ic),ajaxTransport:Mc(Jc),ajax:function(a,b){"object"==typeof a&&(b=a,a=void 0),b=b||{};var c,d,e,f,g,h,i,j,k=n.ajaxSetup({},b),l=k.context||k,m=k.context&&(l.nodeType||l.jquery)?n(l):n.event,o=n.Deferred(),p=n.Callbacks("once memory"),q=k.statusCode||{},r={},s={},t=0,u="canceled",v={readyState:0,getResponseHeader:function(a){var b;if(2===t){if(!j){j={};while(b=Dc.exec(f))j[b[1].toLowerCase()]=b[2]}b=j[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return 2===t?f:null},setRequestHeader:function(a,b){var c=a.toLowerCase();return t||(a=s[c]=s[c]||a,r[a]=b),this},overrideMimeType:function(a){return t||(k.mimeType=a),this},statusCode:function(a){var b;if(a)if(2>t)for(b in a)q[b]=[q[b],a[b]];else v.always(a[v.status]);return this},abort:function(a){var b=a||u;return i&&i.abort(b),x(0,b),this}};if(o.promise(v).complete=p.add,v.success=v.done,v.error=v.fail,k.url=((a||k.url||Ac)+"").replace(Bc,"").replace(Gc,zc[1]+"//"),k.type=b.method||b.type||k.method||k.type,k.dataTypes=n.trim(k.dataType||"*").toLowerCase().match(F)||[""],null==k.crossDomain&&(c=Hc.exec(k.url.toLowerCase()),k.crossDomain=!(!c||c[1]===zc[1]&&c[2]===zc[2]&&(c[3]||("http:"===c[1]?"80":"443"))===(zc[3]||("http:"===zc[1]?"80":"443")))),k.data&&k.processData&&"string"!=typeof k.data&&(k.data=n.param(k.data,k.traditional)),Nc(Ic,k,b,v),2===t)return v;h=k.global,h&&0===n.active++&&n.event.trigger("ajaxStart"),k.type=k.type.toUpperCase(),k.hasContent=!Fc.test(k.type),e=k.url,k.hasContent||(k.data&&(e=k.url+=(xc.test(e)?"&":"?")+k.data,delete k.data),k.cache===!1&&(k.url=Cc.test(e)?e.replace(Cc,"$1_="+wc++):e+(xc.test(e)?"&":"?")+"_="+wc++)),k.ifModified&&(n.lastModified[e]&&v.setRequestHeader("If-Modified-Since",n.lastModified[e]),n.etag[e]&&v.setRequestHeader("If-None-Match",n.etag[e])),(k.data&&k.hasContent&&k.contentType!==!1||b.contentType)&&v.setRequestHeader("Content-Type",k.contentType),v.setRequestHeader("Accept",k.dataTypes[0]&&k.accepts[k.dataTypes[0]]?k.accepts[k.dataTypes[0]]+("*"!==k.dataTypes[0]?", "+Kc+"; q=0.01":""):k.accepts["*"]);for(d in k.headers)v.setRequestHeader(d,k.headers[d]);if(k.beforeSend&&(k.beforeSend.call(l,v,k)===!1||2===t))return v.abort();u="abort";for(d in{success:1,error:1,complete:1})v[d](k[d]);if(i=Nc(Jc,k,b,v)){v.readyState=1,h&&m.trigger("ajaxSend",[v,k]),k.async&&k.timeout>0&&(g=setTimeout(function(){v.abort("timeout")},k.timeout));try{t=1,i.send(r,x)}catch(w){if(!(2>t))throw w;x(-1,w)}}else x(-1,"No Transport");function x(a,b,c,d){var j,r,s,u,w,x=b;2!==t&&(t=2,g&&clearTimeout(g),i=void 0,f=d||"",v.readyState=a>0?4:0,j=a>=200&&300>a||304===a,c&&(u=Pc(k,v,c)),u=Qc(k,u,v,j),j?(k.ifModified&&(w=v.getResponseHeader("Last-Modified"),w&&(n.lastModified[e]=w),w=v.getResponseHeader("etag"),w&&(n.etag[e]=w)),204===a||"HEAD"===k.type?x="nocontent":304===a?x="notmodified":(x=u.state,r=u.data,s=u.error,j=!s)):(s=x,(a||!x)&&(x="error",0>a&&(a=0))),v.status=a,v.statusText=(b||x)+"",j?o.resolveWith(l,[r,x,v]):o.rejectWith(l,[v,x,s]),v.statusCode(q),q=void 0,h&&m.trigger(j?"ajaxSuccess":"ajaxError",[v,k,j?r:s]),p.fireWith(l,[v,x]),h&&(m.trigger("ajaxComplete",[v,k]),--n.active||n.event.trigger("ajaxStop")))}return v},getJSON:function(a,b,c){return n.get(a,b,c,"json")},getScript:function(a,b){return n.get(a,void 0,b,"script")}}),n.each(["get","post"],function(a,b){n[b]=function(a,c,d,e){return n.isFunction(c)&&(e=e||d,d=c,c=void 0),n.ajax({url:a,type:b,dataType:e,data:c,success:d})}}),n.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){n.fn[b]=function(a){return this.on(b,a)}}),n._evalUrl=function(a){return n.ajax({url:a,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})},n.fn.extend({wrapAll:function(a){if(n.isFunction(a))return this.each(function(b){n(this).wrapAll(a.call(this,b))});if(this[0]){var b=n(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&1===a.firstChild.nodeType)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){return this.each(n.isFunction(a)?function(b){n(this).wrapInner(a.call(this,b))}:function(){var b=n(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=n.isFunction(a);return this.each(function(c){n(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){n.nodeName(this,"body")||n(this).replaceWith(this.childNodes)}).end()}}),n.expr.filters.hidden=function(a){return a.offsetWidth<=0&&a.offsetHeight<=0||!l.reliableHiddenOffsets()&&"none"===(a.style&&a.style.display||n.css(a,"display"))},n.expr.filters.visible=function(a){return!n.expr.filters.hidden(a)};var Rc=/%20/g,Sc=/\[\]$/,Tc=/\r?\n/g,Uc=/^(?:submit|button|image|reset|file)$/i,Vc=/^(?:input|select|textarea|keygen)/i;function Wc(a,b,c,d){var e;if(n.isArray(b))n.each(b,function(b,e){c||Sc.test(a)?d(a,e):Wc(a+"["+("object"==typeof e?b:"")+"]",e,c,d)});else if(c||"object"!==n.type(b))d(a,b);else for(e in b)Wc(a+"["+e+"]",b[e],c,d)}n.param=function(a,b){var c,d=[],e=function(a,b){b=n.isFunction(b)?b():null==b?"":b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};if(void 0===b&&(b=n.ajaxSettings&&n.ajaxSettings.traditional),n.isArray(a)||a.jquery&&!n.isPlainObject(a))n.each(a,function(){e(this.name,this.value)});else for(c in a)Wc(c,a[c],b,e);return d.join("&").replace(Rc,"+")},n.fn.extend({serialize:function(){return n.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=n.prop(this,"elements");return a?n.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!n(this).is(":disabled")&&Vc.test(this.nodeName)&&!Uc.test(a)&&(this.checked||!X.test(a))}).map(function(a,b){var c=n(this).val();return null==c?null:n.isArray(c)?n.map(c,function(a){return{name:b.name,value:a.replace(Tc,"\r\n")}}):{name:b.name,value:c.replace(Tc,"\r\n")}}).get()}}),n.ajaxSettings.xhr=void 0!==a.ActiveXObject?function(){return!this.isLocal&&/^(get|post|head|put|delete|options)$/i.test(this.type)&&$c()||_c()}:$c;var Xc=0,Yc={},Zc=n.ajaxSettings.xhr();a.ActiveXObject&&n(a).on("unload",function(){for(var a in Yc)Yc[a](void 0,!0)}),l.cors=!!Zc&&"withCredentials"in Zc,Zc=l.ajax=!!Zc,Zc&&n.ajaxTransport(function(a){if(!a.crossDomain||l.cors){var b;return{send:function(c,d){var e,f=a.xhr(),g=++Xc;if(f.open(a.type,a.url,a.async,a.username,a.password),a.xhrFields)for(e in a.xhrFields)f[e]=a.xhrFields[e];a.mimeType&&f.overrideMimeType&&f.overrideMimeType(a.mimeType),a.crossDomain||c["X-Requested-With"]||(c["X-Requested-With"]="XMLHttpRequest");for(e in c)void 0!==c[e]&&f.setRequestHeader(e,c[e]+"");f.send(a.hasContent&&a.data||null),b=function(c,e){var h,i,j;if(b&&(e||4===f.readyState))if(delete Yc[g],b=void 0,f.onreadystatechange=n.noop,e)4!==f.readyState&&f.abort();else{j={},h=f.status,"string"==typeof f.responseText&&(j.text=f.responseText);try{i=f.statusText}catch(k){i=""}h||!a.isLocal||a.crossDomain?1223===h&&(h=204):h=j.text?200:404}j&&d(h,i,j,f.getAllResponseHeaders())},a.async?4===f.readyState?setTimeout(b):f.onreadystatechange=Yc[g]=b:b()},abort:function(){b&&b(void 0,!0)}}}});function $c(){try{return new a.XMLHttpRequest}catch(b){}}function _c(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}n.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(a){return n.globalEval(a),a}}}),n.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),n.ajaxTransport("script",function(a){if(a.crossDomain){var b,c=z.head||n("head")[0]||z.documentElement;return{send:function(d,e){b=z.createElement("script"),b.async=!0,a.scriptCharset&&(b.charset=a.scriptCharset),b.src=a.url,b.onload=b.onreadystatechange=function(a,c){(c||!b.readyState||/loaded|complete/.test(b.readyState))&&(b.onload=b.onreadystatechange=null,b.parentNode&&b.parentNode.removeChild(b),b=null,c||e(200,"success"))},c.insertBefore(b,c.firstChild)},abort:function(){b&&b.onload(void 0,!0)}}}});var ad=[],bd=/(=)\?(?=&|$)|\?\?/;n.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=ad.pop()||n.expando+"_"+wc++;return this[a]=!0,a}}),n.ajaxPrefilter("json jsonp",function(b,c,d){var e,f,g,h=b.jsonp!==!1&&(bd.test(b.url)?"url":"string"==typeof b.data&&!(b.contentType||"").indexOf("application/x-www-form-urlencoded")&&bd.test(b.data)&&"data");return h||"jsonp"===b.dataTypes[0]?(e=b.jsonpCallback=n.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h?b[h]=b[h].replace(bd,"$1"+e):b.jsonp!==!1&&(b.url+=(xc.test(b.url)?"&":"?")+b.jsonp+"="+e),b.converters["script json"]=function(){return g||n.error(e+" was not called"),g[0]},b.dataTypes[0]="json",f=a[e],a[e]=function(){g=arguments},d.always(function(){a[e]=f,b[e]&&(b.jsonpCallback=c.jsonpCallback,ad.push(e)),g&&n.isFunction(f)&&f(g[0]),g=f=void 0}),"script"):void 0}),n.parseHTML=function(a,b,c){if(!a||"string"!=typeof a)return null;"boolean"==typeof b&&(c=b,b=!1),b=b||z;var d=v.exec(a),e=!c&&[];return d?[b.createElement(d[1])]:(d=n.buildFragment([a],b,e),e&&e.length&&n(e).remove(),n.merge([],d.childNodes))};var cd=n.fn.load;n.fn.load=function(a,b,c){if("string"!=typeof a&&cd)return cd.apply(this,arguments);var d,e,f,g=this,h=a.indexOf(" ");return h>=0&&(d=a.slice(h,a.length),a=a.slice(0,h)),n.isFunction(b)?(c=b,b=void 0):b&&"object"==typeof b&&(f="POST"),g.length>0&&n.ajax({url:a,type:f,dataType:"html",data:b}).done(function(a){e=arguments,g.html(d?n("<div>").append(n.parseHTML(a)).find(d):a)}).complete(c&&function(a,b){g.each(c,e||[a.responseText,b,a])}),this},n.expr.filters.animated=function(a){return n.grep(n.timers,function(b){return a===b.elem}).length};var dd=a.document.documentElement;function ed(a){return n.isWindow(a)?a:9===a.nodeType?a.defaultView||a.parentWindow:!1}n.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=n.css(a,"position"),l=n(a),m={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=n.css(a,"top"),i=n.css(a,"left"),j=("absolute"===k||"fixed"===k)&&n.inArray("auto",[f,i])>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),n.isFunction(b)&&(b=b.call(a,c,h)),null!=b.top&&(m.top=b.top-h.top+g),null!=b.left&&(m.left=b.left-h.left+e),"using"in b?b.using.call(a,m):l.css(m)}},n.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){n.offset.setOffset(this,a,b)});var b,c,d={top:0,left:0},e=this[0],f=e&&e.ownerDocument;if(f)return b=f.documentElement,n.contains(b,e)?(typeof e.getBoundingClientRect!==L&&(d=e.getBoundingClientRect()),c=ed(f),{top:d.top+(c.pageYOffset||b.scrollTop)-(b.clientTop||0),left:d.left+(c.pageXOffset||b.scrollLeft)-(b.clientLeft||0)}):d},position:function(){if(this[0]){var a,b,c={top:0,left:0},d=this[0];return"fixed"===n.css(d,"position")?b=d.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),n.nodeName(a[0],"html")||(c=a.offset()),c.top+=n.css(a[0],"borderTopWidth",!0),c.left+=n.css(a[0],"borderLeftWidth",!0)),{top:b.top-c.top-n.css(d,"marginTop",!0),left:b.left-c.left-n.css(d,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||dd;while(a&&!n.nodeName(a,"html")&&"static"===n.css(a,"position"))a=a.offsetParent;return a||dd})}}),n.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,b){var c=/Y/.test(b);n.fn[a]=function(d){return W(this,function(a,d,e){var f=ed(a);return void 0===e?f?b in f?f[b]:f.document.documentElement[d]:a[d]:void(f?f.scrollTo(c?n(f).scrollLeft():e,c?e:n(f).scrollTop()):a[d]=e)},a,d,arguments.length,null)}}),n.each(["top","left"],function(a,b){n.cssHooks[b]=Mb(l.pixelPosition,function(a,c){return c?(c=Kb(a,b),Ib.test(c)?n(a).position()[b]+"px":c):void 0})}),n.each({Height:"height",Width:"width"},function(a,b){n.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){n.fn[d]=function(d,e){var f=arguments.length&&(c||"boolean"!=typeof d),g=c||(d===!0||e===!0?"margin":"border");return W(this,function(b,c,d){var e;return n.isWindow(b)?b.document.documentElement["client"+a]:9===b.nodeType?(e=b.documentElement,Math.max(b.body["scroll"+a],e["scroll"+a],b.body["offset"+a],e["offset"+a],e["client"+a])):void 0===d?n.css(b,c,g):n.style(b,c,d,g)},b,f?d:void 0,f,null)}})}),n.fn.size=function(){return this.length},n.fn.andSelf=n.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return n});var fd=a.jQuery,gd=a.$;return n.noConflict=function(b){return a.$===n&&(a.$=gd),b&&a.jQuery===n&&(a.jQuery=fd),n},typeof b===L&&(a.jQuery=a.$=n),n});
diff --git a/phpBB/assets/javascript/plupload.js b/phpBB/assets/javascript/plupload.js
new file mode 100644
index 0000000000..8b3543880f
--- /dev/null
+++ b/phpBB/assets/javascript/plupload.js
@@ -0,0 +1,657 @@
+/* global phpbb, plupload, attachInline */
+
+plupload.addI18n(phpbb.plupload.i18n);
+phpbb.plupload.ids = [];
+
+(function($) { // Avoid conflicts with other libraries
+
+'use strict';
+
+/**
+ * Set up the uploader.
+ */
+phpbb.plupload.initialize = function() {
+ // Initialize the Plupload uploader.
+ phpbb.plupload.uploader.init();
+
+ // Set attachment data.
+ phpbb.plupload.setData(phpbb.plupload.data);
+ phpbb.plupload.updateMultipartParams(phpbb.plupload.getSerializedData());
+
+ // Only execute if Plupload initialized successfully.
+ phpbb.plupload.uploader.bind('Init', function() {
+ phpbb.plupload.form = $(phpbb.plupload.config.form_hook)[0];
+ phpbb.plupload.rowTpl = $('#attach-row-tpl')[0].outerHTML;
+
+ // Hide the basic upload panel and remove the attach row template.
+ $('#attach-row-tpl, #attach-panel-basic').remove();
+ // Show multi-file upload options.
+ $('#attach-panel-multi').show();
+ });
+
+ phpbb.plupload.uploader.bind('PostInit', function() {
+ // Point out the drag-and-drop zone if it's supported.
+ if (phpbb.plupload.uploader.features.dragdrop) {
+ $('#drag-n-drop-message').show();
+ }
+
+ // Ensure "Add files" button position is correctly calculated.
+ if ($('#attach-panel-multi').is(':visible')) {
+ phpbb.plupload.uploader.refresh();
+ }
+ $('[data-subpanel="attach-panel"]').one('click', function() {
+ phpbb.plupload.uploader.refresh();
+ });
+ });
+};
+
+/**
+ * Unsets all elements in the object uploader.settings.multipart_params whose keys
+ * begin with 'attachment_data['
+ */
+phpbb.plupload.clearParams = function() {
+ var obj = phpbb.plupload.uploader.settings.multipart_params;
+ for (var key in obj) {
+ if (!obj.hasOwnProperty(key) || key.indexOf('attachment_data[') !== 0) {
+ continue;
+ }
+
+ delete phpbb.plupload.uploader.settings.multipart_params[key];
+ }
+};
+
+/**
+ * Update uploader.settings.multipart_params object with new data.
+ *
+ * @param {object} obj
+ */
+phpbb.plupload.updateMultipartParams = function(obj) {
+ var settings = phpbb.plupload.uploader.settings;
+ settings.multipart_params = $.extend(settings.multipart_params, obj);
+};
+
+/**
+ * Convert the array of attachment objects into an object that PHP would expect as POST data.
+ *
+ * @returns {object} An object in the form 'attachment_data[i][key]': value as
+ * expected by the server
+ */
+phpbb.plupload.getSerializedData = function() {
+ var obj = {};
+ for (var i = 0; i < phpbb.plupload.data.length; i++) {
+ var datum = phpbb.plupload.data[i];
+ for (var key in datum) {
+ if (!datum.hasOwnProperty(key)) {
+ continue;
+ }
+
+ obj['attachment_data[' + i + '][' + key + ']'] = datum[key];
+ }
+ }
+ return obj;
+};
+
+/**
+ * Get the index from the phpbb.plupload.data array where the given
+ * attachment id appears.
+ *
+ * @param {int} attachId The attachment id of the file.
+ * @returns {bool|int} Index of the file if exists, otherwise false.
+ */
+phpbb.plupload.getIndex = function(attachId) {
+ var index = $.inArray(Number(attachId), phpbb.plupload.ids);
+ return (index !== -1) ? index : false;
+};
+
+/**
+ * Set the data in phpbb.plupload.data and phpbb.plupload.ids arrays.
+ *
+ * @param {Array} data Array containing the new data to use. In the form of
+ * array(index => object(property: value). Requires attach_id to be one of the object properties.
+ */
+phpbb.plupload.setData = function(data) {
+ // Make sure that the array keys are reset.
+ phpbb.plupload.ids = phpbb.plupload.data = [];
+ phpbb.plupload.data = data;
+
+ for (var i = 0; i < data.length; i++) {
+ phpbb.plupload.ids.push(Number(data[i].attach_id));
+ }
+};
+
+/**
+ * Update the attachment data in the HTML and the phpbb & phpbb.plupload objects.
+ *
+ * @param {Array} data Array containing the new data to use.
+ * @param {string} action The action that required the update. Used to update the inline attachment bbcodes.
+ * @param {int} index The index from phpbb.plupload_ids that was affected by the action.
+ * @param {Array} downloadUrl Optional array of download urls to update.
+ */
+phpbb.plupload.update = function(data, action, index, downloadUrl) {
+
+ phpbb.plupload.updateBbcode(action, index);
+ phpbb.plupload.setData(data);
+ phpbb.plupload.updateRows(downloadUrl);
+ phpbb.plupload.clearParams();
+ phpbb.plupload.updateMultipartParams(phpbb.plupload.getSerializedData());
+};
+
+/**
+ * Update the relevant elements and hidden data for all attachments.
+ *
+ * @param {Array} downloadUrl Optional array of download urls to update.
+ */
+phpbb.plupload.updateRows = function(downloadUrl) {
+ for (var i = 0; i < phpbb.plupload.ids.length; i++) {
+ phpbb.plupload.updateRow(i, downloadUrl);
+ }
+};
+
+/**
+ * Insert a row for a new attachment. This expects an HTML snippet in the HTML
+ * using the id "attach-row-tpl" to be present. This snippet is cloned and the
+ * data for the file inserted into it. The row is then appended or prepended to
+ * #file-list based on the attach_order setting.
+ *
+ * @param {object} file Plupload file object for the new attachment.
+ */
+phpbb.plupload.insertRow = function(file) {
+ var row = $(phpbb.plupload.rowTpl);
+
+ row.attr('id', file.id);
+ row.find('.file-name').html(plupload.xmlEncode(file.name));
+ row.find('.file-size').html(plupload.formatSize(file.size));
+
+ if (phpbb.plupload.order === 'desc') {
+ $('#file-list').prepend(row);
+ } else {
+ $('#file-list').append(row);
+ }
+};
+
+/**
+ * Update the relevant elements and hidden data for an attachment.
+ *
+ * @param {int} index The index from phpbb.plupload.ids of the attachment to edit.
+ * @param {Array} downloadUrl Optional array of download urls to update.
+ */
+phpbb.plupload.updateRow = function(index, downloadUrl) {
+ var attach = phpbb.plupload.data[index],
+ row = $('[data-attach-id="' + attach.attach_id + '"]');
+
+ // Add the link to the file
+ if (typeof downloadUrl !== 'undefined' && typeof downloadUrl[index] !== 'undefined') {
+ var url = downloadUrl[index].replace('&amp;', '&'),
+ link = $('<a></a>');
+
+ link.attr('href', url).html(attach.real_filename);
+ row.find('.file-name').html(link);
+ }
+
+ row.find('textarea').attr('name', 'comment_list[' + index + ']');
+ phpbb.plupload.updateHiddenData(row, attach, index);
+};
+
+/**
+ * Update hidden input data for an attachment.
+ *
+ * @param {object} row jQuery object for the attachment row.
+ * @param {object} attach Attachment data object from phpbb.plupload.data
+ * @param {int} index Attachment index from phpbb.plupload.ids
+ */
+phpbb.plupload.updateHiddenData = function(row, attach, index) {
+ row.find('input[type="hidden"]').remove();
+
+ for (var key in attach) {
+ if (!attach.hasOwnProperty(key)) {
+ return;
+ }
+
+ var input = $('<input />')
+ .attr('type', 'hidden')
+ .attr('name', 'attachment_data[' + index + '][' + key + ']')
+ .attr('value', attach[key]);
+ $('textarea', row).after(input);
+ }
+};
+
+/**
+ * Deleting a file removes it from the queue and fires an AJAX event to the
+ * server to tell it to remove the temporary attachment. The server
+ * responds with the updated attachment data list so that any future
+ * uploads can maintain state with the server
+ *
+ * @param {object} row jQuery object for the attachment row.
+ * @param {int} attachId Attachment id of the file to be removed.
+ */
+phpbb.plupload.deleteFile = function(row, attachId) {
+ // If there's no attach id, then the file hasn't been uploaded. Simply delete the row.
+ if (typeof attachId === 'undefined') {
+ var file = phpbb.plupload.uploader.getFile(row.attr('id'));
+ phpbb.plupload.uploader.removeFile(file);
+
+ row.slideUp(100, function() {
+ row.remove();
+ phpbb.plupload.hideEmptyList();
+ });
+ }
+
+ var index = phpbb.plupload.getIndex(attachId);
+ row.find('.file-status').toggleClass('file-uploaded file-working');
+
+ if (index === false) {
+ return;
+ }
+ var fields = {};
+ fields['delete_file[' + index + ']'] = 1;
+
+ var always = function() {
+ row.find('.file-status').removeClass('file-working');
+ };
+
+ var done = function(response) {
+ if (typeof response !== 'object') {
+ return;
+ }
+
+ // trigger_error() was called which likely means a permission error was encountered.
+ if (typeof response.title !== 'undefined') {
+ phpbb.plupload.uploader.trigger('Error', { message: response.message });
+ // We will have to assume that the deletion failed. So leave the file status as uploaded.
+ row.find('.file-status').toggleClass('file-uploaded');
+
+ return;
+ }
+ phpbb.plupload.update(response, 'removal', index);
+ // Check if the user can upload files now if he had reached the max files limit.
+ phpbb.plupload.handleMaxFilesReached();
+
+ if (row.attr('id')) {
+ var file = phpbb.plupload.uploader.getFile(row.attr('id'));
+ phpbb.plupload.uploader.removeFile(file);
+ }
+ row.slideUp(100, function() {
+ row.remove();
+ // Hide the file list if it's empty now.
+ phpbb.plupload.hideEmptyList();
+ });
+ phpbb.plupload.uploader.trigger('FilesRemoved');
+ };
+
+ $.ajax(phpbb.plupload.config.url, {
+ type: 'POST',
+ data: $.extend(fields, phpbb.plupload.getSerializedData()),
+ headers: phpbb.plupload.config.headers
+ })
+ .always(always)
+ .done(done);
+};
+
+/**
+ * Check the attachment list and hide its container if it's empty.
+ */
+phpbb.plupload.hideEmptyList = function() {
+ if (!$('#file-list').children().length) {
+ $('#file-list-container').slideUp(100);
+ }
+};
+
+/**
+ * Update the indices used in inline attachment bbcodes. This ensures that the
+ * bbcodes correspond to the correct file after a file is added or removed.
+ * This should be called before the phpbb.plupload,data and phpbb.plupload.ids
+ * arrays are updated, otherwise it will not work correctly.
+ *
+ * @param {string} action The action that occurred -- either "addition" or "removal"
+ * @param {int} index The index of the attachment from phpbb.plupload.ids that was affected.
+ */
+phpbb.plupload.updateBbcode = function(action, index) {
+ var textarea = $('#message', phpbb.plupload.form),
+ text = textarea.val(),
+ removal = (action === 'removal');
+
+ // Return if the bbcode isn't used at all.
+ if (text.indexOf('[attachment=') === -1) {
+ return;
+ }
+
+ function runUpdate(i) {
+ var regex = new RegExp('\\[attachment=' + i + '\\](.*?)\\[\\/attachment\\]', 'g');
+ text = text.replace(regex, function updateBbcode(_, fileName) {
+ // Remove the bbcode if the file was removed.
+ if (removal && index === i) {
+ return '';
+ }
+ var newIndex = i + ((removal) ? -1 : 1);
+ return '[attachment=' + newIndex + ']' + fileName + '[/attachment]';
+ });
+ }
+
+ // Loop forwards when removing and backwards when adding ensures we don't
+ // corrupt the bbcode index.
+ var i;
+ if (removal) {
+ for (i = index; i < phpbb.plupload.ids.length; i++) {
+ runUpdate(i);
+ }
+ } else {
+ for (i = phpbb.plupload.ids.length - 1; i >= index; i--) {
+ runUpdate(i);
+ }
+ }
+
+ textarea.val(text);
+};
+
+/**
+ * Get Plupload file objects based on their upload status.
+ *
+ * @param {int} status Plupload status - plupload.DONE, plupload.FAILED,
+ * plupload.QUEUED, plupload.STARTED, plupload.STOPPED
+ *
+ * @returns {Array} The Plupload file objects matching the status.
+ */
+phpbb.plupload.getFilesByStatus = function(status) {
+ var files = [];
+
+ $.each(phpbb.plupload.uploader.files, function(i, file) {
+ if (file.status === status) {
+ files.push(file);
+ }
+ });
+ return files;
+};
+
+/**
+ * Check whether the user has reached the maximun number of files that he's allowed
+ * to upload. If so, disables the uploader and marks the queued files as failed. Otherwise
+ * makes sure that the uploader is enabled.
+ *
+ * @returns {bool} True if the limit has been reached. False if otherwise.
+ */
+phpbb.plupload.handleMaxFilesReached = function() {
+ // If there is no limit, the user is an admin or moderator.
+ if (!phpbb.plupload.maxFiles) {
+ return false;
+ }
+
+ if (phpbb.plupload.maxFiles <= phpbb.plupload.ids.length) {
+ // Fail the rest of the queue.
+ phpbb.plupload.markQueuedFailed(phpbb.plupload.lang.TOO_MANY_ATTACHMENTS);
+ // Disable the uploader.
+ phpbb.plupload.disableUploader();
+ phpbb.plupload.uploader.trigger('Error', { message: phpbb.plupload.lang.TOO_MANY_ATTACHMENTS });
+
+ return true;
+ } else if (phpbb.plupload.maxFiles > phpbb.plupload.ids.length) {
+ // Enable the uploader if the user is under the limit
+ phpbb.plupload.enableUploader();
+ }
+ return false;
+};
+
+/**
+ * Disable the uploader
+ */
+phpbb.plupload.disableUploader = function() {
+ $('#add_files').addClass('disabled');
+ phpbb.plupload.uploader.disableBrowse();
+};
+
+/**
+ * Enable the uploader
+ */
+phpbb.plupload.enableUploader = function() {
+ $('#add_files').removeClass('disabled');
+ phpbb.plupload.uploader.disableBrowse(false);
+};
+
+/**
+ * Mark all queued files as failed.
+ *
+ * @param {string} error Error message to present to the user.
+ */
+phpbb.plupload.markQueuedFailed = function(error) {
+ var files = phpbb.plupload.getFilesByStatus(plupload.QUEUED);
+
+ $.each(files, function(i, file) {
+ $('#' + file.id).find('.file-progress').hide();
+ phpbb.plupload.fileError(file, error);
+ });
+};
+
+/**
+ * Marks a file as failed and sets the error message for it.
+ *
+ * @param {object} file Plupload file object that failed.
+ * @param {string} error Error message to present to the user.
+ */
+phpbb.plupload.fileError = function(file, error) {
+ file.status = plupload.FAILED;
+ file.error = error;
+ $('#' + file.id).find('.file-status')
+ .addClass('file-error')
+ .attr({
+ 'data-error-title': phpbb.plupload.lang.ERROR,
+ 'data-error-message': error
+ });
+};
+
+
+/**
+ * Set up the Plupload object and get some basic data.
+ */
+phpbb.plupload.uploader = new plupload.Uploader(phpbb.plupload.config);
+phpbb.plupload.initialize();
+
+var $fileList = $('#file-list');
+
+/**
+ * Insert inline attachment bbcode.
+ */
+$fileList.on('click', '.file-inline-bbcode', function(e) {
+ var attachId = $(this).parents('.attach-row').attr('data-attach-id'),
+ index = phpbb.plupload.getIndex(attachId);
+
+ attachInline(index, phpbb.plupload.data[index].real_filename);
+ e.preventDefault();
+});
+
+/**
+ * Delete a file.
+ */
+$fileList.on('click', '.file-delete', function(e) {
+ var row = $(this).parents('.attach-row'),
+ attachId = row.attr('data-attach-id');
+
+ phpbb.plupload.deleteFile(row, attachId);
+ e.preventDefault();
+});
+
+/**
+ * Display the error message for a particular file when the error icon is clicked.
+ */
+$fileList.on('click', '.file-error', function(e) {
+ phpbb.alert($(this).attr('data-error-title'), $(this).attr('data-error-message'));
+ e.preventDefault();
+});
+
+/**
+ * Fires when an error occurs.
+ */
+phpbb.plupload.uploader.bind('Error', function(up, error) {
+ error.file.name = plupload.xmlEncode(error.file.name);
+
+ // The error message that Plupload provides for these is vague, so we'll be more specific.
+ if (error.code === plupload.FILE_EXTENSION_ERROR) {
+ error.message = plupload.translate('Invalid file extension:') + ' ' + error.file.name;
+ } else if (error.code === plupload.FILE_SIZE_ERROR) {
+ error.message = plupload.translate('File too large:') + ' ' + error.file.name;
+ }
+ phpbb.alert(phpbb.plupload.lang.ERROR, error.message);
+});
+
+/**
+ * Fires before a given file is about to be uploaded. This allows us to
+ * send the real filename along with the chunk. This is necessary because
+ * for some reason the filename is set to 'blob' whenever a file is chunked
+ *
+ * @param {object} up The plupload.Uploader object
+ * @param {object} file The plupload.File object that is about to be uploaded
+ */
+phpbb.plupload.uploader.bind('BeforeUpload', function(up, file) {
+ if (phpbb.plupload.handleMaxFilesReached()) {
+ return;
+ }
+
+ phpbb.plupload.updateMultipartParams({ real_filename: file.name });
+});
+
+/**
+ * Fired when a single chunk of any given file is uploaded. This parses the
+ * response from the server and checks for an error. If an error occurs it
+ * is reported to the user and the upload of this particular file is halted
+ *
+ * @param {object} up The plupload.Uploader object
+ * @param {object} file The plupload.File object whose chunk has just
+ * been uploaded
+ * @param {object} response The response object from the server
+ */
+phpbb.plupload.uploader.bind('ChunkUploaded', function(up, file, response) {
+ if (response.chunk >= response.chunks - 1) {
+ return;
+ }
+
+ var json = {};
+ try {
+ json = $.parseJSON(response.response);
+ } catch (e) {
+ file.status = plupload.FAILED;
+ up.trigger('FileUploaded', file, {
+ response: JSON.stringify({
+ error: {
+ message: 'Error parsing server response.'
+ }
+ })
+ });
+ }
+
+ // If trigger_error() was called, then a permission error likely occurred.
+ if (typeof json.title !== 'undefined') {
+ json.error = { message: json.message };
+ }
+
+ if (json.error) {
+ file.status = plupload.FAILED;
+ up.trigger('FileUploaded', file, {
+ response: JSON.stringify({
+ error: {
+ message: json.error.message
+ }
+ })
+ });
+ }
+});
+
+/**
+ * Fires when files are added to the queue.
+ */
+phpbb.plupload.uploader.bind('FilesAdded', function(up, files) {
+ // Prevent unnecessary requests to the server if the user already uploaded
+ // the maximum number of files allowed.
+ if (phpbb.plupload.handleMaxFilesReached()) {
+ return;
+ }
+
+ // Switch the active tab if the style supports it
+ if (typeof activateSubPanel === 'function') {
+ activateSubPanel('attach-panel'); // jshint ignore: line
+ }
+
+ // Show the file list if there aren't any files currently.
+ var $fileListContainer = $('#file-list-container');
+ if (!$fileListContainer.is(':visible')) {
+ $fileListContainer.show(100);
+ }
+
+ $.each(files, function(i, file) {
+ phpbb.plupload.insertRow(file);
+ });
+
+ up.bind('UploadProgress', function(up, file) {
+ $('.file-progress-bar', '#' + file.id).css('width', file.percent + '%');
+ $('#file-total-progress-bar').css('width', up.total.percent + '%');
+ });
+
+ // Do not allow more files to be added to the running queue.
+ phpbb.plupload.disableUploader();
+
+ // Start uploading the files once the user has selected them.
+ up.start();
+});
+
+
+/**
+ * Fires when an entire file has been uploaded. It checks for errors
+ * returned by the server otherwise parses the list of attachment data and
+ * appends it to the next file upload so that the server can maintain state
+ * with regards to the attachments in a given post
+ *
+ * @param {object} up The plupload.Uploader object
+ * @param {object} file The plupload.File object that has just been
+ * uploaded
+ * @param {string} response The response string from the server
+ */
+phpbb.plupload.uploader.bind('FileUploaded', function(up, file, response) {
+ var json = {},
+ row = $('#' + file.id),
+ error;
+
+ // Hide the progress indicator.
+ row.find('.file-progress').hide();
+
+ try {
+ json = JSON.parse(response.response);
+ } catch (e) {
+ error = 'Error parsing server response.';
+ }
+
+ // If trigger_error() was called, then a permission error likely occurred.
+ if (typeof json.title !== 'undefined') {
+ error = json.message;
+ up.trigger('Error', { message: error });
+
+ // The rest of the queue will fail.
+ phpbb.plupload.markQueuedFailed(error);
+ } else if (json.error) {
+ error = json.error.message;
+ }
+
+ if (typeof error !== 'undefined') {
+ phpbb.plupload.fileError(file, error);
+ } else if (file.status === plupload.DONE) {
+ file.attachment_data = json.data[0];
+
+ row.attr('data-attach-id', file.attachment_data.attach_id);
+ row.find('.file-inline-bbcode').show();
+ row.find('.file-status').addClass('file-uploaded');
+ phpbb.plupload.update(json.data, 'addition', 0, [json.download_url]);
+ }
+});
+
+/**
+ * Fires when the entire queue of files have been uploaded.
+ */
+phpbb.plupload.uploader.bind('UploadComplete', function() {
+ // Hide the progress bar
+ setTimeout(function() {
+ $('#file-total-progress-bar').fadeOut(500, function() {
+ $(this).css('width', 0).show();
+ });
+ }, 2000);
+
+ // Re-enable the uploader
+ phpbb.plupload.enableUploader();
+});
+
+})(jQuery); // Avoid conflicts with other libraries
diff --git a/phpBB/assets/plupload/plupload.full.min.js b/phpBB/assets/plupload/plupload.full.min.js
new file mode 100644
index 0000000000..2af434de4f
--- /dev/null
+++ b/phpBB/assets/plupload/plupload.full.min.js
@@ -0,0 +1,29 @@
+/**
+ * mOxie - multi-runtime File API & XMLHttpRequest L2 Polyfill
+ * v1.3.4
+ *
+ * Copyright 2013, Moxiecode Systems AB
+ * Released under GPL License.
+ *
+ * License: http://www.plupload.com/license
+ * Contributing: http://www.plupload.com/contributing
+ *
+ * Date: 2015-07-18
+ */
+!function(e,t){"use strict";function n(e,t){for(var n,i=[],r=0;r<e.length;++r){if(n=s[e[r]]||o(e[r]),!n)throw"module definition dependecy not found: "+e[r];i.push(n)}t.apply(null,i)}function i(e,i,r){if("string"!=typeof e)throw"invalid module definition, module id must be defined and be a string";if(i===t)throw"invalid module definition, dependencies must be specified";if(r===t)throw"invalid module definition, definition function must be specified";n(i,function(){s[e]=r.apply(null,arguments)})}function r(e){return!!s[e]}function o(t){for(var n=e,i=t.split(/[.\/]/),r=0;r<i.length;++r){if(!n[i[r]])return;n=n[i[r]]}return n}function a(n){for(var i=0;i<n.length;i++){for(var r=e,o=n[i],a=o.split(/[.\/]/),u=0;u<a.length-1;++u)r[a[u]]===t&&(r[a[u]]={}),r=r[a[u]];r[a[a.length-1]]=s[o]}}var s={},u="moxie/core/utils/Basic",c="moxie/core/utils/Env",l="moxie/core/I18n",d="moxie/core/utils/Mime",h="moxie/core/utils/Dom",f="moxie/core/Exceptions",p="moxie/core/EventTarget",m="moxie/runtime/Runtime",g="moxie/runtime/RuntimeClient",v="moxie/file/FileInput",w="moxie/core/utils/Encode",y="moxie/file/Blob",E="moxie/file/File",_="moxie/file/FileDrop",b="moxie/file/FileReader",x="moxie/core/utils/Url",R="moxie/runtime/RuntimeTarget",A="moxie/file/FileReaderSync",I="moxie/xhr/FormData",T="moxie/xhr/XMLHttpRequest",S="moxie/runtime/Transporter",O="moxie/image/Image",D="moxie/runtime/html5/Runtime",N="moxie/core/utils/Events",L="moxie/runtime/html5/file/FileInput",C="moxie/runtime/html5/file/Blob",M="moxie/runtime/html5/file/FileDrop",F="moxie/runtime/html5/file/FileReader",P="moxie/runtime/html5/xhr/XMLHttpRequest",H="moxie/runtime/html5/utils/BinaryReader",B="moxie/runtime/html5/image/JPEGHeaders",k="moxie/runtime/html5/image/ExifParser",U="moxie/runtime/html5/image/JPEG",G="moxie/runtime/html5/image/PNG",z="moxie/runtime/html5/image/ImageInfo",q="moxie/runtime/html5/image/MegaPixel",j="moxie/runtime/html5/image/Image",X="moxie/runtime/flash/Runtime",V="moxie/runtime/flash/file/FileInput",W="moxie/runtime/flash/file/Blob",Y="moxie/runtime/flash/file/FileReader",$="moxie/runtime/flash/file/FileReaderSync",J="moxie/runtime/flash/xhr/XMLHttpRequest",Z="moxie/runtime/flash/runtime/Transporter",K="moxie/runtime/flash/image/Image",Q="moxie/runtime/silverlight/Runtime",ee="moxie/runtime/silverlight/file/FileInput",te="moxie/runtime/silverlight/file/Blob",ne="moxie/runtime/silverlight/file/FileDrop",ie="moxie/runtime/silverlight/file/FileReader",re="moxie/runtime/silverlight/file/FileReaderSync",oe="moxie/runtime/silverlight/xhr/XMLHttpRequest",ae="moxie/runtime/silverlight/runtime/Transporter",se="moxie/runtime/silverlight/image/Image",ue="moxie/runtime/html4/Runtime",ce="moxie/runtime/html4/file/FileInput",le="moxie/runtime/html4/file/FileReader",de="moxie/runtime/html4/xhr/XMLHttpRequest",he="moxie/runtime/html4/image/Image";i(u,[],function(){var e=function(e){var t;return e===t?"undefined":null===e?"null":e.nodeType?"node":{}.toString.call(e).match(/\s([a-z|A-Z]+)/)[1].toLowerCase()},t=function(i){var r;return n(arguments,function(o,s){s>0&&n(o,function(n,o){n!==r&&(e(i[o])===e(n)&&~a(e(n),["array","object"])?t(i[o],n):i[o]=n)})}),i},n=function(t,n){var i,r,o,a;if(t)if("number"===e(t.length)){for(o=0,i=t.length;i>o;o++)if(n(t[o],o)===!1)return}else if("object"===e(t))for(r in t)if(t.hasOwnProperty(r)&&n(t[r],r)===!1)return},i=function(t){var n;if(!t||"object"!==e(t))return!0;for(n in t)return!1;return!0},r=function(t,n){function i(r){"function"===e(t[r])&&t[r](function(e){++r<o&&!e?i(r):n(e)})}var r=0,o=t.length;"function"!==e(n)&&(n=function(){}),t&&t.length||n(),i(r)},o=function(e,t){var i=0,r=e.length,o=new Array(r);n(e,function(e,n){e(function(e){if(e)return t(e);var a=[].slice.call(arguments);a.shift(),o[n]=a,i++,i===r&&(o.unshift(null),t.apply(this,o))})})},a=function(e,t){if(t){if(Array.prototype.indexOf)return Array.prototype.indexOf.call(t,e);for(var n=0,i=t.length;i>n;n++)if(t[n]===e)return n}return-1},s=function(t,n){var i=[];"array"!==e(t)&&(t=[t]),"array"!==e(n)&&(n=[n]);for(var r in t)-1===a(t[r],n)&&i.push(t[r]);return i.length?i:!1},u=function(e,t){var i=[];return n(e,function(e){-1!==a(e,t)&&i.push(e)}),i.length?i:null},c=function(e){var t,n=[];for(t=0;t<e.length;t++)n[t]=e[t];return n},l=function(){var e=0;return function(t){var n=(new Date).getTime().toString(32),i;for(i=0;5>i;i++)n+=Math.floor(65535*Math.random()).toString(32);return(t||"o_")+n+(e++).toString(32)}}(),d=function(e){return e?String.prototype.trim?String.prototype.trim.call(e):e.toString().replace(/^\s*/,"").replace(/\s*$/,""):e},h=function(e){if("string"!=typeof e)return e;var t={t:1099511627776,g:1073741824,m:1048576,k:1024},n;return e=/^([0-9\.]+)([tmgk]?)$/.exec(e.toLowerCase().replace(/[^0-9\.tmkg]/g,"")),n=e[2],e=+e[1],t.hasOwnProperty(n)&&(e*=t[n]),Math.floor(e)},f=function(t){var n=[].slice.call(arguments,1);return t.replace(/%[a-z]/g,function(){var t=n.shift();return"undefined"!==e(t)?t:""})};return{guid:l,typeOf:e,extend:t,each:n,isEmptyObj:i,inSeries:r,inParallel:o,inArray:a,arrayDiff:s,arrayIntersect:u,toArray:c,trim:d,sprintf:f,parseSizeStr:h}}),i(c,[u],function(e){function t(e,t,n){var i=0,r=0,o=0,a={dev:-6,alpha:-5,a:-5,beta:-4,b:-4,RC:-3,rc:-3,"#":-2,p:1,pl:1},s=function(e){return e=(""+e).replace(/[_\-+]/g,"."),e=e.replace(/([^.\d]+)/g,".$1.").replace(/\.{2,}/g,"."),e.length?e.split("."):[-8]},u=function(e){return e?isNaN(e)?a[e]||-7:parseInt(e,10):0};for(e=s(e),t=s(t),r=Math.max(e.length,t.length),i=0;r>i;i++)if(e[i]!=t[i]){if(e[i]=u(e[i]),t[i]=u(t[i]),e[i]<t[i]){o=-1;break}if(e[i]>t[i]){o=1;break}}if(!n)return o;switch(n){case">":case"gt":return o>0;case">=":case"ge":return o>=0;case"<=":case"le":return 0>=o;case"==":case"=":case"eq":return 0===o;case"<>":case"!=":case"ne":return 0!==o;case"":case"<":case"lt":return 0>o;default:return null}}var n=function(e){var t="",n="?",i="function",r="undefined",o="object",a="major",s="model",u="name",c="type",l="vendor",d="version",h="architecture",f="console",p="mobile",m="tablet",g={has:function(e,t){return-1!==t.toLowerCase().indexOf(e.toLowerCase())},lowerize:function(e){return e.toLowerCase()}},v={rgx:function(){for(var t,n=0,a,s,u,c,l,d,h=arguments;n<h.length;n+=2){var f=h[n],p=h[n+1];if(typeof t===r){t={};for(u in p)c=p[u],typeof c===o?t[c[0]]=e:t[c]=e}for(a=s=0;a<f.length;a++)if(l=f[a].exec(this.getUA())){for(u=0;u<p.length;u++)d=l[++s],c=p[u],typeof c===o&&c.length>0?2==c.length?typeof c[1]==i?t[c[0]]=c[1].call(this,d):t[c[0]]=c[1]:3==c.length?typeof c[1]!==i||c[1].exec&&c[1].test?t[c[0]]=d?d.replace(c[1],c[2]):e:t[c[0]]=d?c[1].call(this,d,c[2]):e:4==c.length&&(t[c[0]]=d?c[3].call(this,d.replace(c[1],c[2])):e):t[c]=d?d:e;break}if(l)break}return t},str:function(t,i){for(var r in i)if(typeof i[r]===o&&i[r].length>0){for(var a=0;a<i[r].length;a++)if(g.has(i[r][a],t))return r===n?e:r}else if(g.has(i[r],t))return r===n?e:r;return t}},w={browser:{oldsafari:{major:{1:["/8","/1","/3"],2:"/4","?":"/"},version:{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}}},device:{sprint:{model:{"Evo Shift 4G":"7373KT"},vendor:{HTC:"APA",Sprint:"Sprint"}}},os:{windows:{version:{ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2000:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",RT:"ARM"}}}},y={browser:[[/(opera\smini)\/([\w\.-]+)/i,/(opera\s[mobiletab]+).+version\/([\w\.-]+)/i,/(opera).+version\/([\w\.]+)/i,/(opera)[\/\s]+([\w\.]+)/i],[u,d],[/\s(opr)\/([\w\.]+)/i],[[u,"Opera"],d],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?([\w\.]+)*/i,/(avant\s|iemobile|slim|baidu)(?:browser)?[\/\s]?([\w\.]*)/i,/(?:ms|\()(ie)\s([\w\.]+)/i,/(rekonq)\/([\w\.]+)*/i,/(chromium|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi)\/([\w\.-]+)/i],[u,d],[/(trident).+rv[:\s]([\w\.]+).+like\sgecko/i],[[u,"IE"],d],[/(edge)\/((\d+)?[\w\.]+)/i],[u,d],[/(yabrowser)\/([\w\.]+)/i],[[u,"Yandex"],d],[/(comodo_dragon)\/([\w\.]+)/i],[[u,/_/g," "],d],[/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?([\w\.]+)/i,/(uc\s?browser|qqbrowser)[\/\s]?([\w\.]+)/i],[u,d],[/(dolfin)\/([\w\.]+)/i],[[u,"Dolphin"],d],[/((?:android.+)crmo|crios)\/([\w\.]+)/i],[[u,"Chrome"],d],[/XiaoMi\/MiuiBrowser\/([\w\.]+)/i],[d,[u,"MIUI Browser"]],[/android.+version\/([\w\.]+)\s+(?:mobile\s?safari|safari)/i],[d,[u,"Android Browser"]],[/FBAV\/([\w\.]+);/i],[d,[u,"Facebook"]],[/version\/([\w\.]+).+?mobile\/\w+\s(safari)/i],[d,[u,"Mobile Safari"]],[/version\/([\w\.]+).+?(mobile\s?safari|safari)/i],[d,u],[/webkit.+?(mobile\s?safari|safari)(\/[\w\.]+)/i],[u,[d,v.str,w.browser.oldsafari.version]],[/(konqueror)\/([\w\.]+)/i,/(webkit|khtml)\/([\w\.]+)/i],[u,d],[/(navigator|netscape)\/([\w\.-]+)/i],[[u,"Netscape"],d],[/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?([\w\.\+]+)/i,/(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix)\/([\w\.-]+)/i,/(mozilla)\/([\w\.]+).+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf)[\/\s]?([\w\.]+)/i,/(links)\s\(([\w\.]+)/i,/(gobrowser)\/?([\w\.]+)*/i,/(ice\s?browser)\/v?([\w\._]+)/i,/(mosaic)[\/\s]([\w\.]+)/i],[u,d]],engine:[[/windows.+\sedge\/([\w\.]+)/i],[d,[u,"EdgeHTML"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m)\/([\w\.]+)/i,/(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i,/(icab)[\/\s]([23]\.[\d\.]+)/i],[u,d],[/rv\:([\w\.]+).*(gecko)/i],[d,u]],os:[[/microsoft\s(windows)\s(vista|xp)/i],[u,d],[/(windows)\snt\s6\.2;\s(arm)/i,/(windows\sphone(?:\sos)*|windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)/i],[u,[d,v.str,w.os.windows.version]],[/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i],[[u,"Windows"],[d,v.str,w.os.windows.version]],[/\((bb)(10);/i],[[u,"BlackBerry"],d],[/(blackberry)\w*\/?([\w\.]+)*/i,/(tizen)[\/\s]([\w\.]+)/i,/(android|webos|palm\os|qnx|bada|rim\stablet\sos|meego|contiki)[\/\s-]?([\w\.]+)*/i,/linux;.+(sailfish);/i],[u,d],[/(symbian\s?os|symbos|s60(?=;))[\/\s-]?([\w\.]+)*/i],[[u,"Symbian"],d],[/\((series40);/i],[u],[/mozilla.+\(mobile;.+gecko.+firefox/i],[[u,"Firefox OS"],d],[/(nintendo|playstation)\s([wids3portablevu]+)/i,/(mint)[\/\s\(]?(\w+)*/i,/(mageia|vectorlinux)[;\s]/i,/(joli|[kxln]?ubuntu|debian|[open]*suse|gentoo|arch|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk|linpus)[\/\s-]?([\w\.-]+)*/i,/(hurd|linux)\s?([\w\.]+)*/i,/(gnu)\s?([\w\.]+)*/i],[u,d],[/(cros)\s[\w]+\s([\w\.]+\w)/i],[[u,"Chromium OS"],d],[/(sunos)\s?([\w\.]+\d)*/i],[[u,"Solaris"],d],[/\s([frentopc-]{0,4}bsd|dragonfly)\s?([\w\.]+)*/i],[u,d],[/(ip[honead]+)(?:.*os\s*([\w]+)*\slike\smac|;\sopera)/i],[[u,"iOS"],[d,/_/g,"."]],[/(mac\sos\sx)\s?([\w\s\.]+\w)*/i,/(macintosh|mac(?=_powerpc)\s)/i],[[u,"Mac OS"],[d,/_/g,"."]],[/((?:open)?solaris)[\/\s-]?([\w\.]+)*/i,/(haiku)\s(\w+)/i,/(aix)\s((\d)(?=\.|\)|\s)[\w\.]*)*/i,/(plan\s9|minix|beos|os\/2|amigaos|morphos|risc\sos|openvms)/i,/(unix)\s?([\w\.]+)*/i],[u,d]]},E=function(e){var n=e||(window&&window.navigator&&window.navigator.userAgent?window.navigator.userAgent:t);this.getBrowser=function(){return v.rgx.apply(this,y.browser)},this.getEngine=function(){return v.rgx.apply(this,y.engine)},this.getOS=function(){return v.rgx.apply(this,y.os)},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS()}},this.getUA=function(){return n},this.setUA=function(e){return n=e,this},this.setUA(n)};return E}(),i=function(){var t={define_property:function(){return!1}(),create_canvas:function(){var e=document.createElement("canvas");return!(!e.getContext||!e.getContext("2d"))}(),return_response_type:function(t){try{if(-1!==e.inArray(t,["","text","document"]))return!0;if(window.XMLHttpRequest){var n=new XMLHttpRequest;if(n.open("get","/"),"responseType"in n)return n.responseType=t,n.responseType!==t?!1:!0}}catch(i){}return!1},use_data_uri:function(){var e=new Image;return e.onload=function(){t.use_data_uri=1===e.width&&1===e.height},setTimeout(function(){e.src="data:image/gif;base64,R0lGODlhAQABAIAAAP8AAAAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw=="},1),!1}(),use_data_uri_over32kb:function(){return t.use_data_uri&&("IE"!==o.browser||o.version>=9)},use_data_uri_of:function(e){return t.use_data_uri&&33e3>e||t.use_data_uri_over32kb()},use_fileinput:function(){if(navigator.userAgent.match(/(Android (1.0|1.1|1.5|1.6|2.0|2.1))|(Windows Phone (OS 7|8.0))|(XBLWP)|(ZuneWP)|(w(eb)?OSBrowser)|(webOS)|(Kindle\/(1.0|2.0|2.5|3.0))/))return!1;var e=document.createElement("input");return e.setAttribute("type","file"),!e.disabled}};return function(n){var i=[].slice.call(arguments);return i.shift(),"function"===e.typeOf(t[n])?t[n].apply(this,i):!!t[n]}}(),r=(new n).getResult(),o={can:i,uaParser:n,browser:r.browser.name,version:r.browser.version,os:r.os.name,osVersion:r.os.version,verComp:t,swf_url:"../flash/Moxie.swf",xap_url:"../silverlight/Moxie.xap",global_event_dispatcher:"moxie.core.EventTarget.instance.dispatchEvent"};return o.OS=o.os,o}),i(l,[u],function(e){var t={};return{addI18n:function(n){return e.extend(t,n)},translate:function(e){return t[e]||e},_:function(e){return this.translate(e)},sprintf:function(t){var n=[].slice.call(arguments,1);return t.replace(/%[a-z]/g,function(){var t=n.shift();return"undefined"!==e.typeOf(t)?t:""})}}}),i(d,[u,l],function(e,t){var n="application/msword,doc dot,application/pdf,pdf,application/pgp-signature,pgp,application/postscript,ps ai eps,application/rtf,rtf,application/vnd.ms-excel,xls xlb,application/vnd.ms-powerpoint,ppt pps pot,application/zip,zip,application/x-shockwave-flash,swf swfl,application/vnd.openxmlformats-officedocument.wordprocessingml.document,docx,application/vnd.openxmlformats-officedocument.wordprocessingml.template,dotx,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,xlsx,application/vnd.openxmlformats-officedocument.presentationml.presentation,pptx,application/vnd.openxmlformats-officedocument.presentationml.template,potx,application/vnd.openxmlformats-officedocument.presentationml.slideshow,ppsx,application/x-javascript,js,application/json,json,audio/mpeg,mp3 mpga mpega mp2,audio/x-wav,wav,audio/x-m4a,m4a,audio/ogg,oga ogg,audio/aiff,aiff aif,audio/flac,flac,audio/aac,aac,audio/ac3,ac3,audio/x-ms-wma,wma,image/bmp,bmp,image/gif,gif,image/jpeg,jpg jpeg jpe,image/photoshop,psd,image/png,png,image/svg+xml,svg svgz,image/tiff,tiff tif,text/plain,asc txt text diff log,text/html,htm html xhtml,text/css,css,text/csv,csv,text/rtf,rtf,video/mpeg,mpeg mpg mpe m2v,video/quicktime,qt mov,video/mp4,mp4,video/x-m4v,m4v,video/x-flv,flv,video/x-ms-wmv,wmv,video/avi,avi,video/webm,webm,video/3gpp,3gpp 3gp,video/3gpp2,3g2,video/vnd.rn-realvideo,rv,video/ogg,ogv,video/x-matroska,mkv,application/vnd.oasis.opendocument.formula-template,otf,application/octet-stream,exe",i={mimes:{},extensions:{},addMimeType:function(e){var t=e.split(/,/),n,i,r;for(n=0;n<t.length;n+=2){for(r=t[n+1].split(/ /),i=0;i<r.length;i++)this.mimes[r[i]]=t[n];this.extensions[t[n]]=r}},extList2mimes:function(t,n){var i=this,r,o,a,s,u=[];for(o=0;o<t.length;o++)for(r=t[o].extensions.split(/\s*,\s*/),a=0;a<r.length;a++){if("*"===r[a])return[];if(s=i.mimes[r[a]],s&&-1===e.inArray(s,u)&&u.push(s),n&&/^\w+$/.test(r[a]))u.push("."+r[a]);else if(!s)return[]}return u},mimes2exts:function(t){var n=this,i=[];return e.each(t,function(t){if("*"===t)return i=[],!1;var r=t.match(/^(\w+)\/(\*|\w+)$/);r&&("*"===r[2]?e.each(n.extensions,function(e,t){new RegExp("^"+r[1]+"/").test(t)&&[].push.apply(i,n.extensions[t])}):n.extensions[t]&&[].push.apply(i,n.extensions[t]))}),i},mimes2extList:function(n){var i=[],r=[];return"string"===e.typeOf(n)&&(n=e.trim(n).split(/\s*,\s*/)),r=this.mimes2exts(n),i.push({title:t.translate("Files"),extensions:r.length?r.join(","):"*"}),i.mimes=n,i},getFileExtension:function(e){var t=e&&e.match(/\.([^.]+)$/);return t?t[1].toLowerCase():""},getFileMime:function(e){return this.mimes[this.getFileExtension(e)]||""}};return i.addMimeType(n),i}),i(h,[c],function(e){var t=function(e){return"string"!=typeof e?e:document.getElementById(e)},n=function(e,t){if(!e.className)return!1;var n=new RegExp("(^|\\s+)"+t+"(\\s+|$)");return n.test(e.className)},i=function(e,t){n(e,t)||(e.className=e.className?e.className.replace(/\s+$/,"")+" "+t:t)},r=function(e,t){if(e.className){var n=new RegExp("(^|\\s+)"+t+"(\\s+|$)");e.className=e.className.replace(n,function(e,t,n){return" "===t&&" "===n?" ":""})}},o=function(e,t){return e.currentStyle?e.currentStyle[t]:window.getComputedStyle?window.getComputedStyle(e,null)[t]:void 0},a=function(t,n){function i(e){var t,n,i=0,r=0;return e&&(n=e.getBoundingClientRect(),t="CSS1Compat"===s.compatMode?s.documentElement:s.body,i=n.left+t.scrollLeft,r=n.top+t.scrollTop),{x:i,y:r}}var r=0,o=0,a,s=document,u,c;if(t=t,n=n||s.body,t&&t.getBoundingClientRect&&"IE"===e.browser&&(!s.documentMode||s.documentMode<8))return u=i(t),c=i(n),{x:u.x-c.x,y:u.y-c.y};for(a=t;a&&a!=n&&a.nodeType;)r+=a.offsetLeft||0,o+=a.offsetTop||0,a=a.offsetParent;for(a=t.parentNode;a&&a!=n&&a.nodeType;)r-=a.scrollLeft||0,o-=a.scrollTop||0,a=a.parentNode;return{x:r,y:o}},s=function(e){return{w:e.offsetWidth||e.clientWidth,h:e.offsetHeight||e.clientHeight}};return{get:t,hasClass:n,addClass:i,removeClass:r,getStyle:o,getPos:a,getSize:s}}),i(f,[u],function(e){function t(e,t){var n;for(n in e)if(e[n]===t)return n;return null}return{RuntimeError:function(){function n(e){this.code=e,this.name=t(i,e),this.message=this.name+": RuntimeError "+this.code}var i={NOT_INIT_ERR:1,NOT_SUPPORTED_ERR:9,JS_ERR:4};return e.extend(n,i),n.prototype=Error.prototype,n}(),OperationNotAllowedException:function(){function t(e){this.code=e,this.name="OperationNotAllowedException"}return e.extend(t,{NOT_ALLOWED_ERR:1}),t.prototype=Error.prototype,t}(),ImageError:function(){function n(e){this.code=e,this.name=t(i,e),this.message=this.name+": ImageError "+this.code}var i={WRONG_FORMAT:1,MAX_RESOLUTION_ERR:2,INVALID_META_ERR:3};return e.extend(n,i),n.prototype=Error.prototype,n}(),FileException:function(){function n(e){this.code=e,this.name=t(i,e),this.message=this.name+": FileException "+this.code}var i={NOT_FOUND_ERR:1,SECURITY_ERR:2,ABORT_ERR:3,NOT_READABLE_ERR:4,ENCODING_ERR:5,NO_MODIFICATION_ALLOWED_ERR:6,INVALID_STATE_ERR:7,SYNTAX_ERR:8};return e.extend(n,i),n.prototype=Error.prototype,n}(),DOMException:function(){function n(e){this.code=e,this.name=t(i,e),this.message=this.name+": DOMException "+this.code}var i={INDEX_SIZE_ERR:1,DOMSTRING_SIZE_ERR:2,HIERARCHY_REQUEST_ERR:3,WRONG_DOCUMENT_ERR:4,INVALID_CHARACTER_ERR:5,NO_DATA_ALLOWED_ERR:6,NO_MODIFICATION_ALLOWED_ERR:7,NOT_FOUND_ERR:8,NOT_SUPPORTED_ERR:9,INUSE_ATTRIBUTE_ERR:10,INVALID_STATE_ERR:11,SYNTAX_ERR:12,INVALID_MODIFICATION_ERR:13,NAMESPACE_ERR:14,INVALID_ACCESS_ERR:15,VALIDATION_ERR:16,TYPE_MISMATCH_ERR:17,SECURITY_ERR:18,NETWORK_ERR:19,ABORT_ERR:20,URL_MISMATCH_ERR:21,QUOTA_EXCEEDED_ERR:22,TIMEOUT_ERR:23,INVALID_NODE_TYPE_ERR:24,DATA_CLONE_ERR:25};return e.extend(n,i),n.prototype=Error.prototype,n}(),EventException:function(){function t(e){this.code=e,this.name="EventException"}return e.extend(t,{UNSPECIFIED_EVENT_TYPE_ERR:0}),t.prototype=Error.prototype,t}()}}),i(p,[c,f,u],function(e,t,n){function i(){var e={};n.extend(this,{uid:null,init:function(){this.uid||(this.uid=n.guid("uid_"))},addEventListener:function(t,i,r,o){var a=this,s;return this.hasOwnProperty("uid")||(this.uid=n.guid("uid_")),t=n.trim(t),/\s/.test(t)?void n.each(t.split(/\s+/),function(e){a.addEventListener(e,i,r,o)}):(t=t.toLowerCase(),r=parseInt(r,10)||0,s=e[this.uid]&&e[this.uid][t]||[],s.push({fn:i,priority:r,scope:o||this}),e[this.uid]||(e[this.uid]={}),void(e[this.uid][t]=s))},hasEventListener:function(t){var n=t?e[this.uid]&&e[this.uid][t]:e[this.uid];return n?n:!1},removeEventListener:function(t,i){t=t.toLowerCase();var r=e[this.uid]&&e[this.uid][t],o;if(r){if(i){for(o=r.length-1;o>=0;o--)if(r[o].fn===i){r.splice(o,1);break}}else r=[];r.length||(delete e[this.uid][t],n.isEmptyObj(e[this.uid])&&delete e[this.uid])}},removeAllEventListeners:function(){e[this.uid]&&delete e[this.uid]},dispatchEvent:function(i){var r,o,a,s,u={},c=!0,l;if("string"!==n.typeOf(i)){if(s=i,"string"!==n.typeOf(s.type))throw new t.EventException(t.EventException.UNSPECIFIED_EVENT_TYPE_ERR);i=s.type,s.total!==l&&s.loaded!==l&&(u.total=s.total,u.loaded=s.loaded),u.async=s.async||!1}if(-1!==i.indexOf("::")?!function(e){r=e[0],i=e[1]}(i.split("::")):r=this.uid,i=i.toLowerCase(),o=e[r]&&e[r][i]){o.sort(function(e,t){return t.priority-e.priority}),a=[].slice.call(arguments),a.shift(),u.type=i,a.unshift(u);var d=[];n.each(o,function(e){a[0].target=e.scope,d.push(u.async?function(t){setTimeout(function(){t(e.fn.apply(e.scope,a)===!1)},1)}:function(t){t(e.fn.apply(e.scope,a)===!1)})}),d.length&&n.inSeries(d,function(e){c=!e})}return c},bind:function(){this.addEventListener.apply(this,arguments)},unbind:function(){this.removeEventListener.apply(this,arguments)},unbindAll:function(){this.removeAllEventListeners.apply(this,arguments)},trigger:function(){return this.dispatchEvent.apply(this,arguments)},handleEventProps:function(e){var t=this;this.bind(e.join(" "),function(e){var t="on"+e.type.toLowerCase();"function"===n.typeOf(this[t])&&this[t].apply(this,arguments)}),n.each(e,function(e){e="on"+e.toLowerCase(e),"undefined"===n.typeOf(t[e])&&(t[e]=null)})}})}return i.instance=new i,i}),i(m,[c,u,h,p],function(e,t,n,i){function r(e,i,o,s,u){var c=this,l,d=t.guid(i+"_"),h=u||"browser";e=e||{},a[d]=this,o=t.extend({access_binary:!1,access_image_binary:!1,display_media:!1,do_cors:!1,drag_and_drop:!1,filter_by_extension:!0,resize_image:!1,report_upload_progress:!1,return_response_headers:!1,return_response_type:!1,return_status_code:!0,send_custom_headers:!1,select_file:!1,select_folder:!1,select_multiple:!0,send_binary_string:!1,send_browser_cookies:!0,send_multipart:!0,slice_blob:!1,stream_upload:!1,summon_file_dialog:!1,upload_filesize:!0,use_http_method:!0},o),e.preferred_caps&&(h=r.getMode(s,e.preferred_caps,h)),l=function(){var e={};return{exec:function(t,n,i,r){return l[n]&&(e[t]||(e[t]={context:this,instance:new l[n]}),e[t].instance[i])?e[t].instance[i].apply(this,r):void 0},removeInstance:function(t){delete e[t]},removeAllInstances:function(){var n=this;t.each(e,function(e,i){"function"===t.typeOf(e.instance.destroy)&&e.instance.destroy.call(e.context),n.removeInstance(i)})}}}(),t.extend(this,{initialized:!1,uid:d,type:i,mode:r.getMode(s,e.required_caps,h),shimid:d+"_container",clients:0,options:e,can:function(e,n){var i=arguments[2]||o;if("string"===t.typeOf(e)&&"undefined"===t.typeOf(n)&&(e=r.parseCaps(e)),"object"===t.typeOf(e)){for(var a in e)if(!this.can(a,e[a],i))return!1;return!0}return"function"===t.typeOf(i[e])?i[e].call(this,n):n===i[e]},getShimContainer:function(){var e,i=n.get(this.shimid);return i||(e=this.options.container?n.get(this.options.container):document.body,i=document.createElement("div"),i.id=this.shimid,i.className="moxie-shim moxie-shim-"+this.type,t.extend(i.style,{position:"absolute",top:"0px",left:"0px",width:"1px",height:"1px",overflow:"hidden"}),e.appendChild(i),e=null),i},getShim:function(){return l},shimExec:function(e,t){var n=[].slice.call(arguments,2);return c.getShim().exec.call(this,this.uid,e,t,n)},exec:function(e,t){var n=[].slice.call(arguments,2);return c[e]&&c[e][t]?c[e][t].apply(this,n):c.shimExec.apply(this,arguments)},destroy:function(){if(c){var e=n.get(this.shimid);e&&e.parentNode.removeChild(e),l&&l.removeAllInstances(),this.unbindAll(),delete a[this.uid],this.uid=null,d=c=l=e=null}}}),this.mode&&e.required_caps&&!this.can(e.required_caps)&&(this.mode=!1)}var o={},a={};return r.order="html5,flash,silverlight,html4",r.getRuntime=function(e){return a[e]?a[e]:!1},r.addConstructor=function(e,t){t.prototype=i.instance,o[e]=t},r.getConstructor=function(e){return o[e]||null},r.getInfo=function(e){var t=r.getRuntime(e);return t?{uid:t.uid,type:t.type,mode:t.mode,can:function(){return t.can.apply(t,arguments)}}:null},r.parseCaps=function(e){var n={};return"string"!==t.typeOf(e)?e||{}:(t.each(e.split(","),function(e){n[e]=!0}),n)},r.can=function(e,t){var n,i=r.getConstructor(e),o;return i?(n=new i({required_caps:t}),o=n.mode,n.destroy(),!!o):!1},r.thatCan=function(e,t){var n=(t||r.order).split(/\s*,\s*/);for(var i in n)if(r.can(n[i],e))return n[i];return null},r.getMode=function(e,n,i){var r=null;if("undefined"===t.typeOf(i)&&(i="browser"),n&&!t.isEmptyObj(e)){if(t.each(n,function(n,i){if(e.hasOwnProperty(i)){var o=e[i](n);if("string"==typeof o&&(o=[o]),r){if(!(r=t.arrayIntersect(r,o)))return r=!1}else r=o}}),r)return-1!==t.inArray(i,r)?i:r[0];if(r===!1)return!1}return i},r.capTrue=function(){return!0},r.capFalse=function(){return!1},r.capTest=function(e){return function(){return!!e}},r}),i(g,[c,f,u,m],function(e,t,n,i){return function r(){var e;n.extend(this,{connectRuntime:function(r){function o(n){var s,u;return n.length?(s=n.shift().toLowerCase(),(u=i.getConstructor(s))?(e=new u(r),e.bind("Init",function(){e.initialized=!0,setTimeout(function(){e.clients++,a.trigger("RuntimeInit",e)},1)}),e.bind("Error",function(){e.destroy(),o(n)}),e.mode?void e.init():void e.trigger("Error")):void o(n)):(a.trigger("RuntimeError",new t.RuntimeError(t.RuntimeError.NOT_INIT_ERR)),void(e=null))}var a=this,s;if("string"===n.typeOf(r)?s=r:"string"===n.typeOf(r.ruid)&&(s=r.ruid),s){if(e=i.getRuntime(s))return e.clients++,e;throw new t.RuntimeError(t.RuntimeError.NOT_INIT_ERR)}o((r.runtime_order||i.order).split(/\s*,\s*/))},disconnectRuntime:function(){e&&--e.clients<=0&&e.destroy(),e=null},getRuntime:function(){return e&&e.uid?e:e=null},exec:function(){return e?e.exec.apply(this,arguments):null}})}}),i(v,[u,c,d,h,f,p,l,m,g],function(e,t,n,i,r,o,a,s,u){function c(t){var o=this,c,d,h;if(-1!==e.inArray(e.typeOf(t),["string","node"])&&(t={browse_button:t}),d=i.get(t.browse_button),!d)throw new r.DOMException(r.DOMException.NOT_FOUND_ERR);h={accept:[{title:a.translate("All Files"),extensions:"*"}],name:"file",multiple:!1,required_caps:!1,container:d.parentNode||document.body},t=e.extend({},h,t),"string"==typeof t.required_caps&&(t.required_caps=s.parseCaps(t.required_caps)),"string"==typeof t.accept&&(t.accept=n.mimes2extList(t.accept)),c=i.get(t.container),c||(c=document.body),"static"===i.getStyle(c,"position")&&(c.style.position="relative"),c=d=null,u.call(o),e.extend(o,{uid:e.guid("uid_"),ruid:null,shimid:null,files:null,init:function(){o.bind("RuntimeInit",function(n,r){o.ruid=r.uid,o.shimid=r.shimid,o.bind("Ready",function(){o.trigger("Refresh")},999),o.bind("Refresh",function(){var n,o,a,s;a=i.get(t.browse_button),s=i.get(r.shimid),a&&(n=i.getPos(a,i.get(t.container)),o=i.getSize(a),s&&e.extend(s.style,{top:n.y+"px",left:n.x+"px",width:o.w+"px",height:o.h+"px"})),s=a=null}),r.exec.call(o,"FileInput","init",t)}),o.connectRuntime(e.extend({},t,{required_caps:{select_file:!0}}))},disable:function(t){var n=this.getRuntime();n&&n.exec.call(this,"FileInput","disable","undefined"===e.typeOf(t)?!0:t)},refresh:function(){o.trigger("Refresh")},destroy:function(){var t=this.getRuntime();t&&(t.exec.call(this,"FileInput","destroy"),this.disconnectRuntime()),"array"===e.typeOf(this.files)&&e.each(this.files,function(e){e.destroy()}),this.files=null,this.unbindAll()}}),this.handleEventProps(l)}var l=["ready","change","cancel","mouseenter","mouseleave","mousedown","mouseup"];return c.prototype=o.instance,c}),i(w,[],function(){var e=function(e){return unescape(encodeURIComponent(e))},t=function(e){return decodeURIComponent(escape(e))},n=function(e,n){if("function"==typeof window.atob)return n?t(window.atob(e)):window.atob(e);var i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",r,o,a,s,u,c,l,d,h=0,f=0,p="",m=[];if(!e)return e;e+="";do s=i.indexOf(e.charAt(h++)),u=i.indexOf(e.charAt(h++)),c=i.indexOf(e.charAt(h++)),l=i.indexOf(e.charAt(h++)),d=s<<18|u<<12|c<<6|l,r=d>>16&255,o=d>>8&255,a=255&d,64==c?m[f++]=String.fromCharCode(r):64==l?m[f++]=String.fromCharCode(r,o):m[f++]=String.fromCharCode(r,o,a);while(h<e.length);return p=m.join(""),n?t(p):p},i=function(t,n){if(n&&(t=e(t)),"function"==typeof window.btoa)return window.btoa(t);var i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",r,o,a,s,u,c,l,d,h=0,f=0,p="",m=[];if(!t)return t;do r=t.charCodeAt(h++),o=t.charCodeAt(h++),a=t.charCodeAt(h++),d=r<<16|o<<8|a,s=d>>18&63,u=d>>12&63,c=d>>6&63,l=63&d,m[f++]=i.charAt(s)+i.charAt(u)+i.charAt(c)+i.charAt(l);while(h<t.length);p=m.join("");var g=t.length%3;return(g?p.slice(0,g-3):p)+"===".slice(g||3)};return{utf8_encode:e,utf8_decode:t,atob:n,btoa:i}}),i(y,[u,w,g],function(e,t,n){function i(o,a){function s(t,n,o){var a,s=r[this.uid];return"string"===e.typeOf(s)&&s.length?(a=new i(null,{type:o,size:n-t}),a.detach(s.substr(t,a.size)),a):null}n.call(this),o&&this.connectRuntime(o),a?"string"===e.typeOf(a)&&(a={data:a}):a={},e.extend(this,{uid:a.uid||e.guid("uid_"),ruid:o,size:a.size||0,type:a.type||"",slice:function(e,t,n){return this.isDetached()?s.apply(this,arguments):this.getRuntime().exec.call(this,"Blob","slice",this.getSource(),e,t,n)},getSource:function(){return r[this.uid]?r[this.uid]:null},detach:function(e){if(this.ruid&&(this.getRuntime().exec.call(this,"Blob","destroy"),this.disconnectRuntime(),this.ruid=null),e=e||"","data:"==e.substr(0,5)){var n=e.indexOf(";base64,");this.type=e.substring(5,n),e=t.atob(e.substring(n+8))}this.size=e.length,r[this.uid]=e},isDetached:function(){return!this.ruid&&"string"===e.typeOf(r[this.uid])},destroy:function(){this.detach(),delete r[this.uid]}}),a.data?this.detach(a.data):r[this.uid]=a}var r={};return i}),i(E,[u,d,y],function(e,t,n){function i(i,r){r||(r={}),n.apply(this,arguments),this.type||(this.type=t.getFileMime(r.name));var o;if(r.name)o=r.name.replace(/\\/g,"/"),o=o.substr(o.lastIndexOf("/")+1);else if(this.type){var a=this.type.split("/")[0];o=e.guid((""!==a?a:"file")+"_"),t.extensions[this.type]&&(o+="."+t.extensions[this.type][0])}e.extend(this,{name:o||e.guid("file_"),relativePath:"",lastModifiedDate:r.lastModifiedDate||(new Date).toLocaleString()})}return i.prototype=n.prototype,i}),i(_,[l,h,f,u,c,E,g,p,d],function(e,t,n,i,r,o,a,s,u){function c(n){var r=this,o;"string"==typeof n&&(n={drop_zone:n}),o={accept:[{title:e.translate("All Files"),extensions:"*"}],required_caps:{drag_and_drop:!0}},n="object"==typeof n?i.extend({},o,n):o,n.container=t.get(n.drop_zone)||document.body,"static"===t.getStyle(n.container,"position")&&(n.container.style.position="relative"),"string"==typeof n.accept&&(n.accept=u.mimes2extList(n.accept)),a.call(r),i.extend(r,{uid:i.guid("uid_"),ruid:null,files:null,init:function(){r.bind("RuntimeInit",function(e,t){r.ruid=t.uid,t.exec.call(r,"FileDrop","init",n),r.dispatchEvent("ready")}),r.connectRuntime(n)},destroy:function(){var e=this.getRuntime();e&&(e.exec.call(this,"FileDrop","destroy"),this.disconnectRuntime()),this.files=null,this.unbindAll()}}),this.handleEventProps(l)}var l=["ready","dragenter","dragleave","drop","error"];return c.prototype=s.instance,c}),i(b,[u,w,f,p,y,g],function(e,t,n,i,r,o){function a(){function i(e,i){var o=this;if(this.trigger("loadstart"),this.readyState===a.LOADING)return this.trigger("error",new n.DOMException(n.DOMException.INVALID_STATE_ERR)),void this.trigger("loadend");if(!(i instanceof r))return this.trigger("error",new n.DOMException(n.DOMException.NOT_FOUND_ERR)),void this.trigger("loadend");if(this.result=null,this.readyState=a.LOADING,i.isDetached()){var s=i.getSource();switch(e){case"readAsText":case"readAsBinaryString":this.result=s;break;case"readAsDataURL":this.result="data:"+i.type+";base64,"+t.btoa(s)}this.readyState=a.DONE,this.trigger("load"),this.trigger("loadend")}else this.connectRuntime(i.ruid),this.exec("FileReader","read",e,i)}o.call(this),e.extend(this,{uid:e.guid("uid_"),readyState:a.EMPTY,result:null,error:null,readAsBinaryString:function(e){i.call(this,"readAsBinaryString",e)},readAsDataURL:function(e){i.call(this,"readAsDataURL",e)},readAsText:function(e){i.call(this,"readAsText",e);
+},abort:function(){this.result=null,-1===e.inArray(this.readyState,[a.EMPTY,a.DONE])&&(this.readyState===a.LOADING&&(this.readyState=a.DONE),this.exec("FileReader","abort"),this.trigger("abort"),this.trigger("loadend"))},destroy:function(){this.abort(),this.exec("FileReader","destroy"),this.disconnectRuntime(),this.unbindAll()}}),this.handleEventProps(s),this.bind("Error",function(e,t){this.readyState=a.DONE,this.error=t},999),this.bind("Load",function(e){this.readyState=a.DONE},999)}var s=["loadstart","progress","load","abort","error","loadend"];return a.EMPTY=0,a.LOADING=1,a.DONE=2,a.prototype=i.instance,a}),i(x,[],function(){var e=function(t,n){for(var i=["source","scheme","authority","userInfo","user","pass","host","port","relative","path","directory","file","query","fragment"],r=i.length,o={http:80,https:443},a={},s=/^(?:([^:\/?#]+):)?(?:\/\/()(?:(?:()(?:([^:@\/]*):?([^:@\/]*))?@)?([^:\/?#]*)(?::(\d*))?))?()(?:(()(?:(?:[^?#\/]*\/)*)()(?:[^?#]*))(?:\\?([^#]*))?(?:#(.*))?)/,u=s.exec(t||"");r--;)u[r]&&(a[i[r]]=u[r]);if(!a.scheme){n&&"string"!=typeof n||(n=e(n||document.location.href)),a.scheme=n.scheme,a.host=n.host,a.port=n.port;var c="";/^[^\/]/.test(a.path)&&(c=n.path,c=/\/[^\/]*\.[^\/]*$/.test(c)?c.replace(/\/[^\/]+$/,"/"):c.replace(/\/?$/,"/")),a.path=c+(a.path||"")}return a.port||(a.port=o[a.scheme]||80),a.port=parseInt(a.port,10),a.path||(a.path="/"),delete a.source,a},t=function(t){var n={http:80,https:443},i="object"==typeof t?t:e(t);return i.scheme+"://"+i.host+(i.port!==n[i.scheme]?":"+i.port:"")+i.path+(i.query?i.query:"")},n=function(t){function n(e){return[e.scheme,e.host,e.port].join("/")}return"string"==typeof t&&(t=e(t)),n(e())===n(t)};return{parseUrl:e,resolveUrl:t,hasSameOrigin:n}}),i(R,[u,g,p],function(e,t,n){function i(){this.uid=e.guid("uid_"),t.call(this),this.destroy=function(){this.disconnectRuntime(),this.unbindAll()}}return i.prototype=n.instance,i}),i(A,[u,g,w],function(e,t,n){return function(){function i(e,t){if(!t.isDetached()){var i=this.connectRuntime(t.ruid).exec.call(this,"FileReaderSync","read",e,t);return this.disconnectRuntime(),i}var r=t.getSource();switch(e){case"readAsBinaryString":return r;case"readAsDataURL":return"data:"+t.type+";base64,"+n.btoa(r);case"readAsText":for(var o="",a=0,s=r.length;s>a;a++)o+=String.fromCharCode(r[a]);return o}}t.call(this),e.extend(this,{uid:e.guid("uid_"),readAsBinaryString:function(e){return i.call(this,"readAsBinaryString",e)},readAsDataURL:function(e){return i.call(this,"readAsDataURL",e)},readAsText:function(e){return i.call(this,"readAsText",e)}})}}),i(I,[f,u,y],function(e,t,n){function i(){var e,i=[];t.extend(this,{append:function(r,o){var a=this,s=t.typeOf(o);o instanceof n?e={name:r,value:o}:"array"===s?(r+="[]",t.each(o,function(e){a.append(r,e)})):"object"===s?t.each(o,function(e,t){a.append(r+"["+t+"]",e)}):"null"===s||"undefined"===s||"number"===s&&isNaN(o)?a.append(r,"false"):i.push({name:r,value:o.toString()})},hasBlob:function(){return!!this.getBlob()},getBlob:function(){return e&&e.value||null},getBlobName:function(){return e&&e.name||null},each:function(n){t.each(i,function(e){n(e.value,e.name)}),e&&n(e.value,e.name)},destroy:function(){e=null,i=[]}})}return i}),i(T,[u,f,p,w,x,m,R,y,A,I,c,d],function(e,t,n,i,r,o,a,s,u,c,l,d){function h(){this.uid=e.guid("uid_")}function f(){function n(e,t){return w.hasOwnProperty(e)?1===arguments.length?l.can("define_property")?w[e]:v[e]:void(l.can("define_property")?w[e]=t:v[e]=t):void 0}function u(t){function i(){B&&(B.destroy(),B=null),s.dispatchEvent("loadend"),s=null}function r(r){B.bind("LoadStart",function(e){n("readyState",f.LOADING),s.dispatchEvent("readystatechange"),s.dispatchEvent(e),O&&s.upload.dispatchEvent(e)}),B.bind("Progress",function(e){n("readyState")!==f.LOADING&&(n("readyState",f.LOADING),s.dispatchEvent("readystatechange")),s.dispatchEvent(e)}),B.bind("UploadProgress",function(e){O&&s.upload.dispatchEvent({type:"progress",lengthComputable:!1,total:e.total,loaded:e.loaded})}),B.bind("Load",function(t){n("readyState",f.DONE),n("status",Number(r.exec.call(B,"XMLHttpRequest","getStatus")||0)),n("statusText",p[n("status")]||""),n("response",r.exec.call(B,"XMLHttpRequest","getResponse",n("responseType"))),~e.inArray(n("responseType"),["text",""])?n("responseText",n("response")):"document"===n("responseType")&&n("responseXML",n("response")),k=r.exec.call(B,"XMLHttpRequest","getAllResponseHeaders"),s.dispatchEvent("readystatechange"),n("status")>0?(O&&s.upload.dispatchEvent(t),s.dispatchEvent(t)):(N=!0,s.dispatchEvent("error")),i()}),B.bind("Abort",function(e){s.dispatchEvent(e),i()}),B.bind("Error",function(e){N=!0,n("readyState",f.DONE),s.dispatchEvent("readystatechange"),D=!0,s.dispatchEvent(e),i()}),r.exec.call(B,"XMLHttpRequest","send",{url:E,method:_,async:y,user:x,password:R,headers:b,mimeType:I,encoding:A,responseType:s.responseType,withCredentials:s.withCredentials,options:H},t)}var s=this;C=(new Date).getTime(),B=new a,"string"==typeof H.required_caps&&(H.required_caps=o.parseCaps(H.required_caps)),H.required_caps=e.extend({},H.required_caps,{return_response_type:s.responseType}),t instanceof c&&(H.required_caps.send_multipart=!0),e.isEmptyObj(b)||(H.required_caps.send_custom_headers=!0),L||(H.required_caps.do_cors=!0),H.ruid?r(B.connectRuntime(H)):(B.bind("RuntimeInit",function(e,t){r(t)}),B.bind("RuntimeError",function(e,t){s.dispatchEvent("RuntimeError",t)}),B.connectRuntime(H))}function g(){n("responseText",""),n("responseXML",null),n("response",null),n("status",0),n("statusText",""),C=M=null}var v=this,w={timeout:0,readyState:f.UNSENT,withCredentials:!1,status:0,statusText:"",responseType:"",responseXML:null,responseText:null,response:null},y=!0,E,_,b={},x,R,A=null,I=null,T=!1,S=!1,O=!1,D=!1,N=!1,L=!1,C,M,F=null,P=null,H={},B,k="",U;e.extend(this,w,{uid:e.guid("uid_"),upload:new h,open:function(o,a,s,u,c){var l;if(!o||!a)throw new t.DOMException(t.DOMException.SYNTAX_ERR);if(/[\u0100-\uffff]/.test(o)||i.utf8_encode(o)!==o)throw new t.DOMException(t.DOMException.SYNTAX_ERR);if(~e.inArray(o.toUpperCase(),["CONNECT","DELETE","GET","HEAD","OPTIONS","POST","PUT","TRACE","TRACK"])&&(_=o.toUpperCase()),~e.inArray(_,["CONNECT","TRACE","TRACK"]))throw new t.DOMException(t.DOMException.SECURITY_ERR);if(a=i.utf8_encode(a),l=r.parseUrl(a),L=r.hasSameOrigin(l),E=r.resolveUrl(a),(u||c)&&!L)throw new t.DOMException(t.DOMException.INVALID_ACCESS_ERR);if(x=u||l.user,R=c||l.pass,y=s||!0,y===!1&&(n("timeout")||n("withCredentials")||""!==n("responseType")))throw new t.DOMException(t.DOMException.INVALID_ACCESS_ERR);T=!y,S=!1,b={},g.call(this),n("readyState",f.OPENED),this.dispatchEvent("readystatechange")},setRequestHeader:function(r,o){var a=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","content-transfer-encoding","date","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","user-agent","via"];if(n("readyState")!==f.OPENED||S)throw new t.DOMException(t.DOMException.INVALID_STATE_ERR);if(/[\u0100-\uffff]/.test(r)||i.utf8_encode(r)!==r)throw new t.DOMException(t.DOMException.SYNTAX_ERR);return r=e.trim(r).toLowerCase(),~e.inArray(r,a)||/^(proxy\-|sec\-)/.test(r)?!1:(b[r]?b[r]+=", "+o:b[r]=o,!0)},getAllResponseHeaders:function(){return k||""},getResponseHeader:function(t){return t=t.toLowerCase(),N||~e.inArray(t,["set-cookie","set-cookie2"])?null:k&&""!==k&&(U||(U={},e.each(k.split(/\r\n/),function(t){var n=t.split(/:\s+/);2===n.length&&(n[0]=e.trim(n[0]),U[n[0].toLowerCase()]={header:n[0],value:e.trim(n[1])})})),U.hasOwnProperty(t))?U[t].header+": "+U[t].value:null},overrideMimeType:function(i){var r,o;if(~e.inArray(n("readyState"),[f.LOADING,f.DONE]))throw new t.DOMException(t.DOMException.INVALID_STATE_ERR);if(i=e.trim(i.toLowerCase()),/;/.test(i)&&(r=i.match(/^([^;]+)(?:;\scharset\=)?(.*)$/))&&(i=r[1],r[2]&&(o=r[2])),!d.mimes[i])throw new t.DOMException(t.DOMException.SYNTAX_ERR);F=i,P=o},send:function(n,r){if(H="string"===e.typeOf(r)?{ruid:r}:r?r:{},this.readyState!==f.OPENED||S)throw new t.DOMException(t.DOMException.INVALID_STATE_ERR);if(n instanceof s)H.ruid=n.ruid,I=n.type||"application/octet-stream";else if(n instanceof c){if(n.hasBlob()){var o=n.getBlob();H.ruid=o.ruid,I=o.type||"application/octet-stream"}}else"string"==typeof n&&(A="UTF-8",I="text/plain;charset=UTF-8",n=i.utf8_encode(n));this.withCredentials||(this.withCredentials=H.required_caps&&H.required_caps.send_browser_cookies&&!L),O=!T&&this.upload.hasEventListener(),N=!1,D=!n,T||(S=!0),u.call(this,n)},abort:function(){if(N=!0,T=!1,~e.inArray(n("readyState"),[f.UNSENT,f.OPENED,f.DONE]))n("readyState",f.UNSENT);else{if(n("readyState",f.DONE),S=!1,!B)throw new t.DOMException(t.DOMException.INVALID_STATE_ERR);B.getRuntime().exec.call(B,"XMLHttpRequest","abort",D),D=!0}},destroy:function(){B&&("function"===e.typeOf(B.destroy)&&B.destroy(),B=null),this.unbindAll(),this.upload&&(this.upload.unbindAll(),this.upload=null)}}),this.handleEventProps(m.concat(["readystatechange"])),this.upload.handleEventProps(m)}var p={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",306:"Reserved",307:"Temporary Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Request Entity Too Large",414:"Request-URI Too Long",415:"Unsupported Media Type",416:"Requested Range Not Satisfiable",417:"Expectation Failed",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",426:"Upgrade Required",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",510:"Not Extended"};h.prototype=n.instance;var m=["loadstart","progress","abort","error","load","timeout","loadend"],g=1,v=2;return f.UNSENT=0,f.OPENED=1,f.HEADERS_RECEIVED=2,f.LOADING=3,f.DONE=4,f.prototype=n.instance,f}),i(S,[u,w,g,p],function(e,t,n,i){function r(){function i(){l=d=0,c=this.result=null}function o(t,n){var i=this;u=n,i.bind("TransportingProgress",function(t){d=t.loaded,l>d&&-1===e.inArray(i.state,[r.IDLE,r.DONE])&&a.call(i)},999),i.bind("TransportingComplete",function(){d=l,i.state=r.DONE,c=null,i.result=u.exec.call(i,"Transporter","getAsBlob",t||"")},999),i.state=r.BUSY,i.trigger("TransportingStarted"),a.call(i)}function a(){var e=this,n,i=l-d;h>i&&(h=i),n=t.btoa(c.substr(d,h)),u.exec.call(e,"Transporter","receive",n,l)}var s,u,c,l,d,h;n.call(this),e.extend(this,{uid:e.guid("uid_"),state:r.IDLE,result:null,transport:function(t,n,r){var a=this;if(r=e.extend({chunk_size:204798},r),(s=r.chunk_size%3)&&(r.chunk_size+=3-s),h=r.chunk_size,i.call(this),c=t,l=t.length,"string"===e.typeOf(r)||r.ruid)o.call(a,n,this.connectRuntime(r));else{var u=function(e,t){a.unbind("RuntimeInit",u),o.call(a,n,t)};this.bind("RuntimeInit",u),this.connectRuntime(r)}},abort:function(){var e=this;e.state=r.IDLE,u&&(u.exec.call(e,"Transporter","clear"),e.trigger("TransportingAborted")),i.call(e)},destroy:function(){this.unbindAll(),u=null,this.disconnectRuntime(),i.call(this)}})}return r.IDLE=0,r.BUSY=1,r.DONE=2,r.prototype=i.instance,r}),i(O,[u,h,f,A,T,m,g,S,c,p,y,E,w],function(e,t,n,i,r,o,a,s,u,c,l,d,h){function f(){function i(e){e||(e=this.exec("Image","getInfo")),this.size=e.size,this.width=e.width,this.height=e.height,this.type=e.type,this.meta=e.meta,""===this.name&&(this.name=e.name)}function c(t){var i=e.typeOf(t);try{if(t instanceof f){if(!t.size)throw new n.DOMException(n.DOMException.INVALID_STATE_ERR);m.apply(this,arguments)}else if(t instanceof l){if(!~e.inArray(t.type,["image/jpeg","image/png"]))throw new n.ImageError(n.ImageError.WRONG_FORMAT);g.apply(this,arguments)}else if(-1!==e.inArray(i,["blob","file"]))c.call(this,new d(null,t),arguments[1]);else if("string"===i)"data:"===t.substr(0,5)?c.call(this,new l(null,{data:t}),arguments[1]):v.apply(this,arguments);else{if("node"!==i||"img"!==t.nodeName.toLowerCase())throw new n.DOMException(n.DOMException.TYPE_MISMATCH_ERR);c.call(this,t.src,arguments[1])}}catch(r){this.trigger("error",r.code)}}function m(t,n){var i=this.connectRuntime(t.ruid);this.ruid=i.uid,i.exec.call(this,"Image","loadFromImage",t,"undefined"===e.typeOf(n)?!0:n)}function g(t,n){function i(e){r.ruid=e.uid,e.exec.call(r,"Image","loadFromBlob",t)}var r=this;r.name=t.name||"",t.isDetached()?(this.bind("RuntimeInit",function(e,t){i(t)}),n&&"string"==typeof n.required_caps&&(n.required_caps=o.parseCaps(n.required_caps)),this.connectRuntime(e.extend({required_caps:{access_image_binary:!0,resize_image:!0}},n))):i(this.connectRuntime(t.ruid))}function v(e,t){var n=this,i;i=new r,i.open("get",e),i.responseType="blob",i.onprogress=function(e){n.trigger(e)},i.onload=function(){g.call(n,i.response,!0)},i.onerror=function(e){n.trigger(e)},i.onloadend=function(){i.destroy()},i.bind("RuntimeError",function(e,t){n.trigger("RuntimeError",t)}),i.send(null,t)}a.call(this),e.extend(this,{uid:e.guid("uid_"),ruid:null,name:"",size:0,width:0,height:0,type:"",meta:{},clone:function(){this.load.apply(this,arguments)},load:function(){c.apply(this,arguments)},downsize:function(t){var i={width:this.width,height:this.height,type:this.type||"image/jpeg",quality:90,crop:!1,preserveHeaders:!0,resample:!1};t="object"==typeof t?e.extend(i,t):e.extend(i,{width:arguments[0],height:arguments[1],crop:arguments[2],preserveHeaders:arguments[3]});try{if(!this.size)throw new n.DOMException(n.DOMException.INVALID_STATE_ERR);if(this.width>f.MAX_RESIZE_WIDTH||this.height>f.MAX_RESIZE_HEIGHT)throw new n.ImageError(n.ImageError.MAX_RESOLUTION_ERR);this.exec("Image","downsize",t.width,t.height,t.crop,t.preserveHeaders)}catch(r){this.trigger("error",r.code)}},crop:function(e,t,n){this.downsize(e,t,!0,n)},getAsCanvas:function(){if(!u.can("create_canvas"))throw new n.RuntimeError(n.RuntimeError.NOT_SUPPORTED_ERR);var e=this.connectRuntime(this.ruid);return e.exec.call(this,"Image","getAsCanvas")},getAsBlob:function(e,t){if(!this.size)throw new n.DOMException(n.DOMException.INVALID_STATE_ERR);return this.exec("Image","getAsBlob",e||"image/jpeg",t||90)},getAsDataURL:function(e,t){if(!this.size)throw new n.DOMException(n.DOMException.INVALID_STATE_ERR);return this.exec("Image","getAsDataURL",e||"image/jpeg",t||90)},getAsBinaryString:function(e,t){var n=this.getAsDataURL(e,t);return h.atob(n.substring(n.indexOf("base64,")+7))},embed:function(i,r){function o(t,r){var o=this;if(u.can("create_canvas")){var l=o.getAsCanvas();if(l)return i.appendChild(l),l=null,o.destroy(),void a.trigger("embedded")}var d=o.getAsDataURL(t,r);if(!d)throw new n.ImageError(n.ImageError.WRONG_FORMAT);if(u.can("use_data_uri_of",d.length))i.innerHTML='<img src="'+d+'" width="'+o.width+'" height="'+o.height+'" />',o.destroy(),a.trigger("embedded");else{var f=new s;f.bind("TransportingComplete",function(){c=a.connectRuntime(this.result.ruid),a.bind("Embedded",function(){e.extend(c.getShimContainer().style,{top:"0px",left:"0px",width:o.width+"px",height:o.height+"px"}),c=null},999),c.exec.call(a,"ImageView","display",this.result.uid,width,height),o.destroy()}),f.transport(h.atob(d.substring(d.indexOf("base64,")+7)),t,{required_caps:{display_media:!0},runtime_order:"flash,silverlight",container:i})}}var a=this,c;r=e.extend({width:this.width,height:this.height,type:this.type||"image/jpeg",quality:90},r||{});try{if(!(i=t.get(i)))throw new n.DOMException(n.DOMException.INVALID_NODE_TYPE_ERR);if(!this.size)throw new n.DOMException(n.DOMException.INVALID_STATE_ERR);this.width>f.MAX_RESIZE_WIDTH||this.height>f.MAX_RESIZE_HEIGHT;var l=new f;return l.bind("Resize",function(){o.call(this,r.type,r.quality)}),l.bind("Load",function(){l.downsize(r)}),this.meta.thumb&&this.meta.thumb.width>=r.width&&this.meta.thumb.height>=r.height?l.load(this.meta.thumb.data):l.clone(this,!1),l}catch(d){this.trigger("error",d.code)}},destroy:function(){this.ruid&&(this.getRuntime().exec.call(this,"Image","destroy"),this.disconnectRuntime()),this.unbindAll()}}),this.handleEventProps(p),this.bind("Load Resize",function(){i.call(this)},999)}var p=["progress","load","error","resize","embedded"];return f.MAX_RESIZE_WIDTH=8192,f.MAX_RESIZE_HEIGHT=8192,f.prototype=c.instance,f}),i(D,[u,f,m,c],function(e,t,n,i){function r(t){var r=this,s=n.capTest,u=n.capTrue,c=e.extend({access_binary:s(window.FileReader||window.File&&window.File.getAsDataURL),access_image_binary:function(){return r.can("access_binary")&&!!a.Image},display_media:s(i.can("create_canvas")||i.can("use_data_uri_over32kb")),do_cors:s(window.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest),drag_and_drop:s(function(){var e=document.createElement("div");return("draggable"in e||"ondragstart"in e&&"ondrop"in e)&&("IE"!==i.browser||i.verComp(i.version,9,">"))}()),filter_by_extension:s(function(){return"Chrome"===i.browser&&i.verComp(i.version,28,">=")||"IE"===i.browser&&i.verComp(i.version,10,">=")||"Safari"===i.browser&&i.verComp(i.version,7,">=")}()),return_response_headers:u,return_response_type:function(e){return"json"===e&&window.JSON?!0:i.can("return_response_type",e)},return_status_code:u,report_upload_progress:s(window.XMLHttpRequest&&(new XMLHttpRequest).upload),resize_image:function(){return r.can("access_binary")&&i.can("create_canvas")},select_file:function(){return i.can("use_fileinput")&&window.File},select_folder:function(){return r.can("select_file")&&"Chrome"===i.browser&&i.verComp(i.version,21,">=")},select_multiple:function(){return!(!r.can("select_file")||"Safari"===i.browser&&"Windows"===i.os||"iOS"===i.os&&i.verComp(i.osVersion,"7.0.0",">")&&i.verComp(i.osVersion,"8.0.0","<"))},send_binary_string:s(window.XMLHttpRequest&&((new XMLHttpRequest).sendAsBinary||window.Uint8Array&&window.ArrayBuffer)),send_custom_headers:s(window.XMLHttpRequest),send_multipart:function(){return!!(window.XMLHttpRequest&&(new XMLHttpRequest).upload&&window.FormData)||r.can("send_binary_string")},slice_blob:s(window.File&&(File.prototype.mozSlice||File.prototype.webkitSlice||File.prototype.slice)),stream_upload:function(){return r.can("slice_blob")&&r.can("send_multipart")},summon_file_dialog:function(){return r.can("select_file")&&("Firefox"===i.browser&&i.verComp(i.version,4,">=")||"Opera"===i.browser&&i.verComp(i.version,12,">=")||"IE"===i.browser&&i.verComp(i.version,10,">=")||!!~e.inArray(i.browser,["Chrome","Safari"]))},upload_filesize:u},arguments[2]);n.call(this,t,arguments[1]||o,c),e.extend(this,{init:function(){this.trigger("Init")},destroy:function(e){return function(){e.call(r),e=r=null}}(this.destroy)}),e.extend(this.getShim(),a)}var o="html5",a={};return n.addConstructor(o,r),a}),i(N,[u],function(e){function t(){this.returnValue=!1}function n(){this.cancelBubble=!0}var i={},r="moxie_"+e.guid(),o=function(o,a,s,u){var c,l;a=a.toLowerCase(),o.addEventListener?(c=s,o.addEventListener(a,c,!1)):o.attachEvent&&(c=function(){var e=window.event;e.target||(e.target=e.srcElement),e.preventDefault=t,e.stopPropagation=n,s(e)},o.attachEvent("on"+a,c)),o[r]||(o[r]=e.guid()),i.hasOwnProperty(o[r])||(i[o[r]]={}),l=i[o[r]],l.hasOwnProperty(a)||(l[a]=[]),l[a].push({func:c,orig:s,key:u})},a=function(t,n,o){var a,s;if(n=n.toLowerCase(),t[r]&&i[t[r]]&&i[t[r]][n]){a=i[t[r]][n];for(var u=a.length-1;u>=0&&(a[u].orig!==o&&a[u].key!==o||(t.removeEventListener?t.removeEventListener(n,a[u].func,!1):t.detachEvent&&t.detachEvent("on"+n,a[u].func),a[u].orig=null,a[u].func=null,a.splice(u,1),o===s));u--);if(a.length||delete i[t[r]][n],e.isEmptyObj(i[t[r]])){delete i[t[r]];try{delete t[r]}catch(c){t[r]=s}}}},s=function(t,n){t&&t[r]&&e.each(i[t[r]],function(e,i){a(t,i,n)})};return{addEvent:o,removeEvent:a,removeAllEvents:s}}),i(L,[D,E,u,h,N,d,c],function(e,t,n,i,r,o,a){function s(){var e;n.extend(this,{init:function(s){var u=this,c=u.getRuntime(),l,d,h,f,p,m;e=s,h=e.accept.mimes||o.extList2mimes(e.accept,c.can("filter_by_extension")),d=c.getShimContainer(),d.innerHTML='<input id="'+c.uid+'" type="file" style="font-size:999px;opacity:0;"'+(e.multiple&&c.can("select_multiple")?"multiple":"")+(e.directory&&c.can("select_folder")?"webkitdirectory directory":"")+(h?' accept="'+h.join(",")+'"':"")+" />",l=i.get(c.uid),n.extend(l.style,{position:"absolute",top:0,left:0,width:"100%",height:"100%"}),f=i.get(e.browse_button),c.can("summon_file_dialog")&&("static"===i.getStyle(f,"position")&&(f.style.position="relative"),p=parseInt(i.getStyle(f,"z-index"),10)||1,f.style.zIndex=p,d.style.zIndex=p-1,r.addEvent(f,"click",function(e){var t=i.get(c.uid);t&&!t.disabled&&t.click(),e.preventDefault()},u.uid)),m=c.can("summon_file_dialog")?f:d,r.addEvent(m,"mouseover",function(){u.trigger("mouseenter")},u.uid),r.addEvent(m,"mouseout",function(){u.trigger("mouseleave")},u.uid),r.addEvent(m,"mousedown",function(){u.trigger("mousedown")},u.uid),r.addEvent(i.get(e.container),"mouseup",function(){u.trigger("mouseup")},u.uid),l.onchange=function g(i){if(u.files=[],n.each(this.files,function(n){var i="";return e.directory&&"."==n.name?!0:(n.webkitRelativePath&&(i="/"+n.webkitRelativePath.replace(/^\//,"")),n=new t(c.uid,n),n.relativePath=i,void u.files.push(n))}),"IE"!==a.browser&&"IEMobile"!==a.browser)this.value="";else{var r=this.cloneNode(!0);this.parentNode.replaceChild(r,this),r.onchange=g}u.files.length&&u.trigger("change")},u.trigger({type:"ready",async:!0}),d=null},disable:function(e){var t=this.getRuntime(),n;(n=i.get(t.uid))&&(n.disabled=!!e)},destroy:function(){var t=this.getRuntime(),n=t.getShim(),o=t.getShimContainer();r.removeAllEvents(o,this.uid),r.removeAllEvents(e&&i.get(e.container),this.uid),r.removeAllEvents(e&&i.get(e.browse_button),this.uid),o&&(o.innerHTML=""),n.removeInstance(this.uid),e=o=n=null}})}return e.FileInput=s}),i(C,[D,y],function(e,t){function n(){function e(e,t,n){var i;if(!window.File.prototype.slice)return(i=window.File.prototype.webkitSlice||window.File.prototype.mozSlice)?i.call(e,t,n):null;try{return e.slice(),e.slice(t,n)}catch(r){return e.slice(t,n-t)}}this.slice=function(){return new t(this.getRuntime().uid,e.apply(this,arguments))}}return e.Blob=n}),i(M,[D,E,u,h,N,d],function(e,t,n,i,r,o){function a(){function e(e){if(!e.dataTransfer||!e.dataTransfer.types)return!1;var t=n.toArray(e.dataTransfer.types||[]);return-1!==n.inArray("Files",t)||-1!==n.inArray("public.file-url",t)||-1!==n.inArray("application/x-moz-file",t)}function a(e,n){if(u(e)){var i=new t(g,e);i.relativePath=n||"",f.push(i)}}function s(e){for(var t=[],i=0;i<e.length;i++)[].push.apply(t,e[i].extensions.split(/\s*,\s*/));return-1===n.inArray("*",t)?t:[]}function u(e){if(!p.length)return!0;var t=o.getFileExtension(e.name);return!t||-1!==n.inArray(t,p)}function c(e,t){var i=[];n.each(e,function(e){var t=e.webkitGetAsEntry();t&&(t.isFile?a(e.getAsFile(),t.fullPath):i.push(t))}),i.length?l(i,t):t()}function l(e,t){var i=[];n.each(e,function(e){i.push(function(t){d(e,t)})}),n.inSeries(i,function(){t()})}function d(e,t){e.isFile?e.file(function(n){a(n,e.fullPath),t()},function(){t()}):e.isDirectory?h(e,t):t()}function h(e,t){function n(e){r.readEntries(function(t){t.length?([].push.apply(i,t),n(e)):e()},e)}var i=[],r=e.createReader();n(function(){l(i,t)})}var f=[],p=[],m,g;n.extend(this,{init:function(t){var i=this,o;m=t,g=i.ruid,p=s(m.accept),o=m.container,r.addEvent(o,"dragover",function(t){e(t)&&(t.preventDefault(),t.dataTransfer.dropEffect="copy")},i.uid),r.addEvent(o,"drop",function(t){e(t)&&(t.preventDefault(),f=[],t.dataTransfer.items&&t.dataTransfer.items[0].webkitGetAsEntry?c(t.dataTransfer.items,function(){i.files=f,i.trigger("drop")}):(n.each(t.dataTransfer.files,function(e){a(e)}),i.files=f,i.trigger("drop")))},i.uid),r.addEvent(o,"dragenter",function(e){i.trigger("dragenter")},i.uid),r.addEvent(o,"dragleave",function(e){i.trigger("dragleave")},i.uid)},destroy:function(){r.removeAllEvents(m&&i.get(m.container),this.uid),g=f=p=m=null}})}return e.FileDrop=a}),i(F,[D,w,u],function(e,t,n){function i(){function e(e){return t.atob(e.substring(e.indexOf("base64,")+7))}var i,r=!1;n.extend(this,{read:function(t,o){var a=this;a.result="",i=new window.FileReader,i.addEventListener("progress",function(e){a.trigger(e)}),i.addEventListener("load",function(t){a.result=r?e(i.result):i.result,a.trigger(t)}),i.addEventListener("error",function(e){a.trigger(e,i.error)}),i.addEventListener("loadend",function(e){i=null,a.trigger(e)}),"function"===n.typeOf(i[t])?(r=!1,i[t](o.getSource())):"readAsBinaryString"===t&&(r=!0,i.readAsDataURL(o.getSource()))},abort:function(){i&&i.abort()},destroy:function(){i=null}})}return e.FileReader=i}),i(P,[D,u,d,x,E,y,I,f,c],function(e,t,n,i,r,o,a,s,u){function c(){function e(e,t){var n=this,i,r;i=t.getBlob().getSource(),r=new window.FileReader,r.onload=function(){t.append(t.getBlobName(),new o(null,{type:i.type,data:r.result})),h.send.call(n,e,t)},r.readAsBinaryString(i)}function c(){return!window.XMLHttpRequest||"IE"===u.browser&&u.verComp(u.version,8,"<")?function(){for(var e=["Msxml2.XMLHTTP.6.0","Microsoft.XMLHTTP"],t=0;t<e.length;t++)try{return new ActiveXObject(e[t])}catch(n){}}():new window.XMLHttpRequest}function l(e){var t=e.responseXML,n=e.responseText;return"IE"===u.browser&&n&&t&&!t.documentElement&&/[^\/]+\/[^\+]+\+xml/.test(e.getResponseHeader("Content-Type"))&&(t=new window.ActiveXObject("Microsoft.XMLDOM"),t.async=!1,t.validateOnParse=!1,t.loadXML(n)),t&&("IE"===u.browser&&0!==t.parseError||!t.documentElement||"parsererror"===t.documentElement.tagName)?null:t}function d(e){var t="----moxieboundary"+(new Date).getTime(),n="--",i="\r\n",r="",a=this.getRuntime();if(!a.can("send_binary_string"))throw new s.RuntimeError(s.RuntimeError.NOT_SUPPORTED_ERR);return f.setRequestHeader("Content-Type","multipart/form-data; boundary="+t),e.each(function(e,a){r+=e instanceof o?n+t+i+'Content-Disposition: form-data; name="'+a+'"; filename="'+unescape(encodeURIComponent(e.name||"blob"))+'"'+i+"Content-Type: "+(e.type||"application/octet-stream")+i+i+e.getSource()+i:n+t+i+'Content-Disposition: form-data; name="'+a+'"'+i+i+unescape(encodeURIComponent(e))+i}),r+=n+t+n+i}var h=this,f,p;t.extend(this,{send:function(n,r){var s=this,l="Mozilla"===u.browser&&u.verComp(u.version,4,">=")&&u.verComp(u.version,7,"<"),h="Android Browser"===u.browser,m=!1;if(p=n.url.replace(/^.+?\/([\w\-\.]+)$/,"$1").toLowerCase(),f=c(),f.open(n.method,n.url,n.async,n.user,n.password),r instanceof o)r.isDetached()&&(m=!0),r=r.getSource();else if(r instanceof a){if(r.hasBlob())if(r.getBlob().isDetached())r=d.call(s,r),m=!0;else if((l||h)&&"blob"===t.typeOf(r.getBlob().getSource())&&window.FileReader)return void e.call(s,n,r);if(r instanceof a){var g=new window.FormData;r.each(function(e,t){e instanceof o?g.append(t,e.getSource()):g.append(t,e)}),r=g}}f.upload?(n.withCredentials&&(f.withCredentials=!0),f.addEventListener("load",function(e){s.trigger(e)}),f.addEventListener("error",function(e){s.trigger(e)}),f.addEventListener("progress",function(e){s.trigger(e)}),f.upload.addEventListener("progress",function(e){s.trigger({type:"UploadProgress",loaded:e.loaded,total:e.total})})):f.onreadystatechange=function v(){switch(f.readyState){case 1:break;case 2:break;case 3:var e,t;try{i.hasSameOrigin(n.url)&&(e=f.getResponseHeader("Content-Length")||0),f.responseText&&(t=f.responseText.length)}catch(r){e=t=0}s.trigger({type:"progress",lengthComputable:!!e,total:parseInt(e,10),loaded:t});break;case 4:f.onreadystatechange=function(){},s.trigger(0===f.status?"error":"load")}},t.isEmptyObj(n.headers)||t.each(n.headers,function(e,t){f.setRequestHeader(t,e)}),""!==n.responseType&&"responseType"in f&&("json"!==n.responseType||u.can("return_response_type","json")?f.responseType=n.responseType:f.responseType="text"),m?f.sendAsBinary?f.sendAsBinary(r):!function(){for(var e=new Uint8Array(r.length),t=0;t<r.length;t++)e[t]=255&r.charCodeAt(t);f.send(e.buffer)}():f.send(r),s.trigger("loadstart")},getStatus:function(){try{if(f)return f.status}catch(e){}return 0},getResponse:function(e){var t=this.getRuntime();try{switch(e){case"blob":var i=new r(t.uid,f.response),o=f.getResponseHeader("Content-Disposition");if(o){var a=o.match(/filename=([\'\"'])([^\1]+)\1/);a&&(p=a[2])}return i.name=p,i.type||(i.type=n.getFileMime(p)),i;case"json":return u.can("return_response_type","json")?f.response:200===f.status&&window.JSON?JSON.parse(f.responseText):null;case"document":return l(f);default:return""!==f.responseText?f.responseText:null}}catch(s){return null}},getAllResponseHeaders:function(){try{return f.getAllResponseHeaders()}catch(e){}return""},abort:function(){f&&f.abort()},destroy:function(){h=p=null}})}return e.XMLHttpRequest=c}),i(H,[u],function(e){function t(e){e instanceof ArrayBuffer?n.apply(this,arguments):i.apply(this,arguments)}function n(t){var n=new DataView(t);e.extend(this,{readByteAt:function(e){return n.getUint8(e)},writeByteAt:function(e,t){n.setUint8(e,t)},SEGMENT:function(e,i,r){switch(arguments.length){case 2:return t.slice(e,e+i);case 1:return t.slice(e);case 3:if(null===r&&(r=new ArrayBuffer),r instanceof ArrayBuffer){var o=new Uint8Array(this.length()-i+r.byteLength);e>0&&o.set(new Uint8Array(t.slice(0,e)),0),o.set(new Uint8Array(r),e),o.set(new Uint8Array(t.slice(e+i)),e+r.byteLength),this.clear(),t=o.buffer,n=new DataView(t);break}default:return t}},length:function(){return t?t.byteLength:0},clear:function(){n=t=null}})}function i(t){function n(e,n,i){i=3===arguments.length?i:t.length-n-1,t=t.substr(0,n)+e+t.substr(i+n)}e.extend(this,{readByteAt:function(e){return t.charCodeAt(e)},writeByteAt:function(e,t){n(String.fromCharCode(t),e,1)},SEGMENT:function(e,i,r){switch(arguments.length){case 1:return t.substr(e);case 2:return t.substr(e,i);case 3:n(null!==r?r:"",e,i);break;default:return t}},length:function(){return t?t.length:0},clear:function(){t=null}})}return e.extend(t.prototype,{littleEndian:!1,read:function(e,t){var n,i,r;if(e+t>this.length())throw new Error("You are trying to read outside the source boundaries.");for(i=this.littleEndian?0:-8*(t-1),r=0,n=0;t>r;r++)n|=this.readByteAt(e+r)<<Math.abs(i+8*r);return n},write:function(e,t,n){var i,r,o="";if(e>this.length())throw new Error("You are trying to write outside the source boundaries.");for(i=this.littleEndian?0:-8*(n-1),r=0;n>r;r++)this.writeByteAt(e+r,t>>Math.abs(i+8*r)&255)},BYTE:function(e){return this.read(e,1)},SHORT:function(e){return this.read(e,2)},LONG:function(e){return this.read(e,4)},SLONG:function(e){var t=this.read(e,4);return t>2147483647?t-4294967296:t},CHAR:function(e){return String.fromCharCode(this.read(e,1))},STRING:function(e,t){return this.asArray("CHAR",e,t).join("")},asArray:function(e,t,n){for(var i=[],r=0;n>r;r++)i[r]=this[e](t+r);return i}}),t}),i(B,[H,f],function(e,t){return function n(i){var r=[],o,a,s,u=0;if(o=new e(i),65496!==o.SHORT(0))throw o.clear(),new t.ImageError(t.ImageError.WRONG_FORMAT);for(a=2;a<=o.length();)if(s=o.SHORT(a),s>=65488&&65495>=s)a+=2;else{if(65498===s||65497===s)break;u=o.SHORT(a+2)+2,s>=65505&&65519>=s&&r.push({hex:s,name:"APP"+(15&s),start:a,length:u,segment:o.SEGMENT(a,u)}),a+=u}return o.clear(),{headers:r,restore:function(t){var n,i,o;for(o=new e(t),a=65504==o.SHORT(2)?4+o.SHORT(4):2,i=0,n=r.length;n>i;i++)o.SEGMENT(a,0,r[i].segment),a+=r[i].length;return t=o.SEGMENT(),o.clear(),t},strip:function(t){var i,r,o,a;for(o=new n(t),r=o.headers,o.purge(),i=new e(t),a=r.length;a--;)i.SEGMENT(r[a].start,r[a].length,"");return t=i.SEGMENT(),i.clear(),t},get:function(e){for(var t=[],n=0,i=r.length;i>n;n++)r[n].name===e.toUpperCase()&&t.push(r[n].segment);return t},
+set:function(e,t){var n=[],i,o,a;for("string"==typeof t?n.push(t):n=t,i=o=0,a=r.length;a>i&&(r[i].name===e.toUpperCase()&&(r[i].segment=n[o],r[i].length=n[o].length,o++),!(o>=n.length));i++);},purge:function(){this.headers=r=[]}}}}),i(k,[u,H,f],function(e,n,i){function r(o){function a(n,r){var o=this,a,s,u,c,h,f,p,m,g=[],v={},w={1:"BYTE",7:"UNDEFINED",2:"ASCII",3:"SHORT",4:"LONG",5:"RATIONAL",9:"SLONG",10:"SRATIONAL"},y={BYTE:1,UNDEFINED:1,ASCII:1,SHORT:2,LONG:4,RATIONAL:8,SLONG:4,SRATIONAL:8};for(a=o.SHORT(n),s=0;a>s;s++)if(g=[],p=n+2+12*s,u=r[o.SHORT(p)],u!==t){if(c=w[o.SHORT(p+=2)],h=o.LONG(p+=2),f=y[c],!f)throw new i.ImageError(i.ImageError.INVALID_META_ERR);if(p+=4,f*h>4&&(p=o.LONG(p)+d.tiffHeader),p+f*h>=this.length())throw new i.ImageError(i.ImageError.INVALID_META_ERR);"ASCII"!==c?(g=o.asArray(c,p,h),m=1==h?g[0]:g,l.hasOwnProperty(u)&&"object"!=typeof m?v[u]=l[u][m]:v[u]=m):v[u]=e.trim(o.STRING(p,h).replace(/\0$/,""))}return v}function s(e,t,n){var i,r,o,a=0;if("string"==typeof t){var s=c[e.toLowerCase()];for(var u in s)if(s[u]===t){t=u;break}}i=d[e.toLowerCase()+"IFD"],r=this.SHORT(i);for(var l=0;r>l;l++)if(o=i+12*l+2,this.SHORT(o)==t){a=o+8;break}if(!a)return!1;try{this.write(a,n,4)}catch(h){return!1}return!0}var u,c,l,d,h,f;if(n.call(this,o),c={tiff:{274:"Orientation",270:"ImageDescription",271:"Make",272:"Model",305:"Software",34665:"ExifIFDPointer",34853:"GPSInfoIFDPointer"},exif:{36864:"ExifVersion",40961:"ColorSpace",40962:"PixelXDimension",40963:"PixelYDimension",36867:"DateTimeOriginal",33434:"ExposureTime",33437:"FNumber",34855:"ISOSpeedRatings",37377:"ShutterSpeedValue",37378:"ApertureValue",37383:"MeteringMode",37384:"LightSource",37385:"Flash",37386:"FocalLength",41986:"ExposureMode",41987:"WhiteBalance",41990:"SceneCaptureType",41988:"DigitalZoomRatio",41992:"Contrast",41993:"Saturation",41994:"Sharpness"},gps:{0:"GPSVersionID",1:"GPSLatitudeRef",2:"GPSLatitude",3:"GPSLongitudeRef",4:"GPSLongitude"},thumb:{513:"JPEGInterchangeFormat",514:"JPEGInterchangeFormatLength"}},l={ColorSpace:{1:"sRGB",0:"Uncalibrated"},MeteringMode:{0:"Unknown",1:"Average",2:"CenterWeightedAverage",3:"Spot",4:"MultiSpot",5:"Pattern",6:"Partial",255:"Other"},LightSource:{1:"Daylight",2:"Fliorescent",3:"Tungsten",4:"Flash",9:"Fine weather",10:"Cloudy weather",11:"Shade",12:"Daylight fluorescent (D 5700 - 7100K)",13:"Day white fluorescent (N 4600 -5400K)",14:"Cool white fluorescent (W 3900 - 4500K)",15:"White fluorescent (WW 3200 - 3700K)",17:"Standard light A",18:"Standard light B",19:"Standard light C",20:"D55",21:"D65",22:"D75",23:"D50",24:"ISO studio tungsten",255:"Other"},Flash:{0:"Flash did not fire",1:"Flash fired",5:"Strobe return light not detected",7:"Strobe return light detected",9:"Flash fired, compulsory flash mode",13:"Flash fired, compulsory flash mode, return light not detected",15:"Flash fired, compulsory flash mode, return light detected",16:"Flash did not fire, compulsory flash mode",24:"Flash did not fire, auto mode",25:"Flash fired, auto mode",29:"Flash fired, auto mode, return light not detected",31:"Flash fired, auto mode, return light detected",32:"No flash function",65:"Flash fired, red-eye reduction mode",69:"Flash fired, red-eye reduction mode, return light not detected",71:"Flash fired, red-eye reduction mode, return light detected",73:"Flash fired, compulsory flash mode, red-eye reduction mode",77:"Flash fired, compulsory flash mode, red-eye reduction mode, return light not detected",79:"Flash fired, compulsory flash mode, red-eye reduction mode, return light detected",89:"Flash fired, auto mode, red-eye reduction mode",93:"Flash fired, auto mode, return light not detected, red-eye reduction mode",95:"Flash fired, auto mode, return light detected, red-eye reduction mode"},ExposureMode:{0:"Auto exposure",1:"Manual exposure",2:"Auto bracket"},WhiteBalance:{0:"Auto white balance",1:"Manual white balance"},SceneCaptureType:{0:"Standard",1:"Landscape",2:"Portrait",3:"Night scene"},Contrast:{0:"Normal",1:"Soft",2:"Hard"},Saturation:{0:"Normal",1:"Low saturation",2:"High saturation"},Sharpness:{0:"Normal",1:"Soft",2:"Hard"},GPSLatitudeRef:{N:"North latitude",S:"South latitude"},GPSLongitudeRef:{E:"East longitude",W:"West longitude"}},d={tiffHeader:10},h=d.tiffHeader,u={clear:this.clear},e.extend(this,{read:function(){try{return r.prototype.read.apply(this,arguments)}catch(e){throw new i.ImageError(i.ImageError.INVALID_META_ERR)}},write:function(){try{return r.prototype.write.apply(this,arguments)}catch(e){throw new i.ImageError(i.ImageError.INVALID_META_ERR)}},UNDEFINED:function(){return this.BYTE.apply(this,arguments)},RATIONAL:function(e){return this.LONG(e)/this.LONG(e+4)},SRATIONAL:function(e){return this.SLONG(e)/this.SLONG(e+4)},ASCII:function(e){return this.CHAR(e)},TIFF:function(){return f||null},EXIF:function(){var t=null;if(d.exifIFD){try{t=a.call(this,d.exifIFD,c.exif)}catch(n){return null}if(t.ExifVersion&&"array"===e.typeOf(t.ExifVersion)){for(var i=0,r="";i<t.ExifVersion.length;i++)r+=String.fromCharCode(t.ExifVersion[i]);t.ExifVersion=r}}return t},GPS:function(){var t=null;if(d.gpsIFD){try{t=a.call(this,d.gpsIFD,c.gps)}catch(n){return null}t.GPSVersionID&&"array"===e.typeOf(t.GPSVersionID)&&(t.GPSVersionID=t.GPSVersionID.join("."))}return t},thumb:function(){if(d.IFD1)try{var e=a.call(this,d.IFD1,c.thumb);if("JPEGInterchangeFormat"in e)return this.SEGMENT(d.tiffHeader+e.JPEGInterchangeFormat,e.JPEGInterchangeFormatLength)}catch(t){}return null},setExif:function(e,t){return"PixelXDimension"!==e&&"PixelYDimension"!==e?!1:s.call(this,"exif",e,t)},clear:function(){u.clear(),o=c=l=f=d=u=null}}),65505!==this.SHORT(0)||"EXIF\x00"!==this.STRING(4,5).toUpperCase())throw new i.ImageError(i.ImageError.INVALID_META_ERR);if(this.littleEndian=18761==this.SHORT(h),42!==this.SHORT(h+=2))throw new i.ImageError(i.ImageError.INVALID_META_ERR);d.IFD0=d.tiffHeader+this.LONG(h+=2),f=a.call(this,d.IFD0,c.tiff),"ExifIFDPointer"in f&&(d.exifIFD=d.tiffHeader+f.ExifIFDPointer,delete f.ExifIFDPointer),"GPSInfoIFDPointer"in f&&(d.gpsIFD=d.tiffHeader+f.GPSInfoIFDPointer,delete f.GPSInfoIFDPointer),e.isEmptyObj(f)&&(f=null);var p=this.LONG(d.IFD0+12*this.SHORT(d.IFD0)+2);p&&(d.IFD1=d.tiffHeader+p)}return r.prototype=n.prototype,r}),i(U,[u,f,B,H,k],function(e,t,n,i,r){function o(o){function a(e){var t=0,n,i;for(e||(e=c);t<=e.length();){if(n=e.SHORT(t+=2),n>=65472&&65475>=n)return t+=5,{height:e.SHORT(t),width:e.SHORT(t+=2)};i=e.SHORT(t+=2),t+=i-2}return null}function s(){var e=d.thumb(),t,n;return e&&(t=new i(e),n=a(t),t.clear(),n)?(n.data=e,n):null}function u(){d&&l&&c&&(d.clear(),l.purge(),c.clear(),h=l=d=c=null)}var c,l,d,h;if(c=new i(o),65496!==c.SHORT(0))throw new t.ImageError(t.ImageError.WRONG_FORMAT);l=new n(o);try{d=new r(l.get("app1")[0])}catch(f){}h=a.call(this),e.extend(this,{type:"image/jpeg",size:c.length(),width:h&&h.width||0,height:h&&h.height||0,setExif:function(t,n){return d?("object"===e.typeOf(t)?e.each(t,function(e,t){d.setExif(t,e)}):d.setExif(t,n),void l.set("app1",d.SEGMENT())):!1},writeHeaders:function(){return l.restore(arguments.length?arguments[0]:o)},stripHeaders:function(e){return l.strip(e)},purge:function(){u.call(this)}}),d&&(this.meta={tiff:d.TIFF(),exif:d.EXIF(),gps:d.GPS(),thumb:s()})}return o}),i(G,[f,u,H],function(e,t,n){function i(i){function r(){var e,t;return e=a.call(this,8),"IHDR"==e.type?(t=e.start,{width:s.LONG(t),height:s.LONG(t+=4)}):null}function o(){s&&(s.clear(),i=l=u=c=s=null)}function a(e){var t,n,i,r;return t=s.LONG(e),n=s.STRING(e+=4,4),i=e+=4,r=s.LONG(e+t),{length:t,type:n,start:i,CRC:r}}var s,u,c,l;s=new n(i),function(){var t=0,n=0,i=[35152,20039,3338,6666];for(n=0;n<i.length;n++,t+=2)if(i[n]!=s.SHORT(t))throw new e.ImageError(e.ImageError.WRONG_FORMAT)}(),l=r.call(this),t.extend(this,{type:"image/png",size:s.length(),width:l.width,height:l.height,purge:function(){o.call(this)}}),o.call(this)}return i}),i(z,[u,f,U,G],function(e,t,n,i){return function(r){var o=[n,i],a;a=function(){for(var e=0;e<o.length;e++)try{return new o[e](r)}catch(n){}throw new t.ImageError(t.ImageError.WRONG_FORMAT)}(),e.extend(this,{type:"",size:0,width:0,height:0,setExif:function(){},writeHeaders:function(e){return e},stripHeaders:function(e){return e},purge:function(){r=null}}),e.extend(this,a),this.purge=function(){a.purge(),a=null}}}),i(q,[],function(){function e(e,i,r){var o=e.naturalWidth,a=e.naturalHeight,s=r.width,u=r.height,c=r.x||0,l=r.y||0,d=i.getContext("2d");t(e)&&(o/=2,a/=2);var h=1024,f=document.createElement("canvas");f.width=f.height=h;for(var p=f.getContext("2d"),m=n(e,o,a),g=0;a>g;){for(var v=g+h>a?a-g:h,w=0;o>w;){var y=w+h>o?o-w:h;p.clearRect(0,0,h,h),p.drawImage(e,-w,-g);var E=w*s/o+c<<0,_=Math.ceil(y*s/o),b=g*u/a/m+l<<0,x=Math.ceil(v*u/a/m);d.drawImage(f,0,0,y,v,E,b,_,x),w+=h}g+=h}f=p=null}function t(e){var t=e.naturalWidth,n=e.naturalHeight;if(t*n>1048576){var i=document.createElement("canvas");i.width=i.height=1;var r=i.getContext("2d");return r.drawImage(e,-t+1,0),0===r.getImageData(0,0,1,1).data[3]}return!1}function n(e,t,n){var i=document.createElement("canvas");i.width=1,i.height=n;var r=i.getContext("2d");r.drawImage(e,0,0);for(var o=r.getImageData(0,0,1,n).data,a=0,s=n,u=n;u>a;){var c=o[4*(u-1)+3];0===c?s=u:a=u,u=s+a>>1}i=null;var l=u/n;return 0===l?1:l}return{isSubsampled:t,renderTo:e}}),i(j,[D,u,f,w,y,E,z,q,d,c],function(e,t,n,i,r,o,a,s,u,c){function l(){function e(){if(!_&&!y)throw new n.ImageError(n.DOMException.INVALID_STATE_ERR);return _||y}function l(e){return i.atob(e.substring(e.indexOf("base64,")+7))}function d(e,t){return"data:"+(t||"")+";base64,"+i.btoa(e)}function h(e){var t=this;y=new Image,y.onerror=function(){v.call(this),t.trigger("error",n.ImageError.WRONG_FORMAT)},y.onload=function(){t.trigger("load")},y.src="data:"==e.substr(0,5)?e:d(e,x.type)}function f(e,t){var i=this,r;return window.FileReader?(r=new FileReader,r.onload=function(){t(this.result)},r.onerror=function(){i.trigger("error",n.ImageError.WRONG_FORMAT)},r.readAsDataURL(e),void 0):t(e.getAsDataURL())}function p(n,i,r,o){var a=this,s,u,c=0,l=0,d,h,f,p;if(A=o,p=this.meta&&this.meta.tiff&&this.meta.tiff.Orientation||1,-1!==t.inArray(p,[5,6,7,8])){var v=n;n=i,i=v}return d=e(),r?(n=Math.min(n,d.width),i=Math.min(i,d.height),s=Math.max(n/d.width,i/d.height)):s=Math.min(n/d.width,i/d.height),s>1&&!r&&o?void this.trigger("Resize"):(_||(_=document.createElement("canvas")),h=Math.round(d.width*s),f=Math.round(d.height*s),r?(_.width=n,_.height=i,h>n&&(c=Math.round((h-n)/2)),f>i&&(l=Math.round((f-i)/2))):(_.width=h,_.height=f),A||g(_.width,_.height,p),m.call(this,d,_,-c,-l,h,f),this.width=_.width,this.height=_.height,R=!0,void a.trigger("Resize"))}function m(e,t,n,i,r,o){if("iOS"===c.OS)s.renderTo(e,t,{width:r,height:o,x:n,y:i});else{var a=t.getContext("2d");a.drawImage(e,n,i,r,o)}}function g(e,t,n){switch(n){case 5:case 6:case 7:case 8:_.width=t,_.height=e;break;default:_.width=e,_.height=t}var i=_.getContext("2d");switch(n){case 2:i.translate(e,0),i.scale(-1,1);break;case 3:i.translate(e,t),i.rotate(Math.PI);break;case 4:i.translate(0,t),i.scale(1,-1);break;case 5:i.rotate(.5*Math.PI),i.scale(1,-1);break;case 6:i.rotate(.5*Math.PI),i.translate(0,-t);break;case 7:i.rotate(.5*Math.PI),i.translate(e,-t),i.scale(-1,1);break;case 8:i.rotate(-.5*Math.PI),i.translate(-e,0)}}function v(){E&&(E.purge(),E=null),b=y=_=x=null,R=!1}var w=this,y,E,_,b,x,R=!1,A=!0;t.extend(this,{loadFromBlob:function(e){var t=this,i=t.getRuntime(),r=arguments.length>1?arguments[1]:!0;if(!i.can("access_binary"))throw new n.RuntimeError(n.RuntimeError.NOT_SUPPORTED_ERR);return x=e,e.isDetached()?(b=e.getSource(),void h.call(this,b)):void f.call(this,e.getSource(),function(e){r&&(b=l(e)),h.call(t,e)})},loadFromImage:function(e,t){this.meta=e.meta,x=new o(null,{name:e.name,size:e.size,type:e.type}),h.call(this,t?b=e.getAsBinaryString():e.getAsDataURL())},getInfo:function(){var t=this.getRuntime(),n;return!E&&b&&t.can("access_image_binary")&&(E=new a(b)),n={width:e().width||0,height:e().height||0,type:x.type||u.getFileMime(x.name),size:b&&b.length||x.size||0,name:x.name||"",meta:E&&E.meta||this.meta||{}},!n.meta||!n.meta.thumb||n.meta.thumb.data instanceof r||(n.meta.thumb.data=new r(null,{type:"image/jpeg",data:n.meta.thumb.data})),n},downsize:function(){p.apply(this,arguments)},getAsCanvas:function(){return _&&(_.id=this.uid+"_canvas"),_},getAsBlob:function(e,t){return e!==this.type&&p.call(this,this.width,this.height,!1),new o(null,{name:x.name||"",type:e,data:w.getAsBinaryString.call(this,e,t)})},getAsDataURL:function(e){var t=arguments[1]||90;if(!R)return y.src;if("image/jpeg"!==e)return _.toDataURL("image/png");try{return _.toDataURL("image/jpeg",t/100)}catch(n){return _.toDataURL("image/jpeg")}},getAsBinaryString:function(e,t){if(!R)return b||(b=l(w.getAsDataURL(e,t))),b;if("image/jpeg"!==e)b=l(w.getAsDataURL(e,t));else{var n;t||(t=90);try{n=_.toDataURL("image/jpeg",t/100)}catch(i){n=_.toDataURL("image/jpeg")}b=l(n),E&&(b=E.stripHeaders(b),A&&(E.meta&&E.meta.exif&&E.setExif({PixelXDimension:this.width,PixelYDimension:this.height}),b=E.writeHeaders(b)),E.purge(),E=null)}return R=!1,b},destroy:function(){w=null,v.call(this),this.getRuntime().getShim().removeInstance(this.uid)}})}return e.Image=l}),i(X,[u,c,h,f,m],function(e,t,n,i,r){function o(){var e;try{e=navigator.plugins["Shockwave Flash"],e=e.description}catch(t){try{e=new ActiveXObject("ShockwaveFlash.ShockwaveFlash").GetVariable("$version")}catch(n){e="0.0"}}return e=e.match(/\d+/g),parseFloat(e[0]+"."+e[1])}function a(e){var i=n.get(e);i&&"OBJECT"==i.nodeName&&("IE"===t.browser?(i.style.display="none",function r(){4==i.readyState?s(e):setTimeout(r,10)}()):i.parentNode.removeChild(i))}function s(e){var t=n.get(e);if(t){for(var i in t)"function"==typeof t[i]&&(t[i]=null);t.parentNode.removeChild(t)}}function u(s){var u=this,d;s=e.extend({swf_url:t.swf_url},s),r.call(this,s,c,{access_binary:function(e){return e&&"browser"===u.mode},access_image_binary:function(e){return e&&"browser"===u.mode},display_media:r.capTrue,do_cors:r.capTrue,drag_and_drop:!1,report_upload_progress:function(){return"client"===u.mode},resize_image:r.capTrue,return_response_headers:!1,return_response_type:function(t){return"json"===t&&window.JSON?!0:!e.arrayDiff(t,["","text","document"])||"browser"===u.mode},return_status_code:function(t){return"browser"===u.mode||!e.arrayDiff(t,[200,404])},select_file:r.capTrue,select_multiple:r.capTrue,send_binary_string:function(e){return e&&"browser"===u.mode},send_browser_cookies:function(e){return e&&"browser"===u.mode},send_custom_headers:function(e){return e&&"browser"===u.mode},send_multipart:r.capTrue,slice_blob:function(e){return e&&"browser"===u.mode},stream_upload:function(e){return e&&"browser"===u.mode},summon_file_dialog:!1,upload_filesize:function(t){return e.parseSizeStr(t)<=2097152||"client"===u.mode},use_http_method:function(t){return!e.arrayDiff(t,["GET","POST"])}},{access_binary:function(e){return e?"browser":"client"},access_image_binary:function(e){return e?"browser":"client"},report_upload_progress:function(e){return e?"browser":"client"},return_response_type:function(t){return e.arrayDiff(t,["","text","json","document"])?"browser":["client","browser"]},return_status_code:function(t){return e.arrayDiff(t,[200,404])?"browser":["client","browser"]},send_binary_string:function(e){return e?"browser":"client"},send_browser_cookies:function(e){return e?"browser":"client"},send_custom_headers:function(e){return e?"browser":"client"},stream_upload:function(e){return e?"client":"browser"},upload_filesize:function(t){return e.parseSizeStr(t)>=2097152?"client":"browser"}},"client"),o()<10&&(this.mode=!1),e.extend(this,{getShim:function(){return n.get(this.uid)},shimExec:function(e,t){var n=[].slice.call(arguments,2);return u.getShim().exec(this.uid,e,t,n)},init:function(){var n,r,o;o=this.getShimContainer(),e.extend(o.style,{position:"absolute",top:"-8px",left:"-8px",width:"9px",height:"9px",overflow:"hidden"}),n='<object id="'+this.uid+'" type="application/x-shockwave-flash" data="'+s.swf_url+'" ',"IE"===t.browser&&(n+='classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" '),n+='width="100%" height="100%" style="outline:0"><param name="movie" value="'+s.swf_url+'" /><param name="flashvars" value="uid='+escape(this.uid)+"&target="+t.global_event_dispatcher+'" /><param name="wmode" value="transparent" /><param name="allowscriptaccess" value="always" /></object>',"IE"===t.browser?(r=document.createElement("div"),o.appendChild(r),r.outerHTML=n,r=o=null):o.innerHTML=n,d=setTimeout(function(){u&&!u.initialized&&u.trigger("Error",new i.RuntimeError(i.RuntimeError.NOT_INIT_ERR))},5e3)},destroy:function(e){return function(){a(u.uid),e.call(u),clearTimeout(d),s=d=e=u=null}}(this.destroy)},l)}var c="flash",l={};return r.addConstructor(c,u),l}),i(V,[X,E,u],function(e,t,n){var i={init:function(e){var i=this,r=this.getRuntime();this.bind("Change",function(){var e=r.shimExec.call(i,"FileInput","getFiles");i.files=[],n.each(e,function(e){i.files.push(new t(r.uid,e))})},999),this.getRuntime().shimExec.call(this,"FileInput","init",{name:e.name,accept:e.accept,multiple:e.multiple}),this.trigger("ready")}};return e.FileInput=i}),i(W,[X,y],function(e,t){var n={slice:function(e,n,i,r){var o=this.getRuntime();return 0>n?n=Math.max(e.size+n,0):n>0&&(n=Math.min(n,e.size)),0>i?i=Math.max(e.size+i,0):i>0&&(i=Math.min(i,e.size)),e=o.shimExec.call(this,"Blob","slice",n,i,r||""),e&&(e=new t(o.uid,e)),e}};return e.Blob=n}),i(Y,[X,w],function(e,t){function n(e,n){switch(n){case"readAsText":return t.atob(e,"utf8");case"readAsBinaryString":return t.atob(e);case"readAsDataURL":return e}return null}var i={read:function(e,t){var i=this;return i.result="","readAsDataURL"===e&&(i.result="data:"+(t.type||"")+";base64,"),i.bind("Progress",function(t,r){r&&(i.result+=n(r,e))},999),i.getRuntime().shimExec.call(this,"FileReader","readAsBase64",t.uid)}};return e.FileReader=i}),i($,[X,w],function(e,t){function n(e,n){switch(n){case"readAsText":return t.atob(e,"utf8");case"readAsBinaryString":return t.atob(e);case"readAsDataURL":return e}return null}var i={read:function(e,t){var i,r=this.getRuntime();return(i=r.shimExec.call(this,"FileReaderSync","readAsBase64",t.uid))?("readAsDataURL"===e&&(i="data:"+(t.type||"")+";base64,"+i),n(i,e,t.type)):null}};return e.FileReaderSync=i}),i(J,[X,u,y,E,A,I,S],function(e,t,n,i,r,o,a){var s={send:function(e,i){function r(){e.transport=l.mode,l.shimExec.call(c,"XMLHttpRequest","send",e,i)}function s(e,t){l.shimExec.call(c,"XMLHttpRequest","appendBlob",e,t.uid),i=null,r()}function u(e,t){var n=new a;n.bind("TransportingComplete",function(){t(this.result)}),n.transport(e.getSource(),e.type,{ruid:l.uid})}var c=this,l=c.getRuntime();if(t.isEmptyObj(e.headers)||t.each(e.headers,function(e,t){l.shimExec.call(c,"XMLHttpRequest","setRequestHeader",t,e.toString())}),i instanceof o){var d;if(i.each(function(e,t){e instanceof n?d=t:l.shimExec.call(c,"XMLHttpRequest","append",t,e)}),i.hasBlob()){var h=i.getBlob();h.isDetached()?u(h,function(e){h.destroy(),s(d,e)}):s(d,h)}else i=null,r()}else i instanceof n?i.isDetached()?u(i,function(e){i.destroy(),i=e.uid,r()}):(i=i.uid,r()):r()},getResponse:function(e){var n,o,a=this.getRuntime();if(o=a.shimExec.call(this,"XMLHttpRequest","getResponseAsBlob")){if(o=new i(a.uid,o),"blob"===e)return o;try{if(n=new r,~t.inArray(e,["","text"]))return n.readAsText(o);if("json"===e&&window.JSON)return JSON.parse(n.readAsText(o))}finally{o.destroy()}}return null},abort:function(e){var t=this.getRuntime();t.shimExec.call(this,"XMLHttpRequest","abort"),this.dispatchEvent("readystatechange"),this.dispatchEvent("abort")}};return e.XMLHttpRequest=s}),i(Z,[X,y],function(e,t){var n={getAsBlob:function(e){var n=this.getRuntime(),i=n.shimExec.call(this,"Transporter","getAsBlob",e);return i?new t(n.uid,i):null}};return e.Transporter=n}),i(K,[X,u,S,y,A],function(e,t,n,i,r){var o={loadFromBlob:function(e){function t(e){r.shimExec.call(i,"Image","loadFromBlob",e.uid),i=r=null}var i=this,r=i.getRuntime();if(e.isDetached()){var o=new n;o.bind("TransportingComplete",function(){t(o.result.getSource())}),o.transport(e.getSource(),e.type,{ruid:r.uid})}else t(e.getSource())},loadFromImage:function(e){var t=this.getRuntime();return t.shimExec.call(this,"Image","loadFromImage",e.uid)},getInfo:function(){var e=this.getRuntime(),t=e.shimExec.call(this,"Image","getInfo");return!t.meta||!t.meta.thumb||t.meta.thumb.data instanceof i||(t.meta.thumb.data=new i(e.uid,t.meta.thumb.data)),t},getAsBlob:function(e,t){var n=this.getRuntime(),r=n.shimExec.call(this,"Image","getAsBlob",e,t);return r?new i(n.uid,r):null},getAsDataURL:function(){var e=this.getRuntime(),t=e.Image.getAsBlob.apply(this,arguments),n;return t?(n=new r,n.readAsDataURL(t)):null}};return e.Image=o}),i(Q,[u,c,h,f,m],function(e,t,n,i,r){function o(e){var t=!1,n=null,i,r,o,a,s,u=0;try{try{n=new ActiveXObject("AgControl.AgControl"),n.IsVersionSupported(e)&&(t=!0),n=null}catch(c){var l=navigator.plugins["Silverlight Plug-In"];if(l){for(i=l.description,"1.0.30226.2"===i&&(i="2.0.30226.2"),r=i.split(".");r.length>3;)r.pop();for(;r.length<4;)r.push(0);for(o=e.split(".");o.length>4;)o.pop();do a=parseInt(o[u],10),s=parseInt(r[u],10),u++;while(u<o.length&&a===s);s>=a&&!isNaN(a)&&(t=!0)}}}catch(d){t=!1}return t}function a(a){var c=this,l;a=e.extend({xap_url:t.xap_url},a),r.call(this,a,s,{access_binary:r.capTrue,access_image_binary:r.capTrue,display_media:r.capTrue,do_cors:r.capTrue,drag_and_drop:!1,report_upload_progress:r.capTrue,resize_image:r.capTrue,return_response_headers:function(e){return e&&"client"===c.mode},return_response_type:function(e){return"json"!==e?!0:!!window.JSON},return_status_code:function(t){return"client"===c.mode||!e.arrayDiff(t,[200,404])},select_file:r.capTrue,select_multiple:r.capTrue,send_binary_string:r.capTrue,send_browser_cookies:function(e){return e&&"browser"===c.mode},send_custom_headers:function(e){return e&&"client"===c.mode},send_multipart:r.capTrue,slice_blob:r.capTrue,stream_upload:!0,summon_file_dialog:!1,upload_filesize:r.capTrue,use_http_method:function(t){return"client"===c.mode||!e.arrayDiff(t,["GET","POST"])}},{return_response_headers:function(e){return e?"client":"browser"},return_status_code:function(t){return e.arrayDiff(t,[200,404])?"client":["client","browser"]},send_browser_cookies:function(e){return e?"browser":"client"},send_custom_headers:function(e){return e?"client":"browser"},use_http_method:function(t){return e.arrayDiff(t,["GET","POST"])?"client":["client","browser"]}}),o("2.0.31005.0")&&"Opera"!==t.browser||(this.mode=!1),e.extend(this,{getShim:function(){return n.get(this.uid).content.Moxie},shimExec:function(e,t){var n=[].slice.call(arguments,2);return c.getShim().exec(this.uid,e,t,n)},init:function(){var e;e=this.getShimContainer(),e.innerHTML='<object id="'+this.uid+'" data="data:application/x-silverlight," type="application/x-silverlight-2" width="100%" height="100%" style="outline:none;"><param name="source" value="'+a.xap_url+'"/><param name="background" value="Transparent"/><param name="windowless" value="true"/><param name="enablehtmlaccess" value="true"/><param name="initParams" value="uid='+this.uid+",target="+t.global_event_dispatcher+'"/></object>',l=setTimeout(function(){c&&!c.initialized&&c.trigger("Error",new i.RuntimeError(i.RuntimeError.NOT_INIT_ERR))},"Windows"!==t.OS?1e4:5e3)},destroy:function(e){return function(){e.call(c),clearTimeout(l),a=l=e=c=null}}(this.destroy)},u)}var s="silverlight",u={};return r.addConstructor(s,a),u}),i(ee,[Q,E,u],function(e,t,n){var i={init:function(e){function i(e){for(var t="",n=0;n<e.length;n++)t+=(""!==t?"|":"")+e[n].title+" | *."+e[n].extensions.replace(/,/g,";*.");return t}var r=this,o=this.getRuntime();this.bind("Change",function(){var e=o.shimExec.call(r,"FileInput","getFiles");r.files=[],n.each(e,function(e){r.files.push(new t(o.uid,e))})},999),this.getRuntime().shimExec.call(this,"FileInput","init",i(e.accept),e.name,e.multiple),this.trigger("ready")}};return e.FileInput=i}),i(te,[Q,u,W],function(e,t,n){return e.Blob=t.extend({},n)}),i(ne,[Q,h,N],function(e,t,n){var i={init:function(){var e=this,i=e.getRuntime(),r;return r=i.getShimContainer(),n.addEvent(r,"dragover",function(e){e.preventDefault(),e.stopPropagation(),e.dataTransfer.dropEffect="copy"},e.uid),n.addEvent(r,"dragenter",function(e){e.preventDefault();var n=t.get(i.uid).dragEnter(e);n&&e.stopPropagation()},e.uid),n.addEvent(r,"drop",function(e){e.preventDefault();var n=t.get(i.uid).dragDrop(e);n&&e.stopPropagation()},e.uid),i.shimExec.call(this,"FileDrop","init")}};return e.FileDrop=i}),i(ie,[Q,u,Y],function(e,t,n){return e.FileReader=t.extend({},n)}),i(re,[Q,u,$],function(e,t,n){return e.FileReaderSync=t.extend({},n)}),i(oe,[Q,u,J],function(e,t,n){return e.XMLHttpRequest=t.extend({},n)}),i(ae,[Q,u,Z],function(e,t,n){return e.Transporter=t.extend({},n)}),i(se,[Q,u,y,K],function(e,t,n,i){return e.Image=t.extend({},i,{getInfo:function(){var e=this.getRuntime(),i=["tiff","exif","gps","thumb"],r={meta:{}},o=e.shimExec.call(this,"Image","getInfo");return o.meta&&(t.each(i,function(e){var t=o.meta[e],n,i,a,s;if(t&&t.keys)for(r.meta[e]={},i=0,a=t.keys.length;a>i;i++)n=t.keys[i],s=t[n],s&&(/^(\d|[1-9]\d+)$/.test(s)?s=parseInt(s,10):/^\d*\.\d+$/.test(s)&&(s=parseFloat(s)),r.meta[e][n]=s)}),!r.meta||!r.meta.thumb||r.meta.thumb.data instanceof n||(r.meta.thumb.data=new n(e.uid,r.meta.thumb.data))),r.width=parseInt(o.width,10),r.height=parseInt(o.height,10),r.size=parseInt(o.size,10),r.type=o.type,r.name=o.name,r}})}),i(ue,[u,f,m,c],function(e,t,n,i){function r(t){var r=this,s=n.capTest,u=n.capTrue;n.call(this,t,o,{access_binary:s(window.FileReader||window.File&&File.getAsDataURL),access_image_binary:!1,display_media:s(a.Image&&(i.can("create_canvas")||i.can("use_data_uri_over32kb"))),do_cors:!1,drag_and_drop:!1,filter_by_extension:s(function(){return"Chrome"===i.browser&&i.verComp(i.version,28,">=")||"IE"===i.browser&&i.verComp(i.version,10,">=")||"Safari"===i.browser&&i.verComp(i.version,7,">=")}()),resize_image:function(){return a.Image&&r.can("access_binary")&&i.can("create_canvas")},report_upload_progress:!1,return_response_headers:!1,return_response_type:function(t){return"json"===t&&window.JSON?!0:!!~e.inArray(t,["text","document",""])},return_status_code:function(t){return!e.arrayDiff(t,[200,404])},select_file:function(){return i.can("use_fileinput")},select_multiple:!1,send_binary_string:!1,send_custom_headers:!1,send_multipart:!0,slice_blob:!1,stream_upload:function(){return r.can("select_file")},summon_file_dialog:function(){return r.can("select_file")&&("Firefox"===i.browser&&i.verComp(i.version,4,">=")||"Opera"===i.browser&&i.verComp(i.version,12,">=")||"IE"===i.browser&&i.verComp(i.version,10,">=")||!!~e.inArray(i.browser,["Chrome","Safari"]))},upload_filesize:u,use_http_method:function(t){return!e.arrayDiff(t,["GET","POST"])}}),e.extend(this,{init:function(){this.trigger("Init")},destroy:function(e){return function(){e.call(r),e=r=null}}(this.destroy)}),e.extend(this.getShim(),a)}var o="html4",a={};return n.addConstructor(o,r),a}),i(ce,[ue,E,u,h,N,d,c],function(e,t,n,i,r,o,a){function s(){function e(){var o=this,l=o.getRuntime(),d,h,f,p,m,g;g=n.guid("uid_"),d=l.getShimContainer(),s&&(f=i.get(s+"_form"),f&&n.extend(f.style,{top:"100%"})),p=document.createElement("form"),p.setAttribute("id",g+"_form"),p.setAttribute("method","post"),p.setAttribute("enctype","multipart/form-data"),p.setAttribute("encoding","multipart/form-data"),n.extend(p.style,{overflow:"hidden",position:"absolute",top:0,left:0,width:"100%",height:"100%"}),m=document.createElement("input"),m.setAttribute("id",g),m.setAttribute("type","file"),m.setAttribute("name",c.name||"Filedata"),m.setAttribute("accept",u.join(",")),n.extend(m.style,{fontSize:"999px",opacity:0}),p.appendChild(m),d.appendChild(p),n.extend(m.style,{position:"absolute",top:0,left:0,width:"100%",height:"100%"}),"IE"===a.browser&&a.verComp(a.version,10,"<")&&n.extend(m.style,{filter:"progid:DXImageTransform.Microsoft.Alpha(opacity=0)"}),m.onchange=function(){var n;if(this.value){if(this.files){if(n=this.files[0],0===n.size)return void p.parentNode.removeChild(p)}else n={name:this.value};n=new t(l.uid,n),this.onchange=function(){},e.call(o),o.files=[n],m.setAttribute("id",n.uid),p.setAttribute("id",n.uid+"_form"),o.trigger("change"),m=p=null}},l.can("summon_file_dialog")&&(h=i.get(c.browse_button),r.removeEvent(h,"click",o.uid),r.addEvent(h,"click",function(e){m&&!m.disabled&&m.click(),e.preventDefault()},o.uid)),s=g,d=f=h=null}var s,u=[],c;n.extend(this,{init:function(t){var n=this,a=n.getRuntime(),s;c=t,u=t.accept.mimes||o.extList2mimes(t.accept,a.can("filter_by_extension")),s=a.getShimContainer(),function(){var e,o,u;e=i.get(t.browse_button),a.can("summon_file_dialog")&&("static"===i.getStyle(e,"position")&&(e.style.position="relative"),o=parseInt(i.getStyle(e,"z-index"),10)||1,e.style.zIndex=o,s.style.zIndex=o-1),u=a.can("summon_file_dialog")?e:s,r.addEvent(u,"mouseover",function(){n.trigger("mouseenter")},n.uid),r.addEvent(u,"mouseout",function(){n.trigger("mouseleave")},n.uid),r.addEvent(u,"mousedown",function(){n.trigger("mousedown")},n.uid),r.addEvent(i.get(t.container),"mouseup",function(){n.trigger("mouseup")},n.uid),e=null}(),e.call(this),s=null,n.trigger({type:"ready",async:!0})},disable:function(e){var t;(t=i.get(s))&&(t.disabled=!!e)},destroy:function(){var e=this.getRuntime(),t=e.getShim(),n=e.getShimContainer();r.removeAllEvents(n,this.uid),r.removeAllEvents(c&&i.get(c.container),this.uid),r.removeAllEvents(c&&i.get(c.browse_button),this.uid),n&&(n.innerHTML=""),t.removeInstance(this.uid),s=u=c=n=t=null}})}return e.FileInput=s}),i(le,[ue,F],function(e,t){return e.FileReader=t}),i(de,[ue,u,h,x,f,N,y,I],function(e,t,n,i,r,o,a,s){function u(){function e(e){var t=this,i,r,a,s,u=!1;if(l){if(i=l.id.replace(/_iframe$/,""),r=n.get(i+"_form")){for(a=r.getElementsByTagName("input"),s=a.length;s--;)switch(a[s].getAttribute("type")){case"hidden":a[s].parentNode.removeChild(a[s]);break;case"file":u=!0}a=[],u||r.parentNode.removeChild(r),r=null}setTimeout(function(){o.removeEvent(l,"load",t.uid),l.parentNode&&l.parentNode.removeChild(l);var n=t.getRuntime().getShimContainer();n.children.length||n.parentNode.removeChild(n),n=l=null,e()},1)}}var u,c,l;t.extend(this,{send:function(d,h){function f(){var n=m.getShimContainer()||document.body,r=document.createElement("div");r.innerHTML='<iframe id="'+g+'_iframe" name="'+g+'_iframe" src="javascript:&quot;&quot;" style="display:none"></iframe>',l=r.firstChild,n.appendChild(l),o.addEvent(l,"load",function(){var n;try{n=l.contentWindow.document||l.contentDocument||window.frames[l.id].document,/^4(0[0-9]|1[0-7]|2[2346])\s/.test(n.title)?u=n.title.replace(/^(\d+).*$/,"$1"):(u=200,c=t.trim(n.body.innerHTML),p.trigger({type:"progress",loaded:c.length,total:c.length}),y&&p.trigger({type:"uploadprogress",loaded:y.size||1025,total:y.size||1025}))}catch(r){if(!i.hasSameOrigin(d.url))return void e.call(p,function(){p.trigger("error")});u=404}e.call(p,function(){p.trigger("load")})},p.uid)}var p=this,m=p.getRuntime(),g,v,w,y;if(u=c=null,h instanceof s&&h.hasBlob()){if(y=h.getBlob(),g=y.uid,w=n.get(g),v=n.get(g+"_form"),!v)throw new r.DOMException(r.DOMException.NOT_FOUND_ERR)}else g=t.guid("uid_"),v=document.createElement("form"),v.setAttribute("id",g+"_form"),v.setAttribute("method",d.method),v.setAttribute("enctype","multipart/form-data"),v.setAttribute("encoding","multipart/form-data"),m.getShimContainer().appendChild(v);v.setAttribute("target",g+"_iframe"),h instanceof s&&h.each(function(e,n){if(e instanceof a)w&&w.setAttribute("name",n);else{var i=document.createElement("input");t.extend(i,{type:"hidden",name:n,value:e}),w?v.insertBefore(i,w):v.appendChild(i)}}),v.setAttribute("action",d.url),f(),v.submit(),p.trigger("loadstart")},getStatus:function(){return u},getResponse:function(e){if("json"===e&&"string"===t.typeOf(c)&&window.JSON)try{
+return JSON.parse(c.replace(/^\s*<pre[^>]*>/,"").replace(/<\/pre>\s*$/,""))}catch(n){return null}return c},abort:function(){var t=this;l&&l.contentWindow&&(l.contentWindow.stop?l.contentWindow.stop():l.contentWindow.document.execCommand?l.contentWindow.document.execCommand("Stop"):l.src="about:blank"),e.call(this,function(){t.dispatchEvent("abort")})}})}return e.XMLHttpRequest=u}),i(he,[ue,j],function(e,t){return e.Image=t}),a([u,c,l,d,h,f,p,m,g,v,w,y,E,_,b,x,R,A,I,T,S,O,N])}(this);;(function(e){"use strict";var t={},n=e.moxie.core.utils.Basic.inArray;return function r(e){var i,s;for(i in e)s=typeof e[i],s==="object"&&!~n(i,["Exceptions","Env","Mime"])?r(e[i]):s==="function"&&(t[i]=e[i])}(e.moxie),t.Env=e.moxie.core.utils.Env,t.Mime=e.moxie.core.utils.Mime,t.Exceptions=e.moxie.core.Exceptions,e.mOxie=t,e.o||(e.o=t),t})(this);
+/**
+ * Plupload - multi-runtime File Uploader
+ * v2.1.8
+ *
+ * Copyright 2013, Moxiecode Systems AB
+ * Released under GPL License.
+ *
+ * License: http://www.plupload.com/license
+ * Contributing: http://www.plupload.com/contributing
+ *
+ * Date: 2015-07-21
+ */
+;(function(e,t,n){function s(e){function r(e,t,r){var i={chunks:"slice_blob",jpgresize:"send_binary_string",pngresize:"send_binary_string",progress:"report_upload_progress",multi_selection:"select_multiple",dragdrop:"drag_and_drop",drop_element:"drag_and_drop",headers:"send_custom_headers",urlstream_upload:"send_binary_string",canSendBinary:"send_binary",triggerDialog:"summon_file_dialog"};i[e]?n[i[e]]=t:r||(n[e]=t)}var t=e.required_features,n={};if(typeof t=="string")o.each(t.split(/\s*,\s*/),function(e){r(e,!0)});else if(typeof t=="object")o.each(t,function(e,t){r(t,e)});else if(t===!0){e.chunk_size>0&&(n.slice_blob=!0);if(e.resize.enabled||!e.multipart)n.send_binary_string=!0;o.each(e,function(e,t){r(t,!!e,!0)})}return n}var r=e.setTimeout,i={},o={VERSION:"2.1.8",STOPPED:1,STARTED:2,QUEUED:1,UPLOADING:2,FAILED:4,DONE:5,GENERIC_ERROR:-100,HTTP_ERROR:-200,IO_ERROR:-300,SECURITY_ERROR:-400,INIT_ERROR:-500,FILE_SIZE_ERROR:-600,FILE_EXTENSION_ERROR:-601,FILE_DUPLICATE_ERROR:-602,IMAGE_FORMAT_ERROR:-700,MEMORY_ERROR:-701,IMAGE_DIMENSIONS_ERROR:-702,mimeTypes:t.mimes,ua:t.ua,typeOf:t.typeOf,extend:t.extend,guid:t.guid,get:function(n){var r=[],i;t.typeOf(n)!=="array"&&(n=[n]);var s=n.length;while(s--)i=t.get(n[s]),i&&r.push(i);return r.length?r:null},each:t.each,getPos:t.getPos,getSize:t.getSize,xmlEncode:function(e){var t={"<":"lt",">":"gt","&":"amp",'"':"quot","'":"#39"},n=/[<>&\"\']/g;return e?(""+e).replace(n,function(e){return t[e]?"&"+t[e]+";":e}):e},toArray:t.toArray,inArray:t.inArray,addI18n:t.addI18n,translate:t.translate,isEmptyObj:t.isEmptyObj,hasClass:t.hasClass,addClass:t.addClass,removeClass:t.removeClass,getStyle:t.getStyle,addEvent:t.addEvent,removeEvent:t.removeEvent,removeAllEvents:t.removeAllEvents,cleanName:function(e){var t,n;n=[/[\300-\306]/g,"A",/[\340-\346]/g,"a",/\307/g,"C",/\347/g,"c",/[\310-\313]/g,"E",/[\350-\353]/g,"e",/[\314-\317]/g,"I",/[\354-\357]/g,"i",/\321/g,"N",/\361/g,"n",/[\322-\330]/g,"O",/[\362-\370]/g,"o",/[\331-\334]/g,"U",/[\371-\374]/g,"u"];for(t=0;t<n.length;t+=2)e=e.replace(n[t],n[t+1]);return e=e.replace(/\s+/g,"_"),e=e.replace(/[^a-z0-9_\-\.]+/gi,""),e},buildUrl:function(e,t){var n="";return o.each(t,function(e,t){n+=(n?"&":"")+encodeURIComponent(t)+"="+encodeURIComponent(e)}),n&&(e+=(e.indexOf("?")>0?"&":"?")+n),e},formatSize:function(e){function t(e,t){return Math.round(e*Math.pow(10,t))/Math.pow(10,t)}if(e===n||/\D/.test(e))return o.translate("N/A");var r=Math.pow(1024,4);return e>r?t(e/r,1)+" "+o.translate("tb"):e>(r/=1024)?t(e/r,1)+" "+o.translate("gb"):e>(r/=1024)?t(e/r,1)+" "+o.translate("mb"):e>1024?Math.round(e/1024)+" "+o.translate("kb"):e+" "+o.translate("b")},parseSize:t.parseSizeStr,predictRuntime:function(e,n){var r,i;return r=new o.Uploader(e),i=t.Runtime.thatCan(r.getOption().required_features,n||e.runtimes),r.destroy(),i},addFileFilter:function(e,t){i[e]=t}};o.addFileFilter("mime_types",function(e,t,n){e.length&&!e.regexp.test(t.name)?(this.trigger("Error",{code:o.FILE_EXTENSION_ERROR,message:o.translate("File extension error."),file:t}),n(!1)):n(!0)}),o.addFileFilter("max_file_size",function(e,t,n){var r;e=o.parseSize(e),t.size!==r&&e&&t.size>e?(this.trigger("Error",{code:o.FILE_SIZE_ERROR,message:o.translate("File size error."),file:t}),n(!1)):n(!0)}),o.addFileFilter("prevent_duplicates",function(e,t,n){if(e){var r=this.files.length;while(r--)if(t.name===this.files[r].name&&t.size===this.files[r].size){this.trigger("Error",{code:o.FILE_DUPLICATE_ERROR,message:o.translate("Duplicate file error."),file:t}),n(!1);return}}n(!0)}),o.Uploader=function(e){function g(){var e,t=0,n;if(this.state==o.STARTED){for(n=0;n<f.length;n++)!e&&f[n].status==o.QUEUED?(e=f[n],this.trigger("BeforeUpload",e)&&(e.status=o.UPLOADING,this.trigger("UploadFile",e))):t++;t==f.length&&(this.state!==o.STOPPED&&(this.state=o.STOPPED,this.trigger("StateChanged")),this.trigger("UploadComplete",f))}}function y(e){e.percent=e.size>0?Math.ceil(e.loaded/e.size*100):100,b()}function b(){var e,t;d.reset();for(e=0;e<f.length;e++)t=f[e],t.size!==n?(d.size+=t.origSize,d.loaded+=t.loaded*t.origSize/t.size):d.size=n,t.status==o.DONE?d.uploaded++:t.status==o.FAILED?d.failed++:d.queued++;d.size===n?d.percent=f.length>0?Math.ceil(d.uploaded/f.length*100):0:(d.bytesPerSec=Math.ceil(d.loaded/((+(new Date)-p||1)/1e3)),d.percent=d.size>0?Math.ceil(d.loaded/d.size*100):0)}function w(){var e=c[0]||h[0];return e?e.getRuntime().uid:!1}function E(e,n){if(e.ruid){var r=t.Runtime.getInfo(e.ruid);if(r)return r.can(n)}return!1}function S(){this.bind("FilesAdded FilesRemoved",function(e){e.trigger("QueueChanged"),e.refresh()}),this.bind("CancelUpload",O),this.bind("BeforeUpload",C),this.bind("UploadFile",k),this.bind("UploadProgress",L),this.bind("StateChanged",A),this.bind("QueueChanged",b),this.bind("Error",_),this.bind("FileUploaded",M),this.bind("Destroy",D)}function x(e,n){var r=this,i=0,s=[],u={runtime_order:e.runtimes,required_caps:e.required_features,preferred_caps:l,swf_url:e.flash_swf_url,xap_url:e.silverlight_xap_url};o.each(e.runtimes.split(/\s*,\s*/),function(t){e[t]&&(u[t]=e[t])}),e.browse_button&&o.each(e.browse_button,function(n){s.push(function(s){var a=new t.FileInput(o.extend({},u,{accept:e.filters.mime_types,name:e.file_data_name,multiple:e.multi_selection,container:e.container,browse_button:n}));a.onready=function(){var e=t.Runtime.getInfo(this.ruid);t.extend(r.features,{chunks:e.can("slice_blob"),multipart:e.can("send_multipart"),multi_selection:e.can("select_multiple")}),i++,c.push(this),s()},a.onchange=function(){r.addFile(this.files)},a.bind("mouseenter mouseleave mousedown mouseup",function(r){v||(e.browse_button_hover&&("mouseenter"===r.type?t.addClass(n,e.browse_button_hover):"mouseleave"===r.type&&t.removeClass(n,e.browse_button_hover)),e.browse_button_active&&("mousedown"===r.type?t.addClass(n,e.browse_button_active):"mouseup"===r.type&&t.removeClass(n,e.browse_button_active)))}),a.bind("mousedown",function(){r.trigger("Browse")}),a.bind("error runtimeerror",function(){a=null,s()}),a.init()})}),e.drop_element&&o.each(e.drop_element,function(e){s.push(function(n){var s=new t.FileDrop(o.extend({},u,{drop_zone:e}));s.onready=function(){var e=t.Runtime.getInfo(this.ruid);r.features.dragdrop=e.can("drag_and_drop"),i++,h.push(this),n()},s.ondrop=function(){r.addFile(this.files)},s.bind("error runtimeerror",function(){s=null,n()}),s.init()})}),t.inSeries(s,function(){typeof n=="function"&&n(i)})}function T(e,r,i){var s=new t.Image;try{s.onload=function(){if(r.width>this.width&&r.height>this.height&&r.quality===n&&r.preserve_headers&&!r.crop)return this.destroy(),i(e);s.downsize(r.width,r.height,r.crop,r.preserve_headers)},s.onresize=function(){i(this.getAsBlob(e.type,r.quality)),this.destroy()},s.onerror=function(){i(e)},s.load(e)}catch(o){i(e)}}function N(e,n,r){function f(e,t,n){var r=a[e];switch(e){case"max_file_size":e==="max_file_size"&&(a.max_file_size=a.filters.max_file_size=t);break;case"chunk_size":if(t=o.parseSize(t))a[e]=t,a.send_file_name=!0;break;case"multipart":a[e]=t,t||(a.send_file_name=!0);break;case"unique_names":a[e]=t,t&&(a.send_file_name=!0);break;case"filters":o.typeOf(t)==="array"&&(t={mime_types:t}),n?o.extend(a.filters,t):a.filters=t,t.mime_types&&(a.filters.mime_types.regexp=function(e){var t=[];return o.each(e,function(e){o.each(e.extensions.split(/,/),function(e){/^\s*\*\s*$/.test(e)?t.push("\\.*"):t.push("\\."+e.replace(new RegExp("["+"/^$.*+?|()[]{}\\".replace(/./g,"\\$&")+"]","g"),"\\$&"))})}),new RegExp("("+t.join("|")+")$","i")}(a.filters.mime_types));break;case"resize":n?o.extend(a.resize,t,{enabled:!0}):a.resize=t;break;case"prevent_duplicates":a.prevent_duplicates=a.filters.prevent_duplicates=!!t;break;case"browse_button":case"drop_element":t=o.get(t);case"container":case"runtimes":case"multi_selection":case"flash_swf_url":case"silverlight_xap_url":a[e]=t,n||(u=!0);break;default:a[e]=t}n||i.trigger("OptionChanged",e,t,r)}var i=this,u=!1;typeof e=="object"?o.each(e,function(e,t){f(t,e,r)}):f(e,n,r),r?(a.required_features=s(o.extend({},a)),l=s(o.extend({},a,{required_features:!0}))):u&&(i.trigger("Destroy"),x.call(i,a,function(e){e?(i.runtime=t.Runtime.getInfo(w()).type,i.trigger("Init",{runtime:i.runtime}),i.trigger("PostInit")):i.trigger("Error",{code:o.INIT_ERROR,message:o.translate("Init error.")})}))}function C(e,t){if(e.settings.unique_names){var n=t.name.match(/\.([^.]+)$/),r="part";n&&(r=n[1]),t.target_name=t.id+"."+r}}function k(e,n){function h(){u-->0?r(p,1e3):(n.loaded=f,e.trigger("Error",{code:o.HTTP_ERROR,message:o.translate("HTTP Error."),file:n,response:m.responseText,status:m.status,responseHeaders:m.getAllResponseHeaders()}))}function p(){var d,v,g={},y;if(n.status!==o.UPLOADING||e.state===o.STOPPED)return;e.settings.send_file_name&&(g.name=n.target_name||n.name),s&&a.chunks&&c.size>s?(y=Math.min(s,c.size-f),d=c.slice(f,f+y)):(y=c.size,d=c),s&&a.chunks&&(e.settings.send_chunk_number?(g.chunk=Math.ceil(f/s),g.chunks=Math.ceil(c.size/s)):(g.offset=f,g.total=c.size)),m=new t.XMLHttpRequest,m.upload&&(m.upload.onprogress=function(t){n.loaded=Math.min(n.size,f+t.loaded),e.trigger("UploadProgress",n)}),m.onload=function(){if(m.status>=400){h();return}u=e.settings.max_retries,y<c.size?(d.destroy(),f+=y,n.loaded=Math.min(f,c.size),e.trigger("ChunkUploaded",n,{offset:n.loaded,total:c.size,response:m.responseText,status:m.status,responseHeaders:m.getAllResponseHeaders()}),t.Env.browser==="Android Browser"&&e.trigger("UploadProgress",n)):n.loaded=n.size,d=v=null,!f||f>=c.size?(n.size!=n.origSize&&(c.destroy(),c=null),e.trigger("UploadProgress",n),n.status=o.DONE,e.trigger("FileUploaded",n,{response:m.responseText,status:m.status,responseHeaders:m.getAllResponseHeaders()})):r(p,1)},m.onerror=function(){h()},m.onloadend=function(){this.destroy(),m=null},e.settings.multipart&&a.multipart?(m.open("post",i,!0),o.each(e.settings.headers,function(e,t){m.setRequestHeader(t,e)}),v=new t.FormData,o.each(o.extend(g,e.settings.multipart_params),function(e,t){v.append(t,e)}),v.append(e.settings.file_data_name,d),m.send(v,{runtime_order:e.settings.runtimes,required_caps:e.settings.required_features,preferred_caps:l,swf_url:e.settings.flash_swf_url,xap_url:e.settings.silverlight_xap_url})):(i=o.buildUrl(e.settings.url,o.extend(g,e.settings.multipart_params)),m.open("post",i,!0),m.setRequestHeader("Content-Type","application/octet-stream"),o.each(e.settings.headers,function(e,t){m.setRequestHeader(t,e)}),m.send(d,{runtime_order:e.settings.runtimes,required_caps:e.settings.required_features,preferred_caps:l,swf_url:e.settings.flash_swf_url,xap_url:e.settings.silverlight_xap_url}))}var i=e.settings.url,s=e.settings.chunk_size,u=e.settings.max_retries,a=e.features,f=0,c;n.loaded&&(f=n.loaded=s?s*Math.floor(n.loaded/s):0),c=n.getSource(),e.settings.resize.enabled&&E(c,"send_binary_string")&&!!~t.inArray(c.type,["image/jpeg","image/png"])?T.call(this,c,e.settings.resize,function(e){c=e,n.size=e.size,p()}):p()}function L(e,t){y(t)}function A(e){if(e.state==o.STARTED)p=+(new Date);else if(e.state==o.STOPPED)for(var t=e.files.length-1;t>=0;t--)e.files[t].status==o.UPLOADING&&(e.files[t].status=o.QUEUED,b())}function O(){m&&m.abort()}function M(e){b(),r(function(){g.call(e)},1)}function _(e,t){t.code===o.INIT_ERROR?e.destroy():t.code===o.HTTP_ERROR&&(t.file.status=o.FAILED,y(t.file),e.state==o.STARTED&&(e.trigger("CancelUpload"),r(function(){g.call(e)},1)))}function D(e){e.stop(),o.each(f,function(e){e.destroy()}),f=[],c.length&&(o.each(c,function(e){e.destroy()}),c=[]),h.length&&(o.each(h,function(e){e.destroy()}),h=[]),l={},v=!1,p=m=null,d.reset()}var u=o.guid(),a,f=[],l={},c=[],h=[],p,d,v=!1,m;a={runtimes:t.Runtime.order,max_retries:0,chunk_size:0,multipart:!0,multi_selection:!0,file_data_name:"file",flash_swf_url:"js/Moxie.swf",silverlight_xap_url:"js/Moxie.xap",filters:{mime_types:[],prevent_duplicates:!1,max_file_size:0},resize:{enabled:!1,preserve_headers:!0,crop:!1},send_file_name:!0,send_chunk_number:!0},N.call(this,e,null,!0),d=new o.QueueProgress,o.extend(this,{id:u,uid:u,state:o.STOPPED,features:{},runtime:null,files:f,settings:a,total:d,init:function(){var e=this;typeof a.preinit=="function"?a.preinit(e):o.each(a.preinit,function(t,n){e.bind(n,t)}),S.call(this);if(!a.browse_button||!a.url){this.trigger("Error",{code:o.INIT_ERROR,message:o.translate("Init error.")});return}x.call(this,a,function(n){typeof a.init=="function"?a.init(e):o.each(a.init,function(t,n){e.bind(n,t)}),n?(e.runtime=t.Runtime.getInfo(w()).type,e.trigger("Init",{runtime:e.runtime}),e.trigger("PostInit")):e.trigger("Error",{code:o.INIT_ERROR,message:o.translate("Init error.")})})},setOption:function(e,t){N.call(this,e,t,!this.runtime)},getOption:function(e){return e?a[e]:a},refresh:function(){c.length&&o.each(c,function(e){e.trigger("Refresh")}),this.trigger("Refresh")},start:function(){this.state!=o.STARTED&&(this.state=o.STARTED,this.trigger("StateChanged"),g.call(this))},stop:function(){this.state!=o.STOPPED&&(this.state=o.STOPPED,this.trigger("StateChanged"),this.trigger("CancelUpload"))},disableBrowse:function(){v=arguments[0]!==n?arguments[0]:!0,c.length&&o.each(c,function(e){e.disable(v)}),this.trigger("DisableBrowse",v)},getFile:function(e){var t;for(t=f.length-1;t>=0;t--)if(f[t].id===e)return f[t]},addFile:function(e,n){function c(e,n){var r=[];t.each(s.settings.filters,function(t,n){i[n]&&r.push(function(r){i[n].call(s,t,e,function(e){r(!e)})})}),t.inSeries(r,n)}function h(e){var i=t.typeOf(e);if(e instanceof t.File){if(!e.ruid&&!e.isDetached()){if(!l)return!1;e.ruid=l,e.connectRuntime(l)}h(new o.File(e))}else e instanceof t.Blob?(h(e.getSource()),e.destroy()):e instanceof o.File?(n&&(e.name=n),u.push(function(t){c(e,function(n){n||(f.push(e),a.push(e),s.trigger("FileFiltered",e)),r(t,1)})})):t.inArray(i,["file","blob"])!==-1?h(new t.File(null,e)):i==="node"&&t.typeOf(e.files)==="filelist"?t.each(e.files,h):i==="array"&&(n=null,t.each(e,h))}var s=this,u=[],a=[],l;l=w(),h(e),u.length&&t.inSeries(u,function(){a.length&&s.trigger("FilesAdded",a)})},removeFile:function(e){var t=typeof e=="string"?e:e.id;for(var n=f.length-1;n>=0;n--)if(f[n].id===t)return this.splice(n,1)[0]},splice:function(e,t){var r=f.splice(e===n?0:e,t===n?f.length:t),i=!1;return this.state==o.STARTED&&(o.each(r,function(e){if(e.status===o.UPLOADING)return i=!0,!1}),i&&this.stop()),this.trigger("FilesRemoved",r),o.each(r,function(e){e.destroy()}),i&&this.start(),r},dispatchEvent:function(e){var t,n,r;e=e.toLowerCase(),t=this.hasEventListener(e);if(t){t.sort(function(e,t){return t.priority-e.priority}),n=[].slice.call(arguments),n.shift(),n.unshift(this);for(var i=0;i<t.length;i++)if(t[i].fn.apply(t[i].scope,n)===!1)return!1}return!0},bind:function(e,t,n,r){o.Uploader.prototype.bind.call(this,e,t,r,n)},destroy:function(){this.trigger("Destroy"),a=d=null,this.unbindAll()}})},o.Uploader.prototype=t.EventTarget.instance,o.File=function(){function n(n){o.extend(this,{id:o.guid(),name:n.name||n.fileName,type:n.type||"",size:n.size||n.fileSize,origSize:n.size||n.fileSize,loaded:0,percent:0,status:o.QUEUED,lastModifiedDate:n.lastModifiedDate||(new Date).toLocaleString(),getNative:function(){var e=this.getSource().getSource();return t.inArray(t.typeOf(e),["blob","file"])!==-1?e:null},getSource:function(){return e[this.id]?e[this.id]:null},destroy:function(){var t=this.getSource();t&&(t.destroy(),delete e[this.id])}}),e[this.id]=n}var e={};return n}(),o.QueueProgress=function(){var e=this;e.size=0,e.loaded=0,e.uploaded=0,e.failed=0,e.queued=0,e.percent=0,e.bytesPerSec=0,e.reset=function(){e.size=e.loaded=e.uploaded=e.failed=e.queued=e.percent=e.bytesPerSec=0}},e.plupload=o})(window,mOxie); \ No newline at end of file
diff --git a/phpBB/bin/phpbbcli.php b/phpBB/bin/phpbbcli.php
new file mode 100755
index 0000000000..239dd3932b
--- /dev/null
+++ b/phpBB/bin/phpbbcli.php
@@ -0,0 +1,69 @@
+#!/usr/bin/env php
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+use Symfony\Component\Console\Input\ArgvInput;
+
+if (php_sapi_name() != 'cli')
+{
+ echo 'This program must be run from the command line.' . PHP_EOL;
+ exit(1);
+}
+
+define('IN_PHPBB', true);
+$phpbb_root_path = __DIR__ . '/../';
+$phpEx = substr(strrchr(__FILE__, '.'), 1);
+require($phpbb_root_path . 'includes/startup.' . $phpEx);
+require($phpbb_root_path . 'phpbb/class_loader.' . $phpEx);
+
+$phpbb_class_loader = new \phpbb\class_loader('phpbb\\', "{$phpbb_root_path}phpbb/", $phpEx);
+$phpbb_class_loader->register();
+
+$phpbb_config_php_file = new \phpbb\config_php_file($phpbb_root_path, $phpEx);
+extract($phpbb_config_php_file->get_all());
+
+require($phpbb_root_path . 'includes/constants.' . $phpEx);
+require($phpbb_root_path . 'includes/functions.' . $phpEx);
+require($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
+require($phpbb_root_path . 'includes/utf/utf_tools.' . $phpEx);
+
+$phpbb_container_builder = new \phpbb\di\container_builder($phpbb_config_php_file, $phpbb_root_path, $phpEx);
+$phpbb_container_builder->set_dump_container(false);
+
+$input = new ArgvInput();
+
+if ($input->hasParameterOption(array('--safe-mode')))
+{
+ $phpbb_container_builder->set_use_extensions(false);
+ $phpbb_container_builder->set_dump_container(false);
+}
+else
+{
+ $phpbb_class_loader_ext = new \phpbb\class_loader('\\', "{$phpbb_root_path}ext/", $phpEx);
+ $phpbb_class_loader_ext->register();
+ phpbb_load_extensions_autoloaders($phpbb_root_path);
+}
+
+$phpbb_container = $phpbb_container_builder->get_container();
+$phpbb_container->get('request')->enable_super_globals();
+require($phpbb_root_path . 'includes/compatibility_globals.' . $phpEx);
+
+$user = $phpbb_container->get('user');
+$user->data['user_id'] = ANONYMOUS;
+$user->ip = '127.0.0.1';
+$user->add_lang('acp/common');
+$user->add_lang('cli');
+
+$application = new \phpbb\console\application('phpBB Console', PHPBB_VERSION, $user);
+$application->register_container_commands($phpbb_container->get('console.command_collection'));
+$application->run($input);
diff --git a/phpBB/cache/.htaccess b/phpBB/cache/.htaccess
index aa5afc1640..aa5afc1640 100644..100755
--- a/phpBB/cache/.htaccess
+++ b/phpBB/cache/.htaccess
diff --git a/phpBB/cache/index.htm b/phpBB/cache/index.htm
index ee1f723a7d..ee1f723a7d 100644..100755
--- a/phpBB/cache/index.htm
+++ b/phpBB/cache/index.htm
diff --git a/phpBB/common.php b/phpBB/common.php
index 31ca746924..71d501e926 100644
--- a/phpBB/common.php
+++ b/phpBB/common.php
@@ -1,27 +1,33 @@
<?php
/**
*
-* @package phpBB3
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
-* Minimum Requirement: PHP 4.3.3
*/
/**
+* Minimum Requirement: PHP 5.3.3
*/
+
if (!defined('IN_PHPBB'))
{
exit;
}
require($phpbb_root_path . 'includes/startup.' . $phpEx);
+require($phpbb_root_path . 'phpbb/class_loader.' . $phpEx);
-if (file_exists($phpbb_root_path . 'config.' . $phpEx))
-{
- require($phpbb_root_path . 'config.' . $phpEx);
-}
+$phpbb_class_loader = new \phpbb\class_loader('phpbb\\', "{$phpbb_root_path}phpbb/", $phpEx);
+$phpbb_class_loader->register();
+
+$phpbb_config_php_file = new \phpbb\config_php_file($phpbb_root_path, $phpEx);
+extract($phpbb_config_php_file->get_all());
if (!defined('PHPBB_INSTALLED'))
{
@@ -32,7 +38,13 @@ if (!defined('PHPBB_INSTALLED'))
// available as used by the redirect function
$server_name = (!empty($_SERVER['HTTP_HOST'])) ? strtolower($_SERVER['HTTP_HOST']) : ((!empty($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : getenv('SERVER_NAME'));
$server_port = (!empty($_SERVER['SERVER_PORT'])) ? (int) $_SERVER['SERVER_PORT'] : (int) getenv('SERVER_PORT');
- $secure = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 1 : 0;
+ $secure = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') ? 1 : 0;
+
+ if (!empty($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https')
+ {
+ $secure = 1;
+ $server_port = 443;
+ }
$script_name = (!empty($_SERVER['PHP_SELF'])) ? $_SERVER['PHP_SELF'] : getenv('PHP_SELF');
if (!$script_name)
@@ -45,8 +57,11 @@ if (!defined('PHPBB_INSTALLED'))
// Replace any number of consecutive backslashes and/or slashes with a single slash
// (could happen on some proxy setups and/or Windows servers)
$script_path = preg_replace('#[\\\\/]{2,}#', '/', $script_path);
+
// Eliminate . and .. from the path
- $script_path = phpbb_clean_path($script_path);
+ require($phpbb_root_path . 'phpbb/filesystem.' . $phpEx);
+ $phpbb_filesystem = new phpbb\filesystem();
+ $script_path = $phpbb_filesystem->clean_path($script_path);
$url = (($secure) ? 'https://' : 'http://') . $server_name;
@@ -64,67 +79,56 @@ if (!defined('PHPBB_INSTALLED'))
exit;
}
-if (defined('DEBUG_EXTRA'))
-{
- $base_memory_usage = 0;
- if (function_exists('memory_get_usage'))
- {
- $base_memory_usage = memory_get_usage();
- }
-}
-
-// Load Extensions
-// dl() is deprecated and disabled by default as of PHP 5.3.
-if (!empty($load_extensions) && function_exists('dl'))
-{
- $load_extensions = explode(',', $load_extensions);
-
- foreach ($load_extensions as $extension)
- {
- @dl(trim($extension));
- }
-}
+// In case $phpbb_adm_relative_path is not set (in case of an update), use the default.
+$phpbb_adm_relative_path = (isset($phpbb_adm_relative_path)) ? $phpbb_adm_relative_path : 'adm/';
+$phpbb_admin_path = (defined('PHPBB_ADMIN_PATH')) ? PHPBB_ADMIN_PATH : $phpbb_root_path . $phpbb_adm_relative_path;
// Include files
-require($phpbb_root_path . 'includes/acm/acm_' . $acm_type . '.' . $phpEx);
-require($phpbb_root_path . 'includes/cache.' . $phpEx);
-require($phpbb_root_path . 'includes/template.' . $phpEx);
-require($phpbb_root_path . 'includes/session.' . $phpEx);
-require($phpbb_root_path . 'includes/auth.' . $phpEx);
-
require($phpbb_root_path . 'includes/functions.' . $phpEx);
require($phpbb_root_path . 'includes/functions_content.' . $phpEx);
+include($phpbb_root_path . 'includes/functions_compatibility.' . $phpEx);
require($phpbb_root_path . 'includes/constants.' . $phpEx);
-require($phpbb_root_path . 'includes/db/' . $dbms . '.' . $phpEx);
require($phpbb_root_path . 'includes/utf/utf_tools.' . $phpEx);
// Set PHP error handler to ours
set_error_handler(defined('PHPBB_MSG_HANDLER') ? PHPBB_MSG_HANDLER : 'msg_handler');
-// Instantiate some basic classes
-$user = new user();
-$auth = new auth();
-$template = new template();
-$cache = new cache();
-$db = new $sql_db();
+$phpbb_class_loader_ext = new \phpbb\class_loader('\\', "{$phpbb_root_path}ext/", $phpEx);
+$phpbb_class_loader_ext->register();
-// Connect to DB
-$db->sql_connect($dbhost, $dbuser, $dbpasswd, $dbname, $dbport, false, defined('PHPBB_DB_NEW_LINK') ? PHPBB_DB_NEW_LINK : false);
+phpbb_load_extensions_autoloaders($phpbb_root_path);
-// We do not need this any longer, unset for safety purposes
-unset($dbpasswd);
+// Set up container
+$phpbb_container_builder = new \phpbb\di\container_builder($phpbb_config_php_file, $phpbb_root_path, $phpEx);
+$phpbb_container = $phpbb_container_builder->get_container();
-// Grab global variables, re-cache if necessary
-$config = $cache->obtain_config();
+$phpbb_class_loader->set_cache($phpbb_container->get('cache.driver'));
+$phpbb_class_loader_ext->set_cache($phpbb_container->get('cache.driver'));
+
+require($phpbb_root_path . 'includes/compatibility_globals.' . $phpEx);
// Add own hook handler
require($phpbb_root_path . 'includes/hooks/index.' . $phpEx);
$phpbb_hook = new phpbb_hook(array('exit_handler', 'phpbb_user_session_handler', 'append_sid', array('template', 'display')));
+$phpbb_hook_finder = $phpbb_container->get('hook_finder');
-foreach ($cache->obtain_hooks() as $hook)
+foreach ($phpbb_hook_finder->find() as $hook)
{
@include($phpbb_root_path . 'includes/hooks/' . $hook . '.' . $phpEx);
}
-?> \ No newline at end of file
+/**
+* Main event which is triggered on every page
+*
+* You can use this event to load function files and initiate objects
+*
+* NOTE: At this point the global session ($user) and permissions ($auth)
+* do NOT exist yet. If you need to use the user object
+* (f.e. to include language files) or need to check permissions,
+* please use the core.user_setup event instead!
+*
+* @event core.common
+* @since 3.1.0-a1
+*/
+$phpbb_dispatcher->dispatch('core.common');
diff --git a/phpBB/composer.json b/phpBB/composer.json
index 966ff39fcc..e6cb2f40ae 100644
--- a/phpBB/composer.json
+++ b/phpBB/composer.json
@@ -1,9 +1,60 @@
{
+ "name": "phpbb/phpbb",
+ "description": "phpBB Forum Software application",
+ "type": "project",
+ "keywords": ["phpbb", "forum"],
+ "homepage": "https://www.phpbb.com",
+ "license": "GPL-2.0",
+ "authors": [
+ {
+ "name": "phpBB Limited",
+ "email": "operations@phpbb.com",
+ "homepage": "https://www.phpbb.com/go/authors"
+ }
+ ],
+ "support": {
+ "issues": "https://tracker.phpbb.com",
+ "forum": "https://www.phpbb.com/community/",
+ "wiki": "https://wiki.phpbb.com",
+ "irc": "irc://irc.freenode.org/phpbb"
+ },
+ "scripts": {
+ "post-update-cmd": "echo 'You MUST manually modify the clean-vendor-dir target in build/build.xml when adding or upgrading dependencies.'"
+ },
+ "replace": {
+ "phpbb/phpbb-core": "self.version"
+ },
+ "require": {
+ "php": ">=5.3.3,<=7.3",
+ "lusitanian/oauth": "0.2.*",
+ "symfony/config": "2.3.*",
+ "symfony/console": "2.3.*",
+ "symfony/dependency-injection": "2.3.*",
+ "symfony/event-dispatcher": "2.3.*",
+ "symfony/http-kernel": "2.3.*",
+ "symfony/routing": "2.3.*",
+ "symfony/yaml": "2.3.*",
+ "twig/twig": "^1.0,<1.25"
+ },
"require-dev": {
"fabpot/goutte": "1.0.*",
+ "phing/phing": "2.4.*",
"phpunit/dbunit": "1.3.*",
"phpunit/phpunit": "4.1.*",
- "phing/phing": "2.4.*",
- "sami/sami": "1.*"
+ "sami/sami": "1.*",
+ "squizlabs/php_codesniffer": "2.*",
+ "symfony/browser-kit": "2.3.*",
+ "symfony/css-selector": "2.3.*",
+ "symfony/debug": "2.3.*",
+ "symfony/dom-crawler": "2.3.*",
+ "symfony/filesystem": "2.3.*",
+ "symfony/finder": "2.3.*",
+ "symfony/http-foundation": "2.3.*",
+ "symfony/process": "2.3.*"
+ },
+ "extra": {
+ "branch-alias": {
+ "dev-master": "3.1.x-dev"
+ }
}
}
diff --git a/phpBB/composer.lock b/phpBB/composer.lock
index becb7b5f83..edd6f7dc07 100644
--- a/phpBB/composer.lock
+++ b/phpBB/composer.lock
@@ -1,11 +1,819 @@
{
"_readme": [
"This file locks the dependencies of your project to a known state",
- "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file"
+ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
+ "This file is @generated automatically"
],
- "hash": "78d2a648f5519c8c5370017aaeba7731",
+ "hash": "ab3d7f33388bce90e6032110a537e61f",
+ "content-hash": "9c138398f4bc789098b020ed37f6ae20",
"packages": [
-
+ {
+ "name": "lusitanian/oauth",
+ "version": "v0.2.5",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/Lusitanian/PHPoAuthLib.git",
+ "reference": "27e375e13e1badcd6dca7fb47b154b3c48fdec0c"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/Lusitanian/PHPoAuthLib/zipball/27e375e13e1badcd6dca7fb47b154b3c48fdec0c",
+ "reference": "27e375e13e1badcd6dca7fb47b154b3c48fdec0c",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "3.7.*",
+ "predis/predis": "0.8.*@dev",
+ "symfony/http-foundation": "~2.1"
+ },
+ "suggest": {
+ "predis/predis": "Allows using the Redis storage backend.",
+ "symfony/http-foundation": "Allows using the Symfony Session storage backend."
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "0.1-dev"
+ }
+ },
+ "autoload": {
+ "psr-0": {
+ "OAuth": "src",
+ "OAuth\\Unit": "tests"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "David Desberg",
+ "email": "david@daviddesberg.com"
+ },
+ {
+ "name": "Pieter Hordijk",
+ "email": "info@pieterhordijk.com",
+ "homepage": "https://pieterhordijk.com",
+ "role": "developer"
+ }
+ ],
+ "description": "PHP 5.3+ oAuth 1/2 Library",
+ "keywords": [
+ "Authentication",
+ "authorization",
+ "oauth",
+ "security"
+ ],
+ "time": "2013-12-25 20:05:42"
+ },
+ {
+ "name": "psr/log",
+ "version": "1.0.2",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/php-fig/log.git",
+ "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d",
+ "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.0.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Psr\\Log\\": "Psr/Log/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "PHP-FIG",
+ "homepage": "http://www.php-fig.org/"
+ }
+ ],
+ "description": "Common interface for logging libraries",
+ "homepage": "https://github.com/php-fig/log",
+ "keywords": [
+ "log",
+ "psr",
+ "psr-3"
+ ],
+ "time": "2016-10-10 12:19:37"
+ },
+ {
+ "name": "symfony/config",
+ "version": "v2.3.42",
+ "target-dir": "Symfony/Component/Config",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/config.git",
+ "reference": "16a645cef1c09ebfc907d3c9b3e9f5836a7d4d3b"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/config/zipball/16a645cef1c09ebfc907d3c9b3e9f5836a7d4d3b",
+ "reference": "16a645cef1c09ebfc907d3c9b3e9f5836a7d4d3b",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.3",
+ "symfony/filesystem": "~2.3"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.3-dev"
+ }
+ },
+ "autoload": {
+ "psr-0": {
+ "Symfony\\Component\\Config\\": ""
+ },
+ "exclude-from-classmap": [
+ "/Tests/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony Config Component",
+ "homepage": "https://symfony.com",
+ "time": "2016-05-30 08:14:41"
+ },
+ {
+ "name": "symfony/console",
+ "version": "v2.3.42",
+ "target-dir": "Symfony/Component/Console",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/console.git",
+ "reference": "20c12c6d6c5a087a66d4e77999451713a92a3507"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/console/zipball/20c12c6d6c5a087a66d4e77999451713a92a3507",
+ "reference": "20c12c6d6c5a087a66d4e77999451713a92a3507",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.3"
+ },
+ "require-dev": {
+ "symfony/event-dispatcher": "~2.1"
+ },
+ "suggest": {
+ "symfony/event-dispatcher": ""
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.3-dev"
+ }
+ },
+ "autoload": {
+ "psr-0": {
+ "Symfony\\Component\\Console\\": ""
+ },
+ "exclude-from-classmap": [
+ "/Tests/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony Console Component",
+ "homepage": "https://symfony.com",
+ "time": "2016-05-26 08:04:58"
+ },
+ {
+ "name": "symfony/debug",
+ "version": "v2.3.42",
+ "target-dir": "Symfony/Component/Debug",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/debug.git",
+ "reference": "863d29c31a1ddfcf1faedf5f8362f392e3261632"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/debug/zipball/863d29c31a1ddfcf1faedf5f8362f392e3261632",
+ "reference": "863d29c31a1ddfcf1faedf5f8362f392e3261632",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.3"
+ },
+ "conflict": {
+ "symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2"
+ },
+ "require-dev": {
+ "symfony/http-foundation": "~2.1",
+ "symfony/http-kernel": "~2.3.24|~2.5.9|~2.6,>=2.6.2"
+ },
+ "suggest": {
+ "symfony/class-loader": "",
+ "symfony/http-foundation": "",
+ "symfony/http-kernel": ""
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.3-dev"
+ }
+ },
+ "autoload": {
+ "psr-0": {
+ "Symfony\\Component\\Debug\\": ""
+ },
+ "exclude-from-classmap": [
+ "/Tests/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony Debug Component",
+ "homepage": "https://symfony.com",
+ "time": "2016-03-30 09:02:35"
+ },
+ {
+ "name": "symfony/dependency-injection",
+ "version": "v2.3.42",
+ "target-dir": "Symfony/Component/DependencyInjection",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/dependency-injection.git",
+ "reference": "06265ee128644eb70356bd72ab28c9ded6618d19"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/06265ee128644eb70356bd72ab28c9ded6618d19",
+ "reference": "06265ee128644eb70356bd72ab28c9ded6618d19",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.3"
+ },
+ "require-dev": {
+ "symfony/config": "~2.2",
+ "symfony/yaml": "~2.1"
+ },
+ "suggest": {
+ "symfony/config": "",
+ "symfony/proxy-manager-bridge": "Generate service proxies to lazy load them",
+ "symfony/yaml": ""
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.3-dev"
+ }
+ },
+ "autoload": {
+ "psr-0": {
+ "Symfony\\Component\\DependencyInjection\\": ""
+ },
+ "exclude-from-classmap": [
+ "/Tests/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony DependencyInjection Component",
+ "homepage": "https://symfony.com",
+ "time": "2016-05-30 08:31:06"
+ },
+ {
+ "name": "symfony/event-dispatcher",
+ "version": "v2.3.42",
+ "target-dir": "Symfony/Component/EventDispatcher",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/event-dispatcher.git",
+ "reference": "fd6d162d97bf3e6060622e5c015af39ca72e33bc"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/fd6d162d97bf3e6060622e5c015af39ca72e33bc",
+ "reference": "fd6d162d97bf3e6060622e5c015af39ca72e33bc",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.3"
+ },
+ "require-dev": {
+ "symfony/dependency-injection": "~2.0,>=2.0.5"
+ },
+ "suggest": {
+ "symfony/dependency-injection": "",
+ "symfony/http-kernel": ""
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.3-dev"
+ }
+ },
+ "autoload": {
+ "psr-0": {
+ "Symfony\\Component\\EventDispatcher\\": ""
+ },
+ "exclude-from-classmap": [
+ "/Tests/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony EventDispatcher Component",
+ "homepage": "https://symfony.com",
+ "time": "2016-04-04 09:22:54"
+ },
+ {
+ "name": "symfony/filesystem",
+ "version": "v2.3.42",
+ "target-dir": "Symfony/Component/Filesystem",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/filesystem.git",
+ "reference": "8fd9cd1da0afe63f0d9d4f27875782a2b7d590d3"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/filesystem/zipball/8fd9cd1da0afe63f0d9d4f27875782a2b7d590d3",
+ "reference": "8fd9cd1da0afe63f0d9d4f27875782a2b7d590d3",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.3"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.3-dev"
+ }
+ },
+ "autoload": {
+ "psr-0": {
+ "Symfony\\Component\\Filesystem\\": ""
+ },
+ "exclude-from-classmap": [
+ "/Tests/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony Filesystem Component",
+ "homepage": "https://symfony.com",
+ "time": "2016-04-12 15:20:10"
+ },
+ {
+ "name": "symfony/http-foundation",
+ "version": "v2.3.42",
+ "target-dir": "Symfony/Component/HttpFoundation",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/http-foundation.git",
+ "reference": "9f4dbb1f3e3cad22d9462e0306c9c71212458f61"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/http-foundation/zipball/9f4dbb1f3e3cad22d9462e0306c9c71212458f61",
+ "reference": "9f4dbb1f3e3cad22d9462e0306c9c71212458f61",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.3",
+ "symfony/polyfill-mbstring": "~1.1"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.3-dev"
+ }
+ },
+ "autoload": {
+ "psr-0": {
+ "Symfony\\Component\\HttpFoundation\\": ""
+ },
+ "classmap": [
+ "Symfony/Component/HttpFoundation/Resources/stubs"
+ ],
+ "exclude-from-classmap": [
+ "/Tests/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony HttpFoundation Component",
+ "homepage": "https://symfony.com",
+ "time": "2016-05-13 15:22:39"
+ },
+ {
+ "name": "symfony/http-kernel",
+ "version": "v2.3.42",
+ "target-dir": "Symfony/Component/HttpKernel",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/http-kernel.git",
+ "reference": "57e0329236e8edf2b0e683043c604f7c9aba9398"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/http-kernel/zipball/57e0329236e8edf2b0e683043c604f7c9aba9398",
+ "reference": "57e0329236e8edf2b0e683043c604f7c9aba9398",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.3",
+ "psr/log": "~1.0",
+ "symfony/debug": "~2.3.24|~2.5.9|~2.6,>=2.6.2",
+ "symfony/event-dispatcher": "~2.1",
+ "symfony/http-foundation": "~2.3,>=2.3.4"
+ },
+ "require-dev": {
+ "symfony/browser-kit": "~2.3",
+ "symfony/class-loader": "~2.1",
+ "symfony/config": "~2.0,>=2.0.5",
+ "symfony/console": "~2.2",
+ "symfony/css-selector": "~2.0,>=2.0.5",
+ "symfony/dependency-injection": "~2.2",
+ "symfony/dom-crawler": "~2.0,>=2.0.5",
+ "symfony/finder": "~2.0,>=2.0.5",
+ "symfony/process": "~2.0,>=2.0.5",
+ "symfony/routing": "~2.2",
+ "symfony/stopwatch": "~2.3",
+ "symfony/templating": "~2.2"
+ },
+ "suggest": {
+ "symfony/browser-kit": "",
+ "symfony/class-loader": "",
+ "symfony/config": "",
+ "symfony/console": "",
+ "symfony/dependency-injection": "",
+ "symfony/finder": ""
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.3-dev"
+ }
+ },
+ "autoload": {
+ "psr-0": {
+ "Symfony\\Component\\HttpKernel\\": ""
+ },
+ "exclude-from-classmap": [
+ "/Tests/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony HttpKernel Component",
+ "homepage": "https://symfony.com",
+ "time": "2016-05-30 08:41:10"
+ },
+ {
+ "name": "symfony/polyfill-mbstring",
+ "version": "v1.3.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/polyfill-mbstring.git",
+ "reference": "e79d363049d1c2128f133a2667e4f4190904f7f4"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/e79d363049d1c2128f133a2667e4f4190904f7f4",
+ "reference": "e79d363049d1c2128f133a2667e4f4190904f7f4",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.3"
+ },
+ "suggest": {
+ "ext-mbstring": "For best performance"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.3-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Polyfill\\Mbstring\\": ""
+ },
+ "files": [
+ "bootstrap.php"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Nicolas Grekas",
+ "email": "p@tchwork.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony polyfill for the Mbstring extension",
+ "homepage": "https://symfony.com",
+ "keywords": [
+ "compatibility",
+ "mbstring",
+ "polyfill",
+ "portable",
+ "shim"
+ ],
+ "time": "2016-11-14 01:06:16"
+ },
+ {
+ "name": "symfony/routing",
+ "version": "v2.3.42",
+ "target-dir": "Symfony/Component/Routing",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/routing.git",
+ "reference": "5b8a2bb7569df81401171829498809e90d6e446c"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/routing/zipball/5b8a2bb7569df81401171829498809e90d6e446c",
+ "reference": "5b8a2bb7569df81401171829498809e90d6e446c",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.3"
+ },
+ "require-dev": {
+ "doctrine/common": "~2.2",
+ "psr/log": "~1.0",
+ "symfony/config": "~2.2",
+ "symfony/http-foundation": "~2.3",
+ "symfony/yaml": "~2.0,>=2.0.5"
+ },
+ "suggest": {
+ "doctrine/common": "",
+ "symfony/config": "",
+ "symfony/yaml": ""
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.3-dev"
+ }
+ },
+ "autoload": {
+ "psr-0": {
+ "Symfony\\Component\\Routing\\": ""
+ },
+ "exclude-from-classmap": [
+ "/Tests/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony Routing Component",
+ "homepage": "https://symfony.com",
+ "time": "2016-05-29 10:13:06"
+ },
+ {
+ "name": "symfony/yaml",
+ "version": "v2.3.42",
+ "target-dir": "Symfony/Component/Yaml",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/yaml.git",
+ "reference": "2cb5f366f9e0df014fc93de46cc416ba0a3055f8"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/yaml/zipball/2cb5f366f9e0df014fc93de46cc416ba0a3055f8",
+ "reference": "2cb5f366f9e0df014fc93de46cc416ba0a3055f8",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.3"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.3-dev"
+ }
+ },
+ "autoload": {
+ "psr-0": {
+ "Symfony\\Component\\Yaml\\": ""
+ },
+ "exclude-from-classmap": [
+ "/Tests/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony Yaml Component",
+ "homepage": "https://symfony.com",
+ "time": "2016-05-30 08:10:17"
+ },
+ {
+ "name": "twig/twig",
+ "version": "v1.24.2",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/twigphp/Twig.git",
+ "reference": "33093f6e310e6976baeac7b14f3a6ec02f2d79b7"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/twigphp/Twig/zipball/33093f6e310e6976baeac7b14f3a6ec02f2d79b7",
+ "reference": "33093f6e310e6976baeac7b14f3a6ec02f2d79b7",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.2.7"
+ },
+ "require-dev": {
+ "symfony/debug": "~2.7",
+ "symfony/phpunit-bridge": "~2.7"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.24-dev"
+ }
+ },
+ "autoload": {
+ "psr-0": {
+ "Twig_": "lib/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com",
+ "homepage": "http://fabien.potencier.org",
+ "role": "Lead Developer"
+ },
+ {
+ "name": "Armin Ronacher",
+ "email": "armin.ronacher@active-4.com",
+ "role": "Project Founder"
+ },
+ {
+ "name": "Twig Team",
+ "homepage": "http://twig.sensiolabs.org/contributors",
+ "role": "Contributors"
+ }
+ ],
+ "description": "Twig, the flexible, fast, and secure template language for PHP",
+ "homepage": "http://twig.sensiolabs.org",
+ "keywords": [
+ "templating"
+ ],
+ "time": "2016-09-01 17:50:53"
+ }
],
"packages-dev": [
{
@@ -66,17 +874,17 @@
},
{
"name": "guzzle/common",
- "version": "v3.7.2",
+ "version": "v3.9.2",
"target-dir": "Guzzle/Common",
"source": {
"type": "git",
- "url": "https://github.com/guzzle/common.git",
- "reference": "70c8e8a624e2ef1657ce0045d845bee9f46a325e"
+ "url": "https://github.com/Guzzle3/common.git",
+ "reference": "2e36af7cf2ce3ea1f2d7c2831843b883a8e7b7dc"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/guzzle/common/zipball/70c8e8a624e2ef1657ce0045d845bee9f46a325e",
- "reference": "70c8e8a624e2ef1657ce0045d845bee9f46a325e",
+ "url": "https://api.github.com/repos/Guzzle3/common/zipball/2e36af7cf2ce3ea1f2d7c2831843b883a8e7b7dc",
+ "reference": "2e36af7cf2ce3ea1f2d7c2831843b883a8e7b7dc",
"shasum": ""
},
"require": {
@@ -106,21 +914,22 @@
"event",
"exception"
],
- "time": "2013-08-02 18:31:05"
+ "abandoned": "guzzle/guzzle",
+ "time": "2014-08-11 04:32:36"
},
{
"name": "guzzle/http",
- "version": "v3.7.2",
+ "version": "v3.9.2",
"target-dir": "Guzzle/Http",
"source": {
"type": "git",
- "url": "https://github.com/guzzle/http.git",
- "reference": "a18954489d8af2e04ee9e3bafd3bf703b55459ff"
+ "url": "https://github.com/Guzzle3/http.git",
+ "reference": "1e8dd1e2ba9dc42332396f39fbfab950b2301dc5"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/guzzle/http/zipball/a18954489d8af2e04ee9e3bafd3bf703b55459ff",
- "reference": "a18954489d8af2e04ee9e3bafd3bf703b55459ff",
+ "url": "https://api.github.com/repos/Guzzle3/http/zipball/1e8dd1e2ba9dc42332396f39fbfab950b2301dc5",
+ "reference": "1e8dd1e2ba9dc42332396f39fbfab950b2301dc5",
"shasum": ""
},
"require": {
@@ -163,21 +972,22 @@
"http",
"http client"
],
- "time": "2013-07-30 22:07:23"
+ "abandoned": "guzzle/guzzle",
+ "time": "2014-08-11 04:32:36"
},
{
"name": "guzzle/parser",
- "version": "v3.7.2",
+ "version": "v3.9.2",
"target-dir": "Guzzle/Parser",
"source": {
"type": "git",
- "url": "https://github.com/guzzle/parser.git",
- "reference": "a25c2ddda1c52fb69a4ee56eb530b13ddd9573c2"
+ "url": "https://github.com/Guzzle3/parser.git",
+ "reference": "6874d171318a8e93eb6d224cf85e4678490b625c"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/guzzle/parser/zipball/a25c2ddda1c52fb69a4ee56eb530b13ddd9573c2",
- "reference": "a25c2ddda1c52fb69a4ee56eb530b13ddd9573c2",
+ "url": "https://api.github.com/repos/Guzzle3/parser/zipball/6874d171318a8e93eb6d224cf85e4678490b625c",
+ "reference": "6874d171318a8e93eb6d224cf85e4678490b625c",
"shasum": ""
},
"require": {
@@ -207,21 +1017,22 @@
"message",
"url"
],
- "time": "2013-07-11 22:46:03"
+ "abandoned": "guzzle/guzzle",
+ "time": "2014-02-05 18:29:46"
},
{
"name": "guzzle/stream",
- "version": "v3.7.2",
+ "version": "v3.9.2",
"target-dir": "Guzzle/Stream",
"source": {
"type": "git",
- "url": "https://github.com/guzzle/stream.git",
- "reference": "a86111d9ac7db31d65a053c825869409fe8fc83f"
+ "url": "https://github.com/Guzzle3/stream.git",
+ "reference": "60c7fed02e98d2c518dae8f97874c8f4622100f0"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/guzzle/stream/zipball/a86111d9ac7db31d65a053c825869409fe8fc83f",
- "reference": "a86111d9ac7db31d65a053c825869409fe8fc83f",
+ "url": "https://api.github.com/repos/Guzzle3/stream/zipball/60c7fed02e98d2c518dae8f97874c8f4622100f0",
+ "reference": "60c7fed02e98d2c518dae8f97874c8f4622100f0",
"shasum": ""
},
"require": {
@@ -260,20 +1071,21 @@
"component",
"stream"
],
- "time": "2013-07-30 22:07:23"
+ "abandoned": "guzzle/guzzle",
+ "time": "2014-05-01 21:36:02"
},
{
"name": "michelf/php-markdown",
- "version": "1.4.1",
+ "version": "1.7.0",
"source": {
"type": "git",
"url": "https://github.com/michelf/php-markdown.git",
- "reference": "de9a19c7bf352d41cc99ed86c3c0ef17e87394b6"
+ "reference": "1f51cc520948f66cd2af8cbc45a5ee175e774220"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/michelf/php-markdown/zipball/de9a19c7bf352d41cc99ed86c3c0ef17e87394b6",
- "reference": "de9a19c7bf352d41cc99ed86c3c0ef17e87394b6",
+ "url": "https://api.github.com/repos/michelf/php-markdown/zipball/1f51cc520948f66cd2af8cbc45a5ee175e774220",
+ "reference": "1f51cc520948f66cd2af8cbc45a5ee175e774220",
"shasum": ""
},
"require": {
@@ -298,36 +1110,37 @@
{
"name": "Michel Fortin",
"email": "michel.fortin@michelf.ca",
- "homepage": "http://michelf.ca/",
+ "homepage": "https://michelf.ca/",
"role": "Developer"
},
{
"name": "John Gruber",
- "homepage": "http://daringfireball.net/"
+ "homepage": "https://daringfireball.net/"
}
],
"description": "PHP Markdown",
- "homepage": "http://michelf.ca/projects/php-markdown/",
+ "homepage": "https://michelf.ca/projects/php-markdown/",
"keywords": [
"markdown"
],
- "time": "2014-05-05 02:43:50"
+ "time": "2016-10-29 18:58:20"
},
{
"name": "nikic/php-parser",
- "version": "v0.9.4",
+ "version": "v0.9.5",
"source": {
"type": "git",
"url": "https://github.com/nikic/PHP-Parser.git",
- "reference": "1e5e280ae88a27effa2ae4aa2bd088494ed8594f"
+ "reference": "ef70767475434bdb3615b43c327e2cae17ef12eb"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/1e5e280ae88a27effa2ae4aa2bd088494ed8594f",
- "reference": "1e5e280ae88a27effa2ae4aa2bd088494ed8594f",
+ "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/ef70767475434bdb3615b43c327e2cae17ef12eb",
+ "reference": "ef70767475434bdb3615b43c327e2cae17ef12eb",
"shasum": ""
},
"require": {
+ "ext-tokenizer": "*",
"php": ">=5.2"
},
"type": "library",
@@ -355,7 +1168,7 @@
"parser",
"php"
],
- "time": "2013-08-25 17:11:40"
+ "time": "2014-07-23 18:24:17"
},
{
"name": "phing/phing",
@@ -411,24 +1224,24 @@
},
{
"name": "phpunit/dbunit",
- "version": "1.3.1",
+ "version": "1.3.2",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/dbunit.git",
- "reference": "a5891b7a9c4f21587a51f9bc4e8f7042b741b480"
+ "reference": "1507040c2541bdffd7fbd71fc792cecdea6a7c61"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/dbunit/zipball/a5891b7a9c4f21587a51f9bc4e8f7042b741b480",
- "reference": "a5891b7a9c4f21587a51f9bc4e8f7042b741b480",
+ "url": "https://api.github.com/repos/sebastianbergmann/dbunit/zipball/1507040c2541bdffd7fbd71fc792cecdea6a7c61",
+ "reference": "1507040c2541bdffd7fbd71fc792cecdea6a7c61",
"shasum": ""
},
"require": {
"ext-pdo": "*",
"ext-simplexml": "*",
"php": ">=5.3.3",
- "phpunit/phpunit": ">=3.7.0@stable",
- "symfony/yaml": ">=2.1.0"
+ "phpunit/phpunit": "~3.7|~4.0",
+ "symfony/yaml": "~2.1"
},
"bin": [
"composer/bin/dbunit"
@@ -466,33 +1279,33 @@
"testing",
"xunit"
],
- "time": "2014-03-26 11:25:06"
+ "time": "2015-03-29 14:23:04"
},
{
"name": "phpunit/php-code-coverage",
- "version": "2.0.6",
+ "version": "2.2.4",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-code-coverage.git",
- "reference": "bccecf50645068b44f49a84009e2a0499a500b99"
+ "reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/bccecf50645068b44f49a84009e2a0499a500b99",
- "reference": "bccecf50645068b44f49a84009e2a0499a500b99",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/eabf68b476ac7d0f73793aada060f1c1a9bf8979",
+ "reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979",
"shasum": ""
},
"require": {
"php": ">=5.3.3",
- "phpunit/php-file-iterator": "~1.3.1",
- "phpunit/php-text-template": "~1.2.0",
- "phpunit/php-token-stream": "~1.2.2",
- "sebastian/environment": "~1.0.0",
- "sebastian/version": "~1.0.3"
+ "phpunit/php-file-iterator": "~1.3",
+ "phpunit/php-text-template": "~1.2",
+ "phpunit/php-token-stream": "~1.3",
+ "sebastian/environment": "^1.3.2",
+ "sebastian/version": "~1.0"
},
"require-dev": {
"ext-xdebug": ">=2.1.4",
- "phpunit/phpunit": "~4.0.14"
+ "phpunit/phpunit": "~4"
},
"suggest": {
"ext-dom": "*",
@@ -502,7 +1315,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "2.0.x-dev"
+ "dev-master": "2.2.x-dev"
}
},
"autoload": {
@@ -511,9 +1324,6 @@
]
},
"notification-url": "https://packagist.org/downloads/",
- "include-path": [
- ""
- ],
"license": [
"BSD-3-Clause"
],
@@ -531,7 +1341,7 @@
"testing",
"xunit"
],
- "time": "2014-04-30 09:01:21"
+ "time": "2015-10-06 15:47:00"
},
{
"name": "phpunit/php-file-iterator",
@@ -580,16 +1390,16 @@
},
{
"name": "phpunit/php-text-template",
- "version": "1.2.0",
+ "version": "1.2.1",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-text-template.git",
- "reference": "206dfefc0ffe9cebf65c413e3d0e809c82fbf00a"
+ "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/206dfefc0ffe9cebf65c413e3d0e809c82fbf00a",
- "reference": "206dfefc0ffe9cebf65c413e3d0e809c82fbf00a",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686",
+ "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686",
"shasum": ""
},
"require": {
@@ -598,20 +1408,17 @@
"type": "library",
"autoload": {
"classmap": [
- "Text/"
+ "src/"
]
},
"notification-url": "https://packagist.org/downloads/",
- "include-path": [
- ""
- ],
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Sebastian Bergmann",
- "email": "sb@sebastian-bergmann.de",
+ "email": "sebastian@phpunit.de",
"role": "lead"
}
],
@@ -620,35 +1427,40 @@
"keywords": [
"template"
],
- "time": "2014-01-30 17:20:04"
+ "time": "2015-06-21 13:50:34"
},
{
"name": "phpunit/php-timer",
- "version": "1.0.5",
+ "version": "1.0.9",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-timer.git",
- "reference": "19689d4354b295ee3d8c54b4f42c3efb69cbc17c"
+ "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/19689d4354b295ee3d8c54b4f42c3efb69cbc17c",
- "reference": "19689d4354b295ee3d8c54b4f42c3efb69cbc17c",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f",
+ "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f",
"shasum": ""
},
"require": {
- "php": ">=5.3.3"
+ "php": "^5.3.3 || ^7.3.17"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0"
},
"type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.0-dev"
+ }
+ },
"autoload": {
"classmap": [
- "PHP/"
+ "src/"
]
},
"notification-url": "https://packagist.org/downloads/",
- "include-path": [
- ""
- ],
"license": [
"BSD-3-Clause"
],
@@ -664,49 +1476,48 @@
"keywords": [
"timer"
],
- "time": "2013-08-02 07:42:54"
+ "time": "2017-02-26 11:10:40"
},
{
"name": "phpunit/php-token-stream",
- "version": "1.2.2",
+ "version": "1.4.11",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-token-stream.git",
- "reference": "ad4e1e23ae01b483c16f600ff1bebec184588e32"
+ "reference": "e03f8f67534427a787e21a385a67ec3ca6978ea7"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/ad4e1e23ae01b483c16f600ff1bebec184588e32",
- "reference": "ad4e1e23ae01b483c16f600ff1bebec184588e32",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/e03f8f67534427a787e21a385a67ec3ca6978ea7",
+ "reference": "e03f8f67534427a787e21a385a67ec3ca6978ea7",
"shasum": ""
},
"require": {
"ext-tokenizer": "*",
"php": ">=5.3.3"
},
+ "require-dev": {
+ "phpunit/phpunit": "~4.2"
+ },
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "1.2-dev"
+ "dev-master": "1.4-dev"
}
},
"autoload": {
"classmap": [
- "PHP/"
+ "src/"
]
},
"notification-url": "https://packagist.org/downloads/",
- "include-path": [
- ""
- ],
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Sebastian Bergmann",
- "email": "sb@sebastian-bergmann.de",
- "role": "lead"
+ "email": "sebastian@phpunit.de"
}
],
"description": "Wrapper around PHP's tokenizer extension.",
@@ -714,20 +1525,20 @@
"keywords": [
"tokenizer"
],
- "time": "2014-03-03 05:10:30"
+ "time": "2017-02-27 10:12:30"
},
{
"name": "phpunit/phpunit",
- "version": "4.1.0",
+ "version": "4.1.6",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git",
- "reference": "efb1b1334605594417a3bd466477772d06d460a8"
+ "reference": "241116219bb7e3b8111a36ffd8f37546888738d6"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/efb1b1334605594417a3bd466477772d06d460a8",
- "reference": "efb1b1334605594417a3bd466477772d06d460a8",
+ "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/241116219bb7e3b8111a36ffd8f37546888738d6",
+ "reference": "241116219bb7e3b8111a36ffd8f37546888738d6",
"shasum": ""
},
"require": {
@@ -741,7 +1552,7 @@
"phpunit/php-file-iterator": "~1.3.1",
"phpunit/php-text-template": "~1.2",
"phpunit/php-timer": "~1.0.2",
- "phpunit/phpunit-mock-objects": "~2.1",
+ "phpunit/phpunit-mock-objects": "2.1.5",
"sebastian/comparator": "~1.0",
"sebastian/diff": "~1.1",
"sebastian/environment": "~1.0",
@@ -788,20 +1599,20 @@
"testing",
"xunit"
],
- "time": "2014-05-02 07:13:40"
+ "time": "2014-08-17 08:07:02"
},
{
"name": "phpunit/phpunit-mock-objects",
- "version": "2.1.0",
+ "version": "2.1.5",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git",
- "reference": "da0eb04d8ee95ec2898187e407e519c118d3d27c"
+ "reference": "7878b9c41edb3afab92b85edf5f0981014a2713a"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/da0eb04d8ee95ec2898187e407e519c118d3d27c",
- "reference": "da0eb04d8ee95ec2898187e407e519c118d3d27c",
+ "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/7878b9c41edb3afab92b85edf5f0981014a2713a",
+ "reference": "7878b9c41edb3afab92b85edf5f0981014a2713a",
"shasum": ""
},
"require": {
@@ -845,19 +1656,19 @@
"mock",
"xunit"
],
- "time": "2014-05-02 07:04:11"
+ "time": "2014-06-12 07:22:15"
},
{
"name": "pimple/pimple",
"version": "v1.0.2",
"source": {
"type": "git",
- "url": "https://github.com/fabpot/Pimple.git",
+ "url": "https://github.com/silexphp/Pimple.git",
"reference": "ae11e57e8c2bb414b2ff93396dbbfc0eb92feb94"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/fabpot/Pimple/zipball/ae11e57e8c2bb414b2ff93396dbbfc0eb92feb94",
+ "url": "https://api.github.com/repos/silexphp/Pimple/zipball/ae11e57e8c2bb414b2ff93396dbbfc0eb92feb94",
"reference": "ae11e57e8c2bb414b2ff93396dbbfc0eb92feb94",
"shasum": ""
},
@@ -897,16 +1708,16 @@
},
{
"name": "sami/sami",
- "version": "v1.4",
+ "version": "v1.4.1",
"source": {
"type": "git",
"url": "https://github.com/FriendsOfPHP/Sami.git",
- "reference": "70f29c781f7bef30181c814b9471b2ceac694454"
+ "reference": "160018bfefffa730dc35a2c606691a45acbf41a1"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/FriendsOfPHP/Sami/zipball/70f29c781f7bef30181c814b9471b2ceac694454",
- "reference": "70f29c781f7bef30181c814b9471b2ceac694454",
+ "url": "https://api.github.com/repos/FriendsOfPHP/Sami/zipball/160018bfefffa730dc35a2c606691a45acbf41a1",
+ "reference": "160018bfefffa730dc35a2c606691a45acbf41a1",
"shasum": ""
},
"require": {
@@ -950,34 +1761,34 @@
"keywords": [
"phpdoc"
],
- "time": "2014-06-25 11:24:03"
+ "time": "2015-06-05 03:36:34"
},
{
"name": "sebastian/comparator",
- "version": "1.0.0",
+ "version": "1.2.4",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/comparator.git",
- "reference": "f7069ee51fa9fb6c038e16a9d0e3439f5449dcf2"
+ "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/f7069ee51fa9fb6c038e16a9d0e3439f5449dcf2",
- "reference": "f7069ee51fa9fb6c038e16a9d0e3439f5449dcf2",
+ "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2b7424b55f5047b47ac6e5ccb20b2aea4011d9be",
+ "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be",
"shasum": ""
},
"require": {
"php": ">=5.3.3",
- "sebastian/diff": "~1.1",
- "sebastian/exporter": "~1.0"
+ "sebastian/diff": "~1.2",
+ "sebastian/exporter": "~1.2 || ~2.0"
},
"require-dev": {
- "phpunit/phpunit": "~4.1"
+ "phpunit/phpunit": "~4.4"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "1.0.x-dev"
+ "dev-master": "1.2.x-dev"
}
},
"autoload": {
@@ -991,11 +1802,6 @@
],
"authors": [
{
- "name": "Sebastian Bergmann",
- "email": "sebastian@phpunit.de",
- "role": "lead"
- },
- {
"name": "Jeff Welch",
"email": "whatthejeff@gmail.com"
},
@@ -1006,6 +1812,10 @@
{
"name": "Bernhard Schussek",
"email": "bschussek@2bepublished.at"
+ },
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de"
}
],
"description": "Provides the functionality to compare PHP values for equality",
@@ -1015,29 +1825,32 @@
"compare",
"equality"
],
- "time": "2014-05-02 07:05:58"
+ "time": "2017-01-29 09:50:25"
},
{
"name": "sebastian/diff",
- "version": "1.1.0",
+ "version": "1.4.3",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/diff.git",
- "reference": "1e091702a5a38e6b4c1ba9ca816e3dd343df2e2d"
+ "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/1e091702a5a38e6b4c1ba9ca816e3dd343df2e2d",
- "reference": "1e091702a5a38e6b4c1ba9ca816e3dd343df2e2d",
+ "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/7f066a26a962dbe58ddea9f72a4e82874a3975a4",
+ "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4",
"shasum": ""
},
"require": {
- "php": ">=5.3.3"
+ "php": "^5.3.3 || ^7.3.17"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "1.1-dev"
+ "dev-master": "1.4-dev"
}
},
"autoload": {
@@ -1051,46 +1864,45 @@
],
"authors": [
{
- "name": "Sebastian Bergmann",
- "email": "sebastian@phpunit.de",
- "role": "lead"
- },
- {
"name": "Kore Nordmann",
"email": "mail@kore-nordmann.de"
+ },
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de"
}
],
"description": "Diff implementation",
- "homepage": "http://www.github.com/sebastianbergmann/diff",
+ "homepage": "https://github.com/sebastianbergmann/diff",
"keywords": [
"diff"
],
- "time": "2013-08-03 16:46:33"
+ "time": "2017-05-22 07:24:03"
},
{
"name": "sebastian/environment",
- "version": "1.0.0",
+ "version": "1.3.8",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/environment.git",
- "reference": "79517609ec01139cd7e9fded0dd7ce08c952ef6a"
+ "reference": "be2c607e43ce4c89ecd60e75c6a85c126e754aea"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/79517609ec01139cd7e9fded0dd7ce08c952ef6a",
- "reference": "79517609ec01139cd7e9fded0dd7ce08c952ef6a",
+ "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/be2c607e43ce4c89ecd60e75c6a85c126e754aea",
+ "reference": "be2c607e43ce4c89ecd60e75c6a85c126e754aea",
"shasum": ""
},
"require": {
- "php": ">=5.3.3"
+ "php": "^5.3.3 || ^7.3.17"
},
"require-dev": {
- "phpunit/phpunit": "4.0.*@dev"
+ "phpunit/phpunit": "^4.8 || ^5.0"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "1.0.x-dev"
+ "dev-master": "1.3.x-dev"
}
},
"autoload": {
@@ -1105,8 +1917,7 @@
"authors": [
{
"name": "Sebastian Bergmann",
- "email": "sebastian@phpunit.de",
- "role": "lead"
+ "email": "sebastian@phpunit.de"
}
],
"description": "Provides functionality to handle HHVM/PHP environments",
@@ -1116,32 +1927,34 @@
"environment",
"hhvm"
],
- "time": "2014-02-18 16:17:19"
+ "time": "2016-08-18 05:49:44"
},
{
"name": "sebastian/exporter",
- "version": "1.0.1",
+ "version": "1.2.2",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/exporter.git",
- "reference": "1f9a98e6f5dfe0524cb8c6166f7c82f3e9ae1529"
+ "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/1f9a98e6f5dfe0524cb8c6166f7c82f3e9ae1529",
- "reference": "1f9a98e6f5dfe0524cb8c6166f7c82f3e9ae1529",
+ "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/42c4c2eec485ee3e159ec9884f95b431287edde4",
+ "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4",
"shasum": ""
},
"require": {
- "php": ">=5.3.3"
+ "php": ">=5.3.3",
+ "sebastian/recursion-context": "~1.0"
},
"require-dev": {
- "phpunit/phpunit": "4.0.*@dev"
+ "ext-mbstring": "*",
+ "phpunit/phpunit": "~4.4"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "1.0.x-dev"
+ "dev-master": "1.3.x-dev"
}
},
"autoload": {
@@ -1155,11 +1968,6 @@
],
"authors": [
{
- "name": "Sebastian Bergmann",
- "email": "sebastian@phpunit.de",
- "role": "lead"
- },
- {
"name": "Jeff Welch",
"email": "whatthejeff@gmail.com"
},
@@ -1168,12 +1976,16 @@
"email": "github@wallbash.com"
},
{
- "name": "Adam Harvey",
- "email": "aharvey@php.net"
- },
- {
"name": "Bernhard Schussek",
"email": "bschussek@2bepublished.at"
+ },
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de"
+ },
+ {
+ "name": "Adam Harvey",
+ "email": "aharvey@php.net"
}
],
"description": "Provides the functionality to export PHP variables for visualization",
@@ -1182,231 +1994,199 @@
"export",
"exporter"
],
- "time": "2014-02-16 08:26:31"
- },
- {
- "name": "sebastian/version",
- "version": "1.0.3",
- "source": {
- "type": "git",
- "url": "https://github.com/sebastianbergmann/version.git",
- "reference": "b6e1f0cf6b9e1ec409a0d3e2f2a5fb0998e36b43"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/b6e1f0cf6b9e1ec409a0d3e2f2a5fb0998e36b43",
- "reference": "b6e1f0cf6b9e1ec409a0d3e2f2a5fb0998e36b43",
- "shasum": ""
- },
- "type": "library",
- "autoload": {
- "classmap": [
- "src/"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "BSD-3-Clause"
- ],
- "authors": [
- {
- "name": "Sebastian Bergmann",
- "email": "sebastian@phpunit.de",
- "role": "lead"
- }
- ],
- "description": "Library that helps with managing the version number of Git-hosted PHP projects",
- "homepage": "https://github.com/sebastianbergmann/version",
- "time": "2014-03-07 15:35:33"
+ "time": "2016-06-17 09:04:28"
},
{
- "name": "symfony/browser-kit",
- "version": "v2.3.4",
- "target-dir": "Symfony/Component/BrowserKit",
+ "name": "sebastian/recursion-context",
+ "version": "1.0.5",
"source": {
"type": "git",
- "url": "https://github.com/symfony/BrowserKit.git",
- "reference": "2639dc4eec81f92760e05396a93bb78000b4f5ca"
+ "url": "https://github.com/sebastianbergmann/recursion-context.git",
+ "reference": "b19cc3298482a335a95f3016d2f8a6950f0fbcd7"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/BrowserKit/zipball/2639dc4eec81f92760e05396a93bb78000b4f5ca",
- "reference": "2639dc4eec81f92760e05396a93bb78000b4f5ca",
+ "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/b19cc3298482a335a95f3016d2f8a6950f0fbcd7",
+ "reference": "b19cc3298482a335a95f3016d2f8a6950f0fbcd7",
"shasum": ""
},
"require": {
- "php": ">=5.3.3",
- "symfony/dom-crawler": "~2.0"
+ "php": ">=5.3.3"
},
"require-dev": {
- "symfony/css-selector": "~2.0",
- "symfony/process": "~2.0"
- },
- "suggest": {
- "symfony/process": ""
+ "phpunit/phpunit": "~4.4"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "2.3-dev"
+ "dev-master": "1.0.x-dev"
}
},
"autoload": {
- "psr-0": {
- "Symfony\\Component\\BrowserKit\\": ""
- }
+ "classmap": [
+ "src/"
+ ]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
- "MIT"
+ "BSD-3-Clause"
],
"authors": [
{
- "name": "Fabien Potencier",
- "email": "fabien@symfony.com",
- "homepage": "http://fabien.potencier.org",
- "role": "Lead Developer"
+ "name": "Jeff Welch",
+ "email": "whatthejeff@gmail.com"
},
{
- "name": "Symfony Community",
- "homepage": "http://symfony.com/contributors"
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de"
+ },
+ {
+ "name": "Adam Harvey",
+ "email": "aharvey@php.net"
}
],
- "description": "Symfony BrowserKit Component",
- "homepage": "http://symfony.com",
- "time": "2013-07-21 12:12:18"
+ "description": "Provides functionality to recursively process PHP variables",
+ "homepage": "http://www.github.com/sebastianbergmann/recursion-context",
+ "time": "2016-10-03 07:41:43"
},
{
- "name": "symfony/console",
- "version": "v2.4.4",
- "target-dir": "Symfony/Component/Console",
+ "name": "sebastian/version",
+ "version": "1.0.6",
"source": {
"type": "git",
- "url": "https://github.com/symfony/Console.git",
- "reference": "2e452005b1e1d003d23702d227e23614679eb5ca"
+ "url": "https://github.com/sebastianbergmann/version.git",
+ "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/Console/zipball/2e452005b1e1d003d23702d227e23614679eb5ca",
- "reference": "2e452005b1e1d003d23702d227e23614679eb5ca",
+ "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/58b3a85e7999757d6ad81c787a1fbf5ff6c628c6",
+ "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6",
"shasum": ""
},
- "require": {
- "php": ">=5.3.3"
- },
- "require-dev": {
- "symfony/event-dispatcher": "~2.1"
- },
- "suggest": {
- "symfony/event-dispatcher": ""
- },
"type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "2.4-dev"
- }
- },
"autoload": {
- "psr-0": {
- "Symfony\\Component\\Console\\": ""
- }
+ "classmap": [
+ "src/"
+ ]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
- "MIT"
+ "BSD-3-Clause"
],
"authors": [
{
- "name": "Fabien Potencier",
- "email": "fabien@symfony.com",
- "homepage": "http://fabien.potencier.org",
- "role": "Lead Developer"
- },
- {
- "name": "Symfony Community",
- "homepage": "http://symfony.com/contributors"
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de",
+ "role": "lead"
}
],
- "description": "Symfony Console Component",
- "homepage": "http://symfony.com",
- "time": "2014-04-27 13:34:57"
+ "description": "Library that helps with managing the version number of Git-hosted PHP projects",
+ "homepage": "https://github.com/sebastianbergmann/version",
+ "time": "2015-06-21 13:59:46"
},
{
- "name": "symfony/css-selector",
- "version": "v2.3.4",
- "target-dir": "Symfony/Component/CssSelector",
+ "name": "squizlabs/php_codesniffer",
+ "version": "2.9.1",
"source": {
"type": "git",
- "url": "https://github.com/symfony/CssSelector.git",
- "reference": "885544201cb24e79754da1dbd61bd779c2e4353e"
+ "url": "https://github.com/squizlabs/PHP_CodeSniffer.git",
+ "reference": "dcbed1074f8244661eecddfc2a675430d8d33f62"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/CssSelector/zipball/885544201cb24e79754da1dbd61bd779c2e4353e",
- "reference": "885544201cb24e79754da1dbd61bd779c2e4353e",
+ "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/dcbed1074f8244661eecddfc2a675430d8d33f62",
+ "reference": "dcbed1074f8244661eecddfc2a675430d8d33f62",
"shasum": ""
},
"require": {
- "php": ">=5.3.3"
+ "ext-simplexml": "*",
+ "ext-tokenizer": "*",
+ "ext-xmlwriter": "*",
+ "php": ">=5.1.2"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "~4.0"
},
+ "bin": [
+ "scripts/phpcs",
+ "scripts/phpcbf"
+ ],
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "2.3-dev"
+ "dev-master": "2.x-dev"
}
},
"autoload": {
- "psr-0": {
- "Symfony\\Component\\CssSelector\\": ""
- }
+ "classmap": [
+ "CodeSniffer.php",
+ "CodeSniffer/CLI.php",
+ "CodeSniffer/Exception.php",
+ "CodeSniffer/File.php",
+ "CodeSniffer/Fixer.php",
+ "CodeSniffer/Report.php",
+ "CodeSniffer/Reporting.php",
+ "CodeSniffer/Sniff.php",
+ "CodeSniffer/Tokens.php",
+ "CodeSniffer/Reports/",
+ "CodeSniffer/Tokenizers/",
+ "CodeSniffer/DocGenerators/",
+ "CodeSniffer/Standards/AbstractPatternSniff.php",
+ "CodeSniffer/Standards/AbstractScopeSniff.php",
+ "CodeSniffer/Standards/AbstractVariableSniff.php",
+ "CodeSniffer/Standards/IncorrectPatternException.php",
+ "CodeSniffer/Standards/Generic/Sniffs/",
+ "CodeSniffer/Standards/MySource/Sniffs/",
+ "CodeSniffer/Standards/PEAR/Sniffs/",
+ "CodeSniffer/Standards/PSR1/Sniffs/",
+ "CodeSniffer/Standards/PSR2/Sniffs/",
+ "CodeSniffer/Standards/Squiz/Sniffs/",
+ "CodeSniffer/Standards/Zend/Sniffs/"
+ ]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
- "MIT"
+ "BSD-3-Clause"
],
"authors": [
{
- "name": "Fabien Potencier",
- "email": "fabien@symfony.com",
- "homepage": "http://fabien.potencier.org",
- "role": "Lead Developer"
- },
- {
- "name": "Symfony Community",
- "homepage": "http://symfony.com/contributors"
- },
- {
- "name": "Jean-François Simon",
- "email": "jeanfrancois.simon@sensiolabs.com"
+ "name": "Greg Sherwood",
+ "role": "lead"
}
],
- "description": "Symfony CssSelector Component",
- "homepage": "http://symfony.com",
- "time": "2013-07-21 12:12:18"
+ "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.",
+ "homepage": "http://www.squizlabs.com/php-codesniffer",
+ "keywords": [
+ "phpcs",
+ "standards"
+ ],
+ "time": "2017-05-22 02:43:20"
},
{
- "name": "symfony/dom-crawler",
- "version": "v2.3.4",
- "target-dir": "Symfony/Component/DomCrawler",
+ "name": "symfony/browser-kit",
+ "version": "v2.3.42",
+ "target-dir": "Symfony/Component/BrowserKit",
"source": {
"type": "git",
- "url": "https://github.com/symfony/DomCrawler.git",
- "reference": "e05e07fe8958a304b5e135f8e65d4ae6148cf59b"
+ "url": "https://github.com/symfony/browser-kit.git",
+ "reference": "0fca8e3490f003262258dcf67c329691913642e5"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/DomCrawler/zipball/e05e07fe8958a304b5e135f8e65d4ae6148cf59b",
- "reference": "e05e07fe8958a304b5e135f8e65d4ae6148cf59b",
+ "url": "https://api.github.com/repos/symfony/browser-kit/zipball/0fca8e3490f003262258dcf67c329691913642e5",
+ "reference": "0fca8e3490f003262258dcf67c329691913642e5",
"shasum": ""
},
"require": {
- "php": ">=5.3.3"
+ "php": ">=5.3.3",
+ "symfony/dom-crawler": "~2.0,>=2.0.5"
},
"require-dev": {
- "symfony/css-selector": "~2.0"
+ "symfony/css-selector": "~2.0,>=2.0.5",
+ "symfony/process": "~2.3.34|~2.7,>=2.7.6"
},
"suggest": {
- "symfony/css-selector": ""
+ "symfony/process": ""
},
"type": "library",
"extra": {
@@ -1416,8 +2196,11 @@
},
"autoload": {
"psr-0": {
- "Symfony\\Component\\DomCrawler\\": ""
- }
+ "Symfony\\Component\\BrowserKit\\": ""
+ },
+ "exclude-from-classmap": [
+ "/Tests/"
+ ]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
@@ -1426,44 +2209,35 @@
"authors": [
{
"name": "Fabien Potencier",
- "email": "fabien@symfony.com",
- "homepage": "http://fabien.potencier.org",
- "role": "Lead Developer"
+ "email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
- "homepage": "http://symfony.com/contributors"
+ "homepage": "https://symfony.com/contributors"
}
],
- "description": "Symfony DomCrawler Component",
- "homepage": "http://symfony.com",
- "time": "2013-07-21 12:12:18"
+ "description": "Symfony BrowserKit Component",
+ "homepage": "https://symfony.com",
+ "time": "2016-03-04 07:12:06"
},
{
- "name": "symfony/event-dispatcher",
- "version": "v2.3.4",
- "target-dir": "Symfony/Component/EventDispatcher",
+ "name": "symfony/css-selector",
+ "version": "v2.3.42",
+ "target-dir": "Symfony/Component/CssSelector",
"source": {
"type": "git",
- "url": "https://github.com/symfony/EventDispatcher.git",
- "reference": "41c9826457c65fa3cf746f214985b7ca9cba42f8"
+ "url": "https://github.com/symfony/css-selector.git",
+ "reference": "e750fff4bd738e54414fbfdd48ede6b0e99ab808"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/EventDispatcher/zipball/41c9826457c65fa3cf746f214985b7ca9cba42f8",
- "reference": "41c9826457c65fa3cf746f214985b7ca9cba42f8",
+ "url": "https://api.github.com/repos/symfony/css-selector/zipball/e750fff4bd738e54414fbfdd48ede6b0e99ab808",
+ "reference": "e750fff4bd738e54414fbfdd48ede6b0e99ab808",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
- "require-dev": {
- "symfony/dependency-injection": "~2.0"
- },
- "suggest": {
- "symfony/dependency-injection": "",
- "symfony/http-kernel": ""
- },
"type": "library",
"extra": {
"branch-alias": {
@@ -1472,8 +2246,11 @@
},
"autoload": {
"psr-0": {
- "Symfony\\Component\\EventDispatcher\\": ""
- }
+ "Symfony\\Component\\CssSelector\\": ""
+ },
+ "exclude-from-classmap": [
+ "/Tests/"
+ ]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
@@ -1481,48 +2258,59 @@
],
"authors": [
{
+ "name": "Jean-François Simon",
+ "email": "jeanfrancois.simon@sensiolabs.com"
+ },
+ {
"name": "Fabien Potencier",
- "email": "fabien@symfony.com",
- "homepage": "http://fabien.potencier.org",
- "role": "Lead Developer"
+ "email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
- "homepage": "http://symfony.com/contributors"
+ "homepage": "https://symfony.com/contributors"
}
],
- "description": "Symfony EventDispatcher Component",
- "homepage": "http://symfony.com",
- "time": "2013-07-21 12:12:18"
+ "description": "Symfony CssSelector Component",
+ "homepage": "https://symfony.com",
+ "time": "2016-03-04 07:12:06"
},
{
- "name": "symfony/filesystem",
- "version": "v2.4.4",
- "target-dir": "Symfony/Component/Filesystem",
+ "name": "symfony/dom-crawler",
+ "version": "v2.3.42",
+ "target-dir": "Symfony/Component/DomCrawler",
"source": {
"type": "git",
- "url": "https://github.com/symfony/Filesystem.git",
- "reference": "a3af8294bcce4a7c1b2892363b0c9d8109affad4"
+ "url": "https://github.com/symfony/dom-crawler.git",
+ "reference": "b1a52aeafe4dd31914c75e72fc9b9ca3a3e5981d"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/Filesystem/zipball/a3af8294bcce4a7c1b2892363b0c9d8109affad4",
- "reference": "a3af8294bcce4a7c1b2892363b0c9d8109affad4",
+ "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/b1a52aeafe4dd31914c75e72fc9b9ca3a3e5981d",
+ "reference": "b1a52aeafe4dd31914c75e72fc9b9ca3a3e5981d",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
+ "require-dev": {
+ "symfony/css-selector": "~2.0,>=2.0.5"
+ },
+ "suggest": {
+ "symfony/css-selector": ""
+ },
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "2.4-dev"
+ "dev-master": "2.3-dev"
}
},
"autoload": {
"psr-0": {
- "Symfony\\Component\\Filesystem\\": ""
- }
+ "Symfony\\Component\\DomCrawler\\": ""
+ },
+ "exclude-from-classmap": [
+ "/Tests/"
+ ]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
@@ -1531,32 +2319,30 @@
"authors": [
{
"name": "Fabien Potencier",
- "email": "fabien@symfony.com",
- "homepage": "http://fabien.potencier.org",
- "role": "Lead Developer"
+ "email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
- "homepage": "http://symfony.com/contributors"
+ "homepage": "https://symfony.com/contributors"
}
],
- "description": "Symfony Filesystem Component",
- "homepage": "http://symfony.com",
- "time": "2014-04-16 10:34:31"
+ "description": "Symfony DomCrawler Component",
+ "homepage": "https://symfony.com",
+ "time": "2016-04-06 13:13:46"
},
{
"name": "symfony/finder",
- "version": "v2.3.4",
+ "version": "v2.3.42",
"target-dir": "Symfony/Component/Finder",
"source": {
"type": "git",
- "url": "https://github.com/symfony/Finder.git",
- "reference": "4a0fee5b86f5bbd9dfdc11ec124eba2915737ce1"
+ "url": "https://github.com/symfony/finder.git",
+ "reference": "dce4b58434fc1cbd66e3006e539bb53074dfea82"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/Finder/zipball/4a0fee5b86f5bbd9dfdc11ec124eba2915737ce1",
- "reference": "4a0fee5b86f5bbd9dfdc11ec124eba2915737ce1",
+ "url": "https://api.github.com/repos/symfony/finder/zipball/dce4b58434fc1cbd66e3006e539bb53074dfea82",
+ "reference": "dce4b58434fc1cbd66e3006e539bb53074dfea82",
"shasum": ""
},
"require": {
@@ -1571,7 +2357,10 @@
"autoload": {
"psr-0": {
"Symfony\\Component\\Finder\\": ""
- }
+ },
+ "exclude-from-classmap": [
+ "/Tests/"
+ ]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
@@ -1580,32 +2369,30 @@
"authors": [
{
"name": "Fabien Potencier",
- "email": "fabien@symfony.com",
- "homepage": "http://fabien.potencier.org",
- "role": "Lead Developer"
+ "email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
- "homepage": "http://symfony.com/contributors"
+ "homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony Finder Component",
- "homepage": "http://symfony.com",
- "time": "2013-08-13 20:18:00"
+ "homepage": "https://symfony.com",
+ "time": "2016-05-13 14:58:35"
},
{
"name": "symfony/process",
- "version": "v2.3.4",
+ "version": "v2.3.42",
"target-dir": "Symfony/Component/Process",
"source": {
"type": "git",
- "url": "https://github.com/symfony/Process.git",
- "reference": "1e91553e1cedd0b8fb1da6ea4f89b02e21713d5b"
+ "url": "https://github.com/symfony/process.git",
+ "reference": "89aced1438655ad81fc828c2e2e555e9b88fef3b"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/Process/zipball/1e91553e1cedd0b8fb1da6ea4f89b02e21713d5b",
- "reference": "1e91553e1cedd0b8fb1da6ea4f89b02e21713d5b",
+ "url": "https://api.github.com/repos/symfony/process/zipball/89aced1438655ad81fc828c2e2e555e9b88fef3b",
+ "reference": "89aced1438655ad81fc828c2e2e555e9b88fef3b",
"shasum": ""
},
"require": {
@@ -1620,56 +2407,10 @@
"autoload": {
"psr-0": {
"Symfony\\Component\\Process\\": ""
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Fabien Potencier",
- "email": "fabien@symfony.com",
- "homepage": "http://fabien.potencier.org",
- "role": "Lead Developer"
},
- {
- "name": "Symfony Community",
- "homepage": "http://symfony.com/contributors"
- }
- ],
- "description": "Symfony Process Component",
- "homepage": "http://symfony.com",
- "time": "2013-08-22 06:42:25"
- },
- {
- "name": "symfony/yaml",
- "version": "v2.4.4",
- "target-dir": "Symfony/Component/Yaml",
- "source": {
- "type": "git",
- "url": "https://github.com/symfony/Yaml.git",
- "reference": "65539ecde838f9c0d18b006b2101e3deb4b5c9ff"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/symfony/Yaml/zipball/65539ecde838f9c0d18b006b2101e3deb4b5c9ff",
- "reference": "65539ecde838f9c0d18b006b2101e3deb4b5c9ff",
- "shasum": ""
- },
- "require": {
- "php": ">=5.3.3"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "2.4-dev"
- }
- },
- "autoload": {
- "psr-0": {
- "Symfony\\Component\\Yaml\\": ""
- }
+ "exclude-from-classmap": [
+ "/Tests/"
+ ]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
@@ -1678,88 +2419,25 @@
"authors": [
{
"name": "Fabien Potencier",
- "email": "fabien@symfony.com",
- "homepage": "http://fabien.potencier.org",
- "role": "Lead Developer"
+ "email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
- "homepage": "http://symfony.com/contributors"
+ "homepage": "https://symfony.com/contributors"
}
],
- "description": "Symfony Yaml Component",
- "homepage": "http://symfony.com",
- "time": "2014-04-18 20:37:09"
- },
- {
- "name": "twig/twig",
- "version": "v1.15.1",
- "source": {
- "type": "git",
- "url": "https://github.com/fabpot/Twig.git",
- "reference": "1fb5784662f438d7d96a541e305e28b812e2eeed"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/fabpot/Twig/zipball/1fb5784662f438d7d96a541e305e28b812e2eeed",
- "reference": "1fb5784662f438d7d96a541e305e28b812e2eeed",
- "shasum": ""
- },
- "require": {
- "php": ">=5.2.4"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "1.15-dev"
- }
- },
- "autoload": {
- "psr-0": {
- "Twig_": "lib/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "BSD-3-Clause"
- ],
- "authors": [
- {
- "name": "Fabien Potencier",
- "email": "fabien@symfony.com",
- "homepage": "http://fabien.potencier.org",
- "role": "Lead Developer"
- },
- {
- "name": "Armin Ronacher",
- "email": "armin.ronacher@active-4.com",
- "role": "Project Founder"
- },
- {
- "name": "Twig Team",
- "homepage": "https://github.com/fabpot/Twig/graphs/contributors",
- "role": "Contributors"
- }
- ],
- "description": "Twig, the flexible, fast, and secure template language for PHP",
- "homepage": "http://twig.sensiolabs.org",
- "keywords": [
- "templating"
- ],
- "time": "2014-02-13 10:19:29"
+ "description": "Symfony Process Component",
+ "homepage": "https://symfony.com",
+ "time": "2016-03-31 08:39:43"
}
],
- "aliases": [
-
- ],
+ "aliases": [],
"minimum-stability": "stable",
- "stability-flags": [
-
- ],
- "platform": [
-
- ],
- "platform-dev": [
-
- ]
+ "stability-flags": [],
+ "prefer-stable": false,
+ "prefer-lowest": false,
+ "platform": {
+ "php": ">=5.3.3,<=7.3.17"
+ },
+ "platform-dev": []
}
diff --git a/phpBB/config/.htaccess b/phpBB/config/.htaccess
new file mode 100644
index 0000000000..4128d345ab
--- /dev/null
+++ b/phpBB/config/.htaccess
@@ -0,0 +1,4 @@
+<Files *>
+ Order Allow,Deny
+ Deny from All
+</Files>
diff --git a/phpBB/config/auth.yml b/phpBB/config/auth.yml
new file mode 100644
index 0000000000..ef06080d38
--- /dev/null
+++ b/phpBB/config/auth.yml
@@ -0,0 +1,101 @@
+services:
+# ----- Auth management -----
+ auth:
+ class: phpbb\auth\auth
+
+# ----- Auth providers -----
+ auth.provider_collection:
+ class: phpbb\auth\provider_collection
+ arguments:
+ - @service_container
+ - @config
+ tags:
+ - { name: service_collection, tag: auth.provider }
+
+ auth.provider.db:
+ class: phpbb\auth\provider\db
+ arguments:
+ - @dbal.conn
+ - @config
+ - @passwords.manager
+ - @request
+ - @user
+ - @service_container
+ - %core.root_path%
+ - %core.php_ext%
+ tags:
+ - { name: auth.provider }
+
+ auth.provider.apache:
+ class: phpbb\auth\provider\apache
+ arguments:
+ - @dbal.conn
+ - @config
+ - @passwords.manager
+ - @request
+ - @user
+ - %core.root_path%
+ - %core.php_ext%
+ tags:
+ - { name: auth.provider }
+
+ auth.provider.ldap:
+ class: phpbb\auth\provider\ldap
+ arguments:
+ - @dbal.conn
+ - @config
+ - @passwords.manager
+ - @user
+ tags:
+ - { name: auth.provider }
+
+ auth.provider.oauth:
+ class: phpbb\auth\provider\oauth\oauth
+ arguments:
+ - @dbal.conn
+ - @config
+ - @passwords.manager
+ - @request
+ - @user
+ - %tables.auth_provider_oauth_token_storage%
+ - %tables.auth_provider_oauth_account_assoc%
+ - @auth.provider.oauth.service_collection
+ - %tables.users%
+ - @service_container
+ - @dispatcher
+ - %core.root_path%
+ - %core.php_ext%
+ tags:
+ - { name: auth.provider }
+
+# ----- OAuth services providers -----
+ auth.provider.oauth.service_collection:
+ class: phpbb\di\service_collection
+ arguments:
+ - @service_container
+ tags:
+ - { name: service_collection, tag: auth.provider.oauth.service }
+
+ auth.provider.oauth.service.bitly:
+ class: phpbb\auth\provider\oauth\service\bitly
+ arguments:
+ - @config
+ - @request
+ tags:
+ - { name: auth.provider.oauth.service }
+
+ auth.provider.oauth.service.facebook:
+ class: phpbb\auth\provider\oauth\service\facebook
+ arguments:
+ - @config
+ - @request
+ tags:
+ - { name: auth.provider.oauth.service }
+
+ auth.provider.oauth.service.google:
+ class: phpbb\auth\provider\oauth\service\google
+ arguments:
+ - @config
+ - @request
+ tags:
+ - { name: auth.provider.oauth.service }
diff --git a/phpBB/config/avatar.yml b/phpBB/config/avatar.yml
new file mode 100644
index 0000000000..b0dca137b0
--- /dev/null
+++ b/phpBB/config/avatar.yml
@@ -0,0 +1,68 @@
+services:
+ avatar.manager:
+ class: phpbb\avatar\manager
+ arguments:
+ - @config
+ - @avatar.driver_collection
+
+# ----- Avatar drivers -----
+ avatar.driver_collection:
+ class: phpbb\di\service_collection
+ arguments:
+ - @service_container
+ tags:
+ - { name: service_collection, tag: avatar.driver }
+
+ avatar.driver.gravatar:
+ class: phpbb\avatar\driver\gravatar
+ arguments:
+ - @config
+ - %core.root_path%
+ - %core.php_ext%
+ - @path_helper
+ - @cache.driver
+ calls:
+ - [set_name, [avatar.driver.gravatar]]
+ tags:
+ - { name: avatar.driver }
+
+ avatar.driver.local:
+ class: phpbb\avatar\driver\local
+ arguments:
+ - @config
+ - %core.root_path%
+ - %core.php_ext%
+ - @path_helper
+ - @cache.driver
+ calls:
+ - [set_name, [avatar.driver.local]]
+ tags:
+ - { name: avatar.driver }
+
+ avatar.driver.remote:
+ class: phpbb\avatar\driver\remote
+ arguments:
+ - @config
+ - %core.root_path%
+ - %core.php_ext%
+ - @path_helper
+ - @cache.driver
+ calls:
+ - [set_name, [avatar.driver.remote]]
+ tags:
+ - { name: avatar.driver }
+
+ avatar.driver.upload:
+ class: phpbb\avatar\driver\upload
+ arguments:
+ - @config
+ - %core.root_path%
+ - %core.php_ext%
+ - @path_helper
+ - @mimetype.guesser
+ - @dispatcher
+ - @cache.driver
+ calls:
+ - [set_name, [avatar.driver.upload]]
+ tags:
+ - { name: avatar.driver }
diff --git a/phpBB/config/captcha.yml b/phpBB/config/captcha.yml
new file mode 100644
index 0000000000..e3f617e909
--- /dev/null
+++ b/phpBB/config/captcha.yml
@@ -0,0 +1,59 @@
+services:
+ captcha.factory:
+ class: phpbb\captcha\factory
+ arguments:
+ - @service_container
+ - @captcha.plugins.service_collection
+
+# ----- Captcha plugins -----
+# Scope MUST be prototype for all the plugins to work.
+ captcha.plugins.service_collection:
+ class: phpbb\di\service_collection
+ arguments:
+ - @service_container
+ tags:
+ - { name: service_collection, tag: captcha.plugins }
+
+ core.captcha.plugins.gd:
+ class: phpbb\captcha\plugins\gd
+ scope: prototype
+ calls:
+ - [set_name, [core.captcha.plugins.gd]]
+ tags:
+ - { name: captcha.plugins }
+
+ core.captcha.plugins.gd_wave:
+ class: phpbb\captcha\plugins\gd_wave
+ scope: prototype
+ calls:
+ - [set_name, [core.captcha.plugins.gd_wave]]
+ tags:
+ - { name: captcha.plugins }
+
+ core.captcha.plugins.nogd:
+ class: phpbb\captcha\plugins\nogd
+ scope: prototype
+ calls:
+ - [set_name, [core.captcha.plugins.nogd]]
+ tags:
+ - { name: captcha.plugins }
+
+ core.captcha.plugins.qa:
+ class: phpbb\captcha\plugins\qa
+ scope: prototype
+ arguments:
+ - %tables.captcha_qa_questions%
+ - %tables.captcha_qa_answers%
+ - %tables.captcha_qa_confirm%
+ calls:
+ - [set_name, [core.captcha.plugins.qa]]
+ tags:
+ - { name: captcha.plugins }
+
+ core.captcha.plugins.recaptcha:
+ class: phpbb\captcha\plugins\recaptcha
+ scope: prototype
+ calls:
+ - [set_name, [core.captcha.plugins.recaptcha]]
+ tags:
+ - { name: captcha.plugins }
diff --git a/phpBB/config/console.yml b/phpBB/config/console.yml
new file mode 100644
index 0000000000..55ffd358e4
--- /dev/null
+++ b/phpBB/config/console.yml
@@ -0,0 +1,162 @@
+services:
+ console.command_collection:
+ class: phpbb\di\service_collection
+ arguments:
+ - @service_container
+ tags:
+ - { name: service_collection, tag: console.command }
+
+ console.command.cache.purge:
+ class: phpbb\console\command\cache\purge
+ arguments:
+ - @user
+ - @cache.driver
+ - @dbal.conn
+ - @auth
+ - @log
+ - @config
+ tags:
+ - { name: console.command }
+
+ console.command.config.delete:
+ class: phpbb\console\command\config\delete
+ arguments:
+ - @user
+ - @config
+ tags:
+ - { name: console.command }
+
+ console.command.config.increment:
+ class: phpbb\console\command\config\increment
+ arguments:
+ - @user
+ - @config
+ tags:
+ - { name: console.command }
+
+ console.command.config.get:
+ class: phpbb\console\command\config\get
+ arguments:
+ - @user
+ - @config
+ tags:
+ - { name: console.command }
+
+ console.command.config.set:
+ class: phpbb\console\command\config\set
+ arguments:
+ - @user
+ - @config
+ tags:
+ - { name: console.command }
+
+ console.command.config.set_atomic:
+ class: phpbb\console\command\config\set_atomic
+ arguments:
+ - @user
+ - @config
+ tags:
+ - { name: console.command }
+
+ console.command.cron.list:
+ class: phpbb\console\command\cron\cron_list
+ arguments:
+ - @user
+ - @cron.manager
+ tags:
+ - { name: console.command }
+
+ console.command.cron.run:
+ class: phpbb\console\command\cron\run
+ arguments:
+ - @user
+ - @cron.manager
+ - @cron.lock_db
+ tags:
+ - { name: console.command }
+
+ console.command.db.migrate:
+ class: phpbb\console\command\db\migrate
+ arguments:
+ - @user
+ - @migrator
+ - @ext.manager
+ - @config
+ - @cache
+ - @log
+ - %core.root_path%
+ tags:
+ - { name: console.command }
+
+ console.command.dev.migration_tips:
+ class: phpbb\console\command\dev\migration_tips
+ arguments:
+ - @user
+ - @ext.manager
+ tags:
+ - { name: console.command }
+
+ console.command.extension.disable:
+ class: phpbb\console\command\extension\disable
+ arguments:
+ - @user
+ - @ext.manager
+ - @log
+ tags:
+ - { name: console.command }
+
+ console.command.extension.enable:
+ class: phpbb\console\command\extension\enable
+ arguments:
+ - @user
+ - @ext.manager
+ - @log
+ tags:
+ - { name: console.command }
+
+ console.command.extension.purge:
+ class: phpbb\console\command\extension\purge
+ arguments:
+ - @user
+ - @ext.manager
+ - @log
+ tags:
+ - { name: console.command }
+
+ console.command.extension.show:
+ class: phpbb\console\command\extension\show
+ arguments:
+ - @user
+ - @ext.manager
+ - @log
+ tags:
+ - { name: console.command }
+
+ console.command.fixup.recalculate_email_hash:
+ class: phpbb\console\command\fixup\recalculate_email_hash
+ arguments:
+ - @user
+ - @dbal.conn
+ tags:
+ - { name: console.command }
+
+ console.command.fixup.update_hashes:
+ class: phpbb\console\command\fixup\update_hashes
+ arguments:
+ - @config
+ - @user
+ - @dbal.conn
+ - @passwords.manager
+ - @passwords.driver_collection
+ - %passwords.algorithms%
+ tags:
+ - { name: console.command }
+
+ console.command.fixup.fix_left_right_ids:
+ class: phpbb\console\command\fixup\fix_left_right_ids
+ arguments:
+ - @user
+ - @dbal.conn
+ - @cache.driver
+ tags:
+ - { name: console.command }
diff --git a/phpBB/config/content.yml b/phpBB/config/content.yml
new file mode 100644
index 0000000000..4d9ee31335
--- /dev/null
+++ b/phpBB/config/content.yml
@@ -0,0 +1,72 @@
+services:
+ content.visibility:
+ class: phpbb\content_visibility
+ arguments:
+ - @auth
+ - @config
+ - @dispatcher
+ - @dbal.conn
+ - @user
+ - %core.root_path%
+ - %core.php_ext%
+ - %tables.forums%
+ - %tables.posts%
+ - %tables.topics%
+ - %tables.users%
+
+ groupposition.legend:
+ class: phpbb\groupposition\legend
+ arguments:
+ - @dbal.conn
+ - @user
+
+ groupposition.teampage:
+ class: phpbb\groupposition\teampage
+ arguments:
+ - @dbal.conn
+ - @user
+ - @cache.driver
+
+ message.form.admin:
+ class: phpbb\message\admin_form
+ arguments:
+ - @auth
+ - @config
+ - @config_text
+ - @dbal.conn
+ - @user
+ - %core.root_path%
+ - %core.php_ext%
+
+ message.form.topic:
+ class: phpbb\message\topic_form
+ arguments:
+ - @auth
+ - @config
+ - @dbal.conn
+ - @user
+ - %core.root_path%
+ - %core.php_ext%
+
+ message.form.user:
+ class: phpbb\message\user_form
+ arguments:
+ - @auth
+ - @config
+ - @dbal.conn
+ - @user
+ - %core.root_path%
+ - %core.php_ext%
+
+ pagination:
+ class: phpbb\pagination
+ arguments:
+ - @template
+ - @user
+ - @controller.helper
+ - @dispatcher
+
+ viewonline_helper:
+ class: phpbb\viewonline_helper
+ arguments:
+ - @filesystem
diff --git a/phpBB/config/cron.yml b/phpBB/config/cron.yml
new file mode 100644
index 0000000000..dc628b43ff
--- /dev/null
+++ b/phpBB/config/cron.yml
@@ -0,0 +1,162 @@
+services:
+ cron.manager:
+ class: phpbb\cron\manager
+ arguments:
+ - @cron.task_collection
+ - %core.root_path%
+ - %core.php_ext%
+
+ cron.lock_db:
+ class: phpbb\lock\db
+ arguments:
+ - cron_lock
+ - @config
+ - @dbal.conn
+
+# ----- Cron tasks -----
+ cron.task_collection:
+ class: phpbb\di\service_collection
+ arguments:
+ - @service_container
+ tags:
+ - { name: service_collection, tag: cron.task }
+
+ cron.task.core.prune_all_forums:
+ class: phpbb\cron\task\core\prune_all_forums
+ arguments:
+ - %core.root_path%
+ - %core.php_ext%
+ - @config
+ - @dbal.conn
+ calls:
+ - [set_name, [cron.task.core.prune_all_forums]]
+ tags:
+ - { name: cron.task }
+
+ cron.task.core.prune_forum:
+ class: phpbb\cron\task\core\prune_forum
+ arguments:
+ - %core.root_path%
+ - %core.php_ext%
+ - @config
+ - @dbal.conn
+ calls:
+ - [set_name, [cron.task.core.prune_forum]]
+ tags:
+ - { name: cron.task }
+
+ cron.task.core.prune_shadow_topics:
+ class: phpbb\cron\task\core\prune_shadow_topics
+ arguments:
+ - %core.root_path%
+ - %core.php_ext%
+ - @config
+ - @dbal.conn
+ - @log
+ - @user
+ calls:
+ - [set_name, [cron.task.core.prune_shadow_topics]]
+ tags:
+ - { name: cron.task }
+
+ cron.task.core.prune_notifications:
+ class: phpbb\cron\task\core\prune_notifications
+ arguments:
+ - @config
+ - @notification_manager
+ calls:
+ - [set_name, [cron.task.core.prune_notifications]]
+ tags:
+ - { name: cron.task }
+
+ cron.task.core.queue:
+ class: phpbb\cron\task\core\queue
+ arguments:
+ - %core.root_path%
+ - %core.php_ext%
+ - @config
+ calls:
+ - [set_name, [cron.task.core.queue]]
+ tags:
+ - { name: cron.task }
+
+ cron.task.core.tidy_cache:
+ class: phpbb\cron\task\core\tidy_cache
+ arguments:
+ - @config
+ - @cache.driver
+ calls:
+ - [set_name, [cron.task.core.tidy_cache]]
+ tags:
+ - { name: cron.task }
+
+ cron.task.core.tidy_database:
+ class: phpbb\cron\task\core\tidy_database
+ arguments:
+ - %core.root_path%
+ - %core.php_ext%
+ - @config
+ calls:
+ - [set_name, [cron.task.core.tidy_database]]
+ tags:
+ - { name: cron.task }
+
+ cron.task.core.tidy_plupload:
+ class: phpbb\cron\task\core\tidy_plupload
+ arguments:
+ - %core.root_path%
+ - @config
+ calls:
+ - [set_name, [cron.task.core.tidy_plupload]]
+ tags:
+ - { name: cron.task }
+
+ cron.task.core.tidy_search:
+ class: phpbb\cron\task\core\tidy_search
+ arguments:
+ - %core.root_path%
+ - %core.php_ext%
+ - @auth
+ - @config
+ - @dbal.conn
+ - @user
+ - @dispatcher
+ calls:
+ - [set_name, [cron.task.core.tidy_search]]
+ tags:
+ - { name: cron.task }
+
+ cron.task.core.tidy_sessions:
+ class: phpbb\cron\task\core\tidy_sessions
+ arguments:
+ - @config
+ - @user
+ calls:
+ - [set_name, [cron.task.core.tidy_sessions]]
+ tags:
+ - { name: cron.task }
+
+ cron.task.core.tidy_warnings:
+ class: phpbb\cron\task\core\tidy_warnings
+ arguments:
+ - %core.root_path%
+ - %core.php_ext%
+ - @config
+ calls:
+ - [set_name, [cron.task.core.tidy_warnings]]
+ tags:
+ - { name: cron.task }
+
+ cron.task.core.update_hashes:
+ class: phpbb\cron\task\core\update_hashes
+ arguments:
+ - @config
+ - @dbal.conn
+ - @passwords.update.lock
+ - @passwords.manager
+ - @passwords.driver_collection
+ - %passwords.algorithms%
+ calls:
+ - [set_name, [cron.task.core.update_hashes]]
+ tags:
+ - { name: cron.task }
diff --git a/phpBB/config/db.yml b/phpBB/config/db.yml
new file mode 100644
index 0000000000..4ab4401bbd
--- /dev/null
+++ b/phpBB/config/db.yml
@@ -0,0 +1,76 @@
+services:
+ dbal.conn:
+ class: phpbb\db\driver\factory
+ arguments:
+ - @service_container
+
+ dbal.conn.driver:
+ synthetic: true
+
+ dbal.tools:
+ class: phpbb\db\tools
+ arguments:
+ - @dbal.conn
+
+# ----- Migrator -----
+ migrator:
+ class: phpbb\db\migrator
+ arguments:
+ - @service_container
+ - @config
+ - @dbal.conn
+ - @dbal.tools
+ - %tables.migrations%
+ - %core.root_path%
+ - %core.php_ext%
+ - %core.table_prefix%
+ - @migrator.tool_collection
+ - @migrator.helper
+
+ migrator.helper:
+ class: phpbb\db\migration\helper
+
+# ----- Migrator's tools -----
+ migrator.tool_collection:
+ class: phpbb\di\service_collection
+ arguments:
+ - @service_container
+ tags:
+ - { name: service_collection, tag: migrator.tool }
+
+ migrator.tool.config:
+ class: phpbb\db\migration\tool\config
+ arguments:
+ - @config
+ tags:
+ - { name: migrator.tool }
+
+ migrator.tool.config_text:
+ class: phpbb\db\migration\tool\config_text
+ arguments:
+ - @config_text
+ tags:
+ - { name: migrator.tool }
+
+ migrator.tool.module:
+ class: phpbb\db\migration\tool\module
+ arguments:
+ - @dbal.conn
+ - @cache
+ - @user
+ - %core.root_path%
+ - %core.php_ext%
+ - %tables.modules%
+ tags:
+ - { name: migrator.tool }
+
+ migrator.tool.permission:
+ class: phpbb\db\migration\tool\permission
+ arguments:
+ - @dbal.conn
+ - @cache
+ - @auth
+ - %core.root_path%
+ - %core.php_ext%
+ tags:
+ - { name: migrator.tool }
diff --git a/phpBB/config/event.yml b/phpBB/config/event.yml
new file mode 100644
index 0000000000..7bc4cb0042
--- /dev/null
+++ b/phpBB/config/event.yml
@@ -0,0 +1,41 @@
+services:
+ dispatcher:
+ class: phpbb\event\dispatcher
+ arguments:
+ - @service_container
+
+ hook_finder:
+ class: phpbb\hook\finder
+ arguments:
+ - %core.root_path%
+ - %core.php_ext%
+ - @cache.driver
+
+ kernel_request_subscriber:
+ class: phpbb\event\kernel_request_subscriber
+ arguments:
+ - @ext.manager
+ - %core.root_path%
+ - %core.php_ext%
+ tags:
+ - { name: kernel.event_subscriber }
+
+ kernel_exception_subscriber:
+ class: phpbb\event\kernel_exception_subscriber
+ arguments:
+ - @template
+ - @user
+ tags:
+ - { name: kernel.event_subscriber }
+
+ kernel_terminate_subscriber:
+ class: phpbb\event\kernel_terminate_subscriber
+ tags:
+ - { name: kernel.event_subscriber }
+
+ symfony_response_listener:
+ class: Symfony\Component\HttpKernel\EventListener\ResponseListener
+ arguments:
+ - UTF-8
+ tags:
+ - { name: kernel.event_subscriber }
diff --git a/phpBB/config/feed.yml b/phpBB/config/feed.yml
new file mode 100644
index 0000000000..b69f80b2c5
--- /dev/null
+++ b/phpBB/config/feed.yml
@@ -0,0 +1,113 @@
+services:
+ feed.helper:
+ class: phpbb\feed\helper
+ arguments:
+ - @config
+ - @user
+ - %core.root_path%
+ - %core.php_ext%
+
+ feed.factory:
+ class: phpbb\feed\factory
+ arguments:
+ - @service_container
+ - @config
+ - @dbal.conn
+
+ feed.forum:
+ class: phpbb\feed\forum
+ scope: prototype
+ arguments:
+ - @feed.helper
+ - @config
+ - @dbal.conn
+ - @cache.driver
+ - @user
+ - @auth
+ - @content.visibility
+ - @dispatcher
+ - %core.php_ext%
+
+ feed.forums:
+ class: phpbb\feed\forums
+ scope: prototype
+ arguments:
+ - @feed.helper
+ - @config
+ - @dbal.conn
+ - @cache.driver
+ - @user
+ - @auth
+ - @content.visibility
+ - @dispatcher
+ - %core.php_ext%
+
+ feed.news:
+ class: phpbb\feed\news
+ scope: prototype
+ arguments:
+ - @feed.helper
+ - @config
+ - @dbal.conn
+ - @cache.driver
+ - @user
+ - @auth
+ - @content.visibility
+ - @dispatcher
+ - %core.php_ext%
+
+ feed.overall:
+ class: phpbb\feed\overall
+ scope: prototype
+ arguments:
+ - @feed.helper
+ - @config
+ - @dbal.conn
+ - @cache.driver
+ - @user
+ - @auth
+ - @content.visibility
+ - @dispatcher
+ - %core.php_ext%
+
+ feed.topic:
+ class: phpbb\feed\topic
+ scope: prototype
+ arguments:
+ - @feed.helper
+ - @config
+ - @dbal.conn
+ - @cache.driver
+ - @user
+ - @auth
+ - @content.visibility
+ - @dispatcher
+ - %core.php_ext%
+
+ feed.topics:
+ class: phpbb\feed\topics
+ scope: prototype
+ arguments:
+ - @feed.helper
+ - @config
+ - @dbal.conn
+ - @cache.driver
+ - @user
+ - @auth
+ - @content.visibility
+ - @dispatcher
+ - %core.php_ext%
+
+ feed.topics_active:
+ class: phpbb\feed\topics_active
+ scope: prototype
+ arguments:
+ - @feed.helper
+ - @config
+ - @dbal.conn
+ - @cache.driver
+ - @user
+ - @auth
+ - @content.visibility
+ - @dispatcher
+ - %core.php_ext%
diff --git a/phpBB/config/mimetype_guesser.yml b/phpBB/config/mimetype_guesser.yml
new file mode 100644
index 0000000000..2e89ed3c1f
--- /dev/null
+++ b/phpBB/config/mimetype_guesser.yml
@@ -0,0 +1,36 @@
+services:
+ mimetype.guesser_collection:
+ class: phpbb\di\service_collection
+ arguments:
+ - @service_container
+ tags:
+ - { name: service_collection, tag: mimetype.guessers }
+
+ mimetype.fileinfo_mimetype_guesser:
+ class: Symfony\Component\HttpFoundation\File\MimeType\FileinfoMimeTypeGuesser
+ tags:
+ - { name: mimetype.guessers }
+
+ mimetype.filebinary_mimetype_guesser:
+ class: Symfony\Component\HttpFoundation\File\MimeType\FileBinaryMimeTypeGuesser
+ tags:
+ - { name: mimetype.guessers }
+
+ mimetype.content_guesser:
+ class: phpbb\mimetype\content_guesser
+ calls:
+ - [set_priority, [%mimetype.guesser.priority.low%]]
+ tags:
+ - { name: mimetype.guessers }
+
+ mimetype.extension_guesser:
+ class: phpbb\mimetype\extension_guesser
+ calls:
+ - [set_priority, [%mimetype.guesser.priority.lowest%]]
+ tags:
+ - { name: mimetype.guessers }
+
+ mimetype.guesser:
+ class: phpbb\mimetype\guesser
+ arguments:
+ - @mimetype.guesser_collection
diff --git a/phpBB/config/notification.yml b/phpBB/config/notification.yml
new file mode 100644
index 0000000000..b17a172fb5
--- /dev/null
+++ b/phpBB/config/notification.yml
@@ -0,0 +1,390 @@
+services:
+ notification_manager:
+ class: phpbb\notification\manager
+ arguments:
+ - @notification.type_collection
+ - @notification.method_collection
+ - @service_container
+ - @user_loader
+ - @config
+ - @dispatcher
+ - @dbal.conn
+ - @cache
+ - @user
+ - %core.root_path%
+ - %core.php_ext%
+ - %tables.notification_types%
+ - %tables.notifications%
+ - %tables.user_notifications%
+
+# ----- Notification's types -----
+# Scope MUST be prototype for all the plugins to work.
+ notification.type_collection:
+ class: phpbb\di\service_collection
+ arguments:
+ - @service_container
+ tags:
+ - { name: service_collection, tag: notification.type }
+
+ notification.type.approve_post:
+ class: phpbb\notification\type\approve_post
+ scope: prototype
+ arguments:
+ - @user_loader
+ - @dbal.conn
+ - @cache.driver
+ - @user
+ - @auth
+ - @config
+ - %core.root_path%
+ - %core.php_ext%
+ - %tables.notification_types%
+ - %tables.notifications%
+ - %tables.user_notifications%
+ tags:
+ - { name: notification.type }
+
+ notification.type.approve_topic:
+ class: phpbb\notification\type\approve_topic
+ scope: prototype
+ arguments:
+ - @user_loader
+ - @dbal.conn
+ - @cache.driver
+ - @user
+ - @auth
+ - @config
+ - %core.root_path%
+ - %core.php_ext%
+ - %tables.notification_types%
+ - %tables.notifications%
+ - %tables.user_notifications%
+ tags:
+ - { name: notification.type }
+
+ notification.type.bookmark:
+ class: phpbb\notification\type\bookmark
+ scope: prototype
+ arguments:
+ - @user_loader
+ - @dbal.conn
+ - @cache.driver
+ - @user
+ - @auth
+ - @config
+ - %core.root_path%
+ - %core.php_ext%
+ - %tables.notification_types%
+ - %tables.notifications%
+ - %tables.user_notifications%
+ tags:
+ - { name: notification.type }
+
+ notification.type.disapprove_post:
+ class: phpbb\notification\type\disapprove_post
+ scope: prototype
+ arguments:
+ - @user_loader
+ - @dbal.conn
+ - @cache.driver
+ - @user
+ - @auth
+ - @config
+ - %core.root_path%
+ - %core.php_ext%
+ - %tables.notification_types%
+ - %tables.notifications%
+ - %tables.user_notifications%
+ tags:
+ - { name: notification.type }
+
+ notification.type.disapprove_topic:
+ class: phpbb\notification\type\disapprove_topic
+ scope: prototype
+ arguments:
+ - @user_loader
+ - @dbal.conn
+ - @cache.driver
+ - @user
+ - @auth
+ - @config
+ - %core.root_path%
+ - %core.php_ext%
+ - %tables.notification_types%
+ - %tables.notifications%
+ - %tables.user_notifications%
+ tags:
+ - { name: notification.type }
+
+ notification.type.group_request:
+ class: phpbb\notification\type\group_request
+ scope: prototype
+ arguments:
+ - @user_loader
+ - @dbal.conn
+ - @cache.driver
+ - @user
+ - @auth
+ - @config
+ - %core.root_path%
+ - %core.php_ext%
+ - %tables.notification_types%
+ - %tables.notifications%
+ - %tables.user_notifications%
+ tags:
+ - { name: notification.type }
+
+ notification.type.group_request_approved:
+ class: phpbb\notification\type\group_request_approved
+ scope: prototype
+ arguments:
+ - @user_loader
+ - @dbal.conn
+ - @cache.driver
+ - @user
+ - @auth
+ - @config
+ - %core.root_path%
+ - %core.php_ext%
+ - %tables.notification_types%
+ - %tables.notifications%
+ - %tables.user_notifications%
+ tags:
+ - { name: notification.type }
+
+ notification.type.pm:
+ class: phpbb\notification\type\pm
+ scope: prototype
+ arguments:
+ - @user_loader
+ - @dbal.conn
+ - @cache.driver
+ - @user
+ - @auth
+ - @config
+ - %core.root_path%
+ - %core.php_ext%
+ - %tables.notification_types%
+ - %tables.notifications%
+ - %tables.user_notifications%
+ tags:
+ - { name: notification.type }
+
+ notification.type.post:
+ class: phpbb\notification\type\post
+ scope: prototype
+ arguments:
+ - @user_loader
+ - @dbal.conn
+ - @cache.driver
+ - @user
+ - @auth
+ - @config
+ - %core.root_path%
+ - %core.php_ext%
+ - %tables.notification_types%
+ - %tables.notifications%
+ - %tables.user_notifications%
+ tags:
+ - { name: notification.type }
+
+ notification.type.post_in_queue:
+ class: phpbb\notification\type\post_in_queue
+ scope: prototype
+ arguments:
+ - @user_loader
+ - @dbal.conn
+ - @cache.driver
+ - @user
+ - @auth
+ - @config
+ - %core.root_path%
+ - %core.php_ext%
+ - %tables.notification_types%
+ - %tables.notifications%
+ - %tables.user_notifications%
+ tags:
+ - { name: notification.type }
+
+ notification.type.quote:
+ class: phpbb\notification\type\quote
+ scope: prototype
+ arguments:
+ - @user_loader
+ - @dbal.conn
+ - @cache.driver
+ - @user
+ - @auth
+ - @config
+ - %core.root_path%
+ - %core.php_ext%
+ - %tables.notification_types%
+ - %tables.notifications%
+ - %tables.user_notifications%
+ tags:
+ - { name: notification.type }
+
+ notification.type.report_pm:
+ class: phpbb\notification\type\report_pm
+ scope: prototype
+ arguments:
+ - @user_loader
+ - @dbal.conn
+ - @cache.driver
+ - @user
+ - @auth
+ - @config
+ - %core.root_path%
+ - %core.php_ext%
+ - %tables.notification_types%
+ - %tables.notifications%
+ - %tables.user_notifications%
+ tags:
+ - { name: notification.type }
+
+ notification.type.report_pm_closed:
+ class: phpbb\notification\type\report_pm_closed
+ scope: prototype
+ arguments:
+ - @user_loader
+ - @dbal.conn
+ - @cache.driver
+ - @user
+ - @auth
+ - @config
+ - %core.root_path%
+ - %core.php_ext%
+ - %tables.notification_types%
+ - %tables.notifications%
+ - %tables.user_notifications%
+ tags:
+ - { name: notification.type }
+
+ notification.type.report_post:
+ class: phpbb\notification\type\report_post
+ scope: prototype
+ arguments:
+ - @user_loader
+ - @dbal.conn
+ - @cache.driver
+ - @user
+ - @auth
+ - @config
+ - %core.root_path%
+ - %core.php_ext%
+ - %tables.notification_types%
+ - %tables.notifications%
+ - %tables.user_notifications%
+ tags:
+ - { name: notification.type }
+
+ notification.type.report_post_closed:
+ class: phpbb\notification\type\report_post_closed
+ scope: prototype
+ arguments:
+ - @user_loader
+ - @dbal.conn
+ - @cache.driver
+ - @user
+ - @auth
+ - @config
+ - %core.root_path%
+ - %core.php_ext%
+ - %tables.notification_types%
+ - %tables.notifications%
+ - %tables.user_notifications%
+ tags:
+ - { name: notification.type }
+
+ notification.type.topic:
+ class: phpbb\notification\type\topic
+ scope: prototype
+ arguments:
+ - @user_loader
+ - @dbal.conn
+ - @cache.driver
+ - @user
+ - @auth
+ - @config
+ - %core.root_path%
+ - %core.php_ext%
+ - %tables.notification_types%
+ - %tables.notifications%
+ - %tables.user_notifications%
+ tags:
+ - { name: notification.type }
+
+ notification.type.topic_in_queue:
+ class: phpbb\notification\type\topic_in_queue
+ scope: prototype
+ arguments:
+ - @user_loader
+ - @dbal.conn
+ - @cache.driver
+ - @user
+ - @auth
+ - @config
+ - %core.root_path%
+ - %core.php_ext%
+ - %tables.notification_types%
+ - %tables.notifications%
+ - %tables.user_notifications%
+ tags:
+ - { name: notification.type }
+
+ notification.type.admin_activate_user:
+ class: phpbb\notification\type\admin_activate_user
+ scope: prototype
+ arguments:
+ - @user_loader
+ - @dbal.conn
+ - @cache.driver
+ - @user
+ - @auth
+ - @config
+ - %core.root_path%
+ - %core.php_ext%
+ - %tables.notification_types%
+ - %tables.notifications%
+ - %tables.user_notifications%
+ tags:
+ - { name: notification.type }
+
+# ----- Notification's methods -----
+# Scope MUST be prototype for all the plugins to work.
+ notification.method_collection:
+ class: phpbb\di\service_collection
+ arguments:
+ - @service_container
+ tags:
+ - { name: service_collection, tag: notification.method }
+
+ notification.method.email:
+ class: phpbb\notification\method\email
+ scope: prototype
+ arguments:
+ - @user_loader
+ - @dbal.conn
+ - @cache.driver
+ - @user
+ - @auth
+ - @config
+ - %core.root_path%
+ - %core.php_ext%
+ tags:
+ - { name: notification.method }
+
+ notification.method.jabber:
+ class: phpbb\notification\method\jabber
+ scope: prototype
+ arguments:
+ - @user_loader
+ - @dbal.conn
+ - @cache.driver
+ - @user
+ - @auth
+ - @config
+ - %core.root_path%
+ - %core.php_ext%
+ tags:
+ - { name: notification.method }
diff --git a/phpBB/config/parameters.yml b/phpBB/config/parameters.yml
new file mode 100644
index 0000000000..8ecc1428f4
--- /dev/null
+++ b/phpBB/config/parameters.yml
@@ -0,0 +1,20 @@
+parameters:
+ # Disable the usage of the super globals (_GET, _POST, _SERVER...)
+ core.disable_super_globals: true
+
+ # Datetime class to use
+ datetime.class: \phpbb\datetime
+
+ # Mimetype guesser priorities
+ mimetype.guesser.priority.lowest: -2
+ mimetype.guesser.priority.low: -1
+ mimetype.guesser.priority.default: 0
+ mimetype.guesser.priority.high: 1
+ mimetype.guesser.priority.highest: 2
+
+ # List of default password driver types
+ passwords.algorithms:
+ - passwords.driver.bcrypt_2y
+ - passwords.driver.bcrypt
+ - passwords.driver.salted_md5
+ - passwords.driver.phpass
diff --git a/phpBB/config/password.yml b/phpBB/config/password.yml
new file mode 100644
index 0000000000..938cef7e16
--- /dev/null
+++ b/phpBB/config/password.yml
@@ -0,0 +1,131 @@
+services:
+# ----- Password management -----
+ passwords.manager:
+ class: phpbb\passwords\manager
+ arguments:
+ - @config
+ - @passwords.driver_collection
+ - @passwords.helper
+ - %passwords.algorithms%
+
+ passwords.helper:
+ class: phpbb\passwords\helper
+
+ passwords.driver_helper:
+ class: phpbb\passwords\driver\helper
+ arguments:
+ - @config
+
+# ----- Password's drivers -----
+ passwords.driver_collection:
+ class: phpbb\di\service_collection
+ arguments:
+ - @service_container
+ tags:
+ - { name: service_collection, tag: passwords.driver }
+
+ passwords.driver.bcrypt:
+ class: phpbb\passwords\driver\bcrypt
+ arguments:
+ - @config
+ - @passwords.driver_helper
+ tags:
+ - { name: passwords.driver }
+
+ passwords.driver.bcrypt_2y:
+ class: phpbb\passwords\driver\bcrypt_2y
+ arguments:
+ - @config
+ - @passwords.driver_helper
+ tags:
+ - { name: passwords.driver }
+
+ passwords.driver.bcrypt_wcf2:
+ class: phpbb\passwords\driver\bcrypt_wcf2
+ arguments:
+ - @passwords.driver.bcrypt
+ - @passwords.driver_helper
+ tags:
+ - { name: passwords.driver }
+
+ passwords.driver.salted_md5:
+ class: phpbb\passwords\driver\salted_md5
+ arguments:
+ - @config
+ - @passwords.driver_helper
+ tags:
+ - { name: passwords.driver }
+
+ passwords.driver.phpass:
+ class: phpbb\passwords\driver\phpass
+ arguments:
+ - @config
+ - @passwords.driver_helper
+ tags:
+ - { name: passwords.driver }
+
+ passwords.driver.convert_password:
+ class: phpbb\passwords\driver\convert_password
+ arguments:
+ - @config
+ - @passwords.driver_helper
+ tags:
+ - { name: passwords.driver }
+
+ passwords.driver.sha1_smf:
+ class: phpbb\passwords\driver\sha1_smf
+ arguments:
+ - @config
+ - @passwords.driver_helper
+ tags:
+ - { name: passwords.driver }
+
+ passwords.driver.sha1_wcf1:
+ class: phpbb\passwords\driver\sha1_wcf1
+ arguments:
+ - @config
+ - @passwords.driver_helper
+ tags:
+ - { name: passwords.driver }
+
+ passwords.driver.sha1:
+ class: phpbb\passwords\driver\sha1
+ arguments:
+ - @config
+ - @passwords.driver_helper
+ tags:
+ - { name: passwords.driver }
+
+ passwords.driver.md5_phpbb2:
+ class: phpbb\passwords\driver\md5_phpbb2
+ arguments:
+ - @request
+ - @passwords.driver.salted_md5
+ - @passwords.driver_helper
+ - %core.root_path%
+ - %core.php_ext%
+ tags:
+ - { name: passwords.driver }
+
+ passwords.driver.md5_mybb:
+ class: phpbb\passwords\driver\md5_mybb
+ arguments:
+ - @config
+ - @passwords.driver_helper
+ tags:
+ - { name: passwords.driver }
+
+ passwords.driver.md5_vb:
+ class: phpbb\passwords\driver\md5_vb
+ arguments:
+ - @config
+ - @passwords.driver_helper
+ tags:
+ - { name: passwords.driver }
+
+ passwords.update.lock:
+ class: phpbb\lock\db
+ arguments:
+ - update_hashes_lock
+ - '@config'
+ - '@dbal.conn'
diff --git a/phpBB/config/profilefield.yml b/phpBB/config/profilefield.yml
new file mode 100644
index 0000000000..5ccfef9148
--- /dev/null
+++ b/phpBB/config/profilefield.yml
@@ -0,0 +1,102 @@
+services:
+ profilefields.manager:
+ class: phpbb\profilefields\manager
+ arguments:
+ - @auth
+ - @dbal.conn
+ - @dispatcher
+ - @request
+ - @template
+ - @profilefields.type_collection
+ - @user
+ - %tables.profile_fields%
+ - %tables.profile_fields_language%
+ - %tables.profile_fields_data%
+
+ profilefields.lang_helper:
+ class: phpbb\profilefields\lang_helper
+ arguments:
+ - @dbal.conn
+ - %tables.profile_fields_options_language%
+
+# ----- Profile fields types -----
+ profilefields.type_collection:
+ class: phpbb\di\service_collection
+ arguments:
+ - @service_container
+ tags:
+ - { name: service_collection, tag: profilefield.type }
+
+ profilefields.type.bool:
+ class: phpbb\profilefields\type\type_bool
+ arguments:
+ - @profilefields.lang_helper
+ - @request
+ - @template
+ - @user
+ tags:
+ - { name: profilefield.type }
+
+ profilefields.type.date:
+ class: phpbb\profilefields\type\type_date
+ arguments:
+ - @request
+ - @template
+ - @user
+ tags:
+ - { name: profilefield.type }
+
+ profilefields.type.dropdown:
+ class: phpbb\profilefields\type\type_dropdown
+ arguments:
+ - @profilefields.lang_helper
+ - @request
+ - @template
+ - @user
+ tags:
+ - { name: profilefield.type }
+
+ profilefields.type.googleplus:
+ class: phpbb\profilefields\type\type_googleplus
+ arguments:
+ - @request
+ - @template
+ - @user
+ tags:
+ - { name: profilefield.type }
+
+ profilefields.type.int:
+ class: phpbb\profilefields\type\type_int
+ arguments:
+ - @request
+ - @template
+ - @user
+ tags:
+ - { name: profilefield.type }
+
+ profilefields.type.string:
+ class: phpbb\profilefields\type\type_string
+ arguments:
+ - @request
+ - @template
+ - @user
+ tags:
+ - { name: profilefield.type }
+
+ profilefields.type.text:
+ class: phpbb\profilefields\type\type_text
+ arguments:
+ - @request
+ - @template
+ - @user
+ tags:
+ - { name: profilefield.type }
+
+ profilefields.type.url:
+ class: phpbb\profilefields\type\type_url
+ arguments:
+ - @request
+ - @template
+ - @user
+ tags:
+ - { name: profilefield.type }
diff --git a/phpBB/config/routing.yml b/phpBB/config/routing.yml
new file mode 100644
index 0000000000..94146e1ec2
--- /dev/null
+++ b/phpBB/config/routing.yml
@@ -0,0 +1,9 @@
+# Structure:
+#
+# foo_controller:
+# path: /foo
+# defaults: { _controller: foo_sevice:method }
+#
+# The above will be accessed via app.php?controller=foo and it will
+# instantiate the "foo_service" service and call the "method" method.
+#
diff --git a/phpBB/config/services.yml b/phpBB/config/services.yml
new file mode 100644
index 0000000000..8667cbbf84
--- /dev/null
+++ b/phpBB/config/services.yml
@@ -0,0 +1,188 @@
+imports:
+ - { resource: auth.yml }
+ - { resource: avatar.yml }
+ - { resource: captcha.yml }
+ - { resource: console.yml }
+ - { resource: content.yml }
+ - { resource: cron.yml }
+ - { resource: db.yml }
+ - { resource: event.yml }
+ - { resource: feed.yml }
+ - { resource: mimetype_guesser.yml }
+ - { resource: notification.yml }
+ - { resource: password.yml }
+ - { resource: profilefield.yml }
+ - { resource: user.yml }
+
+ - { resource: tables.yml }
+ - { resource: parameters.yml }
+
+services:
+ cache:
+ class: phpbb\cache\service
+ arguments:
+ - @cache.driver
+ - @config
+ - @dbal.conn
+ - %core.root_path%
+ - %core.php_ext%
+
+ cache.driver:
+ class: %cache.driver.class%
+
+ class_loader:
+ class: phpbb\class_loader
+ arguments:
+ - phpbb\
+ - %core.root_path%includes/
+ - %core.php_ext%
+ calls:
+ - [register, []]
+ - [set_cache, [@cache.driver]]
+
+ class_loader.ext:
+ class: phpbb\class_loader
+ arguments:
+ - \
+ - %core.root_path%ext/
+ - %core.php_ext%
+ calls:
+ - [register, []]
+ - [set_cache, [@cache.driver]]
+
+ config:
+ class: phpbb\config\db
+ arguments:
+ - @dbal.conn
+ - @cache.driver
+ - %tables.config%
+
+ config.php:
+ synthetic: true
+
+ config_text:
+ class: phpbb\config\db_text
+ arguments:
+ - @dbal.conn
+ - %tables.config_text%
+
+ controller.helper:
+ class: phpbb\controller\helper
+ arguments:
+ - @template
+ - @user
+ - @config
+ - @controller.provider
+ - @ext.manager
+ - @symfony_request
+ - @request
+ - @filesystem
+ - %core.root_path%
+ - %core.php_ext%
+
+ controller.resolver:
+ class: phpbb\controller\resolver
+ arguments:
+ - @user
+ - @service_container
+ - %core.root_path%
+ - @template
+
+ controller.provider:
+ class: phpbb\controller\provider
+ calls:
+ - [find, [%core.root_path%]]
+
+ ext.manager:
+ class: phpbb\extension\manager
+ arguments:
+ - @service_container
+ - @dbal.conn
+ - @config
+ - @filesystem
+ - @user
+ - %tables.ext%
+ - %core.root_path%
+ - %core.php_ext%
+ - @cache.driver
+
+ filesystem:
+ class: phpbb\filesystem
+
+ file_downloader:
+ class: phpbb\file_downloader
+
+ http_kernel:
+ class: Symfony\Component\HttpKernel\HttpKernel
+ arguments:
+ - @dispatcher
+ - @controller.resolver
+
+ log:
+ class: phpbb\log\log
+ arguments:
+ - @dbal.conn
+ - @user
+ - @auth
+ - @dispatcher
+ - %core.root_path%
+ - %core.adm_relative_path%
+ - %core.php_ext%
+ - %tables.log%
+
+ path_helper:
+ class: phpbb\path_helper
+ arguments:
+ - @symfony_request
+ - @filesystem
+ - @request
+ - %core.root_path%
+ - %core.php_ext%
+ - %core.adm_relative_path%
+
+ php_ini:
+ class: phpbb\php\ini
+
+ plupload:
+ class: phpbb\plupload\plupload
+ arguments:
+ - %core.root_path%
+ - @config
+ - @request
+ - @user
+ - @php_ini
+ - @mimetype.guesser
+
+ request:
+ class: phpbb\request\request
+ arguments:
+ - null
+ - %core.disable_super_globals%
+
+ # WARNING: The Symfony request does not escape the input and should be used very carefully
+ # prefer the phpbb request (service @request) as possible
+ symfony_request:
+ class: phpbb\symfony_request
+ arguments:
+ - @request
+
+ template:
+ class: phpbb\template\twig\twig
+ arguments:
+ - @path_helper
+ - @config
+ - @user
+ - @template_context
+ - @ext.manager
+
+ template_context:
+ class: phpbb\template\context
+
+ version_helper:
+ class: phpbb\version_helper
+ scope: prototype
+ arguments:
+ - @cache
+ - @config
+ - @file_downloader
+ - @user
diff --git a/phpBB/config/tables.yml b/phpBB/config/tables.yml
new file mode 100644
index 0000000000..2fe2a33be8
--- /dev/null
+++ b/phpBB/config/tables.yml
@@ -0,0 +1,23 @@
+parameters:
+ tables.auth_provider_oauth_token_storage: %core.table_prefix%oauth_tokens
+ tables.auth_provider_oauth_account_assoc: %core.table_prefix%oauth_accounts
+ tables.captcha_qa_questions: %core.table_prefix%captcha_questions
+ tables.captcha_qa_answers: %core.table_prefix%captcha_answers
+ tables.captcha_qa_confirm: %core.table_prefix%qa_confirm
+ tables.config: %core.table_prefix%config
+ tables.config_text: %core.table_prefix%config_text
+ tables.ext: %core.table_prefix%ext
+ tables.forums: %core.table_prefix%forums
+ tables.log: %core.table_prefix%log
+ tables.migrations: %core.table_prefix%migrations
+ tables.modules: %core.table_prefix%modules
+ tables.notification_types: %core.table_prefix%notification_types
+ tables.notifications: %core.table_prefix%notifications
+ tables.profile_fields: %core.table_prefix%profile_fields
+ tables.profile_fields_data: %core.table_prefix%profile_fields_data
+ tables.profile_fields_options_language: %core.table_prefix%profile_fields_lang
+ tables.profile_fields_language: %core.table_prefix%profile_lang
+ tables.posts: %core.table_prefix%posts
+ tables.topics: %core.table_prefix%topics
+ tables.user_notifications: %core.table_prefix%user_notifications
+ tables.users: %core.table_prefix%users
diff --git a/phpBB/config/user.yml b/phpBB/config/user.yml
new file mode 100644
index 0000000000..1ca853ea45
--- /dev/null
+++ b/phpBB/config/user.yml
@@ -0,0 +1,19 @@
+services:
+ acl.permissions:
+ class: phpbb\permissions
+ arguments:
+ - @dispatcher
+ - @user
+
+ user:
+ class: phpbb\user
+ arguments:
+ - %datetime.class%
+
+ user_loader:
+ class: phpbb\user_loader
+ arguments:
+ - @dbal.conn
+ - %core.root_path%
+ - %core.php_ext%
+ - %tables.users%
diff --git a/phpBB/cron.php b/phpBB/cron.php
index 8000066c92..aed68f6aeb 100644
--- a/phpBB/cron.php
+++ b/phpBB/cron.php
@@ -1,10 +1,13 @@
<?php
/**
*
-* @package phpBB3
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -20,196 +23,60 @@ include($phpbb_root_path . 'common.' . $phpEx);
$user->session_begin(false);
$auth->acl($user->data);
-$cron_type = request_var('cron_type', '');
-
-// Output transparent gif
-header('Cache-Control: no-cache');
-header('Content-type: image/gif');
-header('Content-length: 43');
-
-echo base64_decode('R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==');
-
-// Flush here to prevent browser from showing the page as loading while running cron.
-flush();
-
-if (!isset($config['cron_lock']))
+function output_image()
{
- set_config('cron_lock', '0', true);
-}
+ // Output transparent gif
+ header('Cache-Control: no-cache');
+ header('Content-type: image/gif');
+ header('Content-length: 43');
-// make sure cron doesn't run multiple times in parallel
-if ($config['cron_lock'])
-{
- // if the other process is running more than an hour already we have to assume it
- // aborted without cleaning the lock
- $time = explode(' ', $config['cron_lock']);
- $time = $time[0];
+ echo base64_decode('R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==');
- if ($time + 3600 >= time())
- {
- exit;
- }
+ // Flush here to prevent browser from showing the page as loading while
+ // running cron.
+ flush();
}
-define('CRON_ID', time() . ' ' . unique_id());
+// Thanks to various fatal errors and lack of try/finally, it is quite easy to leave
+// the cron lock locked, especially when working on cron-related code.
+//
+// Attempt to alleviate the problem by doing setup outside of the lock as much as possible.
-$sql = 'UPDATE ' . CONFIG_TABLE . "
- SET config_value = '" . $db->sql_escape(CRON_ID) . "'
- WHERE config_name = 'cron_lock' AND config_value = '" . $db->sql_escape($config['cron_lock']) . "'";
-$db->sql_query($sql);
+$cron_type = request_var('cron_type', '');
-// another cron process altered the table between script start and UPDATE query so exit
-if ($db->sql_affectedrows() != 1)
-{
- exit;
-}
+// Comment this line out for debugging so the page does not return an image.
+output_image();
-/**
-* Run cron-like action
-* Real cron-based layer will be introduced in 3.2
-*/
-switch ($cron_type)
+$cron_lock = $phpbb_container->get('cron.lock_db');
+if ($cron_lock->acquire())
{
- case 'queue':
-
- if (time() - $config['queue_interval'] <= $config['last_queue_run'] || !file_exists($phpbb_root_path . 'cache/queue.' . $phpEx))
- {
- break;
- }
-
- include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);
- $queue = new queue();
-
- $queue->process();
-
- break;
-
- case 'tidy_cache':
-
- if (time() - $config['cache_gc'] <= $config['cache_last_gc'] || !method_exists($cache, 'tidy'))
- {
- break;
- }
-
- $cache->tidy();
-
- break;
-
- case 'tidy_search':
-
- // Select the search method
- $search_type = basename($config['search_type']);
-
- if (time() - $config['search_gc'] <= $config['search_last_gc'] || !file_exists($phpbb_root_path . 'includes/search/' . $search_type . '.' . $phpEx))
- {
- break;
- }
-
- include_once("{$phpbb_root_path}includes/search/$search_type.$phpEx");
-
- // We do some additional checks in the module to ensure it can actually be utilised
- $error = false;
- $search = new $search_type($error);
-
- if ($error)
- {
- break;
- }
-
- $search->tidy();
-
- break;
+ $cron = $phpbb_container->get('cron.manager');
- case 'tidy_warnings':
-
- if (time() - $config['warnings_gc'] <= $config['warnings_last_gc'])
- {
- break;
- }
-
- include_once($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
-
- tidy_warnings();
-
- break;
-
- case 'tidy_database':
-
- if (time() - $config['database_gc'] <= $config['database_last_gc'])
- {
- break;
- }
-
- include_once($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
-
- tidy_database();
-
- break;
-
- case 'tidy_sessions':
-
- if (time() - $config['session_gc'] <= $config['session_last_gc'])
- {
- break;
- }
-
- $user->session_gc();
-
- break;
-
- case 'prune_forum':
-
- $forum_id = request_var('f', 0);
-
- $sql = 'SELECT forum_id, prune_next, enable_prune, prune_days, prune_viewed, forum_flags, prune_freq
- FROM ' . FORUMS_TABLE . "
- WHERE forum_id = $forum_id";
- $result = $db->sql_query($sql);
- $row = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
-
- if (!$row)
+ $task = $cron->find_task($cron_type);
+ if ($task)
+ {
+ /**
+ * This event enables you to catch the task before it runs
+ *
+ * @event core.cron_run_before
+ * @var \phpbb\cron\task\wrapper task Current Cron task
+ * @since 3.1.8-RC1
+ */
+ $vars = array(
+ 'task',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.cron_run_before', compact($vars)));
+
+ if ($task->is_parametrized())
{
- break;
+ $task->parse_parameters($request);
}
-
- // Do the forum Prune thang
- if ($row['prune_next'] < time() && $row['enable_prune'])
+ if ($task->is_ready())
{
- include_once($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
-
- if ($row['prune_days'])
- {
- auto_prune($row['forum_id'], 'posted', $row['forum_flags'], $row['prune_days'], $row['prune_freq']);
- }
-
- if ($row['prune_viewed'])
- {
- auto_prune($row['forum_id'], 'viewed', $row['forum_flags'], $row['prune_viewed'], $row['prune_freq']);
- }
+ $task->run();
}
-
- break;
+ }
+ $cron_lock->release();
}
-// Unloading cache and closing db after having done the dirty work.
-unlock_cron();
garbage_collection();
-
-exit;
-
-
-/**
-* Unlock cron script
-*/
-function unlock_cron()
-{
- global $db;
-
- $sql = 'UPDATE ' . CONFIG_TABLE . "
- SET config_value = '0'
- WHERE config_name = 'cron_lock' AND config_value = '" . $db->sql_escape(CRON_ID) . "'";
- $db->sql_query($sql);
-}
-
-?> \ No newline at end of file
diff --git a/phpBB/develop/add_permissions.php b/phpBB/develop/add_permissions.php
index 6f26bf6ac6..a5279f8f13 100644
--- a/phpBB/develop/add_permissions.php
+++ b/phpBB/develop/add_permissions.php
@@ -1,9 +1,13 @@
<?php
/**
*
-* @package phpBB3
-* @copyright (c) 2004 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -194,9 +198,9 @@ $prefixes = array('f_', 'a_', 'm_', 'u_');
foreach ($prefixes as $prefix)
{
$var = $prefix . 'permissions';
- if (sizeof($$var))
+ if (sizeof(${$var}))
{
- foreach ($$var as $auth_option => $l_ary)
+ foreach (${$var} as $auth_option => $l_ary)
{
$sql_ary = array(
'auth_option' => $auth_option,
@@ -367,7 +371,7 @@ function mass_auth($ug_type, $forum_id, $ug_id, $acl_list, $setting)
switch ($sql_type)
{
case 'insert':
- switch ($db->sql_layer)
+ switch ($db->get_sql_layer())
{
case 'mysql':
case 'mysql4':
@@ -376,6 +380,7 @@ function mass_auth($ug_type, $forum_id, $ug_id, $acl_list, $setting)
case 'mssql':
case 'sqlite':
+ case 'sqlite3':
$sql = implode(' UNION ALL ', preg_replace('#^(.*?)$#', 'SELECT \1', $sql_subary));
break;
@@ -409,5 +414,3 @@ function mass_auth($ug_type, $forum_id, $ug_id, $acl_list, $setting)
unset($sql_ary);
}
-
-?> \ No newline at end of file
diff --git a/phpBB/develop/adjust_avatars.php b/phpBB/develop/adjust_avatars.php
index 81599e694b..dc4ae88f37 100644
--- a/phpBB/develop/adjust_avatars.php
+++ b/phpBB/develop/adjust_avatars.php
@@ -143,5 +143,3 @@ function adjust_avatar($old_name, $midfix)
}
return false;
}
-
-?> \ No newline at end of file
diff --git a/phpBB/develop/adjust_bbcodes.php b/phpBB/develop/adjust_bbcodes.php
index f06f0112ab..5a7f065d7f 100644
--- a/phpBB/develop/adjust_bbcodes.php
+++ b/phpBB/develop/adjust_bbcodes.php
@@ -170,5 +170,3 @@ $db->sql_freeresult($result);
// Done
$db->sql_close();
-
-?> \ No newline at end of file
diff --git a/phpBB/develop/adjust_magic_urls.php b/phpBB/develop/adjust_magic_urls.php
index 1430a47a12..c417c755cf 100644
--- a/phpBB/develop/adjust_magic_urls.php
+++ b/phpBB/develop/adjust_magic_urls.php
@@ -122,5 +122,3 @@ $db->sql_freeresult($result);
// Done
$db->sql_close();
-
-?> \ No newline at end of file
diff --git a/phpBB/develop/adjust_sizes.php b/phpBB/develop/adjust_sizes.php
index 7d72813056..9b58389163 100644
--- a/phpBB/develop/adjust_sizes.php
+++ b/phpBB/develop/adjust_sizes.php
@@ -128,5 +128,3 @@ $db->sql_freeresult($result);
// Done
$db->sql_close();
-
-?> \ No newline at end of file
diff --git a/phpBB/develop/adjust_smilies.php b/phpBB/develop/adjust_smilies.php
index 774c8834f6..ecc3461670 100644
--- a/phpBB/develop/adjust_smilies.php
+++ b/phpBB/develop/adjust_smilies.php
@@ -126,5 +126,3 @@ $db->sql_freeresult($result);
// Done
$db->sql_close();
-
-?> \ No newline at end of file
diff --git a/phpBB/develop/adjust_uids.php b/phpBB/develop/adjust_uids.php
index d301f3cadb..3468475b8f 100644
--- a/phpBB/develop/adjust_uids.php
+++ b/phpBB/develop/adjust_uids.php
@@ -126,4 +126,3 @@ $db->sql_freeresult($result);
// Done
$db->sql_close();
echo 'done';
-?> \ No newline at end of file
diff --git a/phpBB/develop/adjust_usernames.php b/phpBB/develop/adjust_usernames.php
index 1afa77af16..111a9a30d7 100644
--- a/phpBB/develop/adjust_usernames.php
+++ b/phpBB/develop/adjust_usernames.php
@@ -48,5 +48,3 @@ echo 'FINISHED';
// Done
$db->sql_close();
-
-?> \ No newline at end of file
diff --git a/phpBB/develop/benchmark.php b/phpBB/develop/benchmark.php
index 5bbe6f53be..c3cf90773e 100644
--- a/phpBB/develop/benchmark.php
+++ b/phpBB/develop/benchmark.php
@@ -192,13 +192,13 @@ function get_topic_count($forum_id)
{
global $db;
- $sql = "SELECT forum_topics
+ $sql = "SELECT forum_topics_approved
FROM " . FORUMS_TABLE . "
WHERE (forum_id = $forum_id)";
if($result = $db->sql_query($sql))
{
$row = $db->sql_fetchrow($result);
- $topic_count = $row['forum_topics'];
+ $topic_count = $row['forum_topics_approved'];
unset($result);
unset($row);
@@ -263,7 +263,7 @@ function make_post($new_topic_id, $forum_id, $user_id, $post_username, $text, $m
$post_message = prepare_message($text, $html_on, $bbcode_on, $smilies_on, $bbcode_uid);
- $sql = "INSERT INTO " . POSTS_TABLE . " (topic_id, forum_id, poster_id, attach_id, icon_id, post_username, post_time, poster_ip, post_approved, bbcode_uid, enable_bbcode, enable_html, enable_smilies, enable_sig, post_subject, post_text)
+ $sql = "INSERT INTO " . POSTS_TABLE . " (topic_id, forum_id, poster_id, attach_id, icon_id, post_username, post_time, poster_ip, post_visibility, bbcode_uid, enable_bbcode, enable_html, enable_smilies, enable_sig, post_subject, post_text)
VALUES ($new_topic_id, $forum_id, $user_id, 0, 0, '$post_username', $current_time, '$user_ip', 1, '$bbcode_uid', $bbcode_on, $html_on, $smilies_on, $attach_sig, '$post_subject', '$post_message')";
$result = $db->sql_query($sql);
@@ -282,10 +282,10 @@ function make_post($new_topic_id, $forum_id, $user_id, $post_username, $text, $m
if($db->sql_query($sql))
{
$sql = "UPDATE " . FORUMS_TABLE . "
- SET forum_last_post_id = $new_post_id, forum_posts = forum_posts + 1";
+ SET forum_last_post_id = $new_post_id, forum_posts_approved = forum_posts_approved + 1";
if($mode == "newtopic")
{
- $sql .= ", forum_topics = forum_topics + 1";
+ $sql .= ", forum_topics_approved = forum_topics_approved + 1";
}
$sql .= " WHERE forum_id = $forum_id";
@@ -313,7 +313,7 @@ function make_post($new_topic_id, $forum_id, $user_id, $post_username, $text, $m
else
{
// Rollback
- if($db->sql_layer == "mysql")
+ if($db->get_sql_layer() == "mysql")
{
$sql = "DELETE FROM " . POSTS_TABLE . "
WHERE post_id = $new_post_id";
@@ -366,18 +366,10 @@ function make_user($username)
$password = md5("benchpass");
$email = "nobody@localhost";
- $icq = "12345678";
- $website = "http://www.phpbb.com";
- $occupation = "phpBB tester";
- $location = "phpBB world hq";
- $interests = "Eating, sleeping, living, and breathing phpBB";
$signature = "$username: phpBB tester.";
$signature_bbcode_uid = "";
$avatar_filename = "";
$viewemail = 0;
- $aim = 0;
- $yim = 0;
- $msn = 0;
$attachsig = 1;
$allowsmilies = 1;
$allowhtml = 1;
@@ -422,8 +414,8 @@ function make_user($username)
}
- $sql = "INSERT INTO " . USERS_TABLE . " (user_id, username, user_regdate, user_password, user_email, user_icq, user_website, user_occ, user_from, user_interests, user_sig, user_sig_bbcode_uid, user_avatar, user_viewemail, user_aim, user_yim, user_msnm, user_attachsig, user_allowsmilies, user_allowhtml, user_allowbbcode, user_allow_viewonline, user_notify, user_notify_pm, user_timezone, user_dateformat, user_lang, user_style, user_level, user_allow_pm, user_active, user_actkey)
- VALUES ($new_user_id, '$username', " . time() . ", '$password', '$email', '$icq', '$website', '$occupation', '$location', '$interests', '$signature', '$signature_bbcode_uid', '$avatar_filename', $viewemail, '$aim', '$yim', '$msn', $attachsig, $allowsmilies, $allowhtml, $allowbbcode, $allowviewonline, $notifyreply, $notifypm, $user_timezone, '$user_dateformat', '$user_lang', $user_style, 0, 1, ";
+ $sql = "INSERT INTO " . USERS_TABLE . " (user_id, username, user_regdate, user_password, user_email, user_sig, user_sig_bbcode_uid, user_avatar, user_viewemail, user_attachsig, user_allowsmilies, user_allowhtml, user_allowbbcode, user_allow_viewonline, user_notify, user_notify_pm, user_timezone, user_dateformat, user_lang, user_style, user_level, user_allow_pm, user_active, user_actkey)
+ VALUES ($new_user_id, '$username', " . time() . ", '$password', '$email', '$signature', '$signature_bbcode_uid', '$avatar_filename', $viewemail, $attachsig, $allowsmilies, $allowhtml, $allowbbcode, $allowviewonline, $notifyreply, $notifypm, $user_timezone, '$user_dateformat', '$user_lang', $user_style, 0, 1, ";
$sql .= "1, '')";
@@ -458,5 +450,3 @@ function make_user($username)
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/language/en/mods/index.htm b/phpBB/develop/blank.gif
index e69de29bb2..e69de29bb2 100644
--- a/phpBB/language/en/mods/index.htm
+++ b/phpBB/develop/blank.gif
diff --git a/phpBB/styles/prosilver/imageset/de/index.htm b/phpBB/develop/blank.jpg
index e69de29bb2..e69de29bb2 100644
--- a/phpBB/styles/prosilver/imageset/de/index.htm
+++ b/phpBB/develop/blank.jpg
diff --git a/phpBB/develop/calc_email_hash.php b/phpBB/develop/calc_email_hash.php
index fccdfdfca9..740f9158cf 100644
--- a/phpBB/develop/calc_email_hash.php
+++ b/phpBB/develop/calc_email_hash.php
@@ -1,9 +1,13 @@
<?php
/**
*
-* @package phpBB3
-* @copyright (c) 2004 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -68,5 +72,3 @@ do
while ($start);
echo "<p><b>Done</b></p>\n";
-
-?> \ No newline at end of file
diff --git a/phpBB/develop/change_smiley_ref.php b/phpBB/develop/change_smiley_ref.php
index 59ee77b7b1..a2315bc382 100644
--- a/phpBB/develop/change_smiley_ref.php
+++ b/phpBB/develop/change_smiley_ref.php
@@ -1,9 +1,13 @@
<?php
/**
*
-* @package phpBB3
-* @copyright (c) 2003 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -46,5 +50,3 @@ while ($row = $db->sql_fetchrow($result))
$db->sql_freeresult($result);
echo "<p><b>Done</b></p>\n";
-
-?> \ No newline at end of file
diff --git a/phpBB/develop/check_flash_bbcodes.php b/phpBB/develop/check_flash_bbcodes.php
index 5946f685b8..6e1b415bb6 100644
--- a/phpBB/develop/check_flash_bbcodes.php
+++ b/phpBB/develop/check_flash_bbcodes.php
@@ -1,14 +1,20 @@
<?php
/**
*
-* @package phpBB3
-* @copyright (c) 2009, 2010 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
*
-* This script will check your database for potentially dangerous flash BBCode tags
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
+/**
+* This script will check your database for potentially dangerous flash BBCode tags
+*/
+
//
// Security message:
//
diff --git a/phpBB/develop/create_schema_files.php b/phpBB/develop/create_schema_files.php
index b5f1202c0d..60ffe04330 100644
--- a/phpBB/develop/create_schema_files.php
+++ b/phpBB/develop/create_schema_files.php
@@ -1,10 +1,17 @@
<?php
/**
*
-* @package phpBB3
-* @copyright (c) 2006 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+/**
* This file creates new schema files for every database.
* The filenames will be prefixed with an underscore to not overwrite the current schema files.
*
@@ -12,2090 +19,41 @@
*/
$schema_path = dirname(__FILE__) . '/../install/schemas/';
+$supported_dbms = array(
+ 'mssql',
+ 'mysql_40',
+ 'mysql_41',
+ 'oracle',
+ 'postgres',
+ 'sqlite',
+);
+$table_prefix = 'phpbb_';
if (!is_writable($schema_path))
{
die('Schema path not writable');
}
-$schema_data = get_schema_struct();
-$dbms_type_map = array(
- 'mysql_41' => array(
- 'INT:' => 'int(%d)',
- 'BINT' => 'bigint(20)',
- 'UINT' => 'mediumint(8) UNSIGNED',
- 'UINT:' => 'int(%d) UNSIGNED',
- 'TINT:' => 'tinyint(%d)',
- 'USINT' => 'smallint(4) UNSIGNED',
- 'BOOL' => 'tinyint(1) UNSIGNED',
- 'VCHAR' => 'varchar(255)',
- 'VCHAR:' => 'varchar(%d)',
- 'CHAR:' => 'char(%d)',
- 'XSTEXT' => 'text',
- 'XSTEXT_UNI'=> 'varchar(100)',
- 'STEXT' => 'text',
- 'STEXT_UNI' => 'varchar(255)',
- 'TEXT' => 'text',
- 'TEXT_UNI' => 'text',
- 'MTEXT' => 'mediumtext',
- 'MTEXT_UNI' => 'mediumtext',
- 'TIMESTAMP' => 'int(11) UNSIGNED',
- 'DECIMAL' => 'decimal(5,2)',
- 'DECIMAL:' => 'decimal(%d,2)',
- 'PDECIMAL' => 'decimal(6,3)',
- 'PDECIMAL:' => 'decimal(%d,3)',
- 'VCHAR_UNI' => 'varchar(255)',
- 'VCHAR_UNI:'=> 'varchar(%d)',
- 'VCHAR_CI' => 'varchar(255)',
- 'VARBINARY' => 'varbinary(255)',
- ),
-
- 'mysql_40' => array(
- 'INT:' => 'int(%d)',
- 'BINT' => 'bigint(20)',
- 'UINT' => 'mediumint(8) UNSIGNED',
- 'UINT:' => 'int(%d) UNSIGNED',
- 'TINT:' => 'tinyint(%d)',
- 'USINT' => 'smallint(4) UNSIGNED',
- 'BOOL' => 'tinyint(1) UNSIGNED',
- 'VCHAR' => 'varbinary(255)',
- 'VCHAR:' => 'varbinary(%d)',
- 'CHAR:' => 'binary(%d)',
- 'XSTEXT' => 'blob',
- 'XSTEXT_UNI'=> 'blob',
- 'STEXT' => 'blob',
- 'STEXT_UNI' => 'blob',
- 'TEXT' => 'blob',
- 'TEXT_UNI' => 'blob',
- 'MTEXT' => 'mediumblob',
- 'MTEXT_UNI' => 'mediumblob',
- 'TIMESTAMP' => 'int(11) UNSIGNED',
- 'DECIMAL' => 'decimal(5,2)',
- 'DECIMAL:' => 'decimal(%d,2)',
- 'PDECIMAL' => 'decimal(6,3)',
- 'PDECIMAL:' => 'decimal(%d,3)',
- 'VCHAR_UNI' => 'blob',
- 'VCHAR_UNI:'=> array('varbinary(%d)', 'limit' => array('mult', 3, 255, 'blob')),
- 'VCHAR_CI' => 'blob',
- 'VARBINARY' => 'varbinary(255)',
- ),
-
- 'firebird' => array(
- 'INT:' => 'INTEGER',
- 'BINT' => 'DOUBLE PRECISION',
- 'UINT' => 'INTEGER',
- 'UINT:' => 'INTEGER',
- 'TINT:' => 'INTEGER',
- 'USINT' => 'INTEGER',
- 'BOOL' => 'INTEGER',
- 'VCHAR' => 'VARCHAR(255) CHARACTER SET NONE',
- 'VCHAR:' => 'VARCHAR(%d) CHARACTER SET NONE',
- 'CHAR:' => 'CHAR(%d) CHARACTER SET NONE',
- 'XSTEXT' => 'BLOB SUB_TYPE TEXT CHARACTER SET NONE',
- 'STEXT' => 'BLOB SUB_TYPE TEXT CHARACTER SET NONE',
- 'TEXT' => 'BLOB SUB_TYPE TEXT CHARACTER SET NONE',
- 'MTEXT' => 'BLOB SUB_TYPE TEXT CHARACTER SET NONE',
- 'XSTEXT_UNI'=> 'VARCHAR(100) CHARACTER SET UTF8',
- 'STEXT_UNI' => 'VARCHAR(255) CHARACTER SET UTF8',
- 'TEXT_UNI' => 'BLOB SUB_TYPE TEXT CHARACTER SET UTF8',
- 'MTEXT_UNI' => 'BLOB SUB_TYPE TEXT CHARACTER SET UTF8',
- 'TIMESTAMP' => 'INTEGER',
- 'DECIMAL' => 'DOUBLE PRECISION',
- 'DECIMAL:' => 'DOUBLE PRECISION',
- 'PDECIMAL' => 'DOUBLE PRECISION',
- 'PDECIMAL:' => 'DOUBLE PRECISION',
- 'VCHAR_UNI' => 'VARCHAR(255) CHARACTER SET UTF8',
- 'VCHAR_UNI:'=> 'VARCHAR(%d) CHARACTER SET UTF8',
- 'VCHAR_CI' => 'VARCHAR(255) CHARACTER SET UTF8',
- 'VARBINARY' => 'CHAR(255) CHARACTER SET NONE',
- ),
-
- 'mssql' => array(
- 'INT:' => '[int]',
- 'BINT' => '[float]',
- 'UINT' => '[int]',
- 'UINT:' => '[int]',
- 'TINT:' => '[int]',
- 'USINT' => '[int]',
- 'BOOL' => '[int]',
- 'VCHAR' => '[varchar] (255)',
- 'VCHAR:' => '[varchar] (%d)',
- 'CHAR:' => '[char] (%d)',
- 'XSTEXT' => '[varchar] (1000)',
- 'STEXT' => '[varchar] (3000)',
- 'TEXT' => '[varchar] (8000)',
- 'MTEXT' => '[text]',
- 'XSTEXT_UNI'=> '[varchar] (100)',
- 'STEXT_UNI' => '[varchar] (255)',
- 'TEXT_UNI' => '[varchar] (4000)',
- 'MTEXT_UNI' => '[text]',
- 'TIMESTAMP' => '[int]',
- 'DECIMAL' => '[float]',
- 'DECIMAL:' => '[float]',
- 'PDECIMAL' => '[float]',
- 'PDECIMAL:' => '[float]',
- 'VCHAR_UNI' => '[varchar] (255)',
- 'VCHAR_UNI:'=> '[varchar] (%d)',
- 'VCHAR_CI' => '[varchar] (255)',
- 'VARBINARY' => '[varchar] (255)',
- ),
-
- 'oracle' => array(
- 'INT:' => 'number(%d)',
- 'BINT' => 'number(20)',
- 'UINT' => 'number(8)',
- 'UINT:' => 'number(%d)',
- 'TINT:' => 'number(%d)',
- 'USINT' => 'number(4)',
- 'BOOL' => 'number(1)',
- 'VCHAR' => 'varchar2(255)',
- 'VCHAR:' => 'varchar2(%d)',
- 'CHAR:' => 'char(%d)',
- 'XSTEXT' => 'varchar2(1000)',
- 'STEXT' => 'varchar2(3000)',
- 'TEXT' => 'clob',
- 'MTEXT' => 'clob',
- 'XSTEXT_UNI'=> 'varchar2(300)',
- 'STEXT_UNI' => 'varchar2(765)',
- 'TEXT_UNI' => 'clob',
- 'MTEXT_UNI' => 'clob',
- 'TIMESTAMP' => 'number(11)',
- 'DECIMAL' => 'number(5, 2)',
- 'DECIMAL:' => 'number(%d, 2)',
- 'PDECIMAL' => 'number(6, 3)',
- 'PDECIMAL:' => 'number(%d, 3)',
- 'VCHAR_UNI' => 'varchar2(765)',
- 'VCHAR_UNI:'=> array('varchar2(%d)', 'limit' => array('mult', 3, 765, 'clob')),
- 'VCHAR_CI' => 'varchar2(255)',
- 'VARBINARY' => 'raw(255)',
- ),
-
- 'sqlite' => array(
- 'INT:' => 'int(%d)',
- 'BINT' => 'bigint(20)',
- 'UINT' => 'INTEGER UNSIGNED', //'mediumint(8) UNSIGNED',
- 'UINT:' => 'INTEGER UNSIGNED', // 'int(%d) UNSIGNED',
- 'TINT:' => 'tinyint(%d)',
- 'USINT' => 'INTEGER UNSIGNED', //'mediumint(4) UNSIGNED',
- 'BOOL' => 'INTEGER UNSIGNED', //'tinyint(1) UNSIGNED',
- 'VCHAR' => 'varchar(255)',
- 'VCHAR:' => 'varchar(%d)',
- 'CHAR:' => 'char(%d)',
- 'XSTEXT' => 'text(65535)',
- 'STEXT' => 'text(65535)',
- 'TEXT' => 'text(65535)',
- 'MTEXT' => 'mediumtext(16777215)',
- 'XSTEXT_UNI'=> 'text(65535)',
- 'STEXT_UNI' => 'text(65535)',
- 'TEXT_UNI' => 'text(65535)',
- 'MTEXT_UNI' => 'mediumtext(16777215)',
- 'TIMESTAMP' => 'INTEGER UNSIGNED', //'int(11) UNSIGNED',
- 'DECIMAL' => 'decimal(5,2)',
- 'DECIMAL:' => 'decimal(%d,2)',
- 'PDECIMAL' => 'decimal(6,3)',
- 'PDECIMAL:' => 'decimal(%d,3)',
- 'VCHAR_UNI' => 'varchar(255)',
- 'VCHAR_UNI:'=> 'varchar(%d)',
- 'VCHAR_CI' => 'varchar(255)',
- 'VARBINARY' => 'blob',
- ),
-
- 'postgres' => array(
- 'INT:' => 'INT4',
- 'BINT' => 'INT8',
- 'UINT' => 'INT4', // unsigned
- 'UINT:' => 'INT4', // unsigned
- 'USINT' => 'INT2', // unsigned
- 'BOOL' => 'INT2', // unsigned
- 'TINT:' => 'INT2',
- 'VCHAR' => 'varchar(255)',
- 'VCHAR:' => 'varchar(%d)',
- 'CHAR:' => 'char(%d)',
- 'XSTEXT' => 'varchar(1000)',
- 'STEXT' => 'varchar(3000)',
- 'TEXT' => 'varchar(8000)',
- 'MTEXT' => 'TEXT',
- 'XSTEXT_UNI'=> 'varchar(100)',
- 'STEXT_UNI' => 'varchar(255)',
- 'TEXT_UNI' => 'varchar(4000)',
- 'MTEXT_UNI' => 'TEXT',
- 'TIMESTAMP' => 'INT4', // unsigned
- 'DECIMAL' => 'decimal(5,2)',
- 'DECIMAL:' => 'decimal(%d,2)',
- 'PDECIMAL' => 'decimal(6,3)',
- 'PDECIMAL:' => 'decimal(%d,3)',
- 'VCHAR_UNI' => 'varchar(255)',
- 'VCHAR_UNI:'=> 'varchar(%d)',
- 'VCHAR_CI' => 'varchar_ci',
- 'VARBINARY' => 'bytea',
- ),
-);
-
-// A list of types being unsigned for better reference in some db's
-$unsigned_types = array('UINT', 'UINT:', 'USINT', 'BOOL', 'TIMESTAMP');
-$supported_dbms = array('firebird', 'mssql', 'mysql_40', 'mysql_41', 'oracle', 'postgres', 'sqlite');
-
-foreach ($supported_dbms as $dbms)
-{
- $schema_data = get_schema_struct();
- if ($dbms == 'mssql')
- {
- foreach ($schema_data as $table_name => $table_data)
- {
- if (!isset($table_data['PRIMARY_KEY']))
- {
- $schema_data[$table_name]['COLUMNS']['mssqlindex'] = array('UINT', NULL, 'auto_increment');
- $schema_data[$table_name]['PRIMARY_KEY'] = 'mssqlindex';
- }
- }
- }
-
- $fp = fopen($schema_path . $dbms . '_schema.sql', 'wb');
-
- $line = '';
-
- // Write Header
- switch ($dbms)
- {
- case 'mysql_40':
- case 'mysql_41':
- case 'firebird':
- case 'sqlite':
- fwrite($fp, "# DO NOT EDIT THIS FILE, IT IS GENERATED\n");
- fwrite($fp, "#\n");
- fwrite($fp, "# To change the contents of this file, edit\n");
- fwrite($fp, "# phpBB/develop/create_schema_files.php and\n");
- fwrite($fp, "# run it.\n");
- break;
-
- case 'mssql':
- case 'oracle':
- case 'postgres':
- fwrite($fp, "/*\n");
- fwrite($fp, " * DO NOT EDIT THIS FILE, IT IS GENERATED\n");
- fwrite($fp, " *\n");
- fwrite($fp, " * To change the contents of this file, edit\n");
- fwrite($fp, " * phpBB/develop/create_schema_files.php and\n");
- fwrite($fp, " * run it.\n");
- fwrite($fp, " */\n\n");
- break;
- }
-
- switch ($dbms)
- {
- case 'firebird':
- $line .= custom_data('firebird') . "\n";
- break;
-
- case 'sqlite':
- $line .= "BEGIN TRANSACTION;\n\n";
- break;
-
- case 'oracle':
- $line .= custom_data('oracle') . "\n";
- break;
-
- case 'postgres':
- $line .= "BEGIN;\n\n";
- $line .= custom_data('postgres') . "\n";
- break;
- }
-
- fwrite($fp, $line);
-
- foreach ($schema_data as $table_name => $table_data)
- {
- // Write comment about table
- switch ($dbms)
- {
- case 'mysql_40':
- case 'mysql_41':
- case 'firebird':
- case 'sqlite':
- fwrite($fp, "# Table: '{$table_name}'\n");
- break;
-
- case 'mssql':
- case 'oracle':
- case 'postgres':
- fwrite($fp, "/*\n\tTable: '{$table_name}'\n*/\n");
- break;
- }
-
- // Create Table statement
- $generator = $textimage = false;
- $line = '';
-
- switch ($dbms)
- {
- case 'mysql_40':
- case 'mysql_41':
- case 'firebird':
- case 'oracle':
- case 'sqlite':
- case 'postgres':
- $line = "CREATE TABLE {$table_name} (\n";
- break;
-
- case 'mssql':
- $line = "CREATE TABLE [{$table_name}] (\n";
- break;
- }
-
- // Table specific so we don't get overlap
- $modded_array = array();
-
- // Write columns one by one...
- foreach ($table_data['COLUMNS'] as $column_name => $column_data)
- {
- if (strlen($column_name) > 30)
- {
- trigger_error("Column name '$column_name' on table '$table_name' is too long. The maximum is 30 characters.", E_USER_ERROR);
- }
- if (isset($column_data[2]) && $column_data[2] == 'auto_increment' && strlen($column_name) > 26) // "${column_name}_gen"
- {
- trigger_error("Index name '${column_name}_gen' on table '$table_name' is too long. The maximum is 30 characters.", E_USER_ERROR);
- }
-
- // Get type
- if (strpos($column_data[0], ':') !== false)
- {
- list($orig_column_type, $column_length) = explode(':', $column_data[0]);
- if (!is_array($dbms_type_map[$dbms][$orig_column_type . ':']))
- {
- $column_type = sprintf($dbms_type_map[$dbms][$orig_column_type . ':'], $column_length);
- }
- else
- {
- if (isset($dbms_type_map[$dbms][$orig_column_type . ':']['rule']))
- {
- switch ($dbms_type_map[$dbms][$orig_column_type . ':']['rule'][0])
- {
- case 'div':
- $column_length /= $dbms_type_map[$dbms][$orig_column_type . ':']['rule'][1];
- $column_length = ceil($column_length);
- $column_type = sprintf($dbms_type_map[$dbms][$orig_column_type . ':'][0], $column_length);
- break;
- }
- }
-
- if (isset($dbms_type_map[$dbms][$orig_column_type . ':']['limit']))
- {
- switch ($dbms_type_map[$dbms][$orig_column_type . ':']['limit'][0])
- {
- case 'mult':
- $column_length *= $dbms_type_map[$dbms][$orig_column_type . ':']['limit'][1];
- if ($column_length > $dbms_type_map[$dbms][$orig_column_type . ':']['limit'][2])
- {
- $column_type = $dbms_type_map[$dbms][$orig_column_type . ':']['limit'][3];
- $modded_array[$column_name] = $column_type;
- }
- else
- {
- $column_type = sprintf($dbms_type_map[$dbms][$orig_column_type . ':'][0], $column_length);
- }
- break;
- }
- }
- }
- $orig_column_type .= ':';
- }
- else
- {
- $orig_column_type = $column_data[0];
- $column_type = $dbms_type_map[$dbms][$column_data[0]];
- if ($column_type == 'text' || $column_type == 'blob')
- {
- $modded_array[$column_name] = $column_type;
- }
- }
-
- // Adjust default value if db-dependant specified
- if (is_array($column_data[1]))
- {
- $column_data[1] = (isset($column_data[1][$dbms])) ? $column_data[1][$dbms] : $column_data[1]['default'];
- }
-
- switch ($dbms)
- {
- case 'mysql_40':
- case 'mysql_41':
- $line .= "\t{$column_name} {$column_type} ";
-
- // For hexadecimal values do not use single quotes
- if (!is_null($column_data[1]) && substr($column_type, -4) !== 'text' && substr($column_type, -4) !== 'blob')
- {
- $line .= (strpos($column_data[1], '0x') === 0) ? "DEFAULT {$column_data[1]} " : "DEFAULT '{$column_data[1]}' ";
- }
- $line .= 'NOT NULL';
-
- if (isset($column_data[2]))
- {
- if ($column_data[2] == 'auto_increment')
- {
- $line .= ' auto_increment';
- }
- else if ($dbms === 'mysql_41' && $column_data[2] == 'true_sort')
- {
- $line .= ' COLLATE utf8_unicode_ci';
- }
- }
-
- $line .= ",\n";
- break;
-
- case 'sqlite':
- if (isset($column_data[2]) && $column_data[2] == 'auto_increment')
- {
- $line .= "\t{$column_name} INTEGER PRIMARY KEY ";
- $generator = $column_name;
- }
- else
- {
- $line .= "\t{$column_name} {$column_type} ";
- }
-
- $line .= 'NOT NULL ';
- $line .= (!is_null($column_data[1])) ? "DEFAULT '{$column_data[1]}'" : '';
- $line .= ",\n";
- break;
-
- case 'firebird':
- $line .= "\t{$column_name} {$column_type} ";
-
- if (!is_null($column_data[1]))
- {
- $line .= 'DEFAULT ' . ((is_numeric($column_data[1])) ? $column_data[1] : "'{$column_data[1]}'") . ' ';
- }
-
- $line .= 'NOT NULL';
-
- // This is a UNICODE column and thus should be given it's fair share
- if (preg_match('/^X?STEXT_UNI|VCHAR_(CI|UNI:?)/', $column_data[0]))
- {
- $line .= ' COLLATE UNICODE';
- }
-
- $line .= ",\n";
-
- if (isset($column_data[2]) && $column_data[2] == 'auto_increment')
- {
- $generator = $column_name;
- }
- break;
-
- case 'mssql':
- if ($column_type == '[text]')
- {
- $textimage = true;
- }
-
- $line .= "\t[{$column_name}] {$column_type} ";
+define('IN_PHPBB', true);
+$phpbb_root_path = dirname(__FILE__) . '/../';
+$phpEx = substr(strrchr(__FILE__, '.'), 1);
- if (!is_null($column_data[1]))
- {
- // For hexadecimal values do not use single quotes
- if (strpos($column_data[1], '0x') === 0)
- {
- $line .= 'DEFAULT (' . $column_data[1] . ') ';
- }
- else
- {
- $line .= 'DEFAULT (' . ((is_numeric($column_data[1])) ? $column_data[1] : "'{$column_data[1]}'") . ') ';
- }
- }
-
- if (isset($column_data[2]) && $column_data[2] == 'auto_increment')
- {
- $line .= 'IDENTITY (1, 1) ';
- }
-
- $line .= 'NOT NULL';
- $line .= " ,\n";
- break;
-
- case 'oracle':
- $line .= "\t{$column_name} {$column_type} ";
- $line .= (!is_null($column_data[1])) ? "DEFAULT '{$column_data[1]}' " : '';
-
- // In Oracle empty strings ('') are treated as NULL.
- // Therefore in oracle we allow NULL's for all DEFAULT '' entries
- $line .= ($column_data[1] === '') ? ",\n" : "NOT NULL,\n";
-
- if (isset($column_data[2]) && $column_data[2] == 'auto_increment')
- {
- $generator = $column_name;
- }
- break;
-
- case 'postgres':
- $line .= "\t{$column_name} {$column_type} ";
-
- if (isset($column_data[2]) && $column_data[2] == 'auto_increment')
- {
- $line .= "DEFAULT nextval('{$table_name}_seq'),\n";
-
- // Make sure the sequence will be created before creating the table
- $line = "CREATE SEQUENCE {$table_name}_seq;\n\n" . $line;
- }
- else
- {
- $line .= (!is_null($column_data[1])) ? "DEFAULT '{$column_data[1]}' " : '';
- $line .= "NOT NULL";
-
- // Unsigned? Then add a CHECK contraint
- if (in_array($orig_column_type, $unsigned_types))
- {
- $line .= " CHECK ({$column_name} >= 0)";
- }
-
- $line .= ",\n";
- }
- break;
- }
- }
-
- switch ($dbms)
- {
- case 'firebird':
- // Remove last line delimiter...
- $line = substr($line, 0, -2);
- $line .= "\n);;\n\n";
- break;
-
- case 'mssql':
- $line = substr($line, 0, -2);
- $line .= "\n)";// ON [PRIMARY]" . (($textimage) ? ' TEXTIMAGE_ON [PRIMARY]' : '') . "\n";
- $line .= "GO\n\n";
- break;
- }
-
- // Write primary key
- if (isset($table_data['PRIMARY_KEY']))
- {
- if (!is_array($table_data['PRIMARY_KEY']))
- {
- $table_data['PRIMARY_KEY'] = array($table_data['PRIMARY_KEY']);
- }
-
- switch ($dbms)
- {
- case 'mysql_40':
- case 'mysql_41':
- case 'postgres':
- $line .= "\tPRIMARY KEY (" . implode(', ', $table_data['PRIMARY_KEY']) . "),\n";
- break;
-
- case 'firebird':
- $line .= "ALTER TABLE {$table_name} ADD PRIMARY KEY (" . implode(', ', $table_data['PRIMARY_KEY']) . ");;\n\n";
- break;
-
- case 'sqlite':
- if ($generator === false || !in_array($generator, $table_data['PRIMARY_KEY']))
- {
- $line .= "\tPRIMARY KEY (" . implode(', ', $table_data['PRIMARY_KEY']) . "),\n";
- }
- break;
-
- case 'mssql':
- $line .= "ALTER TABLE [{$table_name}] WITH NOCHECK ADD \n";
- $line .= "\tCONSTRAINT [PK_{$table_name}] PRIMARY KEY CLUSTERED \n";
- $line .= "\t(\n";
- $line .= "\t\t[" . implode("],\n\t\t[", $table_data['PRIMARY_KEY']) . "]\n";
- $line .= "\t)\n";
- $line .= "GO\n\n";
- break;
-
- case 'oracle':
- $line .= "\tCONSTRAINT pk_{$table_name} PRIMARY KEY (" . implode(', ', $table_data['PRIMARY_KEY']) . "),\n";
- break;
- }
- }
-
- switch ($dbms)
- {
- case 'oracle':
- // UNIQUE contrains to be added?
- if (isset($table_data['KEYS']))
- {
- foreach ($table_data['KEYS'] as $key_name => $key_data)
- {
- if (!is_array($key_data[1]))
- {
- $key_data[1] = array($key_data[1]);
- }
-
- if ($key_data[0] == 'UNIQUE')
- {
- $line .= "\tCONSTRAINT u_phpbb_{$key_name} UNIQUE (" . implode(', ', $key_data[1]) . "),\n";
- }
- }
- }
-
- // Remove last line delimiter...
- $line = substr($line, 0, -2);
- $line .= "\n)\n/\n\n";
- break;
-
- case 'postgres':
- // Remove last line delimiter...
- $line = substr($line, 0, -2);
- $line .= "\n);\n\n";
- break;
-
- case 'sqlite':
- // Remove last line delimiter...
- $line = substr($line, 0, -2);
- $line .= "\n);\n\n";
- break;
- }
-
- // Write Keys
- if (isset($table_data['KEYS']))
- {
- foreach ($table_data['KEYS'] as $key_name => $key_data)
- {
- if (!is_array($key_data[1]))
- {
- $key_data[1] = array($key_data[1]);
- }
-
- if (strlen($table_name . $key_name) > 30)
- {
- trigger_error("Index name '${table_name}_$key_name' on table '$table_name' is too long. The maximum is 30 characters.", E_USER_ERROR);
- }
-
- switch ($dbms)
- {
- case 'mysql_40':
- case 'mysql_41':
- $line .= ($key_data[0] == 'INDEX') ? "\tKEY" : '';
- $line .= ($key_data[0] == 'UNIQUE') ? "\tUNIQUE" : '';
- foreach ($key_data[1] as $key => $col_name)
- {
- if (isset($modded_array[$col_name]))
- {
- switch ($modded_array[$col_name])
- {
- case 'text':
- case 'blob':
- $key_data[1][$key] = $col_name . '(255)';
- break;
- }
- }
- }
- $line .= ' ' . $key_name . ' (' . implode(', ', $key_data[1]) . "),\n";
- break;
-
- case 'firebird':
- $line .= ($key_data[0] == 'INDEX') ? 'CREATE INDEX' : '';
- $line .= ($key_data[0] == 'UNIQUE') ? 'CREATE UNIQUE INDEX' : '';
-
- $line .= ' ' . $table_name . '_' . $key_name . ' ON ' . $table_name . '(' . implode(', ', $key_data[1]) . ");;\n";
- break;
-
- case 'mssql':
- $line .= ($key_data[0] == 'INDEX') ? 'CREATE INDEX' : '';
- $line .= ($key_data[0] == 'UNIQUE') ? 'CREATE UNIQUE INDEX' : '';
- $line .= " [{$key_name}] ON [{$table_name}]([" . implode('], [', $key_data[1]) . "])\n";
- $line .= "GO\n\n";
- break;
-
- case 'oracle':
- if ($key_data[0] == 'UNIQUE')
- {
- continue;
- }
-
- $line .= ($key_data[0] == 'INDEX') ? 'CREATE INDEX' : '';
-
- $line .= " {$table_name}_{$key_name} ON {$table_name} (" . implode(', ', $key_data[1]) . ")\n";
- $line .= "/\n";
- break;
-
- case 'sqlite':
- $line .= ($key_data[0] == 'INDEX') ? 'CREATE INDEX' : '';
- $line .= ($key_data[0] == 'UNIQUE') ? 'CREATE UNIQUE INDEX' : '';
-
- $line .= " {$table_name}_{$key_name} ON {$table_name} (" . implode(', ', $key_data[1]) . ");\n";
- break;
-
- case 'postgres':
- $line .= ($key_data[0] == 'INDEX') ? 'CREATE INDEX' : '';
- $line .= ($key_data[0] == 'UNIQUE') ? 'CREATE UNIQUE INDEX' : '';
-
- $line .= " {$table_name}_{$key_name} ON {$table_name} (" . implode(', ', $key_data[1]) . ");\n";
- break;
- }
- }
- }
-
- switch ($dbms)
- {
- case 'mysql_40':
- // Remove last line delimiter...
- $line = substr($line, 0, -2);
- $line .= "\n);\n\n";
- break;
-
- case 'mysql_41':
- // Remove last line delimiter...
- $line = substr($line, 0, -2);
- $line .= "\n) CHARACTER SET `utf8` COLLATE `utf8_bin`;\n\n";
- break;
-
- // Create Generator
- case 'firebird':
- if ($generator !== false)
- {
- $line .= "\nCREATE GENERATOR {$table_name}_gen;;\n";
- $line .= 'SET GENERATOR ' . $table_name . "_gen TO 0;;\n\n";
-
- $line .= 'CREATE TRIGGER t_' . $table_name . ' FOR ' . $table_name . "\n";
- $line .= "BEFORE INSERT\nAS\nBEGIN\n";
- $line .= "\tNEW.{$generator} = GEN_ID({$table_name}_gen, 1);\nEND;;\n\n";
- }
- break;
-
- case 'oracle':
- if ($generator !== false)
- {
- $line .= "\nCREATE SEQUENCE {$table_name}_seq\n/\n\n";
-
- $line .= "CREATE OR REPLACE TRIGGER t_{$table_name}\n";
- $line .= "BEFORE INSERT ON {$table_name}\n";
- $line .= "FOR EACH ROW WHEN (\n";
- $line .= "\tnew.{$generator} IS NULL OR new.{$generator} = 0\n";
- $line .= ")\nBEGIN\n";
- $line .= "\tSELECT {$table_name}_seq.nextval\n";
- $line .= "\tINTO :new.{$generator}\n";
- $line .= "\tFROM dual;\nEND;\n/\n\n";
- }
- break;
- }
-
- fwrite($fp, $line . "\n");
- }
-
- $line = '';
-
- // Write custom function at the end for some db's
- switch ($dbms)
- {
- case 'mssql':
- // No need to do this, no transaction support for schema changes
- //$line = "\nCOMMIT\nGO\n\n";
- break;
-
- case 'sqlite':
- $line = "\nCOMMIT;";
- break;
-
- case 'postgres':
- $line = "\nCOMMIT;";
- break;
- }
-
- fwrite($fp, $line);
- fclose($fp);
-}
+include($phpbb_root_path . 'includes/constants.' . $phpEx);
+require($phpbb_root_path . 'phpbb/class_loader.' . $phpEx);
+$phpbb_class_loader = new \phpbb\class_loader('phpbb\\', "{$phpbb_root_path}phpbb/", $phpEx);
+$phpbb_class_loader->register();
+$finder = new \phpbb\finder(new \phpbb\filesystem(), $phpbb_root_path);
+$classes = $finder->core_path('phpbb/')
+ ->directory('/db/migration/data')
+ ->get_classes();
-/**
-* Define the basic structure
-* The format:
-* array('{TABLE_NAME}' => {TABLE_DATA})
-* {TABLE_DATA}:
-* COLUMNS = array({column_name} = array({column_type}, {default}, {auto_increment}))
-* PRIMARY_KEY = {column_name(s)}
-* KEYS = array({key_name} = array({key_type}, {column_name(s)})),
-*
-* Column Types:
-* INT:x => SIGNED int(x)
-* BINT => BIGINT
-* UINT => mediumint(8) UNSIGNED
-* UINT:x => int(x) UNSIGNED
-* TINT:x => tinyint(x)
-* USINT => smallint(4) UNSIGNED (for _order columns)
-* BOOL => tinyint(1) UNSIGNED
-* VCHAR => varchar(255)
-* CHAR:x => char(x)
-* XSTEXT_UNI => text for storing 100 characters (topic_title for example)
-* STEXT_UNI => text for storing 255 characters (normal input field with a max of 255 single-byte chars) - same as VCHAR_UNI
-* TEXT_UNI => text for storing 3000 characters (short text, descriptions, comments, etc.)
-* MTEXT_UNI => mediumtext (post text, large text)
-* VCHAR:x => varchar(x)
-* TIMESTAMP => int(11) UNSIGNED
-* DECIMAL => decimal number (5,2)
-* DECIMAL: => decimal number (x,2)
-* PDECIMAL => precision decimal number (6,3)
-* PDECIMAL: => precision decimal number (x,3)
-* VCHAR_UNI => varchar(255) BINARY
-* VCHAR_CI => varchar_ci for postgresql, others VCHAR
-*/
-function get_schema_struct()
-{
- $schema_data = array();
-
- $schema_data['phpbb_attachments'] = array(
- 'COLUMNS' => array(
- 'attach_id' => array('UINT', NULL, 'auto_increment'),
- 'post_msg_id' => array('UINT', 0),
- 'topic_id' => array('UINT', 0),
- 'in_message' => array('BOOL', 0),
- 'poster_id' => array('UINT', 0),
- 'is_orphan' => array('BOOL', 1),
- 'physical_filename' => array('VCHAR', ''),
- 'real_filename' => array('VCHAR', ''),
- 'download_count' => array('UINT', 0),
- 'attach_comment' => array('TEXT_UNI', ''),
- 'extension' => array('VCHAR:100', ''),
- 'mimetype' => array('VCHAR:100', ''),
- 'filesize' => array('UINT:20', 0),
- 'filetime' => array('TIMESTAMP', 0),
- 'thumbnail' => array('BOOL', 0),
- ),
- 'PRIMARY_KEY' => 'attach_id',
- 'KEYS' => array(
- 'filetime' => array('INDEX', 'filetime'),
- 'post_msg_id' => array('INDEX', 'post_msg_id'),
- 'topic_id' => array('INDEX', 'topic_id'),
- 'poster_id' => array('INDEX', 'poster_id'),
- 'is_orphan' => array('INDEX', 'is_orphan'),
- ),
- );
-
- $schema_data['phpbb_acl_groups'] = array(
- 'COLUMNS' => array(
- 'group_id' => array('UINT', 0),
- 'forum_id' => array('UINT', 0),
- 'auth_option_id' => array('UINT', 0),
- 'auth_role_id' => array('UINT', 0),
- 'auth_setting' => array('TINT:2', 0),
- ),
- 'KEYS' => array(
- 'group_id' => array('INDEX', 'group_id'),
- 'auth_opt_id' => array('INDEX', 'auth_option_id'),
- 'auth_role_id' => array('INDEX', 'auth_role_id'),
- ),
- );
-
- $schema_data['phpbb_acl_options'] = array(
- 'COLUMNS' => array(
- 'auth_option_id' => array('UINT', NULL, 'auto_increment'),
- 'auth_option' => array('VCHAR:50', ''),
- 'is_global' => array('BOOL', 0),
- 'is_local' => array('BOOL', 0),
- 'founder_only' => array('BOOL', 0),
- ),
- 'PRIMARY_KEY' => 'auth_option_id',
- 'KEYS' => array(
- 'auth_option' => array('UNIQUE', 'auth_option'),
- ),
- );
-
- $schema_data['phpbb_acl_roles'] = array(
- 'COLUMNS' => array(
- 'role_id' => array('UINT', NULL, 'auto_increment'),
- 'role_name' => array('VCHAR_UNI', ''),
- 'role_description' => array('TEXT_UNI', ''),
- 'role_type' => array('VCHAR:10', ''),
- 'role_order' => array('USINT', 0),
- ),
- 'PRIMARY_KEY' => 'role_id',
- 'KEYS' => array(
- 'role_type' => array('INDEX', 'role_type'),
- 'role_order' => array('INDEX', 'role_order'),
- ),
- );
-
- $schema_data['phpbb_acl_roles_data'] = array(
- 'COLUMNS' => array(
- 'role_id' => array('UINT', 0),
- 'auth_option_id' => array('UINT', 0),
- 'auth_setting' => array('TINT:2', 0),
- ),
- 'PRIMARY_KEY' => array('role_id', 'auth_option_id'),
- 'KEYS' => array(
- 'ath_op_id' => array('INDEX', 'auth_option_id'),
- ),
- );
-
- $schema_data['phpbb_acl_users'] = array(
- 'COLUMNS' => array(
- 'user_id' => array('UINT', 0),
- 'forum_id' => array('UINT', 0),
- 'auth_option_id' => array('UINT', 0),
- 'auth_role_id' => array('UINT', 0),
- 'auth_setting' => array('TINT:2', 0),
- ),
- 'KEYS' => array(
- 'user_id' => array('INDEX', 'user_id'),
- 'auth_option_id' => array('INDEX', 'auth_option_id'),
- 'auth_role_id' => array('INDEX', 'auth_role_id'),
- ),
- );
-
- $schema_data['phpbb_banlist'] = array(
- 'COLUMNS' => array(
- 'ban_id' => array('UINT', NULL, 'auto_increment'),
- 'ban_userid' => array('UINT', 0),
- 'ban_ip' => array('VCHAR:40', ''),
- 'ban_email' => array('VCHAR_UNI:100', ''),
- 'ban_start' => array('TIMESTAMP', 0),
- 'ban_end' => array('TIMESTAMP', 0),
- 'ban_exclude' => array('BOOL', 0),
- 'ban_reason' => array('VCHAR_UNI', ''),
- 'ban_give_reason' => array('VCHAR_UNI', ''),
- ),
- 'PRIMARY_KEY' => 'ban_id',
- 'KEYS' => array(
- 'ban_end' => array('INDEX', 'ban_end'),
- 'ban_user' => array('INDEX', array('ban_userid', 'ban_exclude')),
- 'ban_email' => array('INDEX', array('ban_email', 'ban_exclude')),
- 'ban_ip' => array('INDEX', array('ban_ip', 'ban_exclude')),
- ),
- );
-
- $schema_data['phpbb_bbcodes'] = array(
- 'COLUMNS' => array(
- 'bbcode_id' => array('USINT', 0),
- 'bbcode_tag' => array('VCHAR:16', ''),
- 'bbcode_helpline' => array('VCHAR_UNI', ''),
- 'display_on_posting' => array('BOOL', 0),
- 'bbcode_match' => array('TEXT_UNI', ''),
- 'bbcode_tpl' => array('MTEXT_UNI', ''),
- 'first_pass_match' => array('MTEXT_UNI', ''),
- 'first_pass_replace' => array('MTEXT_UNI', ''),
- 'second_pass_match' => array('MTEXT_UNI', ''),
- 'second_pass_replace' => array('MTEXT_UNI', ''),
- ),
- 'PRIMARY_KEY' => 'bbcode_id',
- 'KEYS' => array(
- 'display_on_post' => array('INDEX', 'display_on_posting'),
- ),
- );
-
- $schema_data['phpbb_bookmarks'] = array(
- 'COLUMNS' => array(
- 'topic_id' => array('UINT', 0),
- 'user_id' => array('UINT', 0),
- ),
- 'PRIMARY_KEY' => array('topic_id', 'user_id'),
- );
-
- $schema_data['phpbb_bots'] = array(
- 'COLUMNS' => array(
- 'bot_id' => array('UINT', NULL, 'auto_increment'),
- 'bot_active' => array('BOOL', 1),
- 'bot_name' => array('STEXT_UNI', ''),
- 'user_id' => array('UINT', 0),
- 'bot_agent' => array('VCHAR', ''),
- 'bot_ip' => array('VCHAR', ''),
- ),
- 'PRIMARY_KEY' => 'bot_id',
- 'KEYS' => array(
- 'bot_active' => array('INDEX', 'bot_active'),
- ),
- );
-
- $schema_data['phpbb_config'] = array(
- 'COLUMNS' => array(
- 'config_name' => array('VCHAR', ''),
- 'config_value' => array('VCHAR_UNI', ''),
- 'is_dynamic' => array('BOOL', 0),
- ),
- 'PRIMARY_KEY' => 'config_name',
- 'KEYS' => array(
- 'is_dynamic' => array('INDEX', 'is_dynamic'),
- ),
- );
-
- $schema_data['phpbb_confirm'] = array(
- 'COLUMNS' => array(
- 'confirm_id' => array('CHAR:32', ''),
- 'session_id' => array('CHAR:32', ''),
- 'confirm_type' => array('TINT:3', 0),
- 'code' => array('VCHAR:8', ''),
- 'seed' => array('UINT:10', 0),
- 'attempts' => array('UINT', 0),
- ),
- 'PRIMARY_KEY' => array('session_id', 'confirm_id'),
- 'KEYS' => array(
- 'confirm_type' => array('INDEX', 'confirm_type'),
- ),
- );
-
- $schema_data['phpbb_disallow'] = array(
- 'COLUMNS' => array(
- 'disallow_id' => array('UINT', NULL, 'auto_increment'),
- 'disallow_username' => array('VCHAR_UNI:255', ''),
- ),
- 'PRIMARY_KEY' => 'disallow_id',
- );
-
- $schema_data['phpbb_drafts'] = array(
- 'COLUMNS' => array(
- 'draft_id' => array('UINT', NULL, 'auto_increment'),
- 'user_id' => array('UINT', 0),
- 'topic_id' => array('UINT', 0),
- 'forum_id' => array('UINT', 0),
- 'save_time' => array('TIMESTAMP', 0),
- 'draft_subject' => array('STEXT_UNI', ''),
- 'draft_message' => array('MTEXT_UNI', ''),
- ),
- 'PRIMARY_KEY' => 'draft_id',
- 'KEYS' => array(
- 'save_time' => array('INDEX', 'save_time'),
- ),
- );
-
- $schema_data['phpbb_extensions'] = array(
- 'COLUMNS' => array(
- 'extension_id' => array('UINT', NULL, 'auto_increment'),
- 'group_id' => array('UINT', 0),
- 'extension' => array('VCHAR:100', ''),
- ),
- 'PRIMARY_KEY' => 'extension_id',
- );
-
- $schema_data['phpbb_extension_groups'] = array(
- 'COLUMNS' => array(
- 'group_id' => array('UINT', NULL, 'auto_increment'),
- 'group_name' => array('VCHAR_UNI', ''),
- 'cat_id' => array('TINT:2', 0),
- 'allow_group' => array('BOOL', 0),
- 'download_mode' => array('BOOL', 1),
- 'upload_icon' => array('VCHAR', ''),
- 'max_filesize' => array('UINT:20', 0),
- 'allowed_forums' => array('TEXT', ''),
- 'allow_in_pm' => array('BOOL', 0),
- ),
- 'PRIMARY_KEY' => 'group_id',
- );
-
- $schema_data['phpbb_forums'] = array(
- 'COLUMNS' => array(
- 'forum_id' => array('UINT', NULL, 'auto_increment'),
- 'parent_id' => array('UINT', 0),
- 'left_id' => array('UINT', 0),
- 'right_id' => array('UINT', 0),
- 'forum_parents' => array('MTEXT', ''),
- 'forum_name' => array('STEXT_UNI', ''),
- 'forum_desc' => array('TEXT_UNI', ''),
- 'forum_desc_bitfield' => array('VCHAR:255', ''),
- 'forum_desc_options' => array('UINT:11', 7),
- 'forum_desc_uid' => array('VCHAR:8', ''),
- 'forum_link' => array('VCHAR_UNI', ''),
- 'forum_password' => array('VCHAR_UNI:40', ''),
- 'forum_style' => array('UINT', 0),
- 'forum_image' => array('VCHAR', ''),
- 'forum_rules' => array('TEXT_UNI', ''),
- 'forum_rules_link' => array('VCHAR_UNI', ''),
- 'forum_rules_bitfield' => array('VCHAR:255', ''),
- 'forum_rules_options' => array('UINT:11', 7),
- 'forum_rules_uid' => array('VCHAR:8', ''),
- 'forum_topics_per_page' => array('TINT:4', 0),
- 'forum_type' => array('TINT:4', 0),
- 'forum_status' => array('TINT:4', 0),
- 'forum_posts' => array('UINT', 0),
- 'forum_topics' => array('UINT', 0),
- 'forum_topics_real' => array('UINT', 0),
- 'forum_last_post_id' => array('UINT', 0),
- 'forum_last_poster_id' => array('UINT', 0),
- 'forum_last_post_subject' => array('STEXT_UNI', ''),
- 'forum_last_post_time' => array('TIMESTAMP', 0),
- 'forum_last_poster_name'=> array('VCHAR_UNI', ''),
- 'forum_last_poster_colour'=> array('VCHAR:6', ''),
- 'forum_flags' => array('TINT:4', 32),
- 'forum_options' => array('UINT:20', 0),
- 'display_subforum_list' => array('BOOL', 1),
- 'display_on_index' => array('BOOL', 1),
- 'enable_indexing' => array('BOOL', 1),
- 'enable_icons' => array('BOOL', 1),
- 'enable_prune' => array('BOOL', 0),
- 'prune_next' => array('TIMESTAMP', 0),
- 'prune_days' => array('UINT', 0),
- 'prune_viewed' => array('UINT', 0),
- 'prune_freq' => array('UINT', 0),
- ),
- 'PRIMARY_KEY' => 'forum_id',
- 'KEYS' => array(
- 'left_right_id' => array('INDEX', array('left_id', 'right_id')),
- 'forum_lastpost_id' => array('INDEX', 'forum_last_post_id'),
- ),
- );
-
- $schema_data['phpbb_forums_access'] = array(
- 'COLUMNS' => array(
- 'forum_id' => array('UINT', 0),
- 'user_id' => array('UINT', 0),
- 'session_id' => array('CHAR:32', ''),
- ),
- 'PRIMARY_KEY' => array('forum_id', 'user_id', 'session_id'),
- );
-
- $schema_data['phpbb_forums_track'] = array(
- 'COLUMNS' => array(
- 'user_id' => array('UINT', 0),
- 'forum_id' => array('UINT', 0),
- 'mark_time' => array('TIMESTAMP', 0),
- ),
- 'PRIMARY_KEY' => array('user_id', 'forum_id'),
- );
-
- $schema_data['phpbb_forums_watch'] = array(
- 'COLUMNS' => array(
- 'forum_id' => array('UINT', 0),
- 'user_id' => array('UINT', 0),
- 'notify_status' => array('BOOL', 0),
- ),
- 'KEYS' => array(
- 'forum_id' => array('INDEX', 'forum_id'),
- 'user_id' => array('INDEX', 'user_id'),
- 'notify_stat' => array('INDEX', 'notify_status'),
- ),
- );
-
- $schema_data['phpbb_groups'] = array(
- 'COLUMNS' => array(
- 'group_id' => array('UINT', NULL, 'auto_increment'),
- 'group_type' => array('TINT:4', 1),
- 'group_founder_manage' => array('BOOL', 0),
- 'group_skip_auth' => array('BOOL', 0),
- 'group_name' => array('VCHAR_CI', ''),
- 'group_desc' => array('TEXT_UNI', ''),
- 'group_desc_bitfield' => array('VCHAR:255', ''),
- 'group_desc_options' => array('UINT:11', 7),
- 'group_desc_uid' => array('VCHAR:8', ''),
- 'group_display' => array('BOOL', 0),
- 'group_avatar' => array('VCHAR', ''),
- 'group_avatar_type' => array('TINT:2', 0),
- 'group_avatar_width' => array('USINT', 0),
- 'group_avatar_height' => array('USINT', 0),
- 'group_rank' => array('UINT', 0),
- 'group_colour' => array('VCHAR:6', ''),
- 'group_sig_chars' => array('UINT', 0),
- 'group_receive_pm' => array('BOOL', 0),
- 'group_message_limit' => array('UINT', 0),
- 'group_max_recipients' => array('UINT', 0),
- 'group_legend' => array('BOOL', 1),
- ),
- 'PRIMARY_KEY' => 'group_id',
- 'KEYS' => array(
- 'group_legend_name' => array('INDEX', array('group_legend', 'group_name')),
- ),
- );
-
- $schema_data['phpbb_icons'] = array(
- 'COLUMNS' => array(
- 'icons_id' => array('UINT', NULL, 'auto_increment'),
- 'icons_url' => array('VCHAR', ''),
- 'icons_width' => array('TINT:4', 0),
- 'icons_height' => array('TINT:4', 0),
- 'icons_order' => array('UINT', 0),
- 'display_on_posting' => array('BOOL', 1),
- ),
- 'PRIMARY_KEY' => 'icons_id',
- 'KEYS' => array(
- 'display_on_posting' => array('INDEX', 'display_on_posting'),
- ),
- );
-
- $schema_data['phpbb_lang'] = array(
- 'COLUMNS' => array(
- 'lang_id' => array('TINT:4', NULL, 'auto_increment'),
- 'lang_iso' => array('VCHAR:30', ''),
- 'lang_dir' => array('VCHAR:30', ''),
- 'lang_english_name' => array('VCHAR_UNI:100', ''),
- 'lang_local_name' => array('VCHAR_UNI:255', ''),
- 'lang_author' => array('VCHAR_UNI:255', ''),
- ),
- 'PRIMARY_KEY' => 'lang_id',
- 'KEYS' => array(
- 'lang_iso' => array('INDEX', 'lang_iso'),
- ),
- );
-
- $schema_data['phpbb_log'] = array(
- 'COLUMNS' => array(
- 'log_id' => array('UINT', NULL, 'auto_increment'),
- 'log_type' => array('TINT:4', 0),
- 'user_id' => array('UINT', 0),
- 'forum_id' => array('UINT', 0),
- 'topic_id' => array('UINT', 0),
- 'reportee_id' => array('UINT', 0),
- 'log_ip' => array('VCHAR:40', ''),
- 'log_time' => array('TIMESTAMP', 0),
- 'log_operation' => array('TEXT_UNI', ''),
- 'log_data' => array('MTEXT_UNI', ''),
- ),
- 'PRIMARY_KEY' => 'log_id',
- 'KEYS' => array(
- 'log_type' => array('INDEX', 'log_type'),
- 'forum_id' => array('INDEX', 'forum_id'),
- 'topic_id' => array('INDEX', 'topic_id'),
- 'reportee_id' => array('INDEX', 'reportee_id'),
- 'user_id' => array('INDEX', 'user_id'),
- ),
- );
-
- $schema_data['phpbb_login_attempts'] = array(
- 'COLUMNS' => array(
- 'attempt_ip' => array('VCHAR:40', ''),
- 'attempt_browser' => array('VCHAR:150', ''),
- 'attempt_forwarded_for' => array('VCHAR:255', ''),
- 'attempt_time' => array('TIMESTAMP', 0),
- 'user_id' => array('UINT', 0),
- 'username' => array('VCHAR_UNI:255', 0),
- 'username_clean' => array('VCHAR_CI', 0),
- ),
- 'KEYS' => array(
- 'att_ip' => array('INDEX', array('attempt_ip', 'attempt_time')),
- 'att_for' => array('INDEX', array('attempt_forwarded_for', 'attempt_time')),
- 'att_time' => array('INDEX', array('attempt_time')),
- 'user_id' => array('INDEX', 'user_id'),
- ),
- );
-
- $schema_data['phpbb_moderator_cache'] = array(
- 'COLUMNS' => array(
- 'forum_id' => array('UINT', 0),
- 'user_id' => array('UINT', 0),
- 'username' => array('VCHAR_UNI:255', ''),
- 'group_id' => array('UINT', 0),
- 'group_name' => array('VCHAR_UNI', ''),
- 'display_on_index' => array('BOOL', 1),
- ),
- 'KEYS' => array(
- 'disp_idx' => array('INDEX', 'display_on_index'),
- 'forum_id' => array('INDEX', 'forum_id'),
- ),
- );
-
- $schema_data['phpbb_modules'] = array(
- 'COLUMNS' => array(
- 'module_id' => array('UINT', NULL, 'auto_increment'),
- 'module_enabled' => array('BOOL', 1),
- 'module_display' => array('BOOL', 1),
- 'module_basename' => array('VCHAR', ''),
- 'module_class' => array('VCHAR:10', ''),
- 'parent_id' => array('UINT', 0),
- 'left_id' => array('UINT', 0),
- 'right_id' => array('UINT', 0),
- 'module_langname' => array('VCHAR', ''),
- 'module_mode' => array('VCHAR', ''),
- 'module_auth' => array('VCHAR', ''),
- ),
- 'PRIMARY_KEY' => 'module_id',
- 'KEYS' => array(
- 'left_right_id' => array('INDEX', array('left_id', 'right_id')),
- 'module_enabled' => array('INDEX', 'module_enabled'),
- 'class_left_id' => array('INDEX', array('module_class', 'left_id')),
- ),
- );
-
- $schema_data['phpbb_poll_options'] = array(
- 'COLUMNS' => array(
- 'poll_option_id' => array('TINT:4', 0),
- 'topic_id' => array('UINT', 0),
- 'poll_option_text' => array('TEXT_UNI', ''),
- 'poll_option_total' => array('UINT', 0),
- ),
- 'KEYS' => array(
- 'poll_opt_id' => array('INDEX', 'poll_option_id'),
- 'topic_id' => array('INDEX', 'topic_id'),
- ),
- );
-
- $schema_data['phpbb_poll_votes'] = array(
- 'COLUMNS' => array(
- 'topic_id' => array('UINT', 0),
- 'poll_option_id' => array('TINT:4', 0),
- 'vote_user_id' => array('UINT', 0),
- 'vote_user_ip' => array('VCHAR:40', ''),
- ),
- 'KEYS' => array(
- 'topic_id' => array('INDEX', 'topic_id'),
- 'vote_user_id' => array('INDEX', 'vote_user_id'),
- 'vote_user_ip' => array('INDEX', 'vote_user_ip'),
- ),
- );
-
- $schema_data['phpbb_posts'] = array(
- 'COLUMNS' => array(
- 'post_id' => array('UINT', NULL, 'auto_increment'),
- 'topic_id' => array('UINT', 0),
- 'forum_id' => array('UINT', 0),
- 'poster_id' => array('UINT', 0),
- 'icon_id' => array('UINT', 0),
- 'poster_ip' => array('VCHAR:40', ''),
- 'post_time' => array('TIMESTAMP', 0),
- 'post_approved' => array('BOOL', 1),
- 'post_reported' => array('BOOL', 0),
- 'enable_bbcode' => array('BOOL', 1),
- 'enable_smilies' => array('BOOL', 1),
- 'enable_magic_url' => array('BOOL', 1),
- 'enable_sig' => array('BOOL', 1),
- 'post_username' => array('VCHAR_UNI:255', ''),
- 'post_subject' => array('STEXT_UNI', '', 'true_sort'),
- 'post_text' => array('MTEXT_UNI', ''),
- 'post_checksum' => array('VCHAR:32', ''),
- 'post_attachment' => array('BOOL', 0),
- 'bbcode_bitfield' => array('VCHAR:255', ''),
- 'bbcode_uid' => array('VCHAR:8', ''),
- 'post_postcount' => array('BOOL', 1),
- 'post_edit_time' => array('TIMESTAMP', 0),
- 'post_edit_reason' => array('STEXT_UNI', ''),
- 'post_edit_user' => array('UINT', 0),
- 'post_edit_count' => array('USINT', 0),
- 'post_edit_locked' => array('BOOL', 0),
- ),
- 'PRIMARY_KEY' => 'post_id',
- 'KEYS' => array(
- 'forum_id' => array('INDEX', 'forum_id'),
- 'topic_id' => array('INDEX', 'topic_id'),
- 'poster_ip' => array('INDEX', 'poster_ip'),
- 'poster_id' => array('INDEX', 'poster_id'),
- 'post_approved' => array('INDEX', 'post_approved'),
- 'post_username' => array('INDEX', 'post_username'),
- 'tid_post_time' => array('INDEX', array('topic_id', 'post_time')),
- ),
- );
-
- $schema_data['phpbb_privmsgs'] = array(
- 'COLUMNS' => array(
- 'msg_id' => array('UINT', NULL, 'auto_increment'),
- 'root_level' => array('UINT', 0),
- 'author_id' => array('UINT', 0),
- 'icon_id' => array('UINT', 0),
- 'author_ip' => array('VCHAR:40', ''),
- 'message_time' => array('TIMESTAMP', 0),
- 'enable_bbcode' => array('BOOL', 1),
- 'enable_smilies' => array('BOOL', 1),
- 'enable_magic_url' => array('BOOL', 1),
- 'enable_sig' => array('BOOL', 1),
- 'message_subject' => array('STEXT_UNI', ''),
- 'message_text' => array('MTEXT_UNI', ''),
- 'message_edit_reason' => array('STEXT_UNI', ''),
- 'message_edit_user' => array('UINT', 0),
- 'message_attachment' => array('BOOL', 0),
- 'bbcode_bitfield' => array('VCHAR:255', ''),
- 'bbcode_uid' => array('VCHAR:8', ''),
- 'message_edit_time' => array('TIMESTAMP', 0),
- 'message_edit_count' => array('USINT', 0),
- 'to_address' => array('TEXT_UNI', ''),
- 'bcc_address' => array('TEXT_UNI', ''),
- 'message_reported' => array('BOOL', 0),
- ),
- 'PRIMARY_KEY' => 'msg_id',
- 'KEYS' => array(
- 'author_ip' => array('INDEX', 'author_ip'),
- 'message_time' => array('INDEX', 'message_time'),
- 'author_id' => array('INDEX', 'author_id'),
- 'root_level' => array('INDEX', 'root_level'),
- ),
- );
-
- $schema_data['phpbb_privmsgs_folder'] = array(
- 'COLUMNS' => array(
- 'folder_id' => array('UINT', NULL, 'auto_increment'),
- 'user_id' => array('UINT', 0),
- 'folder_name' => array('VCHAR_UNI', ''),
- 'pm_count' => array('UINT', 0),
- ),
- 'PRIMARY_KEY' => 'folder_id',
- 'KEYS' => array(
- 'user_id' => array('INDEX', 'user_id'),
- ),
- );
-
- $schema_data['phpbb_privmsgs_rules'] = array(
- 'COLUMNS' => array(
- 'rule_id' => array('UINT', NULL, 'auto_increment'),
- 'user_id' => array('UINT', 0),
- 'rule_check' => array('UINT', 0),
- 'rule_connection' => array('UINT', 0),
- 'rule_string' => array('VCHAR_UNI', ''),
- 'rule_user_id' => array('UINT', 0),
- 'rule_group_id' => array('UINT', 0),
- 'rule_action' => array('UINT', 0),
- 'rule_folder_id' => array('INT:11', 0),
- ),
- 'PRIMARY_KEY' => 'rule_id',
- 'KEYS' => array(
- 'user_id' => array('INDEX', 'user_id'),
- ),
- );
-
- $schema_data['phpbb_privmsgs_to'] = array(
- 'COLUMNS' => array(
- 'msg_id' => array('UINT', 0),
- 'user_id' => array('UINT', 0),
- 'author_id' => array('UINT', 0),
- 'pm_deleted' => array('BOOL', 0),
- 'pm_new' => array('BOOL', 1),
- 'pm_unread' => array('BOOL', 1),
- 'pm_replied' => array('BOOL', 0),
- 'pm_marked' => array('BOOL', 0),
- 'pm_forwarded' => array('BOOL', 0),
- 'folder_id' => array('INT:11', 0),
- ),
- 'KEYS' => array(
- 'msg_id' => array('INDEX', 'msg_id'),
- 'author_id' => array('INDEX', 'author_id'),
- 'usr_flder_id' => array('INDEX', array('user_id', 'folder_id')),
- ),
- );
-
- $schema_data['phpbb_profile_fields'] = array(
- 'COLUMNS' => array(
- 'field_id' => array('UINT', NULL, 'auto_increment'),
- 'field_name' => array('VCHAR_UNI', ''),
- 'field_type' => array('TINT:4', 0),
- 'field_ident' => array('VCHAR:20', ''),
- 'field_length' => array('VCHAR:20', ''),
- 'field_minlen' => array('VCHAR', ''),
- 'field_maxlen' => array('VCHAR', ''),
- 'field_novalue' => array('VCHAR_UNI', ''),
- 'field_default_value' => array('VCHAR_UNI', ''),
- 'field_validation' => array('VCHAR_UNI:20', ''),
- 'field_required' => array('BOOL', 0),
- 'field_show_novalue' => array('BOOL', 0),
- 'field_show_on_reg' => array('BOOL', 0),
- 'field_show_on_vt' => array('BOOL', 0),
- 'field_show_profile' => array('BOOL', 0),
- 'field_hide' => array('BOOL', 0),
- 'field_no_view' => array('BOOL', 0),
- 'field_active' => array('BOOL', 0),
- 'field_order' => array('UINT', 0),
- ),
- 'PRIMARY_KEY' => 'field_id',
- 'KEYS' => array(
- 'fld_type' => array('INDEX', 'field_type'),
- 'fld_ordr' => array('INDEX', 'field_order'),
- ),
- );
-
- $schema_data['phpbb_profile_fields_data'] = array(
- 'COLUMNS' => array(
- 'user_id' => array('UINT', 0),
- ),
- 'PRIMARY_KEY' => 'user_id',
- );
-
- $schema_data['phpbb_profile_fields_lang'] = array(
- 'COLUMNS' => array(
- 'field_id' => array('UINT', 0),
- 'lang_id' => array('UINT', 0),
- 'option_id' => array('UINT', 0),
- 'field_type' => array('TINT:4', 0),
- 'lang_value' => array('VCHAR_UNI', ''),
- ),
- 'PRIMARY_KEY' => array('field_id', 'lang_id', 'option_id'),
- );
-
- $schema_data['phpbb_profile_lang'] = array(
- 'COLUMNS' => array(
- 'field_id' => array('UINT', 0),
- 'lang_id' => array('UINT', 0),
- 'lang_name' => array('VCHAR_UNI', ''),
- 'lang_explain' => array('TEXT_UNI', ''),
- 'lang_default_value' => array('VCHAR_UNI', ''),
- ),
- 'PRIMARY_KEY' => array('field_id', 'lang_id'),
- );
-
- $schema_data['phpbb_ranks'] = array(
- 'COLUMNS' => array(
- 'rank_id' => array('UINT', NULL, 'auto_increment'),
- 'rank_title' => array('VCHAR_UNI', ''),
- 'rank_min' => array('UINT', 0),
- 'rank_special' => array('BOOL', 0),
- 'rank_image' => array('VCHAR', ''),
- ),
- 'PRIMARY_KEY' => 'rank_id',
- );
-
- $schema_data['phpbb_reports'] = array(
- 'COLUMNS' => array(
- 'report_id' => array('UINT', NULL, 'auto_increment'),
- 'reason_id' => array('USINT', 0),
- 'post_id' => array('UINT', 0),
- 'pm_id' => array('UINT', 0),
- 'user_id' => array('UINT', 0),
- 'user_notify' => array('BOOL', 0),
- 'report_closed' => array('BOOL', 0),
- 'report_time' => array('TIMESTAMP', 0),
- 'report_text' => array('MTEXT_UNI', ''),
- ),
- 'PRIMARY_KEY' => 'report_id',
- 'KEYS' => array(
- 'post_id' => array('INDEX', 'post_id'),
- 'pm_id' => array('INDEX', 'pm_id'),
- ),
- );
-
- $schema_data['phpbb_reports_reasons'] = array(
- 'COLUMNS' => array(
- 'reason_id' => array('USINT', NULL, 'auto_increment'),
- 'reason_title' => array('VCHAR_UNI', ''),
- 'reason_description' => array('MTEXT_UNI', ''),
- 'reason_order' => array('USINT', 0),
- ),
- 'PRIMARY_KEY' => 'reason_id',
- );
-
- $schema_data['phpbb_search_results'] = array(
- 'COLUMNS' => array(
- 'search_key' => array('VCHAR:32', ''),
- 'search_time' => array('TIMESTAMP', 0),
- 'search_keywords' => array('MTEXT_UNI', ''),
- 'search_authors' => array('MTEXT', ''),
- ),
- 'PRIMARY_KEY' => 'search_key',
- );
-
- $schema_data['phpbb_search_wordlist'] = array(
- 'COLUMNS' => array(
- 'word_id' => array('UINT', NULL, 'auto_increment'),
- 'word_text' => array('VCHAR_UNI', ''),
- 'word_common' => array('BOOL', 0),
- 'word_count' => array('UINT', 0),
- ),
- 'PRIMARY_KEY' => 'word_id',
- 'KEYS' => array(
- 'wrd_txt' => array('UNIQUE', 'word_text'),
- 'wrd_cnt' => array('INDEX', 'word_count'),
- ),
- );
-
- $schema_data['phpbb_search_wordmatch'] = array(
- 'COLUMNS' => array(
- 'post_id' => array('UINT', 0),
- 'word_id' => array('UINT', 0),
- 'title_match' => array('BOOL', 0),
- ),
- 'KEYS' => array(
- 'unq_mtch' => array('UNIQUE', array('word_id', 'post_id', 'title_match')),
- 'word_id' => array('INDEX', 'word_id'),
- 'post_id' => array('INDEX', 'post_id'),
- ),
- );
-
- $schema_data['phpbb_sessions'] = array(
- 'COLUMNS' => array(
- 'session_id' => array('CHAR:32', ''),
- 'session_user_id' => array('UINT', 0),
- 'session_forum_id' => array('UINT', 0),
- 'session_last_visit' => array('TIMESTAMP', 0),
- 'session_start' => array('TIMESTAMP', 0),
- 'session_time' => array('TIMESTAMP', 0),
- 'session_ip' => array('VCHAR:40', ''),
- 'session_browser' => array('VCHAR:150', ''),
- 'session_forwarded_for' => array('VCHAR:255', ''),
- 'session_page' => array('VCHAR_UNI', ''),
- 'session_viewonline' => array('BOOL', 1),
- 'session_autologin' => array('BOOL', 0),
- 'session_admin' => array('BOOL', 0),
- ),
- 'PRIMARY_KEY' => 'session_id',
- 'KEYS' => array(
- 'session_time' => array('INDEX', 'session_time'),
- 'session_user_id' => array('INDEX', 'session_user_id'),
- 'session_fid' => array('INDEX', 'session_forum_id'),
- ),
- );
-
- $schema_data['phpbb_sessions_keys'] = array(
- 'COLUMNS' => array(
- 'key_id' => array('CHAR:32', ''),
- 'user_id' => array('UINT', 0),
- 'last_ip' => array('VCHAR:40', ''),
- 'last_login' => array('TIMESTAMP', 0),
- ),
- 'PRIMARY_KEY' => array('key_id', 'user_id'),
- 'KEYS' => array(
- 'last_login' => array('INDEX', 'last_login'),
- ),
- );
-
- $schema_data['phpbb_sitelist'] = array(
- 'COLUMNS' => array(
- 'site_id' => array('UINT', NULL, 'auto_increment'),
- 'site_ip' => array('VCHAR:40', ''),
- 'site_hostname' => array('VCHAR', ''),
- 'ip_exclude' => array('BOOL', 0),
- ),
- 'PRIMARY_KEY' => 'site_id',
- );
-
- $schema_data['phpbb_smilies'] = array(
- 'COLUMNS' => array(
- 'smiley_id' => array('UINT', NULL, 'auto_increment'),
- // We may want to set 'code' to VCHAR:50 or check if unicode support is possible... at the moment only ASCII characters are allowed.
- 'code' => array('VCHAR_UNI:50', ''),
- 'emotion' => array('VCHAR_UNI:50', ''),
- 'smiley_url' => array('VCHAR:50', ''),
- 'smiley_width' => array('USINT', 0),
- 'smiley_height' => array('USINT', 0),
- 'smiley_order' => array('UINT', 0),
- 'display_on_posting'=> array('BOOL', 1),
- ),
- 'PRIMARY_KEY' => 'smiley_id',
- 'KEYS' => array(
- 'display_on_post' => array('INDEX', 'display_on_posting'),
- ),
- );
-
- $schema_data['phpbb_styles'] = array(
- 'COLUMNS' => array(
- 'style_id' => array('UINT', NULL, 'auto_increment'),
- 'style_name' => array('VCHAR_UNI:255', ''),
- 'style_copyright' => array('VCHAR_UNI', ''),
- 'style_active' => array('BOOL', 1),
- 'template_id' => array('UINT', 0),
- 'theme_id' => array('UINT', 0),
- 'imageset_id' => array('UINT', 0),
- ),
- 'PRIMARY_KEY' => 'style_id',
- 'KEYS' => array(
- 'style_name' => array('UNIQUE', 'style_name'),
- 'template_id' => array('INDEX', 'template_id'),
- 'theme_id' => array('INDEX', 'theme_id'),
- 'imageset_id' => array('INDEX', 'imageset_id'),
- ),
- );
-
- $schema_data['phpbb_styles_template'] = array(
- 'COLUMNS' => array(
- 'template_id' => array('UINT', NULL, 'auto_increment'),
- 'template_name' => array('VCHAR_UNI:255', ''),
- 'template_copyright' => array('VCHAR_UNI', ''),
- 'template_path' => array('VCHAR:100', ''),
- 'bbcode_bitfield' => array('VCHAR:255', 'kNg='),
- 'template_storedb' => array('BOOL', 0),
- 'template_inherits_id' => array('UINT:4', 0),
- 'template_inherit_path' => array('VCHAR', ''),
- ),
- 'PRIMARY_KEY' => 'template_id',
- 'KEYS' => array(
- 'tmplte_nm' => array('UNIQUE', 'template_name'),
- ),
- );
-
- $schema_data['phpbb_styles_template_data'] = array(
- 'COLUMNS' => array(
- 'template_id' => array('UINT', 0),
- 'template_filename' => array('VCHAR:100', ''),
- 'template_included' => array('TEXT', ''),
- 'template_mtime' => array('TIMESTAMP', 0),
- 'template_data' => array('MTEXT_UNI', ''),
- ),
- 'KEYS' => array(
- 'tid' => array('INDEX', 'template_id'),
- 'tfn' => array('INDEX', 'template_filename'),
- ),
- );
-
- $schema_data['phpbb_styles_theme'] = array(
- 'COLUMNS' => array(
- 'theme_id' => array('UINT', NULL, 'auto_increment'),
- 'theme_name' => array('VCHAR_UNI:255', ''),
- 'theme_copyright' => array('VCHAR_UNI', ''),
- 'theme_path' => array('VCHAR:100', ''),
- 'theme_storedb' => array('BOOL', 0),
- 'theme_mtime' => array('TIMESTAMP', 0),
- 'theme_data' => array('MTEXT_UNI', ''),
- ),
- 'PRIMARY_KEY' => 'theme_id',
- 'KEYS' => array(
- 'theme_name' => array('UNIQUE', 'theme_name'),
- ),
- );
-
- $schema_data['phpbb_styles_imageset'] = array(
- 'COLUMNS' => array(
- 'imageset_id' => array('UINT', NULL, 'auto_increment'),
- 'imageset_name' => array('VCHAR_UNI:255', ''),
- 'imageset_copyright' => array('VCHAR_UNI', ''),
- 'imageset_path' => array('VCHAR:100', ''),
- ),
- 'PRIMARY_KEY' => 'imageset_id',
- 'KEYS' => array(
- 'imgset_nm' => array('UNIQUE', 'imageset_name'),
- ),
- );
-
- $schema_data['phpbb_styles_imageset_data'] = array(
- 'COLUMNS' => array(
- 'image_id' => array('UINT', NULL, 'auto_increment'),
- 'image_name' => array('VCHAR:200', ''),
- 'image_filename' => array('VCHAR:200', ''),
- 'image_lang' => array('VCHAR:30', ''),
- 'image_height' => array('USINT', 0),
- 'image_width' => array('USINT', 0),
- 'imageset_id' => array('UINT', 0),
- ),
- 'PRIMARY_KEY' => 'image_id',
- 'KEYS' => array(
- 'i_d' => array('INDEX', 'imageset_id'),
- ),
- );
-
- $schema_data['phpbb_topics'] = array(
- 'COLUMNS' => array(
- 'topic_id' => array('UINT', NULL, 'auto_increment'),
- 'forum_id' => array('UINT', 0),
- 'icon_id' => array('UINT', 0),
- 'topic_attachment' => array('BOOL', 0),
- 'topic_approved' => array('BOOL', 1),
- 'topic_reported' => array('BOOL', 0),
- 'topic_title' => array('STEXT_UNI', '', 'true_sort'),
- 'topic_poster' => array('UINT', 0),
- 'topic_time' => array('TIMESTAMP', 0),
- 'topic_time_limit' => array('TIMESTAMP', 0),
- 'topic_views' => array('UINT', 0),
- 'topic_replies' => array('UINT', 0),
- 'topic_replies_real' => array('UINT', 0),
- 'topic_status' => array('TINT:3', 0),
- 'topic_type' => array('TINT:3', 0),
- 'topic_first_post_id' => array('UINT', 0),
- 'topic_first_poster_name' => array('VCHAR_UNI', ''),
- 'topic_first_poster_colour' => array('VCHAR:6', ''),
- 'topic_last_post_id' => array('UINT', 0),
- 'topic_last_poster_id' => array('UINT', 0),
- 'topic_last_poster_name' => array('VCHAR_UNI', ''),
- 'topic_last_poster_colour' => array('VCHAR:6', ''),
- 'topic_last_post_subject' => array('STEXT_UNI', ''),
- 'topic_last_post_time' => array('TIMESTAMP', 0),
- 'topic_last_view_time' => array('TIMESTAMP', 0),
- 'topic_moved_id' => array('UINT', 0),
- 'topic_bumped' => array('BOOL', 0),
- 'topic_bumper' => array('UINT', 0),
- 'poll_title' => array('STEXT_UNI', ''),
- 'poll_start' => array('TIMESTAMP', 0),
- 'poll_length' => array('TIMESTAMP', 0),
- 'poll_max_options' => array('TINT:4', 1),
- 'poll_last_vote' => array('TIMESTAMP', 0),
- 'poll_vote_change' => array('BOOL', 0),
- ),
- 'PRIMARY_KEY' => 'topic_id',
- 'KEYS' => array(
- 'forum_id' => array('INDEX', 'forum_id'),
- 'forum_id_type' => array('INDEX', array('forum_id', 'topic_type')),
- 'last_post_time' => array('INDEX', 'topic_last_post_time'),
- 'topic_approved' => array('INDEX', 'topic_approved'),
- 'forum_appr_last' => array('INDEX', array('forum_id', 'topic_approved', 'topic_last_post_id')),
- 'fid_time_moved' => array('INDEX', array('forum_id', 'topic_last_post_time', 'topic_moved_id')),
- ),
- );
-
- $schema_data['phpbb_topics_track'] = array(
- 'COLUMNS' => array(
- 'user_id' => array('UINT', 0),
- 'topic_id' => array('UINT', 0),
- 'forum_id' => array('UINT', 0),
- 'mark_time' => array('TIMESTAMP', 0),
- ),
- 'PRIMARY_KEY' => array('user_id', 'topic_id'),
- 'KEYS' => array(
- 'topic_id' => array('INDEX', 'topic_id'),
- 'forum_id' => array('INDEX', 'forum_id'),
- ),
- );
-
- $schema_data['phpbb_topics_posted'] = array(
- 'COLUMNS' => array(
- 'user_id' => array('UINT', 0),
- 'topic_id' => array('UINT', 0),
- 'topic_posted' => array('BOOL', 0),
- ),
- 'PRIMARY_KEY' => array('user_id', 'topic_id'),
- );
-
- $schema_data['phpbb_topics_watch'] = array(
- 'COLUMNS' => array(
- 'topic_id' => array('UINT', 0),
- 'user_id' => array('UINT', 0),
- 'notify_status' => array('BOOL', 0),
- ),
- 'KEYS' => array(
- 'topic_id' => array('INDEX', 'topic_id'),
- 'user_id' => array('INDEX', 'user_id'),
- 'notify_stat' => array('INDEX', 'notify_status'),
- ),
- );
-
- $schema_data['phpbb_user_group'] = array(
- 'COLUMNS' => array(
- 'group_id' => array('UINT', 0),
- 'user_id' => array('UINT', 0),
- 'group_leader' => array('BOOL', 0),
- 'user_pending' => array('BOOL', 1),
- ),
- 'KEYS' => array(
- 'group_id' => array('INDEX', 'group_id'),
- 'user_id' => array('INDEX', 'user_id'),
- 'group_leader' => array('INDEX', 'group_leader'),
- ),
- );
-
- $schema_data['phpbb_users'] = array(
- 'COLUMNS' => array(
- 'user_id' => array('UINT', NULL, 'auto_increment'),
- 'user_type' => array('TINT:2', 0),
- 'group_id' => array('UINT', 3),
- 'user_permissions' => array('MTEXT', ''),
- 'user_perm_from' => array('UINT', 0),
- 'user_ip' => array('VCHAR:40', ''),
- 'user_regdate' => array('TIMESTAMP', 0),
- 'username' => array('VCHAR_CI', ''),
- 'username_clean' => array('VCHAR_CI', ''),
- 'user_password' => array('VCHAR_UNI:40', ''),
- 'user_passchg' => array('TIMESTAMP', 0),
- 'user_pass_convert' => array('BOOL', 0),
- 'user_email' => array('VCHAR_UNI:100', ''),
- 'user_email_hash' => array('BINT', 0),
- 'user_birthday' => array('VCHAR:10', ''),
- 'user_lastvisit' => array('TIMESTAMP', 0),
- 'user_lastmark' => array('TIMESTAMP', 0),
- 'user_lastpost_time' => array('TIMESTAMP', 0),
- 'user_lastpage' => array('VCHAR_UNI:200', ''),
- 'user_last_confirm_key' => array('VCHAR:10', ''),
- 'user_last_search' => array('TIMESTAMP', 0),
- 'user_warnings' => array('TINT:4', 0),
- 'user_last_warning' => array('TIMESTAMP', 0),
- 'user_login_attempts' => array('TINT:4', 0),
- 'user_inactive_reason' => array('TINT:2', 0),
- 'user_inactive_time' => array('TIMESTAMP', 0),
- 'user_posts' => array('UINT', 0),
- 'user_lang' => array('VCHAR:30', ''),
- 'user_timezone' => array('DECIMAL', 0),
- 'user_dst' => array('BOOL', 0),
- 'user_dateformat' => array('VCHAR_UNI:30', 'd M Y H:i'),
- 'user_style' => array('UINT', 0),
- 'user_rank' => array('UINT', 0),
- 'user_colour' => array('VCHAR:6', ''),
- 'user_new_privmsg' => array('INT:4', 0),
- 'user_unread_privmsg' => array('INT:4', 0),
- 'user_last_privmsg' => array('TIMESTAMP', 0),
- 'user_message_rules' => array('BOOL', 0),
- 'user_full_folder' => array('INT:11', -3),
- 'user_emailtime' => array('TIMESTAMP', 0),
- 'user_topic_show_days' => array('USINT', 0),
- 'user_topic_sortby_type' => array('VCHAR:1', 't'),
- 'user_topic_sortby_dir' => array('VCHAR:1', 'd'),
- 'user_post_show_days' => array('USINT', 0),
- 'user_post_sortby_type' => array('VCHAR:1', 't'),
- 'user_post_sortby_dir' => array('VCHAR:1', 'a'),
- 'user_notify' => array('BOOL', 0),
- 'user_notify_pm' => array('BOOL', 1),
- 'user_notify_type' => array('TINT:4', 0),
- 'user_allow_pm' => array('BOOL', 1),
- 'user_allow_viewonline' => array('BOOL', 1),
- 'user_allow_viewemail' => array('BOOL', 1),
- 'user_allow_massemail' => array('BOOL', 1),
- 'user_options' => array('UINT:11', 230271),
- 'user_avatar' => array('VCHAR', ''),
- 'user_avatar_type' => array('TINT:2', 0),
- 'user_avatar_width' => array('USINT', 0),
- 'user_avatar_height' => array('USINT', 0),
- 'user_sig' => array('MTEXT_UNI', ''),
- 'user_sig_bbcode_uid' => array('VCHAR:8', ''),
- 'user_sig_bbcode_bitfield' => array('VCHAR:255', ''),
- 'user_from' => array('VCHAR_UNI:100', ''),
- 'user_icq' => array('VCHAR:15', ''),
- 'user_aim' => array('VCHAR_UNI', ''),
- 'user_yim' => array('VCHAR_UNI', ''),
- 'user_msnm' => array('VCHAR_UNI', ''),
- 'user_jabber' => array('VCHAR_UNI', ''),
- 'user_website' => array('VCHAR_UNI:200', ''),
- 'user_occ' => array('TEXT_UNI', ''),
- 'user_interests' => array('TEXT_UNI', ''),
- 'user_actkey' => array('VCHAR:32', ''),
- 'user_newpasswd' => array('VCHAR_UNI:40', ''),
- 'user_form_salt' => array('VCHAR_UNI:32', ''),
- 'user_new' => array('BOOL', 1),
- 'user_reminded' => array('TINT:4', 0),
- 'user_reminded_time' => array('TIMESTAMP', 0),
- ),
- 'PRIMARY_KEY' => 'user_id',
- 'KEYS' => array(
- 'user_birthday' => array('INDEX', 'user_birthday'),
- 'user_email_hash' => array('INDEX', 'user_email_hash'),
- 'user_type' => array('INDEX', 'user_type'),
- 'username_clean' => array('UNIQUE', 'username_clean'),
- ),
- );
-
- $schema_data['phpbb_warnings'] = array(
- 'COLUMNS' => array(
- 'warning_id' => array('UINT', NULL, 'auto_increment'),
- 'user_id' => array('UINT', 0),
- 'post_id' => array('UINT', 0),
- 'log_id' => array('UINT', 0),
- 'warning_time' => array('TIMESTAMP', 0),
- ),
- 'PRIMARY_KEY' => 'warning_id',
- );
-
- $schema_data['phpbb_words'] = array(
- 'COLUMNS' => array(
- 'word_id' => array('UINT', NULL, 'auto_increment'),
- 'word' => array('VCHAR_UNI', ''),
- 'replacement' => array('VCHAR_UNI', ''),
- ),
- 'PRIMARY_KEY' => 'word_id',
- );
-
- $schema_data['phpbb_zebra'] = array(
- 'COLUMNS' => array(
- 'user_id' => array('UINT', 0),
- 'zebra_id' => array('UINT', 0),
- 'friend' => array('BOOL', 0),
- 'foe' => array('BOOL', 0),
- ),
- 'PRIMARY_KEY' => array('user_id', 'zebra_id'),
- );
-
- return $schema_data;
-}
-
-
-/**
-* Data put into the header for various dbms
-*/
-function custom_data($dbms)
-{
- switch ($dbms)
- {
- case 'oracle':
- return <<<EOF
-/*
- This first section is optional, however its probably the best method
- of running phpBB on Oracle. If you already have a tablespace and user created
- for phpBB you can leave this section commented out!
-
- The first set of statements create a phpBB tablespace and a phpBB user,
- make sure you change the password of the phpBB user before you run this script!!
-*/
-
-/*
-CREATE TABLESPACE "PHPBB"
- LOGGING
- DATAFILE 'E:\ORACLE\ORADATA\LOCAL\PHPBB.ora'
- SIZE 10M
- AUTOEXTEND ON NEXT 10M
- MAXSIZE 100M;
-
-CREATE USER "PHPBB"
- PROFILE "DEFAULT"
- IDENTIFIED BY "phpbb_password"
- DEFAULT TABLESPACE "PHPBB"
- QUOTA UNLIMITED ON "PHPBB"
- ACCOUNT UNLOCK;
-
-GRANT ANALYZE ANY TO "PHPBB";
-GRANT CREATE SEQUENCE TO "PHPBB";
-GRANT CREATE SESSION TO "PHPBB";
-GRANT CREATE TABLE TO "PHPBB";
-GRANT CREATE TRIGGER TO "PHPBB";
-GRANT CREATE VIEW TO "PHPBB";
-GRANT "CONNECT" TO "PHPBB";
-
-COMMIT;
-DISCONNECT;
-
-CONNECT phpbb/phpbb_password;
-*/
-EOF;
-
- break;
-
- case 'postgres':
- return <<<EOF
-/*
- Domain definition
-*/
-CREATE DOMAIN varchar_ci AS varchar(255) NOT NULL DEFAULT ''::character varying;
-
-/*
- Operation Functions
-*/
-CREATE FUNCTION _varchar_ci_equal(varchar_ci, varchar_ci) RETURNS boolean AS 'SELECT LOWER($1) = LOWER($2)' LANGUAGE SQL STRICT;
-CREATE FUNCTION _varchar_ci_not_equal(varchar_ci, varchar_ci) RETURNS boolean AS 'SELECT LOWER($1) != LOWER($2)' LANGUAGE SQL STRICT;
-CREATE FUNCTION _varchar_ci_less_than(varchar_ci, varchar_ci) RETURNS boolean AS 'SELECT LOWER($1) < LOWER($2)' LANGUAGE SQL STRICT;
-CREATE FUNCTION _varchar_ci_less_equal(varchar_ci, varchar_ci) RETURNS boolean AS 'SELECT LOWER($1) <= LOWER($2)' LANGUAGE SQL STRICT;
-CREATE FUNCTION _varchar_ci_greater_than(varchar_ci, varchar_ci) RETURNS boolean AS 'SELECT LOWER($1) > LOWER($2)' LANGUAGE SQL STRICT;
-CREATE FUNCTION _varchar_ci_greater_equals(varchar_ci, varchar_ci) RETURNS boolean AS 'SELECT LOWER($1) >= LOWER($2)' LANGUAGE SQL STRICT;
-
-/*
- Operators
-*/
-CREATE OPERATOR <(
- PROCEDURE = _varchar_ci_less_than,
- LEFTARG = varchar_ci,
- RIGHTARG = varchar_ci,
- COMMUTATOR = >,
- NEGATOR = >=,
- RESTRICT = scalarltsel,
- JOIN = scalarltjoinsel);
-
-CREATE OPERATOR <=(
- PROCEDURE = _varchar_ci_less_equal,
- LEFTARG = varchar_ci,
- RIGHTARG = varchar_ci,
- COMMUTATOR = >=,
- NEGATOR = >,
- RESTRICT = scalarltsel,
- JOIN = scalarltjoinsel);
-
-CREATE OPERATOR >(
- PROCEDURE = _varchar_ci_greater_than,
- LEFTARG = varchar_ci,
- RIGHTARG = varchar_ci,
- COMMUTATOR = <,
- NEGATOR = <=,
- RESTRICT = scalargtsel,
- JOIN = scalargtjoinsel);
-
-CREATE OPERATOR >=(
- PROCEDURE = _varchar_ci_greater_equals,
- LEFTARG = varchar_ci,
- RIGHTARG = varchar_ci,
- COMMUTATOR = <=,
- NEGATOR = <,
- RESTRICT = scalargtsel,
- JOIN = scalargtjoinsel);
-
-CREATE OPERATOR <>(
- PROCEDURE = _varchar_ci_not_equal,
- LEFTARG = varchar_ci,
- RIGHTARG = varchar_ci,
- COMMUTATOR = <>,
- NEGATOR = =,
- RESTRICT = neqsel,
- JOIN = neqjoinsel);
-
-CREATE OPERATOR =(
- PROCEDURE = _varchar_ci_equal,
- LEFTARG = varchar_ci,
- RIGHTARG = varchar_ci,
- COMMUTATOR = =,
- NEGATOR = <>,
- RESTRICT = eqsel,
- JOIN = eqjoinsel,
- HASHES,
- MERGES,
- SORT1= <);
-
-EOF;
- break;
- }
-
- return '';
-}
+$db = new \phpbb\db\driver\sqlite();
+$schema_generator = new \phpbb\db\migration\schema_generator($classes, new \phpbb\config\config(array()), $db, new \phpbb\db\tools($db, true), $phpbb_root_path, $phpEx, $table_prefix);
+$schema_data = $schema_generator->get_schema();
-echo 'done';
+$fp = fopen($schema_path . 'schema.json', 'wb');
+fwrite($fp, json_encode($schema_data, JSON_PRETTY_PRINT));
+fclose($fp);
+echo 'Successfully created schema file';
diff --git a/phpBB/develop/create_search_index.php b/phpBB/develop/create_search_index.php
index c1a7125d61..9b79a35a84 100644
--- a/phpBB/develop/create_search_index.php
+++ b/phpBB/develop/create_search_index.php
@@ -1,9 +1,13 @@
<?php
/**
*
-* @package phpBB3
-* @copyright (c) 2011 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -25,7 +29,6 @@ $phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : '../';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
require($phpbb_root_path . 'common.' . $phpEx);
require($phpbb_root_path . 'includes/acp/acp_search.' . $phpEx);
-require($phpbb_root_path . 'includes/search/' . $class_name . '.' . $phpEx);
$user->session_begin();
$auth->acl($user->data);
diff --git a/phpBB/develop/create_variable_overview.php b/phpBB/develop/create_variable_overview.php
index f926d79eb5..ace2e4d953 100644
--- a/phpBB/develop/create_variable_overview.php
+++ b/phpBB/develop/create_variable_overview.php
@@ -1,13 +1,19 @@
<?php
/**
*
-* @package phpBB3
-* @copyright (c) 2003 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+/**
* This script generates an index of some template vars and their use within the templates.
* It writes down all language variables used by various templates.
-*
*/
//
@@ -38,7 +44,7 @@ fwrite($fp, $contents);
fclose($fp);
$html_skeleton = '
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="subSilver.css" type="text/css">
@@ -77,7 +83,7 @@ $html_skeleton .= '<br><br><a name="ref"></a><b>References: </b>{SEE_FILES}';
$html_skeleton .= '
<br><br>
-<div class="copyright" align="center">Powered by <a href="http://www.phpbb.com/">phpBB</a>&reg; Forum Software &copy; phpBB Group</div>
+<div class="copyright" align="center">Powered by <a href="http://www.phpbb.com/">phpBB</a>&reg; Forum Software &copy; phpBB Limited</div>
<br clear="all" /></td>
</tr>
@@ -356,7 +362,7 @@ echo '<br>Store Files';
$fp = fopen($store_dir . 'index.html', 'w');
$html_data = '
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="subSilver.css" type="text/css">
@@ -399,7 +405,7 @@ $html_data .= '<br><li><a href="./lang_index.html" class="gen">Appendix A: Langu
$html_data .= '
</ol><br><br>
-<div class="copyright" align="center">Powered by <a href="http://www.phpbb.com/">phpBB</a>&reg; Forum Software &copy; phpBB Group</div>
+<div class="copyright" align="center">Powered by <a href="http://www.phpbb.com/">phpBB</a>&reg; Forum Software &copy; phpBB Limited</div>
<br clear="all" /></td>
</tr>
@@ -421,7 +427,7 @@ fwrite($common_fp, "<?php\n\n \$lang = array(\n");
$fp = fopen($store_dir . 'lang_index.html', 'w');
$html_data = '
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="subSilver.css" type="text/css">
@@ -522,7 +528,7 @@ foreach ($lang_fp as $filepointer)
$html_data .= '
<br><br>
-<div class="copyright" align="center">Powered by <a href="http://www.phpbb.com/">phpBB</a>&reg; Forum Software &copy; phpBB Group</div>
+<div class="copyright" align="center">Powered by <a href="http://www.phpbb.com/">phpBB</a>&reg; Forum Software &copy; phpBB Limited</div>
<br clear="all" /></td>
</tr>
@@ -537,5 +543,3 @@ fclose($fp);
echo '<br>Finished!';
flush();
-
-?> \ No newline at end of file
diff --git a/phpBB/develop/export_events_for_wiki.php b/phpBB/develop/export_events_for_wiki.php
new file mode 100644
index 0000000000..be16e5e7cd
--- /dev/null
+++ b/phpBB/develop/export_events_for_wiki.php
@@ -0,0 +1,138 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+if (php_sapi_name() != 'cli')
+{
+ die("This program must be run from the command line.\n");
+}
+
+$phpEx = substr(strrchr(__FILE__, '.'), 1);
+$phpbb_root_path = __DIR__ . '/../';
+define('IN_PHPBB', true);
+
+function usage()
+{
+ echo "Usage: export_events_for_wiki.php COMMAND [VERSION] [EXTENSION]\n";
+ echo "\n";
+ echo "COMMAND:\n";
+ echo " all:\n";
+ echo " Generate the complete wikipage for https://wiki.phpbb.com/Event_List\n";
+ echo "\n";
+ echo " diff:\n";
+ echo " Generate the Event Diff for the release highlights\n";
+ echo "\n";
+ echo " php:\n";
+ echo " Generate the PHP event section of Event_List\n";
+ echo "\n";
+ echo " adm:\n";
+ echo " Generate the ACP Template event section of Event_List\n";
+ echo "\n";
+ echo " styles:\n";
+ echo " Generate the Styles Template event section of Event_List\n";
+ echo "\n";
+ echo "VERSION (diff only):\n";
+ echo " Filter events (minimum version)\n";
+ echo "\n";
+ echo "EXTENSION (Optional):\n";
+ echo " If not given, only core events will be exported.\n";
+ echo " Otherwise only events from the extension will be exported.\n";
+ echo "\n";
+ exit(2);
+}
+
+function validate_argument_count($arguments, $count)
+{
+ if ($arguments <= $count)
+ {
+ usage();
+ }
+}
+
+validate_argument_count($argc, 1);
+
+$action = $argv[1];
+$extension = isset($argv[2]) ? $argv[2] : null;
+$min_version = null;
+require __DIR__ . '/../phpbb/event/php_exporter.' . $phpEx;
+require __DIR__ . '/../phpbb/event/md_exporter.' . $phpEx;
+require __DIR__ . '/../includes/functions.' . $phpEx;
+require __DIR__ . '/../phpbb/event/recursive_event_filter_iterator.' . $phpEx;
+require __DIR__ . '/../phpbb/recursive_dot_prefix_filter_iterator.' . $phpEx;
+
+switch ($action)
+{
+
+ case 'diff':
+ echo '== Event changes ==' . "\n";
+ $min_version = $extension;
+ $extension = isset($argv[3]) ? $argv[3] : null;
+
+ case 'all':
+ if ($action === 'all')
+ {
+ echo '__FORCETOC__' . "\n";
+ }
+
+
+ case 'php':
+ $exporter = new \phpbb\event\php_exporter($phpbb_root_path, $extension, $min_version);
+ $exporter->crawl_phpbb_directory_php();
+ echo $exporter->export_events_for_wiki($action);
+
+ if ($action === 'php')
+ {
+ break;
+ }
+ echo "\n";
+ // no break;
+
+ case 'styles':
+ $exporter = new \phpbb\event\md_exporter($phpbb_root_path, $extension, $min_version);
+ if ($min_version && $action === 'diff')
+ {
+ $exporter->crawl_eventsmd('docs/events.md', 'styles');
+ }
+ else
+ {
+ $exporter->crawl_phpbb_directory_styles('docs/events.md');
+ }
+ echo $exporter->export_events_for_wiki($action);
+
+ if ($action === 'styles')
+ {
+ break;
+ }
+ echo "\n";
+ // no break;
+
+ case 'adm':
+ $exporter = new \phpbb\event\md_exporter($phpbb_root_path, $extension, $min_version);
+ if ($min_version && $action === 'diff')
+ {
+ $exporter->crawl_eventsmd('docs/events.md', 'adm');
+ }
+ else
+ {
+ $exporter->crawl_phpbb_directory_adm('docs/events.md');
+ }
+ echo $exporter->export_events_for_wiki($action);
+
+ if ($action === 'all')
+ {
+ echo "\n" . '[[Category:Events and Listeners]]' . "\n";
+ }
+ break;
+
+ default:
+ usage();
+}
diff --git a/phpBB/develop/fill.php b/phpBB/develop/fill.php
index e0d054d073..6d08e9c206 100644
--- a/phpBB/develop/fill.php
+++ b/phpBB/develop/fill.php
@@ -1,9 +1,13 @@
<?php
/**
*
-* @package phpBB3
-* @copyright (c) 2001, 2003 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -38,8 +42,8 @@ $posts_per_topic = 500;
// general vars
-$mode = (isset($_REQUEST['mode'])) ? $_REQUEST['mode'] : 'generate';
-$start = (isset($_REQUEST['start'])) ? intval($_REQUEST['start']) : 0;
+$mode = request_var('mode', 'generate');
+$start = request_var('start', 0);
switch ($mode)
{
@@ -86,7 +90,7 @@ switch ($mode)
$topic_rows[] = "($topic_id, $forum_id, '$forum_id-$topic_id', " . (($topic_id % 34) ? '0' : '1') . ')';
- $sql = 'INSERT IGNORE INTO ' . POSTS_TABLE . ' (topic_id, forum_id, poster_id, post_subject, post_text, post_username, post_approved, post_time, post_reported)
+ $sql = 'INSERT IGNORE INTO ' . POSTS_TABLE . ' (topic_id, forum_id, poster_id, post_subject, post_text, post_username, post_visibility, post_time, post_reported)
VALUES ';
$rows = array();
@@ -183,5 +187,3 @@ function rndm_username()
return $usernames[array_rand($usernames)];
}
-
-?> \ No newline at end of file
diff --git a/phpBB/develop/generate_utf_casefold.php b/phpBB/develop/generate_utf_casefold.php
index 08f67c3eb6..3412ddd106 100644
--- a/phpBB/develop/generate_utf_casefold.php
+++ b/phpBB/develop/generate_utf_casefold.php
@@ -1,9 +1,13 @@
<?php
/**
*
-* @package phpBB3
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -151,5 +155,3 @@ function download($url)
echo "\n";
}
-
-?> \ No newline at end of file
diff --git a/phpBB/develop/generate_utf_confusables.php b/phpBB/develop/generate_utf_confusables.php
index fd0439a4bb..9c9109259b 100644
--- a/phpBB/develop/generate_utf_confusables.php
+++ b/phpBB/develop/generate_utf_confusables.php
@@ -1,9 +1,13 @@
<?php
/**
*
-* @package phpBB3
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -239,5 +243,3 @@ function download($url)
echo "\n";
}
-
-?> \ No newline at end of file
diff --git a/phpBB/develop/generate_utf_tables.php b/phpBB/develop/generate_utf_tables.php
index 6372270b78..16a449679b 100644
--- a/phpBB/develop/generate_utf_tables.php
+++ b/phpBB/develop/generate_utf_tables.php
@@ -1,9 +1,13 @@
<?php
/**
*
-* @package phpBB3
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -568,4 +572,4 @@ function cp_to_utf($cp)
{
return chr($cp);
}
-} \ No newline at end of file
+}
diff --git a/phpBB/develop/imageset_to_css.php b/phpBB/develop/imageset_to_css.php
new file mode 100644
index 0000000000..d49fe9c741
--- /dev/null
+++ b/phpBB/develop/imageset_to_css.php
@@ -0,0 +1,374 @@
+<?php
+
+/*
+ Converts imageset to CSS code
+
+ Change style name and path below, open in browser.
+*/
+
+$phpbb_root_path = '../';
+$style = 'subsilver2';
+
+$imageset_path = $phpbb_root_path . 'styles/' . $style . '/imageset';
+$theme_path = $phpbb_root_path . 'styles/' . $style . '/theme';
+
+// Start output buffering
+ob_start();
+
+// Get global and English images
+$images_global = get_imageset($imageset_path);
+if ($images_global === false)
+{
+ echo 'imageset.cfg was not found.';
+ echo ob_get_clean();
+ return;
+}
+$images_en = get_imageset($imageset_path, 'en');
+if ($images_en === false)
+{
+ echo 'English imageset.cfg was not found.';
+ echo ob_get_clean();
+ return;
+}
+
+// Remove duplicate images
+foreach ($images_en as $key => $row)
+{
+ unset($images_global[$key]);
+}
+
+// CSS replacements
+$not_compatible = array(
+ '{T_TEMPLATE_PATH}',
+ '{T_IMAGESET_PATH}',
+ '{T_IMAGESET_LANG_PATH}',
+ '{T_STYLESHEET_NAME}',
+ '{S_USER_LANG}'
+);
+$replace = array(
+ '{T_THEME_PATH}' => '.',
+);
+// Enable/disable one of lines below to enable/disable replacement of English buttons
+// $replace = array_merge($replace, get_replacements($images_global));
+$replace = array_merge($replace, get_replacements($images_global), get_replacements($images_en));
+
+// BIDI code
+$bidi_code = css($images_global, './images/', true);
+
+// Get all CSS files, parse them
+$files = list_files($theme_path, 'css');
+if ($files === false || !count($files))
+{
+ echo 'No CSS files found in theme directory.<br />';
+}
+else for ($i=0; $i<count($files); $i++)
+{
+ $file = $theme_path . '/' . $files[$i];
+ $data = file_get_contents($file);
+ $hash = md5($data);
+ $data = strtr($data, $replace);
+ $errors = false;
+ for($j=0; $j<count($not_compatible); $j++)
+ {
+ if (strpos($data, $not_compatible[$j]) !== false)
+ {
+ echo 'Error: ', $file, ' contains ', $not_compatible[$j], '. That variable cannot be converted.<br />';
+ continue;
+ }
+ }
+ if (basename($file) == 'bidi.css' && strpos($data, '/* Former imageset */') === false && strlen($bidi_code))
+ {
+ // Add bidi data
+ $data .= "\n/* Former imageset */\n" . $bidi_code;
+ $bidi_code = '';
+ echo 'Note: RTL imageset entries were added at the end of file below:<br />';
+ }
+ if (md5($data) == $hash)
+ {
+ echo 'Nothing to replace in ', $file, '<br />';
+ }
+ else
+ {
+ echo 'Updated ', $file, ':', dump_code($data, $files[$i]);
+ }
+}
+
+// Check if there are invalid images in imageset
+$list = array_merge($images_global, $images_en);
+foreach ($list as $key => $row)
+{
+ if ($row['skip'])
+ {
+ echo 'Unable to generate code to add to CSS files because some images are missing or invalid. See errors above.';
+ echo ob_get_clean();
+ return;
+ }
+}
+
+// Code to add to CSS files
+$code = '
+/* Former imageset */
+span.imageset {
+ display: inline-block;
+ background: transparent none 0 0 no-repeat;
+ margin: 0;
+ padding: 0;
+ width: 0;
+ height: 0;
+ overflow: hidden;
+}
+
+/* Global imageset items */
+' . css($images_global, './images/') . '
+
+/* English images for fallback */
+' . css($images_en, './en/');
+if (strlen($bidi_code))
+{
+ $code .= "\n/* RTL imageset entries */\n" . $bidi_code;
+}
+echo 'Code to add to CSS file:', dump_code($code, 'imageset.css');
+
+
+$list = list_languages($imageset_path);
+for ($i=0; $i<count($list); $i++)
+{
+ $lang = $list[$i];
+ $images = get_imageset($imageset_path . '/' . $lang);
+ if (!count($images))
+ {
+ continue;
+ }
+ $code = '/* ' . strtoupper($lang) . ' Language Pack */
+' . css($images, './');
+ echo 'New CSS file: ', $theme_path, '/', $lang, '/stylesheet.css', dump_code($code, 'stylesheet_' . $lang . '.css');
+}
+
+echo ob_get_clean();
+return;
+
+
+/*
+ Functions
+*/
+function get_imageset($path, $lang = '')
+{
+ $cfg = $path . ($lang ? '/' . $lang : '') . '/imageset.cfg';
+ if (!@file_exists($cfg))
+ {
+ return false;
+ }
+ $data = file($cfg);
+ $result = array();
+ for ($i=0; $i<count($data); $i++)
+ {
+ $str = trim($data[$i]);
+ if (substr($str, 0, 4) != 'img_')
+ {
+ continue;
+ }
+ $list = explode('=', $data[$i]);
+ if (count($list) != 2)
+ {
+ continue;
+ }
+ $key = trim($list[0]);
+ $row = explode('*', trim($list[1]));
+ $file = trim($row[0]);
+ $height = isset($row[1]) && intval($row[1]) ? intval($row[1]) : false;
+ $width = isset($row[2]) && intval($row[2]) ? intval($row[2]) : false;
+ $skip = false;
+ if (strlen($file) && (!$width || !$height))
+ {
+ // Try to detect width/height
+ $filename = $path . ($lang ? '/' . $lang : '') . '/' . $file;
+ if (!@file_exists($filename))
+ {
+ echo 'Error: file ', $filename, ' does not exist and its dimensions are not available in imageset.cfg<br />';
+ $skip = true;
+ }
+ else
+ {
+ $size = @getimagesize($filename);
+ if ($size === false)
+ {
+ echo 'Error: file ', $filename, ' is not a valid image<br />';
+ $skip = true;
+ }
+ else
+ {
+ if(!$width) $width = intval($size[0]);
+ if(!$height) $height = intval($size[1]);
+ }
+ }
+ }
+ $result[$key] = array(
+ 'lang' => $lang,
+ 'file' => $file,
+ 'height' => $height,
+ 'width' => $width,
+ 'skip' => $skip
+ );
+ }
+ return $result;
+}
+
+function get_replacements($list)
+{
+ $result = array();
+ foreach ($list as $key => $row)
+ {
+ $key = '{' . strtoupper($key);
+ $result[$key . '_SRC}'] = strlen($row['file']) ? ($row['lang'] ? './' . $row['lang'] : './images') . '/' . $row['file'] : '';
+ $result[$key . '_WIDTH}'] = intval($row['width']);
+ $result[$key . '_HEIGHT}'] = intval($row['height']);
+ }
+ return $result;
+}
+
+function list_files($dir, $ext)
+{
+ $res = @opendir($dir);
+ if ($res === false)
+ {
+ return false;
+ }
+ $files = array();
+ while (($file = readdir($res)) !== false)
+ {
+ $list = explode('.', $file);
+ if(count($list) > 1 && strtolower($list[count($list) - 1]) == $ext)
+ {
+ $files[] = $file;
+ }
+ }
+ closedir($res);
+ return $files;
+}
+
+function list_languages($dir)
+{
+ $res = @opendir($dir);
+ if ($res === false)
+ {
+ return array();
+ }
+ $files = array();
+ while (($file = readdir($res)) !== false)
+ {
+ if (substr($file, 0, 1) == '.')
+ {
+ continue;
+ }
+ $filename = $dir . '/' . $file;
+ if (is_dir($filename) && file_exists($filename . '/imageset.cfg'))
+ {
+ $files[] = $file;
+ }
+ }
+ closedir($res);
+ return $files;
+}
+
+function dump_code($code, $filename = 'file.txt')
+{
+ $hash = md5($code);
+ if (isset($_GET['download']) && $_GET['download'] === $hash)
+ {
+ // Download file
+ ob_end_clean();
+ header('Pragma: public');
+ header('Expires: 0');
+ header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
+ header('Content-Type: application/force-download');
+ header('Content-Disposition: attachment; filename="' . $filename . '";');
+ header('Content-Transfer-Encoding: binary');
+ header('Content-Length: ' . strlen($code));
+ echo $code;
+ exit;
+ }
+ $list = explode("\n", $code);
+ $height = 15 * count($list);
+ echo ' [ <a href="?download=', $hash, '">download</a> <a href="javascript:void(0);" onclick="document.getElementById(\'code-', $hash, '\').style.height = \'', $height, 'px\'; this.style.display = \'none\'; return false;">expand</a> ]<br />';
+ echo '<textarea id="code-', $hash, '" onfocus="this.select();" style="width: 98%; height: 200px;">', htmlspecialchars($code), '</textarea><br />';
+}
+
+function css($list, $path = './', $bidi = false)
+{
+ $code = '';
+ // Change value to true if you want images to be grouped up by size
+ $group = $bidi;
+ if ($group)
+ {
+ // group up images by size
+ $groups = array();
+ foreach ($list as $key => $row)
+ {
+ if (!strlen($row['file']))
+ {
+ continue;
+ }
+ $groups[$row['width'] . '*' . $row['height']][] = $key;
+ }
+ foreach ($groups as $size => $keys)
+ {
+ $extra = '';
+ for ($i=0; $i<count($keys); $i++)
+ {
+ $code .= ($i == 0 ? '' : ', ') . ($bidi ? '.rtl ' : '') . '.imageset.' . substr($keys[$i], 4);
+ if (!$bidi)
+ {
+ $extra .= '.imageset.' . substr($keys[$i], 4) . ' { background-image: url("' . $path . $list[$keys[$i]]['file'] . "\"); }\n";
+ }
+ }
+ $row = $list[$keys[0]];
+ $code .= ' {';
+ if ($bidi)
+ {
+ $code .= '
+ padding-right: ' . $row['width'] . 'px;
+ padding-left: 0;
+}
+';
+ }
+ else
+ {
+ $code .= '
+ padding-left: ' . $row['width'] . 'px;
+ padding-top: ' . $row['height'] . 'px;
+}
+' . $extra;
+ }
+ }
+ }
+ else
+ {
+ foreach ($list as $key => $row)
+ {
+ if (!strlen($row['file']))
+ {
+ continue;
+ }
+ $code .= ($bidi ? '.rtl ' : '') . '.imageset.' . substr($key, 4) . ' {';
+ if ($bidi)
+ {
+ $code .= '
+ padding-right: ' . $row['width'] . 'px;
+ padding-left: 0;
+}
+';
+ }
+ else
+ {
+ $code .= '
+ background-image: url("' . $path . $row['file'] . '");
+ padding-left: ' . $row['width'] . 'px;
+ padding-top: ' . $row['height'] . 'px;
+}
+';
+ }
+ }
+ }
+ return $code;
+}
+
diff --git a/phpBB/develop/lang_duplicates.php b/phpBB/develop/lang_duplicates.php
index 5be48f69f0..5981882292 100644
--- a/phpBB/develop/lang_duplicates.php
+++ b/phpBB/develop/lang_duplicates.php
@@ -15,10 +15,11 @@ die("Please read the first lines of this script for instructions on how to enabl
// -------------------------------------------------------------
//
-// $Id$
+// @copyright (c) phpBB Limited <https://www.phpbb.com>
+// @license GNU General Public License, version 2 (GPL-2.0)
//
-// @copyright (c) 2005 phpBB Group
-// @license http://opensource.org/licenses/gpl-license.php GNU Public License
+// For full copyright and license information, please see
+// the docs/CREDITS.txt file.
//
// -------------------------------------------------------------
// Thanks to arod-1
@@ -137,4 +138,4 @@ function find_modules($dirname)
?>
</body>
-</html> \ No newline at end of file
+</html>
diff --git a/phpBB/develop/merge_attachment_tables.php b/phpBB/develop/merge_attachment_tables.php
index 0186b3cc8b..dd6e12172e 100644
--- a/phpBB/develop/merge_attachment_tables.php
+++ b/phpBB/develop/merge_attachment_tables.php
@@ -1,9 +1,13 @@
<?php
/**
*
-* @package phpBB3
-* @copyright (c) 2001, 2003 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -44,7 +48,7 @@ $sql = "CREATE TABLE {$table_prefix}attachments
AND a.post_id = p.post_id";
$db->sql_query($sql);
-switch ($db->sql_layer)
+switch ($db->get_sql_layer())
{
case 'mysql':
case 'mysql4':
@@ -72,5 +76,3 @@ $db->sql_query($sql);
//$db->sql_query("DROP TABLE {$table_prefix}attach_temp");
echo "<p><b>Done</b></p>\n";
-
-?> \ No newline at end of file
diff --git a/phpBB/develop/merge_post_tables.php b/phpBB/develop/merge_post_tables.php
index 2d99d725d0..9e81917108 100644
--- a/phpBB/develop/merge_post_tables.php
+++ b/phpBB/develop/merge_post_tables.php
@@ -1,9 +1,13 @@
<?php
/**
*
-* @package phpBB3
-* @copyright (c) 2003 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -42,7 +46,7 @@ $sql = "CREATE TABLE {$table_prefix}posts
WHERE pt.post_id = p.post_id";
$db->sql_query($sql);
-switch ($db->sql_layer)
+switch ($db->get_sql_layer())
{
case 'mysql':
case 'mysql4':
@@ -50,7 +54,7 @@ switch ($db->sql_layer)
ADD PRIMARY KEY (post_id),
ADD INDEX topic_id (topic_id),
ADD INDEX poster_ip (poster_ip),
- ADD INDEX post_approved (post_approved),
+ ADD INDEX post_visibility (post_visibility),
MODIFY COLUMN post_id mediumint(8) UNSIGNED NOT NULL auto_increment,
ADD COLUMN post_encoding varchar(11) DEFAULT \'iso-8859-15\' NOT NULL';
break;
@@ -138,7 +142,7 @@ while ($row = $db->sql_fetchrow($result))
}
$db->sql_freeresult($result);
-switch ($db->sql_layer)
+switch ($db->get_sql_layer())
{
case 'oracle':
$sql = "SELECT f.*, p.post_time, p.post_username, u.username, u.user_id
@@ -162,7 +166,7 @@ while ($row = $db->sql_fetchrow($result))
$forum_id = $row['forum_id'];
$sql_ary[] = "UPDATE " . $table_prefix . "forums
- SET forum_last_poster_id = " . ((!empty($row['user_id']) && $row['user_id'] != ANONYMOUS) ? $row['user_id'] : ANONYMOUS) . ", forum_last_poster_name = '" . ((!empty($row['user_id']) && $row['user_id'] != ANONYMOUS) ? addslashes($row['username']) : addslashes($row['post_username'])) . "', forum_last_post_time = " . $row['post_time'] . ", forum_posts = " . (($post_count[$forum_id]) ? $post_count[$forum_id] : 0) . ", forum_topics = " . (($topic_count[$forum_id]) ? $topic_count[$forum_id] : 0) . "
+ SET forum_last_poster_id = " . ((!empty($row['user_id']) && $row['user_id'] != ANONYMOUS) ? $row['user_id'] : ANONYMOUS) . ", forum_last_poster_name = '" . ((!empty($row['user_id']) && $row['user_id'] != ANONYMOUS) ? addslashes($row['username']) : addslashes($row['post_username'])) . "', forum_last_post_time = " . $row['post_time'] . ", forum_posts_approved = " . (($post_count[$forum_id]) ? $post_count[$forum_id] : 0) . ", forum_topics_approved = " . (($topic_count[$forum_id]) ? $topic_count[$forum_id] : 0) . "
WHERE forum_id = $forum_id";
$sql = "SELECT t.topic_id, u.username, u.user_id, u2.username as user2, u2.user_id as id2, p.post_username, p2.post_username AS post_username2, p2.post_time
@@ -193,5 +197,3 @@ foreach ($sql_ary as $sql)
}
echo "<p><b>Done</b></p>\n";
-
-?> \ No newline at end of file
diff --git a/phpBB/develop/mysql_upgrader.php b/phpBB/develop/mysql_upgrader.php
index dcf2f2c88b..698be9d303 100644
--- a/phpBB/develop/mysql_upgrader.php
+++ b/phpBB/develop/mysql_upgrader.php
@@ -1,14 +1,20 @@
<?php
/**
*
-* @package phpBB3
-* @copyright (c) 2006 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
*
-* This file creates SQL statements to upgrade phpBB on MySQL 3.x/4.0.x to 4.1.x/5.x
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
+/**
+* This file creates SQL statements to upgrade phpBB on MySQL 3.x/4.0.x to 4.1.x/5.x
+*/
+
//
// Security message:
//
@@ -56,68 +62,14 @@ echo "USE $dbname;$newline$newline";
@set_time_limit(0);
-$schema_data = get_schema_struct();
-$dbms_type_map = array(
- 'mysql_41' => array(
- 'INT:' => 'int(%d)',
- 'BINT' => 'bigint(20)',
- 'UINT' => 'mediumint(8) UNSIGNED',
- 'UINT:' => 'int(%d) UNSIGNED',
- 'TINT:' => 'tinyint(%d)',
- 'USINT' => 'smallint(4) UNSIGNED',
- 'BOOL' => 'tinyint(1) UNSIGNED',
- 'VCHAR' => 'varchar(255)',
- 'VCHAR:' => 'varchar(%d)',
- 'CHAR:' => 'char(%d)',
- 'XSTEXT' => 'text',
- 'XSTEXT_UNI'=> 'varchar(100)',
- 'STEXT' => 'text',
- 'STEXT_UNI' => 'varchar(255)',
- 'TEXT' => 'text',
- 'TEXT_UNI' => 'text',
- 'MTEXT' => 'mediumtext',
- 'MTEXT_UNI' => 'mediumtext',
- 'TIMESTAMP' => 'int(11) UNSIGNED',
- 'DECIMAL' => 'decimal(5,2)',
- 'DECIMAL:' => 'decimal(%d,2)',
- 'PDECIMAL' => 'decimal(6,3)',
- 'PDECIMAL:' => 'decimal(%d,3)',
- 'VCHAR_UNI' => 'varchar(255)',
- 'VCHAR_UNI:'=> 'varchar(%d)',
- 'VCHAR_CI' => 'varchar(255)',
- 'VARBINARY' => 'varbinary(255)',
- ),
+$finder = new \phpbb\finder(new \phpbb\filesystem(), $phpbb_root_path);
+$classes = $finder->core_path('phpbb/')
+ ->directory('/db/migration/data')
+ ->get_classes();
- 'mysql_40' => array(
- 'INT:' => 'int(%d)',
- 'BINT' => 'bigint(20)',
- 'UINT' => 'mediumint(8) UNSIGNED',
- 'UINT:' => 'int(%d) UNSIGNED',
- 'TINT:' => 'tinyint(%d)',
- 'USINT' => 'smallint(4) UNSIGNED',
- 'BOOL' => 'tinyint(1) UNSIGNED',
- 'VCHAR' => 'varbinary(255)',
- 'VCHAR:' => 'varbinary(%d)',
- 'CHAR:' => 'binary(%d)',
- 'XSTEXT' => 'blob',
- 'XSTEXT_UNI'=> 'blob',
- 'STEXT' => 'blob',
- 'STEXT_UNI' => 'blob',
- 'TEXT' => 'blob',
- 'TEXT_UNI' => 'blob',
- 'MTEXT' => 'mediumblob',
- 'MTEXT_UNI' => 'mediumblob',
- 'TIMESTAMP' => 'int(11) UNSIGNED',
- 'DECIMAL' => 'decimal(5,2)',
- 'DECIMAL:' => 'decimal(%d,2)',
- 'PDECIMAL' => 'decimal(6,3)',
- 'PDECIMAL:' => 'decimal(%d,3)',
- 'VCHAR_UNI' => 'blob',
- 'VCHAR_UNI:'=> array('varbinary(%d)', 'limit' => array('mult', 3, 255, 'blob')),
- 'VCHAR_CI' => 'blob',
- 'VARBINARY' => 'varbinary(255)',
- ),
-);
+$schema_generator = new \phpbb\db\migration\schema_generator($classes, $config, $db, new \phpbb\db\tools($db, true), $phpbb_root_path, $phpEx, $table_prefix);
+$schema_data = $schema_generator->get_schema();
+$dbms_type_map = \phpbb\db\tools::get_dbms_type_map();
foreach ($schema_data as $table_name => $table_data)
{
@@ -176,7 +128,7 @@ foreach ($schema_data as $table_name => $table_data)
$column_type = $dbms_type_map['mysql_41'][$column_data[0]];
}
- // Adjust default value if db-dependant specified
+ // Adjust default value if db-dependent specified
if (is_array($column_data[1]))
{
$column_data[1] = (isset($column_data[1][$dbms])) ? $column_data[1][$dbms] : $column_data[1]['default'];
@@ -255,1164 +207,3 @@ foreach ($schema_data as $table_name => $table_data)
echo "ALTER TABLE $table_name ADD FULLTEXT (post_subject), ADD FULLTEXT (post_text), ADD FULLTEXT post_content (post_subject, post_text);{$newline}";
}
}
-
-/**
-* Define the basic structure
-* The format:
-* array('{TABLE_NAME}' => {TABLE_DATA})
-* {TABLE_DATA}:
-* COLUMNS = array({column_name} = array({column_type}, {default}, {auto_increment}))
-* PRIMARY_KEY = {column_name(s)}
-* KEYS = array({key_name} = array({key_type}, {column_name(s)})),
-*
-* Column Types:
-* INT:x => SIGNED int(x)
-* BINT => BIGINT
-* UINT => mediumint(8) UNSIGNED
-* UINT:x => int(x) UNSIGNED
-* TINT:x => tinyint(x)
-* USINT => smallint(4) UNSIGNED (for _order columns)
-* BOOL => tinyint(1) UNSIGNED
-* VCHAR => varchar(255)
-* CHAR:x => char(x)
-* XSTEXT_UNI => text for storing 100 characters (topic_title for example)
-* STEXT_UNI => text for storing 255 characters (normal input field with a max of 255 single-byte chars) - same as VCHAR_UNI
-* TEXT_UNI => text for storing 3000 characters (short text, descriptions, comments, etc.)
-* MTEXT_UNI => mediumtext (post text, large text)
-* VCHAR:x => varchar(x)
-* TIMESTAMP => int(11) UNSIGNED
-* DECIMAL => decimal number (5,2)
-* DECIMAL: => decimal number (x,2)
-* PDECIMAL => precision decimal number (6,3)
-* PDECIMAL: => precision decimal number (x,3)
-* VCHAR_UNI => varchar(255) BINARY
-* VCHAR_CI => varchar_ci for postgresql, others VCHAR
-*/
-function get_schema_struct()
-{
- $schema_data = array();
-
- $schema_data['phpbb_attachments'] = array(
- 'COLUMNS' => array(
- 'attach_id' => array('UINT', NULL, 'auto_increment'),
- 'post_msg_id' => array('UINT', 0),
- 'topic_id' => array('UINT', 0),
- 'in_message' => array('BOOL', 0),
- 'poster_id' => array('UINT', 0),
- 'is_orphan' => array('BOOL', 1),
- 'physical_filename' => array('VCHAR', ''),
- 'real_filename' => array('VCHAR', ''),
- 'download_count' => array('UINT', 0),
- 'attach_comment' => array('TEXT_UNI', ''),
- 'extension' => array('VCHAR:100', ''),
- 'mimetype' => array('VCHAR:100', ''),
- 'filesize' => array('UINT:20', 0),
- 'filetime' => array('TIMESTAMP', 0),
- 'thumbnail' => array('BOOL', 0),
- ),
- 'PRIMARY_KEY' => 'attach_id',
- 'KEYS' => array(
- 'filetime' => array('INDEX', 'filetime'),
- 'post_msg_id' => array('INDEX', 'post_msg_id'),
- 'topic_id' => array('INDEX', 'topic_id'),
- 'poster_id' => array('INDEX', 'poster_id'),
- 'is_orphan' => array('INDEX', 'is_orphan'),
- ),
- );
-
- $schema_data['phpbb_acl_groups'] = array(
- 'COLUMNS' => array(
- 'group_id' => array('UINT', 0),
- 'forum_id' => array('UINT', 0),
- 'auth_option_id' => array('UINT', 0),
- 'auth_role_id' => array('UINT', 0),
- 'auth_setting' => array('TINT:2', 0),
- ),
- 'KEYS' => array(
- 'group_id' => array('INDEX', 'group_id'),
- 'auth_opt_id' => array('INDEX', 'auth_option_id'),
- 'auth_role_id' => array('INDEX', 'auth_role_id'),
- ),
- );
-
- $schema_data['phpbb_acl_options'] = array(
- 'COLUMNS' => array(
- 'auth_option_id' => array('UINT', NULL, 'auto_increment'),
- 'auth_option' => array('VCHAR:50', ''),
- 'is_global' => array('BOOL', 0),
- 'is_local' => array('BOOL', 0),
- 'founder_only' => array('BOOL', 0),
- ),
- 'PRIMARY_KEY' => 'auth_option_id',
- 'KEYS' => array(
- 'auth_option' => array('UNIQUE', 'auth_option'),
- ),
- );
-
- $schema_data['phpbb_acl_roles'] = array(
- 'COLUMNS' => array(
- 'role_id' => array('UINT', NULL, 'auto_increment'),
- 'role_name' => array('VCHAR_UNI', ''),
- 'role_description' => array('TEXT_UNI', ''),
- 'role_type' => array('VCHAR:10', ''),
- 'role_order' => array('USINT', 0),
- ),
- 'PRIMARY_KEY' => 'role_id',
- 'KEYS' => array(
- 'role_type' => array('INDEX', 'role_type'),
- 'role_order' => array('INDEX', 'role_order'),
- ),
- );
-
- $schema_data['phpbb_acl_roles_data'] = array(
- 'COLUMNS' => array(
- 'role_id' => array('UINT', 0),
- 'auth_option_id' => array('UINT', 0),
- 'auth_setting' => array('TINT:2', 0),
- ),
- 'PRIMARY_KEY' => array('role_id', 'auth_option_id'),
- 'KEYS' => array(
- 'ath_op_id' => array('INDEX', 'auth_option_id'),
- ),
- );
-
- $schema_data['phpbb_acl_users'] = array(
- 'COLUMNS' => array(
- 'user_id' => array('UINT', 0),
- 'forum_id' => array('UINT', 0),
- 'auth_option_id' => array('UINT', 0),
- 'auth_role_id' => array('UINT', 0),
- 'auth_setting' => array('TINT:2', 0),
- ),
- 'KEYS' => array(
- 'user_id' => array('INDEX', 'user_id'),
- 'auth_option_id' => array('INDEX', 'auth_option_id'),
- 'auth_role_id' => array('INDEX', 'auth_role_id'),
- ),
- );
-
- $schema_data['phpbb_banlist'] = array(
- 'COLUMNS' => array(
- 'ban_id' => array('UINT', NULL, 'auto_increment'),
- 'ban_userid' => array('UINT', 0),
- 'ban_ip' => array('VCHAR:40', ''),
- 'ban_email' => array('VCHAR_UNI:100', ''),
- 'ban_start' => array('TIMESTAMP', 0),
- 'ban_end' => array('TIMESTAMP', 0),
- 'ban_exclude' => array('BOOL', 0),
- 'ban_reason' => array('VCHAR_UNI', ''),
- 'ban_give_reason' => array('VCHAR_UNI', ''),
- ),
- 'PRIMARY_KEY' => 'ban_id',
- 'KEYS' => array(
- 'ban_end' => array('INDEX', 'ban_end'),
- 'ban_user' => array('INDEX', array('ban_userid', 'ban_exclude')),
- 'ban_email' => array('INDEX', array('ban_email', 'ban_exclude')),
- 'ban_ip' => array('INDEX', array('ban_ip', 'ban_exclude')),
- ),
- );
-
- $schema_data['phpbb_bbcodes'] = array(
- 'COLUMNS' => array(
- 'bbcode_id' => array('USINT', 0),
- 'bbcode_tag' => array('VCHAR:16', ''),
- 'bbcode_helpline' => array('VCHAR_UNI', ''),
- 'display_on_posting' => array('BOOL', 0),
- 'bbcode_match' => array('TEXT_UNI', ''),
- 'bbcode_tpl' => array('MTEXT_UNI', ''),
- 'first_pass_match' => array('MTEXT_UNI', ''),
- 'first_pass_replace' => array('MTEXT_UNI', ''),
- 'second_pass_match' => array('MTEXT_UNI', ''),
- 'second_pass_replace' => array('MTEXT_UNI', ''),
- ),
- 'PRIMARY_KEY' => 'bbcode_id',
- 'KEYS' => array(
- 'display_on_post' => array('INDEX', 'display_on_posting'),
- ),
- );
-
- $schema_data['phpbb_bookmarks'] = array(
- 'COLUMNS' => array(
- 'topic_id' => array('UINT', 0),
- 'user_id' => array('UINT', 0),
- ),
- 'PRIMARY_KEY' => array('topic_id', 'user_id'),
- );
-
- $schema_data['phpbb_bots'] = array(
- 'COLUMNS' => array(
- 'bot_id' => array('UINT', NULL, 'auto_increment'),
- 'bot_active' => array('BOOL', 1),
- 'bot_name' => array('STEXT_UNI', ''),
- 'user_id' => array('UINT', 0),
- 'bot_agent' => array('VCHAR', ''),
- 'bot_ip' => array('VCHAR', ''),
- ),
- 'PRIMARY_KEY' => 'bot_id',
- 'KEYS' => array(
- 'bot_active' => array('INDEX', 'bot_active'),
- ),
- );
-
- $schema_data['phpbb_config'] = array(
- 'COLUMNS' => array(
- 'config_name' => array('VCHAR', ''),
- 'config_value' => array('VCHAR_UNI', ''),
- 'is_dynamic' => array('BOOL', 0),
- ),
- 'PRIMARY_KEY' => 'config_name',
- 'KEYS' => array(
- 'is_dynamic' => array('INDEX', 'is_dynamic'),
- ),
- );
-
- $schema_data['phpbb_confirm'] = array(
- 'COLUMNS' => array(
- 'confirm_id' => array('CHAR:32', ''),
- 'session_id' => array('CHAR:32', ''),
- 'confirm_type' => array('TINT:3', 0),
- 'code' => array('VCHAR:8', ''),
- 'seed' => array('UINT:10', 0),
- 'attempts' => array('UINT', 0),
- ),
- 'PRIMARY_KEY' => array('session_id', 'confirm_id'),
- 'KEYS' => array(
- 'confirm_type' => array('INDEX', 'confirm_type'),
- ),
- );
-
- $schema_data['phpbb_disallow'] = array(
- 'COLUMNS' => array(
- 'disallow_id' => array('UINT', NULL, 'auto_increment'),
- 'disallow_username' => array('VCHAR_UNI:255', ''),
- ),
- 'PRIMARY_KEY' => 'disallow_id',
- );
-
- $schema_data['phpbb_drafts'] = array(
- 'COLUMNS' => array(
- 'draft_id' => array('UINT', NULL, 'auto_increment'),
- 'user_id' => array('UINT', 0),
- 'topic_id' => array('UINT', 0),
- 'forum_id' => array('UINT', 0),
- 'save_time' => array('TIMESTAMP', 0),
- 'draft_subject' => array('STEXT_UNI', ''),
- 'draft_message' => array('MTEXT_UNI', ''),
- ),
- 'PRIMARY_KEY' => 'draft_id',
- 'KEYS' => array(
- 'save_time' => array('INDEX', 'save_time'),
- ),
- );
-
- $schema_data['phpbb_extensions'] = array(
- 'COLUMNS' => array(
- 'extension_id' => array('UINT', NULL, 'auto_increment'),
- 'group_id' => array('UINT', 0),
- 'extension' => array('VCHAR:100', ''),
- ),
- 'PRIMARY_KEY' => 'extension_id',
- );
-
- $schema_data['phpbb_extension_groups'] = array(
- 'COLUMNS' => array(
- 'group_id' => array('UINT', NULL, 'auto_increment'),
- 'group_name' => array('VCHAR_UNI', ''),
- 'cat_id' => array('TINT:2', 0),
- 'allow_group' => array('BOOL', 0),
- 'download_mode' => array('BOOL', 1),
- 'upload_icon' => array('VCHAR', ''),
- 'max_filesize' => array('UINT:20', 0),
- 'allowed_forums' => array('TEXT', ''),
- 'allow_in_pm' => array('BOOL', 0),
- ),
- 'PRIMARY_KEY' => 'group_id',
- );
-
- $schema_data['phpbb_forums'] = array(
- 'COLUMNS' => array(
- 'forum_id' => array('UINT', NULL, 'auto_increment'),
- 'parent_id' => array('UINT', 0),
- 'left_id' => array('UINT', 0),
- 'right_id' => array('UINT', 0),
- 'forum_parents' => array('MTEXT', ''),
- 'forum_name' => array('STEXT_UNI', ''),
- 'forum_desc' => array('TEXT_UNI', ''),
- 'forum_desc_bitfield' => array('VCHAR:255', ''),
- 'forum_desc_options' => array('UINT:11', 7),
- 'forum_desc_uid' => array('VCHAR:8', ''),
- 'forum_link' => array('VCHAR_UNI', ''),
- 'forum_password' => array('VCHAR_UNI:40', ''),
- 'forum_style' => array('UINT', 0),
- 'forum_image' => array('VCHAR', ''),
- 'forum_rules' => array('TEXT_UNI', ''),
- 'forum_rules_link' => array('VCHAR_UNI', ''),
- 'forum_rules_bitfield' => array('VCHAR:255', ''),
- 'forum_rules_options' => array('UINT:11', 7),
- 'forum_rules_uid' => array('VCHAR:8', ''),
- 'forum_topics_per_page' => array('TINT:4', 0),
- 'forum_type' => array('TINT:4', 0),
- 'forum_status' => array('TINT:4', 0),
- 'forum_posts' => array('UINT', 0),
- 'forum_topics' => array('UINT', 0),
- 'forum_topics_real' => array('UINT', 0),
- 'forum_last_post_id' => array('UINT', 0),
- 'forum_last_poster_id' => array('UINT', 0),
- 'forum_last_post_subject' => array('STEXT_UNI', ''),
- 'forum_last_post_time' => array('TIMESTAMP', 0),
- 'forum_last_poster_name'=> array('VCHAR_UNI', ''),
- 'forum_last_poster_colour'=> array('VCHAR:6', ''),
- 'forum_flags' => array('TINT:4', 32),
- 'forum_options' => array('UINT:20', 0),
- 'display_subforum_list' => array('BOOL', 1),
- 'display_on_index' => array('BOOL', 1),
- 'enable_indexing' => array('BOOL', 1),
- 'enable_icons' => array('BOOL', 1),
- 'enable_prune' => array('BOOL', 0),
- 'prune_next' => array('TIMESTAMP', 0),
- 'prune_days' => array('UINT', 0),
- 'prune_viewed' => array('UINT', 0),
- 'prune_freq' => array('UINT', 0),
- ),
- 'PRIMARY_KEY' => 'forum_id',
- 'KEYS' => array(
- 'left_right_id' => array('INDEX', array('left_id', 'right_id')),
- 'forum_lastpost_id' => array('INDEX', 'forum_last_post_id'),
- ),
- );
-
- $schema_data['phpbb_forums_access'] = array(
- 'COLUMNS' => array(
- 'forum_id' => array('UINT', 0),
- 'user_id' => array('UINT', 0),
- 'session_id' => array('CHAR:32', ''),
- ),
- 'PRIMARY_KEY' => array('forum_id', 'user_id', 'session_id'),
- );
-
- $schema_data['phpbb_forums_track'] = array(
- 'COLUMNS' => array(
- 'user_id' => array('UINT', 0),
- 'forum_id' => array('UINT', 0),
- 'mark_time' => array('TIMESTAMP', 0),
- ),
- 'PRIMARY_KEY' => array('user_id', 'forum_id'),
- );
-
- $schema_data['phpbb_forums_watch'] = array(
- 'COLUMNS' => array(
- 'forum_id' => array('UINT', 0),
- 'user_id' => array('UINT', 0),
- 'notify_status' => array('BOOL', 0),
- ),
- 'KEYS' => array(
- 'forum_id' => array('INDEX', 'forum_id'),
- 'user_id' => array('INDEX', 'user_id'),
- 'notify_stat' => array('INDEX', 'notify_status'),
- ),
- );
-
- $schema_data['phpbb_groups'] = array(
- 'COLUMNS' => array(
- 'group_id' => array('UINT', NULL, 'auto_increment'),
- 'group_type' => array('TINT:4', 1),
- 'group_founder_manage' => array('BOOL', 0),
- 'group_skip_auth' => array('BOOL', 0),
- 'group_name' => array('VCHAR_CI', ''),
- 'group_desc' => array('TEXT_UNI', ''),
- 'group_desc_bitfield' => array('VCHAR:255', ''),
- 'group_desc_options' => array('UINT:11', 7),
- 'group_desc_uid' => array('VCHAR:8', ''),
- 'group_display' => array('BOOL', 0),
- 'group_avatar' => array('VCHAR', ''),
- 'group_avatar_type' => array('TINT:2', 0),
- 'group_avatar_width' => array('USINT', 0),
- 'group_avatar_height' => array('USINT', 0),
- 'group_rank' => array('UINT', 0),
- 'group_colour' => array('VCHAR:6', ''),
- 'group_sig_chars' => array('UINT', 0),
- 'group_receive_pm' => array('BOOL', 0),
- 'group_message_limit' => array('UINT', 0),
- 'group_max_recipients' => array('UINT', 0),
- 'group_legend' => array('BOOL', 1),
- ),
- 'PRIMARY_KEY' => 'group_id',
- 'KEYS' => array(
- 'group_legend_name' => array('INDEX', array('group_legend', 'group_name')),
- ),
- );
-
- $schema_data['phpbb_icons'] = array(
- 'COLUMNS' => array(
- 'icons_id' => array('UINT', NULL, 'auto_increment'),
- 'icons_url' => array('VCHAR', ''),
- 'icons_width' => array('TINT:4', 0),
- 'icons_height' => array('TINT:4', 0),
- 'icons_order' => array('UINT', 0),
- 'display_on_posting' => array('BOOL', 1),
- ),
- 'PRIMARY_KEY' => 'icons_id',
- 'KEYS' => array(
- 'display_on_posting' => array('INDEX', 'display_on_posting'),
- ),
- );
-
- $schema_data['phpbb_lang'] = array(
- 'COLUMNS' => array(
- 'lang_id' => array('TINT:4', NULL, 'auto_increment'),
- 'lang_iso' => array('VCHAR:30', ''),
- 'lang_dir' => array('VCHAR:30', ''),
- 'lang_english_name' => array('VCHAR_UNI:100', ''),
- 'lang_local_name' => array('VCHAR_UNI:255', ''),
- 'lang_author' => array('VCHAR_UNI:255', ''),
- ),
- 'PRIMARY_KEY' => 'lang_id',
- 'KEYS' => array(
- 'lang_iso' => array('INDEX', 'lang_iso'),
- ),
- );
-
- $schema_data['phpbb_log'] = array(
- 'COLUMNS' => array(
- 'log_id' => array('UINT', NULL, 'auto_increment'),
- 'log_type' => array('TINT:4', 0),
- 'user_id' => array('UINT', 0),
- 'forum_id' => array('UINT', 0),
- 'topic_id' => array('UINT', 0),
- 'reportee_id' => array('UINT', 0),
- 'log_ip' => array('VCHAR:40', ''),
- 'log_time' => array('TIMESTAMP', 0),
- 'log_operation' => array('TEXT_UNI', ''),
- 'log_data' => array('MTEXT_UNI', ''),
- ),
- 'PRIMARY_KEY' => 'log_id',
- 'KEYS' => array(
- 'log_type' => array('INDEX', 'log_type'),
- 'forum_id' => array('INDEX', 'forum_id'),
- 'topic_id' => array('INDEX', 'topic_id'),
- 'reportee_id' => array('INDEX', 'reportee_id'),
- 'user_id' => array('INDEX', 'user_id'),
- ),
- );
-
- $schema_data['phpbb_login_attempts'] = array(
- 'COLUMNS' => array(
- 'attempt_ip' => array('VCHAR:40', ''),
- 'attempt_browser' => array('VCHAR:150', ''),
- 'attempt_forwarded_for' => array('VCHAR:255', ''),
- 'attempt_time' => array('TIMESTAMP', 0),
- 'user_id' => array('UINT', 0),
- 'username' => array('VCHAR_UNI:255', 0),
- 'username_clean' => array('VCHAR_CI', 0),
- ),
- 'KEYS' => array(
- 'att_ip' => array('INDEX', array('attempt_ip', 'attempt_time')),
- 'att_for' => array('INDEX', array('attempt_forwarded_for', 'attempt_time')),
- 'att_time' => array('INDEX', array('attempt_time')),
- 'user_id' => array('INDEX', 'user_id'),
- ),
- );
-
- $schema_data['phpbb_moderator_cache'] = array(
- 'COLUMNS' => array(
- 'forum_id' => array('UINT', 0),
- 'user_id' => array('UINT', 0),
- 'username' => array('VCHAR_UNI:255', ''),
- 'group_id' => array('UINT', 0),
- 'group_name' => array('VCHAR_UNI', ''),
- 'display_on_index' => array('BOOL', 1),
- ),
- 'KEYS' => array(
- 'disp_idx' => array('INDEX', 'display_on_index'),
- 'forum_id' => array('INDEX', 'forum_id'),
- ),
- );
-
- $schema_data['phpbb_modules'] = array(
- 'COLUMNS' => array(
- 'module_id' => array('UINT', NULL, 'auto_increment'),
- 'module_enabled' => array('BOOL', 1),
- 'module_display' => array('BOOL', 1),
- 'module_basename' => array('VCHAR', ''),
- 'module_class' => array('VCHAR:10', ''),
- 'parent_id' => array('UINT', 0),
- 'left_id' => array('UINT', 0),
- 'right_id' => array('UINT', 0),
- 'module_langname' => array('VCHAR', ''),
- 'module_mode' => array('VCHAR', ''),
- 'module_auth' => array('VCHAR', ''),
- ),
- 'PRIMARY_KEY' => 'module_id',
- 'KEYS' => array(
- 'left_right_id' => array('INDEX', array('left_id', 'right_id')),
- 'module_enabled' => array('INDEX', 'module_enabled'),
- 'class_left_id' => array('INDEX', array('module_class', 'left_id')),
- ),
- );
-
- $schema_data['phpbb_poll_options'] = array(
- 'COLUMNS' => array(
- 'poll_option_id' => array('TINT:4', 0),
- 'topic_id' => array('UINT', 0),
- 'poll_option_text' => array('TEXT_UNI', ''),
- 'poll_option_total' => array('UINT', 0),
- ),
- 'KEYS' => array(
- 'poll_opt_id' => array('INDEX', 'poll_option_id'),
- 'topic_id' => array('INDEX', 'topic_id'),
- ),
- );
-
- $schema_data['phpbb_poll_votes'] = array(
- 'COLUMNS' => array(
- 'topic_id' => array('UINT', 0),
- 'poll_option_id' => array('TINT:4', 0),
- 'vote_user_id' => array('UINT', 0),
- 'vote_user_ip' => array('VCHAR:40', ''),
- ),
- 'KEYS' => array(
- 'topic_id' => array('INDEX', 'topic_id'),
- 'vote_user_id' => array('INDEX', 'vote_user_id'),
- 'vote_user_ip' => array('INDEX', 'vote_user_ip'),
- ),
- );
-
- $schema_data['phpbb_posts'] = array(
- 'COLUMNS' => array(
- 'post_id' => array('UINT', NULL, 'auto_increment'),
- 'topic_id' => array('UINT', 0),
- 'forum_id' => array('UINT', 0),
- 'poster_id' => array('UINT', 0),
- 'icon_id' => array('UINT', 0),
- 'poster_ip' => array('VCHAR:40', ''),
- 'post_time' => array('TIMESTAMP', 0),
- 'post_approved' => array('BOOL', 1),
- 'post_reported' => array('BOOL', 0),
- 'enable_bbcode' => array('BOOL', 1),
- 'enable_smilies' => array('BOOL', 1),
- 'enable_magic_url' => array('BOOL', 1),
- 'enable_sig' => array('BOOL', 1),
- 'post_username' => array('VCHAR_UNI:255', ''),
- 'post_subject' => array('STEXT_UNI', '', 'true_sort'),
- 'post_text' => array('MTEXT_UNI', ''),
- 'post_checksum' => array('VCHAR:32', ''),
- 'post_attachment' => array('BOOL', 0),
- 'bbcode_bitfield' => array('VCHAR:255', ''),
- 'bbcode_uid' => array('VCHAR:8', ''),
- 'post_postcount' => array('BOOL', 1),
- 'post_edit_time' => array('TIMESTAMP', 0),
- 'post_edit_reason' => array('STEXT_UNI', ''),
- 'post_edit_user' => array('UINT', 0),
- 'post_edit_count' => array('USINT', 0),
- 'post_edit_locked' => array('BOOL', 0),
- ),
- 'PRIMARY_KEY' => 'post_id',
- 'KEYS' => array(
- 'forum_id' => array('INDEX', 'forum_id'),
- 'topic_id' => array('INDEX', 'topic_id'),
- 'poster_ip' => array('INDEX', 'poster_ip'),
- 'poster_id' => array('INDEX', 'poster_id'),
- 'post_approved' => array('INDEX', 'post_approved'),
- 'post_username' => array('INDEX', 'post_username'),
- 'tid_post_time' => array('INDEX', array('topic_id', 'post_time')),
- ),
- );
-
- $schema_data['phpbb_privmsgs'] = array(
- 'COLUMNS' => array(
- 'msg_id' => array('UINT', NULL, 'auto_increment'),
- 'root_level' => array('UINT', 0),
- 'author_id' => array('UINT', 0),
- 'icon_id' => array('UINT', 0),
- 'author_ip' => array('VCHAR:40', ''),
- 'message_time' => array('TIMESTAMP', 0),
- 'enable_bbcode' => array('BOOL', 1),
- 'enable_smilies' => array('BOOL', 1),
- 'enable_magic_url' => array('BOOL', 1),
- 'enable_sig' => array('BOOL', 1),
- 'message_subject' => array('STEXT_UNI', ''),
- 'message_text' => array('MTEXT_UNI', ''),
- 'message_edit_reason' => array('STEXT_UNI', ''),
- 'message_edit_user' => array('UINT', 0),
- 'message_attachment' => array('BOOL', 0),
- 'bbcode_bitfield' => array('VCHAR:255', ''),
- 'bbcode_uid' => array('VCHAR:8', ''),
- 'message_edit_time' => array('TIMESTAMP', 0),
- 'message_edit_count' => array('USINT', 0),
- 'to_address' => array('TEXT_UNI', ''),
- 'bcc_address' => array('TEXT_UNI', ''),
- 'message_reported' => array('BOOL', 0),
- ),
- 'PRIMARY_KEY' => 'msg_id',
- 'KEYS' => array(
- 'author_ip' => array('INDEX', 'author_ip'),
- 'message_time' => array('INDEX', 'message_time'),
- 'author_id' => array('INDEX', 'author_id'),
- 'root_level' => array('INDEX', 'root_level'),
- ),
- );
-
- $schema_data['phpbb_privmsgs_folder'] = array(
- 'COLUMNS' => array(
- 'folder_id' => array('UINT', NULL, 'auto_increment'),
- 'user_id' => array('UINT', 0),
- 'folder_name' => array('VCHAR_UNI', ''),
- 'pm_count' => array('UINT', 0),
- ),
- 'PRIMARY_KEY' => 'folder_id',
- 'KEYS' => array(
- 'user_id' => array('INDEX', 'user_id'),
- ),
- );
-
- $schema_data['phpbb_privmsgs_rules'] = array(
- 'COLUMNS' => array(
- 'rule_id' => array('UINT', NULL, 'auto_increment'),
- 'user_id' => array('UINT', 0),
- 'rule_check' => array('UINT', 0),
- 'rule_connection' => array('UINT', 0),
- 'rule_string' => array('VCHAR_UNI', ''),
- 'rule_user_id' => array('UINT', 0),
- 'rule_group_id' => array('UINT', 0),
- 'rule_action' => array('UINT', 0),
- 'rule_folder_id' => array('INT:11', 0),
- ),
- 'PRIMARY_KEY' => 'rule_id',
- 'KEYS' => array(
- 'user_id' => array('INDEX', 'user_id'),
- ),
- );
-
- $schema_data['phpbb_privmsgs_to'] = array(
- 'COLUMNS' => array(
- 'msg_id' => array('UINT', 0),
- 'user_id' => array('UINT', 0),
- 'author_id' => array('UINT', 0),
- 'pm_deleted' => array('BOOL', 0),
- 'pm_new' => array('BOOL', 1),
- 'pm_unread' => array('BOOL', 1),
- 'pm_replied' => array('BOOL', 0),
- 'pm_marked' => array('BOOL', 0),
- 'pm_forwarded' => array('BOOL', 0),
- 'folder_id' => array('INT:11', 0),
- ),
- 'KEYS' => array(
- 'msg_id' => array('INDEX', 'msg_id'),
- 'author_id' => array('INDEX', 'author_id'),
- 'usr_flder_id' => array('INDEX', array('user_id', 'folder_id')),
- ),
- );
-
- $schema_data['phpbb_profile_fields'] = array(
- 'COLUMNS' => array(
- 'field_id' => array('UINT', NULL, 'auto_increment'),
- 'field_name' => array('VCHAR_UNI', ''),
- 'field_type' => array('TINT:4', 0),
- 'field_ident' => array('VCHAR:20', ''),
- 'field_length' => array('VCHAR:20', ''),
- 'field_minlen' => array('VCHAR', ''),
- 'field_maxlen' => array('VCHAR', ''),
- 'field_novalue' => array('VCHAR_UNI', ''),
- 'field_default_value' => array('VCHAR_UNI', ''),
- 'field_validation' => array('VCHAR_UNI:20', ''),
- 'field_required' => array('BOOL', 0),
- 'field_show_novalue' => array('BOOL', 0),
- 'field_show_on_reg' => array('BOOL', 0),
- 'field_show_on_vt' => array('BOOL', 0),
- 'field_show_profile' => array('BOOL', 0),
- 'field_hide' => array('BOOL', 0),
- 'field_no_view' => array('BOOL', 0),
- 'field_active' => array('BOOL', 0),
- 'field_order' => array('UINT', 0),
- ),
- 'PRIMARY_KEY' => 'field_id',
- 'KEYS' => array(
- 'fld_type' => array('INDEX', 'field_type'),
- 'fld_ordr' => array('INDEX', 'field_order'),
- ),
- );
-
- $schema_data['phpbb_profile_fields_data'] = array(
- 'COLUMNS' => array(
- 'user_id' => array('UINT', 0),
- ),
- 'PRIMARY_KEY' => 'user_id',
- );
-
- $schema_data['phpbb_profile_fields_lang'] = array(
- 'COLUMNS' => array(
- 'field_id' => array('UINT', 0),
- 'lang_id' => array('UINT', 0),
- 'option_id' => array('UINT', 0),
- 'field_type' => array('TINT:4', 0),
- 'lang_value' => array('VCHAR_UNI', ''),
- ),
- 'PRIMARY_KEY' => array('field_id', 'lang_id', 'option_id'),
- );
-
- $schema_data['phpbb_profile_lang'] = array(
- 'COLUMNS' => array(
- 'field_id' => array('UINT', 0),
- 'lang_id' => array('UINT', 0),
- 'lang_name' => array('VCHAR_UNI', ''),
- 'lang_explain' => array('TEXT_UNI', ''),
- 'lang_default_value' => array('VCHAR_UNI', ''),
- ),
- 'PRIMARY_KEY' => array('field_id', 'lang_id'),
- );
-
- $schema_data['phpbb_ranks'] = array(
- 'COLUMNS' => array(
- 'rank_id' => array('UINT', NULL, 'auto_increment'),
- 'rank_title' => array('VCHAR_UNI', ''),
- 'rank_min' => array('UINT', 0),
- 'rank_special' => array('BOOL', 0),
- 'rank_image' => array('VCHAR', ''),
- ),
- 'PRIMARY_KEY' => 'rank_id',
- );
-
- $schema_data['phpbb_reports'] = array(
- 'COLUMNS' => array(
- 'report_id' => array('UINT', NULL, 'auto_increment'),
- 'reason_id' => array('USINT', 0),
- 'post_id' => array('UINT', 0),
- 'pm_id' => array('UINT', 0),
- 'user_id' => array('UINT', 0),
- 'user_notify' => array('BOOL', 0),
- 'report_closed' => array('BOOL', 0),
- 'report_time' => array('TIMESTAMP', 0),
- 'report_text' => array('MTEXT_UNI', ''),
- ),
- 'PRIMARY_KEY' => 'report_id',
- 'KEYS' => array(
- 'post_id' => array('INDEX', 'post_id'),
- 'pm_id' => array('INDEX', 'pm_id'),
- ),
- );
-
- $schema_data['phpbb_reports_reasons'] = array(
- 'COLUMNS' => array(
- 'reason_id' => array('USINT', NULL, 'auto_increment'),
- 'reason_title' => array('VCHAR_UNI', ''),
- 'reason_description' => array('MTEXT_UNI', ''),
- 'reason_order' => array('USINT', 0),
- ),
- 'PRIMARY_KEY' => 'reason_id',
- );
-
- $schema_data['phpbb_search_results'] = array(
- 'COLUMNS' => array(
- 'search_key' => array('VCHAR:32', ''),
- 'search_time' => array('TIMESTAMP', 0),
- 'search_keywords' => array('MTEXT_UNI', ''),
- 'search_authors' => array('MTEXT', ''),
- ),
- 'PRIMARY_KEY' => 'search_key',
- );
-
- $schema_data['phpbb_search_wordlist'] = array(
- 'COLUMNS' => array(
- 'word_id' => array('UINT', NULL, 'auto_increment'),
- 'word_text' => array('VCHAR_UNI', ''),
- 'word_common' => array('BOOL', 0),
- 'word_count' => array('UINT', 0),
- ),
- 'PRIMARY_KEY' => 'word_id',
- 'KEYS' => array(
- 'wrd_txt' => array('UNIQUE', 'word_text'),
- 'wrd_cnt' => array('INDEX', 'word_count'),
- ),
- );
-
- $schema_data['phpbb_search_wordmatch'] = array(
- 'COLUMNS' => array(
- 'post_id' => array('UINT', 0),
- 'word_id' => array('UINT', 0),
- 'title_match' => array('BOOL', 0),
- ),
- 'KEYS' => array(
- 'unq_mtch' => array('UNIQUE', array('word_id', 'post_id', 'title_match')),
- 'word_id' => array('INDEX', 'word_id'),
- 'post_id' => array('INDEX', 'post_id'),
- ),
- );
-
- $schema_data['phpbb_sessions'] = array(
- 'COLUMNS' => array(
- 'session_id' => array('CHAR:32', ''),
- 'session_user_id' => array('UINT', 0),
- 'session_forum_id' => array('UINT', 0),
- 'session_last_visit' => array('TIMESTAMP', 0),
- 'session_start' => array('TIMESTAMP', 0),
- 'session_time' => array('TIMESTAMP', 0),
- 'session_ip' => array('VCHAR:40', ''),
- 'session_browser' => array('VCHAR:150', ''),
- 'session_forwarded_for' => array('VCHAR:255', ''),
- 'session_page' => array('VCHAR_UNI', ''),
- 'session_viewonline' => array('BOOL', 1),
- 'session_autologin' => array('BOOL', 0),
- 'session_admin' => array('BOOL', 0),
- ),
- 'PRIMARY_KEY' => 'session_id',
- 'KEYS' => array(
- 'session_time' => array('INDEX', 'session_time'),
- 'session_user_id' => array('INDEX', 'session_user_id'),
- 'session_fid' => array('INDEX', 'session_forum_id'),
- ),
- );
-
- $schema_data['phpbb_sessions_keys'] = array(
- 'COLUMNS' => array(
- 'key_id' => array('CHAR:32', ''),
- 'user_id' => array('UINT', 0),
- 'last_ip' => array('VCHAR:40', ''),
- 'last_login' => array('TIMESTAMP', 0),
- ),
- 'PRIMARY_KEY' => array('key_id', 'user_id'),
- 'KEYS' => array(
- 'last_login' => array('INDEX', 'last_login'),
- ),
- );
-
- $schema_data['phpbb_sitelist'] = array(
- 'COLUMNS' => array(
- 'site_id' => array('UINT', NULL, 'auto_increment'),
- 'site_ip' => array('VCHAR:40', ''),
- 'site_hostname' => array('VCHAR', ''),
- 'ip_exclude' => array('BOOL', 0),
- ),
- 'PRIMARY_KEY' => 'site_id',
- );
-
- $schema_data['phpbb_smilies'] = array(
- 'COLUMNS' => array(
- 'smiley_id' => array('UINT', NULL, 'auto_increment'),
- // We may want to set 'code' to VCHAR:50 or check if unicode support is possible... at the moment only ASCII characters are allowed.
- 'code' => array('VCHAR_UNI:50', ''),
- 'emotion' => array('VCHAR_UNI:50', ''),
- 'smiley_url' => array('VCHAR:50', ''),
- 'smiley_width' => array('USINT', 0),
- 'smiley_height' => array('USINT', 0),
- 'smiley_order' => array('UINT', 0),
- 'display_on_posting'=> array('BOOL', 1),
- ),
- 'PRIMARY_KEY' => 'smiley_id',
- 'KEYS' => array(
- 'display_on_post' => array('INDEX', 'display_on_posting'),
- ),
- );
-
- $schema_data['phpbb_styles'] = array(
- 'COLUMNS' => array(
- 'style_id' => array('UINT', NULL, 'auto_increment'),
- 'style_name' => array('VCHAR_UNI:255', ''),
- 'style_copyright' => array('VCHAR_UNI', ''),
- 'style_active' => array('BOOL', 1),
- 'template_id' => array('UINT', 0),
- 'theme_id' => array('UINT', 0),
- 'imageset_id' => array('UINT', 0),
- ),
- 'PRIMARY_KEY' => 'style_id',
- 'KEYS' => array(
- 'style_name' => array('UNIQUE', 'style_name'),
- 'template_id' => array('INDEX', 'template_id'),
- 'theme_id' => array('INDEX', 'theme_id'),
- 'imageset_id' => array('INDEX', 'imageset_id'),
- ),
- );
-
- $schema_data['phpbb_styles_template'] = array(
- 'COLUMNS' => array(
- 'template_id' => array('UINT', NULL, 'auto_increment'),
- 'template_name' => array('VCHAR_UNI:255', ''),
- 'template_copyright' => array('VCHAR_UNI', ''),
- 'template_path' => array('VCHAR:100', ''),
- 'bbcode_bitfield' => array('VCHAR:255', 'kNg='),
- 'template_storedb' => array('BOOL', 0),
- 'template_inherits_id' => array('UINT:4', 0),
- 'template_inherit_path' => array('VCHAR', ''),
- ),
- 'PRIMARY_KEY' => 'template_id',
- 'KEYS' => array(
- 'tmplte_nm' => array('UNIQUE', 'template_name'),
- ),
- );
-
- $schema_data['phpbb_styles_template_data'] = array(
- 'COLUMNS' => array(
- 'template_id' => array('UINT', 0),
- 'template_filename' => array('VCHAR:100', ''),
- 'template_included' => array('TEXT', ''),
- 'template_mtime' => array('TIMESTAMP', 0),
- 'template_data' => array('MTEXT_UNI', ''),
- ),
- 'KEYS' => array(
- 'tid' => array('INDEX', 'template_id'),
- 'tfn' => array('INDEX', 'template_filename'),
- ),
- );
-
- $schema_data['phpbb_styles_theme'] = array(
- 'COLUMNS' => array(
- 'theme_id' => array('UINT', NULL, 'auto_increment'),
- 'theme_name' => array('VCHAR_UNI:255', ''),
- 'theme_copyright' => array('VCHAR_UNI', ''),
- 'theme_path' => array('VCHAR:100', ''),
- 'theme_storedb' => array('BOOL', 0),
- 'theme_mtime' => array('TIMESTAMP', 0),
- 'theme_data' => array('MTEXT_UNI', ''),
- ),
- 'PRIMARY_KEY' => 'theme_id',
- 'KEYS' => array(
- 'theme_name' => array('UNIQUE', 'theme_name'),
- ),
- );
-
- $schema_data['phpbb_styles_imageset'] = array(
- 'COLUMNS' => array(
- 'imageset_id' => array('UINT', NULL, 'auto_increment'),
- 'imageset_name' => array('VCHAR_UNI:255', ''),
- 'imageset_copyright' => array('VCHAR_UNI', ''),
- 'imageset_path' => array('VCHAR:100', ''),
- ),
- 'PRIMARY_KEY' => 'imageset_id',
- 'KEYS' => array(
- 'imgset_nm' => array('UNIQUE', 'imageset_name'),
- ),
- );
-
- $schema_data['phpbb_styles_imageset_data'] = array(
- 'COLUMNS' => array(
- 'image_id' => array('UINT', NULL, 'auto_increment'),
- 'image_name' => array('VCHAR:200', ''),
- 'image_filename' => array('VCHAR:200', ''),
- 'image_lang' => array('VCHAR:30', ''),
- 'image_height' => array('USINT', 0),
- 'image_width' => array('USINT', 0),
- 'imageset_id' => array('UINT', 0),
- ),
- 'PRIMARY_KEY' => 'image_id',
- 'KEYS' => array(
- 'i_d' => array('INDEX', 'imageset_id'),
- ),
- );
-
- $schema_data['phpbb_topics'] = array(
- 'COLUMNS' => array(
- 'topic_id' => array('UINT', NULL, 'auto_increment'),
- 'forum_id' => array('UINT', 0),
- 'icon_id' => array('UINT', 0),
- 'topic_attachment' => array('BOOL', 0),
- 'topic_approved' => array('BOOL', 1),
- 'topic_reported' => array('BOOL', 0),
- 'topic_title' => array('STEXT_UNI', '', 'true_sort'),
- 'topic_poster' => array('UINT', 0),
- 'topic_time' => array('TIMESTAMP', 0),
- 'topic_time_limit' => array('TIMESTAMP', 0),
- 'topic_views' => array('UINT', 0),
- 'topic_replies' => array('UINT', 0),
- 'topic_replies_real' => array('UINT', 0),
- 'topic_status' => array('TINT:3', 0),
- 'topic_type' => array('TINT:3', 0),
- 'topic_first_post_id' => array('UINT', 0),
- 'topic_first_poster_name' => array('VCHAR_UNI', ''),
- 'topic_first_poster_colour' => array('VCHAR:6', ''),
- 'topic_last_post_id' => array('UINT', 0),
- 'topic_last_poster_id' => array('UINT', 0),
- 'topic_last_poster_name' => array('VCHAR_UNI', ''),
- 'topic_last_poster_colour' => array('VCHAR:6', ''),
- 'topic_last_post_subject' => array('STEXT_UNI', ''),
- 'topic_last_post_time' => array('TIMESTAMP', 0),
- 'topic_last_view_time' => array('TIMESTAMP', 0),
- 'topic_moved_id' => array('UINT', 0),
- 'topic_bumped' => array('BOOL', 0),
- 'topic_bumper' => array('UINT', 0),
- 'poll_title' => array('STEXT_UNI', ''),
- 'poll_start' => array('TIMESTAMP', 0),
- 'poll_length' => array('TIMESTAMP', 0),
- 'poll_max_options' => array('TINT:4', 1),
- 'poll_last_vote' => array('TIMESTAMP', 0),
- 'poll_vote_change' => array('BOOL', 0),
- ),
- 'PRIMARY_KEY' => 'topic_id',
- 'KEYS' => array(
- 'forum_id' => array('INDEX', 'forum_id'),
- 'forum_id_type' => array('INDEX', array('forum_id', 'topic_type')),
- 'last_post_time' => array('INDEX', 'topic_last_post_time'),
- 'topic_approved' => array('INDEX', 'topic_approved'),
- 'forum_appr_last' => array('INDEX', array('forum_id', 'topic_approved', 'topic_last_post_id')),
- 'fid_time_moved' => array('INDEX', array('forum_id', 'topic_last_post_time', 'topic_moved_id')),
- ),
- );
-
- $schema_data['phpbb_topics_track'] = array(
- 'COLUMNS' => array(
- 'user_id' => array('UINT', 0),
- 'topic_id' => array('UINT', 0),
- 'forum_id' => array('UINT', 0),
- 'mark_time' => array('TIMESTAMP', 0),
- ),
- 'PRIMARY_KEY' => array('user_id', 'topic_id'),
- 'KEYS' => array(
- 'topic_id' => array('INDEX', 'topic_id'),
- 'forum_id' => array('INDEX', 'forum_id'),
- ),
- );
-
- $schema_data['phpbb_topics_posted'] = array(
- 'COLUMNS' => array(
- 'user_id' => array('UINT', 0),
- 'topic_id' => array('UINT', 0),
- 'topic_posted' => array('BOOL', 0),
- ),
- 'PRIMARY_KEY' => array('user_id', 'topic_id'),
- );
-
- $schema_data['phpbb_topics_watch'] = array(
- 'COLUMNS' => array(
- 'topic_id' => array('UINT', 0),
- 'user_id' => array('UINT', 0),
- 'notify_status' => array('BOOL', 0),
- ),
- 'KEYS' => array(
- 'topic_id' => array('INDEX', 'topic_id'),
- 'user_id' => array('INDEX', 'user_id'),
- 'notify_stat' => array('INDEX', 'notify_status'),
- ),
- );
-
- $schema_data['phpbb_user_group'] = array(
- 'COLUMNS' => array(
- 'group_id' => array('UINT', 0),
- 'user_id' => array('UINT', 0),
- 'group_leader' => array('BOOL', 0),
- 'user_pending' => array('BOOL', 1),
- ),
- 'KEYS' => array(
- 'group_id' => array('INDEX', 'group_id'),
- 'user_id' => array('INDEX', 'user_id'),
- 'group_leader' => array('INDEX', 'group_leader'),
- ),
- );
-
- $schema_data['phpbb_users'] = array(
- 'COLUMNS' => array(
- 'user_id' => array('UINT', NULL, 'auto_increment'),
- 'user_type' => array('TINT:2', 0),
- 'group_id' => array('UINT', 3),
- 'user_permissions' => array('MTEXT', ''),
- 'user_perm_from' => array('UINT', 0),
- 'user_ip' => array('VCHAR:40', ''),
- 'user_regdate' => array('TIMESTAMP', 0),
- 'username' => array('VCHAR_CI', ''),
- 'username_clean' => array('VCHAR_CI', ''),
- 'user_password' => array('VCHAR_UNI:40', ''),
- 'user_passchg' => array('TIMESTAMP', 0),
- 'user_pass_convert' => array('BOOL', 0),
- 'user_email' => array('VCHAR_UNI:100', ''),
- 'user_email_hash' => array('BINT', 0),
- 'user_birthday' => array('VCHAR:10', ''),
- 'user_lastvisit' => array('TIMESTAMP', 0),
- 'user_lastmark' => array('TIMESTAMP', 0),
- 'user_lastpost_time' => array('TIMESTAMP', 0),
- 'user_lastpage' => array('VCHAR_UNI:200', ''),
- 'user_last_confirm_key' => array('VCHAR:10', ''),
- 'user_last_search' => array('TIMESTAMP', 0),
- 'user_warnings' => array('TINT:4', 0),
- 'user_last_warning' => array('TIMESTAMP', 0),
- 'user_login_attempts' => array('TINT:4', 0),
- 'user_inactive_reason' => array('TINT:2', 0),
- 'user_inactive_time' => array('TIMESTAMP', 0),
- 'user_posts' => array('UINT', 0),
- 'user_lang' => array('VCHAR:30', ''),
- 'user_timezone' => array('DECIMAL', 0),
- 'user_dst' => array('BOOL', 0),
- 'user_dateformat' => array('VCHAR_UNI:30', 'd M Y H:i'),
- 'user_style' => array('UINT', 0),
- 'user_rank' => array('UINT', 0),
- 'user_colour' => array('VCHAR:6', ''),
- 'user_new_privmsg' => array('INT:4', 0),
- 'user_unread_privmsg' => array('INT:4', 0),
- 'user_last_privmsg' => array('TIMESTAMP', 0),
- 'user_message_rules' => array('BOOL', 0),
- 'user_full_folder' => array('INT:11', -3),
- 'user_emailtime' => array('TIMESTAMP', 0),
- 'user_topic_show_days' => array('USINT', 0),
- 'user_topic_sortby_type' => array('VCHAR:1', 't'),
- 'user_topic_sortby_dir' => array('VCHAR:1', 'd'),
- 'user_post_show_days' => array('USINT', 0),
- 'user_post_sortby_type' => array('VCHAR:1', 't'),
- 'user_post_sortby_dir' => array('VCHAR:1', 'a'),
- 'user_notify' => array('BOOL', 0),
- 'user_notify_pm' => array('BOOL', 1),
- 'user_notify_type' => array('TINT:4', 0),
- 'user_allow_pm' => array('BOOL', 1),
- 'user_allow_viewonline' => array('BOOL', 1),
- 'user_allow_viewemail' => array('BOOL', 1),
- 'user_allow_massemail' => array('BOOL', 1),
- 'user_options' => array('UINT:11', 230271),
- 'user_avatar' => array('VCHAR', ''),
- 'user_avatar_type' => array('TINT:2', 0),
- 'user_avatar_width' => array('USINT', 0),
- 'user_avatar_height' => array('USINT', 0),
- 'user_sig' => array('MTEXT_UNI', ''),
- 'user_sig_bbcode_uid' => array('VCHAR:8', ''),
- 'user_sig_bbcode_bitfield' => array('VCHAR:255', ''),
- 'user_from' => array('VCHAR_UNI:100', ''),
- 'user_icq' => array('VCHAR:15', ''),
- 'user_aim' => array('VCHAR_UNI', ''),
- 'user_yim' => array('VCHAR_UNI', ''),
- 'user_msnm' => array('VCHAR_UNI', ''),
- 'user_jabber' => array('VCHAR_UNI', ''),
- 'user_website' => array('VCHAR_UNI:200', ''),
- 'user_occ' => array('TEXT_UNI', ''),
- 'user_interests' => array('TEXT_UNI', ''),
- 'user_actkey' => array('VCHAR:32', ''),
- 'user_newpasswd' => array('VCHAR_UNI:40', ''),
- 'user_form_salt' => array('VCHAR_UNI:32', ''),
- 'user_new' => array('BOOL', 1),
- 'user_reminded' => array('TINT:4', 0),
- 'user_reminded_time' => array('TIMESTAMP', 0),
- ),
- 'PRIMARY_KEY' => 'user_id',
- 'KEYS' => array(
- 'user_birthday' => array('INDEX', 'user_birthday'),
- 'user_email_hash' => array('INDEX', 'user_email_hash'),
- 'user_type' => array('INDEX', 'user_type'),
- 'username_clean' => array('UNIQUE', 'username_clean'),
- ),
- );
-
- $schema_data['phpbb_warnings'] = array(
- 'COLUMNS' => array(
- 'warning_id' => array('UINT', NULL, 'auto_increment'),
- 'user_id' => array('UINT', 0),
- 'post_id' => array('UINT', 0),
- 'log_id' => array('UINT', 0),
- 'warning_time' => array('TIMESTAMP', 0),
- ),
- 'PRIMARY_KEY' => 'warning_id',
- );
-
- $schema_data['phpbb_words'] = array(
- 'COLUMNS' => array(
- 'word_id' => array('UINT', NULL, 'auto_increment'),
- 'word' => array('VCHAR_UNI', ''),
- 'replacement' => array('VCHAR_UNI', ''),
- ),
- 'PRIMARY_KEY' => 'word_id',
- );
-
- $schema_data['phpbb_zebra'] = array(
- 'COLUMNS' => array(
- 'user_id' => array('UINT', 0),
- 'zebra_id' => array('UINT', 0),
- 'friend' => array('BOOL', 0),
- 'foe' => array('BOOL', 0),
- ),
- 'PRIMARY_KEY' => array('user_id', 'zebra_id'),
- );
-
- return $schema_data;
-}
diff --git a/phpBB/develop/namespacify.php b/phpBB/develop/namespacify.php
new file mode 100644
index 0000000000..447e87905e
--- /dev/null
+++ b/phpBB/develop/namespacify.php
@@ -0,0 +1,194 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+//
+// 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");
+
+$namespace_dir = realpath(__DIR__ . '/../phpbb/');
+$code_dir = realpath(__DIR__ . '/../');
+$test_dir = realpath(__DIR__ . '/../../tests/');
+$config_dir = realpath(__DIR__ . '/../config/');
+
+function map_class_name($old_class_name, $code_dir)
+{
+ $parts = explode('_', $old_class_name);
+ $cur_dir = array();
+ $cur_name = array();
+ $in_name = false;
+ foreach ($parts as $i => $part)
+ {
+ if (empty($part))
+ {
+ return null;
+ }
+
+ if (!$in_name)
+ {
+ $new_dir = array_merge($cur_dir, array($part));
+ $path = $code_dir . '/' . implode('/', $new_dir);
+
+ if (file_exists($path) && is_dir($path))
+ {
+ $cur_dir = $new_dir;
+ }
+ else
+ {
+ $in_name = true;
+ $cur_name[] = $part;
+ }
+ }
+ else
+ {
+ $cur_name[] = $part;
+ }
+ }
+
+ if (empty($cur_name) && !empty($cur_dir))
+ {
+ $cur_name[] = $cur_dir[count($cur_dir) - 1];
+ }
+
+ if (file_exists($code_dir . '/' . implode('/', $cur_dir) . '/' . implode('_', $cur_name) . '.php'))
+ {
+ return implode('\\', $cur_dir) . '\\' . implode('_', $cur_name);
+ }
+
+ return null;
+}
+
+$iterator = new \AppendIterator();
+$iterator->append(new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($code_dir)));
+$iterator->append(new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($test_dir)));
+$iterator->append(new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($config_dir)));
+
+foreach ($iterator as $file)
+{
+ if (substr($file->getPath(), 0, 6) === 'vendor')
+ {
+ continue;
+ }
+
+ if ($file->getExtension() == 'php')
+ {
+ $code = file_get_contents($file->getPathname());
+ $namespaced_file = false;
+
+ if (preg_match('#^' . preg_quote($namespace_dir, '#') . '#', $file->getPath()))
+ {
+ if (preg_match('#^(?:interface|(?:abstract )?class) (phpbb_[a-z0-9_]+)#m', $code, $matches))
+ {
+ $old_class_name = $matches[1];
+ $dirs = explode(DIRECTORY_SEPARATOR, preg_replace('#^' . preg_quote(dirname($namespace_dir) . DIRECTORY_SEPARATOR, '#') . '#', '', $file->getPath()));
+
+ $namespace = implode('\\', $dirs);
+
+ if ($dirs[count($dirs) - 1] == substr($file->getFilename(), 0, -4))
+ {
+ $class_name = preg_replace('#^' . preg_quote(implode('_', $dirs), '#') . '#', $dirs[count($dirs) - 1], $old_class_name);
+ }
+ else
+ {
+ $class_name = preg_replace('#^' . preg_quote(implode('_', $dirs), '#') . '_#', '', $old_class_name);
+ }
+
+ $code = preg_replace("#^\*/$#m", "*/\n\nnamespace $namespace;", $code, 1, $count);
+ if ($count != 1)
+ {
+ die("Incorrect replacement count for namespace of $old_class_name");
+ }
+ $code = preg_replace("#^(interface|(?:abstract )?class) $old_class_name#m", "\\1 $class_name", $code, -1, $count);
+ if ($count != 1)
+ {
+ die("Incorrect replacement count for $old_class_name");
+ }
+
+ $namespaced_file = true;
+ }
+ }
+
+ if (preg_match_all('#[^a-z0-9_$](phpbb_[a-z0-9_]+)#', $code, $matches))
+ {
+ foreach ($matches[1] as $old_class_name)
+ {
+ $class_name = map_class_name($old_class_name, $code_dir);
+ if ($class_name)
+ {
+ $code = preg_replace("#([^a-z0-9_\$>])$old_class_name([^a-z0-9_])#", '\\1\\\\' . $class_name . '\\2', $code);
+ }
+ }
+ }
+
+ if ($namespaced_file)
+ {
+ $code = preg_replace('#new ([a-zA-Z0-9_][a-zA-Z0-9_\\\\]+)#', 'new \\\\\\1', $code);
+ $code = preg_replace('#([^a-zA-Z0-9_\\\\$])([a-zA-Z0-9_][a-zA-Z0-9_\\\\]+)::#', '\\1\\\\\\2::', $code);
+ $code = preg_replace('#catch \(([a-zA-Z0-9_][a-zA-Z0-9_\\\\]+)#', 'catch (\\\\\\1', $code);
+ $code = preg_replace('#(\(|, )([a-zA-Z0-9_][a-zA-Z0-9_\\\\]+)(\s\$)#', '\\1\\\\\\2\\3', $code);
+ $code = preg_replace('#(implements |extends )([a-zA-Z0-9_][a-zA-Z0-9_\\\\]+)(?=\s*(?:,|\n))#', '\\1\\\\\\2', $code);
+ $abs_classes = array(
+ 'Countable',
+ 'IteratorAggregate',
+ 'ArrayAccess',
+ );
+ $code = preg_replace('#(\s+)(' . implode('|', $abs_classes) . ')#', '\\1\\\\\\2', $code);
+ $rel_classes = array(
+ 'ContainerBuilder',
+ 'YamlFileLoader',
+ 'FileLocator',
+ 'Extension',
+ 'CompilerPassInterface',
+ 'EventSubscriberInterface',
+ 'EventDispatcherInterface',
+ 'ContainerAwareEventDispatcher',
+ 'ContainerInterface',
+ 'KernelEvents',
+ 'RouteCollection',
+ 'ControllerResolverInterface',
+ 'Request',
+ 'include',
+ 'array',
+ 'parent',
+ 'self',
+ );
+ $code = preg_replace('#([^a-zA-Z0-9_])\\\\((?:' . implode('|', $rel_classes) . ')(?:\s|\(|::|;))#', '\\1\\2', $code);
+ }
+
+ file_put_contents($file->getPathname(), $code);
+ }
+
+ if ($file->getExtension() == 'yml')
+ {
+ $code = file_get_contents($file->getPathname());
+
+ if (preg_match_all('#\s*class:\s*(phpbb_[a-z0-9_]+)\s+#', $code, $matches))
+ {
+ foreach ($matches[1] as $old_class_name)
+ {
+ $class_name = map_class_name($old_class_name, $code_dir);
+ if ($class_name)
+ {
+ $code = preg_replace("#(\s*class:\s*)$old_class_name(\s+)#", "\\1$class_name\\2", $code);
+ }
+ }
+ }
+
+ file_put_contents($file->getPathname(), $code);
+ }
+}
+
diff --git a/phpBB/develop/nuke-db.php b/phpBB/develop/nuke-db.php
index d7329c3f56..e1f64a6177 100644
--- a/phpBB/develop/nuke-db.php
+++ b/phpBB/develop/nuke-db.php
@@ -54,5 +54,3 @@ else
flush();
}
}
-?>
-
diff --git a/phpBB/develop/regex.php b/phpBB/develop/regex.php
index 8165ba1f21..46b6fff701 100644
--- a/phpBB/develop/regex.php
+++ b/phpBB/develop/regex.php
@@ -80,5 +80,3 @@ echo 'www.URL: ' . $www_url . "<br />\n";
// no schema and no authority
$relative_url = "$segment$path_abempty(?:\?$query)?(?:\#$fragment)?";
echo 'relative URL: ' . $relative_url . "<br />\n";
-
-?> \ No newline at end of file
diff --git a/phpBB/develop/regex_idn.php b/phpBB/develop/regex_idn.php
new file mode 100644
index 0000000000..d871695c50
--- /dev/null
+++ b/phpBB/develop/regex_idn.php
@@ -0,0 +1,151 @@
+<?php
+//
+// 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");
+
+// IP regular expressions
+
+$dec_octet = '(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])';
+$h16 = '[\dA-F]{1,4}';
+$ipv4 = "(?:$dec_octet\.){3}$dec_octet";
+$ls32 = "(?:$h16:$h16|$ipv4)";
+
+$ipv6_construct = array(
+ array(false, '', '{6}', $ls32),
+ array(false, '::', '{0,5}', "(?:$h16(?::$h16)?|$ipv4)"),
+ array('', ':', '{4}', $ls32),
+ array('{1,2}', ':', '{3}', $ls32),
+ array('{1,3}', ':', '{2}', $ls32),
+ array('{1,4}', ':', '', $ls32),
+ array('{1,5}', ':', false, $ls32),
+ array('{1,6}', ':', false, $h16),
+ array('{1,7}', ':', false, ''),
+ array(false, '::', false, '')
+);
+
+$ipv6 = '(?:';
+foreach ($ipv6_construct as $ip_type)
+{
+ $ipv6 .= '(?:';
+ if ($ip_type[0] !== false)
+ {
+ $ipv6 .= "(?:$h16:)" . $ip_type[0];
+ }
+ $ipv6 .= $ip_type[1];
+ if ($ip_type[2] !== false)
+ {
+ $ipv6 .= "(?:$h16:)" . $ip_type[2];
+ }
+ $ipv6 .= $ip_type[3] . ')|';
+}
+$ipv6 = substr($ipv6, 0, -1) . ')';
+
+echo 'IPv4: ' . $ipv4 . "<br /><br />\n\nIPv6: " . $ipv6 . "<br /><br />\n\n";
+
+// URL regular expressions
+
+/* IDN2008 characters derivation
+** http://unicode.org/faq/idn.html#33 - IDN FAQ: derivation of valid characters in terms of Unicode properties
+** http://unicode.org/reports/tr46/ - Unicode Technical Standard #46. Unicode IDNA Compatibility Processing
+** http://www.unicode.org/Public/UNIDATA/DerivedNormalizationProps.txt - Unicode Character Database
+*/
+/*
+** Remove Control Characters and Whitespace (as in IDNA2003)
+*/
+$no_cc = '\p{C}\p{Z}';
+/*
+** Remove Symbols, Punctuation, non-decimal Numbers, and Enclosing Marks
+*/
+$no_symbol = '\p{S}\p{P}\p{Nl}\p{No}\p{Me}';
+/*
+** Remove characters used for archaic Hangul (Korean) - \p{HST=L} and \p{HST=V}
+** as per http://unicode.org/Public/UNIDATA/HangulSyllableType.txt
+*/
+$no_hangul = '\x{1100}-\x{115F}\x{A960}-\x{A97C}\x{1160}-\x{11A7}\x{D7B0}-\x{D7C6}';
+/*
+** Remove three blocks of technical or archaic symbols.
+*/
+$no_cdm = '\x{20D0}-\x{20FF}'; // \p{block=Combining_Diacritical_Marks_For_Symbols}
+$no_musical = '\x{1D100}-\x{1D1FF}'; // \p{block=Musical_Symbols}
+$no_ancient_greek_musical = '\x{1D200}-\x{1D24F}'; // \p{block=Ancient_Greek_Musical_Notation}
+/* Remove certain exceptions:
+** U+0640 ARABIC TATWEEL
+** U+07FA NKO LAJANYALAN
+** U+302E HANGUL SINGLE DOT TONE MARK
+** U+302F HANGUL DOUBLE DOT TONE MARK
+** U+3031 VERTICAL KANA REPEAT MARK
+** U+3032 VERTICAL KANA REPEAT WITH VOICED SOUND MARK
+** ..
+** U+3035 VERTICAL KANA REPEAT MARK LOWER HALF
+** U+303B VERTICAL IDEOGRAPHIC ITERATION MARK
+*/
+$no_certain_exceptions = '\x{0640}\x{07FA}\x{302E}\x{302F}\x{3031}-\x{3035}\x{303B}';
+/* Add certain exceptions:
+** U+00B7 MIDDLE DOT
+** U+0375 GREEK LOWER NUMERAL SIGN
+** U+05F3 HEBREW PUNCTUATION GERESH
+** U+05F4 HEBREW PUNCTUATION GERSHAYIM
+** U+30FB KATAKANA MIDDLE DOT
+** U+002D HYPHEN-MINUS
+** U+06FD ARABIC SIGN SINDHI AMPERSAND
+** U+06FE ARABIC SIGN SINDHI POSTPOSITION MEN
+** U+0F0B TIBETAN MARK INTERSYLLABIC TSHEG
+** U+3007 IDEOGRAPHIC NUMBER ZERO
+*/
+$add_certain_exceptions = '\x{00B7}\x{0375}\x{05F3}\x{05F4}\x{30FB}\x{002D}\x{06FD}\x{06FE}\x{0F0B}\x{3007}';
+/* Add special exceptions (Deviations):
+** U+00DF LATIN SMALL LETTER SHARP S
+** U+03C2 GREEK SMALL LETTER FINAL SIGMA
+** U+200C ZERO WIDTH NON-JOINER
+** U+200D ZERO WIDTH JOINER
+*/
+$add_deviations = '\x{00DF}\x{03C2}\x{200C}\x{200D}';
+
+// Concatenate remove/add regexes respectively
+$remove_chars = "$no_cc$no_symbol$no_hangul$no_cdm$no_musical$no_ancient_greek_musical$no_certain_exceptions";
+$add_chars = "$add_certain_exceptions$add_deviations";
+
+// Initialize inline mode
+$inline = false;
+
+do
+{
+ $inline = !$inline;
+
+ $pct_encoded = "%[\dA-F]{2}";
+ $unreserved = "$add_chars\pL0-9\-._~";
+ $sub_delims = ($inline) ? '!$&\'(*+,;=' : '!$&\'()*+,;=';
+ $scheme = ($inline) ? '[a-z][a-z\d+]*': '[a-z][a-z\d+\-.]*' ; // avoid automatic parsing of "word" in "last word.http://..."
+ $pchar = "(?:[^$remove_chars]*[$unreserved$sub_delims:@|]+|$pct_encoded)"; // rfc: no "|"
+
+ $reg_name = "(?:[^$remove_chars]*[$unreserved$sub_delims:@|]+|$pct_encoded)+"; // rfc: * instead of + and no "|" and no "@" and no ":" (included instead of userinfo)
+ //$userinfo = "(?:(?:[$unreserved$sub_delims:]+|$pct_encoded))*";
+ $ipv4_simple = '[0-9.]+';
+ $ipv6_simple = '\[[a-z0-9.]+:[a-z0-9.]+:[a-z0-9.:]+\]';
+ $host = "(?:$reg_name|$ipv4_simple|$ipv6_simple)";
+ $port = '\d*';
+ //$authority = "(?:$userinfo@)?$host(?::$port)?";
+ $authority = "$host(?::$port)?";
+ $segment = "$pchar*";
+ $path_abempty = "(?:/$segment)*";
+ $hier_part = "/{2}$authority$path_abempty";
+ $query = "(?:[^$remove_chars]*[$unreserved$sub_delims:@/?|]+|$pct_encoded)*"; // pchar | "/" | "?", rfc: no "|"
+ $fragment = $query;
+
+ $url = "$scheme:$hier_part(?:\?$query)?(?:\#$fragment)?";
+ echo (($inline) ? 'URL inline: ' : 'URL: ') . $url . "<br /><br />\n\n";
+
+ // no scheme, shortened authority, but host has to start with www.
+ $www_url = "www\.$reg_name(?::$port)?$path_abempty(?:\?$query)?(?:\#$fragment)?";
+ echo (($inline) ? 'www.URL_inline: ' : 'www.URL: ') . $www_url . "<br /><br />\n\n";
+
+ // no schema and no authority
+ $relative_url = "$segment$path_abempty(?:\?$query)?(?:\#$fragment)?";
+ echo (($inline) ? 'relative URL inline: ' : 'relative URL: ') . $relative_url . "<br /><br />\n\n";
+}
+while ($inline);
diff --git a/phpBB/develop/remove-php-end-tags.py b/phpBB/develop/remove-php-end-tags.py
new file mode 100755
index 0000000000..89b9ee5032
--- /dev/null
+++ b/phpBB/develop/remove-php-end-tags.py
@@ -0,0 +1,65 @@
+#!/usr/bin/env python
+# Remove ending PHP tags '?>'
+# @author Oleg Pudeyev
+# @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+
+import sys, os, os.path, optparse
+
+def error(message, code):
+ print >>sys.stderr, message
+ exit(code)
+
+
+parser = optparse.OptionParser()
+parser.add_option('-a', '--aggressive', help='Remove ending tags when they are followed by whitespace', action='store_true')
+options, args = parser.parse_args()
+
+if len(args) != 1:
+ parser.usage()
+ error("Usage: remove-php-end-tags path", 2)
+
+path = args[0]
+
+if not os.path.exists(path):
+ error("Path does not exist: %s" % path, 3)
+
+if options.aggressive:
+ import re
+
+ fix_re = re.compile(r'\s*\?>\s*$')
+ def fix_content(content):
+ content = fix_re.sub(r'\n', content)
+ return content
+else:
+ def fix_content(content):
+ if content.endswith('?>'):
+ content = content[:-2].strip() + "\n"
+ return content
+
+def process_file(path):
+ f = open(path)
+ try:
+ content = f.read()
+ finally:
+ f.close()
+ fixed_content = fix_content(content)
+ if content != fixed_content:
+ f = open(path, 'w')
+ try:
+ f.write(fixed_content)
+ finally:
+ f.close()
+
+def process_dir(path):
+ for root, dirs, files in os.walk(path):
+ if '.svn' in dirs:
+ dirs.remove('.svn')
+ for file in files:
+ if file.endswith('.php'):
+ path = os.path.join(root, file)
+ process_file(path)
+
+if os.path.isdir(path):
+ process_dir(path)
+else:
+ process_file(path)
diff --git a/phpBB/develop/rename_interfaces.php b/phpBB/develop/rename_interfaces.php
new file mode 100644
index 0000000000..90bf9cc205
--- /dev/null
+++ b/phpBB/develop/rename_interfaces.php
@@ -0,0 +1,56 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+//
+// 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");
+
+$code_dir = realpath(__DIR__ . '/../');
+$test_dir = realpath(__DIR__ . '/../../tests/');
+$iterator = new \AppendIterator();
+$iterator->append(new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($code_dir)));
+$iterator->append(new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($test_dir)));
+
+$map = array(
+ 'phpbb\request\request_interface' => 'phpbb\request\request_interface',
+ 'phpbb\auth\provider\provider_interface' => 'phpbb\auth\provider\provider_interface',
+ 'phpbb\avatar\driver\driver_interface' => 'phpbb\avatar\driver\driver_interface',
+ 'phpbb\cache\driver\driver_interface' => 'phpbb\cache\driver\driver_interface',
+ 'phpbb\db\migration\tool\tool_interface' => 'phpbb\db\migration\tool\tool_interface',
+ 'phpbb\extension\extension_interface' => 'phpbb\extension\extension_interface',
+ 'phpbb\groupposition\groupposition_interface' => 'phpbb\groupposition\groupposition_interface',
+ 'phpbb\log\log_interface' => 'phpbb\log\log_interface',
+ 'phpbb\notification\method\method_interface' => 'phpbb\notification\method\method_interface',
+ 'phpbb\notification\type\type_interface' => 'phpbb\notification\type\type_interface',
+ 'phpbb\request\request_interface' => 'phpbb\request\request_interface',
+ 'phpbb\tree\tree_interface' => 'phpbb\tree\tree_interface',
+);
+
+foreach ($iterator as $file)
+{
+ if ($file->getExtension() == 'php')
+ {
+ $code = file_get_contents($file->getPathname());
+
+ foreach ($map as $orig => $new)
+ {
+ $code = preg_replace("#([^a-z0-9_\$])$orig([^a-z0-9_])#i", '\\1' . $new . '\\2', $code);
+ }
+ file_put_contents($file->getPathname(), $code);
+ }
+}
diff --git a/phpBB/develop/repair_bots.php b/phpBB/develop/repair_bots.php
index c5aaa75d9b..2c6e9ce091 100644
--- a/phpBB/develop/repair_bots.php
+++ b/phpBB/develop/repair_bots.php
@@ -128,7 +128,7 @@ function add_bots($bots)
'user_email' => '',
'user_lang' => $config['default_lang'],
'user_style' => 1,
- 'user_timezone' => 0,
+ 'user_timezone' => 'UTC',
'user_allow_massemail' => 0,
);
@@ -147,5 +147,3 @@ function add_bots($bots)
}
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/develop/search_fill.php b/phpBB/develop/search_fill.php
index 371c8c74cc..07c4024b2f 100644
--- a/phpBB/develop/search_fill.php
+++ b/phpBB/develop/search_fill.php
@@ -34,15 +34,13 @@ $user->setup();
$search_type = $config['search_type'];
-if (!file_exists($phpbb_root_path . 'includes/search/' . $search_type . '.' . $phpEx))
+if (!class_exists($search_type))
{
trigger_error('NO_SUCH_SEARCH_MODULE');
}
-require($phpbb_root_path . 'includes/search/' . $search_type . '.' . $phpEx);
-
$error = false;
-$search = new $search_type($error);
+$search = new $search_type($error, $phpbb_root_path, $phpEx, $auth, $config, $db, $user, $phpbb_dispatcher);
if ($error)
{
diff --git a/phpBB/develop/strip_icc_profiles.sh b/phpBB/develop/strip_icc_profiles.sh
index 779c7ffca7..b11a63616b 100755
--- a/phpBB/develop/strip_icc_profiles.sh
+++ b/phpBB/develop/strip_icc_profiles.sh
@@ -1,7 +1,12 @@
#!/bin/sh
#
-# @copyright (c) 2014 phpBB Group
-# @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+# This file is part of the phpBB Forum Software package.
+#
+# @copyright (c) phpBB Limited <https://www.phpbb.com>
+# @license GNU General Public License, version 2 (GPL-2.0)
+#
+# For full copyright and license information, please see
+# the docs/CREDITS.txt file.
#
if [ "$#" -ne 1 ]
diff --git a/phpBB/develop/unicode_testing.php b/phpBB/develop/unicode_testing.php
index 25a13d1325..ec3c71d078 100644
--- a/phpBB/develop/unicode_testing.php
+++ b/phpBB/develop/unicode_testing.php
@@ -116,5 +116,3 @@ function utf8_normalize_nfkc($strings)
return $strings;
}
-
-?> \ No newline at end of file
diff --git a/phpBB/develop/update_email_hash.php b/phpBB/develop/update_email_hash.php
index 80fd4bbc17..57aebe3ca0 100644
--- a/phpBB/develop/update_email_hash.php
+++ b/phpBB/develop/update_email_hash.php
@@ -54,4 +54,3 @@ echo 'FINISHED';
// Done
$db->sql_close();
-?> \ No newline at end of file
diff --git a/phpBB/develop/utf_normalizer_test.php b/phpBB/develop/utf_normalizer_test.php
index b8709888fe..27ff786db7 100644
--- a/phpBB/develop/utf_normalizer_test.php
+++ b/phpBB/develop/utf_normalizer_test.php
@@ -1,9 +1,13 @@
<?php
/**
*
-* @package phpBB3
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -387,4 +391,4 @@ function cp_to_utf($cp)
{
return chr($cp);
}
-} \ No newline at end of file
+}
diff --git a/phpBB/docs/AUTHORS b/phpBB/docs/AUTHORS
deleted file mode 100644
index ca56fe3b72..0000000000
--- a/phpBB/docs/AUTHORS
+++ /dev/null
@@ -1,89 +0,0 @@
-/**
-*
-* phpBB3 © Copyright phpBB Group
-* http://www.phpbb.com
-*
-* This program is free software: you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation, version 2 of the License.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program. If not, see <http://opensource.org/licenses/gpl-2.0.php>
-*
-*/
-
-Please see: http://www.phpbb.com/about/team/ for a list of all the people currently
-involved in phpBB.
-
-phpBB Lead Developer: naderman (Nils Adermann)
-
-phpBB Developers: bantu (Andreas Fischer)
- dhruv.goel92 (Dhruv Goel)
- Elsensee (Oliver Schramm)
- marc1706 (Marc Alexander)
- nickvergessen (Joas Schilling)
- Nicofuma (Tristan Darricau)
- prototech (Cesar Gallegos)
-
-Contributions by: leviatan21 (Gabriel Vazquez)
- Raimon (Raimon Meuldijk)
- Xore (Robert Hetzler)
-
-
--- Former Contributors --
-
-phpBB Project Manager: theFinn (James Atkinson) [Founder - 04/2007]
- SHS` (Jonathan Stanley)
-
-phpBB Lead Developer: Acyd Burn (Meik Sievertsen) [09/2005 - 01/2010]
- psoTFX (Paul S. Owen) [2001 - 09/2005]
-
-phpBB Developers: A_Jelly_Doughnut (Josh Woody) [01/2010 - 11/2010]
- Acyd Burn (Meik Sievertsen) [02/2003 - 09/2005]
- APTX (Marek A. Ruszczyński) [12/2007 - 04/2011]
- Arty (Vjacheslav Trushkin) [02/2012 - 07/2012]
- Ashe (Ludovic Arnaud) [10/2002 - 11/2003, 06/2006 - 10/2006]
- BartVB (Bart van Bragt) [11/2000 - 03/2006]
- ckwalsh (Cullen Walsh) [01/2010 - 07/2011]
- DavidMJ (David M.) [12/2005 - 08/2009]
- dhn (Dominik Dröscher) [05/2007 - 01/2011]
- EXreaction (Nathan Guse) [07/2012 - 05/2014]
- GrahamJE (Graham Eames) [09/2005 - 11/2006]
- igorw (Igor Wiedler) [08/2010 - 02/2013]
- imkingdavid (David King) [11/2012 - 06/2014]
- kellanved (Henry Sudhof) [04/2007 - 03/2011]
- Oleg (Oleg Pudeyev) [01/2011 - 05/2013]
- rxu (Ruslan Uzdenov) [04/2010 - 12/2012]
- TerraFrost (Jim Wigginton) [04/2009 - 01/2011]
- ToonArmy (Chris Smith) [06/2008 - 11/2011]
- Vic D'Elfant (Vic D'Elfant) [04/2007 - 04/2009]
-
--- Copyrights --
-
-Visual Confirmation: Xore (Robert Hetzler)
-
-Original subSilver by subBlue Design, Tom Beddard, (c) 2001 phpBB Group
-prosilver by subBlue Design, Tom Beddard, (c) 2004 phpBB Group
-subsilver2 by subBlue Design, Tom Beddard, (c) 2004 phpBB Group
-
-phpBB3 contains code from the following applications:
-
-LGPL licenced:
-Smarty (c) 2001, 2002 by ispi of Lincoln, Inc, http://smarty.php.net/
-
-GPL licenced:
-phpMyAdmin (c) 2001,2003 phpMyAdmin Devel team, http://www.phpmyadmin.net/
-Jabber Class (c) 2006 Flyspray.org, http://www.flyspray.org/
-Chora (c) 2000-2006, The Horde Project. http://horde.org/chora/
-Horde Project (c) 2000-2006, The Horde Project. http://horde.org/
-
-PHP License, version 3.0:
-Pear (c) 2001-2004 PHP Group, http://pear.php.net
-
-Text_Diff-0.2.1 http://pear.php.net/package/Text_Diff
-
diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html
index 2c400ce212..a149e3d6c5 100644
--- a/phpBB/docs/CHANGELOG.html
+++ b/phpBB/docs/CHANGELOG.html
@@ -1,19 +1,13 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en" xml:lang="en">
+<!DOCTYPE html>
+<html dir="ltr" lang="en">
<head>
-
-<meta http-equiv="content-type" content="text/html; charset=utf-8" />
-<meta http-equiv="content-style-type" content="text/css" />
-<meta http-equiv="content-language" content="en" />
-<meta http-equiv="imagetoolbar" content="no" />
-<meta name="resource-type" content="document" />
-<meta name="distribution" content="global" />
-<meta name="copyright" content="phpBB Group" />
+<meta charset="utf-8">
+<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="keywords" content="" />
-<meta name="description" content="phpBB 3.0.x Changelog" />
-<title>phpBB3 &bull; Changelog</title>
+<meta name="description" content="phpBB 3.1.x Changelog" />
+<title>phpBB &bull; Changelog</title>
-<link href="stylesheet.css" rel="stylesheet" type="text/css" media="screen, projection" />
+<link href="assets/css/stylesheet.css" rel="stylesheet" type="text/css" media="screen" />
</head>
@@ -23,15 +17,15 @@
<a id="top" name="top" accesskey="t"></a>
<div id="page-header">
<div class="headerbar">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div id="doc-description">
- <a href="../index.php" id="logo"><img src="site_logo.gif" alt="" /></a>
- <h1>phpBB 3.0.x Changelog</h1>
+ <a href="../index.php" id="logo"><img src="assets/images/site_logo.gif" alt="" /></a>
+ <h1>phpBB 3.1.x Changelog</h1>
<p style="display: none;"><a href="#start_here">Skip</a></p>
</div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
</div>
@@ -41,18 +35,48 @@
<!-- BEGIN DOCUMENT -->
-<p>This is a non-exhaustive (but still near complete) changelog for phpBB 3.0.x including release candidate versions. Our thanks to all those people who've contributed bug reports and code fixes.</p>
+<p class="paragraph main-description">
+ This is a non-exhaustive (but still near complete) changelog for phpBB 3.1.x including release candidate versions.
+ Our thanks to all those people who've contributed bug reports and code fixes.
+</p>
<h1>Changelog</h1>
<div class="paragraph menu">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div class="content">
<ol>
<li><a href="#changelog">Changelog</a>
<ul>
+ <li><a href="#v3110">Changes since 3.1.10</a></li>
+ <li><a href="#v319">Changes since 3.1.9</a></li>
+ <li><a href="#v318">Changes since 3.1.8</a></li>
+ <li><a href="#v317pl1">Changes since 3.1.7-PL1</a></li>
+ <li><a href="#v317">Changes since 3.1.7</a></li>
+ <li><a href="#v316">Changes since 3.1.6</a></li>
+ <li><a href="#v315">Changes since 3.1.5</a></li>
+ <li><a href="#v314">Changes since 3.1.4</a></li>
+ <li><a href="#v313">Changes since 3.1.3</a></li>
+ <li><a href="#v313rc1">Changes since 3.1.3-RC1</a></li>
+ <li><a href="#v312">Changes since 3.1.2</a></li>
+ <li><a href="#v311">Changes since 3.1.1</a></li>
+ <li><a href="#v310">Changes since 3.1.0</a></li>
+ <li><a href="#v310RC6">Changes since 3.1.0-RC6</a></li>
+ <li><a href="#v310RC5">Changes since 3.1.0-RC5</a></li>
+ <li><a href="#v310RC4">Changes since 3.1.0-RC4</a></li>
+ <li><a href="#v310RC3">Changes since 3.1.0-RC3</a></li>
+ <li><a href="#v310RC2">Changes since 3.1.0-RC2</a></li>
+ <li><a href="#v310RC1">Changes since 3.1.0-RC1</a></li>
+ <li><a href="#v310b4">Changes since 3.1.0-b4</a></li>
+ <li><a href="#v310b3">Changes since 3.1.0-b3</a></li>
+ <li><a href="#v310b2">Changes since 3.1.0-b2</a></li>
+ <li><a href="#v310b1">Changes since 3.1.0-b1</a></li>
+ <li><a href="#v310a3">Changes since 3.1.0-a3</a></li>
+ <li><a href="#v310a2">Changes since 3.1.0-a2</a></li>
+ <li><a href="#v310a1">Changes since 3.1.0-a1</a></li>
+ <li><a href="#v30x">Changes since 3.0.x</a></li>
<li><a href="#v3013-PL1">Changes since 3.0.13-PL1</a></li>
<li><a href="#v3013">Changes since 3.0.13</a></li>
<li><a href="#v3012">Changes since 3.0.12</a></li>
@@ -84,7 +108,7 @@
</div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<hr />
@@ -92,9 +116,2844 @@
<a name="changelog"></a><h2>1. Changelog</h2>
<div class="paragraph">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
- <div class="content">
+<div class="content">
+
+ <a name="v3110"></a><h3>Changes since 3.1.10</h3>
+
+ <h4>Bug</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-7336">PHPBB3-7336</a>] - Words in new topic title aren't found by search after topic is split</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-8116">PHPBB3-8116</a>] - Server timeout or browsercrash after viewing postdetails</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-8301">PHPBB3-8301</a>] - admin log generate slow queries</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9590">PHPBB3-9590</a>] - Unable to update permissions for more than 6 forums at a time</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11076">PHPBB3-11076</a>] - Update notification in ACP for minimum PHP version missing essential information</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11483">PHPBB3-11483</a>] - Forced Activation needs looking at.</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11611">PHPBB3-11611</a>] - setup_github_network.php no longer creates a repository</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13247">PHPBB3-13247</a>] - Online indicator in post profile hides behind certain avatars</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13250">PHPBB3-13250</a>] - File cache does not write entries starting with _ and containing a slash</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13429">PHPBB3-13429</a>] - Changes tag in docblock of events should be unified</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13558">PHPBB3-13558</a>] - Error - stream_socket_enable_crypto()</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13757">PHPBB3-13757</a>] - Negative PM count</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14468">PHPBB3-14468</a>] - [php] - 'core.viewforum_modify_topics_data' add parameter forum_id</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14549">PHPBB3-14549</a>] - Correctly redirect back after topic merge in MCP</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14770">PHPBB3-14770</a>] - Plupload: WRONG_FILESIZE is used wrong</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14795">PHPBB3-14795</a>] - Topic merge bug</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14801">PHPBB3-14801</a>] - Search highlight option doesn't always highlight unicode strings</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14802">PHPBB3-14802</a>] - Empty/blank lines should not be additional poll options</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14806">PHPBB3-14806</a>] - Authentication for e-mail is not working</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14819">PHPBB3-14819</a>] - Soft deleted posts visible in topic review</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14821">PHPBB3-14821</a>] - Do not expect parsed HTML in kernel subscriber output</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14830">PHPBB3-14830</a>] - FORM_INVALID error on ACP search and CPF settings</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14831">PHPBB3-14831</a>] - Extension migration file fails</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14838">PHPBB3-14838</a>] - feeds.attachments_base - server 500 error for large attachment tables</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14844">PHPBB3-14844</a>] - BBcodes B and I return &lt;strong&gt; and &lt;em&gt; tags instead of CSS under inherited styles</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14859">PHPBB3-14859</a>] - PM report notifications only sent out to full Global Moderators</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14860">PHPBB3-14860</a>] - Broken link on subscriptions page on mobile devices</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14863">PHPBB3-14863</a>] - &quot;Array&quot; in message title when permanently deleting posts</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14864">PHPBB3-14864</a>] - ACP datefromat text input still has 30 max length while dateformat field had been expanded to 64</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14876">PHPBB3-14876</a>] - Multibyte message is not displayed properly on exception</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14877">PHPBB3-14877</a>] - CSS error in &quot;.codebox code&quot; definition</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14881">PHPBB3-14881</a>] - Problems using EVENT (overall_footer_content_after)</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14888">PHPBB3-14888</a>] - Missing check for disabled profile field types</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14889">PHPBB3-14889</a>] - Missing method declaration in profile fields type interface</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14890">PHPBB3-14890</a>] - Wrong validation of input field in profile field type string</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14906">PHPBB3-14906</a>] - Duplicated sig key in user_cache_data array</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14923">PHPBB3-14923</a>] - SQL PostgreSQL blocking errors during DB update installation</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14938">PHPBB3-14938</a>] - Inconsistent data results from ext_mgr-&gt;all_available() vs ext_mgr-&gt;is_available()</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14941">PHPBB3-14941</a>] - MySQL Fulltext search index creating still fails on InnoDB</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14943">PHPBB3-14943</a>] - Template loop access gives PHP error</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14953">PHPBB3-14953</a>] - Incorrect &quot;order by&quot; definition in ucp_pm_viewfolder</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14968">PHPBB3-14968</a>] - Version check marks 3.1.10 boards as outdated </li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14997">PHPBB3-14997</a>] - Bad Position for topiclist_row_topic_title_after</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14998">PHPBB3-14998</a>] - ACP Update link is incorrect!</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-15003">PHPBB3-15003</a>] - When using mark all, disabled check boxes should not become checked</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-15006">PHPBB3-15006</a>] - Permission inheritance with checkbox not working</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-15011">PHPBB3-15011</a>] - Error not checked on metadata load failure</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-15108">PHPBB3-15108</a>] - Duplicate code in request-&gt;overwrite</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-15143">PHPBB3-15143</a>] - version check on branch is broken</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-15146">PHPBB3-15146</a>] - Date profile field validation incorrect</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-15150">PHPBB3-15150</a>] - Yabber SSL/TLS certification</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-15186">PHPBB3-15186</a>] - The force_delete_allowed flag does not affect actual posts deletion ability</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-15187">PHPBB3-15187</a>] - ACP Template files not purged during Extension Enable</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-15246">PHPBB3-15246</a>] - Memcache driver incorrectly handles Unix sockets</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-15248">PHPBB3-15248</a>] - Event core.modify_posting_auth does not honor its parameters</li>
+ </ul>
+ <h4>Improvement</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9211">PHPBB3-9211</a>] - List subforums-links separately in parent-forums' legend</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12749">PHPBB3-12749</a>] - core.submit_post_end add subject to the event data</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13457">PHPBB3-13457</a>] - New Hooks for ucp_main</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13459">PHPBB3-13459</a>] - New Template-Event in overall_header.html</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13479">PHPBB3-13479</a>] - Add hook for modifying highlighting on viewtopic</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13601">PHPBB3-13601</a>] - New event upon acl_clear_prefetch</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13603">PHPBB3-13603</a>] - New event upon index_body_online_block_after</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13605">PHPBB3-13605</a>] - New event upon ucp_pm_compose_predefined_message</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13608">PHPBB3-13608</a>] - New event upon ucp_restore_permissions</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13609">PHPBB3-13609</a>] - New event upon ucp_switch_permissions</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13845">PHPBB3-13845</a>] - Add event when user changes or delete avatar</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14119">PHPBB3-14119</a>] - [PHP] - (User) unban event request</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14239">PHPBB3-14239</a>] - [PHP] - Add event ucp_remind_modify_select_sql</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14331">PHPBB3-14331</a>] - Add rank calculation or result event access</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14520">PHPBB3-14520</a>] - [Template] - ucp_pm_viewmessage_message_body_after</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14522">PHPBB3-14522</a>] - [Template] - ucp_register_buttons_before</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14524">PHPBB3-14524</a>] - [PHP] - core.ucp_register_requests_after</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14733">PHPBB3-14733</a>] - Support increasing hashing cost factor</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14750">PHPBB3-14750</a>] - Fileupload form should not set invalid attributes for file input</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14758">PHPBB3-14758</a>] - ACP-Parameter &quot;Maximum thumbnail width in pixel&quot; should be &quot;Maximum thumbnail width/heigth in pixel:&quot;</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14759">PHPBB3-14759</a>] - Event core.mcp_main_modify_shadow_sql</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14760">PHPBB3-14760</a>] - Event core.mcp_main_modify_fork_sql</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14786">PHPBB3-14786</a>] - Add mcp_forum_actions_before/after events</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14804">PHPBB3-14804</a>] - Add core event to MCP after merging topics</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14805">PHPBB3-14805</a>] - Allow building package for previous versions on PHP 7</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14808">PHPBB3-14808</a>] - Add template event overall_header_searchbox_after</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14817">PHPBB3-14817</a>] - Add core event on includes/functions_download.php</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14825">PHPBB3-14825</a>] - Add OAuth events</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14827">PHPBB3-14827</a>] - Possibility to add multiple form keys</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14842">PHPBB3-14842</a>] - Avatar size 0 - unlimited</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14847">PHPBB3-14847</a>] - Add php event to add options in ACP Attachments</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14848">PHPBB3-14848</a>] - Add ACP template events after extensions list titles</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14849">PHPBB3-14849</a>] - Add ACP extension event</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14850">PHPBB3-14850</a>] - Add core events for smilies</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14852">PHPBB3-14852</a>] - Add core event to the function build_header()</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14853">PHPBB3-14853</a>] - Add core event to allow modifying PM attachments download auth</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14855">PHPBB3-14855</a>] - Update notifications and PM alert bubbles</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14870">PHPBB3-14870</a>] - Add php events to modify list of PMs</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14872">PHPBB3-14872</a>] - Remove count versus sizeof restriction in coding guidelines</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14874">PHPBB3-14874</a>] - Error on sending a .pak smiley</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14882">PHPBB3-14882</a>] - Add core event to MCP after move posts sync</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14887">PHPBB3-14887</a>] - ACP profile step 1 lang specific event</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14918">PHPBB3-14918</a>] - Provide quick access to extension version metadata</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14940">PHPBB3-14940</a>] - Add ACP template event acp_ext_details_end</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14957">PHPBB3-14957</a>] - Do not cache database config</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14958">PHPBB3-14958</a>] - Twig extension function lang() performs redundant template data copying</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-15020">PHPBB3-15020</a>] - Add Events for mcp_topic_postrow_post_subject</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-15059">PHPBB3-15059</a>] - Do not wrap content in code box</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-15081">PHPBB3-15081</a>] - Add ACP template event acp_ext_details_notice</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-15107">PHPBB3-15107</a>] - Add additional vars to event</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-15131">PHPBB3-15131</a>] - Add variable to the 'core.mcp_main_modify_fork_sql' event</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-15142">PHPBB3-15142</a>] - Extension Version Check Should Support Branches</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-15151">PHPBB3-15151</a>] - ACP Cookie settings should contain explanatory text for all fields</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-15199">PHPBB3-15199</a>] - Add core event to the function send() in the messenger</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-15200">PHPBB3-15200</a>] - Allow extensions using custom templates for help/faq controllers </li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-15205">PHPBB3-15205</a>] - Add template events to forumlist_body.html</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-15219">PHPBB3-15219</a>] - Add cron to update passwords hashes to bcrypt</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-15226">PHPBB3-15226</a>] - Add index for latest topics query in feeds</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-15237">PHPBB3-15237</a>] - Unguarded includes functions_user</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-15238">PHPBB3-15238</a>] - Add console command to fix left/right IDs for the forums and modules</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-15241">PHPBB3-15241</a>] - Add ACP template event acp_profile_contact_last</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-15250">PHPBB3-15250</a>] - Add core event to MCP at the end of merge_posts</li>
+ </ul>
+ <h4>New Feature</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12545">PHPBB3-12545</a>] - new pre-posting event</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13730">PHPBB3-13730</a>] - [PHP] - core.delete_post_end</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14390">PHPBB3-14390</a>] - [prosilver] - ucp_main_front_user_details_after</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14498">PHPBB3-14498</a>] - Not possible to deactivate display of &quot;who is online&quot; and birthdays for guests</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14662">PHPBB3-14662</a>] - [Template] - memberlist_team_username_prepend &amp; append</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14868">PHPBB3-14868</a>] - [Template] - mcp_forum_modify_select_after</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14996">PHPBB3-14996</a>] - [event] - Add Event search_results_topictitle_after</li>
+ </ul>
+ <h4>Sub-task</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13149">PHPBB3-13149</a>] - [Event] - core.phpbb_log_get_topic_auth_sql_before</li>
+ </ul>
+ <h4>Task</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-15178">PHPBB3-15178</a>] - Update 3.1.x dependencies</li>
+ </ul>
+
+ <a name="v319"></a><h3>Changes since 3.1.9</h3>
+
+ <h4>Bug</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11446">PHPBB3-11446</a>] - Use sql_in_set as designed and consistent with the rest of phpBB code in phpbb_notification_manager</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12230">PHPBB3-12230</a>] - Do not auto remove user group when Newly Registered Users group was disabled</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12925">PHPBB3-12925</a>] - Use plural for permanent delete posts/topics confirmation</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14109">PHPBB3-14109</a>] - MySQL InnoDB does not support multiple index definitions on the same query.</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14291">PHPBB3-14291</a>] - Function send_file_to_browser() endlessly overwrites 'filesize' in ATTACHMENTS_TABLE</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14610">PHPBB3-14610</a>] - Q&amp;A CAPTCHA logs error when it has been solved</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14615">PHPBB3-14615</a>] - delete avatar triggers the new min max value in the HTML5 inputs</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14616">PHPBB3-14616</a>] - Auto-prune fails on large forums</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14631">PHPBB3-14631</a>] - 3.1.9 DB cli update crashes with PHP Fatal error: Call to undefined function phpbb\truncate_string()</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14654">PHPBB3-14654</a>] - Imagemagick &gt; ImageMagick</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14661">PHPBB3-14661</a>] - Fix a typo in twig.php</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14673">PHPBB3-14673</a>] - Missing Language Variable</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14683">PHPBB3-14683</a>] - Typos in operators in some email templates</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14703">PHPBB3-14703</a>] - module.add adds a module to the wrong parent</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14704">PHPBB3-14704</a>] - Remove unused language files and corresponding functions</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14721">PHPBB3-14721</a>] - New registrants choosing old deleted usernames get linked to old accounts with namechange</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14742">PHPBB3-14742</a>] - Improvements to migrator</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14745">PHPBB3-14745</a>] - &quot;U_NOTIFICATION_SETTINGS&quot; contains an HTML entity but is printed in a plaintext email</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14755">PHPBB3-14755</a>] - Error in MCP Move posts</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14782">PHPBB3-14782</a>] - Quick Links &gt; Your Posts gives mysql error</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14788">PHPBB3-14788</a>] - Update developer list to reflect team changes</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14796">PHPBB3-14796</a>] - Log table is using constant in log delete method</li>
+ </ul>
+ <h4>Improvement</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13709">PHPBB3-13709</a>] - Fallback to english in email templates by extensions</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13716">PHPBB3-13716</a>] - Check phpBB version constant against config version</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13865">PHPBB3-13865</a>] - Complement core event search_modify_param</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14184">PHPBB3-14184</a>] - Missing info on SMTP mail function option</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14429">PHPBB3-14429</a>] - core.obtain_users_online_string_modify</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14466">PHPBB3-14466</a>] - Add an event to cron.php</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14469">PHPBB3-14469</a>] - [Template] - &lt;!-- EVENT viewforum_topicrow_before --&gt;</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14516">PHPBB3-14516</a>] - [Template] - memberlist_email_before</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14581">PHPBB3-14581</a>] - Add core events relating to soft delete</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14592">PHPBB3-14592</a>] - [PHP] - core.search_backend_search_after</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14596">PHPBB3-14596</a>] - Prevent installs of 3.1 on PHP 7</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14624">PHPBB3-14624</a>] - Add event to ucp_profile in signature section</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14630">PHPBB3-14630</a>] - Add event to ucp_pm_compose</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14638">PHPBB3-14638</a>] - [PHP] - multiple UCP subscription events for form data and template variables</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14643">PHPBB3-14643</a>] - Select newest file in restore list</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14652">PHPBB3-14652</a>] - Typo birthdays</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14664">PHPBB3-14664</a>] - Fix PHPDoc comment in cron manager</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14672">PHPBB3-14672</a>] - Add template event to viewforum</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14685">PHPBB3-14685</a>] - PHP event for altering announcements sql</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14687">PHPBB3-14687</a>] - Modify viewforum_modify_topicrow</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14688">PHPBB3-14688</a>] - Add core events to the feeds</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14689">PHPBB3-14689</a>] - Build 3.2.x API docs</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14695">PHPBB3-14695</a>] - Add posting_editor_subject_prepend/append template events</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14712">PHPBB3-14712</a>] - Add search.php core event to allow modifying the forum select list</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14713">PHPBB3-14713</a>] - Add core event to the admin function get_forum_list()</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14715">PHPBB3-14715</a>] - Add template events in posting_topic_review &amp; mcp_topic</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14720">PHPBB3-14720</a>] - Add global javascript variable 'phpbb' to jshint settings</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14727">PHPBB3-14727</a>] - Event core.search_modify_submit_parameters</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14738">PHPBB3-14738</a>] - Add core events to improve modifying forum lists</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14747">PHPBB3-14747</a>] - Add topic_last_poster_id and topic_last_post_time to Event core.modify_posting_auth</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14762">PHPBB3-14762</a>] - Add core event to session.php to alter IP address</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14781">PHPBB3-14781</a>] - Add core event to the function group_user_attributes()</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14783">PHPBB3-14783</a>] - Event - ACP Posting Buttons Before Custom BBCodes</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14784">PHPBB3-14784</a>] - missing rewrite for lighttpd</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14785">PHPBB3-14785</a>] - [Template event] - overall_header_headerbar_append</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14787">PHPBB3-14787</a>] - Add more parameters to the core.search_modify_url_parameters event</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14789">PHPBB3-14789</a>] - Add missing link hash and form token checks to ACP</li>
+ </ul>
+ <h4>New Feature</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13978">PHPBB3-13978</a>] - [PHP] - User control panel - on signature change</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14484">PHPBB3-14484</a>] - Support extensions in UI tests</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14506">PHPBB3-14506</a>] - [Template] - mcp_move_before</li>
+ </ul>
+ <h4>Task</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12133">PHPBB3-12133</a>] - Update list of browsers supporting filename* in Content-Disposition</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14538">PHPBB3-14538</a>] - Update composer dependencies</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14598">PHPBB3-14598</a>] - Phing Sniffer Testing Use Statements in DocBlocks</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14743">PHPBB3-14743</a>] - Remove PHP7 from test matrix in 3.1.x</li>
+ </ul>
+
+ <a name="v318"></a><h3>Changes since 3.1.8</h3>
+
+ <h4>Bug</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-8058">PHPBB3-8058</a>] - Default style in ACP-&gt;Board Settings not observing offset</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13028">PHPBB3-13028</a>] - &quot;View unanswered posts&quot; link should be called instead &quot;View unanswered topics&quot;</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13264">PHPBB3-13264</a>] - Editing an unapproved post as a moderator/admin approves it</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13521">PHPBB3-13521</a>] - Q&amp;A Captcha ACP, required fields error corrupts inputted data</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13630">PHPBB3-13630</a>] - NULL value parsed into $select_single can cause 403 Forbidden on certain restrictive hosting environments for &quot;Find a Member&quot; function within Private Message composition</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13681">PHPBB3-13681</a>] - Email queue shouldn't be cached by opcache</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13683">PHPBB3-13683</a>] - Controller generates urls with absolute path of phpbb's root</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13842">PHPBB3-13842</a>] - Missing rewrite module on IIS7 leads to an error</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13977">PHPBB3-13977</a>] - Fatal error entering UCP if bookmarked topic was deleted</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14132">PHPBB3-14132</a>] - SQL Error when creating a new subject on fresh installation</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14136">PHPBB3-14136</a>] - IE compatibility meta is missing in overall_header.html</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14241">PHPBB3-14241</a>] - Security bug into Spambot control Questions</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14272">PHPBB3-14272</a>] - Use valid html5 input elements in forms</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14290">PHPBB3-14290</a>] - Function set_modified_headers() never sends 304 'Not Modified' header</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14408">PHPBB3-14408</a>] - Remove span corners</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14422">PHPBB3-14422</a>] - Support cmd+enter &amp; ctrl+enter for submitting message</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14437">PHPBB3-14437</a>] - Place Inline Images on Post get scrambled up -- not follow the order you place them in.</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14443">PHPBB3-14443</a>] - jabber notification-template prefix &quot;short&quot; breaks resolution of paths in extensions</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14475">PHPBB3-14475</a>] - Do not log upon automatically removing users form newly registered users group</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14481">PHPBB3-14481</a>] - phpBB does not obey HTTP_X_FORWARDED_PORT header</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14483">PHPBB3-14483</a>] - call to header(arg, arg) function sendHeaders() in Response.php causes Error 500 in app.php generated links</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14496">PHPBB3-14496</a>] - Automatic update relies on cache creating files in cache folder</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14500">PHPBB3-14500</a>] - Duplicate newversion in build.xml</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14514">PHPBB3-14514</a>] - Users get skipped in passwords_convert_p1 migration</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14519">PHPBB3-14519</a>] - Do not query database for unread notifications if all are retrieved</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14532">PHPBB3-14532</a>] - Database column default incorrectly escaped on MSSQL</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14533">PHPBB3-14533</a>] - &quot;U_NOTIFICATION_SETTINGS&quot; doesn't return the correct URL</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14536">PHPBB3-14536</a>] - Force timestamp to be integer in user::format_date()</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14559">PHPBB3-14559</a>] - Attachments' behaviour in quotes</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14562">PHPBB3-14562</a>] - Extension's permissions don't have language fallback</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14570">PHPBB3-14570</a>] - Board versions for 3.2.x can be accidentally downgraded to 3.1.x</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14577">PHPBB3-14577</a>] - Stop using sizeof() inside for() loop</li>
+ </ul>
+ <h4>Improvement</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10356">PHPBB3-10356</a>] - Username search should find all users for administrators instead of NORMALs and FOUNDERs only</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12305">PHPBB3-12305</a>] - Add new event core.viewforum_get_topic_id_sql to control forum topic listing</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14134">PHPBB3-14134</a>] - Send warning notification PM in user's language.</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14316">PHPBB3-14316</a>] - Add memberlist_view.html template events before/after the custom fields and zebra links</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14365">PHPBB3-14365</a>] - Add core event to the function topic_review() </li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14366">PHPBB3-14366</a>] - Add core events to the function decode_message()</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14395">PHPBB3-14395</a>] - Add event core.viewtopic_add_quickmod_option_after</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14471">PHPBB3-14471</a>] - Add filedata var to the core.avatar_driver_upload_move_file_before event</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14486">PHPBB3-14486</a>] - Add an event and fix an event in login_box()</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14508">PHPBB3-14508</a>] - Change language notice on account activation</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14540">PHPBB3-14540</a>] - Adjust class recursive_dot_prefix_filter_iterator to increase performance</li>
+ </ul>
+ <h4>New Feature</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12684">PHPBB3-12684</a>] - Add a command to add a user from the CLI</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14189">PHPBB3-14189</a>] - [PHP] - core.gen_sort_selects_after</li>
+ </ul>
+ <h4>Task</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14538">PHPBB3-14538</a>] - Update composer dependencies</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14565">PHPBB3-14565</a>] - Updates composer to 1.0.0-b2</li>
+ </ul>
+
+ <a name="v317pl1"></a><h3>Changes since 3.1.7-PL1</h3>
+
+ <h4>Bug</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12441">PHPBB3-12441</a>] - Database-size in ACP missing after update MariaDB from 5.5 to 10.0</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12618">PHPBB3-12618</a>] - Extension Version Check does not support https</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13180">PHPBB3-13180</a>] - Increase the field size of date format to allow more syntax for other calendars</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13908">PHPBB3-13908</a>] - After clause in migration add_column schema tool not honored</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14046">PHPBB3-14046</a>] - Instant message (jabber) dialog says message sent on the creation screen</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14303">PHPBB3-14303</a>] - Some changes for UTF-8 variant on language pack?</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14374">PHPBB3-14374</a>] - Update dynamically generated jquery CDN script tag</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14386">PHPBB3-14386</a>] - open_basedir restriction in effect with remote upload avatar</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14387">PHPBB3-14387</a>] - Extend avatar-driver by extension in ACP not possible</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14394">PHPBB3-14394</a>] - Only purge cache in functional tests if necessary</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14396">PHPBB3-14396</a>] - Use VCHAR_UNI instead of VCHAR for user_dateformat</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14397">PHPBB3-14397</a>] - Fix @since tag in event 'core.ucp_prefs_view_after'</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14403">PHPBB3-14403</a>] - phpbb\log should still work even when no user data is given</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14407">PHPBB3-14407</a>] - Users not being removed from Newly Registered Users group</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14409">PHPBB3-14409</a>] - Update session page info before displaying online list</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14411">PHPBB3-14411</a>] - Delete permanently is not working as it should be</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14423">PHPBB3-14423</a>] - Display database size for Aria storage engine</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14425">PHPBB3-14425</a>] - Database tests do not allow using socket</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14427">PHPBB3-14427</a>] - Memberlist Display Wrong</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14433">PHPBB3-14433</a>] - Functional tests fail for extensions</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14439">PHPBB3-14439</a>] - Error page shown in Manage users -&gt; Anonymous -&gt; Select Form -&gt; Avatar when board wide all avatar settings are disabled</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14467">PHPBB3-14467</a>] - Automatic resize of textarea calculates wrong height</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14475">PHPBB3-14475</a>] - Do not log removal of users from newly registered group</li>
+ </ul>
+ <h4>Improvement</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14289">PHPBB3-14289</a>] - Add events in navbar header</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14356">PHPBB3-14356</a>] - Add template events to viewtopic around back2top link</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14412">PHPBB3-14412</a>] - Comment fixes for PHPDoc in the events</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14458">PHPBB3-14458</a>] - Explicitly state RewriteBase into .htaccess root file</li>
+ </ul>
+
+ <a name="v317"></a><h3>Changes since 3.1.7</h3>
+
+ <h4>Security Issue</h4>
+ <ul>
+ <li>[SECURITY-188] - Check form key in acp_bbcodes</li>
+ </ul>
+ <h4>Bug</h4>
+ <ul>
+ <li>[<a href="https://tracker.phpbb.com/browse/PHPBB3-14343">PHPBB3-14343</a>] - Undefined variable $phpbb_dispatcher when (un-)locking a topic or post</li>
+ </ul>
+
+ <a name="v316"></a><h3>Changes since 3.1.6</h3>
+
+ <h4>Bug</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-8839">PHPBB3-8839</a>] - Wrong new status of subforumlink on index</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-8920">PHPBB3-8920</a>] - PM-Report for every moderator</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9153">PHPBB3-9153</a>] - New member can delete pm just in one way</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9252">PHPBB3-9252</a>] - Conflict when (dis)approving a post by two moderators at the same time</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11468">PHPBB3-11468</a>] - Controllers can not set additional parameters of page_header()</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11971">PHPBB3-11971</a>] - Validating not correctly in Spambot countermeasures</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12616">PHPBB3-12616</a>] - Report notification is not removed when post is disapproved or deleted</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13202">PHPBB3-13202</a>] - dead code in sessions.php</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13423">PHPBB3-13423</a>] - Driver sqlite3 failed periodically</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13636">PHPBB3-13636</a>] - Unexpect return to previous page behaviour</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13656">PHPBB3-13656</a>] - database_upgrade.php fails when database password contains a % character</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13748">PHPBB3-13748</a>] - Wrong tooltip after poll vote change</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13759">PHPBB3-13759</a>] - submit_post doesn't take $data['post_time'] - into account</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13799">PHPBB3-13799</a>] - Avatar gallery subfolders paths are handled incorrectly</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13831">PHPBB3-13831</a>] - Post deletion reason is not appearing on moderation logs</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13835">PHPBB3-13835</a>] - File upload of large files where filename contains umlauts fails</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13846">PHPBB3-13846</a>] - Permissions around soft deleting are inconsistently handled</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13851">PHPBB3-13851</a>] - &quot;Can ignore flood limit&quot; permission not taking effect</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13892">PHPBB3-13892</a>] - &quot;Someone reports a post&quot; notification setting has no effect</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13945">PHPBB3-13945</a>] - Account re-activation does not create a notification</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13950">PHPBB3-13950</a>] - If disabled extension - no hidden permission set</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13960">PHPBB3-13960</a>] - Profile field validation may break</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13976">PHPBB3-13976</a>] - Fix comment typo in salted_md5 driver</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13988">PHPBB3-13988</a>] - Atom feeds use relative links for image attachments</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13992">PHPBB3-13992</a>] - Fix html5 error from output on w3.org its new validator</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14058">PHPBB3-14058</a>] - subsilver2 Contact us form doesn't have an email subject field</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14070">PHPBB3-14070</a>] - Disabled avatar types is still displayed on the forum</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14106">PHPBB3-14106</a>] - Sorting is unworkable while moderating forum (merge topics)</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14114">PHPBB3-14114</a>] - Inconsistency in install.html in 3.1.x Automatic uopdate package</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14127">PHPBB3-14127</a>] - Error in the BBCode FAQ in 'Linking to another site'</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14142">PHPBB3-14142</a>] - Remove unused ignore_configs from avatar drivers</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14143">PHPBB3-14143</a>] - Flush the in-memory mail queue when writing it to the disk</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14153">PHPBB3-14153</a>] - Notifications dropdown header doesn't clear floats</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14159">PHPBB3-14159</a>] - Not accessible link on main ACP page</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14161">PHPBB3-14161</a>] - The core.download_file_send_to_browser_before - $vars - 'extension' it does not exist</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14163">PHPBB3-14163</a>] - Select All in code bug in Edge</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14181">PHPBB3-14181</a>] - Custom report/denial reason not shown in user notifications</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14186">PHPBB3-14186</a>] - Incorrect string concatenation in phpbb_mcp_sorting()</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14200">PHPBB3-14200</a>] - Allow hidden users to see theself on viewonline</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14215">PHPBB3-14215</a>] - [ticket/14212] - Adding event after users have been removed to a group</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14217">PHPBB3-14217</a>] - [ticket/13591] - Change SQL query into array to allow</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14224">PHPBB3-14224</a>] - Fix trailing whitespaces</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14228">PHPBB3-14228</a>] - Vertical align of numbers in polls</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14236">PHPBB3-14236</a>] - Race condition in the functional tests</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14242">PHPBB3-14242</a>] - Fix on memberlist the sort method.</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14249">PHPBB3-14249</a>] - Online list isn't sorted anymore</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14258">PHPBB3-14258</a>] - Add event in auth::Login</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14271">PHPBB3-14271</a>] - Update nginx sample config</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14276">PHPBB3-14276</a>] - Function get_folder_status not setup for use of plurals</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14287">PHPBB3-14287</a>] - Loading indicator not removed after confirming action that does not produce a message</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14297">PHPBB3-14297</a>] - Uppercase and lowercase when sorting topics</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14334">PHPBB3-14334</a>] - Do not use deprecated function get_user_avatar() in user_loader</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14339">PHPBB3-14339</a>] - State support for PHP 7.0 in docs</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14346">PHPBB3-14346</a>] - Improve version check output when phpbb.com is unreachable</li>
+ </ul>
+ <h4>Improvement</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-7362">PHPBB3-7362</a>] - Title/Post Icons Need Attribute Text</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-8800">PHPBB3-8800</a>] - Add &quot;mark topics read&quot; link to &quot;View unread posts&quot;</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10343">PHPBB3-10343</a>] - ACP: searching for users does not show inactive accounts</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13684">PHPBB3-13684</a>] - Only resize attached file comments vertically</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13934">PHPBB3-13934</a>] - Enctype clause for forms may be needed for profile fields</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14066">PHPBB3-14066</a>] - Add template events to search_body.html</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14073">PHPBB3-14073</a>] - Add core events to the several places in includes/functions_admin.php</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14075">PHPBB3-14075</a>] - Event in posting preview</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14080">PHPBB3-14080</a>] - Add template events to viewforum_body.html before/after/append/prepend the topic row</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14088">PHPBB3-14088</a>] - Add core events to the search.php</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14089">PHPBB3-14089</a>] - [Template] - posting_topic_title_after</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14098">PHPBB3-14098</a>] - Add core events to the search backends (fulltext_*.php)</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14102">PHPBB3-14102</a>] - Add core event to the mcp_topic.php</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14113">PHPBB3-14113</a>] - Add core events to the memberlist.php for customizing members search</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14117">PHPBB3-14117</a>] - Add core events to index.php to allow modifying birthdays list</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14123">PHPBB3-14123</a>] - Add more descriptive help to the CLI commands</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14126">PHPBB3-14126</a>] - Add viewtopic_topic_title_after template event</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14133">PHPBB3-14133</a>] - Comment fix for phpbb_get_user_rank()</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14154">PHPBB3-14154</a>] - Include &quot;Clean Name&quot; for disabled Extensions</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14155">PHPBB3-14155</a>] - Add row highlighting to extensions and style management</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14156">PHPBB3-14156</a>] - Add the Symfony ResponseListener</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14164">PHPBB3-14164</a>] - Helpful instructions for database updates</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14170">PHPBB3-14170</a>] - Fix mcp_change_poster_after event</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14201">PHPBB3-14201</a>] - Add ACP template events</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14213">PHPBB3-14213</a>] - [PHP] - core.group_add_user_after</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14219">PHPBB3-14219</a>] - Add email address into inactive user display in ACP</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14261">PHPBB3-14261</a>] - Pages served from app.php can't disable the update of session_page</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14283">PHPBB3-14283</a>] - Add a &quot;Manage Group&quot; link on a group page</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14313">PHPBB3-14313</a>] - Don't display quote button on unapproved posts</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14343">PHPBB3-14343</a>] - Add event when locking/unlocking posts/topics</li>
+ </ul>
+ <h4>New Feature</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14144">PHPBB3-14144</a>] - [Template] - quickreply_editor_subject_before</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14146">PHPBB3-14146</a>] - [Template] - viewtopic_body_post_subject_before</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14187">PHPBB3-14187</a>] - [ACP Template] - acp_styles_before_table</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14188">PHPBB3-14188</a>] - [PHP] - core.acp_styles_action_before</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14191">PHPBB3-14191</a>] - [PHP] - core.get_gravatar_url_after</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14192">PHPBB3-14192</a>] - [PHP] - core.memberlist_memberrow_before</li>
+ </ul>
+ <h4>Task</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14140">PHPBB3-14140</a>] - Update Symfony to benefit from improvement to the console component</li>
+ </ul>
+
+
+ <a name="v315"></a><h3>Changes since 3.1.5</h3>
+
+ <h4>Bug</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10711">PHPBB3-10711</a>] - SQL error DUPLICATE for KEY in FORUMS_TRACK_TABLE </li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13711">PHPBB3-13711</a>] - disabled accounts receive mails</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13815">PHPBB3-13815</a>] - Event parameters in posting do not affect behavior as expected</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13903">PHPBB3-13903</a>] - Container naming doesn't allow Windows' semicolon</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13930">PHPBB3-13930</a>] - Check for correct spacing between keyword &amp; parenthesis in codesniffer</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13941">PHPBB3-13941</a>] - One test is blocked in an inifinite loop on php 5.5+ and with sqlite3</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13948">PHPBB3-13948</a>] - Only reports top level WHOIS IP for a user in ACP</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13949">PHPBB3-13949</a>] - Replace colon with colon lang key in memberlist search page</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13951">PHPBB3-13951</a>] - Jump to page function does not work since 3.1.5 upgrade</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13952">PHPBB3-13952</a>] - Fulltext Native errors from tidy_search cron task</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13955">PHPBB3-13955</a>] - 3.1.5 not loading CDN resources</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13962">PHPBB3-13962</a>] - Forum dropdown in MCP queue could expand beyond screen size</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13966">PHPBB3-13966</a>] - Change post's author --&gt; error message</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13967">PHPBB3-13967</a>] - BBCode guide - loading phpBB logo image breaks https</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13980">PHPBB3-13980</a>] - Current avatar not removed when uploading with different extension</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13984">PHPBB3-13984</a>] - AJAX Loading Indicator broken</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14037">PHPBB3-14037</a>] - Memberlist profile fields headlines not computed from same way as data</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14049">PHPBB3-14049</a>] - Plupload delete request should use config headers</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14069">PHPBB3-14069</a>] - Incorrect sql_fetchfield call in style_update_p1 migration</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14077">PHPBB3-14077</a>] - Select all code not work in Microsoft Edge</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14082">PHPBB3-14082</a>] - Fix wrong variables in fulltext native search for keyworded results</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14083">PHPBB3-14083</a>] - Fix wrong variables in fulltext mysql search for author search</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14093">PHPBB3-14093</a>] - Hardcoded language in ucp_pm_viewfolder.html</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14103">PHPBB3-14103</a>] - Underline in abbreviations in Firefox 40</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14104">PHPBB3-14104</a>] - Fix missing variable in fulltext native search query for total results for author</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14115">PHPBB3-14115</a>] - Microdata is not valid in prosilver</li>
+ </ul>
+ <h4>Improvement</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11530">PHPBB3-11530</a>] - Remove quotes that are too deep automatically</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12952">PHPBB3-12952</a>] - Display HTTP Output along with Status code in case assertion fails in functional tests</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13598">PHPBB3-13598</a>] - Add an option to post a locked topic</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13786">PHPBB3-13786</a>] - Add core events to add MCP post options</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13818">PHPBB3-13818</a>] - Browse Extensions Database link in Extension Manager</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13843">PHPBB3-13843</a>] - Add templates events to insert custom panel-tab into posting editor</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13863">PHPBB3-13863</a>] - [Template] - topiclist_row_append/topiclist_row_prepend in mcp_forum.html</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13879">PHPBB3-13879</a>] - We're using px most places but ems in others</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13882">PHPBB3-13882</a>] - Avatars in notifications should be lazy loaded</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13899">PHPBB3-13899</a>] - Add items to core.search_results_modify_search_title</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13911">PHPBB3-13911</a>] - Add configuration options to profile fields</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13931">PHPBB3-13931</a>] - Wrong order in docs/events.md</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13968">PHPBB3-13968</a>] - [PHP] - core.user_setup_after</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13971">PHPBB3-13971</a>] - Add draft_id variable to event core.posting_modify_template_vars</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13981">PHPBB3-13981</a>] - Events to intercept uploaded avatar deletion</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13995">PHPBB3-13995</a>] - Invalid HTML using Projection Media Type</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14002">PHPBB3-14002</a>] - Add template events before/after user details in ucp_main_front.html</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14005">PHPBB3-14005</a>] - Allow extensions control post buttons displaying</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14014">PHPBB3-14014</a>] - [PHP] - mcp_forum_view_actions</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14064">PHPBB3-14064</a>] - Add template events to ucp_pm_history.html</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14065">PHPBB3-14065</a>] - Add template events to attachment.html</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14067">PHPBB3-14067</a>] - Add template events to overall_header.html around feeds</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14068">PHPBB3-14068</a>] - New events around poll panel in viewtopic</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14072">PHPBB3-14072</a>] - Add core event to the function format_display()</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14085">PHPBB3-14085</a>] - [Template] - posting_topic_title_prepend</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14086">PHPBB3-14086</a>] - [Template] - Add mcp_forum_topic_title_*</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14090">PHPBB3-14090</a>] - [Template] - mcp_topic_topic_title_*</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14091">PHPBB3-14091</a>] - [Template] - mcp_topic_subject_*</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14101">PHPBB3-14101</a>] - Add core event to the download/file.php</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14116">PHPBB3-14116</a>] - sql_affectedrows has no arguments</li>
+ </ul>
+ <h4>New Feature</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12692">PHPBB3-12692</a>] - Add a console command to manage the thumbnail</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13311">PHPBB3-13311</a>] - Add php event to acp manage_forums when deleting content</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13974">PHPBB3-13974</a>] - Add php event for altering data when changing a post's poster</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13997">PHPBB3-13997</a>] - [Template] - posting_editor_submit_buttons</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14006">PHPBB3-14006</a>] - [PHP] - core.ucp_register_agreement</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14041">PHPBB3-14041</a>] - [Template] - viewtopic_dropdown_top_custom</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14042">PHPBB3-14042</a>] - [Template] - viewtopic_dropdown_bottom_custom</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14043">PHPBB3-14043</a>] - [PHP] - core.get_avatar_after</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14087">PHPBB3-14087</a>] - Add an event to ucp_activate.php.</li>
+ </ul>
+ <h4>Sub-task</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13694">PHPBB3-13694</a>] - Allow modifying the Postgres author search query for results</li>
+ </ul>
+ <h4>Task</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13947">PHPBB3-13947</a>] - Add CHItA to developer list</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14010">PHPBB3-14010</a>] - Update Plupload to 2.1.8</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14099">PHPBB3-14099</a>] - Update Twig to 1.20</li>
+ </ul>
+
+
+ <a name="v314"></a><h3>Changes since 3.1.4</h3>
+
+ <h4>Bug</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9563">PHPBB3-9563</a>] - Empty categories showing up on index</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11521">PHPBB3-11521</a>] - Missing language string when migration is invalid</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11532">PHPBB3-11532</a>] - acp_users_overview.html autocompletes &quot;confirm email&quot; and &quot;password&quot; fields in chrome</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13516">PHPBB3-13516</a>] - icc-profiler check should skip extensions vendor</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13564">PHPBB3-13564</a>] - User is not removed from oauth tables upon deletion</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13664">PHPBB3-13664</a>] - Allow changing total list for unapproved posts in mcp_front</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13755">PHPBB3-13755</a>] - uploading attachments results in error: parsing server response. </li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13763">PHPBB3-13763</a>] - Language Spelling Error: Completly</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13771">PHPBB3-13771</a>] - AJAX responses do not support exceptions messages</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13772">PHPBB3-13772</a>] - Error in @param variable type for phpbb\passwords\manager</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13779">PHPBB3-13779</a>] - Permission set migration tool grants regular users heightened permissions</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13787">PHPBB3-13787</a>] - Duplicate entry of poll_delete in prosilver template</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13792">PHPBB3-13792</a>] - Travis fails installing hhvm-nigthly</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13819">PHPBB3-13819</a>] - Add missing sql_freeresult() to files in includes/</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13822">PHPBB3-13822</a>] - Permissions are in the wrong category</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13823">PHPBB3-13823</a>] - Update package is missing file with inline whitespace changes</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13827">PHPBB3-13827</a>] - controller\helper::message does not return JSON object for AJAX requests</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13830">PHPBB3-13830</a>] - phpcs doesn't detect class using in catch blocks</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13833">PHPBB3-13833</a>] - Submit a lot of messages without timeout between messages</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13838">PHPBB3-13838</a>] - Add a sniff to ensure that the opening brace of a control statement is on the line after</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13852">PHPBB3-13852</a>] - Inconsistent tab navigation when login in</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13861">PHPBB3-13861</a>] - Old styles are not removed by style update migration</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13868">PHPBB3-13868</a>] - Adding multiple language files for acp/mcp/ucp modules is incorrectly handled for extensions</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13873">PHPBB3-13873</a>] - Remove broken print stylesheet in preference of &amp;view=print</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13875">PHPBB3-13875</a>] - Lint test should ignore cache, ext, and store folder</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13878">PHPBB3-13878</a>] - Properly display background images when printing with webkit browser</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13888">PHPBB3-13888</a>] - &quot;Couldn't fetch mysqli_result&quot; error on username search and egosearch</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13913">PHPBB3-13913</a>] - Post subject of password protected and list-only forums shown on board index</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13922">PHPBB3-13922</a>] - Whitespace found at end of line phpBB/includes/functions_admin.php</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13928">PHPBB3-13928</a>] - Fix build_cfg_template_test after ticket/sec-184 </li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13939">PHPBB3-13939</a>] - phpBB no longer shows error messages when uploading files with drag/drop</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13942">PHPBB3-13942</a>] - phpbb\user::set_lang() adds extra path and PHP extension to ext lang files</li>
+ </ul>
+ <h4>Improvement</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12101">PHPBB3-12101</a>] - Redirect for Microsoft servers in /includes/functions.php:redirect()</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12542">PHPBB3-12542</a>] - Highlight textarea when files are dragged over it</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12717">PHPBB3-12717</a>] - Improve the code sniffer</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13200">PHPBB3-13200</a>] - Add autocomplete=&quot;off&quot; to additional password fields</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13648">PHPBB3-13648</a>] - Allow extensions using custom bbcode validation methods</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13699">PHPBB3-13699</a>] - Add template events in viewforum_body.html before and after the title</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13745">PHPBB3-13745</a>] - Add veiwtopic.php core event to allow manipulating poll data</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13750">PHPBB3-13750</a>] - Add generate_forum_nav() core event to allow modifying navlinks text</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13752">PHPBB3-13752</a>] - Add viewonline.php core event to allow modifying forum data SQL query</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13753">PHPBB3-13753</a>] - Add template events to forum category header</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13778">PHPBB3-13778</a>] - Misleading instruction text for recaptcha plugin</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13790">PHPBB3-13790</a>] - Update phpcs to 2.3.2</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13791">PHPBB3-13791</a>] - Add more post buttons template events to viewtopic_body.html</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13808">PHPBB3-13808</a>] - Add event before and after the search form</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13809">PHPBB3-13809</a>] - Test php parsing on php7 on travis</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13841">PHPBB3-13841</a>] - Add event when topics are moved</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13858">PHPBB3-13858</a>] - Make the Plupload uploader instance available in the global namespace</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13872">PHPBB3-13872</a>] - Allow template events to have a changed tag</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13876">PHPBB3-13876</a>] - Use async webfontloader to load webfont from googles CDN</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13905">PHPBB3-13905</a>] - loading.gif loaded before document load when it isn't needed</li>
+ </ul>
+ <h4>Security Issue</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13917">PHPBB3-13917</a>] - Use hash_equals() if possible in password driver helper</li>
+ <li>[SECURITY-184] - Do not output passwords to HTML input fields</li>
+ </ul>
+ <h4>Sub-task</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13660">PHPBB3-13660</a>] - Allow changing the query for total reports in mcp_front</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13661">PHPBB3-13661</a>] - Allow changing how and which logs are retrieved</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13668">PHPBB3-13668</a>] - Allow modifying the query to get details from the post report</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13672">PHPBB3-13672</a>] - Allow changing the query to obtain the user-submitted report.</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13685">PHPBB3-13685</a>] - Allow modifying the keywords search query for mysql fulltext search</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13686">PHPBB3-13686</a>] - Allow modifying the fulltext native search query for total results before before</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13689">PHPBB3-13689</a>] - Allow modifying the Postgres native search query for results</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13691">PHPBB3-13691</a>] - Allow modifying the fulltext native search query for total results for author</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13693">PHPBB3-13693</a>] - Allow modifying the MySQL author search query for results</li>
+ </ul>
+ <h4>Task</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13807">PHPBB3-13807</a>] - Extend event exporter to filter by min or max version to allow generating event diffs for releases</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13887">PHPBB3-13887</a>] - JS could use some refactoring</li>
+ </ul>
+
+
+ <a name="v313"></a><h3>Changes since 3.1.3</h3>
+
+ <h4>Security</h4>
+ <ul>
+ <li>[SECURITY-180] - An insufficient check allowed users of the Google Chrome browser to be redirected to external domains (e.g. on login)</li>
+ </ul>
+ <h4>Bug</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-8050">PHPBB3-8050</a>] - Avatar &amp; Long PM recipients list break out of template</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-8250">PHPBB3-8250</a>] - Forum selections in MCP queue not working</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-8494">PHPBB3-8494</a>] - Cannot install two boards on the same postgresql database</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11424">PHPBB3-11424</a>] - Quick-Mod Tools race condition results in NO_MODE</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12368">PHPBB3-12368</a>] - Updating database fails in upgrade from 3.0 when trying twice without purging the cache</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13348">PHPBB3-13348</a>] - sql_freeresult() should be called in feed base class</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13414">PHPBB3-13414</a>] - download/file.php 304 Not Modified bug</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13433">PHPBB3-13433</a>] - A dot in email address leads to unwanted extraneous dot</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13463">PHPBB3-13463</a>] - Mark read icon displays on wrong side in RTL</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13469">PHPBB3-13469</a>] - Soft delete fails with error message</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13472">PHPBB3-13472</a>] - Notification for admin activation of user doesn't get pruned after the user is deleted</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13477">PHPBB3-13477</a>] - File caching of extensions' version check file doesn't work</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13493">PHPBB3-13493</a>] - $helper-&gt;route gives wrong path for guests with trailing slashes and mod_rewrite disabled</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13522">PHPBB3-13522</a>] - Q&amp;A Captcha ACP, admins can add blank answers</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13538">PHPBB3-13538</a>] - Add tests for pagination in nested loops</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13542">PHPBB3-13542</a>] - Add $error to core UCP event for better validating of new UCP options</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13550">PHPBB3-13550</a>] - Invalid JSON response returned when plupload dir is not writable</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13551">PHPBB3-13551</a>] - Authentication method- LDAP- entered value 'ldap base dn' does not display</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13555">PHPBB3-13555</a>] - Poll options preview rendered incorrectly by &lt;br /&gt; collision</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13563">PHPBB3-13563</a>] - No Private Message button shown in memberlist for subsilver2</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13568">PHPBB3-13568</a>] - Imagick path validated as relative path although ACP asks for absolute path</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13569">PHPBB3-13569</a>] - Use sql_freeresult for $result assignments and remove unneeded $result assignments</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13570">PHPBB3-13570</a>] - Mysqli extension supports persistent connection since PHP 5.3.0</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13577">PHPBB3-13577</a>] - Skip tests requiring fileinfo if fileinfo is not enabled</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13586">PHPBB3-13586</a>] - Allow '0' as username with Jabber notifications</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13587">PHPBB3-13587</a>] - SQL syntax errors in get_prune_users()</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13588">PHPBB3-13588</a>] - Information message for disabled fsockopen() is not displayed correctly</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13590">PHPBB3-13590</a>] - Remember me login keys should be centered</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13597">PHPBB3-13597</a>] - Modify variable-variable syntax to be compatible with PHP7</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13612">PHPBB3-13612</a>] - Functional test of extension fails if ext requires page refresh</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13615">PHPBB3-13615</a>] - Avatar Gallery shows categories but no images in subsilver2</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13617">PHPBB3-13617</a>] - Bot session continuation with invalid f= query paramter causes SQL error</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13618">PHPBB3-13618</a>] - Small grammatical typo in the English FAQ regarding COPPA</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13631">PHPBB3-13631</a>] - Fix variable name in core.phpbb_content_visibility_get_global_visibility_before event</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13639">PHPBB3-13639</a>] - Unused class icon-search-advanced references nonexistent image</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13644">PHPBB3-13644</a>] - Type hint dispatcher_interface instead of dispatcher</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13649">PHPBB3-13649</a>] - Subforum tooltip always displays &quot;no unread posts&quot; on viewforum.php</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13655">PHPBB3-13655</a>] - $phpbb_dispatcher undefined in phpbb_mcp_sorting()</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13657">PHPBB3-13657</a>] - Start testing against PHP7</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13666">PHPBB3-13666</a>] - data-clicked attribute is not always removed on ajax form submissions</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13667">PHPBB3-13667</a>] - Big buttons are incorrectly aligned in Chrome on Windows</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13670">PHPBB3-13670</a>] - Fix fatal function name must be a string in functional tests</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13698">PHPBB3-13698</a>] - Incorrect password message shows unparsed &quot;Board Administrator&quot;-link</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13702">PHPBB3-13702</a>] - Page is zoomed in by default on iOS devices in landscape mode</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13703">PHPBB3-13703</a>] - Uploaded avatars are not loading correctly when passing through the events</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13719">PHPBB3-13719</a>] - Remove superfluous $search_options in acp_search.php </li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13721">PHPBB3-13721</a>] - URL Rewriting doesn't work on IIS7</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13723">PHPBB3-13723</a>] - Update docs/AUTHORS for 3.1.4-RC1</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13726">PHPBB3-13726</a>] - Responsive breadcrumbs JavaScript incorrectly calculates width of hidden items</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13727">PHPBB3-13727</a>] - Responsive breadcrumbs JavaScript doesn't reset wrap- classes when resizing</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13732">PHPBB3-13732</a>] - Update composer for PHP7 compatibility</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13736">PHPBB3-13736</a>] - Replace colons with colon lang keys in Contact us page</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13738">PHPBB3-13738</a>] - Sami still refers to develop-* branches</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13741">PHPBB3-13741</a>] - Remove outdated comments in CSS files</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13742">PHPBB3-13742</a>] - Local avatar driver is not generating correct urls on index</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13743">PHPBB3-13743</a>] - Missing global vars $phpbb_root_path and $phpEx in message_parser.php</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13747">PHPBB3-13747</a>] - Fix test_validate_path_linux method</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13749">PHPBB3-13749</a>] - Add missing slash to base uri in helper route tests</li>
+ </ul>
+ <h4>Improvement</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13313">PHPBB3-13313</a>] - Add a core php event to the mass email form</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13467">PHPBB3-13467</a>] - Add a CONTRIBUTING file to the project on Github</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13510">PHPBB3-13510</a>] - Add template event before/after the pagination on viewtopic</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13512">PHPBB3-13512</a>] - Add template events to viewtopic_body.html before/after the post details</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13518">PHPBB3-13518</a>] - Add core event to markread() in functions.php</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13532">PHPBB3-13532</a>] - Add core event to get_unread_topics() in functions.php</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13533">PHPBB3-13533</a>] - Add template events to the header of search_results.html</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13535">PHPBB3-13535</a>] - Add ucp_profile.php core event to allow modifying account settings on editing</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13536">PHPBB3-13536</a>] - Add UCP/ACP core events to allow modifying user profile data on editing</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13537">PHPBB3-13537</a>] - Add core events on mcp_queue for approval and disapproval</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13540">PHPBB3-13540</a>] - Add events to the topic review while posting and moderating posts</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13578">PHPBB3-13578</a>] - Add ucp_register.php core event</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13591">PHPBB3-13591</a>] - Add functions.php core event to the function obtain_users_online_string()</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13595">PHPBB3-13595</a>] - Remove unused instances of the bbcode class</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13596">PHPBB3-13596</a>] - Add display_forums() core event to allow modifying forums list data</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13600">PHPBB3-13600</a>] - Add core event to allow extensions to create a custom help page</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13602">PHPBB3-13602</a>] - Add template event overall_header_navbar_before</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13628">PHPBB3-13628</a>] - Add template events into ucp profile html files</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13635">PHPBB3-13635</a>] - Add sql_ary to UCP profile event</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13637">PHPBB3-13637</a>] - Add php event for modifying the data when composing a PM</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13643">PHPBB3-13643</a>] - kernel_terminate_subscriber should have a very low priority</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13650">PHPBB3-13650</a>] - New core event for UCP profile mode</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13658">PHPBB3-13658</a>] - [Event] - Before and after deletion of topics</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13675">PHPBB3-13675</a>] - Add validate to acp_profile event and add template events</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13679">PHPBB3-13679</a>] - Add template event overall_header_searchbox_before</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13701">PHPBB3-13701</a>] - New posting_pm_layout.html template events to wrap &quot;include posting_pm_header.html&quot;</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13710">PHPBB3-13710</a>] - Add template events around smilies display</li>
+ </ul>
+ <h4>New Feature</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13336">PHPBB3-13336</a>] - New core events for user activation</li>
+ </ul>
+ <h4>Sub-task</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13142">PHPBB3-13142</a>] - [Event] - Before query to list unapproved and deleted posts</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13592">PHPBB3-13592</a>] - Add core event to allow changing get_visibility_sql's result</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13621">PHPBB3-13621</a>] - Fix event phpbb_content_visibility_get_forums_visibility_before to get where_sql working as specified</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13625">PHPBB3-13625</a>] - Add more variables to core.viewforum_get_topic_data</li>
+ </ul>
+ <h4>Task</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9457">PHPBB3-9457</a>] - [Accessibility] - Add WAI-ARIA landmarks to the Prosilver template files</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12599">PHPBB3-12599</a>] - Update documentation styling</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13572">PHPBB3-13572</a>] - Upgrade composer to 1.0.0-alpha9</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13626">PHPBB3-13626</a>] - Add branch aliases</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13634">PHPBB3-13634</a>] - Update README to show new branch names</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13640">PHPBB3-13640</a>] - Rearrange order of color css rules</li>
+ </ul>
+
+ <a name="v313rc1"></a><h3>Changes since 3.1.3-RC1</h3>
+
+ <h4>Bug</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12933">PHPBB3-12933</a>] - The search operator for partial matches does not work</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13544">PHPBB3-13544</a>] - Migrations' &quot;permission.permission_unset&quot; deletes all permissions instead of just the one stated</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13556">PHPBB3-13556</a>] - Translated exceptions from file_downloader are handled incorrectly</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13557">PHPBB3-13557</a>] - Migrations for 3.0.13 and PL1 are missing</li>
+ </ul>
+ <h4>Task</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13553">PHPBB3-13553</a>] - Controller helper needs a message handler to replace error handler</li>
+ </ul>
+
+ <a name="v312"></a><h3>Changes since 3.1.2</h3>
+
+ <h4>Security</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13519">PHPBB3-13519</a>] - Correctly validate imagick path as path and not string</li>
+ </ul>
+ <h4>Bug</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9100">PHPBB3-9100</a>] - Inline attachments are not being inserted at the cursor</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11613">PHPBB3-11613</a>] - Cookies do not work for netbios domain</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12089">PHPBB3-12089</a>] - Make HTTP status code error messages more informative</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12642">PHPBB3-12642</a>] - Custom profile field isn't displayed</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12698">PHPBB3-12698</a>] - Replace all instances of magic numbers with constants in javascript</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12866">PHPBB3-12866</a>] - Wrong profile field validation options</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13098">PHPBB3-13098</a>] - Repair Yahoo contact field</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13192">PHPBB3-13192</a>] - confirm_box() action contains app.php when enable_mod_rewrite is set</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13238">PHPBB3-13238</a>] - \phpbb\db\migration\data\v310\mysql_fulltext_drop tries to drop non existent indexes</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13272">PHPBB3-13272</a>] - Changed Files packages do not include vendor directory</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13282">PHPBB3-13282</a>] - PostgreSQL error when creating boolean/dropdown custom profile fields</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13302">PHPBB3-13302</a>] - ACP links to docs need to be updated to 3.1 URLs</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13307">PHPBB3-13307</a>] - develop/mysql_upgrader.php does not work anymore</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13319">PHPBB3-13319</a>] - Icons/smilies table improperly formed when no images present</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13346">PHPBB3-13346</a>] - Missing space in posting_editor.html</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13357">PHPBB3-13357</a>] - LOG_MOVED_TOPIC Language var missing</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13358">PHPBB3-13358</a>] - Add class for retrieving remote file data</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13362">PHPBB3-13362</a>] - The whole cache dir (excluding the .htaccess and index.html files) should be ignored by git</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13366">PHPBB3-13366</a>] - Dynamic config for &quot;plupload_last_gc&quot; is static</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13381">PHPBB3-13381</a>] - Code Sniffer complains about 3.1.2 migration</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13385">PHPBB3-13385</a>] - Add free result after running update query in $config-&gt;set_atomic()</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13391">PHPBB3-13391</a>] - subsilver2 poll options must have a setting of 1 when editing a post</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13393">PHPBB3-13393</a>] - Invalid parameters passed to call_user_func_array in version_helper.php</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13396">PHPBB3-13396</a>] - Multibyte chars cause attachment upload to fail</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13400">PHPBB3-13400</a>] - Add a new message for high server loads during search</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13405">PHPBB3-13405</a>] - A typo in style_update_p1.php migration may prevent updating in some circumstances</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13406">PHPBB3-13406</a>] - ADD INDEX syntax may cause an error in earlier MySQL versions</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13420">PHPBB3-13420</a>] - Prune users bug - filter all with 0 posts</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13427">PHPBB3-13427</a>] - Add template events to MCP front before/after each list</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13431">PHPBB3-13431</a>] - Wrong margin-left for RTL sites in Internet Explorer mobile view</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13432">PHPBB3-13432</a>] - Migrator module tool does not add the needed module language file</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13441">PHPBB3-13441</a>] - functions_convert fails to set global moderators default group</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13442">PHPBB3-13442</a>] - UTF-8 symbols for database host</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13448">PHPBB3-13448</a>] - \phpbb\messenger-&gt;template can't find email templates in extensions</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13453">PHPBB3-13453</a>] - Sort params in Canonical URL</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13470">PHPBB3-13470</a>] - Mass email says &quot;user doesn't exist&quot; when all users is selected</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13486">PHPBB3-13486</a>] - Call to undefined method phpbb\db\driver\factory::sql_escpape() on database update</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13489">PHPBB3-13489</a>] - Allow the migrations to use the DI container</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13490">PHPBB3-13490</a>] - Unicode chars are broken in edit message after preview</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13492">PHPBB3-13492</a>] - Custom BBCode URL tokens do not support IDN</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13504">PHPBB3-13504</a>] - &quot;Array&quot; is displayed when searching, or when unanswered posts or active topics are selected</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13507">PHPBB3-13507</a>] - Large images in posts can cause horizontal scrollbars</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13511">PHPBB3-13511</a>] - The &quot;Unused Use&quot; Sniff is broken</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13530">PHPBB3-13530</a>] - Fix undefined variables in migrations and tests</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13534">PHPBB3-13534</a>] - Non-existent path in attachment settings causes travis failure</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13543">PHPBB3-13543</a>] - Slow tests fail on 3.1 and 3.2</li>
+ </ul>
+ <h4>Improvement</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11033">PHPBB3-11033</a>] - FULLTEXT_SPHINX_NO_CONFIG_DATA references unrequired field</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12567">PHPBB3-12567</a>] - [proSilver] - viewtopic_body.html: Change 'back2top' anchor in to '#top'</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12926">PHPBB3-12926</a>] - Support for IDN (IRI)</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13266">PHPBB3-13266</a>] - Enabling twig dump function if DEBUG is defined</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13306">PHPBB3-13306</a>] - Add error level to the error collector</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13312">PHPBB3-13312</a>] - [event] - Add core event to the mass email form</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13368">PHPBB3-13368</a>] - Add the forum_data var to the core.viewforum_get_topic_ids_data event</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13370">PHPBB3-13370</a>] - Add ability to call class methods more easily in the convertor framework</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13389">PHPBB3-13389</a>] - Replace pattern with path in routing.yml</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13402">PHPBB3-13402</a>] - Code Sniffer, unused use, check the function doc blocks</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13409">PHPBB3-13409</a>] - Add event to modify search parameters before searching</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13419">PHPBB3-13419</a>] - Add template event at the end of the file</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13422">PHPBB3-13422</a>] - Add new events in save custom cookies and set custom ban type</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13428">PHPBB3-13428</a>] - Add core events to memberlist.php for teampage</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13430">PHPBB3-13430</a>] - Add event for modifying prune SQL</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13435">PHPBB3-13435</a>] - Add core event to modify submit_post() sql data</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13437">PHPBB3-13437</a>] - [Template] - viewtopic_body_post_author_before/after</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13439">PHPBB3-13439</a>] - [event] - Add event to run code at beginning of ACP users overview</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13440">PHPBB3-13440</a>] - [event] - Add event to process when a user fails a login attempt</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13449">PHPBB3-13449</a>] - Add viewforum.php core event after the topic data has been assigned to template </li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13466">PHPBB3-13466</a>] - Add bbcode_uid and bitfield to event core.message_parser_check_message</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13478">PHPBB3-13478</a>] - Add core event core.bbcode_cache_init_end</li>
+ </ul>
+ <h4>Sub-task</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13141">PHPBB3-13141</a>] - Add an event to allow applying additional permissions to MCP access besides f_read</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13146">PHPBB3-13146</a>] - Add an event to allow changing the result of calling get_forums_visibility_sql()</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13147">PHPBB3-13147</a>] - Add an event to change get_global_visibility_sql()'s results</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13148">PHPBB3-13148</a>] - Add an event to creating a final way to modify edit logs output</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13154">PHPBB3-13154</a>] - Add an event to edit user list for notifications</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13158">PHPBB3-13158</a>] - Add an event to allow adding extra auth checks when the user is posting</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13159">PHPBB3-13159</a>] - Add an event to allow extra auth checks when reporting posts</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13160">PHPBB3-13160</a>] - Add an event to viewtopic before viewing permissions</li>
+ </ul>
+ <h4>Task</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12924">PHPBB3-12924</a>] - Meta tags should be self-closing</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13528">PHPBB3-13528</a>] - Boolean checkbox profile fields display &quot;1&quot; instead of selected value</li>
+ </ul>
+
+
+ <a name="v311"></a><h3>Changes since 3.1.1</h3>
+
+ <h4>Security</h4>
+ <ul>
+ <li>[SECURITY-171] - Version helper does not properly escape version info</li>
+ <li>[SECURITY-169] - AJAX request with unexpected referrer causes infinite loop</li>
+ </ul>
+
+ <h4>Bug</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10442">PHPBB3-10442</a>] - XHTML is invalid when a forum link without redirect counter is present</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10744">PHPBB3-10744</a>] - Prevent user from installing styles with reserved directory names</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11863">PHPBB3-11863</a>] - User registration settings show incorrectly as disabled when board-wide emails are disabled</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12703">PHPBB3-12703</a>] - Notification System sends exact same SQL query multiple times</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13083">PHPBB3-13083</a>] - Language correction in NO_ENTRIES in acp_logs</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13100">PHPBB3-13100</a>] - Don't display &quot;delete reason&quot; dialog for shadow-topics</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13193">PHPBB3-13193</a>] - Post counts in Private Messages should link to the user's posts</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13197">PHPBB3-13197</a>] - Group Avatar not deleted from users</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13204">PHPBB3-13204</a>] - Login flood control error supresses incorrect credential error</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13209">PHPBB3-13209</a>] - Boolean (Yes/No) custom profile field doesn't show given name</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13216">PHPBB3-13216</a>] - Datetime tests fail randomly</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13228">PHPBB3-13228</a>] - &quot;Code: Select all&quot; font-size too big in Private Messages</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13239">PHPBB3-13239</a>] - Can´t upload Attachments on iOS</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13241">PHPBB3-13241</a>] - Topics are being duplicated in multipage forums</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13242">PHPBB3-13242</a>] - Validation error in Contact a Board Administrator</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13243">PHPBB3-13243</a>] - Debug error when clicking Re-check all versions on ACP manage extensions page</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13251">PHPBB3-13251</a>] - Database password containing special characters no longer accepted after upgrade to 3.1.0</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13253">PHPBB3-13253</a>] - MCP queue link in active topics search is missing</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13265">PHPBB3-13265</a>] - &quot;Edit profile&quot; link on view-own-profile page should only show if user has permission to edit</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13270">PHPBB3-13270</a>] - Upgrading from 3.0.12 to 3.1.1 does not display moderator soft delete permissions</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13277">PHPBB3-13277</a>] - Move Up &amp; Down does not take work in Internet Explorer</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13280">PHPBB3-13280</a>] - $user-&gt;page['page'] - is invalid resulting in confirm_box() not working correctly</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13284">PHPBB3-13284</a>] - Message body not included in email topic message </li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13298">PHPBB3-13298</a>] - Use mysql_free_result to free result sets which were requested using mysql_query()</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13300">PHPBB3-13300</a>] - Jabber field still shown in profile when feature is disabled</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13301">PHPBB3-13301</a>] - Apache Authentication is probably broken</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13303">PHPBB3-13303</a>] - Migrator caught in loop calculating dependencies</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13315">PHPBB3-13315</a>] - Upgrade from 3.0.12 to 3.1.1 resets CAPTCHA selection</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13316">PHPBB3-13316</a>] - reCAPTCHA does not work on secured connection</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13318">PHPBB3-13318</a>] - login_username doesn't have multibyte parameter set to true</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13323">PHPBB3-13323</a>] - posting.php can pass invalid auth option to acl_get()</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13332">PHPBB3-13332</a>] - Insufficient information passed to password drivers for converted boards</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13337">PHPBB3-13337</a>] - Mark subforums read triggers error if subforums contain no topics</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13338">PHPBB3-13338</a>] - Some tests fail when run on their own</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13342">PHPBB3-13342</a>] - 310/captcha_plugins migration changes recaptcha to nogd</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13349">PHPBB3-13349</a>] - Incorrect entities used for breadcrumb separator in CSS</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13354">PHPBB3-13354</a>] - Unknown column 'topic_logs' in 'where clause' when deleting topic log in MCP</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13376">PHPBB3-13376</a>] - deregister_globals() does not work correctly when $_COOKIE['GLOBALS'] is specified</li>
+ </ul>
+
+ <h4>Improvement</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12681">PHPBB3-12681</a>] - Cache the compiled routes and dump the url_generator</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12885">PHPBB3-12885</a>] - Wrong index page title when using Board Index text</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13023">PHPBB3-13023</a>] - [event] - Add Event posting_editor_buttons_custom_tags_before</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13133">PHPBB3-13133</a>] - Allow @vendor_extname in INCLUDECSS</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13182">PHPBB3-13182</a>] - [event] - Add posting.php core event to allow modifying the message before parsing</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13220">PHPBB3-13220</a>] - [event] - Add template events to memberlist_search.html</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13290">PHPBB3-13290</a>] - [event] - Add template event index_body_forumlist_body_after</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13294">PHPBB3-13294</a>] - [event] - Add message_parser.php core event for additional message handling before parsing</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13297">PHPBB3-13297</a>] - Add unicode modifier to url/email regular expression patterns</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13309">PHPBB3-13309</a>] - [event] - Add ACP template event acp_email_options_after</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13310">PHPBB3-13310</a>] - [event] - Add core event core.acp_email_modify_sql</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13326">PHPBB3-13326</a>] - Add viewtopic_url variable to a viewtopic event</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13328">PHPBB3-13328</a>] - [event] - Add event core.mcp_view_forum_modify_sql</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13347">PHPBB3-13347</a>] - [event] - Add new template events to acp_forums.html</li>
+ </ul>
+
+ <h4>New Feature</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12962">PHPBB3-12962</a>] - Use phantomjs and webdriver for UI testing</li>
+ </ul>
+
+ <h4>Task</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13324">PHPBB3-13324</a>] - Composer no longer downloads sami/sami and fabpot/goutte</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13325">PHPBB3-13325</a>] - Make installing dependencies for tests more user friendly or optional</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13331">PHPBB3-13331</a>] - Sami run as part of phing MUST NOT switch branches</li>
+ </ul>
+
+
+ <a name="v310"></a><h3>Changes since 3.1.0</h3>
+
+ <h4>Security</h4>
+ <ul>
+ <li>[SECURITY-164] - Cross Site Scripting via PATH_INFO in page_name variable</li>
+ </ul>
+ <h4>Bug</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13248">PHPBB3-13248</a>] - Login functions need to use provider collection for retrieving provider</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13267">PHPBB3-13267</a>] - Automatic Update instructions indicate that only the install folder is necessary</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13268">PHPBB3-13268</a>] - MSSQL's get_existing_indexes() function improperly appends ternary result</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13271">PHPBB3-13271</a>] - Anonymous users can CC themselves on emails sent to admin via contact form</li>
+ </ul>
+ <h4>Task</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13262">PHPBB3-13262</a>] - Add note to docs about htaccess file when upgrading 3.0 to 3.1</li>
+ </ul>
+
+ <a name="v310RC6"></a><h3>Changes since 3.1.0-RC6</h3>
+
+ <h4>Bug</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13126">PHPBB3-13126</a>] - More detailed output for migrations needed</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13208">PHPBB3-13208</a>] - Security issues are not pulled into the changelog</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13210">PHPBB3-13210</a>] - Queue Cron Job checks for wrong config variable queue_interval_config</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13211">PHPBB3-13211</a>] - Add possibility to save migrations output to log</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13221">PHPBB3-13221</a>] - Can't upgrade to 3.1 from 3.0.11 and older</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13223">PHPBB3-13223</a>] - Using get_username_string() for email template variables causes HTML markup in emails</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13225">PHPBB3-13225</a>] - phpbb_hash() undefined in phpbb\db\migration\data\v30x\release_3_0_5_rc1.php</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13226">PHPBB3-13226</a>] - Stray $rank_img in memberlist.php</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13227">PHPBB3-13227</a>] - Remote avatars do not work with cURL wrapper</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13229">PHPBB3-13229</a>] - Memberlist is getting overloaded with redundant SQL queries</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13230">PHPBB3-13230</a>] - Deprecated phpbb_clean_path() does not work anymore</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13231">PHPBB3-13231</a>] - The migration contact_admin_form must depends on config_db_text</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13232">PHPBB3-13232</a>] - Email queue does not get run</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13234">PHPBB3-13234</a>] - Remember me cookie gets unset by admin reauthentication</li>
+ </ul>
+ <h4>Improvement</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13207">PHPBB3-13207</a>] - Default subscription notification setting for new users does not include email</li>
+ </ul>
+ <h4>Task</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13215">PHPBB3-13215</a>] - Update Symfony Components to 2.3.21</li>
+ </ul>
+
+ <a name="v310RC5"></a><h3>Changes since 3.1.0-RC5</h3>
+
+ <h4>Bug</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12530">PHPBB3-12530</a>] - Visual confirmation is breaking layout in prosilver's mobile mode</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12568">PHPBB3-12568</a>] - docs/README.html references MODs instead of extensions</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13124">PHPBB3-13124</a>] - PHP event extractor too strict on doc blocks</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13138">PHPBB3-13138</a>] - Banned users cause infinite recursion</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13140">PHPBB3-13140</a>] - Header links don't re-appear on window size increase</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13161">PHPBB3-13161</a>] - PHP Warnings issued from phpbb database test case</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13163">PHPBB3-13163</a>] - Header Navbar Responsiveness Broken</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13164">PHPBB3-13164</a>] - Data sent to core.submit_post_end event does not include fresh post_visibility</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13168">PHPBB3-13168</a>] - Warning displayed in PHP 5.6 for mbstring.http_input</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13169">PHPBB3-13169</a>] - Responsive forms not displaying correctly in RTL</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13171">PHPBB3-13171</a>] - Can not delete posts and soft delete topics in MCP topic view</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13174">PHPBB3-13174</a>] - Minor HTML error in ucp_pm_viewmessage.html (needs closing &lt;/div&gt;)</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13177">PHPBB3-13177</a>] - Post count-based ranks do not display in viewtopic</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13181">PHPBB3-13181</a>] - Sphinx config template should use place holders for database credentials</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13186">PHPBB3-13186</a>] - Do not link post count to author search if search disabled</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13187">PHPBB3-13187</a>] - INSTALL.html is not valid HTML</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13188">PHPBB3-13188</a>] - Sphinx index() function triggers slow queries that time out replies</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13190">PHPBB3-13190</a>] - phpbb_session_login_keys_test::test_reset_keys fails on develop-ascraeus</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13194">PHPBB3-13194</a>] - BBCode isn't parsed when issuing a warning for a post</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13203">PHPBB3-13203</a>] - Use constant time comparison method for comparing password hashes</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13217">PHPBB3-13217</a>] - Remember me cookie leak</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13218">PHPBB3-13218</a>] - Missing token check in acp_styles</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13221">PHPBB3-13221</a>] - Can't upgrade to 3.1 from 3.0.11 and older</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13223">PHPBB3-13223</a>] - Using get_username_string() for email template variables causes HTML markup in emails</li>
+ </ul>
+ <h4>Improvement</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12796">PHPBB3-12796</a>] - View own Profile should have an edit button</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12799">PHPBB3-12799</a>] - Place the events for f_brunoais_read_other</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13041">PHPBB3-13041</a>] - help_faq.php language file needs to be revised</li>
+ </ul>
+ <h4>New Feature</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13205">PHPBB3-13205</a>] - Add mark all PMs read button</li>
+ </ul>
+
+
+ <a name="v310RC4"></a><h3>Changes since 3.1.0-RC4</h3>
+
+ <h4>Bug</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10729">PHPBB3-10729</a>] - Post editor information is not updated when user being deleted with posts</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11224">PHPBB3-11224</a>] - SQL cache destroy does not destroy queries to tables joined</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12368">PHPBB3-12368</a>] - Updating database fails in upgrade from 3.0 when trying twice without purging the cache</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12489">PHPBB3-12489</a>] - Description for Contact link in custom profile fields</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12657">PHPBB3-12657</a>] - Add a test file for cli command cache:purge</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12858">PHPBB3-12858</a>] - 'GMT' is hard coded and not pulled from language files</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12889">PHPBB3-12889</a>] - multi-select element in unban email-adresses not limited in width</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13011">PHPBB3-13011</a>] - Javascript bug when selecting first one or two characters of a post</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13027">PHPBB3-13027</a>] - PM folder full percentage could be a bit more accurate</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13033">PHPBB3-13033</a>] - Duplicate entry SQL error thrown when running notifications_use_full_name migration</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13045">PHPBB3-13045</a>] - Pragma header not specified as response header by RFC2616</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13048">PHPBB3-13048</a>] - AJAX requests are being stored to session_page</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13055">PHPBB3-13055</a>] - String profile fields validation limits content to latin chars only</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13070">PHPBB3-13070</a>] - Wrong hook name is registered for array(template, display)</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13071">PHPBB3-13071</a>] - total_match_count is used before core.search_get_posts_data event</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13080">PHPBB3-13080</a>] - Responsive design - language variable to long</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13082">PHPBB3-13082</a>] - Search box does not displayed proper in admin cp when no logs listed</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13085">PHPBB3-13085</a>] - Fix typo in oauth.php</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13086">PHPBB3-13086</a>] - Update ACP_MASS_EMAIL_EXPLAIN language key</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13087">PHPBB3-13087</a>] - WLM link is empty in viewtopic</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13097">PHPBB3-13097</a>] - Fix missing unit type in forms.css</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13104">PHPBB3-13104</a>] - Responsive tabs display bug in IE11</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13105">PHPBB3-13105</a>] - Future dates are displayed as &quot;Tomorrow&quot; with relative date format</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13111">PHPBB3-13111</a>] - Debug output when editing DropDown Custom Fields with multiple languages</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13113">PHPBB3-13113</a>] - The routes are not always generated for the good app.php file</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13116">PHPBB3-13116</a>] - Topic and post approval notifications got interchanged</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13117">PHPBB3-13117</a>] - Installation fails on MySQL 5.7 because auto_increment columns can be NULL</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13118">PHPBB3-13118</a>] - datetime.class parameter not used in user class</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13120">PHPBB3-13120</a>] - phpbb_load_extensions_autoloaders() doesn't work very well with the extensions behind a symlink</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13121">PHPBB3-13121</a>] - Customise Purge Cache always returns user to Styles page</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13125">PHPBB3-13125</a>] - Uploaded avatars are not displayed in IE &lt;= 7</li>
+ </ul>
+ <h4>Improvement</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12408">PHPBB3-12408</a>] - Add quick setting for &quot;default guest style&quot; to ACP board settings</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12985">PHPBB3-12985</a>] - Add event to modify the redirect after a successful login</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12993">PHPBB3-12993</a>] - Add event to get_user_rank() function</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13025">PHPBB3-13025</a>] - Add template events for buttons on viewforum and viewtopic</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13059">PHPBB3-13059</a>] - Add core event to generate_page_link() to allow modifying pagination URLs</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13072">PHPBB3-13072</a>] - Add total_match_count to core.search_get_topic_data event</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13077">PHPBB3-13077</a>] - Change module order in Customise tab for better usability</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13094">PHPBB3-13094</a>] - Remove the search box if there are no new posts to search for</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13107">PHPBB3-13107</a>] - Add template events to forum row in forumlist_body.html</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13108">PHPBB3-13108</a>] - Add core event to the parse_attachments() function to allow modifying files info</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13110">PHPBB3-13110</a>] - Add core event to the page_footer() function to allow handling overall output</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13122">PHPBB3-13122</a>] - phpbb_wrapper_gmgetdate_test intermittently fails</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13134">PHPBB3-13134</a>] - Add core event to the root of the function display_forums()</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13137">PHPBB3-13137</a>] - Remove schema.json from repository</li>
+ </ul>
+ <h4>Sub-task</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12929">PHPBB3-12929</a>] - Add an event when getting the information for PM composal</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12930">PHPBB3-12930</a>] - Add an event to the query getting the post for quoting in a PM</li>
+ </ul>
+ <h4>Task</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10794">PHPBB3-10794</a>] - Make schema available at runtime</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12987">PHPBB3-12987</a>] - Cleanup the services.yml file</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13106">PHPBB3-13106</a>] - Remove the \phpbb\di\pass\kernel_pass class</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13119">PHPBB3-13119</a>] - Add events to mcp and acp ban modules</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13123">PHPBB3-13123</a>] - Add events to allow post blocking and post pre/past processing</li>
+ </ul>
+
+ <a name="v310RC3"></a><h3>Changes since 3.1.0-RC3</h3>
+
+ <h4>Bug</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10472">PHPBB3-10472</a>] - ACP &quot;add multiple smilies&quot; page is unusable on 1024x768 resolution</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11909">PHPBB3-11909</a>] - phpbb/db/migrator::load_migrations is never called</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12258">PHPBB3-12258</a>] - Add attachment: error alert popup on &quot;empty.png&quot; does not show up</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12506">PHPBB3-12506</a>] - Long post titles bump the username down an extra row beneath the edit/quote/delete buttons</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12658">PHPBB3-12658</a>] - Add tests for config:* cli commands</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12661">PHPBB3-12661</a>] - Extensions templates not loaded from &quot;all&quot; by helper/render()</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12734">PHPBB3-12734</a>] - Custom profile manager should not suppress errors when inserting user rows</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12765">PHPBB3-12765</a>] - acp_profile.php should use db/tools</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12852">PHPBB3-12852</a>] - \phpbb\path_helper get_url_parts does not handle get variable with no value</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12856">PHPBB3-12856</a>] - plupload images are not integrated into style-path</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12862">PHPBB3-12862</a>] - Smiley and Whos Onlike pop-up boxes are making styling difficult</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12949">PHPBB3-12949</a>] - Undefined function mime_content_type()</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12966">PHPBB3-12966</a>] - Undefined sorting of posts with same post_time on postgres</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12975">PHPBB3-12975</a>] - Catchable fatal error after update to RC3</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12976">PHPBB3-12976</a>] - Pagination of UCP manage attachments page in prosilver does not support plural forms</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12983">PHPBB3-12983</a>] - UCP preferences, Display posts ordering by: input is not properly validated</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12984">PHPBB3-12984</a>] - Index page: blank line when no forum description shown</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12986">PHPBB3-12986</a>] - Wrong functions call order breaks detection of common words in search</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12990">PHPBB3-12990</a>] - The prefix for the notification's services is harcoded</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12996">PHPBB3-12996</a>] - tests/lock/flock_test.php should use microtime() instead of time()</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12998">PHPBB3-12998</a>] - Undefined $lang in mcp_warn.php::add_warning()</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13004">PHPBB3-13004</a>] - Topic tools button is displayed even if dropdown is empty</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13008">PHPBB3-13008</a>] - Importing a resource in routing.yml breaks download/file.php and ACP</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13009">PHPBB3-13009</a>] - Cleanup Tweaks CSS, Remove outdated browser support</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13018">PHPBB3-13018</a>] - Key binding on AJAX popups are not unbound upon close/cancel</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13019">PHPBB3-13019</a>] - Don't display &quot;Soft delete reason&quot; dialog when moderator cannot soft-delete</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13022">PHPBB3-13022</a>] - &quot;Return to advanced search&quot; wrong assumption </li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13031">PHPBB3-13031</a>] - Impossible to properly upload image if no proper mimetype guessers enabled</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13035">PHPBB3-13035</a>] - Empty meta tags in header</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13040">PHPBB3-13040</a>] - W3C validator warning in overral_footer.html</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13042">PHPBB3-13042</a>] - Unused var in login_box()</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13044">PHPBB3-13044</a>] - Expires header violates RFC 2616</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13046">PHPBB3-13046</a>] - In download/avatar we don't load the vendors added by the extensions</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13050">PHPBB3-13050</a>] - Allow topic/forum subscription when email and jabber are off</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13051">PHPBB3-13051</a>] - Fix broken viewonline core event</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13052">PHPBB3-13052</a>] - Remove additional parameters from check_form_key()</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13057">PHPBB3-13057</a>] - Fatal error on previous page link after closing a report</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13065">PHPBB3-13065</a>] - Unknown column 'user_pass_convert' in 'field list' [code] - =&gt; 1054 </li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13068">PHPBB3-13068</a>] - Language correction in FIELD_IS_CONTACT_EXPLAIN</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13069">PHPBB3-13069</a>] - Timezone selector does not filter locations on change</li>
+ </ul>
+ <h4>Improvement</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12416">PHPBB3-12416</a>] - WhoIs Pop Up Page Details</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12598">PHPBB3-12598</a>] - Improve action-bar search box styling</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12653">PHPBB3-12653</a>] - Caches the informations about the listeners to be able to not load them everytime</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12900">PHPBB3-12900</a>] - 3.1.0 avatar scaling</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12943">PHPBB3-12943</a>] - Add core.phpbb_generate_debug_output core event</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12961">PHPBB3-12961</a>] - Add link in anti-spam ACP page which links directly to captchas in titania</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12969">PHPBB3-12969</a>] - Add template event around the find username link on composing pm</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12982">PHPBB3-12982</a>] - JS in 3.1 is nasty</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12989">PHPBB3-12989</a>] - Remove unused &quot;created_by.jpg&quot; from prosilver</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12991">PHPBB3-12991</a>] - Have events after/before &quot;add warning&quot; field - user and post</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12994">PHPBB3-12994</a>] - Add core event to viewtopic.php before sending vars to template</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13003">PHPBB3-13003</a>] - Missing language keys in command &quot;extension:show&quot;</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13005">PHPBB3-13005</a>] - Add core event to display_forums() to modify category template data</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13006">PHPBB3-13006</a>] - Add variables to the 'core.modify_quickmod_actions' event</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13010">PHPBB3-13010</a>] - phpbb_get_avatar() incorrectly refers to \phpbb\avatar\driver\driver::clean_row()</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13020">PHPBB3-13020</a>] - Add var to core.viewforum_get_topic_data event to allow modifying forum template data</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13024">PHPBB3-13024</a>] - Template event viewtopic_body_postrow_post_content_footer</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13026">PHPBB3-13026</a>] - Add template vars array to core.viewonline_overwrite_location to allow modifying/adding template vars</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13034">PHPBB3-13034</a>] - Add ability to access extensions outside the phpBB root</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13036">PHPBB3-13036</a>] - Controller helper route method should be able to generate absolute URL's</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13038">PHPBB3-13038</a>] - Link user post tally to their posts</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13047">PHPBB3-13047</a>] - Add $post_list array to core.viewtopic_modify_page_title core event</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13056">PHPBB3-13056</a>] - Move the arguments of the request class to the DI</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13058">PHPBB3-13058</a>] - The &quot;jump to page&quot; input does not have a min attribute.</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13061">PHPBB3-13061</a>] - Use a compiler pass to replace the service event.subscriber_loader</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13062">PHPBB3-13062</a>] - Add viewforum.php core event to allow modifying sql query to select topic ids</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13066">PHPBB3-13066</a>] - Add common search results core event to modify search title</li>
+ </ul>
+ <h4>New Feature</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12951">PHPBB3-12951</a>] - Add .editorconfig</li>
+ </ul>
+ <h4>Sub-task</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12928">PHPBB3-12928</a>] - [Event] - core.mcp_reports_gather_query_before</li>
+ </ul>
+ <h4>Task</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12999">PHPBB3-12999</a>] - Remove @author tag from the doc block</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13032">PHPBB3-13032</a>] - Update Symfony Components to 2.3.19</li>
+ </ul>
+
+
+ <a name="v310RC2"></a><h3>Changes since 3.1.0-RC2</h3>
+
+ <h4>Bug</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11148">PHPBB3-11148</a>] - Fix uploading attachments from Android 4 powered devices</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11480">PHPBB3-11480</a>] - Prevent Private Message system from returning &quot;Unknown folder&quot; when inbox folder is full</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11520">PHPBB3-11520</a>] - Post count not incremented when you fork a topic</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11854">PHPBB3-11854</a>] - Captcha code is still in includes/</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12232">PHPBB3-12232</a>] - MCP Banning: Max execution time exceeded</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12448">PHPBB3-12448</a>] - Migration tools don't allow adding columns with default == NULL</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12492">PHPBB3-12492</a>] - DB_TEST: Special chars are not supported.</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12535">PHPBB3-12535</a>] - The profile link should be better adjusted to the avatar image it surrounds in viewtopic.php</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12685">PHPBB3-12685</a>] - CLI doesn't load extension commands</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12710">PHPBB3-12710</a>] - phpBB 3.0.12 on Oracle fails to upgrade to 3.1.0</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12718">PHPBB3-12718</a>] - Hard Deleting Post does not Decrease Post Count</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12742">PHPBB3-12742</a>] - Notifications duplicate code that requires an event</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12744">PHPBB3-12744</a>] - RTL board header is one line higher than LTR</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12748">PHPBB3-12748</a>] - UCP Terms of Use Typo</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12770">PHPBB3-12770</a>] - search_wordmatch unique key name is too long</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12776">PHPBB3-12776</a>] - docs/INSTALL.html is missing 3.0 to 3.1 update instructions</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12789">PHPBB3-12789</a>] - Cached directories are not deleted when the cache is purged (with ACM memory enabled).</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12791">PHPBB3-12791</a>] - String profile fields do not use links, smilies and line breaks in memberlist</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12792">PHPBB3-12792</a>] - Profile field type strings function get_profile_contact_value duplicates raw()</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12793">PHPBB3-12793</a>] - String '0' does not display for string profile fields</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12794">PHPBB3-12794</a>] - Google+ profile field validation is too strict</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12809">PHPBB3-12809</a>] - RTL styling issues with new jump-box dropdown</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12814">PHPBB3-12814</a>] - Error while trying to setup LDAP Authentication in ACP</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12822">PHPBB3-12822</a>] - Preselect avatar type if only 1 type is enabled</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12837">PHPBB3-12837</a>] - Viewing contact form displays &quot;VIEWING_MEMBERS&quot; on viewonline</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12842">PHPBB3-12842</a>] - Out of memory issue in code sniffer call for extensions</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12843">PHPBB3-12843</a>] - When you click on &quot;Mark forums read&quot; in the browser, a console error occurs</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12844">PHPBB3-12844</a>] - $dbpasswd is cleared too early in connection manager</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12845">PHPBB3-12845</a>] - HTML5 Invalid using role=&quot;navigation&quot;</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12846">PHPBB3-12846</a>] - SQLite3 bug in profilefield_base_migration.php</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12849">PHPBB3-12849</a>] - ReferenceError in core.js</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12851">PHPBB3-12851</a>] - Font colour button title is not consistent with other buttons</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12853">PHPBB3-12853</a>] - Problems with ACP/MCP links in mobile design with other translations</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12854">PHPBB3-12854</a>] - Admin contact page should not be used when board emails are disabled</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12855">PHPBB3-12855</a>] - Container is being recompiled on every page request although DEBUG_CONTAINER is not set</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12859">PHPBB3-12859</a>] - Missing post button events from view pm template</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12870">PHPBB3-12870</a>] - Console database migrate function can not update from 3.0.12 to 3.1</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12873">PHPBB3-12873</a>] - Wrong identifier tested in \db\tools\sql_create_(unique_)index()</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12875">PHPBB3-12875</a>] - Extension's info_acp_lang files don't fallback correctly when the user's language is not included in the extension</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12881">PHPBB3-12881</a>] - Debug error - Undefined index: mark_time</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12882">PHPBB3-12882</a>] - $config['search_type'] - is not correctly updated when updating from 3.0 to 3.1</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12883">PHPBB3-12883</a>] - Do not use basename() to get the search class in phpbb\cron\task\core\tidy_search</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12886">PHPBB3-12886</a>] - Redundant lock and unlock expressions for QuickMod in viewtopic.php</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12887">PHPBB3-12887</a>] - Typo in timezone handling code: 'offest' should be 'offset'</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12891">PHPBB3-12891</a>] - Long page generation time when banlist is long</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12895">PHPBB3-12895</a>] - ?style=1 appended to url after using the UCP</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12898">PHPBB3-12898</a>] - In cron.php we try to release the lock after the call to garbage_collection()</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12901">PHPBB3-12901</a>] - Wrong type hint in show_available_child_styles() doc block</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12902">PHPBB3-12902</a>] - Remove duplicate entry in build_cfg_template() switch statement</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12903">PHPBB3-12903</a>] - Remove unused method in phpBB/phpbb/extension/metadata_manager.php</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12908">PHPBB3-12908</a>] - Fix broken operator assignment in increment.php</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12909">PHPBB3-12909</a>] - Use correct lang vars in cli extension enable</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12910">PHPBB3-12910</a>] - Profile fields: Two &quot;simple text field&quot; in dropdown menu</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12912">PHPBB3-12912</a>] - Undefined index when adding logs from extensions</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12918">PHPBB3-12918</a>] - Functional Tests Suite does not run on its own</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12919">PHPBB3-12919</a>] - Allow using class names as module identifier for extensions</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12922">PHPBB3-12922</a>] - Posts per page in MCP should have a minimum value of zero</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12931">PHPBB3-12931</a>] - General error on user registration when domain name is not set</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12932">PHPBB3-12932</a>] - Easy support of non-gregorian calendars</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12937">PHPBB3-12937</a>] - Without config file, extract($phpbb_config_php_file-&gt;get_all()); breaks</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12938">PHPBB3-12938</a>] - Board floods &quot;store&quot;-directory with packed attachments</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12940">PHPBB3-12940</a>] - Unused 'use' statements in download/file.php</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12950">PHPBB3-12950</a>] - Functional tests can not be run anymore if another language is present</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12954">PHPBB3-12954</a>] - Nginx setup on travis returns wrong SCRIPT_NAME info</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12956">PHPBB3-12956</a>] - Unknown column 'field_is_contact' in 'field list'</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12964">PHPBB3-12964</a>] - Undefined $row in download/file.php</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12967">PHPBB3-12967</a>] - Undefined variable: phpbb_dispatcher in mcp_queue.php</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12970">PHPBB3-12970</a>] - chema.json is not up to date with migration files</li>
+ </ul>
+ <h4>Improvement</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9165">PHPBB3-9165</a>] - Extend template loop to allow iteration step modification</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10073">PHPBB3-10073</a>] - Contact page</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12051">PHPBB3-12051</a>] - Optimise Composer Autoloader on Build</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12560">PHPBB3-12560</a>] - Add methods to set upload and temp paths in Plupload class</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12656">PHPBB3-12656</a>] - Translate existing CLI commands</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12663">PHPBB3-12663</a>] - Extract Command Line Interface language strings into their own file.</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12671">PHPBB3-12671</a>] - Possibility to use NOT LIKE expression</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12693">PHPBB3-12693</a>] - Add a travis test that checks file permissions</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12738">PHPBB3-12738</a>] - Move related code from functions_posting into remove_post_from_statistic()</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12778">PHPBB3-12778</a>] - The automatic updater should have an option to automatically delete removed files during update</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12828">PHPBB3-12828</a>] - Add includes/ucp/ucp_prefs.php common core event to allow additional actions before the page load</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12832">PHPBB3-12832</a>] - Add footer links to the Quick Links menu</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12836">PHPBB3-12836</a>] - [Event] - core.functions.redirect</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12841">PHPBB3-12841</a>] - Allow extensions to position new config vars in an array</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12847">PHPBB3-12847</a>] - Allow extensions to define if they can be enabled</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12857">PHPBB3-12857</a>] - Add template events overall_header_breadcrumbs_before/after</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12864">PHPBB3-12864</a>] - Have an EVENT tag after STYLESHEETS in overall_header</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12871">PHPBB3-12871</a>] - Add PHPBB_DISPLAY_LOAD_TIME constant to config.php on installation</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12872">PHPBB3-12872</a>] - Add poster_id to viewtopic_modify_post_row</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12884">PHPBB3-12884</a>] - Add core event to the function upload_attachment()</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12892">PHPBB3-12892</a>] - S_NUM_ROWS does not scale</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12896">PHPBB3-12896</a>] - Add event in acp_main to allow php checks for admin notices</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12906">PHPBB3-12906</a>] - Add rel=&quot;help&quot; to FAQ link</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12913">PHPBB3-12913</a>] - Add more parameters to core.submit_post_end event</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12942">PHPBB3-12942</a>] - Add core.add_form_key core event</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12944">PHPBB3-12944</a>] - Add core.login_forum_box core event</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12953">PHPBB3-12953</a>] - Page title not updated when notifications are marked as read</li>
+ </ul>
+ <h4>Sub-task</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12800">PHPBB3-12800</a>] - [Event] - Create core.functions_display.display_user_activity.actives_after</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12801">PHPBB3-12801</a>] - [Event] - core.functions_posting.load_drafts_draft_list_results</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12876">PHPBB3-12876</a>] - [Event] - core.mcp_mcp_front.mcp_front_view_queue_postid_list_after</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12880">PHPBB3-12880</a>] - [Event] - core.mcp_queue_!is_topics_query_before</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12927">PHPBB3-12927</a>] - [Event] - core.mcp_queue_get_posts2_query_before</li>
+ </ul>
+ <h4>Task</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10404">PHPBB3-10404</a>] - Remove create_function from includes/acp/auth.php</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12557">PHPBB3-12557</a>] - Fix doc block errors found by Sami</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12826">PHPBB3-12826</a>] - Investigate &quot;catch (Exception&quot;</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12860">PHPBB3-12860</a>] - Add template events to mcp_ban.html</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12861">PHPBB3-12861</a>] - Add event before assigning the posts to the template</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12917">PHPBB3-12917</a>] - Move commit check and file executable checks to 5.3.3 build on travis</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12920">PHPBB3-12920</a>] - Create composer installable app and core packages with subtree split</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12941">PHPBB3-12941</a>] - Check for Sami documentation errors on Travis CI</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12948">PHPBB3-12948</a>] - Remove Travis CI &quot;broken opcache on PHP 5.5.7 and 5.5.8&quot; workaround.</li>
+ </ul>
+
+ <a name="v310RC1"></a><h3>Changes since 3.1.0-RC1</h3>
+
+ <h4>Bug</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9801">PHPBB3-9801</a>] - Users on custom pages outside the board directory are being displayed on Index page</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11392">PHPBB3-11392</a>] - &quot;Make normal&quot; in quickmod tool does not ajaxify correctly</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12325">PHPBB3-12325</a>] - Automatic update should notify about outdated files</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12420">PHPBB3-12420</a>] - Reduce config.php inclusions in DIC code</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12446">PHPBB3-12446</a>] - Unnecessary db connect - function phpbb_bootstrap_enabled_exts</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12462">PHPBB3-12462</a>] - Do not use string &quot;None&quot; for different avatar options</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12515">PHPBB3-12515</a>] - FULLTEXT_POSTGRES_TS_NOT_USABLE and FULLTEXT_POSTGRES_VERSION_CHECK_EXPLAIN redundant</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12605">PHPBB3-12605</a>] - Make dropdowns uniform</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12674">PHPBB3-12674</a>] - Last edited by in PMs doesn't show user colour</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12680">PHPBB3-12680</a>] - Contact icons in viewtopic are missing alternative text</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12695">PHPBB3-12695</a>] - Undefined index: MISSING_INLINE_ATTACHMENT notice given when viewing post details</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12716">PHPBB3-12716</a>] - Wrong method call in phpbb\auth\provider\oauth\token_storage</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12759">PHPBB3-12759</a>] - Profile fields lang value db queries can cause query flood</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12760">PHPBB3-12760</a>] - Post approval icon for wrong topics in Last Post column</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12764">PHPBB3-12764</a>] - Wrong error message on install if mysqli is selected and the credentials are wrong</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12766">PHPBB3-12766</a>] - Event exporter does not like RCx as version</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12768">PHPBB3-12768</a>] - 'NOTIFICATION_REPORT_CLOSED' entry has wrong indentation</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12771">PHPBB3-12771</a>] - Bug in \phpbb\db\migration\profilefield_base_migration when used in extensions</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12772">PHPBB3-12772</a>] - Fatal error when &quot;Email topic&quot; is used in topic tools</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12773">PHPBB3-12773</a>] - Fix language variable name in cli extension enable command</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12774">PHPBB3-12774</a>] - Undefined variable $phpbb_adm_relative_path in phpbb_create_install_container()</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12781">PHPBB3-12781</a>] - Template regex for DEFINE has problems when enclosed by other template conditionals</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12783">PHPBB3-12783</a>] - Remove require: phpbb/phpbb from Extensions composer.json files</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12787">PHPBB3-12787</a>] - Incorrect generated url when using ajax and routing</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12788">PHPBB3-12788</a>] - Update Symfony suite from 2.3.12 to 2.3.16</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12790">PHPBB3-12790</a>] - Always use the interface when available (and not directly the class)</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12802">PHPBB3-12802</a>] - Properly handle connection errors in SQLite3</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12808">PHPBB3-12808</a>] - Small gap between username and drop-down arrow</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12810">PHPBB3-12810</a>] - In acp_forums the displayed value for prune_shadow_freq is the value of prune_freq</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12811">PHPBB3-12811</a>] - Margin Bottom not taking effect in Safari with 101% height on same element</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12815">PHPBB3-12815</a>] - Members list link hidden from guests who have permission to view members list page</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12816">PHPBB3-12816</a>] - Fix comment about logs in user_ban function</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12818">PHPBB3-12818</a>] - Deleting a log entry in MCP produces a General error</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12819">PHPBB3-12819</a>] - Wrong text on hover over &quot;Jump to page&quot; field</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12825">PHPBB3-12825</a>] - Allow the extensions to be tested with the sniffer and skip the vendors</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12830">PHPBB3-12830</a>] - .postlink is in colours.css doubled, one should be deleted</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12834">PHPBB3-12834</a>] - Viewonline only matches routes</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12839">PHPBB3-12839</a>] - Missing stylesheet when it is not updated</li>
+ </ul>
+ <h4>Improvement</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12013">PHPBB3-12013</a>] - Quickmod tools and jumpbox should use new dropdown</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12099">PHPBB3-12099</a>] - path_helper returns wrong web root path for ajax requests</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12196">PHPBB3-12196</a>] - Referer vs Referrer in language files</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12197">PHPBB3-12197</a>] - Fix misleading FAQ entries</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12334">PHPBB3-12334</a>] - Add raw values of profile fields to template</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12562">PHPBB3-12562</a>] - Prosilver has no max-width</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12645">PHPBB3-12645</a>] - Update support links to 3.1 forums</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12662">PHPBB3-12662</a>] - Reorganize and modernize the header navbar</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12735">PHPBB3-12735</a>] - Remove all :link, :visited, :active link states</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12777">PHPBB3-12777</a>] - Rename extension status functions and add is_configured()</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12779">PHPBB3-12779</a>] - Change order of file lists on automatic update</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12782">PHPBB3-12782</a>] - Use an interface for the phpbb event_dispatcher</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12784">PHPBB3-12784</a>] - Allow the extensions to add a custom auto loader</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12786">PHPBB3-12786</a>] - Extend profilefield_base_migration.php class</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12812">PHPBB3-12812</a>] - Add a migrator tool for config_text database changes</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12813">PHPBB3-12813</a>] - Improve responsive pagination location and fix page-jump title</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12823">PHPBB3-12823</a>] - Remove trailing whitespace from CSS files</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12824">PHPBB3-12824</a>] - Move ACP &amp; MCP links in the header to the end of the link list</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12827">PHPBB3-12827</a>] - Reorder quick-links</li>
+ </ul>
+ <h4>Task</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12775">PHPBB3-12775</a>] - Refactor functions_container into class container_builder</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12829">PHPBB3-12829</a>] - Remove check for pgsql 8.3/8.2</li>
+ </ul>
+
+ <a name="v310b4"></a><h3>Changes since 3.1.0-b4</h3>
+
+ <h4>Bug</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-8610">PHPBB3-8610</a>] - Splitting and merging topics does not handle subscriptions and bookmarks correctly</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10899">PHPBB3-10899</a>] - Using Delete All in log viewer with keyword search</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11331">PHPBB3-11331</a>] - Inform admin of incorrect avatar path instead of stripping unexpected parts from destination path</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11445">PHPBB3-11445</a>] - Suboptimal number of query complexity in phpbb_notification_manager::get_global_subscriptions()</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11467">PHPBB3-11467</a>] - phpbb_extension_metadata_manager uses hard coded language for exceptions</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11659">PHPBB3-11659</a>] - Information about file_upload is missing from the requirement page</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11942">PHPBB3-11942</a>] - Delete post/topic reason should be added to the generated log entry</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12109">PHPBB3-12109</a>] - Bug when setting users forum permissions with &quot;Select all users&quot; checkbox</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12209">PHPBB3-12209</a>] - OAuth Authentication in ACP does not explain that it allows regular login too</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12332">PHPBB3-12332</a>] - Attachments with long file names break the Uploader layout</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12352">PHPBB3-12352</a>] - The service definition &quot;auth.provider.smf&quot; does not exist.</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12443">PHPBB3-12443</a>] - Responsive tabs broken in IE</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12457">PHPBB3-12457</a>] - Gallery avatar category &quot;Main&quot; is empty</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12508">PHPBB3-12508</a>] - phpbb\finder (currently phpbb\extension\finder) should not depend on extension manager</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12521">PHPBB3-12521</a>] - When selecting the target to merge two topics, the last column is pushed on a new line</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12552">PHPBB3-12552</a>] - [RTL] - Forum list content forced into single char column when responsive</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12553">PHPBB3-12553</a>] - Right-to-left language bugs in prosilver</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12566">PHPBB3-12566</a>] - &quot;Private messages&quot; in viewtopic.php should be &quot;Send pivate message&quot;</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12589">PHPBB3-12589</a>] - The finder should search directly in $directory if it's an absolute sub-path</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12612">PHPBB3-12612</a>] - Front-facing files should not contain functions</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12615">PHPBB3-12615</a>] - Improper clearing of .topic-actions leads to float problems</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12637">PHPBB3-12637</a>] - coding-guidelines.html contains invalid HTML</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12638">PHPBB3-12638</a>] - Call to undefined function phpbb\db\migration\data\v30x\phpbb_require_updated() when not using autoupdate package</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12639">PHPBB3-12639</a>] - Delete entry in admin-log leads to mysql-error</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12640">PHPBB3-12640</a>] - Posting editor tab &quot;attachments&quot; is unclicked in IE8</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12641">PHPBB3-12641</a>] - With IE8 logged in to ACP error message appears in the browser</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12643">PHPBB3-12643</a>] - Cannot convert SQLite DB from 3.0.12 to 3.1.0</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12652">PHPBB3-12652</a>] - Deleting marked log entries leads to MySQL Error</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12660">PHPBB3-12660</a>] - Undefined offset error when phpinfo() disabled and debug enabled</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12665">PHPBB3-12665</a>] - develop/migration_tips.php should not find extension tips</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12667">PHPBB3-12667</a>] - New posts in a topic cause undesirable results when clicking topic title or page button</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12672">PHPBB3-12672</a>] - Make &lt;Tab&gt; inside [code] - more user friendly</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12673">PHPBB3-12673</a>] - PLUPLOAD fails due missing constant IMAGETYPE_SWC</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12675">PHPBB3-12675</a>] - Fix code sniffer complaints in 3.1.0-b5-dev code</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12682">PHPBB3-12682</a>] - Code Sniffer does not work correctly on Travis CI.</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12688">PHPBB3-12688</a>] - Rank images do not work on routes</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12694">PHPBB3-12694</a>] - Remove whitespace at end of line from acp_groups</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12697">PHPBB3-12697</a>] - Database Test Case Must Purge Extension Schema When Done</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12705">PHPBB3-12705</a>] - make_clickable is using static variables incorrectly</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12707">PHPBB3-12707</a>] - \phpbb\db\driver\phpbb\db\driver\mysql is tried being loaded</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12708">PHPBB3-12708</a>] - [ROOT] -/install/install_main.php still uses docs/COPYING</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12709">PHPBB3-12709</a>] - Duplicate entries in the posting attachments tab</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12711">PHPBB3-12711</a>] - Contact form migration fails on MSSQL</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12712">PHPBB3-12712</a>] - Password conversion migration fails on MSSQL</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12715">PHPBB3-12715</a>] - Mistakes in the doc blocks</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12720">PHPBB3-12720</a>] - Git commit hook should not require commit message to start with a capital letter</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12728">PHPBB3-12728</a>] - Enforce box-model for image attachments</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12741">PHPBB3-12741</a>] - Functional tests on Travis fail since php update last night</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12746">PHPBB3-12746</a>] - Failing test: tests/content_visibility/delete_post_test.php</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12747">PHPBB3-12747</a>] - Drop Firebird support</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12750">PHPBB3-12750</a>] - Install/Update footer is not centered anymore</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12752">PHPBB3-12752</a>] - Cron list tests fail on windows with ansi support</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12753">PHPBB3-12753</a>] - FIELD_INVALID_CHARS_ALPHA_PUNCTUATION is not localized</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12755">PHPBB3-12755</a>] - Remote upload stuck in infinite loop if server sends keep-alive</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12756">PHPBB3-12756</a>] - Fatal error with mysqli_fetch_assoc on hhvm</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12761">PHPBB3-12761</a>] - Remove the execute bit from functions_user.php</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12762">PHPBB3-12762</a>] - Make ext.php optional for extensions</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12763">PHPBB3-12763</a>] - Do not unnecessarily rewrite install/schemas/*_schema.sql when updating schema.json file</li>
+ </ul>
+ <h4>Improvement</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11266">PHPBB3-11266</a>] - Use our own error message when composer is not set up</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12532">PHPBB3-12532</a>] - Add header_navbar_username_prepend/append template events.</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12541">PHPBB3-12541</a>] - Activate attachments tab when files are dropped into textarea</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12563">PHPBB3-12563</a>] - Language key names in ACP styles are misleading</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12606">PHPBB3-12606</a>] - PHP events in /includes/acp/acp_groups.php</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12608">PHPBB3-12608</a>] - Improve notifications drop-down menu styling in header</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12613">PHPBB3-12613</a>] - Improve pagination styling and jump-to-page dialog</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12646">PHPBB3-12646</a>] - Add data attribute to breadcrumb links</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12648">PHPBB3-12648</a>] - Improve UCP/MCP/Posting tabs styling &amp; problems</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12655">PHPBB3-12655</a>] - Allow the CLI to be used as a shell</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12664">PHPBB3-12664</a>] - Refactor develop/migration_tips.php into a console command</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12666">PHPBB3-12666</a>] - Use &quot;None&quot; for images in gallery avatar path root and rename lang key</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12668">PHPBB3-12668</a>] - Add ability to modify subforums template data for core.display_forums_modify_template_vars event</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12669">PHPBB3-12669</a>] - Add core event to the function display_forums() for additional template data</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12677">PHPBB3-12677</a>] - Remove comment about ‘threading’</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12687">PHPBB3-12687</a>] - Add a constant to dissociate the displaying of the load time from DEBUG</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12690">PHPBB3-12690</a>] - Add core.submit_pm_after event</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12691">PHPBB3-12691</a>] - Add core.delete_pm to funtion delete_pm.</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12704">PHPBB3-12704</a>] - Improve the load time information in the footer when enabled</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12706">PHPBB3-12706</a>] - Ignore additional languages and styles from git</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12714">PHPBB3-12714</a>] - Better align the description of radio buttons to avoid confusion with the forum list in attachments settings</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12740">PHPBB3-12740</a>] - Stop Using IDs as CSS selectors</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12758">PHPBB3-12758</a>] - Add 'show_results' mode var to event core.search_modify_rowset</li>
+ </ul>
+ <h4>New Feature</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12597">PHPBB3-12597</a>] - Command for executing all available cron tasks</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12602">PHPBB3-12602</a>] - Add command to print the cron list</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12607">PHPBB3-12607</a>] - CLI command for running a specific cron task</li>
+ </ul>
+ <h4>Sub-task</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12575">PHPBB3-12575</a>] - Use a proxy pattern in \phpbb\di\service_collection</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12699">PHPBB3-12699</a>] - Replace instances in the message textarea keydown callback</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12721">PHPBB3-12721</a>] - Simple rules</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12722">PHPBB3-12722</a>] - Add rule Generic.Formatting.SpaceAfterCast</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12724">PHPBB3-12724</a>] - Add rule Squiz.PHP.Eval</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12729">PHPBB3-12729</a>] - Add Facebook profile field</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12730">PHPBB3-12730</a>] - Add Google+ profile field</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12731">PHPBB3-12731</a>] - Add YouTube profile field</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12732">PHPBB3-12732</a>] - Add Skype profile field</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12733">PHPBB3-12733</a>] - Add Twitter profile field</li>
+ </ul>
+ <h4>Task</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11528">PHPBB3-11528</a>] - Use mink for acceptance tests involving javascript execution</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12514">PHPBB3-12514</a>] - Add additional tests for custom profile fields type</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12696">PHPBB3-12696</a>] - Add events to ucp_register.html</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12701">PHPBB3-12701</a>] - Add events to user_add function</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12723">PHPBB3-12723</a>] - Add Code Sniffer sniff ensuring PHP files use the correct file header</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12726">PHPBB3-12726</a>] - Add Code Sniffer sniff ensuring PHP files do not contain any unused use statements</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12757">PHPBB3-12757</a>] - Add a Code Sniffer ruleset for PHP files of phpBB extensions</li>
+ </ul>
+
+
+ <a name="v310b3"></a><h3>Changes since 3.1.0-b3</h3>
+
+ <h4>Bug</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10176">PHPBB3-10176</a>] - Imageset Appearance Problem with Google Chrome Browser. </li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11226">PHPBB3-11226</a>] - filespec::move_file() from functions_upload.php does not error correctly</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11232">PHPBB3-11232</a>] - prosilver ajax.js does not respect PHPBB_USE_BOARD_URL_PATH</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11366">PHPBB3-11366</a>] - Add &quot;MOD Version Check&quot; for extensions to the core</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11497">PHPBB3-11497</a>] - The extension finder keeps state, so should be instantiated on each container request, not reset manually</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12025">PHPBB3-12025</a>] - Post Preview no longer shows UNAUTHORISED_BBCODE warning for disallowed BBcodes</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12074">PHPBB3-12074</a>] - Enabling/Disabling/Data deleting of an extension should generate a log entry</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12174">PHPBB3-12174</a>] - &quot;Download all attachments&quot; link displayed when the topic has attachments in hidden posts only</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12185">PHPBB3-12185</a>] - Topic header in viewforum too small for translation</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12270">PHPBB3-12270</a>] - Approving a topic triggers wrong notification</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12275">PHPBB3-12275</a>] - core.modify_username_string is not triggered everytime</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12332">PHPBB3-12332</a>] - Attachments with long file names break the Uploader layout</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12357">PHPBB3-12357</a>] - generate_smilies() does not work for routes</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12402">PHPBB3-12402</a>] - CAPTCHA plugin migration fails to detect missing plugins</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12415">PHPBB3-12415</a>] - Use private message instead of &quot;pm&quot; accronym in cpf visibility options</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12421">PHPBB3-12421</a>] - We try to display attachments in feed even for users who don't have the right to see them</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12428">PHPBB3-12428</a>] - Incorrect from version in database update log entry</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12434">PHPBB3-12434</a>] - No error message with Plupload except for files without extension</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12435">PHPBB3-12435</a>] - purge_notifications() fails for disabled extensions</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12440">PHPBB3-12440</a>] - Change URL in browsers addressbar when a view=unread#unread link was used</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12451">PHPBB3-12451</a>] - posting.php TOO_FEW_CHARS_LIMIT should be split for plurals</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12459">PHPBB3-12459</a>] - Unapproved posts/topics are not correctly handled in feeds</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12460">PHPBB3-12460</a>] - Soft deleted posts/topics are not correctly handled in feeds</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12461">PHPBB3-12461</a>] - Statistics are wrong for topic's based feeds</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12476">PHPBB3-12476</a>] - purge_cache should increase asset version</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12486">PHPBB3-12486</a>] - &quot;Risky&quot; tests from phpunit 4.1</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12491">PHPBB3-12491</a>] - Conflict between USERNAME_FULL in functions.php and mcp_notes.php</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12493">PHPBB3-12493</a>] - User can not send PMs to users with PMs disabled, but PM button is visible on posts</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12498">PHPBB3-12498</a>] - IE8 displays avatar in header with wrong width</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12499">PHPBB3-12499</a>] - Incorrect call to phpbb\log\log::add() in db:migrate console command</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12500">PHPBB3-12500</a>] - user.img does not set a title attribute for resulting span</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12501">PHPBB3-12501</a>] - Weird post attachment behavior in MCP report details</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12503">PHPBB3-12503</a>] - All test cases should extend phpbb_test_case instead of PHPUnit_Framework_TestCase</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12504">PHPBB3-12504</a>] - Avatar manager test is using undefined variables</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12509">PHPBB3-12509</a>] - Extentions can't send email with new notification system</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12510">PHPBB3-12510</a>] - build_url() is not encoding url entities</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12511">PHPBB3-12511</a>] - Missing language strings in memberlist group view for mobile prosilver</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12513">PHPBB3-12513</a>] - simple_headers do not support extension loaded CSS stylesheets</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12517">PHPBB3-12517</a>] - Missing argument in call to log.add() in prune_shadow_topics.php</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12519">PHPBB3-12519</a>] - m_approve language update from soft delete patch got nucked by a merge conflict</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12520">PHPBB3-12520</a>] - Can not move text with the mouse anymore in post-box when attachments are allowed</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12522">PHPBB3-12522</a>] - Add parameter description in guesser_interface</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12525">PHPBB3-12525</a>] - CONTACT_USER used with username</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12526">PHPBB3-12526</a>] - &quot;Undefined index: filesize&quot; error thrown when editing a PM with attachments</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12527">PHPBB3-12527</a>] - Remove translation editor from ACP</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12529">PHPBB3-12529</a>] - phpbb\controller\resolver::getController doesn't use $phpbb_root_path to check if the template dir exist</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12533">PHPBB3-12533</a>] - The notification link should fill the parent li-container in the notifications dialog</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12534">PHPBB3-12534</a>] - Enabling and disabling extensions should not abuse the red errorbox</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12536">PHPBB3-12536</a>] - Get Versions Should Not Require Both Stable and Unstable Branches</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12540">PHPBB3-12540</a>] - WRONG_FILESIZE contains broken placeholders</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12543">PHPBB3-12543</a>] - Enter key no longer works in posting when attachment error is triggered</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12547">PHPBB3-12547</a>] - Rename jquery.js to jquery.min.js in assets directory</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12548">PHPBB3-12548</a>] - [RTL] - Posting button icons should display on left side of text</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12549">PHPBB3-12549</a>] - [RTL] - Forumlist/topiclist &lt;dfn&gt; tags should not be visible</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12550">PHPBB3-12550</a>] - [RTL] - Last post column breaks into second line</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12551">PHPBB3-12551</a>] - [RTL] - Breadcrumb separator does not display correctly</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12561">PHPBB3-12561</a>] - Create_schema_files.php should process colum &quot;after&quot; instead of adding it to the JSON</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12570">PHPBB3-12570</a>] - db_text throws an error, when set() is called with the current value</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12572">PHPBB3-12572</a>] - JavaScript console throws error when alert message title is not defined (core.js bug)</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12580">PHPBB3-12580</a>] - :link Pseudo causing over specificity issues in the theme</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12586">PHPBB3-12586</a>] - \phpbb\extension\manager::all_available() should only locate ext files two levels deep and ignore dot-files/folders</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12594">PHPBB3-12594</a>] - File headers, credit lines, etc. should reflect updated legal info</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12600">PHPBB3-12600</a>] - The cli command extension:show is broken</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12604">PHPBB3-12604</a>] - Notifications Dropdown Padding Broken When Empty</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12611">PHPBB3-12611</a>] - phpBB Group copyright notice should be removed from all images</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12614">PHPBB3-12614</a>] - Do not hide post buttons before hovering over post</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12621">PHPBB3-12621</a>] - schema.json is not up to date with migration files</li>
+ </ul>
+ <h4>Improvement</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9388">PHPBB3-9388</a>] - use DOM scripting to hide unnecessary input fields</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11163">PHPBB3-11163</a>] - Include ext/ directory in installation and update packages</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12155">PHPBB3-12155</a>] - Use CSS instead of translated images for the mini post buttons</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12407">PHPBB3-12407</a>] - Allow changing of post_data and other variables with core.posting_modify_template_vars</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12431">PHPBB3-12431</a>] - Add has_poll icon to topiclists</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12433">PHPBB3-12433</a>] - QUOTE_DEPTH_EXCEEDED needs a different string for '1'</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12488">PHPBB3-12488</a>] - Add user warning indication to viewtopic posts</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12507">PHPBB3-12507</a>] - Add console command to purge the cache</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12518">PHPBB3-12518</a>] - Allow extensions to overwrite CANNOT_EDIT_* checks in posting.php and viewtopic.php</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12523">PHPBB3-12523</a>] - Add search_results.html template events search_results_topic_(before/after)</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12524">PHPBB3-12524</a>] - Add search.php core event to modify search results rowset</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12531">PHPBB3-12531</a>] - Restore default topic title links in subsilver2</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12555">PHPBB3-12555</a>] - Make use of canonical urls to avoid duplicate content</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12583">PHPBB3-12583</a>] - Add event core.mcp_warn_post_before/after</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12584">PHPBB3-12584</a>] - Add event core.mcp_warn_user_before/after</li>
+ </ul>
+ <h4>Sub-task</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12576">PHPBB3-12576</a>] - Remove cron from common.php</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12585">PHPBB3-12585</a>] - Don't check the cron on each page load</li>
+ </ul>
+ <h4>Task</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10839">PHPBB3-10839</a>] - Remove phpunit.xml.functional and always include functional tests</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12384">PHPBB3-12384</a>] - Run Travis CI HHVM tests against MySQLi instead of MySQL</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12495">PHPBB3-12495</a>] - Add Sami to composer dependencies and build script</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12544">PHPBB3-12544</a>] - Update Plupload to 2.1.2</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12582">PHPBB3-12582</a>] - Strip away copyrighted ICC profile from images</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12592">PHPBB3-12592</a>] - Run mysql driver on Travis CI</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12603">PHPBB3-12603</a>] - Remove hook_system.html from docs</li>
+ </ul>
+
+
+ <a name="v310b2"></a><h3>Changes since 3.1.0-b2</h3>
+
+ <h4>Bug</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-7707">PHPBB3-7707</a>] - Missing occurrences of get_username_string</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-8323">PHPBB3-8323</a>] - Banned User (PMs and Mails)</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-8558">PHPBB3-8558</a>] - Board Emails not setting a correct email header</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-8700">PHPBB3-8700</a>] - Language file &quot;acp/styles.php&quot; contains many unused language entries</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-8960">PHPBB3-8960</a>] - Allow changing allow_avatar_remote when images/avatars/upload is not writable</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10423">PHPBB3-10423</a>] - Searching for the term &quot;test *&quot; will highlight nearly every word and displays htmlspecialchars as htmlentities.</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10687">PHPBB3-10687</a>] - UNABLE_GET_IMAGE_SIZE text misleading for remote avatars</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10851">PHPBB3-10851</a>] - HTML files containing certain tags being rejected as possible attack vectors with &quot;Check attachment file&quot; set to &quot;No&quot;</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11098">PHPBB3-11098</a>] - New persistent login keys list should have (un)select all and order options.</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11339">PHPBB3-11339</a>] - Using AJAX calls one after another</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11352">PHPBB3-11352</a>] - Disapproving topic takes you to quick reply for that topic</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11431">PHPBB3-11431</a>] - All topic notifications are deleted if one reply is edited and needs to be approved</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11508">PHPBB3-11508</a>] - General error &quot;not allowed as quickmod&quot; when changing the forum while merging two topics</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11772">PHPBB3-11772</a>] - New topic notification triggered when editing an existing post with post-approval enabled</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11860">PHPBB3-11860</a>] - .htaccess not working for Apache 2.4</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11881">PHPBB3-11881</a>] - Timezone migration can take a long time</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11917">PHPBB3-11917</a>] - &quot;Manage external account&quot; shows when not activated</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11978">PHPBB3-11978</a>] - Text field for topic-search</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12004">PHPBB3-12004</a>] - Support empty routes to app.php/ in path_helper</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12012">PHPBB3-12012</a>] - DB Tools should correctly remove columns that are part of indexes</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12043">PHPBB3-12043</a>] - Sort Extensions by Name in ACP Ext Mgr</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12052">PHPBB3-12052</a>] - Post edited by user on moderation queue is not marked as unapproved.</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12083">PHPBB3-12083</a>] - &quot;Select all&quot; selects nothing in Webkit Browsers with only one character in [code] -</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12097">PHPBB3-12097</a>] - The validate_data() function doesn't work with class method</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12113">PHPBB3-12113</a>] - Deleting warnings does not use plurals correctly</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12121">PHPBB3-12121</a>] - Update process doesn't preserve total redirects for links</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12130">PHPBB3-12130</a>] - Bullet character disappears on mouse-over in IE8</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12186">PHPBB3-12186</a>] - MCP should open &quot;Reported posts&quot; instead of PM Reports</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12191">PHPBB3-12191</a>] - UCP should open with global settings instead of notification settings</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12193">PHPBB3-12193</a>] - Broken HTML when an SQL error occurs during migration</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12211">PHPBB3-12211</a>] - Attachment file names are run through htmlspecialchars twice</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12254">PHPBB3-12254</a>] - Language switching on Registration page doesn't work for Extensions</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12265">PHPBB3-12265</a>] - Contact profile fields icons should be hidden in a dropdown</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12286">PHPBB3-12286</a>] - Fix coding guidelines</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12331">PHPBB3-12331</a>] - Fix DB error in update_profile_field_data() with disabled fields</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12342">PHPBB3-12342</a>] - Javascript Bugs and Fixes</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12348">PHPBB3-12348</a>] - Make create_schema_files.php runnable when phpBB is not installed yet</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12350">PHPBB3-12350</a>] - tests/extension/modules_test.php can not be run alone</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12351">PHPBB3-12351</a>] - Ajax &quot;Mark topics read&quot; does not give feedback</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12353">PHPBB3-12353</a>] - User attachments in ACP are not displaying every attachment</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12354">PHPBB3-12354</a>] - passwords_manager_test::test_unique_id fails from time to time</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12355">PHPBB3-12355</a>] - Topic Tools not updated fully updated when subscribing/bookmarking</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12356">PHPBB3-12356</a>] - Plupload does not load in PM editor</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12358">PHPBB3-12358</a>] - data-refresh not working as expected for routes</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12359">PHPBB3-12359</a>] - Day and Month of Birthday Misaligned When Editing</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12360">PHPBB3-12360</a>] - User is displayed twice in online list after second login</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12362">PHPBB3-12362</a>] - Infinite loop in schema generator if dependency can't be resolved</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12367">PHPBB3-12367</a>] - Travis fails in phpbb_wrapper_gmgetdate_test::test_gmgetdate()</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12372">PHPBB3-12372</a>] - dE() function does not toggle in ACP</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12373">PHPBB3-12373</a>] - Add to/from forum ids to LOG_MOVE entries </li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12375">PHPBB3-12375</a>] - Attachment deletion broken after jQuery update</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12378">PHPBB3-12378</a>] - Prosilver common.css has duplicate entries</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12379">PHPBB3-12379</a>] - Plupload labels duplicated when responsive</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12380">PHPBB3-12380</a>] - “Remember Me” login keys are not sorted in UCP</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12381">PHPBB3-12381</a>] - Broken error message when selecting invalid DB driver</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12382">PHPBB3-12382</a>] - Template event listners can not access subloops when loop is defined in the original file</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12386">PHPBB3-12386</a>] - Add DEBUG_EXTRA again and use it for container creation</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12388">PHPBB3-12388</a>] - Log entries without log_data display language key instead of translated string</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12391">PHPBB3-12391</a>] - core.posting_modify_template_vars pass some variables to listeners</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12395">PHPBB3-12395</a>] - Pagination tests fail on travis with postgresql</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12397">PHPBB3-12397</a>] - db_tools::sql_unique_index_exists() has wrong doc block</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12398">PHPBB3-12398</a>] - Prune shadow topics tests fail due to wrong forum_last_post_id</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12405">PHPBB3-12405</a>] - create_user() in functional tests uses invalid timezone and no dateformat</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12406">PHPBB3-12406</a>] - Fix description of page_title var in core.viewtopic_modify_page_title</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12412">PHPBB3-12412</a>] - Styling issue with pagination numbering for smilies and icons</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12413">PHPBB3-12413</a>] - Fatal error &quot;Call to undefined method phpbb\feed\*::fetch_attachments()&quot; for topic based feeds</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12418">PHPBB3-12418</a>] - Notice displayed for feed.php </li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12422">PHPBB3-12422</a>] - Log searches error due to plural arrays in language files</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12429">PHPBB3-12429</a>] - Update phpunit to 3.8+</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12432">PHPBB3-12432</a>] - Migrator should not automatically revert custom functions defined in update_data()</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12436">PHPBB3-12436</a>] - Functional test framework's add_style() should not use sql_multi_insert()</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12444">PHPBB3-12444</a>] - The logs message aren't filled correctly when some values are missing.</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12455">PHPBB3-12455</a>] - Remove unused strings EXTENSION_CONTROLLER_MISSING and EXTENSION_CLASS_WRONG_TYPE from common.php</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12456">PHPBB3-12456</a>] - Missing new lines at the end of file in language files</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12467">PHPBB3-12467</a>] - Add config_*.php and tests_config_*.php to .gitignore</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12469">PHPBB3-12469</a>] - Convert Timezone test fails because of outdated schema</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12470">PHPBB3-12470</a>] - Move commands from .travis.yml to separate files to allow reuse</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12472">PHPBB3-12472</a>] - Set fast finish for .travis.yml</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12474">PHPBB3-12474</a>] - The console command for updating/migrating the db should display the error with the &lt;error&gt; tag</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12475">PHPBB3-12475</a>] - Undefined variable $log in db:migrate console command</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12477">PHPBB3-12477</a>] - PM link no longer displays in viewtopic</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12478">PHPBB3-12478</a>] - ucp_pm_viewmessage_contact_fields_before/after missing in PM page</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12480">PHPBB3-12480</a>] - \phpbb\extension\finder is finding too many routing files</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12482">PHPBB3-12482</a>] - Undefined variable: data in viewtopic when not logged in</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12485">PHPBB3-12485</a>] - Broken tests due to absolute exclude</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12494">PHPBB3-12494</a>] - Undefined index: user_type on viewtopic.php</li>
+ </ul>
+ <h4>Improvement</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9758">PHPBB3-9758</a>] - Make users avatar available to the template</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10521">PHPBB3-10521</a>] - Override Board Language via URL</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11962">PHPBB3-11962</a>] - Resize images to 100% with in viewtopic</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12150">PHPBB3-12150</a>] - Automatically prune shadow topics</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12201">PHPBB3-12201</a>] - Clean up ACP attachment management page</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12273">PHPBB3-12273</a>] - Add a test to run the event exporter on travis</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12282">PHPBB3-12282</a>] - Add an interface for dbal driver to ensure that functions are there</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12283">PHPBB3-12283</a>] - Online status on posting review page.</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12322">PHPBB3-12322</a>] - Add CSS classes for post-profile &lt;dd&gt; elements</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12323">PHPBB3-12323</a>] - Add Template Event search_results_author_prepend</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12327">PHPBB3-12327</a>] - Changing poll result-bars width from absolute % to relative</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12328">PHPBB3-12328</a>] - Add Template Event index_body_stat_blocks_after</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12329">PHPBB3-12329</a>] - Add &lt;div&gt; container to index blocks (online-list, birthday-list, statistics)</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12333">PHPBB3-12333</a>] - Add Template Event overall_header_page_body_before</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12335">PHPBB3-12335</a>] - Add Events to phpbb\profilefields\manager (grab &amp; show)</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12336">PHPBB3-12336</a>] - Add functions_module.php core events to allow adjusting parameters for custom ACP, MCP, UCP modules</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12337">PHPBB3-12337</a>] - Update jQuery to version 1.11.0</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12338">PHPBB3-12338</a>] - Add Template Event overall_footer_page_body_after</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12339">PHPBB3-12339</a>] - Add Event core.page_header_after</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12344">PHPBB3-12344</a>] - Add event to submit_pm()</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12345">PHPBB3-12345</a>] - Improve search flood interval message</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12346">PHPBB3-12346</a>] - Add Template Event overall_header_navlink_append/prepend</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12347">PHPBB3-12347</a>] - Move breadcrumb seperator from template to CSS</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12361">PHPBB3-12361</a>] - Replace the Google logo with the phpBB logo in the BBCode FAQ</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12364">PHPBB3-12364</a>] - Add template identifier var to all missing pages</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12365">PHPBB3-12365</a>] - Do not crop image attachment heights at 350px</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12366">PHPBB3-12366</a>] - Add Event core.search_get_posts_data</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12369">PHPBB3-12369</a>] - Add template variable for extensions to add classes to &lt;body&gt; element without JS</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12374">PHPBB3-12374</a>] - Add Template events index_body_block_&lt;blockname&gt;_append</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12376">PHPBB3-12376</a>] - Add template events viewtopic_body_polls</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12377">PHPBB3-12377</a>] - Move navbars to separate template files</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12389">PHPBB3-12389</a>] - Move &quot;print topic&quot; &amp; &quot;email topic&quot; icons (and PM versions) to topic tools</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12392">PHPBB3-12392</a>] - Include $profile_fields in core.memberlist_view_profile event</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12396">PHPBB3-12396</a>] - Add Template events viewforum_forum_name_append/prepend</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12400">PHPBB3-12400</a>] - Add viewforum.php core event to allow modifying topics data before display the page</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12401">PHPBB3-12401</a>] - Add $topic_data array to core.viewtopic_modify_post_row event in viewtopic.php</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12403">PHPBB3-12403</a>] - Add template events to acp_users_prefs.html</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12409">PHPBB3-12409</a>] - Add acp_users.php core events to modify users preferences data</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12410">PHPBB3-12410</a>] - Add Template events search_results_post_before/after</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12411">PHPBB3-12411</a>] - Expand dispatch vars of event: core.search_modify_tpl_ary</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12419">PHPBB3-12419</a>] - Improve font size in notifications drop-down</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12437">PHPBB3-12437</a>] - Clean up redundant &quot;clear&quot; elements &amp; &quot;corners&quot;</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12438">PHPBB3-12438</a>] - Add Template event memberlist_view_content_prepend</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12442">PHPBB3-12442</a>] - Add CSS classes to heading elements</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12473">PHPBB3-12473</a>] - Add console command for updating/migrating database</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12484">PHPBB3-12484</a>] - Template event ucp_agreement_terms_before/after</li>
+ </ul>
+ <h4>New Feature</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9728">PHPBB3-9728</a>] - Support for sqlite version 3</li>
+ </ul>
+ <h4>Sub-task</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12349">PHPBB3-12349</a>] - License in migrations header not linking to version 2 of GNU GPL</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12370">PHPBB3-12370</a>] - Editing a post removes topic notifications</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12371">PHPBB3-12371</a>] - Notifications are incorrectly updated when a post is deleted or moved to ModerationQueue</li>
+ </ul>
+ <h4>Task</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12071">PHPBB3-12071</a>] - Test suite fails if Fileinfo isn't installed</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12199">PHPBB3-12199</a>] - Move deprecated functions to functions_compatibility.php</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12318">PHPBB3-12318</a>] - Correctly setup HHVM functional tests on Travis CI</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12320">PHPBB3-12320</a>] - No longer allow Travis CI HHVM environment to fail</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12341">PHPBB3-12341</a>] - Add tests for get_username_string()</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12390">PHPBB3-12390</a>] - Released packages MUST NOT contain vendor tests or other non-library code</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12417">PHPBB3-12417</a>] - hhvm-nightly 2014.04.16~precise breaks tests</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12423">PHPBB3-12423</a>] - Increase composer minimum-stability from beta to stable</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12424">PHPBB3-12424</a>] - Update Symfony Dependencies to latest 2.3 releaes</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12458">PHPBB3-12458</a>] - Apply Squiz.WhiteSpace.SuperfluousWhitespace.* sniffs to legacy codebase</li>
+ </ul>
+
+
+ <a name="v310b1"></a><h3>Changes since 3.1.0-b1</h3>
+
+ <h4>Bug</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-8309">PHPBB3-8309</a>] - Rename &quot;Last visited&quot; to &quot;Last activity&quot; on memberlist/viewprofile</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9040">PHPBB3-9040</a>] - Count HTML entities as single characters in Custom Profile fields</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9725">PHPBB3-9725</a>] - MSSQL Schema is not azure compatible</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10769">PHPBB3-10769</a>] - &quot;ACP Access Denied&quot; view includes ajax parts</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11071">PHPBB3-11071</a>] - User selection of an invalid style causes a general error</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11357">PHPBB3-11357</a>] - Invalid markup in installer</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11959">PHPBB3-11959</a>] - List of users in notifications should be trimmed</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12031">PHPBB3-12031</a>] - Bug language Notification list should trim users</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12127">PHPBB3-12127</a>] - Possible NOTIFICATION_QUOTE_TRIMMED miswording</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12160">PHPBB3-12160</a>] - Convert Page throws &quot;invalid dbms driver&quot; when no phpBB installation is present</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12257">PHPBB3-12257</a>] - MySQL Fulltext Tests are not run on Travis CI</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12281">PHPBB3-12281</a>] - Disable redis in travis setup on develop until redis fixes it</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12292">PHPBB3-12292</a>] - Buttons are mis-matched, unaligned in ACP Style Details</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12293">PHPBB3-12293</a>] - Core event listeners not working in log.php</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12294">PHPBB3-12294</a>] - phpbb_ in profile fields column names is incorrectly replaced with the table prefix</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12297">PHPBB3-12297</a>] - user_from column not deleted on update to b1</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12310">PHPBB3-12310</a>] - SMTP username and password should not autocomplete during install</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12311">PHPBB3-12311</a>] - Metadata Manager should require license instead of licence</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12314">PHPBB3-12314</a>] - HHVM SPL autoloader sometimes passes class name with leading backslash</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12315">PHPBB3-12315</a>] - NO_SEARCH_INDEX in language/en/acp/common.php uses invalid HTML</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12316">PHPBB3-12316</a>] - develop-ascraeus build status missing from &quot;Automated Testing&quot; section in README.md</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12317">PHPBB3-12317</a>] - Some notification tests fail on DBMS drivers using appropriate integer typing (MSSQL, Sqlite3, also MySQL on HHVM)</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12321">PHPBB3-12321</a>] - Remove execute bit from file ucp_main_subscribed.html and buttons.png in prosilver</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12324">PHPBB3-12324</a>] - Can not update from b1 to b2 because of missing install/update/new/config/ folder</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12326">PHPBB3-12326</a>] - Error while updating from b1 to b2 because of incomplete update files</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12330">PHPBB3-12330</a>] - Installation fails on MSSQL</li>
+ </ul>
+ <h4>Improvement</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10174">PHPBB3-10174</a>] - Rename &quot;Ban usernames&quot; to &quot;Ban users&quot; in ACP</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10590">PHPBB3-10590</a>] - Skip confirmation page after successful posting of an approved post</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11169">PHPBB3-11169</a>] - Move prune users from security to users category</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11230">PHPBB3-11230</a>] - Use @inheritdoc in docblocks in cache drivers</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11239">PHPBB3-11239</a>] - Include username before the Overview title.</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11336">PHPBB3-11336</a>] - Rename mode parameter from &quot;leaders&quot; to something more accurate for the &quot;The team&quot; page</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11360">PHPBB3-11360</a>] - page_header() argument &quot;display_online_list&quot; should be FALSE by default</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11666">PHPBB3-11666</a>] - POST_DELETED should refer to posts instead of messages</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12035">PHPBB3-12035</a>] - Add a link to user's posts in the ACP user overview page</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12198">PHPBB3-12198</a>] - Unused ERR_TEMPLATE_EVENT_* language strings in en/common.php</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12268">PHPBB3-12268</a>] - Extension finder should not crawl through .git/ of extensions</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12269">PHPBB3-12269</a>] - Delete &quot;mods&quot; folder from the language folder</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12274">PHPBB3-12274</a>] - Updater is using old version of adm/style/admin.css</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12276">PHPBB3-12276</a>] - Expand core.memberlist_view_profile event to include Zebra state</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12278">PHPBB3-12278</a>] - Add mcp.php core event to allow setting display options for custom MCP modules</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12284">PHPBB3-12284</a>] - Make Extension Details page more readable</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12289">PHPBB3-12289</a>] - Add viewtopic_body.html template event to allow custom post notices</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12300">PHPBB3-12300</a>] - Revert and Reimagine Link to last read posts</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12304">PHPBB3-12304</a>] - Add CSS class to rules-link container</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12308">PHPBB3-12308</a>] - Add Template Event forumlist_body_last_row_after</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12309">PHPBB3-12309</a>] - Add Template Event quickreply_editor_panel_before/after</li>
+ </ul>
+ <h4>New Feature</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-7580">PHPBB3-7580</a>] - Allow isset() check in IF template syntax</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12298">PHPBB3-12298</a>] - Template Event memberlist_view_contact_before/after</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12301">PHPBB3-12301</a>] - Template Event overall_header_body_before</li>
+ </ul>
+ <h4>Task</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11459">PHPBB3-11459</a>] - Deduplicate database schema definiton</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11904">PHPBB3-11904</a>] - Revisit ALLOW_CDN_EXPLAIN wording</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12302">PHPBB3-12302</a>] - Upgrade composer.phar to 1.0.0-alpha8</li>
+ </ul>
+
+ <a name="v310a3"></a><h3>Changes since 3.1.0-a3</h3>
+
+ <h4>Bug</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-8041">PHPBB3-8041</a>] - Do not concatenate the destination to L_RETURN_TO to allow better translations</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-8122">PHPBB3-8122</a>] - Reviewing topics/posts - not correctly displayed</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-8785">PHPBB3-8785</a>] - PM recipients/bcc list looks bad</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-8919">PHPBB3-8919</a>] - Localisation imageset being refreshed too frequently causing broken images</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9106">PHPBB3-9106</a>] - Upload fails to complete for large files.</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9420">PHPBB3-9420</a>] - BBCode - Unable to use a proper URI token</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9459">PHPBB3-9459</a>] - Visiting ACP with screen resolution 800x600px</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10175">PHPBB3-10175</a>] - Class loader cannot find a/b_foo.php when a/b/bar.php exists</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10338">PHPBB3-10338</a>] - Attachments list is displayed incorrectly</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10722">PHPBB3-10722</a>] - Code Coverage generation fails</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11038">PHPBB3-11038</a>] - Does not correctly find module info classes using new naming conventions</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11146">PHPBB3-11146</a>] - MCP topic/post approval error</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11151">PHPBB3-11151</a>] - Can use negative start for memberlist.php</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11218">PHPBB3-11218</a>] - File upload functional test fails</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11255">PHPBB3-11255</a>] - Some tests do not run standalone due to dbal dependency on global $cache</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11271">PHPBB3-11271</a>] - Images in ATOM feed display, but attached inline images do not.</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11288">PHPBB3-11288</a>] - &quot;Fulltext native&quot; search fooled by hyphens</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11364">PHPBB3-11364</a>] - Add an easy-to-switch system for app.php?controller= vs mod-rewrite usage in append_sid</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11429">PHPBB3-11429</a>] - Extensions should increment assets number on enable</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11581">PHPBB3-11581</a>] - General Error in UCP if PMs are disabled in ACP</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11625">PHPBB3-11625</a>] - General Error accessing MCP from Global Announcement</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11648">PHPBB3-11648</a>] - Test suite creates files in phpBB directory</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11787">PHPBB3-11787</a>] - Permission language strings use samp for highlight instead of strong</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11880">PHPBB3-11880</a>] - Schema changes can take too long and cause a timeout</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11938">PHPBB3-11938</a>] - Use of deprecated sql_attr_str2ordinal in sphinx.conf</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12003">PHPBB3-12003</a>] - ACP broken when error thrown</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12072">PHPBB3-12072</a>] - Missing word &quot;send&quot; in comment in schema_data.sql</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12078">PHPBB3-12078</a>] - &quot;Can permanently delete own posts&quot; permission has no effect</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12080">PHPBB3-12080</a>] - Responsive design in ACP / User Administration / Signature needs fixing</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12093">PHPBB3-12093</a>] - IE 11 javascript selection is no longer supported</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12126">PHPBB3-12126</a>] - Alert box is aligned to the left instead of center in IE</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12132">PHPBB3-12132</a>] - viewtopic_print_head_append template event is missing in subsilver2</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12134">PHPBB3-12134</a>] - ucp_pm_viewmessage_print_head_append template event is missing in subsilver2</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12136">PHPBB3-12136</a>] - Call to undefined function generate_pagination() in functions_posting.php</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12138">PHPBB3-12138</a>] - Information and pagination of filtered attachments</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12139">PHPBB3-12139</a>] - Spaces missing after $show_guests in viewonline.php</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12141">PHPBB3-12141</a>] - Travis tests fail on 5.5</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12149">PHPBB3-12149</a>] - Division by zero in [ROOT] -/phpbb/pagination.php</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12153">PHPBB3-12153</a>] - PAGE_NUMBER should be assigned by pagination.generate_template_pagination()</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12158">PHPBB3-12158</a>] - pagination.validate_start() returns negative value when $num_items = 0</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12168">PHPBB3-12168</a>] - Nav Header Links Alignment Issues without small-icon</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12170">PHPBB3-12170</a>] - Migration helper replaces table name with 0 when creating tables</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12171">PHPBB3-12171</a>] - Attachments from soft-deleted posts are still downloadable</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12172">PHPBB3-12172</a>] - &quot;Download all attachments&quot; feature leaks post/pm attachments when being able to download one of them</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12175">PHPBB3-12175</a>] - Fix and run functional upload tests</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12176">PHPBB3-12176</a>] - No error shown when attempting to delete a founder</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12183">PHPBB3-12183</a>] - Update user_newpasswd column in users table for passwords manager</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12184">PHPBB3-12184</a>] - Undefined variable tpl_fields in profile field manager on memberlist</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12188">PHPBB3-12188</a>] - Add php 5.6 to travis tests</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12192">PHPBB3-12192</a>] - Avatars in PM report closed notifications are broken</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12194">PHPBB3-12194</a>] - Unknown column 'field_show_novalue' in 'field list' [1054] -</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12200">PHPBB3-12200</a>] - Profile field template files missing in adm/style</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12202">PHPBB3-12202</a>] - Variables read from style.cfg etc. should be htmlspecialchared</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12203">PHPBB3-12203</a>] - user_occ does not have a default value when registering</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12205">PHPBB3-12205</a>] - Custom Profile Field display bug</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12206">PHPBB3-12206</a>] - Errors in plupload doesn't pull lang vars right</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12207">PHPBB3-12207</a>] - prosilver layout breaks when error outputted before &lt;html&gt;</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12208">PHPBB3-12208</a>] - Plupload uploads files even if they were deleted from queue</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12210">PHPBB3-12210</a>] - dbtools::sql_create_table incorrectly throws error related to auto-increment length on non auto-increment fields</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12212">PHPBB3-12212</a>] - HTML in attachment file name rendered before upload</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12216">PHPBB3-12216</a>] - Undefined index: lang_options when creating date profile field</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12220">PHPBB3-12220</a>] - Debug message if no unread messages are present</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12222">PHPBB3-12222</a>] - Replace hardoded comma with translatable separator in forumlist_body.html</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12223">PHPBB3-12223</a>] - Pagination displayes additional &amp;bull; when PAGE_NUMBER is empty</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12226">PHPBB3-12226</a>] - Incorrectly used plurals in ucp.php MOVE_PM_ERROR and FOLDER_MESSAGE_STATUS</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12227">PHPBB3-12227</a>] - &quot;X from Y messages&quot; should be &quot;X out of Y messages&quot;</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12243">PHPBB3-12243</a>] - subsilver2 is missing profile field files</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12245">PHPBB3-12245</a>] - &quot;Invalid id refernce&quot; for label &quot;joined&quot; and &quot;group_id&quot; in acp_prune_users.html</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12249">PHPBB3-12249</a>] - Undefined variable: row when editing profile</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12250">PHPBB3-12250</a>] - Remove deprecated phpbb_clean_path function</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12251">PHPBB3-12251</a>] - Clean up and Enhancement of Custom Profile Fields</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12256">PHPBB3-12256</a>] - phpbb\notification\type\admin_activate_user uses $sql as fetchrow parameter</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12261">PHPBB3-12261</a>] - Login redirect from extension front controllers broken</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12263">PHPBB3-12263</a>] - \phpbb\db\migration\tool\module.php contains several errors</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12267">PHPBB3-12267</a>] - Functional testcase method get_extension_manager() uses undefined variable php_ext</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12271">PHPBB3-12271</a>] - Decouple dropdown header/footer from #notification_list</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12272">PHPBB3-12272</a>] - Hardcoded colon in subforums list</li>
+ </ul>
+ <h4>Improvement</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9255">PHPBB3-9255</a>] - Friends Sidebar has scability issues..</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9479">PHPBB3-9479</a>] - Empty paragraphs for vertical spacing are rather old-fashioned</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9709">PHPBB3-9709</a>] - Missing language files for MCP could be substituted by default / english ones</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9871">PHPBB3-9871</a>] - Update version check file to use json format</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10288">PHPBB3-10288</a>] - Templates including other templates in loop can't access variables</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10549">PHPBB3-10549</a>] - Languages variables should be used, not hardcoded</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10555">PHPBB3-10555</a>] - Copyright notice in overall_header.html is not translatable</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10945">PHPBB3-10945</a>] - Show entered search query in the search box when no results are found.</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11019">PHPBB3-11019</a>] - Ability to store array of data in a log</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11022">PHPBB3-11022</a>] - Add &quot;Tahoma&quot; to used font families in css files</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11040">PHPBB3-11040</a>] - PostgreSQL fulltext search improvement</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11111">PHPBB3-11111</a>] - Allow only vertical resize on the textarea.</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11179">PHPBB3-11179</a>] - change the start parameter in search when out of bounds to display last(or first) page</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11201">PHPBB3-11201</a>] - MSNM / WLM closing - redundant profile field</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11254">PHPBB3-11254</a>] - Check CRLF line endings in the test suite</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11297">PHPBB3-11297</a>] - Running tests doc should mention dbunit dependency</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11610">PHPBB3-11610</a>] - Use a more secure hashing method like bcrypt</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11645">PHPBB3-11645</a>] - Rename &quot;.MODs&quot; tab in the ACP</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11693">PHPBB3-11693</a>] - Change phpbb_db_driver::sql_build_array() to support DELETE</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11716">PHPBB3-11716</a>] - Migration to convert soft delete/trash bin mods to 3.1 soft delete</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12029">PHPBB3-12029</a>] - Module names in the ACP should not be truncated when they are too long</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12073">PHPBB3-12073</a>] - Small text size in ACP between &lt;samp&gt;&lt;/samp&gt; and &lt;code&gt;&lt;/code&gt; tags</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12106">PHPBB3-12106</a>] - Document exceptions to &quot;Disable Board&quot; in ACP.</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12114">PHPBB3-12114</a>] - Convert current profile fields to custom-profile-field system</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12117">PHPBB3-12117</a>] - Nested Set Tree Classes Should be able to get all roots</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12166">PHPBB3-12166</a>] - Add template event &quot;quickreply_editor_message_box_before&quot;</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12167">PHPBB3-12167</a>] - Allow users to change style via style parameter by default</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12190">PHPBB3-12190</a>] - Add core event &quot;core.modify_submit_post_data&quot;</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12217">PHPBB3-12217</a>] - Add template events to viewtopic_body.html</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12224">PHPBB3-12224</a>] - Add template method to assign block arrays</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12231">PHPBB3-12231</a>] - Add template events to forumlist_body.html</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12238">PHPBB3-12238</a>] - There is no cancel input type.</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12239">PHPBB3-12239</a>] - Move deprecated password functions to compatibility file</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12240">PHPBB3-12240</a>] - Adding specific class names to buttons in posting_buttons.html</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12241">PHPBB3-12241</a>] - Event to add and/or modify acp_board configurations</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12244">PHPBB3-12244</a>] - Remove ambiguity between Extension Tab and Extensions Management links</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12248">PHPBB3-12248</a>] - Extension Details Homepage should be a clickable link</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12259">PHPBB3-12259</a>] - Too many redundant tests are run on Travis</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12260">PHPBB3-12260</a>] - Add core event to delete_posts() function</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12262">PHPBB3-12262</a>] - Adjust a script to export the events in wiki format</li>
+ </ul>
+ <h4>Sub-task</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12115">PHPBB3-12115</a>] - Convert occupation/interests profile field to custom field</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12169">PHPBB3-12169</a>] - Convert location user field to profile field </li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12187">PHPBB3-12187</a>] - Convert website user field to profile field</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12233">PHPBB3-12233</a>] - Allowing CPF to be have an icon on viewtopic and be listed in the contact section of the profile</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12234">PHPBB3-12234</a>] - Convert ICQ user field to profile field</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12235">PHPBB3-12235</a>] - Convert MSN/WLM user field to profile field </li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12236">PHPBB3-12236</a>] - Convert AOL user field to profile field</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12237">PHPBB3-12237</a>] - Convert Yahoo user field to profile field</li>
+ </ul>
+ <h4>Task</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10763">PHPBB3-10763</a>] - Audit code for non-static functions called statically</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10793">PHPBB3-10793</a>] - Use db_tools in create_schema_files</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11509">PHPBB3-11509</a>] - Travis should check commit message format</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11764">PHPBB3-11764</a>] - Remove Subsilver2 from installation packages</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12177">PHPBB3-12177</a>] - Add event ucp_zebra_friend_list_before/after</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12180">PHPBB3-12180</a>] - CodeSniffer: Ensure each file ends with a single newline</li>
+ </ul>
+
+
+ <a name="v310a2"></a><h3>Changes since 3.1.0-a2</h3>
+
+<h4>Bug</h4>
+<ul>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10810">PHPBB3-10810</a>] - Manage group in ucp requires access to adm/</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11246">PHPBB3-11246</a>] - Misleading Message in New User Pruning Feature</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11484">PHPBB3-11484</a>] - Topic Reply Notification email links not requiring user to log in</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11507">PHPBB3-11507</a>] - Impossible to prune users by group only</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11672">PHPBB3-11672</a>] - AJAX alerts contain unnecessary messages/links</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11709">PHPBB3-11709</a>] - Bulletin points in navigation menu are misaligned in RTL languages</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11842">PHPBB3-11842</a>] - Avatar driver error thrown when creating group</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11856">PHPBB3-11856</a>] - Require composer.json for extensions</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11859">PHPBB3-11859</a>] - Avatar drivers should return template filename</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11869">PHPBB3-11869</a>] - Strict debug message when registering with profile fields displayed</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11911">PHPBB3-11911</a>] - ACP should warn if there is no search index created for the selected search engine</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11912">PHPBB3-11912</a>] - &quot;Unable to guess the mime type as no guessers are available&quot; when uploading files</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11914">PHPBB3-11914</a>] - plupload should be updated to 2.0.x</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11915">PHPBB3-11915</a>] - plupload should be restyled to match the design of prosilver better</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11959">PHPBB3-11959</a>] - List of users in notifications should be trimmed</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11963">PHPBB3-11963</a>] - Stale MCP notifications get left behind</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11984">PHPBB3-11984</a>] - Ticket for more bugs/improvements for responsive design for both prosilver and ACP</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11988">PHPBB3-11988</a>] - Active tab in ACP should not have hover effect</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11997">PHPBB3-11997</a>] - redirect() does not work for app.php/xyz pages</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12001">PHPBB3-12001</a>] - User input is ignored in AJAX confirmation forms</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12006">PHPBB3-12006</a>] - Disabled Extensions with Modules can break the ACP/UCP/MCP</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12009">PHPBB3-12009</a>] - Incorrectly installed extensions should be ignored</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12011">PHPBB3-12011</a>] - RTL languages have style bugs in prosilver/ACP</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12015">PHPBB3-12015</a>] - Enhance events in viewtopic to increase their usability</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12026">PHPBB3-12026</a>] - Unable to find template - in MCP/UCP, which are added via extensions</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12027">PHPBB3-12027</a>] - Redis tests failing</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12028">PHPBB3-12028</a>] - Don't use L_COLON in a JavaScript context</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12030">PHPBB3-12030</a>] - Include config directory completely in update packages when one file is being updated</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12032">PHPBB3-12032</a>] - Certain notifications incorrectly inherit read status from post/topic</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12036">PHPBB3-12036</a>] - Module Management items have 2 move down buttons and no up</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12038">PHPBB3-12038</a>] - Move up/down buttons are not AJAXified in various ACP pages.</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12040">PHPBB3-12040</a>] - ACP tabs flicker when AJAX background appears</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12042">PHPBB3-12042</a>] - Several strings of plupload are not being translated</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12045">PHPBB3-12045</a>] - Several HTML markup issues in adm/style/acp_prune_users.html</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12049">PHPBB3-12049</a>] - PLUPLOAD_ERR_UPLOAD_LIMIT should be using plurals</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12050">PHPBB3-12050</a>] - phpbb_notification_submit_post_base should be abstract</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12055">PHPBB3-12055</a>] - ACP BBCodes/Smilies Row Color Changes Needed After AJAX operations</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12058">PHPBB3-12058</a>] - Updating database fails in migration v310/avatar_types.php</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12059">PHPBB3-12059</a>] - ACP INCLUDECSS not working, missing {$STYLESHEETS}</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12062">PHPBB3-12062</a>] - INCLUDEJS broken for extension events in the ACP</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12063">PHPBB3-12063</a>] - &lt;tr&gt; tags use invalid valign attribute</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12077">PHPBB3-12077</a>] - General Error thrown when submitting ACP language pack editor </li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12079">PHPBB3-12079</a>] - request.untrimmed_variable() $multibyte param does not have default value</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12091">PHPBB3-12091</a>] - Plupload - File upload does not work in Internet Explorer 11</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12092">PHPBB3-12092</a>] - Plupload - File info missing for several uploaded files</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12095">PHPBB3-12095</a>] - IE11 JavaScript plupload error</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12096">PHPBB3-12096</a>] - Not using plurals correctly in search.php MAX_NUM_SEARCH_KEYWORDS_REFINE</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12100">PHPBB3-12100</a>] - ACP Template files not purged during Extension Enable/Disable</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12107">PHPBB3-12107</a>] - Log table name is hard-coded in log.get_logs()</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12110">PHPBB3-12110</a>] - Update Plupload to 2.1.1</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12123">PHPBB3-12123</a>] - No category specified for soft-delete permission</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12124">PHPBB3-12124</a>] - Plupload broken on IE8</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12125">PHPBB3-12125</a>] - Topic rows are missing background in IE8</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12131">PHPBB3-12131</a>] - prosilver viewtopic print view has invalid imageset var</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12140">PHPBB3-12140</a>] - Avoid endless loop in build script</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12141">PHPBB3-12141</a>] - Travis tests fail on 5.5</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12151">PHPBB3-12151</a>] - Class 'phpbb\profilefields\profilefields' not found</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12154">PHPBB3-12154</a>] - DB Schema not built with develop script</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12156">PHPBB3-12156</a>] - Passwords Manager ~ Bug with OAuth</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12159">PHPBB3-12159</a>] - Fix code sniffer complaints after profilefields and passwords merge</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12161">PHPBB3-12161</a>] - build/save directories are no longer created</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12162">PHPBB3-12162</a>] - Binary files missing from update packages</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12163">PHPBB3-12163</a>] - Page number in viewtopic page title is incorrect</li>
+</ul>
+<h4>Improvement</h4>
+<ul>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10910">PHPBB3-10910</a>] - function build_cfg_template() allow $size for $tpl_type = select</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11346">PHPBB3-11346</a>] - Do not show &quot;Mark topics as read&quot; when there are no topics</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11849">PHPBB3-11849</a>] - Move pagination from functions.php into class</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11950">PHPBB3-11950</a>] - Add 'I forgot my password' link to index page login form</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11961">PHPBB3-11961</a>] - Plupload is not updating uploaded files panel</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11966">PHPBB3-11966</a>] - Add Template Event overall_header_navigation_prepend/append to Subsilver2</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11969">PHPBB3-11969</a>] - Link topic title to unread post instead of first post</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11979">PHPBB3-11979</a>] - Add basic dropdown menu framework to prosilver</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12005">PHPBB3-12005</a>] - Remove code responsible for PM popup completely</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12010">PHPBB3-12010</a>] - Navbar icons should be clickable</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12014">PHPBB3-12014</a>] - Add template event &quot;index_body_forumlist_before&quot;</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12024">PHPBB3-12024</a>] - Add Template Event overall_header_content_before and overall_footer_content_after</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12034">PHPBB3-12034</a>] - AJAXify notifications popup</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12054">PHPBB3-12054</a>] - Improve Index Body Template Events</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12060">PHPBB3-12060</a>] - Add BBCode system core and template events</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12069">PHPBB3-12069</a>] - Add PHP event core.submit_post_modify_return_url in submit_post()</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12104">PHPBB3-12104</a>] - Shadowtopics SQL used in core event should use the SQL builder</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12135">PHPBB3-12135</a>] - editor.js function bbfontstyle()</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12146">PHPBB3-12146</a>] - Add color demo when editing a group from the UCP</li>
+</ul>
+<h4>New Feature</h4>
+<ul>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12039">PHPBB3-12039</a>] - Add config functionality to CLI</li>
+</ul>
+<h4>Sub-task</h4>
+<ul>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11241">PHPBB3-11241</a>] - Improve user interface for mass attachment downloader (all posts, all topics)</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12111">PHPBB3-12111</a>] - Extract profile field types to individual classes</li>
+</ul>
+<h4>Task</h4>
+<ul>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11432">PHPBB3-11432</a>] - Travis should complain when CRLF files are added.</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11509">PHPBB3-11509</a>] - Travis should check commit message format</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11985">PHPBB3-11985</a>] - Enable APC module on Travis to run APC Cache tests</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12064">PHPBB3-12064</a>] - Remove obsolete viewsource.html from adm/style folder</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12147">PHPBB3-12147</a>] - Remove Travis CI notification configuration</li>
+</ul>
+
+ <a name="v310a1"></a><h3>Changes since 3.1.0-a1</h3>
+
+<h4>Bug</h4>
+<ul>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-4776">PHPBB3-4776</a>] - Long post gets hidden behind posting profile</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10449">PHPBB3-10449</a>] - Lines spilling in subscriptions view</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10948">PHPBB3-10948</a>] - Color swatch in 3.1 does not display properly</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11030">PHPBB3-11030</a>] - I beam cursor in prosilver when hovering on browse button for uploading attachments</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11073">PHPBB3-11073</a>] - Reported/Unapproved moderator information in viewtopic is striked through instead of underlined</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11138">PHPBB3-11138</a>] - Resync features in ACP should not use AJAX</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11280">PHPBB3-11280</a>] - Double clicking &quot;mark topics read&quot; produces an error the second time</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11525">PHPBB3-11525</a>] - phpbb_avatar_manager::clean_row collapses user_id and group_id</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11534">PHPBB3-11534</a>] - Remote avatar does not properly check if remote file is an image</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11626">PHPBB3-11626</a>] - Auth ACP options should be moved to separate html file</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11663">PHPBB3-11663</a>] - In generate_text_for_storage the function does not check for errors of parse_message:parse() and act accordingly</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11691">PHPBB3-11691</a>] - Soft delete migration conversion should be staggered</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11739">PHPBB3-11739</a>] - Wrong name for UCP Module &quot;Edit &quot;Remember Me&quot; login keys&quot;</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11842">PHPBB3-11842</a>] - Create a new group Error with avatar driver</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11857">PHPBB3-11857</a>] - Avatar manager must not depend on entire container</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11872">PHPBB3-11872</a>] - MCP: Users with most warnings list is invalid</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11896">PHPBB3-11896</a>] - &quot;Mark all notifications read&quot; does not work</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11899">PHPBB3-11899</a>] - New ajax poll vote should give feedback while waiting for servers response</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11916">PHPBB3-11916</a>] - Remove files from hidden attach list after deletion</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11922">PHPBB3-11922</a>] - Migrator fails to remove columns on MSSQL when they have/had an index</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11923">PHPBB3-11923</a>] - UCP avatar error when user has no permissions to change his/her avatar</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11924">PHPBB3-11924</a>] - Add a script to export the events in wiki format</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11926">PHPBB3-11926</a>] - Plupload Migration has a broken dependency.</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11927">PHPBB3-11927</a>] - Missing Files after 3.1.0-A1 Automatic Updater</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11930">PHPBB3-11930</a>] - Avatar paths are incorrect when using app.php</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11935">PHPBB3-11935</a>] - Invalid HTML in &quot;Sort By&quot; form elements in Prosilver</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11936">PHPBB3-11936</a>] - Fixes to Notifications Window</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11939">PHPBB3-11939</a>] - Quick reply editor has unnecessary data-ajax attribute</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11943">PHPBB3-11943</a>] - $VAR = false has unexpected result</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11945">PHPBB3-11945</a>] - Focused buttons are hard to notice</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11947">PHPBB3-11947</a>] - Notification popup does not appear when clicking number in text</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11948">PHPBB3-11948</a>] - Extensions should be allowed to have more then 1 routing file</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11949">PHPBB3-11949</a>] - cannot upgrade to 3.1</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11960">PHPBB3-11960</a>] - Responsive design removed teampage names</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11972">PHPBB3-11972</a>] - Add template event posting_editor_subject_after</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11977">PHPBB3-11977</a>] - Ajax delete should disable moving options</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11982">PHPBB3-11982</a>] - Navigation is shown above AJAX background in ACP</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11983">PHPBB3-11983</a>] - Subscriptions argument missing from docblock in ucp_notifications</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11986">PHPBB3-11986</a>] - Undefined index: poster_id in file.php</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11987">PHPBB3-11987</a>] - {ROOT_PATH} in ACP leads to adm/</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11990">PHPBB3-11990</a>] - Remove result_mssqlnative from acp_database</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11991">PHPBB3-11991</a>] - PHP notices when closing reported posts entries in MCP</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11992">PHPBB3-11992</a>] - Wrong variable to close &quot;Users with most warnings&quot; block at MCP</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11994">PHPBB3-11994</a>] - Admin options for extensions are bad/misleading</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11995">PHPBB3-11995</a>] - Reverting a config.remove fails</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12002">PHPBB3-12002</a>] - Extension management page should use generate/check link hash</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12007">PHPBB3-12007</a>] - Default last_result of callable steps must be integer instead of false</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12008">PHPBB3-12008</a>] - &quot;Prune notifications&quot; cron task always ran, blocking others</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12016">PHPBB3-12016</a>] - Event listeners should be services</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12017">PHPBB3-12017</a>] - Extension tests are broken on current develop</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12018">PHPBB3-12018</a>] - Use path_helper for admin style CSS in sql report</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12023">PHPBB3-12023</a>] - New css files missing after update</li>
+</ul>
+<h4>Improvement</h4>
+<ul>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11552">PHPBB3-11552</a>] - Responsive design for prosilver</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11746">PHPBB3-11746</a>] - Add &quot;account activation required&quot; notification for Administrators</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11921">PHPBB3-11921</a>] - Improve Notifications and PMs in the header</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11928">PHPBB3-11928</a>] - Replace AJAX loading info pop up with animation</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11957">PHPBB3-11957</a>] - Responsive design for admin control panel</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11973">PHPBB3-11973</a>] - Remove logic from language files where possible</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11974">PHPBB3-11974</a>] - All timezones should be translatable</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11975">PHPBB3-11975</a>] - Add ACP link next to MCP</li>
+</ul>
+<h4>Task</h4>
+<ul>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11031">PHPBB3-11031</a>] - Bring phpBB2 converter up to speed with 3.1 changes</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11980">PHPBB3-11980</a>] - Setup PHP Code Sniffer</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11981">PHPBB3-11981</a>] - Review/Fix Code Sniffer complaints</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11998">PHPBB3-11998</a>] - Add console / command line client environment </li>
+</ul>
+
+ <a name="v30x"></a><h3>Changes since 3.0.x</h3>
+
+<h4>Bug</h4>
+<ul>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-4412">PHPBB3-4412</a>] - MCP and viewtopic messed up when long profile fields used</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-6109">PHPBB3-6109</a>] - MSN is now called Windows Live Messenger (WLM)</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-6855">PHPBB3-6855</a>] - The word separator has been misspelled in the code</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-7070">PHPBB3-7070</a>] - Making Font Type &amp; Size Easy To modify</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-7252">PHPBB3-7252</a>] - Use IMAGETYPE_ constants in get_supported_image_types()</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-7448">PHPBB3-7448</a>] - Module management calling non-static method p_master::module_auth()</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-8212">PHPBB3-8212</a>] - Comment spelling mistake in includes/acp/acp_board.php</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-8228">PHPBB3-8228</a>] - Coding BBcode has whitespace before the code.</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-8542">PHPBB3-8542</a>] - No custom profile fields in private messages</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-8641">PHPBB3-8641</a>] - Extra and missing comma in acp_board.php</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-8713">PHPBB3-8713</a>] - trimming login inputs isn't sensible</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-8841">PHPBB3-8841</a>] - Unexpected results when using &quot;PHPBB_USE_BOARD_URL_PATH&quot;</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-8912">PHPBB3-8912</a>] - phpbb_styles_template_data contans more than 4k records</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9022">PHPBB3-9022</a>] - Poll Deletion Problem on Global change</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9163">PHPBB3-9163</a>] - style.php cannot be properly cached</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9341">PHPBB3-9341</a>] - Incorrectly named template vars</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9394">PHPBB3-9394</a>] - wrong comment in functions_upload.php</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9474">PHPBB3-9474</a>] - Unnecessary mcp_viewlogs.html included</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9492">PHPBB3-9492</a>] - Group avatar overwrites currently defined user avatars</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9766">PHPBB3-9766</a>] - phpbb_default_captcha::delete_code() takes no argument but uses $confirm_id</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9918">PHPBB3-9918</a>] - $redirect variable set, but not used, in mcp functions</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10006">PHPBB3-10006</a>] - phpbb_config::delete is missing</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10013">PHPBB3-10013</a>] - Cache test writes to a temporary location deep in the source tree</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10045">PHPBB3-10045</a>] - Database updater version for changes between 3.0.x and 3.1.0 should be 3.1.0-dev</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10070">PHPBB3-10070</a>] - CRLF in develop</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10080">PHPBB3-10080</a>] - request_var tests fail when other tests using request_var are executed first</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10103">PHPBB3-10103</a>] - Fix remaining usage of flock() by converting it to use the lock class</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10136">PHPBB3-10136</a>] - Missing $request globalizations in includes/functions.php</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10139">PHPBB3-10139</a>] - Use of $cache for two different things in includes/config/db.php </li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10151">PHPBB3-10151</a>] - Version number needs to be updated in installer</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10152">PHPBB3-10152</a>] - Installer places ?&gt; in config.php</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10156">PHPBB3-10156</a>] - Cron tests fail on windows</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10290">PHPBB3-10290</a>] - Who's online broken due to malformed SQL</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10300">PHPBB3-10300</a>] - Groups teampage legends settings</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10316">PHPBB3-10316</a>] - Inconsistency between prosilver and subsilver when locking a topic while moving</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10322">PHPBB3-10322</a>] - No longer possible to include templates via variables, captcha broken</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10329">PHPBB3-10329</a>] - Function pcre_utf8_support() needs the &quot;phpbb_&quot; prefix</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10350">PHPBB3-10350</a>] - class phpbb_template_renderer_eval does not work</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10355">PHPBB3-10355</a>] - Template tests do not correctly end output buffering</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10359">PHPBB3-10359</a>] - Fix phpbb_request regression in download/file.php and style.php</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10360">PHPBB3-10360</a>] - search_results.html gone haywire!</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10364">PHPBB3-10364</a>] - ACP Permissions Roles Tabs Broken</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10371">PHPBB3-10371</a>] - $user-&gt;theme['imageset_path'] - doesn't exist anymore</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10374">PHPBB3-10374</a>] - Template cache viewer broken</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10375">PHPBB3-10375</a>] - Template Cache keeps regenerating cache files</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10378">PHPBB3-10378</a>] - Errors in imageset -&gt; theme conversion</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10380">PHPBB3-10380</a>] - Imageset removal: bidi padding change</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10384">PHPBB3-10384</a>] - 1_DAY language variables are not working in templates anymore</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10392">PHPBB3-10392</a>] - Alternate nested block loop syntax broken for auto variables</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10393">PHPBB3-10393</a>] - Syntax error in cached template code</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10409">PHPBB3-10409</a>] - Running database_update.php multiple times breaks the update</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10417">PHPBB3-10417</a>] - phpbb_test_case_helpers::get_test_config() uses array_merge() on undefined $config</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10444">PHPBB3-10444</a>] - Edit reason remains if a post gets edited by a moderator for the second time</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10457">PHPBB3-10457</a>] - Undefined variable $request, when print-viewing PMs</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10458">PHPBB3-10458</a>] - Invalid html when print-viewing a PM</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10459">PHPBB3-10459</a>] - Make &quot;Reply to all&quot;on PMs as a button</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10463">PHPBB3-10463</a>] - Inherit template causes SQL error</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10464">PHPBB3-10464</a>] - Debug error in search settings/search index</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10477">PHPBB3-10477</a>] - Registration, forgot password broken</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10481">PHPBB3-10481</a>] - Test suite does not run on php 5.3</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10495">PHPBB3-10495</a>] - Tests have version checks against php 6.0.0</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10500">PHPBB3-10500</a>] - Miscellaneous issues in the new template engine</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10541">PHPBB3-10541</a>] - Empty &quot;Select form:&quot; dropdown when editing user</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10547">PHPBB3-10547</a>] - Log out instead of acp statistics page at the end of fresh install </li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10560">PHPBB3-10560</a>] - Post count not updated to include unapproved posts (though topic count is) for moderators</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10575">PHPBB3-10575</a>] - UCP Register: Non-static method phpbb_captcha_factory::get_instance() should not be called statically</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10579">PHPBB3-10579</a>] - New license block has v2 duplicated</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10602">PHPBB3-10602</a>] - A bug in mail queue processing</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10618">PHPBB3-10618</a>] - Hardcoded phpBB 3.0 language in installer</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10634">PHPBB3-10634</a>] - cp modules: function loaded() only checks current module type</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10636">PHPBB3-10636</a>] - cache_moderators() generates invalid query</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10637">PHPBB3-10637</a>] - Extension manager: missed code changes in search</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10641">PHPBB3-10641</a>] - MCP still uses old plurality forms of language variables</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10645">PHPBB3-10645</a>] - Invalid CSS for checkboxes and radio buttons in ACP css</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10652">PHPBB3-10652</a>] - Template inheritance doesn't work</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10655">PHPBB3-10655</a>] - Bug in test case: phpbb_template_template_inheritance_test</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10663">PHPBB3-10663</a>] - Extension manager: finder class adds directories that should not match the query</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10667">PHPBB3-10667</a>] - Fix extensions and group positions tests under MySQL 5.5 strict mode</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10671">PHPBB3-10671</a>] - Integrity tests failing</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10672">PHPBB3-10672</a>] - Statistics .. Total posts</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10678">PHPBB3-10678</a>] - Provide Firebird, Oracle, and increased MSSQL support in unit tests</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10685">PHPBB3-10685</a>] - Template inheritance test produces a notice on php 5.4 due to an incompatible override of setup_engine</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10690">PHPBB3-10690</a>] - Undefined language string in MCP</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10703">PHPBB3-10703</a>] - extensions.php script dies miserably when ext directory is missing</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10704">PHPBB3-10704</a>] - Typo in a comment</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10735">PHPBB3-10735</a>] - Incorrect styles search order, locator's inability to use template inheritance for extensions</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10736">PHPBB3-10736</a>] - Composer is making tests fail</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10742">PHPBB3-10742</a>] - Tables in users list have incorrect width</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10752">PHPBB3-10752</a>] - acp_styles errors</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10754">PHPBB3-10754</a>] - $style should be renamed to $phpbb_style</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10756">PHPBB3-10756</a>] - Template classes don't belong in style directory</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10759">PHPBB3-10759</a>] - Database updater doesn't reset default style</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10777">PHPBB3-10777</a>] - Typo in viewtopic.php comment line 1632</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10778">PHPBB3-10778</a>] - Extra space on the link &quot;Close Window&quot; in prosilver/template/posting_smilies.html</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10779">PHPBB3-10779</a>] - &quot;Serve jQuery using Google's CDN&quot; Should be on ACP Load Settings, not Board Features</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10781">PHPBB3-10781</a>] - Quick Mod tools don't work</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10784">PHPBB3-10784</a>] - Do not show ajax overlay unless needed</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10785">PHPBB3-10785</a>] - Illegal use of $_REQUEST in develop/fill.php</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10801">PHPBB3-10801</a>] - Move topic in quickmod tools not functional</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10802">PHPBB3-10802</a>] - Splitting topics in quickmod tools not functional</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10803">PHPBB3-10803</a>] - When ajax requests fail, the failure message should remain visible until the user dismisses it</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10805">PHPBB3-10805</a>] - &quot;Request timed out&quot; ui appears over function ui in ajax</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10807">PHPBB3-10807</a>] - Deleting topics via quickmod provides no feedback</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10808">PHPBB3-10808</a>] - Locking topics via quickmod provides no feedback</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10811">PHPBB3-10811</a>] - AJAX callback &quot;alt_text&quot; insufficiently changes links</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10813">PHPBB3-10813</a>] - Installer does not check that php json extension is present</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10818">PHPBB3-10818</a>] - Global Announcements Update Dialog does not terminate with exit_handler()</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10826">PHPBB3-10826</a>] - 3.1-dev Database Updater keeps running group_legend query</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10837">PHPBB3-10837</a>] - Undefined index in extension tests</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10844">PHPBB3-10844</a>] - Extensions are not located when front-end file has a diffferent phpbb_root_path</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10845">PHPBB3-10845</a>] - Reported post text does not get bbcode-parsed when viewing a post report</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10847">PHPBB3-10847</a>] - Dependent is misspelled a number of times</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10871">PHPBB3-10871</a>] - In &quot;Posts awaiting approval&quot; if there's more than one post it shows no posts</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10875">PHPBB3-10875</a>] - SQL Cache is not used</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10876">PHPBB3-10876</a>] - Xampp crashes on Develop when template has too many ORs in an IF statement</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10885">PHPBB3-10885</a>] - UCP Main Error if no forums exist</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10888">PHPBB3-10888</a>] - cachepath in template class is set externally</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10905">PHPBB3-10905</a>] - Last topic title missing in subsilver</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10906">PHPBB3-10906</a>] - Last post title does not work for new installs of 3.1-dev due to missing change to schema_data.sql</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10912">PHPBB3-10912</a>] - Undefined variable: last_post_subject_truncated</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10915">PHPBB3-10915</a>] - Sort not installed styles list in admin control panel - styles</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10943">PHPBB3-10943</a>] - Search Box should display keywords entered by the user</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10954">PHPBB3-10954</a>] - Mark topics as read AJAX</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10976">PHPBB3-10976</a>] - Running tests using phpunit.xml.all fails</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10982">PHPBB3-10982</a>] - Allow setting dimming control overlay also as data-overlay</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10998">PHPBB3-10998</a>] - No border-radius for forum rules block</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10999">PHPBB3-10999</a>] - Asset version not defined in adm/</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11002">PHPBB3-11002</a>] - Etc/GMT timezones return wrong offset</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11003">PHPBB3-11003</a>] - Ability to show full list of timezones with JavaScript enabled</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11004">PHPBB3-11004</a>] - The timezone suggestion button is not a real button</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11007">PHPBB3-11007</a>] - Timezone selector shows all timezones</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11014">PHPBB3-11014</a>] - Previous/next links are no longer displayed.</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11018">PHPBB3-11018</a>] - Pagination in memberlist</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11023">PHPBB3-11023</a>] - Fix excess tabbing and spacing in functions.php</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11029">PHPBB3-11029</a>] - Cannot break/continue 1 level in includes\cache\service.php:340</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11041">PHPBB3-11041</a>] - global $php_ext instead of global $phpEx</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11043">PHPBB3-11043</a>] - Update template hook name</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11046">PHPBB3-11046</a>] - No border-radius for UCP message colours block</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11047">PHPBB3-11047</a>] - Unclosed variable shows incorrect language key</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11052">PHPBB3-11052</a>] - Search class changes not reflected in installer or convertor</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11065">PHPBB3-11065</a>] - li tag on topic display options at MCP is unclosed</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11067">PHPBB3-11067</a>] - Pagination in ACP is missing CSS code from pagination change</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11077">PHPBB3-11077</a>] - Feed still has fallback code for global announcement with forum_id = 0</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11086">PHPBB3-11086</a>] - Database Updater still relies on cache factory - needs to be updated to use DIC</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11089">PHPBB3-11089</a>] - Database type mysql sets unusable board</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11092">PHPBB3-11092</a>] - phpbb_gen_download_links strict standards errors</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11095">PHPBB3-11095</a>] - Jumpbox should use &quot;get&quot; method</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11099">PHPBB3-11099</a>] - Clicking Banning tab in MCP causes all tabs to collapse down</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11100">PHPBB3-11100</a>] - jabber::can_use_ssl() should not be called statically in includes/acp/acp_jabber.php on line 124</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11101">PHPBB3-11101</a>] - Container processors are executed before globals exist</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11106">PHPBB3-11106</a>] - Undefined index: EDITED_TIME_TOTAL</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11139">PHPBB3-11139</a>] - Colour swatch window with Fatal error</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11140">PHPBB3-11140</a>] - MCP Front errors on reported posts</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11154">PHPBB3-11154</a>] - Unable to upgrade 3.0 QI-installed board to 3.1</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11157">PHPBB3-11157</a>] - Strict spam renders spambot countermeasures page unusable</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11159">PHPBB3-11159</a>] - Coding guidelines: static public</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11166">PHPBB3-11166</a>] - AJAX confirm box is not using custom templates given</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11171">PHPBB3-11171</a>] - Copy bbcode fields, etc. for reported posts</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11176">PHPBB3-11176</a>] - Functional tests do not run</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11177">PHPBB3-11177</a>] - Postgres search when query has only negation</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11187">PHPBB3-11187</a>] - Functional tests broken by new config class</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11188">PHPBB3-11188</a>] - postgres search result count does not get the total count</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11190">PHPBB3-11190</a>] - Functional tests do not clear the cache between each test</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11194">PHPBB3-11194</a>] - PHP Notice: Undefined index &quot;tag&quot; </li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11198">PHPBB3-11198</a>] - AJAX move up/down links not replaced correctly</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11199">PHPBB3-11199</a>] - Cache purge should remove dumped container</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11200">PHPBB3-11200</a>] - Container construction fails with non-MySQLi drivers</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11204">PHPBB3-11204</a>] - Wrong indentation in functional test case base class</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11205">PHPBB3-11205</a>] - Merge conflict in readme.html</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11206">PHPBB3-11206</a>] - Avatars are broken, includes non-existent files</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11208">PHPBB3-11208</a>] - Functional tests are broken</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11209">PHPBB3-11209</a>] - Always clone Ajax disable images to avoid problems if they are used multiple times on the same page</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11211">PHPBB3-11211</a>] - Call to undefined function phpbb_real_path() in /phpBB/includes/di/extension/ext.php on line 52</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11212">PHPBB3-11212</a>] - Catch non-existent globals if error occurs during container construction</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11213">PHPBB3-11213</a>] - Missing global in install_update.php</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11227">PHPBB3-11227</a>] - @return void -&gt; @return null</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11236">PHPBB3-11236</a>] - Prune users requires group selection if any groups are defined</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11237">PHPBB3-11237</a>] - php spam when pruning users</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11247">PHPBB3-11247</a>] - php spam in flock class</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11248">PHPBB3-11248</a>] - CRLF line endings</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11253">PHPBB3-11253</a>] - Signature module acl is not going to be added to 3.1 boards</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11256">PHPBB3-11256</a>] - Unused service controller.route_collection</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11257">PHPBB3-11257</a>] - Using Service Collection requires set_name() method to exist</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11263">PHPBB3-11263</a>] - PHP Notice: in file functions_messenger.php on line 213: Undefined variable: extension_manager</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11273">PHPBB3-11273</a>] - Missing space after Sphinx &quot;Indexer memory limit&quot; input box </li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11277">PHPBB3-11277</a>] - User DST column is not removed on update, and therefor user_timezone is updated everytime the update file is run</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11279">PHPBB3-11279</a>] - &quot;Something went wrong when processing your request.&quot; is not acceptable language</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11291">PHPBB3-11291</a>] - &quot;Could not open input file: ../composer.phar&quot; error during phing's create-package</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11298">PHPBB3-11298</a>] - ACP_EXTENSIONS_MANAGEMENT missing string</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11302">PHPBB3-11302</a>] - No timezone is selected by default in registration form</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11303">PHPBB3-11303</a>] - Timezone selection is not preserved in registration form</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11305">PHPBB3-11305</a>] - Installer is broken on develop</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11309">PHPBB3-11309</a>] - phpbb_extension_interface::disable_step correct docblock</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11310">PHPBB3-11310</a>] - CSRF in style installation in acp</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11311">PHPBB3-11311</a>] - Include javascript core.js file in subsilver2 overall_footer.html</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11313">PHPBB3-11313</a>] - Typo in alt_text callback breaks replacement of text</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11320">PHPBB3-11320</a>] - Database test cases fail if functions file is not included and config file exists</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11321">PHPBB3-11321</a>] - Recreate schema files with develop/create_schema_files.php</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11323">PHPBB3-11323</a>] - Not possible to define template variable with other variables</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11329">PHPBB3-11329</a>] - Color values should be in colours.css, not buttons.css</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11334">PHPBB3-11334</a>] - Controller helper url() method still generates URLs like app.php/route/to/page instead of app.php?controller=route/to/page</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11335">PHPBB3-11335</a>] - Hook finder fails to load hooks</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11342">PHPBB3-11342</a>] - Marking subforums as read does not change the unread icons of active topics</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11344">PHPBB3-11344</a>] - ACP_STYLE_COMPONENTS</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11345">PHPBB3-11345</a>] - Font size on new buttons is too thin</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11350">PHPBB3-11350</a>] - $db should not be passed by reference to db_tools</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11362">PHPBB3-11362</a>] - Resource locator does not find admin template files from extensions</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11363">PHPBB3-11363</a>] - Migrations module tool does not load info files from extensions</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11367">PHPBB3-11367</a>] - Migrator throws error if migrations table does not exist</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11369">PHPBB3-11369</a>] - Reverting migration throws error (attempt to unserialize string)</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11370">PHPBB3-11370</a>] - Effectively installed migrations not inserted into migrations table</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11372">PHPBB3-11372</a>] - Migrator should only check if effectively installed if the migration is not installed at all</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11381">PHPBB3-11381</a>] - Finder cannot find items for non-enabled extensions (required during installation)</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11383">PHPBB3-11383</a>] - Uninstalling an extension that adds a module causes an error upon purge</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11385">PHPBB3-11385</a>] - get_module_infos from migrator does not return module info</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11386">PHPBB3-11386</a>] - Migrator can include files multiple times</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11387">PHPBB3-11387</a>] - Module add tool logs module as added even if it fails due to error (migrations)</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11388">PHPBB3-11388</a>] - Extension CSS files are not being auto-loaded</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11394">PHPBB3-11394</a>] - Migration Tools are too strict</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11395">PHPBB3-11395</a>] - acp_modules::get_module_infos can include files multiple times</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11396">PHPBB3-11396</a>] - insert_migration also updates migration (should rename function)</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11398">PHPBB3-11398</a>] - Migrations permission tool's method permission_set causes fatal error</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11400">PHPBB3-11400</a>] - Notification system assumes email is always available</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11402">PHPBB3-11402</a>] - Undefined offset 0 post/topic_in_queue (notifications)</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11403">PHPBB3-11403</a>] - Multiinsert for notifications should use batches</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11404">PHPBB3-11404</a>] - Can not access ACP &quot;manage group&quot; page while creating new groups</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11405">PHPBB3-11405</a>] - Users that are subscribed to a forum, don't receive notifications for new replies</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11407">PHPBB3-11407</a>] - UI notifications have wrong &lt;dfn&gt; info next to checkbox</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11408">PHPBB3-11408</a>] - Undefined index jabber (should be user_jabber)</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11411">PHPBB3-11411</a>] - Broken primary key on phpbb_notification_types table</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11413">PHPBB3-11413</a>] - phpbb_notification_types table should have an integer primary key</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11415">PHPBB3-11415</a>] - Accessing phpbb_migrations table from index page (or other pages)</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11416">PHPBB3-11416</a>] - Primary key on phpbb_notifications table too small</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11417">PHPBB3-11417</a>] - Notification Options page in User Control Panel has &quot;Mark read&quot; as submit button.</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11420">PHPBB3-11420</a>] - Notification methods are not (correctly) imported</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11421">PHPBB3-11421</a>] - Submit button missing from UCP notifications module</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11422">PHPBB3-11422</a>] - Assets should be incremented on database update</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11423">PHPBB3-11423</a>] - Email has HTML from username</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11433">PHPBB3-11433</a>] - Loading alert message is shown beneath overlay</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11435">PHPBB3-11435</a>] - Extension template files curly braces bug</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11437">PHPBB3-11437</a>] - Sphinx debug assert failed when no search results are found</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11438">PHPBB3-11438</a>] - Sphinx default config does not work properly</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11439">PHPBB3-11439</a>] - Notification tests are not run via phpunit.xml.dist</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11440">PHPBB3-11440</a>] - Mixed type (string vs integer) in SQL query against phpbb_users</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11442">PHPBB3-11442</a>] - AJAX in the ACP Does not work wherever Confirm Box modals are used</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11443">PHPBB3-11443</a>] - Two migration tests are not run via phpunit.xml.dist </li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11448">PHPBB3-11448</a>] - phpbb_notification_manager::mark_notifications_read takes $user_id as a parameter but isn't using it</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11450">PHPBB3-11450</a>] - phpbb_extension_metadata_manager has wrong docs and too many arguments</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11451">PHPBB3-11451</a>] - class phpbb_notification_method_jabber extends phpbb_notification_method_email</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11452">PHPBB3-11452</a>] - phpbb_notification_method_email::is_available() should return false when user doesn't have an email address</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11454">PHPBB3-11454</a>] - Jabber notifications are not working at all</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11455">PHPBB3-11455</a>] - Sort phpBB/config/tables.yml in alphabetic order</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11457">PHPBB3-11457</a>] - class phpbb_notification_test should not require/use the global set_var() function</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11460">PHPBB3-11460</a>] - New installs have wrong data in phpbb_user_notifications table.</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11464">PHPBB3-11464</a>] - Config table load_cpf_pm is missing on new install</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11466">PHPBB3-11466</a>] - phpunit configs excludes non-existant files</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11471">PHPBB3-11471</a>] - Some email templates contain unrelated text</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11474">PHPBB3-11474</a>] - &quot;Post in queue&quot; notification send to too many moderators</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11478">PHPBB3-11478</a>] - Daylight Savingtime changes old posts in time, too.</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11479">PHPBB3-11479</a>] - Can not access install/index.php?mode=update</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11485">PHPBB3-11485</a>] - migration doesn't add necessary columns to phpbb_styles table when updating schemas.</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11488">PHPBB3-11488</a>] - Notification email error</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11489">PHPBB3-11489</a>] - Change forum list layout to work at any resolution</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11491">PHPBB3-11491</a>] - Functional test for extensions has wrong class name and is in the wrong directory</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11492">PHPBB3-11492</a>] - memberlist user_ids array uninitalized can lead to error</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11494">PHPBB3-11494</a>] - Fix memberlist leaders functional tests</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11501">PHPBB3-11501</a>] - Fix &quot;This test did not perform any assertions&quot; message on some tests</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11503">PHPBB3-11503</a>] - Implementation of DB drivers vary too much</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11516">PHPBB3-11516</a>] - .live() deprecated in new version of jquery</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11535">PHPBB3-11535</a>] - ACP und UCP avatar groups settings do not display an error upon submitting incorrect data</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11549">PHPBB3-11549</a>] - Resource locator does not find admin template files from extensions</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11550">PHPBB3-11550</a>] - Functional extension controller test should use $helpers to copy and remove files</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11551">PHPBB3-11551</a>] - ACP System tab errors: [phpBB Debug] - PHP Notice: in file [ROOT] -/includes/acp/acp_update.php on line 49: Undefined offset: 1</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11553">PHPBB3-11553</a>] - Links list errors</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11554">PHPBB3-11554</a>] - forum_fn.js should be moved to footer</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11555">PHPBB3-11555</a>] - Pagination page selection JS is broken</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11556">PHPBB3-11556</a>] - Remove non-jquery fallback code from forum_fn.js</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11560">PHPBB3-11560</a>] - Missing T_JQUERY_LINK template variable in installer</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11561">PHPBB3-11561</a>] - Notification functional tests fail using phpunit.xml.all</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11562">PHPBB3-11562</a>] - forum_fn.js cleanup</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11563">PHPBB3-11563</a>] - Move subPanels() code from html templates to forum_fn.js</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11564">PHPBB3-11564</a>] - Notifications list errors</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11567">PHPBB3-11567</a>] - Fatal error at database update</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11569">PHPBB3-11569</a>] - Database update fails at continuing on some environments</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11570">PHPBB3-11570</a>] - No way to get back to update routine when in database updater</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11573">PHPBB3-11573</a>] - Test Suite does not work with MySQL STRICT_TRANS_TABLES (MySQL 5.6)</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11574">PHPBB3-11574</a>] - Unable to &quot;auto update&quot; from 3.0 to 3.1</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11585">PHPBB3-11585</a>] - Strict Standars error when editing the role </li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11586">PHPBB3-11586</a>] - Fix/cleanup some of upload_attachment()'s code</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11587">PHPBB3-11587</a>] - Group gets removed from legend when editing one in UCP</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11593">PHPBB3-11593</a>] - filter-&gt;compile_var_tags uses undefined variable</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11594">PHPBB3-11594</a>] - Template filter not aware of extension context</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11599">PHPBB3-11599</a>] - Tree tests are very slow</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11602">PHPBB3-11602</a>] - Do not call avatar_manager's localize_errors() if avatars are disabled</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11605">PHPBB3-11605</a>] - Order of files and directories given to phpbb_test_case_helpers-&gt;remove_files() matters.</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11622">PHPBB3-11622</a>] - Template events are loaded incorrectly</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11647">PHPBB3-11647</a>] - URLs are incorrectly handled by INCLUDEJS</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11660">PHPBB3-11660</a>] - Bootstrap container from config.php bugs</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11664">PHPBB3-11664</a>] - Creating php.html file in root path in tests</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11665">PHPBB3-11665</a>] - Can't change file names already sent to set_filenames</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11675">PHPBB3-11675</a>] - Uncaught exception 'Twig_Error_Syntax' -Permissions User roles- </li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11687">PHPBB3-11687</a>] - assets_version is missing in phpbb_config</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11688">PHPBB3-11688</a>] - Cache purge does not purge the twig directory</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11691">PHPBB3-11691</a>] - Soft delete migration conversion should be staggered</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11692">PHPBB3-11692</a>] - Don't update search_type in dev migration if already appended with phpbb_search_</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11694">PHPBB3-11694</a>] - Twig Error on ACP Login page</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11695">PHPBB3-11695</a>] - Cannot edit first post in a topic more than once without manually changing &quot;Options Per User&quot; to 1 on second edit.</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11696">PHPBB3-11696</a>] - phpbb_db_tools does not autoload</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11697">PHPBB3-11697</a>] - fulltext_mysql.php - author_search() uses incorrect $m_approve_fid_ary parameter</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11701">PHPBB3-11701</a>] - TWIG breaks template events for events inside of looped template code</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11702">PHPBB3-11702</a>] - Forumlink gives general error</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11706">PHPBB3-11706</a>] - getimagesize() should be called with @ to prevent PHP warning in remote avatar</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11707">PHPBB3-11707</a>] - Twig DEFINE not working as expected</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11708">PHPBB3-11708</a>] - Invalid bulletin point in notifications</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11712">PHPBB3-11712</a>] - Typo in editor.js</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11713">PHPBB3-11713</a>] - Module gets removed by ajax even if removal was not successful</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11717">PHPBB3-11717</a>] - View unanswered posts = General error</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11718">PHPBB3-11718</a>] - Twig lexer only correcting statements in IF, not ELSEIF</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11723">PHPBB3-11723</a>] - Can not agree to Terms of Service if more than one language is installed</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11725">PHPBB3-11725</a>] - No Avatar image -upload avatar-</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11727">PHPBB3-11727</a>] - INCLUDECSS and INCLUDEJS incorrectly default to /template/ folder</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11728">PHPBB3-11728</a>] - Fix last occurance of topic_approved index</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11729">PHPBB3-11729</a>] - memberlist.php is empty white page</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11731">PHPBB3-11731</a>] - Make calls for captcha garbage collections non-static</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11733">PHPBB3-11733</a>] - Illegal offset type Warning in [ROOT] -/includes/auth/auth.php via [ROOT] -/feed.php</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11734">PHPBB3-11734</a>] - Missing permession in language file</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11735">PHPBB3-11735</a>] - Missing checkbox in User Control Panel / Manage notifications</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11739">PHPBB3-11739</a>] - Wrong name for UCP Module &quot;Edit &quot;Remember Me&quot; login keys&quot;</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11741">PHPBB3-11741</a>] - Brackets exist even without any text</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11751">PHPBB3-11751</a>] - MCP Softdelete Modules missing when updating board</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11754">PHPBB3-11754</a>] - Remove leftovers of style switcher</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11755">PHPBB3-11755</a>] - MySQL Upgrader out of date for 3.1</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11757">PHPBB3-11757</a>] - Typo in signature_module_auth migration</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11759">PHPBB3-11759</a>] - Migrations update to the wrong 3.0.x version numbers.</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11761">PHPBB3-11761</a>] - Example.org no longer serves blank responses, failing functional tests</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11763">PHPBB3-11763</a>] - Debug and SQL Error when reporting a PM</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11767">PHPBB3-11767</a>] - Unable to update DB from 3.0.X to 3.1.X because of post_visibility</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11770">PHPBB3-11770</a>] - Invalid class for pm list in outbox/sentbox</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11774">PHPBB3-11774</a>] - PHP errors on viewing reported post details</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11777">PHPBB3-11777</a>] - Extension template events are not loaded from subdirectories</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11779">PHPBB3-11779</a>] - Invalid class for unapproved posts in mcp index</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11780">PHPBB3-11780</a>] - Remove unused images from prosilver</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11781">PHPBB3-11781</a>] - update_post_information() is not defined in phpbb_content_visibility-&gt;set_post_visibility</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11782">PHPBB3-11782</a>] - Notices inside posts look messy</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11791">PHPBB3-11791</a>] - Template events are not loaded in ACP</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11792">PHPBB3-11792</a>] - core.user_setup event doesn't support loading language files from extensions</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11796">PHPBB3-11796</a>] - Duplicate code for pagination</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11800">PHPBB3-11800</a>] - Incorrect inclusion of scripts in popup window</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11804">PHPBB3-11804</a>] - &lt;/li&gt; tag at overall_header.html (prosilver) which was not open</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11805">PHPBB3-11805</a>] - pagination does not support controller_helper urls</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11809">PHPBB3-11809</a>] - core.js should be loaded directly after jQuery and after every other JS file</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11811">PHPBB3-11811</a>] - Chrome 30 adds outline to focused elements</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11812">PHPBB3-11812</a>] - No longer able to define empty template variable using DEFINE</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11816">PHPBB3-11816</a>] - Twig regression: parentheses in IF statements stop DEFINE variables and loop lengths from working</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11822">PHPBB3-11822</a>] - Template include asset doesn't follow namespace lookup order</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11824">PHPBB3-11824</a>] - Controller URLs do not work anymore</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11825">PHPBB3-11825</a>] - phpBB/phpbb/ should only contain classes</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11828">PHPBB3-11828</a>] - Twig DEFINE is causing errors</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11832">PHPBB3-11832</a>] - URLs in tests aren't shortened, triggering errors in Composer files</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11833">PHPBB3-11833</a>] - Twig error while viewing user notes</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11835">PHPBB3-11835</a>] - phpbb_db_migration_data_310_auth_provider_oauth: A required module does not exist: UCP_AUTH_LINK</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11836">PHPBB3-11836</a>] - Manage external account associations error</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11837">PHPBB3-11837</a>] - UCP_AUTH_LINK_NOT_SUPPORTED (untranslated)</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11843">PHPBB3-11843</a>] - Regression: using underscores in template DEFINE variables yields unexpected behavior</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11846">PHPBB3-11846</a>] - Empty paragraph elements in jumpbox.html</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11850">PHPBB3-11850</a>] - $user-&gt;page contains bogus data on controller (app.php) pages</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11852">PHPBB3-11852</a>] - filesystem class must not depend on a web request</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11862">PHPBB3-11862</a>] - Events core.delete_user_before and core.delete_user_after compact the wrong vars</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11865">PHPBB3-11865</a>] - includes/bbcode.php is missing namespace change</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11866">PHPBB3-11866</a>] - &quot;You have specified an invalid dbms driver&quot; Error with config sample</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11867">PHPBB3-11867</a>] - Schema files are not created by create_schema_files.php</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11868">PHPBB3-11868</a>] - Class 'phpbb_request_interface' not found</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11871">PHPBB3-11871</a>] - Extension modules are not working with namespaces anymore</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11874">PHPBB3-11874</a>] - RSS Feed -Bug Url-</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11878">PHPBB3-11878</a>] - Missing leading \ in dependencies in soft_delete_mcp_modules</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11882">PHPBB3-11882</a>] - Incorrect dependency in signature module auth migration</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11888">PHPBB3-11888</a>] - On New installation the default search backend is not shown correctly.</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11890">PHPBB3-11890</a>] - Language key used when soft-deleting in MCP.</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11892">PHPBB3-11892</a>] - Undefined variable: to_forum_id after cancelling merge topic/move posts</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11893">PHPBB3-11893</a>] - Font size in &quot;Edit 'Remember Me' login keys&quot; is large</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11895">PHPBB3-11895</a>] - Forum feed stopped working</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11898">PHPBB3-11898</a>] - Unable to login to ACP on AREA51</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11901">PHPBB3-11901</a>] - Undefined offset: 3 in file [ROOT] -/includes/functions_content.php on line 776</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11905">PHPBB3-11905</a>] - Alpha 1 Migration</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11906">PHPBB3-11906</a>] - Missing database entries &quot;read_notification&quot;</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11908">PHPBB3-11908</a>] - class phpbb_auth_provider_oauth_service_exception not using namespaces</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11918">PHPBB3-11918</a>] - Can not update from 3.0.x to 3.1.x with MSSQL</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11919">PHPBB3-11919</a>] - Improper argument order for sql_fetchfield() in notification manager</li>
+</ul>
+<h4>Improvement</h4>
+<ul>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-7598">PHPBB3-7598</a>] - Reminding inactive users</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-7938">PHPBB3-7938</a>] - Display information about unread and new PMs in the header.</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-8065">PHPBB3-8065</a>] - Add an option to lock topics while moving them.</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-8270">PHPBB3-8270</a>] - Automatically loaded language-files for mods</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-8796">PHPBB3-8796</a>] - Mark forum(s) read (or mark topics read) marks some topics you haven't read</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9346">PHPBB3-9346</a>] - Use different message template for jabber notification</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9532">PHPBB3-9532</a>] - Optimized Page Titles</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9549">PHPBB3-9549</a>] - Enhance teampage functionality</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9596">PHPBB3-9596</a>] - Modular cron and allowing cron tasks to be run from system cron</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9608">PHPBB3-9608</a>] - Cleanse object references from codebase for 3.1</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9649">PHPBB3-9649</a>] - Moderator queue does not display icon if the new post is made in old thread</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9668">PHPBB3-9668</a>] - Automatic UTF-8 normalization</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9669">PHPBB3-9669</a>] - Native UTF-8 normalization</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9684">PHPBB3-9684</a>] - Link global announcements to forums</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9693">PHPBB3-9693</a>] - generate_smilies clean up </li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9716">PHPBB3-9716</a>] - Handle user input through a request class providing a more complete mechanism than request_var</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9741">PHPBB3-9741</a>] - Do not store any themes or templates in the database</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9746">PHPBB3-9746</a>] - Normalise internet protocol version 6 addresses</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9792">PHPBB3-9792</a>] - Move function definitions out of download/file.php</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9823">PHPBB3-9823</a>] - Move functions definitions out of adm/index.php</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9979">PHPBB3-9979</a>] - Autoloading for test suite</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10001">PHPBB3-10001</a>] - Class Based Forum/Topic Image</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10076">PHPBB3-10076</a>] - STARTTLS for emails</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10143">PHPBB3-10143</a>] - Delete-write-read test for config classes</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10148">PHPBB3-10148</a>] - Turn TEMPLATE_BITFIELD into an instance variable in acp_styles.php</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10155">PHPBB3-10155</a>] - Inclusion of jQuery</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10161">PHPBB3-10161</a>] - Use one of &quot;email&quot; or &quot;e-mail&quot;</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10172">PHPBB3-10172</a>] - Display empty birthday box in prosilver when birthdays are enabled but there are none today</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10258">PHPBB3-10258</a>] - Use HTML5 doctype</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10271">PHPBB3-10271</a>] - confirm_box operations should use AJAX</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10272">PHPBB3-10272</a>] - Simple operations should use AJAX</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10273">PHPBB3-10273</a>] - Accepting / denying posts should use AJAX</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10281">PHPBB3-10281</a>] - Reordering forums in the ACP should use AJAX</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10312">PHPBB3-10312</a>] - Un-check &quot;Leave shadow topic in place&quot; checkbox when moving topics</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10325">PHPBB3-10325</a>] - Ability to disable the &quot;I forgot my password&quot; feature</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10336">PHPBB3-10336</a>] - Removing imagesets in 3.1</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10344">PHPBB3-10344</a>] - Add attachment icons to list of reports and queue</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10362">PHPBB3-10362</a>] - HTML5 Fix - &quot;name&quot; attribute is deprecated in anchors. Use &quot;id&quot; attribute instead.</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10383">PHPBB3-10383</a>] - Polls should use AJAX</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10387">PHPBB3-10387</a>] - generate_pagination() should export the current page number as a template variable</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10390">PHPBB3-10390</a>] - Add an ACP option to use jQuery via local copy or remote CDN</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10410">PHPBB3-10410</a>] - Add option to display users in their first teampage group</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10412">PHPBB3-10412</a>] - Use memory_get_peak_usage for debug output instead of memory_get_usage</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10431">PHPBB3-10431</a>] - Remove language from the button-graphics and use text strings instead</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10438">PHPBB3-10438</a>] - Alligning the Smileys on the same line as the text.</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10484">PHPBB3-10484</a>] - Use variables for sql_build_query() calls, so mods/extensions can extend the arrays</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10510">PHPBB3-10510</a>] - Quick-mod markup should be in the template</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10524">PHPBB3-10524</a>] - Wrong version code name in Ascraeus coding guidelines document.</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10535">PHPBB3-10535</a>] - Remove &quot;Confirm Email Address&quot; field from registration form</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10557">PHPBB3-10557</a>] - Missing IN_PHPBB check in phpBB/includes/functions_acp.php</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10601">PHPBB3-10601</a>] - Move inbox to top module in UCP Private Messages Tab</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10614">PHPBB3-10614</a>] - Script to manage extensions</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10617">PHPBB3-10617</a>] - prosilver clean up: adding proper css reset</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10619">PHPBB3-10619</a>] - prosilver clean up: removing duplicate colors</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10632">PHPBB3-10632</a>] - Merging style components</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10640">PHPBB3-10640</a>] - Bigger Topic Title Length</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10650">PHPBB3-10650</a>] - Last Topic Title on Forum list</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10659">PHPBB3-10659</a>] - Allow all administrators to purge cache</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10665">PHPBB3-10665</a>] - INCLUDEJS template tag</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10679">PHPBB3-10679</a>] - Add new permission for changing profile field information</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10705">PHPBB3-10705</a>] - Replace WARNINGS_ZERO_TOTAL with NO_WARNINGS for consistency</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10714">PHPBB3-10714</a>] - Create a class for add_log() and unit tests</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10726">PHPBB3-10726</a>] - Preview from Quick Reply</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10727">PHPBB3-10727</a>] - Don't hide quickreply with javascript</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10733">PHPBB3-10733</a>] - Adding file locator function to style class</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10734">PHPBB3-10734</a>] - CSS3 rounded corners</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10741">PHPBB3-10741</a>] - Automatically resize textarea</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10743">PHPBB3-10743</a>] - Change theme to style in php code</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10762">PHPBB3-10762</a>] - Separate style and phpBB version numbers in style.cfg</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10771">PHPBB3-10771</a>] - Using Remember Me instead of autologin or persistent keys in the UI.</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10780">PHPBB3-10780</a>] - Move colons from template files to language files</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10783">PHPBB3-10783</a>] - assets_version config var appended to assets (css/js) URLs to prevent caching</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10786">PHPBB3-10786</a>] - Render search options by default on memberlist.php</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10799">PHPBB3-10799</a>] - includejs should not put phpbb root path in generated template code</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10800">PHPBB3-10800</a>] - includejs test confusingly includes an html file</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10864">PHPBB3-10864</a>] - Allow extensions to be accessed via controller with shorter access name than &quot;vendor/extname&quot;</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10933">PHPBB3-10933</a>] - Make style code more understandable</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10936">PHPBB3-10936</a>] - MySQL fulltext search improvement - removing check for PCRE UTF support</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10938">PHPBB3-10938</a>] - Display subforum listing on forumlist via template loop instead of PHP implode()</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10947">PHPBB3-10947</a>] - Quickmod tools have stopped autosubmitting</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10955">PHPBB3-10955</a>] - ajaxify should take options as the only argument</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10966">PHPBB3-10966</a>] - Remove code duplication from mysql* and mssql* dbal</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10968">PHPBB3-10968</a>] - Render pagination fully within the template</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10970">PHPBB3-10970</a>] - Allow INCLUDE template macros to accept paths of the form {FOO}/a/{BAR}/c</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10972">PHPBB3-10972</a>] - Add a new method to phpbb_functional_test_case to allow a new user to be created</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10973">PHPBB3-10973</a>] - Allow mocks to be autoloaded in tests</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10975">PHPBB3-10975</a>] - Memberlist functional tests</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10990">PHPBB3-10990</a>] - $user-&gt;lang['COMMA_SEPARATOR'] - is not uniformly used</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11001">PHPBB3-11001</a>] - html5 Placeholder for search box.</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11008">PHPBB3-11008</a>] - Get rid of eval in javascript</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11010">PHPBB3-11010</a>] - HTML5 input types for form fields</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11011">PHPBB3-11011</a>] - Using dependency injection for global variables in all search backends.</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11012">PHPBB3-11012</a>] - Member variable phpEx vs php_ext naming inconstistency</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11013">PHPBB3-11013</a>] - Allow arrays to be assigned and retrieved in templates</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11015">PHPBB3-11015</a>] - Make DBAL classes autoloadable</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11021">PHPBB3-11021</a>] - Link back to main site config setting</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11025">PHPBB3-11025</a>] - Make Last topic title in forum list Bold</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11032">PHPBB3-11032</a>] - Better error reporting for sphinx</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11037">PHPBB3-11037</a>] - Cache drivers require globals</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11044">PHPBB3-11044</a>] - Compress class should keep track of files added and deal with conflicts</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11048">PHPBB3-11048</a>] - Use access specifiers in search backends</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11050">PHPBB3-11050</a>] - Add docblocks missing in properties and methods in all search backends.</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11051">PHPBB3-11051</a>] - Add retrieval functions for all public properties in search backends</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11068">PHPBB3-11068</a>] - Hiding foes posts should use JS to display them, rather then reloading the whole page</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11070">PHPBB3-11070</a>] - Redundant background-position property in Prosilver button CSS?</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11082">PHPBB3-11082</a>] - Redis cache driver should not have executable permission</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11083">PHPBB3-11083</a>] - Abstract cache drivers should use abstract keyword</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11088">PHPBB3-11088</a>] - Combine Style and Extension Management into one Customisations tab in the ACP</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11116">PHPBB3-11116</a>] - Adjust Display of Warning/Error Messages in Extensions Controller</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11129">PHPBB3-11129</a>] - Misleading subscription state messages</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11152">PHPBB3-11152</a>] - Create cached, compiled container class rather than compiling it on every page load</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11156">PHPBB3-11156</a>] - Delete &quot;Misc&quot; tab of forum based permissions + move items</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11174">PHPBB3-11174</a>] - Unit tests for search backends</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11181">PHPBB3-11181</a>] - Bump PHP requirement to 5.3.3</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11183">PHPBB3-11183</a>] - Remove $load_extensions and weird dl() calls</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11189">PHPBB3-11189</a>] - Merge DEBUG and DEBUG_EXTRA</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11193">PHPBB3-11193</a>] - Generalize phpbb_di_pass_collection_pass to handle all collections using service tags</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11197">PHPBB3-11197</a>] - Prefix the css classes for the small arrow with &quot;arrow&quot;.</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11202">PHPBB3-11202</a>] - Add response status checks to functional tests</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11215">PHPBB3-11215</a>] - Separate root path for filesystem and urls/assets</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11217">PHPBB3-11217</a>] - Prefix for template values to give back value URL encoded</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11238">PHPBB3-11238</a>] - Specify goutte version</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11250">PHPBB3-11250</a>] - Remake the unit tests for the BBCode parser.</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11259">PHPBB3-11259</a>] - Make $phpbb_admin_path available everywhere</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11268">PHPBB3-11268</a>] - Delete phpbb_db_driver_mysql4 case</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11275">PHPBB3-11275</a>] - editor.js::colorPalette() breaks page with document.write &gt; add proper target</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11283">PHPBB3-11283</a>] - Extensions as symlinks</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11294">PHPBB3-11294</a>] - Update extension list in running tests doc</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11306">PHPBB3-11306</a>] - Container should be created by a phpbb_create_default_container() function</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11314">PHPBB3-11314</a>] - Improve readability and code cleanup in new JavaScript files</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11328">PHPBB3-11328</a>] - New language variables for buttons</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11373">PHPBB3-11373</a>] - Notifications - Purge old with cron</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11390">PHPBB3-11390</a>] - Remove pagination from ucp_notifications.html when list is empty.</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11393">PHPBB3-11393</a>] - Give more information on database_updater about what exactly happened</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11409">PHPBB3-11409</a>] - No feedback provided when updating group position settings in ACP</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11458">PHPBB3-11458</a>] - Automatically add extension permission language files</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11461">PHPBB3-11461</a>] - [Template Event] - viewtopic_body_footer</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11463">PHPBB3-11463</a>] - Add topic title attribute in search results</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11477">PHPBB3-11477</a>] - Allow customisation of &quot;Board index&quot;</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11482">PHPBB3-11482</a>] - Extend syntax for DEFINE tag</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11495">PHPBB3-11495</a>] - Add nested sets implementation to phpBB core</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11519">PHPBB3-11519</a>] - Rename test event template file</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11533">PHPBB3-11533</a>] - Notification settings page is using topiclist class incorrectly</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11557">PHPBB3-11557</a>] - Allow to use tab when typing code and keep indentation</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11558">PHPBB3-11558</a>] - Notifications link in header should not include [ and ] -</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11577">PHPBB3-11577</a>] - Topiclist/Forumlist Needs tweaking after PR 1331</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11582">PHPBB3-11582</a>] - Split permission logic from translations</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11600">PHPBB3-11600</a>] - Increase code test coverage of avatar manager</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11606">PHPBB3-11606</a>] - make_clickable() in includes/functions_content.php uses deprecated preg_replace() /e modifier (PREG_REPLACE_EVAL)</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11615">PHPBB3-11615</a>] - Partial refactoring of session tests</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11620">PHPBB3-11620</a>] - Improve session test coverage</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11621">PHPBB3-11621</a>] - Improve MySQL fulltext search indexes</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11651">PHPBB3-11651</a>] - Bootstrap container from config.php</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11667">PHPBB3-11667</a>] - phpbb_template_twig_node_includeasset should be abstract</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11669">PHPBB3-11669</a>] - Fix PHP bug #55124 (/./ in recursive mkdirs)</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11684">PHPBB3-11684</a>] - No utility to time-wasting user login confirmation message/screen</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11685">PHPBB3-11685</a>] - No utility to time-wasting user logout confirmation message/screen </li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11700">PHPBB3-11700</a>] - Use namespaces rather than prefixes for class names</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11703">PHPBB3-11703</a>] - Make &quot;Serve jQuery using Google’s CDN&quot; generic</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11724">PHPBB3-11724</a>] - Support &quot;ELSE IF&quot; and &quot;ELSEIF&quot; in the same way</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11744">PHPBB3-11744</a>] - Group join request notification</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11745">PHPBB3-11745</a>] - Group join approved notification</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11747">PHPBB3-11747</a>] - UCP Prefs Core and Template Events</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11749">PHPBB3-11749</a>] - PHP and Template Event Requests for Topic Preview Extension</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11784">PHPBB3-11784</a>] - Remove naming redundancy for event listeners</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11786">PHPBB3-11786</a>] - Fix various defects in PHPDoc in-code documentation</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11795">PHPBB3-11795</a>] - Move all JavaScript from HTML code to external files</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11813">PHPBB3-11813</a>] - Mock authentication provider should implement base provider class</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11831">PHPBB3-11831</a>] - Update fabpot/goutte to 1.0.*</li>
+</ul>
+<h4>New Feature</h4>
+<ul>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9498">PHPBB3-9498</a>] - External Avatar sources: Gravatar</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9550">PHPBB3-9550</a>] - Introduce new Event System</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9558">PHPBB3-9558</a>] - Use PHP timezone handling abilities</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9627">PHPBB3-9627</a>] - Resume support for attachments / HTTP range support</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9647">PHPBB3-9647</a>] - Ability to delete auto login keys from UCP</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9657">PHPBB3-9657</a>] - Soft Delete Posts and Topics </li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9721">PHPBB3-9721</a>] - Attachments management</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9726">PHPBB3-9726</a>] - Improved template engine</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9730">PHPBB3-9730</a>] - PostgreSQL Fulltext Search</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9737">PHPBB3-9737</a>] - Migrations</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9790">PHPBB3-9790</a>] - Support for X-Accel-Redirect and X-Sendfile headers for attachment downloads</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10018">PHPBB3-10018</a>] - Refactor Avatars to support custom modules</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10270">PHPBB3-10270</a>] - JavaScript - confirm / alert / input popups</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10323">PHPBB3-10323</a>] - Extensions</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10328">PHPBB3-10328</a>] - There should be a way to send JSON</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10345">PHPBB3-10345</a>] - Support for arbitrary number of plural forms in language packs</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10411">PHPBB3-10411</a>] - Create grouping capability for custom ordered team page</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10586">PHPBB3-10586</a>] - Front-facing file in Extensions</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10600">PHPBB3-10600</a>] - When creating a report for a post, copy the post itself</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10631">PHPBB3-10631</a>] - Extensions Admin</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10739">PHPBB3-10739</a>] - Dependency Injection Container</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10929">PHPBB3-10929</a>] - Improves the attachment uploader to use HTML5 features</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10931">PHPBB3-10931</a>] - Add a wrapper class for ini_get()</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10942">PHPBB3-10942</a>] - Add sql_case() and sql_concatenate() to dbal</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10946">PHPBB3-10946</a>] - Sphinx Search Backend integration</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11042">PHPBB3-11042</a>] - Feature to download all attachments in a post and topic.</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11103">PHPBB3-11103</a>] - Notifications system</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11175">PHPBB3-11175</a>] - Add microdata to breadcrumbs</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11469">PHPBB3-11469</a>] - Add SQL insert buffer class</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11598">PHPBB3-11598</a>] - Replace template engine with Twig</li>
+</ul>
+<h4>Sub-task</h4>
+<ul>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9556">PHPBB3-9556</a>] - Drop php closing tags</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9574">PHPBB3-9574</a>] - Drop fallback implementations</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9688">PHPBB3-9688</a>] - update_session API</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9738">PHPBB3-9738</a>] - Make installer and updater use migrations</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9797">PHPBB3-9797</a>] - Adjust existing access to superglobals</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10817">PHPBB3-10817</a>] - Use valid composer.json instead of non-standard extension.json</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10992">PHPBB3-10992</a>] - Use updated Goutte in Fileupload tests</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11109">PHPBB3-11109</a>] - Create a separate set of compress tests for the develop branch</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11243">PHPBB3-11243</a>] - Topics with attachments only show &quot;download all attachments&quot; links on pages containing attachments.</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11318">PHPBB3-11318</a>] - Extensions use migrations</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11351">PHPBB3-11351</a>] - Add appropriate language strings for errors</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11531">PHPBB3-11531</a>] - Add functional tests for new avatar system</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11637">PHPBB3-11637</a>] - generate_text_for_display on search.php</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11638">PHPBB3-11638</a>] - generate_text_for_display on viewtopic.php</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11639">PHPBB3-11639</a>] - generate_text_for_display on includes/functions_posting.php</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11640">PHPBB3-11640</a>] - generate_text_for_display on includes/functions_privmsgs.php</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11641">PHPBB3-11641</a>] - generate_text_for_display on includes/mcp/mcp_pm_reports.php</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11642">PHPBB3-11642</a>] - generate_text_for_display on includes/mcp/mcp_post.php</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11643">PHPBB3-11643</a>] - generate_text_for_display on includes/mcp/mcp_queue.php</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11653">PHPBB3-11653</a>] - generate_text_for_display on includes/mcp/mcp_topic.php</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11654">PHPBB3-11654</a>] - generate_text_for_display on includes/mcp/mcp_warn.php</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11655">PHPBB3-11655</a>] - generate_text_for_display on includes/ucp/ucp_pm_viewmessage.php</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11656">PHPBB3-11656</a>] - generate_text_for_display on memberlist.php</li>
+</ul>
+<h4>Task</h4>
+<ul>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-7090">PHPBB3-7090</a>] - Update minimum PHP version to 5.2</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9557">PHPBB3-9557</a>] - Update coding guidelines for 3.1 and PHP &gt;= 5.2</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9682">PHPBB3-9682</a>] - Add a class loader for auto loading and define naming rules for new phpbb classes</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9783">PHPBB3-9783</a>] - Restore subsilver2</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9867">PHPBB3-9867</a>] - Adjust the implementation of error messages localization</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9983">PHPBB3-9983</a>] - Restructure ACM classes</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9988">PHPBB3-9988</a>] - Replace config with an instance of a class implementing ArrayAccess</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10091">PHPBB3-10091</a>] - Bump minimum required postgresql version for 3.1</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10173">PHPBB3-10173</a>] - Move birthday list logic into templates</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10202">PHPBB3-10202</a>] - Provide a mechanism to manually retrieve long configuration options from a TEXT column</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10260">PHPBB3-10260</a>] - Remove prosilver styleswitcher</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10314">PHPBB3-10314</a>] - Whitelist all files in includes for code coverage reports</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10389">PHPBB3-10389</a>] - JSON extension should be checked in the installer</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10414">PHPBB3-10414</a>] - Functional testing</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10467">PHPBB3-10467</a>] - Check extensions diff for classes/constants not existing in php 5.2</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10609">PHPBB3-10609</a>] - Prefix phpBB functions with phpbb_ to prevent compatibility issues with other software</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10670">PHPBB3-10670</a>] - Require PHP 5.3 at minimum for phpBB 3.1</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10680">PHPBB3-10680</a>] - Add ext/ to .gitignore</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10688">PHPBB3-10688</a>] - Change 3.0 language to 3.1</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10693">PHPBB3-10693</a>] - Change minimum PHP version for Ascraeus to 5.3.2</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10719">PHPBB3-10719</a>] - Remove second 5.2 test suite on ascreaus</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10732">PHPBB3-10732</a>] - Add config_dev.php and config_test.php to .gitignore</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10855">PHPBB3-10855</a>] - Coding guideline change - have curly brackets on same line in JS</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10869">PHPBB3-10869</a>] - Remove PHP 5.2 check from .travis.yml</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10877">PHPBB3-10877</a>] - Have bamboo generate and publish a phpBB package for every build.</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10882">PHPBB3-10882</a>] - Expand test coverage for template engine - add tests for invalid constructs</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10893">PHPBB3-10893</a>] - Update the Usage of Composer</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10909">PHPBB3-10909</a>] - Update Travis Test Configuration: Travis no longer supports PHP 5.3.2</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10932">PHPBB3-10932</a>] - Store composer.phar in the phpBB repository to make sure a working version is always available</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10939">PHPBB3-10939</a>] - Modify the phpbb_request class to handle the $_FILES superglobal as well</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10941">PHPBB3-10941</a>] - Write tests for includes/functions_upload.php</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10944">PHPBB3-10944</a>] - Allow INCLUDEJS to include javascript from the assets directory</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10949">PHPBB3-10949</a>] - 3.1 AJAX code should use new coding guidelines</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10963">PHPBB3-10963</a>] - Use fileinfo in filespec::is_image() instead of trusting the mimetype sent by the browser</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10969">PHPBB3-10969</a>] - Remove remove_comments() and remove_remarks()</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10993">PHPBB3-10993</a>] - Update README to use composer.phar from the repository</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10994">PHPBB3-10994</a>] - Revert changes in PHPBB3-10963</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11054">PHPBB3-11054</a>] - Improper @var documentation syntax in includes/extension/controller.php</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11061">PHPBB3-11061</a>] - Fix README composer instructions</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11195">PHPBB3-11195</a>] - Put conditional opening brace on its own line, as per guidelines</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11225">PHPBB3-11225</a>] - Delete subsilver2 mcp_jumpbox.html</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11287">PHPBB3-11287</a>] - Add Template Event naming guidelines to docs/coding-guidelines.html</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11338">PHPBB3-11338</a>] - Enable Redis tests on Travis</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11441">PHPBB3-11441</a>] - Refactor phpbb_user_loader tests</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11476">PHPBB3-11476</a>] - Remove pass-by-reference from phpbb_db_driver::sql_multi_insert</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11481">PHPBB3-11481</a>] - Feed classes are currently all in feed.php</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11698">PHPBB3-11698</a>] - Move all autoloadable files to phpbb/ rather than includes/</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11722">PHPBB3-11722</a>] - Remove reference assignment for $captcha in report.php</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11760">PHPBB3-11760</a>] - 3.0.x Migration should use the phpbb_version_compare() wrapper.</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11818">PHPBB3-11818</a>] - Upgrade Symfony to 2.3 LTS</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11870">PHPBB3-11870</a>] - No longer exclude ./phpBB/phpbb/search/fulltext_*.php from code coverage</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11885">PHPBB3-11885</a>] - Add migrations for 3.0.12-RCx and 3.0.12</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11913">PHPBB3-11913</a>] - Apply reorganisation of download.phpbb.com to build_announcement.php</li>
+</ul>
<a name="v3013-PL1"></a><h3>Changes since 3.0.13-PL1</h3>
@@ -1053,8 +3912,8 @@
</li>
</ul>
-
<a name="v307-PL1"></a><h3>Changes since 3.0.7-PL1</h3>
+
<h4> Security
</h4>
<ul>
@@ -1511,7 +4370,6 @@
</li>
</ul>
-
<a name="v307"></a><h3>Changes since 3.0.7</h3>
<ul>
@@ -2629,7 +5487,7 @@
<div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<hr />
@@ -2637,17 +5495,17 @@
<a name="disclaimer"></a><h2>2. Copyright and disclaimer</h2>
<div class="paragraph">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div class="content">
- <p>This application is opensource software released under the <a href="http://opensource.org/licenses/gpl-2.0.php">GNU General Public License v2</a>. Please see source code and the docs directory for more details. This package and its contents are Copyright (c) <a href="https://www.phpbb.com/">phpBB Group</a>, All Rights Reserved.</p>
+ <p>phpBB is free software, released under the terms of the <a href="http://opensource.org/licenses/gpl-2.0.php">GNU General Public License, version 2 (GPL-2.0)</a>. Copyright © <a href="https://www.phpbb.com">phpBB Limited</a>. For full copyright and license information, please see the docs/CREDITS.txt file.</p>
</div>
<div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<!-- END DOCUMENT -->
@@ -2658,7 +5516,7 @@
</div></div>
<div>
- <a id="bottom" name="bottom" accesskey="z"></a>
+ <a id="bottom" accesskey="z"></a>
</div>
</body>
diff --git a/phpBB/docs/CREDITS.txt b/phpBB/docs/CREDITS.txt
new file mode 100644
index 0000000000..26ff8fcc80
--- /dev/null
+++ b/phpBB/docs/CREDITS.txt
@@ -0,0 +1,102 @@
+/**
+*
+* phpBB © Copyright phpBB Limited 2003-2016
+* http://www.phpbb.com
+*
+* phpBB is free software. You can redistribute it and/or modify it
+* under the terms of the GNU General Public License, version 2 (GPL-2.0)
+* as published by the Free Software Foundation.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* A copy of the license can be viewed in the docs/LICENSE.txt file.
+* The same can be viewed at <http://opensource.org/licenses/gpl-2.0.php>
+*
+*/
+
+
+phpBB Project Manager: Marshalrusty (Yuriy Rusko)
+
+phpBB Product Manager: naderman (Nils Adermann)
+
+phpBB Lead Developer: Marc (Marc Alexander)
+
+phpBB Developers: bantu (Andreas Fischer)
+ CHItA (Máté Bartus)
+ Elsensee (Oliver Schramm)
+ Nicofuma (Tristan Darricau)
+ prototech (Cesar Gallegos)
+
+For a list of phpBB Team members, please see:
+http://www.phpbb.com/about/team/
+
+For a full list of phpBB code contributors, please see:
+https://github.com/phpbb/phpbb/graphs/contributors
+
+-- Former Developers --
+
+phpBB Project Manager: theFinn (James Atkinson) [Founder - 04/2007]
+ SHS` (Jonathan Stanley)
+
+phpBB Lead Developer: Acyd Burn (Meik Sievertsen) [09/2005 - 01/2010]
+ psoTFX (Paul S. Owen) [2001 - 09/2005]
+
+phpBB Developers: A_Jelly_Doughnut (Josh Woody) [01/2010 - 11/2010]
+ Acyd Burn (Meik Sievertsen) [02/2003 - 09/2005]
+ APTX (Marek A. Ruszczyński) [12/2007 - 04/2011]
+ Arty (Vjacheslav Trushkin) [02/2012 - 07/2012]
+ Ashe (Ludovic Arnaud) [10/2002 - 11/2003, 06/2006 - 10/2006]
+ BartVB (Bart van Bragt) [11/2000 - 03/2006]
+ ckwalsh (Cullen Walsh) [01/2010 - 07/2011]
+ DavidMJ (David M.) [12/2005 - 08/2009]
+ dhn (Dominik Dröscher) [05/2007 - 01/2011]
+ dhruv.goel92 (Dhruv Goel) [04/2013 - 05/2016]
+ EXreaction (Nathan Guse) [07/2012 - 05/2014]
+ GrahamJE (Graham Eames) [09/2005 - 11/2006]
+ igorw (Igor Wiedler) [08/2010 - 02/2013]
+ imkingdavid (David King) [11/2012 - 06/2014]
+ kellanved (Henry Sudhof) [04/2007 - 03/2011]
+ nickvergessen (Joas Schilling)[04/2010 - 12/2015]
+ Oleg (Oleg Pudeyev) [01/2011 - 05/2013]
+ rxu (Ruslan Uzdenov) [04/2010 - 12/2012]
+ TerraFrost (Jim Wigginton) [04/2009 - 01/2011]
+ ToonArmy (Chris Smith) [06/2008 - 11/2011]
+ Vic D'Elfant (Vic D'Elfant) [04/2007 - 04/2009]
+
+Major contributions by: leviatan21 (Gabriel Vazquez)
+ NeoThermic (Ashley Pinner)
+ Raimon (Raimon Meuldijk)
+ Xore (Robert Hetzler)
+
+-- Copyrights --
+
+Visual Confirmation: Xore (Robert Hetzler)
+
+Original subSilver by subBlue Design, Tom Beddard, (c) 2001 phpBB Limited
+prosilver by subBlue Design, Tom Beddard, (c) 2004 phpBB Limited
+subsilver2 by subBlue Design, Tom Beddard, (c) 2004 phpBB Limited
+
+phpBB contains code from the following applications:
+
+LGPL licenced:
+Smarty (c) 2001, 2002 by ispi of Lincoln, Inc, http://smarty.php.net/
+
+GPL licenced:
+phpMyAdmin (c) 2001, 2003 phpMyAdmin Devel team, http://www.phpmyadmin.net/
+Jabber Class (c) 2006 Flyspray.org, http://www.flyspray.org/
+Chora (c) 2000-2006, The Horde Project. http://horde.org/chora/
+Horde Project (c) 2000-2006, The Horde Project. http://horde.org/
+jQuery (c) 2011, John Resig. http://jquery.com/
+Sphinx Technologies Inc (c) 2001-2012 Andrew Aksyonoff, http://sphinxsearch.com/
+Plupload (c) 2010-2013 Moxiecode Systems AB, http://www.plupload.com/
+
+PHP License, version 3.0:
+Pear (c) 2001-2004 PHP Group, http://pear.php.net
+
+Text_Diff-0.2.1 http://pear.php.net/package/Text_Diff
+
+MIT licenced:
+Symfony2 (c) 2004-2011 Fabien Potencier, http://symfony.com/
diff --git a/phpBB/docs/FAQ.html b/phpBB/docs/FAQ.html
index 9b6440ab21..5f3a425cda 100644
--- a/phpBB/docs/FAQ.html
+++ b/phpBB/docs/FAQ.html
@@ -1,19 +1,13 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en" xml:lang="en">
+<!DOCTYPE html>
+<html dir="ltr" lang="en">
<head>
-
-<meta http-equiv="content-type" content="text/html; charset=utf-8" />
-<meta http-equiv="content-style-type" content="text/css" />
-<meta http-equiv="content-language" content="en" />
-<meta http-equiv="imagetoolbar" content="no" />
-<meta name="resource-type" content="document" />
-<meta name="distribution" content="global" />
-<meta name="copyright" content="phpBB Group" />
+<meta charset="utf-8">
+<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="keywords" content="" />
-<meta name="description" content="phpBB 3.0.x frequently asked questions" />
-<title>phpBB3 &bull; FAQ</title>
+<meta name="description" content="phpBB 3.1.x frequently asked questions" />
+<title>phpBB &bull; FAQ</title>
-<link href="stylesheet.css" rel="stylesheet" type="text/css" media="screen, projection" />
+<link href="assets/css/stylesheet.css" rel="stylesheet" type="text/css" media="screen" />
</head>
@@ -23,16 +17,16 @@
<a id="top" name="top" accesskey="t"></a>
<div id="page-header">
<div class="headerbar">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div id="doc-description">
- <a href="../index.php" id="logo"><img src="site_logo.gif" alt="" /></a>
- <h1>phpBB 3.0.x FAQ</h1>
- <p>phpBB 3.0.x frequently asked questions</p>
+ <a href="../index.php" id="logo"><img src="assets/images/site_logo.gif" alt="" /></a>
+ <h1>phpBB 3.1.x FAQ</h1>
+ <p>phpBB 3.1.x frequently asked questions</p>
<p style="display: none;"><a href="#start_here">Skip</a></p>
</div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
</div>
@@ -42,12 +36,17 @@
<!-- BEGIN DOCUMENT -->
- <p>This is a very basic Frequently Asked Questions (FAQ) page which attempts to answer some of the more commonly asked questions. It is by no means exhaustive and should be used in combination with the 'built-in' User FAQ within phpBB3, the community forums and our IRC channel (see <a href="README.html">README</a> for details).</p>
+ <p class="paragraph main-description">
+ This is a very basic Frequently Asked Questions (FAQ) page which attempts to answer some of the
+ more commonly asked questions. It is by no means exhaustive and should be used in combination with
+ the 'built-in' User FAQ within phpBB3, the community forums and our IRC channel
+ (see <a href="README.html">README</a> for details).
+ </p>
<h1>FAQ</h1>
<div class="paragraph menu">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div class="content">
@@ -73,7 +72,7 @@
</div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<hr />
@@ -81,11 +80,11 @@
<a name="install"></a><h2>I am finding phpBB too difficult to install. Will you do it for me?</h2>
<div class="paragraph">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div class="content">
-<p>Simple answer, no we will not. We are not being difficult when we say this we are actually trying to help you. phpBB has a reputation for being easy to install, that reputation is we believe well deserved. It is a simple process of unarchiving a single file, uploading the resulting directory/files to their intended location and entering some data in a web based form. The sequence of events, what to type where, etc. is covered in detail in the accompanying <a href="INSTALL.html">INSTALL.html</a> documentation. If you cannot install phpBB3 the chances are you will be unable to administer or update it.</p>
+<p>Simple answer, no we will not. We are not being difficult when we say this we are actually trying to help you. phpBB has a reputation for being easy to install, that reputation is we believe well deserved. It is a simple process of unarchiving a single file, uploading the resulting directory/files to their intended location and entering some data in a web based form. The sequence of events, what to type where, etc. is covered in detail in the accompanying <a href="INSTALL.html">INSTALL.html</a> documentation. If you cannot install phpBB the chances are you will be unable to administer or update it.</p>
<p>There are people, companies (unrelated to your hosting provider), etc. that will install your forum, either for free or for a payment. We do not recommend you make use of these offers. Unless the service is provided by your hosting company you will have to divulge passwords and other sensitive details. If you did not know how to use an ATM would you give a passer-by your bank card and PIN and ask them to show you what to do? No, probably not! The same applies to your hosting account details!</p>
@@ -95,7 +94,7 @@
<div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<hr />
@@ -106,7 +105,7 @@ A board is dealing in warez/porn/etc., you need to prevent them doing this!<br /
I want to sue you because i think you host an illegal board!</h2>
<div class="paragraph">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div class="content">
@@ -118,7 +117,7 @@ I want to sue you because i think you host an illegal board!</h2>
<div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<hr />
@@ -126,7 +125,7 @@ I want to sue you because i think you host an illegal board!</h2>
<a name="viewonline"></a><h2>According to viewonline a user is doing/reading something they should not be able to!</h2>
<div class="paragraph">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div class="content">
@@ -138,7 +137,7 @@ I want to sue you because i think you host an illegal board!</h2>
<div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<hr />
@@ -146,7 +145,7 @@ I want to sue you because i think you host an illegal board!</h2>
<a name="mail"></a><h2>I keep getting Mail sending errors when I (or my users) post/send PM's/etc.!</h2>
<div class="paragraph">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div class="content">
@@ -158,7 +157,7 @@ I want to sue you because i think you host an illegal board!</h2>
<div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<hr />
@@ -166,7 +165,7 @@ I want to sue you because i think you host an illegal board!</h2>
<a name="mail_language"></a><h2>My users are complaining that emails are not in their selected language!</h2>
<div class="paragraph">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div class="content">
@@ -178,7 +177,7 @@ I want to sue you because i think you host an illegal board!</h2>
<div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<hr />
@@ -186,7 +185,7 @@ I want to sue you because i think you host an illegal board!</h2>
<a name="aol_browser"></a><h2>My AOL based users keep getting logged out!</h2>
<div class="paragraph">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div class="content">
@@ -194,13 +193,13 @@ I want to sue you because i think you host an illegal board!</h2>
<p>Unfortunately this only works when the users IP is constant as they browse the board. For most users this will be the case. However certain providers route their users via a cluster of proxys. In some cases, particularly the AOL browser, this results in different IPs being forwarded as the user moves between pages. We take account of this by not checking the entire IP by default but only the first "three quads" (<samp>A.B.C</samp>). Again in most cases this will be fine. However again AOL uses IPs which can vary so much that checking only the first two quads results in a fairly static IP being available for session validation.</p>
-<p>If you are experiencing problems related to this you can set the Session IP validation parameter found in <code>Admin-&gt;General-&gt;Server Configuration-&gt;Security Settings</code> to <samp>A.B</samp>. Please note that reducing the IP validation length does potentially increase the risk of sessions being hijacked (this is something for you to consider, phpBB Group takes no responsibility should anything happen!). We suggest to at least additionally enable the browser validation.</p>
+<p>If you are experiencing problems related to this you can set the Session IP validation parameter found in <code>Admin-&gt;General-&gt;Server Configuration-&gt;Security Settings</code> to <samp>A.B</samp>. Please note that reducing the IP validation length does potentially increase the risk of sessions being hijacked (this is something for you to consider, phpBB Limited takes no responsibility should anything happen!). We suggest to at least additionally enable the browser validation.</p>
</div>
<div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<hr />
@@ -208,7 +207,7 @@ I want to sue you because i think you host an illegal board!</h2>
<a name="avatars"></a><h2>I am unable to upload avatars from my computer, regardless of the settings.</h2>
<div class="paragraph">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div class="content">
@@ -220,7 +219,7 @@ I want to sue you because i think you host an illegal board!</h2>
<div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<hr />
@@ -228,7 +227,7 @@ I want to sue you because i think you host an illegal board!</h2>
<a name="gallery_avatars"></a><h2>I just cannot get gallery avatars to appear!</h2>
<div class="paragraph">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div class="content">
@@ -238,7 +237,7 @@ I want to sue you because i think you host an illegal board!</h2>
<div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<hr />
@@ -246,17 +245,17 @@ I want to sue you because i think you host an illegal board!</h2>
<a name="permissions"></a><h2>How do I use/set permissions?</h2>
<div class="paragraph">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div class="content">
-<p>Please read the paragraph about permissions in our extensive <a href="https://www.phpbb.com/support/documentation/3.0/">online documentation</a>.</p>
+<p>Please read the paragraph about permissions in our extensive <a href="https://www.phpbb.com/support/docs/en/3.1/ug/">online documentation</a>.</p>
</div>
<div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<hr />
@@ -264,7 +263,7 @@ I want to sue you because i think you host an illegal board!</h2>
<a name="login_issues"></a><h2>I (or my users) cannot stay logged in to the forum!</h2>
<div class="paragraph">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div class="content">
@@ -276,7 +275,7 @@ I want to sue you because i think you host an illegal board!</h2>
<div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<hr />
@@ -284,7 +283,7 @@ I want to sue you because i think you host an illegal board!</h2>
<a name="logout_issues"></a><h2>My users are complaining about being logged out too quickly!</h2>
<div class="paragraph">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div class="content">
@@ -294,7 +293,7 @@ I want to sue you because i think you host an illegal board!</h2>
<div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<hr />
@@ -302,11 +301,11 @@ I want to sue you because i think you host an illegal board!</h2>
<a name="not_answered"></a><h2>My question isn't answered here!</h2>
<div class="paragraph">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div class="content">
-<p>Please read our <a href="https://www.phpbb.com/support/documentation/3.0/">extensive user documentation</a> first, it may just explain what you want to know.</p>
+<p>Please read our <a href="https://www.phpbb.com/support/docs/en/3.1/ug/">extensive user documentation</a> first, it may just explain what you want to know.</p>
<p>Feel free to search our community forum for the information you require. <strong>PLEASE DO NOT</strong> post your question without having first used search, chances are someone has already asked and answered your question. You can find our board here:</p>
@@ -316,7 +315,7 @@ I want to sue you because i think you host an illegal board!</h2>
<div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<hr />
@@ -324,17 +323,17 @@ I want to sue you because i think you host an illegal board!</h2>
<a name="disclaimer"></a><h2>Copyright and disclaimer</h2>
<div class="paragraph">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div class="content">
- <p>This application is opensource software released under the <a href="http://opensource.org/licenses/gpl-2.0.php">GNU General Public License v2</a>. Please see source code and the docs directory for more details. This package and its contents are Copyright (c) <a href="https://www.phpbb.com/">phpBB Group</a>, All Rights Reserved.</p>
+ <p>phpBB is free software, released under the terms of the <a href="http://opensource.org/licenses/gpl-2.0.php">GNU General Public License, version 2 (GPL-2.0)</a>. Copyright © <a href="https://www.phpbb.com">phpBB Limited</a>. For full copyright and license information, please see the docs/CREDITS.txt file.</p>
</div>
<div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<!-- END DOCUMENT -->
@@ -345,7 +344,7 @@ I want to sue you because i think you host an illegal board!</h2>
</div></div>
<div>
- <a id="bottom" name="bottom" accesskey="z"></a>
+ <a id="bottom" accesskey="z"></a>
</div>
</body>
diff --git a/phpBB/docs/INSTALL.html b/phpBB/docs/INSTALL.html
index aedb07cdd0..19644327c2 100644
--- a/phpBB/docs/INSTALL.html
+++ b/phpBB/docs/INSTALL.html
@@ -1,19 +1,13 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en" xml:lang="en">
+<!DOCTYPE html>
+<html dir="ltr" lang="en">
<head>
-
-<meta http-equiv="content-type" content="text/html; charset=utf-8" />
-<meta http-equiv="content-style-type" content="text/css" />
-<meta http-equiv="content-language" content="en" />
-<meta http-equiv="imagetoolbar" content="no" />
-<meta name="resource-type" content="document" />
-<meta name="distribution" content="global" />
-<meta name="copyright" content="phpBB Group" />
+<meta charset="utf-8">
+<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="keywords" content="" />
-<meta name="description" content="phpBB 3.0.x Installation, updating and conversion informations" />
-<title>phpBB3 &bull; Install</title>
+<meta name="description" content="phpBB 3.1.x Installation, updating and conversion informations" />
+<title>phpBB &bull; Install</title>
-<link href="stylesheet.css" rel="stylesheet" type="text/css" media="screen, projection" />
+<link href="assets/css/stylesheet.css" rel="stylesheet" type="text/css" media="screen" />
</head>
@@ -23,16 +17,16 @@
<a id="top" name="top" accesskey="t"></a>
<div id="page-header">
<div class="headerbar">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div id="doc-description">
- <a href="../index.php" id="logo"><img src="site_logo.gif" alt="" /></a>
- <h1>phpBB 3.0.x Install</h1>
- <p>phpBB 3.0.x Installation, updating and conversion informations</p>
+ <a href="../index.php" id="logo"><img src="assets/images/site_logo.gif" alt="" /></a>
+ <h1>phpBB 3.1.x Install</h1>
+ <p>phpBB 3.1.x Installation, updating and conversion informations</p>
<p style="display: none;"><a href="#start_here">Skip</a></p>
</div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
</div>
@@ -42,16 +36,22 @@
<!-- BEGIN DOCUMENT -->
-<p><strong>Please read this document completely before proceeding with installation, updating or converting.</strong></p>
+<div class="paragraph">
+ <p><strong>Please read this document completely before proceeding with installation, updating or converting.</strong></p>
-<p>This document will walk you through the basics on installing, updating and converting the forum software.</p>
-
-<p>A basic overview of running phpBB3 can be found in the accompanying <a href="README.html">README</a> file. Please ensure you read that document in addition to this! For more detailed information on using, installing, updating and converting phpBB3 you should read <a href="https://www.phpbb.com/support/documentation/3.0/">the documentation</a> available online.</p>
+ <p>This document will walk you through the basics on installing, updating and converting the forum software.</p>
+ <p>
+ A basic overview of running phpBB can be found in the accompanying <a href="README.html">README</a> file.
+ Please ensure you read that document in addition to this! For more detailed information on using, installing,
+ updating and converting phpBB you should read <a href="https://www.phpbb.com/support/docs/en/3.1/ug/">the documentation</a>
+ available online.
+ </p>
+</div>
<h1>Install</h1>
<div class="paragraph menu">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div class="content">
@@ -59,7 +59,7 @@
<li><a href="#quickinstall">Quick install</a></li>
<li><a href="#require">Requirements</a></li>
<li><a href="#install">New installation</a></li>
- <li><a href="#update">Updating from stable releases of phpBB 3.0.x</a>
+ <li><a href="#update">Updating from stable releases of phpBB 3.1.x</a>
<ol style="list-style-type: lower-roman;">
<li><a href="#update_full">Full package</a></li>
<li><a href="#update_files">Changed files</a></li>
@@ -68,7 +68,8 @@
<li><a href="#update_all">All package types</a></li>
</ol>
</li>
- <li><a href="#convert">Conversion from phpBB 2.0.x to phpBB 3.0.x</a>
+ <li><a href="#update30">Updating from phpBB 3.0.x to phpBB 3.1.x</a></li>
+ <li><a href="#convert">Conversion from phpBB 2.0.x to phpBB 3.1.x</a>
<ol style="list-style-type: lower-roman;">
<li><a href="#prereq">Requirements before converting</a></li>
<li><a href="#conversion">Converting</a></li>
@@ -88,7 +89,7 @@
</div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<hr />
@@ -96,7 +97,7 @@
<a name="quickinstall"></a><h2>1. Quick install</h2>
<div class="paragraph">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div class="content">
@@ -120,7 +121,7 @@
<div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<hr />
@@ -128,11 +129,11 @@
<a name="require"></a><h2>2. Requirements</h2>
<div class="paragraph">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div class="content">
- <p>phpBB 3.0.x has a few requirements which must be met before you are able to install and use it.</p>
+ <p>phpBB 3.1.x has a few requirements which must be met before you are able to install and use it.</p>
<ul>
<li>A webserver or web hosting account running on any major Operating System with support for PHP</li>
@@ -140,33 +141,38 @@
<ul>
<li>MySQL 3.23 or above (MySQLi supported)</li>
<li>MariaDB 5.1 or above</li>
- <li>PostgreSQL 7.3+</li>
- <li>SQLite 2.8.2+ (SQLite 3 is not supported)</li>
- <li>Firebird 2.1+</li>
+ <li>PostgreSQL 8.3+</li>
+ <li>SQLite 2.8.2+</li>
+ <li>SQLite 3.6.15+</li>
<li>MS SQL Server 2000 or above (directly or via ODBC or the native adapter)</li>
<li>Oracle</li>
</ul>
</li>
- <li><strong>PHP (>=4.3.3, >=4.4.0, >=5.0.0)</strong> with support for the database you intend to use.</li>
+ <li><strong>PHP 5.3.3+</strong> and <strong>PHP &lt; 7.0</strong> with support for the database you intend to use.</li>
+ <li>The following PHP modules are required:
+ <ul>
+ <li>json</li>
+ </ul>
+ </li>
<li>getimagesize() function must be enabled.</li>
<li>Presence of the following modules within PHP will provide access to additional features, but they are not required:
<ul>
<li>zlib Compression support</li>
<li>Remote FTP support</li>
<li>XML support</li>
- <li>Imagemagick support</li>
+ <li>ImageMagick support</li>
<li>GD Support</li>
</ul>
</li>
</ul>
- <p>If your server or hosting account does not meet the requirements above then you will be unable to install phpBB 3.0.x.</p>
+ <p>If your server or hosting account does not meet the requirements above then you will be unable to install phpBB 3.1.x.</p>
</div>
<div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<hr />
@@ -174,27 +180,27 @@
<a name="install"></a><h2>3. New installation</h2>
<div class="paragraph">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div class="content">
- <p>Installation of phpBB3 will vary according to your server and database. If you have <em>shell access</em> to your account (via telnet or ssh for example) you may want to upload the entire phpBB3 archive (in binary mode!) to a directory on your host and unarchive it there.</p>
+ <p>Installation of phpBB will vary according to your server and database. If you have <em>shell access</em> to your account (via telnet or ssh for example) you may want to upload the entire phpBB archive (in binary mode!) to a directory on your host and unarchive it there.</p>
- <p>If you do not have shell access or do not wish to use it, you will need to decompress the phpBB3 archive to a local directory on your system using your favourite compression program, e.g. winzip, rar, zip, etc. From there you must FTP <strong>ALL</strong> the files it contains (being sure to retain the directory structure and filenames) to your host. Please ensure that the cases of filenames are retained, do <strong>NOT</strong> force filenames to all lower or upper case as doing so will cause errors later.</p>
+ <p>If you do not have shell access or do not wish to use it, you will need to decompress the phpBB archive to a local directory on your system using your favourite compression program, e.g. winzip, rar, zip, etc. From there you must FTP <strong>ALL</strong> the files it contains (being sure to retain the directory structure and filenames) to your host. Please ensure that the cases of filenames are retained, do <strong>NOT</strong> force filenames to all lower or upper case as doing so will cause errors later.</p>
<p>All .php, .sql, .cfg, .css, .js, .html, .htaccess and .txt files should be uploaded in <strong>ASCII</strong> mode, while all graphics should be uploaded in <strong>BINARY</strong> mode. If you are unfamiliar with what this means please refer to your FTP client documentation. In most cases this is all handled transparantly by your ftp client, but if you encounter problems later you should be sure the files were uploaded correctly as described here.</p>
- <p>phpBB3 comes supplied with British English as its standard language. However, a number of separate packs for different languages are available. If you are not a native English speaker you may wish to install one or more of these packages before continuing. The installation process below will allow you to select a default language from those available (you can, of course, change this default at a later stage). For more details on language packs, where to obtain them and how to install them please see the <a href="README.html#i18n">README</a>.</p>
+ <p>phpBB comes supplied with British English as its standard language. However, a number of separate packs for different languages are available. If you are not a native English speaker you may wish to install one or more of these packages before continuing. The installation process below will allow you to select a default language from those available (you can, of course, change this default at a later stage). For more details on language packs, where to obtain them and how to install them please see the <a href="README.html#i18n">README</a>.</p>
- <p>Once all the files have been uploaded to your site, you should point your browser at this location with the addition of <code>/install/</code>. For example, if your domain name is <code>www.example.com</code> and you placed the phpBB3 files in the directory <code>/phpBB3</code> off your web root you would enter <code>http://www.example.com/phpBB3/install/</code> or (alternatively) <code>http://www.example.com/phpBB3/install/index.php</code> into your browser. When you have done this, you should see the <strong><em>phpBB3 Introduction</em></strong> screen appear.</p>
+ <p>Once all the files have been uploaded to your site, you should point your browser at this location with the addition of <code>/install/</code>. For example, if your domain name is <code>www.example.com</code> and you placed the phpBB files in the directory <code>/phpBB3</code> off your web root you would enter <code>http://www.example.com/phpBB3/install/</code> or (alternatively) <code>http://www.example.com/phpBB3/install/index.php</code> into your browser. When you have done this, you should see the <strong><em>phpBB Introduction</em></strong> screen appear.</p>
<h4>Introduction:</h4>
- <p>The initial screen gives you a short introduction into phpBB. It allows you to read the license phpBB3 is released under (General Public License v2) and provides information about how you can receive support. To start the installation, use the <strong><em>INSTALL</em></strong> tab.</p>
+ <p>The initial screen gives you a short introduction into phpBB. It allows you to read the license phpBB is released under (General Public License v2) and provides information about how you can receive support. To start the installation, use the <strong><em>INSTALL</em></strong> tab.</p>
<h4>Requirements</h4>
- <p>The first page you will see after starting the installation is the Requirements list. phpBB3 automatically checks whether everything that it needs to run properly is installed on your server. You need to have at least the minimum PHP version installed, and at least one database available to continue the installation. Also important, is that all shown folders are available and have the correct permissions. Please see the description of each section to find out whether they are optional or required for phpBB3 to run. If everything is in order, you can continue the installation with <em>Start Install</em>.</p>
+ <p>The first page you will see after starting the installation is the Requirements list. phpBB automatically checks whether everything that it needs to run properly is installed on your server. You need to have at least the minimum PHP version installed, and at least one database available to continue the installation. Also important, is that all shown folders are available and have the correct permissions. Please see the description of each section to find out whether they are optional or required for phpBB to run. If everything is in order, you can continue the installation with <em>Start Install</em>.</p>
<h4>Database settings</h4>
@@ -214,7 +220,7 @@
<p>You don't need to change the Prefix for tables in database setting, unless you plan on using multipe phpBB installations on one database. In this case, you can use a different prefix for each installation to make it work.</p>
- <p>After you entered your details, you can continue with the <em>Proceed to next step</em> button. Now phpBB3 will check whether the data you entered will lead to a successful database connection and whether tables with the same prefix already exist.</p>
+ <p>After you entered your details, you can continue with the <em>Proceed to next step</em> button. Now phpBB will check whether the data you entered will lead to a successful database connection and whether tables with the same prefix already exist.</p>
<p>A <em>Could not connect to the database</em> error means that you didn't enter the database data correctly and it is not possible for phpBB to connect. Make sure that everything you entered is in order and try again. Again, if you are unsure about your database settings, please contact your host.</p>
@@ -224,7 +230,7 @@
<h4>Administrator details</h4>
- <p>Now you have to create your administration user. This user will have full administration access and he/she will be the first user on your forum. All fields on this page are required. You can also set the default language of your forum on this page. In a vanilla phpBB3 installation, we only include British English. You can download further languages from <a href="https://www.phpbb.com/">www.phpbb.com</a>, and add them before installing or later.</p>
+ <p>Now you have to create your administration user. This user will have full administration access and he/she will be the first user on your forum. All fields on this page are required. You can also set the default language of your forum on this page. In a vanilla phpBB installation, we only include British English. You can download further languages from <a href="https://www.phpbb.com/">www.phpbb.com</a>, and add them before installing or later.</p>
<h4>Configuration file</h4>
@@ -238,7 +244,7 @@
<p>If the installation was successful, you can now use the <em>Login</em> button to visit the Administration Control Panel. Congratulations, you have installed phpBB successfully. But there is still work ahead!</p>
- <p>If you are unable to get phpBB3 installed even after reading this guide, please look at the support section of the installer's introduction page to find out where you can ask for further assistance.</p>
+ <p>If you are unable to get phpBB installed even after reading this guide, please look at the support section of the installer's introduction page to find out where you can ask for further assistance.</p>
<p>At this point if you are converting from phpBB 2.0.x, you should refer to the <a href="#convert">conversion steps</a> for further information. If not, you should remove the install directory from your server as you will only be able to access the Administration Control Panel whilst it is present.</p>
@@ -246,29 +252,29 @@
<div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<hr />
- <a name="update"></a><h2>4. Updating from stable releases of phpBB 3.0.x</h2>
+ <a name="update"></a><h2>4. Updating from stable releases of phpBB 3.1.x</h2>
<div class="paragraph">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div class="content">
-<p>If you are currently using a stable release of phpBB3, updating to this version is straightforward. You would have downloaded one of four packages and your choice determines what you need to do. <strong>Note</strong>: Before updating, we heavily recommend you do a <em>full backup of your database and existing phpBB3 files</em>! If you are unsure how to achieve this please ask your hosting provider for advice.</p>
+<p>If you are currently using a stable release of phpBB, updating to this version is straightforward. You would have downloaded one of four packages and your choice determines what you need to do. <strong>Note</strong>: Before updating, we heavily recommend you do a <em>full backup of your database and existing phpBB files</em>! If you are unsure how to achieve this please ask your hosting provider for advice.</p>
-<p><strong>Please make sure you update your phpBB3 source files too, even if you run the <code>database_update.php</code> file.</strong></p>
+<p><strong>Please make sure you update your phpBB source files too, even if you run the <code>database_update.php</code> file.</strong> If you have shell access to your server, you may wish to update via the command line interface. From your board's root, execute the following command: <code>php bin/phpbbcli.php --safe-mode db:migrate</code>.</p>
<a name="update_full"></a><h3>4.i. Full package</h3>
<p>The full package is normally meant for new installations only, but if you want to replace all source files, this package comes in handy.</p>
- <p>First, you should make a copy of your existing <code>config.php</code> file; keep it in a safe place! Next, delete all the existing phpBB3 files, you may want to leave your <code>files/</code> and <code>images/</code> directorie in place. You can leave alternative styles in place too. With this complete, you can upload the new phpBB files (see <a href="#install">New installation</a> for details if necessary). Once complete, copy back your saved <code>config.php</code>, replacing the new one. Another method is to just <strong>replace</strong> the existing files with the files from the full package - though make sure you do <strong>not</strong> overwrite your config.php file.</p>
+ <p>First, you should make a copy of your existing <code>config.php</code> file; keep it in a safe place! Next, delete all the existing phpBB files, you may want to leave your <code>files/</code> and <code>images/</code> directories in place. You can leave alternative styles in place too. With this complete, you can upload the new phpBB files (see <a href="#install">New installation</a> for details if necessary). Once complete, copy back your saved <code>config.php</code>, replacing the new one. Another method is to just <strong>replace</strong> the existing files with the files from the full package - though make sure you do <strong>not</strong> overwrite your config.php file.</p>
- <p>You should now run <code>install/database_update.php</code> which, depending on your previous version, will make a number of database changes. You may receive <em>FAILURES</em> during this procedure. They should not be a cause for concern unless you see an actual <em>ERROR</em>, in which case the script will stop (in this case you should seek help via our forums or bug tracker).</p>
+ <p>You should now run <code>install/database_update.php</code> which, depending on your previous version, will make a number of database changes. You may receive <em>FAILURES</em> during this procedure. They should not be a cause for concern unless you see an actual <em>ERROR</em>, in which case the script will stop (in this case you should seek help via our forums or bug tracker). If you have shell access to your server, you may wish to update via the command line interface. From your board's root, execute the following command: <code>php bin/phpbbcli.php --safe-mode db:migrate</code>.</p>
<p>Once <code>install/database_update.php</code> has completed, you may proceed to the Administration Control Panel and then remove the install directory as advised.</p>
@@ -276,11 +282,11 @@
<p>This package is meant for those wanting to only replace the files that were changed between a previous version and the latest version.</p>
- <p>This package contains a number of archives, each contains the files changed from a given release to the latest version. You should select the appropriate archive for your current version, e.g. if you currently have <strong>3.0.13</strong> you should select the appropriate <code>phpBB-3.0.14-files.zip/tar.bz2</code> file.</p>
+ <p>This package contains a number of archives, each contains the files changed from a given release to the latest version. You should select the appropriate archive for your current version, e.g. if you currently have <strong>3.1.0</strong> you should select the appropriate <code>phpBB-3.1.1-files.zip/tar.bz2</code> file.</p>
<p>The directory structure has been preserved, enabling you (if you wish) to simply upload the uncompressed contents of the archive to the appropriate location on your server, i.e. simply overwrite the existing files with the new versions. Do not forget that if you have installed any modifications (MODs) these files will overwrite the originals, possibly destroying them in the process. You will need to re-add MODs to any affected file before uploading.</p>
- <p>As for the other update procedures, you should run <code>install/database_update.php</code> after you have finished updating the files. This will update your database schema and increment the version number.</p>
+ <p>As for the other update procedures, you should run <code>install/database_update.php</code> after you have finished updating the files. This will update your database schema and increment the version number. If you have shell access to your server, you may wish to update via the command line interface. From your board's root, execute the following command: <code>php bin/phpbbcli.php --safe-mode db:migrate</code>.</p>
<a name="update_patch"></a><h3>4.iii. Patch file</h3>
@@ -288,24 +294,24 @@
<p>The patch file is one solution for those with many Modifications (MODs) or other changes and do not want to re-add them back to all the changed files. To use this you will need command line access to a standard UNIX type <strong>patch</strong> application. If you do not have access to such an application, but still want to use this update approach, we strongly recommend the <a href="#update_auto">Automatic update package</a> explained below. It is also the recommended update method.</p>
- <p>A number of patch files are provided to allow you to update from previous stable releases. Select the correct patch, e.g. if your current version is <strong>3.0.13</strong>, you need the <code>phpBB-3.0.14-patch.zip/tar.bz2</code> file. Place the correct patch in the parent directory containing the phpBB core files (i.e. index.php, viewforum.php, etc.). With this done you should run the following command: <code>patch -cl -d [PHPBB DIRECTORY] -p1 &lt; [PATCH NAME]</code> (where PHPBB DIRECTORY is the directory name your phpBB Installation resides in, for example phpBB, and where PATCH NAME is the relevant filename of the selected patch file). This should complete quickly, hopefully without any HUNK FAILED comments.</p>
+ <p>A number of patch files are provided to allow you to update from previous stable releases. Select the correct patch, e.g. if your current version is <strong>3.1.0</strong>, you need the <code>phpBB-3.1.1-patch.zip/tar.bz2</code> file. Place the correct patch in the parent directory containing the phpBB core files (i.e. index.php, viewforum.php, etc.). With this done you should run the following command: <code>patch -cl -d [PHPBB DIRECTORY] -p1 &lt; [PATCH NAME]</code> (where PHPBB DIRECTORY is the directory name your phpBB Installation resides in, for example phpBB, and where PATCH NAME is the relevant filename of the selected patch file). This should complete quickly, hopefully without any HUNK FAILED comments.</p>
<p>If you do get failures, you should look at using the <a href="#update_files">Changed Files</a> package to replace the files which failed to patch. Please note that you will need to manually re-add any MODs to these particular files. Alternatively, if you know how, you can examine the .rej files to determine what failed where and make manual adjustments to the relevant source.</p>
- <p>You should, of course, delete the patch file (or files) after use. As for the other update procedures, you should run <code>install/database_update.php</code> after you have finished updating the files. This will update your database schema and data (if appropriate) and increment the version number.</p>
+ <p>You should, of course, delete the patch file (or files) after use. As for the other update procedures, you should run <code>install/database_update.php</code> after you have finished updating the files. This will update your database schema and data (if appropriate) and increment the version number. If you have shell access to your server, you may wish to update via the command line interface. From your board's root, execute the following command: <code>php bin/phpbbcli.php --safe-mode db:migrate</code>.</p>
<a name="update_auto"></a><h3>4.iv. Automatic update package</h3>
<p>This update method is the recommended method for updating. This package detects changed files automatically and merges in changes if needed.</p>
- <p>The automatic update package will update the board from a given version to the latest version. A number of automatic update files are available, and you should choose the one that corresponds to the version of the board that you are currently running. For example, if your current version is <strong>3.0.13</strong>, you need the <code>phpBB-3.0.13_to_3.0.14.zip/tar.bz2</code> file.</p>
+ <p>The automatic update package will update the board from a given version to the latest version. A number of automatic update files are available, and you should choose the one that corresponds to the version of the board that you are currently running. For example, if your current version is <strong>3.1.5</strong>, you need the <code>phpBB-3.1.5_to_3.1.6.zip/tar.bz2</code> file.</p>
<p>To perform the update, either follow the instructions from the <strong>Administration Control Panel-&gt;System</strong> Tab - this should point out that you are running an outdated version and will guide you through the update - or follow the instructions listed below.</p>
<ul>
<li>Go to the <a href="https://www.phpbb.com/downloads/">downloads page</a> and download the latest update package listed there, matching your current version.</li>
- <li>Upload the uncompressed archive contents to your phpBB installation - only the install folder is required. Upload the whole install folder, retaining the file structure.</li>
- <li>After the install folder is present, phpBB3 will go offline automatically.</li>
+ <li>Upload the uncompressed archive contents to your phpBB installation - only the <code>install/</code> and <code>vendor/</code> folders are required. Upload these folders in their entirety, retaining the file structure.</li>
+ <li>After the install folder is present, phpBB will go offline automatically.</li>
<li>Point your browser to the install directory, for example <code>http://www.example.com/phpBB3/install/</code></li>
<li>Choose the "Update" Tab and follow the instructions</li>
</ul>
@@ -322,18 +328,52 @@
<div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<hr />
- <a name="convert"></a><h2>5. Conversion from phpBB 2.0.x to phpBB 3.0.x</h2>
+ <a name="update30"></a><h2>5. Updating from phpBB 3.0.x to phpBB 3.1.x</h2>
<div class="paragraph">
<div class="inner"><span class="corners-top"><span></span></span>
<div class="content">
+ <p>Updating from phpBB 3.0.x to 3.1.x is just the same as <a href="#update">updating from stable releases of phpBB 3.1.x</a></p>
+
+ <p>However you can also start with a new set of phpBB 3.1.x files.</p>
+
+ <ol>
+ <li>Delete all files <strong>EXCEPT</strong> for the following:
+
+ <ul>
+ <li>The <code>config.php</code> file</li>
+ <li>The <code>images/</code> directory</li>
+ <li>The <code>files/</code> directory</li>
+ <li>The <code>store/</code> directory</li>
+ </ul></li>
+
+ <li>Upload the contents of the 3.1.x Full Package into your forum's directory. Make sure the root level .htaccess file is included in the upload.</li>
+ <li>Browse to install/database_update.php</li>
+ <li>Delete the <code>install/</code> directory</li>
+ </ol>
+ </div>
+
+ <div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
+
+ <span class="corners-bottom"><span></span></span></div>
+ </div>
+
+ <hr />
+
+ <a name="convert"></a><h2>6. Conversion from phpBB 2.0.x to phpBB 3.1.x</h2>
+
+ <div class="paragraph">
+ <div class="inner">
+
+ <div class="content">
+
<p>This paragraph explains the steps necessary to convert your existing phpBB2 installation to phpBB3.</p>
<a name="prereq"></a><h3>5.i. Requirements before converting</h3>
@@ -385,25 +425,25 @@
<div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<hr />
- <a name="postinstall"></a><h2>6. Important (security related) post-Install tasks for all installation methods</h2>
+ <a name="postinstall"></a><h2>7. Important (security related) post-Install tasks for all installation methods</h2>
<div class="paragraph">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div class="content">
- <p>Once you have successfully installed phpBB3 you <strong>MUST</strong> ensure you remove the entire <code>install/</code> directory. Leaving the install directory in place is a <em>very serious potential security issue</em> which may lead to deletion or alteration of files, etc. Please note that until this directory is removed, phpBB will not operate and a warning message will be displayed. Beyond this <strong>essential</strong> deletion, you may also wish to delete the docs/ directory if you wish.</p>
+ <p>Once you have successfully installed phpBB you <strong>MUST</strong> ensure you remove the entire <code>install/</code> directory. Leaving the install directory in place is a <em>very serious potential security issue</em> which may lead to deletion or alteration of files, etc. Please note that until this directory is removed, phpBB will not operate and a warning message will be displayed. Beyond this <strong>essential</strong> deletion, you may also wish to delete the docs/ directory if you wish.</p>
<p>With these directories deleted, you should proceed to the administration panel. Depending on how the installation completed, you may have been directed there automatically. If not, login as the administrator you specified during install/conversion and click the <strong>Administration Control Panel</strong> link at the bottom of any page. Ensure that details specified on the <strong>General</strong> tab are correct!</p>
<a name="avatars"></a><h3>6.i. Uploadable avatars</h3>
- <p>phpBB3 supports several methods for allowing users to select their own <em>avatar</em> (an avatar is a small image generally unique to a user and displayed just below their username in posts).</p>
+ <p>phpBB supports several methods for allowing users to select their own <em>avatar</em> (an avatar is a small image generally unique to a user and displayed just below their username in posts).</p>
<p>Two of these options allow users to upload an avatar from their machine or a remote location (via a URL). If you wish to enable this function you should first ensure the correct path for uploadable avatars is set in <strong>Administration Control Panel -&gt; General -&gt; Board Configuration -&gt; Avatar settings</strong>. By default this is <code>images/avatars/uploads</code>, but you can set it to whatever you like, just ensure the configuration setting is updated. You must also ensure this directory can be written to by the webserver. Usually this means you have to alter its permissions to allow anyone to read and write to it. Exactly how you should do this depends on your FTP client or server operating system.</p>
@@ -415,23 +455,35 @@
<a name="webserver_configuration"></a><h3>6.ii. Webserver configuration</h3>
- <p>Depending on your web server, you may have to configure your server to deny web access to the <code>cache/</code>, <code>files/</code>, <code>store/</code> and other directories. This is to prevent users from accessing sensitive files.</p>
-
- <p>For <strong>Apache</strong> there are <code>.htaccess</code> files already in place to do this for you. Similarly, for <strong>Windows</strong> based servers using <strong>IIS</strong> there are <code>web.config</code> files already in place to do this for you. For other webservers, you will have to adjust the configuration yourself. Sample files for <strong>nginx</strong> and <strong>lighttpd</strong> to help you get started may be found in <code>docs/</code> directory.</p>
+ <p>Depending on your web server, you may have to configure your server to deny web access to the <code>cache/</code>, <code>files/</code>, <code>includes</code>, <code>phpbb</code>, <code>store/</code>, and <code>vendor</code> directories. This is to prevent users from accessing sensitive files.</p>
+
+ <p>
+ For <strong>Apache</strong> there are <code>.htaccess</code> files already in place to do this for the most sensitive files and folders. We do however recommend to completely deny all access to the aforementioned folders and their respective subfolders in your Apache configuration.<br />
+ On Apache 2.4, denying access to the <code>phpbb</code> folder in a phpBB instance located at <code>/var/www/html/</code> would be accomplished by adding the following access rules to the Apache configuration file (typically apache.conf):
+ <pre>
+&lt;Directory /var/www/html/phpbb/*&gt;
+ Require all denied
+&lt;/Directory&gt;
+&lt;Directory /var/www/html/phpbb>
+ Require all denied
+&lt;/Directory&gt;</pre>
+ <br />
+ <p>The same settings can be applied to the other mentioned directories by replacing <code>phpbb</code> by the respective directory name. Please note that there are differences in syntax between Apache version <a href="https://httpd.apache.org/docs/2.2/howto/access.html">2.2</a> and <a href="https://httpd.apache.org/docs/2.4/howto/access.html">2.4</a>.</p>
+ <p>For <strong>Windows</strong> based servers using <strong>IIS</strong> there are <code>web.config</code> files already in place to do this for you. For other webservers, you will have to adjust the configuration yourself. Sample files for <strong>nginx</strong> and <strong>lighttpd</strong> to help you get started may be found in the <code>docs/</code> directory.</p>
</div>
<div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<hr />
-<a name="anti_spam"></a><h2>7. Anti-Spam Measures</h2>
-
+<a name="anti_spam"></a><h2>8. Anti-Spam Measures</h2>
+
<div class="paragraph">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div class="content">
<p>Like any online site that allows user input, your board could be subject to unwanted posts; often referred to as <a href="http://en.wikipedia.org/wiki/Forum_spam">forum spam</a>. The vast majority of these attacks will be from automated computer programs known as <a href="http://en.wikipedia.org/wiki/Spambot">spambots</a>. The attacks, generally, are not personal as the spammers are just trying to find accessible targets. phpBB has a number of anti-spam measures built in, including a range of CAPTCHAs. However, administrators are strongly urged to read and follow the advice for <a href="https://www.phpbb.com/support/spam/">Preventing Spam in phpBB</a> as soon as possible after completing the installation of your board.</p>
@@ -439,25 +491,25 @@
<div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<hr />
-<a name="disclaimer"></a><h2>8. Copyright and disclaimer</h2>
+<a name="disclaimer"></a><h2>9. Copyright and disclaimer</h2>
<div class="paragraph">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div class="content">
- <p>This application is opensource software released under the <a href="http://opensource.org/licenses/gpl-2.0.php">GNU General Public License v2</a>. Please see the source code and <code>docs/</code> directory for more details. This package and its contents are Copyright &copy; <a href="https://www.phpbb.com/">phpBB Group</a>, All Rights Reserved.</p>
+ <p>phpBB is free software, released under the terms of the <a href="http://opensource.org/licenses/gpl-2.0.php">GNU General Public License, version 2 (GPL-2.0)</a>. Copyright © <a href="https://www.phpbb.com">phpBB Limited</a>. For full copyright and license information, please see the docs/CREDITS.txt file.</p>
</div>
<div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<!-- END DOCUMENT -->
@@ -468,7 +520,7 @@
</div></div>
<div>
- <a id="bottom" name="bottom" accesskey="z"></a>
+ <a id="bottom" accesskey="z"></a>
</div>
</body>
diff --git a/phpBB/docs/COPYING b/phpBB/docs/LICENSE.txt
index ce992b2ce7..ce992b2ce7 100644
--- a/phpBB/docs/COPYING
+++ b/phpBB/docs/LICENSE.txt
diff --git a/phpBB/docs/README.html b/phpBB/docs/README.html
index d54c58eca6..38f74c199a 100644
--- a/phpBB/docs/README.html
+++ b/phpBB/docs/README.html
@@ -1,19 +1,13 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en" xml:lang="en">
+<!DOCTYPE html>
+<html dir="ltr" lang="en">
<head>
-
-<meta http-equiv="content-type" content="text/html; charset=utf-8" />
-<meta http-equiv="content-style-type" content="text/css" />
-<meta http-equiv="content-language" content="en" />
-<meta http-equiv="imagetoolbar" content="no" />
-<meta name="resource-type" content="document" />
-<meta name="distribution" content="global" />
-<meta name="copyright" content="phpBB Group" />
+<meta charset="utf-8">
+<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="keywords" content="" />
-<meta name="description" content="phpBB 3.0.x Readme" />
-<title>phpBB3 &bull; Readme</title>
+<meta name="description" content="phpBB 3.1.x Readme" />
+<title>phpBB &bull; Readme</title>
-<link href="stylesheet.css" rel="stylesheet" type="text/css" media="screen, projection" />
+<link href="assets/css/stylesheet.css" rel="stylesheet" type="text/css" media="screen" />
</head>
@@ -23,15 +17,15 @@
<a id="top" name="top" accesskey="t"></a>
<div id="page-header">
<div class="headerbar">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div id="doc-description">
- <a href="../index.php" id="logo"><img src="site_logo.gif" alt="" /></a>
- <h1>phpBB 3.0.x Readme</h1>
+ <a href="../index.php" id="logo"><img src="assets/images/site_logo.gif" alt="" /></a>
+ <h1>phpBB 3.1.x Readme</h1>
<p style="display: none;"><a href="#start_here">Skip</a></p>
</div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
</div>
@@ -41,25 +35,29 @@
<!-- BEGIN DOCUMENT -->
- <p>Thank you for downloading phpBB3. This README will guide you through the basics of installation and operation of phpBB3. Please ensure you read this and the accompanying documentation fully <strong>before</strong> proceeding with the installation.</p>
+ <p class="paragraph main-description">
+ Thank you for downloading phpBB. This README will guide you through the basics of installation
+ and operation of phpBB. Please ensure you read this and the accompanying documentation fully
+ <strong>before</strong> proceeding with the installation.
+ </p>
<h1>Readme</h1>
<div class="paragraph menu">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div class="content">
<ol>
- <li><a href="#install">Installing phpBB3</a></li>
- <li><a href="#run">Running phpBB3</a>
+ <li><a href="#install">Installing phpBB</a></li>
+ <li><a href="#run">Running phpBB</a>
<ol style="list-style-type: lower-roman;">
<li><a href="#i18n">Languages (Internationalisation - i18n)</a></li>
<li><a href="#styles">Styles</a></li>
- <li><a href="#mods">Modifications</a></li>
+ <li><a href="#extensions">Extensions</a></li>
</ol>
</li>
- <li><a href="#help">Getting help with phpBB3</a>
+ <li><a href="#help">Getting help with phpBB</a>
<ol style="list-style-type: lower-roman;">
<li><a href="#docs">Documentation</a></li>
<li><a href="#kb">Knowledge Base</a></li>
@@ -80,51 +78,52 @@
</div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<hr />
- <a name="install"></a><h2>1. Installing phpBB3</h2>
+ <a name="install"></a><h2>1. Installing phpBB</h2>
<div class="paragraph">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div class="content">
+ <p>Installation, update and conversion instructions can be found in the <a href="INSTALL.html">INSTALL</a> document in this directory. If you are intending on converting from a phpBB 2.0.x or 3.0.x installation we highly recommend that you backup any existing data before proceeding!</p>
- <p>Installation, update and conversion instructions can be found in the <a href="INSTALL.html">INSTALL</a> document in this directory. If you are intending on converting from a phpBB 2.0.x installation we highly recommend that you backup any existing data before proceeding!</p>
-
- <p>Users of phpBB3 Beta versions cannot directly update.</p>
+ <p>Users of phpBB 3.0 and 3.1 Beta versions cannot directly update.</p>
<p>Please note that we don't support the following installation types:</p>
<ul>
- <li>Updates from phpBB3 Beta versions to phpBB3 RC1 and higher</li>
- <li>Conversions from phpBB 2.0.x to phpBB3 Beta versions</li>
- <li>phpBB3 Beta installations</li>
+ <li>Updates from phpBB 3.0 Beta versions to phpBB 3.0 RC1 and higher</li>
+ <li>Updates from phpBB 3.1 Beta versions to phpBB 3.1 RC1 and higher</li>
+ <li>Conversions from phpBB 2.0.x to phpBB 3.0 or 3.1 Beta versions</li>
+ <li>phpBB 3.0 or 3.1 Beta installations</li>
</ul>
<p>We give support for the following installation types:</p>
<ul>
- <li>Updates from phpBB3 RC1 to the latest version</li>
+ <li>Updates from phpBB 3.0 RC1 and 3.1 RC1 to the latest version</li>
<li>Note: if using the <em>Automatic Update Package</em>, updates are supported from phpBB 3.0.2 onward. To update a pre-3.0.2 installation, first update to 3.0.2 and then update to the current version.</li>
<li>Conversions from phpBB 2.0.x to the latest version</li>
- <li>New installations of phpBB3 - only the latest released version</li>
+ <li>New installations of phpBB 3.0.x - only the latest released version</li>
+ <li>New installations of phpBB 3.1.x - only the latest released version</li>
</ul>
</div>
<div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<hr />
- <a name="run"></a><h2>2. Running phpBB3</h2>
+ <a name="run"></a><h2>2. Running phpBB</h2>
<div class="paragraph">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div class="content">
@@ -138,55 +137,55 @@
<p>This is the <em>official</em> location for all supported language sets. If you download a package from a 3rd party site you do so with the understanding that we cannot offer support. Please do not ask for support if you download a language pack from a 3rd party site.</p>
- <p>Installation of these packages is straightforward: simply download the required language pack, uncompress (unzip) it and via FTP transfer the included <code>language</code> and <code>styles</code> folders to the root of your board installation. The language can then be installed via the Administration Control Panel of your board: <code>System tab -&gt; General Tasks -&gt; Language packs</code>. A more detailed description of the process is in the Knowledge Base article, <a href="https://www.phpbb.com/kb/article/how-to-install-a-language-pack/">How to Install a Language Pack</a>.</p>
+ <p>Installation of these packages is straightforward: simply download the required language pack, uncompress (unzip) it and via FTP transfer the included <code>language</code> and <code>styles</code> folders to the root of your board installation. The language can then be installed via the Administration Control Panel of your board: <code>Customise tab -&gt; Language management -&gt; Language packs</code>. A more detailed description of the process is in the Knowledge Base article, <a href="https://www.phpbb.com/kb/article/how-to-install-a-language-pack/">How to Install a Language Pack</a>.</p>
- <p>If your language is not available, please visit our <a href="https://www.phpbb.com/community/viewforum.php?f=66">[3.0.x] Translations</a> forum where you will find topics on translations in progress. Should you wish to volunteer to translate a language not currently available or assist in maintaining an existing language pack, you can <a href="https://www.phpbb.com/languages/apply.php">Apply to become a translator</a>.</p>
+ <p>If your language is not available, please visit our <a href="https://www.phpbb.com/community/viewforum.php?f=491">[3.1.x] Translations</a> forum where you will find topics on translations in progress. Should you wish to volunteer to translate a language not currently available or assist in maintaining an existing language pack, you can <a href="https://www.phpbb.com/languages/apply.php">Apply to become a translator</a>.</p>
<a name="styles"></a><h3>2.ii. Styles</h3>
- <p>Although the phpBB Group is rather proud of the included styles, we realise that they may not be to everyone's taste. Therefore, phpBB3 allows styles to be switched with relative ease. First, you need to locate and download a style you like. You can find them listed in the <a href="https://www.phpbb.com/customise/db/styles-2/">Styles</a> section of our <a href="https://www.phpbb.com/customise/db/">Customisation Database</a>.</p>
+ <p>Although we are rather proud of the included styles, we realise that they may not be to everyone's taste. Therefore, phpBB allows styles to be switched with relative ease. First, you need to locate and download a style you like. You can find them listed in the <a href="https://www.phpbb.com/customise/db/styles-2/">Styles</a> section of our <a href="https://www.phpbb.com/customise/db/">Customisation Database</a>.</p>
<p>For more information about styles, please see: <a href="https://www.phpbb.com/styles/">https://www.phpbb.com/styles/</a></p>
<p><strong>Please note</strong> that 3rd party styles downloaded for versions of phpBB2 will <strong>not</strong> work in phpBB3. It is also important to ensure that the style is updated to match the current version of the phpBB software you are using.</p>
- <p>Once you have downloaded a style, the usual next step is to unarchive (or upload the unarchived contents of) the package into your <code>styles/</code> directory. You then need to visit <code>Administration Control Panel -&gt; Styles tab</code> where you should see the new style available. Click &quot;Install&quot; to install the style.</p>
+ <p>Once you have downloaded a style, the usual next step is to unarchive (or upload the unarchived contents of) the package into your <code>styles/</code> directory. You then need to visit <code>Administration Control Panel -&gt; Customise tab -&gt; Style management -&gt; Install Styles</code> where you should see the new style available. Click &quot;Install style&quot; to install the style.</p>
- <p><strong>Please note</strong> that to improve efficiency, the software caches certain data. For this reason, if you create your own style or modify existing ones, please remember to &quot;Refresh&quot; the appropriate style components <code>Administration Control Panel -&gt; Styles tab -&gt; Style Components</code> screen. You may also need to reload the page you have changed in your web browser to overcome browser caching. If the changed components are not refreshed you will not see your changes taking effect.</p>
+ <p><strong>Please note</strong> that to improve efficiency, the software caches certain data. For this reason, if you create your own style or modify existing ones, please remember to purge the board cache by clicking the <code>Run now</code> button next to the <code>Purge the cache</code> option in the index page of the Administration Control Panel. You may also need to reload the page you have changed in your web browser to overcome browser caching. If the cache is not purged, you will not see your changes taking effect.</p>
- <a name="mods"></a><h3>2.iii. Modifications</h3>
+ <a name="extensions"></a><h3>2.iii. Extensions</h3>
- <p>Although not officially supported by the phpBB Group, phpBB has a thriving modification scene. These third party modifications to the standard phpBB software, known as <strong>MODs</strong>, extend its capabilities still further. You can browse through many of the MODs in the <a href="https://www.phpbb.com/customise/db/modifications-1/">Modifications</a> section of our <a href="https://www.phpbb.com/customise/db/">Customisation Database</a>.</p>
+ <p>We are proud to have a thriving extensions community. These third party extensions to the standard phpBB software, extend its capabilities still further. You can browse through many of the extensions in the <a href="https://www.phpbb.com/customise/db/extensions-36">Extensions</a> section of our <a href="https://www.phpbb.com/customise/db/">Customisation Database</a>.</p>
- <p>For more information about MODs, please see: <a href="https://www.phpbb.com/mods/">https://www.phpbb.com/mods/</a></p>
+ <p>For more information about extensions, please see: <a href="https://www.phpbb.com/extensions">https://www.phpbb.com/extensions</a></p>
- <p><strong>Please remember</strong> that any bugs or other issues that occur after you have added any modification should <strong>NOT</strong> be reported to the bug tracker (see below). First remove the MOD and see if the problem is resolved. Any support for a MOD should only be sought in the &quot;Discussion/Support&quot; forum for that MOD.</p>
+ <p><strong>Please remember</strong> that any bugs or other issues that occur after you have added any extension should <strong>NOT</strong> be reported to the bug tracker (see below). First disable the extension and see if the problem is resolved. Any support for an extension should only be sought in the &quot;Discussion/Support&quot; forum for that extension.</p>
- <p>Also remember that any modifications, particularly those which modify the database in any way, may render upgrading your forum to future versions more difficult. With all this said, many users have and continue to utilise many of the MODs already available with great success.</p>
+ <p>Also remember that any extensions which modify the database in any way, may render upgrading your forum to future versions more difficult.</p>
</div>
<div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<hr />
-<a name="help"></a><h2>3. Getting help with phpBB3</h2>
+<a name="help"></a><h2>3. Getting help with phpBB</h2>
<div class="paragraph">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div class="content">
- <p>phpBB3 can sometimes seem a little daunting to new users, particularly with regards to the permission system. The first thing you should do is check the <a href="FAQ.html">FAQ</a>, which covers a few basic getting started questions. If you need additional help there are several places you can find it.</p>
+ <p>phpBB can sometimes seem a little daunting to new users, particularly with regards to the permission system. The first thing you should do is check the <a href="FAQ.html">FAQ</a>, which covers a few basic getting started questions. If you need additional help there are several places you can find it.</p>
- <a name="docs"></a><h3>3.i. phpBB3 Documentation</h3>
+ <a name="docs"></a><h3>3.i. phpBB Documentation</h3>
<p>Comprehensive documentation is now available on the phpBB website:</p>
- <p><a href="https://www.phpbb.com/support/documentation/3.0/">https://www.phpbb.com/support/documentation/3.0/</a></p>
+ <p><a href="https://www.phpbb.com/support/docs/en/3.1/ug/">https://www.phpbb.com/support/docs/en/3.1/ug/</a></p>
<p>This covers everything from installation to setting permissions and managing users.</p>
@@ -198,7 +197,7 @@
<a name="website"></a><h3>3.iii. Community Forums</h3>
- <p>The phpBB Group maintains a thriving community where a number of people have generously decided to donate their time to help support users. This site can be found at:</p>
+ <p>The phpBB project maintains a thriving community where a number of people have generously decided to donate their time to help support users. This site can be found at:</p>
<p><a href="https://www.phpbb.com/community/">https://www.phpbb.com/community/</a></p>
@@ -214,7 +213,7 @@
<div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<hr />
@@ -222,23 +221,23 @@
<a name="status"></a><h2>4. Status of this version</h2>
<div class="paragraph">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div class="content">
- <p>This is the third stable release of phpBB. The 3.0.x line is essentially feature frozen, with only point releases seeing fixes for bugs and security issues, though feature alterations and minor feature additions may be done if deemed absolutely required. Our next major release will be phpBB 3.1. Please do not post questions asking when 3.1 will be available, no release date has been set.</p>
+ <p>This is a stable release of phpBB. The 3.1.x line is feature frozen, with point releases principally including fixes for bugs and security issues. Feature alterations and minor feature additions may be done if deemed absolutely required. The next major release will be phpBB 3.2 which is currently under development. Please do not post questions asking when 3.2 will be available, no release date has been set.</p>
<p>Those interested in the development of phpBB should keep an eye on the development forums to see how things are progressing:</p>
<p><a href="http://area51.phpbb.com/phpBB/">http://area51.phpbb.com/phpBB/</a></p>
- <p>Please note that the development forums should <strong>NOT</strong> be used to seek support for or ask questions about phpBB 2.0.x or phpBB 3.0.x, the main community forums are the place for this. Any such posts will be locked and go unanswered.</p>
+ <p>Please note that the development forums should <strong>NOT</strong> be used to seek support for phpBB, the main community forums are the place for this.</p>
</div>
<div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<hr />
@@ -246,36 +245,36 @@
<a name="bugs"></a><h2>5. Reporting Bugs</h2>
<div class="paragraph">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div class="content">
- <p>The phpBB Group uses a bug tracking system to store, list and manage all reported bugs, it can be found at the location listed below. Please <strong>DO NOT</strong> post bug reports to our forums. In addition please <strong>DO NOT</strong> use the bug tracker for support requests. Posting such a request will only see you directed to the support forums (while taking time away from working on real bugs).</p>
+ <p>The phpBB developers use a bug tracking system to store, list and manage all reported bugs, it can be found at the location listed below. Please <strong>DO NOT</strong> post bug reports to our forums. In addition please <strong>DO NOT</strong> use the bug tracker for support requests. Posting such a request will only see you directed to the support forums (while taking time away from working on real bugs).</p>
<p><a href="http://tracker.phpbb.com/browse/PHPBB3">http://tracker.phpbb.com/browse/PHPBB3</a></p>
<p>While we very much appreciate receiving bug reports (the more reports the more stable phpBB will be) we ask you carry out a few steps before adding new entries:</p>
<ul>
- <li>First, determine if your bug is reproduceable; how to determine this depends on the bug in question. Only if the bug is reproduceable is it likely to be a problem with phpBB3 (or in some way connected). If something cannot be reproduced it may turn out to have been your hosting provider working on something, a user doing something silly, etc. Bug reports for non-reproduceable events can slow down our attempts to fix real, reproduceable issues<br /><br /></li>
+ <li>First, determine if your bug is reproduceable; how to determine this depends on the bug in question. Only if the bug is reproduceable is it likely to be a problem with phpBB (or in some way connected). If something cannot be reproduced it may turn out to have been your hosting provider working on something, a user doing something silly, etc. Bug reports for non-reproduceable events can slow down our attempts to fix real, reproduceable issues<br /><br /></li>
<li>Next, please read or search through the existing bug reports to see if <em>your</em> bug (or one very similar to it) is already listed. If it is please add to that existing bug rather than creating a new duplicate entry (all this does is slow us down).<br /><br /></li>
- <li>Check the forums (use search!) to see if people have discussed anything that sounds similar to what you are seeing. However, as noted above please <strong>DO NOT</strong> post your particular bug to the forum unless it's non-reproduceable or you are sure it&rsquo;s related to something you have done rather than phpBB3<br /><br /></li>
+ <li>Check the forums (use search!) to see if people have discussed anything that sounds similar to what you are seeing. However, as noted above please <strong>DO NOT</strong> post your particular bug to the forum unless it's non-reproduceable or you are sure it&rsquo;s related to something you have done rather than phpBB<br /><br /></li>
<li>If no existing bug exists then please feel free to add it</li>
</ul>
<p>If you do post a new bug (i.e. one that isn't already listed in the bug tracker) first make sure that you have logged in (your username and password are the same as for the community forums) then please include the following details:</p>
<ul>
- <li>Your server type/version, e.g. Apache 1.3.28, IIS 4, Sambar, etc.</li>
- <li>PHP version and mode of operation, e.g. PHP 5.1.1 as a module, PHP 4.4.4 running as CGI, etc.</li>
- <li>DB type/version, e.g. MySQL 4.0.1, PostgreSQL 7.3.2, MSSQL Server 2000 SP1, etc.</li>
+ <li>Your server type/version, e.g. Apache 2.2.3, IIS 7, Sambar, etc.</li>
+ <li>PHP version and mode of operation, e.g. PHP 5.3.3 as a module, PHP 5.4.0 running as CGI, etc.</li>
+ <li>DB type/version, e.g. MySQL 5.0.77, PostgreSQL 9.0.6, MSSQL Server 2000 SP1, etc.</li>
</ul>
<p>The relevant database type/version is listed within the administration control panel.</p>
- <p>Please be as detailed as you can in your report, and if possible, list the steps required to duplicate the problem. If you have a patch that fixes the issue, please attach it to the ticket or submit a pull request to our repository <a href="https://github.com/phpbb/phpbb3">on GitHub</a>.</p>
+ <p>Please be as detailed as you can in your report, and if possible, list the steps required to duplicate the problem. If you have a patch that fixes the issue, please attach it to the ticket or submit a pull request to our repository <a href="https://github.com/phpbb/phpbb">on GitHub</a>.</p>
- <p>If you create a patch, it is very much appreciated (but not required) if you follow the phpBB coding guidelines. Please note that the coding guidelines are somewhat different between different versions of phpBB. For phpBB 3.0.x the coding guidelines may be found here: <a href="http://area51.phpbb.com/docs/30x/coding-guidelines.html">http://area51.phpbb.com/docs/30x/coding-guidelines.html</a></p>
+ <p>If you create a patch, it is very much appreciated (but not required) if you follow the phpBB coding guidelines. Please note that the coding guidelines are somewhat different between different versions of phpBB. For phpBB 3.1.x the coding guidelines may be found here: <a href="http://area51.phpbb.com/docs/31x/coding-guidelines.html">http://area51.phpbb.com/docs/31x/coding-guidelines.html</a></p>
<p>Once a bug has been submitted you will be emailed any follow up comments added to it. <strong>Please</strong> if you are requested to supply additional information, do so! It is frustrating for us to receive bug reports, ask for additional information but get nothing. In these cases we have a policy of closing the bug, which may leave a very real problem in place. Obviously we would rather not have this situation arise.</p>
@@ -289,7 +288,7 @@
<div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<hr />
@@ -297,7 +296,7 @@
<a name="curbugs"></a><h2>6. Overview of current bug list</h2>
<div class="paragraph">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div class="content">
@@ -313,7 +312,7 @@
<div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<hr />
@@ -321,15 +320,15 @@
<a name="php"></a><h2>7. PHP compatibility issues</h2>
<div class="paragraph">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div class="content">
- <p>phpBB is no longer supported on PHP3 due to several compatibility issues and we recommend that you upgrade to the latest stable release of PHP5 to run phpBB. The minimum version required is PHP 4.3.3. The minimum version that will be required for phpBB 3.1 is PHP 5.3.3.</p>
+ <p>phpBB 3.1.x takes advantage of new features added in PHP 5.3. We recommend that you upgrade to the latest stable release of PHP5 to run phpBB. The minimum version required is PHP 5.3.3 and the maximum supported version is any version prior to PHP 7.0.</p>
- <p>Please remember that running any application on a development (unstable, e.g. a beta release) version of PHP can lead to strange/unexpected results which may appear to be bugs in the application. Therefore, we recommend you upgrade to the newest stable version of PHP before running phpBB3. If you are running a development version of PHP please check any bugs you find on a system running a stable release before submitting.</p>
+ <p>Please remember that running any application on a development (unstable, e.g. a beta release) version of PHP can lead to strange/unexpected results which may appear to be bugs in the application. Therefore, we recommend you upgrade to the newest stable version of PHP before running phpBB. If you are running a development version of PHP please check any bugs you find on a system running a stable release before submitting.</p>
- <p>This board has been developed and tested under Linux and Windows (amongst others) running Apache using MySQL 3.23, 4.x, 5.x, MariaDB 5.x, MSSQL Server 2000, PostgreSQL 7.x, Oracle 8, SQLite 2 and Firebird. Versions of PHP used range from 4.3.3 to 5.4.x without problem. </p>
+ <p>This board has been developed and tested under Linux and Windows (amongst others) running Apache using MySQL 3.23, 4.x, 5.x, MariaDB 5.x, MSSQL Server 2000, PostgreSQL 8.x, Oracle 8, SQLite 2 and SQLite 3. Versions of PHP used range from 5.3.x to 5.4.x without problem.</p>
<a name="phpsec"></a><h3>7.i. Notice on PHP security issues</h3>
@@ -339,7 +338,7 @@
<div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<hr />
@@ -347,17 +346,17 @@
<a name="disclaimer"></a><h2>8. Copyright and disclaimer</h2>
<div class="paragraph">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div class="content">
- <p>This application is opensource software released under the <a href="http://opensource.org/licenses/gpl-2.0.php">GNU General Public License v2</a>. Please see source code and the docs directory for more details. This package and its contents are Copyright &copy; <a href="https://www.phpbb.com/">phpBB Group</a>, All Rights Reserved.</p>
+ <p>phpBB is free software, released under the terms of the <a href="http://opensource.org/licenses/gpl-2.0.php">GNU General Public License, version 2 (GPL-2.0)</a>. Copyright © <a href="https://www.phpbb.com">phpBB Limited</a>. For full copyright and license information, please see the docs/CREDITS.txt file.</p>
</div>
<div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<!-- END DOCUMENT -->
@@ -368,7 +367,7 @@
</div></div>
<div>
- <a id="bottom" name="bottom" accesskey="z"></a>
+ <a id="bottom" accesskey="z"></a>
</div>
</body>
diff --git a/phpBB/docs/assets/css/stylesheet.css b/phpBB/docs/assets/css/stylesheet.css
new file mode 100644
index 0000000000..c090ab7e07
--- /dev/null
+++ b/phpBB/docs/assets/css/stylesheet.css
@@ -0,0 +1,337 @@
+/*
+ The original "prosilver" theme for phpBB3
+ Created by subBlue design :: http://www.subBlue.com
+*/
+
+* { margin: 0; padding: 0; }
+
+html { font-size: 100%; height: 100%; margin-bottom: 1px; }
+
+body {
+ font-family: Verdana, Helvetica, Arial, sans-serif;
+ color: #828282;
+ background-color: #FFFFFF;
+ font-size: 10px;
+ margin: 0;
+ padding: 12px 0;
+}
+
+img { border-width: 0; }
+
+ul, ol {
+ font-size: 1.1em;
+}
+
+ul ul, ol ol {
+ font-size: inherit;
+}
+
+p {
+ line-height: 1.3em;
+ font-size: 1.1em;
+ margin-bottom: 1.5em;
+}
+
+hr {
+ border: 0 none #FFFFFF;
+ border-top: 1px solid #CCCCCC;
+ height: 1px;
+ margin: 5px 0;
+ display: block;
+ clear: both;
+}
+
+html, body {
+ color: #536482;
+ background-color: #FFFFFF;
+}
+
+#doc-description h1 {
+ font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
+ margin-right: 200px;
+ color: #FFFFFF;
+ margin-top: 15px;
+ font-weight: bold;
+ font-size: 2em;
+ color: #fff;
+}
+
+h1 {
+ font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
+ font-weight: normal;
+ color: #000;
+ font-size: 2em;
+ margin: 0.8em 0 0.2em 0;
+}
+
+h2 {
+ font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
+ font-weight: normal;
+ color: #28313F;
+ font-size: 1.5em;
+ margin: 0.8em 0 0.2em 0;
+}
+
+h3 {
+ font-family: Arial, Helvetica, sans-serif;
+ font-weight: bold;
+ border-bottom: 1px solid #CCCCCC;
+ margin-bottom: 3px;
+ padding-bottom: 2px;
+ font-size: 1.1em;
+ color: #115098;
+ margin-top: 20px;
+}
+
+h4 {
+ font-family: Arial, Helvetica, sans-serif;
+ font-weight: bold;
+ margin-bottom: 3px;
+ padding-bottom: 2px;
+ font-size: 1.1em;
+ color: #115098;
+ margin-top: 20px;
+}
+
+.good { color: green; }
+.bad { color: red; }
+
+.version {
+ margin-top: 20px;
+ text-align: left;
+ font-size: 70%;
+ color: #006600;
+ border-top: 1px solid #ccc;
+}
+
+code {
+ color: #006600;
+ font-weight: normal;
+ font-family: 'Courier New', monospace;
+ border-color: #D1D7DC;
+ border-width: 1px;
+ border-style: solid;
+ background-color: #FAFAFA;
+ padding: 0 4px;
+}
+
+pre {
+ color: #006600;
+ font-weight: normal;
+ font-family: 'Courier New', monospace;
+ border-color: #D1D7DC;
+ border-width: 1px;
+ border-style: solid;
+ background-color: #FAFAFA;
+ padding: 0 4px
+}
+
+#wrap {
+ padding: 0 20px;
+ min-width: 650px;
+}
+
+#simple-wrap {
+ padding: 6px 10px;
+}
+
+#page-body {
+ margin: 4px 0;
+ clear: both;
+}
+
+#page-footer {
+ clear: both;
+}
+
+#logo {
+ float: left;
+ width: auto;
+ padding: 10px 13px 0 10px;
+}
+
+a#logo:hover {
+ text-decoration: none;
+}
+
+#doc-description {
+ float: left;
+ width: 70%;
+}
+
+#doc-description h1 {
+ margin-right: 0;
+}
+
+.headerbar {
+ background: #ebebeb none repeat-x 0 0;
+ border-radius: 7px;
+ color: #FFFFFF;
+ margin-bottom: 4px;
+ padding: 5px;
+}
+
+.paragraph {
+ border-radius: 7px;
+ font-size: 1.1em;
+ padding: 5px 10px;
+ margin-bottom: 4px;
+ background-repeat: no-repeat;
+ background-position: 100% 0;
+ background-color: #ECF3F7;
+}
+
+.paragraph:target .content {
+ color: #000000;
+}
+
+.paragraph:target h3 a {
+ color: #000000;
+}
+
+.main-description {
+ font-size: 1.15em;
+}
+
+.content {
+ color: #333333;
+}
+
+.content h2, .panel h2 {
+ color: #115098;
+ border-bottom-color: #CCCCCC;
+}
+
+a:link { color: #898989; text-decoration: none; }
+a:visited { color: #898989; text-decoration: none; }
+a:hover { color: #d3d3d3; text-decoration: underline; }
+a:active { color: #d2d2d2; text-decoration: none; }
+
+hr {
+ border-color: #FFFFFF;
+ border-top-color: #CCCCCC;
+}
+
+.menu {
+ background-color: #cadceb;
+}
+
+.headerbar {
+ background-color: #12A3EB;
+ background-image: url("../images/bg_header.gif");
+ color: #FFFFFF;
+}
+
+.panel {
+ background-color: #ECF1F3;
+ color: #28313F;
+}
+
+.error {
+ color: #BC2A4D;
+}
+
+a:link { color: #105289; }
+a:visited { color: #105289; }
+a:hover { color: #D31141; }
+a:active { color: #368AD2; }
+
+.content {
+ padding: 0;
+ line-height: 1.48em;
+ color: #333333;
+}
+
+.content h2, .panel h2 {
+ color: #115098;
+ border-bottom-color: #CCCCCC;
+}
+
+.notice {
+ border-top-color: #CCCCCC;
+}
+
+.codebox {
+ padding: 3px;
+ background-color: #FFFFFF;
+ border: 1px solid #C9D2D8;
+ font-size: 1em;
+ margin-bottom: 10px;
+ display: block;
+ font: 0.9em Monaco, "Andale Mono","Courier New", Courier, mono;
+ line-height: 1.3em;
+}
+
+* html hr { margin: 0; }
+
+.top {
+ background: url("../images/icon_back_top.gif") no-repeat top left;
+ text-decoration: none;
+ width: 11px;
+ height: 11px;
+ display: block;
+ float: right;
+ overflow: hidden;
+ letter-spacing: 1000px;
+ text-indent: 11px;
+}
+
+.content ol, .content ul {
+ margin-left: 25px;
+ margin-top: 0;
+}
+
+.content ul + p, .content ul + div {
+ margin-top: 20px;
+}
+
+.comment {
+ color: green;
+}
+
+.indent {
+ margin-left: 20px;
+}
+
+.paragraph table {
+ font-size: 8pt;
+ border-collapse: collapse;
+ border: 1px solid #cfcfcf;
+ margin-bottom: 20px;
+}
+
+.paragraph table caption {
+ display: none;
+}
+
+.paragraph table thead {
+ background-color: #cadceb;
+ color: #000;
+}
+
+.paragraph table td, .paragraph table th {
+ border: 1px solid #006699;
+ padding: 0.5em;
+ background-color: #e1ebf2;
+}
+
+.paragraph table th {
+ background-color: #cadceb;
+}
+
+.paragraph table td dl {
+ margin: 0;
+ padding: 0;
+}
+
+.paragraph table td dl dt {
+ float: left;
+ clear: both;
+ margin-right: 1em;
+}
+
+.inner:after {
+ clear: both;
+ content: '';
+ display: block;
+}
diff --git a/phpBB/docs/bg_header.gif b/phpBB/docs/assets/images/bg_header.gif
index 351de9f46a..351de9f46a 100644
--- a/phpBB/docs/bg_header.gif
+++ b/phpBB/docs/assets/images/bg_header.gif
Binary files differ
diff --git a/phpBB/styles/prosilver/imageset/icon_back_top.gif b/phpBB/docs/assets/images/icon_back_top.gif
index 4d2b8f3822..4d2b8f3822 100644
--- a/phpBB/styles/prosilver/imageset/icon_back_top.gif
+++ b/phpBB/docs/assets/images/icon_back_top.gif
Binary files differ
diff --git a/phpBB/styles/prosilver/imageset/site_logo.gif b/phpBB/docs/assets/images/site_logo.gif
index 2517fbedd6..2517fbedd6 100644
--- a/phpBB/styles/prosilver/imageset/site_logo.gif
+++ b/phpBB/docs/assets/images/site_logo.gif
Binary files differ
diff --git a/phpBB/docs/auth_api.html b/phpBB/docs/auth_api.html
index eb168e26a6..960fa76417 100644
--- a/phpBB/docs/auth_api.html
+++ b/phpBB/docs/auth_api.html
@@ -1,19 +1,13 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en" xml:lang="en">
+<!DOCTYPE html>
+<html dir="ltr" lang="en">
<head>
-
-<meta http-equiv="content-type" content="text/html; charset=utf-8" />
-<meta http-equiv="content-style-type" content="text/css" />
-<meta http-equiv="content-language" content="en" />
-<meta http-equiv="imagetoolbar" content="no" />
-<meta name="resource-type" content="document" />
-<meta name="distribution" content="global" />
-<meta name="copyright" content="phpBB Group" />
+<meta charset="utf-8">
+<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="keywords" content="" />
<meta name="description" content="This is an explanation of how to use the phpBB auth/acl API" />
<title>phpBB3 &bull; Auth API</title>
-<link href="stylesheet.css" rel="stylesheet" type="text/css" media="screen, projection" />
+<link href="assets/css/stylesheet.css" rel="stylesheet" type="text/css" media="screen" />
</head>
@@ -23,16 +17,16 @@
<a id="top" name="top" accesskey="t"></a>
<div id="page-header">
<div class="headerbar">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div id="doc-description">
- <a href="../index.php" id="logo"><img src="site_logo.gif" alt="" /></a>
+ <a href="../index.php" id="logo"><img src="assets/images/site_logo.gif" alt="" /></a>
<h1>Auth API</h1>
<p>This is an explanation of how to use the phpBB auth/acl API</p>
<p style="display: none;"><a href="#start_here">Skip</a></p>
</div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
</div>
@@ -42,12 +36,12 @@
<!-- BEGIN DOCUMENT -->
- <p>This is an explanation of how to use the phpBB auth/acl API.</p>
+ <p class="paragraph main-description">This is an explanation of how to use the phpBB auth/acl API.</p>
<h1>Auth API</h1>
<div class="paragraph menu">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div class="content">
@@ -72,7 +66,7 @@
</div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<hr />
@@ -80,7 +74,7 @@
<a name="intro"></a><h2>1. Introduction</h2>
<div class="paragraph">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div class="content">
@@ -93,8 +87,8 @@
<p>To use any methods contained with the <code>auth</code> class it first needs to be instantiated. This is best achieved early in the execution of the script in the following manner:</p>
<div class="codebox"><pre>
-$auth = new auth();
- </pre></div>
+$auth = new phpbb\auth\auth();</pre>
+ </div>
<p>Once an instance of the class has been created you are free to call the various methods it contains. Please note that should you wish to use the <code>auth_admin</code> methods you will need to instantiate this separately but in the same way.</p>
@@ -102,7 +96,7 @@ $auth = new auth();
<div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<hr />
@@ -110,19 +104,19 @@ $auth = new auth();
<a name="methods"></a><h2>2. Methods</h2>
<div class="paragraph">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div class="content">
<p>Following are the methods you are able to use.</p>
<a name="acl"></a><h3>2.i. acl</h3>
-
+
<p>The <code>acl</code> method is the initialisation routine for all the acl functions. If you intend calling any acl method you must first call this. The method takes as its one and only required parameter an associative array containing user information as stored in the database. This array must contain at least the following information; user_id, user_permissions and user_type. It is called in the following way:</p>
<div class="codebox"><pre>
-$auth-&gt;acl(<code>userdata</code>);
- </pre></div>
+$auth-&gt;acl(<code>userdata</code>);</pre>
+ </div>
<p>Where userdata is the array containing the aforementioned data.</p>
@@ -131,8 +125,8 @@ $auth-&gt;acl(<code>userdata</code>);
<p>This method is the primary way of determining what a user can and cannot do for a given option globally or in a given forum. The method should be called in the following way:</p>
<div class="codebox"><pre>
-$result = $auth-&gt;acl_get(<code>option</code>[, <code>forum</code>]);
- </pre></div>
+$result = $auth-&gt;acl_get(<code>option</code>[, <code>forum</code>]);</pre>
+ </div>
<p>Where option is a string representing the required option, e.g. 'f_list', 'm_edit', 'a_adduser', etc. By adding a ! in front of the option, e.g. '!f_list' the result of this method will be negated. The optional forum term is the integer forum_id.</p>
@@ -149,8 +143,8 @@ $result = $auth-&gt;acl_get(<code>option</code>[, <code>forum</code>]);
<p>The method should be called thus:</p>
<div class="codebox"><pre>
-$result = $auth-&gt;acl_gets(<code>option1</code>[, <code>option2</code>, ..., <code>optionN</code>, <code>forum</code>]);
- </pre></div>
+$result = $auth-&gt;acl_gets(<code>option1</code>[, <code>option2</code>, ..., <code>optionN</code>, <code>forum</code>]);</pre>
+ </div>
<p>As with the <code>acl_get</code> method the options are strings representing the required permissions to check. The forum again is an integer representing a given forum_id.</p>
@@ -161,16 +155,16 @@ $result = $auth-&gt;acl_gets(<code>option1</code>[, <code>option2</code>, ..., <
<p>This method is used to find out in which forums a user is allowed to carry out an operation or to find out in which forums he is not allowed to carry out an operation. The method should be called in the following way:</p>
<div class="codebox"><pre>
-$result = $auth-&gt;acl_getf(<code>option</code>[, <code>clean</code>]);
- </pre></div>
+$result = $auth-&gt;acl_getf(<code>option</code>[, <code>clean</code>]);</pre>
+ </div>
<p>Just like in the <code>acl_get</code> method the option is a string specifying the permission which has to be checked (negation using ! is allowed). The second parameter is a boolean. If it is set to false this method returns all forums with either zero or a positive integer. If it is set to true only those forums with a positive integer as the result will be returned.</p>
<p>The method returns an associative array of the form:</p>
<div class="codebox"><pre>
-array(<em>forum_id1</em> =&gt; array(<em>option</em> =&gt; <em>integer</em>), <em>forum_id2</em> =&gt; ...)
- </pre></div>
+array(<em>forum_id1</em> =&gt; array(<em>option</em> =&gt; <em>integer</em>), <em>forum_id2</em> =&gt; ...)</pre>
+ </div>
<p>Where option is the option passed to the method and integer is either zero or a positive integer and the same <code>acl_get(option, forum_id)</code> would return.</p>
@@ -179,8 +173,8 @@ array(<em>forum_id1</em> =&gt; array(<em>option</em> =&gt; <em>integer</em>), <e
<p>This method is used to find out whether a user has a permission in at least one forum or globally. This method is similar to checking whether <code>acl_getf(option, true)</code> returned one or more forums but it's faster. It should be called in the following way:</p>
<div class="codebox"><pre>
-$result = $auth-&gt;acl_getf_global(<code>option</code>)
- </pre></div>
+$result = $auth-&gt;acl_getf_global(<code>option</code>)</pre>
+ </div>
<p>As with the previous methods option is a string specifying the permission which has to be checked.</p>
@@ -237,7 +231,7 @@ $result = $auth-&gt;acl_get_list($user_id, $permissions, $forum_id);
<div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<hr />
@@ -245,7 +239,7 @@ $result = $auth-&gt;acl_get_list($user_id, $permissions, $forum_id);
<a name="admin_related"></a><h2>3. Admin related functions</h2>
<div class="paragraph">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div class="content">
@@ -254,8 +248,8 @@ $result = $auth-&gt;acl_get_list($user_id, $permissions, $forum_id);
<p>To use any methods this class contains it first needs to be instantiated separately from <code>auth</code>. This is achieved in the same way as <code>auth</code>:</p>
<div class="codebox"><pre>
-$auth_admin = new auth_admin();
- </pre></div>
+$auth_admin = new auth_admin();</pre>
+ </div>
<p>This instance gives you access to both the methods of this specific class and that of <code>auth</code>.</p>
@@ -263,7 +257,7 @@ $auth_admin = new auth_admin();
<div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<hr />
@@ -271,17 +265,17 @@ $auth_admin = new auth_admin();
<a name="disclaimer"></a><h2>4. Copyright and disclaimer</h2>
<div class="paragraph">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div class="content">
- <p>This application is opensource software released under the <a href="http://opensource.org/licenses/gpl-2.0.php">GNU General Public License v2</a>. Please see source code and the docs directory for more details. This package and its contents are Copyright (c) <a href="https://www.phpbb.com/">phpBB Group</a>, All Rights Reserved.</p>
+ <p>phpBB is free software, released under the terms of the <a href="http://opensource.org/licenses/gpl-2.0.php">GNU General Public License, version 2 (GPL-2.0)</a>. Copyright © <a href="https://www.phpbb.com">phpBB Limited</a>. For full copyright and license information, please see the docs/CREDITS.txt file.</p>
</div>
<div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<!-- END DOCUMENT -->
@@ -292,7 +286,7 @@ $auth_admin = new auth_admin();
</div></div>
<div>
- <a id="bottom" name="bottom" accesskey="z"></a>
+ <a id="bottom" accesskey="z"></a>
</div>
</body>
diff --git a/phpBB/docs/coding-guidelines.html b/phpBB/docs/coding-guidelines.html
index f3d161589b..56b71006c7 100644
--- a/phpBB/docs/coding-guidelines.html
+++ b/phpBB/docs/coding-guidelines.html
@@ -1,19 +1,13 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en" xml:lang="en">
+<!DOCTYPE html>
+<html dir="ltr" lang="en">
<head>
-
-<meta http-equiv="content-type" content="text/html; charset=utf-8" />
-<meta http-equiv="content-style-type" content="text/css" />
-<meta http-equiv="content-language" content="en" />
-<meta http-equiv="imagetoolbar" content="no" />
-<meta name="resource-type" content="document" />
-<meta name="distribution" content="global" />
-<meta name="copyright" content="phpBB Group" />
+<meta charset="utf-8">
+<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="keywords" content="" />
-<meta name="description" content="Olympus coding guidelines document" />
+<meta name="description" content="Ascraeus coding guidelines document" />
<title>phpBB3 &bull; Coding Guidelines</title>
-<link href="stylesheet.css" rel="stylesheet" type="text/css" media="screen, projection" />
+<link href="assets/css/stylesheet.css" rel="stylesheet" type="text/css" media="screen" />
</head>
@@ -23,16 +17,16 @@
<a id="top" name="top" accesskey="t"></a>
<div id="page-header">
<div class="headerbar">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div id="doc-description">
- <a href="../index.php" id="logo"><img src="site_logo.gif" alt="" /></a>
+ <a href="../index.php" id="logo"><img src="assets/images/site_logo.gif" alt="" /></a>
<h1>Coding Guidelines</h1>
- <p>Olympus coding guidelines document</p>
+ <p>Ascraeus coding guidelines document</p>
<p style="display: none;"><a href="#start_here">Skip</a></p>
</div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
</div>
@@ -42,12 +36,14 @@
<!-- BEGIN DOCUMENT -->
-<p>These are the phpBB Coding Guidelines for Olympus, all attempts should be made to follow them as closely as possible.</p>
+<p class="paragraph main-description">
+ These are the phpBB Coding Guidelines for Ascraeus, all attempts should be made to follow them as closely as possible.
+</p>
<h1>Coding Guidelines</h1>
<div class="paragraph menu">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div class="content">
@@ -62,11 +58,12 @@
</li>
<li><a href="#code">Code Layout/Guidelines</a>
<ol style="list-style-type: lower-roman;">
- <li><a href="#namingvars">Variable/Function Naming</a></li>
+ <li><a href="#namingvars">Variable/Function/Class Naming</a></li>
<li><a href="#codelayout">Code Layout</a></li>
<li><a href="#sql">SQL/SQL Layout</a></li>
<li><a href="#optimizing">Optimizations</a></li>
<li><a href="#general">General Guidelines</a></li>
+ <li><a href="#phprestrictions">Restrictions on the Use of PHP</a></li>
</ol>
</li>
<li><a href="#styling">Styling</a>
@@ -77,13 +74,16 @@
<li><a href="#templating">Templating</a>
<ol style="list-style-type: lower-roman;">
<li><a href="#templates">General Templating</a></li>
- <li><a href="#inheritance">Template Inheritance</a></li>
+ <li><a href="#stylestree">Styles Tree</a></li>
+ <li><a href="#template-events">Template Events</a></li>
</ol></li>
<li><a href="#charsets">Character Sets and Encodings</a></li>
<li><a href="#translation">Translation (<abbr title="Internationalisation">i18n</abbr>/<abbr title="Localisation">L10n</abbr>) Guidelines</a>
<ol style="list-style-type: lower-roman;">
<li><a href="#standardisation">Standardisation</a></li>
<li><a href="#otherconsiderations">Other considerations</a></li>
+ <li><a href="#placeholders">Working with placeholders</a></li>
+ <li><a href="#usingplurals">Using plurals</a></li>
<li><a href="#writingstyle">Writing Style</a></li>
</ol>
</li>
@@ -92,7 +92,7 @@
</div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<hr />
@@ -100,7 +100,7 @@
<a name="defaults"></a><h2>1. Defaults</h2>
<div class="paragraph">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div class="content">
@@ -111,16 +111,16 @@
<p>Tabs in front of lines are no problem, but having them within the text can be a problem if you do not set it to the amount of spaces every one of us uses. Here is a short example of how it should look like:</p>
<div class="codebox"><pre>
-{TAB}$mode{TAB}{TAB}= request_var('mode', '');
-{TAB}$search_id{TAB}= request_var('search_id', '');
- </pre></div>
+{TAB}$mode{TAB}{TAB}= $request->variable('mode', '');
+{TAB}$search_id{TAB}= $request->variable('search_id', '');</pre>
+ </div>
<p>If entered with tabs (replace the {TAB}) both equal signs need to be on the same column.</p>
<h3>Linefeeds:</h3>
<p>Ensure that your editor is saving files in the UNIX (LF) line ending format. This means that lines are terminated with a newline, not with Windows Line endings (CR/LF combo) as they are on Win32 or Classic Mac (CR) Line endings. Any decent editor should be able to do this, but it might not always be the default setting. Know your editor. If you want advice for an editor for your Operating System, just ask one of the developers. Some of them do their editing on Win32.</p>
- <a name="fileheader"></a><h3>1.ii. File Header</h3>
+ <a name="fileheader"></a><h3>1.ii. File Layout</h3>
<h4>Standard header for new files:</h4>
<p>This template of the header must be included at the start of all phpBB files: </p>
@@ -128,15 +128,27 @@
<div class="codebox"><pre>
/**
*
-* @package {PACKAGENAME}
-* @copyright (c) 2007 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
*
-*/
- </pre></div>
+* @copyright (c) phpBB Limited &lt;https://www.phpbb.com&gt;
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/</pre>
+ </div>
<p>Please see the <a href="#locations">File Locations section</a> for the correct package name.</p>
+ <h4>PHP closing tags</h4>
+
+ <p>A file containg only PHP code should not end with the optional PHP closing tag <strong>?&gt;</strong> to avoid issues with whitespace following it.</p>
+
+ <h4>Newline at end of file</h4>
+
+ <p>All files should end in a newline so the last line does not appear as modified in diffs, when a line is appended to the file.</p>
+
<h4>Files containing inline code:</h4>
<p>For those files you have to put an empty comment directly after the header to prevent the documentor assigning the header to the first code element found.</p>
@@ -148,8 +160,8 @@
/**
*/
-{CODE}
- </pre></div>
+{CODE}</pre>
+ </div>
<h4>Files containing only functions:</h4>
@@ -176,8 +188,8 @@ Small code snipped, mostly one or two defines or an if statement
/**
* {DOCUMENTATION}
*/
-class ...
- </pre></div>
+class ...</pre>
+ </div>
<a name="locations"></a><h3>1.iii. File Locations</h3>
@@ -187,19 +199,12 @@ class ...
<ul>
<li><strong>phpBB3</strong><br />Core files and all files not assigned to a separate package</li>
- <li><strong>acm</strong><br /><code>/includes/acm</code>, <code>/includes/cache.php</code><br />Cache System</li>
+ <li><strong>acm</strong><br /><code>/phpbb/cache</code><br />Cache System</li>
<li><strong>acp</strong><br /><code>/adm</code>, <code>/includes/acp</code>, <code>/includes/functions_admin.php</code><br />Administration Control Panel</li>
- <li><strong>dbal</strong><br /><code>/includes/db</code><br />Database Abstraction Layer.<br />Base class is <code>dbal</code>
+ <li><strong>dbal</strong><br /><code>/phpbb/db</code>, <code>/includes/db</code><br />Database Abstraction Layer.
<ul>
- <li><code>/includes/db/dbal.php</code><br />Base DBAL class, defining the overall framework</li>
- <li><code>/includes/db/firebird.php</code><br />Firebird/Interbase Database Abstraction Layer</li>
- <li><code>/includes/db/msssql.php</code><br />MSSQL Database Abstraction Layer</li>
- <li><code>/includes/db/mssql_odbc.php</code><br />MSSQL ODBC Database Abstraction Layer for MSSQL</li>
- <li><code>/includes/db/mysql.php</code><br />MySQL Database Abstraction Layer for MySQL 3.x/4.0.x/4.1.x/5.x</li>
- <li><code>/includes/db/mysqli.php</code><br />MySQLi Database Abstraction Layer</li>
- <li><code>/includes/db/oracle.php</code><br />Oracle Database Abstraction Layer</li>
- <li><code>/includes/db/postgres.php</code><br />PostgreSQL Database Abstraction Layer</li>
- <li><code>/includes/db/sqlite.php</code><br />Sqlite Database Abstraction Layer</li>
+ <li><code>/phpbb/db/driver/</code><br />Database Abstraction Layer classes</li>
+ <li><code>/phpbb/db/migration/</code><br />Migrations are used for updating the database from one release to another</li>
</ul>
</li>
<li><strong>diff</strong><br /><code>/includes/diff</code><br />Diff Engine</li>
@@ -207,13 +212,13 @@ class ...
<li><strong>images</strong><br /><code>/images</code><br />All global images not connected to styles</li>
<li><strong>install</strong><br /><code>/install</code><br />Installation System</li>
<li><strong>language</strong><br /><code>/language</code><br />All language files</li>
- <li><strong>login</strong><br /><code>/includes/auth</code><br />Login Authentication Plugins</li>
+ <li><strong>login</strong><br /><code>/phpbb/auth</code><br />Login Authentication Plugins</li>
<li><strong>VC</strong><br /><code>/includes/captcha</code><br />CAPTCHA</li>
<li><strong>mcp</strong><br /><code>mcp.php</code>, <code>/includes/mcp</code>, <code>report.php</code><br />Moderator Control Panel</li>
<li><strong>ucp</strong><br /><code>ucp.php</code>, <code>/includes/ucp</code><br />User Control Panel</li>
<li><strong>utf</strong><br /><code>/includes/utf</code><br />UTF8-related functions/classes</li>
- <li><strong>search</strong><br /><code>/includes/search</code>, <code>search.php</code><br />Search System</li>
- <li><strong>styles</strong><br /><code>/styles</code>, <code>style.php</code><br />phpBB Styles/Templates/Themes/Imagesets</li>
+ <li><strong>search</strong><br /><code>/phpbb/search</code>, <code>search.php</code><br />Search System</li>
+ <li><strong>styles</strong><br /><code>/styles</code><br />phpBB Styles/Templates/Themes</li>
</ul>
<a name="constants"></a><h3>1.iv. Special Constants</h3>
@@ -246,18 +251,17 @@ PHPBB_QA (Set board to QA-Mode, which means the updater also c
<p>If the <code>PHPBB_USE_BOARD_URL_PATH</code> constant is set to true, phpBB uses generate_board_url() (this will return the boards url with the script path included) on all instances where web-accessible images are loaded. The exact locations are:</p>
<ul>
- <li>/includes/session.php - user::img()</li>
+ <li>/phpbb/user.php - \phpbb\user::img()</li>
<li>/includes/functions_content.php - smiley_text()</li>
</ul>
<p>Path locations for the following template variables are affected by this too:</p>
<ul>
+ <li>{T_ASSETS_PATH} - assets (non-style specific, static resources)</li>
<li>{T_THEME_PATH} - styles/xxx/theme</li>
<li>{T_TEMPLATE_PATH} - styles/xxx/template</li>
<li>{T_SUPER_TEMPLATE_PATH} - styles/xxx/template</li>
- <li>{T_IMAGESET_PATH} - styles/xxx/imageset</li>
- <li>{T_IMAGESET_LANG_PATH} - styles/xxx/imageset/yy</li>
<li>{T_IMAGES_PATH} - images/</li>
<li>{T_SMILIES_PATH} - $config['smilies_path']/</li>
<li>{T_AVATAR_PATH} - $config['avatar_path']/</li>
@@ -265,7 +269,7 @@ PHPBB_QA (Set board to QA-Mode, which means the updater also c
<li>{T_ICONS_PATH} - $config['icons_path']/</li>
<li>{T_RANKS_PATH} - $config['ranks_path']/</li>
<li>{T_UPLOAD_PATH} - $config['upload_path']/</li>
- <li>{T_STYLESHEET_LINK} - styles/xxx/theme/stylesheet.css (or link to style.php if css is parsed dynamically)</li>
+ <li>{T_STYLESHEET_LINK} - styles/xxx/theme/stylesheet.css</li>
<li>New template variable {BOARD_URL} for the board url + script path.</li>
</ul>
@@ -273,7 +277,7 @@ PHPBB_QA (Set board to QA-Mode, which means the updater also c
<div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<hr />
@@ -281,23 +285,29 @@ PHPBB_QA (Set board to QA-Mode, which means the updater also c
<a name="code"></a><h2>2. Code Layout/Guidelines</h2>
<div class="paragraph">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div class="content">
<p>Please note that these guidelines apply to all php, html, javascript and css files.</p>
- <a name="namingvars"></a><h3>2.i. Variable/Function Naming</h3>
+ <a name="namingvars"></a><h3>2.i. Variable/Function/Class Naming</h3>
<p>We will not be using any form of hungarian notation in our naming conventions. Many of us believe that hungarian naming is one of the primary code obfuscation techniques currently in use.</p>
<h4>Variable Names:</h4>
- <p>Variable names should be in all lowercase, with words separated by an underscore, example:</p>
+ <p>In PHP, variable names should be in all lowercase, with words separated by an underscore, example:</p>
<div class="indent">
<p><code>$current_user</code> is right, but <code>$currentuser</code> and <code> $currentUser</code> are not.</p>
</div>
+ <p>In JavaScript, variable names should use camel case:</p>
+
+ <div class="indent">
+ <p><code>currentUser</code> is right, but <code>currentuser</code> and <code>current_user</code> are not.</p>
+ </div>
+
<p>Names should be descriptive, but concise. We don't want huge sentences as our variable names, but typing an extra couple of characters is always better than wondering what exactly a certain variable is for. </p>
<h4>Loop Indices:</h4>
@@ -310,20 +320,48 @@ for ($i = 0; $i &lt; $outer_size; $i++)
{
foo($i, $j);
}
-}
- </pre></div>
+}</pre>
+ </div>
<h4>Function Names:</h4>
- <p>Functions should also be named descriptively. We're not programming in C here, we don't want to write functions called things like "stristr()". Again, all lower-case names with words separated by a single underscore character. Function names should preferably have a verb in them somewhere. Good function names are <code>print_login_status()</code>, <code>get_user_data()</code>, etc. </p>
+ <p>Functions should also be named descriptively. We're not programming in C here, we don't want to write functions called things like "stristr()". Again, all lower-case names with words separated by a single underscore character in PHP, and camel caps in JavaScript. Function names should be prefixed with "phpbb_" and preferably have a verb in them somewhere. Good function names are <code>phpbb_print_login_status()</code>, <code>phpbb_get_user_data()</code>, etc. Constructor functions in JavaScript should begin with a capital letter.</p>
<h4>Function Arguments:</h4>
<p>Arguments are subject to the same guidelines as variable names. We don't want a bunch of functions like: <code>do_stuff($a, $b, $c)</code>. In most cases, we'd like to be able to tell how to use a function by just looking at its declaration. </p>
+ <h4>Class Names:</h4>
+
+ <p>Apart from following the rules for function names, all classes should meet the following conditions:</p>
+ <ul>
+ <li>Every class must be defined in a separate file.</li>
+ <li>The classes have to be located in a subdirectory of <code>phpbb/</code>.</li>
+ <li>Classnames must be namespaced with <code>\phpbb\</code> to avoid name clashes.</li>
+ <li>Class names/namespaces have to reflect the location of the file they are defined in. The namespace must be the directory in which the file is located. So the directory names must not contain any underscores, but the filename may.</li>
+ <li>Directories should typically be a singular noun (e.g. <code>dir</code> in the example below, not <code>dirs</code>.</li>
+ </ul>
+
+ <p>So given the following example directory structure you would result in the below listed lookups</p>
+ <div class="codebox"><pre>
+phpbb/
+ class_name.php
+ dir/
+ class_name.php
+ subdir/
+ class_name.php</pre>
+ </div>
+
+ <div class="codebox"><pre>
+\phpbb\class_name - phpbb/class_name.php
+\phpbb\dir\class_name - phpbb/dir/class_name.php
+\phpbb\dir\subdir\class_name - phpbb/dir/subdir/class_name.php</pre>
+ </div>
+
+
<h4>Summary:</h4>
- <p>The basic philosophy here is to not hurt code clarity for the sake of laziness. This has to be balanced by a little bit of common sense, though; <code>print_login_status_for_a_given_user()</code> goes too far, for example -- that function would be better named <code>print_user_login_status()</code>, or just <code>print_login_status()</code>.</p>
+ <p>The basic philosophy here is to not hurt code clarity for the sake of laziness. This has to be balanced by a little bit of common sense, though; <code>phpbb_print_login_status_for_a_given_user()</code> goes too far, for example -- that function would be better named <code>phpbb_print_user_login_status()</code>, or just <code>phpbb_print_login_status()</code>.</p>
<h4>Special Namings: </h4>
- <p>For all emoticons use the term <code>smiley</code> in singular and <code>smilies</code> in plural.</p>
+ <p>For all emoticons use the term <code>smiley</code> in singular and <code>smilies</code> in plural. For emails we use the term <code>email</code> (without dash between “e” and “m”).</p>
<a name="codelayout"></a><h3>2.ii. Code Layout</h3>
@@ -342,8 +380,8 @@ while (condition)
do_stuff();
for ($i = 0; $i &lt; size; $i++)
- do_stuff($i);
- </pre></div>
+ do_stuff($i);</pre>
+ </div>
<p class="good">// These are all right. </p>
<div class="codebox"><pre>
@@ -360,11 +398,11 @@ while (condition)
for ($i = 0; $i &lt; size; $i++)
{
do_stuff();
-}
- </pre></div>
+}</pre>
+ </div>
<h4>Where to put the braces:</h4>
- <p>This one is a bit of a holy war, but we're going to use a style that can be summed up in one sentence: Braces always go on their own line. The closing brace should also always be at the same column as the corresponding opening brace, examples:</p>
+ <p>In PHP code, braces always go on their own line. The closing brace should also always be at the same column as the corresponding opening brace, examples:</p>
<div class="codebox"><pre>
if (condition)
@@ -392,8 +430,32 @@ while (condition)
function do_stuff()
{
...
+}</pre>
+ </div>
+
+ <p>In JavaScript code, braces always go on the same line:</p>
+
+ <div class="codebox"><pre>
+if (condition) {
+ while (condition2) {
+ ...
+ }
+} else {
+ ...
}
- </pre></div>
+
+for (var i = 0; i &lt; size; i++) {
+ ...
+}
+
+while (condition) {
+ ...
+}
+
+function do_stuff() {
+ ...
+}</pre>
+ </div>
<h4>Use spaces between tokens:</h4>
<p>This is another simple, easy step that helps keep code readable without much effort. Whenever you write an assignment, expression, etc.. Always leave <em>one</em> space between the tokens. Basically, write code as if it was English. Put spaces between variable names and operators. Don't put spaces just after an opening bracket or before a closing bracket. Don't put spaces just before a comma or a semicolon. This is best shown with a few examples, examples:</p>
@@ -417,26 +479,26 @@ for($i=0; $i&lt;$size; $i++) ...
for ($i = 0; $i &lt; $size; $i++) ...
$i=($j &lt; $size)?0:1;
-$i = ($j &lt; $size) ? 0 : 1;
- </pre></div>
+$i = ($j &lt; $size) ? 0 : 1;</pre>
+ </div>
<h4>Operator precedence:</h4>
<p>Do you know the exact precedence of all the operators in PHP? Neither do I. Don't guess. Always make it obvious by using brackets to force the precedence of an equation so you know what it does. Remember to not over-use this, as it may harden the readability. Basically, do not enclose single expressions. Examples:</p>
<p class="bad">// what's the result? who knows. </p>
- <div class="codebox"><pre>
-$bool = ($i &lt; 7 &amp;&amp; $j &gt; 8 || $k == 4);
- </pre></div>
+ <div class="codebox">
+ <pre>$bool = ($i &lt; 7 &amp;&amp; $j &gt; 8 || $k == 4);</pre>
+ </div>
<p class="bad">// now you can be certain what I'm doing here.</p>
- <div class="codebox"><pre>
-$bool = (($i &lt; 7) &amp;&amp; (($j &lt; 8) || ($k == 4)));
- </pre></div>
+ <div class="codebox">
+ <pre>$bool = (($i &lt; 7) &amp;&amp; (($j &lt; 8) || ($k == 4)));</pre>
+ </div>
<p class="good">// But this one is even better, because it is easier on the eye but the intention is preserved</p>
- <div class="codebox"><pre>
-$bool = ($i &lt; 7 &amp;&amp; ($j &lt; 8 || $k == 4));
- </pre></div>
+ <div class="codebox">
+ <pre>$bool = ($i &lt; 7 &amp;&amp; ($j &lt; 8 || $k == 4));</pre>
+ </div>
<h4>Quoting strings:</h4>
<p>There are two different ways to quote strings in PHP - either with single quotes or with double quotes. The main difference is that the parser does variable interpolation in double-quoted strings, but not in single quoted strings. Because of this, you should <em>always</em> use single quotes <em>unless</em> you specifically need variable interpolation to be done on that string. This way, we can save the parser the trouble of parsing a bunch of strings where no interpolation needs to be done.</p>
@@ -446,50 +508,70 @@ $bool = ($i &lt; 7 &amp;&amp; ($j &lt; 8 || $k == 4));
<div class="codebox"><pre>
$str = "This is a really long string with no variables for the parser to find.";
-do_stuff("$str");
- </pre></div>
+do_stuff("$str");</pre>
+ </div>
<p class="good">// right</p>
<div class="codebox"><pre>
$str = 'This is a really long string with no variables for the parser to find.';
-do_stuff($str);
- </pre></div>
+do_stuff($str);</pre>
+ </div>
<p class="bad">// Sometimes single quotes are just not right</p>
<div class="codebox"><pre>
-$post_url = $phpbb_root_path . 'posting.' . $phpEx . '?mode=' . $mode . '&amp;amp;start=' . $start;
- </pre></div>
+$post_url = $phpbb_root_path . 'posting.' . $phpEx . '?mode=' . $mode . '&amp;amp;start=' . $start;</pre>
+ </div>
<p class="good">// Double quotes are sometimes needed to not overcrowd the line with concatenations.</p>
<div class="codebox"><pre>
-$post_url = "{$phpbb_root_path}posting.$phpEx?mode=$mode&amp;amp;start=$start";
- </pre></div>
+$post_url = "{$phpbb_root_path}posting.$phpEx?mode=$mode&amp;amp;start=$start";</pre>
+ </div>
<p>In SQL statements mixing single and double quotes is partly allowed (following the guidelines listed here about SQL formatting), else one should try to only use one method - mostly single quotes.</p>
- <h4>Associative array keys:</h4>
- <p>In PHP, it's legal to use a literal string as a key to an associative array without quoting that string. We don't want to do this -- the string should always be quoted to avoid confusion. Note that this is only when we're using a literal, not when we're using a variable, examples:</p>
+ <h4>Commas after every array element:</h4>
+ <p>If an array is defined with each element on its own line, you still have to modify the previous line to add a comma when appending a new element. PHP allows for trailing (useless) commas in array definitions. These should always be used so each element including the comma can be appended with a single line. In JavaScript, do not use the trailing comma, as it causes browsers to throw errors.</p>
<p class="bad">// wrong</p>
<div class="codebox"><pre>
-$foo = $assoc_array[blah];
- </pre></div>
+$foo = array(
+ 'bar' => 42,
+ 'boo' => 23
+);</pre>
+ </div>
<p class="good">// right </p>
<div class="codebox"><pre>
-$foo = $assoc_array['blah'];
- </pre></div>
+$foo = array(
+ 'bar' => 42,
+ 'boo' => 23,
+);</pre>
+ </div>
+
+
+ <h4>Associative array keys:</h4>
+ <p>In PHP, it's legal to use a literal string as a key to an associative array without quoting that string. We don't want to do this -- the string should always be quoted to avoid confusion. Note that this is only when we're using a literal, not when we're using a variable, examples:</p>
<p class="bad">// wrong</p>
- <div class="codebox"><pre>
-$foo = $assoc_array["$var"];
- </pre></div>
+ <div class="codebox">
+ <pre>$foo = $assoc_array[blah];</pre>
+ </div>
<p class="good">// right </p>
- <div class="codebox"><pre>
-$foo = $assoc_array[$var];
- </pre></div>
+ <div class="codebox">
+ <pre>$foo = $assoc_array['blah'];</pre>
+ </div>
+
+ <p class="bad">// wrong</p>
+ <div class="codebox">
+ <pre>$foo = $assoc_array["$var"];</pre>
+ </div>
+
+ <p class="good">// right </p>
+ <div class="codebox">
+ <pre>$foo = $assoc_array[$var];</pre>
+ </div>
<h4>Comments:</h4>
<p>Each complex function should be preceded by a comment that tells a programmer everything they need to know to use that function. The meaning of every parameter, the expected input, and the output are required as a minimal comment. The function's behaviour in error conditions (and what those error conditions are) should also be present - but mostly included within the comment about the output.<br /><br />Especially important to document are any assumptions the code makes, or preconditions for its proper operation. Any one of the developers should be able to look at any part of the application and figure out what's going on in a reasonable amount of time.<br /><br />Avoid using <code>/* */</code> comment blocks for one-line comments, <code>//</code> should be used for one/two-liners.</p>
@@ -503,8 +585,8 @@ $foo = $assoc_array[$var];
<p class="bad">// wrong </p>
<div class="codebox"><pre>
$array[++$i] = $j;
-$array[$i++] = $k;
- </pre></div>
+$array[$i++] = $k;</pre>
+ </div>
<p class="good">// right </p>
<div class="codebox"><pre>
@@ -512,39 +594,38 @@ $i++;
$array[$i] = $j;
$array[$i] = $k;
-$i++;
- </pre></div>
+$i++;</pre>
+ </div>
<h4>Inline conditionals:</h4>
<p>Inline conditionals should only be used to do very simple things. Preferably, they will only be used to do assignments, and not for function calls or anything complex at all. They can be harmful to readability if used incorrectly, so don't fall in love with saving typing by using them, examples:</p>
<p class="bad">// Bad place to use them</p>
<div class="codebox"><pre>
-($i &lt; $size &amp;&amp; $j &gt; $size) ? do_stuff($foo) : do_stuff($bar);
- </pre></div>
+($i &lt; $size &amp;&amp; $j &gt; $size) ? do_stuff($foo) : do_stuff($bar);</pre>
+ </div>
<p class="good">// OK place to use them </p>
<div class="codebox"><pre>
-$min = ($i &lt; $j) ? $i : $j;
- </pre></div>
+$min = ($i &lt; $j) ? $i : $j;</pre>
+ </div>
<h4>Don't use uninitialized variables.</h4>
<p>For phpBB3, we intend to use a higher level of run-time error reporting. This will mean that the use of an uninitialized variable will be reported as a warning. These warnings can be avoided by using the built-in isset() function to check whether a variable has been set - but preferably the variable is always existing. For checking if an array has a key set this can come in handy though, examples:</p>
<p class="bad">// Wrong </p>
- <div class="codebox"><pre>
-if ($forum) ...
- </pre></div>
+ <div class="codebox">
+ <pre>if ($forum) ...</pre>
+ </div>
<p class="good">// Right </p>
- <div class="codebox"><pre>
-if (isset($forum)) ...
- </pre></div>
+ <div class="codebox">
+ <pre>if (isset($forum)) ...</pre></div>
<p class="good">// Also possible</p>
- <div class="codebox"><pre>
-if (isset($forum) &amp;&amp; $forum == 5)
- </pre></div>
+ <div class="codebox">
+ <pre>if (isset($forum) &amp;&amp; $forum == 5)</pre>
+ </div>
<p>The <code>empty()</code> function is useful if you want to check if a variable is not set or being empty (an empty string, 0 as an integer or string, NULL, false, an empty array or a variable declared, but without a value in a class). Therefore empty should be used in favor of <code>isset($array) &amp;&amp; sizeof($array) &gt; 0</code> - this can be written in a shorter way as <code>!empty($array)</code>.</p>
@@ -561,8 +642,8 @@ switch ($mode)
case 'mode2':
// I am doing something completely different here
break;
-}
- </pre></div>
+}</pre>
+ </div>
<p class="good">// Good </p>
<div class="codebox"><pre>
@@ -579,8 +660,8 @@ switch ($mode)
default:
// Always assume that a case was not caught
break;
-}
- </pre></div>
+}</pre>
+ </div>
<p class="good">// Also good, if you have more code between the case and the break </p>
<div class="codebox"><pre>
@@ -603,8 +684,8 @@ switch ($mode)
// Always assume that a case was not caught
break;
-}
- </pre></div>
+}</pre>
+ </div>
<p>Even if the break for the default case is not needed, it is sometimes better to include it just for readability and completeness.</p>
@@ -631,13 +712,33 @@ switch ($mode)
// Always assume that a case was not caught
break;
-}
- </pre></div>
+}</pre>
+ </div>
+
+ <h4>Class Members</h4>
+ <p>Use the explicit visibility qualifiers <code>public</code>, <code>private</code> and <code>protected</code> for all properties instead of <code>var</code>.
+
+ <p>Place the <code>static</code> qualifier before the visibility qualifiers.</p>
+
+ <p class="bad">//Wrong </p>
+ <div class="codebox"><pre>
+var $x;
+private static function f()</pre>
+ </div>
+
+ <p class="good">// Right </p>
+ <div class="codebox"><pre>
+public $x;
+static private function f()</pre>
+ </div>
+
+ <h4>Constants</h4>
+ <p>Prefer class constants over global constants created with <code>define()</code>.</p>
<a name="sql"></a><h3>2.iii. SQL/SQL Layout</h3>
<h4>Common SQL Guidelines: </h4>
- <p>All SQL should be cross-DB compatible, if DB specific SQL is used alternatives must be provided which work on all supported DB's (MySQL3/4/5, MSSQL (7.0 and 2000), PostgreSQL (7.0+), Firebird, SQLite, Oracle8, ODBC (generalised if possible)).</p>
+ <p>All SQL should be cross-DB compatible, if DB specific SQL is used alternatives must be provided which work on all supported DB's (MySQL3/4/5, MSSQL (7.0 and 2000), PostgreSQL (8.3+), SQLite, Oracle8, ODBC (generalised if possible)).</p>
<p>All SQL commands should utilise the DataBase Abstraction Layer (DBAL)</p>
<h4>SQL code layout:</h4>
@@ -649,8 +750,8 @@ $sql = 'SELECT *
&lt;-one tab-&gt;WHERE a = 1
&lt;-two tabs-&gt;AND (b = 2
&lt;-three tabs-&gt;OR b = 3)
-&lt;-one tab-&gt;ORDER BY b';
- </pre></div>
+&lt;-one tab-&gt;ORDER BY b';</pre>
+ </div>
<p>Here the example with the tabs applied:</p>
@@ -660,8 +761,8 @@ $sql = 'SELECT *
WHERE a = 1
AND (b = 2
OR b = 3)
- ORDER BY b';
- </pre></div>
+ ORDER BY b';</pre>
+ </div>
<h4>SQL Quotes: </h4>
<p>Use double quotes where applicable. (The variables in these examples are typecasted to integers beforehand.) Examples: </p>
@@ -670,16 +771,16 @@ $sql = 'SELECT *
<div class="codebox"><pre>
"UPDATE " . SOME_TABLE . " SET something = something_else WHERE a = $b";
-'UPDATE ' . SOME_TABLE . ' SET something = ' . $user_id . ' WHERE a = ' . $something;
- </pre></div>
+'UPDATE ' . SOME_TABLE . ' SET something = ' . $user_id . ' WHERE a = ' . $something;</pre>
+ </div>
<p class="good">// These are right. </p>
<div class="codebox"><pre>
'UPDATE ' . SOME_TABLE . " SET something = something_else WHERE a = $b";
-'UPDATE ' . SOME_TABLE . " SET something = $user_id WHERE a = $something";
- </pre></div>
+'UPDATE ' . SOME_TABLE . " SET something = $user_id WHERE a = $something";</pre>
+ </div>
<p>In other words use single quotes where no variable substitution is required or where the variable involved shouldn't appear within double quotes. Otherwise use double quotes.</p>
@@ -690,15 +791,15 @@ $sql = 'SELECT *
<div class="codebox"><pre>
$sql = 'SELECT *
FROM ' . SOME_TABLE . '
- WHERE a != 2';
- </pre></div>
+ WHERE a != 2';</pre>
+ </div>
<p class="good">// This is right. </p>
<div class="codebox"><pre>
$sql = 'SELECT *
FROM ' . SOME_TABLE . '
- WHERE a &lt;&gt; 2';
- </pre></div>
+ WHERE a &lt;&gt; 2';</pre>
+ </div>
<h4>Common DBAL methods: </h4>
@@ -709,8 +810,8 @@ $sql = 'SELECT *
<div class="codebox"><pre>
$sql = 'SELECT *
FROM ' . SOME_TABLE . "
- WHERE username = '" . $db-&gt;sql_escape($username) . "'";
- </pre></div>
+ WHERE username = '" . $db-&gt;sql_escape($username) . "'";</pre>
+ </div>
<h4>sql_query_limit():</h4>
@@ -731,8 +832,8 @@ $sql_ary = array(
'moredata' =&gt; $another_int,
);
-$db-&gt;sql_query('INSERT INTO ' . SOME_TABLE . ' ' . $db-&gt;sql_build_array('INSERT', $sql_ary));
- </pre></div>
+$db-&gt;sql_query('INSERT INTO ' . SOME_TABLE . ' ' . $db-&gt;sql_build_array('INSERT', $sql_ary));</pre>
+ </div>
<p>To complete the example, this is how an update statement would look like:</p>
@@ -746,8 +847,8 @@ $sql_ary = array(
$sql = 'UPDATE ' . SOME_TABLE . '
SET ' . $db-&gt;sql_build_array('UPDATE', $sql_ary) . '
WHERE user_id = ' . (int) $user_id;
-$db-&gt;sql_query($sql);
- </pre></div>
+$db-&gt;sql_query($sql);</pre>
+ </div>
<p>The <code>$db-&gt;sql_build_array()</code> function supports the following modes: <code>INSERT</code> (example above), <code>INSERT_SELECT</code> (building query for <code>INSERT INTO table (...) SELECT value, column ...</code> statements), <code>UPDATE</code> (example above) and <code>SELECT</code> (for building WHERE statement [AND logic]).</p>
@@ -770,8 +871,8 @@ $sql_ary[] = array(
'moredata' =&gt; $another_int_2,
);
-$db->sql_multi_insert(SOME_TABLE, $sql_ary);
- </pre></div>
+$db->sql_multi_insert(SOME_TABLE, $sql_ary);</pre>
+ </div>
<h4>sql_in_set():</h4>
@@ -781,22 +882,22 @@ $db->sql_multi_insert(SOME_TABLE, $sql_ary);
$sql = 'SELECT *
FROM ' . FORUMS_TABLE . '
WHERE ' . $db-&gt;sql_in_set('forum_id', $forum_ids);
-$db-&gt;sql_query($sql);
- </pre></div>
+$db-&gt;sql_query($sql);</pre>
+ </div>
<p>Based on the number of values in $forum_ids, the query can look differently.</p>
<p class="good">// SQL Statement if $forum_ids = array(1, 2, 3);</p>
<div class="codebox"><pre>
-SELECT FROM phpbb_forums WHERE forum_id IN (1, 2, 3)
- </pre></div>
+SELECT FROM phpbb_forums WHERE forum_id IN (1, 2, 3)</pre>
+ </div>
<p class="good">// SQL Statement if $forum_ids = array(1) or $forum_ids = 1</p>
<div class="codebox"><pre>
-SELECT FROM phpbb_forums WHERE forum_id = 1
- </pre></div>
+SELECT FROM phpbb_forums WHERE forum_id = 1</pre>
+ </div>
<p>Of course the same is possible for doing a negative match against a number of values:</p>
@@ -804,22 +905,22 @@ SELECT FROM phpbb_forums WHERE forum_id = 1
$sql = 'SELECT *
FROM ' . FORUMS_TABLE . '
WHERE ' . $db-&gt;sql_in_set('forum_id', $forum_ids, <strong>true</strong>);
-$db-&gt;sql_query($sql);
- </pre></div>
+$db-&gt;sql_query($sql);</pre>
+ </div>
<p>Based on the number of values in $forum_ids, the query can look differently here too.</p>
<p class="good">// SQL Statement if $forum_ids = array(1, 2, 3);</p>
<div class="codebox"><pre>
-SELECT FROM phpbb_forums WHERE forum_id <strong>NOT</strong> IN (1, 2, 3)
- </pre></div>
+SELECT FROM phpbb_forums WHERE forum_id <strong>NOT</strong> IN (1, 2, 3)</pre>
+ </div>
<p class="good">// SQL Statement if $forum_ids = array(1) or $forum_ids = 1</p>
<div class="codebox"><pre>
-SELECT FROM phpbb_forums WHERE forum_id <strong>&lt;&gt;</strong> 1
- </pre></div>
+SELECT FROM phpbb_forums WHERE forum_id <strong>&lt;&gt;</strong> 1</pre>
+ </div>
<p>If the given array is empty, an error will be produced.</p>
@@ -849,8 +950,8 @@ $sql_array = array(
'ORDER_BY' =&gt; 'left_id',
);
-$sql = $db-&gt;sql_build_query('SELECT', $sql_array);
- </pre></div>
+$sql = $db-&gt;sql_build_query('SELECT', $sql_array);</pre>
+ </div>
<p>The possible first parameter for sql_build_query() is SELECT or SELECT_DISTINCT. As you can see, the logic is pretty self-explaining. For the LEFT_JOIN key, just add another array if you want to join on to tables for example. The added benefit of using this construct is that you are able to easily build the query statement based on conditions - for example the above LEFT_JOIN is only necessary if server side topic tracking is enabled; a slight adjustement would be:</p>
@@ -885,8 +986,8 @@ else
// Here we read the cookie data
}
-$sql = $db-&gt;sql_build_query('SELECT', $sql_array);
- </pre></div>
+$sql = $db-&gt;sql_build_query('SELECT', $sql_array);</pre>
+ </div>
<a name="optimizing"></a><h3>2.iv. Optimizations</h3>
@@ -898,16 +999,16 @@ $sql = $db-&gt;sql_build_query('SELECT', $sql_array);
for ($i = 0; $i &lt; sizeof($post_data); $i++)
{
do_something();
-}
- </pre></div>
+}</pre>
+ </div>
<p class="good">// You are able to assign the (not changing) result within the loop itself</p>
<div class="codebox"><pre>
for ($i = 0, $size = sizeof($post_data); $i &lt; $size; $i++)
{
do_something();
-}
- </pre></div>
+}</pre>
+ </div>
<h4>Use of in_array(): </h4>
<p>Try to avoid using in_array() on huge arrays, and try to not place them into loops if the array to check consist of more than 20 entries. in_array() can be very time consuming and uses a lot of cpu processing time. For little checks it is not noticeable, but if checked against a huge array within a loop those checks alone can take several seconds. If you need this functionality, try using isset() on the arrays keys instead, actually shifting the values into keys and vice versa. A call to <code>isset($array[$var])</code> is a lot faster than <code>in_array($var, array_keys($array))</code> for example.</p>
@@ -923,35 +1024,35 @@ for ($i = 0, $size = sizeof($post_data); $i &lt; $size; $i++)
<p>No attempt should be made to remove any copyright information (either contained within the source or displayed interactively when the source is run/compiled), neither should the copyright information be altered in any way (it may be added to).</p>
<h4>Variables: </h4>
- <p>Make use of the <code>request_var()</code> function for anything except for submit or single checking params.</p>
- <p>The request_var function determines the type to set from the second parameter (which determines the default value too). If you need to get a scalar variable type, you need to tell this the request_var function explicitly. Examples:</p>
+ <p>Make use of the <code>\phpbb\request\request</code> class for everything.</p>
+ <p>The $request->variable() method determines the type to set from the second parameter (which determines the default value too). If you need to get a scalar variable type, you need to tell this the variable() method explicitly. Examples:</p>
<p class="bad">// Old method, do not use it</p>
<div class="codebox"><pre>
$start = (isset($HTTP_GET_VARS['start'])) ? intval($HTTP_GET_VARS['start']) : intval($HTTP_POST_VARS['start']);
-$submit = (isset($HTTP_POST_VARS['submit'])) ? true : false;
- </pre></div>
+$submit = (isset($HTTP_POST_VARS['submit'])) ? true : false;</pre>
+ </div>
<p class="good">// Use request var and define a default variable (use the correct type)</p>
<div class="codebox"><pre>
-$start = request_var('start', 0);
-$submit = (isset($_POST['submit'])) ? true : false;
- </pre></div>
+$start = $request->variable('start', 0);
+$submit = $request->is_set_post('submit');</pre>
+ </div>
- <p class="bad">// $start is an int, the following use of request_var therefore is not allowed</p>
+ <p class="bad">// $start is an int, the following use of $request->variable() therefore is not allowed</p>
<div class="codebox"><pre>
-$start = request_var('start', '0');
- </pre></div>
+$start = $request->variable('start', '0');</pre>
+ </div>
<p class="good">// Getting an array, keys are integers, value defaults to 0</p>
<div class="codebox"><pre>
-$mark_array = request_var('mark', array(0));
- </pre></div>
+$mark_array = $request->variable('mark', array(0));</pre>
+ </div>
<p class="good">// Getting an array, keys are strings, value defaults to 0</p>
<div class="codebox"><pre>
-$action_ary = request_var('action', array('' =&gt; 0));
- </pre></div>
+$action_ary = $request->variable('action', array('' =&gt; 0));</pre>
+ </div>
<h4>Login checks/redirection: </h4>
<p>To show a forum login box use <code>login_forum_box($forum_data)</code>, else use the <code>login_box()</code> function.</p>
@@ -974,8 +1075,8 @@ $action_ary = request_var('action', array('' =&gt; 0));
{
trigger_error('FORM_INVALID');
}
- }
- </pre></div>
+ }</pre>
+ </div>
<p>The string passed to <code>add_form_key()</code> needs to match the string passed to <code>check_form_key()</code>. Another requirement for this to work correctly is that all forms include the <code>{S_FORM_TOKEN}</code> template variable.</p>
@@ -986,8 +1087,8 @@ $action_ary = request_var('action', array('' =&gt; 0));
<div class="codebox"><pre>
$user-&gt;session_begin();
$auth-&gt;acl($user-&gt;data);
-$user-&gt;setup();
- </pre></div>
+$user-&gt;setup();</pre>
+ </div>
<p>The <code>$user-&gt;setup()</code> call can be used to pass on additional language definition and a custom style (used in viewforum).</p>
@@ -995,16 +1096,16 @@ $user-&gt;setup();
<p>All messages/errors should be outputted by calling <code>trigger_error()</code> using the appropriate message type and language string. Example:</p>
<div class="codebox"><pre>
-trigger_error('NO_FORUM');
- </pre></div>
+trigger_error('NO_FORUM');</pre>
+ </div>
<div class="codebox"><pre>
-trigger_error($user-&gt;lang['NO_FORUM']);
- </pre></div>
+trigger_error($user-&gt;lang['NO_FORUM']);</pre>
+ </div>
<div class="codebox"><pre>
-trigger_error('NO_MODE', E_USER_ERROR);
- </pre></div>
+trigger_error('NO_MODE', E_USER_ERROR);</pre>
+ </div>
<h4>Url formatting</h4>
@@ -1013,8 +1114,8 @@ trigger_error('NO_MODE', E_USER_ERROR);
<p>The <code>append_sid()</code> function from 2.0.x is available too, though it does not handle url alterations automatically. Please have a look at the code documentation if you want to get more details on how to use append_sid(). A sample call to append_sid() can look like this:</p>
<div class="codebox"><pre>
-append_sid(&quot;{$phpbb_root_path}memberlist.$phpEx&quot;, 'mode=group&amp;amp;g=' . $row['group_id'])
- </pre></div>
+append_sid(&quot;{$phpbb_root_path}memberlist.$phpEx&quot;, 'mode=group&amp;amp;g=' . $row['group_id'])</pre>
+ </div>
<h4>General function usage: </h4>
@@ -1022,9 +1123,6 @@ append_sid(&quot;{$phpbb_root_path}memberlist.$phpEx&quot;, 'mode=group&amp;amp;
<ul>
<li>
- <p>Use <code>sizeof</code> instead of <code>count</code></p>
- </li>
- <li>
<p>Use <code>strpos</code> instead of <code>strstr</code></p>
</li>
<li>
@@ -1042,31 +1140,60 @@ append_sid(&quot;{$phpbb_root_path}memberlist.$phpEx&quot;, 'mode=group&amp;amp;
<p>Your page should either call <code>page_footer()</code> in the end to trigger output through the template engine and terminate the script, or alternatively at least call the <code>exit_handler()</code>. That call is necessary because it provides a method for external applications embedding phpBB to be called at the end of the script.</p>
+ <a name="phprestrictions"></a><h3>2.vi. Restrictions on the Use of PHP</h3>
+
+ <h4>Dynamic code execution:</h4>
+
+ <p>Never execute dynamic PHP code (generated or in a constant string) using any of the following PHP functions:</p>
+
+ <ul>
+ <li><strong>eval</strong></li>
+ <li><strong>create_function</strong></li>
+ <li><strong>preg_replace</strong> with the <strong>e</strong> modifier in the pattern</li>
+ </ul>
+
+ <p>If absolutely necessary a file should be created, and a mechanism for creating this file prior to running phpBB should be provided as a setup process.</p>
+
+ <p>The <strong>e</strong> modifier in <strong>preg_replace</strong> can be replaced by <strong>preg_replace_callback</strong> and objects to encapsulate state that is needed in the callback code.</p>
+
+ <h4>Other functions, operators, statements and keywords:</h4>
+
+ <p>The following PHP statements should also not be used in phpBB:</p>
+
+ <ul>
+ <li><strong>goto</strong></li>
+ </ul>
+
</div>
<div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<hr />
<a name="styling"></a><h2>3. Styling</h2>
<div class="paragraph">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div class="content">
<a name="cfgfiles"></a><h3>3.i. Style Config Files</h3>
- <p>Style cfg files are simple name-value lists with the information necessary for installing a style. Similar cfg files exist for templates, themes and imagesets. These follow the same principle and will not be introduced individually. Styles can use installed components by using the required_theme/required_template/required_imageset entries. The important part of the style configuration file is assigning an unique name.</p>
- <div class="codebox"><pre>
- # General Information about this style
- name = prosilver_duplicate
- copyright = &copy; phpBB Group, 2007
- version = 3.0.3
- required_template = prosilver
- required_theme = prosilver
- required_imageset = prosilver
- </pre></div>
+ <p>Style cfg files are simple name-value lists with the information necessary for installing a style. The important part of the style configuration file is assigning an unique name.</p>
+ <div class="codebox"><pre>
+# General Information about this style
+name = prosilver_duplicate
+copyright = © phpBB Limited, 2007
+style_version = 3.1.0
+phpbb_version = 3.1.0
+
+# Defining a different template bitfield
+# template_bitfield = lNg=
+
+# Parent style
+# Set value to empty or to this style's name if this style does not have a parent style
+parent = prosilver</pre>
+ </div>
<a name="genstyling"></a><h3>3.2. General Styling Rules</h3>
<p>Templates should be produced in a consistent manner. Where appropriate they should be based off an existing copy, e.g. index, viewforum or viewtopic (the combination of which implement a range of conditional and variable forms). Please also note that the indentation and coding guidelines also apply to templates where possible.</p>
@@ -1088,7 +1215,7 @@ append_sid(&quot;{$phpbb_root_path}memberlist.$phpEx&quot;, 'mode=group&amp;amp;
<p>Row colours/classes are now defined by the template, use an <code>IF S_ROW_COUNT</code> switch, see viewtopic or viewforum for an example.</p>
-<p>Remember block level ordering is important ... while not all pages validate as XHTML 1.0 Strict compliant it is something we're trying to work on.</p>
+<p>Remember block level ordering is important.</p>
<p>Use a standard cellpadding of 2 and cellspacing of 0 on outer tables. Inner tables can vary from 0 to 3 or even 4 depending on the need.</p>
@@ -1124,14 +1251,14 @@ append_sid(&quot;{$phpbb_root_path}memberlist.$phpEx&quot;, 'mode=group&amp;amp;
<div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<hr />
<a name="templating"></a><h2>4. Templating</h2>
<div class="paragraph">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div class="content">
<a name="templates"></a><h3>4.i. General Templating</h3>
@@ -1156,13 +1283,13 @@ append_sid(&quot;{$phpbb_root_path}memberlist.$phpEx&quot;, 'mode=group&amp;amp;
<p>A bit later loops will be explained further. To not irritate you we will explain conditionals as well as other statements first.</p>
<h4>Including files</h4>
-<p>Something that existed in 2.0.x which no longer exists in 3.0.x is the ability to assign a template to a variable. This was used (for example) to output the jumpbox. Instead (perhaps better, perhaps not but certainly more flexible) we now have INCLUDE. This takes the simple form:</p>
+<p>Something that existed in 2.0.x which no longer exists in 3.x is the ability to assign a template to a variable. This was used (for example) to output the jumpbox. Instead (perhaps better, perhaps not but certainly more flexible) we now have INCLUDE. This takes the simple form:</p>
<div class="codebox"><pre>
<span class="comment">&lt;!-- INCLUDE filename --&gt;</span>
</pre></div>
-<p>You will note in the 3.0 templates the major sources start with <code>&lt;!-- INCLUDE overall_header.html --&gt;</code> or <code>&lt;!-- INCLUDE simple_header.html --&gt;</code>, etc. In 2.0.x control of &quot;which&quot; header to use was defined entirely within the code. In 3.0.x the template designer can output what they like. Note that you can introduce new templates (i.e. other than those in the default set) using this system and include them as you wish ... perhaps useful for a common &quot;menu&quot; bar or some such. No need to modify loads of files as with 2.0.x.</p>
+<p>You will note in the 3.x templates the major sources start with <code>&lt;!-- INCLUDE overall_header.html --&gt;</code> or <code>&lt;!-- INCLUDE simple_header.html --&gt;</code>, etc. In 2.0.x control of &quot;which&quot; header to use was defined entirely within the code. In 3.x the template designer can output what they like. Note that you can introduce new templates (i.e. other than those in the default set) using this system and include them as you wish ... perhaps useful for a common &quot;menu&quot; bar or some such. No need to modify loads of files as with 2.0.x.</p>
<p>Added in <strong>3.0.6</strong> is the ability to include a file using a template variable to specify the file, this functionality only works for root variables (i.e. not block variables).</p>
<div class="codebox"><pre>
@@ -1194,7 +1321,7 @@ append_sid(&quot;{$phpbb_root_path}memberlist.$phpEx&quot;, 'mode=group&amp;amp;
<p>it will be included and executed inline.<br /><br />A note, it is very much encouraged that template designers do not include PHP. The ability to include raw PHP was introduced primarily to allow end users to include banner code, etc. without modifying multiple files (as with 2.0.x). It was not intended for general use ... hence <!-- w --><a href="https://www.phpbb.com">www.phpbb.com</a><!-- w --> will <strong>not</strong> make available template sets which include PHP. And by default templates will have PHP disabled (the admin will need to specifically activate PHP for a template).</p>
<h4>Conditionals/Control structures</h4>
-<p>The most significant addition to 3.0.x are conditions or control structures, &quot;if something then do this else do that&quot;. The system deployed is very similar to Smarty. This may confuse some people at first but it offers great potential and great flexibility with a little imagination. In their most simple form these constructs take the form:</p>
+<p>The most significant addition to 3.x are conditions or control structures, &quot;if something then do this else do that&quot;. The system deployed is very similar to Smarty. This may confuse some people at first but it offers great potential and great flexibility with a little imagination. In their most simple form these constructs take the form:</p>
<div class="codebox"><pre>
<span class="comment">&lt;!-- IF expr --&gt;</span>
@@ -1265,7 +1392,7 @@ div
<span class="comment">&lt;!-- ENDIF --&gt;</span>
</pre></div>
-<p>Each statement will be tested in turn and the relevant output generated when a match (if a match) is found. It is not necessary to always use ELSEIF, ELSE can be used alone to match &quot;everything else&quot;.<br /><br />So what can you do with all this? Well take for example the colouration of rows in viewforum. In 2.0.x row colours were predefined within the source as either row color1, row color2 or row class1, row class2. In 3.0.x this is moved to the template, it may look a little daunting at first but remember control flows from top to bottom and it's not too difficult:</p>
+<p>Each statement will be tested in turn and the relevant output generated when a match (if a match) is found. It is not necessary to always use ELSEIF, ELSE can be used alone to match &quot;everything else&quot;.<br /><br />So what can you do with all this? Well take for example the colouration of rows in viewforum. In 2.0.x row colours were predefined within the source as either row color1, row color2 or row class1, row class2. In 3.x this is moved to the template, it may look a little daunting at first but remember control flows from top to bottom and it's not too difficult:</p>
<div class="codebox"><pre>
&lt;table&gt;
@@ -1536,31 +1663,91 @@ div
&lt;/form&gt;
</pre></div><br />
- <a name="inheritance"></a><h3>4.ii. Template Inheritance</h3>
- <p>When basing a new style on an existing one, it is not necessary to provide all the template files. By declaring the base style name in the <strong>inherit_from</strong> field in the template configuration file, the style can be set to inherit template files from the base style. The limitation on this is that the base style has to be installed and complete, meaning that it is not itself inheriting.</p>
+ <a name="stylestree"></a><h3>4.ii. Styles Tree</h3>
+ <p>When basing a new style on an existing one, it is not necessary to provide all the template files. By declaring the base style name in the <strong>parent</strong> field in the style configuration file, the style can be set to reuse template files from the parent style.</p>
- <p>The effect of doing so is that the template engine will use the template files in the new style where they exist, but fall back to files in the base style otherwise. Declaring a style to inherit from another also causes it to use some of the configuration settings of the base style, notably database storage.</p>
+ <p>The effect of doing so is that the template engine will use the template files in the new style where they exist, but fall back to files in the parent style otherwise.</p>
- <p>We strongly encourage the use of inheritance for styles based on the bundled styles, as it will ease the update procedure.</p>
+ <p>We strongly encourage the use of parent styles for styles based on the bundled styles, as it will ease the update procedure.</p>
<div class="codebox"><pre>
- # General Information about this template
- name = inherits
- copyright = &copy; phpBB Group, 2007
- version = 3.0.3
-
- # Defining a different template bitfield
- template_bitfield = lNg=
-
- # Are we inheriting?
- inherit_from = prosilver
+# General Information about this style
+name = Custom Style
+copyright = © phpBB Limited, 2007
+style_version = 3.1.0-b1
+phpbb_version = 3.1.0-b1
+
+# Defining a different template bitfield
+# template_bitfield = lNg=
+
+# Parent style
+# Set value to empty or to this style's name if this style does not have a parent style
+parent = prosilver
</pre></div>
+ <a name="template-events"></a><h3>4.iii. Template Events</h3>
+ <p>Template events must follow this format: <code>&lt;!-- EVENT event_name --&gt;</code></p>
+ <p>Using the above example, files named <code>event_name.html</code> located within extensions will be injected into the location of the event.</p>
+
+ <h4>Template event naming guidelines:</h4>
+ <ul>
+ <li>An event name must be all lowercase, with each word separated by an underscore.</li>
+ <li>An event name must briefly describe the location and purpose of the event.</li>
+ <li>
+ An event name must end with one of the following suffixes:
+ <ul>
+ <li><code>_prepend</code> - This event adds an item to the beginning of a block of related items, or adds to the beginning of individual items in a block.</li>
+ <li><code>_append</code> - This event adds an item to the end of a block of related items, or adds to the end of individual items in a block.</li>
+ <li><code>_before</code> - This event adds content directly before the specified block</li>
+ <li><code>_after</code> - This event adds content directly after the specified block</li>
+ </ul>
+ </li>
+ </ul>
+
+ <h4>Template event documentation</h4>
+ <p>Events must be documented in <code>phpBB/docs/events.md</code> in alphabetical order based on the event name. The format is as follows:</p>
+
+ <ul><li>An event found in only one template file:
+ <div class="codebox"><pre>event_name
+===
+* Location: styles/&lt;style_name&gt;/template/filename.html
+* Purpose: A brief description of what this event should be used for.
+This may span multiple lines.
+* Since: Version since when the event was added
+</pre></div></li>
+ <li>An event found in multiple template files:
+ <div class="codebox"><pre>event_name
+===
+* Locations:
+ + first/file/path.html
+ + second/file/path.html
+* Purpose: Same as above.
+* Since: 3.1.0-b1
+</pre></div>
+ <li>An event that is found multiple times in a file should have the number of instances in parenthesis next to the filename.
+ <div class="codebox"><pre>event_name
+===
+* Locations:
+ + first/file/path.html (2)
+ + second/file/path.html
+* Purpose: Same as above.
+* Since: 3.1.0-b1
+</pre></div></li>
+ <li>An actual example event documentation:
+ <div class="codebox"><pre>forumlist_body_last_post_title_prepend
+====
+* Locations:
+ + styles/prosilver/template/forumlist_body.html
+ + styles/subsilver2/template/forumlist_body.html
+* Purpose: Add content before the post title of the latest post in a forum on the forum list.
+* Since: 3.1.0-a1
+</pre></div></ul><br />
+
</div>
<div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<hr />
@@ -1570,7 +1757,7 @@ div
<a name="charsets"></a><h2>5. Character Sets and Encodings</h2>
<div class="paragraph">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div class="content">
@@ -1584,16 +1771,16 @@ div
<p>phpBB only uses the ASCII and the UTF-8 character encodings. Still all Strings are UTF-8 encoded because ASCII is a subset of UTF-8. The only exceptions to this rule are code sections which deal with external systems which use other encodings and character sets. Such external data should be converted to UTF-8 using the <code>utf8_recode()</code> function supplied with phpBB. It supports a variety of other character sets and encodings, a full list can be found below.</p>
-<p>With <code>request_var()</code> you can either allow all UCS characters in user input or restrict user input to ASCII characters. This feature is controlled by the function's third parameter called <code>$multibyte</code>. You should allow multibyte characters in posts, PMs, topic titles, forum names, etc. but it's not necessary for internal uses like a <code>$mode</code> variable which should only hold a predefined list of ASCII strings anyway.</p>
+<p>With <code>$request->variable()</code> you can either allow all UCS characters in user input or restrict user input to ASCII characters. This feature is controlled by the method's third parameter called <code>$multibyte</code>. You should allow multibyte characters in posts, PMs, topic titles, forum names, etc. but it's not necessary for internal uses like a <code>$mode</code> variable which should only hold a predefined list of ASCII strings anyway.</p>
<div class="codebox"><pre>
// an input string containing a multibyte character
$_REQUEST['multibyte_string'] = 'K&#228;se';
// print request variable as a UTF-8 string allowing multibyte characters
-echo request_var('multibyte_string', '', true);
+echo $request->variable('multibyte_string', '', true);
// print request variable as ASCII string
-echo request_var('multibyte_string', '');
+echo $request->variable('multibyte_string', '');
</pre></div>
<p>This code snippet will generate the following output:</p>
@@ -1603,19 +1790,6 @@ K&#228;se
K??se
</pre></div>
-<h4>Unicode Normalization</h4>
-
-<p>If you retrieve user input with multibyte characters you should additionally normalize the string using <code>utf8_normalize_nfc()</code> before you work with it. This is necessary to make sure that equal characters can only occur in one particular binary representation. For example the character &#197; can be represented either as <code>U+00C5</code> (LATIN CAPITAL LETTER A WITH RING ABOVE) or as <code>U+212B</code> (ANGSTROM SIGN). phpBB uses Normalization Form Canonical Composition (NFC) for all text. So the correct version of the above example would look like this:</p>
-
-<div class="codebox"><pre>
-$_REQUEST['multibyte_string'] = 'K&#228;se';
-
-// normalize multibyte strings
-echo utf8_normalize_nfc(request_var('multibyte_string', '', true));
-// ASCII strings do not need to be normalized
-echo request_var('multibyte_string', '');
-</pre></div>
-
<h4>Case Folding</h4>
<p>Case insensitive comparison of strings is no longer possible with <code>strtolower</code> or <code>strtoupper</code> as some characters have multiple lower case or multiple upper case forms depending on their position in a word. The <code>utf8_strtolower</code> and the <code>utf8_strtoupper</code> functions suffer from the same problem so they can only be used to display upper/lower case versions of a string but they cannot be used for case insensitive comparisons either. So instead you should use case folding which gives you a case insensitive version of the string which can be used for case insensitive comparisons. An NFC normalized string can be case folded using <code>utf8_case_fold_nfc()</code>.</p>
@@ -1646,7 +1820,7 @@ if (utf8_case_fold_nfc($string1) == utf8_case_fold_nfc($string2))
<div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<hr />
@@ -1654,7 +1828,7 @@ if (utf8_case_fold_nfc($string1) == utf8_case_fold_nfc($string2))
<a name="translation"></a><h2>6. Translation (<abbr title="Internationalisation">i18n</abbr>/<abbr title="Localisation">L10n</abbr>) Guidelines</h2>
<div class="paragraph">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div class="content">
@@ -1668,7 +1842,7 @@ if (utf8_case_fold_nfc($string1) == utf8_case_fold_nfc($string2))
<p>With phpBB3, the output encoding for the forum in now UTF-8, a Universal Character Encoding by the Unicode Consortium that is by design a superset to US-ASCII and ISO-8859-1. By using one character set which simultaenously supports all scripts which previously would have required different encodings (eg: ISO-8859-1 to ISO-8859-15 (Latin, Greek, Cyrillic, Thai, Hebrew, Arabic); GB2312 (Simplified Chinese); Big5 (Traditional Chinese), EUC-JP (Japanese), EUC-KR (Korean), VISCII (Vietnamese); et cetera), we remove the need to convert between encodings and improves the accessibility of multilingual forums.</p>
- <p>The impact is that the language files for phpBB must now also be encoded as UTF-8, with a caveat that the files must <strong>not contain</strong> a <acronym title="Byte-Order-Mark">BOM</acronym> for compatibility reasons with non-Unicode aware versions of PHP. For those with forums using the Latin character set (ie: most European languages), this change is transparent since UTF-8 is superset to US-ASCII and ISO-8859-1.</p>
+ <p>The impact is that the language files for phpBB must now also be encoded as UTF-8, with a caveat that the files must <strong>not contain</strong> a <abbr title="Byte-Order-Mark">BOM</abbr> for compatibility reasons with non-Unicode aware versions of PHP. For those with forums using the Latin character set (ie: most European languages), this change is transparent since UTF-8 is superset to US-ASCII and ISO-8859-1.</p>
<h4>Language Tag:</h4>
@@ -1678,8 +1852,8 @@ if (utf8_case_fold_nfc($string1) == utf8_case_fold_nfc($string2))
<p>Most language tags consist of a two- or three-letter language subtag (from <a href="http://www.loc.gov/standards/iso639-2/php/English_list.php">ISO 639-1/ISO 639-2</a>). Sometimes, this is followed by a two-letter or three-digit region subtag (from <a href="http://www.iso.ch/iso/en/prods-services/iso3166ma/02iso-3166-code-lists/list-en1.html">ISO 3166-1 alpha-2</a> or <a href="http://unstats.un.org/unsd/methods/m49/m49.htm">UN M.49</a>). Some examples are:</p>
- <table summary="Examples of various possible language tags as described by RFC 4646 and RFC 4647">
- <caption>Language tag examples</caption>
+ <table>
+ <caption>Examples of various possible language tags as described by RFC 4646 and RFC 4647</caption>
<thead>
<tr>
<th scope="col">Language tag</th>
@@ -1730,8 +1904,8 @@ if (utf8_case_fold_nfc($string1) == utf8_case_fold_nfc($string2))
<p>Next is the <a href="http://www.unicode.org/iso15924/iso15924-codes.html">ISO 15924</a> language script code and when one should or shouldn't use it. For example, whilst <code>en-Latn</code> is syntaxically correct for describing English written with Latin script, real world English writing is <strong>more-or-less exclusively in the Latin script</strong>. For such languages like English that are written in a single script, the <a href="http://www.iana.org/assignments/language-subtag-registry"><abbr title="Internet Assigned Numbers Authority">IANA</abbr> Language Subtag Registry</a> has a "Suppress-Script" field meaning the script code <strong>should be ommitted</strong> unless a specific language tag requires a specific script code. Some languages are <strong>written in more than one script</strong> and in such cases, the script code <strong>is encouraged</strong> since an end-user may be able to read their language in one script, but not the other. Some examples are:</p>
- <table summary="Examples of using a language subtag in combination with a script subtag">
- <caption>Language subtag + script subtag examples</caption>
+ <table>
+ <caption>Examples of using a language subtag in combination with a script subtag</caption>
<thead>
<tr>
<th scope="col">Language tag</th>
@@ -1797,8 +1971,8 @@ if (utf8_case_fold_nfc($string1) == utf8_case_fold_nfc($string2))
<p>Examples of English using marco-geographical regions:</p>
- <table summary="Examples for English of ISO 3166-1 alpha-2 vs. UN M.49 code">
- <caption>Coding for English using macro-geographical regions</caption>
+ <table>
+ <caption>Coding for English using macro-geographical regions (examples for English of ISO 3166-1 alpha-2 vs. UN M.49 code)</caption>
<thead>
<tr>
<th scope="col">ISO 639-1/ISO 639-2 + ISO 3166-1 alpha-2</th>
@@ -1823,8 +1997,8 @@ if (utf8_case_fold_nfc($string1) == utf8_case_fold_nfc($string2))
<p>Examples of Spanish using marco-geographical regions:</p>
- <table summary="Examples for Spanish of ISO 3166-1 alpha-2 vs. UN M.49 code">
- <caption>Coding for Spanish macro-geographical regions</caption>
+ <table>
+ <caption>Coding for Spanish macro-geographical regions (examples for Spanish of ISO 3166-1 alpha-2 vs. UN M.49 code)</caption>
<thead>
<tr>
<th scope="col">ISO 639-1/ISO 639-2 + ISO 3166-1 alpha-2</th>
@@ -1852,7 +2026,7 @@ if (utf8_case_fold_nfc($string1) == utf8_case_fold_nfc($string2))
<p>Example of where the <a href="http://www.iso.ch/iso/en/prods-services/iso3166ma/02iso-3166-code-lists/list-en1.html">ISO 3166-1 alpha-2</a> is ambiguous and why <a href="http://unstats.un.org/unsd/methods/m49/m49.htm">UN M.49</a> might be preferred:</p>
- <table summary="Example where the ISO 3166-1 alpha-2 is ambiguous">
+ <table>
<caption>Coding for ambiguous ISO 3166-1 alpha-2 regions</caption>
<thead>
<tr>
@@ -1908,7 +2082,7 @@ if (utf8_case_fold_nfc($string1) == utf8_case_fold_nfc($string2))
<p><a href="http://tools.ietf.org/html/rfc4646">RFC 4646</a> anticipates features which shall be available in (currently draft) <a href="http://www.sil.org/iso639-3/">ISO 639-3</a> which aims to provide as complete enumeration of languages as possible, including living, extinct, ancient and constructed languages, whether majour, minor or unwritten. A new feature of <a href="http://www.sil.org/iso639-3/">ISO 639-3</a> compared to the previous two revisions is the concept of <a href="http://www.sil.org/iso639-3/macrolanguages.asp">macrolanguages</a> where Arabic and Chinese are two such examples. In such cases, their respective codes of <code>ar</code> and <code>zh</code> is very vague as to which dialect/topolect is used or perhaps some terse classical variant which may be difficult for all but very educated users. For such macrolanguages, it is recommended that the sub-language tag is used as a suffix to the macrolanguage tag, eg:</p>
- <table summary="Examples of macrolanguages used with sub-language subtags">
+ <table>
<caption>Macrolanguage subtag + sub-language subtag examples</caption>
<thead>
<tr>
@@ -1952,7 +2126,7 @@ if (utf8_case_fold_nfc($string1) == utf8_case_fold_nfc($string2))
<p>For phpBB, the language tags are <strong>not</strong> used in their raw form and instead converted to all lower-case and have the hyphen <code>-</code> replaced with an underscore <code>_</code> where appropriate, with some examples below:</p>
- <table summary="Normalisation of language tags for usage in phpBB">
+ <table>
<caption>Language tag normalisation examples</caption>
<thead>
<tr>
@@ -2006,7 +2180,7 @@ if (utf8_case_fold_nfc($string1) == utf8_case_fold_nfc($string2))
<p>For the English language description, the language name is always first and any additional attributes required to describe the subtags within the language code are then listed in order separated with commas and enclosed within parentheses, eg:</p>
- <table summary="English language description examples of iso.txt for usage in phpBB">
+ <table>
<caption>English language description examples for iso.txt</caption>
<thead>
<tr>
@@ -2058,7 +2232,7 @@ if (utf8_case_fold_nfc($string1) == utf8_case_fold_nfc($string2))
<p>The various Unicode control characters for bi-directional text and their HTML enquivalents where appropriate are as follows:</p>
- <table summary="Table of the various Unicode bidirectional control characters">
+ <table>
<caption>Unicode bidirectional control characters &amp; HTML elements/entities</caption>
<thead>
<tr>
@@ -2124,7 +2298,7 @@ if (utf8_case_fold_nfc($string1) == utf8_case_fold_nfc($string2))
<p>For <code>iso.txt</code>, the directionality of the text can be explicitly set using special Unicode characters via any of the three methods provided by left-to-right/right-to-left markers/embeds/overrides, as without them, the ordering of characters will be incorrect, eg:</p>
- <table summary="Effect of using Unicode bidirectional control characters within iso.txt">
+ <table>
<caption>Unicode bidirectional control characters iso.txt</caption>
<thead>
<tr>
@@ -2172,7 +2346,7 @@ if (utf8_case_fold_nfc($string1) == utf8_case_fold_nfc($string2))
<p>Within some cases, there may be mixed scripts of a left-to-right and right-to-left direction, so using <code>LRE</code> &amp; <code>RLE</code> with <code>PDF</code> may be more appropriate. Lastly, in very rare instances where directionality must be forced, then use <code>LRO</code> &amp; <code>RLO</code> with <code>PDF</code>.</p>
<p>For further information on authoring techniques of bi-directional text, please see the W3C tutorial on <a href="http://www.w3.org/International/tutorials/bidi-xhtml/">authoring techniques for XHTML pages with bi-directional text</a>.</p>
- <h4>Working with placeholders:</h4>
+ <a name="placeholders"></a><h3>6.iii. Working with placeholders</h3>
<p>As phpBB is translated into languages with different ordering rules to that of English, it is possible to show specific values in any order deemed appropriate. Take for example the extremely simple &quot;Page <em>X</em> of <em>Y</em>&quot;, whilst in English this could just be coded as:</p>
@@ -2181,8 +2355,8 @@ if (utf8_case_fold_nfc($string1) == utf8_case_fold_nfc($string2))
'PAGE_OF' =&gt; 'Page %s of %s',
/* Just grabbing the replacements as they
come and hope they are in the right order */
- ...
- </pre></div>
+ ...</pre>
+ </div>
<p>&hellip; a clearer way to show explicit replacement ordering is to do:</p>
@@ -2191,8 +2365,8 @@ if (utf8_case_fold_nfc($string1) == utf8_case_fold_nfc($string2))
'PAGE_OF' =&gt; 'Page %1$s of %2$s',
/* Explicit ordering of the replacements,
even if they are the same order as English */
- ...
- </pre></div>
+ ...</pre>
+ </div>
<p>Why bother at all? Because some languages, the string transliterated back to English might read something like:</p>
@@ -2201,10 +2375,62 @@ if (utf8_case_fold_nfc($string1) == utf8_case_fold_nfc($string2))
'PAGE_OF' =&gt; 'Total of %2$s pages, currently on page %1$s',
/* Explicit ordering of the replacements,
reversed compared to English as the total comes first */
+ ...</pre>
+ </div>
+
+ <a name="usingplurals"></a><h3>6.iv. Using plurals</h3>
+
+ <p>
+ The english language is very simple when it comes to plurals.<br />
+ You have <code>0 elephants</code>, <code>1 elephant</code>, or <code>2+ elephants</code>. So basically you have 2 different forms: one singular and one plural.<br />
+ But for some other languages this is quite more difficult. Let's take the Bosnian language as another example:<br />
+ You have <code>[1/21/31] slon</code>, <code>[2/3/4] slona</code>, <code>[0/5/6] slonova</code> and <code>[7/8/9/11] ...</code> and some more difficult rules.
+ </p>
+
+ <p>The <a href="https://wiki.phpbb.com/Plural_Rules">plural system</a> takes care of this and can be used as follows:</p>
+
+ <p>The PHP code will basically look like this:</p>
+
+ <div class="codebox"><pre>
+ ...
+ $user->lang('NUMBER_OF_ELEPHANTS', $number_of_elephants);
+ ...</pre>
+ </div>
+
+ <p>And the English translation would be:</p>
+
+ <div class="codebox"><pre>
+ ...
+ 'NUMBER_OF_ELEPHANTS' => array(
+ 0 => 'You have no elephants', // Optional special case for 0
+ 1 => 'You have 1 elephant', // Singular
+ 2 => 'You have %d elephants', // Plural
+ ),
+ ...</pre>
+ </div>
+
+ <p>While the Bosnian translation can have more cases:</p>
+
+ <div class="codebox"><pre>
...
- </pre></div>
+ 'NUMBER_OF_ELEPHANTS' => array(
+ 0 => 'You have no slonova', // Optional special case for 0
+ 1 => 'You have %d slon', // Used for 1, 21, 31, ..
+ 2 => 'You have %d slona', // Used for 5, 6,
+ 3 => ...
+ ),
+ ...</pre>
+ </div>
- <a name="writingstyle"></a><h3>6.iii. Writing Style</h3>
+ <p><strong>NOTE:</strong> It is okay to use plurals for an unknown number compared to a single item, when the number is not known and displayed:</p>
+ <div class="codebox"><pre>
+ ...
+ 'MODERATOR' => 'Moderator', // Your board has 1 moderator
+ 'MODERATORS' => 'Moderators', // Your board has multiple moderators
+ ...</pre>
+ </div>
+
+ <a name="writingstyle"></a><h3>6.v. Writing Style</h3>
<h4>Miscellaneous tips &amp; hints:</h4>
@@ -2216,8 +2442,8 @@ if (utf8_case_fold_nfc($string1) == utf8_case_fold_nfc($string2))
...
'CONV_ERROR_NO_AVATAR_PATH'
=&gt; 'Note to developer: you must specify $convertor['avatar_path'] to use %s.',
- ...
- </pre></div>
+ ...</pre>
+ </div>
<p class="good">// Good - Literal straight quotes should be escaped with a backslash, ie: \</p>
@@ -2225,8 +2451,8 @@ if (utf8_case_fold_nfc($string1) == utf8_case_fold_nfc($string2))
...
'CONV_ERROR_NO_AVATAR_PATH'
=&gt; 'Note to developer: you must specify $convertor[\'avatar_path\'] to use %s.',
- ...
- </pre></div>
+ ...</pre>
+ </div>
<p>However, because phpBB3 now uses UTF-8 as its sole encoding, we can actually use this to our advantage and not have to remember to escape a straight quote when we don't have to:</p>
@@ -2235,24 +2461,24 @@ if (utf8_case_fold_nfc($string1) == utf8_case_fold_nfc($string2))
<div class="codebox"><pre>
...
'USE_PERMISSIONS' =&gt; 'Test out user's permissions',
- ...
- </pre></div>
+ ...</pre>
+ </div>
<p class="good">// Okay - However, non-programmers wouldn't type "user\'s" automatically</p>
<div class="codebox"><pre>
...
'USE_PERMISSIONS' =&gt; 'Test out user\'s permissions',
- ...
- </pre></div>
+ ...</pre>
+ </div>
<p class="good">// Best - Use the Unicode Right-Single-Quotation-Mark character</p>
<div class="codebox"><pre>
...
'USE_PERMISSIONS' =&gt; 'Test out user&rsquo;s permissions',
- ...
- </pre></div>
+ ...</pre>
+ </div>
<p>The <code>&quot;</code> (straight double quote), <code>&lt;</code> (less-than sign) and <code>&gt;</code> (greater-than sign) characters can all be used as displayed glyphs or as part of HTML markup, for example:</p>
@@ -2260,28 +2486,28 @@ if (utf8_case_fold_nfc($string1) == utf8_case_fold_nfc($string2))
<div class="codebox"><pre>
...
-'FOO_BAR' =&gt; 'PHP version &lt; 4.3.3.&lt;br /&gt;
+'FOO_BAR' =&gt; 'PHP version &lt; 5.3.3.&lt;br /&gt;
Visit &quot;Downloads&quot; at &lt;a href=&quot;http://www.php.net/&quot;&gt;www.php.net&lt;/a&gt;.',
- ...
- </pre></div>
+ ...</pre>
+ </div>
<p class="good">// Okay - No more invalid HTML, but &quot;&amp;quot;&quot; is rather clumsy</p>
<div class="codebox"><pre>
...
-'FOO_BAR' =&gt; 'PHP version &amp;lt; 4.3.3.&lt;br /&gt;
+'FOO_BAR' =&gt; 'PHP version &amp;lt; 5.3.3.&lt;br /&gt;
Visit &amp;quot;Downloads&amp;quot; at &lt;a href=&quot;http://www.php.net/&quot;&gt;www.php.net&lt;/a&gt;.',
- ...
- </pre></div>
+ ...</pre>
+ </div>
<p class="good">// Best - No more invalid HTML, and usage of correct typographical quotation marks</p>
<div class="codebox"><pre>
...
-'FOO_BAR' =&gt; 'PHP version &amp;lt; 4.3.3.&lt;br /&gt;
+'FOO_BAR' =&gt; 'PHP version &amp;lt; 5.3.3.&lt;br /&gt;
Visit &ldquo;Downloads&rdquo; at &lt;a href=&quot;http://www.php.net/&quot;&gt;www.php.net&lt;/a&gt;.',
- ...
- </pre></div>
+ ...</pre>
+ </div>
<p>Lastly, the <code>&amp;</code> (ampersand) must always be entitised regardless of where it is used:</p>
@@ -2290,16 +2516,16 @@ if (utf8_case_fold_nfc($string1) == utf8_case_fold_nfc($string2))
<div class="codebox"><pre>
...
'FOO_BAR' =&gt; '&lt;a href=&quot;http://somedomain.tld/?foo=1&amp;bar=2&quot;&gt;Foo &amp; Bar&lt;/a&gt;.',
- ...
- </pre></div>
+ ...</pre>
+ </div>
<p class="good">// Good - Valid HTML, amperands are correctly entitised in all cases</p>
<div class="codebox"><pre>
...
'FOO_BAR' =&gt; '&lt;a href=&quot;http://somedomain.tld/?foo=1&amp;amp;bar=2&quot;&gt;Foo &amp;amp; Bar&lt;/a&gt;.',
- ...
- </pre></div>
+ ...</pre>
+ </div>
<p>As for how these charcters are entered depends very much on choice of Operating System, current language locale/keyboard configuration and native abilities of the text editor used to edit phpBB language files. Please see <a href="http://en.wikipedia.org/wiki/Unicode#Input_methods">http://en.wikipedia.org/wiki/Unicode#Input_methods</a> for more information.</p>
@@ -2311,7 +2537,7 @@ if (utf8_case_fold_nfc($string1) == utf8_case_fold_nfc($string2))
<div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<hr />
@@ -2319,17 +2545,17 @@ if (utf8_case_fold_nfc($string1) == utf8_case_fold_nfc($string2))
<a name="disclaimer"></a><h2>7. Copyright and disclaimer</h2>
<div class="paragraph">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div class="content">
- <p>This application is opensource software released under the <a href="http://opensource.org/licenses/gpl-2.0.php">GNU General Public License v2</a>. Please see source code and the docs directory for more details. This package and its contents are Copyright (c) <a href="https://www.phpbb.com/">phpBB Group</a>, All Rights Reserved.</p>
+ <p>phpBB is free software, released under the terms of the <a href="http://opensource.org/licenses/gpl-2.0.php">GNU General Public License, version 2 (GPL-2.0)</a>. Copyright © <a href="https://www.phpbb.com">phpBB Limited</a>. For full copyright and license information, please see the docs/CREDITS.txt file.</p>
</div>
<div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<!-- END DOCUMENT -->
@@ -2340,7 +2566,7 @@ if (utf8_case_fold_nfc($string1) == utf8_case_fold_nfc($string2))
</div></div>
<div>
- <a id="bottom" name="bottom" accesskey="z"></a>
+ <a id="bottom" accesskey="z"></a>
</div>
</body>
diff --git a/phpBB/docs/corners_left.gif b/phpBB/docs/corners_left.gif
deleted file mode 100644
index 206e50368d..0000000000
--- a/phpBB/docs/corners_left.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/docs/corners_left.png b/phpBB/docs/corners_left.png
deleted file mode 100644
index 256bde3daa..0000000000
--- a/phpBB/docs/corners_left.png
+++ /dev/null
Binary files differ
diff --git a/phpBB/docs/corners_right.gif b/phpBB/docs/corners_right.gif
deleted file mode 100644
index 0ba66d50b2..0000000000
--- a/phpBB/docs/corners_right.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/docs/corners_right.png b/phpBB/docs/corners_right.png
deleted file mode 100644
index df41823b4c..0000000000
--- a/phpBB/docs/corners_right.png
+++ /dev/null
Binary files differ
diff --git a/phpBB/docs/events.md b/phpBB/docs/events.md
new file mode 100644
index 0000000000..417666c09e
--- /dev/null
+++ b/phpBB/docs/events.md
@@ -0,0 +1,2952 @@
+acp_ban_cell_append
+===
+* Location: adm/style/acp_ban.html
+* Since: 3.1.7-RC1
+* Purpose: Add content at the end of the ban cell area
+
+acp_ban_cell_prepend
+===
+* Location: adm/style/acp_ban.html
+* Since: 3.1.7-RC1
+* Purpose: Add content at the start of the ban cell area
+
+acp_bbcodes_actions_append
+===
+* Location: adm/style/acp_bbcodes.html
+* Since: 3.1.0-a3
+* Purpose: Add actions to the BBCodes page, after edit/delete buttons
+
+acp_bbcodes_actions_prepend
+===
+* Location: adm/style/acp_bbcodes.html
+* Since: 3.1.0-a3
+* Purpose: Add actions to the BBCodes page, before edit/delete buttons
+
+acp_bbcodes_edit_fieldsets_after
+===
+* Location: adm/style/acp_bbcodes.html
+* Since: 3.1.0-a3
+* Purpose: Add settings to BBCode add/edit form
+
+acp_email_group_options_append
+===
+* Location: adm/style/acp_email.html
+* Since: 3.1.7-RC1
+* Purpose: Add content at the end of the group options select box
+
+acp_email_group_options_prepend
+===
+* Location: adm/style/acp_email.html
+* Since: 3.1.7-RC1
+* Purpose: Add content at the start of the group options select box
+
+acp_email_find_username_append
+===
+* Location: adm/style/acp_email.html
+* Since: 3.1.7-RC1
+* Purpose: Add content at the end of the fimd username link
+
+acp_email_find_username_prepend
+===
+* Location: adm/style/acp_email.html
+* Since: 3.1.7-RC1
+* Purpose: Add content at the start of the fimd username link
+
+acp_email_options_after
+===
+* Location: adm/style/acp_email.html
+* Since: 3.1.2-RC1
+* Purpose: Add settings to mass email form
+
+acp_ext_details_end
+===
+* Location: adm/style/acp_ext_details.html
+* Since: 3.1.11-RC1
+* Purpose: Add more detailed information on extension after the available information.
+
+acp_ext_details_notice
+===
+* Location: adm/style/acp_ext_details.html
+* Since: 3.1.11-RC1
+* Purpose: Add extension detail notices after version check information.
+
+acp_ext_list_disabled_name_after
+===
+* Location: adm/style/acp_ext_list.html
+* Since: 3.1.11-RC1
+* Purpose: Add content after the name of disabled extensions in the list
+
+acp_ext_list_disabled_title_after
+===
+* Location: adm/style/acp_ext_list.html
+* Since: 3.1.11-RC1
+* Purpose: Add text after disabled extensions section title.
+
+acp_ext_list_enabled_name_after
+===
+* Location: adm/style/acp_ext_list.html
+* Since: 3.1.11-RC1
+* Purpose: Add content after the name of enabled extensions in the list
+
+acp_ext_list_enabled_title_after
+===
+* Location: adm/style/acp_ext_list.html
+* Since: 3.1.11-RC1
+* Purpose: Add text after enabled extensions section title.
+
+acp_forums_custom_settings
+===
+* Location: adm/style/acp_forums.html
+* Since: 3.1.6-RC1
+* Purpose: Add its own box (fieldset) for extension settings
+
+acp_forums_main_settings_append
+===
+* Location: adm/style/acp_forums.html
+* Since: 3.1.2-RC1
+* Purpose: Add settings to forums at end of main settings section
+
+acp_forums_main_settings_prepend
+===
+* Location: adm/style/acp_forums.html
+* Since: 3.1.2-RC1
+* Purpose: Add settings to forums before main settings section
+
+acp_forums_normal_settings_append
+===
+* Location: adm/style/acp_forums.html
+* Since: 3.1.0-a1
+* Purpose: Add settings to forums at end of normal settings section
+
+acp_forums_normal_settings_prepend
+===
+* Location: adm/style/acp_forums.html
+* Since: 3.1.2-RC1
+* Purpose: Add settings to forums before normal settings section
+
+acp_forums_prune_settings_append
+===
+* Location: adm/style/acp_forums.html
+* Since: 3.1.2-RC1
+* Purpose: Add settings to forums at end of prune settings section
+
+acp_forums_prune_settings_prepend
+===
+* Location: adm/style/acp_forums.html
+* Since: 3.1.2-RC1
+* Purpose: Add settings to forums before prune settings section
+
+acp_forums_quick_select_button_append
+===
+* Location: adm/style/acp_forums.html
+* Since: 3.1.7-RC1
+* Purpose: Add content after the quick select forum submit button
+
+acp_forums_quick_select_button_prepend
+===
+* Location: adm/style/acp_forums.html
+* Since: 3.1.7-RC1
+* Purpose: Add content before the quick select forum submit button
+
+acp_forums_rules_settings_append
+===
+* Location: adm/style/acp_forums.html
+* Since: 3.1.2-RC1
+* Purpose: Add settings to forums at end of rules settings section
+
+acp_forums_rules_settings_prepend
+===
+* Location: adm/style/acp_forums.html
+* Since: 3.1.2-RC1
+* Purpose: Add settings to forums before rules settings section
+
+acp_group_options_before
+===
+* Location: adm/style/acp_groups.html
+* Since: 3.1.0-b4
+* Purpose: Add addtional options to group settings (before GROUP_FOUNDER_MANAGE)
+
+acp_group_options_after
+===
+* Location: adm/style/acp_groups.html
+* Since: 3.1.0-b4
+* Purpose: Add addtional options to group settings (after GROUP_RECEIVE_PM)
+
+acp_groups_find_username_append
+===
+* Location: adm/style/acp_groups.html
+* Since: 3.1.7-RC1
+* Purpose: Add content at the end of the find username link
+
+acp_groups_find_username_prepend
+===
+* Location: adm/style/acp_groups.html
+* Since: 3.1.7-RC1
+* Purpose: Add content at the start of the find username link
+
+acp_groups_manage_after
+===
+* Location: adm/style/acp_groups.html
+* Since: 3.1.7-RC1
+* Purpose: Add content after the manage groups table
+
+acp_groups_manage_before
+===
+* Location: adm/style/acp_groups.html
+* Since: 3.1.7-RC1
+* Purpose: Add content before the manage groups table
+
+acp_groups_position_legend_add_button_after
+===
+* Location: adm/style/acp_groups_position.html
+* Since: 3.1.7-RC1
+* Purpose: Add content after adding group to legend submit button
+
+acp_groups_position_legend_add_button_before
+===
+* Location: adm/style/acp_groups_position.html
+* Since: 3.1.7-RC1
+* Purpose: Add content before adding group to legend submit button
+
+acp_groups_position_teampage_add_button_after
+===
+* Location: adm/style/acp_groups_position.html
+* Since: 3.1.7-RC1
+* Purpose: Add content after adding group to teampage submit button
+
+acp_groups_position_teampage_add_button_before
+===
+* Location: adm/style/acp_groups_position.html
+* Since: 3.1.7-RC1
+* Purpose: Add content before adding group to teampage submit button
+
+acp_logs_quick_select_forum_button_append
+===
+* Location: adm/style/acp_logs.html
+* Since: 3.1.7-RC1
+* Purpose: Add content after the quick forum select form submit button
+
+acp_logs_quick_select_forum_button_prepend
+===
+* Location: adm/style/acp_logs.html
+* Since: 3.1.7-RC1
+* Purpose: Add content before the quick forum select form submit button
+
+acp_main_actions_append
+===
+* Location: adm/style/acp_main.html
+* Since: 3.1.0-a1
+* Purpose: Add actions to the ACP main page below the cache purge action
+
+acp_main_notice_after
+===
+* Location: adm/style/acp_main.html
+* Since: 3.1.0-a1
+* Purpose: Add notices or other blocks in the ACP below other configuration notices
+
+acp_overall_footer_after
+===
+* Location: adm/style/overall_footer.html
+* Since: 3.1.0-a1
+* Purpose: Add content below the footer in the ACP
+
+acp_overall_header_body_before
+===
+* Location: adm/style/overall_header.html
+* Since: 3.1.0-b2
+* Purpose: Add content to the header body
+
+acp_overall_header_head_append
+===
+* Location: adm/style/overall_header.html
+* Since: 3.1.0-a1
+* Purpose: Add assets within the `<head>` tags in the ACP
+
+acp_overall_header_stylesheets_after
+===
+* Location: adm/style/overall_header.html
+* Since: 3.1.0-RC3
+* Purpose: Add assets after stylesheets within the `<head>` tags in the ACP.
+Note that INCLUDECSS will not work with this event.
+
+acp_permission_forum_copy_src_forum_append
+===
+* Location: adm/style/permission_forum_copy.html
+* Since: 3.1.7-RC1
+* Purpose: Add content after the sourse forum select form
+
+acp_permission_forum_copy_src_forum_prepend
+===
+* Location: adm/style/permission_forum_copy.html
+* Since: 3.1.7-RC1
+* Purpose: Add content before the sourse forum select form
+
+acp_permission_forum_copy_dest_forum_append
+===
+* Location: adm/style/permission_forum_copy.html
+* Since: 3.1.7-RC1
+* Purpose: Add content after the destiny forum select form
+
+acp_permission_forum_copy_dest_forum_prepend
+===
+* Location: adm/style/permission_forum_copy.html
+* Since: 3.1.7-RC1
+* Purpose: Add content before the destiny forum select form
+
+acp_permissions_add_group_options_append
+===
+* Location: adm/style/acp_permissions.html
+* Since: 3.1.7-RC1
+* Purpose: Add content after the group multiple select form
+
+acp_permissions_add_group_options_prepend
+===
+* Location: adm/style/acp_permissions.html
+* Since: 3.1.7-RC1
+* Purpose: Add content before the group multiple select form
+
+acp_permissions_find_username_append
+===
+* Location: adm/style/acp_permissions.html
+* Since: 3.1.7-RC1
+* Purpose: Add content after the find username link
+
+acp_permissions_find_username_prepend
+===
+* Location: adm/style/acp_permissions.html
+* Since: 3.1.7-RC1
+* Purpose: Add content before the find username link
+
+acp_permissions_select_forum_append
+===
+* Location: adm/style/acp_permissions.html
+* Since: 3.1.7-RC1
+* Purpose: Add content after the forum select form label
+
+acp_permissions_select_forum_prepend
+===
+* Location: adm/style/acp_permissions.html
+* Since: 3.1.7-RC1
+* Purpose: Add content before the forum select form label
+
+acp_permissions_select_group_after
+===
+* Location: adm/style/acp_permissions.html
+* Since: 3.1.7-RC1
+* Purpose: Add content after the group select form in usergroup view
+
+acp_permissions_select_group_append
+===
+* Location: adm/style/acp_permissions.html
+* Since: 3.1.7-RC1
+* Purpose: Add content after the group select form label
+
+acp_permissions_select_group_before
+===
+* Location: adm/style/acp_permissions.html
+* Since: 3.1.7-RC1
+* Purpose: Add content before the group select form in usergroup view
+
+acp_permissions_select_group_prepend
+===
+* Location: adm/style/acp_permissions.html
+* Since: 3.1.7-RC1
+* Purpose: Add content before the group select form label
+
+acp_permissions_select_multiple_forum_append
+===
+* Location: adm/style/acp_permissions.html
+* Since: 3.1.7-RC1
+* Purpose: Add content after the forum multiple select form label
+
+acp_permissions_select_multiple_forum_prepend
+===
+* Location: adm/style/acp_permissions.html
+* Since: 3.1.7-RC1
+* Purpose: Add content before the forum multiple select form label
+
+acp_posting_buttons_after
+===
+* Locations:
+ + adm/style/acp_posting_buttons.html
+* Since: 3.1.0-b4
+* Purpose: Add content after BBCode posting buttons in the ACP
+
+acp_posting_buttons_before
+===
+* Locations:
+ + adm/style/acp_posting_buttons.html
+* Since: 3.1.0-b4
+* Purpose: Add content before BBCode posting buttons in the ACP
+
+acp_posting_buttons_custom_tags_before
+===
+* Locations:
+ + adm/style/acp_posting_buttons.html
+* Since: 3.1.10-RC1
+* Purpose: Add content before the custom BBCodes in the ACP
+
+acp_profile_contact_before
+===
+* Locations:
+ + adm/style/acp_profile.html
+* Since: 3.1.6-RC1
+* Purpose: Add extra options to custom profile field configuration in the ACP
+
+acp_profile_contact_last
+===
+* Locations:
+ + adm/style/acp_profile.html
+* Since: 3.1.11-RC1
+* Purpose: Add contact specific options to custom profile fields in the ACP
+
+acp_profile_step_one_lang_after
+===
+* Locations:
+ + adm/style/acp_profile.html
+* Since: 3.1.11-RC1
+* Purpose: Add extra lang specific options to custom profile field step one configuration in the ACP
+
+acp_prune_forums_append
+===
+* Locations:
+ + adm/style/acp_prune_forums.html
+* Since: 3.1.7-RC1
+* Purpose: Add content after the forum select form label
+
+acp_prune_forums_prepend
+===
+* Locations:
+ + adm/style/acp_prune_forums.html
+* Since: 3.1.7-RC1
+* Purpose: Add content before the forum select form label
+
+acp_prune_users_find_username_append
+===
+* Locations:
+ + adm/style/acp_prune_users.html
+* Since: 3.1.7-RC1
+* Purpose: Add content after the find username link
+
+acp_prune_users_find_username_prepend
+===
+* Locations:
+ + adm/style/acp_prune_users.html
+* Since: 3.1.7-RC1
+* Purpose: Add content before the find username link
+
+acp_ranks_edit_after
+===
+* Locations:
+ + adm/style/acp_ranks.html
+* Since: 3.1.0-RC3
+* Purpose: Add content after the rank details when editing a rank in the ACP
+
+acp_ranks_edit_before
+===
+* Locations:
+ + adm/style/acp_ranks.html
+* Since: 3.1.0-RC3
+* Purpose: Add content before the rank details when editing a rank in the ACP
+
+acp_ranks_list_column_after
+===
+* Locations:
+ + adm/style/acp_ranks.html
+* Since: 3.1.0-RC3
+* Purpose: Add content before the first column in the ranks list in the ACP
+
+acp_ranks_list_column_before
+===
+* Locations:
+ + adm/style/acp_ranks.html
+* Since: 3.1.0-RC3
+* Purpose: Add content after the last column (but before the action column)
+in the ranks list in the ACP
+
+acp_ranks_list_header_after
+===
+* Locations:
+ + adm/style/acp_ranks.html
+* Since: 3.1.0-RC3
+* Purpose: Add content before the first header-column in the ranks list in the ACP
+
+acp_ranks_list_header_before
+===
+* Locations:
+ + adm/style/acp_ranks.html
+* Since: 3.1.0-RC3
+* Purpose: Add content after the last header-column (but before the action column)
+in the ranks list in the ACP
+
+acp_styles_list_before
+===
+* Locations:
+ + adm/style/acp_styles.html
+* Since: 3.1.7-RC1
+* Purpose: Add content before list of styles
+
+acp_users_profile_before
+===
+* Locations:
+ + adm/style/acp_users_profile.html
+* Since: 3.1.4-RC1
+* Purpose: Add content before the profile details when editing a user in the ACP
+
+acp_users_profile_after
+===
+* Locations:
+ + adm/style/acp_users_profile.html
+* Since: 3.1.4-RC1
+* Purpose: Add content after the profile details but before the custom profile fields when editing a user in the ACP
+
+acp_users_profile_custom_after
+===
+* Locations:
+ + adm/style/acp_users_profile.html
+* Since: 3.1.4-RC1
+* Purpose: Add content after the the custom profile fields when editing a user in the ACP
+
+acp_simple_footer_after
+===
+* Location: adm/style/simple_footer.html
+* Since: 3.1.0-a1
+* Purpose: Add content below the simple footer in the ACP
+
+acp_simple_header_body_before
+===
+* Location: adm/style/simple_header.html
+* Since: 3.1.0-b2
+* Purpose: Add content to the header body
+
+acp_simple_header_head_append
+===
+* Location: adm/style/simple_header.html
+* Since: 3.1.0-a1
+* Purpose: Add assets within the `<head>` tags in the simple header of the ACP
+
+acp_simple_header_stylesheets_after
+===
+* Location: adm/style/simple_header.html
+* Since: 3.1.0-RC3
+* Purpose: Add assets after stylesheets within the `<head>` tags in the simple header
+of the ACP. Note that INCLUDECSS will not work with this event.
+
+acp_users_overview_options_append
+===
+* Location: adm/style/acp_users_overview.html
+* Since: 3.1.0-a1
+* Purpose: Add options and settings on user overview page
+
+acp_users_prefs_append
+===
+* Location: adm/style/acp_users_prefs.html
+* Since: 3.1.0-b3
+* Purpose: Add user options fieldset to the bottom of ACP users prefs settings
+
+acp_users_prefs_prepend
+===
+* Location: adm/style/acp_users_prefs.html
+* Since: 3.1.0-b3
+* Purpose: Add user options fieldset to the top of ACP users prefs settings
+
+acp_users_prefs_personal_append
+===
+* Location: adm/style/acp_users_prefs.html
+* Since: 3.1.0-b3
+* Purpose: Add user options fieldset to the bottom of ACP users personal prefs settings
+
+acp_users_prefs_personal_prepend
+===
+* Location: adm/style/acp_users_prefs.html
+* Since: 3.1.0-b3
+* Purpose: Add user options fieldset to the top of ACP users personal prefs settings
+
+acp_users_prefs_post_append
+===
+* Location: adm/style/acp_users_prefs.html
+* Since: 3.1.0-b3
+* Purpose: Add user options fieldset to the bottom of ACP users post prefs settings
+
+acp_users_prefs_post_prepend
+===
+* Location: adm/style/acp_users_prefs.html
+* Since: 3.1.0-b3
+* Purpose: Add user options fieldset to the top of ACP users post prefs settings
+
+acp_users_prefs_view_append
+===
+* Location: adm/style/acp_users_prefs.html
+* Since: 3.1.0-b3
+* Purpose: Add user options fieldset to the bottom of ACP users view prefs settings
+
+acp_users_prefs_view_prepend
+===
+* Location: adm/style/acp_users_prefs.html
+* Since: 3.1.0-b3
+* Purpose: Add user options fieldset to the top of ACP users view prefs settings
+
+acp_users_select_group_after
+===
+* Location: adm/style/acp_users.html
+* Since: 3.1.7-RC1
+* Purpose: Add content after group select form
+
+acp_users_select_group_before
+===
+* Location: adm/style/acp_users.html
+* Since: 3.1.7-RC1
+* Purpose: Add content before group select form
+
+attachment_file_after
+===
+* Locations:
+ + styles/prosilver/template/attachment.html
+ + styles/subsilver2/template/attachment.html
+* Since: 3.1.6-RC1
+* Purpose: Add content after the attachment.
+
+attachment_file_append
+===
+* Locations:
+ + styles/prosilver/template/attachment.html
+ + styles/subsilver2/template/attachment.html
+* Since: 3.1.6-RC1
+* Purpose: Add custom attachment types displaying to the bottom of attachment block.
+
+attachment_file_before
+===
+* Locations:
+ + styles/prosilver/template/attachment.html
+ + styles/subsilver2/template/attachment.html
+* Since: 3.1.6-RC1
+* Purpose: Add content before the attachment.
+
+attachment_file_prepend
+===
+* Locations:
+ + styles/prosilver/template/attachment.html
+ + styles/subsilver2/template/attachment.html
+* Since: 3.1.6-RC1
+* Purpose: Add custom attachment types displaying to the top of attachment block.
+
+forumlist_body_category_header_after
+===
+* Locations:
+ + styles/prosilver/template/forumlist_body.html
+ + styles/subsilver2/template/forumlist_body.html
+* Since: 3.1.0-a4
+* Purpose: Add content after the header of the category on the forum list.
+
+forumlist_body_category_header_before
+===
+* Locations:
+ + styles/prosilver/template/forumlist_body.html
+ + styles/subsilver2/template/forumlist_body.html
+* Since: 3.1.0-a4
+* Purpose: Add content before the header of the category on the forum list.
+
+forumlist_body_category_header_row_append
+===
+* Locations:
+ + styles/prosilver/template/forumlist_body.html
+* Since: 3.1.5-RC1
+* Purpose: Add content after the header row of the category on the forum list.
+
+forumlist_body_category_header_row_prepend
+===
+* Locations:
+ + styles/prosilver/template/forumlist_body.html
+* Since: 3.1.5-RC1
+* Purpose: Add content before the header row of the category on the forum list.
+
+forumlist_body_forum_row_after
+===
+* Locations:
+ + styles/prosilver/template/forumlist_body.html
+ + styles/subsilver2/template/forumlist_body.html
+* Since: 3.1.0-RC5
+* Purpose: Add content after the forum list item.
+
+forumlist_body_forum_row_append
+===
+* Locations:
+ + styles/prosilver/template/forumlist_body.html
+ + styles/subsilver2/template/forumlist_body.html
+* Since: 3.1.0-RC5
+* Purpose: Add content at the start of the forum list item.
+
+forumlist_body_forum_row_before
+===
+* Locations:
+ + styles/prosilver/template/forumlist_body.html
+ + styles/subsilver2/template/forumlist_body.html
+* Since: 3.1.0-RC5
+* Purpose: Add content before the forum list item.
+
+forumlist_body_forum_row_prepend
+===
+* Locations:
+ + styles/prosilver/template/forumlist_body.html
+ + styles/subsilver2/template/forumlist_body.html
+* Since: 3.1.0-RC5
+* Purpose: Add content at the end of the forum list item.
+
+forumlist_body_last_post_title_prepend
+===
+* Locations:
+ + styles/prosilver/template/forumlist_body.html
+ + styles/subsilver2/template/forumlist_body.html
+* Since: 3.1.0-a1
+* Purpose: Add content before the post title of the latest post in a forum on the forum list.
+
+forumlist_body_subforum_link_append
+===
+* Locations:
+ + styles/prosilver/template/forumlist_body.html
+ + styles/subsilver2/template/forumlist_body.html
+* Since: 3.1.11-RC1
+* Purpose: Add content at the end of subforum link item.
+
+forumlist_body_subforum_link_prepend
+===
+* Locations:
+ + styles/prosilver/template/forumlist_body.html
+ + styles/subsilver2/template/forumlist_body.html
+* Since: 3.1.11-RC1
+* Purpose: Add content at the start of subforum link item.
+
+forumlist_body_subforums_after
+===
+* Locations:
+ + styles/prosilver/template/forumlist_body.html
+ + styles/subsilver2/template/forumlist_body.html
+* Since: 3.1.0-a4
+* Purpose: Add content after the list of subforums (if any) for each forum on the forum list.
+
+forumlist_body_subforums_before
+===
+* Locations:
+ + styles/prosilver/template/forumlist_body.html
+ + styles/subsilver2/template/forumlist_body.html
+* Since: 3.1.0-a4
+* Purpose: Add content before the list of subforums (if any) for each forum on the forum list.
+
+forumlist_body_last_row_after
+===
+* Locations:
+ + styles/prosilver/template/forumlist_body.html
+ + styles/subsilver2/template/forumlist_body.html
+* Since: 3.1.0-b2
+* Purpose: Add content after the very last row of the forum list.
+
+index_body_birthday_block_before
+===
+* Locations:
+ + styles/prosilver/template/index_body.html
+ + styles/subsilver2/template/index_body.html
+* Since: 3.1.11-RC1
+* Purpose: Add new statistic blocks before the Birthday block
+
+index_body_block_birthday_append
+===
+* Locations:
+ + styles/prosilver/template/index_body.html
+ + styles/subsilver2/template/index_body.html
+* Since: 3.1.0-b3
+* Purpose: Append content to the birthday list on the Board index
+
+index_body_block_birthday_prepend
+===
+* Locations:
+ + styles/prosilver/template/index_body.html
+ + styles/subsilver2/template/index_body.html
+* Since: 3.1.0-b3
+* Purpose: Prepend content to the birthday list on the Board index
+
+index_body_block_online_append
+===
+* Locations:
+ + styles/prosilver/template/index_body.html
+ + styles/subsilver2/template/index_body.html
+* Since: 3.1.0-b3
+* Purpose: Append content to the online list on the Board index
+
+index_body_block_online_prepend
+===
+* Locations:
+ + styles/prosilver/template/index_body.html
+ + styles/subsilver2/template/index_body.html
+* Since: 3.1.0-b3
+* Purpose: Prepend content to the online list on the Board index
+
+index_body_block_stats_append
+===
+* Locations:
+ + styles/prosilver/template/index_body.html
+ + styles/subsilver2/template/index_body.html
+* Since: 3.1.0-b3
+* Purpose: Append content to the statistics list on the Board index
+
+index_body_block_stats_prepend
+===
+* Locations:
+ + styles/prosilver/template/index_body.html
+ + styles/subsilver2/template/index_body.html
+* Since: 3.1.0-b3
+* Purpose: Prepend content to the statistics list on the Board index
+
+index_body_forumlist_body_after
+===
+* Locations:
+ + styles/prosilver/template/index_body.html
+ + styles/subsilver2/template/index_body.html
+* Since: 3.1.1
+* Purpose: Add content after the forum list body on the index page
+
+index_body_markforums_after
+===
+* Locations:
+ + styles/prosilver/template/index_body.html
+ + styles/subsilver2/template/index_body.html
+* Since: 3.1.0-RC2
+* Purpose: Add content after the mark-read link above the forum list on Board index
+
+index_body_markforums_before
+===
+* Locations:
+ + styles/prosilver/template/index_body.html
+ + styles/subsilver2/template/index_body.html
+* Since: 3.1.0-RC2
+* Purpose: Add content before the mark-read link above the forum list on Board index
+
+index_body_stat_blocks_after
+===
+* Locations:
+ + styles/prosilver/template/index_body.html
+ + styles/subsilver2/template/index_body.html
+* Since: 3.1.0-b3
+* Purpose: Add new statistic blocks below the Who Is Online and Board Statistics blocks
+
+index_body_stat_blocks_before
+===
+* Locations:
+ + styles/prosilver/template/index_body.html
+ + styles/subsilver2/template/index_body.html
+* Since: 3.1.0-a1
+* Purpose: Add new statistic blocks above the Who Is Online and Board Statistics blocks
+
+mcp_ban_fields_after
+===
+* Locations:
+ + styles/prosilver/template/mcp_ban.html
+ + styles/subsilver2/template/mcp_ban.html
+* Since: 3.1.0-RC3
+* Purpose: Add additional fields to the ban form in MCP
+
+mcp_ban_fields_before
+===
+* Locations:
+ + styles/prosilver/template/mcp_ban.html
+ + styles/subsilver2/template/mcp_ban.html
+* Since: 3.1.0-RC3
+* Purpose: Add additional fields to the ban form in MCP
+
+mcp_ban_unban_after
+===
+* Locations:
+ + styles/prosilver/template/mcp_ban.html
+ + styles/subsilver2/template/mcp_ban.html
+* Since: 3.1.0-RC3
+* Purpose: Add additional fields to the unban form in MCP
+
+mcp_ban_unban_before
+===
+* Locations:
+ + styles/prosilver/template/mcp_ban.html
+ + styles/subsilver2/template/mcp_ban.html
+* Since: 3.1.0-RC3
+* Purpose: Add additional fields to the unban form in MCP
+
+mcp_forum_actions_after
+===
+* Locations:
+ + styles/prosilver/template/mcp_forum.html
+ + styles/subsilver2/template/mcp_forum.html
+* Since: 3.1.11-RC1
+* Purpose: Add some information after actions fieldset
+
+mcp_forum_actions_append
+===
+* Locations:
+ + styles/prosilver/template/mcp_forum.html
+ + styles/subsilver2/template/mcp_forum.html
+* Since: 3.1.11-RC1
+* Purpose: Add additional options to actions select
+
+mcp_forum_actions_before
+===
+* Locations:
+ + styles/prosilver/template/mcp_forum.html
+ + styles/subsilver2/template/mcp_forum.html
+* Since: 3.1.11-RC1
+* Purpose: Add some information before actions fieldset
+
+mcp_forum_topic_title_before
+===
+* Locations:
+ + styles/prosilver/template/mcp_forum.html
+ + styles/subsilver2/template/mcp_forum.html
+* Since: 3.1.6-RC1
+* Purpose: Add some information before the topic title
+
+mcp_forum_topic_title_after
+===
+* Locations:
+ + styles/prosilver/template/mcp_forum.html
+ + styles/subsilver2/template/mcp_forum.html
+* Since: 3.1.6-RC1
+* Purpose: Add some information after the topic title
+
+mcp_front_latest_logs_after
+===
+* Locations:
+ + styles/prosilver/template/mcp_front.html
+ + styles/subsilver2/template/mcp_front.html
+* Since: 3.1.3-RC1
+* Purpose: Add content after latest logs list
+
+mcp_front_latest_logs_before
+===
+* Locations:
+ + styles/prosilver/template/mcp_front.html
+ + styles/subsilver2/template/mcp_front.html
+* Since: 3.1.3-RC1
+* Purpose: Add content before latest logs list
+
+mcp_front_latest_reported_before
+===
+* Locations:
+ + styles/prosilver/template/mcp_front.html
+ + styles/subsilver2/template/mcp_front.html
+* Since: 3.1.3-RC1
+* Purpose: Add content before latest reported posts list
+
+mcp_front_latest_reported_pms_before
+===
+* Locations:
+ + styles/prosilver/template/mcp_front.html
+ + styles/subsilver2/template/mcp_front.html
+* Since: 3.1.3-RC1
+* Purpose: Add content before latest reported private messages list
+
+mcp_front_latest_unapproved_before
+===
+* Locations:
+ + styles/prosilver/template/mcp_front.html
+ + styles/subsilver2/template/mcp_front.html
+* Since: 3.1.3-RC1
+* Purpose: Add content before latest unapproved posts list
+
+mcp_move_before
+===
+* Locations:
+ + styles/prosilver/template/mcp_move.html
+ + styles/subsilver2/template/mcp_move.html
+* Since: 3.1.10-RC1
+* Purpose: Add content before move topic/post form
+
+mcp_post_additional_options
+===
+* Locations:
+ + styles/prosilver/template/mcp_post.html
+ + styles/subsilver2/template/mcp_post.html
+* Since: 3.1.5-RC1
+* Purpose: Add content within the list of post moderation actions
+
+mcp_topic_options_after
+===
+* Locations:
+ + styles/prosilver/template/mcp_topic.html
+ + styles/subsilver2/template/mcp_topic.html
+* Since: 3.1.6-RC1
+* Purpose: Add some options (field, checkbox, ...) after the subject field when split a subject
+
+mcp_topic_options_before
+===
+* Locations:
+ + styles/prosilver/template/mcp_topic.html
+ + styles/subsilver2/template/mcp_topic.html
+* Since: 3.1.6-RC1
+* Purpose: Add some options (field, checkbox, ...) before the subject field when split a subject
+
+mcp_topic_postrow_post_details_after
+===
+* Locations:
+ + styles/prosilver/template/mcp_topic.html
+ + styles/subsilver2/template/mcp_topic.html
+* Since: 3.1.10-RC1
+* Purpose: Add content after post details in topic moderation
+
+mcp_topic_postrow_post_details_before
+===
+* Locations:
+ + styles/prosilver/template/mcp_topic.html
+ + styles/subsilver2/template/mcp_topic.html
+* Since: 3.1.10-RC1
+* Purpose: Add content before post details in topic moderation
+
+mcp_topic_postrow_post_subject_after
+===
+* Locations:
+ + styles/prosilver/template/mcp_topic.html
+* Since: 3.1.11-RC1
+* Purpose: Add content after post subject in topic moderation
+
+mcp_topic_postrow_post_subject_before
+===
+* Locations:
+ + styles/prosilver/template/mcp_topic.html
+* Since: 3.1.11-RC1
+* Purpose: Add content before post subject in topic moderation
+
+mcp_topic_topic_title_after
+===
+* Locations:
+ + styles/prosilver/template/mcp_topic.html
+ + styles/subsilver2/template/mcp_topic.html
+* Since: 3.1.6-RC1
+* Purpose: Add some information after the topic title
+
+mcp_topic_topic_title_before
+===
+* Locations:
+ + styles/prosilver/template/mcp_topic.html
+ + styles/subsilver2/template/mcp_topic.html
+* Since: 3.1.6-RC1
+* Purpose: Add some information before the topic title
+
+mcp_warn_post_add_warning_field_after
+===
+* Locations:
+ + styles/prosilver/template/mcp_warn_post.html
+ + styles/subsilver2/template/mcp_warn_post.html
+* Since: 3.1.0-RC4
+* Purpose: Add content during warning for a post - after add warning field.
+
+mcp_warn_post_add_warning_field_before
+===
+* Locations:
+ + styles/prosilver/template/mcp_warn_post.html
+ + styles/subsilver2/template/mcp_warn_post.html
+* Since: 3.1.0-RC4
+* Purpose: Add content during warning for a post - before add warning field.
+
+mcp_warn_user_add_warning_field_after
+===
+* Locations:
+ + styles/prosilver/template/mcp_warn_user.html
+ + styles/subsilver2/template/mcp_warn_user.html
+* Since: 3.1.0-RC4
+* Purpose: Add content during warning a user - after add warning field.
+
+mcp_warn_user_add_warning_field_before
+===
+* Locations:
+ + styles/prosilver/template/mcp_warn_user.html
+ + styles/subsilver2/template/mcp_warn_user.html
+* Since: 3.1.0-RC4
+* Purpose: Add content during warning a user - before add warning field.
+
+memberlist_body_rank_append
+===
+* Locations:
+ + styles/prosilver/template/memberlist_body.html
+ + styles/subsilver2/template/memberlist_body.html
+* Since: 3.1.6-RC1
+* Purpose: Add information after rank in memberlist. Works in
+all display modes (leader, group and normal memberlist).
+
+memberlist_body_rank_prepend
+===
+* Locations:
+ + styles/prosilver/template/memberlist_body.html
+ + styles/subsilver2/template/memberlist_body.html
+* Since: 3.1.6-RC1
+* Purpose: Add information before rank in memberlist. Works in
+all display modes (leader, group and normal memberlist).
+
+memberlist_body_username_append
+===
+* Locations:
+ + styles/prosilver/template/memberlist_body.html
+ + styles/subsilver2/template/memberlist_body.html
+* Since: 3.1.0-a1
+* Purpose: Add information after every username in the memberlist. Works in
+all display modes (leader, group and normal memberlist).
+
+memberlist_body_username_prepend
+===
+* Locations:
+ + styles/prosilver/template/memberlist_body.html
+ + styles/subsilver2/template/memberlist_body.html
+* Since: 3.1.0-a1
+* Purpose: Add information before every username in the memberlist. Works in
+all display modes (leader, group and normal memberlist).
+
+memberlist_email_before
+===
+* Locations:
+ + styles/prosilver/template/memberlist_email.html
+ + styles/subsilver2/template/memberlist_email.html
+* Since: 3.1.10-RC1
+* Purpose: Allow adding customizations before the memberlist_email form.
+
+memberlist_search_fields_after
+===
+* Locations:
+ + styles/prosilver/template/memberlist_search.html
+ + styles/subsilver2/template/memberlist_search.html
+* Since: 3.1.2-RC1
+* Purpose: Add information after the search fields column.
+
+memberlist_search_fields_before
+===
+* Locations:
+ + styles/prosilver/template/memberlist_search.html
+ + styles/subsilver2/template/memberlist_search.html
+* Since: 3.1.2-RC1
+* Purpose: Add information before the search fields column.
+
+memberlist_search_sorting_options_before
+===
+* Locations:
+ + styles/prosilver/template/memberlist_search.html
+ + styles/subsilver2/template/memberlist_search.html
+* Since: 3.1.2-RC1
+* Purpose: Add information before the search sorting options field.
+
+memberlist_team_username_append
+===
+* Locations:
+ + styles/prosilver/template/memberlist_team.html
+ + styles/subsilver2/template/memberlist_team.html
+* Since: 3.1.11-RC1
+* Purpose: Append information to username of team member
+
+memberlist_team_username_prepend
+===
+* Locations:
+ + styles/prosilver/template/memberlist_team.html
+ + styles/subsilver2/template/memberlist_team.html
+* Since: 3.1.11-RC1
+* Purpose: Add information before team user username
+
+memberlist_view_contact_after
+===
+* Locations:
+ + styles/prosilver/template/memberlist_view.html
+ + styles/subsilver2/template/memberlist_view.html
+* Since: 3.1.0-b2
+* Purpose: Add content after the user contact part of any user profile
+
+memberlist_view_contact_before
+===
+* Locations:
+ + styles/prosilver/template/memberlist_view.html
+ + styles/subsilver2/template/memberlist_view.html
+* Since: 3.1.0-b2
+* Purpose: Add content before the user contact part of any user profile
+
+memberlist_view_contact_custom_fields_after
+===
+* Locations:
+ + styles/prosilver/template/memberlist_view.html
+ + styles/subsilver2/template/memberlist_view.html
+* Since: 3.1.9-RC1
+* Purpose: Add content after the user contact related custom fields
+
+memberlist_view_contact_custom_fields_before
+===
+* Locations:
+ + styles/prosilver/template/memberlist_view.html
+ + styles/subsilver2/template/memberlist_view.html
+* Since: 3.1.9-RC1
+* Purpose: Add content before the user contact related custom fields
+
+memberlist_view_content_append
+===
+* Locations:
+ + styles/prosilver/template/memberlist_view.html
+ + styles/subsilver2/template/memberlist_view.html
+* Since: 3.1.0-b2
+* Purpose: Add custom content to the user profile view after the main content
+
+memberlist_view_content_prepend
+===
+* Locations:
+ + styles/prosilver/template/memberlist_view.html
+ + styles/subsilver2/template/memberlist_view.html
+* Since: 3.1.0-b3
+* Purpose: Add custom content to the user profile view before the main content
+
+memberlist_view_non_contact_custom_fields_after
+===
+* Locations:
+ + styles/prosilver/template/memberlist_view.html
+ + styles/subsilver2/template/memberlist_view.html
+* Since: 3.1.9-RC1
+* Purpose: Add content after the user not contact related custom fields
+
+memberlist_view_non_contact_custom_fields_before
+===
+* Locations:
+ + styles/prosilver/template/memberlist_view.html
+ + styles/subsilver2/template/memberlist_view.html
+* Since: 3.1.9-RC1
+* Purpose: Add content before the user not contact related custom fields
+
+memberlist_view_rank_after
+===
+* Locations:
+ + styles/subsilver2/template/memberlist_view.html
+* Since: 3.1.6-RC1
+* Purpose: Add information after rank in memberlist
+
+memberlist_view_rank_avatar_after
+===
+* Locations:
+ + styles/prosilver/template/memberlist_view.html
+* Since: 3.1.6-RC1
+* Purpose: Add information after rank in memberlist (with avatar)
+
+memberlist_view_rank_avatar_before
+===
+* Locations:
+ + styles/prosilver/template/memberlist_view.html
+* Since: 3.1.6-RC1
+* Purpose: Add information before rank in memberlist (with avatar)
+
+memberlist_view_rank_before
+===
+* Locations:
+ + styles/subsilver2/template/memberlist_view.html
+* Since: 3.1.6-RC1
+* Purpose: Add information after rank in memberlist
+
+memberlist_view_rank_no_avatar_after
+===
+* Locations:
+ + styles/prosilver/template/memberlist_view.html
+* Since: 3.1.6-RC1
+* Purpose: Add information after rank in memberlist (without avatar)
+
+memberlist_view_rank_no_avatar_before
+===
+* Locations:
+ + styles/prosilver/template/memberlist_view.html
+* Since: 3.1.6-RC1
+* Purpose: Add information before rank in memberlist (without avatar)
+
+memberlist_view_user_statistics_after
+===
+* Locations:
+ + styles/prosilver/template/memberlist_view.html
+ + styles/subsilver2/template/memberlist_view.html
+* Since: 3.1.0-a1
+* Purpose: Add entries after the user statistics part of any user profile
+
+memberlist_view_user_statistics_before
+===
+* Locations:
+ + styles/prosilver/template/memberlist_view.html
+ + styles/subsilver2/template/memberlist_view.html
+* Since: 3.1.0-a1
+* Purpose: Add entries before the user statistics part of any user profile
+
+memberlist_view_zebra_after
+===
+* Locations:
+ + styles/prosilver/template/memberlist_view.html
+ + styles/subsilver2/template/memberlist_view.html
+* Since: 3.1.9-RC1
+* Purpose: Add content after the user friends/foes links
+
+memberlist_view_zebra_before
+===
+* Locations:
+ + styles/prosilver/template/memberlist_view.html
+ + styles/subsilver2/template/memberlist_view.html
+* Since: 3.1.9-RC1
+* Purpose: Add content before the user friends/foes links
+
+navbar_header_logged_out_content
+===
+* Locations:
+ + styles/prosilver/template/navbar_header.html
+* Since: 3.1.0-RC1
+* Purpose: Add text and HTML in place of the username when not logged in.
+
+navbar_header_profile_list_after
+===
+* Locations:
+ + styles/prosilver/template/navbar_header.html
+* Since: 3.1.0-RC2
+* Purpose: Add links to the bottom of the profile drop-down menu in the header navbar
+
+navbar_header_profile_list_before
+===
+* Locations:
+ + styles/prosilver/template/navbar_header.html
+* Since: 3.1.0-RC2
+* Purpose: Add links to the top of the profile drop-down menu in the header navbar
+
+navbar_header_quick_links_after
+===
+* Locations:
+ + styles/prosilver/template/navbar_header.html
+* Since: 3.1.0-RC2
+* Purpose: Add links to the bottom of the quick-links drop-down menu in the header
+
+navbar_header_quick_links_before
+===
+* Locations:
+ + styles/prosilver/template/navbar_header.html
+* Since: 3.1.0-RC2
+* Purpose: Add links to the top of the quick-links drop-down menu in the header
+
+navbar_header_user_profile_append
+===
+* Locations:
+ + styles/prosilver/template/navbar_header.html
+* Since: 3.1.8-RC1
+* Purpose: Add links to the right of the user drop down area
+
+navbar_header_user_profile_prepend
+===
+* Locations:
+ + styles/prosilver/template/navbar_header.html
+* Since: 3.1.8-RC1
+* Purpose: Add links to the left of the notification area
+
+navbar_header_username_append
+===
+* Locations:
+ + styles/prosilver/template/navbar_header.html
+* Since: 3.1.0-RC1
+* Purpose: Add text and HTMl after the username shown in the navbar.
+
+navbar_header_username_prepend
+===
+* Locations:
+ + styles/prosilver/template/navbar_header.html
+* Since: 3.1.0-RC1
+* Purpose: Add text and HTMl before the username shown in the navbar.
+
+overall_footer_after
+===
+* Locations:
+ + styles/prosilver/template/overall_footer.html
+ + styles/subsilver2/template/overall_footer.html
+* Since: 3.1.0-a1
+* Purpose: Add content at the end of the file, directly prior to the `</body>` tag
+
+overall_footer_body_after
+===
+* Locations:
+ + styles/prosilver/template/overall_footer.html
+ + styles/subsilver2/template/overall_footer.html
+* Since: 3.1.3-RC1
+* Purpose: Add content before the `</body>` tag but after the $SCRIPTS var, i.e. after the js scripts have been loaded
+
+overall_footer_breadcrumb_append
+===
+* Locations:
+ + styles/prosilver/template/navbar_footer.html
+ + styles/subsilver2/template/breadcrumbs.html
+* Since: 3.1.0-a1
+* Purpose: Add links to the list of breadcrumbs in the footer
+
+overall_footer_breadcrumb_prepend
+===
+* Locations:
+ + styles/prosilver/template/navbar_footer.html
+ + styles/subsilver2/template/breadcrumbs.html
+* Since: 3.1.0-RC3
+* Purpose: Add links to the list of breadcrumbs in the footer (after site-home, but before board-index)
+
+overall_footer_content_after
+===
+* Locations:
+ + styles/prosilver/template/overall_footer.html
+ + styles/subsilver2/template/overall_footer.html
+* Since: 3.1.0-a3
+* Purpose: Add content on all pages after the main content, before the footer
+
+overall_footer_copyright_append
+===
+* Locations:
+ + styles/prosilver/template/overall_footer.html
+ + styles/subsilver2/template/overall_footer.html
+* Since: 3.1.0-a1
+* Purpose: Add content after the copyright line (no new line by default), before the ACP link
+
+overall_footer_copyright_prepend
+===
+* Locations:
+ + styles/prosilver/template/overall_footer.html
+ + styles/subsilver2/template/overall_footer.html
+* Since: 3.1.0-a1
+* Purpose: Add content before the copyright line
+
+overall_footer_page_body_after
+===
+* Locations:
+ + styles/prosilver/template/overall_footer.html
+ + styles/subsilver2/template/overall_footer.html
+* Since: 3.1.0-b3
+* Purpose: Add content after the page-body, but before the footer
+
+overall_footer_teamlink_after
+===
+* Locations:
+ + styles/prosilver/template/navbar_footer.html
+ + styles/subsilver2/template/index_body.html
+* Since: 3.1.0-b3
+* Purpose: Add contents after the team-link in the footer
+
+overall_footer_teamlink_before
+===
+* Locations:
+ + styles/prosilver/template/navbar_footer.html
+ + styles/subsilver2/template/index_body.html
+* Since: 3.1.0-b3
+* Purpose: Add contents before the team-link in the footer
+
+overall_footer_timezone_after
+===
+* Locations:
+ + styles/prosilver/template/navbar_footer.html
+ + styles/subsilver2/template/breadcrumbs.html
+* Since: 3.1.0-b3
+* Purpose: Add content to the navbar in the page footer, after "Timezone"
+
+overall_footer_timezone_before
+===
+* Locations:
+ + styles/prosilver/template/navbar_footer.html
+ + styles/subsilver2/template/breadcrumbs.html
+* Since: 3.1.0-b3
+* Purpose: Add content to the navbar in the page footer, before "Timezone"
+
+overall_header_body_before
+===
+* Locations:
+ + styles/prosilver/template/overall_header.html
+ + styles/subsilver2/template/overall_header.html
+* Since: 3.1.0-b2
+* Purpose: Add content to the header body
+
+overall_header_breadcrumb_append
+===
+* Locations:
+ + styles/prosilver/template/navbar_header.html
+ + styles/subsilver2/template/breadcrumbs.html
+* Since: 3.1.0-a1
+* Purpose: Add links to the list of breadcrumbs in the header
+
+overall_header_breadcrumb_prepend
+===
+* Locations:
+ + styles/prosilver/template/navbar_header.html
+ + styles/subsilver2/template/breadcrumbs.html
+* Since: 3.1.0-RC3
+* Purpose: Add links to the list of breadcrumbs in the header (after site-home, but before board-index)
+
+overall_header_breadcrumbs_after
+===
+* Locations:
+ + styles/prosilver/template/navbar_header.html
+ + styles/subsilver2/template/breadcrumbs.html
+* Since: 3.1.0-RC3
+* Purpose: Add content after the breadcrumbs (outside of the breadcrumbs container)
+
+overall_header_breadcrumbs_before
+===
+* Locations:
+ + styles/prosilver/template/navbar_header.html
+ + styles/subsilver2/template/breadcrumbs.html
+* Since: 3.1.0-RC3
+* Purpose: Add content before the breadcrumbs (outside of the breadcrumbs container)
+
+overall_header_content_before
+===
+* Locations:
+ + styles/prosilver/template/overall_header.html
+ + styles/subsilver2/template/overall_header.html
+* Since: 3.1.0-a3
+* Purpose: Add content on all pages before the main content, after the header
+
+overall_header_feeds
+===
+* Locations:
+ + styles/prosilver/template/overall_header.html
+ + styles/subsilver2/template/overall_header.html
+* Since: 3.1.6-RC1
+* Purpose: Add custom feeds
+
+overall_header_head_append
+===
+* Locations:
+ + styles/prosilver/template/overall_header.html
+ + styles/subsilver2/template/overall_header.html
+* Since: 3.1.0-a1
+* Purpose: Add asset calls directly before the `</head>` tag
+
+overall_header_headerbar_after
+===
+* Locations:
+ + styles/prosilver/template/overall_header.html
+* Since: 3.1.10-RC1
+* Purpose: Add content at the end of the headerbar
+
+overall_header_headerbar_before
+===
+* Locations:
+ + styles/prosilver/template/overall_header.html
+* Since: 3.1.10-RC1
+* Purpose: Add content at the beginning of the headerbar
+
+overall_header_navbar_before
+===
+* Locations:
+ + styles/prosilver/template/overall_header.html
+ + styles/subsilver2/template/overall_header.html
+* Since: 3.1.4-RC1
+* Purpose: Add content before the navigation bar
+
+overall_header_navigation_append
+===
+* Locations:
+ + styles/prosilver/template/navbar_header.html
+ + styles/subsilver2/template/overall_header.html
+* Since: 3.1.0-a1
+* Purpose: Add links after the navigation links in the header
+
+overall_header_navigation_prepend
+===
+* Locations:
+ + styles/prosilver/template/navbar_header.html
+ + styles/subsilver2/template/overall_header.html
+* Since: 3.1.0-a1
+* Purpose: Add links before the navigation links in the header
+
+overall_header_navlink_append
+===
+* Locations:
+ + styles/prosilver/template/navbar_header.html
+ + styles/subsilver2/template/breadcrumbs.html
+* Since: 3.1.0-b3
+* Purpose: Add content after each individual navlink (breadcrumb)
+
+overall_header_navlink_prepend
+===
+* Locations:
+ + styles/prosilver/template/navbar_header.html
+ + styles/subsilver2/template/breadcrumbs.html
+* Since: 3.1.0-b3
+* Purpose: Add content before each individual navlink (breadcrumb)
+
+overall_header_page_body_before
+===
+* Locations:
+ + styles/prosilver/template/overall_header.html
+ + styles/subsilver2/template/overall_header.html
+* Since: 3.1.0-b3
+* Purpose: Add content after the page-header, but before the page-body
+
+overall_header_searchbox_after
+===
+* Locations:
+ + styles/prosilver/template/overall_header.html
+* Since: 3.1.11-RC1
+* Purpose: Add content after the search box in the header
+
+overall_header_searchbox_before
+===
+* Locations:
+ + styles/prosilver/template/overall_header.html
+* Since: 3.1.4-RC1
+* Purpose: Add content before the search box in the header
+
+overall_header_stylesheets_after
+===
+* Locations:
+ + styles/prosilver/template/overall_header.html
+ + styles/subsilver2/template/overall_header.html
+* Since: 3.1.0-RC3
+* Purpose: Add asset calls after stylesheets within the `</head>` tag.
+Note that INCLUDECSS will not work with this event.
+
+posting_editor_add_panel_tab
+===
+* Locations:
+ + styles/prosilver/template/posting_editor.html
+* Since: 3.1.6-RC1
+* Purpose: Add custom panel to post editor
+
+posting_editor_bbcode_status_after
+===
+* Locations:
+ + styles/prosilver/template/posting_editor.html
+ + styles/subsilver2/template/posting_body.html
+* Since: 3.1.4-RC1
+* Purpose: Add content after bbcode status
+
+posting_editor_buttons_after
+===
+* Locations:
+ + styles/prosilver/template/posting_buttons.html
+ + styles/subsilver2/template/posting_buttons.html
+* Since: 3.1.0-a3
+* Purpose: Add content after the BBCode posting buttons
+
+posting_editor_buttons_before
+===
+* Locations:
+ + styles/prosilver/template/posting_buttons.html
+ + styles/subsilver2/template/posting_buttons.html
+* Since: 3.1.0-a3
+* Purpose: Add content before the BBCode posting buttons
+
+posting_editor_buttons_custom_tags_before
+===
+* Locations:
+ + styles/prosilver/template/posting_buttons.html
+ + styles/subsilver2/template/posting_buttons.html
+* Since: 3.1.2-RC1
+* Purpose: Add content inside the BBCode posting buttons and before the customs BBCode
+
+posting_editor_message_after
+===
+* Locations:
+ + styles/prosilver/template/posting_editor.html
+ + styles/subsilver2/template/posting_body.html
+* Since: 3.1.0-a2
+* Purpose: Add field (e.g. textbox) to the posting screen after the message
+
+posting_editor_message_before
+===
+* Locations:
+ + styles/prosilver/template/posting_editor.html
+ + styles/subsilver2/template/posting_body.html
+* Since: 3.1.0-a2
+* Purpose: Add field (e.g. textbox) to the posting screen before the message
+
+posting_editor_options_prepend
+===
+* Locations:
+ + styles/prosilver/template/posting_editor.html
+ + styles/subsilver2/template/posting_body.html
+* Since: 3.1.0-a1
+* Purpose: Add posting options on the posting screen
+
+posting_editor_smilies_after
+===
+* Locations:
+ + styles/prosilver/template/posting_editor.html
+ + styles/subsilver2/template/posting_body.html
+* Since: 3.1.4-RC1
+* Purpose: Add content after smilies
+
+posting_editor_smilies_before
+===
+* Locations:
+ + styles/prosilver/template/posting_editor.html
+ + styles/subsilver2/template/posting_body.html
+* Since: 3.1.4-RC1
+* Purpose: Add content before the smilies
+
+posting_editor_subject_after
+===
+* Locations:
+ + styles/prosilver/template/posting_editor.html
+ + styles/subsilver2/template/posting_body.html
+* Since: 3.1.0-a2
+* Purpose: Add field (e.g. textbox) to the posting screen after the subject
+
+posting_editor_subject_append
+===
+* Locations:
+ + styles/prosilver/template/posting_editor.html
+ + styles/subsilver2/template/posting_body.html
+* Since: 3.1.10-RC1
+* Purpose: Add field, text, etc. to the posting after the subject text box
+
+posting_editor_subject_before
+===
+* Locations:
+ + styles/prosilver/template/posting_editor.html
+ + styles/subsilver2/template/posting_body.html
+* Since: 3.1.0-a2
+* Purpose: Add field (e.g. textbox) to the posting screen before the subject
+
+posting_editor_subject_prepend
+===
+* Locations:
+ + styles/prosilver/template/posting_editor.html
+ + styles/subsilver2/template/posting_body.html
+* Since: 3.1.10-RC1
+* Purpose: Add field, text, etc. to the posting before the subject text box
+
+posting_editor_submit_buttons
+===
+* Locations:
+ + styles/prosilver/template/posting_editor.html
+ + styles/subsilver2/template/posting_body.html
+* Since: 3.1.6-RC1
+* Purpose: Add custom buttons in the posting editor
+
+posting_layout_include_panel_body
+===
+* Locations:
+ + styles/prosilver/template/posting_layout.html
+* Since: 3.1.6-RC1
+* Purpose: Add include of custom panel template body in posting editor
+
+posting_pm_header_find_username_after
+===
+* Locations:
+ + styles/prosilver/template/posting_pm_header.html
+ + styles/subsilver2/template/ucp_header.html
+* Since: 3.1.0-RC4
+* Purpose: Add content after the find username link on composing pm
+
+posting_pm_header_find_username_before
+===
+* Locations:
+ + styles/prosilver/template/posting_pm_header.html
+ + styles/subsilver2/template/ucp_header.html
+* Since: 3.1.0-RC4
+* Purpose: Add content before the find username link on composing pm
+
+posting_pm_layout_include_pm_header_after
+===
+* Locations:
+ + styles/prosilver/template/posting_pm_layout.html
+* Since: 3.1.4-RC1
+* Purpose: Add content after the include of posting_pm_header.html
+
+posting_pm_layout_include_pm_header_before
+===
+* Locations:
+ + styles/prosilver/template/posting_pm_layout.html
+* Since: 3.1.4-RC1
+* Purpose: Add content before the include of posting_pm_header.html
+
+posting_poll_body_options_after
+===
+* Locations:
+ + styles/prosilver/template/posting_poll_body.html
+ + styles/subsilver2/template/posting_poll_body.html
+* Since: 3.1.4-RC1
+* Purpose: Add content after the poll options on creating a poll
+
+posting_preview_poll_after
+===
+* Locations:
+ + styles/prosilver/template/posting_preview.html
+ + styles/subsilver2/template/posting_preview.html
+* Since: 3.1.7-RC1
+* Purpose: Add content after the poll preview block
+
+posting_topic_review_row_post_details_after
+===
+* Locations:
+ + styles/prosilver/template/posting_topic_review.html
+ + styles/subsilver2/template/posting_topic_review.html
+* Since: 3.1.10-RC1
+* Purpose: Add content after post details in topic review
+
+posting_topic_review_row_post_details_before
+===
+* Locations:
+ + styles/prosilver/template/posting_topic_review.html
+ + styles/subsilver2/template/posting_topic_review.html
+* Since: 3.1.10-RC1
+* Purpose: Add content before post details in topic review
+
+posting_topic_title_after
+===
+* Locations:
+ + styles/prosilver/template/posting_layout.html
+ + styles/subsilver2/template/posting_body.html
+* Since: 3.1.7-RC1
+* Purpose: Allows to add some information after the topic title in the posting form
+
+posting_topic_title_before
+===
+* Locations:
+ + styles/prosilver/template/posting_layout.html
+ + styles/subsilver2/template/posting_body.html
+* Since: 3.1.6-RC1
+* Purpose: Allows to add some information on the left of the topic title in the posting form
+
+quickreply_editor_panel_after
+===
+* Locations:
+ + styles/prosilver/template/quickreply_editor.html
+ + styles/subsilver2/template/quickreply_editor.html
+* Since: 3.1.0-b2
+* Purpose: Add content after the quick reply panel (but inside the form)
+
+quickreply_editor_panel_before
+===
+* Locations:
+ + styles/prosilver/template/quickreply_editor.html
+ + styles/subsilver2/template/quickreply_editor.html
+* Since: 3.1.0-b2
+* Purpose: Add content before the quick reply panel (but inside the form)
+
+quickreply_editor_message_after
+===
+* Locations:
+ + styles/prosilver/template/quickreply_editor.html
+ + styles/subsilver2/template/quickreply_editor.html
+* Since: 3.1.0-a4
+* Purpose: Add content after the quick reply textbox
+
+quickreply_editor_message_before
+===
+* Locations:
+ + styles/prosilver/template/quickreply_editor.html
+ + styles/subsilver2/template/quickreply_editor.html
+* Since: 3.1.0-a4
+* Purpose: Add content before the quick reply textbox
+
+quickreply_editor_subject_before
+===
+* Locations:
+ + styles/prosilver/template/quickreply_editor.html
+ + styles/subsilver2/template/quickreply_editor.html
+* Since: 3.1.7-RC1
+* Purpose: Add content before the quick reply subject textbox
+
+search_body_form_after
+===
+* Locations:
+ + styles/prosilver/template/search_body.html
+ + styles/subsilver2/template/search_body.html
+* Since: 3.1.7-RC1
+* Purpose: Add content after the search form
+
+search_body_form_before
+===
+* Locations:
+ + styles/prosilver/template/search_body.html
+ + styles/subsilver2/template/search_body.html
+* Since: 3.1.5-RC1
+* Purpose: Add content before the search form
+
+search_body_recent_search_after
+===
+* Locations:
+ + styles/prosilver/template/search_body.html
+ + styles/subsilver2/template/search_body.html
+* Since: 3.1.7-RC1
+* Purpose: Add content after the recent search queries list
+
+search_body_recent_search_before
+===
+* Locations:
+ + styles/prosilver/template/search_body.html
+ + styles/subsilver2/template/search_body.html
+* Since: 3.1.7-RC1
+* Purpose: Add content before the recent search queries list
+
+search_body_search_display_options_append
+===
+* Locations:
+ + styles/prosilver/template/search_body.html
+ + styles/subsilver2/template/search_body.html
+* Since: 3.1.7-RC1
+* Purpose: Put content at the bottom of the search query display options fields set
+
+search_body_search_display_options_prepend
+===
+* Locations:
+ + styles/prosilver/template/search_body.html
+ + styles/subsilver2/template/search_body.html
+* Since: 3.1.7-RC1
+* Purpose: Put content at the top of the search query display options fields set
+
+search_body_search_options_after
+===
+* Locations:
+ + styles/prosilver/template/search_body.html
+ + styles/subsilver2/template/search_body.html
+* Since: 3.1.7-RC1
+* Purpose: Add content after the search query options fields set
+
+search_body_search_options_append
+===
+* Locations:
+ + styles/prosilver/template/search_body.html
+ + styles/subsilver2/template/search_body.html
+* Since: 3.1.7-RC1
+* Purpose: Put content at the bottom of the search query options fields set
+
+search_body_search_options_before
+===
+* Locations:
+ + styles/prosilver/template/search_body.html
+ + styles/subsilver2/template/search_body.html
+* Since: 3.1.7-RC1
+* Purpose: Add content before the search query options fields set
+
+search_body_search_options_prepend
+===
+* Locations:
+ + styles/prosilver/template/search_body.html
+ + styles/subsilver2/template/search_body.html
+* Since: 3.1.7-RC1
+* Purpose: Put content at the top of the search query options fields set
+
+search_body_search_query_after
+===
+* Locations:
+ + styles/prosilver/template/search_body.html
+ + styles/subsilver2/template/search_body.html
+* Since: 3.1.7-RC1
+* Purpose: Add content after the search query fields set
+
+search_body_search_query_append
+===
+* Locations:
+ + styles/prosilver/template/search_body.html
+ + styles/subsilver2/template/search_body.html
+* Since: 3.1.7-RC1
+* Purpose: Put content at the bottom of the search query fields set
+
+search_body_search_query_before
+===
+* Locations:
+ + styles/prosilver/template/search_body.html
+ + styles/subsilver2/template/search_body.html
+* Since: 3.1.7-RC1
+* Purpose: Add content before the search query fields set
+
+search_body_search_query_prepend
+===
+* Locations:
+ + styles/prosilver/template/search_body.html
+ + styles/subsilver2/template/search_body.html
+* Since: 3.1.7-RC1
+* Purpose: Put content at the top of the search query fields set
+
+search_results_header_after
+===
+* Locations:
+ + styles/prosilver/template/search_results.html
+ + styles/subsilver2/template/search_results.html
+* Since: 3.1.4-RC1
+* Purpose: Add content after the header of the search results
+
+search_results_header_before
+===
+* Locations:
+ + styles/prosilver/template/search_results.html
+ + styles/subsilver2/template/search_results.html
+* Since: 3.1.4-RC1
+* Purpose: Add content before the header of the search results.
+
+search_results_post_after
+===
+* Locations:
+ + styles/prosilver/template/search_results.html
+ + styles/subsilver2/template/search_results.html
+* Since: 3.1.0-b3
+* Purpose: Add data after search result posts
+
+search_results_post_before
+===
+* Locations:
+ + styles/prosilver/template/search_results.html
+ + styles/subsilver2/template/search_results.html
+* Since: 3.1.0-b3
+* Purpose: Add data before search result posts
+
+search_results_postprofile_after
+===
+* Locations:
+ + styles/prosilver/template/search_results.html
+* Since: 3.1.0-b3
+* Purpose: Add content after the post author and stats in search results (posts view mode)
+
+search_results_postprofile_before
+===
+* Locations:
+ + styles/prosilver/template/search_results.html
+* Since: 3.1.0-b3
+* Purpose: Add content directly before the post author in search results (posts view mode)
+
+search_results_searchbox_after
+===
+* Locations:
+ + styles/prosilver/template/search_results.html
+ + styles/subsilver2/template/search_results.html
+* Since: 3.1.4-RC1
+* Purpose: Add content right after the searchbox of the search results.
+
+search_results_topic_after
+===
+* Locations:
+ + styles/prosilver/template/search_results.html
+ + styles/subsilver2/template/search_results.html
+* Since: 3.1.0-b4
+* Purpose: Add data after search result topics
+
+search_results_topic_before
+===
+* Locations:
+ + styles/prosilver/template/search_results.html
+ + styles/subsilver2/template/search_results.html
+* Since: 3.1.0-b4
+* Purpose: Add data before search result topics
+
+search_results_topic_title_after
+===
+* Locations:
+ + styles/prosilver/template/search_results.html
+* Since: 3.1.11-RC1
+* Purpose: Add data after search results topic title
+
+simple_footer_after
+===
+* Locations:
+ + styles/prosilver/template/simple_footer.html
+ + styles/subsilver2/template/simple_footer.html
+* Since: 3.1.0-a1
+* Purpose: Add content directly prior to the `</body>` tag of the simple footer
+
+simple_header_body_before
+===
+* Locations:
+ + styles/prosilver/template/simple_header.html
+ + styles/subsilver2/template/simple_header.html
+* Since: 3.1.0-b2
+* Purpose: Add content to the header body
+
+simple_header_head_append
+===
+* Locations:
+ + styles/prosilver/template/simple_header.html
+ + styles/subsilver2/template/simple_header.html
+* Since: 3.1.0-b4
+* Purpose: Add asset calls directly before the `</head>` tag
+
+simple_header_stylesheets_after
+===
+* Locations:
+ + styles/prosilver/template/simple_header.html
+ + styles/subsilver2/template/simple_header.html
+* Since: 3.1.0-RC3
+* Purpose: Add asset calls after stylesheets within the `</head>` tag.
+Note that INCLUDECSS will not work with this event.
+
+topiclist_row_prepend
+===
+* Locations:
+ + styles/prosilver/template/search_results.html
+ + styles/prosilver/template/viewforum_body.html
+ + styles/prosilver/template/mcp_forum.html
+ + styles/subsilver2/template/search_results.html
+ + styles/subsilver2/template/viewforum_body.html
+ + styles/subsilver2/template/mcp_forum.html
+* Since: 3.1.0-a1
+* Changed: 3.1.6-RC1 Added event to mcp_forum.html
+* Purpose: Add content into topic rows (inside the elements containing topic titles)
+
+topiclist_row_append
+===
+* Locations:
+ + styles/prosilver/template/search_results.html
+ + styles/prosilver/template/viewforum_body.html
+ + styles/prosilver/template/mcp_forum.html
+ + styles/subsilver2/template/search_results.html
+ + styles/subsilver2/template/viewforum_body.html
+ + styles/subsilver2/template/mcp_forum.html
+* Since: 3.1.0-a1
+* Changed: 3.1.6-RC1 Added event to mcp_forum.html
+* Purpose: Add content into topic rows (inside the elements containing topic titles)
+
+topiclist_row_topic_title_after
+===
+* Locations:
+ + styles/prosilver/template/search_results.html
+ + styles/prosilver/template/viewforum_body.html
+ + styles/prosilver/template/mcp_forum.html
+ + styles/subsilver2/template/search_results.html
+ + styles/subsilver2/template/viewforum_body.html
+ + styles/subsilver2/template/mcp_forum.html
+* Since: 3.1.10-RC1
+* Purpose: Add content into topic rows (after the elements containing the topic titles)
+
+ucp_agreement_terms_after
+===
+* Locations:
+ + styles/prosilver/template/ucp_agreement.html
+ + styles/subsilver2/template/ucp_agreement.html
+* Since: 3.1.0-b3
+* Purpose: Add content after the terms of agreement text at user registration
+
+ucp_agreement_terms_before
+===
+* Locations:
+ + styles/prosilver/template/ucp_agreement.html
+ + styles/subsilver2/template/ucp_agreement.html
+* Since: 3.1.0-b3
+* Purpose: Add content before the terms of agreement text at user registration
+
+ucp_main_front_user_activity_after
+===
+* Locations:
+ + styles/prosilver/template/ucp_main_front.html
+ + styles/subsilver2/template/ucp_main_front.html
+* Since: 3.1.6-RC1
+* Purpose: Add content right after the user activity info viewing UCP front page
+
+ucp_main_front_user_activity_append
+===
+* Locations:
+ + styles/prosilver/template/ucp_main_front.html
+ + styles/subsilver2/template/ucp_main_front.html
+* Since: 3.1.11-RC1
+* Purpose: Add content after last user activity info viewing UCP front page
+
+ucp_main_front_user_activity_before
+===
+* Locations:
+ + styles/prosilver/template/ucp_main_front.html
+ + styles/subsilver2/template/ucp_main_front.html
+* Since: 3.1.6-RC1
+* Purpose: Add content right before the user activity info viewing UCP front page
+
+ucp_main_front_user_activity_prepend
+===
+* Locations:
+ + styles/prosilver/template/ucp_main_front.html
+ + styles/subsilver2/template/ucp_main_front.html
+* Since: 3.1.11-RC1
+* Purpose: Add content before first user activity info viewing UCP front page
+
+ucp_pm_history_post_buttons_after
+===
+* Locations:
+ + styles/prosilver/template/ucp_pm_history.html
+ + styles/subsilver2/template/ucp_pm_history.html
+* Since: 3.1.6-RC1
+* Purpose: Add post button to private messages in history review (next to quote etc), at
+the end of the list.
+
+ucp_pm_history_post_buttons_before
+===
+* Locations:
+ + styles/prosilver/template/ucp_pm_history.html
+ + styles/subsilver2/template/ucp_pm_history.html
+* Since: 3.1.6-RC1
+* Purpose: Add post button to private messages in history review (next to quote etc), at
+the start of the list.
+
+ucp_pm_history_post_buttons_list_after
+===
+* Locations:
+ + styles/prosilver/template/ucp_pm_history.html
+* Since: 3.1.6-RC1
+* Purpose: Add post button custom list to private messages in history review (next to quote etc),
+after the original list.
+
+ucp_pm_history_post_buttons_list_before
+===
+* Locations:
+ + styles/prosilver/template/ucp_pm_history.html
+* Since: 3.1.6-RC1
+* Purpose: Add post button custom list to private messages in history review (next to quote etc),
+before the original list.
+
+ucp_pm_history_review_after
+===
+* Locations:
+ + styles/prosilver/template/ucp_pm_history.html
+ + styles/subsilver2/template/ucp_pm_history.html
+* Since: 3.1.6-RC1
+* Purpose: Add content after the private messages history review.
+
+ucp_pm_history_review_before
+===
+* Locations:
+ + styles/prosilver/template/ucp_pm_history.html
+ + styles/subsilver2/template/ucp_pm_history.html
+* Since: 3.1.6-RC1
+* Purpose: Add content before the private messages history review.
+
+ucp_pm_viewmessage_avatar_after
+===
+* Locations:
+ + styles/prosilver/template/ucp_pm_viewmessage.html
+* Since: 3.1.0-RC3
+* Purpose: Add content right after the avatar when viewing a private message
+
+ucp_pm_viewmessage_avatar_before
+===
+* Locations:
+ + styles/prosilver/template/ucp_pm_viewmessage.html
+* Since: 3.1.0-RC3
+* Purpose: Add content right before the avatar when viewing a private message
+
+ucp_pm_viewmessage_contact_fields_after
+===
+* Locations:
+ + styles/prosilver/template/ucp_pm_viewmessage.html
+* Since: 3.1.0-b1
+* Purpose: Add data after the contact fields on the user profile when viewing
+a private message
+
+ucp_pm_viewmessage_contact_fields_before
+===
+* Locations:
+ + styles/prosilver/template/ucp_pm_viewmessage.html
+* Since: 3.1.0-b1
+* Purpose: Add data before the contact fields on the user profile when viewing
+a private message
+
+ucp_pm_viewmessage_custom_fields_after
+===
+* Locations:
+ + styles/prosilver/template/ucp_pm_viewmessage.html
+* Since: 3.1.0-a1
+* Purpose: Add data after the custom fields on the user profile when viewing
+a private message
+
+ucp_pm_viewmessage_custom_fields_before
+===
+* Locations:
+ + styles/prosilver/template/ucp_pm_viewmessage.html
+* Since: 3.1.0-a1
+* Purpose: Add data before the custom fields on the user profile when viewing
+a private message
+
+ucp_pm_viewmessage_options_before
+===
+* Locations:
+ + styles/prosilver/template/ucp_pm_viewmessage.html
+* Since: 3.1.11-RC1
+* Purpose: Add content right before display options
+
+ucp_pm_viewmessage_post_buttons_after
+===
+* Locations:
+ + styles/prosilver/template/ucp_pm_viewmessage.html
+ + styles/subsilver2/template/ucp_pm_viewmessage.html
+* Since: 3.1.0-RC3
+* Purpose: Add post button to private messages (next to edit, quote etc), at
+the end of the list.
+
+ucp_pm_viewmessage_post_buttons_before
+===
+* Locations:
+ + styles/prosilver/template/ucp_pm_viewmessage.html
+ + styles/subsilver2/template/ucp_pm_viewmessage.html
+* Since: 3.1.0-RC3
+* Purpose: Add post button to private messages (next to edit, quote etc), at
+the start of the list.
+
+ucp_pm_viewmessage_post_buttons_list_after
+===
+* Locations:
+ + styles/prosilver/template/ucp_pm_viewmessage.html
+* Since: 3.1.6-RC1
+* Purpose: Add post button custom list to private messages (next to edit, quote etc),
+after the original list.
+
+ucp_pm_viewmessage_post_buttons_list_before
+===
+* Locations:
+ + styles/prosilver/template/ucp_pm_viewmessage.html
+* Since: 3.1.6-RC1
+* Purpose: Add post button custom list to private messages (next to edit, quote etc),
+before the original list.
+
+ucp_pm_viewmessage_print_head_append
+===
+* Locations:
+ + styles/prosilver/template/ucp_pm_viewmessage_print.html
+ + styles/subsilver2/template/ucp_pm_viewmessage_print.html
+* Since: 3.1.0-a1
+* Purpose: Add asset calls directly before the `</head>` tag of the Print PM screen
+
+ucp_pm_viewmessage_rank_after
+===
+* Locations:
+ + styles/prosilver/template/ucp_pm_viewmessage.html
+* Since: 3.1.6-RC1
+* Purpose: Add data after the rank on the user profile when viewing
+a private message
+
+ucp_pm_viewmessage_rank_before
+===
+* Locations:
+ + styles/prosilver/template/ucp_pm_viewmessage.html
+* Since: 3.1.6-RC1
+* Purpose: Add data before the rank on the user profile when viewing
+a private message
+
+ucp_prefs_personal_prepend
+===
+* Locations:
+ + styles/prosilver/template/ucp_prefs_personal.html
+ + styles/subsilver2/template/ucp_prefs_personal.html
+* Since: 3.1.0-a1
+* Purpose: Add user options to the top of the Edit Global Settings block
+
+ucp_prefs_personal_append
+===
+* Locations:
+ + styles/prosilver/template/ucp_prefs_personal.html
+ + styles/subsilver2/template/ucp_prefs_personal.html
+* Since: 3.1.0-a1
+* Purpose: Add user options to the bottom of the Edit Global Settings block
+
+ucp_prefs_post_prepend
+===
+* Locations:
+ + styles/prosilver/template/ucp_prefs_post.html
+ + styles/subsilver2/template/ucp_prefs_post.html
+* Since: 3.1.0-a1
+* Purpose: Add user options to the top of the Edit Posting Defaults block
+
+ucp_prefs_post_append
+===
+* Locations:
+ + styles/prosilver/template/ucp_prefs_post.html
+ + styles/subsilver2/template/ucp_prefs_post.html
+* Since: 3.1.0-a1
+* Purpose: Add user options to the bottom of the Edit Posting Defaults block
+
+ucp_prefs_view_radio_buttons_prepend
+===
+* Locations:
+ + styles/prosilver/template/ucp_prefs_view.html
+ + styles/subsilver2/template/ucp_prefs_view.html
+* Since: 3.1.0-a1
+* Purpose: Add options to the top of the radio buttons block of the Edit
+Display Options screen
+
+ucp_prefs_view_radio_buttons_append
+===
+* Locations:
+ + styles/prosilver/template/ucp_prefs_view.html
+ + styles/subsilver2/template/ucp_prefs_view.html
+* Since: 3.1.0-a1
+* Purpose: Add options to the bottom of the radio buttons block of the Edit
+Display Options screen
+
+ucp_prefs_view_select_menu_prepend
+===
+* Locations:
+ + styles/prosilver/template/ucp_prefs_view.html
+ + styles/subsilver2/template/ucp_prefs_view.html
+* Since: 3.1.0-a1
+* Purpose: Add options to the top of the drop-down lists block of the Edit
+Display Options screen
+
+ucp_prefs_view_select_menu_append
+===
+* Locations:
+ + styles/prosilver/template/ucp_prefs_view.html
+ + styles/subsilver2/template/ucp_prefs_view.html
+* Since: 3.1.0-a1
+* Purpose: Add options to the bottom of the drop-down lists block of the Edit
+Display Options screen
+
+ucp_profile_profile_info_before
+===
+* Locations:
+ + styles/prosilver/template/ucp_profile_profile_info.html
+ + styles/subsilver2/template/ucp_profile_profile_info.html
+* Since: 3.1.4-RC1
+* Purpose: Add options in profile page fieldset - before jabber field.
+
+ucp_profile_profile_info_after
+===
+* Locations:
+ + styles/prosilver/template/ucp_profile_profile_info.html
+ + styles/subsilver2/template/ucp_profile_profile_info.html
+* Since: 3.1.4-RC1
+* Purpose: Add options in profile page fieldset - after custom profile fields.
+
+ucp_profile_register_details_before
+===
+* Locations:
+ + styles/prosilver/template/ucp_profile_reg_details.html
+ + styles/subsilver2/template/ucp_profile_reg_details.html
+* Since: 3.1.4-RC1
+* Purpose: Add options in profile page fieldset - before first field.
+
+ucp_profile_register_details_after
+===
+* Locations:
+ + styles/prosilver/template/ucp_profile_reg_details.html
+ + styles/subsilver2/template/ucp_profile_reg_details.html
+* Since: 3.1.4-RC1
+* Purpose: Add options in profile page fieldset - after confirm password field.
+
+ucp_register_buttons_before
+===
+* Locations:
+ + styles/prosilver/template/ucp_register.html
+ + styles/subsilver2/template/ucp_register.html
+* Since: 3.1.11-RC1
+* Purpose: Add content before buttons in registration form.
+
+ucp_register_credentials_before
+===
+* Locations:
+ + styles/prosilver/template/ucp_register.html
+ + styles/subsilver2/template/ucp_register.html
+* Since: 3.1.0-b5
+* Purpose: Add options in registration page fieldset - before first field.
+
+ucp_register_profile_fields_after
+===
+* Locations:
+ + styles/prosilver/template/ucp_register.html
+ + styles/subsilver2/template/ucp_register.html
+* Since: 3.1.0-b5
+* Purpose: Add options in registration page fieldset - after last field.
+
+ucp_register_credentials_after
+===
+* Locations:
+ + styles/prosilver/template/ucp_register.html
+ + styles/subsilver2/template/ucp_register.html
+* Since: 3.1.0-b5
+* Purpose: Add options in registration page fieldset - after password field.
+
+ucp_register_options_before
+===
+* Locations:
+ + styles/prosilver/template/ucp_register.html
+ + styles/subsilver2/template/ucp_register.html
+* Since: 3.1.0-b5
+* Purpose: Add options in registration page fieldset - before language selector.
+
+ucp_register_profile_fields_before
+===
+* Locations:
+ + styles/prosilver/template/ucp_register.html
+ + styles/subsilver2/template/ucp_register.html
+* Since: 3.1.0-b5
+* Purpose: Add options in registration page fieldset - before profile fields.
+
+ucp_friend_list_before
+===
+* Locations:
+ + styles/prosilver/template/ucp_zebra_friends.html
+ + styles/subsilver2/template/ucp_zebra_friends.html
+* Since: 3.1.0-a4
+* Purpose: Add optional elements before list of friends in UCP
+
+ucp_friend_list_after
+===
+* Locations:
+ + styles/prosilver/template/ucp_zebra_friends.html
+ + styles/subsilver2/template/ucp_zebra_friends.html
+* Since: 3.1.0-a4
+* Purpose: Add optional elements after list of friends in UCP
+
+viewforum_body_topic_row_after
+===
+* Locations:
+ + styles/prosilver/template/viewforum_body.html
+ + styles/subsilver2/template/viewforum_body.html
+* Since: 3.1.7-RC1
+* Purpose: Add content after the topic list item.
+
+viewforum_body_topic_row_append
+===
+* Locations:
+ + styles/prosilver/template/viewforum_body.html
+ + styles/subsilver2/template/viewforum_body.html
+* Since: 3.1.7-RC1
+* Purpose: Add content at the start of the topic list item.
+
+viewforum_body_topic_row_before
+===
+* Locations:
+ + styles/prosilver/template/viewforum_body.html
+ + styles/subsilver2/template/viewforum_body.html
+* Since: 3.1.7-RC1
+* Purpose: Add content before the topic list item.
+
+viewforum_body_topic_row_prepend
+===
+* Locations:
+ + styles/prosilver/template/viewforum_body.html
+ + styles/subsilver2/template/viewforum_body.html
+* Since: 3.1.7-RC1
+* Purpose: Add content at the end of the topic list item.
+
+viewforum_body_topicrow_row_before
+===
+* Locations:
+ + styles/prosilver/template/viewforum_body.html
+ + styles/subsilver2/template/viewforum_body.html
+* Since: 3.1.10-RC1
+* Purpose: Add content before list of topics.
+
+viewforum_buttons_bottom_before
+===
+* Locations:
+ + styles/prosilver/template/viewforum_body.html
+ + styles/subsilver2/template/viewforum_body.html
+* Since: 3.1.0-RC5
+* Purpose: Add buttons before New Topic button on the bottom of the topic's list
+
+viewforum_buttons_bottom_after
+===
+* Locations:
+ + styles/prosilver/template/viewforum_body.html
+ + styles/subsilver2/template/viewforum_body.html
+* Since: 3.1.0-RC5
+* Purpose: Add buttons after New Topic button on the bottom of the topic's list
+
+viewforum_buttons_top_before
+===
+* Locations:
+ + styles/prosilver/template/viewforum_body.html
+ + styles/subsilver2/template/viewforum_body.html
+* Since: 3.1.0-RC5
+* Purpose: Add buttons before New Topic button on the top of the topic's list
+
+viewforum_buttons_top_after
+===
+* Locations:
+ + styles/prosilver/template/viewforum_body.html
+ + styles/subsilver2/template/viewforum_body.html
+* Since: 3.1.0-RC5
+* Purpose: Add buttons after New Topic button on the top of the topic's list
+
+viewtopic_buttons_bottom_before
+===
+* Locations:
+ + styles/prosilver/template/viewtopic_body.html
+ + styles/subsilver2/template/viewtopic_body.html
+* Since: 3.1.0-RC5
+* Purpose: Add buttons before Post Reply button on the bottom of the posts's list
+
+viewtopic_buttons_bottom_after
+===
+* Locations:
+ + styles/prosilver/template/viewtopic_body.html
+ + styles/subsilver2/template/viewtopic_body.html
+* Since: 3.1.0-RC5
+* Purpose: Add buttons after Post Reply button on the bottom of the posts's list
+
+viewtopic_buttons_top_before
+===
+* Locations:
+ + styles/prosilver/template/viewtopic_body.html
+ + styles/subsilver2/template/viewtopic_body.html
+* Since: 3.1.0-RC5
+* Purpose: Add buttons before Post Reply button on the top of the posts's list
+
+viewtopic_buttons_top_after
+===
+* Locations:
+ + styles/prosilver/template/viewtopic_body.html
+ + styles/subsilver2/template/viewtopic_body.html
+* Since: 3.1.0-RC5
+* Purpose: Add buttons after Post Reply button on the top of the posts's list
+
+viewtopic_dropdown_bottom_custom
+===
+* Locations:
+ + styles/prosilver/template/viewtopic_body.html
+* Since: 3.1.6-RC1
+* Purpose: Create a custom dropdown menu
+
+viewtopic_dropdown_top_custom
+===
+* Locations:
+ + styles/prosilver/template/viewtopic_body.html
+* Since: 3.1.6-RC1
+* Purpose: Create a custom dropdown menu
+
+viewforum_forum_name_append
+===
+* Locations:
+ + styles/prosilver/template/viewforum_body.html
+ + styles/subsilver2/template/viewforum_body.html
+* Since: 3.1.0-b3
+* Purpose: Add content directly after the forum name link on the View forum screen
+
+viewforum_forum_name_prepend
+===
+* Locations:
+ + styles/prosilver/template/viewforum_body.html
+ + styles/subsilver2/template/viewforum_body.html
+* Since: 3.1.0-b3
+* Purpose: Add content directly before the forum name link on the View forum screen
+
+viewforum_forum_title_after
+===
+* Locations:
+ + styles/prosilver/template/viewforum_body.html
+ + styles/subsilver2/template/viewforum_body.html
+* Since: 3.1.5-RC1
+* Purpose: Add content directly after the forum title on the View forum screen
+
+viewforum_forum_title_before
+===
+* Locations:
+ + styles/prosilver/template/viewforum_body.html
+ + styles/subsilver2/template/viewforum_body.html
+* Since: 3.1.5-RC1
+* Purpose: Add content directly before the forum title on the View forum screen
+
+viewtopic_print_head_append
+===
+* Locations:
+ + styles/prosilver/template/viewtopic_print.html
+ + styles/subsilver2/template/viewtopic_print.html
+* Since: 3.1.0-a1
+* Purpose: Add asset calls directly before the `</head>` tag of the Print Topic screen
+
+viewtopic_body_pagination_top_after
+===
+* Locations:
+ + styles/prosilver/template/viewtopic_body.html
+ + styles/subsilver2/template/viewtopic_body.html
+* Since: 3.1.4-RC1
+* Purpose: Add content after the pagination at top
+
+viewtopic_body_avatar_after
+===
+* Locations:
+ + styles/prosilver/template/viewtopic_body.html
+ + styles/subsilver2/template/viewtopic_body.html
+* Since: 3.1.0-RC3
+* Purpose: Add content right after the avatar when viewing topics
+
+viewtopic_body_avatar_before
+===
+* Locations:
+ + styles/prosilver/template/viewtopic_body.html
+ + styles/subsilver2/template/viewtopic_body.html
+* Since: 3.1.0-RC3
+* Purpose: Add content right before the avatar when viewing topics
+
+viewtopic_body_contact_fields_after
+===
+* Locations:
+ + styles/prosilver/template/viewtopic_body.html
+* Since: 3.1.0-b3
+* Purpose: Add data after the contact fields on the user profile when viewing
+a post
+
+viewtopic_body_contact_fields_before
+===
+* Locations:
+ + styles/prosilver/template/viewtopic_body.html
+* Since: 3.1.0-b3
+* Purpose: Add data before the contact fields on the user profile when viewing
+a post
+
+viewtopic_body_footer_before
+===
+* Locations:
+ + styles/prosilver/template/viewtopic_body.html
+ + styles/subsilver2/template/viewtopic_body.html
+* Since: 3.1.0-a1
+* Purpose: Add content to the bottom of the View topic screen below the posts
+and quick reply, directly before the jumpbox in Prosilver, breadcrumbs in
+Subsilver2.
+
+viewtopic_body_poll_after
+===
+* Locations:
+ + styles/prosilver/template/viewtopic_body.html
+ + styles/subsilver2/template/viewtopic_body.html
+* Since: 3.1.6-RC1
+* Purpose: Add content after the poll panel.
+
+viewtopic_body_poll_before
+===
+* Locations:
+ + styles/prosilver/template/viewtopic_body.html
+ + styles/subsilver2/template/viewtopic_body.html
+* Since: 3.1.6-RC1
+* Purpose: Add content before the poll panel.
+
+viewtopic_body_poll_option_after
+===
+* Locations:
+ + styles/prosilver/template/viewtopic_body.html
+ + styles/subsilver2/template/viewtopic_body.html
+* Since: 3.1.0-b3
+* Purpose: Add content after the poll option
+the list.
+
+viewtopic_body_poll_option_before
+===
+* Locations:
+ + styles/prosilver/template/viewtopic_body.html
+ + styles/subsilver2/template/viewtopic_body.html
+* Since: 3.1.0-b3
+* Purpose: Add content before the poll option
+the list.
+
+viewtopic_body_poll_question_append
+===
+* Locations:
+ + styles/prosilver/template/viewtopic_body.html
+ + styles/subsilver2/template/viewtopic_body.html
+* Since: 3.1.0-b3
+* Purpose: Add content directly after the poll question on the View topic screen
+
+viewtopic_body_poll_question_prepend
+===
+* Locations:
+ + styles/prosilver/template/viewtopic_body.html
+ + styles/subsilver2/template/viewtopic_body.html
+* Since: 3.1.0-b3
+* Purpose: Add content directly before the poll question on the View topic screen
+
+viewtopic_body_post_author_after
+===
+* Locations:
+ + styles/prosilver/template/viewtopic_body.html
+ + styles/subsilver2/template/viewtopic_body.html
+* Since: 3.1.3-RC1
+* Purpose: Add content directly after the post author on the view topic screen
+
+viewtopic_body_post_author_before
+===
+* Locations:
+ + styles/prosilver/template/viewtopic_body.html
+ + styles/subsilver2/template/viewtopic_body.html
+* Since: 3.1.3-RC1
+* Purpose: Add content directly before the post author on the view topic screen
+
+viewtopic_body_post_buttons_after
+===
+* Locations:
+ + styles/prosilver/template/viewtopic_body.html
+ + styles/subsilver2/template/viewtopic_body.html
+* Since: 3.1.0-a1
+* Purpose: Add post button to posts (next to edit, quote etc), at the end of
+the list.
+
+viewtopic_body_post_buttons_before
+===
+* Locations:
+ + styles/prosilver/template/viewtopic_body.html
+ + styles/subsilver2/template/viewtopic_body.html
+* Since: 3.1.0-a1
+* Purpose: Add post button to posts (next to edit, quote etc), at the start of
+the list.
+
+viewtopic_body_post_buttons_list_after
+===
+* Locations:
+ + styles/prosilver/template/viewtopic_body.html
+* Since: 3.1.5-RC1
+* Purpose: Add post button custom list to posts (next to edit, quote etc),
+after the original list.
+
+viewtopic_body_post_buttons_list_before
+===
+* Locations:
+ + styles/prosilver/template/viewtopic_body.html
+* Since: 3.1.5-RC1
+* Purpose: Add post button custom list to posts (next to edit, quote etc),
+before the original list.
+
+viewtopic_body_post_subject_before
+===
+* Locations:
+ + styles/prosilver/template/viewtopic_body.html
+ + styles/subsilver2/template/viewtopic_body.html
+* Since: 3.1.7-RC1
+* Purpose: Add data before post icon and subject
+
+viewtopic_body_postrow_back2top_after
+===
+* Locations:
+ + styles/prosilver/template/viewtopic_body.html
+ + styles/subsilver2/template/viewtopic_body.html
+* Since: 3.1.8-RC1
+* Purpose: Add content to the post's bottom after the back to top link
+
+viewtopic_body_postrow_back2top_append
+===
+* Locations:
+ + styles/prosilver/template/viewtopic_body.html
+ + styles/subsilver2/template/viewtopic_body.html
+* Since: 3.1.8-RC1
+* Purpose: Add content to the post's bottom directly after the back to top link
+
+viewtopic_body_postrow_back2top_before
+===
+* Locations:
+ + styles/prosilver/template/viewtopic_body.html
+ + styles/subsilver2/template/viewtopic_body.html
+* Since: 3.1.8-RC1
+* Purpose: Add content to the post's bottom before the back to top link
+
+viewtopic_body_postrow_back2top_prepend
+===
+* Locations:
+ + styles/prosilver/template/viewtopic_body.html
+ + styles/subsilver2/template/viewtopic_body.html
+* Since: 3.1.8-RC1
+* Purpose: Add content to the post's bottom directly before the back to top link
+
+viewtopic_body_postrow_custom_fields_after
+===
+* Locations:
+ + styles/prosilver/template/viewtopic_body.html
+ + styles/subsilver2/template/viewtopic_body.html
+* Since: 3.1.0-a1
+* Purpose: Add data after the custom fields on the user profile when viewing
+a post
+
+viewtopic_body_postrow_custom_fields_before
+===
+* Locations:
+ + styles/prosilver/template/viewtopic_body.html
+ + styles/subsilver2/template/viewtopic_body.html
+* Since: 3.1.0-a1
+* Purpose: Add data before the custom fields on the user profile when viewing
+a post
+
+viewtopic_body_postrow_post_after
+===
+* Locations:
+ + styles/prosilver/template/viewtopic_body.html
+ + styles/subsilver2/template/viewtopic_body.html
+* Since: 3.1.0-a4
+* Purpose: Add data after posts
+
+viewtopic_body_postrow_post_before
+===
+* Locations:
+ + styles/prosilver/template/viewtopic_body.html
+ + styles/subsilver2/template/viewtopic_body.html
+* Since: 3.1.0-a4
+* Purpose: Add data before posts
+
+viewtopic_body_postrow_post_content_footer
+===
+* Locations:
+ + styles/prosilver/template/viewtopic_body.html
+ + styles/subsilver2/template/viewtopic_body.html
+* Since: 3.1.0-RC4
+* Purpose: Add data at the end of the posts.
+
+viewtopic_body_postrow_post_details_after
+===
+* Locations:
+ + styles/prosilver/template/viewtopic_body.html
+ + styles/subsilver2/template/viewtopic_body.html
+* Since: 3.1.4-RC1
+* Purpose: Add content after the post details
+
+viewtopic_body_postrow_post_details_before
+===
+* Locations:
+ + styles/prosilver/template/viewtopic_body.html
+ + styles/subsilver2/template/viewtopic_body.html
+* Since: 3.1.4-RC1
+* Purpose: Add content before the post details
+
+viewtopic_body_postrow_post_notices_after
+===
+* Locations:
+ + styles/prosilver/template/viewtopic_body.html
+ + styles/subsilver2/template/viewtopic_body.html
+* Since: 3.1.0-b2
+* Purpose: Add posts specific custom notices at the notices bottom.
+
+viewtopic_body_postrow_post_notices_before
+===
+* Locations:
+ + styles/prosilver/template/viewtopic_body.html
+ + styles/subsilver2/template/viewtopic_body.html
+* Since: 3.1.0-b2
+* Purpose: Add posts specific custom notices at the notices top.
+
+viewtopic_body_postrow_rank_after
+===
+* Locations:
+ + styles/prosilver/template/viewtopic_body.html
+ + styles/subsilver2/template/viewtopic_body.html
+* Since: 3.1.6-RC1
+* Purpose: Add data after the rank on the user profile when viewing
+a post
+
+viewtopic_body_postrow_rank_before
+===
+* Locations:
+ + styles/prosilver/template/viewtopic_body.html
+ + styles/subsilver2/template/viewtopic_body.html
+* Since: 3.1.6-RC1
+* Purpose: Add data before the rank on the user profile when viewing
+a post
+
+viewtopic_body_topic_actions_before
+===
+* Locations:
+ + styles/prosilver/template/viewtopic_body.html
+ + styles/subsilver2/template/viewtopic_body.html
+* Since: 3.1.0-a4
+* Purpose: Add data before the topic actions buttons (after the posts sorting options)
+
+viewtopic_topic_title_after
+===
+* Locations:
+ + styles/prosilver/template/viewtopic_body.html
+ + styles/subsilver2/template/viewtopic_body.html
+* Since: 3.1.7-RC1
+* Purpose: Add content directly after the topic title link on the View topic screen (outside of the h2 HTML tag)
+
+viewtopic_topic_title_append
+===
+* Locations:
+ + styles/prosilver/template/viewtopic_body.html
+ + styles/subsilver2/template/viewtopic_body.html
+* Since: 3.1.0-b3
+* Purpose: Add content directly after the topic title link on the View topic screen
+
+viewtopic_topic_title_prepend
+===
+* Locations:
+ + styles/prosilver/template/viewtopic_body.html
+ + styles/subsilver2/template/viewtopic_body.html
+* Since: 3.1.0-a1
+* Purpose: Add content directly before the topic title link on the View topic screen
+
+viewtopic_topic_tools_after
+===
+* Locations:
+ + styles/prosilver/template/viewtopic_topic_tools.html
+* Since: 3.1.0-a3
+* Purpose: Add a new topic tool after the rest of the existing ones
+
+viewtopic_topic_tools_before
+===
+* Locations:
+ + styles/prosilver/template/viewtopic_topic_tools.html
+* Since: 3.1.0-a3
+* Purpose: Add a new topic tool before the rest of the existing ones
diff --git a/phpBB/docs/hook_system.html b/phpBB/docs/hook_system.html
deleted file mode 100644
index fbc8baaf75..0000000000
--- a/phpBB/docs/hook_system.html
+++ /dev/null
@@ -1,889 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en" xml:lang="en">
-<head>
-
-<meta http-equiv="content-type" content="text/html; charset=utf-8" />
-<meta http-equiv="content-style-type" content="text/css" />
-<meta http-equiv="content-language" content="en" />
-<meta http-equiv="imagetoolbar" content="no" />
-<meta name="resource-type" content="document" />
-<meta name="distribution" content="global" />
-<meta name="copyright" content="phpBB Group" />
-<meta name="keywords" content="" />
-<meta name="description" content="Hook System explanation" />
-<title>phpBB3 &bull; Hook System</title>
-
-<style type="text/css">
-/* <![CDATA[ */
-
-/*
- The original "prosilver" theme for phpBB3
- Created by subBlue design :: http://www.subBlue.com
-*/
-
-* { margin: 0; padding: 0; }
-
-html { font-size: 100%; height: 100%; margin-bottom: 1px; }
-
-body {
- font-family: Verdana, Helvetica, Arial, sans-serif;
- color: #828282;
- background-color: #FFFFFF;
- font-size: 12px;
- margin: 0;
- padding: 12px 0;
-}
-
-img { border-width: 0; }
-
-p {
- line-height: 1.3em;
- font-size: 1.1em;
- margin-bottom: 1.5em;
-}
-
-hr {
- border: 0 none #FFFFFF;
- border-top: 1px solid #CCCCCC;
- height: 1px;
- margin: 5px 0;
- display: block;
- clear: both;
-}
-
-html, body {
- color: #536482;
- background-color: #FFFFFF;
-}
-
-#doc-description h1 {
- font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
- margin-right: 200px;
- color: #FFFFFF;
- margin-top: 15px;
- font-weight: bold;
- font-size: 2em;
- color: #fff;
-}
-
-h1 {
- font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
- font-weight: normal;
- color: #000;
- font-size: 2em;
- margin: 0.8em 0 0.2em 0;
-}
-
-h2 {
- font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
- font-weight: normal;
- color: #28313F;
- font-size: 1.5em;
- margin: 0.8em 0 0.2em 0;
-}
-
-h3 {
- font-family: Arial, Helvetica, sans-serif;
- font-weight: bold;
- border-bottom: 1px solid #CCCCCC;
- margin-bottom: 3px;
- padding-bottom: 2px;
- font-size: 1.05em;
- color: #115098;
- margin-top: 20px;
-}
-
-.good { color: green; }
-.bad { color: red; }
-
-.version {
- margin-top: 20px;
- text-align: left;
- font-size: 70%;
- color: #006600;
- border-top: 1px solid #ccc;
-}
-
-code {
- color: #006600;
- font-weight: normal;
- font-family: 'Courier New', monospace;
- border-color: #D1D7DC;
- border-width: 1px;
- border-style: solid;
- background-color: #FAFAFA;
-}
-
-#wrap {
- padding: 0 20px;
- min-width: 650px;
-}
-
-#simple-wrap {
- padding: 6px 10px;
-}
-
-#page-body {
- margin: 4px 0;
- clear: both;
-}
-
-#page-footer {
- clear: both;
-}
-
-#logo {
- float: left;
- width: auto;
- padding: 10px 13px 0 10px;
-}
-
-a#logo:hover {
- text-decoration: none;
-}
-
-#doc-description {
- float: left;
- width: 70%;
-}
-
-#doc-description h1 {
- margin-right: 0;
-}
-
-.headerbar {
- background: #ebebeb none repeat-x 0 0;
- color: #FFFFFF;
- margin-bottom: 4px;
- padding: 0 5px;
-}
-
-span.corners-top, span.corners-bottom, span.corners-top span, span.corners-bottom span {
- font-size: 1px;
- line-height: 1px;
- display: block;
- height: 5px;
- background-repeat: no-repeat;
-}
-
-span.corners-top {
- background-image: none;
- background-position: 0 0;
- margin: 0 -5px;
-}
-
-span.corners-top span {
- background-image: none;
- background-position: 100% 0;
-}
-
-span.corners-bottom {
- background-image: none;
- background-position: 0 100%;
- margin: 0 -5px;
- clear: both;
-}
-
-span.corners-bottom span {
- background-image: none;
- background-position: 100% 100%;
-}
-
-.paragraph {
- padding: 0 10px;
- margin-bottom: 4px;
- background-repeat: no-repeat;
- background-position: 100% 0;
- background-color: #ECF3F7;
-}
-
-.paragraph:target .content {
- color: #000000;
-}
-
-.paragraph:target h3 a {
- color: #000000;
-}
-
-.content {
- color: #333333;
-}
-
-.content h2, .panel h2 {
- color: #115098;
- border-bottom-color: #CCCCCC;
-}
-
-a:link { color: #898989; text-decoration: none; }
-a:visited { color: #898989; text-decoration: none; }
-a:hover { color: #d3d3d3; text-decoration: underline; }
-a:active { color: #d2d2d2; text-decoration: none; }
-
-hr {
- border-color: #FFFFFF;
- border-top-color: #CCCCCC;
-}
-
-.menu {
- background-color: #cadceb;
-}
-
-.headerbar {
- background-color: #12A3EB;
- background-image: url("bg_header.gif");
- color: #FFFFFF;
-}
-
-.panel {
- background-color: #ECF1F3;
- color: #28313F;
-}
-
-
-span.corners-top {
- background-image: url("corners_left.png");
-}
-
-span.corners-top span {
- background-image: url("corners_right.png");
-}
-
-span.corners-bottom {
- background-image: url("corners_left.png");
-}
-
-span.corners-bottom span {
- background-image: url("corners_right.png");
-}
-
-.error {
- color: #BC2A4D;
-}
-
-a:link { color: #105289; }
-a:visited { color: #105289; }
-a:hover { color: #D31141; }
-a:active { color: #368AD2; }
-
-.paragraph span.corners-top, .paragraph span.corners-bottom {
- margin: 0 -10px;
-}
-
-.content {
- padding: 0;
- line-height: 1.48em;
- color: #333333;
-}
-
-.content h2, .panel h2 {
- color: #115098;
- border-bottom-color: #CCCCCC;
-}
-
-.notice {
- border-top-color: #CCCCCC;
-}
-
-.codebox {
- padding: 3px;
- background-color: #FFFFFF;
- border: 1px solid #C9D2D8;
- font-size: 1em;
- margin-bottom: 10px;
- display: block;
- font: 0.9em Monaco, "Andale Mono","Courier New", Courier, mono;
- line-height: 1.3em;
-}
-
-* html hr { margin: 0; }
-* html span.corners-top, * html span.corners-bottom { background-image: url("corners_left.gif"); }
-* html span.corners-top span, * html span.corners-bottom span { background-image: url("corners_right.gif"); }
-
-.back2top {
- clear: both;
- height: 11px;
- text-align: right;
-}
-
-.content ol {
- margin-left: 25px;
-}
-
-/* ]]> */
-</style>
-
-</head>
-
-<body id="phpbb" class="section-docs">
-
-<div id="wrap">
- <a id="top" name="top" accesskey="t"></a>
- <div id="page-header">
- <div class="headerbar">
- <div class="inner"><span class="corners-top"><span></span></span>
-
- <div id="doc-description">
- <a href="../index.php" id="logo"><img src="site_logo.gif" alt="" /></a>
- <h1>Hook System</h1>
- <p>This is an explanation of how to use the phpBB3 hook system.</p>
- <p style="display: none;"><a href="#start_here">Skip</a></p>
- </div>
-
- <span class="corners-bottom"><span></span></span></div>
- </div>
- </div>
-
- <a name="start_here"></a>
-
- <div id="page-body">
-
- <h1>Hook System</h1>
-
- <div class="paragraph menu">
- <div class="inner"><span class="corners-top"><span></span></span>
-
- <div class="content">
-
- <ol>
- <li><a href="#intro">Introduction</a></li>
- <li><a href="#use">Allow hooks in functions/methods</a></li>
- <li><a href="#register">Registering hooks</a></li>
- <li><a href="#return">Result returning</a></li>
- <li><a href="#embed">Embedding your hook files/classes/methods</a></li>
- <li><a href="#disclaimer">Copyright and disclaimer</a></li>
- </ol>
-
- </div>
-
- <span class="corners-bottom"><span></span></span></div>
- </div>
-
- <hr />
-
- <a name="intro"></a><h2>1. Introduction</h2>
-
- <div class="paragraph">
- <div class="inner"><span class="corners-top"><span></span></span>
-
- <div class="content">
-
-<h3>What is it?</h3>
-
-<p>The hook system allows applicaton and mod developers to hook into phpBB's or their own functions.</p>
-
-<h3>Pre-defined hookable phpBB3 functions</h3>
-
-<p>In phpBB3 there are four functions you are able to hook into with your custom functions:</p>
-
-<p><code>phpbb_user_session_handler();</code> which is called within user::setup after the session and the user object is correctly initialized.<br />
-<code>append_sid($url, $params = false, $is_amp = true, $session_id = false);</code> which is called for building urls (appending the session id)<br />
-<code>$template-&gt;display($handle, $include_once = true);</code> which is called directly before outputting the (not-yet-compiled) template.<br />
-<code>exit_handler();</code> which is called at the very end of phpBB3's execution.</p>
-
-<p>Please note: The <code>$template-&gt;display</code> hook takes a third <code>$template</code> argument, which is the template instance being used, which should be used instead of the global.</p>
-
-<p>There are also valid external constants you may want to use if you embed phpBB3 into your application:</p>
-
-<div class="codebox"><pre>
-PHPBB_MSG_HANDLER (overwrite message handler)
-PHPBB_DB_NEW_LINK (overwrite new_link parameter for sql_connect)
-PHPBB_ROOT_PATH (overwrite $phpbb_root_path)
-PHPBB_ADMIN_PATH (overwrite $phpbb_admin_path)
-PHPBB_USE_BOARD_URL_PATH (use generate_board_url() for image paths instead of $phpbb_root_path)
-</pre></div>
-
-<p>If the <code>PHPBB_USE_BOARD_URL_PATH</code> constant is set to true, phpBB uses generate_board_url() (this will return the boards url with the script path included) on all instances where web-accessible images are loaded. The exact locations are:</p>
-
-<ul>
- <li>/includes/session.php - user::img()</li>
- <li>/includes/functions_content.php - smiley_text()</li>
-</ul>
-
-<p>Path locations for the following template variables are affected by this too:</p>
-
-<ul>
- <li>{T_THEME_PATH} - styles/xxx/theme</li>
- <li>{T_TEMPLATE_PATH} - styles/xxx/template</li>
- <li>{T_SUPER_TEMPLATE_PATH} - styles/xxx/template</li>
- <li>{T_IMAGESET_PATH} - styles/xxx/imageset</li>
- <li>{T_IMAGESET_LANG_PATH} - styles/xxx/imageset/yy</li>
- <li>{T_IMAGES_PATH} - images/</li>
- <li>{T_SMILIES_PATH} - $config['smilies_path']/</li>
- <li>{T_AVATAR_PATH} - $config['avatar_path']/</li>
- <li>{T_AVATAR_GALLERY_PATH} - $config['avatar_gallery_path']/</li>
- <li>{T_ICONS_PATH} - $config['icons_path']/</li>
- <li>{T_RANKS_PATH} - $config['ranks_path']/</li>
- <li>{T_UPLOAD_PATH} - $config['upload_path']/</li>
- <li>{T_STYLESHEET_LINK} - styles/xxx/theme/stylesheet.css (or link to style.php if css is parsed dynamically)</li>
- <li>New template variable {BOARD_URL} for the board url + script path.</li>
-</ul>
-
-
- </div>
-
- <div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
-
- <span class="corners-bottom"><span></span></span></div>
- </div>
-
- <a name="use"></a><h2>2. Allow hooks in functions/methods</h2>
-
- <div class="paragraph">
- <div class="inner"><span class="corners-top"><span></span></span>
-
- <div class="content">
-
-<p>The following examples explain how phpBB3 utilize the in-build hook system. You will be more interested in registering your hooks, but showing you this may help you understand the system better along the way.</p>
-
-<p>First of all, this is how a function need to be layed out if you want to allow it to be hookable...</p>
-
-<div class="codebox"><pre>
-function my_own_function($my_first_parameter, $my_second_parameter)
-{
- global $phpbb_hook;
-
- if ($phpbb_hook-&gt;call_hook(__FUNCTION__, $my_first_parameter, $my_second_parameter))
- {
- if ($phpbb_hook-&gt;hook_return(__FUNCTION__))
- {
- return $phpbb_hook-&gt;hook_return_result(__FUNCTION__);
- }
- }
-
- [YOUR CODE HERE]
-}
-</pre></div>
-
-<p>Above, the call_hook function should always be mapping your function call... in regard to the number of parameters passed.</p>
-
-<p>This is how you could make a method being hookable...</p>
-
-<div class="codebox"><pre>
-class my_hookable_object
-{
- function hook_me($my_first_parameter, $my_second_parameter)
- {
- global $phpbb_hook;
-
- if ($phpbb_hook-&gt;call_hook(array(__CLASS__, __FUNCTION__), $my_first_parameter, $my_second_parameter))
- {
- if ($phpbb_hook-&gt;hook_return(array(__CLASS__, __FUNCTION__)))
- {
- return $phpbb_hook-&gt;hook_return_result(array(__CLASS__, __FUNCTION__));
- }
- }
-
- [YOUR CODE HERE]
- }
-}
-</pre></div>
-
-<p>The only difference about calling it is the way you define the first parameter. For a function it is only <code>__FUNCTION__</code>, for a method it is <code>array(__CLASS__, __FUNCTION__)</code>. In PHP4 __CLASS__ is always returning the class in lowercase.</p>
-
-<p>Now, in phpBB there are some pre-defined hooks available, but how do you make your own hookable function available (and therefore allowing others to hook into it)? For this, there is the add_hook() method:</p>
-
-<div class="codebox"><pre>
-// Adding your own hookable function:
-$phpbb_hook-&gt;add_hook('my_own_function');
-
-// Adding your own hookable method:
-$phpbb_hook-&gt;add_hook(array('my_hookable_object', 'hook_me'));
-</pre></div>
-
-<p>You are also able to remove the possibility of hooking a function/method by calling <code>$phpbb_hook-&gt;remove_hook()</code> with the same parameters as add_hook().<br />
-This comes in handy if you want to force some hooks not to be called - at all.</p>
-
- </div>
-
- <div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
-
- <span class="corners-bottom"><span></span></span></div>
- </div>
-
- <a name="register"></a><h2>3. Registering hooks</h2>
-
- <div class="paragraph">
- <div class="inner"><span class="corners-top"><span></span></span>
-
- <div class="content">
-
- <h3>Registering hooks</h3>
-
-<p>Now to actually defining your functions which should be called. For this we take the append_sid() function as an example (this function is able to be hooked by default). We create two classes, one being static and a function:</p>
-
-<div class="codebox"><pre>
-class my_append_sid_class
-{
- // Our functions
- function my_append_sid(&amp;$hook, $url, $params = false, $is_amp = true, $session_id = false)
- {
- // Get possible previous results
- $result = $hook-&gt;previous_hook_result('append_sid');
-
- return $result['result'] . '&lt;br /&gt;And i was the second one.';
- }
-}
-
-// Yet another class :o
-class my_second_append_sid_class
-{
- function my_append_sid(&amp;$hook, $url, $params = false, $is_amp = true, $session_id = false)
- {
- // Get possible previous results
- $result = $hook-&gt;previous_hook_result('append_sid');
-
- echo $result['result'] . '&lt;br /&gt;I was called as the third one.';
- }
-}
-
-// And a normal function
-function my_append_sid(&amp;$hook, $url, $params = false, $is_amp = true, $session_id = false)
-{
- // Get possible previous results
- $result = $hook-&gt;previous_hook_result('append_sid');
-
- return 'I was called as the first one';
-}
-
-// Initializing the second class
-$my_second_append_sid_class = new my_second_append_sid_class();
-</pre></div>
-
-<p>Make sure you add the same parameters to your function as is defined for the hookable function with one exception: The first variable is always <code>&amp;$hook</code>... this is the hook object itself you are able to operate on.</p>
-
-<p>Now we register the hooks one by one with the <code>$phpbb_hook-&gt;register()</code> method:</p>
-
-<div class="codebox"><pre>
-// Now, we register our append_sid &quot;replacements&quot; in a stacked way...
-// Registering the function (this is called first)
-$phpbb_hook-&gt;register('append_sid', 'my_append_sid');
-
-// Registering the first class
-$phpbb_hook-&gt;register('append_sid', array('my_append_sid_class', 'my_append_sid'));
-$phpbb_hook-&gt;register('append_sid', array(&amp;$my_second_append_sid_class, 'my_append_sid'));
-</pre></div>
-
-<p>With this you are even able to make your own functions that are already hooked itself being hooked again...</p>
-
-<div class="codebox"><pre>
-// Registering hook, which will be called
-$phpbb_hook-&gt;register('append_sid', 'my_own_append_sid');
-
-// Add hook to our called hook function
-$phpbb_hook-&gt;add_hook('my_own_append_sid');
-
-// Register added hook
-$phpbb_hook-&gt;register('my_own_append_sid', 'also_my_own_append_sid');
-</pre></div>
-
- <h3>Special treatment/chains</h3>
-
- <p>The <code>register</code> method is able to take a third argument to specify a special 'chain' mode. The valid modes are <code>first</code>, <code>last</code> and <code>standalone</code></p>
-
- <p><code>$phpbb_hook-&gt;register('append_sid', 'my_own_append_sid', 'first')</code> would make sure that the function is called in the beginning of the chain. It is possible that more than one function is called within the first block - here the FIFO principle is used.</p>
-
- <p><code>$phpbb_hook-&gt;register('append_sid', 'my_own_append_sid', 'last')</code> would make sure that the function is called at the very end of the chain. It is possible that more than one function is called within the last block - here the FIFO principle is used.</p>
-
- <p><code>$phpbb_hook-&gt;register('append_sid', 'my_own_append_sid', 'standalone')</code> makes sure only the defined function is called. All other functions are removed from the chain and no other functions are added to it later on. If two applications try to trigger the standalone mode a PHP notice will be printed and the second function being discarded.</p>
-
- <h3>Only allowing hooks for some objects</h3>
-
- <p>Because the hook system is not able to differate between initialized objects and only operate on the class, you need to solve this on the code level.</p>
-
- <p>One possibility would be to use a property:</p>
-
- <div class="codebox"><pre>
-class my_hookable_object
-{
- function blabla()
- {
- }
-}
-
-class my_hookable_object2 extends my_hookable_object
-{
- var $call_hook = true;
-
- function hook_me($my_first_parameter, $my_second_parameter)
- {
- if ($this-&gt;call_hook)
- {
- global $phpbb_hook;
-
- if ($phpbb_hook-&gt;call_hook(array(__CLASS__, __FUNCTION__), $my_first_parameter, $my_second_parameter))
- {
- if ($phpbb_hook-&gt;hook_return(array(__CLASS__, __FUNCTION__)))
- {
- return $phpbb_hook-&gt;hook_return_result(array(__CLASS__, __FUNCTION__));
- }
- }
- }
-
- return 'not hooked';
- }
-}
-
-function hooking(&amp;$hook, $first, $second)
-{
- return 'hooked';
-}
-
-$first_object = new my_hookable_object2();
-$second_object = new my_hookable_object2();
-
-$phpbb_hook-&gt;add_hook(array('my_hookable_object2', 'hook_me'));
-
-$phpbb_hook-&gt;register(array('my_hookable_object2', 'hook_me'), 'hooking');
-
-// Do not call the hook for $first_object
-$first_object-&gt;call_hook = false;
-
-echo $first_object-&gt;hook_me('first', 'second') . '&lt;br /&gt;';
-echo $second_object-&gt;hook_me('first', 'second') . '&lt;br /&gt;';
-</pre></div>
-
-<p>OUTPUT:</p>
-
-<div class="codebox"><pre>
-not hooked
-hooked
-</pre></div>
-
- <p>A different possibility would be using a function variable (which could be left out on passing the function variables to the hook):</p>
-
- <div class="codebox"><pre>
-class my_hookable_object
-{
- function blabla()
- {
- }
-}
-
-class my_hookable_object2 extends my_hookable_object
-{
- function hook_me($my_first_parameter, $my_second_parameter, $hook_me = true)
- {
- if ($hook_me)
- {
- global $phpbb_hook;
-
- if ($phpbb_hook-&gt;call_hook(array(__CLASS__, __FUNCTION__), $my_first_parameter, $my_second_parameter))
- {
- if ($phpbb_hook-&gt;hook_return(array(__CLASS__, __FUNCTION__)))
- {
- return $phpbb_hook-&gt;hook_return_result(array(__CLASS__, __FUNCTION__));
- }
- }
- }
-
- return 'not hooked';
- }
-}
-
-function hooking(&amp;$hook, $first, $second)
-{
- return 'hooked';
-}
-
-$first_object = new my_hookable_object2();
-$second_object = new my_hookable_object2();
-
-$phpbb_hook-&gt;add_hook(array('my_hookable_object2', 'hook_me'));
-
-$phpbb_hook-&gt;register(array('my_hookable_object2', 'hook_me'), 'hooking');
-
-echo $first_object-&gt;hook_me('first', 'second', false) . '&lt;br /&gt;';
-echo $second_object-&gt;hook_me('first', 'second') . '&lt;br /&gt;';
- </pre></div>
-
- <p>OUTPUT:</p>
-
- <div class="codebox"><pre>
-not hooked
-hooked
- </pre></div>
-
- </div>
-
- <div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
-
- <span class="corners-bottom"><span></span></span></div>
- </div>
-
- <a name="return"></a><h2>4. Result returning</h2>
-
- <div class="paragraph">
- <div class="inner"><span class="corners-top"><span></span></span>
-
- <div class="content">
-
-<p>Generally, the distinction has to be made if a function returns the result obtained from the called function or continue the execution. Based on the needs of the application this may differ. Therefore, the function returns the results only if the called hook function is returning a result.</p>
-
-<h3>Case 1 - Returning the result</h3>
-
-<p>Imagine the following function supporting hooks:</p>
-
-<div class="codebox"><pre>
-function append_sid($url, $params = false, $is_amp = true, $session_id = false)
-{
- global $_SID, $_EXTRA_URL, $phpbb_hook;
-
- // Developers using the hook function need to globalise the $_SID and $_EXTRA_URL on their own and also handle it appropiatly.
- // They could mimick most of what is within this function
- if ($phpbb_hook-&gt;call_hook(__FUNCTION__, $url, $params, $is_amp, $session_id))
- {
- if ($phpbb_hook-&gt;hook_return(__FUNCTION__))
- {
- return $phpbb_hook-&gt;hook_return_result(__FUNCTION__);
- }
- }
-
- [...]
-}
-</pre></div>
-
-<p>Now, the following function is yours. Since you return a value, the append_sid() function itself is returning it as is:</p>
-
-<div class="codebox"><pre>
-// The function called
-function my_append_sid(&amp;$hook, $url, $params = false, $is_amp = true, $session_id = false)
-{
- // Get possible previous results
- $result = $hook-&gt;previous_hook_result('append_sid');
-
- return 'Since i return something the append_sid() function will return my result.';
-}
-</pre></div>
-
-<p>To be able to get the results returned from functions higher in the change the <code>previous_hook_result()</code> method should always be used, it returns an <code>array('result' => [your result])</code> construct.</p>
-
-<h3>Case 2 - Not Returning any result</h3>
-
-<p>Sometimes applications want to return nothing and therefore force the underlying function to continue it's execution:</p>
-
-<div class="codebox"><pre>
-function append_sid($url, $params = false, $is_amp = true, $session_id = false)
-{
- global $_SID, $_EXTRA_URL, $phpbb_hook;
-
- // Developers using the hook function need to globalise the $_SID and $_EXTRA_URL on their own and also handle it appropiatly.
- // They could mimick most of what is within this function
- if ($phpbb_hook-&gt;call_hook(__FUNCTION__, $url, $params, $is_amp, $session_id))
- {
- if ($phpbb_hook-&gt;hook_return(__FUNCTION__))
- {
- return $phpbb_hook-&gt;hook_return_result(__FUNCTION__);
- }
- }
-
- [...]
-}
-
-// The function called
-function my_append_sid(&amp;$hook, $url, $params = false, $is_amp = true, $session_id = false)
-{
- // Get possible previous results
- $result = $hook-&gt;previous_hook_result('append_sid');
-
- [...]
-
- // I only rewrite some variables, but return nothing. Therefore, the append_sid() function will not return my (non)result.
-}
-</pre></div>
-
-<p>Please Note: The decision to return or not return is solely made of the very last function call within the hook chain. An example:</p>
-
-<div class="codebox"><pre>
-// The function called
-function my_append_sid(&amp;$hook, $url, $params = false, $is_amp = true, $session_id = false)
-{
- // Get possible previous results
- $result = $hook-&gt;previous_hook_result('append_sid');
-
- // $result is not filled
-
- return 'FILLED';
-}
-
-// This function is registered too and gets executed after my_append_sid()
-function my_own_append_sid(&amp;$hook, $url, $params = false, $is_amp = true, $session_id = false)
-{
- $result = $hook->previous_hook_result('append_sid');
-
- // $result is actually filled with $result['result'] = 'FILLED'
- // But i return nothing, therefore append_sid() continues it's execution.
-}
-
-// The way both functions are registered.
-$phpbb_hook->register('append_sid', 'my_append_sid');
-$phpbb_hook->register('append_sid', 'my_own_append_sid');
-</pre></div>
-
- </div>
-
- <div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
-
- <span class="corners-bottom"><span></span></span></div>
- </div>
-
- <a name="embed"></a><h2>5. Embedding your hook files/classes/methods</h2>
-
- <div class="paragraph">
- <div class="inner"><span class="corners-top"><span></span></span>
-
- <div class="content">
-
-<p>There are basically two methods you are able to choose from:</p>
-
-<p>1) Add a file to includes/hooks/. The file need to be prefixed by <code>hook_</code>. This file is included within common.php, you are able to register your hooks, include other files or functions, etc. It is advised to only include other files if needed (within a function call for example).</p>
-
-<p>Please be aware that you need to purge your cache within the ACP to make your newly placed file available to phpBB3.</p>
-
-<p>2) The second method is meant for those wanting to wrap phpBB3 without placing a custom file to the hooks directory. This is mostly done by including phpBB's files within the application file. To be able to register your hooks you need to create a function within your application:</p>
-
-<div class="codebox"><pre>
-// My function which gets executed within the hooks constuctor
-function phpbb_hook_register(&amp;$hook)
-{
- $hook-&gt;register('append_sid', 'my_append_sid');
-}
-
-[...]
-</pre></div>
-
-<p>You should get the idea. ;)</p>
-
- </div>
-
- <div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
-
- <span class="corners-bottom"><span></span></span></div>
- </div>
-
- <a name="disclaimer"></a><h2>6. Copyright and disclaimer</h2>
-
- <div class="paragraph">
- <div class="inner"><span class="corners-top"><span></span></span>
-
- <div class="content">
-
- <p>This application is opensource software released under the <a href="http://opensource.org/licenses/gpl-2.0.php">GNU General Public License v2</a>. Please see source code and the docs directory for more details. This package and its contents are Copyright (c) <a href="https://www.phpbb.com/">phpBB Group</a>, All Rights Reserved.</p>
-
- </div>
-
- <div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
-
- <span class="corners-bottom"><span></span></span></div>
- </div>
-
- <div id="page-footer">
- <div class="version">&nbsp;</div>
- </div>
-</div></div>
-
-<div>
- <a id="bottom" name="bottom" accesskey="z"></a>
-</div>
-
-</body>
-</html>
diff --git a/phpBB/docs/lighttpd.sample.conf b/phpBB/docs/lighttpd.sample.conf
index 5873d1c945..f5b509e002 100644
--- a/phpBB/docs/lighttpd.sample.conf
+++ b/phpBB/docs/lighttpd.sample.conf
@@ -1,12 +1,22 @@
# Sample lighttpd configuration file for phpBB.
# Global settings have been removed, copy them
# from your system's lighttpd.conf.
-# Tested with lighttpd 1.4.26
+# Tested with lighttpd 1.4.35
+
+# If you want to use the X-Sendfile feature,
+# uncomment the 'allow-x-send-file' for the fastcgi
+# server below and add the following to your config.php
+#
+# define('PHPBB_ENABLE_X_SENDFILE', true);
+#
+# See http://blog.lighttpd.net/articles/2006/07/02/x-sendfile
+# for the details on X-Sendfile.
# Load moules
server.modules += (
"mod_access",
"mod_fastcgi",
+ "mod_rewrite",
"mod_accesslog"
)
@@ -27,7 +37,7 @@ $HTTP["host"] == "www.myforums.com" {
accesslog.filename = "/var/log/lighttpd/access-www.myforums.com.log"
# Deny access to internal phpbb files.
- $HTTP["url"] =~ "^/(config\.php|common\.php|includes|cache|files|store|images/avatars/upload)" {
+ $HTTP["url"] =~ "^/(config\.php|common\.php|cache|files|images/avatars/upload|includes|phpbb|store|vendor)" {
url.access-deny = ( "" )
}
@@ -40,7 +50,15 @@ $HTTP["host"] == "www.myforums.com" {
$HTTP["url"] =~ "/\.htaccess|/\.htpasswd|/\.htgroups" {
url.access-deny = ( "" )
}
-
+
+ # The following 3 lines will rewrite URLs passed through the front controller
+ # to not require app.php in the actual URL. In other words, a controller is
+ # by default accessed at /app.php/my/controller, but can also be accessed at
+ # /my/controller
+ url.rewrite-if-not-file = (
+ "^/(.*)$" => "/app.php/$1"
+ )
+
fastcgi.server = ( ".php" =>
((
"bin-path" => "/usr/bin/php-cgi",
@@ -54,6 +72,7 @@ $HTTP["host"] == "www.myforums.com" {
"bin-copy-environment" => (
"PATH", "SHELL", "USER"
),
+ #"allow-x-send-file" => "enable",
"broken-scriptfilename" => "enable"
))
)
diff --git a/phpBB/docs/nginx.sample.conf b/phpBB/docs/nginx.sample.conf
index 40b6ee76da..bf33f4e73d 100644
--- a/phpBB/docs/nginx.sample.conf
+++ b/phpBB/docs/nginx.sample.conf
@@ -3,6 +3,14 @@
# from your system's nginx.conf.
# Tested with nginx 0.8.35.
+# If you want to use the X-Accel-Redirect feature,
+# add the following to your config.php.
+#
+# define('PHPBB_ENABLE_X_ACCEL_REDIRECT', true);
+#
+# See http://wiki.nginx.org/XSendfile for the details
+# on X-Accel-Redirect.
+
http {
# Compression - requires gzip and gzip static modules.
gzip on;
@@ -56,10 +64,15 @@ http {
location / {
# phpbb uses index.htm
index index.php index.html index.htm;
+ try_files $uri $uri/ @rewriteapp;
+ }
+
+ location @rewriteapp {
+ rewrite ^(.*)$ /app.php/$1 last;
}
# Deny access to internal phpbb files.
- location ~ /(config\.php|common\.php|includes|cache|files|store|images/avatars/upload) {
+ location ~ /(config\.php|common\.php|cache|files|images/avatars/upload|includes|phpbb|store|vendor) {
deny all;
# deny was ignored before 0.8.40 for connections over IPv6.
# Use internal directive to prohibit access on older versions.
@@ -67,12 +80,16 @@ http {
}
# Pass the php scripts to fastcgi server specified in upstream declaration.
- location ~ \.php$ {
- fastcgi_pass php;
- # Necessary for php.
- fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ location ~ \.php(/|$) {
# Unmodified fastcgi_params from nginx distribution.
include fastcgi_params;
+ # Necessary for php.
+ fastcgi_split_path_info ^(.+\.php)(/.*)$;
+ fastcgi_param PATH_INFO $fastcgi_path_info;
+ fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
+ fastcgi_param DOCUMENT_ROOT $realpath_root;
+ try_files $uri $uri/ /app.php$is_args$args;
+ fastcgi_pass php;
}
# Deny access to version control system directories.
diff --git a/phpBB/docs/site_logo.gif b/phpBB/docs/site_logo.gif
deleted file mode 100644
index 909114c377..0000000000
--- a/phpBB/docs/site_logo.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/docs/sphinx.sample.conf b/phpBB/docs/sphinx.sample.conf
new file mode 100644
index 0000000000..0a210ecd1a
--- /dev/null
+++ b/phpBB/docs/sphinx.sample.conf
@@ -0,0 +1,100 @@
+source source_phpbb_{SPHINX_ID}_main
+{
+ type = mysql # mysql or pgsql
+ sql_host = localhost # SQL server host sphinx connects to
+ sql_user = username
+ sql_pass = password
+ sql_db = db_name
+ sql_port = 3306 # optional, default is 3306 for mysql and 5432 for pgsql
+ sql_query_pre = SET NAMES 'utf8'
+ sql_query_pre = UPDATE phpbb_sphinx SET max_doc_id = (SELECT MAX(post_id) FROM phpbb_posts) WHERE counter_id = 1
+ sql_query_range = SELECT MIN(post_id), MAX(post_id) FROM phpbb_posts
+ sql_range_step = 5000
+ sql_query = SELECT \
+ p.post_id AS id, \
+ p.forum_id, \
+ p.topic_id, \
+ p.poster_id, \
+ p.post_visibility, \
+ CASE WHEN p.post_id = t.topic_first_post_id THEN 1 ELSE 0 END as topic_first_post, \
+ p.post_time, \
+ p.post_subject, \
+ p.post_subject as title, \
+ p.post_text as data, \
+ t.topic_last_post_time, \
+ 0 as deleted\
+ FROM phpbb_posts p, phpbb_topics t \
+ WHERE \
+ p.topic_id = t.topic_id \
+ AND p.post_id >= $start AND p.post_id <= $end
+ sql_query_post =
+ sql_query_post_index = UPDATE phpbb_sphinx SET max_doc_id = $maxid WHERE counter_id = 1
+ sql_query_info = SELECT * FROM phpbb_posts WHERE post_id = $id
+ sql_attr_uint = forum_id
+ sql_attr_uint = topic_id
+ sql_attr_uint = poster_id
+ sql_attr_uint = post_visibility
+ sql_attr_bool = topic_first_post
+ sql_attr_bool = deleted
+ sql_attr_timestamp = post_time
+ sql_attr_timestamp = topic_last_post_time
+ sql_attr_string = post_subject
+}
+source source_phpbb_{SPHINX_ID}_delta : source_phpbb_{SPHINX_ID}_main
+{
+ sql_query_pre =
+ sql_query_range =
+ sql_range_step =
+ sql_query = SELECT \
+ p.post_id AS id, \
+ p.forum_id, \
+ p.topic_id, \
+ p.poster_id, \
+ p.post_visibility, \
+ CASE WHEN p.post_id = t.topic_first_post_id THEN 1 ELSE 0 END as topic_first_post, \
+ p.post_time, \
+ p.post_subject, \
+ p.post_subject as title, \
+ p.post_text as data, \
+ t.topic_last_post_time, \
+ 0 as deleted \
+ FROM phpbb_posts p, phpbb_topics t \
+ WHERE \
+ p.topic_id = t.topic_id \
+ AND p.post_id >= ( SELECT max_doc_id FROM phpbb_sphinx WHERE counter_id=1 )
+ sql_query_pre =
+}
+index index_phpbb_{SPHINX_ID}_main
+{
+ path = {DATA_PATH}/index_phpbb_{SPHINX_ID}_main
+ source = source_phpbb_{SPHINX_ID}_main
+ docinfo = extern
+ morphology = none
+ stopwords =
+ min_word_len = 2
+ charset_type = utf-8
+ charset_table = U+FF10..U+FF19->0..9, 0..9, U+FF41..U+FF5A->a..z, U+FF21..U+FF3A->a..z, A..Z->a..z, a..z, U+0149, U+017F, U+0138, U+00DF, U+00FF, U+00C0..U+00D6->U+00E0..U+00F6, U+00E0..U+00F6, U+00D8..U+00DE->U+00F8..U+00FE, U+00F8..U+00FE, U+0100->U+0101, U+0101, U+0102->U+0103, U+0103, U+0104->U+0105, U+0105, U+0106->U+0107, U+0107, U+0108->U+0109, U+0109, U+010A->U+010B, U+010B, U+010C->U+010D, U+010D, U+010E->U+010F, U+010F, U+0110->U+0111, U+0111, U+0112->U+0113, U+0113, U+0114->U+0115, U+0115, U+0116->U+0117, U+0117, U+0118->U+0119, U+0119, U+011A->U+011B, U+011B, U+011C->U+011D, U+011D, U+011E->U+011F, U+011F, U+0130->U+0131, U+0131, U+0132->U+0133, U+0133, U+0134->U+0135, U+0135, U+0136->U+0137, U+0137, U+0139->U+013A, U+013A, U+013B->U+013C, U+013C, U+013D->U+013E, U+013E, U+013F->U+0140, U+0140, U+0141->U+0142, U+0142, U+0143->U+0144, U+0144, U+0145->U+0146, U+0146, U+0147->U+0148, U+0148, U+014A->U+014B, U+014B, U+014C->U+014D, U+014D, U+014E->U+014F, U+014F, U+0150->U+0151, U+0151, U+0152->U+0153, U+0153, U+0154->U+0155, U+0155, U+0156->U+0157, U+0157, U+0158->U+0159, U+0159, U+015A->U+015B, U+015B, U+015C->U+015D, U+015D, U+015E->U+015F, U+015F, U+0160->U+0161, U+0161, U+0162->U+0163, U+0163, U+0164->U+0165, U+0165, U+0166->U+0167, U+0167, U+0168->U+0169, U+0169, U+016A->U+016B, U+016B, U+016C->U+016D, U+016D, U+016E->U+016F, U+016F, U+0170->U+0171, U+0171, U+0172->U+0173, U+0173, U+0174->U+0175, U+0175, U+0176->U+0177, U+0177, U+0178->U+00FF, U+00FF, U+0179->U+017A, U+017A, U+017B->U+017C, U+017C, U+017D->U+017E, U+017E, U+0410..U+042F->U+0430..U+044F, U+0430..U+044F, U+4E00..U+9FFF
+ min_prefix_len = 0
+ min_infix_len = 0
+}
+index index_phpbb_{SPHINX_ID}_delta : index_phpbb_{SPHINX_ID}_main
+{
+ path = {DATA_PATH}/index_phpbb_{SPHINX_ID}_delta
+ source = source_phpbb_{SPHINX_ID}_delta
+}
+indexer
+{
+ mem_limit = 512M
+}
+searchd
+{
+ compat_sphinxql_magics = 0
+ listen = localhost:9312
+ log = {DATA_PATH}/log/searchd.log
+ query_log = {DATA_PATH}/log/sphinx-query.log
+ read_timeout = 5
+ max_children = 30
+ pid_file = {DATA_PATH}/searchd.pid
+ max_matches = 20000
+ binlog_path = {DATA_PATH}
+}
diff --git a/phpBB/docs/stylesheet.css b/phpBB/docs/stylesheet.css
deleted file mode 100644
index 6b8f5994c0..0000000000
--- a/phpBB/docs/stylesheet.css
+++ /dev/null
@@ -1,352 +0,0 @@
-/*
- The original "prosilver" theme for phpBB3
- Created by subBlue design :: http://www.subBlue.com
-*/
-
-* { margin: 0; padding: 0; }
-
-html { font-size: 100%; height: 100%; margin-bottom: 1px; }
-
-body {
- font-family: Verdana, Helvetica, Arial, sans-serif;
- color: #828282;
- background-color: #FFFFFF;
- font-size: 12px;
- margin: 0;
- padding: 12px 0;
-}
-
-img { border-width: 0; }
-
-p {
- line-height: 1.3em;
- font-size: 1.1em;
- margin-bottom: 1.5em;
-}
-
-hr {
- border: 0 none #FFFFFF;
- border-top: 1px solid #CCCCCC;
- height: 1px;
- margin: 5px 0;
- display: block;
- clear: both;
-}
-
-html, body {
- color: #536482;
- background-color: #FFFFFF;
-}
-
-#doc-description h1 {
- font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
- margin-right: 200px;
- color: #FFFFFF;
- margin-top: 15px;
- font-weight: bold;
- font-size: 2em;
- color: #fff;
-}
-
-h1 {
- font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
- font-weight: normal;
- color: #000;
- font-size: 2em;
- margin: 0.8em 0 0.2em 0;
-}
-
-h2 {
- font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
- font-weight: normal;
- color: #28313F;
- font-size: 1.5em;
- margin: 0.8em 0 0.2em 0;
-}
-
-h3 {
- font-family: Arial, Helvetica, sans-serif;
- font-weight: bold;
- border-bottom: 1px solid #CCCCCC;
- margin-bottom: 3px;
- padding-bottom: 2px;
- font-size: 1.05em;
- color: #115098;
- margin-top: 20px;
-}
-
-h4 {
- font-family: Arial, Helvetica, sans-serif;
- font-weight: bold;
- margin-bottom: 3px;
- padding-bottom: 2px;
- font-size: 1.05em;
- color: #115098;
- margin-top: 20px;
-}
-
-.good { color: green; }
-.bad { color: red; }
-
-.version {
- margin-top: 20px;
- text-align: left;
- font-size: 70%;
- color: #006600;
- border-top: 1px solid #ccc;
-}
-
-code {
- color: #006600;
- font-weight: normal;
- font-family: 'Courier New', monospace;
- border-color: #D1D7DC;
- border-width: 1px;
- border-style: solid;
- background-color: #FAFAFA;
-}
-
-#wrap {
- padding: 0 20px;
- min-width: 650px;
-}
-
-#simple-wrap {
- padding: 6px 10px;
-}
-
-#page-body {
- margin: 4px 0;
- clear: both;
-}
-
-#page-footer {
- clear: both;
-}
-
-#logo {
- float: left;
- width: auto;
- padding: 10px 13px 0 10px;
-}
-
-a#logo:hover {
- text-decoration: none;
-}
-
-#doc-description {
- float: left;
- width: 70%;
-}
-
-#doc-description h1 {
- margin-right: 0;
-}
-
-.headerbar {
- background: #ebebeb none repeat-x 0 0;
- color: #FFFFFF;
- margin-bottom: 4px;
- padding: 0 5px;
-}
-
-span.corners-top, span.corners-bottom, span.corners-top span, span.corners-bottom span {
- font-size: 1px;
- line-height: 1px;
- display: block;
- height: 5px;
- background-repeat: no-repeat;
-}
-
-span.corners-top {
- background-image: none;
- background-position: 0 0;
- margin: 0 -5px;
-}
-
-span.corners-top span {
- background-image: none;
- background-position: 100% 0;
-}
-
-span.corners-bottom {
- background-image: none;
- background-position: 0 100%;
- margin: 0 -5px;
- clear: both;
-}
-
-span.corners-bottom span {
- background-image: none;
- background-position: 100% 100%;
-}
-
-.paragraph {
- padding: 0 10px;
- margin-bottom: 4px;
- background-repeat: no-repeat;
- background-position: 100% 0;
- background-color: #ECF3F7;
-}
-
-.paragraph:target .content {
- color: #000000;
-}
-
-.paragraph:target h3 a {
- color: #000000;
-}
-
-.content {
- color: #333333;
-}
-
-.content h2, .panel h2 {
- color: #115098;
- border-bottom-color: #CCCCCC;
-}
-
-a:link { color: #898989; text-decoration: none; }
-a:visited { color: #898989; text-decoration: none; }
-a:hover { color: #d3d3d3; text-decoration: underline; }
-a:active { color: #d2d2d2; text-decoration: none; }
-
-hr {
- border-color: #FFFFFF;
- border-top-color: #CCCCCC;
-}
-
-.menu {
- background-color: #cadceb;
-}
-
-.headerbar {
- background-color: #12A3EB;
- background-image: url("bg_header.gif");
- color: #FFFFFF;
-}
-
-.panel {
- background-color: #ECF1F3;
- color: #28313F;
-}
-
-
-span.corners-top {
- background-image: url("corners_left.png");
-}
-
-span.corners-top span {
- background-image: url("corners_right.png");
-}
-
-span.corners-bottom {
- background-image: url("corners_left.png");
-}
-
-span.corners-bottom span {
- background-image: url("corners_right.png");
-}
-
-.error {
- color: #BC2A4D;
-}
-
-a:link { color: #105289; }
-a:visited { color: #105289; }
-a:hover { color: #D31141; }
-a:active { color: #368AD2; }
-
-.paragraph span.corners-top, .paragraph span.corners-bottom {
- margin: 0 -10px;
-}
-
-.content {
- padding: 0;
- line-height: 1.48em;
- color: #333333;
-}
-
-.content h2, .panel h2 {
- color: #115098;
- border-bottom-color: #CCCCCC;
-}
-
-.notice {
- border-top-color: #CCCCCC;
-}
-
-.codebox {
- padding: 3px;
- background-color: #FFFFFF;
- border: 1px solid #C9D2D8;
- font-size: 1em;
- margin-bottom: 10px;
- display: block;
- font: 0.9em Monaco, "Andale Mono","Courier New", Courier, mono;
- line-height: 1.3em;
-}
-
-* html hr { margin: 0; }
-* html span.corners-top, * html span.corners-bottom { background-image: url("corners_left.gif"); }
-* html span.corners-top span, * html span.corners-bottom span { background-image: url("corners_right.gif"); }
-
-.back2top {
- clear: both;
- height: 11px;
- text-align: right;
-}
-
-.content ol, .content ul {
- margin-left: 25px;
- margin-top: 0;
-}
-
-.content ul + p, .content ul + div {
- margin-top: 20px;
-}
-
-.comment {
- color: green;
-}
-
-.indent {
- margin-left: 20px;
-}
-
-.paragraph table {
- font-size: 8pt;
- border-collapse: collapse;
- border: 1px solid #cfcfcf;
- margin-bottom: 20px;
-}
-
-.paragraph table caption {
- display: none;
-}
-
-.paragraph table thead {
- background-color: #cadceb;
- color: #000;
-}
-
-.paragraph table td, .paragraph table th {
- border: 1px solid #006699;
- padding: 0.5em;
- background-color: #e1ebf2;
-}
-
-.paragraph table th {
- background-color: #cadceb;
-}
-
-.paragraph table td dl {
- margin: 0;
- padding: 0;
-}
-
-.paragraph table td dl dt {
- float: left;
- clear: both;
- margin-right: 1em;
-}
diff --git a/phpBB/download/file.php b/phpBB/download/file.php
index cf8aaa03e8..e60ffad6b0 100644
--- a/phpBB/download/file.php
+++ b/phpBB/download/file.php
@@ -1,10 +1,13 @@
<?php
/**
*
-* @package phpBB3
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -15,7 +18,6 @@ define('IN_PHPBB', true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './../';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
-
// Thank you sun.
if (isset($_SERVER['CONTENT_TYPE']))
{
@@ -32,33 +34,61 @@ else if (isset($_SERVER['HTTP_USER_AGENT']) && strpos($_SERVER['HTTP_USER_AGENT'
if (isset($_GET['avatar']))
{
require($phpbb_root_path . 'includes/startup.' . $phpEx);
- require($phpbb_root_path . 'config.' . $phpEx);
+
+ require($phpbb_root_path . 'phpbb/class_loader.' . $phpEx);
+ $phpbb_class_loader = new \phpbb\class_loader('phpbb\\', "{$phpbb_root_path}phpbb/", $phpEx);
+ $phpbb_class_loader->register();
+
+ $phpbb_config_php_file = new \phpbb\config_php_file($phpbb_root_path, $phpEx);
+ extract($phpbb_config_php_file->get_all());
if (!defined('PHPBB_INSTALLED') || empty($dbms) || empty($acm_type))
{
exit;
}
- require($phpbb_root_path . 'includes/acm/acm_' . $acm_type . '.' . $phpEx);
- require($phpbb_root_path . 'includes/cache.' . $phpEx);
- require($phpbb_root_path . 'includes/db/' . $dbms . '.' . $phpEx);
require($phpbb_root_path . 'includes/constants.' . $phpEx);
require($phpbb_root_path . 'includes/functions.' . $phpEx);
+ require($phpbb_root_path . 'includes/functions_download' . '.' . $phpEx);
+ require($phpbb_root_path . 'includes/utf/utf_tools.' . $phpEx);
- $db = new $sql_db();
- $cache = new cache();
+ // Setup class loader first
+ $phpbb_class_loader_ext = new \phpbb\class_loader('\\', "{$phpbb_root_path}ext/", $phpEx);
+ $phpbb_class_loader_ext->register();
+
+ phpbb_load_extensions_autoloaders($phpbb_root_path);
+
+ // Set up container
+ $phpbb_container_builder = new \phpbb\di\container_builder($phpbb_config_php_file, $phpbb_root_path, $phpEx);
+ $phpbb_container = $phpbb_container_builder->get_container();
+
+ $phpbb_class_loader->set_cache($phpbb_container->get('cache.driver'));
+ $phpbb_class_loader_ext->set_cache($phpbb_container->get('cache.driver'));
+
+ // set up caching
+ $cache = $phpbb_container->get('cache');
+
+ $phpbb_dispatcher = $phpbb_container->get('dispatcher');
+ $request = $phpbb_container->get('request');
+ $db = $phpbb_container->get('dbal.conn');
+ $phpbb_log = $phpbb_container->get('log');
- // Connect to DB
- if (!@$db->sql_connect($dbhost, $dbuser, $dbpasswd, $dbname, $dbport, false, false))
- {
- exit;
- }
unset($dbpasswd);
+ request_var('', 0, false, false, $request);
+
+ $config = $phpbb_container->get('config');
+ set_config(null, null, null, $config);
+ set_config_count(null, null, null, $config);
+
+ // load extensions
+ $phpbb_extension_manager = $phpbb_container->get('ext.manager');
+
// worst-case default
- $browser = (!empty($_SERVER['HTTP_USER_AGENT'])) ? htmlspecialchars((string) $_SERVER['HTTP_USER_AGENT']) : 'msie 6.0';
+ $browser = strtolower($request->header('User-Agent', 'msie 6.0'));
+
+ $phpbb_avatar_manager = $phpbb_container->get('avatar.manager');
- $config = $cache->obtain_config();
$filename = request_var('avatar', '');
$avatar_group = false;
$exit = false;
@@ -108,8 +138,9 @@ if (isset($_GET['avatar']))
// implicit else: we are not in avatar mode
include($phpbb_root_path . 'common.' . $phpEx);
+require($phpbb_root_path . 'includes/functions_download' . '.' . $phpEx);
-$download_id = request_var('id', 0);
+$attach_id = request_var('id', 0);
$mode = request_var('mode', '');
$thumbnail = request_var('t', false);
@@ -118,22 +149,22 @@ $user->session_begin(false);
$auth->acl($user->data);
$user->setup('viewtopic');
-if (!$download_id)
+if (!$config['allow_attachments'] && !$config['allow_pm_attach'])
{
send_status_line(404, 'Not Found');
- trigger_error('NO_ATTACHMENT_SELECTED');
+ trigger_error('ATTACHMENT_FUNCTIONALITY_DISABLED');
}
-if (!$config['allow_attachments'] && !$config['allow_pm_attach'])
+if (!$attach_id)
{
send_status_line(404, 'Not Found');
- trigger_error('ATTACHMENT_FUNCTIONALITY_DISABLED');
+ trigger_error('NO_ATTACHMENT_SELECTED');
}
-$sql = 'SELECT attach_id, in_message, post_msg_id, extension, is_orphan, poster_id, filetime
+$sql = 'SELECT attach_id, post_msg_id, topic_id, in_message, poster_id, is_orphan, physical_filename, real_filename, extension, mimetype, filesize, filetime
FROM ' . ATTACHMENTS_TABLE . "
- WHERE attach_id = $download_id";
-$result = $db->sql_query_limit($sql, 1);
+ WHERE attach_id = $attach_id";
+$result = $db->sql_query($sql);
$attachment = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
@@ -142,594 +173,142 @@ if (!$attachment)
send_status_line(404, 'Not Found');
trigger_error('ERROR_NO_ATTACHMENT');
}
-
-if ((!$attachment['in_message'] && !$config['allow_attachments']) || ($attachment['in_message'] && !$config['allow_pm_attach']))
+else if (!download_allowed())
{
- send_status_line(404, 'Not Found');
- trigger_error('ATTACHMENT_FUNCTIONALITY_DISABLED');
+ send_status_line(403, 'Forbidden');
+ trigger_error($user->lang['LINKAGE_FORBIDDEN']);
}
-
-$row = array();
-
-if ($attachment['is_orphan'])
+else
{
- // We allow admins having attachment permissions to see orphan attachments...
- $own_attachment = ($auth->acl_get('a_attach') || $attachment['poster_id'] == $user->data['user_id']) ? true : false;
+ $attachment['physical_filename'] = utf8_basename($attachment['physical_filename']);
- if (!$own_attachment || ($attachment['in_message'] && !$auth->acl_get('u_pm_download')) || (!$attachment['in_message'] && !$auth->acl_get('u_download')))
+ if (!$attachment['in_message'] && !$config['allow_attachments'] || $attachment['in_message'] && !$config['allow_pm_attach'])
{
send_status_line(404, 'Not Found');
- trigger_error('ERROR_NO_ATTACHMENT');
+ trigger_error('ATTACHMENT_FUNCTIONALITY_DISABLED');
}
- // Obtain all extensions...
- $extensions = $cache->obtain_attach_extensions(true);
-}
-else
-{
- if (!$attachment['in_message'])
- {
- //
- $sql = 'SELECT p.forum_id, f.forum_name, f.forum_password, f.parent_id
- FROM ' . POSTS_TABLE . ' p, ' . FORUMS_TABLE . ' f
- WHERE p.post_id = ' . $attachment['post_msg_id'] . '
- AND p.forum_id = f.forum_id';
- $result = $db->sql_query_limit($sql, 1);
- $row = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
-
- // Global announcement?
- $f_download = (!$row) ? $auth->acl_getf_global('f_download') : $auth->acl_get('f_download', $row['forum_id']);
-
- if ($auth->acl_get('u_download') && $f_download)
- {
- if ($row && $row['forum_password'])
- {
- // Do something else ... ?
- login_forum_box($row);
- }
- }
- else
- {
- send_status_line(403, 'Forbidden');
- trigger_error('SORRY_AUTH_VIEW_ATTACH');
- }
- }
- else
+ if ($attachment['is_orphan'])
{
- $row['forum_id'] = false;
- if (!$auth->acl_get('u_pm_download'))
- {
- send_status_line(403, 'Forbidden');
- trigger_error('SORRY_AUTH_VIEW_ATTACH');
- }
-
- // Check if the attachment is within the users scope...
- $sql = 'SELECT user_id, author_id
- FROM ' . PRIVMSGS_TO_TABLE . '
- WHERE msg_id = ' . $attachment['post_msg_id'];
- $result = $db->sql_query($sql);
+ // We allow admins having attachment permissions to see orphan attachments...
+ $own_attachment = ($auth->acl_get('a_attach') || $attachment['poster_id'] == $user->data['user_id']) ? true : false;
- $allowed = false;
- while ($user_row = $db->sql_fetchrow($result))
+ if (!$own_attachment || ($attachment['in_message'] && !$auth->acl_get('u_pm_download')) || (!$attachment['in_message'] && !$auth->acl_get('u_download')))
{
- if ($user->data['user_id'] == $user_row['user_id'] || $user->data['user_id'] == $user_row['author_id'])
- {
- $allowed = true;
- break;
- }
- }
- $db->sql_freeresult($result);
-
- if (!$allowed)
- {
- send_status_line(403, 'Forbidden');
+ send_status_line(404, 'Not Found');
trigger_error('ERROR_NO_ATTACHMENT');
}
- }
-
- // disallowed?
- $extensions = array();
- if (!extension_allowed($row['forum_id'], $attachment['extension'], $extensions))
- {
- send_status_line(404, 'Forbidden');
- trigger_error(sprintf($user->lang['EXTENSION_DISABLED_AFTER_POSTING'], $attachment['extension']));
- }
-}
-
-if (!download_allowed())
-{
- send_status_line(403, 'Forbidden');
- trigger_error($user->lang['LINKAGE_FORBIDDEN']);
-}
-
-$download_mode = (int) $extensions[$attachment['extension']]['download_mode'];
-
-// Fetching filename here to prevent sniffing of filename
-$sql = 'SELECT attach_id, is_orphan, in_message, post_msg_id, extension, physical_filename, real_filename, mimetype, filetime
- FROM ' . ATTACHMENTS_TABLE . "
- WHERE attach_id = $download_id";
-$result = $db->sql_query_limit($sql, 1);
-$attachment = $db->sql_fetchrow($result);
-$db->sql_freeresult($result);
-
-if (!$attachment)
-{
- send_status_line(404, 'Not Found');
- trigger_error('ERROR_NO_ATTACHMENT');
-}
-
-$attachment['physical_filename'] = utf8_basename($attachment['physical_filename']);
-$display_cat = $extensions[$attachment['extension']]['display_cat'];
-
-if (($display_cat == ATTACHMENT_CATEGORY_IMAGE || $display_cat == ATTACHMENT_CATEGORY_THUMB) && !$user->optionget('viewimg'))
-{
- $display_cat = ATTACHMENT_CATEGORY_NONE;
-}
-
-if ($display_cat == ATTACHMENT_CATEGORY_FLASH && !$user->optionget('viewflash'))
-{
- $display_cat = ATTACHMENT_CATEGORY_NONE;
-}
-
-if ($thumbnail)
-{
- $attachment['physical_filename'] = 'thumb_' . $attachment['physical_filename'];
-}
-else if (($display_cat == ATTACHMENT_CATEGORY_NONE/* || $display_cat == ATTACHMENT_CATEGORY_IMAGE*/) && !$attachment['is_orphan'])
-{
- // Update download count
- $sql = 'UPDATE ' . ATTACHMENTS_TABLE . '
- SET download_count = download_count + 1
- WHERE attach_id = ' . $attachment['attach_id'];
- $db->sql_query($sql);
-}
-
-if ($display_cat == ATTACHMENT_CATEGORY_IMAGE && $mode === 'view' && (strpos($attachment['mimetype'], 'image') === 0) && (strpos(strtolower($user->browser), 'msie') !== false) && !phpbb_is_greater_ie_version($user->browser, 7))
-{
- wrap_img_in_html(append_sid($phpbb_root_path . 'download/file.' . $phpEx, 'id=' . $attachment['attach_id']), $attachment['real_filename']);
- file_gc();
-}
-else
-{
- // Determine the 'presenting'-method
- if ($download_mode == PHYSICAL_LINK)
- {
- // This presenting method should no longer be used
- if (!@is_dir($phpbb_root_path . $config['upload_path']))
- {
- send_status_line(500, 'Internal Server Error');
- trigger_error($user->lang['PHYSICAL_DOWNLOAD_NOT_POSSIBLE']);
- }
- redirect($phpbb_root_path . $config['upload_path'] . '/' . $attachment['physical_filename']);
- file_gc();
+ // Obtain all extensions...
+ $extensions = $cache->obtain_attach_extensions(true);
}
else
{
- send_file_to_browser($attachment, $config['upload_path'], $display_cat);
- file_gc();
- }
-}
-
-
-/**
-* A simplified function to deliver avatars
-* The argument needs to be checked before calling this function.
-*/
-function send_avatar_to_browser($file, $browser)
-{
- global $config, $phpbb_root_path;
-
- $prefix = $config['avatar_salt'] . '_';
- $image_dir = $config['avatar_path'];
-
- // Adjust image_dir path (no trailing slash)
- if (substr($image_dir, -1, 1) == '/' || substr($image_dir, -1, 1) == '\\')
- {
- $image_dir = substr($image_dir, 0, -1) . '/';
- }
- $image_dir = str_replace(array('../', '..\\', './', '.\\'), '', $image_dir);
-
- if ($image_dir && ($image_dir[0] == '/' || $image_dir[0] == '\\'))
- {
- $image_dir = '';
- }
- $file_path = $phpbb_root_path . $image_dir . '/' . $prefix . $file;
-
- if ((@file_exists($file_path) && @is_readable($file_path)) && !headers_sent())
- {
- header('Pragma: public');
-
- $image_data = @getimagesize($file_path);
- header('Content-Type: ' . image_type_to_mime_type($image_data[2]));
-
- if ((strpos(strtolower($browser), 'msie') !== false) && !phpbb_is_greater_ie_version($browser, 7))
+ if (!$attachment['in_message'])
{
- header('Content-Disposition: attachment; ' . header_filename($file));
+ phpbb_download_handle_forum_auth($db, $auth, $attachment['topic_id']);
- if (strpos(strtolower($browser), 'msie 6.0') !== false)
- {
- header('Expires: -1');
- }
- else
+ $sql = 'SELECT forum_id, post_visibility
+ FROM ' . POSTS_TABLE . '
+ WHERE post_id = ' . (int) $attachment['post_msg_id'];
+ $result = $db->sql_query($sql);
+ $post_row = $db->sql_fetchrow($result);
+ $db->sql_freeresult($result);
+
+ if (!$post_row || ($post_row['post_visibility'] != ITEM_APPROVED && !$auth->acl_get('m_approve', $post_row['forum_id'])))
{
- header('Expires: ' . gmdate('D, d M Y H:i:s \G\M\T', time() + 31536000));
+ // Attachment of a soft deleted post and the user is not allowed to see the post
+ send_status_line(404, 'Not Found');
+ trigger_error('ERROR_NO_ATTACHMENT');
}
}
else
{
- header('Content-Disposition: inline; ' . header_filename($file));
- header('Expires: ' . gmdate('D, d M Y H:i:s \G\M\T', time() + 31536000));
- }
-
- $size = @filesize($file_path);
- if ($size)
- {
- header("Content-Length: $size");
+ // Attachment is in a private message.
+ $post_row = array('forum_id' => false);
+ phpbb_download_handle_pm_auth($db, $auth, $user->data['user_id'], $attachment['post_msg_id']);
}
- if (@readfile($file_path) == false)
+ $extensions = array();
+ if (!extension_allowed($post_row['forum_id'], $attachment['extension'], $extensions))
{
- $fp = @fopen($file_path, 'rb');
-
- if ($fp !== false)
- {
- while (!feof($fp))
- {
- echo fread($fp, 8192);
- }
- fclose($fp);
- }
+ send_status_line(403, 'Forbidden');
+ trigger_error(sprintf($user->lang['EXTENSION_DISABLED_AFTER_POSTING'], $attachment['extension']));
}
-
- flush();
- }
- else
- {
- send_status_line(404, 'Not Found');
}
-}
-/**
-* Wraps an url into a simple html page. Used to display attachments in IE.
-* this is a workaround for now; might be moved to template system later
-* direct any complaints to 1 Microsoft Way, Redmond
-*/
-function wrap_img_in_html($src, $title)
-{
- echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-Strict.dtd">';
- echo '<html>';
- echo '<head>';
- echo '<meta http-equiv="content-type" content="text/html; charset=UTF-8" />';
- echo '<title>' . $title . '</title>';
- echo '</head>';
- echo '<body>';
- echo '<div>';
- echo '<img src="' . $src . '" alt="' . $title . '" />';
- echo '</div>';
- echo '</body>';
- echo '</html>';
-}
+ $download_mode = (int) $extensions[$attachment['extension']]['download_mode'];
+ $display_cat = $extensions[$attachment['extension']]['display_cat'];
-/**
-* Send file to browser
-*/
-function send_file_to_browser($attachment, $upload_dir, $category)
-{
- global $user, $db, $config, $phpbb_root_path;
-
- $filename = $phpbb_root_path . $upload_dir . '/' . $attachment['physical_filename'];
-
- if (!@file_exists($filename))
- {
- send_status_line(404, 'Not Found');
- trigger_error('ERROR_NO_ATTACHMENT');
- }
-
- // Correct the mime type - we force application/octetstream for all files, except images
- // Please do not change this, it is a security precaution
- if ($category != ATTACHMENT_CATEGORY_IMAGE || strpos($attachment['mimetype'], 'image') !== 0)
+ if (($display_cat == ATTACHMENT_CATEGORY_IMAGE || $display_cat == ATTACHMENT_CATEGORY_THUMB) && !$user->optionget('viewimg'))
{
- $attachment['mimetype'] = (strpos(strtolower($user->browser), 'msie') !== false || strpos(strtolower($user->browser), 'opera') !== false) ? 'application/octetstream' : 'application/octet-stream';
+ $display_cat = ATTACHMENT_CATEGORY_NONE;
}
- if (@ob_get_length())
+ if ($display_cat == ATTACHMENT_CATEGORY_FLASH && !$user->optionget('viewflash'))
{
- @ob_end_clean();
+ $display_cat = ATTACHMENT_CATEGORY_NONE;
}
- // Now send the File Contents to the Browser
- $size = @filesize($filename);
-
- // To correctly display further errors we need to make sure we are using the correct headers for both (unsetting content-length may not work)
-
- // Check if headers already sent or not able to get the file contents.
- if (headers_sent() || !@file_exists($filename) || !@is_readable($filename))
- {
- // PHP track_errors setting On?
- if (!empty($php_errormsg))
- {
- send_status_line(500, 'Internal Server Error');
- trigger_error($user->lang['UNABLE_TO_DELIVER_FILE'] . '<br />' . sprintf($user->lang['TRACKED_PHP_ERROR'], $php_errormsg));
- }
-
- send_status_line(500, 'Internal Server Error');
- trigger_error('UNABLE_TO_DELIVER_FILE');
- }
-
- // Now the tricky part... let's dance
- header('Pragma: public');
-
/**
- * Commented out X-Sendfile support. To not expose the physical filename within the header if xsendfile is absent we need to look into methods of checking it's status.
- *
- * Try X-Sendfile since it is much more server friendly - only works if the path is *not* outside of the root path...
- * lighttpd has core support for it. An apache2 module is available at http://celebnamer.celebworld.ws/stuff/mod_xsendfile/
+ * Event to modify data before sending file to browser
*
- * Not really ideal, but should work fine...
- * <code>
- * if (strpos($upload_dir, '/') !== 0 && strpos($upload_dir, '../') === false)
- * {
- * header('X-Sendfile: ' . $filename);
- * }
- * </code>
+ * @event core.download_file_send_to_browser_before
+ * @var int attach_id The attachment ID
+ * @var array attachment Array with attachment data
+ * @var int display_cat Attachment category
+ * @var int download_mode File extension specific download mode
+ * @var array extensions Array with file extensions data
+ * @var string mode Download mode
+ * @var bool thumbnail Flag indicating if the file is a thumbnail
+ * @since 3.1.6-RC1
+ * @changed 3.1.7-RC1 Fixing wrong name of a variable (replacing "extension" by "extensions")
*/
+ $vars = array(
+ 'attach_id',
+ 'attachment',
+ 'display_cat',
+ 'download_mode',
+ 'extensions',
+ 'mode',
+ 'thumbnail',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.download_file_send_to_browser_before', compact($vars)));
- // Send out the Headers. Do not set Content-Disposition to inline please, it is a security measure for users using the Internet Explorer.
- header('Content-Type: ' . $attachment['mimetype']);
-
- if (phpbb_is_greater_ie_version($user->browser, 7))
- {
- header('X-Content-Type-Options: nosniff');
- }
-
- if ($category == ATTACHMENT_CATEGORY_FLASH && request_var('view', 0) === 1)
- {
- // We use content-disposition: inline for flash files and view=1 to let it correctly play with flash player 10 - any other disposition will fail to play inline
- header('Content-Disposition: inline');
- }
- else
- {
- if (empty($user->browser) || ((strpos(strtolower($user->browser), 'msie') !== false) && !phpbb_is_greater_ie_version($user->browser, 7)))
- {
- header('Content-Disposition: attachment; ' . header_filename(htmlspecialchars_decode($attachment['real_filename'])));
- if (empty($user->browser) || (strpos(strtolower($user->browser), 'msie 6.0') !== false))
- {
- header('expires: -1');
- }
- }
- else
- {
- header('Content-Disposition: ' . ((strpos($attachment['mimetype'], 'image') === 0) ? 'inline' : 'attachment') . '; ' . header_filename(htmlspecialchars_decode($attachment['real_filename'])));
- if (phpbb_is_greater_ie_version($user->browser, 7) && (strpos($attachment['mimetype'], 'image') !== 0))
- {
- header('X-Download-Options: noopen');
- }
- }
- }
-
- // Close the db connection before sending the file
- $db->sql_close();
-
- if (!set_modified_headers($attachment['filetime'], $user->browser))
- {
- // Send Content-Length only if set_modified_headers() does not send
- // status 304 - Not Modified
- if ($size)
- {
- header("Content-Length: $size");
- }
-
- // Try to deliver in chunks
- @set_time_limit(0);
-
- $fp = @fopen($filename, 'rb');
-
- if ($fp !== false)
- {
- while (!feof($fp))
- {
- echo fread($fp, 8192);
- }
- fclose($fp);
- }
- else
- {
- @readfile($filename);
- }
-
- flush();
- }
- file_gc();
-}
-
-/**
-* Get a browser friendly UTF-8 encoded filename
-*/
-function header_filename($file)
-{
- $user_agent = (!empty($_SERVER['HTTP_USER_AGENT'])) ? htmlspecialchars((string) $_SERVER['HTTP_USER_AGENT']) : '';
-
- // There be dragons here.
- // Not many follows the RFC...
- if (strpos($user_agent, 'MSIE') !== false || strpos($user_agent, 'Safari') !== false || strpos($user_agent, 'Konqueror') !== false)
+ if ($thumbnail)
{
- return "filename=" . rawurlencode($file);
+ $attachment['physical_filename'] = 'thumb_' . $attachment['physical_filename'];
}
-
- // follow the RFC for extended filename for the rest
- return "filename*=UTF-8''" . rawurlencode($file);
-}
-
-/**
-* Check if downloading item is allowed
-*/
-function download_allowed()
-{
- global $config, $user, $db;
-
- if (!$config['secure_downloads'])
+ else if ($display_cat == ATTACHMENT_CATEGORY_NONE && !$attachment['is_orphan'] && !phpbb_http_byte_range($attachment['filesize']))
{
- return true;
+ // Update download count
+ phpbb_increment_downloads($db, $attachment['attach_id']);
}
- $url = (!empty($_SERVER['HTTP_REFERER'])) ? trim($_SERVER['HTTP_REFERER']) : trim(getenv('HTTP_REFERER'));
-
- if (!$url)
+ if ($display_cat == ATTACHMENT_CATEGORY_IMAGE && $mode === 'view' && (strpos($attachment['mimetype'], 'image') === 0) && (strpos(strtolower($user->browser), 'msie') !== false) && !phpbb_is_greater_ie_version($user->browser, 7))
{
- return ($config['secure_allow_empty_referer']) ? true : false;
- }
-
- // Split URL into domain and script part
- $url = @parse_url($url);
-
- if ($url === false)
- {
- return ($config['secure_allow_empty_referer']) ? true : false;
+ wrap_img_in_html(append_sid($phpbb_root_path . 'download/file.' . $phpEx, 'id=' . $attachment['attach_id']), $attachment['real_filename']);
+ file_gc();
}
-
- $hostname = $url['host'];
- unset($url);
-
- $allowed = ($config['secure_allow_deny']) ? false : true;
- $iplist = array();
-
- if (($ip_ary = @gethostbynamel($hostname)) !== false)
+ else
{
- foreach ($ip_ary as $ip)
+ // Determine the 'presenting'-method
+ if ($download_mode == PHYSICAL_LINK)
{
- if ($ip)
+ // This presenting method should no longer be used
+ if (!@is_dir($phpbb_root_path . $config['upload_path']))
{
- $iplist[] = $ip;
+ send_status_line(500, 'Internal Server Error');
+ trigger_error($user->lang['PHYSICAL_DOWNLOAD_NOT_POSSIBLE']);
}
- }
- }
-
- // Check for own server...
- $server_name = $user->host;
-
- // Forcing server vars is the only way to specify/override the protocol
- if ($config['force_server_vars'] || !$server_name)
- {
- $server_name = $config['server_name'];
- }
-
- if (preg_match('#^.*?' . preg_quote($server_name, '#') . '.*?$#i', $hostname))
- {
- $allowed = true;
- }
-
- // Get IP's and Hostnames
- if (!$allowed)
- {
- $sql = 'SELECT site_ip, site_hostname, ip_exclude
- FROM ' . SITELIST_TABLE;
- $result = $db->sql_query($sql);
- while ($row = $db->sql_fetchrow($result))
- {
- $site_ip = trim($row['site_ip']);
- $site_hostname = trim($row['site_hostname']);
-
- if ($site_ip)
- {
- foreach ($iplist as $ip)
- {
- if (preg_match('#^' . str_replace('\*', '.*?', preg_quote($site_ip, '#')) . '$#i', $ip))
- {
- if ($row['ip_exclude'])
- {
- $allowed = ($config['secure_allow_deny']) ? false : true;
- break 2;
- }
- else
- {
- $allowed = ($config['secure_allow_deny']) ? true : false;
- }
- }
- }
- }
-
- if ($site_hostname)
- {
- if (preg_match('#^' . str_replace('\*', '.*?', preg_quote($site_hostname, '#')) . '$#i', $hostname))
- {
- if ($row['ip_exclude'])
- {
- $allowed = ($config['secure_allow_deny']) ? false : true;
- break;
- }
- else
- {
- $allowed = ($config['secure_allow_deny']) ? true : false;
- }
- }
- }
- }
- $db->sql_freeresult($result);
- }
-
- return $allowed;
-}
-
-/**
-* Check if the browser has the file already and set the appropriate headers-
-* @returns false if a resend is in order.
-*/
-function set_modified_headers($stamp, $browser)
-{
- // let's see if we have to send the file at all
- $last_load = isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) ? strtotime(trim($_SERVER['HTTP_IF_MODIFIED_SINCE'])) : false;
-
- if (strpos(strtolower($browser), 'msie 6.0') === false && !phpbb_is_greater_ie_version($browser, 7))
- {
- if ($last_load !== false && $last_load >= $stamp)
- {
- send_status_line(304, 'Not Modified');
- // seems that we need those too ... browsers
- header('Pragma: public');
- header('Expires: ' . gmdate('D, d M Y H:i:s \G\M\T', time() + 31536000));
- return true;
+ redirect($phpbb_root_path . $config['upload_path'] . '/' . $attachment['physical_filename']);
+ file_gc();
}
else
{
- header('Last-Modified: ' . gmdate('D, d M Y H:i:s', $stamp) . ' GMT');
+ send_file_to_browser($attachment, $config['upload_path'], $display_cat);
+ file_gc();
}
}
- return false;
-}
-
-function file_gc()
-{
- global $cache, $db;
- if (!empty($cache))
- {
- $cache->unload();
- }
- $db->sql_close();
- exit;
-}
-
-/**
-* Check if the browser is internet explorer version 7+
-*
-* @param string $user_agent User agent HTTP header
-* @param int $version IE version to check against
-*
-* @return bool true if internet explorer version is greater than $version
-*/
-function phpbb_is_greater_ie_version($user_agent, $version)
-{
- if (preg_match('/msie (\d+)/', strtolower($user_agent), $matches))
- {
- $ie_version = (int) $matches[1];
- return ($ie_version > $version);
- }
- else
- {
- return false;
- }
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/auth/index.htm b/phpBB/ext/index.htm
index ee1f723a7d..ee1f723a7d 100644
--- a/phpBB/includes/auth/index.htm
+++ b/phpBB/ext/index.htm
diff --git a/phpBB/faq.php b/phpBB/faq.php
index 0a04bad8eb..cf34ce809a 100644
--- a/phpBB/faq.php
+++ b/phpBB/faq.php
@@ -1,10 +1,13 @@
<?php
/**
*
-* @package phpBB3
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -22,6 +25,7 @@ $auth->acl($user->data);
$user->setup();
$mode = request_var('mode', '');
+$template_file = 'faq_body.html';
// Load the appropriate faq file
switch ($mode)
@@ -32,8 +36,33 @@ switch ($mode)
break;
default:
- $l_title = $user->lang['FAQ_EXPLAIN'];
- $user->add_lang('faq', false, true);
+ $page_title = $user->lang['FAQ_EXPLAIN'];
+ $ext_name = $lang_file = '';
+
+ /**
+ * You can use this event display a custom help page
+ *
+ * @event core.faq_mode_validation
+ * @var string page_title Title of the page
+ * @var string mode FAQ that is going to be displayed
+ * @var string lang_file Language file containing the help data
+ * @var string ext_name Vendor and extension name where the help
+ * language file can be loaded from
+ * @var string template_file Template file name
+ * @since 3.1.4-RC1
+ * @changed 3.1.11-RC1 Added template_file var
+ */
+ $vars = array(
+ 'page_title',
+ 'mode',
+ 'lang_file',
+ 'ext_name',
+ 'template_file',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.faq_mode_validation', compact($vars)));
+
+ $l_title = $page_title;
+ $user->add_lang(($lang_file) ? $lang_file : 'faq', false, true, $ext_name);
break;
}
@@ -75,15 +104,14 @@ $template->assign_vars(array(
'L_BACK_TO_TOP' => $user->lang['BACK_TO_TOP'],
'SWITCH_COLUMN_MANUALLY' => (!$found_switch) ? true : false,
+ 'S_IN_FAQ' => true,
));
-page_header($l_title, false);
+page_header($l_title);
$template->set_filenames(array(
- 'body' => 'faq_body.html')
+ 'body' => $template_file)
);
make_jumpbox(append_sid("{$phpbb_root_path}viewforum.$phpEx"));
page_footer();
-
-?> \ No newline at end of file
diff --git a/phpBB/feed.php b/phpBB/feed.php
index 7e1a761694..6fd0ed800f 100644
--- a/phpBB/feed.php
+++ b/phpBB/feed.php
@@ -1,9 +1,13 @@
<?php
/**
-* @package phpBB3
-* @version $Id$
-* @copyright (c) 2009 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
* Idea and original RSS Feed 2.0 MOD (Version 1.0.8/9) by leviatan21
* Original MOD: http://www.phpbb.com/community/viewtopic.php?f=69&t=1214645
@@ -19,6 +23,7 @@ define('IN_PHPBB', true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);
+include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
if (!$config['feed_enable'])
{
@@ -37,7 +42,7 @@ if (!empty($config['feed_http_auth']) && request_var('auth', '') == 'http')
}
$auth->acl($user->data);
-$user->setup();
+$user->setup('viewtopic');
// Initial var setup
$forum_id = request_var('f', 0);
@@ -60,10 +65,12 @@ if ($forum_id || $topic_id || $mode)
}
// This boards URL
-$board_url = generate_board_url();
+$phpbb_feed_helper = $phpbb_container->get('feed.helper');
+$board_url = $phpbb_feed_helper->get_board_url();
// Get correct feed object
-$feed = phpbb_feed_factory::init($mode, $forum_id, $topic_id);
+$phpbb_feed_factory = $phpbb_container->get('feed.factory');
+$feed = $phpbb_feed_factory->get_feed($mode, $forum_id, $topic_id);
// No feed found
if ($feed === false)
@@ -77,6 +84,20 @@ $feed->open();
// Iterate through items
while ($row = $feed->get_item())
{
+ /**
+ * Event to modify the feed row
+ *
+ * @event core.feed_modify_feed_row
+ * @var int forum_id Forum ID
+ * @var string mode Feeds mode (forums|topics|topics_new|topics_active|news)
+ * @var array row Array with feed data
+ * @var int topic_id Topic ID
+ *
+ * @since 3.1.10-RC1
+ */
+ $vars = array('forum_id', 'mode', 'row', 'topic_id');
+ extract($phpbb_dispatcher->trigger_event('core.feed_modify_feed_row', compact($vars)));
+
// BBCode options to correctly disable urls, smilies, bbcode...
if ($feed->get('options') === NULL)
{
@@ -98,15 +119,17 @@ while ($row = $feed->get_item())
$published = ($feed->get('published') !== NULL) ? (int) $row[$feed->get('published')] : 0;
$updated = ($feed->get('updated') !== NULL) ? (int) $row[$feed->get('updated')] : 0;
+ $display_attachments = ($auth->acl_get('u_download') && $auth->acl_get('f_download', $row['forum_id']) && isset($row['post_attachment']) && $row['post_attachment']) ? true : false;
+
$item_row = array(
'author' => ($feed->get('creator') !== NULL) ? $row[$feed->get('creator')] : '',
- 'published' => ($published > 0) ? feed_format_date($published) : '',
- 'updated' => ($updated > 0) ? feed_format_date($updated) : '',
+ 'published' => ($published > 0) ? $phpbb_feed_helper->format_date($published) : '',
+ 'updated' => ($updated > 0) ? $phpbb_feed_helper->format_date($updated) : '',
'link' => '',
'title' => censor_text($title),
'category' => ($config['feed_item_statistics'] && !empty($row['forum_id'])) ? $board_url . '/viewforum.' . $phpEx . '?f=' . $row['forum_id'] : '',
'category_name' => ($config['feed_item_statistics'] && isset($row['forum_name'])) ? $row['forum_name'] : '',
- 'description' => censor_text(feed_generate_content($row[$feed->get('text')], $row[$feed->get('bbcode_uid')], $row[$feed->get('bitfield')], $options)),
+ 'description' => censor_text($phpbb_feed_helper->generate_content($row[$feed->get('text')], $row[$feed->get('bbcode_uid')], $row[$feed->get('bitfield')], $options, $row['forum_id'], ($display_attachments ? $feed->get_attachments($row['post_id']) : array()))),
'statistics' => '',
);
@@ -127,12 +150,12 @@ if (!$feed_updated_time)
// Some default assignments
// FEED_IMAGE is not used (atom)
$global_vars = array_merge($global_vars, array(
- 'FEED_IMAGE' => ($user->img('site_logo', '', false, '', 'src')) ? $board_url . '/' . substr($user->img('site_logo', '', false, '', 'src'), strlen($phpbb_root_path)) : '',
- 'SELF_LINK' => feed_append_sid('/feed.' . $phpEx, $params),
+ 'FEED_IMAGE' => '',
+ 'SELF_LINK' => $phpbb_feed_helper->append_sid('feed.' . $phpEx, $params),
'FEED_LINK' => $board_url . '/index.' . $phpEx,
'FEED_TITLE' => $config['sitename'],
'FEED_SUBTITLE' => $config['site_desc'],
- 'FEED_UPDATED' => feed_format_date($feed_updated_time),
+ 'FEED_UPDATED' => $phpbb_feed_helper->format_date($feed_updated_time),
'FEED_LANG' => $user->lang['USER_LANG'],
'FEED_AUTHOR' => $config['sitename'],
));
@@ -151,12 +174,11 @@ if ($config['gzip_compress'])
}
// IF debug extra is enabled and admin want to "explain" the page we need to set other headers...
-if (defined('DEBUG_EXTRA') && request_var('explain', 0) && $auth->acl_get('a_'))
+if (defined('DEBUG') && request_var('explain', 0) && $auth->acl_get('a_'))
{
header('Content-type: text/html; charset=UTF-8');
header('Cache-Control: private, no-cache="set-cookie"');
- header('Expires: 0');
- header('Pragma: no-cache');
+ header('Expires: ' . gmdate('D, d M Y H:i:s', time()) . ' GMT');
$mtime = explode(' ', microtime());
$totaltime = $mtime[0] + $mtime[1] - $starttime;
@@ -232,1258 +254,3 @@ echo '</feed>';
garbage_collection();
exit_handler();
-
-/**
-* Run links through append_sid(), prepend generate_board_url() and remove session id
-**/
-function feed_append_sid($url, $params)
-{
- global $board_url;
-
- return append_sid($board_url . $url, $params, true, '');
-}
-
-/**
-* Generate ISO 8601 date string (RFC 3339)
-**/
-function feed_format_date($time)
-{
- static $zone_offset;
- static $offset_string;
-
- if (empty($offset_string))
- {
- global $user;
-
- $zone_offset = (int) $user->timezone + (int) $user->dst;
-
- $sign = ($zone_offset < 0) ? '-' : '+';
- $time_offset = abs($zone_offset);
-
- $offset_seconds = $time_offset % 3600;
- $offset_minutes = $offset_seconds / 60;
- $offset_hours = ($time_offset - $offset_seconds) / 3600;
-
- $offset_string = sprintf("%s%02d:%02d", $sign, $offset_hours, $offset_minutes);
- }
-
- return gmdate("Y-m-d\TH:i:s", $time + $zone_offset) . $offset_string;
-}
-
-/**
-* Generate text content
-**/
-function feed_generate_content($content, $uid, $bitfield, $options)
-{
- global $user, $config, $phpbb_root_path, $phpEx, $board_url;
-
- if (empty($content))
- {
- return '';
- }
-
- // Prepare some bbcodes for better parsing
- $content = preg_replace("#\[quote(=&quot;.*?&quot;)?:$uid\]\s*(.*?)\s*\[/quote:$uid\]#si", "[quote$1:$uid]<br />$2<br />[/quote:$uid]", $content);
-
- $content = generate_text_for_display($content, $uid, $bitfield, $options);
-
- // Add newlines
- $content = str_replace('<br />', '<br />' . "\n", $content);
-
- // Convert smiley Relative paths to Absolute path, Windows style
- $content = str_replace($phpbb_root_path . $config['smilies_path'], $board_url . '/' . $config['smilies_path'], $content);
-
- // Remove "Select all" link and mouse events
- $content = str_replace('<a href="#" onclick="selectCode(this); return false;">' . $user->lang['SELECT_ALL_CODE'] . '</a>', '', $content);
- $content = preg_replace('#(onkeypress|onclick)="(.*?)"#si', '', $content);
-
- // Firefox does not support CSS for feeds, though
-
- // Remove font sizes
-// $content = preg_replace('#<span style="font-size: [0-9]+%; line-height: [0-9]+%;">([^>]+)</span>#iU', '\1', $content);
-
- // Make text strong :P
-// $content = preg_replace('#<span style="font-weight: bold?">(.*?)</span>#iU', '<strong>\1</strong>', $content);
-
- // Italic
-// $content = preg_replace('#<span style="font-style: italic?">([^<]+)</span>#iU', '<em>\1</em>', $content);
-
- // Underline
-// $content = preg_replace('#<span style="text-decoration: underline?">([^<]+)</span>#iU', '<u>\1</u>', $content);
-
- // Remove embed Windows Media Streams
- $content = preg_replace( '#<\!--\[if \!IE\]>-->([^[]+)<\!--<!\[endif\]-->#si', '', $content);
-
- // Do not use &lt; and &gt;, because we want to retain code contained in [code][/code]
-
- // Remove embed and objects
- $content = preg_replace( '#<(object|embed)(.*?) (value|src)=(.*?) ([^[]+)(object|embed)>#si',' <a href=$4 target="_blank"><strong>$1</strong></a> ',$content);
-
- // Remove some specials html tag, because somewhere there are a mod to allow html tags ;)
- $content = preg_replace( '#<(script|iframe)([^[]+)\1>#siU', ' <strong>$1</strong> ', $content);
-
- // Remove Comments from inline attachments [ia]
- $content = preg_replace('#<div class="(inline-attachment|attachtitle)">(.*?)<!-- ia(.*?) -->(.*?)<!-- ia(.*?) -->(.*?)</div>#si','$4',$content);
-
- // Replace some entities with their unicode counterpart
- $entities = array(
- '&nbsp;' => "\xC2\xA0",
- '&bull;' => "\xE2\x80\xA2",
- '&middot;' => "\xC2\xB7",
- '&copy;' => "\xC2\xA9",
- );
-
- $content = str_replace(array_keys($entities), array_values($entities), $content);
-
- // Remove CDATA blocks. ;)
- $content = preg_replace('#\<\!\[CDATA\[(.*?)\]\]\>#s', '', $content);
-
- // Other control characters
- $content = preg_replace('#(?:[\x00-\x1F\x7F]+|(?:\xC2[\x80-\x9F])+)#', '', $content);
-
- return $content;
-}
-
-/**
-* Factory class to return correct object
-* @package phpBB3
-*/
-class phpbb_feed_factory
-{
- /**
- * Return correct object for specified mode
- *
- * @param string $mode The feeds mode.
- * @param int $forum_id Forum id specified by the script if forum feed provided.
- * @param int $topic_id Topic id specified by the script if topic feed provided.
- *
- * @return object Returns correct feeds object for specified mode.
- */
- function init($mode, $forum_id, $topic_id)
- {
- global $config;
-
- switch ($mode)
- {
- case 'forums':
- if (!$config['feed_overall_forums'])
- {
- return false;
- }
-
- return new phpbb_feed_forums();
- break;
-
- case 'topics':
- case 'topics_new':
- if (!$config['feed_topics_new'])
- {
- return false;
- }
-
- return new phpbb_feed_topics();
- break;
-
- case 'topics_active':
- if (!$config['feed_topics_active'])
- {
- return false;
- }
-
- return new phpbb_feed_topics_active();
- break;
-
- case 'news':
- global $db;
-
- // Get at least one news forum
- $sql = 'SELECT forum_id
- FROM ' . FORUMS_TABLE . '
- WHERE ' . $db->sql_bit_and('forum_options', FORUM_OPTION_FEED_NEWS, '<> 0');
- $result = $db->sql_query_limit($sql, 1, 0, 600);
- $s_feed_news = (int) $db->sql_fetchfield('forum_id');
- $db->sql_freeresult($result);
-
- if (!$s_feed_news)
- {
- return false;
- }
-
- return new phpbb_feed_news();
- break;
-
- default:
- if ($topic_id && $config['feed_topic'])
- {
- return new phpbb_feed_topic($topic_id);
- }
- else if ($forum_id && $config['feed_forum'])
- {
- return new phpbb_feed_forum($forum_id);
- }
- else if ($config['feed_overall'])
- {
- return new phpbb_feed_overall();
- }
-
- return false;
- break;
- }
- }
-}
-
-/**
-* Base class with some generic functions and settings.
-*
-* @package phpBB3
-*/
-class phpbb_feed_base
-{
- /**
- * SQL Query to be executed to get feed items
- */
- var $sql = array();
-
- /**
- * Keys specified for retrieval of title, content, etc.
- */
- var $keys = array();
-
- /**
- * Number of items to fetch. Usually overwritten by $config['feed_something']
- */
- var $num_items = 15;
-
- /**
- * Separator for title elements to separate items (for example forum / topic)
- */
- var $separator = "\xE2\x80\xA2"; // &bull;
-
- /**
- * Separator for the statistics row (Posted by, post date, replies, etc.)
- */
- var $separator_stats = "\xE2\x80\x94"; // &mdash;
-
- /** @var mixed Query result handle */
- var $result;
-
- /**
- * Constructor
- */
- function phpbb_feed_base()
- {
- global $config;
-
- $this->set_keys();
-
- // Allow num_items to be string
- if (is_string($this->num_items))
- {
- $this->num_items = (int) $config[$this->num_items];
-
- // A precaution
- if (!$this->num_items)
- {
- $this->num_items = 10;
- }
- }
- }
-
- /**
- * Set keys.
- */
- function set_keys()
- {
- }
-
- /**
- * Open feed
- */
- function open()
- {
- }
-
- /**
- * Close feed
- */
- function close()
- {
- global $db;
-
- if (!empty($this->result))
- {
- $db->sql_freeresult($this->result);
- }
- }
-
- /**
- * Set key
- */
- function set($key, $value)
- {
- $this->keys[$key] = $value;
- }
-
- /**
- * Get key
- */
- function get($key)
- {
- return (isset($this->keys[$key])) ? $this->keys[$key] : NULL;
- }
-
- function get_readable_forums()
- {
- global $auth;
- static $forum_ids;
-
- if (!isset($forum_ids))
- {
- $forum_ids = array_keys($auth->acl_getf('f_read', true));
- }
-
- return $forum_ids;
- }
-
- function get_moderator_approve_forums()
- {
- global $auth;
- static $forum_ids;
-
- if (!isset($forum_ids))
- {
- $forum_ids = array_keys($auth->acl_getf('m_approve', true));
- }
-
- return $forum_ids;
- }
-
- function is_moderator_approve_forum($forum_id)
- {
- static $forum_ids;
-
- if (!isset($forum_ids))
- {
- $forum_ids = array_flip($this->get_moderator_approve_forums());
- }
-
- if (!$forum_id)
- {
- // Global announcement, your a moderator in any forum than it's okay.
- return (!empty($forum_ids)) ? true : false;
- }
-
- return (isset($forum_ids[$forum_id])) ? true : false;
- }
-
- function get_excluded_forums()
- {
- global $db, $cache;
- static $forum_ids;
-
- // Matches acp/acp_board.php
- $cache_name = 'feed_excluded_forum_ids';
-
- if (!isset($forum_ids) && ($forum_ids = $cache->get('_' . $cache_name)) === false)
- {
- $sql = 'SELECT forum_id
- FROM ' . FORUMS_TABLE . '
- WHERE ' . $db->sql_bit_and('forum_options', FORUM_OPTION_FEED_EXCLUDE, '<> 0');
- $result = $db->sql_query($sql);
-
- $forum_ids = array();
- while ($forum_id = (int) $db->sql_fetchfield('forum_id'))
- {
- $forum_ids[$forum_id] = $forum_id;
- }
- $db->sql_freeresult($result);
-
- $cache->put('_' . $cache_name, $forum_ids);
- }
-
- return $forum_ids;
- }
-
- function is_excluded_forum($forum_id)
- {
- $forum_ids = $this->get_excluded_forums();
-
- return isset($forum_ids[$forum_id]) ? true : false;
- }
-
- function get_passworded_forums()
- {
- global $user;
-
- return $user->get_passworded_forums();
- }
-
- function get_item()
- {
- global $db;
-
- if (!isset($this->result))
- {
- if (!$this->get_sql())
- {
- return false;
- }
-
- // Query database
- $sql = $db->sql_build_query('SELECT', $this->sql);
- $this->result = $db->sql_query_limit($sql, $this->num_items);
- }
-
- return $db->sql_fetchrow($this->result);
- }
-
- function user_viewprofile($row)
- {
- global $phpEx, $user;
-
- $author_id = (int) $row[$this->get('author_id')];
-
- if ($author_id == ANONYMOUS)
- {
- // Since we cannot link to a profile, we just return GUEST
- // instead of $row['username']
- return $user->lang['GUEST'];
- }
-
- return '<a href="' . feed_append_sid('/memberlist.' . $phpEx, 'mode=viewprofile&amp;u=' . $author_id) . '">' . $row[$this->get('creator')] . '</a>';
- }
-}
-
-/**
-* Abstract class for post based feeds
-*
-* @package phpBB3
-*/
-class phpbb_feed_post_base extends phpbb_feed_base
-{
- var $num_items = 'feed_limit_post';
-
- function set_keys()
- {
- $this->set('title', 'post_subject');
- $this->set('title2', 'topic_title');
-
- $this->set('author_id', 'user_id');
- $this->set('creator', 'username');
- $this->set('published', 'post_time');
- $this->set('updated', 'post_edit_time');
- $this->set('text', 'post_text');
-
- $this->set('bitfield', 'bbcode_bitfield');
- $this->set('bbcode_uid','bbcode_uid');
-
- $this->set('enable_bbcode', 'enable_bbcode');
- $this->set('enable_smilies', 'enable_smilies');
- $this->set('enable_magic_url', 'enable_magic_url');
- }
-
- function adjust_item(&$item_row, &$row)
- {
- global $phpEx, $config, $user;
-
- $item_row['link'] = feed_append_sid('/viewtopic.' . $phpEx, "t={$row['topic_id']}&amp;p={$row['post_id']}#p{$row['post_id']}");
-
- if ($config['feed_item_statistics'])
- {
- $item_row['statistics'] = $user->lang['POSTED'] . ' ' . $user->lang['POST_BY_AUTHOR'] . ' ' . $this->user_viewprofile($row)
- . ' ' . $this->separator_stats . ' ' . $user->format_date($row[$this->get('published')])
- . (($this->is_moderator_approve_forum($row['forum_id']) && !$row['post_approved']) ? ' ' . $this->separator_stats . ' ' . $user->lang['POST_UNAPPROVED'] : '');
- }
- }
-}
-
-/**
-* Abstract class for topic based feeds
-*
-* @package phpBB3
-*/
-class phpbb_feed_topic_base extends phpbb_feed_base
-{
- var $num_items = 'feed_limit_topic';
-
- function set_keys()
- {
- $this->set('title', 'topic_title');
- $this->set('title2', 'forum_name');
-
- $this->set('author_id', 'topic_poster');
- $this->set('creator', 'topic_first_poster_name');
- $this->set('published', 'post_time');
- $this->set('updated', 'post_edit_time');
- $this->set('text', 'post_text');
-
- $this->set('bitfield', 'bbcode_bitfield');
- $this->set('bbcode_uid','bbcode_uid');
-
- $this->set('enable_bbcode', 'enable_bbcode');
- $this->set('enable_smilies', 'enable_smilies');
- $this->set('enable_magic_url', 'enable_magic_url');
- }
-
- function adjust_item(&$item_row, &$row)
- {
- global $phpEx, $config, $user;
-
- $item_row['link'] = feed_append_sid('/viewtopic.' . $phpEx, 't=' . $row['topic_id'] . '&amp;p=' . $row['post_id'] . '#p' . $row['post_id']);
-
- if ($config['feed_item_statistics'])
- {
- $item_row['statistics'] = $user->lang['POSTED'] . ' ' . $user->lang['POST_BY_AUTHOR'] . ' ' . $this->user_viewprofile($row)
- . ' ' . $this->separator_stats . ' ' . $user->format_date($row[$this->get('published')])
- . ' ' . $this->separator_stats . ' ' . $user->lang['REPLIES'] . ' ' . (($this->is_moderator_approve_forum($row['forum_id'])) ? $row['topic_replies_real'] : $row['topic_replies'])
- . ' ' . $this->separator_stats . ' ' . $user->lang['VIEWS'] . ' ' . $row['topic_views']
- . (($this->is_moderator_approve_forum($row['forum_id']) && ($row['topic_replies_real'] != $row['topic_replies'])) ? ' ' . $this->separator_stats . ' ' . $user->lang['POSTS_UNAPPROVED'] : '');
- }
- }
-}
-
-/**
-* Board wide feed (aka overall feed)
-*
-* This will give you the newest {$this->num_items} posts
-* from the whole board.
-*
-* @package phpBB3
-*/
-class phpbb_feed_overall extends phpbb_feed_post_base
-{
- function get_sql()
- {
- global $auth, $db;
-
- $forum_ids = array_diff($this->get_readable_forums(), $this->get_excluded_forums(), $this->get_passworded_forums());
- if (empty($forum_ids))
- {
- return false;
- }
-
- // Add global forum id
- $forum_ids[] = 0;
-
- // m_approve forums
- $fid_m_approve = $this->get_moderator_approve_forums();
- $sql_m_approve = (!empty($fid_m_approve)) ? 'OR ' . $db->sql_in_set('forum_id', $fid_m_approve) : '';
-
- // Determine topics with recent activity
- $sql = 'SELECT topic_id, topic_last_post_time
- FROM ' . TOPICS_TABLE . '
- WHERE ' . $db->sql_in_set('forum_id', $forum_ids) . '
- AND topic_moved_id = 0
- AND (topic_approved = 1
- ' . $sql_m_approve . ')
- ORDER BY topic_last_post_time DESC';
- $result = $db->sql_query_limit($sql, $this->num_items);
-
- $topic_ids = array();
- $min_post_time = 0;
- while ($row = $db->sql_fetchrow())
- {
- $topic_ids[] = (int) $row['topic_id'];
-
- $min_post_time = (int) $row['topic_last_post_time'];
- }
- $db->sql_freeresult($result);
-
- if (empty($topic_ids))
- {
- return false;
- }
-
- // Get the actual data
- $this->sql = array(
- 'SELECT' => 'f.forum_id, f.forum_name, ' .
- 'p.post_id, p.topic_id, p.post_time, p.post_edit_time, p.post_approved, p.post_subject, p.post_text, p.bbcode_bitfield, p.bbcode_uid, p.enable_bbcode, p.enable_smilies, p.enable_magic_url, ' .
- 'u.username, u.user_id',
- 'FROM' => array(
- USERS_TABLE => 'u',
- POSTS_TABLE => 'p',
- ),
- 'LEFT_JOIN' => array(
- array(
- 'FROM' => array(FORUMS_TABLE => 'f'),
- 'ON' => 'f.forum_id = p.forum_id',
- ),
- ),
- 'WHERE' => $db->sql_in_set('p.topic_id', $topic_ids) . '
- AND (p.post_approved = 1
- ' . str_replace('forum_id', 'p.forum_id', $sql_m_approve) . ')
- AND p.post_time >= ' . $min_post_time . '
- AND u.user_id = p.poster_id',
- 'ORDER_BY' => 'p.post_time DESC',
- );
-
- return true;
- }
-
- function adjust_item(&$item_row, &$row)
- {
- parent::adjust_item($item_row, $row);
-
- $item_row['title'] = (isset($row['forum_name']) && $row['forum_name'] !== '') ? $row['forum_name'] . ' ' . $this->separator . ' ' . $item_row['title'] : $item_row['title'];
- }
-}
-
-/**
-* Forum feed
-*
-* This will give you the last {$this->num_items} posts made
-* within a specific forum.
-*
-* @package phpBB3
-*/
-class phpbb_feed_forum extends phpbb_feed_post_base
-{
- var $forum_id = 0;
- var $forum_data = array();
-
- function phpbb_feed_forum($forum_id)
- {
- parent::phpbb_feed_base();
-
- $this->forum_id = (int) $forum_id;
- }
-
- function open()
- {
- global $db, $auth;
-
- // Check if forum exists
- $sql = 'SELECT forum_id, forum_name, forum_password, forum_type, forum_options
- FROM ' . FORUMS_TABLE . '
- WHERE forum_id = ' . $this->forum_id;
- $result = $db->sql_query($sql);
- $this->forum_data = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
-
- if (empty($this->forum_data))
- {
- trigger_error('NO_FORUM');
- }
-
- // Forum needs to be postable
- if ($this->forum_data['forum_type'] != FORUM_POST)
- {
- trigger_error('NO_FEED');
- }
-
- // Make sure forum is not excluded from feed
- if (phpbb_optionget(FORUM_OPTION_FEED_EXCLUDE, $this->forum_data['forum_options']))
- {
- trigger_error('NO_FEED');
- }
-
- // Make sure we can read this forum
- if (!$auth->acl_get('f_read', $this->forum_id))
- {
- trigger_error('SORRY_AUTH_READ');
- }
-
- // Make sure forum is not passworded or user is authed
- if ($this->forum_data['forum_password'])
- {
- $forum_ids_passworded = $this->get_passworded_forums();
-
- if (isset($forum_ids_passworded[$this->forum_id]))
- {
- trigger_error('SORRY_AUTH_READ');
- }
-
- unset($forum_ids_passworded);
- }
- }
-
- function get_sql()
- {
- global $auth, $db;
-
- $m_approve = ($auth->acl_get('m_approve', $this->forum_id)) ? true : false;
- $forum_ids = array(0, $this->forum_id);
-
- // Determine topics with recent activity
- $sql = 'SELECT topic_id, topic_last_post_time
- FROM ' . TOPICS_TABLE . '
- WHERE ' . $db->sql_in_set('forum_id', $forum_ids) . '
- AND topic_moved_id = 0
- ' . ((!$m_approve) ? 'AND topic_approved = 1' : '') . '
- ORDER BY topic_last_post_time DESC';
- $result = $db->sql_query_limit($sql, $this->num_items);
-
- $topic_ids = array();
- $min_post_time = 0;
- while ($row = $db->sql_fetchrow())
- {
- $topic_ids[] = (int) $row['topic_id'];
-
- $min_post_time = (int) $row['topic_last_post_time'];
- }
- $db->sql_freeresult($result);
-
- if (empty($topic_ids))
- {
- return false;
- }
-
- $this->sql = array(
- 'SELECT' => 'p.post_id, p.topic_id, p.post_time, p.post_edit_time, p.post_approved, p.post_subject, p.post_text, p.bbcode_bitfield, p.bbcode_uid, p.enable_bbcode, p.enable_smilies, p.enable_magic_url, ' .
- 'u.username, u.user_id',
- 'FROM' => array(
- POSTS_TABLE => 'p',
- USERS_TABLE => 'u',
- ),
- 'WHERE' => $db->sql_in_set('p.topic_id', $topic_ids) . '
- ' . ((!$m_approve) ? 'AND p.post_approved = 1' : '') . '
- AND p.post_time >= ' . $min_post_time . '
- AND p.poster_id = u.user_id',
- 'ORDER_BY' => 'p.post_time DESC',
- );
-
- return true;
- }
-
- function adjust_item(&$item_row, &$row)
- {
- parent::adjust_item($item_row, $row);
-
- $item_row['title'] = (isset($row['forum_name']) && $row['forum_name'] !== '') ? $row['forum_name'] . ' ' . $this->separator . ' ' . $item_row['title'] : $item_row['title'];
- }
-
- function get_item()
- {
- return ($row = parent::get_item()) ? array_merge($this->forum_data, $row) : $row;
- }
-}
-
-/**
-* Topic feed for a specific topic
-*
-* This will give you the last {$this->num_items} posts made within this topic.
-*
-* @package phpBB3
-*/
-class phpbb_feed_topic extends phpbb_feed_post_base
-{
- var $topic_id = 0;
- var $forum_id = 0;
- var $topic_data = array();
-
- function phpbb_feed_topic($topic_id)
- {
- parent::phpbb_feed_base();
-
- $this->topic_id = (int) $topic_id;
- }
-
- function open()
- {
- global $auth, $db, $user;
-
- $sql = 'SELECT f.forum_options, f.forum_password, t.topic_id, t.forum_id, t.topic_approved, t.topic_title, t.topic_time, t.topic_views, t.topic_replies, t.topic_type
- FROM ' . TOPICS_TABLE . ' t
- LEFT JOIN ' . FORUMS_TABLE . ' f
- ON (f.forum_id = t.forum_id)
- WHERE t.topic_id = ' . $this->topic_id;
- $result = $db->sql_query($sql);
- $this->topic_data = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
-
- if (empty($this->topic_data))
- {
- trigger_error('NO_TOPIC');
- }
-
- if ($this->topic_data['topic_type'] == POST_GLOBAL)
- {
- // We need to find at least one postable forum where feeds are enabled,
- // that the user can read and maybe also has approve permissions.
- $in_fid_ary = $this->get_readable_forums();
-
- if (empty($in_fid_ary))
- {
- // User cannot read any forums
- trigger_error('SORRY_AUTH_READ');
- }
-
- if (!$this->topic_data['topic_approved'])
- {
- // Also require m_approve
- $in_fid_ary = array_intersect($in_fid_ary, $this->get_moderator_approve_forums());
-
- if (empty($in_fid_ary))
- {
- trigger_error('SORRY_AUTH_READ');
- }
- }
-
- // Diff excluded forums
- $in_fid_ary = array_diff($in_fid_ary, $this->get_excluded_forums());
-
- if (empty($in_fid_ary))
- {
- trigger_error('SORRY_AUTH_READ');
- }
-
- // Also exclude passworded forums
- $in_fid_ary = array_diff($in_fid_ary, $this->get_passworded_forums());
-
- if (empty($in_fid_ary))
- {
- trigger_error('SORRY_AUTH_READ');
- }
-
- $sql = 'SELECT forum_id, left_id
- FROM ' . FORUMS_TABLE . '
- WHERE forum_type = ' . FORUM_POST . '
- AND ' . $db->sql_in_set('forum_id', $in_fid_ary) . '
- ORDER BY left_id ASC';
- $result = $db->sql_query_limit($sql, 1);
- $this->forum_data = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
-
- if (empty($this->forum_data))
- {
- // No forum found.
- trigger_error('SORRY_AUTH_READ');
- }
-
- unset($in_fid_ary);
- }
- else
- {
- $this->forum_id = (int) $this->topic_data['forum_id'];
-
- // Make sure topic is either approved or user authed
- if (!$this->topic_data['topic_approved'] && !$auth->acl_get('m_approve', $this->forum_id))
- {
- trigger_error('SORRY_AUTH_READ');
- }
-
- // Make sure forum is not excluded from feed
- if (phpbb_optionget(FORUM_OPTION_FEED_EXCLUDE, $this->topic_data['forum_options']))
- {
- trigger_error('NO_FEED');
- }
-
- // Make sure we can read this forum
- if (!$auth->acl_get('f_read', $this->forum_id))
- {
- trigger_error('SORRY_AUTH_READ');
- }
-
- // Make sure forum is not passworded or user is authed
- if ($this->topic_data['forum_password'])
- {
- $forum_ids_passworded = $this->get_passworded_forums();
-
- if (isset($forum_ids_passworded[$this->forum_id]))
- {
- trigger_error('SORRY_AUTH_READ');
- }
-
- unset($forum_ids_passworded);
- }
- }
- }
-
- function get_sql()
- {
- global $auth, $db;
-
- $this->sql = array(
- 'SELECT' => 'p.post_id, p.post_time, p.post_edit_time, p.post_approved, p.post_subject, p.post_text, p.bbcode_bitfield, p.bbcode_uid, p.enable_bbcode, p.enable_smilies, p.enable_magic_url, ' .
- 'u.username, u.user_id',
- 'FROM' => array(
- POSTS_TABLE => 'p',
- USERS_TABLE => 'u',
- ),
- 'WHERE' => 'p.topic_id = ' . $this->topic_id . '
- ' . ($this->forum_id && !$auth->acl_get('m_approve', $this->forum_id) ? 'AND p.post_approved = 1' : '') . '
- AND p.poster_id = u.user_id',
- 'ORDER_BY' => 'p.post_time DESC',
- );
-
- return true;
- }
-
- function get_item()
- {
- return ($row = parent::get_item()) ? array_merge($this->topic_data, $row) : $row;
- }
-}
-
-/**
-* 'All Forums' feed
-*
-* This will give you a list of all postable forums where feeds are enabled
-* including forum description, topic stats and post stats
-*
-* @package phpBB3
-*/
-class phpbb_feed_forums extends phpbb_feed_base
-{
- var $num_items = 0;
-
- function set_keys()
- {
- $this->set('title', 'forum_name');
- $this->set('text', 'forum_desc');
- $this->set('bitfield', 'forum_desc_bitfield');
- $this->set('bbcode_uid','forum_desc_uid');
- $this->set('updated', 'forum_last_post_time');
- $this->set('options', 'forum_desc_options');
- }
-
- function get_sql()
- {
- global $auth, $db;
-
- $in_fid_ary = array_diff($this->get_readable_forums(), $this->get_excluded_forums());
- if (empty($in_fid_ary))
- {
- return false;
- }
-
- // Build SQL Query
- $this->sql = array(
- 'SELECT' => 'f.forum_id, f.left_id, f.forum_name, f.forum_last_post_time,
- f.forum_desc, f.forum_desc_bitfield, f.forum_desc_uid, f.forum_desc_options,
- f.forum_topics, f.forum_posts',
- 'FROM' => array(FORUMS_TABLE => 'f'),
- 'WHERE' => 'f.forum_type = ' . FORUM_POST . '
- AND ' . $db->sql_in_set('f.forum_id', $in_fid_ary),
- 'ORDER_BY' => 'f.left_id ASC',
- );
-
- return true;
- }
-
- function adjust_item(&$item_row, &$row)
- {
- global $phpEx, $config;
-
- $item_row['link'] = feed_append_sid('/viewforum.' . $phpEx, 'f=' . $row['forum_id']);
-
- if ($config['feed_item_statistics'])
- {
- global $user;
-
- $item_row['statistics'] = sprintf($user->lang['TOTAL_TOPICS_OTHER'], $row['forum_topics'])
- . ' ' . $this->separator_stats . ' ' . sprintf($user->lang['TOTAL_POSTS_OTHER'], $row['forum_posts']);
- }
- }
-}
-
-/**
-* News feed
-*
-* This will give you {$this->num_items} first posts
-* of all topics in the selected news forums.
-*
-* @package phpBB3
-*/
-class phpbb_feed_news extends phpbb_feed_topic_base
-{
- function get_news_forums()
- {
- global $db, $cache;
- static $forum_ids;
-
- // Matches acp/acp_board.php
- $cache_name = 'feed_news_forum_ids';
-
- if (!isset($forum_ids) && ($forum_ids = $cache->get('_' . $cache_name)) === false)
- {
- $sql = 'SELECT forum_id
- FROM ' . FORUMS_TABLE . '
- WHERE ' . $db->sql_bit_and('forum_options', FORUM_OPTION_FEED_NEWS, '<> 0');
- $result = $db->sql_query($sql);
-
- $forum_ids = array();
- while ($forum_id = (int) $db->sql_fetchfield('forum_id'))
- {
- $forum_ids[$forum_id] = $forum_id;
- }
- $db->sql_freeresult($result);
-
- $cache->put('_' . $cache_name, $forum_ids);
- }
-
- return $forum_ids;
- }
-
- function get_sql()
- {
- global $auth, $config, $db;
-
- // Determine forum ids
- $in_fid_ary = array_intersect($this->get_news_forums(), $this->get_readable_forums());
- if (empty($in_fid_ary))
- {
- return false;
- }
-
- $in_fid_ary = array_diff($in_fid_ary, $this->get_passworded_forums());
- if (empty($in_fid_ary))
- {
- return false;
- }
-
- // Add global forum
- $in_fid_ary[] = 0;
-
- // We really have to get the post ids first!
- $sql = 'SELECT topic_first_post_id, topic_time
- FROM ' . TOPICS_TABLE . '
- WHERE ' . $db->sql_in_set('forum_id', $in_fid_ary) . '
- AND topic_moved_id = 0
- AND topic_approved = 1
- ORDER BY topic_time DESC';
- $result = $db->sql_query_limit($sql, $this->num_items);
-
- $post_ids = array();
- while ($row = $db->sql_fetchrow($result))
- {
- $post_ids[] = (int) $row['topic_first_post_id'];
- }
- $db->sql_freeresult($result);
-
- if (empty($post_ids))
- {
- return false;
- }
-
- $this->sql = array(
- 'SELECT' => 'f.forum_id, f.forum_name,
- t.topic_id, t.topic_title, t.topic_poster, t.topic_first_poster_name, t.topic_replies, t.topic_replies_real, t.topic_views, t.topic_time, t.topic_last_post_time,
- p.post_id, p.post_time, p.post_edit_time, p.post_text, p.bbcode_bitfield, p.bbcode_uid, p.enable_bbcode, p.enable_smilies, p.enable_magic_url',
- 'FROM' => array(
- TOPICS_TABLE => 't',
- POSTS_TABLE => 'p',
- ),
- 'LEFT_JOIN' => array(
- array(
- 'FROM' => array(FORUMS_TABLE => 'f'),
- 'ON' => 'p.forum_id = f.forum_id',
- ),
- ),
- 'WHERE' => 'p.topic_id = t.topic_id
- AND ' . $db->sql_in_set('p.post_id', $post_ids),
- 'ORDER_BY' => 'p.post_time DESC',
- );
-
- return true;
- }
-}
-
-/**
-* New Topics feed
-*
-* This will give you the last {$this->num_items} created topics
-* including the first post.
-*
-* @package phpBB3
-*/
-class phpbb_feed_topics extends phpbb_feed_topic_base
-{
- function get_sql()
- {
- global $db, $config;
-
- $forum_ids_read = $this->get_readable_forums();
- if (empty($forum_ids_read))
- {
- return false;
- }
-
- $in_fid_ary = array_diff($forum_ids_read, $this->get_excluded_forums(), $this->get_passworded_forums());
- if (empty($in_fid_ary))
- {
- return false;
- }
-
- // Add global forum
- $in_fid_ary[] = 0;
-
- // We really have to get the post ids first!
- $sql = 'SELECT topic_first_post_id, topic_time
- FROM ' . TOPICS_TABLE . '
- WHERE ' . $db->sql_in_set('forum_id', $in_fid_ary) . '
- AND topic_moved_id = 0
- AND topic_approved = 1
- ORDER BY topic_time DESC';
- $result = $db->sql_query_limit($sql, $this->num_items);
-
- $post_ids = array();
- while ($row = $db->sql_fetchrow($result))
- {
- $post_ids[] = (int) $row['topic_first_post_id'];
- }
- $db->sql_freeresult($result);
-
- if (empty($post_ids))
- {
- return false;
- }
-
- $this->sql = array(
- 'SELECT' => 'f.forum_id, f.forum_name,
- t.topic_id, t.topic_title, t.topic_poster, t.topic_first_poster_name, t.topic_replies, t.topic_replies_real, t.topic_views, t.topic_time, t.topic_last_post_time,
- p.post_id, p.post_time, p.post_edit_time, p.post_text, p.bbcode_bitfield, p.bbcode_uid, p.enable_bbcode, p.enable_smilies, p.enable_magic_url',
- 'FROM' => array(
- TOPICS_TABLE => 't',
- POSTS_TABLE => 'p',
- ),
- 'LEFT_JOIN' => array(
- array(
- 'FROM' => array(FORUMS_TABLE => 'f'),
- 'ON' => 'p.forum_id = f.forum_id',
- ),
- ),
- 'WHERE' => 'p.topic_id = t.topic_id
- AND ' . $db->sql_in_set('p.post_id', $post_ids),
- 'ORDER_BY' => 'p.post_time DESC',
- );
-
- return true;
- }
-
- function adjust_item(&$item_row, &$row)
- {
- parent::adjust_item($item_row, $row);
-
- $item_row['title'] = (isset($row['forum_name']) && $row['forum_name'] !== '') ? $row['forum_name'] . ' ' . $this->separator . ' ' . $item_row['title'] : $item_row['title'];
- }
-}
-
-/**
-* Active Topics feed
-*
-* This will give you the last {$this->num_items} topics
-* with replies made withing the last {$this->sort_days} days
-* including the last post.
-*
-* @package phpBB3
-*/
-class phpbb_feed_topics_active extends phpbb_feed_topic_base
-{
- var $sort_days = 7;
-
- function set_keys()
- {
- parent::set_keys();
-
- $this->set('author_id', 'topic_last_poster_id');
- $this->set('creator', 'topic_last_poster_name');
- }
-
- function get_sql()
- {
- global $db, $config;
-
- $forum_ids_read = $this->get_readable_forums();
- if (empty($forum_ids_read))
- {
- return false;
- }
-
- $in_fid_ary = array_intersect($forum_ids_read, $this->get_forum_ids());
- $in_fid_ary = array_diff($in_fid_ary, $this->get_passworded_forums());
- if (empty($in_fid_ary))
- {
- return false;
- }
-
- // Add global forum
- $in_fid_ary[] = 0;
-
- // Search for topics in last X days
- $last_post_time_sql = ($this->sort_days) ? ' AND topic_last_post_time > ' . (time() - ($this->sort_days * 24 * 3600)) : '';
-
- // We really have to get the post ids first!
- $sql = 'SELECT topic_last_post_id, topic_last_post_time
- FROM ' . TOPICS_TABLE . '
- WHERE ' . $db->sql_in_set('forum_id', $in_fid_ary) . '
- AND topic_moved_id = 0
- AND topic_approved = 1
- ' . $last_post_time_sql . '
- ORDER BY topic_last_post_time DESC';
- $result = $db->sql_query_limit($sql, $this->num_items);
-
- $post_ids = array();
- while ($row = $db->sql_fetchrow($result))
- {
- $post_ids[] = (int) $row['topic_last_post_id'];
- }
- $db->sql_freeresult($result);
-
- if (empty($post_ids))
- {
- return false;
- }
-
- $this->sql = array(
- 'SELECT' => 'f.forum_id, f.forum_name,
- t.topic_id, t.topic_title, t.topic_replies, t.topic_replies_real, t.topic_views,
- t.topic_last_poster_id, t.topic_last_poster_name, t.topic_last_post_time,
- p.post_id, p.post_time, p.post_edit_time, p.post_text, p.bbcode_bitfield, p.bbcode_uid, p.enable_bbcode, p.enable_smilies, p.enable_magic_url',
- 'FROM' => array(
- TOPICS_TABLE => 't',
- POSTS_TABLE => 'p',
- ),
- 'LEFT_JOIN' => array(
- array(
- 'FROM' => array(FORUMS_TABLE => 'f'),
- 'ON' => 'p.forum_id = f.forum_id',
- ),
- ),
- 'WHERE' => 'p.topic_id = t.topic_id
- AND ' . $db->sql_in_set('p.post_id', $post_ids),
- 'ORDER_BY' => 'p.post_time DESC',
- );
-
- return true;
- }
-
- function get_forum_ids()
- {
- global $db, $cache;
- static $forum_ids;
-
- $cache_name = 'feed_topic_active_forum_ids';
-
- if (!isset($forum_ids) && ($forum_ids = $cache->get('_' . $cache_name)) === false)
- {
- $sql = 'SELECT forum_id
- FROM ' . FORUMS_TABLE . '
- WHERE forum_type = ' . FORUM_POST . '
- AND ' . $db->sql_bit_and('forum_options', FORUM_OPTION_FEED_EXCLUDE, '= 0') . '
- AND ' . $db->sql_bit_and('forum_flags', log(FORUM_FLAG_ACTIVE_TOPICS, 2), '<> 0');
- $result = $db->sql_query($sql);
-
- $forum_ids = array();
- while ($forum_id = (int) $db->sql_fetchfield('forum_id'))
- {
- $forum_ids[$forum_id] = $forum_id;
- }
- $db->sql_freeresult($result);
-
- $cache->put('_' . $cache_name, $forum_ids, 180);
- }
-
- return $forum_ids;
- }
-
- function adjust_item(&$item_row, &$row)
- {
- parent::adjust_item($item_row, $row);
-
- $item_row['title'] = (isset($row['forum_name']) && $row['forum_name'] !== '') ? $row['forum_name'] . ' ' . $this->separator . ' ' . $item_row['title'] : $item_row['title'];
- }
-}
-
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/acm/acm_apc.php b/phpBB/includes/acm/acm_apc.php
deleted file mode 100644
index 205353d3a5..0000000000
--- a/phpBB/includes/acm/acm_apc.php
+++ /dev/null
@@ -1,84 +0,0 @@
-<?php
-/**
-*
-* @package acm
-* @version $Id$
-* @copyright (c) 2005, 2009 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
-*
-*/
-
-/**
-* @ignore
-*/
-if (!defined('IN_PHPBB'))
-{
- exit;
-}
-
-// Include the abstract base
-if (!class_exists('acm_memory'))
-{
- require("{$phpbb_root_path}includes/acm/acm_memory.$phpEx");
-}
-
-/**
-* ACM for APC
-* @package acm
-*/
-class acm extends acm_memory
-{
- var $extension = 'apc';
-
- /**
- * Purge cache data
- *
- * @return null
- */
- function purge()
- {
- apc_clear_cache('user');
-
- parent::purge();
- }
-
- /**
- * Fetch an item from the cache
- *
- * @access protected
- * @param string $var Cache key
- * @return mixed Cached data
- */
- function _read($var)
- {
- return apc_fetch($this->key_prefix . $var);
- }
-
- /**
- * Store data in the cache
- *
- * @access protected
- * @param string $var Cache key
- * @param mixed $data Data to store
- * @param int $ttl Time-to-live of cached data
- * @return bool True if the operation succeeded
- */
- function _write($var, $data, $ttl = 2592000)
- {
- return apc_store($this->key_prefix . $var, $data, $ttl);
- }
-
- /**
- * Remove an item from the cache
- *
- * @access protected
- * @param string $var Cache key
- * @return bool True if the operation succeeded
- */
- function _delete($var)
- {
- return apc_delete($this->key_prefix . $var);
- }
-}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/acm/acm_eaccelerator.php b/phpBB/includes/acm/acm_eaccelerator.php
deleted file mode 100644
index ecec3ac9a5..0000000000
--- a/phpBB/includes/acm/acm_eaccelerator.php
+++ /dev/null
@@ -1,121 +0,0 @@
-<?php
-/**
-*
-* @package acm
-* @version $Id$
-* @copyright (c) 2005, 2009 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
-*
-*/
-
-/**
-* @ignore
-*/
-if (!defined('IN_PHPBB'))
-{
- exit;
-}
-
-// Include the abstract base
-if (!class_exists('acm_memory'))
-{
- require("{$phpbb_root_path}includes/acm/acm_memory.$phpEx");
-}
-
-/**
-* ACM for eAccelerator
-* @package acm
-* @todo Missing locks from destroy() talk with David
-*/
-class acm extends acm_memory
-{
- var $extension = 'eaccelerator';
- var $function = 'eaccelerator_get';
-
- var $serialize_header = '#phpbb-serialized#';
-
- /**
- * Purge cache data
- *
- * @return null
- */
- function purge()
- {
- foreach (eaccelerator_list_keys() as $var)
- {
- // @todo Check why the substr()
- // @todo Only unset vars matching $this->key_prefix
- eaccelerator_rm(substr($var['name'], 1));
- }
-
- parent::purge();
- }
-
- /**
- * Perform cache garbage collection
- *
- * @return null
- */
- function tidy()
- {
- eaccelerator_gc();
-
- set_config('cache_last_gc', time(), true);
- }
-
- /**
- * Fetch an item from the cache
- *
- * @access protected
- * @param string $var Cache key
- * @return mixed Cached data
- */
- function _read($var)
- {
- $result = eaccelerator_get($this->key_prefix . $var);
-
- if ($result === null)
- {
- return false;
- }
-
- // Handle serialized objects
- if (is_string($result) && strpos($result, $this->serialize_header . 'O:') === 0)
- {
- $result = unserialize(substr($result, strlen($this->serialize_header)));
- }
-
- return $result;
- }
-
- /**
- * Store data in the cache
- *
- * @access protected
- * @param string $var Cache key
- * @param mixed $data Data to store
- * @param int $ttl Time-to-live of cached data
- * @return bool True if the operation succeeded
- */
- function _write($var, $data, $ttl = 2592000)
- {
- // Serialize objects and make them easy to detect
- $data = (is_object($data)) ? $this->serialize_header . serialize($data) : $data;
-
- return eaccelerator_put($this->key_prefix . $var, $data, $ttl);
- }
-
- /**
- * Remove an item from the cache
- *
- * @access protected
- * @param string $var Cache key
- * @return bool True if the operation succeeded
- */
- function _delete($var)
- {
- return eaccelerator_rm($this->key_prefix . $var);
- }
-}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/acm/acm_file.php b/phpBB/includes/acm/acm_file.php
deleted file mode 100644
index 524a28561e..0000000000
--- a/phpBB/includes/acm/acm_file.php
+++ /dev/null
@@ -1,732 +0,0 @@
-<?php
-/**
-*
-* @package acm
-* @version $Id$
-* @copyright (c) 2005, 2009 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
-*
-*/
-
-/**
-* @ignore
-*/
-if (!defined('IN_PHPBB'))
-{
- exit;
-}
-
-/**
-* ACM File Based Caching
-* @package acm
-*/
-class acm
-{
- var $vars = array();
- var $var_expires = array();
- var $is_modified = false;
-
- var $sql_rowset = array();
- var $sql_row_pointer = array();
- var $cache_dir = '';
-
- /**
- * Set cache path
- */
- function acm()
- {
- global $phpbb_root_path;
- $this->cache_dir = $phpbb_root_path . 'cache/';
- }
-
- /**
- * Load global cache
- */
- function load()
- {
- return $this->_read('data_global');
- }
-
- /**
- * Unload cache object
- */
- function unload()
- {
- $this->save();
- unset($this->vars);
- unset($this->var_expires);
- unset($this->sql_rowset);
- unset($this->sql_row_pointer);
-
- $this->vars = array();
- $this->var_expires = array();
- $this->sql_rowset = array();
- $this->sql_row_pointer = array();
- }
-
- /**
- * Save modified objects
- */
- function save()
- {
- if (!$this->is_modified)
- {
- return;
- }
-
- global $phpEx;
-
- if (!$this->_write('data_global'))
- {
- if (!function_exists('phpbb_is_writable'))
- {
- global $phpbb_root_path;
- include($phpbb_root_path . 'includes/functions.' . $phpEx);
- }
-
- // Now, this occurred how often? ... phew, just tell the user then...
- if (!phpbb_is_writable($this->cache_dir))
- {
- // We need to use die() here, because else we may encounter an infinite loop (the message handler calls $cache->unload())
- die('Fatal: ' . $this->cache_dir . ' is NOT writable.');
- exit;
- }
-
- die('Fatal: Not able to open ' . $this->cache_dir . 'data_global.' . $phpEx);
- exit;
- }
-
- $this->is_modified = false;
- }
-
- /**
- * Tidy cache
- */
- function tidy()
- {
- global $phpEx;
-
- $dir = @opendir($this->cache_dir);
-
- if (!$dir)
- {
- return;
- }
-
- $time = time();
-
- while (($entry = readdir($dir)) !== false)
- {
- if (!preg_match('/^(sql_|data_(?!global))/', $entry))
- {
- continue;
- }
-
- if (!($handle = @fopen($this->cache_dir . $entry, 'rb')))
- {
- continue;
- }
-
- // Skip the PHP header
- fgets($handle);
-
- // Skip expiration
- $expires = (int) fgets($handle);
-
- fclose($handle);
-
- if ($time >= $expires)
- {
- $this->remove_file($this->cache_dir . $entry);
- }
- }
- closedir($dir);
-
- if (file_exists($this->cache_dir . 'data_global.' . $phpEx))
- {
- if (!sizeof($this->vars))
- {
- $this->load();
- }
-
- foreach ($this->var_expires as $var_name => $expires)
- {
- if ($time >= $expires)
- {
- $this->destroy($var_name);
- }
- }
- }
-
- set_config('cache_last_gc', time(), true);
- }
-
- /**
- * Get saved cache object
- */
- function get($var_name)
- {
- if ($var_name[0] == '_')
- {
- global $phpEx;
-
- if (!$this->_exists($var_name))
- {
- return false;
- }
-
- return $this->_read('data' . $var_name);
- }
- else
- {
- return ($this->_exists($var_name)) ? $this->vars[$var_name] : false;
- }
- }
-
- /**
- * Put data into cache
- */
- function put($var_name, $var, $ttl = 31536000)
- {
- if ($var_name[0] == '_')
- {
- $this->_write('data' . $var_name, $var, time() + $ttl);
- }
- else
- {
- $this->vars[$var_name] = $var;
- $this->var_expires[$var_name] = time() + $ttl;
- $this->is_modified = true;
- }
- }
-
- /**
- * Purge cache data
- */
- function purge()
- {
- // Purge all phpbb cache files
- $dir = @opendir($this->cache_dir);
-
- if (!$dir)
- {
- return;
- }
-
- while (($entry = readdir($dir)) !== false)
- {
- if (strpos($entry, 'sql_') !== 0 && strpos($entry, 'data_') !== 0 && strpos($entry, 'ctpl_') !== 0 && strpos($entry, 'tpl_') !== 0)
- {
- continue;
- }
-
- $this->remove_file($this->cache_dir . $entry);
- }
- closedir($dir);
-
- unset($this->vars);
- unset($this->var_expires);
- unset($this->sql_rowset);
- unset($this->sql_row_pointer);
-
- $this->vars = array();
- $this->var_expires = array();
- $this->sql_rowset = array();
- $this->sql_row_pointer = array();
-
- $this->is_modified = false;
- }
-
- /**
- * Destroy cache data
- */
- function destroy($var_name, $table = '')
- {
- global $phpEx;
-
- if ($var_name == 'sql' && !empty($table))
- {
- if (!is_array($table))
- {
- $table = array($table);
- }
-
- $dir = @opendir($this->cache_dir);
-
- if (!$dir)
- {
- return;
- }
-
- while (($entry = readdir($dir)) !== false)
- {
- if (strpos($entry, 'sql_') !== 0)
- {
- continue;
- }
-
- if (!($handle = @fopen($this->cache_dir . $entry, 'rb')))
- {
- continue;
- }
-
- // Skip the PHP header
- fgets($handle);
-
- // Skip expiration
- fgets($handle);
-
- // Grab the query, remove the LF
- $query = substr(fgets($handle), 0, -1);
-
- fclose($handle);
-
- foreach ($table as $check_table)
- {
- // Better catch partial table names than no table names. ;)
- if (strpos($query, $check_table) !== false)
- {
- $this->remove_file($this->cache_dir . $entry);
- break;
- }
- }
- }
- closedir($dir);
-
- return;
- }
-
- if (!$this->_exists($var_name))
- {
- return;
- }
-
- if ($var_name[0] == '_')
- {
- $this->remove_file($this->cache_dir . 'data' . $var_name . ".$phpEx", true);
- }
- else if (isset($this->vars[$var_name]))
- {
- $this->is_modified = true;
- unset($this->vars[$var_name]);
- unset($this->var_expires[$var_name]);
-
- // We save here to let the following cache hits succeed
- $this->save();
- }
- }
-
- /**
- * Check if a given cache entry exist
- */
- function _exists($var_name)
- {
- if ($var_name[0] == '_')
- {
- global $phpEx;
- return file_exists($this->cache_dir . 'data' . $var_name . ".$phpEx");
- }
- else
- {
- if (!sizeof($this->vars))
- {
- $this->load();
- }
-
- if (!isset($this->var_expires[$var_name]))
- {
- return false;
- }
-
- return (time() > $this->var_expires[$var_name]) ? false : isset($this->vars[$var_name]);
- }
- }
-
- /**
- * Load cached sql query
- */
- function sql_load($query)
- {
- // Remove extra spaces and tabs
- $query = preg_replace('/[\n\r\s\t]+/', ' ', $query);
-
- if (($rowset = $this->_read('sql_' . md5($query))) === false)
- {
- return false;
- }
-
- $query_id = sizeof($this->sql_rowset);
- $this->sql_rowset[$query_id] = $rowset;
- $this->sql_row_pointer[$query_id] = 0;
-
- return $query_id;
- }
-
- /**
- * Save sql query
- */
- function sql_save($query, &$query_result, $ttl)
- {
- global $db;
-
- // Remove extra spaces and tabs
- $query = preg_replace('/[\n\r\s\t]+/', ' ', $query);
-
- $query_id = sizeof($this->sql_rowset);
- $this->sql_rowset[$query_id] = array();
- $this->sql_row_pointer[$query_id] = 0;
-
- while ($row = $db->sql_fetchrow($query_result))
- {
- $this->sql_rowset[$query_id][] = $row;
- }
- $db->sql_freeresult($query_result);
-
- if ($this->_write('sql_' . md5($query), $this->sql_rowset[$query_id], $ttl + time(), $query))
- {
- $query_result = $query_id;
- }
- }
-
- /**
- * Ceck if a given sql query exist in cache
- */
- function sql_exists($query_id)
- {
- return isset($this->sql_rowset[$query_id]);
- }
-
- /**
- * Fetch row from cache (database)
- */
- function sql_fetchrow($query_id)
- {
- if ($this->sql_row_pointer[$query_id] < sizeof($this->sql_rowset[$query_id]))
- {
- return $this->sql_rowset[$query_id][$this->sql_row_pointer[$query_id]++];
- }
-
- return false;
- }
-
- /**
- * Fetch a field from the current row of a cached database result (database)
- */
- function sql_fetchfield($query_id, $field)
- {
- if ($this->sql_row_pointer[$query_id] < sizeof($this->sql_rowset[$query_id]))
- {
- return (isset($this->sql_rowset[$query_id][$this->sql_row_pointer[$query_id]][$field])) ? $this->sql_rowset[$query_id][$this->sql_row_pointer[$query_id]++][$field] : false;
- }
-
- return false;
- }
-
- /**
- * Seek a specific row in an a cached database result (database)
- */
- function sql_rowseek($rownum, $query_id)
- {
- if ($rownum >= sizeof($this->sql_rowset[$query_id]))
- {
- return false;
- }
-
- $this->sql_row_pointer[$query_id] = $rownum;
- return true;
- }
-
- /**
- * Free memory used for a cached database result (database)
- */
- function sql_freeresult($query_id)
- {
- if (!isset($this->sql_rowset[$query_id]))
- {
- return false;
- }
-
- unset($this->sql_rowset[$query_id]);
- unset($this->sql_row_pointer[$query_id]);
-
- return true;
- }
-
- /**
- * Read cached data from a specified file
- *
- * @access private
- * @param string $filename Filename to write
- * @return mixed False if an error was encountered, otherwise the data type of the cached data
- */
- function _read($filename)
- {
- global $phpEx;
-
- $file = "{$this->cache_dir}$filename.$phpEx";
-
- $type = substr($filename, 0, strpos($filename, '_'));
-
- if (!file_exists($file))
- {
- return false;
- }
-
- if (!($handle = @fopen($file, 'rb')))
- {
- return false;
- }
-
- // Skip the PHP header
- fgets($handle);
-
- if ($filename == 'data_global')
- {
- $this->vars = $this->var_expires = array();
-
- $time = time();
-
- while (($expires = (int) fgets($handle)) && !feof($handle))
- {
- // Number of bytes of data
- $bytes = substr(fgets($handle), 0, -1);
-
- if (!is_numeric($bytes) || ($bytes = (int) $bytes) === 0)
- {
- // We cannot process the file without a valid number of bytes
- // so we discard it
- fclose($handle);
-
- $this->vars = $this->var_expires = array();
- $this->is_modified = false;
-
- $this->remove_file($file);
-
- return false;
- }
-
- if ($time >= $expires)
- {
- fseek($handle, $bytes, SEEK_CUR);
-
- continue;
- }
-
- $var_name = substr(fgets($handle), 0, -1);
-
- // Read the length of bytes that consists of data.
- $data = fread($handle, $bytes - strlen($var_name));
- $data = @unserialize($data);
-
- // Don't use the data if it was invalid
- if ($data !== false)
- {
- $this->vars[$var_name] = $data;
- $this->var_expires[$var_name] = $expires;
- }
-
- // Absorb the LF
- fgets($handle);
- }
-
- fclose($handle);
-
- $this->is_modified = false;
-
- return true;
- }
- else
- {
- $data = false;
- $line = 0;
-
- while (($buffer = fgets($handle)) && !feof($handle))
- {
- $buffer = substr($buffer, 0, -1); // Remove the LF
-
- // $buffer is only used to read integers
- // if it is non numeric we have an invalid
- // cache file, which we will now remove.
- if (!is_numeric($buffer))
- {
- break;
- }
-
- if ($line == 0)
- {
- $expires = (int) $buffer;
-
- if (time() >= $expires)
- {
- break;
- }
-
- if ($type == 'sql')
- {
- // Skip the query
- fgets($handle);
- }
- }
- else if ($line == 1)
- {
- $bytes = (int) $buffer;
-
- // Never should have 0 bytes
- if (!$bytes)
- {
- break;
- }
-
- // Grab the serialized data
- $data = fread($handle, $bytes);
-
- // Read 1 byte, to trigger EOF
- fread($handle, 1);
-
- if (!feof($handle))
- {
- // Somebody tampered with our data
- $data = false;
- }
- break;
- }
- else
- {
- // Something went wrong
- break;
- }
- $line++;
- }
- fclose($handle);
-
- // unserialize if we got some data
- $data = ($data !== false) ? @unserialize($data) : $data;
-
- if ($data === false)
- {
- $this->remove_file($file);
- return false;
- }
-
- return $data;
- }
- }
-
- /**
- * Write cache data to a specified file
- *
- * 'data_global' is a special case and the generated format is different for this file:
- * <code>
- * <?php exit; ?>
- * (expiration)
- * (length of var and serialised data)
- * (var)
- * (serialised data)
- * ... (repeat)
- * </code>
- *
- * The other files have a similar format:
- * <code>
- * <?php exit; ?>
- * (expiration)
- * (query) [SQL files only]
- * (length of serialised data)
- * (serialised data)
- * </code>
- *
- * @access private
- * @param string $filename Filename to write
- * @param mixed $data Data to store
- * @param int $expires Timestamp when the data expires
- * @param string $query Query when caching SQL queries
- * @return bool True if the file was successfully created, otherwise false
- */
- function _write($filename, $data = null, $expires = 0, $query = '')
- {
- global $phpEx;
-
- $file = "{$this->cache_dir}$filename.$phpEx";
-
- if ($handle = @fopen($file, 'wb'))
- {
- @flock($handle, LOCK_EX);
-
- // File header
- fwrite($handle, '<' . '?php exit; ?' . '>');
-
- if ($filename == 'data_global')
- {
- // Global data is a different format
- foreach ($this->vars as $var => $data)
- {
- if (strpos($var, "\r") !== false || strpos($var, "\n") !== false)
- {
- // CR/LF would cause fgets() to read the cache file incorrectly
- // do not cache test entries, they probably won't be read back
- // the cache keys should really be alphanumeric with a few symbols.
- continue;
- }
- $data = serialize($data);
-
- // Write out the expiration time
- fwrite($handle, "\n" . $this->var_expires[$var] . "\n");
-
- // Length of the remaining data for this var (ignoring two LF's)
- fwrite($handle, strlen($data . $var) . "\n");
- fwrite($handle, $var . "\n");
- fwrite($handle, $data);
- }
- }
- else
- {
- fwrite($handle, "\n" . $expires . "\n");
-
- if (strpos($filename, 'sql_') === 0)
- {
- fwrite($handle, $query . "\n");
- }
- $data = serialize($data);
-
- fwrite($handle, strlen($data) . "\n");
- fwrite($handle, $data);
- }
-
- @flock($handle, LOCK_UN);
- fclose($handle);
-
- if (!function_exists('phpbb_chmod'))
- {
- global $phpbb_root_path;
- include($phpbb_root_path . 'includes/functions.' . $phpEx);
- }
-
- phpbb_chmod($file, CHMOD_READ | CHMOD_WRITE);
-
- return true;
- }
-
- return false;
- }
-
- /**
- * Removes/unlinks file
- */
- function remove_file($filename, $check = false)
- {
- if (!function_exists('phpbb_is_writable'))
- {
- global $phpbb_root_path, $phpEx;
- include($phpbb_root_path . 'includes/functions.' . $phpEx);
- }
-
- if ($check && !phpbb_is_writable($this->cache_dir))
- {
- // E_USER_ERROR - not using language entry - intended.
- trigger_error('Unable to remove files within ' . $this->cache_dir . '. Please check directory permissions.', E_USER_ERROR);
- }
-
- return @unlink($filename);
- }
-}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/acm/acm_memcache.php b/phpBB/includes/acm/acm_memcache.php
deleted file mode 100644
index 70bc219952..0000000000
--- a/phpBB/includes/acm/acm_memcache.php
+++ /dev/null
@@ -1,138 +0,0 @@
-<?php
-/**
-*
-* @package acm
-* @version $Id$
-* @copyright (c) 2005, 2009 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
-*
-*/
-
-/**
-* @ignore
-*/
-if (!defined('IN_PHPBB'))
-{
- exit;
-}
-
-// Include the abstract base
-if (!class_exists('acm_memory'))
-{
- require("{$phpbb_root_path}includes/acm/acm_memory.$phpEx");
-}
-
-if (!defined('PHPBB_ACM_MEMCACHE_PORT'))
-{
- define('PHPBB_ACM_MEMCACHE_PORT', 11211);
-}
-
-if (!defined('PHPBB_ACM_MEMCACHE_COMPRESS'))
-{
- define('PHPBB_ACM_MEMCACHE_COMPRESS', false);
-}
-
-if (!defined('PHPBB_ACM_MEMCACHE_HOST'))
-{
- define('PHPBB_ACM_MEMCACHE_HOST', 'localhost');
-}
-
-if (!defined('PHPBB_ACM_MEMCACHE'))
-{
- //can define multiple servers with host1/port1,host2/port2 format
- define('PHPBB_ACM_MEMCACHE', PHPBB_ACM_MEMCACHE_HOST . '/' . PHPBB_ACM_MEMCACHE_PORT);
-}
-
-/**
-* ACM for Memcached
-* @package acm
-*/
-class acm extends acm_memory
-{
- var $extension = 'memcache';
-
- var $memcache;
- var $flags = 0;
-
- function acm()
- {
- // Call the parent constructor
- parent::acm_memory();
-
- $this->memcache = new Memcache;
- foreach(explode(',', PHPBB_ACM_MEMCACHE) as $u)
- {
- $parts = explode('/', $u);
- $this->memcache->addServer(trim($parts[0]), trim($parts[1]));
- }
- $this->flags = (PHPBB_ACM_MEMCACHE_COMPRESS) ? MEMCACHE_COMPRESSED : 0;
- }
-
- /**
- * Unload the cache resources
- *
- * @return null
- */
- function unload()
- {
- parent::unload();
-
- $this->memcache->close();
- }
-
- /**
- * Purge cache data
- *
- * @return null
- */
- function purge()
- {
- $this->memcache->flush();
-
- parent::purge();
- }
-
- /**
- * Fetch an item from the cache
- *
- * @access protected
- * @param string $var Cache key
- * @return mixed Cached data
- */
- function _read($var)
- {
- return $this->memcache->get($this->key_prefix . $var);
- }
-
- /**
- * Store data in the cache
- *
- * @access protected
- * @param string $var Cache key
- * @param mixed $data Data to store
- * @param int $ttl Time-to-live of cached data
- * @return bool True if the operation succeeded
- */
- function _write($var, $data, $ttl = 2592000)
- {
- if (!$this->memcache->replace($this->key_prefix . $var, $data, $this->flags, $ttl))
- {
- return $this->memcache->set($this->key_prefix . $var, $data, $this->flags, $ttl);
- }
- return true;
- }
-
- /**
- * Remove an item from the cache
- *
- * @access protected
- * @param string $var Cache key
- * @return bool True if the operation succeeded
- */
- function _delete($var)
- {
- return $this->memcache->delete($this->key_prefix . $var);
- }
-}
-
-?>
diff --git a/phpBB/includes/acm/acm_memory.php b/phpBB/includes/acm/acm_memory.php
deleted file mode 100644
index 9b68585d24..0000000000
--- a/phpBB/includes/acm/acm_memory.php
+++ /dev/null
@@ -1,451 +0,0 @@
-<?php
-/**
-*
-* @package acm
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
-*
-*/
-
-/**
-* @ignore
-*/
-if (!defined('IN_PHPBB'))
-{
- exit;
-}
-
-/**
-* ACM Abstract Memory Class
-* @package acm
-*/
-class acm_memory
-{
- var $key_prefix;
-
- var $vars = array();
- var $is_modified = false;
-
- var $sql_rowset = array();
- var $sql_row_pointer = array();
- var $cache_dir = '';
-
- /**
- * Set cache path
- */
- function acm_memory()
- {
- global $phpbb_root_path, $dbname, $table_prefix;
-
- $this->cache_dir = $phpbb_root_path . 'cache/';
- $this->key_prefix = substr(md5($dbname . $table_prefix), 0, 8) . '_';
-
- if (!isset($this->extension) || !extension_loaded($this->extension))
- {
- global $acm_type;
-
- trigger_error("Could not find required extension [{$this->extension}] for the ACM module $acm_type.", E_USER_ERROR);
- }
-
- if (isset($this->function) && !function_exists($this->function))
- {
- global $acm_type;
-
- trigger_error("The required function [{$this->function}] is not available for the ACM module $acm_type.", E_USER_ERROR);
- }
- }
-
- /**
- * Load global cache
- */
- function load()
- {
- // grab the global cache
- $this->vars = $this->_read('global');
-
- if ($this->vars !== false)
- {
- return true;
- }
-
- return false;
- }
-
- /**
- * Unload cache object
- */
- function unload()
- {
- $this->save();
- unset($this->vars);
- unset($this->sql_rowset);
- unset($this->sql_row_pointer);
-
- $this->vars = array();
- $this->sql_rowset = array();
- $this->sql_row_pointer = array();
- }
-
- /**
- * Save modified objects
- */
- function save()
- {
- if (!$this->is_modified)
- {
- return;
- }
-
- $this->_write('global', $this->vars, 2592000);
-
- $this->is_modified = false;
- }
-
- /**
- * Tidy cache
- */
- function tidy()
- {
- // cache has auto GC, no need to have any code here :)
-
- set_config('cache_last_gc', time(), true);
- }
-
- /**
- * Get saved cache object
- */
- function get($var_name)
- {
- if ($var_name[0] == '_')
- {
- if (!$this->_exists($var_name))
- {
- return false;
- }
-
- return $this->_read($var_name);
- }
- else
- {
- return ($this->_exists($var_name)) ? $this->vars[$var_name] : false;
- }
- }
-
- /**
- * Put data into cache
- */
- function put($var_name, $var, $ttl = 2592000)
- {
- if ($var_name[0] == '_')
- {
- $this->_write($var_name, $var, $ttl);
- }
- else
- {
- $this->vars[$var_name] = $var;
- $this->is_modified = true;
- }
- }
-
- /**
- * Purge cache data
- */
- function purge()
- {
- // Purge all phpbb cache files
- $dir = @opendir($this->cache_dir);
-
- if (!$dir)
- {
- return;
- }
-
- while (($entry = readdir($dir)) !== false)
- {
- if (strpos($entry, 'sql_') !== 0 && strpos($entry, 'data_') !== 0 && strpos($entry, 'ctpl_') !== 0 && strpos($entry, 'tpl_') !== 0)
- {
- continue;
- }
-
- $this->remove_file($this->cache_dir . $entry);
- }
- closedir($dir);
-
- unset($this->vars);
- unset($this->sql_rowset);
- unset($this->sql_row_pointer);
-
- $this->vars = array();
- $this->sql_rowset = array();
- $this->sql_row_pointer = array();
-
- $this->is_modified = false;
- }
-
-
- /**
- * Destroy cache data
- */
- function destroy($var_name, $table = '')
- {
- if ($var_name == 'sql' && !empty($table))
- {
- if (!is_array($table))
- {
- $table = array($table);
- }
-
- foreach ($table as $table_name)
- {
- // gives us the md5s that we want
- $temp = $this->_read('sql_' . $table_name);
-
- if ($temp === false)
- {
- continue;
- }
-
- // delete each query ref
- foreach ($temp as $md5_id => $void)
- {
- $this->_delete('sql_' . $md5_id);
- }
-
- // delete the table ref
- $this->_delete('sql_' . $table_name);
- }
-
- return;
- }
-
- if (!$this->_exists($var_name))
- {
- return;
- }
-
- if ($var_name[0] == '_')
- {
- $this->_delete($var_name);
- }
- else if (isset($this->vars[$var_name]))
- {
- $this->is_modified = true;
- unset($this->vars[$var_name]);
-
- // We save here to let the following cache hits succeed
- $this->save();
- }
- }
-
- /**
- * Check if a given cache entry exist
- */
- function _exists($var_name)
- {
- if ($var_name[0] == '_')
- {
- return $this->_isset($var_name);
- }
- else
- {
- if (!sizeof($this->vars))
- {
- $this->load();
- }
-
- return isset($this->vars[$var_name]);
- }
- }
-
- /**
- * Load cached sql query
- */
- function sql_load($query)
- {
- // Remove extra spaces and tabs
- $query = preg_replace('/[\n\r\s\t]+/', ' ', $query);
- $query_id = sizeof($this->sql_rowset);
-
- if (($result = $this->_read('sql_' . md5($query))) === false)
- {
- return false;
- }
-
- $this->sql_rowset[$query_id] = $result;
- $this->sql_row_pointer[$query_id] = 0;
-
- return $query_id;
- }
-
- /**
- * Save sql query
- */
- function sql_save($query, &$query_result, $ttl)
- {
- global $db;
-
- // Remove extra spaces and tabs
- $query = preg_replace('/[\n\r\s\t]+/', ' ', $query);
- $hash = md5($query);
-
- // determine which tables this query belongs to
- // Some queries use backticks, namely the get_database_size() query
- // don't check for conformity, the SQL would error and not reach here.
- if (!preg_match_all('/(?:FROM \\(?(`?\\w+`?(?: \\w+)?(?:, ?`?\\w+`?(?: \\w+)?)*)\\)?)|(?:JOIN (`?\\w+`?(?: \\w+)?))/', $query, $regs, PREG_SET_ORDER))
- {
- // Bail out if the match fails.
- return;
- }
-
- $tables = array();
- foreach ($regs as $match)
- {
- if ($match[0][0] == 'F')
- {
- $tables = array_merge($tables, array_map('trim', explode(',', $match[1])));
- }
- else
- {
- $tables[] = $match[2];
- }
- }
-
- foreach ($tables as $table_name)
- {
- // Remove backticks
- $table_name = ($table_name[0] == '`') ? substr($table_name, 1, -1) : $table_name;
-
- if (($pos = strpos($table_name, ' ')) !== false)
- {
- $table_name = substr($table_name, 0, $pos);
- }
-
- $temp = $this->_read('sql_' . $table_name);
-
- if ($temp === false)
- {
- $temp = array();
- }
-
- $temp[$hash] = true;
-
- // This must never expire
- $this->_write('sql_' . $table_name, $temp, 0);
- }
-
- // store them in the right place
- $query_id = sizeof($this->sql_rowset);
- $this->sql_rowset[$query_id] = array();
- $this->sql_row_pointer[$query_id] = 0;
-
- while ($row = $db->sql_fetchrow($query_result))
- {
- $this->sql_rowset[$query_id][] = $row;
- }
- $db->sql_freeresult($query_result);
-
- $this->_write('sql_' . $hash, $this->sql_rowset[$query_id], $ttl);
-
- $query_result = $query_id;
- }
-
- /**
- * Ceck if a given sql query exist in cache
- */
- function sql_exists($query_id)
- {
- return isset($this->sql_rowset[$query_id]);
- }
-
- /**
- * Fetch row from cache (database)
- */
- function sql_fetchrow($query_id)
- {
- if ($this->sql_row_pointer[$query_id] < sizeof($this->sql_rowset[$query_id]))
- {
- return $this->sql_rowset[$query_id][$this->sql_row_pointer[$query_id]++];
- }
-
- return false;
- }
-
- /**
- * Fetch a field from the current row of a cached database result (database)
- */
- function sql_fetchfield($query_id, $field)
- {
- if ($this->sql_row_pointer[$query_id] < sizeof($this->sql_rowset[$query_id]))
- {
- return (isset($this->sql_rowset[$query_id][$this->sql_row_pointer[$query_id]][$field])) ? $this->sql_rowset[$query_id][$this->sql_row_pointer[$query_id]++][$field] : false;
- }
-
- return false;
- }
-
- /**
- * Seek a specific row in an a cached database result (database)
- */
- function sql_rowseek($rownum, $query_id)
- {
- if ($rownum >= sizeof($this->sql_rowset[$query_id]))
- {
- return false;
- }
-
- $this->sql_row_pointer[$query_id] = $rownum;
- return true;
- }
-
- /**
- * Free memory used for a cached database result (database)
- */
- function sql_freeresult($query_id)
- {
- if (!isset($this->sql_rowset[$query_id]))
- {
- return false;
- }
-
- unset($this->sql_rowset[$query_id]);
- unset($this->sql_row_pointer[$query_id]);
-
- return true;
- }
-
- /**
- * Removes/unlinks file
- */
- function remove_file($filename, $check = false)
- {
- if (!function_exists('phpbb_is_writable'))
- {
- global $phpbb_root_path, $phpEx;
- include($phpbb_root_path . 'includes/functions.' . $phpEx);
- }
-
- if ($check && !phpbb_is_writable($this->cache_dir))
- {
- // E_USER_ERROR - not using language entry - intended.
- trigger_error('Unable to remove files within ' . $this->cache_dir . '. Please check directory permissions.', E_USER_ERROR);
- }
-
- return @unlink($filename);
- }
-
- /**
- * Check if a cache var exists
- *
- * @access protected
- * @param string $var Cache key
- * @return bool True if it exists, otherwise false
- */
- function _isset($var)
- {
- // Most caches don't need to check
- return true;
- }
-}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/acm/acm_null.php b/phpBB/includes/acm/acm_null.php
deleted file mode 100644
index fca67115a7..0000000000
--- a/phpBB/includes/acm/acm_null.php
+++ /dev/null
@@ -1,156 +0,0 @@
-<?php
-/**
-*
-* @package acm
-* @version $Id$
-* @copyright (c) 2005, 2009 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
-*
-*/
-
-/**
-* @ignore
-*/
-if (!defined('IN_PHPBB'))
-{
- exit;
-}
-
-/**
-* ACM Null Caching
-* @package acm
-*/
-class acm
-{
- /**
- * Set cache path
- */
- function acm()
- {
- }
-
- /**
- * Load global cache
- */
- function load()
- {
- return true;
- }
-
- /**
- * Unload cache object
- */
- function unload()
- {
- }
-
- /**
- * Save modified objects
- */
- function save()
- {
- }
-
- /**
- * Tidy cache
- */
- function tidy()
- {
- // This cache always has a tidy room.
- set_config('cache_last_gc', time(), true);
- }
-
- /**
- * Get saved cache object
- */
- function get($var_name)
- {
- return false;
- }
-
- /**
- * Put data into cache
- */
- function put($var_name, $var, $ttl = 0)
- {
- }
-
- /**
- * Purge cache data
- */
- function purge()
- {
- }
-
- /**
- * Destroy cache data
- */
- function destroy($var_name, $table = '')
- {
- }
-
- /**
- * Check if a given cache entry exist
- */
- function _exists($var_name)
- {
- return false;
- }
-
- /**
- * Load cached sql query
- */
- function sql_load($query)
- {
- return false;
- }
-
- /**
- * Save sql query
- */
- function sql_save($query, &$query_result, $ttl)
- {
- }
-
- /**
- * Ceck if a given sql query exist in cache
- */
- function sql_exists($query_id)
- {
- return false;
- }
-
- /**
- * Fetch row from cache (database)
- */
- function sql_fetchrow($query_id)
- {
- return false;
- }
-
- /**
- * Fetch a field from the current row of a cached database result (database)
- */
- function sql_fetchfield($query_id, $field)
- {
- return false;
- }
-
- /**
- * Seek a specific row in an a cached database result (database)
- */
- function sql_rowseek($rownum, $query_id)
- {
- return false;
- }
-
- /**
- * Free memory used for a cached database result (database)
- */
- function sql_freeresult($query_id)
- {
- return false;
- }
-}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/acm/acm_redis.php b/phpBB/includes/acm/acm_redis.php
deleted file mode 100644
index dc11ca7768..0000000000
--- a/phpBB/includes/acm/acm_redis.php
+++ /dev/null
@@ -1,145 +0,0 @@
-<?php
-/**
-*
-* @package acm
-* @copyright (c) 2011 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
-*
-*/
-
-/**
-* @ignore
-*/
-if (!defined('IN_PHPBB'))
-{
- exit;
-}
-
-// Include the abstract base
-if (!class_exists('acm_memory'))
-{
- require("{$phpbb_root_path}includes/acm/acm_memory.$phpEx");
-}
-
-if (!defined('PHPBB_ACM_REDIS_PORT'))
-{
- define('PHPBB_ACM_REDIS_PORT', 6379);
-}
-
-if (!defined('PHPBB_ACM_REDIS_HOST'))
-{
- define('PHPBB_ACM_REDIS_HOST', 'localhost');
-}
-
-/**
-* ACM for Redis
-*
-* Compatible with the php extension phpredis available
-* at https://github.com/nicolasff/phpredis
-*
-* @package acm
-*/
-class acm extends acm_memory
-{
- var $extension = 'redis';
-
- var $redis;
-
- function acm()
- {
- // Call the parent constructor
- parent::acm_memory();
-
- $this->redis = new Redis();
- $this->redis->connect(PHPBB_ACM_REDIS_HOST, PHPBB_ACM_REDIS_PORT);
-
- if (defined('PHPBB_ACM_REDIS_PASSWORD'))
- {
- if (!$this->redis->auth(PHPBB_ACM_REDIS_PASSWORD))
- {
- global $acm_type;
-
- trigger_error("Incorrect password for the ACM module $acm_type.", E_USER_ERROR);
- }
- }
-
- $this->redis->setOption(Redis::OPT_SERIALIZER, Redis::SERIALIZER_PHP);
- $this->redis->setOption(Redis::OPT_PREFIX, $this->key_prefix);
-
- if (defined('PHPBB_ACM_REDIS_DB'))
- {
- if (!$this->redis->select(PHPBB_ACM_REDIS_DB))
- {
- global $acm_type;
-
- trigger_error("Incorrect database for the ACM module $acm_type.", E_USER_ERROR);
- }
- }
- }
-
- /**
- * Unload the cache resources
- *
- * @return null
- */
- function unload()
- {
- parent::unload();
-
- $this->redis->close();
- }
-
- /**
- * Purge cache data
- *
- * @return null
- */
- function purge()
- {
- $this->redis->flushDB();
-
- parent::purge();
- }
-
- /**
- * Fetch an item from the cache
- *
- * @access protected
- * @param string $var Cache key
- * @return mixed Cached data
- */
- function _read($var)
- {
- return $this->redis->get($var);
- }
-
- /**
- * Store data in the cache
- *
- * @access protected
- * @param string $var Cache key
- * @param mixed $data Data to store
- * @param int $ttl Time-to-live of cached data
- * @return bool True if the operation succeeded
- */
- function _write($var, $data, $ttl = 2592000)
- {
- return $this->redis->setex($var, $ttl, $data);
- }
-
- /**
- * Remove an item from the cache
- *
- * @access protected
- * @param string $var Cache key
- * @return bool True if the operation succeeded
- */
- function _delete($var)
- {
- if ($this->redis->delete($var) > 0)
- {
- return true;
- }
- return false;
- }
-}
diff --git a/phpBB/includes/acm/acm_wincache.php b/phpBB/includes/acm/acm_wincache.php
deleted file mode 100644
index 7faba4f5b6..0000000000
--- a/phpBB/includes/acm/acm_wincache.php
+++ /dev/null
@@ -1,84 +0,0 @@
-<?php
-/**
-*
-* @package acm
-* @copyright (c) 2010 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
-*
-*/
-
-/**
-* @ignore
-*/
-if (!defined('IN_PHPBB'))
-{
- exit;
-}
-
-// Include the abstract base
-if (!class_exists('acm_memory'))
-{
- require("{$phpbb_root_path}includes/acm/acm_memory.$phpEx");
-}
-
-/**
-* ACM for WinCache
-* @package acm
-*/
-class acm extends acm_memory
-{
- var $extension = 'wincache';
-
- /**
- * Purge cache data
- *
- * @return null
- */
- function purge()
- {
- wincache_ucache_clear();
-
- parent::purge();
- }
-
- /**
- * Fetch an item from the cache
- *
- * @access protected
- * @param string $var Cache key
- * @return mixed Cached data
- */
- function _read($var)
- {
- $success = false;
- $result = wincache_ucache_get($this->key_prefix . $var, $success);
-
- return ($success) ? $result : false;
- }
-
- /**
- * Store data in the cache
- *
- * @access protected
- * @param string $var Cache key
- * @param mixed $data Data to store
- * @param int $ttl Time-to-live of cached data
- * @return bool True if the operation succeeded
- */
- function _write($var, $data, $ttl = 2592000)
- {
- return wincache_ucache_set($this->key_prefix . $var, $data, $ttl);
- }
-
- /**
- * Remove an item from the cache
- *
- * @access protected
- * @param string $var Cache key
- * @return bool True if the operation succeeded
- */
- function _delete($var)
- {
- return wincache_ucache_delete($this->key_prefix . $var);
- }
-}
diff --git a/phpBB/includes/acm/acm_xcache.php b/phpBB/includes/acm/acm_xcache.php
deleted file mode 100644
index e3d83f8bfa..0000000000
--- a/phpBB/includes/acm/acm_xcache.php
+++ /dev/null
@@ -1,121 +0,0 @@
-<?php
-/**
-*
-* @package acm
-* @version $Id$
-* @copyright (c) 2005, 2009 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
-*
-*/
-
-/**
-* @ignore
-*/
-if (!defined('IN_PHPBB'))
-{
- exit;
-}
-
-// Include the abstract base
-if (!class_exists('acm_memory'))
-{
- require("{$phpbb_root_path}includes/acm/acm_memory.$phpEx");
-}
-
-/**
-* ACM for XCache
-* @package acm
-*
-* To use this module you need ini_get() enabled and the following INI settings configured as follows:
-* - xcache.var_size > 0
-* - xcache.admin.enable_auth = off (or xcache.admin.user and xcache.admin.password set)
-*
-*/
-class acm extends acm_memory
-{
- var $extension = 'XCache';
-
- function acm()
- {
- parent::acm_memory();
-
- if (!function_exists('ini_get') || (int) ini_get('xcache.var_size') <= 0)
- {
- trigger_error('Increase xcache.var_size setting above 0 or enable ini_get() to use this ACM module.', E_USER_ERROR);
- }
- }
-
- /**
- * Purge cache data
- *
- * @return null
- */
- function purge()
- {
- // Run before for XCache, if admin functions are disabled it will terminate execution
- parent::purge();
-
- // If the admin authentication is enabled but not set up, this will cause a nasty error.
- // Not much we can do about it though.
- $n = xcache_count(XC_TYPE_VAR);
-
- for ($i = 0; $i < $n; $i++)
- {
- xcache_clear_cache(XC_TYPE_VAR, $i);
- }
- }
-
- /**
- * Fetch an item from the cache
- *
- * @access protected
- * @param string $var Cache key
- * @return mixed Cached data
- */
- function _read($var)
- {
- $result = xcache_get($this->key_prefix . $var);
-
- return ($result !== null) ? $result : false;
- }
-
- /**
- * Store data in the cache
- *
- * @access protected
- * @param string $var Cache key
- * @param mixed $data Data to store
- * @param int $ttl Time-to-live of cached data
- * @return bool True if the operation succeeded
- */
- function _write($var, $data, $ttl = 2592000)
- {
- return xcache_set($this->key_prefix . $var, $data, $ttl);
- }
-
- /**
- * Remove an item from the cache
- *
- * @access protected
- * @param string $var Cache key
- * @return bool True if the operation succeeded
- */
- function _delete($var)
- {
- return xcache_unset($this->key_prefix . $var);
- }
-
- /**
- * Check if a cache var exists
- *
- * @access protected
- * @param string $var Cache key
- * @return bool True if it exists, otherwise false
- */
- function _isset($var)
- {
- return xcache_isset($this->key_prefix . $var);
- }
-}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/acp/acp_attachments.php b/phpBB/includes/acp/acp_attachments.php
index bffe6f7db3..e4650455c4 100644
--- a/phpBB/includes/acp/acp_attachments.php
+++ b/phpBB/includes/acp/acp_attachments.php
@@ -1,10 +1,13 @@
<?php
/**
*
-* @package acp
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -16,19 +19,39 @@ if (!defined('IN_PHPBB'))
exit;
}
-/**
-* @package acp
-*/
class acp_attachments
{
- var $u_action;
- var $new_config;
+ /** @var \phpbb\db\driver\driver_interface */
+ protected $db;
+
+ /** @var \phpbb\config\config */
+ protected $config;
+
+ /** @var ContainerBuilder */
+ protected $phpbb_container;
+
+ /** @var \phpbb\template\template */
+ protected $template;
+
+ /** @var \phpbb\user */
+ protected $user;
+
+ public $id;
+ public $u_action;
+ protected $new_config;
function main($id, $mode)
{
- global $db, $user, $auth, $template, $cache;
+ global $db, $user, $auth, $template, $cache, $phpbb_container, $phpbb_dispatcher;
global $config, $phpbb_admin_path, $phpbb_root_path, $phpEx;
+ $this->id = $id;
+ $this->db = $db;
+ $this->config = $config;
+ $this->template = $template;
+ $this->user = $user;
+ $this->phpbb_container = $phpbb_container;
+
$user->add_lang(array('posting', 'viewtopic', 'acp/attachments'));
$error = $notify = array();
@@ -61,6 +84,10 @@ class acp_attachments
$l_title = 'ACP_ORPHAN_ATTACHMENTS';
break;
+ case 'manage':
+ $l_title = 'ACP_MANAGE_ATTACHMENTS';
+ break;
+
default:
trigger_error('NO_MODE', E_USER_ERROR);
break;
@@ -79,7 +106,10 @@ class acp_attachments
{
case 'attach':
- include_once($phpbb_root_path . 'includes/functions_posting.' . $phpEx);
+ if (!function_exists('get_supported_image_types'))
+ {
+ include($phpbb_root_path . 'includes/functions_posting.' . $phpEx);
+ }
$sql = 'SELECT group_name, cat_id
FROM ' . EXTENSION_GROUPS_TABLE . '
@@ -95,7 +125,7 @@ class acp_attachments
}
$db->sql_freeresult($result);
- $l_legend_cat_images = $user->lang['SETTINGS_CAT_IMAGES'] . ' [' . $user->lang['ASSIGNED_GROUP'] . ': ' . ((!empty($s_assigned_groups[ATTACHMENT_CATEGORY_IMAGE])) ? implode(', ', $s_assigned_groups[ATTACHMENT_CATEGORY_IMAGE]) : $user->lang['NO_EXT_GROUP']) . ']';
+ $l_legend_cat_images = $user->lang['SETTINGS_CAT_IMAGES'] . ' [' . $user->lang['ASSIGNED_GROUP'] . ': ' . ((!empty($s_assigned_groups[ATTACHMENT_CATEGORY_IMAGE])) ? implode($user->lang['COMMA_SEPARATOR'], $s_assigned_groups[ATTACHMENT_CATEGORY_IMAGE]) : $user->lang['NO_EXT_GROUP']) . ']';
$display_vars = array(
'title' => 'ACP_ATTACHMENT_SETTINGS',
@@ -114,25 +144,36 @@ class acp_attachments
'attachment_quota' => array('lang' => 'ATTACH_QUOTA', 'validate' => 'string', 'type' => 'custom', 'method' => 'max_filesize', 'explain' => true),
'max_filesize' => array('lang' => 'ATTACH_MAX_FILESIZE', 'validate' => 'string', 'type' => 'custom', 'method' => 'max_filesize', 'explain' => true),
'max_filesize_pm' => array('lang' => 'ATTACH_MAX_PM_FILESIZE','validate' => 'string', 'type' => 'custom', 'method' => 'max_filesize', 'explain' => true),
- 'max_attachments' => array('lang' => 'MAX_ATTACHMENTS', 'validate' => 'int', 'type' => 'text:3:3', 'explain' => false),
- 'max_attachments_pm' => array('lang' => 'MAX_ATTACHMENTS_PM', 'validate' => 'int', 'type' => 'text:3:3', 'explain' => false),
+ 'max_attachments' => array('lang' => 'MAX_ATTACHMENTS', 'validate' => 'int:0:999', 'type' => 'number:0:999', 'explain' => false),
+ 'max_attachments_pm' => array('lang' => 'MAX_ATTACHMENTS_PM', 'validate' => 'int:0:999', 'type' => 'number:0:999', 'explain' => false),
'secure_downloads' => array('lang' => 'SECURE_DOWNLOADS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'secure_allow_deny' => array('lang' => 'SECURE_ALLOW_DENY', 'validate' => 'int', 'type' => 'custom', 'method' => 'select_allow_deny', 'explain' => true),
'secure_allow_empty_referer' => array('lang' => 'SECURE_EMPTY_REFERRER', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'check_attachment_content' => array('lang' => 'CHECK_CONTENT', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
-
'legend2' => $l_legend_cat_images,
'img_display_inlined' => array('lang' => 'DISPLAY_INLINED', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'img_create_thumbnail' => array('lang' => 'CREATE_THUMBNAIL', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
- 'img_max_thumb_width' => array('lang' => 'MAX_THUMB_WIDTH', 'validate' => 'int', 'type' => 'text:7:15', 'explain' => true, 'append' => ' ' . $user->lang['PIXEL']),
- 'img_min_thumb_filesize' => array('lang' => 'MIN_THUMB_FILESIZE', 'validate' => 'int', 'type' => 'text:7:15', 'explain' => true, 'append' => ' ' . $user->lang['BYTES']),
+ 'img_max_thumb_width' => array('lang' => 'MAX_THUMB_WIDTH', 'validate' => 'int:0:999999999999999', 'type' => 'number:0:999999999999999', 'explain' => true, 'append' => ' ' . $user->lang['PIXEL']),
+ 'img_min_thumb_filesize' => array('lang' => 'MIN_THUMB_FILESIZE', 'validate' => 'int:0:999999999999999', 'type' => 'number:0:999999999999999', 'explain' => true, 'append' => ' ' . $user->lang['BYTES']),
'img_imagick' => array('lang' => 'IMAGICK_PATH', 'validate' => 'absolute_path', 'type' => 'text:20:200', 'explain' => true, 'append' => '&nbsp;&nbsp;<span>[ <a href="' . $this->u_action . '&amp;action=imgmagick">' . $user->lang['SEARCH_IMAGICK'] . '</a> ]</span>'),
- 'img_max' => array('lang' => 'MAX_IMAGE_SIZE', 'validate' => 'int', 'type' => 'dimension:3:4', 'explain' => true, 'append' => ' ' . $user->lang['PIXEL']),
- 'img_link' => array('lang' => 'IMAGE_LINK_SIZE', 'validate' => 'int', 'type' => 'dimension:3:4', 'explain' => true, 'append' => ' ' . $user->lang['PIXEL']),
+ 'img_max' => array('lang' => 'MAX_IMAGE_SIZE', 'validate' => 'int:0:9999', 'type' => 'dimension:0:9999', 'explain' => true, 'append' => ' ' . $user->lang['PIXEL']),
+ 'img_link' => array('lang' => 'IMAGE_LINK_SIZE', 'validate' => 'int:0:9999', 'type' => 'dimension:0:9999', 'explain' => true, 'append' => ' ' . $user->lang['PIXEL']),
)
);
+ /**
+ * Event to add and/or modify acp_attachement configurations
+ *
+ * @event core.acp_attachments_config_edit_add
+ * @var array display_vars Array of config values to display and process
+ * @var string mode Mode of the config page we are displaying
+ * @var boolean submit Do we display the form or process the submission
+ * @since 3.1.11-RC1
+ */
+ $vars = array('display_vars', 'mode', 'submit');
+ extract($phpbb_dispatcher->trigger_event('core.acp_attachments_config_edit_add', compact($vars)));
+
$this->new_config = $config;
$cfg_array = (isset($_REQUEST['config'])) ? request_var('config', array('' => '')) : $this->new_config;
$error = array();
@@ -745,7 +786,6 @@ class acp_attachments
}
$template->assign_vars(array(
- 'PHPBB_ROOT_PATH' => $phpbb_root_path,
'IMG_PATH' => $img_path,
'ACTION' => $action,
'GROUP_ID' => $group_id,
@@ -914,7 +954,7 @@ class acp_attachments
$db->sql_query($sql);
add_log('admin', 'LOG_ATTACH_ORPHAN_DEL', implode(', ', $delete_files));
- $notify[] = sprintf($user->lang['LOG_ATTACH_ORPHAN_DEL'], implode(', ', $delete_files));
+ $notify[] = sprintf($user->lang['LOG_ATTACH_ORPHAN_DEL'], implode($user->lang['COMMA_SEPARATOR'], $delete_files));
}
$upload_list = array();
@@ -1043,6 +1083,181 @@ class acp_attachments
$db->sql_freeresult($result);
break;
+
+ case 'manage':
+
+ if ($submit)
+ {
+ $delete_files = (isset($_POST['delete'])) ? array_keys(request_var('delete', array('' => 0))) : array();
+
+ if (sizeof($delete_files))
+ {
+ // Select those attachments we want to delete...
+ $sql = 'SELECT real_filename
+ FROM ' . ATTACHMENTS_TABLE . '
+ WHERE ' . $db->sql_in_set('attach_id', $delete_files) . '
+ AND is_orphan = 0';
+ $result = $db->sql_query($sql);
+ while ($row = $db->sql_fetchrow($result))
+ {
+ $deleted_filenames[] = $row['real_filename'];
+ }
+ $db->sql_freeresult($result);
+
+ if ($num_deleted = delete_attachments('attach', $delete_files))
+ {
+ if (sizeof($delete_files) != $num_deleted)
+ {
+ $error[] = $user->lang['FILES_GONE'];
+ }
+ add_log('admin', 'LOG_ATTACHMENTS_DELETED', implode(', ', $deleted_filenames));
+ $notify[] = sprintf($user->lang['LOG_ATTACHMENTS_DELETED'], implode($user->lang['COMMA_SEPARATOR'], $deleted_filenames));
+ }
+ else
+ {
+ $error[] = $user->lang['NO_FILES_TO_DELETE'];
+ }
+ }
+ }
+
+ if ($action == 'stats')
+ {
+ $this->handle_stats_resync();
+ }
+
+ $stats_error = $this->check_stats_accuracy();
+
+ if ($stats_error)
+ {
+ $error[] = $stats_error;
+ }
+
+ $template->assign_vars(array(
+ 'S_MANAGE' => true,
+ ));
+
+ $start = request_var('start', 0);
+
+ // Sort keys
+ $sort_days = request_var('st', 0);
+ $sort_key = request_var('sk', 't');
+ $sort_dir = request_var('sd', 'd');
+
+ // Sorting
+ $limit_days = array(0 => $user->lang['ALL_ENTRIES'], 1 => $user->lang['1_DAY'], 7 => $user->lang['7_DAYS'], 14 => $user->lang['2_WEEKS'], 30 => $user->lang['1_MONTH'], 90 => $user->lang['3_MONTHS'], 180 => $user->lang['6_MONTHS'], 365 => $user->lang['1_YEAR']);
+ $sort_by_text = array('f' => $user->lang['FILENAME'], 't' => $user->lang['FILEDATE'], 's' => $user->lang['FILESIZE'], 'x' => $user->lang['EXTENSION'], 'd' => $user->lang['DOWNLOADS'],'p' => $user->lang['ATTACH_POST_TYPE'], 'u' => $user->lang['AUTHOR']);
+ $sort_by_sql = array('f' => 'a.real_filename', 't' => 'a.filetime', 's' => 'a.filesize', 'x' => 'a.extension', 'd' => 'a.download_count', 'p' => 'a.in_message', 'u' => 'u.username');
+
+ $s_limit_days = $s_sort_key = $s_sort_dir = $u_sort_param = '';
+ gen_sort_selects($limit_days, $sort_by_text, $sort_days, $sort_key, $sort_dir, $s_limit_days, $s_sort_key, $s_sort_dir, $u_sort_param);
+
+ $min_filetime = ($sort_days) ? (time() - ($sort_days * 86400)) : '';
+ $limit_filetime = ($min_filetime) ? " AND a.filetime >= $min_filetime " : '';
+ $start = ($sort_days && isset($_POST['sort'])) ? 0 : $start;
+
+ $attachments_per_page = (int) $config['topics_per_page'];
+
+ $stats = $this->get_attachment_stats($limit_filetime);
+ $num_files = $stats['num_files'];
+ $total_size = $stats['upload_dir_size'];
+
+ // Make sure $start is set to the last page if it exceeds the amount
+ $pagination = $phpbb_container->get('pagination');
+ $start = $pagination->validate_start($start, $attachments_per_page, $num_files);
+
+ // If the user is trying to reach the second half of the attachments list, fetch it starting from the end
+ $store_reverse = false;
+ $sql_limit = $attachments_per_page;
+
+ if ($start > $num_files / 2)
+ {
+ $store_reverse = true;
+
+ // Select the sort order. Add time sort anchor for non-time sorting cases
+ $sql_sort_anchor = ($sort_key != 't') ? ', a.filetime ' . (($sort_dir == 'd') ? 'ASC' : 'DESC') : '';
+ $sql_sort_order = $sort_by_sql[$sort_key] . ' ' . (($sort_dir == 'd') ? 'ASC' : 'DESC') . $sql_sort_anchor;
+ $sql_limit = $pagination->reverse_limit($start, $sql_limit, $num_files);
+ $sql_start = $pagination->reverse_start($start, $sql_limit, $num_files);
+ }
+ else
+ {
+ // Select the sort order. Add time sort anchor for non-time sorting cases
+ $sql_sort_anchor = ($sort_key != 't') ? ', a.filetime ' . (($sort_dir == 'd') ? 'DESC' : 'ASC') : '';
+ $sql_sort_order = $sort_by_sql[$sort_key] . ' ' . (($sort_dir == 'd') ? 'DESC' : 'ASC') . $sql_sort_anchor;
+ $sql_start = $start;
+ }
+
+ $attachments_list = array();
+
+ // Just get the files
+ $sql = 'SELECT a.*, u.username, u.user_colour, t.topic_title
+ FROM ' . ATTACHMENTS_TABLE . ' a
+ LEFT JOIN ' . USERS_TABLE . ' u ON (u.user_id = a.poster_id)
+ LEFT JOIN ' . TOPICS_TABLE . " t ON (a.topic_id = t.topic_id)
+ WHERE a.is_orphan = 0
+ $limit_filetime
+ ORDER BY $sql_sort_order";
+ $result = $db->sql_query_limit($sql, $sql_limit, $sql_start);
+
+ $i = ($store_reverse) ? $sql_limit - 1 : 0;
+
+ // Store increment value in a variable to save some conditional calls
+ $i_increment = ($store_reverse) ? -1 : 1;
+ while ($attachment_row = $db->sql_fetchrow($result))
+ {
+ $attachments_list[$i] = $attachment_row;
+ $i = $i + $i_increment;
+ }
+ $db->sql_freeresult($result);
+
+ $base_url = $this->u_action . "&amp;$u_sort_param";
+ $pagination->generate_template_pagination($base_url, 'pagination', 'start', $num_files, $attachments_per_page, $start);
+
+ $template->assign_vars(array(
+ 'TOTAL_FILES' => $num_files,
+ 'TOTAL_SIZE' => get_formatted_filesize($total_size),
+
+ 'S_LIMIT_DAYS' => $s_limit_days,
+ 'S_SORT_KEY' => $s_sort_key,
+ 'S_SORT_DIR' => $s_sort_dir)
+ );
+
+ // Grab extensions
+ $extensions = $cache->obtain_attach_extensions(true);
+
+ for ($i = 0, $end = sizeof($attachments_list); $i < $end; ++$i)
+ {
+ $row = $attachments_list[$i];
+
+ $row['extension'] = strtolower(trim((string) $row['extension']));
+ $comment = ($row['attach_comment'] && !$row['in_message']) ? str_replace(array("\n", "\r"), array('<br />', "\n"), $row['attach_comment']) : '';
+ $display_cat = $extensions[$row['extension']]['display_cat'];
+ $l_downloaded_viewed = ($display_cat == ATTACHMENT_CATEGORY_NONE) ? 'DOWNLOAD_COUNTS' : 'VIEWED_COUNTS';
+
+ $template->assign_block_vars('attachments', array(
+ 'ATTACHMENT_POSTER' => get_username_string('full', (int) $row['poster_id'], (string) $row['username'], (string) $row['user_colour'], (string) $row['username']),
+ 'FILESIZE' => get_formatted_filesize((int) $row['filesize']),
+ 'FILETIME' => $user->format_date((int) $row['filetime']),
+ 'REAL_FILENAME' => (!$row['in_message']) ? utf8_basename((string) $row['real_filename']) : '',
+ 'PHYSICAL_FILENAME' => utf8_basename((string) $row['physical_filename']),
+ 'EXT_GROUP_NAME' => (!empty($extensions[$row['extension']]['group_name'])) ? $user->lang['EXT_GROUP_' . $extensions[$row['extension']]['group_name']] : '',
+ 'COMMENT' => $comment,
+ 'TOPIC_TITLE' => (!$row['in_message']) ? (string) $row['topic_title'] : '',
+ 'ATTACH_ID' => (int) $row['attach_id'],
+ 'POST_ID' => (int) $row['post_msg_id'],
+ 'TOPIC_ID' => (int) $row['topic_id'],
+ 'POST_IDS' => (!empty($post_ids[$row['attach_id']])) ? (int) $post_ids[$row['attach_id']] : '',
+
+ 'L_DOWNLOAD_COUNT' => $user->lang($l_downloaded_viewed, (int) $row['download_count']),
+
+ 'S_IN_MESSAGE' => (bool) $row['in_message'],
+
+ 'U_VIEW_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", "t={$row['topic_id']}&amp;p={$row['post_msg_id']}") . "#p{$row['post_msg_id']}",
+ 'U_FILE' => append_sid($phpbb_root_path . 'download/file.' . $phpEx, 'mode=view&amp;id=' . $row['attach_id']))
+ );
+ }
+
+ break;
}
if (sizeof($error))
@@ -1063,6 +1278,96 @@ class acp_attachments
}
/**
+ * Get attachment file count and size of upload directory
+ *
+ * @param $limit string Additional limit for WHERE clause to filter stats by.
+ * @return array Returns array with stats: num_files and upload_dir_size
+ */
+ public function get_attachment_stats($limit = '')
+ {
+ $sql = 'SELECT COUNT(a.attach_id) AS num_files, SUM(a.filesize) AS upload_dir_size
+ FROM ' . ATTACHMENTS_TABLE . " a
+ WHERE a.is_orphan = 0
+ $limit";
+ $result = $this->db->sql_query($sql);
+ $row = $this->db->sql_fetchrow($result);
+ $this->db->sql_freeresult($result);
+
+ return array(
+ 'num_files' => (int) $row['num_files'],
+ 'upload_dir_size' => (float) $row['upload_dir_size'],
+ );
+ }
+
+ /**
+ * Set config attachment stat values
+ *
+ * @param $stats array Array of config key => value pairs to set.
+ * @return null
+ */
+ public function set_attachment_stats($stats)
+ {
+ foreach ($stats as $key => $value)
+ {
+ $this->config->set($key, $value, true);
+ }
+ }
+
+ /**
+ * Check accuracy of attachment statistics.
+ *
+ * @return bool|string Returns false if stats are correct or error message
+ * otherwise.
+ */
+ public function check_stats_accuracy()
+ {
+ // Get fresh stats.
+ $stats = $this->get_attachment_stats();
+
+ // Get current files stats
+ $num_files = (int) $this->config['num_files'];
+ $total_size = (float) $this->config['upload_dir_size'];
+
+ if (($num_files != $stats['num_files']) || ($total_size != $stats['upload_dir_size']))
+ {
+ $u_resync = $this->u_action . '&amp;action=stats';
+
+ return $this->user->lang(
+ 'FILES_STATS_WRONG',
+ (int) $stats['num_files'],
+ get_formatted_filesize($stats['upload_dir_size']),
+ '<a href="' . $u_resync . '">',
+ '</a>'
+ );
+ }
+ return false;
+ }
+
+ /**
+ * Handle stats resync.
+ *
+ * @return null
+ */
+ public function handle_stats_resync()
+ {
+ if (!confirm_box(true))
+ {
+ confirm_box(false, $this->user->lang['RESYNC_FILES_STATS_CONFIRM'], build_hidden_fields(array(
+ 'i' => $this->id,
+ 'mode' => 'manage',
+ 'action' => 'stats',
+ )));
+ }
+ else
+ {
+ $this->set_attachment_stats($this->get_attachment_stats());
+ $log = $this->phpbb_container->get('log');
+ $log->add('admin', $this->user->data['user_id'], $this->user->ip, 'LOG_RESYNC_FILES_STATS');
+ }
+
+ }
+
+ /**
* Build Select for category items
*/
function category_select($select_name, $group_id = false, $key = '')
@@ -1133,7 +1438,7 @@ class acp_attachments
$row['group_name'] = $user->lang['NOT_ASSIGNED'];
$group_name[] = $row;
- for ($i = 0; $i < sizeof($group_name); $i++)
+ for ($i = 0, $groups_size = sizeof($group_name); $i < $groups_size; $i++)
{
if ($default_group === false)
{
@@ -1235,6 +1540,7 @@ class acp_attachments
function perform_site_list()
{
global $db, $user;
+ global $request;
if (isset($_REQUEST['securesubmit']))
{
@@ -1243,7 +1549,7 @@ class acp_attachments
$ip_list = array_unique(explode("\n", $ips));
$ip_list_log = implode(', ', $ip_list);
- $ip_exclude = (!empty($_POST['ipexclude'])) ? 1 : 0;
+ $ip_exclude = (int) $request->variable('ipexclude', false, false, \phpbb\request\request_interface::POST);
$iplist = array();
$hostlist = array();
@@ -1441,7 +1747,8 @@ class acp_attachments
$size_var = $filesize['si_identifier'];
$value = $filesize['value'];
- return '<input type="text" id="' . $key . '" size="8" maxlength="15" name="config[' . $key . ']" value="' . $value . '" /> <select name="' . $key . '">' . size_select_options($size_var) . '</select>';
+ // size and maxlength must not be specified for input of type number
+ return '<input type="number" id="' . $key . '" min="0" max="999999999999999" step="any" name="config[' . $key . ']" value="' . $value . '" /> <select name="' . $key . '">' . size_select_options($size_var) . '</select>';
}
/**
@@ -1455,5 +1762,3 @@ class acp_attachments
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/acp/acp_ban.php b/phpBB/includes/acp/acp_ban.php
index f8af1b86e1..286bc92813 100644
--- a/phpBB/includes/acp/acp_ban.php
+++ b/phpBB/includes/acp/acp_ban.php
@@ -1,10 +1,13 @@
<?php
/**
*
-* @package acp
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -16,23 +19,22 @@ if (!defined('IN_PHPBB'))
exit;
}
-/**
-* @package acp
-*/
class acp_ban
{
var $u_action;
function main($id, $mode)
{
- global $config, $db, $user, $auth, $template, $cache;
- global $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix;
+ global $user, $template, $request, $phpbb_dispatcher;
+ global $phpbb_root_path, $phpEx;
- include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
+ if (!function_exists('user_ban'))
+ {
+ include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
+ }
- $bansubmit = (isset($_POST['bansubmit'])) ? true : false;
- $unbansubmit = (isset($_POST['unbansubmit'])) ? true : false;
- $current_time = time();
+ $bansubmit = $request->is_set_post('bansubmit');
+ $unbansubmit = $request->is_set_post('unbansubmit');
$user->add_lang(array('acp/ban', 'acp/users'));
$this->tpl_name = 'acp_ban';
@@ -48,23 +50,79 @@ class acp_ban
if ($bansubmit)
{
// Grab the list of entries
- $ban = utf8_normalize_nfc(request_var('ban', '', true));
- $ban_len = request_var('banlength', 0);
- $ban_len_other = request_var('banlengthother', '');
- $ban_exclude = request_var('banexclude', 0);
- $ban_reason = utf8_normalize_nfc(request_var('banreason', '', true));
- $ban_give_reason = utf8_normalize_nfc(request_var('bangivereason', '', true));
+ $ban = $request->variable('ban', '', true);
+ $ban_length = $request->variable('banlength', 0);
+ $ban_length_other = $request->variable('banlengthother', '');
+ $ban_exclude = $request->variable('banexclude', 0);
+ $ban_reason = $request->variable('banreason', '', true);
+ $ban_give_reason = $request->variable('bangivereason', '', true);
if ($ban)
{
- user_ban($mode, $ban, $ban_len, $ban_len_other, $ban_exclude, $ban_reason, $ban_give_reason);
+ $abort_ban = false;
+ /**
+ * Use this event to modify the ban details before the ban is performed
+ *
+ * @event core.acp_ban_before
+ * @var string mode One of the following: user, ip, email
+ * @var string ban Either string or array with usernames, ips or email addresses
+ * @var int ban_length Ban length in minutes
+ * @var string ban_length_other Ban length as a date (YYYY-MM-DD)
+ * @var bool ban_exclude Are we banning or excluding from another ban
+ * @var string ban_reason Ban reason displayed to moderators
+ * @var string ban_give_reason Ban reason displayed to the banned user
+ * @var mixed abort_ban Either false, or an error message that is displayed to the user.
+ * If a string is given the bans are not issued.
+ * @since 3.1.0-RC5
+ */
+ $vars = array(
+ 'mode',
+ 'ban',
+ 'ban_length',
+ 'ban_length_other',
+ 'ban_exclude',
+ 'ban_reason',
+ 'ban_give_reason',
+ 'abort_ban',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.acp_ban_before', compact($vars)));
+
+ if ($abort_ban)
+ {
+ trigger_error($abort_ban . adm_back_link($this->u_action));
+ }
+ user_ban($mode, $ban, $ban_length, $ban_length_other, $ban_exclude, $ban_reason, $ban_give_reason);
+
+ /**
+ * Use this event to perform actions after the ban has been performed
+ *
+ * @event core.acp_ban_after
+ * @var string mode One of the following: user, ip, email
+ * @var string ban Either string or array with usernames, ips or email addresses
+ * @var int ban_length Ban length in minutes
+ * @var string ban_length_other Ban length as a date (YYYY-MM-DD)
+ * @var bool ban_exclude Are we banning or excluding from another ban
+ * @var string ban_reason Ban reason displayed to moderators
+ * @var string ban_give_reason Ban reason displayed to the banned user
+ * @since 3.1.0-RC5
+ */
+ $vars = array(
+ 'mode',
+ 'ban',
+ 'ban_length',
+ 'ban_length_other',
+ 'ban_exclude',
+ 'ban_reason',
+ 'ban_give_reason',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.acp_ban_after', compact($vars)));
trigger_error($user->lang['BAN_UPDATE_SUCCESSFUL'] . adm_back_link($this->u_action));
}
}
else if ($unbansubmit)
{
- $ban = request_var('unban', array(''));
+ $ban = $request->variable('unban', array(''));
if ($ban)
{
@@ -98,7 +156,7 @@ class acp_ban
break;
}
- $this->display_ban_options($mode);
+ self::display_ban_options($mode);
$template->assign_vars(array(
'L_TITLE' => $this->page_title,
@@ -110,7 +168,7 @@ class acp_ban
'L_NO_BAN_CELL' => $l_no_ban_cell,
'S_USERNAME_BAN' => ($mode == 'user') ? true : false,
-
+
'U_ACTION' => $this->u_action,
'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&amp;form=acp_ban&amp;field=ban'),
));
@@ -119,7 +177,7 @@ class acp_ban
/**
* Display ban options
*/
- function display_ban_options($mode)
+ static public function display_ban_options($mode)
{
global $user, $db, $template;
@@ -176,8 +234,6 @@ class acp_ban
$result = $db->sql_query($sql);
$banned_options = $excluded_options = array();
- $ban_length = $ban_reasons = $ban_give_reasons = array();
-
while ($row = $db->sql_fetchrow($result))
{
$option = '<option value="' . $row['ban_id'] . '">' . $row[$field] . '</option>';
@@ -196,60 +252,31 @@ class acp_ban
if ($time_length == 0)
{
// Banned permanently
- $ban_length[$row['ban_id']] = $user->lang['PERMANENT'];
+ $ban_length = $user->lang['PERMANENT'];
}
else if (isset($ban_end_text[$time_length]))
{
// Banned for a given duration
- $ban_length[$row['ban_id']] = sprintf($user->lang['BANNED_UNTIL_DURATION'], $ban_end_text[$time_length], $user->format_date($row['ban_end'], false, true));
+ $ban_length = $user->lang('BANNED_UNTIL_DURATION', $ban_end_text[$time_length], $user->format_date($row['ban_end'], false, true));
}
else
{
// Banned until given date
- $ban_length[$row['ban_id']] = sprintf($user->lang['BANNED_UNTIL_DATE'], $user->format_date($row['ban_end'], false, true));
+ $ban_length = $user->lang('BANNED_UNTIL_DATE', $user->format_date($row['ban_end'], false, true));
}
- $ban_reasons[$row['ban_id']] = $row['ban_reason'];
- $ban_give_reasons[$row['ban_id']] = $row['ban_give_reason'];
+ $template->assign_block_vars('bans', array(
+ 'BAN_ID' => (int) $row['ban_id'],
+ 'LENGTH' => $ban_length,
+ 'A_LENGTH' => addslashes($ban_length),
+ 'REASON' => $row['ban_reason'],
+ 'A_REASON' => addslashes($row['ban_reason']),
+ 'GIVE_REASON' => $row['ban_give_reason'],
+ 'A_GIVE_REASON' => addslashes($row['ban_give_reason']),
+ ));
}
$db->sql_freeresult($result);
- if (sizeof($ban_length))
- {
- foreach ($ban_length as $ban_id => $length)
- {
- $template->assign_block_vars('ban_length', array(
- 'BAN_ID' => (int) $ban_id,
- 'LENGTH' => $length,
- 'A_LENGTH' => addslashes($length),
- ));
- }
- }
-
- if (sizeof($ban_reasons))
- {
- foreach ($ban_reasons as $ban_id => $reason)
- {
- $template->assign_block_vars('ban_reason', array(
- 'BAN_ID' => $ban_id,
- 'REASON' => $reason,
- 'A_REASON' => addslashes($reason),
- ));
- }
- }
-
- if (sizeof($ban_give_reasons))
- {
- foreach ($ban_give_reasons as $ban_id => $reason)
- {
- $template->assign_block_vars('ban_give_reason', array(
- 'BAN_ID' => $ban_id,
- 'REASON' => $reason,
- 'A_REASON' => addslashes($reason),
- ));
- }
- }
-
$options = '';
if ($excluded_options)
{
@@ -272,5 +299,3 @@ class acp_ban
));
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/acp/acp_bbcodes.php b/phpBB/includes/acp/acp_bbcodes.php
index 31166a56dc..c98be241e9 100644
--- a/phpBB/includes/acp/acp_bbcodes.php
+++ b/phpBB/includes/acp/acp_bbcodes.php
@@ -1,10 +1,13 @@
<?php
/**
*
-* @package acp
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -16,16 +19,13 @@ if (!defined('IN_PHPBB'))
exit;
}
-/**
-* @package acp
-*/
class acp_bbcodes
{
var $u_action;
function main($id, $mode)
{
- global $db, $user, $auth, $template, $cache;
+ global $db, $user, $auth, $template, $cache, $request, $phpbb_dispatcher;
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
$user->add_lang('acp/posting');
@@ -33,6 +33,7 @@ class acp_bbcodes
// Set up general vars
$action = request_var('action', '');
$bbcode_id = request_var('bbcode', 0);
+ $submit = $request->is_set_post('submit');
$this->tpl_name = 'acp_bbcodes';
$this->page_title = 'ACP_BBCODES';
@@ -40,6 +41,11 @@ class acp_bbcodes
add_form_key($form_key);
+ if ($submit && !check_form_key($form_key))
+ {
+ trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING);
+ }
+
// Set up mode-specific vars
switch ($action)
{
@@ -97,7 +103,7 @@ class acp_bbcodes
case 'edit':
case 'add':
- $template->assign_vars(array(
+ $tpl_ary = array(
'S_EDIT_BBCODE' => true,
'U_BACK' => $this->u_action,
'U_ACTION' => $this->u_action . '&amp;action=' . (($action == 'add') ? 'create' : 'modify') . (($bbcode_id) ? "&amp;bbcode=$bbcode_id" : ''),
@@ -106,14 +112,32 @@ class acp_bbcodes
'BBCODE_MATCH' => $bbcode_match,
'BBCODE_TPL' => $bbcode_tpl,
'BBCODE_HELPLINE' => $bbcode_helpline,
- 'DISPLAY_ON_POSTING' => $display_on_posting)
+ 'DISPLAY_ON_POSTING' => $display_on_posting,
);
- foreach ($user->lang['tokens'] as $token => $token_explain)
+ $bbcode_tokens = array('TEXT', 'SIMPLETEXT', 'INTTEXT', 'IDENTIFIER', 'NUMBER', 'EMAIL', 'URL', 'LOCAL_URL', 'RELATIVE_URL', 'COLOR');
+
+ /**
+ * Modify custom bbcode template data before we display the add/edit form
+ *
+ * @event core.acp_bbcodes_edit_add
+ * @var string action Type of the action: add|edit
+ * @var array tpl_ary Array with custom bbcode add/edit data
+ * @var int bbcode_id When editing: the bbcode id,
+ * when creating: 0
+ * @var array bbcode_tokens Array of bbcode tokens
+ * @since 3.1.0-a3
+ */
+ $vars = array('action', 'tpl_ary', 'bbcode_id', 'bbcode_tokens');
+ extract($phpbb_dispatcher->trigger_event('core.acp_bbcodes_edit_add', compact($vars)));
+
+ $template->assign_vars($tpl_ary);
+
+ foreach ($bbcode_tokens as $token)
{
$template->assign_block_vars('token', array(
'TOKEN' => '{' . $token . '}',
- 'EXPLAIN' => ($token === 'LOCAL_URL') ? sprintf($token_explain, generate_board_url() . '/') : $token_explain,
+ 'EXPLAIN' => ($token === 'LOCAL_URL') ? $user->lang(array('tokens', $token), generate_board_url() . '/') : $user->lang(array('tokens', $token)),
));
}
@@ -124,6 +148,36 @@ class acp_bbcodes
case 'modify':
case 'create':
+ $sql_ary = $hidden_fields = array();
+
+ /**
+ * Modify custom bbcode data before the modify/create action
+ *
+ * @event core.acp_bbcodes_modify_create
+ * @var string action Type of the action: modify|create
+ * @var array sql_ary Array with new bbcode data
+ * @var int bbcode_id When editing: the bbcode id,
+ * when creating: 0
+ * @var bool display_on_posting Display bbcode on posting form
+ * @var string bbcode_match The bbcode usage string to match
+ * @var string bbcode_tpl The bbcode HTML replacement string
+ * @var string bbcode_helpline The bbcode help line string
+ * @var array hidden_fields Array of hidden fields for use when
+ * submitting form when $warn_text is true
+ * @since 3.1.0-a3
+ */
+ $vars = array(
+ 'action',
+ 'sql_ary',
+ 'bbcode_id',
+ 'display_on_posting',
+ 'bbcode_match',
+ 'bbcode_tpl',
+ 'bbcode_helpline',
+ 'hidden_fields',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.acp_bbcodes_modify_create', compact($vars)));
+
$warn_text = preg_match('%<[^>]*\{text[\d]*\}[^>]*>%i', $bbcode_tpl);
if (!$warn_text || confirm_box(true))
{
@@ -172,13 +226,12 @@ class acp_bbcodes
trigger_error($user->lang['BBCODE_TAG_DEF_TOO_LONG'] . adm_back_link($this->u_action), E_USER_WARNING);
}
-
if (strlen($bbcode_helpline) > 255)
{
trigger_error($user->lang['BBCODE_HELPLINE_TOO_LONG'] . adm_back_link($this->u_action), E_USER_WARNING);
}
- $sql_ary = array(
+ $sql_ary = array_merge($sql_ary, array(
'bbcode_tag' => $data['bbcode_tag'],
'bbcode_match' => $bbcode_match,
'bbcode_tpl' => $bbcode_tpl,
@@ -188,7 +241,7 @@ class acp_bbcodes
'first_pass_replace' => $data['first_pass_replace'],
'second_pass_match' => $data['second_pass_match'],
'second_pass_replace' => $data['second_pass_replace']
- );
+ ));
if ($action == 'create')
{
@@ -244,14 +297,14 @@ class acp_bbcodes
}
else
{
- confirm_box(false, $user->lang['BBCODE_DANGER'], build_hidden_fields(array(
+ confirm_box(false, $user->lang['BBCODE_DANGER'], build_hidden_fields(array_merge($hidden_fields, array(
'action' => $action,
'bbcode' => $bbcode_id,
'bbcode_match' => $bbcode_match,
'bbcode_tpl' => htmlspecialchars($bbcode_tpl),
'bbcode_helpline' => $bbcode_helpline,
'display_on_posting' => $display_on_posting,
- ))
+ )))
, 'confirm_bbcode.html');
}
@@ -273,6 +326,18 @@ class acp_bbcodes
$db->sql_query('DELETE FROM ' . BBCODES_TABLE . " WHERE bbcode_id = $bbcode_id");
$cache->destroy('sql', BBCODES_TABLE);
add_log('admin', 'LOG_BBCODE_DELETE', $row['bbcode_tag']);
+
+ if ($request->is_ajax())
+ {
+ $json_response = new \phpbb\json_response;
+ $json_response->send(array(
+ 'MESSAGE_TITLE' => $user->lang['INFORMATION'],
+ 'MESSAGE_TEXT' => $user->lang['BBCODE_DELETED'],
+ 'REFRESH_DATA' => array(
+ 'time' => 3
+ )
+ ));
+ }
}
else
{
@@ -288,22 +353,57 @@ class acp_bbcodes
break;
}
- $template->assign_vars(array(
- 'U_ACTION' => $this->u_action . '&amp;action=add')
+ $u_action = $this->u_action;
+
+ $template_data = array(
+ 'U_ACTION' => $this->u_action . '&amp;action=add',
+ );
+
+ $sql_ary = array(
+ 'SELECT' => 'b.*',
+ 'FROM' => array(BBCODES_TABLE => 'b'),
+ 'ORDER_BY' => 'b.bbcode_tag',
);
- $sql = 'SELECT *
- FROM ' . BBCODES_TABLE . '
- ORDER BY bbcode_tag';
- $result = $db->sql_query($sql);
+ /**
+ * Modify custom bbcode template data before we display the form
+ *
+ * @event core.acp_bbcodes_display_form
+ * @var string action Type of the action: modify|create
+ * @var array sql_ary The SQL array to get custom bbcode data
+ * @var array template_data Array with form template data
+ * @var string u_action The u_action link
+ * @since 3.1.0-a3
+ */
+ $vars = array('action', 'sql_ary', 'template_data', 'u_action');
+ extract($phpbb_dispatcher->trigger_event('core.acp_bbcodes_display_form', compact($vars)));
+
+ $result = $db->sql_query($db->sql_build_query('SELECT', $sql_ary));
+
+ $template->assign_vars($template_data);
while ($row = $db->sql_fetchrow($result))
{
- $template->assign_block_vars('bbcodes', array(
+ $bbcodes_array = array(
'BBCODE_TAG' => $row['bbcode_tag'],
- 'U_EDIT' => $this->u_action . '&amp;action=edit&amp;bbcode=' . $row['bbcode_id'],
- 'U_DELETE' => $this->u_action . '&amp;action=delete&amp;bbcode=' . $row['bbcode_id'])
+ 'U_EDIT' => $u_action . '&amp;action=edit&amp;bbcode=' . $row['bbcode_id'],
+ 'U_DELETE' => $u_action . '&amp;action=delete&amp;bbcode=' . $row['bbcode_id'],
);
+
+ /**
+ * Modify display of custom bbcodes in the form
+ *
+ * @event core.acp_bbcodes_display_bbcodes
+ * @var array row Array with current bbcode data
+ * @var array bbcodes_array Array of bbcodes template data
+ * @var string u_action The u_action link
+ * @since 3.1.0-a3
+ */
+ $vars = array('bbcodes_array', 'row', 'u_action');
+ extract($phpbb_dispatcher->trigger_event('core.acp_bbcodes_display_bbcodes', compact($vars)));
+
+ $template->assign_block_vars('bbcodes', $bbcodes_array);
+
}
$db->sql_freeresult($result);
}
@@ -315,18 +415,11 @@ class acp_bbcodes
{
$bbcode_match = trim($bbcode_match);
$bbcode_tpl = trim($bbcode_tpl);
- $utf8 = strpos($bbcode_match, 'INTTEXT') !== false;
- // make sure we have utf8 support
- $utf8_pcre_properties = false;
- if (version_compare(PHP_VERSION, '5.1.0', '>=') || (version_compare(PHP_VERSION, '5.0.0-dev', '<=') && version_compare(PHP_VERSION, '4.4.0', '>=')))
- {
- // While this is the proper range of PHP versions, PHP may not be linked with the bundled PCRE lib and instead with an older version
- if (@preg_match('/\p{L}/u', 'a') !== false)
- {
- $utf8_pcre_properties = true;
- }
- }
+ // Allow unicode characters for URL|LOCAL_URL|RELATIVE_URL|INTTEXT tokens
+ $utf8 = preg_match('/(URL|LOCAL_URL|RELATIVE_URL|INTTEXT)/', $bbcode_match);
+
+ $utf8_pcre_properties = phpbb_pcre_utf8_support();
$fp_match = preg_quote($bbcode_match, '!');
$fp_replace = preg_replace('#^\[(.*?)\]#', '[$1:$uid]', $bbcode_match);
@@ -480,5 +573,3 @@ class acp_bbcodes
);
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/acp/acp_board.php b/phpBB/includes/acp/acp_board.php
index 526d8e05da..5c3c7f30aa 100644
--- a/phpBB/includes/acp/acp_board.php
+++ b/phpBB/includes/acp/acp_board.php
@@ -1,11 +1,17 @@
<?php
/**
*
-* @package acp
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+/**
* @todo add cron intervals to server settings? (database_gc, queue_interval, session_gc, search_gc, cache_gc, warnings_gc)
*/
@@ -17,19 +23,16 @@ if (!defined('IN_PHPBB'))
exit;
}
-/**
-* @package acp
-*/
class acp_board
{
var $u_action;
- var $new_config = array();
+ var $new_config;
function main($id, $mode)
{
global $db, $user, $auth, $template;
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
- global $cache;
+ global $cache, $phpbb_container, $phpbb_dispatcher;
$user->add_lang('acp/board');
@@ -54,19 +57,24 @@ class acp_board
'legend1' => 'ACP_BOARD_SETTINGS',
'sitename' => array('lang' => 'SITE_NAME', 'validate' => 'string', 'type' => 'text:40:255', 'explain' => false),
'site_desc' => array('lang' => 'SITE_DESC', 'validate' => 'string', 'type' => 'text:40:255', 'explain' => false),
+ 'site_home_url' => array('lang' => 'SITE_HOME_URL', 'validate' => 'string', 'type' => 'url:40:255', 'explain' => true),
+ 'site_home_text' => array('lang' => 'SITE_HOME_TEXT', 'validate' => 'string', 'type' => 'text:40:255', 'explain' => true),
+ 'board_index_text' => array('lang' => 'BOARD_INDEX_TEXT', 'validate' => 'string', 'type' => 'text:40:255', 'explain' => true),
'board_disable' => array('lang' => 'DISABLE_BOARD', 'validate' => 'bool', 'type' => 'custom', 'method' => 'board_disable', 'explain' => true),
'board_disable_msg' => false,
'default_lang' => array('lang' => 'DEFAULT_LANGUAGE', 'validate' => 'lang', 'type' => 'select', 'function' => 'language_select', 'params' => array('{CONFIG_VALUE}'), 'explain' => false),
'default_dateformat' => array('lang' => 'DEFAULT_DATE_FORMAT', 'validate' => 'string', 'type' => 'custom', 'method' => 'dateformat_select', 'explain' => true),
- 'board_timezone' => array('lang' => 'SYSTEM_TIMEZONE', 'validate' => 'string', 'type' => 'select', 'function' => 'tz_select', 'params' => array('{CONFIG_VALUE}', 1), 'explain' => true),
- 'board_dst' => array('lang' => 'SYSTEM_DST', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
- 'default_style' => array('lang' => 'DEFAULT_STYLE', 'validate' => 'int', 'type' => 'select', 'function' => 'style_select', 'params' => array('{CONFIG_VALUE}', false), 'explain' => false),
+ 'board_timezone' => array('lang' => 'SYSTEM_TIMEZONE', 'validate' => 'timezone', 'type' => 'custom', 'method' => 'timezone_select', 'explain' => true),
+
+ 'legend2' => 'BOARD_STYLE',
+ 'default_style' => array('lang' => 'DEFAULT_STYLE', 'validate' => 'int', 'type' => 'select', 'function' => 'style_select', 'params' => array('{CONFIG_VALUE}', false), 'explain' => true),
+ 'guest_style' => array('lang' => 'GUEST_STYLE', 'validate' => 'int', 'type' => 'select', 'function' => 'style_select', 'params' => array($this->guest_style_get(), false), 'explain' => true),
'override_user_style' => array('lang' => 'OVERRIDE_STYLE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
- 'legend2' => 'WARNINGS',
- 'warnings_expire_days' => array('lang' => 'WARNINGS_EXPIRE', 'validate' => 'int', 'type' => 'text:3:4', 'explain' => true, 'append' => ' ' . $user->lang['DAYS']),
+ 'legend3' => 'WARNINGS',
+ 'warnings_expire_days' => array('lang' => 'WARNINGS_EXPIRE', 'validate' => 'int:0:9999', 'type' => 'number:0:9999', 'explain' => true, 'append' => ' ' . $user->lang['DAYS']),
- 'legend3' => 'ACP_SUBMIT_CHANGES',
+ 'legend4' => 'ACP_SUBMIT_CHANGES',
)
);
break;
@@ -89,6 +97,7 @@ class acp_board
'allow_nocensors' => array('lang' => 'ALLOW_NO_CENSORS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'allow_bookmarks' => array('lang' => 'ALLOW_BOOKMARKS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'allow_birthdays' => array('lang' => 'ALLOW_BIRTHDAYS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
+ 'display_last_subject' => array('lang' => 'DISPLAY_LAST_SUBJECT', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'allow_quick_reply' => array('lang' => 'ALLOW_QUICK_REPLY', 'validate' => 'bool', 'type' => 'custom', 'method' => 'quick_reply', 'explain' => true),
'legend2' => 'ACP_LOAD_SETTINGS',
@@ -96,6 +105,7 @@ class acp_board
'load_moderators' => array('lang' => 'YES_MODERATORS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
'load_jumpbox' => array('lang' => 'YES_JUMPBOX', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
'load_cpf_memberlist' => array('lang' => 'LOAD_CPF_MEMBERLIST', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
+ 'load_cpf_pm' => array('lang' => 'LOAD_CPF_PM', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
'load_cpf_viewprofile' => array('lang' => 'LOAD_CPF_VIEWPROFILE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
'load_cpf_viewtopic' => array('lang' => 'LOAD_CPF_VIEWTOPIC', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
@@ -105,28 +115,43 @@ class acp_board
break;
case 'avatar':
+ $phpbb_avatar_manager = $phpbb_container->get('avatar.manager');
+ $avatar_drivers = $phpbb_avatar_manager->get_all_drivers();
+
+ $avatar_vars = array();
+ foreach ($avatar_drivers as $current_driver)
+ {
+ $driver = $phpbb_avatar_manager->get_driver($current_driver, false);
+
+ /*
+ * First grab the settings for enabling/disabling the avatar
+ * driver and afterwards grab additional settings the driver
+ * might have.
+ */
+ $avatar_vars += $phpbb_avatar_manager->get_avatar_settings($driver);
+ $avatar_vars += $driver->prepare_form_acp($user);
+ }
+
$display_vars = array(
'title' => 'ACP_AVATAR_SETTINGS',
'vars' => array(
'legend1' => 'ACP_AVATAR_SETTINGS',
- 'avatar_min_width' => array('lang' => 'MIN_AVATAR_SIZE', 'validate' => 'int:0', 'type' => false, 'method' => false, 'explain' => false,),
- 'avatar_min_height' => array('lang' => 'MIN_AVATAR_SIZE', 'validate' => 'int:0', 'type' => false, 'method' => false, 'explain' => false,),
- 'avatar_max_width' => array('lang' => 'MAX_AVATAR_SIZE', 'validate' => 'int:0', 'type' => false, 'method' => false, 'explain' => false,),
- 'avatar_max_height' => array('lang' => 'MAX_AVATAR_SIZE', 'validate' => 'int:0', 'type' => false, 'method' => false, 'explain' => false,),
+ 'avatar_min_width' => array('lang' => 'MIN_AVATAR_SIZE', 'validate' => 'int:0', 'type' => false, 'method' => false, 'explain' => false),
+ 'avatar_min_height' => array('lang' => 'MIN_AVATAR_SIZE', 'validate' => 'int:0', 'type' => false, 'method' => false, 'explain' => false),
+ 'avatar_max_width' => array('lang' => 'MAX_AVATAR_SIZE', 'validate' => 'int:0', 'type' => false, 'method' => false, 'explain' => false),
+ 'avatar_max_height' => array('lang' => 'MAX_AVATAR_SIZE', 'validate' => 'int:0', 'type' => false, 'method' => false, 'explain' => false),
'allow_avatar' => array('lang' => 'ALLOW_AVATARS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
- 'allow_avatar_local' => array('lang' => 'ALLOW_LOCAL', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
- 'allow_avatar_remote' => array('lang' => 'ALLOW_REMOTE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
- 'allow_avatar_upload' => array('lang' => 'ALLOW_UPLOAD', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
- 'allow_avatar_remote_upload'=> array('lang' => 'ALLOW_REMOTE_UPLOAD', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
- 'avatar_filesize' => array('lang' => 'MAX_FILESIZE', 'validate' => 'int:0', 'type' => 'text:4:10', 'explain' => true, 'append' => ' ' . $user->lang['BYTES']),
- 'avatar_min' => array('lang' => 'MIN_AVATAR_SIZE', 'validate' => 'int:0', 'type' => 'dimension:3:4', 'explain' => true, 'append' => ' ' . $user->lang['PIXEL']),
- 'avatar_max' => array('lang' => 'MAX_AVATAR_SIZE', 'validate' => 'int:0', 'type' => 'dimension:3:4', 'explain' => true, 'append' => ' ' . $user->lang['PIXEL']),
- 'avatar_path' => array('lang' => 'AVATAR_STORAGE_PATH', 'validate' => 'rpath', 'type' => 'text:20:255', 'explain' => true),
- 'avatar_gallery_path' => array('lang' => 'AVATAR_GALLERY_PATH', 'validate' => 'rpath', 'type' => 'text:20:255', 'explain' => true)
+ 'avatar_min' => array('lang' => 'MIN_AVATAR_SIZE', 'validate' => 'int:0', 'type' => 'dimension:0', 'explain' => true, 'append' => ' ' . $user->lang['PIXEL']),
+ 'avatar_max' => array('lang' => 'MAX_AVATAR_SIZE', 'validate' => 'int:0', 'type' => 'dimension:0', 'explain' => true, 'append' => ' ' . $user->lang['PIXEL']),
)
);
+
+ if (!empty($avatar_vars))
+ {
+ $display_vars['vars'] += $avatar_vars;
+ }
break;
case 'message':
@@ -136,11 +161,11 @@ class acp_board
'vars' => array(
'legend1' => 'GENERAL_SETTINGS',
'allow_privmsg' => array('lang' => 'BOARD_PM', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
- 'pm_max_boxes' => array('lang' => 'BOXES_MAX', 'validate' => 'int:0', 'type' => 'text:4:4', 'explain' => true),
- 'pm_max_msgs' => array('lang' => 'BOXES_LIMIT', 'validate' => 'int:0', 'type' => 'text:4:4', 'explain' => true),
+ 'pm_max_boxes' => array('lang' => 'BOXES_MAX', 'validate' => 'int:0:9999', 'type' => 'number:0:9999', 'explain' => true),
+ 'pm_max_msgs' => array('lang' => 'BOXES_LIMIT', 'validate' => 'int:0:9999', 'type' => 'number:0:9999', 'explain' => true),
'full_folder_action' => array('lang' => 'FULL_FOLDER_ACTION', 'validate' => 'int', 'type' => 'select', 'method' => 'full_folder_select', 'explain' => true),
- 'pm_edit_time' => array('lang' => 'PM_EDIT_TIME', 'validate' => 'int:0', 'type' => 'text:5:5', 'explain' => true, 'append' => ' ' . $user->lang['MINUTES']),
- 'pm_max_recipients' => array('lang' => 'PM_MAX_RECIPIENTS', 'validate' => 'int:0', 'type' => 'text:5:5', 'explain' => true),
+ 'pm_edit_time' => array('lang' => 'PM_EDIT_TIME', 'validate' => 'int:0:99999', 'type' => 'number:0:99999', 'explain' => true, 'append' => ' ' . $user->lang['MINUTES']),
+ 'pm_max_recipients' => array('lang' => 'PM_MAX_RECIPIENTS', 'validate' => 'int:0:99999', 'type' => 'number:0:99999', 'explain' => true),
'legend2' => 'GENERAL_OPTIONS',
'allow_mass_pm' => array('lang' => 'ALLOW_MASS_PM', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
@@ -177,24 +202,24 @@ class acp_board
'legend2' => 'POSTING',
'bump_type' => false,
- 'edit_time' => array('lang' => 'EDIT_TIME', 'validate' => 'int:0', 'type' => 'text:5:5', 'explain' => true, 'append' => ' ' . $user->lang['MINUTES']),
- 'delete_time' => array('lang' => 'DELETE_TIME', 'validate' => 'int:0', 'type' => 'text:5:5', 'explain' => true, 'append' => ' ' . $user->lang['MINUTES']),
+ 'edit_time' => array('lang' => 'EDIT_TIME', 'validate' => 'int:0:99999', 'type' => 'number:0:99999', 'explain' => true, 'append' => ' ' . $user->lang['MINUTES']),
+ 'delete_time' => array('lang' => 'DELETE_TIME', 'validate' => 'int:0:99999', 'type' => 'number:0:99999', 'explain' => true, 'append' => ' ' . $user->lang['MINUTES']),
'display_last_edited' => array('lang' => 'DISPLAY_LAST_EDITED', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
- 'flood_interval' => array('lang' => 'FLOOD_INTERVAL', 'validate' => 'int:0', 'type' => 'text:3:10', 'explain' => true, 'append' => ' ' . $user->lang['SECONDS']),
+ 'flood_interval' => array('lang' => 'FLOOD_INTERVAL', 'validate' => 'int:0:9999999999', 'type' => 'number:0:9999999999', 'explain' => true, 'append' => ' ' . $user->lang['SECONDS']),
'bump_interval' => array('lang' => 'BUMP_INTERVAL', 'validate' => 'int:0', 'type' => 'custom', 'method' => 'bump_interval', 'explain' => true),
- 'topics_per_page' => array('lang' => 'TOPICS_PER_PAGE', 'validate' => 'int:1', 'type' => 'text:3:4', 'explain' => false),
- 'posts_per_page' => array('lang' => 'POSTS_PER_PAGE', 'validate' => 'int:1', 'type' => 'text:3:4', 'explain' => false),
- 'smilies_per_page' => array('lang' => 'SMILIES_PER_PAGE', 'validate' => 'int:1', 'type' => 'text:3:4', 'explain' => false),
- 'hot_threshold' => array('lang' => 'HOT_THRESHOLD', 'validate' => 'int:0', 'type' => 'text:3:4', 'explain' => true),
- 'max_poll_options' => array('lang' => 'MAX_POLL_OPTIONS', 'validate' => 'int:2:127', 'type' => 'text:4:4', 'explain' => false),
- 'max_post_chars' => array('lang' => 'CHAR_LIMIT', 'validate' => 'int:0', 'type' => 'text:4:6', 'explain' => true),
- 'min_post_chars' => array('lang' => 'MIN_CHAR_LIMIT', 'validate' => 'int:1', 'type' => 'text:4:6', 'explain' => true),
- 'max_post_smilies' => array('lang' => 'SMILIES_LIMIT', 'validate' => 'int:0', 'type' => 'text:4:4', 'explain' => true),
- 'max_post_urls' => array('lang' => 'MAX_POST_URLS', 'validate' => 'int:0', 'type' => 'text:5:4', 'explain' => true),
- 'max_post_font_size' => array('lang' => 'MAX_POST_FONT_SIZE', 'validate' => 'int:0', 'type' => 'text:5:4', 'explain' => true, 'append' => ' %'),
- 'max_quote_depth' => array('lang' => 'QUOTE_DEPTH_LIMIT', 'validate' => 'int:0', 'type' => 'text:4:4', 'explain' => true),
- 'max_post_img_width' => array('lang' => 'MAX_POST_IMG_WIDTH', 'validate' => 'int:0', 'type' => 'text:5:4', 'explain' => true, 'append' => ' ' . $user->lang['PIXEL']),
- 'max_post_img_height' => array('lang' => 'MAX_POST_IMG_HEIGHT', 'validate' => 'int:0', 'type' => 'text:5:4', 'explain' => true, 'append' => ' ' . $user->lang['PIXEL']),
+ 'topics_per_page' => array('lang' => 'TOPICS_PER_PAGE', 'validate' => 'int:1:9999', 'type' => 'number:1:9999', 'explain' => false),
+ 'posts_per_page' => array('lang' => 'POSTS_PER_PAGE', 'validate' => 'int:1:9999', 'type' => 'number:1:9999', 'explain' => false),
+ 'smilies_per_page' => array('lang' => 'SMILIES_PER_PAGE', 'validate' => 'int:1:9999', 'type' => 'number:1:9999', 'explain' => false),
+ 'hot_threshold' => array('lang' => 'HOT_THRESHOLD', 'validate' => 'int:0:9999', 'type' => 'number:0:9999', 'explain' => true),
+ 'max_poll_options' => array('lang' => 'MAX_POLL_OPTIONS', 'validate' => 'int:2:127', 'type' => 'number:2:127', 'explain' => false),
+ 'max_post_chars' => array('lang' => 'CHAR_LIMIT', 'validate' => 'int:0:999999', 'type' => 'number:0:999999', 'explain' => true),
+ 'min_post_chars' => array('lang' => 'MIN_CHAR_LIMIT', 'validate' => 'int:1:999999', 'type' => 'number:1:999999', 'explain' => true),
+ 'max_post_smilies' => array('lang' => 'SMILIES_LIMIT', 'validate' => 'int:0:9999', 'type' => 'number:0:9999', 'explain' => true),
+ 'max_post_urls' => array('lang' => 'MAX_POST_URLS', 'validate' => 'int:0:9999', 'type' => 'number:0:9999', 'explain' => true),
+ 'max_post_font_size' => array('lang' => 'MAX_POST_FONT_SIZE', 'validate' => 'int:0:9999', 'type' => 'number:0:9999', 'explain' => true, 'append' => ' %'),
+ 'max_quote_depth' => array('lang' => 'QUOTE_DEPTH_LIMIT', 'validate' => 'int:0:9999', 'type' => 'number:0:9999', 'explain' => true),
+ 'max_post_img_width' => array('lang' => 'MAX_POST_IMG_WIDTH', 'validate' => 'int:0:9999', 'type' => 'number:0:9999', 'explain' => true, 'append' => ' ' . $user->lang['PIXEL']),
+ 'max_post_img_height' => array('lang' => 'MAX_POST_IMG_HEIGHT', 'validate' => 'int:0:9999', 'type' => 'number:0:9999', 'explain' => true, 'append' => ' ' . $user->lang['PIXEL']),
'legend3' => 'ACP_SUBMIT_CHANGES',
)
@@ -214,12 +239,12 @@ class acp_board
'allow_sig_links' => array('lang' => 'ALLOW_SIG_LINKS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'legend2' => 'GENERAL_SETTINGS',
- 'max_sig_chars' => array('lang' => 'MAX_SIG_LENGTH', 'validate' => 'int:0', 'type' => 'text:5:4', 'explain' => true),
- 'max_sig_urls' => array('lang' => 'MAX_SIG_URLS', 'validate' => 'int:0', 'type' => 'text:5:4', 'explain' => true),
- 'max_sig_font_size' => array('lang' => 'MAX_SIG_FONT_SIZE', 'validate' => 'int:0', 'type' => 'text:5:4', 'explain' => true, 'append' => ' %'),
- 'max_sig_smilies' => array('lang' => 'MAX_SIG_SMILIES', 'validate' => 'int:0', 'type' => 'text:5:4', 'explain' => true),
- 'max_sig_img_width' => array('lang' => 'MAX_SIG_IMG_WIDTH', 'validate' => 'int:0', 'type' => 'text:5:4', 'explain' => true, 'append' => ' ' . $user->lang['PIXEL']),
- 'max_sig_img_height' => array('lang' => 'MAX_SIG_IMG_HEIGHT', 'validate' => 'int:0', 'type' => 'text:5:4', 'explain' => true, 'append' => ' ' . $user->lang['PIXEL']),
+ 'max_sig_chars' => array('lang' => 'MAX_SIG_LENGTH', 'validate' => 'int:0:9999', 'type' => 'number:0:9999', 'explain' => true),
+ 'max_sig_urls' => array('lang' => 'MAX_SIG_URLS', 'validate' => 'int:0:9999', 'type' => 'number:0:9999', 'explain' => true),
+ 'max_sig_font_size' => array('lang' => 'MAX_SIG_FONT_SIZE', 'validate' => 'int:0:9999', 'type' => 'number:0:9999', 'explain' => true, 'append' => ' %'),
+ 'max_sig_smilies' => array('lang' => 'MAX_SIG_SMILIES', 'validate' => 'int:0:9999', 'type' => 'number:0:9999', 'explain' => true),
+ 'max_sig_img_width' => array('lang' => 'MAX_SIG_IMG_WIDTH', 'validate' => 'int:0:9999', 'type' => 'number:0:9999', 'explain' => true, 'append' => ' ' . $user->lang['PIXEL']),
+ 'max_sig_img_height' => array('lang' => 'MAX_SIG_IMG_HEIGHT', 'validate' => 'int:0:9999', 'type' => 'number:0:9999', 'explain' => true, 'append' => ' ' . $user->lang['PIXEL']),
'legend3' => 'ACP_SUBMIT_CHANGES',
)
@@ -235,20 +260,20 @@ class acp_board
'max_pass_chars' => array('lang' => 'PASSWORD_LENGTH', 'validate' => 'int:8:255', 'type' => false, 'method' => false, 'explain' => false,),
'require_activation' => array('lang' => 'ACC_ACTIVATION', 'validate' => 'int', 'type' => 'select', 'method' => 'select_acc_activation', 'explain' => true),
- 'new_member_post_limit' => array('lang' => 'NEW_MEMBER_POST_LIMIT', 'validate' => 'int:0:255', 'type' => 'text:4:4', 'explain' => true, 'append' => ' ' . $user->lang['POSTS']),
+ 'new_member_post_limit' => array('lang' => 'NEW_MEMBER_POST_LIMIT', 'validate' => 'int:0:255', 'type' => 'number:0:255', 'explain' => true, 'append' => ' ' . $user->lang['POSTS']),
'new_member_group_default'=> array('lang' => 'NEW_MEMBER_GROUP_DEFAULT', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'min_name_chars' => array('lang' => 'USERNAME_LENGTH', 'validate' => 'int:1', 'type' => 'custom:5:180', 'method' => 'username_length', 'explain' => true),
'min_pass_chars' => array('lang' => 'PASSWORD_LENGTH', 'validate' => 'int:1', 'type' => 'custom', 'method' => 'password_length', 'explain' => true),
'allow_name_chars' => array('lang' => 'USERNAME_CHARS', 'validate' => 'string', 'type' => 'select', 'method' => 'select_username_chars', 'explain' => true),
'pass_complex' => array('lang' => 'PASSWORD_TYPE', 'validate' => 'string', 'type' => 'select', 'method' => 'select_password_chars', 'explain' => true),
- 'chg_passforce' => array('lang' => 'FORCE_PASS_CHANGE', 'validate' => 'int:0', 'type' => 'text:3:3', 'explain' => true, 'append' => ' ' . $user->lang['DAYS']),
+ 'chg_passforce' => array('lang' => 'FORCE_PASS_CHANGE', 'validate' => 'int:0:999', 'type' => 'number:0:999', 'explain' => true, 'append' => ' ' . $user->lang['DAYS']),
'legend2' => 'GENERAL_OPTIONS',
'allow_namechange' => array('lang' => 'ALLOW_NAME_CHANGE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
'allow_emailreuse' => array('lang' => 'ALLOW_EMAIL_REUSE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'enable_confirm' => array('lang' => 'VISUAL_CONFIRM_REG', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
- 'max_login_attempts' => array('lang' => 'MAX_LOGIN_ATTEMPTS', 'validate' => 'int:0', 'type' => 'text:3:3', 'explain' => true),
- 'max_reg_attempts' => array('lang' => 'REG_LIMIT', 'validate' => 'int:0', 'type' => 'text:4:4', 'explain' => true),
+ 'max_login_attempts' => array('lang' => 'MAX_LOGIN_ATTEMPTS', 'validate' => 'int:0:999', 'type' => 'number:0:999', 'explain' => true),
+ 'max_reg_attempts' => array('lang' => 'REG_LIMIT', 'validate' => 'int:0:9999', 'type' => 'number:0:9999', 'explain' => true),
'legend3' => 'COPPA',
'coppa_enable' => array('lang' => 'ENABLE_COPPA', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
@@ -270,13 +295,13 @@ class acp_board
'feed_http_auth' => array('lang' => 'ACP_FEED_HTTP_AUTH', 'validate' => 'bool', 'type' => 'radio:enabled_disabled', 'explain' => true),
'legend2' => 'ACP_FEED_POST_BASED',
- 'feed_limit_post' => array('lang' => 'ACP_FEED_LIMIT', 'validate' => 'int:5', 'type' => 'text:3:4', 'explain' => true),
+ 'feed_limit_post' => array('lang' => 'ACP_FEED_LIMIT', 'validate' => 'int:5:9999', 'type' => 'number:5:9999', 'explain' => true),
'feed_overall' => array('lang' => 'ACP_FEED_OVERALL', 'validate' => 'bool', 'type' => 'radio:enabled_disabled', 'explain' => true ),
'feed_forum' => array('lang' => 'ACP_FEED_FORUM', 'validate' => 'bool', 'type' => 'radio:enabled_disabled', 'explain' => true ),
'feed_topic' => array('lang' => 'ACP_FEED_TOPIC', 'validate' => 'bool', 'type' => 'radio:enabled_disabled', 'explain' => true ),
'legend3' => 'ACP_FEED_TOPIC_BASED',
- 'feed_limit_topic' => array('lang' => 'ACP_FEED_LIMIT', 'validate' => 'int:5', 'type' => 'text:3:4', 'explain' => true),
+ 'feed_limit_topic' => array('lang' => 'ACP_FEED_LIMIT', 'validate' => 'int:5:9999', 'type' => 'number:5:9999', 'explain' => true),
'feed_topics_new' => array('lang' => 'ACP_FEED_TOPICS_NEW', 'validate' => 'bool', 'type' => 'radio:enabled_disabled', 'explain' => true ),
'feed_topics_active' => array('lang' => 'ACP_FEED_TOPICS_ACTIVE', 'validate' => 'bool', 'type' => 'radio:enabled_disabled', 'explain' => true ),
'feed_news_id' => array('lang' => 'ACP_FEED_NEWS', 'validate' => 'string', 'type' => 'custom', 'method' => 'select_news_forums', 'explain' => true),
@@ -293,10 +318,10 @@ class acp_board
'title' => 'ACP_COOKIE_SETTINGS',
'vars' => array(
'legend1' => 'ACP_COOKIE_SETTINGS',
- 'cookie_domain' => array('lang' => 'COOKIE_DOMAIN', 'validate' => 'string', 'type' => 'text::255', 'explain' => false),
- 'cookie_name' => array('lang' => 'COOKIE_NAME', 'validate' => 'string', 'type' => 'text::16', 'explain' => false),
- 'cookie_path' => array('lang' => 'COOKIE_PATH', 'validate' => 'string', 'type' => 'text::255', 'explain' => false),
- 'cookie_secure' => array('lang' => 'COOKIE_SECURE', 'validate' => 'bool', 'type' => 'radio:disabled_enabled', 'explain' => true)
+ 'cookie_domain' => array('lang' => 'COOKIE_DOMAIN', 'validate' => 'string', 'type' => 'text::255', 'explain' => true),
+ 'cookie_name' => array('lang' => 'COOKIE_NAME', 'validate' => 'string', 'type' => 'text::16', 'explain' => true),
+ 'cookie_path' => array('lang' => 'COOKIE_PATH', 'validate' => 'string', 'type' => 'text::255', 'explain' => true),
+ 'cookie_secure' => array('lang' => 'COOKIE_SECURE', 'validate' => 'bool', 'type' => 'radio:disabled_enabled', 'explain' => true),
)
);
break;
@@ -306,12 +331,14 @@ class acp_board
'title' => 'ACP_LOAD_SETTINGS',
'vars' => array(
'legend1' => 'GENERAL_SETTINGS',
- 'limit_load' => array('lang' => 'LIMIT_LOAD', 'validate' => 'string', 'type' => 'text:4:4', 'explain' => true),
- 'session_length' => array('lang' => 'SESSION_LENGTH', 'validate' => 'int:60', 'type' => 'text:5:10', 'explain' => true, 'append' => ' ' . $user->lang['SECONDS']),
- 'active_sessions' => array('lang' => 'LIMIT_SESSIONS', 'validate' => 'int:0', 'type' => 'text:4:4', 'explain' => true),
- 'load_online_time' => array('lang' => 'ONLINE_LENGTH', 'validate' => 'int:0', 'type' => 'text:4:3', 'explain' => true, 'append' => ' ' . $user->lang['MINUTES']),
+ 'limit_load' => array('lang' => 'LIMIT_LOAD', 'validate' => 'int:0:9999', 'type' => 'number:0:9999', 'explain' => true),
+ 'session_length' => array('lang' => 'SESSION_LENGTH', 'validate' => 'int:60:9999999999', 'type' => 'number:60:9999999999', 'explain' => true, 'append' => ' ' . $user->lang['SECONDS']),
+ 'active_sessions' => array('lang' => 'LIMIT_SESSIONS', 'validate' => 'int:0:9999', 'type' => 'number:0:9999', 'explain' => true),
+ 'load_online_time' => array('lang' => 'ONLINE_LENGTH', 'validate' => 'int:0:999', 'type' => 'number:0:999', 'explain' => true, 'append' => ' ' . $user->lang['MINUTES']),
+ 'read_notification_expire_days' => array('lang' => 'READ_NOTIFICATION_EXPIRE_DAYS', 'validate' => 'int:0', 'type' => 'number:0', 'explain' => true, 'append' => ' ' . $user->lang['DAYS']),
'legend2' => 'GENERAL_OPTIONS',
+ 'load_notifications' => array('lang' => 'LOAD_NOTIFICATIONS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'load_db_track' => array('lang' => 'YES_POST_MARKING', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'load_db_lastread' => array('lang' => 'YES_READ_MARKING', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'load_anon_lastread' => array('lang' => 'YES_ANON_READ_MARKING', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
@@ -323,10 +350,13 @@ class acp_board
'load_moderators' => array('lang' => 'YES_MODERATORS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
'load_jumpbox' => array('lang' => 'YES_JUMPBOX', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
'load_user_activity' => array('lang' => 'LOAD_USER_ACTIVITY', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
- 'load_tplcompile' => array('lang' => 'RECOMPILE_STYLES', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
+ 'load_tplcompile' => array('lang' => 'RECOMPILE_STYLES', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
+ 'allow_cdn' => array('lang' => 'ALLOW_CDN', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
+ 'allow_live_searches' => array('lang' => 'ALLOW_LIVE_SEARCHES', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'legend3' => 'CUSTOM_PROFILE_FIELDS',
'load_cpf_memberlist' => array('lang' => 'LOAD_CPF_MEMBERLIST', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
+ 'load_cpf_pm' => array('lang' => 'LOAD_CPF_PM', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
'load_cpf_viewprofile' => array('lang' => 'LOAD_CPF_VIEWPROFILE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
'load_cpf_viewtopic' => array('lang' => 'LOAD_CPF_VIEWTOPIC', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
@@ -340,7 +370,7 @@ class acp_board
'title' => 'ACP_AUTH_SETTINGS',
'vars' => array(
'legend1' => 'ACP_AUTH_SETTINGS',
- 'auth_method' => array('lang' => 'AUTH_METHOD', 'validate' => 'string', 'type' => 'select', 'method' => 'select_auth_method', 'explain' => false)
+ 'auth_method' => array('lang' => 'AUTH_METHOD', 'validate' => 'string', 'type' => 'select:1:toggable', 'method' => 'select_auth_method', 'explain' => false),
)
);
break;
@@ -351,8 +381,10 @@ class acp_board
'vars' => array(
'legend1' => 'ACP_SERVER_SETTINGS',
'gzip_compress' => array('lang' => 'ENABLE_GZIP', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
+ 'use_system_cron' => array('lang' => 'USE_SYSTEM_CRON', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'legend2' => 'PATH_SETTINGS',
+ 'enable_mod_rewrite' => array('lang' => 'MOD_REWRITE_ENABLE', 'validate' => 'bool', 'type' => 'custom', 'method' => 'enable_mod_rewrite', 'explain' => true),
'smilies_path' => array('lang' => 'SMILIES_PATH', 'validate' => 'rpath', 'type' => 'text:20:255', 'explain' => true),
'icons_path' => array('lang' => 'ICONS_PATH', 'validate' => 'rpath', 'type' => 'text:20:255', 'explain' => true),
'upload_icons_path' => array('lang' => 'UPLOAD_ICONS_PATH', 'validate' => 'rpath', 'type' => 'text:20:255', 'explain' => true),
@@ -362,7 +394,7 @@ class acp_board
'force_server_vars' => array('lang' => 'FORCE_SERVER_VARS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'server_protocol' => array('lang' => 'SERVER_PROTOCOL', 'validate' => 'string', 'type' => 'text:10:10', 'explain' => true),
'server_name' => array('lang' => 'SERVER_NAME', 'validate' => 'string', 'type' => 'text:40:255', 'explain' => true),
- 'server_port' => array('lang' => 'SERVER_PORT', 'validate' => 'int:0', 'type' => 'text:5:5', 'explain' => true),
+ 'server_port' => array('lang' => 'SERVER_PORT', 'validate' => 'int:0:99999', 'type' => 'number:0:99999', 'explain' => true),
'script_path' => array('lang' => 'SCRIPT_PATH', 'validate' => 'script_path', 'type' => 'text::255', 'explain' => true),
'legend4' => 'ACP_SUBMIT_CHANGES',
@@ -376,23 +408,24 @@ class acp_board
'vars' => array(
'legend1' => 'ACP_SECURITY_SETTINGS',
'allow_autologin' => array('lang' => 'ALLOW_AUTOLOGIN', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
- 'max_autologin_time' => array('lang' => 'AUTOLOGIN_LENGTH', 'validate' => 'int:0', 'type' => 'text:5:5', 'explain' => true, 'append' => ' ' . $user->lang['DAYS']),
+ 'allow_password_reset' => array('lang' => 'ALLOW_PASSWORD_RESET', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
+ 'max_autologin_time' => array('lang' => 'AUTOLOGIN_LENGTH', 'validate' => 'int:0:99999', 'type' => 'number:0:99999', 'explain' => true, 'append' => ' ' . $user->lang['DAYS']),
'ip_check' => array('lang' => 'IP_VALID', 'validate' => 'int', 'type' => 'custom', 'method' => 'select_ip_check', 'explain' => true),
'browser_check' => array('lang' => 'BROWSER_VALID', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'forwarded_for_check' => array('lang' => 'FORWARDED_FOR_VALID', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
- 'referer_validation' => array('lang' => 'REFERER_VALID', 'validate' => 'int:0:3','type' => 'custom', 'method' => 'select_ref_check', 'explain' => true),
+ 'referer_validation' => array('lang' => 'REFERRER_VALID', 'validate' => 'int:0:3','type' => 'custom', 'method' => 'select_ref_check', 'explain' => true),
'check_dnsbl' => array('lang' => 'CHECK_DNSBL', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'email_check_mx' => array('lang' => 'EMAIL_CHECK_MX', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'max_pass_chars' => array('lang' => 'PASSWORD_LENGTH', 'validate' => 'int:8:255', 'type' => false, 'method' => false, 'explain' => false,),
'min_pass_chars' => array('lang' => 'PASSWORD_LENGTH', 'validate' => 'int:1', 'type' => 'custom', 'method' => 'password_length', 'explain' => true),
'pass_complex' => array('lang' => 'PASSWORD_TYPE', 'validate' => 'string', 'type' => 'select', 'method' => 'select_password_chars', 'explain' => true),
- 'chg_passforce' => array('lang' => 'FORCE_PASS_CHANGE', 'validate' => 'int:0', 'type' => 'text:3:3', 'explain' => true, 'append' => ' ' . $user->lang['DAYS']),
- 'max_login_attempts' => array('lang' => 'MAX_LOGIN_ATTEMPTS', 'validate' => 'int:0', 'type' => 'text:3:3', 'explain' => true),
- 'ip_login_limit_max' => array('lang' => 'IP_LOGIN_LIMIT_MAX', 'validate' => 'int:0', 'type' => 'text:3:3', 'explain' => true),
- 'ip_login_limit_time' => array('lang' => 'IP_LOGIN_LIMIT_TIME', 'validate' => 'int:0', 'type' => 'text:5:5', 'explain' => true, 'append' => ' ' . $user->lang['SECONDS']),
+ 'chg_passforce' => array('lang' => 'FORCE_PASS_CHANGE', 'validate' => 'int:0:999', 'type' => 'number:0:999', 'explain' => true, 'append' => ' ' . $user->lang['DAYS']),
+ 'max_login_attempts' => array('lang' => 'MAX_LOGIN_ATTEMPTS', 'validate' => 'int:0:999', 'type' => 'number:0:999', 'explain' => true),
+ 'ip_login_limit_max' => array('lang' => 'IP_LOGIN_LIMIT_MAX', 'validate' => 'int:0:999', 'type' => 'number:0:999', 'explain' => true),
+ 'ip_login_limit_time' => array('lang' => 'IP_LOGIN_LIMIT_TIME', 'validate' => 'int:0:99999', 'type' => 'number:0:99999', 'explain' => true, 'append' => ' ' . $user->lang['SECONDS']),
'ip_login_limit_use_forwarded' => array('lang' => 'IP_LOGIN_LIMIT_USE_FORWARDED', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'tpl_allow_php' => array('lang' => 'TPL_ALLOW_PHP', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
- 'form_token_lifetime' => array('lang' => 'FORM_TIME_MAX', 'validate' => 'int:-1', 'type' => 'text:5:5', 'explain' => true, 'append' => ' ' . $user->lang['SECONDS']),
+ 'form_token_lifetime' => array('lang' => 'FORM_TIME_MAX', 'validate' => 'int:-1:99999', 'type' => 'number:-1:99999', 'explain' => true, 'append' => ' ' . $user->lang['SECONDS']),
'form_token_sid_guests' => array('lang' => 'FORM_SID_GUESTS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
)
@@ -407,19 +440,23 @@ class acp_board
'email_enable' => array('lang' => 'ENABLE_EMAIL', 'validate' => 'bool', 'type' => 'radio:enabled_disabled', 'explain' => true),
'board_email_form' => array('lang' => 'BOARD_EMAIL_FORM', 'validate' => 'bool', 'type' => 'radio:enabled_disabled', 'explain' => true),
'email_function_name' => array('lang' => 'EMAIL_FUNCTION_NAME', 'validate' => 'string', 'type' => 'text:20:50', 'explain' => true),
- 'email_package_size' => array('lang' => 'EMAIL_PACKAGE_SIZE', 'validate' => 'int:0', 'type' => 'text:5:5', 'explain' => true),
- 'board_contact' => array('lang' => 'CONTACT_EMAIL', 'validate' => 'email', 'type' => 'text:25:100', 'explain' => true),
- 'board_email' => array('lang' => 'ADMIN_EMAIL', 'validate' => 'email', 'type' => 'text:25:100', 'explain' => true),
+ 'email_package_size' => array('lang' => 'EMAIL_PACKAGE_SIZE', 'validate' => 'int:0', 'type' => 'number:0:99999', 'explain' => true),
+ 'board_contact' => array('lang' => 'CONTACT_EMAIL', 'validate' => 'email', 'type' => 'email:25:100', 'explain' => true),
+ 'board_contact_name' => array('lang' => 'CONTACT_EMAIL_NAME', 'validate' => 'string', 'type' => 'text:25:50', 'explain' => true),
+ 'board_email' => array('lang' => 'ADMIN_EMAIL', 'validate' => 'email', 'type' => 'email:25:100', 'explain' => true),
'board_email_sig' => array('lang' => 'EMAIL_SIG', 'validate' => 'string', 'type' => 'textarea:5:30', 'explain' => true),
'board_hide_emails' => array('lang' => 'BOARD_HIDE_EMAILS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'legend2' => 'SMTP_SETTINGS',
'smtp_delivery' => array('lang' => 'USE_SMTP', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
- 'smtp_host' => array('lang' => 'SMTP_SERVER', 'validate' => 'string', 'type' => 'text:25:50', 'explain' => false),
- 'smtp_port' => array('lang' => 'SMTP_PORT', 'validate' => 'int:0', 'type' => 'text:4:5', 'explain' => true),
+ 'smtp_host' => array('lang' => 'SMTP_SERVER', 'validate' => 'string', 'type' => 'text:25:50', 'explain' => true),
+ 'smtp_port' => array('lang' => 'SMTP_PORT', 'validate' => 'int:0:99999', 'type' => 'number:0:99999', 'explain' => true),
'smtp_auth_method' => array('lang' => 'SMTP_AUTH_METHOD', 'validate' => 'string', 'type' => 'select', 'method' => 'mail_auth_select', 'explain' => true),
'smtp_username' => array('lang' => 'SMTP_USERNAME', 'validate' => 'string', 'type' => 'text:25:255', 'explain' => true),
'smtp_password' => array('lang' => 'SMTP_PASSWORD', 'validate' => 'string', 'type' => 'password:25:255', 'explain' => true),
+ 'smtp_verify_peer' => array('lang' => 'SMTP_VERIFY_PEER', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
+ 'smtp_verify_peer_name' => array('lang' => 'SMTP_VERIFY_PEER_NAME', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
+ 'smtp_allow_self_signed'=> array('lang' => 'SMTP_ALLOW_SELF_SIGNED','validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'legend3' => 'ACP_SUBMIT_CHANGES',
)
@@ -431,16 +468,28 @@ class acp_board
break;
}
+ /**
+ * Event to add and/or modify acp_board configurations
+ *
+ * @event core.acp_board_config_edit_add
+ * @var array display_vars Array of config values to display and process
+ * @var string mode Mode of the config page we are displaying
+ * @var boolean submit Do we display the form or process the submission
+ * @since 3.1.0-a4
+ */
+ $vars = array('display_vars', 'mode', 'submit');
+ extract($phpbb_dispatcher->trigger_event('core.acp_board_config_edit_add', compact($vars)));
+
if (isset($display_vars['lang']))
{
$user->add_lang($display_vars['lang']);
}
- $this->new_config = $config;
+ $this->new_config = clone $config;
$cfg_array = (isset($_REQUEST['config'])) ? utf8_normalize_nfc(request_var('config', array('' => ''), true)) : $this->new_config;
$error = array();
- // We validate the complete config if whished
+ // We validate the complete config if wished
validate_config_vars($display_vars['vars'], $cfg_array, $error);
if ($submit && !check_form_key($form_key))
@@ -454,7 +503,7 @@ class acp_board
}
// We go through the display_vars to make sure no one is trying to set variables he/she is not allowed to...
- foreach ($display_vars['vars'] as $config_name => $null)
+ foreach ($display_vars['vars'] as $config_name => $data)
{
if (!isset($cfg_array[$config_name]) || strpos($config_name, 'legend') !== false)
{
@@ -466,6 +515,15 @@ class acp_board
continue;
}
+ if ($config_name == 'guest_style')
+ {
+ if (isset($cfg_array[$config_name]))
+ {
+ $this->guest_style_set($cfg_array[$config_name]);
+ }
+ continue;
+ }
+
$this->new_config[$config_name] = $config_value = $cfg_array[$config_name];
if ($config_name == 'email_function_name')
@@ -477,6 +535,13 @@ class acp_board
if ($submit)
{
+ if (strpos($data['type'], 'password') === 0 && $config_value === '********')
+ {
+ // Do not update password fields if the content is ********,
+ // because that is the password replacement we use to not
+ // send the password to the output
+ continue;
+ }
set_config($config_name, $config_value);
if ($config_name == 'allow_quick_reply' && isset($_POST['allow_quick_reply_enable']))
@@ -499,84 +564,63 @@ class acp_board
if ($mode == 'auth')
{
// Retrieve a list of auth plugins and check their config values
- $auth_plugins = array();
-
- $dp = @opendir($phpbb_root_path . 'includes/auth');
+ $auth_providers = $phpbb_container->get('auth.provider_collection');
- if ($dp)
+ $updated_auth_settings = false;
+ $old_auth_config = array();
+ foreach ($auth_providers as $provider)
{
- while (($file = readdir($dp)) !== false)
+ /** @var \phpbb\auth\provider\provider_interface $provider */
+ if ($fields = $provider->acp())
{
- if (preg_match('#^auth_(.*?)\.' . $phpEx . '$#', $file))
+ // Check if we need to create config fields for this plugin and save config when submit was pressed
+ foreach ($fields as $field)
{
- $auth_plugins[] = basename(preg_replace('#^auth_(.*?)\.' . $phpEx . '$#', '\1', $file));
- }
- }
- closedir($dp);
+ if (!isset($config[$field]))
+ {
+ set_config($field, '');
+ }
- sort($auth_plugins);
- }
+ if (!isset($cfg_array[$field]) || strpos($field, 'legend') !== false)
+ {
+ continue;
+ }
- $updated_auth_settings = false;
- $old_auth_config = array();
- foreach ($auth_plugins as $method)
- {
- if ($method && file_exists($phpbb_root_path . 'includes/auth/auth_' . $method . '.' . $phpEx))
- {
- include_once($phpbb_root_path . 'includes/auth/auth_' . $method . '.' . $phpEx);
+ if (substr($field, -9) === '_password' && $cfg_array[$field] === '********')
+ {
+ // Do not update password fields if the content is ********,
+ // because that is the password replacement we use to not
+ // send the password to the output
+ continue;
+ }
- $method = 'acp_' . $method;
- if (function_exists($method))
- {
- if ($fields = $method($this->new_config))
+ $old_auth_config[$field] = $this->new_config[$field];
+ $config_value = $cfg_array[$field];
+ $this->new_config[$field] = $config_value;
+
+ if ($submit)
{
- // Check if we need to create config fields for this plugin and save config when submit was pressed
- foreach ($fields['config'] as $field)
- {
- if (!isset($config[$field]))
- {
- set_config($field, '');
- }
-
- if (!isset($cfg_array[$field]) || strpos($field, 'legend') !== false)
- {
- continue;
- }
-
- $old_auth_config[$field] = $this->new_config[$field];
- $config_value = $cfg_array[$field];
- $this->new_config[$field] = $config_value;
-
- if ($submit)
- {
- $updated_auth_settings = true;
- set_config($field, $config_value);
- }
- }
+ $updated_auth_settings = true;
+ set_config($field, $config_value);
}
- unset($fields);
}
}
+ unset($fields);
}
if ($submit && (($cfg_array['auth_method'] != $this->new_config['auth_method']) || $updated_auth_settings))
{
$method = basename($cfg_array['auth_method']);
- if ($method && in_array($method, $auth_plugins))
+ if (array_key_exists('auth.provider.' . $method, $auth_providers))
{
- include_once($phpbb_root_path . 'includes/auth/auth_' . $method . '.' . $phpEx);
-
- $method = 'init_' . $method;
- if (function_exists($method))
+ $provider = $auth_providers['auth.provider.' . $method];
+ if ($error = $provider->init())
{
- if ($error = $method())
+ foreach ($old_auth_config as $config_name => $config_value)
{
- foreach ($old_auth_config as $config_name => $config_value)
- {
- set_config($config_name, $config_value);
- }
- trigger_error($error . adm_back_link($this->u_action), E_USER_WARNING);
+ set_config($config_name, $config_value);
}
+ trigger_error($error . adm_back_link($this->u_action), E_USER_WARNING);
}
set_config('auth_method', basename($cfg_array['auth_method']));
}
@@ -591,7 +635,15 @@ class acp_board
{
add_log('admin', 'LOG_CONFIG_' . strtoupper($mode));
- trigger_error($user->lang['CONFIG_UPDATED'] . adm_back_link($this->u_action));
+ $message = $user->lang('CONFIG_UPDATED');
+ $message_type = E_USER_NOTICE;
+ if (!$config['email_enable'] && in_array($mode, array('email', 'registration')) &&
+ in_array($config['require_activation'], array(USER_ACTIVATION_SELF, USER_ACTIVATION_ADMIN)))
+ {
+ $message .= '<br /><br />' . $user->lang('ACC_ACTIVATION_WARNING');
+ $message_type = E_USER_WARNING;
+ }
+ trigger_error($message . adm_back_link($this->u_action), $message_type);
}
$this->tpl_name = 'acp_board';
@@ -660,23 +712,22 @@ class acp_board
{
$template->assign_var('S_AUTH', true);
- foreach ($auth_plugins as $method)
+ foreach ($auth_providers as $provider)
{
- if ($method && file_exists($phpbb_root_path . 'includes/auth/auth_' . $method . '.' . $phpEx))
+ $auth_tpl = $provider->get_acp_template($this->new_config);
+ if ($auth_tpl)
{
- $method = 'acp_' . $method;
- if (function_exists($method))
+ if (array_key_exists('BLOCK_VAR_NAME', $auth_tpl))
{
- $fields = $method($this->new_config);
-
- if ($fields['tpl'])
+ foreach ($auth_tpl['BLOCK_VARS'] as $block_vars)
{
- $template->assign_block_vars('auth_tpl', array(
- 'TPL' => $fields['tpl'])
- );
+ $template->assign_block_vars($auth_tpl['BLOCK_VAR_NAME'], $block_vars);
}
- unset($fields);
}
+ $template->assign_vars($auth_tpl['TEMPLATE_VARS']);
+ $template->assign_block_vars('auth_tpl', array(
+ 'TEMPLATE_FILE' => $auth_tpl['TEMPLATE_FILE'],
+ ));
}
}
}
@@ -687,25 +738,19 @@ class acp_board
*/
function select_auth_method($selected_method, $key = '')
{
- global $phpbb_root_path, $phpEx;
+ global $phpbb_root_path, $phpEx, $phpbb_container;
$auth_plugins = array();
+ $auth_providers = $phpbb_container->get('auth.provider_collection');
- $dp = @opendir($phpbb_root_path . 'includes/auth');
-
- if (!$dp)
- {
- return '';
- }
-
- while (($file = readdir($dp)) !== false)
+ foreach ($auth_providers as $key => $value)
{
- if (preg_match('#^auth_(.*?)\.' . $phpEx . '$#', $file))
+ if (!($value instanceof \phpbb\auth\provider\provider_interface))
{
- $auth_plugins[] = preg_replace('#^auth_(.*?)\.' . $phpEx . '$#', '\1', $file);
+ continue;
}
+ $auth_plugins[] = str_replace('auth.provider.', '', $key);
}
- closedir($dp);
sort($auth_plugins);
@@ -713,7 +758,7 @@ class acp_board
foreach ($auth_plugins as $method)
{
$selected = ($selected_method == $method) ? ' selected="selected"' : '';
- $auth_select .= '<option value="' . $method . '"' . $selected . '>' . ucfirst($method) . '</option>';
+ $auth_select .= "<option value=\"$method\"$selected data-toggle-setting=\"#auth_{$method}_settings\">" . ucfirst($method) . '</option>';
}
return $auth_select;
@@ -775,20 +820,19 @@ class acp_board
global $user, $config;
$act_ary = array(
- 'ACC_DISABLE' => USER_ACTIVATION_DISABLE,
- 'ACC_NONE' => USER_ACTIVATION_NONE,
+ 'ACC_DISABLE' => array(true, USER_ACTIVATION_DISABLE),
+ 'ACC_NONE' => array(true, USER_ACTIVATION_NONE),
+ 'ACC_USER' => array($config['email_enable'], USER_ACTIVATION_SELF),
+ 'ACC_ADMIN' => array($config['email_enable'], USER_ACTIVATION_ADMIN),
);
- if ($config['email_enable'])
- {
- $act_ary['ACC_USER'] = USER_ACTIVATION_SELF;
- $act_ary['ACC_ADMIN'] = USER_ACTIVATION_ADMIN;
- }
- $act_options = '';
- foreach ($act_ary as $key => $value)
+ $act_options = '';
+ foreach ($act_ary as $key => $data)
{
+ list($available, $value) = $data;
$selected = ($selected_value == $value) ? ' selected="selected"' : '';
- $act_options .= '<option value="' . $value . '"' . $selected . '>' . $user->lang[$key] . '</option>';
+ $class = (!$available) ? ' class="disabled-option"' : '';
+ $act_options .= '<option value="' . $value . '"' . $selected . $class . '>' . $user->lang($key) . '</option>';
}
return $act_options;
@@ -801,7 +845,7 @@ class acp_board
{
global $user;
- return '<input id="' . $key . '" type="text" size="3" maxlength="3" name="config[min_name_chars]" value="' . $value . '" /> ' . $user->lang['MIN_CHARS'] . '&nbsp;&nbsp;<input type="text" size="3" maxlength="3" name="config[max_name_chars]" value="' . $this->new_config['max_name_chars'] . '" /> ' . $user->lang['MAX_CHARS'];
+ return '<input id="' . $key . '" type="number" min="1" max="999" name="config[min_name_chars]" value="' . $value . '" /> ' . $user->lang['MIN_CHARS'] . '&nbsp;&nbsp;<input type="number" min="8" max="180" name="config[max_name_chars]" value="' . $this->new_config['max_name_chars'] . '" /> ' . $user->lang['MAX_CHARS'];
}
/**
@@ -829,7 +873,7 @@ class acp_board
{
global $user;
- return '<input id="' . $key . '" type="text" size="3" maxlength="3" name="config[min_pass_chars]" value="' . $value . '" /> ' . $user->lang['MIN_CHARS'] . '&nbsp;&nbsp;<input type="text" size="3" maxlength="3" name="config[max_pass_chars]" value="' . $this->new_config['max_pass_chars'] . '" /> ' . $user->lang['MAX_CHARS'];
+ return '<input id="' . $key . '" type="number" min="1" max="999" name="config[min_pass_chars]" value="' . $value . '" /> ' . $user->lang['MIN_CHARS'] . '&nbsp;&nbsp;<input type="number" min="8" max="255" name="config[max_pass_chars]" value="' . $this->new_config['max_pass_chars'] . '" /> ' . $user->lang['MAX_CHARS'];
}
/**
@@ -893,6 +937,50 @@ class acp_board
'<br /><br /><input class="button2" type="submit" id="' . $key . '_enable" name="' . $key . '_enable" value="' . $user->lang['ALLOW_QUICK_REPLY_BUTTON'] . '" />';
}
+ /**
+ * Select guest timezone
+ */
+ function timezone_select($value, $key)
+ {
+ global $template, $user;
+
+ $timezone_select = phpbb_timezone_select($template, $user, $value, true);
+
+ return '<select name="config[' . $key . ']" id="' . $key . '">' . $timezone_select . '</select>';
+ }
+
+ /**
+ * Get guest style
+ */
+ public function guest_style_get()
+ {
+ global $db;
+
+ $sql = 'SELECT user_style
+ FROM ' . USERS_TABLE . '
+ WHERE user_id = ' . ANONYMOUS;
+ $result = $db->sql_query($sql);
+
+ $style = (int) $db->sql_fetchfield('user_style');
+ $db->sql_freeresult($result);
+
+ return $style;
+ }
+
+ /**
+ * Set guest style
+ *
+ * @param int $style_id The style ID
+ */
+ public function guest_style_set($style_id)
+ {
+ global $db;
+
+ $sql = 'UPDATE ' . USERS_TABLE . '
+ SET user_style = ' . (int) $style_id . '
+ WHERE user_id = ' . ANONYMOUS;
+ $db->sql_query($sql);
+ }
/**
* Select default dateformat
@@ -903,10 +991,14 @@ class acp_board
// Let the format_date function operate with the acp values
$old_tz = $user->timezone;
- $old_dst = $user->dst;
-
- $user->timezone = $config['board_timezone'] * 3600;
- $user->dst = $config['board_dst'] * 3600;
+ try
+ {
+ $user->timezone = new DateTimeZone($config['board_timezone']);
+ }
+ catch (\Exception $e)
+ {
+ // If the board timezone is invalid, we just use the users timezone.
+ }
$dateformat_options = '';
@@ -926,10 +1018,9 @@ class acp_board
// Reset users date options
$user->timezone = $old_tz;
- $user->dst = $old_dst;
return "<select name=\"dateoptions\" id=\"dateoptions\" onchange=\"if (this.value == 'custom') { document.getElementById('" . addslashes($key) . "').value = '" . addslashes($value) . "'; } else { document.getElementById('" . addslashes($key) . "').value = this.value; }\">$dateformat_options</select>
- <input type=\"text\" name=\"config[$key]\" id=\"$key\" value=\"$value\" maxlength=\"30\" />";
+ <input type=\"text\" name=\"config[$key]\" id=\"$key\" value=\"$value\" maxlength=\"64\" />";
}
/**
@@ -1000,6 +1091,51 @@ class acp_board
$cache->destroy('sql', FORUMS_TABLE);
}
-}
+ /**
+ * Option to enable/disable removal of 'app.php' from URLs
+ *
+ * Note that if mod_rewrite is on, URLs without app.php will still work,
+ * but any paths generated by the controller helper url() method will not
+ * contain app.php.
+ *
+ * @param int $value The current config value
+ * @param string $key The config key
+ * @return string The HTML for the form field
+ */
+ function enable_mod_rewrite($value, $key)
+ {
+ global $user, $config;
+
+ // Determine whether mod_rewrite is enabled on the server
+ // NOTE: This only works on Apache servers on which PHP is NOT
+ // installed as CGI. In that case, there is no way for PHP to
+ // determine whether or not the Apache module is enabled.
+ //
+ // To be clear on the value of $mod_rewite:
+ // null = Cannot determine whether or not the server has mod_rewrite
+ // enabled
+ // false = Can determine that the server does NOT have mod_rewrite
+ // enabled
+ // true = Can determine that the server DOES have mod_rewrite_enabled
+ $mod_rewrite = null;
+ if (function_exists('apache_get_modules'))
+ {
+ $mod_rewrite = (bool) in_array('mod_rewrite', apache_get_modules());
+ }
+
+ // If $message is false, mod_rewrite is enabled.
+ // Otherwise, it is not and we need to:
+ // 1) disable the form field
+ // 2) make sure the config value is set to 0
+ // 3) append the message to the return
+ $value = ($mod_rewrite === false) ? 0 : $value;
+ $message = $mod_rewrite === null ? 'MOD_REWRITE_INFORMATION_UNAVAILABLE' : ($mod_rewrite === false ? 'MOD_REWRITE_DISABLED' : false);
-?> \ No newline at end of file
+ // Let's do some friendly HTML injection if we want to disable the
+ // form field because h_radio() has no pretty way of doing so
+ $field_name = 'config[enable_mod_rewrite]' . ($message === 'MOD_REWRITE_DISABLED' ? '" disabled="disabled' : '');
+
+ return h_radio($field_name, array(1 => 'YES', 0 => 'NO'), $value) .
+ ($message !== false ? '<br /><span>' . $user->lang($message) . '</span>' : '');
+ }
+}
diff --git a/phpBB/includes/acp/acp_bots.php b/phpBB/includes/acp/acp_bots.php
index d08cabb062..2188b90729 100644
--- a/phpBB/includes/acp/acp_bots.php
+++ b/phpBB/includes/acp/acp_bots.php
@@ -1,10 +1,13 @@
<?php
/**
*
-* @package acp
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -16,16 +19,13 @@ if (!defined('IN_PHPBB'))
exit;
}
-/**
-* @package acp
-*/
class acp_bots
{
var $u_action;
function main($id, $mode)
{
- global $config, $db, $user, $auth, $template, $cache;
+ global $config, $db, $user, $auth, $template, $cache, $request;
global $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix;
$action = request_var('action', '');
@@ -141,7 +141,11 @@ class acp_bots
case 'edit':
case 'add':
- include_once($phpbb_root_path . 'includes/functions_user.' . $phpEx);
+
+ if (!function_exists('user_update_name'))
+ {
+ include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
+ }
$bot_row = array(
'bot_name' => utf8_normalize_nfc(request_var('bot_name', '', true)),
@@ -158,7 +162,7 @@ class acp_bots
{
$error[] = $user->lang['ERR_BOT_NO_MATCHES'];
}
-
+
if ($bot_row['bot_ip'] && !preg_match('#^[\d\.,:]+$#', $bot_row['bot_ip']))
{
if (!$ip_list = gethostbynamel($bot_row['bot_ip']))
@@ -177,7 +181,7 @@ class acp_bots
{
$error[] = $user->lang['ERR_BOT_AGENT_MATCHES_UA'];
}
-
+
$bot_name = false;
if ($bot_id)
{
@@ -202,7 +206,7 @@ class acp_bots
{
$error[] = $user->lang['BOT_NAME_TAKEN'];
}
-
+
if (!sizeof($error))
{
// New bot? Create a new user and group entry
@@ -220,7 +224,6 @@ class acp_bots
{
trigger_error($user->lang['NO_BOT_GROUP'] . adm_back_link($this->u_action . "&amp;id=$bot_id&amp;action=$action"), E_USER_WARNING);
}
-
$user_id = user_add(array(
'user_type' => (int) USER_IGNORE,
@@ -234,7 +237,7 @@ class acp_bots
'user_style' => (int) $bot_row['bot_style'],
'user_allow_massemail' => 0,
));
-
+
$sql = 'INSERT INTO ' . BOTS_TABLE . ' ' . $db->sql_build_array('INSERT', array(
'user_id' => (int) $user_id,
'bot_name' => (string) $bot_row['bot_name'],
@@ -243,7 +246,7 @@ class acp_bots
'bot_ip' => (string) $bot_row['bot_ip'])
);
$db->sql_query($sql);
-
+
$log = 'ADDED';
}
else if ($bot_id)
@@ -290,12 +293,12 @@ class acp_bots
$log = 'UPDATED';
}
-
+
$cache->destroy('_bots');
-
+
add_log('admin', 'LOG_BOT_' . $log, $bot_row['bot_name']);
trigger_error($user->lang['BOT_' . $log] . adm_back_link($this->u_action));
-
+
}
}
else if ($bot_id)
@@ -336,11 +339,11 @@ class acp_bots
'U_ACTION' => $this->u_action . "&amp;id=$bot_id&amp;action=$action",
'U_BACK' => $this->u_action,
'ERROR_MSG' => (sizeof($error)) ? implode('<br />', $error) : '',
-
+
'BOT_NAME' => $bot_row['bot_name'],
'BOT_IP' => $bot_row['bot_ip'],
'BOT_AGENT' => $bot_row['bot_agent'],
-
+
'S_EDIT_BOT' => true,
'S_ACTIVE_OPTIONS' => $s_active_options,
'S_STYLE_OPTIONS' => $style_select,
@@ -354,6 +357,14 @@ class acp_bots
break;
}
+ if ($request->is_ajax() && ($action == 'activate' || $action == 'deactivate'))
+ {
+ $json_response = new \phpbb\json_response;
+ $json_response->send(array(
+ 'text' => $user->lang['BOT_' . (($action == 'activate') ? 'DE' : '') . 'ACTIVATE'],
+ ));
+ }
+
$s_options = '';
$_options = array('activate' => 'BOT_ACTIVATE', 'deactivate' => 'BOT_DEACTIVATE', 'delete' => 'DELETE');
foreach ($_options as $value => $lang)
@@ -390,7 +401,7 @@ class acp_bots
}
$db->sql_freeresult($result);
}
-
+
/**
* Validate bot name against username table
*/
@@ -410,9 +421,7 @@ class acp_bots
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
-
+
return ($row) ? false : true;
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/acp/acp_captcha.php b/phpBB/includes/acp/acp_captcha.php
index bfec7c27d8..92d5e1dda6 100644
--- a/phpBB/includes/acp/acp_captcha.php
+++ b/phpBB/includes/acp/acp_captcha.php
@@ -1,10 +1,14 @@
<?php
/**
*
-* @package acp
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
*/
/**
@@ -15,28 +19,24 @@ if (!defined('IN_PHPBB'))
exit;
}
-/**
-* @package acp
-*/
class acp_captcha
{
var $u_action;
function main($id, $mode)
{
- global $db, $user, $auth, $template;
- global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
+ global $request, $user, $auth, $template;
+ global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx, $phpbb_container;
$user->add_lang('acp/board');
- include($phpbb_root_path . 'includes/captcha/captcha_factory.' . $phpEx);
- $captchas = phpbb_captcha_factory::get_captcha_types();
+ $factory = $phpbb_container->get('captcha.factory');
+ $captchas = $factory->get_captcha_types();
$selected = request_var('select_captcha', $config['captcha_plugin']);
$selected = (isset($captchas['available'][$selected]) || isset($captchas['unavailable'][$selected])) ? $selected : $config['captcha_plugin'];
$configure = request_var('configure', false);
-
// Oh, they are just here for the view
if (isset($_GET['captcha_demo']))
{
@@ -46,17 +46,42 @@ class acp_captcha
// Delegate
if ($configure)
{
- $config_captcha =& phpbb_captcha_factory::get_instance($selected);
+ $config_captcha = $factory->get_instance($selected);
$config_captcha->acp_page($id, $this);
}
else
{
$config_vars = array(
- 'enable_confirm' => array('tpl' => 'REG_ENABLE', 'default' => false),
- 'enable_post_confirm' => array('tpl' => 'POST_ENABLE', 'default' => false),
- 'confirm_refresh' => array('tpl' => 'CONFIRM_REFRESH', 'default' => false),
- 'max_reg_attempts' => array('tpl' => 'REG_LIMIT', 'default' => 0),
- 'max_login_attempts' => array('tpl' => 'MAX_LOGIN_ATTEMPTS', 'default' => 0),
+ 'enable_confirm' => array(
+ 'tpl' => 'REG_ENABLE',
+ 'default' => false,
+ 'validate' => 'bool',
+ 'lang' => 'VISUAL_CONFIRM_REG',
+ ),
+ 'enable_post_confirm' => array(
+ 'tpl' => 'POST_ENABLE',
+ 'default' => false,
+ 'validate' => 'bool',
+ 'lang' => 'VISUAL_CONFIRM_POST',
+ ),
+ 'confirm_refresh' => array(
+ 'tpl' => 'CONFIRM_REFRESH',
+ 'default' => false,
+ 'validate' => 'bool',
+ 'lang' => 'VISUAL_CONFIRM_REFRESH',
+ ),
+ 'max_reg_attempts' => array(
+ 'tpl' => 'REG_LIMIT',
+ 'default' => 0,
+ 'validate' => 'int:0:99999',
+ 'lang' => 'REG_LIMIT',
+ ),
+ 'max_login_attempts' => array(
+ 'tpl' => 'MAX_LOGIN_ATTEMPTS',
+ 'default' => 0,
+ 'validate' => 'int:0:99999',
+ 'lang' => 'MAX_LOGIN_ATTEMPTS',
+ ),
);
$this->tpl_name = 'acp_captcha';
@@ -65,12 +90,31 @@ class acp_captcha
add_form_key($form_key);
$submit = request_var('main_submit', false);
+ $error = $cfg_array = array();
- if ($submit && check_form_key($form_key))
+ if ($submit)
{
foreach ($config_vars as $config_var => $options)
{
- set_config($config_var, request_var($config_var, $options['default']));
+ $cfg_array[$config_var] = $request->variable($config_var, $options['default']);
+ }
+ validate_config_vars($config_vars, $cfg_array, $error);
+
+ if (!check_form_key($form_key))
+ {
+ $error[] = $user->lang['FORM_INVALID'];
+ }
+ if ($error)
+ {
+ $submit = false;
+ }
+ }
+
+ if ($submit)
+ {
+ foreach ($cfg_array as $key => $value)
+ {
+ $config->set($key, $value);
}
if ($selected !== $config['captcha_plugin'])
@@ -78,11 +122,11 @@ class acp_captcha
// sanity check
if (isset($captchas['available'][$selected]))
{
- $old_captcha =& phpbb_captcha_factory::get_instance($config['captcha_plugin']);
+ $old_captcha = $factory->get_instance($config['captcha_plugin']);
$old_captcha->uninstall();
set_config('captcha_plugin', $selected);
- $new_captcha =& phpbb_captcha_factory::get_instance($config['captcha_plugin']);
+ $new_captcha = $factory->get_instance($config['captcha_plugin']);
$new_captcha->install();
add_log('admin', 'LOG_CONFIG_VISUAL');
@@ -94,26 +138,22 @@ class acp_captcha
}
trigger_error($user->lang['CONFIG_UPDATED'] . adm_back_link($this->u_action));
}
- else if ($submit)
- {
- trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING);
- }
else
{
$captcha_select = '';
foreach ($captchas['available'] as $value => $title)
{
$current = ($selected !== false && $value == $selected) ? ' selected="selected"' : '';
- $captcha_select .= '<option value="' . $value . '"' . $current . '>' . $user->lang[$title] . '</option>';
+ $captcha_select .= '<option value="' . $value . '"' . $current . '>' . $user->lang($title) . '</option>';
}
foreach ($captchas['unavailable'] as $value => $title)
{
$current = ($selected !== false && $value == $selected) ? ' selected="selected"' : '';
- $captcha_select .= '<option value="' . $value . '"' . $current . ' class="disabled-option">' . $user->lang[$title] . '</option>';
+ $captcha_select .= '<option value="' . $value . '"' . $current . ' class="disabled-option">' . $user->lang($title) . '</option>';
}
- $demo_captcha =& phpbb_captcha_factory::get_instance($selected);
+ $demo_captcha = $factory->get_instance($selected);
foreach ($config_vars as $config_var => $options)
{
@@ -124,6 +164,7 @@ class acp_captcha
'CAPTCHA_PREVIEW_TPL' => $demo_captcha->get_demo_template($id),
'S_CAPTCHA_HAS_CONFIG' => $demo_captcha->has_config(),
'CAPTCHA_SELECT' => $captcha_select,
+ 'ERROR_MSG' => implode('<br />', $error),
'U_ACTION' => $this->u_action,
));
@@ -136,9 +177,9 @@ class acp_captcha
*/
function deliver_demo($selected)
{
- global $db, $user, $config;
+ global $db, $user, $config, $phpbb_container;
- $captcha =& phpbb_captcha_factory::get_instance($selected);
+ $captcha = $phpbb_container->get('captcha.factory')->get_instance($selected);
$captcha->init(CONFIRM_REG);
$captcha->execute_demo();
@@ -146,5 +187,3 @@ class acp_captcha
exit_handler();
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/acp/acp_contact.php b/phpBB/includes/acp/acp_contact.php
new file mode 100644
index 0000000000..4e46df21e0
--- /dev/null
+++ b/phpBB/includes/acp/acp_contact.php
@@ -0,0 +1,134 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+/**
+* @ignore
+*/
+if (!defined('IN_PHPBB'))
+{
+ exit;
+}
+
+/**
+* @package acp
+*/
+class acp_contact
+{
+ public $u_action;
+
+ public function main($id, $mode)
+ {
+ global $user, $request, $template;
+ global $config, $phpbb_root_path, $phpEx, $phpbb_container;
+
+ $user->add_lang(array('acp/board', 'posting'));
+
+ $this->tpl_name = 'acp_contact';
+ $this->page_title = 'ACP_CONTACT_SETTINGS';
+ $form_name = 'acp_contact';
+ add_form_key($form_name);
+ $error = '';
+
+ if (!function_exists('display_custom_bbcodes'))
+ {
+ include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
+ }
+ if (!class_exists('parse_message'))
+ {
+ include($phpbb_root_path . 'includes/message_parser.' . $phpEx);
+ }
+
+ $config_text = $phpbb_container->get('config_text');
+
+ $contact_admin_data = $config_text->get_array(array(
+ 'contact_admin_info',
+ 'contact_admin_info_uid',
+ 'contact_admin_info_bitfield',
+ 'contact_admin_info_flags',
+ ));
+
+ $contact_admin_info = $contact_admin_data['contact_admin_info'];
+ $contact_admin_info_uid = $contact_admin_data['contact_admin_info_uid'];
+ $contact_admin_info_bitfield= $contact_admin_data['contact_admin_info_bitfield'];
+ $contact_admin_info_flags = $contact_admin_data['contact_admin_info_flags'];
+
+ if ($request->is_set_post('submit') || $request->is_set_post('preview'))
+ {
+ if (!check_form_key($form_name))
+ {
+ $error = $user->lang('FORM_INVALID');
+ }
+
+ $contact_admin_info = $request->variable('contact_admin_info', '', true);
+
+ generate_text_for_storage(
+ $contact_admin_info,
+ $contact_admin_info_uid,
+ $contact_admin_info_bitfield,
+ $contact_admin_info_flags,
+ !$request->variable('disable_bbcode', false),
+ !$request->variable('disable_magic_url', false),
+ !$request->variable('disable_smilies', false)
+ );
+
+ if (empty($error) && $request->is_set_post('submit'))
+ {
+ $config->set('contact_admin_form_enable', $request->variable('contact_admin_form_enable', false));
+
+ $config_text->set_array(array(
+ 'contact_admin_info' => $contact_admin_info,
+ 'contact_admin_info_uid' => $contact_admin_info_uid,
+ 'contact_admin_info_bitfield' => $contact_admin_info_bitfield,
+ 'contact_admin_info_flags' => $contact_admin_info_flags,
+ ));
+
+ trigger_error($user->lang['CONTACT_US_INFO_UPDATED'] . adm_back_link($this->u_action));
+ }
+ }
+
+ $contact_admin_info_preview = '';
+ if ($request->is_set_post('preview'))
+ {
+ $contact_admin_info_preview = generate_text_for_display($contact_admin_info, $contact_admin_info_uid, $contact_admin_info_bitfield, $contact_admin_info_flags);
+ }
+
+ $contact_admin_edit = generate_text_for_edit($contact_admin_info, $contact_admin_info_uid, $contact_admin_info_flags);
+
+ $template->assign_vars(array(
+ 'ERRORS' => $error,
+ 'CONTACT_ENABLED' => $config['contact_admin_form_enable'],
+
+ 'CONTACT_US_INFO' => $contact_admin_edit['text'],
+ 'CONTACT_US_INFO_PREVIEW' => $contact_admin_info_preview,
+
+ 'S_BBCODE_DISABLE_CHECKED' => !$contact_admin_edit['allow_bbcode'],
+ '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', '<a href="' . append_sid("{$phpbb_root_path}faq.$phpEx", 'mode=bbcode') . '">', '</a>'),
+ 'SMILIES_STATUS' => $user->lang['SMILIES_ARE_ON'],
+ 'IMG_STATUS' => $user->lang['IMAGES_ARE_ON'],
+ 'FLASH_STATUS' => $user->lang['FLASH_IS_ON'],
+ 'URL_STATUS' => $user->lang['URL_IS_ON'],
+
+ 'S_BBCODE_ALLOWED' => true,
+ 'S_SMILIES_ALLOWED' => true,
+ 'S_BBCODE_IMG' => true,
+ 'S_BBCODE_FLASH' => true,
+ 'S_LINKS_ALLOWED' => true,
+ ));
+
+ // Assigning custom bbcodes
+ display_custom_bbcodes();
+ }
+}
diff --git a/phpBB/includes/acp/acp_database.php b/phpBB/includes/acp/acp_database.php
index 758cd10434..dd0599e06a 100644
--- a/phpBB/includes/acp/acp_database.php
+++ b/phpBB/includes/acp/acp_database.php
@@ -1,10 +1,13 @@
<?php
/**
*
-* @package acp
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -16,9 +19,6 @@ if (!defined('IN_PHPBB'))
exit;
}
-/**
-* @package acp
-*/
class acp_database
{
var $db_tools;
@@ -29,11 +29,7 @@ class acp_database
global $cache, $db, $user, $auth, $template, $table_prefix;
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
- if (!class_exists('phpbb_db_tools'))
- {
- require($phpbb_root_path . 'includes/db/db_tools.' . $phpEx);
- }
- $this->db_tools = new phpbb_db_tools($db);
+ $this->db_tools = new \phpbb\db\tools($db);
$user->add_lang('acp/database');
@@ -43,6 +39,9 @@ class acp_database
$action = request_var('action', '');
$submit = (isset($_POST['submit'])) ? true : false;
+ $form_key = 'acp_database';
+ add_form_key($form_key);
+
$template->assign_vars(array(
'MODE' => $mode
));
@@ -66,6 +65,11 @@ class acp_database
trigger_error($user->lang['TABLE_SELECT_ERROR'] . adm_back_link($this->u_action), E_USER_WARNING);
}
+ if (!check_form_key($form_key))
+ {
+ trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING);
+ }
+
$store = $download = $structure = $schema_data = false;
if ($where == 'store_and_download' || $where == 'store')
@@ -94,34 +98,34 @@ class acp_database
$time = time();
$filename = 'backup_' . $time . '_' . unique_id();
- switch ($db->sql_layer)
+ switch ($db->get_sql_layer())
{
case 'mysqli':
case 'mysql4':
case 'mysql':
- $extractor = new mysql_extractor($download, $store, $format, $filename, $time);
+ $extractor = new mysql_extractor($format, $filename, $time, $download, $store);
break;
case 'sqlite':
- $extractor = new sqlite_extractor($download, $store, $format, $filename, $time);
+ $extractor = new sqlite_extractor($format, $filename, $time, $download, $store);
+ break;
+
+ case 'sqlite3':
+ $extractor = new sqlite3_extractor($format, $filename, $time, $download, $store);
break;
case 'postgres':
- $extractor = new postgres_extractor($download, $store, $format, $filename, $time);
+ $extractor = new postgres_extractor($format, $filename, $time, $download, $store);
break;
case 'oracle':
- $extractor = new oracle_extractor($download, $store, $format, $filename, $time);
+ $extractor = new oracle_extractor($format, $filename, $time, $download, $store);
break;
case 'mssql':
case 'mssql_odbc':
case 'mssqlnative':
- $extractor = new mssql_extractor($download, $store, $format, $filename, $time);
- break;
-
- case 'firebird':
- $extractor = new firebird_extractor($download, $store, $format, $filename, $time);
+ $extractor = new mssql_extractor($format, $filename, $time, $download, $store);
break;
}
@@ -137,10 +141,10 @@ class acp_database
else
{
// We might wanna empty out all that junk :D
- switch ($db->sql_layer)
+ switch ($db->get_sql_layer())
{
case 'sqlite':
- case 'firebird':
+ case 'sqlite3':
$extractor->flush('DELETE FROM ' . $table_name . ";\n");
break;
@@ -273,7 +277,7 @@ class acp_database
break;
}
- header('Pragma: no-cache');
+ header('Cache-Control: private, no-cache');
header("Content-Type: $mimetype; name=\"$name\"");
header("Content-disposition: attachment; filename=$name");
@@ -324,32 +328,19 @@ class acp_database
break;
}
- switch ($db->sql_layer)
+ switch ($db->get_sql_layer())
{
case 'mysql':
case 'mysql4':
case 'mysqli':
case 'sqlite':
+ case 'sqlite3':
while (($sql = $fgetd($fp, ";\n", $read, $seek, $eof)) !== false)
{
$db->sql_query($sql);
}
break;
- case 'firebird':
- $delim = ";\n";
- while (($sql = $fgetd($fp, $delim, $read, $seek, $eof)) !== false)
- {
- $query = trim($sql);
- if (substr($query, 0, 8) === 'SET TERM')
- {
- $delim = $query[9] . "\n";
- continue;
- }
- $db->sql_query($query);
- }
- break;
-
case 'postgres':
$delim = ";\n";
while (($sql = $fgetd($fp, $delim, $read, $seek, $eof)) !== false)
@@ -382,10 +373,10 @@ class acp_database
{
trigger_error($user->lang['RESTORE_FAILURE'] . adm_back_link($this->u_action), E_USER_WARNING);
}
- pg_put_line($db->db_connect_id, $sub . "\n");
+ pg_put_line($db->get_db_connect_id(), $sub . "\n");
}
- pg_put_line($db->db_connect_id, "\\.\n");
- pg_end_copy($db->db_connect_id);
+ pg_put_line($db->get_db_connect_id(), "\\.\n");
+ pg_end_copy($db->get_db_connect_id());
}
}
break;
@@ -478,9 +469,6 @@ class acp_database
}
}
-/**
-* @package acp
-*/
class base_extractor
{
var $fh;
@@ -493,8 +481,10 @@ class base_extractor
var $format;
var $run_comp = false;
- function base_extractor($download = false, $store = false, $format, $filename, $time)
+ function base_extractor($format, $filename, $time, $download = false, $store = false)
{
+ global $request;
+
$this->download = $download;
$this->store = $store;
$this->time = $time;
@@ -528,7 +518,7 @@ class base_extractor
if ($download == true)
{
$name = $filename . $ext;
- header('Pragma: no-cache');
+ header('Cache-Control: private, no-cache');
header("Content-Type: $mimetype; name=\"$name\"");
header("Content-disposition: attachment; filename=$name");
@@ -539,7 +529,7 @@ class base_extractor
break;
case 'gzip':
- if ((isset($_SERVER['HTTP_ACCEPT_ENCODING']) && strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') !== false) && strpos(strtolower($_SERVER['HTTP_USER_AGENT']), 'msie') === false)
+ if (strpos($request->header('Accept-Encoding'), 'gzip') !== false && strpos(strtolower($request->header('User-Agent')), 'msie') === false)
{
ob_start('ob_gzhandler');
}
@@ -622,9 +612,6 @@ class base_extractor
}
}
-/**
-* @package acp
-*/
class mysql_extractor extends base_extractor
{
function write_start($table_prefix)
@@ -644,7 +631,7 @@ class mysql_extractor extends base_extractor
if ($new_extract === null)
{
- if ($db->sql_layer === 'mysqli' || version_compare($db->sql_server_info(true), '3.23.20', '>='))
+ if ($db->get_sql_layer() === 'mysqli' || version_compare($db->sql_server_info(true), '3.23.20', '>='))
{
$new_extract = true;
}
@@ -667,7 +654,7 @@ class mysql_extractor extends base_extractor
function write_data($table_name)
{
global $db;
- if ($db->sql_layer === 'mysqli')
+ if ($db->get_sql_layer() === 'mysqli')
{
$this->write_data_mysqli($table_name);
}
@@ -682,7 +669,7 @@ class mysql_extractor extends base_extractor
global $db;
$sql = "SELECT *
FROM $table_name";
- $result = mysqli_query($db->db_connect_id, $sql, MYSQLI_USE_RESULT);
+ $result = mysqli_query($db->get_db_connect_id(), $sql, MYSQLI_USE_RESULT);
if ($result != false)
{
$fields_cnt = mysqli_num_fields($result);
@@ -761,7 +748,7 @@ class mysql_extractor extends base_extractor
global $db;
$sql = "SELECT *
FROM $table_name";
- $result = mysql_unbuffered_query($sql, $db->db_connect_id);
+ $result = mysql_unbuffered_query($sql, $db->get_db_connect_id());
if ($result != false)
{
@@ -948,9 +935,6 @@ class mysql_extractor extends base_extractor
}
}
-/**
-* @package acp
-*/
class sqlite_extractor extends base_extractor
{
function write_start($prefix)
@@ -1016,50 +1000,118 @@ class sqlite_extractor extends base_extractor
function write_data($table_name)
{
global $db;
- static $proper;
- if (is_null($proper))
- {
- $proper = version_compare(PHP_VERSION, '5.1.3', '>=');
- }
+ $col_types = sqlite_fetch_column_types($db->get_db_connect_id(), $table_name);
- if ($proper)
+ $sql = "SELECT *
+ FROM $table_name";
+ $result = sqlite_unbuffered_query($db->get_db_connect_id(), $sql);
+ $rows = sqlite_fetch_all($result, SQLITE_ASSOC);
+ $sql_insert = 'INSERT INTO ' . $table_name . ' (' . implode(', ', array_keys($col_types)) . ') VALUES (';
+ foreach ($rows as $row)
{
- $col_types = sqlite_fetch_column_types($db->db_connect_id, $table_name);
+ foreach ($row as $column_name => $column_data)
+ {
+ if (is_null($column_data))
+ {
+ $row[$column_name] = 'NULL';
+ }
+ else if ($column_data == '')
+ {
+ $row[$column_name] = "''";
+ }
+ else if (strpos($col_types[$column_name], 'text') !== false || strpos($col_types[$column_name], 'char') !== false || strpos($col_types[$column_name], 'blob') !== false)
+ {
+ $row[$column_name] = sanitize_data_generic(str_replace("'", "''", $column_data));
+ }
+ }
+ $this->flush($sql_insert . implode(', ', $row) . ");\n");
}
- else
- {
- $sql = "SELECT sql
- FROM sqlite_master
- WHERE type = 'table'
- AND name = '" . $table_name . "'";
- $table_data = sqlite_single_query($db->db_connect_id, $sql);
- $table_data = preg_replace('#CREATE\s+TABLE\s+"?' . $table_name . '"?#i', '', $table_data);
- $table_data = trim($table_data);
+ }
- preg_match('#\((.*)\)#s', $table_data, $matches);
+ function write_end()
+ {
+ $this->flush("COMMIT;\n");
+ parent::write_end();
+ }
+}
+
+class sqlite3_extractor extends base_extractor
+{
+ function write_start($prefix)
+ {
+ $sql_data = "--\n";
+ $sql_data .= "-- phpBB Backup Script\n";
+ $sql_data .= "-- Dump of tables for $prefix\n";
+ $sql_data .= "-- DATE : " . gmdate("d-m-Y H:i:s", $this->time) . " GMT\n";
+ $sql_data .= "--\n";
+ $sql_data .= "BEGIN TRANSACTION;\n";
+ $this->flush($sql_data);
+ }
- $table_cols = explode(',', trim($matches[1]));
- foreach ($table_cols as $declaration)
+ function write_table($table_name)
+ {
+ global $db;
+ $sql_data = '-- Table: ' . $table_name . "\n";
+ $sql_data .= "DROP TABLE $table_name;\n";
+
+ $sql = "SELECT sql
+ FROM sqlite_master
+ WHERE type = 'table'
+ AND name = '" . $db->sql_escape($table_name) . "'
+ ORDER BY name ASC;";
+ $result = $db->sql_query($sql);
+ $row = $db->sql_fetchrow($result);
+ $db->sql_freeresult($result);
+
+ // Create Table
+ $sql_data .= $row['sql'] . ";\n";
+
+ $result = $db->sql_query("PRAGMA index_list('" . $db->sql_escape($table_name) . "');");
+
+ while ($row = $db->sql_fetchrow($result))
+ {
+ if (strpos($row['name'], 'autoindex') !== false)
{
- $entities = preg_split('#\s+#', trim($declaration));
- $column_name = preg_replace('/"?([^"]+)"?/', '\1', $entities[0]);
+ continue;
+ }
- // Hit a primary key, those are not what we need :D
- if (empty($entities[1]) || (strtolower($entities[0]) === 'primary' && strtolower($entities[1]) === 'key'))
- {
- continue;
- }
- $col_types[$column_name] = $entities[1];
+ $result2 = $db->sql_query("PRAGMA index_info('" . $db->sql_escape($row['name']) . "');");
+
+ $fields = array();
+ while ($row2 = $db->sql_fetchrow($result2))
+ {
+ $fields[] = $row2['name'];
}
+ $db->sql_freeresult($result2);
+
+ $sql_data .= 'CREATE ' . ($row['unique'] ? 'UNIQUE ' : '') . 'INDEX ' . $row['name'] . ' ON ' . $table_name . ' (' . implode(', ', $fields) . ");\n";
}
+ $db->sql_freeresult($result);
+
+ $this->flush($sql_data . "\n");
+ }
+
+ function write_data($table_name)
+ {
+ global $db;
+
+ $result = $db->sql_query("PRAGMA table_info('" . $db->sql_escape($table_name) . "');");
+
+ $col_types = array();
+ while ($row = $db->sql_fetchrow($result))
+ {
+ $col_types[$row['name']] = $row['type'];
+ }
+ $db->sql_freeresult($result);
+
+ $sql_insert = 'INSERT INTO ' . $table_name . ' (' . implode(', ', array_keys($col_types)) . ') VALUES (';
$sql = "SELECT *
FROM $table_name";
- $result = sqlite_unbuffered_query($db->db_connect_id, $sql);
- $rows = sqlite_fetch_all($result, SQLITE_ASSOC);
- $sql_insert = 'INSERT INTO ' . $table_name . ' (' . implode(', ', array_keys($col_types)) . ') VALUES (';
- foreach ($rows as $row)
+ $result = $db->sql_query($sql);
+
+ while ($row = $db->sql_fetchrow($result))
{
foreach ($row as $column_name => $column_data)
{
@@ -1067,11 +1119,11 @@ class sqlite_extractor extends base_extractor
{
$row[$column_name] = 'NULL';
}
- else if ($column_data == '')
+ else if ($column_data === '')
{
$row[$column_name] = "''";
}
- else if (strpos($col_types[$column_name], 'text') !== false || strpos($col_types[$column_name], 'char') !== false || strpos($col_types[$column_name], 'blob') !== false)
+ else if (stripos($col_types[$column_name], 'text') !== false || stripos($col_types[$column_name], 'char') !== false || stripos($col_types[$column_name], 'blob') !== false)
{
$row[$column_name] = sanitize_data_generic(str_replace("'", "''", $column_data));
}
@@ -1087,9 +1139,6 @@ class sqlite_extractor extends base_extractor
}
}
-/**
-* @package acp
-*/
class postgres_extractor extends base_extractor
{
function write_start($prefix)
@@ -1132,6 +1181,7 @@ class postgres_extractor extends base_extractor
$this->flush($sql_data . ";\n");
}
}
+ $db->sql_freeresult($result);
$sql_data = '-- Table: ' . $table_name . "\n";
$sql_data .= "DROP TABLE $table_name;\n";
@@ -1218,7 +1268,6 @@ class postgres_extractor extends base_extractor
}
$db->sql_freeresult($result);
-
// Get the listing of primary keys.
$sql_pri_keys = "SELECT ic.relname as index_name, bc.relname as tab_name, ta.attname as column_name, i.indisunique as unique_key, i.indisprimary as primary_key
FROM pg_class bc, pg_class ic, pg_index i, pg_attribute ta, pg_attribute ia
@@ -1318,7 +1367,6 @@ class postgres_extractor extends base_extractor
$ary_type[] = pg_field_type($result, $i);
$ary_name[] = pg_field_name($result, $i);
-
$sql = "SELECT pg_get_expr(d.adbin, d.adrelid) as rowdefault
FROM pg_attrdef d, pg_class c
WHERE (c.relname = '{$table_name}')
@@ -1381,9 +1429,6 @@ class postgres_extractor extends base_extractor
}
}
-/**
-* @package acp
-*/
class mssql_extractor extends base_extractor
{
function write_end()
@@ -1517,11 +1562,11 @@ class mssql_extractor extends base_extractor
{
global $db;
- if ($db->sql_layer === 'mssql')
+ if ($db->get_sql_layer() === 'mssql')
{
$this->write_data_mssql($table_name);
}
- else if($db->sql_layer === 'mssqlnative')
+ else if ($db->get_sql_layer() === 'mssqlnative')
{
$this->write_data_mssqlnative($table_name);
}
@@ -1624,7 +1669,7 @@ class mssql_extractor extends base_extractor
}
$this->flush($sql_data);
}
-
+
function write_data_mssqlnative($table_name)
{
global $db;
@@ -1645,16 +1690,17 @@ class mssql_extractor extends base_extractor
return;
}
- $sql = "SELECT * FROM $table_name";
- $result_fields = $db->sql_query_limit($sql, 1);
+ $sql = "SELECT COLUMN_NAME, DATA_TYPE
+ FROM INFORMATION_SCHEMA.COLUMNS
+ WHERE INFORMATION_SCHEMA.COLUMNS.TABLE_NAME = '" . $db->sql_escape($table_name) . "'";
+ $result_fields = $db->sql_query($sql);
- $row = new result_mssqlnative($result_fields);
- $i_num_fields = $row->num_fields();
-
- for ($i = 0; $i < $i_num_fields; $i++)
+ $i_num_fields = 0;
+ while ($row = $db->sql_fetchrow($result_fields))
{
- $ary_type[$i] = $row->field_type($i);
- $ary_name[$i] = $row->field_name($i);
+ $ary_type[$i_num_fields] = $row['DATA_TYPE'];
+ $ary_name[$i_num_fields] = $row['COLUMN_NAME'];
+ $i_num_fields++;
}
$db->sql_freeresult($result_fields);
@@ -1663,7 +1709,7 @@ class mssql_extractor extends base_extractor
WHERE COLUMNPROPERTY(object_id('$table_name'), COLUMN_NAME, 'IsIdentity') = 1";
$result2 = $db->sql_query($sql);
$row2 = $db->sql_fetchrow($result2);
-
+
if (!empty($row2['has_identity']))
{
$sql_data .= "\nSET IDENTITY_INSERT $table_name ON\nGO\n";
@@ -1727,8 +1773,8 @@ class mssql_extractor extends base_extractor
$sql_data .= "\nSET IDENTITY_INSERT $table_name OFF\nGO\n";
}
$this->flush($sql_data);
- }
-
+ }
+
function write_data_odbc($table_name)
{
global $db;
@@ -1827,9 +1873,6 @@ class mssql_extractor extends base_extractor
}
-/**
-* @package acp
-*/
class oracle_extractor extends base_extractor
{
function write_table($table_name)
@@ -2057,238 +2100,6 @@ class oracle_extractor extends base_extractor
}
}
-/**
-* @package acp
-*/
-class firebird_extractor extends base_extractor
-{
- function write_start($prefix)
- {
- $sql_data = "--\n";
- $sql_data .= "-- phpBB Backup Script\n";
- $sql_data .= "-- Dump of tables for $prefix\n";
- $sql_data .= "-- DATE : " . gmdate("d-m-Y H:i:s", $this->time) . " GMT\n";
- $sql_data .= "--\n";
- $this->flush($sql_data);
- }
-
- function write_data($table_name)
- {
- global $db;
- $ary_type = $ary_name = array();
-
- // Grab all of the data from current table.
- $sql = "SELECT *
- FROM $table_name";
- $result = $db->sql_query($sql);
-
- $i_num_fields = ibase_num_fields($result);
-
- for ($i = 0; $i < $i_num_fields; $i++)
- {
- $info = ibase_field_info($result, $i);
- $ary_type[$i] = $info['type'];
- $ary_name[$i] = $info['name'];
- }
-
- while ($row = $db->sql_fetchrow($result))
- {
- $schema_vals = $schema_fields = array();
-
- // Build the SQL statement to recreate the data.
- for ($i = 0; $i < $i_num_fields; $i++)
- {
- $str_val = $row[strtolower($ary_name[$i])];
-
- if (preg_match('#char|text|bool|varbinary|blob#i', $ary_type[$i]))
- {
- $str_quote = '';
- $str_empty = "''";
- $str_val = sanitize_data_generic(str_replace("'", "''", $str_val));
- }
- else if (preg_match('#date|timestamp#i', $ary_type[$i]))
- {
- if (empty($str_val))
- {
- $str_quote = '';
- }
- else
- {
- $str_quote = "'";
- }
- }
- else
- {
- $str_quote = '';
- $str_empty = 'NULL';
- }
-
- if (empty($str_val) && $str_val !== '0')
- {
- $str_val = $str_empty;
- }
-
- $schema_vals[$i] = $str_quote . $str_val . $str_quote;
- $schema_fields[$i] = '"' . $ary_name[$i] . '"';
- }
-
- // Take the ordered fields and their associated data and build it
- // into a valid sql statement to recreate that field in the data.
- $sql_data = "INSERT INTO $table_name (" . implode(', ', $schema_fields) . ') VALUES (' . implode(', ', $schema_vals) . ");\n";
-
- $this->flush($sql_data);
- }
- $db->sql_freeresult($result);
- }
-
- function write_table($table_name)
- {
- global $db;
-
- $sql_data = '-- Table: ' . $table_name . "\n";
- $sql_data .= "DROP TABLE $table_name;\n";
-
- $data_types = array(7 => 'SMALLINT', 8 => 'INTEGER', 10 => 'FLOAT', 12 => 'DATE', 13 => 'TIME', 14 => 'CHARACTER', 27 => 'DOUBLE PRECISION', 35 => 'TIMESTAMP', 37 => 'VARCHAR', 40 => 'CSTRING', 261 => 'BLOB', 701 => 'DECIMAL', 702 => 'NUMERIC');
-
- $sql_data .= "\nCREATE TABLE $table_name (\n";
-
- $sql = 'SELECT DISTINCT R.RDB$FIELD_NAME as FNAME, R.RDB$NULL_FLAG as NFLAG, R.RDB$DEFAULT_SOURCE as DSOURCE, F.RDB$FIELD_TYPE as FTYPE, F.RDB$FIELD_SUB_TYPE as STYPE, F.RDB$FIELD_LENGTH as FLEN
- FROM RDB$RELATION_FIELDS R
- JOIN RDB$FIELDS F ON R.RDB$FIELD_SOURCE=F.RDB$FIELD_NAME
- LEFT JOIN RDB$FIELD_DIMENSIONS D ON R.RDB$FIELD_SOURCE = D.RDB$FIELD_NAME
- WHERE F.RDB$SYSTEM_FLAG = 0
- AND R.RDB$RELATION_NAME = \''. $table_name . '\'
- ORDER BY R.RDB$FIELD_POSITION';
- $result = $db->sql_query($sql);
-
- $rows = array();
- while ($row = $db->sql_fetchrow($result))
- {
- $line = "\t" . '"' . $row['fname'] . '" ' . $data_types[$row['ftype']];
-
- if ($row['ftype'] == 261 && $row['stype'] == 1)
- {
- $line .= ' SUB_TYPE TEXT';
- }
-
- if ($row['ftype'] == 37 || $row['ftype'] == 14)
- {
- $line .= ' (' . $row['flen'] . ')';
- }
-
- if (!empty($row['dsource']))
- {
- $line .= ' ' . $row['dsource'];
- }
-
- if (!empty($row['nflag']))
- {
- $line .= ' NOT NULL';
- }
- $rows[] = $line;
- }
- $db->sql_freeresult($result);
-
- $sql_data .= implode(",\n", $rows);
- $sql_data .= "\n);\n";
- $keys = array();
-
- $sql = 'SELECT I.RDB$FIELD_NAME as NAME
- FROM RDB$RELATION_CONSTRAINTS RC, RDB$INDEX_SEGMENTS I, RDB$INDICES IDX
- WHERE (I.RDB$INDEX_NAME = RC.RDB$INDEX_NAME)
- AND (IDX.RDB$INDEX_NAME = RC.RDB$INDEX_NAME)
- AND (RC.RDB$RELATION_NAME = \''. $table_name . '\')
- ORDER BY I.RDB$FIELD_POSITION';
- $result = $db->sql_query($sql);
-
- while ($row = $db->sql_fetchrow($result))
- {
- $keys[] = $row['name'];
- }
-
- if (sizeof($keys))
- {
- $sql_data .= "\nALTER TABLE $table_name ADD PRIMARY KEY (" . implode(', ', $keys) . ');';
- }
-
- $db->sql_freeresult($result);
-
- $sql = 'SELECT I.RDB$INDEX_NAME as INAME, I.RDB$UNIQUE_FLAG as UFLAG, S.RDB$FIELD_NAME as FNAME
- FROM RDB$INDICES I JOIN RDB$INDEX_SEGMENTS S ON S.RDB$INDEX_NAME=I.RDB$INDEX_NAME
- WHERE (I.RDB$SYSTEM_FLAG IS NULL OR I.RDB$SYSTEM_FLAG=0)
- AND I.RDB$FOREIGN_KEY IS NULL
- AND I.RDB$RELATION_NAME = \''. $table_name . '\'
- AND I.RDB$INDEX_NAME NOT STARTING WITH \'RDB$\'
- ORDER BY S.RDB$FIELD_POSITION';
- $result = $db->sql_query($sql);
-
- $index = array();
- while ($row = $db->sql_fetchrow($result))
- {
- $index[$row['iname']]['unique'] = !empty($row['uflag']);
- $index[$row['iname']]['values'][] = $row['fname'];
- }
-
- foreach ($index as $index_name => $data)
- {
- $sql_data .= "\nCREATE ";
- if ($data['unique'])
- {
- $sql_data .= 'UNIQUE ';
- }
- $sql_data .= "INDEX $index_name ON $table_name(" . implode(', ', $data['values']) . ");";
- }
- $sql_data .= "\n";
-
- $db->sql_freeresult($result);
-
- $sql = 'SELECT D1.RDB$DEPENDENT_NAME as DNAME, D1.RDB$FIELD_NAME as FNAME, D1.RDB$DEPENDENT_TYPE, R1.RDB$RELATION_NAME
- FROM RDB$DEPENDENCIES D1
- LEFT JOIN RDB$RELATIONS R1 ON ((D1.RDB$DEPENDENT_NAME = R1.RDB$RELATION_NAME) AND (NOT (R1.RDB$VIEW_BLR IS NULL)))
- WHERE (D1.RDB$DEPENDED_ON_TYPE = 0)
- AND (D1.RDB$DEPENDENT_TYPE <> 3)
- AND (D1.RDB$DEPENDED_ON_NAME = \'' . $table_name . '\')
- UNION SELECT DISTINCT F2.RDB$RELATION_NAME, D2.RDB$FIELD_NAME, D2.RDB$DEPENDENT_TYPE, R2.RDB$RELATION_NAME FROM RDB$DEPENDENCIES D2, RDB$RELATION_FIELDS F2
- LEFT JOIN RDB$RELATIONS R2 ON ((F2.RDB$RELATION_NAME = R2.RDB$RELATION_NAME) AND (NOT (R2.RDB$VIEW_BLR IS NULL)))
- WHERE (D2.RDB$DEPENDENT_TYPE = 3)
- AND (D2.RDB$DEPENDENT_NAME = F2.RDB$FIELD_SOURCE)
- AND (D2.RDB$DEPENDED_ON_NAME = \'' . $table_name . '\')
- ORDER BY 1, 2';
- $result = $db->sql_query($sql);
- while ($row = $db->sql_fetchrow($result))
- {
- $sql = 'SELECT T1.RDB$DEPENDED_ON_NAME as GEN, T1.RDB$FIELD_NAME, T1.RDB$DEPENDED_ON_TYPE
- FROM RDB$DEPENDENCIES T1
- WHERE (T1.RDB$DEPENDENT_NAME = \'' . $row['dname'] . '\')
- AND (T1.RDB$DEPENDENT_TYPE = 2 AND T1.RDB$DEPENDED_ON_TYPE = 14)
- UNION ALL SELECT DISTINCT D.RDB$DEPENDED_ON_NAME, D.RDB$FIELD_NAME, D.RDB$DEPENDED_ON_TYPE
- FROM RDB$DEPENDENCIES D, RDB$RELATION_FIELDS F
- WHERE (D.RDB$DEPENDENT_TYPE = 3)
- AND (D.RDB$DEPENDENT_NAME = F.RDB$FIELD_SOURCE)
- AND (F.RDB$RELATION_NAME = \'' . $row['dname'] . '\')
- ORDER BY 1,2';
- $result2 = $db->sql_query($sql);
- $row2 = $db->sql_fetchrow($result2);
- $db->sql_freeresult($result2);
- $gen_name = $row2['gen'];
-
- $sql_data .= "\nDROP GENERATOR " . $gen_name . ";";
- $sql_data .= "\nSET TERM ^ ;";
- $sql_data .= "\nCREATE GENERATOR " . $gen_name . "^";
- $sql_data .= "\nSET GENERATOR " . $gen_name . " TO 0^\n";
- $sql_data .= "\nCREATE TRIGGER {$row['dname']} FOR $table_name";
- $sql_data .= "\nBEFORE INSERT\nAS\nBEGIN";
- $sql_data .= "\n NEW.{$row['fname']} = GEN_ID(" . $gen_name . ", 1);";
- $sql_data .= "\nEND^\n";
- $sql_data .= "\nSET TERM ; ^\n";
- }
-
- $this->flush($sql_data);
-
- $db->sql_freeresult($result);
- }
-}
-
// get how much space we allow for a chunk of data, very similar to phpMyAdmin's way of doing things ;-) (hey, we only do this for MySQL anyway :P)
function get_usable_memory()
{
@@ -2464,5 +2275,3 @@ function fgetd_seekless(&$fp, $delim, $read, $seek, $eof, $buffer = 8192)
return false;
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/acp/acp_disallow.php b/phpBB/includes/acp/acp_disallow.php
index e2176b7bcd..5b12013708 100644
--- a/phpBB/includes/acp/acp_disallow.php
+++ b/phpBB/includes/acp/acp_disallow.php
@@ -1,10 +1,13 @@
<?php
/**
*
-* @package acp
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -16,9 +19,6 @@ if (!defined('IN_PHPBB'))
exit;
}
-/**
-* @package acp
-*/
class acp_disallow
{
var $u_action;
@@ -26,9 +26,7 @@ class acp_disallow
function main($id, $mode)
{
global $db, $user, $auth, $template, $cache;
- global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
-
- include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
+ global $config, $phpbb_admin_path;
$user->add_lang('acp/posting');
@@ -116,5 +114,3 @@ class acp_disallow
);
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/acp/acp_email.php b/phpBB/includes/acp/acp_email.php
index df0d44c0c5..917d02318e 100644
--- a/phpBB/includes/acp/acp_email.php
+++ b/phpBB/includes/acp/acp_email.php
@@ -1,10 +1,13 @@
<?php
/**
*
-* @package acp
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -16,9 +19,6 @@ if (!defined('IN_PHPBB'))
exit;
}
-/**
-* @package acp
-*/
class acp_email
{
var $u_action;
@@ -26,7 +26,7 @@ class acp_email
function main($id, $mode)
{
global $config, $db, $user, $auth, $template, $cache;
- global $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix;
+ global $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix, $phpbb_dispatcher;
$user->add_lang('acp/email');
$this->tpl_name = 'acp_email';
@@ -40,6 +40,7 @@ class acp_email
$error = array();
$usernames = request_var('usernames', '', true);
+ $usernames = (!empty($usernames)) ? explode("\n", $usernames) : array();
$group_id = request_var('g', 0);
$subject = utf8_normalize_nfc(request_var('subject', '', true));
$message = utf8_normalize_nfc(request_var('message', '', true));
@@ -69,14 +70,18 @@ class acp_email
if (!sizeof($error))
{
- if ($usernames)
+ if (!empty($usernames))
{
// If giving usernames the admin is able to email inactive users too...
- $sql = 'SELECT username, user_email, user_jabber, user_notify_type, user_lang
- FROM ' . USERS_TABLE . '
- WHERE ' . $db->sql_in_set('username_clean', array_map('utf8_clean_string', explode("\n", $usernames))) . '
- AND user_allow_massemail = 1
- ORDER BY user_lang, user_notify_type'; // , SUBSTRING(user_email FROM INSTR(user_email, '@'))
+ $sql_ary = array(
+ 'SELECT' => 'username, user_email, user_jabber, user_notify_type, user_lang',
+ 'FROM' => array(
+ USERS_TABLE => '',
+ ),
+ 'WHERE' => $db->sql_in_set('username_clean', array_map('utf8_clean_string', $usernames)) . '
+ AND user_allow_massemail = 1',
+ 'ORDER_BY' => 'user_lang, user_notify_type',
+ );
}
else
{
@@ -123,8 +128,18 @@ class acp_email
),
);
}
- $sql = $db->sql_build_query('SELECT', $sql_ary);
}
+ /**
+ * Modify sql query to change the list of users the email is sent to
+ *
+ * @event core.acp_email_modify_sql
+ * @var array sql_ary Array which is used to build the sql query
+ * @since 3.1.2-RC1
+ */
+ $vars = array('sql_ary');
+ extract($phpbb_dispatcher->trigger_event('core.acp_email_modify_sql', compact($vars)));
+
+ $sql = $db->sql_build_query('SELECT', $sql_ary);
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
@@ -174,12 +189,52 @@ class acp_email
$db->sql_freeresult($result);
// Send the messages
- include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);
- include_once($phpbb_root_path . 'includes/functions_user.' . $phpEx);
+ if (!class_exists('messenger'))
+ {
+ include($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);
+ }
+
+ if (!function_exists('get_group_name'))
+ {
+ include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
+ }
$messenger = new messenger($use_queue);
$errored = false;
+ $email_template = 'admin_send_email';
+ $template_data = array(
+ 'CONTACT_EMAIL' => phpbb_get_board_contact($config, $phpEx),
+ 'MESSAGE' => htmlspecialchars_decode($message),
+ );
+ $generate_log_entry = true;
+
+ /**
+ * Modify email template data before the emails are sent
+ *
+ * @event core.acp_email_send_before
+ * @var string email_template The template to be used for sending the email
+ * @var string subject The subject of the email
+ * @var array template_data Array with template data assigned to email template
+ * @var bool generate_log_entry If false, no log entry will be created
+ * @var array usernames Usernames which will be displayed in log entry, if it will be created
+ * @var int group_id The group this email will be sent to
+ * @var bool use_queue If true, email queue will be used for sending
+ * @var int priority Priority of sent emails
+ * @since 3.1.3-RC1
+ */
+ $vars = array(
+ 'email_template',
+ 'subject',
+ 'template_data',
+ 'generate_log_entry',
+ 'usernames',
+ 'group_id',
+ 'use_queue',
+ 'priority',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.acp_email_send_before', compact($vars)));
+
for ($i = 0, $size = sizeof($email_list); $i < $size; $i++)
{
$used_lang = $email_list[$i][0]['lang'];
@@ -193,17 +248,14 @@ class acp_email
$messenger->im($email_row['jabber'], $email_row['name']);
}
- $messenger->template('admin_send_email', $used_lang);
+ $messenger->template($email_template, $used_lang);
$messenger->anti_abuse_headers($config, $user);
$messenger->subject(htmlspecialchars_decode($subject));
$messenger->set_mail_priority($priority);
- $messenger->assign_vars(array(
- 'CONTACT_EMAIL' => $config['board_contact'],
- 'MESSAGE' => htmlspecialchars_decode($message))
- );
+ $messenger->assign_vars($template_data);
if (!($messenger->send($used_method)))
{
@@ -214,24 +266,26 @@ class acp_email
$messenger->save_queue();
- if ($usernames)
+ if ($generate_log_entry)
{
- $usernames = explode("\n", $usernames);
- add_log('admin', 'LOG_MASS_EMAIL', implode(', ', utf8_normalize_nfc($usernames)));
- }
- else
- {
- if ($group_id)
+ if (!empty($usernames))
{
- $group_name = get_group_name($group_id);
+ add_log('admin', 'LOG_MASS_EMAIL', implode(', ', utf8_normalize_nfc($usernames)));
}
else
{
- // Not great but the logging routine doesn't cope well with localising on the fly
- $group_name = $user->lang['ALL_USERS'];
- }
+ if ($group_id)
+ {
+ $group_name = get_group_name($group_id);
+ }
+ else
+ {
+ // Not great but the logging routine doesn't cope well with localising on the fly
+ $group_name = $user->lang['ALL_USERS'];
+ }
- add_log('admin', 'LOG_MASS_EMAIL', $group_name);
+ add_log('admin', 'LOG_MASS_EMAIL', $group_name);
+ }
}
if (!$errored)
@@ -267,19 +321,31 @@ class acp_email
$s_priority_options .= '<option value="' . MAIL_NORMAL_PRIORITY . '" selected="selected">' . $user->lang['MAIL_NORMAL_PRIORITY'] . '</option>';
$s_priority_options .= '<option value="' . MAIL_HIGH_PRIORITY . '">' . $user->lang['MAIL_HIGH_PRIORITY'] . '</option>';
- $template->assign_vars(array(
+ $template_data = array(
'S_WARNING' => (sizeof($error)) ? true : false,
'WARNING_MSG' => (sizeof($error)) ? implode('<br />', $error) : '',
'U_ACTION' => $this->u_action,
'S_GROUP_OPTIONS' => $select_list,
- 'USERNAMES' => $usernames,
+ 'USERNAMES' => implode("\n", $usernames),
'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&amp;form=acp_email&amp;field=usernames'),
'SUBJECT' => $subject,
'MESSAGE' => $message,
- 'S_PRIORITY_OPTIONS' => $s_priority_options)
+ 'S_PRIORITY_OPTIONS' => $s_priority_options,
);
+ /**
+ * Modify custom email template data before we display the form
+ *
+ * @event core.acp_email_display
+ * @var array template_data Array with template data assigned to email template
+ * @var array exclude Array with groups which are excluded from group selection
+ * @var array usernames Usernames which will be displayed in form
+ *
+ * @since 3.1.4-RC1
+ */
+ $vars = array('template_data', 'exclude', 'usernames');
+ extract($phpbb_dispatcher->trigger_event('core.acp_email_display', compact($vars)));
+
+ $template->assign_vars($template_data);
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/acp/acp_extensions.php b/phpBB/includes/acp/acp_extensions.php
new file mode 100644
index 0000000000..f0348817c8
--- /dev/null
+++ b/phpBB/includes/acp/acp_extensions.php
@@ -0,0 +1,603 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+/**
+* @ignore
+*/
+if (!defined('IN_PHPBB'))
+{
+ exit;
+}
+
+class acp_extensions
+{
+ var $u_action;
+ var $tpl_name;
+ var $page_title;
+
+ private $config;
+ private $template;
+ private $user;
+ private $cache;
+ private $log;
+ private $request;
+ private $phpbb_dispatcher;
+ private $ext_manager;
+
+ function main()
+ {
+ // Start the page
+ global $config, $user, $template, $request, $phpbb_extension_manager, $phpbb_root_path, $phpEx, $phpbb_log, $cache, $phpbb_dispatcher;
+
+ $this->config = $config;
+ $this->template = $template;
+ $this->user = $user;
+ $this->cache = $cache;
+ $this->request = $request;
+ $this->log = $phpbb_log;
+ $this->phpbb_dispatcher = $phpbb_dispatcher;
+ $this->ext_manager = $phpbb_extension_manager;
+
+ $this->user->add_lang(array('install', 'acp/extensions', 'migrator'));
+
+ $this->page_title = 'ACP_EXTENSIONS';
+
+ $action = $this->request->variable('action', 'list');
+ $ext_name = $this->request->variable('ext_name', '');
+
+ // What is a safe limit of execution time? Half the max execution time should be safe.
+ $safe_time_limit = (ini_get('max_execution_time') / 2);
+ $start_time = time();
+
+ // Cancel action
+ if ($this->request->is_set_post('cancel'))
+ {
+ $action = 'list';
+ $ext_name = '';
+ }
+
+ if (in_array($action, array('enable', 'disable', 'delete_data')) && !check_link_hash($this->request->variable('hash', ''), $action . '.' . $ext_name))
+ {
+ trigger_error('FORM_INVALID', E_USER_WARNING);
+ }
+
+ /**
+ * Event to run a specific action on extension
+ *
+ * @event core.acp_extensions_run_action_before
+ * @var string action Action to run; if the event completes execution of the action, should be set to 'none'
+ * @var string u_action Url we are at
+ * @var string ext_name Extension name from request
+ * @var int safe_time_limit Safe limit of execution time
+ * @var int start_time Start time
+ * @var string tpl_name Template file to load
+ * @since 3.1.11-RC1
+ * @changed 3.2.1-RC1 Renamed to core.acp_extensions_run_action_before, added tpl_name, added action 'none'
+ */
+ $u_action = $this->u_action;
+ $tpl_name = '';
+ $vars = array('action', 'u_action', 'ext_name', 'safe_time_limit', 'start_time', 'tpl_name');
+ extract($this->phpbb_dispatcher->trigger_event('core.acp_extensions_run_action_before', compact($vars)));
+
+ // In case they have been updated by the event
+ $this->u_action = $u_action;
+ $this->tpl_name = $tpl_name;
+
+ // If they've specified an extension, let's load the metadata manager and validate it.
+ if ($ext_name)
+ {
+ $md_manager = $this->ext_manager->create_extension_metadata_manager($ext_name, $this->template);
+
+ try
+ {
+ $md_manager->get_metadata('all');
+ }
+ catch (\phpbb\extension\exception $e)
+ {
+ trigger_error($e, E_USER_WARNING);
+ }
+ }
+
+ // What are we doing?
+ switch ($action)
+ {
+ case 'none':
+ // Intentionally empty, used by extensions that execute additional actions in the prior event
+ break;
+
+ case 'set_config_version_check_force_unstable':
+ $force_unstable = $this->request->variable('force_unstable', false);
+
+ if ($force_unstable)
+ {
+ $s_hidden_fields = build_hidden_fields(array(
+ 'force_unstable' => $force_unstable,
+ ));
+
+ confirm_box(false, $this->user->lang('EXTENSION_FORCE_UNSTABLE_CONFIRM'), $s_hidden_fields);
+ }
+ else
+ {
+ $this->config->set('extension_force_unstable', false);
+ trigger_error($this->user->lang['CONFIG_UPDATED'] . adm_back_link($this->u_action));
+ }
+ break;
+
+ case 'list':
+ default:
+ if (confirm_box(true))
+ {
+ $this->config->set('extension_force_unstable', true);
+ trigger_error($this->user->lang['CONFIG_UPDATED'] . adm_back_link($this->u_action));
+ }
+
+ $this->list_enabled_exts();
+ $this->list_disabled_exts();
+ $this->list_available_exts();
+
+ $this->template->assign_vars(array(
+ 'U_VERSIONCHECK_FORCE' => $this->u_action . '&amp;action=list&amp;versioncheck_force=1',
+ 'FORCE_UNSTABLE' => $this->config['extension_force_unstable'],
+ 'U_ACTION' => $this->u_action,
+ ));
+
+ $this->tpl_name = 'acp_ext_list';
+ break;
+
+ case 'enable_pre':
+ try
+ {
+ $md_manager->validate_enable();
+ }
+ catch (\phpbb\extension\exception $e)
+ {
+ trigger_error($e . adm_back_link($this->u_action), E_USER_WARNING);
+ }
+
+ $extension = $this->ext_manager->get_extension($ext_name);
+ if (!$extension->is_enableable())
+ {
+ trigger_error($this->user->lang['EXTENSION_NOT_ENABLEABLE'] . adm_back_link($this->u_action), E_USER_WARNING);
+ }
+
+ if ($this->ext_manager->is_enabled($ext_name))
+ {
+ redirect($this->u_action);
+ }
+
+ $this->tpl_name = 'acp_ext_enable';
+
+ $this->template->assign_vars(array(
+ 'PRE' => true,
+ 'L_CONFIRM_MESSAGE' => $this->user->lang('EXTENSION_ENABLE_CONFIRM', $md_manager->get_metadata('display-name')),
+ 'U_ENABLE' => $this->u_action . '&amp;action=enable&amp;ext_name=' . urlencode($ext_name) . '&amp;hash=' . generate_link_hash('enable.' . $ext_name),
+ ));
+ break;
+
+ case 'enable':
+ try
+ {
+ $md_manager->validate_enable();
+ }
+ catch (\phpbb\extension\exception $e)
+ {
+ trigger_error($e . adm_back_link($this->u_action), E_USER_WARNING);
+ }
+
+ $extension = $this->ext_manager->get_extension($ext_name);
+ if (!$extension->is_enableable())
+ {
+ trigger_error($this->user->lang['EXTENSION_NOT_ENABLEABLE'] . adm_back_link($this->u_action), E_USER_WARNING);
+ }
+
+ try
+ {
+ while ($this->ext_manager->enable_step($ext_name))
+ {
+ // Are we approaching the time limit? If so we want to pause the update and continue after refreshing
+ if ((time() - $start_time) >= $safe_time_limit)
+ {
+ $this->template->assign_var('S_NEXT_STEP', true);
+
+ meta_refresh(0, $this->u_action . '&amp;action=enable&amp;ext_name=' . urlencode($ext_name) . '&amp;hash=' . generate_link_hash('enable.' . $ext_name));
+ }
+ }
+
+ // Update custom style for admin area
+ $this->template->set_custom_style(array(
+ array(
+ 'name' => 'adm',
+ 'ext_path' => 'adm/style/',
+ ),
+ ), array($phpbb_root_path . 'adm/style'));
+
+ $this->log->add('admin', $this->user->data['user_id'], $this->user->ip, 'LOG_EXT_ENABLE', time(), array($ext_name));
+ }
+ catch (\phpbb\db\migration\exception $e)
+ {
+ $this->template->assign_var('MIGRATOR_ERROR', $e->getLocalisedMessage($this->user));
+ }
+
+ $this->tpl_name = 'acp_ext_enable';
+
+ $this->template->assign_vars(array(
+ 'U_RETURN' => $this->u_action . '&amp;action=list',
+ ));
+ break;
+
+ case 'disable_pre':
+ if (!$this->ext_manager->is_enabled($ext_name))
+ {
+ redirect($this->u_action);
+ }
+
+ $this->tpl_name = 'acp_ext_disable';
+
+ $this->template->assign_vars(array(
+ 'PRE' => true,
+ 'L_CONFIRM_MESSAGE' => $this->user->lang('EXTENSION_DISABLE_CONFIRM', $md_manager->get_metadata('display-name')),
+ 'U_DISABLE' => $this->u_action . '&amp;action=disable&amp;ext_name=' . urlencode($ext_name) . '&amp;hash=' . generate_link_hash('disable.' . $ext_name),
+ ));
+ break;
+
+ case 'disable':
+ if (!$this->ext_manager->is_enabled($ext_name))
+ {
+ redirect($this->u_action);
+ }
+
+ while ($this->ext_manager->disable_step($ext_name))
+ {
+ // Are we approaching the time limit? If so we want to pause the update and continue after refreshing
+ if ((time() - $start_time) >= $safe_time_limit)
+ {
+ $this->template->assign_var('S_NEXT_STEP', true);
+
+ meta_refresh(0, $this->u_action . '&amp;action=disable&amp;ext_name=' . urlencode($ext_name) . '&amp;hash=' . generate_link_hash('disable.' . $ext_name));
+ }
+ }
+ $this->log->add('admin', $this->user->data['user_id'], $this->user->ip, 'LOG_EXT_DISABLE', time(), array($ext_name));
+
+ $this->tpl_name = 'acp_ext_disable';
+
+ $this->template->assign_vars(array(
+ 'U_RETURN' => $this->u_action . '&amp;action=list',
+ ));
+ break;
+
+ case 'delete_data_pre':
+ if ($this->ext_manager->is_enabled($ext_name))
+ {
+ redirect($this->u_action);
+ }
+ $this->tpl_name = 'acp_ext_delete_data';
+
+ $this->template->assign_vars(array(
+ 'PRE' => true,
+ 'L_CONFIRM_MESSAGE' => $this->user->lang('EXTENSION_DELETE_DATA_CONFIRM', $md_manager->get_metadata('display-name')),
+ 'U_PURGE' => $this->u_action . '&amp;action=delete_data&amp;ext_name=' . urlencode($ext_name) . '&amp;hash=' . generate_link_hash('delete_data.' . $ext_name),
+ ));
+ break;
+
+ case 'delete_data':
+ if ($this->ext_manager->is_enabled($ext_name))
+ {
+ redirect($this->u_action);
+ }
+
+ try
+ {
+ while ($this->ext_manager->purge_step($ext_name))
+ {
+ // Are we approaching the time limit? If so we want to pause the update and continue after refreshing
+ if ((time() - $start_time) >= $safe_time_limit)
+ {
+ $this->template->assign_var('S_NEXT_STEP', true);
+
+ meta_refresh(0, $this->u_action . '&amp;action=delete_data&amp;ext_name=' . urlencode($ext_name) . '&amp;hash=' . generate_link_hash('delete_data.' . $ext_name));
+ }
+ }
+ $this->log->add('admin', $this->user->data['user_id'], $this->user->ip, 'LOG_EXT_PURGE', time(), array($ext_name));
+ }
+ catch (\phpbb\db\migration\exception $e)
+ {
+ $this->template->assign_var('MIGRATOR_ERROR', $e->getLocalisedMessage($this->user));
+ }
+
+ $this->tpl_name = 'acp_ext_delete_data';
+
+ $this->template->assign_vars(array(
+ 'U_RETURN' => $this->u_action . '&amp;action=list',
+ ));
+ break;
+
+ case 'details':
+ // Output it to the template
+ $md_manager->output_template_data();
+
+ try
+ {
+ $updates_available = $this->version_check($md_manager, $this->request->variable('versioncheck_force', false));
+
+ $this->template->assign_vars(array(
+ 'S_UP_TO_DATE' => empty($updates_available),
+ 'S_VERSIONCHECK' => true,
+ 'UP_TO_DATE_MSG' => $this->user->lang(empty($updates_available) ? 'UP_TO_DATE' : 'NOT_UP_TO_DATE', $md_manager->get_metadata('display-name')),
+ ));
+
+ $this->template->assign_block_vars('updates_available', $updates_available);
+ }
+ catch (\RuntimeException $e)
+ {
+ $this->template->assign_vars(array(
+ 'S_VERSIONCHECK_STATUS' => $e->getCode(),
+ 'VERSIONCHECK_FAIL_REASON' => ($e->getMessage() !== $this->user->lang('VERSIONCHECK_FAIL')) ? $e->getMessage() : '',
+ ));
+ }
+
+ $this->template->assign_vars(array(
+ 'U_BACK' => $this->u_action . '&amp;action=list',
+ 'U_VERSIONCHECK_FORCE' => $this->u_action . '&amp;action=details&amp;versioncheck_force=1&amp;ext_name=' . urlencode($md_manager->get_metadata('name')),
+ ));
+
+ $this->tpl_name = 'acp_ext_details';
+ break;
+ }
+
+ /**
+ * Event to run after a specific action on extension has completed
+ *
+ * @event core.acp_extensions_run_action_after
+ * @var string action Action that has run
+ * @var string u_action Url we are at
+ * @var string ext_name Extension name from request
+ * @var int safe_time_limit Safe limit of execution time
+ * @var int start_time Start time
+ * @var string tpl_name Template file to load
+ * @since 3.1.11-RC1
+ */
+ $u_action = $this->u_action;
+ $tpl_name = $this->tpl_name;
+ $vars = array('action', 'u_action', 'ext_name', 'safe_time_limit', 'start_time', 'tpl_name');
+ extract($this->phpbb_dispatcher->trigger_event('core.acp_extensions_run_action_after', compact($vars)));
+
+ // In case they have been updated by the event
+ $this->u_action = $u_action;
+ $this->tpl_name = $tpl_name;
+ }
+
+ /**
+ * Lists all the enabled extensions and dumps to the template
+ *
+ * @return null
+ */
+ public function list_enabled_exts()
+ {
+ $enabled_extension_meta_data = array();
+
+ foreach ($this->ext_manager->all_enabled() as $name => $location)
+ {
+ $md_manager = $this->ext_manager->create_extension_metadata_manager($name, $this->template);
+
+ try
+ {
+ $meta = $md_manager->get_metadata('all');
+ $enabled_extension_meta_data[$name] = array(
+ 'META_DISPLAY_NAME' => $md_manager->get_metadata('display-name'),
+ 'META_VERSION' => $meta['version'],
+ );
+
+ $force_update = $this->request->variable('versioncheck_force', false);
+ $updates = $this->version_check($md_manager, $force_update, !$force_update);
+
+ $enabled_extension_meta_data[$name]['S_UP_TO_DATE'] = empty($updates);
+ $enabled_extension_meta_data[$name]['S_VERSIONCHECK'] = true;
+ $enabled_extension_meta_data[$name]['U_VERSIONCHECK_FORCE'] = $this->u_action . '&amp;action=details&amp;versioncheck_force=1&amp;ext_name=' . urlencode($md_manager->get_metadata('name'));
+ }
+ catch (\phpbb\extension\exception $e)
+ {
+ $this->template->assign_block_vars('disabled', array(
+ 'META_DISPLAY_NAME' => $this->user->lang('EXTENSION_INVALID_LIST', $name, $e),
+ 'S_VERSIONCHECK' => false,
+ ));
+ }
+ catch (\RuntimeException $e)
+ {
+ $enabled_extension_meta_data[$name]['S_VERSIONCHECK'] = false;
+ }
+ }
+
+ uasort($enabled_extension_meta_data, array($this, 'sort_extension_meta_data_table'));
+
+ foreach ($enabled_extension_meta_data as $name => $block_vars)
+ {
+ $block_vars['NAME'] = $name;
+ $block_vars['U_DETAILS'] = $this->u_action . '&amp;action=details&amp;ext_name=' . urlencode($name);
+
+ $this->template->assign_block_vars('enabled', $block_vars);
+
+ $this->output_actions('enabled', array(
+ 'DISABLE' => $this->u_action . '&amp;action=disable_pre&amp;ext_name=' . urlencode($name),
+ ));
+ }
+ }
+
+ /**
+ * Lists all the disabled extensions and dumps to the template
+ *
+ * @return null
+ */
+ public function list_disabled_exts()
+ {
+ $disabled_extension_meta_data = array();
+
+ foreach ($this->ext_manager->all_disabled() as $name => $location)
+ {
+ $md_manager = $this->ext_manager->create_extension_metadata_manager($name, $this->template);
+
+ try
+ {
+ $meta = $md_manager->get_metadata('all');
+ $disabled_extension_meta_data[$name] = array(
+ 'META_DISPLAY_NAME' => $md_manager->get_metadata('display-name'),
+ 'META_VERSION' => $meta['version'],
+ );
+
+ $force_update = $this->request->variable('versioncheck_force', false);
+ $updates = $this->version_check($md_manager, $force_update, !$force_update);
+
+ $disabled_extension_meta_data[$name]['S_UP_TO_DATE'] = empty($updates);
+ $disabled_extension_meta_data[$name]['S_VERSIONCHECK'] = true;
+ $disabled_extension_meta_data[$name]['U_VERSIONCHECK_FORCE'] = $this->u_action . '&amp;action=details&amp;versioncheck_force=1&amp;ext_name=' . urlencode($md_manager->get_metadata('name'));
+ }
+ catch (\phpbb\extension\exception $e)
+ {
+ $this->template->assign_block_vars('disabled', array(
+ 'META_DISPLAY_NAME' => $this->user->lang('EXTENSION_INVALID_LIST', $name, $e),
+ 'S_VERSIONCHECK' => false,
+ ));
+ }
+ catch (\RuntimeException $e)
+ {
+ $disabeld_extension_meta_data[$name]['S_VERSIONCHECK'] = false;
+ }
+ }
+
+ uasort($disabled_extension_meta_data, array($this, 'sort_extension_meta_data_table'));
+
+ foreach ($disabled_extension_meta_data as $name => $block_vars)
+ {
+ $block_vars['NAME'] = $name;
+ $block_vars['U_DETAILS'] = $this->u_action . '&amp;action=details&amp;ext_name=' . urlencode($name);
+
+ $this->template->assign_block_vars('disabled', $block_vars);
+
+ $this->output_actions('disabled', array(
+ 'ENABLE' => $this->u_action . '&amp;action=enable_pre&amp;ext_name=' . urlencode($name),
+ 'DELETE_DATA' => $this->u_action . '&amp;action=delete_data_pre&amp;ext_name=' . urlencode($name),
+ ));
+ }
+ }
+
+ /**
+ * Lists all the available extensions and dumps to the template
+ *
+ * @return null
+ */
+ public function list_available_exts()
+ {
+ $uninstalled = array_diff_key($this->ext_manager->all_available(), $this->ext_manager->all_configured());
+
+ $available_extension_meta_data = array();
+
+ foreach ($uninstalled as $name => $location)
+ {
+ $md_manager = $this->ext_manager->create_extension_metadata_manager($name, $this->template);
+
+ try
+ {
+ $meta = $md_manager->get_metadata('all');
+ $available_extension_meta_data[$name] = array(
+ 'META_DISPLAY_NAME' => $md_manager->get_metadata('display-name'),
+ 'META_VERSION' => $meta['version'],
+ );
+
+ $force_update = $this->request->variable('versioncheck_force', false);
+ $updates = $this->version_check($md_manager, $force_update, !$force_update);
+
+ $available_extension_meta_data[$name]['S_UP_TO_DATE'] = empty($updates);
+ $available_extension_meta_data[$name]['S_VERSIONCHECK'] = true;
+ $available_extension_meta_data[$name]['U_VERSIONCHECK_FORCE'] = $this->u_action . '&amp;action=details&amp;versioncheck_force=1&amp;ext_name=' . urlencode($md_manager->get_metadata('name'));
+ }
+ catch (\phpbb\extension\exception $e)
+ {
+ $this->template->assign_block_vars('disabled', array(
+ 'META_DISPLAY_NAME' => $this->user->lang('EXTENSION_INVALID_LIST', $name, $e),
+ 'S_VERSIONCHECK' => false,
+ ));
+ }
+ catch (\RuntimeException $e)
+ {
+ $available_extension_meta_data[$name]['S_VERSIONCHECK'] = false;
+ }
+ }
+
+ uasort($available_extension_meta_data, array($this, 'sort_extension_meta_data_table'));
+
+ foreach ($available_extension_meta_data as $name => $block_vars)
+ {
+ $block_vars['NAME'] = $name;
+ $block_vars['U_DETAILS'] = $this->u_action . '&amp;action=details&amp;ext_name=' . urlencode($name);
+
+ $this->template->assign_block_vars('disabled', $block_vars);
+
+ $this->output_actions('disabled', array(
+ 'ENABLE' => $this->u_action . '&amp;action=enable_pre&amp;ext_name=' . urlencode($name),
+ ));
+ }
+ }
+
+ /**
+ * Output actions to a block
+ *
+ * @param string $block
+ * @param array $actions
+ */
+ private function output_actions($block, $actions)
+ {
+ foreach ($actions as $lang => $url)
+ {
+ $this->template->assign_block_vars($block . '.actions', array(
+ 'L_ACTION' => $this->user->lang('EXTENSION_' . $lang),
+ 'L_ACTION_EXPLAIN' => (isset($this->user->lang['EXTENSION_' . $lang . '_EXPLAIN'])) ? $this->user->lang('EXTENSION_' . $lang . '_EXPLAIN') : '',
+ 'U_ACTION' => $url,
+ ));
+ }
+ }
+
+ /**
+ * Check the version and return the available updates.
+ *
+ * @param \phpbb\extension\metadata_manager $md_manager The metadata manager for the version to check.
+ * @param bool $force_update Ignores cached data. Defaults to false.
+ * @param bool $force_cache Force the use of the cache. Override $force_update.
+ * @return array
+ * @throws RuntimeException
+ */
+ protected function version_check(\phpbb\extension\metadata_manager $md_manager, $force_update = false, $force_cache = false)
+ {
+ $meta = $md_manager->get_metadata('all');
+
+ if (!isset($meta['extra']['version-check']))
+ {
+ throw new \RuntimeException($this->user->lang('NO_VERSIONCHECK'), 1);
+ }
+
+ $version_check = $meta['extra']['version-check'];
+
+ $version_helper = new \phpbb\version_helper($this->cache, $this->config, new \phpbb\file_downloader(), $this->user);
+ $version_helper->set_current_version($meta['version']);
+ $version_helper->set_file_location($version_check['host'], $version_check['directory'], $version_check['filename'], isset($version_check['ssl']) ? $version_check['ssl'] : false);
+ $version_helper->force_stability($this->config['extension_force_unstable'] ? 'unstable' : null);
+
+ return $version_helper->get_ext_update_on_branch($force_update, $force_cache);
+ }
+
+ /**
+ * Sort helper for the table containing the metadata about the extensions.
+ */
+ protected function sort_extension_meta_data_table($val1, $val2)
+ {
+ return strnatcasecmp($val1['META_DISPLAY_NAME'], $val2['META_DISPLAY_NAME']);
+ }
+}
diff --git a/phpBB/includes/acp/acp_forums.php b/phpBB/includes/acp/acp_forums.php
index dc2e6b75fb..1e69a4ad20 100644
--- a/phpBB/includes/acp/acp_forums.php
+++ b/phpBB/includes/acp/acp_forums.php
@@ -1,10 +1,13 @@
<?php
/**
*
-* @package acp
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -16,9 +19,6 @@ if (!defined('IN_PHPBB'))
exit;
}
-/**
-* @package acp
-*/
class acp_forums
{
var $u_action;
@@ -26,7 +26,7 @@ class acp_forums
function main($id, $mode)
{
- global $db, $user, $auth, $template, $cache;
+ global $db, $user, $auth, $template, $cache, $request, $phpbb_dispatcher;
global $config, $phpbb_admin_path, $phpbb_root_path, $phpEx;
$user->add_lang('acp/forums');
@@ -139,17 +139,31 @@ class acp_forums
'enable_prune' => request_var('enable_prune', false),
'enable_post_review' => request_var('enable_post_review', true),
'enable_quick_reply' => request_var('enable_quick_reply', false),
+ 'enable_shadow_prune' => request_var('enable_shadow_prune', false),
'prune_days' => request_var('prune_days', 7),
'prune_viewed' => request_var('prune_viewed', 7),
'prune_freq' => request_var('prune_freq', 1),
'prune_old_polls' => request_var('prune_old_polls', false),
'prune_announce' => request_var('prune_announce', false),
'prune_sticky' => request_var('prune_sticky', false),
+ 'prune_shadow_days' => request_var('prune_shadow_days', 7),
+ 'prune_shadow_freq' => request_var('prune_shadow_freq', 1),
'forum_password' => request_var('forum_password', '', true),
'forum_password_confirm'=> request_var('forum_password_confirm', '', true),
'forum_password_unset' => request_var('forum_password_unset', false),
);
+ /**
+ * Request forum data and operate on it (parse texts, etc.)
+ *
+ * @event core.acp_manage_forums_request_data
+ * @var string action Type of the action: add|edit
+ * @var array forum_data Array with new forum data
+ * @since 3.1.0-a1
+ */
+ $vars = array('action', 'forum_data');
+ extract($phpbb_dispatcher->trigger_event('core.acp_manage_forums_request_data', compact($vars)));
+
// On add, add empty forum_options... else do not consider it (not updating it)
if ($action == 'add')
{
@@ -195,7 +209,7 @@ class acp_forums
($action != 'edit' || empty($forum_id) || ($auth->acl_get('a_fauth') && $auth->acl_get('a_authusers') && $auth->acl_get('a_authgroups') && $auth->acl_get('a_mauth'))))
{
copy_forum_permissions($forum_perm_from, $forum_data['forum_id'], ($action == 'edit') ? true : false);
- cache_moderators();
+ phpbb_cache_moderators($db, $cache, $auth);
$copied_permissions = true;
}
/* Commented out because of questionable UI workflow - re-visit for 3.0.7
@@ -256,6 +270,12 @@ class acp_forums
$cache->destroy('sql', FORUMS_TABLE);
}
+ if ($request->is_ajax())
+ {
+ $json_response = new \phpbb\json_response;
+ $json_response->send(array('success' => ($move_forum_name !== false)));
+ }
+
break;
case 'sync':
@@ -266,7 +286,7 @@ class acp_forums
@set_time_limit(0);
- $sql = 'SELECT forum_name, forum_topics_real
+ $sql = 'SELECT forum_name, (forum_topics_approved + forum_topics_unapproved + forum_topics_softdeleted) AS total_topics
FROM ' . FORUMS_TABLE . "
WHERE forum_id = $forum_id";
$result = $db->sql_query($sql);
@@ -278,7 +298,7 @@ class acp_forums
trigger_error($user->lang['NO_FORUM'] . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id), E_USER_WARNING);
}
- if ($row['forum_topics_real'])
+ if ($row['total_topics'])
{
$sql = 'SELECT MIN(topic_id) as min_topic_id, MAX(topic_id) as max_topic_id
FROM ' . TOPICS_TABLE . '
@@ -297,7 +317,6 @@ class acp_forums
$end = $start + $batch_size;
// Sync all topics in batch mode...
- sync('topic_approved', 'range', 'topic_id BETWEEN ' . $start . ' AND ' . $end, true, false);
sync('topic', 'range', 'topic_id BETWEEN ' . $start . ' AND ' . $end, true, true);
if ($end < $row2['max_topic_id'])
@@ -313,15 +332,15 @@ class acp_forums
$start += $batch_size;
- $url = $this->u_action . "&amp;parent_id={$this->parent_id}&amp;f=$forum_id&amp;action=sync&amp;start=$start&amp;topics_done=$topics_done&amp;total={$row['forum_topics_real']}";
+ $url = $this->u_action . "&amp;parent_id={$this->parent_id}&amp;f=$forum_id&amp;action=sync&amp;start=$start&amp;topics_done=$topics_done&amp;total={$row['total_topics']}";
meta_refresh(0, $url);
$template->assign_vars(array(
- 'U_PROGRESS_BAR' => $this->u_action . "&amp;action=progress_bar&amp;start=$topics_done&amp;total={$row['forum_topics_real']}",
- 'UA_PROGRESS_BAR' => addslashes($this->u_action . "&amp;action=progress_bar&amp;start=$topics_done&amp;total={$row['forum_topics_real']}"),
+ 'U_PROGRESS_BAR' => $this->u_action . "&amp;action=progress_bar&amp;start=$topics_done&amp;total={$row['total_topics']}",
+ 'UA_PROGRESS_BAR' => addslashes($this->u_action . "&amp;action=progress_bar&amp;start=$topics_done&amp;total={$row['total_topics']}"),
'S_CONTINUE_SYNC' => true,
- 'L_PROGRESS_EXPLAIN' => sprintf($user->lang['SYNC_IN_PROGRESS_EXPLAIN'], $topics_done, $row['forum_topics_real']))
+ 'L_PROGRESS_EXPLAIN' => sprintf($user->lang['SYNC_IN_PROGRESS_EXPLAIN'], $topics_done, $row['total_topics']))
);
return;
@@ -335,7 +354,7 @@ class acp_forums
'U_PROGRESS_BAR' => $this->u_action . '&amp;action=progress_bar',
'UA_PROGRESS_BAR' => addslashes($this->u_action . '&amp;action=progress_bar'),
'S_CONTINUE_SYNC' => true,
- 'L_PROGRESS_EXPLAIN' => sprintf($user->lang['SYNC_IN_PROGRESS_EXPLAIN'], 0, $row['forum_topics_real']))
+ 'L_PROGRESS_EXPLAIN' => sprintf($user->lang['SYNC_IN_PROGRESS_EXPLAIN'], 0, $row['total_topics']))
);
return;
@@ -380,6 +399,9 @@ class acp_forums
$forum_data['forum_flags'] += (request_var('enable_quick_reply', false)) ? FORUM_FLAG_QUICK_REPLY : 0;
}
+ // Initialise $row, so we always have it in the event
+ $row = array();
+
// Show form to create/modify a forum
if ($action == 'edit')
{
@@ -439,6 +461,9 @@ class acp_forums
'prune_days' => 7,
'prune_viewed' => 7,
'prune_freq' => 1,
+ 'enable_shadow_prune' => false,
+ 'prune_shadow_days' => 7,
+ 'prune_shadow_freq' => 1,
'forum_flags' => FORUM_FLAG_POST_REVIEW + FORUM_FLAG_ACTIVE_TOPICS,
'forum_options' => 0,
'forum_password' => '',
@@ -447,6 +472,24 @@ class acp_forums
}
}
+ /**
+ * Initialise data before we display the add/edit form
+ *
+ * @event core.acp_manage_forums_initialise_data
+ * @var string action Type of the action: add|edit
+ * @var bool update Do we display the form only
+ * or did the user press submit
+ * @var int forum_id When editing: the forum id,
+ * when creating: the parent forum id
+ * @var array row Array with current forum data
+ * empty when creating new forum
+ * @var array forum_data Array with new forum data
+ * @var string parents_list List of parent options
+ * @since 3.1.0-a1
+ */
+ $vars = array('action', 'update', 'forum_id', 'row', 'forum_data', 'parents_list');
+ extract($phpbb_dispatcher->trigger_event('core.acp_manage_forums_initialise_data', compact($vars)));
+
$forum_rules_data = array(
'text' => $forum_data['forum_rules'],
'allow_bbcode' => true,
@@ -576,7 +619,7 @@ class acp_forums
$errors[] = $user->lang['FORUM_PASSWORD_OLD'];
}
- $template->assign_vars(array(
+ $template_data = array(
'S_EDIT_FORUM' => true,
'S_ERROR' => (sizeof($errors)) ? true : false,
'S_PARENT_ID' => $this->parent_id,
@@ -600,6 +643,8 @@ class acp_forums
'PRUNE_FREQ' => $forum_data['prune_freq'],
'PRUNE_DAYS' => $forum_data['prune_days'],
'PRUNE_VIEWED' => $forum_data['prune_viewed'],
+ 'PRUNE_SHADOW_FREQ' => $forum_data['prune_shadow_freq'],
+ 'PRUNE_SHADOW_DAYS' => $forum_data['prune_shadow_days'],
'TOPICS_PER_PAGE' => $forum_data['forum_topics_per_page'],
'FORUM_RULES_LINK' => $forum_data['forum_rules_link'],
'FORUM_RULES' => $forum_data['forum_rules'],
@@ -632,6 +677,7 @@ class acp_forums
'S_DISPLAY_SUBFORUM_LIST' => ($forum_data['display_subforum_list']) ? true : false,
'S_DISPLAY_ON_INDEX' => ($forum_data['display_on_index']) ? true : false,
'S_PRUNE_ENABLE' => ($forum_data['enable_prune']) ? true : false,
+ 'S_PRUNE_SHADOW_ENABLE' => ($forum_data['enable_shadow_prune']) ? true : false,
'S_FORUM_LINK_TRACK' => ($forum_data['forum_flags'] & FORUM_FLAG_LINK_TRACK) ? true : false,
'S_PRUNE_OLD_POLLS' => ($forum_data['forum_flags'] & FORUM_FLAG_PRUNE_POLL) ? true : false,
'S_PRUNE_ANNOUNCE' => ($forum_data['forum_flags'] & FORUM_FLAG_PRUNE_ANNOUNCE) ? true : false,
@@ -641,7 +687,40 @@ class acp_forums
'S_ENABLE_POST_REVIEW' => ($forum_data['forum_flags'] & FORUM_FLAG_POST_REVIEW) ? true : false,
'S_ENABLE_QUICK_REPLY' => ($forum_data['forum_flags'] & FORUM_FLAG_QUICK_REPLY) ? true : false,
'S_CAN_COPY_PERMISSIONS' => ($action != 'edit' || empty($forum_id) || ($auth->acl_get('a_fauth') && $auth->acl_get('a_authusers') && $auth->acl_get('a_authgroups') && $auth->acl_get('a_mauth'))) ? true : false,
- ));
+ );
+
+ /**
+ * Modify forum template data before we display the form
+ *
+ * @event core.acp_manage_forums_display_form
+ * @var string action Type of the action: add|edit
+ * @var bool update Do we display the form only
+ * or did the user press submit
+ * @var int forum_id When editing: the forum id,
+ * when creating: the parent forum id
+ * @var array row Array with current forum data
+ * empty when creating new forum
+ * @var array forum_data Array with new forum data
+ * @var string parents_list List of parent options
+ * @var array errors Array of errors, if you add errors
+ * ensure to update the template variables
+ * S_ERROR and ERROR_MSG to display it
+ * @var array template_data Array with new forum data
+ * @since 3.1.0-a1
+ */
+ $vars = array(
+ 'action',
+ 'update',
+ 'forum_id',
+ 'row',
+ 'forum_data',
+ 'parents_list',
+ 'errors',
+ 'template_data',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.acp_manage_forums_display_form', compact($vars)));
+
+ $template->assign_vars($template_data);
return;
@@ -706,7 +785,7 @@ class acp_forums
if (!empty($forum_perm_from) && $forum_perm_from != $forum_id)
{
copy_forum_permissions($forum_perm_from, $forum_id, true);
- cache_moderators();
+ phpbb_cache_moderators($db, $cache, $auth);
$auth->acl_clear_prefetch();
$cache->destroy('sql', FORUMS_TABLE);
@@ -763,9 +842,26 @@ class acp_forums
ORDER BY left_id";
$result = $db->sql_query($sql);
- if ($row = $db->sql_fetchrow($result))
+ $rowset = array();
+ while ($row = $db->sql_fetchrow($result))
+ {
+ $rowset[(int) $row['forum_id']] = $row;
+ }
+ $db->sql_freeresult($result);
+
+ /**
+ * Modify the forum list data
+ *
+ * @event core.acp_manage_forums_modify_forum_list
+ * @var array rowset Array with the forums list data
+ * @since 3.1.10-RC1
+ */
+ $vars = array('rowset');
+ extract($phpbb_dispatcher->trigger_event('core.acp_manage_forums_modify_forum_list', compact($vars)));
+
+ if (!empty($rowset))
{
- do
+ foreach ($rowset as $row)
{
$forum_type = $row['forum_type'];
@@ -795,8 +891,8 @@ class acp_forums
'FORUM_IMAGE_SRC' => ($row['forum_image']) ? $phpbb_root_path . $row['forum_image'] : '',
'FORUM_NAME' => $row['forum_name'],
'FORUM_DESCRIPTION' => generate_text_for_display($row['forum_desc'], $row['forum_desc_uid'], $row['forum_desc_bitfield'], $row['forum_desc_options']),
- 'FORUM_TOPICS' => $row['forum_topics'],
- 'FORUM_POSTS' => $row['forum_posts'],
+ 'FORUM_TOPICS' => $row['forum_topics_approved'],
+ 'FORUM_POSTS' => $row['forum_posts_approved'],
'S_FORUM_LINK' => ($forum_type == FORUM_LINK) ? true : false,
'S_FORUM_POST' => ($forum_type == FORUM_POST) ? true : false,
@@ -809,7 +905,6 @@ class acp_forums
'U_SYNC' => $url . '&amp;action=sync')
);
}
- while ($row = $db->sql_fetchrow($result));
}
else if ($this->parent_id)
{
@@ -825,7 +920,7 @@ class acp_forums
'U_SYNC' => $url . '&amp;action=sync')
);
}
- $db->sql_freeresult($result);
+ unset($rowset);
$template->assign_vars(array(
'ERROR_MSG' => (sizeof($errors)) ? implode('<br />', $errors) : '',
@@ -866,10 +961,22 @@ class acp_forums
*/
function update_forum_data(&$forum_data)
{
- global $db, $user, $cache, $phpbb_root_path;
+ global $db, $user, $cache, $phpbb_root_path, $phpbb_container, $phpbb_dispatcher;
$errors = array();
+ /**
+ * Validate the forum data before we create/update the forum
+ *
+ * @event core.acp_manage_forums_validate_data
+ * @var array forum_data Array with new forum data
+ * @var array errors Array of errors, should be strings and not
+ * language key.
+ * @since 3.1.0-a1
+ */
+ $vars = array('forum_data', 'errors');
+ extract($phpbb_dispatcher->trigger_event('core.acp_manage_forums_validate_data', compact($vars)));
+
if ($forum_data['forum_name'] == '')
{
$errors[] = $user->lang['FORUM_NAME_EMPTY'];
@@ -958,11 +1065,29 @@ class acp_forums
}
else
{
- $forum_data_sql['forum_password'] = phpbb_hash($forum_data_sql['forum_password']);
+ // Instantiate passwords manager
+ $passwords_manager = $phpbb_container->get('passwords.manager');
+
+ $forum_data_sql['forum_password'] = $passwords_manager->hash($forum_data_sql['forum_password']);
}
unset($forum_data_sql['forum_password_unset']);
- if (!isset($forum_data_sql['forum_id']))
+ /**
+ * Remove invalid values from forum_data_sql that should not be updated
+ *
+ * @event core.acp_manage_forums_update_data_before
+ * @var array forum_data Array with forum data
+ * @var array forum_data_sql Array with data we are going to update
+ * If forum_data_sql[forum_id] is set, we update
+ * that forum, otherwise a new one is created.
+ * @since 3.1.0-a1
+ */
+ $vars = array('forum_data', 'forum_data_sql');
+ extract($phpbb_dispatcher->trigger_event('core.acp_manage_forums_update_data_before', compact($vars)));
+
+ $is_new_forum = !isset($forum_data_sql['forum_id']);
+
+ if ($is_new_forum)
{
// no forum_id means we're creating a new forum
unset($forum_data_sql['type_action']);
@@ -1055,7 +1180,8 @@ class acp_forums
return array($user->lang['NO_FORUM_ACTION']);
}
- $forum_data_sql['forum_posts'] = $forum_data_sql['forum_topics'] = $forum_data_sql['forum_topics_real'] = $forum_data_sql['forum_last_post_id'] = $forum_data_sql['forum_last_poster_id'] = $forum_data_sql['forum_last_post_time'] = 0;
+ $forum_data_sql['forum_posts_approved'] = $forum_data_sql['forum_posts_unapproved'] = $forum_data_sql['forum_posts_softdeleted'] = $forum_data_sql['forum_topics_approved'] = $forum_data_sql['forum_topics_unapproved'] = $forum_data_sql['forum_topics_softdeleted'] = 0;
+ $forum_data_sql['forum_last_post_id'] = $forum_data_sql['forum_last_poster_id'] = $forum_data_sql['forum_last_post_time'] = 0;
$forum_data_sql['forum_last_poster_name'] = $forum_data_sql['forum_last_poster_colour'] = '';
}
else if ($row['forum_type'] == FORUM_CAT && $forum_data_sql['forum_type'] == FORUM_LINK)
@@ -1175,9 +1301,12 @@ class acp_forums
else if ($row['forum_type'] == FORUM_CAT && $forum_data_sql['forum_type'] == FORUM_POST)
{
// Changing a category to a forum? Reset the data (you can't post directly in a cat, you must use a forum)
- $forum_data_sql['forum_posts'] = 0;
- $forum_data_sql['forum_topics'] = 0;
- $forum_data_sql['forum_topics_real'] = 0;
+ $forum_data_sql['forum_posts_approved'] = 0;
+ $forum_data_sql['forum_posts_unapproved'] = 0;
+ $forum_data_sql['forum_posts_softdeleted'] = 0;
+ $forum_data_sql['forum_topics_approved'] = 0;
+ $forum_data_sql['forum_topics_unapproved'] = 0;
+ $forum_data_sql['forum_topics_softdeleted'] = 0;
$forum_data_sql['forum_last_post_id'] = 0;
$forum_data_sql['forum_last_post_subject'] = '';
$forum_data_sql['forum_last_post_time'] = 0;
@@ -1233,6 +1362,22 @@ class acp_forums
add_log('admin', 'LOG_FORUM_EDIT', $forum_data['forum_name']);
}
+ /**
+ * Event after a forum was updated or created
+ *
+ * @event core.acp_manage_forums_update_data_after
+ * @var array forum_data Array with forum data
+ * @var array forum_data_sql Array with data we updated
+ * @var bool is_new_forum Did we create a forum or update one
+ * If you want to overwrite this value,
+ * ensure to set forum_data_sql[forum_id]
+ * @var array errors Array of errors, should be strings and not
+ * language key.
+ * @since 3.1.0-a1
+ */
+ $vars = array('forum_data', 'forum_data_sql', 'is_new_forum', 'errors');
+ extract($phpbb_dispatcher->trigger_event('core.acp_manage_forums_update_data_after', compact($vars)));
+
return $errors;
}
@@ -1241,7 +1386,7 @@ class acp_forums
*/
function move_forum($from_id, $to_id)
{
- global $db, $user;
+ global $db, $user, $phpbb_dispatcher;
$to_data = $moved_ids = $errors = array();
@@ -1253,16 +1398,36 @@ class acp_forums
if ($to_data['forum_type'] == FORUM_LINK)
{
$errors[] = $user->lang['PARENT_IS_LINK_FORUM'];
- return $errors;
}
}
+ /**
+ * Event when we move all children of one forum to another
+ *
+ * This event may be triggered, when a forum is deleted
+ *
+ * @event core.acp_manage_forums_move_children
+ * @var int from_id If of the current parent forum
+ * @var int to_id If of the new parent forum
+ * @var array errors Array of errors, should be strings and not
+ * language key.
+ * @since 3.1.0-a1
+ */
+ $vars = array('from_id', 'to_id', 'errors');
+ extract($phpbb_dispatcher->trigger_event('core.acp_manage_forums_move_children', compact($vars)));
+
+ // Return if there were errors
+ if (!empty($errors))
+ {
+ return $errors;
+ }
+
$moved_forums = get_forum_branch($from_id, 'children', 'descending');
$from_data = $moved_forums[0];
$diff = sizeof($moved_forums) * 2;
$moved_ids = array();
- for ($i = 0; $i < sizeof($moved_forums); ++$i)
+ for ($i = 0, $size = sizeof($moved_forums); $i < $size; ++$i)
{
$moved_ids[] = $moved_forums[$i]['forum_id'];
}
@@ -1336,7 +1501,30 @@ class acp_forums
*/
function move_forum_content($from_id, $to_id, $sync = true)
{
- global $db;
+ global $db, $phpbb_dispatcher;
+
+ $errors = array();
+
+ /**
+ * Event when we move content from one forum to another
+ *
+ * @event core.acp_manage_forums_move_content
+ * @var int from_id If of the current parent forum
+ * @var int to_id If of the new parent forum
+ * @var bool sync Shall we sync the "to"-forum's data
+ * @var array errors Array of errors, should be strings and not
+ * language key. If this array is not empty,
+ * The content will not be moved.
+ * @since 3.1.0-a1
+ */
+ $vars = array('from_id', 'to_id', 'sync', 'errors');
+ extract($phpbb_dispatcher->trigger_event('core.acp_manage_forums_move_content', compact($vars)));
+
+ // Return if there were errors
+ if (!empty($errors))
+ {
+ return $errors;
+ }
$table_ary = array(LOG_TABLE, POSTS_TABLE, TOPICS_TABLE, DRAFTS_TABLE, TOPICS_TRACK_TABLE);
@@ -1614,7 +1802,7 @@ class acp_forums
*/
function delete_forum_content($forum_id)
{
- global $db, $config, $phpbb_root_path, $phpEx;
+ global $db, $config, $phpbb_root_path, $phpEx, $phpbb_dispatcher;
include_once($phpbb_root_path . 'includes/functions_posting.' . $phpEx);
@@ -1645,7 +1833,7 @@ class acp_forums
FROM ' . POSTS_TABLE . '
WHERE forum_id = ' . $forum_id . '
AND post_postcount = 1
- AND post_approved = 1';
+ AND post_visibility = ' . ITEM_APPROVED;
$result = $db->sql_query($sql);
$post_counts = array();
@@ -1655,7 +1843,7 @@ class acp_forums
}
$db->sql_freeresult($result);
- switch ($db->sql_layer)
+ switch ($db->get_sql_layer())
{
case 'mysql4':
case 'mysqli':
@@ -1746,6 +1934,24 @@ class acp_forums
$table_ary = array(FORUMS_ACCESS_TABLE, FORUMS_TRACK_TABLE, FORUMS_WATCH_TABLE, LOG_TABLE, MODERATOR_CACHE_TABLE, POSTS_TABLE, TOPICS_TABLE, TOPICS_TRACK_TABLE);
+ /**
+ * Perform additional actions before forum content deletion
+ *
+ * @event core.delete_forum_content_before_query
+ * @var array table_ary Array of tables from which all rows will be deleted that hold the forum_id
+ * @var int forum_id the forum id
+ * @var array topic_ids Array of the topic ids from the forum to be deleted
+ * @var array post_counts Array of counts of posts in the forum, by poster_id
+ * @since 3.1.6-RC1
+ */
+ $vars = array(
+ 'table_ary',
+ 'forum_id',
+ 'topic_ids',
+ 'post_counts',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.delete_forum_content_before_query', compact($vars)));
+
foreach ($table_ary as $table)
{
$db->sql_query("DELETE FROM $table WHERE forum_id = $forum_id");
@@ -1783,7 +1989,7 @@ class acp_forums
// Make sure the overall post/topic count is correct...
$sql = 'SELECT COUNT(post_id) AS stat
FROM ' . POSTS_TABLE . '
- WHERE post_approved = 1';
+ WHERE post_visibility = ' . ITEM_APPROVED;
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
@@ -1792,7 +1998,7 @@ class acp_forums
$sql = 'SELECT COUNT(topic_id) AS stat
FROM ' . TOPICS_TABLE . '
- WHERE topic_approved = 1';
+ WHERE topic_visibility = ' . ITEM_APPROVED;
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
@@ -1945,5 +2151,3 @@ class acp_forums
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/acp/acp_groups.php b/phpBB/includes/acp/acp_groups.php
index c9d476b8ae..0352f6a242 100644
--- a/phpBB/includes/acp/acp_groups.php
+++ b/phpBB/includes/acp/acp_groups.php
@@ -1,10 +1,13 @@
<?php
/**
*
-* @package acp
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -16,9 +19,6 @@ if (!defined('IN_PHPBB'))
exit;
}
-/**
-* @package acp
-*/
class acp_groups
{
var $u_action;
@@ -27,6 +27,7 @@ class acp_groups
{
global $config, $db, $user, $auth, $template, $cache;
global $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix, $file_uploads;
+ global $request, $phpbb_container, $phpbb_dispatcher;
$user->add_lang('acp/groups');
$this->tpl_name = 'acp_groups';
@@ -35,7 +36,16 @@ class acp_groups
$form_key = 'acp_groups';
add_form_key($form_key);
- include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
+ if ($mode == 'position')
+ {
+ $this->manage_position();
+ return;
+ }
+
+ if (!function_exists('group_user_attributes'))
+ {
+ include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
+ }
// Check and set some common vars
$action = (isset($_POST['add'])) ? 'add' : ((isset($_POST['addusers'])) ? 'addusers' : request_var('action', ''));
@@ -47,17 +57,17 @@ class acp_groups
$start = request_var('start', 0);
$update = (isset($_POST['update'])) ? true : false;
-
// Clear some vars
- $can_upload = (file_exists($phpbb_root_path . $config['avatar_path']) && phpbb_is_writable($phpbb_root_path . $config['avatar_path']) && $file_uploads) ? true : false;
$group_row = array();
// Grab basic data for group, if group_id is set and exists
if ($group_id)
{
- $sql = 'SELECT *
- FROM ' . GROUPS_TABLE . "
- WHERE group_id = $group_id";
+ $sql = 'SELECT g.*, t.teampage_position AS group_teampage
+ FROM ' . GROUPS_TABLE . ' g
+ LEFT JOIN ' . TEAMPAGE_TABLE . ' t
+ ON (t.group_id = g.group_id)
+ WHERE g.group_id = ' . $group_id;
$result = $db->sql_query($sql);
$group_row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
@@ -133,7 +143,7 @@ class acp_groups
if (confirm_box(true))
{
$group_name = ($group_row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $group_row['group_name']] : $group_row['group_name'];
- group_user_attributes('default', $group_id, $mark_ary, false, $group_name, $group_row);
+ group_user_attributes('default', $group_id, $mark_ary, false, $group_name, $group_row);
trigger_error($user->lang['GROUP_DEFS_UPDATED'] . adm_back_link($this->u_action . '&amp;action=list&amp;g=' . $group_id));
}
else
@@ -288,7 +298,10 @@ class acp_groups
case 'edit':
case 'add':
- include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
+ if (!function_exists('display_forums'))
+ {
+ include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
+ }
$data = $submit_ary = array();
@@ -305,8 +318,48 @@ class acp_groups
$error = array();
$user->add_lang('ucp');
- $avatar_select = basename(request_var('avatar_select', ''));
- $category = basename(request_var('category', ''));
+ // Setup avatar data for later
+ $avatars_enabled = false;
+ $avatar_drivers = null;
+ $avatar_data = null;
+ $avatar_error = array();
+
+ /** @var \phpbb\avatar\manager $phpbb_avatar_manager */
+ $phpbb_avatar_manager = $phpbb_container->get('avatar.manager');
+
+ if ($config['allow_avatar'])
+ {
+ $avatar_drivers = $phpbb_avatar_manager->get_enabled_drivers();
+
+ // This is normalised data, without the group_ prefix
+ $avatar_data = \phpbb\avatar\manager::clean_row($group_row, 'group');
+ if (!isset($avatar_data['id']))
+ {
+ $avatar_data['id'] = 'g' . $group_id;
+ }
+ }
+
+ if ($request->is_set_post('avatar_delete'))
+ {
+ if (confirm_box(true))
+ {
+ $avatar_data['id'] = substr($avatar_data['id'], 1);
+ $phpbb_avatar_manager->handle_avatar_delete($db, $user, $avatar_data, GROUPS_TABLE, 'group_');
+
+ $message = ($action == 'edit') ? 'GROUP_UPDATED' : 'GROUP_CREATED';
+ trigger_error($user->lang[$message] . adm_back_link($this->u_action));
+ }
+ else
+ {
+ confirm_box(false, $user->lang('CONFIRM_AVATAR_DELETE'), build_hidden_fields(array(
+ 'avatar_delete' => true,
+ 'i' => $id,
+ 'mode' => $mode,
+ 'g' => $group_id,
+ 'action' => $action))
+ );
+ }
+ }
// Did we submit?
if ($update)
@@ -324,17 +377,12 @@ class acp_groups
$allow_desc_urls = request_var('desc_parse_urls', false);
$allow_desc_smilies = request_var('desc_parse_smilies', false);
- $data['uploadurl'] = request_var('uploadurl', '');
- $data['remotelink'] = request_var('remotelink', '');
- $data['width'] = request_var('width', '');
- $data['height'] = request_var('height', '');
- $delete = request_var('delete', '');
-
$submit_ary = array(
'colour' => request_var('group_colour', ''),
'rank' => request_var('group_rank', 0),
'receive_pm' => isset($_REQUEST['group_receive_pm']) ? 1 : 0,
'legend' => isset($_REQUEST['group_legend']) ? 1 : 0,
+ 'teampage' => isset($_REQUEST['group_teampage']) ? 1 : 0,
'message_limit' => request_var('group_message_limit', 0),
'max_recipients' => request_var('group_max_recipients', 0),
'founder_manage' => 0,
@@ -346,81 +394,39 @@ class acp_groups
$submit_ary['founder_manage'] = isset($_REQUEST['group_founder_manage']) ? 1 : 0;
}
- if (!empty($_FILES['uploadfile']['tmp_name']) || $data['uploadurl'] || $data['remotelink'])
+ if ($config['allow_avatar'])
{
- // Avatar stuff
- $var_ary = array(
- 'uploadurl' => array('string', true, 5, 255),
- 'remotelink' => array('string', true, 5, 255),
- 'width' => array('string', true, 1, 3),
- 'height' => array('string', true, 1, 3),
- );
+ // Handle avatar
+ $driver_name = $phpbb_avatar_manager->clean_driver_name($request->variable('avatar_driver', ''));
- if (!($error = validate_data($data, $var_ary)))
+ if (in_array($driver_name, $avatar_drivers) && !$request->is_set_post('avatar_delete'))
{
- $data['user_id'] = "g$group_id";
+ $driver = $phpbb_avatar_manager->get_driver($driver_name);
+ $result = $driver->process_form($request, $template, $user, $avatar_data, $avatar_error);
- if ((!empty($_FILES['uploadfile']['tmp_name']) || $data['uploadurl']) && $can_upload)
+ if ($result && empty($avatar_error))
{
- list($submit_ary['avatar_type'], $submit_ary['avatar'], $submit_ary['avatar_width'], $submit_ary['avatar_height']) = avatar_upload($data, $error);
- }
- else if ($data['remotelink'])
- {
- list($submit_ary['avatar_type'], $submit_ary['avatar'], $submit_ary['avatar_width'], $submit_ary['avatar_height']) = avatar_remote($data, $error);
+ $result['avatar_type'] = $driver_name;
+ $submit_ary = array_merge($submit_ary, $result);
}
}
- }
- else if ($avatar_select && $config['allow_avatar_local'])
- {
- // check avatar gallery
- if (is_dir($phpbb_root_path . $config['avatar_gallery_path'] . '/' . $category))
- {
- $submit_ary['avatar_type'] = AVATAR_GALLERY;
-
- list($submit_ary['avatar_width'], $submit_ary['avatar_height']) = getimagesize($phpbb_root_path . $config['avatar_gallery_path'] . '/' . $category . '/' . $avatar_select);
- $submit_ary['avatar'] = $category . '/' . $avatar_select;
- }
- }
- else if ($delete)
- {
- $submit_ary['avatar'] = '';
- $submit_ary['avatar_type'] = $submit_ary['avatar_width'] = $submit_ary['avatar_height'] = 0;
- }
- else if ($data['width'] && $data['height'])
- {
- // Only update the dimensions?
- if ($config['avatar_max_width'] || $config['avatar_max_height'])
- {
- if ($data['width'] > $config['avatar_max_width'] || $data['height'] > $config['avatar_max_height'])
- {
- $error[] = sprintf($user->lang['AVATAR_WRONG_SIZE'], $config['avatar_min_width'], $config['avatar_min_height'], $config['avatar_max_width'], $config['avatar_max_height'], $data['width'], $data['height']);
- }
- }
-
- if (!sizeof($error))
+ else
{
- if ($config['avatar_min_width'] || $config['avatar_min_height'])
+ $driver = $phpbb_avatar_manager->get_driver($avatar_data['avatar_type']);
+ if ($driver)
{
- if ($data['width'] < $config['avatar_min_width'] || $data['height'] < $config['avatar_min_height'])
- {
- $error[] = sprintf($user->lang['AVATAR_WRONG_SIZE'], $config['avatar_min_width'], $config['avatar_min_height'], $config['avatar_max_width'], $config['avatar_max_height'], $data['width'], $data['height']);
- }
+ $driver->delete($avatar_data);
}
- }
- if (!sizeof($error))
- {
- $submit_ary['avatar_width'] = $data['width'];
- $submit_ary['avatar_height'] = $data['height'];
+ // Removing the avatar
+ $submit_ary['avatar_type'] = '';
+ $submit_ary['avatar'] = '';
+ $submit_ary['avatar_width'] = 0;
+ $submit_ary['avatar_height'] = 0;
}
- }
- if ((isset($submit_ary['avatar']) && $submit_ary['avatar'] && (!isset($group_row['group_avatar']))) || $delete)
- {
- if (isset($group_row['group_avatar']) && $group_row['group_avatar'])
- {
- avatar_delete('group', $group_row, true);
- }
+ // Merge any avatar errors into the primary error array
+ $error = array_merge($error, $phpbb_avatar_manager->localize_errors($user, $avatar_error));
}
/*
@@ -434,6 +440,42 @@ class acp_groups
'colour' => array('hex_colour', true),
);
+ /**
+ * Request group data and operate on it
+ *
+ * @event core.acp_manage_group_request_data
+ * @var string action Type of the action: add|edit
+ * @var int group_id The group id
+ * @var array group_row Array with new group data
+ * @var array error Array of errors, if you add errors
+ * ensure to update the template variables
+ * S_ERROR and ERROR_MSG to display it
+ * @var string group_name The group name
+ * @var string group_desc The group description
+ * @var int group_type The group type
+ * @var bool allow_desc_bbcode Allow bbcode in group description: true|false
+ * @var bool allow_desc_urls Allow urls in group description: true|false
+ * @var bool allow_desc_smilies Allow smiles in group description: true|false
+ * @var array submit_ary Array with new group data
+ * @var array validation_checks Array with validation data
+ * @since 3.1.0-b5
+ */
+ $vars = array(
+ 'action',
+ 'group_id',
+ 'group_row',
+ 'error',
+ 'group_name',
+ 'group_desc',
+ 'group_type',
+ 'allow_desc_bbcode',
+ 'allow_desc_urls',
+ 'allow_desc_smilies',
+ 'submit_ary',
+ 'validation_checks',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.acp_manage_group_request_data', compact($vars)));
+
if ($validation_error = validate_data($submit_ary, $validation_checks))
{
// Replace "error" string with its real, localised form
@@ -445,26 +487,66 @@ class acp_groups
// Only set the rank, colour, etc. if it's changed or if we're adding a new
// group. This prevents existing group members being updated if no changes
// were made.
+ // However there are some attributes that need to be set everytime,
+ // otherwise the group gets removed from the feature.
+ $set_attributes = array('legend', 'teampage');
$group_attributes = array();
$test_variables = array(
'rank' => 'int',
'colour' => 'string',
'avatar' => 'string',
- 'avatar_type' => 'int',
+ 'avatar_type' => 'string',
'avatar_width' => 'int',
'avatar_height' => 'int',
'receive_pm' => 'int',
'legend' => 'int',
+ 'teampage' => 'int',
'message_limit' => 'int',
'max_recipients'=> 'int',
'founder_manage'=> 'int',
'skip_auth' => 'int',
);
+ /**
+ * Initialise data before we display the add/edit form
+ *
+ * @event core.acp_manage_group_initialise_data
+ * @var string action Type of the action: add|edit
+ * @var int group_id The group id
+ * @var array group_row Array with new group data
+ * @var array error Array of errors, if you add errors
+ * ensure to update the template variables
+ * S_ERROR and ERROR_MSG to display it
+ * @var string group_name The group name
+ * @var string group_desc The group description
+ * @var int group_type The group type
+ * @var bool allow_desc_bbcode Allow bbcode in group description: true|false
+ * @var bool allow_desc_urls Allow urls in group description: true|false
+ * @var bool allow_desc_smilies Allow smiles in group description: true|false
+ * @var array submit_ary Array with new group data
+ * @var array test_variables Array with variables for test
+ * @since 3.1.0-b5
+ */
+ $vars = array(
+ 'action',
+ 'group_id',
+ 'group_row',
+ 'error',
+ 'group_name',
+ 'group_desc',
+ 'group_type',
+ 'allow_desc_bbcode',
+ 'allow_desc_urls',
+ 'allow_desc_smilies',
+ 'submit_ary',
+ 'test_variables',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.acp_manage_group_initialise_data', compact($vars)));
+
foreach ($test_variables as $test => $type)
{
- if (isset($submit_ary[$test]) && ($action == 'add' || $group_row['group_' . $test] != $submit_ary[$test]))
+ if (isset($submit_ary[$test]) && ($action == 'add' || $group_row['group_' . $test] != $submit_ary[$test] || isset($group_attributes['group_avatar']) && strpos($test, 'avatar') === 0 || in_array($test, $set_attributes)))
{
settype($submit_ary[$test], $type);
$group_attributes['group_' . $test] = $group_row['group_' . $test] = $submit_ary[$test];
@@ -521,7 +603,7 @@ class acp_groups
}
}
- $cache->destroy('sql', GROUPS_TABLE);
+ $cache->destroy('sql', array(GROUPS_TABLE, TEAMPAGE_TABLE));
$message = ($action == 'edit') ? 'GROUP_UPDATED' : 'GROUP_CREATED';
trigger_error($user->lang[$message] . adm_back_link($this->u_action));
@@ -581,13 +663,51 @@ class acp_groups
$type_closed = ($group_type == GROUP_CLOSED) ? ' checked="checked"' : '';
$type_hidden = ($group_type == GROUP_HIDDEN) ? ' checked="checked"' : '';
- $avatar_img = (!empty($group_row['group_avatar'])) ? get_user_avatar($group_row['group_avatar'], $group_row['group_avatar_type'], $group_row['group_avatar_width'], $group_row['group_avatar_height'], 'GROUP_AVATAR') : '<img src="' . $phpbb_admin_path . 'images/no_avatar.gif" alt="" />';
+ // Load up stuff for avatars
+ if ($config['allow_avatar'])
+ {
+ $avatars_enabled = false;
+ $selected_driver = $phpbb_avatar_manager->clean_driver_name($request->variable('avatar_driver', $avatar_data['avatar_type']));
+
+ // Assign min and max values before generating avatar driver html
+ $template->assign_vars(array(
+ 'AVATAR_MIN_WIDTH' => $config['avatar_min_width'],
+ 'AVATAR_MAX_WIDTH' => $config['avatar_max_width'],
+ 'AVATAR_MIN_HEIGHT' => $config['avatar_min_height'],
+ 'AVATAR_MAX_HEIGHT' => $config['avatar_max_height'],
+ ));
+
+ foreach ($avatar_drivers as $current_driver)
+ {
+ $driver = $phpbb_avatar_manager->get_driver($current_driver);
+
+ $avatars_enabled = true;
+ $template->set_filenames(array(
+ 'avatar' => $driver->get_acp_template_name(),
+ ));
+
+ if ($driver->prepare_form($request, $template, $user, $avatar_data, $avatar_error))
+ {
+ $driver_name = $phpbb_avatar_manager->prepare_driver_name($current_driver);
+ $driver_upper = strtoupper($driver_name);
+ $template->assign_block_vars('avatar_drivers', array(
+ 'L_TITLE' => $user->lang($driver_upper . '_TITLE'),
+ 'L_EXPLAIN' => $user->lang($driver_upper . '_EXPLAIN'),
+
+ 'DRIVER' => $driver_name,
+ 'SELECTED' => $current_driver == $selected_driver,
+ 'OUTPUT' => $template->assign_display('avatar'),
+ ));
+ }
+ }
+ }
- $display_gallery = (isset($_POST['display_gallery'])) ? true : false;
+ $avatar = phpbb_get_group_avatar($group_row, 'GROUP_AVATAR', true);
- if ($config['allow_avatar_local'] && $display_gallery)
+ if (isset($phpbb_avatar_manager) && !$update)
{
- avatar_gallery($category, $avatar_select, 4);
+ // Merge any avatar errors into the primary error array
+ $error = array_merge($error, $phpbb_avatar_manager->localize_errors($user, $avatar_error));
}
$back_link = request_var('back_link', '');
@@ -608,12 +728,10 @@ class acp_groups
'S_ADD_GROUP' => ($action == 'add') ? true : false,
'S_GROUP_PERM' => ($action == 'add' && $auth->acl_get('a_authgroups') && $auth->acl_gets('a_aauth', 'a_fauth', 'a_mauth', 'a_uauth')) ? true : false,
'S_INCLUDE_SWATCH' => true,
- 'S_CAN_UPLOAD' => $can_upload,
'S_ERROR' => (sizeof($error)) ? true : false,
'S_SPECIAL_GROUP' => ($group_type == GROUP_SPECIAL) ? true : false,
- 'S_DISPLAY_GALLERY' => ($config['allow_avatar_local'] && !$display_gallery) ? true : false,
- 'S_IN_GALLERY' => ($config['allow_avatar_local'] && $display_gallery) ? true : false,
'S_USER_FOUNDER' => ($user->data['user_type'] == USER_FOUNDER) ? true : false,
+ 'S_AVATARS_ENABLED' => ($config['allow_avatar'] && $avatars_enabled),
'ERROR_MSG' => (sizeof($error)) ? implode('<br />', $error) : '',
'GROUP_NAME' => ($group_type == GROUP_SPECIAL) ? $user->lang['G_' . $group_name] : $group_name,
@@ -622,6 +740,7 @@ class acp_groups
'GROUP_RECEIVE_PM' => (isset($group_row['group_receive_pm']) && $group_row['group_receive_pm']) ? ' checked="checked"' : '',
'GROUP_FOUNDER_MANAGE' => (isset($group_row['group_founder_manage']) && $group_row['group_founder_manage']) ? ' checked="checked"' : '',
'GROUP_LEGEND' => (isset($group_row['group_legend']) && $group_row['group_legend']) ? ' checked="checked"' : '',
+ 'GROUP_TEAMPAGE' => (isset($group_row['group_teampage']) && $group_row['group_teampage']) ? ' checked="checked"' : '',
'GROUP_MESSAGE_LIMIT' => (isset($group_row['group_message_limit'])) ? $group_row['group_message_limit'] : 0,
'GROUP_MAX_RECIPIENTS' => (isset($group_row['group_max_recipients'])) ? $group_row['group_max_recipients'] : 0,
'GROUP_COLOUR' => (isset($group_row['group_colour'])) ? $group_row['group_colour'] : '',
@@ -633,8 +752,7 @@ class acp_groups
'S_RANK_OPTIONS' => $rank_options,
'S_GROUP_OPTIONS' => group_select_options(false, false, (($user->data['user_type'] == USER_FOUNDER) ? false : 0)),
- 'AVATAR' => $avatar_img,
- 'AVATAR_IMAGE' => $avatar_img,
+ 'AVATAR' => empty($avatar) ? '<img src="' . $phpbb_admin_path . 'images/no_avatar.gif" alt="" />' : $avatar,
'AVATAR_MAX_FILESIZE' => $config['avatar_filesize'],
'AVATAR_WIDTH' => (isset($group_row['group_avatar_width'])) ? $group_row['group_avatar_width'] : '',
'AVATAR_HEIGHT' => (isset($group_row['group_avatar_height'])) ? $group_row['group_avatar_height'] : '',
@@ -651,11 +769,43 @@ class acp_groups
'GROUP_HIDDEN' => $type_hidden,
'U_BACK' => $u_back,
- 'U_SWATCH' => append_sid("{$phpbb_admin_path}swatch.$phpEx", 'form=settings&amp;name=group_colour'),
'U_ACTION' => "{$this->u_action}&amp;action=$action&amp;g=$group_id",
- 'L_AVATAR_EXPLAIN' => sprintf($user->lang['AVATAR_EXPLAIN'], $config['avatar_max_width'], $config['avatar_max_height'], round($config['avatar_filesize'] / 1024)),
+ 'L_AVATAR_EXPLAIN' => phpbb_avatar_explanation_string(),
));
+ /**
+ * Modify group template data before we display the form
+ *
+ * @event core.acp_manage_group_display_form
+ * @var string action Type of the action: add|edit
+ * @var bool update Do we display the form only
+ * or did the user press submit
+ * @var int group_id The group id
+ * @var array group_row Array with new group data
+ * @var string group_name The group name
+ * @var int group_type The group type
+ * @var array group_desc_data The group description data
+ * @var string group_rank The group rank
+ * @var string rank_options The rank options
+ * @var array error Array of errors, if you add errors
+ * ensure to update the template variables
+ * S_ERROR and ERROR_MSG to display it
+ * @since 3.1.0-b5
+ */
+ $vars = array(
+ 'action',
+ 'update',
+ 'group_id',
+ 'group_row',
+ 'group_desc_data',
+ 'group_name',
+ 'group_type',
+ 'group_rank',
+ 'rank_options',
+ 'error',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.acp_manage_group_display_form', compact($vars)));
+
return;
break;
@@ -667,6 +817,7 @@ class acp_groups
}
$this->page_title = 'GROUP_MEMBERS';
+ $pagination = $phpbb_container->get('pagination');
// Grab the leaders - always, on every page...
$sql = 'SELECT u.user_id, u.username, u.username_clean, u.user_regdate, u.user_colour, u.user_posts, u.group_id, ug.group_leader, ug.user_pending
@@ -709,13 +860,14 @@ class acp_groups
$s_action_options .= '<option value="' . $option . '">' . $user->lang['GROUP_' . $lang] . '</option>';
}
+ $base_url = $this->u_action . "&amp;action=$action&amp;g=$group_id";
+ $pagination->generate_template_pagination($base_url, 'pagination', 'start', $total_members, $config['topics_per_page'], $start);
+
$template->assign_vars(array(
'S_LIST' => true,
'S_GROUP_SPECIAL' => ($group_row['group_type'] == GROUP_SPECIAL) ? true : false,
'S_ACTION_OPTIONS' => $s_action_options,
- 'S_ON_PAGE' => on_page($total_members, $config['topics_per_page'], $start),
- 'PAGINATION' => generate_pagination($this->u_action . "&amp;action=$action&amp;g=$group_id", $total_members, $config['topics_per_page'], $start, true),
'GROUP_NAME' => ($group_row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $group_row['group_name']] : $group_row['group_name'],
'U_ACTION' => $this->u_action . "&amp;g=$group_id",
@@ -831,6 +983,222 @@ class acp_groups
}
}
}
-}
-?>
+ public function manage_position()
+ {
+ global $config, $db, $template, $user, $request, $phpbb_container;
+
+ $this->tpl_name = 'acp_groups_position';
+ $this->page_title = 'ACP_GROUPS_POSITION';
+
+ $field = $request->variable('field', '');
+ $action = $request->variable('action', '');
+ $group_id = $request->variable('g', 0);
+ $teampage_id = $request->variable('t', 0);
+ $category_id = $request->variable('c', 0);
+
+ if ($field && !in_array($field, array('legend', 'teampage')))
+ {
+ // Invalid mode
+ trigger_error($user->lang['NO_MODE'] . adm_back_link($this->u_action), E_USER_WARNING);
+ }
+ else if ($field && in_array($field, array('legend', 'teampage')))
+ {
+
+ $group_position = $phpbb_container->get('groupposition.' . $field);
+ }
+
+ if ($field == 'teampage')
+ {
+ try
+ {
+ switch ($action)
+ {
+ case 'add':
+ $group_position->add_group_teampage($group_id, $category_id);
+ break;
+
+ case 'add_category':
+ $group_position->add_category_teampage($request->variable('category_name', '', true));
+ break;
+
+ case 'delete':
+ $group_position->delete_teampage($teampage_id);
+ break;
+
+ case 'move_up':
+ $group_position->move_up_teampage($teampage_id);
+ break;
+
+ case 'move_down':
+ $group_position->move_down_teampage($teampage_id);
+ break;
+ }
+ }
+ catch (\phpbb\groupposition\exception $exception)
+ {
+ trigger_error($user->lang($exception->getMessage()) . adm_back_link($this->u_action), E_USER_WARNING);
+ }
+ }
+ else if ($field == 'legend')
+ {
+ try
+ {
+ switch ($action)
+ {
+ case 'add':
+ $group_position->add_group($group_id);
+ break;
+
+ case 'delete':
+ $group_position->delete_group($group_id);
+ break;
+
+ case 'move_up':
+ $group_position->move_up($group_id);
+ break;
+
+ case 'move_down':
+ $group_position->move_down($group_id);
+ break;
+ }
+ }
+ catch (\phpbb\groupposition\exception $exception)
+ {
+ trigger_error($user->lang($exception->getMessage()) . adm_back_link($this->u_action), E_USER_WARNING);
+ }
+ }
+ else
+ {
+ switch ($action)
+ {
+ case 'set_config_teampage':
+ $config->set('teampage_forums', $request->variable('teampage_forums', 0));
+ $config->set('teampage_memberships', $request->variable('teampage_memberships', 0));
+ trigger_error($user->lang['CONFIG_UPDATED'] . adm_back_link($this->u_action));
+ break;
+
+ case 'set_config_legend':
+ $config->set('legend_sort_groupname', $request->variable('legend_sort_groupname', 0));
+ trigger_error($user->lang['CONFIG_UPDATED'] . adm_back_link($this->u_action));
+ break;
+ }
+ }
+
+ if (($action == 'move_up' || $action == 'move_down') && $request->is_ajax())
+ {
+ $json_response = new \phpbb\json_response;
+ $json_response->send(array('success' => true));
+ }
+
+ $sql = 'SELECT group_id, group_name, group_colour, group_type, group_legend
+ FROM ' . GROUPS_TABLE . '
+ ORDER BY group_legend ASC, group_type DESC, group_name ASC';
+ $result = $db->sql_query($sql);
+
+ $s_group_select_legend = '';
+ while ($row = $db->sql_fetchrow($result))
+ {
+ $group_name = ($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name'];
+ if ($row['group_legend'])
+ {
+ $template->assign_block_vars('legend', array(
+ 'GROUP_NAME' => $group_name,
+ 'GROUP_COLOUR' => ($row['group_colour']) ? '#' . $row['group_colour'] : '',
+ 'GROUP_TYPE' => $user->lang[\phpbb\groupposition\legend::group_type_language($row['group_type'])],
+
+ 'U_MOVE_DOWN' => "{$this->u_action}&amp;field=legend&amp;action=move_down&amp;g=" . $row['group_id'],
+ 'U_MOVE_UP' => "{$this->u_action}&amp;field=legend&amp;action=move_up&amp;g=" . $row['group_id'],
+ 'U_DELETE' => "{$this->u_action}&amp;field=legend&amp;action=delete&amp;g=" . $row['group_id'],
+ ));
+ }
+ else
+ {
+ $template->assign_block_vars('add_legend', array(
+ 'GROUP_ID' => (int) $row['group_id'],
+ 'GROUP_NAME' => $group_name,
+ 'GROUP_SPECIAL' => ($row['group_type'] == GROUP_SPECIAL),
+ ));
+ }
+ }
+ $db->sql_freeresult($result);
+
+ $category_url_param = (($category_id) ? '&amp;c=' . $category_id : '');
+
+ $sql = 'SELECT t.*, g.group_name, g.group_colour, g.group_type
+ FROM ' . TEAMPAGE_TABLE . ' t
+ LEFT JOIN ' . GROUPS_TABLE . ' g
+ ON (t.group_id = g.group_id)
+ WHERE t.teampage_parent = ' . $category_id . '
+ OR t.teampage_id = ' . $category_id . '
+ ORDER BY t.teampage_position ASC';
+ $result = $db->sql_query($sql);
+
+ $category_data = array();
+ while ($row = $db->sql_fetchrow($result))
+ {
+ if ($row['teampage_id'] == $category_id)
+ {
+ $template->assign_vars(array(
+ 'CURRENT_CATEGORY_NAME' => $row['teampage_name'],
+ ));
+ continue;
+ }
+
+ if ($row['group_id'])
+ {
+ $group_name = ($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name'];
+ $group_type = $user->lang[\phpbb\groupposition\teampage::group_type_language($row['group_type'])];
+ }
+ else
+ {
+ $group_name = $row['teampage_name'];
+ $group_type = '';
+ }
+
+ $template->assign_block_vars('teampage', array(
+ 'GROUP_NAME' => $group_name,
+ 'GROUP_COLOUR' => ($row['group_colour']) ? '#' . $row['group_colour'] : '',
+ 'GROUP_TYPE' => $group_type,
+
+ 'U_CATEGORY' => (!$row['group_id']) ? "{$this->u_action}&amp;c=" . $row['teampage_id'] : '',
+ 'U_MOVE_DOWN' => "{$this->u_action}&amp;field=teampage&amp;action=move_down{$category_url_param}&amp;t=" . $row['teampage_id'],
+ 'U_MOVE_UP' => "{$this->u_action}&amp;field=teampage&amp;action=move_up{$category_url_param}&amp;t=" . $row['teampage_id'],
+ 'U_DELETE' => "{$this->u_action}&amp;field=teampage&amp;action=delete{$category_url_param}&amp;t=" . $row['teampage_id'],
+ ));
+ }
+ $db->sql_freeresult($result);
+
+ $sql = 'SELECT g.group_id, g.group_name, g.group_colour, g.group_type
+ FROM ' . GROUPS_TABLE . ' g
+ LEFT JOIN ' . TEAMPAGE_TABLE . ' t
+ ON (t.group_id = g.group_id)
+ WHERE t.teampage_id IS NULL
+ ORDER BY g.group_type DESC, g.group_name ASC';
+ $result = $db->sql_query($sql);
+
+ $s_group_select_teampage = '';
+ while ($row = $db->sql_fetchrow($result))
+ {
+ $group_name = ($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name'];
+ $template->assign_block_vars('add_teampage', array(
+ 'GROUP_ID' => (int) $row['group_id'],
+ 'GROUP_NAME' => $group_name,
+ 'GROUP_SPECIAL' => ($row['group_type'] == GROUP_SPECIAL),
+ ));
+ }
+ $db->sql_freeresult($result);
+
+ $template->assign_vars(array(
+ 'U_ACTION' => $this->u_action,
+ 'U_ACTION_LEGEND' => $this->u_action . '&amp;field=legend',
+ 'U_ACTION_TEAMPAGE' => $this->u_action . '&amp;field=teampage' . $category_url_param,
+ 'U_ACTION_TEAMPAGE_CAT' => $this->u_action . '&amp;field=teampage_cat',
+
+ 'S_TEAMPAGE_CATEGORY' => $category_id,
+ 'DISPLAY_FORUMS' => ($config['teampage_forums']) ? true : false,
+ 'DISPLAY_MEMBERSHIPS' => $config['teampage_memberships'],
+ 'LEGEND_SORT_GROUPNAME' => ($config['legend_sort_groupname']) ? true : false,
+ ));
+ }
+}
diff --git a/phpBB/includes/acp/acp_icons.php b/phpBB/includes/acp/acp_icons.php
index 24f6cbbcbf..a0ea7dc9b1 100644
--- a/phpBB/includes/acp/acp_icons.php
+++ b/phpBB/includes/acp/acp_icons.php
@@ -1,10 +1,13 @@
<?php
/**
*
-* @package acp
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -18,7 +21,6 @@ if (!defined('IN_PHPBB'))
/**
* @todo [smilies] check regular expressions for special char replacements (stored specialchared in db)
-* @package acp
*/
class acp_icons
{
@@ -28,6 +30,7 @@ class acp_icons
{
global $db, $user, $auth, $template, $cache;
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
+ global $request, $phpbb_container;
$user->add_lang('acp/posting');
@@ -37,6 +40,10 @@ class acp_icons
$action = (isset($_POST['edit'])) ? 'edit' : $action;
$action = (isset($_POST['import'])) ? 'import' : $action;
$icon_id = request_var('id', 0);
+ $submit = $request->is_set_post('submit', false);
+
+ $form_key = 'acp_icons';
+ add_form_key($form_key);
$mode = ($mode == 'smilies') ? 'smilies' : 'icons';
@@ -203,7 +210,6 @@ class acp_icons
unset($_images[$row[$fields . '_url']]);
}
-
if ($row[$fields . '_id'] == $icon_id)
{
$after = true;
@@ -307,7 +313,6 @@ class acp_icons
'IMG_SRC' => $phpbb_root_path . $img_path . '/' . $default_row['smiley_url'],
'IMG_PATH' => $img_path,
- 'PHPBB_ROOT_PATH' => $phpbb_root_path,
'CODE' => $default_row['code'],
'EMOTION' => $default_row['emotion'],
@@ -324,6 +329,11 @@ class acp_icons
case 'create':
case 'modify':
+ if (!check_form_key($form_key))
+ {
+ trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING);
+ }
+
// Get items to create/modify
$images = (isset($_POST['image'])) ? array_keys(request_var('image', array('' => 0))) : array();
@@ -338,7 +348,7 @@ class acp_icons
$image_display_on_posting = (isset($_POST['display_on_posting'])) ? request_var('display_on_posting', array('' => 0)) : array();
// Ok, add the relevant bits if we are adding new codes to existing emoticons...
- if (!empty($_POST['add_additional_code']))
+ if ($request->variable('add_additional_code', false, false, \phpbb\request\request_interface::POST))
{
$add_image = request_var('add_image', '');
$add_code = utf8_normalize_nfc(request_var('add_code', '', true));
@@ -354,7 +364,7 @@ class acp_icons
$image_width[$add_image] = request_var('add_width', 0);
$image_height[$add_image] = request_var('add_height', 0);
- if (!empty($_POST['add_display_on_posting']))
+ if ($request->variable('add_display_on_posting', false, false, \phpbb\request\request_interface::POST))
{
$image_display_on_posting[$add_image] = 1;
}
@@ -378,7 +388,7 @@ class acp_icons
if ($smiley_count + $addable_smileys_count > SMILEY_LIMIT)
{
- trigger_error(sprintf($user->lang['TOO_MANY_SMILIES'], SMILEY_LIMIT) . adm_back_link($this->u_action), E_USER_WARNING);
+ trigger_error($user->lang('TOO_MANY_SMILIES', SMILEY_LIMIT) . adm_back_link($this->u_action), E_USER_WARNING);
}
}
@@ -480,27 +490,13 @@ class acp_icons
$icons_updated++;
}
- }
+ }
}
$cache->destroy('_icons');
$cache->destroy('sql', $table);
- $level = E_USER_NOTICE;
- switch ($icons_updated)
- {
- case 0:
- $suc_lang = "{$lang}_NONE";
- $level = E_USER_WARNING;
- break;
-
- case 1:
- $suc_lang = "{$lang}_ONE";
- break;
-
- default:
- $suc_lang = $lang;
- }
+ $level = ($icons_updated) ? E_USER_NOTICE : E_USER_WARNING;
$errormsgs = '';
foreach ($errors as $img => $error)
{
@@ -508,11 +504,11 @@ class acp_icons
}
if ($action == 'modify')
{
- trigger_error($user->lang[$suc_lang . '_EDITED'] . $errormsgs . adm_back_link($this->u_action), $level);
+ trigger_error($user->lang($lang . '_EDITED', $icons_updated) . $errormsgs . adm_back_link($this->u_action), $level);
}
else
{
- trigger_error($user->lang[$suc_lang . '_ADDED'] . $errormsgs . adm_back_link($this->u_action), $level);
+ trigger_error($user->lang($lang . '_ADDED', $icons_updated) . $errormsgs . adm_back_link($this->u_action), $level);
}
break;
@@ -526,6 +522,11 @@ class acp_icons
{
$order = 0;
+ if (!check_form_key($form_key))
+ {
+ trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING);
+ }
+
if (!($pak_ary = @file($phpbb_root_path . $img_path . '/' . $pak)))
{
trigger_error($user->lang['PAK_FILE_NOT_READABLE'] . adm_back_link($this->u_action), E_USER_WARNING);
@@ -551,10 +552,10 @@ class acp_icons
// The user has already selected a smilies_pak file
if ($current == 'delete')
{
- switch ($db->sql_layer)
+ switch ($db->get_sql_layer())
{
case 'sqlite':
- case 'firebird':
+ case 'sqlite3':
$db->sql_query('DELETE FROM ' . $table);
break;
@@ -598,7 +599,7 @@ class acp_icons
$smiley_count = $this->item_count($table);
if ($smiley_count + sizeof($pak_ary) > SMILEY_LIMIT)
{
- trigger_error(sprintf($user->lang['TOO_MANY_SMILIES'], SMILEY_LIMIT) . adm_back_link($this->u_action), E_USER_WARNING);
+ trigger_error($user->lang('TOO_MANY_SMILIES', SMILEY_LIMIT) . adm_back_link($this->u_action), E_USER_WARNING);
}
}
@@ -711,7 +712,7 @@ class acp_icons
$template->assign_vars(array(
'MESSAGE_TITLE' => $user->lang['EXPORT_' . $lang],
- 'MESSAGE_TEXT' => sprintf($user->lang['EXPORT_' . $lang . '_EXPLAIN'], '<a href="' . $this->u_action . '&amp;action=send">', '</a>'),
+ 'MESSAGE_TEXT' => sprintf($user->lang['EXPORT_' . $lang . '_EXPLAIN'], '<a href="' . $this->u_action . '&amp;action=send&amp;hash=' . generate_link_hash('acp_icons') . '">', '</a>'),
'S_USER_NOTICE' => true,
)
@@ -723,6 +724,11 @@ class acp_icons
case 'send':
+ if (!check_link_hash($request->variable('hash', ''), 'acp_icons'))
+ {
+ trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING);
+ }
+
$sql = "SELECT *
FROM $table
ORDER BY {$fields}_order";
@@ -750,7 +756,7 @@ class acp_icons
{
garbage_collection();
- header('Pragma: public');
+ header('Cache-Control: public');
// Send out the Headers
header('Content-Type: text/x-delimtext; name="' . $mode . '.pak"');
@@ -796,6 +802,18 @@ class acp_icons
$cache->destroy('_icons');
$cache->destroy('sql', $table);
+
+ if ($request->is_ajax())
+ {
+ $json_response = new \phpbb\json_response;
+ $json_response->send(array(
+ 'MESSAGE_TITLE' => $user->lang['INFORMATION'],
+ 'MESSAGE_TEXT' => $notice,
+ 'REFRESH_DATA' => array(
+ 'time' => 3
+ )
+ ));
+ }
}
else
{
@@ -812,6 +830,11 @@ class acp_icons
case 'move_up':
case 'move_down':
+ if (!check_link_hash($request->variable('hash', ''), 'acp_icons'))
+ {
+ trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING);
+ }
+
// Get current order id...
$sql = "SELECT {$fields}_order as current_order
FROM $table
@@ -835,9 +858,10 @@ class acp_icons
WHERE {$fields}_order = $switch_order_id
AND {$fields}_id <> $icon_id";
$db->sql_query($sql);
+ $move_executed = (bool) $db->sql_affectedrows();
// Only update the other entry too if the previous entry got updated
- if ($db->sql_affectedrows())
+ if ($move_executed)
{
$sql = "UPDATE $table
SET {$fields}_order = $switch_order_id
@@ -849,6 +873,14 @@ class acp_icons
$cache->destroy('_icons');
$cache->destroy('sql', $table);
+ if ($request->is_ajax())
+ {
+ $json_response = new \phpbb\json_response;
+ $json_response->send(array(
+ 'success' => $move_executed,
+ ));
+ }
+
break;
}
@@ -896,6 +928,7 @@ class acp_icons
);
$spacer = false;
+ $pagination = $phpbb_container->get('pagination');
$pagination_start = request_var('start', 0);
$item_count = $this->item_count($table);
@@ -919,8 +952,8 @@ class acp_icons
'EMOTION' => (isset($row['emotion'])) ? $row['emotion'] : '',
'U_EDIT' => $this->u_action . '&amp;action=edit&amp;id=' . $row[$fields . '_id'],
'U_DELETE' => $this->u_action . '&amp;action=delete&amp;id=' . $row[$fields . '_id'],
- 'U_MOVE_UP' => $this->u_action . '&amp;action=move_up&amp;id=' . $row[$fields . '_id'] . '&amp;start=' . $pagination_start,
- 'U_MOVE_DOWN' => $this->u_action . '&amp;action=move_down&amp;id=' . $row[$fields . '_id'] . '&amp;start=' . $pagination_start,
+ 'U_MOVE_UP' => $this->u_action . '&amp;action=move_up&amp;id=' . $row[$fields . '_id'] . '&amp;start=' . $pagination_start . '&amp;hash=' . generate_link_hash('acp_icons'),
+ 'U_MOVE_DOWN' => $this->u_action . '&amp;action=move_down&amp;id=' . $row[$fields . '_id'] . '&amp;start=' . $pagination_start . '&amp;hash=' . generate_link_hash('acp_icons'),
));
if (!$spacer && !$row['display_on_posting'])
@@ -930,9 +963,7 @@ class acp_icons
}
$db->sql_freeresult($result);
- $template->assign_var('PAGINATION',
- generate_pagination($this->u_action, $item_count, $config['smilies_per_page'], $pagination_start, true)
- );
+ $pagination->generate_template_pagination($this->u_action, 'pagination', 'start', $item_count, $config['smilies_per_page'], $pagination_start);
}
/**
@@ -954,5 +985,3 @@ class acp_icons
return $item_count;
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/acp/acp_inactive.php b/phpBB/includes/acp/acp_inactive.php
index f3f332d707..76c7a1b277 100644
--- a/phpBB/includes/acp/acp_inactive.php
+++ b/phpBB/includes/acp/acp_inactive.php
@@ -1,10 +1,13 @@
<?php
/**
*
-* @package acp
-* @version $Id$
-* @copyright (c) 2006 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -16,9 +19,6 @@ if (!defined('IN_PHPBB'))
exit;
}
-/**
-* @package acp
-*/
class acp_inactive
{
var $u_action;
@@ -31,10 +31,13 @@ class acp_inactive
function main($id, $mode)
{
- global $config, $db, $user, $auth, $template;
+ global $config, $db, $user, $auth, $template, $phpbb_container;
global $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix;
- include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
+ if (!function_exists('user_active_flip'))
+ {
+ include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
+ }
$user->add_lang('memberlist');
@@ -50,6 +53,7 @@ class acp_inactive
$form_key = 'acp_inactive';
add_form_key($form_key);
+ $pagination = $phpbb_container->get('pagination');
// We build the sort key and per page settings here, because they may be needed later
@@ -108,7 +112,10 @@ class acp_inactive
if ($config['require_activation'] == USER_ACTIVATION_ADMIN && !empty($inactive_users))
{
- include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);
+ if (!class_exists('messenger'))
+ {
+ include($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);
+ }
$messenger = new messenger(false);
@@ -116,7 +123,7 @@ class acp_inactive
{
$messenger->template('admin_welcome_activated', $row['user_lang']);
- $messenger->to($row['user_email'], $row['username']);
+ $messenger->set_addresses($row);
$messenger->anti_abuse_headers($config, $user);
@@ -137,6 +144,8 @@ class acp_inactive
add_log('admin', 'LOG_USER_ACTIVE', $row['username']);
add_log('user', $row['user_id'], 'LOG_USER_ACTIVE_USER');
}
+
+ trigger_error(sprintf($user->lang['LOG_INACTIVE_ACTIVATE'], implode($user->lang['COMMA_SEPARATOR'], $user_affected) . ' ' . adm_back_link($this->u_action)));
}
// For activate we really need to redirect, else a refresh can result in users being deactivated again
@@ -154,12 +163,11 @@ class acp_inactive
trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action), E_USER_WARNING);
}
- foreach ($mark as $user_id)
- {
- user_delete('retain', $user_id, $user_affected[$user_id]);
- }
+ user_delete('retain', $mark, true);
add_log('admin', 'LOG_INACTIVE_' . strtoupper($action), implode(', ', $user_affected));
+
+ trigger_error(sprintf($user->lang['LOG_INACTIVE_DELETE'], implode($user->lang['COMMA_SEPARATOR'], $user_affected) . ' ' . adm_back_link($this->u_action)));
}
else
{
@@ -194,7 +202,10 @@ class acp_inactive
if ($row = $db->sql_fetchrow($result))
{
// Send the messages
- include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);
+ if (!class_exists('messenger'))
+ {
+ include($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);
+ }
$messenger = new messenger();
$usernames = $user_ids = array();
@@ -203,8 +214,7 @@ class acp_inactive
{
$messenger->template('user_remind_inactive', $row['user_lang']);
- $messenger->to($row['user_email'], $row['username']);
- $messenger->im($row['user_jabber'], $row['username']);
+ $messenger->set_addresses($row);
$messenger->anti_abuse_headers($config, $user);
@@ -231,7 +241,8 @@ class acp_inactive
$db->sql_query($sql);
add_log('admin', 'LOG_INACTIVE_REMIND', implode(', ', $usernames));
- unset($usernames);
+
+ trigger_error(sprintf($user->lang['LOG_INACTIVE_REMIND'], implode($user->lang['COMMA_SEPARATOR'], $usernames) . ' ' . adm_back_link($this->u_action)));
}
$db->sql_freeresult($result);
@@ -269,9 +280,10 @@ class acp_inactive
'REMINDED_EXPLAIN' => $user->lang('USER_LAST_REMINDED', (int) $row['user_reminded'], $user->format_date($row['user_reminded_time'])),
- 'USERNAME_FULL' => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour'], false, append_sid("{$phpbb_admin_path}index.$phpEx", 'i=users&amp;mode=overview')),
+ 'USERNAME_FULL' => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour'], false, append_sid("{$phpbb_admin_path}index.$phpEx", 'i=users&amp;mode=overview&amp;redirect=acp_inactive')),
'USERNAME' => get_username_string('username', $row['user_id'], $row['username'], $row['user_colour']),
'USER_COLOR' => get_username_string('colour', $row['user_id'], $row['username'], $row['user_colour']),
+ 'USER_EMAIL' => $row['user_email'],
'U_USER_ADMIN' => append_sid("{$phpbb_admin_path}index.$phpEx", "i=users&amp;mode=overview&amp;u={$row['user_id']}"),
'U_SEARCH_USER' => ($auth->acl_get('u_search')) ? append_sid("{$phpbb_root_path}search.$phpEx", "author_id={$row['user_id']}&amp;sr=posts") : '',
@@ -284,6 +296,9 @@ class acp_inactive
$option_ary += array('remind' => 'REMIND');
}
+ $base_url = $this->u_action . "&amp;$u_sort_param&amp;users_per_page=$per_page";
+ $pagination->generate_template_pagination($base_url, 'pagination', 'start', $inactive_count, $per_page, $start);
+
$template->assign_vars(array(
'S_INACTIVE_USERS' => true,
'S_INACTIVE_OPTIONS' => build_select($option_ary),
@@ -291,8 +306,6 @@ class acp_inactive
'S_LIMIT_DAYS' => $s_limit_days,
'S_SORT_KEY' => $s_sort_key,
'S_SORT_DIR' => $s_sort_dir,
- 'S_ON_PAGE' => on_page($inactive_count, $per_page, $start),
- 'PAGINATION' => generate_pagination($this->u_action . "&amp;$u_sort_param&amp;users_per_page=$per_page", $inactive_count, $per_page, $start, true),
'USERS_PER_PAGE' => $per_page,
'U_ACTION' => $this->u_action . "&amp;$u_sort_param&amp;users_per_page=$per_page&amp;start=$start",
@@ -302,5 +315,3 @@ class acp_inactive
$this->page_title = 'ACP_INACTIVE_USERS';
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/acp/acp_jabber.php b/phpBB/includes/acp/acp_jabber.php
index 9925527b34..3b958c0ea1 100644
--- a/phpBB/includes/acp/acp_jabber.php
+++ b/phpBB/includes/acp/acp_jabber.php
@@ -1,11 +1,17 @@
<?php
/**
*
-* @package acp
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+/**
* @todo Check/enter/update transport info
*/
@@ -17,9 +23,6 @@ if (!defined('IN_PHPBB'))
exit;
}
-/**
-* @package acp
-*/
class acp_jabber
{
var $u_action;
@@ -31,7 +34,10 @@ class acp_jabber
$user->add_lang('acp/board');
- include_once($phpbb_root_path . 'includes/functions_jabber.' . $phpEx);
+ if (!class_exists('jabber'))
+ {
+ include($phpbb_root_path . 'includes/functions_jabber.' . $phpEx);
+ }
$action = request_var('action', '');
$submit = (isset($_POST['submit'])) ? true : false;
@@ -44,13 +50,16 @@ class acp_jabber
$this->tpl_name = 'acp_jabber';
$this->page_title = 'ACP_JABBER_SETTINGS';
- $jab_enable = request_var('jab_enable', (bool) $config['jab_enable']);
- $jab_host = request_var('jab_host', (string) $config['jab_host']);
- $jab_port = request_var('jab_port', (int) $config['jab_port']);
- $jab_username = request_var('jab_username', (string) $config['jab_username']);
- $jab_password = request_var('jab_password', (string) $config['jab_password']);
- $jab_package_size = request_var('jab_package_size', (int) $config['jab_package_size']);
- $jab_use_ssl = request_var('jab_use_ssl', (bool) $config['jab_use_ssl']);
+ $jab_enable = request_var('jab_enable', (bool) $config['jab_enable']);
+ $jab_host = request_var('jab_host', (string) $config['jab_host']);
+ $jab_port = request_var('jab_port', (int) $config['jab_port']);
+ $jab_username = request_var('jab_username', (string) $config['jab_username']);
+ $jab_password = request_var('jab_password', (string) $config['jab_password']);
+ $jab_package_size = request_var('jab_package_size', (int) $config['jab_package_size']);
+ $jab_use_ssl = request_var('jab_use_ssl', (bool) $config['jab_use_ssl']);
+ $jab_verify_peer = request_var('jab_verify_peer', (bool) $config['jab_verify_peer']);
+ $jab_verify_peer_name = request_var('jab_verify_peer_name', (bool) $config['jab_verify_peer_name']);
+ $jab_allow_self_signed = request_var('jab_allow_self_signed', (bool) $config['jab_allow_self_signed']);
$form_name = 'acp_jabber';
add_form_key($form_name);
@@ -70,7 +79,7 @@ class acp_jabber
// Is this feature enabled? Then try to establish a connection
if ($jab_enable)
{
- $jabber = new jabber($jab_host, $jab_port, $jab_username, $jab_password, $jab_use_ssl);
+ $jabber = new jabber($jab_host, $jab_port, $jab_username, $jab_password, $jab_use_ssl, $jab_verify_peer, $jab_verify_peer_name, $jab_allow_self_signed);
if (!$jabber->connect())
{
@@ -104,9 +113,15 @@ class acp_jabber
set_config('jab_host', $jab_host);
set_config('jab_port', $jab_port);
set_config('jab_username', $jab_username);
- set_config('jab_password', $jab_password);
+ if ($jab_password !== '********')
+ {
+ set_config('jab_password', $jab_password);
+ }
set_config('jab_package_size', $jab_package_size);
set_config('jab_use_ssl', $jab_use_ssl);
+ set_config('jab_verify_peer', $jab_verify_peer);
+ set_config('jab_verify_peer_name', $jab_verify_peer_name);
+ set_config('jab_allow_self_signed', $jab_allow_self_signed);
add_log('admin', 'LOG_' . $log);
trigger_error($message . adm_back_link($this->u_action));
@@ -119,13 +134,14 @@ class acp_jabber
'JAB_HOST' => $jab_host,
'JAB_PORT' => ($jab_port) ? $jab_port : '',
'JAB_USERNAME' => $jab_username,
- 'JAB_PASSWORD' => $jab_password,
+ 'JAB_PASSWORD' => $jab_password !== '' ? '********' : '',
'JAB_PACKAGE_SIZE' => $jab_package_size,
'JAB_USE_SSL' => $jab_use_ssl,
+ 'JAB_VERIFY_PEER' => $jab_verify_peer,
+ 'JAB_VERIFY_PEER_NAME' => $jab_verify_peer_name,
+ 'JAB_ALLOW_SELF_SIGNED' => $jab_allow_self_signed,
'S_CAN_USE_SSL' => jabber::can_use_ssl(),
'S_GTALK_NOTE' => (!@function_exists('dns_get_record')) ? true : false,
));
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/acp/acp_language.php b/phpBB/includes/acp/acp_language.php
index d560cdd0c5..bddc2be9cb 100644
--- a/phpBB/includes/acp/acp_language.php
+++ b/phpBB/includes/acp/acp_language.php
@@ -1,10 +1,13 @@
<?php
/**
*
-* @package acp
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -16,9 +19,6 @@ if (!defined('IN_PHPBB'))
exit;
}
-/**
-* @package acp
-*/
class acp_language
{
var $u_action;
@@ -31,21 +31,16 @@ class acp_language
function main($id, $mode)
{
- global $config, $db, $user, $auth, $template, $cache;
- global $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix;
- global $safe_mode, $file_uploads;
+ global $config, $db, $user, $template;
+ global $phpbb_root_path, $phpEx, $request;
- include_once($phpbb_root_path . 'includes/functions_user.' . $phpEx);
-
- $this->default_variables();
+ if (!function_exists('validate_language_iso_name'))
+ {
+ include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
+ }
// Check and set some common vars
-
$action = (isset($_POST['update_details'])) ? 'update_details' : '';
- $action = (isset($_POST['download_file'])) ? 'download_file' : $action;
- $action = (isset($_POST['upload_file'])) ? 'upload_file' : $action;
- $action = (isset($_POST['upload_data'])) ? 'upload_data' : $action;
- $action = (isset($_POST['submit_file'])) ? 'submit_file' : $action;
$action = (isset($_POST['remove_store'])) ? 'details' : $action;
$submit = (empty($action) && !isset($_POST['update']) && !isset($_POST['test_connection'])) ? false : true;
@@ -55,11 +50,6 @@ class acp_language
add_form_key('acp_lang');
$lang_id = request_var('id', 0);
- if (isset($_POST['missing_file']))
- {
- $missing_file = request_var('missing_file', array('' => 0));
- list($_REQUEST['language_file'], ) = array_keys($missing_file);
- }
$selected_lang_file = request_var('language_file', '|common.' . $phpEx);
@@ -72,78 +62,8 @@ class acp_language
$this->tpl_name = 'acp_language';
$this->page_title = 'ACP_LANGUAGE_PACKS';
- if ($submit && $action == 'upload_data' && request_var('test_connection', ''))
- {
- $test_connection = false;
- $action = 'upload_file';
- $method = request_var('method', '');
-
- include_once($phpbb_root_path . 'includes/functions_transfer.' . $phpEx);
-
- switch ($method)
- {
- case 'ftp':
- $transfer = new ftp(request_var('host', ''), request_var('username', ''), request_var('password', ''), request_var('root_path', ''), request_var('port', ''), request_var('timeout', ''));
- break;
-
- case 'ftp_fsock':
- $transfer = new ftp_fsock(request_var('host', ''), request_var('username', ''), request_var('password', ''), request_var('root_path', ''), request_var('port', ''), request_var('timeout', ''));
- break;
-
- default:
- trigger_error($user->lang['INVALID_UPLOAD_METHOD'], E_USER_ERROR);
- break;
- }
-
- $test_connection = $transfer->open_session();
- $transfer->close_session();
- }
-
switch ($action)
{
- case 'upload_file':
-
- include_once($phpbb_root_path . 'includes/functions_transfer.' . $phpEx);
-
- $method = request_var('method', '');
-
- if (!class_exists($method))
- {
- trigger_error('Method does not exist.', E_USER_ERROR);
- }
-
- $requested_data = call_user_func(array($method, 'data'));
- foreach ($requested_data as $data => $default)
- {
- $template->assign_block_vars('data', array(
- 'DATA' => $data,
- 'NAME' => $user->lang[strtoupper($method . '_' . $data)],
- 'EXPLAIN' => $user->lang[strtoupper($method . '_' . $data) . '_EXPLAIN'],
- 'DEFAULT' => (!empty($_REQUEST[$data])) ? request_var($data, '') : $default
- ));
- }
-
- $hidden_data = build_hidden_fields(array(
- 'file' => $this->language_file,
- 'dir' => $this->language_directory,
- 'language_file' => $selected_lang_file,
- 'method' => $method)
- );
-
- $hidden_data .= build_hidden_fields(array('entry' => $_POST['entry']), true, STRIP);
-
- $template->assign_vars(array(
- 'S_UPLOAD' => true,
- 'NAME' => $method,
- 'U_ACTION' => $this->u_action . "&amp;id=$lang_id&amp;action=upload_data",
- 'U_BACK' => $this->u_action . "&amp;id=$lang_id&amp;action=details&amp;language_file=" . urlencode($selected_lang_file),
- 'HIDDEN' => $hidden_data,
-
- 'S_CONNECTION_SUCCESS' => (request_var('test_connection', '') && $test_connection === true) ? true : false,
- 'S_CONNECTION_FAILED' => (request_var('test_connection', '') && $test_connection !== true) ? true : false
- ));
- break;
-
case 'update_details':
if (!$submit || !check_form_key($form_name))
@@ -178,255 +98,6 @@ class acp_language
trigger_error($user->lang['LANGUAGE_DETAILS_UPDATED'] . adm_back_link($this->u_action));
break;
- case 'submit_file':
- case 'download_file':
- case 'upload_data':
-
- if (!$submit || !check_form_key($form_name))
- {
- trigger_error($user->lang['FORM_INVALID']. adm_back_link($this->u_action), E_USER_WARNING);
- }
-
- if (!$lang_id || empty($_POST['entry']))
- {
- trigger_error($user->lang['NO_LANG_ID'] . adm_back_link($this->u_action), E_USER_WARNING);
- }
-
- if ($this->language_directory != 'email' && !is_array($_POST['entry']))
- {
- trigger_error($user->lang['NO_LANG_ID'] . adm_back_link($this->u_action), E_USER_WARNING);
- }
-
- if (!$this->language_file || (!$this->language_directory && !in_array($this->language_file, $this->main_files)))
- {
- trigger_error($user->lang['NO_FILE_SELECTED'] . adm_back_link($this->u_action), E_USER_WARNING);
- }
-
- $sql = 'SELECT *
- FROM ' . LANG_TABLE . "
- WHERE lang_id = $lang_id";
- $result = $db->sql_query($sql);
- $row = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
-
- if (!$row)
- {
- trigger_error($user->lang['NO_LANG_ID'] . adm_back_link($this->u_action), E_USER_WARNING);
- }
-
- // Before we attempt to write anything let's check if the admin really chose a correct filename
- switch ($this->language_directory)
- {
- case 'email':
- // Get email templates
- $email_files = filelist($phpbb_root_path . 'language/' . $row['lang_iso'], 'email', 'txt');
- $email_files = $email_files['email/'];
-
- if (!in_array($this->language_file, $email_files))
- {
- trigger_error($user->lang['WRONG_LANGUAGE_FILE'] . adm_back_link($this->u_action . '&amp;action=details&amp;id=' . $lang_id), E_USER_WARNING);
- }
- break;
-
- case 'acp':
- // Get acp files
- $acp_files = filelist($phpbb_root_path . 'language/' . $row['lang_iso'], 'acp', $phpEx);
- $acp_files = $acp_files['acp/'];
-
- if (!in_array($this->language_file, $acp_files))
- {
- trigger_error($user->lang['WRONG_LANGUAGE_FILE'] . adm_back_link($this->u_action . '&amp;action=details&amp;id=' . $lang_id), E_USER_WARNING);
- }
- break;
-
- case 'mods':
- // Get mod files
- $mods_files = filelist($phpbb_root_path . 'language/' . $row['lang_iso'], 'mods', $phpEx);
- $mods_files = (isset($mods_files['mods/'])) ? $mods_files['mods/'] : array();
-
- if (!in_array($this->language_file, $mods_files))
- {
- trigger_error($user->lang['WRONG_LANGUAGE_FILE'] . adm_back_link($this->u_action . '&amp;action=details&amp;id=' . $lang_id), E_USER_WARNING);
- }
- break;
-
- default:
- if (!in_array($this->language_file, $this->main_files))
- {
- trigger_error($user->lang['WRONG_LANGUAGE_FILE'] . adm_back_link($this->u_action . '&amp;action=details&amp;id=' . $lang_id), E_USER_WARNING);
- }
- break;
- }
-
- if (!$safe_mode)
- {
- $mkdir_ary = array('language', 'language/' . $row['lang_iso']);
-
- if ($this->language_directory)
- {
- $mkdir_ary[] = 'language/' . $row['lang_iso'] . '/' . $this->language_directory;
- }
-
- foreach ($mkdir_ary as $dir)
- {
- $dir = $phpbb_root_path . 'store/' . $dir;
-
- if (!is_dir($dir))
- {
- if (!@mkdir($dir, 0777))
- {
- trigger_error("Could not create directory $dir", E_USER_ERROR);
- }
- @chmod($dir, 0777);
- }
- }
- }
-
- // Get target filename for storage folder
- $filename = $this->get_filename($row['lang_iso'], $this->language_directory, $this->language_file, true, true);
- $fp = @fopen($phpbb_root_path . $filename, 'wb');
-
- if (!$fp)
- {
- trigger_error(sprintf($user->lang['UNABLE_TO_WRITE_FILE'], $filename) . adm_back_link($this->u_action . '&amp;id=' . $lang_id . '&amp;action=details&amp;language_file=' . urlencode($selected_lang_file)), E_USER_WARNING);
- }
-
- if ($this->language_directory == 'email')
- {
- // Email Template
- $entry = $this->prepare_lang_entry($_POST['entry'], false);
- fwrite($fp, $entry);
- }
- else
- {
- $name = (($this->language_directory) ? $this->language_directory . '_' : '') . $this->language_file;
- $header = str_replace(array('{FILENAME}', '{LANG_NAME}', '{CHANGED}', '{AUTHOR}'), array($name, $row['lang_english_name'], date('Y-m-d', time()), $row['lang_author']), $this->language_file_header);
-
- if (strpos($this->language_file, 'help_') === 0)
- {
- // Help File
- $header .= '$help = array(' . "\n";
- fwrite($fp, $header);
-
- foreach ($_POST['entry'] as $key => $value)
- {
- if (!is_array($value))
- {
- continue;
- }
-
- $entry = "\tarray(\n";
-
- foreach ($value as $_key => $_value)
- {
- $entry .= "\t\t" . (int) $_key . "\t=> '" . $this->prepare_lang_entry($_value) . "',\n";
- }
-
- $entry .= "\t),\n";
- fwrite($fp, $entry);
- }
-
- $footer = ");\n\n?>";
- fwrite($fp, $footer);
- }
- else
- {
- // Language File
- $header .= $this->lang_header;
- fwrite($fp, $header);
-
- foreach ($_POST['entry'] as $key => $value)
- {
- $entry = $this->format_lang_array($key, $value);
- fwrite($fp, $entry);
- }
-
- $footer = "));\n\n?>";
- fwrite($fp, $footer);
- }
- }
-
- fclose($fp);
-
- if ($action == 'download_file')
- {
- header('Pragma: no-cache');
- header('Content-Type: application/octetstream; name="' . $this->language_file . '"');
- header('Content-disposition: attachment; filename=' . $this->language_file);
-
- $fp = @fopen($phpbb_root_path . $filename, 'rb');
- while ($buffer = fread($fp, 1024))
- {
- echo $buffer;
- }
- fclose($fp);
-
- add_log('admin', 'LOG_LANGUAGE_FILE_SUBMITTED', $this->language_file);
-
- exit;
- }
- else if ($action == 'upload_data')
- {
- $sql = 'SELECT lang_iso
- FROM ' . LANG_TABLE . "
- WHERE lang_id = $lang_id";
- $result = $db->sql_query($sql);
- $row = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
-
- $file = request_var('file', '');
- $dir = request_var('dir', '');
-
- $selected_lang_file = $dir . '|' . $file;
-
- $old_file = '/' . $this->get_filename($row['lang_iso'], $dir, $file, false, true);
- $lang_path = 'language/' . $row['lang_iso'] . '/' . (($dir) ? $dir . '/' : '');
-
- include_once($phpbb_root_path . 'includes/functions_transfer.' . $phpEx);
- $method = request_var('method', '');
-
- if ($method != 'ftp' && $method != 'ftp_fsock')
- {
- trigger_error($user->lang['INVALID_UPLOAD_METHOD'], E_USER_ERROR);
- }
-
- $transfer = new $method(request_var('host', ''), request_var('username', ''), request_var('password', ''), request_var('root_path', ''), request_var('port', ''), request_var('timeout', ''));
-
- if (($result = $transfer->open_session()) !== true)
- {
- trigger_error($user->lang[$result] . adm_back_link($this->u_action . '&amp;action=details&amp;id=' . $lang_id . '&amp;language_file=' . urlencode($selected_lang_file)), E_USER_WARNING);
- }
-
- $transfer->rename($lang_path . $file, $lang_path . $file . '.bak');
- $result = $transfer->copy_file('store/' . $lang_path . $file, $lang_path . $file);
-
- if ($result === false)
- {
- // If failed, try to rename again and print error out...
- $transfer->delete_file($lang_path . $file);
- $transfer->rename($lang_path . $file . '.bak', $lang_path . $file);
-
- trigger_error($user->lang['UPLOAD_FAILED'] . adm_back_link($this->u_action . '&amp;action=details&amp;id=' . $lang_id . '&amp;language_file=' . urlencode($selected_lang_file)), E_USER_WARNING);
- }
-
- $transfer->close_session();
-
- // Remove from storage folder
- if (file_exists($phpbb_root_path . 'store/' . $lang_path . $file))
- {
- @unlink($phpbb_root_path . 'store/' . $lang_path . $file);
- }
-
- add_log('admin', 'LOG_LANGUAGE_FILE_REPLACED', $file);
-
- trigger_error($user->lang['UPLOAD_COMPLETED'] . adm_back_link($this->u_action . '&amp;action=details&amp;id=' . $lang_id . '&amp;language_file=' . urlencode($selected_lang_file)));
- }
-
- add_log('admin', 'LOG_LANGUAGE_FILE_SUBMITTED', $this->language_file);
- $action = 'details';
-
- // no break;
-
case 'details':
if (!$lang_id)
@@ -443,308 +114,82 @@ class acp_language
$lang_entries = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
- $lang_iso = $lang_entries['lang_iso'];
- $missing_vars = $missing_files = array();
-
- // Get email templates
- $email_files = filelist($phpbb_root_path . 'language/' . $config['default_lang'], 'email', 'txt');
- $email_files = $email_files['email/'];
-
- // Get acp files
- $acp_files = filelist($phpbb_root_path . 'language/' . $config['default_lang'], 'acp', $phpEx);
- $acp_files = $acp_files['acp/'];
-
- // Get mod files
- $mods_files = filelist($phpbb_root_path . 'language/' . $config['default_lang'], 'mods', $phpEx);
- $mods_files = (isset($mods_files['mods/'])) ? $mods_files['mods/'] : array();
-
- // Check if our current filename matches the files
- switch ($this->language_directory)
- {
- case 'email':
- if (!in_array($this->language_file, $email_files))
- {
- trigger_error($user->lang['WRONG_LANGUAGE_FILE'] . adm_back_link($this->u_action . '&amp;action=details&amp;id=' . $lang_id), E_USER_WARNING);
- }
- break;
-
- case 'acp':
- if (!in_array($this->language_file, $acp_files))
- {
- trigger_error($user->lang['WRONG_LANGUAGE_FILE'] . adm_back_link($this->u_action . '&amp;action=details&amp;id=' . $lang_id), E_USER_WARNING);
- }
- break;
-
- case 'mods':
- if (!in_array($this->language_file, $mods_files))
- {
- trigger_error($user->lang['WRONG_LANGUAGE_FILE'] . adm_back_link($this->u_action . '&amp;action=details&amp;id=' . $lang_id), E_USER_WARNING);
- }
- break;
-
- default:
- if (!in_array($this->language_file, $this->main_files))
- {
- trigger_error($user->lang['WRONG_LANGUAGE_FILE'] . adm_back_link($this->u_action . '&amp;action=details&amp;id=' . $lang_id), E_USER_WARNING);
- }
- }
-
- if (isset($_POST['remove_store']))
+ if (!$lang_entries)
{
- $store_filename = $this->get_filename($lang_iso, $this->language_directory, $this->language_file, true, true);
-
- if (file_exists($phpbb_root_path . $store_filename))
- {
- @unlink($phpbb_root_path . $store_filename);
- }
+ trigger_error($user->lang['LANGUAGE_PACK_NOT_EXIST'] . adm_back_link($this->u_action), E_USER_WARNING);
}
- include_once($phpbb_root_path . 'includes/functions_transfer.' . $phpEx);
-
- $methods = transfer::methods();
-
- foreach ($methods as $method)
- {
- $template->assign_block_vars('buttons', array(
- 'VALUE' => $method
- ));
- }
+ $lang_iso = $lang_entries['lang_iso'];
$template->assign_vars(array(
'S_DETAILS' => true,
'U_ACTION' => $this->u_action . "&amp;action=details&amp;id=$lang_id",
'U_BACK' => $this->u_action,
+
'LANG_LOCAL_NAME' => $lang_entries['lang_local_name'],
'LANG_ENGLISH_NAME' => $lang_entries['lang_english_name'],
- 'LANG_ISO' => $lang_entries['lang_iso'],
+ 'LANG_ISO' => $lang_iso,
'LANG_AUTHOR' => $lang_entries['lang_author'],
- 'ALLOW_UPLOAD' => sizeof($methods)
- )
- );
+ 'L_MISSING_FILES' => $user->lang('THOSE_MISSING_LANG_FILES', $lang_entries['lang_local_name']),
+ 'L_MISSING_VARS_EXPLAIN' => $user->lang('THOSE_MISSING_LANG_VARIABLES', $lang_entries['lang_local_name']),
+ ));
- // If current lang is different from the default lang, then first try to grab missing/additional vars
+ // If current lang is different from the default lang, then highlight missing files and variables
if ($lang_iso != $config['default_lang'])
{
- $is_missing_var = false;
-
- foreach ($this->main_files as $file)
+ try
{
- if (file_exists($phpbb_root_path . $this->get_filename($lang_iso, '', $file)))
- {
- $missing_vars[$file] = $this->compare_language_files($config['default_lang'], $lang_iso, '', $file);
-
- if (sizeof($missing_vars[$file]))
- {
- $is_missing_var = true;
- }
- }
- else
- {
- $missing_files[] = $this->get_filename($lang_iso, '', $file);
- }
+ $iterator = new \RecursiveIteratorIterator(
+ new \phpbb\recursive_dot_prefix_filter_iterator(
+ new \RecursiveDirectoryIterator(
+ $phpbb_root_path . 'language/' . $config['default_lang'] . '/',
+ \FilesystemIterator::SKIP_DOTS
+ )
+ ),
+ \RecursiveIteratorIterator::LEAVES_ONLY
+ );
}
-
- // Now go through acp/mods directories
- foreach ($acp_files as $file)
+ catch (\Exception $e)
{
- if (file_exists($phpbb_root_path . $this->get_filename($lang_iso, 'acp', $file)))
- {
- $missing_vars['acp/' . $file] = $this->compare_language_files($config['default_lang'], $lang_iso, 'acp', $file);
-
- if (sizeof($missing_vars['acp/' . $file]))
- {
- $is_missing_var = true;
- }
- }
- else
- {
- $missing_files[] = $this->get_filename($lang_iso, 'acp', $file);
- }
+ return array();
}
- if (sizeof($mods_files))
+ foreach ($iterator as $file_info)
{
- foreach ($mods_files as $file)
+ /** @var \RecursiveDirectoryIterator $file_info */
+ $relative_path = $iterator->getInnerIterator()->getSubPathname();
+ $relative_path = str_replace(DIRECTORY_SEPARATOR, '/', $relative_path);
+
+ if (file_exists($phpbb_root_path . 'language/' . $lang_iso . '/' . $relative_path))
{
- if (file_exists($phpbb_root_path . $this->get_filename($lang_iso, 'mods', $file)))
+ if (substr($relative_path, 0 - strlen($phpEx)) === $phpEx)
{
- $missing_vars['mods/' . $file] = $this->compare_language_files($config['default_lang'], $lang_iso, 'mods', $file);
+ $missing_vars = $this->compare_language_files($config['default_lang'], $lang_iso, $relative_path);
- if (sizeof($missing_vars['mods/' . $file]))
+ if (!empty($missing_vars))
{
- $is_missing_var = true;
+ $template->assign_block_vars('missing_varfile', array(
+ 'FILE_NAME' => $relative_path,
+ ));
+
+ foreach ($missing_vars as $var)
+ {
+ $template->assign_block_vars('missing_varfile.variable', array(
+ 'VAR_NAME' => $var,
+ ));
+ }
}
}
- else
- {
- $missing_files[] = $this->get_filename($lang_iso, 'mods', $file);
- }
- }
- }
-
- // More missing files... for example email templates?
- foreach ($email_files as $file)
- {
- if (!file_exists($phpbb_root_path . $this->get_filename($lang_iso, 'email', $file)))
- {
- $missing_files[] = $this->get_filename($lang_iso, 'email', $file);
}
- }
-
- if (sizeof($missing_files))
- {
- $template->assign_vars(array(
- 'S_MISSING_FILES' => true,
- 'L_MISSING_FILES' => sprintf($user->lang['THOSE_MISSING_LANG_FILES'], $lang_entries['lang_local_name']),
- 'MISSING_FILES' => implode('<br />', $missing_files))
- );
- }
-
- if ($is_missing_var)
- {
- $template->assign_vars(array(
- 'S_MISSING_VARS' => true,
- 'L_MISSING_VARS_EXPLAIN' => sprintf($user->lang['THOSE_MISSING_LANG_VARIABLES'], $lang_entries['lang_local_name']),
- 'U_MISSING_ACTION' => $this->u_action . "&amp;action=$action&amp;id=$lang_id")
- );
-
- foreach ($missing_vars as $file => $vars)
- {
- if (!sizeof($vars))
- {
- continue;
- }
-
- $template->assign_block_vars('missing', array(
- 'FILE' => $file,
- 'TPL' => $this->print_language_entries($vars, '', false),
- 'KEY' => (strpos($file, '/') === false) ? '|' . $file : str_replace('/', '|', $file))
- );
- }
- }
- }
-
- // Main language files
- $s_lang_options = '<option value="|common.' . $phpEx . '" class="sep">' . $user->lang['LANGUAGE_FILES'] . '</option>';
- foreach ($this->main_files as $file)
- {
- if (strpos($file, 'help_') === 0)
- {
- continue;
- }
-
- $prefix = (file_exists($phpbb_root_path . $this->get_filename($lang_iso, '', $file, true, true))) ? '* ' : '';
-
- $selected = (!$this->language_directory && $this->language_file == $file) ? ' selected="selected"' : '';
- $s_lang_options .= '<option value="|' . $file . '"' . $selected . '>' . $prefix . $file . '</option>';
- }
-
- // Help Files
- $s_lang_options .= '<option value="|common.' . $phpEx . '" class="sep">' . $user->lang['HELP_FILES'] . '</option>';
- foreach ($this->main_files as $file)
- {
- if (strpos($file, 'help_') !== 0)
- {
- continue;
- }
-
- $prefix = (file_exists($phpbb_root_path . $this->get_filename($lang_iso, '', $file, true, true))) ? '* ' : '';
-
- $selected = (!$this->language_directory && $this->language_file == $file) ? ' selected="selected"' : '';
- $s_lang_options .= '<option value="|' . $file . '"' . $selected . '>' . $prefix . $file . '</option>';
- }
-
- // Now every other language directory
- $check_files = array('email', 'acp', 'mods');
-
- foreach ($check_files as $check)
- {
- if (!sizeof(${$check . '_files'}))
- {
- continue;
- }
-
- $s_lang_options .= '<option value="|common.' . $phpEx . '" class="sep">' . $user->lang[strtoupper($check) . '_FILES'] . '</option>';
-
- foreach (${$check . '_files'} as $file)
- {
- $prefix = (file_exists($phpbb_root_path . $this->get_filename($lang_iso, $check, $file, true, true))) ? '* ' : '';
-
- $selected = ($this->language_directory == $check && $this->language_file == $file) ? ' selected="selected"' : '';
- $s_lang_options .= '<option value="' . $check . '|' . $file . '"' . $selected . '>' . $prefix . $file . '</option>';
- }
- }
-
- // Get Language Entries - if saved within store folder, we take this one (with the option to remove it)
- $lang = array();
-
- $is_email_file = ($this->language_directory == 'email') ? true : false;
- $is_help_file = (strpos($this->language_file, 'help_') === 0) ? true : false;
-
- $file_from_store = (file_exists($phpbb_root_path . $this->get_filename($lang_iso, $this->language_directory, $this->language_file, true, true))) ? true : false;
- $no_store_filename = $this->get_filename($lang_iso, $this->language_directory, $this->language_file);
-
- if (!$file_from_store && !file_exists($phpbb_root_path . $no_store_filename))
- {
- $print_message = sprintf($user->lang['MISSING_LANGUAGE_FILE'], $no_store_filename);
- }
- else
- {
- if ($is_email_file)
- {
- $lang = file_get_contents($phpbb_root_path . $this->get_filename($lang_iso, $this->language_directory, $this->language_file, $file_from_store));
- }
- else
- {
- $help = array();
- include($phpbb_root_path . $this->get_filename($lang_iso, $this->language_directory, $this->language_file, $file_from_store));
-
- if ($is_help_file)
+ else
{
- $lang = $help;
- unset($help);
+ $template->assign_block_vars('missing_files', array(
+ 'FILE_NAME' => $relative_path,
+ ));
}
}
-
- $print_message = (($this->language_directory) ? $this->language_directory . '/' : '') . $this->language_file;
- }
-
- // Normal language pack entries
- $template->assign_vars(array(
- 'U_ENTRY_ACTION' => $this->u_action . "&amp;action=details&amp;id=$lang_id#entries",
- 'S_EMAIL_FILE' => $is_email_file,
- 'S_FROM_STORE' => $file_from_store,
- 'S_LANG_OPTIONS' => $s_lang_options,
- 'PRINT_MESSAGE' => $print_message,
- )
- );
-
- if (!$is_email_file)
- {
- $tpl = '';
- $name = (($this->language_directory) ? $this->language_directory . '/' : '') . $this->language_file;
-
- if (isset($missing_vars[$name]) && sizeof($missing_vars[$name]))
- {
- $tpl .= $this->print_language_entries($missing_vars[$name], '* ');
- }
-
- $tpl .= $this->print_language_entries($lang);
-
- $template->assign_var('TPL', $tpl);
- unset($tpl);
- }
- else
- {
- $template->assign_vars(array(
- 'LANG' => $lang)
- );
-
- unset($lang);
}
-
return;
-
break;
case 'delete':
@@ -782,11 +227,6 @@ class acp_language
$sql = 'DELETE FROM ' . PROFILE_FIELDS_LANG_TABLE . ' WHERE lang_id = ' . $lang_id;
$db->sql_query($sql);
- $sql = 'DELETE FROM ' . STYLES_IMAGESET_DATA_TABLE . " WHERE image_lang = '" . $db->sql_escape($row['lang_iso']) . "'";
- $result = $db->sql_query($sql);
-
- $cache->destroy('sql', STYLES_IMAGESET_DATA_TABLE);
-
add_log('admin', 'LOG_LANGUAGE_PACK_DELETED', $row['lang_english_name']);
trigger_error(sprintf($user->lang['LANGUAGE_PACK_DELETED'], $row['lang_english_name']) . adm_back_link($this->u_action));
@@ -799,11 +239,16 @@ class acp_language
'action' => $action,
'id' => $lang_id,
);
- confirm_box(false, $user->lang['CONFIRM_OPERATION'], build_hidden_fields($s_hidden_fields));
+ confirm_box(false, $user->lang('DELETE_LANGUAGE_CONFIRM', $row['lang_english_name']), build_hidden_fields($s_hidden_fields));
}
break;
case 'install':
+ if (!check_link_hash($request->variable('hash', ''), 'acp_language'))
+ {
+ trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING);
+ }
+
$lang_iso = request_var('iso', '');
$lang_iso = basename($lang_iso);
@@ -851,66 +296,6 @@ class acp_language
$db->sql_query('INSERT INTO ' . LANG_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary));
$lang_id = $db->sql_nextid();
- $valid_localized = array(
- 'icon_back_top', 'icon_contact_aim', 'icon_contact_email', 'icon_contact_icq', 'icon_contact_jabber', 'icon_contact_msnm', 'icon_contact_pm', 'icon_contact_yahoo', 'icon_contact_www', 'icon_post_delete', 'icon_post_edit', 'icon_post_info', 'icon_post_quote', 'icon_post_report', 'icon_user_online', 'icon_user_offline', 'icon_user_profile', 'icon_user_search', 'icon_user_warn', 'button_pm_forward', 'button_pm_new', 'button_pm_reply', 'button_topic_locked', 'button_topic_new', 'button_topic_reply',
- );
-
- $sql_ary = array();
-
- $sql = 'SELECT *
- FROM ' . STYLES_IMAGESET_TABLE;
- $result = $db->sql_query($sql);
- while ($imageset_row = $db->sql_fetchrow($result))
- {
- if (@file_exists("{$phpbb_root_path}styles/{$imageset_row['imageset_path']}/imageset/{$lang_pack['iso']}/imageset.cfg"))
- {
- $cfg_data_imageset_data = parse_cfg_file("{$phpbb_root_path}styles/{$imageset_row['imageset_path']}/imageset/{$lang_pack['iso']}/imageset.cfg");
- foreach ($cfg_data_imageset_data as $image_name => $value)
- {
- if (strpos($value, '*') !== false)
- {
- if (substr($value, -1, 1) === '*')
- {
- list($image_filename, $image_height) = explode('*', $value);
- $image_width = 0;
- }
- else
- {
- list($image_filename, $image_height, $image_width) = explode('*', $value);
- }
- }
- else
- {
- $image_filename = $value;
- $image_height = $image_width = 0;
- }
-
- if (strpos($image_name, 'img_') === 0 && $image_filename)
- {
- $image_name = substr($image_name, 4);
- if (in_array($image_name, $valid_localized))
- {
- $sql_ary[] = array(
- 'image_name' => (string) $image_name,
- 'image_filename' => (string) $image_filename,
- 'image_height' => (int) $image_height,
- 'image_width' => (int) $image_width,
- 'imageset_id' => (int) $imageset_row['imageset_id'],
- 'image_lang' => (string) $lang_pack['iso'],
- );
- }
- }
- }
- }
- }
- $db->sql_freeresult($result);
-
- if (sizeof($sql_ary))
- {
- $db->sql_multi_insert(STYLES_IMAGESET_DATA_TABLE, $sql_ary);
- $cache->destroy('sql', STYLES_IMAGESET_DATA_TABLE);
- }
-
// Now let's copy the default language entries for custom profile fields for this new language - makes admin's life easier.
$sql = 'SELECT lang_id
FROM ' . LANG_TABLE . "
@@ -959,127 +344,6 @@ class acp_language
trigger_error($message . adm_back_link($this->u_action));
break;
-
- case 'download':
-
- if (!$lang_id)
- {
- trigger_error($user->lang['NO_LANG_ID'] . adm_back_link($this->u_action), E_USER_WARNING);
- }
-
- $sql = 'SELECT *
- FROM ' . LANG_TABLE . '
- WHERE lang_id = ' . $lang_id;
- $result = $db->sql_query($sql);
- $row = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
-
- $use_method = request_var('use_method', '');
- $methods = array('.tar');
-
- $available_methods = array('.tar.gz' => 'zlib', '.tar.bz2' => 'bz2', '.zip' => 'zlib');
- foreach ($available_methods as $type => $module)
- {
- if (!@extension_loaded($module))
- {
- continue;
- }
-
- $methods[] = $type;
- }
-
- // Let the user decide in which format he wants to have the pack
- if (!$use_method)
- {
- $this->page_title = 'SELECT_DOWNLOAD_FORMAT';
-
- $radio_buttons = '';
- foreach ($methods as $method)
- {
- $radio_buttons .= '<label><input type="radio"' . ((!$radio_buttons) ? ' id="use_method"' : '') . ' class="radio" value="' . $method . '" name="use_method" /> ' . $method . '</label>';
- }
-
- $template->assign_vars(array(
- 'S_SELECT_METHOD' => true,
- 'U_BACK' => $this->u_action,
- 'U_ACTION' => $this->u_action . "&amp;action=$action&amp;id=$lang_id",
- 'RADIO_BUTTONS' => $radio_buttons)
- );
-
- return;
- }
-
- if (!in_array($use_method, $methods))
- {
- $use_method = '.tar';
- }
-
- include_once($phpbb_root_path . 'includes/functions_compress.' . $phpEx);
-
- if ($use_method == '.zip')
- {
- $compress = new compress_zip('w', $phpbb_root_path . 'store/lang_' . $row['lang_iso'] . $use_method);
- }
- else
- {
- $compress = new compress_tar('w', $phpbb_root_path . 'store/lang_' . $row['lang_iso'] . $use_method, $use_method);
- }
-
- // Get email templates
- $email_templates = filelist($phpbb_root_path . 'language/' . $row['lang_iso'], 'email', 'txt');
- $email_templates = $email_templates['email/'];
-
- // Get acp files
- $acp_files = filelist($phpbb_root_path . 'language/' . $row['lang_iso'], 'acp', $phpEx);
- $acp_files = $acp_files['acp/'];
-
- // Get mod files
- $mod_files = filelist($phpbb_root_path . 'language/' . $row['lang_iso'], 'mods', $phpEx);
- $mod_files = (isset($mod_files['mods/'])) ? $mod_files['mods/'] : array();
-
- // Add main files
- $this->add_to_archive($compress, $this->main_files, $row['lang_iso']);
-
- // Add search files if they exist...
- if (file_exists($phpbb_root_path . 'language/' . $row['lang_iso'] . '/search_ignore_words.' . $phpEx))
- {
- $this->add_to_archive($compress, array("search_ignore_words.$phpEx"), $row['lang_iso']);
- }
-
- if (file_exists($phpbb_root_path . 'language/' . $row['lang_iso'] . '/search_synonyms.' . $phpEx))
- {
- $this->add_to_archive($compress, array("search_synonyms.$phpEx"), $row['lang_iso']);
- }
-
- // Write files in folders
- $this->add_to_archive($compress, $email_templates, $row['lang_iso'], 'email');
- $this->add_to_archive($compress, $acp_files, $row['lang_iso'], 'acp');
- $this->add_to_archive($compress, $mod_files, $row['lang_iso'], 'mods');
-
- // Write ISO File
- $iso_src = htmlspecialchars_decode($row['lang_english_name']) . "\n";
- $iso_src .= htmlspecialchars_decode($row['lang_local_name']) . "\n";
- $iso_src .= htmlspecialchars_decode($row['lang_author']);
- $compress->add_data($iso_src, 'language/' . $row['lang_iso'] . '/iso.txt');
-
- // index.htm files
- $compress->add_data('', 'language/' . $row['lang_iso'] . '/index.htm');
- $compress->add_data('', 'language/' . $row['lang_iso'] . '/email/index.htm');
- $compress->add_data('', 'language/' . $row['lang_iso'] . '/acp/index.htm');
-
- if (sizeof($mod_files))
- {
- $compress->add_data('', 'language/' . $row['lang_iso'] . '/mods/index.htm');
- }
-
- $compress->close();
-
- $compress->download('lang_' . $row['lang_iso']);
- @unlink($phpbb_root_path . 'store/lang_' . $row['lang_iso'] . $use_method);
-
- exit;
-
- break;
}
$sql = 'SELECT user_lang, COUNT(user_lang) AS lang_count
@@ -1164,7 +428,7 @@ class acp_language
'ISO' => htmlspecialchars($lang_ary['iso']),
'LOCAL_NAME' => htmlspecialchars($lang_ary['local_name'], ENT_COMPAT, 'UTF-8'),
'NAME' => htmlspecialchars($lang_ary['name'], ENT_COMPAT, 'UTF-8'),
- 'U_INSTALL' => $this->u_action . '&amp;action=install&amp;iso=' . urlencode($lang_ary['iso']))
+ 'U_INSTALL' => $this->u_action . '&amp;action=install&amp;iso=' . urlencode($lang_ary['iso']) . '&amp;hash=' . generate_link_hash('acp_language'))
);
}
}
@@ -1172,294 +436,31 @@ class acp_language
unset($new_ary);
}
-
- /**
- * Set default language variables/header
- */
- function default_variables()
- {
- global $phpEx;
-
- $this->language_file_header = '<?php
-/**
-*
-* {FILENAME} [{LANG_NAME}]
-*
-* @package language
-* @version $' . 'Id: ' . '$
-* @copyright (c) ' . date('Y') . ' phpBB Group
-* @author {CHANGED} - {AUTHOR}
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
-*
-*/
-
-/**
-* DO NOT CHANGE
-*/
-if (!defined(\'IN_PHPBB\'))
-{
- exit;
-}
-
-if (empty($lang) || !is_array($lang))
-{
- $lang = array();
-}
-
-// DEVELOPERS PLEASE NOTE
-//
-// All language files should use UTF-8 as their encoding and the files must not contain a BOM.
-//
-// Placeholders can now contain order information, e.g. instead of
-// \'Page %s of %s\' you can (and should) write \'Page %1$s of %2$s\', this allows
-// translators to re-order the output of data while ensuring it remains correct
-//
-// You do not need this where single placeholders are used, e.g. \'Message %d\' is fine
-// equally where a string contains only two placeholders which are used to wrap text
-// in a url you again do not need to specify an order e.g., \'Click %sHERE%s\' is fine
-';
-
- $this->lang_header = '
-$lang = array_merge($lang, array(
-';
-
- // Language files in language root directory
- $this->main_files = array("captcha_qa.$phpEx", "captcha_recaptcha.$phpEx", "common.$phpEx", "groups.$phpEx", "install.$phpEx", "mcp.$phpEx", "memberlist.$phpEx", "posting.$phpEx", "search.$phpEx", "ucp.$phpEx", "viewforum.$phpEx", "viewtopic.$phpEx", "help_bbcode.$phpEx", "help_faq.$phpEx");
- }
-
- /**
- * Get filename/location of language file
- */
- function get_filename($lang_iso, $directory, $filename, $check_store = false, $only_return_filename = false)
- {
- global $phpbb_root_path, $safe_mode;
-
- $check_filename = "language/$lang_iso/" . (($directory) ? $directory . '/' : '') . $filename;
-
- if ($check_store)
- {
- $check_store_filename = ($safe_mode) ? "store/langfile_{$lang_iso}" . (($directory) ? '_' . $directory : '') . "_{$filename}" : "store/language/$lang_iso/" . (($directory) ? $directory . '/' : '') . $filename;
-
- if (!$only_return_filename && file_exists($phpbb_root_path . $check_store_filename))
- {
- return $check_store_filename;
- }
- else if ($only_return_filename)
- {
- return $check_store_filename;
- }
- }
-
- return $check_filename;
- }
-
/**
- * Add files to archive
+ * Compare two language files
*/
- function add_to_archive(&$compress, $filelist, $lang_iso, $directory = '')
+ function compare_language_files($source_lang, $dest_lang, $file)
{
global $phpbb_root_path;
- foreach ($filelist as $file)
- {
- // Get source filename
- $source = $this->get_filename($lang_iso, $directory, $file, true);
- $destination = 'language/' . $lang_iso . '/' . (($directory) ? $directory . '/' : '') . $file;
-
- // Add file to archive
- $compress->add_custom_file($phpbb_root_path . $source, $destination);
- }
- }
-
- /**
- * Little helper to add some hardcoded template bits
- */
- function add_input_field()
- {
- $keys = func_get_args();
-
- $non_static = array_shift($keys);
- $value = utf8_normalize_nfc(array_shift($keys));
-
- if (!$non_static)
- {
- return '<strong>' . htmlspecialchars($value, ENT_COMPAT, 'UTF-8') . '</strong>';
- }
-
- // If more then 270 characters, then we present a textarea, else an input field
- $textarea = (utf8_strlen($value) > 270) ? true : false;
- $tpl = '';
-
- $tpl .= ($textarea) ? '<textarea name="' : '<input type="text" name="';
- $tpl .= 'entry[' . implode('][', array_map('utf8_htmlspecialchars', $keys)) . ']"';
-
- $tpl .= ($textarea) ? ' cols="80" rows="5" class="langvalue">' : ' class="langvalue" value="';
- $tpl .= htmlspecialchars($value, ENT_COMPAT, 'UTF-8');
- $tpl .= ($textarea) ? '</textarea>' : '" />';
-
- return $tpl;
- }
-
- /**
- * Print language entries
- */
- function print_language_entries(&$lang_ary, $key_prefix = '', $input_field = true)
- {
- $tpl = '';
+ $source_file = $phpbb_root_path . 'language/' . $source_lang . '/' . $file;
+ $dest_file = $phpbb_root_path . 'language/' . $dest_lang . '/' . $file;
- foreach ($lang_ary as $key => $value)
+ if (!file_exists($dest_file))
{
- if (is_array($value))
- {
- // Write key
- $tpl .= '
- <tr>
- <td class="row3" colspan="2">' . htmlspecialchars($key_prefix, ENT_COMPAT, 'UTF-8') . '<strong>' . htmlspecialchars($key, ENT_COMPAT, 'UTF-8') . '</strong></td>
- </tr>';
-
- foreach ($value as $_key => $_value)
- {
- if (is_array($_value))
- {
- // Write key
- $tpl .= '
- <tr>
- <td class="row3" colspan="2">' . htmlspecialchars($key_prefix, ENT_COMPAT, 'UTF-8') . '&nbsp; &nbsp;<strong>' . htmlspecialchars($_key, ENT_COMPAT, 'UTF-8') . '</strong></td>
- </tr>';
-
- foreach ($_value as $__key => $__value)
- {
- // Write key
- $tpl .= '
- <tr>
- <td class="row1" style="white-space: nowrap;">' . htmlspecialchars($key_prefix, ENT_COMPAT, 'UTF-8') . '<strong>' . htmlspecialchars($__key, ENT_COMPAT, 'UTF-8') . '</strong></td>
- <td class="row2">';
-
- $tpl .= $this->add_input_field($input_field, $__value, $key, $_key, $__key);
-
- $tpl .= '</td>
- </tr>';
- }
- }
- else
- {
- // Write key
- $tpl .= '
- <tr>
- <td class="row1" style="white-space: nowrap;">' . htmlspecialchars($key_prefix, ENT_COMPAT, 'UTF-8') . '<strong>' . htmlspecialchars($_key, ENT_COMPAT, 'UTF-8') . '</strong></td>
- <td class="row2">';
-
- $tpl .= $this->add_input_field($input_field, $_value, $key, $_key);
-
- $tpl .= '</td>
- </tr>';
- }
- }
-
- $tpl .= '
- <tr>
- <td class="spacer" colspan="2">&nbsp;</td>
- </tr>';
- }
- else
- {
- // Write key
- $tpl .= '
- <tr>
- <td class="row1" style="white-space: nowrap;">' . htmlspecialchars($key_prefix, ENT_COMPAT, 'UTF-8') . '<strong>' . htmlspecialchars($key, ENT_COMPAT, 'UTF-8') . '</strong></td>
- <td class="row2">';
-
- $tpl .= $this->add_input_field($input_field, $value, $key);
-
- $tpl .= '</td>
- </tr>';
- }
+ return array();
}
- return $tpl;
- }
-
- /**
- * Compare two language files
- */
- function compare_language_files($source_lang, $dest_lang, $directory, $file)
- {
- global $phpbb_root_path, $phpEx;
-
- $return_ary = array();
-
$lang = array();
- include("{$phpbb_root_path}language/{$source_lang}/" . (($directory) ? $directory . '/' : '') . $file);
+ include($source_file);
$lang_entry_src = $lang;
$lang = array();
-
- if (!file_exists($phpbb_root_path . $this->get_filename($dest_lang, $directory, $file, true)))
- {
- return array();
- }
-
- include($phpbb_root_path . $this->get_filename($dest_lang, $directory, $file, true));
-
+ include($dest_file);
$lang_entry_dst = $lang;
unset($lang);
- $diff_array_keys = array_diff(array_keys($lang_entry_src), array_keys($lang_entry_dst));
- unset($lang_entry_dst);
-
- foreach ($diff_array_keys as $key)
- {
- $return_ary[$key] = $lang_entry_src[$key];
- }
-
- unset($lang_entry_src);
-
- return $return_ary;
- }
-
- /**
- * Return language string value for storage
- */
- function prepare_lang_entry($text, $store = true)
- {
- $text = (STRIP) ? stripslashes($text) : $text;
-
- // Adjust for storage...
- if ($store)
- {
- $text = str_replace("'", "\\'", str_replace('\\', '\\\\', $text));
- }
-
- return $text;
- }
-
- /**
- * Format language array for storage
- */
- function format_lang_array($key, $value, $tabs = "\t")
- {
- $entry = '';
-
- if (!is_array($value))
- {
- $entry .= "{$tabs}'" . $this->prepare_lang_entry($key) . "'\t=> '" . $this->prepare_lang_entry($value) . "',\n";
- }
- else
- {
- $_tabs = $tabs . "\t";
- $entry .= "\n{$tabs}'" . $this->prepare_lang_entry($key) . "'\t=> array(\n";
-
- foreach ($value as $_key => $_value)
- {
- $entry .= $this->format_lang_array($_key, $_value, $_tabs);
- }
-
- $entry .= "{$tabs}),\n\n";
- }
-
- return $entry;
+ return array_diff(array_keys($lang_entry_src), array_keys($lang_entry_dst));
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/acp/acp_logs.php b/phpBB/includes/acp/acp_logs.php
index 2fc86e325f..80dee1d620 100644
--- a/phpBB/includes/acp/acp_logs.php
+++ b/phpBB/includes/acp/acp_logs.php
@@ -1,10 +1,13 @@
<?php
/**
*
-* @package acp
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -16,17 +19,15 @@ if (!defined('IN_PHPBB'))
exit;
}
-/**
-* @package acp
-*/
class acp_logs
{
var $u_action;
function main($id, $mode)
{
- global $db, $user, $auth, $template, $cache;
+ global $db, $user, $auth, $template, $cache, $phpbb_container;
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
+ global $request;
$user->add_lang('mcp');
@@ -35,8 +36,8 @@ class acp_logs
$forum_id = request_var('f', 0);
$topic_id = request_var('t', 0);
$start = request_var('start', 0);
- $deletemark = (!empty($_POST['delmarked'])) ? true : false;
- $deleteall = (!empty($_POST['delall'])) ? true : false;
+ $deletemark = $request->variable('delmarked', false, false, \phpbb\request\request_interface::POST);
+ $deleteall = $request->variable('delall', false, false, \phpbb\request\request_interface::POST);
$marked = request_var('mark', array(0));
// Sort keys
@@ -46,34 +47,33 @@ class acp_logs
$this->tpl_name = 'acp_logs';
$this->log_type = constant('LOG_' . strtoupper($mode));
+ $pagination = $phpbb_container->get('pagination');
// Delete entries if requested and able
if (($deletemark || $deleteall) && $auth->acl_get('a_clearlogs'))
{
if (confirm_box(true))
{
- $where_sql = '';
+ $conditions = array();
if ($deletemark && sizeof($marked))
{
- $sql_in = array();
- foreach ($marked as $mark)
- {
- $sql_in[] = $mark;
- }
- $where_sql = ' AND ' . $db->sql_in_set('log_id', $sql_in);
- unset($sql_in);
+ $conditions['log_id'] = array('IN' => $marked);
}
- if ($where_sql || $deleteall)
+ if ($deleteall)
{
- $sql = 'DELETE FROM ' . LOG_TABLE . "
- WHERE log_type = {$this->log_type}
- $where_sql";
- $db->sql_query($sql);
+ if ($sort_days)
+ {
+ $conditions['log_time'] = array('>=', time() - ($sort_days * 86400));
+ }
- add_log('admin', 'LOG_CLEAR_' . strtoupper($mode));
+ $keywords = utf8_normalize_nfc(request_var('keywords', '', true));
+ $conditions['keywords'] = $keywords;
}
+
+ $phpbb_log = $phpbb_container->get('log');
+ $phpbb_log->delete($mode, $conditions);
}
else
{
@@ -117,7 +117,7 @@ class acp_logs
if ($mode == 'mod')
{
$forum_box = '<option value="0">' . $user->lang['ALL_FORUMS'] . '</option>' . make_forum_select($forum_id);
-
+
$template->assign_vars(array(
'S_SHOW_FORUMS' => true,
'S_FORUM_BOX' => $forum_box)
@@ -129,14 +129,14 @@ class acp_logs
$log_count = 0;
$start = view_log($mode, $log_data, $log_count, $config['topics_per_page'], $start, $forum_id, 0, 0, $sql_where, $sql_sort, $keywords);
+ $base_url = $this->u_action . "&amp;$u_sort_param$keywords_param";
+ $pagination->generate_template_pagination($base_url, 'pagination', 'start', $log_count, $config['topics_per_page'], $start);
+
$template->assign_vars(array(
'L_TITLE' => $l_title,
'L_EXPLAIN' => $l_title_explain,
'U_ACTION' => $this->u_action . "&amp;$u_sort_param$keywords_param&amp;start=$start",
- 'S_ON_PAGE' => on_page($log_count, $config['topics_per_page'], $start),
- 'PAGINATION' => generate_pagination($this->u_action . "&amp;$u_sort_param$keywords_param", $log_count, $config['topics_per_page'], $start, true),
-
'S_LIMIT_DAYS' => $s_limit_days,
'S_SORT_KEY' => $s_sort_key,
'S_SORT_DIR' => $s_sort_dir,
@@ -148,7 +148,7 @@ class acp_logs
foreach ($log_data as $row)
{
$data = array();
-
+
$checks = array('viewtopic', 'viewlogs', 'viewforum');
foreach ($checks as $check)
{
@@ -172,5 +172,3 @@ class acp_logs
}
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/acp/acp_main.php b/phpBB/includes/acp/acp_main.php
index 79557bb5fd..6e7bd91a86 100644
--- a/phpBB/includes/acp/acp_main.php
+++ b/phpBB/includes/acp/acp_main.php
@@ -1,10 +1,13 @@
<?php
/**
*
-* @package acp
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -16,17 +19,14 @@ if (!defined('IN_PHPBB'))
exit;
}
-/**
-* @package acp
-*/
class acp_main
{
var $u_action;
function main($id, $mode)
{
- global $config, $db, $user, $auth, $template;
- global $phpbb_root_path, $phpbb_admin_path, $phpEx;
+ global $config, $db, $cache, $user, $auth, $template, $request;
+ global $phpbb_root_path, $phpbb_admin_path, $phpEx, $phpbb_container, $phpbb_dispatcher;
// Show restore permissions notice
if ($user->data['user_perm_from'] && $auth->acl_get('a_switchperm'))
@@ -41,11 +41,7 @@ class acp_main
$user_row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
- $perm_from = '<strong' . (($user_row['user_colour']) ? ' style="color: #' . $user_row['user_colour'] . '">' : '>');
- $perm_from .= ($user_row['user_id'] != ANONYMOUS) ? '<a href="' . append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&amp;u=' . $user_row['user_id']) . '">' : '';
- $perm_from .= $user_row['username'];
- $perm_from .= ($user_row['user_id'] != ANONYMOUS) ? '</a>' : '';
- $perm_from .= '</strong>';
+ $perm_from = get_username_string('full', $user_row['user_id'], $user_row['username'], $user_row['user_colour']);
$template->assign_vars(array(
'S_RESTORE_PERMISSIONS' => true,
@@ -64,9 +60,7 @@ class acp_main
if ($action === 'admlogout')
{
$user->unset_admin();
- $redirect_url = append_sid("{$phpbb_root_path}index.$phpEx");
- meta_refresh(3, $redirect_url);
- trigger_error($user->lang['ADM_LOGGED_OUT'] . '<br /><br />' . sprintf($user->lang['RETURN_INDEX'], '<a href="' . $redirect_url . '">', '</a>'));
+ redirect(append_sid("{$phpbb_root_path}index.$phpEx"));
}
if (!confirm_box(true))
@@ -130,6 +124,11 @@ class acp_main
set_config('record_online_users', 1, true);
set_config('record_online_date', time(), true);
add_log('admin', 'LOG_RESET_ONLINE');
+
+ if ($request->is_ajax())
+ {
+ trigger_error('RESET_ONLINE_SUCCESS');
+ }
break;
case 'stats':
@@ -140,14 +139,14 @@ class acp_main
$sql = 'SELECT COUNT(post_id) AS stat
FROM ' . POSTS_TABLE . '
- WHERE post_approved = 1';
+ WHERE post_visibility = ' . ITEM_APPROVED;
$result = $db->sql_query($sql);
set_config('num_posts', (int) $db->sql_fetchfield('stat'), true);
$db->sql_freeresult($result);
$sql = 'SELECT COUNT(topic_id) AS stat
FROM ' . TOPICS_TABLE . '
- WHERE topic_approved = 1';
+ WHERE topic_visibility = ' . ITEM_APPROVED;
$result = $db->sql_query($sql);
set_config('num_topics', (int) $db->sql_fetchfield('stat'), true);
$db->sql_freeresult($result);
@@ -180,6 +179,11 @@ class acp_main
update_last_username();
add_log('admin', 'LOG_RESYNC_STATS');
+
+ if ($request->is_ajax())
+ {
+ trigger_error('RESYNC_STATS_SUCCESS');
+ }
break;
case 'user':
@@ -223,7 +227,7 @@ class acp_main
$sql = 'SELECT COUNT(post_id) AS num_posts, poster_id
FROM ' . POSTS_TABLE . '
WHERE post_id BETWEEN ' . ($start + 1) . ' AND ' . ($start + $step) . '
- AND post_postcount = 1 AND post_approved = 1
+ AND post_postcount = 1 AND post_visibility = ' . ITEM_APPROVED . '
GROUP BY poster_id';
$result = $db->sql_query($sql);
@@ -243,6 +247,10 @@ class acp_main
add_log('admin', 'LOG_RESYNC_POSTCOUNTS');
+ if ($request->is_ajax())
+ {
+ trigger_error('RESYNC_POSTCOUNTS_SUCCESS');
+ }
break;
case 'date':
@@ -253,13 +261,18 @@ class acp_main
set_config('board_startdate', time() - 1);
add_log('admin', 'LOG_RESET_DATE');
+
+ if ($request->is_ajax())
+ {
+ trigger_error('RESET_DATE_SUCCESS');
+ }
break;
case 'db_track':
- switch ($db->sql_layer)
+ switch ($db->get_sql_layer())
{
case 'sqlite':
- case 'firebird':
+ case 'sqlite3':
$db->sql_query('DELETE FROM ' . TOPICS_POSTED_TABLE);
break;
@@ -328,22 +341,27 @@ class acp_main
}
add_log('admin', 'LOG_RESYNC_POST_MARKING');
- break;
- case 'purge_cache':
- if ((int) $user->data['user_type'] !== USER_FOUNDER)
+ if ($request->is_ajax())
{
- trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action), E_USER_WARNING);
+ trigger_error('RESYNC_POST_MARKING_SUCCESS');
}
+ break;
- global $cache;
+ case 'purge_cache':
+ $config->increment('assets_version', 1);
$cache->purge();
// Clear permissions
$auth->acl_clear_prefetch();
- cache_moderators();
+ phpbb_cache_moderators($db, $cache, $auth);
add_log('admin', 'LOG_PURGE_CACHE');
+
+ if ($request->is_ajax())
+ {
+ trigger_error('PURGE_CACHE_SUCCESS');
+ }
break;
case 'purge_sessions':
@@ -356,10 +374,10 @@ class acp_main
foreach ($tables as $table)
{
- switch ($db->sql_layer)
+ switch ($db->get_sql_layer())
{
case 'sqlite':
- case 'firebird':
+ case 'sqlite3':
$db->sql_query("DELETE FROM $table");
break;
@@ -390,6 +408,11 @@ class acp_main
$db->sql_query($sql);
add_log('admin', 'LOG_PURGE_SESSIONS');
+
+ if ($request->is_ajax())
+ {
+ trigger_error('PURGE_SESSIONS_SUCCESS');
+ }
break;
}
}
@@ -398,28 +421,62 @@ class acp_main
// Version check
$user->add_lang('install');
- if ($auth->acl_get('a_server') && version_compare(PHP_VERSION, '5.3.3', '<'))
+ if ($auth->acl_get('a_server') && version_compare(PHP_VERSION, '5.4.0', '<'))
{
$template->assign_vars(array(
'S_PHP_VERSION_OLD' => true,
- 'L_PHP_VERSION_OLD' => sprintf($user->lang['PHP_VERSION_OLD'], '<a href="https://www.phpbb.com/community/viewtopic.php?f=14&amp;t=2152375">', '</a>'),
+ 'L_PHP_VERSION_OLD' => sprintf($user->lang['PHP_VERSION_OLD'], PHP_VERSION, '5.4.0', '<a href="https://www.phpbb.com/support/docs/en/3.2/ug/quickstart/requirements">', '</a>'),
));
}
- $latest_version_info = false;
- if (($latest_version_info = obtain_latest_version_info(request_var('versioncheck_force', false))) === false)
+ if ($auth->acl_get('a_board'))
{
- $template->assign_var('S_VERSIONCHECK_FAIL', true);
+ /** @var \phpbb\version_helper $version_helper */
+ $version_helper = $phpbb_container->get('version_helper');
+ try
+ {
+ $recheck = $request->variable('versioncheck_force', false);
+ $updates_available = $version_helper->get_update_on_branch($recheck);
+ $upgrades_available = $version_helper->get_suggested_updates();
+ if (!empty($upgrades_available))
+ {
+ $upgrades_available = array_pop($upgrades_available);
+ }
+
+ $template->assign_vars(array(
+ 'S_VERSION_UP_TO_DATE' => empty($updates_available),
+ 'S_VERSION_UPGRADEABLE' => !empty($upgrades_available),
+ 'UPGRADE_INSTRUCTIONS' => !empty($upgrades_available) ? $user->lang('UPGRADE_INSTRUCTIONS', $upgrades_available['current'], $upgrades_available['announcement']) : false,
+ ));
+ }
+ catch (\RuntimeException $e)
+ {
+ $template->assign_vars(array(
+ 'S_VERSIONCHECK_FAIL' => true,
+ 'VERSIONCHECK_FAIL_REASON' => ($e->getMessage() !== $user->lang('VERSIONCHECK_FAIL')) ? $e->getMessage() : '',
+ ));
+ }
}
else
{
- $latest_version_info = explode("\n", $latest_version_info);
+ // We set this template var to true, to not display an outdated version notice.
+ $template->assign_var('S_VERSION_UP_TO_DATE', true);
+ }
- $template->assign_vars(array(
- 'S_VERSION_UP_TO_DATE' => phpbb_version_compare(trim($latest_version_info[0]), $config['version'], '<='),
- ));
+ // Incomplete update?
+ if (phpbb_version_compare($config['version'], PHPBB_VERSION, '<'))
+ {
+ $template->assign_var('S_UPDATE_INCOMPLETE', true);
}
+ /**
+ * Notice admin
+ *
+ * @event core.acp_main_notice
+ * @since 3.1.0-RC3
+ */
+ $phpbb_dispatcher->dispatch('core.acp_main_notice');
+
// Get forum statistics
$total_posts = $config['num_posts'];
$total_topics = $config['num_topics'];
@@ -520,6 +577,7 @@ class acp_main
'U_VERSIONCHECK' => append_sid("{$phpbb_admin_path}index.$phpEx", 'i=update&amp;mode=version_check'),
'U_VERSIONCHECK_FORCE' => append_sid("{$phpbb_admin_path}index.$phpEx", 'versioncheck_force=1'),
+ 'S_VERSIONCHECK' => ($auth->acl_get('a_board')) ? true : false,
'S_ACTION_OPTIONS' => ($auth->acl_get('a_board')) ? true : false,
'S_FOUNDER' => ($user->data['user_type'] == USER_FOUNDER) ? true : false,
)
@@ -594,6 +652,22 @@ class acp_main
$template->assign_var('S_REMOVE_INSTALL', true);
}
+ // Warn if no search index is created
+ if ($config['num_posts'] && class_exists($config['search_type']))
+ {
+ $error = false;
+ $search_type = $config['search_type'];
+ $search = new $search_type($error, $phpbb_root_path, $phpEx, $auth, $config, $db, $user, $phpbb_dispatcher);
+
+ if (!$search->index_created())
+ {
+ $template->assign_vars(array(
+ 'S_SEARCH_INDEX_MISSING' => true,
+ 'L_NO_SEARCH_INDEX' => $user->lang('NO_SEARCH_INDEX', $search->get_name(), '<a href="' . append_sid("{$phpbb_admin_path}index.$phpEx", 'i=acp_search&amp;mode=index') . '">', '</a>'),
+ ));
+ }
+ }
+
if (!defined('PHPBB_DISABLE_CONFIG_CHECK') && file_exists($phpbb_root_path . 'config.' . $phpEx) && phpbb_is_writable($phpbb_root_path . 'config.' . $phpEx))
{
// World-Writable? (000x)
@@ -621,5 +695,3 @@ class acp_main
$this->page_title = 'ACP_MAIN';
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/acp/acp_modules.php b/phpBB/includes/acp/acp_modules.php
index 75bc5766a9..9d14614417 100644
--- a/phpBB/includes/acp/acp_modules.php
+++ b/phpBB/includes/acp/acp_modules.php
@@ -1,10 +1,13 @@
<?php
/**
*
-* @package acp
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -26,9 +29,6 @@ if (!defined('IN_PHPBB'))
* - category disabled
*/
-/**
-* @package acp
-*/
class acp_modules
{
var $module_class = '';
@@ -37,7 +37,7 @@ class acp_modules
function main($id, $mode)
{
- global $db, $user, $auth, $template, $module;
+ global $db, $user, $auth, $template, $module, $request;
global $config, $phpbb_admin_path, $phpbb_root_path, $phpEx;
// Set a global define for modules we might include (the author is able to prevent execution of code by checking this constant)
@@ -46,6 +46,9 @@ class acp_modules
$user->add_lang('acp/modules');
$this->tpl_name = 'acp_modules';
+ $form_key = 'acp_modules';
+ add_form_key($form_key);
+
// module class
$this->module_class = $mode;
@@ -111,7 +114,7 @@ class acp_modules
}
break;
-
+
case 'enable':
case 'disable':
if (!$module_id)
@@ -119,6 +122,11 @@ class acp_modules
trigger_error($user->lang['NO_MODULE_ID'] . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id), E_USER_WARNING);
}
+ if (!check_link_hash($request->variable('hash', ''), 'acp_modules'))
+ {
+ trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id), E_USER_WARNING);
+ }
+
$sql = 'SELECT *
FROM ' . MODULES_TABLE . "
WHERE module_class = '" . $db->sql_escape($this->module_class) . "'
@@ -150,6 +158,11 @@ class acp_modules
trigger_error($user->lang['NO_MODULE_ID'] . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id), E_USER_WARNING);
}
+ if (!check_link_hash($request->variable('hash', ''), 'acp_modules'))
+ {
+ trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id), E_USER_WARNING);
+ }
+
$sql = 'SELECT *
FROM ' . MODULES_TABLE . "
WHERE module_class = '" . $db->sql_escape($this->module_class) . "'
@@ -170,7 +183,15 @@ class acp_modules
add_log('admin', 'LOG_MODULE_' . strtoupper($action), $this->lang_name($row['module_langname']), $move_module_name);
$this->remove_cache_file();
}
-
+
+ if ($request->is_ajax())
+ {
+ $json_response = new \phpbb\json_response;
+ $json_response->send(array(
+ 'success' => ($move_module_name !== false),
+ ));
+ }
+
break;
case 'quickadd':
@@ -207,7 +228,7 @@ class acp_modules
if (!sizeof($errors))
{
$this->remove_cache_file();
-
+
trigger_error($user->lang['MODULE_ADDED'] . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id));
}
}
@@ -231,7 +252,7 @@ class acp_modules
{
trigger_error($user->lang['NO_MODULE_ID'] . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id), E_USER_WARNING);
}
-
+
$module_row = $this->get_module_row($module_id);
// no break
@@ -250,7 +271,7 @@ class acp_modules
'module_auth' => '',
);
}
-
+
$module_data = array();
$module_data['module_basename'] = request_var('module_basename', (string) $module_row['module_basename']);
@@ -265,6 +286,11 @@ class acp_modules
if ($submit)
{
+ if (!check_form_key($form_key))
+ {
+ trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id), E_USER_WARNING);
+ }
+
if (!$module_data['module_langname'])
{
trigger_error($user->lang['NO_MODULE_LANGNAME'] . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id), E_USER_WARNING);
@@ -295,7 +321,7 @@ class acp_modules
if (!sizeof($errors))
{
$this->remove_cache_file();
-
+
trigger_error((($action == 'add') ? $user->lang['MODULE_ADDED'] : $user->lang['MODULE_EDITED']) . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id));
}
}
@@ -316,7 +342,7 @@ class acp_modules
}
// Name options
- $s_name_options .= '<option value="' . $option . '"' . (($option == $module_data['module_basename']) ? ' selected="selected"' : '') . '>' . $this->lang_name($values['title']) . ' [' . $this->module_class . '_' . $option . ']</option>';
+ $s_name_options .= '<option value="' . $option . '"' . (($option == $module_data['module_basename']) ? ' selected="selected"' : '') . '>' . $this->lang_name($values['title']) . ' [' . $option . ']</option>';
$template->assign_block_vars('m_names', array('NAME' => $option, 'A_NAME' => addslashes($option)));
@@ -327,7 +353,7 @@ class acp_modules
{
$s_mode_options .= '<option value="' . $m_mode . '"' . (($m_mode == $module_data['module_mode']) ? ' selected="selected"' : '') . '>' . $this->lang_name($m_values['title']) . '</option>';
}
-
+
$template->assign_block_vars('m_names.modes', array(
'OPTION' => $m_mode,
'VALUE' => $this->lang_name($m_values['title']),
@@ -336,7 +362,7 @@ class acp_modules
);
}
}
-
+
$s_cat_option = '<option value="0"' . (($module_data['parent_id'] == 0) ? ' selected="selected"' : '') . '>' . $user->lang['NO_PARENT'] . '</option>';
$template->assign_vars(array_merge(array(
@@ -349,7 +375,7 @@ class acp_modules
'U_EDIT_ACTION' => $this->u_action . '&amp;parent_id=' . $this->parent_id,
'L_TITLE' => $user->lang[strtoupper($action) . '_MODULE'],
-
+
'MODULENAME' => $this->lang_name($module_data['module_langname']),
'ACTION' => $action,
'MODULE_ID' => $module_id,
@@ -374,6 +400,16 @@ class acp_modules
// Default management page
if (sizeof($errors))
{
+ if ($request->is_ajax())
+ {
+ $json_response = new \phpbb\json_response;
+ $json_response->send(array(
+ 'MESSAGE_TITLE' => $user->lang('ERROR'),
+ 'MESSAGE_TEXT' => implode('<br />', $errors),
+ 'SUCCESS' => false,
+ ));
+ }
+
$template->assign_vars(array(
'S_ERROR' => true,
'ERROR_MSG' => implode('<br />', $errors))
@@ -442,12 +478,12 @@ class acp_modules
'S_ACP_MODULE_MANAGEMENT' => ($this->module_class == 'acp' && ($row['module_basename'] == 'modules' || $row['module_langname'] == 'ACP_MODULE_MANAGEMENT')) ? true : false,
'U_MODULE' => $this->u_action . '&amp;parent_id=' . $row['module_id'],
- 'U_MOVE_UP' => $url . '&amp;action=move_up',
- 'U_MOVE_DOWN' => $url . '&amp;action=move_down',
+ 'U_MOVE_UP' => $url . '&amp;action=move_up&amp;hash=' . generate_link_hash('acp_modules'),
+ 'U_MOVE_DOWN' => $url . '&amp;action=move_down&amp;hash=' . generate_link_hash('acp_modules'),
'U_EDIT' => $url . '&amp;action=edit',
'U_DELETE' => $url . '&amp;action=delete',
- 'U_ENABLE' => $url . '&amp;action=enable',
- 'U_DISABLE' => $url . '&amp;action=disable')
+ 'U_ENABLE' => $url . '&amp;action=enable&amp;hash=' . generate_link_hash('acp_modules'),
+ 'U_DISABLE' => $url . '&amp;action=disable&amp;hash=' . generate_link_hash('acp_modules'))
);
}
while ($row = $db->sql_fetchrow($result));
@@ -466,8 +502,8 @@ class acp_modules
'U_EDIT' => $url . '&amp;action=edit',
'U_DELETE' => $url . '&amp;action=delete',
- 'U_ENABLE' => $url . '&amp;action=enable',
- 'U_DISABLE' => $url . '&amp;action=disable')
+ 'U_ENABLE' => $url . '&amp;action=enable&amp;hash=' . generate_link_hash('acp_modules'),
+ 'U_DISABLE' => $url . '&amp;action=disable&amp;hash=' . generate_link_hash('acp_modules'))
);
}
$db->sql_freeresult($result);
@@ -480,7 +516,7 @@ class acp_modules
foreach ($module_infos as $option => $values)
{
// Name options
- $s_install_options .= '<optgroup label="' . $this->lang_name($values['title']) . ' [' . $this->module_class . '_' . $option . ']">';
+ $s_install_options .= '<optgroup label="' . $this->lang_name($values['title']) . ' [' . $option . ']">';
// Build module modes
foreach ($values['modes'] as $m_mode => $m_values)
@@ -516,7 +552,7 @@ class acp_modules
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
-
+
if (!$row)
{
trigger_error($user->lang['NO_MODULE'] . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id), E_USER_WARNING);
@@ -524,72 +560,79 @@ class acp_modules
return $row;
}
-
+
/**
* Get available module information from module files
+ *
+ * @param string $module
+ * @param bool|string $module_class
+ * @param bool $use_all_available Use all available instead of just all
+ * enabled extensions
+ * @return array
*/
- function get_module_infos($module = '', $module_class = false)
+ function get_module_infos($module = '', $module_class = false, $use_all_available = false)
{
- global $phpbb_root_path, $phpEx;
-
+ global $phpbb_extension_manager, $phpbb_root_path, $phpEx;
+
$module_class = ($module_class === false) ? $this->module_class : $module_class;
$directory = $phpbb_root_path . 'includes/' . $module_class . '/info/';
$fileinfo = array();
- if (!$module)
- {
- $dh = @opendir($directory);
+ $finder = $phpbb_extension_manager->get_finder($use_all_available);
+
+ $modules = $finder
+ ->extension_suffix('_module')
+ ->extension_directory("/$module_class")
+ ->core_path("includes/$module_class/info/")
+ ->core_prefix($module_class . '_')
+ ->get_classes(true);
- if (!$dh)
+ foreach ($modules as $cur_module)
+ {
+ // Skip entries we do not need if we know the module we are
+ // looking for
+ if ($module && strpos(str_replace('\\', '_', $cur_module), $module) === false && $module !== $cur_module)
{
- return $fileinfo;
+ continue;
}
- while (($file = readdir($dh)) !== false)
- {
- // Is module?
- if (preg_match('/^' . $module_class . '_.+\.' . $phpEx . '$/', $file))
- {
- $class = str_replace(".$phpEx", '', $file) . '_info';
+ $info_class = preg_replace('/_module$/', '_info', $cur_module);
- if (!class_exists($class))
- {
- include($directory . $file);
- }
+ // If the class does not exist it might be following the old
+ // format. phpbb_acp_info_acp_foo needs to be turned into
+ // acp_foo_info and the respective file has to be included
+ // manually because it does not support auto loading
+ $old_info_class_file = str_replace("phpbb_{$module_class}_info_", '', $cur_module);
+ $old_info_class = $old_info_class_file . '_info';
- // Get module title tag
- if (class_exists($class))
- {
- $c_class = new $class();
- $module_info = $c_class->module();
- $fileinfo[str_replace($module_class . '_', '', $module_info['filename'])] = $module_info;
- }
- }
+ if (class_exists($old_info_class))
+ {
+ $info_class = $old_info_class;
}
- closedir($dh);
-
- ksort($fileinfo);
- }
- else
- {
- $filename = $module_class . '_' . basename($module);
- $class = $module_class . '_' . basename($module) . '_info';
-
- if (!class_exists($class))
+ else if (!class_exists($info_class))
{
- include($directory . $filename . '.' . $phpEx);
+ $info_class = $old_info_class;
+ // need to check class exists again because previous checks triggered autoloading
+ if (!class_exists($info_class) && file_exists($directory . $old_info_class_file . '.' . $phpEx))
+ {
+ include($directory . $old_info_class_file . '.' . $phpEx);
+ }
}
- // Get module title tag
- if (class_exists($class))
+ if (class_exists($info_class))
{
- $c_class = new $class();
- $module_info = $c_class->module();
- $fileinfo[str_replace($module_class . '_', '', $module_info['filename'])] = $module_info;
+ $info = new $info_class();
+ $module_info = $info->module();
+
+ $main_class = (isset($module_info['filename'])) ? $module_info['filename'] : $cur_module;
+
+ $fileinfo[$main_class] = $module_info;
}
}
-
+
+ ksort($fileinfo);
+
return $fileinfo;
}
@@ -717,15 +760,15 @@ class acp_modules
*/
function remove_cache_file()
{
- global $cache;
+ global $phpbb_container;
// Sanitise for future path use, it's escaped as appropriate for queries
$p_class = str_replace(array('.', '/', '\\'), '', basename($this->module_class));
-
- $cache->destroy('_modules_' . $p_class);
+
+ $phpbb_container->get('cache.driver')->destroy('_modules_' . $p_class);
// Additionally remove sql cache
- $cache->destroy('sql', MODULES_TABLE);
+ $phpbb_container->get('cache.driver')->destroy('sql', MODULES_TABLE);
}
/**
@@ -741,7 +784,8 @@ class acp_modules
/**
* Update/Add module
*
- * @param bool $run_inline if set to true errors will be returned and no logs being written
+ * @param array &$module_data The module data
+ * @param bool $run_inline if set to true errors will be returned and no logs being written
*/
function update_module_data(&$module_data, $run_inline = false)
{
@@ -862,7 +906,7 @@ class acp_modules
$diff = sizeof($moved_modules) * 2;
$moved_ids = array();
- for ($i = 0; $i < sizeof($moved_modules); ++$i)
+ for ($i = 0, $size = sizeof($moved_modules); $i < $size; ++$i)
{
$moved_ids[] = $moved_modules[$i]['module_id'];
}
@@ -1061,5 +1105,3 @@ class acp_modules
return $this->lang_name($target['module_langname']);
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/acp/acp_permission_roles.php b/phpBB/includes/acp/acp_permission_roles.php
index 03ea5a39dd..0796b36fef 100644
--- a/phpBB/includes/acp/acp_permission_roles.php
+++ b/phpBB/includes/acp/acp_permission_roles.php
@@ -1,10 +1,13 @@
<?php
/**
*
-* @package acp
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -16,22 +19,28 @@ if (!defined('IN_PHPBB'))
exit;
}
-/**
-* @package acp
-*/
class acp_permission_roles
{
var $u_action;
+ protected $auth_admin;
function main($id, $mode)
{
- global $db, $user, $auth, $template, $cache;
+ global $db, $user, $auth, $template, $cache, $phpbb_container;
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
+ global $request;
+
+ if (!function_exists('user_get_id_name'))
+ {
+ include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
+ }
- include_once($phpbb_root_path . 'includes/functions_user.' . $phpEx);
- include_once($phpbb_root_path . 'includes/acp/auth.' . $phpEx);
+ if (!class_exists('auth_admin'))
+ {
+ include($phpbb_root_path . 'includes/acp/auth.' . $phpEx);
+ }
- $auth_admin = new auth_admin();
+ $this->auth_admin = new auth_admin();
$user->add_lang('acp/permissions');
add_permission_language();
@@ -46,6 +55,11 @@ class acp_permission_roles
$form_name = 'acp_permissions';
add_form_key($form_name);
+ if (!$role_id && in_array($action, array('remove', 'edit', 'move_up', 'move_down')))
+ {
+ trigger_error($user->lang['NO_ROLE_SELECTED'] . adm_back_link($this->u_action), E_USER_WARNING);
+ }
+
switch ($mode)
{
case 'admin_roles':
@@ -85,11 +99,6 @@ class acp_permission_roles
{
case 'remove':
- if (!$role_id)
- {
- trigger_error($user->lang['NO_ROLE_SELECTED'] . adm_back_link($this->u_action), E_USER_WARNING);
- }
-
$sql = 'SELECT *
FROM ' . ACL_ROLES_TABLE . '
WHERE role_id = ' . $role_id;
@@ -123,10 +132,6 @@ class acp_permission_roles
break;
case 'edit':
- if (!$role_id)
- {
- trigger_error($user->lang['NO_ROLE_SELECTED'] . adm_back_link($this->u_action), E_USER_WARNING);
- }
// Get role we edit
$sql = 'SELECT *
@@ -211,7 +216,7 @@ class acp_permission_roles
}
// Now add the auth settings
- $auth_admin->acl_set_role($role_id, $auth_settings);
+ $this->auth_admin->acl_set_role($role_id, $auth_settings);
$role_name = (!empty($user->lang[$role_name])) ? $user->lang[$role_name] : $role_name;
add_log('admin', 'LOG_' . strtoupper($permission_type) . 'ROLE_' . strtoupper($action), $role_name);
@@ -255,7 +260,7 @@ class acp_permission_roles
{
$sql = 'SELECT auth_option_id, auth_option
FROM ' . ACL_OPTIONS_TABLE . "
- WHERE auth_option " . $db->sql_like_expression($permission_type . $db->any_char) . "
+ WHERE auth_option " . $db->sql_like_expression($permission_type . $db->get_any_char()) . "
AND auth_option <> '{$permission_type}'
ORDER BY auth_option_id";
$result = $db->sql_query($sql);
@@ -274,11 +279,6 @@ class acp_permission_roles
if ($action == 'edit')
{
- if (!$role_id)
- {
- trigger_error($user->lang['NO_ROLE_SELECTED'] . adm_back_link($this->u_action), E_USER_WARNING);
- }
-
$sql = 'SELECT *
FROM ' . ACL_ROLES_TABLE . '
WHERE role_id = ' . $role_id;
@@ -306,6 +306,8 @@ class acp_permission_roles
trigger_error($user->lang['NO_ROLE_SELECTED'] . adm_back_link($this->u_action), E_USER_WARNING);
}
+ $phpbb_permissions = $phpbb_container->get('acl.permissions');
+
$template->assign_vars(array(
'S_EDIT' => true,
@@ -314,14 +316,13 @@ class acp_permission_roles
'ROLE_NAME' => $role_row['role_name'],
'ROLE_DESCRIPTION' => $role_row['role_description'],
- 'L_ACL_TYPE' => $user->lang['ACL_TYPE_' . strtoupper($permission_type)],
- )
- );
+ 'L_ACL_TYPE' => $phpbb_permissions->get_type_lang($permission_type),
+ ));
// We need to fill the auth options array with ACL_NO options ;)
$sql = 'SELECT auth_option_id, auth_option
FROM ' . ACL_OPTIONS_TABLE . "
- WHERE auth_option " . $db->sql_like_expression($permission_type . $db->any_char) . "
+ WHERE auth_option " . $db->sql_like_expression($permission_type . $db->get_any_char()) . "
AND auth_option <> '{$permission_type}'
ORDER BY auth_option_id";
$result = $db->sql_query($sql);
@@ -344,7 +345,7 @@ class acp_permission_roles
// Get users/groups/forums using this preset...
if ($action == 'edit')
{
- $hold_ary = $auth_admin->get_role_mask($role_id);
+ $hold_ary = $this->auth_admin->get_role_mask($role_id);
if (sizeof($hold_ary))
{
@@ -355,7 +356,7 @@ class acp_permission_roles
'L_ROLE_ASSIGNED_TO' => sprintf($user->lang['ROLE_ASSIGNED_TO'], $role_name))
);
- $auth_admin->display_role_mask($hold_ary);
+ $this->auth_admin->display_role_mask($hold_ary);
}
}
@@ -365,7 +366,23 @@ class acp_permission_roles
case 'move_up':
case 'move_down':
- $order = request_var('order', 0);
+ if (!check_link_hash($request->variable('hash', ''), 'acp_permission_roles'))
+ {
+ trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING);
+ }
+
+ $sql = 'SELECT role_order
+ FROM ' . ACL_ROLES_TABLE . "
+ WHERE role_id = $role_id";
+ $result = $db->sql_query($sql);
+ $order = $db->sql_fetchfield('role_order');
+ $db->sql_freeresult($result);
+
+ if ($order === false || ($order == 0 && $action == 'move_up'))
+ {
+ break;
+ }
+ $order = (int) $order;
$order_total = $order * 2 + (($action == 'move_up') ? -1 : 1);
$sql = 'UPDATE ' . ACL_ROLES_TABLE . '
@@ -374,6 +391,14 @@ class acp_permission_roles
AND role_order IN ($order, " . (($action == 'move_up') ? $order - 1 : $order + 1) . ')';
$db->sql_query($sql);
+ if ($request->is_ajax())
+ {
+ $json_response = new \phpbb\json_response;
+ $json_response->send(array(
+ 'success' => (bool) $db->sql_affectedrows(),
+ ));
+ }
+
break;
}
@@ -420,8 +445,8 @@ class acp_permission_roles
'U_EDIT' => $this->u_action . '&amp;action=edit&amp;role_id=' . $row['role_id'],
'U_REMOVE' => $this->u_action . '&amp;action=remove&amp;role_id=' . $row['role_id'],
- 'U_MOVE_UP' => $this->u_action . '&amp;action=move_up&amp;order=' . $row['role_order'],
- 'U_MOVE_DOWN' => $this->u_action . '&amp;action=move_down&amp;order=' . $row['role_order'],
+ 'U_MOVE_UP' => $this->u_action . '&amp;action=move_up&amp;role_id=' . $row['role_id'] . '&amp;hash=' . generate_link_hash('acp_permission_roles'),
+ 'U_MOVE_DOWN' => $this->u_action . '&amp;action=move_down&amp;role_id=' . $row['role_id'] . '&amp;hash=' . generate_link_hash('acp_permission_roles'),
'U_DISPLAY_ITEMS' => ($row['role_id'] == $display_item) ? '' : $this->u_action . '&amp;display_item=' . $row['role_id'] . '#assigned_to')
);
@@ -446,8 +471,8 @@ class acp_permission_roles
'S_DISPLAY_ROLE_MASK' => true)
);
- $hold_ary = $auth_admin->get_role_mask($display_item);
- $auth_admin->display_role_mask($hold_ary);
+ $hold_ary = $this->auth_admin->get_role_mask($display_item);
+ $this->auth_admin->display_role_mask($hold_ary);
}
}
@@ -456,14 +481,16 @@ class acp_permission_roles
*/
function display_auth_options($auth_options)
{
- global $template, $user;
+ global $template, $user, $phpbb_container;
+
+ $phpbb_permissions = $phpbb_container->get('acl.permissions');
$content_array = $categories = array();
$key_sort_array = array(0);
$auth_options = array(0 => $auth_options);
// Making use of auth_admin method here (we do not really want to change two similar code fragments)
- auth_admin::build_permission_array($auth_options, $content_array, $categories, $key_sort_array);
+ $this->auth_admin->build_permission_array($auth_options, $content_array, $categories, $key_sort_array);
$content_array = $content_array[0];
@@ -473,7 +500,7 @@ class acp_permission_roles
foreach ($content_array as $cat => $cat_array)
{
$template->assign_block_vars('auth', array(
- 'CAT_NAME' => $user->lang['permission_cat'][$cat],
+ 'CAT_NAME' => $phpbb_permissions->get_category_lang($cat),
'S_YES' => ($cat_array['S_YES'] && !$cat_array['S_NEVER'] && !$cat_array['S_NO']) ? true : false,
'S_NEVER' => ($cat_array['S_NEVER'] && !$cat_array['S_YES'] && !$cat_array['S_NO']) ? true : false,
@@ -488,8 +515,8 @@ class acp_permission_roles
'S_NO' => ($allowed == ACL_NO) ? true : false,
'FIELD_NAME' => $permission,
- 'PERMISSION' => $user->lang['acl_' . $permission]['lang'])
- );
+ 'PERMISSION' => $phpbb_permissions->get_permission_lang($permission),
+ ));
}
}
}
@@ -501,12 +528,10 @@ class acp_permission_roles
{
global $db;
- $auth_admin = new auth_admin();
-
// Get complete auth array
$sql = 'SELECT auth_option, auth_option_id
FROM ' . ACL_OPTIONS_TABLE . "
- WHERE auth_option " . $db->sql_like_expression($permission_type . $db->any_char);
+ WHERE auth_option " . $db->sql_like_expression($permission_type . $db->get_any_char());
$result = $db->sql_query($sql);
$auth_settings = array();
@@ -530,19 +555,19 @@ class acp_permission_roles
$db->sql_freeresult($result);
// Get role assignments
- $hold_ary = $auth_admin->get_role_mask($role_id);
+ $hold_ary = $this->auth_admin->get_role_mask($role_id);
// Re-assign permissions
foreach ($hold_ary as $forum_id => $forum_ary)
{
if (isset($forum_ary['users']))
{
- $auth_admin->acl_set('user', $forum_id, $forum_ary['users'], $auth_settings, 0, false);
+ $this->auth_admin->acl_set('user', $forum_id, $forum_ary['users'], $auth_settings, 0, false);
}
if (isset($forum_ary['groups']))
{
- $auth_admin->acl_set('group', $forum_id, $forum_ary['groups'], $auth_settings, 0, false);
+ $this->auth_admin->acl_set('group', $forum_id, $forum_ary['groups'], $auth_settings, 0, false);
}
}
@@ -564,8 +589,6 @@ class acp_permission_roles
WHERE role_id = ' . $role_id;
$db->sql_query($sql);
- $auth_admin->acl_clear_prefetch();
+ $this->auth_admin->acl_clear_prefetch();
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/acp/acp_permissions.php b/phpBB/includes/acp/acp_permissions.php
index e9f0af5071..62e75a2db7 100644
--- a/phpBB/includes/acp/acp_permissions.php
+++ b/phpBB/includes/acp/acp_permissions.php
@@ -1,10 +1,13 @@
<?php
/**
*
-* @package acp
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -16,21 +19,28 @@ if (!defined('IN_PHPBB'))
exit;
}
-/**
-* @package acp
-*/
class acp_permissions
{
var $u_action;
var $permission_dropdown;
+ protected $permissions;
function main($id, $mode)
{
- global $db, $user, $auth, $template, $cache;
+ global $db, $user, $auth, $template, $cache, $phpbb_container;
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
- include_once($phpbb_root_path . 'includes/functions_user.' . $phpEx);
- include_once($phpbb_root_path . 'includes/acp/auth.' . $phpEx);
+ if (!function_exists('user_get_id_name'))
+ {
+ include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
+ }
+
+ if (!class_exists('auth_admin'))
+ {
+ include($phpbb_root_path . 'includes/acp/auth.' . $phpEx);
+ }
+
+ $this->permissions = $phpbb_container->get('acl.permissions');
$auth_admin = new auth_admin();
@@ -50,7 +60,7 @@ class acp_permissions
if ($user_id && isset($auth_admin->acl_options['id'][$permission]) && $auth->acl_get('a_viewauth'))
{
- $this->page_title = sprintf($user->lang['TRACE_PERMISSION'], $user->lang['acl_' . $permission]['lang']);
+ $this->page_title = sprintf($user->lang['TRACE_PERMISSION'], $this->permissions->get_permission_lang($permission));
$this->permission_trace($user_id, $forum_id, $permission);
return;
}
@@ -328,15 +338,6 @@ class acp_permissions
}
}
-
- // Setting permissions screen
- $s_hidden_fields = build_hidden_fields(array(
- 'user_id' => $user_id,
- 'group_id' => $group_id,
- 'forum_id' => $forum_id,
- 'type' => $permission_type)
- );
-
// Go through the screens/options needed and present them in correct order
foreach ($permission_victim as $victim)
{
@@ -469,6 +470,14 @@ class acp_permissions
// If there are more than 5 forums selected the admin is not able to select all users/groups too.
// We need to see if the number of forums can be increased or need to be decreased.
+ // Setting permissions screen
+ $s_hidden_fields = build_hidden_fields(array(
+ 'user_id' => $user_id,
+ 'group_id' => $group_id,
+ 'forum_id' => $forum_id,
+ 'type' => $permission_type,
+ ));
+
$template->assign_vars(array(
'U_ACTION' => $this->u_action,
'ANONYMOUS_USER_ID' => ANONYMOUS,
@@ -498,13 +507,21 @@ class acp_permissions
$template->assign_vars(array(
'S_FORUM_NAMES' => (sizeof($forum_names)) ? true : false,
- 'FORUM_NAMES' => implode(', ', $forum_names))
+ 'FORUM_NAMES' => implode($user->lang['COMMA_SEPARATOR'], $forum_names))
);
}
return;
}
+ // Setting permissions screen
+ $s_hidden_fields = build_hidden_fields(array(
+ 'user_id' => $user_id,
+ 'group_id' => $group_id,
+ 'forum_id' => $forum_id,
+ 'type' => $permission_type,
+ ));
+
// Do not allow forum_ids being set and no other setting defined (will bog down the server too much)
if (sizeof($forum_id) && !sizeof($user_id) && !sizeof($group_id))
{
@@ -513,7 +530,7 @@ class acp_permissions
$template->assign_vars(array(
'S_PERMISSION_DROPDOWN' => (sizeof($this->permission_dropdown) > 1) ? $this->build_permission_dropdown($this->permission_dropdown, $permission_type, $permission_scope) : false,
- 'L_PERMISSION_TYPE' => $user->lang['ACL_TYPE_' . strtoupper($permission_type)],
+ 'L_PERMISSION_TYPE' => $this->permissions->get_type_lang($permission_type),
'U_ACTION' => $this->u_action,
'S_HIDDEN_FIELDS' => $s_hidden_fields)
@@ -588,7 +605,7 @@ class acp_permissions
*/
function build_permission_dropdown($options, $default_option, $permission_scope)
{
- global $user, $auth;
+ global $auth;
$s_dropdown_options = '';
foreach ($options as $setting)
@@ -599,7 +616,7 @@ class acp_permissions
}
$selected = ($setting == $default_option) ? ' selected="selected"' : '';
- $l_setting = (isset($user->lang['permission_type'][$permission_scope][$setting])) ? $user->lang['permission_type'][$permission_scope][$setting] : $user->lang['permission_type'][$setting];
+ $l_setting = $this->permissions->get_type_lang($setting, $permission_scope);
$s_dropdown_options .= '<option value="' . $setting . '"' . $selected . '>' . $l_setting . '</option>';
}
@@ -657,7 +674,8 @@ class acp_permissions
*/
function set_permissions($mode, $permission_type, &$auth_admin, &$user_id, &$group_id)
{
- global $user, $auth;
+ global $db, $cache, $user, $auth;
+ global $request;
$psubmit = request_var('psubmit', array(0 => array(0 => 0)));
@@ -676,18 +694,17 @@ class acp_permissions
list($ug_id, ) = each($psubmit);
list($forum_id, ) = each($psubmit[$ug_id]);
- if (empty($_POST['setting']) || empty($_POST['setting'][$ug_id]) || empty($_POST['setting'][$ug_id][$forum_id]) || !is_array($_POST['setting'][$ug_id][$forum_id]))
+ $settings = $request->variable('setting', array(0 => array(0 => array('' => 0))), false, \phpbb\request\request_interface::POST);
+ if (empty($settings) || empty($settings[$ug_id]) || empty($settings[$ug_id][$forum_id]))
{
trigger_error('WRONG_PERMISSION_SETTING_FORMAT', E_USER_WARNING);
}
- // We obtain and check $_POST['setting'][$ug_id][$forum_id] directly and not using request_var() because request_var()
- // currently does not support the amount of dimensions required. ;)
- // $auth_settings = request_var('setting', array(0 => array(0 => array('' => 0))));
- $auth_settings = array_map('intval', $_POST['setting'][$ug_id][$forum_id]);
+ $auth_settings = $settings[$ug_id][$forum_id];
// Do we have a role we want to set?
- $assigned_role = (isset($_POST['role'][$ug_id][$forum_id])) ? (int) $_POST['role'][$ug_id][$forum_id] : 0;
+ $roles = $request->variable('role', array(0 => array(0 => 0)), false, \phpbb\request\request_interface::POST);
+ $assigned_role = (isset($roles[$ug_id][$forum_id])) ? (int) $roles[$ug_id][$forum_id] : 0;
// Do the admin want to set these permissions to other items too?
$inherit = request_var('inherit', array(0 => array(0)));
@@ -727,17 +744,18 @@ class acp_permissions
// Do we need to recache the moderator lists?
if ($permission_type == 'm_')
{
- cache_moderators();
+ phpbb_cache_moderators($db, $cache, $auth);
}
// Remove users who are now moderators or admins from everyones foes list
if ($permission_type == 'm_' || $permission_type == 'a_')
{
- update_foes($group_id, $user_id);
+ phpbb_update_foes($db, $auth, $group_id, $user_id);
}
$this->log_action($mode, 'add', $permission_type, $ug_type, $ug_id, $forum_id);
+ meta_refresh(5, $this->u_action);
trigger_error($user->lang['AUTH_UPDATED'] . adm_back_link($this->u_action));
}
@@ -746,7 +764,8 @@ class acp_permissions
*/
function set_all_permissions($mode, $permission_type, &$auth_admin, &$user_id, &$group_id)
{
- global $user, $auth;
+ global $db, $cache, $user, $auth;
+ global $request;
// User or group to be set?
$ug_type = (sizeof($user_id)) ? 'user' : 'group';
@@ -757,8 +776,8 @@ class acp_permissions
trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action), E_USER_WARNING);
}
- $auth_settings = (isset($_POST['setting'])) ? $_POST['setting'] : array();
- $auth_roles = (isset($_POST['role'])) ? $_POST['role'] : array();
+ $auth_settings = $request->variable('setting', array(0 => array(0 => array('' => 0))), false, \phpbb\request\request_interface::POST);
+ $auth_roles = $request->variable('role', array(0 => array(0 => 0)), false, \phpbb\request\request_interface::POST);
$ug_ids = $forum_ids = array();
// We need to go through the auth settings
@@ -794,23 +813,25 @@ class acp_permissions
// Do we need to recache the moderator lists?
if ($permission_type == 'm_')
{
- cache_moderators();
+ phpbb_cache_moderators($db, $cache, $auth);
}
// Remove users who are now moderators or admins from everyones foes list
if ($permission_type == 'm_' || $permission_type == 'a_')
{
- update_foes($group_id, $user_id);
+ phpbb_update_foes($db, $auth, $group_id, $user_id);
}
$this->log_action($mode, 'add', $permission_type, $ug_type, $ug_ids, $forum_ids);
if ($mode == 'setting_forum_local' || $mode == 'setting_mod_local')
{
+ meta_refresh(5, $this->u_action . '&amp;forum_id[]=' . implode('&amp;forum_id[]=', $forum_ids));
trigger_error($user->lang['AUTH_UPDATED'] . adm_back_link($this->u_action . '&amp;forum_id[]=' . implode('&amp;forum_id[]=', $forum_ids)));
}
else
{
+ meta_refresh(5, $this->u_action);
trigger_error($user->lang['AUTH_UPDATED'] . adm_back_link($this->u_action));
}
}
@@ -858,7 +879,7 @@ class acp_permissions
*/
function remove_permissions($mode, $permission_type, &$auth_admin, &$user_id, &$group_id, &$forum_id)
{
- global $user, $db, $auth;
+ global $user, $db, $cache, $auth;
// User or group to be set?
$ug_type = (sizeof($user_id)) ? 'user' : 'group';
@@ -874,17 +895,19 @@ class acp_permissions
// Do we need to recache the moderator lists?
if ($permission_type == 'm_')
{
- cache_moderators();
+ phpbb_cache_moderators($db, $cache, $auth);
}
$this->log_action($mode, 'del', $permission_type, $ug_type, (($ug_type == 'user') ? $user_id : $group_id), (sizeof($forum_id) ? $forum_id : array(0 => 0)));
if ($mode == 'setting_forum_local' || $mode == 'setting_mod_local')
{
+ meta_refresh(5, $this->u_action . '&amp;forum_id[]=' . implode('&amp;forum_id[]=', $forum_id));
trigger_error($user->lang['AUTH_UPDATED'] . adm_back_link($this->u_action . '&amp;forum_id[]=' . implode('&amp;forum_id[]=', $forum_id)));
}
else
{
+ meta_refresh(5, $this->u_action);
trigger_error($user->lang['AUTH_UPDATED'] . adm_back_link($this->u_action));
}
}
@@ -952,12 +975,7 @@ class acp_permissions
if ($user_id != $user->data['user_id'])
{
- $sql = 'SELECT user_id, username, user_permissions, user_type
- FROM ' . USERS_TABLE . '
- WHERE user_id = ' . $user_id;
- $result = $db->sql_query($sql);
- $userdata = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
+ $userdata = $auth->obtain_user_data($user_id);
}
else
{
@@ -984,7 +1002,7 @@ class acp_permissions
$back = request_var('back', 0);
$template->assign_vars(array(
- 'PERMISSION' => $user->lang['acl_' . $permission]['lang'],
+ 'PERMISSION' => $this->permissions->get_permission_lang($permission),
'PERMISSION_USERNAME' => $userdata['username'],
'FORUM_NAME' => $forum_name,
@@ -1105,7 +1123,7 @@ class acp_permissions
{
if ($user_id != $user->data['user_id'])
{
- $auth2 = new auth();
+ $auth2 = new \phpbb\auth\auth();
$auth2->acl($userdata);
$auth_setting = $auth2->acl_get($permission);
}
@@ -1172,7 +1190,7 @@ class acp_permissions
*/
function copy_forum_permissions()
{
- global $auth, $cache, $template, $user;
+ global $db, $auth, $cache, $template, $user;
$user->add_lang('acp/forums');
@@ -1187,7 +1205,7 @@ class acp_permissions
{
if (copy_forum_permissions($src, $dest))
{
- cache_moderators();
+ phpbb_cache_moderators($db, $cache, $auth);
$auth->acl_clear_prefetch();
$cache->destroy('sql', FORUMS_TABLE);
@@ -1232,7 +1250,7 @@ class acp_permissions
$sql = 'SELECT auth_option_id
FROM ' . ACL_OPTIONS_TABLE . '
- WHERE auth_option ' . $db->sql_like_expression($permission_type . $db->any_char);
+ WHERE auth_option ' . $db->sql_like_expression($permission_type . $db->get_any_char());
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result))
@@ -1311,5 +1329,3 @@ class acp_permissions
);
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/acp/acp_php_info.php b/phpBB/includes/acp/acp_php_info.php
index 88e2ac3f8d..810a111edb 100644
--- a/phpBB/includes/acp/acp_php_info.php
+++ b/phpBB/includes/acp/acp_php_info.php
@@ -1,10 +1,13 @@
<?php
/**
*
-* @package acp
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -16,9 +19,6 @@ if (!defined('IN_PHPBB'))
exit;
}
-/**
-* @package acp
-*/
class acp_php_info
{
var $u_action;
@@ -82,11 +82,9 @@ class acp_php_info
$template->assign_var('PHPINFO', $output);
}
-
+
function remove_spaces($matches)
{
return '<a name="' . str_replace(' ', '_', $matches[1]) . '">';
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/acp/acp_profile.php b/phpBB/includes/acp/acp_profile.php
index 19223847f0..9e6cc49522 100644
--- a/phpBB/includes/acp/acp_profile.php
+++ b/phpBB/includes/acp/acp_profile.php
@@ -1,10 +1,13 @@
<?php
/**
*
-* @package acp
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -16,45 +19,50 @@ if (!defined('IN_PHPBB'))
exit;
}
-/**
-* @package acp
-*/
class acp_profile
{
var $u_action;
var $edit_lang_id;
var $lang_defs;
+ protected $type_collection;
function main($id, $mode)
{
global $config, $db, $user, $auth, $template, $cache;
global $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix;
+ global $request, $phpbb_container, $phpbb_dispatcher;
- include($phpbb_root_path . 'includes/functions_posting.' . $phpEx);
- include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
- include($phpbb_root_path . 'includes/functions_profile_fields.' . $phpEx);
+ if (!function_exists('generate_smilies'))
+ {
+ include($phpbb_root_path . 'includes/functions_posting.' . $phpEx);
+ }
+
+ if (!function_exists('user_get_id_name'))
+ {
+ include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
+ }
$user->add_lang(array('ucp', 'acp/profile'));
$this->tpl_name = 'acp_profile';
$this->page_title = 'ACP_CUSTOM_PROFILE_FIELDS';
+ $field_id = $request->variable('field_id', 0);
$action = (isset($_POST['create'])) ? 'create' : request_var('action', '');
$error = array();
$s_hidden_fields = '';
- // Define some default values for each field type
- $default_values = array(
- FIELD_STRING => array('field_length' => 10, 'field_minlen' => 0, 'field_maxlen' => 20, 'field_validation' => '.*', 'field_novalue' => '', 'field_default_value' => ''),
- FIELD_TEXT => array('field_length' => '5|80', 'field_minlen' => 0, 'field_maxlen' => 1000, 'field_validation' => '.*', 'field_novalue' => '', 'field_default_value' => ''),
- FIELD_INT => array('field_length' => 5, 'field_minlen' => 0, 'field_maxlen' => 100, 'field_validation' => '', 'field_novalue' => 0, 'field_default_value' => 0),
- FIELD_DATE => array('field_length' => 10, 'field_minlen' => 10, 'field_maxlen' => 10, 'field_validation' => '', 'field_novalue' => ' 0- 0- 0', 'field_default_value' => ' 0- 0- 0'),
- FIELD_BOOL => array('field_length' => 1, 'field_minlen' => 0, 'field_maxlen' => 0, 'field_validation' => '', 'field_novalue' => 0, 'field_default_value' => 0),
- FIELD_DROPDOWN => array('field_length' => 0, 'field_minlen' => 0, 'field_maxlen' => 5, 'field_validation' => '', 'field_novalue' => 0, 'field_default_value' => 0),
- );
+ $form_key = 'acp_profile';
+ add_form_key($form_key);
- $cp = new custom_profile_admin();
+ if (!$field_id && in_array($action, array('delete','activate', 'deactivate', 'move_up', 'move_down', 'edit')))
+ {
+ trigger_error($user->lang['NO_FIELD_ID'] . adm_back_link($this->u_action), E_USER_WARNING);
+ }
+
+ $cp = $phpbb_container->get('profilefields.manager');
+ $this->type_collection = $phpbb_container->get('profilefields.type_collection');
// Build Language array
// Based on this, we decide which elements need to be edited later and which language items are missing
@@ -88,22 +96,16 @@ class acp_profile
// Have some fields been defined?
if (isset($this->lang_defs['entry']))
{
- foreach ($this->lang_defs['entry'] as $field_id => $field_ary)
+ foreach ($this->lang_defs['entry'] as $field_ident => $field_ary)
{
// Fill an array with the languages that are missing for each field
- $this->lang_defs['diff'][$field_id] = array_diff(array_values($this->lang_defs['iso']), $field_ary);
+ $this->lang_defs['diff'][$field_ident] = array_diff(array_values($this->lang_defs['iso']), $field_ary);
}
}
switch ($action)
{
case 'delete':
- $field_id = request_var('field_id', 0);
-
- if (!$field_id)
- {
- trigger_error($user->lang['NO_FIELD_ID'] . adm_back_link($this->u_action), E_USER_WARNING);
- }
if (confirm_box(true))
{
@@ -120,57 +122,8 @@ class acp_profile
$db->sql_query('DELETE FROM ' . PROFILE_FIELDS_LANG_TABLE . " WHERE field_id = $field_id");
$db->sql_query('DELETE FROM ' . PROFILE_LANG_TABLE . " WHERE field_id = $field_id");
- switch ($db->sql_layer)
- {
- case 'sqlite':
- $sql = "SELECT sql
- FROM sqlite_master
- WHERE type = 'table'
- AND name = '" . PROFILE_FIELDS_DATA_TABLE . "'
- ORDER BY type DESC, name;";
- $result = $db->sql_query($sql);
- $row = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
-
- // Create a temp table and populate it, destroy the existing one
- $db->sql_query(preg_replace('#CREATE\s+TABLE\s+"?' . PROFILE_FIELDS_DATA_TABLE . '"?#i', 'CREATE TEMPORARY TABLE ' . PROFILE_FIELDS_DATA_TABLE . '_temp', $row['sql']));
- $db->sql_query('INSERT INTO ' . PROFILE_FIELDS_DATA_TABLE . '_temp SELECT * FROM ' . PROFILE_FIELDS_DATA_TABLE);
- $db->sql_query('DROP TABLE ' . PROFILE_FIELDS_DATA_TABLE);
-
- preg_match('#\((.*)\)#s', $row['sql'], $matches);
-
- $new_table_cols = trim($matches[1]);
- $old_table_cols = preg_split('/,(?=[\\sa-z])/im', $new_table_cols);
- $column_list = array();
-
- foreach ($old_table_cols as $declaration)
- {
- $entities = preg_split('#\s+#', trim($declaration));
-
- if ($entities[0] == 'PRIMARY')
- {
- continue;
- }
-
- if ($entities[0] !== 'pf_' . $field_ident)
- {
- $column_list[] = $entities[0];
- }
- }
-
- $columns = implode(',', $column_list);
-
- $new_table_cols = preg_replace('/' . 'pf_' . $field_ident . '[^,]+,/', '', $new_table_cols);
-
- // create a new table and fill it up. destroy the temp one
- $db->sql_query('CREATE TABLE ' . PROFILE_FIELDS_DATA_TABLE . ' (' . $new_table_cols . ');');
- $db->sql_query('INSERT INTO ' . PROFILE_FIELDS_DATA_TABLE . ' (' . $columns . ') SELECT ' . $columns . ' FROM ' . PROFILE_FIELDS_DATA_TABLE . '_temp;');
- $db->sql_query('DROP TABLE ' . PROFILE_FIELDS_DATA_TABLE . '_temp');
- break;
-
- default:
- $db->sql_query('ALTER TABLE ' . PROFILE_FIELDS_DATA_TABLE . " DROP COLUMN pf_$field_ident");
- }
+ $db_tools = $phpbb_container->get('dbal.tools');
+ $db_tools->sql_column_remove(PROFILE_FIELDS_DATA_TABLE, 'pf_' . $field_ident);
$order = 0;
@@ -210,11 +163,10 @@ class acp_profile
break;
case 'activate':
- $field_id = request_var('field_id', 0);
- if (!$field_id)
+ if (!check_link_hash($request->variable('hash', ''), 'acp_profile'))
{
- trigger_error($user->lang['NO_FIELD_ID'] . adm_back_link($this->u_action), E_USER_WARNING);
+ trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$sql = 'SELECT lang_id
@@ -242,16 +194,24 @@ class acp_profile
$db->sql_freeresult($result);
add_log('admin', 'LOG_PROFILE_FIELD_ACTIVATE', $field_ident);
+
+ if ($request->is_ajax())
+ {
+ $json_response = new \phpbb\json_response();
+ $json_response->send(array(
+ 'text' => $user->lang('DEACTIVATE'),
+ ));
+ }
+
trigger_error($user->lang['PROFILE_FIELD_ACTIVATED'] . adm_back_link($this->u_action));
break;
case 'deactivate':
- $field_id = request_var('field_id', 0);
- if (!$field_id)
+ if (!check_link_hash($request->variable('hash', ''), 'acp_profile'))
{
- trigger_error($user->lang['NO_FIELD_ID'] . adm_back_link($this->u_action), E_USER_WARNING);
+ trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$sql = 'UPDATE ' . PROFILE_FIELDS_TABLE . "
@@ -266,14 +226,40 @@ class acp_profile
$field_ident = (string) $db->sql_fetchfield('field_ident');
$db->sql_freeresult($result);
+ if ($request->is_ajax())
+ {
+ $json_response = new \phpbb\json_response();
+ $json_response->send(array(
+ 'text' => $user->lang('ACTIVATE'),
+ ));
+ }
+
add_log('admin', 'LOG_PROFILE_FIELD_DEACTIVATE', $field_ident);
+
trigger_error($user->lang['PROFILE_FIELD_DEACTIVATED'] . adm_back_link($this->u_action));
break;
case 'move_up':
case 'move_down':
- $field_order = request_var('order', 0);
+
+ if (!check_link_hash($request->variable('hash', ''), 'acp_profile'))
+ {
+ trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING);
+ }
+
+ $sql = 'SELECT field_order
+ FROM ' . PROFILE_FIELDS_TABLE . "
+ WHERE field_id = $field_id";
+ $result = $db->sql_query($sql);
+ $field_order = $db->sql_fetchfield('field_order');
+ $db->sql_freeresult($result);
+
+ if ($field_order === false || ($field_order == 0 && $action == 'move_up'))
+ {
+ break;
+ }
+ $field_order = (int) $field_order;
$order_total = $field_order * 2 + (($action == 'move_up') ? -1 : 1);
$sql = 'UPDATE ' . PROFILE_FIELDS_TABLE . "
@@ -281,12 +267,19 @@ class acp_profile
WHERE field_order IN ($field_order, " . (($action == 'move_up') ? $field_order - 1 : $field_order + 1) . ')';
$db->sql_query($sql);
+ if ($request->is_ajax())
+ {
+ $json_response = new \phpbb\json_response;
+ $json_response->send(array(
+ 'success' => (bool) $db->sql_affectedrows(),
+ ));
+ }
+
break;
case 'create':
case 'edit':
- $field_id = request_var('field_id', 0);
$step = request_var('step', 1);
$submit = (isset($_REQUEST['next']) || isset($_REQUEST['prev'])) ? true : false;
@@ -298,11 +291,6 @@ class acp_profile
// We are editing... we need to grab basic things
if ($action == 'edit')
{
- if (!$field_id)
- {
- trigger_error($user->lang['NO_FIELD_ID'] . adm_back_link($this->u_action), E_USER_WARNING);
- }
-
$sql = 'SELECT l.*, f.*
FROM ' . PROFILE_LANG_TABLE . ' l, ' . PROFILE_FIELDS_TABLE . ' f
WHERE l.lang_id = ' . $this->edit_lang_id . "
@@ -332,6 +320,7 @@ class acp_profile
$this->edit_lang_id = $field_row['lang_id'];
}
$field_type = $field_row['field_type'];
+ $profile_field = $this->type_collection[$field_type];
// Get language entries
$sql = 'SELECT *
@@ -355,14 +344,15 @@ class acp_profile
// We are adding a new field, define basic params
$lang_options = $field_row = array();
- $field_type = request_var('field_type', 0);
+ $field_type = request_var('field_type', '');
- if (!$field_type)
+ if (!isset($this->type_collection[$field_type]))
{
trigger_error($user->lang['NO_FIELD_TYPE'] . adm_back_link($this->u_action), E_USER_WARNING);
}
- $field_row = array_merge($default_values[$field_type], array(
+ $profile_field = $this->type_collection[$field_type];
+ $field_row = array_merge($profile_field->get_default_option_values(), array(
'field_ident' => str_replace(' ', '_', utf8_clean_string(request_var('field_ident', '', true))),
'field_required' => 0,
'field_show_novalue'=> 0,
@@ -370,7 +360,12 @@ class acp_profile
'field_show_profile'=> 0,
'field_no_view' => 0,
'field_show_on_reg' => 0,
+ 'field_show_on_pm' => 0,
'field_show_on_vt' => 0,
+ 'field_show_on_ml' => 0,
+ 'field_is_contact' => 0,
+ 'field_contact_desc'=> '',
+ 'field_contact_url' => '',
'lang_name' => utf8_normalize_nfc(request_var('field_ident', '', true)),
'lang_explain' => '',
'lang_default_value'=> '')
@@ -381,55 +376,66 @@ class acp_profile
// $exclude contains the data we gather in each step
$exclude = array(
- 1 => array('field_ident', 'lang_name', 'lang_explain', 'field_option_none', 'field_show_on_reg', 'field_show_on_vt', 'field_required', 'field_show_novalue', 'field_hide', 'field_show_profile', 'field_no_view'),
+ 1 => array('field_ident', 'lang_name', 'lang_explain', 'field_option_none', 'field_show_on_reg', 'field_show_on_pm', 'field_show_on_vt', 'field_show_on_ml', 'field_required', 'field_show_novalue', 'field_hide', 'field_show_profile', 'field_no_view', 'field_is_contact', 'field_contact_desc', 'field_contact_url'),
2 => array('field_length', 'field_maxlen', 'field_minlen', 'field_validation', 'field_novalue', 'field_default_value'),
3 => array('l_lang_name', 'l_lang_explain', 'l_lang_default_value', 'l_lang_options')
);
- // Text-based fields require the lang_default_value to be excluded
- if ($field_type == FIELD_STRING || $field_type == FIELD_TEXT)
- {
- $exclude[1][] = 'lang_default_value';
- }
-
- // option-specific fields require lang_options to be excluded
- if ($field_type == FIELD_BOOL || $field_type == FIELD_DROPDOWN)
- {
- $exclude[1][] = 'lang_options';
- }
-
- $cp->vars['field_ident'] = ($action == 'create' && $step == 1) ? utf8_clean_string(request_var('field_ident', $field_row['field_ident'], true)) : request_var('field_ident', $field_row['field_ident']);
- $cp->vars['lang_name'] = utf8_normalize_nfc(request_var('lang_name', $field_row['lang_name'], true));
- $cp->vars['lang_explain'] = utf8_normalize_nfc(request_var('lang_explain', $field_row['lang_explain'], true));
- $cp->vars['lang_default_value'] = utf8_normalize_nfc(request_var('lang_default_value', $field_row['lang_default_value'], true));
-
// Visibility Options...
$visibility_ary = array(
'field_required',
'field_show_novalue',
'field_show_on_reg',
+ 'field_show_on_pm',
'field_show_on_vt',
+ 'field_show_on_ml',
'field_show_profile',
'field_hide',
+ 'field_is_contact',
);
- foreach ($visibility_ary as $val)
- {
- $cp->vars[$val] = ($submit || $save) ? request_var($val, 0) : $field_row[$val];
- }
+ /**
+ * Event to add initialization for new profile field table fields
+ *
+ * @event core.acp_profile_create_edit_init
+ * @var string action create|edit
+ * @var int step Configuration step (1|2|3)
+ * @var bool submit Form has been submitted
+ * @var bool save Configuration should be saved
+ * @var string field_type Type of the field we are dealing with
+ * @var array field_row Array of data about the field
+ * @var array exclude Array of excluded fields by step
+ * @var array visibility_ary Array of fields that are visibility related
+ * @since 3.1.6-RC1
+ */
+ $vars = array(
+ 'action',
+ 'step',
+ 'submit',
+ 'save',
+ 'field_type',
+ 'field_row',
+ 'exclude',
+ 'visibility_ary',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.acp_profile_create_edit_init', compact($vars)));
- $cp->vars['field_no_view'] = request_var('field_no_view', (int) $field_row['field_no_view']);
+ $options = $profile_field->prepare_options_form($exclude, $visibility_ary);
- // A boolean field expects an array as the lang options
- if ($field_type == FIELD_BOOL)
- {
- $options = utf8_normalize_nfc(request_var('lang_options', array(''), true));
- }
- else
+ $cp->vars['field_ident'] = ($action == 'create' && $step == 1) ? utf8_clean_string(request_var('field_ident', $field_row['field_ident'], true)) : request_var('field_ident', $field_row['field_ident']);
+ $cp->vars['lang_name'] = $request->variable('lang_name', $field_row['lang_name'], true);
+ $cp->vars['lang_explain'] = $request->variable('lang_explain', $field_row['lang_explain'], true);
+ $cp->vars['lang_default_value'] = $request->variable('lang_default_value', $field_row['lang_default_value'], true);
+ $cp->vars['field_contact_desc'] = $request->variable('field_contact_desc', $field_row['field_contact_desc'], true);
+ $cp->vars['field_contact_url'] = $request->variable('field_contact_url', $field_row['field_contact_url'], true);
+
+ foreach ($visibility_ary as $val)
{
- $options = utf8_normalize_nfc(request_var('lang_options', '', true));
+ $cp->vars[$val] = ($submit || $save) ? $request->variable($val, 0) : $field_row[$val];
}
+ $cp->vars['field_no_view'] = $request->variable('field_no_view', (int) $field_row['field_no_view']);
+
// If the user has submitted a form with options (i.e. dropdown field)
if ($options)
{
@@ -457,91 +463,9 @@ class acp_profile
{
$var = utf8_normalize_nfc(request_var($key, $field_row[$key], true));
- // Manipulate the intended variables a little bit if needed
- if ($field_type == FIELD_DROPDOWN && $key == 'field_maxlen')
- {
- // Get the number of options if this key is 'field_maxlen'
- $var = sizeof(explode("\n", utf8_normalize_nfc(request_var('lang_options', '', true))));
- }
- else if ($field_type == FIELD_TEXT && $key == 'field_length')
- {
- if (isset($_REQUEST['rows']))
- {
- $cp->vars['rows'] = request_var('rows', 0);
- $cp->vars['columns'] = request_var('columns', 0);
- $var = $cp->vars['rows'] . '|' . $cp->vars['columns'];
- }
- else
- {
- $row_col = explode('|', $var);
- $cp->vars['rows'] = $row_col[0];
- $cp->vars['columns'] = $row_col[1];
- }
- }
- else if ($field_type == FIELD_DATE && $key == 'field_default_value')
- {
- $always_now = request_var('always_now', -1);
-
- if ($always_now == 1 || ($always_now === -1 && $var == 'now'))
- {
- $now = getdate();
-
- $cp->vars['field_default_value_day'] = $now['mday'];
- $cp->vars['field_default_value_month'] = $now['mon'];
- $cp->vars['field_default_value_year'] = $now['year'];
- $var = $_POST['field_default_value'] = 'now';
- }
- else
- {
- if (isset($_REQUEST['field_default_value_day']))
- {
- $cp->vars['field_default_value_day'] = request_var('field_default_value_day', 0);
- $cp->vars['field_default_value_month'] = request_var('field_default_value_month', 0);
- $cp->vars['field_default_value_year'] = request_var('field_default_value_year', 0);
- $var = $_POST['field_default_value'] = sprintf('%2d-%2d-%4d', $cp->vars['field_default_value_day'], $cp->vars['field_default_value_month'], $cp->vars['field_default_value_year']);
- }
- else
- {
- list($cp->vars['field_default_value_day'], $cp->vars['field_default_value_month'], $cp->vars['field_default_value_year']) = explode('-', $var);
- }
- }
- }
- else if ($field_type == FIELD_BOOL && $key == 'field_default_value')
- {
- // 'field_length' == 1 defines radio buttons. Possible values are 1 or 2 only.
- // 'field_length' == 2 defines checkbox. Possible values are 0 or 1 only.
- // If we switch the type on step 2, we have to adjust field value.
- // 1 is a common value for the checkbox and radio buttons.
-
- // Adjust unchecked checkbox value.
- // If we return or save settings from 2nd/3rd page
- // and the checkbox is unchecked, set the value to 0.
- if (isset($_REQUEST['step']) && !isset($_REQUEST[$key]))
- {
- $var = 0;
- }
-
- // If we switch to the checkbox type but former radio buttons value was 2,
- // which is not the case for the checkbox, set it to 0 (unchecked).
- if ($cp->vars['field_length'] == 2 && $var == 2)
- {
- $var = 0;
- }
- // If we switch to the radio buttons but the former checkbox value was 0,
- // which is not the case for the radio buttons, set it to 0.
- else if ($cp->vars['field_length'] == 1 && $var == 0)
- {
- $var = 2;
- }
- }
- else if ($field_type == FIELD_INT && $key == 'field_default_value')
- {
- // Permit an empty string
- if ($action == 'create' && request_var('field_default_value', '') === '')
- {
- $var = '';
- }
- }
+ $field_data = $cp->vars;
+ $var = $profile_field->get_excluded_options($key, $action, $var, $field_data, 2);
+ $cp->vars = $field_data;
$cp->vars[$key] = $var;
}
@@ -564,7 +488,6 @@ class acp_profile
}
$db->sql_freeresult($result);
-
$sql = 'SELECT lang_id, lang_name, lang_explain, lang_default_value
FROM ' . PROFILE_LANG_TABLE . '
WHERE lang_id <> ' . $this->edit_lang_id . "
@@ -588,20 +511,12 @@ class acp_profile
if (!$cp->vars[$key] && $action == 'edit')
{
- $cp->vars[$key] = $$key;
+ $cp->vars[$key] = ${$key};
}
- else if ($key == 'l_lang_options' && $field_type == FIELD_BOOL)
- {
- $cp->vars[$key] = utf8_normalize_nfc(request_var($key, array(0 => array('')), true));
- }
- else if ($key == 'l_lang_options' && is_array($cp->vars[$key]))
- {
- foreach ($cp->vars[$key] as $lang_id => $options)
- {
- $cp->vars[$key][$lang_id] = explode("\n", $options);
- }
- }
+ $field_data = $cp->vars;
+ $var = $profile_field->get_excluded_options($key, $action, $var, $field_data, 3);
+ $cp->vars = $field_data;
}
// Check for general issues in every step
@@ -628,15 +543,7 @@ class acp_profile
$error[] = $user->lang['EMPTY_USER_FIELD_NAME'];
}
- if ($field_type == FIELD_DROPDOWN && !sizeof($cp->vars['lang_options']))
- {
- $error[] = $user->lang['NO_FIELD_ENTRIES'];
- }
-
- if ($field_type == FIELD_BOOL && (empty($cp->vars['lang_options'][0]) || empty($cp->vars['lang_options'][1])))
- {
- $error[] = $user->lang['NO_FIELD_ENTRIES'];
- }
+ $error = $profile_field->validate_options_on_submit($error, $cp->vars);
// Check for already existing field ident
if ($action != 'edit')
@@ -655,13 +562,14 @@ class acp_profile
}
}
- $step = (isset($_REQUEST['next'])) ? $step + 1 : ((isset($_REQUEST['prev'])) ? $step - 1 : $step);
-
if (sizeof($error))
{
- $step--;
$submit = false;
}
+ else
+ {
+ $step = (isset($_REQUEST['next'])) ? $step + 1 : ((isset($_REQUEST['prev'])) ? $step - 1 : $step);
+ }
// Build up the specific hidden fields
foreach ($exclude as $num => $key_ary)
@@ -673,66 +581,29 @@ class acp_profile
$_new_key_ary = array();
+ $field_data = $cp->vars;
foreach ($key_ary as $key)
{
- if ($field_type == FIELD_TEXT && $key == 'field_length' && isset($_REQUEST['rows']))
+ $var = $profile_field->prepare_hidden_fields($step, $key, $action, $field_data);
+ if ($var !== null)
{
- $cp->vars['rows'] = request_var('rows', 0);
- $cp->vars['columns'] = request_var('columns', 0);
- $_new_key_ary[$key] = $cp->vars['rows'] . '|' . $cp->vars['columns'];
- }
- else if ($field_type == FIELD_DATE && $key == 'field_default_value')
- {
- $always_now = request_var('always_now', 0);
-
- if ($always_now)
- {
- $_new_key_ary[$key] = 'now';
- }
- else if (isset($_REQUEST['field_default_value_day']))
- {
- $cp->vars['field_default_value_day'] = request_var('field_default_value_day', 0);
- $cp->vars['field_default_value_month'] = request_var('field_default_value_month', 0);
- $cp->vars['field_default_value_year'] = request_var('field_default_value_year', 0);
- $_new_key_ary[$key] = sprintf('%2d-%2d-%4d', $cp->vars['field_default_value_day'], $cp->vars['field_default_value_month'], $cp->vars['field_default_value_year']);
- }
- }
- else if ($field_type == FIELD_BOOL && $key == 'l_lang_options' && isset($_REQUEST['l_lang_options']))
- {
- $_new_key_ary[$key] = utf8_normalize_nfc(request_var($key, array(array('')), true));
- }
- else if ($field_type == FIELD_BOOL && $key == 'field_default_value')
- {
- $_new_key_ary[$key] = request_var($key, $cp->vars[$key]);
- }
- else
- {
- if (!isset($_REQUEST[$key]))
- {
- $var = false;
- }
- else if ($key == 'field_ident' && isset($cp->vars[$key]))
- {
- $_new_key_ary[$key]= $cp->vars[$key];
- }
- else
- {
- $_new_key_ary[$key] = (is_array($_REQUEST[$key])) ? utf8_normalize_nfc(request_var($key, array(''), true)) : utf8_normalize_nfc(request_var($key, '', true));
- }
+ $_new_key_ary[$key] = $var;
}
}
+ $cp->vars = $field_data;
$s_hidden_fields .= build_hidden_fields($_new_key_ary);
}
if (!sizeof($error))
{
- if ($step == 3 && (sizeof($this->lang_defs['iso']) == 1 || $save))
- {
- $this->save_profile_field($cp, $field_type, $action);
- }
- else if ($action == 'edit' && $save)
+ if (($step == 3 && (sizeof($this->lang_defs['iso']) == 1 || $save)) || ($action == 'edit' && $save))
{
+ if (!check_form_key($form_key))
+ {
+ trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING);
+ }
+
$this->save_profile_field($cp, $field_type, $action);
}
}
@@ -754,66 +625,34 @@ class acp_profile
{
// Create basic options - only small differences between field types
case 1:
-
- // Build common create options
- $template->assign_vars(array(
+ $template_vars = array(
'S_STEP_ONE' => true,
'S_FIELD_REQUIRED' => ($cp->vars['field_required']) ? true : false,
'S_FIELD_SHOW_NOVALUE'=> ($cp->vars['field_show_novalue']) ? true : false,
'S_SHOW_ON_REG' => ($cp->vars['field_show_on_reg']) ? true : false,
+ 'S_SHOW_ON_PM' => ($cp->vars['field_show_on_pm']) ? true : false,
'S_SHOW_ON_VT' => ($cp->vars['field_show_on_vt']) ? true : false,
+ 'S_SHOW_ON_MEMBERLIST'=> ($cp->vars['field_show_on_ml']) ? true : false,
'S_FIELD_HIDE' => ($cp->vars['field_hide']) ? true : false,
'S_SHOW_PROFILE' => ($cp->vars['field_show_profile']) ? true : false,
'S_FIELD_NO_VIEW' => ($cp->vars['field_no_view']) ? true : false,
+ 'S_FIELD_CONTACT' => $cp->vars['field_is_contact'],
+ 'FIELD_CONTACT_DESC'=> $cp->vars['field_contact_desc'],
+ 'FIELD_CONTACT_URL' => $cp->vars['field_contact_url'],
'L_LANG_SPECIFIC' => sprintf($user->lang['LANG_SPECIFIC_OPTIONS'], $config['default_lang']),
- 'FIELD_TYPE' => $user->lang['FIELD_' . strtoupper($cp->profile_types[$field_type])],
+ 'FIELD_TYPE' => $profile_field->get_name(),
'FIELD_IDENT' => $cp->vars['field_ident'],
'LANG_NAME' => $cp->vars['lang_name'],
- 'LANG_EXPLAIN' => $cp->vars['lang_explain'])
+ 'LANG_EXPLAIN' => $cp->vars['lang_explain'],
);
- // String and Text needs to set default values here...
- if ($field_type == FIELD_STRING || $field_type == FIELD_TEXT)
- {
- $template->assign_vars(array(
- 'S_TEXT' => ($field_type == FIELD_TEXT) ? true : false,
- 'S_STRING' => ($field_type == FIELD_STRING) ? true : false,
-
- 'L_DEFAULT_VALUE_EXPLAIN' => $user->lang[strtoupper($cp->profile_types[$field_type]) . '_DEFAULT_VALUE_EXPLAIN'],
- 'LANG_DEFAULT_VALUE' => $cp->vars['lang_default_value'])
- );
- }
-
- if ($field_type == FIELD_BOOL || $field_type == FIELD_DROPDOWN)
- {
- // Initialize these array elements if we are creating a new field
- if (!sizeof($cp->vars['lang_options']))
- {
- if ($field_type == FIELD_BOOL)
- {
- // No options have been defined for a boolean field.
- $cp->vars['lang_options'][0] = '';
- $cp->vars['lang_options'][1] = '';
- }
- else
- {
- // No options have been defined for the dropdown menu
- $cp->vars['lang_options'] = array();
- }
- }
-
- $template->assign_vars(array(
- 'S_BOOL' => ($field_type == FIELD_BOOL) ? true : false,
- 'S_DROPDOWN' => ($field_type == FIELD_DROPDOWN) ? true : false,
-
- 'L_LANG_OPTIONS_EXPLAIN' => $user->lang[strtoupper($cp->profile_types[$field_type]) . '_ENTRIES_EXPLAIN'],
- 'LANG_OPTIONS' => ($field_type == FIELD_DROPDOWN) ? implode("\n", $cp->vars['lang_options']) : '',
- 'FIRST_LANG_OPTION' => ($field_type == FIELD_BOOL) ? $cp->vars['lang_options'][0] : '',
- 'SECOND_LANG_OPTION' => ($field_type == FIELD_BOOL) ? $cp->vars['lang_options'][1] : '')
- );
- }
+ $field_data = $cp->vars;
+ $profile_field->display_options($template_vars, $field_data);
+ $cp->vars = $field_data;
+ // Build common create options
+ $template->assign_vars($template_vars);
break;
case 2:
@@ -824,8 +663,7 @@ class acp_profile
);
// Build options based on profile type
- $function = 'get_' . $cp->profile_types[$field_type] . '_options';
- $options = $cp->$function();
+ $options = $profile_field->get_options($this->lang_defs['iso'][$config['default_lang']], $cp->vars);
foreach ($options as $num => $option_ary)
{
@@ -859,6 +697,33 @@ class acp_profile
break;
}
+ $field_data = $cp->vars;
+ /**
+ * Event to add template variables for new profile field table fields
+ *
+ * @event core.acp_profile_create_edit_after
+ * @var string action create|edit
+ * @var int step Configuration step (1|2|3)
+ * @var bool submit Form has been submitted
+ * @var bool save Configuration should be saved
+ * @var string field_type Type of the field we are dealing with
+ * @var array field_data Array of data about the field
+ * @var array s_hidden_fields Array of hidden fields in case this needs modification
+ * @var array options Array of options specific to this step
+ * @since 3.1.6-RC1
+ */
+ $vars = array(
+ 'action',
+ 'step',
+ 'submit',
+ 'save',
+ 'field_type',
+ 'field_data',
+ 's_hidden_fields',
+ 'options',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.acp_profile_create_edit_after', compact($vars)));
+
$template->assign_vars(array(
'S_HIDDEN_FIELDS' => $s_hidden_fields)
);
@@ -887,17 +752,22 @@ class acp_profile
$s_one_need_edit = true;
}
+ if (!isset($this->type_collection[$row['field_type']]))
+ {
+ continue;
+ }
+ $profile_field = $this->type_collection[$row['field_type']];
$template->assign_block_vars('fields', array(
'FIELD_IDENT' => $row['field_ident'],
- 'FIELD_TYPE' => $user->lang['FIELD_' . strtoupper($cp->profile_types[$row['field_type']])],
+ 'FIELD_TYPE' => $profile_field->get_name(),
'L_ACTIVATE_DEACTIVATE' => $user->lang[$active_lang],
- 'U_ACTIVATE_DEACTIVATE' => $this->u_action . "&amp;action=$active_value&amp;field_id=$id",
+ 'U_ACTIVATE_DEACTIVATE' => $this->u_action . "&amp;action=$active_value&amp;field_id=$id" . '&amp;hash=' . generate_link_hash('acp_profile'),
'U_EDIT' => $this->u_action . "&amp;action=edit&amp;field_id=$id",
'U_TRANSLATE' => $this->u_action . "&amp;action=edit&amp;field_id=$id&amp;step=3",
'U_DELETE' => $this->u_action . "&amp;action=delete&amp;field_id=$id",
- 'U_MOVE_UP' => $this->u_action . "&amp;action=move_up&amp;order={$row['field_order']}",
- 'U_MOVE_DOWN' => $this->u_action . "&amp;action=move_down&amp;order={$row['field_order']}",
+ 'U_MOVE_UP' => $this->u_action . "&amp;action=move_up&amp;field_id=$id" . '&amp;hash=' . generate_link_hash('acp_profile'),
+ 'U_MOVE_DOWN' => $this->u_action . "&amp;action=move_down&amp;field_id=$id" . '&amp;hash=' . generate_link_hash('acp_profile'),
'S_NEED_EDIT' => $s_need_edit)
);
@@ -911,15 +781,15 @@ class acp_profile
}
$s_select_type = '';
- foreach ($cp->profile_types as $key => $value)
+ foreach ($this->type_collection as $key => $profile_field)
{
- $s_select_type .= '<option value="' . $key . '">' . $user->lang['FIELD_' . strtoupper($value)] . '</option>';
+ $s_select_type .= '<option value="' . $key . '">' . $profile_field->get_name() . '</option>';
}
$template->assign_vars(array(
'U_ACTION' => $this->u_action,
- 'S_TYPE_OPTIONS' => $s_select_type)
- );
+ 'S_TYPE_OPTIONS' => $s_select_type,
+ ));
}
/**
@@ -927,7 +797,7 @@ class acp_profile
*/
function build_language_options(&$cp, $field_type, $action = 'create')
{
- global $user, $config, $db;
+ global $user, $config, $db, $phpbb_container;
$default_lang_id = (!empty($this->edit_lang_id)) ? $this->edit_lang_id : $this->lang_defs['iso'][$config['default_lang']];
@@ -944,31 +814,8 @@ class acp_profile
}
$db->sql_freeresult($result);
- $options = array();
- $options['lang_name'] = 'string';
- if ($cp->vars['lang_explain'])
- {
- $options['lang_explain'] = 'text';
- }
-
- switch ($field_type)
- {
- case FIELD_BOOL:
- $options['lang_options'] = 'two_options';
- break;
-
- case FIELD_DROPDOWN:
- $options['lang_options'] = 'optionfield';
- break;
-
- case FIELD_TEXT:
- case FIELD_STRING:
- if (strlen($cp->vars['lang_default_value']))
- {
- $options['lang_default_value'] = ($field_type == FIELD_STRING) ? 'string' : 'text';
- }
- break;
- }
+ $profile_field = $this->type_collection[$field_type];
+ $options = $profile_field->get_language_options($cp->vars);
$lang_options = array();
@@ -1047,7 +894,7 @@ class acp_profile
*/
function save_profile_field(&$cp, $field_type, $action = 'create')
{
- global $db, $config, $user;
+ global $db, $config, $user, $phpbb_container, $phpbb_dispatcher;
$field_id = request_var('field_id', 0);
@@ -1078,12 +925,36 @@ class acp_profile
'field_required' => $cp->vars['field_required'],
'field_show_novalue' => $cp->vars['field_show_novalue'],
'field_show_on_reg' => $cp->vars['field_show_on_reg'],
+ 'field_show_on_pm' => $cp->vars['field_show_on_pm'],
'field_show_on_vt' => $cp->vars['field_show_on_vt'],
+ 'field_show_on_ml' => $cp->vars['field_show_on_ml'],
'field_hide' => $cp->vars['field_hide'],
'field_show_profile' => $cp->vars['field_show_profile'],
- 'field_no_view' => $cp->vars['field_no_view']
+ 'field_no_view' => $cp->vars['field_no_view'],
+ 'field_is_contact' => $cp->vars['field_is_contact'],
+ 'field_contact_desc' => $cp->vars['field_contact_desc'],
+ 'field_contact_url' => $cp->vars['field_contact_url'],
);
+ $field_data = $cp->vars;
+ /**
+ * Event to modify profile field configuration data before saving to database
+ *
+ * @event core.acp_profile_create_edit_save_before
+ * @var string action create|edit
+ * @var string field_type Type of the field we are dealing with
+ * @var array field_data Array of data about the field
+ * @var array profile_fields Array of fields to be sent to the database
+ * @since 3.1.6-RC1
+ */
+ $vars = array(
+ 'action',
+ 'field_type',
+ 'field_data',
+ 'profile_fields',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.acp_profile_create_edit_save_before', compact($vars)));
+
if ($action == 'create')
{
$profile_fields += array(
@@ -1107,10 +978,14 @@ class acp_profile
$db->sql_query($sql);
}
+ $profile_field = $this->type_collection[$field_type];
+
if ($action == 'create')
{
$field_ident = 'pf_' . $field_ident;
- $profile_sql[] = $this->add_field_ident($field_ident, $field_type);
+
+ $db_tools = $phpbb_container->get('dbal.tools');
+ $db_tools->sql_column_add(PROFILE_FIELDS_DATA_TABLE, $field_ident, array($profile_field->get_database_column_type(), null));
}
$sql_ary = array(
@@ -1164,23 +1039,7 @@ class acp_profile
}
}
- // These are always arrays because the key is the language id...
- $cp->vars['l_lang_name'] = utf8_normalize_nfc(request_var('l_lang_name', array(0 => ''), true));
- $cp->vars['l_lang_explain'] = utf8_normalize_nfc(request_var('l_lang_explain', array(0 => ''), true));
- $cp->vars['l_lang_default_value'] = utf8_normalize_nfc(request_var('l_lang_default_value', array(0 => ''), true));
-
- if ($field_type != FIELD_BOOL)
- {
- $cp->vars['l_lang_options'] = utf8_normalize_nfc(request_var('l_lang_options', array(0 => ''), true));
- }
- else
- {
- /**
- * @todo check if this line is correct...
- $cp->vars['l_lang_default_value'] = request_var('l_lang_default_value', array(0 => array('')), true);
- */
- $cp->vars['l_lang_options'] = utf8_normalize_nfc(request_var('l_lang_options', array(0 => array('')), true));
- }
+ $cp->vars = $profile_field->get_language_options_input($cp->vars);
if ($cp->vars['lang_options'])
{
@@ -1200,7 +1059,7 @@ class acp_profile
foreach ($cp->vars['lang_options'] as $option_id => $value)
{
$sql_ary = array(
- 'field_type' => (int) $field_type,
+ 'field_type' => $field_type,
'lang_value' => $value
);
@@ -1255,7 +1114,7 @@ class acp_profile
'field_id' => (int) $field_id,
'lang_id' => (int) $lang_id,
'option_id' => (int) $option_id,
- 'field_type' => (int) $field_type,
+ 'field_type' => $field_type,
'lang_value' => $value
);
}
@@ -1309,7 +1168,6 @@ class acp_profile
}
}
-
$db->sql_transaction('begin');
if ($action == 'create')
@@ -1381,277 +1239,4 @@ class acp_profile
}
}
}
-
- /**
- * Return sql statement for adding a new field ident (profile field) to the profile fields data table
- */
- function add_field_ident($field_ident, $field_type)
- {
- global $db;
-
- switch ($db->sql_layer)
- {
- case 'mysql':
- case 'mysql4':
- case 'mysqli':
-
- // We are defining the biggest common value, because of the possibility to edit the min/max values of each field.
- $sql = 'ALTER TABLE ' . PROFILE_FIELDS_DATA_TABLE . " ADD `$field_ident` ";
-
- switch ($field_type)
- {
- case FIELD_STRING:
- $sql .= ' VARCHAR(255) ';
- break;
-
- case FIELD_DATE:
- $sql .= 'VARCHAR(10) ';
- break;
-
- case FIELD_TEXT:
- $sql .= "TEXT";
- // ADD {$field_ident}_bbcode_uid VARCHAR(5) NOT NULL,
- // ADD {$field_ident}_bbcode_bitfield INT(11) UNSIGNED";
- break;
-
- case FIELD_BOOL:
- $sql .= 'TINYINT(2) ';
- break;
-
- case FIELD_DROPDOWN:
- $sql .= 'MEDIUMINT(8) ';
- break;
-
- case FIELD_INT:
- $sql .= 'BIGINT(20) ';
- break;
- }
-
- break;
-
- case 'sqlite':
-
- switch ($field_type)
- {
- case FIELD_STRING:
- $type = ' VARCHAR(255) ';
- break;
-
- case FIELD_DATE:
- $type = 'VARCHAR(10) ';
- break;
-
- case FIELD_TEXT:
- $type = "TEXT(65535)";
- // ADD {$field_ident}_bbcode_uid VARCHAR(5) NOT NULL,
- // ADD {$field_ident}_bbcode_bitfield INT(11) UNSIGNED";
- break;
-
- case FIELD_BOOL:
- $type = 'TINYINT(2) ';
- break;
-
- case FIELD_DROPDOWN:
- $type = 'MEDIUMINT(8) ';
- break;
-
- case FIELD_INT:
- $type = 'BIGINT(20) ';
- break;
- }
-
- // We are defining the biggest common value, because of the possibility to edit the min/max values of each field.
- if (version_compare(sqlite_libversion(), '3.0') == -1)
- {
- $sql = "SELECT sql
- FROM sqlite_master
- WHERE type = 'table'
- AND name = '" . PROFILE_FIELDS_DATA_TABLE . "'
- ORDER BY type DESC, name;";
- $result = $db->sql_query($sql);
- $row = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
-
- // Create a temp table and populate it, destroy the existing one
- $db->sql_query(preg_replace('#CREATE\s+TABLE\s+"?' . PROFILE_FIELDS_DATA_TABLE . '"?#i', 'CREATE TEMPORARY TABLE ' . PROFILE_FIELDS_DATA_TABLE . '_temp', $row['sql']));
- $db->sql_query('INSERT INTO ' . PROFILE_FIELDS_DATA_TABLE . '_temp SELECT * FROM ' . PROFILE_FIELDS_DATA_TABLE);
- $db->sql_query('DROP TABLE ' . PROFILE_FIELDS_DATA_TABLE);
-
- preg_match('#\((.*)\)#s', $row['sql'], $matches);
-
- $new_table_cols = trim($matches[1]);
- $old_table_cols = explode(',', $new_table_cols);
- $column_list = array();
-
- foreach ($old_table_cols as $declaration)
- {
- $entities = preg_split('#\s+#', trim($declaration));
- if ($entities[0] == 'PRIMARY')
- {
- continue;
- }
- $column_list[] = $entities[0];
- }
-
- $columns = implode(',', $column_list);
-
- $new_table_cols = $field_ident . ' ' . $type . ',' . $new_table_cols;
-
- // create a new table and fill it up. destroy the temp one
- $db->sql_query('CREATE TABLE ' . PROFILE_FIELDS_DATA_TABLE . ' (' . $new_table_cols . ');');
- $db->sql_query('INSERT INTO ' . PROFILE_FIELDS_DATA_TABLE . ' (' . $columns . ') SELECT ' . $columns . ' FROM ' . PROFILE_FIELDS_DATA_TABLE . '_temp;');
- $db->sql_query('DROP TABLE ' . PROFILE_FIELDS_DATA_TABLE . '_temp');
- }
- else
- {
- $sql = 'ALTER TABLE ' . PROFILE_FIELDS_DATA_TABLE . " ADD $field_ident [$type]";
- }
-
- break;
-
- case 'mssql':
- case 'mssql_odbc':
- case 'mssqlnative':
-
- // We are defining the biggest common value, because of the possibility to edit the min/max values of each field.
- $sql = 'ALTER TABLE [' . PROFILE_FIELDS_DATA_TABLE . "] ADD [$field_ident] ";
-
- switch ($field_type)
- {
- case FIELD_STRING:
- $sql .= ' [VARCHAR] (255) ';
- break;
-
- case FIELD_DATE:
- $sql .= '[VARCHAR] (10) ';
- break;
-
- case FIELD_TEXT:
- $sql .= "[TEXT]";
- // ADD {$field_ident}_bbcode_uid [VARCHAR] (5) NOT NULL,
- // ADD {$field_ident}_bbcode_bitfield [INT] UNSIGNED";
- break;
-
- case FIELD_BOOL:
- case FIELD_DROPDOWN:
- $sql .= '[INT] ';
- break;
-
- case FIELD_INT:
- $sql .= '[FLOAT] ';
- break;
- }
-
- break;
-
- case 'postgres':
-
- // We are defining the biggest common value, because of the possibility to edit the min/max values of each field.
- $sql = 'ALTER TABLE ' . PROFILE_FIELDS_DATA_TABLE . " ADD COLUMN \"$field_ident\" ";
-
- switch ($field_type)
- {
- case FIELD_STRING:
- $sql .= ' VARCHAR(255) ';
- break;
-
- case FIELD_DATE:
- $sql .= 'VARCHAR(10) ';
- break;
-
- case FIELD_TEXT:
- $sql .= "TEXT";
- // ADD {$field_ident}_bbcode_uid VARCHAR(5) NOT NULL,
- // ADD {$field_ident}_bbcode_bitfield INT4 UNSIGNED";
- break;
-
- case FIELD_BOOL:
- $sql .= 'INT2 ';
- break;
-
- case FIELD_DROPDOWN:
- $sql .= 'INT4 ';
- break;
-
- case FIELD_INT:
- $sql .= 'INT8 ';
- break;
- }
-
- break;
-
- case 'firebird':
-
- // We are defining the biggest common value, because of the possibility to edit the min/max values of each field.
- $sql = 'ALTER TABLE ' . PROFILE_FIELDS_DATA_TABLE . ' ADD "' . strtoupper($field_ident) . '" ';
-
- switch ($field_type)
- {
- case FIELD_STRING:
- $sql .= ' VARCHAR(255) ';
- break;
-
- case FIELD_DATE:
- $sql .= 'VARCHAR(10) ';
- break;
-
- case FIELD_TEXT:
- $sql .= "BLOB SUB_TYPE TEXT";
- // ADD {$field_ident}_bbcode_uid VARCHAR(5) NOT NULL,
- // ADD {$field_ident}_bbcode_bitfield INTEGER UNSIGNED";
- break;
-
- case FIELD_BOOL:
- case FIELD_DROPDOWN:
- $sql .= 'INTEGER ';
- break;
-
- case FIELD_INT:
- $sql .= 'DOUBLE PRECISION ';
- break;
- }
-
- break;
-
- case 'oracle':
-
- // We are defining the biggest common value, because of the possibility to edit the min/max values of each field.
- $sql = 'ALTER TABLE ' . PROFILE_FIELDS_DATA_TABLE . " ADD $field_ident ";
-
- switch ($field_type)
- {
- case FIELD_STRING:
- $sql .= ' VARCHAR2(255) ';
- break;
-
- case FIELD_DATE:
- $sql .= 'VARCHAR2(10) ';
- break;
-
- case FIELD_TEXT:
- $sql .= "CLOB";
- // ADD {$field_ident}_bbcode_uid VARCHAR2(5) NOT NULL,
- // ADD {$field_ident}_bbcode_bitfield NUMBER(11) UNSIGNED";
- break;
-
- case FIELD_BOOL:
- $sql .= 'NUMBER(2) ';
- break;
-
- case FIELD_DROPDOWN:
- $sql .= 'NUMBER(8) ';
- break;
-
- case FIELD_INT:
- $sql .= 'NUMBER(20) ';
- break;
- }
-
- break;
- }
-
- return $sql;
- }
}
-
-?>
diff --git a/phpBB/includes/acp/acp_prune.php b/phpBB/includes/acp/acp_prune.php
index ffe20f86f5..98d9caabdd 100644
--- a/phpBB/includes/acp/acp_prune.php
+++ b/phpBB/includes/acp/acp_prune.php
@@ -1,10 +1,13 @@
<?php
/**
*
-* @package acp
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -16,9 +19,6 @@ if (!defined('IN_PHPBB'))
exit;
}
-/**
-* @package acp
-*/
class acp_prune
{
var $u_action;
@@ -28,7 +28,11 @@ class acp_prune
global $user, $phpEx, $phpbb_admin_path, $phpbb_root_path;
$user->add_lang('acp/prune');
- include_once($phpbb_root_path . 'includes/functions_user.' . $phpEx);
+
+ if (!function_exists('user_active_flip'))
+ {
+ include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
+ }
switch ($mode)
{
@@ -80,7 +84,7 @@ class acp_prune
$prune_posted = request_var('prune_days', 0);
$prune_viewed = request_var('prune_vieweddays', 0);
$prune_all = (!$prune_posted && !$prune_viewed) ? true : false;
-
+
$prune_flags = 0;
$prune_flags += (request_var('prune_old_polls', 0)) ? 2 : 0;
$prune_flags += (request_var('prune_announce', 0)) ? 4 : 0;
@@ -110,7 +114,7 @@ class acp_prune
$p_result['topics'] = 0;
$p_result['posts'] = 0;
$log_data = '';
-
+
do
{
if (!$auth->acl_get('f_list', $row['forum_id']))
@@ -130,7 +134,7 @@ class acp_prune
$p_result['topics'] += $return['topics'];
$p_result['posts'] += $return['posts'];
}
-
+
if ($prune_viewed)
{
$return = prune($row['forum_id'], 'viewed', $prunedate_viewed, $prune_flags, false);
@@ -146,11 +150,11 @@ class acp_prune
'NUM_TOPICS' => $p_result['topics'],
'NUM_POSTS' => $p_result['posts'])
);
-
+
$log_data .= (($log_data != '') ? ', ' : '') . $row['forum_name'];
}
while ($row = $db->sql_fetchrow($result));
-
+
// Sync all pruned forums at once
sync('forum', 'forum_id', $prune_ids, true, true);
add_log('admin', 'LOG_PRUNE', $log_data);
@@ -243,8 +247,8 @@ class acp_prune
if (confirm_box(true))
{
$user_ids = $usernames = array();
- $this->get_prune_users($user_ids, $usernames);
+ $this->get_prune_users($user_ids, $usernames);
if (sizeof($user_ids))
{
if ($action == 'deactivate')
@@ -256,19 +260,13 @@ class acp_prune
{
if ($deleteposts)
{
- foreach ($user_ids as $user_id)
- {
- user_delete('remove', $user_id);
- }
-
+ user_delete('remove', $user_ids);
+
$l_log = 'LOG_PRUNE_USER_DEL_DEL';
}
else
{
- foreach ($user_ids as $user_id)
- {
- user_delete('retain', $user_id, $usernames[$user_id]);
- }
+ user_delete('retain', $user_ids, true);
$l_log = 'LOG_PRUNE_USER_DEL_ANON';
}
@@ -300,7 +298,8 @@ class acp_prune
{
$template->assign_block_vars('users', array(
'USERNAME' => $usernames[$user_id],
- 'U_PROFILE' => append_sid($phpbb_root_path . 'memberlist.' . $phpEx, 'mode=viewprofile&amp;u=' . $user_id),
+ 'USER_ID' => $user_id,
+ 'U_PROFILE' => get_username_string('profile', $user_id, $usernames[$user_id]),
'U_USER_ADMIN' => ($auth->acl_get('a_user')) ? append_sid("{$phpbb_admin_path}index.$phpEx", 'i=users&amp;mode=overview&amp;u=' . $user_id, true, $user->session_id) : '',
));
}
@@ -315,17 +314,7 @@ class acp_prune
'mode' => $mode,
'prune' => 1,
- 'users' => utf8_normalize_nfc(request_var('users', '', true)),
- 'username' => utf8_normalize_nfc(request_var('username', '', true)),
- 'email' => request_var('email', ''),
- 'joined_select' => request_var('joined_select', ''),
- 'joined' => request_var('joined', ''),
- 'active_select' => request_var('active_select', ''),
- 'active' => request_var('active', ''),
- 'count_select' => request_var('count_select', ''),
- 'count' => request_var('count', ''),
'deleteposts' => request_var('deleteposts', 0),
-
'action' => request_var('action', ''),
)), 'confirm_body_prune.html');
}
@@ -341,22 +330,36 @@ class acp_prune
}
$find_time = array('lt' => $user->lang['BEFORE'], 'gt' => $user->lang['AFTER']);
- $s_find_join_time = '';
- foreach ($find_time as $key => $value)
- {
- $s_find_join_time .= '<option value="' . $key . '">' . $value . '</option>';
- }
-
$s_find_active_time = '';
foreach ($find_time as $key => $value)
{
$s_find_active_time .= '<option value="' . $key . '">' . $value . '</option>';
}
+ $sql = 'SELECT group_id, group_name
+ FROM ' . GROUPS_TABLE . '
+ WHERE group_type <> ' . GROUP_SPECIAL . '
+ ORDER BY group_name ASC';
+ $result = $db->sql_query($sql);
+
+ $s_group_list = '';
+ while ($row = $db->sql_fetchrow($result))
+ {
+ $s_group_list .= '<option value="' . $row['group_id'] . '">' . $row['group_name'] . '</option>';
+ }
+ $db->sql_freeresult($result);
+
+ if ($s_group_list)
+ {
+ // Only prepend the "All groups" option if there are groups,
+ // otherwise we don't want to display this option at all.
+ $s_group_list = '<option value="0">' . $user->lang['PRUNE_USERS_GROUP_NONE'] . '</option>' . $s_group_list;
+ }
+
$template->assign_vars(array(
'U_ACTION' => $this->u_action,
- 'S_JOINED_OPTIONS' => $s_find_join_time,
'S_ACTIVE_OPTIONS' => $s_find_active_time,
+ 'S_GROUP_LIST' => $s_group_list,
'S_COUNT_OPTIONS' => $s_find_count,
'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&amp;form=acp_prune&amp;field=users'),
));
@@ -367,50 +370,86 @@ class acp_prune
*/
function get_prune_users(&$user_ids, &$usernames)
{
- global $user, $db;
+ global $user, $db, $request;
+
+ $users_by_name = request_var('users', '', true);
+ $users_by_id = request_var('user_ids', array(0));
+ $group_id = request_var('group_id', 0);
+ $posts_on_queue = (trim($request->variable('posts_on_queue', '')) === '') ? false : $request->variable('posts_on_queue', 0);
- $users = utf8_normalize_nfc(request_var('users', '', true));
-
- if ($users)
+ if ($users_by_name)
{
- $users = explode("\n", $users);
+ $users = explode("\n", $users_by_name);
$where_sql = ' AND ' . $db->sql_in_set('username_clean', array_map('utf8_clean_string', $users));
}
+ else if (!empty($users_by_id))
+ {
+ $user_ids = $users_by_id;
+ user_get_id_name($user_ids, $usernames);
+
+ $where_sql = ' AND ' . $db->sql_in_set('user_id', $user_ids);
+ }
else
{
- $username = utf8_normalize_nfc(request_var('username', '', true));
+ $username = request_var('username', '', true);
$email = request_var('email', '');
- $joined_select = request_var('joined_select', 'lt');
$active_select = request_var('active_select', 'lt');
$count_select = request_var('count_select', 'eq');
- $joined = request_var('joined', '');
+ $queue_select = request_var('queue_select', 'gt');
+ $joined_before = request_var('joined_before', '');
+ $joined_after = request_var('joined_after', '');
$active = request_var('active', '');
+ $count = ($request->variable('count', '') === '') ? false : $request->variable('count', 0);
+
$active = ($active) ? explode('-', $active) : array();
- $joined = ($joined) ? explode('-', $joined) : array();
+ $joined_before = ($joined_before) ? explode('-', $joined_before) : array();
+ $joined_after = ($joined_after) ? explode('-', $joined_after) : array();
- if ((sizeof($active) && sizeof($active) != 3) || (sizeof($joined) && sizeof($joined) != 3))
+ // calculate the conditions required by the join time criteria
+ $joined_sql = '';
+ if (!empty($joined_before) && !empty($joined_after))
{
- trigger_error($user->lang['WRONG_ACTIVE_JOINED_DATE'] . adm_back_link($this->u_action), E_USER_WARNING);
+ // if the two entered dates are equal, we need to adjust
+ // so that our time range is a full day instead of 1 second
+ if ($joined_after == $joined_before)
+ {
+ $joined_after[2] += 1;
+ }
+
+ $joined_sql = ' AND user_regdate BETWEEN ' . gmmktime(0, 0, 0, (int) $joined_after[1], (int) $joined_after[2], (int) $joined_after[0]) .
+ ' AND ' . gmmktime(0, 0, 0, (int) $joined_before[1], (int) $joined_before[2], (int) $joined_before[0]);
}
+ else if (empty($joined_before) && !empty($joined_after))
+ {
+ $joined_sql = ' AND user_regdate > ' . gmmktime(0, 0, 0, (int) $joined_after[1], (int) $joined_after[2], (int) $joined_after[0]);
+ }
+ else if (empty($joined_after) && !empty($joined_before))
+ {
+ $joined_sql = ' AND user_regdate < ' . gmmktime(0, 0, 0, (int) $joined_before[1], (int) $joined_before[2], (int) $joined_before[0]);
+ }
+ // implicit else when both arrays are empty do nothing
- $count = request_var('count', '');
+ if ((sizeof($active) && sizeof($active) != 3) || (sizeof($joined_before) && sizeof($joined_before) != 3) || (sizeof($joined_after) && sizeof($joined_after) != 3))
+ {
+ trigger_error($user->lang['WRONG_ACTIVE_JOINED_DATE'] . adm_back_link($this->u_action), E_USER_WARNING);
+ }
$key_match = array('lt' => '<', 'gt' => '>', 'eq' => '=');
$sort_by_types = array('username', 'user_email', 'user_posts', 'user_regdate', 'user_lastvisit');
$where_sql = '';
- $where_sql .= ($username) ? ' AND username_clean ' . $db->sql_like_expression(str_replace('*', $db->any_char, utf8_clean_string($username))) : '';
- $where_sql .= ($email) ? ' AND user_email ' . $db->sql_like_expression(str_replace('*', $db->any_char, $email)) . ' ' : '';
- $where_sql .= (sizeof($joined)) ? " AND user_regdate " . $key_match[$joined_select] . ' ' . gmmktime(0, 0, 0, (int) $joined[1], (int) $joined[2], (int) $joined[0]) : '';
- $where_sql .= ($count !== '') ? " AND user_posts " . $key_match[$count_select] . ' ' . (int) $count . ' ' : '';
+ $where_sql .= ($username) ? ' AND username_clean ' . $db->sql_like_expression(str_replace('*', $db->get_any_char(), utf8_clean_string($username))) : '';
+ $where_sql .= ($email) ? ' AND user_email ' . $db->sql_like_expression(str_replace('*', $db->get_any_char(), $email)) . ' ' : '';
+ $where_sql .= $joined_sql;
+ $where_sql .= ($count !== false) ? " AND user_posts " . $key_match[$count_select] . ' ' . (int) $count . ' ' : '';
// First handle pruning of users who never logged in, last active date is 0000-00-00
if (sizeof($active) && (int) $active[0] == 0 && (int) $active[1] == 0 && (int) $active[2] == 0)
{
$where_sql .= ' AND user_lastvisit = 0';
- }
+ }
else if (sizeof($active) && $active_select != 'lt')
{
$where_sql .= ' AND user_lastvisit ' . $key_match[$active_select] . ' ' . gmmktime(0, 0, 0, (int) $active[1], (int) $active[2], (int) $active[0]);
@@ -421,8 +460,8 @@ class acp_prune
}
}
- // Protect the admin, do not prune if no options are given...
- if (!$where_sql)
+ // If no search criteria were provided, go no further.
+ if (!$where_sql && !$group_id && $posts_on_queue === false)
{
return;
}
@@ -439,28 +478,84 @@ class acp_prune
}
$db->sql_freeresult($result);
- // Do not prune founder members
- $sql = 'SELECT user_id, username
- FROM ' . USERS_TABLE . '
- WHERE user_id <> ' . ANONYMOUS . '
- AND user_type <> ' . USER_FOUNDER . "
- $where_sql";
- $result = $db->sql_query($sql);
+ // Protect the admin, do not prune if no options are given...
+ if ($where_sql)
+ {
+ // Do not prune founder members
+ $sql = 'SELECT user_id, username
+ FROM ' . USERS_TABLE . '
+ WHERE user_id <> ' . ANONYMOUS . '
+ AND user_type <> ' . USER_FOUNDER . "
+ $where_sql";
+ $result = $db->sql_query($sql);
- $where_sql = '';
- $user_ids = $usernames = array();
+ $user_ids = $usernames = array();
- while ($row = $db->sql_fetchrow($result))
+ while ($row = $db->sql_fetchrow($result))
+ {
+ // Do not prune bots and the user currently pruning.
+ if ($row['user_id'] != $user->data['user_id'] && !in_array($row['user_id'], $bot_ids))
+ {
+ $user_ids[] = $row['user_id'];
+ $usernames[$row['user_id']] = $row['username'];
+ }
+ }
+ $db->sql_freeresult($result);
+ }
+
+ if ($group_id)
{
- // Do not prune bots and the user currently pruning.
- if ($row['user_id'] != $user->data['user_id'] && !in_array($row['user_id'], $bot_ids))
+ $sql = 'SELECT u.user_id, u.username
+ FROM ' . USER_GROUP_TABLE . ' ug, ' . USERS_TABLE . ' u
+ WHERE ug.group_id = ' . (int) $group_id . '
+ AND ug.user_id <> ' . ANONYMOUS . '
+ AND u.user_type <> ' . USER_FOUNDER . '
+ AND ug.user_pending = 0
+ AND u.user_id = ug.user_id
+ ' . (!empty($user_ids) ? ' AND ' . $db->sql_in_set('ug.user_id', $user_ids) : '');
+ $result = $db->sql_query($sql);
+
+ // we're performing an intersection operation, so all the relevant users
+ // come from this most recent query (which was limited to the results of the
+ // previous query)
+ $user_ids = $usernames = array();
+ while ($row = $db->sql_fetchrow($result))
{
- $user_ids[] = $row['user_id'];
- $usernames[$row['user_id']] = $row['username'];
+ // Do not prune bots and the user currently pruning.
+ if ($row['user_id'] != $user->data['user_id'] && !in_array($row['user_id'], $bot_ids))
+ {
+ $user_ids[] = $row['user_id'];
+ $usernames[$row['user_id']] = $row['username'];
+ }
}
+ $db->sql_freeresult($result);
+ }
+
+ if ($posts_on_queue !== false)
+ {
+ $sql = 'SELECT u.user_id, u.username, COUNT(p.post_id) AS queue_posts
+ FROM ' . POSTS_TABLE . ' p, ' . USERS_TABLE . ' u
+ WHERE u.user_id <> ' . ANONYMOUS . '
+ AND u.user_type <> ' . USER_FOUNDER . '
+ AND ' . $db->sql_in_set('p.post_visibility', array(ITEM_UNAPPROVED, ITEM_REAPPROVE)) . '
+ AND u.user_id = p.poster_id
+ ' . (!empty($user_ids) ? ' AND ' . $db->sql_in_set('p.poster_id', $user_ids) : '') . '
+ GROUP BY p.poster_id
+ HAVING queue_posts ' . $key_match[$queue_select] . ' ' . $posts_on_queue;
+ $result = $db->sql_query($sql);
+
+ // same intersection logic as the above group ID portion
+ $user_ids = $usernames = array();
+ while ($row = $db->sql_fetchrow($result))
+ {
+ // Do not prune bots and the user currently pruning.
+ if ($row['user_id'] != $user->data['user_id'] && !in_array($row['user_id'], $bot_ids))
+ {
+ $user_ids[] = $row['user_id'];
+ $usernames[$row['user_id']] = $row['username'];
+ }
+ }
+ $db->sql_freeresult($result);
}
- $db->sql_freeresult($result);
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/acp/acp_ranks.php b/phpBB/includes/acp/acp_ranks.php
index ea057cd84c..5885de57ec 100644
--- a/phpBB/includes/acp/acp_ranks.php
+++ b/phpBB/includes/acp/acp_ranks.php
@@ -1,10 +1,13 @@
<?php
/**
*
-* @package acp
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -16,16 +19,13 @@ if (!defined('IN_PHPBB'))
exit;
}
-/**
-* @package acp
-*/
class acp_ranks
{
var $u_action;
function main($id, $mode)
{
- global $db, $user, $auth, $template, $cache;
+ global $db, $user, $auth, $template, $cache, $request, $phpbb_dispatcher;
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
$user->add_lang('acp/posting');
@@ -72,7 +72,18 @@ class acp_ranks
'rank_min' => $min_posts,
'rank_image' => htmlspecialchars_decode($rank_image)
);
-
+
+ /**
+ * Modify the SQL array when saving a rank
+ *
+ * @event core.acp_ranks_save_modify_sql_ary
+ * @var int rank_id The ID of the rank (if available)
+ * @var array sql_ary Array with the rank's data
+ * @since 3.1.0-RC3
+ */
+ $vars = array('rank_id', 'sql_ary');
+ extract($phpbb_dispatcher->trigger_event('core.acp_ranks_save_modify_sql_ary', compact($vars)));
+
if ($rank_id)
{
$sql = 'UPDATE ' . RANKS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . " WHERE rank_id = $rank_id";
@@ -123,6 +134,18 @@ class acp_ranks
$cache->destroy('_ranks');
add_log('admin', 'LOG_RANK_REMOVED', $rank_title);
+
+ if ($request->is_ajax())
+ {
+ $json_response = new \phpbb\json_response;
+ $json_response->send(array(
+ 'MESSAGE_TITLE' => $user->lang['INFORMATION'],
+ 'MESSAGE_TEXT' => $user->lang['RANK_REMOVED'],
+ 'REFRESH_DATA' => array(
+ 'time' => 3
+ )
+ ));
+ }
}
else
{
@@ -140,7 +163,7 @@ class acp_ranks
case 'add':
$data = $ranks = $existing_imgs = array();
-
+
$sql = 'SELECT *
FROM ' . RANKS_TABLE . '
ORDER BY rank_min ASC, rank_special ASC';
@@ -190,7 +213,7 @@ class acp_ranks
$filename_list = '<option value=""' . (($edit_img == '') ? ' selected="selected"' : '') . '>----------</option>' . $filename_list;
unset($existing_imgs, $imglist);
- $template->assign_vars(array(
+ $tpl_ary = array(
'S_EDIT' => true,
'U_BACK' => $this->u_action,
'RANKS_PATH' => $phpbb_root_path . $config['ranks_path'],
@@ -198,17 +221,28 @@ class acp_ranks
'RANK_TITLE' => (isset($ranks['rank_title'])) ? $ranks['rank_title'] : '',
'S_FILENAME_LIST' => $filename_list,
- 'RANK_IMAGE' => ($edit_img) ? $phpbb_root_path . $config['ranks_path'] . '/' . $edit_img : $phpbb_admin_path . 'images/spacer.gif',
+ 'RANK_IMAGE' => ($edit_img) ? $phpbb_root_path . $config['ranks_path'] . '/' . $edit_img : htmlspecialchars($phpbb_admin_path) . 'images/spacer.gif',
'S_SPECIAL_RANK' => (isset($ranks['rank_special']) && $ranks['rank_special']) ? true : false,
- 'MIN_POSTS' => (isset($ranks['rank_min']) && !$ranks['rank_special']) ? $ranks['rank_min'] : 0)
+ 'MIN_POSTS' => (isset($ranks['rank_min']) && !$ranks['rank_special']) ? $ranks['rank_min'] : 0,
);
-
+ /**
+ * Modify the template output array for editing/adding ranks
+ *
+ * @event core.acp_ranks_edit_modify_tpl_ary
+ * @var array ranks Array with the rank's data
+ * @var array tpl_ary Array with the rank's template data
+ * @since 3.1.0-RC3
+ */
+ $vars = array('ranks', 'tpl_ary');
+ extract($phpbb_dispatcher->trigger_event('core.acp_ranks_edit_modify_tpl_ary', compact($vars)));
+
+ $template->assign_vars($tpl_ary);
return;
break;
}
-
+
$template->assign_vars(array(
'U_ACTION' => $this->u_action)
);
@@ -220,7 +254,7 @@ class acp_ranks
while ($row = $db->sql_fetchrow($result))
{
- $template->assign_block_vars('ranks', array(
+ $rank_row = array(
'S_RANK_IMAGE' => ($row['rank_image']) ? true : false,
'S_SPECIAL_RANK' => ($row['rank_special']) ? true : false,
@@ -229,12 +263,23 @@ class acp_ranks
'MIN_POSTS' => $row['rank_min'],
'U_EDIT' => $this->u_action . '&amp;action=edit&amp;id=' . $row['rank_id'],
- 'U_DELETE' => $this->u_action . '&amp;action=delete&amp;id=' . $row['rank_id'])
- );
+ 'U_DELETE' => $this->u_action . '&amp;action=delete&amp;id=' . $row['rank_id'],
+ );
+
+ /**
+ * Modify the template output array for each listed rank
+ *
+ * @event core.acp_ranks_list_modify_rank_row
+ * @var array row Array with the rank's data
+ * @var array rank_row Array with the rank's template data
+ * @since 3.1.0-RC3
+ */
+ $vars = array('row', 'rank_row');
+ extract($phpbb_dispatcher->trigger_event('core.acp_ranks_list_modify_rank_row', compact($vars)));
+
+ $template->assign_block_vars('ranks', $rank_row);
}
$db->sql_freeresult($result);
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/acp/acp_reasons.php b/phpBB/includes/acp/acp_reasons.php
index dbc9fcb6cc..bd40a88138 100644
--- a/phpBB/includes/acp/acp_reasons.php
+++ b/phpBB/includes/acp/acp_reasons.php
@@ -1,10 +1,13 @@
<?php
/**
*
-* @package acp
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -16,9 +19,6 @@ if (!defined('IN_PHPBB'))
exit;
}
-/**
-* @package acp
-*/
class acp_reasons
{
var $u_action;
@@ -27,6 +27,7 @@ class acp_reasons
{
global $db, $user, $auth, $template, $cache;
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
+ global $request;
$user->add_lang(array('mcp', 'acp/posting'));
@@ -114,7 +115,7 @@ class acp_reasons
$result = $db->sql_query($sql);
$max_order = (int) $db->sql_fetchfield('max_reason_order');
$db->sql_freeresult($result);
-
+
$sql_ary = array(
'reason_title' => (string) $reason_row['reason_title'],
'reason_description' => (string) $reason_row['reason_description'],
@@ -172,14 +173,14 @@ class acp_reasons
'U_ACTION' => $this->u_action . "&amp;id=$reason_id&amp;action=$action",
'U_BACK' => $this->u_action,
'ERROR_MSG' => (sizeof($error)) ? implode('<br />', $error) : '',
-
+
'REASON_TITLE' => $reason_row['reason_title'],
'REASON_DESCRIPTION' => $reason_row['reason_description'],
'TRANSLATED_TITLE' => ($translated) ? $user->lang['report_reasons']['TITLE'][strtoupper($reason_row['reason_title'])] : '',
'TRANSLATED_DESCRIPTION'=> ($translated) ? $user->lang['report_reasons']['DESCRIPTION'][strtoupper($reason_row['reason_title'])] : '',
- 'S_AVAILABLE_TITLES' => implode(', ', array_map('htmlspecialchars', array_keys($user->lang['report_reasons']['TITLE']))),
+ 'S_AVAILABLE_TITLES' => implode($user->lang['COMMA_SEPARATOR'], array_map('htmlspecialchars', array_keys($user->lang['report_reasons']['TITLE']))),
'S_EDIT_REASON' => true,
'S_TRANSLATED' => $translated,
'S_ERROR' => (sizeof($error)) ? true : false,
@@ -218,7 +219,7 @@ class acp_reasons
$other_reason_id = (int) $db->sql_fetchfield('reason_id');
$db->sql_freeresult($result);
- switch ($db->sql_layer)
+ switch ($db->get_sql_layer())
{
// The ugly one!
case 'mysqli':
@@ -251,8 +252,8 @@ class acp_reasons
// Teh standard
case 'postgres':
case 'oracle':
- case 'firebird':
case 'sqlite':
+ case 'sqlite3':
// Change the reports using this reason to 'other'
$sql = 'UPDATE ' . REPORTS_TABLE . '
SET reason_id = ' . $other_reason_id . ", report_text = '" . $db->sql_escape($reason_row['reason_description']) . "\n\n' || report_text
@@ -281,7 +282,23 @@ class acp_reasons
case 'move_up':
case 'move_down':
- $order = request_var('order', 0);
+ if (!check_link_hash($request->variable('hash', ''), 'acp_reasons'))
+ {
+ trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING);
+ }
+
+ $sql = 'SELECT reason_order
+ FROM ' . REPORTS_REASONS_TABLE . "
+ WHERE reason_id = $reason_id";
+ $result = $db->sql_query($sql);
+ $order = $db->sql_fetchfield('reason_order');
+ $db->sql_freeresult($result);
+
+ if ($order === false || ($order == 0 && $action == 'move_up'))
+ {
+ break;
+ }
+ $order = (int) $order;
$order_total = $order * 2 + (($action == 'move_up') ? -1 : 1);
$sql = 'UPDATE ' . REPORTS_REASONS_TABLE . '
@@ -289,6 +306,13 @@ class acp_reasons
WHERE reason_order IN (' . $order . ', ' . (($action == 'move_up') ? $order - 1 : $order + 1) . ')';
$db->sql_query($sql);
+ if ($request->is_ajax())
+ {
+ $json_response = new \phpbb\json_response;
+ $json_response->send(array(
+ 'success' => (bool) $db->sql_affectedrows(),
+ ));
+ }
break;
}
@@ -304,7 +328,7 @@ class acp_reasons
do
{
++$order;
-
+
if ($row['reason_order'] != $order)
{
$sql = 'UPDATE ' . REPORTS_REASONS_TABLE . "
@@ -364,12 +388,10 @@ class acp_reasons
'U_EDIT' => $this->u_action . '&amp;action=edit&amp;id=' . $row['reason_id'],
'U_DELETE' => (!$other_reason) ? $this->u_action . '&amp;action=delete&amp;id=' . $row['reason_id'] : '',
- 'U_MOVE_UP' => $this->u_action . '&amp;action=move_up&amp;order=' . $row['reason_order'],
- 'U_MOVE_DOWN' => $this->u_action . '&amp;action=move_down&amp;order=' . $row['reason_order'])
+ 'U_MOVE_UP' => $this->u_action . '&amp;action=move_up&amp;id=' . $row['reason_id'] . '&amp;hash=' . generate_link_hash('acp_reasons'),
+ 'U_MOVE_DOWN' => $this->u_action . '&amp;action=move_down&amp;id=' . $row['reason_id'] . '&amp;hash=' . generate_link_hash('acp_reasons'))
);
}
$db->sql_freeresult($result);
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/acp/acp_search.php b/phpBB/includes/acp/acp_search.php
index 0cd67b1c34..cc1e5df084 100644
--- a/phpBB/includes/acp/acp_search.php
+++ b/phpBB/includes/acp/acp_search.php
@@ -1,10 +1,13 @@
<?php
/**
*
-* @package acp
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -16,9 +19,6 @@ if (!defined('IN_PHPBB'))
exit;
}
-/**
-* @package acp
-*/
class acp_search
{
var $u_action;
@@ -50,11 +50,16 @@ class acp_search
function settings($id, $mode)
{
- global $db, $user, $auth, $template, $cache;
+ global $db, $user, $auth, $template, $cache, $request;
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
$submit = (isset($_POST['submit'])) ? true : false;
+ if ($submit && !check_link_hash($request->variable('hash', ''), 'acp_search'))
+ {
+ trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING);
+ }
+
$search_types = $this->get_search_types();
$settings = array(
@@ -77,9 +82,11 @@ class acp_search
continue;
}
- $name = ucfirst(strtolower(str_replace('_', ' ', $type)));
+ $name = $search->get_name();
+
$selected = ($config['search_type'] == $type) ? ' selected="selected"' : '';
- $search_options .= '<option value="' . $type . '"' . $selected . '>' . $name . '</option>';
+ $identifier = substr($type, strrpos($type, '\\') + 1);
+ $search_options .= "<option value=\"$type\"$selected data-toggle-setting=\"#search_{$identifier}_settings\">$name</option>";
if (method_exists($search, 'acp'))
{
@@ -88,9 +95,10 @@ class acp_search
if (!$submit)
{
$template->assign_block_vars('backend', array(
- 'NAME' => $name,
- 'SETTINGS' => $vars['tpl'])
- );
+ 'NAME' => $name,
+ 'SETTINGS' => $vars['tpl'],
+ 'IDENTIFIER' => $identifier,
+ ));
}
else if (is_array($vars['config']))
{
@@ -223,24 +231,16 @@ class acp_search
'S_YES_SEARCH' => (bool) $config['load_search'],
'S_SETTINGS' => true,
- 'U_ACTION' => $this->u_action)
+ 'U_ACTION' => $this->u_action . '&amp;hash=' . generate_link_hash('acp_search'))
);
}
function index($id, $mode)
{
- global $db, $user, $auth, $template, $cache;
+ global $db, $user, $auth, $template, $cache, $request;
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
- if (isset($_REQUEST['action']) && is_array($_REQUEST['action']))
- {
- $action = request_var('action', array('' => false));
- $action = key($action);
- }
- else
- {
- $action = request_var('action', '');
- }
+ $action = request_var('action', '');
$this->state = explode(',', $config['search_indexing_state']);
if (isset($_POST['cancel']))
@@ -249,6 +249,12 @@ class acp_search
$this->state = array();
$this->save_state();
}
+ $submit = $request->is_set_post('submit', false);
+
+ if (!check_link_hash($request->variable('hash', ''), 'acp_search') && in_array($action, array('create', 'delete')))
+ {
+ trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING);
+ }
if ($action)
{
@@ -283,7 +289,7 @@ class acp_search
{
trigger_error($error . adm_back_link($this->u_action), E_USER_WARNING);
}
- $name = ucfirst(strtolower(str_replace('_', ' ', $this->state[0])));
+ $name = $this->search->get_name();
$action = &$this->state[1];
@@ -299,7 +305,7 @@ class acp_search
if (method_exists($this->search, 'delete_index'))
{
// pass a reference to myself so the $search object can make use of save_state() and attributes
- if ($error = $this->search->delete_index($this, append_sid("{$phpbb_admin_path}index.$phpEx", "i=$id&mode=$mode&action=delete", false)))
+ if ($error = $this->search->delete_index($this, append_sid("{$phpbb_admin_path}index.$phpEx", "i=$id&mode=$mode&action=delete&hash=" . generate_link_hash('acp_search'), false)))
{
$this->state = array('');
$this->save_state();
@@ -344,8 +350,8 @@ class acp_search
$mtime = explode(' ', microtime());
$totaltime = $mtime[0] + $mtime[1] - $starttime;
$rows_per_second = $row_count / $totaltime;
- meta_refresh(1, append_sid($this->u_action . '&amp;action=delete&amp;skip_rows=' . $post_counter));
- trigger_error(sprintf($user->lang['SEARCH_INDEX_DELETE_REDIRECT'], $post_counter, $row_count, $rows_per_second));
+ meta_refresh(1, append_sid($this->u_action . '&amp;action=delete&amp;skip_rows=' . $post_counter . '&amp;hash=' . generate_link_hash('acp_search')));
+ trigger_error($user->lang('SEARCH_INDEX_DELETE_REDIRECT', (int) $row_count, $post_counter, $rows_per_second));
}
}
@@ -405,9 +411,8 @@ class acp_search
$i = 0;
while ($row = ($buffer ? $rows[$i++] : $db->sql_fetchrow($result)))
{
- // Indexing enabled for this forum or global announcement?
- // Global announcements get indexed by default.
- if (!$row['forum_id'] || (isset($forums[$row['forum_id']]) && $forums[$row['forum_id']]))
+ // Indexing enabled for this forum
+ if (isset($forums[$row['forum_id']]) && $forums[$row['forum_id']])
{
$this->search->index('post', $row['post_id'], $row['post_text'], $row['post_subject'], $row['poster_id'], $row['forum_id']);
}
@@ -435,8 +440,8 @@ class acp_search
$mtime = explode(' ', microtime());
$totaltime = $mtime[0] + $mtime[1] - $starttime;
$rows_per_second = $row_count / $totaltime;
- meta_refresh(1, append_sid($this->u_action . '&amp;action=create&amp;skip_rows=' . $post_counter));
- trigger_error(sprintf($user->lang['SEARCH_INDEX_CREATE_REDIRECT'], $post_counter, $row_count, $rows_per_second));
+ meta_refresh(1, append_sid($this->u_action . '&amp;action=create&amp;skip_rows=' . $post_counter . '&amp;hash=' . generate_link_hash('acp_search')));
+ trigger_error($user->lang('SEARCH_INDEX_CREATE_REDIRECT', (int) $row_count, $post_counter) . $user->lang('SEARCH_INDEX_CREATE_REDIRECT_RATE', $rows_per_second));
}
}
@@ -455,7 +460,6 @@ class acp_search
$search = null;
$error = false;
- $search_options = '';
foreach ($search_types as $type)
{
if ($this->init_search($type, $search, $error) || !method_exists($search, 'index_created'))
@@ -463,7 +467,7 @@ class acp_search
continue;
}
- $name = ucfirst(strtolower(str_replace('_', ' ', $type)));
+ $name = $search->get_name();
$data = array();
if (method_exists($search, 'index_stats'))
@@ -515,7 +519,7 @@ class acp_search
$template->assign_vars(array(
'S_INDEX' => true,
- 'U_ACTION' => $this->u_action,
+ 'U_ACTION' => $this->u_action . '&amp;hash=' . generate_link_hash('acp_search'),
'U_PROGRESS_BAR' => append_sid("{$phpbb_admin_path}index.$phpEx", "i=$id&amp;mode=$mode&amp;action=progress_bar"),
'UA_PROGRESS_BAR' => addslashes(append_sid("{$phpbb_admin_path}index.$phpEx", "i=$id&amp;mode=$mode&amp;action=progress_bar")),
));
@@ -524,7 +528,7 @@ class acp_search
{
$template->assign_vars(array(
'S_CONTINUE_INDEXING' => $this->state[1],
- 'U_CONTINUE_INDEXING' => $this->u_action . '&amp;action=' . $this->state[1],
+ 'U_CONTINUE_INDEXING' => $this->u_action . '&amp;action=' . $this->state[1] . '&amp;hash=' . generate_link_hash('acp_search'),
'L_CONTINUE' => ($this->state[1] == 'create') ? $user->lang['CONTINUE_INDEXING'] : $user->lang['CONTINUE_DELETING_INDEX'],
'L_CONTINUE_EXPLAIN' => ($this->state[1] == 'create') ? $user->lang['CONTINUE_INDEXING_EXPLAIN'] : $user->lang['CONTINUE_DELETING_INDEX_EXPLAIN'])
);
@@ -562,27 +566,15 @@ class acp_search
function get_search_types()
{
- global $phpbb_root_path, $phpEx;
+ global $phpbb_root_path, $phpEx, $phpbb_extension_manager;
- $search_types = array();
+ $finder = $phpbb_extension_manager->get_finder();
- $dp = @opendir($phpbb_root_path . 'includes/search');
-
- if ($dp)
- {
- while (($file = readdir($dp)) !== false)
- {
- if ((preg_match('#\.' . $phpEx . '$#', $file)) && ($file != "search.$phpEx"))
- {
- $search_types[] = preg_replace('#^(.*?)\.' . $phpEx . '$#', '\1', $file);
- }
- }
- closedir($dp);
-
- sort($search_types);
- }
-
- return $search_types;
+ return $finder
+ ->extension_suffix('_backend')
+ ->extension_directory('/search')
+ ->core_path('phpbb/search/')
+ ->get_classes();
}
function get_max_post_id()
@@ -617,27 +609,17 @@ class acp_search
*/
function init_search($type, &$search, &$error)
{
- global $phpbb_root_path, $phpEx, $user;
-
- if (!preg_match('#^\w+$#', $type) || !file_exists("{$phpbb_root_path}includes/search/$type.$phpEx"))
- {
- $error = $user->lang['NO_SUCH_SEARCH_MODULE'];
- return $error;
- }
+ global $phpbb_root_path, $phpEx, $user, $auth, $config, $db, $phpbb_dispatcher;
- include_once("{$phpbb_root_path}includes/search/$type.$phpEx");
-
- if (!class_exists($type))
+ if (!class_exists($type) || !method_exists($type, 'keyword_search'))
{
$error = $user->lang['NO_SUCH_SEARCH_MODULE'];
return $error;
}
$error = false;
- $search = new $type($error);
+ $search = new $type($error, $phpbb_root_path, $phpEx, $auth, $config, $db, $user, $phpbb_dispatcher);
return $error;
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/acp/acp_send_statistics.php b/phpBB/includes/acp/acp_send_statistics.php
index b8fc2d2c45..7c9e9cf78e 100644
--- a/phpBB/includes/acp/acp_send_statistics.php
+++ b/phpBB/includes/acp/acp_send_statistics.php
@@ -1,10 +1,13 @@
<?php
/**
*
-* @package acp
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -16,18 +19,18 @@ if (!defined('IN_PHPBB'))
exit;
}
-include($phpbb_root_path . 'includes/questionnaire/questionnaire.' . $phpEx);
-
-/**
-* @package acp
-*/
class acp_send_statistics
{
var $u_action;
function main($id, $mode)
{
- global $config, $template, $phpbb_admin_path, $phpEx;
+ global $config, $template, $phpbb_admin_path, $phpbb_root_path, $phpEx;
+
+ if (!class_exists('phpbb_questionnaire_data_collector'))
+ {
+ include($phpbb_root_path . 'includes/questionnaire/questionnaire.' . $phpEx);
+ }
$collect_url = "https://www.phpbb.com/stats/receive_stats.php";
@@ -86,5 +89,3 @@ class acp_send_statistics
}
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/acp/acp_styles.php b/phpBB/includes/acp/acp_styles.php
index 47cd02bca7..c29fb062d8 100644
--- a/phpBB/includes/acp/acp_styles.php
+++ b/phpBB/includes/acp/acp_styles.php
@@ -1,10 +1,13 @@
<?php
/**
*
-* @package acp
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -16,3961 +19,1336 @@ if (!defined('IN_PHPBB'))
exit;
}
-/**
-* @package acp
-*/
class acp_styles
{
- var $u_action;
-
- var $style_cfg;
- var $template_cfg;
- var $theme_cfg;
- var $imageset_cfg;
- var $imageset_keys;
+ public $u_action;
- function main($id, $mode)
- {
- global $db, $user, $auth, $template, $cache;
- global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
-
- // Hardcoded template bitfield to add for new templates
- $bitfield = new bitfield();
- $bitfield->set(0);
- $bitfield->set(1);
- $bitfield->set(2);
- $bitfield->set(3);
- $bitfield->set(4);
- $bitfield->set(8);
- $bitfield->set(9);
- $bitfield->set(11);
- $bitfield->set(12);
- define('TEMPLATE_BITFIELD', $bitfield->get_base64());
- unset($bitfield);
+ protected $u_base_action;
+ protected $s_hidden_fields;
+ protected $mode;
+ protected $styles_path;
+ protected $styles_path_absolute = 'styles';
+ protected $default_style = 0;
+ protected $styles_list_cols = 0;
+ protected $reserved_style_names = array('adm', 'admin', 'all');
- $user->add_lang('acp/styles');
+ /** @var \phpbb\db\driver\driver_interface */
+ protected $db;
- $this->tpl_name = 'acp_styles';
- $this->page_title = 'ACP_CAT_STYLES';
+ /** @var \phpbb\user */
+ protected $user;
- $action = request_var('action', '');
- $action = (isset($_POST['add'])) ? 'add' : $action;
- $style_id = request_var('id', 0);
-
- // Fill the configuration variables
- $this->style_cfg = $this->template_cfg = $this->theme_cfg = $this->imageset_cfg = '
-#
-# phpBB {MODE} configuration file
-#
-# @package phpBB3
-# @copyright (c) 2005 phpBB Group
-# @license http://opensource.org/licenses/gpl-license.php GNU Public License
-#
-#
-# At the left is the name, please do not change this
-# At the right the value is entered
-# For on/off options the valid values are on, off, 1, 0, true and false
-#
-# Values get trimmed, if you want to add a space in front or at the end of
-# the value, then enclose the value with single or double quotes.
-# Single and double quotes do not need to be escaped.
-#
-#
-
-# General Information about this {MODE}
-name = {NAME}
-copyright = {COPYRIGHT}
-version = {VERSION}
-';
-
- $this->theme_cfg .= '
-# Some configuration options
-
-#
-# You have to turn this option on if you want to use the
-# path template variables ({T_IMAGESET_PATH} for example) within
-# your css file.
-# This is mostly the case if you want to use language specific
-# images within your css file.
-#
-parse_css_file = {PARSE_CSS_FILE}
-';
-
- $this->template_cfg .= '
-# Some configuration options
-
-# Template inheritance
-# See http://blog.phpbb.com/2008/07/31/templating-just-got-easier/
-# Set value to empty or this template name to ignore template inheritance.
-inherit_from = {INHERIT_FROM}
-';
-
- $this->imageset_keys = array(
- 'logos' => array(
- 'site_logo',
- ),
- 'buttons' => array(
- 'icon_back_top', 'icon_contact_aim', 'icon_contact_email', 'icon_contact_icq', 'icon_contact_jabber', 'icon_contact_msnm', 'icon_contact_pm', 'icon_contact_yahoo', 'icon_contact_www', 'icon_post_delete', 'icon_post_edit', 'icon_post_info', 'icon_post_quote', 'icon_post_report', 'icon_user_online', 'icon_user_offline', 'icon_user_profile', 'icon_user_search', 'icon_user_warn', 'button_pm_forward', 'button_pm_new', 'button_pm_reply', 'button_topic_locked', 'button_topic_new', 'button_topic_reply',
- ),
- 'icons' => array(
- 'icon_post_target', 'icon_post_target_unread', 'icon_topic_attach', 'icon_topic_latest', 'icon_topic_newest', 'icon_topic_reported', 'icon_topic_unapproved', 'icon_friend', 'icon_foe',
- ),
- 'forums' => array(
- 'forum_link', 'forum_read', 'forum_read_locked', 'forum_read_subforum', 'forum_unread', 'forum_unread_locked', 'forum_unread_subforum', 'subforum_read', 'subforum_unread'
- ),
- 'folders' => array(
- 'topic_moved', 'topic_read', 'topic_read_mine', 'topic_read_hot', 'topic_read_hot_mine', 'topic_read_locked', 'topic_read_locked_mine', 'topic_unread', 'topic_unread_mine', 'topic_unread_hot', 'topic_unread_hot_mine', 'topic_unread_locked', 'topic_unread_locked_mine', 'sticky_read', 'sticky_read_mine', 'sticky_read_locked', 'sticky_read_locked_mine', 'sticky_unread', 'sticky_unread_mine', 'sticky_unread_locked', 'sticky_unread_locked_mine', 'announce_read', 'announce_read_mine', 'announce_read_locked', 'announce_read_locked_mine', 'announce_unread', 'announce_unread_mine', 'announce_unread_locked', 'announce_unread_locked_mine', 'global_read', 'global_read_mine', 'global_read_locked', 'global_read_locked_mine', 'global_unread', 'global_unread_mine', 'global_unread_locked', 'global_unread_locked_mine', 'pm_read', 'pm_unread',
- ),
- 'polls' => array(
- 'poll_left', 'poll_center', 'poll_right',
- ),
- 'ui' => array(
- 'upload_bar',
- ),
- 'user' => array(
- 'user_icon1', 'user_icon2', 'user_icon3', 'user_icon4', 'user_icon5', 'user_icon6', 'user_icon7', 'user_icon8', 'user_icon9', 'user_icon10',
- ),
- );
+ /** @var \phpbb\template\template */
+ protected $template;
- // Execute overall actions
- switch ($action)
- {
- case 'delete':
- if ($style_id)
- {
- $this->remove($mode, $style_id);
- return;
- }
- break;
+ /** @var \phpbb\request\request_interface */
+ protected $request;
- case 'export':
- if ($style_id)
- {
- $this->export($mode, $style_id);
- return;
- }
- break;
+ /** @var \phpbb\cache\driver\driver_interface */
+ protected $cache;
- case 'install':
- $this->install($mode);
- return;
- break;
+ /** @var \phpbb\auth\auth */
+ protected $auth;
- case 'add':
- $this->add($mode);
- return;
- break;
+ /** @var string */
+ protected $phpbb_root_path;
- case 'details':
- if ($style_id)
- {
- $this->details($mode, $style_id);
- return;
- }
- break;
+ /** @var string */
+ protected $php_ext;
- case 'edit':
- if ($style_id)
- {
- switch ($mode)
- {
- case 'imageset':
- return $this->edit_imageset($style_id);
- case 'template':
- return $this->edit_template($style_id);
- case 'theme':
- return $this->edit_theme($style_id);
- }
- }
- break;
+ /** @var \phpbb\event\dispatcher_interface */
+ protected $dispatcher;
- case 'cache':
- if ($style_id)
- {
- switch ($mode)
- {
- case 'template':
- return $this->template_cache($style_id);
- }
- }
- break;
- }
-
- switch ($mode)
- {
- case 'style':
-
- switch ($action)
- {
- case 'activate':
- case 'deactivate':
-
- if ($style_id == $config['default_style'])
- {
- trigger_error($user->lang['DEACTIVATE_DEFAULT'] . adm_back_link($this->u_action), E_USER_WARNING);
- }
-
- if (($action == 'deactivate' && confirm_box(true)) || $action == 'activate')
- {
- $sql = 'UPDATE ' . STYLES_TABLE . '
- SET style_active = ' . (($action == 'activate') ? 1 : 0) . '
- WHERE style_id = ' . $style_id;
- $db->sql_query($sql);
-
- // Set style to default for any member using deactivated style
- if ($action == 'deactivate')
- {
- $sql = 'UPDATE ' . USERS_TABLE . '
- SET user_style = ' . $config['default_style'] . "
- WHERE user_style = $style_id";
- $db->sql_query($sql);
-
- $sql = 'UPDATE ' . FORUMS_TABLE . '
- SET forum_style = 0
- WHERE forum_style = ' . $style_id;
- $db->sql_query($sql);
- }
- }
- else if ($action == 'deactivate')
- {
- $s_hidden_fields = array(
- 'i' => $id,
- 'mode' => $mode,
- 'action' => $action,
- 'style_id' => $style_id,
- );
- confirm_box(false, $user->lang['CONFIRM_OPERATION'], build_hidden_fields($s_hidden_fields));
- }
- break;
- }
-
- $this->frontend('style', array('details'), array('export', 'delete'));
- break;
-
- case 'template':
-
- switch ($action)
- {
- // Refresh template data stored in db and clear cache
- case 'refresh':
-
- $sql = 'SELECT *
- FROM ' . STYLES_TEMPLATE_TABLE . "
- WHERE template_id = $style_id";
- $result = $db->sql_query($sql);
- $template_row = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
-
- if (!$template_row)
- {
- trigger_error($user->lang['NO_TEMPLATE'] . adm_back_link($this->u_action), E_USER_WARNING);
- }
-
- if (confirm_box(true))
- {
- $template_refreshed = '';
-
- // Only refresh database if the template is stored in the database
- if ($template_row['template_storedb'] && file_exists("{$phpbb_root_path}styles/{$template_row['template_path']}/template/"))
- {
- $filelist = array('' => array());
-
- $sql = 'SELECT template_filename, template_mtime
- FROM ' . STYLES_TEMPLATE_DATA_TABLE . "
- WHERE template_id = $style_id";
- $result = $db->sql_query($sql);
-
- while ($row = $db->sql_fetchrow($result))
- {
-// if (@filemtime("{$phpbb_root_path}styles/{$template_row['template_path']}/template/" . $row['template_filename']) > $row['template_mtime'])
-// {
- // get folder info from the filename
- if (($slash_pos = strrpos($row['template_filename'], '/')) === false)
- {
- $filelist[''][] = $row['template_filename'];
- }
- else
- {
- $filelist[substr($row['template_filename'], 0, $slash_pos + 1)][] = substr($row['template_filename'], $slash_pos + 1, strlen($row['template_filename']) - $slash_pos - 1);
- }
-// }
- }
- $db->sql_freeresult($result);
-
- $this->store_templates('update', $style_id, $template_row['template_path'], $filelist);
- unset($filelist);
-
- $template_refreshed = $user->lang['TEMPLATE_REFRESHED'] . '<br />';
- add_log('admin', 'LOG_TEMPLATE_REFRESHED', $template_row['template_name']);
- }
-
- $this->clear_template_cache($template_row);
-
- trigger_error($template_refreshed . $user->lang['TEMPLATE_CACHE_CLEARED'] . adm_back_link($this->u_action));
- }
- else
- {
- confirm_box(false, ($template_row['template_storedb']) ? $user->lang['CONFIRM_TEMPLATE_REFRESH'] : $user->lang['CONFIRM_TEMPLATE_CLEAR_CACHE'], build_hidden_fields(array(
- 'i' => $id,
- 'mode' => $mode,
- 'action' => $action,
- 'id' => $style_id
- )));
- }
-
- break;
- }
-
- $this->frontend('template', array('edit', 'cache', 'details'), array('refresh', 'export', 'delete'));
- break;
-
- case 'theme':
-
- switch ($action)
- {
- // Refresh theme data stored in the database
- case 'refresh':
-
- $sql = 'SELECT *
- FROM ' . STYLES_THEME_TABLE . "
- WHERE theme_id = $style_id";
- $result = $db->sql_query($sql);
- $theme_row = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
-
- if (!$theme_row)
- {
- trigger_error($user->lang['NO_THEME'] . adm_back_link($this->u_action), E_USER_WARNING);
- }
-
- if (!$theme_row['theme_storedb'])
- {
- trigger_error($user->lang['THEME_ERR_REFRESH_FS'] . adm_back_link($this->u_action), E_USER_WARNING);
- }
-
- if (confirm_box(true))
- {
- if ($theme_row['theme_storedb'] && file_exists("{$phpbb_root_path}styles/{$theme_row['theme_path']}/theme/stylesheet.css"))
- {
- // Save CSS contents
- $sql_ary = array(
- 'theme_mtime' => (int) filemtime("{$phpbb_root_path}styles/{$theme_row['theme_path']}/theme/stylesheet.css"),
- 'theme_data' => $this->db_theme_data($theme_row)
- );
-
- $sql = 'UPDATE ' . STYLES_THEME_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . "
- WHERE theme_id = $style_id";
- $db->sql_query($sql);
-
- $cache->destroy('sql', STYLES_THEME_TABLE);
-
- add_log('admin', 'LOG_THEME_REFRESHED', $theme_row['theme_name']);
- trigger_error($user->lang['THEME_REFRESHED'] . adm_back_link($this->u_action));
- }
- }
- else
- {
- confirm_box(false, $user->lang['CONFIRM_THEME_REFRESH'], build_hidden_fields(array(
- 'i' => $id,
- 'mode' => $mode,
- 'action' => $action,
- 'id' => $style_id
- )));
- }
- break;
- }
-
- $this->frontend('theme', array('edit', 'details'), array('refresh', 'export', 'delete'));
- break;
-
- case 'imageset':
-
- switch ($action)
- {
- case 'refresh':
-
- $sql = 'SELECT *
- FROM ' . STYLES_IMAGESET_TABLE . "
- WHERE imageset_id = $style_id";
- $result = $db->sql_query($sql);
- $imageset_row = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
-
- if (!$imageset_row)
- {
- trigger_error($user->lang['NO_IMAGESET'] . adm_back_link($this->u_action), E_USER_WARNING);
- }
-
- if (confirm_box(true))
- {
- $sql_ary = array();
-
- $imageset_definitions = array();
- foreach ($this->imageset_keys as $topic => $key_array)
- {
- $imageset_definitions = array_merge($imageset_definitions, $key_array);
- }
-
- $cfg_data_imageset = parse_cfg_file("{$phpbb_root_path}styles/{$imageset_row['imageset_path']}/imageset/imageset.cfg");
-
- $db->sql_transaction('begin');
-
- $sql = 'DELETE FROM ' . STYLES_IMAGESET_DATA_TABLE . '
- WHERE imageset_id = ' . $style_id;
- $result = $db->sql_query($sql);
-
- foreach ($cfg_data_imageset as $image_name => $value)
- {
- if (strpos($value, '*') !== false)
- {
- if (substr($value, -1, 1) === '*')
- {
- list($image_filename, $image_height) = explode('*', $value);
- $image_width = 0;
- }
- else
- {
- list($image_filename, $image_height, $image_width) = explode('*', $value);
- }
- }
- else
- {
- $image_filename = $value;
- $image_height = $image_width = 0;
- }
-
- if (strpos($image_name, 'img_') === 0 && $image_filename)
- {
- $image_name = substr($image_name, 4);
- if (in_array($image_name, $imageset_definitions))
- {
- $sql_ary[] = array(
- 'image_name' => (string) $image_name,
- 'image_filename' => (string) $image_filename,
- 'image_height' => (int) $image_height,
- 'image_width' => (int) $image_width,
- 'imageset_id' => (int) $style_id,
- 'image_lang' => '',
- );
- }
- }
- }
-
- $sql = 'SELECT lang_dir
- FROM ' . LANG_TABLE;
- $result = $db->sql_query($sql);
-
- while ($row = $db->sql_fetchrow($result))
- {
- if (@file_exists("{$phpbb_root_path}styles/{$imageset_row['imageset_path']}/imageset/{$row['lang_dir']}/imageset.cfg"))
- {
- $cfg_data_imageset_data = parse_cfg_file("{$phpbb_root_path}styles/{$imageset_row['imageset_path']}/imageset/{$row['lang_dir']}/imageset.cfg");
- foreach ($cfg_data_imageset_data as $image_name => $value)
- {
- if (strpos($value, '*') !== false)
- {
- if (substr($value, -1, 1) === '*')
- {
- list($image_filename, $image_height) = explode('*', $value);
- $image_width = 0;
- }
- else
- {
- list($image_filename, $image_height, $image_width) = explode('*', $value);
- }
- }
- else
- {
- $image_filename = $value;
- $image_height = $image_width = 0;
- }
-
- if (strpos($image_name, 'img_') === 0 && $image_filename)
- {
- $image_name = substr($image_name, 4);
- if (in_array($image_name, $imageset_definitions))
- {
- $sql_ary[] = array(
- 'image_name' => (string) $image_name,
- 'image_filename' => (string) $image_filename,
- 'image_height' => (int) $image_height,
- 'image_width' => (int) $image_width,
- 'imageset_id' => (int) $style_id,
- 'image_lang' => (string) $row['lang_dir'],
- );
- }
- }
- }
- }
- }
- $db->sql_freeresult($result);
-
- $db->sql_multi_insert(STYLES_IMAGESET_DATA_TABLE, $sql_ary);
-
- $db->sql_transaction('commit');
-
- $cache->destroy('sql', STYLES_IMAGESET_DATA_TABLE);
- $cache->destroy('imageset_site_logo_md5');
-
- add_log('admin', 'LOG_IMAGESET_REFRESHED', $imageset_row['imageset_name']);
- trigger_error($user->lang['IMAGESET_REFRESHED'] . adm_back_link($this->u_action));
- }
- else
- {
- confirm_box(false, $user->lang['CONFIRM_IMAGESET_REFRESH'], build_hidden_fields(array(
- 'i' => $id,
- 'mode' => $mode,
- 'action' => $action,
- 'id' => $style_id
- )));
- }
- break;
- }
-
- $this->frontend('imageset', array('edit', 'details'), array('refresh', 'export', 'delete'));
- break;
- }
- }
-
- /**
- * Build Frontend with supplied options
- */
- function frontend($mode, $options, $actions)
+ public function main($id, $mode)
{
- global $user, $template, $db, $config, $phpbb_root_path, $phpEx;
-
- $sql_from = '';
- $sql_sort = 'LOWER(' . $mode . '_name)';
- $style_count = array();
-
- switch ($mode)
- {
- case 'style':
- $sql_from = STYLES_TABLE;
- $sql_sort = 'style_active DESC, ' . $sql_sort;
-
- $sql = 'SELECT user_style, COUNT(user_style) AS style_count
- FROM ' . USERS_TABLE . '
- GROUP BY user_style';
- $result = $db->sql_query($sql);
-
- while ($row = $db->sql_fetchrow($result))
- {
- $style_count[$row['user_style']] = $row['style_count'];
- }
- $db->sql_freeresult($result);
-
- break;
-
- case 'template':
- $sql_from = STYLES_TEMPLATE_TABLE;
- break;
-
- case 'theme':
- $sql_from = STYLES_THEME_TABLE;
- break;
-
- case 'imageset':
- $sql_from = STYLES_IMAGESET_TABLE;
- break;
-
- default:
- trigger_error($user->lang['NO_MODE'] . adm_back_link($this->u_action), E_USER_WARNING);
- }
-
- $l_prefix = strtoupper($mode);
-
- $this->page_title = 'ACP_' . $l_prefix . 'S';
-
- $template->assign_vars(array(
- 'S_FRONTEND' => true,
- 'S_STYLE' => ($mode == 'style') ? true : false,
-
- 'L_TITLE' => $user->lang[$this->page_title],
- 'L_EXPLAIN' => $user->lang[$this->page_title . '_EXPLAIN'],
- 'L_NAME' => $user->lang[$l_prefix . '_NAME'],
- 'L_INSTALLED' => $user->lang['INSTALLED_' . $l_prefix],
- 'L_UNINSTALLED' => $user->lang['UNINSTALLED_' . $l_prefix],
- 'L_NO_UNINSTALLED' => $user->lang['NO_UNINSTALLED_' . $l_prefix],
- 'L_CREATE' => $user->lang['CREATE_' . $l_prefix],
-
- 'U_ACTION' => $this->u_action,
- )
+ global $db, $user, $phpbb_admin_path, $phpbb_root_path, $phpEx, $template, $request, $cache, $auth, $config, $phpbb_dispatcher;
+
+ $this->db = $db;
+ $this->user = $user;
+ $this->template = $template;
+ $this->request = $request;
+ $this->cache = $cache;
+ $this->auth = $auth;
+ $this->config = $config;
+ $this->phpbb_root_path = $phpbb_root_path;
+ $this->php_ext = $phpEx;
+ $this->dispatcher = $phpbb_dispatcher;
+
+ $this->default_style = $config['default_style'];
+ $this->styles_path = $this->phpbb_root_path . $this->styles_path_absolute . '/';
+
+ $this->u_base_action = append_sid("{$phpbb_admin_path}index.{$this->php_ext}", "i={$id}");
+ $this->s_hidden_fields = array(
+ 'mode' => $mode,
);
- $sql = "SELECT *
- FROM $sql_from
- ORDER BY $sql_sort ASC";
- $result = $db->sql_query($sql);
-
- $installed = array();
+ $this->user->add_lang('acp/styles');
- $basis_options = '<option class="sep" value="">' . $user->lang['OPTIONAL_BASIS'] . '</option>';
- while ($row = $db->sql_fetchrow($result))
- {
- $installed[] = $row[$mode . '_name'];
- $basis_options .= '<option value="' . $row[$mode . '_id'] . '">' . $row[$mode . '_name'] . '</option>';
-
- $stylevis = ($mode == 'style' && !$row['style_active']) ? 'activate' : 'deactivate';
+ $this->tpl_name = 'acp_styles';
+ $this->page_title = 'ACP_CAT_STYLES';
+ $this->mode = $mode;
- $s_options = array();
- foreach ($options as $option)
- {
- $s_options[] = '<a href="' . $this->u_action . "&amp;action=$option&amp;id=" . $row[$mode . '_id'] . '">' . $user->lang[strtoupper($option)] . '</a>';
- }
+ $action = $this->request->variable('action', '');
+ $post_actions = array('install', 'activate', 'deactivate', 'uninstall');
- $s_actions = array();
- foreach ($actions as $option)
+ foreach ($post_actions as $key)
+ {
+ if ($this->request->is_set_post($key))
{
- $s_actions[] = '<a href="' . $this->u_action . "&amp;action=$option&amp;id=" . $row[$mode . '_id'] . '">' . $user->lang[strtoupper($option)] . '</a>';
+ $action = $key;
}
-
- $template->assign_block_vars('installed', array(
- 'S_DEFAULT_STYLE' => ($mode == 'style' && $row['style_id'] == $config['default_style']) ? true : false,
- 'U_EDIT' => $this->u_action . '&amp;action=' . (($mode == 'style') ? 'details' : 'edit') . '&amp;id=' . $row[$mode . '_id'],
- 'U_STYLE_ACT_DEACT' => $this->u_action . '&amp;action=' . $stylevis . '&amp;id=' . $row[$mode . '_id'],
- 'L_STYLE_ACT_DEACT' => $user->lang['STYLE_' . strtoupper($stylevis)],
- 'S_OPTIONS' => implode(' | ', $s_options),
- 'S_ACTIONS' => implode(' | ', $s_actions),
- 'U_PREVIEW' => ($mode == 'style') ? append_sid("{$phpbb_root_path}index.$phpEx", "$mode=" . $row[$mode . '_id']) : '',
-
- 'NAME' => $row[$mode . '_name'],
- 'STYLE_COUNT' => ($mode == 'style' && isset($style_count[$row['style_id']])) ? $style_count[$row['style_id']] : 0,
-
- 'S_INACTIVE' => ($mode == 'style' && !$row['style_active']) ? true : false,
- )
- );
}
- $db->sql_freeresult($result);
-
- // Grab uninstalled items
- $new_ary = $cfg = array();
- $dp = @opendir("{$phpbb_root_path}styles");
-
- if ($dp)
+ // The uninstall action uses confirm_box() to verify the validity of the request,
+ // so there is no need to check for a valid token here.
+ if (in_array($action, $post_actions) && $action != 'uninstall')
{
- while (($file = readdir($dp)) !== false)
- {
- if ($file[0] == '.' || !is_dir($phpbb_root_path . 'styles/' . $file))
- {
- continue;
- }
-
- $subpath = ($mode != 'style') ? "$mode/" : '';
- if (file_exists("{$phpbb_root_path}styles/$file/$subpath$mode.cfg"))
- {
- if ($cfg = file("{$phpbb_root_path}styles/$file/$subpath$mode.cfg"))
- {
- $items = parse_cfg_file('', $cfg);
- $name = (isset($items['name'])) ? trim($items['name']) : false;
+ $is_valid_request = check_link_hash($request->variable('hash', ''), $action) || check_form_key('styles_management');
- if ($name && !in_array($name, $installed))
- {
- // The array key is used for sorting later on.
- // $file is appended because $name doesn't have to be unique.
- $new_ary[$name . $file] = array(
- 'path' => $file,
- 'name' => $name,
- 'copyright' => $items['copyright'],
- );
- }
- }
- }
+ if (!$is_valid_request)
+ {
+ trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING);
}
- closedir($dp);
}
- unset($installed);
-
- if (sizeof($new_ary))
+ if ($action != '')
{
- ksort($new_ary);
-
- foreach ($new_ary as $cfg)
- {
- $template->assign_block_vars('uninstalled', array(
- 'NAME' => $cfg['name'],
- 'COPYRIGHT' => $cfg['copyright'],
- 'U_INSTALL' => $this->u_action . '&amp;action=install&amp;path=' . urlencode($cfg['path']))
- );
- }
+ $this->s_hidden_fields['action'] = $action;
}
- unset($new_ary);
- $template->assign_vars(array(
- 'S_BASIS_OPTIONS' => $basis_options)
+ $this->template->assign_vars(array(
+ 'U_ACTION' => $this->u_base_action,
+ 'S_HIDDEN_FIELDS' => build_hidden_fields($this->s_hidden_fields)
+ )
);
+ /**
+ * Run code before ACP styles action execution
+ *
+ * @event core.acp_styles_action_before
+ * @var int id Module ID
+ * @var string mode Active module
+ * @var string action Module that should be run
+ * @since 3.1.7-RC1
+ */
+ $vars = array('id', 'mode', 'action');
+ extract($this->dispatcher->trigger_event('core.acp_styles_action_before', compact($vars)));
+
+ // Execute actions
+ switch ($action)
+ {
+ case 'install':
+ $this->action_install();
+ return;
+ case 'uninstall':
+ $this->action_uninstall();
+ return;
+ case 'activate':
+ $this->action_activate();
+ return;
+ case 'deactivate':
+ $this->action_deactivate();
+ return;
+ case 'details':
+ $this->action_details();
+ return;
+ default:
+ $this->frontend();
+ }
}
/**
- * Provides a template editor which allows saving changes to template files on the filesystem or in the database.
- *
- * @param int $template_id specifies which template set is being edited
+ * Main page
*/
- function edit_template($template_id)
+ protected function frontend()
{
- global $phpbb_root_path, $phpEx, $config, $db, $cache, $user, $template, $safe_mode;
+ add_form_key('styles_management');
- if (defined('PHPBB_DISABLE_ACP_EDITOR'))
+ // Check mode
+ switch ($this->mode)
{
- trigger_error($user->lang['EDITOR_DISABLED'] . adm_back_link($this->u_action));
+ case 'style':
+ $this->welcome_message('ACP_STYLES', 'ACP_STYLES_EXPLAIN');
+ $this->show_installed();
+ return;
+ case 'install':
+ $this->welcome_message('INSTALL_STYLES', 'INSTALL_STYLES_EXPLAIN');
+ $this->show_available();
+ return;
}
+ trigger_error($this->user->lang['NO_MODE'] . adm_back_link($this->u_action), E_USER_WARNING);
+ }
- $this->page_title = 'EDIT_TEMPLATE';
-
- $filelist = $filelist_cats = array();
-
- $template_data = utf8_normalize_nfc(request_var('template_data', '', true));
- $template_data = htmlspecialchars_decode($template_data);
- $template_file = utf8_normalize_nfc(request_var('template_file', '', true));
- $text_rows = max(5, min(999, request_var('text_rows', 20)));
- $save_changes = (isset($_POST['save'])) ? true : false;
-
- // make sure template_file path doesn't go upwards
- $template_file = preg_replace('#\.{2,}#', '.', $template_file);
-
- // Retrieve some information about the template
- $sql = 'SELECT template_storedb, template_path, template_name
- FROM ' . STYLES_TEMPLATE_TABLE . "
- WHERE template_id = $template_id";
- $result = $db->sql_query($sql);
- $template_info = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
-
- if (!$template_info)
- {
- trigger_error($user->lang['NO_TEMPLATE'] . adm_back_link($this->u_action), E_USER_WARNING);
- }
+ /**
+ * Install style(s)
+ */
+ protected function action_install()
+ {
+ // Get list of styles to install
+ $dirs = $this->request_vars('dir', '', true);
- if ($save_changes && !check_form_key('acp_styles'))
- {
- trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING);
- }
- else if (!$save_changes)
- {
- add_form_key('acp_styles');
- }
+ // Get list of styles that can be installed
+ $styles = $this->find_available(false);
- // save changes to the template if the user submitted any
- if ($save_changes && $template_file)
+ // Install each style
+ $messages = array();
+ $installed_names = array();
+ $installed_dirs = array();
+ $last_installed = false;
+ foreach ($dirs as $dir)
{
- // Get the filesystem location of the current file
- $file = "{$phpbb_root_path}styles/{$template_info['template_path']}/template/$template_file";
- $additional = '';
-
- // If the template is stored on the filesystem try to write the file else store it in the database
- if (!$safe_mode && !$template_info['template_storedb'] && file_exists($file) && phpbb_is_writable($file))
+ if (in_array($dir, $this->reserved_style_names))
{
- if (!($fp = @fopen($file, 'wb')))
- {
- // File exists and is writeable, but still not able to be written to
- trigger_error(sprintf($user->lang['TEMPLATE_FILE_NOT_WRITABLE'], htmlspecialchars($template_file)) . adm_back_link($this->u_action), E_USER_WARNING);
- }
- fwrite($fp, $template_data);
- fclose($fp);
- }
- else
- {
- $db->sql_transaction('begin');
-
- // If it's not stored in the db yet, then update the template setting and store all template files in the db
- if (!$template_info['template_storedb'])
- {
- if ($super = $this->get_super('template', $template_id))
- {
- $this->store_in_db('template', $super['template_id']);
- }
- else
- {
- $this->store_in_db('template', $template_id);
- }
-
- add_log('admin', 'LOG_TEMPLATE_EDIT_DETAILS', $template_info['template_name']);
- $additional .= '<br />' . $user->lang['EDIT_TEMPLATE_STORED_DB'];
- }
-
- // Update the template_data table entry for this template file
- $sql = 'UPDATE ' . STYLES_TEMPLATE_DATA_TABLE . "
- SET template_data = '" . $db->sql_escape($template_data) . "', template_mtime = " . time() . "
- WHERE template_id = $template_id
- AND template_filename = '" . $db->sql_escape($template_file) . "'";
- $db->sql_query($sql);
-
- $db->sql_transaction('commit');
+ $messages[] = $this->user->lang('STYLE_NAME_RESERVED', htmlspecialchars($dir));
+ continue;
}
- // destroy the cached version of the template (filename without extension)
- $this->clear_template_cache($template_info, array(substr($template_file, 0, -5)));
-
- $cache->destroy('sql', STYLES_TABLE);
-
- add_log('admin', 'LOG_TEMPLATE_EDIT', $template_info['template_name'], $template_file);
- trigger_error($user->lang['TEMPLATE_FILE_UPDATED'] . $additional . adm_back_link($this->u_action . "&amp;action=edit&amp;id=$template_id&amp;text_rows=$text_rows&amp;template_file=$template_file"));
- }
-
- // Generate a category array containing template filenames
- if (!$template_info['template_storedb'])
- {
- $template_path = "{$phpbb_root_path}styles/{$template_info['template_path']}/template";
-
- $filelist = filelist($template_path, '', 'html');
- $filelist[''] = array_diff($filelist[''], array('bbcode.html'));
-
- if ($template_file)
+ $found = false;
+ foreach ($styles as &$style)
{
- if (!file_exists($template_path . "/$template_file") || !($template_data = file_get_contents($template_path . "/$template_file")))
+ // Check if:
+ // 1. Directory matches directory we are looking for
+ // 2. Style is not installed yet
+ // 3. Style with same name or directory hasn't been installed already within this function
+ if ($style['style_path'] == $dir && empty($style['_installed']) && !in_array($style['style_path'], $installed_dirs) && !in_array($style['style_name'], $installed_names))
{
- trigger_error($user->lang['NO_TEMPLATE'] . adm_back_link($this->u_action), E_USER_WARNING);
+ // Install style
+ $style['style_active'] = 1;
+ $style['style_id'] = $this->install_style($style);
+ $style['_installed'] = true;
+ $found = true;
+ $last_installed = $style['style_id'];
+ $installed_names[] = $style['style_name'];
+ $installed_dirs[] = $style['style_path'];
+ $messages[] = sprintf($this->user->lang['STYLE_INSTALLED'], htmlspecialchars($style['style_name']));
}
}
- }
- else
- {
- $sql = 'SELECT *
- FROM ' . STYLES_TEMPLATE_DATA_TABLE . "
- WHERE template_id = $template_id";
- $result = $db->sql_query($sql);
-
- $filelist = array('' => array());
- while ($row = $db->sql_fetchrow($result))
+ if (!$found)
{
- $file_info = pathinfo($row['template_filename']);
-
- if (($file_info['basename'] != 'bbcode') && ($file_info['extension'] == 'html'))
- {
- if (($file_info['dirname'] == '.') || empty($file_info['dirname']))
- {
- $filelist[''][] = $row['template_filename'];
- }
- else
- {
- $filelist[$file_info['dirname'] . '/'][] = $file_info['basename'];
- }
- }
-
- if ($row['template_filename'] == $template_file)
- {
- $template_data = $row['template_data'];
- }
+ $messages[] = sprintf($this->user->lang['STYLE_NOT_INSTALLED'], htmlspecialchars($dir));
}
- $db->sql_freeresult($result);
- unset($file_info);
}
- if (empty($filelist['']))
+ // Show message
+ if (!count($messages))
{
- trigger_error($user->lang['NO_TEMPLATE'] . adm_back_link($this->u_action), E_USER_WARNING);
+ trigger_error($this->user->lang['NO_MATCHING_STYLES_FOUND'] . adm_back_link($this->u_action), E_USER_WARNING);
}
+ $message = implode('<br />', $messages);
+ $message .= '<br /><br /><a href="' . $this->u_base_action . '&amp;mode=style' . '">&laquo; ' . $this->user->lang('STYLE_INSTALLED_RETURN_INSTALLED_STYLES') . '</a>';
+ $message .= '<br /><br /><a href="' . $this->u_base_action . '&amp;mode=install' . '">&raquo; ' . $this->user->lang('STYLE_INSTALLED_RETURN_UNINSTALLED_STYLES') . '</a>';
+ trigger_error($message, E_USER_NOTICE);
+ }
- // Now create the categories
- $filelist_cats[''] = array();
- foreach ($filelist as $pathfile => $file_ary)
- {
- // Use the directory name as category name
- if (!empty($pathfile))
- {
- $filelist_cats[$pathfile] = array();
- foreach ($file_ary as $file)
- {
- $filelist_cats[$pathfile][$pathfile . $file] = $file;
- }
- }
- // or if it's in the main category use the word before the first underscore to group files
- else
- {
- $cats = array();
- foreach ($file_ary as $file)
- {
- $cats[] = substr($file, 0, strpos($file, '_'));
- $filelist_cats[substr($file, 0, strpos($file, '_'))][$file] = $file;
- }
-
- $cats = array_values(array_unique($cats));
-
- // we don't need any single element categories so put them into the misc '' category
- for ($i = 0, $n = sizeof($cats); $i < $n; $i++)
- {
- if (sizeof($filelist_cats[$cats[$i]]) == 1 && $cats[$i] !== '')
- {
- $filelist_cats[''][key($filelist_cats[$cats[$i]])] = current($filelist_cats[$cats[$i]]);
- unset($filelist_cats[$cats[$i]]);
- }
- }
- unset($cats);
- }
- }
- unset($filelist);
+ /**
+ * Confirm styles removal
+ */
+ protected function action_uninstall()
+ {
+ // Get list of styles to uninstall
+ $ids = $this->request_vars('id', 0, true);
- // Generate list of categorised template files
- $tpl_options = '';
- ksort($filelist_cats);
- foreach ($filelist_cats as $category => $tpl_ary)
+ // Check if confirmation box was submitted
+ if (confirm_box(true))
{
- ksort($tpl_ary);
-
- if (!empty($category))
- {
- $tpl_options .= '<option class="sep" value="">' . $category . '</option>';
- }
-
- foreach ($tpl_ary as $filename => $file)
- {
- $selected = ($template_file == $filename) ? ' selected="selected"' : '';
- $tpl_options .= '<option value="' . $filename . '"' . $selected . '>' . $file . '</option>';
- }
+ // Uninstall
+ $this->action_uninstall_confirmed($ids, $this->request->variable('confirm_delete_files', false));
+ return;
}
- $template->assign_vars(array(
- 'S_EDIT_TEMPLATE' => true,
- 'S_HIDDEN_FIELDS' => build_hidden_fields(array('template_file' => $template_file)),
- 'S_TEMPLATES' => $tpl_options,
-
- 'U_ACTION' => $this->u_action . "&amp;action=edit&amp;id=$template_id&amp;text_rows=$text_rows",
- 'U_BACK' => $this->u_action,
-
- 'L_EDIT' => $user->lang['EDIT_TEMPLATE'],
- 'L_EDIT_EXPLAIN' => $user->lang['EDIT_TEMPLATE_EXPLAIN'],
- 'L_EDITOR' => $user->lang['TEMPLATE_EDITOR'],
- 'L_EDITOR_HEIGHT' => $user->lang['TEMPLATE_EDITOR_HEIGHT'],
- 'L_FILE' => $user->lang['TEMPLATE_FILE'],
- 'L_SELECT' => $user->lang['SELECT_TEMPLATE'],
- 'L_SELECTED' => $user->lang['SELECTED_TEMPLATE'],
- 'L_SELECTED_FILE' => $user->lang['SELECTED_TEMPLATE_FILE'],
-
- 'SELECTED_TEMPLATE' => $template_info['template_name'],
- 'TEMPLATE_FILE' => $template_file,
- 'TEMPLATE_DATA' => utf8_htmlspecialchars($template_data),
- 'TEXT_ROWS' => $text_rows)
- );
+ // Confirm box
+ $s_hidden = build_hidden_fields(array(
+ 'action' => 'uninstall',
+ 'ids' => $ids
+ ));
+ $this->template->assign_var('S_CONFIRM_DELETE', true);
+ confirm_box(false, $this->user->lang['CONFIRM_UNINSTALL_STYLES'], $s_hidden, 'acp_styles.html');
+
+ // Canceled - show styles list
+ $this->frontend();
}
/**
- * Allows the admin to view cached versions of template files and clear single template cache files
+ * Uninstall styles(s)
*
- * @param int $template_id specifies which template's cache is shown
+ * @param array $ids List of style IDs
+ * @param bool $delete_files If true, script will attempt to remove files for selected styles
*/
- function template_cache($template_id)
+ protected function action_uninstall_confirmed($ids, $delete_files)
{
- global $phpbb_root_path, $phpEx, $config, $db, $cache, $user, $template;
-
- $source = str_replace('/', '.', request_var('source', ''));
- $file_ary = array_diff(request_var('delete', array('')), array(''));
- $submit = isset($_POST['submit']) ? true : false;
-
- $sql = 'SELECT *
- FROM ' . STYLES_TEMPLATE_TABLE . "
- WHERE template_id = $template_id";
- $result = $db->sql_query($sql);
- $template_row = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
-
- if (!$template_row)
- {
- trigger_error($user->lang['NO_TEMPLATE'] . adm_back_link($this->u_action), E_USER_WARNING);
- }
-
- // User wants to delete one or more files ...
- if ($submit && $file_ary)
- {
- $this->clear_template_cache($template_row, $file_ary);
- trigger_error($user->lang['TEMPLATE_CACHE_CLEARED'] . adm_back_link($this->u_action . "&amp;action=cache&amp;id=$template_id"));
- }
-
- $cache_prefix = 'tpl_' . str_replace('_', '-', $template_row['template_path']);
+ $default = $this->default_style;
+ $uninstalled = array();
+ $messages = array();
- // Someone wants to see the cached source ... so we'll highlight it,
- // add line numbers and indent it appropriately. This could be nasty
- // on larger source files ...
- if ($source && file_exists("{$phpbb_root_path}cache/{$cache_prefix}_$source.html.$phpEx"))
+ // Check styles list
+ foreach ($ids as $id)
{
- adm_page_header($user->lang['TEMPLATE_CACHE']);
-
- $template->set_filenames(array(
- 'body' => 'viewsource.html')
- );
-
- $template->assign_vars(array(
- 'FILENAME' => str_replace('.', '/', $source) . '.html')
- );
-
- $code = str_replace(array("\r\n", "\r"), array("\n", "\n"), file_get_contents("{$phpbb_root_path}cache/{$cache_prefix}_$source.html.$phpEx"));
-
- $conf = array('highlight.bg', 'highlight.comment', 'highlight.default', 'highlight.html', 'highlight.keyword', 'highlight.string');
- foreach ($conf as $ini_var)
+ if (!$id)
{
- @ini_set($ini_var, str_replace('highlight.', 'syntax', $ini_var));
+ trigger_error($this->user->lang['INVALID_STYLE_ID'] . adm_back_link($this->u_action), E_USER_WARNING);
}
-
- $marker = 'MARKER' . time();
- $code = highlight_string(str_replace("\n", $marker, $code), true);
- $code = str_replace($marker, "\n", $code);
- $str_from = array('<span style="color: ', '<font color="syntax', '</font>', '<code>', '</code>','[', ']', '.', ':');
- $str_to = array('<span class="', '<span class="syntax', '</span>', '', '', '&#91;', '&#93;', '&#46;', '&#58;');
-
- $code = str_replace($str_from, $str_to, $code);
- $code = preg_replace('#^(<span class="[a-z_]+">)\n?(.*?)\n?(</span>)$#ism', '$1$2$3', $code);
- $code = substr($code, strlen('<span class="syntaxhtml">'));
- $code = substr($code, 0, -1 * strlen('</ span>'));
- $code = explode("\n", $code);
-
- foreach ($code as $key => $line)
+ if ($id == $default)
{
- $template->assign_block_vars('source', array(
- 'LINENUM' => $key + 1,
- 'LINE' => preg_replace('#([^ ;])&nbsp;([^ &])#', '$1 $2', $line))
- );
- unset($code[$key]);
+ trigger_error($this->user->lang['UNINSTALL_DEFAULT'] . adm_back_link($this->u_action), E_USER_WARNING);
}
-
- adm_page_footer();
+ $uninstalled[$id] = false;
}
- $filemtime = array();
- if ($template_row['template_storedb'])
- {
- $ids = array();
- if (isset($template_row['template_inherits_id']) && $template_row['template_inherits_id'])
- {
- $ids[] = $template_row['template_inherits_id'];
- }
- $ids[] = $template_row['template_id'];
-
- $filemtime = array();
- $file_template_db = array();
-
- foreach ($ids as $id)
- {
- $sql = 'SELECT template_filename, template_mtime
- FROM ' . STYLES_TEMPLATE_DATA_TABLE . "
- WHERE template_id = $id";
- $result = $db->sql_query($sql);
-
- while ($row = $db->sql_fetchrow($result))
- {
- $filemtime[$row['template_filename']] = $row['template_mtime'];
- $file_template_db[$row['template_filename']] = $id;
- }
- $db->sql_freeresult($result);
- }
- }
+ // Order by reversed style_id, so parent styles would be removed after child styles
+ // This way parent and child styles can be removed in same function call
+ $sql = 'SELECT *
+ FROM ' . STYLES_TABLE . '
+ WHERE style_id IN (' . implode(', ', $ids) . ')
+ ORDER BY style_id DESC';
+ $result = $this->db->sql_query($sql);
- // Get a list of cached template files and then retrieve additional information about them
- $file_ary = $this->template_cache_filelist($template_row['template_path']);
+ $rows = $this->db->sql_fetchrowset($result);
+ $this->db->sql_freeresult($result);
- foreach ($file_ary as $file)
+ // Uinstall each style
+ $uninstalled = array();
+ foreach ($rows as $style)
{
- $file = str_replace('/', '.', $file);
-
- // perform some dirty guessing to get the path right.
- // We assume that three dots in a row were '../'
- $tpl_file = str_replace('.', '/', $file);
- $tpl_file = str_replace('///', '../', $tpl_file);
-
- $filename = "{$cache_prefix}_$file.html.$phpEx";
+ $result = $this->uninstall_style($style, $delete_files);
- if (!file_exists("{$phpbb_root_path}cache/$filename"))
+ if (is_string($result))
{
+ $messages[] = $result;
continue;
}
+ $messages[] = sprintf($this->user->lang['STYLE_UNINSTALLED'], $style['style_name']);
+ $uninstalled[] = $style['style_name'];
- $file_tpl = "{$phpbb_root_path}styles/{$template_row['template_path']}/template/$tpl_file.html";
- $inherited = false;
-
- if (isset($template_row['template_inherits_id']) && $template_row['template_inherits_id'])
+ // Attempt to delete files
+ if ($delete_files)
{
- if (!$template_row['template_storedb'])
- {
- if (!file_exists($file_tpl))
- {
- $file_tpl = "{$phpbb_root_path}styles/{$template_row['template_inherit_path']}/template/$tpl_file.html";
- $inherited = true;
- }
- }
- else
- {
- if ($file_template_db[$file . '.html'] == $template_row['template_inherits_id'])
- {
- $file_tpl = "{$phpbb_root_path}styles/{$template_row['template_inherit_path']}/template/$tpl_file.html";
- $inherited = true;
- }
- }
- }
-
- // Correct the filename if it is stored in database and the file is in a subfolder.
- if ($template_row['template_storedb'])
- {
- $file = str_replace('.', '/', $file);
+ $messages[] = sprintf($this->user->lang[$this->delete_style_files($style['style_path']) ? 'DELETE_STYLE_FILES_SUCCESS' : 'DELETE_STYLE_FILES_FAILED'], $style['style_name']);
}
+ }
- $template->assign_block_vars('file', array(
- 'U_VIEWSOURCE' => $this->u_action . "&amp;action=cache&amp;id=$template_id&amp;source=$file",
+ if (empty($messages))
+ {
+ // Nothing to uninstall?
+ trigger_error($this->user->lang['NO_MATCHING_STYLES_FOUND'] . adm_back_link($this->u_action), E_USER_WARNING);
+ }
- 'CACHED' => $user->format_date(filemtime("{$phpbb_root_path}cache/$filename")),
- 'FILENAME' => $file,
- 'FILENAME_PATH' => $file_tpl,
- 'FILESIZE' => get_formatted_filesize(filesize("{$phpbb_root_path}cache/$filename")),
- 'MODIFIED' => $user->format_date((!$template_row['template_storedb']) ? filemtime($file_tpl) : $filemtime[$file . '.html']))
- );
+ // Log action
+ if (count($uninstalled))
+ {
+ add_log('admin', 'LOG_STYLE_DELETE', implode(', ', $uninstalled));
}
- unset($filemtime);
- $template->assign_vars(array(
- 'S_CACHE' => true,
- 'S_TEMPLATE' => true,
+ // Clear cache
+ $this->cache->purge();
- 'U_ACTION' => $this->u_action . "&amp;action=cache&amp;id=$template_id",
- 'U_BACK' => $this->u_action)
- );
+ // Show message
+ trigger_error(implode('<br />', $messages) . adm_back_link($this->u_action), E_USER_NOTICE);
}
/**
- * Provides a css editor and a basic easier to use stylesheet editing tool for less experienced (or lazy) users
- *
- * @param int $theme_id specifies which theme is being edited
+ * Activate styles
*/
- function edit_theme($theme_id)
+ protected function action_activate()
{
- global $phpbb_root_path, $phpEx, $config, $db, $cache, $user, $template, $safe_mode;
-
- $this->page_title = 'EDIT_THEME';
-
- $filelist = $filelist_cats = array();
-
- $theme_data = utf8_normalize_nfc(request_var('template_data', '', true));
- $theme_data = htmlspecialchars_decode($theme_data);
- $theme_file = utf8_normalize_nfc(request_var('template_file', '', true));
- $text_rows = max(5, min(999, request_var('text_rows', 20)));
- $save_changes = (isset($_POST['save'])) ? true : false;
-
- // make sure theme_file path doesn't go upwards
- $theme_file = str_replace('..', '.', $theme_file);
-
- // Retrieve some information about the theme
- $sql = 'SELECT theme_storedb, theme_path, theme_name, theme_data
- FROM ' . STYLES_THEME_TABLE . "
- WHERE theme_id = $theme_id";
- $result = $db->sql_query($sql);
-
- if (!($theme_info = $db->sql_fetchrow($result)))
- {
- trigger_error($user->lang['NO_THEME'] . adm_back_link($this->u_action), E_USER_WARNING);
- }
- $db->sql_freeresult($result);
-
- // save changes to the theme if the user submitted any
- if ($save_changes)
- {
- // Get the filesystem location of the current file
- $file = "{$phpbb_root_path}styles/{$theme_info['theme_path']}/theme/$theme_file";
- $additional = '';
- $message = $user->lang['THEME_UPDATED'];
-
- // If the theme is stored on the filesystem try to write the file else store it in the database
- if (!$safe_mode && !$theme_info['theme_storedb'] && file_exists($file) && phpbb_is_writable($file))
- {
- if (!($fp = @fopen($file, 'wb')))
- {
- trigger_error($user->lang['NO_THEME'] . adm_back_link($this->u_action), E_USER_WARNING);
- }
- fwrite($fp, $theme_data);
- fclose($fp);
- }
- else
- {
- // Write stylesheet to db
- $sql_ary = array(
- 'theme_mtime' => time(),
- 'theme_storedb' => 1,
- 'theme_data' => $this->db_theme_data($theme_info, $theme_data),
- );
- $sql = 'UPDATE ' . STYLES_THEME_TABLE . '
- SET ' . $db->sql_build_array('UPDATE', $sql_ary) . '
- WHERE theme_id = ' . $theme_id;
- $db->sql_query($sql);
-
- $cache->destroy('sql', STYLES_THEME_TABLE);
+ // Get list of styles to activate
+ $ids = $this->request_vars('id', 0, true);
- // notify the user if the theme was not stored in the db before his modification
- if (!$theme_info['theme_storedb'])
- {
- add_log('admin', 'LOG_THEME_EDIT_DETAILS', $theme_info['theme_name']);
- $message .= '<br />' . $user->lang['EDIT_THEME_STORED_DB'];
- }
- }
- $cache->destroy('sql', STYLES_THEME_TABLE);
- add_log('admin', (!$theme_info['theme_storedb']) ? 'LOG_THEME_EDIT_FILE' : 'LOG_THEME_EDIT', $theme_info['theme_name'], (!$theme_info['theme_storedb']) ? $theme_file : '');
-
- trigger_error($message . adm_back_link($this->u_action . "&amp;action=edit&amp;id=$theme_id&amp;template_file=$theme_file&amp;text_rows=$text_rows"));
- }
+ // Activate styles
+ $sql = 'UPDATE ' . STYLES_TABLE . '
+ SET style_active = 1
+ WHERE style_id IN (' . implode(', ', $ids) . ')';
+ $this->db->sql_query($sql);
- // Generate a category array containing theme filenames
- if (!$theme_info['theme_storedb'])
- {
- $theme_path = "{$phpbb_root_path}styles/{$theme_info['theme_path']}/theme";
+ // Purge cache
+ $this->cache->destroy('sql', STYLES_TABLE);
- $filelist = filelist($theme_path, '', 'css');
+ // Show styles list
+ $this->frontend();
+ }
- if ($theme_file)
- {
- if (!file_exists($theme_path . "/$theme_file") || !($theme_data = file_get_contents($theme_path . "/$theme_file")))
- {
- trigger_error($user->lang['NO_THEME'] . adm_back_link($this->u_action), E_USER_WARNING);
- }
- }
- }
- else
- {
- $theme_data = &$theme_info['theme_data'];
- }
+ /**
+ * Deactivate styles
+ */
+ protected function action_deactivate()
+ {
+ // Get list of styles to deactivate
+ $ids = $this->request_vars('id', 0, true);
- // Now create the categories
- $filelist_cats[''] = array();
- foreach ($filelist as $pathfile => $file_ary)
+ // Check for default style
+ foreach ($ids as $id)
{
- // Use the directory name as category name
- if (!empty($pathfile))
- {
- $filelist_cats[$pathfile] = array();
- foreach ($file_ary as $file)
- {
- $filelist_cats[$pathfile][$pathfile . $file] = $file;
- }
- }
- // or if it's in the main category use the word before the first underscore to group files
- else
+ if ($id == $this->default_style)
{
- $cats = array();
- foreach ($file_ary as $file)
- {
- $cats[] = substr($file, 0, strpos($file, '_'));
- $filelist_cats[substr($file, 0, strpos($file, '_'))][$file] = $file;
- }
-
- $cats = array_values(array_unique($cats));
-
- // we don't need any single element categories so put them into the misc '' category
- for ($i = 0, $n = sizeof($cats); $i < $n; $i++)
- {
- if (sizeof($filelist_cats[$cats[$i]]) == 1 && $cats[$i] !== '')
- {
- $filelist_cats[''][key($filelist_cats[$cats[$i]])] = current($filelist_cats[$cats[$i]]);
- unset($filelist_cats[$cats[$i]]);
- }
- }
- unset($cats);
+ trigger_error($this->user->lang['DEACTIVATE_DEFAULT'] . adm_back_link($this->u_action), E_USER_WARNING);
}
}
- unset($filelist);
- // Generate list of categorised theme files
- $tpl_options = '';
- ksort($filelist_cats);
- foreach ($filelist_cats as $category => $tpl_ary)
- {
- ksort($tpl_ary);
+ // Reset default style for users who use selected styles
+ $sql = 'UPDATE ' . USERS_TABLE . '
+ SET user_style = 0
+ WHERE user_style IN (' . implode(', ', $ids) . ')';
+ $this->db->sql_query($sql);
- if (!empty($category))
- {
- $tpl_options .= '<option class="sep" value="">' . $category . '</option>';
- }
+ // Deactivate styles
+ $sql = 'UPDATE ' . STYLES_TABLE . '
+ SET style_active = 0
+ WHERE style_id IN (' . implode(', ', $ids) . ')';
+ $this->db->sql_query($sql);
- foreach ($tpl_ary as $filename => $file)
- {
- $selected = ($theme_file == $filename) ? ' selected="selected"' : '';
- $tpl_options .= '<option value="' . $filename . '"' . $selected . '>' . $file . '</option>';
- }
- }
+ // Purge cache
+ $this->cache->destroy('sql', STYLES_TABLE);
- $template->assign_vars(array(
- 'S_EDIT_THEME' => true,
- 'S_HIDDEN_FIELDS' => build_hidden_fields(array('template_file' => $theme_file)),
- 'S_THEME_IN_DB' => $theme_info['theme_storedb'],
- 'S_TEMPLATES' => $tpl_options,
-
- 'U_ACTION' => $this->u_action . "&amp;action=edit&amp;id=$theme_id&amp;text_rows=$text_rows",
- 'U_BACK' => $this->u_action,
-
- 'L_EDIT' => $user->lang['EDIT_THEME'],
- 'L_EDIT_EXPLAIN' => $user->lang['EDIT_THEME_EXPLAIN'],
- 'L_EDITOR' => $user->lang['THEME_EDITOR'],
- 'L_EDITOR_HEIGHT' => $user->lang['THEME_EDITOR_HEIGHT'],
- 'L_FILE' => $user->lang['THEME_FILE'],
- 'L_SELECT' => $user->lang['SELECT_THEME'],
- 'L_SELECTED' => $user->lang['SELECTED_THEME'],
- 'L_SELECTED_FILE' => $user->lang['SELECTED_THEME_FILE'],
-
- 'SELECTED_TEMPLATE' => $theme_info['theme_name'],
- 'TEMPLATE_FILE' => $theme_file,
- 'TEMPLATE_DATA' => utf8_htmlspecialchars($theme_data),
- 'TEXT_ROWS' => $text_rows)
- );
+ // Show styles list
+ $this->frontend();
}
/**
- * Edit imagesets
- *
- * @param int $imageset_id specifies which imageset is being edited
+ * Show style details
*/
- function edit_imageset($imageset_id)
+ protected function action_details()
{
- global $db, $user, $phpbb_root_path, $cache, $template;
-
- $this->page_title = 'EDIT_IMAGESET';
-
- if (!$imageset_id)
+ $id = $this->request->variable('id', 0);
+ if (!$id)
{
- trigger_error($user->lang['NO_IMAGESET'] . adm_back_link($this->u_action), E_USER_WARNING);
+ trigger_error($this->user->lang['NO_MATCHING_STYLES_FOUND'] . adm_back_link($this->u_action), E_USER_WARNING);
}
- $update = (isset($_POST['update'])) ? true : false;
-
- $imgname = request_var('imgname', 'site_logo');
- $imgname = preg_replace('#[^a-z0-9\-+_]#i', '', $imgname);
- $sql_extra = $imgnamelang = '';
-
- $sql = 'SELECT imageset_path, imageset_name
- FROM ' . STYLES_IMAGESET_TABLE . "
- WHERE imageset_id = $imageset_id";
- $result = $db->sql_query($sql);
- $imageset_row = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
+ // Get all styles
+ $styles = $this->get_styles();
+ usort($styles, array($this, 'sort_styles'));
- if (!$imageset_row)
+ // Find current style
+ $style = false;
+ foreach ($styles as $row)
{
- trigger_error($user->lang['NO_IMAGESET'] . adm_back_link($this->u_action), E_USER_WARNING);
- }
-
- $imageset_path = $imageset_row['imageset_path'];
- $imageset_name = $imageset_row['imageset_name'];
-
- if (strpos($imgname, '-') !== false)
- {
- list($imgname, $imgnamelang) = explode('-', $imgname);
- $sql_extra = " AND image_lang IN ('" . $db->sql_escape($imgnamelang) . "', '')";
- }
-
- $sql = 'SELECT image_filename, image_width, image_height, image_lang, image_id
- FROM ' . STYLES_IMAGESET_DATA_TABLE . "
- WHERE imageset_id = $imageset_id
- AND image_name = '" . $db->sql_escape($imgname) . "'$sql_extra";
- $result = $db->sql_query($sql);
- $imageset_data_row = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
-
- $image_filename = $imageset_data_row['image_filename'];
- $image_width = $imageset_data_row['image_width'];
- $image_height = $imageset_data_row['image_height'];
- $image_lang = $imageset_data_row['image_lang'];
- $image_id = $imageset_data_row['image_id'];
- $imgsize = ($imageset_data_row['image_width'] && $imageset_data_row['image_height']) ? 1 : 0;
-
- // Check to see whether the selected image exists in the table
- $valid_name = ($update) ? false : true;
-
- foreach ($this->imageset_keys as $category => $img_ary)
- {
- if (in_array($imgname, $img_ary))
+ if ($row['style_id'] == $id)
{
- $valid_name = true;
+ $style = $row;
break;
}
}
- if ($update && isset($_POST['imgpath']) && $valid_name)
+ if ($style === false)
{
- // If imgwidth and imgheight are non-zero grab the actual size
- // from the image itself ... we ignore width settings for the poll center image
- $imgwidth = request_var('imgwidth', 0);
- $imgheight = request_var('imgheight', 0);
- $imgsize = request_var('imgsize', 0);
- $imgpath = request_var('imgpath', '');
- $imgpath = str_replace('..', '.', $imgpath);
-
- // If no dimensions selected, we reset width and height to 0 ;)
- if (!$imgsize)
- {
- $imgwidth = $imgheight = 0;
- }
+ trigger_error($this->user->lang['NO_MATCHING_STYLES_FOUND'] . adm_back_link($this->u_action), E_USER_WARNING);
+ }
- $imglang = '';
+ // Read style configuration file
+ $style_cfg = $this->read_style_cfg($style['style_path']);
- if ($imgpath && !file_exists("{$phpbb_root_path}styles/$imageset_path/imageset/$imgpath"))
- {
- trigger_error($user->lang['NO_IMAGE_ERROR'] . adm_back_link($this->u_action), E_USER_WARNING);
- }
+ // Find all available parent styles
+ $list = $this->find_possible_parents($styles, $id);
- // Determine width/height. If dimensions included and no width/height given, we detect them automatically...
- if ($imgsize && $imgpath)
- {
- if (!$imgwidth || !$imgheight)
- {
- list($imgwidth_file, $imgheight_file) = getimagesize("{$phpbb_root_path}styles/$imageset_path/imageset/$imgpath");
- $imgwidth = ($imgwidth) ? $imgwidth : $imgwidth_file;
- $imgheight = ($imgheight) ? $imgheight : $imgheight_file;
- }
- $imgwidth = ($imgname != 'poll_center') ? (int) $imgwidth : 0;
- $imgheight = (int) $imgheight;
- }
+ // Add form key
+ $form_key = 'acp_styles';
+ add_form_key($form_key);
- if (strpos($imgpath, '/') !== false)
- {
- list($imglang, $imgfilename) = explode('/', $imgpath);
- }
- else
+ // Change data
+ if ($this->request->variable('update', false))
+ {
+ if (!check_form_key($form_key))
{
- $imgfilename = $imgpath;
+ trigger_error($this->user->lang['FORM_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING);
}
- $sql_ary = array(
- 'image_filename' => (string) $imgfilename,
- 'image_width' => (int) $imgwidth,
- 'image_height' => (int) $imgheight,
- 'image_lang' => (string) $imglang,
+ $update = array(
+ 'style_name' => trim($this->request->variable('style_name', $style['style_name'])),
+ 'style_parent_id' => $this->request->variable('style_parent', (int) $style['style_parent_id']),
+ 'style_active' => $this->request->variable('style_active', (int) $style['style_active']),
);
+ $update_action = $this->u_action . '&amp;action=details&amp;id=' . $id;
- // already exists
- if ($imageset_data_row)
- {
- $sql = 'UPDATE ' . STYLES_IMAGESET_DATA_TABLE . '
- SET ' . $db->sql_build_array('UPDATE', $sql_ary) . "
- WHERE image_id = $image_id";
- $db->sql_query($sql);
- }
- // does not exist
- else if (!$imageset_data_row)
+ // Check style name
+ if ($update['style_name'] != $style['style_name'])
{
- $sql_ary['image_name'] = $imgname;
- $sql_ary['imageset_id'] = (int) $imageset_id;
- $db->sql_query('INSERT INTO ' . STYLES_IMAGESET_DATA_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary));
- }
-
- $cache->destroy('sql', STYLES_IMAGESET_DATA_TABLE);
-
- add_log('admin', 'LOG_IMAGESET_EDIT', $imageset_name);
-
- $template->assign_var('SUCCESS', true);
-
- $image_filename = $imgfilename;
- $image_width = $imgwidth;
- $image_height = $imgheight;
- $image_lang = $imglang;
- }
-
- $imglang = '';
- $imagesetlist = array('nolang' => array(), 'lang' => array());
- $langs = array();
-
- $dir = "{$phpbb_root_path}styles/$imageset_path/imageset";
- $dp = @opendir($dir);
-
- if ($dp)
- {
- while (($file = readdir($dp)) !== false)
- {
- if ($file[0] != '.' && strtoupper($file) != 'CVS' && !is_file($dir . '/' . $file) && !is_link($dir . '/' . $file))
+ if (!strlen($update['style_name']))
{
- $langs[] = $file;
+ trigger_error($this->user->lang['STYLE_ERR_STYLE_NAME'] . adm_back_link($update_action), E_USER_WARNING);
}
- else if (preg_match('#\.(?:gif|jpg|png)$#', $file))
+ foreach ($styles as $row)
{
- $imagesetlist['nolang'][] = $file;
+ if ($row['style_name'] == $update['style_name'])
+ {
+ trigger_error($this->user->lang['STYLE_ERR_NAME_EXIST'] . adm_back_link($update_action), E_USER_WARNING);
+ }
}
}
-
- if ($sql_extra)
+ else
{
- $dp2 = @opendir("$dir/$imgnamelang");
+ unset($update['style_name']);
+ }
- if ($dp2)
+ // Check parent style id
+ if ($update['style_parent_id'] != $style['style_parent_id'])
+ {
+ if ($update['style_parent_id'] != 0)
{
- while (($file2 = readdir($dp2)) !== false)
+ $found = false;
+ foreach ($list as $row)
{
- if (preg_match('#\.(?:gif|jpg|png)$#', $file2))
+ if ($row['style_id'] == $update['style_parent_id'])
{
- $imagesetlist['lang'][] = "$imgnamelang/$file2";
+ $found = true;
+ $update['style_parent_tree'] = ($row['style_parent_tree'] != '' ? $row['style_parent_tree'] . '/' : '') . $row['style_path'];
+ break;
}
}
- closedir($dp2);
- }
- }
- closedir($dp);
- }
-
- // Generate list of image options
- $img_options = '';
- foreach ($this->imageset_keys as $category => $img_ary)
- {
- $template->assign_block_vars('category', array(
- 'NAME' => $user->lang['IMG_CAT_' . strtoupper($category)]
- ));
-
- foreach ($img_ary as $img)
- {
- if ($category == 'buttons')
- {
- foreach ($langs as $language)
+ if (!$found)
{
- $template->assign_block_vars('category.images', array(
- 'SELECTED' => ($img == $imgname && $language == $imgnamelang),
- 'VALUE' => $img . '-' . $language,
- 'TEXT' => $user->lang['IMG_' . strtoupper($img)] . ' [ ' . $language . ' ]'
- ));
+ trigger_error($this->user->lang['STYLE_ERR_INVALID_PARENT'] . adm_back_link($update_action), E_USER_WARNING);
}
}
else
{
- $template->assign_block_vars('category.images', array(
- 'SELECTED' => ($img == $imgname),
- 'VALUE' => $img,
- 'TEXT' => (($category == 'custom') ? $img : $user->lang['IMG_' . strtoupper($img)])
- ));
+ $update['style_parent_tree'] = '';
}
}
- }
-
- // Make sure the list of possible images is sorted alphabetically
- sort($imagesetlist['lang']);
- sort($imagesetlist['nolang']);
-
- $image_found = false;
- $img_val = '';
- foreach ($imagesetlist as $type => $img_ary)
- {
- if ($type !== 'lang' || $sql_extra)
+ else
{
- $template->assign_block_vars('imagesetlist', array(
- 'TYPE' => ($type == 'lang')
- ));
+ unset($update['style_parent_id']);
}
- foreach ($img_ary as $img)
+ // Check style_active
+ if ($update['style_active'] != $style['style_active'])
{
- $imgtext = preg_replace('/^([^\/]+\/)/', '', $img);
- $selected = (!empty($imgname) && strpos($image_filename, $imgtext) !== false);
- if ($selected)
+ if (!$update['style_active'] && $this->default_style == $style['style_id'])
{
- $image_found = true;
- $img_val = htmlspecialchars($img);
+ trigger_error($this->user->lang['DEACTIVATE_DEFAULT'] . adm_back_link($update_action), E_USER_WARNING);
}
- $template->assign_block_vars('imagesetlist.images', array(
- 'SELECTED' => $selected,
- 'TEXT' => $imgtext,
- 'VALUE' => htmlspecialchars($img)
- ));
}
- }
-
- $imgsize_bool = (!empty($imgname) && $image_width && $image_height) ? true : false;
- $image_request = '../styles/' . $imageset_path . '/imageset/' . ($image_lang ? $imgnamelang . '/' : '') . $image_filename;
-
- $template->assign_vars(array(
- 'S_EDIT_IMAGESET' => true,
- 'L_TITLE' => $user->lang[$this->page_title],
- 'L_EXPLAIN' => $user->lang[$this->page_title . '_EXPLAIN'],
- 'IMAGE_OPTIONS' => $img_options,
- 'IMAGE_SIZE' => $image_width,
- 'IMAGE_HEIGHT' => $image_height,
- 'IMAGE_REQUEST' => (empty($image_filename)) ? 'images/no_image.png' : $image_request,
- 'U_ACTION' => $this->u_action . "&amp;action=edit&amp;id=$imageset_id",
- 'U_BACK' => $this->u_action,
- 'NAME' => $imageset_name,
- 'A_NAME' => addslashes($imageset_name),
- 'PATH' => $imageset_path,
- 'A_PATH' => addslashes($imageset_path),
- 'ERROR' => !$valid_name,
- 'IMG_SRC' => ($image_found) ? '../styles/' . $imageset_path . '/imageset/' . $img_val : 'images/no_image.png',
- 'IMAGE_SELECT' => $image_found
- ));
- }
-
- /**
- * Remove style/template/theme/imageset
- */
- function remove($mode, $style_id)
- {
- global $db, $template, $user, $phpbb_root_path, $cache, $config;
-
- $new_id = request_var('new_id', 0);
- $update = (isset($_POST['update'])) ? true : false;
- $sql_where = '';
-
- switch ($mode)
- {
- case 'style':
- $sql_from = STYLES_TABLE;
- $sql_select = 'style_id, style_name, template_id, theme_id, imageset_id';
- $sql_where = 'AND style_active = 1';
- break;
-
- case 'template':
- $sql_from = STYLES_TEMPLATE_TABLE;
- $sql_select = 'template_id, template_name, template_path, template_storedb';
- break;
-
- case 'theme':
- $sql_from = STYLES_THEME_TABLE;
- $sql_select = 'theme_id, theme_name, theme_path, theme_storedb';
- break;
-
- case 'imageset':
- $sql_from = STYLES_IMAGESET_TABLE;
- $sql_select = 'imageset_id, imageset_name, imageset_path';
- break;
- }
-
- if ($mode === 'template' && ($conflicts = $this->check_inheritance($mode, $style_id)))
- {
- $l_type = strtoupper($mode);
- $msg = $user->lang[$l_type . '_DELETE_DEPENDENT'];
- foreach ($conflicts as $id => $values)
+ else
{
- $msg .= '<br />' . $values['template_name'];
+ unset($update['style_active']);
}
- trigger_error($msg . adm_back_link($this->u_action), E_USER_WARNING);
- }
-
- $l_prefix = strtoupper($mode);
-
- $sql = "SELECT $sql_select
- FROM $sql_from
- WHERE {$mode}_id = $style_id";
- $result = $db->sql_query($sql);
- $style_row = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
-
- if (!$style_row)
- {
- trigger_error($user->lang['NO_' . $l_prefix] . adm_back_link($this->u_action), E_USER_WARNING);
- }
-
- $s_only_component = $this->display_component_options($mode, $style_row[$mode . '_id'], $style_row);
-
- if ($s_only_component)
- {
- trigger_error($user->lang['ONLY_' . $l_prefix] . adm_back_link($this->u_action), E_USER_WARNING);
- }
-
- if ($update)
- {
- if ($mode == 'style')
+ // Update data
+ if (count($update))
{
- $sql = "DELETE FROM $sql_from
- WHERE {$mode}_id = $style_id";
- $db->sql_query($sql);
-
- $sql = 'UPDATE ' . USERS_TABLE . "
- SET user_style = $new_id
- WHERE user_style = $style_id";
- $db->sql_query($sql);
+ $sql = 'UPDATE ' . STYLES_TABLE . '
+ SET ' . $this->db->sql_build_array('UPDATE', $update) . "
+ WHERE style_id = $id";
+ $this->db->sql_query($sql);
- $sql = 'UPDATE ' . FORUMS_TABLE . "
- SET forum_style = $new_id
- WHERE forum_style = $style_id";
- $db->sql_query($sql);
+ $style = array_merge($style, $update);
- if ($style_id == $config['default_style'])
+ if (isset($update['style_parent_id']))
{
- set_config('default_style', $new_id);
+ // Update styles tree
+ $styles = $this->get_styles();
+ if ($this->update_styles_tree($styles, $style))
+ {
+ // Something was changed in styles tree, purge all cache
+ $this->cache->purge();
+ }
}
+ add_log('admin', 'LOG_STYLE_EDIT_DETAILS', $style['style_name']);
+ }
- // Remove the components
- $components = array('template', 'theme', 'imageset');
- foreach ($components as $component)
+ // Update default style
+ $default = $this->request->variable('style_default', 0);
+ if ($default)
+ {
+ if (!$style['style_active'])
{
- $new_id = request_var('new_' . $component . '_id', 0);
- $component_id = $style_row[$component . '_id'];
- $this->remove_component($component, $component_id, $new_id, $style_id);
+ trigger_error($this->user->lang['STYLE_DEFAULT_CHANGE_INACTIVE'] . adm_back_link($update_action), E_USER_WARNING);
}
- }
- else
- {
- $this->remove_component($mode, $style_id, $new_id);
+ set_config('default_style', $id);
+ $this->cache->purge();
}
- $cache->destroy('sql', STYLES_TABLE);
-
- add_log('admin', 'LOG_' . $l_prefix . '_DELETE', $style_row[$mode . '_name']);
- $message = ($mode != 'style') ? $l_prefix . '_DELETED_FS' : $l_prefix . '_DELETED';
- trigger_error($user->lang[$message] . adm_back_link($this->u_action));
+ // Show styles list
+ $this->frontend();
+ return;
}
- $this->page_title = 'DELETE_' . $l_prefix;
+ // Show page title
+ $this->welcome_message('ACP_STYLES', null);
- $template->assign_vars(array(
- 'S_DELETE' => true,
-
- 'L_TITLE' => $user->lang[$this->page_title],
- 'L_EXPLAIN' => $user->lang[$this->page_title . '_EXPLAIN'],
- 'L_NAME' => $user->lang[$l_prefix . '_NAME'],
- 'L_REPLACE' => $user->lang['REPLACE_' . $l_prefix],
- 'L_REPLACE_EXPLAIN' => $user->lang['REPLACE_' . $l_prefix . '_EXPLAIN'],
-
- 'U_ACTION' => $this->u_action . "&amp;action=delete&amp;id=$style_id",
- 'U_BACK' => $this->u_action,
+ // Show parent styles
+ foreach ($list as $row)
+ {
+ $this->template->assign_block_vars('parent_styles', array(
+ 'STYLE_ID' => $row['style_id'],
+ 'STYLE_NAME' => htmlspecialchars($row['style_name']),
+ 'LEVEL' => $row['level'],
+ 'SPACER' => str_repeat('&nbsp; ', $row['level']),
+ )
+ );
+ }
- 'NAME' => $style_row[$mode . '_name'],
+ // Show style details
+ $this->template->assign_vars(array(
+ 'S_STYLE_DETAILS' => true,
+ 'STYLE_ID' => $style['style_id'],
+ 'STYLE_NAME' => htmlspecialchars($style['style_name']),
+ 'STYLE_PATH' => htmlspecialchars($style['style_path']),
+ 'STYLE_VERSION' => htmlspecialchars($style_cfg['style_version']),
+ 'STYLE_COPYRIGHT' => strip_tags($style['style_copyright']),
+ 'STYLE_PARENT' => $style['style_parent_id'],
+ 'S_STYLE_ACTIVE' => $style['style_active'],
+ 'S_STYLE_DEFAULT' => ($style['style_id'] == $this->default_style)
)
);
-
- if ($mode == 'style')
- {
- $template->assign_vars(array(
- 'S_DELETE_STYLE' => true,
- ));
- }
}
/**
- * Remove template/theme/imageset entry from the database
+ * List installed styles
*/
- function remove_component($component, $component_id, $new_id, $style_id = false)
+ protected function show_installed()
{
- global $db;
+ // Get all installed styles
+ $styles = $this->get_styles();
- if (($new_id == 0) || ($component === 'template' && ($conflicts = $this->check_inheritance($component, $component_id))))
+ if (!count($styles))
{
- // We can not delete the template, as the user wants to keep the component or an other template is inheriting from this one.
- return;
+ trigger_error($this->user->lang['NO_MATCHING_STYLES_FOUND'] . adm_back_link($this->u_action), E_USER_WARNING);
}
- $component_in_use = array();
- if ($component != 'style')
- {
- $component_in_use = $this->component_in_use($component, $component_id, $style_id);
- }
+ usort($styles, array($this, 'sort_styles'));
- if (($new_id == -1) && !empty($component_in_use))
- {
- // We can not delete the component, as it is still in use
- return;
- }
+ // Get users
+ $users = $this->get_users();
- if ($component == 'imageset')
+ // Add users counter to rows
+ foreach ($styles as &$style)
{
- $sql = 'DELETE FROM ' . STYLES_IMAGESET_DATA_TABLE . "
- WHERE imageset_id = $component_id";
- $db->sql_query($sql);
+ $style['_users'] = isset($users[$style['style_id']]) ? $users[$style['style_id']] : 0;
}
- switch ($component)
- {
- case 'template':
- $sql_from = STYLES_TEMPLATE_TABLE;
- break;
-
- case 'theme':
- $sql_from = STYLES_THEME_TABLE;
- break;
-
- case 'imageset':
- $sql_from = STYLES_IMAGESET_TABLE;;
- break;
- }
-
- $sql = "DELETE FROM $sql_from
- WHERE {$component}_id = $component_id";
- $db->sql_query($sql);
-
- $sql = 'UPDATE ' . STYLES_TABLE . "
- SET {$component}_id = $new_id
- WHERE {$component}_id = $component_id";
- $db->sql_query($sql);
- }
-
- /**
- * Display the options which can be used to replace a style/template/theme/imageset
- *
- * @return boolean Returns true if the component is the only component and can not be deleted.
- */
- function display_component_options($component, $component_id, $style_row = false, $style_id = false)
- {
- global $db, $template, $user;
-
- $is_only_component = true;
- $component_in_use = array();
- if ($component != 'style')
- {
- $component_in_use = $this->component_in_use($component, $component_id, $style_id);
- }
-
- $sql_where = '';
- switch ($component)
- {
- case 'style':
- $sql_from = STYLES_TABLE;
- $sql_where = 'WHERE style_active = 1';
- break;
-
- case 'template':
- $sql_from = STYLES_TEMPLATE_TABLE;
- $sql_where = 'WHERE template_inherits_id <> ' . $component_id;
- break;
-
- case 'theme':
- $sql_from = STYLES_THEME_TABLE;
- break;
-
- case 'imageset':
- $sql_from = STYLES_IMAGESET_TABLE;
- break;
- }
+ // Set up styles list variables
+ // Addons should increase this number and update template variable
+ $this->styles_list_cols = 4;
+ $this->template->assign_var('STYLES_LIST_COLS', $this->styles_list_cols);
- $s_options = '';
- if (($component != 'style') && empty($component_in_use))
- {
- // If it is not in use, there must be another component
- $is_only_component = false;
-
- $sql = "SELECT {$component}_id, {$component}_name
- FROM $sql_from
- WHERE {$component}_id = {$component_id}";
- $result = $db->sql_query($sql);
- $row = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
-
- $s_options .= '<option value="-1" selected="selected">' . $user->lang['DELETE_' . strtoupper($component)] . '</option>';
- $s_options .= '<option value="0">' . sprintf($user->lang['KEEP_' . strtoupper($component)], $row[$component . '_name']) . '</option>';
- }
- else
- {
- $sql = "SELECT {$component}_id, {$component}_name
- FROM $sql_from
- $sql_where
- ORDER BY {$component}_name ASC";
- $result = $db->sql_query($sql);
-
- $s_keep_option = $s_options = '';
- while ($row = $db->sql_fetchrow($result))
- {
- if ($row[$component . '_id'] != $component_id)
- {
- $is_only_component = false;
- $s_options .= '<option value="' . $row[$component . '_id'] . '">' . sprintf($user->lang['REPLACE_WITH_OPTION'], $row[$component . '_name']) . '</option>';
- }
- else if ($component != 'style')
- {
- $s_keep_option = '<option value="0" selected="selected">' . sprintf($user->lang['KEEP_' . strtoupper($component)], $row[$component . '_name']) . '</option>';
- }
- }
- $db->sql_freeresult($result);
- $s_options = $s_keep_option . $s_options;
- }
+ // Show styles list
+ $this->show_styles_list($styles, 0, 0);
- if (!$style_row)
+ // Show styles with invalid inherits_id
+ foreach ($styles as $style)
{
- $template->assign_var('S_REPLACE_' . strtoupper($component) . '_OPTIONS', $s_options);
- }
- else
- {
- $template->assign_var('S_REPLACE_OPTIONS', $s_options);
- if ($component == 'style')
+ if (empty($style['_shown']))
{
- $components = array('template', 'theme', 'imageset');
- foreach ($components as $component)
- {
- $this->display_component_options($component, $style_row[$component . '_id'], false, $component_id, true);
- }
+ $style['_note'] = sprintf($this->user->lang['REQUIRES_STYLE'], htmlspecialchars($style['style_parent_tree']));
+ $this->list_style($style, 0);
}
}
- return $is_only_component;
- }
-
- /**
- * Check whether the component is still used by another style or component
- */
- function component_in_use($component, $component_id, $style_id = false)
- {
- global $db;
-
- $component_in_use = array();
+ // Add buttons
+ $this->template->assign_block_vars('extra_actions', array(
+ 'ACTION_NAME' => 'activate',
+ 'L_ACTION' => $this->user->lang['STYLE_ACTIVATE'],
+ )
+ );
- if ($style_id)
- {
- $sql = 'SELECT style_id, style_name
- FROM ' . STYLES_TABLE . "
- WHERE {$component}_id = {$component_id}
- AND style_id <> {$style_id}
- ORDER BY style_name ASC";
- }
- else
- {
- $sql = 'SELECT style_id, style_name
- FROM ' . STYLES_TABLE . "
- WHERE {$component}_id = {$component_id}
- ORDER BY style_name ASC";
- }
- $result = $db->sql_query($sql);
- while ($row = $db->sql_fetchrow($result))
- {
- $component_in_use[] = $row['style_name'];
- }
- $db->sql_freeresult($result);
+ $this->template->assign_block_vars('extra_actions', array(
+ 'ACTION_NAME' => 'deactivate',
+ 'L_ACTION' => $this->user->lang['STYLE_DEACTIVATE'],
+ )
+ );
- if ($component === 'template' && ($conflicts = $this->check_inheritance($component, $component_id)))
+ if (isset($this->style_counters) && $this->style_counters['total'] > 1)
{
- foreach ($conflicts as $temp_id => $conflict_data)
- {
- $component_in_use[] = $conflict_data['template_name'];
- }
+ $this->template->assign_block_vars('extra_actions', array(
+ 'ACTION_NAME' => 'uninstall',
+ 'L_ACTION' => $this->user->lang['STYLE_UNINSTALL'],
+ )
+ );
}
-
- return $component_in_use;
}
/**
- * Export style or style elements
+ * Show list of styles that can be installed
*/
- function export($mode, $style_id)
+ protected function show_available()
{
- global $db, $template, $user, $phpbb_root_path, $cache, $phpEx, $config;
-
- $update = (isset($_POST['update'])) ? true : false;
+ // Get list of styles
+ $styles = $this->find_available(true);
- $inc_template = request_var('inc_template', 0);
- $inc_theme = request_var('inc_theme', 0);
- $inc_imageset = request_var('inc_imageset', 0);
- $store = request_var('store', 0);
- $format = request_var('format', '');
-
- $error = array();
- $methods = array('tar');
-
- $available_methods = array('tar.gz' => 'zlib', 'tar.bz2' => 'bz2', 'zip' => 'zlib');
- foreach ($available_methods as $type => $module)
- {
- if (!@extension_loaded($module))
- {
- continue;
- }
-
- $methods[] = $type;
- }
-
- if (!in_array($format, $methods))
+ // Show styles
+ if (empty($styles))
{
- $format = 'tar';
+ trigger_error($this->user->lang['NO_UNINSTALLED_STYLE'] . adm_back_link($this->u_base_action), E_USER_NOTICE);
}
- switch ($mode)
- {
- case 'style':
- if ($update && ($inc_template + $inc_theme + $inc_imageset) < 1)
- {
- $error[] = $user->lang['STYLE_ERR_MORE_ELEMENTS'];
- }
-
- $name = 'style_name';
-
- $sql_select = 's.style_id, s.style_name, s.style_copyright';
- $sql_select .= ($inc_template) ? ', t.*' : ', t.template_name';
- $sql_select .= ($inc_theme) ? ', c.*' : ', c.theme_name';
- $sql_select .= ($inc_imageset) ? ', i.*' : ', i.imageset_name';
- $sql_from = STYLES_TABLE . ' s, ' . STYLES_TEMPLATE_TABLE . ' t, ' . STYLES_THEME_TABLE . ' c, ' . STYLES_IMAGESET_TABLE . ' i';
- $sql_where = "s.style_id = $style_id AND t.template_id = s.template_id AND c.theme_id = s.theme_id AND i.imageset_id = s.imageset_id";
-
- $l_prefix = 'STYLE';
- break;
-
- case 'template':
- $name = 'template_name';
-
- $sql_select = '*';
- $sql_from = STYLES_TEMPLATE_TABLE;
- $sql_where = "template_id = $style_id";
-
- $l_prefix = 'TEMPLATE';
- break;
-
- case 'theme':
- $name = 'theme_name';
+ usort($styles, array($this, 'sort_styles'));
- $sql_select = '*';
- $sql_from = STYLES_THEME_TABLE;
- $sql_where = "theme_id = $style_id";
-
- $l_prefix = 'THEME';
- break;
-
- case 'imageset':
- $name = 'imageset_name';
-
- $sql_select = '*';
- $sql_from = STYLES_IMAGESET_TABLE;
- $sql_where = "imageset_id = $style_id";
-
- $l_prefix = 'IMAGESET';
- break;
- }
+ $this->styles_list_cols = 3;
+ $this->template->assign_vars(array(
+ 'STYLES_LIST_COLS' => $this->styles_list_cols,
+ 'STYLES_LIST_HIDE_COUNT' => true
+ )
+ );
- if ($update && !sizeof($error))
+ // Show styles
+ foreach ($styles as &$style)
{
- $sql = "SELECT $sql_select
- FROM $sql_from
- WHERE $sql_where";
- $result = $db->sql_query($sql);
- $style_row = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
-
- if (!$style_row)
- {
- trigger_error($user->lang['NO_' . $l_prefix] . adm_back_link($this->u_action), E_USER_WARNING);
- }
-
- $var_ary = array('style_id', 'style_name', 'style_copyright', 'template_id', 'template_name', 'template_path', 'template_copyright', 'template_storedb', 'template_inherits_id', 'bbcode_bitfield', 'theme_id', 'theme_name', 'theme_path', 'theme_copyright', 'theme_storedb', 'theme_mtime', 'theme_data', 'imageset_id', 'imageset_name', 'imageset_path', 'imageset_copyright');
-
- foreach ($var_ary as $var)
- {
- if (!isset($style_row[$var]))
- {
- $style_row[$var] = '';
- }
- }
-
- $files = $data = array();
-
- if ($mode == 'style')
- {
- $style_cfg = str_replace(array('{MODE}', '{NAME}', '{COPYRIGHT}', '{VERSION}'), array($mode, $style_row['style_name'], $style_row['style_copyright'], $config['version']), $this->style_cfg);
-
- $style_cfg .= (!$inc_template) ? "\nrequired_template = {$style_row['template_name']}" : '';
- $style_cfg .= (!$inc_theme) ? "\nrequired_theme = {$style_row['theme_name']}" : '';
- $style_cfg .= (!$inc_imageset) ? "\nrequired_imageset = {$style_row['imageset_name']}" : '';
-
- $data[] = array(
- 'src' => $style_cfg,
- 'prefix' => 'style.cfg'
- );
-
- unset($style_cfg);
- }
-
- // Export template core code
- if ($mode == 'template' || $inc_template)
- {
- $use_template_name = $style_row['template_name'];
-
- // Add the inherit from variable, depending on it's use...
- if ($style_row['template_inherits_id'])
- {
- // Get the template name
- $sql = 'SELECT template_name
- FROM ' . STYLES_TEMPLATE_TABLE . '
- WHERE template_id = ' . (int) $style_row['template_inherits_id'];
- $result = $db->sql_query($sql);
- $use_template_name = (string) $db->sql_fetchfield('template_name');
- $db->sql_freeresult($result);
- }
-
- $template_cfg = str_replace(array('{MODE}', '{NAME}', '{COPYRIGHT}', '{VERSION}', '{INHERIT_FROM}'), array($mode, $style_row['template_name'], $style_row['template_copyright'], $config['version'], $use_template_name), $this->template_cfg);
-
- $template_cfg .= "\n\nbbcode_bitfield = {$style_row['bbcode_bitfield']}";
-
- $data[] = array(
- 'src' => $template_cfg,
- 'prefix' => 'template/template.cfg'
- );
-
- // This is potentially nasty memory-wise ...
- if (!$style_row['template_storedb'])
- {
- $files[] = array(
- 'src' => "styles/{$style_row['template_path']}/template/",
- 'prefix-' => "styles/{$style_row['template_path']}/",
- 'prefix+' => false,
- 'exclude' => 'template.cfg'
- );
- }
- else
- {
- $sql = 'SELECT template_filename, template_data
- FROM ' . STYLES_TEMPLATE_DATA_TABLE . "
- WHERE template_id = {$style_row['template_id']}";
- $result = $db->sql_query($sql);
-
- while ($row = $db->sql_fetchrow($result))
- {
- $data[] = array(
- 'src' => $row['template_data'],
- 'prefix' => 'template/' . $row['template_filename']
- );
- }
- $db->sql_freeresult($result);
- }
- unset($template_cfg);
- }
-
- // Export theme core code
- if ($mode == 'theme' || $inc_theme)
- {
- $theme_cfg = str_replace(array('{MODE}', '{NAME}', '{COPYRIGHT}', '{VERSION}'), array($mode, $style_row['theme_name'], $style_row['theme_copyright'], $config['version']), $this->theme_cfg);
-
- // Read old cfg file
- $items = $cache->obtain_cfg_items($style_row);
- $items = $items['theme'];
-
- if (!isset($items['parse_css_file']))
- {
- $items['parse_css_file'] = 'off';
- }
-
- $theme_cfg = str_replace(array('{PARSE_CSS_FILE}'), array($items['parse_css_file']), $theme_cfg);
-
- $files[] = array(
- 'src' => "styles/{$style_row['theme_path']}/theme/",
- 'prefix-' => "styles/{$style_row['theme_path']}/",
- 'prefix+' => false,
- 'exclude' => ($style_row['theme_storedb']) ? 'stylesheet.css,theme.cfg' : 'theme.cfg'
- );
-
- $data[] = array(
- 'src' => $theme_cfg,
- 'prefix' => 'theme/theme.cfg'
- );
-
- if ($style_row['theme_storedb'])
- {
- $data[] = array(
- 'src' => $style_row['theme_data'],
- 'prefix' => 'theme/stylesheet.css'
- );
- }
-
- unset($items, $theme_cfg);
- }
-
- // Export imageset core code
- if ($mode == 'imageset' || $inc_imageset)
+ // Check if style has a parent style in styles list
+ $has_parent = false;
+ if ($style['_inherit_name'] != '')
{
- $imageset_cfg = str_replace(array('{MODE}', '{NAME}', '{COPYRIGHT}', '{VERSION}'), array($mode, $style_row['imageset_name'], $style_row['imageset_copyright'], $config['version']), $this->imageset_cfg);
-
- $imageset_main = array();
-
- $sql = 'SELECT image_filename, image_name, image_height, image_width
- FROM ' . STYLES_IMAGESET_DATA_TABLE . "
- WHERE imageset_id = $style_id
- AND image_lang = ''";
- $result = $db->sql_query($sql);
- while ($row = $db->sql_fetchrow($result))
- {
- $imageset_main[$row['image_name']] = $row['image_filename'] . ($row['image_height'] ? '*' . $row['image_height']: '') . ($row['image_width'] ? '*' . $row['image_width']: '');
- }
- $db->sql_freeresult($result);
-
- foreach ($this->imageset_keys as $topic => $key_array)
- {
- foreach ($key_array as $key)
- {
- if (isset($imageset_main[$key]))
- {
- $imageset_cfg .= "\nimg_" . $key . ' = ' . str_replace("styles/{$style_row['imageset_path']}/imageset/", '{PATH}', $imageset_main[$key]);
- }
- }
- }
-
- $files[] = array(
- 'src' => "styles/{$style_row['imageset_path']}/imageset/",
- 'prefix-' => "styles/{$style_row['imageset_path']}/",
- 'prefix+' => false,
- 'exclude' => 'imageset.cfg'
- );
-
- $data[] = array(
- 'src' => trim($imageset_cfg),
- 'prefix' => 'imageset/imageset.cfg'
- );
-
- end($data);
-
- $imageset_root = "{$phpbb_root_path}styles/{$style_row['imageset_path']}/imageset/";
-
- if ($dh = @opendir($imageset_root))
- {
- while (($fname = readdir($dh)) !== false)
- {
- if ($fname[0] != '.' && $fname != 'CVS' && is_dir("$imageset_root$fname"))
- {
- $files[key($files)]['exclude'] .= ',' . $fname . '/imageset.cfg';
- }
- }
- closedir($dh);
- }
-
- $imageset_lang = array();
-
- $sql = 'SELECT image_filename, image_name, image_height, image_width, image_lang
- FROM ' . STYLES_IMAGESET_DATA_TABLE . "
- WHERE imageset_id = $style_id
- AND image_lang <> ''";
- $result = $db->sql_query($sql);
- while ($row = $db->sql_fetchrow($result))
- {
- $imageset_lang[$row['image_lang']][$row['image_name']] = $row['image_filename'] . ($row['image_height'] ? '*' . $row['image_height']: '') . ($row['image_width'] ? '*' . $row['image_width']: '');
- }
- $db->sql_freeresult($result);
-
- foreach ($imageset_lang as $lang => $imageset_localized)
+ foreach ($styles as $parent_style)
{
- $imageset_cfg = str_replace(array('{MODE}', '{NAME}', '{COPYRIGHT}', '{VERSION}'), array($mode, $style_row['imageset_name'], $style_row['imageset_copyright'], $config['version']), $this->imageset_cfg);
-
- foreach ($this->imageset_keys as $topic => $key_array)
+ if ($parent_style['style_name'] == $style['_inherit_name'] && empty($parent_style['_shown']))
{
- foreach ($key_array as $key)
- {
- if (isset($imageset_localized[$key]))
- {
- $imageset_cfg .= "\nimg_" . $key . ' = ' . str_replace("styles/{$style_row['imageset_path']}/imageset/", '{PATH}', $imageset_localized[$key]);
- }
- }
+ // Show parent style first
+ $has_parent = true;
}
-
- $data[] = array(
- 'src' => trim($imageset_cfg),
- 'prefix' => 'imageset/' . $lang . '/imageset.cfg'
- );
}
-
- unset($imageset_cfg);
}
-
- switch ($format)
+ if (!$has_parent)
{
- case 'tar':
- $ext = '.tar';
- break;
-
- case 'zip':
- $ext = '.zip';
- break;
-
- case 'tar.gz':
- $ext = '.tar.gz';
- break;
-
- case 'tar.bz2':
- $ext = '.tar.bz2';
- break;
-
- default:
- $error[] = $user->lang[$l_prefix . '_ERR_ARCHIVE'];
- }
-
- if (!sizeof($error))
- {
- include($phpbb_root_path . 'includes/functions_compress.' . $phpEx);
-
- if ($mode == 'style')
- {
- $path = preg_replace('#[^\w-]+#', '_', $style_row['style_name']);
- }
- else
- {
- $path = $style_row[$mode . '_path'];
- }
-
- if ($format == 'zip')
- {
- $compress = new compress_zip('w', $phpbb_root_path . "store/$path$ext");
- }
- else
- {
- $compress = new compress_tar('w', $phpbb_root_path . "store/$path$ext", $ext);
- }
-
- if (sizeof($files))
- {
- foreach ($files as $file_ary)
- {
- $compress->add_file($file_ary['src'], $file_ary['prefix-'], $file_ary['prefix+'], $file_ary['exclude']);
- }
- }
-
- if (sizeof($data))
- {
- foreach ($data as $data_ary)
- {
- $compress->add_data($data_ary['src'], $data_ary['prefix']);
- }
- }
-
- $compress->close();
-
- add_log('admin', 'LOG_' . $l_prefix . '_EXPORT', $style_row[$mode . '_name']);
-
- if (!$store)
- {
- $compress->download($path);
- @unlink("{$phpbb_root_path}store/$path$ext");
- exit;
- }
-
- trigger_error(sprintf($user->lang[$l_prefix . '_EXPORTED'], "store/$path$ext") . adm_back_link($this->u_action));
+ $this->list_style($style, 0);
+ $this->show_available_child_styles($styles, $style['style_name'], 1);
}
}
- $sql = "SELECT {$mode}_id, {$mode}_name
- FROM " . (($mode == 'style') ? STYLES_TABLE : $sql_from) . "
- WHERE {$mode}_id = $style_id";
- $result = $db->sql_query($sql);
- $style_row = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
-
- if (!$style_row)
+ // Show styles that do not have parent style in styles list
+ foreach ($styles as $style)
{
- trigger_error($user->lang['NO_' . $l_prefix] . adm_back_link($this->u_action), E_USER_WARNING);
+ if (empty($style['_shown']))
+ {
+ $this->list_style($style, 0);
+ }
}
- $this->page_title = $l_prefix . '_EXPORT';
-
- $format_buttons = '';
- foreach ($methods as $method)
+ // Add button
+ if (isset($this->style_counters) && $this->style_counters['caninstall'] > 0)
{
- $format_buttons .= '<label><input type="radio"' . ((!$format_buttons) ? ' id="format"' : '') . ' class="radio" value="' . $method . '" name="format"' . (($method == $format) ? ' checked="checked"' : '') . ' /> ' . $method . '</label>';
+ $this->template->assign_block_vars('extra_actions', array(
+ 'ACTION_NAME' => 'install',
+ 'L_ACTION' => $this->user->lang['INSTALL_STYLES'],
+ )
+ );
}
-
- $template->assign_vars(array(
- 'S_EXPORT' => true,
- 'S_ERROR_MSG' => (sizeof($error)) ? true : false,
- 'S_STYLE' => ($mode == 'style') ? true : false,
-
- 'L_TITLE' => $user->lang[$this->page_title],
- 'L_EXPLAIN' => $user->lang[$this->page_title . '_EXPLAIN'],
- 'L_NAME' => $user->lang[$l_prefix . '_NAME'],
-
- 'U_ACTION' => $this->u_action . '&amp;action=export&amp;id=' . $style_id,
- 'U_BACK' => $this->u_action,
-
- 'ERROR_MSG' => (sizeof($error)) ? implode('<br />', $error) : '',
- 'NAME' => $style_row[$mode . '_name'],
- 'FORMAT_BUTTONS' => $format_buttons)
- );
}
/**
- * Display details
+ * Find styles available for installation
+ *
+ * @param bool $all if true, function will return all installable styles. if false, function will return only styles that can be installed
+ * @return array List of styles
*/
- function details($mode, $style_id)
+ protected function find_available($all)
{
- global $template, $db, $config, $user, $safe_mode, $cache, $phpbb_root_path;
-
- $update = (isset($_POST['update'])) ? true : false;
- $l_type = strtoupper($mode);
-
- $error = array();
- $element_ary = array('template' => STYLES_TEMPLATE_TABLE, 'theme' => STYLES_THEME_TABLE, 'imageset' => STYLES_IMAGESET_TABLE);
-
- switch ($mode)
- {
- case 'style':
- $sql_from = STYLES_TABLE;
- break;
-
- case 'template':
- $sql_from = STYLES_TEMPLATE_TABLE;
- break;
-
- case 'theme':
- $sql_from = STYLES_THEME_TABLE;
- break;
-
- case 'imageset':
- $sql_from = STYLES_IMAGESET_TABLE;
- break;
- }
-
- $sql = "SELECT *
- FROM $sql_from
- WHERE {$mode}_id = $style_id";
- $result = $db->sql_query($sql);
- $style_row = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
-
- if (!$style_row)
- {
- trigger_error($user->lang['NO_' . $l_type] . adm_back_link($this->u_action), E_USER_WARNING);
+ // Get list of installed styles
+ $installed = $this->get_styles();
+
+ $installed_dirs = array();
+ $installed_names = array();
+ foreach ($installed as $style)
+ {
+ $installed_dirs[] = $style['style_path'];
+ $installed_names[$style['style_name']] = array(
+ 'path' => $style['style_path'],
+ 'id' => $style['style_id'],
+ 'parent' => $style['style_parent_id'],
+ 'tree' => (strlen($style['style_parent_tree']) ? $style['style_parent_tree'] . '/' : '') . $style['style_path'],
+ );
}
- $style_row['style_default'] = ($mode == 'style' && $config['default_style'] == $style_id) ? 1 : 0;
+ // Get list of directories
+ $dirs = $this->find_style_dirs();
- if ($update)
+ // Find styles that can be installed
+ $styles = array();
+ foreach ($dirs as $dir)
{
- $name = utf8_normalize_nfc(request_var('name', '', true));
- $copyright = utf8_normalize_nfc(request_var('copyright', '', true));
-
- $template_id = request_var('template_id', 0);
- $theme_id = request_var('theme_id', 0);
- $imageset_id = request_var('imageset_id', 0);
-
- $style_active = request_var('style_active', 0);
- $style_default = request_var('style_default', 0);
- $store_db = request_var('store_db', 0);
-
- // If the admin selected the style to be the default style, but forgot to activate it... we will do it for him
- if ($style_default)
+ if (in_array($dir, $installed_dirs))
{
- $style_active = 1;
- }
-
- $sql = "SELECT {$mode}_id, {$mode}_name
- FROM $sql_from
- WHERE {$mode}_id <> $style_id
- AND LOWER({$mode}_name) = '" . $db->sql_escape(strtolower($name)) . "'";
- $result = $db->sql_query($sql);
- $conflict = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
-
- if ($mode == 'style' && (!$template_id || !$theme_id || !$imageset_id))
- {
- $error[] = $user->lang['STYLE_ERR_NO_IDS'];
- }
-
- if ($mode == 'style' && $style_row['style_active'] && !$style_active && $config['default_style'] == $style_id)
- {
- $error[] = $user->lang['DEACTIVATE_DEFAULT'];
- }
-
- if (!$name || $conflict)
- {
- $error[] = $user->lang[$l_type . '_ERR_STYLE_NAME'];
- }
-
- if ($mode === 'theme' || $mode === 'template')
- {
- // a rather elaborate check we have to do here once to avoid trouble later
- $check = "{$phpbb_root_path}styles/" . $style_row["{$mode}_path"] . (($mode === 'theme') ? '/theme/stylesheet.css' : '/template');
- if (($style_row["{$mode}_storedb"] != $store_db) && !$store_db && ($safe_mode || !phpbb_is_writable($check)))
- {
- $error[] = $user->lang['EDIT_' . strtoupper($mode) . '_STORED_DB'];
- $store_db = 1;
- }
-
- // themes which have to be parsed have to go into db
- if ($mode == 'theme')
- {
- $cfg = parse_cfg_file("{$phpbb_root_path}styles/" . $style_row["{$mode}_path"] . "/theme/theme.cfg");
-
- if (isset($cfg['parse_css_file']) && $cfg['parse_css_file'] && !$store_db)
- {
- $error[] = $user->lang['EDIT_THEME_STORE_PARSED'];
- $store_db = 1;
- }
- }
+ // Style is already installed
+ continue;
}
-
- if (!sizeof($error))
+ $cfg = $this->read_style_cfg($dir);
+ if ($cfg === false)
{
- // Check length settings
- if (utf8_strlen($name) > 30)
- {
- $error[] = $user->lang[$l_type . '_ERR_NAME_LONG'];
- }
-
- if (utf8_strlen($copyright) > 60)
- {
- $error[] = $user->lang[$l_type . '_ERR_COPY_LONG'];
- }
+ // Invalid style.cfg
+ continue;
}
- }
- if ($update && sizeof($error))
- {
- $style_row = array_merge($style_row, array(
- 'template_id' => $template_id,
- 'theme_id' => $theme_id,
- 'imageset_id' => $imageset_id,
- 'style_active' => $style_active,
- $mode . '_storedb' => $store_db,
- $mode . '_name' => $name,
- $mode . '_copyright' => $copyright)
+ // Style should be available for installation
+ $parent = $cfg['parent'];
+ $style = array(
+ 'style_id' => 0,
+ 'style_name' => $cfg['name'],
+ 'style_copyright' => $cfg['copyright'],
+ 'style_active' => 0,
+ 'style_path' => $dir,
+ 'bbcode_bitfield' => $cfg['template_bitfield'],
+ 'style_parent_id' => 0,
+ 'style_parent_tree' => '',
+ // Extra values for styles list
+ // All extra variable start with _ so they won't be confused with data that can be added to styles table
+ '_inherit_name' => $parent,
+ '_available' => true,
+ '_note' => '',
);
- }
-
- // User has submitted form and no errors have occurred
- if ($update && !sizeof($error))
- {
- $sql_ary = array(
- $mode . '_name' => $name,
- $mode . '_copyright' => $copyright
- );
-
- switch ($mode)
- {
- case 'style':
-
- $sql_ary += array(
- 'template_id' => (int) $template_id,
- 'theme_id' => (int) $theme_id,
- 'imageset_id' => (int) $imageset_id,
- 'style_active' => (int) $style_active,
- );
- break;
-
- case 'imageset':
- break;
-
- case 'theme':
-
- if ($style_row['theme_storedb'] != $store_db)
- {
- $theme_data = '';
-
- if (!$style_row['theme_storedb'])
- {
- $theme_data = $this->db_theme_data($style_row);
- }
- else if (!$store_db && !$safe_mode && phpbb_is_writable("{$phpbb_root_path}styles/{$style_row['theme_path']}/theme/stylesheet.css"))
- {
- $store_db = 1;
- $theme_data = $style_row['theme_data'];
-
- if ($fp = @fopen("{$phpbb_root_path}styles/{$style_row['theme_path']}/theme/stylesheet.css", 'wb'))
- {
- $store_db = (@fwrite($fp, str_replace("styles/{$style_row['theme_path']}/theme/", './', $theme_data))) ? 0 : 1;
- }
- fclose($fp);
- }
-
- $sql_ary += array(
- 'theme_mtime' => ($store_db) ? filemtime("{$phpbb_root_path}styles/{$style_row['theme_path']}/theme/stylesheet.css") : 0,
- 'theme_storedb' => $store_db,
- 'theme_data' => ($store_db) ? $theme_data : '',
- );
- }
- break;
-
- case 'template':
-
- if ($style_row['template_storedb'] != $store_db)
- {
- if ($super = $this->get_super($mode, $style_row['template_id']))
- {
- $error[] = (sprintf($user->lang["{$l_type}_INHERITS"], $super['template_name']));
- $sql_ary = array();
- }
- else
- {
- if (!$store_db && !$safe_mode && phpbb_is_writable("{$phpbb_root_path}styles/{$style_row['template_path']}/template"))
- {
- $err = $this->store_in_fs('template', $style_row['template_id']);
- if ($err)
- {
- $error += $err;
- }
- }
- else if ($store_db)
- {
- $this->store_in_db('template', $style_row['template_id']);
- }
- else
- {
- // We no longer store within the db, but are also not able to update the file structure
- // Since the admin want to switch this, we adhere to his decision. But we also need to remove the cache
- $sql = 'DELETE FROM ' . STYLES_TEMPLATE_DATA_TABLE . "
- WHERE template_id = $style_id";
- $db->sql_query($sql);
- }
-
- $sql_ary += array(
- 'template_storedb' => $store_db,
- );
- }
- }
- break;
- }
- if (sizeof($sql_ary))
+ // Check style inheritance
+ if ($parent != '')
{
- $sql = "UPDATE $sql_from
- SET " . $db->sql_build_array('UPDATE', $sql_ary) . "
- WHERE {$mode}_id = $style_id";
- $db->sql_query($sql);
-
- // Making this the default style?
- if ($mode == 'style' && $style_default)
+ if (isset($installed_names[$parent]))
{
- set_config('default_style', $style_id);
+ // Parent style is installed
+ $row = $installed_names[$parent];
+ $style['style_parent_id'] = $row['id'];
+ $style['style_parent_tree'] = $row['tree'];
}
- }
-
- $cache->destroy('sql', STYLES_TABLE);
-
- add_log('admin', 'LOG_' . $l_type . '_EDIT_DETAILS', $name);
- if (sizeof($error))
- {
- trigger_error(implode('<br />', $error) . adm_back_link($this->u_action), E_USER_WARNING);
- }
- else
- {
- trigger_error($user->lang[$l_type . '_DETAILS_UPDATED'] . adm_back_link($this->u_action));
- }
- }
-
- if ($mode == 'style')
- {
- foreach ($element_ary as $element => $table)
- {
- $sql = "SELECT {$element}_id, {$element}_name
- FROM $table
- ORDER BY {$element}_id ASC";
- $result = $db->sql_query($sql);
-
- ${$element . '_options'} = '';
- while ($row = $db->sql_fetchrow($result))
+ else
{
- $selected = ($row[$element . '_id'] == $style_row[$element . '_id']) ? ' selected="selected"' : '';
- ${$element . '_options'} .= '<option value="' . $row[$element . '_id'] . '"' . $selected . '>' . $row[$element . '_name'] . '</option>';
+ // Parent style is not installed yet
+ $style['_available'] = false;
+ $style['_note'] = sprintf($this->user->lang['REQUIRES_STYLE'], htmlspecialchars($parent));
}
- $db->sql_freeresult($result);
}
- }
- if ($mode == 'template')
- {
- $super = array();
- if (isset($style_row[$mode . '_inherits_id']) && $style_row['template_inherits_id'])
+ if ($all || $style['_available'])
{
- $super = $this->get_super($mode, $style_row['template_id']);
+ $styles[] = $style;
}
}
- $this->page_title = 'EDIT_DETAILS_' . $l_type;
-
- $template->assign_vars(array(
- 'S_DETAILS' => true,
- 'S_ERROR_MSG' => (sizeof($error)) ? true : false,
- 'S_STYLE' => ($mode == 'style') ? true : false,
- 'S_TEMPLATE' => ($mode == 'template') ? true : false,
- 'S_THEME' => ($mode == 'theme') ? true : false,
- 'S_IMAGESET' => ($mode == 'imageset') ? true : false,
- 'S_STORE_DB' => (isset($style_row[$mode . '_storedb'])) ? $style_row[$mode . '_storedb'] : 0,
- 'S_STORE_DB_DISABLED' => (isset($style_row[$mode . '_inherits_id'])) ? $style_row[$mode . '_inherits_id'] : 0,
- 'S_STYLE_ACTIVE' => (isset($style_row['style_active'])) ? $style_row['style_active'] : 0,
- 'S_STYLE_DEFAULT' => (isset($style_row['style_default'])) ? $style_row['style_default'] : 0,
- 'S_SUPERTEMPLATE' => (isset($style_row[$mode . '_inherits_id']) && $style_row[$mode . '_inherits_id']) ? $super['template_name'] : 0,
-
- 'S_TEMPLATE_OPTIONS' => ($mode == 'style') ? $template_options : '',
- 'S_THEME_OPTIONS' => ($mode == 'style') ? $theme_options : '',
- 'S_IMAGESET_OPTIONS' => ($mode == 'style') ? $imageset_options : '',
-
- 'U_ACTION' => $this->u_action . '&amp;action=details&amp;id=' . $style_id,
- 'U_BACK' => $this->u_action,
-
- 'L_TITLE' => $user->lang[$this->page_title],
- 'L_EXPLAIN' => $user->lang[$this->page_title . '_EXPLAIN'],
- 'L_NAME' => $user->lang[$l_type . '_NAME'],
- 'L_LOCATION' => ($mode == 'template' || $mode == 'theme') ? $user->lang[$l_type . '_LOCATION'] : '',
- 'L_LOCATION_EXPLAIN' => ($mode == 'template' || $mode == 'theme') ? $user->lang[$l_type . '_LOCATION_EXPLAIN'] : '',
-
- 'ERROR_MSG' => (sizeof($error)) ? implode('<br />', $error) : '',
- 'NAME' => $style_row[$mode . '_name'],
- 'COPYRIGHT' => $style_row[$mode . '_copyright'],
- )
- );
+ return $styles;
}
/**
- * Load css file contents
+ * Show styles list
+ *
+ * @param array $styles styles list
+ * @param int $parent parent style id
+ * @param int $level style inheritance level
*/
- function load_css_file($path, $filename)
+ protected function show_styles_list(&$styles, $parent, $level)
{
- global $phpbb_root_path;
-
- $file = "{$phpbb_root_path}styles/$path/theme/$filename";
-
- if (file_exists($file) && ($content = file_get_contents($file)))
+ foreach ($styles as &$style)
{
- $content = trim($content);
- }
- else
- {
- $content = '';
- }
- if (defined('DEBUG'))
- {
- $content = "/* BEGIN @include $filename */ \n $content \n /* END @include $filename */ \n";
+ if (empty($style['_shown']) && $style['style_parent_id'] == $parent)
+ {
+ $this->list_style($style, $level);
+ $this->show_styles_list($styles, $style['style_id'], $level + 1);
+ }
}
-
- return $content;
}
/**
- * Returns a string containing the value that should be used for the theme_data column in the theme database table.
- * Includes contents of files loaded via @import
+ * Show available styles tree
*
- * @param array $theme_row is an associative array containing the theme's current database entry
- * @param mixed $stylesheet can either be the new content for the stylesheet or false to load from the standard file
- * @param string $root_path should only be used in case you want to use a different root path than "{$phpbb_root_path}styles/{$theme_row['theme_path']}"
- *
- * @return string Stylesheet data for theme_data column in the theme table
+ * @param array $styles Styles list, passed as reference
+ * @param string $name Name of parent style
+ * @param int $level Styles tree level
*/
- function db_theme_data($theme_row, $stylesheet = false, $root_path = '')
+ protected function show_available_child_styles(&$styles, $name, $level)
{
- global $phpbb_root_path;
-
- if (!$root_path)
+ foreach ($styles as &$style)
{
- $root_path = $phpbb_root_path . 'styles/' . $theme_row['theme_path'];
- }
-
- if (!$stylesheet)
- {
- $stylesheet = '';
- if (file_exists($root_path . '/theme/stylesheet.css'))
- {
- $stylesheet = file_get_contents($root_path . '/theme/stylesheet.css');
- }
- }
-
- // Match CSS imports
- $matches = array();
- preg_match_all('/@import url\((["\'])(.*)\1\);/i', $stylesheet, $matches);
-
- // remove commented stylesheets (very simple parser, allows only whitespace
- // around an @import statement)
- preg_match_all('#/\*\s*@import url\((["\'])(.*)\1\);\s\*/#i', $stylesheet, $commented);
- $matches[2] = array_diff($matches[2], $commented[2]);
-
- if (sizeof($matches))
- {
- foreach ($matches[0] as $idx => $match)
+ if (empty($style['_shown']) && $style['_inherit_name'] == $name)
{
- if (isset($matches[2][$idx]))
- {
- $stylesheet = str_replace($match, acp_styles::load_css_file($theme_row['theme_path'], $matches[2][$idx]), $stylesheet);
- }
+ $this->list_style($style, $level);
+ $this->show_available_child_styles($styles, $style['style_name'], $level + 1);
}
}
-
- // adjust paths
- return str_replace('./', 'styles/' . $theme_row['theme_path'] . '/theme/', $stylesheet);
}
/**
- * Store template files into db
+ * Update styles tree
+ *
+ * @param array $styles Styles list, passed as reference
+ * @param array|false $style Current style, false if root
+ * @return bool True if something was updated, false if not
*/
- function store_templates($mode, $style_id, $template_path, $filelist)
+ protected function update_styles_tree(&$styles, $style = false)
{
- global $phpbb_root_path, $phpEx, $db;
-
- $template_path = $template_path . '/template/';
- $includes = array();
- foreach ($filelist as $pathfile => $file_ary)
+ $parent_id = ($style === false) ? 0 : $style['style_id'];
+ $parent_tree = ($style === false) ? '' : ($style['style_parent_tree'] == '' ? '' : $style['style_parent_tree']) . $style['style_path'];
+ $update = false;
+ $updated = false;
+ foreach ($styles as &$row)
{
- foreach ($file_ary as $file)
+ if ($row['style_parent_id'] == $parent_id)
{
- if (!($fp = @fopen("{$phpbb_root_path}styles/$template_path$pathfile$file", 'r')))
+ if ($row['style_parent_tree'] != $parent_tree)
{
- trigger_error("Could not open {$phpbb_root_path}styles/$template_path$pathfile$file", E_USER_ERROR);
- }
-
- $filesize = filesize("{$phpbb_root_path}styles/$template_path$pathfile$file");
-
- if ($filesize)
- {
- $template_data = fread($fp, $filesize);
- }
-
- fclose($fp);
-
- if (!$filesize)
- {
- // File is empty
- continue;
- }
-
- if (preg_match_all('#<!-- INCLUDE (.*?\.html) -->#is', $template_data, $matches))
- {
- foreach ($matches[1] as $match)
- {
- $includes[trim($match)][] = $file;
- }
+ $row['style_parent_tree'] = $parent_tree;
+ $update = true;
}
+ $updated |= $this->update_styles_tree($styles, $row);
}
}
-
- foreach ($filelist as $pathfile => $file_ary)
+ if ($update)
{
- foreach ($file_ary as $file)
- {
- // Skip index.
- if (strpos($file, 'index.') === 0)
- {
- continue;
- }
-
- // We could do this using extended inserts ... but that could be one
- // heck of a lot of data ...
- $sql_ary = array(
- 'template_id' => (int) $style_id,
- 'template_filename' => "$pathfile$file",
- 'template_included' => (isset($includes[$file])) ? implode(':', $includes[$file]) . ':' : '',
- 'template_mtime' => (int) filemtime("{$phpbb_root_path}styles/$template_path$pathfile$file"),
- 'template_data' => (string) file_get_contents("{$phpbb_root_path}styles/$template_path$pathfile$file"),
- );
-
- if ($mode == 'insert')
- {
- $sql = 'INSERT INTO ' . STYLES_TEMPLATE_DATA_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary);
- }
- else
- {
- $sql = 'UPDATE ' . STYLES_TEMPLATE_DATA_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . "
- WHERE template_id = $style_id
- AND template_filename = '" . $db->sql_escape("$pathfile$file") . "'";
- }
- $db->sql_query($sql);
- }
+ $sql = 'UPDATE ' . STYLES_TABLE . "
+ SET style_parent_tree = '" . $this->db->sql_escape($parent_tree) . "'
+ WHERE style_parent_id = {$parent_id}";
+ $this->db->sql_query($sql);
+ $updated = true;
}
+ return $updated;
}
/**
- * Returns an array containing all template filenames for one template that are currently cached.
+ * Find all possible parent styles for style
*
- * @param string $template_path contains the name of the template's folder in /styles/
- *
- * @return array of filenames that exist in /styles/$template_path/template/ (without extension!)
+ * @param array $styles list of styles
+ * @param int $id id of style
+ * @param int $parent current parent style id
+ * @param int $level current tree level
+ * @return array Style ids, names and levels
*/
- function template_cache_filelist($template_path)
+ protected function find_possible_parents($styles, $id = -1, $parent = 0, $level = 0)
{
- global $phpbb_root_path, $phpEx, $user;
-
- $cache_prefix = 'tpl_' . str_replace('_', '-', $template_path);
-
- if (!($dp = @opendir("{$phpbb_root_path}cache")))
- {
- trigger_error($user->lang['TEMPLATE_ERR_CACHE_READ'] . adm_back_link($this->u_action), E_USER_WARNING);
- }
-
- $file_ary = array();
- while ($file = readdir($dp))
- {
- if ($file[0] == '.')
- {
- continue;
- }
-
- if (is_file($phpbb_root_path . 'cache/' . $file) && (strpos($file, $cache_prefix) === 0))
- {
- $file_ary[] = str_replace('.', '/', preg_replace('#^' . preg_quote($cache_prefix, '#') . '_(.*?)\.html\.' . $phpEx . '$#i', '\1', $file));
+ $results = array();
+ foreach ($styles as $style)
+ {
+ if ($style['style_id'] != $id && $style['style_parent_id'] == $parent)
+ {
+ $results[] = array(
+ 'style_id' => $style['style_id'],
+ 'style_name' => $style['style_name'],
+ 'style_path' => $style['style_path'],
+ 'style_parent_id' => $style['style_parent_id'],
+ 'style_parent_tree' => $style['style_parent_tree'],
+ 'level' => $level
+ );
+ $results = array_merge($results, $this->find_possible_parents($styles, $id, $style['style_id'], $level + 1));
}
}
- closedir($dp);
-
- return $file_ary;
+ return $results;
}
/**
- * Destroys cached versions of template files
+ * Show item in styles list
*
- * @param array $template_row contains the template's row in the STYLES_TEMPLATE_TABLE database table
- * @param mixed $file_ary is optional and may contain an array of template file names which should be refreshed in the cache.
- * The file names should be the original template file names and not the cache file names.
+ * @param array $style style row
+ * @param int $level style inheritance level
*/
- function clear_template_cache($template_row, $file_ary = false)
+ protected function list_style(&$style, $level)
{
- global $phpbb_root_path, $phpEx, $user;
-
- $cache_prefix = 'tpl_' . str_replace('_', '-', $template_row['template_path']);
-
- if (!$file_ary || !is_array($file_ary))
- {
- $file_ary = $this->template_cache_filelist($template_row['template_path']);
- $log_file_list = $user->lang['ALL_FILES'];
- }
- else
- {
- $log_file_list = implode(', ', $file_ary);
- }
-
- foreach ($file_ary as $file)
+ // Mark row as shown
+ if (!empty($style['_shown']))
{
- $file = str_replace('/', '.', $file);
-
- $file = "{$phpbb_root_path}cache/{$cache_prefix}_$file.html.$phpEx";
- if (file_exists($file) && is_file($file))
- {
- @unlink($file);
- }
+ return;
}
- unset($file_ary);
-
- add_log('admin', 'LOG_TEMPLATE_CACHE_CLEARED', $template_row['template_name'], $log_file_list);
- }
-
- /**
- * Install Style/Template/Theme/Imageset
- */
- function install($mode)
- {
- global $phpbb_root_path, $phpEx, $config, $db, $cache, $user, $template;
-
- $l_type = strtoupper($mode);
-
- $error = $installcfg = $style_row = array();
- $root_path = $cfg_file = '';
- $element_ary = array('template' => STYLES_TEMPLATE_TABLE, 'theme' => STYLES_THEME_TABLE, 'imageset' => STYLES_IMAGESET_TABLE);
- $install_path = request_var('path', '');
- $update = (isset($_POST['update'])) ? true : false;
+ $style['_shown'] = true;
+
+ // Generate template variables
+ $actions = array();
+ $row = array(
+ // Style data
+ 'STYLE_ID' => $style['style_id'],
+ 'STYLE_NAME' => htmlspecialchars($style['style_name']),
+ 'STYLE_PATH' => htmlspecialchars($style['style_path']),
+ 'STYLE_COPYRIGHT' => strip_tags($style['style_copyright']),
+ 'STYLE_ACTIVE' => $style['style_active'],
+
+ // Additional data
+ 'DEFAULT' => ($style['style_id'] && $style['style_id'] == $this->default_style),
+ 'USERS' => (isset($style['_users'])) ? $style['_users'] : '',
+ 'LEVEL' => $level,
+ 'PADDING' => (4 + 16 * $level),
+ 'SHOW_COPYRIGHT' => ($style['style_id']) ? false : true,
+ 'STYLE_PATH_FULL' => htmlspecialchars($this->styles_path_absolute . '/' . $style['style_path']) . '/',
+
+ // Comment to show below style
+ 'COMMENT' => (isset($style['_note'])) ? $style['_note'] : '',
+
+ // The following variables should be used by hooks to add custom HTML code
+ 'EXTRA' => '',
+ 'EXTRA_OPTIONS' => ''
+ );
- // Installing, obtain cfg file contents
- if ($install_path)
+ // Status specific data
+ if ($style['style_id'])
{
- $root_path = $phpbb_root_path . 'styles/' . $install_path . '/';
- $cfg_file = ($mode == 'style') ? "$root_path$mode.cfg" : "$root_path$mode/$mode.cfg";
-
- if (!file_exists($cfg_file))
- {
- $error[] = $user->lang[$l_type . '_ERR_NOT_' . $l_type];
- }
- else
- {
- $installcfg = parse_cfg_file($cfg_file);
- }
- }
+ // Style is installed
- // Installing
- if (sizeof($installcfg))
- {
- $name = $installcfg['name'];
- $copyright = $installcfg['copyright'];
- $version = $installcfg['version'];
-
- $style_row = array(
- $mode . '_id' => 0,
- $mode . '_name' => '',
- $mode . '_copyright' => ''
+ // Details
+ $actions[] = array(
+ 'U_ACTION' => $this->u_action . '&amp;action=details&amp;id=' . $style['style_id'],
+ 'L_ACTION' => $this->user->lang['DETAILS']
);
- switch ($mode)
- {
- case 'style':
-
- $style_row = array(
- 'style_id' => 0,
- 'style_name' => $installcfg['name'],
- 'style_copyright' => $installcfg['copyright']
- );
-
- $reqd_template = (isset($installcfg['required_template'])) ? $installcfg['required_template'] : false;
- $reqd_theme = (isset($installcfg['required_theme'])) ? $installcfg['required_theme'] : false;
- $reqd_imageset = (isset($installcfg['required_imageset'])) ? $installcfg['required_imageset'] : false;
-
- // Check to see if each element is already installed, if it is grab the id
- foreach ($element_ary as $element => $table)
- {
- $style_row = array_merge($style_row, array(
- $element . '_id' => 0,
- $element . '_name' => '',
- $element . '_copyright' => '')
- );
-
- $this->test_installed($element, $error, (${'reqd_' . $element}) ? $phpbb_root_path . 'styles/' . $reqd_template . '/' : $root_path, ${'reqd_' . $element}, $style_row[$element . '_id'], $style_row[$element . '_name'], $style_row[$element . '_copyright']);
+ // Activate/Deactive
+ $action_name = ($style['style_active'] ? 'de' : '') . 'activate';
- if (!$style_row[$element . '_name'])
- {
- $style_row[$element . '_name'] = $reqd_template;
- }
-
- // Merge other information to installcfg... if present
- $cfg_file = $phpbb_root_path . 'styles/' . $install_path . '/' . $element . '/' . $element . '.cfg';
-
- if (file_exists($cfg_file))
- {
- $cfg_contents = parse_cfg_file($cfg_file);
-
- // Merge only specific things. We may need them later.
- foreach (array('inherit_from', 'parse_css_file') as $key)
- {
- if (!empty($cfg_contents[$key]) && !isset($installcfg[$key]))
- {
- $installcfg[$key] = $cfg_contents[$key];
- }
- }
- }
- }
-
- break;
+ $actions[] = array(
+ 'U_ACTION' => $this->u_action . '&amp;action=' . $action_name . '&amp;hash=' . generate_link_hash($action_name) . '&amp;id=' . $style['style_id'],
+ 'L_ACTION' => $this->user->lang['STYLE_' . ($style['style_active'] ? 'DE' : '') . 'ACTIVATE']
+ );
- case 'template':
- $this->test_installed('template', $error, $root_path, false, $style_row['template_id'], $style_row['template_name'], $style_row['template_copyright']);
- break;
+/* // Export
+ $actions[] = array(
+ 'U_ACTION' => $this->u_action . '&amp;action=export&amp;hash=' . generate_link_hash('export') . '&amp;id=' . $style['style_id'],
+ 'L_ACTION' => $this->user->lang['EXPORT']
+ ); */
- case 'theme':
- $this->test_installed('theme', $error, $root_path, false, $style_row['theme_id'], $style_row['theme_name'], $style_row['theme_copyright']);
- break;
+ // Uninstall
+ $actions[] = array(
+ 'U_ACTION' => $this->u_action . '&amp;action=uninstall&amp;hash=' . generate_link_hash('uninstall') . '&amp;id=' . $style['style_id'],
+ 'L_ACTION' => $this->user->lang['STYLE_UNINSTALL']
+ );
- case 'imageset':
- $this->test_installed('imageset', $error, $root_path, false, $style_row['imageset_id'], $style_row['imageset_name'], $style_row['imageset_copyright']);
- break;
- }
+ // Preview
+ $actions[] = array(
+ 'U_ACTION' => append_sid($this->phpbb_root_path . 'index.' . $this->php_ext, 'style=' . $style['style_id']),
+ 'L_ACTION' => $this->user->lang['PREVIEW']
+ );
}
else
{
- trigger_error($user->lang['NO_' . $l_type] . adm_back_link($this->u_action), E_USER_WARNING);
- }
-
- $style_row['store_db'] = request_var('store_db', 0);
- $style_row['style_active'] = request_var('style_active', 1);
- $style_row['style_default'] = request_var('style_default', 0);
-
- // User has submitted form and no errors have occurred
- if ($update && !sizeof($error))
- {
- if ($mode == 'style')
+ // Style is not installed
+ if (empty($style['_available']))
{
- foreach ($element_ary as $element => $table)
- {
- ${$element . '_root_path'} = (${'reqd_' . $element}) ? $phpbb_root_path . 'styles/' . ${'reqd_' . $element} . '/' : false;
- ${$element . '_path'} = (${'reqd_' . $element}) ? ${'reqd_' . $element} : false;
- }
- $this->install_style($error, 'install', $root_path, $style_row['style_id'], $style_row['style_name'], $install_path, $style_row['style_copyright'], $style_row['style_active'], $style_row['style_default'], $style_row, $template_root_path, $template_path, $theme_root_path, $theme_path, $imageset_root_path, $imageset_path);
+ $actions[] = array(
+ 'HTML' => $this->user->lang['CANNOT_BE_INSTALLED']
+ );
}
else
{
- $style_row['store_db'] = $this->install_element($mode, $error, 'install', $root_path, $style_row[$mode . '_id'], $style_row[$mode . '_name'], $install_path, $style_row[$mode . '_copyright'], $style_row['store_db']);
+ $actions[] = array(
+ 'U_ACTION' => $this->u_action . '&amp;action=install&amp;hash=' . generate_link_hash('install') . '&amp;dir=' . urlencode($style['style_path']),
+ 'L_ACTION' => $this->user->lang['INSTALL_STYLE']
+ );
}
+ }
- if (!sizeof($error))
- {
- $cache->destroy('sql', STYLES_TABLE);
+ // todo: add hook
- $message = ($style_row['store_db']) ? '_ADDED_DB' : '_ADDED';
- trigger_error($user->lang[$l_type . $message] . adm_back_link($this->u_action));
- }
+ // Assign template variables
+ $this->template->assign_block_vars('styles_list', $row);
+ foreach ($actions as $action)
+ {
+ $this->template->assign_block_vars('styles_list.actions', $action);
}
- $this->page_title = 'INSTALL_' . $l_type;
-
- $template->assign_vars(array(
- 'S_DETAILS' => true,
- 'S_INSTALL' => true,
- 'S_ERROR_MSG' => (sizeof($error)) ? true : false,
- 'S_LOCATION' => (isset($installcfg['inherit_from']) && $installcfg['inherit_from']) ? false : true,
- 'S_STYLE' => ($mode == 'style') ? true : false,
- 'S_TEMPLATE' => ($mode == 'template') ? true : false,
- 'S_SUPERTEMPLATE' => (isset($installcfg['inherit_from'])) ? $installcfg['inherit_from'] : '',
- 'S_THEME' => ($mode == 'theme') ? true : false,
-
- 'S_STORE_DB' => (isset($style_row[$mode . '_storedb'])) ? $style_row[$mode . '_storedb'] : 0,
- 'S_STYLE_ACTIVE' => (isset($style_row['style_active'])) ? $style_row['style_active'] : 0,
- 'S_STYLE_DEFAULT' => (isset($style_row['style_default'])) ? $style_row['style_default'] : 0,
-
- 'U_ACTION' => $this->u_action . "&amp;action=install&amp;path=" . urlencode($install_path),
- 'U_BACK' => $this->u_action,
-
- 'L_TITLE' => $user->lang[$this->page_title],
- 'L_EXPLAIN' => $user->lang[$this->page_title . '_EXPLAIN'],
- 'L_NAME' => $user->lang[$l_type . '_NAME'],
- 'L_LOCATION' => ($mode == 'template' || $mode == 'theme') ? $user->lang[$l_type . '_LOCATION'] : '',
- 'L_LOCATION_EXPLAIN' => ($mode == 'template' || $mode == 'theme') ? $user->lang[$l_type . '_LOCATION_EXPLAIN'] : '',
-
- 'ERROR_MSG' => (sizeof($error)) ? implode('<br />', $error) : '',
- 'NAME' => $style_row[$mode . '_name'],
- 'COPYRIGHT' => $style_row[$mode . '_copyright'],
- 'TEMPLATE_NAME' => ($mode == 'style') ? $style_row['template_name'] : '',
- 'THEME_NAME' => ($mode == 'style') ? $style_row['theme_name'] : '',
- 'IMAGESET_NAME' => ($mode == 'style') ? $style_row['imageset_name'] : '')
- );
+ // Increase counters
+ $counter = ($style['style_id']) ? ($style['style_active'] ? 'active' : 'inactive') : (empty($style['_available']) ? 'cannotinstall' : 'caninstall');
+ if (!isset($this->style_counters))
+ {
+ $this->style_counters = array(
+ 'total' => 0,
+ 'active' => 0,
+ 'inactive' => 0,
+ 'caninstall' => 0,
+ 'cannotinstall' => 0
+ );
+ }
+ $this->style_counters[$counter]++;
+ $this->style_counters['total']++;
}
/**
- * Add new style
+ * Show welcome message
+ *
+ * @param string $title main title
+ * @param string $description page description
*/
- function add($mode)
+ protected function welcome_message($title, $description)
{
- global $phpbb_root_path, $phpEx, $config, $db, $cache, $user, $template;
-
- $l_type = strtoupper($mode);
- $element_ary = array('template' => STYLES_TEMPLATE_TABLE, 'theme' => STYLES_THEME_TABLE, 'imageset' => STYLES_IMAGESET_TABLE);
- $error = array();
-
- $style_row = array(
- $mode . '_name' => utf8_normalize_nfc(request_var('name', '', true)),
- $mode . '_copyright' => utf8_normalize_nfc(request_var('copyright', '', true)),
- 'template_id' => 0,
- 'theme_id' => 0,
- 'imageset_id' => 0,
- 'store_db' => request_var('store_db', 0),
- 'style_active' => request_var('style_active', 1),
- 'style_default' => request_var('style_default', 0),
+ $this->template->assign_vars(array(
+ 'L_TITLE' => $this->user->lang[$title],
+ 'L_EXPLAIN' => (isset($this->user->lang[$description])) ? $this->user->lang[$description] : ''
+ )
);
+ }
- $basis = request_var('basis', 0);
- $update = (isset($_POST['update'])) ? true : false;
-
- if ($basis)
- {
- switch ($mode)
- {
- case 'style':
- $sql_select = 'template_id, theme_id, imageset_id';
- $sql_from = STYLES_TABLE;
- break;
-
- case 'template':
- $sql_select = 'template_id';
- $sql_from = STYLES_TEMPLATE_TABLE;
- break;
-
- case 'theme':
- $sql_select = 'theme_id';
- $sql_from = STYLES_THEME_TABLE;
- break;
-
- case 'imageset':
- $sql_select = 'imageset_id';
- $sql_from = STYLES_IMAGESET_TABLE;
- break;
- }
-
- $sql = "SELECT $sql_select
- FROM $sql_from
- WHERE {$mode}_id = $basis";
- $result = $db->sql_query($sql);
- $row = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
-
- if (!$row)
- {
- $error[] = $user->lang['NO_' . $l_type];
- }
-
- if (!sizeof($error))
- {
- $style_row['template_id'] = (isset($row['template_id'])) ? $row['template_id'] : $style_row['template_id'];
- $style_row['theme_id'] = (isset($row['theme_id'])) ? $row['theme_id'] : $style_row['theme_id'];
- $style_row['imageset_id'] = (isset($row['imageset_id'])) ? $row['imageset_id'] : $style_row['imageset_id'];
- }
- }
-
- if ($update)
- {
- $style_row['template_id'] = request_var('template_id', $style_row['template_id']);
- $style_row['theme_id'] = request_var('theme_id', $style_row['theme_id']);
- $style_row['imageset_id'] = request_var('imageset_id', $style_row['imageset_id']);
-
- if ($mode == 'style' && (!$style_row['template_id'] || !$style_row['theme_id'] || !$style_row['imageset_id']))
- {
- $error[] = $user->lang['STYLE_ERR_NO_IDS'];
- }
- }
-
- // User has submitted form and no errors have occurred
- if ($update && !sizeof($error))
- {
- if ($mode == 'style')
- {
- $style_row['style_id'] = 0;
-
- $this->install_style($error, 'add', '', $style_row['style_id'], $style_row['style_name'], '', $style_row['style_copyright'], $style_row['style_active'], $style_row['style_default'], $style_row);
- }
-
- if (!sizeof($error))
- {
- $cache->destroy('sql', STYLES_TABLE);
-
- $message = ($style_row['store_db']) ? '_ADDED_DB' : '_ADDED';
- trigger_error($user->lang[$l_type . $message] . adm_back_link($this->u_action));
- }
- }
+ /**
+ * Find all directories that have styles
+ *
+ * @return array Directory names
+ */
+ protected function find_style_dirs()
+ {
+ $styles = array();
- if ($mode == 'style')
+ $dp = @opendir($this->styles_path);
+ if ($dp)
{
- foreach ($element_ary as $element => $table)
+ while (($file = readdir($dp)) !== false)
{
- $sql = "SELECT {$element}_id, {$element}_name
- FROM $table
- ORDER BY {$element}_id ASC";
- $result = $db->sql_query($sql);
+ $dir = $this->styles_path . $file;
+ if ($file[0] == '.' || !is_dir($dir))
+ {
+ continue;
+ }
- ${$element . '_options'} = '';
- while ($row = $db->sql_fetchrow($result))
+ if (file_exists("{$dir}/style.cfg"))
{
- $selected = ($row[$element . '_id'] == $style_row[$element . '_id']) ? ' selected="selected"' : '';
- ${$element . '_options'} .= '<option value="' . $row[$element . '_id'] . '"' . $selected . '>' . $row[$element . '_name'] . '</option>';
+ $styles[] = $file;
}
- $db->sql_freeresult($result);
}
+ closedir($dp);
}
- $this->page_title = 'ADD_' . $l_type;
-
- $template->assign_vars(array(
- 'S_DETAILS' => true,
- 'S_ADD' => true,
- 'S_ERROR_MSG' => (sizeof($error)) ? true : false,
- 'S_STYLE' => ($mode == 'style') ? true : false,
- 'S_TEMPLATE' => ($mode == 'template') ? true : false,
- 'S_THEME' => ($mode == 'theme') ? true : false,
- 'S_BASIS' => ($basis) ? true : false,
-
- 'S_STORE_DB' => (isset($style_row['storedb'])) ? $style_row['storedb'] : 0,
- 'S_STYLE_ACTIVE' => (isset($style_row['style_active'])) ? $style_row['style_active'] : 0,
- 'S_STYLE_DEFAULT' => (isset($style_row['style_default'])) ? $style_row['style_default'] : 0,
- 'S_TEMPLATE_OPTIONS' => ($mode == 'style') ? $template_options : '',
- 'S_THEME_OPTIONS' => ($mode == 'style') ? $theme_options : '',
- 'S_IMAGESET_OPTIONS' => ($mode == 'style') ? $imageset_options : '',
-
- 'U_ACTION' => $this->u_action . '&amp;action=add&amp;basis=' . $basis,
- 'U_BACK' => $this->u_action,
-
- 'L_TITLE' => $user->lang[$this->page_title],
- 'L_EXPLAIN' => $user->lang[$this->page_title . '_EXPLAIN'],
- 'L_NAME' => $user->lang[$l_type . '_NAME'],
- 'L_LOCATION' => ($mode == 'template' || $mode == 'theme') ? $user->lang[$l_type . '_LOCATION'] : '',
- 'L_LOCATION_EXPLAIN' => ($mode == 'template' || $mode == 'theme') ? $user->lang[$l_type . '_LOCATION_EXPLAIN'] : '',
-
- 'ERROR_MSG' => (sizeof($error)) ? implode('<br />', $error) : '',
- 'NAME' => $style_row[$mode . '_name'],
- 'COPYRIGHT' => $style_row[$mode . '_copyright'])
- );
-
+ return $styles;
}
/**
-
- $reqd_template = (isset($installcfg['required_template'])) ? $installcfg['required_template'] : false;
- $reqd_theme = (isset($installcfg['required_theme'])) ? $installcfg['required_theme'] : false;
- $reqd_imageset = (isset($installcfg['required_imageset'])) ? $installcfg['required_imageset'] : false;
-
- // Check to see if each element is already installed, if it is grab the id
- foreach ($element_ary as $element => $table)
- {
- $style_row = array_merge($style_row, array(
- $element . '_id' => 0,
- $element . '_name' => '',
- $element . '_copyright' => '')
- );
-
- $this->test_installed($element, $error, $root_path, ${'reqd_' . $element}, $style_row[$element . '_id'], $style_row[$element . '_name'], $style_row[$element . '_copyright']);
- * Is this element installed? If not, grab its cfg details
+ * Sort styles
*/
- function test_installed($element, &$error, $root_path, $reqd_name, &$id, &$name, &$copyright)
+ public function sort_styles($style1, $style2)
{
- global $db, $user;
-
- switch ($element)
+ if ($style1['style_active'] != $style2['style_active'])
{
- case 'template':
- $sql_from = STYLES_TEMPLATE_TABLE;
- break;
-
- case 'theme':
- $sql_from = STYLES_THEME_TABLE;
- break;
-
- case 'imageset':
- $sql_from = STYLES_IMAGESET_TABLE;
- break;
+ return ($style1['style_active']) ? -1 : 1;
}
-
- $l_element = strtoupper($element);
-
- $chk_name = ($reqd_name !== false) ? $reqd_name : $name;
-
- $sql = "SELECT {$element}_id, {$element}_name
- FROM $sql_from
- WHERE {$element}_name = '" . $db->sql_escape($chk_name) . "'";
- $result = $db->sql_query($sql);
-
- if ($row = $db->sql_fetchrow($result))
+ if (isset($style1['_available']) && $style1['_available'] != $style2['_available'])
{
- $name = $row[$element . '_name'];
- $id = $row[$element . '_id'];
+ return ($style1['_available']) ? -1 : 1;
}
- else
- {
- if (!($cfg = @file("$root_path$element/$element.cfg")))
- {
- $error[] = sprintf($user->lang['REQUIRES_' . $l_element], $reqd_name);
- return false;
- }
-
- $cfg = parse_cfg_file("$root_path$element/$element.cfg", $cfg);
-
- $name = $cfg['name'];
- $copyright = $cfg['copyright'];
- $id = 0;
-
- unset($cfg);
- }
- $db->sql_freeresult($result);
+ return strcasecmp(isset($style1['style_name']) ? $style1['style_name'] : $style1['name'], isset($style2['style_name']) ? $style2['style_name'] : $style2['name']);
}
/**
- * Install/Add style
+ * Read style configuration file
+ *
+ * @param string $dir style directory
+ * @return array|bool Style data, false on error
*/
- function install_style(&$error, $action, $root_path, &$id, $name, $path, $copyright, $active, $default, &$style_row, $template_root_path = false, $template_path = false, $theme_root_path = false, $theme_path = false, $imageset_root_path = false, $imageset_path = false)
+ protected function read_style_cfg($dir)
{
- global $config, $db, $user;
+ static $required = array('name', 'phpbb_version', 'copyright');
+ $cfg = parse_cfg_file($this->styles_path . $dir . '/style.cfg');
- $element_ary = array('template', 'theme', 'imageset');
-
- if (!$name)
- {
- $error[] = $user->lang['STYLE_ERR_STYLE_NAME'];
- }
-
- // Check length settings
- if (utf8_strlen($name) > 30)
- {
- $error[] = $user->lang['STYLE_ERR_NAME_LONG'];
- }
-
- if (utf8_strlen($copyright) > 60)
- {
- $error[] = $user->lang['STYLE_ERR_COPY_LONG'];
- }
-
- // Check if the name already exist
- $sql = 'SELECT style_id
- FROM ' . STYLES_TABLE . "
- WHERE style_name = '" . $db->sql_escape($name) . "'";
- $result = $db->sql_query($sql);
- $row = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
-
- if ($row)
- {
- $error[] = $user->lang['STYLE_ERR_NAME_EXIST'];
- }
-
- if (sizeof($error))
+ // Check if it is a valid file
+ foreach ($required as $key)
{
- return false;
- }
-
- foreach ($element_ary as $element)
- {
- // Zero id value ... need to install element ... run usual checks
- // and do the install if necessary
- if (!$style_row[$element . '_id'])
+ if (!isset($cfg[$key]))
{
- $this->install_element($element, $error, $action, (${$element . '_root_path'}) ? ${$element . '_root_path'} : $root_path, $style_row[$element . '_id'], $style_row[$element . '_name'], (${$element . '_path'}) ? ${$element . '_path'} : $path, $style_row[$element . '_copyright']);
+ return false;
}
}
- if (!$style_row['template_id'] || !$style_row['theme_id'] || !$style_row['imageset_id'])
+ // Check data
+ if (!isset($cfg['parent']) || !is_string($cfg['parent']) || $cfg['parent'] == $cfg['name'])
{
- $error[] = $user->lang['STYLE_ERR_NO_IDS'];
+ $cfg['parent'] = '';
}
-
- if (sizeof($error))
+ if (!isset($cfg['template_bitfield']))
{
- return false;
+ $cfg['template_bitfield'] = $this->default_bitfield();
}
- $db->sql_transaction('begin');
-
- $sql_ary = array(
- 'style_name' => $name,
- 'style_copyright' => $copyright,
- 'style_active' => (int) $active,
- 'template_id' => (int) $style_row['template_id'],
- 'theme_id' => (int) $style_row['theme_id'],
- 'imageset_id' => (int) $style_row['imageset_id'],
- );
-
- $sql = 'INSERT INTO ' . STYLES_TABLE . '
- ' . $db->sql_build_array('INSERT', $sql_ary);
- $db->sql_query($sql);
-
- $id = $db->sql_nextid();
-
- if ($default)
- {
- $sql = 'UPDATE ' . USERS_TABLE . "
- SET user_style = $id
- WHERE user_style = " . $config['default_style'];
- $db->sql_query($sql);
-
- set_config('default_style', $id);
- }
-
- $db->sql_transaction('commit');
-
- add_log('admin', 'LOG_STYLE_ADD', $name);
+ return $cfg;
}
/**
- * Install/add an element, doing various checks as we go
+ * Install style
+ *
+ * @param array $style style data
+ * @return int Style id
*/
- function install_element($mode, &$error, $action, $root_path, &$id, $name, $path, $copyright, $store_db = 0)
+ protected function install_style($style)
{
- global $phpbb_root_path, $db, $user;
-
- // we parse the cfg here (again)
- $cfg_data = parse_cfg_file("$root_path$mode/$mode.cfg");
-
- switch ($mode)
- {
- case 'template':
- $sql_from = STYLES_TEMPLATE_TABLE;
- break;
-
- case 'theme':
- $sql_from = STYLES_THEME_TABLE;
- break;
-
- case 'imageset':
- $sql_from = STYLES_IMAGESET_TABLE;
- break;
- }
-
- $l_type = strtoupper($mode);
-
- if (!$name)
- {
- $error[] = $user->lang[$l_type . '_ERR_STYLE_NAME'];
- }
-
- // Check length settings
- if (utf8_strlen($name) > 30)
- {
- $error[] = $user->lang[$l_type . '_ERR_NAME_LONG'];
- }
-
- if (utf8_strlen($copyright) > 60)
- {
- $error[] = $user->lang[$l_type . '_ERR_COPY_LONG'];
- }
-
- // Check if the name already exist
- $sql = "SELECT {$mode}_id
- FROM $sql_from
- WHERE {$mode}_name = '" . $db->sql_escape($name) . "'";
- $result = $db->sql_query($sql);
- $row = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
-
- if ($row)
+ // Generate row
+ $sql_ary = array();
+ foreach ($style as $key => $value)
{
- // If it exist, we just use the style on installation
- if ($action == 'install')
+ if ($key != 'style_id' && substr($key, 0, 1) != '_')
{
- $id = $row[$mode . '_id'];
- return false;
+ $sql_ary[$key] = $value;
}
-
- $error[] = $user->lang[$l_type . '_ERR_NAME_EXIST'];
}
- if (isset($cfg_data['inherit_from']) && $cfg_data['inherit_from'])
- {
- if ($mode === 'template')
- {
- $select_bf = ', bbcode_bitfield';
- }
- else
- {
- $select_bf = '';
- }
+ // Add to database
+ $this->db->sql_transaction('begin');
- $sql = "SELECT {$mode}_id, {$mode}_name, {$mode}_path, {$mode}_storedb $select_bf
- FROM $sql_from
- WHERE {$mode}_name = '" . $db->sql_escape($cfg_data['inherit_from']) . "'
- AND {$mode}_inherits_id = 0";
- $result = $db->sql_query($sql);
- $row = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
- if (!$row)
- {
- $error[] = sprintf($user->lang[$l_type . '_ERR_REQUIRED_OR_INCOMPLETE'], $cfg_data['inherit_from']);
- }
- else
- {
- $inherit_id = $row["{$mode}_id"];
- $inherit_path = $row["{$mode}_path"];
- $inherit_bf = ($mode === 'template') ? $row["bbcode_bitfield"] : false;
- $cfg_data['store_db'] = $row["{$mode}_storedb"];
- $store_db = $row["{$mode}_storedb"];
- }
- }
- else
- {
- $inherit_id = 0;
- $inherit_path = '';
- $inherit_bf = false;
- }
-
- if (sizeof($error))
- {
- return false;
- }
-
- $sql_ary = array(
- $mode . '_name' => $name,
- $mode . '_copyright' => $copyright,
- $mode . '_path' => $path,
- );
-
- switch ($mode)
- {
- case 'template':
- // We check if the template author defined a different bitfield
- if (!empty($cfg_data['template_bitfield']))
- {
- $sql_ary['bbcode_bitfield'] = $cfg_data['template_bitfield'];
- }
- else if ($inherit_bf)
- {
- $sql_ary['bbcode_bitfield'] = $inherit_bf;
- }
- else
- {
- $sql_ary['bbcode_bitfield'] = TEMPLATE_BITFIELD;
- }
-
- // We set a pre-defined bitfield here which we may use further in 3.2
- $sql_ary += array(
- 'template_storedb' => $store_db,
- );
- if (isset($cfg_data['inherit_from']) && $cfg_data['inherit_from'])
- {
- $sql_ary += array(
- 'template_inherits_id' => $inherit_id,
- 'template_inherit_path' => $inherit_path,
- );
- }
- break;
-
- case 'theme':
- // We are only interested in the theme configuration for now
-
- if (isset($cfg_data['parse_css_file']) && $cfg_data['parse_css_file'])
- {
- $store_db = 1;
- }
-
- $sql_ary += array(
- 'theme_storedb' => $store_db,
- 'theme_data' => ($store_db) ? $this->db_theme_data($sql_ary, false, $root_path) : '',
- 'theme_mtime' => (int) filemtime("{$phpbb_root_path}styles/$path/theme/stylesheet.css")
- );
- break;
-
- // all the heavy lifting is done later
- case 'imageset':
- break;
- }
-
- $db->sql_transaction('begin');
-
- $sql = "INSERT INTO $sql_from
- " . $db->sql_build_array('INSERT', $sql_ary);
- $db->sql_query($sql);
-
- $id = $db->sql_nextid();
-
- if ($mode == 'template' && $store_db)
- {
- $filelist = filelist("{$root_path}template", '', 'html');
- $this->store_templates('insert', $id, $path, $filelist);
- }
- else if ($mode == 'imageset')
- {
- $cfg_data = parse_cfg_file("$root_path$mode/imageset.cfg");
-
- $imageset_definitions = array();
- foreach ($this->imageset_keys as $topic => $key_array)
- {
- $imageset_definitions = array_merge($imageset_definitions, $key_array);
- }
-
- foreach ($cfg_data as $key => $value)
- {
- if (strpos($value, '*') !== false)
- {
- if (substr($value, -1, 1) === '*')
- {
- list($image_filename, $image_height) = explode('*', $value);
- $image_width = 0;
- }
- else
- {
- list($image_filename, $image_height, $image_width) = explode('*', $value);
- }
- }
- else
- {
- $image_filename = $value;
- $image_height = $image_width = 0;
- }
-
- if (strpos($key, 'img_') === 0 && $image_filename)
- {
- $key = substr($key, 4);
- if (in_array($key, $imageset_definitions))
- {
- $sql_ary = array(
- 'image_name' => $key,
- 'image_filename' => str_replace('{PATH}', "styles/$path/imageset/", trim($image_filename)),
- 'image_height' => (int) $image_height,
- 'image_width' => (int) $image_width,
- 'imageset_id' => (int) $id,
- 'image_lang' => '',
- );
- $db->sql_query('INSERT INTO ' . STYLES_IMAGESET_DATA_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary));
- }
- }
- }
- unset($cfg_data);
+ $sql = 'INSERT INTO ' . STYLES_TABLE . '
+ ' . $this->db->sql_build_array('INSERT', $sql_ary);
+ $this->db->sql_query($sql);
- $sql = 'SELECT lang_dir
- FROM ' . LANG_TABLE;
- $result = $db->sql_query($sql);
+ $id = $this->db->sql_nextid();
- while ($row = $db->sql_fetchrow($result))
- {
- if (@file_exists("$root_path$mode/{$row['lang_dir']}/imageset.cfg"))
- {
- $cfg_data_imageset_data = parse_cfg_file("$root_path$mode/{$row['lang_dir']}/imageset.cfg");
- foreach ($cfg_data_imageset_data as $image_name => $value)
- {
- if (strpos($value, '*') !== false)
- {
- if (substr($value, -1, 1) === '*')
- {
- list($image_filename, $image_height) = explode('*', $value);
- $image_width = 0;
- }
- else
- {
- list($image_filename, $image_height, $image_width) = explode('*', $value);
- }
- }
- else
- {
- $image_filename = $value;
- $image_height = $image_width = 0;
- }
+ $this->db->sql_transaction('commit');
- if (strpos($image_name, 'img_') === 0 && $image_filename)
- {
- $image_name = substr($image_name, 4);
- if (in_array($image_name, $imageset_definitions))
- {
- $sql_ary = array(
- 'image_name' => $image_name,
- 'image_filename' => $image_filename,
- 'image_height' => (int) $image_height,
- 'image_width' => (int) $image_width,
- 'imageset_id' => (int) $id,
- 'image_lang' => $row['lang_dir'],
- );
- $db->sql_query('INSERT INTO ' . STYLES_IMAGESET_DATA_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary));
- }
- }
- }
- unset($cfg_data_imageset_data);
- }
- }
- $db->sql_freeresult($result);
- }
+ add_log('admin', 'LOG_STYLE_ADD', $sql_ary['style_name']);
- $db->sql_transaction('commit');
-
- $log = ($store_db) ? 'LOG_' . $l_type . '_ADD_DB' : 'LOG_' . $l_type . '_ADD_FS';
- add_log('admin', $log, $name);
-
- // Return store_db in case it had to be altered
- return $store_db;
+ return $id;
}
/**
- * Checks downwards dependencies
+ * Lists all styles
*
- * @access public
- * @param string $mode The element type to check - only template is supported
- * @param int $id The template id
- * @returns false if no component inherits, array with name, path and id for each subtemplate otherwise
+ * @return array Rows with styles data
*/
- function check_inheritance($mode, $id)
+ protected function get_styles()
{
- global $db;
-
- $l_type = strtoupper($mode);
-
- switch ($mode)
- {
- case 'template':
- $sql_from = STYLES_TEMPLATE_TABLE;
- break;
+ $sql = 'SELECT *
+ FROM ' . STYLES_TABLE;
+ $result = $this->db->sql_query($sql);
- case 'theme':
- $sql_from = STYLES_THEME_TABLE;
- break;
+ $rows = $this->db->sql_fetchrowset($result);
+ $this->db->sql_freeresult($result);
- case 'imageset':
- $sql_from = STYLES_IMAGESET_TABLE;
- break;
- }
+ return $rows;
+ }
- $sql = "SELECT {$mode}_id, {$mode}_name, {$mode}_path
- FROM $sql_from
- WHERE {$mode}_inherits_id = " . (int) $id;
- $result = $db->sql_query($sql);
+ /**
+ * Count users for each style
+ *
+ * @return array Styles in following format: [style_id] = number of users
+ */
+ protected function get_users()
+ {
+ $sql = 'SELECT user_style, COUNT(user_style) AS style_count
+ FROM ' . USERS_TABLE . '
+ GROUP BY user_style';
+ $result = $this->db->sql_query($sql);
- $names = array();
- while ($row = $db->sql_fetchrow($result))
+ $style_count = array();
+ while ($row = $this->db->sql_fetchrow($result))
{
-
- $names[$row["{$mode}_id"]] = array(
- "{$mode}_id" => $row["{$mode}_id"],
- "{$mode}_name" => $row["{$mode}_name"],
- "{$mode}_path" => $row["{$mode}_path"],
- );
+ $style_count[$row['user_style']] = $row['style_count'];
}
- $db->sql_freeresult($result);
+ $this->db->sql_freeresult($result);
- if (sizeof($names))
- {
- return $names;
- }
- else
- {
- return false;
- }
+ return $style_count;
}
/**
- * Checks upwards dependencies
+ * Uninstall style
*
- * @access public
- * @param string $mode The element type to check - only template is supported
- * @param int $id The template id
- * @returns false if the component does not inherit, array with name, path and id otherwise
+ * @param array $style Style data
+ * @return bool|string True on success, error message on error
*/
- function get_super($mode, $id)
+ protected function uninstall_style($style)
{
- global $db;
-
- $l_type = strtoupper($mode);
-
- switch ($mode)
- {
- case 'template':
- $sql_from = STYLES_TEMPLATE_TABLE;
- break;
+ $id = $style['style_id'];
+ $path = $style['style_path'];
- case 'theme':
- $sql_from = STYLES_THEME_TABLE;
- break;
-
- case 'imageset':
- $sql_from = STYLES_IMAGESET_TABLE;
- break;
- }
+ // Check if style has child styles
+ $sql = 'SELECT style_id
+ FROM ' . STYLES_TABLE . '
+ WHERE style_parent_id = ' . (int) $id . " OR style_parent_tree = '" . $this->db->sql_escape($path) . "'";
+ $result = $this->db->sql_query($sql);
- $sql = "SELECT {$mode}_inherits_id
- FROM $sql_from
- WHERE {$mode}_id = " . (int) $id;
- $result = $db->sql_query_limit($sql, 1);
+ $conflict = $this->db->sql_fetchrow($result);
+ $this->db->sql_freeresult($result);
- if ($row = $db->sql_fetchrow($result))
- {
- $db->sql_freeresult($result);
- }
- else
+ if ($conflict !== false)
{
- return false;
+ return sprintf($this->user->lang['STYLE_UNINSTALL_DEPENDENT'], $style['style_name']);
}
- $super_id = $row["{$mode}_inherits_id"];
-
- $sql = "SELECT {$mode}_id, {$mode}_name, {$mode}_path
- FROM $sql_from
- WHERE {$mode}_id = " . (int) $super_id;
-
- $result = $db->sql_query_limit($sql, 1);
- if ($row = $db->sql_fetchrow($result))
- {
- $db->sql_freeresult($result);
- return $row;
- }
+ // Change default style for users
+ $sql = 'UPDATE ' . USERS_TABLE . '
+ SET user_style = 0
+ WHERE user_style = ' . $id;
+ $this->db->sql_query($sql);
- return false;
+ // Uninstall style
+ $sql = 'DELETE FROM ' . STYLES_TABLE . '
+ WHERE style_id = ' . $id;
+ $this->db->sql_query($sql);
+ return true;
}
/**
- * Moves a template set and its subtemplates to the database
+ * Delete all files in style directory
*
- * @access public
- * @param string $mode The component to move - only template is supported
- * @param int $id The template id
+ * @param string $path Style directory
+ * @param string $dir Directory to remove inside style's directory
+ * @return bool True on success, false on error
*/
- function store_in_db($mode, $id)
+ protected function delete_style_files($path, $dir = '')
{
- global $db, $user;
+ $dirname = $this->styles_path . $path . $dir;
+ $result = true;
- $error = array();
- $l_type = strtoupper($mode);
- if ($super = $this->get_super($mode, $id))
- {
- $error[] = (sprintf($user->lang["{$l_type}_INHERITS"], $super['template_name']));
- return $error;
- }
+ $dp = @opendir($dirname);
- $sql = "SELECT {$mode}_id, {$mode}_name, {$mode}_path
- FROM " . STYLES_TEMPLATE_TABLE . '
- WHERE template_id = ' . (int) $id;
-
- $result = $db->sql_query_limit($sql, 1);
- if ($row = $db->sql_fetchrow($result))
+ if ($dp)
{
- $db->sql_freeresult($result);
- $subs = $this->check_inheritance($mode, $id);
-
- $this->_store_in_db($mode, $id, $row["{$mode}_path"]);
- if ($subs && sizeof($subs))
+ while (($file = readdir($dp)) !== false)
{
- foreach ($subs as $sub_id => $sub)
+ if ($file == '.' || $file == '..')
+ {
+ continue;
+ }
+ $filename = $dirname . '/' . $file;
+ if (is_dir($filename))
+ {
+ if (!$this->delete_style_files($path, $dir . '/' . $file))
+ {
+ $result = false;
+ }
+ }
+ else
{
- if ($err = $this->_store_in_db($mode, $sub["{$mode}_id"], $sub["{$mode}_path"]))
+ if (!@unlink($filename))
{
- $error[] = $err;
+ $result = false;
}
}
}
+ closedir($dp);
}
- if (sizeof($error))
+ if (!@rmdir($dirname))
{
- return $error;
+ return false;
}
- return false;
- }
-
- /**
- * Moves a template set to the database
- *
- * @access private
- * @param string $mode The component to move - only template is supported
- * @param int $id The template id
- * @param string $path TThe path to the template files
- */
- function _store_in_db($mode, $id, $path)
- {
- global $phpbb_root_path, $db;
-
- $filelist = filelist("{$phpbb_root_path}styles/{$path}/template", '', 'html');
- $this->store_templates('insert', $id, $path, $filelist);
-
- // Okay, we do the query here -shouldn't be triggered often.
- $sql = 'UPDATE ' . STYLES_TEMPLATE_TABLE . '
- SET template_storedb = 1
- WHERE template_id = ' . $id;
- $db->sql_query($sql);
+ return $result;
}
/**
- * Moves a template set and its subtemplates to the filesystem
+ * Get list of items from posted data
*
- * @access public
- * @param string $mode The component to move - only template is supported
- * @param int $id The template id
+ * @param string $name Variable name
+ * @param string|int $default Default value for array
+ * @param bool $error If true, error will be triggered if list is empty
+ * @return array Items
*/
- function store_in_fs($mode, $id)
+ protected function request_vars($name, $default, $error = false)
{
- global $db, $user;
+ $item = $this->request->variable($name, $default);
+ $items = $this->request->variable($name . 's', array($default));
- $error = array();
- $l_type = strtoupper($mode);
- if ($super = $this->get_super($mode, $id))
+ if (count($items) == 1 && $items[0] == $default)
{
- $error[] = (sprintf($user->lang["{$l_type}_INHERITS"], $super['template_name']));
- return($error);
+ $items = array();
}
- $sql = "SELECT {$mode}_id, {$mode}_name, {$mode}_path
- FROM " . STYLES_TEMPLATE_TABLE . '
- WHERE template_id = ' . (int) $id;
-
- $result = $db->sql_query_limit($sql, 1);
- if ($row = $db->sql_fetchrow($result))
+ if ($item != $default && !count($items))
{
- $db->sql_freeresult($result);
- if (!sizeof($error))
- {
- $subs = $this->check_inheritance($mode, $id);
-
- $this->_store_in_fs($mode, $id, $row["{$mode}_path"]);
+ $items[] = $item;
+ }
- if ($subs && sizeof($subs))
- {
- foreach ($subs as $sub_id => $sub)
- {
- $this->_store_in_fs($mode, $sub["{$mode}_id"], $sub["{$mode}_path"]);
- }
- }
- }
- if (sizeof($error))
- {
- $this->store_in_db($id, $mode);
- return $error;
- }
+ if ($error && !count($items))
+ {
+ trigger_error($this->user->lang['NO_MATCHING_STYLES_FOUND'] . adm_back_link($this->u_action), E_USER_WARNING);
}
- return false;
+
+ return $items;
}
/**
- * Moves a template set to the filesystem
+ * Generates default bitfield
+ *
+ * This bitfield decides which bbcodes are defined in a template.
*
- * @access private
- * @param string $mode The component to move - only template is supported
- * @param int $id The template id
- * @param string $path The path to the template
+ * @return string Bitfield
*/
- function _store_in_fs($mode, $id, $path)
+ protected function default_bitfield()
{
- global $phpbb_root_path, $db, $user, $safe_mode;
-
- $store_db = 0;
- $error = array();
- if (!$safe_mode && phpbb_is_writable("{$phpbb_root_path}styles/{$path}/template"))
+ static $value;
+ if (isset($value))
{
- $sql = 'SELECT *
- FROM ' . STYLES_TEMPLATE_DATA_TABLE . "
- WHERE template_id = $id";
- $result = $db->sql_query($sql);
-
- while ($row = $db->sql_fetchrow($result))
- {
- if (!($fp = @fopen("{$phpbb_root_path}styles/{$path}/template/" . $row['template_filename'], 'wb')))
- {
- $store_db = 1;
- $error[] = $user->lang['EDIT_TEMPLATE_STORED_DB'];
- break;
- }
-
- fwrite($fp, $row['template_data']);
- fclose($fp);
- }
- $db->sql_freeresult($result);
-
- if (!$store_db)
- {
- $sql = 'DELETE FROM ' . STYLES_TEMPLATE_DATA_TABLE . "
- WHERE template_id = $id";
- $db->sql_query($sql);
- }
+ return $value;
}
- if (sizeof($error))
- {
- return $error;
- }
- $sql = 'UPDATE ' . STYLES_TEMPLATE_TABLE . '
- SET template_storedb = 0
- WHERE template_id = ' . $id;
- $db->sql_query($sql);
- return false;
+ // Hardcoded template bitfield to add for new templates
+ $bitfield = new bitfield();
+ $bitfield->set(0);
+ $bitfield->set(1);
+ $bitfield->set(2);
+ $bitfield->set(3);
+ $bitfield->set(4);
+ $bitfield->set(8);
+ $bitfield->set(9);
+ $bitfield->set(11);
+ $bitfield->set(12);
+ $value = $bitfield->get_base64();
+ return $value;
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/acp/acp_update.php b/phpBB/includes/acp/acp_update.php
index 87d5c51b56..cee2ce222e 100644
--- a/phpBB/includes/acp/acp_update.php
+++ b/phpBB/includes/acp/acp_update.php
@@ -1,10 +1,13 @@
<?php
/**
*
-* @package acp
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -16,72 +19,64 @@ if (!defined('IN_PHPBB'))
exit;
}
-/**
-* @package acp
-*/
class acp_update
{
var $u_action;
function main($id, $mode)
{
- global $config, $db, $user, $auth, $template, $cache;
- global $phpbb_root_path, $phpbb_admin_path, $phpEx;
+ global $config, $user, $template, $request;
+ global $phpbb_root_path, $phpEx, $phpbb_container;
$user->add_lang('install');
$this->tpl_name = 'acp_update';
$this->page_title = 'ACP_VERSION_CHECK';
- // Get current and latest version
- $info = htmlspecialchars(obtain_latest_version_info(request_var('versioncheck_force', false)));
-
- if (empty($info))
+ $version_helper = $phpbb_container->get('version_helper');
+ try
{
- trigger_error('VERSIONCHECK_FAIL', E_USER_WARNING);
+ $recheck = $request->variable('versioncheck_force', false);
+ $updates_available = $version_helper->get_update_on_branch($recheck);
+ $upgrades_available = $version_helper->get_suggested_updates();
+ if (!empty($upgrades_available))
+ {
+ $upgrades_available = array_pop($upgrades_available);
+ }
}
-
- $info = explode("\n", $info);
- $latest_version = trim($info[0]);
-
- $announcement_url = trim($info[1]);
- $announcement_url = (strpos($announcement_url, '&amp;') === false) ? str_replace('&', '&amp;', $announcement_url) : $announcement_url;
- $update_link = append_sid($phpbb_root_path . 'install/index.' . $phpEx, 'mode=update');
-
- // next feature release
- $next_feature_version = $next_feature_announcement_url = false;
- if (isset($info[2]) && trim($info[2]) !== '')
+ catch (\RuntimeException $e)
{
- $next_feature_version = trim($info[2]);
- $next_feature_announcement_url = trim($info[3]);
+ $template->assign_var('S_VERSIONCHECK_FAIL', true);
+
+ $updates_available = array();
}
- // Determine automatic update...
- $sql = 'SELECT config_value
- FROM ' . CONFIG_TABLE . "
- WHERE config_name = 'version_update_from'";
- $result = $db->sql_query($sql);
- $version_update_from = (string) $db->sql_fetchfield('config_value');
- $db->sql_freeresult($result);
+ $template->assign_block_vars('updates_available', $updates_available);
- $current_version = (!empty($version_update_from)) ? $version_update_from : $config['version'];
+ $update_link = append_sid($phpbb_root_path . 'install/');
$template->assign_vars(array(
- 'S_UP_TO_DATE' => phpbb_version_compare($latest_version, $config['version'], '<='),
- 'S_UP_TO_DATE_AUTO' => phpbb_version_compare($latest_version, $current_version, '<='),
- 'S_VERSION_CHECK' => true,
- 'U_ACTION' => $this->u_action,
- 'U_VERSIONCHECK_FORCE' => append_sid($this->u_action . '&amp;versioncheck_force=1'),
+ 'S_UP_TO_DATE' => empty($updates_available),
+ 'U_ACTION' => $this->u_action,
+ 'U_VERSIONCHECK_FORCE' => append_sid($this->u_action . '&amp;versioncheck_force=1'),
- 'LATEST_VERSION' => $latest_version,
- 'CURRENT_VERSION' => $config['version'],
- 'AUTO_VERSION' => $version_update_from,
- 'NEXT_FEATURE_VERSION' => $next_feature_version,
+ 'CURRENT_VERSION' => $config['version'],
- 'UPDATE_INSTRUCTIONS' => sprintf($user->lang['UPDATE_INSTRUCTIONS'], $announcement_url, $update_link),
- 'UPGRADE_INSTRUCTIONS' => $next_feature_version ? $user->lang('UPGRADE_INSTRUCTIONS', $next_feature_version, $next_feature_announcement_url) : false,
+ 'UPDATE_INSTRUCTIONS' => sprintf($user->lang['UPDATE_INSTRUCTIONS'], $update_link),
+ 'S_VERSION_UPGRADEABLE' => !empty($upgrades_available),
+ 'UPGRADE_INSTRUCTIONS' => !empty($upgrades_available) ? $user->lang('UPGRADE_INSTRUCTIONS', $upgrades_available['current'], $upgrades_available['announcement']) : false,
));
+
+ // Incomplete update?
+ if (phpbb_version_compare($config['version'], PHPBB_VERSION, '<'))
+ {
+ $database_update_link = append_sid($phpbb_root_path . 'install/database_update.' . $phpEx);
+
+ $template->assign_vars(array(
+ 'S_UPDATE_INCOMPLETE' => true,
+ 'FILES_VERSION' => PHPBB_VERSION,
+ 'INCOMPLETE_INSTRUCTIONS' => $user->lang('UPDATE_INCOMPLETE_EXPLAIN', $database_update_link),
+ ));
+ }
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php
index b82be8887c..cd44800af8 100644
--- a/phpBB/includes/acp/acp_users.php
+++ b/phpBB/includes/acp/acp_users.php
@@ -1,10 +1,13 @@
<?php
/**
*
-* @package acp
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -16,9 +19,6 @@ if (!defined('IN_PHPBB'))
exit;
}
-/**
-* @package acp
-*/
class acp_users
{
var $u_action;
@@ -33,16 +33,22 @@ class acp_users
{
global $config, $db, $user, $auth, $template, $cache;
global $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix, $file_uploads;
+ global $phpbb_dispatcher, $request;
+ global $phpbb_container;
$user->add_lang(array('posting', 'ucp', 'acp/users'));
$this->tpl_name = 'acp_users';
- $this->page_title = 'ACP_USER_' . strtoupper($mode);
$error = array();
$username = utf8_normalize_nfc(request_var('username', '', true));
$user_id = request_var('u', 0);
$action = request_var('action', '');
+ // Get referer to redirect user to the appropriate page after delete action
+ $redirect = request_var('redirect', '');
+ $redirect_tag = "redirect=$redirect";
+ $redirect_url = append_sid("{$phpbb_admin_path}index.$phpEx", "i=$redirect");
+
$submit = (isset($_POST['update']) && !isset($_POST['cancel'])) ? true : false;
$form_name = 'acp_users';
@@ -51,12 +57,15 @@ class acp_users
// Whois (special case)
if ($action == 'whois')
{
- include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
+ if (!function_exists('user_get_id_name'))
+ {
+ include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
+ }
$this->page_title = 'WHOIS';
$this->tpl_name = 'simple_body';
- $user_ip = request_var('user_ip', '');
+ $user_ip = phpbb_ip_normalise(request_var('user_ip', ''));
$domain = gethostbyaddr($user_ip);
$ipwhois = user_ipwhois($user_ip);
@@ -120,7 +129,7 @@ class acp_users
// Build modes dropdown list
$sql = 'SELECT module_mode, module_auth
FROM ' . MODULES_TABLE . "
- WHERE module_basename = 'users'
+ WHERE module_basename = 'acp_users'
AND module_enabled = 1
AND module_class = 'acp'
ORDER BY left_id, module_mode";
@@ -129,7 +138,7 @@ class acp_users
$dropdown_modes = array();
while ($row = $db->sql_fetchrow($result))
{
- if (!$this->p_master->module_auth($row['module_auth']))
+ if (!$this->p_master->module_auth_self($row['module_auth']))
{
continue;
}
@@ -145,9 +154,9 @@ class acp_users
}
$template->assign_vars(array(
- 'U_BACK' => $this->u_action,
+ 'U_BACK' => (empty($redirect)) ? $this->u_action : $redirect_url,
'U_MODE_SELECT' => append_sid("{$phpbb_admin_path}index.$phpEx", "i=$id&amp;u=$user_id"),
- 'U_ACTION' => $this->u_action . '&amp;u=' . $user_id,
+ 'U_ACTION' => $this->u_action . '&amp;u=' . $user_id . ((empty($redirect)) ? '' : '&amp;' . $redirect_tag),
'S_FORM_OPTIONS' => $s_form_options,
'MANAGED_USERNAME' => $user_row['username'])
);
@@ -158,11 +167,16 @@ class acp_users
trigger_error($user->lang['NOT_MANAGE_FOUNDER'] . adm_back_link($this->u_action), E_USER_WARNING);
}
+ $this->page_title = $user_row['username'] . ' :: ' . $user->lang('ACP_USER_' . strtoupper($mode));
+
switch ($mode)
{
case 'overview':
- include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
+ if (!function_exists('user_get_id_name'))
+ {
+ include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
+ }
$user->add_lang('acp/ban');
@@ -170,6 +184,21 @@ class acp_users
$delete_type = request_var('delete_type', '');
$ip = request_var('ip', 'ip');
+ /**
+ * Run code at beginning of ACP users overview
+ *
+ * @event core.acp_users_overview_before
+ * @var array user_row Current user data
+ * @var string mode Active module
+ * @var string action Module that should be run
+ * @var bool submit Do we display the form only
+ * or did the user press submit
+ * @var array error Array holding error messages
+ * @since 3.1.3-RC1
+ */
+ $vars = array('user_row', 'mode', 'action', 'submit', 'error');
+ extract($phpbb_dispatcher->trigger_event('core.acp_users_overview_before', compact($vars)));
+
if ($submit)
{
if ($delete)
@@ -203,19 +232,30 @@ class acp_users
user_delete($delete_type, $user_id, $user_row['username']);
add_log('admin', 'LOG_USER_DELETED', $user_row['username']);
- trigger_error($user->lang['USER_DELETED'] . adm_back_link($this->u_action));
+ trigger_error($user->lang['USER_DELETED'] . adm_back_link(
+ (empty($redirect)) ? $this->u_action : $redirect_url
+ )
+ );
}
else
{
- confirm_box(false, $user->lang['CONFIRM_OPERATION'], build_hidden_fields(array(
+ $delete_confirm_hidden_fields = array(
'u' => $user_id,
'i' => $id,
'mode' => $mode,
'action' => $action,
'update' => true,
'delete' => 1,
- 'delete_type' => $delete_type))
+ 'delete_type' => $delete_type,
);
+
+ // Checks if the redirection page is specified
+ if (!empty($redirect))
+ {
+ $delete_confirm_hidden_fields['redirect'] = $redirect;
+ }
+
+ confirm_box(false, $user->lang['CONFIRM_OPERATION'], build_hidden_fields($delete_confirm_hidden_fields));
}
}
else
@@ -320,7 +360,10 @@ class acp_users
if ($config['email_enable'])
{
- include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);
+ if (!class_exists('messenger'))
+ {
+ include($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);
+ }
$server_url = generate_board_url();
@@ -330,11 +373,6 @@ class acp_users
if ($user_row['user_type'] == USER_NORMAL)
{
user_active_flip('deactivate', $user_id, INACTIVE_REMIND);
-
- $sql = 'UPDATE ' . USERS_TABLE . "
- SET user_actkey = '" . $db->sql_escape($user_actkey) . "'
- WHERE user_id = $user_id";
- $db->sql_query($sql);
}
else
{
@@ -343,15 +381,25 @@ class acp_users
FROM ' . USERS_TABLE . '
WHERE user_id = ' . $user_id;
$result = $db->sql_query($sql);
- $user_actkey = (string) $db->sql_fetchfield('user_actkey');
+ $user_activation_key = (string) $db->sql_fetchfield('user_actkey');
$db->sql_freeresult($result);
+
+ $user_actkey = empty($user_activation_key) ? $user_actkey : $user_activation_key;
+ }
+
+ if ($user_row['user_type'] == USER_NORMAL || empty($user_activation_key))
+ {
+ $sql = 'UPDATE ' . USERS_TABLE . "
+ SET user_actkey = '" . $db->sql_escape($user_actkey) . "'
+ WHERE user_id = $user_id";
+ $db->sql_query($sql);
}
$messenger = new messenger(false);
$messenger->template($email_template, $user_row['user_lang']);
- $messenger->to($user_row['user_email'], $user_row['username']);
+ $messenger->set_addresses($user_row);
$messenger->anti_abuse_headers($config, $user);
@@ -400,13 +448,19 @@ class acp_users
{
if ($config['require_activation'] == USER_ACTIVATION_ADMIN)
{
- include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);
+ $phpbb_notifications = $phpbb_container->get('notification_manager');
+ $phpbb_notifications->delete_notifications('notification.type.admin_activate_user', $user_row['user_id']);
+
+ if (!class_exists('messenger'))
+ {
+ include($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);
+ }
$messenger = new messenger(false);
$messenger->template('admin_welcome_activated', $user_row['user_lang']);
- $messenger->to($user_row['user_email'], $user_row['username']);
+ $messenger->set_addresses($user_row);
$messenger->anti_abuse_headers($config, $user);
@@ -459,23 +513,9 @@ class acp_users
trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action . '&amp;u=' . $user_id), E_USER_WARNING);
}
- $sql_ary = array(
- 'user_avatar' => '',
- 'user_avatar_type' => 0,
- 'user_avatar_width' => 0,
- 'user_avatar_height' => 0,
- );
-
- $sql = 'UPDATE ' . USERS_TABLE . '
- SET ' . $db->sql_build_array('UPDATE', $sql_ary) . "
- WHERE user_id = $user_id";
- $db->sql_query($sql);
-
// Delete old avatar if present
- if ($user_row['user_avatar'] && $user_row['user_avatar_type'] != AVATAR_GALLERY)
- {
- avatar_delete('user', $user_row);
- }
+ $phpbb_avatar_manager = $phpbb_container->get('avatar.manager');
+ $phpbb_avatar_manager->handle_avatar_delete($db, $user, $phpbb_avatar_manager->clean_row($user_row, 'user'), USERS_TABLE, 'user_');
add_log('admin', 'LOG_USER_DEL_AVATAR', $user_row['username']);
add_log('user', $user_id, 'LOG_USER_DEL_AVATAR_USER');
@@ -626,29 +666,32 @@ class acp_users
$topic_id_ary = $move_topic_ary = $move_post_ary = $new_topic_id_ary = array();
$forum_id_ary = array($new_forum_id);
- $sql = 'SELECT topic_id, COUNT(post_id) AS total_posts
+ $sql = 'SELECT topic_id, post_visibility, COUNT(post_id) AS total_posts
FROM ' . POSTS_TABLE . "
WHERE poster_id = $user_id
AND forum_id <> $new_forum_id
- GROUP BY topic_id";
+ GROUP BY topic_id, post_visibility";
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result))
{
- $topic_id_ary[$row['topic_id']] = $row['total_posts'];
+ $topic_id_ary[$row['topic_id']][$row['post_visibility']] = $row['total_posts'];
}
$db->sql_freeresult($result);
if (sizeof($topic_id_ary))
{
- $sql = 'SELECT topic_id, forum_id, topic_title, topic_replies, topic_replies_real, topic_attachment
+ $sql = 'SELECT topic_id, forum_id, topic_title, topic_posts_approved, topic_posts_unapproved, topic_posts_softdeleted, topic_attachment
FROM ' . TOPICS_TABLE . '
WHERE ' . $db->sql_in_set('topic_id', array_keys($topic_id_ary));
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result))
{
- if (max($row['topic_replies'], $row['topic_replies_real']) + 1 == $topic_id_ary[$row['topic_id']])
+ if ($topic_id_ary[$row['topic_id']][ITEM_APPROVED] == $row['topic_posts_approved']
+ && $topic_id_ary[$row['topic_id']][ITEM_UNAPPROVED] == $row['topic_posts_unapproved']
+ && $topic_id_ary[$row['topic_id']][ITEM_REAPPROVE] == $row['topic_posts_unapproved']
+ && $topic_id_ary[$row['topic_id']][ITEM_DELETED] == $row['topic_posts_softdeleted'])
{
$move_topic_ary[] = $row['topic_id'];
}
@@ -681,7 +724,7 @@ class acp_users
'topic_time' => time(),
'forum_id' => $new_forum_id,
'icon_id' => 0,
- 'topic_approved' => 1,
+ 'topic_visibility' => ITEM_APPROVED,
'topic_title' => $post_ary['title'],
'topic_first_poster_name' => $user_row['username'],
'topic_type' => POST_NORMAL,
@@ -726,7 +769,6 @@ class acp_users
sync('forum', 'forum_id', $forum_id_ary, false, true);
}
-
add_log('admin', 'LOG_USER_MOVE_POSTS', $user_row['username'], $forum_info['forum_name']);
add_log('user', $user_id, 'LOG_USER_MOVE_POSTS_USER', $forum_info['forum_name']);
@@ -755,6 +797,19 @@ class acp_users
}
break;
+
+ default:
+ /**
+ * Run custom quicktool code
+ *
+ * @event core.acp_users_overview_run_quicktool
+ * @var array user_row Current user data
+ * @var string action Quick tool that should be run
+ * @since 3.1.0-a1
+ */
+ $vars = array('action', 'user_row');
+ extract($phpbb_dispatcher->trigger_event('core.acp_users_overview_run_quicktool', compact($vars)));
+ break;
}
// Handle registration info updates
@@ -762,9 +817,8 @@ class acp_users
'username' => utf8_normalize_nfc(request_var('user', $user_row['username'], true)),
'user_founder' => request_var('user_founder', ($user_row['user_type'] == USER_FOUNDER) ? 1 : 0),
'email' => strtolower(request_var('user_email', $user_row['user_email'])),
- 'email_confirm' => strtolower(request_var('email_confirm', '')),
- 'new_password' => request_var('new_password', '', true),
- 'password_confirm' => request_var('password_confirm', '', true),
+ 'new_password' => $request->variable('new_password', '', true),
+ 'password_confirm' => $request->variable('password_confirm', '', true),
);
// Validation data - we do not check the password complexity setting here
@@ -792,9 +846,8 @@ class acp_users
$check_ary += array(
'email' => array(
array('string', false, 6, 60),
- array('email', $user_row['user_email'])
+ array('user_email', $user_row['user_email']),
),
- 'email_confirm' => array('string', true, 6, 60)
);
}
@@ -805,19 +858,17 @@ class acp_users
$error[] = 'NEW_PASSWORD_ERROR';
}
- if ($data['email'] != $user_row['user_email'] && $data['email_confirm'] != $data['email'])
- {
- $error[] = 'NEW_EMAIL_ERROR';
- }
-
if (!check_form_key($form_name))
{
$error[] = 'FORM_INVALID';
}
+ // Instantiate passwords manager
+ $passwords_manager = $phpbb_container->get('passwords.manager');
+
// Which updates do we need to do?
$update_username = ($user_row['username'] != $data['username']) ? $data['username'] : false;
- $update_password = ($data['new_password'] && !phpbb_check_hash($data['new_password'], $user_row['user_password'])) ? true : false;
+ $update_password = $data['new_password'] && !$passwords_manager->check($data['new_password'], $user_row['user_password']);
$update_email = ($data['email'] != $user_row['user_email']) ? $data['email'] : false;
if (!sizeof($error))
@@ -868,6 +919,18 @@ class acp_users
}
}
+ /**
+ * Modify user data before we update it
+ *
+ * @event core.acp_users_overview_modify_data
+ * @var array user_row Current user data
+ * @var array data Submitted user data
+ * @var array sql_ary User data we udpate
+ * @since 3.1.0-a1
+ */
+ $vars = array('user_row', 'data', 'sql_ary');
+ extract($phpbb_dispatcher->trigger_event('core.acp_users_overview_modify_data', compact($vars)));
+
if ($update_username !== false)
{
$sql_ary['username'] = $update_username;
@@ -889,9 +952,8 @@ class acp_users
if ($update_password)
{
$sql_ary += array(
- 'user_password' => phpbb_hash($data['new_password']),
+ 'user_password' => $passwords_manager->hash($data['new_password']),
'user_passchg' => time(),
- 'user_pass_convert' => 0,
);
$user->reset_login_keys($user_id);
@@ -920,7 +982,7 @@ class acp_users
}
// Replace "error" strings with their real, localised form
- $error = preg_replace('#^([A-Z_]+)$#e', "(!empty(\$user->lang['\\1'])) ? \$user->lang['\\1'] : '\\1'", $error);
+ $error = array_map(array($user, 'lang'), $error);
}
if ($user_id == $user->data['user_id'])
@@ -958,12 +1020,6 @@ class acp_users
}
}
- $s_action_options = '<option class="sep" value="">' . $user->lang['SELECT_OPTION'] . '</option>';
- foreach ($quick_tool_ary as $value => $lang)
- {
- $s_action_options .= '<option value="' . $value . '">' . $user->lang['USER_ADMIN_' . $lang] . '</option>';
- }
-
if ($config['load_onlinetrack'])
{
$sql = 'SELECT MAX(session_time) AS session_time, MIN(session_viewonline) AS session_viewonline
@@ -978,7 +1034,24 @@ class acp_users
unset($row);
}
- $last_visit = (!empty($user_row['session_time'])) ? $user_row['session_time'] : $user_row['user_lastvisit'];
+ /**
+ * Add additional quick tool options and overwrite user data
+ *
+ * @event core.acp_users_display_overview
+ * @var array user_row Array with user data
+ * @var array quick_tool_ary Ouick tool options
+ * @since 3.1.0-a1
+ */
+ $vars = array('user_row', 'quick_tool_ary');
+ extract($phpbb_dispatcher->trigger_event('core.acp_users_display_overview', compact($vars)));
+
+ $s_action_options = '<option class="sep" value="">' . $user->lang['SELECT_OPTION'] . '</option>';
+ foreach ($quick_tool_ary as $value => $lang)
+ {
+ $s_action_options .= '<option value="' . $value . '">' . $user->lang['USER_ADMIN_' . $lang] . '</option>';
+ }
+
+ $last_active = (!empty($user_row['session_time'])) ? $user_row['session_time'] : $user_row['user_lastvisit'];
$inactive_reason = '';
if ($user_row['user_type'] == USER_INACTIVE)
@@ -1009,7 +1082,7 @@ class acp_users
$sql = 'SELECT COUNT(post_id) as posts_in_queue
FROM ' . POSTS_TABLE . '
WHERE poster_id = ' . $user_id . '
- AND post_approved = 0';
+ AND ' . $db->sql_in_set('post_visibility', array(ITEM_UNAPPROVED, ITEM_REAPPROVE));
$result = $db->sql_query($sql);
$user_row['posts_in_queue'] = (int) $db->sql_fetchfield('posts_in_queue');
$db->sql_freeresult($result);
@@ -1022,8 +1095,8 @@ class acp_users
$db->sql_freeresult($result);
$template->assign_vars(array(
- 'L_NAME_CHARS_EXPLAIN' => sprintf($user->lang[$config['allow_name_chars'] . '_EXPLAIN'], $config['min_name_chars'], $config['max_name_chars']),
- 'L_CHANGE_PASSWORD_EXPLAIN' => sprintf($user->lang[$config['pass_complex'] . '_EXPLAIN'], $config['min_pass_chars'], $config['max_pass_chars']),
+ 'L_NAME_CHARS_EXPLAIN' => $user->lang($config['allow_name_chars'] . '_EXPLAIN', $user->lang('CHARACTERS', (int) $config['min_name_chars']), $user->lang('CHARACTERS', (int) $config['max_name_chars'])),
+ 'L_CHANGE_PASSWORD_EXPLAIN' => $user->lang($config['pass_complex'] . '_EXPLAIN', $user->lang('CHARACTERS', (int) $config['min_pass_chars']), $user->lang('CHARACTERS', (int) $config['max_pass_chars'])),
'L_POSTS_IN_QUEUE' => $user->lang('NUM_POSTS_IN_QUEUE', $user_row['posts_in_queue']),
'S_FOUNDER' => ($user->data['user_type'] == USER_FOUNDER) ? true : false,
@@ -1045,7 +1118,7 @@ class acp_users
'USER' => $user_row['username'],
'USER_REGISTERED' => $user->format_date($user_row['user_regdate']),
'REGISTERED_IP' => ($ip == 'hostname') ? gethostbyaddr($user_row['user_ip']) : $user_row['user_ip'],
- 'USER_LASTACTIVE' => ($last_visit) ? $user->format_date($last_visit) : ' - ',
+ 'USER_LASTACTIVE' => ($last_active) ? $user->format_date($last_active) : ' - ',
'USER_EMAIL' => $user_row['user_email'],
'USER_WARNINGS' => $user_row['user_warnings'],
'USER_POSTS' => $user_row['user_posts'],
@@ -1065,6 +1138,7 @@ class acp_users
$deleteall = (isset($_POST['delall'])) ? true : false;
$marked = request_var('mark', array(0));
$message = utf8_normalize_nfc(request_var('message', '', true));
+ $pagination = $phpbb_container->get('pagination');
// Sort keys
$sort_days = request_var('st', 0);
@@ -1134,10 +1208,11 @@ class acp_users
$log_count = 0;
$start = view_log('user', $log_data, $log_count, $config['topics_per_page'], $start, 0, 0, $user_id, $sql_where, $sql_sort);
+ $base_url = $this->u_action . "&amp;u=$user_id&amp;$u_sort_param";
+ $pagination->generate_template_pagination($base_url, 'pagination', 'start', $log_count, $config['topics_per_page'], $start);
+
$template->assign_vars(array(
'S_FEEDBACK' => true,
- 'S_ON_PAGE' => on_page($log_count, $config['topics_per_page'], $start),
- 'PAGINATION' => generate_pagination($this->u_action . "&amp;u=$user_id&amp;$u_sort_param", $log_count, $config['topics_per_page'], $start, true),
'S_LIMIT_DAYS' => $s_limit_days,
'S_SORT_KEY' => $s_sort_key,
@@ -1210,17 +1285,13 @@ class acp_users
WHERE user_id = $user_id";
$db->sql_query($sql);
- switch ($log_warnings)
+ if ($log_warnings)
{
- case 2:
- add_log('admin', 'LOG_WARNINGS_DELETED', $user_row['username'], $num_warnings);
- break;
- case 1:
- add_log('admin', 'LOG_WARNING_DELETED', $user_row['username']);
- break;
- default:
- add_log('admin', 'LOG_WARNINGS_DELETED_ALL', $user_row['username']);
- break;
+ add_log('admin', 'LOG_WARNINGS_DELETED', $user_row['username'], $num_warnings);
+ }
+ else
+ {
+ add_log('admin', 'LOG_WARNINGS_DELETED_ALL', $user_row['username']);
}
}
}
@@ -1290,7 +1361,6 @@ class acp_users
}
}
-
$template->assign_block_vars('warn', array(
'ID' => $row['warning_id'],
'USERNAME' => ($row['log_operation']) ? get_username_string('full', $row['mod_user_id'], $row['mod_username'], $row['mod_user_colour']) : '-',
@@ -1308,10 +1378,12 @@ class acp_users
case 'profile':
- include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
- include($phpbb_root_path . 'includes/functions_profile_fields.' . $phpEx);
+ if (!function_exists('user_get_id_name'))
+ {
+ include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
+ }
- $cp = new custom_profile();
+ $cp = $phpbb_container->get('profilefields.manager');
$cp_data = $cp_error = array();
@@ -1325,15 +1397,7 @@ class acp_users
$user_row['iso_lang_id'] = $row['lang_id'];
$data = array(
- 'icq' => request_var('icq', $user_row['user_icq']),
- 'aim' => request_var('aim', $user_row['user_aim']),
- 'msn' => request_var('msn', $user_row['user_msnm']),
- 'yim' => request_var('yim', $user_row['user_yim']),
'jabber' => utf8_normalize_nfc(request_var('jabber', $user_row['user_jabber'], true)),
- 'website' => request_var('website', $user_row['user_website']),
- 'location' => utf8_normalize_nfc(request_var('location', $user_row['user_from'], true)),
- 'occupation' => utf8_normalize_nfc(request_var('occupation', $user_row['user_occ'], true)),
- 'interests' => utf8_normalize_nfc(request_var('interests', $user_row['user_interests'], true)),
'bday_day' => 0,
'bday_month' => 0,
'bday_year' => 0,
@@ -1349,25 +1413,25 @@ class acp_users
$data['bday_year'] = request_var('bday_year', $data['bday_year']);
$data['user_birthday'] = sprintf('%2d-%2d-%4d', $data['bday_day'], $data['bday_month'], $data['bday_year']);
+ /**
+ * Modify user data on editing profile in ACP
+ *
+ * @event core.acp_users_modify_profile
+ * @var array data Array with user profile data
+ * @var bool submit Flag indicating if submit button has been pressed
+ * @var int user_id The user id
+ * @var array user_row Array with the full user data
+ * @since 3.1.4-RC1
+ */
+ $vars = array('data', 'submit', 'user_id', 'user_row');
+ extract($phpbb_dispatcher->trigger_event('core.acp_users_modify_profile', compact($vars)));
if ($submit)
{
$error = validate_data($data, array(
- 'icq' => array(
- array('string', true, 3, 15),
- array('match', true, '#^[0-9]+$#i')),
- 'aim' => array('string', true, 3, 255),
- 'msn' => array('string', true, 5, 255),
'jabber' => array(
array('string', true, 5, 255),
array('jabber')),
- 'yim' => array('string', true, 5, 255),
- 'website' => array(
- array('string', true, 12, 255),
- array('match', true, '#^http[s]?://(.*?\.)*?[a-z0-9\-]+\.[a-z]{2,4}#i')),
- 'location' => array('string', true, 2, 100),
- 'occupation' => array('string', true, 2, 500),
- 'interests' => array('string', true, 2, 500),
'bday_day' => array('num', true, 1, 31),
'bday_month' => array('num', true, 1, 12),
'bday_year' => array('num', true, 1901, gmdate('Y', time())),
@@ -1386,21 +1450,39 @@ class acp_users
$error[] = 'FORM_INVALID';
}
+ /**
+ * Validate profile data in ACP before submitting to the database
+ *
+ * @event core.acp_users_profile_validate
+ * @var bool submit Flag indicating if submit button has been pressed
+ * @var array data Array with user profile data
+ * @var array error Array with the form errors
+ * @since 3.1.4-RC1
+ */
+ $vars = array('submit', 'data', 'error');
+ extract($phpbb_dispatcher->trigger_event('core.acp_users_profile_validate', compact($vars)));
+
if (!sizeof($error))
{
$sql_ary = array(
- 'user_icq' => $data['icq'],
- 'user_aim' => $data['aim'],
- 'user_msnm' => $data['msn'],
- 'user_yim' => $data['yim'],
'user_jabber' => $data['jabber'],
- 'user_website' => $data['website'],
- 'user_from' => $data['location'],
- 'user_occ' => $data['occupation'],
- 'user_interests'=> $data['interests'],
'user_birthday' => $data['user_birthday'],
);
+ /**
+ * Modify profile data in ACP before submitting to the database
+ *
+ * @event core.acp_users_profile_modify_sql_ary
+ * @var array cp_data Array with the user custom profile fields data
+ * @var array data Array with user profile data
+ * @var int user_id The user id
+ * @var array user_row Array with the full user data
+ * @var array sql_ary Array with sql data
+ * @since 3.1.4-RC1
+ */
+ $vars = array('cp_data', 'data', 'user_id', 'user_row', 'sql_ary');
+ extract($phpbb_dispatcher->trigger_event('core.acp_users_profile_modify_sql_ary', compact($vars)));
+
$sql = 'UPDATE ' . USERS_TABLE . '
SET ' . $db->sql_build_array('UPDATE', $sql_ary) . "
WHERE user_id = $user_id";
@@ -1413,7 +1495,7 @@ class acp_users
}
// Replace "error" strings with their real, localised form
- $error = preg_replace('#^([A-Z_]+)$#e', "(!empty(\$user->lang['\\1'])) ? \$user->lang['\\1'] : '\\1'", $error);
+ $error = array_map(array($user, 'lang'), $error);
}
$s_birthday_day_options = '<option value="0"' . ((!$data['bday_day']) ? ' selected="selected"' : '') . '>--</option>';
@@ -1441,16 +1523,7 @@ class acp_users
unset($now);
$template->assign_vars(array(
- 'ICQ' => $data['icq'],
- 'YIM' => $data['yim'],
- 'AIM' => $data['aim'],
- 'MSN' => $data['msn'],
'JABBER' => $data['jabber'],
- 'WEBSITE' => $data['website'],
- 'LOCATION' => $data['location'],
- 'OCCUPATION' => $data['occupation'],
- 'INTERESTS' => $data['interests'],
-
'S_BIRTHDAY_DAY_OPTIONS' => $s_birthday_day_options,
'S_BIRTHDAY_MONTH_OPTIONS' => $s_birthday_month_options,
'S_BIRTHDAY_YEAR_OPTIONS' => $s_birthday_year_options,
@@ -1467,20 +1540,21 @@ class acp_users
case 'prefs':
- include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
+ if (!function_exists('user_get_id_name'))
+ {
+ include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
+ }
$data = array(
'dateformat' => utf8_normalize_nfc(request_var('dateformat', $user_row['user_dateformat'], true)),
'lang' => basename(request_var('lang', $user_row['user_lang'])),
- 'tz' => request_var('tz', (float) $user_row['user_timezone']),
+ 'tz' => request_var('tz', $user_row['user_timezone']),
'style' => request_var('style', $user_row['user_style']),
- 'dst' => request_var('dst', $user_row['user_dst']),
'viewemail' => request_var('viewemail', $user_row['user_allow_viewemail']),
'massemail' => request_var('massemail', $user_row['user_allow_massemail']),
'hideonline' => request_var('hideonline', !$user_row['user_allow_viewonline']),
'notifymethod' => request_var('notifymethod', $user_row['user_notify_type']),
'notifypm' => request_var('notifypm', $user_row['user_notify_pm']),
- 'popuppm' => request_var('popuppm', $this->optionget($user_row, 'popuppm')),
'allowpm' => request_var('allowpm', $user_row['user_allow_pm']),
'topic_sk' => request_var('topic_sk', ($user_row['user_topic_sortby_type']) ? $user_row['user_topic_sortby_type'] : 't'),
@@ -1504,12 +1578,23 @@ class acp_users
'notify' => request_var('notify', $user_row['user_notify']),
);
+ /**
+ * Modify users preferences data
+ *
+ * @event core.acp_users_prefs_modify_data
+ * @var array data Array with users preferences data
+ * @var array user_row Array with user data
+ * @since 3.1.0-b3
+ */
+ $vars = array('data', 'user_row');
+ extract($phpbb_dispatcher->trigger_event('core.acp_users_prefs_modify_data', compact($vars)));
+
if ($submit)
{
$error = validate_data($data, array(
- 'dateformat' => array('string', false, 1, 30),
+ 'dateformat' => array('string', false, 1, 64),
'lang' => array('match', false, '#^[a-z_\-]{2,}$#i'),
- 'tz' => array('num', false, -14, 14),
+ 'tz' => array('timezone'),
'topic_sk' => array('string', false, 1, 1),
'topic_sd' => array('string', false, 1, 1),
@@ -1524,7 +1609,6 @@ class acp_users
if (!sizeof($error))
{
- $this->optionset($user_row, 'popuppm', $data['popuppm']);
$this->optionset($user_row, 'viewimg', $data['view_images']);
$this->optionset($user_row, 'viewflash', $data['view_flash']);
$this->optionset($user_row, 'viewsmilies', $data['view_smilies']);
@@ -1545,7 +1629,6 @@ class acp_users
'user_notify_type' => $data['notifymethod'],
'user_notify_pm' => $data['notifypm'],
- 'user_dst' => $data['dst'],
'user_dateformat' => $data['dateformat'],
'user_lang' => $data['lang'],
'user_timezone' => $data['tz'],
@@ -1562,41 +1645,57 @@ class acp_users
'user_notify' => $data['notify'],
);
- $sql = 'UPDATE ' . USERS_TABLE . '
- SET ' . $db->sql_build_array('UPDATE', $sql_ary) . "
- WHERE user_id = $user_id";
- $db->sql_query($sql);
-
- // Check if user has an active session
- if ($user_row['session_id'])
+ /**
+ * Modify SQL query before users preferences are updated
+ *
+ * @event core.acp_users_prefs_modify_sql
+ * @var array data Array with users preferences data
+ * @var array user_row Array with user data
+ * @var array sql_ary SQL array with users preferences data to update
+ * @var array error Array with errors data
+ * @since 3.1.0-b3
+ */
+ $vars = array('data', 'user_row', 'sql_ary', 'error');
+ extract($phpbb_dispatcher->trigger_event('core.acp_users_prefs_modify_sql', compact($vars)));
+
+ if (!sizeof($error))
{
- // We'll update the session if user_allow_viewonline has changed and the user is a bot
- // Or if it's a regular user and the admin set it to hide the session
- if ($user_row['user_allow_viewonline'] != $sql_ary['user_allow_viewonline'] && $user_row['user_type'] == USER_IGNORE
- || $user_row['user_allow_viewonline'] && !$sql_ary['user_allow_viewonline'])
+ $sql = 'UPDATE ' . USERS_TABLE . '
+ SET ' . $db->sql_build_array('UPDATE', $sql_ary) . "
+ WHERE user_id = $user_id";
+ $db->sql_query($sql);
+
+ // Check if user has an active session
+ if ($user_row['session_id'])
{
- // We also need to check if the user has the permission to cloak.
- $user_auth = new auth();
- $user_auth->acl($user_row);
+ // We'll update the session if user_allow_viewonline has changed and the user is a bot
+ // Or if it's a regular user and the admin set it to hide the session
+ if ($user_row['user_allow_viewonline'] != $sql_ary['user_allow_viewonline'] && $user_row['user_type'] == USER_IGNORE
+ || $user_row['user_allow_viewonline'] && !$sql_ary['user_allow_viewonline'])
+ {
+ // We also need to check if the user has the permission to cloak.
+ $user_auth = new \phpbb\auth\auth();
+ $user_auth->acl($user_row);
- $session_sql_ary = array(
- 'session_viewonline' => ($user_auth->acl_get('u_hideonline')) ? $sql_ary['user_allow_viewonline'] : true,
- );
+ $session_sql_ary = array(
+ 'session_viewonline' => ($user_auth->acl_get('u_hideonline')) ? $sql_ary['user_allow_viewonline'] : true,
+ );
- $sql = 'UPDATE ' . SESSIONS_TABLE . '
- SET ' . $db->sql_build_array('UPDATE', $session_sql_ary) . "
- WHERE session_user_id = $user_id";
- $db->sql_query($sql);
+ $sql = 'UPDATE ' . SESSIONS_TABLE . '
+ SET ' . $db->sql_build_array('UPDATE', $session_sql_ary) . "
+ WHERE session_user_id = $user_id";
+ $db->sql_query($sql);
- unset($user_auth);
+ unset($user_auth);
+ }
}
- }
- trigger_error($user->lang['USER_PREFS_UPDATED'] . adm_back_link($this->u_action . '&amp;u=' . $user_id));
+ trigger_error($user->lang['USER_PREFS_UPDATED'] . adm_back_link($this->u_action . '&amp;u=' . $user_id));
+ }
}
// Replace "error" strings with their real, localised form
- $error = preg_replace('#^([A-Z_]+)$#e', "(!empty(\$user->lang['\\1'])) ? \$user->lang['\\1'] : '\\1'", $error);
+ $error = array_map(array($user, 'lang'), $error);
}
$dateformat_options = '';
@@ -1655,7 +1754,8 @@ class acp_users
${'s_sort_' . $sort_option . '_dir'} .= '</select>';
}
- $template->assign_vars(array(
+ phpbb_timezone_select($template, $user, $data['tz'], true);
+ $user_prefs_data = array(
'S_PREFS' => true,
'S_JABBER_DISABLED' => ($config['jab_enable'] && $user_row['user_jabber'] && @extension_loaded('xml')) ? false : true,
@@ -1667,8 +1767,6 @@ class acp_users
'NOTIFY_IM' => ($data['notifymethod'] == NOTIFY_IM) ? true : false,
'NOTIFY_BOTH' => ($data['notifymethod'] == NOTIFY_BOTH) ? true : false,
'NOTIFY_PM' => $data['notifypm'],
- 'POPUP_PM' => $data['popuppm'],
- 'DST' => $data['dst'],
'BBCODE' => $data['bbcode'],
'SMILIES' => $data['smilies'],
'ATTACH_SIG' => $data['sig'],
@@ -1695,75 +1793,146 @@ class acp_users
'S_LANG_OPTIONS' => language_select($data['lang']),
'S_STYLE_OPTIONS' => style_select($data['style']),
- 'S_TZ_OPTIONS' => tz_select($data['tz'], true),
- )
);
+ /**
+ * Modify users preferences data before assigning it to the template
+ *
+ * @event core.acp_users_prefs_modify_template_data
+ * @var array data Array with users preferences data
+ * @var array user_row Array with user data
+ * @var array user_prefs_data Array with users preferences data to be assigned to the template
+ * @since 3.1.0-b3
+ */
+ $vars = array('data', 'user_row', 'user_prefs_data');
+ extract($phpbb_dispatcher->trigger_event('core.acp_users_prefs_modify_template_data', compact($vars)));
+
+ $template->assign_vars($user_prefs_data);
+
break;
case 'avatar':
- include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
- include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
-
- $can_upload = (file_exists($phpbb_root_path . $config['avatar_path']) && phpbb_is_writable($phpbb_root_path . $config['avatar_path']) && $file_uploads) ? true : false;
+ $avatars_enabled = false;
+ /** @var \phpbb\avatar\manager $phpbb_avatar_manager */
+ $phpbb_avatar_manager = $phpbb_container->get('avatar.manager');
- if ($submit)
+ if ($config['allow_avatar'])
{
+ $avatar_drivers = $phpbb_avatar_manager->get_enabled_drivers();
- if (!check_form_key($form_name))
+ // This is normalised data, without the user_ prefix
+ $avatar_data = \phpbb\avatar\manager::clean_row($user_row, 'user');
+
+ if ($submit)
{
+ if (check_form_key($form_name))
+ {
+ $driver_name = $phpbb_avatar_manager->clean_driver_name($request->variable('avatar_driver', ''));
+
+ if (in_array($driver_name, $avatar_drivers) && !$request->is_set_post('avatar_delete'))
+ {
+ $driver = $phpbb_avatar_manager->get_driver($driver_name);
+ $result = $driver->process_form($request, $template, $user, $avatar_data, $error);
+
+ if ($result && empty($error))
+ {
+ // Success! Lets save the result in the database
+ $result = array(
+ 'user_avatar_type' => $driver_name,
+ 'user_avatar' => $result['avatar'],
+ 'user_avatar_width' => $result['avatar_width'],
+ 'user_avatar_height' => $result['avatar_height'],
+ );
+
+ $sql = 'UPDATE ' . USERS_TABLE . '
+ SET ' . $db->sql_build_array('UPDATE', $result) . '
+ WHERE user_id = ' . (int) $user_id;
+
+ $db->sql_query($sql);
+ trigger_error($user->lang['USER_AVATAR_UPDATED'] . adm_back_link($this->u_action . '&amp;u=' . $user_id));
+ }
+ }
+ }
+ else
+ {
trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action . '&amp;u=' . $user_id), E_USER_WARNING);
+ }
}
- if (avatar_process_user($error, $user_row, $can_upload))
+ // Handle deletion of avatars
+ if ($request->is_set_post('avatar_delete'))
{
- trigger_error($user->lang['USER_AVATAR_UPDATED'] . adm_back_link($this->u_action . '&amp;u=' . $user_row['user_id']));
+ if (!confirm_box(true))
+ {
+ confirm_box(false, $user->lang('CONFIRM_AVATAR_DELETE'), build_hidden_fields(array(
+ 'avatar_delete' => true))
+ );
+ }
+ else
+ {
+ $phpbb_avatar_manager->handle_avatar_delete($db, $user, $avatar_data, USERS_TABLE, 'user_');
+
+ trigger_error($user->lang['USER_AVATAR_UPDATED'] . adm_back_link($this->u_action . '&amp;u=' . $user_id));
+ }
}
- // Replace "error" strings with their real, localised form
- $error = preg_replace('#^([A-Z_]+)$#e', "(!empty(\$user->lang['\\1'])) ? \$user->lang['\\1'] : '\\1'", $error);
- }
+ $selected_driver = $phpbb_avatar_manager->clean_driver_name($request->variable('avatar_driver', $user_row['user_avatar_type']));
- if (!$config['allow_avatar'] && $user_row['user_avatar_type'])
- {
- $error[] = $user->lang['USER_AVATAR_NOT_ALLOWED'];
- }
- else if ((($user_row['user_avatar_type'] == AVATAR_UPLOAD) && !$config['allow_avatar_upload']) ||
- (($user_row['user_avatar_type'] == AVATAR_REMOTE) && !$config['allow_avatar_remote']) ||
- (($user_row['user_avatar_type'] == AVATAR_GALLERY) && !$config['allow_avatar_local']))
- {
- $error[] = $user->lang['USER_AVATAR_TYPE_NOT_ALLOWED'];
- }
+ // Assign min and max values before generating avatar driver html
+ $template->assign_vars(array(
+ 'AVATAR_MIN_WIDTH' => $config['avatar_min_width'],
+ 'AVATAR_MAX_WIDTH' => $config['avatar_max_width'],
+ 'AVATAR_MIN_HEIGHT' => $config['avatar_min_height'],
+ 'AVATAR_MAX_HEIGHT' => $config['avatar_max_height'],
+ ));
+
+ foreach ($avatar_drivers as $current_driver)
+ {
+ $driver = $phpbb_avatar_manager->get_driver($current_driver);
+
+ $avatars_enabled = true;
+ $template->set_filenames(array(
+ 'avatar' => $driver->get_acp_template_name(),
+ ));
+
+ if ($driver->prepare_form($request, $template, $user, $avatar_data, $error))
+ {
+ $driver_name = $phpbb_avatar_manager->prepare_driver_name($current_driver);
+ $driver_upper = strtoupper($driver_name);
- // Generate users avatar
- $avatar_img = ($user_row['user_avatar']) ? get_user_avatar($user_row['user_avatar'], $user_row['user_avatar_type'], $user_row['user_avatar_width'], $user_row['user_avatar_height'], 'USER_AVATAR', true) : '<img src="' . $phpbb_admin_path . 'images/no_avatar.gif" alt="" />';
+ $template->assign_block_vars('avatar_drivers', array(
+ 'L_TITLE' => $user->lang($driver_upper . '_TITLE'),
+ 'L_EXPLAIN' => $user->lang($driver_upper . '_EXPLAIN'),
- $display_gallery = (isset($_POST['display_gallery'])) ? true : false;
- $avatar_select = basename(request_var('avatar_select', ''));
- $category = basename(request_var('category', ''));
+ 'DRIVER' => $driver_name,
+ 'SELECTED' => $current_driver == $selected_driver,
+ 'OUTPUT' => $template->assign_display('avatar'),
+ ));
+ }
+ }
+ }
- if ($config['allow_avatar_local'] && $display_gallery)
+ // Avatar manager is not initialized if avatars are disabled
+ if (isset($phpbb_avatar_manager))
{
- avatar_gallery($category, $avatar_select, 4);
+ // Replace "error" strings with their real, localised form
+ $error = $phpbb_avatar_manager->localize_errors($user, $error);
}
+ $avatar = phpbb_get_user_avatar($user_row, 'USER_AVATAR', true);
+
$template->assign_vars(array(
- 'S_AVATAR' => true,
- 'S_CAN_UPLOAD' => $can_upload,
- 'S_UPLOAD_FILE' => ($config['allow_avatar'] && $can_upload && $config['allow_avatar_upload']) ? true : false,
- 'S_REMOTE_UPLOAD' => ($config['allow_avatar'] && $can_upload && $config['allow_avatar_remote_upload']) ? true : false,
- 'S_ALLOW_REMOTE' => ($config['allow_avatar'] && $config['allow_avatar_remote']) ? true : false,
- 'S_DISPLAY_GALLERY' => ($config['allow_avatar'] && $config['allow_avatar_local'] && !$display_gallery) ? true : false,
- 'S_IN_GALLERY' => ($config['allow_avatar'] && $config['allow_avatar_local'] && $display_gallery) ? true : false,
-
- 'AVATAR_IMAGE' => $avatar_img,
- 'AVATAR_MAX_FILESIZE' => $config['avatar_filesize'],
- 'USER_AVATAR_WIDTH' => $user_row['user_avatar_width'],
- 'USER_AVATAR_HEIGHT' => $user_row['user_avatar_height'],
-
- 'L_AVATAR_EXPLAIN' => sprintf($user->lang['AVATAR_EXPLAIN'], $config['avatar_max_width'], $config['avatar_max_height'], round($config['avatar_filesize'] / 1024)))
- );
+ 'S_AVATAR' => true,
+ 'ERROR' => (!empty($error)) ? implode('<br />', $error) : '',
+ 'AVATAR' => (empty($avatar) ? '<img src="' . $phpbb_admin_path . 'images/no_avatar.gif" alt="" />' : $avatar),
+
+ 'S_FORM_ENCTYPE' => ' enctype="multipart/form-data"',
+
+ 'L_AVATAR_EXPLAIN' => $user->lang(($config['avatar_filesize'] == 0) ? 'AVATAR_EXPLAIN_NO_FILESIZE' : 'AVATAR_EXPLAIN', $config['avatar_max_width'], $config['avatar_max_height'], $config['avatar_filesize'] / 1024),
+
+ 'S_AVATARS_ENABLED' => ($config['allow_avatar'] && $avatars_enabled),
+ ));
break;
@@ -1810,8 +1979,15 @@ class acp_users
case 'sig':
- include_once($phpbb_root_path . 'includes/functions_posting.' . $phpEx);
- include_once($phpbb_root_path . 'includes/functions_display.' . $phpEx);
+ if (!function_exists('generate_smilies'))
+ {
+ include($phpbb_root_path . 'includes/functions_posting.' . $phpEx);
+ }
+
+ if (!function_exists('display_custom_bbcodes'))
+ {
+ include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
+ }
$enable_bbcode = ($config['allow_sig_bbcode']) ? (bool) $this->optionget($user_row, 'sig_bbcode') : false;
$enable_smilies = ($config['allow_sig_smilies']) ? (bool) $this->optionget($user_row, 'sig_smilies') : false;
@@ -1822,7 +1998,10 @@ class acp_users
if ($submit || $preview)
{
- include_once($phpbb_root_path . 'includes/message_parser.' . $phpEx);
+ if (!class_exists('messenger'))
+ {
+ include($phpbb_root_path . 'includes/message_parser.' . $phpEx);
+ }
$enable_bbcode = ($config['allow_sig_bbcode']) ? ((request_var('disable_bbcode', false)) ? false : true) : false;
$enable_smilies = ($config['allow_sig_smilies']) ? ((request_var('disable_smilies', false)) ? false : true) : false;
@@ -1865,7 +2044,7 @@ class acp_users
}
// Replace "error" strings with their real, localised form
- $error = preg_replace('#^([A-Z_]+)$#e', "(!empty(\$user->lang['\\1'])) ? \$user->lang['\\1'] : '\\1'", $error);
+ $error = array_map(array($user, 'lang'), $error);
}
$signature_preview = '';
@@ -1895,7 +2074,7 @@ class acp_users
'FLASH_STATUS' => ($config['allow_sig_flash']) ? $user->lang['FLASH_IS_ON'] : $user->lang['FLASH_IS_OFF'],
'URL_STATUS' => ($config['allow_sig_links']) ? $user->lang['URL_IS_ON'] : $user->lang['URL_IS_OFF'],
- 'L_SIGNATURE_EXPLAIN' => sprintf($user->lang['SIGNATURE_EXPLAIN'], $config['max_sig_chars']),
+ 'L_SIGNATURE_EXPLAIN' => $user->lang('SIGNATURE_EXPLAIN', (int) $config['max_sig_chars']),
'S_BBCODE_ALLOWED' => $config['allow_sig_bbcode'],
'S_SMILIES_ALLOWED' => $config['allow_sig_smilies'],
@@ -1914,6 +2093,7 @@ class acp_users
$start = request_var('start', 0);
$deletemark = (isset($_POST['delmarked'])) ? true : false;
$marked = request_var('mark', array(0));
+ $pagination = $phpbb_container->get('pagination');
// Sort keys
$sort_key = request_var('sk', 'a');
@@ -1956,7 +2136,7 @@ class acp_users
$message = (sizeof($log_attachments) == 1) ? $user->lang['ATTACHMENT_DELETED'] : $user->lang['ATTACHMENTS_DELETED'];
- add_log('admin', 'LOG_ATTACHMENTS_DELETED', implode(', ', $log_attachments));
+ add_log('admin', 'LOG_ATTACHMENTS_DELETED', implode($user->lang['COMMA_SEPARATOR'], $log_attachments));
trigger_error($message . adm_back_link($this->u_action . '&amp;u=' . $user_id));
}
else
@@ -2049,20 +2229,23 @@ class acp_users
}
$db->sql_freeresult($result);
+ $base_url = $this->u_action . "&amp;u=$user_id&amp;sk=$sort_key&amp;sd=$sort_dir";
+ $pagination->generate_template_pagination($base_url, 'pagination', 'start', $num_attachments, $config['topics_per_page'], $start);
+
$template->assign_vars(array(
'S_ATTACHMENTS' => true,
- 'S_ON_PAGE' => on_page($num_attachments, $config['topics_per_page'], $start),
'S_SORT_KEY' => $s_sort_key,
'S_SORT_DIR' => $s_sort_dir,
-
- 'PAGINATION' => generate_pagination($this->u_action . "&amp;u=$user_id&amp;sk=$sort_key&amp;sd=$sort_dir", $num_attachments, $config['topics_per_page'], $start, true))
- );
+ ));
break;
case 'groups':
- include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
+ if (!function_exists('group_user_attributes'))
+ {
+ include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
+ }
$user->add_lang(array('groups', 'acp/groups'));
$group_id = request_var('g', 0);
@@ -2096,6 +2279,12 @@ class acp_users
{
trigger_error($user->lang['NO_GROUP'] . adm_back_link($this->u_action . '&amp;u=' . $user_id), E_USER_WARNING);
}
+
+ if (!check_link_hash($request->variable('hash', ''), 'acp_users'))
+ {
+ trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING);
+ }
+
group_user_attributes($action, $group_id, $user_id);
if ($action == 'default')
@@ -2190,7 +2379,6 @@ class acp_users
$error = array();
}
-
$sql = 'SELECT ug.*, g.*
FROM ' . GROUPS_TABLE . ' g, ' . USER_GROUP_TABLE . " ug
WHERE ug.user_id = $user_id
@@ -2254,8 +2442,8 @@ class acp_users
{
$template->assign_block_vars('group', array(
'U_EDIT_GROUP' => append_sid("{$phpbb_admin_path}index.$phpEx", "i=groups&amp;mode=manage&amp;action=edit&amp;u=$user_id&amp;g={$data['group_id']}&amp;back_link=acp_users_groups"),
- 'U_DEFAULT' => $this->u_action . "&amp;action=default&amp;u=$user_id&amp;g=" . $data['group_id'],
- 'U_DEMOTE_PROMOTE' => $this->u_action . '&amp;action=' . (($data['group_leader']) ? 'demote' : 'promote') . "&amp;u=$user_id&amp;g=" . $data['group_id'],
+ 'U_DEFAULT' => $this->u_action . "&amp;action=default&amp;u=$user_id&amp;g=" . $data['group_id'] . '&amp;hash=' . generate_link_hash('acp_users'),
+ 'U_DEMOTE_PROMOTE' => $this->u_action . '&amp;action=' . (($data['group_leader']) ? 'demote' : 'promote') . "&amp;u=$user_id&amp;g=" . $data['group_id'] . '&amp;hash=' . generate_link_hash('acp_users'),
'U_DELETE' => $this->u_action . "&amp;action=delete&amp;u=$user_id&amp;g=" . $data['group_id'],
'U_APPROVE' => ($group_type == 'pending') ? $this->u_action . "&amp;action=approve&amp;u=$user_id&amp;g=" . $data['group_id'] : '',
@@ -2279,7 +2467,10 @@ class acp_users
case 'perm':
- include_once($phpbb_root_path . 'includes/acp/auth.' . $phpEx);
+ if (!class_exists('auth_admin'))
+ {
+ include($phpbb_root_path . 'includes/acp/auth.' . $phpEx);
+ }
$auth_admin = new auth_admin();
@@ -2294,7 +2485,7 @@ class acp_users
// Select auth options
$sql = 'SELECT auth_option, is_local, is_global
FROM ' . ACL_OPTIONS_TABLE . '
- WHERE auth_option ' . $db->sql_like_expression($db->any_char . '_') . '
+ WHERE auth_option ' . $db->sql_like_expression($db->get_any_char() . '_') . '
AND is_global = 1
ORDER BY auth_option';
$result = $db->sql_query($sql);
@@ -2314,7 +2505,7 @@ class acp_users
{
$sql = 'SELECT auth_option, is_local, is_global
FROM ' . ACL_OPTIONS_TABLE . "
- WHERE auth_option " . $db->sql_like_expression($db->any_char . '_') . "
+ WHERE auth_option " . $db->sql_like_expression($db->get_any_char() . '_') . "
AND is_local = 1
ORDER BY is_global DESC, auth_option";
$result = $db->sql_query($sql);
@@ -2411,5 +2602,3 @@ class acp_users
return phpbb_optionget($user->keyoptions[$key], $var);
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/acp/acp_words.php b/phpBB/includes/acp/acp_words.php
index 88c5bbe592..272d38bcc8 100644
--- a/phpBB/includes/acp/acp_words.php
+++ b/phpBB/includes/acp/acp_words.php
@@ -1,10 +1,13 @@
<?php
/**
*
-* @package acp
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -18,7 +21,6 @@ if (!defined('IN_PHPBB'))
/**
* @todo [words] check regular expressions for special char replacements (stored specialchared in db)
-* @package acp
*/
class acp_words
{
@@ -102,7 +104,7 @@ class acp_words
'word' => $word,
'replacement' => $replacement
);
-
+
if ($word_id)
{
$db->sql_query('UPDATE ' . WORDS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . ' WHERE word_id = ' . $word_id);
@@ -163,7 +165,6 @@ class acp_words
break;
}
-
$template->assign_vars(array(
'U_ACTION' => $this->u_action,
'S_HIDDEN_FIELDS' => $s_hidden_fields)
@@ -186,5 +187,3 @@ class acp_words
$db->sql_freeresult($result);
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/acp/auth.php b/phpBB/includes/acp/auth.php
index 10d7973da6..52c45499b2 100644
--- a/phpBB/includes/acp/auth.php
+++ b/phpBB/includes/acp/auth.php
@@ -1,10 +1,13 @@
<?php
/**
*
-* @package phpBB3
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -18,9 +21,8 @@ if (!defined('IN_PHPBB'))
/**
* ACP Permission/Auth class
-* @package phpBB3
*/
-class auth_admin extends auth
+class auth_admin extends \phpbb\auth\auth
{
/**
* Init auth settings
@@ -131,7 +133,7 @@ class auth_admin extends auth
{
if ($user->data['user_id'] != $userdata['user_id'])
{
- $auth2 = new auth();
+ $auth2 = new \phpbb\auth\auth();
$auth2->acl($userdata);
}
else
@@ -140,7 +142,6 @@ class auth_admin extends auth
$auth2 = &$auth;
}
-
$hold_ary[$userdata['user_id']] = array();
foreach ($forum_ids as $f_id)
{
@@ -182,7 +183,10 @@ class auth_admin extends auth
}
// Defining the user-function here to save some memory
- $return_acl_fill = create_function('$value', 'return ' . $acl_fill . ';');
+ $return_acl_fill = function () use ($acl_fill)
+ {
+ return $acl_fill;
+ };
// Actually fill the gaps
if (sizeof($hold_ary))
@@ -262,7 +266,8 @@ class auth_admin extends auth
*/
function display_mask($mode, $permission_type, &$hold_ary, $user_mode = 'user', $local = false, $group_display = true)
{
- global $template, $user, $db, $phpbb_root_path, $phpEx;
+ global $template, $user, $db, $phpbb_root_path, $phpEx, $phpbb_container;
+ $phpbb_permissions = $phpbb_container->get('acl.permissions');
// Define names for template loops, might be able to be set
$tpl_pmask = 'p_mask';
@@ -270,7 +275,7 @@ class auth_admin extends auth
$tpl_category = 'category';
$tpl_mask = 'mask';
- $l_acl_type = (isset($user->lang['ACL_TYPE_' . (($local) ? 'LOCAL' : 'GLOBAL') . '_' . strtoupper($permission_type)])) ? $user->lang['ACL_TYPE_' . (($local) ? 'LOCAL' : 'GLOBAL') . '_' . strtoupper($permission_type)] : 'ACL_TYPE_' . (($local) ? 'LOCAL' : 'GLOBAL') . '_' . strtoupper($permission_type);
+ $l_acl_type = $phpbb_permissions->get_type_lang($permission_type, (($local) ? 'local' : 'global'));
// Allow trace for viewing permissions and in user mode
$show_trace = ($mode == 'view' && $user_mode == 'user') ? true : false;
@@ -506,7 +511,7 @@ class auth_admin extends auth
'FORUM_ID' => $forum_id)
);
- $this->assign_cat_array($ug_array, $tpl_pmask . '.' . $tpl_fmask . '.' . $tpl_category, $tpl_mask, $ug_id, $forum_id, $show_trace, ($mode == 'view'));
+ $this->assign_cat_array($ug_array, $tpl_pmask . '.' . $tpl_fmask . '.' . $tpl_category, $tpl_mask, $ug_id, $forum_id, ($mode == 'view'), $show_trace);
unset($content_array[$ug_id]);
}
@@ -530,8 +535,8 @@ class auth_admin extends auth
'NAME' => $ug_name,
'CATEGORIES' => implode('</th><th>', $categories),
- 'USER_GROUPS_DEFAULT' => ($user_mode == 'user' && isset($user_groups_default[$ug_id]) && sizeof($user_groups_default[$ug_id])) ? implode(', ', $user_groups_default[$ug_id]) : '',
- 'USER_GROUPS_CUSTOM' => ($user_mode == 'user' && isset($user_groups_custom[$ug_id]) && sizeof($user_groups_custom[$ug_id])) ? implode(', ', $user_groups_custom[$ug_id]) : '',
+ 'USER_GROUPS_DEFAULT' => ($user_mode == 'user' && isset($user_groups_default[$ug_id]) && sizeof($user_groups_default[$ug_id])) ? implode($user->lang['COMMA_SEPARATOR'], $user_groups_default[$ug_id]) : '',
+ 'USER_GROUPS_CUSTOM' => ($user_mode == 'user' && isset($user_groups_custom[$ug_id]) && sizeof($user_groups_custom[$ug_id])) ? implode($user->lang['COMMA_SEPARATOR'], $user_groups_custom[$ug_id]) : '',
'L_ACL_TYPE' => $l_acl_type,
'S_LOCAL' => ($local) ? true : false,
@@ -593,7 +598,7 @@ class auth_admin extends auth
'FORUM_ID' => $forum_id)
);
- $this->assign_cat_array($forum_array, $tpl_pmask . '.' . $tpl_fmask . '.' . $tpl_category, $tpl_mask, $ug_id, $forum_id, $show_trace, ($mode == 'view'));
+ $this->assign_cat_array($forum_array, $tpl_pmask . '.' . $tpl_fmask . '.' . $tpl_category, $tpl_mask, $ug_id, $forum_id, ($mode == 'view'), $show_trace);
}
unset($hold_ary[$ug_id], $ug_names_ary[$ug_id]);
@@ -649,9 +654,9 @@ class auth_admin extends auth
{
$template->assign_block_vars('role_mask.users', array(
'USER_ID' => $row['user_id'],
- 'USERNAME' => $row['username'],
- 'U_PROFILE' => append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=viewprofile&amp;u={$row['user_id']}"))
- );
+ 'USERNAME' => get_username_string('username', $row['user_id'], $row['username']),
+ 'U_PROFILE' => get_username_string('profile', $row['user_id'], $row['username']),
+ ));
}
$db->sql_freeresult($result);
}
@@ -833,7 +838,7 @@ class auth_admin extends auth
}
// Remove current auth options...
- $auth_option_ids = array((int)$any_option_id);
+ $auth_option_ids = array((int) $any_option_id);
foreach ($auth as $auth_option => $auth_setting)
{
$auth_option_ids[] = (int) $this->acl_options['id'][$auth_option];
@@ -1022,7 +1027,7 @@ class auth_admin extends auth
// Get permission type
$sql = 'SELECT auth_option, auth_option_id
FROM ' . ACL_OPTIONS_TABLE . "
- WHERE auth_option " . $db->sql_like_expression($permission_type . $db->any_char);
+ WHERE auth_option " . $db->sql_like_expression($permission_type . $db->get_any_char());
$result = $db->sql_query($sql);
$auth_id_ary = array();
@@ -1099,20 +1104,27 @@ class auth_admin extends auth
* Assign category to template
* used by display_mask()
*/
- function assign_cat_array(&$category_array, $tpl_cat, $tpl_mask, $ug_id, $forum_id, $show_trace = false, $s_view)
+ function assign_cat_array(&$category_array, $tpl_cat, $tpl_mask, $ug_id, $forum_id, $s_view, $show_trace = false)
{
- global $template, $user, $phpbb_admin_path, $phpEx;
+ global $template, $user, $phpbb_admin_path, $phpEx, $phpbb_container;
+
+ $phpbb_permissions = $phpbb_container->get('acl.permissions');
@reset($category_array);
while (list($cat, $cat_array) = each($category_array))
{
+ if (!$phpbb_permissions->category_defined($cat))
+ {
+ continue;
+ }
+
$template->assign_block_vars($tpl_cat, array(
'S_YES' => ($cat_array['S_YES'] && !$cat_array['S_NEVER'] && !$cat_array['S_NO']) ? true : false,
'S_NEVER' => ($cat_array['S_NEVER'] && !$cat_array['S_YES'] && !$cat_array['S_NO']) ? true : false,
'S_NO' => ($cat_array['S_NO'] && !$cat_array['S_NEVER'] && !$cat_array['S_YES']) ? true : false,
- 'CAT_NAME' => $user->lang['permission_cat'][$cat])
- );
+ 'CAT_NAME' => $phpbb_permissions->get_category_lang($cat),
+ ));
/* Sort permissions by name (more naturaly and user friendly than sorting by a primary key)
* Commented out due to it's memory consumption and time needed
@@ -1132,6 +1144,11 @@ class auth_admin extends auth
@reset($cat_array['permissions']);
while (list($permission, $allowed) = each($cat_array['permissions']))
{
+ if (!$phpbb_permissions->permission_defined($permission))
+ {
+ continue;
+ }
+
if ($s_view)
{
$template->assign_block_vars($tpl_cat . '.' . $tpl_mask, array(
@@ -1146,8 +1163,8 @@ class auth_admin extends auth
'U_TRACE' => ($show_trace) ? append_sid("{$phpbb_admin_path}index.$phpEx", "i=permissions&amp;mode=trace&amp;u=$ug_id&amp;f=$forum_id&amp;auth=$permission") : '',
'UA_TRACE' => ($show_trace) ? append_sid("{$phpbb_admin_path}index.$phpEx", "i=permissions&mode=trace&u=$ug_id&f=$forum_id&auth=$permission", false) : '',
- 'PERMISSION' => $user->lang['acl_' . $permission]['lang'])
- );
+ 'PERMISSION' => $phpbb_permissions->get_permission_lang($permission),
+ ));
}
else
{
@@ -1164,8 +1181,8 @@ class auth_admin extends auth
'U_TRACE' => ($show_trace) ? append_sid("{$phpbb_admin_path}index.$phpEx", "i=permissions&amp;mode=trace&amp;u=$ug_id&amp;f=$forum_id&amp;auth=$permission") : '',
'UA_TRACE' => ($show_trace) ? append_sid("{$phpbb_admin_path}index.$phpEx", "i=permissions&mode=trace&u=$ug_id&f=$forum_id&auth=$permission", false) : '',
- 'PERMISSION' => $user->lang['acl_' . $permission]['lang'])
- );
+ 'PERMISSION' => $phpbb_permissions->get_permission_lang($permission),
+ ));
}
}
}
@@ -1177,7 +1194,9 @@ class auth_admin extends auth
*/
function build_permission_array(&$permission_row, &$content_array, &$categories, $key_sort_array)
{
- global $user;
+ global $user, $phpbb_container;
+
+ $phpbb_permissions = $phpbb_container->get('acl.permissions');
foreach ($key_sort_array as $forum_id)
{
@@ -1192,20 +1211,12 @@ class auth_admin extends auth
@reset($permissions);
while (list($permission, $auth_setting) = each($permissions))
{
- if (!isset($user->lang['acl_' . $permission]))
- {
- $user->lang['acl_' . $permission] = array(
- 'cat' => 'misc',
- 'lang' => '{ acl_' . $permission . ' }'
- );
- }
-
- $cat = $user->lang['acl_' . $permission]['cat'];
+ $cat = $phpbb_permissions->get_permission_category($permission);
// Build our categories array
if (!isset($categories[$cat]))
{
- $categories[$cat] = $user->lang['permission_cat'][$cat];
+ $categories[$cat] = $phpbb_permissions->get_category_lang($cat);
}
// Build our content array
@@ -1281,5 +1292,3 @@ class auth_admin extends auth
return true;
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/acp/info/acp_attachments.php b/phpBB/includes/acp/info/acp_attachments.php
index b77785801f..ff6e342f77 100644
--- a/phpBB/includes/acp/info/acp_attachments.php
+++ b/phpBB/includes/acp/info/acp_attachments.php
@@ -1,16 +1,16 @@
<?php
/**
*
-* @package acp
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
-/**
-* @package module_install
-*/
class acp_attachments_info
{
function module()
@@ -23,7 +23,8 @@ class acp_attachments_info
'attach' => array('title' => 'ACP_ATTACHMENT_SETTINGS', 'auth' => 'acl_a_attach', 'cat' => array('ACP_BOARD_CONFIGURATION', 'ACP_ATTACHMENTS')),
'extensions' => array('title' => 'ACP_MANAGE_EXTENSIONS', 'auth' => 'acl_a_attach', 'cat' => array('ACP_ATTACHMENTS')),
'ext_groups' => array('title' => 'ACP_EXTENSION_GROUPS', 'auth' => 'acl_a_attach', 'cat' => array('ACP_ATTACHMENTS')),
- 'orphan' => array('title' => 'ACP_ORPHAN_ATTACHMENTS', 'auth' => 'acl_a_attach', 'cat' => array('ACP_ATTACHMENTS'))
+ 'orphan' => array('title' => 'ACP_ORPHAN_ATTACHMENTS', 'auth' => 'acl_a_attach', 'cat' => array('ACP_ATTACHMENTS')),
+ 'manage' => array('title' => 'ACP_MANAGE_ATTACHMENTS', 'auth' => 'acl_a_attach', 'cat' => array('ACP_ATTACHMENTS')),
),
);
}
@@ -36,5 +37,3 @@ class acp_attachments_info
{
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/acp/info/acp_ban.php b/phpBB/includes/acp/info/acp_ban.php
index df51011ec6..4959f4da41 100644
--- a/phpBB/includes/acp/info/acp_ban.php
+++ b/phpBB/includes/acp/info/acp_ban.php
@@ -1,16 +1,16 @@
<?php
/**
*
-* @package acp
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
-/**
-* @package module_install
-*/
class acp_ban_info
{
function module()
@@ -35,5 +35,3 @@ class acp_ban_info
{
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/acp/info/acp_bbcodes.php b/phpBB/includes/acp/info/acp_bbcodes.php
index c0206432d6..2bca319cc3 100644
--- a/phpBB/includes/acp/info/acp_bbcodes.php
+++ b/phpBB/includes/acp/info/acp_bbcodes.php
@@ -1,16 +1,16 @@
<?php
/**
*
-* @package acp
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
-/**
-* @package module_install
-*/
class acp_bbcodes_info
{
function module()
@@ -33,5 +33,3 @@ class acp_bbcodes_info
{
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/acp/info/acp_board.php b/phpBB/includes/acp/info/acp_board.php
index 3e18f55940..6838b4f8ba 100644
--- a/phpBB/includes/acp/info/acp_board.php
+++ b/phpBB/includes/acp/info/acp_board.php
@@ -1,16 +1,16 @@
<?php
/**
*
-* @package acp
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
-/**
-* @package module_install
-*/
class acp_board_info
{
function module()
@@ -48,5 +48,3 @@ class acp_board_info
{
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/acp/info/acp_bots.php b/phpBB/includes/acp/info/acp_bots.php
index 45087f9225..9aa24927af 100644
--- a/phpBB/includes/acp/info/acp_bots.php
+++ b/phpBB/includes/acp/info/acp_bots.php
@@ -1,16 +1,16 @@
<?php
/**
*
-* @package acp
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
-/**
-* @package module_install
-*/
class acp_bots_info
{
function module()
@@ -33,6 +33,3 @@ class acp_bots_info
{
}
}
-
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/acp/info/acp_captcha.php b/phpBB/includes/acp/info/acp_captcha.php
index b2541c252c..99dc5ce0e5 100644
--- a/phpBB/includes/acp/info/acp_captcha.php
+++ b/phpBB/includes/acp/info/acp_captcha.php
@@ -1,16 +1,16 @@
<?php
/**
*
-* @package acp
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
-/**
-* @package module_install
-*/
class acp_captcha_info
{
function module()
@@ -34,5 +34,3 @@ class acp_captcha_info
{
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/acp/info/acp_contact.php b/phpBB/includes/acp/info/acp_contact.php
new file mode 100644
index 0000000000..548eb52816
--- /dev/null
+++ b/phpBB/includes/acp/info/acp_contact.php
@@ -0,0 +1,30 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+/**
+* @package module_install
+*/
+class acp_contact_info
+{
+ public function module()
+ {
+ return array(
+ 'filename' => 'acp_contact',
+ 'title' => 'ACP_CONTACT',
+ 'version' => '1.0.0',
+ 'modes' => array(
+ 'contact' => array('title' => 'ACP_CONTACT_SETTINGS', 'auth' => 'acl_a_board', 'cat' => array('ACP_BOARD_CONFIGURATION')),
+ ),
+ );
+ }
+}
diff --git a/phpBB/includes/acp/info/acp_database.php b/phpBB/includes/acp/info/acp_database.php
index 85c3c8b21c..5cf9da24fb 100644
--- a/phpBB/includes/acp/info/acp_database.php
+++ b/phpBB/includes/acp/info/acp_database.php
@@ -1,16 +1,16 @@
<?php
/**
*
-* @package acp
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
-/**
-* @package module_install
-*/
class acp_database_info
{
function module()
@@ -34,5 +34,3 @@ class acp_database_info
{
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/acp/info/acp_disallow.php b/phpBB/includes/acp/info/acp_disallow.php
index 41315eb716..ebd44b515c 100644
--- a/phpBB/includes/acp/info/acp_disallow.php
+++ b/phpBB/includes/acp/info/acp_disallow.php
@@ -1,16 +1,16 @@
<?php
/**
*
-* @package acp
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
-/**
-* @package module_install
-*/
class acp_disallow_info
{
function module()
@@ -33,6 +33,3 @@ class acp_disallow_info
{
}
}
-
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/acp/info/acp_email.php b/phpBB/includes/acp/info/acp_email.php
index 4ad7bca58b..2f77fc617c 100644
--- a/phpBB/includes/acp/info/acp_email.php
+++ b/phpBB/includes/acp/info/acp_email.php
@@ -1,16 +1,16 @@
<?php
/**
*
-* @package acp
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
-/**
-* @package module_install
-*/
class acp_email_info
{
function module()
@@ -33,6 +33,3 @@ class acp_email_info
{
}
}
-
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/acp/info/acp_extensions.php b/phpBB/includes/acp/info/acp_extensions.php
new file mode 100644
index 0000000000..d4cf1b0ed5
--- /dev/null
+++ b/phpBB/includes/acp/info/acp_extensions.php
@@ -0,0 +1,35 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+class acp_extensions_info
+{
+ function module()
+ {
+ return array(
+ 'filename' => 'acp_extensions',
+ 'title' => 'ACP_EXTENSION_MANAGEMENT',
+ 'version' => '1.0.0',
+ 'modes' => array(
+ 'main' => array('title' => 'ACP_EXTENSIONS', 'auth' => 'acl_a_extensions', 'cat' => array('ACP_EXTENSION_MANAGEMENT')),
+ ),
+ );
+ }
+
+ function install()
+ {
+ }
+
+ function uninstall()
+ {
+ }
+}
diff --git a/phpBB/includes/acp/info/acp_forums.php b/phpBB/includes/acp/info/acp_forums.php
index 8d82eaf42d..647090c8c3 100644
--- a/phpBB/includes/acp/info/acp_forums.php
+++ b/phpBB/includes/acp/info/acp_forums.php
@@ -1,16 +1,16 @@
<?php
/**
*
-* @package acp
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
-/**
-* @package module_install
-*/
class acp_forums_info
{
function module()
@@ -33,5 +33,3 @@ class acp_forums_info
{
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/acp/info/acp_groups.php b/phpBB/includes/acp/info/acp_groups.php
index 3910c24e6b..6c5ad70d97 100644
--- a/phpBB/includes/acp/info/acp_groups.php
+++ b/phpBB/includes/acp/info/acp_groups.php
@@ -1,16 +1,16 @@
<?php
/**
*
-* @package acp
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
-/**
-* @package module_install
-*/
class acp_groups_info
{
function module()
@@ -21,6 +21,7 @@ class acp_groups_info
'version' => '1.0.0',
'modes' => array(
'manage' => array('title' => 'ACP_GROUPS_MANAGE', 'auth' => 'acl_a_group', 'cat' => array('ACP_GROUPS')),
+ 'position' => array('title' => 'ACP_GROUPS_POSITION', 'auth' => 'acl_a_group', 'cat' => array('ACP_GROUPS')),
),
);
}
@@ -33,5 +34,3 @@ class acp_groups_info
{
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/acp/info/acp_icons.php b/phpBB/includes/acp/info/acp_icons.php
index 16bf753940..001d6cb402 100644
--- a/phpBB/includes/acp/info/acp_icons.php
+++ b/phpBB/includes/acp/info/acp_icons.php
@@ -1,16 +1,16 @@
<?php
/**
*
-* @package acp
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
-/**
-* @package module_install
-*/
class acp_icons_info
{
function module()
@@ -34,5 +34,3 @@ class acp_icons_info
{
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/acp/info/acp_inactive.php b/phpBB/includes/acp/info/acp_inactive.php
index e17fbda9dd..442eb13c30 100644
--- a/phpBB/includes/acp/info/acp_inactive.php
+++ b/phpBB/includes/acp/info/acp_inactive.php
@@ -1,16 +1,16 @@
<?php
/**
*
-* @package acp
-* @version $Id$
-* @copyright (c) 2006 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
-/**
-* @package module_install
-*/
class acp_inactive_info
{
function module()
@@ -33,5 +33,3 @@ class acp_inactive_info
{
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/acp/info/acp_jabber.php b/phpBB/includes/acp/info/acp_jabber.php
index 7bcf7744e1..c1dfb2aca7 100644
--- a/phpBB/includes/acp/info/acp_jabber.php
+++ b/phpBB/includes/acp/info/acp_jabber.php
@@ -1,16 +1,16 @@
<?php
/**
*
-* @package acp
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
-/**
-* @package module_install
-*/
class acp_jabber_info
{
function module()
@@ -33,4 +33,3 @@ class acp_jabber_info
{
}
}
-?> \ No newline at end of file
diff --git a/phpBB/includes/acp/info/acp_language.php b/phpBB/includes/acp/info/acp_language.php
index f7606631fe..b9efbbbd9a 100644
--- a/phpBB/includes/acp/info/acp_language.php
+++ b/phpBB/includes/acp/info/acp_language.php
@@ -1,16 +1,16 @@
<?php
/**
*
-* @package acp
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
-/**
-* @package module_install
-*/
class acp_language_info
{
function module()
@@ -20,7 +20,7 @@ class acp_language_info
'title' => 'ACP_LANGUAGE',
'version' => '1.0.0',
'modes' => array(
- 'lang_packs' => array('title' => 'ACP_LANGUAGE_PACKS', 'auth' => 'acl_a_language', 'cat' => array('ACP_GENERAL_TASKS')),
+ 'lang_packs' => array('title' => 'ACP_LANGUAGE_PACKS', 'auth' => 'acl_a_language', 'cat' => array('ACP_LANGUAGE')),
),
);
}
@@ -33,5 +33,3 @@ class acp_language_info
{
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/acp/info/acp_logs.php b/phpBB/includes/acp/info/acp_logs.php
index f119e10b83..3b2764c4dc 100644
--- a/phpBB/includes/acp/info/acp_logs.php
+++ b/phpBB/includes/acp/info/acp_logs.php
@@ -1,30 +1,45 @@
<?php
/**
*
-* @package acp
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
-/**
-* @package module_install
-*/
class acp_logs_info
{
function module()
{
+ global $phpbb_dispatcher;
+
+ $modes = array(
+ 'admin' => array('title' => 'ACP_ADMIN_LOGS', 'auth' => 'acl_a_viewlogs', 'cat' => array('ACP_FORUM_LOGS')),
+ 'mod' => array('title' => 'ACP_MOD_LOGS', 'auth' => 'acl_a_viewlogs', 'cat' => array('ACP_FORUM_LOGS')),
+ 'users' => array('title' => 'ACP_USERS_LOGS', 'auth' => 'acl_a_viewlogs', 'cat' => array('ACP_FORUM_LOGS')),
+ 'critical' => array('title' => 'ACP_CRITICAL_LOGS', 'auth' => 'acl_a_viewlogs', 'cat' => array('ACP_FORUM_LOGS')),
+ );
+
+ /**
+ * Event to add or modify ACP log modulemodes
+ *
+ * @event core.acp_logs_info_modify_modes
+ * @var array modes Array with modes info
+ * @since 3.1.11-RC1
+ * @since 3.2.1-RC1
+ */
+ $vars = array('modes');
+ extract($phpbb_dispatcher->trigger_event('core.acp_logs_info_modify_modes', compact($vars)));
+
return array(
'filename' => 'acp_logs',
'title' => 'ACP_LOGGING',
'version' => '1.0.0',
- 'modes' => array(
- 'admin' => array('title' => 'ACP_ADMIN_LOGS', 'auth' => 'acl_a_viewlogs', 'cat' => array('ACP_FORUM_LOGS')),
- 'mod' => array('title' => 'ACP_MOD_LOGS', 'auth' => 'acl_a_viewlogs', 'cat' => array('ACP_FORUM_LOGS')),
- 'users' => array('title' => 'ACP_USERS_LOGS', 'auth' => 'acl_a_viewlogs', 'cat' => array('ACP_FORUM_LOGS')),
- 'critical' => array('title' => 'ACP_CRITICAL_LOGS', 'auth' => 'acl_a_viewlogs', 'cat' => array('ACP_FORUM_LOGS')),
- ),
+ 'modes' => $modes,
);
}
@@ -36,5 +51,3 @@ class acp_logs_info
{
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/acp/info/acp_main.php b/phpBB/includes/acp/info/acp_main.php
index 5574cc40d1..51259e3bd9 100644
--- a/phpBB/includes/acp/info/acp_main.php
+++ b/phpBB/includes/acp/info/acp_main.php
@@ -1,16 +1,16 @@
<?php
/**
*
-* @package acp
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
-/**
-* @package module_install
-*/
class acp_main_info
{
function module()
@@ -33,5 +33,3 @@ class acp_main_info
{
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/acp/info/acp_modules.php b/phpBB/includes/acp/info/acp_modules.php
index 886f17d628..a47cd4ad83 100644
--- a/phpBB/includes/acp/info/acp_modules.php
+++ b/phpBB/includes/acp/info/acp_modules.php
@@ -1,16 +1,16 @@
<?php
/**
*
-* @package acp
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
-/**
-* @package module_install
-*/
class acp_modules_info
{
function module()
@@ -35,5 +35,3 @@ class acp_modules_info
{
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/acp/info/acp_permission_roles.php b/phpBB/includes/acp/info/acp_permission_roles.php
index 3ab2fecd53..e8aa13375d 100644
--- a/phpBB/includes/acp/info/acp_permission_roles.php
+++ b/phpBB/includes/acp/info/acp_permission_roles.php
@@ -1,16 +1,16 @@
<?php
/**
*
-* @package acp
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
-/**
-* @package module_install
-*/
class acp_permission_roles_info
{
function module()
@@ -36,5 +36,3 @@ class acp_permission_roles_info
{
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/acp/info/acp_permissions.php b/phpBB/includes/acp/info/acp_permissions.php
index 6f341742f3..3ec592a300 100644
--- a/phpBB/includes/acp/info/acp_permissions.php
+++ b/phpBB/includes/acp/info/acp_permissions.php
@@ -1,16 +1,16 @@
<?php
/**
*
-* @package acp
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
-/**
-* @package module_install
-*/
class acp_permissions_info
{
function module()
@@ -50,5 +50,3 @@ class acp_permissions_info
{
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/acp/info/acp_php_info.php b/phpBB/includes/acp/info/acp_php_info.php
index 7d716b0f83..af978e0daa 100644
--- a/phpBB/includes/acp/info/acp_php_info.php
+++ b/phpBB/includes/acp/info/acp_php_info.php
@@ -1,16 +1,16 @@
<?php
/**
*
-* @package acp
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
-/**
-* @package module_install
-*/
class acp_php_info_info
{
function module()
@@ -33,5 +33,3 @@ class acp_php_info_info
{
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/acp/info/acp_profile.php b/phpBB/includes/acp/info/acp_profile.php
index 8590226038..307e711eee 100644
--- a/phpBB/includes/acp/info/acp_profile.php
+++ b/phpBB/includes/acp/info/acp_profile.php
@@ -1,16 +1,16 @@
<?php
/**
*
-* @package acp
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
-/**
-* @package module_install
-*/
class acp_profile_info
{
function module()
@@ -33,5 +33,3 @@ class acp_profile_info
{
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/acp/info/acp_prune.php b/phpBB/includes/acp/info/acp_prune.php
index 46565c4f16..58cb1ba9ab 100644
--- a/phpBB/includes/acp/info/acp_prune.php
+++ b/phpBB/includes/acp/info/acp_prune.php
@@ -1,16 +1,16 @@
<?php
/**
*
-* @package acp
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
-/**
-* @package module_install
-*/
class acp_prune_info
{
function module()
@@ -21,7 +21,7 @@ class acp_prune_info
'version' => '1.0.0',
'modes' => array(
'forums' => array('title' => 'ACP_PRUNE_FORUMS', 'auth' => 'acl_a_prune', 'cat' => array('ACP_MANAGE_FORUMS')),
- 'users' => array('title' => 'ACP_PRUNE_USERS', 'auth' => 'acl_a_userdel', 'cat' => array('ACP_USER_SECURITY')),
+ 'users' => array('title' => 'ACP_PRUNE_USERS', 'auth' => 'acl_a_userdel', 'cat' => array('ACP_CAT_USERS')),
),
);
}
@@ -34,5 +34,3 @@ class acp_prune_info
{
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/acp/info/acp_ranks.php b/phpBB/includes/acp/info/acp_ranks.php
index 06b9c6d284..3cc9b4a428 100644
--- a/phpBB/includes/acp/info/acp_ranks.php
+++ b/phpBB/includes/acp/info/acp_ranks.php
@@ -1,16 +1,16 @@
<?php
/**
*
-* @package acp
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
-/**
-* @package module_install
-*/
class acp_ranks_info
{
function module()
@@ -33,5 +33,3 @@ class acp_ranks_info
{
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/acp/info/acp_reasons.php b/phpBB/includes/acp/info/acp_reasons.php
index 65d805ee18..c48fd1aacd 100644
--- a/phpBB/includes/acp/info/acp_reasons.php
+++ b/phpBB/includes/acp/info/acp_reasons.php
@@ -1,16 +1,16 @@
<?php
/**
*
-* @package acp
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
-/**
-* @package module_install
-*/
class acp_reasons_info
{
function module()
@@ -33,5 +33,3 @@ class acp_reasons_info
{
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/acp/info/acp_search.php b/phpBB/includes/acp/info/acp_search.php
index 4afd6c6994..5d681a7174 100644
--- a/phpBB/includes/acp/info/acp_search.php
+++ b/phpBB/includes/acp/info/acp_search.php
@@ -1,16 +1,16 @@
<?php
/**
*
-* @package acp
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
-/**
-* @package module_install
-*/
class acp_search_info
{
function module()
@@ -34,5 +34,3 @@ class acp_search_info
{
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/acp/info/acp_send_statistics.php b/phpBB/includes/acp/info/acp_send_statistics.php
index de5dcdb8ad..a4f2ddc420 100644
--- a/phpBB/includes/acp/info/acp_send_statistics.php
+++ b/phpBB/includes/acp/info/acp_send_statistics.php
@@ -1,16 +1,16 @@
<?php
/**
*
-* @package acp
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
-/**
-* @package module_install
-*/
class acp_send_statistics_info
{
function module()
@@ -33,5 +33,3 @@ class acp_send_statistics_info
{
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/acp/info/acp_styles.php b/phpBB/includes/acp/info/acp_styles.php
index db67167e39..c0ab005502 100644
--- a/phpBB/includes/acp/info/acp_styles.php
+++ b/phpBB/includes/acp/info/acp_styles.php
@@ -1,16 +1,16 @@
<?php
/**
*
-* @package acp
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
-/**
-* @package module_install
-*/
class acp_styles_info
{
function module()
@@ -18,12 +18,10 @@ class acp_styles_info
return array(
'filename' => 'acp_styles',
'title' => 'ACP_CAT_STYLES',
- 'version' => '1.0.0',
+ 'version' => '2.0.0',
'modes' => array(
'style' => array('title' => 'ACP_STYLES', 'auth' => 'acl_a_styles', 'cat' => array('ACP_STYLE_MANAGEMENT')),
- 'template' => array('title' => 'ACP_TEMPLATES', 'auth' => 'acl_a_styles', 'cat' => array('ACP_STYLE_COMPONENTS')),
- 'theme' => array('title' => 'ACP_THEMES', 'auth' => 'acl_a_styles', 'cat' => array('ACP_STYLE_COMPONENTS')),
- 'imageset' => array('title' => 'ACP_IMAGESETS', 'auth' => 'acl_a_styles', 'cat' => array('ACP_STYLE_COMPONENTS')),
+ 'install' => array('title' => 'ACP_STYLES_INSTALL', 'auth' => 'acl_a_styles', 'cat' => array('ACP_STYLE_MANAGEMENT')),
),
);
}
@@ -36,5 +34,3 @@ class acp_styles_info
{
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/acp/info/acp_update.php b/phpBB/includes/acp/info/acp_update.php
index 886cdc94d5..ca00f6d305 100644
--- a/phpBB/includes/acp/info/acp_update.php
+++ b/phpBB/includes/acp/info/acp_update.php
@@ -1,16 +1,16 @@
<?php
/**
*
-* @package acp
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
-/**
-* @package module_install
-*/
class acp_update_info
{
function module()
@@ -33,5 +33,3 @@ class acp_update_info
{
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/acp/info/acp_users.php b/phpBB/includes/acp/info/acp_users.php
index 10081ac870..ab69523cde 100644
--- a/phpBB/includes/acp/info/acp_users.php
+++ b/phpBB/includes/acp/info/acp_users.php
@@ -1,16 +1,16 @@
<?php
/**
*
-* @package acp
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
-/**
-* @package module_install
-*/
class acp_users_info
{
function module()
@@ -43,5 +43,3 @@ class acp_users_info
{
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/acp/info/acp_words.php b/phpBB/includes/acp/info/acp_words.php
index a2417f8a7f..3c8c79f25f 100644
--- a/phpBB/includes/acp/info/acp_words.php
+++ b/phpBB/includes/acp/info/acp_words.php
@@ -1,16 +1,16 @@
<?php
/**
*
-* @package acp
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
-/**
-* @package module_install
-*/
class acp_words_info
{
function module()
@@ -33,5 +33,3 @@ class acp_words_info
{
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/auth.php b/phpBB/includes/auth.php
deleted file mode 100644
index 0585921426..0000000000
--- a/phpBB/includes/auth.php
+++ /dev/null
@@ -1,1064 +0,0 @@
-<?php
-/**
-*
-* @package phpBB3
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
-*
-*/
-
-/**
-* @ignore
-*/
-if (!defined('IN_PHPBB'))
-{
- exit;
-}
-
-/**
-* Permission/Auth class
-* @package phpBB3
-*/
-class auth
-{
- var $acl = array();
- var $cache = array();
- var $acl_options = array();
- var $acl_forum_ids = false;
-
- /**
- * Init permissions
- */
- function acl(&$userdata)
- {
- global $db, $cache;
-
- $this->acl = $this->cache = $this->acl_options = array();
- $this->acl_forum_ids = false;
-
- if (($this->acl_options = $cache->get('_acl_options')) === false)
- {
- $sql = 'SELECT auth_option_id, auth_option, is_global, is_local
- FROM ' . ACL_OPTIONS_TABLE . '
- ORDER BY auth_option_id';
- $result = $db->sql_query($sql);
-
- $global = $local = 0;
- $this->acl_options = array();
- while ($row = $db->sql_fetchrow($result))
- {
- if ($row['is_global'])
- {
- $this->acl_options['global'][$row['auth_option']] = $global++;
- }
-
- if ($row['is_local'])
- {
- $this->acl_options['local'][$row['auth_option']] = $local++;
- }
-
- $this->acl_options['id'][$row['auth_option']] = (int) $row['auth_option_id'];
- $this->acl_options['option'][(int) $row['auth_option_id']] = $row['auth_option'];
- }
- $db->sql_freeresult($result);
-
- $cache->put('_acl_options', $this->acl_options);
- }
-
- if (!trim($userdata['user_permissions']))
- {
- $this->acl_cache($userdata);
- }
-
- // Fill ACL array
- $this->_fill_acl($userdata['user_permissions']);
-
- // Verify bitstring length with options provided...
- $renew = false;
- $global_length = sizeof($this->acl_options['global']);
- $local_length = sizeof($this->acl_options['local']);
-
- // Specify comparing length (bitstring is padded to 31 bits)
- $global_length = ($global_length % 31) ? ($global_length - ($global_length % 31) + 31) : $global_length;
- $local_length = ($local_length % 31) ? ($local_length - ($local_length % 31) + 31) : $local_length;
-
- // You thought we are finished now? Noooo... now compare them.
- foreach ($this->acl as $forum_id => $bitstring)
- {
- if (($forum_id && strlen($bitstring) != $local_length) || (!$forum_id && strlen($bitstring) != $global_length))
- {
- $renew = true;
- break;
- }
- }
-
- // If a bitstring within the list does not match the options, we have a user with incorrect permissions set and need to renew them
- if ($renew)
- {
- $this->acl_cache($userdata);
- $this->_fill_acl($userdata['user_permissions']);
- }
-
- return;
- }
-
- /**
- * Fill ACL array with relevant bitstrings from user_permissions column
- * @access private
- */
- function _fill_acl($user_permissions)
- {
- $seq_cache = array();
- $this->acl = array();
- $user_permissions = explode("\n", $user_permissions);
-
- foreach ($user_permissions as $f => $seq)
- {
- if ($seq)
- {
- $i = 0;
-
- if (!isset($this->acl[$f]))
- {
- $this->acl[$f] = '';
- }
-
- while ($subseq = substr($seq, $i, 6))
- {
- if (isset($seq_cache[$subseq]))
- {
- $converted = $seq_cache[$subseq];
- }
- else
- {
- $converted = $seq_cache[$subseq] = str_pad(base_convert($subseq, 36, 2), 31, 0, STR_PAD_LEFT);
- }
-
- // We put the original bitstring into the acl array
- $this->acl[$f] .= $converted;
- $i += 6;
- }
- }
- }
- }
-
- /**
- * Look up an option
- * if the option is prefixed with !, then the result becomes negated
- *
- * If a forum id is specified the local option will be combined with a global option if one exist.
- * If a forum id is not specified, only the global option will be checked.
- */
- function acl_get($opt, $f = 0)
- {
- $negate = false;
-
- if (strpos($opt, '!') === 0)
- {
- $negate = true;
- $opt = substr($opt, 1);
- }
-
- if (!isset($this->cache[$f][$opt]))
- {
- // We combine the global/local option with an OR because some options are global and local.
- // If the user has the global permission the local one is true too and vice versa
- $this->cache[$f][$opt] = false;
-
- // Is this option a global permission setting?
- if (isset($this->acl_options['global'][$opt]))
- {
- if (isset($this->acl[0]))
- {
- $this->cache[$f][$opt] = $this->acl[0][$this->acl_options['global'][$opt]];
- }
- }
-
- // Is this option a local permission setting?
- // But if we check for a global option only, we won't combine the options...
- if ($f != 0 && isset($this->acl_options['local'][$opt]))
- {
- if (isset($this->acl[$f]) && isset($this->acl[$f][$this->acl_options['local'][$opt]]))
- {
- $this->cache[$f][$opt] |= $this->acl[$f][$this->acl_options['local'][$opt]];
- }
- }
- }
-
- // Founder always has all global options set to true...
- return ($negate) ? !$this->cache[$f][$opt] : $this->cache[$f][$opt];
- }
-
- /**
- * Get forums with the specified permission setting
- * if the option is prefixed with !, then the result becomes nagated
- *
- * @param bool $clean set to true if only values needs to be returned which are set/unset
- */
- function acl_getf($opt, $clean = false)
- {
- $acl_f = array();
- $negate = false;
-
- if (strpos($opt, '!') === 0)
- {
- $negate = true;
- $opt = substr($opt, 1);
- }
-
- // If we retrieve a list of forums not having permissions in, we need to get every forum_id
- if ($negate)
- {
- if ($this->acl_forum_ids === false)
- {
- global $db;
-
- $sql = 'SELECT forum_id
- FROM ' . FORUMS_TABLE;
-
- if (sizeof($this->acl))
- {
- $sql .= ' WHERE ' . $db->sql_in_set('forum_id', array_keys($this->acl), true);
- }
- $result = $db->sql_query($sql);
-
- $this->acl_forum_ids = array();
- while ($row = $db->sql_fetchrow($result))
- {
- $this->acl_forum_ids[] = $row['forum_id'];
- }
- $db->sql_freeresult($result);
- }
- }
-
- if (isset($this->acl_options['local'][$opt]))
- {
- foreach ($this->acl as $f => $bitstring)
- {
- // Skip global settings
- if (!$f)
- {
- continue;
- }
-
- $allowed = (!isset($this->cache[$f][$opt])) ? $this->acl_get($opt, $f) : $this->cache[$f][$opt];
-
- if (!$clean)
- {
- $acl_f[$f][$opt] = ($negate) ? !$allowed : $allowed;
- }
- else
- {
- if (($negate && !$allowed) || (!$negate && $allowed))
- {
- $acl_f[$f][$opt] = 1;
- }
- }
- }
- }
-
- // If we get forum_ids not having this permission, we need to fill the remaining parts
- if ($negate && sizeof($this->acl_forum_ids))
- {
- foreach ($this->acl_forum_ids as $f)
- {
- $acl_f[$f][$opt] = 1;
- }
- }
-
- return $acl_f;
- }
-
- /**
- * Get local permission state for any forum.
- *
- * Returns true if user has the permission in one or more forums, false if in no forum.
- * If global option is checked it returns the global state (same as acl_get($opt))
- * Local option has precedence...
- */
- function acl_getf_global($opt)
- {
- if (is_array($opt))
- {
- // evaluates to true as soon as acl_getf_global is true for one option
- foreach ($opt as $check_option)
- {
- if ($this->acl_getf_global($check_option))
- {
- return true;
- }
- }
-
- return false;
- }
-
- if (isset($this->acl_options['local'][$opt]))
- {
- foreach ($this->acl as $f => $bitstring)
- {
- // Skip global settings
- if (!$f)
- {
- continue;
- }
-
- // as soon as the user has any permission we're done so return true
- if ((!isset($this->cache[$f][$opt])) ? $this->acl_get($opt, $f) : $this->cache[$f][$opt])
- {
- return true;
- }
- }
- }
- else if (isset($this->acl_options['global'][$opt]))
- {
- return $this->acl_get($opt);
- }
-
- return false;
- }
-
- /**
- * Get permission settings (more than one)
- */
- function acl_gets()
- {
- $args = func_get_args();
- $f = array_pop($args);
-
- if (!is_numeric($f))
- {
- $args[] = $f;
- $f = 0;
- }
-
- // alternate syntax: acl_gets(array('m_', 'a_'), $forum_id)
- if (is_array($args[0]))
- {
- $args = $args[0];
- }
-
- $acl = 0;
- foreach ($args as $opt)
- {
- $acl |= $this->acl_get($opt, $f);
- }
-
- return $acl;
- }
-
- /**
- * Get permission listing based on user_id/options/forum_ids
- *
- * Be careful when using this function with permissions a_, m_, u_ and f_ !
- * It may not work correctly. When a user group grants an a_* permission,
- * e.g. a_foo, but the user's a_foo permission is set to "Never", then
- * the user does not in fact have the a_ permission.
- * But the user will still be listed as having the a_ permission.
- *
- * For more information see: http://tracker.phpbb.com/browse/PHPBB3-10252
- */
- function acl_get_list($user_id = false, $opts = false, $forum_id = false)
- {
- if ($user_id !== false && !is_array($user_id) && $opts === false && $forum_id === false)
- {
- $hold_ary = array($user_id => $this->acl_raw_data_single_user($user_id));
- }
- else
- {
- $hold_ary = $this->acl_raw_data($user_id, $opts, $forum_id);
- }
-
- $auth_ary = array();
- foreach ($hold_ary as $user_id => $forum_ary)
- {
- foreach ($forum_ary as $forum_id => $auth_option_ary)
- {
- foreach ($auth_option_ary as $auth_option => $auth_setting)
- {
- if ($auth_setting)
- {
- $auth_ary[$forum_id][$auth_option][] = $user_id;
- }
- }
- }
- }
-
- return $auth_ary;
- }
-
- /**
- * Cache data to user_permissions row
- */
- function acl_cache(&$userdata)
- {
- global $db;
-
- // Empty user_permissions
- $userdata['user_permissions'] = '';
-
- $hold_ary = $this->acl_raw_data_single_user($userdata['user_id']);
-
- // Key 0 in $hold_ary are global options, all others are forum_ids
-
- // If this user is founder we're going to force fill the admin options ...
- if ($userdata['user_type'] == USER_FOUNDER)
- {
- foreach ($this->acl_options['global'] as $opt => $id)
- {
- if (strpos($opt, 'a_') === 0)
- {
- $hold_ary[0][$this->acl_options['id'][$opt]] = ACL_YES;
- }
- }
- }
-
- $hold_str = $this->build_bitstring($hold_ary);
-
- if ($hold_str)
- {
- $userdata['user_permissions'] = $hold_str;
-
- $sql = 'UPDATE ' . USERS_TABLE . "
- SET user_permissions = '" . $db->sql_escape($userdata['user_permissions']) . "',
- user_perm_from = 0
- WHERE user_id = " . $userdata['user_id'];
- $db->sql_query($sql);
- }
-
- return;
- }
-
- /**
- * Build bitstring from permission set
- */
- function build_bitstring(&$hold_ary)
- {
- $hold_str = '';
-
- if (sizeof($hold_ary))
- {
- ksort($hold_ary);
-
- $last_f = 0;
-
- foreach ($hold_ary as $f => $auth_ary)
- {
- $ary_key = (!$f) ? 'global' : 'local';
-
- $bitstring = array();
- foreach ($this->acl_options[$ary_key] as $opt => $id)
- {
- if (isset($auth_ary[$this->acl_options['id'][$opt]]))
- {
- $bitstring[$id] = $auth_ary[$this->acl_options['id'][$opt]];
-
- $option_key = substr($opt, 0, strpos($opt, '_') + 1);
-
- // If one option is allowed, the global permission for this option has to be allowed too
- // example: if the user has the a_ permission this means he has one or more a_* permissions
- if ($auth_ary[$this->acl_options['id'][$opt]] == ACL_YES && (!isset($bitstring[$this->acl_options[$ary_key][$option_key]]) || $bitstring[$this->acl_options[$ary_key][$option_key]] == ACL_NEVER))
- {
- $bitstring[$this->acl_options[$ary_key][$option_key]] = ACL_YES;
- }
- }
- else
- {
- $bitstring[$id] = ACL_NEVER;
- }
- }
-
- // Now this bitstring defines the permission setting for the current forum $f (or global setting)
- $bitstring = implode('', $bitstring);
-
- // The line number indicates the id, therefore we have to add empty lines for those ids not present
- $hold_str .= str_repeat("\n", $f - $last_f);
-
- // Convert bitstring for storage - we do not use binary/bytes because PHP's string functions are not fully binary safe
- for ($i = 0, $bit_length = strlen($bitstring); $i < $bit_length; $i += 31)
- {
- $hold_str .= str_pad(base_convert(str_pad(substr($bitstring, $i, 31), 31, 0, STR_PAD_RIGHT), 2, 36), 6, 0, STR_PAD_LEFT);
- }
-
- $last_f = $f;
- }
- unset($bitstring);
-
- $hold_str = rtrim($hold_str);
- }
-
- return $hold_str;
- }
-
- /**
- * Clear one or all users cached permission settings
- */
- function acl_clear_prefetch($user_id = false)
- {
- global $db, $cache;
-
- // Rebuild options cache
- $cache->destroy('_role_cache');
-
- $sql = 'SELECT *
- FROM ' . ACL_ROLES_DATA_TABLE . '
- ORDER BY role_id ASC';
- $result = $db->sql_query($sql);
-
- $this->role_cache = array();
- while ($row = $db->sql_fetchrow($result))
- {
- $this->role_cache[$row['role_id']][$row['auth_option_id']] = (int) $row['auth_setting'];
- }
- $db->sql_freeresult($result);
-
- foreach ($this->role_cache as $role_id => $role_options)
- {
- $this->role_cache[$role_id] = serialize($role_options);
- }
-
- $cache->put('_role_cache', $this->role_cache);
-
- // Now empty user permissions
- $where_sql = '';
-
- if ($user_id !== false)
- {
- $user_id = (!is_array($user_id)) ? $user_id = array((int) $user_id) : array_map('intval', $user_id);
- $where_sql = ' WHERE ' . $db->sql_in_set('user_id', $user_id);
- }
-
- $sql = 'UPDATE ' . USERS_TABLE . "
- SET user_permissions = '',
- user_perm_from = 0
- $where_sql";
- $db->sql_query($sql);
-
- return;
- }
-
- /**
- * Get assigned roles
- */
- function acl_role_data($user_type, $role_type, $ug_id = false, $forum_id = false)
- {
- global $db;
-
- $roles = array();
-
- $sql_id = ($user_type == 'user') ? 'user_id' : 'group_id';
-
- $sql_ug = ($ug_id !== false) ? ((!is_array($ug_id)) ? "AND a.$sql_id = $ug_id" : 'AND ' . $db->sql_in_set("a.$sql_id", $ug_id)) : '';
- $sql_forum = ($forum_id !== false) ? ((!is_array($forum_id)) ? "AND a.forum_id = $forum_id" : 'AND ' . $db->sql_in_set('a.forum_id', $forum_id)) : '';
-
- // Grab assigned roles...
- $sql = 'SELECT a.auth_role_id, a.' . $sql_id . ', a.forum_id
- FROM ' . (($user_type == 'user') ? ACL_USERS_TABLE : ACL_GROUPS_TABLE) . ' a, ' . ACL_ROLES_TABLE . " r
- WHERE a.auth_role_id = r.role_id
- AND r.role_type = '" . $db->sql_escape($role_type) . "'
- $sql_ug
- $sql_forum
- ORDER BY r.role_order ASC";
- $result = $db->sql_query($sql);
-
- while ($row = $db->sql_fetchrow($result))
- {
- $roles[$row[$sql_id]][$row['forum_id']] = $row['auth_role_id'];
- }
- $db->sql_freeresult($result);
-
- return $roles;
- }
-
- /**
- * Get raw acl data based on user/option/forum
- */
- function acl_raw_data($user_id = false, $opts = false, $forum_id = false)
- {
- global $db;
-
- $sql_user = ($user_id !== false) ? ((!is_array($user_id)) ? 'user_id = ' . (int) $user_id : $db->sql_in_set('user_id', array_map('intval', $user_id))) : '';
- $sql_forum = ($forum_id !== false) ? ((!is_array($forum_id)) ? 'AND a.forum_id = ' . (int) $forum_id : 'AND ' . $db->sql_in_set('a.forum_id', array_map('intval', $forum_id))) : '';
-
- $sql_opts = $sql_opts_select = $sql_opts_from = '';
- $hold_ary = array();
-
- if ($opts !== false)
- {
- $sql_opts_select = ', ao.auth_option';
- $sql_opts_from = ', ' . ACL_OPTIONS_TABLE . ' ao';
- $this->build_auth_option_statement('ao.auth_option', $opts, $sql_opts);
- }
-
- $sql_ary = array();
-
- // Grab non-role settings - user-specific
- $sql_ary[] = 'SELECT a.user_id, a.forum_id, a.auth_setting, a.auth_option_id' . $sql_opts_select . '
- FROM ' . ACL_USERS_TABLE . ' a' . $sql_opts_from . '
- WHERE a.auth_role_id = 0 ' .
- (($sql_opts_from) ? 'AND a.auth_option_id = ao.auth_option_id ' : '') .
- (($sql_user) ? 'AND a.' . $sql_user : '') . "
- $sql_forum
- $sql_opts";
-
- // Now the role settings - user-specific
- $sql_ary[] = 'SELECT a.user_id, a.forum_id, r.auth_option_id, r.auth_setting, r.auth_option_id' . $sql_opts_select . '
- FROM ' . ACL_USERS_TABLE . ' a, ' . ACL_ROLES_DATA_TABLE . ' r' . $sql_opts_from . '
- WHERE a.auth_role_id = r.role_id ' .
- (($sql_opts_from) ? 'AND r.auth_option_id = ao.auth_option_id ' : '') .
- (($sql_user) ? 'AND a.' . $sql_user : '') . "
- $sql_forum
- $sql_opts";
-
- foreach ($sql_ary as $sql)
- {
- $result = $db->sql_query($sql);
-
- while ($row = $db->sql_fetchrow($result))
- {
- $option = ($sql_opts_select) ? $row['auth_option'] : $this->acl_options['option'][$row['auth_option_id']];
- $hold_ary[$row['user_id']][$row['forum_id']][$option] = $row['auth_setting'];
- }
- $db->sql_freeresult($result);
- }
-
- $sql_ary = array();
-
- // Now grab group settings - non-role specific...
- $sql_ary[] = 'SELECT ug.user_id, a.forum_id, a.auth_setting, a.auth_option_id' . $sql_opts_select . '
- FROM ' . ACL_GROUPS_TABLE . ' a, ' . USER_GROUP_TABLE . ' ug, ' . GROUPS_TABLE . ' g' . $sql_opts_from . '
- WHERE a.auth_role_id = 0 ' .
- (($sql_opts_from) ? 'AND a.auth_option_id = ao.auth_option_id ' : '') . '
- AND a.group_id = ug.group_id
- AND g.group_id = ug.group_id
- AND ug.user_pending = 0
- AND NOT (ug.group_leader = 1 AND g.group_skip_auth = 1)
- ' . (($sql_user) ? 'AND ug.' . $sql_user : '') . "
- $sql_forum
- $sql_opts";
-
- // Now grab group settings - role specific...
- $sql_ary[] = 'SELECT ug.user_id, a.forum_id, r.auth_setting, r.auth_option_id' . $sql_opts_select . '
- FROM ' . ACL_GROUPS_TABLE . ' a, ' . USER_GROUP_TABLE . ' ug, ' . GROUPS_TABLE . ' g, ' . ACL_ROLES_DATA_TABLE . ' r' . $sql_opts_from . '
- WHERE a.auth_role_id = r.role_id ' .
- (($sql_opts_from) ? 'AND r.auth_option_id = ao.auth_option_id ' : '') . '
- AND a.group_id = ug.group_id
- AND g.group_id = ug.group_id
- AND ug.user_pending = 0
- AND NOT (ug.group_leader = 1 AND g.group_skip_auth = 1)
- ' . (($sql_user) ? 'AND ug.' . $sql_user : '') . "
- $sql_forum
- $sql_opts";
-
- foreach ($sql_ary as $sql)
- {
- $result = $db->sql_query($sql);
-
- while ($row = $db->sql_fetchrow($result))
- {
- $option = ($sql_opts_select) ? $row['auth_option'] : $this->acl_options['option'][$row['auth_option_id']];
-
- if (!isset($hold_ary[$row['user_id']][$row['forum_id']][$option]) || (isset($hold_ary[$row['user_id']][$row['forum_id']][$option]) && $hold_ary[$row['user_id']][$row['forum_id']][$option] != ACL_NEVER))
- {
- $hold_ary[$row['user_id']][$row['forum_id']][$option] = $row['auth_setting'];
-
- // If we detect ACL_NEVER, we will unset the flag option (within building the bitstring it is correctly set again)
- if ($row['auth_setting'] == ACL_NEVER)
- {
- $flag = substr($option, 0, strpos($option, '_') + 1);
-
- if (isset($hold_ary[$row['user_id']][$row['forum_id']][$flag]) && $hold_ary[$row['user_id']][$row['forum_id']][$flag] == ACL_YES)
- {
- unset($hold_ary[$row['user_id']][$row['forum_id']][$flag]);
-
-/* if (in_array(ACL_YES, $hold_ary[$row['user_id']][$row['forum_id']]))
- {
- $hold_ary[$row['user_id']][$row['forum_id']][$flag] = ACL_YES;
- }
-*/
- }
- }
- }
- }
- $db->sql_freeresult($result);
- }
-
- return $hold_ary;
- }
-
- /**
- * Get raw user based permission settings
- */
- function acl_user_raw_data($user_id = false, $opts = false, $forum_id = false)
- {
- global $db;
-
- $sql_user = ($user_id !== false) ? ((!is_array($user_id)) ? 'user_id = ' . (int) $user_id : $db->sql_in_set('user_id', array_map('intval', $user_id))) : '';
- $sql_forum = ($forum_id !== false) ? ((!is_array($forum_id)) ? 'AND a.forum_id = ' . (int) $forum_id : 'AND ' . $db->sql_in_set('a.forum_id', array_map('intval', $forum_id))) : '';
-
- $sql_opts = '';
- $hold_ary = $sql_ary = array();
-
- if ($opts !== false)
- {
- $this->build_auth_option_statement('ao.auth_option', $opts, $sql_opts);
- }
-
- // Grab user settings - non-role specific...
- $sql_ary[] = 'SELECT a.user_id, a.forum_id, a.auth_setting, a.auth_option_id, ao.auth_option
- FROM ' . ACL_USERS_TABLE . ' a, ' . ACL_OPTIONS_TABLE . ' ao
- WHERE a.auth_role_id = 0
- AND a.auth_option_id = ao.auth_option_id ' .
- (($sql_user) ? 'AND a.' . $sql_user : '') . "
- $sql_forum
- $sql_opts
- ORDER BY a.forum_id, ao.auth_option";
-
- // Now the role settings - user-specific
- $sql_ary[] = 'SELECT a.user_id, a.forum_id, r.auth_option_id, r.auth_setting, r.auth_option_id, ao.auth_option
- FROM ' . ACL_USERS_TABLE . ' a, ' . ACL_ROLES_DATA_TABLE . ' r, ' . ACL_OPTIONS_TABLE . ' ao
- WHERE a.auth_role_id = r.role_id
- AND r.auth_option_id = ao.auth_option_id ' .
- (($sql_user) ? 'AND a.' . $sql_user : '') . "
- $sql_forum
- $sql_opts
- ORDER BY a.forum_id, ao.auth_option";
-
- foreach ($sql_ary as $sql)
- {
- $result = $db->sql_query($sql);
-
- while ($row = $db->sql_fetchrow($result))
- {
- $hold_ary[$row['user_id']][$row['forum_id']][$row['auth_option']] = $row['auth_setting'];
- }
- $db->sql_freeresult($result);
- }
-
- return $hold_ary;
- }
-
- /**
- * Get raw group based permission settings
- */
- function acl_group_raw_data($group_id = false, $opts = false, $forum_id = false)
- {
- global $db;
-
- $sql_group = ($group_id !== false) ? ((!is_array($group_id)) ? 'group_id = ' . (int) $group_id : $db->sql_in_set('group_id', array_map('intval', $group_id))) : '';
- $sql_forum = ($forum_id !== false) ? ((!is_array($forum_id)) ? 'AND a.forum_id = ' . (int) $forum_id : 'AND ' . $db->sql_in_set('a.forum_id', array_map('intval', $forum_id))) : '';
-
- $sql_opts = '';
- $hold_ary = $sql_ary = array();
-
- if ($opts !== false)
- {
- $this->build_auth_option_statement('ao.auth_option', $opts, $sql_opts);
- }
-
- // Grab group settings - non-role specific...
- $sql_ary[] = 'SELECT a.group_id, a.forum_id, a.auth_setting, a.auth_option_id, ao.auth_option
- FROM ' . ACL_GROUPS_TABLE . ' a, ' . ACL_OPTIONS_TABLE . ' ao
- WHERE a.auth_role_id = 0
- AND a.auth_option_id = ao.auth_option_id ' .
- (($sql_group) ? 'AND a.' . $sql_group : '') . "
- $sql_forum
- $sql_opts
- ORDER BY a.forum_id, ao.auth_option";
-
- // Now grab group settings - role specific...
- $sql_ary[] = 'SELECT a.group_id, a.forum_id, r.auth_setting, r.auth_option_id, ao.auth_option
- FROM ' . ACL_GROUPS_TABLE . ' a, ' . ACL_ROLES_DATA_TABLE . ' r, ' . ACL_OPTIONS_TABLE . ' ao
- WHERE a.auth_role_id = r.role_id
- AND r.auth_option_id = ao.auth_option_id ' .
- (($sql_group) ? 'AND a.' . $sql_group : '') . "
- $sql_forum
- $sql_opts
- ORDER BY a.forum_id, ao.auth_option";
-
- foreach ($sql_ary as $sql)
- {
- $result = $db->sql_query($sql);
-
- while ($row = $db->sql_fetchrow($result))
- {
- $hold_ary[$row['group_id']][$row['forum_id']][$row['auth_option']] = $row['auth_setting'];
- }
- $db->sql_freeresult($result);
- }
-
- return $hold_ary;
- }
-
- /**
- * Get raw acl data based on user for caching user_permissions
- * This function returns the same data as acl_raw_data(), but without the user id as the first key within the array.
- */
- function acl_raw_data_single_user($user_id)
- {
- global $db, $cache;
-
- // Check if the role-cache is there
- if (($this->role_cache = $cache->get('_role_cache')) === false)
- {
- $this->role_cache = array();
-
- // We pre-fetch roles
- $sql = 'SELECT *
- FROM ' . ACL_ROLES_DATA_TABLE . '
- ORDER BY role_id ASC';
- $result = $db->sql_query($sql);
-
- while ($row = $db->sql_fetchrow($result))
- {
- $this->role_cache[$row['role_id']][$row['auth_option_id']] = (int) $row['auth_setting'];
- }
- $db->sql_freeresult($result);
-
- foreach ($this->role_cache as $role_id => $role_options)
- {
- $this->role_cache[$role_id] = serialize($role_options);
- }
-
- $cache->put('_role_cache', $this->role_cache);
- }
-
- $hold_ary = array();
-
- // Grab user-specific permission settings
- $sql = 'SELECT forum_id, auth_option_id, auth_role_id, auth_setting
- FROM ' . ACL_USERS_TABLE . '
- WHERE user_id = ' . $user_id;
- $result = $db->sql_query($sql);
-
- while ($row = $db->sql_fetchrow($result))
- {
- // If a role is assigned, assign all options included within this role. Else, only set this one option.
- if ($row['auth_role_id'])
- {
- $hold_ary[$row['forum_id']] = (empty($hold_ary[$row['forum_id']])) ? unserialize($this->role_cache[$row['auth_role_id']]) : $hold_ary[$row['forum_id']] + unserialize($this->role_cache[$row['auth_role_id']]);
- }
- else
- {
- $hold_ary[$row['forum_id']][$row['auth_option_id']] = $row['auth_setting'];
- }
- }
- $db->sql_freeresult($result);
-
- // Now grab group-specific permission settings
- $sql = 'SELECT a.forum_id, a.auth_option_id, a.auth_role_id, a.auth_setting
- FROM ' . ACL_GROUPS_TABLE . ' a, ' . USER_GROUP_TABLE . ' ug, ' . GROUPS_TABLE . ' g
- WHERE a.group_id = ug.group_id
- AND g.group_id = ug.group_id
- AND ug.user_pending = 0
- AND NOT (ug.group_leader = 1 AND g.group_skip_auth = 1)
- AND ug.user_id = ' . $user_id;
- $result = $db->sql_query($sql);
-
- while ($row = $db->sql_fetchrow($result))
- {
- if (!$row['auth_role_id'])
- {
- $this->_set_group_hold_ary($hold_ary[$row['forum_id']], $row['auth_option_id'], $row['auth_setting']);
- }
- else if (!empty($this->role_cache[$row['auth_role_id']]))
- {
- foreach (unserialize($this->role_cache[$row['auth_role_id']]) as $option_id => $setting)
- {
- $this->_set_group_hold_ary($hold_ary[$row['forum_id']], $option_id, $setting);
- }
- }
- }
- $db->sql_freeresult($result);
-
- return $hold_ary;
- }
-
- /**
- * Private function snippet for setting a specific piece of the hold_ary
- */
- function _set_group_hold_ary(&$hold_ary, $option_id, $setting)
- {
- if (!isset($hold_ary[$option_id]) || (isset($hold_ary[$option_id]) && $hold_ary[$option_id] != ACL_NEVER))
- {
- $hold_ary[$option_id] = $setting;
-
- // If we detect ACL_NEVER, we will unset the flag option (within building the bitstring it is correctly set again)
- if ($setting == ACL_NEVER)
- {
- $flag = substr($this->acl_options['option'][$option_id], 0, strpos($this->acl_options['option'][$option_id], '_') + 1);
- $flag = (int) $this->acl_options['id'][$flag];
-
- if (isset($hold_ary[$flag]) && $hold_ary[$flag] == ACL_YES)
- {
- unset($hold_ary[$flag]);
-
-/* This is uncommented, because i suspect this being slightly wrong due to mixed permission classes being possible
- if (in_array(ACL_YES, $hold_ary))
- {
- $hold_ary[$flag] = ACL_YES;
- }*/
- }
- }
- }
- }
-
- /**
- * Authentication plug-ins is largely down to Sergey Kanareykin, our thanks to him.
- */
- function login($username, $password, $autologin = false, $viewonline = 1, $admin = 0)
- {
- global $config, $db, $user, $phpbb_root_path, $phpEx;
-
- $method = trim(basename($config['auth_method']));
- include_once($phpbb_root_path . 'includes/auth/auth_' . $method . '.' . $phpEx);
-
- $method = 'login_' . $method;
- if (function_exists($method))
- {
- $login = $method($username, $password, $user->ip, $user->browser, $user->forwarded_for);
-
- // If the auth module wants us to create an empty profile do so and then treat the status as LOGIN_SUCCESS
- if ($login['status'] == LOGIN_SUCCESS_CREATE_PROFILE)
- {
- // we are going to use the user_add function so include functions_user.php if it wasn't defined yet
- if (!function_exists('user_add'))
- {
- include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
- }
-
- user_add($login['user_row'], (isset($login['cp_data'])) ? $login['cp_data'] : false);
-
- $sql = 'SELECT user_id, username, user_password, user_passchg, user_email, user_type
- FROM ' . USERS_TABLE . "
- WHERE username_clean = '" . $db->sql_escape(utf8_clean_string($username)) . "'";
- $result = $db->sql_query($sql);
- $row = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
-
- if (!$row)
- {
- return array(
- 'status' => LOGIN_ERROR_EXTERNAL_AUTH,
- 'error_msg' => 'AUTH_NO_PROFILE_CREATED',
- 'user_row' => array('user_id' => ANONYMOUS),
- );
- }
-
- $login = array(
- 'status' => LOGIN_SUCCESS,
- 'error_msg' => false,
- 'user_row' => $row,
- );
- }
-
- // If login succeeded, we will log the user in... else we pass the login array through...
- if ($login['status'] == LOGIN_SUCCESS)
- {
- $old_session_id = $user->session_id;
-
- if ($admin)
- {
- global $SID, $_SID;
-
- $cookie_expire = time() - 31536000;
- $user->set_cookie('u', '', $cookie_expire);
- $user->set_cookie('sid', '', $cookie_expire);
- unset($cookie_expire);
-
- $SID = '?sid=';
- $user->session_id = $_SID = '';
- }
-
- $result = $user->session_create($login['user_row']['user_id'], $admin, $autologin, $viewonline);
-
- // Successful session creation
- if ($result === true)
- {
- // If admin re-authentication we remove the old session entry because a new one has been created...
- if ($admin)
- {
- // the login array is used because the user ids do not differ for re-authentication
- $sql = 'DELETE FROM ' . SESSIONS_TABLE . "
- WHERE session_id = '" . $db->sql_escape($old_session_id) . "'
- AND session_user_id = {$login['user_row']['user_id']}";
- $db->sql_query($sql);
- }
-
- return array(
- 'status' => LOGIN_SUCCESS,
- 'error_msg' => false,
- 'user_row' => $login['user_row'],
- );
- }
-
- return array(
- 'status' => LOGIN_BREAK,
- 'error_msg' => $result,
- 'user_row' => $login['user_row'],
- );
- }
-
- return $login;
- }
-
- trigger_error('Authentication method not found', E_USER_ERROR);
- }
-
- /**
- * Fill auth_option statement for later querying based on the supplied options
- */
- function build_auth_option_statement($key, $auth_options, &$sql_opts)
- {
- global $db;
-
- if (!is_array($auth_options))
- {
- if (strpos($auth_options, '%') !== false)
- {
- $sql_opts = "AND $key " . $db->sql_like_expression(str_replace('%', $db->any_char, $auth_options));
- }
- else
- {
- $sql_opts = "AND $key = '" . $db->sql_escape($auth_options) . "'";
- }
- }
- else
- {
- $is_like_expression = false;
-
- foreach ($auth_options as $option)
- {
- if (strpos($option, '%') !== false)
- {
- $is_like_expression = true;
- }
- }
-
- if (!$is_like_expression)
- {
- $sql_opts = 'AND ' . $db->sql_in_set($key, $auth_options);
- }
- else
- {
- $sql = array();
-
- foreach ($auth_options as $option)
- {
- if (strpos($option, '%') !== false)
- {
- $sql[] = $key . ' ' . $db->sql_like_expression(str_replace('%', $db->any_char, $option));
- }
- else
- {
- $sql[] = $key . " = '" . $db->sql_escape($option) . "'";
- }
- }
-
- $sql_opts = 'AND (' . implode(' OR ', $sql) . ')';
- }
- }
- }
-}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/auth/auth_apache.php b/phpBB/includes/auth/auth_apache.php
deleted file mode 100644
index 391e7abb0e..0000000000
--- a/phpBB/includes/auth/auth_apache.php
+++ /dev/null
@@ -1,249 +0,0 @@
-<?php
-/**
-* Apache auth plug-in for phpBB3
-*
-* Authentication plug-ins is largely down to Sergey Kanareykin, our thanks to him.
-*
-* @package login
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
-*
-*/
-
-/**
-* @ignore
-*/
-if (!defined('IN_PHPBB'))
-{
- exit;
-}
-
-/**
-* Checks whether the user is identified to apache
-* Only allow changing authentication to apache if the user is identified
-* Called in acp_board while setting authentication plugins
-*
-* @return boolean|string false if the user is identified and else an error message
-*/
-function init_apache()
-{
- global $user;
-
- if (!isset($_SERVER['PHP_AUTH_USER']) || $user->data['username'] !== $_SERVER['PHP_AUTH_USER'])
- {
- return $user->lang['APACHE_SETUP_BEFORE_USE'];
- }
- return false;
-}
-
-/**
-* Login function
-*/
-function login_apache(&$username, &$password)
-{
- global $db;
-
- // do not allow empty password
- if (!$password)
- {
- return array(
- 'status' => LOGIN_ERROR_PASSWORD,
- 'error_msg' => 'NO_PASSWORD_SUPPLIED',
- 'user_row' => array('user_id' => ANONYMOUS),
- );
- }
-
- if (!$username)
- {
- return array(
- 'status' => LOGIN_ERROR_USERNAME,
- 'error_msg' => 'LOGIN_ERROR_USERNAME',
- 'user_row' => array('user_id' => ANONYMOUS),
- );
- }
-
- if (!isset($_SERVER['PHP_AUTH_USER']))
- {
- return array(
- 'status' => LOGIN_ERROR_EXTERNAL_AUTH,
- 'error_msg' => 'LOGIN_ERROR_EXTERNAL_AUTH_APACHE',
- 'user_row' => array('user_id' => ANONYMOUS),
- );
- }
-
- $php_auth_user = $_SERVER['PHP_AUTH_USER'];
- $php_auth_pw = $_SERVER['PHP_AUTH_PW'];
-
- if (!empty($php_auth_user) && !empty($php_auth_pw))
- {
- if ($php_auth_user !== $username)
- {
- return array(
- 'status' => LOGIN_ERROR_USERNAME,
- 'error_msg' => 'LOGIN_ERROR_USERNAME',
- 'user_row' => array('user_id' => ANONYMOUS),
- );
- }
-
- $sql = 'SELECT user_id, username, user_password, user_passchg, user_email, user_type
- FROM ' . USERS_TABLE . "
- WHERE username = '" . $db->sql_escape($php_auth_user) . "'";
- $result = $db->sql_query($sql);
- $row = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
-
- if ($row)
- {
- // User inactive...
- if ($row['user_type'] == USER_INACTIVE || $row['user_type'] == USER_IGNORE)
- {
- return array(
- 'status' => LOGIN_ERROR_ACTIVE,
- 'error_msg' => 'ACTIVE_ERROR',
- 'user_row' => $row,
- );
- }
-
- // Successful login...
- return array(
- 'status' => LOGIN_SUCCESS,
- 'error_msg' => false,
- 'user_row' => $row,
- );
- }
-
- // this is the user's first login so create an empty profile
- return array(
- 'status' => LOGIN_SUCCESS_CREATE_PROFILE,
- 'error_msg' => false,
- 'user_row' => user_row_apache($php_auth_user, $php_auth_pw),
- );
- }
-
- // Not logged into apache
- return array(
- 'status' => LOGIN_ERROR_EXTERNAL_AUTH,
- 'error_msg' => 'LOGIN_ERROR_EXTERNAL_AUTH_APACHE',
- 'user_row' => array('user_id' => ANONYMOUS),
- );
-}
-
-/**
-* Autologin function
-*
-* @return array containing the user row or empty if no auto login should take place
-*/
-function autologin_apache()
-{
- global $db;
-
- if (!isset($_SERVER['PHP_AUTH_USER']))
- {
- return array();
- }
-
- $php_auth_user = $_SERVER['PHP_AUTH_USER'];
- $php_auth_pw = $_SERVER['PHP_AUTH_PW'];
-
- if (!empty($php_auth_user) && !empty($php_auth_pw))
- {
- set_var($php_auth_user, $php_auth_user, 'string', true);
- set_var($php_auth_pw, $php_auth_pw, 'string', true);
-
- $sql = 'SELECT *
- FROM ' . USERS_TABLE . "
- WHERE username = '" . $db->sql_escape($php_auth_user) . "'";
- $result = $db->sql_query($sql);
- $row = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
-
- if ($row)
- {
- return ($row['user_type'] == USER_INACTIVE || $row['user_type'] == USER_IGNORE) ? array() : $row;
- }
-
- if (!function_exists('user_add'))
- {
- global $phpbb_root_path, $phpEx;
-
- include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
- }
-
- // create the user if he does not exist yet
- user_add(user_row_apache($php_auth_user, $php_auth_pw));
-
- $sql = 'SELECT *
- FROM ' . USERS_TABLE . "
- WHERE username_clean = '" . $db->sql_escape(utf8_clean_string($php_auth_user)) . "'";
- $result = $db->sql_query($sql);
- $row = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
-
- if ($row)
- {
- return $row;
- }
- }
-
- return array();
-}
-
-/**
-* This function generates an array which can be passed to the user_add function in order to create a user
-*/
-function user_row_apache($username, $password)
-{
- global $db, $config, $user;
- // first retrieve default group id
- $sql = 'SELECT group_id
- FROM ' . GROUPS_TABLE . "
- WHERE group_name = '" . $db->sql_escape('REGISTERED') . "'
- AND group_type = " . GROUP_SPECIAL;
- $result = $db->sql_query($sql);
- $row = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
-
- if (!$row)
- {
- trigger_error('NO_GROUP');
- }
-
- // generate user account data
- return array(
- 'username' => $username,
- 'user_password' => phpbb_hash($password),
- 'user_email' => '',
- 'group_id' => (int) $row['group_id'],
- 'user_type' => USER_NORMAL,
- 'user_ip' => $user->ip,
- 'user_new' => ($config['new_member_post_limit']) ? 1 : 0,
- );
-}
-
-/**
-* The session validation function checks whether the user is still logged in
-*
-* @return boolean true if the given user is authenticated or false if the session should be closed
-*/
-function validate_session_apache(&$user)
-{
- // Check if PHP_AUTH_USER is set and handle this case
- if (isset($_SERVER['PHP_AUTH_USER']))
- {
- $php_auth_user = '';
- set_var($php_auth_user, $_SERVER['PHP_AUTH_USER'], 'string', true);
-
- return ($php_auth_user === $user['username']) ? true : false;
- }
-
- // PHP_AUTH_USER is not set. A valid session is now determined by the user type (anonymous/bot or not)
- if ($user['user_type'] == USER_IGNORE)
- {
- return true;
- }
-
- return false;
-}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/auth/auth_db.php b/phpBB/includes/auth/auth_db.php
deleted file mode 100644
index 1c6cdf7832..0000000000
--- a/phpBB/includes/auth/auth_db.php
+++ /dev/null
@@ -1,276 +0,0 @@
-<?php
-/**
-* Database auth plug-in for phpBB3
-*
-* Authentication plug-ins is largely down to Sergey Kanareykin, our thanks to him.
-*
-* This is for authentication via the integrated user table
-*
-* @package login
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
-*
-*/
-
-/**
-* @ignore
-*/
-if (!defined('IN_PHPBB'))
-{
- exit;
-}
-
-/**
-* Login function
-*
-* @param string $username
-* @param string $password
-* @param string $ip IP address the login is taking place from. Used to
-* limit the number of login attempts per IP address.
-* @param string $browser The user agent used to login
-* @param string $forwarded_for X_FORWARDED_FOR header sent with login request
-* @return array A associative array of the format
-* array(
-* 'status' => status constant
-* 'error_msg' => string
-* 'user_row' => array
-* )
-*/
-function login_db($username, $password, $ip = '', $browser = '', $forwarded_for = '')
-{
- global $db, $config;
-
- // do not allow empty password
- if (!$password)
- {
- return array(
- 'status' => LOGIN_ERROR_PASSWORD,
- 'error_msg' => 'NO_PASSWORD_SUPPLIED',
- 'user_row' => array('user_id' => ANONYMOUS),
- );
- }
-
- if (!$username)
- {
- return array(
- 'status' => LOGIN_ERROR_USERNAME,
- 'error_msg' => 'LOGIN_ERROR_USERNAME',
- 'user_row' => array('user_id' => ANONYMOUS),
- );
- }
-
- $username_clean = utf8_clean_string($username);
-
- $sql = 'SELECT user_id, username, user_password, user_passchg, user_pass_convert, user_email, user_type, user_login_attempts
- FROM ' . USERS_TABLE . "
- WHERE username_clean = '" . $db->sql_escape($username_clean) . "'";
- $result = $db->sql_query($sql);
- $row = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
-
- if (($ip && !$config['ip_login_limit_use_forwarded']) ||
- ($forwarded_for && $config['ip_login_limit_use_forwarded']))
- {
- $sql = 'SELECT COUNT(*) AS attempts
- FROM ' . LOGIN_ATTEMPT_TABLE . '
- WHERE attempt_time > ' . (time() - (int) $config['ip_login_limit_time']);
- if ($config['ip_login_limit_use_forwarded'])
- {
- $sql .= " AND attempt_forwarded_for = '" . $db->sql_escape($forwarded_for) . "'";
- }
- else
- {
- $sql .= " AND attempt_ip = '" . $db->sql_escape($ip) . "' ";
- }
-
- $result = $db->sql_query($sql);
- $attempts = (int) $db->sql_fetchfield('attempts');
- $db->sql_freeresult($result);
-
- $attempt_data = array(
- 'attempt_ip' => $ip,
- 'attempt_browser' => trim(substr($browser, 0, 149)),
- 'attempt_forwarded_for' => $forwarded_for,
- 'attempt_time' => time(),
- 'user_id' => ($row) ? (int) $row['user_id'] : 0,
- 'username' => $username,
- 'username_clean' => $username_clean,
- );
- $sql = 'INSERT INTO ' . LOGIN_ATTEMPT_TABLE . $db->sql_build_array('INSERT', $attempt_data);
- $result = $db->sql_query($sql);
- }
- else
- {
- $attempts = 0;
- }
-
- if (!$row)
- {
- if ($config['ip_login_limit_max'] && $attempts >= $config['ip_login_limit_max'])
- {
- return array(
- 'status' => LOGIN_ERROR_ATTEMPTS,
- 'error_msg' => 'LOGIN_ERROR_ATTEMPTS',
- 'user_row' => array('user_id' => ANONYMOUS),
- );
- }
-
- return array(
- 'status' => LOGIN_ERROR_USERNAME,
- 'error_msg' => 'LOGIN_ERROR_USERNAME',
- 'user_row' => array('user_id' => ANONYMOUS),
- );
- }
-
- $show_captcha = ($config['max_login_attempts'] && $row['user_login_attempts'] >= $config['max_login_attempts']) ||
- ($config['ip_login_limit_max'] && $attempts >= $config['ip_login_limit_max']);
-
- // If there are too much login attempts, we need to check for an confirm image
- // Every auth module is able to define what to do by itself...
- if ($show_captcha)
- {
- // Visual Confirmation handling
- if (!class_exists('phpbb_captcha_factory'))
- {
- global $phpbb_root_path, $phpEx;
- include ($phpbb_root_path . 'includes/captcha/captcha_factory.' . $phpEx);
- }
-
- $captcha =& phpbb_captcha_factory::get_instance($config['captcha_plugin']);
- $captcha->init(CONFIRM_LOGIN);
- $vc_response = $captcha->validate($row);
- if ($vc_response)
- {
- return array(
- 'status' => LOGIN_ERROR_ATTEMPTS,
- 'error_msg' => 'LOGIN_ERROR_ATTEMPTS',
- 'user_row' => $row,
- );
- }
- else
- {
- $captcha->reset();
- }
-
- }
-
- // If the password convert flag is set we need to convert it
- if ($row['user_pass_convert'])
- {
- // in phpBB2 passwords were used exactly as they were sent, with addslashes applied
- $password_old_format = isset($_REQUEST['password']) ? (string) $_REQUEST['password'] : '';
- $password_old_format = (!STRIP) ? addslashes($password_old_format) : $password_old_format;
- $password_new_format = '';
-
- set_var($password_new_format, stripslashes($password_old_format), 'string', true);
-
- if ($password == $password_new_format)
- {
- if (!function_exists('utf8_to_cp1252'))
- {
- global $phpbb_root_path, $phpEx;
- include($phpbb_root_path . 'includes/utf/data/recode_basic.' . $phpEx);
- }
-
- // cp1252 is phpBB2's default encoding, characters outside ASCII range might work when converted into that encoding
- // plain md5 support left in for conversions from other systems.
- if ((strlen($row['user_password']) == 34 && (phpbb_check_hash(md5($password_old_format), $row['user_password']) || phpbb_check_hash(md5(utf8_to_cp1252($password_old_format)), $row['user_password'])))
- || (strlen($row['user_password']) == 32 && (md5($password_old_format) == $row['user_password'] || md5(utf8_to_cp1252($password_old_format)) == $row['user_password'])))
- {
- $hash = phpbb_hash($password_new_format);
-
- // Update the password in the users table to the new format and remove user_pass_convert flag
- $sql = 'UPDATE ' . USERS_TABLE . '
- SET user_password = \'' . $db->sql_escape($hash) . '\',
- user_pass_convert = 0
- WHERE user_id = ' . $row['user_id'];
- $db->sql_query($sql);
-
- $row['user_pass_convert'] = 0;
- $row['user_password'] = $hash;
- }
- else
- {
- // Although we weren't able to convert this password we have to
- // increase login attempt count to make sure this cannot be exploited
- $sql = 'UPDATE ' . USERS_TABLE . '
- SET user_login_attempts = user_login_attempts + 1
- WHERE user_id = ' . (int) $row['user_id'] . '
- AND user_login_attempts < ' . LOGIN_ATTEMPTS_MAX;
- $db->sql_query($sql);
-
- return array(
- 'status' => LOGIN_ERROR_PASSWORD_CONVERT,
- 'error_msg' => 'LOGIN_ERROR_PASSWORD_CONVERT',
- 'user_row' => $row,
- );
- }
- }
- }
-
- // Check password ...
- if (!$row['user_pass_convert'] && phpbb_check_hash($password, $row['user_password']))
- {
- // Check for old password hash...
- if (strlen($row['user_password']) == 32)
- {
- $hash = phpbb_hash($password);
-
- // Update the password in the users table to the new format
- $sql = 'UPDATE ' . USERS_TABLE . "
- SET user_password = '" . $db->sql_escape($hash) . "',
- user_pass_convert = 0
- WHERE user_id = {$row['user_id']}";
- $db->sql_query($sql);
-
- $row['user_password'] = $hash;
- }
-
- $sql = 'DELETE FROM ' . LOGIN_ATTEMPT_TABLE . '
- WHERE user_id = ' . $row['user_id'];
- $db->sql_query($sql);
-
- if ($row['user_login_attempts'] != 0)
- {
- // Successful, reset login attempts (the user passed all stages)
- $sql = 'UPDATE ' . USERS_TABLE . '
- SET user_login_attempts = 0
- WHERE user_id = ' . $row['user_id'];
- $db->sql_query($sql);
- }
-
- // User inactive...
- if ($row['user_type'] == USER_INACTIVE || $row['user_type'] == USER_IGNORE)
- {
- return array(
- 'status' => LOGIN_ERROR_ACTIVE,
- 'error_msg' => 'ACTIVE_ERROR',
- 'user_row' => $row,
- );
- }
-
- // Successful login... set user_login_attempts to zero...
- return array(
- 'status' => LOGIN_SUCCESS,
- 'error_msg' => false,
- 'user_row' => $row,
- );
- }
-
- // Password incorrect - increase login attempts
- $sql = 'UPDATE ' . USERS_TABLE . '
- SET user_login_attempts = user_login_attempts + 1
- WHERE user_id = ' . (int) $row['user_id'] . '
- AND user_login_attempts < ' . LOGIN_ATTEMPTS_MAX;
- $db->sql_query($sql);
-
- // Give status about wrong password...
- return array(
- 'status' => ($show_captcha) ? LOGIN_ERROR_ATTEMPTS : LOGIN_ERROR_PASSWORD,
- 'error_msg' => ($show_captcha) ? 'LOGIN_ERROR_ATTEMPTS' : 'LOGIN_ERROR_PASSWORD',
- 'user_row' => $row,
- );
-}
-
-?>
diff --git a/phpBB/includes/auth/auth_ldap.php b/phpBB/includes/auth/auth_ldap.php
deleted file mode 100644
index f7134dca7e..0000000000
--- a/phpBB/includes/auth/auth_ldap.php
+++ /dev/null
@@ -1,359 +0,0 @@
-<?php
-/**
-*
-* LDAP auth plug-in for phpBB3
-*
-* Authentication plug-ins is largely down to Sergey Kanareykin, our thanks to him.
-*
-* @package login
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
-*
-*/
-
-/**
-* @ignore
-*/
-if (!defined('IN_PHPBB'))
-{
- exit;
-}
-
-/**
-* Connect to ldap server
-* Only allow changing authentication to ldap if we can connect to the ldap server
-* Called in acp_board while setting authentication plugins
-*/
-function init_ldap()
-{
- global $config, $user;
-
- if (!@extension_loaded('ldap'))
- {
- return $user->lang['LDAP_NO_LDAP_EXTENSION'];
- }
-
- $config['ldap_port'] = (int) $config['ldap_port'];
- if ($config['ldap_port'])
- {
- $ldap = @ldap_connect($config['ldap_server'], $config['ldap_port']);
- }
- else
- {
- $ldap = @ldap_connect($config['ldap_server']);
- }
-
- if (!$ldap)
- {
- return $user->lang['LDAP_NO_SERVER_CONNECTION'];
- }
-
- @ldap_set_option($ldap, LDAP_OPT_PROTOCOL_VERSION, 3);
- @ldap_set_option($ldap, LDAP_OPT_REFERRALS, 0);
-
- /* Patch by maat */
- @ldap_start_tls($ldap);
-
- if ($config['ldap_user'] || $config['ldap_password'])
- {
- if (!@ldap_bind($ldap, htmlspecialchars_decode($config['ldap_user']), htmlspecialchars_decode($config['ldap_password'])))
- {
- return $user->lang['LDAP_INCORRECT_USER_PASSWORD'];
- }
- }
-
- // ldap_connect only checks whether the specified server is valid, so the connection might still fail
- $search = @ldap_search(
- $ldap,
- htmlspecialchars_decode($config['ldap_base_dn']),
- ldap_user_filter($user->data['username']),
- (empty($config['ldap_email'])) ?
- array(htmlspecialchars_decode($config['ldap_uid'])) :
- array(htmlspecialchars_decode($config['ldap_uid']), htmlspecialchars_decode($config['ldap_email'])),
- 0,
- 1
- );
-
- if ($search === false)
- {
- return $user->lang['LDAP_SEARCH_FAILED'];
- }
-
- $result = @ldap_get_entries($ldap, $search);
-
- @ldap_close($ldap);
-
-
- if (!is_array($result) || sizeof($result) < 2)
- {
- return sprintf($user->lang['LDAP_NO_IDENTITY'], $user->data['username']);
- }
-
- if (!empty($config['ldap_email']) && !isset($result[0][htmlspecialchars_decode($config['ldap_email'])]))
- {
- return $user->lang['LDAP_NO_EMAIL'];
- }
-
- return false;
-}
-
-/**
-* Login function
-*/
-function login_ldap(&$username, &$password)
-{
- global $db, $config, $user;
-
- // do not allow empty password
- if (!$password)
- {
- return array(
- 'status' => LOGIN_ERROR_PASSWORD,
- 'error_msg' => 'NO_PASSWORD_SUPPLIED',
- 'user_row' => array('user_id' => ANONYMOUS),
- );
- }
-
- if (!$username)
- {
- return array(
- 'status' => LOGIN_ERROR_USERNAME,
- 'error_msg' => 'LOGIN_ERROR_USERNAME',
- 'user_row' => array('user_id' => ANONYMOUS),
- );
- }
-
- if (!@extension_loaded('ldap'))
- {
- return array(
- 'status' => LOGIN_ERROR_EXTERNAL_AUTH,
- 'error_msg' => 'LDAP_NO_LDAP_EXTENSION',
- 'user_row' => array('user_id' => ANONYMOUS),
- );
- }
-
- $config['ldap_port'] = (int) $config['ldap_port'];
- if ($config['ldap_port'])
- {
- $ldap = @ldap_connect($config['ldap_server'], $config['ldap_port']);
- }
- else
- {
- $ldap = @ldap_connect($config['ldap_server']);
- }
-
- if (!$ldap)
- {
- return array(
- 'status' => LOGIN_ERROR_EXTERNAL_AUTH,
- 'error_msg' => 'LDAP_NO_SERVER_CONNECTION',
- 'user_row' => array('user_id' => ANONYMOUS),
- );
- }
-
- @ldap_set_option($ldap, LDAP_OPT_PROTOCOL_VERSION, 3);
- @ldap_set_option($ldap, LDAP_OPT_REFERRALS, 0);
-
- /* Patch by maat */
- @ldap_start_tls($ldap);
-
- if ($config['ldap_user'] || $config['ldap_password'])
- {
- if (!@ldap_bind($ldap, htmlspecialchars_decode($config['ldap_user']), htmlspecialchars_decode($config['ldap_password'])))
- {
- return array(
- 'status' => LOGIN_ERROR_EXTERNAL_AUTH,
- 'error_msg' => 'LDAP_NO_SERVER_CONNECTION',
- 'user_row' => array('user_id' => ANONYMOUS),
- );
- }
- }
-
- $search = @ldap_search(
- $ldap,
- htmlspecialchars_decode($config['ldap_base_dn']),
- ldap_user_filter($username),
- (empty($config['ldap_email'])) ?
- array(htmlspecialchars_decode($config['ldap_uid'])) :
- array(htmlspecialchars_decode($config['ldap_uid']), htmlspecialchars_decode($config['ldap_email'])),
- 0,
- 1
- );
-
- $ldap_result = @ldap_get_entries($ldap, $search);
-
- if (is_array($ldap_result) && sizeof($ldap_result) > 1)
- {
- if (@ldap_bind($ldap, $ldap_result[0]['dn'], htmlspecialchars_decode($password)))
- {
- @ldap_close($ldap);
-
- $sql ='SELECT user_id, username, user_password, user_passchg, user_email, user_type
- FROM ' . USERS_TABLE . "
- WHERE username_clean = '" . $db->sql_escape(utf8_clean_string($username)) . "'";
- $result = $db->sql_query($sql);
- $row = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
-
- if ($row)
- {
- unset($ldap_result);
-
- // User inactive...
- if ($row['user_type'] == USER_INACTIVE || $row['user_type'] == USER_IGNORE)
- {
- return array(
- 'status' => LOGIN_ERROR_ACTIVE,
- 'error_msg' => 'ACTIVE_ERROR',
- 'user_row' => $row,
- );
- }
-
- // Successful login... set user_login_attempts to zero...
- return array(
- 'status' => LOGIN_SUCCESS,
- 'error_msg' => false,
- 'user_row' => $row,
- );
- }
- else
- {
- // retrieve default group id
- $sql = 'SELECT group_id
- FROM ' . GROUPS_TABLE . "
- WHERE group_name = '" . $db->sql_escape('REGISTERED') . "'
- AND group_type = " . GROUP_SPECIAL;
- $result = $db->sql_query($sql);
- $row = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
-
- if (!$row)
- {
- trigger_error('NO_GROUP');
- }
-
- // generate user account data
- $ldap_user_row = array(
- 'username' => $username,
- 'user_password' => phpbb_hash($password),
- 'user_email' => (!empty($config['ldap_email'])) ? utf8_htmlspecialchars($ldap_result[0][htmlspecialchars_decode($config['ldap_email'])][0]) : '',
- 'group_id' => (int) $row['group_id'],
- 'user_type' => USER_NORMAL,
- 'user_ip' => $user->ip,
- 'user_new' => ($config['new_member_post_limit']) ? 1 : 0,
- );
-
- unset($ldap_result);
-
- // this is the user's first login so create an empty profile
- return array(
- 'status' => LOGIN_SUCCESS_CREATE_PROFILE,
- 'error_msg' => false,
- 'user_row' => $ldap_user_row,
- );
- }
- }
- else
- {
- unset($ldap_result);
- @ldap_close($ldap);
-
- // Give status about wrong password...
- return array(
- 'status' => LOGIN_ERROR_PASSWORD,
- 'error_msg' => 'LOGIN_ERROR_PASSWORD',
- 'user_row' => array('user_id' => ANONYMOUS),
- );
- }
- }
-
- @ldap_close($ldap);
-
- return array(
- 'status' => LOGIN_ERROR_USERNAME,
- 'error_msg' => 'LOGIN_ERROR_USERNAME',
- 'user_row' => array('user_id' => ANONYMOUS),
- );
-}
-
-/**
-* Generates a filter string for ldap_search to find a user
-*
-* @param $username string Username identifying the searched user
-*
-* @return string A filter string for ldap_search
-*/
-function ldap_user_filter($username)
-{
- global $config;
-
- $filter = '(' . $config['ldap_uid'] . '=' . phpbb_ldap_escape(htmlspecialchars_decode($username)) . ')';
- if ($config['ldap_user_filter'])
- {
- $_filter = ($config['ldap_user_filter'][0] == '(' && substr($config['ldap_user_filter'], -1) == ')') ? $config['ldap_user_filter'] : "({$config['ldap_user_filter']})";
- $filter = "(&{$filter}{$_filter})";
- }
- return $filter;
-}
-
-/**
-* Escapes an LDAP AttributeValue
-*/
-function phpbb_ldap_escape($string)
-{
- return str_replace(array('*', '\\', '(', ')'), array('\\*', '\\\\', '\\(', '\\)'), $string);
-}
-
-/**
-* This function is used to output any required fields in the authentication
-* admin panel. It also defines any required configuration table fields.
-*/
-function acp_ldap(&$new)
-{
- global $user;
-
- $tpl = '
-
- <dl>
- <dt><label for="ldap_server">' . $user->lang['LDAP_SERVER'] . ':</label><br /><span>' . $user->lang['LDAP_SERVER_EXPLAIN'] . '</span></dt>
- <dd><input type="text" id="ldap_server" size="40" name="config[ldap_server]" value="' . $new['ldap_server'] . '" /></dd>
- </dl>
- <dl>
- <dt><label for="ldap_port">' . $user->lang['LDAP_PORT'] . ':</label><br /><span>' . $user->lang['LDAP_PORT_EXPLAIN'] . '</span></dt>
- <dd><input type="text" id="ldap_port" size="40" name="config[ldap_port]" value="' . $new['ldap_port'] . '" /></dd>
- </dl>
- <dl>
- <dt><label for="ldap_dn">' . $user->lang['LDAP_DN'] . ':</label><br /><span>' . $user->lang['LDAP_DN_EXPLAIN'] . '</span></dt>
- <dd><input type="text" id="ldap_dn" size="40" name="config[ldap_base_dn]" value="' . $new['ldap_base_dn'] . '" /></dd>
- </dl>
- <dl>
- <dt><label for="ldap_uid">' . $user->lang['LDAP_UID'] . ':</label><br /><span>' . $user->lang['LDAP_UID_EXPLAIN'] . '</span></dt>
- <dd><input type="text" id="ldap_uid" size="40" name="config[ldap_uid]" value="' . $new['ldap_uid'] . '" /></dd>
- </dl>
- <dl>
- <dt><label for="ldap_user_filter">' . $user->lang['LDAP_USER_FILTER'] . ':</label><br /><span>' . $user->lang['LDAP_USER_FILTER_EXPLAIN'] . '</span></dt>
- <dd><input type="text" id="ldap_user_filter" size="40" name="config[ldap_user_filter]" value="' . $new['ldap_user_filter'] . '" /></dd>
- </dl>
- <dl>
- <dt><label for="ldap_email">' . $user->lang['LDAP_EMAIL'] . ':</label><br /><span>' . $user->lang['LDAP_EMAIL_EXPLAIN'] . '</span></dt>
- <dd><input type="text" id="ldap_email" size="40" name="config[ldap_email]" value="' . $new['ldap_email'] . '" /></dd>
- </dl>
- <dl>
- <dt><label for="ldap_user">' . $user->lang['LDAP_USER'] . ':</label><br /><span>' . $user->lang['LDAP_USER_EXPLAIN'] . '</span></dt>
- <dd><input type="text" id="ldap_user" size="40" name="config[ldap_user]" value="' . $new['ldap_user'] . '" /></dd>
- </dl>
- <dl>
- <dt><label for="ldap_password">' . $user->lang['LDAP_PASSWORD'] . ':</label><br /><span>' . $user->lang['LDAP_PASSWORD_EXPLAIN'] . '</span></dt>
- <dd><input type="password" id="ldap_password" size="40" name="config[ldap_password]" value="' . $new['ldap_password'] . '" autocomplete="off" /></dd>
- </dl>
- ';
-
- // These are fields required in the config table
- return array(
- 'tpl' => $tpl,
- 'config' => array('ldap_server', 'ldap_port', 'ldap_base_dn', 'ldap_uid', 'ldap_user_filter', 'ldap_email', 'ldap_user', 'ldap_password')
- );
-}
-
-?>
diff --git a/phpBB/includes/bbcode.php b/phpBB/includes/bbcode.php
index 3c25fd6587..86390c0901 100644
--- a/phpBB/includes/bbcode.php
+++ b/phpBB/includes/bbcode.php
@@ -1,10 +1,13 @@
<?php
/**
*
-* @package phpBB3
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -18,7 +21,6 @@ if (!defined('IN_PHPBB'))
/**
* BBCode class
-* @package phpBB3
*/
class bbcode
{
@@ -30,7 +32,6 @@ class bbcode
var $bbcodes = array();
var $template_bitfield;
- var $template_filename = '';
/**
* Constructor
@@ -128,33 +129,16 @@ class bbcode
*/
function bbcode_cache_init()
{
- global $phpbb_root_path, $template, $user;
+ global $phpbb_root_path, $phpEx, $config, $user, $phpbb_dispatcher, $phpbb_extension_manager, $phpbb_path_helper;
if (empty($this->template_filename))
{
- $this->template_bitfield = new bitfield($user->theme['bbcode_bitfield']);
- $this->template_filename = $phpbb_root_path . 'styles/' . $user->theme['template_path'] . '/template/bbcode.html';
-
- if (empty($user->theme['template_inherits_id']) && !empty($template->orig_tpl_inherits_id))
- {
- $user->theme['template_inherits_id'] = $template->orig_tpl_inherits_id;
- }
+ $this->template_bitfield = new bitfield($user->style['bbcode_bitfield']);
- if (!@file_exists($this->template_filename))
- {
- if (isset($user->theme['template_inherits_id']) && $user->theme['template_inherits_id'])
- {
- $this->template_filename = $phpbb_root_path . 'styles/' . $user->theme['template_inherit_path'] . '/template/bbcode.html';
- if (!@file_exists($this->template_filename))
- {
- trigger_error('The file ' . $this->template_filename . ' is missing.', E_USER_ERROR);
- }
- }
- else
- {
- trigger_error('The file ' . $this->template_filename . ' is missing.', E_USER_ERROR);
- }
- }
+ $template = new phpbb\template\twig\twig($phpbb_path_helper, $config, $user, new phpbb\template\context(), $phpbb_extension_manager);
+ $template->set_style();
+ $template->set_filenames(array('bbcode.html' => 'bbcode.html'));
+ $this->template_filename = $template->get_source_file_for_handle('bbcode.html');
}
$bbcode_ids = $rowset = $sql = array();
@@ -198,6 +182,8 @@ class bbcode
$db->sql_freeresult($result);
}
+ // To perform custom second pass in extension, use $this->bbcode_second_pass_by_extension()
+ // method which accepts variable number of parameters
foreach ($bbcode_ids as $bbcode_id)
{
switch ($bbcode_id)
@@ -404,6 +390,26 @@ class bbcode
break;
}
}
+
+ $bbcode_cache = $this->bbcode_cache;
+ $bbcode_bitfield = $this->bbcode_bitfield;
+ $bbcode_uid = $this->bbcode_uid;
+
+ /**
+ * Use this event to modify the bbcode_cache
+ *
+ * @event core.bbcode_cache_init_end
+ * @var array bbcode_cache The array of cached search and replace patterns of bbcodes
+ * @var string bbcode_bitfield The bbcode bitfield
+ * @var string bbcode_uid The bbcode uid
+ * @since 3.1.3-RC1
+ */
+ $vars = array('bbcode_cache', 'bbcode_bitfield', 'bbcode_uid');
+ extract($phpbb_dispatcher->trigger_event('core.bbcode_cache_init_end', compact($vars)));
+
+ $this->bbcode_cache = $bbcode_cache;
+ $this->bbcode_bitfield = $bbcode_bitfield;
+ $this->bbcode_uid = $bbcode_uid;
}
/**
@@ -423,7 +429,7 @@ class bbcode
'i_close' => '</span>',
'u_open' => '<span style="text-decoration: underline">',
'u_close' => '</span>',
- 'img' => '<img src="$1" alt="' . $user->lang['IMAGE'] . '" />',
+ 'img' => '<img src="$1" class="postimage" alt="' . $user->lang['IMAGE'] . '" />',
'size' => '<span style="font-size: $1%; line-height: normal">$2</span>',
'color' => '<span style="color: $1">$2</span>',
'email' => '<a href="mailto:$1">$2</a>'
@@ -609,6 +615,36 @@ class bbcode
return $code;
}
-}
-?> \ No newline at end of file
+ /**
+ * Function to perform custom bbcode second pass by extensions
+ * can be used to assign bbcode pattern replacement
+ * Example: '#\[list=([^\[]+):$uid\]#e' => "\$this->bbcode_second_pass_by_extension('\$1')"
+ *
+ * Accepts variable number of parameters
+ *
+ * @return mixed Second pass result
+ */
+ function bbcode_second_pass_by_extension()
+ {
+ global $phpbb_dispatcher;
+
+ $return = false;
+ $params_array = func_get_args();
+
+ /**
+ * Event to perform bbcode second pass with
+ * the custom validating methods provided by extensions
+ *
+ * @event core.bbcode_second_pass_by_extension
+ * @var array params_array Array with the function parameters
+ * @var mixed return Second pass result to return
+ *
+ * @since 3.1.5-RC1
+ */
+ $vars = array('params_array', 'return');
+ extract($phpbb_dispatcher->trigger_event('core.bbcode_second_pass_by_extension', compact($vars)));
+
+ return $return;
+ }
+}
diff --git a/phpBB/includes/cache.php b/phpBB/includes/cache.php
deleted file mode 100644
index 612adcca4f..0000000000
--- a/phpBB/includes/cache.php
+++ /dev/null
@@ -1,437 +0,0 @@
-<?php
-/**
-*
-* @package acm
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
-*
-*/
-
-/**
-* @ignore
-*/
-if (!defined('IN_PHPBB'))
-{
- exit;
-}
-
-/**
-* Class for grabbing/handling cached entries, extends acm_file or acm_db depending on the setup
-* @package acm
-*/
-class cache extends acm
-{
- /**
- * Get config values
- */
- function obtain_config()
- {
- global $db;
-
- if (($config = $this->get('config')) !== false)
- {
- $sql = 'SELECT config_name, config_value
- FROM ' . CONFIG_TABLE . '
- WHERE is_dynamic = 1';
- $result = $db->sql_query($sql);
-
- while ($row = $db->sql_fetchrow($result))
- {
- $config[$row['config_name']] = $row['config_value'];
- }
- $db->sql_freeresult($result);
- }
- else
- {
- $config = $cached_config = array();
-
- $sql = 'SELECT config_name, config_value, is_dynamic
- FROM ' . CONFIG_TABLE;
- $result = $db->sql_query($sql);
-
- while ($row = $db->sql_fetchrow($result))
- {
- if (!$row['is_dynamic'])
- {
- $cached_config[$row['config_name']] = $row['config_value'];
- }
-
- $config[$row['config_name']] = $row['config_value'];
- }
- $db->sql_freeresult($result);
-
- $this->put('config', $cached_config);
- }
-
- return $config;
- }
-
- /**
- * Obtain list of naughty words and build preg style replacement arrays for use by the
- * calling script
- */
- function obtain_word_list()
- {
- global $db;
-
- if (($censors = $this->get('_word_censors')) === false)
- {
- $sql = 'SELECT word, replacement
- FROM ' . WORDS_TABLE;
- $result = $db->sql_query($sql);
-
- $censors = array();
- while ($row = $db->sql_fetchrow($result))
- {
- $censors['match'][] = get_censor_preg_expression($row['word']);
- $censors['replace'][] = $row['replacement'];
- }
- $db->sql_freeresult($result);
-
- $this->put('_word_censors', $censors);
- }
-
- return $censors;
- }
-
- /**
- * Obtain currently listed icons
- */
- function obtain_icons()
- {
- if (($icons = $this->get('_icons')) === false)
- {
- global $db;
-
- // Topic icons
- $sql = 'SELECT *
- FROM ' . ICONS_TABLE . '
- ORDER BY icons_order';
- $result = $db->sql_query($sql);
-
- $icons = array();
- while ($row = $db->sql_fetchrow($result))
- {
- $icons[$row['icons_id']]['img'] = $row['icons_url'];
- $icons[$row['icons_id']]['width'] = (int) $row['icons_width'];
- $icons[$row['icons_id']]['height'] = (int) $row['icons_height'];
- $icons[$row['icons_id']]['display'] = (bool) $row['display_on_posting'];
- }
- $db->sql_freeresult($result);
-
- $this->put('_icons', $icons);
- }
-
- return $icons;
- }
-
- /**
- * Obtain ranks
- */
- function obtain_ranks()
- {
- if (($ranks = $this->get('_ranks')) === false)
- {
- global $db;
-
- $sql = 'SELECT *
- FROM ' . RANKS_TABLE . '
- ORDER BY rank_min DESC';
- $result = $db->sql_query($sql);
-
- $ranks = array();
- while ($row = $db->sql_fetchrow($result))
- {
- if ($row['rank_special'])
- {
- $ranks['special'][$row['rank_id']] = array(
- 'rank_title' => $row['rank_title'],
- 'rank_image' => $row['rank_image']
- );
- }
- else
- {
- $ranks['normal'][] = array(
- 'rank_title' => $row['rank_title'],
- 'rank_min' => $row['rank_min'],
- 'rank_image' => $row['rank_image']
- );
- }
- }
- $db->sql_freeresult($result);
-
- $this->put('_ranks', $ranks);
- }
-
- return $ranks;
- }
-
- /**
- * Obtain allowed extensions
- *
- * @param mixed $forum_id If false then check for private messaging, if int then check for forum id. If true, then only return extension informations.
- *
- * @return array allowed extensions array.
- */
- function obtain_attach_extensions($forum_id)
- {
- if (($extensions = $this->get('_extensions')) === false)
- {
- global $db;
-
- $extensions = array(
- '_allowed_post' => array(),
- '_allowed_pm' => array(),
- );
-
- // The rule is to only allow those extensions defined. ;)
- $sql = 'SELECT e.extension, g.*
- FROM ' . EXTENSIONS_TABLE . ' e, ' . EXTENSION_GROUPS_TABLE . ' g
- WHERE e.group_id = g.group_id
- AND (g.allow_group = 1 OR g.allow_in_pm = 1)';
- $result = $db->sql_query($sql);
-
- while ($row = $db->sql_fetchrow($result))
- {
- $extension = strtolower(trim($row['extension']));
-
- $extensions[$extension] = array(
- 'display_cat' => (int) $row['cat_id'],
- 'download_mode' => (int) $row['download_mode'],
- 'upload_icon' => trim($row['upload_icon']),
- 'max_filesize' => (int) $row['max_filesize'],
- 'allow_group' => $row['allow_group'],
- 'allow_in_pm' => $row['allow_in_pm'],
- );
-
- $allowed_forums = ($row['allowed_forums']) ? unserialize(trim($row['allowed_forums'])) : array();
-
- // Store allowed extensions forum wise
- if ($row['allow_group'])
- {
- $extensions['_allowed_post'][$extension] = (!sizeof($allowed_forums)) ? 0 : $allowed_forums;
- }
-
- if ($row['allow_in_pm'])
- {
- $extensions['_allowed_pm'][$extension] = 0;
- }
- }
- $db->sql_freeresult($result);
-
- $this->put('_extensions', $extensions);
- }
-
- // Forum post
- if ($forum_id === false)
- {
- // We are checking for private messages, therefore we only need to get the pm extensions...
- $return = array('_allowed_' => array());
-
- foreach ($extensions['_allowed_pm'] as $extension => $check)
- {
- $return['_allowed_'][$extension] = 0;
- $return[$extension] = $extensions[$extension];
- }
-
- $extensions = $return;
- }
- else if ($forum_id === true)
- {
- return $extensions;
- }
- else
- {
- $forum_id = (int) $forum_id;
- $return = array('_allowed_' => array());
-
- foreach ($extensions['_allowed_post'] as $extension => $check)
- {
- // Check for allowed forums
- if (is_array($check))
- {
- $allowed = (!in_array($forum_id, $check)) ? false : true;
- }
- else
- {
- $allowed = true;
- }
-
- if ($allowed)
- {
- $return['_allowed_'][$extension] = 0;
- $return[$extension] = $extensions[$extension];
- }
- }
-
- $extensions = $return;
- }
-
- if (!isset($extensions['_allowed_']))
- {
- $extensions['_allowed_'] = array();
- }
-
- return $extensions;
- }
-
- /**
- * Obtain active bots
- */
- function obtain_bots()
- {
- if (($bots = $this->get('_bots')) === false)
- {
- global $db;
-
- switch ($db->sql_layer)
- {
- case 'mssql':
- case 'mssql_odbc':
- case 'mssqlnative':
- $sql = 'SELECT user_id, bot_agent, bot_ip
- FROM ' . BOTS_TABLE . '
- WHERE bot_active = 1
- ORDER BY LEN(bot_agent) DESC';
- break;
-
- case 'firebird':
- $sql = 'SELECT user_id, bot_agent, bot_ip
- FROM ' . BOTS_TABLE . '
- WHERE bot_active = 1
- ORDER BY CHAR_LENGTH(bot_agent) DESC';
- break;
-
- // LENGTH supported by MySQL, IBM DB2 and Oracle for sure...
- default:
- $sql = 'SELECT user_id, bot_agent, bot_ip
- FROM ' . BOTS_TABLE . '
- WHERE bot_active = 1
- ORDER BY LENGTH(bot_agent) DESC';
- break;
- }
- $result = $db->sql_query($sql);
-
- $bots = array();
- while ($row = $db->sql_fetchrow($result))
- {
- $bots[] = $row;
- }
- $db->sql_freeresult($result);
-
- $this->put('_bots', $bots);
- }
-
- return $bots;
- }
-
- /**
- * Obtain cfg file data
- */
- function obtain_cfg_items($theme)
- {
- global $config, $phpbb_root_path;
-
- $parsed_items = array(
- 'theme' => array(),
- 'template' => array(),
- 'imageset' => array()
- );
-
- foreach ($parsed_items as $key => $parsed_array)
- {
- $parsed_array = $this->get('_cfg_' . $key . '_' . $theme[$key . '_path']);
-
- if ($parsed_array === false)
- {
- $parsed_array = array();
- }
-
- $reparse = false;
- $filename = $phpbb_root_path . 'styles/' . $theme[$key . '_path'] . '/' . $key . '/' . $key . '.cfg';
-
- if (!file_exists($filename))
- {
- continue;
- }
-
- if (!isset($parsed_array['filetime']) || (($config['load_tplcompile'] && @filemtime($filename) > $parsed_array['filetime'])))
- {
- $reparse = true;
- }
-
- // Re-parse cfg file
- if ($reparse)
- {
- $parsed_array = parse_cfg_file($filename);
- $parsed_array['filetime'] = @filemtime($filename);
-
- $this->put('_cfg_' . $key . '_' . $theme[$key . '_path'], $parsed_array);
- }
- $parsed_items[$key] = $parsed_array;
- }
-
- return $parsed_items;
- }
-
- /**
- * Obtain disallowed usernames
- */
- function obtain_disallowed_usernames()
- {
- if (($usernames = $this->get('_disallowed_usernames')) === false)
- {
- global $db;
-
- $sql = 'SELECT disallow_username
- FROM ' . DISALLOW_TABLE;
- $result = $db->sql_query($sql);
-
- $usernames = array();
- while ($row = $db->sql_fetchrow($result))
- {
- $usernames[] = str_replace('%', '.*?', preg_quote(utf8_clean_string($row['disallow_username']), '#'));
- }
- $db->sql_freeresult($result);
-
- $this->put('_disallowed_usernames', $usernames);
- }
-
- return $usernames;
- }
-
- /**
- * Obtain hooks...
- */
- function obtain_hooks()
- {
- global $phpbb_root_path, $phpEx;
-
- if (($hook_files = $this->get('_hooks')) === false)
- {
- $hook_files = array();
-
- // Now search for hooks...
- $dh = @opendir($phpbb_root_path . 'includes/hooks/');
-
- if ($dh)
- {
- while (($file = readdir($dh)) !== false)
- {
- if (strpos($file, 'hook_') === 0 && substr($file, -(strlen($phpEx) + 1)) === '.' . $phpEx)
- {
- $hook_files[] = substr($file, 0, -(strlen($phpEx) + 1));
- }
- }
- closedir($dh);
- }
-
- $this->put('_hooks', $hook_files);
- }
-
- return $hook_files;
- }
-}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/captcha/captcha_factory.php b/phpBB/includes/captcha/captcha_factory.php
deleted file mode 100644
index 131c0b3b77..0000000000
--- a/phpBB/includes/captcha/captcha_factory.php
+++ /dev/null
@@ -1,100 +0,0 @@
-<?php
-/**
-*
-* @package VC
-* @version $Id$
-* @copyright (c) 2008 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
-*
-*/
-
-/**
-* @ignore
-*/
-if (!defined('IN_PHPBB'))
-{
- exit;
-}
-
-/**
-* A small class for 3.0.x (no autoloader in 3.0.x)
-*
-* @package VC
-*/
-class phpbb_captcha_factory
-{
- /**
- * return an instance of class $name in file $name_plugin.php
- */
- function &get_instance($name)
- {
- global $phpbb_root_path, $phpEx;
-
- $name = basename($name);
- if (!class_exists($name))
- {
- include($phpbb_root_path . "includes/captcha/plugins/{$name}_plugin." . $phpEx);
- }
- $instance = call_user_func(array($name, 'get_instance'));
- return $instance;
- }
-
- /**
- * Call the garbage collector
- */
- function garbage_collect($name)
- {
- global $phpbb_root_path, $phpEx;
-
- $name = basename($name);
- if (!class_exists($name))
- {
- include($phpbb_root_path . "includes/captcha/plugins/{$name}_plugin." . $phpEx);
- }
- call_user_func(array($name, 'garbage_collect'), 0);
- }
-
- /**
- * return a list of all discovered CAPTCHA plugins
- */
- function get_captcha_types()
- {
- global $phpbb_root_path, $phpEx;
-
- $captchas = array(
- 'available' => array(),
- 'unavailable' => array(),
- );
-
- $dp = @opendir($phpbb_root_path . 'includes/captcha/plugins');
-
- if ($dp)
- {
- while (($file = readdir($dp)) !== false)
- {
- if ((preg_match('#_plugin\.' . $phpEx . '$#', $file)))
- {
- $name = preg_replace('#^(.*?)_plugin\.' . $phpEx . '$#', '\1', $file);
- if (!class_exists($name))
- {
- include($phpbb_root_path . "includes/captcha/plugins/$file");
- }
-
- if (call_user_func(array($name, 'is_available')))
- {
- $captchas['available'][$name] = call_user_func(array($name, 'get_name'));
- }
- else
- {
- $captchas['unavailable'][$name] = call_user_func(array($name, 'get_name'));
- }
- }
- }
- closedir($dp);
- }
-
- return $captchas;
- }
-}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/captcha/captcha_gd.php b/phpBB/includes/captcha/captcha_gd.php
deleted file mode 100644
index ecdad43978..0000000000
--- a/phpBB/includes/captcha/captcha_gd.php
+++ /dev/null
@@ -1,2640 +0,0 @@
-<?php
-/**
-*
-* @package VC
-* @version $Id$
-* @copyright (c) 2006 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
-*
-*/
-
-/**
-* @ignore
-*/
-if (!defined('IN_PHPBB'))
-{
- exit;
-}
-
-/**
-* Original Author - Xore (Robert Hetzler)
-* With contributions from Neothermic
-*
-* @package VC
-*/
-class captcha
-{
- var $width = 360;
- var $height = 96;
-
-
- /**
- * Create the image containing $code with a seed of $seed
- */
- function execute($code, $seed)
- {
- global $config;
-
- mt_srand($seed);
-
- // Create image
- $img = imagecreatetruecolor($this->width, $this->height);
-
- // Generate colours
- $colour = new colour_manager($img, array(
- 'random' => true,
- 'min_value' => 60,
- ), 'hsv');
-
- $scheme = $colour->colour_scheme('background', false);
- $scheme = $colour->mono_range($scheme, 10, false);
- shuffle($scheme);
-
- $bg_colours = array_splice($scheme, mt_rand(6, 12));
-
- // Generate code characters
- $characters = $sizes = $bounding_boxes = $noise = array();
- $width_avail = $this->width - 15;
- $code_len = strlen($code);
- $captcha_bitmaps = $this->captcha_bitmaps();
-
- for ($i = 0; $i < $code_len; ++$i)
- {
- $characters[$i] = new char_cube3d($captcha_bitmaps, $code[$i]);
-
- list($min, $max) = $characters[$i]->range();
- $sizes[$i] = mt_rand($min, $max);
-
- $box = $characters[$i]->dimensions($sizes[$i]);
- $width_avail -= ($box[2] - $box[0]);
- $bounding_boxes[$i] = $box;
- }
-
-
- // Redistribute leftover x-space
- $offset = array();
- for ($i = 0; $i < $code_len; ++$i)
- {
- $denom = ($code_len - $i);
- $denom = max(1.3, $denom);
- $offset[$i] = phpbb_mt_rand(0, (int) round((1.5 * $width_avail) / $denom));
- $width_avail -= $offset[$i];
- }
-
- if ($config['captcha_gd_x_grid'])
- {
- $grid = (int) $config['captcha_gd_x_grid'];
- for ($y = 0; $y < $this->height; $y += mt_rand($grid - 2, $grid + 2))
- {
- $current_colour = $scheme[array_rand($scheme)];
- imageline($img, mt_rand(0,4), mt_rand($y - 3, $y), mt_rand($this->width - 5, $this->width), mt_rand($y - 3, $y), $current_colour);
- }
- }
-
- if ($config['captcha_gd_y_grid'])
- {
- $grid = (int) $config['captcha_gd_y_grid'];
- for ($x = 0; $x < $this->width; $x += mt_rand($grid - 2, $grid + 2))
- {
- $current_colour = $scheme[array_rand($scheme)];
- imagedashedline($img, mt_rand($x -3, $x + 3), mt_rand(0, 4), mt_rand($x -3, $x + 3), mt_rand($this->height - 5, $this->height), $current_colour);
- }
- }
- if ($config['captcha_gd_wave'] && ($config['captcha_gd_y_grid'] || $config['captcha_gd_y_grid']))
- {
- $this->wave($img);
- }
-
-
- if ($config['captcha_gd_3d_noise'])
- {
- $xoffset = mt_rand(0,9);
- $noise_bitmaps = $this->captcha_noise_bg_bitmaps();
- for ($i = 0; $i < $code_len; ++$i)
- {
- $noise[$i] = new char_cube3d($noise_bitmaps, mt_rand(1, sizeof($noise_bitmaps['data'])));
-
- list($min, $max) = $noise[$i]->range();
- //$box = $noise[$i]->dimensions($sizes[$i]);
- }
- $xoffset = 0;
- for ($i = 0; $i < $code_len; ++$i)
- {
- $dimm = $bounding_boxes[$i];
- $xoffset += ($offset[$i] - $dimm[0]);
- $yoffset = mt_rand(-$dimm[1], $this->height - $dimm[3]);
-
- $noise[$i]->drawchar($sizes[$i], $xoffset, $yoffset, $img, $colour->get_resource('background'), $scheme);
- $xoffset += $dimm[2];
- }
- }
- $xoffset = 5;
- for ($i = 0; $i < $code_len; ++$i)
- {
- $dimm = $bounding_boxes[$i];
- $xoffset += ($offset[$i] - $dimm[0]);
- $yoffset = mt_rand(-$dimm[1], $this->height - $dimm[3]);
-
- $characters[$i]->drawchar($sizes[$i], $xoffset, $yoffset, $img, $colour->get_resource('background'), $scheme);
- $xoffset += $dimm[2];
- }
- if ($config['captcha_gd_wave'])
- {
- $this->wave($img);
- }
- if ($config['captcha_gd_foreground_noise'])
- {
- $this->noise_line($img, 0, 0, $this->width, $this->height, $colour->get_resource('background'), $scheme, $bg_colours);
- }
- // Send image
- header('Content-Type: image/png');
- header('Cache-control: no-cache, no-store');
- imagepng($img);
- imagedestroy($img);
- }
-
- /**
- * Sinus
- */
- function wave($img)
- {
- global $config;
-
- $period_x = mt_rand(12,18);
- $period_y = mt_rand(7,14);
- $amp_x = mt_rand(5,10);
- $amp_y = mt_rand(2,4);
- $socket = mt_rand(0,100);
-
- $dampen_x = mt_rand($this->width/5, $this->width/2);
- $dampen_y = mt_rand($this->height/5, $this->height/2);
- $direction_x = (mt_rand (0, 1));
- $direction_y = (mt_rand (0, 1));
-
- for ($i = 0; $i < $this->width; $i++)
- {
- $dir = ($direction_x) ? $i : ($this->width - $i);
- imagecopy($img, $img, $i-1, sin($socket+ $i/($period_x + $dir/$dampen_x)) * $amp_x, $i, 0, 1, $this->height);
- }
- $socket = mt_rand(0,100);
- for ($i = 0; $i < $this->height; $i++)
- {
- $dir = ($direction_y) ? $i : ($this->height - $i);
- imagecopy($img, $img ,sin($socket + $i/($period_y + ($dir)/$dampen_y)) * $amp_y, $i-1, 0, $i, $this->width, 1);
- }
- return $img;
- }
-
- /**
- * Noise line
- */
- function noise_line($img, $min_x, $min_y, $max_x, $max_y, $bg, $font, $non_font)
- {
- imagesetthickness($img, 2);
-
- $x1 = $min_x;
- $x2 = $max_x;
- $y1 = $min_y;
- $y2 = $min_y;
-
- do
- {
- $line = array_merge(
- array_fill(0, mt_rand(30, 60), $non_font[array_rand($non_font)]),
- array_fill(0, mt_rand(30, 60), $bg)
- );
-
- imagesetstyle($img, $line);
- imageline($img, $x1, $y1, $x2, $y2, IMG_COLOR_STYLED);
-
- $y1 += mt_rand(12, 35);
- $y2 += mt_rand(12, 35);
- }
- while ($y1 < $max_y && $y2 < $max_y);
-
- $x1 = $min_x;
- $x2 = $min_x;
- $y1 = $min_y;
- $y2 = $max_y;
-
- do
- {
- $line = array_merge(
- array_fill(0, mt_rand(30, 60), $non_font[array_rand($non_font)]),
- array_fill(0, mt_rand(30, 60), $bg)
- );
-
- imagesetstyle($img, $line);
- imageline($img, $x1, $y1, $x2, $y2, IMG_COLOR_STYLED);
-
- $x1 += mt_rand(20, 35);
- $x2 += mt_rand(20, 35);
- }
- while ($x1 < $max_x && $x2 < $max_x);
- imagesetthickness($img, 1);
- }
-
-
- function captcha_noise_bg_bitmaps()
- {
- return array(
- 'width' => 15,
- 'height' => 5,
- 'data' => array(
-
- 1 => array(
- array(1,0,0,0,1,0,0,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,1,0,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,1,0,0,0,0,0,0,1,0,0),
- array(1,0,0,0,0,0,1,0,0,0,0,1,0,0,0),
- ),
- 2 => array(
- array(1,1,mt_rand(0,1),1,0,1,1,1,1,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,1,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0,1,1,0,1,1,1),
- ),
- 3 => array(
- array(1,0,0,0,0,0,0,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,0,0,0,0,0,1,0),
- array(0,0,0,0,1,0,0,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,0,0,0,0,0,1,0),
- array(1,0,0,0,0,0,0,0,0,0,0,0,0,0,1),
- ),
- 4 => array(
- array(1,0,1,0,1,0,0,1,1,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,1,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0),
- array(1,0,1,0,0,0,0,0,0,0,0,0,0,0,0),
- ),
- 5 => array(
- array(1,1,1,1,0,0,0,1,1,1,0,0,1,0,1),
- array(0,0,0,0,0,0,0,1,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0),
- array(1,0,1,0,0,0,0,0,0,0,0,0,0,0,0),
- ),
- 6 => array(
- array(mt_rand(0,1),mt_rand(0,1),mt_rand(0,1),mt_rand(0,1),mt_rand(0,1),0,mt_rand(0,1),mt_rand(0,1),mt_rand(0,1),mt_rand(0,1),mt_rand(0,1),0,mt_rand(0,1),mt_rand(0,1),mt_rand(0,1)),
- array(0,0,0,0,0,0,0,mt_rand(0,1),0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0),
- array(mt_rand(0,1),0,mt_rand(0,1),0,0,0,0,0,0,0,0,0,0,0,0),
- ),
- 7 => array(
- array(0,0,0,0,0,0,0,0,0,0,1,1,0,1,1),
- array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0),
- array(0,0,1,1,0,0,0,1,0,0,0,0,0,0,0),
- array(0,1,0,0,0,1,0,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0,0,0,0,0,0,0),
- ),
- ));
- }
-
- /**
- * Return bitmaps
- */
- function captcha_bitmaps()
- {
- global $config;
-
- $chars = array(
- 'A' => array(
- array(
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,1,0,1,0,0,0),
- array(0,0,0,1,0,1,0,0,0),
- array(0,0,0,1,0,1,0,0,0),
- array(0,0,1,0,0,0,1,0,0),
- array(0,0,1,0,0,0,1,0,0),
- array(0,0,1,0,0,0,1,0,0),
- array(0,1,0,0,0,0,0,1,0),
- array(0,1,0,0,0,0,0,1,0),
- array(0,1,1,1,1,1,1,1,0),
- array(0,1,0,0,0,0,0,1,0),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- ),
- array(
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,1,0,1,0,0,0),
- array(0,0,1,1,0,1,1,0,0),
- array(0,0,1,0,0,0,1,0,0),
- array(0,1,0,0,0,0,0,1,0),
- array(0,1,0,0,0,0,0,1,0),
- array(0,1,1,1,1,1,1,1,0),
- array(0,1,0,0,0,0,0,1,0),
- array(0,1,0,0,0,0,0,1,0),
- array(0,1,0,0,0,0,0,1,0),
- array(0,1,0,0,0,0,0,1,0),
- array(0,1,0,0,0,0,0,1,0),
- array(1,1,1,0,0,0,1,1,1),
- ),
- array(
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,1,1,1,1,1,0,0),
- array(0,1,1,0,0,0,1,1,0),
- array(1,1,0,0,0,0,0,1,1),
- array(1,0,0,0,0,0,0,0,1),
- array(0,0,0,0,0,0,0,1,1),
- array(0,0,0,0,0,1,1,1,1),
- array(0,0,0,1,1,1,0,0,1),
- array(0,1,1,1,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,1,0,0,0,0,1,1,1),
- array(0,1,1,1,1,1,1,0,1),
- ),
- ),
- 'B' => array(
- array(
- array(1,1,1,1,1,1,1,0,0),
- array(1,0,0,0,0,0,0,1,0),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,1,0),
- array(1,1,1,1,1,1,1,0,0),
- array(1,0,0,0,0,0,0,1,0),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,1,0),
- array(1,1,1,1,1,1,1,0,0),
- ),
- array(
- array(1,1,1,1,1,1,1,0,0),
- array(0,1,0,0,0,0,0,1,0),
- array(0,1,0,0,0,0,0,0,1),
- array(0,1,0,0,0,0,0,0,1),
- array(0,1,0,0,0,0,0,0,1),
- array(0,1,0,0,0,0,0,0,1),
- array(0,1,0,0,0,0,0,1,0),
- array(0,1,1,1,1,1,1,0,0),
- array(0,1,0,0,0,0,0,1,0),
- array(0,1,0,0,0,0,0,0,1),
- array(0,1,0,0,0,0,0,0,1),
- array(0,1,0,0,0,0,0,0,1),
- array(0,1,0,0,0,0,0,0,1),
- array(0,1,0,0,0,0,0,1,0),
- array(1,1,1,1,1,1,1,0,0),
- ),
- array(
- array(0,1,0,0,0,0,0,0,0),
- array(0,1,0,0,0,0,0,0,0),
- array(0,1,0,0,0,0,0,0,0),
- array(0,1,0,0,0,0,0,0,0),
- array(0,1,0,0,0,0,0,0,0),
- array(0,1,0,0,0,0,0,0,0),
- array(0,1,0,0,0,0,0,0,0),
- array(0,1,1,1,1,1,1,0,0),
- array(0,1,0,0,0,0,0,1,0),
- array(0,1,0,0,0,0,0,0,1),
- array(0,1,0,0,0,0,0,0,1),
- array(0,1,0,0,0,0,0,0,1),
- array(0,1,0,0,0,0,0,0,1),
- array(0,1,0,0,0,0,0,1,0),
- array(0,1,1,1,1,1,1,0,0),
- ),
- ),
- 'C' => array(
- array(
- array(0,0,1,1,1,1,1,0,0),
- array(0,1,0,0,0,0,0,1,0),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(0,1,0,0,0,0,0,1,0),
- array(0,0,1,1,1,1,1,0,0),
- ),
- array(
- array(0,0,1,1,1,1,1,0,1),
- array(0,1,0,0,0,0,0,1,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(0,1,0,0,0,0,0,1,1),
- array(0,0,1,1,1,1,1,0,1),
- ),
- ),
- 'D' => array(
- array(
- array(1,1,1,1,1,1,1,0,0),
- array(1,0,0,0,0,0,0,1,0),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,1,0),
- array(1,1,1,1,1,1,1,0,0),
- ),
- array(
- array(1,1,1,1,1,1,1,0,0),
- array(0,1,0,0,0,0,0,1,0),
- array(0,1,0,0,0,0,0,0,1),
- array(0,1,0,0,0,0,0,0,1),
- array(0,1,0,0,0,0,0,0,1),
- array(0,1,0,0,0,0,0,0,1),
- array(0,1,0,0,0,0,0,0,1),
- array(0,1,0,0,0,0,0,0,1),
- array(0,1,0,0,0,0,0,0,1),
- array(0,1,0,0,0,0,0,0,1),
- array(0,1,0,0,0,0,0,0,1),
- array(0,1,0,0,0,0,0,0,1),
- array(0,1,0,0,0,0,0,0,1),
- array(0,1,0,0,0,0,0,1,0),
- array(1,1,1,1,1,1,1,0,0),
- ),
- array(
- array(0,0,0,0,0,0,0,0,1),
- array(0,0,0,0,0,0,0,0,1),
- array(0,0,0,0,0,0,0,0,1),
- array(0,0,0,0,0,0,0,0,1),
- array(0,0,0,0,0,0,0,0,1),
- array(0,0,0,0,0,0,0,0,1),
- array(0,0,0,0,0,0,0,0,1),
- array(0,0,1,1,1,1,1,0,1),
- array(0,1,1,0,0,0,1,1,1),
- array(0,1,0,0,0,0,0,0,1),
- array(0,1,0,0,0,0,0,0,1),
- array(0,1,0,0,0,0,0,0,1),
- array(0,1,0,0,0,0,0,0,1),
- array(0,1,1,0,0,0,1,1,1),
- array(0,0,1,1,1,1,1,0,1),
- ),
- ),
- 'E' => array(
- array(
- array(1,1,1,1,1,1,1,1,1),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,1,1,1,1,1,1,1,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,1,1,1,1,1,1,1,1),
- ),
- array(
- array(1,1,1,1,1,1,1,1,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,1,1,1,1,1,1,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,1),
- array(1,1,1,1,1,1,1,1,1),
- ),
- array(
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,1,1,1,1,1,0,0),
- array(0,1,1,0,0,0,1,1,0),
- array(1,1,0,0,0,0,0,1,1),
- array(1,1,1,1,1,1,1,1,1),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,1),
- array(1,1,0,0,0,0,0,1,1),
- array(0,1,1,1,1,1,1,1,0),
- ),
- ),
- 'F' => array(
- array(
- array(1,1,1,1,1,1,1,1,1),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,1,1,1,1,1,1,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- ),
- array(
- array(0,1,1,1,1,1,1,1,1),
- array(0,1,0,0,0,0,0,0,1),
- array(0,1,0,0,0,0,0,0,0),
- array(0,1,0,0,0,0,0,0,0),
- array(0,1,0,0,0,0,0,0,0),
- array(0,1,0,0,0,0,0,0,0),
- array(0,1,0,0,0,0,0,0,0),
- array(0,1,1,1,1,1,1,0,0),
- array(0,1,0,0,0,0,0,0,0),
- array(0,1,0,0,0,0,0,0,0),
- array(0,1,0,0,0,0,0,0,0),
- array(0,1,0,0,0,0,0,0,0),
- array(0,1,0,0,0,0,0,0,0),
- array(0,1,0,0,0,0,0,0,0),
- array(1,1,1,0,0,0,0,0,0),
- ),
- array(
- array(0,0,0,1,1,0,0,0,0),
- array(0,0,1,1,0,0,0,0,0),
- array(0,1,1,0,0,0,0,0,0),
- array(0,1,0,0,0,0,0,0,0),
- array(0,1,0,0,0,0,0,0,0),
- array(1,1,1,1,0,0,0,0,0),
- array(0,1,0,0,0,0,0,0,0),
- array(0,1,0,0,0,0,0,0,0),
- array(0,1,0,0,0,0,0,0,0),
- array(0,1,0,0,0,0,0,0,0),
- array(0,1,0,0,0,0,0,0,0),
- array(0,1,0,0,0,0,0,0,0),
- array(0,1,0,0,0,0,0,0,0),
- array(0,1,0,0,0,0,0,0,0),
- array(0,1,0,0,0,0,0,0,0),
- ),
- ),
- 'G' => array(
- array(
- array(0,0,1,1,1,1,1,0,0),
- array(0,1,0,0,0,0,0,1,0),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,1,1,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(0,1,0,0,0,0,0,1,0),
- array(0,0,1,1,1,1,1,0,0),
- ),
- array(
- array(0,0,1,1,1,1,1,0,1),
- array(0,1,0,0,0,0,0,1,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,1,1,1,1,1),
- array(1,0,0,0,1,0,0,0,1),
- array(1,0,0,0,1,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(0,1,0,0,0,0,0,1,1),
- array(0,0,1,1,1,1,1,0,1),
- ),
- array(
- array(0,0,1,1,1,1,1,0,1),
- array(0,1,1,0,0,0,0,1,1),
- array(1,1,0,0,0,0,0,1,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,1,1,0,0,0,0,0,1),
- array(0,0,1,1,1,1,1,1,1),
- array(0,0,0,0,0,0,0,0,1),
- array(0,0,0,0,0,0,0,0,1),
- array(0,0,0,0,0,0,0,0,1),
- array(0,0,0,0,0,0,0,0,1),
- array(0,0,0,0,0,0,0,1,1),
- array(1,1,1,1,1,1,1,1,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- ),
- ),
- 'H' => array(
- array(
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,1,1,1,1,1,1,1,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- ),
- array(
- array(1,1,1,0,0,0,1,1,1),
- array(0,1,0,0,0,0,0,1,0),
- array(0,1,0,0,0,0,0,1,0),
- array(0,1,0,0,0,0,0,1,0),
- array(0,1,0,0,0,0,0,1,0),
- array(0,1,0,0,0,0,0,1,0),
- array(0,1,0,0,0,0,0,1,0),
- array(0,1,1,1,1,1,1,1,0),
- array(0,1,0,0,0,0,0,1,0),
- array(0,1,0,0,0,0,0,1,0),
- array(0,1,0,0,0,0,0,1,0),
- array(0,1,0,0,0,0,0,1,0),
- array(0,1,0,0,0,0,0,1,0),
- array(0,1,0,0,0,0,0,1,0),
- array(1,1,1,0,0,0,1,1,1),
- ),
- array(
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,1,1,1,0,0,0),
- array(1,1,1,1,0,1,1,0,0),
- array(1,0,0,0,0,0,1,0,0),
- array(1,0,0,0,0,0,1,0,0),
- array(1,0,0,0,0,0,1,0,0),
- array(1,0,0,0,0,0,1,0,0),
- array(1,0,0,0,0,0,1,0,0),
- array(1,0,0,0,0,0,1,0,0),
- ),
- ),
- 'I' => array(
- array(
- array(1,1,1,1,1,1,1,1,1),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(1,1,1,1,1,1,1,1,1),
- ),
- array(
- array(0,0,0,1,1,1,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,1,1,1,0,0,0),
- ),
- array(
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,1,1,1,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,1,1,1,0,0,0),
- ),
- ),
- 'J' => array(
- array(
- array(1,1,1,1,1,1,1,1,1),
- array(0,0,0,0,0,1,0,0,0),
- array(0,0,0,0,0,1,0,0,0),
- array(0,0,0,0,0,1,0,0,0),
- array(0,0,0,0,0,1,0,0,0),
- array(0,0,0,0,0,1,0,0,0),
- array(0,0,0,0,0,1,0,0,0),
- array(0,0,0,0,0,1,0,0,0),
- array(0,0,0,0,0,1,0,0,0),
- array(0,0,0,0,0,1,0,0,0),
- array(0,0,0,0,0,1,0,0,0),
- array(1,0,0,0,0,1,0,0,0),
- array(1,0,0,0,0,1,0,0,0),
- array(0,1,0,0,1,0,0,0,0),
- array(0,0,1,1,0,0,0,0,0),
- ),
- array(
- array(1,1,1,1,1,1,1,1,1),
- array(0,0,0,0,0,1,0,0,0),
- array(0,0,0,0,0,1,0,0,0),
- array(0,0,0,0,0,1,0,0,0),
- array(0,0,0,0,0,1,0,0,0),
- array(0,0,0,0,0,1,0,0,0),
- array(0,0,0,0,0,1,0,0,0),
- array(0,0,0,0,0,1,0,0,0),
- array(0,0,0,0,0,1,0,0,0),
- array(0,0,0,0,0,1,0,0,0),
- array(0,0,0,0,0,1,0,0,0),
- array(1,0,0,0,0,1,0,0,0),
- array(1,0,0,0,0,1,0,0,0),
- array(1,1,0,0,1,0,0,0,0),
- array(1,0,1,1,0,0,0,0,0),
- ),
- array(
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,1,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,1,0,0,0),
- array(0,0,0,0,0,1,0,0,0),
- array(0,0,0,0,0,1,0,0,0),
- array(0,0,0,0,0,1,0,0,0),
- array(0,0,0,0,0,1,0,0,0),
- array(1,0,0,0,0,1,0,0,0),
- array(1,0,0,0,0,1,0,0,0),
- array(0,1,0,0,1,0,0,0,0),
- array(0,0,1,1,0,0,0,0,0),
- ),
- ),
- 'K' => array(
- array( // New 'K', supplied by NeoThermic
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,1,0),
- array(1,0,0,0,0,0,1,0,0),
- array(1,0,0,0,0,1,0,0,0),
- array(1,0,0,0,1,0,0,0,0),
- array(1,0,0,1,0,0,0,0,0),
- array(1,0,1,0,0,0,0,0,0),
- array(1,1,0,0,0,0,0,0,0),
- array(1,0,1,0,0,0,0,0,0),
- array(1,0,0,1,0,0,0,0,0),
- array(1,0,0,0,1,0,0,0,0),
- array(1,0,0,0,0,1,0,0,0),
- array(1,0,0,0,0,0,1,0,0),
- array(1,0,0,0,0,0,0,1,0),
- array(1,0,0,0,0,0,0,0,1),
- ),
- array(
- array(0,1,0,0,0,0,0,0,1),
- array(0,1,0,0,0,0,0,1,0),
- array(0,1,0,0,0,0,1,0,0),
- array(0,1,0,0,0,1,0,0,0),
- array(0,1,0,0,1,0,0,0,0),
- array(0,1,0,1,0,0,0,0,0),
- array(0,1,1,0,0,0,0,0,0),
- array(0,1,0,0,0,0,0,0,0),
- array(0,1,1,0,0,0,0,0,0),
- array(0,1,0,1,0,0,0,0,0),
- array(0,1,0,0,1,0,0,0,0),
- array(0,1,0,0,0,1,0,0,0),
- array(0,1,0,0,0,0,1,0,0),
- array(0,1,0,0,0,0,0,1,0),
- array(1,1,1,0,0,0,1,1,1),
- ),
- array(
- array(0,0,0,0,0,0,0,0,0),
- array(0,1,0,0,0,0,0,0,0),
- array(0,1,0,0,0,0,0,0,0),
- array(0,1,0,0,0,1,0,0,0),
- array(0,1,0,0,1,0,0,0,0),
- array(0,1,0,1,0,0,0,0,0),
- array(0,1,1,0,0,0,0,0,0),
- array(0,1,0,0,0,0,0,0,0),
- array(0,1,1,0,0,0,0,0,0),
- array(0,1,0,1,0,0,0,0,0),
- array(0,1,0,0,1,0,0,0,0),
- array(0,1,0,0,0,1,0,0,0),
- array(0,1,0,0,0,0,1,0,0),
- array(0,1,0,0,0,0,0,1,0),
- array(0,1,0,0,0,0,0,1,0),
- ),
- ),
- 'L' => array(
- array(
- array(0,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,1,1,1,1,1,1,1,1),
- ),
- array(
- array(0,0,0,0,0,0,0,0,0),
- array(0,1,0,0,0,0,0,0,0),
- array(0,1,0,0,0,0,0,0,0),
- array(0,1,0,0,0,0,0,0,0),
- array(0,1,0,0,0,0,0,0,0),
- array(0,1,0,0,0,0,0,0,0),
- array(0,1,0,0,0,0,0,0,0),
- array(0,1,0,0,0,0,0,0,0),
- array(0,1,0,0,0,0,0,0,0),
- array(0,1,0,0,0,0,0,0,0),
- array(0,1,0,0,0,0,0,0,0),
- array(0,1,0,0,0,0,0,0,0),
- array(0,1,0,0,0,0,0,0,0),
- array(0,1,0,0,0,0,0,0,1),
- array(1,1,1,1,1,1,1,1,1),
- ),
- array(
- array(0,0,0,0,0,0,0,0,0),
- array(0,1,0,0,0,0,0,0,0),
- array(0,1,0,0,0,0,0,0,0),
- array(0,1,0,0,0,0,0,0,0),
- array(0,1,0,0,0,0,0,0,0),
- array(0,1,0,0,0,0,0,0,0),
- array(0,1,0,0,0,0,0,0,0),
- array(0,1,0,0,0,0,0,0,0),
- array(0,1,0,0,0,0,0,0,0),
- array(0,1,0,0,0,0,0,0,0),
- array(0,1,0,0,0,0,0,0,0),
- array(0,1,0,0,0,0,0,0,0),
- array(0,1,0,0,0,0,0,0,0),
- array(0,1,1,0,0,0,0,0,0),
- array(0,0,1,1,1,0,0,0,0),
- ),
- ),
- 'M' => array(
- array(
- array(1,1,0,0,0,0,0,1,1),
- array(1,1,0,0,0,0,0,1,1),
- array(1,0,1,0,0,0,1,0,1),
- array(1,0,1,0,0,0,1,0,1),
- array(1,0,1,0,0,0,1,0,1),
- array(1,0,0,1,0,1,0,0,1),
- array(1,0,0,1,0,1,0,0,1),
- array(1,0,0,1,0,1,0,0,1),
- array(1,0,0,0,1,0,0,0,1),
- array(1,0,0,0,1,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- ),
- array(
- array(0,0,0,0,0,0,0,0,0),
- array(0,1,0,0,0,0,0,1,0),
- array(0,1,1,0,0,0,1,1,0),
- array(0,1,1,0,0,0,1,1,0),
- array(0,1,1,0,0,0,1,1,0),
- array(0,1,0,1,0,1,0,1,0),
- array(0,1,0,1,0,1,0,1,0),
- array(0,1,0,1,0,1,0,1,0),
- array(0,1,0,0,1,0,0,1,0),
- array(0,1,0,0,1,0,0,1,0),
- array(0,1,0,0,0,0,0,1,0),
- array(0,1,0,0,0,0,0,1,0),
- array(0,1,0,0,0,0,0,1,0),
- array(0,1,0,0,0,0,0,1,0),
- array(1,1,1,0,0,0,1,1,1),
- ),
- array(
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,1,1,1,0,1,1,1,0),
- array(1,1,0,1,1,1,0,1,1),
- array(1,0,0,0,1,0,0,0,1),
- array(1,0,0,0,1,0,0,0,1),
- array(1,0,0,0,1,0,0,0,1),
- array(1,0,0,0,1,0,0,0,1),
- array(1,0,0,0,1,0,0,0,1),
- array(1,0,0,0,1,0,0,0,1),
- array(1,0,0,0,1,0,0,0,1),
- ),
- ),
- 'N' => array(
- array(
- array(1,1,0,0,0,0,0,0,1),
- array(1,1,0,0,0,0,0,0,1),
- array(1,0,1,0,0,0,0,0,1),
- array(1,0,1,0,0,0,0,0,1),
- array(1,0,0,1,0,0,0,0,1),
- array(1,0,0,1,0,0,0,0,1),
- array(1,0,0,0,1,0,0,0,1),
- array(1,0,0,0,1,0,0,0,1),
- array(1,0,0,0,1,0,0,0,1),
- array(1,0,0,0,0,1,0,0,1),
- array(1,0,0,0,0,1,0,0,1),
- array(1,0,0,0,0,0,1,0,1),
- array(1,0,0,0,0,0,1,0,1),
- array(1,0,0,0,0,0,0,1,1),
- array(1,0,0,0,0,0,0,1,1),
- ),
- array(
- array(0,0,0,0,0,0,0,0,0),
- array(0,1,0,0,0,0,0,1,0),
- array(0,1,1,0,0,0,0,1,0),
- array(0,1,1,0,0,0,0,1,0),
- array(0,1,1,0,0,0,0,1,0),
- array(0,1,0,1,0,0,0,1,0),
- array(0,1,0,1,0,0,0,1,0),
- array(0,1,0,1,0,0,0,1,0),
- array(0,1,0,0,1,0,0,1,0),
- array(0,1,0,0,1,1,0,1,0),
- array(0,1,0,0,0,1,0,1,0),
- array(0,1,0,0,0,1,1,1,0),
- array(0,1,0,0,0,0,1,1,0),
- array(0,1,0,0,0,0,0,1,0),
- array(1,1,1,0,0,0,1,1,1),
- ),
- array(
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(1,0,1,1,1,1,0,0,0),
- array(1,1,1,0,0,1,1,0,0),
- array(1,0,0,0,0,0,1,0,0),
- array(1,0,0,0,0,0,1,0,0),
- array(1,0,0,0,0,0,1,0,0),
- array(1,0,0,0,0,0,1,0,0),
- array(1,0,0,0,0,0,1,0,0),
- array(1,0,0,0,0,0,1,0,0),
- ),
- ),
- 'O' => array(
- array(
- array(0,0,1,1,1,1,1,0,0),
- array(0,1,0,0,0,0,0,1,0),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(0,1,0,0,0,0,0,1,0),
- array(0,0,1,1,1,1,1,0,0),
- ),
- array(
- array(0,0,1,1,1,1,1,0,0),
- array(0,1,0,0,0,0,0,1,0),
- array(1,1,0,0,0,0,0,1,1),
- array(1,1,0,0,0,0,0,1,1),
- array(1,1,0,0,0,0,0,1,1),
- array(1,1,0,0,0,0,0,1,1),
- array(1,1,0,0,0,0,0,1,1),
- array(1,1,0,0,0,0,0,1,1),
- array(1,1,0,0,0,0,0,1,1),
- array(1,1,0,0,0,0,0,1,1),
- array(1,1,0,0,0,0,0,1,1),
- array(1,1,0,0,0,0,0,1,1),
- array(1,1,0,0,0,0,0,1,1),
- array(0,1,0,0,0,0,0,1,0),
- array(0,0,1,1,1,1,1,0,0),
- ),
- array(
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,1,1,1,1,1,0,0,0),
- array(1,1,1,0,0,1,1,0,0),
- array(1,0,0,0,0,0,1,0,0),
- array(1,0,0,0,0,0,1,0,0),
- array(1,0,0,0,0,0,1,0,0),
- array(1,0,0,0,0,0,1,0,0),
- array(1,1,0,0,0,1,1,0,0),
- array(0,1,1,1,1,1,0,0,0),
- ),
- ),
- 'P' => array(
- array(
- array(1,1,1,1,1,1,1,0,0),
- array(1,0,0,0,0,0,0,1,0),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,1,0),
- array(1,1,1,1,1,1,1,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- ),
- array(
- array(1,1,1,1,1,1,1,0,0),
- array(0,1,0,0,0,0,0,1,0),
- array(0,1,0,0,0,0,0,0,1),
- array(0,1,0,0,0,0,0,0,1),
- array(0,1,0,0,0,0,0,0,1),
- array(0,1,0,0,0,0,0,0,1),
- array(0,1,0,0,0,0,0,1,0),
- array(1,1,1,1,1,1,1,0,0),
- array(0,1,0,0,0,0,0,0,0),
- array(0,1,0,0,0,0,0,0,0),
- array(0,1,0,0,0,0,0,0,0),
- array(0,1,0,0,0,0,0,0,0),
- array(0,1,0,0,0,0,0,0,0),
- array(0,1,0,0,0,0,0,0,0),
- array(1,1,1,0,0,0,0,0,0),
- ),
- array(
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,1,1,0,0,0,0,0),
- array(1,1,0,1,1,0,0,0,0),
- array(1,0,0,0,1,0,0,0,0),
- array(1,0,0,0,1,0,0,0,0),
- array(1,0,0,1,1,0,0,0,0),
- array(1,1,1,1,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- ),
- ),
- 'Q' => array(
- array(
- array(0,0,1,1,1,1,1,0,0),
- array(0,1,0,0,0,0,0,1,0),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,1,0,0,1),
- array(1,0,0,0,0,0,1,0,1),
- array(0,1,0,0,0,0,0,1,0),
- array(0,0,1,1,1,1,1,0,1),
- ),
- array(
- array(0,0,1,1,1,1,1,0,0),
- array(0,1,0,0,0,0,0,1,0),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,1,0,0,0,1),
- array(1,1,0,0,1,1,0,1,1),
- array(0,1,1,1,1,1,1,1,0),
- array(0,0,0,0,0,0,1,1,0),
- array(0,0,0,0,0,0,0,1,1),
- array(0,0,0,0,0,0,0,0,1),
- ),
- array(
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,1,1,1,1),
- array(0,0,0,0,1,1,0,0,1),
- array(0,0,0,0,1,0,0,0,1),
- array(0,0,0,0,1,0,0,0,1),
- array(0,0,0,0,1,1,0,1,1),
- array(0,0,0,0,0,1,1,0,1),
- array(0,0,0,0,0,0,0,0,1),
- array(0,0,0,0,0,0,0,0,1),
- array(0,0,0,0,0,0,0,0,1),
- array(0,0,0,0,0,0,0,0,1),
- array(0,0,0,0,0,0,0,0,1),
- array(0,0,0,0,0,0,0,0,1),
- ),
- ),
- 'R' => array(
- array(
- array(1,1,1,1,1,1,1,0,0),
- array(1,0,0,0,0,0,0,1,0),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,1,0),
- array(1,1,1,1,1,1,1,0,0),
- array(1,1,1,0,0,0,0,0,0),
- array(1,0,0,1,0,0,0,0,0),
- array(1,0,0,0,1,0,0,0,0),
- array(1,0,0,0,0,1,0,0,0),
- array(1,0,0,0,0,0,1,0,0),
- array(1,0,0,0,0,0,0,1,0),
- array(1,0,0,0,0,0,0,0,1),
- ),
- array(
- array(1,1,1,1,1,1,1,0,0),
- array(0,1,0,0,0,0,0,1,0),
- array(0,1,0,0,0,0,0,0,1),
- array(0,1,0,0,0,0,0,0,1),
- array(0,1,0,0,0,0,0,0,1),
- array(0,1,0,0,0,0,0,0,1),
- array(0,1,0,0,0,0,0,1,0),
- array(1,1,1,1,1,1,1,0,0),
- array(0,1,1,0,0,0,0,0,0),
- array(0,1,1,1,0,0,0,0,0),
- array(0,1,0,1,1,0,0,0,0),
- array(0,1,0,0,1,1,0,0,0),
- array(0,1,0,0,0,1,1,0,0),
- array(0,1,0,0,0,0,1,1,0),
- array(1,1,1,0,0,0,1,1,1),
- ),
- array(
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,1,1,1,1,0,0,0,0),
- array(1,1,0,0,1,1,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- ),
- ),
- 'S' => array(
- array(
- array(0,0,1,1,1,1,1,0,0),
- array(0,1,0,0,0,0,0,1,0),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(0,1,0,0,0,0,0,0,0),
- array(0,0,1,1,1,1,1,0,0),
- array(0,0,0,0,0,0,0,1,0),
- array(0,0,0,0,0,0,0,0,1),
- array(0,0,0,0,0,0,0,0,1),
- array(0,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(0,1,0,0,0,0,0,1,0),
- array(0,0,1,1,1,1,1,0,0),
- ),
- array(
- array(0,0,1,1,1,1,1,0,1),
- array(0,1,0,0,0,0,0,1,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(0,1,0,0,0,0,0,0,0),
- array(0,0,1,1,1,1,1,0,0),
- array(0,0,0,0,0,0,0,1,0),
- array(0,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,1,0,0,0,0,0,1,0),
- array(1,0,1,1,1,1,1,0,0),
- ),
- array(
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,1,1,1,1,0,0,0,0),
- array(1,0,0,0,0,1,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,1,0,0,0,0,0,0,0),
- array(0,1,1,1,1,0,0,0,0),
- array(0,0,0,0,0,1,0,0,0),
- array(1,0,0,0,1,1,0,0,0),
- array(0,1,1,1,1,0,0,0,0),
- ),
- ),
- 'T' => array(
- array(
- array(1,1,1,1,1,1,1,1,1),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- ),
- array(
- array(1,1,1,1,1,1,1,1,1),
- array(1,0,0,0,1,0,0,0,1),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,1,1,1,0,0,0),
- ),
- array(
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,1,1,1,1,1,1,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,1,0,0,0),
- array(0,0,0,0,0,1,1,1,0),
- ),
- ),
- 'U' => array(
- array(
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(0,1,0,0,0,0,0,1,0),
- array(0,0,1,1,1,1,1,0,0),
- ),
- array(
- array(1,0,0,0,0,0,0,0,0),
- array(1,1,1,0,0,0,1,1,1),
- array(0,1,0,0,0,0,0,1,0),
- array(0,1,0,0,0,0,0,1,0),
- array(0,1,0,0,0,0,0,1,0),
- array(0,1,0,0,0,0,0,1,0),
- array(0,1,0,0,0,0,0,1,0),
- array(0,1,0,0,0,0,0,1,0),
- array(0,1,0,0,0,0,0,1,0),
- array(0,1,0,0,0,0,0,1,0),
- array(0,1,0,0,0,0,0,1,0),
- array(0,1,0,0,0,0,0,1,0),
- array(0,1,0,0,0,0,0,1,0),
- array(0,1,1,0,0,0,1,1,0),
- array(0,0,1,1,1,1,1,0,0),
- ),
- array(
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,1,0,0,0,0,0,1),
- array(0,0,1,0,0,0,0,0,1),
- array(0,0,1,0,0,0,0,0,1),
- array(0,0,1,0,0,0,0,0,1),
- array(0,0,1,0,0,0,0,0,1),
- array(0,0,1,0,0,0,0,1,1),
- array(0,0,1,1,0,0,1,1,1),
- array(0,0,0,1,1,1,1,0,1),
- ),
- ),
- 'V' => array(
- array(
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(0,1,0,0,0,0,0,1,0),
- array(0,1,0,0,0,0,0,1,0),
- array(0,1,0,0,0,0,0,1,0),
- array(0,0,1,0,0,0,1,0,0),
- array(0,0,1,0,0,0,1,0,0),
- array(0,0,1,0,0,0,1,0,0),
- array(0,0,1,0,0,0,1,0,0),
- array(0,0,0,1,0,1,0,0,0),
- array(0,0,0,1,0,1,0,0,0),
- array(0,0,0,1,0,1,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- ),
- array(
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(1,1,1,0,0,0,1,1,1),
- array(0,1,0,0,0,0,0,1,0),
- array(0,1,0,0,0,0,0,1,0),
- array(0,0,1,0,0,0,1,0,0),
- array(0,0,1,0,0,0,1,0,0),
- array(0,0,1,0,0,0,1,0,0),
- array(0,0,1,0,0,0,1,0,0),
- array(0,0,0,1,0,1,0,0,0),
- array(0,0,0,1,0,1,0,0,0),
- array(0,0,0,1,0,1,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- ),
- array(
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,1,0,0,0,1,0,0),
- array(0,0,1,0,0,0,1,0,0),
- array(0,0,1,0,0,0,1,0,0),
- array(0,0,1,0,0,0,1,0,0),
- array(0,0,0,1,0,1,0,0,0),
- array(0,0,0,1,0,1,0,0,0),
- array(0,0,0,1,0,1,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- ),
- ),
- 'W' => array(
- array(
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,1,0,0,0,1),
- array(1,0,0,0,1,0,0,0,1),
- array(1,0,0,1,0,1,0,0,1),
- array(1,0,0,1,0,1,0,0,1),
- array(1,0,0,1,0,1,0,0,1),
- array(1,0,1,0,0,0,1,0,1),
- array(1,0,1,0,0,0,1,0,1),
- array(1,0,1,0,0,0,1,0,1),
- array(1,1,0,0,0,0,0,1,1),
- array(1,1,0,0,0,0,0,1,1),
- ),
- array(
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(1,1,1,0,0,0,1,1,1),
- array(0,1,0,0,0,0,0,1,0),
- array(0,1,0,0,0,0,0,1,0),
- array(0,1,0,0,0,0,0,1,0),
- array(0,1,0,0,0,0,0,1,0),
- array(0,1,0,0,1,0,0,1,0),
- array(0,1,0,0,1,0,0,1,0),
- array(0,1,0,1,1,1,0,1,0),
- array(0,1,0,1,0,1,0,1,0),
- array(0,1,1,1,0,1,1,1,0),
- array(0,1,1,0,0,0,1,1,0),
- array(0,1,0,0,0,0,0,1,0),
- array(0,0,0,0,0,0,0,0,0),
- ),
- array(
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,1,0,0,0,0,0,1,0),
- array(0,1,0,0,1,0,0,1,0),
- array(0,1,0,0,1,0,0,1,0),
- array(0,1,0,1,1,1,0,1,0),
- array(0,1,0,1,0,1,0,1,0),
- array(0,1,1,1,0,1,1,1,0),
- array(0,1,1,0,0,0,1,1,0),
- array(0,1,0,0,0,0,0,1,0),
- array(0,0,0,0,0,0,0,0,0),
- ),
- ),
- 'X' => array(
- array(
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(0,1,0,0,0,0,0,1,0),
- array(0,1,0,0,0,0,0,1,0),
- array(0,0,1,0,0,0,1,0,0),
- array(0,0,0,1,0,1,0,0,0),
- array(0,0,0,1,0,1,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,1,0,1,0,0,0),
- array(0,0,0,1,0,1,0,0,0),
- array(0,0,1,0,0,0,1,0,0),
- array(0,1,0,0,0,0,1,0,0),
- array(0,1,0,0,0,0,0,1,0),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- ),
- array(
- array(0,0,0,0,0,0,0,0,0),
- array(1,1,1,0,0,0,1,1,1),
- array(0,1,0,0,0,0,0,1,0),
- array(0,1,0,0,0,0,0,1,0),
- array(0,0,1,0,0,0,1,0,0),
- array(0,0,0,1,0,1,0,0,0),
- array(0,0,0,1,0,1,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,1,0,1,0,0,0),
- array(0,0,0,1,0,1,0,0,0),
- array(0,0,1,0,0,0,1,0,0),
- array(0,1,0,0,0,0,1,0,0),
- array(0,1,0,0,0,0,0,1,0),
- array(1,1,1,0,0,0,1,1,1),
- array(0,0,0,0,0,0,0,0,0),
- ),
- array(
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,1,0,0,0,0,0,1,0),
- array(0,1,1,0,0,0,1,1,0),
- array(0,0,1,1,0,1,1,0,0),
- array(0,0,0,1,1,1,0,0,0),
- array(0,0,0,1,1,1,0,0,0),
- array(0,0,1,1,0,1,1,0,0),
- array(0,1,1,0,0,0,1,1,0),
- array(0,0,0,0,0,0,0,0,0),
- ),
- ),
- 'Y' => array(
- array(
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(0,1,0,0,0,0,0,1,0),
- array(0,1,0,0,0,0,0,1,0),
- array(0,0,1,0,0,0,1,0,0),
- array(0,0,1,0,0,0,1,0,0),
- array(0,0,0,1,0,1,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- ),
- array(
- array(0,0,0,0,0,0,0,0,0),
- array(1,1,1,0,0,0,1,1,1),
- array(0,1,0,0,0,0,0,1,0),
- array(0,1,0,0,0,0,0,1,0),
- array(0,0,1,0,0,0,1,0,0),
- array(0,0,1,0,0,0,1,0,0),
- array(0,0,0,1,0,1,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,1,1,1,0,0,0),
- ),
- array(
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,1,0,0,0,0,1),
- array(0,0,0,1,1,0,0,0,1),
- array(0,0,0,0,1,0,0,1,1),
- array(0,0,0,0,1,1,0,1,0),
- array(0,0,0,0,0,1,1,1,0),
- array(0,0,0,0,0,0,1,0,0),
- array(0,0,0,0,0,1,1,0,0),
- array(0,0,0,0,0,1,0,0,0),
- array(0,0,0,0,1,1,0,0,0),
- array(0,0,1,1,1,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- ),
- ),
- 'Z' => array(
- array(
- array(1,1,1,1,1,1,1,1,1),
- array(1,0,0,0,0,0,0,0,1),
- array(0,0,0,0,0,0,0,0,1),
- array(0,0,0,0,0,0,0,1,0),
- array(0,0,0,0,0,0,1,0,0),
- array(0,0,0,0,0,1,0,0,0),
- array(0,0,0,0,0,1,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,1,0,0,0,0,0),
- array(0,0,0,1,0,0,0,0,0),
- array(0,0,1,0,0,0,0,0,0),
- array(0,1,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,1),
- array(1,1,1,1,1,1,1,1,1),
- ),
- array(
- array(1,1,1,1,1,1,1,1,1),
- array(0,0,0,0,0,0,0,0,1),
- array(0,0,0,0,0,0,0,0,1),
- array(0,0,0,0,0,0,0,1,0),
- array(0,0,0,0,0,0,1,0,0),
- array(0,0,0,0,0,1,0,0,0),
- array(0,0,0,0,0,1,0,0,0),
- array(0,0,1,1,1,1,1,0,0),
- array(0,0,0,1,0,0,0,0,0),
- array(0,0,0,1,0,0,0,0,0),
- array(0,0,1,0,0,0,0,0,0),
- array(0,1,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,1,1,1,1,1,1,1,1),
- ),
- array(
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,1,1,1,1,1,1,1,0),
- array(0,0,0,0,0,1,1,0,0),
- array(0,0,0,0,1,1,0,0,0),
- array(0,0,0,1,1,0,0,0,0),
- array(0,0,1,1,0,0,0,0,0),
- array(0,0,1,0,0,0,0,0,0),
- array(0,1,1,1,1,1,1,1,0),
- ),
- ),
- );
- return array(
- 'width' => 9,
- 'height' => 15,
- 'data' => array(
-
- 'A' => $chars['A'][mt_rand(0, min(sizeof($chars['A']), $config['captcha_gd_fonts']) -1)],
- 'B' => $chars['B'][mt_rand(0, min(sizeof($chars['B']), $config['captcha_gd_fonts']) -1)],
- 'C' => $chars['C'][mt_rand(0, min(sizeof($chars['C']), $config['captcha_gd_fonts']) -1)],
- 'D' => $chars['D'][mt_rand(0, min(sizeof($chars['D']), $config['captcha_gd_fonts']) -1)],
- 'E' => $chars['E'][mt_rand(0, min(sizeof($chars['E']), $config['captcha_gd_fonts']) -1)],
- 'F' => $chars['F'][mt_rand(0, min(sizeof($chars['F']), $config['captcha_gd_fonts']) -1)],
- 'G' => $chars['G'][mt_rand(0, min(sizeof($chars['G']), $config['captcha_gd_fonts']) -1)],
- 'H' => $chars['H'][mt_rand(0, min(sizeof($chars['H']), $config['captcha_gd_fonts']) -1)],
- 'I' => $chars['I'][mt_rand(0, min(sizeof($chars['I']), $config['captcha_gd_fonts']) -1)],
- 'J' => $chars['J'][mt_rand(0, min(sizeof($chars['J']), $config['captcha_gd_fonts']) -1)],
- 'K' => $chars['K'][mt_rand(0, min(sizeof($chars['K']), $config['captcha_gd_fonts']) -1)],
- 'L' => $chars['L'][mt_rand(0, min(sizeof($chars['L']), $config['captcha_gd_fonts']) -1)],
- 'M' => $chars['M'][mt_rand(0, min(sizeof($chars['M']), $config['captcha_gd_fonts']) -1)],
- 'N' => $chars['N'][mt_rand(0, min(sizeof($chars['N']), $config['captcha_gd_fonts']) -1)],
- 'O' => $chars['O'][mt_rand(0, min(sizeof($chars['O']), $config['captcha_gd_fonts']) -1)],
- 'P' => $chars['P'][mt_rand(0, min(sizeof($chars['P']), $config['captcha_gd_fonts']) -1)],
- 'Q' => $chars['Q'][mt_rand(0, min(sizeof($chars['Q']), $config['captcha_gd_fonts']) -1)],
- 'R' => $chars['R'][mt_rand(0, min(sizeof($chars['R']), $config['captcha_gd_fonts']) -1)],
- 'S' => $chars['S'][mt_rand(0, min(sizeof($chars['S']), $config['captcha_gd_fonts']) -1)],
- 'T' => $chars['T'][mt_rand(0, min(sizeof($chars['T']), $config['captcha_gd_fonts']) -1)],
- 'U' => $chars['U'][mt_rand(0, min(sizeof($chars['U']), $config['captcha_gd_fonts']) -1)],
- 'V' => $chars['V'][mt_rand(0, min(sizeof($chars['V']), $config['captcha_gd_fonts']) -1)],
- 'W' => $chars['W'][mt_rand(0, min(sizeof($chars['W']), $config['captcha_gd_fonts']) -1)],
- 'X' => $chars['X'][mt_rand(0, min(sizeof($chars['X']), $config['captcha_gd_fonts']) -1)],
- 'Y' => $chars['Y'][mt_rand(0, min(sizeof($chars['Y']), $config['captcha_gd_fonts']) -1)],
- 'Z' => $chars['Z'][mt_rand(0, min(sizeof($chars['Z']), $config['captcha_gd_fonts']) -1)],
-
- '1' => array(
- array(0,0,0,1,1,0,0,0,0),
- array(0,0,1,0,1,0,0,0,0),
- array(0,1,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,1,1,1,1,1,1,1,0),
- ),
- '2' => array( // New '2' supplied by Anon
- array(0,0,0,1,1,1,0,0,0),
- array(0,0,1,0,0,0,1,0,0),
- array(0,1,0,0,0,0,1,1,0),
- array(0,0,0,0,0,0,0,0,1),
- array(0,0,0,0,0,0,0,0,1),
- array(0,0,0,0,0,0,0,1,1),
- array(0,0,0,0,0,0,0,1,0),
- array(0,0,0,0,0,0,1,0,0),
- array(0,0,0,0,0,1,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,1,0,0,0,0,0),
- array(0,0,1,0,0,0,0,0,0),
- array(0,1,0,0,0,0,0,0,0),
- array(1,1,1,1,1,1,1,1,1),
- array(0,0,0,0,0,0,0,0,0),
- ),
- '3' => array(
- array(0,0,1,1,1,1,1,0,0),
- array(0,1,0,0,0,0,0,1,0),
- array(1,0,0,0,0,0,0,0,1),
- array(0,0,0,0,0,0,0,0,1),
- array(0,0,0,0,0,0,0,0,1),
- array(0,0,0,0,0,0,0,0,1),
- array(0,0,0,0,0,0,0,1,0),
- array(0,0,0,0,0,1,1,0,0),
- array(0,0,0,0,0,0,0,1,0),
- array(0,0,0,0,0,0,0,0,1),
- array(0,0,0,0,0,0,0,0,1),
- array(0,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(0,1,0,0,0,0,0,1,0),
- array(0,0,1,1,1,1,1,0,0),
- ),
- '4' => array(
- array(0,0,0,0,0,0,1,1,0),
- array(0,0,0,0,0,1,0,1,0),
- array(0,0,0,0,1,0,0,1,0),
- array(0,0,0,1,0,0,0,1,0),
- array(0,0,1,0,0,0,0,1,0),
- array(0,1,0,0,0,0,0,1,0),
- array(1,0,0,0,0,0,0,1,0),
- array(1,0,0,0,0,0,0,1,0),
- array(1,1,1,1,1,1,1,1,1),
- array(0,0,0,0,0,0,0,1,0),
- array(0,0,0,0,0,0,0,1,0),
- array(0,0,0,0,0,0,0,1,0),
- array(0,0,0,0,0,0,0,1,0),
- array(0,0,0,0,0,0,0,1,0),
- array(0,0,0,0,0,0,0,1,0),
- ),
- '5' => array(
- array(1,1,1,1,1,1,1,1,1),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(0,1,0,0,0,0,0,0,0),
- array(0,0,1,1,1,1,1,0,0),
- array(0,0,0,0,0,0,0,1,0),
- array(0,0,0,0,0,0,0,0,1),
- array(0,0,0,0,0,0,0,0,1),
- array(0,0,0,0,0,0,0,0,1),
- array(0,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(0,1,0,0,0,0,0,1,0),
- array(0,0,1,1,1,1,1,0,0),
- ),
- '6' => array(
- array(0,0,1,1,1,1,1,0,0),
- array(0,1,0,0,0,0,0,1,0),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,1,1,1,1,0,0),
- array(1,0,1,0,0,0,0,1,0),
- array(1,1,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(0,1,0,0,0,0,0,1,0),
- array(0,0,1,1,1,1,1,0,0),
- ),
- '7' => array(
- array(1,1,1,1,1,1,1,1,1),
- array(0,0,0,0,0,0,0,0,1),
- array(0,0,0,0,0,0,0,1,0),
- array(0,0,0,0,0,0,0,1,0),
- array(0,0,0,0,0,0,1,0,0),
- array(0,0,0,0,0,1,0,0,0),
- array(0,0,0,0,0,1,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,1,0,0,0,0,0),
- array(0,0,0,1,0,0,0,0,0),
- array(0,0,1,0,0,0,0,0,0),
- array(0,1,0,0,0,0,0,0,0),
- array(0,1,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- ),
- '8' => array(
- array(0,0,1,1,1,1,1,0,0),
- array(0,1,0,0,0,0,0,1,0),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(0,1,0,0,0,0,0,1,0),
- array(0,0,1,1,1,1,1,0,0),
- array(0,1,0,0,0,0,0,1,0),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(0,1,0,0,0,0,0,1,0),
- array(0,0,1,1,1,1,1,0,0),
- ),
- '9' => array(
- array(0,0,1,1,1,1,1,0,0),
- array(0,1,0,0,0,0,0,1,0),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,1,1),
- array(0,1,0,0,0,0,1,0,1),
- array(0,0,1,1,1,1,0,0,1),
- array(0,0,0,0,0,0,0,0,1),
- array(0,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(0,1,0,0,0,0,0,1,0),
- array(0,0,1,1,1,1,1,0,0),
- ),
- )
- );
- }
-}
-
-/**
-* @package VC
-*/
-class char_cube3d
-{
- var $bitmap;
- var $bitmap_width;
- var $bitmap_height;
-
- var $basis_matrix = array(array(1, 0, 0), array(0, 1, 0), array(0, 0, 1));
- var $abs_x = array(1, 0);
- var $abs_y = array(0, 1);
- var $x = 0;
- var $y = 1;
- var $z = 2;
- var $letter = '';
-
- /**
- */
- function char_cube3d(&$bitmaps, $letter)
- {
- $this->bitmap = $bitmaps['data'][$letter];
- $this->bitmap_width = $bitmaps['width'];
- $this->bitmap_height = $bitmaps['height'];
-
- $this->basis_matrix[0][0] = mt_rand(-600, 600);
- $this->basis_matrix[0][1] = mt_rand(-600, 600);
- $this->basis_matrix[0][2] = (mt_rand(0, 1) * 2000) - 1000;
- $this->basis_matrix[1][0] = mt_rand(-1000, 1000);
- $this->basis_matrix[1][1] = mt_rand(-1000, 1000);
- $this->basis_matrix[1][2] = mt_rand(-1000, 1000);
-
- $this->normalize($this->basis_matrix[0]);
- $this->normalize($this->basis_matrix[1]);
- $this->basis_matrix[2] = $this->cross_product($this->basis_matrix[0], $this->basis_matrix[1]);
- $this->normalize($this->basis_matrix[2]);
-
- // $this->basis_matrix[1] might not be (probably isn't) orthogonal to $basis_matrix[0]
- $this->basis_matrix[1] = $this->cross_product($this->basis_matrix[0], $this->basis_matrix[2]);
- $this->normalize($this->basis_matrix[1]);
-
- // Make sure our cube is facing into the canvas (assuming +z == in)
- for ($i = 0; $i < 3; ++$i)
- {
- if ($this->basis_matrix[$i][2] < 0)
- {
- $this->basis_matrix[$i][0] *= -1;
- $this->basis_matrix[$i][1] *= -1;
- $this->basis_matrix[$i][2] *= -1;
- }
- }
-
- // Force our "z" basis vector to be the one with greatest absolute z value
- $this->x = 0;
- $this->y = 1;
- $this->z = 2;
-
- // Swap "y" with "z"
- if ($this->basis_matrix[1][2] > $this->basis_matrix[2][2])
- {
- $this->z = 1;
- $this->y = 2;
- }
-
- // Swap "x" with "z"
- if ($this->basis_matrix[0][2] > $this->basis_matrix[$this->z][2])
- {
- $this->x = $this->z;
- $this->z = 0;
- }
-
- // Still need to determine which of $x,$y are which.
- // wrong orientation if y's y-component is less than it's x-component
- // likewise if x's x-component is less than it's y-component
- // if they disagree, go with the one with the greater weight difference.
- // rotate if positive
- $weight = (abs($this->basis_matrix[$this->x][1]) - abs($this->basis_matrix[$this->x][0])) + (abs($this->basis_matrix[$this->y][0]) - abs($this->basis_matrix[$this->y][1]));
-
- // Swap "x" with "y"
- if ($weight > 0)
- {
- list($this->x, $this->y) = array($this->y, $this->x);
- }
-
- $this->abs_x = array($this->basis_matrix[$this->x][0], $this->basis_matrix[$this->x][1]);
- $this->abs_y = array($this->basis_matrix[$this->y][0], $this->basis_matrix[$this->y][1]);
-
- if ($this->abs_x[0] < 0)
- {
- $this->abs_x[0] *= -1;
- $this->abs_x[1] *= -1;
- }
-
- if ($this->abs_y[1] > 0)
- {
- $this->abs_y[0] *= -1;
- $this->abs_y[1] *= -1;
- }
-
- $this->letter = $letter;
- }
-
- /**
- * Draw a character
- */
- function drawchar($scale, $xoff, $yoff, $img, $background, $colours)
- {
- $width = $this->bitmap_width;
- $height = $this->bitmap_height;
- $bitmap = $this->bitmap;
-
- $colour1 = $colours[array_rand($colours)];
- $colour2 = $colours[array_rand($colours)];
-
- $swapx = ($this->basis_matrix[$this->x][0] > 0);
- $swapy = ($this->basis_matrix[$this->y][1] < 0);
-
- for ($y = 0; $y < $height; ++$y)
- {
- for ($x = 0; $x < $width; ++$x)
- {
- $xp = ($swapx) ? ($width - $x - 1) : $x;
- $yp = ($swapy) ? ($height - $y - 1) : $y;
-
- if ($bitmap[$height - $yp - 1][$xp])
- {
- $dx = $this->scale($this->abs_x, ($xp - ($swapx ? ($width / 2) : ($width / 2) - 1)) * $scale);
- $dy = $this->scale($this->abs_y, ($yp - ($swapy ? ($height / 2) : ($height / 2) - 1)) * $scale);
- $xo = $xoff + $dx[0] + $dy[0];
- $yo = $yoff + $dx[1] + $dy[1];
-
- $origin = array(0, 0, 0);
- $xvec = $this->scale($this->basis_matrix[$this->x], $scale);
- $yvec = $this->scale($this->basis_matrix[$this->y], $scale);
- $face_corner = $this->sum2($xvec, $yvec);
-
- $zvec = $this->scale($this->basis_matrix[$this->z], $scale);
- $x_corner = $this->sum2($xvec, $zvec);
- $y_corner = $this->sum2($yvec, $zvec);
-
- imagefilledpolygon($img, $this->gen_poly($xo, $yo, $origin, $xvec, $x_corner,$zvec), 4, $colour1);
- imagefilledpolygon($img, $this->gen_poly($xo, $yo, $origin, $yvec, $y_corner,$zvec), 4, $colour2);
-
- $face = $this->gen_poly($xo, $yo, $origin, $xvec, $face_corner, $yvec);
-
- imagefilledpolygon($img, $face, 4, $background);
- imagepolygon($img, $face, 4, $colour1);
- }
- }
- }
- }
-
- /*
- * return a roughly acceptable range of sizes for rendering with this texttype
- */
- function range()
- {
- return array(3, 4);
- }
-
- /**
- * Vector length
- */
- function vectorlen($vector)
- {
- return sqrt(pow($vector[0], 2) + pow($vector[1], 2) + pow($vector[2], 2));
- }
-
- /**
- * Normalize
- */
- function normalize(&$vector, $length = 1)
- {
- $length = (( $length < 1) ? 1 : $length);
- $length /= $this->vectorlen($vector);
- $vector[0] *= $length;
- $vector[1] *= $length;
- $vector[2] *= $length;
- }
-
- /**
- */
- function cross_product($vector1, $vector2)
- {
- $retval = array(0, 0, 0);
- $retval[0] = (($vector1[1] * $vector2[2]) - ($vector1[2] * $vector2[1]));
- $retval[1] = -(($vector1[0] * $vector2[2]) - ($vector1[2] * $vector2[0]));
- $retval[2] = (($vector1[0] * $vector2[1]) - ($vector1[1] * $vector2[0]));
-
- return $retval;
- }
-
- /**
- */
- function sum($vector1, $vector2)
- {
- return array($vector1[0] + $vector2[0], $vector1[1] + $vector2[1], $vector1[2] + $vector2[2]);
- }
-
- /**
- */
- function sum2($vector1, $vector2)
- {
- return array($vector1[0] + $vector2[0], $vector1[1] + $vector2[1]);
- }
-
- /**
- */
- function scale($vector, $length)
- {
- if (sizeof($vector) == 2)
- {
- return array($vector[0] * $length, $vector[1] * $length);
- }
-
- return array($vector[0] * $length, $vector[1] * $length, $vector[2] * $length);
- }
-
- /**
- */
- function gen_poly($xoff, $yoff, &$vec1, &$vec2, &$vec3, &$vec4)
- {
- $poly = array();
- $poly[0] = $xoff + $vec1[0];
- $poly[1] = $yoff + $vec1[1];
- $poly[2] = $xoff + $vec2[0];
- $poly[3] = $yoff + $vec2[1];
- $poly[4] = $xoff + $vec3[0];
- $poly[5] = $yoff + $vec3[1];
- $poly[6] = $xoff + $vec4[0];
- $poly[7] = $yoff + $vec4[1];
-
- return $poly;
- }
-
- /**
- * dimensions
- */
- function dimensions($size)
- {
- $xn = $this->scale($this->basis_matrix[$this->x], -($this->bitmap_width / 2) * $size);
- $xp = $this->scale($this->basis_matrix[$this->x], ($this->bitmap_width / 2) * $size);
- $yn = $this->scale($this->basis_matrix[$this->y], -($this->bitmap_height / 2) * $size);
- $yp = $this->scale($this->basis_matrix[$this->y], ($this->bitmap_height / 2) * $size);
-
- $p = array();
- $p[0] = $this->sum2($xn, $yn);
- $p[1] = $this->sum2($xp, $yn);
- $p[2] = $this->sum2($xp, $yp);
- $p[3] = $this->sum2($xn, $yp);
-
- $min_x = $max_x = $p[0][0];
- $min_y = $max_y = $p[0][1];
-
- for ($i = 1; $i < 4; ++$i)
- {
- $min_x = ($min_x > $p[$i][0]) ? $p[$i][0] : $min_x;
- $min_y = ($min_y > $p[$i][1]) ? $p[$i][1] : $min_y;
- $max_x = ($max_x < $p[$i][0]) ? $p[$i][0] : $max_x;
- $max_y = ($max_y < $p[$i][1]) ? $p[$i][1] : $max_y;
- }
-
- return array($min_x, $min_y, $max_x, $max_y);
- }
-}
-
-/**
-* @package VC
-*/
-class colour_manager
-{
- var $img;
- var $mode;
- var $colours;
- var $named_colours;
-
- /**
- * Create the colour manager, link it to the image resource
- */
- function colour_manager($img, $background = false, $mode = 'ahsv')
- {
- $this->img = $img;
- $this->mode = $mode;
- $this->colours = array();
- $this->named_colours = array();
-
- if ($background !== false)
- {
- $bg = $this->allocate_named('background', $background);
- imagefill($this->img, 0, 0, $bg);
- }
- }
-
- /**
- * Lookup a named colour resource
- */
- function get_resource($named_colour)
- {
- if (isset($this->named_colours[$named_colour]))
- {
- return $this->named_colours[$named_colour];
- }
-
- if (isset($this->named_rgb[$named_colour]))
- {
- return $this->allocate_named($named_colour, $this->named_rgb[$named_colour], 'rgb');
- }
-
- return false;
- }
-
- /**
- * Assign a name to a colour resource
- */
- function name_colour($name, $resource)
- {
- $this->named_colours[$name] = $resource;
- }
-
- /**
- * names and allocates a colour resource
- */
- function allocate_named($name, $colour, $mode = false)
- {
- $resource = $this->allocate($colour, $mode);
-
- if ($resource !== false)
- {
- $this->name_colour($name, $resource);
- }
- return $resource;
- }
-
- /**
- * allocates a specified colour into the image
- */
- function allocate($colour, $mode = false)
- {
- if ($mode === false)
- {
- $mode = $this->mode;
- }
-
- if (!is_array($colour))
- {
- if (isset($this->named_rgb[$colour]))
- {
- return $this->allocate_named($colour, $this->named_rgb[$colour], 'rgb');
- }
-
- if (!is_int($colour))
- {
- return false;
- }
-
- $mode = 'rgb';
- $colour = array(255 & ($colour >> 16), 255 & ($colour >> 8), 255 & $colour);
- }
-
- if (isset($colour['mode']))
- {
- $mode = $colour['mode'];
- unset($colour['mode']);
- }
-
- if (isset($colour['random']))
- {
- unset($colour['random']);
- // everything else is params
- return $this->random_colour($colour, $mode);
- }
-
- $rgb = colour_manager::model_convert($colour, $mode, 'rgb');
- $store = ($this->mode == 'rgb') ? $rgb : colour_manager::model_convert($colour, $mode, $this->mode);
- $resource = imagecolorallocate($this->img, $rgb[0], $rgb[1], $rgb[2]);
- $this->colours[$resource] = $store;
-
- return $resource;
- }
-
- /**
- * randomly generates a colour, with optional params
- */
- function random_colour($params = array(), $mode = false)
- {
- if ($mode === false)
- {
- $mode = $this->mode;
- }
-
- switch ($mode)
- {
- case 'rgb':
- // @TODO random rgb generation. do we intend to do this, or is it just too tedious?
- break;
-
- case 'ahsv':
- case 'hsv':
- default:
-
- $default_params = array(
- 'hue_bias' => false, // degree / 'r'/'g'/'b'/'c'/'m'/'y' /'o'
- 'hue_range' => false, // if hue bias, then difference range +/- from bias
- 'min_saturation' => 30, // 0 - 100
- 'max_saturation' => 80, // 0 - 100
- 'min_value' => 30, // 0 - 100
- 'max_value' => 80, // 0 - 100
- );
-
- $alt = ($mode == 'ahsv') ? true : false;
- $params = array_merge($default_params, $params);
-
- $min_hue = 0;
- $max_hue = 359;
- $min_saturation = max(0, $params['min_saturation']);
- $max_saturation = min(100, $params['max_saturation']);
- $min_value = max(0, $params['min_value']);
- $max_value = min(100, $params['max_value']);
-
- if ($params['hue_bias'] !== false)
- {
- if (is_numeric($params['hue_bias']))
- {
- $h = intval($params['hue_bias']) % 360;
- }
- else
- {
- switch ($params['hue_bias'])
- {
- case 'o':
- $h = $alt ? 60 : 30;
- break;
-
- case 'y':
- $h = $alt ? 120 : 60;
- break;
-
- case 'g':
- $h = $alt ? 180 : 120;
- break;
-
- case 'c':
- $h = $alt ? 210 : 180;
- break;
-
- case 'b':
- $h = 240;
- break;
-
- case 'm':
- $h = 300;
- break;
-
- case 'r':
- default:
- $h = 0;
- break;
- }
- }
-
- $min_hue = $h + 360;
- $max_hue = $h + 360;
-
- if ($params['hue_range'])
- {
- $min_hue -= min(180, $params['hue_range']);
- $max_hue += min(180, $params['hue_range']);
- }
- }
-
- $h = mt_rand($min_hue, $max_hue);
- $s = mt_rand($min_saturation, $max_saturation);
- $v = mt_rand($min_value, $max_value);
-
- return $this->allocate(array($h, $s, $v), $mode);
-
- break;
- }
- }
-
- /**
- */
- function colour_scheme($resource, $include_original = true)
- {
- $mode = 'hsv';
-
- if (($pre = $this->get_resource($resource)) !== false)
- {
- $resource = $pre;
- }
-
- $colour = colour_manager::model_convert($this->colours[$resource], $this->mode, $mode);
- $results = ($include_original) ? array($resource) : array();
- $colour2 = $colour3 = $colour4 = $colour;
- $colour2[0] += 150;
- $colour3[0] += 180;
- $colour4[0] += 210;
-
-
- $results[] = $this->allocate($colour2, $mode);
- $results[] = $this->allocate($colour3, $mode);
- $results[] = $this->allocate($colour4, $mode);
-
- return $results;
- }
-
- /**
- */
- function mono_range($resource, $count = 5, $include_original = true)
- {
- if (is_array($resource))
- {
- $results = array();
- for ($i = 0, $size = sizeof($resource); $i < $size; ++$i)
- {
- $results = array_merge($results, $this->mono_range($resource[$i], $count, $include_original));
- }
- return $results;
- }
-
- $mode = (in_array($this->mode, array('hsv', 'ahsv'), true) ? $this->mode : 'ahsv');
- if (($pre = $this->get_resource($resource)) !== false)
- {
- $resource = $pre;
- }
-
- $colour = colour_manager::model_convert($this->colours[$resource], $this->mode, $mode);
-
- $results = array();
- if ($include_original)
- {
- $results[] = $resource;
- $count--;
- }
-
- // This is a hard problem. I chicken out and try to maintain readability at the cost of less randomness.
-
- while ($count > 0)
- {
- $colour[1] = ($colour[1] + mt_rand(40,60)) % 99;
- $colour[2] = ($colour[2] + mt_rand(40,60));
- $results[] = $this->allocate($colour, $mode);
- $count--;
- }
- return $results;
- }
-
- /**
- * Convert from one colour model to another
- */
- function model_convert($colour, $from_model, $to_model)
- {
- if ($from_model == $to_model)
- {
- return $colour;
- }
-
- switch ($to_model)
- {
- case 'hsv':
-
- switch ($from_model)
- {
- case 'ahsv':
- return colour_manager::ah2h($colour);
- break;
-
- case 'rgb':
- return colour_manager::rgb2hsv($colour);
- break;
- }
- break;
-
- case 'ahsv':
-
- switch ($from_model)
- {
- case 'hsv':
- return colour_manager::h2ah($colour);
- break;
-
- case 'rgb':
- return colour_manager::h2ah(colour_manager::rgb2hsv($colour));
- break;
- }
- break;
-
- case 'rgb':
- switch ($from_model)
- {
- case 'hsv':
- return colour_manager::hsv2rgb($colour);
- break;
-
- case 'ahsv':
- return colour_manager::hsv2rgb(colour_manager::ah2h($colour));
- break;
- }
- break;
- }
- return false;
- }
-
- /**
- * Slightly altered from wikipedia's algorithm
- */
- function hsv2rgb($hsv)
- {
- colour_manager::normalize_hue($hsv[0]);
-
- $h = $hsv[0];
- $s = min(1, max(0, $hsv[1] / 100));
- $v = min(1, max(0, $hsv[2] / 100));
-
- // calculate hue sector
- $hi = floor($hsv[0] / 60);
-
- // calculate opposite colour
- $p = $v * (1 - $s);
-
- // calculate distance between hex vertices
- $f = ($h / 60) - $hi;
-
- // coming in or going out?
- if (!($hi & 1))
- {
- $f = 1 - $f;
- }
-
- // calculate adjacent colour
- $q = $v * (1 - ($f * $s));
-
- switch ($hi)
- {
- case 0:
- $rgb = array($v, $q, $p);
- break;
-
- case 1:
- $rgb = array($q, $v, $p);
- break;
-
- case 2:
- $rgb = array($p, $v, $q);
- break;
-
- case 3:
- $rgb = array($p, $q, $v);
- break;
-
- case 4:
- $rgb = array($q, $p, $v);
- break;
-
- case 5:
- $rgb = array($v, $p, $q);
- break;
-
- default:
- return array(0, 0, 0);
- break;
- }
-
- return array(255 * $rgb[0], 255 * $rgb[1], 255 * $rgb[2]);
- }
-
- /**
- * (more than) Slightly altered from wikipedia's algorithm
- */
- function rgb2hsv($rgb)
- {
- $r = min(255, max(0, $rgb[0]));
- $g = min(255, max(0, $rgb[1]));
- $b = min(255, max(0, $rgb[2]));
- $max = max($r, $g, $b);
- $min = min($r, $g, $b);
-
- $v = $max / 255;
- $s = (!$max) ? 0 : 1 - ($min / $max);
-
- // if max - min is 0, we want hue to be 0 anyway.
- $h = $max - $min;
-
- if ($h)
- {
- switch ($max)
- {
- case $g:
- $h = 120 + (60 * ($b - $r) / $h);
- break;
-
- case $b:
- $h = 240 + (60 * ($r - $g) / $h);
- break;
-
- case $r:
- $h = 360 + (60 * ($g - $b) / $h);
- break;
- }
- }
- colour_manager::normalize_hue($h);
-
- return array($h, $s * 100, $v * 100);
- }
-
- /**
- */
- function normalize_hue(&$hue)
- {
- $hue %= 360;
-
- if ($hue < 0)
- {
- $hue += 360;
- }
- }
-
- /**
- * Alternate hue to hue
- */
- function ah2h($ahue)
- {
- if (is_array($ahue))
- {
- $ahue[0] = colour_manager::ah2h($ahue[0]);
- return $ahue;
- }
- colour_manager::normalize_hue($ahue);
-
- // blue through red is already ok
- if ($ahue >= 240)
- {
- return $ahue;
- }
-
- // ahue green is at 180
- if ($ahue >= 180)
- {
- // return (240 - (2 * (240 - $ahue)));
- return (2 * $ahue) - 240; // equivalent
- }
-
- // ahue yellow is at 120 (RYB rather than RGB)
- if ($ahue >= 120)
- {
- return $ahue - 60;
- }
-
- return $ahue / 2;
- }
-
- /**
- * hue to Alternate hue
- */
- function h2ah($hue)
- {
- if (is_array($hue))
- {
- $hue[0] = colour_manager::h2ah($hue[0]);
- return $hue;
- }
- colour_manager::normalize_hue($hue);
-
- // blue through red is already ok
- if ($hue >= 240)
- {
- return $hue;
- }
- else if ($hue <= 60)
- {
- return $hue * 2;
- }
- else if ($hue <= 120)
- {
- return $hue + 60;
- }
- else
- {
- return ($hue + 240) / 2;
- }
- }
-}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/captcha/captcha_gd_wave.php b/phpBB/includes/captcha/captcha_gd_wave.php
deleted file mode 100644
index 27422513d9..0000000000
--- a/phpBB/includes/captcha/captcha_gd_wave.php
+++ /dev/null
@@ -1,845 +0,0 @@
-<?php
-/**
-*
-* @package VC
-* @version $Id$
-* @copyright (c) 2006 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
-*
-*/
-
-/**
-* Wave3D CAPTCHA
-*
-* @author Robert Hetzler
-* @package VC
-*/
-class captcha
-{
- var $width = 360;
- var $height = 96;
-
- function execute($code, $seed)
- {
- global $starttime;
-
- // seed the random generator
- mt_srand($seed);
-
- // set height and width
- $img_x = $this->width;
- $img_y = $this->height;
-
- // Generate image
- $img = imagecreatetruecolor($img_x, $img_y);
- $x_grid = mt_rand(6, 10);
- $y_grid = mt_rand(6, 10);
-
- // Ok, so lets cut to the chase. We could accurately represent this in 3d and
- // do all the appropriate linear transforms. my questions is... why bother?
- // The computational overhead is unnecessary when you consider the simple fact:
- // we're not here to accurately represent a model, but to just show off some random-ish
- // polygons
-
- // Conceive of 3 spaces.
- // 1) planar-space (discrete "pixel" grid)
- // 2) 3-space. (planar-space with z/height aspect)
- // 3) image space (pixels on the screen)
- // resolution of the planar-space we're embedding the text code in
- $plane_x = 100;
- $plane_y = 30;
-
- $subdivision_factor = 3;
-
- // $box is the 4 points in img_space that correspond to the corners of the plane in 3-space
- $box = array(
- 'upper_left' => array(
- 'x' => mt_rand(5, 15),
- 'y' => mt_rand(10, 15)
- ),
- 'upper_right' => array(
- 'x' => mt_rand($img_x - 35, $img_x - 19),
- 'y' => mt_rand(10, 17)
- ),
- 'lower_left' => array(
- 'x' => mt_rand($img_x - 45, $img_x - 5),
- 'y' => mt_rand($img_y - 15, $img_y - 0),
- ),
- );
-
- $box['lower_right'] = array(
- 'x' => $box['lower_left']['x'] + $box['upper_left']['x'] - $box['upper_right']['x'],
- 'y' => $box['lower_left']['y'] + $box['upper_left']['y'] - $box['upper_right']['y'],
- );
-
- // TODO
- $background = imagecolorallocate($img, mt_rand(155, 255), mt_rand(155, 255), mt_rand(155, 255));
- imagefill($img, 0, 0, $background);
- $black = imagecolorallocate($img, 0, 0, 0);
-
- $random = array();
- $fontcolors = array();
-
- for ($i = 0; $i < 15; ++$i)
- {
- $random[$i] = imagecolorallocate($img, mt_rand(120, 255), mt_rand(120, 255), mt_rand(120, 255));
- }
-
- $fontcolors[0] = imagecolorallocate($img, mt_rand(0, 120), mt_rand(0, 120), mt_rand(0, 120));
-
- $colors = array();
-
- $minr = mt_rand(20, 30);
- $ming = mt_rand(20, 30);
- $minb = mt_rand(20, 30);
-
- $maxr = mt_rand(150, 230);
- $maxg = mt_rand(150, 230);
- $maxb = mt_rand(150, 230);
-
- for ($i = -30; $i <= 30; ++$i)
- {
- $coeff1 = ($i + 12) / 45;
- $coeff2 = 1 - $coeff1;
- $colors[$i] = imagecolorallocate($img, ($coeff2 * $maxr) + ($coeff1 * $minr), ($coeff2 * $maxg) + ($coeff1 * $ming), ($coeff2 * $maxb) + ($coeff1 * $minb));
- }
-
- // $img_buffer is the last row of 3-space positions (converted to img-space), cached
- // (using this means we don't need to recalculate all 4 positions for each new polygon,
- // merely the newest point that we're adding, which is then cached.
- $img_buffer = array(array(), array());
-
- // In image-space, the x- and y-offset necessary to move one unit in the x-direction in planar-space
- $dxx = ($box['upper_right']['x'] - $box['upper_left']['x']) / ($subdivision_factor * $plane_x);
- $dxy = ($box['upper_right']['y'] - $box['upper_left']['y']) / ($subdivision_factor * $plane_x);
-
- // In image-space, the x- and y-offset necessary to move one unit in the y-direction in planar-space
- $dyx = ($box['lower_right']['x'] - $box['upper_left']['x']) / ($subdivision_factor * $plane_y);
- $dyy = ($box['lower_right']['y'] - $box['upper_left']['y']) / ($subdivision_factor * $plane_y);
-
- // Initial captcha-letter offset in planar-space
- $plane_offset_x = mt_rand(3, 8);
- $plane_offset_y = mt_rand( 12, 15);
-
- // character map
- $map = $this->captcha_bitmaps();
-
- // matrix
- $plane = array();
-
- // for each character, we'll silkscreen it into our boolean pixel plane
- for ($c = 0, $code_num = strlen($code); $c < $code_num; ++$c)
- {
- $letter = $code[$c];
-
- for ($x = $map['width'] - 1; $x >= 0; --$x)
- {
- for ($y = $map['height'] - 1; $y >= 0; --$y)
- {
- if ($map['data'][$letter][$y][$x])
- {
- $plane[$y + $plane_offset_y + (($c & 1) ? 1 : -1)][$x + $plane_offset_x] = true;
- }
- }
- }
- $plane_offset_x += 11;
- }
-
- // calculate our first buffer, we can't actually draw polys with these yet
- // img_pos_prev == screen x,y location to our immediate left.
- // img_pos_cur == current screen x,y location
- // we calculate screen position of our
- // current cell based on the difference from the previous cell
- // rather than recalculating from absolute coordinates
- // What we cache into the $img_buffer contains the raised text coordinates.
- $img_pos_prev = $img_buffer[0][0] = array($box['upper_left']['x'], $box['upper_left']['y']);
- $cur_height = $prev_height = $this->wave_height(0, 0, $subdivision_factor);
- $full_x = $plane_x * $subdivision_factor;
- $full_y = $plane_y * $subdivision_factor;
-
- for ($x = 1; $x <= $full_x; ++$x)
- {
- $cur_height = $this->wave_height($x, 0, $subdivision_factor);
- $offset = $cur_height - $prev_height;
- $img_pos_cur = array($img_pos_prev[0] + $dxx, $img_pos_prev[1] + $dxy + $offset);
-
- $img_buffer[0][$x] = $img_pos_cur;
- $img_pos_prev = $img_pos_cur;
- $prev_height = $cur_height;
- }
-
- for ($y = 1; $y <= $full_y; ++$y)
- {
- // swap buffers
- $buffer_cur = $y & 1;
- $buffer_prev = 1 - $buffer_cur;
-
- $prev_height = $this->wave_height(0, $y, $subdivision_factor);
- $offset = $prev_height - $this->wave_height(0, $y - 1, $subdivision_factor);
- $img_pos_cur = array($img_buffer[$buffer_prev][0][0] + $dyx, min($img_buffer[$buffer_prev][0][1] + $dyy + $offset, $img_y - 1));
-
- // make sure we don't try to write off the page
- $img_pos_prev = $img_pos_cur;
-
- $img_buffer[$buffer_cur][0] = $img_pos_cur;
-
- for ($x = 1; $x <= $full_x; ++$x)
- {
- $cur_height = $this->wave_height($x, $y, $subdivision_factor) + $this->grid_height($x, $y, 1, $x_grid, $y_grid);
-
- // height is a z-factor, not a y-factor
- $offset = $cur_height - $prev_height;
- $img_pos_cur = array($img_pos_prev[0] + $dxx, $img_pos_prev[1] + $dxy + $offset);
-
- // height is float, index it to an int, get closest color
- $color = $colors[intval($cur_height)];
- $img_pos_prev = $img_pos_cur;
- $prev_height = $cur_height;
-
- $y_index_old = intval(($y - 1) / $subdivision_factor);
- $y_index_new = intval($y / $subdivision_factor);
- $x_index_old = intval(($x - 1) / $subdivision_factor);
- $x_index_new = intval($x / $subdivision_factor);
-
- if (!empty($plane[$y_index_new][$x_index_new]))
- {
- $img_pos_cur[1] += $this->wave_height($x, $y, $subdivision_factor, 1) - 30 - $cur_height;
- $color = $colors[20];
- }
- $img_pos_cur[1] = min($img_pos_cur[1], $img_y - 1);
- $img_buffer[$buffer_cur][$x] = $img_pos_cur;
-
- // Smooth the edges as much as possible by having not more than one low<->high traingle per square
- // Otherwise, just
- $diag_down = (empty($plane[$y_index_old][$x_index_old]) == empty($plane[$y_index_new][$x_index_new]));
- $diag_up = (empty($plane[$y_index_old][$x_index_new]) == empty($plane[$y_index_new][$x_index_old]));
-
- // natural switching
- $mode = ($x + $y) & 1;
-
- // override if it requires it
- if ($diag_down != $diag_up)
- {
- $mode = $diag_up;
- }
-
- if ($mode)
- {
- // +-/ /
- // 1 |/ 2 /|
- // / /-+
- $poly1 = array_merge($img_buffer[$buffer_cur][$x - 1], $img_buffer[$buffer_prev][$x - 1], $img_buffer[$buffer_prev][$x]);
- $poly2 = array_merge($img_buffer[$buffer_cur][$x - 1], $img_buffer[$buffer_cur][$x], $img_buffer[$buffer_prev][$x]);
- }
- else
- {
- // \ \-+
- // 1 |\ 2 \|
- // +-\ \
- $poly1 = array_merge($img_buffer[$buffer_cur][$x - 1], $img_buffer[$buffer_prev][$x - 1], $img_buffer[$buffer_cur][$x]);
- $poly2 = array_merge($img_buffer[$buffer_prev][$x - 1], $img_buffer[$buffer_prev][$x], $img_buffer[$buffer_cur][$x]);
- }
-
- imagefilledpolygon($img, $poly1, 3, $color);
- imagefilledpolygon($img, $poly2, 3, $color);
- }
- }
-
- // Output image
- header('Content-Type: image/png');
- header('Cache-control: no-cache, no-store');
- //$mtime = explode(' ', microtime());
- //$totaltime = $mtime[0] + $mtime[1] - $starttime;
-
- //echo $totaltime . "<br />\n";
- //echo memory_get_usage() - $tmp;
- imagepng($img);
- imagedestroy($img);
- }
-
- function wave_height($x, $y, $factor = 1, $tweak = 0.7)
- {
- // stretch the wave. TODO: pretty it up
- $x = $x/5 + 180;
- $y = $y/4;
- return ((sin($x / (3 * $factor)) + sin($y / (3 * $factor))) * 10 * $tweak);
- }
-
- function grid_height($x, $y, $factor = 1, $x_grid, $y_grid)
- {
- return ((!($x % ($x_grid * $factor)) || !($y % ($y_grid * $factor))) ? 3 : 0);
- }
-
- function captcha_bitmaps()
- {
- return array(
- 'width' => 9,
- 'height' => 13,
- 'data' => array(
- 'A' => array(
- array(0,0,1,1,1,1,0,0,0),
- array(0,1,0,0,0,0,1,0,0),
- array(1,0,0,0,0,0,0,1,0),
- array(1,0,0,0,0,0,0,1,0),
- array(1,0,0,0,0,0,0,1,0),
- array(1,0,0,0,0,0,0,1,0),
- array(1,0,0,0,0,0,0,1,0),
- array(1,1,1,1,1,1,1,1,0),
- array(1,0,0,0,0,0,0,1,0),
- array(1,0,0,0,0,0,0,1,0),
- array(1,0,0,0,0,0,0,1,0),
- array(1,0,0,0,0,0,0,1,0),
- array(1,0,0,0,0,0,0,1,0),
- array(0,0,0,0,0,0,0,0,0),
- ),
- 'B' => array(
- array(1,1,1,1,1,1,0,0,0),
- array(1,0,0,0,0,0,1,0,0),
- array(1,0,0,0,0,0,0,1,0),
- array(1,0,0,0,0,0,0,1,0),
- array(1,0,0,0,0,0,0,1,0),
- array(1,0,0,0,0,0,1,0,0),
- array(1,1,1,1,1,1,0,0,0),
- array(1,0,0,0,0,0,1,0,0),
- array(1,0,0,0,0,0,0,1,0),
- array(1,0,0,0,0,0,0,1,0),
- array(1,0,0,0,0,0,0,1,0),
- array(1,0,0,0,0,0,1,0,0),
- array(1,1,1,1,1,1,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- ),
- 'C' => array(
- array(0,0,1,1,1,1,1,0,0),
- array(0,1,0,0,0,0,0,1,0),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,1),
- array(0,1,0,0,0,0,0,1,0),
- array(0,0,1,1,1,1,1,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- ),
- 'D' => array(
- array(1,1,1,1,1,1,1,0,0),
- array(1,0,0,0,0,0,0,1,0),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,1,0),
- array(1,1,1,1,1,1,1,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- ),
- 'E' => array(
- array(0,0,1,1,1,1,1,1,1),
- array(0,1,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,1,1,1,1,1,1,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(0,1,0,0,0,0,0,0,0),
- array(0,0,1,1,1,1,1,1,1),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- ),
- 'F' => array(
- array(0,0,1,1,1,1,1,1,0),
- array(0,1,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,1,1,1,1,1,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- ),
- 'G' => array(
- array(0,0,1,1,1,1,1,0,0),
- array(0,1,0,0,0,0,0,1,0),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,1,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(0,1,0,0,0,0,0,1,0),
- array(0,0,1,1,1,1,1,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- ),
- 'H' => array(
- array(1,0,0,0,0,0,1,0,0),
- array(1,0,0,0,0,0,1,0,0),
- array(1,0,0,0,0,0,1,0,0),
- array(1,0,0,0,0,0,1,0,0),
- array(1,0,0,0,0,0,1,0,0),
- array(1,1,1,1,1,1,1,0,0),
- array(1,0,0,0,0,0,1,0,0),
- array(1,0,0,0,0,0,1,0,0),
- array(1,0,0,0,0,0,1,0,0),
- array(1,0,0,0,0,0,1,0,0),
- array(1,0,0,0,0,0,1,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- ),
- 'I' => array(
- array(0,1,1,1,1,1,1,1,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,1,1,1,1,1,1,1,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- ),
- 'J' => array(
- array(0,0,0,0,0,0,1,1,1),
- array(0,0,0,0,0,0,0,0,1),
- array(0,0,0,0,0,0,0,0,1),
- array(0,0,0,0,0,0,0,0,1),
- array(0,0,0,0,0,0,0,0,1),
- array(0,0,0,0,0,0,0,0,1),
- array(0,0,0,0,0,0,0,0,1),
- array(0,1,0,0,0,0,0,0,1),
- array(0,1,0,0,0,0,0,0,1),
- array(0,0,1,0,0,0,0,1,0),
- array(0,0,0,1,1,1,1,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- ),
- 'K' => array(
- array(1,0,0,0,0,0,1,0,0),
- array(1,0,0,0,0,1,0,0,0),
- array(1,0,0,0,1,0,0,0,0),
- array(1,0,0,1,0,0,0,0,0),
- array(1,0,1,0,0,0,0,0,0),
- array(1,1,0,0,0,0,0,0,0),
- array(1,0,1,0,0,0,0,0,0),
- array(1,0,0,1,0,0,0,0,0),
- array(1,0,0,0,1,0,0,0,0),
- array(1,0,0,0,0,1,0,0,0),
- array(1,0,0,0,0,0,1,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- ),
- 'L' => array(
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(0,1,0,0,0,0,0,0,0),
- array(0,0,1,1,1,1,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- ),
- 'M' => array(
- array(0,1,0,0,0,0,0,1,0),
- array(0,1,1,0,0,0,1,1,0),
- array(0,1,0,1,0,1,0,1,0),
- array(0,1,0,0,1,0,0,1,0),
- array(0,1,0,0,0,0,0,1,0),
- array(0,1,0,0,0,0,0,1,0),
- array(0,1,0,0,0,0,0,1,0),
- array(0,1,0,0,0,0,0,1,0),
- array(0,1,0,0,0,0,0,1,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- ),
- 'N' => array(
- array(1,0,0,0,0,0,0,0,1),
- array(1,1,0,0,0,0,0,0,1),
- array(1,0,1,0,0,0,0,0,1),
- array(1,0,0,1,0,0,0,0,1),
- array(1,0,0,0,1,0,0,0,1),
- array(1,0,0,0,0,1,0,0,1),
- array(1,0,0,0,0,0,1,0,1),
- array(1,0,0,0,0,0,0,1,1),
- array(1,0,0,0,0,0,0,0,1),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- ),
- 'O' => array(
- array(0,0,0,1,1,1,0,0,0),
- array(0,0,1,0,0,0,1,0,0),
- array(0,1,0,0,0,0,0,1,0),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(0,1,0,0,0,0,0,1,0),
- array(0,0,1,0,0,0,1,0,0),
- array(0,0,0,1,1,1,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- ),
- 'P' => array(
- array(1,1,1,1,1,1,0,0,0),
- array(1,0,0,0,0,0,1,0,0),
- array(1,0,0,0,0,0,0,1,0),
- array(1,0,0,0,0,0,0,1,0),
- array(1,0,0,0,0,0,0,1,0),
- array(1,0,0,0,0,0,0,1,0),
- array(1,0,0,0,0,0,1,0,0),
- array(1,1,1,1,1,1,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- ),
- 'Q' => array(
- array(0,0,1,1,1,1,0,0,0),
- array(0,1,0,0,0,0,1,0,0),
- array(1,0,0,0,0,0,0,1,0),
- array(1,0,0,0,0,0,0,1,0),
- array(1,0,0,0,0,0,0,1,0),
- array(1,0,0,0,0,0,0,1,0),
- array(1,0,0,0,1,0,0,1,0),
- array(1,0,0,0,0,1,0,1,0),
- array(0,1,0,0,0,0,1,0,0),
- array(0,0,1,1,1,1,0,1,0),
- array(0,0,0,0,0,0,0,0,1),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- ),
- 'R' => array(
- array(1,1,1,1,1,1,0,0,0),
- array(1,0,0,0,0,0,1,0,0),
- array(1,0,0,0,0,0,0,1,0),
- array(1,0,0,0,0,0,0,1,0),
- array(1,0,0,0,0,0,0,1,0),
- array(1,0,0,0,0,0,1,0,0),
- array(1,1,1,1,1,1,0,0,0),
- array(1,0,1,0,0,0,0,0,0),
- array(1,0,0,1,0,0,0,0,0),
- array(1,0,0,0,1,0,0,0,0),
- array(1,0,0,0,0,1,0,0,0),
- array(1,0,0,0,0,0,1,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- ),
- 'S' => array(
- array(0,0,1,1,1,1,1,1,1),
- array(0,1,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(0,1,0,0,0,0,0,0,0),
- array(0,0,1,1,1,1,1,0,0),
- array(0,0,0,0,0,0,0,1,0),
- array(0,0,0,0,0,0,0,0,1),
- array(0,0,0,0,0,0,0,0,1),
- array(0,0,0,0,0,0,0,1,0),
- array(1,1,1,1,1,1,1,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- ),
- 'T' => array(
- array(1,1,1,1,1,1,1,1,1),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- ),
- 'U' => array(
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(0,1,0,0,0,0,0,1,0),
- array(0,0,1,1,1,1,1,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- ),
- 'V' => array(
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(0,1,0,0,0,0,0,1,0),
- array(0,0,1,0,0,0,1,0,0),
- array(0,0,0,1,0,1,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- ),
- 'W' => array(
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,1,0,0,0,1),
- array(1,0,0,1,0,1,0,0,1),
- array(1,0,1,0,0,0,1,0,1),
- array(1,1,0,0,0,0,0,1,1),
- array(1,0,0,0,0,0,0,0,1),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- ),
- 'X' => array(
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(0,1,0,0,0,0,0,1,0),
- array(0,0,1,0,0,0,1,0,0),
- array(0,0,0,1,0,1,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,1,0,1,0,0,0),
- array(0,0,1,0,0,0,1,0,0),
- array(0,1,0,0,0,0,0,1,0),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- ),
- 'Y' => array(
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(0,1,0,0,0,0,0,1,0),
- array(0,0,1,0,0,0,1,0,0),
- array(0,0,0,1,0,1,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- ),
- 'Z' => array(
- array(1,1,1,1,1,1,1,1,1),
- array(1,0,0,0,0,0,0,0,1),
- array(0,0,0,0,0,0,0,1,0),
- array(0,0,0,0,0,0,1,0,0),
- array(0,0,0,0,0,1,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,1,0,0,0,0,0),
- array(0,0,1,0,0,0,0,0,0),
- array(0,1,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,1),
- array(1,1,1,1,1,1,1,1,1),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- ),
- '1' => array(
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,1,1,0,0,0,0),
- array(0,0,1,0,1,0,0,0,0),
- array(0,1,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,1,1,1,1,1,1,1,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- ),
- '2' => array(
- array(0,0,0,1,1,1,0,0,0),
- array(0,0,1,0,0,0,1,0,0),
- array(0,1,0,0,0,0,0,1,0),
- array(0,0,0,0,0,0,0,0,1),
- array(0,0,0,0,0,0,0,0,1),
- array(0,0,0,0,0,0,0,0,1),
- array(0,0,0,0,0,0,0,1,0),
- array(0,0,0,0,0,0,1,0,0),
- array(0,0,0,0,0,1,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,1,0,0,0,0,0),
- array(0,0,1,0,0,0,0,0,0),
- array(0,1,1,1,1,1,1,1,1),
- array(0,0,0,0,0,0,0,0,0),
- ),
- '3' => array(
- array(0,0,0,1,1,1,1,0,0),
- array(0,0,1,0,0,0,0,1,0),
- array(0,1,0,0,0,0,0,0,1),
- array(0,0,0,0,0,0,0,0,1),
- array(0,0,0,0,0,0,0,0,1),
- array(0,0,0,0,0,0,0,1,0),
- array(0,0,0,0,0,1,1,0,0),
- array(0,0,0,0,0,0,0,1,0),
- array(0,0,0,0,0,0,0,0,1),
- array(0,0,0,0,0,0,0,0,1),
- array(0,1,0,0,0,0,0,0,1),
- array(0,0,1,0,0,0,0,1,0),
- array(0,0,0,1,1,1,1,0,0),
- array(0,0,0,0,0,0,0,0,0),
- ),
- '4' => array(
- array(0,0,0,0,0,0,0,1,0),
- array(0,0,0,0,0,0,1,1,0),
- array(0,0,0,0,0,1,0,1,0),
- array(0,0,0,0,1,0,0,1,0),
- array(0,0,0,1,0,0,0,1,0),
- array(0,0,1,0,0,0,0,1,0),
- array(0,1,1,1,1,1,1,1,1),
- array(0,0,0,0,0,0,0,1,0),
- array(0,0,0,0,0,0,0,1,0),
- array(0,0,0,0,0,0,0,1,0),
- array(0,0,0,0,0,0,0,1,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- ),
- '5' => array(
- array(1,1,1,1,1,1,1,1,1),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(0,1,0,0,0,0,0,0,0),
- array(0,0,1,1,1,1,1,0,0),
- array(0,0,0,0,0,0,0,1,0),
- array(0,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(0,1,0,0,0,0,0,1,0),
- array(0,0,1,1,1,1,1,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- ),
- '6' => array(
- array(0,0,1,1,1,1,1,0,0),
- array(0,1,0,0,0,0,0,1,0),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,0,0,0,0,0,0),
- array(1,0,0,1,1,1,1,0,0),
- array(1,0,1,0,0,0,0,1,0),
- array(1,1,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(0,1,0,0,0,0,0,1,0),
- array(0,0,1,1,1,1,1,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- ),
- '7' => array(
- array(1,1,1,1,1,1,1,1,1),
- array(1,0,0,0,0,0,0,0,1),
- array(0,0,0,0,0,0,0,1,0),
- array(0,0,0,0,0,0,1,0,0),
- array(0,0,0,0,0,1,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,1,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- ),
- '8' => array(
- array(0,0,1,1,1,1,1,0,0),
- array(0,1,0,0,0,0,0,1,0),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(0,1,0,0,0,0,0,1,0),
- array(0,0,1,1,1,1,1,0,0),
- array(0,1,0,0,0,0,0,1,0),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(1,0,0,0,0,0,0,0,1),
- array(0,1,0,0,0,0,0,1,0),
- array(0,0,1,1,1,1,1,0,0),
- array(0,0,0,0,0,0,0,0,0),
- ),
- '9' => array(
- array(0,0,0,1,1,1,1,0,0),
- array(0,0,1,0,0,0,0,1,0),
- array(0,1,0,0,0,0,0,0,1),
- array(0,1,0,0,0,0,0,0,1),
- array(0,1,0,0,0,0,0,0,1),
- array(0,1,0,0,0,0,0,1,1),
- array(0,0,1,1,1,1,1,0,1),
- array(0,0,0,0,0,0,0,0,1),
- array(0,0,0,0,0,0,0,0,1),
- array(0,1,0,0,0,0,0,0,1),
- array(0,0,1,0,0,0,0,1,0),
- array(0,0,0,1,1,1,1,0,0),
- array(0,0,0,0,0,0,0,0,0),
- array(0,0,0,0,0,0,0,0,0),
- ),
- )
- );
- }
-}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/captcha/captcha_non_gd.php b/phpBB/includes/captcha/captcha_non_gd.php
deleted file mode 100644
index 2adf909b96..0000000000
--- a/phpBB/includes/captcha/captcha_non_gd.php
+++ /dev/null
@@ -1,392 +0,0 @@
-<?php
-/**
-*
-* @package VC
-* @version $Id$
-* @copyright (c) 2006 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
-*
-*/
-
-/**
-* @ignore
-*/
-if (!defined('IN_PHPBB'))
-{
- exit;
-}
-
-/**
-* Main non-gd captcha class
-* @ignore
-* @package VC
-*/
-class captcha
-{
- var $filtered_pngs;
- var $width = 320;
- var $height = 50;
-
- /**
- * Define filtered pngs on init
- */
- function captcha()
- {
- // If we can we will generate a single filtered png, we avoid nastiness via emulation of some Zlib stuff
- $this->define_filtered_pngs();
- }
-
- /**
- * Create the image containing $code with a seed of $seed
- */
- function execute($code, $seed)
- {
- $img_height = $this->height - 10;
- $img_width = 0;
-
- mt_srand($seed);
-
- $char_widths = $hold_chars = array();
- $code_len = strlen($code);
-
- for ($i = 0; $i < $code_len; $i++)
- {
- $char = $code[$i];
-
- $width = mt_rand(0, 4);
- $raw_width = $this->filtered_pngs[$char]['width'];
- $char_widths[$i] = $width;
- $img_width += $raw_width - $width;
-
- // Split the char into chunks of $raw_width + 1 length
- if (empty($hold_chars[$char]))
- {
- $hold_chars[$char] = str_split(base64_decode($this->filtered_pngs[$char]['data']), $raw_width + 1);
- }
- }
-
- $offset_x = mt_rand(0, $this->width - $img_width);
- $offset_y = mt_rand(0, $this->height - $img_height);
-
- $image = '';
- for ($i = 0; $i < $this->height; $i++)
- {
- $image .= chr(0);
-
- if ($i > $offset_y && $i < $offset_y + $img_height)
- {
- for ($j = 0; $j < $offset_x; $j++)
- {
- $image .= chr(mt_rand(140, 255));
- }
-
- for ($j = 0; $j < $code_len; $j++)
- {
- $image .= $this->randomise(substr($hold_chars[$code{$j}][$i - $offset_y - 1], 1), $char_widths[$j]);
- }
-
- for ($j = $offset_x + $img_width; $j < $this->width; $j++)
- {
- $image .= chr(mt_rand(140, 255));
- }
- }
- else
- {
- for ($j = 0; $j < $this->width; $j++)
- {
- $image .= chr(mt_rand(140, 255));
- }
- }
- }
- unset($hold_chars);
-
- $image = $this->create_png($image, $this->width, $this->height);
-
- // Output image
- header('Content-Type: image/png');
- header('Cache-control: no-cache, no-store');
- echo $image;
- exit;
- }
-
- /**
- * This is designed to randomise the pixels of the image data within
- * certain limits so as to keep it readable. It also varies the image
- * width a little
- */
- function randomise($scanline, $width)
- {
- $new_line = '';
-
- $end = strlen($scanline) - ceil($width/2);
- for ($i = (int) floor($width / 2); $i < $end; $i++)
- {
- $pixel = ord($scanline{$i});
-
- if ($pixel < 190)
- {
- $new_line .= chr(mt_rand(0, 205));
- }
- else if ($pixel > 190)
- {
- $new_line .= chr(mt_rand(145, 255));
- }
- else
- {
- $new_line .= $scanline{$i};
- }
- }
-
- return $new_line;
- }
-
- /**
- * This creates a chunk of the given type, with the given data
- * of the given length adding the relevant crc
- */
- function png_chunk($length, $type, $data)
- {
- $raw = $type . $data;
-
- return pack('N', $length) . $raw . pack('N', crc32($raw));
- }
-
- /**
- * Creates greyscale 8bit png - The PNG spec can be found at
- * http://www.libpng.org/pub/png/spec/PNG-Contents.html we use
- * png because it's a fully recognised open standard and supported
- * by practically all modern browsers and OSs
- */
- function create_png($raw_image, $width, $height)
- {
- // SIG
- $image = pack('C8', 137, 80, 78, 71, 13, 10, 26, 10);
-
- // IHDR
- $raw = pack('N2', $width, $height);
- $raw .= pack('C5', 8, 0, 0, 0, 0);
- $image .= $this->png_chunk(13, 'IHDR', $raw);
-
- // IDAT
- if (@extension_loaded('zlib'))
- {
- $raw_image = gzcompress($raw_image);
- $length = strlen($raw_image);
- }
- else
- {
- // The total length of this image, uncompressed, is just a calculation of pixels
- $length = ($width + 1) * $height;
-
- // Adler-32 hash generation
- // Note: The hash is _backwards_ so we must reverse it
-
- if (@extension_loaded('hash'))
- {
- $adler_hash = strrev(hash('adler32', $raw_image, true));
- }
- else if (@extension_loaded('mhash'))
- {
- $adler_hash = strrev(mhash(MHASH_ADLER32, $raw_image));
- }
- else
- {
- // Optimized Adler-32 loop ported from the GNU Classpath project
- $temp_length = $length;
- $s1 = 1;
- $s2 = $index = 0;
-
- while ($temp_length > 0)
- {
- // We can defer the modulo operation:
- // s1 maximally grows from 65521 to 65521 + 255 * 3800
- // s2 maximally grows by 3800 * median(s1) = 2090079800 < 2^31
- $substract_value = ($temp_length < 3800) ? $temp_length : 3800;
- $temp_length -= $substract_value;
-
- while (--$substract_value >= 0)
- {
- $s1 += ord($raw_image[$index]);
- $s2 += $s1;
-
- $index++;
- }
-
- $s1 %= 65521;
- $s2 %= 65521;
- }
- $adler_hash = pack('N', ($s2 << 16) | $s1);
- }
-
- // This is the same thing as gzcompress($raw_image, 0) but does not need zlib
- $raw_image = pack('C3v2', 0x78, 0x01, 0x01, $length, ~$length) . $raw_image . $adler_hash;
-
- // The Zlib header + Adler hash make us add on 11
- $length += 11;
- }
-
- // IDAT
- $image .= $this->png_chunk($length, 'IDAT', $raw_image);
-
- // IEND
- $image .= $this->png_chunk(0, 'IEND', '');
-
- return $image;
- }
-
- /**
- * png image data
- * Each 'data' element is base64_encoded uncompressed IDAT
- */
- function define_filtered_pngs()
- {
- $this->filtered_pngs = array(
- '0' => array(
- 'data' => 'AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A///////////////////olFAkBAAAGDyA4P///M31/////////////wD////////////////0dAgAAAAAAAAAAAAEcPipFGHn////////////AP//////////////6DAAAAAAAAAAAAAAAAAALSEAN+T///////////8A//////////////xAAAAAAAAAAAAAAAAAAAAAACPA/////////////wD/////////////oAAAAAAAAAAAAAAAAAAAAAAAev//////////////AP////////////8oAAAAAAAAPNj/zDAAAAAAAABD//////////////8A////////////1AAAAAAAABjw////5BAAAAAAAADo/////////////wD///////////+QAAAAAAAAbP//////QgAAAAAAAKj/////////////AP///////////1wAAAAAAACs/////8AXAAAAAAAAcP////////////8A////////////OAAAAAAAAND////dNwAAAAAAAABI/////////////wD///////////8gAAAAAAAA4P//7koACwAAAAAAACT/////////////AP///////////wgAAAAAAAD///VqAwaPAAAAAAAAEP////////////8A////////////AAAAAAAAAP/8kQYDavUAAAAAAAAA/////////////wD///////////8AAAAAAAAA/6kNAEru/wAAAAAAAAD/////////////AP///////////wAAAAAAAADAIwA33f//AAAAAAAAAP////////////8A////////////FAAAAAAAADYAI8D///8AAAAAAAAQ/////////////wD///////////8kAAAAAAAAAA2p////5AAAAAAAACD/////////////AP///////////0gAAAAAAAAFkfz////UAAAAAAAAQP////////////8A////////////cAAAAAAAAET1/////7AAAAAAAABo/////////////wD///////////+oAAAAAAAAXfX/////sAAAAAAAAGj/////////////AAAAALgAAAAAAAAwAAAAAAAAAAAAAAD////////////oAAAAAAAACOT////oEAAAAAAAAOD/////////////AP////////////8+AAAAAAAAKMz/zDQAAAAAAAA0//////////////8A////////////7jgAAAAAAAAAAAAAAAAAAAAAAKT//////////////wD///////////VqAwIAAAAAAAAAAAAAAAAAAAA8////////////////AP//////////rQcDaVEAAAAAAAAAAAAAAAAAKOj///////////////8A///////////nblnu/IAIAAAAAAAAAAAAAFzw/////////////////wD////////////79////+iITCAAAAAgSITg////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////w==',
- 'width' => 40
- ),
- '1' => array(
- 'data' => 'AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////8BAAAAAAAP//////////////////AP////////////////////////9sAAAAAAAA//////////////////8A////////////////////////pAAAAAAAAAD//////////////////wD//////////////////////6wEAAAAAAAAAP//////////////////AP////////////////////h4AAAAAAAAAAAA//////////////////8A//////////////////ygJAAAAAAAAAAAAAD//////////////////wD//////////////9x8HAAAAAAAAAAAAAAAAP//////////////////AP//////////////AAAAAAAAAAAAAAAAAAAA//////////////////8A//////////////8AAAAAAAAAAAAAAAAAAAD//////////////////wD//////////////wAAAAAAAAR4AAAAAAAAAP//////////////////AP//////////////AAAAAAA4zP8AAAAAAAAA//////////////////8A//////////////8AAAA4sP///wAAAAAAAAD//////////////////wD//////////////yR80P//////AAAAAAAAAP//////////////////AP////////////////////////8AAAAAAAAA//////////////////8A/////////////////////////wAAAAAAAAD//////////////////wD/////////////////////////AAAAAAAAAP//////////////////AP////////////////////////8AAAAAAAAA//////////////////8A/////////////////////////wAAAAAAAAD//////////////////wD/////////////////////////AAAAAAAAAP//////////////////AP////////////////////////8AAAAAAAAA//////////////////8A/////////////////////////wAAAAAAAAD//////////////////wD/////////////////////////AAAAAAAAAP//////////////////AP////////////////////////8AAAAAAAAA//////////////////8A/////////////////////////wAAAAAAAAD//////////////////wD/////////////////////////AAAAAAAAAP//////////////////AP////////////////////////8AAAAAAAAA//////////////////8A/////////////////////////wAAAAAAAAD//////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8=',
- 'width' => 40
- ),
- '2' => array(
- 'data' => 'AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP/////////////////okFAkCAAABCBIfNT///////////////////8A///////////////8hAgAAAAAAAAAAAAAAFTo/////////////////wD//////////////1QAAAAAAAAAAAAAAAAAACjo////////////////AP////////////+MAAAAAAAAAAAAAAAAAAAAADj///////////////8A////////////9BAAAAAAAAAAAAAAAAAAAAAAALD//////////////wD///////////+gAAAAAAAAAHjs+KwMAAAAAAAAVP//////////////AP///////////1gAAAAAAABM/////6QAAAAAAAAU//////////////8A////////////KAAAAAAAALj/////+AAAAAAAAAD//////////////wD///////////+MfGBMOCAI8P/////wAAAAAAAACP//////////////AP///////////////////////////5wAAAAAAAAw//////////////8A///////////////////////////oFAAAAAAAAHz//////////////wD/////////////////////////6CgAAAAAAAAE3P//////////////AP///////////////////////9ggAAAAAAAAAHT///////////////8A//////////////////////+0DAAAAAAAAAA8+P///////////////wD/////////////////////gAAAAAAAAAAAKOj/////////////////AP//////////////////9FAAAAAAAAAAADzw//////////////////8A/////////////////+g4AAAAAAAAAABk/P///////////////////wD////////////////oKAAAAAAAAAAMqP//////////////////////AP//////////////6CgAAAAAAAAAMNz///////////////////////8A//////////////g4AAAAAAAAAFT0/////////////////////////wD/////////////bAAAAAAAAABU/P//////////////////////////AP///////////8wAAAAAAAAAAAAAAAAAAAAAAAAA//////////////8A////////////SAAAAAAAAAAAAAAAAAAAAAAAAAD//////////////wD//////////9wAAAAAAAAAAAAAAAAAAAAAAAAAAP//////////////AP//////////hAAAAAAAAAAAAAAAAAAAAAAAAAAA//////////////8A//////////9AAAAAAAAAAAAAAAAAAAAAAAAAAAD//////////////wD//////////xAAAAAAAAAAAAAAAAAAAAAAAAAAAP//////////////AP////////////////////////////////////////////////////8=',
- 'width' => 40
- ),
- '3' => array(
- 'data' => 'AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD////////////////8sGg0FAAAACA4cLz8////////////////////AP//////////////rBgAAAAAAAAAAAAAACTA//////////////////8A/////////////3QAAAAAAAAAAAAAAAAAAASs/////////////////wD///////////+YAAAAAAAAAAAAAAAAAAAAAAjc////////////////AP//////////6AwAAAAAAAAAAAAAAAAAAAAAAGT///////////////8A//////////94AAAAAAAABJDw/8g4AAAAAAAAHP///////////////wD//////////yAAAAAAAACE/////9gAAAAAAAAA////////////////AP///////////NSwiGQ4FOT//////AAAAAAAABD///////////////8A//////////////////////////+YAAAAAAAAVP///////////////wD//////////////////////P/ggAQAAAAAAATM////////////////AP////////////////////9gAAAAAAAAAAAElP////////////////8A/////////////////////0AAAAAAAAAAHLj//////////////////wD/////////////////////OAAAAAAAAAAwkPj/////////////////AP////////////////////8gAAAAAAAAAAAAINj///////////////8A/////////////////////xAAAAAAAAAAAAAAIPD//////////////wD/////////////////////uOz/4HgEAAAAAAAAhP//////////////AP///////////////////////////3wAAAAAAAAw//////////////8A////////////////////////////6AAAAAAAAAj//////////////wD/////////////////////////////AAAAAAAAAP//////////////AP//////////tJh8YEQoDNz//////+AAAAAAAAAY//////////////8A//////////88AAAAAAAAaP//////dAAAAAAAAEz//////////////wD//////////6QAAAAAAAAAdOD/5HQAAAAAAAAApP//////////////AP///////////CgAAAAAAAAAAAAAAAAAAAAAACD4//////////////8A////////////yAQAAAAAAAAAAAAAAAAAAAAEuP///////////////wD/////////////rAQAAAAAAAAAAAAAAAAABJD/////////////////AP//////////////zDQAAAAAAAAAAAAAACTA//////////////////8A/////////////////8BwOCAAAAAUNGi0/P///////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8=',
- 'width' => 40
- ),
- '4' => array(
- 'data' => 'AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP//////////////////////////nAAAAAAAAAD///////////////8A/////////////////////////8AEAAAAAAAAAP///////////////wD////////////////////////gGAAAAAAAAAAA////////////////AP//////////////////////9DAAAAAAAAAAAAD///////////////8A//////////////////////9UAAAAAAAAAAAAAP///////////////wD/////////////////////hAAAAAAAAAAAAAAA////////////////AP///////////////////7QAAAAAAAAAAAAAAAD///////////////8A///////////////////UDAAAAAAUAAAAAAAAAP///////////////wD/////////////////7CQAAAAABMAAAAAAAAAA////////////////AP////////////////xEAAAAAACU/wAAAAAAAAD///////////////8A////////////////cAAAAAAAZP//AAAAAAAAAP///////////////wD//////////////6AAAAAAADz8//8AAAAAAAAA////////////////AP/////////////IBAAAAAAc6P///wAAAAAAAAD///////////////8A////////////5BgAAAAADMz/////AAAAAAAAAP///////////////wD///////////g0AAAAAACk//////8AAAAAAAAA////////////////AP//////////XAAAAAAAfP///////wAAAAAAAAD///////////////8A//////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///////////wD//////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////////AP//////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///////////8A//////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///////////wD//////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////////AP//////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///////////8A////////////////////////////AAAAAAAAAP///////////////wD///////////////////////////8AAAAAAAAA////////////////AP///////////////////////////wAAAAAAAAD///////////////8A////////////////////////////AAAAAAAAAP///////////////wD///////////////////////////8AAAAAAAAA////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8=',
- 'width' => 40
- ),
- '5' => array(
- 'data' => 'AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP//////////////8AAAAAAAAAAAAAAAAAAAAAAA//////////////8A///////////////MAAAAAAAAAAAAAAAAAAAAAAD//////////////wD//////////////6wAAAAAAAAAAAAAAAAAAAAAAP//////////////AP//////////////iAAAAAAAAAAAAAAAAAAAAAAA//////////////8A//////////////9kAAAAAAAAAAAAAAAAAAAAAAD//////////////wD//////////////0QAAAAAAAAAAAAAAAAAAAAAAP//////////////AP//////////////IAAAAAAAYP////////////////////////////8A//////////////wAAAAAAAB8/////////////////////////////wD/////////////3AAAAAAAAIj/////////////////////////////AP////////////+4AAAAAAAAoLRYHAAEKGTE//////////////////8A/////////////5QAAAAAAAAQAAAAAAAAAABY9P///////////////wD/////////////dAAAAAAAAAAAAAAAAAAAAAA89P//////////////AP////////////9QAAAAAAAAAAAAAAAAAAAAAABg//////////////8A/////////////zAAAAAAAAAAAAAAAAAAAAAAAADQ/////////////wD/////////////IAAAAAAAAGjY/+h4BAAAAAAAAGz/////////////AP//////////////9NS0lHSc//////90AAAAAAAALP////////////8A/////////////////////////////9QAAAAAAAAE/////////////wD//////////////////////////////wAAAAAAAAD/////////////AP/////////////////////////////8AAAAAAAAEP////////////8A////////////pIRwWEAgDOD//////8wAAAAAAAA8/////////////wD///////////9EAAAAAAAAaP//////ZAAAAAAAAHz/////////////AP///////////6QAAAAAAAAAaOD/4GQAAAAAAAAE4P////////////8A/////////////CQAAAAAAAAAAAAAAAAAAAAAAGD//////////////wD/////////////yAQAAAAAAAAAAAAAAAAAAAAc7P//////////////AP//////////////rAwAAAAAAAAAAAAAAAAAGNj///////////////8A////////////////0EAAAAAAAAAAAAAAAFTo/////////////////wD//////////////////8h4QCAAAAAcQHzU////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8=',
- 'width' => 40
- ),
- '6' => array(
- 'data' => 'AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD///////////////////+0ZCwMAAAUNGjI////////////////////AP/////////////////EMAAAAAAAAAAAAABM6P////////////////8A////////////////lAQAAAAAAAAAAAAAAAAo6P///////////////wD//////////////6wAAAAAAAAAAAAAAAAAAABI////////////////AP/////////////oEAAAAAAAAAAAAAAAAAAAAACw//////////////8A/////////////3AAAAAAAAAoxP/YPAAAAAAAAEj//////////////wD////////////4EAAAAAAACOD////YDCBAVGiAoP//////////////AP///////////7gAAAAAAABY//////////////////////////////8A////////////eAAAAAAAAJT//////////////////////////////wD///////////9MAAAAAAAAvP/IXBgABCx03P//////////////////AP///////////ygAAAAAAADcdAAAAAAAAAAEiP////////////////8A////////////FAAAAAAAAFAAAAAAAAAAAAAAcP///////////////wD///////////8AAAAAAAAAAAAAAAAAAAAAAAAAlP//////////////AP///////////wAAAAAAAAAAAAAAAAAAAAAAAAAQ8P////////////8A////////////AAAAAAAAAABAyP/kZAAAAAAAAACQ/////////////wD///////////8MAAAAAAAALPj/////WAAAAAAAAET/////////////AP///////////yQAAAAAAACY///////MAAAAAAAAFP////////////8A////////////SAAAAAAAAMD///////wAAAAAAAAA/////////////wD///////////9wAAAAAAAAvP///////wAAAAAAAAD/////////////AP///////////7QAAAAAAACI///////UAAAAAAAAJP////////////8A////////////+AwAAAAAACDw/////2wAAAAAAABY/////////////wD/////////////cAAAAAAAADC8/Ox4AAAAAAAAAKj/////////////AP/////////////oEAAAAAAAAAAAAAAAAAAAAAAk/P////////////8A//////////////+oAAAAAAAAAAAAAAAAAAAABLj//////////////wD///////////////+QAAAAAAAAAAAAAAAAAACQ////////////////AP////////////////+0JAAAAAAAAAAAAAAkuP////////////////8A///////////////////8sGg0FAAADCxgqPz//////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8=',
- 'width' => 40
- ),
- '7' => array(
- 'data' => 'AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD///////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////AP///////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAP////////////8A////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////wD///////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////AP///////////wAAAAAAAAAAAAAAAAAAAAAAAAAABP////////////8A////////////AAAAAAAAAAAAAAAAAAAAAAAAAAy4/////////////wD//////////////////////////+QUAAAAAAAEuP//////////////AP/////////////////////////8QAAAAAAAAKT///////////////8A/////////////////////////4wAAAAAAAB0/////////////////wD////////////////////////cCAAAAAAANPz/////////////////AP///////////////////////0QAAAAAAATY//////////////////8A//////////////////////+0AAAAAAAAeP///////////////////wD//////////////////////CQAAAAAABTw////////////////////AP////////////////////+gAAAAAAAAkP////////////////////8A/////////////////////ywAAAAAABDw/////////////////////wD///////////////////+4AAAAAAAAbP//////////////////////AP///////////////////1wAAAAAAADQ//////////////////////8A///////////////////4DAAAAAAAMP///////////////////////wD//////////////////7QAAAAAAAB8////////////////////////AP//////////////////aAAAAAAAAMj///////////////////////8A//////////////////8oAAAAAAAM/P///////////////////////wD/////////////////8AAAAAAAAET/////////////////////////AP////////////////+0AAAAAAAAcP////////////////////////8A/////////////////4wAAAAAAACY/////////////////////////wD/////////////////WAAAAAAAAMD/////////////////////////AP////////////////80AAAAAAAA4P////////////////////////8A/////////////////xAAAAAAAAD4/////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8=',
- 'width' => 40
- ),
- '8' => array(
- 'data' => 'AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD////////////////////IdDQUAAAEIEiA1P//////////////////AP/////////////////gRAAAAAAAAAAAAAAAROD///////////////8A////////////////0BgAAAAAAAAAAAAAAAAAEMj//////////////wD///////////////AcAAAAAAAAAAAAAAAAAAAAHPD/////////////AP//////////////hAAAAAAAAAAAAAAAAAAAAAAAhP////////////8A//////////////8sAAAAAAAAKMz/zCgAAAAAAAAs/////////////wD//////////////wAAAAAAAADM////zAAAAAAAAAD/////////////AP//////////////BAAAAAAAAP//////AAAAAAAABP////////////8A//////////////8sAAAAAAAAzP///9QAAAAAAAAw/////////////wD//////////////3wAAAAAAAAoyP/YNAAAAAAAAIT/////////////AP//////////////7BgAAAAAAAAAAAAAAAAAAAAc8P////////////8A////////////////xBgAAAAAAAAAAAAAAAAAGNj//////////////wD/////////////////tAQAAAAAAAAAAAAAAACo////////////////AP///////////////HAAAAAAAAAAAAAAAAAAAAB8//////////////8A//////////////9gAAAAAAAAAAAAAAAAAAAAAAB8/////////////wD/////////////wAAAAAAAAABk4P/UWAAAAAAAAATQ////////////AP////////////9UAAAAAAAAaP//////XAAAAAAAAGT///////////8A/////////////xgAAAAAAADg///////cAAAAAAAAJP///////////wD/////////////AAAAAAAAAP////////8AAAAAAAAA////////////AP////////////8AAAAAAAAA4P//////3AAAAAAAAAT///////////8A/////////////ygAAAAAAABg//////9cAAAAAAAALP///////////wD/////////////ZAAAAAAAAABY1P/cXAAAAAAAAABw////////////AP/////////////QAAAAAAAAAAAAAAAAAAAAAAAABNz///////////8A//////////////9gAAAAAAAAAAAAAAAAAAAAAAB0/////////////wD///////////////Q8AAAAAAAAAAAAAAAAAAAAUPz/////////////AP////////////////x4CAAAAAAAAAAAAAAAEIT8//////////////8A///////////////////smFQwGAAAABg0ZKT0/////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8=',
- 'width' => 40
- ),
- '9' => array(
- 'data' => 'AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD///////////////////ysYCwMAAAUNGiw/P//////////////////AP////////////////+4JAAAAAAAAAAAAAAkuP////////////////8A////////////////lAQAAAAAAAAAAAAAAAAAkP///////////////wD//////////////8AEAAAAAAAAAAAAAAAAAAAAqP//////////////AP/////////////8JAAAAAAAAAAAAAAAAAAAAAAQ7P////////////8A/////////////6wAAAAAAAAAfOz8vCwAAAAAAABw/////////////wD/////////////WAAAAAAAAHD/////7BgAAAAAAAz4////////////AP////////////8kAAAAAAAA1P//////hAAAAAAAALT///////////8A/////////////wAAAAAAAAD///////+4AAAAAAAAcP///////////wD/////////////AAAAAAAAAPz//////8AAAAAAAABI////////////AP////////////8UAAAAAAAAzP//////lAAAAAAAACT///////////8A/////////////0QAAAAAAABY//////gsAAAAAAAADP///////////wD/////////////kAAAAAAAAABw5P/IPAAAAAAAAAAA////////////AP/////////////wEAAAAAAAAAAAAAAAAAAAAAAAAAD///////////8A//////////////+UAAAAAAAAAAAAAAAAAAAAAAAAAP///////////wD///////////////9wAAAAAAAAAAAAAFAAAAAAAAAU////////////AP////////////////+IBAAAAAAAAABw3AAAAAAAACj///////////8A///////////////////cdCwEABhcxP+8AAAAAAAATP///////////wD//////////////////////////////5AAAAAAAAB4////////////AP//////////////////////////////UAAAAAAAALj///////////8A//////////////+kgGxUQCAM2P///+AIAAAAAAAQ+P///////////wD//////////////0gAAAAAAAA42P/EKAAAAAAAAHD/////////////AP//////////////sAAAAAAAAAAAAAAAAAAAAAAQ6P////////////8A////////////////TAAAAAAAAAAAAAAAAAAAAKz//////////////wD////////////////oKAAAAAAAAAAAAAAAAASU////////////////AP/////////////////sUAAAAAAAAAAAAAAwxP////////////////8A////////////////////yHA0FAAADCxktP///////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8=',
- 'width' => 40
- ),
- 'A' => array(
- 'data' => 'AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD//////////////////+QAAAAAAAAAAAAAAOT/////////////////AP//////////////////kAAAAAAAAAAAAAAAkP////////////////8A//////////////////88AAAAAAAAAAAAAAA8/////////////////wD/////////////////5AAAAAAAAAAAAAAAAADk////////////////AP////////////////+QAAAAAAAAAAAAAAAAAJD///////////////8A/////////////////zwAAAAAAAAAAAAAAAAAPP///////////////wD////////////////kAAAAAAAAAAgAAAAAAAAA5P//////////////AP///////////////5AAAAAAAAAAgAAAAAAAAACQ//////////////8A////////////////PAAAAAAAAAz8HAAAAAAAADz//////////////wD//////////////+QAAAAAAAAAWP9kAAAAAAAAANz/////////////AP//////////////kAAAAAAAAACk/7wAAAAAAAAAhP////////////8A//////////////88AAAAAAAABOz//BQAAAAAAAAw/////////////wD/////////////4AAAAAAAAAA8////ZAAAAAAAAADc////////////AP////////////+EAAAAAAAAAIj///+8AAAAAAAAAIT///////////8A/////////////zAAAAAAAAAA2P////wQAAAAAAAAMP///////////wD////////////cAAAAAAAAACT//////1wAAAAAAAAA3P//////////AP///////////4QAAAAAAAAAAAAAAAAAAAAAAAAAAACE//////////8A////////////MAAAAAAAAAAAAAAAAAAAAAAAAAAAADD//////////wD//////////9wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAANz/////////AP//////////hAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAhP////////8A//////////8wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAw/////////wD/////////3AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADc////////AP////////+EAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIT///////8A/////////zAAAAAAAAAAhP///////////2QAAAAAAAAAMP///////wD////////cAAAAAAAAAADM////////////vAAAAAAAAAAA3P//////AP///////4QAAAAAAAAAHP/////////////4DAAAAAAAAACE//////8A////////MAAAAAAAAABk//////////////9cAAAAAAAAADD//////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8=',
- 'width' => 40
- ),
- 'B' => array(
- 'data' => 'AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A//////////8AAAAAAAAAAAAAAAAAAAAAEDh83P///////////////wD//////////wAAAAAAAAAAAAAAAAAAAAAAAAAEhP//////////////AP//////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAeP////////////8A//////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAxP///////////wD//////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAABY////////////AP//////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAABT///////////8A//////////8AAAAAAAAAAP/////4zEwAAAAAAAAAAP///////////wD//////////wAAAAAAAAAA////////7AAAAAAAAAAQ////////////AP//////////AAAAAAAAAAD////////sAAAAAAAAAEj///////////8A//////////8AAAAAAAAAAP/////4zEQAAAAAAAAAtP///////////wD//////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAFz/////////////AP//////////AAAAAAAAAAAAAAAAAAAAAAAAAAiA/P////////////8A//////////8AAAAAAAAAAAAAAAAAAAAAAAAIjPj//////////////wD//////////wAAAAAAAAAAAAAAAAAAAAAAAAAAGKz/////////////AP//////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAJT///////////8A//////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAABNz//////////wD//////////wAAAAAAAAAA///////sqCAAAAAAAAAAbP//////////AP//////////AAAAAAAAAAD/////////yAAAAAAAAAAs//////////8A//////////8AAAAAAAAAAP//////////AAAAAAAAAAT//////////wD//////////wAAAAAAAAAA/////////7wAAAAAAAAAAP//////////AP//////////AAAAAAAAAAD//////+ikGAAAAAAAAAAY//////////8A//////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFT//////////wD//////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAsP//////////AP//////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAADj///////////8A//////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAc6P///////////wD//////////wAAAAAAAAAAAAAAAAAAAAAAAAAATOj/////////////AP//////////AAAAAAAAAAAAAAAAAAAEIEBkkNj///////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8=',
- 'width' => 40
- ),
- 'C' => array(
- 'data' => 'AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP//////////////////5JRULBAAAAgkTIDQ//////////////////8A////////////////1FAAAAAAAAAAAAAAAABAyP///////////////wD//////////////4gEAAAAAAAAAAAAAAAAAAAElP//////////////AP////////////9wAAAAAAAAAAAAAAAAAAAAAAAAlP////////////8A////////////kAAAAAAAAAAAAAAAAAAAAAAAAAAEyP///////////wD//////////9wIAAAAAAAAAAAAAAAAAAAAAAAAAAAw////////////AP//////////WAAAAAAAAAAAWMz/8JwQAAAAAAAAAACw//////////8A/////////+wEAAAAAAAAAID//////9QMAAAAAAAAAET//////////wD/////////nAAAAAAAAAAo/P///////3wAAAAABDBspP//////////AP////////9gAAAAAAAAAIz/////////3BxQjMT0//////////////8A/////////zQAAAAAAAAAzP///////////////////////////////wD/////////GAAAAAAAAADo////////////////////////////////AP////////8AAAAAAAAAAP////////////////////////////////8A/////////wAAAAAAAAAA/////////////////////////////////wD/////////AAAAAAAAAAD/////////////////////////////////AP////////8cAAAAAAAAAOj///////////////////////////////8A/////////zgAAAAAAAAA0P/////////kIGio7P///////////////wD/////////bAAAAAAAAACg/////////5wAAAAAMHS49P//////////AP////////+oAAAAAAAAAEz/////////PAAAAAAAAAAc//////////8A//////////QIAAAAAAAAALz//////6QAAAAAAAAAAGT//////////wD//////////3AAAAAAAAAADIzo/+SEBAAAAAAAAAAAyP//////////AP//////////7BAAAAAAAAAAAAAAAAAAAAAAAAAAAED///////////8A////////////rAAAAAAAAAAAAAAAAAAAAAAAAAAE0P///////////wD/////////////fAAAAAAAAAAAAAAAAAAAAAAAAJz/////////////AP//////////////iAQAAAAAAAAAAAAAAAAAAASY//////////////8A////////////////yEAAAAAAAAAAAAAAAAA8yP///////////////wD//////////////////9yIUCwQAAAAIEB4yP//////////////////AP////////////////////////////////////////////////////8=',
- 'width' => 40
- ),
- 'D' => array(
- 'data' => 'AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD///////////8AAAAAAAAAAAAAAAAADChQkOT/////////////////AP///////////wAAAAAAAAAAAAAAAAAAAAAABGjw//////////////8A////////////AAAAAAAAAAAAAAAAAAAAAAAAACDY/////////////wD///////////8AAAAAAAAAAAAAAAAAAAAAAAAAABjk////////////AP///////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAED///////////8A////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAKj//////////wD///////////8AAAAAAAAAAP///+isSAAAAAAAAAAANP//////////AP///////////wAAAAAAAAAA////////hAAAAAAAAAAA2P////////8A////////////AAAAAAAAAAD/////////MAAAAAAAAACQ/////////wD///////////8AAAAAAAAAAP////////+MAAAAAAAAAFj/////////AP///////////wAAAAAAAAAA/////////8gAAAAAAAAAMP////////8A////////////AAAAAAAAAAD/////////5AAAAAAAAAAY/////////wD///////////8AAAAAAAAAAP//////////AAAAAAAAAAD/////////AP///////////wAAAAAAAAAA//////////8AAAAAAAAAAP////////8A////////////AAAAAAAAAAD//////////wAAAAAAAAAA/////////wD///////////8AAAAAAAAAAP/////////wAAAAAAAAABD/////////AP///////////wAAAAAAAAAA/////////9QAAAAAAAAAJP////////8A////////////AAAAAAAAAAD/////////qAAAAAAAAABI/////////wD///////////8AAAAAAAAAAP////////9QAAAAAAAAAHj/////////AP///////////wAAAAAAAAAA////////uAAAAAAAAAAAvP////////8A////////////AAAAAAAAAAD////w0HwEAAAAAAAAACT8/////////wD///////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAoP//////////AP///////////wAAAAAAAAAAAAAAAAAAAAAAAAAAADz8//////////8A////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAY6P///////////wD///////////8AAAAAAAAAAAAAAAAAAAAAAAAAKNz/////////////AP///////////wAAAAAAAAAAAAAAAAAAAAAACHT0//////////////8A////////////AAAAAAAAAAAAAAAAABg4bKj0/////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8=',
- 'width' => 40
- ),
- 'E' => array(
- 'data' => 'AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP//////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////////////8A//////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////wD//////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////AP//////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////////////8A//////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////wD//////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////AP//////////AAAAAAAAAAD///////////////////////////////8A//////////8AAAAAAAAAAP///////////////////////////////wD//////////wAAAAAAAAAA////////////////////////////////AP//////////AAAAAAAAAAD///////////////////////////////8A//////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAD//////////////wD//////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAP//////////////AP//////////AAAAAAAAAAAAAAAAAAAAAAAAAAAA//////////////8A//////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAD//////////////wD//////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAP//////////////AP//////////AAAAAAAAAAAAAAAAAAAAAAAAAAAA//////////////8A//////////8AAAAAAAAAAP///////////////////////////////wD//////////wAAAAAAAAAA////////////////////////////////AP//////////AAAAAAAAAAD///////////////////////////////8A//////////8AAAAAAAAAAP///////////////////////////////wD//////////wAAAAAAAAAA////////////////////////////////AP//////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////////////8A//////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////wD//////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////AP//////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////////////8A//////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////wD//////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////AP////////////////////////////////////////////////////8=',
- 'width' => 40
- ),
- 'F' => array(
- 'data' => 'AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////wAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////wD/////////////AAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////AP////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAP////////////8A/////////////wAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////wD/////////////AAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////AP////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAP////////////8A/////////////wAAAAAAAAAA/////////////////////////////wD/////////////AAAAAAAAAAD/////////////////////////////AP////////////8AAAAAAAAAAP////////////////////////////8A/////////////wAAAAAAAAAA/////////////////////////////wD/////////////AAAAAAAAAAAAAAAAAAAAAAAA////////////////AP////////////8AAAAAAAAAAAAAAAAAAAAAAAD///////////////8A/////////////wAAAAAAAAAAAAAAAAAAAAAAAP///////////////wD/////////////AAAAAAAAAAAAAAAAAAAAAAAA////////////////AP////////////8AAAAAAAAAAAAAAAAAAAAAAAD///////////////8A/////////////wAAAAAAAAAAAAAAAAAAAAAAAP///////////////wD/////////////AAAAAAAAAAD/////////////////////////////AP////////////8AAAAAAAAAAP////////////////////////////8A/////////////wAAAAAAAAAA/////////////////////////////wD/////////////AAAAAAAAAAD/////////////////////////////AP////////////8AAAAAAAAAAP////////////////////////////8A/////////////wAAAAAAAAAA/////////////////////////////wD/////////////AAAAAAAAAAD/////////////////////////////AP////////////8AAAAAAAAAAP////////////////////////////8A/////////////wAAAAAAAAAA/////////////////////////////wD/////////////AAAAAAAAAAD/////////////////////////////AP////////////8AAAAAAAAAAP////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8=',
- 'width' => 40
- ),
- 'G' => array(
- 'data' => 'AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD//////////////////MB8TCgQAAAACCA4YJzs////////////////AP///////////////JQcAAAAAAAAAAAAAAAAAAhw8P////////////8A/////////////9gwAAAAAAAAAAAAAAAAAAAAAAAk2P///////////wD////////////EDAAAAAAAAAAAAAAAAAAAAAAAAAAc7P//////////AP//////////2AwAAAAAAAAAAAAAAAAAAAAAAAAAAABY//////////8A//////////wwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADQ/////////wD/////////kAAAAAAAAAAAEHzQ/P/gmCAAAAAAAAAAAFz/////////AP////////wcAAAAAAAAACjg////////8CwAAAAAAAAgWP////////8A////////vAAAAAAAAAAI2P//////////yBRAcJjI8P///////////wD///////94AAAAAAAAAGD/////////////////////////////////AP///////0AAAAAAAAAAsP////////////////////////////////8A////////IAAAAAAAAADc/////////////////////////////////wD///////8AAAAAAAAAAP///////wAAAAAAAAAAAAAAAAD/////////AP///////wAAAAAAAAAA////////AAAAAAAAAAAAAAAAAP////////8A////////AAAAAAAAAAD///////8AAAAAAAAAAAAAAAAA/////////wD///////8gAAAAAAAAAOD//////wAAAAAAAAAAAAAAAAD/////////AP///////0AAAAAAAAAAtP//////AAAAAAAAAAAAAAAAAP////////8A////////cAAAAAAAAABw//////8AAAAAAAAAAAAAAAAA/////////wD///////+8AAAAAAAAABDs////////////AAAAAAAAAAD/////////AP////////wYAAAAAAAAADz0//////////AAAAAAAAAAAP////////8A/////////5AAAAAAAAAAACCY4P//3KhcCAAAAAAAAAAA/////////wD/////////+CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////////AP//////////xAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIP////////8A////////////rAQAAAAAAAAAAAAAAAAAAAAAAAAAAGTw/////////wD/////////////vBQAAAAAAAAAAAAAAAAAAAAAADjI////////////AP//////////////8HAQAAAAAAAAAAAAAAAAAEiw//////////////8A//////////////////iwcEAgBAAABCA4aKDk/////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8=',
- 'width' => 40
- ),
- 'H' => array(
- 'data' => 'AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////8AAAAAAAAAAP///////////wAAAAAAAAAA//////////8A/////////wAAAAAAAAAA////////////AAAAAAAAAAD//////////wD/////////AAAAAAAAAAD///////////8AAAAAAAAAAP//////////AP////////8AAAAAAAAAAP///////////wAAAAAAAAAA//////////8A/////////wAAAAAAAAAA////////////AAAAAAAAAAD//////////wD/////////AAAAAAAAAAD///////////8AAAAAAAAAAP//////////AP////////8AAAAAAAAAAP///////////wAAAAAAAAAA//////////8A/////////wAAAAAAAAAA////////////AAAAAAAAAAD//////////wD/////////AAAAAAAAAAD///////////8AAAAAAAAAAP//////////AP////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//////////8A/////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//////////wD/////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP//////////AP////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//////////8A/////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//////////wD/////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP//////////AP////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//////////8A/////////wAAAAAAAAAA////////////AAAAAAAAAAD//////////wD/////////AAAAAAAAAAD///////////8AAAAAAAAAAP//////////AP////////8AAAAAAAAAAP///////////wAAAAAAAAAA//////////8A/////////wAAAAAAAAAA////////////AAAAAAAAAAD//////////wD/////////AAAAAAAAAAD///////////8AAAAAAAAAAP//////////AP////////8AAAAAAAAAAP///////////wAAAAAAAAAA//////////8A/////////wAAAAAAAAAA////////////AAAAAAAAAAD//////////wD/////////AAAAAAAAAAD///////////8AAAAAAAAAAP//////////AP////////8AAAAAAAAAAP///////////wAAAAAAAAAA//////////8A/////////wAAAAAAAAAA////////////AAAAAAAAAAD//////////wD/////////AAAAAAAAAAD///////////8AAAAAAAAAAP//////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8=',
- 'width' => 40
- ),
- 'I' => array(
- 'data' => 'AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////AAAAAAAAAAAAAAAAAAAAAAAA////////////////AP////////////8AAAAAAAAAAAAAAAAAAAAAAAD///////////////8A/////////////wAAAAAAAAAAAAAAAAAAAAAAAP///////////////wD/////////////AAAAAAAAAAAAAAAAAAAAAAAA////////////////AP////////////8AAAAAAAAAAAAAAAAAAAAAAAD///////////////8A/////////////wAAAAAAAAAAAAAAAAAAAAAAAP///////////////wD/////////////AAAAAAAAAAAAAAAAAAAAAAAA////////////////AP///////////////////wAAAAAAAAAA//////////////////////8A////////////////////AAAAAAAAAAD//////////////////////wD///////////////////8AAAAAAAAAAP//////////////////////AP///////////////////wAAAAAAAAAA//////////////////////8A////////////////////AAAAAAAAAAD//////////////////////wD///////////////////8AAAAAAAAAAP//////////////////////AP///////////////////wAAAAAAAAAA//////////////////////8A////////////////////AAAAAAAAAAD//////////////////////wD///////////////////8AAAAAAAAAAP//////////////////////AP///////////////////wAAAAAAAAAA//////////////////////8A////////////////////AAAAAAAAAAD//////////////////////wD///////////////////8AAAAAAAAAAP//////////////////////AP///////////////////wAAAAAAAAAA//////////////////////8A////////////////////AAAAAAAAAAD//////////////////////wD///////////////////8AAAAAAAAAAP//////////////////////AP////////////8AAAAAAAAAAAAAAAAAAAAAAAD///////////////8A/////////////wAAAAAAAAAAAAAAAAAAAAAAAP///////////////wD/////////////AAAAAAAAAAAAAAAAAAAAAAAA////////////////AP////////////8AAAAAAAAAAAAAAAAAAAAAAAD///////////////8A/////////////wAAAAAAAAAAAAAAAAAAAAAAAP///////////////wD/////////////AAAAAAAAAAAAAAAAAAAAAAAA////////////////AP////////////8AAAAAAAAAAAAAAAAAAAAAAAD///////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8=',
- 'width' => 40
- ),
- 'J' => array(
- 'data' => 'AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP///////////////////////////wAAAAAAAAAA//////////////8A////////////////////////////AAAAAAAAAAD//////////////wD///////////////////////////8AAAAAAAAAAP//////////////AP///////////////////////////wAAAAAAAAAA//////////////8A////////////////////////////AAAAAAAAAAD//////////////wD///////////////////////////8AAAAAAAAAAP//////////////AP///////////////////////////wAAAAAAAAAA//////////////8A////////////////////////////AAAAAAAAAAD//////////////wD///////////////////////////8AAAAAAAAAAP//////////////AP///////////////////////////wAAAAAAAAAA//////////////8A////////////////////////////AAAAAAAAAAD//////////////wD///////////////////////////8AAAAAAAAAAP//////////////AP///////////////////////////wAAAAAAAAAA//////////////8A////////////////////////////AAAAAAAAAAD//////////////wD///////////////////////////8AAAAAAAAAAP//////////////AP///////////////////////////wAAAAAAAAAA//////////////8A////////////////////////////AAAAAAAAAAj//////////////wD//////////+zMrIxwUDAQ//////wAAAAAAAAAIP//////////////AP//////////DAAAAAAAAADo////2AAAAAAAAAA0//////////////8A//////////8wAAAAAAAAAKj///+YAAAAAAAAAFj//////////////wD//////////2gAAAAAAAAAIND/yBgAAAAAAAAAkP//////////////AP//////////vAAAAAAAAAAAAAAAAAAAAAAAAADc//////////////8A////////////MAAAAAAAAAAAAAAAAAAAAAAAUP///////////////wD////////////EBAAAAAAAAAAAAAAAAAAAABjk////////////////AP////////////+sBAAAAAAAAAAAAAAAAAAY2P////////////////8A///////////////EMAAAAAAAAAAAAAAAVOj//////////////////wD/////////////////vHBAIAAAABg8fNT/////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8=',
- 'width' => 40
- ),
- 'K' => array(
- 'data' => 'AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD///////8AAAAAAAAAAP//////////wAQAAAAAAAAAAABw////////AP///////wAAAAAAAAAA/////////9AMAAAAAAAAAAAAcP////////8A////////AAAAAAAAAAD////////cGAAAAAAAAAAAAHD//////////wD///////8AAAAAAAAAAP//////6CgAAAAAAAAAAABs////////////AP///////wAAAAAAAAAA//////Q0AAAAAAAAAAAAVPz///////////8A////////AAAAAAAAAAD////8RAAAAAAAAAAAAFT8/////////////wD///////8AAAAAAAAAAP///1gAAAAAAAAAAABU/P//////////////AP///////wAAAAAAAAAA//9wAAAAAAAAAAAASPz///////////////8A////////AAAAAAAAAAD/jAAAAAAAAAAAADz0/////////////////wD///////8AAAAAAAAAAKQAAAAAAAAAAAA89P//////////////////AP///////wAAAAAAAAAABAAAAAAAAAAAFPT///////////////////8A////////AAAAAAAAAAAAAAAAAAAAAAAApP///////////////////wD///////8AAAAAAAAAAAAAAAAAAAAAAAAU8P//////////////////AP///////wAAAAAAAAAAAAAAAAAAAAAAAABk//////////////////8A////////AAAAAAAAAAAAAAAAAAAAAAAAAADE/////////////////wD///////8AAAAAAAAAAAAAAAAoEAAAAAAAACz8////////////////AP///////wAAAAAAAAAAAAAAGNiAAAAAAAAAAIj///////////////8A////////AAAAAAAAAAAAABjY//gYAAAAAAAACOD//////////////wD///////8AAAAAAAAAAAAY2P///5wAAAAAAAAASP//////////////AP///////wAAAAAAAAAAGNj//////CgAAAAAAAAAqP////////////8A////////AAAAAAAAAADI////////sAAAAAAAAAAc8P///////////wD///////8AAAAAAAAAAP//////////QAAAAAAAAABs////////////AP///////wAAAAAAAAAA///////////IAAAAAAAAAATI//////////8A////////AAAAAAAAAAD///////////9YAAAAAAAAADD8/////////wD///////8AAAAAAAAAAP///////////9wEAAAAAAAAAJD/////////AP///////wAAAAAAAAAA/////////////3AAAAAAAAAADOT///////8A////////AAAAAAAAAAD/////////////7BAAAAAAAAAAUP///////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8=',
- 'width' => 40
- ),
- 'L' => array(
- 'data' => 'AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////8AAAAAAAAAAP////////////////////////////8A/////////////wAAAAAAAAAA/////////////////////////////wD/////////////AAAAAAAAAAD/////////////////////////////AP////////////8AAAAAAAAAAP////////////////////////////8A/////////////wAAAAAAAAAA/////////////////////////////wD/////////////AAAAAAAAAAD/////////////////////////////AP////////////8AAAAAAAAAAP////////////////////////////8A/////////////wAAAAAAAAAA/////////////////////////////wD/////////////AAAAAAAAAAD/////////////////////////////AP////////////8AAAAAAAAAAP////////////////////////////8A/////////////wAAAAAAAAAA/////////////////////////////wD/////////////AAAAAAAAAAD/////////////////////////////AP////////////8AAAAAAAAAAP////////////////////////////8A/////////////wAAAAAAAAAA/////////////////////////////wD/////////////AAAAAAAAAAD/////////////////////////////AP////////////8AAAAAAAAAAP////////////////////////////8A/////////////wAAAAAAAAAA/////////////////////////////wD/////////////AAAAAAAAAAD/////////////////////////////AP////////////8AAAAAAAAAAP////////////////////////////8A/////////////wAAAAAAAAAA/////////////////////////////wD/////////////AAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////AP////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAP////////////8A/////////////wAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////wD/////////////AAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////AP////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAP////////////8A/////////////wAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////wD/////////////AAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8=',
- 'width' => 40
- ),
- 'M' => array(
- 'data' => 'AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A//////8AAAAAAAAAAAAAAHz//////3wAAAAAAAAAAAAAAP///////wD//////wAAAAAAAAAAAAAATP//////UAAAAAAAAAAAAAAA////////AP//////AAAAAAAAAAAAAAAc//////8cAAAAAAAAAAAAAAD///////8A//////8AAAAAAAAAAAAAAADw////8AAAAAAAAAAAAAAAAP///////wD//////wAAAAAAAAAAAAAAALz////AAAAAAAAAAAAAAAAA////////AP//////AAAAAAAAAAAAAAAAkP///5AAAAAAAAAAAAAAAAD///////8A//////8AAAAAAAAAAAAAAABc////ZAAAAAAAAAAAAAAAAP///////wD//////wAAAAAAAAAoAAAAADD///8wAAAAACQAAAAAAAAA////////AP//////AAAAAAAAAFwAAAAABPz//AgAAAAAXAAAAAAAAAD///////8A//////8AAAAAAAAAkAAAAAAA0P/UAAAAAACQAAAAAAAAAP///////wD//////wAAAAAAAADMAAAAAACg/6gAAAAAAMQAAAAAAAAA////////AP//////AAAAAAAAAPgEAAAAAHD/dAAAAAAE+AAAAAAAAAD///////8A//////8AAAAAAAAA/zQAAAAAQP9IAAAAADD/AAAAAAAAAP///////wD//////wAAAAAAAAD/bAAAAAAQ/xQAAAAAaP8AAAAAAAAA////////AP//////AAAAAAAAAP+gAAAAAADQAAAAAACc/wAAAAAAAAD///////8A//////8AAAAAAAAA/9QAAAAAAGgAAAAAAND/AAAAAAAAAP///////wD//////wAAAAAAAAD//wwAAAAAFAAAAAAM/P8AAAAAAAAA////////AP//////AAAAAAAAAP//RAAAAAAAAAAAADz//wAAAAAAAAD///////8A//////8AAAAAAAAA//94AAAAAAAAAAAAcP//AAAAAAAAAP///////wD//////wAAAAAAAAD//7AAAAAAAAAAAACo//8AAAAAAAAA////////AP//////AAAAAAAAAP//5AAAAAAAAAAAANz//wAAAAAAAAD///////8A//////8AAAAAAAAA////HAAAAAAAAAAQ////AAAAAAAAAP///////wD//////wAAAAAAAAD///9QAAAAAAAAAEz///8AAAAAAAAA////////AP//////AAAAAAAAAP///4gAAAAAAAAAfP///wAAAAAAAAD///////8A//////8AAAAAAAAA////vAAAAAAAAACw////AAAAAAAAAP///////wD//////wAAAAAAAAD////wAAAAAAAAAOz///8AAAAAAAAA////////AP//////AAAAAAAAAP////8sAAAAAAAc/////wAAAAAAAAD///////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8=',
- 'width' => 40
- ),
- 'N' => array(
- 'data' => 'AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////AAAAAAAAALD/////////////AAAAAAAAAP//////////AP////////8AAAAAAAAAFOj///////////8AAAAAAAAA//////////8A/////////wAAAAAAAAAASP///////////wAAAAAAAAD//////////wD/////////AAAAAAAAAAAAkP//////////AAAAAAAAAP//////////AP////////8AAAAAAAAAAAAI1P////////8AAAAAAAAA//////////8A/////////wAAAAAAAAAAAAAw+P///////wAAAAAAAAD//////////wD/////////AAAAAAAAAAAAAABw////////AAAAAAAAAP//////////AP////////8AAAAAAAAAAAAAAAC8//////8AAAAAAAAA//////////8A/////////wAAAAAAAAAAAAAAABzs/////wAAAAAAAAD//////////wD/////////AAAAAAAAAAAAAAAAAFD/////AAAAAAAAAP//////////AP////////8AAAAAAAAAAAAAAAAAAJz///8AAAAAAAAA//////////8A/////////wAAAAAAAAAUAAAAAAAADNz//wAAAAAAAAD//////////wD/////////AAAAAAAAALQAAAAAAAAANPz/AAAAAAAAAP//////////AP////////8AAAAAAAAA/2wAAAAAAAAAfP8AAAAAAAAA//////////8A/////////wAAAAAAAAD/+CwAAAAAAAAExAAAAAAAAAD//////////wD/////////AAAAAAAAAP//0AQAAAAAAAAgAAAAAAAAAP//////////AP////////8AAAAAAAAA////jAAAAAAAAAAAAAAAAAAA//////////8A/////////wAAAAAAAAD/////RAAAAAAAAAAAAAAAAAD//////////wD/////////AAAAAAAAAP/////kFAAAAAAAAAAAAAAAAP//////////AP////////8AAAAAAAAA//////+sAAAAAAAAAAAAAAAA//////////8A/////////wAAAAAAAAD///////9kAAAAAAAAAAAAAAD//////////wD/////////AAAAAAAAAP////////QkAAAAAAAAAAAAAP//////////AP////////8AAAAAAAAA/////////8wEAAAAAAAAAAAA//////////8A/////////wAAAAAAAAD//////////4QAAAAAAAAAAAD//////////wD/////////AAAAAAAAAP///////////DwAAAAAAAAAAP//////////AP////////8AAAAAAAAA////////////4BAAAAAAAAAA//////////8A/////////wAAAAAAAAD/////////////qAAAAAAAAAD//////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8=',
- 'width' => 40
- ),
- 'O' => array(
- 'data' => 'AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A///////////////////0qGw4HAAAABw4aKT0/////////////////wD////////////////wcAwAAAAAAAAAAAAAAAho6P//////////////AP//////////////uBQAAAAAAAAAAAAAAAAAAAAMoP////////////8A/////////////6AEAAAAAAAAAAAAAAAAAAAAAAAAkP///////////wD///////////+4BAAAAAAAAAAAAAAAAAAAAAAAAAAAoP//////////AP//////////8BQAAAAAAAAAAAAAAAAAAAAAAAAAAAAM5P////////8A//////////9wAAAAAAAAAAAsrPD/7KQsAAAAAAAAAABg/////////wD/////////+BAAAAAAAAAAUPj///////hQAAAAAAAAAAjs////////AP////////+sAAAAAAAAABDw//////////AYAAAAAAAAAKD///////8A/////////2wAAAAAAAAAdP///////////3wAAAAAAAAAYP///////wD/////////OAAAAAAAAAC4////////////xAAAAAAAAAAw////////AP////////8cAAAAAAAAAOD////////////oAAAAAAAAABT///////8A/////////wAAAAAAAAAA//////////////8AAAAAAAAAAP///////wD/////////AAAAAAAAAAD//////////////wAAAAAAAAAA////////AP////////8AAAAAAAAAAP/////////////8AAAAAAAAAAD///////8A/////////xwAAAAAAAAA5P///////////+AAAAAAAAAAHP///////wD/////////NAAAAAAAAAC8////////////uAAAAAAAAAA4////////AP////////9oAAAAAAAAAHj///////////98AAAAAAAAAGT///////8A/////////6gAAAAAAAAAGPD/////////+BgAAAAAAAAApP///////wD/////////9AwAAAAAAAAAUPz///////xcAAAAAAAAAAjs////////AP//////////cAAAAAAAAAAALKjs//CwOAAAAAAAAAAAYP////////8A///////////wFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAzk/////////wD///////////+4BAAAAAAAAAAAAAAAAAAAAAAAAAAAoP//////////AP////////////+QAAAAAAAAAAAAAAAAAAAAAAAAAJD///////////8A//////////////+sEAAAAAAAAAAAAAAAAAAAAAyg/////////////wD////////////////oZAgAAAAAAAAAAAAAAARg4P//////////////AP//////////////////9KhsOCAAAAAUMFyc7P////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8=',
- 'width' => 40
- ),
- 'P' => array(
- 'data' => 'AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP///////////wAAAAAAAAAAAAAAAAAACCxguP////////////////8A////////////AAAAAAAAAAAAAAAAAAAAAAAAOOD//////////////wD///////////8AAAAAAAAAAAAAAAAAAAAAAAAAGOD/////////////AP///////////wAAAAAAAAAAAAAAAAAAAAAAAAAARP////////////8A////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAxP///////////wD///////////8AAAAAAAAAAAAAAAAAAAAAAAAAAABo////////////AP///////////wAAAAAAAAAA////6JwMAAAAAAAAADD///////////8A////////////AAAAAAAAAAD//////6AAAAAAAAAADP///////////wD///////////8AAAAAAAAAAP//////9AAAAAAAAAAA////////////AP///////////wAAAAAAAAAA///////0AAAAAAAAAAD///////////8A////////////AAAAAAAAAAD//////5gAAAAAAAAAHP///////////wD///////////8AAAAAAAAAAP///9iICAAAAAAAAABI////////////AP///////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAJD///////////8A////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAI6P///////////wD///////////8AAAAAAAAAAAAAAAAAAAAAAAAAAIT/////////////AP///////////wAAAAAAAAAAAAAAAAAAAAAAAABU/P////////////8A////////////AAAAAAAAAAAAAAAAAAAAAAAIhPz//////////////wD///////////8AAAAAAAAAAAAAAAAABCRMkOz/////////////////AP///////////wAAAAAAAAAA//////////////////////////////8A////////////AAAAAAAAAAD//////////////////////////////wD///////////8AAAAAAAAAAP//////////////////////////////AP///////////wAAAAAAAAAA//////////////////////////////8A////////////AAAAAAAAAAD//////////////////////////////wD///////////8AAAAAAAAAAP//////////////////////////////AP///////////wAAAAAAAAAA//////////////////////////////8A////////////AAAAAAAAAAD//////////////////////////////wD///////////8AAAAAAAAAAP//////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8=',
- 'width' => 40
- ),
- 'Q' => array(
- 'data' => 'AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////SoaDQcAAAAHDhoqPT///////////////////8A//////////////BwDAAAAAAAAAAAAAAACHDo/////////////////wD///////////+4FAAAAAAAAAAAAAAAAAAAABCo////////////////AP//////////nAQAAAAAAAAAAAAAAAAAAAAAAACQ//////////////8A/////////7gEAAAAAAAAAAAAAAAAAAAAAAAAAACg/////////////wD////////wFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAzo////////////AP///////3AAAAAAAAAAACyo8P/sqCwAAAAAAAAAAGT///////////8A///////4EAAAAAAAAABM+P///////FQAAAAAAAAACPT//////////wD//////7AAAAAAAAAAFPD/////////9BgAAAAAAAAApP//////////AP//////bAAAAAAAAAB4////////////fAAAAAAAAABk//////////8A//////84AAAAAAAAALz///////////+8AAAAAAAAADT//////////wD//////xwAAAAAAAAA6P///////////+QAAAAAAAAAHP//////////AP//////AAAAAAAAAAD//////////////wAAAAAAAAAA//////////8A//////8AAAAAAAAAAP//////////////AAAAAAAAAAD//////////wD//////wAAAAAAAAAA/P////////////8AAAAAAAAAAP//////////AP//////GAAAAAAAAADg////////////4AAAAAAAAAAc//////////8A//////84AAAAAAAAALT////MJHTo//+8AAAAAAAAADT//////////wD//////2wAAAAAAAAAdP///2AAABCg/3wAAAAAAAAAZP//////////AP//////rAAAAAAAAAAY9P/sCAAAAABMGAAAAAAAAACk//////////8A///////4EAAAAAAAAABU/P+0OAAAAAAAAAAAAAAACPT//////////wD///////94AAAAAAAAAAA4sPD/gAAAAAAAAAAAAABk////////////AP////////AcAAAAAAAAAAAAAAAAAAAAAAAAAAAADOT///////////8A/////////7wEAAAAAAAAAAAAAAAAAAAAAAAAAACQ/////////////wD//////////6wEAAAAAAAAAAAAAAAAAAAAAAAAABSs////////////AP///////////7gUAAAAAAAAAAAAAAAAAAAAAAAAAABAwP////////8A//////////////BwDAAAAAAAAAAAAAAABAgAAAAAAAA8/////////wD////////////////0qGg0GAAAABgwXJjkxBgAAAAAALD/////////AP//////////////////////////////////5DQAAAAk/P////////8A////////////////////////////////////+GwAAJD//////////wD//////////////////////////////////////8A49P//////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8=',
- 'width' => 40
- ),
- 'R' => array(
- 'data' => 'AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////wAAAAAAAAAAAAAAAAAAAAQgOGSk+P///////////////wD/////////AAAAAAAAAAAAAAAAAAAAAAAAAAAcuP//////////////AP////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAEsP////////////8A/////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQ6P///////////wD/////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB8////////////AP////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAADD///////////8A/////////wAAAAAAAAAA///////svDgAAAAAAAAACP///////////wD/////////AAAAAAAAAAD/////////7AAAAAAAAAAA////////////AP////////8AAAAAAAAAAP/////////cAAAAAAAAABD///////////8A/////////wAAAAAAAAAA//////DQoCQAAAAAAAAAQP///////////wD/////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAACU////////////AP////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAIPj///////////8A/////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAzU/////////////wD/////////AAAAAAAAAAAAAAAAAAAAAAAAAAA02P//////////////AP////////8AAAAAAAAAAAAAAAAAAAAAAAxctPz///////////////8A/////////wAAAAAAAAAAAAAAAAAAAAAAAEDY/////////////////wD/////////AAAAAAAAAAD/9LAsAAAAAAAAAAzc////////////////AP////////8AAAAAAAAAAP///+wkAAAAAAAAADD8//////////////8A/////////wAAAAAAAAAA/////8QAAAAAAAAAAJD//////////////wD/////////AAAAAAAAAAD//////1QAAAAAAAAAFPD/////////////AP////////8AAAAAAAAAAP//////3AQAAAAAAAAAgP////////////8A/////////wAAAAAAAAAA////////aAAAAAAAAAAM6P///////////wD/////////AAAAAAAAAAD////////oCAAAAAAAAABs////////////AP////////8AAAAAAAAAAP////////+AAAAAAAAAAATc//////////8A/////////wAAAAAAAAAA//////////AUAAAAAAAAAFj//////////wD/////////AAAAAAAAAAD//////////5AAAAAAAAAAAND/////////AP////////8AAAAAAAAAAP//////////+CQAAAAAAAAAQP////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8=',
- 'width' => 40
- ),
- 'S' => array(
- 'data' => 'AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP/////////////////8vHBEIAgAAAQgQHC8/P////////////////8A////////////////pCQAAAAAAAAAAAAAAAAcoP///////////////wD//////////////FwAAAAAAAAAAAAAAAAAAAAAXP//////////////AP////////////9oAAAAAAAAAAAAAAAAAAAAAAAAhP////////////8A////////////zAAAAAAAAAAAAAAAAAAAAAAAAAAI6P///////////wD///////////9cAAAAAAAAAAAAAAAAAAAAAAAAAACA////////////AP///////////xgAAAAAAAAAUOD/8KwkAAAAAAAAADj///////////8A////////////AAAAAAAAAAD0/////8wABCAgICxASP///////////wD///////////8MAAAAAAAAAMz/////////////////////////////AP///////////0AAAAAAAAAACFiQxPT///////////////////////8A////////////oAAAAAAAAAAAAAAAADBwtPT//////////////////wD////////////8QAAAAAAAAAAAAAAAAAAACFTA////////////////AP/////////////oOAAAAAAAAAAAAAAAAAAAAABM6P////////////8A///////////////4fAgAAAAAAAAAAAAAAAAAAAAY2P///////////wD/////////////////7IwwAAAAAAAAAAAAAAAAAAAo+P//////////AP/////////////////////koGw0BAAAAAAAAAAAAACU//////////8A///////////////////////////4uFgAAAAAAAAAADz//////////wD//////////2BgSEA0IBwA6P///////5QAAAAAAAAADP//////////AP//////////JAAAAAAAAACc/////////AAAAAAAAAAA//////////8A//////////9YAAAAAAAAACDo///////AAAAAAAAAABT//////////wD//////////6QAAAAAAAAAACCk7P/snBQAAAAAAAAAUP//////////AP//////////+BAAAAAAAAAAAAAAAAAAAAAAAAAAAACs//////////8A////////////kAAAAAAAAAAAAAAAAAAAAAAAAAAAOP///////////wD////////////8RAAAAAAAAAAAAAAAAAAAAAAAABjc////////////AP/////////////0PAAAAAAAAAAAAAAAAAAAAAAg2P////////////8A///////////////8hBQAAAAAAAAAAAAAAAAMdPT//////////////wD/////////////////+LRwSCAMAAAAHDhoqPT/////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8=',
- 'width' => 40
- ),
- 'T' => array(
- 'data' => 'AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////////AP////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///////////8A/////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///////////wD/////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////////AP////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///////////8A/////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///////////wD///////////////////8AAAAAAAAAAP//////////////////////AP///////////////////wAAAAAAAAAA//////////////////////8A////////////////////AAAAAAAAAAD//////////////////////wD///////////////////8AAAAAAAAAAP//////////////////////AP///////////////////wAAAAAAAAAA//////////////////////8A////////////////////AAAAAAAAAAD//////////////////////wD///////////////////8AAAAAAAAAAP//////////////////////AP///////////////////wAAAAAAAAAA//////////////////////8A////////////////////AAAAAAAAAAD//////////////////////wD///////////////////8AAAAAAAAAAP//////////////////////AP///////////////////wAAAAAAAAAA//////////////////////8A////////////////////AAAAAAAAAAD//////////////////////wD///////////////////8AAAAAAAAAAP//////////////////////AP///////////////////wAAAAAAAAAA//////////////////////8A////////////////////AAAAAAAAAAD//////////////////////wD///////////////////8AAAAAAAAAAP//////////////////////AP///////////////////wAAAAAAAAAA//////////////////////8A////////////////////AAAAAAAAAAD//////////////////////wD///////////////////8AAAAAAAAAAP//////////////////////AP///////////////////wAAAAAAAAAA//////////////////////8A////////////////////AAAAAAAAAAD//////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8=',
- 'width' => 40
- ),
- 'U' => array(
- 'data' => 'AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////8AAAAAAAAAAP///////////wAAAAAAAAAA//////////8A/////////wAAAAAAAAAA////////////AAAAAAAAAAD//////////wD/////////AAAAAAAAAAD///////////8AAAAAAAAAAP//////////AP////////8AAAAAAAAAAP///////////wAAAAAAAAAA//////////8A/////////wAAAAAAAAAA////////////AAAAAAAAAAD//////////wD/////////AAAAAAAAAAD///////////8AAAAAAAAAAP//////////AP////////8AAAAAAAAAAP///////////wAAAAAAAAAA//////////8A/////////wAAAAAAAAAA////////////AAAAAAAAAAD//////////wD/////////AAAAAAAAAAD///////////8AAAAAAAAAAP//////////AP////////8AAAAAAAAAAP///////////wAAAAAAAAAA//////////8A/////////wAAAAAAAAAA////////////AAAAAAAAAAD//////////wD/////////AAAAAAAAAAD///////////8AAAAAAAAAAP//////////AP////////8AAAAAAAAAAP///////////wAAAAAAAAAA//////////8A/////////wAAAAAAAAAA////////////AAAAAAAAAAD//////////wD/////////AAAAAAAAAAD///////////8AAAAAAAAAAP//////////AP////////8AAAAAAAAAAP///////////wAAAAAAAAAA//////////8A/////////wAAAAAAAAAA////////////AAAAAAAAAAD//////////wD/////////JAAAAAAAAADk/////////+gAAAAAAAAAHP//////////AP////////9MAAAAAAAAAJz/////////nAAAAAAAAABE//////////8A/////////4gAAAAAAAAAHOj//////+ggAAAAAAAAAHz//////////wD/////////0AAAAAAAAAAAIJzs/+ykIAAAAAAAAAAA0P//////////AP//////////QAAAAAAAAAAAAAAAAAAAAAAAAAAAAED///////////8A///////////IBAAAAAAAAAAAAAAAAAAAAAAAAAAE0P///////////wD///////////+YAAAAAAAAAAAAAAAAAAAAAAAAAJj/////////////AP////////////+UBAAAAAAAAAAAAAAAAAAAAASU//////////////8A///////////////IPAAAAAAAAAAAAAAAAAAwyP///////////////wD/////////////////0IxYOCAIAAAEIEiAyP//////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8=',
- 'width' => 40
- ),
- 'V' => array(
- 'data' => 'AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD//////zAAAAAAAAAAYP//////////////ZAAAAAAAAAAw////////AP//////kAAAAAAAAAAU/P////////////8UAAAAAAAAAJD///////8A///////oBAAAAAAAAADE////////////xAAAAAAAAAAE7P///////wD///////9MAAAAAAAAAHD///////////94AAAAAAAAAEz/////////AP///////6gAAAAAAAAAJP///////////yQAAAAAAAAArP////////8A////////+BAAAAAAAAAA1P/////////YAAAAAAAAABT4/////////wD/////////aAAAAAAAAACE/////////4QAAAAAAAAAbP//////////AP/////////EAAAAAAAAADT/////////OAAAAAAAAADM//////////8A//////////8kAAAAAAAAAOT//////+QAAAAAAAAAKP///////////wD//////////4QAAAAAAAAAmP//////nAAAAAAAAACI////////////AP//////////5AAAAAAAAABE//////9EAAAAAAAABOT///////////8A////////////QAAAAAAAAAT0////9AgAAAAAAABI/////////////wD///////////+gAAAAAAAAAKT///+kAAAAAAAAAKj/////////////AP////////////QIAAAAAAAAXP///1wAAAAAAAAM+P////////////8A/////////////1wAAAAAAAAM+P/8DAAAAAAAAGT//////////////wD/////////////vAAAAAAAAAC8/7wAAAAAAAAAxP//////////////AP//////////////HAAAAAAAAGj/aAAAAAAAACT///////////////8A//////////////94AAAAAAAAHP8cAAAAAAAAhP///////////////wD//////////////9gAAAAAAAAAkAAAAAAAAADk////////////////AP///////////////zgAAAAAAAAQAAAAAAAAQP////////////////8A////////////////lAAAAAAAAAAAAAAAAACg/////////////////wD////////////////sCAAAAAAAAAAAAAAADPT/////////////////AP////////////////9QAAAAAAAAAAAAAABg//////////////////8A/////////////////7AAAAAAAAAAAAAAAMD//////////////////wD//////////////////BQAAAAAAAAAAAAc////////////////////AP//////////////////cAAAAAAAAAAAAHz///////////////////8A///////////////////MAAAAAAAAAAAA3P///////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8=',
- 'width' => 40
- ),
- 'W' => array(
- 'data' => 'AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A//8cAAAAAAAAALz/////4AAAAAAAAAAA6P////+8AAAAAAAAABz//wD//1QAAAAAAAAAjP////+gAAAAAAAAAACo/////4wAAAAAAAAAUP//AP//jAAAAAAAAABU/////2AAAAAAAAAAAGj/////VAAAAAAAAACM//8A///EAAAAAAAAACT/////IAAAAAAAAAAAKP////8kAAAAAAAAAMT//wD///gEAAAAAAAAAPD//+AAAAAAAAAAAAAA6P//8AAAAAAAAAAE9P//AP///zAAAAAAAAAAvP//oAAAAAAAAAAAAACo//+8AAAAAAAAADD///8A////bAAAAAAAAACM//9gAAAAAAAAAAAAAGT//4wAAAAAAAAAaP///wD///+kAAAAAAAAAFT//yAAAAAAAAAAAAAAIP//VAAAAAAAAACc////AP///9gAAAAAAAAAJP/gAAAAAAAAAAAAAAAA4P8kAAAAAAAAANT///8A/////xAAAAAAAAAA8KAAAAAAAAAAAAAAAACg8AAAAAAAAAAQ/////wD/////TAAAAAAAAAC8YAAAAAAAAAAAAAAAAGC8AAAAAAAAAET/////AP////+AAAAAAAAAAIwgAAAAAAAAAAAAAAAAIIwAAAAAAAAAfP////8A/////7gAAAAAAAAANAAAAAAAACwwAAAAAAAANAAAAAAAAACw/////wD/////8AAAAAAAAAAAAAAAAAAAdHgAAAAAAAAAAAAAAAAAAOz/////AP//////KAAAAAAAAAAAAAAAAAC4vAAAAAAAAAAAAAAAAAAg//////8A//////9gAAAAAAAAAAAAAAAACPj4CAAAAAAAAAAAAAAAAFj//////wD//////5QAAAAAAAAAAAAAAABE//9IAAAAAAAAAAAAAAAAkP//////AP//////0AAAAAAAAAAAAAAAAIj//4wAAAAAAAAAAAAAAADI//////8A///////8DAAAAAAAAAAAAAAAzP//1AAAAAAAAAAAAAAABPj//////wD///////88AAAAAAAAAAAAABT/////GAAAAAAAAAAAAAA0////////AP///////3QAAAAAAAAAAAAAWP////9gAAAAAAAAAAAAAHD///////8A////////sAAAAAAAAAAAAACg/////6QAAAAAAAAAAAAApP///////wD////////kAAAAAAAAAAAAAOT/////6AAAAAAAAAAAAADc////////AP////////8cAAAAAAAAAAAo////////MAAAAAAAAAAAEP////////8A/////////1QAAAAAAAAAAHD///////94AAAAAAAAAABM/////////wD/////////jAAAAAAAAAAAtP///////7wAAAAAAAAAAID/////////AP/////////EAAAAAAAAAAT0////////+AgAAAAAAAAAuP////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8=',
- 'width' => 40
- ),
- 'X' => array(
- 'data' => 'AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD///////9UAAAAAAAAAKz///////////+sAAAAAAAAAFD/////////AP///////+QQAAAAAAAAFOT/////////8BwAAAAAAAAM5P////////8A/////////5gAAAAAAAAATP////////9kAAAAAAAAAJD//////////wD//////////0AAAAAAAAAAoP//////wAAAAAAAAAA0/P//////////AP//////////2AgAAAAAAAAQ4P////gkAAAAAAAABMz///////////8A////////////iAAAAAAAAABA////dAAAAAAAAABw/////////////wD////////////8MAAAAAAAAACU/9AEAAAAAAAAHPD/////////////AP/////////////IBAAAAAAAAAzYMAAAAAAAAACs//////////////8A//////////////90AAAAAAAAABAAAAAAAAAATP///////////////wD///////////////QgAAAAAAAAAAAAAAAAAAzg////////////////AP///////////////7wAAAAAAAAAAAAAAAAAjP////////////////8A/////////////////2AAAAAAAAAAAAAAADD8/////////////////wD/////////////////7BQAAAAAAAAAAAAEyP//////////////////AP/////////////////gDAAAAAAAAAAAAAjY//////////////////8A/////////////////0AAAAAAAAAAAAAAADj8/////////////////wD///////////////+UAAAAAAAAAAAAAAAAAJD/////////////////AP//////////////4AwAAAAAAAAAAAAAAAAADOD///////////////8A//////////////9AAAAAAAAAAAAAAAAAAAAAQP///////////////wD/////////////nAAAAAAAAAAAWAAAAAAAAAAAlP//////////////AP///////////+QQAAAAAAAAAGD/YAAAAAAAAAAM4P////////////8A////////////TAAAAAAAAAAs9P/0LAAAAAAAAABM/////////////wD//////////6AAAAAAAAAADNT////UDAAAAAAAAACg////////////AP/////////kEAAAAAAAAACg//////+gAAAAAAAAABDk//////////8A/////////0wAAAAAAAAAYP////////9gAAAAAAAAAEz//////////wD///////+oAAAAAAAAACz0//////////QsAAAAAAAAAKT/////////AP//////7BQAAAAAAAAM1P///////////9QMAAAAAAAAFOz///////8A//////9UAAAAAAAAAKD//////////////6AAAAAAAAAAVP///////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8=',
- 'width' => 40
- ),
- 'Y' => array(
- 'data' => 'AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP///////1QAAAAAAAAAAGj//////////2gAAAAAAAAAAFT///////8A////////5BAAAAAAAAAAAMT////////EAAAAAAAAAAAQ5P///////wD/////////mAAAAAAAAAAAKPj/////+CgAAAAAAAAAAJj/////////AP//////////PAAAAAAAAAAAgP////+AAAAAAAAAAAA8//////////8A///////////YCAAAAAAAAAAE2P//2AQAAAAAAAAACNj//////////wD///////////+AAAAAAAAAAAA4//84AAAAAAAAAACA////////////AP////////////woAAAAAAAAAACUlAAAAAAAAAAAKPz///////////8A/////////////8gAAAAAAAAAABAQAAAAAAAAAADI/////////////wD//////////////2wAAAAAAAAAAAAAAAAAAAAAbP//////////////AP//////////////8BwAAAAAAAAAAAAAAAAAABzw//////////////8A////////////////tAAAAAAAAAAAAAAAAAAAtP///////////////wD/////////////////VAAAAAAAAAAAAAAAAFT/////////////////AP/////////////////oEAAAAAAAAAAAAAAQ6P////////////////8A//////////////////+cAAAAAAAAAAAAAJz//////////////////wD///////////////////9AAAAAAAAAAABA////////////////////AP///////////////////9gAAAAAAAAAANj///////////////////8A/////////////////////wAAAAAAAAAA/////////////////////wD/////////////////////AAAAAAAAAAD/////////////////////AP////////////////////8AAAAAAAAAAP////////////////////8A/////////////////////wAAAAAAAAAA/////////////////////wD/////////////////////AAAAAAAAAAD/////////////////////AP////////////////////8AAAAAAAAAAP////////////////////8A/////////////////////wAAAAAAAAAA/////////////////////wD/////////////////////AAAAAAAAAAD/////////////////////AP////////////////////8AAAAAAAAAAP////////////////////8A/////////////////////wAAAAAAAAAA/////////////////////wD/////////////////////AAAAAAAAAAD/////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8=',
- 'width' => 40
- ),
- 'Z' => array(
- 'data' => 'AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A//////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAD//////////////wD//////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAP//////////////AP//////////AAAAAAAAAAAAAAAAAAAAAAAAAAAA//////////////8A//////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAD//////////////wD//////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAP//////////////AP//////////AAAAAAAAAAAAAAAAAAAAAAAAAAAQ//////////////8A/////////////////////////1AAAAAAAAAABLz//////////////wD///////////////////////98AAAAAAAAAACY////////////////AP//////////////////////pAAAAAAAAAAAaP////////////////8A/////////////////////8QIAAAAAAAAAET8/////////////////wD////////////////////gGAAAAAAAAAAo9P//////////////////AP//////////////////9CwAAAAAAAAAFNz///////////////////8A//////////////////xMAAAAAAAAAATA/////////////////////wD/////////////////eAAAAAAAAAAAnP//////////////////////AP///////////////5wAAAAAAAAAAHT///////////////////////8A///////////////ABAAAAAAAAABM/P///////////////////////wD/////////////3BQAAAAAAAAALPT/////////////////////////AP////////////QoAAAAAAAAABjg//////////////////////////8A///////////8SAAAAAAAAAAExP///////////////////////////wD//////////2wAAAAAAAAAAKD/////////////////////////////AP////////+YAAAAAAAAAAB8//////////////////////////////8A/////////wQAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////wD/////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////AP////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////////////8A/////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////wD/////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////AP////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8=',
- 'width' => 40
- ),
- );
- }
-}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/captcha/plugins/captcha_abstract.php b/phpBB/includes/captcha/plugins/captcha_abstract.php
deleted file mode 100644
index 21cacd730c..0000000000
--- a/phpBB/includes/captcha/plugins/captcha_abstract.php
+++ /dev/null
@@ -1,380 +0,0 @@
-<?php
-/**
-*
-* @package VC
-* @version $Id$
-* @copyright (c) 2006, 2008 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
-*
-*/
-
-/**
-* @ignore
-*/
-if (!defined('IN_PHPBB'))
-{
- exit;
-}
-
-
-/**
-* This class holds the code shared by the two default 3.0.x CAPTCHAs.
-*
-* @package VC
-*/
-class phpbb_default_captcha
-{
- var $confirm_id;
- var $confirm_code;
- var $code;
- var $seed;
- var $attempts = 0;
- var $type;
- var $solved = 0;
- var $captcha_vars = false;
-
- function init($type)
- {
- global $config, $db, $user;
-
- // read input
- $this->confirm_id = request_var('confirm_id', '');
- $this->confirm_code = request_var('confirm_code', '');
- $refresh = request_var('refresh_vc', false) && $config['confirm_refresh'];
-
- $this->type = (int) $type;
-
- if (!strlen($this->confirm_id) || !$this->load_code())
- {
- // we have no confirm ID, better get ready to display something
- $this->generate_code();
- }
- else if ($refresh)
- {
- $this->regenerate_code();
- }
- }
-
- function execute_demo()
- {
- global $user;
-
- $this->code = gen_rand_string_friendly(mt_rand(CAPTCHA_MIN_CHARS, CAPTCHA_MAX_CHARS));
- $this->seed = hexdec(substr(unique_id(), 4, 10));
-
- // compute $seed % 0x7fffffff
- $this->seed -= 0x7fffffff * floor($this->seed / 0x7fffffff);
-
- $captcha = new captcha();
- define('IMAGE_OUTPUT', 1);
- $captcha->execute($this->code, $this->seed);
- }
-
- function execute()
- {
- if (empty($this->code))
- {
- if (!$this->load_code())
- {
- // invalid request, bail out
- return false;
- }
- }
- $captcha = new captcha();
- define('IMAGE_OUTPUT', 1);
- $captcha->execute($this->code, $this->seed);
- }
-
- function get_template()
- {
- global $config, $user, $template, $phpEx, $phpbb_root_path;
-
- if ($this->is_solved())
- {
- return false;
- }
- else
- {
- $link = append_sid($phpbb_root_path . 'ucp.' . $phpEx, 'mode=confirm&amp;confirm_id=' . $this->confirm_id . '&amp;type=' . $this->type);
- $explain = $user->lang(($this->type != CONFIRM_POST) ? 'CONFIRM_EXPLAIN' : 'POST_CONFIRM_EXPLAIN', '<a href="mailto:' . htmlspecialchars($config['board_contact']) . '">', '</a>');
-
- $template->assign_vars(array(
- 'CONFIRM_IMAGE_LINK' => $link,
- 'CONFIRM_IMAGE' => '<img src="' . $link . '" />',
- 'CONFIRM_IMG' => '<img src="' . $link . '" />',
- 'CONFIRM_ID' => $this->confirm_id,
- 'S_CONFIRM_CODE' => true,
- 'S_TYPE' => $this->type,
- 'S_CONFIRM_REFRESH' => ($config['enable_confirm'] && $config['confirm_refresh'] && $this->type == CONFIRM_REG) ? true : false,
- 'L_CONFIRM_EXPLAIN' => $explain,
- ));
-
- return 'captcha_default.html';
- }
- }
-
- function get_demo_template($id)
- {
- global $config, $user, $template, $phpbb_admin_path, $phpEx;
-
- $variables = '';
-
- if (is_array($this->captcha_vars))
- {
- foreach ($this->captcha_vars as $captcha_var => $template_var)
- {
- $variables .= '&amp;' . rawurlencode($captcha_var) . '=' . request_var($captcha_var, (int) $config[$captcha_var]);
- }
- }
-
- // acp_captcha has a delivery function; let's use it
- $template->assign_vars(array(
- 'CONFIRM_IMAGE' => append_sid($phpbb_admin_path . 'index.' . $phpEx, 'captcha_demo=1&amp;mode=visual&amp;i=' . $id . '&amp;select_captcha=' . $this->get_class_name()) . $variables,
- 'CONFIRM_ID' => $this->confirm_id,
- ));
-
- return 'captcha_default_acp_demo.html';
- }
-
- function get_hidden_fields()
- {
- $hidden_fields = array();
-
- // this is required for posting.php - otherwise we would forget about the captcha being already solved
- if ($this->solved)
- {
- $hidden_fields['confirm_code'] = $this->confirm_code;
- }
- $hidden_fields['confirm_id'] = $this->confirm_id;
- return $hidden_fields;
- }
-
- function garbage_collect($type)
- {
- global $db, $config;
-
- $sql = 'SELECT DISTINCT c.session_id
- FROM ' . CONFIRM_TABLE . ' c
- LEFT JOIN ' . SESSIONS_TABLE . ' s ON (c.session_id = s.session_id)
- WHERE s.session_id IS NULL' .
- ((empty($type)) ? '' : ' AND c.confirm_type = ' . (int) $type);
- $result = $db->sql_query($sql);
-
- if ($row = $db->sql_fetchrow($result))
- {
- $sql_in = array();
- do
- {
- $sql_in[] = (string) $row['session_id'];
- }
- while ($row = $db->sql_fetchrow($result));
-
- if (sizeof($sql_in))
- {
- $sql = 'DELETE FROM ' . CONFIRM_TABLE . '
- WHERE ' . $db->sql_in_set('session_id', $sql_in);
- $db->sql_query($sql);
- }
- }
- $db->sql_freeresult($result);
- }
-
- function uninstall()
- {
- $this->garbage_collect(0);
- }
-
- function install()
- {
- return;
- }
-
- function validate()
- {
- global $config, $db, $user;
-
- if (empty($user->lang))
- {
- $user->setup();
- }
-
- $error = '';
- if (!$this->confirm_id)
- {
- $error = $user->lang['CONFIRM_CODE_WRONG'];
- }
- else
- {
- if ($this->check_code())
- {
- // $this->delete_code(); commented out to allow posting.php to repeat the question
- $this->solved = true;
- }
- else
- {
- $error = $user->lang['CONFIRM_CODE_WRONG'];
- }
- }
-
- if (strlen($error))
- {
- // okay, incorrect answer. Let's ask a new question.
- $this->new_attempt();
- return $error;
- }
- else
- {
- return false;
- }
- }
-
- /**
- * The old way to generate code, suitable for GD and non-GD. Resets the internal state.
- */
- function generate_code()
- {
- global $db, $user;
-
- $this->code = gen_rand_string_friendly(mt_rand(CAPTCHA_MIN_CHARS, CAPTCHA_MAX_CHARS));
- $this->confirm_id = md5(unique_id($user->ip));
- $this->seed = hexdec(substr(unique_id(), 4, 10));
- $this->solved = 0;
- // compute $seed % 0x7fffffff
- $this->seed -= 0x7fffffff * floor($this->seed / 0x7fffffff);
-
- $sql = 'INSERT INTO ' . CONFIRM_TABLE . ' ' . $db->sql_build_array('INSERT', array(
- 'confirm_id' => (string) $this->confirm_id,
- 'session_id' => (string) $user->session_id,
- 'confirm_type' => (int) $this->type,
- 'code' => (string) $this->code,
- 'seed' => (int) $this->seed)
- );
- $db->sql_query($sql);
- }
-
- /**
- * New Question, if desired.
- */
- function regenerate_code()
- {
- global $db, $user;
-
- $this->code = gen_rand_string_friendly(mt_rand(CAPTCHA_MIN_CHARS, CAPTCHA_MAX_CHARS));
- $this->seed = hexdec(substr(unique_id(), 4, 10));
- $this->solved = 0;
- // compute $seed % 0x7fffffff
- $this->seed -= 0x7fffffff * floor($this->seed / 0x7fffffff);
-
- $sql = 'UPDATE ' . CONFIRM_TABLE . ' SET ' . $db->sql_build_array('UPDATE', array(
- 'code' => (string) $this->code,
- 'seed' => (int) $this->seed)) . '
- WHERE
- confirm_id = \'' . $db->sql_escape($this->confirm_id) . '\'
- AND session_id = \'' . $db->sql_escape($user->session_id) . '\'';
- $db->sql_query($sql);
- }
-
- /**
- * New Question, if desired.
- */
- function new_attempt()
- {
- global $db, $user;
-
- $this->code = gen_rand_string_friendly(mt_rand(CAPTCHA_MIN_CHARS, CAPTCHA_MAX_CHARS));
- $this->seed = hexdec(substr(unique_id(), 4, 10));
- $this->solved = 0;
- // compute $seed % 0x7fffffff
- $this->seed -= 0x7fffffff * floor($this->seed / 0x7fffffff);
-
- $sql = 'UPDATE ' . CONFIRM_TABLE . ' SET ' . $db->sql_build_array('UPDATE', array(
- 'code' => (string) $this->code,
- 'seed' => (int) $this->seed)) . '
- , attempts = attempts + 1
- WHERE
- confirm_id = \'' . $db->sql_escape($this->confirm_id) . '\'
- AND session_id = \'' . $db->sql_escape($user->session_id) . '\'';
- $db->sql_query($sql);
- }
-
- /**
- * Look up everything we need for painting&checking.
- */
- function load_code()
- {
- global $db, $user;
-
- $sql = 'SELECT code, seed, attempts
- FROM ' . CONFIRM_TABLE . "
- WHERE confirm_id = '" . $db->sql_escape($this->confirm_id) . "'
- AND session_id = '" . $db->sql_escape($user->session_id) . "'
- AND confirm_type = " . $this->type;
- $result = $db->sql_query($sql);
- $row = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
-
- if ($row)
- {
- $this->code = $row['code'];
- $this->seed = $row['seed'];
- $this->attempts = $row['attempts'];
- return true;
- }
-
- return false;
- }
-
- function check_code()
- {
- return (strcasecmp($this->code, $this->confirm_code) === 0);
- }
-
- function delete_code()
- {
- global $db, $user;
-
- $sql = 'DELETE FROM ' . CONFIRM_TABLE . "
- WHERE confirm_id = '" . $db->sql_escape($confirm_id) . "'
- AND session_id = '" . $db->sql_escape($user->session_id) . "'
- AND confirm_type = " . $this->type;
- $db->sql_query($sql);
- }
-
- function get_attempt_count()
- {
- return $this->attempts;
- }
-
- function reset()
- {
- global $db, $user;
-
- $sql = 'DELETE FROM ' . CONFIRM_TABLE . "
- WHERE session_id = '" . $db->sql_escape($user->session_id) . "'
- AND confirm_type = " . (int) $this->type;
- $db->sql_query($sql);
-
- // we leave the class usable by generating a new question
- $this->generate_code();
- }
-
- function is_solved()
- {
- if (request_var('confirm_code', false) && $this->solved === 0)
- {
- $this->validate();
- }
- return (bool) $this->solved;
- }
-
- /**
- * API function
- */
- function has_config()
- {
- return false;
- }
-
-}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/captcha/plugins/phpbb_captcha_gd_plugin.php b/phpBB/includes/captcha/plugins/phpbb_captcha_gd_plugin.php
deleted file mode 100644
index 6e899adc16..0000000000
--- a/phpBB/includes/captcha/plugins/phpbb_captcha_gd_plugin.php
+++ /dev/null
@@ -1,165 +0,0 @@
-<?php
-/**
-*
-* @package VC
-* @version $Id$
-* @copyright (c) 2006, 2008 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
-*
-*/
-
-/**
-* @ignore
-*/
-if (!defined('IN_PHPBB'))
-{
- exit;
-}
-
-/**
-* Placeholder for autoload
-*/
-if (!class_exists('phpbb_default_captcha'))
-{
- include($phpbb_root_path . 'includes/captcha/plugins/captcha_abstract.' . $phpEx);
-}
-
-/**
-* @package VC
-*/
-class phpbb_captcha_gd extends phpbb_default_captcha
-{
-
- var $captcha_vars = array(
- 'captcha_gd_x_grid' => 'CAPTCHA_GD_X_GRID',
- 'captcha_gd_y_grid' => 'CAPTCHA_GD_Y_GRID',
- 'captcha_gd_foreground_noise' => 'CAPTCHA_GD_FOREGROUND_NOISE',
-// 'captcha_gd' => 'CAPTCHA_GD_PREVIEWED',
- 'captcha_gd_wave' => 'CAPTCHA_GD_WAVE',
- 'captcha_gd_3d_noise' => 'CAPTCHA_GD_3D_NOISE',
- 'captcha_gd_fonts' => 'CAPTCHA_GD_FONTS',
- );
-
- function phpbb_captcha_gd()
- {
- global $phpbb_root_path, $phpEx;
-
- if (!class_exists('captcha'))
- {
- include($phpbb_root_path . 'includes/captcha/captcha_gd.' . $phpEx);
- }
- }
-
- function &get_instance()
- {
- $instance =& new phpbb_captcha_gd();
- return $instance;
- }
-
- function is_available()
- {
- global $phpbb_root_path, $phpEx;
-
- if (@extension_loaded('gd'))
- {
- return true;
- }
-
- if (!function_exists('can_load_dll'))
- {
- include($phpbb_root_path . 'includes/functions_install.' . $phpEx);
- }
-
- return can_load_dll('gd');
- }
-
- /**
- * API function
- */
- function has_config()
- {
- return true;
- }
-
- function get_name()
- {
- return 'CAPTCHA_GD';
- }
-
- function get_class_name()
- {
- return 'phpbb_captcha_gd';
- }
-
- function acp_page($id, &$module)
- {
- global $db, $user, $auth, $template;
- global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
-
- $user->add_lang('acp/board');
-
- $config_vars = array(
- 'enable_confirm' => 'REG_ENABLE',
- 'enable_post_confirm' => 'POST_ENABLE',
- 'confirm_refresh' => 'CONFIRM_REFRESH',
- 'captcha_gd' => 'CAPTCHA_GD',
- );
-
- $module->tpl_name = 'captcha_gd_acp';
- $module->page_title = 'ACP_VC_SETTINGS';
- $form_key = 'acp_captcha';
- add_form_key($form_key);
-
- $submit = request_var('submit', '');
-
- if ($submit && check_form_key($form_key))
- {
- $captcha_vars = array_keys($this->captcha_vars);
- foreach ($captcha_vars as $captcha_var)
- {
- $value = request_var($captcha_var, 0);
- if ($value >= 0)
- {
- set_config($captcha_var, $value);
- }
- }
-
- add_log('admin', 'LOG_CONFIG_VISUAL');
- trigger_error($user->lang['CONFIG_UPDATED'] . adm_back_link($module->u_action));
- }
- else if ($submit)
- {
- trigger_error($user->lang['FORM_INVALID'] . adm_back_link($module->u_action));
- }
- else
- {
- foreach ($this->captcha_vars as $captcha_var => $template_var)
- {
- $var = (isset($_REQUEST[$captcha_var])) ? request_var($captcha_var, 0) : $config[$captcha_var];
- $template->assign_var($template_var, $var);
- }
-
- $template->assign_vars(array(
- 'CAPTCHA_PREVIEW' => $this->get_demo_template($id),
- 'CAPTCHA_NAME' => $this->get_class_name(),
- 'U_ACTION' => $module->u_action,
- ));
- }
- }
-
- function execute_demo()
- {
- global $config;
-
- $config_old = $config;
- foreach ($this->captcha_vars as $captcha_var => $template_var)
- {
- $config[$captcha_var] = request_var($captcha_var, (int) $config[$captcha_var]);
- }
- parent::execute_demo();
- $config = $config_old;
- }
-
-}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/captcha/plugins/phpbb_captcha_gd_wave_plugin.php b/phpBB/includes/captcha/plugins/phpbb_captcha_gd_wave_plugin.php
deleted file mode 100644
index 2f55d15efd..0000000000
--- a/phpBB/includes/captcha/plugins/phpbb_captcha_gd_wave_plugin.php
+++ /dev/null
@@ -1,83 +0,0 @@
-<?php
-/**
-*
-* @package VC
-* @version $Id$
-* @copyright (c) 2006, 2008 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
-*
-*/
-
-/**
-* @ignore
-*/
-if (!defined('IN_PHPBB'))
-{
- exit;
-}
-
-/**
-* Placeholder for autoload
-*/
-if (!class_exists('phpbb_default_captcha'))
-{
- include($phpbb_root_path . 'includes/captcha/plugins/captcha_abstract.' . $phpEx);
-}
-
-/**
-* @package VC
-*/
-class phpbb_captcha_gd_wave extends phpbb_default_captcha
-{
-
- function phpbb_captcha_gd_wave()
- {
- global $phpbb_root_path, $phpEx;
-
- if (!class_exists('captcha'))
- {
- include_once($phpbb_root_path . 'includes/captcha/captcha_gd_wave.' . $phpEx);
- }
- }
-
- function get_instance()
- {
- return new phpbb_captcha_gd_wave();
- }
-
- function is_available()
- {
- global $phpbb_root_path, $phpEx;
-
- if (@extension_loaded('gd'))
- {
- return true;
- }
-
- if (!function_exists('can_load_dll'))
- {
- include($phpbb_root_path . 'includes/functions_install.' . $phpEx);
- }
-
- return can_load_dll('gd');
- }
-
- function get_name()
- {
- return 'CAPTCHA_GD_3D';
- }
-
- function get_class_name()
- {
- return 'phpbb_captcha_gd_wave';
- }
-
- function acp_page($id, &$module)
- {
- global $config, $db, $template, $user;
-
- trigger_error($user->lang['CAPTCHA_NO_OPTIONS'] . adm_back_link($module->u_action));
- }
-}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/captcha/plugins/phpbb_captcha_nogd_plugin.php b/phpBB/includes/captcha/plugins/phpbb_captcha_nogd_plugin.php
deleted file mode 100644
index ac30ed4297..0000000000
--- a/phpBB/includes/captcha/plugins/phpbb_captcha_nogd_plugin.php
+++ /dev/null
@@ -1,72 +0,0 @@
-<?php
-/**
-*
-* @package VC
-* @version $Id$
-* @copyright (c) 2006, 2008 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
-*
-*/
-
-/**
-* @ignore
-*/
-if (!defined('IN_PHPBB'))
-{
- exit;
-}
-
-/**
-* Placeholder for autoload
-*/
-if (!class_exists('phpbb_default_captcha'))
-{
- include($phpbb_root_path . 'includes/captcha/plugins/captcha_abstract.' . $phpEx);
-}
-
-/**
-* @package VC
-*/
-class phpbb_captcha_nogd extends phpbb_default_captcha
-{
-
- function phpbb_captcha_nogd()
- {
- global $phpbb_root_path, $phpEx;
-
- if (!class_exists('captcha'))
- {
- include_once($phpbb_root_path . 'includes/captcha/captcha_non_gd.' . $phpEx);
- }
- }
-
- function &get_instance()
- {
- $instance =& new phpbb_captcha_nogd();
- return $instance;
- }
-
- function is_available()
- {
- return true;
- }
-
- function get_name()
- {
- return 'CAPTCHA_NO_GD';
- }
-
- function get_class_name()
- {
- return 'phpbb_captcha_nogd';
- }
-
- function acp_page($id, &$module)
- {
- global $user;
-
- trigger_error($user->lang['CAPTCHA_NO_OPTIONS'] . adm_back_link($module->u_action));
- }
-}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/captcha/plugins/phpbb_captcha_qa_plugin.php b/phpBB/includes/captcha/plugins/phpbb_captcha_qa_plugin.php
deleted file mode 100644
index 45f76bd676..0000000000
--- a/phpBB/includes/captcha/plugins/phpbb_captcha_qa_plugin.php
+++ /dev/null
@@ -1,1022 +0,0 @@
-<?php
-/**
-*
-* @package VC
-* @version $Id$
-* @copyright (c) 2006, 2008 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
-*
-*/
-
-/**
-* @ignore
-*/
-if (!defined('IN_PHPBB'))
-{
- exit;
-}
-
-global $table_prefix;
-
-define('CAPTCHA_QUESTIONS_TABLE', $table_prefix . 'captcha_questions');
-define('CAPTCHA_ANSWERS_TABLE', $table_prefix . 'captcha_answers');
-define('CAPTCHA_QA_CONFIRM_TABLE', $table_prefix . 'qa_confirm');
-
-/**
-* And now to something completely different. Let's make a captcha without extending the abstract class.
-* QA CAPTCHA sample implementation
-*
-* @package VC
-*/
-class phpbb_captcha_qa
-{
- var $confirm_id;
- var $answer;
- var $question_ids;
- var $question_text;
- var $question_lang;
- var $question_strict;
- var $attempts = 0;
- var $type;
- // dirty trick: 0 is false, but can still encode that the captcha is not yet validated
- var $solved = 0;
-
- /**
- * @param int $type as per the CAPTCHA API docs, the type
- */
- function init($type)
- {
- global $config, $db, $user;
-
- // load our language file
- $user->add_lang('captcha_qa');
-
- // read input
- $this->confirm_id = request_var('qa_confirm_id', '');
- $this->answer = utf8_normalize_nfc(request_var('qa_answer', '', true));
-
- $this->type = (int) $type;
- $this->question_lang = $user->lang_name;
-
- // we need all defined questions - shouldn't be too many, so we can just grab them
- // try the user's lang first
- $sql = 'SELECT question_id
- FROM ' . CAPTCHA_QUESTIONS_TABLE . "
- WHERE lang_iso = '" . $db->sql_escape($user->lang_name) . "'";
- $result = $db->sql_query($sql, 3600);
-
- while ($row = $db->sql_fetchrow($result))
- {
- $this->question_ids[$row['question_id']] = $row['question_id'];
- }
- $db->sql_freeresult($result);
-
- // fallback to the board default lang
- if (!sizeof($this->question_ids))
- {
- $this->question_lang = $config['default_lang'];
-
- $sql = 'SELECT question_id
- FROM ' . CAPTCHA_QUESTIONS_TABLE . "
- WHERE lang_iso = '" . $db->sql_escape($config['default_lang']) . "'";
- $result = $db->sql_query($sql, 7200);
-
- while ($row = $db->sql_fetchrow($result))
- {
- $this->question_ids[$row['question_id']] = $row['question_id'];
- }
- $db->sql_freeresult($result);
- }
-
- // okay, if there is a confirm_id, we try to load that confirm's state. If not, we try to find one
- if (!$this->load_answer() && (!$this->load_confirm_id() || !$this->load_answer()))
- {
- // we have no valid confirm ID, better get ready to ask something
- $this->select_question();
- }
- }
-
- /**
- * API function
- */
- function &get_instance()
- {
- $instance =& new phpbb_captcha_qa();
-
- return $instance;
- }
-
- /**
- * See if the captcha has created its tables.
- */
- function is_installed()
- {
- global $db, $phpbb_root_path, $phpEx;
-
- if (!class_exists('phpbb_db_tools'))
- {
- include("$phpbb_root_path/includes/db/db_tools.$phpEx");
- }
- $db_tool = new phpbb_db_tools($db);
-
- return $db_tool->sql_table_exists(CAPTCHA_QUESTIONS_TABLE);
- }
-
- /**
- * API function - for the captcha to be available, it must have installed itself and there has to be at least one question in the board's default lang
- */
- function is_available()
- {
- global $config, $db, $phpbb_root_path, $phpEx, $user;
-
- // load language file for pretty display in the ACP dropdown
- $user->add_lang('captcha_qa');
-
- if (!phpbb_captcha_qa::is_installed())
- {
- return false;
- }
-
- $sql = 'SELECT COUNT(question_id) AS question_count
- FROM ' . CAPTCHA_QUESTIONS_TABLE . "
- WHERE lang_iso = '" . $db->sql_escape($config['default_lang']) . "'";
- $result = $db->sql_query($sql);
- $row = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
-
- return ((bool) $row['question_count']);
- }
-
- /**
- * API function
- */
- function has_config()
- {
- return true;
- }
-
- /**
- * API function
- */
- function get_name()
- {
- return 'CAPTCHA_QA';
- }
-
- /**
- * API function
- */
- function get_class_name()
- {
- return 'phpbb_captcha_qa';
- }
-
- /**
- * API function - not needed as we don't display an image
- */
- function execute_demo()
- {
- }
-
- /**
- * API function - not needed as we don't display an image
- */
- function execute()
- {
- }
-
- /**
- * API function - send the question to the template
- */
- function get_template()
- {
- global $template;
-
- if ($this->is_solved())
- {
- return false;
- }
- else
- {
- $template->assign_vars(array(
- 'QA_CONFIRM_QUESTION' => $this->question_text,
- 'QA_CONFIRM_ID' => $this->confirm_id,
- 'S_CONFIRM_CODE' => true,
- 'S_TYPE' => $this->type,
- ));
-
- return 'captcha_qa.html';
- }
- }
-
- /**
- * API function - we just display a mockup so that the captcha doesn't need to be installed
- */
- function get_demo_template()
- {
- global $config, $db, $template;
-
- if ($this->is_available())
- {
- $sql = 'SELECT question_text
- FROM ' . CAPTCHA_QUESTIONS_TABLE . "
- WHERE lang_iso = '" . $db->sql_escape($config['default_lang']) . "'";
- $result = $db->sql_query_limit($sql, 1);
- if ($row = $db->sql_fetchrow($result))
- {
- $template->assign_vars(array(
- 'QA_CONFIRM_QUESTION' => $row['question_text'],
- ));
- }
- $db->sql_freeresult($result);
- }
- return 'captcha_qa_acp_demo.html';
- }
-
- /**
- * API function
- */
- function get_hidden_fields()
- {
- $hidden_fields = array();
-
- // this is required - otherwise we would forget about the captcha being already solved
- if ($this->solved)
- {
- $hidden_fields['qa_answer'] = $this->answer;
- }
- $hidden_fields['qa_confirm_id'] = $this->confirm_id;
-
- return $hidden_fields;
- }
-
- /**
- * API function
- */
- function garbage_collect($type = 0)
- {
- global $db, $config;
-
- $sql = 'SELECT c.confirm_id
- FROM ' . CAPTCHA_QA_CONFIRM_TABLE . ' c
- LEFT JOIN ' . SESSIONS_TABLE . ' s
- ON (c.session_id = s.session_id)
- WHERE s.session_id IS NULL' .
- ((empty($type)) ? '' : ' AND c.confirm_type = ' . (int) $type);
- $result = $db->sql_query($sql);
-
- if ($row = $db->sql_fetchrow($result))
- {
- $sql_in = array();
-
- do
- {
- $sql_in[] = (string) $row['confirm_id'];
- }
- while ($row = $db->sql_fetchrow($result));
-
- if (sizeof($sql_in))
- {
- $sql = 'DELETE FROM ' . CAPTCHA_QA_CONFIRM_TABLE . '
- WHERE ' . $db->sql_in_set('confirm_id', $sql_in);
- $db->sql_query($sql);
- }
- }
- $db->sql_freeresult($result);
- }
-
- /**
- * API function - we don't drop the tables here, as that would cause the loss of all entered questions.
- */
- function uninstall()
- {
- $this->garbage_collect(0);
- }
-
- /**
- * API function - set up shop
- */
- function install()
- {
- global $db, $phpbb_root_path, $phpEx;
-
- if (!class_exists('phpbb_db_tools'))
- {
- include("$phpbb_root_path/includes/db/db_tools.$phpEx");
- }
- $db_tool = new phpbb_db_tools($db);
-
- $tables = array(CAPTCHA_QUESTIONS_TABLE, CAPTCHA_ANSWERS_TABLE, CAPTCHA_QA_CONFIRM_TABLE);
-
- $schemas = array(
- CAPTCHA_QUESTIONS_TABLE => array (
- 'COLUMNS' => array(
- 'question_id' => array('UINT', Null, 'auto_increment'),
- 'strict' => array('BOOL', 0),
- 'lang_id' => array('UINT', 0),
- 'lang_iso' => array('VCHAR:30', ''),
- 'question_text' => array('TEXT_UNI', ''),
- ),
- 'PRIMARY_KEY' => 'question_id',
- 'KEYS' => array(
- 'lang' => array('INDEX', 'lang_iso'),
- ),
- ),
- CAPTCHA_ANSWERS_TABLE => array (
- 'COLUMNS' => array(
- 'question_id' => array('UINT', 0),
- 'answer_text' => array('STEXT_UNI', ''),
- ),
- 'KEYS' => array(
- 'qid' => array('INDEX', 'question_id'),
- ),
- ),
- CAPTCHA_QA_CONFIRM_TABLE => array (
- 'COLUMNS' => array(
- 'session_id' => array('CHAR:32', ''),
- 'confirm_id' => array('CHAR:32', ''),
- 'lang_iso' => array('VCHAR:30', ''),
- 'question_id' => array('UINT', 0),
- 'attempts' => array('UINT', 0),
- 'confirm_type' => array('USINT', 0),
- ),
- 'KEYS' => array(
- 'session_id' => array('INDEX', 'session_id'),
- 'lookup' => array('INDEX', array('confirm_id', 'session_id', 'lang_iso')),
- ),
- 'PRIMARY_KEY' => 'confirm_id',
- ),
- );
-
- foreach($schemas as $table => $schema)
- {
- if (!$db_tool->sql_table_exists($table))
- {
- $db_tool->sql_create_table($table, $schema);
- }
- }
- }
-
- /**
- * API function - see what has to be done to validate
- */
- function validate()
- {
- global $config, $db, $user;
-
- $error = '';
-
- if (!sizeof($this->question_ids))
- {
- return false;
- }
-
- if (!$this->confirm_id)
- {
- $error = $user->lang['CONFIRM_QUESTION_WRONG'];
- }
- else
- {
- if ($this->check_answer())
- {
- // $this->delete_code(); commented out to allow posting.php to repeat the question
- $this->solved = true;
- }
- else
- {
- $error = $user->lang['CONFIRM_QUESTION_WRONG'];
- }
- }
-
- if (strlen($error))
- {
- // okay, incorrect answer. Let's ask a new question.
- $this->new_attempt();
- $this->solved = false;
-
- return $error;
- }
- else
- {
- return false;
- }
- }
-
- /**
- * Select a question
- */
- function select_question()
- {
- global $db, $user;
-
- if (!sizeof($this->question_ids))
- {
- return false;
- }
- $this->confirm_id = md5(unique_id($user->ip));
- $this->question = (int) array_rand($this->question_ids);
-
- $sql = 'INSERT INTO ' . CAPTCHA_QA_CONFIRM_TABLE . ' ' . $db->sql_build_array('INSERT', array(
- 'confirm_id' => (string) $this->confirm_id,
- 'session_id' => (string) $user->session_id,
- 'lang_iso' => (string) $this->question_lang,
- 'confirm_type' => (int) $this->type,
- 'question_id' => (int) $this->question,
- ));
- $db->sql_query($sql);
-
- $this->load_answer();
- }
-
- /**
- * New Question, if desired.
- */
- function reselect_question()
- {
- global $db, $user;
-
- if (!sizeof($this->question_ids))
- {
- return false;
- }
-
- $this->question = (int) array_rand($this->question_ids);
- $this->solved = 0;
-
- $sql = 'UPDATE ' . CAPTCHA_QA_CONFIRM_TABLE . '
- SET question_id = ' . (int) $this->question . "
- WHERE confirm_id = '" . $db->sql_escape($this->confirm_id) . "'
- AND session_id = '" . $db->sql_escape($user->session_id) . "'";
- $db->sql_query($sql);
-
- $this->load_answer();
- }
-
- /**
- * Wrong answer, so we increase the attempts and use a different question.
- */
- function new_attempt()
- {
- global $db, $user;
-
- // yah, I would prefer a stronger rand, but this should work
- $this->question = (int) array_rand($this->question_ids);
- $this->solved = 0;
-
- $sql = 'UPDATE ' . CAPTCHA_QA_CONFIRM_TABLE . '
- SET question_id = ' . (int) $this->question . ",
- attempts = attempts + 1
- WHERE confirm_id = '" . $db->sql_escape($this->confirm_id) . "'
- AND session_id = '" . $db->sql_escape($user->session_id) . "'";
- $db->sql_query($sql);
-
- $this->load_answer();
- }
-
-
- /**
- * See if there is already an entry for the current session.
- */
- function load_confirm_id()
- {
- global $db, $user;
-
- $sql = 'SELECT confirm_id
- FROM ' . CAPTCHA_QA_CONFIRM_TABLE . "
- WHERE
- session_id = '" . $db->sql_escape($user->session_id) . "'
- AND lang_iso = '" . $db->sql_escape($this->question_lang) . "'
- AND confirm_type = " . $this->type;
- $result = $db->sql_query_limit($sql, 1);
- $row = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
-
- if ($row)
- {
- $this->confirm_id = $row['confirm_id'];
- return true;
- }
- return false;
- }
-
- /**
- * Look up everything we need and populate the instance variables.
- */
- function load_answer()
- {
- global $db, $user;
-
- if (!strlen($this->confirm_id) || !sizeof($this->question_ids))
- {
- return false;
- }
-
- $sql = 'SELECT con.question_id, attempts, question_text, strict
- FROM ' . CAPTCHA_QA_CONFIRM_TABLE . ' con, ' . CAPTCHA_QUESTIONS_TABLE . " qes
- WHERE con.question_id = qes.question_id
- AND confirm_id = '" . $db->sql_escape($this->confirm_id) . "'
- AND session_id = '" . $db->sql_escape($user->session_id) . "'
- AND qes.lang_iso = '" . $db->sql_escape($this->question_lang) . "'
- AND confirm_type = " . $this->type;
- $result = $db->sql_query($sql);
- $row = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
-
- if ($row)
- {
- $this->question = $row['question_id'];
-
- $this->attempts = $row['attempts'];
- $this->question_strict = $row['strict'];
- $this->question_text = $row['question_text'];
-
- return true;
- }
-
- return false;
- }
-
- /**
- * The actual validation
- */
- function check_answer()
- {
- global $db;
-
- $answer = ($this->question_strict) ? utf8_normalize_nfc(request_var('qa_answer', '', true)) : utf8_clean_string(utf8_normalize_nfc(request_var('qa_answer', '', true)));
-
- $sql = 'SELECT answer_text
- FROM ' . CAPTCHA_ANSWERS_TABLE . '
- WHERE question_id = ' . (int) $this->question;
- $result = $db->sql_query($sql);
-
- while ($row = $db->sql_fetchrow($result))
- {
- $solution = ($this->question_strict) ? $row['answer_text'] : utf8_clean_string($row['answer_text']);
-
- if ($solution === $answer)
- {
- $this->solved = true;
-
- break;
- }
- }
- $db->sql_freeresult($result);
-
- return $this->solved;
- }
-
- /**
- * API function - clean the entry
- */
- function delete_code()
- {
- global $db, $user;
-
- $sql = 'DELETE FROM ' . CAPTCHA_QA_CONFIRM_TABLE . "
- WHERE confirm_id = '" . $db->sql_escape($confirm_id) . "'
- AND session_id = '" . $db->sql_escape($user->session_id) . "'
- AND confirm_type = " . $this->type;
- $db->sql_query($sql);
- }
-
- /**
- * API function
- */
- function get_attempt_count()
- {
- return $this->attempts;
- }
-
- /**
- * API function
- */
- function reset()
- {
- global $db, $user;
-
- $sql = 'DELETE FROM ' . CAPTCHA_QA_CONFIRM_TABLE . "
- WHERE session_id = '" . $db->sql_escape($user->session_id) . "'
- AND confirm_type = " . (int) $this->type;
- $db->sql_query($sql);
-
- // we leave the class usable by generating a new question
- $this->select_question();
- }
-
- /**
- * API function
- */
- function is_solved()
- {
- if (request_var('qa_answer', false) && $this->solved === 0)
- {
- $this->validate();
- }
-
- return (bool) $this->solved;
- }
-
- /**
- * API function - The ACP backend, this marks the end of the easy methods
- */
- function acp_page($id, &$module)
- {
- global $db, $user, $auth, $template;
- global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
-
- $user->add_lang('acp/board');
- $user->add_lang('captcha_qa');
-
- if (!$this->is_installed())
- {
- $this->install();
- }
-
- $module->tpl_name = 'captcha_qa_acp';
- $module->page_title = 'ACP_VC_SETTINGS';
- $form_key = 'acp_captcha';
- add_form_key($form_key);
-
- $submit = request_var('submit', false);
- $question_id = request_var('question_id', 0);
- $action = request_var('action', '');
-
- // we have two pages, so users might want to navigate from one to the other
- $list_url = $module->u_action . "&amp;configure=1&amp;select_captcha=" . $this->get_class_name();
-
- $template->assign_vars(array(
- 'U_ACTION' => $module->u_action,
- 'QUESTION_ID' => $question_id ,
- 'CLASS' => $this->get_class_name(),
- ));
-
- // show the list?
- if (!$question_id && $action != 'add')
- {
- $this->acp_question_list($module);
- }
- else if ($question_id && $action == 'delete')
- {
- if ($this->get_class_name() !== $config['captcha_plugin'] || !$this->acp_is_last($question_id))
- {
- if (confirm_box(true))
- {
- $this->acp_delete_question($question_id);
-
- trigger_error($user->lang['QUESTION_DELETED'] . adm_back_link($list_url));
- }
- else
- {
- confirm_box(false, $user->lang['CONFIRM_OPERATION'], build_hidden_fields(array(
- 'question_id' => $question_id,
- 'action' => $action,
- 'configure' => 1,
- 'select_captcha' => $this->get_class_name(),
- ))
- );
- }
- }
- else
- {
- trigger_error($user->lang['QA_LAST_QUESTION'] . adm_back_link($list_url), E_USER_WARNING);
- }
- }
- else
- {
- // okay, show the editor
- $error = false;
- $input_question = request_var('question_text', '', true);
- $input_answers = request_var('answers', '', true);
- $input_lang = request_var('lang_iso', '', true);
- $input_strict = request_var('strict', false);
- $langs = $this->get_languages();
-
- foreach ($langs as $lang => $entry)
- {
- $template->assign_block_vars('langs', array(
- 'ISO' => $lang,
- 'NAME' => $entry['name'],
- ));
- }
-
- $template->assign_vars(array(
- 'U_LIST' => $list_url,
- ));
-
- if ($question_id)
- {
- if ($question = $this->acp_get_question_data($question_id))
- {
- $answers = (isset($input_answers[$lang])) ? $input_answers[$lang] : implode("\n", $question['answers']);
-
- $template->assign_vars(array(
- 'QUESTION_TEXT' => ($input_question) ? $input_question : $question['question_text'],
- 'LANG_ISO' => ($input_lang) ? $input_lang : $question['lang_iso'],
- 'STRICT' => (isset($_REQUEST['strict'])) ? $input_strict : $question['strict'],
- 'ANSWERS' => $answers,
- ));
- }
- else
- {
- trigger_error($user->lang['FORM_INVALID'] . adm_back_link($list_url));
- }
- }
- else
- {
- $template->assign_vars(array(
- 'QUESTION_TEXT' => $input_question,
- 'LANG_ISO' => $input_lang,
- 'STRICT' => $input_strict,
- 'ANSWERS' => $input_answers,
- ));
- }
-
- if ($submit && check_form_key($form_key))
- {
- $data = $this->acp_get_question_input();
-
- if (!$this->validate_input($data))
- {
- $template->assign_vars(array(
- 'S_ERROR' => true,
- ));
- }
- else
- {
- if ($question_id)
- {
- $this->acp_update_question($data, $question_id);
- }
- else
- {
- $this->acp_add_question($data);
- }
-
- add_log('admin', 'LOG_CONFIG_VISUAL');
- trigger_error($user->lang['CONFIG_UPDATED'] . adm_back_link($list_url));
- }
- }
- else if ($submit)
- {
- trigger_error($user->lang['FORM_INVALID'] . adm_back_link($list_url), E_USER_WARNING);
- }
- }
- }
-
- /**
- * This handles the list overview
- */
- function acp_question_list(&$module)
- {
- global $db, $template;
-
- $sql = 'SELECT *
- FROM ' . CAPTCHA_QUESTIONS_TABLE;
- $result = $db->sql_query($sql);
-
- $template->assign_vars(array(
- 'S_LIST' => true,
- ));
-
- while ($row = $db->sql_fetchrow($result))
- {
- $url = $module->u_action . "&amp;question_id={$row['question_id']}&amp;configure=1&amp;select_captcha=" . $this->get_class_name() . '&amp;';
-
- $template->assign_block_vars('questions', array(
- 'QUESTION_TEXT' => $row['question_text'],
- 'QUESTION_ID' => $row['question_id'],
- 'QUESTION_LANG' => $row['lang_iso'],
- 'U_DELETE' => "{$url}action=delete",
- 'U_EDIT' => "{$url}action=edit",
- ));
- }
- $db->sql_freeresult($result);
- }
-
- /**
- * Grab a question and bring it into a format the editor understands
- */
- function acp_get_question_data($question_id)
- {
- global $db;
-
- if ($question_id)
- {
- $sql = 'SELECT *
- FROM ' . CAPTCHA_QUESTIONS_TABLE . '
- WHERE question_id = ' . $question_id;
- $result = $db->sql_query($sql);
- $question = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
-
- if (!$question)
- {
- return false;
- }
-
- $question['answers'] = array();
-
- $sql = 'SELECT *
- FROM ' . CAPTCHA_ANSWERS_TABLE . '
- WHERE question_id = ' . $question_id;
- $result = $db->sql_query($sql);
-
- while ($row = $db->sql_fetchrow($result))
- {
- $question['answers'][] = $row['answer_text'];
- }
- $db->sql_freeresult($result);
-
- return $question;
- }
- }
-
- /**
- * Grab a question from input and bring it into a format the editor understands
- */
- function acp_get_question_input()
- {
- $answers = utf8_normalize_nfc(request_var('answers', '', true));
- $question = array(
- 'question_text' => request_var('question_text', '', true),
- 'strict' => request_var('strict', false),
- 'lang_iso' => request_var('lang_iso', ''),
- 'answers' => (strlen($answers)) ? explode("\n", $answers) : '',
- );
-
- return $question;
- }
-
- /**
- * Update a question.
- * param mixed $data : an array as created from acp_get_question_input or acp_get_question_data
- */
- function acp_update_question($data, $question_id)
- {
- global $db, $cache;
-
- // easier to delete all answers than to figure out which to update
- $sql = 'DELETE FROM ' . CAPTCHA_ANSWERS_TABLE . " WHERE question_id = $question_id";
- $db->sql_query($sql);
-
- $langs = $this->get_languages();
- $question_ary = $data;
- $question_ary['lang_id'] = $langs[$question_ary['lang_iso']]['id'];
- unset($question_ary['answers']);
-
- $sql = 'UPDATE ' . CAPTCHA_QUESTIONS_TABLE . '
- SET ' . $db->sql_build_array('UPDATE', $question_ary) . "
- WHERE question_id = $question_id";
- $db->sql_query($sql);
-
- $this->acp_insert_answers($data, $question_id);
-
- $cache->destroy('sql', CAPTCHA_QUESTIONS_TABLE);
- }
-
- /**
- * Insert a question.
- * param mixed $data : an array as created from acp_get_question_input or acp_get_question_data
- */
- function acp_add_question($data)
- {
- global $db, $cache;
-
- $langs = $this->get_languages();
- $question_ary = $data;
-
- $question_ary['lang_id'] = $langs[$data['lang_iso']]['id'];
- unset($question_ary['answers']);
-
- $sql = 'INSERT INTO ' . CAPTCHA_QUESTIONS_TABLE . ' ' . $db->sql_build_array('INSERT', $question_ary);
- $db->sql_query($sql);
-
- $question_id = $db->sql_nextid();
-
- $this->acp_insert_answers($data, $question_id);
-
- $cache->destroy('sql', CAPTCHA_QUESTIONS_TABLE);
- }
-
- /**
- * Insert the answers.
- * param mixed $data : an array as created from acp_get_question_input or acp_get_question_data
- */
- function acp_insert_answers($data, $question_id)
- {
- global $db, $cache;
-
- foreach ($data['answers'] as $answer)
- {
- $answer_ary = array(
- 'question_id' => $question_id,
- 'answer_text' => $answer,
- );
-
- $sql = 'INSERT INTO ' . CAPTCHA_ANSWERS_TABLE . ' ' . $db->sql_build_array('INSERT', $answer_ary);
- $db->sql_query($sql);
- }
-
- $cache->destroy('sql', CAPTCHA_ANSWERS_TABLE);
- }
-
- /**
- * Delete a question.
- */
- function acp_delete_question($question_id)
- {
- global $db, $cache;
-
- $tables = array(CAPTCHA_QUESTIONS_TABLE, CAPTCHA_ANSWERS_TABLE);
-
- foreach ($tables as $table)
- {
- $sql = "DELETE FROM $table
- WHERE question_id = $question_id";
- $db->sql_query($sql);
- }
-
- $cache->destroy('sql', $tables);
- }
-
- /**
- * Check if the entered data can be inserted/used
- * param mixed $data : an array as created from acp_get_question_input or acp_get_question_data
- */
- function validate_input($question_data)
- {
- $langs = $this->get_languages();
-
- if (!isset($question_data['lang_iso']) ||
- !isset($question_data['question_text']) ||
- !isset($question_data['strict']) ||
- !isset($question_data['answers']))
- {
- return false;
- }
-
- if (!isset($langs[$question_data['lang_iso']]) ||
- !strlen($question_data['question_text']) ||
- !sizeof($question_data['answers']) ||
- !is_array($question_data['answers']))
- {
- return false;
- }
-
- return true;
- }
-
- /**
- * List the installed language packs
- */
- function get_languages()
- {
- global $db;
-
- $sql = 'SELECT *
- FROM ' . LANG_TABLE;
- $result = $db->sql_query($sql);
-
- $langs = array();
- while ($row = $db->sql_fetchrow($result))
- {
- $langs[$row['lang_iso']] = array(
- 'name' => $row['lang_local_name'],
- 'id' => (int) $row['lang_id'],
- );
- }
- $db->sql_freeresult($result);
-
- return $langs;
- }
-
-
-
- /**
- * See if there is a question other than the one we have
- */
- function acp_is_last($question_id)
- {
- global $config, $db;
-
- if ($question_id)
- {
- $sql = 'SELECT question_id
- FROM ' . CAPTCHA_QUESTIONS_TABLE . "
- WHERE lang_iso = '" . $db->sql_escape($config['default_lang']) . "'
- AND question_id <> " . (int) $question_id;
- $result = $db->sql_query_limit($sql, 1);
- $question = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
-
- if (!$question)
- {
- return true;
- }
- return false;
- }
- }
-}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/captcha/plugins/phpbb_recaptcha_plugin.php b/phpBB/includes/captcha/plugins/phpbb_recaptcha_plugin.php
deleted file mode 100644
index 0b0270f568..0000000000
--- a/phpBB/includes/captcha/plugins/phpbb_recaptcha_plugin.php
+++ /dev/null
@@ -1,345 +0,0 @@
-<?php
-/**
-*
-* @package VC
-* @version $Id$
-* @copyright (c) 2006, 2008 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
-*
-*/
-
-/**
-* @ignore
-*/
-if (!defined('IN_PHPBB'))
-{
- exit;
-}
-
-if (!class_exists('phpbb_default_captcha'))
-{
- // we need the classic captcha code for tracking solutions and attempts
- include($phpbb_root_path . 'includes/captcha/plugins/captcha_abstract.' . $phpEx);
-}
-
-/**
-* @package VC
-*/
-class phpbb_recaptcha extends phpbb_default_captcha
-{
- var $recaptcha_server = 'http://www.google.com/recaptcha/api';
- var $recaptcha_server_secure = 'https://www.google.com/recaptcha/api'; // class constants :(
-
- // We are opening a socket to port 80 of this host and send
- // the POST request asking for verification to the path specified here.
- var $recaptcha_verify_server = 'www.google.com';
- var $recaptcha_verify_path = '/recaptcha/api/verify';
-
- var $challenge;
- var $response;
-
- // PHP4 Constructor
- function phpbb_recaptcha()
- {
- $this->recaptcha_server = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? $this->recaptcha_server_secure : $this->recaptcha_server;
- }
-
- function init($type)
- {
- global $config, $db, $user;
-
- $user->add_lang('captcha_recaptcha');
- parent::init($type);
- $this->challenge = request_var('recaptcha_challenge_field', '');
- $this->response = request_var('recaptcha_response_field', '');
- }
-
- function &get_instance()
- {
- $instance =& new phpbb_recaptcha();
- return $instance;
- }
-
- function is_available()
- {
- global $config, $user;
- $user->add_lang('captcha_recaptcha');
- return (isset($config['recaptcha_pubkey']) && !empty($config['recaptcha_pubkey']));
- }
-
- /**
- * API function
- */
- function has_config()
- {
- return true;
- }
-
- function get_name()
- {
- return 'CAPTCHA_RECAPTCHA';
- }
-
- function get_class_name()
- {
- return 'phpbb_recaptcha';
- }
-
- function acp_page($id, &$module)
- {
- global $config, $db, $template, $user;
-
- $captcha_vars = array(
- 'recaptcha_pubkey' => 'RECAPTCHA_PUBKEY',
- 'recaptcha_privkey' => 'RECAPTCHA_PRIVKEY',
- );
-
- $module->tpl_name = 'captcha_recaptcha_acp';
- $module->page_title = 'ACP_VC_SETTINGS';
- $form_key = 'acp_captcha';
- add_form_key($form_key);
-
- $submit = request_var('submit', '');
-
- if ($submit && check_form_key($form_key))
- {
- $captcha_vars = array_keys($captcha_vars);
- foreach ($captcha_vars as $captcha_var)
- {
- $value = request_var($captcha_var, '');
- if ($value)
- {
- set_config($captcha_var, $value);
- }
- }
-
- add_log('admin', 'LOG_CONFIG_VISUAL');
- trigger_error($user->lang['CONFIG_UPDATED'] . adm_back_link($module->u_action));
- }
- else if ($submit)
- {
- trigger_error($user->lang['FORM_INVALID'] . adm_back_link($module->u_action));
- }
- else
- {
- foreach ($captcha_vars as $captcha_var => $template_var)
- {
- $var = (isset($_REQUEST[$captcha_var])) ? request_var($captcha_var, '') : ((isset($config[$captcha_var])) ? $config[$captcha_var] : '');
- $template->assign_var($template_var, $var);
- }
-
- $template->assign_vars(array(
- 'CAPTCHA_PREVIEW' => $this->get_demo_template($id),
- 'CAPTCHA_NAME' => $this->get_class_name(),
- 'U_ACTION' => $module->u_action,
- ));
-
- }
- }
-
- // not needed
- function execute_demo()
- {
- }
-
- // not needed
- function execute()
- {
- }
-
- function get_template()
- {
- global $config, $user, $template;
-
- if ($this->is_solved())
- {
- return false;
- }
- else
- {
- $explain = $user->lang(($this->type != CONFIRM_POST) ? 'CONFIRM_EXPLAIN' : 'POST_CONFIRM_EXPLAIN', '<a href="mailto:' . htmlspecialchars($config['board_contact']) . '">', '</a>');
-
- $template->assign_vars(array(
- 'RECAPTCHA_SERVER' => $this->recaptcha_server,
- 'RECAPTCHA_PUBKEY' => isset($config['recaptcha_pubkey']) ? $config['recaptcha_pubkey'] : '',
- 'RECAPTCHA_ERRORGET' => '',
- 'S_RECAPTCHA_AVAILABLE' => $this->is_available(),
- 'S_CONFIRM_CODE' => true,
- 'S_TYPE' => $this->type,
- 'L_CONFIRM_EXPLAIN' => $explain,
- ));
-
- return 'captcha_recaptcha.html';
- }
- }
-
- function get_demo_template($id)
- {
- return $this->get_template();
- }
-
- function get_hidden_fields()
- {
- $hidden_fields = array();
-
- // this is required for posting.php - otherwise we would forget about the captcha being already solved
- if ($this->solved)
- {
- $hidden_fields['confirm_code'] = $this->code;
- }
- $hidden_fields['confirm_id'] = $this->confirm_id;
- return $hidden_fields;
- }
-
- function uninstall()
- {
- $this->garbage_collect(0);
- }
-
- function install()
- {
- return;
- }
-
- function validate()
- {
- if (!parent::validate())
- {
- return false;
- }
- else
- {
- return $this->recaptcha_check_answer();
- }
- }
-
-// Code from here on is based on recaptchalib.php
-/*
- * This is a PHP library that handles calling reCAPTCHA.
- * - Documentation and latest version
- * http://recaptcha.net/plugins/php/
- * - Get a reCAPTCHA API Key
- * http://recaptcha.net/api/getkey
- * - Discussion group
- * http://groups.google.com/group/recaptcha
- *
- * Copyright (c) 2007 reCAPTCHA -- http://recaptcha.net
- * AUTHORS:
- * Mike Crawford
- * Ben Maurer
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-
- /**
- * Submits an HTTP POST to a reCAPTCHA server
- * @param string $host
- * @param string $path
- * @param array $data
- * @param int port
- * @return array response
- */
- function _recaptcha_http_post($host, $path, $data, $port = 80)
- {
- $req = $this->_recaptcha_qsencode ($data);
-
- $http_request = "POST $path HTTP/1.0\r\n";
- $http_request .= "Host: $host\r\n";
- $http_request .= "Content-Type: application/x-www-form-urlencoded;\r\n";
- $http_request .= "Content-Length: " . strlen($req) . "\r\n";
- $http_request .= "User-Agent: reCAPTCHA/PHP/phpBB\r\n";
- $http_request .= "\r\n";
- $http_request .= $req;
-
- $response = '';
- if (false == ($fs = @fsockopen($host, $port, $errno, $errstr, 10)))
- {
- trigger_error('Could not open socket', E_USER_ERROR);
- }
-
- fwrite($fs, $http_request);
-
- while (!feof($fs))
- {
- // One TCP-IP packet
- $response .= fgets($fs, 1160);
- }
- fclose($fs);
- $response = explode("\r\n\r\n", $response, 2);
-
- return $response;
- }
-
- /**
- * Calls an HTTP POST function to verify if the user's guess was correct
- * @param array $extra_params an array of extra variables to post to the server
- * @return ReCaptchaResponse
- */
- function recaptcha_check_answer($extra_params = array())
- {
- global $config, $user;
-
- //discard spam submissions
- if ($this->challenge == null || strlen($this->challenge) == 0 || $this->response == null || strlen($this->response) == 0)
- {
- return $user->lang['RECAPTCHA_INCORRECT'];
- }
-
- $response = $this->_recaptcha_http_post($this->recaptcha_verify_server, $this->recaptcha_verify_path,
- array(
- 'privatekey' => $config['recaptcha_privkey'],
- 'remoteip' => $user->ip,
- 'challenge' => $this->challenge,
- 'response' => $this->response
- ) + $extra_params
- );
-
- $answers = explode("\n", $response[1]);
-
- if (trim($answers[0]) === 'true')
- {
- $this->solved = true;
- return false;
- }
- else
- {
- return $user->lang['RECAPTCHA_INCORRECT'];
- }
- }
-
- /**
- * Encodes the given data into a query string format
- * @param $data - array of string elements to be encoded
- * @return string - encoded request
- */
- function _recaptcha_qsencode($data)
- {
- $req = '';
- foreach ($data as $key => $value)
- {
- $req .= $key . '=' . urlencode(stripslashes($value)) . '&';
- }
-
- // Cut the last '&'
- $req = substr($req, 0, strlen($req) - 1);
- return $req;
- }
-}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/compatibility_globals.php b/phpBB/includes/compatibility_globals.php
new file mode 100644
index 0000000000..54c9287c96
--- /dev/null
+++ b/phpBB/includes/compatibility_globals.php
@@ -0,0 +1,47 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+/**
+*/
+if (!defined('IN_PHPBB'))
+{
+ exit;
+}
+
+// set up caching
+$cache = $phpbb_container->get('cache');
+
+// Instantiate some basic classes
+$phpbb_dispatcher = $phpbb_container->get('dispatcher');
+$request = $phpbb_container->get('request');
+$user = $phpbb_container->get('user');
+$auth = $phpbb_container->get('auth');
+$db = $phpbb_container->get('dbal.conn');
+
+// make sure request_var uses this request instance
+request_var('', 0, false, false, $request); // "dependency injection" for a function
+
+// Grab global variables, re-cache if necessary
+$config = $phpbb_container->get('config');
+set_config(null, null, null, $config);
+set_config_count(null, null, null, $config);
+
+$phpbb_log = $phpbb_container->get('log');
+$symfony_request = $phpbb_container->get('symfony_request');
+$phpbb_filesystem = $phpbb_container->get('filesystem');
+$phpbb_path_helper = $phpbb_container->get('path_helper');
+
+// load extensions
+$phpbb_extension_manager = $phpbb_container->get('ext.manager');
+
+$template = $phpbb_container->get('template');
diff --git a/phpBB/includes/constants.php b/phpBB/includes/constants.php
index e8a3191280..a24ebaf9de 100644
--- a/phpBB/includes/constants.php
+++ b/phpBB/includes/constants.php
@@ -1,10 +1,13 @@
<?php
/**
*
-* @package phpBB3
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -25,7 +28,7 @@ if (!defined('IN_PHPBB'))
*/
// phpBB Version
-define('PHPBB_VERSION', '3.0.14');
+define('PHPBB_VERSION', '3.1.11');
// QA-related
// define('PHPBB_QA', 1);
@@ -47,10 +50,10 @@ define('USER_INACTIVE', 1);
define('USER_IGNORE', 2);
define('USER_FOUNDER', 3);
-define('INACTIVE_REGISTER', 1);
-define('INACTIVE_PROFILE', 2);
-define('INACTIVE_MANUAL', 3);
-define('INACTIVE_REMIND', 4);
+define('INACTIVE_REGISTER', 1); // Newly registered account
+define('INACTIVE_PROFILE', 2); // Profile details changed
+define('INACTIVE_MANUAL', 3); // Account deactivated by administrator
+define('INACTIVE_REMIND', 4); // Forced user account reactivation
// ACL
define('ACL_NEVER', 0);
@@ -62,6 +65,7 @@ define('LOGIN_CONTINUE', 1);
define('LOGIN_BREAK', 2);
define('LOGIN_SUCCESS', 3);
define('LOGIN_SUCCESS_CREATE_PROFILE', 20);
+define('LOGIN_SUCCESS_LINK_PROFILE', 21);
define('LOGIN_ERROR_USERNAME', 10);
define('LOGIN_ERROR_PASSWORD', 11);
define('LOGIN_ERROR_ACTIVE', 12);
@@ -88,6 +92,11 @@ define('ITEM_UNLOCKED', 0);
define('ITEM_LOCKED', 1);
define('ITEM_MOVED', 2);
+define('ITEM_UNAPPROVED', 0); // => has not yet been approved
+define('ITEM_APPROVED', 1); // => has been approved, and has not been soft deleted
+define('ITEM_DELETED', 2); // => has been soft deleted
+define('ITEM_REAPPROVE', 3); // => has been edited and needs to be re-approved
+
// Forum Flags
define('FORUM_FLAG_LINK_TRACK', 1);
define('FORUM_FLAG_PRUNE_POLL', 2);
@@ -224,9 +233,11 @@ define('BBCODES_TABLE', $table_prefix . 'bbcodes');
define('BOOKMARKS_TABLE', $table_prefix . 'bookmarks');
define('BOTS_TABLE', $table_prefix . 'bots');
define('CONFIG_TABLE', $table_prefix . 'config');
+define('CONFIG_TEXT_TABLE', $table_prefix . 'config_text');
define('CONFIRM_TABLE', $table_prefix . 'confirm');
define('DISALLOW_TABLE', $table_prefix . 'disallow');
define('DRAFTS_TABLE', $table_prefix . 'drafts');
+define('EXT_TABLE', $table_prefix . 'ext');
define('EXTENSIONS_TABLE', $table_prefix . 'extensions');
define('EXTENSION_GROUPS_TABLE', $table_prefix . 'extension_groups');
define('FORUMS_TABLE', $table_prefix . 'forums');
@@ -238,8 +249,11 @@ define('ICONS_TABLE', $table_prefix . 'icons');
define('LANG_TABLE', $table_prefix . 'lang');
define('LOG_TABLE', $table_prefix . 'log');
define('LOGIN_ATTEMPT_TABLE', $table_prefix . 'login_attempts');
+define('MIGRATIONS_TABLE', $table_prefix . 'migrations');
define('MODERATOR_CACHE_TABLE', $table_prefix . 'moderator_cache');
define('MODULES_TABLE', $table_prefix . 'modules');
+define('NOTIFICATION_TYPES_TABLE', $table_prefix . 'notification_types');
+define('NOTIFICATIONS_TABLE', $table_prefix . 'notifications');
define('POLL_OPTIONS_TABLE', $table_prefix . 'poll_options');
define('POLL_VOTES_TABLE', $table_prefix . 'poll_votes');
define('POSTS_TABLE', $table_prefix . 'posts');
@@ -261,23 +275,23 @@ define('SESSIONS_TABLE', $table_prefix . 'sessions');
define('SESSIONS_KEYS_TABLE', $table_prefix . 'sessions_keys');
define('SITELIST_TABLE', $table_prefix . 'sitelist');
define('SMILIES_TABLE', $table_prefix . 'smilies');
+define('SPHINX_TABLE', $table_prefix . 'sphinx');
define('STYLES_TABLE', $table_prefix . 'styles');
define('STYLES_TEMPLATE_TABLE', $table_prefix . 'styles_template');
define('STYLES_TEMPLATE_DATA_TABLE',$table_prefix . 'styles_template_data');
define('STYLES_THEME_TABLE', $table_prefix . 'styles_theme');
define('STYLES_IMAGESET_TABLE', $table_prefix . 'styles_imageset');
define('STYLES_IMAGESET_DATA_TABLE',$table_prefix . 'styles_imageset_data');
+define('TEAMPAGE_TABLE', $table_prefix . 'teampage');
define('TOPICS_TABLE', $table_prefix . 'topics');
define('TOPICS_POSTED_TABLE', $table_prefix . 'topics_posted');
define('TOPICS_TRACK_TABLE', $table_prefix . 'topics_track');
define('TOPICS_WATCH_TABLE', $table_prefix . 'topics_watch');
define('USER_GROUP_TABLE', $table_prefix . 'user_group');
+define('USER_NOTIFICATIONS_TABLE', $table_prefix . 'user_notifications');
define('USERS_TABLE', $table_prefix . 'users');
define('WARNINGS_TABLE', $table_prefix . 'warnings');
define('WORDS_TABLE', $table_prefix . 'words');
define('ZEBRA_TABLE', $table_prefix . 'zebra');
// Additional tables
-
-
-?>
diff --git a/phpBB/includes/db/db_tools.php b/phpBB/includes/db/db_tools.php
deleted file mode 100644
index 6913960185..0000000000
--- a/phpBB/includes/db/db_tools.php
+++ /dev/null
@@ -1,2525 +0,0 @@
-<?php
-/**
-*
-* @package dbal
-* @version $Id$
-* @copyright (c) 2007 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
-*
-*/
-
-/**
-* @ignore
-*/
-if (!defined('IN_PHPBB'))
-{
- exit;
-}
-
-/**
-* Database Tools for handling cross-db actions such as altering columns, etc.
-* Currently not supported is returning SQL for creating tables.
-*
-* @package dbal
-* @note currently not used within phpBB3, but may be utilized later.
-*/
-class phpbb_db_tools
-{
- /**
- * Current sql layer
- */
- var $sql_layer = '';
-
- /**
- * @var object DB object
- */
- var $db = NULL;
-
- /**
- * The Column types for every database we support
- * @var array
- */
- var $dbms_type_map = array(
- 'mysql_41' => array(
- 'INT:' => 'int(%d)',
- 'BINT' => 'bigint(20)',
- 'UINT' => 'mediumint(8) UNSIGNED',
- 'UINT:' => 'int(%d) UNSIGNED',
- 'TINT:' => 'tinyint(%d)',
- 'USINT' => 'smallint(4) UNSIGNED',
- 'BOOL' => 'tinyint(1) UNSIGNED',
- 'VCHAR' => 'varchar(255)',
- 'VCHAR:' => 'varchar(%d)',
- 'CHAR:' => 'char(%d)',
- 'XSTEXT' => 'text',
- 'XSTEXT_UNI'=> 'varchar(100)',
- 'STEXT' => 'text',
- 'STEXT_UNI' => 'varchar(255)',
- 'TEXT' => 'text',
- 'TEXT_UNI' => 'text',
- 'MTEXT' => 'mediumtext',
- 'MTEXT_UNI' => 'mediumtext',
- 'TIMESTAMP' => 'int(11) UNSIGNED',
- 'DECIMAL' => 'decimal(5,2)',
- 'DECIMAL:' => 'decimal(%d,2)',
- 'PDECIMAL' => 'decimal(6,3)',
- 'PDECIMAL:' => 'decimal(%d,3)',
- 'VCHAR_UNI' => 'varchar(255)',
- 'VCHAR_UNI:'=> 'varchar(%d)',
- 'VCHAR_CI' => 'varchar(255)',
- 'VARBINARY' => 'varbinary(255)',
- ),
-
- 'mysql_40' => array(
- 'INT:' => 'int(%d)',
- 'BINT' => 'bigint(20)',
- 'UINT' => 'mediumint(8) UNSIGNED',
- 'UINT:' => 'int(%d) UNSIGNED',
- 'TINT:' => 'tinyint(%d)',
- 'USINT' => 'smallint(4) UNSIGNED',
- 'BOOL' => 'tinyint(1) UNSIGNED',
- 'VCHAR' => 'varbinary(255)',
- 'VCHAR:' => 'varbinary(%d)',
- 'CHAR:' => 'binary(%d)',
- 'XSTEXT' => 'blob',
- 'XSTEXT_UNI'=> 'blob',
- 'STEXT' => 'blob',
- 'STEXT_UNI' => 'blob',
- 'TEXT' => 'blob',
- 'TEXT_UNI' => 'blob',
- 'MTEXT' => 'mediumblob',
- 'MTEXT_UNI' => 'mediumblob',
- 'TIMESTAMP' => 'int(11) UNSIGNED',
- 'DECIMAL' => 'decimal(5,2)',
- 'DECIMAL:' => 'decimal(%d,2)',
- 'PDECIMAL' => 'decimal(6,3)',
- 'PDECIMAL:' => 'decimal(%d,3)',
- 'VCHAR_UNI' => 'blob',
- 'VCHAR_UNI:'=> array('varbinary(%d)', 'limit' => array('mult', 3, 255, 'blob')),
- 'VCHAR_CI' => 'blob',
- 'VARBINARY' => 'varbinary(255)',
- ),
-
- 'firebird' => array(
- 'INT:' => 'INTEGER',
- 'BINT' => 'DOUBLE PRECISION',
- 'UINT' => 'INTEGER',
- 'UINT:' => 'INTEGER',
- 'TINT:' => 'INTEGER',
- 'USINT' => 'INTEGER',
- 'BOOL' => 'INTEGER',
- 'VCHAR' => 'VARCHAR(255) CHARACTER SET NONE',
- 'VCHAR:' => 'VARCHAR(%d) CHARACTER SET NONE',
- 'CHAR:' => 'CHAR(%d) CHARACTER SET NONE',
- 'XSTEXT' => 'BLOB SUB_TYPE TEXT CHARACTER SET NONE',
- 'STEXT' => 'BLOB SUB_TYPE TEXT CHARACTER SET NONE',
- 'TEXT' => 'BLOB SUB_TYPE TEXT CHARACTER SET NONE',
- 'MTEXT' => 'BLOB SUB_TYPE TEXT CHARACTER SET NONE',
- 'XSTEXT_UNI'=> 'VARCHAR(100) CHARACTER SET UTF8',
- 'STEXT_UNI' => 'VARCHAR(255) CHARACTER SET UTF8',
- 'TEXT_UNI' => 'BLOB SUB_TYPE TEXT CHARACTER SET UTF8',
- 'MTEXT_UNI' => 'BLOB SUB_TYPE TEXT CHARACTER SET UTF8',
- 'TIMESTAMP' => 'INTEGER',
- 'DECIMAL' => 'DOUBLE PRECISION',
- 'DECIMAL:' => 'DOUBLE PRECISION',
- 'PDECIMAL' => 'DOUBLE PRECISION',
- 'PDECIMAL:' => 'DOUBLE PRECISION',
- 'VCHAR_UNI' => 'VARCHAR(255) CHARACTER SET UTF8',
- 'VCHAR_UNI:'=> 'VARCHAR(%d) CHARACTER SET UTF8',
- 'VCHAR_CI' => 'VARCHAR(255) CHARACTER SET UTF8',
- 'VARBINARY' => 'CHAR(255) CHARACTER SET NONE',
- ),
-
- 'mssql' => array(
- 'INT:' => '[int]',
- 'BINT' => '[float]',
- 'UINT' => '[int]',
- 'UINT:' => '[int]',
- 'TINT:' => '[int]',
- 'USINT' => '[int]',
- 'BOOL' => '[int]',
- 'VCHAR' => '[varchar] (255)',
- 'VCHAR:' => '[varchar] (%d)',
- 'CHAR:' => '[char] (%d)',
- 'XSTEXT' => '[varchar] (1000)',
- 'STEXT' => '[varchar] (3000)',
- 'TEXT' => '[varchar] (8000)',
- 'MTEXT' => '[text]',
- 'XSTEXT_UNI'=> '[varchar] (100)',
- 'STEXT_UNI' => '[varchar] (255)',
- 'TEXT_UNI' => '[varchar] (4000)',
- 'MTEXT_UNI' => '[text]',
- 'TIMESTAMP' => '[int]',
- 'DECIMAL' => '[float]',
- 'DECIMAL:' => '[float]',
- 'PDECIMAL' => '[float]',
- 'PDECIMAL:' => '[float]',
- 'VCHAR_UNI' => '[varchar] (255)',
- 'VCHAR_UNI:'=> '[varchar] (%d)',
- 'VCHAR_CI' => '[varchar] (255)',
- 'VARBINARY' => '[varchar] (255)',
- ),
-
- 'mssqlnative' => array(
- 'INT:' => '[int]',
- 'BINT' => '[float]',
- 'UINT' => '[int]',
- 'UINT:' => '[int]',
- 'TINT:' => '[int]',
- 'USINT' => '[int]',
- 'BOOL' => '[int]',
- 'VCHAR' => '[varchar] (255)',
- 'VCHAR:' => '[varchar] (%d)',
- 'CHAR:' => '[char] (%d)',
- 'XSTEXT' => '[varchar] (1000)',
- 'STEXT' => '[varchar] (3000)',
- 'TEXT' => '[varchar] (8000)',
- 'MTEXT' => '[text]',
- 'XSTEXT_UNI'=> '[varchar] (100)',
- 'STEXT_UNI' => '[varchar] (255)',
- 'TEXT_UNI' => '[varchar] (4000)',
- 'MTEXT_UNI' => '[text]',
- 'TIMESTAMP' => '[int]',
- 'DECIMAL' => '[float]',
- 'DECIMAL:' => '[float]',
- 'PDECIMAL' => '[float]',
- 'PDECIMAL:' => '[float]',
- 'VCHAR_UNI' => '[varchar] (255)',
- 'VCHAR_UNI:'=> '[varchar] (%d)',
- 'VCHAR_CI' => '[varchar] (255)',
- 'VARBINARY' => '[varchar] (255)',
- ),
-
- 'oracle' => array(
- 'INT:' => 'number(%d)',
- 'BINT' => 'number(20)',
- 'UINT' => 'number(8)',
- 'UINT:' => 'number(%d)',
- 'TINT:' => 'number(%d)',
- 'USINT' => 'number(4)',
- 'BOOL' => 'number(1)',
- 'VCHAR' => 'varchar2(255)',
- 'VCHAR:' => 'varchar2(%d)',
- 'CHAR:' => 'char(%d)',
- 'XSTEXT' => 'varchar2(1000)',
- 'STEXT' => 'varchar2(3000)',
- 'TEXT' => 'clob',
- 'MTEXT' => 'clob',
- 'XSTEXT_UNI'=> 'varchar2(300)',
- 'STEXT_UNI' => 'varchar2(765)',
- 'TEXT_UNI' => 'clob',
- 'MTEXT_UNI' => 'clob',
- 'TIMESTAMP' => 'number(11)',
- 'DECIMAL' => 'number(5, 2)',
- 'DECIMAL:' => 'number(%d, 2)',
- 'PDECIMAL' => 'number(6, 3)',
- 'PDECIMAL:' => 'number(%d, 3)',
- 'VCHAR_UNI' => 'varchar2(765)',
- 'VCHAR_UNI:'=> array('varchar2(%d)', 'limit' => array('mult', 3, 765, 'clob')),
- 'VCHAR_CI' => 'varchar2(255)',
- 'VARBINARY' => 'raw(255)',
- ),
-
- 'sqlite' => array(
- 'INT:' => 'int(%d)',
- 'BINT' => 'bigint(20)',
- 'UINT' => 'INTEGER UNSIGNED', //'mediumint(8) UNSIGNED',
- 'UINT:' => 'INTEGER UNSIGNED', // 'int(%d) UNSIGNED',
- 'TINT:' => 'tinyint(%d)',
- 'USINT' => 'INTEGER UNSIGNED', //'mediumint(4) UNSIGNED',
- 'BOOL' => 'INTEGER UNSIGNED', //'tinyint(1) UNSIGNED',
- 'VCHAR' => 'varchar(255)',
- 'VCHAR:' => 'varchar(%d)',
- 'CHAR:' => 'char(%d)',
- 'XSTEXT' => 'text(65535)',
- 'STEXT' => 'text(65535)',
- 'TEXT' => 'text(65535)',
- 'MTEXT' => 'mediumtext(16777215)',
- 'XSTEXT_UNI'=> 'text(65535)',
- 'STEXT_UNI' => 'text(65535)',
- 'TEXT_UNI' => 'text(65535)',
- 'MTEXT_UNI' => 'mediumtext(16777215)',
- 'TIMESTAMP' => 'INTEGER UNSIGNED', //'int(11) UNSIGNED',
- 'DECIMAL' => 'decimal(5,2)',
- 'DECIMAL:' => 'decimal(%d,2)',
- 'PDECIMAL' => 'decimal(6,3)',
- 'PDECIMAL:' => 'decimal(%d,3)',
- 'VCHAR_UNI' => 'varchar(255)',
- 'VCHAR_UNI:'=> 'varchar(%d)',
- 'VCHAR_CI' => 'varchar(255)',
- 'VARBINARY' => 'blob',
- ),
-
- 'postgres' => array(
- 'INT:' => 'INT4',
- 'BINT' => 'INT8',
- 'UINT' => 'INT4', // unsigned
- 'UINT:' => 'INT4', // unsigned
- 'USINT' => 'INT2', // unsigned
- 'BOOL' => 'INT2', // unsigned
- 'TINT:' => 'INT2',
- 'VCHAR' => 'varchar(255)',
- 'VCHAR:' => 'varchar(%d)',
- 'CHAR:' => 'char(%d)',
- 'XSTEXT' => 'varchar(1000)',
- 'STEXT' => 'varchar(3000)',
- 'TEXT' => 'varchar(8000)',
- 'MTEXT' => 'TEXT',
- 'XSTEXT_UNI'=> 'varchar(100)',
- 'STEXT_UNI' => 'varchar(255)',
- 'TEXT_UNI' => 'varchar(4000)',
- 'MTEXT_UNI' => 'TEXT',
- 'TIMESTAMP' => 'INT4', // unsigned
- 'DECIMAL' => 'decimal(5,2)',
- 'DECIMAL:' => 'decimal(%d,2)',
- 'PDECIMAL' => 'decimal(6,3)',
- 'PDECIMAL:' => 'decimal(%d,3)',
- 'VCHAR_UNI' => 'varchar(255)',
- 'VCHAR_UNI:'=> 'varchar(%d)',
- 'VCHAR_CI' => 'varchar_ci',
- 'VARBINARY' => 'bytea',
- ),
- );
-
- /**
- * A list of types being unsigned for better reference in some db's
- * @var array
- */
- var $unsigned_types = array('UINT', 'UINT:', 'USINT', 'BOOL', 'TIMESTAMP');
-
- /**
- * A list of supported DBMS. We change this class to support more DBMS, the DBMS itself only need to follow some rules.
- * @var array
- */
- var $supported_dbms = array('firebird', 'mssql', 'mssqlnative', 'mysql_40', 'mysql_41', 'oracle', 'postgres', 'sqlite');
-
- /**
- * This is set to true if user only wants to return the 'to-be-executed' SQL statement(s) (as an array).
- * This mode has no effect on some methods (inserting of data for example). This is expressed within the methods command.
- */
- var $return_statements = false;
-
- /**
- * Constructor. Set DB Object and set {@link $return_statements return_statements}.
- *
- * @param phpbb_dbal $db DBAL object
- * @param bool $return_statements True if only statements should be returned and no SQL being executed
- */
- function phpbb_db_tools(&$db, $return_statements = false)
- {
- $this->db = $db;
- $this->return_statements = $return_statements;
-
- // Determine mapping database type
- switch ($this->db->sql_layer)
- {
- case 'mysql':
- $this->sql_layer = 'mysql_40';
- break;
-
- case 'mysql4':
- if (version_compare($this->db->sql_server_info(true), '4.1.3', '>='))
- {
- $this->sql_layer = 'mysql_41';
- }
- else
- {
- $this->sql_layer = 'mysql_40';
- }
- break;
-
- case 'mysqli':
- $this->sql_layer = 'mysql_41';
- break;
-
- case 'mssql':
- case 'mssql_odbc':
- $this->sql_layer = 'mssql';
- break;
-
- case 'mssqlnative':
- $this->sql_layer = 'mssqlnative';
- break;
-
- default:
- $this->sql_layer = $this->db->sql_layer;
- break;
- }
- }
-
- /**
- * Gets a list of tables in the database.
- *
- * @return array Array of table names (all lower case)
- */
- function sql_list_tables()
- {
- switch ($this->db->sql_layer)
- {
- case 'mysql':
- case 'mysql4':
- case 'mysqli':
- $sql = 'SHOW TABLES';
- break;
-
- case 'sqlite':
- $sql = 'SELECT name
- FROM sqlite_master
- WHERE type = "table"';
- break;
-
- case 'mssql':
- case 'mssql_odbc':
- case 'mssqlnative':
- $sql = "SELECT name
- FROM sysobjects
- WHERE type='U'";
- break;
-
- case 'postgres':
- $sql = 'SELECT relname
- FROM pg_stat_user_tables';
- break;
-
- case 'firebird':
- $sql = 'SELECT rdb$relation_name
- FROM rdb$relations
- WHERE rdb$view_source is null
- AND rdb$system_flag = 0';
- break;
-
- case 'oracle':
- $sql = 'SELECT table_name
- FROM USER_TABLES';
- break;
- }
-
- $result = $this->db->sql_query($sql);
-
- $tables = array();
- while ($row = $this->db->sql_fetchrow($result))
- {
- $name = current($row);
- $tables[$name] = $name;
- }
- $this->db->sql_freeresult($result);
-
- return $tables;
- }
-
- /**
- * Check if table exists
- *
- *
- * @param string $table_name The table name to check for
- * @return bool true if table exists, else false
- */
- function sql_table_exists($table_name)
- {
- $this->db->sql_return_on_error(true);
- $result = $this->db->sql_query_limit('SELECT * FROM ' . $table_name, 1);
- $this->db->sql_return_on_error(false);
-
- if ($result)
- {
- $this->db->sql_freeresult($result);
- return true;
- }
-
- return false;
- }
-
- /**
- * Create SQL Table
- *
- * @param string $table_name The table name to create
- * @param array $table_data Array containing table data.
- * @return array Statements if $return_statements is true.
- */
- function sql_create_table($table_name, $table_data)
- {
- // holds the DDL for a column
- $columns = $statements = array();
-
- if ($this->sql_table_exists($table_name))
- {
- return $this->_sql_run_sql($statements);
- }
-
- // Begin transaction
- $statements[] = 'begin';
-
- // Determine if we have created a PRIMARY KEY in the earliest
- $primary_key_gen = false;
-
- // Determine if the table requires a sequence
- $create_sequence = false;
-
- // Begin table sql statement
- switch ($this->sql_layer)
- {
- case 'mssql':
- case 'mssqlnative':
- $table_sql = 'CREATE TABLE [' . $table_name . '] (' . "\n";
- break;
-
- default:
- $table_sql = 'CREATE TABLE ' . $table_name . ' (' . "\n";
- break;
- }
-
- if ($this->sql_layer == 'mssql' || $this->sql_layer == 'mssqlnative')
- {
- if (!isset($table_data['PRIMARY_KEY']))
- {
- $table_data['COLUMNS']['mssqlindex'] = array('UINT', null, 'auto_increment');
- $table_data['PRIMARY_KEY'] = 'mssqlindex';
- }
- }
-
- // Iterate through the columns to create a table
- foreach ($table_data['COLUMNS'] as $column_name => $column_data)
- {
- // here lies an array, filled with information compiled on the column's data
- $prepared_column = $this->sql_prepare_column_data($table_name, $column_name, $column_data);
-
- if (isset($prepared_column['auto_increment']) && $prepared_column['auto_increment'] && strlen($column_name) > 26) // "${column_name}_gen"
- {
- trigger_error("Index name '${column_name}_gen' on table '$table_name' is too long. The maximum auto increment column length is 26 characters.", E_USER_ERROR);
- }
-
- // here we add the definition of the new column to the list of columns
- switch ($this->sql_layer)
- {
- case 'mssql':
- case 'mssqlnative':
- $columns[] = "\t [{$column_name}] " . $prepared_column['column_type_sql_default'];
- break;
-
- default:
- $columns[] = "\t {$column_name} " . $prepared_column['column_type_sql'];
- break;
- }
-
- // see if we have found a primary key set due to a column definition if we have found it, we can stop looking
- if (!$primary_key_gen)
- {
- $primary_key_gen = isset($prepared_column['primary_key_set']) && $prepared_column['primary_key_set'];
- }
-
- // create sequence DDL based off of the existance of auto incrementing columns
- if (!$create_sequence && isset($prepared_column['auto_increment']) && $prepared_column['auto_increment'])
- {
- $create_sequence = $column_name;
- }
- }
-
- // this makes up all the columns in the create table statement
- $table_sql .= implode(",\n", $columns);
-
- // Close the table for two DBMS and add to the statements
- switch ($this->sql_layer)
- {
- case 'firebird':
- case 'mssql':
- case 'mssqlnative':
- $table_sql .= "\n);";
- $statements[] = $table_sql;
- break;
- }
-
- // we have yet to create a primary key for this table,
- // this means that we can add the one we really wanted instead
- if (!$primary_key_gen)
- {
- // Write primary key
- if (isset($table_data['PRIMARY_KEY']))
- {
- if (!is_array($table_data['PRIMARY_KEY']))
- {
- $table_data['PRIMARY_KEY'] = array($table_data['PRIMARY_KEY']);
- }
-
- switch ($this->sql_layer)
- {
- case 'mysql_40':
- case 'mysql_41':
- case 'postgres':
- case 'sqlite':
- $table_sql .= ",\n\t PRIMARY KEY (" . implode(', ', $table_data['PRIMARY_KEY']) . ')';
- break;
-
- case 'firebird':
- case 'mssql':
- case 'mssqlnative':
- // We need the data here
- $old_return_statements = $this->return_statements;
- $this->return_statements = true;
-
- $primary_key_stmts = $this->sql_create_primary_key($table_name, $table_data['PRIMARY_KEY']);
- foreach ($primary_key_stmts as $pk_stmt)
- {
- $statements[] = $pk_stmt;
- }
-
- $this->return_statements = $old_return_statements;
- break;
-
- case 'oracle':
- $table_sql .= ",\n\t CONSTRAINT pk_{$table_name} PRIMARY KEY (" . implode(', ', $table_data['PRIMARY_KEY']) . ')';
- break;
- }
- }
- }
-
- // close the table
- switch ($this->sql_layer)
- {
- case 'mysql_41':
- // make sure the table is in UTF-8 mode
- $table_sql .= "\n) CHARACTER SET `utf8` COLLATE `utf8_bin`;";
- $statements[] = $table_sql;
- break;
-
- case 'mysql_40':
- case 'sqlite':
- $table_sql .= "\n);";
- $statements[] = $table_sql;
- break;
-
- case 'postgres':
- // do we need to add a sequence for auto incrementing columns?
- if ($create_sequence)
- {
- $statements[] = "CREATE SEQUENCE {$table_name}_seq;";
- }
-
- $table_sql .= "\n);";
- $statements[] = $table_sql;
- break;
-
- case 'oracle':
- $table_sql .= "\n)";
- $statements[] = $table_sql;
-
- // do we need to add a sequence and a tigger for auto incrementing columns?
- if ($create_sequence)
- {
- // create the actual sequence
- $statements[] = "CREATE SEQUENCE {$table_name}_seq";
-
- // the trigger is the mechanism by which we increment the counter
- $trigger = "CREATE OR REPLACE TRIGGER t_{$table_name}\n";
- $trigger .= "BEFORE INSERT ON {$table_name}\n";
- $trigger .= "FOR EACH ROW WHEN (\n";
- $trigger .= "\tnew.{$create_sequence} IS NULL OR new.{$create_sequence} = 0\n";
- $trigger .= ")\n";
- $trigger .= "BEGIN\n";
- $trigger .= "\tSELECT {$table_name}_seq.nextval\n";
- $trigger .= "\tINTO :new.{$create_sequence}\n";
- $trigger .= "\tFROM dual;\n";
- $trigger .= "END;";
-
- $statements[] = $trigger;
- }
- break;
-
- case 'firebird':
- if ($create_sequence)
- {
- $statements[] = "CREATE GENERATOR {$table_name}_gen;";
- $statements[] = "SET GENERATOR {$table_name}_gen TO 0;";
-
- $trigger = "CREATE TRIGGER t_$table_name FOR $table_name\n";
- $trigger .= "BEFORE INSERT\nAS\nBEGIN\n";
- $trigger .= "\tNEW.{$create_sequence} = GEN_ID({$table_name}_gen, 1);\nEND;";
- $statements[] = $trigger;
- }
- break;
- }
-
- // Write Keys
- if (isset($table_data['KEYS']))
- {
- foreach ($table_data['KEYS'] as $key_name => $key_data)
- {
- if (!is_array($key_data[1]))
- {
- $key_data[1] = array($key_data[1]);
- }
-
- $old_return_statements = $this->return_statements;
- $this->return_statements = true;
-
- $key_stmts = ($key_data[0] == 'UNIQUE') ? $this->sql_create_unique_index($table_name, $key_name, $key_data[1]) : $this->sql_create_index($table_name, $key_name, $key_data[1]);
-
- foreach ($key_stmts as $key_stmt)
- {
- $statements[] = $key_stmt;
- }
-
- $this->return_statements = $old_return_statements;
- }
- }
-
- // Commit Transaction
- $statements[] = 'commit';
-
- return $this->_sql_run_sql($statements);
- }
-
- /**
- * Handle passed database update array.
- * Expected structure...
- * Key being one of the following
- * change_columns: Column changes (only type, not name)
- * add_columns: Add columns to a table
- * drop_keys: Dropping keys
- * drop_columns: Removing/Dropping columns
- * add_primary_keys: adding primary keys
- * add_unique_index: adding an unique index
- * add_index: adding an index (can be column:index_size if you need to provide size)
- *
- * The values are in this format:
- * {TABLE NAME} => array(
- * {COLUMN NAME} => array({COLUMN TYPE}, {DEFAULT VALUE}, {OPTIONAL VARIABLES}),
- * {KEY/INDEX NAME} => array({COLUMN NAMES}),
- * )
- *
- * For more information have a look at /develop/create_schema_files.php (only available through SVN)
- */
- function perform_schema_changes($schema_changes)
- {
- if (empty($schema_changes))
- {
- return;
- }
-
- $statements = array();
- $sqlite = false;
-
- // For SQLite we need to perform the schema changes in a much more different way
- if ($this->db->sql_layer == 'sqlite' && $this->return_statements)
- {
- $sqlite_data = array();
- $sqlite = true;
- }
-
- // Drop tables?
- if (!empty($schema_changes['drop_tables']))
- {
- foreach ($schema_changes['drop_tables'] as $table)
- {
- // only drop table if it exists
- if ($this->sql_table_exists($table))
- {
- $result = $this->sql_table_drop($table);
- if ($this->return_statements)
- {
- $statements = array_merge($statements, $result);
- }
- }
- }
- }
-
- // Add tables?
- if (!empty($schema_changes['add_tables']))
- {
- foreach ($schema_changes['add_tables'] as $table => $table_data)
- {
- $result = $this->sql_create_table($table, $table_data);
- if ($this->return_statements)
- {
- $statements = array_merge($statements, $result);
- }
- }
- }
-
- // Change columns?
- if (!empty($schema_changes['change_columns']))
- {
- foreach ($schema_changes['change_columns'] as $table => $columns)
- {
- foreach ($columns as $column_name => $column_data)
- {
- // If the column exists we change it, else we add it ;)
- if ($column_exists = $this->sql_column_exists($table, $column_name))
- {
- $result = $this->sql_column_change($table, $column_name, $column_data, true);
- }
- else
- {
- $result = $this->sql_column_add($table, $column_name, $column_data, true);
- }
-
- if ($sqlite)
- {
- if ($column_exists)
- {
- $sqlite_data[$table]['change_columns'][] = $result;
- }
- else
- {
- $sqlite_data[$table]['add_columns'][] = $result;
- }
- }
- else if ($this->return_statements)
- {
- $statements = array_merge($statements, $result);
- }
- }
- }
- }
-
- // Add columns?
- if (!empty($schema_changes['add_columns']))
- {
- foreach ($schema_changes['add_columns'] as $table => $columns)
- {
- foreach ($columns as $column_name => $column_data)
- {
- // Only add the column if it does not exist yet
- if ($column_exists = $this->sql_column_exists($table, $column_name))
- {
- continue;
- // This is commented out here because it can take tremendous time on updates
-// $result = $this->sql_column_change($table, $column_name, $column_data, true);
- }
- else
- {
- $result = $this->sql_column_add($table, $column_name, $column_data, true);
- }
-
- if ($sqlite)
- {
- if ($column_exists)
- {
- continue;
-// $sqlite_data[$table]['change_columns'][] = $result;
- }
- else
- {
- $sqlite_data[$table]['add_columns'][] = $result;
- }
- }
- else if ($this->return_statements)
- {
- $statements = array_merge($statements, $result);
- }
- }
- }
- }
-
- // Remove keys?
- if (!empty($schema_changes['drop_keys']))
- {
- foreach ($schema_changes['drop_keys'] as $table => $indexes)
- {
- foreach ($indexes as $index_name)
- {
- if (!$this->sql_index_exists($table, $index_name))
- {
- continue;
- }
-
- $result = $this->sql_index_drop($table, $index_name);
-
- if ($this->return_statements)
- {
- $statements = array_merge($statements, $result);
- }
- }
- }
- }
-
- // Drop columns?
- if (!empty($schema_changes['drop_columns']))
- {
- foreach ($schema_changes['drop_columns'] as $table => $columns)
- {
- foreach ($columns as $column)
- {
- // Only remove the column if it exists...
- if ($this->sql_column_exists($table, $column))
- {
- $result = $this->sql_column_remove($table, $column, true);
-
- if ($sqlite)
- {
- $sqlite_data[$table]['drop_columns'][] = $result;
- }
- else if ($this->return_statements)
- {
- $statements = array_merge($statements, $result);
- }
- }
- }
- }
- }
-
- // Add primary keys?
- if (!empty($schema_changes['add_primary_keys']))
- {
- foreach ($schema_changes['add_primary_keys'] as $table => $columns)
- {
- $result = $this->sql_create_primary_key($table, $columns, true);
-
- if ($sqlite)
- {
- $sqlite_data[$table]['primary_key'] = $result;
- }
- else if ($this->return_statements)
- {
- $statements = array_merge($statements, $result);
- }
- }
- }
-
- // Add unique indexes?
- if (!empty($schema_changes['add_unique_index']))
- {
- foreach ($schema_changes['add_unique_index'] as $table => $index_array)
- {
- foreach ($index_array as $index_name => $column)
- {
- if ($this->sql_unique_index_exists($table, $index_name))
- {
- continue;
- }
-
- $result = $this->sql_create_unique_index($table, $index_name, $column);
-
- if ($this->return_statements)
- {
- $statements = array_merge($statements, $result);
- }
- }
- }
- }
-
- // Add indexes?
- if (!empty($schema_changes['add_index']))
- {
- foreach ($schema_changes['add_index'] as $table => $index_array)
- {
- foreach ($index_array as $index_name => $column)
- {
- if ($this->sql_index_exists($table, $index_name))
- {
- continue;
- }
-
- $result = $this->sql_create_index($table, $index_name, $column);
-
- if ($this->return_statements)
- {
- $statements = array_merge($statements, $result);
- }
- }
- }
- }
-
- if ($sqlite)
- {
- foreach ($sqlite_data as $table_name => $sql_schema_changes)
- {
- // Create temporary table with original data
- $statements[] = 'begin';
-
- $sql = "SELECT sql
- FROM sqlite_master
- WHERE type = 'table'
- AND name = '{$table_name}'
- ORDER BY type DESC, name;";
- $result = $this->db->sql_query($sql);
-
- if (!$result)
- {
- continue;
- }
-
- $row = $this->db->sql_fetchrow($result);
- $this->db->sql_freeresult($result);
-
- // Create a backup table and populate it, destroy the existing one
- $statements[] = preg_replace('#CREATE\s+TABLE\s+"?' . $table_name . '"?#i', 'CREATE TEMPORARY TABLE ' . $table_name . '_temp', $row['sql']);
- $statements[] = 'INSERT INTO ' . $table_name . '_temp SELECT * FROM ' . $table_name;
- $statements[] = 'DROP TABLE ' . $table_name;
-
- // Get the columns...
- preg_match('#\((.*)\)#s', $row['sql'], $matches);
-
- $plain_table_cols = trim($matches[1]);
- $new_table_cols = preg_split('/,(?![\s\w]+\))/m', $plain_table_cols);
- $column_list = array();
-
- foreach ($new_table_cols as $declaration)
- {
- $entities = preg_split('#\s+#', trim($declaration));
- if ($entities[0] == 'PRIMARY')
- {
- continue;
- }
- $column_list[] = $entities[0];
- }
-
- // note down the primary key notation because sqlite only supports adding it to the end for the new table
- $primary_key = false;
- $_new_cols = array();
-
- foreach ($new_table_cols as $key => $declaration)
- {
- $entities = preg_split('#\s+#', trim($declaration));
- if ($entities[0] == 'PRIMARY')
- {
- $primary_key = $declaration;
- continue;
- }
- $_new_cols[] = $declaration;
- }
-
- $new_table_cols = $_new_cols;
-
- // First of all... change columns
- if (!empty($sql_schema_changes['change_columns']))
- {
- foreach ($sql_schema_changes['change_columns'] as $column_sql)
- {
- foreach ($new_table_cols as $key => $declaration)
- {
- $entities = preg_split('#\s+#', trim($declaration));
- if (strpos($column_sql, $entities[0] . ' ') === 0)
- {
- $new_table_cols[$key] = $column_sql;
- }
- }
- }
- }
-
- if (!empty($sql_schema_changes['add_columns']))
- {
- foreach ($sql_schema_changes['add_columns'] as $column_sql)
- {
- $new_table_cols[] = $column_sql;
- }
- }
-
- // Now drop them...
- if (!empty($sql_schema_changes['drop_columns']))
- {
- foreach ($sql_schema_changes['drop_columns'] as $column_name)
- {
- // Remove from column list...
- $new_column_list = array();
- foreach ($column_list as $key => $value)
- {
- if ($value === $column_name)
- {
- continue;
- }
-
- $new_column_list[] = $value;
- }
-
- $column_list = $new_column_list;
-
- // Remove from table...
- $_new_cols = array();
- foreach ($new_table_cols as $key => $declaration)
- {
- $entities = preg_split('#\s+#', trim($declaration));
- if (strpos($column_name . ' ', $entities[0] . ' ') === 0)
- {
- continue;
- }
- $_new_cols[] = $declaration;
- }
- $new_table_cols = $_new_cols;
- }
- }
-
- // Primary key...
- if (!empty($sql_schema_changes['primary_key']))
- {
- $new_table_cols[] = 'PRIMARY KEY (' . implode(', ', $sql_schema_changes['primary_key']) . ')';
- }
- // Add a new one or the old primary key
- else if ($primary_key !== false)
- {
- $new_table_cols[] = $primary_key;
- }
-
- $columns = implode(',', $column_list);
-
- // create a new table and fill it up. destroy the temp one
- $statements[] = 'CREATE TABLE ' . $table_name . ' (' . implode(',', $new_table_cols) . ');';
- $statements[] = 'INSERT INTO ' . $table_name . ' (' . $columns . ') SELECT ' . $columns . ' FROM ' . $table_name . '_temp;';
- $statements[] = 'DROP TABLE ' . $table_name . '_temp';
-
- $statements[] = 'commit';
- }
- }
-
- if ($this->return_statements)
- {
- return $statements;
- }
- }
-
- /**
- * Gets a list of columns of a table.
- *
- * @param string $table Table name
- *
- * @return array Array of column names (all lower case)
- */
- function sql_list_columns($table)
- {
- $columns = array();
-
- switch ($this->sql_layer)
- {
- case 'mysql_40':
- case 'mysql_41':
- $sql = "SHOW COLUMNS FROM $table";
- break;
-
- // PostgreSQL has a way of doing this in a much simpler way but would
- // not allow us to support all versions of PostgreSQL
- case 'postgres':
- $sql = "SELECT a.attname
- FROM pg_class c, pg_attribute a
- WHERE c.relname = '{$table}'
- AND a.attnum > 0
- AND a.attrelid = c.oid";
- break;
-
- // same deal with PostgreSQL, we must perform more complex operations than
- // we technically could
- case 'mssql':
- case 'mssqlnative':
- $sql = "SELECT c.name
- FROM syscolumns c
- LEFT JOIN sysobjects o ON c.id = o.id
- WHERE o.name = '{$table}'";
- break;
-
- case 'oracle':
- $sql = "SELECT column_name
- FROM user_tab_columns
- WHERE LOWER(table_name) = '" . strtolower($table) . "'";
- break;
-
- case 'firebird':
- $sql = "SELECT RDB\$FIELD_NAME as FNAME
- FROM RDB\$RELATION_FIELDS
- WHERE RDB\$RELATION_NAME = '" . strtoupper($table) . "'";
- break;
-
- case 'sqlite':
- $sql = "SELECT sql
- FROM sqlite_master
- WHERE type = 'table'
- AND name = '{$table}'";
-
- $result = $this->db->sql_query($sql);
-
- if (!$result)
- {
- return false;
- }
-
- $row = $this->db->sql_fetchrow($result);
- $this->db->sql_freeresult($result);
-
- preg_match('#\((.*)\)#s', $row['sql'], $matches);
-
- $cols = trim($matches[1]);
- $col_array = preg_split('/,(?![\s\w]+\))/m', $cols);
-
- foreach ($col_array as $declaration)
- {
- $entities = preg_split('#\s+#', trim($declaration));
- if ($entities[0] == 'PRIMARY')
- {
- continue;
- }
-
- $column = strtolower($entities[0]);
- $columns[$column] = $column;
- }
-
- return $columns;
- break;
- }
-
- $result = $this->db->sql_query($sql);
-
- while ($row = $this->db->sql_fetchrow($result))
- {
- $column = strtolower(current($row));
- $columns[$column] = $column;
- }
- $this->db->sql_freeresult($result);
-
- return $columns;
- }
-
- /**
- * Check whether a specified column exist in a table
- *
- * @param string $table Table to check
- * @param string $column_name Column to check
- *
- * @return bool True if column exists, false otherwise
- */
- function sql_column_exists($table, $column_name)
- {
- $columns = $this->sql_list_columns($table);
-
- return isset($columns[$column_name]);
- }
-
- /**
- * Check if a specified index exists in table. Does not return PRIMARY KEY and UNIQUE indexes.
- *
- * @param string $table_name Table to check the index at
- * @param string $index_name The index name to check
- *
- * @return bool True if index exists, else false
- */
- function sql_index_exists($table_name, $index_name)
- {
- if ($this->sql_layer == 'mssql' || $this->sql_layer == 'mssqlnative')
- {
- $sql = "EXEC sp_statistics '$table_name'";
- $result = $this->db->sql_query($sql);
-
- while ($row = $this->db->sql_fetchrow($result))
- {
- if ($row['TYPE'] == 3)
- {
- if (strtolower($row['INDEX_NAME']) == strtolower($index_name))
- {
- $this->db->sql_freeresult($result);
- return true;
- }
- }
- }
- $this->db->sql_freeresult($result);
-
- return false;
- }
-
- switch ($this->sql_layer)
- {
- case 'firebird':
- $sql = "SELECT LOWER(RDB\$INDEX_NAME) as index_name
- FROM RDB\$INDICES
- WHERE RDB\$RELATION_NAME = '" . strtoupper($table_name) . "'
- AND RDB\$UNIQUE_FLAG IS NULL
- AND RDB\$FOREIGN_KEY IS NULL";
- $col = 'index_name';
- break;
-
- case 'postgres':
- $sql = "SELECT ic.relname as index_name
- FROM pg_class bc, pg_class ic, pg_index i
- WHERE (bc.oid = i.indrelid)
- AND (ic.oid = i.indexrelid)
- AND (bc.relname = '" . $table_name . "')
- AND (i.indisunique != 't')
- AND (i.indisprimary != 't')";
- $col = 'index_name';
- break;
-
- case 'mysql_40':
- case 'mysql_41':
- $sql = 'SHOW KEYS
- FROM ' . $table_name;
- $col = 'Key_name';
- break;
-
- case 'oracle':
- $sql = "SELECT index_name
- FROM user_indexes
- WHERE table_name = '" . strtoupper($table_name) . "'
- AND generated = 'N'
- AND uniqueness = 'NONUNIQUE'";
- $col = 'index_name';
- break;
-
- case 'sqlite':
- $sql = "PRAGMA index_list('" . $table_name . "');";
- $col = 'name';
- break;
- }
-
- $result = $this->db->sql_query($sql);
- while ($row = $this->db->sql_fetchrow($result))
- {
- if (($this->sql_layer == 'mysql_40' || $this->sql_layer == 'mysql_41') && !$row['Non_unique'])
- {
- continue;
- }
-
- // These DBMS prefix index name with the table name
- switch ($this->sql_layer)
- {
- case 'firebird':
- case 'oracle':
- case 'postgres':
- case 'sqlite':
- $row[$col] = substr($row[$col], strlen($table_name) + 1);
- break;
- }
-
- if (strtolower($row[$col]) == strtolower($index_name))
- {
- $this->db->sql_freeresult($result);
- return true;
- }
- }
- $this->db->sql_freeresult($result);
-
- return false;
- }
-
- /**
- * Check if a specified index exists in table. Does not return PRIMARY KEY indexes.
- *
- * @param string $table_name Table to check the index at
- * @param string $index_name The index name to check
- *
- * @return bool True if index exists, else false
- */
- function sql_unique_index_exists($table_name, $index_name)
- {
- if ($this->sql_layer == 'mssql' || $this->sql_layer == 'mssqlnative')
- {
- $sql = "EXEC sp_statistics '$table_name'";
- $result = $this->db->sql_query($sql);
-
- while ($row = $this->db->sql_fetchrow($result))
- {
- // Usually NON_UNIQUE is the column we want to check, but we allow for both
- if ($row['TYPE'] == 3)
- {
- if (strtolower($row['INDEX_NAME']) == strtolower($index_name))
- {
- $this->db->sql_freeresult($result);
- return true;
- }
- }
- }
- $this->db->sql_freeresult($result);
- return false;
- }
-
- switch ($this->sql_layer)
- {
- case 'firebird':
- $sql = "SELECT LOWER(RDB\$INDEX_NAME) as index_name
- FROM RDB\$INDICES
- WHERE RDB\$RELATION_NAME = '" . strtoupper($table_name) . "'
- AND RDB\$UNIQUE_FLAG IS NOT NULL
- AND RDB\$FOREIGN_KEY IS NULL";
- $col = 'index_name';
- break;
-
- case 'postgres':
- $sql = "SELECT ic.relname as index_name, i.indisunique
- FROM pg_class bc, pg_class ic, pg_index i
- WHERE (bc.oid = i.indrelid)
- AND (ic.oid = i.indexrelid)
- AND (bc.relname = '" . $table_name . "')
- AND (i.indisprimary != 't')";
- $col = 'index_name';
- break;
-
- case 'mysql_40':
- case 'mysql_41':
- $sql = 'SHOW KEYS
- FROM ' . $table_name;
- $col = 'Key_name';
- break;
-
- case 'oracle':
- $sql = "SELECT index_name, table_owner
- FROM user_indexes
- WHERE table_name = '" . strtoupper($table_name) . "'
- AND generated = 'N'
- AND uniqueness = 'UNIQUE'";
- $col = 'index_name';
- break;
-
- case 'sqlite':
- $sql = "PRAGMA index_list('" . $table_name . "');";
- $col = 'name';
- break;
- }
-
- $result = $this->db->sql_query($sql);
- while ($row = $this->db->sql_fetchrow($result))
- {
- if (($this->sql_layer == 'mysql_40' || $this->sql_layer == 'mysql_41') && ($row['Non_unique'] || $row[$col] == 'PRIMARY'))
- {
- continue;
- }
-
- if ($this->sql_layer == 'sqlite' && !$row['unique'])
- {
- continue;
- }
-
- if ($this->sql_layer == 'postgres' && $row['indisunique'] != 't')
- {
- continue;
- }
-
- // These DBMS prefix index name with the table name
- switch ($this->sql_layer)
- {
- case 'oracle':
- // Two cases here... prefixed with U_[table_owner] and not prefixed with table_name
- if (strpos($row[$col], 'U_') === 0)
- {
- $row[$col] = substr($row[$col], strlen('U_' . $row['table_owner']) + 1);
- }
- else if (strpos($row[$col], strtoupper($table_name)) === 0)
- {
- $row[$col] = substr($row[$col], strlen($table_name) + 1);
- }
- break;
-
- case 'firebird':
- case 'postgres':
- case 'sqlite':
- $row[$col] = substr($row[$col], strlen($table_name) + 1);
- break;
- }
-
- if (strtolower($row[$col]) == strtolower($index_name))
- {
- $this->db->sql_freeresult($result);
- return true;
- }
- }
- $this->db->sql_freeresult($result);
-
- return false;
- }
-
- /**
- * Private method for performing sql statements (either execute them or return them)
- * @access private
- */
- function _sql_run_sql($statements)
- {
- if ($this->return_statements)
- {
- return $statements;
- }
-
- // We could add error handling here...
- foreach ($statements as $sql)
- {
- if ($sql === 'begin')
- {
- $this->db->sql_transaction('begin');
- }
- else if ($sql === 'commit')
- {
- $this->db->sql_transaction('commit');
- }
- else
- {
- $this->db->sql_query($sql);
- }
- }
-
- return true;
- }
-
- /**
- * Function to prepare some column information for better usage
- * @access private
- */
- function sql_prepare_column_data($table_name, $column_name, $column_data)
- {
- if (strlen($column_name) > 30)
- {
- trigger_error("Column name '$column_name' on table '$table_name' is too long. The maximum is 30 characters.", E_USER_ERROR);
- }
-
- // Get type
- if (strpos($column_data[0], ':') !== false)
- {
- list($orig_column_type, $column_length) = explode(':', $column_data[0]);
- if (!is_array($this->dbms_type_map[$this->sql_layer][$orig_column_type . ':']))
- {
- $column_type = sprintf($this->dbms_type_map[$this->sql_layer][$orig_column_type . ':'], $column_length);
- }
- else
- {
- if (isset($this->dbms_type_map[$this->sql_layer][$orig_column_type . ':']['rule']))
- {
- switch ($this->dbms_type_map[$this->sql_layer][$orig_column_type . ':']['rule'][0])
- {
- case 'div':
- $column_length /= $this->dbms_type_map[$this->sql_layer][$orig_column_type . ':']['rule'][1];
- $column_length = ceil($column_length);
- $column_type = sprintf($this->dbms_type_map[$this->sql_layer][$orig_column_type . ':'][0], $column_length);
- break;
- }
- }
-
- if (isset($this->dbms_type_map[$this->sql_layer][$orig_column_type . ':']['limit']))
- {
- switch ($this->dbms_type_map[$this->sql_layer][$orig_column_type . ':']['limit'][0])
- {
- case 'mult':
- $column_length *= $this->dbms_type_map[$this->sql_layer][$orig_column_type . ':']['limit'][1];
- if ($column_length > $this->dbms_type_map[$this->sql_layer][$orig_column_type . ':']['limit'][2])
- {
- $column_type = $this->dbms_type_map[$this->sql_layer][$orig_column_type . ':']['limit'][3];
- }
- else
- {
- $column_type = sprintf($this->dbms_type_map[$this->sql_layer][$orig_column_type . ':'][0], $column_length);
- }
- break;
- }
- }
- }
- $orig_column_type .= ':';
- }
- else
- {
- $orig_column_type = $column_data[0];
- $column_type = $this->dbms_type_map[$this->sql_layer][$column_data[0]];
- }
-
- // Adjust default value if db-dependant specified
- if (is_array($column_data[1]))
- {
- $column_data[1] = (isset($column_data[1][$this->sql_layer])) ? $column_data[1][$this->sql_layer] : $column_data[1]['default'];
- }
-
- $sql = '';
-
- $return_array = array();
-
- switch ($this->sql_layer)
- {
- case 'firebird':
- $sql .= " {$column_type} ";
- $return_array['column_type_sql_type'] = " {$column_type} ";
-
- if (!is_null($column_data[1]))
- {
- $sql .= 'DEFAULT ' . ((is_numeric($column_data[1])) ? $column_data[1] : "'{$column_data[1]}'") . ' ';
- $return_array['column_type_sql_default'] = ((is_numeric($column_data[1])) ? $column_data[1] : "'{$column_data[1]}'") . ' ';
- }
-
- $sql .= 'NOT NULL';
-
- // This is a UNICODE column and thus should be given it's fair share
- if (preg_match('/^X?STEXT_UNI|VCHAR_(CI|UNI:?)/', $column_data[0]))
- {
- $sql .= ' COLLATE UNICODE';
- }
-
- $return_array['auto_increment'] = false;
- if (isset($column_data[2]) && $column_data[2] == 'auto_increment')
- {
- $return_array['auto_increment'] = true;
- }
-
- break;
-
- case 'mssql':
- case 'mssqlnative':
- $sql .= " {$column_type} ";
- $sql_default = " {$column_type} ";
-
- // For adding columns we need the default definition
- if (!is_null($column_data[1]))
- {
- // For hexadecimal values do not use single quotes
- if (strpos($column_data[1], '0x') === 0)
- {
- $return_array['default'] = 'DEFAULT (' . $column_data[1] . ') ';
- $sql_default .= $return_array['default'];
- }
- else
- {
- $return_array['default'] = 'DEFAULT (' . ((is_numeric($column_data[1])) ? $column_data[1] : "'{$column_data[1]}'") . ') ';
- $sql_default .= $return_array['default'];
- }
- }
-
- if (isset($column_data[2]) && $column_data[2] == 'auto_increment')
- {
-// $sql .= 'IDENTITY (1, 1) ';
- $sql_default .= 'IDENTITY (1, 1) ';
- }
-
- $return_array['textimage'] = $column_type === '[text]';
-
- $sql .= 'NOT NULL';
- $sql_default .= 'NOT NULL';
-
- $return_array['column_type_sql_default'] = $sql_default;
-
- break;
-
- case 'mysql_40':
- case 'mysql_41':
- $sql .= " {$column_type} ";
-
- // For hexadecimal values do not use single quotes
- if (!is_null($column_data[1]) && substr($column_type, -4) !== 'text' && substr($column_type, -4) !== 'blob')
- {
- $sql .= (strpos($column_data[1], '0x') === 0) ? "DEFAULT {$column_data[1]} " : "DEFAULT '{$column_data[1]}' ";
- }
- $sql .= 'NOT NULL';
-
- if (isset($column_data[2]))
- {
- if ($column_data[2] == 'auto_increment')
- {
- $sql .= ' auto_increment';
- }
- else if ($this->sql_layer === 'mysql_41' && $column_data[2] == 'true_sort')
- {
- $sql .= ' COLLATE utf8_unicode_ci';
- }
- }
-
- break;
-
- case 'oracle':
- $sql .= " {$column_type} ";
- $sql .= (!is_null($column_data[1])) ? "DEFAULT '{$column_data[1]}' " : '';
-
- // In Oracle empty strings ('') are treated as NULL.
- // Therefore in oracle we allow NULL's for all DEFAULT '' entries
- // Oracle does not like setting NOT NULL on a column that is already NOT NULL (this happens only on number fields)
- if (!preg_match('/number/i', $column_type))
- {
- $sql .= ($column_data[1] === '') ? '' : 'NOT NULL';
- }
-
- $return_array['auto_increment'] = false;
- if (isset($column_data[2]) && $column_data[2] == 'auto_increment')
- {
- $return_array['auto_increment'] = true;
- }
-
- break;
-
- case 'postgres':
- $return_array['column_type'] = $column_type;
-
- $sql .= " {$column_type} ";
-
- $return_array['auto_increment'] = false;
- if (isset($column_data[2]) && $column_data[2] == 'auto_increment')
- {
- $default_val = "nextval('{$table_name}_seq')";
- $return_array['auto_increment'] = true;
- }
- else if (!is_null($column_data[1]))
- {
- $default_val = "'" . $column_data[1] . "'";
- $return_array['null'] = 'NOT NULL';
- $sql .= 'NOT NULL ';
- }
-
- $return_array['default'] = $default_val;
-
- $sql .= "DEFAULT {$default_val}";
-
- // Unsigned? Then add a CHECK contraint
- if (in_array($orig_column_type, $this->unsigned_types))
- {
- $return_array['constraint'] = "CHECK ({$column_name} >= 0)";
- $sql .= " CHECK ({$column_name} >= 0)";
- }
-
- break;
-
- case 'sqlite':
- $return_array['primary_key_set'] = false;
- if (isset($column_data[2]) && $column_data[2] == 'auto_increment')
- {
- $sql .= ' INTEGER PRIMARY KEY';
- $return_array['primary_key_set'] = true;
- }
- else
- {
- $sql .= ' ' . $column_type;
- }
-
- $sql .= ' NOT NULL ';
- $sql .= (!is_null($column_data[1])) ? "DEFAULT '{$column_data[1]}'" : '';
-
- break;
- }
-
- $return_array['column_type_sql'] = $sql;
-
- return $return_array;
- }
-
- /**
- * Add new column
- */
- function sql_column_add($table_name, $column_name, $column_data, $inline = false)
- {
- $column_data = $this->sql_prepare_column_data($table_name, $column_name, $column_data);
- $statements = array();
-
- switch ($this->sql_layer)
- {
- case 'firebird':
- // Does not support AFTER statement, only POSITION (and there you need the column position)
- $statements[] = 'ALTER TABLE ' . $table_name . ' ADD "' . strtoupper($column_name) . '" ' . $column_data['column_type_sql'];
- break;
-
- case 'mssql':
- case 'mssqlnative':
- // Does not support AFTER, only through temporary table
- $statements[] = 'ALTER TABLE [' . $table_name . '] ADD [' . $column_name . '] ' . $column_data['column_type_sql_default'];
- break;
-
- case 'mysql_40':
- case 'mysql_41':
- $after = (!empty($column_data['after'])) ? ' AFTER ' . $column_data['after'] : '';
- $statements[] = 'ALTER TABLE `' . $table_name . '` ADD COLUMN `' . $column_name . '` ' . $column_data['column_type_sql'] . $after;
- break;
-
- case 'oracle':
- // Does not support AFTER, only through temporary table
- $statements[] = 'ALTER TABLE ' . $table_name . ' ADD ' . $column_name . ' ' . $column_data['column_type_sql'];
- break;
-
- case 'postgres':
- // Does not support AFTER, only through temporary table
- if (version_compare($this->db->sql_server_info(true), '8.0', '>='))
- {
- $statements[] = 'ALTER TABLE ' . $table_name . ' ADD COLUMN "' . $column_name . '" ' . $column_data['column_type_sql'];
- }
- else
- {
- // old versions cannot add columns with default and null information
- $statements[] = 'ALTER TABLE ' . $table_name . ' ADD COLUMN "' . $column_name . '" ' . $column_data['column_type'] . ' ' . $column_data['constraint'];
-
- if (isset($column_data['null']))
- {
- if ($column_data['null'] == 'NOT NULL')
- {
- $statements[] = 'ALTER TABLE ' . $table_name . ' ALTER COLUMN ' . $column_name . ' SET NOT NULL';
- }
- }
-
- if (isset($column_data['default']))
- {
- $statements[] = 'ALTER TABLE ' . $table_name . ' ALTER COLUMN ' . $column_name . ' SET DEFAULT ' . $column_data['default'];
- }
- }
-
- break;
-
- case 'sqlite':
-
- if ($inline && $this->return_statements)
- {
- return $column_name . ' ' . $column_data['column_type_sql'];
- }
-
- if (version_compare(sqlite_libversion(), '3.0') == -1)
- {
- $sql = "SELECT sql
- FROM sqlite_master
- WHERE type = 'table'
- AND name = '{$table_name}'
- ORDER BY type DESC, name;";
- $result = $this->db->sql_query($sql);
-
- if (!$result)
- {
- break;
- }
-
- $row = $this->db->sql_fetchrow($result);
- $this->db->sql_freeresult($result);
-
- $statements[] = 'begin';
-
- // Create a backup table and populate it, destroy the existing one
- $statements[] = preg_replace('#CREATE\s+TABLE\s+"?' . $table_name . '"?#i', 'CREATE TEMPORARY TABLE ' . $table_name . '_temp', $row['sql']);
- $statements[] = 'INSERT INTO ' . $table_name . '_temp SELECT * FROM ' . $table_name;
- $statements[] = 'DROP TABLE ' . $table_name;
-
- preg_match('#\((.*)\)#s', $row['sql'], $matches);
-
- $new_table_cols = trim($matches[1]);
- $old_table_cols = preg_split('/,(?![\s\w]+\))/m', $new_table_cols);
- $column_list = array();
-
- foreach ($old_table_cols as $declaration)
- {
- $entities = preg_split('#\s+#', trim($declaration));
- if ($entities[0] == 'PRIMARY')
- {
- continue;
- }
- $column_list[] = $entities[0];
- }
-
- $columns = implode(',', $column_list);
-
- $new_table_cols = $column_name . ' ' . $column_data['column_type_sql'] . ',' . $new_table_cols;
-
- // create a new table and fill it up. destroy the temp one
- $statements[] = 'CREATE TABLE ' . $table_name . ' (' . $new_table_cols . ');';
- $statements[] = 'INSERT INTO ' . $table_name . ' (' . $columns . ') SELECT ' . $columns . ' FROM ' . $table_name . '_temp;';
- $statements[] = 'DROP TABLE ' . $table_name . '_temp';
-
- $statements[] = 'commit';
- }
- else
- {
- $statements[] = 'ALTER TABLE ' . $table_name . ' ADD ' . $column_name . ' [' . $column_data['column_type_sql'] . ']';
- }
- break;
- }
-
- return $this->_sql_run_sql($statements);
- }
-
- /**
- * Drop column
- */
- function sql_column_remove($table_name, $column_name, $inline = false)
- {
- $statements = array();
-
- switch ($this->sql_layer)
- {
- case 'firebird':
- $statements[] = 'ALTER TABLE ' . $table_name . ' DROP "' . strtoupper($column_name) . '"';
- break;
-
- case 'mssql':
- case 'mssqlnative':
- $sql = "SELECT CAST(SERVERPROPERTY('productversion') AS VARCHAR(25)) AS mssql_version";
- $result = $this->db->sql_query($sql);
- $row = $this->db->sql_fetchrow($result);
- $this->db->sql_freeresult($result);
-
- // Remove default constraints
- if ($row['mssql_version'][0] == '8') // SQL Server 2000
- {
- // http://msdn.microsoft.com/en-us/library/aa175912%28v=sql.80%29.aspx
- // Deprecated in SQL Server 2005
- $statements[] = "DECLARE @drop_default_name VARCHAR(100), @cmd VARCHAR(1000)
- SET @drop_default_name =
- (SELECT so.name FROM sysobjects so
- JOIN sysconstraints sc ON so.id = sc.constid
- WHERE object_name(so.parent_obj) = '{$table_name}'
- AND so.xtype = 'D'
- AND sc.colid = (SELECT colid FROM syscolumns
- WHERE id = object_id('{$table_name}')
- AND name = '{$column_name}'))
- IF @drop_default_name <> ''
- BEGIN
- SET @cmd = 'ALTER TABLE [{$table_name}] DROP CONSTRAINT [' + @drop_default_name + ']'
- EXEC(@cmd)
- END";
- }
- else
- {
- $sql = "SELECT dobj.name AS def_name
- FROM sys.columns col
- LEFT OUTER JOIN sys.objects dobj ON (dobj.object_id = col.default_object_id AND dobj.type = 'D')
- WHERE col.object_id = object_id('{$table_name}')
- AND col.name = '{$column_name}'
- AND dobj.name IS NOT NULL";
- $result = $this->db->sql_query($sql);
- $row = $this->db->sql_fetchrow($result);
- $this->db->sql_freeresult($result);
-
- if ($row)
- {
- $statements[] = 'ALTER TABLE [' . $table_name . '] DROP CONSTRAINT [' . $row['def_name'] . ']';
- }
- }
-
- $statements[] = 'ALTER TABLE [' . $table_name . '] DROP COLUMN [' . $column_name . ']';
- break;
-
- case 'mysql_40':
- case 'mysql_41':
- $statements[] = 'ALTER TABLE `' . $table_name . '` DROP COLUMN `' . $column_name . '`';
- break;
-
- case 'oracle':
- $statements[] = 'ALTER TABLE ' . $table_name . ' DROP COLUMN ' . $column_name;
- break;
-
- case 'postgres':
- $statements[] = 'ALTER TABLE ' . $table_name . ' DROP COLUMN "' . $column_name . '"';
- break;
-
- case 'sqlite':
-
- if ($inline && $this->return_statements)
- {
- return $column_name;
- }
-
- if (version_compare(sqlite_libversion(), '3.0') == -1)
- {
- $sql = "SELECT sql
- FROM sqlite_master
- WHERE type = 'table'
- AND name = '{$table_name}'
- ORDER BY type DESC, name;";
- $result = $this->db->sql_query($sql);
-
- if (!$result)
- {
- break;
- }
-
- $row = $this->db->sql_fetchrow($result);
- $this->db->sql_freeresult($result);
-
- $statements[] = 'begin';
-
- // Create a backup table and populate it, destroy the existing one
- $statements[] = preg_replace('#CREATE\s+TABLE\s+"?' . $table_name . '"?#i', 'CREATE TEMPORARY TABLE ' . $table_name . '_temp', $row['sql']);
- $statements[] = 'INSERT INTO ' . $table_name . '_temp SELECT * FROM ' . $table_name;
- $statements[] = 'DROP TABLE ' . $table_name;
-
- preg_match('#\((.*)\)#s', $row['sql'], $matches);
-
- $new_table_cols = trim($matches[1]);
- $old_table_cols = preg_split('/,(?![\s\w]+\))/m', $new_table_cols);
- $column_list = array();
-
- foreach ($old_table_cols as $declaration)
- {
- $entities = preg_split('#\s+#', trim($declaration));
- if ($entities[0] == 'PRIMARY' || $entities[0] === $column_name)
- {
- continue;
- }
- $column_list[] = $entities[0];
- }
-
- $columns = implode(',', $column_list);
-
- $new_table_cols = preg_replace('/' . $column_name . '[^,]+(?:,|$)/m', '', $new_table_cols);
-
- // create a new table and fill it up. destroy the temp one
- $statements[] = 'CREATE TABLE ' . $table_name . ' (' . $new_table_cols . ');';
- $statements[] = 'INSERT INTO ' . $table_name . ' (' . $columns . ') SELECT ' . $columns . ' FROM ' . $table_name . '_temp;';
- $statements[] = 'DROP TABLE ' . $table_name . '_temp';
-
- $statements[] = 'commit';
- }
- else
- {
- $statements[] = 'ALTER TABLE ' . $table_name . ' DROP COLUMN ' . $column_name;
- }
- break;
- }
-
- return $this->_sql_run_sql($statements);
- }
-
- /**
- * Drop Index
- */
- function sql_index_drop($table_name, $index_name)
- {
- $statements = array();
-
- switch ($this->sql_layer)
- {
- case 'mssql':
- case 'mssqlnative':
- $statements[] = 'DROP INDEX ' . $table_name . '.' . $index_name;
- break;
-
- case 'mysql_40':
- case 'mysql_41':
- $statements[] = 'DROP INDEX ' . $index_name . ' ON ' . $table_name;
- break;
-
- case 'firebird':
- case 'oracle':
- case 'postgres':
- case 'sqlite':
- $statements[] = 'DROP INDEX ' . $table_name . '_' . $index_name;
- break;
- }
-
- return $this->_sql_run_sql($statements);
- }
-
- /**
- * Drop Table
- */
- function sql_table_drop($table_name)
- {
- $statements = array();
-
- if (!$this->sql_table_exists($table_name))
- {
- return $this->_sql_run_sql($statements);
- }
-
- // the most basic operation, get rid of the table
- $statements[] = 'DROP TABLE ' . $table_name;
-
- switch ($this->sql_layer)
- {
- case 'firebird':
- $sql = 'SELECT RDB$GENERATOR_NAME as gen
- FROM RDB$GENERATORS
- WHERE RDB$SYSTEM_FLAG = 0
- AND RDB$GENERATOR_NAME = \'' . strtoupper($table_name) . "_GEN'";
- $result = $this->db->sql_query($sql);
-
- // does a generator exist?
- if ($row = $this->db->sql_fetchrow($result))
- {
- $statements[] = "DROP GENERATOR {$row['gen']};";
- }
- $this->db->sql_freeresult($result);
- break;
-
- case 'oracle':
- $sql = 'SELECT A.REFERENCED_NAME
- FROM USER_DEPENDENCIES A, USER_TRIGGERS B
- WHERE A.REFERENCED_TYPE = \'SEQUENCE\'
- AND A.NAME = B.TRIGGER_NAME
- AND B.TABLE_NAME = \'' . strtoupper($table_name) . "'";
- $result = $this->db->sql_query($sql);
-
- // any sequences ref'd to this table's triggers?
- while ($row = $this->db->sql_fetchrow($result))
- {
- $statements[] = "DROP SEQUENCE {$row['referenced_name']}";
- }
- $this->db->sql_freeresult($result);
- break;
-
- case 'postgres':
- // PGSQL does not "tightly" bind sequences and tables, we must guess...
- $sql = "SELECT relname
- FROM pg_class
- WHERE relkind = 'S'
- AND relname = '{$table_name}_seq'";
- $result = $this->db->sql_query($sql);
-
- // We don't even care about storing the results. We already know the answer if we get rows back.
- if ($this->db->sql_fetchrow($result))
- {
- $statements[] = "DROP SEQUENCE {$table_name}_seq;\n";
- }
- $this->db->sql_freeresult($result);
- break;
- }
-
- return $this->_sql_run_sql($statements);
- }
-
- /**
- * Add primary key
- */
- function sql_create_primary_key($table_name, $column, $inline = false)
- {
- $statements = array();
-
- switch ($this->sql_layer)
- {
- case 'firebird':
- case 'postgres':
- case 'mysql_40':
- case 'mysql_41':
- $statements[] = 'ALTER TABLE ' . $table_name . ' ADD PRIMARY KEY (' . implode(', ', $column) . ')';
- break;
-
- case 'mssql':
- case 'mssqlnative':
- $sql = "ALTER TABLE [{$table_name}] WITH NOCHECK ADD ";
- $sql .= "CONSTRAINT [PK_{$table_name}] PRIMARY KEY CLUSTERED (";
- $sql .= '[' . implode("],\n\t\t[", $column) . ']';
- $sql .= ')';
-
- $statements[] = $sql;
- break;
-
- case 'oracle':
- $statements[] = 'ALTER TABLE ' . $table_name . 'add CONSTRAINT pk_' . $table_name . ' PRIMARY KEY (' . implode(', ', $column) . ')';
- break;
-
- case 'sqlite':
-
- if ($inline && $this->return_statements)
- {
- return $column;
- }
-
- $sql = "SELECT sql
- FROM sqlite_master
- WHERE type = 'table'
- AND name = '{$table_name}'
- ORDER BY type DESC, name;";
- $result = $this->db->sql_query($sql);
-
- if (!$result)
- {
- break;
- }
-
- $row = $this->db->sql_fetchrow($result);
- $this->db->sql_freeresult($result);
-
- $statements[] = 'begin';
-
- // Create a backup table and populate it, destroy the existing one
- $statements[] = preg_replace('#CREATE\s+TABLE\s+"?' . $table_name . '"?#i', 'CREATE TEMPORARY TABLE ' . $table_name . '_temp', $row['sql']);
- $statements[] = 'INSERT INTO ' . $table_name . '_temp SELECT * FROM ' . $table_name;
- $statements[] = 'DROP TABLE ' . $table_name;
-
- preg_match('#\((.*)\)#s', $row['sql'], $matches);
-
- $new_table_cols = trim($matches[1]);
- $old_table_cols = preg_split('/,(?![\s\w]+\))/m', $new_table_cols);
- $column_list = array();
-
- foreach ($old_table_cols as $declaration)
- {
- $entities = preg_split('#\s+#', trim($declaration));
- if ($entities[0] == 'PRIMARY')
- {
- continue;
- }
- $column_list[] = $entities[0];
- }
-
- $columns = implode(',', $column_list);
-
- // create a new table and fill it up. destroy the temp one
- $statements[] = 'CREATE TABLE ' . $table_name . ' (' . $new_table_cols . ', PRIMARY KEY (' . implode(', ', $column) . '));';
- $statements[] = 'INSERT INTO ' . $table_name . ' (' . $columns . ') SELECT ' . $columns . ' FROM ' . $table_name . '_temp;';
- $statements[] = 'DROP TABLE ' . $table_name . '_temp';
-
- $statements[] = 'commit';
- break;
- }
-
- return $this->_sql_run_sql($statements);
- }
-
- /**
- * Add unique index
- */
- function sql_create_unique_index($table_name, $index_name, $column)
- {
- $statements = array();
-
- $table_prefix = substr(CONFIG_TABLE, 0, -6); // strlen(config)
- if (strlen($table_name . $index_name) - strlen($table_prefix) > 24)
- {
- $max_length = strlen($table_prefix) + 24;
- trigger_error("Index name '{$table_name}_$index_name' on table '$table_name' is too long. The maximum is $max_length characters.", E_USER_ERROR);
- }
-
- switch ($this->sql_layer)
- {
- case 'firebird':
- case 'postgres':
- case 'oracle':
- case 'sqlite':
- $statements[] = 'CREATE UNIQUE INDEX ' . $table_name . '_' . $index_name . ' ON ' . $table_name . '(' . implode(', ', $column) . ')';
- break;
-
- case 'mysql_40':
- case 'mysql_41':
- $statements[] = 'ALTER TABLE ' . $table_name . ' ADD UNIQUE INDEX ' . $index_name . '(' . implode(', ', $column) . ')';
- break;
-
- case 'mssql':
- case 'mssqlnative':
- $statements[] = 'CREATE UNIQUE INDEX ' . $index_name . ' ON ' . $table_name . '(' . implode(', ', $column) . ')';
- break;
- }
-
- return $this->_sql_run_sql($statements);
- }
-
- /**
- * Add index
- */
- function sql_create_index($table_name, $index_name, $column)
- {
- $statements = array();
-
- $table_prefix = substr(CONFIG_TABLE, 0, -6); // strlen(config)
- if (strlen($table_name . $index_name) - strlen($table_prefix) > 24)
- {
- $max_length = strlen($table_prefix) + 24;
- trigger_error("Index name '{$table_name}_$index_name' on table '$table_name' is too long. The maximum is $max_length characters.", E_USER_ERROR);
- }
-
- // remove index length unless MySQL4
- if ('mysql_40' != $this->sql_layer)
- {
- $column = preg_replace('#:.*$#', '', $column);
- }
-
- switch ($this->sql_layer)
- {
- case 'firebird':
- case 'postgres':
- case 'oracle':
- case 'sqlite':
- $statements[] = 'CREATE INDEX ' . $table_name . '_' . $index_name . ' ON ' . $table_name . '(' . implode(', ', $column) . ')';
- break;
-
- case 'mysql_40':
- // add index size to definition as required by MySQL4
- foreach ($column as $i => $col)
- {
- if (false !== strpos($col, ':'))
- {
- list($col, $index_size) = explode(':', $col);
- $column[$i] = "$col($index_size)";
- }
- }
- // no break
- case 'mysql_41':
- $statements[] = 'ALTER TABLE ' . $table_name . ' ADD INDEX ' . $index_name . '(' . implode(', ', $column) . ')';
- break;
-
- case 'mssql':
- case 'mssqlnative':
- $statements[] = 'CREATE INDEX ' . $index_name . ' ON ' . $table_name . '(' . implode(', ', $column) . ')';
- break;
- }
-
- return $this->_sql_run_sql($statements);
- }
-
- /**
- * List all of the indices that belong to a table,
- * does not count:
- * * UNIQUE indices
- * * PRIMARY keys
- */
- function sql_list_index($table_name)
- {
- $index_array = array();
-
- if ($this->sql_layer == 'mssql' || $this->sql_layer == 'mssqlnative')
- {
- $sql = "EXEC sp_statistics '$table_name'";
- $result = $this->db->sql_query($sql);
- while ($row = $this->db->sql_fetchrow($result))
- {
- if ($row['TYPE'] == 3)
- {
- $index_array[] = $row['INDEX_NAME'];
- }
- }
- $this->db->sql_freeresult($result);
- }
- else
- {
- switch ($this->sql_layer)
- {
- case 'firebird':
- $sql = "SELECT LOWER(RDB\$INDEX_NAME) as index_name
- FROM RDB\$INDICES
- WHERE RDB\$RELATION_NAME = '" . strtoupper($table_name) . "'
- AND RDB\$UNIQUE_FLAG IS NULL
- AND RDB\$FOREIGN_KEY IS NULL";
- $col = 'index_name';
- break;
-
- case 'postgres':
- $sql = "SELECT ic.relname as index_name
- FROM pg_class bc, pg_class ic, pg_index i
- WHERE (bc.oid = i.indrelid)
- AND (ic.oid = i.indexrelid)
- AND (bc.relname = '" . $table_name . "')
- AND (i.indisunique != 't')
- AND (i.indisprimary != 't')";
- $col = 'index_name';
- break;
-
- case 'mysql_40':
- case 'mysql_41':
- $sql = 'SHOW KEYS
- FROM ' . $table_name;
- $col = 'Key_name';
- break;
-
- case 'oracle':
- $sql = "SELECT index_name
- FROM user_indexes
- WHERE table_name = '" . strtoupper($table_name) . "'
- AND generated = 'N'
- AND uniqueness = 'NONUNIQUE'";
- $col = 'index_name';
- break;
-
- case 'sqlite':
- $sql = "PRAGMA index_info('" . $table_name . "');";
- $col = 'name';
- break;
- }
-
- $result = $this->db->sql_query($sql);
- while ($row = $this->db->sql_fetchrow($result))
- {
- if (($this->sql_layer == 'mysql_40' || $this->sql_layer == 'mysql_41') && !$row['Non_unique'])
- {
- continue;
- }
-
- switch ($this->sql_layer)
- {
- case 'firebird':
- case 'oracle':
- case 'postgres':
- case 'sqlite':
- $row[$col] = substr($row[$col], strlen($table_name) + 1);
- break;
- }
-
- $index_array[] = $row[$col];
- }
- $this->db->sql_freeresult($result);
- }
-
- return array_map('strtolower', $index_array);
- }
-
- /**
- * Change column type (not name!)
- */
- function sql_column_change($table_name, $column_name, $column_data, $inline = false)
- {
- $column_data = $this->sql_prepare_column_data($table_name, $column_name, $column_data);
- $statements = array();
-
- switch ($this->sql_layer)
- {
- case 'firebird':
- // Change type...
- if (!empty($column_data['column_type_sql_default']))
- {
- $statements[] = 'ALTER TABLE ' . $table_name . ' ALTER COLUMN "' . strtoupper($column_name) . '" TYPE ' . ' ' . $column_data['column_type_sql_type'];
- $statements[] = 'ALTER TABLE ' . $table_name . ' ALTER COLUMN "' . strtoupper($column_name) . '" SET DEFAULT ' . ' ' . $column_data['column_type_sql_default'];
- }
- else
- {
- // TODO: try to change pkey without removing trigger, generator or constraints. ATM this query may fail.
- $statements[] = 'ALTER TABLE ' . $table_name . ' ALTER COLUMN "' . strtoupper($column_name) . '" TYPE ' . ' ' . $column_data['column_type_sql_type'];
- }
- break;
-
- case 'mssql':
- case 'mssqlnative':
- $statements[] = 'ALTER TABLE [' . $table_name . '] ALTER COLUMN [' . $column_name . '] ' . $column_data['column_type_sql'];
-
- if (!empty($column_data['default']))
- {
- $sql = "SELECT CAST(SERVERPROPERTY('productversion') AS VARCHAR(25)) AS mssql_version";
- $result = $this->db->sql_query($sql);
- $row = $this->db->sql_fetchrow($result);
- $this->db->sql_freeresult($result);
-
- // Using TRANSACT-SQL for this statement because we do not want to have colliding data if statements are executed at a later stage
- if ($row['mssql_version'][0] == '8') // SQL Server 2000
- {
- $statements[] = "DECLARE @drop_default_name VARCHAR(100), @cmd VARCHAR(1000)
- SET @drop_default_name =
- (SELECT so.name FROM sysobjects so
- JOIN sysconstraints sc ON so.id = sc.constid
- WHERE object_name(so.parent_obj) = '{$table_name}'
- AND so.xtype = 'D'
- AND sc.colid = (SELECT colid FROM syscolumns
- WHERE id = object_id('{$table_name}')
- AND name = '{$column_name}'))
- IF @drop_default_name <> ''
- BEGIN
- SET @cmd = 'ALTER TABLE [{$table_name}] DROP CONSTRAINT [' + @drop_default_name + ']'
- EXEC(@cmd)
- END
- SET @cmd = 'ALTER TABLE [{$table_name}] ADD CONSTRAINT [DF_{$table_name}_{$column_name}_1] {$column_data['default']} FOR [{$column_name}]'
- EXEC(@cmd)";
- }
- else
- {
- $statements[] = "DECLARE @drop_default_name VARCHAR(100), @cmd VARCHAR(1000)
- SET @drop_default_name =
- (SELECT dobj.name FROM sys.columns col
- LEFT OUTER JOIN sys.objects dobj ON (dobj.object_id = col.default_object_id AND dobj.type = 'D')
- WHERE col.object_id = object_id('{$table_name}')
- AND col.name = '{$column_name}'
- AND dobj.name IS NOT NULL)
- IF @drop_default_name <> ''
- BEGIN
- SET @cmd = 'ALTER TABLE [{$table_name}] DROP CONSTRAINT [' + @drop_default_name + ']'
- EXEC(@cmd)
- END
- SET @cmd = 'ALTER TABLE [{$table_name}] ADD CONSTRAINT [DF_{$table_name}_{$column_name}_1] {$column_data['default']} FOR [{$column_name}]'
- EXEC(@cmd)";
- }
- }
- break;
-
- case 'mysql_40':
- case 'mysql_41':
- $statements[] = 'ALTER TABLE `' . $table_name . '` CHANGE `' . $column_name . '` `' . $column_name . '` ' . $column_data['column_type_sql'];
- break;
-
- case 'oracle':
- $statements[] = 'ALTER TABLE ' . $table_name . ' MODIFY ' . $column_name . ' ' . $column_data['column_type_sql'];
- break;
-
- case 'postgres':
- $sql = 'ALTER TABLE ' . $table_name . ' ';
-
- $sql_array = array();
- $sql_array[] = 'ALTER COLUMN ' . $column_name . ' TYPE ' . $column_data['column_type'];
-
- if (isset($column_data['null']))
- {
- if ($column_data['null'] == 'NOT NULL')
- {
- $sql_array[] = 'ALTER COLUMN ' . $column_name . ' SET NOT NULL';
- }
- else if ($column_data['null'] == 'NULL')
- {
- $sql_array[] = 'ALTER COLUMN ' . $column_name . ' DROP NOT NULL';
- }
- }
-
- if (isset($column_data['default']))
- {
- $sql_array[] = 'ALTER COLUMN ' . $column_name . ' SET DEFAULT ' . $column_data['default'];
- }
-
- // we don't want to double up on constraints if we change different number data types
- if (isset($column_data['constraint']))
- {
- $constraint_sql = "SELECT consrc as constraint_data
- FROM pg_constraint, pg_class bc
- WHERE conrelid = bc.oid
- AND bc.relname = '{$table_name}'
- AND NOT EXISTS (
- SELECT *
- FROM pg_constraint as c, pg_inherits as i
- WHERE i.inhrelid = pg_constraint.conrelid
- AND c.conname = pg_constraint.conname
- AND c.consrc = pg_constraint.consrc
- AND c.conrelid = i.inhparent
- )";
-
- $constraint_exists = false;
-
- $result = $this->db->sql_query($constraint_sql);
- while ($row = $this->db->sql_fetchrow($result))
- {
- if (trim($row['constraint_data']) == trim($column_data['constraint']))
- {
- $constraint_exists = true;
- break;
- }
- }
- $this->db->sql_freeresult($result);
-
- if (!$constraint_exists)
- {
- $sql_array[] = 'ADD ' . $column_data['constraint'];
- }
- }
-
- $sql .= implode(', ', $sql_array);
-
- $statements[] = $sql;
- break;
-
- case 'sqlite':
-
- if ($inline && $this->return_statements)
- {
- return $column_name . ' ' . $column_data['column_type_sql'];
- }
-
- $sql = "SELECT sql
- FROM sqlite_master
- WHERE type = 'table'
- AND name = '{$table_name}'
- ORDER BY type DESC, name;";
- $result = $this->db->sql_query($sql);
-
- if (!$result)
- {
- break;
- }
-
- $row = $this->db->sql_fetchrow($result);
- $this->db->sql_freeresult($result);
-
- $statements[] = 'begin';
-
- // Create a temp table and populate it, destroy the existing one
- $statements[] = preg_replace('#CREATE\s+TABLE\s+"?' . $table_name . '"?#i', 'CREATE TEMPORARY TABLE ' . $table_name . '_temp', $row['sql']);
- $statements[] = 'INSERT INTO ' . $table_name . '_temp SELECT * FROM ' . $table_name;
- $statements[] = 'DROP TABLE ' . $table_name;
-
- preg_match('#\((.*)\)#s', $row['sql'], $matches);
-
- $new_table_cols = trim($matches[1]);
- $old_table_cols = preg_split('/,(?![\s\w]+\))/m', $new_table_cols);
- $column_list = array();
-
- foreach ($old_table_cols as $key => $declaration)
- {
- $entities = preg_split('#\s+#', trim($declaration));
- $column_list[] = $entities[0];
- if ($entities[0] == $column_name)
- {
- $old_table_cols[$key] = $column_name . ' ' . $column_data['column_type_sql'];
- }
- }
-
- $columns = implode(',', $column_list);
-
- // create a new table and fill it up. destroy the temp one
- $statements[] = 'CREATE TABLE ' . $table_name . ' (' . implode(',', $old_table_cols) . ');';
- $statements[] = 'INSERT INTO ' . $table_name . ' (' . $columns . ') SELECT ' . $columns . ' FROM ' . $table_name . '_temp;';
- $statements[] = 'DROP TABLE ' . $table_name . '_temp';
-
- $statements[] = 'commit';
-
- break;
- }
-
- return $this->_sql_run_sql($statements);
- }
-}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/db/dbal.php b/phpBB/includes/db/dbal.php
deleted file mode 100644
index 30d2870938..0000000000
--- a/phpBB/includes/db/dbal.php
+++ /dev/null
@@ -1,1000 +0,0 @@
-<?php
-/**
-*
-* @package dbal
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
-*
-*/
-
-/**
-* @ignore
-*/
-if (!defined('IN_PHPBB'))
-{
- exit;
-}
-
-/**
-* Database Abstraction Layer
-* @package dbal
-*/
-class dbal
-{
- var $db_connect_id;
- var $query_result;
- var $return_on_error = false;
- var $transaction = false;
- var $sql_time = 0;
- var $num_queries = array();
- var $open_queries = array();
-
- var $curtime = 0;
- var $query_hold = '';
- var $html_hold = '';
- var $sql_report = '';
-
- var $persistency = false;
- var $user = '';
- var $server = '';
- var $dbname = '';
-
- // Set to true if error triggered
- var $sql_error_triggered = false;
-
- // Holding the last sql query on sql error
- var $sql_error_sql = '';
- // Holding the error information - only populated if sql_error_triggered is set
- var $sql_error_returned = array();
-
- // Holding transaction count
- var $transactions = 0;
-
- // Supports multi inserts?
- var $multi_insert = false;
-
- /**
- * Current sql layer
- */
- var $sql_layer = '';
-
- /**
- * Wildcards for matching any (%) or exactly one (_) character within LIKE expressions
- */
- var $any_char;
- var $one_char;
-
- /**
- * Exact version of the DBAL, directly queried
- */
- var $sql_server_version = false;
-
- /**
- * Constructor
- */
- function dbal()
- {
- $this->num_queries = array(
- 'cached' => 0,
- 'normal' => 0,
- 'total' => 0,
- );
-
- // Fill default sql layer based on the class being called.
- // This can be changed by the specified layer itself later if needed.
- $this->sql_layer = substr(get_class($this), 5);
-
- // Do not change this please! This variable is used to easy the use of it - and is hardcoded.
- $this->any_char = chr(0) . '%';
- $this->one_char = chr(0) . '_';
- }
-
- /**
- * return on error or display error message
- */
- function sql_return_on_error($fail = false)
- {
- $this->sql_error_triggered = false;
- $this->sql_error_sql = '';
-
- $this->return_on_error = $fail;
- }
-
- /**
- * Return number of sql queries and cached sql queries used
- */
- function sql_num_queries($cached = false)
- {
- return ($cached) ? $this->num_queries['cached'] : $this->num_queries['normal'];
- }
-
- /**
- * Add to query count
- */
- function sql_add_num_queries($cached = false)
- {
- $this->num_queries['cached'] += ($cached !== false) ? 1 : 0;
- $this->num_queries['normal'] += ($cached !== false) ? 0 : 1;
- $this->num_queries['total'] += 1;
- }
-
- /**
- * DBAL garbage collection, close sql connection
- */
- function sql_close()
- {
- if (!$this->db_connect_id)
- {
- return false;
- }
-
- if ($this->transaction)
- {
- do
- {
- $this->sql_transaction('commit');
- }
- while ($this->transaction);
- }
-
- foreach ($this->open_queries as $query_id)
- {
- $this->sql_freeresult($query_id);
- }
-
- // Connection closed correctly. Set db_connect_id to false to prevent errors
- if ($result = $this->_sql_close())
- {
- $this->db_connect_id = false;
- }
-
- return $result;
- }
-
- /**
- * Build LIMIT query
- * Doing some validation here.
- */
- function sql_query_limit($query, $total, $offset = 0, $cache_ttl = 0)
- {
- if (empty($query))
- {
- return false;
- }
-
- // Never use a negative total or offset
- $total = ($total < 0) ? 0 : $total;
- $offset = ($offset < 0) ? 0 : $offset;
-
- return $this->_sql_query_limit($query, $total, $offset, $cache_ttl);
- }
-
- /**
- * Fetch all rows
- */
- function sql_fetchrowset($query_id = false)
- {
- if ($query_id === false)
- {
- $query_id = $this->query_result;
- }
-
- if ($query_id !== false)
- {
- $result = array();
- while ($row = $this->sql_fetchrow($query_id))
- {
- $result[] = $row;
- }
-
- return $result;
- }
-
- return false;
- }
-
- /**
- * Seek to given row number
- * rownum is zero-based
- */
- function sql_rowseek($rownum, &$query_id)
- {
- global $cache;
-
- if ($query_id === false)
- {
- $query_id = $this->query_result;
- }
-
- if (isset($cache->sql_rowset[$query_id]))
- {
- return $cache->sql_rowseek($rownum, $query_id);
- }
-
- if ($query_id === false)
- {
- return false;
- }
-
- $this->sql_freeresult($query_id);
- $query_id = $this->sql_query($this->last_query_text);
-
- if ($query_id === false)
- {
- return false;
- }
-
- // We do not fetch the row for rownum == 0 because then the next resultset would be the second row
- for ($i = 0; $i < $rownum; $i++)
- {
- if (!$this->sql_fetchrow($query_id))
- {
- return false;
- }
- }
-
- return true;
- }
-
- /**
- * Fetch field
- * if rownum is false, the current row is used, else it is pointing to the row (zero-based)
- */
- function sql_fetchfield($field, $rownum = false, $query_id = false)
- {
- global $cache;
-
- if ($query_id === false)
- {
- $query_id = $this->query_result;
- }
-
- if ($query_id !== false)
- {
- if ($rownum !== false)
- {
- $this->sql_rowseek($rownum, $query_id);
- }
-
- if (!is_object($query_id) && isset($cache->sql_rowset[$query_id]))
- {
- return $cache->sql_fetchfield($query_id, $field);
- }
-
- $row = $this->sql_fetchrow($query_id);
- return (isset($row[$field])) ? $row[$field] : false;
- }
-
- return false;
- }
-
- /**
- * Correctly adjust LIKE expression for special characters
- * Some DBMS are handling them in a different way
- *
- * @param string $expression The expression to use. Every wildcard is escaped, except $this->any_char and $this->one_char
- * @return string LIKE expression including the keyword!
- */
- function sql_like_expression($expression)
- {
- $expression = utf8_str_replace(array('_', '%'), array("\_", "\%"), $expression);
- $expression = utf8_str_replace(array(chr(0) . "\_", chr(0) . "\%"), array('_', '%'), $expression);
-
- return $this->_sql_like_expression('LIKE \'' . $this->sql_escape($expression) . '\'');
- }
-
- /**
- * Returns whether results of a query need to be buffered to run a transaction while iterating over them.
- *
- * @return bool Whether buffering is required.
- */
- function sql_buffer_nested_transactions()
- {
- return false;
- }
-
- /**
- * SQL Transaction
- * @access private
- */
- function sql_transaction($status = 'begin')
- {
- switch ($status)
- {
- case 'begin':
- // If we are within a transaction we will not open another one, but enclose the current one to not loose data (prevening auto commit)
- if ($this->transaction)
- {
- $this->transactions++;
- return true;
- }
-
- $result = $this->_sql_transaction('begin');
-
- if (!$result)
- {
- $this->sql_error();
- }
-
- $this->transaction = true;
- break;
-
- case 'commit':
- // If there was a previously opened transaction we do not commit yet... but count back the number of inner transactions
- if ($this->transaction && $this->transactions)
- {
- $this->transactions--;
- return true;
- }
-
- // Check if there is a transaction (no transaction can happen if there was an error, with a combined rollback and error returning enabled)
- // This implies we have transaction always set for autocommit db's
- if (!$this->transaction)
- {
- return false;
- }
-
- $result = $this->_sql_transaction('commit');
-
- if (!$result)
- {
- $this->sql_error();
- }
-
- $this->transaction = false;
- $this->transactions = 0;
- break;
-
- case 'rollback':
- $result = $this->_sql_transaction('rollback');
- $this->transaction = false;
- $this->transactions = 0;
- break;
-
- default:
- $result = $this->_sql_transaction($status);
- break;
- }
-
- return $result;
- }
-
- /**
- * Build sql statement from array for insert/update/select statements
- *
- * Idea for this from Ikonboard
- * Possible query values: INSERT, INSERT_SELECT, UPDATE, SELECT
- *
- */
- function sql_build_array($query, $assoc_ary = false)
- {
- if (!is_array($assoc_ary))
- {
- return false;
- }
-
- $fields = $values = array();
-
- if ($query == 'INSERT' || $query == 'INSERT_SELECT')
- {
- foreach ($assoc_ary as $key => $var)
- {
- $fields[] = $key;
-
- if (is_array($var) && is_string($var[0]))
- {
- // This is used for INSERT_SELECT(s)
- $values[] = $var[0];
- }
- else
- {
- $values[] = $this->_sql_validate_value($var);
- }
- }
-
- $query = ($query == 'INSERT') ? ' (' . implode(', ', $fields) . ') VALUES (' . implode(', ', $values) . ')' : ' (' . implode(', ', $fields) . ') SELECT ' . implode(', ', $values) . ' ';
- }
- else if ($query == 'MULTI_INSERT')
- {
- trigger_error('The MULTI_INSERT query value is no longer supported. Please use sql_multi_insert() instead.', E_USER_ERROR);
- }
- else if ($query == 'UPDATE' || $query == 'SELECT')
- {
- $values = array();
- foreach ($assoc_ary as $key => $var)
- {
- $values[] = "$key = " . $this->_sql_validate_value($var);
- }
- $query = implode(($query == 'UPDATE') ? ', ' : ' AND ', $values);
- }
-
- return $query;
- }
-
- /**
- * Build IN or NOT IN sql comparison string, uses <> or = on single element
- * arrays to improve comparison speed
- *
- * @access public
- * @param string $field name of the sql column that shall be compared
- * @param array $array array of values that are allowed (IN) or not allowed (NOT IN)
- * @param bool $negate true for NOT IN (), false for IN () (default)
- * @param bool $allow_empty_set If true, allow $array to be empty, this function will return 1=1 or 1=0 then. Default to false.
- */
- function sql_in_set($field, $array, $negate = false, $allow_empty_set = false)
- {
- if (!sizeof($array))
- {
- if (!$allow_empty_set)
- {
- // Print the backtrace to help identifying the location of the problematic code
- $this->sql_error('No values specified for SQL IN comparison');
- }
- else
- {
- // NOT IN () actually means everything so use a tautology
- if ($negate)
- {
- return '1=1';
- }
- // IN () actually means nothing so use a contradiction
- else
- {
- return '1=0';
- }
- }
- }
-
- if (!is_array($array))
- {
- $array = array($array);
- }
-
- if (sizeof($array) == 1)
- {
- @reset($array);
- $var = current($array);
-
- return $field . ($negate ? ' <> ' : ' = ') . $this->_sql_validate_value($var);
- }
- else
- {
- return $field . ($negate ? ' NOT IN ' : ' IN ') . '(' . implode(', ', array_map(array($this, '_sql_validate_value'), $array)) . ')';
- }
- }
-
- /**
- * Run binary AND operator on DB column.
- * Results in sql statement: "{$column_name} & (1 << {$bit}) {$compare}"
- *
- * @param string $column_name The column name to use
- * @param int $bit The value to use for the AND operator, will be converted to (1 << $bit). Is used by options, using the number schema... 0, 1, 2...29
- * @param string $compare Any custom SQL code after the check (for example "= 0")
- */
- function sql_bit_and($column_name, $bit, $compare = '')
- {
- if (method_exists($this, '_sql_bit_and'))
- {
- return $this->_sql_bit_and($column_name, $bit, $compare);
- }
-
- return $column_name . ' & ' . (1 << $bit) . (($compare) ? ' ' . $compare : '');
- }
-
- /**
- * Run binary OR operator on DB column.
- * Results in sql statement: "{$column_name} | (1 << {$bit}) {$compare}"
- *
- * @param string $column_name The column name to use
- * @param int $bit The value to use for the OR operator, will be converted to (1 << $bit). Is used by options, using the number schema... 0, 1, 2...29
- * @param string $compare Any custom SQL code after the check (for example "= 0")
- */
- function sql_bit_or($column_name, $bit, $compare = '')
- {
- if (method_exists($this, '_sql_bit_or'))
- {
- return $this->_sql_bit_or($column_name, $bit, $compare);
- }
-
- return $column_name . ' | ' . (1 << $bit) . (($compare) ? ' ' . $compare : '');
- }
-
- /**
- * Run LOWER() on DB column of type text (i.e. neither varchar nor char).
- *
- * @param string $column_name The column name to use
- *
- * @return string A SQL statement like "LOWER($column_name)"
- */
- function sql_lower_text($column_name)
- {
- return "LOWER($column_name)";
- }
-
- /**
- * Run more than one insert statement.
- *
- * @param string $table table name to run the statements on
- * @param array &$sql_ary multi-dimensional array holding the statement data.
- *
- * @return bool false if no statements were executed.
- * @access public
- */
- function sql_multi_insert($table, &$sql_ary)
- {
- if (!sizeof($sql_ary))
- {
- return false;
- }
-
- if ($this->multi_insert)
- {
- $ary = array();
- foreach ($sql_ary as $id => $_sql_ary)
- {
- // If by accident the sql array is only one-dimensional we build a normal insert statement
- if (!is_array($_sql_ary))
- {
- return $this->sql_query('INSERT INTO ' . $table . ' ' . $this->sql_build_array('INSERT', $sql_ary));
- }
-
- $values = array();
- foreach ($_sql_ary as $key => $var)
- {
- $values[] = $this->_sql_validate_value($var);
- }
- $ary[] = '(' . implode(', ', $values) . ')';
- }
-
- return $this->sql_query('INSERT INTO ' . $table . ' ' . ' (' . implode(', ', array_keys($sql_ary[0])) . ') VALUES ' . implode(', ', $ary));
- }
- else
- {
- foreach ($sql_ary as $ary)
- {
- if (!is_array($ary))
- {
- return false;
- }
-
- $result = $this->sql_query('INSERT INTO ' . $table . ' ' . $this->sql_build_array('INSERT', $ary));
-
- if (!$result)
- {
- return false;
- }
- }
- }
-
- return true;
- }
-
- /**
- * Function for validating values
- * @access private
- */
- function _sql_validate_value($var)
- {
- if (is_null($var))
- {
- return 'NULL';
- }
- else if (is_string($var))
- {
- return "'" . $this->sql_escape($var) . "'";
- }
- else
- {
- return (is_bool($var)) ? intval($var) : $var;
- }
- }
-
- /**
- * Build sql statement from array for select and select distinct statements
- *
- * Possible query values: SELECT, SELECT_DISTINCT
- */
- function sql_build_query($query, $array)
- {
- $sql = '';
- switch ($query)
- {
- case 'SELECT':
- case 'SELECT_DISTINCT';
-
- $sql = str_replace('_', ' ', $query) . ' ' . $array['SELECT'] . ' FROM ';
-
- // Build table array. We also build an alias array for later checks.
- $table_array = $aliases = array();
- $used_multi_alias = false;
-
- foreach ($array['FROM'] as $table_name => $alias)
- {
- if (is_array($alias))
- {
- $used_multi_alias = true;
-
- foreach ($alias as $multi_alias)
- {
- $table_array[] = $table_name . ' ' . $multi_alias;
- $aliases[] = $multi_alias;
- }
- }
- else
- {
- $table_array[] = $table_name . ' ' . $alias;
- $aliases[] = $alias;
- }
- }
-
- // We run the following code to determine if we need to re-order the table array. ;)
- // The reason for this is that for multi-aliased tables (two equal tables) in the FROM statement the last table need to match the first comparison.
- // DBMS who rely on this: Oracle, PostgreSQL and MSSQL. For all other DBMS it makes absolutely no difference in which order the table is.
- if (!empty($array['LEFT_JOIN']) && sizeof($array['FROM']) > 1 && $used_multi_alias !== false)
- {
- // Take first LEFT JOIN
- $join = current($array['LEFT_JOIN']);
-
- // Determine the table used there (even if there are more than one used, we only want to have one
- preg_match('/(' . implode('|', $aliases) . ')\.[^\s]+/U', str_replace(array('(', ')', 'AND', 'OR', ' '), '', $join['ON']), $matches);
-
- // If there is a first join match, we need to make sure the table order is correct
- if (!empty($matches[1]))
- {
- $first_join_match = trim($matches[1]);
- $table_array = $last = array();
-
- foreach ($array['FROM'] as $table_name => $alias)
- {
- if (is_array($alias))
- {
- foreach ($alias as $multi_alias)
- {
- ($multi_alias === $first_join_match) ? $last[] = $table_name . ' ' . $multi_alias : $table_array[] = $table_name . ' ' . $multi_alias;
- }
- }
- else
- {
- ($alias === $first_join_match) ? $last[] = $table_name . ' ' . $alias : $table_array[] = $table_name . ' ' . $alias;
- }
- }
-
- $table_array = array_merge($table_array, $last);
- }
- }
-
- $sql .= $this->_sql_custom_build('FROM', implode(' CROSS JOIN ', $table_array));
-
- if (!empty($array['LEFT_JOIN']))
- {
- foreach ($array['LEFT_JOIN'] as $join)
- {
- $sql .= ' LEFT JOIN ' . key($join['FROM']) . ' ' . current($join['FROM']) . ' ON (' . $join['ON'] . ')';
- }
- }
-
- if (!empty($array['WHERE']))
- {
- $sql .= ' WHERE ' . $this->_sql_custom_build('WHERE', $array['WHERE']);
- }
-
- if (!empty($array['GROUP_BY']))
- {
- $sql .= ' GROUP BY ' . $array['GROUP_BY'];
- }
-
- if (!empty($array['ORDER_BY']))
- {
- $sql .= ' ORDER BY ' . $array['ORDER_BY'];
- }
-
- break;
- }
-
- return $sql;
- }
-
- /**
- * display sql error page
- */
- function sql_error($sql = '')
- {
- global $auth, $user, $config;
-
- // Set var to retrieve errored status
- $this->sql_error_triggered = true;
- $this->sql_error_sql = $sql;
-
- $this->sql_error_returned = $this->_sql_error();
-
- if (!$this->return_on_error)
- {
- $message = 'SQL ERROR [ ' . $this->sql_layer . ' ]<br /><br />' . $this->sql_error_returned['message'] . ' [' . $this->sql_error_returned['code'] . ']';
-
- // Show complete SQL error and path to administrators only
- // Additionally show complete error on installation or if extended debug mode is enabled
- // The DEBUG_EXTRA constant is for development only!
- if ((isset($auth) && $auth->acl_get('a_')) || defined('IN_INSTALL') || defined('DEBUG_EXTRA'))
- {
- $message .= ($sql) ? '<br /><br />SQL<br /><br />' . htmlspecialchars($sql) : '';
- }
- else
- {
- // If error occurs in initiating the session we need to use a pre-defined language string
- // This could happen if the connection could not be established for example (then we are not able to grab the default language)
- if (!isset($user->lang['SQL_ERROR_OCCURRED']))
- {
- $message .= '<br /><br />An sql error occurred while fetching this page. Please contact an administrator if this problem persists.';
- }
- else
- {
- if (!empty($config['board_contact']))
- {
- $message .= '<br /><br />' . sprintf($user->lang['SQL_ERROR_OCCURRED'], '<a href="mailto:' . htmlspecialchars($config['board_contact']) . '">', '</a>');
- }
- else
- {
- $message .= '<br /><br />' . sprintf($user->lang['SQL_ERROR_OCCURRED'], '', '');
- }
- }
- }
-
- if ($this->transaction)
- {
- $this->sql_transaction('rollback');
- }
-
- if (strlen($message) > 1024)
- {
- // We need to define $msg_long_text here to circumvent text stripping.
- global $msg_long_text;
- $msg_long_text = $message;
-
- trigger_error(false, E_USER_ERROR);
- }
-
- trigger_error($message, E_USER_ERROR);
- }
-
- if ($this->transaction)
- {
- $this->sql_transaction('rollback');
- }
-
- return $this->sql_error_returned;
- }
-
- /**
- * Explain queries
- */
- function sql_report($mode, $query = '')
- {
- global $cache, $starttime, $phpbb_root_path, $user;
-
- if (empty($_REQUEST['explain']))
- {
- return false;
- }
-
- if (!$query && $this->query_hold != '')
- {
- $query = $this->query_hold;
- }
-
- switch ($mode)
- {
- case 'display':
- if (!empty($cache))
- {
- $cache->unload();
- }
- $this->sql_close();
-
- $mtime = explode(' ', microtime());
- $totaltime = $mtime[0] + $mtime[1] - $starttime;
-
- echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml" dir="ltr">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
- <meta http-equiv="Content-Style-Type" content="text/css" />
- <meta http-equiv="imagetoolbar" content="no" />
- <title>SQL Report</title>
- <link href="' . $phpbb_root_path . 'adm/style/admin.css" rel="stylesheet" type="text/css" media="screen" />
- </head>
- <body id="errorpage">
- <div id="wrap">
- <div id="page-header">
- <a href="' . build_url('explain') . '">Return to previous page</a>
- </div>
- <div id="page-body">
- <div id="acp">
- <div class="panel">
- <span class="corners-top"><span></span></span>
- <div id="content">
- <h1>SQL Report</h1>
- <br />
- <p><b>Page generated in ' . round($totaltime, 4) . " seconds with {$this->num_queries['normal']} queries" . (($this->num_queries['cached']) ? " + {$this->num_queries['cached']} " . (($this->num_queries['cached'] == 1) ? 'query' : 'queries') . ' returning data from cache' : '') . '</b></p>
-
- <p>Time spent on ' . $this->sql_layer . ' queries: <b>' . round($this->sql_time, 5) . 's</b> | Time spent on PHP: <b>' . round($totaltime - $this->sql_time, 5) . 's</b></p>
-
- <br /><br />
- ' . $this->sql_report . '
- </div>
- <span class="corners-bottom"><span></span></span>
- </div>
- </div>
- </div>
- <div id="page-footer">
- Powered by <a href="https://www.phpbb.com/">phpBB</a>&reg; Forum Software &copy; phpBB Group
- </div>
- </div>
- </body>
- </html>';
-
- exit_handler();
-
- break;
-
- case 'stop':
- $endtime = explode(' ', microtime());
- $endtime = $endtime[0] + $endtime[1];
-
- $this->sql_report .= '
-
- <table cellspacing="1">
- <thead>
- <tr>
- <th>Query #' . $this->num_queries['total'] . '</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td class="row3"><textarea style="font-family:\'Courier New\',monospace;width:99%" rows="5" cols="10">' . preg_replace('/\t(AND|OR)(\W)/', "\$1\$2", htmlspecialchars(preg_replace('/[\s]*[\n\r\t]+[\n\r\s\t]*/', "\n", $query))) . '</textarea></td>
- </tr>
- </tbody>
- </table>
-
- ' . $this->html_hold . '
-
- <p style="text-align: center;">
- ';
-
- if ($this->query_result)
- {
- if (preg_match('/^(UPDATE|DELETE|REPLACE)/', $query))
- {
- $this->sql_report .= 'Affected rows: <b>' . $this->sql_affectedrows($this->query_result) . '</b> | ';
- }
- $this->sql_report .= 'Before: ' . sprintf('%.5f', $this->curtime - $starttime) . 's | After: ' . sprintf('%.5f', $endtime - $starttime) . 's | Elapsed: <b>' . sprintf('%.5f', $endtime - $this->curtime) . 's</b>';
- }
- else
- {
- $error = $this->sql_error();
- $this->sql_report .= '<b style="color: red">FAILED</b> - ' . $this->sql_layer . ' Error ' . $error['code'] . ': ' . htmlspecialchars($error['message']);
- }
-
- $this->sql_report .= '</p><br /><br />';
-
- $this->sql_time += $endtime - $this->curtime;
- break;
-
- case 'start':
- $this->query_hold = $query;
- $this->html_hold = '';
-
- $this->_sql_report($mode, $query);
-
- $this->curtime = explode(' ', microtime());
- $this->curtime = $this->curtime[0] + $this->curtime[1];
-
- break;
-
- case 'add_select_row':
-
- $html_table = func_get_arg(2);
- $row = func_get_arg(3);
-
- if (!$html_table && sizeof($row))
- {
- $html_table = true;
- $this->html_hold .= '<table cellspacing="1"><tr>';
-
- foreach (array_keys($row) as $val)
- {
- $this->html_hold .= '<th>' . (($val) ? ucwords(str_replace('_', ' ', $val)) : '&nbsp;') . '</th>';
- }
- $this->html_hold .= '</tr>';
- }
- $this->html_hold .= '<tr>';
-
- $class = 'row1';
- foreach (array_values($row) as $val)
- {
- $class = ($class == 'row1') ? 'row2' : 'row1';
- $this->html_hold .= '<td class="' . $class . '">' . (($val) ? $val : '&nbsp;') . '</td>';
- }
- $this->html_hold .= '</tr>';
-
- return $html_table;
-
- break;
-
- case 'fromcache':
-
- $this->_sql_report($mode, $query);
-
- break;
-
- case 'record_fromcache':
-
- $endtime = func_get_arg(2);
- $splittime = func_get_arg(3);
-
- $time_cache = $endtime - $this->curtime;
- $time_db = $splittime - $endtime;
- $color = ($time_db > $time_cache) ? 'green' : 'red';
-
- $this->sql_report .= '<table cellspacing="1"><thead><tr><th>Query results obtained from the cache</th></tr></thead><tbody><tr>';
- $this->sql_report .= '<td class="row3"><textarea style="font-family:\'Courier New\',monospace;width:99%" rows="5" cols="10">' . preg_replace('/\t(AND|OR)(\W)/', "\$1\$2", htmlspecialchars(preg_replace('/[\s]*[\n\r\t]+[\n\r\s\t]*/', "\n", $query))) . '</textarea></td></tr></tbody></table>';
- $this->sql_report .= '<p style="text-align: center;">';
- $this->sql_report .= 'Before: ' . sprintf('%.5f', $this->curtime - $starttime) . 's | After: ' . sprintf('%.5f', $endtime - $starttime) . 's | Elapsed [cache]: <b style="color: ' . $color . '">' . sprintf('%.5f', ($time_cache)) . 's</b> | Elapsed [db]: <b>' . sprintf('%.5f', $time_db) . 's</b></p><br /><br />';
-
- // Pad the start time to not interfere with page timing
- $starttime += $time_db;
-
- break;
-
- default:
-
- $this->_sql_report($mode, $query);
-
- break;
- }
-
- return true;
- }
-
- /**
- * Gets the estimated number of rows in a specified table.
- *
- * @param string $table_name Table name
- *
- * @return string Number of rows in $table_name.
- * Prefixed with ~ if estimated (otherwise exact).
- *
- * @access public
- */
- function get_estimated_row_count($table_name)
- {
- return $this->get_row_count($table_name);
- }
-
- /**
- * Gets the exact number of rows in a specified table.
- *
- * @param string $table_name Table name
- *
- * @return string Exact number of rows in $table_name.
- *
- * @access public
- */
- function get_row_count($table_name)
- {
- $sql = 'SELECT COUNT(*) AS rows_total
- FROM ' . $this->sql_escape($table_name);
- $result = $this->sql_query($sql);
- $rows_total = $this->sql_fetchfield('rows_total');
- $this->sql_freeresult($result);
-
- return $rows_total;
- }
-}
-
-/**
-* This variable holds the class name to use later
-*/
-$sql_db = (!empty($dbms)) ? 'dbal_' . basename($dbms) : 'dbal';
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/db/firebird.php b/phpBB/includes/db/firebird.php
deleted file mode 100644
index 7072c58ac0..0000000000
--- a/phpBB/includes/db/firebird.php
+++ /dev/null
@@ -1,526 +0,0 @@
-<?php
-/**
-*
-* @package dbal
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
-*
-*/
-
-/**
-* @ignore
-*/
-if (!defined('IN_PHPBB'))
-{
- exit;
-}
-
-include_once($phpbb_root_path . 'includes/db/dbal.' . $phpEx);
-
-/**
-* Firebird/Interbase Database Abstraction Layer
-* Minimum Requirement is Firebird 2.1
-* @package dbal
-*/
-class dbal_firebird extends dbal
-{
- var $last_query_text = '';
- var $service_handle = false;
- var $affected_rows = 0;
- var $connect_error = '';
-
- /**
- * Connect to server
- */
- function sql_connect($sqlserver, $sqluser, $sqlpassword, $database, $port = false, $persistency = false, $new_link = false)
- {
- $this->persistency = $persistency;
- $this->user = $sqluser;
- $this->server = $sqlserver . (($port) ? ':' . $port : '');
- $this->dbname = str_replace('\\', '/', $database);
-
- // There are three possibilities to connect to an interbase db
- if (!$this->server)
- {
- $use_database = $this->dbname;
- }
- else if (strpos($this->server, '//') === 0)
- {
- $use_database = $this->server . $this->dbname;
- }
- else
- {
- $use_database = $this->server . ':' . $this->dbname;
- }
-
- if ($this->persistency)
- {
- if (!function_exists('ibase_pconnect'))
- {
- $this->connect_error = 'ibase_pconnect function does not exist, is interbase extension installed?';
- return $this->sql_error('');
- }
- $this->db_connect_id = @ibase_pconnect($use_database, $this->user, $sqlpassword, false, false, 3);
- }
- else
- {
- if (!function_exists('ibase_connect'))
- {
- $this->connect_error = 'ibase_connect function does not exist, is interbase extension installed?';
- return $this->sql_error('');
- }
- $this->db_connect_id = @ibase_connect($use_database, $this->user, $sqlpassword, false, false, 3);
- }
-
- // Do not call ibase_service_attach if connection failed,
- // otherwise error message from ibase_(p)connect call will be clobbered.
- if ($this->db_connect_id && function_exists('ibase_service_attach') && $this->server)
- {
- $this->service_handle = @ibase_service_attach($this->server, $this->user, $sqlpassword);
- }
- else
- {
- $this->service_handle = false;
- }
-
- return ($this->db_connect_id) ? $this->db_connect_id : $this->sql_error('');
- }
-
- /**
- * Version information about used database
- * @param bool $raw if true, only return the fetched sql_server_version
- * @param bool $use_cache forced to false for Interbase
- * @return string sql server version
- */
- function sql_server_info($raw = false, $use_cache = true)
- {
- /**
- * force $use_cache false. I didn't research why the caching code there is no caching code
- * but I assume its because the IB extension provides a direct method to access it
- * without a query.
- */
-
- $use_cache = false;
-
- if ($this->service_handle !== false && function_exists('ibase_server_info'))
- {
- return @ibase_server_info($this->service_handle, IBASE_SVC_SERVER_VERSION);
- }
-
- return ($raw) ? '2.1' : 'Firebird/Interbase';
- }
-
- /**
- * SQL Transaction
- * @access private
- */
- function _sql_transaction($status = 'begin')
- {
- switch ($status)
- {
- case 'begin':
- return true;
- break;
-
- case 'commit':
- return @ibase_commit();
- break;
-
- case 'rollback':
- return @ibase_rollback();
- break;
- }
-
- return true;
- }
-
- /**
- * Base query method
- *
- * @param string $query Contains the SQL query which shall be executed
- * @param int $cache_ttl Either 0 to avoid caching or the time in seconds which the result shall be kept in cache
- * @return mixed When casted to bool the returned value returns true on success and false on failure
- *
- * @access public
- */
- function sql_query($query = '', $cache_ttl = 0)
- {
- if ($query != '')
- {
- global $cache;
-
- // EXPLAIN only in extra debug mode
- if (defined('DEBUG_EXTRA'))
- {
- $this->sql_report('start', $query);
- }
-
- $this->last_query_text = $query;
- $this->query_result = ($cache_ttl && method_exists($cache, 'sql_load')) ? $cache->sql_load($query) : false;
- $this->sql_add_num_queries($this->query_result);
-
- if ($this->query_result === false)
- {
- $array = array();
- // We overcome Firebird's 32767 char limit by binding vars
- if (strlen($query) > 32767)
- {
- if (preg_match('/^(INSERT INTO[^(]++)\\(([^()]+)\\) VALUES[^(]++\\((.*?)\\)$/s', $query, $regs))
- {
- if (strlen($regs[3]) > 32767)
- {
- preg_match_all('/\'(?:[^\']++|\'\')*+\'|[\d-.]+/', $regs[3], $vals, PREG_PATTERN_ORDER);
-
- $inserts = $vals[0];
- unset($vals);
-
- foreach ($inserts as $key => $value)
- {
- if (!empty($value) && $value[0] === "'" && strlen($value) > 32769) // check to see if this thing is greater than the max + 'x2
- {
- $inserts[$key] = '?';
- $array[] = str_replace("''", "'", substr($value, 1, -1));
- }
- }
-
- $query = $regs[1] . '(' . $regs[2] . ') VALUES (' . implode(', ', $inserts) . ')';
- }
- }
- else if (preg_match('/^(UPDATE ([\\w_]++)\\s+SET )([\\w_]++\\s*=\\s*(?:\'(?:[^\']++|\'\')*+\'|\\d+)(?:,\\s*[\\w_]++\\s*=\\s*(?:\'(?:[^\']++|\'\')*+\'|[\d-.]+))*+)\\s+(WHERE.*)$/s', $query, $data))
- {
- if (strlen($data[3]) > 32767)
- {
- $update = $data[1];
- $where = $data[4];
- preg_match_all('/(\\w++)\\s*=\\s*(\'(?:[^\']++|\'\')*+\'|[\d-.]++)/', $data[3], $temp, PREG_SET_ORDER);
- unset($data);
-
- $cols = array();
- foreach ($temp as $value)
- {
- if (!empty($value[2]) && $value[2][0] === "'" && strlen($value[2]) > 32769) // check to see if this thing is greater than the max + 'x2
- {
- $array[] = str_replace("''", "'", substr($value[2], 1, -1));
- $cols[] = $value[1] . '=?';
- }
- else
- {
- $cols[] = $value[1] . '=' . $value[2];
- }
- }
-
- $query = $update . implode(', ', $cols) . ' ' . $where;
- unset($cols);
- }
- }
- }
-
- if (!function_exists('ibase_affected_rows') && (preg_match('/^UPDATE ([\w_]++)\s+SET [\w_]++\s*=\s*(?:\'(?:[^\']++|\'\')*+\'|[\d-.]+)(?:,\s*[\w_]++\s*=\s*(?:\'(?:[^\']++|\'\')*+\'|[\d-.]+))*+\s+(WHERE.*)?$/s', $query, $regs) || preg_match('/^DELETE FROM ([\w_]++)\s*(WHERE\s*.*)?$/s', $query, $regs)))
- {
- $affected_sql = 'SELECT COUNT(*) as num_rows_affected FROM ' . $regs[1];
- if (!empty($regs[2]))
- {
- $affected_sql .= ' ' . $regs[2];
- }
-
- if (!($temp_q_id = @ibase_query($this->db_connect_id, $affected_sql)))
- {
- return false;
- }
-
- $temp_result = @ibase_fetch_assoc($temp_q_id);
- @ibase_free_result($temp_q_id);
-
- $this->affected_rows = ($temp_result) ? $temp_result['NUM_ROWS_AFFECTED'] : false;
- }
-
- if (sizeof($array))
- {
- $p_query = @ibase_prepare($this->db_connect_id, $query);
- array_unshift($array, $p_query);
- $this->query_result = call_user_func_array('ibase_execute', $array);
- unset($array);
-
- if ($this->query_result === false)
- {
- $this->sql_error($query);
- }
- }
- else if (($this->query_result = @ibase_query($this->db_connect_id, $query)) === false)
- {
- $this->sql_error($query);
- }
-
- if (defined('DEBUG_EXTRA'))
- {
- $this->sql_report('stop', $query);
- }
-
- if (!$this->transaction)
- {
- if (function_exists('ibase_commit_ret'))
- {
- @ibase_commit_ret();
- }
- else
- {
- // way cooler than ibase_commit_ret :D
- @ibase_query('COMMIT RETAIN;');
- }
- }
-
- if ($cache_ttl && method_exists($cache, 'sql_save'))
- {
- $this->open_queries[(int) $this->query_result] = $this->query_result;
- $cache->sql_save($query, $this->query_result, $cache_ttl);
- }
- else if (strpos($query, 'SELECT') === 0 && $this->query_result)
- {
- $this->open_queries[(int) $this->query_result] = $this->query_result;
- }
- }
- else if (defined('DEBUG_EXTRA'))
- {
- $this->sql_report('fromcache', $query);
- }
- }
- else
- {
- return false;
- }
-
- return $this->query_result;
- }
-
- /**
- * Build LIMIT query
- */
- function _sql_query_limit($query, $total, $offset = 0, $cache_ttl = 0)
- {
- $this->query_result = false;
-
- $query = 'SELECT FIRST ' . $total . ((!empty($offset)) ? ' SKIP ' . $offset : '') . substr($query, 6);
-
- return $this->sql_query($query, $cache_ttl);
- }
-
- /**
- * Return number of affected rows
- */
- function sql_affectedrows()
- {
- // PHP 5+ function
- if (function_exists('ibase_affected_rows'))
- {
- return ($this->db_connect_id) ? @ibase_affected_rows($this->db_connect_id) : false;
- }
- else
- {
- return $this->affected_rows;
- }
- }
-
- /**
- * Fetch current row
- */
- function sql_fetchrow($query_id = false)
- {
- global $cache;
-
- if ($query_id === false)
- {
- $query_id = $this->query_result;
- }
-
- if (isset($cache->sql_rowset[$query_id]))
- {
- return $cache->sql_fetchrow($query_id);
- }
-
- if ($query_id === false)
- {
- return false;
- }
-
- $row = array();
- $cur_row = @ibase_fetch_object($query_id, IBASE_TEXT);
-
- if (!$cur_row)
- {
- return false;
- }
-
- foreach (get_object_vars($cur_row) as $key => $value)
- {
- $row[strtolower($key)] = (is_string($value)) ? trim(str_replace(array("\\0", "\\n"), array("\0", "\n"), $value)) : $value;
- }
-
- return (sizeof($row)) ? $row : false;
- }
-
- /**
- * Get last inserted id after insert statement
- */
- function sql_nextid()
- {
- $query_id = $this->query_result;
-
- if ($query_id !== false && $this->last_query_text != '')
- {
- if ($this->query_result && preg_match('#^INSERT[\t\n ]+INTO[\t\n ]+([a-z0-9\_\-]+)#i', $this->last_query_text, $tablename))
- {
- $sql = 'SELECT GEN_ID(' . $tablename[1] . '_gen, 0) AS new_id FROM RDB$DATABASE';
-
- if (!($temp_q_id = @ibase_query($this->db_connect_id, $sql)))
- {
- return false;
- }
-
- $temp_result = @ibase_fetch_assoc($temp_q_id);
- @ibase_free_result($temp_q_id);
-
- return ($temp_result) ? $temp_result['NEW_ID'] : false;
- }
- }
-
- return false;
- }
-
- /**
- * Free sql result
- */
- function sql_freeresult($query_id = false)
- {
- global $cache;
-
- if ($query_id === false)
- {
- $query_id = $this->query_result;
- }
-
- if (isset($cache->sql_rowset[$query_id]))
- {
- return $cache->sql_freeresult($query_id);
- }
-
- if (isset($this->open_queries[(int) $query_id]))
- {
- unset($this->open_queries[(int) $query_id]);
- return @ibase_free_result($query_id);
- }
-
- return false;
- }
-
- /**
- * Escape string used in sql query
- */
- function sql_escape($msg)
- {
- return str_replace(array("'", "\0"), array("''", ''), $msg);
- }
-
- /**
- * Build LIKE expression
- * @access private
- */
- function _sql_like_expression($expression)
- {
- return $expression . " ESCAPE '\\'";
- }
-
- /**
- * Build db-specific query data
- * @access private
- */
- function _sql_custom_build($stage, $data)
- {
- return $data;
- }
-
- function _sql_bit_and($column_name, $bit, $compare = '')
- {
- return 'BIN_AND(' . $column_name . ', ' . (1 << $bit) . ')' . (($compare) ? ' ' . $compare : '');
- }
-
- function _sql_bit_or($column_name, $bit, $compare = '')
- {
- return 'BIN_OR(' . $column_name . ', ' . (1 << $bit) . ')' . (($compare) ? ' ' . $compare : '');
- }
-
- /**
- * return sql error array
- * @access private
- */
- function _sql_error()
- {
- // Need special handling here because ibase_errmsg returns
- // connection errors, however if the interbase extension
- // is not installed then ibase_errmsg does not exist and
- // we cannot call it.
- if (function_exists('ibase_errmsg'))
- {
- $msg = @ibase_errmsg();
- if (!$msg)
- {
- $msg = $this->connect_error;
- }
- }
- else
- {
- $msg = $this->connect_error;
- }
- return array(
- 'message' => $msg,
- 'code' => (@function_exists('ibase_errcode') ? @ibase_errcode() : '')
- );
- }
-
- /**
- * Close sql connection
- * @access private
- */
- function _sql_close()
- {
- if ($this->service_handle !== false)
- {
- @ibase_service_detach($this->service_handle);
- }
-
- return @ibase_close($this->db_connect_id);
- }
-
- /**
- * Build db-specific report
- * @access private
- */
- function _sql_report($mode, $query = '')
- {
- switch ($mode)
- {
- case 'start':
- break;
-
- case 'fromcache':
- $endtime = explode(' ', microtime());
- $endtime = $endtime[0] + $endtime[1];
-
- $result = @ibase_query($this->db_connect_id, $query);
- while ($void = @ibase_fetch_object($result, IBASE_TEXT))
- {
- // Take the time spent on parsing rows into account
- }
- @ibase_free_result($result);
-
- $splittime = explode(' ', microtime());
- $splittime = $splittime[0] + $splittime[1];
-
- $this->sql_report('record_fromcache', $query, $endtime, $splittime);
-
- break;
- }
- }
-}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/db/mssql.php b/phpBB/includes/db/mssql.php
deleted file mode 100644
index 2dd95c2508..0000000000
--- a/phpBB/includes/db/mssql.php
+++ /dev/null
@@ -1,476 +0,0 @@
-<?php
-/**
-*
-* @package dbal
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
-*
-*/
-
-/**
-* @ignore
-*/
-if (!defined('IN_PHPBB'))
-{
- exit;
-}
-
-include_once($phpbb_root_path . 'includes/db/dbal.' . $phpEx);
-
-/**
-* MSSQL Database Abstraction Layer
-* Minimum Requirement is MSSQL 2000+
-* @package dbal
-*/
-class dbal_mssql extends dbal
-{
- var $connect_error = '';
-
- /**
- * Connect to server
- */
- function sql_connect($sqlserver, $sqluser, $sqlpassword, $database, $port = false, $persistency = false, $new_link = false)
- {
- if (!function_exists('mssql_connect'))
- {
- $this->connect_error = 'mssql_connect function does not exist, is mssql extension installed?';
- return $this->sql_error('');
- }
-
- $this->persistency = $persistency;
- $this->user = $sqluser;
- $this->dbname = $database;
-
- $port_delimiter = (defined('PHP_OS') && substr(PHP_OS, 0, 3) === 'WIN') ? ',' : ':';
- $this->server = $sqlserver . (($port) ? $port_delimiter . $port : '');
-
- @ini_set('mssql.charset', 'UTF-8');
- @ini_set('mssql.textlimit', 2147483647);
- @ini_set('mssql.textsize', 2147483647);
-
- if (version_compare(PHP_VERSION, '5.1.0', '>=') || (version_compare(PHP_VERSION, '5.0.0-dev', '<=') && version_compare(PHP_VERSION, '4.4.1', '>=')))
- {
- $this->db_connect_id = ($this->persistency) ? @mssql_pconnect($this->server, $this->user, $sqlpassword, $new_link) : @mssql_connect($this->server, $this->user, $sqlpassword, $new_link);
- }
- else
- {
- $this->db_connect_id = ($this->persistency) ? @mssql_pconnect($this->server, $this->user, $sqlpassword) : @mssql_connect($this->server, $this->user, $sqlpassword);
- }
-
- if ($this->db_connect_id && $this->dbname != '')
- {
- if (!@mssql_select_db($this->dbname, $this->db_connect_id))
- {
- @mssql_close($this->db_connect_id);
- return false;
- }
- }
-
- return ($this->db_connect_id) ? $this->db_connect_id : $this->sql_error('');
- }
-
- /**
- * Version information about used database
- * @param bool $raw if true, only return the fetched sql_server_version
- * @param bool $use_cache If true, it is safe to retrieve the value from the cache
- * @return string sql server version
- */
- function sql_server_info($raw = false, $use_cache = true)
- {
- global $cache;
-
- if (!$use_cache || empty($cache) || ($this->sql_server_version = $cache->get('mssql_version')) === false)
- {
- $result_id = @mssql_query("SELECT SERVERPROPERTY('productversion'), SERVERPROPERTY('productlevel'), SERVERPROPERTY('edition')", $this->db_connect_id);
-
- $row = false;
- if ($result_id)
- {
- $row = @mssql_fetch_assoc($result_id);
- @mssql_free_result($result_id);
- }
-
- $this->sql_server_version = ($row) ? trim(implode(' ', $row)) : 0;
-
- if (!empty($cache) && $use_cache)
- {
- $cache->put('mssql_version', $this->sql_server_version);
- }
- }
-
- if ($raw)
- {
- return $this->sql_server_version;
- }
-
- return ($this->sql_server_version) ? 'MSSQL<br />' . $this->sql_server_version : 'MSSQL';
- }
-
- /**
- * SQL Transaction
- * @access private
- */
- function _sql_transaction($status = 'begin')
- {
- switch ($status)
- {
- case 'begin':
- return @mssql_query('BEGIN TRANSACTION', $this->db_connect_id);
- break;
-
- case 'commit':
- return @mssql_query('COMMIT TRANSACTION', $this->db_connect_id);
- break;
-
- case 'rollback':
- return @mssql_query('ROLLBACK TRANSACTION', $this->db_connect_id);
- break;
- }
-
- return true;
- }
-
- /**
- * Base query method
- *
- * @param string $query Contains the SQL query which shall be executed
- * @param int $cache_ttl Either 0 to avoid caching or the time in seconds which the result shall be kept in cache
- * @return mixed When casted to bool the returned value returns true on success and false on failure
- *
- * @access public
- */
- function sql_query($query = '', $cache_ttl = 0)
- {
- if ($query != '')
- {
- global $cache;
-
- // EXPLAIN only in extra debug mode
- if (defined('DEBUG_EXTRA'))
- {
- $this->sql_report('start', $query);
- }
-
- $this->query_result = ($cache_ttl && method_exists($cache, 'sql_load')) ? $cache->sql_load($query) : false;
- $this->sql_add_num_queries($this->query_result);
-
- if ($this->query_result === false)
- {
- if (($this->query_result = @mssql_query($query, $this->db_connect_id)) === false)
- {
- $this->sql_error($query);
- }
-
- if (defined('DEBUG_EXTRA'))
- {
- $this->sql_report('stop', $query);
- }
-
- if ($cache_ttl && method_exists($cache, 'sql_save'))
- {
- $this->open_queries[(int) $this->query_result] = $this->query_result;
- $cache->sql_save($query, $this->query_result, $cache_ttl);
- }
- else if (strpos($query, 'SELECT') === 0 && $this->query_result)
- {
- $this->open_queries[(int) $this->query_result] = $this->query_result;
- }
- }
- else if (defined('DEBUG_EXTRA'))
- {
- $this->sql_report('fromcache', $query);
- }
- }
- else
- {
- return false;
- }
-
- return $this->query_result;
- }
-
- /**
- * Build LIMIT query
- */
- function _sql_query_limit($query, $total, $offset = 0, $cache_ttl = 0)
- {
- $this->query_result = false;
-
- // Since TOP is only returning a set number of rows we won't need it if total is set to 0 (return all rows)
- if ($total)
- {
- // We need to grab the total number of rows + the offset number of rows to get the correct result
- if (strpos($query, 'SELECT DISTINCT') === 0)
- {
- $query = 'SELECT DISTINCT TOP ' . ($total + $offset) . ' ' . substr($query, 15);
- }
- else
- {
- $query = 'SELECT TOP ' . ($total + $offset) . ' ' . substr($query, 6);
- }
- }
-
- $result = $this->sql_query($query, $cache_ttl);
-
- // Seek by $offset rows
- if ($offset)
- {
- $this->sql_rowseek($offset, $result);
- }
-
- return $result;
- }
-
- /**
- * Return number of affected rows
- */
- function sql_affectedrows()
- {
- return ($this->db_connect_id) ? @mssql_rows_affected($this->db_connect_id) : false;
- }
-
- /**
- * Fetch current row
- */
- function sql_fetchrow($query_id = false)
- {
- global $cache;
-
- if ($query_id === false)
- {
- $query_id = $this->query_result;
- }
-
- if (isset($cache->sql_rowset[$query_id]))
- {
- return $cache->sql_fetchrow($query_id);
- }
-
- if ($query_id === false)
- {
- return false;
- }
-
- $row = @mssql_fetch_assoc($query_id);
-
- // I hope i am able to remove this later... hopefully only a PHP or MSSQL bug
- if ($row)
- {
- foreach ($row as $key => $value)
- {
- $row[$key] = ($value === ' ' || $value === NULL) ? '' : $value;
- }
- }
-
- return $row;
- }
-
- /**
- * Seek to given row number
- * rownum is zero-based
- */
- function sql_rowseek($rownum, &$query_id)
- {
- global $cache;
-
- if ($query_id === false)
- {
- $query_id = $this->query_result;
- }
-
- if (isset($cache->sql_rowset[$query_id]))
- {
- return $cache->sql_rowseek($rownum, $query_id);
- }
-
- return ($query_id !== false) ? @mssql_data_seek($query_id, $rownum) : false;
- }
-
- /**
- * Get last inserted id after insert statement
- */
- function sql_nextid()
- {
- $result_id = @mssql_query('SELECT SCOPE_IDENTITY()', $this->db_connect_id);
- if ($result_id)
- {
- if ($row = @mssql_fetch_assoc($result_id))
- {
- @mssql_free_result($result_id);
- return $row['computed'];
- }
- @mssql_free_result($result_id);
- }
-
- return false;
- }
-
- /**
- * Free sql result
- */
- function sql_freeresult($query_id = false)
- {
- global $cache;
-
- if ($query_id === false)
- {
- $query_id = $this->query_result;
- }
-
- if (isset($cache->sql_rowset[$query_id]))
- {
- return $cache->sql_freeresult($query_id);
- }
-
- if (isset($this->open_queries[$query_id]))
- {
- unset($this->open_queries[$query_id]);
- return @mssql_free_result($query_id);
- }
-
- return false;
- }
-
- /**
- * Escape string used in sql query
- */
- function sql_escape($msg)
- {
- return str_replace(array("'", "\0"), array("''", ''), $msg);
- }
-
- /**
- * {@inheritDoc}
- */
- function sql_lower_text($column_name)
- {
- return "LOWER(SUBSTRING($column_name, 1, DATALENGTH($column_name)))";
- }
-
- /**
- * Build LIKE expression
- * @access private
- */
- function _sql_like_expression($expression)
- {
- return $expression . " ESCAPE '\\'";
- }
-
- /**
- * return sql error array
- * @access private
- */
- function _sql_error()
- {
- if (function_exists('mssql_get_last_message'))
- {
- $error = array(
- 'message' => @mssql_get_last_message(),
- 'code' => '',
- );
-
- // Get error code number
- $result_id = @mssql_query('SELECT @@ERROR as code', $this->db_connect_id);
- if ($result_id)
- {
- $row = @mssql_fetch_assoc($result_id);
- $error['code'] = $row['code'];
- @mssql_free_result($result_id);
- }
-
- // Get full error message if possible
- $sql = 'SELECT CAST(description as varchar(255)) as message
- FROM master.dbo.sysmessages
- WHERE error = ' . $error['code'];
- $result_id = @mssql_query($sql);
-
- if ($result_id)
- {
- $row = @mssql_fetch_assoc($result_id);
- if (!empty($row['message']))
- {
- $error['message'] .= '<br />' . $row['message'];
- }
- @mssql_free_result($result_id);
- }
- }
- else
- {
- $error = array(
- 'message' => $this->connect_error,
- 'code' => '',
- );
- }
-
- return $error;
- }
-
- /**
- * Build db-specific query data
- * @access private
- */
- function _sql_custom_build($stage, $data)
- {
- return $data;
- }
-
- /**
- * Close sql connection
- * @access private
- */
- function _sql_close()
- {
- return @mssql_close($this->db_connect_id);
- }
-
- /**
- * Build db-specific report
- * @access private
- */
- function _sql_report($mode, $query = '')
- {
- switch ($mode)
- {
- case 'start':
- $html_table = false;
- @mssql_query('SET SHOWPLAN_TEXT ON;', $this->db_connect_id);
- if ($result = @mssql_query($query, $this->db_connect_id))
- {
- @mssql_next_result($result);
- while ($row = @mssql_fetch_row($result))
- {
- $html_table = $this->sql_report('add_select_row', $query, $html_table, $row);
- }
- }
- @mssql_query('SET SHOWPLAN_TEXT OFF;', $this->db_connect_id);
- @mssql_free_result($result);
-
- if ($html_table)
- {
- $this->html_hold .= '</table>';
- }
- break;
-
- case 'fromcache':
- $endtime = explode(' ', microtime());
- $endtime = $endtime[0] + $endtime[1];
-
- $result = @mssql_query($query, $this->db_connect_id);
- while ($void = @mssql_fetch_assoc($result))
- {
- // Take the time spent on parsing rows into account
- }
- @mssql_free_result($result);
-
- $splittime = explode(' ', microtime());
- $splittime = $splittime[0] + $splittime[1];
-
- $this->sql_report('record_fromcache', $query, $endtime, $splittime);
-
- break;
- }
- }
-}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/db/mssql_odbc.php b/phpBB/includes/db/mssql_odbc.php
deleted file mode 100644
index 04501cce8b..0000000000
--- a/phpBB/includes/db/mssql_odbc.php
+++ /dev/null
@@ -1,422 +0,0 @@
-<?php
-/**
-*
-* @package dbal
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
-*
-*/
-
-/**
-* @ignore
-*/
-if (!defined('IN_PHPBB'))
-{
- exit;
-}
-
-include_once($phpbb_root_path . 'includes/db/dbal.' . $phpEx);
-
-/**
-* Unified ODBC functions
-* Unified ODBC functions support any database having ODBC driver, for example Adabas D, IBM DB2, iODBC, Solid, Sybase SQL Anywhere...
-* Here we only support MSSQL Server 2000+ because of the provided schema
-*
-* @note number of bytes returned for returning data depends on odbc.defaultlrl php.ini setting.
-* If it is limited to 4K for example only 4K of data is returned max, resulting in incomplete theme data for example.
-* @note odbc.defaultbinmode may affect UTF8 characters
-*
-* @package dbal
-*/
-class dbal_mssql_odbc extends dbal
-{
- var $last_query_text = '';
- var $connect_error = '';
-
- /**
- * Connect to server
- */
- function sql_connect($sqlserver, $sqluser, $sqlpassword, $database, $port = false, $persistency = false, $new_link = false)
- {
- $this->persistency = $persistency;
- $this->user = $sqluser;
- $this->dbname = $database;
-
- $port_delimiter = (defined('PHP_OS') && substr(PHP_OS, 0, 3) === 'WIN') ? ',' : ':';
- $this->server = $sqlserver . (($port) ? $port_delimiter . $port : '');
-
- $max_size = @ini_get('odbc.defaultlrl');
- if (!empty($max_size))
- {
- $unit = strtolower(substr($max_size, -1, 1));
- $max_size = (int) $max_size;
-
- if ($unit == 'k')
- {
- $max_size = floor($max_size / 1024);
- }
- else if ($unit == 'g')
- {
- $max_size *= 1024;
- }
- else if (is_numeric($unit))
- {
- $max_size = floor((int) ($max_size . $unit) / 1048576);
- }
- $max_size = max(8, $max_size) . 'M';
-
- @ini_set('odbc.defaultlrl', $max_size);
- }
-
- if ($this->persistency)
- {
- if (!function_exists('odbc_pconnect'))
- {
- $this->connect_error = 'odbc_pconnect function does not exist, is odbc extension installed?';
- return $this->sql_error('');
- }
- $this->db_connect_id = @odbc_pconnect($this->server, $this->user, $sqlpassword);
- }
- else
- {
- if (!function_exists('odbc_connect'))
- {
- $this->connect_error = 'odbc_connect function does not exist, is odbc extension installed?';
- return $this->sql_error('');
- }
- $this->db_connect_id = @odbc_connect($this->server, $this->user, $sqlpassword);
- }
-
- return ($this->db_connect_id) ? $this->db_connect_id : $this->sql_error('');
- }
-
- /**
- * Version information about used database
- * @param bool $raw if true, only return the fetched sql_server_version
- * @param bool $use_cache If true, it is safe to retrieve the value from the cache
- * @return string sql server version
- */
- function sql_server_info($raw = false, $use_cache = true)
- {
- global $cache;
-
- if (!$use_cache || empty($cache) || ($this->sql_server_version = $cache->get('mssqlodbc_version')) === false)
- {
- $result_id = @odbc_exec($this->db_connect_id, "SELECT SERVERPROPERTY('productversion'), SERVERPROPERTY('productlevel'), SERVERPROPERTY('edition')");
-
- $row = false;
- if ($result_id)
- {
- $row = @odbc_fetch_array($result_id);
- @odbc_free_result($result_id);
- }
-
- $this->sql_server_version = ($row) ? trim(implode(' ', $row)) : 0;
-
- if (!empty($cache) && $use_cache)
- {
- $cache->put('mssqlodbc_version', $this->sql_server_version);
- }
- }
-
- if ($raw)
- {
- return $this->sql_server_version;
- }
-
- return ($this->sql_server_version) ? 'MSSQL (ODBC)<br />' . $this->sql_server_version : 'MSSQL (ODBC)';
- }
-
- /**
- * SQL Transaction
- * @access private
- */
- function _sql_transaction($status = 'begin')
- {
- switch ($status)
- {
- case 'begin':
- return @odbc_exec($this->db_connect_id, 'BEGIN TRANSACTION');
- break;
-
- case 'commit':
- return @odbc_exec($this->db_connect_id, 'COMMIT TRANSACTION');
- break;
-
- case 'rollback':
- return @odbc_exec($this->db_connect_id, 'ROLLBACK TRANSACTION');
- break;
- }
-
- return true;
- }
-
- /**
- * Base query method
- *
- * @param string $query Contains the SQL query which shall be executed
- * @param int $cache_ttl Either 0 to avoid caching or the time in seconds which the result shall be kept in cache
- * @return mixed When casted to bool the returned value returns true on success and false on failure
- *
- * @access public
- */
- function sql_query($query = '', $cache_ttl = 0)
- {
- if ($query != '')
- {
- global $cache;
-
- // EXPLAIN only in extra debug mode
- if (defined('DEBUG_EXTRA'))
- {
- $this->sql_report('start', $query);
- }
-
- $this->last_query_text = $query;
- $this->query_result = ($cache_ttl && method_exists($cache, 'sql_load')) ? $cache->sql_load($query) : false;
- $this->sql_add_num_queries($this->query_result);
-
- if ($this->query_result === false)
- {
- if (($this->query_result = @odbc_exec($this->db_connect_id, $query)) === false)
- {
- $this->sql_error($query);
- }
-
- if (defined('DEBUG_EXTRA'))
- {
- $this->sql_report('stop', $query);
- }
-
- if ($cache_ttl && method_exists($cache, 'sql_save'))
- {
- $this->open_queries[(int) $this->query_result] = $this->query_result;
- $cache->sql_save($query, $this->query_result, $cache_ttl);
- }
- else if (strpos($query, 'SELECT') === 0 && $this->query_result)
- {
- $this->open_queries[(int) $this->query_result] = $this->query_result;
- }
- }
- else if (defined('DEBUG_EXTRA'))
- {
- $this->sql_report('fromcache', $query);
- }
- }
- else
- {
- return false;
- }
-
- return $this->query_result;
- }
-
- /**
- * Build LIMIT query
- */
- function _sql_query_limit($query, $total, $offset = 0, $cache_ttl = 0)
- {
- $this->query_result = false;
-
- // Since TOP is only returning a set number of rows we won't need it if total is set to 0 (return all rows)
- if ($total)
- {
- // We need to grab the total number of rows + the offset number of rows to get the correct result
- if (strpos($query, 'SELECT DISTINCT') === 0)
- {
- $query = 'SELECT DISTINCT TOP ' . ($total + $offset) . ' ' . substr($query, 15);
- }
- else
- {
- $query = 'SELECT TOP ' . ($total + $offset) . ' ' . substr($query, 6);
- }
- }
-
- $result = $this->sql_query($query, $cache_ttl);
-
- // Seek by $offset rows
- if ($offset)
- {
- $this->sql_rowseek($offset, $result);
- }
-
- return $result;
- }
-
- /**
- * Return number of affected rows
- */
- function sql_affectedrows()
- {
- return ($this->db_connect_id) ? @odbc_num_rows($this->query_result) : false;
- }
-
- /**
- * Fetch current row
- * @note number of bytes returned depends on odbc.defaultlrl php.ini setting. If it is limited to 4K for example only 4K of data is returned max.
- */
- function sql_fetchrow($query_id = false, $debug = false)
- {
- global $cache;
-
- if ($query_id === false)
- {
- $query_id = $this->query_result;
- }
-
- if (isset($cache->sql_rowset[$query_id]))
- {
- return $cache->sql_fetchrow($query_id);
- }
-
- return ($query_id !== false) ? @odbc_fetch_array($query_id) : false;
- }
-
- /**
- * Get last inserted id after insert statement
- */
- function sql_nextid()
- {
- $result_id = @odbc_exec($this->db_connect_id, 'SELECT @@IDENTITY');
-
- if ($result_id)
- {
- if (@odbc_fetch_array($result_id))
- {
- $id = @odbc_result($result_id, 1);
- @odbc_free_result($result_id);
- return $id;
- }
- @odbc_free_result($result_id);
- }
-
- return false;
- }
-
- /**
- * Free sql result
- */
- function sql_freeresult($query_id = false)
- {
- global $cache;
-
- if ($query_id === false)
- {
- $query_id = $this->query_result;
- }
-
- if (isset($cache->sql_rowset[$query_id]))
- {
- return $cache->sql_freeresult($query_id);
- }
-
- if (isset($this->open_queries[(int) $query_id]))
- {
- unset($this->open_queries[(int) $query_id]);
- return @odbc_free_result($query_id);
- }
-
- return false;
- }
-
- /**
- * Escape string used in sql query
- */
- function sql_escape($msg)
- {
- return str_replace(array("'", "\0"), array("''", ''), $msg);
- }
-
- /**
- * {@inheritDoc}
- */
- function sql_lower_text($column_name)
- {
- return "LOWER(SUBSTRING($column_name, 1, DATALENGTH($column_name)))";
- }
-
- /**
- * Build LIKE expression
- * @access private
- */
- function _sql_like_expression($expression)
- {
- return $expression . " ESCAPE '\\'";
- }
-
- /**
- * Build db-specific query data
- * @access private
- */
- function _sql_custom_build($stage, $data)
- {
- return $data;
- }
-
- /**
- * return sql error array
- * @access private
- */
- function _sql_error()
- {
- if (function_exists('odbc_errormsg'))
- {
- $error = array(
- 'message' => @odbc_errormsg(),
- 'code' => @odbc_error(),
- );
- }
- else
- {
- $error = array(
- 'message' => $this->connect_error,
- 'code' => '',
- );
- }
-
- return $error;
- }
-
- /**
- * Close sql connection
- * @access private
- */
- function _sql_close()
- {
- return @odbc_close($this->db_connect_id);
- }
-
- /**
- * Build db-specific report
- * @access private
- */
- function _sql_report($mode, $query = '')
- {
- switch ($mode)
- {
- case 'start':
- break;
-
- case 'fromcache':
- $endtime = explode(' ', microtime());
- $endtime = $endtime[0] + $endtime[1];
-
- $result = @odbc_exec($this->db_connect_id, $query);
- while ($void = @odbc_fetch_array($result))
- {
- // Take the time spent on parsing rows into account
- }
- @odbc_free_result($result);
-
- $splittime = explode(' ', microtime());
- $splittime = $splittime[0] + $splittime[1];
-
- $this->sql_report('record_fromcache', $query, $endtime, $splittime);
-
- break;
- }
- }
-}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/db/mssqlnative.php b/phpBB/includes/db/mssqlnative.php
deleted file mode 100644
index b91372ac61..0000000000
--- a/phpBB/includes/db/mssqlnative.php
+++ /dev/null
@@ -1,652 +0,0 @@
-<?php
-/**
-*
-* @package dbal
-* @version $Id$
-* @copyright (c) 2010 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
-*
-* This is the MS SQL Server Native database abstraction layer.
-* PHP mssql native driver required.
-* @author Chris Pucci
-*
-*/
-
-/**
-* @ignore
-*/
-if (!defined('IN_PHPBB'))
-{
- exit;
-}
-
-include_once($phpbb_root_path . 'includes/db/dbal.' . $phpEx);
-
-/**
- * Prior to version 1.1 the SQL Server Native PHP driver didn't support sqlsrv_num_rows, or cursor based seeking so we recall all rows into an array
- * and maintain our own cursor index into that array.
- */
-class result_mssqlnative
-{
- public function result_mssqlnative($queryresult = false)
- {
- $this->m_cursor = 0;
- $this->m_rows = array();
- $this->m_num_fields = sqlsrv_num_fields($queryresult);
- $this->m_field_meta = sqlsrv_field_metadata($queryresult);
-
- while ($row = sqlsrv_fetch_array($queryresult, SQLSRV_FETCH_ASSOC))
- {
- if ($row !== null)
- {
- foreach($row as $k => $v)
- {
- if (is_object($v) && method_exists($v, 'format'))
- {
- $row[$k] = $v->format("Y-m-d\TH:i:s\Z");
- }
- }
- $this->m_rows[] = $row;//read results into memory, cursors are not supported
- }
- }
-
- $this->m_row_count = sizeof($this->m_rows);
- }
-
- private function array_to_obj($array, &$obj)
- {
- foreach ($array as $key => $value)
- {
- if (is_array($value))
- {
- $obj->$key = new stdClass();
- array_to_obj($value, $obj->$key);
- }
- else
- {
- $obj->$key = $value;
- }
- }
- return $obj;
- }
-
- public function fetch($mode = SQLSRV_FETCH_BOTH, $object_class = 'stdClass')
- {
- if ($this->m_cursor >= $this->m_row_count || $this->m_row_count == 0)
- {
- return false;
- }
-
- $ret = false;
- $arr_num = array();
-
- if ($mode == SQLSRV_FETCH_NUMERIC || $mode == SQLSRV_FETCH_BOTH)
- {
- foreach($this->m_rows[$this->m_cursor] as $key => $value)
- {
- $arr_num[] = $value;
- }
- }
-
- switch ($mode)
- {
- case SQLSRV_FETCH_ASSOC:
- $ret = $this->m_rows[$this->m_cursor];
- break;
- case SQLSRV_FETCH_NUMERIC:
- $ret = $arr_num;
- break;
- case 'OBJECT':
- $ret = $this->array_to_obj($this->m_rows[$this->m_cursor], $o = new $object_class);
- break;
- case SQLSRV_FETCH_BOTH:
- default:
- $ret = $this->m_rows[$this->m_cursor] + $arr_num;
- break;
- }
- $this->m_cursor++;
- return $ret;
- }
-
- public function get($pos, $fld)
- {
- return $this->m_rows[$pos][$fld];
- }
-
- public function num_rows()
- {
- return $this->m_row_count;
- }
-
- public function seek($iRow)
- {
- $this->m_cursor = min($iRow, $this->m_row_count);
- }
-
- public function num_fields()
- {
- return $this->m_num_fields;
- }
-
- public function field_name($nr)
- {
- $arr_keys = array_keys($this->m_rows[0]);
- return $arr_keys[$nr];
- }
-
- public function field_type($nr)
- {
- $i = 0;
- $int_type = -1;
- $str_type = '';
-
- foreach ($this->m_field_meta as $meta)
- {
- if ($nr == $i)
- {
- $int_type = $meta['Type'];
- break;
- }
- $i++;
- }
-
- //http://msdn.microsoft.com/en-us/library/cc296183.aspx contains type table
- switch ($int_type)
- {
- case SQLSRV_SQLTYPE_BIGINT: $str_type = 'bigint'; break;
- case SQLSRV_SQLTYPE_BINARY: $str_type = 'binary'; break;
- case SQLSRV_SQLTYPE_BIT: $str_type = 'bit'; break;
- case SQLSRV_SQLTYPE_CHAR: $str_type = 'char'; break;
- case SQLSRV_SQLTYPE_DATETIME: $str_type = 'datetime'; break;
- case SQLSRV_SQLTYPE_DECIMAL/*($precision, $scale)*/: $str_type = 'decimal'; break;
- case SQLSRV_SQLTYPE_FLOAT: $str_type = 'float'; break;
- case SQLSRV_SQLTYPE_IMAGE: $str_type = 'image'; break;
- case SQLSRV_SQLTYPE_INT: $str_type = 'int'; break;
- case SQLSRV_SQLTYPE_MONEY: $str_type = 'money'; break;
- case SQLSRV_SQLTYPE_NCHAR/*($charCount)*/: $str_type = 'nchar'; break;
- case SQLSRV_SQLTYPE_NUMERIC/*($precision, $scale)*/: $str_type = 'numeric'; break;
- case SQLSRV_SQLTYPE_NVARCHAR/*($charCount)*/: $str_type = 'nvarchar'; break;
- case SQLSRV_SQLTYPE_NTEXT: $str_type = 'ntext'; break;
- case SQLSRV_SQLTYPE_REAL: $str_type = 'real'; break;
- case SQLSRV_SQLTYPE_SMALLDATETIME: $str_type = 'smalldatetime'; break;
- case SQLSRV_SQLTYPE_SMALLINT: $str_type = 'smallint'; break;
- case SQLSRV_SQLTYPE_SMALLMONEY: $str_type = 'smallmoney'; break;
- case SQLSRV_SQLTYPE_TEXT: $str_type = 'text'; break;
- case SQLSRV_SQLTYPE_TIMESTAMP: $str_type = 'timestamp'; break;
- case SQLSRV_SQLTYPE_TINYINT: $str_type = 'tinyint'; break;
- case SQLSRV_SQLTYPE_UNIQUEIDENTIFIER: $str_type = 'uniqueidentifier'; break;
- case SQLSRV_SQLTYPE_UDT: $str_type = 'UDT'; break;
- case SQLSRV_SQLTYPE_VARBINARY/*($byteCount)*/: $str_type = 'varbinary'; break;
- case SQLSRV_SQLTYPE_VARCHAR/*($charCount)*/: $str_type = 'varchar'; break;
- case SQLSRV_SQLTYPE_XML: $str_type = 'xml'; break;
- default: $str_type = $int_type;
- }
- return $str_type;
- }
-
- public function free()
- {
- unset($this->m_rows);
- return;
- }
-}
-
-/**
-* @package dbal
-*/
-class dbal_mssqlnative extends dbal
-{
- var $m_insert_id = NULL;
- var $last_query_text = '';
- var $query_options = array();
- var $connect_error = '';
-
- /**
- * Connect to server
- */
- function sql_connect($sqlserver, $sqluser, $sqlpassword, $database, $port = false, $persistency = false, $new_link = false)
- {
- // Test for driver support, to avoid suppressed fatal error
- if (!function_exists('sqlsrv_connect'))
- {
- $this->connect_error = 'Native MS SQL Server driver for PHP is missing or needs to be updated. Version 1.1 or later is required to install phpBB3. You can download the driver from: http://www.microsoft.com/sqlserver/2005/en/us/PHP-Driver.aspx';
- return $this->sql_error('');
- }
-
- //set up connection variables
- $this->persistency = $persistency;
- $this->user = $sqluser;
- $this->dbname = $database;
- $port_delimiter = (defined('PHP_OS') && substr(PHP_OS, 0, 3) === 'WIN') ? ',' : ':';
- $this->server = $sqlserver . (($port) ? $port_delimiter . $port : '');
-
- //connect to database
- $this->db_connect_id = sqlsrv_connect($this->server, array(
- 'Database' => $this->dbname,
- 'UID' => $this->user,
- 'PWD' => $sqlpassword
- ));
-
- return ($this->db_connect_id) ? $this->db_connect_id : $this->sql_error('');
- }
-
- /**
- * Version information about used database
- * @param bool $raw if true, only return the fetched sql_server_version
- * @param bool $use_cache If true, it is safe to retrieve the value from the cache
- * @return string sql server version
- */
- function sql_server_info($raw = false, $use_cache = true)
- {
- global $cache;
-
- if (!$use_cache || empty($cache) || ($this->sql_server_version = $cache->get('mssql_version')) === false)
- {
- $arr_server_info = sqlsrv_server_info($this->db_connect_id);
- $this->sql_server_version = $arr_server_info['SQLServerVersion'];
-
- if (!empty($cache) && $use_cache)
- {
- $cache->put('mssql_version', $this->sql_server_version);
- }
- }
-
- if ($raw)
- {
- return $this->sql_server_version;
- }
-
- return ($this->sql_server_version) ? 'MSSQL<br />' . $this->sql_server_version : 'MSSQL';
- }
-
- /**
- * {@inheritDoc}
- */
- function sql_buffer_nested_transactions()
- {
- return true;
- }
-
- /**
- * SQL Transaction
- * @access private
- */
- function _sql_transaction($status = 'begin')
- {
- switch ($status)
- {
- case 'begin':
- return sqlsrv_begin_transaction($this->db_connect_id);
- break;
-
- case 'commit':
- return sqlsrv_commit($this->db_connect_id);
- break;
-
- case 'rollback':
- return sqlsrv_rollback($this->db_connect_id);
- break;
- }
- return true;
- }
-
- /**
- * Base query method
- *
- * @param string $query Contains the SQL query which shall be executed
- * @param int $cache_ttl Either 0 to avoid caching or the time in seconds which the result shall be kept in cache
- * @return mixed When casted to bool the returned value returns true on success and false on failure
- *
- * @access public
- */
- function sql_query($query = '', $cache_ttl = 0)
- {
- if ($query != '')
- {
- global $cache;
-
- // EXPLAIN only in extra debug mode
- if (defined('DEBUG_EXTRA'))
- {
- $this->sql_report('start', $query);
- }
-
- $this->last_query_text = $query;
- $this->query_result = ($cache_ttl && method_exists($cache, 'sql_load')) ? $cache->sql_load($query) : false;
- $this->sql_add_num_queries($this->query_result);
-
- if ($this->query_result === false)
- {
- if (($this->query_result = @sqlsrv_query($this->db_connect_id, $query, array(), $this->query_options)) === false)
- {
- $this->sql_error($query);
- }
- // reset options for next query
- $this->query_options = array();
-
- if (defined('DEBUG_EXTRA'))
- {
- $this->sql_report('stop', $query);
- }
-
- if ($cache_ttl && method_exists($cache, 'sql_save'))
- {
- $this->open_queries[(int) $this->query_result] = $this->query_result;
- $cache->sql_save($query, $this->query_result, $cache_ttl);
- }
- else if (strpos($query, 'SELECT') === 0 && $this->query_result)
- {
- $this->open_queries[(int) $this->query_result] = $this->query_result;
- }
- }
- else if (defined('DEBUG_EXTRA'))
- {
- $this->sql_report('fromcache', $query);
- }
- }
- else
- {
- return false;
- }
- return $this->query_result;
- }
-
- /**
- * Build LIMIT query
- */
- function _sql_query_limit($query, $total, $offset = 0, $cache_ttl = 0)
- {
- $this->query_result = false;
-
- // total == 0 means all results - not zero results
- if ($offset == 0 && $total !== 0)
- {
- if (strpos($query, "SELECT") === false)
- {
- $query = "TOP {$total} " . $query;
- }
- else
- {
- $query = preg_replace('/SELECT(\s*DISTINCT)?/Dsi', 'SELECT$1 TOP '.$total, $query);
- }
- }
- else if ($offset > 0)
- {
- $query = preg_replace('/SELECT(\s*DISTINCT)?/Dsi', 'SELECT$1 TOP(10000000) ', $query);
- $query = 'SELECT *
- FROM (SELECT sub2.*, ROW_NUMBER() OVER(ORDER BY sub2.line2) AS line3
- FROM (SELECT 1 AS line2, sub1.* FROM (' . $query . ') AS sub1) as sub2) AS sub3';
-
- if ($total > 0)
- {
- $query .= ' WHERE line3 BETWEEN ' . ($offset+1) . ' AND ' . ($offset + $total);
- }
- else
- {
- $query .= ' WHERE line3 > ' . $offset;
- }
- }
-
- $result = $this->sql_query($query, $cache_ttl);
-
- return $result;
- }
-
- /**
- * Return number of affected rows
- */
- function sql_affectedrows()
- {
- return (!empty($this->query_result)) ? @sqlsrv_rows_affected($this->query_result) : false;
- }
-
- /**
- * Fetch current row
- */
- function sql_fetchrow($query_id = false)
- {
- global $cache;
-
- if ($query_id === false)
- {
- $query_id = $this->query_result;
- }
-
- if (isset($cache->sql_rowset[$query_id]))
- {
- return $cache->sql_fetchrow($query_id);
- }
-
- if ($query_id === false)
- {
- return false;
- }
-
- $row = @sqlsrv_fetch_array($query_id, SQLSRV_FETCH_ASSOC);
-
- if ($row)
- {
- foreach ($row as $key => $value)
- {
- $row[$key] = ($value === ' ' || $value === NULL) ? '' : $value;
- }
-
- // remove helper values from LIMIT queries
- if (isset($row['line2']))
- {
- unset($row['line2'], $row['line3']);
- }
- }
- return (sizeof($row)) ? $row : false;
- }
-
- /**
- * Get last inserted id after insert statement
- */
- function sql_nextid()
- {
- $result_id = @sqlsrv_query($this->db_connect_id, 'SELECT @@IDENTITY');
-
- if ($result_id !== false)
- {
- $row = @sqlsrv_fetch_array($result_id);
- $id = $row[0];
- @sqlsrv_free_stmt($result_id);
- return $id;
- }
- else
- {
- return false;
- }
- }
-
- /**
- * Free sql result
- */
- function sql_freeresult($query_id = false)
- {
- global $cache;
-
- if ($query_id === false)
- {
- $query_id = $this->query_result;
- }
-
- if (isset($cache->sql_rowset[$query_id]))
- {
- return $cache->sql_freeresult($query_id);
- }
-
- if (isset($this->open_queries[$query_id]))
- {
- unset($this->open_queries[$query_id]);
- return @sqlsrv_free_stmt($query_id);
- }
- return false;
- }
-
- /**
- * Escape string used in sql query
- */
- function sql_escape($msg)
- {
- return str_replace(array("'", "\0"), array("''", ''), $msg);
- }
-
- /**
- * {@inheritDoc}
- */
- function sql_lower_text($column_name)
- {
- return "LOWER(SUBSTRING($column_name, 1, DATALENGTH($column_name)))";
- }
-
- /**
- * Build LIKE expression
- * @access private
- */
- function _sql_like_expression($expression)
- {
- return $expression . " ESCAPE '\\'";
- }
-
- /**
- * return sql error array
- * @access private
- */
- function _sql_error()
- {
- if (function_exists('sqlsrv_errors'))
- {
- $errors = @sqlsrv_errors(SQLSRV_ERR_ERRORS);
- $error_message = '';
- $code = 0;
-
- if ($errors != null)
- {
- foreach ($errors as $error)
- {
- $error_message .= "SQLSTATE: " . $error[ 'SQLSTATE'] . "\n";
- $error_message .= "code: " . $error[ 'code'] . "\n";
- $code = $error['code'];
- $error_message .= "message: " . $error[ 'message'] . "\n";
- }
- $this->last_error_result = $error_message;
- $error = $this->last_error_result;
- }
- else
- {
- $error = (isset($this->last_error_result) && $this->last_error_result) ? $this->last_error_result : array();
- }
-
- $error = array(
- 'message' => $error,
- 'code' => $code,
- );
- }
- else
- {
- $error = array(
- 'message' => $this->connect_error,
- 'code' => '',
- );
- }
-
- return $error;
- }
-
- /**
- * Build db-specific query data
- * @access private
- */
- function _sql_custom_build($stage, $data)
- {
- return $data;
- }
-
- /**
- * Close sql connection
- * @access private
- */
- function _sql_close()
- {
- return @sqlsrv_close($this->db_connect_id);
- }
-
- /**
- * Build db-specific report
- * @access private
- */
- function _sql_report($mode, $query = '')
- {
- switch ($mode)
- {
- case 'start':
- $html_table = false;
- @sqlsrv_query($this->db_connect_id, 'SET SHOWPLAN_TEXT ON;');
- if ($result = @sqlsrv_query($this->db_connect_id, $query))
- {
- @sqlsrv_next_result($result);
- while ($row = @sqlsrv_fetch_array($result))
- {
- $html_table = $this->sql_report('add_select_row', $query, $html_table, $row);
- }
- }
- @sqlsrv_query($this->db_connect_id, 'SET SHOWPLAN_TEXT OFF;');
- @sqlsrv_free_stmt($result);
-
- if ($html_table)
- {
- $this->html_hold .= '</table>';
- }
- break;
-
- case 'fromcache':
- $endtime = explode(' ', microtime());
- $endtime = $endtime[0] + $endtime[1];
-
- $result = @sqlsrv_query($this->db_connect_id, $query);
- while ($void = @sqlsrv_fetch_array($result))
- {
- // Take the time spent on parsing rows into account
- }
- @sqlsrv_free_stmt($result);
-
- $splittime = explode(' ', microtime());
- $splittime = $splittime[0] + $splittime[1];
-
- $this->sql_report('record_fromcache', $query, $endtime, $splittime);
-
- break;
- }
- }
-
- /**
- * Utility method used to retrieve number of rows
- * Emulates mysql_num_rows
- * Used in acp_database.php -> write_data_mssqlnative()
- * Requires a static or keyset cursor to be definde via
- * mssqlnative_set_query_options()
- */
- function mssqlnative_num_rows($res)
- {
- if ($res !== false)
- {
- return sqlsrv_num_rows($res);
- }
- else
- {
- return false;
- }
- }
-
- /**
- * Allows setting mssqlnative specific query options passed to sqlsrv_query as 4th parameter.
- */
- function mssqlnative_set_query_options($options)
- {
- $this->query_options = $options;
- }
-}
-
-?>
diff --git a/phpBB/includes/db/mysql.php b/phpBB/includes/db/mysql.php
deleted file mode 100644
index 252cb20bd4..0000000000
--- a/phpBB/includes/db/mysql.php
+++ /dev/null
@@ -1,591 +0,0 @@
-<?php
-/**
-*
-* @package dbal
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
-*
-*/
-
-/**
-* @ignore
-*/
-if (!defined('IN_PHPBB'))
-{
- exit;
-}
-
-include_once($phpbb_root_path . 'includes/db/dbal.' . $phpEx);
-
-/**
-* MySQL4 Database Abstraction Layer
-* Compatible with:
-* MySQL 3.23+
-* MySQL 4.0+
-* MySQL 4.1+
-* MySQL 5.0+
-* @package dbal
-*/
-class dbal_mysql extends dbal
-{
- var $multi_insert = true;
- var $connect_error = '';
-
- /**
- * Connect to server
- * @access public
- */
- function sql_connect($sqlserver, $sqluser, $sqlpassword, $database, $port = false, $persistency = false, $new_link = false)
- {
- $this->persistency = $persistency;
- $this->user = $sqluser;
- $this->server = $sqlserver . (($port) ? ':' . $port : '');
- $this->dbname = $database;
-
- $this->sql_layer = 'mysql4';
-
- if ($this->persistency)
- {
- if (!function_exists('mysql_pconnect'))
- {
- $this->connect_error = 'mysql_pconnect function does not exist, is mysql extension installed?';
- return $this->sql_error('');
- }
- $this->db_connect_id = @mysql_pconnect($this->server, $this->user, $sqlpassword);
- }
- else
- {
- if (!function_exists('mysql_connect'))
- {
- $this->connect_error = 'mysql_connect function does not exist, is mysql extension installed?';
- return $this->sql_error('');
- }
- $this->db_connect_id = @mysql_connect($this->server, $this->user, $sqlpassword, $new_link);
- }
-
- if ($this->db_connect_id && $this->dbname != '')
- {
- if (@mysql_select_db($this->dbname, $this->db_connect_id))
- {
- // Determine what version we are using and if it natively supports UNICODE
- if (version_compare($this->sql_server_info(true), '4.1.0', '>='))
- {
- @mysql_query("SET NAMES 'utf8'", $this->db_connect_id);
-
- // enforce strict mode on databases that support it
- if (version_compare($this->sql_server_info(true), '5.0.2', '>='))
- {
- $result = @mysql_query('SELECT @@session.sql_mode AS sql_mode', $this->db_connect_id);
- $row = @mysql_fetch_assoc($result);
- @mysql_free_result($result);
- $modes = array_map('trim', explode(',', $row['sql_mode']));
-
- // TRADITIONAL includes STRICT_ALL_TABLES and STRICT_TRANS_TABLES
- if (!in_array('TRADITIONAL', $modes))
- {
- if (!in_array('STRICT_ALL_TABLES', $modes))
- {
- $modes[] = 'STRICT_ALL_TABLES';
- }
-
- if (!in_array('STRICT_TRANS_TABLES', $modes))
- {
- $modes[] = 'STRICT_TRANS_TABLES';
- }
- }
-
- $mode = implode(',', $modes);
- @mysql_query("SET SESSION sql_mode='{$mode}'", $this->db_connect_id);
- }
- }
- else if (version_compare($this->sql_server_info(true), '4.0.0', '<'))
- {
- $this->sql_layer = 'mysql';
- }
-
- return $this->db_connect_id;
- }
- }
-
- return $this->sql_error('');
- }
-
- /**
- * Version information about used database
- * @param bool $raw if true, only return the fetched sql_server_version
- * @param bool $use_cache If true, it is safe to retrieve the value from the cache
- * @return string sql server version
- */
- function sql_server_info($raw = false, $use_cache = true)
- {
- global $cache;
-
- if (!$use_cache || empty($cache) || ($this->sql_server_version = $cache->get('mysql_version')) === false)
- {
- $result = @mysql_query('SELECT VERSION() AS version', $this->db_connect_id);
- $row = @mysql_fetch_assoc($result);
- @mysql_free_result($result);
-
- $this->sql_server_version = $row['version'];
-
- if (!empty($cache) && $use_cache)
- {
- $cache->put('mysql_version', $this->sql_server_version);
- }
- }
-
- return ($raw) ? $this->sql_server_version : 'MySQL ' . $this->sql_server_version;
- }
-
- /**
- * SQL Transaction
- * @access private
- */
- function _sql_transaction($status = 'begin')
- {
- switch ($status)
- {
- case 'begin':
- return @mysql_query('BEGIN', $this->db_connect_id);
- break;
-
- case 'commit':
- return @mysql_query('COMMIT', $this->db_connect_id);
- break;
-
- case 'rollback':
- return @mysql_query('ROLLBACK', $this->db_connect_id);
- break;
- }
-
- return true;
- }
-
- /**
- * Base query method
- *
- * @param string $query Contains the SQL query which shall be executed
- * @param int $cache_ttl Either 0 to avoid caching or the time in seconds which the result shall be kept in cache
- * @return mixed When casted to bool the returned value returns true on success and false on failure
- *
- * @access public
- */
- function sql_query($query = '', $cache_ttl = 0)
- {
- if ($query != '')
- {
- global $cache;
-
- // EXPLAIN only in extra debug mode
- if (defined('DEBUG_EXTRA'))
- {
- $this->sql_report('start', $query);
- }
-
- $this->query_result = ($cache_ttl && method_exists($cache, 'sql_load')) ? $cache->sql_load($query) : false;
- $this->sql_add_num_queries($this->query_result);
-
- if ($this->query_result === false)
- {
- if (($this->query_result = @mysql_query($query, $this->db_connect_id)) === false)
- {
- $this->sql_error($query);
- }
-
- if (defined('DEBUG_EXTRA'))
- {
- $this->sql_report('stop', $query);
- }
-
- if ($cache_ttl && method_exists($cache, 'sql_save'))
- {
- $this->open_queries[(int) $this->query_result] = $this->query_result;
- $cache->sql_save($query, $this->query_result, $cache_ttl);
- }
- else if (strpos($query, 'SELECT') === 0 && $this->query_result)
- {
- $this->open_queries[(int) $this->query_result] = $this->query_result;
- }
- }
- else if (defined('DEBUG_EXTRA'))
- {
- $this->sql_report('fromcache', $query);
- }
- }
- else
- {
- return false;
- }
-
- return $this->query_result;
- }
-
- /**
- * Build LIMIT query
- */
- function _sql_query_limit($query, $total, $offset = 0, $cache_ttl = 0)
- {
- $this->query_result = false;
-
- // if $total is set to 0 we do not want to limit the number of rows
- if ($total == 0)
- {
- // Having a value of -1 was always a bug
- $total = '18446744073709551615';
- }
-
- $query .= "\n LIMIT " . ((!empty($offset)) ? $offset . ', ' . $total : $total);
-
- return $this->sql_query($query, $cache_ttl);
- }
-
- /**
- * Return number of affected rows
- */
- function sql_affectedrows()
- {
- return ($this->db_connect_id) ? @mysql_affected_rows($this->db_connect_id) : false;
- }
-
- /**
- * Fetch current row
- */
- function sql_fetchrow($query_id = false)
- {
- global $cache;
-
- if ($query_id === false)
- {
- $query_id = $this->query_result;
- }
-
- if (isset($cache->sql_rowset[$query_id]))
- {
- return $cache->sql_fetchrow($query_id);
- }
-
- return ($query_id !== false) ? @mysql_fetch_assoc($query_id) : false;
- }
-
- /**
- * Seek to given row number
- * rownum is zero-based
- */
- function sql_rowseek($rownum, &$query_id)
- {
- global $cache;
-
- if ($query_id === false)
- {
- $query_id = $this->query_result;
- }
-
- if (isset($cache->sql_rowset[$query_id]))
- {
- return $cache->sql_rowseek($rownum, $query_id);
- }
-
- return ($query_id !== false) ? @mysql_data_seek($query_id, $rownum) : false;
- }
-
- /**
- * Get last inserted id after insert statement
- */
- function sql_nextid()
- {
- return ($this->db_connect_id) ? @mysql_insert_id($this->db_connect_id) : false;
- }
-
- /**
- * Free sql result
- */
- function sql_freeresult($query_id = false)
- {
- global $cache;
-
- if ($query_id === false)
- {
- $query_id = $this->query_result;
- }
-
- if (isset($cache->sql_rowset[$query_id]))
- {
- return $cache->sql_freeresult($query_id);
- }
-
- if (isset($this->open_queries[(int) $query_id]))
- {
- unset($this->open_queries[(int) $query_id]);
- return @mysql_free_result($query_id);
- }
-
- return false;
- }
-
- /**
- * Escape string used in sql query
- */
- function sql_escape($msg)
- {
- if (!$this->db_connect_id)
- {
- return @mysql_real_escape_string($msg);
- }
-
- return @mysql_real_escape_string($msg, $this->db_connect_id);
- }
-
- /**
- * Gets the estimated number of rows in a specified table.
- *
- * @param string $table_name Table name
- *
- * @return string Number of rows in $table_name.
- * Prefixed with ~ if estimated (otherwise exact).
- *
- * @access public
- */
- function get_estimated_row_count($table_name)
- {
- $table_status = $this->get_table_status($table_name);
-
- if (isset($table_status['Engine']))
- {
- if ($table_status['Engine'] === 'MyISAM')
- {
- return $table_status['Rows'];
- }
- else if ($table_status['Engine'] === 'InnoDB' && $table_status['Rows'] > 100000)
- {
- return '~' . $table_status['Rows'];
- }
- }
-
- return parent::get_row_count($table_name);
- }
-
- /**
- * Gets the exact number of rows in a specified table.
- *
- * @param string $table_name Table name
- *
- * @return string Exact number of rows in $table_name.
- *
- * @access public
- */
- function get_row_count($table_name)
- {
- $table_status = $this->get_table_status($table_name);
-
- if (isset($table_status['Engine']) && $table_status['Engine'] === 'MyISAM')
- {
- return $table_status['Rows'];
- }
-
- return parent::get_row_count($table_name);
- }
-
- /**
- * Gets some information about the specified table.
- *
- * @param string $table_name Table name
- *
- * @return array
- *
- * @access protected
- */
- function get_table_status($table_name)
- {
- $sql = "SHOW TABLE STATUS
- LIKE '" . $this->sql_escape($table_name) . "'";
- $result = $this->sql_query($sql);
- $table_status = $this->sql_fetchrow($result);
- $this->sql_freeresult($result);
-
- return $table_status;
- }
-
- /**
- * Build LIKE expression
- * @access private
- */
- function _sql_like_expression($expression)
- {
- return $expression;
- }
-
- /**
- * Build db-specific query data
- * @access private
- */
- function _sql_custom_build($stage, $data)
- {
- switch ($stage)
- {
- case 'FROM':
- $data = '(' . $data . ')';
- break;
- }
-
- return $data;
- }
-
- /**
- * return sql error array
- * @access private
- */
- function _sql_error()
- {
- if ($this->db_connect_id)
- {
- $error = array(
- 'message' => @mysql_error($this->db_connect_id),
- 'code' => @mysql_errno($this->db_connect_id),
- );
- }
- else if (function_exists('mysql_error'))
- {
- $error = array(
- 'message' => @mysql_error(),
- 'code' => @mysql_errno(),
- );
- }
- else
- {
- $error = array(
- 'message' => $this->connect_error,
- 'code' => '',
- );
- }
-
- return $error;
- }
-
- /**
- * Close sql connection
- * @access private
- */
- function _sql_close()
- {
- return @mysql_close($this->db_connect_id);
- }
-
- /**
- * Build db-specific report
- * @access private
- */
- function _sql_report($mode, $query = '')
- {
- static $test_prof;
-
- // current detection method, might just switch to see the existance of INFORMATION_SCHEMA.PROFILING
- if ($test_prof === null)
- {
- $test_prof = false;
- if (version_compare($this->sql_server_info(true), '5.0.37', '>=') && version_compare($this->sql_server_info(true), '5.1', '<'))
- {
- $test_prof = true;
- }
- }
-
- switch ($mode)
- {
- case 'start':
-
- $explain_query = $query;
- if (preg_match('/UPDATE ([a-z0-9_]+).*?WHERE(.*)/s', $query, $m))
- {
- $explain_query = 'SELECT * FROM ' . $m[1] . ' WHERE ' . $m[2];
- }
- else if (preg_match('/DELETE FROM ([a-z0-9_]+).*?WHERE(.*)/s', $query, $m))
- {
- $explain_query = 'SELECT * FROM ' . $m[1] . ' WHERE ' . $m[2];
- }
-
- if (preg_match('/^SELECT/', $explain_query))
- {
- $html_table = false;
-
- // begin profiling
- if ($test_prof)
- {
- @mysql_query('SET profiling = 1;', $this->db_connect_id);
- }
-
- if ($result = @mysql_query("EXPLAIN $explain_query", $this->db_connect_id))
- {
- while ($row = @mysql_fetch_assoc($result))
- {
- $html_table = $this->sql_report('add_select_row', $query, $html_table, $row);
- }
- }
- @mysql_free_result($result);
-
- if ($html_table)
- {
- $this->html_hold .= '</table>';
- }
-
- if ($test_prof)
- {
- $html_table = false;
-
- // get the last profile
- if ($result = @mysql_query('SHOW PROFILE ALL;', $this->db_connect_id))
- {
- $this->html_hold .= '<br />';
- while ($row = @mysql_fetch_assoc($result))
- {
- // make <unknown> HTML safe
- if (!empty($row['Source_function']))
- {
- $row['Source_function'] = str_replace(array('<', '>'), array('&lt;', '&gt;'), $row['Source_function']);
- }
-
- // remove unsupported features
- foreach ($row as $key => $val)
- {
- if ($val === null)
- {
- unset($row[$key]);
- }
- }
- $html_table = $this->sql_report('add_select_row', $query, $html_table, $row);
- }
- }
- @mysql_free_result($result);
-
- if ($html_table)
- {
- $this->html_hold .= '</table>';
- }
-
- @mysql_query('SET profiling = 0;', $this->db_connect_id);
- }
- }
-
- break;
-
- case 'fromcache':
- $endtime = explode(' ', microtime());
- $endtime = $endtime[0] + $endtime[1];
-
- $result = @mysql_query($query, $this->db_connect_id);
- while ($void = @mysql_fetch_assoc($result))
- {
- // Take the time spent on parsing rows into account
- }
- @mysql_free_result($result);
-
- $splittime = explode(' ', microtime());
- $splittime = $splittime[0] + $splittime[1];
-
- $this->sql_report('record_fromcache', $query, $endtime, $splittime);
-
- break;
- }
- }
-}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/db/mysqli.php b/phpBB/includes/db/mysqli.php
deleted file mode 100644
index 69f1d26a40..0000000000
--- a/phpBB/includes/db/mysqli.php
+++ /dev/null
@@ -1,581 +0,0 @@
-<?php
-/**
-*
-* @package dbal
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
-*
-*/
-
-/**
-* @ignore
-*/
-if (!defined('IN_PHPBB'))
-{
- exit;
-}
-
-include_once($phpbb_root_path . 'includes/db/dbal.' . $phpEx);
-
-/**
-* MySQLi Database Abstraction Layer
-* mysqli-extension has to be compiled with:
-* MySQL 4.1+ or MySQL 5.0+
-* @package dbal
-*/
-class dbal_mysqli extends dbal
-{
- var $multi_insert = true;
- var $connect_error = '';
-
- /**
- * Connect to server
- */
- function sql_connect($sqlserver, $sqluser, $sqlpassword, $database, $port = false, $persistency = false , $new_link = false)
- {
- if (!function_exists('mysqli_connect'))
- {
- $this->connect_error = 'mysqli_connect function does not exist, is mysqli extension installed?';
- return $this->sql_error('');
- }
-
- // Mysqli extension supports persistent connection since PHP 5.3.0
- $this->persistency = (version_compare(PHP_VERSION, '5.3.0', '>=')) ? $persistency : false;
- $this->user = $sqluser;
-
- // If persistent connection, set dbhost to localhost when empty and prepend it with 'p:' prefix
- $this->server = ($this->persistency) ? 'p:' . (($sqlserver) ? $sqlserver : 'localhost') : $sqlserver;
-
- $this->dbname = $database;
- $port = (!$port) ? NULL : $port;
-
- // If port is set and it is not numeric, most likely mysqli socket is set.
- // Try to map it to the $socket parameter.
- $socket = NULL;
- if ($port)
- {
- if (is_numeric($port))
- {
- $port = (int) $port;
- }
- else
- {
- $socket = $port;
- $port = NULL;
- }
- }
-
- $this->db_connect_id = @mysqli_connect($this->server, $this->user, $sqlpassword, $this->dbname, $port, $socket);
-
- if ($this->db_connect_id && $this->dbname != '')
- {
- @mysqli_query($this->db_connect_id, "SET NAMES 'utf8'");
-
- // enforce strict mode on databases that support it
- if (version_compare($this->sql_server_info(true), '5.0.2', '>='))
- {
- $result = @mysqli_query($this->db_connect_id, 'SELECT @@session.sql_mode AS sql_mode');
- $row = @mysqli_fetch_assoc($result);
- @mysqli_free_result($result);
-
- $modes = array_map('trim', explode(',', $row['sql_mode']));
-
- // TRADITIONAL includes STRICT_ALL_TABLES and STRICT_TRANS_TABLES
- if (!in_array('TRADITIONAL', $modes))
- {
- if (!in_array('STRICT_ALL_TABLES', $modes))
- {
- $modes[] = 'STRICT_ALL_TABLES';
- }
-
- if (!in_array('STRICT_TRANS_TABLES', $modes))
- {
- $modes[] = 'STRICT_TRANS_TABLES';
- }
- }
-
- $mode = implode(',', $modes);
- @mysqli_query($this->db_connect_id, "SET SESSION sql_mode='{$mode}'");
- }
- return $this->db_connect_id;
- }
-
- return $this->sql_error('');
- }
-
- /**
- * Version information about used database
- * @param bool $use_cache If true, it is safe to retrieve the value from the cache
- * @return string sql server version
- */
- function sql_server_info($raw = false, $use_cache = true)
- {
- global $cache;
-
- if (!$use_cache || empty($cache) || ($this->sql_server_version = $cache->get('mysqli_version')) === false)
- {
- $result = @mysqli_query($this->db_connect_id, 'SELECT VERSION() AS version');
- $row = @mysqli_fetch_assoc($result);
- @mysqli_free_result($result);
-
- $this->sql_server_version = $row['version'];
-
- if (!empty($cache) && $use_cache)
- {
- $cache->put('mysqli_version', $this->sql_server_version);
- }
- }
-
- return ($raw) ? $this->sql_server_version : 'MySQL(i) ' . $this->sql_server_version;
- }
-
- /**
- * SQL Transaction
- * @access private
- */
- function _sql_transaction($status = 'begin')
- {
- switch ($status)
- {
- case 'begin':
- return @mysqli_autocommit($this->db_connect_id, false);
- break;
-
- case 'commit':
- $result = @mysqli_commit($this->db_connect_id);
- @mysqli_autocommit($this->db_connect_id, true);
- return $result;
- break;
-
- case 'rollback':
- $result = @mysqli_rollback($this->db_connect_id);
- @mysqli_autocommit($this->db_connect_id, true);
- return $result;
- break;
- }
-
- return true;
- }
-
- /**
- * Base query method
- *
- * @param string $query Contains the SQL query which shall be executed
- * @param int $cache_ttl Either 0 to avoid caching or the time in seconds which the result shall be kept in cache
- * @return mixed When casted to bool the returned value returns true on success and false on failure
- *
- * @access public
- */
- function sql_query($query = '', $cache_ttl = 0)
- {
- if ($query != '')
- {
- global $cache;
-
- // EXPLAIN only in extra debug mode
- if (defined('DEBUG_EXTRA'))
- {
- $this->sql_report('start', $query);
- }
-
- $this->query_result = ($cache_ttl && method_exists($cache, 'sql_load')) ? $cache->sql_load($query) : false;
- $this->sql_add_num_queries($this->query_result);
-
- if ($this->query_result === false)
- {
- if (($this->query_result = @mysqli_query($this->db_connect_id, $query)) === false)
- {
- $this->sql_error($query);
- }
-
- if (defined('DEBUG_EXTRA'))
- {
- $this->sql_report('stop', $query);
- }
-
- if ($cache_ttl && method_exists($cache, 'sql_save'))
- {
- $cache->sql_save($query, $this->query_result, $cache_ttl);
- }
- }
- else if (defined('DEBUG_EXTRA'))
- {
- $this->sql_report('fromcache', $query);
- }
- }
- else
- {
- return false;
- }
-
- return $this->query_result;
- }
-
- /**
- * Build LIMIT query
- */
- function _sql_query_limit($query, $total, $offset = 0, $cache_ttl = 0)
- {
- $this->query_result = false;
-
- // if $total is set to 0 we do not want to limit the number of rows
- if ($total == 0)
- {
- // MySQL 4.1+ no longer supports -1 in limit queries
- $total = '18446744073709551615';
- }
-
- $query .= "\n LIMIT " . ((!empty($offset)) ? $offset . ', ' . $total : $total);
-
- return $this->sql_query($query, $cache_ttl);
- }
-
- /**
- * Return number of affected rows
- */
- function sql_affectedrows()
- {
- return ($this->db_connect_id) ? @mysqli_affected_rows($this->db_connect_id) : false;
- }
-
- /**
- * Fetch current row
- */
- function sql_fetchrow($query_id = false)
- {
- global $cache;
-
- if ($query_id === false)
- {
- $query_id = $this->query_result;
- }
-
- if (!is_object($query_id) && isset($cache->sql_rowset[$query_id]))
- {
- return $cache->sql_fetchrow($query_id);
- }
-
- if ($query_id !== false)
- {
- $result = @mysqli_fetch_assoc($query_id);
- return $result !== null ? $result : false;
- }
-
- return false;
- }
-
- /**
- * Seek to given row number
- * rownum is zero-based
- */
- function sql_rowseek($rownum, &$query_id)
- {
- global $cache;
-
- if ($query_id === false)
- {
- $query_id = $this->query_result;
- }
-
- if (!is_object($query_id) && isset($cache->sql_rowset[$query_id]))
- {
- return $cache->sql_rowseek($rownum, $query_id);
- }
-
- return ($query_id !== false) ? @mysqli_data_seek($query_id, $rownum) : false;
- }
-
- /**
- * Get last inserted id after insert statement
- */
- function sql_nextid()
- {
- return ($this->db_connect_id) ? @mysqli_insert_id($this->db_connect_id) : false;
- }
-
- /**
- * Free sql result
- */
- function sql_freeresult($query_id = false)
- {
- global $cache;
-
- if ($query_id === false)
- {
- $query_id = $this->query_result;
- }
-
- if (!is_object($query_id) && isset($cache->sql_rowset[$query_id]))
- {
- return $cache->sql_freeresult($query_id);
- }
-
- return @mysqli_free_result($query_id);
- }
-
- /**
- * Escape string used in sql query
- */
- function sql_escape($msg)
- {
- return @mysqli_real_escape_string($this->db_connect_id, $msg);
- }
-
- /**
- * Gets the estimated number of rows in a specified table.
- *
- * @param string $table_name Table name
- *
- * @return string Number of rows in $table_name.
- * Prefixed with ~ if estimated (otherwise exact).
- *
- * @access public
- */
- function get_estimated_row_count($table_name)
- {
- $table_status = $this->get_table_status($table_name);
-
- if (isset($table_status['Engine']))
- {
- if ($table_status['Engine'] === 'MyISAM')
- {
- return $table_status['Rows'];
- }
- else if ($table_status['Engine'] === 'InnoDB' && $table_status['Rows'] > 100000)
- {
- return '~' . $table_status['Rows'];
- }
- }
-
- return parent::get_row_count($table_name);
- }
-
- /**
- * Gets the exact number of rows in a specified table.
- *
- * @param string $table_name Table name
- *
- * @return string Exact number of rows in $table_name.
- *
- * @access public
- */
- function get_row_count($table_name)
- {
- $table_status = $this->get_table_status($table_name);
-
- if (isset($table_status['Engine']) && $table_status['Engine'] === 'MyISAM')
- {
- return $table_status['Rows'];
- }
-
- return parent::get_row_count($table_name);
- }
-
- /**
- * Gets some information about the specified table.
- *
- * @param string $table_name Table name
- *
- * @return array
- *
- * @access protected
- */
- function get_table_status($table_name)
- {
- $sql = "SHOW TABLE STATUS
- LIKE '" . $this->sql_escape($table_name) . "'";
- $result = $this->sql_query($sql);
- $table_status = $this->sql_fetchrow($result);
- $this->sql_freeresult($result);
-
- return $table_status;
- }
-
- /**
- * Build LIKE expression
- * @access private
- */
- function _sql_like_expression($expression)
- {
- return $expression;
- }
-
- /**
- * Build db-specific query data
- * @access private
- */
- function _sql_custom_build($stage, $data)
- {
- switch ($stage)
- {
- case 'FROM':
- $data = '(' . $data . ')';
- break;
- }
-
- return $data;
- }
-
- /**
- * return sql error array
- * @access private
- */
- function _sql_error()
- {
- if ($this->db_connect_id)
- {
- $error = array(
- 'message' => @mysqli_error($this->db_connect_id),
- 'code' => @mysqli_errno($this->db_connect_id)
- );
- }
- else if (function_exists('mysqli_connect_error'))
- {
- $error = array(
- 'message' => @mysqli_connect_error(),
- 'code' => @mysqli_connect_errno(),
- );
- }
- else
- {
- $error = array(
- 'message' => $this->connect_error,
- 'code' => '',
- );
- }
-
- return $error;
- }
-
- /**
- * Close sql connection
- * @access private
- */
- function _sql_close()
- {
- return @mysqli_close($this->db_connect_id);
- }
-
- /**
- * Build db-specific report
- * @access private
- */
- function _sql_report($mode, $query = '')
- {
- static $test_prof;
-
- // current detection method, might just switch to see the existance of INFORMATION_SCHEMA.PROFILING
- if ($test_prof === null)
- {
- $test_prof = false;
- if (strpos(mysqli_get_server_info($this->db_connect_id), 'community') !== false)
- {
- $ver = mysqli_get_server_version($this->db_connect_id);
- if ($ver >= 50037 && $ver < 50100)
- {
- $test_prof = true;
- }
- }
- }
-
- switch ($mode)
- {
- case 'start':
-
- $explain_query = $query;
- if (preg_match('/UPDATE ([a-z0-9_]+).*?WHERE(.*)/s', $query, $m))
- {
- $explain_query = 'SELECT * FROM ' . $m[1] . ' WHERE ' . $m[2];
- }
- else if (preg_match('/DELETE FROM ([a-z0-9_]+).*?WHERE(.*)/s', $query, $m))
- {
- $explain_query = 'SELECT * FROM ' . $m[1] . ' WHERE ' . $m[2];
- }
-
- if (preg_match('/^SELECT/', $explain_query))
- {
- $html_table = false;
-
- // begin profiling
- if ($test_prof)
- {
- @mysqli_query($this->db_connect_id, 'SET profiling = 1;');
- }
-
- if ($result = @mysqli_query($this->db_connect_id, "EXPLAIN $explain_query"))
- {
- while ($row = @mysqli_fetch_assoc($result))
- {
- $html_table = $this->sql_report('add_select_row', $query, $html_table, $row);
- }
- }
- @mysqli_free_result($result);
-
- if ($html_table)
- {
- $this->html_hold .= '</table>';
- }
-
- if ($test_prof)
- {
- $html_table = false;
-
- // get the last profile
- if ($result = @mysqli_query($this->db_connect_id, 'SHOW PROFILE ALL;'))
- {
- $this->html_hold .= '<br />';
- while ($row = @mysqli_fetch_assoc($result))
- {
- // make <unknown> HTML safe
- if (!empty($row['Source_function']))
- {
- $row['Source_function'] = str_replace(array('<', '>'), array('&lt;', '&gt;'), $row['Source_function']);
- }
-
- // remove unsupported features
- foreach ($row as $key => $val)
- {
- if ($val === null)
- {
- unset($row[$key]);
- }
- }
- $html_table = $this->sql_report('add_select_row', $query, $html_table, $row);
- }
- }
- @mysqli_free_result($result);
-
- if ($html_table)
- {
- $this->html_hold .= '</table>';
- }
-
- @mysqli_query($this->db_connect_id, 'SET profiling = 0;');
- }
- }
-
- break;
-
- case 'fromcache':
- $endtime = explode(' ', microtime());
- $endtime = $endtime[0] + $endtime[1];
-
- $result = @mysqli_query($this->db_connect_id, $query);
- while ($void = @mysqli_fetch_assoc($result))
- {
- // Take the time spent on parsing rows into account
- }
- @mysqli_free_result($result);
-
- $splittime = explode(' ', microtime());
- $splittime = $splittime[0] + $splittime[1];
-
- $this->sql_report('record_fromcache', $query, $endtime, $splittime);
-
- break;
- }
- }
-}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/db/oracle.php b/phpBB/includes/db/oracle.php
deleted file mode 100644
index 4a7a4ecc8c..0000000000
--- a/phpBB/includes/db/oracle.php
+++ /dev/null
@@ -1,808 +0,0 @@
-<?php
-/**
-*
-* @package dbal
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
-*
-*/
-
-/**
-* @ignore
-*/
-if (!defined('IN_PHPBB'))
-{
- exit;
-}
-
-include_once($phpbb_root_path . 'includes/db/dbal.' . $phpEx);
-
-/**
-* Oracle Database Abstraction Layer
-* @package dbal
-*/
-class dbal_oracle extends dbal
-{
- var $last_query_text = '';
- var $connect_error = '';
-
- /**
- * Connect to server
- */
- function sql_connect($sqlserver, $sqluser, $sqlpassword, $database, $port = false, $persistency = false, $new_link = false)
- {
- $this->persistency = $persistency;
- $this->user = $sqluser;
- $this->server = $sqlserver . (($port) ? ':' . $port : '');
- $this->dbname = $database;
-
- $connect = $database;
-
- // support for "easy connect naming"
- if ($sqlserver !== '' && $sqlserver !== '/')
- {
- if (substr($sqlserver, -1, 1) == '/')
- {
- $sqlserver == substr($sqlserver, 0, -1);
- }
- $connect = $sqlserver . (($port) ? ':' . $port : '') . '/' . $database;
- }
-
- if ($new_link)
- {
- if (!function_exists('ocinlogon'))
- {
- $this->connect_error = 'ocinlogon function does not exist, is oci extension installed?';
- return $this->sql_error('');
- }
- $this->db_connect_id = @ocinlogon($this->user, $sqlpassword, $connect, 'UTF8');
- }
- else if ($this->persistency)
- {
- if (!function_exists('ociplogon'))
- {
- $this->connect_error = 'ociplogon function does not exist, is oci extension installed?';
- return $this->sql_error('');
- }
- $this->db_connect_id = @ociplogon($this->user, $sqlpassword, $connect, 'UTF8');
- }
- else
- {
- if (!function_exists('ocilogon'))
- {
- $this->connect_error = 'ocilogon function does not exist, is oci extension installed?';
- return $this->sql_error('');
- }
- $this->db_connect_id = @ocilogon($this->user, $sqlpassword, $connect, 'UTF8');
- }
-
- return ($this->db_connect_id) ? $this->db_connect_id : $this->sql_error('');
- }
-
- /**
- * Version information about used database
- * @param bool $raw if true, only return the fetched sql_server_version
- * @param bool $use_cache forced to false for Oracle
- * @return string sql server version
- */
- function sql_server_info($raw = false, $use_cache = true)
- {
- /**
- * force $use_cache false. I didn't research why the caching code below is commented out
- * but I assume its because the Oracle extension provides a direct method to access it
- * without a query.
- */
-
- $use_cache = false;
-/*
- global $cache;
-
- if (empty($cache) || ($this->sql_server_version = $cache->get('oracle_version')) === false)
- {
- $result = @ociparse($this->db_connect_id, 'SELECT * FROM v$version WHERE banner LIKE \'Oracle%\'');
- @ociexecute($result, OCI_DEFAULT);
- @ocicommit($this->db_connect_id);
-
- $row = array();
- @ocifetchinto($result, $row, OCI_ASSOC + OCI_RETURN_NULLS);
- @ocifreestatement($result);
- $this->sql_server_version = trim($row['BANNER']);
-
- $cache->put('oracle_version', $this->sql_server_version);
- }
-*/
- $this->sql_server_version = @ociserverversion($this->db_connect_id);
-
- return $this->sql_server_version;
- }
-
- /**
- * SQL Transaction
- * @access private
- */
- function _sql_transaction($status = 'begin')
- {
- switch ($status)
- {
- case 'begin':
- return true;
- break;
-
- case 'commit':
- return @ocicommit($this->db_connect_id);
- break;
-
- case 'rollback':
- return @ocirollback($this->db_connect_id);
- break;
- }
-
- return true;
- }
-
- /**
- * Oracle specific code to handle the fact that it does not compare columns properly
- * @access private
- */
- function _rewrite_col_compare($args)
- {
- if (sizeof($args) == 4)
- {
- if ($args[2] == '=')
- {
- return '(' . $args[0] . ' OR (' . $args[1] . ' is NULL AND ' . $args[3] . ' is NULL))';
- }
- else if ($args[2] == '<>')
- {
- // really just a fancy way of saying foo <> bar or (foo is NULL XOR bar is NULL) but SQL has no XOR :P
- return '(' . $args[0] . ' OR ((' . $args[1] . ' is NULL AND ' . $args[3] . ' is NOT NULL) OR (' . $args[1] . ' is NOT NULL AND ' . $args[3] . ' is NULL)))';
- }
- }
- else
- {
- return $this->_rewrite_where($args[0]);
- }
- }
-
- /**
- * Oracle specific code to handle it's lack of sanity
- * @access private
- */
- function _rewrite_where($where_clause)
- {
- preg_match_all('/\s*(AND|OR)?\s*([\w_.()]++)\s*(?:(=|<[=>]?|>=?|LIKE)\s*((?>\'(?>[^\']++|\'\')*+\'|[\d-.()]+))|((NOT )?IN\s*\((?>\'(?>[^\']++|\'\')*+\',? ?|[\d-.]+,? ?)*+\)))/', $where_clause, $result, PREG_SET_ORDER);
- $out = '';
- foreach ($result as $val)
- {
- if (!isset($val[5]))
- {
- if ($val[4] !== "''")
- {
- $out .= $val[0];
- }
- else
- {
- $out .= ' ' . $val[1] . ' ' . $val[2];
- if ($val[3] == '=')
- {
- $out .= ' is NULL';
- }
- else if ($val[3] == '<>')
- {
- $out .= ' is NOT NULL';
- }
- }
- }
- else
- {
- $in_clause = array();
- $sub_exp = substr($val[5], strpos($val[5], '(') + 1, -1);
- $extra = false;
- preg_match_all('/\'(?>[^\']++|\'\')*+\'|[\d-.]++/', $sub_exp, $sub_vals, PREG_PATTERN_ORDER);
- $i = 0;
- foreach ($sub_vals[0] as $sub_val)
- {
- // two things:
- // 1) This determines if an empty string was in the IN clausing, making us turn it into a NULL comparison
- // 2) This fixes the 1000 list limit that Oracle has (ORA-01795)
- if ($sub_val !== "''")
- {
- $in_clause[(int) $i++/1000][] = $sub_val;
- }
- else
- {
- $extra = true;
- }
- }
- if (!$extra && $i < 1000)
- {
- $out .= $val[0];
- }
- else
- {
- $out .= ' ' . $val[1] . '(';
- $in_array = array();
-
- // constuct each IN() clause
- foreach ($in_clause as $in_values)
- {
- $in_array[] = $val[2] . ' ' . (isset($val[6]) ? $val[6] : '') . 'IN(' . implode(', ', $in_values) . ')';
- }
-
- // Join the IN() clauses against a few ORs (IN is just a nicer OR anyway)
- $out .= implode(' OR ', $in_array);
-
- // handle the empty string case
- if ($extra)
- {
- $out .= ' OR ' . $val[2] . ' is ' . (isset($val[6]) ? $val[6] : '') . 'NULL';
- }
- $out .= ')';
-
- unset($in_array, $in_clause);
- }
- }
- }
-
- return $out;
- }
-
- /**
- * Base query method
- *
- * @param string $query Contains the SQL query which shall be executed
- * @param int $cache_ttl Either 0 to avoid caching or the time in seconds which the result shall be kept in cache
- * @return mixed When casted to bool the returned value returns true on success and false on failure
- *
- * @access public
- */
- function sql_query($query = '', $cache_ttl = 0)
- {
- if ($query != '')
- {
- global $cache;
-
- // EXPLAIN only in extra debug mode
- if (defined('DEBUG_EXTRA'))
- {
- $this->sql_report('start', $query);
- }
-
- $this->last_query_text = $query;
- $this->query_result = ($cache_ttl && method_exists($cache, 'sql_load')) ? $cache->sql_load($query) : false;
- $this->sql_add_num_queries($this->query_result);
-
- if ($this->query_result === false)
- {
- $in_transaction = false;
- if (!$this->transaction)
- {
- $this->sql_transaction('begin');
- }
- else
- {
- $in_transaction = true;
- }
-
- $array = array();
-
- // We overcome Oracle's 4000 char limit by binding vars
- if (strlen($query) > 4000)
- {
- if (preg_match('/^(INSERT INTO[^(]++)\\(([^()]+)\\) VALUES[^(]++\\((.*?)\\)$/sU', $query, $regs))
- {
- if (strlen($regs[3]) > 4000)
- {
- $cols = explode(', ', $regs[2]);
-
- preg_match_all('/\'(?:[^\']++|\'\')*+\'|[\d-.]+/', $regs[3], $vals, PREG_PATTERN_ORDER);
-
-/* The code inside this comment block breaks clob handling, but does allow the
- database restore script to work. If you want to allow no posts longer than 4KB
- and/or need the db restore script, uncomment this.
-
-
- if (sizeof($cols) !== sizeof($vals))
- {
- // Try to replace some common data we know is from our restore script or from other sources
- $regs[3] = str_replace("'||chr(47)||'", '/', $regs[3]);
- $_vals = explode(', ', $regs[3]);
-
- $vals = array();
- $is_in_val = false;
- $i = 0;
- $string = '';
-
- foreach ($_vals as $value)
- {
- if (strpos($value, "'") === false && !$is_in_val)
- {
- $vals[$i++] = $value;
- continue;
- }
-
- if (substr($value, -1) === "'")
- {
- $vals[$i] = $string . (($is_in_val) ? ', ' : '') . $value;
- $string = '';
- $is_in_val = false;
-
- if ($vals[$i][0] !== "'")
- {
- $vals[$i] = "''" . $vals[$i];
- }
- $i++;
- continue;
- }
- else
- {
- $string .= (($is_in_val) ? ', ' : '') . $value;
- $is_in_val = true;
- }
- }
-
- if ($string)
- {
- // New value if cols != value
- $vals[(sizeof($cols) !== sizeof($vals)) ? $i : $i - 1] .= $string;
- }
-
- $vals = array(0 => $vals);
- }
-*/
-
- $inserts = $vals[0];
- unset($vals);
-
- foreach ($inserts as $key => $value)
- {
- if (!empty($value) && $value[0] === "'" && strlen($value) > 4002) // check to see if this thing is greater than the max + 'x2
- {
- $inserts[$key] = ':' . strtoupper($cols[$key]);
- $array[$inserts[$key]] = str_replace("''", "'", substr($value, 1, -1));
- }
- }
-
- $query = $regs[1] . '(' . $regs[2] . ') VALUES (' . implode(', ', $inserts) . ')';
- }
- }
- else if (preg_match_all('/^(UPDATE [\\w_]++\\s+SET )([\\w_]++\\s*=\\s*(?:\'(?:[^\']++|\'\')*+\'|[\d-.]+)(?:,\\s*[\\w_]++\\s*=\\s*(?:\'(?:[^\']++|\'\')*+\'|[\d-.]+))*+)\\s+(WHERE.*)$/s', $query, $data, PREG_SET_ORDER))
- {
- if (strlen($data[0][2]) > 4000)
- {
- $update = $data[0][1];
- $where = $data[0][3];
- preg_match_all('/([\\w_]++)\\s*=\\s*(\'(?:[^\']++|\'\')*+\'|[\d-.]++)/', $data[0][2], $temp, PREG_SET_ORDER);
- unset($data);
-
- $cols = array();
- foreach ($temp as $value)
- {
- if (!empty($value[2]) && $value[2][0] === "'" && strlen($value[2]) > 4002) // check to see if this thing is greater than the max + 'x2
- {
- $cols[] = $value[1] . '=:' . strtoupper($value[1]);
- $array[$value[1]] = str_replace("''", "'", substr($value[2], 1, -1));
- }
- else
- {
- $cols[] = $value[1] . '=' . $value[2];
- }
- }
-
- $query = $update . implode(', ', $cols) . ' ' . $where;
- unset($cols);
- }
- }
- }
-
- switch (substr($query, 0, 6))
- {
- case 'DELETE':
- if (preg_match('/^(DELETE FROM [\w_]++ WHERE)((?:\s*(?:AND|OR)?\s*[\w_]+\s*(?:(?:=|<>)\s*(?>\'(?>[^\']++|\'\')*+\'|[\d-.]+)|(?:NOT )?IN\s*\((?>\'(?>[^\']++|\'\')*+\',? ?|[\d-.]+,? ?)*+\)))*+)$/', $query, $regs))
- {
- $query = $regs[1] . $this->_rewrite_where($regs[2]);
- unset($regs);
- }
- break;
-
- case 'UPDATE':
- if (preg_match('/^(UPDATE [\\w_]++\\s+SET [\\w_]+\s*=\s*(?:\'(?:[^\']++|\'\')*+\'|[\d-.]++|:\w++)(?:, [\\w_]+\s*=\s*(?:\'(?:[^\']++|\'\')*+\'|[\d-.]++|:\w++))*+\\s+WHERE)(.*)$/s', $query, $regs))
- {
- $query = $regs[1] . $this->_rewrite_where($regs[2]);
- unset($regs);
- }
- break;
-
- case 'SELECT':
- $query = preg_replace_callback('/([\w_.]++)\s*(?:(=|<>)\s*(?>\'(?>[^\']++|\'\')*+\'|[\d-.]++|([\w_.]++))|(?:NOT )?IN\s*\((?>\'(?>[^\']++|\'\')*+\',? ?|[\d-.]++,? ?)*+\))/', array($this, '_rewrite_col_compare'), $query);
- break;
- }
-
- $this->query_result = @ociparse($this->db_connect_id, $query);
-
- foreach ($array as $key => $value)
- {
- @ocibindbyname($this->query_result, $key, $array[$key], -1);
- }
-
- $success = @ociexecute($this->query_result, OCI_DEFAULT);
-
- if (!$success)
- {
- $this->sql_error($query);
- $this->query_result = false;
- }
- else
- {
- if (!$in_transaction)
- {
- $this->sql_transaction('commit');
- }
- }
-
- if (defined('DEBUG_EXTRA'))
- {
- $this->sql_report('stop', $query);
- }
-
- if ($cache_ttl && method_exists($cache, 'sql_save'))
- {
- $this->open_queries[(int) $this->query_result] = $this->query_result;
- $cache->sql_save($query, $this->query_result, $cache_ttl);
- }
- else if (strpos($query, 'SELECT') === 0 && $this->query_result)
- {
- $this->open_queries[(int) $this->query_result] = $this->query_result;
- }
- }
- else if (defined('DEBUG_EXTRA'))
- {
- $this->sql_report('fromcache', $query);
- }
- }
- else
- {
- return false;
- }
-
- return $this->query_result;
- }
-
- /**
- * Build LIMIT query
- */
- function _sql_query_limit($query, $total, $offset = 0, $cache_ttl = 0)
- {
- $this->query_result = false;
-
- $query = 'SELECT * FROM (SELECT /*+ FIRST_ROWS */ rownum AS xrownum, a.* FROM (' . $query . ') a WHERE rownum <= ' . ($offset + $total) . ') WHERE xrownum >= ' . $offset;
-
- return $this->sql_query($query, $cache_ttl);
- }
-
- /**
- * Return number of affected rows
- */
- function sql_affectedrows()
- {
- return ($this->query_result) ? @ocirowcount($this->query_result) : false;
- }
-
- /**
- * Fetch current row
- */
- function sql_fetchrow($query_id = false)
- {
- global $cache;
-
- if ($query_id === false)
- {
- $query_id = $this->query_result;
- }
-
- if (isset($cache->sql_rowset[$query_id]))
- {
- return $cache->sql_fetchrow($query_id);
- }
-
- if ($query_id !== false)
- {
- $row = array();
- $result = @ocifetchinto($query_id, $row, OCI_ASSOC + OCI_RETURN_NULLS);
-
- if (!$result || !$row)
- {
- return false;
- }
-
- $result_row = array();
- foreach ($row as $key => $value)
- {
- // Oracle treats empty strings as null
- if (is_null($value))
- {
- $value = '';
- }
-
- // OCI->CLOB?
- if (is_object($value))
- {
- $value = $value->load();
- }
-
- $result_row[strtolower($key)] = $value;
- }
-
- return $result_row;
- }
-
- return false;
- }
-
- /**
- * Seek to given row number
- * rownum is zero-based
- */
- function sql_rowseek($rownum, &$query_id)
- {
- global $cache;
-
- if ($query_id === false)
- {
- $query_id = $this->query_result;
- }
-
- if (isset($cache->sql_rowset[$query_id]))
- {
- return $cache->sql_rowseek($rownum, $query_id);
- }
-
- if ($query_id === false)
- {
- return false;
- }
-
- // Reset internal pointer
- @ociexecute($query_id, OCI_DEFAULT);
-
- // We do not fetch the row for rownum == 0 because then the next resultset would be the second row
- for ($i = 0; $i < $rownum; $i++)
- {
- if (!$this->sql_fetchrow($query_id))
- {
- return false;
- }
- }
-
- return true;
- }
-
- /**
- * Get last inserted id after insert statement
- */
- function sql_nextid()
- {
- $query_id = $this->query_result;
-
- if ($query_id !== false && $this->last_query_text != '')
- {
- if (preg_match('#^INSERT[\t\n ]+INTO[\t\n ]+([a-z0-9\_\-]+)#is', $this->last_query_text, $tablename))
- {
- $query = 'SELECT ' . $tablename[1] . '_seq.currval FROM DUAL';
- $stmt = @ociparse($this->db_connect_id, $query);
- @ociexecute($stmt, OCI_DEFAULT);
-
- $temp_result = @ocifetchinto($stmt, $temp_array, OCI_ASSOC + OCI_RETURN_NULLS);
- @ocifreestatement($stmt);
-
- if ($temp_result)
- {
- return $temp_array['CURRVAL'];
- }
- else
- {
- return false;
- }
- }
- }
-
- return false;
- }
-
- /**
- * Free sql result
- */
- function sql_freeresult($query_id = false)
- {
- global $cache;
-
- if ($query_id === false)
- {
- $query_id = $this->query_result;
- }
-
- if (isset($cache->sql_rowset[$query_id]))
- {
- return $cache->sql_freeresult($query_id);
- }
-
- if (isset($this->open_queries[(int) $query_id]))
- {
- unset($this->open_queries[(int) $query_id]);
- return @ocifreestatement($query_id);
- }
-
- return false;
- }
-
- /**
- * Escape string used in sql query
- */
- function sql_escape($msg)
- {
- return str_replace(array("'", "\0"), array("''", ''), $msg);
- }
-
- /**
- * Build LIKE expression
- * @access private
- */
- function _sql_like_expression($expression)
- {
- return $expression . " ESCAPE '\\'";
- }
-
- function _sql_custom_build($stage, $data)
- {
- return $data;
- }
-
- function _sql_bit_and($column_name, $bit, $compare = '')
- {
- return 'BITAND(' . $column_name . ', ' . (1 << $bit) . ')' . (($compare) ? ' ' . $compare : '');
- }
-
- function _sql_bit_or($column_name, $bit, $compare = '')
- {
- return 'BITOR(' . $column_name . ', ' . (1 << $bit) . ')' . (($compare) ? ' ' . $compare : '');
- }
-
- /**
- * return sql error array
- * @access private
- */
- function _sql_error()
- {
- if (function_exists('ocierror'))
- {
- $error = @ocierror();
- $error = (!$error) ? @ocierror($this->query_result) : $error;
- $error = (!$error) ? @ocierror($this->db_connect_id) : $error;
-
- if ($error)
- {
- $this->last_error_result = $error;
- }
- else
- {
- $error = (isset($this->last_error_result) && $this->last_error_result) ? $this->last_error_result : array();
- }
- }
- else
- {
- $error = array(
- 'message' => $this->connect_error,
- 'code' => '',
- );
- }
-
- return $error;
- }
-
- /**
- * Close sql connection
- * @access private
- */
- function _sql_close()
- {
- return @ocilogoff($this->db_connect_id);
- }
-
- /**
- * Build db-specific report
- * @access private
- */
- function _sql_report($mode, $query = '')
- {
- switch ($mode)
- {
- case 'start':
-
- $html_table = false;
-
- // Grab a plan table, any will do
- $sql = "SELECT table_name
- FROM USER_TABLES
- WHERE table_name LIKE '%PLAN_TABLE%'";
- $stmt = ociparse($this->db_connect_id, $sql);
- ociexecute($stmt);
- $result = array();
-
- if (ocifetchinto($stmt, $result, OCI_ASSOC + OCI_RETURN_NULLS))
- {
- $table = $result['TABLE_NAME'];
-
- // This is the statement_id that will allow us to track the plan
- $statement_id = substr(md5($query), 0, 30);
-
- // Remove any stale plans
- $stmt2 = ociparse($this->db_connect_id, "DELETE FROM $table WHERE statement_id='$statement_id'");
- ociexecute($stmt2);
- ocifreestatement($stmt2);
-
- // Explain the plan
- $sql = "EXPLAIN PLAN
- SET STATEMENT_ID = '$statement_id'
- FOR $query";
- $stmt2 = ociparse($this->db_connect_id, $sql);
- ociexecute($stmt2);
- ocifreestatement($stmt2);
-
- // Get the data from the plan
- $sql = "SELECT operation, options, object_name, object_type, cardinality, cost
- FROM plan_table
- START WITH id = 0 AND statement_id = '$statement_id'
- CONNECT BY PRIOR id = parent_id
- AND statement_id = '$statement_id'";
- $stmt2 = ociparse($this->db_connect_id, $sql);
- ociexecute($stmt2);
-
- $row = array();
- while (ocifetchinto($stmt2, $row, OCI_ASSOC + OCI_RETURN_NULLS))
- {
- $html_table = $this->sql_report('add_select_row', $query, $html_table, $row);
- }
-
- ocifreestatement($stmt2);
-
- // Remove the plan we just made, we delete them on request anyway
- $stmt2 = ociparse($this->db_connect_id, "DELETE FROM $table WHERE statement_id='$statement_id'");
- ociexecute($stmt2);
- ocifreestatement($stmt2);
- }
-
- ocifreestatement($stmt);
-
- if ($html_table)
- {
- $this->html_hold .= '</table>';
- }
-
- break;
-
- case 'fromcache':
- $endtime = explode(' ', microtime());
- $endtime = $endtime[0] + $endtime[1];
-
- $result = @ociparse($this->db_connect_id, $query);
- $success = @ociexecute($result, OCI_DEFAULT);
- $row = array();
-
- while (@ocifetchinto($result, $row, OCI_ASSOC + OCI_RETURN_NULLS))
- {
- // Take the time spent on parsing rows into account
- }
- @ocifreestatement($result);
-
- $splittime = explode(' ', microtime());
- $splittime = $splittime[0] + $splittime[1];
-
- $this->sql_report('record_fromcache', $query, $endtime, $splittime);
-
- break;
- }
- }
-}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/db/postgres.php b/phpBB/includes/db/postgres.php
deleted file mode 100644
index bb116e0763..0000000000
--- a/phpBB/includes/db/postgres.php
+++ /dev/null
@@ -1,485 +0,0 @@
-<?php
-/**
-*
-* @package dbal
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
-*
-*/
-
-/**
-* @ignore
-*/
-if (!defined('IN_PHPBB'))
-{
- exit;
-}
-
-include_once($phpbb_root_path . 'includes/db/dbal.' . $phpEx);
-
-if (!class_exists('phpbb_error_collector'))
-{
- include($phpbb_root_path . 'includes/error_collector.' . $phpEx);
-}
-
-/**
-* PostgreSQL Database Abstraction Layer
-* Minimum Requirement is Version 7.3+
-* @package dbal
-*/
-class dbal_postgres extends dbal
-{
- var $last_query_text = '';
- var $connect_error = '';
-
- /**
- * Connect to server
- */
- function sql_connect($sqlserver, $sqluser, $sqlpassword, $database, $port = false, $persistency = false, $new_link = false)
- {
- $connect_string = '';
-
- if ($sqluser)
- {
- $connect_string .= "user=$sqluser ";
- }
-
- if ($sqlpassword)
- {
- $connect_string .= "password=$sqlpassword ";
- }
-
- if ($sqlserver)
- {
- // $sqlserver can carry a port separated by : for compatibility reasons
- // If $sqlserver has more than one : it's probably an IPv6 address.
- // In this case we only allow passing a port via the $port variable.
- if (substr_count($sqlserver, ':') === 1)
- {
- list($sqlserver, $port) = explode(':', $sqlserver);
- }
-
- if ($sqlserver !== 'localhost')
- {
- $connect_string .= "host=$sqlserver ";
- }
-
- if ($port)
- {
- $connect_string .= "port=$port ";
- }
- }
-
- $schema = '';
-
- if ($database)
- {
- $this->dbname = $database;
- if (strpos($database, '.') !== false)
- {
- list($database, $schema) = explode('.', $database);
- }
- $connect_string .= "dbname=$database";
- }
-
- $this->persistency = $persistency;
-
- if ($this->persistency)
- {
- if (!function_exists('pg_pconnect'))
- {
- $this->connect_error = 'pg_pconnect function does not exist, is pgsql extension installed?';
- return $this->sql_error('');
- }
- $collector = new phpbb_error_collector;
- $collector->install();
- $this->db_connect_id = (!$new_link) ? @pg_pconnect($connect_string) : @pg_pconnect($connect_string, PGSQL_CONNECT_FORCE_NEW);
- }
- else
- {
- if (!function_exists('pg_connect'))
- {
- $this->connect_error = 'pg_connect function does not exist, is pgsql extension installed?';
- return $this->sql_error('');
- }
- $collector = new phpbb_error_collector;
- $collector->install();
- $this->db_connect_id = (!$new_link) ? @pg_connect($connect_string) : @pg_connect($connect_string, PGSQL_CONNECT_FORCE_NEW);
- }
-
- $collector->uninstall();
-
- if ($this->db_connect_id)
- {
- if (version_compare($this->sql_server_info(true), '8.2', '>='))
- {
- $this->multi_insert = true;
- }
-
- if ($schema !== '')
- {
- @pg_query($this->db_connect_id, 'SET search_path TO ' . $schema);
- }
- return $this->db_connect_id;
- }
-
- $this->connect_error = $collector->format_errors();
- return $this->sql_error('');
- }
-
- /**
- * Version information about used database
- * @param bool $raw if true, only return the fetched sql_server_version
- * @param bool $use_cache If true, it is safe to retrieve the value from the cache
- * @return string sql server version
- */
- function sql_server_info($raw = false, $use_cache = true)
- {
- global $cache;
-
- if (!$use_cache || empty($cache) || ($this->sql_server_version = $cache->get('pgsql_version')) === false)
- {
- $query_id = @pg_query($this->db_connect_id, 'SELECT VERSION() AS version');
- $row = @pg_fetch_assoc($query_id, null);
- @pg_free_result($query_id);
-
- $this->sql_server_version = (!empty($row['version'])) ? trim(substr($row['version'], 10)) : 0;
-
- if (!empty($cache) && $use_cache)
- {
- $cache->put('pgsql_version', $this->sql_server_version);
- }
- }
-
- return ($raw) ? $this->sql_server_version : 'PostgreSQL ' . $this->sql_server_version;
- }
-
- /**
- * SQL Transaction
- * @access private
- */
- function _sql_transaction($status = 'begin')
- {
- switch ($status)
- {
- case 'begin':
- return @pg_query($this->db_connect_id, 'BEGIN');
- break;
-
- case 'commit':
- return @pg_query($this->db_connect_id, 'COMMIT');
- break;
-
- case 'rollback':
- return @pg_query($this->db_connect_id, 'ROLLBACK');
- break;
- }
-
- return true;
- }
-
- /**
- * Base query method
- *
- * @param string $query Contains the SQL query which shall be executed
- * @param int $cache_ttl Either 0 to avoid caching or the time in seconds which the result shall be kept in cache
- * @return mixed When casted to bool the returned value returns true on success and false on failure
- *
- * @access public
- */
- function sql_query($query = '', $cache_ttl = 0)
- {
- if ($query != '')
- {
- global $cache;
-
- // EXPLAIN only in extra debug mode
- if (defined('DEBUG_EXTRA'))
- {
- $this->sql_report('start', $query);
- }
-
- $this->last_query_text = $query;
- $this->query_result = ($cache_ttl && method_exists($cache, 'sql_load')) ? $cache->sql_load($query) : false;
- $this->sql_add_num_queries($this->query_result);
-
- if ($this->query_result === false)
- {
- if (($this->query_result = @pg_query($this->db_connect_id, $query)) === false)
- {
- $this->sql_error($query);
- }
-
- if (defined('DEBUG_EXTRA'))
- {
- $this->sql_report('stop', $query);
- }
-
- if ($cache_ttl && method_exists($cache, 'sql_save'))
- {
- $this->open_queries[(int) $this->query_result] = $this->query_result;
- $cache->sql_save($query, $this->query_result, $cache_ttl);
- }
- else if (strpos($query, 'SELECT') === 0 && $this->query_result)
- {
- $this->open_queries[(int) $this->query_result] = $this->query_result;
- }
- }
- else if (defined('DEBUG_EXTRA'))
- {
- $this->sql_report('fromcache', $query);
- }
- }
- else
- {
- return false;
- }
-
- return $this->query_result;
- }
-
- /**
- * Build db-specific query data
- * @access private
- */
- function _sql_custom_build($stage, $data)
- {
- return $data;
- }
-
- /**
- * Build LIMIT query
- */
- function _sql_query_limit($query, $total, $offset = 0, $cache_ttl = 0)
- {
- $this->query_result = false;
-
- // if $total is set to 0 we do not want to limit the number of rows
- if ($total == 0)
- {
- $total = 'ALL';
- }
-
- $query .= "\n LIMIT $total OFFSET $offset";
-
- return $this->sql_query($query, $cache_ttl);
- }
-
- /**
- * Return number of affected rows
- */
- function sql_affectedrows()
- {
- return ($this->query_result) ? @pg_affected_rows($this->query_result) : false;
- }
-
- /**
- * Fetch current row
- */
- function sql_fetchrow($query_id = false)
- {
- global $cache;
-
- if ($query_id === false)
- {
- $query_id = $this->query_result;
- }
-
- if (isset($cache->sql_rowset[$query_id]))
- {
- return $cache->sql_fetchrow($query_id);
- }
-
- return ($query_id !== false) ? @pg_fetch_assoc($query_id, null) : false;
- }
-
- /**
- * Seek to given row number
- * rownum is zero-based
- */
- function sql_rowseek($rownum, &$query_id)
- {
- global $cache;
-
- if ($query_id === false)
- {
- $query_id = $this->query_result;
- }
-
- if (isset($cache->sql_rowset[$query_id]))
- {
- return $cache->sql_rowseek($rownum, $query_id);
- }
-
- return ($query_id !== false) ? @pg_result_seek($query_id, $rownum) : false;
- }
-
- /**
- * Get last inserted id after insert statement
- */
- function sql_nextid()
- {
- $query_id = $this->query_result;
-
- if ($query_id !== false && $this->last_query_text != '')
- {
- if (preg_match("/^INSERT[\t\n ]+INTO[\t\n ]+([a-z0-9\_\-]+)/is", $this->last_query_text, $tablename))
- {
- $query = "SELECT currval('" . $tablename[1] . "_seq') AS last_value";
- $temp_q_id = @pg_query($this->db_connect_id, $query);
-
- if (!$temp_q_id)
- {
- return false;
- }
-
- $temp_result = @pg_fetch_assoc($temp_q_id, NULL);
- @pg_free_result($query_id);
-
- return ($temp_result) ? $temp_result['last_value'] : false;
- }
- }
-
- return false;
- }
-
- /**
- * Free sql result
- */
- function sql_freeresult($query_id = false)
- {
- global $cache;
-
- if ($query_id === false)
- {
- $query_id = $this->query_result;
- }
-
- if (isset($cache->sql_rowset[$query_id]))
- {
- return $cache->sql_freeresult($query_id);
- }
-
- if (isset($this->open_queries[(int) $query_id]))
- {
- unset($this->open_queries[(int) $query_id]);
- return @pg_free_result($query_id);
- }
-
- return false;
- }
-
- /**
- * Escape string used in sql query
- * Note: Do not use for bytea values if we may use them at a later stage
- */
- function sql_escape($msg)
- {
- return @pg_escape_string($msg);
- }
-
- /**
- * Build LIKE expression
- * @access private
- */
- function _sql_like_expression($expression)
- {
- return $expression;
- }
-
- /**
- * return sql error array
- * @access private
- */
- function _sql_error()
- {
- // pg_last_error only works when there is an established connection.
- // Connection errors have to be tracked by us manually.
- if ($this->db_connect_id)
- {
- $message = @pg_last_error($this->db_connect_id);
- }
- else
- {
- $message = $this->connect_error;
- }
-
- return array(
- 'message' => $message,
- 'code' => ''
- );
- }
-
- /**
- * Close sql connection
- * @access private
- */
- function _sql_close()
- {
- return @pg_close($this->db_connect_id);
- }
-
- /**
- * Build db-specific report
- * @access private
- */
- function _sql_report($mode, $query = '')
- {
- switch ($mode)
- {
- case 'start':
-
- $explain_query = $query;
- if (preg_match('/UPDATE ([a-z0-9_]+).*?WHERE(.*)/s', $query, $m))
- {
- $explain_query = 'SELECT * FROM ' . $m[1] . ' WHERE ' . $m[2];
- }
- else if (preg_match('/DELETE FROM ([a-z0-9_]+).*?WHERE(.*)/s', $query, $m))
- {
- $explain_query = 'SELECT * FROM ' . $m[1] . ' WHERE ' . $m[2];
- }
-
- if (preg_match('/^SELECT/', $explain_query))
- {
- $html_table = false;
-
- if ($result = @pg_query($this->db_connect_id, "EXPLAIN $explain_query"))
- {
- while ($row = @pg_fetch_assoc($result, NULL))
- {
- $html_table = $this->sql_report('add_select_row', $query, $html_table, $row);
- }
- }
- @pg_free_result($result);
-
- if ($html_table)
- {
- $this->html_hold .= '</table>';
- }
- }
-
- break;
-
- case 'fromcache':
- $endtime = explode(' ', microtime());
- $endtime = $endtime[0] + $endtime[1];
-
- $result = @pg_query($this->db_connect_id, $query);
- while ($void = @pg_fetch_assoc($result, NULL))
- {
- // Take the time spent on parsing rows into account
- }
- @pg_free_result($result);
-
- $splittime = explode(' ', microtime());
- $splittime = $splittime[0] + $splittime[1];
-
- $this->sql_report('record_fromcache', $query, $endtime, $splittime);
-
- break;
- }
- }
-}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/db/sqlite.php b/phpBB/includes/db/sqlite.php
deleted file mode 100644
index 557b057cce..0000000000
--- a/phpBB/includes/db/sqlite.php
+++ /dev/null
@@ -1,370 +0,0 @@
-<?php
-/**
-*
-* @package dbal
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
-*
-*/
-
-/**
-* @ignore
-*/
-if (!defined('IN_PHPBB'))
-{
- exit;
-}
-
-include_once($phpbb_root_path . 'includes/db/dbal.' . $phpEx);
-
-/**
-* Sqlite Database Abstraction Layer
-* Minimum Requirement: 2.8.2+
-* @package dbal
-*/
-class dbal_sqlite extends dbal
-{
- var $connect_error = '';
-
- /**
- * Connect to server
- */
- function sql_connect($sqlserver, $sqluser, $sqlpassword, $database, $port = false, $persistency = false, $new_link = false)
- {
- $this->persistency = $persistency;
- $this->user = $sqluser;
- $this->server = $sqlserver . (($port) ? ':' . $port : '');
- $this->dbname = $database;
-
- $error = '';
- if ($this->persistency)
- {
- if (!function_exists('sqlite_popen'))
- {
- $this->connect_error = 'sqlite_popen function does not exist, is sqlite extension installed?';
- return $this->sql_error('');
- }
- $this->db_connect_id = @sqlite_popen($this->server, 0666, $error);
- }
- else
- {
- if (!function_exists('sqlite_open'))
- {
- $this->connect_error = 'sqlite_open function does not exist, is sqlite extension installed?';
- return $this->sql_error('');
- }
- $this->db_connect_id = @sqlite_open($this->server, 0666, $error);
- }
-
- if ($this->db_connect_id)
- {
- @sqlite_query('PRAGMA short_column_names = 1', $this->db_connect_id);
-// @sqlite_query('PRAGMA encoding = "UTF-8"', $this->db_connect_id);
- }
-
- return ($this->db_connect_id) ? true : array('message' => $error);
- }
-
- /**
- * Version information about used database
- * @param bool $raw if true, only return the fetched sql_server_version
- * @param bool $use_cache if true, it is safe to retrieve the stored value from the cache
- * @return string sql server version
- */
- function sql_server_info($raw = false, $use_cache = true)
- {
- global $cache;
-
- if (!$use_cache || empty($cache) || ($this->sql_server_version = $cache->get('sqlite_version')) === false)
- {
- $result = @sqlite_query('SELECT sqlite_version() AS version', $this->db_connect_id);
- $row = @sqlite_fetch_array($result, SQLITE_ASSOC);
-
- $this->sql_server_version = (!empty($row['version'])) ? $row['version'] : 0;
-
- if (!empty($cache) && $use_cache)
- {
- $cache->put('sqlite_version', $this->sql_server_version);
- }
- }
-
- return ($raw) ? $this->sql_server_version : 'SQLite ' . $this->sql_server_version;
- }
-
- /**
- * SQL Transaction
- * @access private
- */
- function _sql_transaction($status = 'begin')
- {
- switch ($status)
- {
- case 'begin':
- return @sqlite_query('BEGIN', $this->db_connect_id);
- break;
-
- case 'commit':
- return @sqlite_query('COMMIT', $this->db_connect_id);
- break;
-
- case 'rollback':
- return @sqlite_query('ROLLBACK', $this->db_connect_id);
- break;
- }
-
- return true;
- }
-
- /**
- * Base query method
- *
- * @param string $query Contains the SQL query which shall be executed
- * @param int $cache_ttl Either 0 to avoid caching or the time in seconds which the result shall be kept in cache
- * @return mixed When casted to bool the returned value returns true on success and false on failure
- *
- * @access public
- */
- function sql_query($query = '', $cache_ttl = 0)
- {
- if ($query != '')
- {
- global $cache;
-
- // EXPLAIN only in extra debug mode
- if (defined('DEBUG_EXTRA'))
- {
- $this->sql_report('start', $query);
- }
-
- $this->query_result = ($cache_ttl && method_exists($cache, 'sql_load')) ? $cache->sql_load($query) : false;
- $this->sql_add_num_queries($this->query_result);
-
- if ($this->query_result === false)
- {
- if (($this->query_result = @sqlite_query($query, $this->db_connect_id)) === false)
- {
- $this->sql_error($query);
- }
-
- if (defined('DEBUG_EXTRA'))
- {
- $this->sql_report('stop', $query);
- }
-
- if ($cache_ttl && method_exists($cache, 'sql_save'))
- {
- $this->open_queries[(int) $this->query_result] = $this->query_result;
- $cache->sql_save($query, $this->query_result, $cache_ttl);
- }
- else if (strpos($query, 'SELECT') === 0 && $this->query_result)
- {
- $this->open_queries[(int) $this->query_result] = $this->query_result;
- }
- }
- else if (defined('DEBUG_EXTRA'))
- {
- $this->sql_report('fromcache', $query);
- }
- }
- else
- {
- return false;
- }
-
- return $this->query_result;
- }
-
- /**
- * Build LIMIT query
- */
- function _sql_query_limit($query, $total, $offset = 0, $cache_ttl = 0)
- {
- $this->query_result = false;
-
- // if $total is set to 0 we do not want to limit the number of rows
- if ($total == 0)
- {
- $total = -1;
- }
-
- $query .= "\n LIMIT " . ((!empty($offset)) ? $offset . ', ' . $total : $total);
-
- return $this->sql_query($query, $cache_ttl);
- }
-
- /**
- * Return number of affected rows
- */
- function sql_affectedrows()
- {
- return ($this->db_connect_id) ? @sqlite_changes($this->db_connect_id) : false;
- }
-
- /**
- * Fetch current row
- */
- function sql_fetchrow($query_id = false)
- {
- global $cache;
-
- if ($query_id === false)
- {
- $query_id = $this->query_result;
- }
-
- if (isset($cache->sql_rowset[$query_id]))
- {
- return $cache->sql_fetchrow($query_id);
- }
-
- return ($query_id !== false) ? @sqlite_fetch_array($query_id, SQLITE_ASSOC) : false;
- }
-
- /**
- * Seek to given row number
- * rownum is zero-based
- */
- function sql_rowseek($rownum, &$query_id)
- {
- global $cache;
-
- if ($query_id === false)
- {
- $query_id = $this->query_result;
- }
-
- if (isset($cache->sql_rowset[$query_id]))
- {
- return $cache->sql_rowseek($rownum, $query_id);
- }
-
- return ($query_id !== false) ? @sqlite_seek($query_id, $rownum) : false;
- }
-
- /**
- * Get last inserted id after insert statement
- */
- function sql_nextid()
- {
- return ($this->db_connect_id) ? @sqlite_last_insert_rowid($this->db_connect_id) : false;
- }
-
- /**
- * Free sql result
- */
- function sql_freeresult($query_id = false)
- {
- global $cache;
-
- if ($query_id === false)
- {
- $query_id = $this->query_result;
- }
-
- if (isset($cache->sql_rowset[$query_id]))
- {
- return $cache->sql_freeresult($query_id);
- }
-
- return true;
- }
-
- /**
- * Escape string used in sql query
- */
- function sql_escape($msg)
- {
- return @sqlite_escape_string($msg);
- }
-
- /**
- * Correctly adjust LIKE expression for special characters
- * For SQLite an underscore is a not-known character... this may change with SQLite3
- */
- function sql_like_expression($expression)
- {
- // Unlike LIKE, GLOB is case sensitive (unfortunatly). SQLite users need to live with it!
- // We only catch * and ? here, not the character map possible on file globbing.
- $expression = str_replace(array(chr(0) . '_', chr(0) . '%'), array(chr(0) . '?', chr(0) . '*'), $expression);
-
- $expression = str_replace(array('?', '*'), array("\?", "\*"), $expression);
- $expression = str_replace(array(chr(0) . "\?", chr(0) . "\*"), array('?', '*'), $expression);
-
- return 'GLOB \'' . $this->sql_escape($expression) . '\'';
- }
-
- /**
- * return sql error array
- * @access private
- */
- function _sql_error()
- {
- if (function_exists('sqlite_error_string'))
- {
- $error = array(
- 'message' => @sqlite_error_string(@sqlite_last_error($this->db_connect_id)),
- 'code' => @sqlite_last_error($this->db_connect_id),
- );
- }
- else
- {
- $error = array(
- 'message' => $this->connect_error,
- 'code' => '',
- );
- }
-
- return $error;
- }
-
- /**
- * Build db-specific query data
- * @access private
- */
- function _sql_custom_build($stage, $data)
- {
- return $data;
- }
-
- /**
- * Close sql connection
- * @access private
- */
- function _sql_close()
- {
- return @sqlite_close($this->db_connect_id);
- }
-
- /**
- * Build db-specific report
- * @access private
- */
- function _sql_report($mode, $query = '')
- {
- switch ($mode)
- {
- case 'start':
- break;
-
- case 'fromcache':
- $endtime = explode(' ', microtime());
- $endtime = $endtime[0] + $endtime[1];
-
- $result = @sqlite_query($query, $this->db_connect_id);
- while ($void = @sqlite_fetch_array($result, SQLITE_ASSOC))
- {
- // Take the time spent on parsing rows into account
- }
-
- $splittime = explode(' ', microtime());
- $splittime = $splittime[0] + $splittime[1];
-
- $this->sql_report('record_fromcache', $query, $endtime, $splittime);
-
- break;
- }
- }
-}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/diff/diff.php b/phpBB/includes/diff/diff.php
index 60af574b78..d307880c4b 100644
--- a/phpBB/includes/diff/diff.php
+++ b/phpBB/includes/diff/diff.php
@@ -1,10 +1,13 @@
<?php
/**
*
-* @package diff
-* @version $Id$
-* @copyright (c) 2006 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -20,7 +23,7 @@ if (!defined('IN_PHPBB'))
* Code from pear.php.net, Text_Diff-1.1.0 package
* http://pear.php.net/package/Text_Diff/
*
-* Modified by phpBB Group to meet our coding standards
+* Modified by phpBB Limited to meet our coding standards
* and being able to integrate into phpBB
*
* General API for generating and formatting diffs - the differences between
@@ -43,8 +46,9 @@ class diff
/**
* Computes diffs between sequences of strings.
*
- * @param array $from_lines An array of strings. Typically these are lines from a file.
- * @param array $to_lines An array of strings.
+ * @param array &$from_content An array of strings. Typically these are lines from a file.
+ * @param array &$to_content An array of strings.
+ * @param bool $preserve_cr If true, \r is replaced by a new line in the diff output
*/
function diff(&$from_content, &$to_content, $preserve_cr = true)
{
@@ -488,9 +492,11 @@ class diff3 extends diff
/**
* Computes diff between 3 sequences of strings.
*
- * @param array $orig The original lines to use.
- * @param array $final1 The first version to compare to.
- * @param array $final2 The second version to compare to.
+ * @param array &$orig The original lines to use.
+ * @param array &$final1 The first version to compare to.
+ * @param array &$final2 The second version to compare to.
+ * @param bool $preserve_cr If true, \r\n and bare \r are replaced by a new line
+ * in the diff output
*/
function diff3(&$orig, &$final1, &$final2, $preserve_cr = true)
{
@@ -1144,5 +1150,3 @@ class diff3_block_builder
array_splice($array, sizeof($array), 0, $lines);
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/diff/engine.php b/phpBB/includes/diff/engine.php
index 982149457d..bc21b3b9ba 100644
--- a/phpBB/includes/diff/engine.php
+++ b/phpBB/includes/diff/engine.php
@@ -1,10 +1,13 @@
<?php
/**
*
-* @package diff
-* @version $Id$
-* @copyright (c) 2006 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -20,7 +23,7 @@ if (!defined('IN_PHPBB'))
* Code from pear.php.net, Text_Diff-1.1.0 package
* http://pear.php.net/package/Text_Diff/ (native engine)
*
-* Modified by phpBB Group to meet our coding standards
+* Modified by phpBB Limited to meet our coding standards
* and being able to integrate into phpBB
*
* Class used internally by Text_Diff to actually compute the diffs. This
@@ -550,5 +553,3 @@ class diff_engine
}
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/diff/renderer.php b/phpBB/includes/diff/renderer.php
index 5cb1b6ada9..6b7f07cf9c 100644
--- a/phpBB/includes/diff/renderer.php
+++ b/phpBB/includes/diff/renderer.php
@@ -1,10 +1,13 @@
<?php
/**
*
-* @package diff
-* @version $Id$
-* @copyright (c) 2006 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -20,7 +23,7 @@ if (!defined('IN_PHPBB'))
* Code from pear.php.net, Text_Diff-1.1.0 package
* http://pear.php.net/package/Text_Diff/
*
-* Modified by phpBB Group to meet our coding standards
+* Modified by phpBB Limited to meet our coding standards
* and being able to integrate into phpBB
*
* A class to render Diffs in different formats.
@@ -856,5 +859,3 @@ class diff_renderer_side_by_side extends diff_renderer
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/error_collector.php b/phpBB/includes/error_collector.php
deleted file mode 100644
index 3c0a89a1f3..0000000000
--- a/phpBB/includes/error_collector.php
+++ /dev/null
@@ -1,63 +0,0 @@
-<?php
-/**
-*
-* @package phpBB
-* @version $Id$
-* @copyright (c) 2011 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
-*
-*/
-
-/**
-* @ignore
-*/
-if (!defined('IN_PHPBB'))
-{
- exit;
-}
-
-class phpbb_error_collector
-{
- var $errors;
-
- function phpbb_error_collector()
- {
- $this->errors = array();
- }
-
- function install()
- {
- set_error_handler(array(&$this, 'error_handler'));
- }
-
- function uninstall()
- {
- restore_error_handler();
- }
-
- function error_handler($errno, $msg_text, $errfile, $errline)
- {
- $this->errors[] = array($errno, $msg_text, $errfile, $errline);
- }
-
- function format_errors()
- {
- $text = '';
- foreach ($this->errors as $error)
- {
- if (!empty($text))
- {
- $text .= "<br />\n";
- }
-
- list($errno, $msg_text, $errfile, $errline) = $error;
-
- // Prevent leakage of local path to phpBB install
- $errfile = phpbb_filter_root_path($errfile);
-
- $text .= "Errno $errno: $msg_text at $errfile line $errline";
- }
-
- return $text;
- }
-}
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index 2cef973a28..84178f74e4 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -1,10 +1,13 @@
<?php
/**
*
-* @package phpBB3
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -17,123 +20,113 @@ if (!defined('IN_PHPBB'))
}
// Common global functions
-
/**
-* set_var
+* Load the autoloaders added by the extensions.
*
-* Set variable, used by {@link request_var the request_var function}
-*
-* @access private
+* @param string $phpbb_root_path Path to the phpbb root directory.
*/
-function set_var(&$result, $var, $type, $multibyte = false)
+function phpbb_load_extensions_autoloaders($phpbb_root_path)
{
- settype($var, $type);
- $result = $var;
+ $iterator = new \RecursiveIteratorIterator(
+ new \phpbb\recursive_dot_prefix_filter_iterator(
+ new \RecursiveDirectoryIterator(
+ $phpbb_root_path . 'ext/',
+ \FilesystemIterator::SKIP_DOTS | \FilesystemIterator::FOLLOW_SYMLINKS
+ )
+ ),
+ \RecursiveIteratorIterator::SELF_FIRST
+ );
+ $iterator->setMaxDepth(2);
- if ($type == 'string')
+ foreach ($iterator as $file_info)
{
- $result = trim(htmlspecialchars(str_replace(array("\r\n", "\r", "\0"), array("\n", "\n", ''), $result), ENT_COMPAT, 'UTF-8'));
-
- if (!empty($result))
+ if ($file_info->getFilename() === 'vendor' && $iterator->getDepth() === 2)
{
- // Make sure multibyte characters are wellformed
- if ($multibyte)
+ $filename = $file_info->getRealPath() . '/autoload.php';
+ if (file_exists($filename))
{
- if (!preg_match('/^./u', $result))
- {
- $result = '';
- }
- }
- else
- {
- // no multibyte, allow only ASCII (0-127)
- $result = preg_replace('/[\x80-\xFF]/', '?', $result);
+ require $filename;
}
}
-
- $result = (STRIP) ? stripslashes($result) : $result;
}
}
/**
-* request_var
+* Casts a variable to the given type.
*
-* Used to get passed variable
+* @deprecated
*/
-function request_var($var_name, $default, $multibyte = false, $cookie = false)
+function set_var(&$result, $var, $type, $multibyte = false)
{
- if (!$cookie && isset($_COOKIE[$var_name]))
- {
- if (!isset($_GET[$var_name]) && !isset($_POST[$var_name]))
- {
- return (is_array($default)) ? array() : $default;
- }
- $_REQUEST[$var_name] = isset($_POST[$var_name]) ? $_POST[$var_name] : $_GET[$var_name];
- }
+ // no need for dependency injection here, if you have the object, call the method yourself!
+ $type_cast_helper = new \phpbb\request\type_cast_helper();
+ $type_cast_helper->set_var($result, $var, $type, $multibyte);
+}
- $super_global = ($cookie) ? '_COOKIE' : '_REQUEST';
- if (!isset($GLOBALS[$super_global][$var_name]) || is_array($GLOBALS[$super_global][$var_name]) != is_array($default))
- {
- return (is_array($default)) ? array() : $default;
- }
+/**
+* Wrapper function of \phpbb\request\request::variable which exists for backwards compatability.
+* See {@link \phpbb\request\request_interface::variable \phpbb\request\request_interface::variable} for
+* documentation of this function's use.
+*
+* @deprecated
+* @param mixed $var_name The form variable's name from which data shall be retrieved.
+* If the value is an array this may be an array of indizes which will give
+* direct access to a value at any depth. E.g. if the value of "var" is array(1 => "a")
+* then specifying array("var", 1) as the name will return "a".
+* If you pass an instance of {@link \phpbb\request\request_interface phpbb_request_interface}
+* as this parameter it will overwrite the current request class instance. If you do
+* not do so, it will create its own instance (but leave superglobals enabled).
+* @param mixed $default A default value that is returned if the variable was not set.
+* This function will always return a value of the same type as the default.
+* @param bool $multibyte If $default is a string this paramater has to be true if the variable may contain any UTF-8 characters
+* Default is false, causing all bytes outside the ASCII range (0-127) to be replaced with question marks
+* @param bool $cookie This param is mapped to \phpbb\request\request_interface::COOKIE as the last param for
+* \phpbb\request\request_interface::variable for backwards compatability reasons.
+* @param \phpbb\request\request_interface|null|false If an instance of \phpbb\request\request_interface is given the instance is stored in
+* a static variable and used for all further calls where this parameters is null. Until
+* the function is called with an instance it automatically creates a new \phpbb\request\request
+* instance on every call. By passing false this per-call instantiation can be restored
+* after having passed in a \phpbb\request\request_interface instance.
+*
+* @return mixed The value of $_REQUEST[$var_name] run through {@link set_var set_var} to ensure that the type is the
+* the same as that of $default. If the variable is not set $default is returned.
+*/
+function request_var($var_name, $default, $multibyte = false, $cookie = false, $request = null)
+{
+ // This is all just an ugly hack to add "Dependency Injection" to a function
+ // the only real code is the function call which maps this function to a method.
+ static $static_request = null;
- $var = $GLOBALS[$super_global][$var_name];
- if (!is_array($default))
- {
- $type = gettype($default);
- }
- else
+ if ($request instanceof \phpbb\request\request_interface)
{
- list($key_type, $type) = each($default);
- $type = gettype($type);
- $key_type = gettype($key_type);
- if ($type == 'array')
+ $static_request = $request;
+
+ if (empty($var_name))
{
- reset($default);
- $default = current($default);
- list($sub_key_type, $sub_type) = each($default);
- $sub_type = gettype($sub_type);
- $sub_type = ($sub_type == 'array') ? 'NULL' : $sub_type;
- $sub_key_type = gettype($sub_key_type);
+ return;
}
}
-
- if (is_array($var))
+ else if ($request === false)
{
- $_var = $var;
- $var = array();
+ $static_request = null;
- foreach ($_var as $k => $v)
+ if (empty($var_name))
{
- set_var($k, $k, $key_type);
- if ($type == 'array' && is_array($v))
- {
- foreach ($v as $_k => $_v)
- {
- if (is_array($_v))
- {
- $_v = null;
- }
- set_var($_k, $_k, $sub_key_type, $multibyte);
- set_var($var[$k][$_k], $_v, $sub_type, $multibyte);
- }
- }
- else
- {
- if ($type == 'array' || is_array($v))
- {
- $v = null;
- }
- set_var($var[$k], $v, $type, $multibyte);
- }
+ return;
}
}
- else
+
+ $tmp_request = $static_request;
+
+ // no request class set, create a temporary one ourselves to keep backwards compatability
+ if ($tmp_request === null)
{
- set_var($var, $var, $type, $multibyte);
+ // false param: enable super globals, so the created request class does not
+ // make super globals inaccessible everywhere outside this function.
+ $tmp_request = new \phpbb\request\request(new \phpbb\request\type_cast_helper(), false);
}
- return $var;
+ return $tmp_request->variable($var_name, $default, $multibyte, ($cookie) ? \phpbb\request\request_interface::COOKIE : \phpbb\request\request_interface::REQUEST);
}
/**
@@ -149,31 +142,24 @@ function request_var($var_name, $default, $multibyte = false, $cookie = false)
* efficiently cached.
*
* @return null
+*
+* @deprecated
*/
-function set_config($config_name, $config_value, $is_dynamic = false)
+function set_config($config_name, $config_value, $is_dynamic = false, \phpbb\config\config $set_config = null)
{
- global $db, $cache, $config;
-
- $sql = 'UPDATE ' . CONFIG_TABLE . "
- SET config_value = '" . $db->sql_escape($config_value) . "'
- WHERE config_name = '" . $db->sql_escape($config_name) . "'";
- $db->sql_query($sql);
+ static $config = null;
- if (!$db->sql_affectedrows() && !isset($config[$config_name]))
+ if ($set_config !== null)
{
- $sql = 'INSERT INTO ' . CONFIG_TABLE . ' ' . $db->sql_build_array('INSERT', array(
- 'config_name' => $config_name,
- 'config_value' => $config_value,
- 'is_dynamic' => ($is_dynamic) ? 1 : 0));
- $db->sql_query($sql);
- }
-
- $config[$config_name] = $config_value;
+ $config = $set_config;
- if (!$is_dynamic)
- {
- $cache->destroy('config');
+ if (empty($config_name))
+ {
+ return;
+ }
}
+
+ $config->set($config_name, $config_value, !$is_dynamic);
}
/**
@@ -186,35 +172,24 @@ function set_config($config_name, $config_value, $is_dynamic = false)
* efficiently cached.
*
* @return null
+*
+* @deprecated
*/
-function set_config_count($config_name, $increment, $is_dynamic = false)
+function set_config_count($config_name, $increment, $is_dynamic = false, \phpbb\config\config $set_config = null)
{
- global $db, $cache;
+ static $config = null;
- switch ($db->sql_layer)
+ if ($set_config !== null)
{
- case 'firebird':
- // Precision must be from 1 to 18
- $sql_update = 'CAST(CAST(config_value as DECIMAL(18, 0)) + ' . (int) $increment . ' as VARCHAR(255))';
- break;
-
- case 'postgres':
- // Need to cast to text first for PostgreSQL 7.x
- $sql_update = 'CAST(CAST(config_value::text as DECIMAL(255, 0)) + ' . (int) $increment . ' as VARCHAR(255))';
- break;
+ $config = $set_config;
- // MySQL, SQlite, mssql, mssql_odbc, oracle
- default:
- $sql_update = 'config_value + ' . (int) $increment;
- break;
+ if (empty($config_name))
+ {
+ return;
+ }
}
- $db->sql_query('UPDATE ' . CONFIG_TABLE . ' SET config_value = ' . $sql_update . " WHERE config_name = '" . $db->sql_escape($config_name) . "'");
-
- if (!$is_dynamic)
- {
- $cache->destroy('config');
- }
+ $config->increment($config_name, $increment, !$is_dynamic);
}
/**
@@ -314,7 +289,6 @@ function phpbb_gmgetdate($time = false)
* @param array $allowed_units only allow these units (data array indexes)
*
* @return mixed data array if $string_only is false
-* @author bantu
*/
function get_formatted_filesize($value, $string_only = true, $allowed_units = false)
{
@@ -428,219 +402,6 @@ function still_on_time($extra_time = 15)
}
/**
-*
-* @version Version 0.1 / slightly modified for phpBB 3.0.x (using $H$ as hash type identifier)
-*
-* Portable PHP password hashing framework.
-*
-* Written by Solar Designer <solar at openwall.com> in 2004-2006 and placed in
-* the public domain.
-*
-* There's absolutely no warranty.
-*
-* The homepage URL for this framework is:
-*
-* http://www.openwall.com/phpass/
-*
-* Please be sure to update the Version line if you edit this file in any way.
-* It is suggested that you leave the main version number intact, but indicate
-* your project name (after the slash) and add your own revision information.
-*
-* Please do not change the "private" password hashing method implemented in
-* here, thereby making your hashes incompatible. However, if you must, please
-* change the hash type identifier (the "$P$") to something different.
-*
-* Obviously, since this code is in the public domain, the above are not
-* requirements (there can be none), but merely suggestions.
-*
-*
-* Hash the password
-*/
-function phpbb_hash($password)
-{
- $itoa64 = './0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
-
- $random_state = unique_id();
- $random = '';
- $count = 6;
-
- if (($fh = @fopen('/dev/urandom', 'rb')))
- {
- $random = fread($fh, $count);
- fclose($fh);
- }
-
- if (strlen($random) < $count)
- {
- $random = '';
-
- for ($i = 0; $i < $count; $i += 16)
- {
- $random_state = md5(unique_id() . $random_state);
- $random .= pack('H*', md5($random_state));
- }
- $random = substr($random, 0, $count);
- }
-
- $hash = _hash_crypt_private($password, _hash_gensalt_private($random, $itoa64), $itoa64);
-
- if (strlen($hash) == 34)
- {
- return $hash;
- }
-
- return md5($password);
-}
-
-/**
-* Check for correct password
-*
-* @param string $password The password in plain text
-* @param string $hash The stored password hash
-*
-* @return bool Returns true if the password is correct, false if not.
-*/
-function phpbb_check_hash($password, $hash)
-{
- if (strlen($password) > 4096)
- {
- // If the password is too huge, we will simply reject it
- // and not let the server try to hash it.
- return false;
- }
-
- $itoa64 = './0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
- if (strlen($hash) == 34)
- {
- return (_hash_crypt_private($password, $hash, $itoa64) === $hash) ? true : false;
- }
-
- return (md5($password) === $hash) ? true : false;
-}
-
-/**
-* Generate salt for hash generation
-*/
-function _hash_gensalt_private($input, &$itoa64, $iteration_count_log2 = 6)
-{
- if ($iteration_count_log2 < 4 || $iteration_count_log2 > 31)
- {
- $iteration_count_log2 = 8;
- }
-
- $output = '$H$';
- $output .= $itoa64[min($iteration_count_log2 + ((PHP_VERSION >= 5) ? 5 : 3), 30)];
- $output .= _hash_encode64($input, 6, $itoa64);
-
- return $output;
-}
-
-/**
-* Encode hash
-*/
-function _hash_encode64($input, $count, &$itoa64)
-{
- $output = '';
- $i = 0;
-
- do
- {
- $value = ord($input[$i++]);
- $output .= $itoa64[$value & 0x3f];
-
- if ($i < $count)
- {
- $value |= ord($input[$i]) << 8;
- }
-
- $output .= $itoa64[($value >> 6) & 0x3f];
-
- if ($i++ >= $count)
- {
- break;
- }
-
- if ($i < $count)
- {
- $value |= ord($input[$i]) << 16;
- }
-
- $output .= $itoa64[($value >> 12) & 0x3f];
-
- if ($i++ >= $count)
- {
- break;
- }
-
- $output .= $itoa64[($value >> 18) & 0x3f];
- }
- while ($i < $count);
-
- return $output;
-}
-
-/**
-* The crypt function/replacement
-*/
-function _hash_crypt_private($password, $setting, &$itoa64)
-{
- $output = '*';
-
- // Check for correct hash
- if (substr($setting, 0, 3) != '$H$' && substr($setting, 0, 3) != '$P$')
- {
- return $output;
- }
-
- $count_log2 = strpos($itoa64, $setting[3]);
-
- if ($count_log2 < 7 || $count_log2 > 30)
- {
- return $output;
- }
-
- $count = 1 << $count_log2;
- $salt = substr($setting, 4, 8);
-
- if (strlen($salt) != 8)
- {
- return $output;
- }
-
- /**
- * We're kind of forced to use MD5 here since it's the only
- * cryptographic primitive available in all versions of PHP
- * currently in use. To implement our own low-level crypto
- * in PHP would result in much worse performance and
- * consequently in lower iteration counts and hashes that are
- * quicker to crack (by non-PHP code).
- */
- if (PHP_VERSION >= 5)
- {
- $hash = md5($salt . $password, true);
- do
- {
- $hash = md5($hash . $password, true);
- }
- while (--$count);
- }
- else
- {
- $hash = pack('H*', md5($salt . $password));
- do
- {
- $hash = pack('H*', md5($hash . $password));
- }
- while (--$count);
- }
-
- $output = substr($setting, 0, 12);
- $output .= _hash_encode64($hash, 16, $itoa64);
-
- return $output;
-}
-
-/**
* Hashes an email address to a big integer
*
* @param string $email Email address
@@ -701,7 +462,6 @@ function phpbb_version_compare($version1, $version2, $operator = null)
* @param int $perms Permissions to set
*
* @return bool true on success, otherwise false
-* @author faw, phpBB Group
*/
function phpbb_chmod($filename, $perms = CHMOD_READ)
{
@@ -915,102 +675,13 @@ function phpbb_is_writable($file)
}
}
-// Compatibility functions
-
-if (!function_exists('array_combine'))
-{
- /**
- * A wrapper for the PHP5 function array_combine()
- * @param array $keys contains keys for the resulting array
- * @param array $values contains values for the resulting array
- *
- * @return Returns an array by using the values from the keys array as keys and the
- * values from the values array as the corresponding values. Returns false if the
- * number of elements for each array isn't equal or if the arrays are empty.
- */
- function array_combine($keys, $values)
- {
- $keys = array_values($keys);
- $values = array_values($values);
-
- $n = sizeof($keys);
- $m = sizeof($values);
- if (!$n || !$m || ($n != $m))
- {
- return false;
- }
-
- $combined = array();
- for ($i = 0; $i < $n; $i++)
- {
- $combined[$keys[$i]] = $values[$i];
- }
- return $combined;
- }
-}
-
-if (!function_exists('str_split'))
-{
- /**
- * A wrapper for the PHP5 function str_split()
- * @param array $string contains the string to be converted
- * @param array $split_length contains the length of each chunk
- *
- * @return Converts a string to an array. If the optional split_length parameter is specified,
- * the returned array will be broken down into chunks with each being split_length in length,
- * otherwise each chunk will be one character in length. FALSE is returned if split_length is
- * less than 1. If the split_length length exceeds the length of string, the entire string is
- * returned as the first (and only) array element.
- */
- function str_split($string, $split_length = 1)
- {
- if ($split_length < 1)
- {
- return false;
- }
- else if ($split_length >= strlen($string))
- {
- return array($string);
- }
- else
- {
- preg_match_all('#.{1,' . $split_length . '}#s', $string, $matches);
- return $matches[0];
- }
- }
-}
-
-if (!function_exists('stripos'))
-{
- /**
- * A wrapper for the PHP5 function stripos
- * Find position of first occurrence of a case-insensitive string
- *
- * @param string $haystack is the string to search in
- * @param string $needle is the string to search for
- *
- * @return mixed Returns the numeric position of the first occurrence of needle in the haystack string. Unlike strpos(), stripos() is case-insensitive.
- * Note that the needle may be a string of one or more characters.
- * If needle is not found, stripos() will return boolean FALSE.
- */
- function stripos($haystack, $needle)
- {
- if (preg_match('#' . preg_quote($needle, '#') . '#i', $haystack, $m))
- {
- return strpos($haystack, $m[0]);
- }
-
- return false;
- }
-}
-
/**
* Checks if a path ($path) is absolute or relative
*
* @param string $path Path to check absoluteness of
* @return boolean
*/
-function is_absolute($path)
+function phpbb_is_absolute($path)
{
return (isset($path[0]) && $path[0] == '/' || preg_match('#^[a-z]:[/\\\]#i', $path)) ? true : false;
}
@@ -1023,6 +694,8 @@ function is_absolute($path)
*/
function phpbb_own_realpath($path)
{
+ global $request;
+
// Now to perform funky shizzle
// Switch to use UNIX slashes
@@ -1030,7 +703,7 @@ function phpbb_own_realpath($path)
$path_prefix = '';
// Determine what sort of path we have
- if (is_absolute($path))
+ if (phpbb_is_absolute($path))
{
$absolute = true;
@@ -1066,11 +739,12 @@ function phpbb_own_realpath($path)
$path_prefix = '';
}
}
- else if (isset($_SERVER['SCRIPT_FILENAME']) && !empty($_SERVER['SCRIPT_FILENAME']))
+ else if ($request->server('SCRIPT_FILENAME'))
{
// Warning: If chdir() has been used this will lie!
// Warning: This has some problems sometime (CLI can create them easily)
- $path = str_replace(DIRECTORY_SEPARATOR, '/', dirname($_SERVER['SCRIPT_FILENAME'])) . '/' . $path;
+ $filename = htmlspecialchars_decode($request->server('SCRIPT_FILENAME'));
+ $path = str_replace(DIRECTORY_SEPARATOR, '/', dirname($filename)) . '/' . $path;
$absolute = true;
$path_prefix = '';
}
@@ -1209,48 +883,6 @@ else
}
}
-/**
-* Eliminates useless . and .. components from specified path.
-*
-* @param string $path Path to clean
-* @return string Cleaned path
-*/
-function phpbb_clean_path($path)
-{
- $exploded = explode('/', $path);
- $filtered = array();
- foreach ($exploded as $part)
- {
- if ($part === '.' && !empty($filtered))
- {
- continue;
- }
-
- if ($part === '..' && !empty($filtered) && $filtered[sizeof($filtered) - 1] !== '..')
- {
- array_pop($filtered);
- }
- else
- {
- $filtered[] = $part;
- }
- }
- $path = implode('/', $filtered);
- return $path;
-}
-
-if (!function_exists('htmlspecialchars_decode'))
-{
- /**
- * A wrapper for htmlspecialchars_decode
- * @ignore
- */
- function htmlspecialchars_decode($string, $quote_style = ENT_COMPAT)
- {
- return strtr($string, array_flip(get_html_translation_table(HTML_SPECIALCHARS, $quote_style)));
- }
-}
-
// functions used for building option fields
/**
@@ -1302,31 +934,204 @@ function style_select($default = '', $all = false)
}
/**
-* Pick a timezone
+* Format the timezone offset with hours and minutes
+*
+* @param int $tz_offset Timezone offset in seconds
+* @param bool $show_null Whether null offsets should be shown
+* @return string Normalized offset string: -7200 => -02:00
+* 16200 => +04:30
*/
-function tz_select($default = '', $truncate = false)
+function phpbb_format_timezone_offset($tz_offset, $show_null = false)
{
- global $user;
+ $sign = ($tz_offset < 0) ? '-' : '+';
+ $time_offset = abs($tz_offset);
- $tz_select = '';
- foreach ($user->lang['tz_zones'] as $offset => $zone)
+ if ($time_offset == 0 && $show_null == false)
{
- if ($truncate)
+ return '';
+ }
+
+ $offset_seconds = $time_offset % 3600;
+ $offset_minutes = $offset_seconds / 60;
+ $offset_hours = ($time_offset - $offset_seconds) / 3600;
+
+ $offset_string = sprintf("%s%02d:%02d", $sign, $offset_hours, $offset_minutes);
+ return $offset_string;
+}
+
+/**
+* Compares two time zone labels.
+* Arranges them in increasing order by timezone offset.
+* Places UTC before other timezones in the same offset.
+*/
+function phpbb_tz_select_compare($a, $b)
+{
+ $a_sign = $a[3];
+ $b_sign = $b[3];
+ if ($a_sign != $b_sign)
+ {
+ return $a_sign == '-' ? -1 : 1;
+ }
+
+ $a_offset = substr($a, 4, 5);
+ $b_offset = substr($b, 4, 5);
+ if ($a_offset == $b_offset)
+ {
+ $a_name = substr($a, 12);
+ $b_name = substr($b, 12);
+ if ($a_name == $b_name)
+ {
+ return 0;
+ }
+ else if ($a_name == 'UTC')
+ {
+ return -1;
+ }
+ else if ($b_name == 'UTC')
+ {
+ return 1;
+ }
+ else
+ {
+ return $a_name < $b_name ? -1 : 1;
+ }
+ }
+ else
+ {
+ if ($a_sign == '-')
{
- $zone_trunc = truncate_string($zone, 50, 255, false, '...');
+ return $a_offset > $b_offset ? -1 : 1;
}
else
{
- $zone_trunc = $zone;
+ return $a_offset < $b_offset ? -1 : 1;
}
+ }
+}
+
+/**
+* Return list of timezone identifiers
+* We also add the selected timezone if we can create an object with it.
+* DateTimeZone::listIdentifiers seems to not add all identifiers to the list,
+* because some are only kept for backward compatible reasons. If the user has
+* a deprecated value, we add it here, so it can still be kept. Once the user
+* changed his value, there is no way back to deprecated values.
+*
+* @param string $selected_timezone Additional timezone that shall
+* be added to the list of identiers
+* @return array DateTimeZone::listIdentifiers and additional
+* selected_timezone if it is a valid timezone.
+*/
+function phpbb_get_timezone_identifiers($selected_timezone)
+{
+ $timezones = DateTimeZone::listIdentifiers();
- if (is_numeric($offset))
+ if (!in_array($selected_timezone, $timezones))
+ {
+ try
+ {
+ // Add valid timezones that are currently selected but not returned
+ // by DateTimeZone::listIdentifiers
+ $validate_timezone = new DateTimeZone($selected_timezone);
+ $timezones[] = $selected_timezone;
+ }
+ catch (\Exception $e)
{
- $selected = ($offset == $default) ? ' selected="selected"' : '';
- $tz_select .= '<option title="' . $zone . '" value="' . $offset . '"' . $selected . '>' . $zone_trunc . '</option>';
}
}
+ return $timezones;
+}
+
+/**
+* Options to pick a timezone and date/time
+*
+* @param \phpbb\template\template $template phpBB template object
+* @param \phpbb\user $user Object of the current user
+* @param string $default A timezone to select
+* @param boolean $truncate Shall we truncate the options text
+*
+* @return array Returns an array containing the options for the time selector.
+*/
+function phpbb_timezone_select($template, $user, $default = '', $truncate = false)
+{
+ static $timezones;
+
+ $default_offset = '';
+ if (!isset($timezones))
+ {
+ $unsorted_timezones = phpbb_get_timezone_identifiers($default);
+
+ $timezones = array();
+ foreach ($unsorted_timezones as $timezone)
+ {
+ $tz = new DateTimeZone($timezone);
+ $dt = $user->create_datetime('now', $tz);
+ $offset = $dt->getOffset();
+ $current_time = $dt->format($user->lang['DATETIME_FORMAT'], true);
+ $offset_string = phpbb_format_timezone_offset($offset, true);
+ $timezones['UTC' . $offset_string . ' - ' . $timezone] = array(
+ 'tz' => $timezone,
+ 'offset' => $offset_string,
+ 'current' => $current_time,
+ );
+ if ($timezone === $default)
+ {
+ $default_offset = 'UTC' . $offset_string;
+ }
+ }
+ unset($unsorted_timezones);
+
+ uksort($timezones, 'phpbb_tz_select_compare');
+ }
+
+ $tz_select = $opt_group = '';
+
+ foreach ($timezones as $key => $timezone)
+ {
+ if ($opt_group != $timezone['offset'])
+ {
+ // Generate tz_select for backwards compatibility
+ $tz_select .= ($opt_group) ? '</optgroup>' : '';
+ $tz_select .= '<optgroup label="' . $user->lang(array('timezones', 'UTC_OFFSET_CURRENT'), $timezone['offset'], $timezone['current']) . '">';
+ $opt_group = $timezone['offset'];
+ $template->assign_block_vars('timezone_select', array(
+ 'LABEL' => $user->lang(array('timezones', 'UTC_OFFSET_CURRENT'), $timezone['offset'], $timezone['current']),
+ 'VALUE' => $key . ' - ' . $timezone['current'],
+ ));
+
+ $selected = (!empty($default_offset) && strpos($key, $default_offset) !== false) ? ' selected="selected"' : '';
+ $template->assign_block_vars('timezone_date', array(
+ 'VALUE' => $key . ' - ' . $timezone['current'],
+ 'SELECTED' => !empty($selected),
+ 'TITLE' => $user->lang(array('timezones', 'UTC_OFFSET_CURRENT'), $timezone['offset'], $timezone['current']),
+ ));
+ }
+
+ $label = $timezone['tz'];
+ if (isset($user->lang['timezones'][$label]))
+ {
+ $label = $user->lang['timezones'][$label];
+ }
+ $title = $user->lang(array('timezones', 'UTC_OFFSET_CURRENT'), $timezone['offset'], $label);
+
+ if ($truncate)
+ {
+ $label = truncate_string($label, 50, 255, false, '...');
+ }
+
+ // Also generate timezone_select for backwards compatibility
+ $selected = ($timezone['tz'] === $default) ? ' selected="selected"' : '';
+ $tz_select .= '<option title="' . $title . '" value="' . $timezone['tz'] . '"' . $selected . '>' . $label . '</option>';
+ $template->assign_block_vars('timezone_select.timezone_options', array(
+ 'TITLE' => $title,
+ 'VALUE' => $timezone['tz'],
+ 'SELECTED' => !empty($selected),
+ 'LABEL' => $label,
+ ));
+ }
+ $tz_select .= '</optgroup>';
+
return $tz_select;
}
@@ -1336,41 +1141,110 @@ function tz_select($default = '', $truncate = false)
* Marks a topic/forum as read
* Marks a topic as posted to
*
+* @param string $mode (all, topics, topic, post)
+* @param int|bool $forum_id Used in all, topics, and topic mode
+* @param int|bool $topic_id Used in topic and post mode
+* @param int $post_time 0 means current time(), otherwise to set a specific mark time
* @param int $user_id can only be used with $mode == 'post'
*/
function markread($mode, $forum_id = false, $topic_id = false, $post_time = 0, $user_id = 0)
{
global $db, $user, $config;
+ global $request, $phpbb_container, $phpbb_dispatcher;
+
+ $post_time = ($post_time === 0 || $post_time > time()) ? time() : (int) $post_time;
+
+ $should_markread = true;
+
+ /**
+ * This event is used for performing actions directly before marking forums,
+ * topics or posts as read.
+ *
+ * It is also possible to prevent the marking. For that, the $should_markread parameter
+ * should be set to FALSE.
+ *
+ * @event core.markread_before
+ * @var string mode Variable containing marking mode value
+ * @var mixed forum_id Variable containing forum id, or false
+ * @var mixed topic_id Variable containing topic id, or false
+ * @var int post_time Variable containing post time
+ * @var int user_id Variable containing the user id
+ * @var bool should_markread Flag indicating if the markread should be done or not.
+ * @since 3.1.4-RC1
+ */
+ $vars = array(
+ 'mode',
+ 'forum_id',
+ 'topic_id',
+ 'post_time',
+ 'user_id',
+ 'should_markread',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.markread_before', compact($vars)));
+
+ if (!$should_markread)
+ {
+ return;
+ }
if ($mode == 'all')
{
if ($forum_id === false || !sizeof($forum_id))
{
+ // Mark all forums read (index page)
+
+ $phpbb_notifications = $phpbb_container->get('notification_manager');
+
+ // Mark all topic notifications read for this user
+ $phpbb_notifications->mark_notifications_read(array(
+ 'notification.type.topic',
+ 'notification.type.quote',
+ 'notification.type.bookmark',
+ 'notification.type.post',
+ 'notification.type.approve_topic',
+ 'notification.type.approve_post',
+ ), false, $user->data['user_id'], $post_time);
+
if ($config['load_db_lastread'] && $user->data['is_registered'])
{
// Mark all forums read (index page)
- $db->sql_query('DELETE FROM ' . TOPICS_TRACK_TABLE . " WHERE user_id = {$user->data['user_id']}");
- $db->sql_query('DELETE FROM ' . FORUMS_TRACK_TABLE . " WHERE user_id = {$user->data['user_id']}");
- $db->sql_query('UPDATE ' . USERS_TABLE . ' SET user_lastmark = ' . time() . " WHERE user_id = {$user->data['user_id']}");
+ $tables = array(TOPICS_TRACK_TABLE, FORUMS_TRACK_TABLE);
+ foreach ($tables as $table)
+ {
+ $sql = 'DELETE FROM ' . $table . "
+ WHERE user_id = {$user->data['user_id']}
+ AND mark_time < $post_time";
+ $db->sql_query($sql);
+ }
+
+ $sql = 'UPDATE ' . USERS_TABLE . "
+ SET user_lastmark = $post_time
+ WHERE user_id = {$user->data['user_id']}
+ AND user_lastmark < $post_time";
+ $db->sql_query($sql);
}
else if ($config['load_anon_lastread'] || $user->data['is_registered'])
{
- $tracking_topics = (isset($_COOKIE[$config['cookie_name'] . '_track'])) ? ((STRIP) ? stripslashes($_COOKIE[$config['cookie_name'] . '_track']) : $_COOKIE[$config['cookie_name'] . '_track']) : '';
+ $tracking_topics = $request->variable($config['cookie_name'] . '_track', '', true, \phpbb\request\request_interface::COOKIE);
$tracking_topics = ($tracking_topics) ? tracking_unserialize($tracking_topics) : array();
unset($tracking_topics['tf']);
unset($tracking_topics['t']);
unset($tracking_topics['f']);
- $tracking_topics['l'] = base_convert(time() - $config['board_startdate'], 10, 36);
+ $tracking_topics['l'] = base_convert($post_time - $config['board_startdate'], 10, 36);
- $user->set_cookie('track', tracking_serialize($tracking_topics), time() + 31536000);
- $_COOKIE[$config['cookie_name'] . '_track'] = (STRIP) ? addslashes(tracking_serialize($tracking_topics)) : tracking_serialize($tracking_topics);
+ $user->set_cookie('track', tracking_serialize($tracking_topics), $post_time + 31536000);
+ $request->overwrite($config['cookie_name'] . '_track', tracking_serialize($tracking_topics), \phpbb\request\request_interface::COOKIE);
unset($tracking_topics);
if ($user->data['is_registered'])
{
- $db->sql_query('UPDATE ' . USERS_TABLE . ' SET user_lastmark = ' . time() . " WHERE user_id = {$user->data['user_id']}");
+ $sql = 'UPDATE ' . USERS_TABLE . "
+ SET user_lastmark = $post_time
+ WHERE user_id = {$user->data['user_id']}
+ AND user_lastmark < $post_time";
+ $db->sql_query($sql);
}
}
}
@@ -1384,6 +1258,36 @@ function markread($mode, $forum_id = false, $topic_id = false, $post_time = 0, $
{
$forum_id = array($forum_id);
}
+ else
+ {
+ $forum_id = array_unique($forum_id);
+ }
+
+ $phpbb_notifications = $phpbb_container->get('notification_manager');
+
+ $phpbb_notifications->mark_notifications_read_by_parent(array(
+ 'notification.type.topic',
+ 'notification.type.approve_topic',
+ ), $forum_id, $user->data['user_id'], $post_time);
+
+ // Mark all post/quote notifications read for this user in this forum
+ $topic_ids = array();
+ $sql = 'SELECT topic_id
+ FROM ' . TOPICS_TABLE . '
+ WHERE ' . $db->sql_in_set('forum_id', $forum_id);
+ $result = $db->sql_query($sql);
+ while ($row = $db->sql_fetchrow($result))
+ {
+ $topic_ids[] = $row['topic_id'];
+ }
+ $db->sql_freeresult($result);
+
+ $phpbb_notifications->mark_notifications_read_by_parent(array(
+ 'notification.type.quote',
+ 'notification.type.bookmark',
+ 'notification.type.post',
+ 'notification.type.approve_post',
+ ), $topic_ids, $user->data['user_id'], $post_time);
// Add 0 to forums array to mark global announcements correctly
// $forum_id[] = 0;
@@ -1392,6 +1296,7 @@ function markread($mode, $forum_id = false, $topic_id = false, $post_time = 0, $
{
$sql = 'DELETE FROM ' . TOPICS_TRACK_TABLE . "
WHERE user_id = {$user->data['user_id']}
+ AND mark_time < $post_time
AND " . $db->sql_in_set('forum_id', $forum_id);
$db->sql_query($sql);
@@ -1410,9 +1315,10 @@ function markread($mode, $forum_id = false, $topic_id = false, $post_time = 0, $
if (sizeof($sql_update))
{
- $sql = 'UPDATE ' . FORUMS_TRACK_TABLE . '
- SET mark_time = ' . time() . "
+ $sql = 'UPDATE ' . FORUMS_TRACK_TABLE . "
+ SET mark_time = $post_time
WHERE user_id = {$user->data['user_id']}
+ AND mark_time < $post_time
AND " . $db->sql_in_set('forum_id', $sql_update);
$db->sql_query($sql);
}
@@ -1425,7 +1331,7 @@ function markread($mode, $forum_id = false, $topic_id = false, $post_time = 0, $
$sql_ary[] = array(
'user_id' => (int) $user->data['user_id'],
'forum_id' => (int) $f_id,
- 'mark_time' => time()
+ 'mark_time' => $post_time,
);
}
@@ -1434,7 +1340,7 @@ function markread($mode, $forum_id = false, $topic_id = false, $post_time = 0, $
}
else if ($config['load_anon_lastread'] || $user->data['is_registered'])
{
- $tracking = (isset($_COOKIE[$config['cookie_name'] . '_track'])) ? ((STRIP) ? stripslashes($_COOKIE[$config['cookie_name'] . '_track']) : $_COOKIE[$config['cookie_name'] . '_track']) : '';
+ $tracking = $request->variable($config['cookie_name'] . '_track', '', true, \phpbb\request\request_interface::COOKIE);
$tracking = ($tracking) ? tracking_unserialize($tracking) : array();
foreach ($forum_id as $f_id)
@@ -1456,7 +1362,7 @@ function markread($mode, $forum_id = false, $topic_id = false, $post_time = 0, $
unset($tracking['f'][$f_id]);
}
- $tracking['f'][$f_id] = base_convert(time() - $config['board_startdate'], 10, 36);
+ $tracking['f'][$f_id] = base_convert($post_time - $config['board_startdate'], 10, 36);
}
if (isset($tracking['tf']) && empty($tracking['tf']))
@@ -1464,8 +1370,8 @@ function markread($mode, $forum_id = false, $topic_id = false, $post_time = 0, $
unset($tracking['tf']);
}
- $user->set_cookie('track', tracking_serialize($tracking), time() + 31536000);
- $_COOKIE[$config['cookie_name'] . '_track'] = (STRIP) ? addslashes(tracking_serialize($tracking)) : tracking_serialize($tracking);
+ $user->set_cookie('track', tracking_serialize($tracking), $post_time + 31536000);
+ $request->overwrite($config['cookie_name'] . '_track', tracking_serialize($tracking), \phpbb\request\request_interface::COOKIE);
unset($tracking);
}
@@ -1479,11 +1385,27 @@ function markread($mode, $forum_id = false, $topic_id = false, $post_time = 0, $
return;
}
+ $phpbb_notifications = $phpbb_container->get('notification_manager');
+
+ // Mark post notifications read for this user in this topic
+ $phpbb_notifications->mark_notifications_read(array(
+ 'notification.type.topic',
+ 'notification.type.approve_topic',
+ ), $topic_id, $user->data['user_id'], $post_time);
+
+ $phpbb_notifications->mark_notifications_read_by_parent(array(
+ 'notification.type.quote',
+ 'notification.type.bookmark',
+ 'notification.type.post',
+ 'notification.type.approve_post',
+ ), $topic_id, $user->data['user_id'], $post_time);
+
if ($config['load_db_lastread'] && $user->data['is_registered'])
{
- $sql = 'UPDATE ' . TOPICS_TRACK_TABLE . '
- SET mark_time = ' . (($post_time) ? $post_time : time()) . "
+ $sql = 'UPDATE ' . TOPICS_TRACK_TABLE . "
+ SET mark_time = $post_time
WHERE user_id = {$user->data['user_id']}
+ AND mark_time < $post_time
AND topic_id = $topic_id";
$db->sql_query($sql);
@@ -1496,7 +1418,7 @@ function markread($mode, $forum_id = false, $topic_id = false, $post_time = 0, $
'user_id' => (int) $user->data['user_id'],
'topic_id' => (int) $topic_id,
'forum_id' => (int) $forum_id,
- 'mark_time' => ($post_time) ? (int) $post_time : time(),
+ 'mark_time' => $post_time,
);
$db->sql_query('INSERT INTO ' . TOPICS_TRACK_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary));
@@ -1506,7 +1428,7 @@ function markread($mode, $forum_id = false, $topic_id = false, $post_time = 0, $
}
else if ($config['load_anon_lastread'] || $user->data['is_registered'])
{
- $tracking = (isset($_COOKIE[$config['cookie_name'] . '_track'])) ? ((STRIP) ? stripslashes($_COOKIE[$config['cookie_name'] . '_track']) : $_COOKIE[$config['cookie_name'] . '_track']) : '';
+ $tracking = $request->variable($config['cookie_name'] . '_track', '', true, \phpbb\request\request_interface::COOKIE);
$tracking = ($tracking) ? tracking_unserialize($tracking) : array();
$topic_id36 = base_convert($topic_id, 10, 36);
@@ -1516,12 +1438,11 @@ function markread($mode, $forum_id = false, $topic_id = false, $post_time = 0, $
$tracking['tf'][$forum_id][$topic_id36] = true;
}
- $post_time = ($post_time) ? $post_time : time();
$tracking['t'][$topic_id36] = base_convert($post_time - $config['board_startdate'], 10, 36);
// If the cookie grows larger than 10000 characters we will remove the smallest value
// This can result in old topics being unread - but most of the time it should be accurate...
- if (isset($_COOKIE[$config['cookie_name'] . '_track']) && strlen($_COOKIE[$config['cookie_name'] . '_track']) > 10000)
+ if (strlen($request->variable($config['cookie_name'] . '_track', '', true, \phpbb\request\request_interface::COOKIE)) > 10000)
{
//echo 'Cookie grown too large' . print_r($tracking, true);
@@ -1552,7 +1473,12 @@ function markread($mode, $forum_id = false, $topic_id = false, $post_time = 0, $
if ($user->data['is_registered'])
{
$user->data['user_lastmark'] = intval(base_convert(max($time_keys) + $config['board_startdate'], 36, 10));
- $db->sql_query('UPDATE ' . USERS_TABLE . ' SET user_lastmark = ' . $user->data['user_lastmark'] . " WHERE user_id = {$user->data['user_id']}");
+
+ $sql = 'UPDATE ' . USERS_TABLE . "
+ SET user_lastmark = $post_time
+ WHERE user_id = {$user->data['user_id']}
+ AND mark_time < $post_time";
+ $db->sql_query($sql);
}
else
{
@@ -1560,8 +1486,8 @@ function markread($mode, $forum_id = false, $topic_id = false, $post_time = 0, $
}
}
- $user->set_cookie('track', tracking_serialize($tracking), time() + 31536000);
- $_COOKIE[$config['cookie_name'] . '_track'] = (STRIP) ? addslashes(tracking_serialize($tracking)) : tracking_serialize($tracking);
+ $user->set_cookie('track', tracking_serialize($tracking), $post_time + 31536000);
+ $request->overwrite($config['cookie_name'] . '_track', tracking_serialize($tracking), \phpbb\request\request_interface::COOKIE);
}
return;
@@ -1582,7 +1508,7 @@ function markread($mode, $forum_id = false, $topic_id = false, $post_time = 0, $
$sql_ary = array(
'user_id' => (int) $use_user_id,
'topic_id' => (int) $topic_id,
- 'topic_posted' => 1
+ 'topic_posted' => 1,
);
$db->sql_query('INSERT INTO ' . TOPICS_POSTED_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary));
@@ -1622,35 +1548,6 @@ function get_topic_tracking($forum_id, $topic_ids, &$rowset, $forum_mark_time, $
{
$mark_time = array();
- // Get global announcement info
- if ($global_announce_list && sizeof($global_announce_list))
- {
- if (!isset($forum_mark_time[0]))
- {
- global $db;
-
- $sql = 'SELECT mark_time
- FROM ' . FORUMS_TRACK_TABLE . "
- WHERE user_id = {$user->data['user_id']}
- AND forum_id = 0";
- $result = $db->sql_query($sql);
- $row = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
-
- if ($row)
- {
- $mark_time[0] = $row['mark_time'];
- }
- }
- else
- {
- if ($forum_mark_time[0] !== false)
- {
- $mark_time[0] = $forum_mark_time[0];
- }
- }
- }
-
if (!empty($forum_mark_time[$forum_id]) && $forum_mark_time[$forum_id] !== false)
{
$mark_time[$forum_id] = $forum_mark_time[$forum_id];
@@ -1660,14 +1557,7 @@ function get_topic_tracking($forum_id, $topic_ids, &$rowset, $forum_mark_time, $
foreach ($topic_ids as $topic_id)
{
- if ($global_announce_list && isset($global_announce_list[$topic_id]))
- {
- $last_read[$topic_id] = (isset($mark_time[0])) ? $mark_time[0] : $user_lastmark;
- }
- else
- {
- $last_read[$topic_id] = $user_lastmark;
- }
+ $last_read[$topic_id] = $user_lastmark;
}
}
@@ -1679,7 +1569,7 @@ function get_topic_tracking($forum_id, $topic_ids, &$rowset, $forum_mark_time, $
*/
function get_complete_topic_tracking($forum_id, $topic_ids, $global_announce_list = false)
{
- global $config, $user;
+ global $config, $user, $request;
$last_read = array();
@@ -1711,8 +1601,7 @@ function get_complete_topic_tracking($forum_id, $topic_ids, $global_announce_lis
$sql = 'SELECT forum_id, mark_time
FROM ' . FORUMS_TRACK_TABLE . "
WHERE user_id = {$user->data['user_id']}
- AND forum_id " .
- (($global_announce_list && sizeof($global_announce_list)) ? "IN (0, $forum_id)" : "= $forum_id");
+ AND forum_id = $forum_id";
$result = $db->sql_query($sql);
$mark_time = array();
@@ -1726,14 +1615,7 @@ function get_complete_topic_tracking($forum_id, $topic_ids, $global_announce_lis
foreach ($topic_ids as $topic_id)
{
- if ($global_announce_list && isset($global_announce_list[$topic_id]))
- {
- $last_read[$topic_id] = (isset($mark_time[0])) ? $mark_time[0] : $user_lastmark;
- }
- else
- {
- $last_read[$topic_id] = $user_lastmark;
- }
+ $last_read[$topic_id] = $user_lastmark;
}
}
}
@@ -1743,7 +1625,7 @@ function get_complete_topic_tracking($forum_id, $topic_ids, $global_announce_lis
if (!isset($tracking_topics) || !sizeof($tracking_topics))
{
- $tracking_topics = (isset($_COOKIE[$config['cookie_name'] . '_track'])) ? ((STRIP) ? stripslashes($_COOKIE[$config['cookie_name'] . '_track']) : $_COOKIE[$config['cookie_name'] . '_track']) : '';
+ $tracking_topics = $request->variable($config['cookie_name'] . '_track', '', true, \phpbb\request\request_interface::COOKIE);
$tracking_topics = ($tracking_topics) ? tracking_unserialize($tracking_topics) : array();
}
@@ -1771,13 +1653,6 @@ function get_complete_topic_tracking($forum_id, $topic_ids, $global_announce_lis
if (sizeof($topic_ids))
{
$mark_time = array();
- if ($global_announce_list && sizeof($global_announce_list))
- {
- if (isset($tracking_topics['f'][0]))
- {
- $mark_time[0] = base_convert($tracking_topics['f'][0], 36, 10) + $config['board_startdate'];
- }
- }
if (isset($tracking_topics['f'][$forum_id]))
{
@@ -1788,14 +1663,7 @@ function get_complete_topic_tracking($forum_id, $topic_ids, $global_announce_lis
foreach ($topic_ids as $topic_id)
{
- if ($global_announce_list && isset($global_announce_list[$topic_id]))
- {
- $last_read[$topic_id] = (isset($mark_time[0])) ? $mark_time[0] : $user_lastmark;
- }
- else
- {
- $last_read[$topic_id] = $user_lastmark;
- }
+ $last_read[$topic_id] = $user_lastmark;
}
}
}
@@ -1817,6 +1685,7 @@ function get_complete_topic_tracking($forum_id, $topic_ids, $global_announce_lis
function get_unread_topics($user_id = false, $sql_extra = '', $sql_sort = '', $sql_limit = 1001, $sql_limit_offset = 0)
{
global $config, $db, $user;
+ global $phpbb_dispatcher;
$user_id = ($user_id === false) ? (int) $user->data['user_id'] : (int) $user_id;
@@ -1825,7 +1694,7 @@ function get_unread_topics($user_id = false, $sql_extra = '', $sql_sort = '', $s
if (empty($sql_sort))
{
- $sql_sort = 'ORDER BY t.topic_last_post_time DESC';
+ $sql_sort = 'ORDER BY t.topic_last_post_time DESC, t.topic_last_post_id DESC';
}
if ($config['load_db_lastread'] && $user->data['is_registered'])
@@ -1860,6 +1729,24 @@ function get_unread_topics($user_id = false, $sql_extra = '', $sql_sort = '', $s
$sql_sort",
);
+ /**
+ * Change SQL query for fetching unread topics data
+ *
+ * @event core.get_unread_topics_modify_sql
+ * @var array sql_array Fully assembled SQL query with keys SELECT, FROM, LEFT_JOIN, WHERE
+ * @var int last_mark User's last_mark time
+ * @var string sql_extra Extra WHERE SQL statement
+ * @var string sql_sort ORDER BY SQL sorting statement
+ * @since 3.1.4-RC1
+ */
+ $vars = array(
+ 'sql_array',
+ 'last_mark',
+ 'sql_extra',
+ 'sql_sort',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.get_unread_topics_modify_sql', compact($vars)));
+
$sql = $db->sql_build_query('SELECT', $sql_array);
$result = $db->sql_query_limit($sql, $sql_limit, $sql_limit_offset);
@@ -1943,7 +1830,7 @@ function get_unread_topics($user_id = false, $sql_extra = '', $sql_sort = '', $s
*/
function update_forum_tracking_info($forum_id, $forum_last_post_time, $f_mark_time = false, $mark_time_forum = false)
{
- global $db, $tracking_topics, $user, $config, $auth;
+ global $db, $tracking_topics, $user, $config, $auth, $request, $phpbb_container;
// Determine the users last forum mark time if not given.
if ($mark_time_forum === false)
@@ -1954,7 +1841,7 @@ function update_forum_tracking_info($forum_id, $forum_last_post_time, $f_mark_ti
}
else if ($config['load_anon_lastread'] || $user->data['is_registered'])
{
- $tracking_topics = (isset($_COOKIE[$config['cookie_name'] . '_track'])) ? ((STRIP) ? stripslashes($_COOKIE[$config['cookie_name'] . '_track']) : $_COOKIE[$config['cookie_name'] . '_track']) : '';
+ $tracking_topics = $request->variable($config['cookie_name'] . '_track', '', true, \phpbb\request\request_interface::COOKIE);
$tracking_topics = ($tracking_topics) ? tracking_unserialize($tracking_topics) : array();
if (!$user->data['is_registered'])
@@ -1968,7 +1855,7 @@ function update_forum_tracking_info($forum_id, $forum_last_post_time, $f_mark_ti
// Handle update of unapproved topics info.
// Only update for moderators having m_approve permission for the forum.
- $sql_update_unapproved = ($auth->acl_get('m_approve', $forum_id)) ? '': 'AND t.topic_approved = 1';
+ $phpbb_content_visibility = $phpbb_container->get('content.visibility');
// Check the forum for any left unread topics.
// If there are none, we mark the forum as read.
@@ -1988,8 +1875,8 @@ function update_forum_tracking_info($forum_id, $forum_last_post_time, $f_mark_ti
AND tt.user_id = ' . $user->data['user_id'] . ')
WHERE t.forum_id = ' . $forum_id . '
AND t.topic_last_post_time > ' . $mark_time_forum . '
- AND t.topic_moved_id = 0 ' .
- $sql_update_unapproved . '
+ AND t.topic_moved_id = 0
+ AND ' . $phpbb_content_visibility->get_visibility_sql('topic', $forum_id, 't.') . '
AND (tt.topic_id IS NULL
OR tt.mark_time < t.topic_last_post_time)';
$result = $db->sql_query_limit($sql, 1);
@@ -2013,8 +1900,8 @@ function update_forum_tracking_info($forum_id, $forum_last_post_time, $f_mark_ti
FROM ' . TOPICS_TABLE . ' t
WHERE t.forum_id = ' . $forum_id . '
AND t.topic_last_post_time > ' . $mark_time_forum . '
- AND t.topic_moved_id = 0 ' .
- $sql_update_unapproved;
+ AND t.topic_moved_id = 0
+ AND ' . $phpbb_content_visibility->get_visibility_sql('topic', $forum_id, 't.');
$result = $db->sql_query($sql);
$check_forum = $tracking_topics['tf'][$forum_id];
@@ -2168,111 +2055,6 @@ function tracking_unserialize($string, $max_depth = 3)
return $level;
}
-// Pagination functions
-
-/**
-* Pagination routine, generates page number sequence
-* tpl_prefix is for using different pagination blocks at one page
-*/
-function generate_pagination($base_url, $num_items, $per_page, $start_item, $add_prevnext_text = false, $tpl_prefix = '')
-{
- global $template, $user;
-
- // Make sure $per_page is a valid value
- $per_page = ($per_page <= 0) ? 1 : $per_page;
-
- $seperator = '<span class="page-sep">' . $user->lang['COMMA_SEPARATOR'] . '</span>';
- $total_pages = ceil($num_items / $per_page);
-
- if ($total_pages == 1 || !$num_items)
- {
- return false;
- }
-
- $on_page = floor($start_item / $per_page) + 1;
- $url_delim = (strpos($base_url, '?') === false) ? '?' : ((strpos($base_url, '?') === strlen($base_url) - 1) ? '' : '&amp;');
-
- $page_string = ($on_page == 1) ? '<strong>1</strong>' : '<a href="' . $base_url . '">1</a>';
-
- if ($total_pages > 5)
- {
- $start_cnt = min(max(1, $on_page - 4), $total_pages - 5);
- $end_cnt = max(min($total_pages, $on_page + 4), 6);
-
- $page_string .= ($start_cnt > 1) ? '<span class="page-dots"> ... </span>' : $seperator;
-
- for ($i = $start_cnt + 1; $i < $end_cnt; $i++)
- {
- $page_string .= ($i == $on_page) ? '<strong>' . $i . '</strong>' : '<a href="' . $base_url . "{$url_delim}start=" . (($i - 1) * $per_page) . '">' . $i . '</a>';
- if ($i < $end_cnt - 1)
- {
- $page_string .= $seperator;
- }
- }
-
- $page_string .= ($end_cnt < $total_pages) ? '<span class="page-dots"> ... </span>' : $seperator;
- }
- else
- {
- $page_string .= $seperator;
-
- for ($i = 2; $i < $total_pages; $i++)
- {
- $page_string .= ($i == $on_page) ? '<strong>' . $i . '</strong>' : '<a href="' . $base_url . "{$url_delim}start=" . (($i - 1) * $per_page) . '">' . $i . '</a>';
- if ($i < $total_pages)
- {
- $page_string .= $seperator;
- }
- }
- }
-
- $page_string .= ($on_page == $total_pages) ? '<strong>' . $total_pages . '</strong>' : '<a href="' . $base_url . "{$url_delim}start=" . (($total_pages - 1) * $per_page) . '">' . $total_pages . '</a>';
-
- if ($add_prevnext_text)
- {
- if ($on_page != 1)
- {
- $page_string = '<a href="' . $base_url . "{$url_delim}start=" . (($on_page - 2) * $per_page) . '">' . $user->lang['PREVIOUS'] . '</a>&nbsp;&nbsp;' . $page_string;
- }
-
- if ($on_page != $total_pages)
- {
- $page_string .= '&nbsp;&nbsp;<a href="' . $base_url . "{$url_delim}start=" . ($on_page * $per_page) . '">' . $user->lang['NEXT'] . '</a>';
- }
- }
-
- $template->assign_vars(array(
- $tpl_prefix . 'BASE_URL' => $base_url,
- 'A_' . $tpl_prefix . 'BASE_URL' => addslashes($base_url),
- $tpl_prefix . 'PER_PAGE' => $per_page,
-
- $tpl_prefix . 'PREVIOUS_PAGE' => ($on_page == 1) ? '' : $base_url . "{$url_delim}start=" . (($on_page - 2) * $per_page),
- $tpl_prefix . 'NEXT_PAGE' => ($on_page == $total_pages) ? '' : $base_url . "{$url_delim}start=" . ($on_page * $per_page),
- $tpl_prefix . 'TOTAL_PAGES' => $total_pages,
- ));
-
- return $page_string;
-}
-
-/**
-* Return current page (pagination)
-*/
-function on_page($num_items, $per_page, $start)
-{
- global $template, $user;
-
- // Make sure $per_page is a valid value
- $per_page = ($per_page <= 0) ? 1 : $per_page;
-
- $on_page = floor($start / $per_page) + 1;
-
- $template->assign_vars(array(
- 'ON_PAGE' => $on_page)
- );
-
- return sprintf($user->lang['PAGE_OF'], $on_page, max(ceil($num_items / $per_page), 1));
-}
-
// Server functions (building urls, redirecting...)
/**
@@ -2283,6 +2065,9 @@ function on_page($num_items, $per_page, $start)
* @param mixed $params String or array of additional url parameters
* @param bool $is_amp Is url using &amp; (true) or & (false)
* @param string $session_id Possibility to use a custom session id instead of the global one
+* @param bool $is_route Is url generated by a route.
+*
+* @return string The corrected url.
*
* Examples:
* <code>
@@ -2293,9 +2078,10 @@ function on_page($num_items, $per_page, $start)
* </code>
*
*/
-function append_sid($url, $params = false, $is_amp = true, $session_id = false)
+function append_sid($url, $params = false, $is_amp = true, $session_id = false, $is_route = false)
{
- global $_SID, $_EXTRA_URL, $phpbb_hook;
+ global $_SID, $_EXTRA_URL, $phpbb_hook, $phpbb_path_helper;
+ global $phpbb_dispatcher;
if ($params === '' || (is_array($params) && empty($params)))
{
@@ -2303,6 +2089,46 @@ function append_sid($url, $params = false, $is_amp = true, $session_id = false)
$params = false;
}
+ // Update the root path with the correct relative web path
+ if (!$is_route && $phpbb_path_helper instanceof \phpbb\path_helper)
+ {
+ $url = $phpbb_path_helper->update_web_root_path($url);
+ }
+
+ $append_sid_overwrite = false;
+
+ /**
+ * This event can either supplement or override the append_sid() function
+ *
+ * To override this function, the event must set $append_sid_overwrite to
+ * the new URL value, which will be returned following the event
+ *
+ * @event core.append_sid
+ * @var string url The url the session id needs
+ * to be appended to (can have
+ * params)
+ * @var mixed params String or array of additional
+ * url parameters
+ * @var bool is_amp Is url using &amp; (true) or
+ * & (false)
+ * @var bool|string session_id Possibility to use a custom
+ * session id (string) instead of
+ * the global one (false)
+ * @var bool|string append_sid_overwrite Overwrite function (string
+ * URL) or not (false)
+ * @var bool is_route Is url generated by a route.
+ * @since 3.1.0-a1
+ */
+ $vars = array('url', 'params', 'is_amp', 'session_id', 'append_sid_overwrite', 'is_route');
+ extract($phpbb_dispatcher->trigger_event('core.append_sid', compact($vars)));
+
+ if ($append_sid_overwrite)
+ {
+ return $append_sid_overwrite;
+ }
+
+ // The following hook remains for backwards compatibility, though use of
+ // the event above is preferred.
// Developers using the hook function need to globalise the $_SID and $_EXTRA_URL on their own and also handle it appropriately.
// They could mimic most of what is within this function
if (!empty($phpbb_hook) && $phpbb_hook->call_hook(__FUNCTION__, $url, $params, $is_amp, $session_id))
@@ -2404,10 +2230,9 @@ function append_sid($url, $params = false, $is_amp = true, $session_id = false)
*/
function generate_board_url($without_script_path = false)
{
- global $config, $user;
+ global $config, $user, $request;
$server_name = $user->host;
- $server_port = (!empty($_SERVER['SERVER_PORT'])) ? (int) $_SERVER['SERVER_PORT'] : (int) getenv('SERVER_PORT');
// Forcing server vars is the only way to specify/override the protocol
if ($config['force_server_vars'] || !$server_name)
@@ -2422,8 +2247,15 @@ function generate_board_url($without_script_path = false)
}
else
{
+ $server_port = $request->server('SERVER_PORT', 0);
+ $forwarded_proto = $request->server('HTTP_X_FORWARDED_PROTO');
+
+ if (!empty($forwarded_proto) && $forwarded_proto === 'https')
+ {
+ $server_port = 443;
+ }
// Do not rely on cookie_secure, users seem to think that it means a secured cookie instead of an encrypted connection
- $cookie_secure = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 1 : 0;
+ $cookie_secure = $request->is_secure() ? 1 : 0;
$url = (($cookie_secure) ? 'https://' : 'http://') . $server_name;
$script_path = $user->page['root_script_path'];
@@ -2462,7 +2294,7 @@ function generate_board_url($without_script_path = false)
*/
function redirect($url, $return = false, $disable_cd_check = false)
{
- global $db, $cache, $config, $user, $phpbb_root_path;
+ global $db, $cache, $config, $user, $phpbb_root_path, $phpbb_filesystem, $phpbb_path_helper, $phpEx, $phpbb_dispatcher;
$failover_flag = false;
@@ -2471,11 +2303,6 @@ function redirect($url, $return = false, $disable_cd_check = false)
$user->add_lang('common');
}
- if (!$return)
- {
- garbage_collection();
- }
-
// Make sure no &amp;'s are in, this will break the redirect
$url = str_replace('&amp;', '&', $url);
@@ -2492,7 +2319,7 @@ function redirect($url, $return = false, $disable_cd_check = false)
// Attention: only able to redirect within the same domain if $disable_cd_check is false (yourdomain.com -> www.yourdomain.com will not work)
if (!$disable_cd_check && $url_parts['host'] !== $user->host)
{
- trigger_error('Tried to redirect to potentially insecure url.', E_USER_ERROR);
+ trigger_error('INSECURE_REDIRECT', E_USER_ERROR);
}
}
else if ($url[0] == '/')
@@ -2505,90 +2332,40 @@ function redirect($url, $return = false, $disable_cd_check = false)
// Relative uri
$pathinfo = pathinfo($url);
- if (!$disable_cd_check && !file_exists($pathinfo['dirname'] . '/'))
+ // Is the uri pointing to the current directory?
+ if ($pathinfo['dirname'] == '.')
{
- $url = str_replace('../', '', $url);
- $pathinfo = pathinfo($url);
+ $url = str_replace('./', '', $url);
- if (!file_exists($pathinfo['dirname'] . '/'))
+ // Strip / from the beginning
+ if ($url && substr($url, 0, 1) == '/')
{
- // fallback to "last known user page"
- // at least this way we know the user does not leave the phpBB root
- $url = generate_board_url() . '/' . $user->page['page'];
- $failover_flag = true;
+ $url = substr($url, 1);
}
}
- if (!$failover_flag)
- {
- // Is the uri pointing to the current directory?
- if ($pathinfo['dirname'] == '.')
- {
- $url = str_replace('./', '', $url);
-
- // Strip / from the beginning
- if ($url && substr($url, 0, 1) == '/')
- {
- $url = substr($url, 1);
- }
-
- if ($user->page['page_dir'])
- {
- $url = generate_board_url() . '/' . $user->page['page_dir'] . '/' . $url;
- }
- else
- {
- $url = generate_board_url() . '/' . $url;
- }
- }
- else
- {
- // Used ./ before, but $phpbb_root_path is working better with urls within another root path
- $root_dirs = explode('/', str_replace('\\', '/', phpbb_realpath($phpbb_root_path)));
- $page_dirs = explode('/', str_replace('\\', '/', phpbb_realpath($pathinfo['dirname'])));
- $intersection = array_intersect_assoc($root_dirs, $page_dirs);
-
- $root_dirs = array_diff_assoc($root_dirs, $intersection);
- $page_dirs = array_diff_assoc($page_dirs, $intersection);
-
- $dir = str_repeat('../', sizeof($root_dirs)) . implode('/', $page_dirs);
+ $url = $phpbb_path_helper->remove_web_root_path($url);
- // Strip / from the end
- if ($dir && substr($dir, -1, 1) == '/')
- {
- $dir = substr($dir, 0, -1);
- }
-
- // Strip / from the beginning
- if ($dir && substr($dir, 0, 1) == '/')
- {
- $dir = substr($dir, 1);
- }
-
- $url = str_replace($pathinfo['dirname'] . '/', '', $url);
-
- // Strip / from the beginning
- if (substr($url, 0, 1) == '/')
- {
- $url = substr($url, 1);
- }
-
- $url = (!empty($dir) ? $dir . '/' : '') . $url;
- $url = generate_board_url() . '/' . $url;
- }
+ if ($user->page['page_dir'])
+ {
+ $url = $user->page['page_dir'] . '/' . $url;
}
+
+ $url = generate_board_url() . '/' . $url;
}
- // Make sure we don't redirect to external URLs
+ // Clean URL and check if we go outside the forum directory
+ $url = $phpbb_path_helper->clean_url($url);
+
if (!$disable_cd_check && strpos($url, generate_board_url(true) . '/') !== 0)
{
- trigger_error('Tried to redirect to potentially insecure url.', E_USER_ERROR);
+ trigger_error('INSECURE_REDIRECT', E_USER_ERROR);
}
// Make sure no linebreaks are there... to prevent http response splitting for PHP < 4.4.2
if (strpos(urldecode($url), "\n") !== false || strpos(urldecode($url), "\r") !== false || strpos($url, ';') !== false)
{
- trigger_error('Tried to redirect to potentially insecure url.', E_USER_ERROR);
+ trigger_error('INSECURE_REDIRECT', E_USER_ERROR);
}
// Now, also check the protocol and for a valid url the last time...
@@ -2597,23 +2374,40 @@ function redirect($url, $return = false, $disable_cd_check = false)
if ($url_parts === false || empty($url_parts['scheme']) || !in_array($url_parts['scheme'], $allowed_protocols))
{
- trigger_error('Tried to redirect to potentially insecure url.', E_USER_ERROR);
+ trigger_error('INSECURE_REDIRECT', E_USER_ERROR);
}
+ /**
+ * Execute code and/or overwrite redirect()
+ *
+ * @event core.functions.redirect
+ * @var string url The url
+ * @var bool return If true, do not redirect but return the sanitized URL.
+ * @var bool disable_cd_check If true, redirect() will redirect to an external domain. If false, the redirect point to the boards url if it does not match the current domain.
+ * @since 3.1.0-RC3
+ */
+ $vars = array('url', 'return', 'disable_cd_check');
+ extract($phpbb_dispatcher->trigger_event('core.functions.redirect', compact($vars)));
+
if ($return)
{
return $url;
}
+ else
+ {
+ garbage_collection();
+ }
// Redirect via an HTML form for PITA webservers
- if (@preg_match('#Microsoft|WebSTAR|Xitami#', getenv('SERVER_SOFTWARE')))
+ if (@preg_match('#WebSTAR|Xitami#', getenv('SERVER_SOFTWARE')))
{
header('Refresh: 0; URL=' . $url);
- echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">';
- echo '<html xmlns="http://www.w3.org/1999/xhtml" dir="' . $user->lang['DIRECTION'] . '" lang="' . $user->lang['USER_LANG'] . '" xml:lang="' . $user->lang['USER_LANG'] . '">';
+ echo '<!DOCTYPE html>';
+ echo '<html dir="' . $user->lang['DIRECTION'] . '" lang="' . $user->lang['USER_LANG'] . '">';
echo '<head>';
- echo '<meta http-equiv="content-type" content="text/html; charset=utf-8" />';
+ echo '<meta charset="utf-8">';
+ echo '<meta http-equiv="X-UA-Compatible" content="IE=edge">';
echo '<meta http-equiv="refresh" content="0; url=' . str_replace('&', '&amp;', $url) . '" />';
echo '<title>' . $user->lang['REDIRECT'] . '</title>';
echo '</head>';
@@ -2663,77 +2457,23 @@ function reapply_sid($url)
*/
function build_url($strip_vars = false)
{
- global $user, $phpbb_root_path;
+ global $config, $user, $phpbb_path_helper;
- // Append SID
- $redirect = append_sid($user->page['page'], false, false);
+ $page = $phpbb_path_helper->get_valid_page($user->page['page'], $config['enable_mod_rewrite']);
- // Add delimiter if not there...
- if (strpos($redirect, '?') === false)
- {
- $redirect .= '?';
- }
+ // Append SID
+ $redirect = append_sid($page, false, false);
- // Strip vars...
- if ($strip_vars !== false && strpos($redirect, '?') !== false)
+ if ($strip_vars !== false)
{
- if (!is_array($strip_vars))
- {
- $strip_vars = array($strip_vars);
- }
-
- $query = $_query = array();
-
- $args = substr($redirect, strpos($redirect, '?') + 1);
- $args = ($args) ? explode('&', $args) : array();
- $redirect = substr($redirect, 0, strpos($redirect, '?'));
-
- foreach ($args as $argument)
- {
- $arguments = explode('=', $argument);
- $key = $arguments[0];
- unset($arguments[0]);
-
- if ($key === '')
- {
- continue;
- }
-
- $query[$key] = implode('=', $arguments);
- }
-
- // Strip the vars off
- foreach ($strip_vars as $strip)
- {
- if (isset($query[$strip]))
- {
- unset($query[$strip]);
- }
- }
-
- // Glue the remaining parts together... already urlencoded
- foreach ($query as $key => $value)
- {
- $_query[] = $key . '=' . $value;
- }
- $query = implode('&', $_query);
-
- $redirect .= ($query) ? '?' . $query : '';
+ $redirect = $phpbb_path_helper->strip_url_params($redirect, $strip_vars, false);
}
-
- // We need to be cautious here.
- // On some situations, the redirect path is an absolute URL, sometimes a relative path
- // For a relative path, let's prefix it with $phpbb_root_path to point to the correct location,
- // else we use the URL directly.
- $url_parts = @parse_url($redirect);
-
- // URL
- if ($url_parts !== false && !empty($url_parts['scheme']) && !empty($url_parts['host']))
+ else
{
- return str_replace('&', '&amp;', $redirect);
+ $redirect = str_replace('&', '&amp;', $redirect);
}
- return $phpbb_root_path . str_replace('&', '&amp;', $redirect);
+ return $redirect . ((strpos($redirect, '?') === false) ? '?' : '');
}
/**
@@ -2746,15 +2486,25 @@ function build_url($strip_vars = false)
*/
function meta_refresh($time, $url, $disable_cd_check = false)
{
- global $template;
+ global $template, $refresh_data, $request;
$url = redirect($url, true, $disable_cd_check);
- $url = str_replace('&', '&amp;', $url);
+ if ($request->is_ajax())
+ {
+ $refresh_data = array(
+ 'time' => $time,
+ 'url' => $url,
+ );
+ }
+ else
+ {
+ // For XHTML compatibility we change back & to &amp;
+ $url = str_replace('&', '&amp;', $url);
- // For XHTML compatibility we change back & to &amp;
- $template->assign_vars(array(
- 'META' => '<meta http-equiv="refresh" content="' . $time . '; url=' . $url . '" />')
- );
+ $template->assign_vars(array(
+ 'META' => '<meta http-equiv="refresh" content="' . $time . '; url=' . $url . '" />')
+ );
+ }
return $url;
}
@@ -2788,18 +2538,41 @@ function send_status_line($code, $message)
}
else
{
- if (!empty($_SERVER['SERVER_PROTOCOL']) && is_string($_SERVER['SERVER_PROTOCOL']) && preg_match('#^HTTP/[0-9]\.[0-9]$#', $_SERVER['SERVER_PROTOCOL']))
- {
- $version = $_SERVER['SERVER_PROTOCOL'];
- }
- else
- {
- $version = 'HTTP/1.0';
- }
+ $version = phpbb_request_http_version();
header("$version $code $message", true, $code);
}
}
+/**
+* Returns the HTTP version used in the current request.
+*
+* Handles the case of being called before $request is present,
+* in which case it falls back to the $_SERVER superglobal.
+*
+* @return string HTTP version
+*/
+function phpbb_request_http_version()
+{
+ global $request;
+
+ $version = '';
+ if ($request && $request->server('SERVER_PROTOCOL'))
+ {
+ $version = $request->server('SERVER_PROTOCOL');
+ }
+ else if (isset($_SERVER['SERVER_PROTOCOL']))
+ {
+ $version = $_SERVER['SERVER_PROTOCOL'];
+ }
+
+ if (!empty($version) && is_string($version) && preg_match('#^HTTP/[0-9]\.[0-9]$#', $version))
+ {
+ return $version;
+ }
+
+ return 'HTTP/1.0';
+}
+
//Form validation
@@ -2836,10 +2609,11 @@ function check_link_hash($token, $link_name)
/**
* Add a secret token to the form (requires the S_FORM_TOKEN template variable)
* @param string $form_name The name of the form; has to match the name used in check_form_key, otherwise no restrictions apply
+* @param string $template_variable_suffix A string that is appended to the name of the template variable to which the form elements are assigned
*/
-function add_form_key($form_name)
+function add_form_key($form_name, $template_variable_suffix = '')
{
- global $config, $template, $user;
+ global $config, $template, $user, $phpbb_dispatcher;
$now = time();
$token_sid = ($user->data['user_id'] == ANONYMOUS && !empty($config['form_token_sid_guests'])) ? $user->session_id : '';
@@ -2850,21 +2624,45 @@ function add_form_key($form_name)
'form_token' => $token,
));
- $template->assign_vars(array(
- 'S_FORM_TOKEN' => $s_fields,
- ));
+ /**
+ * Perform additional actions on creation of the form token
+ *
+ * @event core.add_form_key
+ * @var string form_name The form name
+ * @var int now Current time timestamp
+ * @var string s_fields Generated hidden fields
+ * @var string token Form token
+ * @var string token_sid User session ID
+ * @var string template_variable_suffix The string that is appended to template variable name
+ *
+ * @since 3.1.0-RC3
+ * @changed 3.1.11-RC1 Added template_variable_suffix
+ */
+ $vars = array(
+ 'form_name',
+ 'now',
+ 's_fields',
+ 'token',
+ 'token_sid',
+ 'template_variable_suffix',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.add_form_key', compact($vars)));
+
+ $template->assign_var('S_FORM_TOKEN' . $template_variable_suffix, $s_fields);
}
/**
-* Check the form key. Required for all altering actions not secured by confirm_box
-* @param string $form_name The name of the form; has to match the name used in add_form_key, otherwise no restrictions apply
-* @param int $timespan The maximum acceptable age for a submitted form in seconds. Defaults to the config setting.
-* @param string $return_page The address for the return link
-* @param bool $trigger If true, the function will triger an error when encountering an invalid form
-*/
-function check_form_key($form_name, $timespan = false, $return_page = '', $trigger = false)
+ * Check the form key. Required for all altering actions not secured by confirm_box
+ *
+ * @param string $form_name The name of the form; has to match the name used
+ * in add_form_key, otherwise no restrictions apply
+ * @param int $timespan The maximum acceptable age for a submitted form
+ * in seconds. Defaults to the config setting.
+ * @return bool True, if the form key was valid, false otherwise
+ */
+function check_form_key($form_name, $timespan = false)
{
- global $config, $user;
+ global $config, $request, $user;
if ($timespan === false)
{
@@ -2872,10 +2670,10 @@ function check_form_key($form_name, $timespan = false, $return_page = '', $trigg
$timespan = ($config['form_token_lifetime'] == -1) ? -1 : max(30, $config['form_token_lifetime']);
}
- if (isset($_POST['creation_time']) && isset($_POST['form_token']))
+ if ($request->is_set_post('creation_time') && $request->is_set_post('form_token'))
{
- $creation_time = abs(request_var('creation_time', 0));
- $token = request_var('form_token', '');
+ $creation_time = abs($request->variable('creation_time', 0));
+ $token = $request->variable('form_token', '');
$diff = time() - $creation_time;
@@ -2892,11 +2690,6 @@ function check_form_key($form_name, $timespan = false, $return_page = '', $trigg
}
}
- if ($trigger)
- {
- trigger_error($user->lang['FORM_INVALID'] . $return_page);
- }
-
return false;
}
@@ -2915,23 +2708,15 @@ function check_form_key($form_name, $timespan = false, $return_page = '', $trigg
*/
function confirm_box($check, $title = '', $hidden = '', $html_body = 'confirm_body.html', $u_action = '')
{
- global $user, $template, $db;
- global $phpEx, $phpbb_root_path;
+ global $user, $template, $db, $request;
+ global $config, $phpbb_path_helper;
if (isset($_POST['cancel']))
{
return false;
}
- $confirm = false;
- if (isset($_POST['confirm']))
- {
- // language frontier
- if ($_POST['confirm'] === $user->lang['YES'])
- {
- $confirm = true;
- }
- }
+ $confirm = ($user->lang['YES'] === $request->variable('confirm', '', true, \phpbb\request\request_interface::POST));
if ($check && $confirm)
{
@@ -2971,7 +2756,7 @@ function confirm_box($check, $title = '', $hidden = '', $html_body = 'confirm_bo
}
else
{
- page_header(((!isset($user->lang[$title])) ? $user->lang['CONFIRM'] : $user->lang[$title]), false);
+ page_header((!isset($user->lang[$title])) ? $user->lang['CONFIRM'] : $user->lang[$title]);
}
$template->set_filenames(array(
@@ -2986,23 +2771,39 @@ function confirm_box($check, $title = '', $hidden = '', $html_body = 'confirm_bo
}
// re-add sid / transform & to &amp; for user->page (user->page is always using &)
- $use_page = ($u_action) ? $phpbb_root_path . $u_action : $phpbb_root_path . str_replace('&', '&amp;', $user->page['page']);
- $u_action = reapply_sid($use_page);
+ $use_page = ($u_action) ? $u_action : str_replace('&', '&amp;', $user->page['page']);
+ $u_action = reapply_sid($phpbb_path_helper->get_valid_page($use_page, $config['enable_mod_rewrite']));
$u_action .= ((strpos($u_action, '?') === false) ? '?' : '&amp;') . 'confirm_key=' . $confirm_key;
$template->assign_vars(array(
- 'MESSAGE_TITLE' => (!isset($user->lang[$title])) ? $user->lang['CONFIRM'] : $user->lang[$title],
+ 'MESSAGE_TITLE' => (!isset($user->lang[$title])) ? $user->lang['CONFIRM'] : $user->lang($title, 1),
'MESSAGE_TEXT' => (!isset($user->lang[$title . '_CONFIRM'])) ? $title : $user->lang[$title . '_CONFIRM'],
'YES_VALUE' => $user->lang['YES'],
'S_CONFIRM_ACTION' => $u_action,
- 'S_HIDDEN_FIELDS' => $hidden . $s_hidden_fields)
- );
+ 'S_HIDDEN_FIELDS' => $hidden . $s_hidden_fields,
+ 'S_AJAX_REQUEST' => $request->is_ajax(),
+ ));
$sql = 'UPDATE ' . USERS_TABLE . " SET user_last_confirm_key = '" . $db->sql_escape($confirm_key) . "'
WHERE user_id = " . $user->data['user_id'];
$db->sql_query($sql);
+ if ($request->is_ajax())
+ {
+ $u_action .= '&confirm_uid=' . $user->data['user_id'] . '&sess=' . $user->session_id . '&sid=' . $user->session_id;
+ $json_response = new \phpbb\json_response;
+ $json_response->send(array(
+ 'MESSAGE_BODY' => $template->assign_display('body'),
+ 'MESSAGE_TITLE' => (!isset($user->lang[$title])) ? $user->lang['CONFIRM'] : $user->lang[$title],
+ 'MESSAGE_TEXT' => (!isset($user->lang[$title . '_CONFIRM'])) ? $title : $user->lang[$title . '_CONFIRM'],
+
+ 'YES_VALUE' => $user->lang['YES'],
+ 'S_CONFIRM_ACTION' => str_replace('&amp;', '&', $u_action), //inefficient, rewrite whole function
+ 'S_HIDDEN_FIELDS' => $hidden . $s_hidden_fields
+ ));
+ }
+
if (defined('IN_ADMIN') && isset($user->data['session_admin']) && $user->data['session_admin'])
{
adm_page_footer();
@@ -3019,11 +2820,7 @@ function confirm_box($check, $title = '', $hidden = '', $html_body = 'confirm_bo
function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = false, $s_display = true)
{
global $db, $user, $template, $auth, $phpEx, $phpbb_root_path, $config;
-
- if (!class_exists('phpbb_captcha_factory'))
- {
- include($phpbb_root_path . 'includes/captcha/captcha_factory.' . $phpEx);
- }
+ global $request, $phpbb_container, $phpbb_dispatcher;
$err = '';
@@ -3033,6 +2830,21 @@ function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = fa
$user->setup();
}
+ /**
+ * This event allows an extension to modify the login process
+ *
+ * @event core.login_box_before
+ * @var string redirect Redirect string
+ * @var string l_explain Explain language string
+ * @var string l_success Success language string
+ * @var bool admin Is admin?
+ * @var bool s_display Display full login form?
+ * @var string err Error string
+ * @since 3.1.9-RC1
+ */
+ $vars = array('redirect', 'l_explain', 'l_success', 'admin', 's_display', 'err');
+ extract($phpbb_dispatcher->trigger_event('core.login_box_before', compact($vars)));
+
// Print out error if user tries to authenticate as an administrator without having the privileges...
if ($admin && !$auth->acl_get('a_'))
{
@@ -3045,7 +2857,7 @@ function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = fa
trigger_error('NO_AUTH_ADMIN');
}
- if (isset($_POST['login']))
+ if (empty($err) && ($request->is_set_post('login') || ($request->is_set('login') && $request->variable('login', '') == 'external')))
{
// Get credential
if ($admin)
@@ -3061,16 +2873,16 @@ function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = fa
trigger_error('NO_AUTH_ADMIN');
}
- $password = request_var('password_' . $credential, '', true);
+ $password = $request->untrimmed_variable('password_' . $credential, '', true);
}
else
{
- $password = request_var('password', '', true);
+ $password = $request->untrimmed_variable('password', '', true);
}
$username = request_var('username', '', true);
- $autologin = (!empty($_POST['autologin'])) ? true : false;
- $viewonline = (!empty($_POST['viewonline'])) ? 0 : 1;
+ $autologin = $request->is_set_post('autologin');
+ $viewonline = (int) !$request->is_set_post('viewonline');
$admin = ($admin) ? 1 : 0;
$viewonline = ($admin) ? $user->data['session_viewonline'] : $viewonline;
@@ -3108,8 +2920,18 @@ function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = fa
if ($result['status'] == LOGIN_SUCCESS)
{
$redirect = request_var('redirect', "{$phpbb_root_path}index.$phpEx");
- $message = ($l_success) ? $l_success : $user->lang['LOGIN_REDIRECT'];
- $l_redirect = ($admin) ? $user->lang['PROCEED_TO_ACP'] : (($redirect === "{$phpbb_root_path}index.$phpEx" || $redirect === "index.$phpEx") ? $user->lang['RETURN_INDEX'] : $user->lang['RETURN_PAGE']);
+
+ /**
+ * This event allows an extension to modify the redirection when a user successfully logs in
+ *
+ * @event core.login_box_redirect
+ * @var string redirect Redirect string
+ * @var bool admin Is admin?
+ * @since 3.1.0-RC5
+ * @changed 3.1.9-RC1 Removed undefined return variable
+ */
+ $vars = array('redirect', 'admin');
+ extract($phpbb_dispatcher->trigger_event('core.login_box_redirect', compact($vars)));
// append/replace SID (may change during the session for AOL users)
$redirect = reapply_sid($redirect);
@@ -3120,8 +2942,7 @@ function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = fa
return;
}
- $redirect = meta_refresh(3, $redirect);
- trigger_error($message . '<br /><br />' . sprintf($l_redirect, '<a href="' . $redirect . '">', '</a>'));
+ redirect($redirect);
}
// Something failed, determine what...
@@ -3133,28 +2954,26 @@ function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = fa
// Special cases... determine
switch ($result['status'])
{
+ case LOGIN_ERROR_PASSWORD_CONVERT:
+ $err = sprintf(
+ $user->lang[$result['error_msg']],
+ ($config['email_enable']) ? '<a href="' . append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=sendpassword') . '">' : '',
+ ($config['email_enable']) ? '</a>' : '',
+ '<a href="' . phpbb_get_board_contact_link($config, $phpbb_root_path, $phpEx) . '">',
+ '</a>'
+ );
+ break;
+
case LOGIN_ERROR_ATTEMPTS:
- $captcha = phpbb_captcha_factory::get_instance($config['captcha_plugin']);
+ $captcha = $phpbb_container->get('captcha.factory')->get_instance($config['captcha_plugin']);
$captcha->init(CONFIRM_LOGIN);
// $captcha->reset();
$template->assign_vars(array(
'CAPTCHA_TEMPLATE' => $captcha->get_template(),
));
-
- $err = $user->lang[$result['error_msg']];
- break;
-
- case LOGIN_ERROR_PASSWORD_CONVERT:
- $err = sprintf(
- $user->lang[$result['error_msg']],
- ($config['email_enable']) ? '<a href="' . append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=sendpassword') . '">' : '',
- ($config['email_enable']) ? '</a>' : '',
- ($config['board_contact']) ? '<a href="mailto:' . htmlspecialchars($config['board_contact']) . '">' : '',
- ($config['board_contact']) ? '</a>' : ''
- );
- break;
+ // no break;
// Username, password, etc...
default:
@@ -3163,11 +2982,24 @@ function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = fa
// Assign admin contact to some error messages
if ($result['error_msg'] == 'LOGIN_ERROR_USERNAME' || $result['error_msg'] == 'LOGIN_ERROR_PASSWORD')
{
- $err = (!$config['board_contact']) ? sprintf($user->lang[$result['error_msg']], '', '') : sprintf($user->lang[$result['error_msg']], '<a href="mailto:' . htmlspecialchars($config['board_contact']) . '">', '</a>');
+ $err = sprintf($user->lang[$result['error_msg']], '<a href="' . append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=contactadmin') . '">', '</a>');
}
break;
}
+
+ /**
+ * This event allows an extension to process when a user fails a login attempt
+ *
+ * @event core.login_box_failed
+ * @var array result Login result data
+ * @var string username User name used to login
+ * @var string password Password used to login
+ * @var string err Error message
+ * @since 3.1.3-RC1
+ */
+ $vars = array('result', 'username', 'password', 'err');
+ extract($phpbb_dispatcher->trigger_event('core.login_box_failed', compact($vars)));
}
// Assign credential for username/password pair
@@ -3187,6 +3019,30 @@ function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = fa
$s_hidden_fields['credential'] = $credential;
}
+ $provider_collection = $phpbb_container->get('auth.provider_collection');
+ $auth_provider = $provider_collection->get_provider();
+
+ $auth_provider_data = $auth_provider->get_login_data();
+ if ($auth_provider_data)
+ {
+ if (isset($auth_provider_data['VARS']))
+ {
+ $template->assign_vars($auth_provider_data['VARS']);
+ }
+
+ if (isset($auth_provider_data['BLOCK_VAR_NAME']))
+ {
+ foreach ($auth_provider_data['BLOCK_VARS'] as $block_vars)
+ {
+ $template->assign_block_vars($auth_provider_data['BLOCK_VAR_NAME'], $block_vars);
+ }
+ }
+
+ $template->assign_vars(array(
+ 'PROVIDER_TEMPLATE_FILE' => $auth_provider_data['TEMPLATE_FILE'],
+ ));
+ }
+
$s_hidden_fields = build_hidden_fields($s_hidden_fields);
$template->assign_vars(array(
@@ -3208,7 +3064,7 @@ function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = fa
'PASSWORD_CREDENTIAL' => ($admin) ? 'password_' . $credential : 'password',
));
- page_header($user->lang['LOGIN'], false);
+ page_header($user->lang['LOGIN']);
$template->set_filenames(array(
'body' => 'login_body.html')
@@ -3223,9 +3079,9 @@ function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = fa
*/
function login_forum_box($forum_data)
{
- global $db, $config, $user, $template, $phpEx;
+ global $db, $phpbb_container, $request, $template, $user, $phpbb_dispatcher;
- $password = request_var('password', '', true);
+ $password = $request->variable('password', '', true);
$sql = 'SELECT forum_id
FROM ' . FORUMS_ACCESS_TABLE . '
@@ -3266,7 +3122,9 @@ function login_forum_box($forum_data)
}
$db->sql_freeresult($result);
- if (phpbb_check_hash($password, $forum_data['forum_password']))
+ $passwords_manager = $phpbb_container->get('passwords.manager');
+
+ if ($passwords_manager->check($password, $forum_data['forum_password']))
{
$sql_ary = array(
'forum_id' => (int) $forum_data['forum_id'],
@@ -3282,7 +3140,18 @@ function login_forum_box($forum_data)
$template->assign_var('LOGIN_ERROR', $user->lang['WRONG_PASSWORD']);
}
- page_header($user->lang['LOGIN'], false);
+ /**
+ * Performing additional actions, load additional data on forum login
+ *
+ * @event core.login_forum_box
+ * @var array forum_data Array with forum data
+ * @var string password Password entered
+ * @since 3.1.0-RC3
+ */
+ $vars = array('forum_data', 'password');
+ extract($phpbb_dispatcher->trigger_event('core.login_forum_box', compact($vars)));
+
+ page_header($user->lang['LOGIN']);
$template->assign_vars(array(
'FORUM_NAME' => isset($forum_data['forum_name']) ? $forum_data['forum_name'] : '',
@@ -3399,79 +3268,59 @@ function parse_cfg_file($filename, $lines = false)
$parsed_items[$key] = $value;
}
-
- if (isset($parsed_items['inherit_from']) && isset($parsed_items['name']) && $parsed_items['inherit_from'] == $parsed_items['name'])
+
+ if (isset($parsed_items['parent']) && isset($parsed_items['name']) && $parsed_items['parent'] == $parsed_items['name'])
{
- unset($parsed_items['inherit_from']);
+ unset($parsed_items['parent']);
}
return $parsed_items;
}
/**
-* Add log event
+* Add log entry
+*
+* @param string $mode The mode defines which log_type is used and from which log the entry is retrieved
+* @param int $forum_id Mode 'mod' ONLY: forum id of the related item, NOT INCLUDED otherwise
+* @param int $topic_id Mode 'mod' ONLY: topic id of the related item, NOT INCLUDED otherwise
+* @param int $reportee_id Mode 'user' ONLY: user id of the reportee, NOT INCLUDED otherwise
+* @param string $log_operation Name of the operation
+* @param array $additional_data More arguments can be added, depending on the log_type
+*
+* @return int|bool Returns the log_id, if the entry was added to the database, false otherwise.
+*
+* @deprecated Use $phpbb_log->add() instead
*/
function add_log()
{
- global $db, $user;
-
- // In phpBB 3.1.x i want to have logging in a class to be able to control it
- // For now, we need a quite hakish approach to circumvent logging for some actions
- // @todo implement cleanly
- if (!empty($GLOBALS['skip_add_log']))
- {
- return false;
- }
+ global $phpbb_log, $user;
$args = func_get_args();
+ $mode = array_shift($args);
- $mode = array_shift($args);
- $reportee_id = ($mode == 'user') ? intval(array_shift($args)) : '';
- $forum_id = ($mode == 'mod') ? intval(array_shift($args)) : '';
- $topic_id = ($mode == 'mod') ? intval(array_shift($args)) : '';
- $action = array_shift($args);
- $data = (!sizeof($args)) ? '' : serialize($args);
-
- $sql_ary = array(
- 'user_id' => (empty($user->data)) ? ANONYMOUS : $user->data['user_id'],
- 'log_ip' => $user->ip,
- 'log_time' => time(),
- 'log_operation' => $action,
- 'log_data' => $data,
- );
-
+ // This looks kind of dirty, but add_log has some additional data before the log_operation
+ $additional_data = array();
switch ($mode)
{
case 'admin':
- $sql_ary['log_type'] = LOG_ADMIN;
+ case 'critical':
break;
-
case 'mod':
- $sql_ary += array(
- 'log_type' => LOG_MOD,
- 'forum_id' => $forum_id,
- 'topic_id' => $topic_id
- );
+ $additional_data['forum_id'] = array_shift($args);
+ $additional_data['topic_id'] = array_shift($args);
break;
-
case 'user':
- $sql_ary += array(
- 'log_type' => LOG_USERS,
- 'reportee_id' => $reportee_id
- );
+ $additional_data['reportee_id'] = array_shift($args);
break;
-
- case 'critical':
- $sql_ary['log_type'] = LOG_CRITICAL;
- break;
-
- default:
- return false;
}
- $db->sql_query('INSERT INTO ' . LOG_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary));
+ $log_operation = array_shift($args);
+ $additional_data = array_merge($additional_data, $args);
- return $db->sql_nextid();
+ $user_id = (empty($user->data)) ? ANONYMOUS : $user->data['user_id'];
+ $user_ip = (empty($user->ip)) ? '' : $user->ip;
+
+ return $phpbb_log->add($mode, $user_id, $user_ip, $log_operation, time(), $additional_data);
}
/**
@@ -3530,7 +3379,7 @@ function get_preg_expression($mode)
case 'email':
// Regex written by James Watts and Francisco Jose Martin Moreno
// http://fightingforalostcause.net/misc/2006/compare-email-regex.php
- return '([\w\!\#$\%\&\'\*\+\-\/\=\?\^\`{\|\}\~]+\.)*(?:[\w\!\#$\%\'\*\+\-\/\=\?\^\`{\|\}\~]|&amp;)+@((((([a-z0-9]{1}[a-z0-9\-]{0,62}[a-z0-9]{1})|[a-z])\.)+[a-z]{2,63})|(\d{1,3}\.){3}\d{1,3}(\:\d{1,5})?)';
+ return '((?:[\w\!\#$\%\&\'\*\+\-\/\=\?\^\`{\|\}\~]+\.)*(?:[\w\!\#$\%\'\*\+\-\/\=\?\^\`{\|\}\~]|&amp;)+)@((((([a-z0-9]{1}[a-z0-9\-]{0,62}[a-z0-9]{1})|[a-z])\.)+[a-z]{2,63})|(\d{1,3}\.){3}\d{1,3}(\:\d{1,5})?)';
break;
case 'bbcode_htm':
@@ -3556,28 +3405,48 @@ function get_preg_expression($mode)
break;
case 'url':
+ // generated with regex_idn.php file in the develop folder
+ return "[a-z][a-z\d+\-.]*:/{2}(?:(?:[^\p{C}\p{Z}\p{S}\p{P}\p{Nl}\p{No}\p{Me}\x{1100}-\x{115F}\x{A960}-\x{A97C}\x{1160}-\x{11A7}\x{D7B0}-\x{D7C6}\x{20D0}-\x{20FF}\x{1D100}-\x{1D1FF}\x{1D200}-\x{1D24F}\x{0640}\x{07FA}\x{302E}\x{302F}\x{3031}-\x{3035}\x{303B}]*[\x{00B7}\x{0375}\x{05F3}\x{05F4}\x{30FB}\x{002D}\x{06FD}\x{06FE}\x{0F0B}\x{3007}\x{00DF}\x{03C2}\x{200C}\x{200D}\pL0-9\-._~!$&'()*+,;=:@|]+|%[\dA-F]{2})+|[0-9.]+|\[[a-z0-9.]+:[a-z0-9.]+:[a-z0-9.:]+\])(?::\d*)?(?:/(?:[^\p{C}\p{Z}\p{S}\p{P}\p{Nl}\p{No}\p{Me}\x{1100}-\x{115F}\x{A960}-\x{A97C}\x{1160}-\x{11A7}\x{D7B0}-\x{D7C6}\x{20D0}-\x{20FF}\x{1D100}-\x{1D1FF}\x{1D200}-\x{1D24F}\x{0640}\x{07FA}\x{302E}\x{302F}\x{3031}-\x{3035}\x{303B}]*[\x{00B7}\x{0375}\x{05F3}\x{05F4}\x{30FB}\x{002D}\x{06FD}\x{06FE}\x{0F0B}\x{3007}\x{00DF}\x{03C2}\x{200C}\x{200D}\pL0-9\-._~!$&'()*+,;=:@|]+|%[\dA-F]{2})*)*(?:\?(?:[^\p{C}\p{Z}\p{S}\p{P}\p{Nl}\p{No}\p{Me}\x{1100}-\x{115F}\x{A960}-\x{A97C}\x{1160}-\x{11A7}\x{D7B0}-\x{D7C6}\x{20D0}-\x{20FF}\x{1D100}-\x{1D1FF}\x{1D200}-\x{1D24F}\x{0640}\x{07FA}\x{302E}\x{302F}\x{3031}-\x{3035}\x{303B}]*[\x{00B7}\x{0375}\x{05F3}\x{05F4}\x{30FB}\x{002D}\x{06FD}\x{06FE}\x{0F0B}\x{3007}\x{00DF}\x{03C2}\x{200C}\x{200D}\pL0-9\-._~!$&'()*+,;=:@/?|]+|%[\dA-F]{2})*)?(?:\#(?:[^\p{C}\p{Z}\p{S}\p{P}\p{Nl}\p{No}\p{Me}\x{1100}-\x{115F}\x{A960}-\x{A97C}\x{1160}-\x{11A7}\x{D7B0}-\x{D7C6}\x{20D0}-\x{20FF}\x{1D100}-\x{1D1FF}\x{1D200}-\x{1D24F}\x{0640}\x{07FA}\x{302E}\x{302F}\x{3031}-\x{3035}\x{303B}]*[\x{00B7}\x{0375}\x{05F3}\x{05F4}\x{30FB}\x{002D}\x{06FD}\x{06FE}\x{0F0B}\x{3007}\x{00DF}\x{03C2}\x{200C}\x{200D}\pL0-9\-._~!$&'()*+,;=:@/?|]+|%[\dA-F]{2})*)?";
+ break;
+
case 'url_inline':
- $inline = ($mode == 'url') ? ')' : '';
- $scheme = ($mode == 'url') ? '[a-z\d+\-.]' : '[a-z\d+]'; // avoid automatic parsing of "word" in "last word.http://..."
- // generated with regex generation file in the develop folder
- return "[a-z]$scheme*:/{2}(?:(?:[a-z0-9\-._~!$&'($inline*+,;=:@|]+|%[\dA-F]{2})+|[0-9.]+|\[[a-z0-9.]+:[a-z0-9.]+:[a-z0-9.:]+\])(?::\d*)?(?:/(?:[a-z0-9\-._~!$&'($inline*+,;=:@|]+|%[\dA-F]{2})*)*(?:\?(?:[a-z0-9\-._~!$&'($inline*+,;=:@/?|]+|%[\dA-F]{2})*)?(?:\#(?:[a-z0-9\-._~!$&'($inline*+,;=:@/?|]+|%[\dA-F]{2})*)?";
+ // generated with regex_idn.php file in the develop folder
+ return "[a-z][a-z\d+]*:/{2}(?:(?:[^\p{C}\p{Z}\p{S}\p{P}\p{Nl}\p{No}\p{Me}\x{1100}-\x{115F}\x{A960}-\x{A97C}\x{1160}-\x{11A7}\x{D7B0}-\x{D7C6}\x{20D0}-\x{20FF}\x{1D100}-\x{1D1FF}\x{1D200}-\x{1D24F}\x{0640}\x{07FA}\x{302E}\x{302F}\x{3031}-\x{3035}\x{303B}]*[\x{00B7}\x{0375}\x{05F3}\x{05F4}\x{30FB}\x{002D}\x{06FD}\x{06FE}\x{0F0B}\x{3007}\x{00DF}\x{03C2}\x{200C}\x{200D}\pL0-9\-._~!$&'(*+,;=:@|]+|%[\dA-F]{2})+|[0-9.]+|\[[a-z0-9.]+:[a-z0-9.]+:[a-z0-9.:]+\])(?::\d*)?(?:/(?:[^\p{C}\p{Z}\p{S}\p{P}\p{Nl}\p{No}\p{Me}\x{1100}-\x{115F}\x{A960}-\x{A97C}\x{1160}-\x{11A7}\x{D7B0}-\x{D7C6}\x{20D0}-\x{20FF}\x{1D100}-\x{1D1FF}\x{1D200}-\x{1D24F}\x{0640}\x{07FA}\x{302E}\x{302F}\x{3031}-\x{3035}\x{303B}]*[\x{00B7}\x{0375}\x{05F3}\x{05F4}\x{30FB}\x{002D}\x{06FD}\x{06FE}\x{0F0B}\x{3007}\x{00DF}\x{03C2}\x{200C}\x{200D}\pL0-9\-._~!$&'(*+,;=:@|]+|%[\dA-F]{2})*)*(?:\?(?:[^\p{C}\p{Z}\p{S}\p{P}\p{Nl}\p{No}\p{Me}\x{1100}-\x{115F}\x{A960}-\x{A97C}\x{1160}-\x{11A7}\x{D7B0}-\x{D7C6}\x{20D0}-\x{20FF}\x{1D100}-\x{1D1FF}\x{1D200}-\x{1D24F}\x{0640}\x{07FA}\x{302E}\x{302F}\x{3031}-\x{3035}\x{303B}]*[\x{00B7}\x{0375}\x{05F3}\x{05F4}\x{30FB}\x{002D}\x{06FD}\x{06FE}\x{0F0B}\x{3007}\x{00DF}\x{03C2}\x{200C}\x{200D}\pL0-9\-._~!$&'(*+,;=:@/?|]+|%[\dA-F]{2})*)?(?:\#(?:[^\p{C}\p{Z}\p{S}\p{P}\p{Nl}\p{No}\p{Me}\x{1100}-\x{115F}\x{A960}-\x{A97C}\x{1160}-\x{11A7}\x{D7B0}-\x{D7C6}\x{20D0}-\x{20FF}\x{1D100}-\x{1D1FF}\x{1D200}-\x{1D24F}\x{0640}\x{07FA}\x{302E}\x{302F}\x{3031}-\x{3035}\x{303B}]*[\x{00B7}\x{0375}\x{05F3}\x{05F4}\x{30FB}\x{002D}\x{06FD}\x{06FE}\x{0F0B}\x{3007}\x{00DF}\x{03C2}\x{200C}\x{200D}\pL0-9\-._~!$&'(*+,;=:@/?|]+|%[\dA-F]{2})*)?";
break;
case 'www_url':
+ // generated with regex_idn.php file in the develop folder
+ return "www\.(?:[^\p{C}\p{Z}\p{S}\p{P}\p{Nl}\p{No}\p{Me}\x{1100}-\x{115F}\x{A960}-\x{A97C}\x{1160}-\x{11A7}\x{D7B0}-\x{D7C6}\x{20D0}-\x{20FF}\x{1D100}-\x{1D1FF}\x{1D200}-\x{1D24F}\x{0640}\x{07FA}\x{302E}\x{302F}\x{3031}-\x{3035}\x{303B}]*[\x{00B7}\x{0375}\x{05F3}\x{05F4}\x{30FB}\x{002D}\x{06FD}\x{06FE}\x{0F0B}\x{3007}\x{00DF}\x{03C2}\x{200C}\x{200D}\pL0-9\-._~!$&'()*+,;=:@|]+|%[\dA-F]{2})+(?::\d*)?(?:/(?:[^\p{C}\p{Z}\p{S}\p{P}\p{Nl}\p{No}\p{Me}\x{1100}-\x{115F}\x{A960}-\x{A97C}\x{1160}-\x{11A7}\x{D7B0}-\x{D7C6}\x{20D0}-\x{20FF}\x{1D100}-\x{1D1FF}\x{1D200}-\x{1D24F}\x{0640}\x{07FA}\x{302E}\x{302F}\x{3031}-\x{3035}\x{303B}]*[\x{00B7}\x{0375}\x{05F3}\x{05F4}\x{30FB}\x{002D}\x{06FD}\x{06FE}\x{0F0B}\x{3007}\x{00DF}\x{03C2}\x{200C}\x{200D}\pL0-9\-._~!$&'()*+,;=:@|]+|%[\dA-F]{2})*)*(?:\?(?:[^\p{C}\p{Z}\p{S}\p{P}\p{Nl}\p{No}\p{Me}\x{1100}-\x{115F}\x{A960}-\x{A97C}\x{1160}-\x{11A7}\x{D7B0}-\x{D7C6}\x{20D0}-\x{20FF}\x{1D100}-\x{1D1FF}\x{1D200}-\x{1D24F}\x{0640}\x{07FA}\x{302E}\x{302F}\x{3031}-\x{3035}\x{303B}]*[\x{00B7}\x{0375}\x{05F3}\x{05F4}\x{30FB}\x{002D}\x{06FD}\x{06FE}\x{0F0B}\x{3007}\x{00DF}\x{03C2}\x{200C}\x{200D}\pL0-9\-._~!$&'()*+,;=:@/?|]+|%[\dA-F]{2})*)?(?:\#(?:[^\p{C}\p{Z}\p{S}\p{P}\p{Nl}\p{No}\p{Me}\x{1100}-\x{115F}\x{A960}-\x{A97C}\x{1160}-\x{11A7}\x{D7B0}-\x{D7C6}\x{20D0}-\x{20FF}\x{1D100}-\x{1D1FF}\x{1D200}-\x{1D24F}\x{0640}\x{07FA}\x{302E}\x{302F}\x{3031}-\x{3035}\x{303B}]*[\x{00B7}\x{0375}\x{05F3}\x{05F4}\x{30FB}\x{002D}\x{06FD}\x{06FE}\x{0F0B}\x{3007}\x{00DF}\x{03C2}\x{200C}\x{200D}\pL0-9\-._~!$&'()*+,;=:@/?|]+|%[\dA-F]{2})*)?";
+ break;
+
case 'www_url_inline':
- $inline = ($mode == 'www_url') ? ')' : '';
- return "www\.(?:[a-z0-9\-._~!$&'($inline*+,;=:@|]+|%[\dA-F]{2})+(?::\d*)?(?:/(?:[a-z0-9\-._~!$&'($inline*+,;=:@|]+|%[\dA-F]{2})*)*(?:\?(?:[a-z0-9\-._~!$&'($inline*+,;=:@/?|]+|%[\dA-F]{2})*)?(?:\#(?:[a-z0-9\-._~!$&'($inline*+,;=:@/?|]+|%[\dA-F]{2})*)?";
+ // generated with regex_idn.php file in the develop folder
+ return "www\.(?:[^\p{C}\p{Z}\p{S}\p{P}\p{Nl}\p{No}\p{Me}\x{1100}-\x{115F}\x{A960}-\x{A97C}\x{1160}-\x{11A7}\x{D7B0}-\x{D7C6}\x{20D0}-\x{20FF}\x{1D100}-\x{1D1FF}\x{1D200}-\x{1D24F}\x{0640}\x{07FA}\x{302E}\x{302F}\x{3031}-\x{3035}\x{303B}]*[\x{00B7}\x{0375}\x{05F3}\x{05F4}\x{30FB}\x{002D}\x{06FD}\x{06FE}\x{0F0B}\x{3007}\x{00DF}\x{03C2}\x{200C}\x{200D}\pL0-9\-._~!$&'(*+,;=:@|]+|%[\dA-F]{2})+(?::\d*)?(?:/(?:[^\p{C}\p{Z}\p{S}\p{P}\p{Nl}\p{No}\p{Me}\x{1100}-\x{115F}\x{A960}-\x{A97C}\x{1160}-\x{11A7}\x{D7B0}-\x{D7C6}\x{20D0}-\x{20FF}\x{1D100}-\x{1D1FF}\x{1D200}-\x{1D24F}\x{0640}\x{07FA}\x{302E}\x{302F}\x{3031}-\x{3035}\x{303B}]*[\x{00B7}\x{0375}\x{05F3}\x{05F4}\x{30FB}\x{002D}\x{06FD}\x{06FE}\x{0F0B}\x{3007}\x{00DF}\x{03C2}\x{200C}\x{200D}\pL0-9\-._~!$&'(*+,;=:@|]+|%[\dA-F]{2})*)*(?:\?(?:[^\p{C}\p{Z}\p{S}\p{P}\p{Nl}\p{No}\p{Me}\x{1100}-\x{115F}\x{A960}-\x{A97C}\x{1160}-\x{11A7}\x{D7B0}-\x{D7C6}\x{20D0}-\x{20FF}\x{1D100}-\x{1D1FF}\x{1D200}-\x{1D24F}\x{0640}\x{07FA}\x{302E}\x{302F}\x{3031}-\x{3035}\x{303B}]*[\x{00B7}\x{0375}\x{05F3}\x{05F4}\x{30FB}\x{002D}\x{06FD}\x{06FE}\x{0F0B}\x{3007}\x{00DF}\x{03C2}\x{200C}\x{200D}\pL0-9\-._~!$&'(*+,;=:@/?|]+|%[\dA-F]{2})*)?(?:\#(?:[^\p{C}\p{Z}\p{S}\p{P}\p{Nl}\p{No}\p{Me}\x{1100}-\x{115F}\x{A960}-\x{A97C}\x{1160}-\x{11A7}\x{D7B0}-\x{D7C6}\x{20D0}-\x{20FF}\x{1D100}-\x{1D1FF}\x{1D200}-\x{1D24F}\x{0640}\x{07FA}\x{302E}\x{302F}\x{3031}-\x{3035}\x{303B}]*[\x{00B7}\x{0375}\x{05F3}\x{05F4}\x{30FB}\x{002D}\x{06FD}\x{06FE}\x{0F0B}\x{3007}\x{00DF}\x{03C2}\x{200C}\x{200D}\pL0-9\-._~!$&'(*+,;=:@/?|]+|%[\dA-F]{2})*)?";
break;
case 'relative_url':
+ // generated with regex_idn.php file in the develop folder
+ return "(?:[^\p{C}\p{Z}\p{S}\p{P}\p{Nl}\p{No}\p{Me}\x{1100}-\x{115F}\x{A960}-\x{A97C}\x{1160}-\x{11A7}\x{D7B0}-\x{D7C6}\x{20D0}-\x{20FF}\x{1D100}-\x{1D1FF}\x{1D200}-\x{1D24F}\x{0640}\x{07FA}\x{302E}\x{302F}\x{3031}-\x{3035}\x{303B}]*[\x{00B7}\x{0375}\x{05F3}\x{05F4}\x{30FB}\x{002D}\x{06FD}\x{06FE}\x{0F0B}\x{3007}\x{00DF}\x{03C2}\x{200C}\x{200D}\pL0-9\-._~!$&'()*+,;=:@|]+|%[\dA-F]{2})*(?:/(?:[^\p{C}\p{Z}\p{S}\p{P}\p{Nl}\p{No}\p{Me}\x{1100}-\x{115F}\x{A960}-\x{A97C}\x{1160}-\x{11A7}\x{D7B0}-\x{D7C6}\x{20D0}-\x{20FF}\x{1D100}-\x{1D1FF}\x{1D200}-\x{1D24F}\x{0640}\x{07FA}\x{302E}\x{302F}\x{3031}-\x{3035}\x{303B}]*[\x{00B7}\x{0375}\x{05F3}\x{05F4}\x{30FB}\x{002D}\x{06FD}\x{06FE}\x{0F0B}\x{3007}\x{00DF}\x{03C2}\x{200C}\x{200D}\pL0-9\-._~!$&'()*+,;=:@|]+|%[\dA-F]{2})*)*(?:\?(?:[^\p{C}\p{Z}\p{S}\p{P}\p{Nl}\p{No}\p{Me}\x{1100}-\x{115F}\x{A960}-\x{A97C}\x{1160}-\x{11A7}\x{D7B0}-\x{D7C6}\x{20D0}-\x{20FF}\x{1D100}-\x{1D1FF}\x{1D200}-\x{1D24F}\x{0640}\x{07FA}\x{302E}\x{302F}\x{3031}-\x{3035}\x{303B}]*[\x{00B7}\x{0375}\x{05F3}\x{05F4}\x{30FB}\x{002D}\x{06FD}\x{06FE}\x{0F0B}\x{3007}\x{00DF}\x{03C2}\x{200C}\x{200D}\pL0-9\-._~!$&'()*+,;=:@/?|]+|%[\dA-F]{2})*)?(?:\#(?:[^\p{C}\p{Z}\p{S}\p{P}\p{Nl}\p{No}\p{Me}\x{1100}-\x{115F}\x{A960}-\x{A97C}\x{1160}-\x{11A7}\x{D7B0}-\x{D7C6}\x{20D0}-\x{20FF}\x{1D100}-\x{1D1FF}\x{1D200}-\x{1D24F}\x{0640}\x{07FA}\x{302E}\x{302F}\x{3031}-\x{3035}\x{303B}]*[\x{00B7}\x{0375}\x{05F3}\x{05F4}\x{30FB}\x{002D}\x{06FD}\x{06FE}\x{0F0B}\x{3007}\x{00DF}\x{03C2}\x{200C}\x{200D}\pL0-9\-._~!$&'()*+,;=:@/?|]+|%[\dA-F]{2})*)?";
+ break;
+
case 'relative_url_inline':
- $inline = ($mode == 'relative_url') ? ')' : '';
- return "(?:[a-z0-9\-._~!$&'($inline*+,;=:@|]+|%[\dA-F]{2})*(?:/(?:[a-z0-9\-._~!$&'($inline*+,;=:@|]+|%[\dA-F]{2})*)*(?:\?(?:[a-z0-9\-._~!$&'($inline*+,;=:@/?|]+|%[\dA-F]{2})*)?(?:\#(?:[a-z0-9\-._~!$&'($inline*+,;=:@/?|]+|%[\dA-F]{2})*)?";
+ // generated with regex_idn.php file in the develop folder
+ return "(?:[^\p{C}\p{Z}\p{S}\p{P}\p{Nl}\p{No}\p{Me}\x{1100}-\x{115F}\x{A960}-\x{A97C}\x{1160}-\x{11A7}\x{D7B0}-\x{D7C6}\x{20D0}-\x{20FF}\x{1D100}-\x{1D1FF}\x{1D200}-\x{1D24F}\x{0640}\x{07FA}\x{302E}\x{302F}\x{3031}-\x{3035}\x{303B}]*[\x{00B7}\x{0375}\x{05F3}\x{05F4}\x{30FB}\x{002D}\x{06FD}\x{06FE}\x{0F0B}\x{3007}\x{00DF}\x{03C2}\x{200C}\x{200D}\pL0-9\-._~!$&'(*+,;=:@|]+|%[\dA-F]{2})*(?:/(?:[^\p{C}\p{Z}\p{S}\p{P}\p{Nl}\p{No}\p{Me}\x{1100}-\x{115F}\x{A960}-\x{A97C}\x{1160}-\x{11A7}\x{D7B0}-\x{D7C6}\x{20D0}-\x{20FF}\x{1D100}-\x{1D1FF}\x{1D200}-\x{1D24F}\x{0640}\x{07FA}\x{302E}\x{302F}\x{3031}-\x{3035}\x{303B}]*[\x{00B7}\x{0375}\x{05F3}\x{05F4}\x{30FB}\x{002D}\x{06FD}\x{06FE}\x{0F0B}\x{3007}\x{00DF}\x{03C2}\x{200C}\x{200D}\pL0-9\-._~!$&'(*+,;=:@|]+|%[\dA-F]{2})*)*(?:\?(?:[^\p{C}\p{Z}\p{S}\p{P}\p{Nl}\p{No}\p{Me}\x{1100}-\x{115F}\x{A960}-\x{A97C}\x{1160}-\x{11A7}\x{D7B0}-\x{D7C6}\x{20D0}-\x{20FF}\x{1D100}-\x{1D1FF}\x{1D200}-\x{1D24F}\x{0640}\x{07FA}\x{302E}\x{302F}\x{3031}-\x{3035}\x{303B}]*[\x{00B7}\x{0375}\x{05F3}\x{05F4}\x{30FB}\x{002D}\x{06FD}\x{06FE}\x{0F0B}\x{3007}\x{00DF}\x{03C2}\x{200C}\x{200D}\pL0-9\-._~!$&'(*+,;=:@/?|]+|%[\dA-F]{2})*)?(?:\#(?:[^\p{C}\p{Z}\p{S}\p{P}\p{Nl}\p{No}\p{Me}\x{1100}-\x{115F}\x{A960}-\x{A97C}\x{1160}-\x{11A7}\x{D7B0}-\x{D7C6}\x{20D0}-\x{20FF}\x{1D100}-\x{1D1FF}\x{1D200}-\x{1D24F}\x{0640}\x{07FA}\x{302E}\x{302F}\x{3031}-\x{3035}\x{303B}]*[\x{00B7}\x{0375}\x{05F3}\x{05F4}\x{30FB}\x{002D}\x{06FD}\x{06FE}\x{0F0B}\x{3007}\x{00DF}\x{03C2}\x{200C}\x{200D}\pL0-9\-._~!$&'(*+,;=:@/?|]+|%[\dA-F]{2})*)?";
break;
case 'table_prefix':
return '#^[a-zA-Z][a-zA-Z0-9_]*$#';
break;
+
+ // Matches the predecing dot
+ case 'path_remove_dot_trailing_slash':
+ return '#^(?:(\.)?)+(?:(.+)?)+(?:([\\/\\\])$)#';
+ break;
+
+ case 'semantic_version':
+ // Regular expression to match semantic versions by http://rgxdb.com/
+ return '/(?<=^[Vv]|^)(?:(?<major>(?:0|[1-9](?:(?:0|[1-9])+)*))[.](?<minor>(?:0|[1-9](?:(?:0|[1-9])+)*))[.](?<patch>(?:0|[1-9](?:(?:0|[1-9])+)*))(?:-(?<prerelease>(?:(?:(?:[A-Za-z]|-)(?:(?:(?:0|[1-9])|(?:[A-Za-z]|-))+)?|(?:(?:(?:0|[1-9])|(?:[A-Za-z]|-))+)(?:[A-Za-z]|-)(?:(?:(?:0|[1-9])|(?:[A-Za-z]|-))+)?)|(?:0|[1-9](?:(?:0|[1-9])+)*))(?:[.](?:(?:(?:[A-Za-z]|-)(?:(?:(?:0|[1-9])|(?:[A-Za-z]|-))+)?|(?:(?:(?:0|[1-9])|(?:[A-Za-z]|-))+)(?:[A-Za-z]|-)(?:(?:(?:0|[1-9])|(?:[A-Za-z]|-))+)?)|(?:0|[1-9](?:(?:0|[1-9])+)*)))*))?(?:[+](?<build>(?:(?:(?:[A-Za-z]|-)(?:(?:(?:0|[1-9])|(?:[A-Za-z]|-))+)?|(?:(?:(?:0|[1-9])|(?:[A-Za-z]|-))+)(?:[A-Za-z]|-)(?:(?:(?:0|[1-9])|(?:[A-Za-z]|-))+)?)|(?:(?:0|[1-9])+))(?:[.](?:(?:(?:[A-Za-z]|-)(?:(?:(?:0|[1-9])|(?:[A-Za-z]|-))+)?|(?:(?:(?:0|[1-9])|(?:[A-Za-z]|-))+)(?:[A-Za-z]|-)(?:(?:(?:0|[1-9])|(?:[A-Za-z]|-))+)?)|(?:(?:0|[1-9])+)))*))?)$/';
+ break;
}
return '';
@@ -3594,18 +3463,10 @@ function get_preg_expression($mode)
*/
function get_censor_preg_expression($word, $use_unicode = true)
{
- static $unicode_support = null;
-
- // Check whether PHP version supports unicode properties
- if (is_null($unicode_support))
- {
- $unicode_support = ((version_compare(PHP_VERSION, '5.1.0', '>=') || (version_compare(PHP_VERSION, '5.0.0-dev', '<=') && version_compare(PHP_VERSION, '4.4.0', '>='))) && @preg_match('/\p{L}/u', 'a') !== false) ? true : false;
- }
-
// Unescape the asterisk to simplify further conversions
$word = str_replace('\*', '*', preg_quote($word, '#'));
- if ($use_unicode && $unicode_support)
+ if ($use_unicode && phpbb_pcre_utf8_support())
{
// Replace asterisk(s) inside the pattern, at the start and at the end of it with regexes
$word = preg_replace(array('#(?<=[\p{Nd}\p{L}_])\*+(?=[\p{Nd}\p{L}_])#iu', '#^\*+#', '#\*+$#'), array('([\x20]*?|[\p{Nd}\p{L}_-]*?)', '[\p{Nd}\p{L}_-]*?', '[\p{Nd}\p{L}_-]*?'), $word);
@@ -3657,6 +3518,182 @@ function short_ipv6($ip, $length)
}
/**
+* Normalises an internet protocol address,
+* also checks whether the specified address is valid.
+*
+* IPv4 addresses are returned 'as is'.
+*
+* IPv6 addresses are normalised according to
+* A Recommendation for IPv6 Address Text Representation
+* http://tools.ietf.org/html/draft-ietf-6man-text-addr-representation-07
+*
+* @param string $address IP address
+*
+* @return mixed false if specified address is not valid,
+* string otherwise
+*/
+function phpbb_ip_normalise($address)
+{
+ $address = trim($address);
+
+ if (empty($address) || !is_string($address))
+ {
+ return false;
+ }
+
+ if (preg_match(get_preg_expression('ipv4'), $address))
+ {
+ return $address;
+ }
+
+ return phpbb_inet_ntop(phpbb_inet_pton($address));
+}
+
+/**
+* Wrapper for inet_ntop()
+*
+* Converts a packed internet address to a human readable representation
+* inet_ntop() is supported by PHP since 5.1.0, since 5.3.0 also on Windows.
+*
+* @param string $in_addr A 32bit IPv4, or 128bit IPv6 address.
+*
+* @return mixed false on failure,
+* string otherwise
+*/
+function phpbb_inet_ntop($in_addr)
+{
+ $in_addr = bin2hex($in_addr);
+
+ switch (strlen($in_addr))
+ {
+ case 8:
+ return implode('.', array_map('hexdec', str_split($in_addr, 2)));
+
+ case 32:
+ if (substr($in_addr, 0, 24) === '00000000000000000000ffff')
+ {
+ return phpbb_inet_ntop(pack('H*', substr($in_addr, 24)));
+ }
+
+ $parts = str_split($in_addr, 4);
+ $parts = preg_replace('/^0+(?!$)/', '', $parts);
+ $ret = implode(':', $parts);
+
+ $matches = array();
+ preg_match_all('/(?<=:|^)(?::?0){2,}/', $ret, $matches, PREG_OFFSET_CAPTURE);
+ $matches = $matches[0];
+
+ if (empty($matches))
+ {
+ return $ret;
+ }
+
+ $longest_match = '';
+ $longest_match_offset = 0;
+ foreach ($matches as $match)
+ {
+ if (strlen($match[0]) > strlen($longest_match))
+ {
+ $longest_match = $match[0];
+ $longest_match_offset = $match[1];
+ }
+ }
+
+ $ret = substr_replace($ret, '', $longest_match_offset, strlen($longest_match));
+
+ if ($longest_match_offset == strlen($ret))
+ {
+ $ret .= ':';
+ }
+
+ if ($longest_match_offset == 0)
+ {
+ $ret = ':' . $ret;
+ }
+
+ return $ret;
+
+ default:
+ return false;
+ }
+}
+
+/**
+* Wrapper for inet_pton()
+*
+* Converts a human readable IP address to its packed in_addr representation
+* inet_pton() is supported by PHP since 5.1.0, since 5.3.0 also on Windows.
+*
+* @param string $address A human readable IPv4 or IPv6 address.
+*
+* @return mixed false if address is invalid,
+* in_addr representation of the given address otherwise (string)
+*/
+function phpbb_inet_pton($address)
+{
+ $ret = '';
+ if (preg_match(get_preg_expression('ipv4'), $address))
+ {
+ foreach (explode('.', $address) as $part)
+ {
+ $ret .= ($part <= 0xF ? '0' : '') . dechex($part);
+ }
+
+ return pack('H*', $ret);
+ }
+
+ if (preg_match(get_preg_expression('ipv6'), $address))
+ {
+ $parts = explode(':', $address);
+ $missing_parts = 8 - sizeof($parts) + 1;
+
+ if (substr($address, 0, 2) === '::')
+ {
+ ++$missing_parts;
+ }
+
+ if (substr($address, -2) === '::')
+ {
+ ++$missing_parts;
+ }
+
+ $embedded_ipv4 = false;
+ $last_part = end($parts);
+
+ if (preg_match(get_preg_expression('ipv4'), $last_part))
+ {
+ $parts[sizeof($parts) - 1] = '';
+ $last_part = phpbb_inet_pton($last_part);
+ $embedded_ipv4 = true;
+ --$missing_parts;
+ }
+
+ foreach ($parts as $i => $part)
+ {
+ if (strlen($part))
+ {
+ $ret .= str_pad($part, 4, '0', STR_PAD_LEFT);
+ }
+ else if ($i && $i < sizeof($parts) - 1)
+ {
+ $ret .= str_repeat('0000', $missing_parts);
+ }
+ }
+
+ $ret = pack('H*', $ret);
+
+ if ($embedded_ipv4)
+ {
+ $ret .= $last_part;
+ }
+
+ return $ret;
+ }
+
+ return false;
+}
+
+/**
* Wrapper for php's checkdnsrr function.
*
* @param string $host Fully-Qualified Domain Name
@@ -3670,8 +3707,6 @@ function short_ipv6($ip, $length)
*
* Since null can also be returned, you probably want to compare the result
* with === true or === false,
-*
-* @author bantu
*/
function phpbb_checkdnsrr($host, $type = 'MX')
{
@@ -3853,11 +3888,11 @@ function phpbb_checkdnsrr($host, $type = 'MX')
// Handler, header and footer
/**
-* Error and message handler, call with trigger_error if reqd
+* Error and message handler, call with trigger_error if read
*/
function msg_handler($errno, $msg_text, $errfile, $errline)
{
- global $cache, $db, $auth, $template, $config, $user;
+ global $cache, $db, $auth, $template, $config, $user, $request;
global $phpEx, $phpbb_root_path, $msg_title, $msg_long_text;
// Do not display notices if we suppress them via @
@@ -3942,12 +3977,22 @@ function msg_handler($errno, $msg_text, $errfile, $errline)
$log_text .= '<br /><br />BACKTRACE<br />' . $backtrace;
}
- if (defined('IN_INSTALL') || defined('DEBUG_EXTRA') || isset($auth) && $auth->acl_get('a_'))
+ if (defined('IN_INSTALL') || defined('DEBUG') || isset($auth) && $auth->acl_get('a_'))
{
$msg_text = $log_text;
+
+ // If this is defined there already was some output
+ // So let's not break it
+ if (defined('IN_DB_UPDATE'))
+ {
+ echo '<div class="errorbox">' . $msg_text . '</div>';
+
+ $db->sql_return_on_error(true);
+ phpbb_end_update($cache, $config);
+ }
}
- if ((defined('DEBUG') || defined('IN_CRON') || defined('IMAGE_OUTPUT')) && isset($db))
+ if ((defined('IN_CRON') || defined('IMAGE_OUTPUT')) && isset($db))
{
// let's avoid loops
$db->sql_return_on_error(true);
@@ -3962,10 +4007,11 @@ function msg_handler($errno, $msg_text, $errfile, $errline)
// Try to not call the adm page data...
- echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">';
- echo '<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr">';
+ echo '<!DOCTYPE html>';
+ echo '<html dir="ltr">';
echo '<head>';
- echo '<meta http-equiv="content-type" content="text/html; charset=utf-8" />';
+ echo '<meta charset="utf-8">';
+ echo '<meta http-equiv="X-UA-Compatible" content="IE=edge">';
echo '<title>' . $msg_title . '</title>';
echo '<style type="text/css">' . "\n" . '/* <![CDATA[ */' . "\n";
echo '* { margin: 0; padding: 0; } html { font-size: 100%; height: 100%; margin-bottom: 1px; background-color: #E4EDF0; } body { font-family: "Lucida Grande", Verdana, Helvetica, Arial, sans-serif; color: #536482; background: #E4EDF0; font-size: 62.5%; margin: 0; } ';
@@ -3995,7 +4041,7 @@ function msg_handler($errno, $msg_text, $errfile, $errline)
echo ' </div>';
echo ' </div>';
echo ' <div id="page-footer">';
- echo ' Powered by <a href="https://www.phpbb.com/">phpBB</a>&reg; Forum Software &copy; phpBB Group';
+ echo ' Powered by <a href="https://www.phpbb.com/">phpBB</a>&reg; Forum Software &copy; phpBB Limited';
echo ' </div>';
echo '</div>';
echo '</body>';
@@ -4041,7 +4087,7 @@ function msg_handler($errno, $msg_text, $errfile, $errline)
}
else
{
- page_header($msg_title, false);
+ page_header($msg_title);
}
}
@@ -4056,6 +4102,20 @@ function msg_handler($errno, $msg_text, $errfile, $errline)
'S_USER_NOTICE' => ($errno == E_USER_NOTICE) ? true : false)
);
+ if ($request->is_ajax())
+ {
+ global $refresh_data;
+
+ $json_response = new \phpbb\json_response;
+ $json_response->send(array(
+ 'MESSAGE_TITLE' => $msg_title,
+ 'MESSAGE_TEXT' => $msg_text,
+ 'S_USER_WARNING' => ($errno == E_USER_WARNING) ? true : false,
+ 'S_USER_NOTICE' => ($errno == E_USER_NOTICE) ? true : false,
+ 'REFRESH_DATA' => (!empty($refresh_data)) ? $refresh_data : null
+ ));
+ }
+
// We do not want the cron script to be called on error messages
define('IN_CRON', true);
@@ -4127,7 +4187,7 @@ function obtain_guest_count($item_id = 0, $item = 'forum')
// Get number of online guests
- if ($db->sql_layer === 'sqlite')
+ if ($db->get_sql_layer() === 'sqlite' || $db->get_sql_layer() === 'sqlite3')
{
$sql = 'SELECT COUNT(session_ip) as num_guests
FROM (
@@ -4225,21 +4285,46 @@ function obtain_users_online($item_id = 0, $item = 'forum')
*/
function obtain_users_online_string($online_users, $item_id = 0, $item = 'forum')
{
- global $config, $db, $user, $auth;
+ global $config, $db, $user, $auth, $phpbb_dispatcher;
- $user_online_link = $online_userlist = '';
+ $guests_online = $hidden_online = $l_online_users = $online_userlist = $visible_online = '';
+ $user_online_link = $rowset = array();
// Need caps version of $item for language-strings
$item_caps = strtoupper($item);
if (sizeof($online_users['online_users']))
{
- $sql = 'SELECT username, username_clean, user_id, user_type, user_allow_viewonline, user_colour
- FROM ' . USERS_TABLE . '
- WHERE ' . $db->sql_in_set('user_id', $online_users['online_users']) . '
- ORDER BY username_clean ASC';
- $result = $db->sql_query($sql);
+ $sql_ary = array(
+ 'SELECT' => 'u.username, u.username_clean, u.user_id, u.user_type, u.user_allow_viewonline, u.user_colour',
+ 'FROM' => array(
+ USERS_TABLE => 'u',
+ ),
+ 'WHERE' => $db->sql_in_set('u.user_id', $online_users['online_users']),
+ 'ORDER_BY' => 'u.username_clean ASC',
+ );
- while ($row = $db->sql_fetchrow($result))
+ /**
+ * Modify SQL query to obtain online users data
+ *
+ * @event core.obtain_users_online_string_sql
+ * @var array online_users Array with online users data
+ * from obtain_users_online()
+ * @var int item_id Restrict online users to item id
+ * @var string item Restrict online users to a certain
+ * session item, e.g. forum for
+ * session_forum_id
+ * @var array sql_ary SQL query array to obtain users online data
+ * @since 3.1.4-RC1
+ * @changed 3.1.7-RC1 Change sql query into array and adjust var accordingly. Allows extension authors the ability to adjust the sql_ary.
+ */
+ $vars = array('online_users', 'item_id', 'item', 'sql_ary');
+ extract($phpbb_dispatcher->trigger_event('core.obtain_users_online_string_sql', compact($vars)));
+
+ $result = $db->sql_query($db->sql_build_query('SELECT', $sql_ary));
+ $rowset = $db->sql_fetchrowset($result);
+ $db->sql_freeresult($result);
+
+ foreach ($rowset as $row)
{
// User is logged in and therefore not a guest
if ($row['user_id'] != ANONYMOUS)
@@ -4249,16 +4334,39 @@ function obtain_users_online_string($online_users, $item_id = 0, $item = 'forum'
$row['username'] = '<em>' . $row['username'] . '</em>';
}
- if (!isset($online_users['hidden_users'][$row['user_id']]) || $auth->acl_get('u_viewonline'))
+ if (!isset($online_users['hidden_users'][$row['user_id']]) || $auth->acl_get('u_viewonline') || $row['user_id'] === $user->data['user_id'])
{
- $user_online_link = get_username_string(($row['user_type'] <> USER_IGNORE) ? 'full' : 'no_profile', $row['user_id'], $row['username'], $row['user_colour']);
- $online_userlist .= ($online_userlist != '') ? ', ' . $user_online_link : $user_online_link;
+ $user_online_link[$row['user_id']] = get_username_string(($row['user_type'] <> USER_IGNORE) ? 'full' : 'no_profile', $row['user_id'], $row['username'], $row['user_colour']);
}
}
}
- $db->sql_freeresult($result);
}
+ /**
+ * Modify online userlist data
+ *
+ * @event core.obtain_users_online_string_before_modify
+ * @var array online_users Array with online users data
+ * from obtain_users_online()
+ * @var int item_id Restrict online users to item id
+ * @var string item Restrict online users to a certain
+ * session item, e.g. forum for
+ * session_forum_id
+ * @var array rowset Array with online users data
+ * @var array user_online_link Array with online users items (usernames)
+ * @since 3.1.10-RC1
+ */
+ $vars = array(
+ 'online_users',
+ 'item_id',
+ 'item',
+ 'rowset',
+ 'user_online_link',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.obtain_users_online_string_before_modify', compact($vars)));
+
+ $online_userlist = implode(', ', $user_online_link);
+
if (!$online_userlist)
{
$online_userlist = $user->lang['NO_ONLINE_USERS'];
@@ -4270,58 +4378,52 @@ function obtain_users_online_string($online_users, $item_id = 0, $item = 'forum'
}
else if ($config['load_online_guests'])
{
- $l_online = ($online_users['guests_online'] === 1) ? $user->lang['BROWSING_' . $item_caps . '_GUEST'] : $user->lang['BROWSING_' . $item_caps . '_GUESTS'];
- $online_userlist = sprintf($l_online, $online_userlist, $online_users['guests_online']);
+ $online_userlist = $user->lang('BROWSING_' . $item_caps . '_GUESTS', $online_users['guests_online'], $online_userlist);
}
else
{
$online_userlist = sprintf($user->lang['BROWSING_' . $item_caps], $online_userlist);
}
// Build online listing
- $vars_online = array(
- 'ONLINE' => array('total_online', 'l_t_user_s', 0),
- 'REG' => array('visible_online', 'l_r_user_s', !$config['load_online_guests']),
- 'HIDDEN' => array('hidden_online', 'l_h_user_s', $config['load_online_guests']),
- 'GUEST' => array('guests_online', 'l_g_user_s', 0)
- );
+ $visible_online = $user->lang('REG_USERS_TOTAL', (int) $online_users['visible_online']);
+ $hidden_online = $user->lang('HIDDEN_USERS_TOTAL', (int) $online_users['hidden_online']);
- foreach ($vars_online as $l_prefix => $var_ary)
+ if ($config['load_online_guests'])
{
- if ($var_ary[2])
- {
- $l_suffix = '_AND';
- }
- else
- {
- $l_suffix = '';
- }
- switch ($online_users[$var_ary[0]])
- {
- case 0:
- ${$var_ary[1]} = $user->lang[$l_prefix . '_USERS_ZERO_TOTAL' . $l_suffix];
- break;
-
- case 1:
- ${$var_ary[1]} = $user->lang[$l_prefix . '_USER_TOTAL' . $l_suffix];
- break;
-
- default:
- ${$var_ary[1]} = $user->lang[$l_prefix . '_USERS_TOTAL' . $l_suffix];
- break;
- }
+ $guests_online = $user->lang('GUEST_USERS_TOTAL', (int) $online_users['guests_online']);
+ $l_online_users = $user->lang('ONLINE_USERS_TOTAL_GUESTS', (int) $online_users['total_online'], $visible_online, $hidden_online, $guests_online);
}
- unset($vars_online);
-
- $l_online_users = sprintf($l_t_user_s, $online_users['total_online']);
- $l_online_users .= sprintf($l_r_user_s, $online_users['visible_online']);
- $l_online_users .= sprintf($l_h_user_s, $online_users['hidden_online']);
-
- if ($config['load_online_guests'])
+ else
{
- $l_online_users .= sprintf($l_g_user_s, $online_users['guests_online']);
+ $l_online_users = $user->lang('ONLINE_USERS_TOTAL', (int) $online_users['total_online'], $visible_online, $hidden_online);
}
-
+ /**
+ * Modify online userlist data
+ *
+ * @event core.obtain_users_online_string_modify
+ * @var array online_users Array with online users data
+ * from obtain_users_online()
+ * @var int item_id Restrict online users to item id
+ * @var string item Restrict online users to a certain
+ * session item, e.g. forum for
+ * session_forum_id
+ * @var array rowset Array with online users data
+ * @var array user_online_link Array with online users items (usernames)
+ * @var string online_userlist String containing users online list
+ * @var string l_online_users String with total online users count info
+ * @since 3.1.4-RC1
+ */
+ $vars = array(
+ 'online_users',
+ 'item_id',
+ 'item',
+ 'rowset',
+ 'user_online_link',
+ 'online_userlist',
+ 'l_online_users',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.obtain_users_online_string_modify', compact($vars)));
return array(
'online_userlist' => $online_userlist,
@@ -4365,6 +4467,178 @@ function phpbb_optionset($bit, $set, $data)
}
/**
+* Determine which plural form we should use.
+* For some languages this is not as simple as for English.
+*
+* @param $rule int ID of the plural rule we want to use, see http://wiki.phpbb.com/Plural_Rules#Plural_Rules
+* @param $number int|float The number we want to get the plural case for. Float numbers are floored.
+* @return int The plural-case we need to use for the number plural-rule combination
+*/
+function phpbb_get_plural_form($rule, $number)
+{
+ $number = (int) $number;
+
+ if ($rule > 15 || $rule < 0)
+ {
+ trigger_error('INVALID_PLURAL_RULE');
+ }
+
+ /**
+ * The following plural rules are based on a list published by the Mozilla Developer Network
+ * https://developer.mozilla.org/en/Localization_and_Plurals
+ */
+ switch ($rule)
+ {
+ case 0:
+ /**
+ * Families: Asian (Chinese, Japanese, Korean, Vietnamese), Persian, Turkic/Altaic (Turkish), Thai, Lao
+ * 1 - everything: 0, 1, 2, ...
+ */
+ return 1;
+
+ case 1:
+ /**
+ * Families: Germanic (Danish, Dutch, English, Faroese, Frisian, German, Norwegian, Swedish), Finno-Ugric (Estonian, Finnish, Hungarian), Language isolate (Basque), Latin/Greek (Greek), Semitic (Hebrew), Romanic (Italian, Portuguese, Spanish, Catalan)
+ * 1 - 1
+ * 2 - everything else: 0, 2, 3, ...
+ */
+ return ($number == 1) ? 1 : 2;
+
+ case 2:
+ /**
+ * Families: Romanic (French, Brazilian Portuguese)
+ * 1 - 0, 1
+ * 2 - everything else: 2, 3, ...
+ */
+ return (($number == 0) || ($number == 1)) ? 1 : 2;
+
+ case 3:
+ /**
+ * Families: Baltic (Latvian)
+ * 1 - 0
+ * 2 - ends in 1, not 11: 1, 21, ... 101, 121, ...
+ * 3 - everything else: 2, 3, ... 10, 11, 12, ... 20, 22, ...
+ */
+ return ($number == 0) ? 1 : ((($number % 10 == 1) && ($number % 100 != 11)) ? 2 : 3);
+
+ case 4:
+ /**
+ * Families: Celtic (Scottish Gaelic)
+ * 1 - is 1 or 11: 1, 11
+ * 2 - is 2 or 12: 2, 12
+ * 3 - others between 3 and 19: 3, 4, ... 10, 13, ... 18, 19
+ * 4 - everything else: 0, 20, 21, ...
+ */
+ return ($number == 1 || $number == 11) ? 1 : (($number == 2 || $number == 12) ? 2 : (($number >= 3 && $number <= 19) ? 3 : 4));
+
+ case 5:
+ /**
+ * Families: Romanic (Romanian)
+ * 1 - 1
+ * 2 - is 0 or ends in 01-19: 0, 2, 3, ... 19, 101, 102, ... 119, 201, ...
+ * 3 - everything else: 20, 21, ...
+ */
+ return ($number == 1) ? 1 : ((($number == 0) || (($number % 100 > 0) && ($number % 100 < 20))) ? 2 : 3);
+
+ case 6:
+ /**
+ * Families: Baltic (Lithuanian)
+ * 1 - ends in 1, not 11: 1, 21, 31, ... 101, 121, ...
+ * 2 - ends in 0 or ends in 10-20: 0, 10, 11, 12, ... 19, 20, 30, 40, ...
+ * 3 - everything else: 2, 3, ... 8, 9, 22, 23, ... 29, 32, 33, ...
+ */
+ return (($number % 10 == 1) && ($number % 100 != 11)) ? 1 : ((($number % 10 < 2) || (($number % 100 >= 10) && ($number % 100 < 20))) ? 2 : 3);
+
+ case 7:
+ /**
+ * Families: Slavic (Croatian, Serbian, Russian, Ukrainian)
+ * 1 - ends in 1, not 11: 1, 21, 31, ... 101, 121, ...
+ * 2 - ends in 2-4, not 12-14: 2, 3, 4, 22, 23, 24, 32, ...
+ * 3 - everything else: 0, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 25, 26, ...
+ */
+ return (($number % 10 == 1) && ($number % 100 != 11)) ? 1 : ((($number % 10 >= 2) && ($number % 10 <= 4) && (($number % 100 < 10) || ($number % 100 >= 20))) ? 2 : 3);
+
+ case 8:
+ /**
+ * Families: Slavic (Slovak, Czech)
+ * 1 - 1
+ * 2 - 2, 3, 4
+ * 3 - everything else: 0, 5, 6, 7, ...
+ */
+ return ($number == 1) ? 1 : ((($number >= 2) && ($number <= 4)) ? 2 : 3);
+
+ case 9:
+ /**
+ * Families: Slavic (Polish)
+ * 1 - 1
+ * 2 - ends in 2-4, not 12-14: 2, 3, 4, 22, 23, 24, 32, ... 104, 122, ...
+ * 3 - everything else: 0, 5, 6, ... 11, 12, 13, 14, 15, ... 20, 21, 25, ...
+ */
+ return ($number == 1) ? 1 : ((($number % 10 >= 2) && ($number % 10 <= 4) && (($number % 100 < 12) || ($number % 100 > 14))) ? 2 : 3);
+
+ case 10:
+ /**
+ * Families: Slavic (Slovenian, Sorbian)
+ * 1 - ends in 01: 1, 101, 201, ...
+ * 2 - ends in 02: 2, 102, 202, ...
+ * 3 - ends in 03-04: 3, 4, 103, 104, 203, 204, ...
+ * 4 - everything else: 0, 5, 6, 7, 8, 9, 10, 11, ...
+ */
+ return ($number % 100 == 1) ? 1 : (($number % 100 == 2) ? 2 : ((($number % 100 == 3) || ($number % 100 == 4)) ? 3 : 4));
+
+ case 11:
+ /**
+ * Families: Celtic (Irish Gaeilge)
+ * 1 - 1
+ * 2 - 2
+ * 3 - is 3-6: 3, 4, 5, 6
+ * 4 - is 7-10: 7, 8, 9, 10
+ * 5 - everything else: 0, 11, 12, ...
+ */
+ return ($number == 1) ? 1 : (($number == 2) ? 2 : (($number >= 3 && $number <= 6) ? 3 : (($number >= 7 && $number <= 10) ? 4 : 5)));
+
+ case 12:
+ /**
+ * Families: Semitic (Arabic)
+ * 1 - 1
+ * 2 - 2
+ * 3 - ends in 03-10: 3, 4, ... 10, 103, 104, ... 110, 203, 204, ...
+ * 4 - ends in 11-99: 11, ... 99, 111, 112, ...
+ * 5 - everything else: 100, 101, 102, 200, 201, 202, ...
+ * 6 - 0
+ */
+ return ($number == 1) ? 1 : (($number == 2) ? 2 : ((($number % 100 >= 3) && ($number % 100 <= 10)) ? 3 : ((($number % 100 >= 11) && ($number % 100 <= 99)) ? 4 : (($number != 0) ? 5 : 6))));
+
+ case 13:
+ /**
+ * Families: Semitic (Maltese)
+ * 1 - 1
+ * 2 - is 0 or ends in 01-10: 0, 2, 3, ... 9, 10, 101, 102, ...
+ * 3 - ends in 11-19: 11, 12, ... 18, 19, 111, 112, ...
+ * 4 - everything else: 20, 21, ...
+ */
+ return ($number == 1) ? 1 : ((($number == 0) || (($number % 100 > 1) && ($number % 100 < 11))) ? 2 : ((($number % 100 > 10) && ($number % 100 < 20)) ? 3 : 4));
+
+ case 14:
+ /**
+ * Families: Slavic (Macedonian)
+ * 1 - ends in 1: 1, 11, 21, ...
+ * 2 - ends in 2: 2, 12, 22, ...
+ * 3 - everything else: 0, 3, 4, ... 10, 13, 14, ... 20, 23, ...
+ */
+ return ($number % 10 == 1) ? 1 : (($number % 10 == 2) ? 2 : 3);
+
+ case 15:
+ /**
+ * Families: Icelandic
+ * 1 - ends in 1, not 11: 1, 21, 31, ... 101, 121, 131, ...
+ * 2 - everything else: 0, 2, 3, ... 10, 11, 12, ... 20, 22, ...
+ */
+ return (($number % 10 == 1) && ($number % 100 != 11)) ? 1 : 2;
+ }
+}
+
+/**
* Login using http authenticate.
*
* @param array $param Parameter array, see $param_defaults array.
@@ -4373,7 +4647,7 @@ function phpbb_optionset($bit, $set, $data)
*/
function phpbb_http_login($param)
{
- global $auth, $user;
+ global $auth, $user, $request;
global $config;
$param_defaults = array(
@@ -4413,9 +4687,9 @@ function phpbb_http_login($param)
$username = null;
foreach ($username_keys as $k)
{
- if (isset($_SERVER[$k]))
+ if ($request->is_set($k, \phpbb\request\request_interface::SERVER))
{
- $username = $_SERVER[$k];
+ $username = htmlspecialchars_decode($request->server($k));
break;
}
}
@@ -4423,9 +4697,9 @@ function phpbb_http_login($param)
$password = null;
foreach ($password_keys as $k)
{
- if (isset($_SERVER[$k]))
+ if ($request->is_set($k, \phpbb\request\request_interface::SERVER))
{
- $password = $_SERVER[$k];
+ $password = htmlspecialchars_decode($request->server($k));
break;
}
}
@@ -4468,11 +4742,231 @@ function phpbb_http_login($param)
}
/**
+* Escapes and quotes a string for use as an HTML/XML attribute value.
+*
+* This is a port of Python xml.sax.saxutils quoteattr.
+*
+* The function will attempt to choose a quote character in such a way as to
+* avoid escaping quotes in the string. If this is not possible the string will
+* be wrapped in double quotes and double quotes will be escaped.
+*
+* @param string $data The string to be escaped
+* @param array $entities Associative array of additional entities to be escaped
+* @return string Escaped and quoted string
+*/
+function phpbb_quoteattr($data, $entities = null)
+{
+ $data = str_replace('&', '&amp;', $data);
+ $data = str_replace('>', '&gt;', $data);
+ $data = str_replace('<', '&lt;', $data);
+
+ $data = str_replace("\n", '&#10;', $data);
+ $data = str_replace("\r", '&#13;', $data);
+ $data = str_replace("\t", '&#9;', $data);
+
+ if (!empty($entities))
+ {
+ $data = str_replace(array_keys($entities), array_values($entities), $data);
+ }
+
+ if (strpos($data, '"') !== false)
+ {
+ if (strpos($data, "'") !== false)
+ {
+ $data = '"' . str_replace('"', '&quot;', $data) . '"';
+ }
+ else
+ {
+ $data = "'" . $data . "'";
+ }
+ }
+ else
+ {
+ $data = '"' . $data . '"';
+ }
+
+ return $data;
+}
+
+/**
+* Converts query string (GET) parameters in request into hidden fields.
+*
+* Useful for forwarding GET parameters when submitting forms with GET method.
+*
+* It is possible to omit some of the GET parameters, which is useful if
+* they are specified in the form being submitted.
+*
+* sid is always omitted.
+*
+* @param \phpbb\request\request $request Request object
+* @param array $exclude A list of variable names that should not be forwarded
+* @return string HTML with hidden fields
+*/
+function phpbb_build_hidden_fields_for_query_params($request, $exclude = null)
+{
+ $names = $request->variable_names(\phpbb\request\request_interface::GET);
+ $hidden = '';
+ foreach ($names as $name)
+ {
+ // Sessions are dealt with elsewhere, omit sid always
+ if ($name == 'sid')
+ {
+ continue;
+ }
+
+ // Omit any additional parameters requested
+ if (!empty($exclude) && in_array($name, $exclude))
+ {
+ continue;
+ }
+
+ $escaped_name = phpbb_quoteattr($name);
+
+ // Note: we might retrieve the variable from POST or cookies
+ // here. To avoid exposing cookies, skip variables that are
+ // overwritten somewhere other than GET entirely.
+ $value = $request->variable($name, '', true);
+ $get_value = $request->variable($name, '', true, \phpbb\request\request_interface::GET);
+ if ($value === $get_value)
+ {
+ $escaped_value = phpbb_quoteattr($value);
+ $hidden .= "<input type='hidden' name=$escaped_name value=$escaped_value />";
+ }
+ }
+ return $hidden;
+}
+
+/**
+* Get user avatar
+*
+* @param array $user_row Row from the users table
+* @param string $alt Optional language string for alt tag within image, can be a language key or text
+* @param bool $ignore_config Ignores the config-setting, to be still able to view the avatar in the UCP
+* @param bool $lazy If true, will be lazy loaded (requires JS)
+*
+* @return string Avatar html
+*/
+function phpbb_get_user_avatar($user_row, $alt = 'USER_AVATAR', $ignore_config = false, $lazy = false)
+{
+ $row = \phpbb\avatar\manager::clean_row($user_row, 'user');
+ return phpbb_get_avatar($row, $alt, $ignore_config, $lazy);
+}
+
+/**
+* Get group avatar
+*
+* @param array $group_row Row from the groups table
+* @param string $alt Optional language string for alt tag within image, can be a language key or text
+* @param bool $ignore_config Ignores the config-setting, to be still able to view the avatar in the UCP
+* @param bool $lazy If true, will be lazy loaded (requires JS)
+*
+* @return string Avatar html
+*/
+function phpbb_get_group_avatar($user_row, $alt = 'GROUP_AVATAR', $ignore_config = false, $lazy = false)
+{
+ $row = \phpbb\avatar\manager::clean_row($user_row, 'group');
+ return phpbb_get_avatar($row, $alt, $ignore_config, $lazy);
+}
+
+/**
+* Get avatar
+*
+* @param array $row Row cleaned by \phpbb\avatar\manager::clean_row
+* @param string $alt Optional language string for alt tag within image, can be a language key or text
+* @param bool $ignore_config Ignores the config-setting, to be still able to view the avatar in the UCP
+* @param bool $lazy If true, will be lazy loaded (requires JS)
+*
+* @return string Avatar html
+*/
+function phpbb_get_avatar($row, $alt, $ignore_config = false, $lazy = false)
+{
+ global $user, $config, $cache, $phpbb_root_path, $phpEx;
+ global $request;
+ global $phpbb_container, $phpbb_dispatcher;
+
+ if (!$config['allow_avatar'] && !$ignore_config)
+ {
+ return '';
+ }
+
+ $avatar_data = array(
+ 'src' => $row['avatar'],
+ 'width' => $row['avatar_width'],
+ 'height' => $row['avatar_height'],
+ );
+
+ $phpbb_avatar_manager = $phpbb_container->get('avatar.manager');
+ $driver = $phpbb_avatar_manager->get_driver($row['avatar_type'], !$ignore_config);
+ $html = '';
+
+ if ($driver)
+ {
+ $html = $driver->get_custom_html($user, $row, $alt);
+ if (!empty($html))
+ {
+ return $html;
+ }
+
+ $avatar_data = $driver->get_data($row);
+ }
+ else
+ {
+ $avatar_data['src'] = '';
+ }
+
+ if (!empty($avatar_data['src']))
+ {
+ if ($lazy)
+ {
+ // Determine board url - we may need it later
+ $board_url = generate_board_url() . '/';
+ // This path is sent with the base template paths in the assign_vars()
+ // call below. We need to correct it in case we are accessing from a
+ // controller because the web paths will be incorrect otherwise.
+ $phpbb_path_helper = $phpbb_container->get('path_helper');
+ $corrected_path = $phpbb_path_helper->get_web_root_path();
+
+ $web_path = (defined('PHPBB_USE_BOARD_URL_PATH') && PHPBB_USE_BOARD_URL_PATH) ? $board_url : $corrected_path;
+
+ $theme = "{$web_path}styles/" . rawurlencode($user->style['style_path']) . '/theme';
+
+ $src = 'src="' . $theme . '/images/no_avatar.gif" data-src="' . $avatar_data['src'] . '"';
+ }
+ else
+ {
+ $src = 'src="' . $avatar_data['src'] . '"';
+ }
+
+ $html = '<img class="avatar" ' . $src . ' ' .
+ ($avatar_data['width'] ? ('width="' . $avatar_data['width'] . '" ') : '') .
+ ($avatar_data['height'] ? ('height="' . $avatar_data['height'] . '" ') : '') .
+ 'alt="' . ((!empty($user->lang[$alt])) ? $user->lang[$alt] : $alt) . '" />';
+ }
+
+ /**
+ * Event to modify HTML <img> tag of avatar
+ *
+ * @event core.get_avatar_after
+ * @var array row Row cleaned by \phpbb\avatar\manager::clean_row
+ * @var string alt Optional language string for alt tag within image, can be a language key or text
+ * @var bool ignore_config Ignores the config-setting, to be still able to view the avatar in the UCP
+ * @var array avatar_data The HTML attributes for avatar <img> tag
+ * @var string html The HTML <img> tag of generated avatar
+ * @since 3.1.6-RC1
+ */
+ $vars = array('row', 'alt', 'ignore_config', 'avatar_data', 'html');
+ extract($phpbb_dispatcher->trigger_event('core.get_avatar_after', compact($vars)));
+
+ return $html;
+}
+
+/**
* Generate page header
*/
-function page_header($page_title = '', $display_online_list = true, $item_id = 0, $item = 'forum')
+function page_header($page_title = '', $display_online_list = false, $item_id = 0, $item = 'forum', $send_headers = true)
{
global $db, $config, $template, $SID, $_SID, $_EXTRA_URL, $user, $auth, $phpEx, $phpbb_root_path;
+ global $phpbb_dispatcher, $request, $phpbb_container, $phpbb_admin_path;
if (defined('HEADER_INC'))
{
@@ -4481,6 +4975,31 @@ function page_header($page_title = '', $display_online_list = true, $item_id = 0
define('HEADER_INC', true);
+ // A listener can set this variable to `true` when it overrides this function
+ $page_header_override = false;
+
+ /**
+ * Execute code and/or overwrite page_header()
+ *
+ * @event core.page_header
+ * @var string page_title Page title
+ * @var bool display_online_list Do we display online users list
+ * @var string item Restrict online users to a certain
+ * session item, e.g. forum for
+ * session_forum_id
+ * @var int item_id Restrict online users to item id
+ * @var bool page_header_override Shall we return instead of running
+ * the rest of page_header()
+ * @since 3.1.0-a1
+ */
+ $vars = array('page_title', 'display_online_list', 'item_id', 'item', 'page_header_override');
+ extract($phpbb_dispatcher->trigger_event('core.page_header', compact($vars)));
+
+ if ($page_header_override)
+ {
+ return;
+ }
+
// gzip_compression
if ($config['gzip_compress'])
{
@@ -4504,11 +5023,13 @@ function page_header($page_title = '', $display_online_list = true, $item_id = 0
}
}
+ $user->update_session_infos();
+
// Generate logged in/logged out status
if ($user->data['user_id'] != ANONYMOUS)
{
$u_login_logout = append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=logout', true, $user->session_id);
- $l_login_logout = sprintf($user->lang['LOGOUT_USER'], $user->data['username']);
+ $l_login_logout = $user->lang['LOGOUT'];
}
else
{
@@ -4543,23 +5064,18 @@ function page_header($page_title = '', $display_online_list = true, $item_id = 0
set_config('record_online_date', time(), true);
}
- $l_online_record = sprintf($user->lang['RECORD_ONLINE_USERS'], $config['record_online_users'], $user->format_date($config['record_online_date'], false, true));
+ $l_online_record = $user->lang('RECORD_ONLINE_USERS', (int) $config['record_online_users'], $user->format_date($config['record_online_date'], false, true));
- $l_online_time = ($config['load_online_time'] == 1) ? 'VIEW_ONLINE_TIME' : 'VIEW_ONLINE_TIMES';
- $l_online_time = sprintf($user->lang[$l_online_time], $config['load_online_time']);
+ $l_online_time = $user->lang('VIEW_ONLINE_TIMES', (int) $config['load_online_time']);
}
- $l_privmsgs_text = $l_privmsgs_text_unread = '';
$s_privmsg_new = false;
- // Obtain number of new private messages if user is logged in
+ // Check for new private messages if user is logged in
if (!empty($user->data['is_registered']))
{
if ($user->data['user_new_privmsg'])
{
- $l_message_new = ($user->data['user_new_privmsg'] == 1) ? $user->lang['NEW_PM'] : $user->lang['NEW_PMS'];
- $l_privmsgs_text = sprintf($l_message_new, $user->data['user_new_privmsg']);
-
if (!$user->data['user_last_privmsg'] || $user->data['user_last_privmsg'] > $user->data['session_last_visit'])
{
$sql = 'UPDATE ' . USERS_TABLE . '
@@ -4576,17 +5092,8 @@ function page_header($page_title = '', $display_online_list = true, $item_id = 0
}
else
{
- $l_privmsgs_text = $user->lang['NO_NEW_PM'];
$s_privmsg_new = false;
}
-
- $l_privmsgs_text_unread = '';
-
- if ($user->data['user_unread_privmsg'] && $user->data['user_unread_privmsg'] != $user->data['user_new_privmsg'])
- {
- $l_message_unread = ($user->data['user_unread_privmsg'] == 1) ? $user->lang['UNREAD_PM'] : $user->lang['UNREAD_PMS'];
- $l_privmsgs_text_unread = sprintf($l_message_unread, $user->data['user_unread_privmsg']);
- }
}
$forum_id = request_var('f', 0);
@@ -4607,10 +5114,12 @@ function page_header($page_title = '', $display_online_list = true, $item_id = 0
// Determine board url - we may need it later
$board_url = generate_board_url() . '/';
- $web_path = (defined('PHPBB_USE_BOARD_URL_PATH') && PHPBB_USE_BOARD_URL_PATH) ? $board_url : $phpbb_root_path;
-
- // Which timezone?
- $tz = ($user->data['user_id'] != ANONYMOUS) ? strval(doubleval($user->data['user_timezone'])) : strval(doubleval($config['board_timezone']));
+ // This path is sent with the base template paths in the assign_vars()
+ // call below. We need to correct it in case we are accessing from a
+ // controller because the web paths will be incorrect otherwise.
+ $phpbb_path_helper = $phpbb_container->get('path_helper');
+ $corrected_path = $phpbb_path_helper->get_web_root_path();
+ $web_path = (defined('PHPBB_USE_BOARD_URL_PATH') && PHPBB_USE_BOARD_URL_PATH) ? $board_url : $corrected_path;
// Send a proper content-language to the output
$user_lang = $user->lang['USER_LANG'];
@@ -4634,6 +5143,33 @@ function page_header($page_title = '', $display_online_list = true, $item_id = 0
}
}
+ $dt = $user->create_datetime();
+ $timezone_offset = $user->lang(array('timezones', 'UTC_OFFSET'), phpbb_format_timezone_offset($dt->getOffset()));
+ $timezone_name = $user->timezone->getName();
+ if (isset($user->lang['timezones'][$timezone_name]))
+ {
+ $timezone_name = $user->lang['timezones'][$timezone_name];
+ }
+
+ // Output the notifications
+ $notifications = false;
+ if ($config['load_notifications'] && $user->data['user_id'] != ANONYMOUS && $user->data['user_type'] != USER_IGNORE)
+ {
+ $phpbb_notifications = $phpbb_container->get('notification_manager');
+
+ $notifications = $phpbb_notifications->load_notifications(array(
+ 'all_unread' => true,
+ 'limit' => 5,
+ ));
+
+ foreach ($notifications['notifications'] as $notification)
+ {
+ $template->assign_block_vars('notifications', $notification->prepare_for_display());
+ }
+ }
+
+ $notification_mark_hash = generate_link_hash('mark_all_notifications_read');
+
// The following assigns all _common_ variables that may be used at any point in a template.
$template->assign_vars(array(
'SITENAME' => $config['sitename'],
@@ -4646,8 +5182,17 @@ function page_header($page_title = '', $display_online_list = true, $item_id = 0
'TOTAL_USERS_ONLINE' => $l_online_users,
'LOGGED_IN_USER_LIST' => $online_userlist,
'RECORD_USERS' => $l_online_record,
- 'PRIVATE_MESSAGE_INFO' => $l_privmsgs_text,
- 'PRIVATE_MESSAGE_INFO_UNREAD' => $l_privmsgs_text_unread,
+
+ 'PRIVATE_MESSAGE_COUNT' => (!empty($user->data['user_unread_privmsg'])) ? $user->data['user_unread_privmsg'] : 0,
+ 'CURRENT_USER_AVATAR' => phpbb_get_user_avatar($user->data),
+ 'CURRENT_USERNAME_SIMPLE' => get_username_string('no_profile', $user->data['user_id'], $user->data['username'], $user->data['user_colour']),
+ 'CURRENT_USERNAME_FULL' => get_username_string('full', $user->data['user_id'], $user->data['username'], $user->data['user_colour']),
+ 'UNREAD_NOTIFICATIONS_COUNT' => ($notifications !== false) ? $notifications['unread_count'] : '',
+ 'NOTIFICATIONS_COUNT' => ($notifications !== false) ? $notifications['unread_count'] : '',
+ 'U_VIEW_ALL_NOTIFICATIONS' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=ucp_notifications'),
+ 'U_MARK_ALL_NOTIFICATIONS' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=ucp_notifications&amp;mode=notification_list&amp;mark=all&amp;token=' . $notification_mark_hash),
+ 'U_NOTIFICATION_SETTINGS' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=ucp_notifications&amp;mode=notification_options'),
+ 'S_NOTIFICATIONS_DISPLAY' => $config['load_notifications'],
'S_USER_NEW_PRIVMSG' => $user->data['user_new_privmsg'],
'S_USER_UNREAD_PRIVMSG' => $user->data['user_unread_privmsg'],
@@ -4656,24 +5201,25 @@ function page_header($page_title = '', $display_online_list = true, $item_id = 0
'SID' => $SID,
'_SID' => $_SID,
'SESSION_ID' => $user->session_id,
- 'ROOT_PATH' => $phpbb_root_path,
+ 'ROOT_PATH' => $web_path,
'BOARD_URL' => $board_url,
'L_LOGIN_LOGOUT' => $l_login_logout,
- 'L_INDEX' => $user->lang['FORUM_INDEX'],
+ 'L_INDEX' => ($config['board_index_text'] !== '') ? $config['board_index_text'] : $user->lang['FORUM_INDEX'],
+ 'L_SITE_HOME' => ($config['site_home_text'] !== '') ? $config['site_home_text'] : $user->lang['HOME'],
'L_ONLINE_EXPLAIN' => $l_online_time,
'U_PRIVATEMSGS' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&amp;folder=inbox'),
'U_RETURN_INBOX' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&amp;folder=inbox'),
- 'U_POPUP_PM' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&amp;mode=popup'),
- 'UA_POPUP_PM' => addslashes(append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&amp;mode=popup')),
'U_MEMBERLIST' => append_sid("{$phpbb_root_path}memberlist.$phpEx"),
'U_VIEWONLINE' => ($auth->acl_gets('u_viewprofile', 'a_user', 'a_useradd', 'a_userdel')) ? append_sid("{$phpbb_root_path}viewonline.$phpEx") : '',
'U_LOGIN_LOGOUT' => $u_login_logout,
'U_INDEX' => append_sid("{$phpbb_root_path}index.$phpEx"),
'U_SEARCH' => append_sid("{$phpbb_root_path}search.$phpEx"),
+ 'U_SITE_HOME' => $config['site_home_url'],
'U_REGISTER' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=register'),
'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' => append_sid("{$phpbb_root_path}faq.$phpEx"),
'U_SEARCH_SELF' => append_sid("{$phpbb_root_path}search.$phpEx", 'search_id=egosearch'),
@@ -4682,7 +5228,8 @@ function page_header($page_title = '', $display_online_list = true, $item_id = 0
'U_SEARCH_UNREAD' => append_sid("{$phpbb_root_path}search.$phpEx", 'search_id=unreadposts'),
'U_SEARCH_ACTIVE_TOPICS'=> append_sid("{$phpbb_root_path}search.$phpEx", 'search_id=active_topics'),
'U_DELETE_COOKIES' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=delete_cookies'),
- 'U_TEAM' => ($user->data['user_id'] != ANONYMOUS && !$auth->acl_get('u_viewprofile')) ? '' : append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=leaders'),
+ 'U_CONTACT_US' => ($config['contact_admin_form_enable'] && $config['email_enable']) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=contactadmin') : '',
+ 'U_TEAM' => ($user->data['user_id'] != ANONYMOUS && !$auth->acl_get('u_viewprofile')) ? '' : append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=team'),
'U_TERMS_USE' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=terms'),
'U_PRIVACY' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=privacy'),
'U_RESTORE_PERMISSIONS' => ($user->data['user_perm_from'] && $auth->acl_get('a_switchperm')) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=restore_perm') : '',
@@ -4693,7 +5240,6 @@ function page_header($page_title = '', $display_online_list = true, $item_id = 0
'S_BOARD_DISABLED' => ($config['board_disable']) ? true : false,
'S_REGISTERED_USER' => (!empty($user->data['is_registered'])) ? true : false,
'S_IS_BOT' => (!empty($user->data['is_bot'])) ? true : false,
- 'S_USER_PM_POPUP' => $user->optionget('popuppm'),
'S_USER_LANG' => $user_lang,
'S_USER_BROWSER' => (isset($user->data['session_browser'])) ? $user->data['session_browser'] : $user->lang['UNKNOWN_BROWSER'],
'S_USERNAME' => $user->data['username'],
@@ -4701,7 +5247,7 @@ function page_header($page_title = '', $display_online_list = true, $item_id = 0
'S_CONTENT_FLOW_BEGIN' => ($user->lang['DIRECTION'] == 'ltr') ? 'left' : 'right',
'S_CONTENT_FLOW_END' => ($user->lang['DIRECTION'] == 'ltr') ? 'right' : 'left',
'S_CONTENT_ENCODING' => 'UTF-8',
- 'S_TIMEZONE' => ($user->data['user_dst'] || ($user->data['user_id'] == ANONYMOUS && $config['board_dst'])) ? sprintf($user->lang['ALL_TIMES'], $user->lang['tz'][$tz], $user->lang['tz']['dst']) : sprintf($user->lang['ALL_TIMES'], $user->lang['tz'][$tz], ''),
+ 'S_TIMEZONE' => sprintf($user->lang['ALL_TIMES'], $timezone_offset, $timezone_name),
'S_DISPLAY_ONLINE_LIST' => ($l_online_time) ? 1 : 0,
'S_DISPLAY_SEARCH' => (!$config['load_search']) ? 0 : (isset($auth) ? ($auth->acl_get('u_search') && $auth->acl_getf_global('f_search')) : 1),
'S_DISPLAY_PM' => ($config['allow_privmsg'] && !empty($user->data['is_registered']) && ($auth->acl_get('u_readpm') || $auth->acl_get('u_sendpm'))) ? true : false,
@@ -4711,8 +5257,8 @@ function page_header($page_title = '', $display_online_list = true, $item_id = 0
'S_FORUM_ID' => $forum_id,
'S_TOPIC_ID' => $topic_id,
- 'S_LOGIN_ACTION' => ((!defined('ADMIN_START')) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=login') : append_sid("index.$phpEx", false, true, $user->session_id)),
- 'S_LOGIN_REDIRECT' => build_hidden_fields(array('redirect' => build_url())),
+ 'S_LOGIN_ACTION' => ((!defined('ADMIN_START')) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=login') : append_sid("{$phpbb_admin_path}index.$phpEx", false, true, $user->session_id)),
+ 'S_LOGIN_REDIRECT' => build_hidden_fields(array('redirect' => $phpbb_path_helper->remove_web_root_path(build_url()))),
'S_ENABLE_FEEDS' => ($config['feed_enable']) ? true : false,
'S_ENABLE_FEEDS_OVERALL' => ($config['feed_overall']) ? true : false,
@@ -4725,11 +5271,11 @@ function page_header($page_title = '', $display_online_list = true, $item_id = 0
'S_SEARCH_HIDDEN_FIELDS' => build_hidden_fields($s_search_hidden_fields),
- 'T_THEME_PATH' => "{$web_path}styles/" . rawurlencode($user->theme['theme_path']) . '/theme',
- 'T_TEMPLATE_PATH' => "{$web_path}styles/" . rawurlencode($user->theme['template_path']) . '/template',
- 'T_SUPER_TEMPLATE_PATH' => (isset($user->theme['template_inherit_path']) && $user->theme['template_inherit_path']) ? "{$web_path}styles/" . rawurlencode($user->theme['template_inherit_path']) . '/template' : "{$web_path}styles/" . rawurlencode($user->theme['template_path']) . '/template',
- 'T_IMAGESET_PATH' => "{$web_path}styles/" . rawurlencode($user->theme['imageset_path']) . '/imageset',
- 'T_IMAGESET_LANG_PATH' => "{$web_path}styles/" . rawurlencode($user->theme['imageset_path']) . '/imageset/' . $user->lang_name,
+ 'T_ASSETS_VERSION' => $config['assets_version'],
+ 'T_ASSETS_PATH' => "{$web_path}assets",
+ 'T_THEME_PATH' => "{$web_path}styles/" . rawurlencode($user->style['style_path']) . '/theme',
+ 'T_TEMPLATE_PATH' => "{$web_path}styles/" . rawurlencode($user->style['style_path']) . '/template',
+ 'T_SUPER_TEMPLATE_PATH' => "{$web_path}styles/" . rawurlencode($user->style['style_path']) . '/template',
'T_IMAGES_PATH' => "{$web_path}images/",
'T_SMILIES_PATH' => "{$web_path}{$config['smilies_path']}/",
'T_AVATAR_PATH' => "{$web_path}{$config['avatar_path']}/",
@@ -4737,14 +5283,15 @@ function page_header($page_title = '', $display_online_list = true, $item_id = 0
'T_ICONS_PATH' => "{$web_path}{$config['icons_path']}/",
'T_RANKS_PATH' => "{$web_path}{$config['ranks_path']}/",
'T_UPLOAD_PATH' => "{$web_path}{$config['upload_path']}/",
- 'T_STYLESHEET_LINK' => (!$user->theme['theme_storedb']) ? "{$web_path}styles/" . rawurlencode($user->theme['theme_path']) . '/theme/stylesheet.css' : append_sid("{$phpbb_root_path}style.$phpEx", 'id=' . $user->theme['style_id'] . '&amp;lang=' . $user->lang_name),
- 'T_STYLESHEET_NAME' => $user->theme['theme_name'],
-
- 'T_THEME_NAME' => rawurlencode($user->theme['theme_path']),
- 'T_TEMPLATE_NAME' => rawurlencode($user->theme['template_path']),
- 'T_SUPER_TEMPLATE_NAME' => rawurlencode((isset($user->theme['template_inherit_path']) && $user->theme['template_inherit_path']) ? $user->theme['template_inherit_path'] : $user->theme['template_path']),
- 'T_IMAGESET_NAME' => rawurlencode($user->theme['imageset_path']),
- 'T_IMAGESET_LANG_NAME' => $user->data['user_lang'],
+ 'T_STYLESHEET_LINK' => "{$web_path}styles/" . rawurlencode($user->style['style_path']) . '/theme/stylesheet.css?assets_version=' . $config['assets_version'],
+ 'T_STYLESHEET_LANG_LINK' => "{$web_path}styles/" . rawurlencode($user->style['style_path']) . '/theme/' . $user->lang_name . '/stylesheet.css?assets_version=' . $config['assets_version'],
+ 'T_JQUERY_LINK' => !empty($config['allow_cdn']) && !empty($config['load_jquery_url']) ? $config['load_jquery_url'] : "{$web_path}assets/javascript/jquery.min.js?assets_version=" . $config['assets_version'],
+ 'S_ALLOW_CDN' => !empty($config['allow_cdn']),
+
+ 'T_THEME_NAME' => rawurlencode($user->style['style_path']),
+ 'T_THEME_LANG_NAME' => $user->data['user_lang'],
+ 'T_TEMPLATE_NAME' => $user->style['style_path'],
+ 'T_SUPER_TEMPLATE_NAME' => rawurlencode((isset($user->style['style_parent_tree']) && $user->style['style_parent_tree']) ? $user->style['style_parent_tree'] : $user->style['style_path']),
'T_IMAGES' => 'images',
'T_SMILIES' => $config['smilies_path'],
'T_AVATAR' => $config['avatar_path'],
@@ -4754,75 +5301,174 @@ function page_header($page_title = '', $display_online_list = true, $item_id = 0
'T_UPLOAD' => $config['upload_path'],
'SITE_LOGO_IMG' => $user->img('site_logo'),
-
- 'A_COOKIE_SETTINGS' => addslashes('; path=' . $config['cookie_path'] . ((!$config['cookie_domain'] || $config['cookie_domain'] == 'localhost' || $config['cookie_domain'] == '127.0.0.1') ? '' : '; domain=' . $config['cookie_domain']) . ((!$config['cookie_secure']) ? '' : '; secure')),
));
- // application/xhtml+xml not used because of IE
- header('Content-type: text/html; charset=UTF-8');
+ $http_headers = array();
+
+ if ($send_headers)
+ {
+ // An array of http headers that phpbb will set. The following event may override these.
+ $http_headers += array(
+ // application/xhtml+xml not used because of IE
+ 'Content-type' => 'text/html; charset=UTF-8',
+ 'Cache-Control' => 'private, no-cache="set-cookie"',
+ 'Expires' => gmdate('D, d M Y H:i:s', time()) . ' GMT',
+ );
+ if (!empty($user->data['is_bot']))
+ {
+ // Let reverse proxies know we detected a bot.
+ $http_headers['X-PHPBB-IS-BOT'] = 'yes';
+ }
+ }
- header('Cache-Control: private, no-cache="set-cookie"');
- header('Expires: 0');
- header('Pragma: no-cache');
+ /**
+ * Execute code and/or overwrite _common_ template variables after they have been assigned.
+ *
+ * @event core.page_header_after
+ * @var string page_title Page title
+ * @var bool display_online_list Do we display online users list
+ * @var string item Restrict online users to a certain
+ * session item, e.g. forum for
+ * session_forum_id
+ * @var int item_id Restrict online users to item id
+ * @var array http_headers HTTP headers that should be set by phpbb
+ *
+ * @since 3.1.0-b3
+ */
+ $vars = array('page_title', 'display_online_list', 'item_id', 'item', 'http_headers');
+ extract($phpbb_dispatcher->trigger_event('core.page_header_after', compact($vars)));
- if (!empty($user->data['is_bot']))
+ foreach ($http_headers as $hname => $hval)
{
- // Let reverse proxies know we detected a bot.
- header('X-PHPBB-IS-BOT: yes');
+ header((string) $hname . ': ' . (string) $hval);
}
return;
}
/**
-* Generate page footer
+* Check and display the SQL report if requested.
+*
+* @param \phpbb\request\request_interface $request Request object
+* @param \phpbb\auth\auth $auth Auth object
+* @param \phpbb\db\driver\driver_interface $db Database connection
*/
-function page_footer($run_cron = true)
+function phpbb_check_and_display_sql_report(\phpbb\request\request_interface $request, \phpbb\auth\auth $auth, \phpbb\db\driver\driver_interface $db)
{
- global $db, $config, $template, $user, $auth, $cache, $starttime, $phpbb_root_path, $phpEx;
+ if ($request->variable('explain', false) && $auth->acl_get('a_') && defined('DEBUG'))
+ {
+ $db->sql_report('display');
+ }
+}
+
+/**
+* Generate the debug output string
+*
+* @param \phpbb\db\driver\driver_interface $db Database connection
+* @param \phpbb\config\config $config Config object
+* @param \phpbb\auth\auth $auth Auth object
+* @param \phpbb\user $user User object
+* @param \phpbb\event\dispatcher_interface $phpbb_dispatcher Event dispatcher
+* @return string
+*/
+function phpbb_generate_debug_output(\phpbb\db\driver\driver_interface $db, \phpbb\config\config $config, \phpbb\auth\auth $auth, \phpbb\user $user, \phpbb\event\dispatcher_interface $phpbb_dispatcher)
+{
+ $debug_info = array();
// Output page creation time
- if (defined('DEBUG'))
+ if (defined('PHPBB_DISPLAY_LOAD_TIME'))
{
- $mtime = explode(' ', microtime());
- $totaltime = $mtime[0] + $mtime[1] - $starttime;
-
- if (!empty($_REQUEST['explain']) && $auth->acl_get('a_') && defined('DEBUG_EXTRA') && method_exists($db, 'sql_report'))
+ if (isset($GLOBALS['starttime']))
{
- $db->sql_report('display');
+ $totaltime = microtime(true) - $GLOBALS['starttime'];
+ $debug_info[] = sprintf('<abbr title="SQL time: %.3fs / PHP time: %.3fs">Time: %.3fs</abbr>', $db->get_sql_time(), ($totaltime - $db->get_sql_time()), $totaltime);
}
- $debug_output = sprintf('Time : %.3fs | ' . $db->sql_num_queries() . ' Queries | GZIP : ' . (($config['gzip_compress'] && @extension_loaded('zlib')) ? 'On' : 'Off') . (($user->load) ? ' | Load : ' . $user->load : ''), $totaltime);
+ $debug_info[] = sprintf('<abbr title="Cached: %d">Queries: %d</abbr>', $db->sql_num_queries(true), $db->sql_num_queries());
- if ($auth->acl_get('a_') && defined('DEBUG_EXTRA'))
+ $memory_usage = memory_get_peak_usage();
+ if ($memory_usage)
{
- if (function_exists('memory_get_usage'))
- {
- if ($memory_usage = memory_get_usage())
- {
- global $base_memory_usage;
- $memory_usage -= $base_memory_usage;
- $memory_usage = get_formatted_filesize($memory_usage);
+ $memory_usage = get_formatted_filesize($memory_usage);
- $debug_output .= ' | Memory Usage: ' . $memory_usage;
- }
- }
+ $debug_info[] = 'Peak Memory Usage: ' . $memory_usage;
+ }
+ }
+
+ if (defined('DEBUG'))
+ {
+ $debug_info[] = 'GZIP: ' . (($config['gzip_compress'] && @extension_loaded('zlib')) ? 'On' : 'Off');
- $debug_output .= ' | <a href="' . build_url() . '&amp;explain=1">Explain</a>';
+ if ($user->load)
+ {
+ $debug_info[] = 'Load: ' . $user->load;
+ }
+
+ if ($auth->acl_get('a_'))
+ {
+ $debug_info[] = '<a href="' . build_url() . '&amp;explain=1">SQL Explain</a>';
}
}
+ /**
+ * Modify debug output information
+ *
+ * @event core.phpbb_generate_debug_output
+ * @var array debug_info Array of strings with debug information
+ *
+ * @since 3.1.0-RC3
+ */
+ $vars = array('debug_info');
+ extract($phpbb_dispatcher->trigger_event('core.phpbb_generate_debug_output', compact($vars)));
+
+ return implode(' | ', $debug_info);
+}
+
+/**
+* Generate page footer
+*
+* @param bool $run_cron Whether or not to run the cron
+* @param bool $display_template Whether or not to display the template
+* @param bool $exit_handler Whether or not to run the exit_handler()
+*/
+function page_footer($run_cron = true, $display_template = true, $exit_handler = true)
+{
+ global $db, $config, $template, $user, $auth, $cache, $starttime, $phpbb_root_path, $phpEx;
+ global $request, $phpbb_dispatcher, $phpbb_admin_path;
+
+ // A listener can set this variable to `true` when it overrides this function
+ $page_footer_override = false;
+
+ /**
+ * Execute code and/or overwrite page_footer()
+ *
+ * @event core.page_footer
+ * @var bool run_cron Shall we run cron tasks
+ * @var bool page_footer_override Shall we return instead of running
+ * the rest of page_footer()
+ * @since 3.1.0-a1
+ */
+ $vars = array('run_cron', 'page_footer_override');
+ extract($phpbb_dispatcher->trigger_event('core.page_footer', compact($vars)));
+
+ if ($page_footer_override)
+ {
+ return;
+ }
+
+ phpbb_check_and_display_sql_report($request, $auth, $db);
+
$template->assign_vars(array(
- 'DEBUG_OUTPUT' => (defined('DEBUG')) ? $debug_output : '',
+ 'DEBUG_OUTPUT' => phpbb_generate_debug_output($db, $config, $auth, $user, $phpbb_dispatcher),
'TRANSLATION_INFO' => (!empty($user->lang['TRANSLATION_INFO'])) ? $user->lang['TRANSLATION_INFO'] : '',
- 'CREDIT_LINE' => $user->lang('POWERED_BY', '<a href="https://www.phpbb.com/">phpBB</a>&reg; Forum Software &copy; phpBB Group'),
+ 'CREDIT_LINE' => $user->lang('POWERED_BY', '<a href="https://www.phpbb.com/">phpBB</a>&reg; Forum Software &copy; phpBB Limited'),
- 'U_ACP' => ($auth->acl_get('a_') && !empty($user->data['is_registered'])) ? append_sid("{$phpbb_root_path}adm/index.$phpEx", false, true, $user->session_id) : '')
+ 'U_ACP' => ($auth->acl_get('a_') && !empty($user->data['is_registered'])) ? append_sid("{$phpbb_admin_path}index.$phpEx", false, true, $user->session_id) : '')
);
// Call cron-type script
$call_cron = false;
- if (!defined('IN_CRON') && $run_cron && !$config['board_disable'] && !$user->data['is_bot'])
+ if (!defined('IN_CRON') && !$config['use_system_cron'] && $run_cron && !$config['board_disable'] && !$user->data['is_bot'] && !$cache->get('_cron.lock_check'))
{
$call_cron = true;
$time_now = (!empty($user->time_now) && is_int($user->time_now)) ? $user->time_now : time();
@@ -4843,47 +5489,44 @@ function page_footer($run_cron = true)
// Call cron job?
if ($call_cron)
{
- $cron_type = '';
+ global $phpbb_container;
+ $cron = $phpbb_container->get('cron.manager');
+ $task = $cron->find_one_ready_task();
- if ($time_now - $config['queue_interval'] > $config['last_queue_run'] && !defined('IN_ADMIN') && file_exists($phpbb_root_path . 'cache/queue.' . $phpEx))
- {
- // Process email queue
- $cron_type = 'queue';
- }
- else if (method_exists($cache, 'tidy') && $time_now - $config['cache_gc'] > $config['cache_last_gc'])
- {
- // Tidy the cache
- $cron_type = 'tidy_cache';
- }
- else if ($config['warnings_expire_days'] && ($time_now - $config['warnings_gc'] > $config['warnings_last_gc']))
- {
- $cron_type = 'tidy_warnings';
- }
- else if ($time_now - $config['database_gc'] > $config['database_last_gc'])
+ if ($task)
{
- // Tidy the database
- $cron_type = 'tidy_database';
+ $url = $task->get_url();
+ $template->assign_var('RUN_CRON_TASK', '<img src="' . $url . '" width="1" height="1" alt="cron" />');
}
- else if ($time_now - $config['search_gc'] > $config['search_last_gc'])
- {
- // Tidy the search
- $cron_type = 'tidy_search';
- }
- else if ($time_now - $config['session_gc'] > $config['session_last_gc'])
- {
- $cron_type = 'tidy_sessions';
- }
-
- if ($cron_type)
+ else
{
- $template->assign_var('RUN_CRON_TASK', '<img src="' . append_sid($phpbb_root_path . 'cron.' . $phpEx, 'cron_type=' . $cron_type) . '" width="1" height="1" alt="cron" />');
+ $cache->put('_cron.lock_check', true, 60);
}
}
- $template->display('body');
+ /**
+ * Execute code and/or modify output before displaying the template.
+ *
+ * @event core.page_footer_after
+ * @var bool display_template Whether or not to display the template
+ * @var bool exit_handler Whether or not to run the exit_handler()
+ *
+ * @since 3.1.0-RC5
+ */
+ $vars = array('display_template', 'exit_handler');
+ extract($phpbb_dispatcher->trigger_event('core.page_footer_after', compact($vars)));
+
+ if ($display_template)
+ {
+ $template->display('body');
+ }
garbage_collection();
- exit_handler();
+
+ if ($exit_handler)
+ {
+ exit_handler();
+ }
}
/**
@@ -4893,6 +5536,18 @@ function page_footer($run_cron = true)
function garbage_collection()
{
global $cache, $db;
+ global $phpbb_dispatcher;
+
+ if (!empty($phpbb_dispatcher))
+ {
+ /**
+ * Unload some objects, to free some memory, before we finish our task
+ *
+ * @event core.garbage_collection
+ * @since 3.1.0-a1
+ */
+ $phpbb_dispatcher->dispatch('core.garbage_collection');
+ }
// Unload cache, must be done before the DB connection if closed
if (!empty($cache))
@@ -4932,7 +5587,7 @@ function exit_handler()
}
/**
-* Handler for init calls in phpBB. This function is called in user::setup();
+* Handler for init calls in phpBB. This function is called in \phpbb\user::setup();
* This function supports hooks.
*/
function phpbb_user_session_handler()
@@ -4950,4 +5605,70 @@ function phpbb_user_session_handler()
return;
}
-?> \ No newline at end of file
+/**
+* Check if PCRE has UTF-8 support
+* PHP may not be linked with the bundled PCRE lib and instead with an older version
+*
+* @return bool Returns true if PCRE (the regular expressions library) supports UTF-8 encoding
+*/
+function phpbb_pcre_utf8_support()
+{
+ static $utf8_pcre_properties = null;
+ if (is_null($utf8_pcre_properties))
+ {
+ $utf8_pcre_properties = (@preg_match('/\p{L}/u', 'a') !== false);
+ }
+ return $utf8_pcre_properties;
+}
+
+/**
+* Casts a numeric string $input to an appropriate numeric type (i.e. integer or float)
+*
+* @param string $input A numeric string.
+*
+* @return int|float Integer $input if $input fits integer,
+* float $input otherwise.
+*/
+function phpbb_to_numeric($input)
+{
+ return ($input > PHP_INT_MAX) ? (float) $input : (int) $input;
+}
+
+/**
+* Get the board contact details (e.g. for emails)
+*
+* @param \phpbb\config\config $config
+* @param string $phpEx
+* @return string
+*/
+function phpbb_get_board_contact(\phpbb\config\config $config, $phpEx)
+{
+ if ($config['contact_admin_form_enable'])
+ {
+ return generate_board_url() . '/memberlist.' . $phpEx . '?mode=contactadmin';
+ }
+ else
+ {
+ return $config['board_contact'];
+ }
+}
+
+/**
+* Get a clickable board contact details link
+*
+* @param \phpbb\config\config $config
+* @param string $phpbb_root_path
+* @param string $phpEx
+* @return string
+*/
+function phpbb_get_board_contact_link(\phpbb\config\config $config, $phpbb_root_path, $phpEx)
+{
+ if ($config['contact_admin_form_enable'] && $config['email_enable'])
+ {
+ return append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=contactadmin');
+ }
+ else
+ {
+ return 'mailto:' . htmlspecialchars($config['board_contact']);
+ }
+}
diff --git a/phpBB/includes/functions_acp.php b/phpBB/includes/functions_acp.php
new file mode 100644
index 0000000000..c4afb39ff0
--- /dev/null
+++ b/phpBB/includes/functions_acp.php
@@ -0,0 +1,717 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+/**
+* @ignore
+*/
+if (!defined('IN_PHPBB'))
+{
+ exit;
+}
+
+/**
+* Header for acp pages
+*/
+function adm_page_header($page_title)
+{
+ global $config, $db, $user, $template;
+ global $phpbb_root_path, $phpbb_admin_path, $phpEx, $SID, $_SID;
+ global $phpbb_dispatcher;
+
+ if (defined('HEADER_INC'))
+ {
+ return;
+ }
+
+ define('HEADER_INC', true);
+
+ // A listener can set this variable to `true` when it overrides this function
+ $adm_page_header_override = false;
+
+ /**
+ * Execute code and/or overwrite adm_page_header()
+ *
+ * @event core.adm_page_header
+ * @var string page_title Page title
+ * @var bool adm_page_header_override Shall we return instead of
+ * running the rest of adm_page_header()
+ * @since 3.1.0-a1
+ */
+ $vars = array('page_title', 'adm_page_header_override');
+ extract($phpbb_dispatcher->trigger_event('core.adm_page_header', compact($vars)));
+
+ if ($adm_page_header_override)
+ {
+ return;
+ }
+
+ $user->update_session_infos();
+
+ // gzip_compression
+ if ($config['gzip_compress'])
+ {
+ if (@extension_loaded('zlib') && !headers_sent())
+ {
+ ob_start('ob_gzhandler');
+ }
+ }
+
+ $template->assign_vars(array(
+ 'PAGE_TITLE' => $page_title,
+ 'USERNAME' => $user->data['username'],
+
+ 'SID' => $SID,
+ '_SID' => $_SID,
+ 'SESSION_ID' => $user->session_id,
+ 'ROOT_PATH' => $phpbb_root_path,
+ 'ADMIN_ROOT_PATH' => $phpbb_admin_path,
+
+ 'U_LOGOUT' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=logout'),
+ 'U_ADM_LOGOUT' => append_sid("{$phpbb_admin_path}index.$phpEx", 'action=admlogout'),
+ 'U_ADM_INDEX' => append_sid("{$phpbb_admin_path}index.$phpEx"),
+ 'U_INDEX' => append_sid("{$phpbb_root_path}index.$phpEx"),
+
+ 'T_IMAGES_PATH' => "{$phpbb_root_path}images/",
+ 'T_SMILIES_PATH' => "{$phpbb_root_path}{$config['smilies_path']}/",
+ 'T_AVATAR_PATH' => "{$phpbb_root_path}{$config['avatar_path']}/",
+ 'T_AVATAR_GALLERY_PATH' => "{$phpbb_root_path}{$config['avatar_gallery_path']}/",
+ 'T_ICONS_PATH' => "{$phpbb_root_path}{$config['icons_path']}/",
+ 'T_RANKS_PATH' => "{$phpbb_root_path}{$config['ranks_path']}/",
+ 'T_UPLOAD_PATH' => "{$phpbb_root_path}{$config['upload_path']}/",
+
+ 'T_ASSETS_VERSION' => $config['assets_version'],
+
+ 'ICON_MOVE_UP' => '<img src="' . htmlspecialchars($phpbb_admin_path) . 'images/icon_up.gif" alt="' . $user->lang['MOVE_UP'] . '" title="' . $user->lang['MOVE_UP'] . '" />',
+ 'ICON_MOVE_UP_DISABLED' => '<img src="' . htmlspecialchars($phpbb_admin_path) . 'images/icon_up_disabled.gif" alt="' . $user->lang['MOVE_UP'] . '" title="' . $user->lang['MOVE_UP'] . '" />',
+ 'ICON_MOVE_DOWN' => '<img src="' . htmlspecialchars($phpbb_admin_path) . 'images/icon_down.gif" alt="' . $user->lang['MOVE_DOWN'] . '" title="' . $user->lang['MOVE_DOWN'] . '" />',
+ 'ICON_MOVE_DOWN_DISABLED' => '<img src="' . htmlspecialchars($phpbb_admin_path) . 'images/icon_down_disabled.gif" alt="' . $user->lang['MOVE_DOWN'] . '" title="' . $user->lang['MOVE_DOWN'] . '" />',
+ 'ICON_EDIT' => '<img src="' . htmlspecialchars($phpbb_admin_path) . 'images/icon_edit.gif" alt="' . $user->lang['EDIT'] . '" title="' . $user->lang['EDIT'] . '" />',
+ 'ICON_EDIT_DISABLED' => '<img src="' . htmlspecialchars($phpbb_admin_path) . 'images/icon_edit_disabled.gif" alt="' . $user->lang['EDIT'] . '" title="' . $user->lang['EDIT'] . '" />',
+ 'ICON_DELETE' => '<img src="' . htmlspecialchars($phpbb_admin_path) . 'images/icon_delete.gif" alt="' . $user->lang['DELETE'] . '" title="' . $user->lang['DELETE'] . '" />',
+ 'ICON_DELETE_DISABLED' => '<img src="' . htmlspecialchars($phpbb_admin_path) . 'images/icon_delete_disabled.gif" alt="' . $user->lang['DELETE'] . '" title="' . $user->lang['DELETE'] . '" />',
+ 'ICON_SYNC' => '<img src="' . htmlspecialchars($phpbb_admin_path) . 'images/icon_sync.gif" alt="' . $user->lang['RESYNC'] . '" title="' . $user->lang['RESYNC'] . '" />',
+ 'ICON_SYNC_DISABLED' => '<img src="' . htmlspecialchars($phpbb_admin_path) . 'images/icon_sync_disabled.gif" alt="' . $user->lang['RESYNC'] . '" title="' . $user->lang['RESYNC'] . '" />',
+
+ 'S_USER_LANG' => $user->lang['USER_LANG'],
+ 'S_CONTENT_DIRECTION' => $user->lang['DIRECTION'],
+ 'S_CONTENT_ENCODING' => 'UTF-8',
+ 'S_CONTENT_FLOW_BEGIN' => ($user->lang['DIRECTION'] == 'ltr') ? 'left' : 'right',
+ 'S_CONTENT_FLOW_END' => ($user->lang['DIRECTION'] == 'ltr') ? 'right' : 'left',
+ ));
+
+ // An array of http headers that phpbb will set. The following event may override these.
+ $http_headers = array(
+ // application/xhtml+xml not used because of IE
+ 'Content-type' => 'text/html; charset=UTF-8',
+ 'Cache-Control' => 'private, no-cache="set-cookie"',
+ 'Expires' => gmdate('D, d M Y H:i:s', time()) . ' GMT',
+ );
+
+ /**
+ * Execute code and/or overwrite _common_ template variables after they have been assigned.
+ *
+ * @event core.adm_page_header_after
+ * @var string page_title Page title
+ * @var array http_headers HTTP headers that should be set by phpbb
+ *
+ * @since 3.1.0-RC3
+ */
+ $vars = array('page_title', 'http_headers');
+ extract($phpbb_dispatcher->trigger_event('core.adm_page_header_after', compact($vars)));
+
+ foreach ($http_headers as $hname => $hval)
+ {
+ header((string) $hname . ': ' . (string) $hval);
+ }
+
+ return;
+}
+
+/**
+* Page footer for acp pages
+*/
+function adm_page_footer($copyright_html = true)
+{
+ global $db, $config, $template, $user, $auth, $cache;
+ global $starttime, $phpbb_root_path, $phpbb_admin_path, $phpEx;
+ global $request, $phpbb_dispatcher;
+
+ // A listener can set this variable to `true` when it overrides this function
+ $adm_page_footer_override = false;
+
+ /**
+ * Execute code and/or overwrite adm_page_footer()
+ *
+ * @event core.adm_page_footer
+ * @var bool copyright_html Shall we display the copyright?
+ * @var bool adm_page_footer_override Shall we return instead of
+ * running the rest of adm_page_footer()
+ * @since 3.1.0-a1
+ */
+ $vars = array('copyright_html', 'adm_page_footer_override');
+ extract($phpbb_dispatcher->trigger_event('core.adm_page_footer', compact($vars)));
+
+ if ($adm_page_footer_override)
+ {
+ return;
+ }
+
+ phpbb_check_and_display_sql_report($request, $auth, $db);
+
+ $template->assign_vars(array(
+ 'DEBUG_OUTPUT' => phpbb_generate_debug_output($db, $config, $auth, $user, $phpbb_dispatcher),
+ 'TRANSLATION_INFO' => (!empty($user->lang['TRANSLATION_INFO'])) ? $user->lang['TRANSLATION_INFO'] : '',
+ 'S_COPYRIGHT_HTML' => $copyright_html,
+ 'CREDIT_LINE' => $user->lang('POWERED_BY', '<a href="https://www.phpbb.com/">phpBB</a>&reg; Forum Software &copy; phpBB Limited'),
+ 'T_JQUERY_LINK' => !empty($config['allow_cdn']) && !empty($config['load_jquery_url']) ? $config['load_jquery_url'] : "{$phpbb_root_path}assets/javascript/jquery.min.js",
+ 'S_ALLOW_CDN' => !empty($config['allow_cdn']),
+ 'VERSION' => $config['version'])
+ );
+
+ $template->display('body');
+
+ garbage_collection();
+ exit_handler();
+}
+
+/**
+* Generate back link for acp pages
+*/
+function adm_back_link($u_action)
+{
+ global $user;
+ return '<br /><br /><a href="' . $u_action . '">&laquo; ' . $user->lang['BACK_TO_PREV'] . '</a>';
+}
+
+/**
+* Build select field options in acp pages
+*/
+function build_select($option_ary, $option_default = false)
+{
+ global $user;
+
+ $html = '';
+ foreach ($option_ary as $value => $title)
+ {
+ $selected = ($option_default !== false && $value == $option_default) ? ' selected="selected"' : '';
+ $html .= '<option value="' . $value . '"' . $selected . '>' . $user->lang[$title] . '</option>';
+ }
+
+ return $html;
+}
+
+/**
+* Build radio fields in acp pages
+*/
+function h_radio($name, $input_ary, $input_default = false, $id = false, $key = false, $separator = '')
+{
+ global $user;
+
+ $html = '';
+ $id_assigned = false;
+ foreach ($input_ary as $value => $title)
+ {
+ $selected = ($input_default !== false && $value == $input_default) ? ' checked="checked"' : '';
+ $html .= '<label><input type="radio" name="' . $name . '"' . (($id && !$id_assigned) ? ' id="' . $id . '"' : '') . ' value="' . $value . '"' . $selected . (($key) ? ' accesskey="' . $key . '"' : '') . ' class="radio" /> ' . $user->lang[$title] . '</label>' . $separator;
+ $id_assigned = true;
+ }
+
+ return $html;
+}
+
+/**
+* Build configuration template for acp configuration pages
+*/
+function build_cfg_template($tpl_type, $key, &$new, $config_key, $vars)
+{
+ global $user, $module, $phpbb_dispatcher;
+
+ $tpl = '';
+ $name = 'config[' . $config_key . ']';
+
+ // Make sure there is no notice printed out for non-existent config options (we simply set them)
+ if (!isset($new[$config_key]))
+ {
+ $new[$config_key] = '';
+ }
+
+ switch ($tpl_type[0])
+ {
+ case 'password':
+ if ($new[$config_key] !== '')
+ {
+ // replace passwords with asterixes
+ $new[$config_key] = '********';
+ }
+ case 'text':
+ case 'url':
+ case 'email':
+ case 'tel':
+ case 'search':
+ // maxlength and size are only valid for these types and will be
+ // ignored for other input types.
+ $size = (int) $tpl_type[1];
+ $maxlength = (int) $tpl_type[2];
+
+ $tpl = '<input id="' . $key . '" type="' . $tpl_type[0] . '"' . (($size) ? ' size="' . $size . '"' : '') . ' maxlength="' . (($maxlength) ? $maxlength : 255) . '" name="' . $name . '" value="' . $new[$config_key] . '"' . (($tpl_type[0] === 'password') ? ' autocomplete="off"' : '') . ' />';
+ break;
+
+ case 'color':
+ case 'datetime':
+ case 'datetime-local':
+ case 'month':
+ case 'week':
+ $tpl = '<input id="' . $key . '" type="' . $tpl_type[0] . '" name="' . $name . '" value="' . $new[$config_key] . '" />';
+ break;
+
+ case 'date':
+ case 'time':
+ case 'number':
+ case 'range':
+ $max = '';
+ $min = ( isset($tpl_type[1]) ) ? (int) $tpl_type[1] : false;
+ if ( isset($tpl_type[2]) )
+ {
+ $max = (int) $tpl_type[2];
+ }
+
+ $tpl = '<input id="' . $key . '" type="' . $tpl_type[0] . '"' . (( $min != '' ) ? ' min="' . $min . '"' : '') . (( $max != '' ) ? ' max="' . $max . '"' : '') . ' name="' . $name . '" value="' . $new[$config_key] . '" />';
+ break;
+
+ case 'dimension':
+ $max = '';
+
+ $min = (int) $tpl_type[1];
+
+ if ( isset($tpl_type[2]) )
+ {
+ $max = (int) $tpl_type[2];
+ }
+
+ $tpl = '<input id="' . $key . '" type="number"' . (( $min !== '' ) ? ' min="' . $min . '"' : '') . (( $max != '' ) ? ' max="' . $max . '"' : '') . ' name="config[' . $config_key . '_width]" value="' . $new[$config_key . '_width'] . '" /> x <input type="number"' . (( $min !== '' ) ? ' min="' . $min . '"' : '') . (( $max != '' ) ? ' max="' . $max . '"' : '') . ' name="config[' . $config_key . '_height]" value="' . $new[$config_key . '_height'] . '" />';
+ break;
+
+ case 'textarea':
+ $rows = (int) $tpl_type[1];
+ $cols = (int) $tpl_type[2];
+
+ $tpl = '<textarea id="' . $key . '" name="' . $name . '" rows="' . $rows . '" cols="' . $cols . '">' . $new[$config_key] . '</textarea>';
+ break;
+
+ case 'radio':
+ $key_yes = ($new[$config_key]) ? ' checked="checked"' : '';
+ $key_no = (!$new[$config_key]) ? ' checked="checked"' : '';
+
+ $tpl_type_cond = explode('_', $tpl_type[1]);
+ $type_no = ($tpl_type_cond[0] == 'disabled' || $tpl_type_cond[0] == 'enabled') ? false : true;
+
+ $tpl_no = '<label><input type="radio" name="' . $name . '" value="0"' . $key_no . ' class="radio" /> ' . (($type_no) ? $user->lang['NO'] : $user->lang['DISABLED']) . '</label>';
+ $tpl_yes = '<label><input type="radio" id="' . $key . '" name="' . $name . '" value="1"' . $key_yes . ' class="radio" /> ' . (($type_no) ? $user->lang['YES'] : $user->lang['ENABLED']) . '</label>';
+
+ $tpl = ($tpl_type_cond[0] == 'yes' || $tpl_type_cond[0] == 'enabled') ? $tpl_yes . $tpl_no : $tpl_no . $tpl_yes;
+ break;
+
+ case 'select':
+ case 'custom':
+
+ $return = '';
+
+ if (isset($vars['method']))
+ {
+ $call = array($module->module, $vars['method']);
+ }
+ else if (isset($vars['function']))
+ {
+ $call = $vars['function'];
+ }
+ else
+ {
+ break;
+ }
+
+ if (isset($vars['params']))
+ {
+ $args = array();
+ foreach ($vars['params'] as $value)
+ {
+ switch ($value)
+ {
+ case '{CONFIG_VALUE}':
+ $value = $new[$config_key];
+ break;
+
+ case '{KEY}':
+ $value = $key;
+ break;
+ }
+
+ $args[] = $value;
+ }
+ }
+ else
+ {
+ $args = array($new[$config_key], $key);
+ }
+
+ $return = call_user_func_array($call, $args);
+
+ if ($tpl_type[0] == 'select')
+ {
+ $size = (isset($tpl_type[1])) ? (int) $tpl_type[1] : 1;
+ $data_toggle = (!empty($tpl_type[2])) ? ' data-togglable-settings="true"' : '';
+
+ $tpl = '<select id="' . $key . '" name="' . $name . '"' . (($size > 1) ? ' size="' . $size . '"' : '') . $data_toggle . '>' . $return . '</select>';
+ }
+ else
+ {
+ $tpl = $return;
+ }
+
+ break;
+
+ default:
+ break;
+ }
+
+ if (isset($vars['append']))
+ {
+ $tpl .= $vars['append'];
+ }
+
+ /**
+ * Overwrite the html code we display for the config value
+ *
+ * @event core.build_config_template
+ * @var array tpl_type Config type array:
+ * 0 => data type
+ * 1 [optional] => string: size, int: minimum
+ * 2 [optional] => string: max. length, int: maximum
+ * @var string key Should be used for the id attribute in html
+ * @var array new Array with the config values we display
+ * @var string name Should be used for the name attribute
+ * @var array vars Array with the options for the config
+ * @var string tpl The resulting html code we display
+ * @since 3.1.0-a1
+ */
+ $vars = array('tpl_type', 'key', 'new', 'name', 'vars', 'tpl');
+ extract($phpbb_dispatcher->trigger_event('core.build_config_template', compact($vars)));
+
+ return $tpl;
+}
+
+/**
+* Going through a config array and validate values, writing errors to $error. The validation method accepts parameters separated by ':' for string and int.
+* The first parameter defines the type to be used, the second the lower bound and the third the upper bound. Only the type is required.
+*/
+function validate_config_vars($config_vars, &$cfg_array, &$error)
+{
+ global $phpbb_root_path, $user, $phpbb_dispatcher;
+
+ $type = 0;
+ $min = 1;
+ $max = 2;
+
+ foreach ($config_vars as $config_name => $config_definition)
+ {
+ if (!isset($cfg_array[$config_name]) || strpos($config_name, 'legend') !== false)
+ {
+ continue;
+ }
+
+ if (!isset($config_definition['validate']))
+ {
+ continue;
+ }
+
+ $validator = explode(':', $config_definition['validate']);
+
+ // Validate a bit. ;) (0 = type, 1 = min, 2= max)
+ switch ($validator[$type])
+ {
+ case 'string':
+ $length = utf8_strlen($cfg_array[$config_name]);
+
+ // the column is a VARCHAR
+ $validator[$max] = (isset($validator[$max])) ? min(255, $validator[$max]) : 255;
+
+ if (isset($validator[$min]) && $length < $validator[$min])
+ {
+ $error[] = sprintf($user->lang['SETTING_TOO_SHORT'], $user->lang[$config_definition['lang']], $validator[$min]);
+ }
+ else if (isset($validator[$max]) && $length > $validator[2])
+ {
+ $error[] = sprintf($user->lang['SETTING_TOO_LONG'], $user->lang[$config_definition['lang']], $validator[$max]);
+ }
+ break;
+
+ case 'bool':
+ $cfg_array[$config_name] = ($cfg_array[$config_name]) ? 1 : 0;
+ break;
+
+ case 'int':
+ $cfg_array[$config_name] = (int) $cfg_array[$config_name];
+
+ if (isset($validator[$min]) && $cfg_array[$config_name] < $validator[$min])
+ {
+ $error[] = sprintf($user->lang['SETTING_TOO_LOW'], $user->lang[$config_definition['lang']], $validator[$min]);
+ }
+ else if (isset($validator[$max]) && $cfg_array[$config_name] > $validator[$max])
+ {
+ $error[] = sprintf($user->lang['SETTING_TOO_BIG'], $user->lang[$config_definition['lang']], $validator[$max]);
+ }
+
+ if (strpos($config_name, '_max') !== false)
+ {
+ // Min/max pairs of settings should ensure that min <= max
+ // Replace _max with _min to find the name of the minimum
+ // corresponding configuration variable
+ $min_name = str_replace('_max', '_min', $config_name);
+
+ if (isset($cfg_array[$min_name]) && is_numeric($cfg_array[$min_name]) && $cfg_array[$config_name] < $cfg_array[$min_name])
+ {
+ // A minimum value exists and the maximum value is less than it
+ $error[] = sprintf($user->lang['SETTING_TOO_LOW'], $user->lang[$config_definition['lang']], (int) $cfg_array[$min_name]);
+ }
+ }
+ break;
+
+ case 'email':
+ if (!preg_match('/^' . get_preg_expression('email') . '$/i', $cfg_array[$config_name]))
+ {
+ $error[] = $user->lang['EMAIL_INVALID_EMAIL'];
+ }
+ break;
+
+ // Absolute path
+ case 'script_path':
+ if (!$cfg_array[$config_name])
+ {
+ break;
+ }
+
+ $destination = str_replace('\\', '/', $cfg_array[$config_name]);
+
+ if ($destination !== '/')
+ {
+ // Adjust destination path (no trailing slash)
+ if (substr($destination, -1, 1) == '/')
+ {
+ $destination = substr($destination, 0, -1);
+ }
+
+ $destination = str_replace(array('../', './'), '', $destination);
+
+ if ($destination[0] != '/')
+ {
+ $destination = '/' . $destination;
+ }
+ }
+
+ $cfg_array[$config_name] = trim($destination);
+
+ break;
+
+ // Absolute path
+ case 'lang':
+ if (!$cfg_array[$config_name])
+ {
+ break;
+ }
+
+ $cfg_array[$config_name] = basename($cfg_array[$config_name]);
+
+ if (!file_exists($phpbb_root_path . 'language/' . $cfg_array[$config_name] . '/'))
+ {
+ $error[] = $user->lang['WRONG_DATA_LANG'];
+ }
+ break;
+
+ // Relative path (appended $phpbb_root_path)
+ case 'rpath':
+ case 'rwpath':
+ if (!$cfg_array[$config_name])
+ {
+ break;
+ }
+
+ $destination = $cfg_array[$config_name];
+
+ // Adjust destination path (no trailing slash)
+ if (substr($destination, -1, 1) == '/' || substr($destination, -1, 1) == '\\')
+ {
+ $destination = substr($destination, 0, -1);
+ }
+
+ $destination = str_replace(array('../', '..\\', './', '.\\'), '', $destination);
+ if ($destination && ($destination[0] == '/' || $destination[0] == "\\"))
+ {
+ $destination = '';
+ }
+
+ $cfg_array[$config_name] = trim($destination);
+
+ // Absolute file path
+ case 'absolute_path':
+ case 'absolute_path_writable':
+ // Path being relative (still prefixed by phpbb_root_path), but with the ability to escape the root dir...
+ case 'path':
+ case 'wpath':
+
+ if (!$cfg_array[$config_name])
+ {
+ break;
+ }
+
+ $cfg_array[$config_name] = trim($cfg_array[$config_name]);
+
+ // Make sure no NUL byte is present...
+ if (strpos($cfg_array[$config_name], "\0") !== false || strpos($cfg_array[$config_name], '%00') !== false)
+ {
+ $cfg_array[$config_name] = '';
+ break;
+ }
+
+ $path = in_array($config_definition['validate'], array('wpath', 'path', 'rpath', 'rwpath')) ? $phpbb_root_path . $cfg_array[$config_name] : $cfg_array[$config_name];
+
+ if (!file_exists($path))
+ {
+ $error[] = sprintf($user->lang['DIRECTORY_DOES_NOT_EXIST'], $cfg_array[$config_name]);
+ }
+
+ if (file_exists($path) && !is_dir($path))
+ {
+ $error[] = sprintf($user->lang['DIRECTORY_NOT_DIR'], $cfg_array[$config_name]);
+ }
+
+ // Check if the path is writable
+ if ($config_definition['validate'] == 'wpath' || $config_definition['validate'] == 'rwpath' || $config_definition['validate'] === 'absolute_path_writable')
+ {
+ if (file_exists($path) && !phpbb_is_writable($path))
+ {
+ $error[] = sprintf($user->lang['DIRECTORY_NOT_WRITABLE'], $cfg_array[$config_name]);
+ }
+ }
+
+ break;
+
+ default:
+ /**
+ * Validate a config value
+ *
+ * @event core.validate_config_variable
+ * @var array cfg_array Array with config values
+ * @var string config_name Name of the config we validate
+ * @var array config_definition Array with the options for
+ * this config
+ * @var array error Array of errors, the errors should
+ * be strings only, language keys are
+ * not replaced afterwards
+ * @since 3.1.0-a1
+ */
+ $vars = array('cfg_array', 'config_name', 'config_definition', 'error');
+ extract($phpbb_dispatcher->trigger_event('core.validate_config_variable', compact($vars)));
+ break;
+ }
+ }
+
+ return;
+}
+
+/**
+* Checks whatever or not a variable is OK for use in the Database
+* param mixed $value_ary An array of the form array(array('lang' => ..., 'value' => ..., 'column_type' =>))'
+* param mixed $error The error array
+*/
+function validate_range($value_ary, &$error)
+{
+ global $user;
+
+ $column_types = array(
+ 'BOOL' => array('php_type' => 'int', 'min' => 0, 'max' => 1),
+ 'USINT' => array('php_type' => 'int', 'min' => 0, 'max' => 65535),
+ 'UINT' => array('php_type' => 'int', 'min' => 0, 'max' => (int) 0x7fffffff),
+ // Do not use (int) 0x80000000 - it evaluates to different
+ // values on 32-bit and 64-bit systems.
+ // Apparently -2147483648 is a float on 32-bit systems,
+ // despite fitting in an int, thus explicit cast is needed.
+ 'INT' => array('php_type' => 'int', 'min' => (int) -2147483648, 'max' => (int) 0x7fffffff),
+ 'TINT' => array('php_type' => 'int', 'min' => -128, 'max' => 127),
+
+ 'VCHAR' => array('php_type' => 'string', 'min' => 0, 'max' => 255),
+ );
+ foreach ($value_ary as $value)
+ {
+ $column = explode(':', $value['column_type']);
+ $max = $min = 0;
+ $type = 0;
+ if (!isset($column_types[$column[0]]))
+ {
+ continue;
+ }
+ else
+ {
+ $type = $column_types[$column[0]];
+ }
+
+ switch ($type['php_type'])
+ {
+ case 'string' :
+ $max = (isset($column[1])) ? min($column[1],$type['max']) : $type['max'];
+ if (utf8_strlen($value['value']) > $max)
+ {
+ $error[] = sprintf($user->lang['SETTING_TOO_LONG'], $user->lang[$value['lang']], $max);
+ }
+ break;
+
+ case 'int':
+ $min = (isset($column[1])) ? max($column[1],$type['min']) : $type['min'];
+ $max = (isset($column[2])) ? min($column[2],$type['max']) : $type['max'];
+ if ($value['value'] < $min)
+ {
+ $error[] = sprintf($user->lang['SETTING_TOO_LOW'], $user->lang[$value['lang']], $min);
+ }
+ else if ($value['value'] > $max)
+ {
+ $error[] = sprintf($user->lang['SETTING_TOO_BIG'], $user->lang[$value['lang']], $max);
+ }
+ break;
+ }
+ }
+}
+
+/**
+* Inserts new config display_vars into an exisiting display_vars array
+* at the given position.
+*
+* @param array $display_vars An array of existing config display vars
+* @param array $add_config_vars An array of new config display vars
+* @param array $where Where to place the new config vars,
+* before or after an exisiting config, as an array
+* of the form: array('after' => 'config_name') or
+* array('before' => 'config_name').
+* @return array The array of config display vars
+*/
+function phpbb_insert_config_array($display_vars, $add_config_vars, $where)
+{
+ if (is_array($where) && array_key_exists(current($where), $display_vars))
+ {
+ $position = array_search(current($where), array_keys($display_vars)) + ((key($where) == 'before') ? 0 : 1);
+ $display_vars = array_merge(
+ array_slice($display_vars, 0, $position),
+ $add_config_vars,
+ array_slice($display_vars, $position)
+ );
+ }
+
+ return $display_vars;
+}
diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php
index 3e69a997a2..4bac718999 100644
--- a/phpBB/includes/functions_admin.php
+++ b/phpBB/includes/functions_admin.php
@@ -1,10 +1,13 @@
<?php
/**
*
-* @package acp
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -24,8 +27,6 @@ if (!defined('IN_PHPBB'))
* @param string $table constant or fullname of the table
* @param int $parent_id parent_id of the current set (default = 0)
* @param array $where contains strings to compare closer on the where statement (additional)
-*
-* @author EXreaction
*/
function recalc_nested_sets(&$new_id, $pkey, $table, $parent_id = 0, $where = array())
{
@@ -64,7 +65,7 @@ function recalc_nested_sets(&$new_id, $pkey, $table, $parent_id = 0, $where = ar
*/
function make_forum_select($select_id = false, $ignore_id = false, $ignore_acl = false, $ignore_nonpost = false, $ignore_emptycat = true, $only_acl_post = false, $return_array = false)
{
- global $db, $user, $auth;
+ global $db, $user, $auth, $phpbb_dispatcher;
// This query is identical to the jumpbox one
$sql = 'SELECT forum_id, forum_name, parent_id, forum_type, forum_flags, forum_options, left_id, right_id
@@ -72,16 +73,33 @@ function make_forum_select($select_id = false, $ignore_id = false, $ignore_acl =
ORDER BY left_id ASC';
$result = $db->sql_query($sql, 600);
+ $rowset = array();
+ while ($row = $db->sql_fetchrow($result))
+ {
+ $rowset[(int) $row['forum_id']] = $row;
+ }
+ $db->sql_freeresult($result);
+
$right = 0;
$padding_store = array('0' => '');
$padding = '';
$forum_list = ($return_array) ? array() : '';
+ /**
+ * Modify the forum list data
+ *
+ * @event core.make_forum_select_modify_forum_list
+ * @var array rowset Array with the forums list data
+ * @since 3.1.10-RC1
+ */
+ $vars = array('rowset');
+ extract($phpbb_dispatcher->trigger_event('core.make_forum_select_modify_forum_list', compact($vars)));
+
// Sometimes it could happen that forums will be displayed here not be displayed within the index page
// This is the result of forums not displayed at index, having list permissions and a parent of a forum with no permissions.
// If this happens, the padding could be "broken"
- while ($row = $db->sql_fetchrow($result))
+ foreach ($rowset as $row)
{
if ($row['left_id'] < $right)
{
@@ -132,8 +150,7 @@ function make_forum_select($select_id = false, $ignore_id = false, $ignore_acl =
$forum_list .= '<option value="' . $row['forum_id'] . '"' . (($disabled) ? ' disabled="disabled" class="disabled-option"' : $selected) . '>' . $padding . $row['forum_name'] . '</option>';
}
}
- $db->sql_freeresult($result);
- unset($padding_store);
+ unset($padding_store, $rowset);
return $forum_list;
}
@@ -200,7 +217,7 @@ function group_select_options($group_id, $exclude_ids = false, $manage_founder =
*/
function get_forum_list($acl_list = 'f_list', $id_only = true, $postable_only = false, $no_cache = false)
{
- global $db, $auth;
+ global $db, $auth, $phpbb_dispatcher;
static $forum_rows;
if (!isset($forum_rows))
@@ -255,6 +272,16 @@ function get_forum_list($acl_list = 'f_list', $id_only = true, $postable_only =
}
}
+ /**
+ * Modify the forum list data
+ *
+ * @event core.get_forum_list_modify_data
+ * @var array rowset Array with the forum list data
+ * @since 3.1.10-RC1
+ */
+ $vars = array('rowset');
+ extract($phpbb_dispatcher->trigger_event('core.get_forum_list_modify_data', compact($vars)));
+
return $rowset;
}
@@ -312,8 +339,6 @@ function get_forum_branch($forum_id, $type = 'all', $order = 'descending', $incl
* @param bool $add_log True if log entry should be added
*
* @return bool False on error
-*
-* @author bantu
*/
function copy_forum_permissions($src_forum_id, $dest_forum_ids, $clear_dest_perms = true, $add_log = true)
{
@@ -501,7 +526,7 @@ function filelist($rootdir, $dir = '', $type = 'gif|jpg|jpeg|png')
*/
function move_topics($topic_ids, $forum_id, $auto_sync = true)
{
- global $db;
+ global $db, $phpbb_dispatcher;
if (empty($topic_ids))
{
@@ -535,6 +560,27 @@ function move_topics($topic_ids, $forum_id, $auto_sync = true)
}
$table_ary = array(TOPICS_TABLE, POSTS_TABLE, LOG_TABLE, DRAFTS_TABLE, TOPICS_TRACK_TABLE);
+
+ /**
+ * Perform additional actions before topics move
+ *
+ * @event core.move_topics_before_query
+ * @var array table_ary Array of tables from which forum_id will be updated for all rows that hold the moved topics
+ * @var array topic_ids Array of the moved topic ids
+ * @var string forum_id The forum id from where the topics are moved
+ * @var array forum_ids Array of the forums where the topics are moving (includes also forum_id)
+ * @var bool auto_sync Whether or not to perform auto sync
+ * @since 3.1.5-RC1
+ */
+ $vars = array(
+ 'table_ary',
+ 'topic_ids',
+ 'forum_id',
+ 'forum_ids',
+ 'auto_sync',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.move_topics_before_query', compact($vars)));
+
foreach ($table_ary as $table)
{
$sql = "UPDATE $table
@@ -556,7 +602,7 @@ function move_topics($topic_ids, $forum_id, $auto_sync = true)
*/
function move_posts($post_ids, $topic_id, $auto_sync = true)
{
- global $db;
+ global $db, $phpbb_dispatcher;
if (!is_array($post_ids))
{
@@ -590,6 +636,28 @@ function move_posts($post_ids, $topic_id, $auto_sync = true)
trigger_error('NO_TOPIC');
}
+ /**
+ * Perform additional actions before moving posts
+ *
+ * @event core.move_posts_before
+ * @var array post_ids Array of post ids to move
+ * @var int topic_id The topic id the posts are moved to
+ * @var bool auto_sync Whether or not to perform auto sync
+ * @var array forum_ids Array of the forum ids the posts are moved from
+ * @var array topic_ids Array of the topic ids the posts are moved from
+ * @var array forum_row Array with the forum id of the topic the posts are moved to
+ * @since 3.1.7-RC1
+ */
+ $vars = array(
+ 'post_ids',
+ 'topic_id',
+ 'auto_sync',
+ 'forum_ids',
+ 'topic_ids',
+ 'forum_row',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.move_posts_before', compact($vars)));
+
$sql = 'UPDATE ' . POSTS_TABLE . '
SET forum_id = ' . (int) $forum_row['forum_id'] . ", topic_id = $topic_id
WHERE " . $db->sql_in_set('post_id', $post_ids);
@@ -600,6 +668,28 @@ function move_posts($post_ids, $topic_id, $auto_sync = true)
WHERE " . $db->sql_in_set('post_msg_id', $post_ids);
$db->sql_query($sql);
+ /**
+ * Perform additional actions after moving posts
+ *
+ * @event core.move_posts_after
+ * @var array post_ids Array of the moved post ids
+ * @var int topic_id The topic id the posts are moved to
+ * @var bool auto_sync Whether or not to perform auto sync
+ * @var array forum_ids Array of the forum ids the posts are moved from
+ * @var array topic_ids Array of the topic ids the posts are moved from
+ * @var array forum_row Array with the forum id of the topic the posts are moved to
+ * @since 3.1.7-RC1
+ */
+ $vars = array(
+ 'post_ids',
+ 'topic_id',
+ 'auto_sync',
+ 'forum_ids',
+ 'topic_ids',
+ 'forum_row',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.move_posts_after', compact($vars)));
+
if ($auto_sync)
{
$forum_ids[] = (int) $forum_row['forum_id'];
@@ -608,6 +698,28 @@ function move_posts($post_ids, $topic_id, $auto_sync = true)
sync('topic_attachment', 'topic_id', $topic_ids);
sync('topic', 'topic_id', $topic_ids, true);
sync('forum', 'forum_id', $forum_ids, true, true);
+
+ /**
+ * Perform additional actions after move post sync
+ *
+ * @event core.move_posts_sync_after
+ * @var array post_ids Array of the moved post ids
+ * @var int topic_id The topic id the posts are moved to
+ * @var bool auto_sync Whether or not to perform auto sync
+ * @var array forum_ids Array of the forum ids the posts are moved from
+ * @var array topic_ids Array of the topic ids the posts are moved from
+ * @var array forum_row Array with the forum id of the topic the posts are moved to
+ * @since 3.1.11-RC1
+ */
+ $vars = array(
+ 'post_ids',
+ 'topic_id',
+ 'auto_sync',
+ 'forum_ids',
+ 'topic_ids',
+ 'forum_row',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.move_posts_sync_after', compact($vars)));
}
// Update posted information
@@ -619,7 +731,7 @@ function move_posts($post_ids, $topic_id, $auto_sync = true)
*/
function delete_topics($where_type, $where_ids, $auto_sync = true, $post_count_sync = true, $call_delete_posts = true)
{
- global $db, $config;
+ global $db, $config, $phpbb_container, $phpbb_dispatcher;
$approved_topics = 0;
$forum_ids = $topic_ids = array();
@@ -645,7 +757,7 @@ function delete_topics($where_type, $where_ids, $auto_sync = true, $post_count_s
'posts' => ($call_delete_posts) ? delete_posts($where_type, $where_ids, false, true, $post_count_sync, false) : 0,
);
- $sql = 'SELECT topic_id, forum_id, topic_approved, topic_moved_id
+ $sql = 'SELECT topic_id, forum_id, topic_visibility, topic_moved_id
FROM ' . TOPICS_TABLE . '
WHERE ' . $where_clause;
$result = $db->sql_query($sql);
@@ -655,7 +767,7 @@ function delete_topics($where_type, $where_ids, $auto_sync = true, $post_count_s
$forum_ids[] = $row['forum_id'];
$topic_ids[] = $row['topic_id'];
- if ($row['topic_approved'] && !$row['topic_moved_id'])
+ if ($row['topic_visibility'] == ITEM_APPROVED && !$row['topic_moved_id'])
{
$approved_topics++;
}
@@ -673,6 +785,20 @@ function delete_topics($where_type, $where_ids, $auto_sync = true, $post_count_s
$table_ary = array(BOOKMARKS_TABLE, TOPICS_TRACK_TABLE, TOPICS_POSTED_TABLE, POLL_VOTES_TABLE, POLL_OPTIONS_TABLE, TOPICS_WATCH_TABLE, TOPICS_TABLE);
+ /**
+ * Perform additional actions before topic(s) deletion
+ *
+ * @event core.delete_topics_before_query
+ * @var array table_ary Array of tables from which all rows will be deleted that hold a topic_id occuring in topic_ids
+ * @var array topic_ids Array of topic ids to delete
+ * @since 3.1.4-RC1
+ */
+ $vars = array(
+ 'table_ary',
+ 'topic_ids',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.delete_topics_before_query', compact($vars)));
+
foreach ($table_ary as $table)
{
$sql = "DELETE FROM $table
@@ -681,6 +807,18 @@ function delete_topics($where_type, $where_ids, $auto_sync = true, $post_count_s
}
unset($table_ary);
+ /**
+ * Perform additional actions after topic(s) deletion
+ *
+ * @event core.delete_topics_after_query
+ * @var array topic_ids Array of topic ids that were deleted
+ * @since 3.1.4-RC1
+ */
+ $vars = array(
+ 'topic_ids',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.delete_topics_after_query', compact($vars)));
+
$moved_topic_ids = array();
// update the other forums
@@ -716,6 +854,14 @@ function delete_topics($where_type, $where_ids, $auto_sync = true, $post_count_s
set_config_count('num_topics', $approved_topics * (-1), true);
}
+ $phpbb_notifications = $phpbb_container->get('notification_manager');
+
+ $phpbb_notifications->delete_notifications(array(
+ 'notification.type.topic',
+ 'notification.type.approve_topic',
+ 'notification.type.topic_in_queue',
+ ), $topic_ids);
+
return $return;
}
@@ -724,7 +870,39 @@ function delete_topics($where_type, $where_ids, $auto_sync = true, $post_count_s
*/
function delete_posts($where_type, $where_ids, $auto_sync = true, $posted_sync = true, $post_count_sync = true, $call_delete_topics = true)
{
- global $db, $config, $phpbb_root_path, $phpEx;
+ global $db, $config, $phpbb_root_path, $phpEx, $auth, $user, $phpbb_container, $phpbb_dispatcher;
+
+ // Notifications types to delete
+ $delete_notifications_types = array(
+ 'notification.type.quote',
+ 'notification.type.approve_post',
+ 'notification.type.post_in_queue',
+ 'notification.type.report_post',
+ );
+
+ /**
+ * Perform additional actions before post(s) deletion
+ *
+ * @event core.delete_posts_before
+ * @var string where_type Variable containing posts deletion mode
+ * @var mixed where_ids Array or comma separated list of posts ids to delete
+ * @var bool auto_sync Flag indicating if topics/forums should be synchronized
+ * @var bool posted_sync Flag indicating if topics_posted table should be resynchronized
+ * @var bool post_count_sync Flag indicating if posts count should be resynchronized
+ * @var bool call_delete_topics Flag indicating if topics having no posts should be deleted
+ * @var array delete_notifications_types Array with notifications types to delete
+ * @since 3.1.0-a4
+ */
+ $vars = array(
+ 'where_type',
+ 'where_ids',
+ 'auto_sync',
+ 'posted_sync',
+ 'post_count_sync',
+ 'call_delete_topics',
+ 'delete_notifications_types',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.delete_posts_before', compact($vars)));
if ($where_type === 'range')
{
@@ -768,7 +946,7 @@ function delete_posts($where_type, $where_ids, $auto_sync = true, $posted_sync =
$approved_posts = 0;
$post_ids = $topic_ids = $forum_ids = $post_counts = $remove_topics = array();
- $sql = 'SELECT post_id, poster_id, post_approved, post_postcount, topic_id, forum_id
+ $sql = 'SELECT post_id, poster_id, post_visibility, post_postcount, topic_id, forum_id
FROM ' . POSTS_TABLE . '
WHERE ' . $where_clause;
$result = $db->sql_query($sql);
@@ -780,12 +958,12 @@ function delete_posts($where_type, $where_ids, $auto_sync = true, $posted_sync =
$topic_ids[] = (int) $row['topic_id'];
$forum_ids[] = (int) $row['forum_id'];
- if ($row['post_postcount'] && $post_count_sync && $row['post_approved'])
+ if ($row['post_postcount'] && $post_count_sync && $row['post_visibility'] == ITEM_APPROVED)
{
$post_counts[$row['poster_id']] = (!empty($post_counts[$row['poster_id']])) ? $post_counts[$row['poster_id']] + 1 : 1;
}
- if ($row['post_approved'])
+ if ($row['post_visibility'] == ITEM_APPROVED)
{
$approved_posts++;
}
@@ -801,6 +979,32 @@ function delete_posts($where_type, $where_ids, $auto_sync = true, $posted_sync =
$table_ary = array(POSTS_TABLE, REPORTS_TABLE);
+ /**
+ * Perform additional actions during post(s) deletion before running the queries
+ *
+ * @event core.delete_posts_in_transaction_before
+ * @var array post_ids Array with deleted posts' ids
+ * @var array poster_ids Array with deleted posts' author ids
+ * @var array topic_ids Array with deleted posts' topic ids
+ * @var array forum_ids Array with deleted posts' forum ids
+ * @var string where_type Variable containing posts deletion mode
+ * @var mixed where_ids Array or comma separated list of post ids to delete
+ * @var array delete_notifications_types Array with notifications types to delete
+ * @var array table_ary Array with table names to delete data from
+ * @since 3.1.7-RC1
+ */
+ $vars = array(
+ 'post_ids',
+ 'poster_ids',
+ 'topic_ids',
+ 'forum_ids',
+ 'where_type',
+ 'where_ids',
+ 'delete_notifications_types',
+ 'table_ary',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.delete_posts_in_transaction_before', compact($vars)));
+
foreach ($table_ary as $table)
{
$sql = "DELETE FROM $table
@@ -848,17 +1052,15 @@ function delete_posts($where_type, $where_ids, $auto_sync = true, $posted_sync =
}
// Remove the message from the search index
- $search_type = basename($config['search_type']);
+ $search_type = $config['search_type'];
- if (!file_exists($phpbb_root_path . 'includes/search/' . $search_type . '.' . $phpEx))
+ if (!class_exists($search_type))
{
trigger_error('NO_SUCH_SEARCH_MODULE');
}
- include_once("{$phpbb_root_path}includes/search/$search_type.$phpEx");
-
$error = false;
- $search = new $search_type($error);
+ $search = new $search_type($error, $phpbb_root_path, $phpEx, $auth, $config, $db, $user, $phpbb_dispatcher);
if ($error)
{
@@ -869,8 +1071,56 @@ function delete_posts($where_type, $where_ids, $auto_sync = true, $posted_sync =
delete_attachments('post', $post_ids, false);
+ /**
+ * Perform additional actions during post(s) deletion
+ *
+ * @event core.delete_posts_in_transaction
+ * @var array post_ids Array with deleted posts' ids
+ * @var array poster_ids Array with deleted posts' author ids
+ * @var array topic_ids Array with deleted posts' topic ids
+ * @var array forum_ids Array with deleted posts' forum ids
+ * @var string where_type Variable containing posts deletion mode
+ * @var mixed where_ids Array or comma separated list of posts ids to delete
+ * @var array delete_notifications_types Array with notifications types to delete
+ * @since 3.1.0-a4
+ */
+ $vars = array(
+ 'post_ids',
+ 'poster_ids',
+ 'topic_ids',
+ 'forum_ids',
+ 'where_type',
+ 'where_ids',
+ 'delete_notifications_types',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.delete_posts_in_transaction', compact($vars)));
+
$db->sql_transaction('commit');
+ /**
+ * Perform additional actions after post(s) deletion
+ *
+ * @event core.delete_posts_after
+ * @var array post_ids Array with deleted posts' ids
+ * @var array poster_ids Array with deleted posts' author ids
+ * @var array topic_ids Array with deleted posts' topic ids
+ * @var array forum_ids Array with deleted posts' forum ids
+ * @var string where_type Variable containing posts deletion mode
+ * @var mixed where_ids Array or comma separated list of posts ids to delete
+ * @var array delete_notifications_types Array with notifications types to delete
+ * @since 3.1.0-a4
+ */
+ $vars = array(
+ 'post_ids',
+ 'poster_ids',
+ 'topic_ids',
+ 'forum_ids',
+ 'where_type',
+ 'where_ids',
+ 'delete_notifications_types',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.delete_posts_after', compact($vars)));
+
// Resync topics_posted table
if ($posted_sync)
{
@@ -884,7 +1134,7 @@ function delete_posts($where_type, $where_ids, $auto_sync = true, $posted_sync =
sync('forum', 'forum_id', $forum_ids, true, true);
}
- if ($approved_posts)
+ if ($approved_posts && $post_count_sync)
{
set_config_count('num_posts', $approved_posts * (-1), true);
}
@@ -895,6 +1145,10 @@ function delete_posts($where_type, $where_ids, $auto_sync = true, $posted_sync =
delete_topics('topic_id', $remove_topics, $auto_sync, $post_count_sync, false);
}
+ $phpbb_notifications = $phpbb_container->get('notification_manager');
+
+ $phpbb_notifications->delete_notifications($delete_notifications_types, $post_ids);
+
return sizeof($post_ids);
}
@@ -907,7 +1161,7 @@ function delete_posts($where_type, $where_ids, $auto_sync = true, $posted_sync =
*/
function delete_attachments($mode, $ids, $resync = true)
{
- global $db, $config;
+ global $db, $config, $phpbb_dispatcher;
// 0 is as bad as an empty array
if (empty($ids))
@@ -952,6 +1206,24 @@ function delete_attachments($mode, $ids, $resync = true)
$post_ids = $message_ids = $topic_ids = $physical = array();
+ /**
+ * Perform additional actions before collecting data for attachment(s) deletion
+ *
+ * @event core.delete_attachments_collect_data_before
+ * @var string mode Variable containing attachments deletion mode, can be: post|message|topic|attach|user
+ * @var mixed ids Array or comma separated list of ids corresponding to the mode
+ * @var bool resync Flag indicating if posts/messages/topics should be synchronized
+ * @var string sql_id The field name to collect/delete data for depending on the mode
+ * @since 3.1.7-RC1
+ */
+ $vars = array(
+ 'mode',
+ 'ids',
+ 'resync',
+ 'sql_id',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.delete_attachments_collect_data_before', compact($vars)));
+
// Collect post and topic ids for later use if we need to touch remaining entries (if resync is enabled)
$sql = 'SELECT post_msg_id, topic_id, in_message, physical_filename, thumbnail, filesize, is_orphan
FROM ' . ATTACHMENTS_TABLE . '
@@ -981,6 +1253,32 @@ function delete_attachments($mode, $ids, $resync = true)
}
$db->sql_freeresult($result);
+ /**
+ * Perform additional actions before attachment(s) deletion
+ *
+ * @event core.delete_attachments_before
+ * @var string mode Variable containing attachments deletion mode, can be: post|message|topic|attach|user
+ * @var mixed ids Array or comma separated list of ids corresponding to the mode
+ * @var bool resync Flag indicating if posts/messages/topics should be synchronized
+ * @var string sql_id The field name to collect/delete data for depending on the mode
+ * @var array post_ids Array with post ids for deleted attachment(s)
+ * @var array topic_ids Array with topic ids for deleted attachment(s)
+ * @var array message_ids Array with private message ids for deleted attachment(s)
+ * @var array physical Array with deleted attachment(s) physical file(s) data
+ * @since 3.1.7-RC1
+ */
+ $vars = array(
+ 'mode',
+ 'ids',
+ 'resync',
+ 'sql_id',
+ 'post_ids',
+ 'topic_ids',
+ 'message_ids',
+ 'physical',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.delete_attachments_before', compact($vars)));
+
// Delete attachments
$sql = 'DELETE FROM ' . ATTACHMENTS_TABLE . '
WHERE ' . $db->sql_in_set($sql_id, $ids);
@@ -990,6 +1288,34 @@ function delete_attachments($mode, $ids, $resync = true)
$db->sql_query($sql);
$num_deleted = $db->sql_affectedrows();
+ /**
+ * Perform additional actions after attachment(s) deletion from the database
+ *
+ * @event core.delete_attachments_from_database_after
+ * @var string mode Variable containing attachments deletion mode, can be: post|message|topic|attach|user
+ * @var mixed ids Array or comma separated list of ids corresponding to the mode
+ * @var bool resync Flag indicating if posts/messages/topics should be synchronized
+ * @var string sql_id The field name to collect/delete data for depending on the mode
+ * @var array post_ids Array with post ids for deleted attachment(s)
+ * @var array topic_ids Array with topic ids for deleted attachment(s)
+ * @var array message_ids Array with private message ids for deleted attachment(s)
+ * @var array physical Array with deleted attachment(s) physical file(s) data
+ * @var int num_deleted The number of deleted attachment(s) from the database
+ * @since 3.1.7-RC1
+ */
+ $vars = array(
+ 'mode',
+ 'ids',
+ 'resync',
+ 'sql_id',
+ 'post_ids',
+ 'topic_ids',
+ 'message_ids',
+ 'physical',
+ 'num_deleted',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.delete_attachments_from_database_after', compact($vars)));
+
if (!$num_deleted)
{
return 0;
@@ -1012,6 +1338,38 @@ function delete_attachments($mode, $ids, $resync = true)
}
}
+ /**
+ * Perform additional actions after attachment(s) deletion from the filesystem
+ *
+ * @event core.delete_attachments_from_filesystem_after
+ * @var string mode Variable containing attachments deletion mode, can be: post|message|topic|attach|user
+ * @var mixed ids Array or comma separated list of ids corresponding to the mode
+ * @var bool resync Flag indicating if posts/messages/topics should be synchronized
+ * @var string sql_id The field name to collect/delete data for depending on the mode
+ * @var array post_ids Array with post ids for deleted attachment(s)
+ * @var array topic_ids Array with topic ids for deleted attachment(s)
+ * @var array message_ids Array with private message ids for deleted attachment(s)
+ * @var array physical Array with deleted attachment(s) physical file(s) data
+ * @var int num_deleted The number of deleted attachment(s) from the database
+ * @var int space_removed The size of deleted files(s) from the filesystem
+ * @var int files_removed The number of deleted file(s) from the filesystem
+ * @since 3.1.7-RC1
+ */
+ $vars = array(
+ 'mode',
+ 'ids',
+ 'resync',
+ 'sql_id',
+ 'post_ids',
+ 'topic_ids',
+ 'message_ids',
+ 'physical',
+ 'num_deleted',
+ 'space_removed',
+ 'files_removed',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.delete_attachments_from_filesystem_after', compact($vars)));
+
if ($space_removed || $files_removed)
{
set_config_count('upload_dir_size', $space_removed * (-1), true);
@@ -1132,8 +1490,6 @@ function delete_attachments($mode, $ids, $resync = true)
* @param bool $auto_sync Will call sync() if this is true
*
* @return array Array with affected forums
-*
-* @author bantu
*/
function delete_topic_shadows($forum_id, $sql_more = '', $auto_sync = true)
{
@@ -1277,7 +1633,7 @@ function phpbb_unlink($filename, $mode = 'file', $entry_removed = false)
* - forum Resync complete forum
* - topic Resync topics
* - topic_moved Removes topic shadows that would be in the same forum as the topic they link to
-* - topic_approved Resyncs the topic_approved flag according to the status of the first post
+* - topic_visibility Resyncs the topic_visibility flag according to the status of the first post
* - post_reported Resyncs the post_reported flag, relying on actual reports
* - topic_reported Resyncs the topic_reported flag, relying on post_reported flags
* - post_attachement Same as post_reported, but with attachment flags
@@ -1297,7 +1653,7 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false,
$where_ids = ($where_ids) ? array((int) $where_ids) : array();
}
- if ($mode == 'forum' || $mode == 'topic' || $mode == 'topic_approved' || $mode == 'topic_reported' || $mode == 'post_reported')
+ if ($mode == 'forum' || $mode == 'topic' || $mode == 'topic_visibility' || $mode == 'topic_reported' || $mode == 'post_reported')
{
if (!$where_type)
{
@@ -1343,7 +1699,7 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false,
{
case 'topic_moved':
$db->sql_transaction('begin');
- switch ($db->sql_layer)
+ switch ($db->get_sql_layer())
{
case 'mysql4':
case 'mysqli':
@@ -1383,43 +1739,55 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false,
$db->sql_transaction('commit');
break;
- case 'topic_approved':
+ case 'topic_visibility':
$db->sql_transaction('begin');
- switch ($db->sql_layer)
+
+ $sql = 'SELECT t.topic_id, p.post_visibility
+ FROM ' . TOPICS_TABLE . ' t, ' . POSTS_TABLE . " p
+ $where_sql_and p.topic_id = t.topic_id
+ AND p.post_visibility = " . ITEM_APPROVED;
+ $result = $db->sql_query($sql);
+
+ $topics_approved = array();
+ while ($row = $db->sql_fetchrow($result))
{
- case 'mysql4':
- case 'mysqli':
- $sql = 'UPDATE ' . TOPICS_TABLE . ' t, ' . POSTS_TABLE . " p
- SET t.topic_approved = p.post_approved
- $where_sql_and t.topic_first_post_id = p.post_id";
- $db->sql_query($sql);
- break;
+ $topics_approved[] = (int) $row['topic_id'];
+ }
+ $db->sql_freeresult($result);
- default:
- $sql = 'SELECT t.topic_id, p.post_approved
- FROM ' . TOPICS_TABLE . ' t, ' . POSTS_TABLE . " p
- $where_sql_and p.post_id = t.topic_first_post_id
- AND p.post_approved <> t.topic_approved";
- $result = $db->sql_query($sql);
+ $sql = 'SELECT t.topic_id, p.post_visibility
+ FROM ' . TOPICS_TABLE . ' t, ' . POSTS_TABLE . " p
+ $where_sql_and " . $db->sql_in_set('t.topic_id', $topics_approved, true, true) . '
+ AND p.topic_id = t.topic_id
+ AND p.post_visibility = ' . ITEM_DELETED;
+ $result = $db->sql_query($sql);
- $topic_ids = array();
- while ($row = $db->sql_fetchrow($result))
- {
- $topic_ids[] = $row['topic_id'];
- }
- $db->sql_freeresult($result);
+ $topics_softdeleted = array();
+ while ($row = $db->sql_fetchrow($result))
+ {
+ $topics_softdeleted[] = (int) $row['topic_id'];
+ }
+ $db->sql_freeresult($result);
- if (!sizeof($topic_ids))
- {
- return;
- }
+ $topics_softdeleted = array_diff($topics_softdeleted, $topics_approved);
+ $topics_not_unapproved = array_merge($topics_softdeleted, $topics_approved);
+
+ $update_ary = array(
+ ITEM_UNAPPROVED => (!empty($topics_not_unapproved)) ? $where_sql_and . ' ' . $db->sql_in_set('topic_id', $topics_not_unapproved, true) : '',
+ ITEM_APPROVED => (!empty($topics_approved)) ? ' WHERE ' . $db->sql_in_set('topic_id', $topics_approved) : '',
+ ITEM_DELETED => (!empty($topics_softdeleted)) ? ' WHERE ' . $db->sql_in_set('topic_id', $topics_softdeleted) : '',
+ );
+ foreach ($update_ary as $visibility => $sql_where)
+ {
+ if ($sql_where)
+ {
$sql = 'UPDATE ' . TOPICS_TABLE . '
- SET topic_approved = 1 - topic_approved
- WHERE ' . $db->sql_in_set('topic_id', $topic_ids);
+ SET topic_visibility = ' . $visibility . '
+ ' . $sql_where;
$db->sql_query($sql);
- break;
+ }
}
$db->sql_transaction('commit');
@@ -1660,9 +2028,12 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false,
$forum_data[$forum_id] = $row;
if ($sync_extra)
{
- $forum_data[$forum_id]['posts'] = 0;
- $forum_data[$forum_id]['topics'] = 0;
- $forum_data[$forum_id]['topics_real'] = 0;
+ $forum_data[$forum_id]['posts_approved'] = 0;
+ $forum_data[$forum_id]['posts_unapproved'] = 0;
+ $forum_data[$forum_id]['posts_softdeleted'] = 0;
+ $forum_data[$forum_id]['topics_approved'] = 0;
+ $forum_data[$forum_id]['topics_unapproved'] = 0;
+ $forum_data[$forum_id]['topics_softdeleted'] = 0;
}
$forum_data[$forum_id]['last_post_id'] = 0;
$forum_data[$forum_id]['last_post_subject'] = '';
@@ -1683,20 +2054,27 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false,
// 2: Get topic counts for each forum (optional)
if ($sync_extra)
{
- $sql = 'SELECT forum_id, topic_approved, COUNT(topic_id) AS forum_topics
+ $sql = 'SELECT forum_id, topic_visibility, COUNT(topic_id) AS total_topics
FROM ' . TOPICS_TABLE . '
WHERE ' . $db->sql_in_set('forum_id', $forum_ids) . '
- GROUP BY forum_id, topic_approved';
+ GROUP BY forum_id, topic_visibility';
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result))
{
$forum_id = (int) $row['forum_id'];
- $forum_data[$forum_id]['topics_real'] += $row['forum_topics'];
- if ($row['topic_approved'])
+ if ($row['topic_visibility'] == ITEM_APPROVED)
{
- $forum_data[$forum_id]['topics'] = $row['forum_topics'];
+ $forum_data[$forum_id]['topics_approved'] = $row['total_topics'];
+ }
+ else if ($row['topic_visibility'] == ITEM_UNAPPROVED || $row['topic_visibility'] == ITEM_REAPPROVE)
+ {
+ $forum_data[$forum_id]['topics_unapproved'] = $row['total_topics'];
+ }
+ else if ($row['topic_visibility'] == ITEM_DELETED)
+ {
+ $forum_data[$forum_id]['topics_softdeleted'] = $row['total_topics'];
}
}
$db->sql_freeresult($result);
@@ -1707,18 +2085,16 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false,
{
if (sizeof($forum_ids) == 1)
{
- $sql = 'SELECT SUM(t.topic_replies + 1) AS forum_posts
+ $sql = 'SELECT SUM(t.topic_posts_approved) AS forum_posts_approved, SUM(t.topic_posts_unapproved) AS forum_posts_unapproved, SUM(t.topic_posts_softdeleted) AS forum_posts_softdeleted
FROM ' . TOPICS_TABLE . ' t
WHERE ' . $db->sql_in_set('t.forum_id', $forum_ids) . '
- AND t.topic_approved = 1
AND t.topic_status <> ' . ITEM_MOVED;
}
else
{
- $sql = 'SELECT t.forum_id, SUM(t.topic_replies + 1) AS forum_posts
+ $sql = 'SELECT t.forum_id, SUM(t.topic_posts_approved) AS forum_posts_approved, SUM(t.topic_posts_unapproved) AS forum_posts_unapproved, SUM(t.topic_posts_softdeleted) AS forum_posts_softdeleted
FROM ' . TOPICS_TABLE . ' t
WHERE ' . $db->sql_in_set('t.forum_id', $forum_ids) . '
- AND t.topic_approved = 1
AND t.topic_status <> ' . ITEM_MOVED . '
GROUP BY t.forum_id';
}
@@ -1729,7 +2105,9 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false,
{
$forum_id = (sizeof($forum_ids) == 1) ? (int) $forum_ids[0] : (int) $row['forum_id'];
- $forum_data[$forum_id]['posts'] = (int) $row['forum_posts'];
+ $forum_data[$forum_id]['posts_approved'] = (int) $row['forum_posts_approved'];
+ $forum_data[$forum_id]['posts_unapproved'] = (int) $row['forum_posts_unapproved'];
+ $forum_data[$forum_id]['posts_softdeleted'] = (int) $row['forum_posts_softdeleted'];
}
$db->sql_freeresult($result);
}
@@ -1740,14 +2118,14 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false,
$sql = 'SELECT MAX(t.topic_last_post_id) as last_post_id
FROM ' . TOPICS_TABLE . ' t
WHERE ' . $db->sql_in_set('t.forum_id', $forum_ids) . '
- AND t.topic_approved = 1';
+ AND t.topic_visibility = ' . ITEM_APPROVED;
}
else
{
$sql = 'SELECT t.forum_id, MAX(t.topic_last_post_id) as last_post_id
FROM ' . TOPICS_TABLE . ' t
WHERE ' . $db->sql_in_set('t.forum_id', $forum_ids) . '
- AND t.topic_approved = 1
+ AND t.topic_visibility = ' . ITEM_APPROVED . '
GROUP BY t.forum_id';
}
@@ -1810,7 +2188,7 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false,
if ($sync_extra)
{
- array_push($fieldnames, 'posts', 'topics', 'topics_real');
+ array_push($fieldnames, 'posts_approved', 'posts_unapproved', 'posts_softdeleted', 'topics_approved', 'topics_unapproved', 'topics_softdeleted');
}
foreach ($forum_data as $forum_id => $row)
@@ -1845,11 +2223,11 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false,
break;
case 'topic':
- $topic_data = $post_ids = $approved_unapproved_ids = $resync_forums = $delete_topics = $delete_posts = $moved_topics = array();
+ $topic_data = $post_ids = $resync_forums = $delete_topics = $delete_posts = $moved_topics = array();
$db->sql_transaction('begin');
- $sql = 'SELECT t.topic_id, t.forum_id, t.topic_moved_id, t.topic_approved, ' . (($sync_extra) ? 't.topic_attachment, t.topic_reported, ' : '') . 't.topic_poster, t.topic_time, t.topic_replies, t.topic_replies_real, t.topic_first_post_id, t.topic_first_poster_name, t.topic_first_poster_colour, t.topic_last_post_id, t.topic_last_post_subject, t.topic_last_poster_id, t.topic_last_poster_name, t.topic_last_poster_colour, t.topic_last_post_time
+ $sql = 'SELECT t.topic_id, t.forum_id, t.topic_moved_id, t.topic_visibility, ' . (($sync_extra) ? 't.topic_attachment, t.topic_reported, ' : '') . 't.topic_poster, t.topic_time, t.topic_posts_approved, t.topic_posts_unapproved, t.topic_posts_softdeleted, t.topic_first_post_id, t.topic_first_poster_name, t.topic_first_poster_colour, t.topic_last_post_id, t.topic_last_post_subject, t.topic_last_poster_id, t.topic_last_poster_name, t.topic_last_poster_colour, t.topic_last_post_time
FROM ' . TOPICS_TABLE . " t
$where_sql";
$result = $db->sql_query($sql);
@@ -1864,8 +2242,10 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false,
$topic_id = (int) $row['topic_id'];
$topic_data[$topic_id] = $row;
- $topic_data[$topic_id]['replies_real'] = -1;
- $topic_data[$topic_id]['replies'] = 0;
+ $topic_data[$topic_id]['visibility'] = ITEM_UNAPPROVED;
+ $topic_data[$topic_id]['posts_approved'] = 0;
+ $topic_data[$topic_id]['posts_unapproved'] = 0;
+ $topic_data[$topic_id]['posts_softdeleted'] = 0;
$topic_data[$topic_id]['first_post_id'] = 0;
$topic_data[$topic_id]['last_post_id'] = 0;
unset($topic_data[$topic_id]['topic_id']);
@@ -1882,11 +2262,11 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false,
$db->sql_freeresult($result);
// Use "t" as table alias because of the $where_sql clause
- // NOTE: 't.post_approved' in the GROUP BY is causing a major slowdown.
- $sql = 'SELECT t.topic_id, t.post_approved, COUNT(t.post_id) AS total_posts, MIN(t.post_id) AS first_post_id, MAX(t.post_id) AS last_post_id
+ // NOTE: 't.post_visibility' in the GROUP BY is causing a major slowdown.
+ $sql = 'SELECT t.topic_id, t.post_visibility, COUNT(t.post_id) AS total_posts, MIN(t.post_id) AS first_post_id, MAX(t.post_id) AS last_post_id
FROM ' . POSTS_TABLE . " t
$where_sql
- GROUP BY t.topic_id, t.post_approved";
+ GROUP BY t.topic_id, t.post_visibility";
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result))
@@ -1907,14 +2287,38 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false,
// When we'll be done, only topics with no posts will remain
unset($delete_topics[$topic_id]);
- $topic_data[$topic_id]['replies_real'] += $row['total_posts'];
- $topic_data[$topic_id]['first_post_id'] = (!$topic_data[$topic_id]['first_post_id']) ? $row['first_post_id'] : min($topic_data[$topic_id]['first_post_id'], $row['first_post_id']);
+ if ($row['post_visibility'] == ITEM_APPROVED)
+ {
+ $topic_data[$topic_id]['posts_approved'] = $row['total_posts'];
+ }
+ else if ($row['post_visibility'] == ITEM_UNAPPROVED || $row['post_visibility'] == ITEM_REAPPROVE)
+ {
+ $topic_data[$topic_id]['posts_unapproved'] = $row['total_posts'];
+ }
+ else if ($row['post_visibility'] == ITEM_DELETED)
+ {
+ $topic_data[$topic_id]['posts_softdeleted'] = $row['total_posts'];
+ }
- if ($row['post_approved'] || !$topic_data[$topic_id]['last_post_id'])
+ if ($row['post_visibility'] == ITEM_APPROVED)
{
- $topic_data[$topic_id]['replies'] = $row['total_posts'] - 1;
+ $topic_data[$topic_id]['visibility'] = ITEM_APPROVED;
+ $topic_data[$topic_id]['first_post_id'] = $row['first_post_id'];
$topic_data[$topic_id]['last_post_id'] = $row['last_post_id'];
}
+ else if ($topic_data[$topic_id]['visibility'] != ITEM_APPROVED)
+ {
+ // If there is no approved post, we take the min/max of the other visibilities
+ // for the last and first post info, because it is only visible to moderators anyway
+ $topic_data[$topic_id]['first_post_id'] = (!empty($topic_data[$topic_id]['first_post_id'])) ? min($topic_data[$topic_id]['first_post_id'], $row['first_post_id']) : $row['first_post_id'];
+ $topic_data[$topic_id]['last_post_id'] = max($topic_data[$topic_id]['last_post_id'], $row['last_post_id']);
+
+ if ($topic_data[$topic_id]['visibility'] == ITEM_UNAPPROVED || $topic_data[$topic_id]['visibility'] == ITEM_REAPPROVE)
+ {
+ // Soft delete status is stronger than unapproved.
+ $topic_data[$topic_id]['visibility'] = $row['post_visibility'];
+ }
+ }
}
}
$db->sql_freeresult($result);
@@ -1955,7 +2359,7 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false,
unset($delete_topics, $delete_topic_ids);
}
- $sql = 'SELECT p.post_id, p.topic_id, p.post_approved, p.poster_id, p.post_subject, p.post_username, p.post_time, u.username, u.user_colour
+ $sql = 'SELECT p.post_id, p.topic_id, p.post_visibility, p.poster_id, p.post_subject, p.post_username, p.post_time, u.username, u.user_colour
FROM ' . POSTS_TABLE . ' p, ' . USERS_TABLE . ' u
WHERE ' . $db->sql_in_set('p.post_id', $post_ids) . '
AND u.user_id = p.poster_id';
@@ -1968,10 +2372,6 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false,
if ($row['post_id'] == $topic_data[$topic_id]['first_post_id'])
{
- if ($topic_data[$topic_id]['topic_approved'] != $row['post_approved'])
- {
- $approved_unapproved_ids[] = $topic_id;
- }
$topic_data[$topic_id]['time'] = $row['post_time'];
$topic_data[$topic_id]['poster'] = $row['poster_id'];
$topic_data[$topic_id]['first_poster_name'] = ($row['poster_id'] == ANONYMOUS) ? $row['post_username'] : $row['username'];
@@ -2032,7 +2432,7 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false,
$sync_shadow_topics = array();
if (sizeof($post_ids))
{
- $sql = 'SELECT p.post_id, p.topic_id, p.post_approved, p.poster_id, p.post_subject, p.post_username, p.post_time, u.username, u.user_colour
+ $sql = 'SELECT p.post_id, p.topic_id, p.post_visibility, p.poster_id, p.post_subject, p.post_username, p.post_time, u.username, u.user_colour
FROM ' . POSTS_TABLE . ' p, ' . USERS_TABLE . ' u
WHERE ' . $db->sql_in_set('p.post_id', $post_ids) . '
AND u.user_id = p.poster_id';
@@ -2099,18 +2499,8 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false,
unset($sync_shadow_topics, $shadow_topic_data);
}
- // approved becomes unapproved, and vice-versa
- if (sizeof($approved_unapproved_ids))
- {
- $sql = 'UPDATE ' . TOPICS_TABLE . '
- SET topic_approved = 1 - topic_approved
- WHERE ' . $db->sql_in_set('topic_id', $approved_unapproved_ids);
- $db->sql_query($sql);
- }
- unset($approved_unapproved_ids);
-
// These are fields that will be synchronised
- $fieldnames = array('time', 'replies', 'replies_real', 'poster', 'first_post_id', 'first_poster_name', 'first_poster_colour', 'last_post_id', 'last_post_subject', 'last_post_time', 'last_poster_id', 'last_poster_name', 'last_poster_colour');
+ $fieldnames = array('time', 'visibility', 'posts_approved', 'posts_unapproved', 'posts_softdeleted', 'poster', 'first_post_id', 'first_poster_name', 'first_poster_colour', 'last_post_id', 'last_post_subject', 'last_post_time', 'last_poster_id', 'last_poster_name', 'last_poster_colour');
if ($sync_extra)
{
@@ -2189,9 +2579,9 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false,
/**
* Prune function
*/
-function prune($forum_id, $prune_mode, $prune_date, $prune_flags = 0, $auto_sync = true)
+function prune($forum_id, $prune_mode, $prune_date, $prune_flags = 0, $auto_sync = true, $prune_limit = 0)
{
- global $db;
+ global $db, $phpbb_dispatcher;
if (!is_array($forum_id))
{
@@ -2208,6 +2598,7 @@ function prune($forum_id, $prune_mode, $prune_date, $prune_flags = 0, $auto_sync
if (!($prune_flags & FORUM_FLAG_PRUNE_ANNOUNCE))
{
$sql_and .= ' AND topic_type <> ' . POST_ANNOUNCE;
+ $sql_and .= ' AND topic_type <> ' . POST_GLOBAL;
}
if (!($prune_flags & FORUM_FLAG_PRUNE_STICKY))
@@ -2225,12 +2616,42 @@ function prune($forum_id, $prune_mode, $prune_date, $prune_flags = 0, $auto_sync
$sql_and .= " AND topic_last_view_time < $prune_date";
}
+ if ($prune_mode == 'shadow')
+ {
+ $sql_and .= ' AND topic_status = ' . ITEM_MOVED . " AND topic_last_post_time < $prune_date";
+ }
+
+ /**
+ * Use this event to modify the SQL that selects topics to be pruned
+ *
+ * @event core.prune_sql
+ * @var string forum_id The forum id
+ * @var string prune_mode The prune mode
+ * @var string prune_date The prune date
+ * @var int prune_flags The prune flags
+ * @var bool auto_sync Whether or not to perform auto sync
+ * @var string sql_and SQL text appended to where clause
+ * @var int prune_limit The prune limit
+ * @since 3.1.3-RC1
+ * @changed 3.1.10-RC1 Added prune_limit
+ */
+ $vars = array(
+ 'forum_id',
+ 'prune_mode',
+ 'prune_date',
+ 'prune_flags',
+ 'auto_sync',
+ 'sql_and',
+ 'prune_limit',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.prune_sql', compact($vars)));
+
$sql = 'SELECT topic_id
FROM ' . TOPICS_TABLE . '
WHERE ' . $db->sql_in_set('forum_id', $forum_id) . "
AND poll_start = 0
$sql_and";
- $result = $db->sql_query($sql);
+ $result = $db->sql_query_limit($sql, $prune_limit);
$topic_list = array();
while ($row = $db->sql_fetchrow($result))
@@ -2247,7 +2668,7 @@ function prune($forum_id, $prune_mode, $prune_date, $prune_flags = 0, $auto_sync
AND poll_start > 0
AND poll_last_vote < $prune_date
$sql_and";
- $result = $db->sql_query($sql);
+ $result = $db->sql_query_limit($sql, $prune_limit);
while ($row = $db->sql_fetchrow($result))
{
@@ -2280,12 +2701,15 @@ function auto_prune($forum_id, $prune_mode, $prune_flags, $prune_days, $prune_fr
$prune_date = time() - ($prune_days * 86400);
$next_prune = time() + ($prune_freq * 86400);
- prune($forum_id, $prune_mode, $prune_date, $prune_flags, true);
+ $result = prune($forum_id, $prune_mode, $prune_date, $prune_flags, true, 300);
- $sql = 'UPDATE ' . FORUMS_TABLE . "
- SET prune_next = $next_prune
- WHERE forum_id = $forum_id";
- $db->sql_query($sql);
+ if ($result['topics'] == 0 && $result['posts'] == 0)
+ {
+ $sql = 'UPDATE ' . FORUMS_TABLE . "
+ SET prune_next = $next_prune
+ WHERE forum_id = $forum_id";
+ $db->sql_query($sql);
+ }
add_log('admin', 'LOG_AUTO_PRUNE', $row['forum_name']);
}
@@ -2294,36 +2718,25 @@ function auto_prune($forum_id, $prune_mode, $prune_flags, $prune_days, $prune_fr
}
/**
-* remove_comments will strip the sql comment lines out of an uploaded sql file
-* specifically for mssql and postgres type files in the install....
+* Cache moderators. Called whenever permissions are changed
+* via admin_permissions. Changes of usernames and group names
+* must be carried through for the moderators table.
*
-* @deprecated Use phpbb_remove_comments() instead.
+* @param \phpbb\db\driver\driver_interface $db Database connection
+* @param \phpbb\cache\driver\driver_interface Cache driver
+* @param \phpbb\auth\auth $auth Authentication object
+* @return null
*/
-function remove_comments(&$output)
+function phpbb_cache_moderators($db, $cache, $auth)
{
- // Remove /* */ comments (http://ostermiller.org/findcomment.html)
- $output = preg_replace('#/\*(.|[\r\n])*?\*/#', "\n", $output);
-
- // Return by reference and value.
- return $output;
-}
-
-/**
-* Cache moderators, called whenever permissions are changed via admin_permissions. Changes of username
-* and group names must be carried through for the moderators table
-*/
-function cache_moderators()
-{
- global $db, $cache, $auth, $phpbb_root_path, $phpEx;
-
// Remove cached sql results
$cache->destroy('sql', MODERATOR_CACHE_TABLE);
// Clear table
- switch ($db->sql_layer)
+ switch ($db->get_sql_layer())
{
case 'sqlite':
- case 'firebird':
+ case 'sqlite3':
$db->sql_query('DELETE FROM ' . MODERATOR_CACHE_TABLE);
break;
@@ -2345,7 +2758,7 @@ function cache_moderators()
$ug_id_ary = array_keys($hold_ary);
// Remove users who have group memberships with DENY moderator permissions
- $sql = $db->sql_build_query('SELECT', array(
+ $sql_ary_deny = array(
'SELECT' => 'a.forum_id, ug.user_id, g.group_id',
'FROM' => array(
@@ -2358,8 +2771,8 @@ function cache_moderators()
'LEFT_JOIN' => array(
array(
'FROM' => array(ACL_ROLES_DATA_TABLE => 'r'),
- 'ON' => 'a.auth_role_id = r.role_id'
- )
+ 'ON' => 'a.auth_role_id = r.role_id',
+ ),
),
'WHERE' => '(o.auth_option_id = a.auth_option_id OR o.auth_option_id = r.auth_option_id)
@@ -2370,8 +2783,9 @@ function cache_moderators()
AND NOT (ug.group_leader = 1 AND g.group_skip_auth = 1)
AND ' . $db->sql_in_set('ug.user_id', $ug_id_ary) . "
AND ug.user_pending = 0
- AND o.auth_option " . $db->sql_like_expression('m_' . $db->any_char),
- ));
+ AND o.auth_option " . $db->sql_like_expression('m_' . $db->get_any_char()),
+ );
+ $sql = $db->sql_build_query('SELECT', $sql_ary_deny);
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result))
@@ -2396,6 +2810,7 @@ function cache_moderators()
{
$usernames_ary[$row['user_id']] = $row['username'];
}
+ $db->sql_freeresult($result);
foreach ($hold_ary as $user_id => $forum_id_ary)
{
@@ -2486,302 +2901,45 @@ function cache_moderators()
/**
* View log
-* If $log_count is set to false, we will skip counting all entries in the database.
+*
+* @param string $mode The mode defines which log_type is used and from which log the entry is retrieved
+* @param array &$log The result array with the logs
+* @param mixed &$log_count If $log_count is set to false, we will skip counting all entries in the database.
+* Otherwise an integer with the number of total matching entries is returned.
+* @param int $limit Limit the number of entries that are returned
+* @param int $offset Offset when fetching the log entries, f.e. when paginating
+* @param mixed $forum_id Restrict the log entries to the given forum_id (can also be an array of forum_ids)
+* @param int $topic_id Restrict the log entries to the given topic_id
+* @param int $user_id Restrict the log entries to the given user_id
+* @param int $log_time Only get log entries newer than the given timestamp
+* @param string $sort_by SQL order option, e.g. 'l.log_time DESC'
+* @param string $keywords Will only return log entries that have the keywords in log_operation or log_data
+*
+* @return int Returns the offset of the last valid page, if the specified offset was invalid (too high)
*/
function view_log($mode, &$log, &$log_count, $limit = 0, $offset = 0, $forum_id = 0, $topic_id = 0, $user_id = 0, $limit_days = 0, $sort_by = 'l.log_time DESC', $keywords = '')
{
- global $db, $user, $auth, $phpEx, $phpbb_root_path, $phpbb_admin_path;
+ global $phpbb_log;
- $topic_id_list = $reportee_id_list = $is_auth = $is_mod = array();
+ $count_logs = ($log_count !== false);
- $profile_url = (defined('IN_ADMIN')) ? append_sid("{$phpbb_admin_path}index.$phpEx", 'i=users&amp;mode=overview') : append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile');
+ $log = $phpbb_log->get_logs($mode, $count_logs, $limit, $offset, $forum_id, $topic_id, $user_id, $limit_days, $sort_by, $keywords);
+ $log_count = $phpbb_log->get_log_count();
- switch ($mode)
- {
- case 'admin':
- $log_type = LOG_ADMIN;
- $sql_forum = '';
- break;
-
- case 'mod':
- $log_type = LOG_MOD;
- $sql_forum = '';
-
- if ($topic_id)
- {
- $sql_forum = 'AND l.topic_id = ' . (int) $topic_id;
- }
- else if (is_array($forum_id))
- {
- $sql_forum = 'AND ' . $db->sql_in_set('l.forum_id', array_map('intval', $forum_id));
- }
- else if ($forum_id)
- {
- $sql_forum = 'AND l.forum_id = ' . (int) $forum_id;
- }
- break;
-
- case 'user':
- $log_type = LOG_USERS;
- $sql_forum = 'AND l.reportee_id = ' . (int) $user_id;
- break;
-
- case 'users':
- $log_type = LOG_USERS;
- $sql_forum = '';
- break;
-
- case 'critical':
- $log_type = LOG_CRITICAL;
- $sql_forum = '';
- break;
-
- default:
- return;
- }
-
- // Use no preg_quote for $keywords because this would lead to sole backslashes being added
- // We also use an OR connection here for spaces and the | string. Currently, regex is not supported for searching (but may come later).
- $keywords = preg_split('#[\s|]+#u', utf8_strtolower($keywords), 0, PREG_SPLIT_NO_EMPTY);
- $sql_keywords = '';
-
- if (!empty($keywords))
- {
- $keywords_pattern = array();
-
- // Build pattern and keywords...
- for ($i = 0, $num_keywords = sizeof($keywords); $i < $num_keywords; $i++)
- {
- $keywords_pattern[] = preg_quote($keywords[$i], '#');
- $keywords[$i] = $db->sql_like_expression($db->any_char . $keywords[$i] . $db->any_char);
- }
-
- $keywords_pattern = '#' . implode('|', $keywords_pattern) . '#ui';
-
- $operations = array();
- foreach ($user->lang as $key => $value)
- {
- if (substr($key, 0, 4) == 'LOG_' && preg_match($keywords_pattern, $value))
- {
- $operations[] = $key;
- }
- }
-
- $sql_keywords = 'AND (';
- if (!empty($operations))
- {
- $sql_keywords .= $db->sql_in_set('l.log_operation', $operations) . ' OR ';
- }
- $sql_lower = $db->sql_lower_text('l.log_data');
- $sql_keywords .= "$sql_lower " . implode(" OR $sql_lower ", $keywords) . ')';
- }
-
- if ($log_count !== false)
- {
- $sql = 'SELECT COUNT(l.log_id) AS total_entries
- FROM ' . LOG_TABLE . ' l, ' . USERS_TABLE . " u
- WHERE l.log_type = $log_type
- AND l.user_id = u.user_id
- AND l.log_time >= $limit_days
- $sql_keywords
- $sql_forum";
- $result = $db->sql_query($sql);
- $log_count = (int) $db->sql_fetchfield('total_entries');
- $db->sql_freeresult($result);
- }
-
- // $log_count may be false here if false was passed in for it,
- // because in this case we did not run the COUNT() query above.
- // If we ran the COUNT() query and it returned zero rows, return;
- // otherwise query for logs below.
- if ($log_count === 0)
- {
- // Save the queries, because there are no logs to display
- return 0;
- }
-
- if ($offset >= $log_count)
- {
- $offset = ($offset - $limit < 0) ? 0 : $offset - $limit;
- }
-
- $sql = "SELECT l.*, u.username, u.username_clean, u.user_colour
- FROM " . LOG_TABLE . " l, " . USERS_TABLE . " u
- WHERE l.log_type = $log_type
- AND u.user_id = l.user_id
- " . (($limit_days) ? "AND l.log_time >= $limit_days" : '') . "
- $sql_keywords
- $sql_forum
- ORDER BY $sort_by";
- $result = $db->sql_query_limit($sql, $limit, $offset);
-
- $i = 0;
- $log = array();
- while ($row = $db->sql_fetchrow($result))
- {
- if ($row['topic_id'])
- {
- $topic_id_list[] = $row['topic_id'];
- }
-
- if ($row['reportee_id'])
- {
- $reportee_id_list[] = $row['reportee_id'];
- }
-
- $log[$i] = array(
- 'id' => $row['log_id'],
-
- 'reportee_id' => $row['reportee_id'],
- 'reportee_username' => '',
- 'reportee_username_full'=> '',
-
- 'user_id' => $row['user_id'],
- 'username' => $row['username'],
- 'username_full' => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour'], false, $profile_url),
-
- 'ip' => $row['log_ip'],
- 'time' => $row['log_time'],
- 'forum_id' => $row['forum_id'],
- 'topic_id' => $row['topic_id'],
-
- 'viewforum' => ($row['forum_id'] && $auth->acl_get('f_read', $row['forum_id'])) ? append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $row['forum_id']) : false,
- 'action' => (isset($user->lang[$row['log_operation']])) ? $user->lang[$row['log_operation']] : '{' . ucfirst(str_replace('_', ' ', $row['log_operation'])) . '}',
- );
-
- if (!empty($row['log_data']))
- {
- $log_data_ary = @unserialize($row['log_data']);
- $log_data_ary = ($log_data_ary === false) ? array() : $log_data_ary;
-
- if (isset($user->lang[$row['log_operation']]))
- {
- // Check if there are more occurrences of % than arguments, if there are we fill out the arguments array
- // It doesn't matter if we add more arguments than placeholders
- if ((substr_count($log[$i]['action'], '%') - sizeof($log_data_ary)) > 0)
- {
- $log_data_ary = array_merge($log_data_ary, array_fill(0, substr_count($log[$i]['action'], '%') - sizeof($log_data_ary), ''));
- }
-
- $log[$i]['action'] = vsprintf($log[$i]['action'], $log_data_ary);
-
- // If within the admin panel we do not censor text out
- if (defined('IN_ADMIN'))
- {
- $log[$i]['action'] = bbcode_nl2br($log[$i]['action']);
- }
- else
- {
- $log[$i]['action'] = bbcode_nl2br(censor_text($log[$i]['action']));
- }
- }
- else if (!empty($log_data_ary))
- {
- $log[$i]['action'] .= '<br />' . implode('', $log_data_ary);
- }
-
- /* Apply make_clickable... has to be seen if it is for good. :/
- // Seems to be not for the moment, reconsider later...
- $log[$i]['action'] = make_clickable($log[$i]['action']);
- */
- }
-
- $i++;
- }
- $db->sql_freeresult($result);
-
- if (sizeof($topic_id_list))
- {
- $topic_id_list = array_unique($topic_id_list);
-
- // This query is not really needed if move_topics() updates the forum_id field,
- // although it's also used to determine if the topic still exists in the database
- $sql = 'SELECT topic_id, forum_id
- FROM ' . TOPICS_TABLE . '
- WHERE ' . $db->sql_in_set('topic_id', array_map('intval', $topic_id_list));
- $result = $db->sql_query($sql);
-
- $default_forum_id = 0;
-
- while ($row = $db->sql_fetchrow($result))
- {
- if (!$row['forum_id'])
- {
- if ($auth->acl_getf_global('f_read'))
- {
- if (!$default_forum_id)
- {
- $sql = 'SELECT forum_id
- FROM ' . FORUMS_TABLE . '
- WHERE forum_type = ' . FORUM_POST;
- $f_result = $db->sql_query_limit($sql, 1);
- $default_forum_id = (int) $db->sql_fetchfield('forum_id', false, $f_result);
- $db->sql_freeresult($f_result);
- }
-
- $is_auth[$row['topic_id']] = $default_forum_id;
- }
- }
- else
- {
- if ($auth->acl_get('f_read', $row['forum_id']))
- {
- $is_auth[$row['topic_id']] = $row['forum_id'];
- }
- }
-
- if ($auth->acl_gets('a_', 'm_', $row['forum_id']))
- {
- $is_mod[$row['topic_id']] = $row['forum_id'];
- }
- }
- $db->sql_freeresult($result);
-
- foreach ($log as $key => $row)
- {
- $log[$key]['viewtopic'] = (isset($is_auth[$row['topic_id']])) ? append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $is_auth[$row['topic_id']] . '&amp;t=' . $row['topic_id']) : false;
- $log[$key]['viewlogs'] = (isset($is_mod[$row['topic_id']])) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=logs&amp;mode=topic_logs&amp;t=' . $row['topic_id'], true, $user->session_id) : false;
- }
- }
-
- if (sizeof($reportee_id_list))
- {
- $reportee_id_list = array_unique($reportee_id_list);
- $reportee_names_list = array();
-
- $sql = 'SELECT user_id, username, user_colour
- FROM ' . USERS_TABLE . '
- WHERE ' . $db->sql_in_set('user_id', $reportee_id_list);
- $result = $db->sql_query($sql);
-
- while ($row = $db->sql_fetchrow($result))
- {
- $reportee_names_list[$row['user_id']] = $row;
- }
- $db->sql_freeresult($result);
-
- foreach ($log as $key => $row)
- {
- if (!isset($reportee_names_list[$row['reportee_id']]))
- {
- continue;
- }
-
- $log[$key]['reportee_username'] = $reportee_names_list[$row['reportee_id']]['username'];
- $log[$key]['reportee_username_full'] = get_username_string('full', $row['reportee_id'], $reportee_names_list[$row['reportee_id']]['username'], $reportee_names_list[$row['reportee_id']]['user_colour'], false, $profile_url);
- }
- }
-
- return $offset;
+ return $phpbb_log->get_valid_offset();
}
/**
-* Update foes - remove moderators and administrators from foe lists...
+* Removes moderators and administrators from foe lists.
+*
+* @param \phpbb\db\driver\driver_interface $db Database connection
+* @param \phpbb\auth\auth $auth Authentication object
+* @param array|bool $group_id If an array, remove all members of this group from foe lists, or false to ignore
+* @param array|bool $user_id If an array, remove this user from foe lists, or false to ignore
+* @return null
*/
-function update_foes($group_id = false, $user_id = false)
+function phpbb_update_foes($db, $auth, $group_id = false, $user_id = false)
{
- global $db, $auth;
-
// update foes for some user
if (is_array($user_id) && sizeof($user_id))
{
@@ -2796,18 +2954,18 @@ function update_foes($group_id = false, $user_id = false)
if (is_array($group_id) && sizeof($group_id))
{
// Grab group settings...
- $sql = $db->sql_build_query('SELECT', array(
+ $sql_ary = array(
'SELECT' => 'a.group_id',
'FROM' => array(
ACL_OPTIONS_TABLE => 'ao',
- ACL_GROUPS_TABLE => 'a'
+ ACL_GROUPS_TABLE => 'a',
),
'LEFT_JOIN' => array(
array(
'FROM' => array(ACL_ROLES_DATA_TABLE => 'r'),
- 'ON' => 'a.auth_role_id = r.role_id'
+ 'ON' => 'a.auth_role_id = r.role_id',
),
),
@@ -2815,8 +2973,9 @@ function update_foes($group_id = false, $user_id = false)
AND ' . $db->sql_in_set('a.group_id', $group_id) . "
AND ao.auth_option IN ('a_', 'm_')",
- 'GROUP_BY' => 'a.group_id'
- ));
+ 'GROUP_BY' => 'a.group_id',
+ );
+ $sql = $db->sql_build_query('SELECT', $sql_ary);
$result = $db->sql_query($sql);
$groups = array();
@@ -2831,11 +2990,11 @@ function update_foes($group_id = false, $user_id = false)
return;
}
- switch ($db->sql_layer)
+ switch ($db->get_sql_layer())
{
case 'mysqli':
case 'mysql4':
- $sql = 'DELETE ' . (($db->sql_layer === 'mysqli' || version_compare($db->sql_server_info(true), '4.1', '>=')) ? 'z.*' : ZEBRA_TABLE) . '
+ $sql = 'DELETE ' . (($db->get_sql_layer() === 'mysqli' || version_compare($db->sql_server_info(true), '4.1', '>=')) ? 'z.*' : ZEBRA_TABLE) . '
FROM ' . ZEBRA_TABLE . ' z, ' . USER_GROUP_TABLE . ' ug
WHERE z.zebra_id = ug.user_id
AND z.foe = 1
@@ -2946,6 +3105,7 @@ function view_inactive_users(&$users, &$user_count, $limit = 0, $offset = 0, $li
$users[] = $row;
}
+ $db->sql_freeresult($result);
return $offset;
}
@@ -2988,7 +3148,7 @@ function get_database_size()
$database_size = false;
// This code is heavily influenced by a similar routine in phpMyAdmin 2.2.0
- switch ($db->sql_layer)
+ switch ($db->get_sql_layer())
{
case 'mysql':
case 'mysql4':
@@ -3002,9 +3162,9 @@ function get_database_size()
{
$version = $row['mysql_version'];
- if (preg_match('#(3\.23|[45]\.)#', $version))
+ if (preg_match('#(3\.23|[45]\.|10\.[0-9]\.[0-9]{1,2}-+Maria)#', $version))
{
- $db_name = (preg_match('#^(?:3\.23\.(?:[6-9]|[1-9]{2}))|[45]\.#', $version)) ? "`{$db->dbname}`" : $db->dbname;
+ $db_name = (preg_match('#^(?:3\.23\.(?:[6-9]|[1-9]{2}))|[45]\.|10\.[0-9]\.[0-9]{1,2}-+Maria#', $version)) ? "`{$db->get_db_name()}`" : $db->get_db_name();
$sql = 'SHOW TABLE STATUS
FROM ' . $db_name;
@@ -3013,7 +3173,7 @@ function get_database_size()
$database_size = 0;
while ($row = $db->sql_fetchrow($result))
{
- if ((isset($row['Type']) && $row['Type'] != 'MRG_MyISAM') || (isset($row['Engine']) && ($row['Engine'] == 'MyISAM' || $row['Engine'] == 'InnoDB')))
+ if ((isset($row['Type']) && $row['Type'] != 'MRG_MyISAM') || (isset($row['Engine']) && ($row['Engine'] == 'MyISAM' || $row['Engine'] == 'InnoDB' || $row['Engine'] == 'Aria')))
{
if ($table_prefix != '')
{
@@ -3033,18 +3193,8 @@ function get_database_size()
}
break;
- case 'firebird':
- global $dbname;
-
- // if it on the local machine, we can get lucky
- if (file_exists($dbname))
- {
- $database_size = filesize($dbname);
- }
-
- break;
-
case 'sqlite':
+ case 'sqlite3':
global $dbhost;
if (file_exists($dbhost))
@@ -3061,7 +3211,7 @@ function get_database_size()
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
-
+
$sql = 'SELECT ((SUM(size) * 8.0) * 1024.0) as dbsize
FROM sysfiles';
@@ -3070,7 +3220,7 @@ function get_database_size()
// Azure stats are stored elsewhere
if (strpos($row['mssql_version'], 'SQL Azure') !== false)
{
- $sql = 'SELECT ((SUM(reserved_page_count) * 8.0) * 1024.0) as dbsize
+ $sql = 'SELECT ((SUM(reserved_page_count) * 8.0) * 1024.0) as dbsize
FROM sys.dm_db_partition_stats';
}
}
@@ -3090,7 +3240,7 @@ function get_database_size()
if ($row['proname'] == 'pg_database_size')
{
- $database = $db->dbname;
+ $database = $db->get_db_name();
if (strpos($database, '.') !== false)
{
list($database, ) = explode('.', $database);
@@ -3130,71 +3280,24 @@ function get_database_size()
/**
* Retrieve contents from remotely stored file
+*
+* @deprecated 3.1.2 Use file_downloader instead
*/
function get_remote_file($host, $directory, $filename, &$errstr, &$errno, $port = 80, $timeout = 6)
{
- global $user;
-
- if ($fsock = @fsockopen($host, $port, $errno, $errstr, $timeout))
- {
- @fputs($fsock, "GET $directory/$filename HTTP/1.0\r\n");
- @fputs($fsock, "HOST: $host\r\n");
- @fputs($fsock, "Connection: close\r\n\r\n");
-
- $timer_stop = time() + $timeout;
- stream_set_timeout($fsock, $timeout);
-
- $file_info = '';
- $get_info = false;
-
- while (!@feof($fsock))
- {
- if ($get_info)
- {
- $file_info .= @fread($fsock, 1024);
- }
- else
- {
- $line = @fgets($fsock, 1024);
- if ($line == "\r\n")
- {
- $get_info = true;
- }
- else if (stripos($line, '404 not found') !== false)
- {
- $errstr = $user->lang['FILE_NOT_FOUND'] . ': ' . $filename;
- return false;
- }
- }
+ global $phpbb_container;
- $stream_meta_data = stream_get_meta_data($fsock);
+ // Get file downloader and assign $errstr and $errno
+ $file_downloader = $phpbb_container->get('file_downloader');
- if (!empty($stream_meta_data['timed_out']) || time() >= $timer_stop)
- {
- $errstr = $user->lang['FSOCK_TIMEOUT'];
- return false;
- }
- }
- @fclose($fsock);
- }
- else
- {
- if ($errstr)
- {
- $errstr = utf8_convert_message($errstr);
- return false;
- }
- else
- {
- $errstr = $user->lang['FSOCK_DISABLED'];
- return false;
- }
- }
+ $file_data = $file_downloader->get($host, $directory, $filename, $port, $timeout);
+ $errstr = $file_downloader->get_error_string();
+ $errno = $file_downloader->get_error_number();
- return $file_info;
+ return $file_data;
}
-/**
+/*
* Tidy Warnings
* Remove all warnings which have now expired from the database
* The duration of a warning can be defined by the administrator
@@ -3278,77 +3381,58 @@ function tidy_database()
*/
function add_permission_language()
{
- global $user, $phpEx;
+ global $config, $user, $phpEx, $phpbb_extension_manager;
- // First of all, our own file. We need to include it as the first file because it presets all relevant variables.
- $user->add_lang('acp/permissions_phpbb');
+ // add permission language files from extensions
+ $finder = $phpbb_extension_manager->get_finder();
- $files_to_add = array();
+ // We grab the language files from the default, English and user's language.
+ // So we can fall back to the other files like we do when using add_lang()
+ $default_lang_files = $english_lang_files = $user_lang_files = array();
- // Now search in acp and mods folder for permissions_ files.
- foreach (array('acp/', 'mods/') as $path)
+ // Search for board default language if it's not the user language
+ if ($config['default_lang'] != $user->lang_name)
{
- $dh = @opendir($user->lang_path . $user->lang_name . '/' . $path);
-
- if ($dh)
- {
- while (($file = readdir($dh)) !== false)
- {
- if ($file !== 'permissions_phpbb.' . $phpEx && strpos($file, 'permissions_') === 0 && substr($file, -(strlen($phpEx) + 1)) === '.' . $phpEx)
- {
- $files_to_add[] = $path . substr($file, 0, -(strlen($phpEx) + 1));
- }
- }
- closedir($dh);
- }
+ $default_lang_files = $finder
+ ->prefix('permissions_')
+ ->suffix(".$phpEx")
+ ->core_path('language/' . basename($config['default_lang']) . '/')
+ ->extension_directory('/language/' . basename($config['default_lang']))
+ ->find();
}
- if (!sizeof($files_to_add))
+ // Search for english, if its not the default or user language
+ if ($config['default_lang'] != 'en' && $user->lang_name != 'en')
{
- return false;
+ $english_lang_files = $finder
+ ->prefix('permissions_')
+ ->suffix(".$phpEx")
+ ->core_path('language/en/')
+ ->extension_directory('/language/en')
+ ->find();
}
- $user->add_lang($files_to_add);
- return true;
-}
+ // Find files in the user's language
+ $user_lang_files = $finder
+ ->prefix('permissions_')
+ ->suffix(".$phpEx")
+ ->core_path('language/' . $user->lang_name . '/')
+ ->extension_directory('/language/' . $user->lang_name)
+ ->find();
-/**
- * Obtains the latest version information
- *
- * @param bool $force_update Ignores cached data. Defaults to false.
- * @param bool $warn_fail Trigger a warning if obtaining the latest version information fails. Defaults to false.
- * @param int $ttl Cache version information for $ttl seconds. Defaults to 86400 (24 hours).
- *
- * @return string | false Version info on success, false on failure.
- */
-function obtain_latest_version_info($force_update = false, $warn_fail = false, $ttl = 86400)
-{
- global $cache;
+ $lang_files = array_merge($english_lang_files, $default_lang_files, $user_lang_files);
- $info = $cache->get('versioncheck');
-
- if ($info === false || $force_update)
+ foreach ($lang_files as $lang_file => $ext_name)
{
- $errstr = '';
- $errno = 0;
-
- $info = get_remote_file('version.phpbb.com', '/phpbb',
- ((defined('PHPBB_QA')) ? '30x_qa.txt' : '30x.txt'), $errstr, $errno);
-
- if (empty($info))
+ if ($ext_name === '/')
{
- $cache->destroy('versioncheck');
- if ($warn_fail)
- {
- trigger_error($errstr, E_USER_WARNING);
- }
- return false;
+ $user->add_lang($lang_file);
+ }
+ else
+ {
+ $user->add_lang_ext($ext_name, $lang_file);
}
-
- $cache->put('versioncheck', $info, $ttl);
}
-
- return $info;
}
/**
@@ -3370,5 +3454,3 @@ function enable_bitfield_column_flag($table_name, $column_name, $flag, $sql_more
' . $sql_more;
$db->sql_query($sql);
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/functions_compatibility.php b/phpBB/includes/functions_compatibility.php
new file mode 100644
index 0000000000..b59c7376e9
--- /dev/null
+++ b/phpBB/includes/functions_compatibility.php
@@ -0,0 +1,198 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+/**
+* @ignore
+*/
+if (!defined('IN_PHPBB'))
+{
+ exit;
+}
+
+/**
+* Get user avatar
+*
+* @deprecated 3.1.0-a1 (To be removed: 3.3.0)
+*
+* @param string $avatar Users assigned avatar name
+* @param int $avatar_type Type of avatar
+* @param string $avatar_width Width of users avatar
+* @param string $avatar_height Height of users avatar
+* @param string $alt Optional language string for alt tag within image, can be a language key or text
+* @param bool $ignore_config Ignores the config-setting, to be still able to view the avatar in the UCP
+* @param bool $lazy If true, will be lazy loaded (requires JS)
+*
+* @return string Avatar image
+*/
+function get_user_avatar($avatar, $avatar_type, $avatar_width, $avatar_height, $alt = 'USER_AVATAR', $ignore_config = false, $lazy = false)
+{
+ // map arguments to new function phpbb_get_avatar()
+ $row = array(
+ 'avatar' => $avatar,
+ 'avatar_type' => $avatar_type,
+ 'avatar_width' => $avatar_width,
+ 'avatar_height' => $avatar_height,
+ );
+
+ return phpbb_get_avatar($row, $alt, $ignore_config, $lazy);
+}
+
+/**
+* Hash the password
+*
+* @deprecated 3.1.0-a2 (To be removed: 3.3.0)
+*
+* @param string $password Password to be hashed
+*
+* @return string|bool Password hash or false if something went wrong during hashing
+*/
+function phpbb_hash($password)
+{
+ global $phpbb_container;
+
+ $passwords_manager = $phpbb_container->get('passwords.manager');
+ return $passwords_manager->hash($password);
+}
+
+/**
+* Check for correct password
+*
+* @deprecated 3.1.0-a2 (To be removed: 3.3.0)
+*
+* @param string $password The password in plain text
+* @param string $hash The stored password hash
+*
+* @return bool Returns true if the password is correct, false if not.
+*/
+function phpbb_check_hash($password, $hash)
+{
+ global $phpbb_container;
+
+ $passwords_manager = $phpbb_container->get('passwords.manager');
+ return $passwords_manager->check($password, $hash);
+}
+
+/**
+* Eliminates useless . and .. components from specified path.
+*
+* Deprecated, use filesystem class instead
+*
+* @param string $path Path to clean
+* @return string Cleaned path
+*
+* @deprecated
+*/
+function phpbb_clean_path($path)
+{
+ global $phpbb_path_helper, $phpbb_container;
+
+ if (!$phpbb_path_helper && $phpbb_container)
+ {
+ $phpbb_path_helper = $phpbb_container->get('path_helper');
+ }
+ else if (!$phpbb_path_helper)
+ {
+ global $phpbb_root_path, $phpEx;
+
+ // The container is not yet loaded, use a new instance
+ if (!class_exists('\phpbb\path_helper'))
+ {
+ require($phpbb_root_path . 'phpbb/path_helper.' . $phpEx);
+ }
+
+ $request = new phpbb\request\request();
+ $phpbb_path_helper = new phpbb\path_helper(
+ new phpbb\symfony_request(
+ $request
+ ),
+ new phpbb\filesystem(),
+ $request,
+ $phpbb_root_path,
+ $phpEx
+ );
+ }
+
+ return $phpbb_path_helper->clean_path($path);
+}
+
+/**
+* Pick a timezone
+*
+* @param string $default A timezone to select
+* @param boolean $truncate Shall we truncate the options text
+*
+* @return string Returns the options for timezone selector only
+*
+* @deprecated
+*/
+function tz_select($default = '', $truncate = false)
+{
+ global $template, $user;
+
+ return phpbb_timezone_select($template, $user, $default, $truncate);
+}
+
+/**
+* Cache moderators. Called whenever permissions are changed
+* via admin_permissions. Changes of usernames and group names
+* must be carried through for the moderators table.
+*
+* @deprecated 3.1
+* @return null
+*/
+function cache_moderators()
+{
+ global $db, $cache, $auth;
+ return phpbb_cache_moderators($db, $cache, $auth);
+}
+
+/**
+* Removes moderators and administrators from foe lists.
+*
+* @deprecated 3.1
+* @param array|bool $group_id If an array, remove all members of this group from foe lists, or false to ignore
+* @param array|bool $user_id If an array, remove this user from foe lists, or false to ignore
+* @return null
+*/
+function update_foes($group_id = false, $user_id = false)
+{
+ global $db, $auth;
+ return phpbb_update_foes($db, $auth, $group_id, $user_id);
+}
+
+/**
+* Get user rank title and image
+*
+* @param int $user_rank the current stored users rank id
+* @param int $user_posts the users number of posts
+* @param string &$rank_title the rank title will be stored here after execution
+* @param string &$rank_img the rank image as full img tag is stored here after execution
+* @param string &$rank_img_src the rank image source is stored here after execution
+*
+* @deprecated 3.1.0-RC5 (To be removed: 3.3.0)
+*
+* Note: since we do not want to break backwards-compatibility, this function will only properly assign ranks to guests if you call it for them with user_posts == false
+*/
+function get_user_rank($user_rank, $user_posts, &$rank_title, &$rank_img, &$rank_img_src)
+{
+ global $phpbb_root_path, $phpEx;
+ if (!function_exists('phpbb_get_user_rank'))
+ {
+ include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
+ }
+
+ $rank_data = phpbb_get_user_rank(array('user_rank' => $user_rank), $user_posts);
+ $rank_title = $rank_data['title'];
+ $rank_img = $rank_data['img'];
+ $rank_img_src = $rank_data['img_src'];
+}
diff --git a/phpBB/includes/functions_compress.php b/phpBB/includes/functions_compress.php
index 455debd939..a7ee29dd91 100644
--- a/phpBB/includes/functions_compress.php
+++ b/phpBB/includes/functions_compress.php
@@ -1,10 +1,13 @@
<?php
/**
*
-* @package phpBB3
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -18,13 +21,17 @@ if (!defined('IN_PHPBB'))
/**
* Class for handling archives (compression/decompression)
-* @package phpBB3
*/
class compress
{
var $fp = 0;
/**
+ * @var array
+ */
+ protected $filelist = array();
+
+ /**
* Add file to archive
*/
function add_file($src, $src_rm_prefix = '', $src_add_prefix = '', $skip_files = '')
@@ -42,7 +49,7 @@ class compress
if (is_file($phpbb_root_path . $src))
{
- $this->data($src_path, file_get_contents("$phpbb_root_path$src"), false, stat("$phpbb_root_path$src"));
+ $this->data($src_path, file_get_contents("$phpbb_root_path$src"), stat("$phpbb_root_path$src"), false);
}
else if (is_dir($phpbb_root_path . $src))
{
@@ -82,7 +89,7 @@ class compress
continue;
}
- $this->data("$src_path$path$file", file_get_contents("$phpbb_root_path$src$path$file"), false, stat("$phpbb_root_path$src$path$file"));
+ $this->data("$src_path$path$file", file_get_contents("$phpbb_root_path$src$path$file"), stat("$phpbb_root_path$src$path$file"), false);
}
}
}
@@ -105,7 +112,7 @@ class compress
return false;
}
- $this->data($filename, file_get_contents($src), false, stat($src));
+ $this->data($filename, file_get_contents($src), stat($src), false);
return true;
}
@@ -119,14 +126,46 @@ class compress
$stat[4] = $stat[5] = 0;
$stat[7] = strlen($src);
$stat[9] = time();
- $this->data($name, $src, false, $stat);
+ $this->data($name, $src, $stat, false);
return true;
}
/**
+ * Checks if a file by that name as already been added and, if it has,
+ * returns a new, unique name.
+ *
+ * @param string $name The filename
+ * @return string A unique filename
+ */
+ protected function unique_filename($name)
+ {
+ if (isset($this->filelist[$name]))
+ {
+ $start = $name;
+ $ext = '';
+ $this->filelist[$name]++;
+
+ // Separate the extension off the end of the filename to preserve it
+ $pos = strrpos($name, '.');
+ if ($pos !== false)
+ {
+ $start = substr($name, 0, $pos);
+ $ext = substr($name, $pos);
+ }
+
+ return $start . '_' . $this->filelist[$name] . $ext;
+ }
+
+ $this->filelist[$name] = 0;
+ return $name;
+ }
+
+ /**
* Return available methods
+ *
+ * @return array Array of strings of available compression methods (.tar, .tar.gz, .zip, etc.)
*/
- function methods()
+ static public function methods()
{
$methods = array('.tar');
$available_methods = array('.tar.gz' => 'zlib', '.tar.bz2' => 'bz2', '.zip' => 'zlib');
@@ -150,12 +189,10 @@ class compress
*
* Zip extraction function by Alexandre Tedeschi, alexandrebr at gmail dot com
*
-* Modified extensively by psoTFX and DavidMJ, (c) phpBB Group, 2003
+* Modified extensively by psoTFX and DavidMJ, (c) phpBB Limited, 2003
*
* Based on work by Eric Mueller and Denis125
* Official ZIP file format: http://www.pkware.com/appnote.txt
-*
-* @package phpBB3
*/
class compress_zip extends compress
{
@@ -359,9 +396,10 @@ class compress_zip extends compress
/**
* Create the structures ... note we assume version made by is MSDOS
*/
- function data($name, $data, $is_dir = false, $stat)
+ function data($name, $data, $stat, $is_dir = false)
{
$name = str_replace('\\', '/', $name);
+ $name = $this->unique_filename($name);
$hexdtime = pack('V', $this->unix_to_dos_time($stat[9]));
@@ -471,7 +509,7 @@ class compress_zip extends compress
$mimetype = 'application/zip';
- header('Pragma: no-cache');
+ header('Cache-Control: private, no-cache');
header("Content-Type: $mimetype; name=\"$download_name.zip\"");
header("Content-disposition: attachment; filename=$download_name.zip");
@@ -490,8 +528,6 @@ class compress_zip extends compress
/**
* Tar/tar.gz compression routine
* Header/checksum creation derived from tarfile.pl, (c) Tom Horsley, 1994
-*
-* @package phpBB3
*/
class compress_tar extends compress
{
@@ -632,8 +668,9 @@ class compress_tar extends compress
/**
* Create the structures
*/
- function data($name, $data, $is_dir = false, $stat)
+ function data($name, $data, $stat, $is_dir = false)
{
+ $name = $this->unique_filename($name);
$this->wrote = true;
$fzwrite = ($this->isbz && function_exists('bzwrite')) ? 'bzwrite' : (($this->isgz && @extension_loaded('zlib')) ? 'gzwrite' : 'fwrite');
@@ -720,7 +757,7 @@ class compress_tar extends compress
break;
}
- header('Pragma: no-cache');
+ header('Cache-Control: private, no-cache');
header("Content-Type: $mimetype; name=\"$download_name$this->type\"");
header("Content-disposition: attachment; filename=$download_name$this->type");
@@ -735,5 +772,3 @@ class compress_tar extends compress
}
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/functions_content.php b/phpBB/includes/functions_content.php
index 19459239d5..f671f33ed0 100644
--- a/phpBB/includes/functions_content.php
+++ b/phpBB/includes/functions_content.php
@@ -1,10 +1,13 @@
<?php
/**
*
-* @package phpBB3
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -44,7 +47,7 @@ if (!defined('IN_PHPBB'))
*/
function gen_sort_selects(&$limit_days, &$sort_by_text, &$sort_days, &$sort_key, &$sort_dir, &$s_limit_days, &$s_sort_key, &$s_sort_dir, &$u_sort_param, $def_st = false, $def_sk = false, $def_sd = false)
{
- global $user;
+ global $user, $phpbb_dispatcher;
$sort_dir_text = array('a' => $user->lang['ASCENDING'], 'd' => $user->lang['DESCENDING']);
@@ -75,7 +78,7 @@ function gen_sort_selects(&$limit_days, &$sort_by_text, &$sort_days, &$sort_key,
foreach ($sorts as $name => $sort_ary)
{
$key = $sort_ary['key'];
- $selected = $$sort_ary['key'];
+ $selected = ${$sort_ary['key']};
// Check if the key is selectable. If not, we reset to the default or first key found.
// This ensures the values are always valid. We also set $sort_dir/sort_key/etc. to the
@@ -84,12 +87,12 @@ function gen_sort_selects(&$limit_days, &$sort_by_text, &$sort_days, &$sort_key,
{
if ($sort_ary['default'] !== false)
{
- $selected = $$key = $sort_ary['default'];
+ $selected = ${$key} = $sort_ary['default'];
}
else
{
@reset($sort_ary['options']);
- $selected = $$key = key($sort_ary['options']);
+ $selected = ${$key} = key($sort_ary['options']);
}
}
@@ -103,6 +106,42 @@ function gen_sort_selects(&$limit_days, &$sort_by_text, &$sort_days, &$sort_key,
$u_sort_param .= ($selected !== $sort_ary['default']) ? ((strlen($u_sort_param)) ? '&amp;' : '') . "{$name}={$selected}" : '';
}
+ /**
+ * Run code before generated sort selects are returned
+ *
+ * @event core.gen_sort_selects_after
+ * @var int limit_days Days limit
+ * @var array sort_by_text Sort by text options
+ * @var int sort_days Sort by days flag
+ * @var string sort_key Sort key
+ * @var string sort_dir Sort dir
+ * @var string s_limit_days String of days limit
+ * @var string s_sort_key String of sort key
+ * @var string s_sort_dir String of sort dir
+ * @var string u_sort_param Sort URL params
+ * @var bool def_st Default sort days
+ * @var bool def_sk Default sort key
+ * @var bool def_sd Default sort dir
+ * @var array sorts Sorts
+ * @since 3.1.9-RC1
+ */
+ $vars = array(
+ 'limit_days',
+ 'sort_by_text',
+ 'sort_days',
+ 'sort_key',
+ 'sort_dir',
+ 's_limit_days',
+ 's_sort_key',
+ 's_sort_dir',
+ 'u_sort_param',
+ 'def_st',
+ 'def_sk',
+ 'def_sd',
+ 'sorts',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.gen_sort_selects_after', compact($vars)));
+
return;
}
@@ -111,7 +150,7 @@ function gen_sort_selects(&$limit_days, &$sort_by_text, &$sort_days, &$sort_key,
*/
function make_jumpbox($action, $forum_id = false, $select_all = false, $acl_list = false, $force_display = false)
{
- global $config, $auth, $template, $user, $db;
+ global $config, $auth, $template, $user, $db, $phpbb_path_helper, $phpbb_dispatcher;
// We only return if the jumpbox is not forced to be displayed (in case it is needed for functionality)
if (!$config['load_jumpbox'] && $force_display === false)
@@ -124,16 +163,33 @@ function make_jumpbox($action, $forum_id = false, $select_all = false, $acl_list
ORDER BY left_id ASC';
$result = $db->sql_query($sql, 600);
+ $rowset = array();
+ while ($row = $db->sql_fetchrow($result))
+ {
+ $rowset[(int) $row['forum_id']] = $row;
+ }
+ $db->sql_freeresult($result);
+
$right = $padding = 0;
$padding_store = array('0' => 0);
$display_jumpbox = false;
$iteration = 0;
+ /**
+ * Modify the jumpbox forum list data
+ *
+ * @event core.make_jumpbox_modify_forum_list
+ * @var array rowset Array with the forums list data
+ * @since 3.1.10-RC1
+ */
+ $vars = array('rowset');
+ extract($phpbb_dispatcher->trigger_event('core.make_jumpbox_modify_forum_list', compact($vars)));
+
// Sometimes it could happen that forums will be displayed here not be displayed within the index page
// This is the result of forums not displayed at index, having list permissions and a parent of a forum with no permissions.
// If this happens, the padding could be "broken"
- while ($row = $db->sql_fetchrow($result))
+ foreach ($rowset as $row)
{
if ($row['left_id'] < $right)
{
@@ -166,27 +222,48 @@ function make_jumpbox($action, $forum_id = false, $select_all = false, $acl_list
continue;
}
+ $tpl_ary = array();
if (!$display_jumpbox)
{
- $template->assign_block_vars('jumpbox_forums', array(
+ $tpl_ary[] = array(
'FORUM_ID' => ($select_all) ? 0 : -1,
'FORUM_NAME' => ($select_all) ? $user->lang['ALL_FORUMS'] : $user->lang['SELECT_FORUM'],
- 'S_FORUM_COUNT' => $iteration)
+ 'S_FORUM_COUNT' => $iteration,
+ 'LINK' => $phpbb_path_helper->append_url_params($action, array('f' => $forum_id)),
);
$iteration++;
$display_jumpbox = true;
}
- $template->assign_block_vars('jumpbox_forums', array(
+ $tpl_ary[] = array(
'FORUM_ID' => $row['forum_id'],
'FORUM_NAME' => $row['forum_name'],
'SELECTED' => ($row['forum_id'] == $forum_id) ? ' selected="selected"' : '',
'S_FORUM_COUNT' => $iteration,
'S_IS_CAT' => ($row['forum_type'] == FORUM_CAT) ? true : false,
'S_IS_LINK' => ($row['forum_type'] == FORUM_LINK) ? true : false,
- 'S_IS_POST' => ($row['forum_type'] == FORUM_POST) ? true : false)
+ 'S_IS_POST' => ($row['forum_type'] == FORUM_POST) ? true : false,
+ 'LINK' => $phpbb_path_helper->append_url_params($action, array('f' => $row['forum_id'])),
+ );
+
+ /**
+ * Modify the jumpbox before it is assigned to the template
+ *
+ * @event core.make_jumpbox_modify_tpl_ary
+ * @var array row The data of the forum
+ * @var array tpl_ary Template data of the forum
+ * @since 3.1.10-RC1
+ */
+ $vars = array(
+ 'row',
+ 'tpl_ary',
);
+ extract($phpbb_dispatcher->trigger_event('core.make_jumpbox_modify_tpl_ary', compact($vars)));
+
+ $template->assign_block_vars_array('jumpbox_forums', $tpl_ary);
+
+ unset($tpl_ary);
for ($i = 0; $i < $padding; $i++)
{
@@ -194,13 +271,15 @@ function make_jumpbox($action, $forum_id = false, $select_all = false, $acl_list
}
$iteration++;
}
- $db->sql_freeresult($result);
- unset($padding_store);
+ unset($padding_store, $rowset);
+
+ $url_parts = $phpbb_path_helper->get_url_parts($action);
$template->assign_vars(array(
- 'S_DISPLAY_JUMPBOX' => $display_jumpbox,
- 'S_JUMPBOX_ACTION' => $action)
- );
+ 'S_DISPLAY_JUMPBOX' => $display_jumpbox,
+ 'S_JUMPBOX_ACTION' => $action,
+ 'HIDDEN_FIELDS_FOR_JUMPBOX' => build_hidden_fields($url_parts['params']),
+ ));
return;
}
@@ -384,7 +463,7 @@ function phpbb_clean_search_string($search_string)
*/
function decode_message(&$message, $bbcode_uid = '')
{
- global $config;
+ global $config, $phpbb_dispatcher;
if ($bbcode_uid)
{
@@ -397,12 +476,38 @@ function decode_message(&$message, $bbcode_uid = '')
$replace = array("\n");
}
+ /**
+ * Use this event to modify the message before it is decoded
+ *
+ * @event core.decode_message_before
+ * @var string message_text The message content
+ * @var string bbcode_uid The message BBCode UID
+ * @since 3.1.9-RC1
+ */
+ $message_text = $message;
+ $vars = array('message_text', 'bbcode_uid');
+ extract($phpbb_dispatcher->trigger_event('core.decode_message_before', compact($vars)));
+ $message = $message_text;
+
$message = str_replace($match, $replace, $message);
$match = get_preg_expression('bbcode_htm');
$replace = array('\1', '\1', '\2', '\1', '', '');
$message = preg_replace($match, $replace, $message);
+
+ /**
+ * Use this event to modify the message after it is decoded
+ *
+ * @event core.decode_message_after
+ * @var string message_text The message content
+ * @var string bbcode_uid The message BBCode UID
+ * @since 3.1.9-RC1
+ */
+ $message_text = $message;
+ $vars = array('message_text', 'bbcode_uid');
+ extract($phpbb_dispatcher->trigger_event('core.decode_message_after', compact($vars)));
+ $message = $message_text;
}
/**
@@ -427,16 +532,34 @@ function strip_bbcode(&$text, $uid = '')
* For display of custom parsed text on user-facing pages
* Expects $text to be the value directly from the database (stored value)
*/
-function generate_text_for_display($text, $uid, $bitfield, $flags)
+function generate_text_for_display($text, $uid, $bitfield, $flags, $censor_text = true)
{
static $bbcode;
+ global $phpbb_dispatcher;
if ($text === '')
{
return '';
}
- $text = censor_text($text);
+ /**
+ * Use this event to modify the text before it is parsed
+ *
+ * @event core.modify_text_for_display_before
+ * @var string text The text to parse
+ * @var string uid The BBCode UID
+ * @var string bitfield The BBCode Bitfield
+ * @var int flags The BBCode Flags
+ * @var bool censor_text Whether or not to apply word censors
+ * @since 3.1.0-a1
+ */
+ $vars = array('text', 'uid', 'bitfield', 'flags', 'censor_text');
+ extract($phpbb_dispatcher->trigger_event('core.modify_text_for_display_before', compact($vars)));
+
+ if ($censor_text)
+ {
+ $text = censor_text($text);
+ }
// Parse bbcode if bbcode uid stored and bbcode enabled
if ($uid && ($flags & OPTION_FLAG_BBCODE))
@@ -462,6 +585,19 @@ function generate_text_for_display($text, $uid, $bitfield, $flags)
$text = bbcode_nl2br($text);
$text = smiley_text($text, !($flags & OPTION_FLAG_SMILIES));
+ /**
+ * Use this event to modify the text after it is parsed
+ *
+ * @event core.modify_text_for_display_after
+ * @var string text The text to parse
+ * @var string uid The BBCode UID
+ * @var string bitfield The BBCode Bitfield
+ * @var int flags The BBCode Flags
+ * @since 3.1.0-a1
+ */
+ $vars = array('text', 'uid', 'bitfield', 'flags');
+ extract($phpbb_dispatcher->trigger_event('core.modify_text_for_display_after', compact($vars)));
+
return $text;
}
@@ -469,10 +605,44 @@ function generate_text_for_display($text, $uid, $bitfield, $flags)
* For parsing custom parsed text to be stored within the database.
* This function additionally returns the uid and bitfield that needs to be stored.
* Expects $text to be the value directly from request_var() and in it's non-parsed form
+*
+* @param string $text The text to be replaced with the parsed one
+* @param string $uid The BBCode uid for this parse
+* @param string $bitfield The BBCode bitfield for this parse
+* @param int $flags The allow_bbcode, allow_urls and allow_smilies compiled into a single integer.
+* @param bool $allow_bbcode If BBCode is allowed (i.e. if BBCode is parsed)
+* @param bool $allow_urls If urls is allowed
+* @param bool $allow_smilies If smilies are allowed
+*
+* @return array An array of string with the errors that occurred while parsing
*/
function generate_text_for_storage(&$text, &$uid, &$bitfield, &$flags, $allow_bbcode = false, $allow_urls = false, $allow_smilies = false)
{
- global $phpbb_root_path, $phpEx;
+ global $phpbb_root_path, $phpEx, $phpbb_dispatcher;
+
+ /**
+ * Use this event to modify the text before it is prepared for storage
+ *
+ * @event core.modify_text_for_storage_before
+ * @var string text The text to parse
+ * @var string uid The BBCode UID
+ * @var string bitfield The BBCode Bitfield
+ * @var int flags The BBCode Flags
+ * @var bool allow_bbcode Whether or not to parse BBCode
+ * @var bool allow_urls Whether or not to parse URLs
+ * @var bool allow_smilies Whether or not to parse Smilies
+ * @since 3.1.0-a1
+ */
+ $vars = array(
+ 'text',
+ 'uid',
+ 'bitfield',
+ 'flags',
+ 'allow_bbcode',
+ 'allow_urls',
+ 'allow_smilies',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.modify_text_for_storage_before', compact($vars)));
$uid = $bitfield = '';
$flags = (($allow_bbcode) ? OPTION_FLAG_BBCODE : 0) + (($allow_smilies) ? OPTION_FLAG_SMILIES : 0) + (($allow_urls) ? OPTION_FLAG_LINKS : 0);
@@ -501,7 +671,22 @@ function generate_text_for_storage(&$text, &$uid, &$bitfield, &$flags, $allow_bb
$bitfield = $message_parser->bbcode_bitfield;
- return;
+ /**
+ * Use this event to modify the text after it is prepared for storage
+ *
+ * @event core.modify_text_for_storage_after
+ * @var string text The text to parse
+ * @var string uid The BBCode UID
+ * @var string bitfield The BBCode Bitfield
+ * @var int flags The BBCode Flags
+ * @var string message_parser The message_parser object
+ * @since 3.1.0-a1
+ * @changed 3.1.11-RC1 Added message_parser to vars
+ */
+ $vars = array('text', 'uid', 'bitfield', 'flags', 'message_parser');
+ extract($phpbb_dispatcher->trigger_event('core.modify_text_for_storage_after', compact($vars)));
+
+ return $message_parser->warn_msg;
}
/**
@@ -510,10 +695,33 @@ function generate_text_for_storage(&$text, &$uid, &$bitfield, &$flags, $allow_bb
*/
function generate_text_for_edit($text, $uid, $flags)
{
- global $phpbb_root_path, $phpEx;
+ global $phpbb_root_path, $phpEx, $phpbb_dispatcher;
+
+ /**
+ * Use this event to modify the text before it is decoded for editing
+ *
+ * @event core.modify_text_for_edit_before
+ * @var string text The text to parse
+ * @var string uid The BBCode UID
+ * @var int flags The BBCode Flags
+ * @since 3.1.0-a1
+ */
+ $vars = array('text', 'uid', 'flags');
+ extract($phpbb_dispatcher->trigger_event('core.modify_text_for_edit_before', compact($vars)));
decode_message($text, $uid);
+ /**
+ * Use this event to modify the text after it is decoded for editing
+ *
+ * @event core.modify_text_for_edit_after
+ * @var string text The text to parse
+ * @var int flags The BBCode Flags
+ * @since 3.1.0-a1
+ */
+ $vars = array('text', 'flags');
+ extract($phpbb_dispatcher->trigger_event('core.modify_text_for_edit_after', compact($vars)));
+
return array(
'allow_bbcode' => ($flags & OPTION_FLAG_BBCODE) ? 1 : 0,
'allow_smilies' => ($flags & OPTION_FLAG_SMILIES) ? 1 : 0,
@@ -603,7 +811,7 @@ function make_clickable_callback($type, $whitespace, $url, $relative_url, $class
break;
}
- $short_url = (strlen($url) > 55) ? substr($url, 0, 39) . ' ... ' . substr($url, -10) : $url;
+ $short_url = (utf8_strlen($url) > 55) ? utf8_substr($url, 0, 39) . ' ... ' . utf8_substr($url, -10) : $url;
switch ($type)
{
@@ -663,37 +871,62 @@ function make_clickable($text, $server_url = false, $class = 'postlink')
$server_url = generate_board_url();
}
- static $magic_url_match;
- static $magic_url_replace;
static $static_class;
+ static $magic_url_match_args;
- if (!is_array($magic_url_match) || $static_class != $class)
+ if (!isset($magic_url_match_args[$server_url]) || $static_class != $class)
{
$static_class = $class;
$class = ($static_class) ? ' class="' . $static_class . '"' : '';
$local_class = ($static_class) ? ' class="' . $static_class . '-local"' : '';
- $magic_url_match = $magic_url_replace = array();
- // Be sure to not let the matches cross over. ;)
+ if (!is_array($magic_url_match_args))
+ {
+ $magic_url_match_args = array();
+ }
// relative urls for this board
- $magic_url_match[] = '#(^|[\n\t (>.])(' . preg_quote($server_url, '#') . ')/(' . get_preg_expression('relative_url_inline') . ')#ie';
- $magic_url_replace[] = "make_clickable_callback(MAGIC_URL_LOCAL, '\$1', '\$2', '\$3', '$local_class')";
+ $magic_url_match_args[$server_url][] = array(
+ '#(^|[\n\t (>.])(' . preg_quote($server_url, '#') . ')/(' . get_preg_expression('relative_url_inline') . ')#iu',
+ MAGIC_URL_LOCAL,
+ $local_class,
+ );
// matches a xxxx://aaaaa.bbb.cccc. ...
- $magic_url_match[] = '#(^|[\n\t (>.])(' . get_preg_expression('url_inline') . ')#ie';
- $magic_url_replace[] = "make_clickable_callback(MAGIC_URL_FULL, '\$1', '\$2', '', '$class')";
+ $magic_url_match_args[$server_url][] = array(
+ '#(^|[\n\t (>.])(' . get_preg_expression('url_inline') . ')#iu',
+ MAGIC_URL_FULL,
+ $class,
+ );
// matches a "www.xxxx.yyyy[/zzzz]" kinda lazy URL thing
- $magic_url_match[] = '#(^|[\n\t (>])(' . get_preg_expression('www_url_inline') . ')#ie';
- $magic_url_replace[] = "make_clickable_callback(MAGIC_URL_WWW, '\$1', '\$2', '', '$class')";
+ $magic_url_match_args[$server_url][] = array(
+ '#(^|[\n\t (>])(' . get_preg_expression('www_url_inline') . ')#iu',
+ MAGIC_URL_WWW,
+ $class,
+ );
// matches an email@domain type address at the start of a line, or after a space or after what might be a BBCode.
- $magic_url_match[] = '/(^|[\n\t (>])(' . get_preg_expression('email') . ')/ie';
- $magic_url_replace[] = "make_clickable_callback(MAGIC_URL_EMAIL, '\$1', '\$2', '', '')";
+ $magic_url_match_args[$server_url][] = array(
+ '/(^|[\n\t (>])(' . get_preg_expression('email') . ')/iu',
+ MAGIC_URL_EMAIL,
+ '',
+ );
+ }
+
+ foreach ($magic_url_match_args[$server_url] as $magic_args)
+ {
+ if (preg_match($magic_args[0], $text, $matches))
+ {
+ $text = preg_replace_callback($magic_args[0], function($matches) use ($magic_args)
+ {
+ $relative_url = isset($matches[3]) ? $matches[3] : '';
+ return make_clickable_callback($magic_args[1], $matches[1], $matches[2], $relative_url, $magic_args[2]);
+ }, $text);
+ }
}
- return preg_replace($magic_url_match, $magic_url_replace, $text);
+ return $text;
}
/**
@@ -749,7 +982,7 @@ function bbcode_nl2br($text)
*/
function smiley_text($text, $force_option = false)
{
- global $config, $user, $phpbb_root_path;
+ global $config, $user, $phpbb_path_helper, $phpbb_dispatcher;
if ($force_option || !$config['allow_smilies'] || !$user->optionget('viewsmilies'))
{
@@ -757,8 +990,18 @@ function smiley_text($text, $force_option = false)
}
else
{
- $root_path = (defined('PHPBB_USE_BOARD_URL_PATH') && PHPBB_USE_BOARD_URL_PATH) ? generate_board_url() . '/' : $phpbb_root_path;
- return preg_replace('#<!\-\- s(.*?) \-\-><img src="\{SMILIES_PATH\}\/(.*?) \/><!\-\- s\1 \-\->#', '<img src="' . $root_path . $config['smilies_path'] . '/\2 />', $text);
+ $root_path = (defined('PHPBB_USE_BOARD_URL_PATH') && PHPBB_USE_BOARD_URL_PATH) ? generate_board_url() . '/' : $phpbb_path_helper->get_web_root_path();
+
+ /**
+ * Event to override the root_path for smilies
+ *
+ * @event core.smiley_text_root_path
+ * @var string root_path root_path for smilies
+ * @since 3.1.11-RC1
+ */
+ $vars = array('root_path');
+ extract($phpbb_dispatcher->trigger_event('core.smiley_text_root_path', compact($vars)));
+ return preg_replace('#<!\-\- s(.*?) \-\-><img src="\{SMILIES_PATH\}\/(.*?) \/><!\-\- s\1 \-\->#', '<img class="smilies" src="' . $root_path . $config['smilies_path'] . '/\2 />', $text);
}
}
@@ -778,7 +1021,7 @@ function parse_attachments($forum_id, &$message, &$attachments, &$update_count,
return;
}
- global $template, $cache, $user;
+ global $template, $cache, $user, $phpbb_dispatcher;
global $extensions, $config, $phpbb_root_path, $phpEx;
//
@@ -840,17 +1083,8 @@ function parse_attachments($forum_id, &$message, &$attachments, &$update_count,
unset($new_attachment_data);
}
- // Sort correctly
- if ($config['display_order'])
- {
- // Ascending sort
- krsort($attachments);
- }
- else
- {
- // Descending sort
- ksort($attachments);
- }
+ // Make sure attachments are properly ordered
+ ksort($attachments);
foreach ($attachments as $attachment)
{
@@ -956,12 +1190,12 @@ function parse_attachments($forum_id, &$message, &$attachments, &$update_count,
}
$download_link = append_sid("{$phpbb_root_path}download/file.$phpEx", 'id=' . $attachment['attach_id']);
+ $l_downloaded_viewed = 'VIEWED_COUNTS';
switch ($display_cat)
{
// Images
case ATTACHMENT_CATEGORY_IMAGE:
- $l_downloaded_viewed = 'VIEWED_COUNT';
$inline_link = append_sid("{$phpbb_root_path}download/file.$phpEx", 'id=' . $attachment['attach_id']);
$download_link .= '&amp;mode=view';
@@ -975,7 +1209,6 @@ function parse_attachments($forum_id, &$message, &$attachments, &$update_count,
// Images, but display Thumbnail
case ATTACHMENT_CATEGORY_THUMB:
- $l_downloaded_viewed = 'VIEWED_COUNT';
$thumbnail_link = append_sid("{$phpbb_root_path}download/file.$phpEx", 'id=' . $attachment['attach_id'] . '&amp;t=1');
$download_link .= '&amp;mode=view';
@@ -989,7 +1222,6 @@ function parse_attachments($forum_id, &$message, &$attachments, &$update_count,
// Windows Media Streams
case ATTACHMENT_CATEGORY_WM:
- $l_downloaded_viewed = 'VIEWED_COUNT';
// Giving the filename directly because within the wm object all variables are in local context making it impossible
// to validate against a valid session (all params can differ)
@@ -1008,7 +1240,6 @@ function parse_attachments($forum_id, &$message, &$attachments, &$update_count,
// Real Media Streams
case ATTACHMENT_CATEGORY_RM:
case ATTACHMENT_CATEGORY_QUICKTIME:
- $l_downloaded_viewed = 'VIEWED_COUNT';
$block_array += array(
'S_RM_FILE' => ($display_cat == ATTACHMENT_CATEGORY_RM) ? true : false,
@@ -1025,8 +1256,6 @@ function parse_attachments($forum_id, &$message, &$attachments, &$update_count,
case ATTACHMENT_CATEGORY_FLASH:
list($width, $height) = @getimagesize($filename);
- $l_downloaded_viewed = 'VIEWED_COUNT';
-
$block_array += array(
'S_FLASH_FILE' => true,
'WIDTH' => $width,
@@ -1039,7 +1268,7 @@ function parse_attachments($forum_id, &$message, &$attachments, &$update_count,
break;
default:
- $l_downloaded_viewed = 'DOWNLOAD_COUNT';
+ $l_downloaded_viewed = 'DOWNLOAD_COUNTS';
$block_array += array(
'S_FILE' => true,
@@ -1047,14 +1276,45 @@ function parse_attachments($forum_id, &$message, &$attachments, &$update_count,
break;
}
- $l_download_count = (!isset($attachment['download_count']) || $attachment['download_count'] == 0) ? $user->lang[$l_downloaded_viewed . '_NONE'] : (($attachment['download_count'] == 1) ? sprintf($user->lang[$l_downloaded_viewed], $attachment['download_count']) : sprintf($user->lang[$l_downloaded_viewed . 'S'], $attachment['download_count']));
+ if (!isset($attachment['download_count']))
+ {
+ $attachment['download_count'] = 0;
+ }
$block_array += array(
'U_DOWNLOAD_LINK' => $download_link,
- 'L_DOWNLOAD_COUNT' => $l_download_count
+ 'L_DOWNLOAD_COUNT' => $user->lang($l_downloaded_viewed, (int) $attachment['download_count']),
);
}
+ /**
+ * Use this event to modify the attachment template data.
+ *
+ * This event is triggered once per attachment.
+ *
+ * @event core.parse_attachments_modify_template_data
+ * @var array attachment Array with attachment data
+ * @var array block_array Template data of the attachment
+ * @var int display_cat Attachment category data
+ * @var string download_link Attachment download link
+ * @var array extensions Array with attachment extensions data
+ * @var mixed forum_id The forum id the attachments are displayed in (false if in private message)
+ * @var bool preview Flag indicating if we are in post preview mode
+ * @var array update_count Array with attachment ids to update download count
+ * @since 3.1.0-RC5
+ */
+ $vars = array(
+ 'attachment',
+ 'block_array',
+ 'display_cat',
+ 'download_link',
+ 'extensions',
+ 'forum_id',
+ 'preview',
+ 'update_count',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.parse_attachments_modify_template_data', compact($vars)));
+
$template->assign_block_vars('_file', $block_array);
$compiled_attachments[] = $template->assign_display('attachment_tpl');
@@ -1063,8 +1323,6 @@ function parse_attachments($forum_id, &$message, &$attachments, &$update_count,
$attachments = $compiled_attachments;
unset($compiled_attachments);
- $tpl_size = sizeof($attachments);
-
$unset_tpl = array();
preg_match_all('#<!\-\- ia([0-9]+) \-\->(.*?)<!\-\- ia\1 \-\->#', $message, $matches, PREG_PATTERN_ORDER);
@@ -1072,8 +1330,7 @@ function parse_attachments($forum_id, &$message, &$attachments, &$update_count,
$replace = array();
foreach ($matches[0] as $num => $capture)
{
- // Flip index if we are displaying the reverse way
- $index = ($config['display_order']) ? ($tpl_size-($matches[1][$num] + 1)) : $matches[1][$num];
+ $index = $matches[1][$num];
$replace['from'][] = $matches[0][$num];
$replace['to'][] = (isset($attachments[$index])) ? $attachments[$index] : sprintf($user->lang['MISSING_INLINE_ATTACHMENT'], $matches[2][array_search($index, $matches[1])]);
@@ -1088,6 +1345,18 @@ function parse_attachments($forum_id, &$message, &$attachments, &$update_count,
$unset_tpl = array_unique($unset_tpl);
+ // Sort correctly
+ if ($config['display_order'])
+ {
+ // Ascending sort
+ krsort($attachments);
+ }
+ else
+ {
+ // Descending sort
+ ksort($attachments);
+ }
+
// Needed to let not display the inlined attachments at the end of the post again
foreach ($unset_tpl as $index)
{
@@ -1124,8 +1393,8 @@ function extension_allowed($forum_id, $extension, &$extensions)
* @param string $string The text to truncate to the given length. String is specialchared.
* @param int $max_length Maximum length of string (multibyte character count as 1 char / Html entity count as 1 char)
* @param int $max_store_length Maximum character length of string (multibyte character count as 1 char / Html entity count as entity chars).
-* @param bool $allow_reply Allow Re: in front of string
-* NOTE: This parameter can cause undesired behavior (returning strings longer than $max_store_length) and is deprecated.
+* @param bool $allow_reply Allow Re: in front of string
+* NOTE: This parameter can cause undesired behavior (returning strings longer than $max_store_length) and is deprecated.
* @param string $append String to be appended
*/
function truncate_string($string, $max_length = 60, $max_store_length = 255, $allow_reply = false, $append = '')
@@ -1191,11 +1460,11 @@ function truncate_string($string, $max_length = 60, $max_store_length = 255, $al
* @param string $custom_profile_url optional parameter to specify a profile url. The user id get appended to this url as &amp;u={user_id}
*
* @return string A string consisting of what is wanted based on $mode.
-* @author BartVB, Acyd Burn
*/
function get_username_string($mode, $user_id, $username, $username_colour = '', $guest_username = false, $custom_profile_url = false)
{
static $_profile_cache;
+ global $phpbb_dispatcher;
// We cache some common variables we need within this function
if (empty($_profile_cache))
@@ -1203,9 +1472,9 @@ function get_username_string($mode, $user_id, $username, $username_colour = '',
global $phpbb_root_path, $phpEx;
$_profile_cache['base_url'] = append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&amp;u={USER_ID}');
- $_profile_cache['tpl_noprofile'] = '{USERNAME}';
+ $_profile_cache['tpl_noprofile'] = '<span class="username">{USERNAME}</span>';
$_profile_cache['tpl_noprofile_colour'] = '<span style="color: {USERNAME_COLOUR};" class="username-coloured">{USERNAME}</span>';
- $_profile_cache['tpl_profile'] = '<a href="{PROFILE_URL}">{USERNAME}</a>';
+ $_profile_cache['tpl_profile'] = '<a href="{PROFILE_URL}" class="username">{USERNAME}</a>';
$_profile_cache['tpl_profile_colour'] = '<a href="{PROFILE_URL}" style="color: {USERNAME_COLOUR};" class="username-coloured">{USERNAME}</a>';
}
@@ -1224,7 +1493,8 @@ function get_username_string($mode, $user_id, $username, $username_colour = '',
// Return colour
if ($mode == 'colour')
{
- return $username_colour;
+ $username_string = $username_colour;
+ break;
}
// no break;
@@ -1244,7 +1514,8 @@ function get_username_string($mode, $user_id, $username, $username_colour = '',
// Return username
if ($mode == 'username')
{
- return $username;
+ $username_string = $username;
+ break;
}
// no break;
@@ -1265,23 +1536,108 @@ function get_username_string($mode, $user_id, $username, $username_colour = '',
// Return profile
if ($mode == 'profile')
{
- return $profile_url;
+ $username_string = $profile_url;
+ break;
}
// no break;
}
- if (($mode == 'full' && !$profile_url) || $mode == 'no_profile')
+ if (!isset($username_string))
{
- return str_replace(array('{USERNAME_COLOUR}', '{USERNAME}'), array($username_colour, $username), (!$username_colour) ? $_profile_cache['tpl_noprofile'] : $_profile_cache['tpl_noprofile_colour']);
+ if (($mode == 'full' && !$profile_url) || $mode == 'no_profile')
+ {
+ $username_string = str_replace(array('{USERNAME_COLOUR}', '{USERNAME}'), array($username_colour, $username), (!$username_colour) ? $_profile_cache['tpl_noprofile'] : $_profile_cache['tpl_noprofile_colour']);
+ }
+ else
+ {
+ $username_string = str_replace(array('{PROFILE_URL}', '{USERNAME_COLOUR}', '{USERNAME}'), array($profile_url, $username_colour, $username), (!$username_colour) ? $_profile_cache['tpl_profile'] : $_profile_cache['tpl_profile_colour']);
+ }
}
- return str_replace(array('{PROFILE_URL}', '{USERNAME_COLOUR}', '{USERNAME}'), array($profile_url, $username_colour, $username), (!$username_colour) ? $_profile_cache['tpl_profile'] : $_profile_cache['tpl_profile_colour']);
+ /**
+ * Use this event to change the output of get_username_string()
+ *
+ * @event core.modify_username_string
+ * @var string mode profile|username|colour|full|no_profile
+ * @var int user_id String or array of additional url
+ * parameters
+ * @var string username The user's username
+ * @var string username_colour The user's colour
+ * @var string guest_username Optional parameter to specify the
+ * guest username.
+ * @var string custom_profile_url Optional parameter to specify a
+ * profile url.
+ * @var string username_string The string that has been generated
+ * @var array _profile_cache Array of original return templates
+ * @since 3.1.0-a1
+ */
+ $vars = array(
+ 'mode',
+ 'user_id',
+ 'username',
+ 'username_colour',
+ 'guest_username',
+ 'custom_profile_url',
+ 'username_string',
+ '_profile_cache',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.modify_username_string', compact($vars)));
+
+ return $username_string;
+}
+
+/**
+ * Add an option to the quick-mod tools.
+ *
+ * @param string $url The recepting URL for the quickmod actions.
+ * @param string $option The language key for the value of the option.
+ * @param string $lang_string The language string to use.
+ */
+function phpbb_add_quickmod_option($url, $option, $lang_string)
+{
+ global $template, $user, $phpbb_path_helper;
+
+ $lang_string = $user->lang($lang_string);
+ $template->assign_block_vars('quickmod', array(
+ 'VALUE' => $option,
+ 'TITLE' => $lang_string,
+ 'LINK' => $phpbb_path_helper->append_url_params($url, array('action' => $option)),
+ ));
}
/**
-* @package phpBB3
+* Concatenate an array into a string list.
+*
+* @param array $items Array of items to concatenate
+* @param object $user The phpBB $user object.
+*
+* @return string String list. Examples: "A"; "A and B"; "A, B, and C"
*/
+function phpbb_generate_string_list($items, $user)
+{
+ if (empty($items))
+ {
+ return '';
+ }
+
+ $count = sizeof($items);
+ $last_item = array_pop($items);
+ $lang_key = 'STRING_LIST_MULTI';
+
+ if ($count == 1)
+ {
+ return $last_item;
+ }
+ else if ($count == 2)
+ {
+ $lang_key = 'STRING_LIST_SIMPLE';
+ }
+ $list = implode($user->lang['COMMA_SEPARATOR'], $items);
+
+ return $user->lang($lang_key, $list, $last_item);
+}
+
class bitfield
{
var $data;
@@ -1372,5 +1728,3 @@ class bitfield
$this->data = $this->data | $bitfield->get_blob();
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/functions_convert.php b/phpBB/includes/functions_convert.php
index 3b26f417e9..da4820134d 100644
--- a/phpBB/includes/functions_convert.php
+++ b/phpBB/includes/functions_convert.php
@@ -1,10 +1,13 @@
<?php
/**
*
-* @package install
-* @version $Id$
-* @copyright (c) 2006 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -476,7 +479,7 @@ function import_avatar_gallery($gallery_name = '', $subdirs_as_galleries = false
$dir->close();
}
- for ($i = 0; $i < sizeof($dirlist); ++$i)
+ for ($i = 0, $end = sizeof($dirlist); $i < $end; ++$i)
{
$dir = $dirlist[$i];
@@ -824,7 +827,7 @@ function get_avatar_dim($src, $axis, $func = false, $arg1 = false, $arg2 = false
break;
case AVATAR_REMOTE:
- // see notes on this functions usage and (hopefully) model $func to avoid this accordingly
+ // see notes on this functions usage and (hopefully) model $func to avoid this accordingly
return get_remote_avatar_dim($src, $axis);
break;
@@ -963,7 +966,7 @@ function get_remote_avatar_dim($src, $axis)
$protocol = (isset($url_info['scheme'])) ? $url_info['scheme'] : 'http';
if (empty($port))
{
- switch(strtolower($protocol))
+ switch (strtolower($protocol))
{
case 'ftp':
$port = 21;
@@ -1004,8 +1007,8 @@ function get_remote_avatar_dim($src, $axis)
{
$bigger = ($remote_avatar_cache[$src][0] > $remote_avatar_cache[$src][1]) ? 0 : 1;
$ratio = $default[$bigger] / $remote_avatar_cache[$src][$bigger];
- $remote_avatar_cache[$src][0] = (int)($remote_avatar_cache[$src][0] * $ratio);
- $remote_avatar_cache[$src][1] = (int)($remote_avatar_cache[$src][1] * $ratio);
+ $remote_avatar_cache[$src][0] = (int) ($remote_avatar_cache[$src][0] * $ratio);
+ $remote_avatar_cache[$src][1] = (int) ($remote_avatar_cache[$src][1] * $ratio);
}
}
@@ -1028,7 +1031,6 @@ function set_user_options()
'attachsig' => array('bit' => 6, 'default' => 0),
'bbcode' => array('bit' => 8, 'default' => 1),
'smilies' => array('bit' => 9, 'default' => 1),
- 'popuppm' => array('bit' => 10, 'default' => 0),
'sig_bbcode' => array('bit' => 15, 'default' => 1),
'sig_smilies' => array('bit' => 16, 'default' => 1),
'sig_links' => array('bit' => 17, 'default' => 1),
@@ -1118,7 +1120,7 @@ function words_unique(&$words)
* Adds a user to the specified group and optionally makes them a group leader
* This function does not create the group if it does not exist and so should only be called after the groups have been created
*/
-function add_user_group($group_id, $user_id, $group_leader=false)
+function add_user_group($group_id, $user_id, $group_leader = false)
{
global $convert, $phpbb_root_path, $config, $user, $db;
@@ -1238,7 +1240,7 @@ function get_config()
$filename = $convert->options['forum_path'] . '/' . $convert->config_schema['filename'];
if (!file_exists($filename))
{
- $convert->p_master->error($user->lang['FILE_NOT_FOUND'] . ': ' . $filename, __LINE__, __FILE__);
+ $convert->p_master->error($user->lang('FILE_NOT_FOUND', $filename), __LINE__, __FILE__);
}
if (isset($convert->config_schema['array_name']))
@@ -1285,7 +1287,9 @@ function restore_config($schema)
{
$var = (empty($m[2]) || empty($convert_config[$m[2]])) ? "''" : "'" . addslashes($convert_config[$m[2]]) . "'";
$exec = '$config_value = ' . $m[1] . '(' . $var . ');';
+ // @codingStandardsIgnoreStart
eval($exec);
+ // @codingStandardsIgnoreEnd
}
else
{
@@ -1298,7 +1302,7 @@ function restore_config($schema)
$src_ary = $schema['array_name'];
$config_value = (isset($convert_config[$src_ary][$src])) ? $convert_config[$src_ary][$src] : '';
}
- }
+ }
if ($config_value !== '')
{
@@ -1423,7 +1427,7 @@ function get_path($src_path, $src_url, $test_file)
$path_array = array();
$phpbb_parts = explode('/', $script_path);
- for ($i = 0; $i < sizeof($url_parts); ++$i)
+ for ($i = 0, $end = sizeof($url_parts); $i < $end; ++$i)
{
if ($i < sizeof($phpbb_parts[$i]) && $url_parts[$i] == $phpbb_parts[$i])
{
@@ -1433,7 +1437,7 @@ function get_path($src_path, $src_url, $test_file)
else
{
$path = '';
- for ($j = $i; $j < sizeof($phpbb_parts); ++$j)
+ for ($j = $i, $end2 = sizeof($phpbb_parts); $j < $end2; ++$j)
{
$path .= '../';
}
@@ -1643,7 +1647,7 @@ function mass_auth($ug_type, $forum_id, $ug_id, $acl_list, $setting = ACL_NO)
switch ($sql_type)
{
case 'insert':
- switch ($db->sql_layer)
+ switch ($db->get_sql_layer())
{
case 'mysql':
case 'mysql4':
@@ -1652,6 +1656,7 @@ function mass_auth($ug_type, $forum_id, $ug_id, $acl_list, $setting = ACL_NO)
case 'mssql':
case 'sqlite':
+ case 'sqlite3':
case 'mssqlnative':
$sql = implode(' UNION ALL ', preg_replace('#^(.*?)$#', 'SELECT \1', $sql_subary));
break;
@@ -1720,7 +1725,7 @@ function add_default_groups()
'GUESTS' => array('', 0, 0),
'REGISTERED' => array('', 0, 0),
'REGISTERED_COPPA' => array('', 0, 0),
- 'GLOBAL_MODERATORS' => array('00AA00', 1, 0),
+ 'GLOBAL_MODERATORS' => array('00AA00', 2, 0),
'ADMINISTRATORS' => array('AA0000', 1, 1),
'BOTS' => array('9E8DA7', 0, 0),
'NEWLY_REGISTERED' => array('', 0, 0),
@@ -1749,7 +1754,7 @@ function add_default_groups()
'group_type' => GROUP_SPECIAL,
'group_colour' => (string) $data[0],
'group_legend' => (int) $data[1],
- 'group_founder_manage' => (int) $data[2]
+ 'group_founder_manage' => (int) $data[2],
);
}
@@ -1759,6 +1764,38 @@ function add_default_groups()
}
}
+function add_groups_to_teampage()
+{
+ global $db;
+
+ $teampage_groups = array(
+ 'ADMINISTRATORS' => 1,
+ 'GLOBAL_MODERATORS' => 2,
+ );
+
+ $sql = 'SELECT *
+ FROM ' . GROUPS_TABLE . '
+ WHERE ' . $db->sql_in_set('group_name', array_keys($teampage_groups));
+ $result = $db->sql_query($sql);
+
+ $teampage_ary = array();
+ while ($row = $db->sql_fetchrow($result))
+ {
+ $teampage_ary[] = array(
+ 'group_id' => (int) $row['group_id'],
+ 'teampage_name' => '',
+ 'teampage_position' => (int) $teampage_groups[$row['group_name']],
+ 'teampage_parent' => 0,
+ );
+ }
+ $db->sql_freeresult($result);
+
+ if (sizeof($teampage_ary))
+ {
+ $db->sql_multi_insert(TEAMPAGE_TABLE, $teampage_ary);
+ }
+}
+
/**
* Sync post count. We might need to do this in batches.
@@ -1769,7 +1806,7 @@ function sync_post_count($offset, $limit)
$sql = 'SELECT COUNT(post_id) AS num_posts, poster_id
FROM ' . POSTS_TABLE . '
WHERE post_postcount = 1
- AND post_approved = 1
+ AND post_visibility = ' . ITEM_APPROVED . '
GROUP BY poster_id
ORDER BY poster_id';
$result = $db->sql_query_limit($sql, $limit, $offset);
@@ -1885,7 +1922,7 @@ function add_bots()
'user_email' => '',
'user_lang' => $config['default_lang'],
'user_style' => 1,
- 'user_timezone' => 0,
+ 'user_timezone' => 'UTC',
'user_allow_massemail' => 0,
);
@@ -1942,7 +1979,7 @@ function update_dynamic_config()
$sql = 'SELECT COUNT(post_id) AS stat
FROM ' . POSTS_TABLE . '
- WHERE post_approved = 1';
+ WHERE post_visibility = ' . ITEM_APPROVED;
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
@@ -1951,7 +1988,7 @@ function update_dynamic_config()
$sql = 'SELECT COUNT(topic_id) AS stat
FROM ' . TOPICS_TABLE . '
- WHERE topic_approved = 1';
+ WHERE topic_visibility = ' . ITEM_APPROVED;
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
@@ -2004,10 +2041,10 @@ function update_topics_posted()
{
global $db, $config;
- switch ($db->sql_layer)
+ switch ($db->get_sql_layer())
{
case 'sqlite':
- case 'firebird':
+ case 'sqlite3':
$db->sql_query('DELETE FROM ' . TOPICS_POSTED_TABLE);
break;
@@ -2111,6 +2148,7 @@ function fix_empty_primary_groups()
}
$sql = 'SELECT user_id FROM ' . USER_GROUP_TABLE . ' WHERE group_id = ' . get_group_id('global_moderators');
+ $result = $db->sql_query($sql);
$user_ids = array();
while ($row = $db->sql_fetchrow($result))
@@ -2231,7 +2269,7 @@ function convert_bbcode($message, $convert_size = true, $extended_bbcodes = fals
"\n\n"
);
- for ($i = 0; $i < sizeof($str_from); ++$i)
+ for ($i = 0, $end = sizeof($str_from); $i < $end; ++$i)
{
$origx[] = '#\\' . str_replace(']', '\\]', $str_from[$i]) . '#is';
$replx[] = $str_to[$i];
@@ -2240,7 +2278,7 @@ function convert_bbcode($message, $convert_size = true, $extended_bbcodes = fals
if (preg_match_all('#\[email=([^\]]+)\](.*?)\[/email\]#i', $message, $m))
{
- for ($i = 0; $i < sizeof($m[1]); ++$i)
+ for ($i = 0, $end = sizeof($m[1]); $i < $end; ++$i)
{
if ($m[1][$i] == $m[2][$i])
{
@@ -2259,7 +2297,7 @@ function convert_bbcode($message, $convert_size = true, $extended_bbcodes = fals
$message = preg_replace('#\[size=([0-9]+)\](.*?)\[/size\]#i', '[size=\1]\2[/size]', $message);
$message = preg_replace('#\[size=[0-9]{2,}\](.*?)\[/size\]#i', '[size=29]\1[/size]', $message);
- for ($i = sizeof($size); $i; )
+ for ($i = sizeof($size); $i;)
{
$i--;
$message = str_replace('[size=' . $i . ']', '[size=' . $size[$i] . ']', $message);
@@ -2301,7 +2339,7 @@ function copy_file($src, $trg, $overwrite = false, $die_on_failure = true, $sour
$parts = explode('/', $trg);
unset($parts[sizeof($parts) - 1]);
- for ($i = 0; $i < sizeof($parts); ++$i)
+ for ($i = 0, $end = sizeof($parts); $i < $end; ++$i)
{
$path .= $parts[$i] . '/';
@@ -2398,7 +2436,7 @@ function copy_dir($src, $trg, $copy_subdirs = true, $overwrite = false, $die_on_
if ($copy_subdirs)
{
- for ($i = 0; $i < sizeof($dirlist); ++$i)
+ for ($i = 0, $end = sizeof($dirlist); $i < $end; ++$i)
{
$dir = $dirlist[$i];
@@ -2433,7 +2471,7 @@ function copy_dir($src, $trg, $copy_subdirs = true, $overwrite = false, $die_on_
$convert->p_master->error(sprintf($str, implode('<br />', $bad_dirs)), __LINE__, __FILE__);
}
- for ($i = 0; $i < sizeof($filelist); ++$i)
+ for ($i = 0, $end = sizeof($filelist); $i < $end; ++$i)
{
copy_file($src . $filelist[$i], $trg . $filelist[$i], $overwrite, $die_on_failure, $source_relative_path);
}
@@ -2473,7 +2511,3 @@ function fill_dateformat($user_dateformat)
return ((empty($user_dateformat)) ? $config['default_dateformat'] : $user_dateformat);
}
-
-
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/functions_database_helper.php b/phpBB/includes/functions_database_helper.php
index 664c246888..8f363d56f3 100644
--- a/phpBB/includes/functions_database_helper.php
+++ b/phpBB/includes/functions_database_helper.php
@@ -1,9 +1,13 @@
<?php
/**
*
-* @package phpBB3
-* @copyright (c) 2012 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -22,14 +26,14 @@ if (!defined('IN_PHPBB'))
*
* The only supported table is bookmarks.
*
-* @param dbal $db Database object
+* @param \phpbb\db\driver\driver_interface $db Database object
* @param string $table Table on which to perform the update
* @param string $column Column whose values to change
* @param array $from_values An array of values that should be changed
* @param int $to_value The new value
* @return null
*/
-function phpbb_update_rows_avoiding_duplicates($db, $table, $column, $from_values, $to_value)
+function phpbb_update_rows_avoiding_duplicates(\phpbb\db\driver\driver_interface $db, $table, $column, $from_values, $to_value)
{
$sql = "SELECT $column, user_id
FROM $table
@@ -107,14 +111,14 @@ function phpbb_update_rows_avoiding_duplicates($db, $table, $column, $from_value
*
* The only supported table is topics_watch.
*
-* @param dbal $db Database object
+* @param \phpbb\db\driver\driver_interface $db Database object
* @param string $table Table on which to perform the update
* @param string $column Column whose values to change
* @param array $from_values An array of values that should be changed
* @param int $to_value The new value
* @return null
*/
-function phpbb_update_rows_avoiding_duplicates_notify_status($db, $table, $column, $from_values, $to_value)
+function phpbb_update_rows_avoiding_duplicates_notify_status(\phpbb\db\driver\driver_interface $db, $table, $column, $from_values, $to_value)
{
$sql = "SELECT $column, user_id, notify_status
FROM $table
diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php
index ee7048638d..3b2d66c2d3 100644
--- a/phpBB/includes/functions_display.php
+++ b/phpBB/includes/functions_display.php
@@ -1,10 +1,13 @@
<?php
/**
*
-* @package phpBB3
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -23,6 +26,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
{
global $db, $auth, $user, $template;
global $phpbb_root_path, $phpEx, $config;
+ global $request, $phpbb_dispatcher, $phpbb_container;
$forum_rows = $subforums = $forum_ids = $forum_ids_moderator = $forum_moderators = $active_forum_ary = array();
$parent_id = $visible_forums = 0;
@@ -54,12 +58,26 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
// Handle marking everything read
if ($mark_read == 'all')
{
- $redirect = build_url(array('mark', 'hash'));
+ $redirect = build_url(array('mark', 'hash', 'mark_time'));
meta_refresh(3, $redirect);
if (check_link_hash(request_var('hash', ''), 'global'))
{
- markread('all');
+ markread('all', false, false, request_var('mark_time', 0));
+
+ if ($request->is_ajax())
+ {
+ // Tell the ajax script what language vars and URL need to be replaced
+ $data = array(
+ 'NO_UNREAD_POSTS' => $user->lang['NO_UNREAD_POSTS'],
+ 'UNREAD_POSTS' => $user->lang['UNREAD_POSTS'],
+ 'U_MARK_FORUMS' => ($user->data['is_registered'] || $config['load_anon_lastread']) ? append_sid("{$phpbb_root_path}index.$phpEx", 'hash=' . generate_link_hash('global') . '&mark=forums&mark_time=' . time()) : '',
+ 'MESSAGE_TITLE' => $user->lang['INFORMATION'],
+ 'MESSAGE_TEXT' => $user->lang['FORUMS_MARKED']
+ );
+ $json_response = new \phpbb\json_response();
+ $json_response->send($data);
+ }
trigger_error(
$user->lang['FORUMS_MARKED'] . '<br /><br />' .
@@ -90,7 +108,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
}
else if ($config['load_anon_lastread'] || $user->data['is_registered'])
{
- $tracking_topics = (isset($_COOKIE[$config['cookie_name'] . '_track'])) ? ((STRIP) ? stripslashes($_COOKIE[$config['cookie_name'] . '_track']) : $_COOKIE[$config['cookie_name'] . '_track']) : '';
+ $tracking_topics = $request->variable($config['cookie_name'] . '_track', '', true, \phpbb\request\request_interface::COOKIE);
$tracking_topics = ($tracking_topics) ? tracking_unserialize($tracking_topics) : array();
if (!$user->data['is_registered'])
@@ -109,7 +127,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
$sql_array['SELECT'] .= ', fa.user_id';
}
- $sql = $db->sql_build_query('SELECT', array(
+ $sql_ary = array(
'SELECT' => $sql_array['SELECT'],
'FROM' => $sql_array['FROM'],
'LEFT_JOIN' => $sql_array['LEFT_JOIN'],
@@ -117,27 +135,41 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
'WHERE' => $sql_where,
'ORDER_BY' => 'f.left_id',
- ));
+ );
+ /**
+ * Event to modify the SQL query before the forum data is queried
+ *
+ * @event core.display_forums_modify_sql
+ * @var array sql_ary The SQL array to get the data of the forums
+ * @since 3.1.0-a1
+ */
+ $vars = array('sql_ary');
+ extract($phpbb_dispatcher->trigger_event('core.display_forums_modify_sql', compact($vars)));
+
+ $sql = $db->sql_build_query('SELECT', $sql_ary);
$result = $db->sql_query($sql);
- $forum_tracking_info = array();
+ $forum_tracking_info = $valid_categories = array();
$branch_root_id = $root_data['forum_id'];
- // Check for unread global announcements (index page only)
- $ga_unread = false;
- if ($root_data['forum_id'] == 0)
- {
- $unread_ga_list = get_unread_topics($user->data['user_id'], 'AND t.forum_id = 0', '', 1);
-
- if (!empty($unread_ga_list))
- {
- $ga_unread = true;
- }
- }
+ $phpbb_content_visibility = $phpbb_container->get('content.visibility');
while ($row = $db->sql_fetchrow($result))
{
+ /**
+ * Event to modify the data set of a forum
+ *
+ * This event is triggered once per forum
+ *
+ * @event core.display_forums_modify_row
+ * @var int branch_root_id Last top-level forum
+ * @var array row The data of the forum
+ * @since 3.1.0-a1
+ */
+ $vars = array('branch_root_id', 'row');
+ extract($phpbb_dispatcher->trigger_event('core.display_forums_modify_row', compact($vars)));
+
$forum_id = $row['forum_id'];
// Mark forums read?
@@ -187,9 +219,11 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
$forum_tracking_info[$forum_id] = (isset($tracking_topics['f'][$forum_id])) ? (int) (base_convert($tracking_topics['f'][$forum_id], 36, 10) + $config['board_startdate']) : $user->data['user_lastmark'];
}
- // Count the difference of real to public topics, so we can display an information to moderators
- $row['forum_id_unapproved_topics'] = ($auth->acl_get('m_approve', $forum_id) && ($row['forum_topics_real'] != $row['forum_topics'])) ? $forum_id : 0;
- $row['forum_topics'] = ($auth->acl_get('m_approve', $forum_id)) ? $row['forum_topics_real'] : $row['forum_topics'];
+ // Lets check whether there are unapproved topics/posts, so we can display an information to moderators
+ $row['forum_id_unapproved_topics'] = ($auth->acl_get('m_approve', $forum_id) && $row['forum_topics_unapproved']) ? $forum_id : 0;
+ $row['forum_id_unapproved_posts'] = ($auth->acl_get('m_approve', $forum_id) && $row['forum_posts_unapproved']) ? $forum_id : 0;
+ $row['forum_posts'] = $phpbb_content_visibility->get_count('forum_posts', $row, $forum_id);
+ $row['forum_topics'] = $phpbb_content_visibility->get_count('forum_topics', $row, $forum_id);
// Display active topics from this forum?
if ($show_active && $row['forum_type'] == FORUM_POST && $auth->acl_get('f_read', $forum_id) && ($row['forum_flags'] & FORUM_FLAG_ACTIVE_TOPICS))
@@ -216,6 +250,12 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
}
}
+ // Fill list of categories with forums
+ if (isset($forum_rows[$row['parent_id']]))
+ {
+ $valid_categories[$row['parent_id']] = true;
+ }
+
//
if ($row['parent_id'] == $root_data['forum_id'] || $row['parent_id'] == $branch_root_id)
{
@@ -233,6 +273,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
$branch_root_id = $forum_id;
}
$forum_rows[$parent_id]['forum_id_last_post'] = $row['forum_id'];
+ $forum_rows[$parent_id]['forum_password_last_post'] = $row['forum_password'];
$forum_rows[$parent_id]['orig_forum_last_post_time'] = $row['forum_last_post_time'];
}
else if ($row['forum_type'] != FORUM_CAT)
@@ -252,6 +293,11 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
$forum_rows[$parent_id]['forum_id_unapproved_topics'] = $forum_id;
}
+ if (!$forum_rows[$parent_id]['forum_id_unapproved_posts'] && $row['forum_id_unapproved_posts'])
+ {
+ $forum_rows[$parent_id]['forum_id_unapproved_posts'] = $forum_id;
+ }
+
$forum_rows[$parent_id]['forum_topics'] += $row['forum_topics'];
// Do not list redirects in LINK Forums as Posts.
@@ -269,23 +315,53 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
$forum_rows[$parent_id]['forum_last_poster_name'] = $row['forum_last_poster_name'];
$forum_rows[$parent_id]['forum_last_poster_colour'] = $row['forum_last_poster_colour'];
$forum_rows[$parent_id]['forum_id_last_post'] = $forum_id;
+ $forum_rows[$parent_id]['forum_password_last_post'] = $row['forum_password'];
}
}
+
+ /**
+ * Event to modify the forum rows data set
+ *
+ * This event is triggered once per forum
+ *
+ * @event core.display_forums_modify_forum_rows
+ * @var array forum_rows Data array of all forums we display
+ * @var array subforums Data array of all subforums we display
+ * @var int branch_root_id Current top-level forum
+ * @var int parent_id Current parent forum
+ * @var array row The data of the forum
+ * @since 3.1.0-a1
+ */
+ $vars = array('forum_rows', 'subforums', 'branch_root_id', 'parent_id', 'row');
+ extract($phpbb_dispatcher->trigger_event('core.display_forums_modify_forum_rows', compact($vars)));
}
$db->sql_freeresult($result);
// Handle marking posts
if ($mark_read == 'forums')
{
- $redirect = build_url(array('mark', 'hash'));
+ $redirect = build_url(array('mark', 'hash', 'mark_time'));
$token = request_var('hash', '');
if (check_link_hash($token, 'global'))
{
- // Add 0 to forums array to mark global announcements correctly
- $forum_ids[] = 0;
- markread('topics', $forum_ids);
+ markread('topics', $forum_ids, false, request_var('mark_time', 0));
$message = sprintf($user->lang['RETURN_FORUM'], '<a href="' . $redirect . '">', '</a>');
meta_refresh(3, $redirect);
+
+ if ($request->is_ajax())
+ {
+ // Tell the ajax script what language vars and URL need to be replaced
+ $data = array(
+ 'NO_UNREAD_POSTS' => $user->lang['NO_UNREAD_POSTS'],
+ 'UNREAD_POSTS' => $user->lang['UNREAD_POSTS'],
+ 'U_MARK_FORUMS' => ($user->data['is_registered'] || $config['load_anon_lastread']) ? append_sid("{$phpbb_root_path}viewforum.$phpEx", 'hash=' . generate_link_hash('global') . '&f=' . $root_data['forum_id'] . '&mark=forums&mark_time=' . time()) : '',
+ 'MESSAGE_TITLE' => $user->lang['INFORMATION'],
+ 'MESSAGE_TEXT' => $user->lang['FORUMS_MARKED']
+ );
+ $json_response = new \phpbb\json_response();
+ $json_response->send($data);
+ }
+
trigger_error($user->lang['FORUMS_MARKED'] . '<br /><br />' . $message);
}
else
@@ -307,14 +383,42 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
get_moderators($forum_moderators, $forum_ids_moderator);
}
+ /**
+ * Event to perform additional actions before the forum list is being generated
+ *
+ * @event core.display_forums_before
+ * @var array active_forum_ary Array with forum data to display active topics
+ * @var bool display_moderators Flag indicating if we display forum moderators
+ * @var array forum_moderators Array with forum moderators list
+ * @var array forum_rows Data array of all forums we display
+ * @var bool return_moderators Flag indicating if moderators list should be returned
+ * @var array root_data Array with the root forum data
+ * @since 3.1.4-RC1
+ */
+ $vars = array(
+ 'active_forum_ary',
+ 'display_moderators',
+ 'forum_moderators',
+ 'forum_rows',
+ 'return_moderators',
+ 'root_data',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.display_forums_before', compact($vars)));
+
// Used to tell whatever we have to create a dummy category or not.
$last_catless = true;
foreach ($forum_rows as $row)
{
- // Empty category
+ // Category
if ($row['parent_id'] == $root_data['forum_id'] && $row['forum_type'] == FORUM_CAT)
{
- $template->assign_block_vars('forumrow', array(
+ // Do not display categories without any forums to display
+ if (!isset($valid_categories[$row['forum_id']]))
+ {
+ continue;
+ }
+
+ $cat_row = array(
'S_IS_CAT' => true,
'FORUM_ID' => $row['forum_id'],
'FORUM_NAME' => $row['forum_name'],
@@ -323,8 +427,32 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
'FORUM_FOLDER_IMG_SRC' => '',
'FORUM_IMAGE' => ($row['forum_image']) ? '<img src="' . $phpbb_root_path . $row['forum_image'] . '" alt="' . $user->lang['FORUM_CAT'] . '" />' : '',
'FORUM_IMAGE_SRC' => ($row['forum_image']) ? $phpbb_root_path . $row['forum_image'] : '',
- 'U_VIEWFORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $row['forum_id']))
+ 'U_VIEWFORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $row['forum_id']),
+ );
+
+ /**
+ * Modify the template data block of the 'category'
+ *
+ * This event is triggered once per 'category'
+ *
+ * @event core.display_forums_modify_category_template_vars
+ * @var array cat_row Template data of the 'category'
+ * @var bool catless The flag indicating whether the 'category' has a parent category
+ * @var bool last_catless The flag indicating whether the last forum had a parent category
+ * @var array root_data Array with the root forum data
+ * @var array row The data of the 'category'
+ * @since 3.1.0-RC4
+ */
+ $vars = array(
+ 'cat_row',
+ 'catless',
+ 'last_catless',
+ 'root_data',
+ 'row',
);
+ extract($phpbb_dispatcher->trigger_event('core.display_forums_modify_category_template_vars', compact($vars)));
+
+ $template->assign_block_vars('forumrow', $cat_row);
continue;
}
@@ -334,12 +462,6 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
$forum_unread = (isset($forum_tracking_info[$forum_id]) && $row['orig_forum_last_post_time'] > $forum_tracking_info[$forum_id]) ? true : false;
- // Mark the first visible forum on index as unread if there's any unread global announcement
- if ($ga_unread && !empty($forum_ids_moderator) && $forum_id == $forum_ids_moderator[0])
- {
- $forum_unread = true;
- }
-
$folder_image = $folder_alt = $l_subforums = '';
$subforums_list = array();
@@ -383,7 +505,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
}
}
- $l_subforums = (sizeof($subforums[$forum_id]) == 1) ? $user->lang['SUBFORUM'] . ': ' : $user->lang['SUBFORUMS'] . ': ';
+ $l_subforums = (sizeof($subforums[$forum_id]) == 1) ? $user->lang['SUBFORUM'] : $user->lang['SUBFORUMS'];
$folder_image = ($forum_unread) ? 'forum_unread_subforum' : 'forum_read_subforum';
}
else
@@ -414,13 +536,21 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
// Create last post link information, if appropriate
if ($row['forum_last_post_id'])
{
- $last_post_subject = $row['forum_last_post_subject'];
+ if ($row['forum_password_last_post'] === '' && $auth->acl_get('f_read', $row['forum_id_last_post']))
+ {
+ $last_post_subject = censor_text($row['forum_last_post_subject']);
+ $last_post_subject_truncated = truncate_string($last_post_subject, 30, 255, false, $user->lang['ELLIPSIS']);
+ }
+ else
+ {
+ $last_post_subject = $last_post_subject_truncated = '';
+ }
$last_post_time = $user->format_date($row['forum_last_post_time']);
$last_post_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id_last_post'] . '&amp;p=' . $row['forum_last_post_id']) . '#p' . $row['forum_last_post_id'];
}
else
{
- $last_post_subject = $last_post_time = $last_post_url = '';
+ $last_post_subject = $last_post_time = $last_post_url = $last_post_subject_truncated = '';
}
// Output moderator listing ... if applicable
@@ -428,18 +558,23 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
if ($display_moderators && !empty($forum_moderators[$forum_id]))
{
$l_moderator = (sizeof($forum_moderators[$forum_id]) == 1) ? $user->lang['MODERATOR'] : $user->lang['MODERATORS'];
- $moderators_list = implode(', ', $forum_moderators[$forum_id]);
+ $moderators_list = implode($user->lang['COMMA_SEPARATOR'], $forum_moderators[$forum_id]);
}
$l_post_click_count = ($row['forum_type'] == FORUM_LINK) ? 'CLICKS' : 'POSTS';
$post_click_count = ($row['forum_type'] != FORUM_LINK || $row['forum_flags'] & FORUM_FLAG_LINK_TRACK) ? $row['forum_posts'] : '';
- $s_subforums_list = array();
+ $s_subforums_list = $subforums_row = array();
foreach ($subforums_list as $subforum)
{
$s_subforums_list[] = '<a href="' . $subforum['link'] . '" class="subforum ' . (($subforum['unread']) ? 'unread' : 'read') . '" title="' . (($subforum['unread']) ? $user->lang['UNREAD_POSTS'] : $user->lang['NO_UNREAD_POSTS']) . '">' . $subforum['name'] . '</a>';
+ $subforums_row[] = array(
+ 'U_SUBFORUM' => $subforum['link'],
+ 'SUBFORUM_NAME' => $subforum['name'],
+ 'S_UNREAD' => $subforum['unread'],
+ );
}
- $s_subforums_list = (string) implode(', ', $s_subforums_list);
+ $s_subforums_list = (string) implode($user->lang['COMMA_SEPARATOR'], $s_subforums_list);
$catless = ($row['parent_id'] == $root_data['forum_id']) ? true : false;
if ($row['forum_type'] != FORUM_LINK)
@@ -460,7 +595,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
}
}
- $template->assign_block_vars('forumrow', array(
+ $forum_row = array(
'S_IS_CAT' => false,
'S_NO_CAT' => $catless && !$last_catless,
'S_IS_LINK' => ($row['forum_type'] == FORUM_LINK) ? true : false,
@@ -469,6 +604,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
'S_LOCKED_FORUM' => ($row['forum_status'] == ITEM_LOCKED) ? true : false,
'S_LIST_SUBFORUMS' => ($row['display_subforum_list']) ? true : false,
'S_SUBFORUMS' => (sizeof($subforums_list)) ? true : false,
+ 'S_DISPLAY_SUBJECT' => ($last_post_subject !== '' && $config['display_last_subject']) ? true : false,
'S_FEED_ENABLED' => ($config['feed_forum'] && !phpbb_optionget(FORUM_OPTION_FEED_EXCLUDE, $row['forum_options']) && $row['forum_type'] == FORUM_POST) ? true : false,
'FORUM_ID' => $row['forum_id'],
@@ -476,12 +612,13 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
'FORUM_DESC' => generate_text_for_display($row['forum_desc'], $row['forum_desc_uid'], $row['forum_desc_bitfield'], $row['forum_desc_options']),
'TOPICS' => $row['forum_topics'],
$l_post_click_count => $post_click_count,
+ 'FORUM_IMG_STYLE' => $folder_image,
'FORUM_FOLDER_IMG' => $user->img($folder_image, $folder_alt),
- 'FORUM_FOLDER_IMG_SRC' => $user->img($folder_image, $folder_alt, false, '', 'src'),
'FORUM_FOLDER_IMG_ALT' => isset($user->lang[$folder_alt]) ? $user->lang[$folder_alt] : '',
'FORUM_IMAGE' => ($row['forum_image']) ? '<img src="' . $phpbb_root_path . $row['forum_image'] . '" alt="' . $user->lang[$folder_alt] . '" />' : '',
'FORUM_IMAGE_SRC' => ($row['forum_image']) ? $phpbb_root_path . $row['forum_image'] : '',
- 'LAST_POST_SUBJECT' => censor_text($last_post_subject),
+ 'LAST_POST_SUBJECT' => $last_post_subject,
+ 'LAST_POST_SUBJECT_TRUNCATED' => $last_post_subject_truncated,
'LAST_POST_TIME' => $last_post_time,
'LAST_POSTER' => get_username_string('username', $row['forum_last_poster_id'], $row['forum_last_poster_name'], $row['forum_last_poster_colour']),
'LAST_POSTER_COLOUR' => get_username_string('colour', $row['forum_last_poster_id'], $row['forum_last_poster_name'], $row['forum_last_poster_colour']),
@@ -493,32 +630,90 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
'L_MODERATOR_STR' => $l_moderator,
'U_UNAPPROVED_TOPICS' => ($row['forum_id_unapproved_topics']) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue&amp;mode=unapproved_topics&amp;f=' . $row['forum_id_unapproved_topics']) : '',
+ 'U_UNAPPROVED_POSTS' => ($row['forum_id_unapproved_posts']) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue&amp;mode=unapproved_posts&amp;f=' . $row['forum_id_unapproved_posts']) : '',
'U_VIEWFORUM' => $u_viewforum,
'U_LAST_POSTER' => get_username_string('profile', $row['forum_last_poster_id'], $row['forum_last_poster_name'], $row['forum_last_poster_colour']),
- 'U_LAST_POST' => $last_post_url)
+ 'U_LAST_POST' => $last_post_url,
);
+ /**
+ * Modify the template data block of the forum
+ *
+ * This event is triggered once per forum
+ *
+ * @event core.display_forums_modify_template_vars
+ * @var array forum_row Template data of the forum
+ * @var array row The data of the forum
+ * @var array subforums_row Template data of subforums
+ * @since 3.1.0-a1
+ * @changed 3.1.0-b5 Added var subforums_row
+ */
+ $vars = array('forum_row', 'row', 'subforums_row');
+ extract($phpbb_dispatcher->trigger_event('core.display_forums_modify_template_vars', compact($vars)));
+
+ $template->assign_block_vars('forumrow', $forum_row);
+
// Assign subforums loop for style authors
- foreach ($subforums_list as $subforum)
- {
- $template->assign_block_vars('forumrow.subforum', array(
- 'U_SUBFORUM' => $subforum['link'],
- 'SUBFORUM_NAME' => $subforum['name'],
- 'S_UNREAD' => $subforum['unread'])
- );
- }
+ $template->assign_block_vars_array('forumrow.subforum', $subforums_row);
+
+ /**
+ * Modify and/or assign additional template data for the forum
+ * after forumrow loop has been assigned. This can be used
+ * to create additional forumrow subloops in extensions.
+ *
+ * This event is triggered once per forum
+ *
+ * @event core.display_forums_add_template_data
+ * @var array forum_row Template data of the forum
+ * @var array row The data of the forum
+ * @var array subforums_list The data of subforums
+ * @var array subforums_row Template data of subforums
+ * @var bool catless The flag indicating whether a forum has a parent category
+ * @since 3.1.0-b5
+ */
+ $vars = array(
+ 'forum_row',
+ 'row',
+ 'subforums_list',
+ 'subforums_row',
+ 'catless',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.display_forums_add_template_data', compact($vars)));
$last_catless = $catless;
}
$template->assign_vars(array(
- 'U_MARK_FORUMS' => ($user->data['is_registered'] || $config['load_anon_lastread']) ? append_sid("{$phpbb_root_path}viewforum.$phpEx", 'hash=' . generate_link_hash('global') . '&amp;f=' . $root_data['forum_id'] . '&amp;mark=forums') : '',
+ 'U_MARK_FORUMS' => ($user->data['is_registered'] || $config['load_anon_lastread']) ? append_sid("{$phpbb_root_path}viewforum.$phpEx", 'hash=' . generate_link_hash('global') . '&amp;f=' . $root_data['forum_id'] . '&amp;mark=forums&amp;mark_time=' . time()) : '',
'S_HAS_SUBFORUM' => ($visible_forums) ? true : false,
'L_SUBFORUM' => ($visible_forums == 1) ? $user->lang['SUBFORUM'] : $user->lang['SUBFORUMS'],
'LAST_POST_IMG' => $user->img('icon_topic_latest', 'VIEW_LATEST_POST'),
'UNAPPROVED_IMG' => $user->img('icon_topic_unapproved', 'TOPICS_UNAPPROVED'),
+ 'UNAPPROVED_POST_IMG' => $user->img('icon_topic_unapproved', 'POSTS_UNAPPROVED_FORUM'),
));
+ /**
+ * Event to perform additional actions after the forum list has been generated
+ *
+ * @event core.display_forums_after
+ * @var array active_forum_ary Array with forum data to display active topics
+ * @var bool display_moderators Flag indicating if we display forum moderators
+ * @var array forum_moderators Array with forum moderators list
+ * @var array forum_rows Data array of all forums we display
+ * @var bool return_moderators Flag indicating if moderators list should be returned
+ * @var array root_data Array with the root forum data
+ * @since 3.1.0-RC5
+ */
+ $vars = array(
+ 'active_forum_ary',
+ 'display_moderators',
+ 'forum_moderators',
+ 'forum_rows',
+ 'return_moderators',
+ 'root_data',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.display_forums_after', compact($vars)));
+
if ($return_moderators)
{
return array($active_forum_ary, $forum_moderators);
@@ -558,16 +753,20 @@ function generate_forum_rules(&$forum_data)
function generate_forum_nav(&$forum_data)
{
global $db, $user, $template, $auth, $config;
- global $phpEx, $phpbb_root_path;
+ global $phpEx, $phpbb_root_path, $phpbb_dispatcher;
if (!$auth->acl_get('f_list', $forum_data['forum_id']))
{
return;
}
+ $navlinks = $navlinks_parents = $forum_template_data = array();
+
// Get forum parents
$forum_parents = get_forum_parents($forum_data);
+ $microdata_attr = 'data-forum-id';
+
// Build navigation links
if (!empty($forum_parents))
{
@@ -581,33 +780,59 @@ function generate_forum_nav(&$forum_data)
continue;
}
- $template->assign_block_vars('navlinks', array(
+ $navlinks_parents[] = array(
'S_IS_CAT' => ($parent_type == FORUM_CAT) ? true : false,
'S_IS_LINK' => ($parent_type == FORUM_LINK) ? true : false,
'S_IS_POST' => ($parent_type == FORUM_POST) ? true : false,
'FORUM_NAME' => $parent_name,
'FORUM_ID' => $parent_forum_id,
- 'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $parent_forum_id))
+ 'MICRODATA' => $microdata_attr . '="' . $parent_forum_id . '"',
+ 'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $parent_forum_id),
);
}
}
- $template->assign_block_vars('navlinks', array(
+ $navlinks = array(
'S_IS_CAT' => ($forum_data['forum_type'] == FORUM_CAT) ? true : false,
'S_IS_LINK' => ($forum_data['forum_type'] == FORUM_LINK) ? true : false,
'S_IS_POST' => ($forum_data['forum_type'] == FORUM_POST) ? true : false,
'FORUM_NAME' => $forum_data['forum_name'],
'FORUM_ID' => $forum_data['forum_id'],
- 'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_data['forum_id']))
+ 'MICRODATA' => $microdata_attr . '="' . $forum_data['forum_id'] . '"',
+ 'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_data['forum_id']),
);
- $template->assign_vars(array(
+ $forum_template_data = array(
'FORUM_ID' => $forum_data['forum_id'],
'FORUM_NAME' => $forum_data['forum_name'],
'FORUM_DESC' => generate_text_for_display($forum_data['forum_desc'], $forum_data['forum_desc_uid'], $forum_data['forum_desc_bitfield'], $forum_data['forum_desc_options']),
'S_ENABLE_FEEDS_FORUM' => ($config['feed_forum'] && $forum_data['forum_type'] == FORUM_POST && !phpbb_optionget(FORUM_OPTION_FEED_EXCLUDE, $forum_data['forum_options'])) ? true : false,
- ));
+ );
+
+ /**
+ * Event to modify the navlinks text
+ *
+ * @event core.generate_forum_nav
+ * @var array forum_data Array with the forum data
+ * @var array forum_template_data Array with generic forum template data
+ * @var string microdata_attr The microdata attribute
+ * @var array navlinks_parents Array with the forum parents navlinks data
+ * @var array navlinks Array with the forum navlinks data
+ * @since 3.1.5-RC1
+ */
+ $vars = array(
+ 'forum_data',
+ 'forum_template_data',
+ 'microdata_attr',
+ 'navlinks_parents',
+ 'navlinks',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.generate_forum_nav', compact($vars)));
+
+ $template->assign_block_vars_array('navlinks', $navlinks_parents);
+ $template->assign_block_vars('navlinks', $navlinks);
+ $template->assign_vars($forum_template_data);
return;
}
@@ -655,48 +880,6 @@ function get_forum_parents(&$forum_data)
}
/**
-* Generate topic pagination
-*/
-function topic_generate_pagination($replies, $url)
-{
- global $config, $user;
-
- // Make sure $per_page is a valid value
- $per_page = ($config['posts_per_page'] <= 0) ? 1 : $config['posts_per_page'];
-
- if (($replies + 1) > $per_page)
- {
- $total_pages = ceil(($replies + 1) / $per_page);
- $pagination = '';
-
- $times = 1;
- for ($j = 0; $j < $replies + 1; $j += $per_page)
- {
- $pagination .= '<a href="' . $url . ($j == 0 ? '' : '&amp;start=' . $j) . '">' . $times . '</a>';
- if ($times == 1 && $total_pages > 5)
- {
- $pagination .= '<span class="page-dots"> ... </span>';
-
- // Display the last three pages
- $times = $total_pages - 3;
- $j += ($total_pages - 4) * $per_page;
- }
- else if ($times < $total_pages)
- {
- $pagination .= '<span class="page-sep">' . $user->lang['COMMA_SEPARATOR'] . '</span>';
- }
- $times++;
- }
- }
- else
- {
- $pagination = '';
- }
-
- return $pagination;
-}
-
-/**
* Obtain list of moderators of each forum
*/
function get_moderators(&$forum_moderators, $forum_id = false)
@@ -790,7 +973,7 @@ function gen_forum_auth_level($mode, $forum_id, $forum_status)
($auth->acl_get('f_post', $forum_id) && !$locked) ? $user->lang['RULES_POST_CAN'] : $user->lang['RULES_POST_CANNOT'],
($auth->acl_get('f_reply', $forum_id) && !$locked) ? $user->lang['RULES_REPLY_CAN'] : $user->lang['RULES_REPLY_CANNOT'],
($user->data['is_registered'] && $auth->acl_gets('f_edit', 'm_edit', $forum_id) && !$locked) ? $user->lang['RULES_EDIT_CAN'] : $user->lang['RULES_EDIT_CANNOT'],
- ($user->data['is_registered'] && $auth->acl_gets('f_delete', 'm_delete', $forum_id) && !$locked) ? $user->lang['RULES_DELETE_CAN'] : $user->lang['RULES_DELETE_CANNOT'],
+ ($user->data['is_registered'] && ($auth->acl_gets('f_delete', 'm_delete', $forum_id) || $auth->acl_gets('f_softdelete', 'm_softdelete', $forum_id)) && !$locked) ? $user->lang['RULES_DELETE_CAN'] : $user->lang['RULES_DELETE_CANNOT'],
);
if ($config['allow_attachments'])
@@ -864,7 +1047,6 @@ function topic_status(&$topic_row, $replies, $unread_topic, &$folder_img, &$fold
$folder_new .= '_locked';
}
-
$folder_img = ($unread_topic) ? $folder_new : $folder;
$folder_alt = ($unread_topic) ? 'UNREAD_POSTS' : (($topic_row['topic_status'] == ITEM_LOCKED) ? 'TOPIC_LOCKED' : 'NO_UNREAD_POSTS');
@@ -883,20 +1065,35 @@ function topic_status(&$topic_row, $replies, $unread_topic, &$folder_img, &$fold
/**
* Assign/Build custom bbcodes for display in screens supporting using of bbcodes
-* The custom bbcodes buttons will be placed within the template block 'custom_codes'
+* The custom bbcodes buttons will be placed within the template block 'custom_tags'
*/
function display_custom_bbcodes()
{
- global $db, $template, $user;
+ global $db, $template, $user, $phpbb_dispatcher;
// Start counting from 22 for the bbcode ids (every bbcode takes two ids - opening/closing)
$num_predefined_bbcodes = 22;
- $sql = 'SELECT bbcode_id, bbcode_tag, bbcode_helpline
- FROM ' . BBCODES_TABLE . '
- WHERE display_on_posting = 1
- ORDER BY bbcode_tag';
- $result = $db->sql_query($sql);
+ $sql_ary = array(
+ 'SELECT' => 'b.bbcode_id, b.bbcode_tag, b.bbcode_helpline',
+ 'FROM' => array(BBCODES_TABLE => 'b'),
+ 'WHERE' => 'b.display_on_posting = 1',
+ 'ORDER_BY' => 'b.bbcode_tag',
+ );
+
+ /**
+ * Event to modify the SQL query before custom bbcode data is queried
+ *
+ * @event core.display_custom_bbcodes_modify_sql
+ * @var array sql_ary The SQL array to get the bbcode data
+ * @var int num_predefined_bbcodes The number of predefined core bbcodes
+ * (multiplied by factor of 2)
+ * @since 3.1.0-a3
+ */
+ $vars = array('sql_ary', 'num_predefined_bbcodes');
+ extract($phpbb_dispatcher->trigger_event('core.display_custom_bbcodes_modify_sql', compact($vars)));
+
+ $result = $db->sql_query($db->sql_build_query('SELECT', $sql_ary));
$i = 0;
while ($row = $db->sql_fetchrow($result))
@@ -907,17 +1104,41 @@ function display_custom_bbcodes()
$row['bbcode_helpline'] = $user->lang[strtoupper($row['bbcode_helpline'])];
}
- $template->assign_block_vars('custom_tags', array(
+ $custom_tags = array(
'BBCODE_NAME' => "'[{$row['bbcode_tag']}]', '[/" . str_replace('=', '', $row['bbcode_tag']) . "]'",
'BBCODE_ID' => $num_predefined_bbcodes + ($i * 2),
'BBCODE_TAG' => $row['bbcode_tag'],
+ 'BBCODE_TAG_CLEAN' => str_replace('=', '-', $row['bbcode_tag']),
'BBCODE_HELPLINE' => $row['bbcode_helpline'],
'A_BBCODE_HELPLINE' => str_replace(array('&amp;', '&quot;', "'", '&lt;', '&gt;'), array('&', '"', "\'", '<', '>'), $row['bbcode_helpline']),
- ));
+ );
+
+ /**
+ * Event to modify the template data block of a custom bbcode
+ *
+ * This event is triggered once per bbcode
+ *
+ * @event core.display_custom_bbcodes_modify_row
+ * @var array custom_tags Template data of the bbcode
+ * @var array row The data of the bbcode
+ * @since 3.1.0-a1
+ */
+ $vars = array('custom_tags', 'row');
+ extract($phpbb_dispatcher->trigger_event('core.display_custom_bbcodes_modify_row', compact($vars)));
+
+ $template->assign_block_vars('custom_tags', $custom_tags);
$i++;
}
$db->sql_freeresult($result);
+
+ /**
+ * Display custom bbcodes
+ *
+ * @event core.display_custom_bbcodes
+ * @since 3.1.0-a1
+ */
+ $phpbb_dispatcher->dispatch('core.display_custom_bbcodes');
}
/**
@@ -958,6 +1179,7 @@ function display_user_activity(&$userdata)
{
global $auth, $template, $db, $user;
global $phpbb_root_path, $phpEx;
+ global $phpbb_container, $phpbb_dispatcher;
// Do not display user activity for users having more than 5000 posts...
if ($userdata['user_posts'] > 5000)
@@ -967,75 +1189,79 @@ function display_user_activity(&$userdata)
$forum_ary = array();
- // Do not include those forums the user is not having read access to...
- $forum_read_ary = $auth->acl_getf('!f_read');
-
- foreach ($forum_read_ary as $forum_id => $not_allowed)
+ $forum_read_ary = $auth->acl_getf('f_read');
+ foreach ($forum_read_ary as $forum_id => $allowed)
{
- if ($not_allowed['f_read'])
+ if ($allowed['f_read'])
{
$forum_ary[] = (int) $forum_id;
}
}
- $forum_ary = array_unique($forum_ary);
- $forum_sql = (sizeof($forum_ary)) ? 'AND ' . $db->sql_in_set('forum_id', $forum_ary, true) : '';
-
- $fid_m_approve = $auth->acl_getf('m_approve', true);
- $sql_m_approve = (!empty($fid_m_approve)) ? 'OR ' . $db->sql_in_set('forum_id', array_keys($fid_m_approve)) : '';
-
- // Obtain active forum
- $sql = 'SELECT forum_id, COUNT(post_id) AS num_posts
- FROM ' . POSTS_TABLE . '
- WHERE poster_id = ' . $userdata['user_id'] . "
- AND post_postcount = 1
- AND (post_approved = 1
- $sql_m_approve)
- $forum_sql
- GROUP BY forum_id
- ORDER BY num_posts DESC";
- $result = $db->sql_query_limit($sql, 1);
- $active_f_row = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
+ $forum_ary = array_diff($forum_ary, $user->get_passworded_forums());
- if (!empty($active_f_row))
+ $active_f_row = $active_t_row = array();
+ if (!empty($forum_ary))
{
- $sql = 'SELECT forum_name
- FROM ' . FORUMS_TABLE . '
- WHERE forum_id = ' . $active_f_row['forum_id'];
- $result = $db->sql_query($sql, 3600);
- $active_f_row['forum_name'] = (string) $db->sql_fetchfield('forum_name');
+ $phpbb_content_visibility = $phpbb_container->get('content.visibility');
+
+ // Obtain active forum
+ $sql = 'SELECT forum_id, COUNT(post_id) AS num_posts
+ FROM ' . POSTS_TABLE . '
+ WHERE poster_id = ' . $userdata['user_id'] . '
+ AND post_postcount = 1
+ AND ' . $phpbb_content_visibility->get_forums_visibility_sql('post', $forum_ary) . '
+ GROUP BY forum_id
+ ORDER BY num_posts DESC';
+ $result = $db->sql_query_limit($sql, 1);
+ $active_f_row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
- }
- // Obtain active topic
- // We need to exclude passworded forums here so we do not leak the topic title
- $forum_ary_topic = array_unique(array_merge($forum_ary, $user->get_passworded_forums()));
- $forum_sql_topic = (!empty($forum_ary_topic)) ? 'AND ' . $db->sql_in_set('forum_id', $forum_ary_topic, true) : '';
-
- $sql = 'SELECT topic_id, COUNT(post_id) AS num_posts
- FROM ' . POSTS_TABLE . '
- WHERE poster_id = ' . $userdata['user_id'] . "
- AND post_postcount = 1
- AND (post_approved = 1
- $sql_m_approve)
- $forum_sql_topic
- GROUP BY topic_id
- ORDER BY num_posts DESC";
- $result = $db->sql_query_limit($sql, 1);
- $active_t_row = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
+ if (!empty($active_f_row))
+ {
+ $sql = 'SELECT forum_name
+ FROM ' . FORUMS_TABLE . '
+ WHERE forum_id = ' . $active_f_row['forum_id'];
+ $result = $db->sql_query($sql, 3600);
+ $active_f_row['forum_name'] = (string) $db->sql_fetchfield('forum_name');
+ $db->sql_freeresult($result);
+ }
- if (!empty($active_t_row))
- {
- $sql = 'SELECT topic_title
- FROM ' . TOPICS_TABLE . '
- WHERE topic_id = ' . $active_t_row['topic_id'];
- $result = $db->sql_query($sql);
- $active_t_row['topic_title'] = (string) $db->sql_fetchfield('topic_title');
+ // Obtain active topic
+ $sql = 'SELECT topic_id, COUNT(post_id) AS num_posts
+ FROM ' . POSTS_TABLE . '
+ WHERE poster_id = ' . $userdata['user_id'] . '
+ AND post_postcount = 1
+ AND ' . $phpbb_content_visibility->get_forums_visibility_sql('post', $forum_ary) . '
+ GROUP BY topic_id
+ ORDER BY num_posts DESC';
+ $result = $db->sql_query_limit($sql, 1);
+ $active_t_row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
+
+ if (!empty($active_t_row))
+ {
+ $sql = 'SELECT topic_title
+ FROM ' . TOPICS_TABLE . '
+ WHERE topic_id = ' . $active_t_row['topic_id'];
+ $result = $db->sql_query($sql);
+ $active_t_row['topic_title'] = (string) $db->sql_fetchfield('topic_title');
+ $db->sql_freeresult($result);
+ }
}
+ /**
+ * Alter list of forums and topics to display as active
+ *
+ * @event core.display_user_activity_modify_actives
+ * @var array userdata User's data
+ * @var array active_f_row List of active forums
+ * @var array active_t_row List of active posts
+ * @since 3.1.0-RC3
+ */
+ $vars = array('userdata', 'active_f_row', 'active_t_row');
+ extract($phpbb_dispatcher->trigger_event('core.display_user_activity_modify_actives', compact($vars)));
+
$userdata['active_t_row'] = $active_t_row;
$userdata['active_f_row'] = $active_f_row;
@@ -1061,10 +1287,10 @@ function display_user_activity(&$userdata)
$template->assign_vars(array(
'ACTIVE_FORUM' => $active_f_name,
- 'ACTIVE_FORUM_POSTS' => ($active_f_count == 1) ? sprintf($user->lang['USER_POST'], 1) : sprintf($user->lang['USER_POSTS'], $active_f_count),
+ 'ACTIVE_FORUM_POSTS' => $user->lang('USER_POSTS', (int) $active_f_count),
'ACTIVE_FORUM_PCT' => sprintf($l_active_pct, $active_f_pct),
'ACTIVE_TOPIC' => censor_text($active_t_name),
- 'ACTIVE_TOPIC_POSTS' => ($active_t_count == 1) ? sprintf($user->lang['USER_POST'], 1) : sprintf($user->lang['USER_POSTS'], $active_t_count),
+ 'ACTIVE_TOPIC_POSTS' => $user->lang('USER_POSTS', (int) $active_t_count),
'ACTIVE_TOPIC_PCT' => sprintf($l_active_pct, $active_t_pct),
'U_ACTIVE_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $active_f_id),
'U_ACTIVE_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 't=' . $active_t_id),
@@ -1078,6 +1304,7 @@ function display_user_activity(&$userdata)
function watch_topic_forum($mode, &$s_watching, $user_id, $forum_id, $topic_id, $notify_status = 'unset', $start = 0, $item_title = '')
{
global $template, $db, $user, $phpEx, $start, $phpbb_root_path;
+ global $request;
$table_sql = ($mode == 'forum') ? FORUMS_WATCH_TABLE : TOPICS_WATCH_TABLE;
$where_sql = ($mode == 'forum') ? 'forum_id' : 'topic_id';
@@ -1086,7 +1313,7 @@ function watch_topic_forum($mode, &$s_watching, $user_id, $forum_id, $topic_id,
$u_url .= ($mode == 'forum') ? '&amp;f' : '&amp;f=' . $forum_id . '&amp;t';
$is_watching = 0;
- // Is user watching this thread?
+ // Is user watching this topic?
if ($user_id != ANONYMOUS)
{
$can_watch = true;
@@ -1105,7 +1332,6 @@ function watch_topic_forum($mode, &$s_watching, $user_id, $forum_id, $topic_id,
if (!is_null($notify_status) && $notify_status !== '')
{
-
if (isset($_GET['unwatch']))
{
$uid = request_var('uid', 0);
@@ -1113,10 +1339,15 @@ function watch_topic_forum($mode, &$s_watching, $user_id, $forum_id, $topic_id,
if ($token && check_link_hash($token, "{$mode}_$match_id") || confirm_box(true))
{
- if ($uid != $user_id || $_GET['unwatch'] != $mode)
+ if ($uid != $user_id || $request->variable('unwatch', '', false, \phpbb\request\request_interface::GET) != $mode)
{
$redirect_url = append_sid("{$phpbb_root_path}view$mode.$phpEx", "$u_url=$match_id&amp;start=$start");
- $message = $user->lang['ERR_UNWATCHING'] . '<br /><br />' . sprintf($user->lang['RETURN_' . strtoupper($mode)], '<a href="' . $redirect_url . '">', '</a>');
+ $message = $user->lang['ERR_UNWATCHING'];
+
+ if (!$request->is_ajax())
+ {
+ $message .= '<br /><br />' . $user->lang('RETURN_' . strtoupper($mode), '<a href="' . $redirect_url . '">', '</a>');
+ }
trigger_error($message);
}
@@ -1126,8 +1357,12 @@ function watch_topic_forum($mode, &$s_watching, $user_id, $forum_id, $topic_id,
$db->sql_query($sql);
$redirect_url = append_sid("{$phpbb_root_path}view$mode.$phpEx", "$u_url=$match_id&amp;start=$start");
- $message = $user->lang['NOT_WATCHING_' . strtoupper($mode)] . '<br /><br />';
- $message .= sprintf($user->lang['RETURN_' . strtoupper($mode)], '<a href="' . $redirect_url . '">', '</a>');
+ $message = $user->lang['NOT_WATCHING_' . strtoupper($mode)];
+
+ if (!$request->is_ajax())
+ {
+ $message .= '<br /><br />' . $user->lang('RETURN_' . strtoupper($mode), '<a href="' . $redirect_url . '">', '</a>');
+ }
meta_refresh(3, $redirect_url);
trigger_error($message);
}
@@ -1178,10 +1413,15 @@ function watch_topic_forum($mode, &$s_watching, $user_id, $forum_id, $topic_id,
if ($token && check_link_hash($token, "{$mode}_$match_id") || confirm_box(true))
{
- if ($uid != $user_id || $_GET['watch'] != $mode)
+ if ($uid != $user_id || $request->variable('watch', '', false, \phpbb\request\request_interface::GET) != $mode)
{
$redirect_url = append_sid("{$phpbb_root_path}view$mode.$phpEx", "$u_url=$match_id&amp;start=$start");
- $message = $user->lang['ERR_WATCHING'] . '<br /><br />' . sprintf($user->lang['RETURN_' . strtoupper($mode)], '<a href="' . $redirect_url . '">', '</a>');
+ $message = $user->lang['ERR_WATCHING'];
+
+ if (!$request->is_ajax())
+ {
+ $message .= '<br /><br />' . $user->lang('RETURN_' . strtoupper($mode), '<a href="' . $redirect_url . '">', '</a>');
+ }
trigger_error($message);
}
@@ -1192,7 +1432,12 @@ function watch_topic_forum($mode, &$s_watching, $user_id, $forum_id, $topic_id,
$db->sql_query($sql);
$redirect_url = append_sid("{$phpbb_root_path}view$mode.$phpEx", "$u_url=$match_id&amp;start=$start");
- $message = $user->lang['ARE_WATCHING_' . strtoupper($mode)] . '<br /><br />' . sprintf($user->lang['RETURN_' . strtoupper($mode)], '<a href="' . $redirect_url . '">', '</a>');
+ $message = $user->lang['ARE_WATCHING_' . strtoupper($mode)];
+
+ if (!$request->is_ajax())
+ {
+ $message .= '<br /><br />' . $user->lang('RETURN_' . strtoupper($mode), '<a href="' . $redirect_url . '">', '</a>');
+ }
meta_refresh(3, $redirect_url);
trigger_error($message);
}
@@ -1221,7 +1466,8 @@ function watch_topic_forum($mode, &$s_watching, $user_id, $forum_id, $topic_id,
}
else
{
- if ((isset($_GET['unwatch']) && $_GET['unwatch'] == $mode) || (isset($_GET['watch']) && $_GET['watch'] == $mode))
+ if ((isset($_GET['unwatch']) && $request->variable('unwatch', '', false, \phpbb\request\request_interface::GET) == $mode) ||
+ (isset($_GET['watch']) && $request->variable('watch', '', false, \phpbb\request\request_interface::GET) == $mode))
{
login_box();
}
@@ -1235,7 +1481,9 @@ function watch_topic_forum($mode, &$s_watching, $user_id, $forum_id, $topic_id,
if ($can_watch)
{
$s_watching['link'] = append_sid("{$phpbb_root_path}view$mode.$phpEx", "$u_url=$match_id&amp;" . (($is_watching) ? 'unwatch' : 'watch') . "=$mode&amp;start=$start&amp;hash=" . generate_link_hash("{$mode}_$match_id"));
+ $s_watching['link_toggle'] = append_sid("{$phpbb_root_path}view$mode.$phpEx", "$u_url=$match_id&amp;" . ((!$is_watching) ? 'unwatch' : 'watch') . "=$mode&amp;start=$start&amp;hash=" . generate_link_hash("{$mode}_$match_id"));
$s_watching['title'] = $user->lang[(($is_watching) ? 'STOP' : 'START') . '_WATCHING_' . strtoupper($mode)];
+ $s_watching['title_toggle'] = $user->lang[((!$is_watching) ? 'STOP' : 'START') . '_WATCHING_' . strtoupper($mode)];
$s_watching['is_watching'] = $is_watching;
}
@@ -1245,17 +1493,34 @@ function watch_topic_forum($mode, &$s_watching, $user_id, $forum_id, $topic_id,
/**
* Get user rank title and image
*
-* @param int $user_rank the current stored users rank id
+* @param array $user_data the current stored users data
* @param int $user_posts the users number of posts
-* @param string &$rank_title the rank title will be stored here after execution
-* @param string &$rank_img the rank image as full img tag is stored here after execution
-* @param string &$rank_img_src the rank image source is stored here after execution
+*
+* @return array An associative array containing the rank title (title), the rank image as full img tag (img) and the rank image source (img_src)
*
* Note: since we do not want to break backwards-compatibility, this function will only properly assign ranks to guests if you call it for them with user_posts == false
*/
-function get_user_rank($user_rank, $user_posts, &$rank_title, &$rank_img, &$rank_img_src)
+function phpbb_get_user_rank($user_data, $user_posts)
{
- global $ranks, $config, $phpbb_root_path;
+ global $ranks, $config, $phpbb_root_path, $phpbb_path_helper, $phpbb_dispatcher;
+
+ $user_rank_data = array(
+ 'title' => null,
+ 'img' => null,
+ 'img_src' => null,
+ );
+
+ /**
+ * Preparing a user's rank before displaying
+ *
+ * @event core.modify_user_rank
+ * @var array user_data Array with user's data
+ * @var int user_posts User_posts to change
+ * @since 3.1.0-RC4
+ */
+
+ $vars = array('user_data', 'user_posts');
+ extract($phpbb_dispatcher->trigger_event('core.modify_user_rank', compact($vars)));
if (empty($ranks))
{
@@ -1263,11 +1528,14 @@ function get_user_rank($user_rank, $user_posts, &$rank_title, &$rank_img, &$rank
$ranks = $cache->obtain_ranks();
}
- if (!empty($user_rank))
+ if (!empty($user_data['user_rank']))
{
- $rank_title = (isset($ranks['special'][$user_rank]['rank_title'])) ? $ranks['special'][$user_rank]['rank_title'] : '';
- $rank_img = (!empty($ranks['special'][$user_rank]['rank_image'])) ? '<img src="' . $phpbb_root_path . $config['ranks_path'] . '/' . $ranks['special'][$user_rank]['rank_image'] . '" alt="' . $ranks['special'][$user_rank]['rank_title'] . '" title="' . $ranks['special'][$user_rank]['rank_title'] . '" />' : '';
- $rank_img_src = (!empty($ranks['special'][$user_rank]['rank_image'])) ? $phpbb_root_path . $config['ranks_path'] . '/' . $ranks['special'][$user_rank]['rank_image'] : '';
+
+ $user_rank_data['title'] = (isset($ranks['special'][$user_data['user_rank']]['rank_title'])) ? $ranks['special'][$user_data['user_rank']]['rank_title'] : '';
+
+ $user_rank_data['img_src'] = (!empty($ranks['special'][$user_data['user_rank']]['rank_image'])) ? $phpbb_path_helper->update_web_root_path($phpbb_root_path . $config['ranks_path'] . '/' . $ranks['special'][$user_data['user_rank']]['rank_image']) : '';
+
+ $user_rank_data['img'] = (!empty($ranks['special'][$user_data['user_rank']]['rank_image'])) ? '<img src="' . $user_rank_data['img_src'] . '" alt="' . $ranks['special'][$user_data['user_rank']]['rank_title'] . '" title="' . $ranks['special'][$user_data['user_rank']]['rank_title'] . '" />' : '';
}
else if ($user_posts !== false)
{
@@ -1277,67 +1545,193 @@ function get_user_rank($user_rank, $user_posts, &$rank_title, &$rank_img, &$rank
{
if ($user_posts >= $rank['rank_min'])
{
- $rank_title = $rank['rank_title'];
- $rank_img = (!empty($rank['rank_image'])) ? '<img src="' . $phpbb_root_path . $config['ranks_path'] . '/' . $rank['rank_image'] . '" alt="' . $rank['rank_title'] . '" title="' . $rank['rank_title'] . '" />' : '';
- $rank_img_src = (!empty($rank['rank_image'])) ? $phpbb_root_path . $config['ranks_path'] . '/' . $rank['rank_image'] : '';
+ $user_rank_data['title'] = $rank['rank_title'];
+ $user_rank_data['img_src'] = (!empty($rank['rank_image'])) ? $phpbb_path_helper->update_web_root_path($phpbb_root_path . $config['ranks_path'] . '/' . $rank['rank_image']) : '';
+ $user_rank_data['img'] = (!empty($rank['rank_image'])) ? '<img src="' . $user_rank_data['img_src'] . '" alt="' . $rank['rank_title'] . '" title="' . $rank['rank_title'] . '" />' : '';
break;
}
}
}
}
+
+ /**
+ * Modify a user's rank before displaying
+ *
+ * @event core.get_user_rank_after
+ * @var array user_data Array with user's data
+ * @var int user_posts User_posts to change
+ * @var array user_rank_data User rank data
+ * @since 3.1.11-RC1
+ */
+
+ $vars = array(
+ 'user_data',
+ 'user_posts',
+ 'user_rank_data',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.get_user_rank_after', compact($vars)));
+
+ return $user_rank_data;
}
/**
-* Get user avatar
-*
-* @param string $avatar Users assigned avatar name
-* @param int $avatar_type Type of avatar
-* @param string $avatar_width Width of users avatar
-* @param string $avatar_height Height of users avatar
-* @param string $alt Optional language string for alt tag within image, can be a language key or text
-* @param bool $ignore_config Ignores the config-setting, to be still able to view the avatar in the UCP
-*
-* @return string Avatar image
+* Prepare profile data
*/
-function get_user_avatar($avatar, $avatar_type, $avatar_width, $avatar_height, $alt = 'USER_AVATAR', $ignore_config = false)
+function phpbb_show_profile($data, $user_notes_enabled = false, $warn_user_enabled = false, $check_can_receive_pm = true)
{
- global $user, $config, $phpbb_root_path, $phpEx;
+ global $config, $auth, $user, $phpEx, $phpbb_root_path, $phpbb_dispatcher;
+
+ $username = $data['username'];
+ $user_id = $data['user_id'];
- if (empty($avatar) || !$avatar_type || (!$config['allow_avatar'] && !$ignore_config))
+ $user_rank_data = phpbb_get_user_rank($data, (($user_id == ANONYMOUS) ? false : $data['user_posts']));
+
+ if ((!empty($data['user_allow_viewemail']) && $auth->acl_get('u_sendemail')) || $auth->acl_get('a_user'))
{
- return '';
+ $email = ($config['board_email_form'] && $config['email_enable']) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=email&amp;u=' . $user_id) : (($config['board_hide_emails'] && !$auth->acl_get('a_user')) ? '' : 'mailto:' . $data['user_email']);
+ }
+ else
+ {
+ $email = '';
}
- $avatar_img = '';
+ if ($config['load_onlinetrack'])
+ {
+ $update_time = $config['load_online_time'] * 60;
+ $online = (time() - $update_time < $data['session_time'] && ((isset($data['session_viewonline']) && $data['session_viewonline']) || $auth->acl_get('u_viewonline'))) ? true : false;
+ }
+ else
+ {
+ $online = false;
+ }
- switch ($avatar_type)
+ if ($data['user_allow_viewonline'] || $auth->acl_get('u_viewonline'))
{
- case AVATAR_UPLOAD:
- if (!$config['allow_avatar_upload'] && !$ignore_config)
- {
- return '';
- }
- $avatar_img = $phpbb_root_path . "download/file.$phpEx?avatar=";
- break;
+ $last_active = (!empty($data['session_time'])) ? $data['session_time'] : $data['user_lastvisit'];
+ }
+ else
+ {
+ $last_active = '';
+ }
+
+ $age = '';
- case AVATAR_GALLERY:
- if (!$config['allow_avatar_local'] && !$ignore_config)
+ if ($config['allow_birthdays'] && $data['user_birthday'])
+ {
+ list($bday_day, $bday_month, $bday_year) = array_map('intval', explode('-', $data['user_birthday']));
+
+ if ($bday_year)
+ {
+ $now = $user->create_datetime();
+ $now = phpbb_gmgetdate($now->getTimestamp() + $now->getOffset());
+
+ $diff = $now['mon'] - $bday_month;
+ if ($diff == 0)
{
- return '';
+ $diff = ($now['mday'] - $bday_day < 0) ? 1 : 0;
}
- $avatar_img = $phpbb_root_path . $config['avatar_gallery_path'] . '/';
- break;
-
- case AVATAR_REMOTE:
- if (!$config['allow_avatar_remote'] && !$ignore_config)
+ else
{
- return '';
+ $diff = ($diff < 0) ? 1 : 0;
}
- break;
+
+ $age = max(0, (int) ($now['year'] - $bday_year - $diff));
+ }
}
- $avatar_img .= $avatar;
- return '<img src="' . (str_replace(' ', '%20', $avatar_img)) . '" width="' . $avatar_width . '" height="' . $avatar_height . '" alt="' . ((!empty($user->lang[$alt])) ? $user->lang[$alt] : $alt) . '" />';
+ if (!function_exists('phpbb_get_banned_user_ids'))
+ {
+ include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
+ }
+
+ // Can this user receive a Private Message?
+ $can_receive_pm = $check_can_receive_pm && (
+ // They must be a "normal" user
+ $data['user_type'] != USER_IGNORE &&
+
+ // They must not be deactivated by the administrator
+ ($data['user_type'] != USER_INACTIVE || $data['user_inactive_reason'] != INACTIVE_MANUAL) &&
+
+ // They must be able to read PMs
+ sizeof($auth->acl_get_list($user_id, 'u_readpm')) &&
+
+ // They must not be permanently banned
+ !sizeof(phpbb_get_banned_user_ids($user_id, false)) &&
+
+ // They must allow users to contact via PM
+ (($auth->acl_gets('a_', 'm_') || $auth->acl_getf_global('m_')) || $data['user_allow_pm'])
+ );
+
+ // Dump it out to the template
+ $template_data = array(
+ 'AGE' => $age,
+ 'RANK_TITLE' => $user_rank_data['title'],
+ 'JOINED' => $user->format_date($data['user_regdate']),
+ 'LAST_ACTIVE' => (empty($last_active)) ? ' - ' : $user->format_date($last_active),
+ 'POSTS' => ($data['user_posts']) ? $data['user_posts'] : 0,
+ 'WARNINGS' => isset($data['user_warnings']) ? $data['user_warnings'] : 0,
+
+ 'USERNAME_FULL' => get_username_string('full', $user_id, $username, $data['user_colour']),
+ 'USERNAME' => get_username_string('username', $user_id, $username, $data['user_colour']),
+ 'USER_COLOR' => get_username_string('colour', $user_id, $username, $data['user_colour']),
+ 'U_VIEW_PROFILE' => get_username_string('profile', $user_id, $username, $data['user_colour']),
+
+ 'A_USERNAME' => addslashes(get_username_string('username', $user_id, $username, $data['user_colour'])),
+
+ 'AVATAR_IMG' => phpbb_get_user_avatar($data),
+ 'ONLINE_IMG' => (!$config['load_onlinetrack']) ? '' : (($online) ? $user->img('icon_user_online', 'ONLINE') : $user->img('icon_user_offline', 'OFFLINE')),
+ 'S_ONLINE' => ($config['load_onlinetrack'] && $online) ? true : false,
+ 'RANK_IMG' => $user_rank_data['img'],
+ 'RANK_IMG_SRC' => $user_rank_data['img_src'],
+ 'S_JABBER_ENABLED' => ($config['jab_enable']) ? true : false,
+
+ 'S_WARNINGS' => ($auth->acl_getf_global('m_') || $auth->acl_get('m_warn')) ? true : false,
+
+ 'U_SEARCH_USER' => ($auth->acl_get('u_search')) ? append_sid("{$phpbb_root_path}search.$phpEx", "author_id=$user_id&amp;sr=posts") : '',
+ 'U_NOTES' => ($user_notes_enabled && $auth->acl_getf_global('m_')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&amp;mode=user_notes&amp;u=' . $user_id, true, $user->session_id) : '',
+ 'U_WARN' => ($warn_user_enabled && $auth->acl_get('m_warn')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=warn&amp;mode=warn_user&amp;u=' . $user_id, true, $user->session_id) : '',
+ 'U_PM' => ($config['allow_privmsg'] && $auth->acl_get('u_sendpm') && $can_receive_pm) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&amp;mode=compose&amp;u=' . $user_id) : '',
+ 'U_EMAIL' => $email,
+ 'U_JABBER' => ($data['user_jabber'] && $auth->acl_get('u_sendim')) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=contact&amp;action=jabber&amp;u=' . $user_id) : '',
+
+ 'USER_JABBER' => ($config['jab_enable']) ? $data['user_jabber'] : '',
+ 'USER_JABBER_IMG' => ($config['jab_enable'] && $data['user_jabber']) ? $user->img('icon_contact_jabber', $data['user_jabber']) : '',
+
+ 'L_SEND_EMAIL_USER' => $user->lang('SEND_EMAIL_USER', $username),
+ 'L_CONTACT_USER' => $user->lang('CONTACT_USER', $username),
+ 'L_VIEWING_PROFILE' => $user->lang('VIEWING_PROFILE', $username),
+ );
+
+ /**
+ * Preparing a user's data before displaying it in profile and memberlist
+ *
+ * @event core.memberlist_prepare_profile_data
+ * @var array data Array with user's data
+ * @var array template_data Template array with user's data
+ * @since 3.1.0-a1
+ */
+ $vars = array('data', 'template_data');
+ extract($phpbb_dispatcher->trigger_event('core.memberlist_prepare_profile_data', compact($vars)));
+
+ return $template_data;
}
-?> \ No newline at end of file
+function phpbb_sort_last_active($first, $second)
+{
+ global $id_cache, $sort_dir;
+
+ $lesser_than = ($sort_dir === 'd') ? -1 : 1;
+
+ if (isset($id_cache[$first]['group_leader']) && $id_cache[$first]['group_leader'] && (!isset($id_cache[$second]['group_leader']) || !$id_cache[$second]['group_leader']))
+ {
+ return -1;
+ }
+ else if (isset($id_cache[$second]['group_leader']) && (!isset($id_cache[$first]['group_leader']) || !$id_cache[$first]['group_leader']) && $id_cache[$second]['group_leader'])
+ {
+ return 1;
+ }
+ else
+ {
+ return $lesser_than * (int) ($id_cache[$first]['last_visit'] - $id_cache[$second]['last_visit']);
+ }
+}
diff --git a/phpBB/includes/functions_download.php b/phpBB/includes/functions_download.php
new file mode 100644
index 0000000000..053e362682
--- /dev/null
+++ b/phpBB/includes/functions_download.php
@@ -0,0 +1,774 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+/**
+* @ignore
+*/
+if (!defined('IN_PHPBB'))
+{
+ exit;
+}
+
+/**
+* A simplified function to deliver avatars
+* The argument needs to be checked before calling this function.
+*/
+function send_avatar_to_browser($file, $browser)
+{
+ global $config, $phpbb_root_path;
+
+ $prefix = $config['avatar_salt'] . '_';
+ $image_dir = $config['avatar_path'];
+
+ // Adjust image_dir path (no trailing slash)
+ if (substr($image_dir, -1, 1) == '/' || substr($image_dir, -1, 1) == '\\')
+ {
+ $image_dir = substr($image_dir, 0, -1) . '/';
+ }
+ $image_dir = str_replace(array('../', '..\\', './', '.\\'), '', $image_dir);
+
+ if ($image_dir && ($image_dir[0] == '/' || $image_dir[0] == '\\'))
+ {
+ $image_dir = '';
+ }
+ $file_path = $phpbb_root_path . $image_dir . '/' . $prefix . $file;
+
+ if ((@file_exists($file_path) && @is_readable($file_path)) && !headers_sent())
+ {
+ header('Cache-Control: public');
+
+ $image_data = @getimagesize($file_path);
+ header('Content-Type: ' . image_type_to_mime_type($image_data[2]));
+
+ if ((strpos(strtolower($browser), 'msie') !== false) && !phpbb_is_greater_ie_version($browser, 7))
+ {
+ header('Content-Disposition: attachment; ' . header_filename($file));
+
+ if (strpos(strtolower($browser), 'msie 6.0') !== false)
+ {
+ header('Expires: ' . gmdate('D, d M Y H:i:s', time()) . ' GMT');
+ }
+ else
+ {
+ header('Expires: ' . gmdate('D, d M Y H:i:s', time() + 31536000) . ' GMT');
+ }
+ }
+ else
+ {
+ header('Content-Disposition: inline; ' . header_filename($file));
+ header('Expires: ' . gmdate('D, d M Y H:i:s', time() + 31536000) . ' GMT');
+ }
+
+ $size = @filesize($file_path);
+ if ($size)
+ {
+ header("Content-Length: $size");
+ }
+
+ if (@readfile($file_path) == false)
+ {
+ $fp = @fopen($file_path, 'rb');
+
+ if ($fp !== false)
+ {
+ while (!feof($fp))
+ {
+ echo fread($fp, 8192);
+ }
+ fclose($fp);
+ }
+ }
+
+ flush();
+ }
+ else
+ {
+ header('HTTP/1.0 404 Not Found');
+ }
+}
+
+/**
+* Wraps an url into a simple html page. Used to display attachments in IE.
+* this is a workaround for now; might be moved to template system later
+* direct any complaints to 1 Microsoft Way, Redmond
+*/
+function wrap_img_in_html($src, $title)
+{
+ echo '<!DOCTYPE html>';
+ echo '<html>';
+ echo '<head>';
+ echo '<meta charset="utf-8">';
+ echo '<meta http-equiv="X-UA-Compatible" content="IE=edge">';
+ echo '<title>' . $title . '</title>';
+ echo '</head>';
+ echo '<body>';
+ echo '<div>';
+ echo '<img src="' . $src . '" alt="' . $title . '" />';
+ echo '</div>';
+ echo '</body>';
+ echo '</html>';
+}
+
+/**
+* Send file to browser
+*/
+function send_file_to_browser($attachment, $upload_dir, $category)
+{
+ global $user, $db, $config, $phpbb_dispatcher, $phpbb_root_path;
+
+ $filename = $phpbb_root_path . $upload_dir . '/' . $attachment['physical_filename'];
+
+ if (!@file_exists($filename))
+ {
+ send_status_line(404, 'Not Found');
+ trigger_error('ERROR_NO_ATTACHMENT');
+ }
+
+ // Correct the mime type - we force application/octetstream for all files, except images
+ // Please do not change this, it is a security precaution
+ if ($category != ATTACHMENT_CATEGORY_IMAGE || strpos($attachment['mimetype'], 'image') !== 0)
+ {
+ $attachment['mimetype'] = (strpos(strtolower($user->browser), 'msie') !== false || strpos(strtolower($user->browser), 'opera') !== false) ? 'application/octetstream' : 'application/octet-stream';
+ }
+
+ if (@ob_get_length())
+ {
+ @ob_end_clean();
+ }
+
+ // Now send the File Contents to the Browser
+ $size = @filesize($filename);
+
+ /**
+ * Event to alter attachment before it is sent to browser.
+ *
+ * @event core.send_file_to_browser_before
+ * @var array attachment Attachment data
+ * @var string upload_dir Relative path of upload directory
+ * @var int category Attachment category
+ * @var string filename Path to file, including filename
+ * @var int size File size
+ * @since 3.1.11-RC1
+ */
+ $vars = array(
+ 'attachment',
+ 'upload_dir',
+ 'category',
+ 'filename',
+ 'size',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.send_file_to_browser_before', compact($vars)));
+
+ // To correctly display further errors we need to make sure we are using the correct headers for both (unsetting content-length may not work)
+
+ // Check if headers already sent or not able to get the file contents.
+ if (headers_sent() || !@file_exists($filename) || !@is_readable($filename))
+ {
+ // PHP track_errors setting On?
+ if (!empty($php_errormsg))
+ {
+ send_status_line(500, 'Internal Server Error');
+ trigger_error($user->lang['UNABLE_TO_DELIVER_FILE'] . '<br />' . sprintf($user->lang['TRACKED_PHP_ERROR'], $php_errormsg));
+ }
+
+ send_status_line(500, 'Internal Server Error');
+ trigger_error('UNABLE_TO_DELIVER_FILE');
+ }
+
+ // Make sure the database record for the filesize is correct
+ if ($size > 0 && $size != $attachment['filesize'] && strpos($attachment['physical_filename'], 'thumb_') === false)
+ {
+ // Update database record
+ $sql = 'UPDATE ' . ATTACHMENTS_TABLE . '
+ SET filesize = ' . (int) $size . '
+ WHERE attach_id = ' . (int) $attachment['attach_id'];
+ $db->sql_query($sql);
+ }
+
+ // Now the tricky part... let's dance
+ header('Cache-Control: public');
+
+ // Send out the Headers. Do not set Content-Disposition to inline please, it is a security measure for users using the Internet Explorer.
+ header('Content-Type: ' . $attachment['mimetype']);
+
+ if (phpbb_is_greater_ie_version($user->browser, 7))
+ {
+ header('X-Content-Type-Options: nosniff');
+ }
+
+ if ($category == ATTACHMENT_CATEGORY_FLASH && request_var('view', 0) === 1)
+ {
+ // We use content-disposition: inline for flash files and view=1 to let it correctly play with flash player 10 - any other disposition will fail to play inline
+ header('Content-Disposition: inline');
+ }
+ else
+ {
+ if (empty($user->browser) || ((strpos(strtolower($user->browser), 'msie') !== false) && !phpbb_is_greater_ie_version($user->browser, 7)))
+ {
+ header('Content-Disposition: attachment; ' . header_filename(htmlspecialchars_decode($attachment['real_filename'])));
+ if (empty($user->browser) || (strpos(strtolower($user->browser), 'msie 6.0') !== false))
+ {
+ header('Expires: ' . gmdate('D, d M Y H:i:s', time()) . ' GMT');
+ }
+ }
+ else
+ {
+ header('Content-Disposition: ' . ((strpos($attachment['mimetype'], 'image') === 0) ? 'inline' : 'attachment') . '; ' . header_filename(htmlspecialchars_decode($attachment['real_filename'])));
+ if (phpbb_is_greater_ie_version($user->browser, 7) && (strpos($attachment['mimetype'], 'image') !== 0))
+ {
+ header('X-Download-Options: noopen');
+ }
+ }
+ }
+
+ // Close the db connection before sending the file etc.
+ file_gc(false);
+
+ if (!set_modified_headers($attachment['filetime'], $user->browser))
+ {
+ // We make sure those have to be enabled manually by defining a constant
+ // because of the potential disclosure of full attachment path
+ // in case support for features is absent in the webserver software.
+ if (defined('PHPBB_ENABLE_X_ACCEL_REDIRECT') && PHPBB_ENABLE_X_ACCEL_REDIRECT)
+ {
+ // X-Accel-Redirect - http://wiki.nginx.org/XSendfile
+ header('X-Accel-Redirect: ' . $user->page['root_script_path'] . $upload_dir . '/' . $attachment['physical_filename']);
+ exit;
+ }
+ else if (defined('PHPBB_ENABLE_X_SENDFILE') && PHPBB_ENABLE_X_SENDFILE && !phpbb_http_byte_range($size))
+ {
+ // X-Sendfile - http://blog.lighttpd.net/articles/2006/07/02/x-sendfile
+ // Lighttpd's X-Sendfile does not support range requests as of 1.4.26
+ // and always requires an absolute path.
+ header('X-Sendfile: ' . dirname(__FILE__) . "/../$upload_dir/{$attachment['physical_filename']}");
+ exit;
+ }
+
+ if ($size)
+ {
+ header("Content-Length: $size");
+ }
+
+ // Try to deliver in chunks
+ @set_time_limit(0);
+
+ $fp = @fopen($filename, 'rb');
+
+ if ($fp !== false)
+ {
+ // Deliver file partially if requested
+ if ($range = phpbb_http_byte_range($size))
+ {
+ fseek($fp, $range['byte_pos_start']);
+
+ send_status_line(206, 'Partial Content');
+ header('Content-Range: bytes ' . $range['byte_pos_start'] . '-' . $range['byte_pos_end'] . '/' . $range['bytes_total']);
+ header('Content-Length: ' . $range['bytes_requested']);
+ }
+
+ while (!feof($fp))
+ {
+ echo fread($fp, 8192);
+ }
+ fclose($fp);
+ }
+ else
+ {
+ @readfile($filename);
+ }
+
+ flush();
+ }
+
+ exit;
+}
+
+/**
+* Get a browser friendly UTF-8 encoded filename
+*/
+function header_filename($file)
+{
+ global $request;
+
+ $user_agent = $request->header('User-Agent');
+
+ // There be dragons here.
+ // Not many follows the RFC...
+ if (strpos($user_agent, 'MSIE') !== false || strpos($user_agent, 'Konqueror') !== false)
+ {
+ return "filename=" . rawurlencode($file);
+ }
+
+ // follow the RFC for extended filename for the rest
+ return "filename*=UTF-8''" . rawurlencode($file);
+}
+
+/**
+* Check if downloading item is allowed
+*/
+function download_allowed()
+{
+ global $config, $user, $db, $request;
+
+ if (!$config['secure_downloads'])
+ {
+ return true;
+ }
+
+ $url = htmlspecialchars_decode($request->header('Referer'));
+
+ if (!$url)
+ {
+ return ($config['secure_allow_empty_referer']) ? true : false;
+ }
+
+ // Split URL into domain and script part
+ $url = @parse_url($url);
+
+ if ($url === false)
+ {
+ return ($config['secure_allow_empty_referer']) ? true : false;
+ }
+
+ $hostname = $url['host'];
+ unset($url);
+
+ $allowed = ($config['secure_allow_deny']) ? false : true;
+ $iplist = array();
+
+ if (($ip_ary = @gethostbynamel($hostname)) !== false)
+ {
+ foreach ($ip_ary as $ip)
+ {
+ if ($ip)
+ {
+ $iplist[] = $ip;
+ }
+ }
+ }
+
+ // Check for own server...
+ $server_name = $user->host;
+
+ // Forcing server vars is the only way to specify/override the protocol
+ if ($config['force_server_vars'] || !$server_name)
+ {
+ $server_name = $config['server_name'];
+ }
+
+ if (preg_match('#^.*?' . preg_quote($server_name, '#') . '.*?$#i', $hostname))
+ {
+ $allowed = true;
+ }
+
+ // Get IP's and Hostnames
+ if (!$allowed)
+ {
+ $sql = 'SELECT site_ip, site_hostname, ip_exclude
+ FROM ' . SITELIST_TABLE;
+ $result = $db->sql_query($sql);
+
+ while ($row = $db->sql_fetchrow($result))
+ {
+ $site_ip = trim($row['site_ip']);
+ $site_hostname = trim($row['site_hostname']);
+
+ if ($site_ip)
+ {
+ foreach ($iplist as $ip)
+ {
+ if (preg_match('#^' . str_replace('\*', '.*?', preg_quote($site_ip, '#')) . '$#i', $ip))
+ {
+ if ($row['ip_exclude'])
+ {
+ $allowed = ($config['secure_allow_deny']) ? false : true;
+ break 2;
+ }
+ else
+ {
+ $allowed = ($config['secure_allow_deny']) ? true : false;
+ }
+ }
+ }
+ }
+
+ if ($site_hostname)
+ {
+ if (preg_match('#^' . str_replace('\*', '.*?', preg_quote($site_hostname, '#')) . '$#i', $hostname))
+ {
+ if ($row['ip_exclude'])
+ {
+ $allowed = ($config['secure_allow_deny']) ? false : true;
+ break;
+ }
+ else
+ {
+ $allowed = ($config['secure_allow_deny']) ? true : false;
+ }
+ }
+ }
+ }
+ $db->sql_freeresult($result);
+ }
+
+ return $allowed;
+}
+
+/**
+* Check if the browser has the file already and set the appropriate headers-
+* @returns false if a resend is in order.
+*/
+function set_modified_headers($stamp, $browser)
+{
+ global $request;
+
+ // let's see if we have to send the file at all
+ $last_load = $request->header('If-Modified-Since') ? strtotime(trim($request->header('If-Modified-Since'))) : false;
+
+ if (strpos(strtolower($browser), 'msie 6.0') === false && !phpbb_is_greater_ie_version($browser, 7))
+ {
+ if ($last_load !== false && $last_load >= $stamp)
+ {
+ send_status_line(304, 'Not Modified');
+ // seems that we need those too ... browsers
+ header('Cache-Control: public');
+ header('Expires: ' . gmdate('D, d M Y H:i:s', time() + 31536000) . ' GMT');
+ return true;
+ }
+ else
+ {
+ header('Last-Modified: ' . gmdate('D, d M Y H:i:s', $stamp) . ' GMT');
+ }
+ }
+ return false;
+}
+
+/**
+* Garbage Collection
+*
+* @param bool $exit Whether to die or not.
+*
+* @return null
+*/
+function file_gc($exit = true)
+{
+ global $cache, $db;
+
+ if (!empty($cache))
+ {
+ $cache->unload();
+ }
+
+ $db->sql_close();
+
+ if ($exit)
+ {
+ exit;
+ }
+}
+
+/**
+* HTTP range support (RFC 2616 Section 14.35)
+*
+* Allows browsers to request partial file content
+* in case a download has been interrupted.
+*
+* @param int $filesize the size of the file in bytes we are about to deliver
+*
+* @return mixed false if the whole file has to be delivered
+* associative array on success
+*/
+function phpbb_http_byte_range($filesize)
+{
+ // Only call find_range_request() once.
+ static $request_array;
+
+ if (!$filesize)
+ {
+ return false;
+ }
+
+ if (!isset($request_array))
+ {
+ $request_array = phpbb_find_range_request();
+ }
+
+ return (empty($request_array)) ? false : phpbb_parse_range_request($request_array, $filesize);
+}
+
+/**
+* Searches for HTTP range request in request headers.
+*
+* @return mixed false if no request found
+* array of strings containing the requested ranges otherwise
+* e.g. array(0 => '0-0', 1 => '123-125')
+*/
+function phpbb_find_range_request()
+{
+ global $request;
+
+ $value = $request->header('Range');
+
+ // Make sure range request starts with "bytes="
+ if (strpos($value, 'bytes=') === 0)
+ {
+ // Strip leading 'bytes='
+ // Multiple ranges can be separated by a comma
+ return explode(',', substr($value, 6));
+ }
+
+ return false;
+}
+
+/**
+* Analyses a range request array.
+*
+* A range request can contain multiple ranges,
+* we however only handle the first request and
+* only support requests from a given byte to the end of the file.
+*
+* @param array $request_array array of strings containing the requested ranges
+* @param int $filesize the full size of the file in bytes that has been requested
+*
+* @return mixed false if the whole file has to be delivered
+* associative array on success
+* byte_pos_start the first byte position, can be passed to fseek()
+* byte_pos_end the last byte position
+* bytes_requested the number of bytes requested
+* bytes_total the full size of the file
+*/
+function phpbb_parse_range_request($request_array, $filesize)
+{
+ // Go through all ranges
+ foreach ($request_array as $range_string)
+ {
+ $range = explode('-', trim($range_string));
+
+ // "-" is invalid, "0-0" however is valid and means the very first byte.
+ if (sizeof($range) != 2 || $range[0] === '' && $range[1] === '')
+ {
+ continue;
+ }
+
+ if ($range[0] === '')
+ {
+ // Return last $range[1] bytes.
+
+ if (!$range[1])
+ {
+ continue;
+ }
+
+ if ($range[1] >= $filesize)
+ {
+ return false;
+ }
+
+ $first_byte_pos = $filesize - (int) $range[1];
+ $last_byte_pos = $filesize - 1;
+ }
+ else
+ {
+ // Return bytes from $range[0] to $range[1]
+
+ $first_byte_pos = (int) $range[0];
+ $last_byte_pos = (int) $range[1];
+
+ if ($last_byte_pos && $last_byte_pos < $first_byte_pos)
+ {
+ // The requested range contains 0 bytes.
+ continue;
+ }
+
+ if ($first_byte_pos >= $filesize)
+ {
+ // Requested range not satisfiable
+ return false;
+ }
+
+ // Adjust last-byte-pos if it is absent or greater than the content.
+ if ($range[1] === '' || $last_byte_pos >= $filesize)
+ {
+ $last_byte_pos = $filesize - 1;
+ }
+ }
+
+ // We currently do not support range requests that end before the end of the file
+ if ($last_byte_pos != $filesize - 1)
+ {
+ continue;
+ }
+
+ return array(
+ 'byte_pos_start' => $first_byte_pos,
+ 'byte_pos_end' => $last_byte_pos,
+ 'bytes_requested' => $last_byte_pos - $first_byte_pos + 1,
+ 'bytes_total' => $filesize,
+ );
+ }
+}
+
+/**
+* Increments the download count of all provided attachments
+*
+* @param \phpbb\db\driver\driver_interface $db The database object
+* @param array|int $ids The attach_id of each attachment
+*
+* @return null
+*/
+function phpbb_increment_downloads($db, $ids)
+{
+ if (!is_array($ids))
+ {
+ $ids = array($ids);
+ }
+
+ $sql = 'UPDATE ' . ATTACHMENTS_TABLE . '
+ SET download_count = download_count + 1
+ WHERE ' . $db->sql_in_set('attach_id', $ids);
+ $db->sql_query($sql);
+}
+
+/**
+* Handles authentication when downloading attachments from a post or topic
+*
+* @param \phpbb\db\driver\driver_interface $db The database object
+* @param \phpbb\auth\auth $auth The authentication object
+* @param int $topic_id The id of the topic that we are downloading from
+*
+* @return null
+*/
+function phpbb_download_handle_forum_auth($db, $auth, $topic_id)
+{
+ $sql_array = array(
+ 'SELECT' => 't.topic_visibility, t.forum_id, f.forum_name, f.forum_password, f.parent_id',
+ 'FROM' => array(
+ TOPICS_TABLE => 't',
+ FORUMS_TABLE => 'f',
+ ),
+ 'WHERE' => 't.topic_id = ' . (int) $topic_id . '
+ AND t.forum_id = f.forum_id',
+ );
+
+ $sql = $db->sql_build_query('SELECT', $sql_array);
+ $result = $db->sql_query($sql);
+ $row = $db->sql_fetchrow($result);
+ $db->sql_freeresult($result);
+
+ if ($row && $row['topic_visibility'] != ITEM_APPROVED && !$auth->acl_get('m_approve', $row['forum_id']))
+ {
+ send_status_line(404, 'Not Found');
+ trigger_error('ERROR_NO_ATTACHMENT');
+ }
+ else if ($row && $auth->acl_get('u_download') && $auth->acl_get('f_download', $row['forum_id']))
+ {
+ if ($row['forum_password'])
+ {
+ // Do something else ... ?
+ login_forum_box($row);
+ }
+ }
+ else
+ {
+ send_status_line(403, 'Forbidden');
+ trigger_error('SORRY_AUTH_VIEW_ATTACH');
+ }
+}
+
+/**
+* Handles authentication when downloading attachments from PMs
+*
+* @param \phpbb\db\driver\driver_interface $db The database object
+* @param \phpbb\auth\auth $auth The authentication object
+* @param int $user_id The user id
+* @param int $msg_id The id of the PM that we are downloading from
+*
+* @return null
+*/
+function phpbb_download_handle_pm_auth($db, $auth, $user_id, $msg_id)
+{
+ global $phpbb_dispatcher;
+
+ if (!$auth->acl_get('u_pm_download'))
+ {
+ send_status_line(403, 'Forbidden');
+ trigger_error('SORRY_AUTH_VIEW_ATTACH');
+ }
+
+ $allowed = phpbb_download_check_pm_auth($db, $user_id, $msg_id);
+
+ /**
+ * Event to modify PM attachments download auth
+ *
+ * @event core.modify_pm_attach_download_auth
+ * @var bool allowed Whether the user is allowed to download from that PM or not
+ * @var int msg_id The id of the PM to download from
+ * @var int user_id The user id for auth check
+ * @since 3.1.11-RC1
+ */
+ $vars = array('allowed', 'msg_id', 'user_id');
+ extract($phpbb_dispatcher->trigger_event('core.modify_pm_attach_download_auth', compact($vars)));
+
+ if (!$allowed)
+ {
+ send_status_line(403, 'Forbidden');
+ trigger_error('ERROR_NO_ATTACHMENT');
+ }
+}
+
+/**
+* Checks whether a user can download from a particular PM
+*
+* @param \phpbb\db\driver\driver_interface $db The database object
+* @param int $user_id The user id
+* @param int $msg_id The id of the PM that we are downloading from
+*
+* @return bool Whether the user is allowed to download from that PM or not
+*/
+function phpbb_download_check_pm_auth($db, $user_id, $msg_id)
+{
+ // Check if the attachment is within the users scope...
+ $sql = 'SELECT msg_id
+ FROM ' . PRIVMSGS_TO_TABLE . '
+ WHERE msg_id = ' . (int) $msg_id . '
+ AND (
+ user_id = ' . (int) $user_id . '
+ OR author_id = ' . (int) $user_id . '
+ )';
+ $result = $db->sql_query_limit($sql, 1);
+ $allowed = (bool) $db->sql_fetchfield('msg_id');
+ $db->sql_freeresult($result);
+
+ return $allowed;
+}
+
+/**
+* Check if the browser is internet explorer version 7+
+*
+* @param string $user_agent User agent HTTP header
+* @param int $version IE version to check against
+*
+* @return bool true if internet explorer version is greater than $version
+*/
+function phpbb_is_greater_ie_version($user_agent, $version)
+{
+ if (preg_match('/msie (\d+)/', strtolower($user_agent), $matches))
+ {
+ $ie_version = (int) $matches[1];
+ return ($ie_version > $version);
+ }
+ else
+ {
+ return false;
+ }
+}
diff --git a/phpBB/includes/functions_install.php b/phpBB/includes/functions_install.php
index 21dd8bfebe..28cc603bdb 100644
--- a/phpBB/includes/functions_install.php
+++ b/phpBB/includes/functions_install.php
@@ -1,10 +1,13 @@
<?php
/**
*
-* @package install
-* @version $Id$
-* @copyright (c) 2006 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -17,27 +20,6 @@ if (!defined('IN_PHPBB'))
}
/**
-* Determine if we are able to load a specified PHP module and do so if possible
-*/
-function can_load_dll($dll)
-{
- // SQLite2 is a tricky thing, from 5.0.0 it requires PDO; if PDO is not loaded we must state that SQLite is unavailable
- // as the installer doesn't understand that the extension has a prerequisite.
- //
- // On top of this sometimes the SQLite extension is compiled for a different version of PDO
- // by some Linux distributions which causes phpBB to bomb out with a blank page.
- //
- // Net result we'll disable automatic inclusion of SQLite support
- //
- // See: r9618 and #56105
- if ($dll == 'sqlite')
- {
- return false;
- }
- return ((@ini_get('enable_dl') || strtolower(@ini_get('enable_dl')) == 'on') && (!@ini_get('safe_mode') || strtolower(@ini_get('safe_mode')) == 'off') && function_exists('dl') && @dl($dll . '.' . PHP_SHLIB_SUFFIX)) ? true : false;
-}
-
-/**
* Returns an array of available DBMS with some data, if a DBMS is specified it will only
* return data for that DBMS and will load its extension if necessary.
*/
@@ -45,16 +27,6 @@ function get_available_dbms($dbms = false, $return_unavailable = false, $only_20
{
global $lang;
$available_dbms = array(
- 'firebird' => array(
- 'LABEL' => 'FireBird',
- 'SCHEMA' => 'firebird',
- 'MODULE' => 'interbase',
- 'DELIM' => ';;',
- 'COMMENTS' => 'remove_remarks',
- 'DRIVER' => 'firebird',
- 'AVAILABLE' => true,
- '2.0.x' => false,
- ),
// Note: php 5.5 alpha 2 deprecated mysql.
// Keep mysqli before mysql in this list.
'mysqli' => array(
@@ -62,8 +34,7 @@ function get_available_dbms($dbms = false, $return_unavailable = false, $only_20
'SCHEMA' => 'mysql_41',
'MODULE' => 'mysqli',
'DELIM' => ';',
- 'COMMENTS' => 'remove_remarks',
- 'DRIVER' => 'mysqli',
+ 'DRIVER' => 'phpbb\db\driver\mysqli',
'AVAILABLE' => true,
'2.0.x' => true,
),
@@ -72,8 +43,7 @@ function get_available_dbms($dbms = false, $return_unavailable = false, $only_20
'SCHEMA' => 'mysql',
'MODULE' => 'mysql',
'DELIM' => ';',
- 'COMMENTS' => 'remove_remarks',
- 'DRIVER' => 'mysql',
+ 'DRIVER' => 'phpbb\db\driver\mysql',
'AVAILABLE' => true,
'2.0.x' => true,
),
@@ -82,8 +52,7 @@ function get_available_dbms($dbms = false, $return_unavailable = false, $only_20
'SCHEMA' => 'mssql',
'MODULE' => 'mssql',
'DELIM' => 'GO',
- 'COMMENTS' => 'remove_comments',
- 'DRIVER' => 'mssql',
+ 'DRIVER' => 'phpbb\db\driver\mssql',
'AVAILABLE' => true,
'2.0.x' => true,
),
@@ -92,8 +61,7 @@ function get_available_dbms($dbms = false, $return_unavailable = false, $only_20
'SCHEMA' => 'mssql',
'MODULE' => 'odbc',
'DELIM' => 'GO',
- 'COMMENTS' => 'remove_comments',
- 'DRIVER' => 'mssql_odbc',
+ 'DRIVER' => 'phpbb\db\driver\mssql_odbc',
'AVAILABLE' => true,
'2.0.x' => true,
),
@@ -102,28 +70,25 @@ function get_available_dbms($dbms = false, $return_unavailable = false, $only_20
'SCHEMA' => 'mssql',
'MODULE' => 'sqlsrv',
'DELIM' => 'GO',
- 'COMMENTS' => 'remove_comments',
- 'DRIVER' => 'mssqlnative',
+ 'DRIVER' => 'phpbb\db\driver\mssqlnative',
'AVAILABLE' => true,
'2.0.x' => false,
- ),
+ ),
'oracle' => array(
'LABEL' => 'Oracle',
'SCHEMA' => 'oracle',
'MODULE' => 'oci8',
'DELIM' => '/',
- 'COMMENTS' => 'remove_comments',
- 'DRIVER' => 'oracle',
+ 'DRIVER' => 'phpbb\db\driver\oracle',
'AVAILABLE' => true,
'2.0.x' => false,
),
'postgres' => array(
- 'LABEL' => 'PostgreSQL 7.x/8.x',
+ 'LABEL' => 'PostgreSQL 8.3+',
'SCHEMA' => 'postgres',
'MODULE' => 'pgsql',
'DELIM' => ';',
- 'COMMENTS' => 'remove_comments',
- 'DRIVER' => 'postgres',
+ 'DRIVER' => 'phpbb\db\driver\postgres',
'AVAILABLE' => true,
'2.0.x' => true,
),
@@ -132,8 +97,16 @@ function get_available_dbms($dbms = false, $return_unavailable = false, $only_20
'SCHEMA' => 'sqlite',
'MODULE' => 'sqlite',
'DELIM' => ';',
- 'COMMENTS' => 'remove_remarks',
- 'DRIVER' => 'sqlite',
+ 'DRIVER' => 'phpbb\db\driver\sqlite',
+ 'AVAILABLE' => true,
+ '2.0.x' => false,
+ ),
+ 'sqlite3' => array(
+ 'LABEL' => 'SQLite3',
+ 'SCHEMA' => 'sqlite',
+ 'MODULE' => 'sqlite3',
+ 'DELIM' => ';',
+ 'DRIVER' => 'phpbb\db\driver\sqlite3',
'AVAILABLE' => true,
'2.0.x' => false,
),
@@ -171,18 +144,15 @@ function get_available_dbms($dbms = false, $return_unavailable = false, $only_20
if (!@extension_loaded($dll))
{
- if (!can_load_dll($dll))
+ if ($return_unavailable)
{
- if ($return_unavailable)
- {
- $available_dbms[$db_name]['AVAILABLE'] = false;
- }
- else
- {
- unset($available_dbms[$db_name]);
- }
- continue;
+ $available_dbms[$db_name]['AVAILABLE'] = false;
+ }
+ else
+ {
+ unset($available_dbms[$db_name]);
}
+ continue;
}
$any_db_support = true;
}
@@ -218,13 +188,7 @@ function dbms_select($default = '', $only_20x_options = false)
*/
function get_tables(&$db)
{
- if (!class_exists('phpbb_db_tools'))
- {
- global $phpbb_root_path, $phpEx;
- require($phpbb_root_path . 'includes/db/db_tools.' . $phpEx);
- }
-
- $db_tools = new phpbb_db_tools($db);
+ $db_tools = new \phpbb\db\tools($db);
return $db_tools->sql_list_tables();
}
@@ -241,26 +205,19 @@ function connect_check_db($error_connect, &$error, $dbms_details, $table_prefix,
$dbms = $dbms_details['DRIVER'];
- if ($load_dbal)
- {
- // Include the DB layer
- include($phpbb_root_path . 'includes/db/' . $dbms . '.' . $phpEx);
- }
-
// Instantiate it and set return on error true
- $sql_db = 'dbal_' . $dbms;
- $db = new $sql_db();
+ $db = new $dbms();
$db->sql_return_on_error(true);
// Check that we actually have a database name before going any further.....
- if ($dbms_details['DRIVER'] != 'sqlite' && $dbms_details['DRIVER'] != 'oracle' && $dbname === '')
+ if ($dbms_details['DRIVER'] != 'phpbb\db\driver\sqlite' && $dbms_details['DRIVER'] != 'phpbb\db\driver\sqlite3' && $dbms_details['DRIVER'] != 'phpbb\db\driver\oracle' && $dbname === '')
{
$error[] = $lang['INST_ERR_DB_NO_NAME'];
return false;
}
// Make sure we don't have a daft user who thinks having the SQLite database in the forum directory is a good idea
- if ($dbms_details['DRIVER'] == 'sqlite' && stripos(phpbb_realpath($dbhost), phpbb_realpath('../')) === 0)
+ if (($dbms_details['DRIVER'] == 'phpbb\db\driver\sqlite' || $dbms_details['DRIVER'] == 'phpbb\db\driver\sqlite3') && stripos(phpbb_realpath($dbhost), phpbb_realpath('../')) === 0)
{
$error[] = $lang['INST_ERR_DB_FORUM_PATH'];
return false;
@@ -269,8 +226,8 @@ function connect_check_db($error_connect, &$error, $dbms_details, $table_prefix,
// Check the prefix length to ensure that index names are not too long and does not contain invalid characters
switch ($dbms_details['DRIVER'])
{
- case 'mysql':
- case 'mysqli':
+ case 'phpbb\db\driver\mysql':
+ case 'phpbb\db\driver\mysqli':
if (strspn($table_prefix, '-./\\') !== 0)
{
$error[] = $lang['INST_ERR_PREFIX_INVALID'];
@@ -279,22 +236,22 @@ function connect_check_db($error_connect, &$error, $dbms_details, $table_prefix,
// no break;
- case 'postgres':
+ case 'phpbb\db\driver\postgres':
$prefix_length = 36;
break;
- case 'mssql':
- case 'mssql_odbc':
- case 'mssqlnative':
+ case 'phpbb\db\driver\mssql':
+ case 'phpbb\db\driver\mssql_odbc':
+ case 'phpbb\db\driver\mssqlnative':
$prefix_length = 90;
break;
- case 'sqlite':
+ case 'phpbb\db\driver\sqlite':
+ case 'phpbb\db\driver\sqlite3':
$prefix_length = 200;
break;
- case 'firebird':
- case 'oracle':
+ case 'phpbb\db\driver\oracle':
$prefix_length = 6;
break;
}
@@ -332,102 +289,29 @@ function connect_check_db($error_connect, &$error, $dbms_details, $table_prefix,
// Make sure that the user has selected a sensible DBAL for the DBMS actually installed
switch ($dbms_details['DRIVER'])
{
- case 'mysqli':
- if (version_compare(mysqli_get_server_info($db->db_connect_id), '4.1.3', '<'))
+ case 'phpbb\db\driver\mysqli':
+ if (version_compare(mysqli_get_server_info($db->get_db_connect_id()), '4.1.3', '<'))
{
$error[] = $lang['INST_ERR_DB_NO_MYSQLI'];
}
break;
- case 'sqlite':
+ case 'phpbb\db\driver\sqlite':
if (version_compare(sqlite_libversion(), '2.8.2', '<'))
{
$error[] = $lang['INST_ERR_DB_NO_SQLITE'];
}
break;
- case 'firebird':
- // check the version of FB, use some hackery if we can't get access to the server info
- if ($db->service_handle !== false && function_exists('ibase_server_info'))
- {
- $val = @ibase_server_info($db->service_handle, IBASE_SVC_SERVER_VERSION);
- preg_match('#V([\d.]+)#', $val, $match);
- if ($match[1] < 2)
- {
- $error[] = $lang['INST_ERR_DB_NO_FIREBIRD'];
- }
- $db_info = @ibase_db_info($db->service_handle, $dbname, IBASE_STS_HDR_PAGES);
-
- preg_match('/^\\s*Page size\\s*(\\d+)/m', $db_info, $regs);
- $page_size = intval($regs[1]);
- if ($page_size < 8192)
- {
- $error[] = $lang['INST_ERR_DB_NO_FIREBIRD_PS'];
- }
- }
- else
+ case 'phpbb\db\driver\sqlite3':
+ $version = \SQLite3::version();
+ if (version_compare($version['versionString'], '3.6.15', '<'))
{
- $sql = "SELECT *
- FROM RDB$FUNCTIONS
- WHERE RDB$SYSTEM_FLAG IS NULL
- AND RDB$FUNCTION_NAME = 'CHAR_LENGTH'";
- $result = $db->sql_query($sql);
- $row = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
-
- // if its a UDF, its too old
- if ($row)
- {
- $error[] = $lang['INST_ERR_DB_NO_FIREBIRD'];
- }
- else
- {
- $sql = 'SELECT 1 FROM RDB$DATABASE
- WHERE BIN_AND(10, 1) = 0';
- $result = $db->sql_query($sql);
- if (!$result) // This can only fail if BIN_AND is not defined
- {
- $error[] = $lang['INST_ERR_DB_NO_FIREBIRD'];
- }
- $db->sql_freeresult($result);
- }
-
- // Setup the stuff for our random table
- $char_array = array_merge(range('A', 'Z'), range('0', '9'));
- $char_len = mt_rand(7, 9);
- $char_array_len = sizeof($char_array) - 1;
-
- $final = '';
-
- for ($i = 0; $i < $char_len; $i++)
- {
- $final .= $char_array[mt_rand(0, $char_array_len)];
- }
-
- // Create some random table
- $sql = 'CREATE TABLE ' . $final . " (
- FIELD1 VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- FIELD2 INTEGER DEFAULT 0 NOT NULL);";
- $db->sql_query($sql);
-
- // Create an index that should fail if the page size is less than 8192
- $sql = 'CREATE INDEX ' . $final . ' ON ' . $final . '(FIELD1, FIELD2);';
- $db->sql_query($sql);
-
- if (ibase_errmsg() !== false)
- {
- $error[] = $lang['INST_ERR_DB_NO_FIREBIRD_PS'];
- }
- else
- {
- // Kill the old table
- $db->sql_query('DROP TABLE ' . $final . ';');
- }
- unset($final);
+ $error[] = $lang['INST_ERR_DB_NO_SQLITE3'];
}
break;
- case 'oracle':
+ case 'phpbb\db\driver\oracle':
if ($unicode_check)
{
$sql = "SELECT *
@@ -449,7 +333,7 @@ function connect_check_db($error_connect, &$error, $dbms_details, $table_prefix,
}
break;
- case 'postgres':
+ case 'phpbb\db\driver\postgres':
if ($unicode_check)
{
$sql = "SHOW server_encoding;";
@@ -475,19 +359,6 @@ function connect_check_db($error_connect, &$error, $dbms_details, $table_prefix,
}
/**
-* Removes comments from schema files
-*
-* @deprecated Use phpbb_remove_comments() instead.
-*/
-function remove_remarks(&$sql)
-{
- // Remove # style comments
- $sql = preg_replace('/\n{2,}/', "\n", preg_replace('/^#.*$/m', "\n", $sql));
-
- // Return by reference
-}
-
-/**
* Removes "/* style" as well as "# style" comments from $input.
*
* @param string $input Input string
@@ -496,17 +367,11 @@ function remove_remarks(&$sql)
*/
function phpbb_remove_comments($input)
{
- if (!function_exists('remove_comments'))
- {
- global $phpbb_root_path, $phpEx;
- require($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
- }
-
- // Remove /* */ comments
- remove_comments($input);
+ // Remove /* */ comments (http://ostermiller.org/findcomment.html)
+ $input = preg_replace('#/\*(.|[\r\n])*?\*/#', "\n", $input);
// Remove # style comments
- remove_remarks($input);
+ $input = preg_replace('/\n{2,}/', "\n", preg_replace('/^#.*$/m', "\n", $input));
return $input;
}
@@ -551,19 +416,18 @@ function adjust_language_keys_callback($matches)
*
* @param array $data Array containing the database connection information
* @param string $dbms The name of the DBAL class to use
-* @param array $load_extensions Array of additional extensions that should be loaded
* @param bool $debug If the debug constants should be enabled by default or not
+* @param bool $debug_container If the container should be compiled on
+* every page load or not
* @param bool $debug_test If the DEBUG_TEST constant should be added
* NOTE: Only for use within the testing framework
*
* @return string The output to write to the file
*/
-function phpbb_create_config_file_data($data, $dbms, $load_extensions, $debug = false, $debug_test = false)
+function phpbb_create_config_file_data($data, $dbms, $debug = false, $debug_container = false, $debug_test = false)
{
- $load_extensions = implode(',', $load_extensions);
-
$config_data = "<?php\n";
- $config_data .= "// phpBB 3.0.x auto-generated configuration file\n// Do not change anything in this file!\n";
+ $config_data .= "// phpBB 3.1.x auto-generated configuration file\n// Do not change anything in this file!\n";
$config_data_array = array(
'dbms' => $dbms,
@@ -573,8 +437,10 @@ function phpbb_create_config_file_data($data, $dbms, $load_extensions, $debug =
'dbuser' => $data['dbuser'],
'dbpasswd' => htmlspecialchars_decode($data['dbpasswd']),
'table_prefix' => $data['table_prefix'],
- 'acm_type' => 'file',
- 'load_extensions' => $load_extensions,
+
+ 'phpbb_adm_relative_path' => 'adm/',
+
+ 'acm_type' => 'phpbb\cache\driver\file',
);
foreach ($config_data_array as $key => $value)
@@ -583,16 +449,24 @@ function phpbb_create_config_file_data($data, $dbms, $load_extensions, $debug =
}
$config_data .= "\n@define('PHPBB_INSTALLED', true);\n";
+ $config_data .= "// @define('PHPBB_DISPLAY_LOAD_TIME', true);\n";
if ($debug)
{
$config_data .= "@define('DEBUG', true);\n";
- $config_data .= "@define('DEBUG_EXTRA', true);\n";
}
else
{
$config_data .= "// @define('DEBUG', true);\n";
- $config_data .= "// @define('DEBUG_EXTRA', true);\n";
+ }
+
+ if ($debug_container)
+ {
+ $config_data .= "@define('DEBUG_CONTAINER', true);\n";
+ }
+ else
+ {
+ $config_data .= "// @define('DEBUG_CONTAINER', true);\n";
}
if ($debug_test)
@@ -603,4 +477,69 @@ function phpbb_create_config_file_data($data, $dbms, $load_extensions, $debug =
return $config_data;
}
-?> \ No newline at end of file
+/**
+* Check whether a file should be ignored on update
+*
+* We ignore new files in some circumstances:
+* 1. The file is a language file, but the language is not installed
+* 2. The file is a style file, but the style is not installed
+* 3. The file is a style language file, but the language is not installed
+*
+* @param string $phpbb_root_path phpBB root path
+* @param string $file File including path from phpbb root
+* @return bool Should we ignore the new file or add it to the board?
+*/
+function phpbb_ignore_new_file_on_update($phpbb_root_path, $file)
+{
+ $ignore_new_file = false;
+
+ // We ignore new files in some circumstances:
+ // 1. The file is a language file, but the language is not installed
+ if (!$ignore_new_file && strpos($file, 'language/') === 0)
+ {
+ list($language_dir, $language_iso) = explode('/', $file);
+ $ignore_new_file = !file_exists($phpbb_root_path . $language_dir . '/' . $language_iso);
+ }
+
+ // 2. The file is a style file, but the style is not installed
+ if (!$ignore_new_file && strpos($file, 'styles/') === 0)
+ {
+ list($styles_dir, $style_name) = explode('/', $file);
+ $ignore_new_file = !file_exists($phpbb_root_path . $styles_dir . '/' . $style_name);
+ }
+
+ // 3. The file is a style language file, but the language is not installed
+ if (!$ignore_new_file && strpos($file, 'styles/') === 0)
+ {
+ $dirs = explode('/', $file);
+ if (sizeof($dirs) >= 5)
+ {
+ list($styles_dir, $style_name, $template_component, $language_iso) = explode('/', $file);
+ if ($template_component == 'theme' && $language_iso !== 'images')
+ {
+ $ignore_new_file = !file_exists($phpbb_root_path . 'language/' . $language_iso);
+ }
+ }
+ }
+
+ return $ignore_new_file;
+}
+
+/**
+* Check whether phpBB is installed.
+*
+* @param string $phpbb_root_path Path to the phpBB board root.
+* @param string $php_ext PHP file extension.
+*
+* @return bool Returns true if phpBB is installed.
+*/
+function phpbb_check_installation_exists($phpbb_root_path, $php_ext)
+{
+ // Try opening config file
+ if (file_exists($phpbb_root_path . 'config.' . $php_ext))
+ {
+ include($phpbb_root_path . 'config.' . $php_ext);
+ }
+
+ return defined('PHPBB_INSTALLED');
+}
diff --git a/phpBB/includes/functions_jabber.php b/phpBB/includes/functions_jabber.php
index 2054124a4e..c9ec6fea61 100644
--- a/phpBB/includes/functions_jabber.php
+++ b/phpBB/includes/functions_jabber.php
@@ -1,10 +1,13 @@
<?php
/**
*
-* @package phpBB3
-* @version $Id$
-* @copyright (c) 2007 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -25,8 +28,6 @@ if (!defined('IN_PHPBB'))
* @author Florian Schmitz (floele)
*
* Only slightly modified by Acyd Burn
-*
-* @package phpBB3
*/
class jabber
{
@@ -40,6 +41,9 @@ class jabber
var $username;
var $password;
var $use_ssl;
+ var $verify_peer;
+ var $verify_peer_name;
+ var $allow_self_signed;
var $resource = 'functions_jabber.phpbb.php';
var $enable_logging;
@@ -48,8 +52,18 @@ class jabber
var $features = array();
/**
+ * Constructor
+ *
+ * @param string $server Jabber server
+ * @param int $port Jabber server port
+ * @param string $username Jabber username or JID
+ * @param string $password Jabber password
+ * @param boold $use_ssl Use ssl
+ * @param bool $verify_peer Verify SSL certificate
+ * @param bool $verify_peer_name Verify Jabber peer name
+ * @param bool $allow_self_signed Allow self signed certificates
*/
- function jabber($server, $port, $username, $password, $use_ssl = false)
+ function __construct($server, $port, $username, $password, $use_ssl = false, $verify_peer = true, $verify_peer_name = true, $allow_self_signed = false)
{
$this->connect_server = ($server) ? $server : 'localhost';
$this->port = ($port) ? $port : 5222;
@@ -69,7 +83,10 @@ class jabber
}
$this->password = $password;
- $this->use_ssl = ($use_ssl && $this->can_use_ssl()) ? true : false;
+ $this->use_ssl = ($use_ssl && self::can_use_ssl()) ? true : false;
+ $this->verify_peer = $verify_peer;
+ $this->verify_peer_name = $verify_peer_name;
+ $this->allow_self_signed = $allow_self_signed;
// Change port if we use SSL
if ($this->port == 5222 && $this->use_ssl)
@@ -84,7 +101,7 @@ class jabber
/**
* Able to use the SSL functionality?
*/
- function can_use_ssl()
+ static public function can_use_ssl()
{
// Will not work with PHP >= 5.2.1 or < 5.2.3RC2 until timeout problem with ssl hasn't been fixed (http://bugs.php.net/41236)
return ((version_compare(PHP_VERSION, '5.2.1', '<') || version_compare(PHP_VERSION, '5.2.3RC2', '>=')) && @extension_loaded('openssl')) ? true : false;
@@ -93,9 +110,9 @@ class jabber
/**
* Able to use TLS?
*/
- function can_use_tls()
+ static public function can_use_tls()
{
- if (!@extension_loaded('openssl') || !function_exists('stream_socket_enable_crypto') || !function_exists('stream_get_meta_data') || !function_exists('socket_set_blocking') || !function_exists('stream_get_wrappers'))
+ if (!@extension_loaded('openssl') || !function_exists('stream_socket_enable_crypto') || !function_exists('stream_get_meta_data') || !function_exists('stream_set_blocking') || !function_exists('stream_get_wrappers'))
{
return false;
}
@@ -138,7 +155,7 @@ class jabber
$this->session['ssl'] = $this->use_ssl;
- if ($this->open_socket($this->connect_server, $this->port, $this->use_ssl))
+ if ($this->open_socket($this->connect_server, $this->port, $this->use_ssl, $this->verify_peer, $this->verify_peer_name, $this->allow_self_signed))
{
$this->send("<?xml version='1.0' encoding='UTF-8' ?" . ">\n");
$this->send("<stream:stream to='{$this->server}' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' version='1.0'>\n");
@@ -226,10 +243,13 @@ class jabber
* @param string $server host to connect to
* @param int $port port number
* @param bool $use_ssl use ssl or not
+ * @param bool $verify_peer verify ssl certificate
+ * @param bool $verify_peer_name verify peer name
+ * @param bool $allow_self_signed allow self-signed ssl certificates
* @access public
* @return bool
*/
- function open_socket($server, $port, $use_ssl = false)
+ function open_socket($server, $port, $use_ssl, $verify_peer, $verify_peer_name, $allow_self_signed)
{
if (@function_exists('dns_get_record'))
{
@@ -240,12 +260,26 @@ class jabber
}
}
- $server = $use_ssl ? 'ssl://' . $server : $server;
+ $options = array();
+
+ if ($use_ssl)
+ {
+ $remote_socket = 'ssl://' . $server . ':' . $port;
+
+ // Set ssl context options, see http://php.net/manual/en/context.ssl.php
+ $options['ssl'] = array('verify_peer' => $verify_peer, 'verify_peer_name' => $verify_peer_name, 'allow_self_signed' => $allow_self_signed);
+ }
+ else
+ {
+ $remote_socket = $server . ':' . $port;
+ }
+
+ $socket_context = stream_context_create($options);
- if ($this->connection = @fsockopen($server, $port, $errorno, $errorstr, $this->timeout))
+ if ($this->connection = @stream_socket_client($remote_socket, $errorno, $errorstr, $this->timeout, STREAM_CLIENT_CONNECT, $socket_context))
{
- socket_set_blocking($this->connection, 0);
- socket_set_timeout($this->connection, 60);
+ stream_set_blocking($this->connection, 0);
+ stream_set_timeout($this->connection, 60);
return true;
}
@@ -443,7 +477,7 @@ class jabber
}
// Let's use TLS if SSL is not enabled and we can actually use it
- if (!$this->session['ssl'] && $this->can_use_tls() && $this->can_use_ssl() && isset($xml['stream:features'][0]['#']['starttls']))
+ if (!$this->session['ssl'] && self::can_use_tls() && self::can_use_ssl() && isset($xml['stream:features'][0]['#']['starttls']))
{
$this->add_to_log('Switching to TLS.');
$this->send("<starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'/>\n");
@@ -562,7 +596,7 @@ class jabber
case 'proceed':
// continue switching to TLS
$meta = stream_get_meta_data($this->connection);
- socket_set_blocking($this->connection, 1);
+ stream_set_blocking($this->connection, 1);
if (!stream_socket_enable_crypto($this->connection, true, STREAM_CRYPTO_METHOD_TLS_CLIENT))
{
@@ -570,7 +604,7 @@ class jabber
return false;
}
- socket_set_blocking($this->connection, $meta['blocked']);
+ stream_set_blocking($this->connection, $meta['blocked']);
$this->session['tls'] = true;
// new stream
@@ -869,5 +903,3 @@ class jabber
return $children;
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/functions_mcp.php b/phpBB/includes/functions_mcp.php
new file mode 100644
index 0000000000..1e08864bdc
--- /dev/null
+++ b/phpBB/includes/functions_mcp.php
@@ -0,0 +1,725 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+/**
+* @ignore
+*/
+if (!defined('IN_PHPBB'))
+{
+ exit;
+}
+
+/**
+* Functions used to generate additional URL paramters
+*/
+function phpbb_module__url($mode, &$module_row)
+{
+ return phpbb_extra_url();
+}
+
+function phpbb_module_notes_url($mode, &$module_row)
+{
+ if ($mode == 'front')
+ {
+ return '';
+ }
+
+ global $user_id;
+ return ($user_id) ? "&amp;u=$user_id" : '';
+}
+
+function phpbb_module_warn_url($mode, &$module_row)
+{
+ if ($mode == 'front' || $mode == 'list')
+ {
+ global $forum_id;
+
+ return ($forum_id) ? "&amp;f=$forum_id" : '';
+ }
+
+ if ($mode == 'warn_post')
+ {
+ global $forum_id, $post_id;
+
+ $url_extra = ($forum_id) ? "&amp;f=$forum_id" : '';
+ $url_extra .= ($post_id) ? "&amp;p=$post_id" : '';
+
+ return $url_extra;
+ }
+ else
+ {
+ global $user_id;
+
+ return ($user_id) ? "&amp;u=$user_id" : '';
+ }
+}
+
+function phpbb_module_main_url($mode, &$module_row)
+{
+ return phpbb_extra_url();
+}
+
+function phpbb_module_logs_url($mode, &$module_row)
+{
+ return phpbb_extra_url();
+}
+
+function phpbb_module_ban_url($mode, &$module_row)
+{
+ return phpbb_extra_url();
+}
+
+function phpbb_module_queue_url($mode, &$module_row)
+{
+ return phpbb_extra_url();
+}
+
+function phpbb_module_reports_url($mode, &$module_row)
+{
+ return phpbb_extra_url();
+}
+
+function phpbb_extra_url()
+{
+ global $forum_id, $topic_id, $post_id, $report_id, $user_id;
+
+ $url_extra = '';
+ $url_extra .= ($forum_id) ? "&amp;f=$forum_id" : '';
+ $url_extra .= ($topic_id) ? "&amp;t=$topic_id" : '';
+ $url_extra .= ($post_id) ? "&amp;p=$post_id" : '';
+ $url_extra .= ($user_id) ? "&amp;u=$user_id" : '';
+ $url_extra .= ($report_id) ? "&amp;r=$report_id" : '';
+
+ return $url_extra;
+}
+
+/**
+* Get simple topic data
+*/
+function phpbb_get_topic_data($topic_ids, $acl_list = false, $read_tracking = false)
+{
+ global $auth, $db, $config, $user;
+ static $rowset = array();
+
+ $topics = array();
+
+ if (!sizeof($topic_ids))
+ {
+ return array();
+ }
+
+ // cache might not contain read tracking info, so we can't use it if read
+ // tracking information is requested
+ if (!$read_tracking)
+ {
+ $cache_topic_ids = array_intersect($topic_ids, array_keys($rowset));
+ $topic_ids = array_diff($topic_ids, array_keys($rowset));
+ }
+ else
+ {
+ $cache_topic_ids = array();
+ }
+
+ if (sizeof($topic_ids))
+ {
+ $sql_array = array(
+ 'SELECT' => 't.*, f.*',
+
+ 'FROM' => array(
+ TOPICS_TABLE => 't',
+ ),
+
+ 'LEFT_JOIN' => array(
+ array(
+ 'FROM' => array(FORUMS_TABLE => 'f'),
+ 'ON' => 'f.forum_id = t.forum_id'
+ )
+ ),
+
+ 'WHERE' => $db->sql_in_set('t.topic_id', $topic_ids)
+ );
+
+ if ($read_tracking && $config['load_db_lastread'])
+ {
+ $sql_array['SELECT'] .= ', tt.mark_time, ft.mark_time as forum_mark_time';
+
+ $sql_array['LEFT_JOIN'][] = array(
+ 'FROM' => array(TOPICS_TRACK_TABLE => 'tt'),
+ 'ON' => 'tt.user_id = ' . $user->data['user_id'] . ' AND t.topic_id = tt.topic_id'
+ );
+
+ $sql_array['LEFT_JOIN'][] = array(
+ 'FROM' => array(FORUMS_TRACK_TABLE => 'ft'),
+ 'ON' => 'ft.user_id = ' . $user->data['user_id'] . ' AND t.forum_id = ft.forum_id'
+ );
+ }
+
+ $sql = $db->sql_build_query('SELECT', $sql_array);
+ $result = $db->sql_query($sql);
+
+ while ($row = $db->sql_fetchrow($result))
+ {
+ $rowset[$row['topic_id']] = $row;
+
+ if ($acl_list && !$auth->acl_gets($acl_list, $row['forum_id']))
+ {
+ continue;
+ }
+
+ $topics[$row['topic_id']] = $row;
+ }
+ $db->sql_freeresult($result);
+ }
+
+ foreach ($cache_topic_ids as $id)
+ {
+ if (!$acl_list || $auth->acl_gets($acl_list, $rowset[$id]['forum_id']))
+ {
+ $topics[$id] = $rowset[$id];
+ }
+ }
+
+ return $topics;
+}
+
+/**
+* Get simple post data
+*/
+function phpbb_get_post_data($post_ids, $acl_list = false, $read_tracking = false)
+{
+ global $db, $auth, $config, $user;
+
+ $rowset = array();
+
+ if (!sizeof($post_ids))
+ {
+ return array();
+ }
+
+ $sql_array = array(
+ 'SELECT' => 'p.*, u.*, t.*, f.*',
+
+ 'FROM' => array(
+ USERS_TABLE => 'u',
+ POSTS_TABLE => 'p',
+ TOPICS_TABLE => 't',
+ ),
+
+ 'LEFT_JOIN' => array(
+ array(
+ 'FROM' => array(FORUMS_TABLE => 'f'),
+ 'ON' => 'f.forum_id = t.forum_id'
+ )
+ ),
+
+ 'WHERE' => $db->sql_in_set('p.post_id', $post_ids) . '
+ AND u.user_id = p.poster_id
+ AND t.topic_id = p.topic_id',
+ );
+
+ if ($read_tracking && $config['load_db_lastread'])
+ {
+ $sql_array['SELECT'] .= ', tt.mark_time, ft.mark_time as forum_mark_time';
+
+ $sql_array['LEFT_JOIN'][] = array(
+ 'FROM' => array(TOPICS_TRACK_TABLE => 'tt'),
+ 'ON' => 'tt.user_id = ' . $user->data['user_id'] . ' AND t.topic_id = tt.topic_id'
+ );
+
+ $sql_array['LEFT_JOIN'][] = array(
+ 'FROM' => array(FORUMS_TRACK_TABLE => 'ft'),
+ 'ON' => 'ft.user_id = ' . $user->data['user_id'] . ' AND t.forum_id = ft.forum_id'
+ );
+ }
+
+ $sql = $db->sql_build_query('SELECT', $sql_array);
+ $result = $db->sql_query($sql);
+ unset($sql_array);
+
+ while ($row = $db->sql_fetchrow($result))
+ {
+ if ($acl_list && !$auth->acl_gets($acl_list, $row['forum_id']))
+ {
+ continue;
+ }
+
+ if ($row['post_visibility'] != ITEM_APPROVED && !$auth->acl_get('m_approve', $row['forum_id']))
+ {
+ // Moderators without the permission to approve post should at least not see them. ;)
+ continue;
+ }
+
+ $rowset[$row['post_id']] = $row;
+ }
+ $db->sql_freeresult($result);
+
+ return $rowset;
+}
+
+/**
+* Get simple forum data
+*/
+function phpbb_get_forum_data($forum_id, $acl_list = 'f_list', $read_tracking = false)
+{
+ global $auth, $db, $user, $config, $phpbb_container;
+
+ $rowset = array();
+
+ if (!is_array($forum_id))
+ {
+ $forum_id = array($forum_id);
+ }
+
+ if (!sizeof($forum_id))
+ {
+ return array();
+ }
+
+ if ($read_tracking && $config['load_db_lastread'])
+ {
+ $read_tracking_join = ' LEFT JOIN ' . FORUMS_TRACK_TABLE . ' ft ON (ft.user_id = ' . $user->data['user_id'] . '
+ AND ft.forum_id = f.forum_id)';
+ $read_tracking_select = ', ft.mark_time';
+ }
+ else
+ {
+ $read_tracking_join = $read_tracking_select = '';
+ }
+
+ $sql = "SELECT f.* $read_tracking_select
+ FROM " . FORUMS_TABLE . " f$read_tracking_join
+ WHERE " . $db->sql_in_set('f.forum_id', $forum_id);
+ $result = $db->sql_query($sql);
+
+ $phpbb_content_visibility = $phpbb_container->get('content.visibility');
+
+ while ($row = $db->sql_fetchrow($result))
+ {
+ if ($acl_list && !$auth->acl_gets($acl_list, $row['forum_id']))
+ {
+ continue;
+ }
+
+ $row['forum_topics_approved'] = $phpbb_content_visibility->get_count('forum_topics', $row, $row['forum_id']);
+
+ $rowset[$row['forum_id']] = $row;
+ }
+ $db->sql_freeresult($result);
+
+ return $rowset;
+}
+
+/**
+* Get simple pm data
+*/
+function phpbb_get_pm_data($pm_ids)
+{
+ global $db;
+
+ $rowset = array();
+
+ if (!sizeof($pm_ids))
+ {
+ return array();
+ }
+
+ $sql_array = array(
+ 'SELECT' => 'p.*, u.*',
+
+ 'FROM' => array(
+ USERS_TABLE => 'u',
+ PRIVMSGS_TABLE => 'p',
+ ),
+
+ 'WHERE' => $db->sql_in_set('p.msg_id', $pm_ids) . '
+ AND u.user_id = p.author_id',
+ );
+
+ $sql = $db->sql_build_query('SELECT', $sql_array);
+ $result = $db->sql_query($sql);
+ unset($sql_array);
+
+ while ($row = $db->sql_fetchrow($result))
+ {
+ $rowset[$row['msg_id']] = $row;
+ }
+ $db->sql_freeresult($result);
+
+ return $rowset;
+}
+
+/**
+* sorting in mcp
+*
+* @param string $where_sql should either be WHERE (default if ommited) or end with AND or OR
+*
+* $mode reports and reports_closed: the $where parameters uses aliases p for posts table and r for report table
+* $mode unapproved_posts: the $where parameters uses aliases p for posts table and t for topic table
+*/
+function phpbb_mcp_sorting($mode, &$sort_days, &$sort_key, &$sort_dir, &$sort_by_sql, &$sort_order_sql, &$total, $forum_id = 0, $topic_id = 0, $where_sql = 'WHERE')
+{
+ global $db, $user, $auth, $template, $phpbb_dispatcher;
+
+ $sort_days = request_var('st', 0);
+ $min_time = ($sort_days) ? time() - ($sort_days * 86400) : 0;
+
+ switch ($mode)
+ {
+ case 'viewforum':
+ $type = 'topics';
+ $default_key = 't';
+ $default_dir = 'd';
+
+ $sql = 'SELECT COUNT(topic_id) AS total
+ FROM ' . TOPICS_TABLE . "
+ $where_sql forum_id = $forum_id
+ AND topic_type NOT IN (" . POST_ANNOUNCE . ', ' . POST_GLOBAL . ")
+ AND topic_last_post_time >= $min_time";
+
+ if (!$auth->acl_get('m_approve', $forum_id))
+ {
+ $sql .= ' AND topic_visibility = ' . ITEM_APPROVED;
+ }
+ break;
+
+ case 'viewtopic':
+ $type = 'posts';
+ $default_key = 't';
+ $default_dir = 'a';
+
+ $sql = 'SELECT COUNT(post_id) AS total
+ FROM ' . POSTS_TABLE . "
+ $where_sql topic_id = $topic_id
+ AND post_time >= $min_time";
+
+ if (!$auth->acl_get('m_approve', $forum_id))
+ {
+ $sql .= ' AND post_visibility = ' . ITEM_APPROVED;
+ }
+ break;
+
+ case 'unapproved_posts':
+ case 'deleted_posts':
+ $visibility_const = ($mode == 'unapproved_posts') ? array(ITEM_UNAPPROVED, ITEM_REAPPROVE) : ITEM_DELETED;
+ $type = 'posts';
+ $default_key = 't';
+ $default_dir = 'd';
+ $where_sql .= ($topic_id) ? ' p.topic_id = ' . $topic_id . ' AND' : '';
+
+ $sql = 'SELECT COUNT(p.post_id) AS total
+ FROM ' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . " t
+ $where_sql " . $db->sql_in_set('p.forum_id', ($forum_id) ? array($forum_id) : array_intersect(get_forum_list('f_read'), get_forum_list('m_approve'))) . '
+ AND ' . $db->sql_in_set('p.post_visibility', $visibility_const) .'
+ AND t.topic_id = p.topic_id
+ AND t.topic_visibility <> p.post_visibility';
+
+ if ($min_time)
+ {
+ $sql .= ' AND post_time >= ' . $min_time;
+ }
+ break;
+
+ case 'unapproved_topics':
+ case 'deleted_topics':
+ $visibility_const = ($mode == 'unapproved_topics') ? array(ITEM_UNAPPROVED, ITEM_REAPPROVE) : ITEM_DELETED;
+ $type = 'topics';
+ $default_key = 't';
+ $default_dir = 'd';
+
+ $sql = 'SELECT COUNT(topic_id) AS total
+ FROM ' . TOPICS_TABLE . "
+ $where_sql " . $db->sql_in_set('forum_id', ($forum_id) ? array($forum_id) : array_intersect(get_forum_list('f_read'), get_forum_list('m_approve'))) . '
+ AND ' . $db->sql_in_set('topic_visibility', $visibility_const);
+
+ if ($min_time)
+ {
+ $sql .= ' AND topic_time >= ' . $min_time;
+ }
+ break;
+
+ case 'pm_reports':
+ case 'pm_reports_closed':
+ case 'reports':
+ case 'reports_closed':
+ $pm = (strpos($mode, 'pm_') === 0) ? true : false;
+
+ $type = ($pm) ? 'pm_reports' : 'reports';
+ $default_key = 't';
+ $default_dir = 'd';
+ $limit_time_sql = ($min_time) ? "AND r.report_time >= $min_time" : '';
+
+ if ($topic_id)
+ {
+ $where_sql .= ' p.topic_id = ' . $topic_id . ' AND ';
+ }
+ else if ($forum_id)
+ {
+ $where_sql .= ' p.forum_id = ' . $forum_id . ' AND ';
+ }
+ else if (!$pm)
+ {
+ $where_sql .= ' ' . $db->sql_in_set('p.forum_id', get_forum_list(array('!f_read', '!m_report')), true, true) . ' AND ';
+ }
+
+ if ($mode == 'reports' || $mode == 'pm_reports')
+ {
+ $where_sql .= ' r.report_closed = 0 AND ';
+ }
+ else
+ {
+ $where_sql .= ' r.report_closed = 1 AND ';
+ }
+
+ if ($pm)
+ {
+ $sql = 'SELECT COUNT(r.report_id) AS total
+ FROM ' . REPORTS_TABLE . ' r, ' . PRIVMSGS_TABLE . " p
+ $where_sql r.post_id = 0
+ AND p.msg_id = r.pm_id
+ $limit_time_sql";
+ }
+ else
+ {
+ $sql = 'SELECT COUNT(r.report_id) AS total
+ FROM ' . REPORTS_TABLE . ' r, ' . POSTS_TABLE . " p
+ $where_sql r.pm_id = 0
+ AND p.post_id = r.post_id
+ $limit_time_sql";
+ }
+ break;
+
+ case 'viewlogs':
+ $type = 'logs';
+ $default_key = 't';
+ $default_dir = 'd';
+
+ $sql = 'SELECT COUNT(log_id) AS total
+ FROM ' . LOG_TABLE . "
+ $where_sql " . $db->sql_in_set('forum_id', ($forum_id) ? array($forum_id) : array_intersect(get_forum_list('f_read'), get_forum_list('m_'))) . '
+ AND log_time >= ' . $min_time . '
+ AND log_type = ' . LOG_MOD;
+ break;
+ }
+
+ $sort_key = request_var('sk', $default_key);
+ $sort_dir = request_var('sd', $default_dir);
+ $sort_dir_text = array('a' => $user->lang['ASCENDING'], 'd' => $user->lang['DESCENDING']);
+
+ switch ($type)
+ {
+ case 'topics':
+ $limit_days = array(0 => $user->lang['ALL_TOPICS'], 1 => $user->lang['1_DAY'], 7 => $user->lang['7_DAYS'], 14 => $user->lang['2_WEEKS'], 30 => $user->lang['1_MONTH'], 90 => $user->lang['3_MONTHS'], 180 => $user->lang['6_MONTHS'], 365 => $user->lang['1_YEAR']);
+ $sort_by_text = array('a' => $user->lang['AUTHOR'], 't' => $user->lang['POST_TIME'], 'tt' => $user->lang['TOPIC_TIME'], 'r' => $user->lang['REPLIES'], 's' => $user->lang['SUBJECT'], 'v' => $user->lang['VIEWS']);
+
+ $sort_by_sql = array('a' => 't.topic_first_poster_name', 't' => array('t.topic_last_post_time', 't.topic_last_post_id'), 'tt' => 't.topic_time', 'r' => (($auth->acl_get('m_approve', $forum_id)) ? 't.topic_posts_approved + t.topic_posts_unapproved + t.topic_posts_softdeleted' : 't.topic_posts_approved'), 's' => 't.topic_title', 'v' => 't.topic_views');
+ $limit_time_sql = ($min_time) ? "AND t.topic_last_post_time >= $min_time" : '';
+ break;
+
+ case 'posts':
+ $limit_days = array(0 => $user->lang['ALL_POSTS'], 1 => $user->lang['1_DAY'], 7 => $user->lang['7_DAYS'], 14 => $user->lang['2_WEEKS'], 30 => $user->lang['1_MONTH'], 90 => $user->lang['3_MONTHS'], 180 => $user->lang['6_MONTHS'], 365 => $user->lang['1_YEAR']);
+ $sort_by_text = array('a' => $user->lang['AUTHOR'], 't' => $user->lang['POST_TIME'], 's' => $user->lang['SUBJECT']);
+ $sort_by_sql = array('a' => 'u.username_clean', 't' => array('p.post_time', 'p.post_id'), 's' => 'p.post_subject');
+ $limit_time_sql = ($min_time) ? "AND p.post_time >= $min_time" : '';
+ break;
+
+ case 'reports':
+ $limit_days = array(0 => $user->lang['ALL_REPORTS'], 1 => $user->lang['1_DAY'], 7 => $user->lang['7_DAYS'], 14 => $user->lang['2_WEEKS'], 30 => $user->lang['1_MONTH'], 90 => $user->lang['3_MONTHS'], 180 => $user->lang['6_MONTHS'], 365 => $user->lang['1_YEAR']);
+ $sort_by_text = array('a' => $user->lang['AUTHOR'], 'r' => $user->lang['REPORTER'], 'p' => $user->lang['POST_TIME'], 't' => $user->lang['REPORT_TIME'], 's' => $user->lang['SUBJECT']);
+ $sort_by_sql = array('a' => 'u.username_clean', 'r' => 'ru.username', 'p' => array('p.post_time', 'p.post_id'), 't' => 'r.report_time', 's' => 'p.post_subject');
+ break;
+
+ case 'pm_reports':
+ $limit_days = array(0 => $user->lang['ALL_REPORTS'], 1 => $user->lang['1_DAY'], 7 => $user->lang['7_DAYS'], 14 => $user->lang['2_WEEKS'], 30 => $user->lang['1_MONTH'], 90 => $user->lang['3_MONTHS'], 180 => $user->lang['6_MONTHS'], 365 => $user->lang['1_YEAR']);
+ $sort_by_text = array('a' => $user->lang['AUTHOR'], 'r' => $user->lang['REPORTER'], 'p' => $user->lang['POST_TIME'], 't' => $user->lang['REPORT_TIME'], 's' => $user->lang['SUBJECT']);
+ $sort_by_sql = array('a' => 'u.username_clean', 'r' => 'ru.username', 'p' => 'p.message_time', 't' => 'r.report_time', 's' => 'p.message_subject');
+ break;
+
+ case 'logs':
+ $limit_days = array(0 => $user->lang['ALL_ENTRIES'], 1 => $user->lang['1_DAY'], 7 => $user->lang['7_DAYS'], 14 => $user->lang['2_WEEKS'], 30 => $user->lang['1_MONTH'], 90 => $user->lang['3_MONTHS'], 180 => $user->lang['6_MONTHS'], 365 => $user->lang['1_YEAR']);
+ $sort_by_text = array('u' => $user->lang['SORT_USERNAME'], 't' => $user->lang['SORT_DATE'], 'i' => $user->lang['SORT_IP'], 'o' => $user->lang['SORT_ACTION']);
+
+ $sort_by_sql = array('u' => 'u.username_clean', 't' => 'l.log_time', 'i' => 'l.log_ip', 'o' => 'l.log_operation');
+ $limit_time_sql = ($min_time) ? "AND l.log_time >= $min_time" : '';
+ break;
+ }
+
+ // Default total to -1 to allow editing by the event
+ $total = -1;
+
+ /**
+ * This event allows you to control the SQL query used to get the total number
+ * of reports the user can access.
+ *
+ * This total is used for the pagination and for displaying the total number
+ * of reports to the user
+ *
+ *
+ * @event core.mcp_sorting_query_before
+ * @var string sql The current SQL search string
+ * @var string mode An id related to the module(s) the user is viewing
+ * @var string type Which kind of information is this being used for displaying. Posts, topics, etc...
+ * @var int forum_id The forum id of the posts the user is trying to access, if not 0
+ * @var int topic_id The topic id of the posts the user is trying to access, if not 0
+ * @var int sort_days The max age of the oldest report to be shown, in days
+ * @var string sort_key The way the user has decided to sort the data.
+ * The valid values must be in the keys of the sort_by_* variables
+ * @var string sort_dir Either 'd' for "DESC" or 'a' for 'ASC' in the SQL query
+ * @var int limit_days The possible max ages of the oldest report for the user to choose, in days.
+ * @var array sort_by_sql SQL text (values) for the possible names of the ways of sorting data (keys).
+ * @var array sort_by_text Language text (values) for the possible names of the ways of sorting data (keys).
+ * @var int min_time Integer with the minimum post time that the user is searching for
+ * @var int limit_time_sql Time limiting options used in the SQL query.
+ * @var int total The total number of reports that exist. Only set if you want to override the result
+ * @var string where_sql Extra information included in the WHERE clause. It must end with "WHERE" or "AND" or "OR".
+ * Set to "WHERE" and set total above -1 to override the total value
+ * @since 3.1.4-RC1
+ */
+ $vars = array(
+ 'sql',
+ 'mode',
+ 'type',
+ 'forum_id',
+ 'topic_id',
+ 'sort_days',
+ 'sort_key',
+ 'sort_dir',
+ 'limit_days',
+ 'sort_by_sql',
+ 'sort_by_text',
+ 'min_time',
+ 'limit_time_sql',
+ 'total',
+ 'where_sql',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.mcp_sorting_query_before', compact($vars)));
+
+ if (!isset($sort_by_sql[$sort_key]))
+ {
+ $sort_key = $default_key;
+ }
+
+ $direction = ($sort_dir == 'd') ? 'DESC' : 'ASC';
+
+ if (is_array($sort_by_sql[$sort_key]))
+ {
+ $sort_order_sql = implode(' ' . $direction . ', ', $sort_by_sql[$sort_key]) . ' ' . $direction;
+ }
+ else
+ {
+ $sort_order_sql = $sort_by_sql[$sort_key] . ' ' . $direction;
+ }
+
+ $s_limit_days = $s_sort_key = $s_sort_dir = $sort_url = '';
+ gen_sort_selects($limit_days, $sort_by_text, $sort_days, $sort_key, $sort_dir, $s_limit_days, $s_sort_key, $s_sort_dir, $sort_url);
+
+ $template->assign_vars(array(
+ 'S_SELECT_SORT_DIR' => $s_sort_dir,
+ 'S_SELECT_SORT_KEY' => $s_sort_key,
+ 'S_SELECT_SORT_DAYS' => $s_limit_days)
+ );
+
+ if (($sort_days && $mode != 'viewlogs') || in_array($mode, array('reports', 'unapproved_topics', 'unapproved_posts', 'deleted_topics', 'deleted_posts')) || $where_sql != 'WHERE')
+ {
+ $result = $db->sql_query($sql);
+ $total = (int) $db->sql_fetchfield('total');
+ $db->sql_freeresult($result);
+ }
+ else if ($total < -1)
+ {
+ $total = -1;
+ }
+}
+
+/**
+* Validate ids
+*
+* @param array &$ids The relevant ids to check
+* @param string $table The table to find the ids in
+* @param string $sql_id The ids relevant column name
+* @param array $acl_list A list of permissions the user need to have
+* @param mixed $singe_forum Limit to one forum id (int) or the first forum found (true)
+*
+* @return mixed False if no ids were able to be retrieved, true if at least one id left.
+* Additionally, this value can be the forum_id assigned if $single_forum was set.
+* Therefore checking the result for with !== false is the best method.
+*/
+function phpbb_check_ids(&$ids, $table, $sql_id, $acl_list = false, $single_forum = false)
+{
+ global $db, $auth;
+
+ if (!is_array($ids) || empty($ids))
+ {
+ return false;
+ }
+
+ $sql = "SELECT $sql_id, forum_id FROM $table
+ WHERE " . $db->sql_in_set($sql_id, $ids);
+ $result = $db->sql_query($sql);
+
+ $ids = array();
+ $forum_id = false;
+
+ while ($row = $db->sql_fetchrow($result))
+ {
+ if ($acl_list && $row['forum_id'] && !$auth->acl_gets($acl_list, $row['forum_id']))
+ {
+ continue;
+ }
+
+ if ($acl_list && !$row['forum_id'] && !$auth->acl_getf_global($acl_list))
+ {
+ continue;
+ }
+
+ // Limit forum? If not, just assign the id.
+ if ($single_forum === false)
+ {
+ $ids[] = $row[$sql_id];
+ continue;
+ }
+
+ // Limit forum to a specific forum id?
+ // This can get really tricky, because we do not want to create a failure on global topics. :)
+ if ($row['forum_id'])
+ {
+ if ($single_forum !== true && $row['forum_id'] == (int) $single_forum)
+ {
+ $forum_id = (int) $single_forum;
+ }
+ else if ($forum_id === false)
+ {
+ $forum_id = $row['forum_id'];
+ }
+
+ if ($row['forum_id'] == $forum_id)
+ {
+ $ids[] = $row[$sql_id];
+ }
+ }
+ else
+ {
+ // Always add a global topic
+ $ids[] = $row[$sql_id];
+ }
+ }
+ $db->sql_freeresult($result);
+
+ if (!sizeof($ids))
+ {
+ return false;
+ }
+
+ // If forum id is false and ids populated we may have only global announcements selected (returning 0 because of (int) $forum_id)
+
+ return ($single_forum === false) ? true : (int) $forum_id;
+}
diff --git a/phpBB/includes/functions_messenger.php b/phpBB/includes/functions_messenger.php
index db2dea33e8..98975b9d8f 100644
--- a/phpBB/includes/functions_messenger.php
+++ b/phpBB/includes/functions_messenger.php
@@ -1,10 +1,13 @@
<?php
/**
*
-* @package phpBB3
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -18,18 +21,18 @@ if (!defined('IN_PHPBB'))
/**
* Messenger
-* @package phpBB3
*/
class messenger
{
- var $vars, $msg, $extra_headers, $replyto, $from, $subject;
+ var $msg, $extra_headers, $replyto, $from, $subject;
var $addresses = array();
var $mail_priority = MAIL_NORMAL_PRIORITY;
var $use_queue = true;
- var $tpl_obj = NULL;
- var $tpl_msg = array();
+ /** @var \phpbb\template\template */
+ protected $template;
+
var $eol = "\n";
/**
@@ -53,11 +56,29 @@ class messenger
function reset()
{
$this->addresses = $this->extra_headers = array();
- $this->vars = $this->msg = $this->replyto = $this->from = '';
+ $this->msg = $this->replyto = $this->from = '';
$this->mail_priority = MAIL_NORMAL_PRIORITY;
}
/**
+ * Set addresses for to/im as available
+ *
+ * @param array $user User row
+ */
+ function set_addresses($user)
+ {
+ if (isset($user['user_email']) && $user['user_email'])
+ {
+ $this->to($user['user_email'], (isset($user['username']) ? $user['username'] : ''));
+ }
+
+ if (isset($user['user_jabber']) && $user['user_jabber'])
+ {
+ $this->im($user['user_jabber'], (isset($user['username']) ? $user['username'] : ''));
+ }
+ }
+
+ /**
* Sets an email address to send to
*/
function to($address, $realname = '')
@@ -189,9 +210,13 @@ class messenger
/**
* Set email template to use
*/
- function template($template_file, $template_lang = '', $template_path = '')
+ function template($template_file, $template_lang = '', $template_path = '', $template_dir_prefix = '')
{
- global $config, $phpbb_root_path, $user;
+ global $config, $phpbb_root_path, $phpEx, $user, $phpbb_extension_manager;
+
+ $template_dir_prefix = (!$template_dir_prefix || $template_dir_prefix[0] === '/') ? $template_dir_prefix : '/' . $template_dir_prefix;
+
+ $this->setup_template();
if (!trim($template_file))
{
@@ -202,42 +227,68 @@ class messenger
{
// fall back to board default language if the user's language is
// missing $template_file. If this does not exist either,
- // $tpl->set_custom_template will do a trigger_error
+ // $this->template->set_filenames will do a trigger_error
$template_lang = basename($config['default_lang']);
}
- // tpl_msg now holds a template object we can use to parse the template file
- if (!isset($this->tpl_msg[$template_lang . $template_file]))
+ $ext_template_paths = array(
+ array(
+ 'name' => $template_lang . '_email',
+ 'ext_path' => 'language/' . $template_lang . '/email' . $template_dir_prefix,
+ ),
+ );
+
+ if ($template_path)
+ {
+ $template_paths = array(
+ $template_path . $template_dir_prefix,
+ );
+ }
+ else
{
- $this->tpl_msg[$template_lang . $template_file] = new template();
- $tpl = &$this->tpl_msg[$template_lang . $template_file];
+ $template_path = (!empty($user->lang_path)) ? $user->lang_path : $phpbb_root_path . 'language/';
+ $template_path .= $template_lang . '/email';
- $fallback_template_path = false;
+ $template_paths = array(
+ $template_path . $template_dir_prefix,
+ );
+
+ $board_language = basename($config['default_lang']);
- if (!$template_path)
+ // we can only specify default language fallback when the path is not a custom one for which we
+ // do not know the default language alternative
+ if ($template_lang !== $board_language)
{
- $template_path = (!empty($user->lang_path)) ? $user->lang_path : $phpbb_root_path . 'language/';
- $template_path .= $template_lang . '/email';
+ $fallback_template_path = (!empty($user->lang_path)) ? $user->lang_path : $phpbb_root_path . 'language/';
+ $fallback_template_path .= $board_language . '/email';
- // we can only specify default language fallback when the path is not a custom one for which we
- // do not know the default language alternative
- if ($template_lang !== basename($config['default_lang']))
- {
- $fallback_template_path = (!empty($user->lang_path)) ? $user->lang_path : $phpbb_root_path . 'language/';
- $fallback_template_path .= basename($config['default_lang']) . '/email';
- }
+ $template_paths[] = $fallback_template_path . $template_dir_prefix;
+
+ $ext_template_paths[] = array(
+ 'name' => $board_language . '_email',
+ 'ext_path' => 'language/' . $board_language . '/email' . $template_dir_prefix,
+ );
}
+ // If everything fails just fall back to en template
+ if ($template_lang !== 'en' && $board_language !== 'en')
+ {
+ $fallback_template_path = (!empty($user->lang_path)) ? $user->lang_path : $phpbb_root_path . 'language/';
+ $fallback_template_path .= 'en/email';
- $tpl->set_custom_template($template_path, $template_lang . '_email', $fallback_template_path);
+ $template_paths[] = $fallback_template_path . $template_dir_prefix;
- $tpl->set_filenames(array(
- 'body' => $template_file . '.txt',
- ));
+ $ext_template_paths[] = array(
+ 'name' => 'en_email',
+ 'ext_path' => 'language/en/email' . $template_dir_prefix,
+ );
+ }
}
- $this->tpl_obj = &$this->tpl_msg[$template_lang . $template_file];
- $this->vars = &$this->tpl_obj->_rootref;
- $this->tpl_msg = '';
+ $this->set_template_paths($ext_template_paths, $template_paths);
+
+ $this->template->set_filenames(array(
+ 'body' => $template_file . '.txt',
+ ));
return true;
}
@@ -247,55 +298,64 @@ class messenger
*/
function assign_vars($vars)
{
- if (!is_object($this->tpl_obj))
- {
- return;
- }
+ $this->setup_template();
- $this->tpl_obj->assign_vars($vars);
+ $this->template->assign_vars($vars);
}
function assign_block_vars($blockname, $vars)
{
- if (!is_object($this->tpl_obj))
- {
- return;
- }
+ $this->setup_template();
- $this->tpl_obj->assign_block_vars($blockname, $vars);
+ $this->template->assign_block_vars($blockname, $vars);
}
/**
* Send the mail out to the recipients set previously in var $this->addresses
+ *
+ * @param int $method User notification method NOTIFY_EMAIL|NOTIFY_IM|NOTIFY_BOTH
+ * @param bool $break Flag indicating if the function only formats the subject
+ * and the message without sending it
+ *
+ * @return bool
*/
function send($method = NOTIFY_EMAIL, $break = false)
{
- global $config, $user;
+ global $config, $user, $phpbb_dispatcher;
// We add some standard variables we always use, no need to specify them always
- if (!isset($this->vars['U_BOARD']))
- {
- $this->assign_vars(array(
- 'U_BOARD' => generate_board_url(),
- ));
- }
-
- if (!isset($this->vars['EMAIL_SIG']))
- {
- $this->assign_vars(array(
- 'EMAIL_SIG' => str_replace('<br />', "\n", "-- \n" . htmlspecialchars_decode($config['board_email_sig'])),
- ));
- }
-
- if (!isset($this->vars['SITENAME']))
- {
- $this->assign_vars(array(
- 'SITENAME' => htmlspecialchars_decode($config['sitename']),
- ));
- }
+ $this->assign_vars(array(
+ 'U_BOARD' => generate_board_url(),
+ 'EMAIL_SIG' => str_replace('<br />', "\n", "-- \n" . htmlspecialchars_decode($config['board_email_sig'])),
+ 'SITENAME' => htmlspecialchars_decode($config['sitename']),
+ ));
+
+ $subject = $this->subject;
+ $message = $this->msg;
+ /**
+ * Event to modify notification message text before parsing
+ *
+ * @event core.modify_notification_message
+ * @var int method User notification method NOTIFY_EMAIL|NOTIFY_IM|NOTIFY_BOTH
+ * @var bool break Flag indicating if the function only formats the subject
+ * and the message without sending it
+ * @var string subject The message subject
+ * @var string message The message text
+ * @since 3.1.11-RC1
+ */
+ $vars = array(
+ 'method',
+ 'break',
+ 'subject',
+ 'message',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.modify_notification_message', compact($vars)));
+ $this->subject = $subject;
+ $this->msg = $message;
+ unset($subject, $message);
// Parse message through template
- $this->msg = trim($this->tpl_obj->assign_display('body'));
+ $this->msg = trim($this->template->assign_display('body'));
// Because we use \n for newlines in the body message we need to fix line encoding errors for those admins who uploaded email template files in the wrong encoding
$this->msg = str_replace("\r\n", "\n", $this->msg);
@@ -349,7 +409,7 @@ class messenger
*/
function error($type, $msg)
{
- global $user, $phpEx, $phpbb_root_path, $config;
+ global $user, $phpEx, $phpbb_root_path, $config, $request;
// Session doesn't exist, create it
if (!isset($user->session_id) || $user->session_id === '')
@@ -357,7 +417,7 @@ class messenger
$user->session_begin();
}
- $calling_page = (!empty($_SERVER['PHP_SELF'])) ? $_SERVER['PHP_SELF'] : $_ENV['PHP_SELF'];
+ $calling_page = htmlspecialchars_decode($request->server('PHP_SELF'));
$message = '';
switch ($type)
@@ -396,17 +456,9 @@ class messenger
*/
function generate_message_id()
{
- global $config;
+ global $config, $request;
- $domain = 'phpbb.generated';
- if ($config['server_name'])
- {
- $domain = $config['server_name'];
- }
- else if (!empty($_SERVER['SERVER_NAME']))
- {
- $domain = $_SERVER['SERVER_NAME'];
- }
+ $domain = ($config['server_name']) ?: $request->server('SERVER_NAME', 'phpbb.generated');
return md5(unique_id(time())) . '@' . $domain;
}
@@ -416,7 +468,7 @@ class messenger
*/
function build_header($to, $cc, $bcc)
{
- global $config;
+ global $config, $phpbb_dispatcher;
// We could use keys here, but we won't do this for 3.0.x to retain backwards compatibility
$headers = array();
@@ -448,6 +500,16 @@ class messenger
$headers[] = 'X-MimeOLE: phpBB3';
$headers[] = 'X-phpBB-Origin: phpbb://' . str_replace(array('http://', 'https://'), array('', ''), generate_board_url());
+ /**
+ * Event to modify email header entries
+ *
+ * @event core.modify_email_headers
+ * @var array headers Array containing email header entries
+ * @since 3.1.11-RC1
+ */
+ $vars = array('headers');
+ extract($phpbb_dispatcher->trigger_event('core.modify_email_headers', compact($vars)));
+
if (sizeof($this->extra_headers))
{
$headers = array_merge($headers, $this->extra_headers);
@@ -486,14 +548,17 @@ class messenger
$use_queue = true;
}
+ $contact_name = htmlspecialchars_decode($config['board_contact_name']);
+ $board_contact = (($contact_name !== '') ? '"' . mail_encode($contact_name) . '" ' : '') . '<' . $config['board_contact'] . '>';
+
if (empty($this->replyto))
{
- $this->replyto = '<' . $config['board_contact'] . '>';
+ $this->replyto = $board_contact;
}
if (empty($this->from))
{
- $this->from = '<' . $config['board_contact'] . '>';
+ $this->from = $board_contact;
}
$encode_eol = ($config['smtp_delivery']) ? "\r\n" : $this->eol;
@@ -509,7 +574,7 @@ class messenger
foreach ($address_ary as $which_ary)
{
- $$type .= (($$type != '') ? ', ' : '') . (($which_ary['name'] != '') ? mail_encode($which_ary['name'], $encode_eol) . ' <' . $which_ary['email'] . '>' : $which_ary['email']);
+ ${$type} .= ((${$type} != '') ? ', ' : '') . (($which_ary['name'] != '') ? mail_encode($which_ary['name'], $encode_eol) . ' <' . $which_ary['email'] . '>' : $which_ary['email']);
}
}
@@ -590,7 +655,7 @@ class messenger
if (!$use_queue)
{
include_once($phpbb_root_path . 'includes/functions_jabber.' . $phpEx);
- $this->jabber = new jabber($config['jab_host'], $config['jab_port'], $config['jab_username'], htmlspecialchars_decode($config['jab_password']), $config['jab_use_ssl']);
+ $this->jabber = new jabber($config['jab_host'], $config['jab_port'], $config['jab_username'], htmlspecialchars_decode($config['jab_password']), $config['jab_use_ssl'], $config['jab_verify_peer'], $config['jab_verify_peer_name'], $config['jab_allow_self_signed']);
if (!$this->jabber->connect())
{
@@ -622,11 +687,35 @@ class messenger
unset($addresses);
return true;
}
+
+ /**
+ * Setup template engine
+ */
+ protected function setup_template()
+ {
+ global $config, $phpbb_path_helper, $user, $phpbb_extension_manager;
+
+ if ($this->template instanceof \phpbb\template\template)
+ {
+ return;
+ }
+
+ $this->template = new \phpbb\template\twig\twig($phpbb_path_helper, $config, $user, new \phpbb\template\context(), $phpbb_extension_manager);
+ }
+
+ /**
+ * Set template paths to load
+ */
+ protected function set_template_paths($path_name, $paths)
+ {
+ $this->setup_template();
+
+ $this->template->set_custom_style($path_name, $paths);
+ }
}
/**
* handling email and jabber queue
-* @package phpBB3
*/
class queue
{
@@ -670,64 +759,6 @@ class queue
}
/**
- * Obtains exclusive lock on queue cache file.
- * Returns resource representing the lock
- */
- function lock()
- {
- // For systems that can't have two processes opening
- // one file for writing simultaneously
- if (file_exists($this->cache_file . '.lock'))
- {
- $mode = 'rb';
- }
- else
- {
- $mode = 'wb';
- }
-
- $lock_fp = @fopen($this->cache_file . '.lock', $mode);
-
- if ($mode == 'wb')
- {
- if (!$lock_fp)
- {
- // Two processes may attempt to create lock file at the same time.
- // Have the losing process try opening the lock file again for reading
- // on the assumption that the winning process created it
- $mode = 'rb';
- $lock_fp = @fopen($this->cache_file . '.lock', $mode);
- }
- else
- {
- // Only need to set mode when the lock file is written
- @chmod($this->cache_file . '.lock', 0666);
- }
- }
-
- if ($lock_fp)
- {
- @flock($lock_fp, LOCK_EX);
- }
-
- return $lock_fp;
- }
-
- /**
- * Releases lock on queue cache file, using resource obtained from lock()
- */
- function unlock($lock_fp)
- {
- // lock() will return null if opening lock file, and thus locking, failed.
- // Accept null values here so that client code does not need to check them
- if ($lock_fp)
- {
- @flock($lock_fp, LOCK_UN);
- fclose($lock_fp);
- }
- }
-
- /**
* Process queue
* Using lock file
*/
@@ -735,7 +766,8 @@ class queue
{
global $db, $config, $phpEx, $phpbb_root_path, $user;
- $lock_fp = $this->lock();
+ $lock = new \phpbb\lock\flock($this->cache_file);
+ $lock->acquire();
// avoid races, check file existence once
$have_cache_file = file_exists($this->cache_file);
@@ -746,7 +778,7 @@ class queue
set_config('last_queue_run', time(), true);
}
- $this->unlock($lock_fp);
+ $lock->release();
return;
}
@@ -798,24 +830,26 @@ class queue
}
include_once($phpbb_root_path . 'includes/functions_jabber.' . $phpEx);
- $this->jabber = new jabber($config['jab_host'], $config['jab_port'], $config['jab_username'], htmlspecialchars_decode($config['jab_password']), $config['jab_use_ssl']);
+ $this->jabber = new jabber($config['jab_host'], $config['jab_port'], $config['jab_username'], htmlspecialchars_decode($config['jab_password']), $config['jab_use_ssl'], $config['jab_verify_peer'], $config['jab_verify_peer_name'], $config['jab_allow_self_signed']);
if (!$this->jabber->connect())
{
- messenger::error('JABBER', $user->lang['ERR_JAB_CONNECT']);
+ $messenger = new messenger();
+ $messenger->error('JABBER', $user->lang['ERR_JAB_CONNECT']);
continue 2;
}
if (!$this->jabber->login())
{
- messenger::error('JABBER', $user->lang['ERR_JAB_AUTH']);
+ $messenger = new messenger();
+ $messenger->error('JABBER', $user->lang['ERR_JAB_AUTH']);
continue 2;
}
break;
default:
- $this->unlock($lock_fp);
+ $lock->release();
return;
}
@@ -841,7 +875,8 @@ class queue
if (!$result)
{
- messenger::error('EMAIL', $err_msg);
+ $messenger = new messenger();
+ $messenger->error('EMAIL', $err_msg);
continue 2;
}
break;
@@ -851,7 +886,8 @@ class queue
{
if ($this->jabber->send_message($address, $msg, $subject) === false)
{
- messenger::error('JABBER', $this->jabber->get_log());
+ $messenger = new messenger();
+ $messenger->error('JABBER', $this->jabber->get_log());
continue 3;
}
}
@@ -887,11 +923,16 @@ class queue
fwrite($fp, "<?php\nif (!defined('IN_PHPBB')) exit;\n\$this->queue_data = unserialize(" . var_export(serialize($this->queue_data), true) . ");\n\n?>");
fclose($fp);
+ if (function_exists('opcache_invalidate'))
+ {
+ @opcache_invalidate($this->cache_file);
+ }
+
phpbb_chmod($this->cache_file, CHMOD_READ | CHMOD_WRITE);
}
}
- $this->unlock($lock_fp);
+ $lock->release();
}
/**
@@ -904,7 +945,8 @@ class queue
return;
}
- $lock_fp = $this->lock();
+ $lock = new \phpbb\lock\flock($this->cache_file);
+ $lock->acquire();
if (file_exists($this->cache_file))
{
@@ -928,10 +970,17 @@ class queue
fwrite($fp, "<?php\nif (!defined('IN_PHPBB')) exit;\n\$this->queue_data = unserialize(" . var_export(serialize($this->data), true) . ");\n\n?>");
fclose($fp);
+ if (function_exists('opcache_invalidate'))
+ {
+ @opcache_invalidate($this->cache_file);
+ }
+
phpbb_chmod($this->cache_file, CHMOD_READ | CHMOD_WRITE);
+
+ $this->data = array();
}
- $this->unlock($lock_fp);
+ $lock->release();
}
}
@@ -1020,14 +1069,25 @@ function smtpmail($addresses, $subject, $message, &$err_msg, $headers = false)
$smtp->add_backtrace('Connecting to ' . $config['smtp_host'] . ':' . $config['smtp_port']);
// Ok we have error checked as much as we can to this point let's get on it already.
- if (!class_exists('phpbb_error_collector'))
+ if (!class_exists('\phpbb\error_collector'))
{
global $phpbb_root_path, $phpEx;
include($phpbb_root_path . 'includes/error_collector.' . $phpEx);
}
- $collector = new phpbb_error_collector;
+ $collector = new \phpbb\error_collector;
$collector->install();
- $smtp->socket = fsockopen($config['smtp_host'], $config['smtp_port'], $errno, $errstr, 20);
+
+ $options = array();
+ $verify_peer = (bool) $config['smtp_verify_peer'];
+ $verify_peer_name = (bool) $config['smtp_verify_peer_name'];
+ $allow_self_signed = (bool) $config['smtp_allow_self_signed'];
+ $remote_socket = $config['smtp_host'] . ':' . $config['smtp_port'];
+
+ // Set ssl context options, see http://php.net/manual/en/context.ssl.php
+ $options['ssl'] = array('verify_peer' => $verify_peer, 'verify_peer_name' => $verify_peer_name, 'allow_self_signed' => $allow_self_signed);
+ $socket_context = stream_context_create($options);
+
+ $smtp->socket = @stream_socket_client($remote_socket, $errno, $errstr, 20, STREAM_CLIENT_CONNECT, $socket_context);
$collector->uninstall();
$error_contents = $collector->format_errors();
@@ -1158,12 +1218,12 @@ function smtpmail($addresses, $subject, $message, &$err_msg, $headers = false)
* SMTP Class
* Auth Mechanisms originally taken from the AUTH Modules found within the PHP Extension and Application Repository (PEAR)
* See docs/AUTHORS for more details
-* @package phpBB3
*/
class smtp_class
{
var $server_response = '';
var $socket = 0;
+ protected $socket_tls = false;
var $responses = array();
var $commands = array();
var $numeric_response_code = 0;
@@ -1314,30 +1374,29 @@ class smtp_class
}
}
- // Try EHLO first
- $this->server_send("EHLO {$local_host}");
- if ($err_msg = $this->server_parse('250', __LINE__))
+ $hello_result = $this->hello($local_host);
+ if (!is_null($hello_result))
{
- // a 503 response code means that we're already authenticated
- if ($this->numeric_response_code == 503)
- {
- return false;
- }
-
- // If EHLO fails, we try HELO
- $this->server_send("HELO {$local_host}");
- if ($err_msg = $this->server_parse('250', __LINE__))
- {
- return ($this->numeric_response_code == 503) ? false : $err_msg;
- }
+ return $hello_result;
}
- foreach ($this->responses as $response)
+ // SMTP STARTTLS (RFC 3207)
+ if (!$this->socket_tls)
{
- $response = explode(' ', $response);
- $response_code = $response[0];
- unset($response[0]);
- $this->commands[$response_code] = implode(' ', $response);
+ $this->socket_tls = $this->starttls();
+
+ if ($this->socket_tls)
+ {
+ // Switched to TLS
+ // RFC 3207: "The client MUST discard any knowledge obtained from the server, [...]"
+ // So say hello again
+ $hello_result = $this->hello($local_host);
+
+ if (!is_null($hello_result))
+ {
+ return $hello_result;
+ }
+ }
}
// If we are not authenticated yet, something might be wrong if no username and passwd passed
@@ -1384,6 +1443,79 @@ class smtp_class
}
/**
+ * SMTP EHLO/HELO
+ *
+ * @return mixed Null if the authentication process is supposed to continue
+ * False if already authenticated
+ * Error message (string) otherwise
+ */
+ protected function hello($hostname)
+ {
+ // Try EHLO first
+ $this->server_send("EHLO $hostname");
+ if ($err_msg = $this->server_parse('250', __LINE__))
+ {
+ // a 503 response code means that we're already authenticated
+ if ($this->numeric_response_code == 503)
+ {
+ return false;
+ }
+
+ // If EHLO fails, we try HELO
+ $this->server_send("HELO $hostname");
+ if ($err_msg = $this->server_parse('250', __LINE__))
+ {
+ return ($this->numeric_response_code == 503) ? false : $err_msg;
+ }
+ }
+
+ foreach ($this->responses as $response)
+ {
+ $response = explode(' ', $response);
+ $response_code = $response[0];
+ unset($response[0]);
+ $this->commands[$response_code] = implode(' ', $response);
+ }
+ }
+
+ /**
+ * SMTP STARTTLS (RFC 3207)
+ *
+ * @return bool Returns true if TLS was started
+ * Otherwise false
+ */
+ protected function starttls()
+ {
+ if (!function_exists('stream_socket_enable_crypto'))
+ {
+ return false;
+ }
+
+ if (!isset($this->commands['STARTTLS']))
+ {
+ return false;
+ }
+
+ $this->server_send('STARTTLS');
+
+ if ($err_msg = $this->server_parse('220', __LINE__))
+ {
+ return false;
+ }
+
+ $result = false;
+ $stream_meta = stream_get_meta_data($this->socket);
+
+ if (socket_set_blocking($this->socket, 1))
+ {
+ $result = stream_socket_enable_crypto($this->socket, true, STREAM_CRYPTO_METHOD_TLS_CLIENT);
+ socket_set_blocking($this->socket, (int) $stream_meta['blocked']);
+ }
+
+ return $result;
+ }
+
+ /**
* Pop before smtp authentication
*/
function pop_before_smtp($hostname, $username, $password)
@@ -1666,12 +1798,12 @@ function phpbb_mail($to, $subject, $msg, $headers, $eol, &$err_msg)
// Reference: http://bugs.php.net/bug.php?id=15841
$headers = implode($eol, $headers);
- if (!class_exists('phpbb_error_collector'))
+ if (!class_exists('\phpbb\error_collector'))
{
include($phpbb_root_path . 'includes/error_collector.' . $phpEx);
}
- $collector = new phpbb_error_collector;
+ $collector = new \phpbb\error_collector;
$collector->install();
// On some PHP Versions mail() *may* fail if there are newlines within the subject.
@@ -1684,5 +1816,3 @@ function phpbb_mail($to, $subject, $msg, $headers, $eol, &$err_msg)
return $result;
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/functions_module.php b/phpBB/includes/functions_module.php
index 0cc2425b28..90d59cfd1e 100644
--- a/phpBB/includes/functions_module.php
+++ b/phpBB/includes/functions_module.php
@@ -1,10 +1,13 @@
<?php
/**
*
-* @package phpBB3
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -18,7 +21,6 @@ if (!defined('IN_PHPBB'))
/**
* Class handling all types of 'plugins' (a future term)
-* @package phpBB3
*/
class p_master
{
@@ -81,7 +83,7 @@ class p_master
function list_modules($p_class)
{
global $auth, $db, $user, $cache;
- global $config, $phpbb_root_path, $phpEx;
+ global $config, $phpbb_root_path, $phpEx, $phpbb_dispatcher;
// Sanitise for future path use, it's escaped as appropriate for queries
$this->p_class = str_replace(array('.', '/', '\\'), '', basename($p_class));
@@ -126,10 +128,19 @@ class p_master
// Clean up module cache array to only let survive modules the user can access
$right_id = false;
+
+ $hide_categories = array();
foreach ($this->module_cache['modules'] as $key => $row)
{
+ // When the module has no mode (category) we check whether it has visible children
+ // before listing it as well.
+ if (!$row['module_mode'])
+ {
+ $hide_categories[(int) $row['module_id']] = $key;
+ }
+
// Not allowed to view module?
- if (!$this->module_auth($row['module_auth']))
+ if (!$this->module_auth_self($row['module_auth']))
{
unset($this->module_cache['modules'][$key]);
continue;
@@ -162,6 +173,22 @@ class p_master
$right_id = $row['right_id'];
continue;
}
+
+ if ($row['module_mode'])
+ {
+ // The parent category has a visible child
+ // So remove it and all its parents from the hide array
+ unset($hide_categories[(int) $row['parent_id']]);
+ foreach ($this->module_cache['parents'][$row['module_id']] as $module_id => $row_id)
+ {
+ unset($hide_categories[$module_id]);
+ }
+ }
+ }
+
+ foreach ($hide_categories as $module_id => $row_id)
+ {
+ unset($this->module_cache['modules'][$row_id]);
}
// Re-index (this is needed, else we are not able to array_slice later)
@@ -221,13 +248,27 @@ class p_master
// We need to prefix the functions to not create a naming conflict
// Function for building 'url_extra'
- $url_func = '_module_' . $row['module_basename'] . '_url';
+ $short_name = $this->get_short_name($row['module_basename']);
+
+ $url_func = 'phpbb_module_' . $short_name . '_url';
+ if (!function_exists($url_func))
+ {
+ $url_func = '_module_' . $short_name . '_url';
+ }
// Function for building the language name
- $lang_func = '_module_' . $row['module_basename'] . '_lang';
+ $lang_func = 'phpbb_module_' . $short_name . '_lang';
+ if (!function_exists($lang_func))
+ {
+ $lang_func = '_module_' . $short_name . '_lang';
+ }
// Custom function for calling parameters on module init (for example assigning template variables)
- $custom_func = '_module_' . $row['module_basename'];
+ $custom_func = 'phpbb_module_' . $short_name;
+ if (!function_exists($custom_func))
+ {
+ $custom_func = '_module_' . $short_name;
+ }
$names[$row['module_basename'] . '_' . $row['module_mode']][] = true;
@@ -258,6 +299,20 @@ class p_master
$custom_func($row['module_mode'], $module_row);
}
+ /**
+ * This event allows to modify parameters for building modules list
+ *
+ * @event core.modify_module_row
+ * @var string url_func Function for building 'url_extra'
+ * @var string lang_func Function for building the language name
+ * @var string custom_func Custom function for calling parameters on module init
+ * @var array row Array holding the basic module data
+ * @var array module_row Array holding the module display parameters
+ * @since 3.1.0-b3
+ */
+ $vars = array('url_func', 'lang_func', 'custom_func', 'row', 'module_row');
+ extract($phpbb_dispatcher->trigger_event('core.modify_module_row', compact($vars)));
+
$this->module_ary[] = $module_row;
}
@@ -275,6 +330,11 @@ class p_master
*/
function loaded($module_basename, $module_mode = false)
{
+ if (!$this->is_full_class($module_basename))
+ {
+ $module_basename = $this->p_class . '_' . $module_basename;
+ }
+
if (empty($this->loaded_cache))
{
$this->loaded_cache = array();
@@ -309,11 +369,26 @@ class p_master
}
/**
- * Check module authorisation
+ * Check module authorisation.
+ *
+ * This is a non-static version that uses $this->acl_forum_id
+ * for the forum id.
+ */
+ function module_auth_self($module_auth)
+ {
+ return self::module_auth($module_auth, $this->acl_forum_id);
+ }
+
+ /**
+ * Check module authorisation.
+ *
+ * This is a static version, it must be given $forum_id.
+ * See also module_auth_self.
*/
- function module_auth($module_auth, $forum_id = false)
+ static function module_auth($module_auth, $forum_id)
{
global $auth, $config;
+ global $request, $phpbb_extension_manager, $phpbb_dispatcher;
$module_auth = trim($module_auth);
@@ -330,6 +405,31 @@ class p_master
[(),] |
[^\s(),]+)/x', $module_auth, $match);
+ // Valid tokens for auth and their replacements
+ $valid_tokens = array(
+ 'acl_([a-z0-9_]+)(,\$id)?' => '(int) $auth->acl_get(\'\\1\'\\2)',
+ '\$id' => '(int) $forum_id',
+ 'aclf_([a-z0-9_]+)' => '(int) $auth->acl_getf_global(\'\\1\')',
+ 'cfg_([a-z0-9_]+)' => '(int) $config[\'\\1\']',
+ 'request_([a-zA-Z0-9_]+)' => '$request->variable(\'\\1\', false)',
+ 'ext_([a-zA-Z0-9_/]+)' => 'array_key_exists(\'\\1\', $phpbb_extension_manager->all_enabled())',
+ 'authmethod_([a-z0-9_\\\\]+)' => '($config[\'auth_method\'] === \'\\1\')',
+ );
+
+ /**
+ * Alter tokens for module authorisation check
+ *
+ * @event core.module_auth
+ * @var array valid_tokens Valid tokens and their auth check
+ * replacements
+ * @var string module_auth The module_auth of the current
+ * module
+ * @var int forum_id The current forum_id
+ * @since 3.1.0-a3
+ */
+ $vars = array('valid_tokens', 'module_auth', 'forum_id');
+ extract($phpbb_dispatcher->trigger_event('core.module_auth', compact($vars)));
+
$tokens = $match[0];
for ($i = 0, $size = sizeof($tokens); $i < $size; $i++)
{
@@ -345,7 +445,7 @@ class p_master
break;
default:
- if (!preg_match('#(?:acl_([a-z0-9_]+)(,\$id)?)|(?:\$id)|(?:aclf_([a-z0-9_]+))|(?:cfg_([a-z0-9_]+))|(?:request_([a-zA-Z0-9_]+))#', $token))
+ if (!preg_match('#(?:' . implode(array_keys($valid_tokens), ')|(?:') . ')#', $token))
{
$token = '';
}
@@ -355,13 +455,22 @@ class p_master
$module_auth = implode(' ', $tokens);
- // Make sure $id seperation is working fine
+ // Make sure $id separation is working fine
$module_auth = str_replace(' , ', ',', $module_auth);
- $forum_id = ($forum_id === false) ? $this->acl_forum_id : $forum_id;
+ $module_auth = preg_replace(
+ // Array keys with # prepended/appended
+ array_map(function($value) {
+ return '#' . $value . '#';
+ }, array_keys($valid_tokens)),
+ array_values($valid_tokens),
+ $module_auth
+ );
$is_auth = false;
- eval('$is_auth = (int) (' . preg_replace(array('#acl_([a-z0-9_]+)(,\$id)?#', '#\$id#', '#aclf_([a-z0-9_]+)#', '#cfg_([a-z0-9_]+)#', '#request_([a-zA-Z0-9_]+)#'), array('(int) $auth->acl_get(\'\\1\'\\2)', '(int) $forum_id', '(int) $auth->acl_getf_global(\'\\1\')', '(int) $config[\'\\1\']', '!empty($_REQUEST[\'\\1\'])'), $module_auth) . ');');
+ // @codingStandardsIgnoreStart
+ eval('$is_auth = (int) (' . $module_auth . ');');
+ // @codingStandardsIgnoreEnd
return $is_auth;
}
@@ -380,6 +489,17 @@ class p_master
$id = request_var('icat', '');
}
+ // Restore the backslashes in class names
+ if (strpos($id, '-') !== false)
+ {
+ $id = str_replace('-', '\\', $id);
+ }
+
+ if ($id && !is_numeric($id) && !$this->is_full_class($id))
+ {
+ $id = $this->p_class . '_' . $id;
+ }
+
$category = false;
foreach ($this->module_ary as $row_id => $item_ary)
{
@@ -388,9 +508,9 @@ class p_master
// If this is a module and no mode selected, select first mode
// If no category or module selected, go active for first module in first category
if (
- (($item_ary['name'] === $id || $item_ary['id'] === (int) $id) && (($item_ary['mode'] == $mode && !$item_ary['cat']) || ($icat && $item_ary['cat']))) ||
+ (($item_ary['name'] === $id || $item_ary['name'] === $this->p_class . '_' . $id || $item_ary['id'] === (int) $id) && (($item_ary['mode'] == $mode && !$item_ary['cat']) || ($icat && $item_ary['cat']))) ||
($item_ary['parent'] === $category && !$item_ary['cat'] && !$icat && $item_ary['display']) ||
- (($item_ary['name'] === $id || $item_ary['id'] === (int) $id) && !$mode && !$item_ary['cat']) ||
+ (($item_ary['name'] === $id || $item_ary['name'] === $this->p_class . '_' . $id || $item_ary['id'] === (int) $id) && !$mode && !$item_ary['cat']) ||
(!$id && !$mode && !$item_ary['cat'] && $item_ary['display'])
)
{
@@ -426,10 +546,14 @@ class p_master
* Loads currently active module
*
* This method loads a given module, passing it the relevant id and mode.
+ *
+ * @param string|false $mode mode, as passed through to the module
+ * @param string|false $module_url If supplied, we use this module url
+ * @param bool $execute_module If true, at the end we execute the main method for the new instance
*/
function load_active($mode = false, $module_url = false, $execute_module = true)
{
- global $phpbb_root_path, $phpbb_admin_path, $phpEx, $user;
+ global $phpbb_root_path, $phpbb_admin_path, $phpEx, $user, $template;
$module_path = $this->include_path . $this->p_class;
$icat = request_var('icat', '');
@@ -439,75 +563,115 @@ class p_master
trigger_error('MODULE_NOT_ACCESS', E_USER_ERROR);
}
- if (!class_exists("{$this->p_class}_$this->p_name"))
+ // new modules use the full class names, old ones are always called <type>_<name>, e.g. acp_board
+ if (!class_exists($this->p_name))
{
- if (!file_exists("$module_path/{$this->p_class}_$this->p_name.$phpEx"))
+ if (!file_exists("$module_path/{$this->p_name}.$phpEx"))
{
- trigger_error($user->lang('MODULE_NOT_FIND', "$module_path/{$this->p_class}_$this->p_name.$phpEx"), E_USER_ERROR);
+ trigger_error($user->lang('MODULE_NOT_FIND', "$module_path/{$this->p_name}.$phpEx"), E_USER_ERROR);
}
- include("$module_path/{$this->p_class}_$this->p_name.$phpEx");
+ include("$module_path/{$this->p_name}.$phpEx");
- if (!class_exists("{$this->p_class}_$this->p_name"))
+ if (!class_exists($this->p_name))
{
- trigger_error($user->lang('MODULE_FILE_INCORRECT_CLASS', "$module_path/{$this->p_class}_$this->p_name.$phpEx", "{$this->p_class}_$this->p_name"), E_USER_ERROR);
+ trigger_error($user->lang('MODULE_FILE_INCORRECT_CLASS', "$module_path/{$this->p_name}.$phpEx", $this->p_name), E_USER_ERROR);
}
+ }
- if (!empty($mode))
- {
- $this->p_mode = $mode;
- }
+ if (!empty($mode))
+ {
+ $this->p_mode = $mode;
+ }
- // Create a new instance of the desired module ... if it has a
- // constructor it will of course be executed
- $instance = "{$this->p_class}_$this->p_name";
+ // Create a new instance of the desired module ...
+ $class_name = $this->p_name;
- $this->module = new $instance($this);
+ $this->module = new $class_name($this);
- // We pre-define the action parameter we are using all over the place
- if (defined('IN_ADMIN'))
+ // We pre-define the action parameter we are using all over the place
+ if (defined('IN_ADMIN'))
+ {
+ /*
+ * If this is an extension module, we'll try to automatically set
+ * the style paths for the extension (the ext author can change them
+ * if necessary).
+ */
+ $module_dir = explode('\\', get_class($this->module));
+
+ // 0 vendor, 1 extension name, ...
+ if (isset($module_dir[1]))
{
- // Is first module automatically enabled a duplicate and the category not passed yet?
- if (!$icat && $this->module_ary[$this->active_module_row_id]['is_duplicate'])
+ $module_style_dir = $phpbb_root_path . 'ext/' . $module_dir[0] . '/' . $module_dir[1] . '/adm/style';
+
+ if (is_dir($module_style_dir))
{
- $icat = $this->module_ary[$this->active_module_row_id]['parent'];
+ $template->set_custom_style(array(
+ array(
+ 'name' => 'adm',
+ 'ext_path' => 'adm/style/',
+ ),
+ ), array($module_style_dir, $phpbb_admin_path . 'style'));
}
+ }
- // Not being able to overwrite ;)
- $this->module->u_action = append_sid("{$phpbb_admin_path}index.$phpEx", "i={$this->p_name}") . (($icat) ? '&amp;icat=' . $icat : '') . "&amp;mode={$this->p_mode}";
+ // Is first module automatically enabled a duplicate and the category not passed yet?
+ if (!$icat && $this->module_ary[$this->active_module_row_id]['is_duplicate'])
+ {
+ $icat = $this->module_ary[$this->active_module_row_id]['parent'];
}
- else
+
+ // Not being able to overwrite ;)
+ $this->module->u_action = append_sid("{$phpbb_admin_path}index.$phpEx", 'i=' . $this->get_module_identifier($this->p_name)) . (($icat) ? '&amp;icat=' . $icat : '') . "&amp;mode={$this->p_mode}";
+ }
+ else
+ {
+ /*
+ * If this is an extension module, we'll try to automatically set
+ * the style paths for the extension (the ext author can change them
+ * if necessary).
+ */
+ $module_dir = explode('\\', get_class($this->module));
+
+ // 0 vendor, 1 extension name, ...
+ if (isset($module_dir[1]))
{
- // If user specified the module url we will use it...
- if ($module_url !== false)
- {
- $this->module->u_action = $module_url;
- }
- else
+ $module_style_dir = 'ext/' . $module_dir[0] . '/' . $module_dir[1] . '/styles';
+
+ if (is_dir($phpbb_root_path . $module_style_dir))
{
- $this->module->u_action = $phpbb_root_path . (($user->page['page_dir']) ? $user->page['page_dir'] . '/' : '') . $user->page['page_name'];
+ $template->set_style(array($module_style_dir, 'styles'));
}
-
- $this->module->u_action = append_sid($this->module->u_action, "i={$this->p_name}") . (($icat) ? '&amp;icat=' . $icat : '') . "&amp;mode={$this->p_mode}";
}
- // Add url_extra parameter to u_action url
- if (!empty($this->module_ary) && $this->active_module !== false && $this->module_ary[$this->active_module_row_id]['url_extra'])
+ // If user specified the module url we will use it...
+ if ($module_url !== false)
{
- $this->module->u_action .= $this->module_ary[$this->active_module_row_id]['url_extra'];
+ $this->module->u_action = $module_url;
}
-
- // Assign the module path for re-usage
- $this->module->module_path = $module_path . '/';
-
- // Execute the main method for the new instance, we send the module id and mode as parameters
- // Users are able to call the main method after this function to be able to assign additional parameters manually
- if ($execute_module)
+ else
{
- $this->module->main($this->p_name, $this->p_mode);
+ $this->module->u_action = $phpbb_root_path . (($user->page['page_dir']) ? $user->page['page_dir'] . '/' : '') . $user->page['page_name'];
}
- return;
+ $this->module->u_action = append_sid($this->module->u_action, 'i=' . $this->get_module_identifier($this->p_name)) . (($icat) ? '&amp;icat=' . $icat : '') . "&amp;mode={$this->p_mode}";
+ }
+
+ // Add url_extra parameter to u_action url
+ if (!empty($this->module_ary) && $this->active_module !== false && $this->module_ary[$this->active_module_row_id]['url_extra'])
+ {
+ $this->module->u_action .= $this->module_ary[$this->active_module_row_id]['url_extra'];
+ }
+
+ // Assign the module path for re-usage
+ $this->module->module_path = $module_path . '/';
+
+ // Execute the main method for the new instance, we send the module id and mode as parameters
+ // Users are able to call the main method after this function to be able to assign additional parameters manually
+ if ($execute_module)
+ {
+ $short_name = preg_replace("#^{$this->p_class}_#", '', $this->p_name);
+ $this->module->main($short_name, $this->p_mode);
}
}
@@ -546,7 +710,7 @@ class p_master
// If we find a name by this id and being enabled we have our active one...
foreach ($this->module_ary as $row_id => $item_ary)
{
- if (($item_ary['name'] === $id || $item_ary['id'] === (int) $id) && $item_ary['display'])
+ if (($item_ary['name'] === $id || $item_ary['id'] === (int) $id) && $item_ary['display'] || $item_ary['name'] === $this->p_class . '_' . $id)
{
if ($mode === false || $mode === $item_ary['mode'])
{
@@ -734,7 +898,26 @@ class p_master
}
}
- $u_title = $module_url . $delim . 'i=' . (($item_ary['cat']) ? $item_ary['id'] : $item_ary['name'] . (($item_ary['is_duplicate']) ? '&amp;icat=' . $current_id : '') . '&amp;mode=' . $item_ary['mode']);
+ $u_title = $module_url . $delim . 'i=';
+ // if the item has a name use it, else use its id
+ if (empty($item_ary['name']))
+ {
+ $u_title .= $item_ary['id'];
+ }
+ else
+ {
+ // if the category has a name, then use it.
+ $u_title .= $this->get_module_identifier($item_ary['name']);
+ }
+ // If the item is not a category append the mode
+ if (!$item_ary['cat'])
+ {
+ if ($item_ary['is_duplicate'])
+ {
+ $u_title .= '&amp;icat=' . $current_id;
+ }
+ $u_title .= '&amp;mode=' . $item_ary['mode'];
+ }
// Was not allowed in categories before - /*!$item_ary['cat'] && */
$u_title .= (isset($item_ary['url_extra'])) ? $item_ary['url_extra'] : '';
@@ -790,9 +973,22 @@ class p_master
/**
* Load module as the current active one without the need for registering it
+ *
+ * @param string $class module class (acp/mcp/ucp)
+ * @param string $name module name (class name of the module, or its basename
+ * phpbb_ext_foo_acp_bar_module, ucp_zebra or zebra)
+ * @param string $mode mode, as passed through to the module
+ *
*/
function load($class, $name, $mode = false)
{
+ // new modules use the full class names, old ones are always called <class>_<name>, e.g. acp_board
+ // in the latter case this function may be called as load('acp', 'board')
+ if (!class_exists($name) && substr($name, 0, strlen($class) + 1) !== $class . '_')
+ {
+ $name = $class . '_' . $name;
+ }
+
$this->p_class = $class;
$this->p_name = $name;
@@ -805,7 +1001,7 @@ class p_master
/**
* Display module
*/
- function display($page_title, $display_online_list = true)
+ function display($page_title, $display_online_list = false)
{
global $template, $user;
@@ -840,7 +1036,7 @@ class p_master
{
foreach ($this->module_ary as $row_id => $item_ary)
{
- if (($item_ary['name'] === $id || $item_ary['id'] === (int) $id) && (!$mode || $item_ary['mode'] === $mode))
+ if (($item_ary['name'] === $id || $item_ary['name'] === $this->p_class . '_' . $id || $item_ary['id'] === (int) $id) && (!$mode || $item_ary['mode'] === $mode))
{
$this->module_ary[$row_id]['display'] = (int) $display;
}
@@ -852,32 +1048,98 @@ class p_master
*/
function add_mod_info($module_class)
{
- global $user, $phpEx;
+ global $config, $user, $phpEx, $phpbb_extension_manager;
+
+ $finder = $phpbb_extension_manager->get_finder();
- if (file_exists($user->lang_path . $user->lang_name . '/mods'))
+ // We grab the language files from the default, English and user's language.
+ // So we can fall back to the other files like we do when using add_lang()
+ $default_lang_files = $english_lang_files = $user_lang_files = array();
+
+ // Search for board default language if it's not the user language
+ if ($config['default_lang'] != $user->lang_name)
{
- $add_files = array();
+ $default_lang_files = $finder
+ ->prefix('info_' . strtolower($module_class) . '_')
+ ->suffix(".$phpEx")
+ ->extension_directory('/language/' . basename($config['default_lang']))
+ ->core_path('language/' . basename($config['default_lang']) . '/mods/')
+ ->find();
+ }
- $dir = @opendir($user->lang_path . $user->lang_name . '/mods');
+ // Search for english, if its not the default or user language
+ if ($config['default_lang'] != 'en' && $user->lang_name != 'en')
+ {
+ $english_lang_files = $finder
+ ->prefix('info_' . strtolower($module_class) . '_')
+ ->suffix(".$phpEx")
+ ->extension_directory('/language/en')
+ ->core_path('language/en/mods/')
+ ->find();
+ }
- if ($dir)
- {
- while (($entry = readdir($dir)) !== false)
- {
- if (strpos($entry, 'info_' . strtolower($module_class) . '_') === 0 && substr(strrchr($entry, '.'), 1) == $phpEx)
- {
- $add_files[] = 'mods/' . substr(basename($entry), 0, -(strlen($phpEx) + 1));
- }
- }
- closedir($dir);
- }
+ // Find files in the user's language
+ $user_lang_files = $finder
+ ->prefix('info_' . strtolower($module_class) . '_')
+ ->suffix(".$phpEx")
+ ->extension_directory('/language/' . $user->lang_name)
+ ->core_path('language/' . $user->lang_name . '/mods/')
+ ->find();
- if (sizeof($add_files))
- {
- $user->add_lang($add_files);
- }
+ $lang_files = array_merge($english_lang_files, $default_lang_files, $user_lang_files);
+ foreach ($lang_files as $lang_file => $ext_name)
+ {
+ $user->add_lang_ext($ext_name, $lang_file);
}
}
-}
-?> \ No newline at end of file
+ /**
+ * Retrieve shortened module basename for legacy basenames (with xcp_ prefix)
+ *
+ * @param string $basename A module basename
+ * @return string The basename if it starts with phpbb_ or the basename with
+ * the current p_class (e.g. acp_) stripped.
+ */
+ protected function get_short_name($basename)
+ {
+ if (substr($basename, 0, 6) === 'phpbb\\' || strpos($basename, '\\') !== false)
+ {
+ return $basename;
+ }
+
+ // strip xcp_ prefix from old classes
+ return substr($basename, strlen($this->p_class) + 1);
+ }
+
+ /**
+ * If the basename contains a \ we don't use that for the URL.
+ *
+ * Firefox is currently unable to correctly copy a urlencoded \
+ * so users will be unable to post links to modules.
+ * However we can replace them with dashes and re-replace them later
+ *
+ * @param string $basename Basename of the module
+ * @return string Identifier that should be used for
+ * module link creation
+ */
+ protected function get_module_identifier($basename)
+ {
+ if (strpos($basename, '\\') === false)
+ {
+ return $basename;
+ }
+
+ return str_replace('\\', '-', $basename);
+ }
+
+ /**
+ * Checks whether the given module basename is a correct class name
+ *
+ * @param string $basename A module basename
+ * @return bool True if the basename starts with phpbb_ or (x)cp_, false otherwise
+ */
+ protected function is_full_class($basename)
+ {
+ return (strpos($basename, '\\') !== false || preg_match('/^(ucp|mcp|acp)_/', $basename));
+ }
+}
diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php
index 3f0a78a7cb..9712b6e922 100644
--- a/phpBB/includes/functions_posting.php
+++ b/phpBB/includes/functions_posting.php
@@ -1,10 +1,13 @@
<?php
/**
*
-* @package phpBB3
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -21,9 +24,11 @@ if (!defined('IN_PHPBB'))
*/
function generate_smilies($mode, $forum_id)
{
- global $auth, $db, $user, $config, $template;
- global $phpEx, $phpbb_root_path;
+ global $db, $user, $config, $template, $phpbb_dispatcher;
+ global $phpEx, $phpbb_root_path, $phpbb_container, $phpbb_path_helper;
+ $base_url = append_sid("{$phpbb_root_path}posting.$phpEx", 'mode=smilies&amp;f=' . $forum_id);
+ $pagination = $phpbb_container->get('pagination');
$start = request_var('start', 0);
if ($mode == 'window')
@@ -62,10 +67,8 @@ function generate_smilies($mode, $forum_id)
'body' => 'posting_smilies.html')
);
- $template->assign_var('PAGINATION',
- generate_pagination(append_sid("{$phpbb_root_path}posting.$phpEx", 'mode=smilies&amp;f=' . $forum_id),
- $smiley_count, $config['smilies_per_page'], $start, true)
- );
+ $start = $pagination->validate_start($start, $config['smilies_per_page'], $smiley_count);
+ $pagination->generate_template_pagination($base_url, 'pagination', 'start', $smiley_count, $config['smilies_per_page'], $start);
}
$display_link = false;
@@ -112,10 +115,19 @@ function generate_smilies($mode, $forum_id)
if (sizeof($smilies))
{
- $root_path = (defined('PHPBB_USE_BOARD_URL_PATH') && PHPBB_USE_BOARD_URL_PATH) ? generate_board_url() . '/' : $phpbb_root_path;
+ $root_path = (defined('PHPBB_USE_BOARD_URL_PATH') && PHPBB_USE_BOARD_URL_PATH) ? generate_board_url() . '/' : $phpbb_path_helper->get_web_root_path();
foreach ($smilies as $row)
{
+ /**
+ * Modify smiley root path before populating smiley list
+ *
+ * @event core.generate_smilies_before
+ * @var string root_path root_path for smilies
+ * @since 3.1.11-RC1
+ */
+ $vars = array('root_path');
+ extract($phpbb_dispatcher->trigger_event('core.generate_smilies_before', compact($vars)));
$template->assign_block_vars('smiley', array(
'SMILEY_CODE' => $row['code'],
'A_SMILEY_CODE' => addslashes($row['code']),
@@ -127,12 +139,24 @@ function generate_smilies($mode, $forum_id)
}
}
+ /**
+ * This event is called after the smilies are populated
+ *
+ * @event core.generate_smilies_after
+ * @var string mode Mode of the smilies: window|inline
+ * @var int forum_id The forum ID we are currently in
+ * @var bool display_link Shall we display the "more smilies" link?
+ * @since 3.1.0-a1
+ */
+ $vars = array('mode', 'forum_id', 'display_link');
+ extract($phpbb_dispatcher->trigger_event('core.generate_smilies_after', compact($vars)));
+
if ($mode == 'inline' && $display_link)
{
$template->assign_vars(array(
'S_SHOW_SMILEY_LINK' => true,
- 'U_MORE_SMILIES' => append_sid("{$phpbb_root_path}posting.$phpEx", 'mode=smilies&amp;f=' . $forum_id))
- );
+ 'U_MORE_SMILIES' => $base_url,
+ ));
}
if ($mode == 'window')
@@ -162,13 +186,12 @@ function update_post_information($type, $ids, $return_update_sql = false)
$ids = array($ids);
}
-
$update_sql = $empty_forums = $not_empty_forums = array();
if ($type != 'topic')
{
$topic_join = ', ' . TOPICS_TABLE . ' t';
- $topic_condition = 'AND t.topic_id = p.topic_id AND t.topic_approved = 1';
+ $topic_condition = 'AND t.topic_id = p.topic_id AND t.topic_visibility = ' . ITEM_APPROVED;
}
else
{
@@ -182,7 +205,7 @@ function update_post_information($type, $ids, $return_update_sql = false)
FROM ' . POSTS_TABLE . " p $topic_join
WHERE " . $db->sql_in_set('p.' . $type . '_id', $ids) . "
$topic_condition
- AND p.post_approved = 1";
+ AND p.post_visibility = " . ITEM_APPROVED;
}
else
{
@@ -190,7 +213,7 @@ function update_post_information($type, $ids, $return_update_sql = false)
FROM ' . POSTS_TABLE . " p $topic_join
WHERE " . $db->sql_in_set('p.' . $type . '_id', $ids) . "
$topic_condition
- AND p.post_approved = 1
+ AND p.post_visibility = " . ITEM_APPROVED . "
GROUP BY p.{$type}_id";
}
$result = $db->sql_query($sql);
@@ -296,6 +319,7 @@ function posting_gen_topic_icons($mode, $icon_id)
{
$template->assign_block_vars('topic_icon', array(
'ICON_ID' => $id,
+ 'ICON_NAME' => $data['img'],
'ICON_IMG' => $root_path . $config['icons_path'] . '/' . $data['img'],
'ICON_WIDTH' => $data['width'],
'ICON_HEIGHT' => $data['height'],
@@ -340,7 +364,7 @@ function posting_gen_topic_types($forum_id, $cur_topic_type = POST_NORMAL)
$topic_type_array[] = array(
'VALUE' => $topic_value['const'],
- 'S_CHECKED' => ($cur_topic_type == $topic_value['const'] || ($forum_id == 0 && $topic_value['const'] == POST_GLOBAL)) ? ' checked="checked"' : '',
+ 'S_CHECKED' => ($cur_topic_type == $topic_value['const']) ? ' checked="checked"' : '',
'L_TOPIC_TYPE' => $user->lang[$topic_value['lang']]
);
}
@@ -377,11 +401,22 @@ function posting_gen_topic_types($forum_id, $cur_topic_type = POST_NORMAL)
/**
* Upload Attachment - filedata is generated here
* Uses upload class
+*
+* @param string $form_name The form name of the file upload input
+* @param int $forum_id The id of the forum
+* @param bool $local Whether the file is local or not
+* @param string $local_storage The path to the local file
+* @param bool $is_message Whether it is a PM or not
+* @param \filespec $local_filedata A filespec object created for the local file
+* @param \phpbb\mimetype\guesser $mimetype_guesser The mimetype guesser object if used
+* @param \phpbb\plupload\plupload $plupload The plupload object if one is being used
+*
+* @return object filespec
*/
-function upload_attachment($form_name, $forum_id, $local = false, $local_storage = '', $is_message = false, $local_filedata = false)
+function upload_attachment($form_name, $forum_id, $local = false, $local_storage = '', $is_message = false, $local_filedata = false, \phpbb\mimetype\guesser $mimetype_guesser = null, \phpbb\plupload\plupload $plupload = null)
{
global $auth, $user, $config, $db, $cache;
- global $phpbb_root_path, $phpEx;
+ global $phpbb_root_path, $phpEx, $phpbb_dispatcher;
$filedata = array(
'error' => array()
@@ -399,14 +434,7 @@ function upload_attachment($form_name, $forum_id, $local = false, $local_storage
$upload->set_disallowed_content(array());
}
- if (!$local)
- {
- $filedata['post_attach'] = ($upload->is_valid($form_name)) ? true : false;
- }
- else
- {
- $filedata['post_attach'] = true;
- }
+ $filedata['post_attach'] = $local || $upload->is_valid($form_name);
if (!$filedata['post_attach'])
{
@@ -417,7 +445,7 @@ function upload_attachment($form_name, $forum_id, $local = false, $local_storage
$extensions = $cache->obtain_attach_extensions((($is_message) ? false : (int) $forum_id));
$upload->set_allowed_extensions(array_keys($extensions['_allowed_']));
- $file = ($local) ? $upload->local_upload($local_storage, $local_filedata) : $upload->form_upload($form_name);
+ $file = ($local) ? $upload->local_upload($local_storage, $local_filedata, $mimetype_guesser) : $upload->form_upload($form_name, $mimetype_guesser, $plupload);
if ($file->init_error)
{
@@ -425,20 +453,18 @@ function upload_attachment($form_name, $forum_id, $local = false, $local_storage
return $filedata;
}
- $cat_id = (isset($extensions[$file->get('extension')]['display_cat'])) ? $extensions[$file->get('extension')]['display_cat'] : ATTACHMENT_CATEGORY_NONE;
+ // Whether the uploaded file is in the image category
+ $is_image = (isset($extensions[$file->get('extension')]['display_cat'])) ? $extensions[$file->get('extension')]['display_cat'] == ATTACHMENT_CATEGORY_IMAGE : false;
- // Do we have to create a thumbnail?
- $filedata['thumbnail'] = ($cat_id == ATTACHMENT_CATEGORY_IMAGE && $config['img_create_thumbnail']) ? 1 : 0;
-
- // Check Image Size, if it is an image
- if (!$auth->acl_get('a_') && !$auth->acl_get('m_', $forum_id) && $cat_id == ATTACHMENT_CATEGORY_IMAGE)
- {
- $file->upload->set_allowed_dimensions(0, 0, $config['img_max_width'], $config['img_max_height']);
- }
-
- // Admins and mods are allowed to exceed the allowed filesize
if (!$auth->acl_get('a_') && !$auth->acl_get('m_', $forum_id))
{
+ // Check Image Size, if it is an image
+ if ($is_image)
+ {
+ $file->upload->set_allowed_dimensions(0, 0, $config['img_max_width'], $config['img_max_height']);
+ }
+
+ // Admins and mods are allowed to exceed the allowed filesize
if (!empty($extensions[$file->get('extension')]['max_filesize']))
{
$allowed_filesize = $extensions[$file->get('extension')]['max_filesize'];
@@ -453,10 +479,12 @@ function upload_attachment($form_name, $forum_id, $local = false, $local_storage
$file->clean_filename('unique', $user->data['user_id'] . '_');
- // Are we uploading an image *and* this image being within the image category? Only then perform additional image checks.
- $no_image = ($cat_id == ATTACHMENT_CATEGORY_IMAGE) ? false : true;
+ // Are we uploading an image *and* this image being within the image category?
+ // Only then perform additional image checks.
+ $file->move_file($config['upload_path'], false, !$is_image);
- $file->move_file($config['upload_path'], false, $no_image);
+ // Do we have to create a thumbnail?
+ $filedata['thumbnail'] = ($is_image && $config['img_create_thumbnail']) ? 1 : 0;
if (sizeof($file->error))
{
@@ -468,10 +496,15 @@ function upload_attachment($form_name, $forum_id, $local = false, $local_storage
}
// Make sure the image category only holds valid images...
- if ($cat_id == ATTACHMENT_CATEGORY_IMAGE && !$file->is_image())
+ if ($is_image && !$file->is_image())
{
$file->remove();
+ if ($plupload && $plupload->is_active())
+ {
+ $plupload->emit_error(104, 'ATTACHED_IMAGE_NOT_IMAGE');
+ }
+
// If this error occurs a user tried to exploit an IE Bug by renaming extensions
// Since the image category is displaying content inline we need to catch this.
trigger_error($user->lang['ATTACHED_IMAGE_NOT_IMAGE']);
@@ -484,6 +517,20 @@ function upload_attachment($form_name, $forum_id, $local = false, $local_storage
$filedata['real_filename'] = $file->get('uploadname');
$filedata['filetime'] = time();
+ /**
+ * Event to modify uploaded file before submit to the post
+ *
+ * @event core.modify_uploaded_file
+ * @var array filedata Array containing uploaded file data
+ * @var bool is_image Flag indicating if the file is an image
+ * @since 3.1.0-RC3
+ */
+ $vars = array(
+ 'filedata',
+ 'is_image',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.modify_uploaded_file', compact($vars)));
+
// Check our complete quota
if ($config['attachment_quota'])
{
@@ -573,30 +620,30 @@ function get_supported_image_types($type = false)
if ($type !== false)
{
// Type is one of the IMAGETYPE constants - it is fetched from getimagesize()
- // We do not use the constants here, because some were not available in PHP 4.3.x
switch ($type)
{
// GIF
- case 1:
+ case IMAGETYPE_GIF:
$new_type = ($format & IMG_GIF) ? IMG_GIF : false;
break;
// JPG, JPC, JP2
- case 2:
- case 9:
- case 10:
- case 11:
- case 12:
+ case IMAGETYPE_JPEG:
+ case IMAGETYPE_JPC:
+ case IMAGETYPE_JPEG2000:
+ case IMAGETYPE_JP2:
+ case IMAGETYPE_JPX:
+ case IMAGETYPE_JB2:
$new_type = ($format & IMG_JPG) ? IMG_JPG : false;
break;
// PNG
- case 3:
+ case IMAGETYPE_PNG:
$new_type = ($format & IMG_PNG) ? IMG_PNG : false;
break;
// WBMP
- case 15:
+ case IMAGETYPE_WBMP:
$new_type = ($format & IMG_WBMP) ? IMG_WBMP : false;
break;
}
@@ -664,7 +711,7 @@ function create_thumbnail($source, $destination, $mimetype)
$used_imagick = false;
- // Only use imagemagick if defined and the passthru function not disabled
+ // Only use ImageMagick if defined and the passthru function not disabled
if ($config['img_imagick'] && function_exists('passthru'))
{
if (substr($config['img_imagick'], -1) !== '/')
@@ -816,7 +863,7 @@ function posting_gen_inline_attachments(&$attachment_data)
*/
function posting_gen_attachment_entry($attachment_data, &$filename_data, $show_attach_box = true)
{
- global $template, $config, $phpbb_root_path, $phpEx, $user, $auth;
+ global $template, $config, $phpbb_root_path, $phpEx, $user;
// Some default template variables
$template->assign_vars(array(
@@ -850,6 +897,7 @@ function posting_gen_attachment_entry($attachment_data, &$filename_data, $show_a
'ATTACH_ID' => $attach_row['attach_id'],
'S_IS_ORPHAN' => $attach_row['is_orphan'],
'ASSOC_INDEX' => $count,
+ 'FILESIZE' => get_formatted_filesize($attach_row['filesize']),
'U_VIEW_ATTACHMENT' => $download_link,
'S_HIDDEN' => $hidden)
@@ -870,7 +918,7 @@ function posting_gen_attachment_entry($attachment_data, &$filename_data, $show_a
function load_drafts($topic_id = 0, $forum_id = 0, $id = 0, $pm_action = '', $msg_id = 0)
{
global $user, $db, $template, $auth;
- global $phpbb_root_path, $phpEx;
+ global $phpbb_root_path, $phpbb_dispatcher, $phpEx;
$topic_ids = $forum_ids = $draft_rows = array();
@@ -913,7 +961,7 @@ function load_drafts($topic_id = 0, $forum_id = 0, $id = 0, $pm_action = '', $ms
$topic_rows = array();
if (sizeof($topic_ids))
{
- $sql = 'SELECT topic_id, forum_id, topic_title
+ $sql = 'SELECT topic_id, forum_id, topic_title, topic_poster
FROM ' . TOPICS_TABLE . '
WHERE ' . $db->sql_in_set('topic_id', array_unique($topic_ids));
$result = $db->sql_query($sql);
@@ -924,6 +972,20 @@ function load_drafts($topic_id = 0, $forum_id = 0, $id = 0, $pm_action = '', $ms
}
$db->sql_freeresult($result);
}
+
+ /**
+ * Drafts found and their topics
+ * Edit $draft_rows in order to add or remove drafts loaded
+ *
+ * @event core.load_drafts_draft_list_result
+ * @var array draft_rows The drafts query result. Includes its forum id and everything about the draft
+ * @var array topic_ids The list of topics got from the topics table
+ * @var array topic_rows The topics that draft_rows references
+ * @since 3.1.0-RC3
+ */
+ $vars = array('draft_rows', 'topic_ids', 'topic_rows');
+ extract($phpbb_dispatcher->trigger_event('core.load_drafts_draft_list_result', compact($vars)));
+
unset($topic_ids);
$template->assign_var('S_SHOW_DRAFTS', true);
@@ -984,18 +1046,20 @@ function load_drafts($topic_id = 0, $forum_id = 0, $id = 0, $pm_action = '', $ms
*/
function topic_review($topic_id, $forum_id, $mode = 'topic_review', $cur_post_id = 0, $show_quote_button = true)
{
- global $user, $auth, $db, $template, $bbcode, $cache;
- global $config, $phpbb_root_path, $phpEx;
+ global $user, $auth, $db, $template, $cache;
+ global $config, $phpbb_root_path, $phpEx, $phpbb_container, $phpbb_dispatcher;
+
+ $phpbb_content_visibility = $phpbb_container->get('content.visibility');
+ $sql_sort = ($mode == 'post_review') ? 'ASC' : 'DESC';
// Go ahead and pull all data for this topic
$sql = 'SELECT p.post_id
FROM ' . POSTS_TABLE . ' p' . "
WHERE p.topic_id = $topic_id
- " . ((!$auth->acl_get('m_approve', $forum_id)) ? 'AND p.post_approved = 1' : '') . '
+ AND " . $phpbb_content_visibility->get_visibility_sql('post', $forum_id, 'p.') . '
' . (($mode == 'post_review') ? " AND p.post_id > $cur_post_id" : '') . '
' . (($mode == 'post_review_edit') ? " AND p.post_id = $cur_post_id" : '') . '
- ORDER BY p.post_time ';
- $sql .= ($mode == 'post_review') ? 'ASC' : 'DESC';
+ ORDER BY p.post_time ' . $sql_sort . ', p.post_id ' . $sql_sort;
$result = $db->sql_query_limit($sql, $config['posts_per_page']);
$post_list = array();
@@ -1018,8 +1082,8 @@ function topic_review($topic_id, $forum_id, $mode = 'topic_review', $cur_post_id
$mode = 'post_review';
}
- $sql = $db->sql_build_query('SELECT', array(
- 'SELECT' => 'u.username, u.user_id, u.user_colour, p.*, z.friend, z.foe',
+ $sql_ary = array(
+ 'SELECT' => 'u.username, u.user_id, u.user_colour, p.*, z.friend, z.foe, uu.username as post_delete_username, uu.user_colour as post_delete_user_colour',
'FROM' => array(
USERS_TABLE => 'u',
@@ -1029,23 +1093,26 @@ function topic_review($topic_id, $forum_id, $mode = 'topic_review', $cur_post_id
'LEFT_JOIN' => array(
array(
'FROM' => array(ZEBRA_TABLE => 'z'),
- 'ON' => 'z.user_id = ' . $user->data['user_id'] . ' AND z.zebra_id = p.poster_id'
- )
+ 'ON' => 'z.user_id = ' . $user->data['user_id'] . ' AND z.zebra_id = p.poster_id',
+ ),
+ array(
+ 'FROM' => array(USERS_TABLE => 'uu'),
+ 'ON' => 'uu.user_id = p.post_delete_user',
+ ),
),
'WHERE' => $db->sql_in_set('p.post_id', $post_list) . '
- AND u.user_id = p.poster_id'
- ));
+ AND u.user_id = p.poster_id',
+ );
+ $sql = $db->sql_build_query('SELECT', $sql_ary);
$result = $db->sql_query($sql);
- $bbcode_bitfield = '';
$rowset = array();
$has_attachments = false;
while ($row = $db->sql_fetchrow($result))
{
$rowset[$row['post_id']] = $row;
- $bbcode_bitfield = $bbcode_bitfield | base64_decode($row['bbcode_bitfield']);
if ($row['post_attachment'])
{
@@ -1054,13 +1121,6 @@ function topic_review($topic_id, $forum_id, $mode = 'topic_review', $cur_post_id
}
$db->sql_freeresult($result);
- // Instantiate BBCode class
- if (!isset($bbcode) && $bbcode_bitfield !== '')
- {
- include_once($phpbb_root_path . 'includes/bbcode.' . $phpEx);
- $bbcode = new bbcode(base64_encode($bbcode_bitfield));
- }
-
// Grab extensions
$extensions = $attachments = array();
if ($has_attachments && $auth->acl_get('u_download') && $auth->acl_get('f_download', $forum_id))
@@ -1082,6 +1142,32 @@ function topic_review($topic_id, $forum_id, $mode = 'topic_review', $cur_post_id
$db->sql_freeresult($result);
}
+ /**
+ * Event to modify the posts list for topic reviews
+ *
+ * @event core.topic_review_modify_post_list
+ * @var array attachments Array with the post attachments data
+ * @var int cur_post_id Post offset ID
+ * @var int forum_id The topic's forum ID
+ * @var string mode The topic review mode
+ * @var array post_list Array with the post IDs
+ * @var array rowset Array with the posts data
+ * @var bool show_quote_button Flag indicating if the quote button should be displayed
+ * @var int topic_id The topic ID that is being reviewed
+ * @since 3.1.9-RC1
+ */
+ $vars = array(
+ 'attachments',
+ 'cur_post_id',
+ 'forum_id',
+ 'mode',
+ 'post_list',
+ 'rowset',
+ 'show_quote_button',
+ 'topic_id',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.topic_review_modify_post_list', compact($vars)));
+
for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i)
{
// A non-existing rowset only happens if there was no user present for the entered poster_id
@@ -1091,29 +1177,24 @@ function topic_review($topic_id, $forum_id, $mode = 'topic_review', $cur_post_id
continue;
}
- $row =& $rowset[$post_list[$i]];
+ $row = $rowset[$post_list[$i]];
$poster_id = $row['user_id'];
$post_subject = $row['post_subject'];
- $message = censor_text($row['post_text']);
$decoded_message = false;
if ($show_quote_button && $auth->acl_get('f_reply', $forum_id))
{
- $decoded_message = $message;
+ $decoded_message = censor_text($row['post_text']);
decode_message($decoded_message, $row['bbcode_uid']);
$decoded_message = bbcode_nl2br($decoded_message);
}
- if ($row['bbcode_bitfield'])
- {
- $bbcode->bbcode_second_pass($message, $row['bbcode_uid'], $row['bbcode_bitfield']);
- }
-
- $message = bbcode_nl2br($message);
- $message = smiley_text($message, !$row['enable_smilies']);
+ $parse_flags = ($row['bbcode_bitfield'] ? OPTION_FLAG_BBCODE : 0);
+ $parse_flags |= ($row['enable_smilies'] ? OPTION_FLAG_SMILIES : 0);
+ $message = generate_text_for_display($row['post_text'], $row['bbcode_uid'], $row['bbcode_bitfield'], $parse_flags, true);
if (!empty($attachments[$row['post_id']]))
{
@@ -1126,7 +1207,32 @@ function topic_review($topic_id, $forum_id, $mode = 'topic_review', $cur_post_id
$post_anchor = ($mode == 'post_review') ? 'ppr' . $row['post_id'] : 'pr' . $row['post_id'];
$u_show_post = append_sid($phpbb_root_path . 'viewtopic.' . $phpEx, "f=$forum_id&amp;t=$topic_id&amp;p={$row['post_id']}&amp;view=show#p{$row['post_id']}");
- $template->assign_block_vars($mode . '_row', array(
+ $l_deleted_message = '';
+ if ($row['post_visibility'] == ITEM_DELETED)
+ {
+ $display_postername = get_username_string('full', $poster_id, $row['username'], $row['user_colour'], $row['post_username']);
+
+ // User having deleted the post also being the post author?
+ if (!$row['post_delete_user'] || $row['post_delete_user'] == $poster_id)
+ {
+ $display_username = $display_postername;
+ }
+ else
+ {
+ $display_username = get_username_string('full', $row['post_delete_user'], $row['post_delete_username'], $row['post_delete_user_colour']);
+ }
+
+ if ($row['post_delete_reason'])
+ {
+ $l_deleted_message = $user->lang('POST_DELETED_BY_REASON', $display_postername, $display_username, $user->format_date($row['post_delete_time'], false, true), $row['post_delete_reason']);
+ }
+ else
+ {
+ $l_deleted_message = $user->lang('POST_DELETED_BY', $display_postername, $display_username, $user->format_date($row['post_delete_time'], false, true));
+ }
+ }
+
+ $post_row = array(
'POST_AUTHOR_FULL' => get_username_string('full', $poster_id, $row['username'], $row['user_colour'], $row['post_username']),
'POST_AUTHOR_COLOUR' => get_username_string('colour', $poster_id, $row['username'], $row['user_colour'], $row['post_username']),
'POST_AUTHOR' => get_username_string('username', $poster_id, $row['username'], $row['user_colour'], $row['post_username']),
@@ -1135,7 +1241,9 @@ function topic_review($topic_id, $forum_id, $mode = 'topic_review', $cur_post_id
'S_HAS_ATTACHMENTS' => (!empty($attachments[$row['post_id']])) ? true : false,
'S_FRIEND' => ($row['friend']) ? true : false,
'S_IGNORE_POST' => ($row['foe']) ? true : false,
- 'L_IGNORE_POST' => ($row['foe']) ? sprintf($user->lang['POST_BY_FOE'], get_username_string('full', $poster_id, $row['username'], $row['user_colour'], $row['post_username']), "<a href=\"{$u_show_post}\" onclick=\"dE('{$post_anchor}', 1); return false;\">", '</a>') : '',
+ 'L_IGNORE_POST' => ($row['foe']) ? sprintf($user->lang['POST_BY_FOE'], get_username_string('full', $poster_id, $row['username'], $row['user_colour'], $row['post_username']), "<a href=\"{$u_show_post}\" onclick=\"phpbb.toggleDisplay('{$post_anchor}', 1); return false;\">", '</a>') : '',
+ 'S_POST_DELETED' => ($row['post_visibility'] == ITEM_DELETED) ? true : false,
+ 'L_DELETE_POST' => $l_deleted_message,
'POST_SUBJECT' => $post_subject,
'MINI_POST_IMG' => $user->img('icon_post_target', $user->lang['POST']),
@@ -1145,9 +1253,37 @@ function topic_review($topic_id, $forum_id, $mode = 'topic_review', $cur_post_id
'POST_ID' => $row['post_id'],
'U_MINI_POST' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'p=' . $row['post_id']) . '#p' . $row['post_id'],
'U_MCP_DETAILS' => ($auth->acl_get('m_info', $forum_id)) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=main&amp;mode=post_details&amp;f=' . $forum_id . '&amp;p=' . $row['post_id'], true, $user->session_id) : '',
- 'POSTER_QUOTE' => ($show_quote_button && $auth->acl_get('f_reply', $forum_id)) ? addslashes(get_username_string('username', $poster_id, $row['username'], $row['user_colour'], $row['post_username'])) : '')
+ 'POSTER_QUOTE' => ($show_quote_button && $auth->acl_get('f_reply', $forum_id)) ? addslashes(get_username_string('username', $poster_id, $row['username'], $row['user_colour'], $row['post_username'])) : '',
);
+ $current_row_number = $i;
+
+ /**
+ * Event to modify the template data block for topic reviews
+ *
+ * @event core.topic_review_modify_row
+ * @var string mode The review mode
+ * @var int topic_id The topic that is being reviewed
+ * @var int forum_id The topic's forum
+ * @var int cur_post_id Post offset id
+ * @var int current_row_number Number of the current row being iterated
+ * @var array post_row Template block array of the current post
+ * @var array row Array with original post and user data
+ * @since 3.1.4-RC1
+ */
+ $vars = array(
+ 'mode',
+ 'topic_id',
+ 'forum_id',
+ 'cur_post_id',
+ 'current_row_number',
+ 'post_row',
+ 'row',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.topic_review_modify_row', compact($vars)));
+
+ $template->assign_block_vars($mode . '_row', $post_row);
+
// Display not already displayed Attachments for this post, we already parsed them. ;)
if (!empty($attachments[$row['post_id']]))
{
@@ -1170,238 +1306,6 @@ function topic_review($topic_id, $forum_id, $mode = 'topic_review', $cur_post_id
return true;
}
-/**
-* User Notification
-*/
-function user_notification($mode, $subject, $topic_title, $forum_name, $forum_id, $topic_id, $post_id, $author_name = '')
-{
- global $db, $user, $config, $phpbb_root_path, $phpEx, $auth;
-
- $topic_notification = ($mode == 'reply' || $mode == 'quote') ? true : false;
- $forum_notification = ($mode == 'post') ? true : false;
-
- if (!$topic_notification && !$forum_notification)
- {
- trigger_error('NO_MODE');
- }
-
- if (($topic_notification && !$config['allow_topic_notify']) || ($forum_notification && !$config['allow_forum_notify']))
- {
- return;
- }
-
- $topic_title = ($topic_notification) ? $topic_title : $subject;
- $topic_title = censor_text($topic_title);
-
- // Exclude guests, current user and banned users from notifications
- if (!function_exists('phpbb_get_banned_user_ids'))
- {
- include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
- }
- $sql_ignore_users = phpbb_get_banned_user_ids();
- $sql_ignore_users[ANONYMOUS] = ANONYMOUS;
- $sql_ignore_users[$user->data['user_id']] = $user->data['user_id'];
-
- $notify_rows = array();
-
- // -- get forum_userids || topic_userids
- $sql = 'SELECT u.user_id, u.username, u.user_email, u.user_lang, u.user_notify_type, u.user_jabber
- FROM ' . (($topic_notification) ? TOPICS_WATCH_TABLE : FORUMS_WATCH_TABLE) . ' w, ' . USERS_TABLE . ' u
- WHERE w.' . (($topic_notification) ? 'topic_id' : 'forum_id') . ' = ' . (($topic_notification) ? $topic_id : $forum_id) . '
- AND ' . $db->sql_in_set('w.user_id', $sql_ignore_users, true) . '
- AND w.notify_status = ' . NOTIFY_YES . '
- AND u.user_type IN (' . USER_NORMAL . ', ' . USER_FOUNDER . ')
- AND u.user_id = w.user_id';
- $result = $db->sql_query($sql);
-
- while ($row = $db->sql_fetchrow($result))
- {
- $notify_user_id = (int) $row['user_id'];
- $notify_rows[$notify_user_id] = array(
- 'user_id' => $notify_user_id,
- 'username' => $row['username'],
- 'user_email' => $row['user_email'],
- 'user_jabber' => $row['user_jabber'],
- 'user_lang' => $row['user_lang'],
- 'notify_type' => ($topic_notification) ? 'topic' : 'forum',
- 'template' => ($topic_notification) ? 'topic_notify' : 'newtopic_notify',
- 'method' => $row['user_notify_type'],
- 'allowed' => false
- );
-
- // Add users who have been already notified to ignore list
- $sql_ignore_users[$notify_user_id] = $notify_user_id;
- }
- $db->sql_freeresult($result);
-
- // forum notification is sent to those not already receiving topic notifications
- if ($topic_notification)
- {
- $sql = 'SELECT u.user_id, u.username, u.user_email, u.user_lang, u.user_notify_type, u.user_jabber
- FROM ' . FORUMS_WATCH_TABLE . ' fw, ' . USERS_TABLE . " u
- WHERE fw.forum_id = $forum_id
- AND " . $db->sql_in_set('fw.user_id', $sql_ignore_users, true) . '
- AND fw.notify_status = ' . NOTIFY_YES . '
- AND u.user_type IN (' . USER_NORMAL . ', ' . USER_FOUNDER . ')
- AND u.user_id = fw.user_id';
- $result = $db->sql_query($sql);
-
- while ($row = $db->sql_fetchrow($result))
- {
- $notify_user_id = (int) $row['user_id'];
- $notify_rows[$notify_user_id] = array(
- 'user_id' => $notify_user_id,
- 'username' => $row['username'],
- 'user_email' => $row['user_email'],
- 'user_jabber' => $row['user_jabber'],
- 'user_lang' => $row['user_lang'],
- 'notify_type' => 'forum',
- 'template' => 'forum_notify',
- 'method' => $row['user_notify_type'],
- 'allowed' => false
- );
- }
- $db->sql_freeresult($result);
- }
-
- if (!sizeof($notify_rows))
- {
- return;
- }
-
- // Make sure users are allowed to read the forum
- foreach ($auth->acl_get_list(array_keys($notify_rows), 'f_read', $forum_id) as $forum_id => $forum_ary)
- {
- foreach ($forum_ary as $auth_option => $user_ary)
- {
- foreach ($user_ary as $user_id)
- {
- $notify_rows[$user_id]['allowed'] = true;
- }
- }
- }
-
- // Now, we have to do a little step before really sending, we need to distinguish our users a little bit. ;)
- $msg_users = $delete_ids = $update_notification = array();
- foreach ($notify_rows as $user_id => $row)
- {
- if (!$row['allowed'] || !trim($row['user_email']))
- {
- $delete_ids[$row['notify_type']][] = $row['user_id'];
- }
- else
- {
- $msg_users[] = $row;
- $update_notification[$row['notify_type']][] = $row['user_id'];
-
- /*
- * We also update the forums watch table for this user when we are
- * sending out a topic notification to prevent sending out another
- * notification in case this user is also subscribed to the forum
- * this topic was posted in.
- * Since an UPDATE query is used, this has no effect on users only
- * subscribed to the topic (i.e. no row is created) and should not
- * be a performance issue.
- */
- if ($row['notify_type'] === 'topic')
- {
- $update_notification['forum'][] = $row['user_id'];
- }
- }
- }
- unset($notify_rows);
-
- // Now, we are able to really send out notifications
- if (sizeof($msg_users))
- {
- include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);
- $messenger = new messenger();
-
- $msg_list_ary = array();
- foreach ($msg_users as $row)
- {
- $pos = (!isset($msg_list_ary[$row['template']])) ? 0 : sizeof($msg_list_ary[$row['template']]);
-
- $msg_list_ary[$row['template']][$pos]['method'] = $row['method'];
- $msg_list_ary[$row['template']][$pos]['email'] = $row['user_email'];
- $msg_list_ary[$row['template']][$pos]['jabber'] = $row['user_jabber'];
- $msg_list_ary[$row['template']][$pos]['name'] = $row['username'];
- $msg_list_ary[$row['template']][$pos]['lang'] = $row['user_lang'];
- $msg_list_ary[$row['template']][$pos]['user_id']= $row['user_id'];
- }
- unset($msg_users);
-
- foreach ($msg_list_ary as $email_template => $email_list)
- {
- foreach ($email_list as $addr)
- {
- $messenger->template($email_template, $addr['lang']);
-
- $messenger->to($addr['email'], $addr['name']);
- $messenger->im($addr['jabber'], $addr['name']);
-
- $messenger->assign_vars(array(
- 'USERNAME' => htmlspecialchars_decode($addr['name']),
- 'TOPIC_TITLE' => htmlspecialchars_decode($topic_title),
- 'FORUM_NAME' => htmlspecialchars_decode($forum_name),
- 'AUTHOR_NAME' => htmlspecialchars_decode($author_name),
-
- 'U_FORUM' => generate_board_url() . "/viewforum.$phpEx?f=$forum_id",
- 'U_TOPIC' => generate_board_url() . "/viewtopic.$phpEx?f=$forum_id&t=$topic_id",
- 'U_NEWEST_POST' => generate_board_url() . "/viewtopic.$phpEx?f=$forum_id&t=$topic_id&p=$post_id&e=$post_id",
- 'U_STOP_WATCHING_TOPIC' => generate_board_url() . "/viewtopic.$phpEx?uid={$addr['user_id']}&f=$forum_id&t=$topic_id&unwatch=topic",
- 'U_STOP_WATCHING_FORUM' => generate_board_url() . "/viewforum.$phpEx?uid={$addr['user_id']}&f=$forum_id&unwatch=forum",
- ));
-
- $messenger->send($addr['method']);
- }
- }
- unset($msg_list_ary);
-
- $messenger->save_queue();
- }
-
- // Handle the DB updates
- $db->sql_transaction('begin');
-
- if (!empty($update_notification['topic']))
- {
- $sql = 'UPDATE ' . TOPICS_WATCH_TABLE . '
- SET notify_status = ' . NOTIFY_NO . "
- WHERE topic_id = $topic_id
- AND " . $db->sql_in_set('user_id', $update_notification['topic']);
- $db->sql_query($sql);
- }
-
- if (!empty($update_notification['forum']))
- {
- $sql = 'UPDATE ' . FORUMS_WATCH_TABLE . '
- SET notify_status = ' . NOTIFY_NO . "
- WHERE forum_id = $forum_id
- AND " . $db->sql_in_set('user_id', $update_notification['forum']);
- $db->sql_query($sql);
- }
-
- // Now delete the user_ids not authorised to receive notifications on this topic/forum
- if (!empty($delete_ids['topic']))
- {
- $sql = 'DELETE FROM ' . TOPICS_WATCH_TABLE . "
- WHERE topic_id = $topic_id
- AND " . $db->sql_in_set('user_id', $delete_ids['topic']);
- $db->sql_query($sql);
- }
-
- if (!empty($delete_ids['forum']))
- {
- $sql = 'DELETE FROM ' . FORUMS_WATCH_TABLE . "
- WHERE forum_id = $forum_id
- AND " . $db->sql_in_set('user_id', $delete_ids['forum']);
- $db->sql_query($sql);
- }
-
- $db->sql_transaction('commit');
-}
-
//
// Post handling functions
//
@@ -1409,14 +1313,14 @@ function user_notification($mode, $subject, $topic_title, $forum_name, $forum_id
/**
* Delete Post
*/
-function delete_post($forum_id, $topic_id, $post_id, &$data)
+function delete_post($forum_id, $topic_id, $post_id, &$data, $is_soft = false, $softdelete_reason = '')
{
- global $db, $user, $auth;
+ global $db, $user, $auth, $phpbb_container, $phpbb_dispatcher;
global $config, $phpEx, $phpbb_root_path;
// Specify our post mode
$post_mode = 'delete';
- if (($data['topic_first_post_id'] === $data['topic_last_post_id']) && $data['topic_replies_real'] == 0)
+ if (($data['topic_first_post_id'] === $data['topic_last_post_id']) && ($data['topic_posts_approved'] + $data['topic_posts_unapproved'] + $data['topic_posts_softdeleted'] == 1))
{
$post_mode = 'delete_topic';
}
@@ -1458,20 +1362,30 @@ function delete_post($forum_id, $topic_id, $post_id, &$data)
$db->sql_freeresult($result);
}
- if (!delete_posts('post_id', array($post_id), false, false))
+ $phpbb_content_visibility = $phpbb_container->get('content.visibility');
+
+ // (Soft) delete the post
+ if ($is_soft && ($post_mode != 'delete_topic'))
{
- // Try to delete topic, we may had an previous error causing inconsistency
- if ($post_mode == 'delete_topic')
+ $phpbb_content_visibility->set_post_visibility(ITEM_DELETED, $post_id, $topic_id, $forum_id, $user->data['user_id'], time(), $softdelete_reason, ($data['topic_first_post_id'] == $post_id), ($data['topic_last_post_id'] == $post_id));
+ }
+ else if (!$is_soft)
+ {
+ if (!delete_posts('post_id', array($post_id), false, false, false))
{
- delete_topics('topic_id', array($topic_id), false);
+ // Try to delete topic, we may had an previous error causing inconsistency
+ if ($post_mode == 'delete_topic')
+ {
+ delete_topics('topic_id', array($topic_id), false);
+ }
+ trigger_error('ALREADY_DELETED');
}
- trigger_error('ALREADY_DELETED');
}
$db->sql_transaction('commit');
// Collect the necessary information for updating the tables
- $sql_data[FORUMS_TABLE] = '';
+ $sql_data[FORUMS_TABLE] = $sql_data[TOPICS_TABLE] = '';
switch ($post_mode)
{
case 'delete_topic':
@@ -1480,24 +1394,32 @@ function delete_post($forum_id, $topic_id, $post_id, &$data)
{
// counting is fun! we only have to do sizeof($forum_ids) number of queries,
// even if the topic is moved back to where its shadow lives (we count how many times it is in a forum)
- $db->sql_query('UPDATE ' . FORUMS_TABLE . ' SET forum_topics_real = forum_topics_real - ' . $topic_count . ', forum_topics = forum_topics - ' . $topic_count . ' WHERE forum_id = ' . $updated_forum);
+ $sql = 'UPDATE ' . FORUMS_TABLE . '
+ SET forum_topics_approved = forum_topics_approved - ' . $topic_count . '
+ WHERE forum_id = ' . $updated_forum;
+ $db->sql_query($sql);
update_post_information('forum', $updated_forum);
}
- delete_topics('topic_id', array($topic_id), false);
-
- if ($data['topic_type'] != POST_GLOBAL)
+ if ($is_soft)
{
- $sql_data[FORUMS_TABLE] .= 'forum_topics_real = forum_topics_real - 1';
- $sql_data[FORUMS_TABLE] .= ($data['topic_approved']) ? ', forum_posts = forum_posts - 1, forum_topics = forum_topics - 1' : '';
+ $topic_row = array();
+ $phpbb_content_visibility->set_topic_visibility(ITEM_DELETED, $topic_id, $forum_id, $user->data['user_id'], time(), $softdelete_reason);
}
-
- $update_sql = update_post_information('forum', $forum_id, true);
- if (sizeof($update_sql))
+ else
{
- $sql_data[FORUMS_TABLE] .= ($sql_data[FORUMS_TABLE]) ? ', ' : '';
- $sql_data[FORUMS_TABLE] .= implode(', ', $update_sql[$forum_id]);
+ delete_topics('topic_id', array($topic_id), false);
+
+ $phpbb_content_visibility->remove_topic_from_statistic($data, $sql_data);
+
+ $update_sql = update_post_information('forum', $forum_id, true);
+ if (sizeof($update_sql))
+ {
+ $sql_data[FORUMS_TABLE] .= ($sql_data[FORUMS_TABLE]) ? ', ' : '';
+ $sql_data[FORUMS_TABLE] .= implode(', ', $update_sql[$forum_id]);
+ }
}
+
break;
case 'delete_first_post':
@@ -1505,82 +1427,88 @@ function delete_post($forum_id, $topic_id, $post_id, &$data)
FROM ' . POSTS_TABLE . ' p, ' . USERS_TABLE . " u
WHERE p.topic_id = $topic_id
AND p.poster_id = u.user_id
- ORDER BY p.post_time ASC";
+ AND p.post_visibility = " . ITEM_APPROVED . '
+ ORDER BY p.post_time ASC, p.post_id ASC';
$result = $db->sql_query_limit($sql, 1);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
- if ($data['topic_type'] != POST_GLOBAL)
+ if (!$row)
{
- $sql_data[FORUMS_TABLE] = ($data['post_approved']) ? 'forum_posts = forum_posts - 1' : '';
+ // No approved post, so the first is a not-approved post (unapproved or soft deleted)
+ $sql = 'SELECT p.post_id, p.poster_id, p.post_time, p.post_username, u.username, u.user_colour
+ FROM ' . POSTS_TABLE . ' p, ' . USERS_TABLE . " u
+ WHERE p.topic_id = $topic_id
+ AND p.poster_id = u.user_id
+ ORDER BY p.post_time ASC, p.post_id ASC";
+ $result = $db->sql_query_limit($sql, 1);
+ $row = $db->sql_fetchrow($result);
+ $db->sql_freeresult($result);
}
- $sql_data[TOPICS_TABLE] = 'topic_poster = ' . intval($row['poster_id']) . ', topic_first_post_id = ' . intval($row['post_id']) . ", topic_first_poster_colour = '" . $db->sql_escape($row['user_colour']) . "', topic_first_poster_name = '" . (($row['poster_id'] == ANONYMOUS) ? $db->sql_escape($row['post_username']) : $db->sql_escape($row['username'])) . "', topic_time = " . (int) $row['post_time'];
-
- // Decrementing topic_replies here is fine because this case only happens if there is more than one post within the topic - basically removing one "reply"
- $sql_data[TOPICS_TABLE] .= ', topic_replies_real = topic_replies_real - 1' . (($data['post_approved']) ? ', topic_replies = topic_replies - 1' : '');
-
$next_post_id = (int) $row['post_id'];
+
+ $sql_data[TOPICS_TABLE] = $db->sql_build_array('UPDATE', array(
+ 'topic_poster' => (int) $row['poster_id'],
+ 'topic_first_post_id' => (int) $row['post_id'],
+ 'topic_first_poster_colour' => $row['user_colour'],
+ 'topic_first_poster_name' => ($row['poster_id'] == ANONYMOUS) ? $row['post_username'] : $row['username'],
+ 'topic_time' => (int) $row['post_time'],
+ ));
break;
case 'delete_last_post':
- if ($data['topic_type'] != POST_GLOBAL)
+ if (!$is_soft)
{
- $sql_data[FORUMS_TABLE] = ($data['post_approved']) ? 'forum_posts = forum_posts - 1' : '';
- }
-
- $update_sql = update_post_information('forum', $forum_id, true);
- if (sizeof($update_sql))
- {
- $sql_data[FORUMS_TABLE] .= ($sql_data[FORUMS_TABLE]) ? ', ' : '';
- $sql_data[FORUMS_TABLE] .= implode(', ', $update_sql[$forum_id]);
- }
+ // Update last post information when hard deleting. Soft delete already did that by itself.
+ $update_sql = update_post_information('forum', $forum_id, true);
+ if (sizeof($update_sql))
+ {
+ $sql_data[FORUMS_TABLE] = (($sql_data[FORUMS_TABLE]) ? $sql_data[FORUMS_TABLE] . ', ' : '') . implode(', ', $update_sql[$forum_id]);
+ }
- $sql_data[TOPICS_TABLE] = 'topic_bumped = 0, topic_bumper = 0, topic_replies_real = topic_replies_real - 1' . (($data['post_approved']) ? ', topic_replies = topic_replies - 1' : '');
+ $sql_data[TOPICS_TABLE] = (($sql_data[TOPICS_TABLE]) ? $sql_data[TOPICS_TABLE] . ', ' : '') . 'topic_bumped = 0, topic_bumper = 0';
- $update_sql = update_post_information('topic', $topic_id, true);
- if (sizeof($update_sql))
- {
- $sql_data[TOPICS_TABLE] .= ', ' . implode(', ', $update_sql[$topic_id]);
- $next_post_id = (int) str_replace('topic_last_post_id = ', '', $update_sql[$topic_id][0]);
+ $update_sql = update_post_information('topic', $topic_id, true);
+ if (!empty($update_sql))
+ {
+ $sql_data[TOPICS_TABLE] .= ', ' . implode(', ', $update_sql[$topic_id]);
+ $next_post_id = (int) str_replace('topic_last_post_id = ', '', $update_sql[$topic_id][0]);
+ }
}
- else
+
+ if (!$next_post_id)
{
$sql = 'SELECT MAX(post_id) as last_post_id
FROM ' . POSTS_TABLE . "
- WHERE topic_id = $topic_id " .
- ((!$auth->acl_get('m_approve', $forum_id)) ? 'AND post_approved = 1' : '');
+ WHERE topic_id = $topic_id
+ AND " . $phpbb_content_visibility->get_visibility_sql('post', $forum_id);
$result = $db->sql_query($sql);
- $row = $db->sql_fetchrow($result);
+ $next_post_id = (int) $db->sql_fetchfield('last_post_id');
$db->sql_freeresult($result);
-
- $next_post_id = (int) $row['last_post_id'];
}
break;
case 'delete':
$sql = 'SELECT post_id
FROM ' . POSTS_TABLE . "
- WHERE topic_id = $topic_id " .
- ((!$auth->acl_get('m_approve', $forum_id)) ? 'AND post_approved = 1' : '') . '
+ WHERE topic_id = $topic_id
+ AND " . $phpbb_content_visibility->get_visibility_sql('post', $forum_id) . '
AND post_time > ' . $data['post_time'] . '
- ORDER BY post_time ASC';
+ ORDER BY post_time ASC, post_id ASC';
$result = $db->sql_query_limit($sql, 1);
- $row = $db->sql_fetchrow($result);
+ $next_post_id = (int) $db->sql_fetchfield('post_id');
$db->sql_freeresult($result);
-
- if ($data['topic_type'] != POST_GLOBAL)
- {
- $sql_data[FORUMS_TABLE] = ($data['post_approved']) ? 'forum_posts = forum_posts - 1' : '';
- }
-
- $sql_data[TOPICS_TABLE] = 'topic_replies_real = topic_replies_real - 1' . (($data['post_approved']) ? ', topic_replies = topic_replies - 1' : '');
- $next_post_id = (int) $row['post_id'];
break;
}
if (($post_mode == 'delete') || ($post_mode == 'delete_last_post') || ($post_mode == 'delete_first_post'))
{
+ if (!$is_soft)
+ {
+ $phpbb_content_visibility->remove_post_from_statistic($data, $sql_data);
+ }
+
$sql = 'SELECT 1 AS has_attachments
FROM ' . ATTACHMENTS_TABLE . '
WHERE topic_id = ' . $topic_id;
@@ -1590,18 +1518,16 @@ function delete_post($forum_id, $topic_id, $post_id, &$data)
if (!$has_attachments)
{
- $sql_data[TOPICS_TABLE] .= ', topic_attachment = 0';
+ $sql_data[TOPICS_TABLE] = (($sql_data[TOPICS_TABLE]) ? $sql_data[TOPICS_TABLE] . ', ' : '') . 'topic_attachment = 0';
}
}
-// $sql_data[USERS_TABLE] = ($data['post_postcount']) ? 'user_posts = user_posts - 1' : '';
-
$db->sql_transaction('begin');
$where_sql = array(
FORUMS_TABLE => "forum_id = $forum_id",
TOPICS_TABLE => "topic_id = $topic_id",
- USERS_TABLE => 'user_id = ' . $data['poster_id']
+ USERS_TABLE => 'user_id = ' . $data['poster_id'],
);
foreach ($sql_data as $table => $update_sql)
@@ -1640,6 +1566,34 @@ function delete_post($forum_id, $topic_id, $post_id, &$data)
sync('topic_reported', 'topic_id', array($topic_id));
}
+ /**
+ * This event is used for performing actions directly after a post or topic
+ * has been deleted.
+ *
+ * @event core.delete_post_after
+ * @var int forum_id Post forum ID
+ * @var int topic_id Post topic ID
+ * @var int post_id Post ID
+ * @var array data Post data
+ * @var bool is_soft Soft delete flag
+ * @var string softdelete_reason Soft delete reason
+ * @var string post_mode delete_topic, delete_first_post, delete_last_post or delete
+ * @var mixed next_post_id Next post ID in the topic (post ID or false)
+ *
+ * @since 3.1.11-RC1
+ */
+ $vars = array(
+ 'forum_id',
+ 'topic_id',
+ 'post_id',
+ 'data',
+ 'is_soft',
+ 'softdelete_reason',
+ 'post_mode',
+ 'next_post_id',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.delete_post_after', compact($vars)));
+
return $next_post_id;
}
@@ -1649,7 +1603,33 @@ function delete_post($forum_id, $topic_id, $post_id, &$data)
*/
function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $update_message = true, $update_search_index = true)
{
- global $db, $auth, $user, $config, $phpEx, $template, $phpbb_root_path;
+ global $db, $auth, $user, $config, $phpEx, $template, $phpbb_root_path, $phpbb_container, $phpbb_dispatcher;
+
+ /**
+ * Modify the data for post submitting
+ *
+ * @event core.modify_submit_post_data
+ * @var string mode Variable containing posting mode value
+ * @var string subject Variable containing post subject value
+ * @var string username Variable containing post author name
+ * @var int topic_type Variable containing topic type value
+ * @var array poll Array with the poll data for the post
+ * @var array data Array with the data for the post
+ * @var bool update_message Flag indicating if the post will be updated
+ * @var bool update_search_index Flag indicating if the search index will be updated
+ * @since 3.1.0-a4
+ */
+ $vars = array(
+ 'mode',
+ 'subject',
+ 'username',
+ 'topic_type',
+ 'poll',
+ 'data',
+ 'update_message',
+ 'update_search_index',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.modify_submit_post_data', compact($vars)));
// We do not handle erasing posts here
if ($mode == 'delete')
@@ -1657,7 +1637,14 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
return false;
}
- $current_time = time();
+ if (!empty($data['post_time']))
+ {
+ $current_time = $data['post_time'];
+ }
+ else
+ {
+ $current_time = time();
+ }
if ($mode == 'post')
{
@@ -1671,22 +1658,22 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
}
else if ($mode == 'edit')
{
- $post_mode = ($data['topic_replies_real'] == 0) ? 'edit_topic' : (($data['topic_first_post_id'] == $data['post_id']) ? 'edit_first_post' : (($data['topic_last_post_id'] == $data['post_id']) ? 'edit_last_post' : 'edit'));
+ $post_mode = ($data['topic_posts_approved'] + $data['topic_posts_unapproved'] + $data['topic_posts_softdeleted'] == 1) ? 'edit_topic' : (($data['topic_first_post_id'] == $data['post_id']) ? 'edit_first_post' : (($data['topic_last_post_id'] == $data['post_id']) ? 'edit_last_post' : 'edit'));
}
// First of all make sure the subject and topic title are having the correct length.
// To achieve this without cutting off between special chars we convert to an array and then count the elements.
- $subject = truncate_string($subject);
- $data['topic_title'] = truncate_string($data['topic_title']);
+ $subject = truncate_string($subject, 120);
+ $data['topic_title'] = truncate_string($data['topic_title'], 120);
// Collect some basic information about which tables and which rows to update/insert
$sql_data = $topic_row = array();
$poster_id = ($mode == 'edit') ? $data['poster_id'] : (int) $user->data['user_id'];
// Retrieve some additional information if not present
- if ($mode == 'edit' && (!isset($data['post_approved']) || !isset($data['topic_approved']) || $data['post_approved'] === false || $data['topic_approved'] === false))
+ if ($mode == 'edit' && (!isset($data['post_visibility']) || !isset($data['topic_visibility']) || $data['post_visibility'] === false || $data['topic_visibility'] === false))
{
- $sql = 'SELECT p.post_approved, t.topic_type, t.topic_replies, t.topic_replies_real, t.topic_approved
+ $sql = 'SELECT p.post_visibility, t.topic_type, t.topic_posts_approved, t.topic_posts_unapproved, t.topic_posts_softdeleted, t.topic_visibility
FROM ' . TOPICS_TABLE . ' t, ' . POSTS_TABLE . ' p
WHERE t.topic_id = p.topic_id
AND p.post_id = ' . $data['post_id'];
@@ -1694,26 +1681,42 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
$topic_row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
- $data['topic_approved'] = $topic_row['topic_approved'];
- $data['post_approved'] = $topic_row['post_approved'];
+ $data['topic_visibility'] = $topic_row['topic_visibility'];
+ $data['post_visibility'] = $topic_row['post_visibility'];
}
- // This variable indicates if the user is able to post or put into the queue - it is used later for all code decisions regarding approval
- // The variable name should be $post_approved, because it indicates if the post is approved or not
- $post_approval = 1;
+ // This variable indicates if the user is able to post or put into the queue
+ $post_visibility = ITEM_APPROVED;
// Check the permissions for post approval.
// Moderators must go through post approval like ordinary users.
if (!$auth->acl_get('f_noapprove', $data['forum_id']))
{
// Post not approved, but in queue
- $post_approval = 0;
+ $post_visibility = ITEM_UNAPPROVED;
+ switch ($post_mode)
+ {
+ case 'edit_first_post':
+ case 'edit':
+ case 'edit_last_post':
+ case 'edit_topic':
+ $post_visibility = ITEM_REAPPROVE;
+ break;
+ }
+ }
+ else if (isset($data['post_visibility']) && $data['post_visibility'] !== false)
+ {
+ $post_visibility = $data['post_visibility'];
}
- // Mods are able to force approved/unapproved posts. True means the post is approved, false the post is unapproved
+ // MODs/Extensions are able to force any visibility on posts
if (isset($data['force_approved_state']))
{
- $post_approval = ($data['force_approved_state']) ? 1 : 0;
+ $post_visibility = (in_array((int) $data['force_approved_state'], array(ITEM_APPROVED, ITEM_UNAPPROVED, ITEM_DELETED, ITEM_REAPPROVE))) ? (int) $data['force_approved_state'] : $post_visibility;
+ }
+ if (isset($data['force_visibility']))
+ {
+ $post_visibility = (in_array((int) $data['force_visibility'], array(ITEM_APPROVED, ITEM_UNAPPROVED, ITEM_DELETED, ITEM_REAPPROVE))) ? (int) $data['force_visibility'] : $post_visibility;
}
// Start the transaction here
@@ -1725,12 +1728,12 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
case 'post':
case 'reply':
$sql_data[POSTS_TABLE]['sql'] = array(
- 'forum_id' => ($topic_type == POST_GLOBAL) ? 0 : $data['forum_id'],
+ 'forum_id' => $data['forum_id'],
'poster_id' => (int) $user->data['user_id'],
'icon_id' => $data['icon_id'],
'poster_ip' => $user->ip,
'post_time' => $current_time,
- 'post_approved' => $post_approval,
+ 'post_visibility' => $post_visibility,
'enable_bbcode' => $data['enable_bbcode'],
'enable_smilies' => $data['enable_smilies'],
'enable_magic_url' => $data['enable_urls'],
@@ -1784,7 +1787,7 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
if ($user->data['user_id'] != $poster_id)
{
$log_subject = ($subject) ? $subject : $data['topic_title'];
- add_log('mod', $data['forum_id'], $data['topic_id'], 'LOG_POST_EDITED', $log_subject, (!empty($username)) ? $username : $user->lang['GUEST']);
+ add_log('mod', $data['forum_id'], $data['topic_id'], 'LOG_POST_EDITED', $log_subject, (!empty($username)) ? $username : $user->lang['GUEST'], $data['post_edit_reason']);
}
if (!isset($sql_data[POSTS_TABLE]['sql']))
@@ -1793,10 +1796,11 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
}
$sql_data[POSTS_TABLE]['sql'] = array_merge($sql_data[POSTS_TABLE]['sql'], array(
- 'forum_id' => ($topic_type == POST_GLOBAL) ? 0 : $data['forum_id'],
+ 'forum_id' => $data['forum_id'],
'poster_id' => $data['poster_id'],
'icon_id' => $data['icon_id'],
- 'post_approved' => (!$post_approval) ? 0 : $data['post_approved'],
+ // We will change the visibility later
+ //'post_visibility' => $post_visibility,
'enable_bbcode' => $data['enable_bbcode'],
'enable_smilies' => $data['enable_smilies'],
'enable_magic_url' => $data['enable_urls'],
@@ -1817,8 +1821,6 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
break;
}
-
- $post_approved = $sql_data[POSTS_TABLE]['sql']['post_approved'];
$topic_row = array();
// And the topic ladies and gentlemen
@@ -1829,15 +1831,20 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
'topic_poster' => (int) $user->data['user_id'],
'topic_time' => $current_time,
'topic_last_view_time' => $current_time,
- 'forum_id' => ($topic_type == POST_GLOBAL) ? 0 : $data['forum_id'],
+ 'forum_id' => $data['forum_id'],
'icon_id' => $data['icon_id'],
- 'topic_approved' => $post_approval,
+ 'topic_posts_approved' => ($post_visibility == ITEM_APPROVED) ? 1 : 0,
+ 'topic_posts_softdeleted' => ($post_visibility == ITEM_DELETED) ? 1 : 0,
+ 'topic_posts_unapproved' => ($post_visibility == ITEM_UNAPPROVED) ? 1 : 0,
+ 'topic_visibility' => $post_visibility,
+ 'topic_delete_user' => ($post_visibility != ITEM_APPROVED) ? (int) $user->data['user_id'] : 0,
'topic_title' => $subject,
'topic_first_poster_name' => (!$user->data['is_registered'] && $username) ? $username : (($user->data['user_id'] != ANONYMOUS) ? $user->data['username'] : ''),
'topic_first_poster_colour' => $user->data['user_colour'],
'topic_type' => $topic_type,
'topic_time_limit' => ($topic_type == POST_STICKY || $topic_type == POST_ANNOUNCE) ? ($data['topic_time_limit'] * 86400) : 0,
'topic_attachment' => (!empty($data['attachment_data'])) ? 1 : 0,
+ 'topic_status' => (isset($data['topic_status'])) ? $data['topic_status'] : ITEM_UNLOCKED,
);
if (isset($poll['poll_options']) && !empty($poll['poll_options']))
@@ -1863,31 +1870,47 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
);
}
- $sql_data[USERS_TABLE]['stat'][] = "user_lastpost_time = $current_time" . (($auth->acl_get('f_postcount', $data['forum_id']) && $post_approval) ? ', user_posts = user_posts + 1' : '');
+ $sql_data[USERS_TABLE]['stat'][] = "user_lastpost_time = $current_time" . (($auth->acl_get('f_postcount', $data['forum_id']) && $post_visibility == ITEM_APPROVED) ? ', user_posts = user_posts + 1' : '');
- if ($topic_type != POST_GLOBAL)
+ if ($post_visibility == ITEM_APPROVED)
{
- if ($post_approval)
- {
- $sql_data[FORUMS_TABLE]['stat'][] = 'forum_posts = forum_posts + 1';
- }
- $sql_data[FORUMS_TABLE]['stat'][] = 'forum_topics_real = forum_topics_real + 1' . (($post_approval) ? ', forum_topics = forum_topics + 1' : '');
+ $sql_data[FORUMS_TABLE]['stat'][] = 'forum_topics_approved = forum_topics_approved + 1';
+ $sql_data[FORUMS_TABLE]['stat'][] = 'forum_posts_approved = forum_posts_approved + 1';
+ }
+ else if ($post_visibility == ITEM_UNAPPROVED)
+ {
+ $sql_data[FORUMS_TABLE]['stat'][] = 'forum_topics_unapproved = forum_topics_unapproved + 1';
+ $sql_data[FORUMS_TABLE]['stat'][] = 'forum_posts_unapproved = forum_posts_unapproved + 1';
+ }
+ else if ($post_visibility == ITEM_DELETED)
+ {
+ $sql_data[FORUMS_TABLE]['stat'][] = 'forum_topics_softdeleted = forum_topics_softdeleted + 1';
+ $sql_data[FORUMS_TABLE]['stat'][] = 'forum_posts_softdeleted = forum_posts_softdeleted + 1';
}
break;
case 'reply':
$sql_data[TOPICS_TABLE]['stat'][] = 'topic_last_view_time = ' . $current_time . ',
- topic_replies_real = topic_replies_real + 1,
topic_bumped = 0,
topic_bumper = 0' .
- (($post_approval) ? ', topic_replies = topic_replies + 1' : '') .
+ (($post_visibility == ITEM_APPROVED) ? ', topic_posts_approved = topic_posts_approved + 1' : '') .
+ (($post_visibility == ITEM_UNAPPROVED) ? ', topic_posts_unapproved = topic_posts_unapproved + 1' : '') .
+ (($post_visibility == ITEM_DELETED) ? ', topic_posts_softdeleted = topic_posts_softdeleted + 1' : '') .
((!empty($data['attachment_data']) || (isset($data['topic_attachment']) && $data['topic_attachment'])) ? ', topic_attachment = 1' : '');
- $sql_data[USERS_TABLE]['stat'][] = "user_lastpost_time = $current_time" . (($auth->acl_get('f_postcount', $data['forum_id']) && $post_approval) ? ', user_posts = user_posts + 1' : '');
+ $sql_data[USERS_TABLE]['stat'][] = "user_lastpost_time = $current_time" . (($auth->acl_get('f_postcount', $data['forum_id']) && $post_visibility == ITEM_APPROVED) ? ', user_posts = user_posts + 1' : '');
- if ($post_approval && $topic_type != POST_GLOBAL)
+ if ($post_visibility == ITEM_APPROVED)
+ {
+ $sql_data[FORUMS_TABLE]['stat'][] = 'forum_posts_approved = forum_posts_approved + 1';
+ }
+ else if ($post_visibility == ITEM_UNAPPROVED)
{
- $sql_data[FORUMS_TABLE]['stat'][] = 'forum_posts = forum_posts + 1';
+ $sql_data[FORUMS_TABLE]['stat'][] = 'forum_posts_unapproved = forum_posts_unapproved + 1';
+ }
+ else if ($post_visibility == ITEM_DELETED)
+ {
+ $sql_data[FORUMS_TABLE]['stat'][] = 'forum_posts_softdeleted = forum_posts_softdeleted + 1';
}
break;
@@ -1909,9 +1932,8 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
}
$sql_data[TOPICS_TABLE]['sql'] = array(
- 'forum_id' => ($topic_type == POST_GLOBAL) ? 0 : $data['forum_id'],
+ 'forum_id' => $data['forum_id'],
'icon_id' => $data['icon_id'],
- 'topic_approved' => (!$post_approval) ? 0 : $data['topic_approved'],
'topic_title' => $subject,
'topic_first_poster_name' => $username,
'topic_type' => $topic_type,
@@ -1926,59 +1948,33 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
'topic_attachment' => (!empty($data['attachment_data'])) ? 1 : (isset($data['topic_attachment']) ? $data['topic_attachment'] : 0),
);
- // Correctly set back the topic replies and forum posts... only if the topic was approved before and now gets disapproved
- if (!$post_approval && $data['topic_approved'])
- {
- // Do we need to grab some topic informations?
- if (!sizeof($topic_row))
- {
- $sql = 'SELECT topic_type, topic_replies, topic_replies_real, topic_approved
- FROM ' . TOPICS_TABLE . '
- WHERE topic_id = ' . $data['topic_id'];
- $result = $db->sql_query($sql);
- $topic_row = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
- }
-
- // If this is the only post remaining we do not need to decrement topic_replies.
- // Also do not decrement if first post - then the topic_replies will not be adjusted if approving the topic again.
-
- // If this is an edited topic or the first post the topic gets completely disapproved later on...
- $sql_data[FORUMS_TABLE]['stat'][] = 'forum_topics = forum_topics - 1';
- $sql_data[FORUMS_TABLE]['stat'][] = 'forum_posts = forum_posts - ' . ($topic_row['topic_replies'] + 1);
-
- set_config_count('num_topics', -1, true);
- set_config_count('num_posts', ($topic_row['topic_replies'] + 1) * (-1), true);
-
- // Only decrement this post, since this is the one non-approved now
- if ($auth->acl_get('f_postcount', $data['forum_id']))
- {
- $sql_data[USERS_TABLE]['stat'][] = 'user_posts = user_posts - 1';
- }
- }
-
- break;
-
- case 'edit':
- case 'edit_last_post':
-
- // Correctly set back the topic replies and forum posts... but only if the post was approved before.
- if (!$post_approval && $data['post_approved'])
- {
- $sql_data[TOPICS_TABLE]['stat'][] = 'topic_replies = topic_replies - 1, topic_last_view_time = ' . $current_time;
- $sql_data[FORUMS_TABLE]['stat'][] = 'forum_posts = forum_posts - 1';
-
- set_config_count('num_posts', -1, true);
-
- if ($auth->acl_get('f_postcount', $data['forum_id']))
- {
- $sql_data[USERS_TABLE]['stat'][] = 'user_posts = user_posts - 1';
- }
- }
-
break;
}
+ /**
+ * Modify sql query data for post submitting
+ *
+ * @event core.submit_post_modify_sql_data
+ * @var array data Array with the data for the post
+ * @var array poll Array with the poll data for the post
+ * @var string post_mode Variable containing posting mode value
+ * @var bool sql_data Array with the data for the posting SQL query
+ * @var string subject Variable containing post subject value
+ * @var int topic_type Variable containing topic type value
+ * @var string username Variable containing post author name
+ * @since 3.1.3-RC1
+ */
+ $vars = array(
+ 'data',
+ 'poll',
+ 'post_mode',
+ 'sql_data',
+ 'subject',
+ 'topic_type',
+ 'username',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.submit_post_modify_sql_data', compact($vars)));
+
// Submit new topic
if ($post_mode == 'post')
{
@@ -2000,83 +1996,49 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
if ($post_mode == 'reply')
{
$sql_data[POSTS_TABLE]['sql'] = array_merge($sql_data[POSTS_TABLE]['sql'], array(
- 'topic_id' => $data['topic_id'])
- );
+ 'topic_id' => $data['topic_id'],
+ ));
}
$sql = 'INSERT INTO ' . POSTS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_data[POSTS_TABLE]['sql']);
$db->sql_query($sql);
$data['post_id'] = $db->sql_nextid();
- if ($post_mode == 'post')
+ if ($post_mode == 'post' || $post_visibility == ITEM_APPROVED)
{
$sql_data[TOPICS_TABLE]['sql'] = array(
- 'topic_first_post_id' => $data['post_id'],
'topic_last_post_id' => $data['post_id'],
'topic_last_post_time' => $current_time,
- 'topic_last_poster_id' => (int) $user->data['user_id'],
- 'topic_last_poster_name' => (!$user->data['is_registered'] && $username) ? $username : (($user->data['user_id'] != ANONYMOUS) ? $user->data['username'] : ''),
+ 'topic_last_poster_id' => $sql_data[POSTS_TABLE]['sql']['poster_id'],
+ 'topic_last_poster_name' => ($user->data['user_id'] == ANONYMOUS) ? $sql_data[POSTS_TABLE]['sql']['post_username'] : $user->data['username'],
'topic_last_poster_colour' => $user->data['user_colour'],
'topic_last_post_subject' => (string) $subject,
);
}
- unset($sql_data[POSTS_TABLE]['sql']);
- }
-
- $make_global = false;
-
- // Are we globalising or unglobalising?
- if ($post_mode == 'edit_first_post' || $post_mode == 'edit_topic')
- {
- if (!sizeof($topic_row))
+ if ($post_mode == 'post')
{
- $sql = 'SELECT topic_type, topic_replies, topic_replies_real, topic_approved, topic_last_post_id
- FROM ' . TOPICS_TABLE . '
- WHERE topic_id = ' . $data['topic_id'];
- $result = $db->sql_query($sql);
- $topic_row = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
+ $sql_data[TOPICS_TABLE]['sql']['topic_first_post_id'] = $data['post_id'];
}
- // globalise/unglobalise?
- if (($topic_row['topic_type'] != POST_GLOBAL && $topic_type == POST_GLOBAL) || ($topic_row['topic_type'] == POST_GLOBAL && $topic_type != POST_GLOBAL))
+ // Update total post count and forum information
+ if ($post_visibility == ITEM_APPROVED)
{
- if (!empty($sql_data[FORUMS_TABLE]['stat']) && implode('', $sql_data[FORUMS_TABLE]['stat']))
+ if ($post_mode == 'post')
{
- $db->sql_query('UPDATE ' . FORUMS_TABLE . ' SET ' . implode(', ', $sql_data[FORUMS_TABLE]['stat']) . ' WHERE forum_id = ' . $data['forum_id']);
+ set_config_count('num_topics', 1, true);
}
+ set_config_count('num_posts', 1, true);
- $make_global = true;
- $sql_data[FORUMS_TABLE]['stat'] = array();
- }
-
- // globalise
- if ($topic_row['topic_type'] != POST_GLOBAL && $topic_type == POST_GLOBAL)
- {
- // Decrement topic/post count
- $sql_data[FORUMS_TABLE]['stat'][] = 'forum_posts = forum_posts - ' . ($topic_row['topic_replies_real'] + 1);
- $sql_data[FORUMS_TABLE]['stat'][] = 'forum_topics_real = forum_topics_real - 1' . (($topic_row['topic_approved']) ? ', forum_topics = forum_topics - 1' : '');
-
- // Update forum_ids for all posts
- $sql = 'UPDATE ' . POSTS_TABLE . '
- SET forum_id = 0
- WHERE topic_id = ' . $data['topic_id'];
- $db->sql_query($sql);
+ $sql_data[FORUMS_TABLE]['stat'][] = 'forum_last_post_id = ' . $data['post_id'];
+ $sql_data[FORUMS_TABLE]['stat'][] = "forum_last_post_subject = '" . $db->sql_escape($subject) . "'";
+ $sql_data[FORUMS_TABLE]['stat'][] = 'forum_last_post_time = ' . $current_time;
+ $sql_data[FORUMS_TABLE]['stat'][] = 'forum_last_poster_id = ' . (int) $user->data['user_id'];
+ $sql_data[FORUMS_TABLE]['stat'][] = "forum_last_poster_name = '" . $db->sql_escape((!$user->data['is_registered'] && $username) ? $username : (($user->data['user_id'] != ANONYMOUS) ? $user->data['username'] : '')) . "'";
+ $sql_data[FORUMS_TABLE]['stat'][] = "forum_last_poster_colour = '" . $db->sql_escape($user->data['user_colour']) . "'";
}
- // unglobalise
- else if ($topic_row['topic_type'] == POST_GLOBAL && $topic_type != POST_GLOBAL)
- {
- // Increment topic/post count
- $sql_data[FORUMS_TABLE]['stat'][] = 'forum_posts = forum_posts + ' . ($topic_row['topic_replies_real'] + 1);
- $sql_data[FORUMS_TABLE]['stat'][] = 'forum_topics_real = forum_topics_real + 1' . (($topic_row['topic_approved']) ? ', forum_topics = forum_topics + 1' : '');
- // Update forum_ids for all posts
- $sql = 'UPDATE ' . POSTS_TABLE . '
- SET forum_id = ' . $data['forum_id'] . '
- WHERE topic_id = ' . $data['topic_id'];
- $db->sql_query($sql);
- }
+ unset($sql_data[POSTS_TABLE]['sql']);
}
// Update the topics table
@@ -2086,6 +2048,8 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
SET ' . $db->sql_build_array('UPDATE', $sql_data[TOPICS_TABLE]['sql']) . '
WHERE topic_id = ' . $data['topic_id'];
$db->sql_query($sql);
+
+ unset($sql_data[TOPICS_TABLE]['sql']);
}
// Update the posts table
@@ -2095,6 +2059,8 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
SET ' . $db->sql_build_array('UPDATE', $sql_data[POSTS_TABLE]['sql']) . '
WHERE post_id = ' . $data['post_id'];
$db->sql_query($sql);
+
+ unset($sql_data[POSTS_TABLE]['sql']);
}
// Update Poll Tables
@@ -2240,187 +2206,26 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
}
}
- // we need to update the last forum information
- // only applicable if the topic is not global and it is approved
- // we also check to make sure we are not dealing with globaling the latest topic (pretty rare but still needs to be checked)
- if ($topic_type != POST_GLOBAL && !$make_global && ($post_approved || !$data['post_approved']))
+ $first_post_has_topic_info = ($post_mode == 'edit_first_post' &&
+ (($post_visibility == ITEM_DELETED && $data['topic_posts_softdeleted'] == 1) ||
+ ($post_visibility == ITEM_UNAPPROVED && $data['topic_posts_unapproved'] == 1) ||
+ ($post_visibility == ITEM_REAPPROVE && $data['topic_posts_unapproved'] == 1) ||
+ ($post_visibility == ITEM_APPROVED && $data['topic_posts_approved'] == 1)));
+ // Fix the post's and topic's visibility and first/last post information, when the post is edited
+ if (($post_mode != 'post' && $post_mode != 'reply') && $data['post_visibility'] != $post_visibility)
{
- // the last post makes us update the forum table. This can happen if...
- // We make a new topic
- // We reply to a topic
- // We edit the last post in a topic and this post is the latest in the forum (maybe)
- // We edit the only post in the topic
- // We edit the first post in the topic and all the other posts are not approved
- if (($post_mode == 'post' || $post_mode == 'reply') && $post_approved)
- {
- $sql_data[FORUMS_TABLE]['stat'][] = 'forum_last_post_id = ' . $data['post_id'];
- $sql_data[FORUMS_TABLE]['stat'][] = "forum_last_post_subject = '" . $db->sql_escape($subject) . "'";
- $sql_data[FORUMS_TABLE]['stat'][] = 'forum_last_post_time = ' . $current_time;
- $sql_data[FORUMS_TABLE]['stat'][] = 'forum_last_poster_id = ' . (int) $user->data['user_id'];
- $sql_data[FORUMS_TABLE]['stat'][] = "forum_last_poster_name = '" . $db->sql_escape((!$user->data['is_registered'] && $username) ? $username : (($user->data['user_id'] != ANONYMOUS) ? $user->data['username'] : '')) . "'";
- $sql_data[FORUMS_TABLE]['stat'][] = "forum_last_poster_colour = '" . $db->sql_escape($user->data['user_colour']) . "'";
- }
- else if ($post_mode == 'edit_last_post' || $post_mode == 'edit_topic' || ($post_mode == 'edit_first_post' && !$data['topic_replies']))
- {
- // this does not _necessarily_ mean that we must update the info again,
- // it just means that we might have to
- $sql = 'SELECT forum_last_post_id, forum_last_post_subject
- FROM ' . FORUMS_TABLE . '
- WHERE forum_id = ' . (int) $data['forum_id'];
- $result = $db->sql_query($sql);
- $row = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
+ // If the post was not approved, it could also be the starter,
+ // so we sync the starter after approving/restoring, to ensure that the stats are correct
+ // Same applies for the last post
+ $is_starter = ($post_mode == 'edit_first_post' || $post_mode == 'edit_topic' || $data['post_visibility'] != ITEM_APPROVED);
+ $is_latest = ($post_mode == 'edit_last_post' || $post_mode == 'edit_topic' || $data['post_visibility'] != ITEM_APPROVED);
- // this post is the latest post in the forum, better update
- if ($row['forum_last_post_id'] == $data['post_id'])
- {
- // If post approved and subject changed, or poster is anonymous, we need to update the forum_last* rows
- if ($post_approved && ($row['forum_last_post_subject'] !== $subject || $data['poster_id'] == ANONYMOUS))
- {
- // the post's subject changed
- if ($row['forum_last_post_subject'] !== $subject)
- {
- $sql_data[FORUMS_TABLE]['stat'][] = 'forum_last_post_subject = \'' . $db->sql_escape($subject) . '\'';
- }
-
- // Update the user name if poster is anonymous... just in case an admin changed it
- if ($data['poster_id'] == ANONYMOUS)
- {
- $sql_data[FORUMS_TABLE]['stat'][] = "forum_last_poster_name = '" . $db->sql_escape($username) . "'";
- }
- }
- else if ($data['post_approved'] !== $post_approved)
- {
- // we need a fresh change of socks, everything has become invalidated
- $sql = 'SELECT MAX(topic_last_post_id) as last_post_id
- FROM ' . TOPICS_TABLE . '
- WHERE forum_id = ' . (int) $data['forum_id'] . '
- AND topic_approved = 1';
- $result = $db->sql_query($sql);
- $row = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
-
- // any posts left in this forum?
- if (!empty($row['last_post_id']))
- {
- $sql = 'SELECT p.post_id, p.post_subject, p.post_time, p.poster_id, p.post_username, u.user_id, u.username, u.user_colour
- FROM ' . POSTS_TABLE . ' p, ' . USERS_TABLE . ' u
- WHERE p.poster_id = u.user_id
- AND p.post_id = ' . (int) $row['last_post_id'];
- $result = $db->sql_query($sql);
- $row = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
-
- // salvation, a post is found! jam it into the forums table
- $sql_data[FORUMS_TABLE]['stat'][] = 'forum_last_post_id = ' . (int) $row['post_id'];
- $sql_data[FORUMS_TABLE]['stat'][] = "forum_last_post_subject = '" . $db->sql_escape($row['post_subject']) . "'";
- $sql_data[FORUMS_TABLE]['stat'][] = 'forum_last_post_time = ' . (int) $row['post_time'];
- $sql_data[FORUMS_TABLE]['stat'][] = 'forum_last_poster_id = ' . (int) $row['poster_id'];
- $sql_data[FORUMS_TABLE]['stat'][] = "forum_last_poster_name = '" . $db->sql_escape(($row['poster_id'] == ANONYMOUS) ? $row['post_username'] : $row['username']) . "'";
- $sql_data[FORUMS_TABLE]['stat'][] = "forum_last_poster_colour = '" . $db->sql_escape($row['user_colour']) . "'";
- }
- else
- {
- // just our luck, the last topic in the forum has just been turned unapproved...
- $sql_data[FORUMS_TABLE]['stat'][] = 'forum_last_post_id = 0';
- $sql_data[FORUMS_TABLE]['stat'][] = "forum_last_post_subject = ''";
- $sql_data[FORUMS_TABLE]['stat'][] = 'forum_last_post_time = 0';
- $sql_data[FORUMS_TABLE]['stat'][] = 'forum_last_poster_id = 0';
- $sql_data[FORUMS_TABLE]['stat'][] = "forum_last_poster_name = ''";
- $sql_data[FORUMS_TABLE]['stat'][] = "forum_last_poster_colour = ''";
- }
- }
- }
- }
- }
- else if ($make_global)
- {
- // somebody decided to be a party pooper, we must recalculate the whole shebang (maybe)
- $sql = 'SELECT forum_last_post_id
- FROM ' . FORUMS_TABLE . '
- WHERE forum_id = ' . (int) $data['forum_id'];
- $result = $db->sql_query($sql);
- $forum_row = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
-
- // we made a topic global, go get new data
- if ($topic_row['topic_type'] != POST_GLOBAL && $topic_type == POST_GLOBAL && $forum_row['forum_last_post_id'] == $topic_row['topic_last_post_id'])
- {
- // we need a fresh change of socks, everything has become invalidated
- $sql = 'SELECT MAX(topic_last_post_id) as last_post_id
- FROM ' . TOPICS_TABLE . '
- WHERE forum_id = ' . (int) $data['forum_id'] . '
- AND topic_approved = 1';
- $result = $db->sql_query($sql);
- $row = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
-
- // any posts left in this forum?
- if (!empty($row['last_post_id']))
- {
- $sql = 'SELECT p.post_id, p.post_subject, p.post_time, p.poster_id, p.post_username, u.user_id, u.username, u.user_colour
- FROM ' . POSTS_TABLE . ' p, ' . USERS_TABLE . ' u
- WHERE p.poster_id = u.user_id
- AND p.post_id = ' . (int) $row['last_post_id'];
- $result = $db->sql_query($sql);
- $row = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
-
- // salvation, a post is found! jam it into the forums table
- $sql_data[FORUMS_TABLE]['stat'][] = 'forum_last_post_id = ' . (int) $row['post_id'];
- $sql_data[FORUMS_TABLE]['stat'][] = "forum_last_post_subject = '" . $db->sql_escape($row['post_subject']) . "'";
- $sql_data[FORUMS_TABLE]['stat'][] = 'forum_last_post_time = ' . (int) $row['post_time'];
- $sql_data[FORUMS_TABLE]['stat'][] = 'forum_last_poster_id = ' . (int) $row['poster_id'];
- $sql_data[FORUMS_TABLE]['stat'][] = "forum_last_poster_name = '" . $db->sql_escape(($row['poster_id'] == ANONYMOUS) ? $row['post_username'] : $row['username']) . "'";
- $sql_data[FORUMS_TABLE]['stat'][] = "forum_last_poster_colour = '" . $db->sql_escape($row['user_colour']) . "'";
- }
- else
- {
- // just our luck, the last topic in the forum has just been globalized...
- $sql_data[FORUMS_TABLE]['stat'][] = 'forum_last_post_id = 0';
- $sql_data[FORUMS_TABLE]['stat'][] = "forum_last_post_subject = ''";
- $sql_data[FORUMS_TABLE]['stat'][] = 'forum_last_post_time = 0';
- $sql_data[FORUMS_TABLE]['stat'][] = 'forum_last_poster_id = 0';
- $sql_data[FORUMS_TABLE]['stat'][] = "forum_last_poster_name = ''";
- $sql_data[FORUMS_TABLE]['stat'][] = "forum_last_poster_colour = ''";
- }
- }
- else if ($topic_row['topic_type'] == POST_GLOBAL && $topic_type != POST_GLOBAL && $forum_row['forum_last_post_id'] < $topic_row['topic_last_post_id'])
- {
- // this post has a higher id, it is newer
- $sql = 'SELECT p.post_id, p.post_subject, p.post_time, p.poster_id, p.post_username, u.user_id, u.username, u.user_colour
- FROM ' . POSTS_TABLE . ' p, ' . USERS_TABLE . ' u
- WHERE p.poster_id = u.user_id
- AND p.post_id = ' . (int) $topic_row['topic_last_post_id'];
- $result = $db->sql_query($sql);
- $row = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
-
- // salvation, a post is found! jam it into the forums table
- $sql_data[FORUMS_TABLE]['stat'][] = 'forum_last_post_id = ' . (int) $row['post_id'];
- $sql_data[FORUMS_TABLE]['stat'][] = "forum_last_post_subject = '" . $db->sql_escape($row['post_subject']) . "'";
- $sql_data[FORUMS_TABLE]['stat'][] = 'forum_last_post_time = ' . (int) $row['post_time'];
- $sql_data[FORUMS_TABLE]['stat'][] = 'forum_last_poster_id = ' . (int) $row['poster_id'];
- $sql_data[FORUMS_TABLE]['stat'][] = "forum_last_poster_name = '" . $db->sql_escape(($row['poster_id'] == ANONYMOUS) ? $row['post_username'] : $row['username']) . "'";
- $sql_data[FORUMS_TABLE]['stat'][] = "forum_last_poster_colour = '" . $db->sql_escape($row['user_colour']) . "'";
- }
+ $phpbb_content_visibility = $phpbb_container->get('content.visibility');
+ $phpbb_content_visibility->set_post_visibility($post_visibility, $data['post_id'], $data['topic_id'], $data['forum_id'], $user->data['user_id'], time(), '', $is_starter, $is_latest);
}
-
- // topic sync time!
- // simply, we update if it is a reply or the last post is edited
- if ($post_approved)
+ else if ($post_mode == 'edit_last_post' || $post_mode == 'edit_topic' || $first_post_has_topic_info)
{
- // reply requires the whole thing
- if ($post_mode == 'reply')
- {
- $sql_data[TOPICS_TABLE]['stat'][] = 'topic_last_post_id = ' . (int) $data['post_id'];
- $sql_data[TOPICS_TABLE]['stat'][] = 'topic_last_poster_id = ' . (int) $user->data['user_id'];
- $sql_data[TOPICS_TABLE]['stat'][] = "topic_last_poster_name = '" . $db->sql_escape((!$user->data['is_registered'] && $username) ? $username : (($user->data['user_id'] != ANONYMOUS) ? $user->data['username'] : '')) . "'";
- $sql_data[TOPICS_TABLE]['stat'][] = "topic_last_poster_colour = '" . (($user->data['user_id'] != ANONYMOUS) ? $db->sql_escape($user->data['user_colour']) : '') . "'";
- $sql_data[TOPICS_TABLE]['stat'][] = "topic_last_post_subject = '" . $db->sql_escape($subject) . "'";
- $sql_data[TOPICS_TABLE]['stat'][] = 'topic_last_post_time = ' . (int) $current_time;
- }
- else if ($post_mode == 'edit_last_post' || $post_mode == 'edit_topic' || ($post_mode == 'edit_first_post' && !$data['topic_replies']))
+ if ($post_visibility == ITEM_APPROVED || $data['topic_visibility'] == $post_visibility)
{
// only the subject can be changed from edit
$sql_data[TOPICS_TABLE]['stat'][] = "topic_last_post_subject = '" . $db->sql_escape($subject) . "'";
@@ -2430,57 +2235,44 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
{
$sql_data[TOPICS_TABLE]['stat'][] = "topic_last_poster_name = '" . $db->sql_escape($username) . "'";
}
- }
- }
- else if (!$data['post_approved'] && ($post_mode == 'edit_last_post' || $post_mode == 'edit_topic' || ($post_mode == 'edit_first_post' && !$data['topic_replies'])))
- {
- // like having the rug pulled from under us
- $sql = 'SELECT MAX(post_id) as last_post_id
- FROM ' . POSTS_TABLE . '
- WHERE topic_id = ' . (int) $data['topic_id'] . '
- AND post_approved = 1';
- $result = $db->sql_query($sql);
- $row = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
-
- // any posts left in this forum?
- if (!empty($row['last_post_id']))
- {
- $sql = 'SELECT p.post_id, p.post_subject, p.post_time, p.poster_id, p.post_username, u.user_id, u.username, u.user_colour
- FROM ' . POSTS_TABLE . ' p, ' . USERS_TABLE . ' u
- WHERE p.poster_id = u.user_id
- AND p.post_id = ' . (int) $row['last_post_id'];
- $result = $db->sql_query($sql);
- $row = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
- // salvation, a post is found! jam it into the topics table
- $sql_data[TOPICS_TABLE]['stat'][] = 'topic_last_post_id = ' . (int) $row['post_id'];
- $sql_data[TOPICS_TABLE]['stat'][] = "topic_last_post_subject = '" . $db->sql_escape($row['post_subject']) . "'";
- $sql_data[TOPICS_TABLE]['stat'][] = 'topic_last_post_time = ' . (int) $row['post_time'];
- $sql_data[TOPICS_TABLE]['stat'][] = 'topic_last_poster_id = ' . (int) $row['poster_id'];
- $sql_data[TOPICS_TABLE]['stat'][] = "topic_last_poster_name = '" . $db->sql_escape(($row['poster_id'] == ANONYMOUS) ? $row['post_username'] : $row['username']) . "'";
- $sql_data[TOPICS_TABLE]['stat'][] = "topic_last_poster_colour = '" . $db->sql_escape($row['user_colour']) . "'";
- }
- }
+ if ($post_visibility == ITEM_APPROVED)
+ {
+ // this does not _necessarily_ mean that we must update the info again,
+ // it just means that we might have to
+ $sql = 'SELECT forum_last_post_id, forum_last_post_subject
+ FROM ' . FORUMS_TABLE . '
+ WHERE forum_id = ' . (int) $data['forum_id'];
+ $result = $db->sql_query($sql);
+ $row = $db->sql_fetchrow($result);
+ $db->sql_freeresult($result);
- // Update total post count, do not consider moderated posts/topics
- if ($post_approval)
- {
- if ($post_mode == 'post')
- {
- set_config_count('num_topics', 1, true);
- set_config_count('num_posts', 1, true);
- }
+ // this post is the latest post in the forum, better update
+ if ($row['forum_last_post_id'] == $data['post_id'] && ($row['forum_last_post_subject'] !== $subject || $data['poster_id'] == ANONYMOUS))
+ {
+ // the post's subject changed
+ if ($row['forum_last_post_subject'] !== $subject)
+ {
+ $sql_data[FORUMS_TABLE]['stat'][] = "forum_last_post_subject = '" . $db->sql_escape($subject) . "'";
+ }
- if ($post_mode == 'reply')
- {
- set_config_count('num_posts', 1, true);
+ // Update the user name if poster is anonymous... just in case a moderator changed it
+ if ($data['poster_id'] == ANONYMOUS)
+ {
+ $sql_data[FORUMS_TABLE]['stat'][] = "forum_last_poster_name = '" . $db->sql_escape($username) . "'";
+ }
+ }
+ }
}
}
// Update forum stats
- $where_sql = array(POSTS_TABLE => 'post_id = ' . $data['post_id'], TOPICS_TABLE => 'topic_id = ' . $data['topic_id'], FORUMS_TABLE => 'forum_id = ' . $data['forum_id'], USERS_TABLE => 'user_id = ' . $poster_id);
+ $where_sql = array(
+ POSTS_TABLE => 'post_id = ' . $data['post_id'],
+ TOPICS_TABLE => 'topic_id = ' . $data['topic_id'],
+ FORUMS_TABLE => 'forum_id = ' . $data['forum_id'],
+ USERS_TABLE => 'user_id = ' . $poster_id
+ );
foreach ($sql_data as $table => $update_ary)
{
@@ -2492,7 +2284,7 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
}
// Delete topic shadows (if any exist). We do not need a shadow topic for an global announcement
- if ($make_global)
+ if ($topic_type == POST_GLOBAL)
{
$sql = 'DELETE FROM ' . TOPICS_TABLE . '
WHERE topic_moved_id = ' . $data['topic_id'];
@@ -2516,27 +2308,22 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
if ($update_search_index && $data['enable_indexing'])
{
// Select the search method and do some additional checks to ensure it can actually be utilised
- $search_type = basename($config['search_type']);
-
- if (!file_exists($phpbb_root_path . 'includes/search/' . $search_type . '.' . $phpEx))
- {
- trigger_error('NO_SUCH_SEARCH_MODULE');
- }
+ $search_type = $config['search_type'];
if (!class_exists($search_type))
{
- include("{$phpbb_root_path}includes/search/$search_type.$phpEx");
+ trigger_error('NO_SUCH_SEARCH_MODULE');
}
$error = false;
- $search = new $search_type($error);
+ $search = new $search_type($error, $phpbb_root_path, $phpEx, $auth, $config, $db, $user, $phpbb_dispatcher);
if ($error)
{
trigger_error($error);
}
- $search->index($mode, $data['post_id'], $data['message'], $subject, $poster_id, ($topic_type == POST_GLOBAL) ? 0 : $data['forum_id']);
+ $search->index($mode, $data['post_id'], $data['message'], $subject, $poster_id, $data['forum_id']);
}
// Topic Notification, do not change if moderator is changing other users posts...
@@ -2565,7 +2352,7 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
// Mark this topic as read
// We do not use post_time here, this is intended (post_time can have a date in the past if editing a message)
- markread('topic', (($topic_type == POST_GLOBAL) ? 0 : $data['forum_id']), $data['topic_id'], time());
+ markread('topic', $data['forum_id'], $data['topic_id'], time());
//
if ($config['load_db_lastread'] && $user->data['is_registered'])
@@ -2573,7 +2360,7 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
$sql = 'SELECT mark_time
FROM ' . FORUMS_TRACK_TABLE . '
WHERE user_id = ' . $user->data['user_id'] . '
- AND forum_id = ' . (($topic_type == POST_GLOBAL) ? 0 : $data['forum_id']);
+ AND forum_id = ' . $data['forum_id'];
$result = $db->sql_query($sql);
$f_mark_time = (int) $db->sql_fetchfield('mark_time');
$db->sql_freeresult($result);
@@ -2586,38 +2373,137 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
if (($config['load_db_lastread'] && $user->data['is_registered']) || $config['load_anon_lastread'] || $user->data['is_registered'])
{
// Update forum info
- if ($topic_type == POST_GLOBAL)
- {
- $sql = 'SELECT MAX(topic_last_post_time) as forum_last_post_time
- FROM ' . TOPICS_TABLE . '
- WHERE forum_id = 0';
- }
- else
- {
- $sql = 'SELECT forum_last_post_time
- FROM ' . FORUMS_TABLE . '
- WHERE forum_id = ' . $data['forum_id'];
- }
+ $sql = 'SELECT forum_last_post_time
+ FROM ' . FORUMS_TABLE . '
+ WHERE forum_id = ' . $data['forum_id'];
$result = $db->sql_query($sql);
$forum_last_post_time = (int) $db->sql_fetchfield('forum_last_post_time');
$db->sql_freeresult($result);
- update_forum_tracking_info((($topic_type == POST_GLOBAL) ? 0 : $data['forum_id']), $forum_last_post_time, $f_mark_time, false);
+ update_forum_tracking_info($data['forum_id'], $forum_last_post_time, $f_mark_time, false);
}
+ // If a username was supplied or the poster is a guest, we will use the supplied username.
+ // Doing it this way we can use "...post by guest-username..." in notifications when
+ // "guest-username" is supplied or ommit the username if it is not.
+ $username = ($username !== '' || !$user->data['is_registered']) ? $username : $user->data['username'];
+
// Send Notifications
- if (($mode == 'reply' || $mode == 'quote' || $mode == 'post') && $post_approval)
+ $notification_data = array_merge($data, array(
+ 'topic_title' => (isset($data['topic_title'])) ? $data['topic_title'] : $subject,
+ 'post_username' => $username,
+ 'poster_id' => $poster_id,
+ 'post_text' => $data['message'],
+ 'post_time' => $current_time,
+ 'post_subject' => $subject,
+ ));
+
+ $phpbb_notifications = $phpbb_container->get('notification_manager');
+
+ if ($post_visibility == ITEM_APPROVED)
+ {
+ switch ($mode)
+ {
+ case 'post':
+ $phpbb_notifications->add_notifications(array(
+ 'notification.type.quote',
+ 'notification.type.topic',
+ ), $notification_data);
+ break;
+
+ case 'reply':
+ case 'quote':
+ $phpbb_notifications->add_notifications(array(
+ 'notification.type.quote',
+ 'notification.type.bookmark',
+ 'notification.type.post',
+ ), $notification_data);
+ break;
+
+ case 'edit_topic':
+ case 'edit_first_post':
+ case 'edit':
+ case 'edit_last_post':
+ $phpbb_notifications->update_notifications(array(
+ 'notification.type.quote',
+ 'notification.type.bookmark',
+ 'notification.type.topic',
+ 'notification.type.post',
+ ), $notification_data);
+ break;
+ }
+ }
+ else if ($post_visibility == ITEM_UNAPPROVED)
+ {
+ switch ($mode)
+ {
+ case 'post':
+ $phpbb_notifications->add_notifications('notification.type.topic_in_queue', $notification_data);
+ break;
+
+ case 'reply':
+ case 'quote':
+ $phpbb_notifications->add_notifications('notification.type.post_in_queue', $notification_data);
+ break;
+
+ case 'edit_topic':
+ case 'edit_first_post':
+ case 'edit':
+ case 'edit_last_post':
+ // Nothing to do here
+ break;
+ }
+ }
+ else if ($post_visibility == ITEM_REAPPROVE)
{
- // If a username was supplied or the poster is a guest, we will use the supplied username.
- // Doing it this way we can use "...post by guest-username..." in notifications when
- // "guest-username" is supplied or ommit the username if it is not.
- $username = ($username !== '' || !$user->data['is_registered']) ? $username : $user->data['username'];
- user_notification($mode, $subject, $data['topic_title'], $data['forum_name'], $data['forum_id'], $data['topic_id'], $data['post_id'], $username);
+ switch ($mode)
+ {
+ case 'edit_topic':
+ case 'edit_first_post':
+ $phpbb_notifications->add_notifications('notification.type.topic_in_queue', $notification_data);
+
+ // Delete the approve_post notification so we can notify the user again,
+ // when his post got reapproved
+ $phpbb_notifications->delete_notifications('notification.type.approve_post', $notification_data['post_id']);
+ break;
+
+ case 'edit':
+ case 'edit_last_post':
+ $phpbb_notifications->add_notifications('notification.type.post_in_queue', $notification_data);
+
+ // Delete the approve_post notification so we can notify the user again,
+ // when his post got reapproved
+ $phpbb_notifications->delete_notifications('notification.type.approve_post', $notification_data['post_id']);
+ break;
+
+ case 'post':
+ case 'reply':
+ case 'quote':
+ // Nothing to do here
+ break;
+ }
+ }
+ else if ($post_visibility == ITEM_DELETED)
+ {
+ switch ($mode)
+ {
+ case 'post':
+ case 'reply':
+ case 'quote':
+ case 'edit_topic':
+ case 'edit_first_post':
+ case 'edit':
+ case 'edit_last_post':
+ // Nothing to do here
+ break;
+ }
}
$params = $add_anchor = '';
- if ($post_approval)
+ if ($post_visibility == ITEM_APPROVED ||
+ ($auth->acl_get('m_softdelete', $data['forum_id']) && $post_visibility == ITEM_DELETED) ||
+ ($auth->acl_get('m_approve', $data['forum_id']) && in_array($post_visibility, array(ITEM_UNAPPROVED, ITEM_REAPPROVE))))
{
$params .= '&amp;t=' . $data['topic_id'];
@@ -2635,6 +2521,44 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
$url = (!$params) ? "{$phpbb_root_path}viewforum.$phpEx" : "{$phpbb_root_path}viewtopic.$phpEx";
$url = append_sid($url, 'f=' . $data['forum_id'] . $params) . $add_anchor;
+ /**
+ * This event is used for performing actions directly after a post or topic
+ * has been submitted. When a new topic is posted, the topic ID is
+ * available in the $data array.
+ *
+ * The only action that can be done by altering data made available to this
+ * event is to modify the return URL ($url).
+ *
+ * @event core.submit_post_end
+ * @var string mode Variable containing posting mode value
+ * @var string subject Variable containing post subject value
+ * @var string username Variable containing post author name
+ * @var int topic_type Variable containing topic type value
+ * @var array poll Array with the poll data for the post
+ * @var array data Array with the data for the post
+ * @var int post_visibility Variable containing up to date post visibility
+ * @var bool update_message Flag indicating if the post will be updated
+ * @var bool update_search_index Flag indicating if the search index will be updated
+ * @var string url The "Return to topic" URL
+ *
+ * @since 3.1.0-a3
+ * @changed 3.1.0-RC3 Added vars mode, subject, username, topic_type,
+ * poll, update_message, update_search_index
+ */
+ $vars = array(
+ 'mode',
+ 'subject',
+ 'username',
+ 'topic_type',
+ 'poll',
+ 'data',
+ 'post_visibility',
+ 'update_message',
+ 'update_search_index',
+ 'url',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.submit_post_end', compact($vars)));
+
return $url;
}
@@ -2740,4 +2664,174 @@ function phpbb_bump_topic($forum_id, $topic_id, $post_data, $bump_time = false)
return $url;
}
-?> \ No newline at end of file
+/**
+* Show upload popup (progress bar)
+*/
+function phpbb_upload_popup($forum_style = 0)
+{
+ global $template, $user;
+
+ ($forum_style) ? $user->setup('posting', $forum_style) : $user->setup('posting');
+
+ page_header($user->lang['PROGRESS_BAR']);
+
+ $template->set_filenames(array(
+ 'popup' => 'posting_progress_bar.html')
+ );
+
+ $template->assign_vars(array(
+ 'PROGRESS_BAR' => $user->img('upload_bar', $user->lang['UPLOAD_IN_PROGRESS']))
+ );
+
+ $template->display('popup');
+
+ garbage_collection();
+ exit_handler();
+}
+
+/**
+* Do the various checks required for removing posts as well as removing it
+*
+* @param int $forum_id The id of the forum
+* @param int $topic_id The id of the topic
+* @param int $post_id The id of the post
+* @param array $post_data Array with the post data
+* @param bool $is_soft The flag indicating whether it is the soft delete mode
+* @param string $delete_reason Description for the post deletion reason
+*
+* @return null
+*/
+function phpbb_handle_post_delete($forum_id, $topic_id, $post_id, &$post_data, $is_soft = false, $delete_reason = '')
+{
+ global $user, $auth, $config, $request;
+ global $phpbb_root_path, $phpEx, $phpbb_dispatcher;
+
+ $force_delete_allowed = $force_softdelete_allowed = false;
+ $perm_check = ($is_soft) ? 'softdelete' : 'delete';
+
+ /**
+ * This event allows to modify the conditions for the post deletion
+ *
+ * @event core.handle_post_delete_conditions
+ * @var int forum_id The id of the forum
+ * @var int topic_id The id of the topic
+ * @var int post_id The id of the post
+ * @var array post_data Array with the post data
+ * @var bool is_soft The flag indicating whether it is the soft delete mode
+ * @var string delete_reason Description for the post deletion reason
+ * @var bool force_delete_allowed Allow the user to delete the post (all permissions and conditions are ignored)
+ * @var bool force_softdelete_allowed Allow the user to softdelete the post (all permissions and conditions are ignored)
+ * @var string perm_check The deletion mode softdelete|delete
+ * @since 3.1.11-RC1
+ */
+ $vars = array(
+ 'forum_id',
+ 'topic_id',
+ 'post_id',
+ 'post_data',
+ 'is_soft',
+ 'delete_reason',
+ 'force_delete_allowed',
+ 'force_softdelete_allowed',
+ 'perm_check',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.handle_post_delete_conditions', compact($vars)));
+
+ // If moderator removing post or user itself removing post, present a confirmation screen
+ if ($force_delete_allowed || ($is_soft && $force_softdelete_allowed) || $auth->acl_get("m_$perm_check", $forum_id) || ($post_data['poster_id'] == $user->data['user_id'] && $user->data['is_registered'] && $auth->acl_get("f_$perm_check", $forum_id) && $post_id == $post_data['topic_last_post_id'] && !$post_data['post_edit_locked'] && ($post_data['post_time'] > time() - ($config['delete_time'] * 60) || !$config['delete_time'])))
+ {
+ $s_hidden_fields = array(
+ 'p' => $post_id,
+ 'f' => $forum_id,
+ 'mode' => ($is_soft) ? 'soft_delete' : 'delete',
+ );
+
+ if (confirm_box(true))
+ {
+ $data = array(
+ 'topic_first_post_id' => $post_data['topic_first_post_id'],
+ 'topic_last_post_id' => $post_data['topic_last_post_id'],
+ 'topic_posts_approved' => $post_data['topic_posts_approved'],
+ 'topic_posts_unapproved' => $post_data['topic_posts_unapproved'],
+ 'topic_posts_softdeleted' => $post_data['topic_posts_softdeleted'],
+ 'topic_visibility' => $post_data['topic_visibility'],
+ 'topic_type' => $post_data['topic_type'],
+ 'post_visibility' => $post_data['post_visibility'],
+ 'post_reported' => $post_data['post_reported'],
+ 'post_time' => $post_data['post_time'],
+ 'poster_id' => $post_data['poster_id'],
+ 'post_postcount' => $post_data['post_postcount'],
+ );
+
+ $next_post_id = delete_post($forum_id, $topic_id, $post_id, $data, $is_soft, $delete_reason);
+ $post_username = ($post_data['poster_id'] == ANONYMOUS && !empty($post_data['post_username'])) ? $post_data['post_username'] : $post_data['username'];
+
+ if ($next_post_id === false)
+ {
+ add_log('mod', $forum_id, $topic_id, (($is_soft) ? 'LOG_SOFTDELETE_TOPIC' : 'LOG_DELETE_TOPIC'), $post_data['topic_title'], $post_username, $delete_reason);
+
+ $meta_info = append_sid("{$phpbb_root_path}viewforum.$phpEx", "f=$forum_id");
+ $message = $user->lang['POST_DELETED'];
+ }
+ else
+ {
+ add_log('mod', $forum_id, $topic_id, (($is_soft) ? 'LOG_SOFTDELETE_POST' : 'LOG_DELETE_POST'), $post_data['post_subject'], $post_username, $delete_reason);
+
+ $meta_info = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&amp;t=$topic_id&amp;p=$next_post_id") . "#p$next_post_id";
+ $message = $user->lang['POST_DELETED'];
+
+ if (!$request->is_ajax())
+ {
+ $message .= '<br /><br />' . $user->lang('RETURN_TOPIC', '<a href="' . $meta_info . '">', '</a>');
+ }
+ }
+
+ meta_refresh(3, $meta_info);
+ if (!$request->is_ajax())
+ {
+ $message .= '<br /><br />' . $user->lang('RETURN_FORUM', '<a href="' . append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_id) . '">', '</a>');
+ }
+ trigger_error($message);
+ }
+ else
+ {
+ global $template;
+
+ $can_delete = $force_delete_allowed || ($auth->acl_get('m_delete', $forum_id) || ($post_data['poster_id'] == $user->data['user_id'] && $user->data['is_registered'] && $auth->acl_get('f_delete', $forum_id)));
+ $can_softdelete = $force_softdelete_allowed || ($auth->acl_get('m_softdelete', $forum_id) || ($post_data['poster_id'] == $user->data['user_id'] && $user->data['is_registered'] && $auth->acl_get('f_softdelete', $forum_id)));
+
+ $template->assign_vars(array(
+ 'S_SOFTDELETED' => $post_data['post_visibility'] == ITEM_DELETED,
+ 'S_CHECKED_PERMANENT' => $request->is_set_post('delete_permanent') ? ' checked="checked"' : '',
+ 'S_ALLOWED_DELETE' => $can_delete,
+ 'S_ALLOWED_SOFTDELETE' => $can_softdelete,
+ ));
+
+ $l_confirm = 'DELETE_POST';
+ if ($post_data['post_visibility'] == ITEM_DELETED)
+ {
+ $l_confirm .= '_PERMANENTLY';
+ $s_hidden_fields['delete_permanent'] = '1';
+ }
+ else if (!$can_softdelete)
+ {
+ $s_hidden_fields['delete_permanent'] = '1';
+ }
+
+ confirm_box(false, $l_confirm, build_hidden_fields($s_hidden_fields), 'confirm_delete_body.html');
+ }
+ }
+
+ // If we are here the user is not able to delete - present the correct error message
+ if ($post_data['poster_id'] != $user->data['user_id'] && $auth->acl_get('f_delete', $forum_id))
+ {
+ trigger_error('DELETE_OWN_POSTS');
+ }
+
+ if ($post_data['poster_id'] == $user->data['user_id'] && $auth->acl_get('f_delete', $forum_id) && $post_id != $post_data['topic_last_post_id'])
+ {
+ trigger_error('CANNOT_DELETE_REPLIED');
+ }
+
+ trigger_error('USER_CANNOT_DELETE');
+}
diff --git a/phpBB/includes/functions_privmsgs.php b/phpBB/includes/functions_privmsgs.php
index c99f40d453..4aad1746d5 100644
--- a/phpBB/includes/functions_privmsgs.php
+++ b/phpBB/includes/functions_privmsgs.php
@@ -1,10 +1,13 @@
<?php
/**
*
-* @package phpBB3
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -19,7 +22,8 @@ if (!defined('IN_PHPBB'))
Ability to simply add own rules by doing three things:
1) Add an appropriate constant
2) Add a new check array to the global_privmsgs_rules variable and the condition array (if one is required)
- 3) Add a new language variable to ucp.php
+ 3) Implement the rule logic in the check_rule() function
+ 4) Add a new language variable to ucp.php
The user is then able to select the new rule. It will be checked against and handled as specified.
To add new actions (yes, checks can be added here too) to the rule management, the core code has to be modified.
@@ -57,42 +61,42 @@ define('CHECK_TO', 5);
*/
$global_privmsgs_rules = array(
CHECK_SUBJECT => array(
- RULE_IS_LIKE => array('check0' => 'message_subject', 'function' => 'preg_match("/" . preg_quote({STRING}, "/") . "/i", {CHECK0})'),
- RULE_IS_NOT_LIKE => array('check0' => 'message_subject', 'function' => '!(preg_match("/" . preg_quote({STRING}, "/") . "/i", {CHECK0}))'),
- RULE_IS => array('check0' => 'message_subject', 'function' => '{CHECK0} == {STRING}'),
- RULE_IS_NOT => array('check0' => 'message_subject', 'function' => '{CHECK0} != {STRING}'),
- RULE_BEGINS_WITH => array('check0' => 'message_subject', 'function' => 'preg_match("/^" . preg_quote({STRING}, "/") . "/i", {CHECK0})'),
- RULE_ENDS_WITH => array('check0' => 'message_subject', 'function' => 'preg_match("/" . preg_quote({STRING}, "/") . "$/i", {CHECK0})'),
+ RULE_IS_LIKE => array('check0' => 'message_subject'),
+ RULE_IS_NOT_LIKE => array('check0' => 'message_subject'),
+ RULE_IS => array('check0' => 'message_subject'),
+ RULE_IS_NOT => array('check0' => 'message_subject'),
+ RULE_BEGINS_WITH => array('check0' => 'message_subject'),
+ RULE_ENDS_WITH => array('check0' => 'message_subject'),
),
CHECK_SENDER => array(
- RULE_IS_LIKE => array('check0' => 'username', 'function' => 'preg_match("/" . preg_quote({STRING}, "/") . "/i", {CHECK0})'),
- RULE_IS_NOT_LIKE => array('check0' => 'username', 'function' => '!(preg_match("/" . preg_quote({STRING}, "/") . "/i", {CHECK0}))'),
- RULE_IS => array('check0' => 'username', 'function' => '{CHECK0} == {STRING}'),
- RULE_IS_NOT => array('check0' => 'username', 'function' => '{CHECK0} != {STRING}'),
- RULE_BEGINS_WITH => array('check0' => 'username', 'function' => 'preg_match("/^" . preg_quote({STRING}, "/") . "/i", {CHECK0})'),
- RULE_ENDS_WITH => array('check0' => 'username', 'function' => 'preg_match("/" . preg_quote({STRING}, "/") . "$/i", {CHECK0})'),
- RULE_IS_FRIEND => array('check0' => 'friend', 'function' => '{CHECK0} == 1'),
- RULE_IS_FOE => array('check0' => 'foe', 'function' => '{CHECK0} == 1'),
- RULE_IS_USER => array('check0' => 'author_id', 'function' => '{CHECK0} == {USER_ID}'),
- RULE_IS_GROUP => array('check0' => 'author_in_group', 'function' => 'in_array({GROUP_ID}, {CHECK0})'),
+ RULE_IS_LIKE => array('check0' => 'username'),
+ RULE_IS_NOT_LIKE => array('check0' => 'username'),
+ RULE_IS => array('check0' => 'username'),
+ RULE_IS_NOT => array('check0' => 'username'),
+ RULE_BEGINS_WITH => array('check0' => 'username'),
+ RULE_ENDS_WITH => array('check0' => 'username'),
+ RULE_IS_FRIEND => array('check0' => 'friend'),
+ RULE_IS_FOE => array('check0' => 'foe'),
+ RULE_IS_USER => array('check0' => 'author_id'),
+ RULE_IS_GROUP => array('check0' => 'author_in_group'),
),
CHECK_MESSAGE => array(
- RULE_IS_LIKE => array('check0' => 'message_text', 'function' => 'preg_match("/" . preg_quote({STRING}, "/") . "/i", {CHECK0})'),
- RULE_IS_NOT_LIKE => array('check0' => 'message_text', 'function' => '!(preg_match("/" . preg_quote({STRING}, "/") . "/i", {CHECK0}))'),
- RULE_IS => array('check0' => 'message_text', 'function' => '{CHECK0} == {STRING}'),
- RULE_IS_NOT => array('check0' => 'message_text', 'function' => '{CHECK0} != {STRING}'),
+ RULE_IS_LIKE => array('check0' => 'message_text'),
+ RULE_IS_NOT_LIKE => array('check0' => 'message_text'),
+ RULE_IS => array('check0' => 'message_text'),
+ RULE_IS_NOT => array('check0' => 'message_text'),
),
CHECK_STATUS => array(
- RULE_ANSWERED => array('check0' => 'pm_replied', 'function' => '{CHECK0} == 1'),
- RULE_FORWARDED => array('check0' => 'pm_forwarded', 'function' => '{CHECK0} == 1'),
+ RULE_ANSWERED => array('check0' => 'pm_replied'),
+ RULE_FORWARDED => array('check0' => 'pm_forwarded'),
),
CHECK_TO => array(
- RULE_TO_GROUP => array('check0' => 'to', 'check1' => 'bcc', 'check2' => 'user_in_group', 'function' => 'in_array("g_" . {CHECK2}, {CHECK0}) || in_array("g_" . {CHECK2}, {CHECK1})'),
- RULE_TO_ME => array('check0' => 'to', 'check1' => 'bcc', 'function' => 'in_array("u_" . $user_id, {CHECK0}) || in_array("u_" . $user_id, {CHECK1})'),
+ RULE_TO_GROUP => array('check0' => 'to', 'check1' => 'bcc', 'check2' => 'user_in_group'),
+ RULE_TO_ME => array('check0' => 'to', 'check1' => 'bcc'),
)
);
@@ -260,16 +264,59 @@ function check_rule(&$rules, &$rule_row, &$message_row, $user_id)
$check_ary = $rules[$rule_row['rule_check']][$rule_row['rule_connection']];
- // Replace Check Literals
- $evaluate = $check_ary['function'];
- $evaluate = preg_replace('/{(CHECK[0-9])}/', '$message_row[$check_ary[strtolower("\1")]]', $evaluate);
+ $result = false;
- // Replace Rule Literals
- $evaluate = preg_replace('/{(STRING|USER_ID|GROUP_ID)}/', '$rule_row["rule_" . strtolower("\1")]', $evaluate);
+ $check0 = $message_row[$check_ary['check0']];
- // Evil Statement
- $result = false;
- eval('$result = (' . $evaluate . ') ? true : false;');
+ switch ($rule_row['rule_connection'])
+ {
+ case RULE_IS_LIKE:
+ $result = preg_match("/" . preg_quote($rule_row['rule_string'], '/') . '/i', $check0);
+ break;
+
+ case RULE_IS_NOT_LIKE:
+ $result = !preg_match("/" . preg_quote($rule_row['rule_string'], '/') . '/i', $check0);
+ break;
+
+ case RULE_IS:
+ $result = ($check0 == $rule_row['rule_string']);
+ break;
+
+ case RULE_IS_NOT:
+ $result = ($check0 != $rule_row['rule_string']);
+ break;
+
+ case RULE_BEGINS_WITH:
+ $result = preg_match("/^" . preg_quote($rule_row['rule_string'], '/') . '/i', $check0);
+ break;
+
+ case RULE_ENDS_WITH:
+ $result = preg_match("/" . preg_quote($rule_row['rule_string'], '/') . '$/i', $check0);
+ break;
+
+ case RULE_IS_FRIEND:
+ case RULE_IS_FOE:
+ case RULE_ANSWERED:
+ case RULE_FORWARDED:
+ $result = ($check0 == 1);
+ break;
+
+ case RULE_IS_USER:
+ $result = ($check0 == $rule_row['rule_user_id']);
+ break;
+
+ case RULE_IS_GROUP:
+ $result = in_array($rule_row['rule_group_id'], $check0);
+ break;
+
+ case RULE_TO_GROUP:
+ $result = (in_array('g_' . $message_row[$check_ary['check2']], $check0) || in_array('g_' . $message_row[$check_ary['check2']], $message_row[$check_ary['check1']]));
+ break;
+
+ case RULE_TO_ME:
+ $result = (in_array('u_' . $user_id, $check0) || in_array('u_' . $user_id, $message_row[$check_ary['check1']]));
+ break;
+ }
if (!$result)
{
@@ -299,7 +346,7 @@ function check_rule(&$rules, &$rule_row, &$message_row, $user_id)
$userdata = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
- $auth2 = new auth();
+ $auth2 = new \phpbb\auth\auth();
$auth2->acl($userdata);
if (!$auth2->acl_get('a_') && !$auth2->acl_get('m_') && !$auth2->acl_getf_global('m_'))
@@ -832,15 +879,26 @@ function update_unread_status($unread, $msg_id, $user_id, $folder_id)
return;
}
- global $db, $user;
+ global $db, $user, $phpbb_container;
+
+ $phpbb_notifications = $phpbb_container->get('notification_manager');
+
+ $phpbb_notifications->mark_notifications_read('notification.type.pm', $msg_id, $user_id);
$sql = 'UPDATE ' . PRIVMSGS_TO_TABLE . "
SET pm_unread = 0
WHERE msg_id = $msg_id
AND user_id = $user_id
- AND folder_id = $folder_id";
+ AND folder_id = $folder_id
+ AND pm_unread = 1";
$db->sql_query($sql);
+ // If the message is already marked as read, we just skip the rest to avoid negative PM count
+ if (!$db->sql_affectedrows())
+ {
+ return;
+ }
+
$sql = 'UPDATE ' . USERS_TABLE . "
SET user_unread_privmsg = user_unread_privmsg - 1
WHERE user_id = $user_id";
@@ -863,6 +921,24 @@ function update_unread_status($unread, $msg_id, $user_id, $folder_id)
}
}
+function mark_folder_read($user_id, $folder_id)
+{
+ global $db;
+
+ $sql = 'SELECT msg_id
+ FROM ' . PRIVMSGS_TO_TABLE . '
+ WHERE folder_id = ' . ((int) $folder_id) . '
+ AND user_id = ' . ((int) $user_id) . '
+ AND pm_unread = 1';
+ $result = $db->sql_query($sql);
+
+ while ($row = $db->sql_fetchrow($result))
+ {
+ update_unread_status(true, $row['msg_id'], $user_id, $folder_id);
+ }
+ $db->sql_freeresult($result);
+}
+
/**
* Handle all actions possible with marked messages
*/
@@ -937,7 +1013,7 @@ function handle_mark_actions($user_id, $mark_action)
*/
function delete_pm($user_id, $msg_ids, $folder_id)
{
- global $db, $user, $phpbb_root_path, $phpEx;
+ global $db, $user, $phpbb_root_path, $phpEx, $phpbb_container, $phpbb_dispatcher;
$user_id = (int) $user_id;
$folder_id = (int) $folder_id;
@@ -961,6 +1037,18 @@ function delete_pm($user_id, $msg_ids, $folder_id)
return false;
}
+ /**
+ * Get all info for PM(s) before they are deleted
+ *
+ * @event core.delete_pm_before
+ * @var int user_id ID of the user requested the message delete
+ * @var array msg_ids array of all messages to be deleted
+ * @var int folder_id ID of the user folder where the messages are stored
+ * @since 3.1.0-b5
+ */
+ $vars = array('user_id', 'msg_ids', 'folder_id');
+ extract($phpbb_dispatcher->trigger_event('core.delete_pm_before', compact($vars)));
+
// Get PM Information for later deleting
$sql = 'SELECT msg_id, pm_unread, pm_new
FROM ' . PRIVMSGS_TO_TABLE . '
@@ -1049,6 +1137,10 @@ function delete_pm($user_id, $msg_ids, $folder_id)
$user->data['user_unread_privmsg'] -= $num_unread;
}
+ $phpbb_notifications = $phpbb_container->get('notification_manager');
+
+ $phpbb_notifications->delete_notifications('notification.type.pm', array_keys($delete_rows));
+
// Now we have to check which messages we can delete completely
$sql = 'SELECT msg_id
FROM ' . PRIVMSGS_TO_TABLE . '
@@ -1101,6 +1193,23 @@ function phpbb_delete_user_pms($user_id)
return false;
}
+ return phpbb_delete_users_pms(array($user_id));
+}
+
+/**
+* Delete all PM(s) for given users and delete the ones without references
+*
+* @param array $user_ids IDs of the users whose private messages we want to delete
+*
+* @return boolean False if there were no pms found, true otherwise.
+*/
+function phpbb_delete_users_pms($user_ids)
+{
+ global $db, $user, $phpbb_root_path, $phpEx, $phpbb_container;
+
+ $user_id_sql = $db->sql_in_set('user_id', $user_ids);
+ $author_id_sql = $db->sql_in_set('author_id', $user_ids);
+
// Get PM Information for later deleting
// The two queries where split, so we can use our indexes
$undelivered_msg = $delete_ids = array();
@@ -1108,7 +1217,7 @@ function phpbb_delete_user_pms($user_id)
// Part 1: get PMs the user received
$sql = 'SELECT msg_id
FROM ' . PRIVMSGS_TO_TABLE . '
- WHERE user_id = ' . $user_id;
+ WHERE ' . $user_id_sql;
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result))
@@ -1118,12 +1227,12 @@ function phpbb_delete_user_pms($user_id)
}
$db->sql_freeresult($result);
- // Part 2: get PMs the user sent, but have yet to be received
- // We cannot simply delete them. First we have to check,
+ // Part 2: get PMs the users sent, but are yet to be received.
+ // We cannot simply delete them. First we have to check
// whether another user already received and read the message.
$sql = 'SELECT msg_id
FROM ' . PRIVMSGS_TO_TABLE . '
- WHERE author_id = ' . $user_id . '
+ WHERE ' . $author_id_sql . '
AND folder_id = ' . PRIVMSGS_NO_BOX;
$result = $db->sql_query($sql);
@@ -1141,6 +1250,8 @@ function phpbb_delete_user_pms($user_id)
$db->sql_transaction('begin');
+ $phpbb_notifications = $phpbb_container->get('notification_manager');
+
if (!empty($undelivered_msg))
{
// A pm is delivered, if for any recipient the message was moved
@@ -1149,7 +1260,7 @@ function phpbb_delete_user_pms($user_id)
// received them.
$sql = 'SELECT msg_id
FROM ' . PRIVMSGS_TO_TABLE . '
- WHERE author_id = ' . $user_id . '
+ WHERE ' . $author_id_sql . '
AND folder_id <> ' . PRIVMSGS_NO_BOX . '
AND folder_id <> ' . PRIVMSGS_OUTBOX . '
AND folder_id <> ' . PRIVMSGS_SENTBOX;
@@ -1169,7 +1280,7 @@ function phpbb_delete_user_pms($user_id)
// Count the messages we delete, so we can correct the user pm data
$sql = 'SELECT user_id, COUNT(msg_id) as num_undelivered_privmsgs
FROM ' . PRIVMSGS_TO_TABLE . '
- WHERE author_id = ' . $user_id . '
+ WHERE ' . $author_id_sql . '
AND folder_id = ' . PRIVMSGS_NO_BOX . '
AND ' . $db->sql_in_set('msg_id', array_merge($undelivered_msg, $delivered_msg)) . '
GROUP BY user_id';
@@ -1209,6 +1320,8 @@ function phpbb_delete_user_pms($user_id)
WHERE folder_id = ' . PRIVMSGS_NO_BOX . '
AND ' . $db->sql_in_set('msg_id', $delivered_msg);
$db->sql_query($sql);
+
+ $phpbb_notifications->delete_notifications('notification.type.pm', $delivered_msg);
}
if (!empty($undelivered_msg))
@@ -1220,6 +1333,8 @@ function phpbb_delete_user_pms($user_id)
$sql = 'DELETE FROM ' . PRIVMSGS_TABLE . '
WHERE ' . $db->sql_in_set('msg_id', $undelivered_msg);
$db->sql_query($sql);
+
+ $phpbb_notifications->delete_notifications('notification.type.pm', $undelivered_msg);
}
}
@@ -1227,12 +1342,12 @@ function phpbb_delete_user_pms($user_id)
$sql = 'UPDATE ' . USERS_TABLE . '
SET user_new_privmsg = 0,
user_unread_privmsg = 0
- WHERE user_id = ' . $user_id;
+ WHERE ' . $user_id_sql;
$db->sql_query($sql);
// Delete private message data of the user
$sql = 'DELETE FROM ' . PRIVMSGS_TO_TABLE . '
- WHERE user_id = ' . (int) $user_id;
+ WHERE ' . $user_id_sql;
$db->sql_query($sql);
if (!empty($delete_ids))
@@ -1262,6 +1377,8 @@ function phpbb_delete_user_pms($user_id)
$sql = 'DELETE FROM ' . PRIVMSGS_TABLE . '
WHERE ' . $db->sql_in_set('msg_id', $delete_ids);
$db->sql_query($sql);
+
+ $phpbb_notifications->delete_notifications('notification.type.pm', $delete_ids);
}
}
@@ -1269,12 +1386,12 @@ function phpbb_delete_user_pms($user_id)
// This way users are still able to read messages from users being removed
$sql = 'UPDATE ' . PRIVMSGS_TO_TABLE . '
SET author_id = ' . ANONYMOUS . '
- WHERE author_id = ' . $user_id;
+ WHERE ' . $author_id_sql;
$db->sql_query($sql);
$sql = 'UPDATE ' . PRIVMSGS_TABLE . '
SET author_id = ' . ANONYMOUS . '
- WHERE author_id = ' . $user_id;
+ WHERE ' . $author_id_sql;
$db->sql_query($sql);
$db->sql_transaction('commit');
@@ -1305,9 +1422,9 @@ function rebuild_header($check_ary)
$_types = array('u', 'g');
foreach ($_types as $type)
{
- if (sizeof($$type))
+ if (sizeof(${$type}))
{
- foreach ($$type as $id)
+ foreach (${$type} as $id)
{
$address[$type][$id] = $check_type;
}
@@ -1481,10 +1598,10 @@ function get_folder_status($folder_id, $folder)
'cur' => $folder['num_messages'],
'remaining' => ($user->data['message_limit']) ? $user->data['message_limit'] - $folder['num_messages'] : 0,
'max' => $user->data['message_limit'],
- 'percent' => ($user->data['message_limit']) ? (($user->data['message_limit'] > 0) ? round(($folder['num_messages'] / $user->data['message_limit']) * 100) : 100) : 0,
+ 'percent' => ($user->data['message_limit']) ? (($user->data['message_limit'] > 0) ? floor(($folder['num_messages'] / $user->data['message_limit']) * 100) : 100) : 0,
);
- $return['message'] = sprintf($user->lang['FOLDER_STATUS_MSG'], $return['percent'], $return['cur'], $return['max']);
+ $return['message'] = $user->lang('FOLDER_STATUS_MSG', $user->lang('MESSAGES_COUNT', (int) $return['max']), (int) $return['cur'], $return['percent']);
return $return;
}
@@ -1498,7 +1615,7 @@ function get_folder_status($folder_id, $folder)
*/
function submit_pm($mode, $subject, &$data, $put_in_outbox = true)
{
- global $db, $auth, $config, $phpEx, $template, $user, $phpbb_root_path;
+ global $db, $auth, $config, $phpEx, $template, $user, $phpbb_root_path, $phpbb_container, $phpbb_dispatcher;
// We do not handle erasing pms here
if ($mode == 'delete')
@@ -1508,6 +1625,18 @@ function submit_pm($mode, $subject, &$data, $put_in_outbox = true)
$current_time = time();
+ /**
+ * Get all parts of the PM that are to be submited to the DB.
+ *
+ * @event core.submit_pm_before
+ * @var string mode PM Post mode - post|reply|quote|quotepost|forward|edit
+ * @var string subject Subject of the private message
+ * @var array data The whole row data of the PM.
+ * @since 3.1.0-b3
+ */
+ $vars = array('mode', 'subject', 'data');
+ extract($phpbb_dispatcher->trigger_event('core.submit_pm_before', compact($vars)));
+
// Collect some basic information about which tables and which rows to update/insert
$sql_data = array();
$root_level = 0;
@@ -1798,95 +1927,36 @@ function submit_pm($mode, $subject, &$data, $put_in_outbox = true)
$db->sql_transaction('commit');
// Send Notifications
- if ($mode != 'edit')
- {
- pm_notification($mode, $data['from_username'], $recipients, $subject, $data['message'], $data['msg_id']);
- }
-
- return $data['msg_id'];
-}
-
-/**
-* PM Notification
-*/
-function pm_notification($mode, $author, $recipients, $subject, $message, $msg_id)
-{
- global $db, $user, $config, $phpbb_root_path, $phpEx, $auth;
-
- $subject = censor_text($subject);
-
- // Exclude guests, current user and banned users from notifications
- unset($recipients[ANONYMOUS], $recipients[$user->data['user_id']]);
-
- if (!sizeof($recipients))
- {
- return;
- }
-
- if (!function_exists('phpbb_get_banned_user_ids'))
- {
- include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
- }
- $banned_users = phpbb_get_banned_user_ids(array_keys($recipients));
- $recipients = array_diff(array_keys($recipients), $banned_users);
-
- if (!sizeof($recipients))
- {
- return;
- }
+ $pm_data = array_merge($data, array(
+ 'message_subject' => $subject,
+ 'recipients' => $recipients,
+ ));
- $sql = 'SELECT user_id, username, user_email, user_lang, user_notify_pm, user_notify_type, user_jabber
- FROM ' . USERS_TABLE . '
- WHERE ' . $db->sql_in_set('user_id', $recipients);
- $result = $db->sql_query($sql);
+ $phpbb_notifications = $phpbb_container->get('notification_manager');
- $msg_list_ary = array();
- while ($row = $db->sql_fetchrow($result))
+ if ($mode == 'edit')
{
- if ($row['user_notify_pm'] == 1 && trim($row['user_email']))
- {
- $msg_list_ary[] = array(
- 'method' => $row['user_notify_type'],
- 'email' => $row['user_email'],
- 'jabber' => $row['user_jabber'],
- 'name' => $row['username'],
- 'lang' => $row['user_lang']
- );
- }
+ $phpbb_notifications->update_notifications('notification.type.pm', $pm_data);
}
- $db->sql_freeresult($result);
-
- if (!sizeof($msg_list_ary))
- {
- return;
- }
-
- include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);
- $messenger = new messenger();
-
- foreach ($msg_list_ary as $pos => $addr)
+ else
{
- $messenger->template('privmsg_notify', $addr['lang']);
-
- $messenger->to($addr['email'], $addr['name']);
- $messenger->im($addr['jabber'], $addr['name']);
-
- $messenger->assign_vars(array(
- 'SUBJECT' => htmlspecialchars_decode($subject),
- 'AUTHOR_NAME' => htmlspecialchars_decode($author),
- 'USERNAME' => htmlspecialchars_decode($addr['name']),
-
- 'U_INBOX' => generate_board_url() . "/ucp.$phpEx?i=pm&folder=inbox",
- 'U_VIEW_MESSAGE' => generate_board_url() . "/ucp.$phpEx?i=pm&mode=view&p=$msg_id",
- ));
-
- $messenger->send($addr['method']);
+ $phpbb_notifications->add_notifications('notification.type.pm', $pm_data);
}
- unset($msg_list_ary);
- $messenger->save_queue();
+ /**
+ * Get PM message ID after submission to DB
+ *
+ * @event core.submit_pm_after
+ * @var string mode PM Post mode - post|reply|quote|quotepost|forward|edit
+ * @var string subject Subject of the private message
+ * @var array data The whole row data of the PM.
+ * @var array pm_data The data sent to notification class
+ * @since 3.1.0-b5
+ */
+ $vars = array('mode', 'subject', 'data', 'pm_data');
+ extract($phpbb_dispatcher->trigger_event('core.submit_pm_after', compact($vars)));
- unset($messenger);
+ return $data['msg_id'];
}
/**
@@ -1894,7 +1964,7 @@ function pm_notification($mode, $author, $recipients, $subject, $message, $msg_i
*/
function message_history($msg_id, $user_id, $message_row, $folder, $in_post_mode = false)
{
- global $db, $user, $config, $template, $phpbb_root_path, $phpEx, $auth, $bbcode;
+ global $db, $user, $config, $template, $phpbb_root_path, $phpEx, $auth;
// Select all receipts and the author from the pm we currently view, to only display their pm-history
$sql = 'SELECT author_id, user_id
@@ -1946,7 +2016,6 @@ function message_history($msg_id, $user_id, $message_row, $folder, $in_post_mode
$title = $row['message_subject'];
$rowset = array();
- $bbcode_bitfield = '';
$folder_url = append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm') . '&amp;folder=';
do
@@ -1962,7 +2031,6 @@ function message_history($msg_id, $user_id, $message_row, $folder, $in_post_mode
else
{
$rowset[$row['msg_id']] = $row;
- $bbcode_bitfield = $bbcode_bitfield | base64_decode($row['bbcode_bitfield']);
}
}
while ($row = $db->sql_fetchrow($result));
@@ -1973,16 +2041,6 @@ function message_history($msg_id, $user_id, $message_row, $folder, $in_post_mode
return false;
}
- // Instantiate BBCode class
- if ((empty($bbcode) || $bbcode === false) && $bbcode_bitfield !== '')
- {
- if (!class_exists('bbcode'))
- {
- include($phpbb_root_path . 'includes/bbcode.' . $phpEx);
- }
- $bbcode = new bbcode(base64_encode($bbcode_bitfield));
- }
-
$title = censor_text($title);
$url = append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm');
@@ -2014,13 +2072,10 @@ function message_history($msg_id, $user_id, $message_row, $folder, $in_post_mode
$decoded_message = bbcode_nl2br($decoded_message);
}
- if ($row['bbcode_bitfield'])
- {
- $bbcode->bbcode_second_pass($message, $row['bbcode_uid'], $row['bbcode_bitfield']);
- }
+ $parse_flags = ($row['bbcode_bitfield'] ? OPTION_FLAG_BBCODE : 0);
+ $parse_flags |= ($row['enable_smilies'] ? OPTION_FLAG_SMILIES : 0);
- $message = bbcode_nl2br($message);
- $message = smiley_text($message, !$row['enable_smilies']);
+ $message = generate_text_for_display($message, $row['bbcode_uid'], $row['bbcode_bitfield'], $parse_flags, false);
$subject = censor_text($subject);
@@ -2040,7 +2095,7 @@ function message_history($msg_id, $user_id, $message_row, $folder, $in_post_mode
'SUBJECT' => $subject,
'SENT_DATE' => $user->format_date($row['message_time']),
'MESSAGE' => $message,
- 'FOLDER' => implode(', ', $row['folder']),
+ 'FOLDER' => implode($user->lang['COMMA_SEPARATOR'], $row['folder']),
'DECODED_MESSAGE' => $decoded_message,
'S_CURRENT_MSG' => ($row['msg_id'] == $msg_id),
@@ -2176,5 +2231,3 @@ function get_recipient_strings($pm_by_id)
return $address_list;
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/functions_profile_fields.php b/phpBB/includes/functions_profile_fields.php
deleted file mode 100644
index a2c0656ca4..0000000000
--- a/phpBB/includes/functions_profile_fields.php
+++ /dev/null
@@ -1,1185 +0,0 @@
-<?php
-/**
-*
-* @package phpBB3
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
-*
-*/
-
-/**
-* @ignore
-*/
-if (!defined('IN_PHPBB'))
-{
- exit;
-}
-
-/**
-* Custom Profile Fields
-* @package phpBB3
-*/
-class custom_profile
-{
- var $profile_types = array(FIELD_INT => 'int', FIELD_STRING => 'string', FIELD_TEXT => 'text', FIELD_BOOL => 'bool', FIELD_DROPDOWN => 'dropdown', FIELD_DATE => 'date');
- var $profile_cache = array();
- var $options_lang = array();
-
- /**
- * Assign editable fields to template, mode can be profile (for profile change) or register (for registration)
- * Called by ucp_profile and ucp_register
- * @access public
- */
- function generate_profile_fields($mode, $lang_id)
- {
- global $db, $template, $auth;
-
- $sql_where = '';
- switch ($mode)
- {
- case 'register':
- // If the field is required we show it on the registration page
- $sql_where .= ' AND f.field_show_on_reg = 1';
- break;
-
- case 'profile':
- // Show hidden fields to moderators/admins
- if (!$auth->acl_gets('a_', 'm_') && !$auth->acl_getf_global('m_'))
- {
- $sql_where .= ' AND f.field_show_profile = 1';
- }
- break;
-
- default:
- trigger_error('Wrong profile mode specified', E_USER_ERROR);
- break;
- }
-
- $sql = 'SELECT l.*, f.*
- FROM ' . PROFILE_LANG_TABLE . ' l, ' . PROFILE_FIELDS_TABLE . " f
- WHERE f.field_active = 1
- $sql_where
- AND l.lang_id = $lang_id
- AND l.field_id = f.field_id
- ORDER BY f.field_order";
- $result = $db->sql_query($sql);
-
- while ($row = $db->sql_fetchrow($result))
- {
- // Return templated field
- $tpl_snippet = $this->process_field_row('change', $row);
-
- // Some types are multivalue, we can't give them a field_id as we would not know which to pick
- $type = (int) $row['field_type'];
-
- $template->assign_block_vars('profile_fields', array(
- 'LANG_NAME' => $row['lang_name'],
- 'LANG_EXPLAIN' => $row['lang_explain'],
- 'FIELD' => $tpl_snippet,
- 'FIELD_ID' => ($type == FIELD_DATE || ($type == FIELD_BOOL && $row['field_length'] == '1')) ? '' : 'pf_' . $row['field_ident'],
- 'S_REQUIRED' => ($row['field_required']) ? true : false)
- );
- }
- $db->sql_freeresult($result);
- }
-
- /**
- * Validate entered profile field data
- * @access public
- */
- function validate_profile_field($field_type, &$field_value, $field_data)
- {
- switch ($field_type)
- {
- case FIELD_DATE:
- $field_validate = explode('-', $field_value);
-
- $day = (isset($field_validate[0])) ? (int) $field_validate[0] : 0;
- $month = (isset($field_validate[1])) ? (int) $field_validate[1] : 0;
- $year = (isset($field_validate[2])) ? (int) $field_validate[2] : 0;
-
- if ((!$day || !$month || !$year) && !$field_data['field_required'])
- {
- return false;
- }
-
- if ((!$day || !$month || !$year) && $field_data['field_required'])
- {
- return 'FIELD_REQUIRED';
- }
-
- if ($day < 0 || $day > 31 || $month < 0 || $month > 12 || ($year < 1901 && $year > 0) || $year > gmdate('Y', time()) + 50)
- {
- return 'FIELD_INVALID_DATE';
- }
-
- if (checkdate($month, $day, $year) === false)
- {
- return 'FIELD_INVALID_DATE';
- }
- break;
-
- case FIELD_BOOL:
- $field_value = (bool) $field_value;
-
- if (!$field_value && $field_data['field_required'])
- {
- return 'FIELD_REQUIRED';
- }
- break;
-
- case FIELD_INT:
- if (trim($field_value) === '' && !$field_data['field_required'])
- {
- return false;
- }
-
- $field_value = (int) $field_value;
-
- if ($field_value < $field_data['field_minlen'])
- {
- return 'FIELD_TOO_SMALL';
- }
- else if ($field_value > $field_data['field_maxlen'])
- {
- return 'FIELD_TOO_LARGE';
- }
- break;
-
- case FIELD_DROPDOWN:
- $field_value = (int) $field_value;
-
- // retrieve option lang data if necessary
- if (!isset($this->options_lang[$field_data['field_id']]) || !isset($this->options_lang[$field_data['field_id']][$field_data['lang_id']]) || !sizeof($this->options_lang[$file_data['field_id']][$field_data['lang_id']]))
- {
- $this->get_option_lang($field_data['field_id'], $field_data['lang_id'], FIELD_DROPDOWN, false);
- }
-
- if (!isset($this->options_lang[$field_data['field_id']][$field_data['lang_id']][$field_value]))
- {
- return 'FIELD_INVALID_VALUE';
- }
-
- if ($field_value == $field_data['field_novalue'] && $field_data['field_required'])
- {
- return 'FIELD_REQUIRED';
- }
- break;
-
- case FIELD_STRING:
- case FIELD_TEXT:
- if (trim($field_value) === '' && !$field_data['field_required'])
- {
- return false;
- }
- else if (trim($field_value) === '' && $field_data['field_required'])
- {
- return 'FIELD_REQUIRED';
- }
-
- if ($field_data['field_minlen'] && utf8_strlen($field_value) < $field_data['field_minlen'])
- {
- return 'FIELD_TOO_SHORT';
- }
- else if ($field_data['field_maxlen'] && utf8_strlen($field_value) > $field_data['field_maxlen'])
- {
- return 'FIELD_TOO_LONG';
- }
-
- if (!empty($field_data['field_validation']) && $field_data['field_validation'] != '.*')
- {
- $field_validate = ($field_type == FIELD_STRING) ? $field_value : bbcode_nl2br($field_value);
- if (!preg_match('#^' . str_replace('\\\\', '\\', $field_data['field_validation']) . '$#i', $field_validate))
- {
- return 'FIELD_INVALID_CHARS';
- }
- }
- break;
- }
-
- return false;
- }
-
- /**
- * Build profile cache, used for display
- * @access private
- */
- function build_cache()
- {
- global $db, $user, $auth;
-
- $this->profile_cache = array();
-
- // Display hidden/no_view fields for admin/moderator
- $sql = 'SELECT l.*, f.*
- FROM ' . PROFILE_LANG_TABLE . ' l, ' . PROFILE_FIELDS_TABLE . ' f
- WHERE l.lang_id = ' . $user->get_iso_lang_id() . '
- AND f.field_active = 1 ' .
- ((!$auth->acl_gets('a_', 'm_') && !$auth->acl_getf_global('m_')) ? ' AND f.field_hide = 0 ' : '') . '
- AND f.field_no_view = 0
- AND l.field_id = f.field_id
- ORDER BY f.field_order';
- $result = $db->sql_query($sql);
-
- while ($row = $db->sql_fetchrow($result))
- {
- $this->profile_cache[$row['field_ident']] = $row;
- }
- $db->sql_freeresult($result);
- }
-
- /**
- * Get language entries for options and store them here for later use
- */
- function get_option_lang($field_id, $lang_id, $field_type, $preview)
- {
- global $db;
-
- if ($preview)
- {
- $lang_options = (!is_array($this->vars['lang_options'])) ? explode("\n", $this->vars['lang_options']) : $this->vars['lang_options'];
-
- foreach ($lang_options as $num => $var)
- {
- $this->options_lang[$field_id][$lang_id][($num + 1)] = $var;
- }
- }
- else
- {
- $sql = 'SELECT option_id, lang_value
- FROM ' . PROFILE_FIELDS_LANG_TABLE . "
- WHERE field_id = $field_id
- AND lang_id = $lang_id
- AND field_type = $field_type
- ORDER BY option_id";
- $result = $db->sql_query($sql);
-
- while ($row = $db->sql_fetchrow($result))
- {
- $this->options_lang[$field_id][$lang_id][($row['option_id'] + 1)] = $row['lang_value'];
- }
- $db->sql_freeresult($result);
- }
- }
-
- /**
- * Submit profile field for validation
- * @access public
- */
- function submit_cp_field($mode, $lang_id, &$cp_data, &$cp_error)
- {
- global $auth, $db, $user;
-
- $sql_where = '';
- switch ($mode)
- {
- case 'register':
- // If the field is required we show it on the registration page
- $sql_where .= ' AND f.field_show_on_reg = 1';
- break;
-
- case 'profile':
- // Show hidden fields to moderators/admins
- if (!$auth->acl_gets('a_', 'm_') && !$auth->acl_getf_global('m_'))
- {
- $sql_where .= ' AND f.field_show_profile = 1';
- }
- break;
-
- default:
- trigger_error('Wrong profile mode specified', E_USER_ERROR);
- break;
- }
-
- $sql = 'SELECT l.*, f.*
- FROM ' . PROFILE_LANG_TABLE . ' l, ' . PROFILE_FIELDS_TABLE . " f
- WHERE l.lang_id = $lang_id
- AND f.field_active = 1
- $sql_where
- AND l.field_id = f.field_id
- ORDER BY f.field_order";
- $result = $db->sql_query($sql);
-
- while ($row = $db->sql_fetchrow($result))
- {
- $cp_data['pf_' . $row['field_ident']] = $this->get_profile_field($row);
- $check_value = $cp_data['pf_' . $row['field_ident']];
-
- if (($cp_result = $this->validate_profile_field($row['field_type'], $check_value, $row)) !== false)
- {
- // If not and only showing common error messages, use this one
- $error = '';
- switch ($cp_result)
- {
- case 'FIELD_INVALID_DATE':
- case 'FIELD_INVALID_VALUE':
- case 'FIELD_REQUIRED':
- $error = sprintf($user->lang[$cp_result], $row['lang_name']);
- break;
-
- case 'FIELD_TOO_SHORT':
- case 'FIELD_TOO_SMALL':
- $error = sprintf($user->lang[$cp_result], $row['lang_name'], $row['field_minlen']);
- break;
-
- case 'FIELD_TOO_LONG':
- case 'FIELD_TOO_LARGE':
- $error = sprintf($user->lang[$cp_result], $row['lang_name'], $row['field_maxlen']);
- break;
-
- case 'FIELD_INVALID_CHARS':
- switch ($row['field_validation'])
- {
- case '[0-9]+':
- $error = sprintf($user->lang[$cp_result . '_NUMBERS_ONLY'], $row['lang_name']);
- break;
-
- case '[\w]+':
- $error = sprintf($user->lang[$cp_result . '_ALPHA_ONLY'], $row['lang_name']);
- break;
-
- case '[\w_\+\. \-\[\]]+':
- $error = sprintf($user->lang[$cp_result . '_SPACERS_ONLY'], $row['lang_name']);
- break;
- }
- break;
- }
-
- if ($error != '')
- {
- $cp_error[] = $error;
- }
- }
- }
- $db->sql_freeresult($result);
- }
-
- /**
- * Update profile field data directly
- */
- function update_profile_field_data($user_id, &$cp_data)
- {
- global $db;
-
- if (!sizeof($cp_data))
- {
- return;
- }
-
- switch ($db->sql_layer)
- {
- case 'oracle':
- case 'firebird':
- case 'postgres':
- $right_delim = $left_delim = '"';
- break;
-
- case 'sqlite':
- case 'mssql':
- case 'mssql_odbc':
- case 'mssqlnative':
- $right_delim = ']';
- $left_delim = '[';
- break;
-
- case 'mysql':
- case 'mysql4':
- case 'mysqli':
- $right_delim = $left_delim = '`';
- break;
- }
-
- // use new array for the UPDATE; changes in the key do not affect the original array
- $cp_data_sql = array();
- foreach ($cp_data as $key => $value)
- {
- // Firebird is case sensitive with delimiter
- $cp_data_sql[$left_delim . (($db->sql_layer == 'firebird' || $db->sql_layer == 'oracle') ? strtoupper($key) : $key) . $right_delim] = $value;
- }
-
- $sql = 'UPDATE ' . PROFILE_FIELDS_DATA_TABLE . '
- SET ' . $db->sql_build_array('UPDATE', $cp_data_sql) . "
- WHERE user_id = $user_id";
- $db->sql_query($sql);
-
- if (!$db->sql_affectedrows())
- {
- $cp_data_sql['user_id'] = (int) $user_id;
-
- $db->sql_return_on_error(true);
-
- $sql = 'INSERT INTO ' . PROFILE_FIELDS_DATA_TABLE . ' ' . $db->sql_build_array('INSERT', $cp_data_sql);
- $db->sql_query($sql);
-
- $db->sql_return_on_error(false);
- }
- }
-
- /**
- * Assign fields to template, used for viewprofile, viewtopic and memberlist (if load setting is enabled)
- * This is directly connected to the user -> mode == grab is to grab the user specific fields, mode == show is for assigning the row to the template
- * @access public
- */
- function generate_profile_fields_template($mode, $user_id = 0, $profile_row = false)
- {
- global $db;
-
- if ($mode == 'grab')
- {
- if (!is_array($user_id))
- {
- $user_id = array($user_id);
- }
-
- if (!sizeof($this->profile_cache))
- {
- $this->build_cache();
- }
-
- if (!sizeof($user_id))
- {
- return array();
- }
-
- $sql = 'SELECT *
- FROM ' . PROFILE_FIELDS_DATA_TABLE . '
- WHERE ' . $db->sql_in_set('user_id', array_map('intval', $user_id));
- $result = $db->sql_query($sql);
-
- $field_data = array();
- while ($row = $db->sql_fetchrow($result))
- {
- $field_data[$row['user_id']] = $row;
- }
- $db->sql_freeresult($result);
-
- $user_fields = array();
-
- $user_ids = $user_id;
-
- // Go through the fields in correct order
- foreach (array_keys($this->profile_cache) as $used_ident)
- {
- foreach ($field_data as $user_id => $row)
- {
- $user_fields[$user_id][$used_ident]['value'] = $row['pf_' . $used_ident];
- $user_fields[$user_id][$used_ident]['data'] = $this->profile_cache[$used_ident];
- }
-
- foreach ($user_ids as $user_id)
- {
- if (!isset($user_fields[$user_id][$used_ident]) && $this->profile_cache[$used_ident]['field_show_novalue'])
- {
- $user_fields[$user_id][$used_ident]['value'] = '';
- $user_fields[$user_id][$used_ident]['data'] = $this->profile_cache[$used_ident];
- }
- }
- }
-
- return $user_fields;
- }
- else if ($mode == 'show')
- {
- // $profile_row == $user_fields[$row['user_id']];
- $tpl_fields = array();
- $tpl_fields['row'] = $tpl_fields['blockrow'] = array();
-
- foreach ($profile_row as $ident => $ident_ary)
- {
- $value = $this->get_profile_value($ident_ary);
-
- if ($value === NULL)
- {
- continue;
- }
-
- $tpl_fields['row'] += array(
- 'PROFILE_' . strtoupper($ident) . '_VALUE' => $value,
- 'PROFILE_' . strtoupper($ident) . '_TYPE' => $ident_ary['data']['field_type'],
- 'PROFILE_' . strtoupper($ident) . '_NAME' => $ident_ary['data']['lang_name'],
- 'PROFILE_' . strtoupper($ident) . '_EXPLAIN'=> $ident_ary['data']['lang_explain'],
-
- 'S_PROFILE_' . strtoupper($ident) => true
- );
-
- $tpl_fields['blockrow'][] = array(
- 'PROFILE_FIELD_VALUE' => $value,
- 'PROFILE_FIELD_TYPE' => $ident_ary['data']['field_type'],
- 'PROFILE_FIELD_NAME' => $ident_ary['data']['lang_name'],
- 'PROFILE_FIELD_EXPLAIN' => $ident_ary['data']['lang_explain'],
-
- 'S_PROFILE_' . strtoupper($ident) => true
- );
- }
-
- return $tpl_fields;
- }
- else
- {
- trigger_error('Wrong mode for custom profile', E_USER_ERROR);
- }
- }
-
- /**
- * Get Profile Value for display
- */
- function get_profile_value($ident_ary)
- {
- $value = $ident_ary['value'];
- $field_type = $ident_ary['data']['field_type'];
-
- switch ($this->profile_types[$field_type])
- {
- case 'int':
- if (($value === '' || $value === null) && !$ident_ary['data']['field_show_novalue'])
- {
- return NULL;
- }
- return (int) $value;
- break;
-
- case 'string':
- case 'text':
- if (!$value && !$ident_ary['data']['field_show_novalue'])
- {
- return NULL;
- }
-
- $value = make_clickable($value);
- $value = censor_text($value);
- $value = bbcode_nl2br($value);
- return $value;
- break;
-
- // case 'datetime':
- case 'date':
- $date = explode('-', $value);
- $day = (isset($date[0])) ? (int) $date[0] : 0;
- $month = (isset($date[1])) ? (int) $date[1] : 0;
- $year = (isset($date[2])) ? (int) $date[2] : 0;
-
- if (!$day && !$month && !$year && !$ident_ary['data']['field_show_novalue'])
- {
- return NULL;
- }
- else if ($day && $month && $year)
- {
- global $user;
- // Date should display as the same date for every user regardless of timezone, so remove offset
- // to compensate for the offset added by user::format_date()
- return $user->format_date(gmmktime(0, 0, 0, $month, $day, $year) - ($user->timezone + $user->dst), $user->lang['DATE_FORMAT'], true);
- }
-
- return $value;
- break;
-
- case 'dropdown':
- $field_id = $ident_ary['data']['field_id'];
- $lang_id = $ident_ary['data']['lang_id'];
- if (!isset($this->options_lang[$field_id][$lang_id]))
- {
- $this->get_option_lang($field_id, $lang_id, FIELD_DROPDOWN, false);
- }
-
- if ($value == $ident_ary['data']['field_novalue'] && !$ident_ary['data']['field_show_novalue'])
- {
- return NULL;
- }
-
- $value = (int) $value;
-
- // User not having a value assigned
- if (!isset($this->options_lang[$field_id][$lang_id][$value]))
- {
- if ($ident_ary['data']['field_show_novalue'])
- {
- $value = $ident_ary['data']['field_novalue'];
- }
- else
- {
- return NULL;
- }
- }
-
- return $this->options_lang[$field_id][$lang_id][$value];
- break;
-
- case 'bool':
- $field_id = $ident_ary['data']['field_id'];
- $lang_id = $ident_ary['data']['lang_id'];
- if (!isset($this->options_lang[$field_id][$lang_id]))
- {
- $this->get_option_lang($field_id, $lang_id, FIELD_BOOL, false);
- }
-
- if (!$value && $ident_ary['data']['field_show_novalue'])
- {
- $value = $ident_ary['data']['field_default_value'];
- }
-
- if ($ident_ary['data']['field_length'] == 1)
- {
- return (isset($this->options_lang[$field_id][$lang_id][(int) $value])) ? $this->options_lang[$field_id][$lang_id][(int) $value] : NULL;
- }
- else if (!$value)
- {
- return NULL;
- }
- else
- {
- return $this->options_lang[$field_id][$lang_id][(int) ($value) + 1];
- }
- break;
-
- default:
- trigger_error('Unknown profile type', E_USER_ERROR);
- break;
- }
- }
-
- /**
- * Get field value for registration/profile
- * @access private
- */
- function get_var($field_validation, &$profile_row, $default_value, $preview)
- {
- global $user;
-
- $profile_row['field_ident'] = (isset($profile_row['var_name'])) ? $profile_row['var_name'] : 'pf_' . $profile_row['field_ident'];
- $user_ident = $profile_row['field_ident'];
- // checkbox - set the value to "true" if it has been set to 1
- if ($profile_row['field_type'] == FIELD_BOOL && $profile_row['field_length'] == 2)
- {
- $value = (isset($_REQUEST[$profile_row['field_ident']]) && request_var($profile_row['field_ident'], $default_value) == 1) ? true : ((!isset($user->profile_fields[$user_ident]) || $preview) ? $default_value : $user->profile_fields[$user_ident]);
- }
- else if ($profile_row['field_type'] == FIELD_INT)
- {
- if (isset($_REQUEST[$profile_row['field_ident']]))
- {
- $value = ($_REQUEST[$profile_row['field_ident']] === '') ? NULL : request_var($profile_row['field_ident'], $default_value);
- }
- else
- {
- if (!$preview && array_key_exists($user_ident, $user->profile_fields) && is_null($user->profile_fields[$user_ident]))
- {
- $value = NULL;
- }
- else if (!isset($user->profile_fields[$user_ident]) || $preview)
- {
- $value = $default_value;
- }
- else
- {
- $value = $user->profile_fields[$user_ident];
- }
- }
-
- return (is_null($value) || $value === '') ? '' : (int) $value;
- }
- else
- {
- $value = (isset($_REQUEST[$profile_row['field_ident']])) ? request_var($profile_row['field_ident'], $default_value, true) : ((!isset($user->profile_fields[$user_ident]) || $preview) ? $default_value : $user->profile_fields[$user_ident]);
-
- if (gettype($value) == 'string')
- {
- $value = utf8_normalize_nfc($value);
- }
- }
-
- switch ($field_validation)
- {
- case 'int':
- return (int) $value;
- break;
- }
-
- return $value;
- }
-
- /**
- * Process int-type
- * @access private
- */
- function generate_int($profile_row, $preview = false)
- {
- global $template;
-
- $profile_row['field_value'] = $this->get_var('int', $profile_row, $profile_row['field_default_value'], $preview);
- $template->assign_block_vars($this->profile_types[$profile_row['field_type']], array_change_key_case($profile_row, CASE_UPPER));
- }
-
- /**
- * Process date-type
- * @access private
- */
- function generate_date($profile_row, $preview = false)
- {
- global $user, $template;
-
- $profile_row['field_ident'] = (isset($profile_row['var_name'])) ? $profile_row['var_name'] : 'pf_' . $profile_row['field_ident'];
- $user_ident = $profile_row['field_ident'];
-
- $now = getdate();
-
- if (!isset($_REQUEST[$profile_row['field_ident'] . '_day']))
- {
- if ($profile_row['field_default_value'] == 'now')
- {
- $profile_row['field_default_value'] = sprintf('%2d-%2d-%4d', $now['mday'], $now['mon'], $now['year']);
- }
- list($day, $month, $year) = explode('-', ((!isset($user->profile_fields[$user_ident]) || $preview) ? $profile_row['field_default_value'] : $user->profile_fields[$user_ident]));
- }
- else
- {
- if ($preview && $profile_row['field_default_value'] == 'now')
- {
- $profile_row['field_default_value'] = sprintf('%2d-%2d-%4d', $now['mday'], $now['mon'], $now['year']);
- list($day, $month, $year) = explode('-', ((!isset($user->profile_fields[$user_ident]) || $preview) ? $profile_row['field_default_value'] : $user->profile_fields[$user_ident]));
- }
- else
- {
- $day = request_var($profile_row['field_ident'] . '_day', 0);
- $month = request_var($profile_row['field_ident'] . '_month', 0);
- $year = request_var($profile_row['field_ident'] . '_year', 0);
- }
- }
-
- $profile_row['s_day_options'] = '<option value="0"' . ((!$day) ? ' selected="selected"' : '') . '>--</option>';
- for ($i = 1; $i < 32; $i++)
- {
- $profile_row['s_day_options'] .= '<option value="' . $i . '"' . (($i == $day) ? ' selected="selected"' : '') . ">$i</option>";
- }
-
- $profile_row['s_month_options'] = '<option value="0"' . ((!$month) ? ' selected="selected"' : '') . '>--</option>';
- for ($i = 1; $i < 13; $i++)
- {
- $profile_row['s_month_options'] .= '<option value="' . $i . '"' . (($i == $month) ? ' selected="selected"' : '') . ">$i</option>";
- }
-
- $profile_row['s_year_options'] = '<option value="0"' . ((!$year) ? ' selected="selected"' : '') . '>--</option>';
- for ($i = $now['year'] - 100; $i <= $now['year'] + 100; $i++)
- {
- $profile_row['s_year_options'] .= '<option value="' . $i . '"' . (($i == $year) ? ' selected="selected"' : '') . ">$i</option>";
- }
- unset($now);
-
- $profile_row['field_value'] = 0;
- $template->assign_block_vars($this->profile_types[$profile_row['field_type']], array_change_key_case($profile_row, CASE_UPPER));
- }
-
- /**
- * Process bool-type
- * @access private
- */
- function generate_bool($profile_row, $preview = false)
- {
- global $template;
-
- $value = $this->get_var('int', $profile_row, $profile_row['field_default_value'], $preview);
-
- $profile_row['field_value'] = $value;
- $template->assign_block_vars($this->profile_types[$profile_row['field_type']], array_change_key_case($profile_row, CASE_UPPER));
-
- if ($profile_row['field_length'] == 1)
- {
- if (!isset($this->options_lang[$profile_row['field_id']][$profile_row['lang_id']]) || !sizeof($this->options_lang[$profile_row['field_id']][$profile_row['lang_id']]))
- {
- $this->get_option_lang($profile_row['field_id'], $profile_row['lang_id'], FIELD_BOOL, $preview);
- }
-
- foreach ($this->options_lang[$profile_row['field_id']][$profile_row['lang_id']] as $option_id => $option_value)
- {
- $template->assign_block_vars('bool.options', array(
- 'OPTION_ID' => $option_id,
- 'CHECKED' => ($value == $option_id) ? ' checked="checked"' : '',
- 'VALUE' => $option_value)
- );
- }
- }
- }
-
- /**
- * Process string-type
- * @access private
- */
- function generate_string($profile_row, $preview = false)
- {
- global $template;
-
- $profile_row['field_value'] = $this->get_var('string', $profile_row, $profile_row['lang_default_value'], $preview);
- $template->assign_block_vars($this->profile_types[$profile_row['field_type']], array_change_key_case($profile_row, CASE_UPPER));
- }
-
- /**
- * Process text-type
- * @access private
- */
- function generate_text($profile_row, $preview = false)
- {
- global $template;
- global $user, $phpEx, $phpbb_root_path;
-
- $field_length = explode('|', $profile_row['field_length']);
- $profile_row['field_rows'] = $field_length[0];
- $profile_row['field_cols'] = $field_length[1];
-
- $profile_row['field_value'] = $this->get_var('string', $profile_row, $profile_row['lang_default_value'], $preview);
- $template->assign_block_vars($this->profile_types[$profile_row['field_type']], array_change_key_case($profile_row, CASE_UPPER));
- }
-
- /**
- * Process dropdown-type
- * @access private
- */
- function generate_dropdown($profile_row, $preview = false)
- {
- global $user, $template;
-
- $value = $this->get_var('int', $profile_row, $profile_row['field_default_value'], $preview);
-
- if (!isset($this->options_lang[$profile_row['field_id']]) || !isset($this->options_lang[$profile_row['field_id']][$profile_row['lang_id']]) || !sizeof($this->options_lang[$profile_row['field_id']][$profile_row['lang_id']]))
- {
- $this->get_option_lang($profile_row['field_id'], $profile_row['lang_id'], FIELD_DROPDOWN, $preview);
- }
-
- $profile_row['field_value'] = $value;
- $template->assign_block_vars($this->profile_types[$profile_row['field_type']], array_change_key_case($profile_row, CASE_UPPER));
-
- foreach ($this->options_lang[$profile_row['field_id']][$profile_row['lang_id']] as $option_id => $option_value)
- {
- $template->assign_block_vars('dropdown.options', array(
- 'OPTION_ID' => $option_id,
- 'SELECTED' => ($value == $option_id) ? ' selected="selected"' : '',
- 'VALUE' => $option_value)
- );
- }
- }
-
- /**
- * Return Templated value/field. Possible values for $mode are:
- * change == user is able to set/enter profile values; preview == just show the value
- * @access private
- */
- function process_field_row($mode, $profile_row)
- {
- global $template;
-
- $preview = ($mode == 'preview') ? true : false;
-
- // set template filename
- $template->set_filenames(array(
- 'cp_body' => 'custom_profile_fields.html')
- );
-
- // empty previously filled blockvars
- foreach ($this->profile_types as $field_case => $field_type)
- {
- $template->destroy_block_vars($field_type);
- }
-
- // Assign template variables
- $type_func = 'generate_' . $this->profile_types[$profile_row['field_type']];
- $this->$type_func($profile_row, $preview);
-
- // Return templated data
- return $template->assign_display('cp_body');
- }
-
- /**
- * Build Array for user insertion into custom profile fields table
- */
- function build_insert_sql_array($cp_data)
- {
- global $db, $user, $auth;
-
- $sql_not_in = array();
- foreach ($cp_data as $key => $null)
- {
- $sql_not_in[] = (strncmp($key, 'pf_', 3) === 0) ? substr($key, 3) : $key;
- }
-
- $sql = 'SELECT f.field_type, f.field_ident, f.field_default_value, l.lang_default_value
- FROM ' . PROFILE_LANG_TABLE . ' l, ' . PROFILE_FIELDS_TABLE . ' f
- WHERE l.lang_id = ' . $user->get_iso_lang_id() . '
- ' . ((sizeof($sql_not_in)) ? ' AND ' . $db->sql_in_set('f.field_ident', $sql_not_in, true) : '') . '
- AND l.field_id = f.field_id';
- $result = $db->sql_query($sql);
-
- while ($row = $db->sql_fetchrow($result))
- {
- if ($row['field_default_value'] == 'now' && $row['field_type'] == FIELD_DATE)
- {
- $now = getdate();
- $row['field_default_value'] = sprintf('%2d-%2d-%4d', $now['mday'], $now['mon'], $now['year']);
- }
- else if ($row['field_default_value'] === '' && $row['field_type'] == FIELD_INT)
- {
- // We cannot insert an empty string into an integer column.
- $row['field_default_value'] = NULL;
- }
-
- $cp_data['pf_' . $row['field_ident']] = (in_array($row['field_type'], array(FIELD_TEXT, FIELD_STRING))) ? $row['lang_default_value'] : $row['field_default_value'];
- }
- $db->sql_freeresult($result);
-
- return $cp_data;
- }
-
- /**
- * Get profile field value on submit
- * @access private
- */
- function get_profile_field($profile_row)
- {
- global $phpbb_root_path, $phpEx;
- global $config;
-
- $var_name = 'pf_' . $profile_row['field_ident'];
-
- switch ($profile_row['field_type'])
- {
- case FIELD_DATE:
-
- if (!isset($_REQUEST[$var_name . '_day']))
- {
- if ($profile_row['field_default_value'] == 'now')
- {
- $now = getdate();
- $profile_row['field_default_value'] = sprintf('%2d-%2d-%4d', $now['mday'], $now['mon'], $now['year']);
- }
- list($day, $month, $year) = explode('-', $profile_row['field_default_value']);
- }
- else
- {
- $day = request_var($var_name . '_day', 0);
- $month = request_var($var_name . '_month', 0);
- $year = request_var($var_name . '_year', 0);
- }
-
- $var = sprintf('%2d-%2d-%4d', $day, $month, $year);
- break;
-
- case FIELD_BOOL:
- // Checkbox
- if ($profile_row['field_length'] == 2)
- {
- $var = (isset($_REQUEST[$var_name])) ? 1 : 0;
- }
- else
- {
- $var = request_var($var_name, (int) $profile_row['field_default_value']);
- }
- break;
-
- case FIELD_STRING:
- case FIELD_TEXT:
- $var = utf8_normalize_nfc(request_var($var_name, (string) $profile_row['field_default_value'], true));
- break;
-
- case FIELD_INT:
- if (isset($_REQUEST[$var_name]) && $_REQUEST[$var_name] === '')
- {
- $var = NULL;
- }
- else
- {
- $var = request_var($var_name, (int) $profile_row['field_default_value']);
- }
- break;
-
- case FIELD_DROPDOWN:
- $var = request_var($var_name, (int) $profile_row['field_default_value']);
- break;
-
- default:
- $var = request_var($var_name, $profile_row['field_default_value']);
- break;
- }
-
- return $var;
- }
-}
-
-/**
-* Custom Profile Fields ACP
-* @package phpBB3
-*/
-class custom_profile_admin extends custom_profile
-{
- var $vars = array();
-
- /**
- * Return possible validation options
- */
- function validate_options()
- {
- global $user;
-
- $validate_ary = array('CHARS_ANY' => '.*', 'NUMBERS_ONLY' => '[0-9]+', 'ALPHA_ONLY' => '[\w]+', 'ALPHA_SPACERS' => '[\w_\+\. \-\[\]]+');
-
- $validate_options = '';
- foreach ($validate_ary as $lang => $value)
- {
- $selected = ($this->vars['field_validation'] == $value) ? ' selected="selected"' : '';
- $validate_options .= '<option value="' . $value . '"' . $selected . '>' . $user->lang[$lang] . '</option>';
- }
-
- return $validate_options;
- }
-
- /**
- * Get string options for second step in ACP
- */
- function get_string_options()
- {
- global $user;
-
- $options = array(
- 0 => array('TITLE' => $user->lang['FIELD_LENGTH'], 'FIELD' => '<input type="text" name="field_length" size="5" value="' . $this->vars['field_length'] . '" />'),
- 1 => array('TITLE' => $user->lang['MIN_FIELD_CHARS'], 'FIELD' => '<input type="text" name="field_minlen" size="5" value="' . $this->vars['field_minlen'] . '" />'),
- 2 => array('TITLE' => $user->lang['MAX_FIELD_CHARS'], 'FIELD' => '<input type="text" name="field_maxlen" size="5" value="' . $this->vars['field_maxlen'] . '" />'),
- 3 => array('TITLE' => $user->lang['FIELD_VALIDATION'], 'FIELD' => '<select name="field_validation">' . $this->validate_options() . '</select>')
- );
-
- return $options;
- }
-
- /**
- * Get text options for second step in ACP
- */
- function get_text_options()
- {
- global $user;
-
- $options = array(
- 0 => array('TITLE' => $user->lang['FIELD_LENGTH'], 'FIELD' => '<input name="rows" size="5" value="' . $this->vars['rows'] . '" /> ' . $user->lang['ROWS'] . '</dd><dd><input name="columns" size="5" value="' . $this->vars['columns'] . '" /> ' . $user->lang['COLUMNS'] . ' <input type="hidden" name="field_length" value="' . $this->vars['field_length'] . '" />'),
- 1 => array('TITLE' => $user->lang['MIN_FIELD_CHARS'], 'FIELD' => '<input type="text" name="field_minlen" size="10" value="' . $this->vars['field_minlen'] . '" />'),
- 2 => array('TITLE' => $user->lang['MAX_FIELD_CHARS'], 'FIELD' => '<input type="text" name="field_maxlen" size="10" value="' . $this->vars['field_maxlen'] . '" />'),
- 3 => array('TITLE' => $user->lang['FIELD_VALIDATION'], 'FIELD' => '<select name="field_validation">' . $this->validate_options() . '</select>')
- );
-
- return $options;
- }
-
- /**
- * Get int options for second step in ACP
- */
- function get_int_options()
- {
- global $user;
-
- $options = array(
- 0 => array('TITLE' => $user->lang['FIELD_LENGTH'], 'FIELD' => '<input type="text" name="field_length" size="5" value="' . $this->vars['field_length'] . '" />'),
- 1 => array('TITLE' => $user->lang['MIN_FIELD_NUMBER'], 'FIELD' => '<input type="text" name="field_minlen" size="5" value="' . $this->vars['field_minlen'] . '" />'),
- 2 => array('TITLE' => $user->lang['MAX_FIELD_NUMBER'], 'FIELD' => '<input type="text" name="field_maxlen" size="5" value="' . $this->vars['field_maxlen'] . '" />'),
- 3 => array('TITLE' => $user->lang['DEFAULT_VALUE'], 'FIELD' => '<input type="post" name="field_default_value" value="' . $this->vars['field_default_value'] . '" />')
- );
-
- return $options;
- }
-
- /**
- * Get bool options for second step in ACP
- */
- function get_bool_options()
- {
- global $user, $config, $lang_defs;
-
- $default_lang_id = $lang_defs['iso'][$config['default_lang']];
-
- $profile_row = array(
- 'var_name' => 'field_default_value',
- 'field_id' => 1,
- 'lang_name' => $this->vars['lang_name'],
- 'lang_explain' => $this->vars['lang_explain'],
- 'lang_id' => $default_lang_id,
- 'field_default_value' => $this->vars['field_default_value'],
- 'field_ident' => 'field_default_value',
- 'field_type' => FIELD_BOOL,
- 'field_length' => $this->vars['field_length'],
- 'lang_options' => $this->vars['lang_options']
- );
-
- $options = array(
- 0 => array('TITLE' => $user->lang['FIELD_TYPE'], 'EXPLAIN' => $user->lang['BOOL_TYPE_EXPLAIN'], 'FIELD' => '<label><input type="radio" class="radio" name="field_length" value="1"' . (($this->vars['field_length'] == 1) ? ' checked="checked"' : '') . ' onchange="document.getElementById(\'add_profile_field\').submit();" /> ' . $user->lang['RADIO_BUTTONS'] . '</label><label><input type="radio" class="radio" name="field_length" value="2"' . (($this->vars['field_length'] == 2) ? ' checked="checked"' : '') . ' onchange="document.getElementById(\'add_profile_field\').submit();" /> ' . $user->lang['CHECKBOX'] . '</label>'),
- 1 => array('TITLE' => $user->lang['DEFAULT_VALUE'], 'FIELD' => $this->process_field_row('preview', $profile_row))
- );
-
- return $options;
- }
-
- /**
- * Get dropdown options for second step in ACP
- */
- function get_dropdown_options()
- {
- global $user, $config, $lang_defs;
-
- $default_lang_id = $lang_defs['iso'][$config['default_lang']];
-
- $profile_row[0] = array(
- 'var_name' => 'field_default_value',
- 'field_id' => 1,
- 'lang_name' => $this->vars['lang_name'],
- 'lang_explain' => $this->vars['lang_explain'],
- 'lang_id' => $default_lang_id,
- 'field_default_value' => $this->vars['field_default_value'],
- 'field_ident' => 'field_default_value',
- 'field_type' => FIELD_DROPDOWN,
- 'lang_options' => $this->vars['lang_options']
- );
-
- $profile_row[1] = $profile_row[0];
- $profile_row[1]['var_name'] = 'field_novalue';
- $profile_row[1]['field_ident'] = 'field_novalue';
- $profile_row[1]['field_default_value'] = $this->vars['field_novalue'];
-
- $options = array(
- 0 => array('TITLE' => $user->lang['DEFAULT_VALUE'], 'FIELD' => $this->process_field_row('preview', $profile_row[0])),
- 1 => array('TITLE' => $user->lang['NO_VALUE_OPTION'], 'EXPLAIN' => $user->lang['NO_VALUE_OPTION_EXPLAIN'], 'FIELD' => $this->process_field_row('preview', $profile_row[1]))
- );
-
- return $options;
- }
-
- /**
- * Get date options for second step in ACP
- */
- function get_date_options()
- {
- global $user, $config, $lang_defs;
-
- $default_lang_id = $lang_defs['iso'][$config['default_lang']];
-
- $profile_row = array(
- 'var_name' => 'field_default_value',
- 'lang_name' => $this->vars['lang_name'],
- 'lang_explain' => $this->vars['lang_explain'],
- 'lang_id' => $default_lang_id,
- 'field_default_value' => $this->vars['field_default_value'],
- 'field_ident' => 'field_default_value',
- 'field_type' => FIELD_DATE,
- 'field_length' => $this->vars['field_length']
- );
-
- $always_now = request_var('always_now', -1);
- if ($always_now == -1)
- {
- $s_checked = ($this->vars['field_default_value'] == 'now') ? true : false;
- }
- else
- {
- $s_checked = ($always_now) ? true : false;
- }
-
- $options = array(
- 0 => array('TITLE' => $user->lang['DEFAULT_VALUE'], 'FIELD' => $this->process_field_row('preview', $profile_row)),
- 1 => array('TITLE' => $user->lang['ALWAYS_TODAY'], 'FIELD' => '<label><input type="radio" class="radio" name="always_now" value="1"' . (($s_checked) ? ' checked="checked"' : '') . ' onchange="document.getElementById(\'add_profile_field\').submit();" /> ' . $user->lang['YES'] . '</label><label><input type="radio" class="radio" name="always_now" value="0"' . ((!$s_checked) ? ' checked="checked"' : '') . ' onchange="document.getElementById(\'add_profile_field\').submit();" /> ' . $user->lang['NO'] . '</label>'),
- );
-
- return $options;
- }
-}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/functions_template.php b/phpBB/includes/functions_template.php
deleted file mode 100644
index 8636dfe010..0000000000
--- a/phpBB/includes/functions_template.php
+++ /dev/null
@@ -1,814 +0,0 @@
-<?php
-/**
-*
-* @package phpBB3
-* @version $Id$
-* @copyright (c) 2005 phpBB Group, sections (c) 2001 ispi of Lincoln Inc
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
-*
-*/
-
-/**
-* @ignore
-*/
-if (!defined('IN_PHPBB'))
-{
- exit;
-}
-
-/**
-* Extension of template class - Functions needed for compiling templates only.
-*
-* psoTFX, phpBB Development Team - Completion of file caching, decompilation
-* routines and implementation of conditionals/keywords and associated changes
-*
-* The interface was inspired by PHPLib templates, and the template file (formats are
-* quite similar)
-*
-* The keyword/conditional implementation is currently based on sections of code from
-* the Smarty templating engine (c) 2001 ispi of Lincoln, Inc. which is released
-* (on its own and in whole) under the LGPL. Section 3 of the LGPL states that any code
-* derived from an LGPL application may be relicenced under the GPL, this applies
-* to this source
-*
-* DEFINE directive inspired by a request by Cyberalien
-*
-* @package phpBB3
-*/
-class template_compile
-{
- var $template;
-
- // Various storage arrays
- var $block_names = array();
- var $block_else_level = array();
-
- /**
- * constuctor
- */
- function template_compile(&$template)
- {
- $this->template = &$template;
- }
-
- /**
- * Load template source from file
- * @access private
- */
- function _tpl_load_file($handle, $store_in_db = false)
- {
- // Try and open template for read
- if (!file_exists($this->template->files[$handle]))
- {
- trigger_error("template->_tpl_load_file(): File {$this->template->files[$handle]} does not exist or is empty", E_USER_ERROR);
- }
-
- $this->template->compiled_code[$handle] = $this->compile(trim(@file_get_contents($this->template->files[$handle])));
-
- // Actually compile the code now.
- $this->compile_write($handle, $this->template->compiled_code[$handle]);
-
- // Store in database if required...
- if ($store_in_db)
- {
- global $db, $user;
-
- $sql_ary = array(
- 'template_id' => $this->template->files_template[$handle],
- 'template_filename' => $this->template->filename[$handle],
- 'template_included' => '',
- 'template_mtime' => time(),
- 'template_data' => trim(@file_get_contents($this->template->files[$handle])),
- );
-
- $sql = 'INSERT INTO ' . STYLES_TEMPLATE_DATA_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary);
- $db->sql_query($sql);
- }
- }
-
- /**
- * Remove any PHP tags that do not belong, these regular expressions are derived from
- * the ones that exist in zend_language_scanner.l
- * @access private
- */
- function remove_php_tags(&$code)
- {
- // This matches the information gathered from the internal PHP lexer
- $match = array(
- '#<([\?%])=?.*?\1>#s',
- '#<script\s+language\s*=\s*(["\']?)php\1\s*>.*?</script\s*>#s',
- '#<\?php(?:\r\n?|[ \n\t]).*?\?>#s'
- );
-
- $code = preg_replace($match, '', $code);
- }
-
- /**
- * The all seeing all doing compile method. Parts are inspired by or directly from Smarty
- * @access private
- */
- function compile($code, $no_echo = false, $echo_var = '')
- {
- global $config;
-
- if ($echo_var)
- {
- global $$echo_var;
- }
-
- // Remove any "loose" php ... we want to give admins the ability
- // to switch on/off PHP for a given template. Allowing unchecked
- // php is a no-no. There is a potential issue here in that non-php
- // content may be removed ... however designers should use entities
- // if they wish to display < and >
- $this->remove_php_tags($code);
-
- // Pull out all block/statement level elements and separate plain text
- preg_match_all('#<!-- PHP -->(.*?)<!-- ENDPHP -->#s', $code, $matches);
- $php_blocks = $matches[1];
- $code = preg_replace('#<!-- PHP -->.*?<!-- ENDPHP -->#s', '<!-- PHP -->', $code);
-
- preg_match_all('#<!-- INCLUDE (\{\$?[A-Z0-9\-_]+\}|[a-zA-Z0-9\_\-\+\./]+) -->#', $code, $matches);
- $include_blocks = $matches[1];
- $code = preg_replace('#<!-- INCLUDE (?:\{\$?[A-Z0-9\-_]+\}|[a-zA-Z0-9\_\-\+\./]+) -->#', '<!-- INCLUDE -->', $code);
-
- preg_match_all('#<!-- INCLUDEPHP ([a-zA-Z0-9\_\-\+\./]+) -->#', $code, $matches);
- $includephp_blocks = $matches[1];
- $code = preg_replace('#<!-- INCLUDEPHP [a-zA-Z0-9\_\-\+\./]+ -->#', '<!-- INCLUDEPHP -->', $code);
-
- preg_match_all('#<!-- ([^<].*?) (.*?)? ?-->#', $code, $blocks, PREG_SET_ORDER);
-
- $text_blocks = preg_split('#<!-- [^<].*? (?:.*?)? ?-->#', $code);
-
- for ($i = 0, $j = sizeof($text_blocks); $i < $j; $i++)
- {
- $this->compile_var_tags($text_blocks[$i]);
- }
- $compile_blocks = array();
-
- for ($curr_tb = 0, $tb_size = sizeof($blocks); $curr_tb < $tb_size; $curr_tb++)
- {
- $block_val = &$blocks[$curr_tb];
-
- switch ($block_val[1])
- {
- case 'BEGIN':
- $this->block_else_level[] = false;
- $compile_blocks[] = '<?php ' . $this->compile_tag_block($block_val[2]) . ' ?>';
- break;
-
- case 'BEGINELSE':
- $this->block_else_level[sizeof($this->block_else_level) - 1] = true;
- $compile_blocks[] = '<?php }} else { ?>';
- break;
-
- case 'END':
- array_pop($this->block_names);
- $compile_blocks[] = '<?php ' . ((array_pop($this->block_else_level)) ? '}' : '}}') . ' ?>';
- break;
-
- case 'IF':
- $compile_blocks[] = '<?php ' . $this->compile_tag_if($block_val[2], false) . ' ?>';
- break;
-
- case 'ELSE':
- $compile_blocks[] = '<?php } else { ?>';
- break;
-
- case 'ELSEIF':
- $compile_blocks[] = '<?php ' . $this->compile_tag_if($block_val[2], true) . ' ?>';
- break;
-
- case 'ENDIF':
- $compile_blocks[] = '<?php } ?>';
- break;
-
- case 'DEFINE':
- $compile_blocks[] = '<?php ' . $this->compile_tag_define($block_val[2], true) . ' ?>';
- break;
-
- case 'UNDEFINE':
- $compile_blocks[] = '<?php ' . $this->compile_tag_define($block_val[2], false) . ' ?>';
- break;
-
- case 'INCLUDE':
- $temp = array_shift($include_blocks);
-
- // Dynamic includes
- // Cheap match rather than a full blown regexp, we already know
- // the format of the input so just use string manipulation.
- if ($temp[0] == '{')
- {
- $file = false;
-
- if ($temp[1] == '$')
- {
- $var = substr($temp, 2, -1);
- //$file = $this->template->_tpldata['DEFINE']['.'][$var];
- $temp = "\$this->_tpldata['DEFINE']['.']['$var']";
- }
- else
- {
- $var = substr($temp, 1, -1);
- //$file = $this->template->_rootref[$var];
- $temp = "\$this->_rootref['$var']";
- }
- }
- else
- {
- $file = $temp;
- }
-
- $compile_blocks[] = '<?php ' . $this->compile_tag_include($temp) . ' ?>';
-
- // No point in checking variable includes
- if ($file)
- {
- $this->template->_tpl_include($file, false);
- }
- break;
-
- case 'INCLUDEPHP':
- $compile_blocks[] = ($config['tpl_allow_php']) ? '<?php ' . $this->compile_tag_include_php(array_shift($includephp_blocks)) . ' ?>' : '';
- break;
-
- case 'PHP':
- $compile_blocks[] = ($config['tpl_allow_php']) ? '<?php ' . array_shift($php_blocks) . ' ?>' : '';
- break;
-
- default:
- $this->compile_var_tags($block_val[0]);
- $trim_check = trim($block_val[0]);
- $compile_blocks[] = (!$no_echo) ? ((!empty($trim_check)) ? $block_val[0] : '') : ((!empty($trim_check)) ? $block_val[0] : '');
- break;
- }
- }
-
- $template_php = '';
- for ($i = 0, $size = sizeof($text_blocks); $i < $size; $i++)
- {
- $trim_check_text = trim($text_blocks[$i]);
- $template_php .= (!$no_echo) ? (($trim_check_text != '') ? $text_blocks[$i] : '') . ((isset($compile_blocks[$i])) ? $compile_blocks[$i] : '') : (($trim_check_text != '') ? $text_blocks[$i] : '') . ((isset($compile_blocks[$i])) ? $compile_blocks[$i] : '');
- }
-
- // Remove unused opening/closing tags
- $template_php = str_replace(' ?><?php ', ' ', $template_php);
-
- // Now add a newline after each php closing tag which already has a newline
- // PHP itself strips a newline if a closing tag is used (this is documented behaviour) and it is mostly not intended by style authors to remove newlines
- $template_php = preg_replace('#\?\>([\r\n])#', '?>\1\1', $template_php);
-
- // There will be a number of occasions where we switch into and out of
- // PHP mode instantaneously. Rather than "burden" the parser with this
- // we'll strip out such occurences, minimising such switching
- if ($no_echo)
- {
- return "\$$echo_var .= '" . $template_php . "'";
- }
-
- return $template_php;
- }
-
- /**
- * Compile variables
- * @access private
- */
- function compile_var_tags(&$text_blocks)
- {
- // change template varrefs into PHP varrefs
- $varrefs = array();
-
- // This one will handle varrefs WITH namespaces
- preg_match_all('#\{((?:[a-z0-9\-_]+\.)+)(\$)?([A-Z0-9\-_]+)\}#', $text_blocks, $varrefs, PREG_SET_ORDER);
-
- foreach ($varrefs as $var_val)
- {
- $namespace = $var_val[1];
- $varname = $var_val[3];
- $new = $this->generate_block_varref($namespace, $varname, true, $var_val[2]);
-
- $text_blocks = str_replace($var_val[0], $new, $text_blocks);
- }
-
- // This will handle the remaining root-level varrefs
- // transform vars prefixed by L_ into their language variable pendant if nothing is set within the tpldata array
- if (strpos($text_blocks, '{L_') !== false)
- {
- $text_blocks = preg_replace('#\{L_([A-Z0-9\-_]+)\}#', "<?php echo ((isset(\$this->_rootref['L_\\1'])) ? \$this->_rootref['L_\\1'] : ((isset(\$user->lang['\\1'])) ? \$user->lang['\\1'] : '{ \\1 }')); ?>", $text_blocks);
- }
-
- // Handle addslashed language variables prefixed with LA_
- // If a template variable already exist, it will be used in favor of it...
- if (strpos($text_blocks, '{LA_') !== false)
- {
- $text_blocks = preg_replace('#\{LA_([A-Z0-9\-_]+)\}#', "<?php echo ((isset(\$this->_rootref['LA_\\1'])) ? \$this->_rootref['LA_\\1'] : ((isset(\$this->_rootref['L_\\1'])) ? addslashes(\$this->_rootref['L_\\1']) : ((isset(\$user->lang['\\1'])) ? addslashes(\$user->lang['\\1']) : '{ \\1 }'))); ?>", $text_blocks);
- }
-
- // Handle remaining varrefs
- $text_blocks = preg_replace('#\{([A-Z0-9\-_]+)\}#', "<?php echo (isset(\$this->_rootref['\\1'])) ? \$this->_rootref['\\1'] : ''; ?>", $text_blocks);
- $text_blocks = preg_replace('#\{\$([A-Z0-9\-_]+)\}#', "<?php echo (isset(\$this->_tpldata['DEFINE']['.']['\\1'])) ? \$this->_tpldata['DEFINE']['.']['\\1'] : ''; ?>", $text_blocks);
-
- return;
- }
-
- /**
- * Compile blocks
- * @access private
- */
- function compile_tag_block($tag_args)
- {
- $no_nesting = false;
-
- // Is the designer wanting to call another loop in a loop?
- if (strpos($tag_args, '!') === 0)
- {
- // Count the number of ! occurrences (not allowed in vars)
- $no_nesting = substr_count($tag_args, '!');
- $tag_args = substr($tag_args, $no_nesting);
- }
-
- // Allow for control of looping (indexes start from zero):
- // foo(2) : Will start the loop on the 3rd entry
- // foo(-2) : Will start the loop two entries from the end
- // foo(3,4) : Will start the loop on the fourth entry and end it on the fifth
- // foo(3,-4) : Will start the loop on the fourth entry and end it four from last
- if (preg_match('#^([^()]*)\(([\-\d]+)(?:,([\-\d]+))?\)$#', $tag_args, $match))
- {
- $tag_args = $match[1];
-
- if ($match[2] < 0)
- {
- $loop_start = '($_' . $tag_args . '_count ' . $match[2] . ' < 0 ? 0 : $_' . $tag_args . '_count ' . $match[2] . ')';
- }
- else
- {
- $loop_start = '($_' . $tag_args . '_count < ' . $match[2] . ' ? $_' . $tag_args . '_count : ' . $match[2] . ')';
- }
-
- if (strlen($match[3]) < 1 || $match[3] == -1)
- {
- $loop_end = '$_' . $tag_args . '_count';
- }
- else if ($match[3] >= 0)
- {
- $loop_end = '(' . ($match[3] + 1) . ' > $_' . $tag_args . '_count ? $_' . $tag_args . '_count : ' . ($match[3] + 1) . ')';
- }
- else //if ($match[3] < -1)
- {
- $loop_end = '$_' . $tag_args . '_count' . ($match[3] + 1);
- }
- }
- else
- {
- $loop_start = 0;
- $loop_end = '$_' . $tag_args . '_count';
- }
-
- $tag_template_php = '';
- array_push($this->block_names, $tag_args);
-
- if ($no_nesting !== false)
- {
- // We need to implode $no_nesting times from the end...
- $block = array_slice($this->block_names, -$no_nesting);
- }
- else
- {
- $block = $this->block_names;
- }
-
- if (sizeof($block) < 2)
- {
- // Block is not nested.
- $tag_template_php = '$_' . $tag_args . "_count = (isset(\$this->_tpldata['$tag_args'])) ? sizeof(\$this->_tpldata['$tag_args']) : 0;";
- $varref = "\$this->_tpldata['$tag_args']";
- }
- else
- {
- // This block is nested.
- // Generate a namespace string for this block.
- $namespace = implode('.', $block);
-
- // Get a reference to the data array for this block that depends on the
- // current indices of all parent blocks.
- $varref = $this->generate_block_data_ref($namespace, false);
-
- // Create the for loop code to iterate over this block.
- $tag_template_php = '$_' . $tag_args . '_count = (isset(' . $varref . ')) ? sizeof(' . $varref . ') : 0;';
- }
-
- $tag_template_php .= 'if ($_' . $tag_args . '_count) {';
-
- /**
- * The following uses foreach for iteration instead of a for loop, foreach is faster but requires PHP to make a copy of the contents of the array which uses more memory
- * <code>
- * if (!$offset)
- * {
- * $tag_template_php .= 'foreach (' . $varref . ' as $_' . $tag_args . '_i => $_' . $tag_args . '_val){';
- * }
- * </code>
- */
-
- $tag_template_php .= 'for ($_' . $tag_args . '_i = ' . $loop_start . '; $_' . $tag_args . '_i < ' . $loop_end . '; ++$_' . $tag_args . '_i){';
- $tag_template_php .= '$_'. $tag_args . '_val = &' . $varref . '[$_'. $tag_args. '_i];';
-
- return $tag_template_php;
- }
-
- /**
- * Compile IF tags - much of this is from Smarty with
- * some adaptions for our block level methods
- * @access private
- */
- function compile_tag_if($tag_args, $elseif)
- {
- // Tokenize args for 'if' tag.
- preg_match_all('/(?:
- "[^"\\\\]*(?:\\\\.[^"\\\\]*)*" |
- \'[^\'\\\\]*(?:\\\\.[^\'\\\\]*)*\' |
- [(),] |
- [^\s(),]+)/x', $tag_args, $match);
-
- $tokens = $match[0];
- $is_arg_stack = array();
-
- for ($i = 0, $size = sizeof($tokens); $i < $size; $i++)
- {
- $token = &$tokens[$i];
-
- switch ($token)
- {
- case '!==':
- case '===':
- case '<<':
- case '>>':
- case '|':
- case '^':
- case '&':
- case '~':
- case ')':
- case ',':
- case '+':
- case '-':
- case '*':
- case '/':
- case '@':
- break;
-
- case '==':
- case 'eq':
- $token = '==';
- break;
-
- case '!=':
- case '<>':
- case 'ne':
- case 'neq':
- $token = '!=';
- break;
-
- case '<':
- case 'lt':
- $token = '<';
- break;
-
- case '<=':
- case 'le':
- case 'lte':
- $token = '<=';
- break;
-
- case '>':
- case 'gt':
- $token = '>';
- break;
-
- case '>=':
- case 'ge':
- case 'gte':
- $token = '>=';
- break;
-
- case '&&':
- case 'and':
- $token = '&&';
- break;
-
- case '||':
- case 'or':
- $token = '||';
- break;
-
- case '!':
- case 'not':
- $token = '!';
- break;
-
- case '%':
- case 'mod':
- $token = '%';
- break;
-
- case '(':
- array_push($is_arg_stack, $i);
- break;
-
- case 'is':
- $is_arg_start = ($tokens[$i-1] == ')') ? array_pop($is_arg_stack) : $i-1;
- $is_arg = implode(' ', array_slice($tokens, $is_arg_start, $i - $is_arg_start));
-
- $new_tokens = $this->_parse_is_expr($is_arg, array_slice($tokens, $i+1));
-
- array_splice($tokens, $is_arg_start, sizeof($tokens), $new_tokens);
-
- $i = $is_arg_start;
-
- // no break
-
- default:
- if (preg_match('#^((?:[a-z0-9\-_]+\.)+)?(\$)?(?=[A-Z])([A-Z0-9\-_]+)#s', $token, $varrefs))
- {
- $token = (!empty($varrefs[1])) ? $this->generate_block_data_ref(substr($varrefs[1], 0, -1), true, $varrefs[2]) . '[\'' . $varrefs[3] . '\']' : (($varrefs[2]) ? '$this->_tpldata[\'DEFINE\'][\'.\'][\'' . $varrefs[3] . '\']' : '$this->_rootref[\'' . $varrefs[3] . '\']');
- }
- else if (preg_match('#^\.((?:[a-z0-9\-_]+\.?)+)$#s', $token, $varrefs))
- {
- // Allow checking if loops are set with .loopname
- // It is also possible to check the loop count by doing <!-- IF .loopname > 1 --> for example
- $blocks = explode('.', $varrefs[1]);
-
- // If the block is nested, we have a reference that we can grab.
- // If the block is not nested, we just go and grab the block from _tpldata
- if (sizeof($blocks) > 1)
- {
- $block = array_pop($blocks);
- $namespace = implode('.', $blocks);
- $varref = $this->generate_block_data_ref($namespace, true);
-
- // Add the block reference for the last child.
- $varref .= "['" . $block . "']";
- }
- else
- {
- $varref = '$this->_tpldata';
-
- // Add the block reference for the last child.
- $varref .= "['" . $blocks[0] . "']";
- }
- $token = "sizeof($varref)";
- }
- else if (!empty($token))
- {
- $token = '(' . $token . ')';
- }
-
- break;
- }
- }
-
- // If there are no valid tokens left or only control/compare characters left, we do skip this statement
- if (!sizeof($tokens) || str_replace(array(' ', '=', '!', '<', '>', '&', '|', '%', '(', ')'), '', implode('', $tokens)) == '')
- {
- $tokens = array('false');
- }
- return (($elseif) ? '} else if (' : 'if (') . (implode(' ', $tokens) . ') { ');
- }
-
- /**
- * Compile DEFINE tags
- * @access private
- */
- function compile_tag_define($tag_args, $op)
- {
- preg_match('#^((?:[a-z0-9\-_]+\.)+)?\$(?=[A-Z])([A-Z0-9_\-]*)(?: = (\'?)([^\']*)(\'?))?$#', $tag_args, $match);
-
- if (empty($match[2]) || (!isset($match[4]) && $op))
- {
- return '';
- }
-
- if (!$op)
- {
- return 'unset(' . (($match[1]) ? $this->generate_block_data_ref(substr($match[1], 0, -1), true, true) . '[\'' . $match[2] . '\']' : '$this->_tpldata[\'DEFINE\'][\'.\'][\'' . $match[2] . '\']') . ');';
- }
-
- // Are we a string?
- if ($match[3] && $match[5])
- {
- $match[4] = str_replace(array('\\\'', '\\\\', '\''), array('\'', '\\', '\\\''), $match[4]);
-
- // Compile reference, we allow template variables in defines...
- $match[4] = $this->compile($match[4]);
-
- // Now replace the php code
- $match[4] = "'" . str_replace(array('<?php echo ', '; ?>'), array("' . ", " . '"), $match[4]) . "'";
- }
- else
- {
- preg_match('#true|false|\.#i', $match[4], $type);
-
- switch (strtolower($type[0]))
- {
- case 'true':
- case 'false':
- $match[4] = strtoupper($match[4]);
- break;
-
- case '.':
- $match[4] = doubleval($match[4]);
- break;
-
- default:
- $match[4] = intval($match[4]);
- break;
- }
- }
-
- return (($match[1]) ? $this->generate_block_data_ref(substr($match[1], 0, -1), true, true) . '[\'' . $match[2] . '\']' : '$this->_tpldata[\'DEFINE\'][\'.\'][\'' . $match[2] . '\']') . ' = ' . $match[4] . ';';
- }
-
- /**
- * Compile INCLUDE tag
- * @access private
- */
- function compile_tag_include($tag_args)
- {
- // Process dynamic includes
- if ($tag_args[0] == '$')
- {
- return "if (isset($tag_args)) { \$this->_tpl_include($tag_args); }";
- }
-
- return "\$this->_tpl_include('$tag_args');";
- }
-
- /**
- * Compile INCLUDE_PHP tag
- * @access private
- */
- function compile_tag_include_php($tag_args)
- {
- return "\$this->_php_include('$tag_args');";
- }
-
- /**
- * parse expression
- * This is from Smarty
- * @access private
- */
- function _parse_is_expr($is_arg, $tokens)
- {
- $expr_end = 0;
- $negate_expr = false;
-
- if (($first_token = array_shift($tokens)) == 'not')
- {
- $negate_expr = true;
- $expr_type = array_shift($tokens);
- }
- else
- {
- $expr_type = $first_token;
- }
-
- switch ($expr_type)
- {
- case 'even':
- if (@$tokens[$expr_end] == 'by')
- {
- $expr_end++;
- $expr_arg = $tokens[$expr_end++];
- $expr = "!(($is_arg / $expr_arg) % $expr_arg)";
- }
- else
- {
- $expr = "!($is_arg & 1)";
- }
- break;
-
- case 'odd':
- if (@$tokens[$expr_end] == 'by')
- {
- $expr_end++;
- $expr_arg = $tokens[$expr_end++];
- $expr = "(($is_arg / $expr_arg) % $expr_arg)";
- }
- else
- {
- $expr = "($is_arg & 1)";
- }
- break;
-
- case 'div':
- if (@$tokens[$expr_end] == 'by')
- {
- $expr_end++;
- $expr_arg = $tokens[$expr_end++];
- $expr = "!($is_arg % $expr_arg)";
- }
- break;
- }
-
- if ($negate_expr)
- {
- $expr = "!($expr)";
- }
-
- array_splice($tokens, 0, $expr_end, $expr);
-
- return $tokens;
- }
-
- /**
- * Generates a reference to the given variable inside the given (possibly nested)
- * block namespace. This is a string of the form:
- * ' . $this->_tpldata['parent'][$_parent_i]['$child1'][$_child1_i]['$child2'][$_child2_i]...['varname'] . '
- * It's ready to be inserted into an "echo" line in one of the templates.
- * NOTE: expects a trailing "." on the namespace.
- * @access private
- */
- function generate_block_varref($namespace, $varname, $echo = true, $defop = false)
- {
- // Strip the trailing period.
- $namespace = substr($namespace, 0, -1);
-
- // Get a reference to the data block for this namespace.
- $varref = $this->generate_block_data_ref($namespace, true, $defop);
- // Prepend the necessary code to stick this in an echo line.
-
- // Append the variable reference.
- $varref .= "['$varname']";
- $varref = ($echo) ? "<?php echo $varref; ?>" : ((isset($varref)) ? $varref : '');
-
- return $varref;
- }
-
- /**
- * Generates a reference to the array of data values for the given
- * (possibly nested) block namespace. This is a string of the form:
- * $this->_tpldata['parent'][$_parent_i]['$child1'][$_child1_i]['$child2'][$_child2_i]...['$childN']
- *
- * If $include_last_iterator is true, then [$_childN_i] will be appended to the form shown above.
- * NOTE: does not expect a trailing "." on the blockname.
- * @access private
- */
- function generate_block_data_ref($blockname, $include_last_iterator, $defop = false)
- {
- // Get an array of the blocks involved.
- $blocks = explode('.', $blockname);
- $blockcount = sizeof($blocks) - 1;
-
- // DEFINE is not an element of any referenced variable, we must use _tpldata to access it
- if ($defop)
- {
- $varref = '$this->_tpldata[\'DEFINE\']';
- // Build up the string with everything but the last child.
- for ($i = 0; $i < $blockcount; $i++)
- {
- $varref .= "['" . $blocks[$i] . "'][\$_" . $blocks[$i] . '_i]';
- }
- // Add the block reference for the last child.
- $varref .= "['" . $blocks[$blockcount] . "']";
- // Add the iterator for the last child if requried.
- if ($include_last_iterator)
- {
- $varref .= '[$_' . $blocks[$blockcount] . '_i]';
- }
- return $varref;
- }
- else if ($include_last_iterator)
- {
- return '$_'. $blocks[$blockcount] . '_val';
- }
- else
- {
- return '$_'. $blocks[$blockcount - 1] . '_val[\''. $blocks[$blockcount]. '\']';
- }
- }
-
- /**
- * Write compiled file to cache directory
- * @access private
- */
- function compile_write($handle, $data)
- {
- global $phpEx;
-
- $filename = $this->template->cachepath . str_replace('/', '.', $this->template->filename[$handle]) . '.' . $phpEx;
-
- $data = "<?php if (!defined('IN_PHPBB')) exit;" . ((strpos($data, '<?php') === 0) ? substr($data, 5) : ' ?>' . $data);
-
- if ($fp = @fopen($filename, 'wb'))
- {
- @flock($fp, LOCK_EX);
- @fwrite ($fp, $data);
- @flock($fp, LOCK_UN);
- @fclose($fp);
-
- phpbb_chmod($filename, CHMOD_READ | CHMOD_WRITE);
- }
-
- return;
- }
-}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/functions_transfer.php b/phpBB/includes/functions_transfer.php
index 5ab7a87efd..42fdee364c 100644
--- a/phpBB/includes/functions_transfer.php
+++ b/phpBB/includes/functions_transfer.php
@@ -1,10 +1,13 @@
<?php
/**
*
-* @package phpBB3
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -18,7 +21,6 @@ if (!defined('IN_PHPBB'))
/**
* Transfer class, wrapper for ftp/sftp/ssh
-* @package phpBB3
*/
class transfer
{
@@ -235,7 +237,7 @@ class transfer
/**
* Determine methods able to be used
*/
- function methods()
+ static public function methods()
{
$methods = array();
$disabled_functions = explode(',', @ini_get('disable_functions'));
@@ -256,7 +258,6 @@ class transfer
/**
* FTP transfer class
-* @package phpBB3
*/
class ftp extends transfer
{
@@ -280,7 +281,7 @@ class ftp extends transfer
}
// Init some needed values
- transfer::transfer();
+ $this->transfer();
return;
}
@@ -288,7 +289,7 @@ class ftp extends transfer
/**
* Requests data
*/
- function data()
+ static public function data()
{
global $user;
@@ -506,9 +507,6 @@ class ftp extends transfer
/**
* FTP fsock transfer class
-*
-* @author wGEric
-* @package phpBB3
*/
class ftp_fsock extends transfer
{
@@ -534,7 +532,7 @@ class ftp_fsock extends transfer
}
// Init some needed values
- transfer::transfer();
+ $this->transfer();
return;
}
@@ -542,7 +540,7 @@ class ftp_fsock extends transfer
/**
* Requests data
*/
- function data()
+ static public function data()
{
global $user;
@@ -902,5 +900,3 @@ class ftp_fsock extends transfer
return ($return) ? $response : true;
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/functions_upload.php b/phpBB/includes/functions_upload.php
index 69f10911ec..1aac0e803c 100644
--- a/phpBB/includes/functions_upload.php
+++ b/phpBB/includes/functions_upload.php
@@ -1,10 +1,13 @@
<?php
/**
*
-* @package phpBB3
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -19,7 +22,6 @@ if (!defined('IN_PHPBB'))
/**
* Responsible for holding all file relevant information, as well as doing file-specific operations.
* The {@link fileupload fileupload class} can be used to upload several files, each of them being this object to operate further on.
-* @package phpBB3
*/
class filespec
{
@@ -45,10 +47,22 @@ class filespec
var $upload = '';
/**
+ * The plupload object
+ * @var \phpbb\plupload\plupload
+ */
+ protected $plupload;
+
+ /**
+ * phpBB Mimetype guesser
+ * @var \phpbb\mimetype\guesser
+ */
+ protected $mimetype_guesser;
+
+ /**
* File Class
* @access private
*/
- function filespec($upload_ary, $upload_namespace)
+ function filespec($upload_ary, $upload_namespace, \phpbb\mimetype\guesser $mimetype_guesser = null, \phpbb\plupload\plupload $plupload = null)
{
if (!isset($upload_ary))
{
@@ -59,7 +73,7 @@ class filespec
$this->filename = $upload_ary['tmp_name'];
$this->filesize = $upload_ary['size'];
$name = (STRIP) ? stripslashes($upload_ary['name']) : $upload_ary['name'];
- $name = trim(utf8_htmlspecialchars(utf8_basename($name)));
+ $name = trim(utf8_basename($name));
$this->realname = $this->uploadname = $name;
$this->mimetype = $upload_ary['type'];
@@ -68,10 +82,10 @@ class filespec
if (!$this->mimetype)
{
- $this->mimetype = 'application/octetstream';
+ $this->mimetype = 'application/octet-stream';
}
- $this->extension = strtolower($this->get_extension($this->realname));
+ $this->extension = strtolower(self::get_extension($this->realname));
// Try to get real filesize from temporary folder (not always working) ;)
$this->filesize = (@filesize($this->filename)) ? @filesize($this->filename) : $this->filesize;
@@ -81,6 +95,8 @@ class filespec
$this->local = (isset($upload_ary['local_mode'])) ? true : false;
$this->upload = $upload_namespace;
+ $this->plupload = $plupload;
+ $this->mimetype_guesser = $mimetype_guesser;
}
/**
@@ -88,6 +104,7 @@ class filespec
*
* @param real|unique|unique_ext $mode real creates a realname, filtering some characters, lowering every character. Unique creates an unique filename
* @param string $prefix Prefix applied to filename
+ * @param string $user_id The user_id is only needed for when cleaning a user's avatar
* @access public
*/
function clean_filename($mode = 'unique', $prefix = '', $user_id = '')
@@ -152,7 +169,7 @@ class filespec
*/
function is_image()
{
- return (strpos($this->mimetype, 'image/') !== false) ? true : false;
+ return (strpos($this->mimetype, 'image/') === 0);
}
/**
@@ -162,12 +179,14 @@ class filespec
*/
function is_uploaded()
{
- if (!$this->local && !is_uploaded_file($this->filename))
+ $is_plupload = $this->plupload && $this->plupload->is_active();
+
+ if (!$this->local && !$is_plupload && !is_uploaded_file($this->filename))
{
return false;
}
- if ($this->local && !file_exists($this->filename))
+ if (($this->local || $is_plupload) && !file_exists($this->filename))
{
return false;
}
@@ -188,9 +207,14 @@ class filespec
/**
* Get file extension
+ *
+ * @param string Filename that needs to be checked
+ * @return string Extension of the supplied filename
*/
- function get_extension($filename)
+ static public function get_extension($filename)
{
+ $filename = utf8_basename($filename);
+
if (strpos($filename, '.') === false)
{
return '';
@@ -201,25 +225,24 @@ class filespec
}
/**
- * Get mimetype. Utilize mime_content_type if the function exist.
- * Not used at the moment...
+ * Get mimetype
+ *
+ * @param string $filename Filename that needs to be checked
+ * @return string Mimetype of supplied filename
*/
function get_mimetype($filename)
{
- $mimetype = '';
-
- if (function_exists('mime_content_type'))
+ if ($this->mimetype_guesser !== null)
{
- $mimetype = mime_content_type($filename);
- }
+ $mimetype = $this->mimetype_guesser->guess($filename, $this->uploadname);
- // Some browsers choke on a mimetype of application/octet-stream
- if (!$mimetype || $mimetype == 'application/octet-stream')
- {
- $mimetype = 'application/octetstream';
+ if ($mimetype !== 'application/octet-stream')
+ {
+ $this->mimetype = $mimetype;
+ }
}
- return $mimetype;
+ return $this->mimetype;
}
/**
@@ -262,8 +285,9 @@ class filespec
* Move file to destination folder
* The phpbb_root_path variable will be applied to the destination path
*
- * @param string $destination_path Destination path, for example $config['avatar_path']
+ * @param string $destination Destination path, for example $config['avatar_path']
* @param bool $overwrite If set to true, an already existing file will be overwritten
+ * @param bool $skip_image_check If set to true, the check for the file to be a valid image is skipped
* @param string $chmod Permission mask for chmodding the file after a successful move. The mode entered here reflects the mode defined by {@link phpbb_chmod()}
*
* @access public
@@ -297,6 +321,9 @@ class filespec
if (file_exists($this->destination_file) && !$overwrite)
{
@unlink($this->filename);
+ $this->error[] = $user->lang($this->upload->error_prefix . 'GENERAL_UPLOAD_ERROR', $this->destination_file);
+ $this->file_moved = false;
+ return false;
}
else
{
@@ -355,6 +382,9 @@ class filespec
// Try to get real filesize from destination folder
$this->filesize = (@filesize($this->destination_file)) ? @filesize($this->destination_file) : $this->filesize;
+ // Get mimetype of supplied file
+ $this->mimetype = $this->get_mimetype($this->destination_file);
+
if ($this->is_image() && !$skip_image_check)
{
$this->width = $this->height = 0;
@@ -370,7 +400,7 @@ class filespec
}
// Check image type
- $types = $this->upload->image_types();
+ $types = fileupload::image_types();
if (!isset($types[$this->image_info[2]]) || !in_array($this->extension, $types[$this->image_info[2]]))
{
@@ -427,7 +457,13 @@ class filespec
if (!$this->upload->valid_dimensions($this))
{
- $this->error[] = sprintf($user->lang[$this->upload->error_prefix . 'WRONG_SIZE'], $this->upload->min_width, $this->upload->min_height, $this->upload->max_width, $this->upload->max_height, $this->width, $this->height);
+ $this->error[] = $user->lang($this->upload->error_prefix . 'WRONG_SIZE',
+ $user->lang('PIXELS', (int) $this->upload->min_width),
+ $user->lang('PIXELS', (int) $this->upload->min_height),
+ $user->lang('PIXELS', (int) $this->upload->max_width),
+ $user->lang('PIXELS', (int) $this->upload->max_height),
+ $user->lang('PIXELS', (int) $this->width),
+ $user->lang('PIXELS', (int) $this->height));
return false;
}
@@ -438,8 +474,6 @@ class filespec
/**
* Class for assigning error messages before a real filespec class can be assigned
-*
-* @package phpBB3
*/
class fileerror extends filespec
{
@@ -452,13 +486,11 @@ class fileerror extends filespec
/**
* File upload class
* Init class (all parameters optional and able to be set/overwritten separately) - scope is global and valid for all uploads
-*
-* @package phpBB3
*/
class fileupload
{
var $allowed_extensions = array();
- var $disallowed_content = array('body', 'head', 'html', 'img', 'plaintext', 'a href', 'pre', 'script', 'table', 'title');
+ var $disallowed_content = array('body', 'head', 'html', 'img', 'plaintext', 'a href', 'pre', 'script', 'table', 'title');
var $max_filesize = 0;
var $min_width = 0;
var $min_height = 0;
@@ -479,6 +511,8 @@ class fileupload
* @param int $min_height Minimum image height (only checked for images)
* @param int $max_width Maximum image width (only checked for images)
* @param int $max_height Maximum image height (only checked for images)
+ * @param bool|array $disallowed_content If enabled, the first 256 bytes of the file must not
+ * contain any of its values. Defaults to false.
*
*/
function fileupload($error_prefix = '', $allowed_extensions = false, $max_filesize = false, $min_width = false, $min_height = false, $max_width = false, $max_height = false, $disallowed_content = false)
@@ -559,15 +593,29 @@ class fileupload
* Upload file from users harddisk
*
* @param string $form_name Form name assigned to the file input field (if it is an array, the key has to be specified)
+ * @param \phpbb\mimetype\guesser $mimetype_guesser Mimetype guesser
+ * @param \phpbb\plupload\plupload $plupload The plupload object
+ *
* @return object $file Object "filespec" is returned, all further operations can be done with this object
* @access public
*/
- function form_upload($form_name)
+ function form_upload($form_name, \phpbb\mimetype\guesser $mimetype_guesser = null, \phpbb\plupload\plupload $plupload = null)
{
- global $user;
+ global $user, $request;
- unset($_FILES[$form_name]['local_mode']);
- $file = new filespec($_FILES[$form_name], $this);
+ $upload = $request->file($form_name);
+ unset($upload['local_mode']);
+
+ if ($plupload)
+ {
+ $result = $plupload->handle_upload($form_name);
+ if (is_array($result))
+ {
+ $upload = array_merge($upload, $result);
+ }
+ }
+
+ $file = new filespec($upload, $this, $mimetype_guesser, $plupload);
if ($file->init_error)
{
@@ -576,9 +624,9 @@ class fileupload
}
// Error array filled?
- if (isset($_FILES[$form_name]['error']))
+ if (isset($upload['error']))
{
- $error = $this->assign_internal_error($_FILES[$form_name]['error']);
+ $error = $this->assign_internal_error($upload['error']);
if ($error !== false)
{
@@ -588,7 +636,7 @@ class fileupload
}
// Check if empty file got uploaded (not catched by is_uploaded_file)
- if (isset($_FILES[$form_name]['size']) && $_FILES[$form_name]['size'] == 0)
+ if (isset($upload['size']) && $upload['size'] == 0)
{
$file->error[] = $user->lang[$this->error_prefix . 'EMPTY_FILEUPLOAD'];
return $file;
@@ -627,42 +675,28 @@ class fileupload
/**
* Move file from another location to phpBB
*/
- function local_upload($source_file, $filedata = false)
+ function local_upload($source_file, $filedata = false, \phpbb\mimetype\guesser $mimetype_guesser = null)
{
- global $user;
+ global $user, $request;
- $form_name = 'local';
+ $upload = array();
- $_FILES[$form_name]['local_mode'] = true;
- $_FILES[$form_name]['tmp_name'] = $source_file;
+ $upload['local_mode'] = true;
+ $upload['tmp_name'] = $source_file;
if ($filedata === false)
{
- $_FILES[$form_name]['name'] = utf8_basename($source_file);
- $_FILES[$form_name]['size'] = 0;
- $mimetype = '';
-
- if (function_exists('mime_content_type'))
- {
- $mimetype = mime_content_type($source_file);
- }
-
- // Some browsers choke on a mimetype of application/octet-stream
- if (!$mimetype || $mimetype == 'application/octet-stream')
- {
- $mimetype = 'application/octetstream';
- }
-
- $_FILES[$form_name]['type'] = $mimetype;
+ $upload['name'] = utf8_basename($source_file);
+ $upload['size'] = 0;
}
else
{
- $_FILES[$form_name]['name'] = $filedata['realname'];
- $_FILES[$form_name]['size'] = $filedata['size'];
- $_FILES[$form_name]['type'] = $filedata['type'];
+ $upload['name'] = $filedata['realname'];
+ $upload['size'] = $filedata['size'];
+ $upload['type'] = $filedata['type'];
}
- $file = new filespec($_FILES[$form_name], $this);
+ $file = new filespec($upload, $this, $mimetype_guesser);
if ($file->init_error)
{
@@ -670,9 +704,9 @@ class fileupload
return $file;
}
- if (isset($_FILES[$form_name]['error']))
+ if (isset($upload['error']))
{
- $error = $this->assign_internal_error($_FILES[$form_name]['error']);
+ $error = $this->assign_internal_error($upload['error']);
if ($error !== false)
{
@@ -707,6 +741,7 @@ class fileupload
}
$this->common_checks($file);
+ $request->overwrite('local', $upload, \phpbb\request\request_interface::FILES);
return $file;
}
@@ -716,10 +751,11 @@ class fileupload
* Uploads file from given url
*
* @param string $upload_url URL pointing to file to upload, for example http://www.foobar.com/example.gif
+ * @param \phpbb\mimetype\guesser $mimetype_guesser Mimetype guesser
* @return object $file Object "filespec" is returned, all further operations can be done with this object
* @access public
*/
- function remote_upload($upload_url)
+ function remote_upload($upload_url, \phpbb\mimetype\guesser $mimetype_guesser = null)
{
global $user, $phpbb_root_path;
@@ -740,9 +776,18 @@ class fileupload
$url = parse_url($upload_url);
+ $default_port = 80;
+ $hostname = $url['host'];
+
+ if ($url['scheme'] == 'https')
+ {
+ $default_port = 443;
+ $hostname = 'tls://' . $url['host'];
+ }
+
$host = $url['host'];
$path = $url['path'];
- $port = (!empty($url['port'])) ? (int) $url['port'] : 80;
+ $port = (!empty($url['port'])) ? (int) $url['port'] : $default_port;
$upload_ary['type'] = 'application/octet-stream';
@@ -782,7 +827,7 @@ class fileupload
$errno = 0;
$errstr = '';
- if (!($fsock = @fsockopen($host, $port, $errno, $errstr)))
+ if (!($fsock = @fsockopen($hostname, $port, $errno, $errstr)))
{
$file = new fileerror($user->lang[$this->error_prefix . 'NOT_UPLOADED']);
return $file;
@@ -883,7 +928,7 @@ class fileupload
return $file;
}
- $tmp_path = (!@ini_get('safe_mode') || strtolower(@ini_get('safe_mode')) == 'off') ? false : $phpbb_root_path . 'cache';
+ $tmp_path = (!@ini_get('safe_mode') || strtolower(@ini_get('safe_mode')) == 'off') ? sys_get_temp_dir() : $phpbb_root_path . 'cache';
$filename = tempnam($tmp_path, unique_id() . '-');
if (!($fp = @fopen($filename, 'wb')))
@@ -898,7 +943,7 @@ class fileupload
$upload_ary['tmp_name'] = $filename;
- $file = new filespec($upload_ary, $this);
+ $file = new filespec($upload_ary, $this, $mimetype_guesser);
$this->common_checks($file);
return $file;
@@ -1023,12 +1068,15 @@ class fileupload
*/
function is_valid($form_name)
{
- return (isset($_FILES[$form_name]) && $_FILES[$form_name]['name'] != 'none') ? true : false;
+ global $request;
+ $upload = $request->file($form_name);
+
+ return (!empty($upload) && $upload['name'] !== 'none');
}
/**
- * Check for allowed extension
+ * Check for bad content (IE mime-sniffing)
*/
function valid_content(&$file)
{
@@ -1036,29 +1084,35 @@ class fileupload
}
/**
- * Return image type/extension mapping
+ * Get image type/extension mapping
+ *
+ * @return array Array containing the image types and their extensions
*/
- function image_types()
+ static public function image_types()
{
- return array(
- 1 => array('gif'),
- 2 => array('jpg', 'jpeg'),
- 3 => array('png'),
- 4 => array('swf'),
- 5 => array('psd'),
- 6 => array('bmp'),
- 7 => array('tif', 'tiff'),
- 8 => array('tif', 'tiff'),
- 9 => array('jpg', 'jpeg'),
- 10 => array('jpg', 'jpeg'),
- 11 => array('jpg', 'jpeg'),
- 12 => array('jpg', 'jpeg'),
- 13 => array('swc'),
- 14 => array('iff'),
- 15 => array('wbmp'),
- 16 => array('xbm'),
+ $result = array(
+ IMAGETYPE_GIF => array('gif'),
+ IMAGETYPE_JPEG => array('jpg', 'jpeg'),
+ IMAGETYPE_PNG => array('png'),
+ IMAGETYPE_SWF => array('swf'),
+ IMAGETYPE_PSD => array('psd'),
+ IMAGETYPE_BMP => array('bmp'),
+ IMAGETYPE_TIFF_II => array('tif', 'tiff'),
+ IMAGETYPE_TIFF_MM => array('tif', 'tiff'),
+ IMAGETYPE_JPC => array('jpg', 'jpeg'),
+ IMAGETYPE_JP2 => array('jpg', 'jpeg'),
+ IMAGETYPE_JPX => array('jpg', 'jpeg'),
+ IMAGETYPE_JB2 => array('jpg', 'jpeg'),
+ IMAGETYPE_IFF => array('iff'),
+ IMAGETYPE_WBMP => array('wbmp'),
+ IMAGETYPE_XBM => array('xbm'),
);
+
+ if (defined('IMAGETYPE_SWC'))
+ {
+ $result[IMAGETYPE_SWC] = array('swc');
+ }
+
+ return $result;
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/functions_url_matcher.php b/phpBB/includes/functions_url_matcher.php
new file mode 100644
index 0000000000..b965046aad
--- /dev/null
+++ b/phpBB/includes/functions_url_matcher.php
@@ -0,0 +1,112 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+use Symfony\Component\Routing\Matcher\Dumper\PhpMatcherDumper;
+use Symfony\Component\Routing\Matcher\UrlMatcher;
+use Symfony\Component\Routing\RequestContext;
+
+/**
+* @ignore
+*/
+if (!defined('IN_PHPBB'))
+{
+ exit;
+}
+
+/**
+* Create a new UrlMatcher class and dump it into the cache file
+*
+* @param \phpbb\extension\manager $manager Extension manager
+* @param RequestContext $context Symfony RequestContext object
+* @param string $root_path Root path
+* @param string $php_ext PHP file extension
+* @return null
+*/
+function phpbb_get_url_matcher(\phpbb\extension\manager $manager, RequestContext $context, $root_path, $php_ext)
+{
+ if (defined('DEBUG'))
+ {
+ return phpbb_create_url_matcher($manager, $context, $root_path);
+ }
+
+ if (!phpbb_url_matcher_dumped($root_path, $php_ext))
+ {
+ phpbb_create_dumped_url_matcher($manager, $root_path, $php_ext);
+ }
+
+ return phpbb_load_url_matcher($context, $root_path, $php_ext);
+}
+
+/**
+* Create a new UrlMatcher class and dump it into the cache file
+*
+* @param \phpbb\extension\manager $manager Extension manager
+* @param string $root_path Root path
+* @param string $php_ext PHP file extension
+* @return null
+*/
+function phpbb_create_dumped_url_matcher(\phpbb\extension\manager $manager, $root_path, $php_ext)
+{
+ $provider = new \phpbb\controller\provider();
+ $provider->find_routing_files($manager->get_finder());
+ $routes = $provider->find($root_path)->get_routes();
+ $dumper = new PhpMatcherDumper($routes);
+ $cached_url_matcher_dump = $dumper->dump(array(
+ 'class' => 'phpbb_url_matcher',
+ ));
+
+ file_put_contents($root_path . 'cache/url_matcher.' . $php_ext, $cached_url_matcher_dump);
+}
+
+/**
+* Create a non-cached UrlMatcher
+*
+* @param \phpbb\extension\manager $manager Extension manager
+* @param RequestContext $context Symfony RequestContext object
+* @return UrlMatcher
+*/
+function phpbb_create_url_matcher(\phpbb\extension\manager $manager, RequestContext $context, $root_path)
+{
+ $provider = new \phpbb\controller\provider();
+ $provider->find_routing_files($manager->get_finder());
+ $routes = $provider->find($root_path)->get_routes();
+ return new UrlMatcher($routes, $context);
+}
+
+/**
+* Load the cached phpbb_url_matcher class
+*
+* @param RequestContext $context Symfony RequestContext object
+* @param string $root_path Root path
+* @param string $php_ext PHP file extension
+* @return phpbb_url_matcher
+*/
+function phpbb_load_url_matcher(RequestContext $context, $root_path, $php_ext)
+{
+ require($root_path . 'cache/url_matcher.' . $php_ext);
+ return new phpbb_url_matcher($context);
+}
+
+/**
+* Determine whether we have our dumped URL matcher
+*
+* The class is automatically dumped to the cache directory
+*
+* @param string $root_path Root path
+* @param string $php_ext PHP file extension
+* @return bool True if it exists, false if not
+*/
+function phpbb_url_matcher_dumped($root_path, $php_ext)
+{
+ return file_exists($root_path . 'cache/url_matcher.' . $php_ext);
+}
diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php
index 40b06836a4..4aecbff6ba 100644
--- a/phpBB/includes/functions_user.php
+++ b/phpBB/includes/functions_user.php
@@ -1,10 +1,13 @@
<?php
/**
*
-* @package phpBB3
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -41,13 +44,13 @@ function user_get_id_name(&$user_id_ary, &$username_ary, $user_type = false)
$which_ary = ($user_id_ary) ? 'user_id_ary' : 'username_ary';
- if ($$which_ary && !is_array($$which_ary))
+ if (${$which_ary} && !is_array(${$which_ary}))
{
- $$which_ary = array($$which_ary);
+ ${$which_ary} = array(${$which_ary});
}
- $sql_in = ($which_ary == 'user_id_ary') ? array_map('intval', $$which_ary) : array_map('utf8_clean_string', $$which_ary);
- unset($$which_ary);
+ $sql_in = ($which_ary == 'user_id_ary') ? array_map('intval', ${$which_ary}) : array_map('utf8_clean_string', ${$which_ary});
+ unset(${$which_ary});
$user_id_ary = $username_ary = array();
@@ -113,22 +116,32 @@ function update_last_username()
*/
function user_update_name($old_name, $new_name)
{
- global $config, $db, $cache;
+ global $config, $db, $cache, $phpbb_dispatcher;
$update_ary = array(
- FORUMS_TABLE => array('forum_last_poster_name'),
- MODERATOR_CACHE_TABLE => array('username'),
- POSTS_TABLE => array('post_username'),
- TOPICS_TABLE => array('topic_first_poster_name', 'topic_last_poster_name'),
+ FORUMS_TABLE => array(
+ 'forum_last_poster_id' => 'forum_last_poster_name',
+ ),
+ MODERATOR_CACHE_TABLE => array(
+ 'user_id' => 'username',
+ ),
+ POSTS_TABLE => array(
+ 'poster_id' => 'post_username',
+ ),
+ TOPICS_TABLE => array(
+ 'topic_poster' => 'topic_first_poster_name',
+ 'topic_last_poster_id' => 'topic_last_poster_name',
+ ),
);
foreach ($update_ary as $table => $field_ary)
{
- foreach ($field_ary as $field)
+ foreach ($field_ary as $id_field => $name_field)
{
$sql = "UPDATE $table
- SET $field = '" . $db->sql_escape($new_name) . "'
- WHERE $field = '" . $db->sql_escape($old_name) . "'";
+ SET $name_field = '" . $db->sql_escape($new_name) . "'
+ WHERE $name_field = '" . $db->sql_escape($old_name) . "'
+ AND $id_field <> " . ANONYMOUS;
$db->sql_query($sql);
}
}
@@ -138,6 +151,17 @@ function user_update_name($old_name, $new_name)
set_config('newest_username', $new_name, true);
}
+ /**
+ * Update a username when it is changed
+ *
+ * @event core.update_username
+ * @var string old_name The old username that is replaced
+ * @var string new_name The new username
+ * @since 3.1.0-a1
+ */
+ $vars = array('old_name', 'new_name');
+ extract($phpbb_dispatcher->trigger_event('core.update_username', compact($vars)));
+
// Because some tables/caches use username-specific data we need to purge this here.
$cache->destroy('sql', MODERATOR_CACHE_TABLE);
}
@@ -147,11 +171,13 @@ function user_update_name($old_name, $new_name)
*
* @param mixed $user_row An array containing the following keys (and the appropriate values): username, group_id (the group to place the user in), user_email and the user_type(usually 0). Additional entries not overridden by defaults will be forwarded.
* @param string $cp_data custom profile fields, see custom_profile::build_insert_sql_array
+* @param array $notifications_data The notifications settings for the new user
* @return the new user's ID.
*/
-function user_add($user_row, $cp_data = false)
+function user_add($user_row, $cp_data = false, $notifications_data = null)
{
global $db, $user, $auth, $config, $phpbb_root_path, $phpEx;
+ global $phpbb_dispatcher, $phpbb_container;
if (empty($user_row['username']) || !isset($user_row['group_id']) || !isset($user_row['user_email']) || !isset($user_row['user_type']))
{
@@ -169,7 +195,6 @@ function user_add($user_row, $cp_data = false)
'username' => $user_row['username'],
'username_clean' => $username_clean,
'user_password' => (isset($user_row['user_password'])) ? $user_row['user_password'] : '',
- 'user_pass_convert' => 0,
'user_email' => strtolower($user_row['user_email']),
'user_email_hash' => phpbb_email_hash($user_row['user_email']),
'group_id' => $user_row['group_id'],
@@ -198,12 +223,9 @@ function user_add($user_row, $cp_data = false)
'user_lastpost_time' => 0,
'user_lastpage' => '',
'user_posts' => 0,
- 'user_dst' => (int) $config['board_dst'],
'user_colour' => '',
- 'user_occ' => '',
- 'user_interests' => '',
'user_avatar' => '',
- 'user_avatar_type' => 0,
+ 'user_avatar_type' => '',
'user_avatar_width' => 0,
'user_avatar_height' => 0,
'user_new_privmsg' => 0,
@@ -213,10 +235,7 @@ function user_add($user_row, $cp_data = false)
'user_full_folder' => PRIVMSGS_NO_BOX,
'user_emailtime' => 0,
- // Mageia Config tweak [ https://bugs.mageia.org/show_bug.cgi?id=1188 ]
- 'user_notify' => 1,
- // Mageia Config tweak
-
+ 'user_notify' => 0,
'user_notify_pm' => 1,
'user_notify_type' => NOTIFY_EMAIL,
'user_allow_pm' => 1,
@@ -249,6 +268,21 @@ function user_add($user_row, $cp_data = false)
}
}
+ /**
+ * Use this event to modify the values to be inserted when a user is added
+ *
+ * @event core.user_add_modify_data
+ * @var array user_row Array of user details submited to user_add
+ * @var array cp_data Array of Custom profile fields submited to user_add
+ * @var array sql_ary Array of data to be inserted when a user is added
+ * @var array notifications_data Array of notification data to be inserted when a user is added
+ * @since 3.1.0-a1
+ * @changed 3.1.0-b5 Added user_row and cp_data
+ * @changed 3.1.11-RC1 Added notifications_data
+ */
+ $vars = array('user_row', 'cp_data', 'sql_ary', 'notifications_data');
+ extract($phpbb_dispatcher->trigger_event('core.user_add_modify_data', compact($vars)));
+
$sql = 'INSERT INTO ' . USERS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary);
$db->sql_query($sql);
@@ -259,13 +293,9 @@ function user_add($user_row, $cp_data = false)
{
$cp_data['user_id'] = (int) $user_id;
- if (!class_exists('custom_profile'))
- {
- include_once($phpbb_root_path . 'includes/functions_profile_fields.' . $phpEx);
- }
-
+ $cp = $phpbb_container->get('profilefields.manager');
$sql = 'INSERT INTO ' . PROFILE_FIELDS_DATA_TABLE . ' ' .
- $db->sql_build_array('INSERT', custom_profile::build_insert_sql_array($cp_data));
+ $db->sql_build_array('INSERT', $cp->build_insert_sql_array($cp_data));
$db->sql_query($sql);
}
@@ -293,8 +323,10 @@ function user_add($user_row, $cp_data = false)
if ($add_group_id)
{
- // Because these actions only fill the log unneccessarily we skip the add_log() entry with a little hack. :/
- $GLOBALS['skip_add_log'] = true;
+ global $phpbb_log;
+
+ // Because these actions only fill the log unneccessarily we skip the add_log() entry.
+ $phpbb_log->disable('admin');
// Add user to "newly registered users" group and set to default group if admin specified so.
if ($config['new_member_group_default'])
@@ -307,7 +339,7 @@ function user_add($user_row, $cp_data = false)
group_user_add($add_group_id, $user_id);
}
- unset($GLOBALS['skip_add_log']);
+ $phpbb_log->enable('admin');
}
}
@@ -328,38 +360,101 @@ function user_add($user_row, $cp_data = false)
set_config('newest_user_colour', $row['group_colour'], true);
}
+ // Use default notifications settings if notifications_data is not set
+ if ($notifications_data === null)
+ {
+ $notifications_data = array(
+ array(
+ 'item_type' => 'notification.type.post',
+ 'method' => 'notification.method.email',
+ ),
+ array(
+ 'item_type' => 'notification.type.topic',
+ 'method' => 'notification.method.email',
+ ),
+ );
+ }
+
+ // Subscribe user to notifications if necessary
+ if (!empty($notifications_data))
+ {
+ $phpbb_notifications = $phpbb_container->get('notification_manager');
+ foreach ($notifications_data as $subscription)
+ {
+ $phpbb_notifications->add_subscription($subscription['item_type'], 0, $subscription['method'], $user_id);
+ }
+ }
+
+ /**
+ * Event that returns user id, user detals and user CPF of newly registared user
+ *
+ * @event core.user_add_after
+ * @var int user_id User id of newly registared user
+ * @var array user_row Array of user details submited to user_add
+ * @var array cp_data Array of Custom profile fields submited to user_add
+ * @since 3.1.0-b5
+ */
+ $vars = array('user_id', 'user_row', 'cp_data');
+ extract($phpbb_dispatcher->trigger_event('core.user_add_after', compact($vars)));
+
return $user_id;
}
/**
* Remove User
*
- * @param string $mode 'retain' or 'remove'
- * @param int $user_id
- * @param mixed $post_username
+ * @param string $mode Either 'retain' or 'remove'
+ * @param mixed $user_ids Either an array of integers or an integer
+ * @param bool $retain_username
* @return bool
*/
-function user_delete($mode, $user_id, $post_username = false)
+function user_delete($mode, $user_ids, $retain_username = true)
{
- global $cache, $config, $db, $user;
+ global $cache, $config, $db, $user, $phpbb_dispatcher, $phpbb_container;
global $phpbb_root_path, $phpEx;
+ $db->sql_transaction('begin');
+
+ $user_rows = array();
+ if (!is_array($user_ids))
+ {
+ $user_ids = array($user_ids);
+ }
+
+ $user_id_sql = $db->sql_in_set('user_id', $user_ids);
+
$sql = 'SELECT *
FROM ' . USERS_TABLE . '
- WHERE user_id = ' . $user_id;
+ WHERE ' . $user_id_sql;
$result = $db->sql_query($sql);
- $user_row = $db->sql_fetchrow($result);
+ while ($row = $db->sql_fetchrow($result))
+ {
+ $user_rows[(int) $row['user_id']] = $row;
+ }
$db->sql_freeresult($result);
- if (!$user_row)
+ if (empty($user_rows))
{
return false;
}
+ /**
+ * Event before a user is deleted
+ *
+ * @event core.delete_user_before
+ * @var string mode Mode of deletion (retain/delete posts)
+ * @var array user_ids IDs of the deleted user
+ * @var mixed retain_username True if username should be retained
+ * or false if not
+ * @since 3.1.0-a1
+ */
+ $vars = array('mode', 'user_ids', 'retain_username');
+ extract($phpbb_dispatcher->trigger_event('core.delete_user_before', compact($vars)));
+
// Before we begin, we will remove the reports the user issued.
$sql = 'SELECT r.post_id, p.topic_id
FROM ' . REPORTS_TABLE . ' r, ' . POSTS_TABLE . ' p
- WHERE r.user_id = ' . $user_id . '
+ WHERE ' . $db->sql_in_set('r.user_id', $user_ids) . '
AND p.post_id = r.post_id';
$result = $db->sql_query($sql);
@@ -413,92 +508,154 @@ function user_delete($mode, $user_id, $post_username = false)
}
// Remove reports
- $db->sql_query('DELETE FROM ' . REPORTS_TABLE . ' WHERE user_id = ' . $user_id);
+ $db->sql_query('DELETE FROM ' . REPORTS_TABLE . ' WHERE ' . $user_id_sql);
- if ($user_row['user_avatar'] && $user_row['user_avatar_type'] == AVATAR_UPLOAD)
- {
- avatar_delete('user', $user_row);
- }
+ $num_users_delta = 0;
- switch ($mode)
+ // Get auth provider collection in case accounts might need to be unlinked
+ $provider_collection = $phpbb_container->get('auth.provider_collection');
+
+ // Some things need to be done in the loop (if the query changes based
+ // on which user is currently being deleted)
+ $added_guest_posts = 0;
+ foreach ($user_rows as $user_id => $user_row)
{
- case 'retain':
+ if ($user_row['user_avatar'] && $user_row['user_avatar_type'] == 'avatar.driver.upload')
+ {
+ avatar_delete('user', $user_row);
+ }
- $db->sql_transaction('begin');
+ // Unlink accounts
+ foreach ($provider_collection as $provider_name => $auth_provider)
+ {
+ $provider_data = $auth_provider->get_auth_link_data($user_id);
- if ($post_username === false)
+ if ($provider_data !== null)
{
- $post_username = $user->lang['GUEST'];
- }
+ $link_data = array(
+ 'user_id' => $user_id,
+ 'link_method' => 'user_delete',
+ );
- // If the user is inactive and newly registered we assume no posts from this user being there...
- if ($user_row['user_type'] == USER_INACTIVE && $user_row['user_inactive_reason'] == INACTIVE_REGISTER && !$user_row['user_posts'])
- {
+ // BLOCK_VARS might contain hidden fields necessary for unlinking accounts
+ if (isset($provider_data['BLOCK_VARS']) && is_array($provider_data['BLOCK_VARS']))
+ {
+ foreach ($provider_data['BLOCK_VARS'] as $provider_service)
+ {
+ if (!array_key_exists('HIDDEN_FIELDS', $provider_service))
+ {
+ $provider_service['HIDDEN_FIELDS'] = array();
+ }
+
+ $auth_provider->unlink_account(array_merge($link_data, $provider_service['HIDDEN_FIELDS']));
+ }
+ }
+ else
+ {
+ $auth_provider->unlink_account($link_data);
+ }
}
- else
- {
- $sql = 'UPDATE ' . FORUMS_TABLE . '
- SET forum_last_poster_id = ' . ANONYMOUS . ", forum_last_poster_name = '" . $db->sql_escape($post_username) . "', forum_last_poster_colour = ''
- WHERE forum_last_poster_id = $user_id";
- $db->sql_query($sql);
+ }
- $sql = 'UPDATE ' . POSTS_TABLE . '
- SET poster_id = ' . ANONYMOUS . ", post_username = '" . $db->sql_escape($post_username) . "'
- WHERE poster_id = $user_id";
- $db->sql_query($sql);
+ // Decrement number of users if this user is active
+ if ($user_row['user_type'] != USER_INACTIVE && $user_row['user_type'] != USER_IGNORE)
+ {
+ --$num_users_delta;
+ }
- $sql = 'UPDATE ' . TOPICS_TABLE . '
- SET topic_poster = ' . ANONYMOUS . ", topic_first_poster_name = '" . $db->sql_escape($post_username) . "', topic_first_poster_colour = ''
- WHERE topic_poster = $user_id";
- $db->sql_query($sql);
+ switch ($mode)
+ {
+ case 'retain':
+ if ($retain_username === false)
+ {
+ $post_username = $user->lang['GUEST'];
+ }
+ else
+ {
+ $post_username = $user_row['username'];
+ }
- $sql = 'UPDATE ' . TOPICS_TABLE . '
- SET topic_last_poster_id = ' . ANONYMOUS . ", topic_last_poster_name = '" . $db->sql_escape($post_username) . "', topic_last_poster_colour = ''
- WHERE topic_last_poster_id = $user_id";
- $db->sql_query($sql);
+ // If the user is inactive and newly registered
+ // we assume no posts from the user, and save
+ // the queries
+ if ($user_row['user_type'] != USER_INACTIVE || $user_row['user_inactive_reason'] != INACTIVE_REGISTER || $user_row['user_posts'])
+ {
+ // When we delete these users and retain the posts, we must assign all the data to the guest user
+ $sql = 'UPDATE ' . FORUMS_TABLE . '
+ SET forum_last_poster_id = ' . ANONYMOUS . ", forum_last_poster_name = '" . $db->sql_escape($post_username) . "', forum_last_poster_colour = ''
+ WHERE forum_last_poster_id = $user_id";
+ $db->sql_query($sql);
- $sql = 'UPDATE ' . ATTACHMENTS_TABLE . '
- SET poster_id = ' . ANONYMOUS . "
- WHERE poster_id = $user_id";
- $db->sql_query($sql);
+ $sql = 'UPDATE ' . POSTS_TABLE . '
+ SET poster_id = ' . ANONYMOUS . ", post_username = '" . $db->sql_escape($post_username) . "'
+ WHERE poster_id = $user_id";
+ $db->sql_query($sql);
- // Since we change every post by this author, we need to count this amount towards the anonymous user
+ $sql = 'UPDATE ' . TOPICS_TABLE . '
+ SET topic_poster = ' . ANONYMOUS . ", topic_first_poster_name = '" . $db->sql_escape($post_username) . "', topic_first_poster_colour = ''
+ WHERE topic_poster = $user_id";
+ $db->sql_query($sql);
- // Update the post count for the anonymous user
- if ($user_row['user_posts'])
- {
- $sql = 'UPDATE ' . USERS_TABLE . '
- SET user_posts = user_posts + ' . $user_row['user_posts'] . '
- WHERE user_id = ' . ANONYMOUS;
+ $sql = 'UPDATE ' . TOPICS_TABLE . '
+ SET topic_last_poster_id = ' . ANONYMOUS . ", topic_last_poster_name = '" . $db->sql_escape($post_username) . "', topic_last_poster_colour = ''
+ WHERE topic_last_poster_id = $user_id";
$db->sql_query($sql);
- }
- }
- $db->sql_transaction('commit');
+ // Since we change every post by this author, we need to count this amount towards the anonymous user
- break;
+ if ($user_row['user_posts'])
+ {
+ $added_guest_posts += $user_row['user_posts'];
+ }
+ }
+ break;
- case 'remove':
+ case 'remove':
+ // there is nothing variant specific to deleting posts
+ break;
+ }
+ }
- if (!function_exists('delete_posts'))
- {
- include($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
- }
+ if ($num_users_delta != 0)
+ {
+ set_config_count('num_users', $num_users_delta, true);
+ }
- // Delete posts, attachments, etc.
- delete_posts('poster_id', $user_id);
+ // Now do the invariant tasks
+ // all queries performed in one call of this function are in a single transaction
+ // so this is kosher
+ if ($mode == 'retain')
+ {
+ // Assign more data to the Anonymous user
+ $sql = 'UPDATE ' . ATTACHMENTS_TABLE . '
+ SET poster_id = ' . ANONYMOUS . '
+ WHERE ' . $db->sql_in_set('poster_id', $user_ids);
+ $db->sql_query($sql);
- break;
+ $sql = 'UPDATE ' . USERS_TABLE . '
+ SET user_posts = user_posts + ' . $added_guest_posts . '
+ WHERE user_id = ' . ANONYMOUS;
+ $db->sql_query($sql);
}
+ else if ($mode == 'remove')
+ {
+ if (!function_exists('delete_posts'))
+ {
+ include($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
+ }
- $db->sql_transaction('begin');
+ // Delete posts, attachments, etc.
+ // delete_posts can handle any number of IDs in its second argument
+ delete_posts('poster_id', $user_ids);
+ }
$table_ary = array(USERS_TABLE, USER_GROUP_TABLE, TOPICS_WATCH_TABLE, FORUMS_WATCH_TABLE, ACL_USERS_TABLE, TOPICS_TRACK_TABLE, TOPICS_POSTED_TABLE, FORUMS_TRACK_TABLE, PROFILE_FIELDS_DATA_TABLE, MODERATOR_CACHE_TABLE, DRAFTS_TABLE, BOOKMARKS_TABLE, SESSIONS_KEYS_TABLE, PRIVMSGS_FOLDER_TABLE, PRIVMSGS_RULES_TABLE);
+ // Delete the miscellaneous (non-post) data for the user
foreach ($table_ary as $table)
{
$sql = "DELETE FROM $table
- WHERE user_id = $user_id";
+ WHERE " . $user_id_sql;
$db->sql_query($sql);
}
@@ -507,40 +664,52 @@ function user_delete($mode, $user_id, $post_username = false)
// Change user_id to anonymous for posts edited by this user
$sql = 'UPDATE ' . POSTS_TABLE . '
SET post_edit_user = ' . ANONYMOUS . '
- WHERE post_edit_user = ' . $user_id;
+ WHERE ' . $db->sql_in_set('post_edit_user', $user_ids);
$db->sql_query($sql);
// Change user_id to anonymous for pms edited by this user
$sql = 'UPDATE ' . PRIVMSGS_TABLE . '
SET message_edit_user = ' . ANONYMOUS . '
- WHERE message_edit_user = ' . $user_id;
+ WHERE ' . $db->sql_in_set('message_edit_user', $user_ids);
+ $db->sql_query($sql);
+
+ // Change user_id to anonymous for posts deleted by this user
+ $sql = 'UPDATE ' . POSTS_TABLE . '
+ SET post_delete_user = ' . ANONYMOUS . '
+ WHERE ' . $db->sql_in_set('post_delete_user', $user_ids);
+ $db->sql_query($sql);
+
+ // Change user_id to anonymous for topics deleted by this user
+ $sql = 'UPDATE ' . TOPICS_TABLE . '
+ SET topic_delete_user = ' . ANONYMOUS . '
+ WHERE ' . $db->sql_in_set('topic_delete_user', $user_ids);
$db->sql_query($sql);
// Delete user log entries about this user
$sql = 'DELETE FROM ' . LOG_TABLE . '
- WHERE reportee_id = ' . $user_id;
+ WHERE ' . $db->sql_in_set('reportee_id', $user_ids);
$db->sql_query($sql);
// Change user_id to anonymous for this users triggered events
$sql = 'UPDATE ' . LOG_TABLE . '
SET user_id = ' . ANONYMOUS . '
- WHERE user_id = ' . $user_id;
+ WHERE ' . $user_id_sql;
$db->sql_query($sql);
// Delete the user_id from the zebra table
$sql = 'DELETE FROM ' . ZEBRA_TABLE . '
- WHERE user_id = ' . $user_id . '
- OR zebra_id = ' . $user_id;
+ WHERE ' . $user_id_sql . '
+ OR ' . $db->sql_in_set('zebra_id', $user_ids);
$db->sql_query($sql);
// Delete the user_id from the banlist
$sql = 'DELETE FROM ' . BANLIST_TABLE . '
- WHERE ban_userid = ' . $user_id;
+ WHERE ' . $db->sql_in_set('ban_userid', $user_ids);
$db->sql_query($sql);
// Delete the user_id from the session table
$sql = 'DELETE FROM ' . SESSIONS_TABLE . '
- WHERE session_user_id = ' . $user_id;
+ WHERE ' . $db->sql_in_set('session_user_id', $user_ids);
$db->sql_query($sql);
// Clean the private messages tables from the user
@@ -548,22 +717,32 @@ function user_delete($mode, $user_id, $post_username = false)
{
include($phpbb_root_path . 'includes/functions_privmsgs.' . $phpEx);
}
- phpbb_delete_user_pms($user_id);
+ phpbb_delete_users_pms($user_ids);
+
+ $phpbb_notifications = $phpbb_container->get('notification_manager');
+ $phpbb_notifications->delete_notifications('notification.type.admin_activate_user', $user_ids);
$db->sql_transaction('commit');
+ /**
+ * Event after a user is deleted
+ *
+ * @event core.delete_user_after
+ * @var string mode Mode of deletion (retain/delete posts)
+ * @var array user_ids IDs of the deleted user
+ * @var mixed retain_username True if username should be retained
+ * or false if not
+ * @since 3.1.0-a1
+ */
+ $vars = array('mode', 'user_ids', 'retain_username');
+ extract($phpbb_dispatcher->trigger_event('core.delete_user_after', compact($vars)));
+
// Reset newest user info if appropriate
- if ($config['newest_user_id'] == $user_id)
+ if (in_array($config['newest_user_id'], $user_ids))
{
update_last_username();
}
- // Decrement number of users if this user is active
- if ($user_row['user_type'] != USER_INACTIVE && $user_row['user_type'] != USER_IGNORE)
- {
- set_config_count('num_users', -1, true);
- }
-
return false;
}
@@ -574,7 +753,7 @@ function user_delete($mode, $user_id, $post_username = false)
*/
function user_active_flip($mode, $user_id_ary, $reason = INACTIVE_MANUAL)
{
- global $config, $db, $user, $auth;
+ global $config, $db, $user, $auth, $phpbb_dispatcher;
$deactivated = $activated = 0;
$sql_statements = array();
@@ -627,6 +806,21 @@ function user_active_flip($mode, $user_id_ary, $reason = INACTIVE_MANUAL)
}
$db->sql_freeresult($result);
+ /**
+ * Check or modify activated/deactivated users data before submitting it to the database
+ *
+ * @event core.user_active_flip_before
+ * @var string mode User type changing mode, can be: flip|activate|deactivate
+ * @var int reason Reason for changing user type, can be: INACTIVE_REGISTER|INACTIVE_PROFILE|INACTIVE_MANUAL|INACTIVE_REMIND
+ * @var int activated The number of users to be activated
+ * @var int deactivated The number of users to be deactivated
+ * @var array user_id_ary Array with user ids to change user type
+ * @var array sql_statements Array with users data to submit to the database, keys: user ids, values: arrays with user data
+ * @since 3.1.4-RC1
+ */
+ $vars = array('mode', 'reason', 'activated', 'deactivated', 'user_id_ary', 'sql_statements');
+ extract($phpbb_dispatcher->trigger_event('core.user_active_flip_before', compact($vars)));
+
if (sizeof($sql_statements))
{
foreach ($sql_statements as $user_id => $sql_ary)
@@ -640,6 +834,21 @@ function user_active_flip($mode, $user_id_ary, $reason = INACTIVE_MANUAL)
$auth->acl_clear_prefetch(array_keys($sql_statements));
}
+ /**
+ * Perform additional actions after the users have been activated/deactivated
+ *
+ * @event core.user_active_flip_after
+ * @var string mode User type changing mode, can be: flip|activate|deactivate
+ * @var int reason Reason for changing user type, can be: INACTIVE_REGISTER|INACTIVE_PROFILE|INACTIVE_MANUAL|INACTIVE_REMIND
+ * @var int activated The number of users to be activated
+ * @var int deactivated The number of users to be deactivated
+ * @var array user_id_ary Array with user ids to change user type
+ * @var array sql_statements Array with users data to submit to the database, keys: user ids, values: arrays with user data
+ * @since 3.1.4-RC1
+ */
+ $vars = array('mode', 'reason', 'activated', 'deactivated', 'user_id_ary', 'sql_statements');
+ extract($phpbb_dispatcher->trigger_event('core.user_active_flip_after', compact($vars)));
+
if ($deactivated)
{
set_config_count('num_users', $deactivated * (-1), true);
@@ -690,11 +899,13 @@ function user_ban($mode, $ban, $ban_len, $ban_len_other, $ban_exclude, $ban_reas
else
{
$ban_other = explode('-', $ban_len_other);
- if (sizeof($ban_other) == 3 && ((int)$ban_other[0] < 9999) &&
+ if (sizeof($ban_other) == 3 && ((int) $ban_other[0] < 9999) &&
(strlen($ban_other[0]) == 4) && (strlen($ban_other[1]) == 2) && (strlen($ban_other[2]) == 2))
{
- $time_offset = (isset($user->timezone) && isset($user->dst)) ? (int) $user->timezone + (int) $user->dst : 0;
- $ban_end = max($current_time, gmmktime(0, 0, 0, (int)$ban_other[1], (int)$ban_other[2], (int)$ban_other[0]) - $time_offset);
+ $ban_end = max($current_time, $user->create_datetime()
+ ->setDate((int) $ban_other[0], (int) $ban_other[1], (int) $ban_other[2])
+ ->setTime(0, 0, 0)
+ ->getTimestamp() + $user->timezone->getOffset(new DateTime('UTC')));
}
else
{
@@ -1055,7 +1266,7 @@ function user_ban($mode, $ban, $ban_len, $ban_len_other, $ban_exclude, $ban_reas
// Update log
$log_entry = ($ban_exclude) ? 'LOG_BAN_EXCLUDE_' : 'LOG_BAN_';
- // Add to moderator log, admin log and user notes
+ // Add to admin log, moderator log and user notes
add_log('admin', $log_entry . strtoupper($mode), $ban_reason, $ban_list_log);
add_log('mod', 0, 0, $log_entry . strtoupper($mode), $ban_reason, $ban_list_log);
if ($mode == 'user')
@@ -1082,7 +1293,7 @@ function user_ban($mode, $ban, $ban_len, $ban_len_other, $ban_exclude, $ban_reas
*/
function user_unban($mode, $ban)
{
- global $db, $user, $auth, $cache;
+ global $db, $user, $auth, $cache, $phpbb_dispatcher;
// Delete stale bans
$sql = 'DELETE FROM ' . BANLIST_TABLE . '
@@ -1149,6 +1360,20 @@ function user_unban($mode, $ban)
add_log('user', $user_id, 'LOG_UNBAN_' . strtoupper($mode), $l_unban_list);
}
}
+
+ /**
+ * Use this event to perform actions after the unban has been performed
+ *
+ * @event core.user_unban
+ * @var string mode One of the following: user, ip, email
+ * @var array user_ids_ary Array with user_ids
+ * @since 3.1.11-RC1
+ */
+ $vars = array(
+ 'mode',
+ 'user_ids_ary',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.user_unban', compact($vars)));
}
$cache->destroy('sql', BANLIST_TABLE);
@@ -1203,7 +1428,7 @@ function user_ipwhois($ip)
$match = array();
// Test for referrals from $whois_host to other whois databases, roll on rwhois
- if (preg_match('#ReferralServer: whois://(.+)#im', $ipwhois, $match))
+ if (preg_match('#ReferralServer:[\x20]*whois://(.+)#im', $ipwhois, $match))
{
if (strpos($match[1], ':') !== false)
{
@@ -1262,9 +1487,18 @@ function validate_data($data, $val_ary)
{
$function = array_shift($validate);
array_unshift($validate, $data[$var]);
- $function_prefix = (function_exists('phpbb_validate_' . $function)) ? 'phpbb_validate_' : 'validate_';
- if ($result = call_user_func_array($function_prefix . $function, $validate))
+ if (is_array($function))
+ {
+ $result = call_user_func_array(array($function[0], 'validate_' . $function[1]), $validate);
+ }
+ else
+ {
+ $function_prefix = (function_exists('phpbb_validate_' . $function)) ? 'phpbb_validate_' : 'validate_';
+ $result = call_user_func_array($function_prefix . $function, $validate);
+ }
+
+ if ($result)
{
// Since errors are checked later for their language file existence, we need to make sure custom errors are not adjusted.
$error[] = (empty($user->lang[$result . '_' . strtoupper($var)])) ? $result : $result . '_' . strtoupper($var);
@@ -1413,6 +1647,22 @@ function validate_language_iso_name($lang_iso)
}
/**
+* Validate Timezone Name
+*
+* Tests whether a timezone name is valid
+*
+* @param string $timezone The timezone string to test
+*
+* @return bool|string Either false if validation succeeded or
+* a string which will be used as the error message
+* (with the variable name appended)
+*/
+function phpbb_validate_timezone($timezone)
+{
+ return (in_array($timezone, phpbb_get_timezone_identifiers($timezone))) ? false : 'TIMEZONE_INVALID';
+}
+
+/**
* Check to see if the username has been taken, or if it is disallowed.
* Also checks if it includes the " character, which we don't allow in usernames.
* Used for registering, changing names, and posting anonymously with a username
@@ -1443,7 +1693,7 @@ function validate_username($username, $allowed_username = false)
$mbstring = $pcre = false;
// generic UTF-8 character types supported?
- if ((version_compare(PHP_VERSION, '5.1.0', '>=') || (version_compare(PHP_VERSION, '5.0.0-dev', '<=') && version_compare(PHP_VERSION, '4.4.0', '>='))) && @preg_match('/\p{L}/u', 'a') !== false)
+ if (phpbb_pcre_utf8_support())
{
$pcre = true;
}
@@ -1580,7 +1830,7 @@ function validate_password($password)
$pcre = $mbstring = false;
// generic UTF-8 character types supported?
- if ((version_compare(PHP_VERSION, '5.1.0', '>=') || (version_compare(PHP_VERSION, '5.0.0-dev', '<=') && version_compare(PHP_VERSION, '4.4.0', '>='))) && @preg_match('/\p{L}/u', 'a') !== false)
+ if (phpbb_pcre_utf8_support())
{
$upp = '\p{Lu}';
$low = '\p{Ll}';
@@ -1653,25 +1903,21 @@ function validate_password($password)
}
/**
-* Check to see if email address is banned or already present in the DB
+* Check to see if email address is a valid address and contains a MX record
*
* @param string $email The email to check
-* @param string $allowed_email An allowed email, default being $user->data['user_email']
*
* @return mixed Either false if validation succeeded or a string which will be used as the error message (with the variable name appended)
*/
-function validate_email($email, $allowed_email = false)
+function phpbb_validate_email($email, $config = null)
{
- global $config, $db, $user;
-
- $email = strtolower($email);
- $allowed_email = ($allowed_email === false) ? strtolower($user->data['user_email']) : strtolower($allowed_email);
-
- if ($allowed_email == $email)
+ if ($config === null)
{
- return false;
+ global $config;
}
+ $email = strtolower($email);
+
if (!preg_match('/^' . get_preg_expression('email') . '$/i', $email))
{
return 'EMAIL_INVALID';
@@ -1689,6 +1935,35 @@ function validate_email($email, $allowed_email = false)
}
}
+ return false;
+}
+
+/**
+* Check to see if email address is banned or already present in the DB
+*
+* @param string $email The email to check
+* @param string $allowed_email An allowed email, default being $user->data['user_email']
+*
+* @return mixed Either false if validation succeeded or a string which will be used as the error message (with the variable name appended)
+*/
+function validate_user_email($email, $allowed_email = false)
+{
+ global $config, $db, $user;
+
+ $email = strtolower($email);
+ $allowed_email = ($allowed_email === false) ? strtolower($user->data['user_email']) : strtolower($allowed_email);
+
+ if ($allowed_email == $email)
+ {
+ return false;
+ }
+
+ $validate_email = phpbb_validate_email($email, $config);
+ if ($validate_email)
+ {
+ return $validate_email;
+ }
+
if (($ban_reason = $user->check_ban(false, false, $email, true)) !== false)
{
return ($ban_reason === true) ? 'EMAIL_BANNED' : $ban_reason;
@@ -1725,15 +2000,15 @@ function validate_jabber($jid)
return false;
}
- $seperator_pos = strpos($jid, '@');
+ $separator_pos = strpos($jid, '@');
- if ($seperator_pos === false)
+ if ($separator_pos === false)
{
return 'WRONG_DATA';
}
- $username = substr($jid, 0, $seperator_pos);
- $realm = substr($jid, $seperator_pos + 1);
+ $username = substr($jid, 0, $separator_pos);
+ $realm = substr($jid, $separator_pos + 1);
if (strlen($username) == 0 || strlen($realm) < 3)
{
@@ -1969,7 +2244,7 @@ function avatar_delete($mode, $row, $clean_db = false)
// Check if the users avatar is actually *not* a group avatar
if ($mode == 'user')
{
- if (strpos($row['user_avatar'], 'g') === 0 || (((int)$row['user_avatar'] !== 0) && ((int)$row['user_avatar'] !== (int)$row['user_id'])))
+ if (strpos($row['user_avatar'], 'g') === 0 || (((int) $row['user_avatar'] !== 0) && ((int) $row['user_avatar'] !== (int) $row['user_id'])))
{
return false;
}
@@ -1980,6 +2255,7 @@ function avatar_delete($mode, $row, $clean_db = false)
avatar_remove_db($row[$mode . '_avatar']);
}
$filename = get_avatar_filename($row[$mode . '_avatar']);
+
if (file_exists($phpbb_root_path . $config['avatar_path'] . '/' . $filename))
{
@unlink($phpbb_root_path . $config['avatar_path'] . '/' . $filename);
@@ -1990,140 +2266,12 @@ function avatar_delete($mode, $row, $clean_db = false)
}
/**
-* Remote avatar linkage
-*/
-function avatar_remote($data, &$error)
-{
- global $config, $db, $user, $phpbb_root_path, $phpEx;
-
- if (!preg_match('#^(http|https|ftp)://#i', $data['remotelink']))
- {
- $data['remotelink'] = 'http://' . $data['remotelink'];
- }
- if (!preg_match('#^(http|https|ftp)://(?:(.*?\.)*?[a-z0-9\-]+?\.[a-z]{2,4}|(?:\d{1,3}\.){3,5}\d{1,3}):?([0-9]*?).*?\.(gif|jpg|jpeg|png)$#i', $data['remotelink']))
- {
- $error[] = $user->lang['AVATAR_URL_INVALID'];
- return false;
- }
-
- // Make sure getimagesize works...
- if (($image_data = @getimagesize($data['remotelink'])) === false && (empty($data['width']) || empty($data['height'])))
- {
- $error[] = $user->lang['UNABLE_GET_IMAGE_SIZE'];
- return false;
- }
-
- if (!empty($image_data) && ($image_data[0] < 2 || $image_data[1] < 2))
- {
- $error[] = $user->lang['AVATAR_NO_SIZE'];
- return false;
- }
-
- $width = ($data['width'] && $data['height']) ? $data['width'] : $image_data[0];
- $height = ($data['width'] && $data['height']) ? $data['height'] : $image_data[1];
-
- if ($width < 2 || $height < 2)
- {
- $error[] = $user->lang['AVATAR_NO_SIZE'];
- return false;
- }
-
- // Check image type
- include_once($phpbb_root_path . 'includes/functions_upload.' . $phpEx);
- $types = fileupload::image_types();
- $extension = strtolower(filespec::get_extension($data['remotelink']));
-
- if (!empty($image_data) && (!isset($types[$image_data[2]]) || !in_array($extension, $types[$image_data[2]])))
- {
- if (!isset($types[$image_data[2]]))
- {
- $error[] = $user->lang['UNABLE_GET_IMAGE_SIZE'];
- }
- else
- {
- $error[] = sprintf($user->lang['IMAGE_FILETYPE_MISMATCH'], $types[$image_data[2]][0], $extension);
- }
- return false;
- }
-
- if ($config['avatar_max_width'] || $config['avatar_max_height'])
- {
- if ($width > $config['avatar_max_width'] || $height > $config['avatar_max_height'])
- {
- $error[] = sprintf($user->lang['AVATAR_WRONG_SIZE'], $config['avatar_min_width'], $config['avatar_min_height'], $config['avatar_max_width'], $config['avatar_max_height'], $width, $height);
- return false;
- }
- }
-
- if ($config['avatar_min_width'] || $config['avatar_min_height'])
- {
- if ($width < $config['avatar_min_width'] || $height < $config['avatar_min_height'])
- {
- $error[] = sprintf($user->lang['AVATAR_WRONG_SIZE'], $config['avatar_min_width'], $config['avatar_min_height'], $config['avatar_max_width'], $config['avatar_max_height'], $width, $height);
- return false;
- }
- }
-
- return array(AVATAR_REMOTE, $data['remotelink'], $width, $height);
-}
-
-/**
-* Avatar upload using the upload class
-*/
-function avatar_upload($data, &$error)
-{
- global $phpbb_root_path, $config, $db, $user, $phpEx;
-
- // Init upload class
- include_once($phpbb_root_path . 'includes/functions_upload.' . $phpEx);
- $upload = new fileupload('AVATAR_', array('jpg', 'jpeg', 'gif', 'png'), $config['avatar_filesize'], $config['avatar_min_width'], $config['avatar_min_height'], $config['avatar_max_width'], $config['avatar_max_height'], (isset($config['mime_triggers']) ? explode('|', $config['mime_triggers']) : false));
-
- if (!empty($_FILES['uploadfile']['name']))
- {
- $file = $upload->form_upload('uploadfile');
- }
- else
- {
- $file = $upload->remote_upload($data['uploadurl']);
- }
-
- $prefix = $config['avatar_salt'] . '_';
- $file->clean_filename('avatar', $prefix, $data['user_id']);
-
- $destination = $config['avatar_path'];
-
- // Adjust destination path (no trailing slash)
- if (substr($destination, -1, 1) == '/' || substr($destination, -1, 1) == '\\')
- {
- $destination = substr($destination, 0, -1);
- }
-
- $destination = str_replace(array('../', '..\\', './', '.\\'), '', $destination);
- if ($destination && ($destination[0] == '/' || $destination[0] == "\\"))
- {
- $destination = '';
- }
-
- // Move file and overwrite any existing image
- $file->move_file($destination, true);
-
- if (sizeof($file->error))
- {
- $file->remove();
- $error = array_merge($error, $file->error);
- }
-
- return array(AVATAR_UPLOAD, $data['user_id'] . '_' . time() . '.' . $file->get('extension'), $file->get('width'), $file->get('height'));
-}
-
-/**
* Generates avatar filename from the database entry
*/
function get_avatar_filename($avatar_entry)
{
global $config;
-
if ($avatar_entry[0] === 'g')
{
$avatar_group = true;
@@ -2139,358 +2287,111 @@ function get_avatar_filename($avatar_entry)
}
/**
-* Avatar Gallery
+* Returns an explanation string with maximum avatar settings
+*
+* @return string
*/
-function avatar_gallery($category, $avatar_select, $items_per_column, $block_var = 'avatar_row')
+function phpbb_avatar_explanation_string()
{
- global $user, $cache, $template;
- global $config, $phpbb_root_path;
-
- $avatar_list = array();
-
- $path = $phpbb_root_path . $config['avatar_gallery_path'];
-
- if (!file_exists($path) || !is_dir($path))
- {
- $avatar_list = array($user->lang['NO_AVATAR_CATEGORY'] => array());
- }
- else
- {
- // Collect images
- $dp = @opendir($path);
-
- if (!$dp)
- {
- return array($user->lang['NO_AVATAR_CATEGORY'] => array());
- }
-
- while (($file = readdir($dp)) !== false)
- {
- if ($file[0] != '.' && preg_match('#^[^&"\'<>]+$#i', $file) && is_dir("$path/$file"))
- {
- $avatar_row_count = $avatar_col_count = 0;
-
- if ($dp2 = @opendir("$path/$file"))
- {
- while (($sub_file = readdir($dp2)) !== false)
- {
- if (preg_match('#^[^&\'"<>]+\.(?:gif|png|jpe?g)$#i', $sub_file))
- {
- $avatar_list[$file][$avatar_row_count][$avatar_col_count] = array(
- 'file' => rawurlencode($file) . '/' . rawurlencode($sub_file),
- 'filename' => rawurlencode($sub_file),
- 'name' => ucfirst(str_replace('_', ' ', preg_replace('#^(.*)\..*$#', '\1', $sub_file))),
- );
- $avatar_col_count++;
- if ($avatar_col_count == $items_per_column)
- {
- $avatar_row_count++;
- $avatar_col_count = 0;
- }
- }
- }
- closedir($dp2);
- }
- }
- }
- closedir($dp);
- }
-
- if (!sizeof($avatar_list))
- {
- $avatar_list = array($user->lang['NO_AVATAR_CATEGORY'] => array());
- }
+ global $config, $user;
- @ksort($avatar_list);
-
- $category = (!$category) ? key($avatar_list) : $category;
- $avatar_categories = array_keys($avatar_list);
-
- $s_category_options = '';
- foreach ($avatar_categories as $cat)
- {
- $s_category_options .= '<option value="' . $cat . '"' . (($cat == $category) ? ' selected="selected"' : '') . '>' . $cat . '</option>';
- }
-
- $template->assign_vars(array(
- 'S_AVATARS_ENABLED' => true,
- 'S_IN_AVATAR_GALLERY' => true,
- 'S_CAT_OPTIONS' => $s_category_options)
- );
-
- $avatar_list = (isset($avatar_list[$category])) ? $avatar_list[$category] : array();
-
- foreach ($avatar_list as $avatar_row_ary)
- {
- $template->assign_block_vars($block_var, array());
-
- foreach ($avatar_row_ary as $avatar_col_ary)
- {
- $template->assign_block_vars($block_var . '.avatar_column', array(
- 'AVATAR_IMAGE' => $phpbb_root_path . $config['avatar_gallery_path'] . '/' . $avatar_col_ary['file'],
- 'AVATAR_NAME' => $avatar_col_ary['name'],
- 'AVATAR_FILE' => $avatar_col_ary['filename'])
- );
-
- $template->assign_block_vars($block_var . '.avatar_option_column', array(
- 'AVATAR_IMAGE' => $phpbb_root_path . $config['avatar_gallery_path'] . '/' . $avatar_col_ary['file'],
- 'S_OPTIONS_AVATAR' => $avatar_col_ary['filename'])
- );
- }
- }
-
- return $avatar_list;
+ return $user->lang(($config['avatar_filesize'] == 0) ? 'AVATAR_EXPLAIN_NO_FILESIZE' : 'AVATAR_EXPLAIN',
+ $user->lang('PIXELS', (int) $config['avatar_max_width']),
+ $user->lang('PIXELS', (int) $config['avatar_max_height']),
+ round($config['avatar_filesize'] / 1024));
}
+//
+// Usergroup functions
+//
/**
-* Tries to (re-)establish avatar dimensions
-*/
-function avatar_get_dimensions($avatar, $avatar_type, &$error, $current_x = 0, $current_y = 0)
-{
- global $config, $phpbb_root_path, $user;
-
- switch ($avatar_type)
- {
- case AVATAR_REMOTE :
- break;
-
- case AVATAR_UPLOAD :
- $avatar = $phpbb_root_path . $config['avatar_path'] . '/' . get_avatar_filename($avatar);
- break;
-
- case AVATAR_GALLERY :
- $avatar = $phpbb_root_path . $config['avatar_gallery_path'] . '/' . $avatar ;
- break;
- }
-
- // Make sure getimagesize works...
- if (($image_data = @getimagesize($avatar)) === false)
- {
- $error[] = $user->lang['UNABLE_GET_IMAGE_SIZE'];
- return false;
- }
-
- if ($image_data[0] < 2 || $image_data[1] < 2)
- {
- $error[] = $user->lang['AVATAR_NO_SIZE'];
- return false;
- }
-
- // try to maintain ratio
- if (!(empty($current_x) && empty($current_y)))
- {
- if ($current_x != 0)
- {
- $image_data[1] = (int) floor(($current_x / $image_data[0]) * $image_data[1]);
- $image_data[1] = min($config['avatar_max_height'], $image_data[1]);
- $image_data[1] = max($config['avatar_min_height'], $image_data[1]);
- }
- if ($current_y != 0)
- {
- $image_data[0] = (int) floor(($current_y / $image_data[1]) * $image_data[0]);
- $image_data[0] = min($config['avatar_max_width'], $image_data[1]);
- $image_data[0] = max($config['avatar_min_width'], $image_data[1]);
- }
- }
- return array($image_data[0], $image_data[1]);
-}
-
-/**
-* Uploading/Changing user avatar
+* Add or edit a group. If we're editing a group we only update user
+* parameters such as rank, etc. if they are changed
*/
-function avatar_process_user(&$error, $custom_userdata = false, $can_upload = null)
+function group_create(&$group_id, $type, $name, $desc, $group_attributes, $allow_desc_bbcode = false, $allow_desc_urls = false, $allow_desc_smilies = false)
{
- global $config, $phpbb_root_path, $auth, $user, $db;
+ global $phpbb_root_path, $config, $db, $user, $file_upload, $phpbb_container;
- $data = array(
- 'uploadurl' => request_var('uploadurl', ''),
- 'remotelink' => request_var('remotelink', ''),
- 'width' => request_var('width', 0),
- 'height' => request_var('height', 0),
- );
-
- $error = validate_data($data, array(
- 'uploadurl' => array('string', true, 5, 255),
- 'remotelink' => array('string', true, 5, 255),
- 'width' => array('string', true, 1, 3),
- 'height' => array('string', true, 1, 3),
- ));
-
- if (sizeof($error))
- {
- return false;
- }
+ $error = array();
- $sql_ary = array();
+ // Attributes which also affect the users table
+ $user_attribute_ary = array('group_colour', 'group_rank', 'group_avatar', 'group_avatar_type', 'group_avatar_width', 'group_avatar_height');
- if ($custom_userdata === false)
- {
- $userdata = &$user->data;
- }
- else
+ // Check data. Limit group name length.
+ if (!utf8_strlen($name) || utf8_strlen($name) > 60)
{
- $userdata = &$custom_userdata;
+ $error[] = (!utf8_strlen($name)) ? $user->lang['GROUP_ERR_USERNAME'] : $user->lang['GROUP_ERR_USER_LONG'];
}
- $data['user_id'] = $userdata['user_id'];
- $change_avatar = ($custom_userdata === false) ? $auth->acl_get('u_chgavatar') : true;
- $avatar_select = basename(request_var('avatar_select', ''));
-
- // Can we upload?
- if (is_null($can_upload))
+ $err = group_validate_groupname($group_id, $name);
+ if (!empty($err))
{
- $can_upload = ($config['allow_avatar_upload'] && file_exists($phpbb_root_path . $config['avatar_path']) && phpbb_is_writable($phpbb_root_path . $config['avatar_path']) && $change_avatar && (@ini_get('file_uploads') || strtolower(@ini_get('file_uploads')) == 'on')) ? true : false;
+ $error[] = $user->lang[$err];
}
- if ((!empty($_FILES['uploadfile']['name']) || $data['uploadurl']) && $can_upload)
- {
- list($sql_ary['user_avatar_type'], $sql_ary['user_avatar'], $sql_ary['user_avatar_width'], $sql_ary['user_avatar_height']) = avatar_upload($data, $error);
- }
- else if ($data['remotelink'] && $change_avatar && $config['allow_avatar_remote'])
+ if (!in_array($type, array(GROUP_OPEN, GROUP_CLOSED, GROUP_HIDDEN, GROUP_SPECIAL, GROUP_FREE)))
{
- list($sql_ary['user_avatar_type'], $sql_ary['user_avatar'], $sql_ary['user_avatar_width'], $sql_ary['user_avatar_height']) = avatar_remote($data, $error);
+ $error[] = $user->lang['GROUP_ERR_TYPE'];
}
- else if ($avatar_select && $change_avatar && $config['allow_avatar_local'])
- {
- $category = basename(request_var('category', ''));
- $sql_ary['user_avatar_type'] = AVATAR_GALLERY;
- $sql_ary['user_avatar'] = $avatar_select;
+ $group_teampage = !empty($group_attributes['group_teampage']);
+ unset($group_attributes['group_teampage']);
- // check avatar gallery
- if (!is_dir($phpbb_root_path . $config['avatar_gallery_path'] . '/' . $category))
- {
- $sql_ary['user_avatar'] = '';
- $sql_ary['user_avatar_type'] = $sql_ary['user_avatar_width'] = $sql_ary['user_avatar_height'] = 0;
- }
- else
- {
- list($sql_ary['user_avatar_width'], $sql_ary['user_avatar_height']) = getimagesize($phpbb_root_path . $config['avatar_gallery_path'] . '/' . $category . '/' . urldecode($sql_ary['user_avatar']));
- $sql_ary['user_avatar'] = $category . '/' . $sql_ary['user_avatar'];
- }
- }
- else if (isset($_POST['delete']) && $change_avatar)
- {
- $sql_ary['user_avatar'] = '';
- $sql_ary['user_avatar_type'] = $sql_ary['user_avatar_width'] = $sql_ary['user_avatar_height'] = 0;
- }
- else if (!empty($userdata['user_avatar']))
+ if (!sizeof($error))
{
- // Only update the dimensions
+ $current_legend = \phpbb\groupposition\legend::GROUP_DISABLED;
+ $current_teampage = \phpbb\groupposition\teampage::GROUP_DISABLED;
- if (empty($data['width']) || empty($data['height']))
+ $legend = $phpbb_container->get('groupposition.legend');
+ $teampage = $phpbb_container->get('groupposition.teampage');
+ if ($group_id)
{
- if ($dims = avatar_get_dimensions($userdata['user_avatar'], $userdata['user_avatar_type'], $error, $data['width'], $data['height']))
+ try
{
- list($guessed_x, $guessed_y) = $dims;
- if (empty($data['width']))
- {
- $data['width'] = $guessed_x;
- }
- if (empty($data['height']))
- {
- $data['height'] = $guessed_y;
- }
+ $current_legend = $legend->get_group_value($group_id);
+ $current_teampage = $teampage->get_group_value($group_id);
}
- }
- if (($config['avatar_max_width'] || $config['avatar_max_height']) &&
- (($data['width'] != $userdata['user_avatar_width']) || $data['height'] != $userdata['user_avatar_height']))
- {
- if ($data['width'] > $config['avatar_max_width'] || $data['height'] > $config['avatar_max_height'])
+ catch (\phpbb\groupposition\exception $exception)
{
- $error[] = sprintf($user->lang['AVATAR_WRONG_SIZE'], $config['avatar_min_width'], $config['avatar_min_height'], $config['avatar_max_width'], $config['avatar_max_height'], $data['width'], $data['height']);
+ trigger_error($user->lang($exception->getMessage()));
}
}
- if (!sizeof($error))
+ if (!empty($group_attributes['group_legend']))
{
- if ($config['avatar_min_width'] || $config['avatar_min_height'])
+ if (($group_id && ($current_legend == \phpbb\groupposition\legend::GROUP_DISABLED)) || !$group_id)
{
- if ($data['width'] < $config['avatar_min_width'] || $data['height'] < $config['avatar_min_height'])
- {
- $error[] = sprintf($user->lang['AVATAR_WRONG_SIZE'], $config['avatar_min_width'], $config['avatar_min_height'], $config['avatar_max_width'], $config['avatar_max_height'], $data['width'], $data['height']);
- }
+ // Old group currently not in the legend or new group, add at the end.
+ $group_attributes['group_legend'] = 1 + $legend->get_group_count();
+ }
+ else
+ {
+ // Group stayes in the legend
+ $group_attributes['group_legend'] = $current_legend;
}
}
-
- if (!sizeof($error))
+ else if ($group_id && ($current_legend != \phpbb\groupposition\legend::GROUP_DISABLED))
{
- $sql_ary['user_avatar_width'] = $data['width'];
- $sql_ary['user_avatar_height'] = $data['height'];
- }
- }
-
- if (!sizeof($error))
- {
- // Do we actually have any data to update?
- if (sizeof($sql_ary))
- {
- $ext_new = $ext_old = '';
- if (isset($sql_ary['user_avatar']))
+ // Group is removed from the legend
+ try
{
- $userdata = ($custom_userdata === false) ? $user->data : $custom_userdata;
- $ext_new = (empty($sql_ary['user_avatar'])) ? '' : substr(strrchr($sql_ary['user_avatar'], '.'), 1);
- $ext_old = (empty($userdata['user_avatar'])) ? '' : substr(strrchr($userdata['user_avatar'], '.'), 1);
-
- if ($userdata['user_avatar_type'] == AVATAR_UPLOAD)
- {
- // Delete old avatar if present
- if ((!empty($userdata['user_avatar']) && empty($sql_ary['user_avatar']))
- || ( !empty($userdata['user_avatar']) && !empty($sql_ary['user_avatar']) && $ext_new !== $ext_old))
- {
- avatar_delete('user', $userdata);
- }
- }
+ $legend->delete_group($group_id, true);
}
-
- $sql = 'UPDATE ' . USERS_TABLE . '
- SET ' . $db->sql_build_array('UPDATE', $sql_ary) . '
- WHERE user_id = ' . (($custom_userdata === false) ? $user->data['user_id'] : $custom_userdata['user_id']);
- $db->sql_query($sql);
-
+ catch (\phpbb\groupposition\exception $exception)
+ {
+ trigger_error($user->lang($exception->getMessage()));
+ }
+ $group_attributes['group_legend'] = \phpbb\groupposition\legend::GROUP_DISABLED;
+ }
+ else
+ {
+ $group_attributes['group_legend'] = \phpbb\groupposition\legend::GROUP_DISABLED;
}
- }
-
- return (sizeof($error)) ? false : true;
-}
-
-//
-// Usergroup functions
-//
-
-/**
-* Add or edit a group. If we're editing a group we only update user
-* parameters such as rank, etc. if they are changed
-*/
-function group_create(&$group_id, $type, $name, $desc, $group_attributes, $allow_desc_bbcode = false, $allow_desc_urls = false, $allow_desc_smilies = false)
-{
- global $phpbb_root_path, $config, $db, $user, $file_upload;
-
- $error = array();
-
- // Attributes which also affect the users table
- $user_attribute_ary = array('group_colour', 'group_rank', 'group_avatar', 'group_avatar_type', 'group_avatar_width', 'group_avatar_height');
-
- // Check data. Limit group name length.
- if (!utf8_strlen($name) || utf8_strlen($name) > 60)
- {
- $error[] = (!utf8_strlen($name)) ? $user->lang['GROUP_ERR_USERNAME'] : $user->lang['GROUP_ERR_USER_LONG'];
- }
-
- $err = group_validate_groupname($group_id, $name);
- if (!empty($err))
- {
- $error[] = $user->lang[$err];
- }
- if (!in_array($type, array(GROUP_OPEN, GROUP_CLOSED, GROUP_HIDDEN, GROUP_SPECIAL, GROUP_FREE)))
- {
- $error[] = $user->lang['GROUP_ERR_TYPE'];
- }
+ // Unset the objects, we don't need them anymore.
+ unset($legend);
- if (!sizeof($error))
- {
$user_ary = array();
$sql_ary = array(
'group_name' => (string) $name,
@@ -2530,12 +2431,12 @@ function group_create(&$group_id, $type, $name, $desc, $group_attributes, $allow
}
$db->sql_freeresult($result);
- if (isset($sql_ary['group_avatar']) && !$sql_ary['group_avatar'])
+ if (isset($sql_ary['group_avatar']))
{
remove_default_avatar($group_id, $user_ary);
}
- if (isset($sql_ary['group_rank']) && !$sql_ary['group_rank'])
+ if (isset($sql_ary['group_rank']))
{
remove_default_rank($group_id, $user_ary);
}
@@ -2583,16 +2484,55 @@ function group_create(&$group_id, $type, $name, $desc, $group_attributes, $allow
$db->sql_query($sql);
}
+ // Remove the group from the teampage, only if unselected and we are editing a group,
+ // which is currently displayed.
+ if (!$group_teampage && $group_id && $current_teampage != \phpbb\groupposition\teampage::GROUP_DISABLED)
+ {
+ try
+ {
+ $teampage->delete_group($group_id);
+ }
+ catch (\phpbb\groupposition\exception $exception)
+ {
+ trigger_error($user->lang($exception->getMessage()));
+ }
+ }
+
if (!$group_id)
{
$group_id = $db->sql_nextid();
- if (isset($sql_ary['group_avatar_type']) && $sql_ary['group_avatar_type'] == AVATAR_UPLOAD)
+ if (isset($sql_ary['group_avatar_type']) && $sql_ary['group_avatar_type'] == 'avatar.driver.upload')
{
group_correct_avatar($group_id, $sql_ary['group_avatar']);
}
}
+ try
+ {
+ if ($group_teampage && $current_teampage == \phpbb\groupposition\teampage::GROUP_DISABLED)
+ {
+ $teampage->add_group($group_id);
+ }
+
+ if ($group_teampage)
+ {
+ if ($current_teampage == \phpbb\groupposition\teampage::GROUP_DISABLED)
+ {
+ $teampage->add_group($group_id);
+ }
+ }
+ else if ($group_id && ($current_teampage != \phpbb\groupposition\teampage::GROUP_DISABLED))
+ {
+ $teampage->delete_group($group_id);
+ }
+ }
+ catch (\phpbb\groupposition\exception $exception)
+ {
+ trigger_error($user->lang($exception->getMessage()));
+ }
+ unset($teampage);
+
// Set user attributes
$sql_ary = array();
if (sizeof($group_attributes))
@@ -2637,7 +2577,7 @@ function group_correct_avatar($group_id, $old_entry)
{
global $config, $db, $phpbb_root_path;
- $group_id = (int)$group_id;
+ $group_id = (int) $group_id;
$ext = substr(strrchr($old_entry, '.'), 1);
$old_filename = get_avatar_filename($old_entry);
$new_filename = $config['avatar_salt'] . "_g$group_id.$ext";
@@ -2663,7 +2603,7 @@ function avatar_remove_db($avatar_name)
$sql = 'UPDATE ' . USERS_TABLE . "
SET user_avatar = '',
- user_avatar_type = 0
+ user_avatar_type = ''
WHERE user_avatar = '" . $db->sql_escape($avatar_name) . '\'';
$db->sql_query($sql);
}
@@ -2674,7 +2614,7 @@ function avatar_remove_db($avatar_name)
*/
function group_delete($group_id, $group_name = false)
{
- global $db, $phpbb_root_path, $phpEx;
+ global $db, $cache, $auth, $user, $phpbb_root_path, $phpEx, $phpbb_dispatcher, $phpbb_container;
if (!$group_name)
{
@@ -2715,6 +2655,33 @@ function group_delete($group_id, $group_name = false)
}
while ($start);
+ // Delete group from legend and teampage
+ try
+ {
+ $legend = $phpbb_container->get('groupposition.legend');
+ $legend->delete_group($group_id);
+ unset($legend);
+ }
+ catch (\phpbb\groupposition\exception $exception)
+ {
+ // The group we want to delete does not exist.
+ // No reason to worry, we just continue the deleting process.
+ //trigger_error($user->lang($exception->getMessage()));
+ }
+
+ try
+ {
+ $teampage = $phpbb_container->get('groupposition.teampage');
+ $teampage->delete_group($group_id);
+ unset($teampage);
+ }
+ catch (\phpbb\groupposition\exception $exception)
+ {
+ // The group we want to delete does not exist.
+ // No reason to worry, we just continue the deleting process.
+ //trigger_error($user->lang($exception->getMessage()));
+ }
+
// Delete group
$sql = 'DELETE FROM ' . GROUPS_TABLE . "
WHERE group_id = $group_id";
@@ -2725,13 +2692,24 @@ function group_delete($group_id, $group_name = false)
WHERE group_id = $group_id";
$db->sql_query($sql);
+ /**
+ * Event after a group is deleted
+ *
+ * @event core.delete_group_after
+ * @var int group_id ID of the deleted group
+ * @var string group_name Name of the deleted group
+ * @since 3.1.0-a1
+ */
+ $vars = array('group_id', 'group_name');
+ extract($phpbb_dispatcher->trigger_event('core.delete_group_after', compact($vars)));
+
// Re-cache moderators
- if (!function_exists('cache_moderators'))
+ if (!function_exists('phpbb_cache_moderators'))
{
include($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
}
- cache_moderators();
+ phpbb_cache_moderators($db, $cache, $auth);
add_log('admin', 'LOG_GROUP_DELETE', $group_name);
@@ -2746,7 +2724,7 @@ function group_delete($group_id, $group_name = false)
*/
function group_user_add($group_id, $user_id_ary = false, $username_ary = false, $group_name = false, $default = false, $leader = 0, $pending = 0, $group_attributes = false)
{
- global $db, $auth;
+ global $db, $auth, $phpbb_container, $phpbb_dispatcher;
// We need both username and user_id info
$result = user_get_id_name($user_id_ary, $username_ary);
@@ -2823,6 +2801,26 @@ function group_user_add($group_id, $user_id_ary = false, $username_ary = false,
// Clear permissions cache of relevant users
$auth->acl_clear_prefetch($user_id_ary);
+ /**
+ * Event after users are added to a group
+ *
+ * @event core.group_add_user_after
+ * @var int group_id ID of the group to which users are added
+ * @var string group_name Name of the group
+ * @var array user_id_ary IDs of the users which are added
+ * @var array username_ary names of the users which are added
+ * @var int pending Pending setting, 1 if user(s) added are pending
+ * @since 3.1.7-RC1
+ */
+ $vars = array(
+ 'group_id',
+ 'group_name',
+ 'user_id_ary',
+ 'username_ary',
+ 'pending',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.group_add_user_after', compact($vars)));
+
if (!$group_name)
{
$group_name = get_group_name($group_id);
@@ -2834,6 +2832,20 @@ function group_user_add($group_id, $user_id_ary = false, $username_ary = false,
group_update_listings($group_id);
+ if ($pending)
+ {
+ $phpbb_notifications = $phpbb_container->get('notification_manager');
+
+ foreach ($add_id_ary as $user_id)
+ {
+ $phpbb_notifications->add_notifications('notification.type.group_request', array(
+ 'group_id' => $group_id,
+ 'user_id' => $user_id,
+ 'group_name' => $group_name,
+ ));
+ }
+ }
+
// Return false - no error
return false;
}
@@ -2845,9 +2857,9 @@ function group_user_add($group_id, $user_id_ary = false, $username_ary = false,
*
* @return false if no errors occurred, else the user lang string for the relevant error, for example 'NO_USER'
*/
-function group_user_del($group_id, $user_id_ary = false, $username_ary = false, $group_name = false)
+function group_user_del($group_id, $user_id_ary = false, $username_ary = false, $group_name = false, $log_action = true)
{
- global $db, $auth, $config;
+ global $db, $auth, $config, $phpbb_dispatcher, $phpbb_container;
if ($config['coppa_enable'])
{
@@ -2946,6 +2958,19 @@ function group_user_del($group_id, $user_id_ary = false, $username_ary = false,
}
unset($special_group_data);
+ /**
+ * Event before users are removed from a group
+ *
+ * @event core.group_delete_user_before
+ * @var int group_id ID of the group from which users are deleted
+ * @var string group_name Name of the group
+ * @var array user_id_ary IDs of the users which are removed
+ * @var array username_ary names of the users which are removed
+ * @since 3.1.0-a1
+ */
+ $vars = array('group_id', 'group_name', 'user_id_ary', 'username_ary');
+ extract($phpbb_dispatcher->trigger_event('core.group_delete_user_before', compact($vars)));
+
$sql = 'DELETE FROM ' . USER_GROUP_TABLE . "
WHERE group_id = $group_id
AND " . $db->sql_in_set('user_id', $user_id_ary);
@@ -2954,20 +2979,40 @@ function group_user_del($group_id, $user_id_ary = false, $username_ary = false,
// Clear permissions cache of relevant users
$auth->acl_clear_prefetch($user_id_ary);
- if (!$group_name)
+ /**
+ * Event after users are removed from a group
+ *
+ * @event core.group_delete_user_after
+ * @var int group_id ID of the group from which users are deleted
+ * @var string group_name Name of the group
+ * @var array user_id_ary IDs of the users which are removed
+ * @var array username_ary names of the users which are removed
+ * @since 3.1.7-RC1
+ */
+ $vars = array('group_id', 'group_name', 'user_id_ary', 'username_ary');
+ extract($phpbb_dispatcher->trigger_event('core.group_delete_user_after', compact($vars)));
+
+ if ($log_action)
{
- $group_name = get_group_name($group_id);
- }
+ if (!$group_name)
+ {
+ $group_name = get_group_name($group_id);
+ }
- $log = 'LOG_GROUP_REMOVE';
+ $log = 'LOG_GROUP_REMOVE';
- if ($group_name)
- {
- add_log('admin', $log, $group_name, implode(', ', $username_ary));
+ if ($group_name)
+ {
+ add_log('admin', $log, $group_name, implode(', ', $username_ary));
+ }
}
group_update_listings($group_id);
+ $phpbb_notifications = $phpbb_container->get('notification_manager');
+
+ $phpbb_notifications->delete_notifications('notification.type.group_request', $user_id_ary, $group_id);
+
// Return false - no error
return false;
}
@@ -2993,7 +3038,7 @@ function remove_default_avatar($group_id, $user_ids)
$sql = 'SELECT *
FROM ' . GROUPS_TABLE . '
- WHERE group_id = ' . (int)$group_id;
+ WHERE group_id = ' . (int) $group_id;
$result = $db->sql_query($sql);
if (!$row = $db->sql_fetchrow($result))
{
@@ -3004,12 +3049,12 @@ function remove_default_avatar($group_id, $user_ids)
$sql = 'UPDATE ' . USERS_TABLE . "
SET user_avatar = '',
- user_avatar_type = 0,
+ user_avatar_type = '',
user_avatar_width = 0,
user_avatar_height = 0
WHERE group_id = " . (int) $group_id . "
- AND user_avatar = '" . $db->sql_escape($row['group_avatar']) . "'
- AND " . $db->sql_in_set('user_id', $user_ids);
+ AND user_avatar = '" . $db->sql_escape($row['group_avatar']) . "'
+ AND " . $db->sql_in_set('user_id', $user_ids);
$db->sql_query($sql);
}
@@ -3034,7 +3079,7 @@ function remove_default_rank($group_id, $user_ids)
$sql = 'SELECT *
FROM ' . GROUPS_TABLE . '
- WHERE group_id = ' . (int)$group_id;
+ WHERE group_id = ' . (int) $group_id;
$result = $db->sql_query($sql);
if (!$row = $db->sql_fetchrow($result))
{
@@ -3045,10 +3090,10 @@ function remove_default_rank($group_id, $user_ids)
$sql = 'UPDATE ' . USERS_TABLE . '
SET user_rank = 0
- WHERE group_id = ' . (int)$group_id . '
- AND user_rank <> 0
- AND user_rank = ' . (int)$row['group_rank'] . '
- AND ' . $db->sql_in_set('user_id', $user_ids);
+ WHERE group_id = ' . (int) $group_id . '
+ AND user_rank <> 0
+ AND user_rank = ' . (int) $row['group_rank'] . '
+ AND ' . $db->sql_in_set('user_id', $user_ids);
$db->sql_query($sql);
}
@@ -3057,7 +3102,7 @@ function remove_default_rank($group_id, $user_ids)
*/
function group_user_attributes($action, $group_id, $user_id_ary = false, $username_ary = false, $group_name = false, $group_attributes = false)
{
- global $db, $auth, $phpbb_root_path, $phpEx, $config;
+ global $db, $auth, $phpbb_root_path, $phpEx, $config, $phpbb_container, $phpbb_dispatcher;
// We need both username and user_id info
$result = user_get_id_name($user_id_ary, $username_ary);
@@ -3077,7 +3122,8 @@ function group_user_attributes($action, $group_id, $user_id_ary = false, $userna
case 'demote':
case 'promote':
- $sql = 'SELECT user_id FROM ' . USER_GROUP_TABLE . "
+ $sql = 'SELECT user_id
+ FROM ' . USER_GROUP_TABLE . "
WHERE group_id = $group_id
AND user_pending = 1
AND " . $db->sql_in_set('user_id', $user_id_ary);
@@ -3109,11 +3155,10 @@ function group_user_attributes($action, $group_id, $user_id_ary = false, $userna
AND ' . $db->sql_in_set('ug.user_id', $user_id_ary);
$result = $db->sql_query($sql);
- $user_id_ary = $email_users = array();
+ $user_id_ary = array();
while ($row = $db->sql_fetchrow($result))
{
$user_id_ary[] = $row['user_id'];
- $email_users[] = $row;
}
$db->sql_freeresult($result);
@@ -3128,27 +3173,14 @@ function group_user_attributes($action, $group_id, $user_id_ary = false, $userna
AND " . $db->sql_in_set('user_id', $user_id_ary);
$db->sql_query($sql);
- // Send approved email to users...
- include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);
- $messenger = new messenger();
+ $phpbb_notifications = $phpbb_container->get('notification_manager');
- foreach ($email_users as $row)
- {
- $messenger->template('group_approved', $row['user_lang']);
-
- $messenger->to($row['user_email'], $row['username']);
- $messenger->im($row['user_jabber'], $row['username']);
-
- $messenger->assign_vars(array(
- 'USERNAME' => htmlspecialchars_decode($row['username']),
- 'GROUP_NAME' => htmlspecialchars_decode($group_name),
- 'U_GROUP' => generate_board_url() . "/ucp.$phpEx?i=groups&mode=membership")
- );
-
- $messenger->send($row['user_notify_type']);
- }
-
- $messenger->save_queue();
+ $phpbb_notifications->add_notifications('notification.type.group_request_approved', array(
+ 'user_ids' => $user_id_ary,
+ 'group_id' => $group_id,
+ 'group_name' => $group_name,
+ ));
+ $phpbb_notifications->delete_notifications('notification.type.group_request', $user_id_ary, $group_id);
$log = 'LOG_USERS_APPROVED';
break;
@@ -3175,7 +3207,8 @@ function group_user_attributes($action, $group_id, $user_id_ary = false, $userna
return 'NO_USERS';
}
- $sql = 'SELECT user_id, group_id FROM ' . USERS_TABLE . '
+ $sql = 'SELECT user_id, group_id
+ FROM ' . USERS_TABLE . '
WHERE ' . $db->sql_in_set('user_id', $user_id_ary, false, true);
$result = $db->sql_query($sql);
@@ -3200,6 +3233,28 @@ function group_user_attributes($action, $group_id, $user_id_ary = false, $userna
break;
}
+ /**
+ * Event to perform additional actions on setting user group attributes
+ *
+ * @event core.user_set_group_attributes
+ * @var int group_id ID of the group
+ * @var string group_name Name of the group
+ * @var array user_id_ary IDs of the users to set group attributes
+ * @var array username_ary Names of the users to set group attributes
+ * @var array group_attributes Group attributes which were changed
+ * @var string action Action to perform over the group members
+ * @since 3.1.10-RC1
+ */
+ $vars = array(
+ 'group_id',
+ 'group_name',
+ 'user_id_ary',
+ 'username_ary',
+ 'group_attributes',
+ 'action',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.user_set_group_attributes', compact($vars)));
+
// Clear permissions cache of relevant users
$auth->acl_clear_prefetch($user_id_ary);
@@ -3263,7 +3318,7 @@ function group_validate_groupname($group_id, $group_name)
*/
function group_set_user_default($group_id, $user_id_ary, $group_attributes = false, $update_listing = false)
{
- global $cache, $db;
+ global $phpbb_container, $db, $phpbb_dispatcher;
if (empty($user_id_ary))
{
@@ -3274,7 +3329,7 @@ function group_set_user_default($group_id, $user_id_ary, $group_attributes = fal
'group_colour' => 'string',
'group_rank' => 'int',
'group_avatar' => 'string',
- 'group_avatar_type' => 'int',
+ 'group_avatar_type' => 'string',
'group_avatar_width' => 'int',
'group_avatar_height' => 'int',
);
@@ -3309,45 +3364,69 @@ function group_set_user_default($group_id, $user_id_ary, $group_attributes = fal
}
}
- // Before we update the user attributes, we will make a list of those having now the group avatar assigned
- if (isset($sql_ary['user_avatar']))
+ $updated_sql_ary = $sql_ary;
+
+ // Before we update the user attributes, we will update the rank for users that don't have a custom rank
+ if (isset($sql_ary['user_rank']))
{
- // Ok, get the original avatar data from users having an uploaded one (we need to remove these from the filesystem)
- $sql = 'SELECT user_id, group_id, user_avatar
- FROM ' . USERS_TABLE . '
- WHERE ' . $db->sql_in_set('user_id', $user_id_ary) . '
- AND user_avatar_type = ' . AVATAR_UPLOAD;
- $result = $db->sql_query($sql);
+ $sql = 'UPDATE ' . USERS_TABLE . '
+ SET ' . $db->sql_build_array('UPDATE', array('user_rank' => $sql_ary['user_rank'])) . '
+ WHERE user_rank = 0
+ AND ' . $db->sql_in_set('user_id', $user_id_ary);
+ $db->sql_query($sql);
+ unset($sql_ary['user_rank']);
+ }
- while ($row = $db->sql_fetchrow($result))
+ // Before we update the user attributes, we will update the avatar for users that don't have a custom avatar
+ $avatar_options = array('user_avatar', 'user_avatar_type', 'user_avatar_height', 'user_avatar_width');
+
+ if (isset($sql_ary['user_avatar']))
+ {
+ $avatar_sql_ary = array();
+ foreach ($avatar_options as $avatar_option)
{
- avatar_delete('user', $row);
- }
- $db->sql_freeresult($result);
+ if (isset($sql_ary[$avatar_option]))
+ {
+ $avatar_sql_ary[$avatar_option] = $sql_ary[$avatar_option];
+ }
+ }
+
+ $sql = 'UPDATE ' . USERS_TABLE . '
+ SET ' . $db->sql_build_array('UPDATE', $avatar_sql_ary) . "
+ WHERE user_avatar = ''
+ AND " . $db->sql_in_set('user_id', $user_id_ary);
+ $db->sql_query($sql);
}
- else
+
+ // Remove the avatar options, as we already updated them
+ foreach ($avatar_options as $avatar_option)
{
- unset($sql_ary['user_avatar_type']);
- unset($sql_ary['user_avatar_height']);
- unset($sql_ary['user_avatar_width']);
+ unset($sql_ary[$avatar_option]);
}
- $sql = 'UPDATE ' . USERS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . '
- WHERE ' . $db->sql_in_set('user_id', $user_id_ary);
- $db->sql_query($sql);
+ if (!empty($sql_ary))
+ {
+ $sql = 'UPDATE ' . USERS_TABLE . '
+ SET ' . $db->sql_build_array('UPDATE', $sql_ary) . '
+ WHERE ' . $db->sql_in_set('user_id', $user_id_ary);
+ $db->sql_query($sql);
+ }
if (isset($sql_ary['user_colour']))
{
// Update any cached colour information for these users
- $sql = 'UPDATE ' . FORUMS_TABLE . " SET forum_last_poster_colour = '" . $db->sql_escape($sql_ary['user_colour']) . "'
+ $sql = 'UPDATE ' . FORUMS_TABLE . "
+ SET forum_last_poster_colour = '" . $db->sql_escape($sql_ary['user_colour']) . "'
WHERE " . $db->sql_in_set('forum_last_poster_id', $user_id_ary);
$db->sql_query($sql);
- $sql = 'UPDATE ' . TOPICS_TABLE . " SET topic_first_poster_colour = '" . $db->sql_escape($sql_ary['user_colour']) . "'
+ $sql = 'UPDATE ' . TOPICS_TABLE . "
+ SET topic_first_poster_colour = '" . $db->sql_escape($sql_ary['user_colour']) . "'
WHERE " . $db->sql_in_set('topic_poster', $user_id_ary);
$db->sql_query($sql);
- $sql = 'UPDATE ' . TOPICS_TABLE . " SET topic_last_poster_colour = '" . $db->sql_escape($sql_ary['user_colour']) . "'
+ $sql = 'UPDATE ' . TOPICS_TABLE . "
+ SET topic_last_poster_colour = '" . $db->sql_escape($sql_ary['user_colour']) . "'
WHERE " . $db->sql_in_set('topic_last_poster_id', $user_id_ary);
$db->sql_query($sql);
@@ -3359,13 +3438,30 @@ function group_set_user_default($group_id, $user_id_ary, $group_attributes = fal
}
}
+ // Make all values available for the event
+ $sql_ary = $updated_sql_ary;
+
+ /**
+ * Event when the default group is set for an array of users
+ *
+ * @event core.user_set_default_group
+ * @var int group_id ID of the group
+ * @var array user_id_ary IDs of the users
+ * @var array group_attributes Group attributes which were changed
+ * @var array update_listing Update the list of moderators and foes
+ * @var array sql_ary User attributes which were changed
+ * @since 3.1.0-a1
+ */
+ $vars = array('group_id', 'user_id_ary', 'group_attributes', 'update_listing', 'sql_ary');
+ extract($phpbb_dispatcher->trigger_event('core.user_set_default_group', compact($vars)));
+
if ($update_listing)
{
group_update_listings($group_id);
}
// Because some tables/caches use usercolour-specific data we need to purge this here.
- $cache->destroy('sql', MODERATOR_CACHE_TABLE);
+ $phpbb_container->get('cache.driver')->destroy('sql', MODERATOR_CACHE_TABLE);
}
/**
@@ -3464,7 +3560,7 @@ function group_memberships($group_id_ary = false, $user_id_ary = false, $return_
*/
function group_update_listings($group_id)
{
- global $auth;
+ global $db, $cache, $auth;
$hold_ary = $auth->acl_group_raw_data($group_id, array('a_', 'm_'));
@@ -3506,22 +3602,22 @@ function group_update_listings($group_id)
if ($mod_permissions)
{
- if (!function_exists('cache_moderators'))
+ if (!function_exists('phpbb_cache_moderators'))
{
global $phpbb_root_path, $phpEx;
include($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
}
- cache_moderators();
+ phpbb_cache_moderators($db, $cache, $auth);
}
if ($mod_permissions || $admin_permissions)
{
- if (!function_exists('update_foes'))
+ if (!function_exists('phpbb_update_foes'))
{
global $phpbb_root_path, $phpEx;
include($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
}
- update_foes(array($group_id));
+ phpbb_update_foes($db, $auth, array($group_id));
}
}
@@ -3574,8 +3670,8 @@ function remove_newly_registered($user_id, $user_data = false)
}
// We need to call group_user_del here, because this function makes sure everything is correctly changed.
- // A downside for a call within the session handler is that the language is not set up yet - so no log entry
- group_user_del($group_id, $user_id);
+ // Force function to not log the removal of users from newly registered users group
+ group_user_del($group_id, $user_id, false, false, false);
// Set user_new to 0 to let this not be triggered again
$sql = 'UPDATE ' . USERS_TABLE . '
@@ -3603,9 +3699,12 @@ function remove_newly_registered($user_id, $user_data = false)
*
* @param array $user_ids Array of users' ids to check for banning,
* leave empty to get complete list of banned ids
+* @param bool|int $ban_end Bool True to get users currently banned
+* Bool False to only get permanently banned users
+* Int Unix timestamp to get users banned until that time
* @return array Array of banned users' ids if any, empty array otherwise
*/
-function phpbb_get_banned_user_ids($user_ids = array())
+function phpbb_get_banned_user_ids($user_ids = array(), $ban_end = true)
{
global $db;
@@ -3617,9 +3716,26 @@ function phpbb_get_banned_user_ids($user_ids = array())
$sql = 'SELECT ban_userid
FROM ' . BANLIST_TABLE . "
WHERE $sql_user_ids
- AND ban_exclude <> 1
- AND (ban_end > " . time() . '
+ AND ban_exclude <> 1";
+
+ if ($ban_end === true)
+ {
+ // Banned currently
+ $sql .= " AND (ban_end > " . time() . '
OR ban_end = 0)';
+ }
+ else if ($ban_end === false)
+ {
+ // Permanently banned
+ $sql .= " AND ban_end = 0";
+ }
+ else
+ {
+ // Banned until a specified time
+ $sql .= " AND (ban_end > " . (int) $ban_end . '
+ OR ban_end = 0)';
+ }
+
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result))
{
@@ -3631,4 +3747,22 @@ function phpbb_get_banned_user_ids($user_ids = array())
return $banned_ids_list;
}
-?>
+/**
+* Function for assigning a template var if the zebra module got included
+*/
+function phpbb_module_zebra($mode, &$module_row)
+{
+ global $template;
+
+ $template->assign_var('S_ZEBRA_ENABLED', true);
+
+ if ($mode == 'friends')
+ {
+ $template->assign_var('S_ZEBRA_FRIENDS_ENABLED', true);
+ }
+
+ if ($mode == 'foes')
+ {
+ $template->assign_var('S_ZEBRA_FOES_ENABLED', true);
+ }
+}
diff --git a/phpBB/includes/hooks/index.php b/phpBB/includes/hooks/index.php
index aa85e63f32..805e0eea1a 100644
--- a/phpBB/includes/hooks/index.php
+++ b/phpBB/includes/hooks/index.php
@@ -1,10 +1,13 @@
<?php
/**
*
-* @package phpBB3
-* @version $Id$
-* @copyright (c) 2007 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -18,7 +21,6 @@ if (!defined('IN_PHPBB'))
/**
* phpBB Hook Class
-* @package phpBB3
*/
class phpbb_hook
{
@@ -246,5 +248,3 @@ class phpbb_hook
}
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/mcp/info/mcp_ban.php b/phpBB/includes/mcp/info/mcp_ban.php
index 383df30498..4aedbc8558 100644
--- a/phpBB/includes/mcp/info/mcp_ban.php
+++ b/phpBB/includes/mcp/info/mcp_ban.php
@@ -1,16 +1,16 @@
<?php
/**
*
-* @package mcp
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
-/**
-* @package module_install
-*/
class mcp_ban_info
{
function module()
@@ -35,5 +35,3 @@ class mcp_ban_info
{
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/mcp/info/mcp_logs.php b/phpBB/includes/mcp/info/mcp_logs.php
index fe2f9fa1d7..c6482c1255 100644
--- a/phpBB/includes/mcp/info/mcp_logs.php
+++ b/phpBB/includes/mcp/info/mcp_logs.php
@@ -1,16 +1,16 @@
<?php
/**
*
-* @package mcp
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
-/**
-* @package module_install
-*/
class mcp_logs_info
{
function module()
@@ -35,5 +35,3 @@ class mcp_logs_info
{
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/mcp/info/mcp_main.php b/phpBB/includes/mcp/info/mcp_main.php
index 9755cdfc07..81ccdbd1cd 100644
--- a/phpBB/includes/mcp/info/mcp_main.php
+++ b/phpBB/includes/mcp/info/mcp_main.php
@@ -1,16 +1,16 @@
<?php
/**
*
-* @package mcp
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
-/**
-* @package module_install
-*/
class mcp_main_info
{
function module()
@@ -36,5 +36,3 @@ class mcp_main_info
{
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/mcp/info/mcp_notes.php b/phpBB/includes/mcp/info/mcp_notes.php
index afe232e5b5..4b8c255fe2 100644
--- a/phpBB/includes/mcp/info/mcp_notes.php
+++ b/phpBB/includes/mcp/info/mcp_notes.php
@@ -1,16 +1,16 @@
<?php
/**
*
-* @package mcp
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
-/**
-* @package module_install
-*/
class mcp_notes_info
{
function module()
@@ -34,5 +34,3 @@ class mcp_notes_info
{
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/mcp/info/mcp_pm_reports.php b/phpBB/includes/mcp/info/mcp_pm_reports.php
index 84f15b7107..c80f3b86a3 100644
--- a/phpBB/includes/mcp/info/mcp_pm_reports.php
+++ b/phpBB/includes/mcp/info/mcp_pm_reports.php
@@ -1,16 +1,16 @@
<?php
/**
*
-* @package mcp
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
-/**
-* @package module_install
-*/
class mcp_pm_reports_info
{
function module()
@@ -20,9 +20,9 @@ class mcp_pm_reports_info
'title' => 'MCP_PM_REPORTS',
'version' => '1.0.0',
'modes' => array(
- 'pm_reports' => array('title' => 'MCP_PM_REPORTS_OPEN', 'auth' => 'aclf_m_report', 'cat' => array('MCP_REPORTS')),
- 'pm_reports_closed' => array('title' => 'MCP_PM_REPORTS_CLOSED', 'auth' => 'aclf_m_report', 'cat' => array('MCP_REPORTS')),
- 'pm_report_details' => array('title' => 'MCP_PM_REPORT_DETAILS', 'auth' => 'aclf_m_report', 'cat' => array('MCP_REPORTS')),
+ 'pm_reports' => array('title' => 'MCP_PM_REPORTS_OPEN', 'auth' => 'acl_m_pm_report', 'cat' => array('MCP_REPORTS')),
+ 'pm_reports_closed' => array('title' => 'MCP_PM_REPORTS_CLOSED', 'auth' => 'acl_m_pm_report', 'cat' => array('MCP_REPORTS')),
+ 'pm_report_details' => array('title' => 'MCP_PM_REPORT_DETAILS', 'auth' => 'acl_m_pm_report', 'cat' => array('MCP_REPORTS')),
),
);
}
@@ -35,5 +35,3 @@ class mcp_pm_reports_info
{
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/mcp/info/mcp_queue.php b/phpBB/includes/mcp/info/mcp_queue.php
index 7a256642b9..556c3902b0 100644
--- a/phpBB/includes/mcp/info/mcp_queue.php
+++ b/phpBB/includes/mcp/info/mcp_queue.php
@@ -1,16 +1,16 @@
<?php
/**
*
-* @package mcp
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
-/**
-* @package module_install
-*/
class mcp_queue_info
{
function module()
@@ -22,6 +22,8 @@ class mcp_queue_info
'modes' => array(
'unapproved_topics' => array('title' => 'MCP_QUEUE_UNAPPROVED_TOPICS', 'auth' => 'aclf_m_approve', 'cat' => array('MCP_QUEUE')),
'unapproved_posts' => array('title' => 'MCP_QUEUE_UNAPPROVED_POSTS', 'auth' => 'aclf_m_approve', 'cat' => array('MCP_QUEUE')),
+ 'deleted_topics' => array('title' => 'MCP_QUEUE_DELETED_TOPICS', 'auth' => 'aclf_m_approve', 'cat' => array('MCP_QUEUE')),
+ 'deleted_posts' => array('title' => 'MCP_QUEUE_DELETED_POSTS', 'auth' => 'aclf_m_approve', 'cat' => array('MCP_QUEUE')),
'approve_details' => array('title' => 'MCP_QUEUE_APPROVE_DETAILS', 'auth' => 'acl_m_approve,$id || (!$id && aclf_m_approve)', 'cat' => array('MCP_QUEUE')),
),
);
@@ -35,5 +37,3 @@ class mcp_queue_info
{
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/mcp/info/mcp_reports.php b/phpBB/includes/mcp/info/mcp_reports.php
index 3893ba5abb..31fee19d79 100644
--- a/phpBB/includes/mcp/info/mcp_reports.php
+++ b/phpBB/includes/mcp/info/mcp_reports.php
@@ -1,16 +1,16 @@
<?php
/**
*
-* @package mcp
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
-/**
-* @package module_install
-*/
class mcp_reports_info
{
function module()
@@ -35,5 +35,3 @@ class mcp_reports_info
{
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/mcp/info/mcp_warn.php b/phpBB/includes/mcp/info/mcp_warn.php
index 2b0b09f75a..d85499f280 100644
--- a/phpBB/includes/mcp/info/mcp_warn.php
+++ b/phpBB/includes/mcp/info/mcp_warn.php
@@ -1,16 +1,16 @@
<?php
/**
*
-* @package mcp
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
-/**
-* @package module_install
-*/
class mcp_warn_info
{
function module()
@@ -36,5 +36,3 @@ class mcp_warn_info
{
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/mcp/mcp_ban.php b/phpBB/includes/mcp/mcp_ban.php
index d9f5eb8f22..2f3405f915 100644
--- a/phpBB/includes/mcp/mcp_ban.php
+++ b/phpBB/includes/mcp/mcp_ban.php
@@ -1,10 +1,13 @@
<?php
/**
*
-* @package mcp
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -16,72 +19,150 @@ if (!defined('IN_PHPBB'))
exit;
}
-/**
-* @package mcp
-*/
class mcp_ban
{
var $u_action;
function main($id, $mode)
{
- global $config, $db, $user, $auth, $template, $cache;
+ global $db, $user, $auth, $template, $request, $phpbb_dispatcher;
global $phpbb_root_path, $phpEx;
- include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
+ if (!function_exists('user_ban'))
+ {
+ include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
+ }
// Include the admin banning interface...
include($phpbb_root_path . 'includes/acp/acp_ban.' . $phpEx);
- $bansubmit = (isset($_POST['bansubmit'])) ? true : false;
- $unbansubmit = (isset($_POST['unbansubmit'])) ? true : false;
- $current_time = time();
+ $bansubmit = $request->is_set_post('bansubmit');
+ $unbansubmit = $request->is_set_post('unbansubmit');
$user->add_lang(array('acp/ban', 'acp/users'));
$this->tpl_name = 'mcp_ban';
+ /**
+ * Use this event to pass perform actions when a ban is issued or revoked
+ *
+ * @event core.mcp_ban_main
+ * @var bool bansubmit True if a ban is issued
+ * @var bool unbansubmit True if a ban is removed
+ * @var string mode Mode of the ban that is being worked on
+ * @since 3.1.0-RC5
+ */
+ $vars = array(
+ 'bansubmit',
+ 'unbansubmit',
+ 'mode',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.mcp_ban_main', compact($vars)));
+
// Ban submitted?
if ($bansubmit)
{
// Grab the list of entries
- $ban = request_var('ban', '', ($mode === 'user') ? true : false);
-
- if ($mode === 'user')
- {
- $ban = utf8_normalize_nfc($ban);
- }
-
- $ban_len = request_var('banlength', 0);
- $ban_len_other = request_var('banlengthother', '');
- $ban_exclude = request_var('banexclude', 0);
- $ban_reason = utf8_normalize_nfc(request_var('banreason', '', true));
- $ban_give_reason = utf8_normalize_nfc(request_var('bangivereason', '', true));
+ $ban = $request->variable('ban', '', $mode === 'user');
+ $ban_length = $request->variable('banlength', 0);
+ $ban_length_other = $request->variable('banlengthother', '');
+ $ban_exclude = $request->variable('banexclude', 0);
+ $ban_reason = $request->variable('banreason', '', true);
+ $ban_give_reason = $request->variable('bangivereason', '', true);
if ($ban)
{
if (confirm_box(true))
{
- user_ban($mode, $ban, $ban_len, $ban_len_other, $ban_exclude, $ban_reason, $ban_give_reason);
+ $abort_ban = false;
+ /**
+ * Use this event to modify the ban details before the ban is performed
+ *
+ * @event core.mcp_ban_before
+ * @var string mode One of the following: user, ip, email
+ * @var string ban Either string or array with usernames, ips or email addresses
+ * @var int ban_length Ban length in minutes
+ * @var string ban_length_other Ban length as a date (YYYY-MM-DD)
+ * @var bool ban_exclude Are we banning or excluding from another ban
+ * @var string ban_reason Ban reason displayed to moderators
+ * @var string ban_give_reason Ban reason displayed to the banned user
+ * @var mixed abort_ban Either false, or an error message that is displayed to the user.
+ * If a string is given the bans are not issued.
+ * @since 3.1.0-RC5
+ */
+ $vars = array(
+ 'mode',
+ 'ban',
+ 'ban_length',
+ 'ban_length_other',
+ 'ban_exclude',
+ 'ban_reason',
+ 'ban_give_reason',
+ 'abort_ban',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.mcp_ban_before', compact($vars)));
+
+ if ($abort_ban)
+ {
+ trigger_error($abort_ban);
+ }
+ user_ban($mode, $ban, $ban_length, $ban_length_other, $ban_exclude, $ban_reason, $ban_give_reason);
+
+ /**
+ * Use this event to perform actions after the ban has been performed
+ *
+ * @event core.mcp_ban_after
+ * @var string mode One of the following: user, ip, email
+ * @var string ban Either string or array with usernames, ips or email addresses
+ * @var int ban_length Ban length in minutes
+ * @var string ban_length_other Ban length as a date (YYYY-MM-DD)
+ * @var bool ban_exclude Are we banning or excluding from another ban
+ * @var string ban_reason Ban reason displayed to moderators
+ * @var string ban_give_reason Ban reason displayed to the banned user
+ * @since 3.1.0-RC5
+ */
+ $vars = array(
+ 'mode',
+ 'ban',
+ 'ban_length',
+ 'ban_length_other',
+ 'ban_exclude',
+ 'ban_reason',
+ 'ban_give_reason',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.mcp_ban_after', compact($vars)));
trigger_error($user->lang['BAN_UPDATE_SUCCESSFUL'] . '<br /><br /><a href="' . $this->u_action . '">&laquo; ' . $user->lang['BACK_TO_PREV'] . '</a>');
}
else
{
- confirm_box(false, $user->lang['CONFIRM_OPERATION'], build_hidden_fields(array(
+ $hidden_fields = array(
'mode' => $mode,
'ban' => $ban,
'bansubmit' => true,
- 'banlength' => $ban_len,
- 'banlengthother' => $ban_len_other,
+ 'banlength' => $ban_length,
+ 'banlengthother' => $ban_length_other,
'banexclude' => $ban_exclude,
'banreason' => $ban_reason,
- 'bangivereason' => $ban_give_reason)));
+ 'bangivereason' => $ban_give_reason,
+ );
+
+ /**
+ * Use this event to pass data from the ban form to the confirmation screen
+ *
+ * @event core.mcp_ban_confirm
+ * @var array hidden_fields Hidden fields that are passed through the confirm screen
+ * @since 3.1.0-RC5
+ */
+ $vars = array('hidden_fields');
+ extract($phpbb_dispatcher->trigger_event('core.mcp_ban_confirm', compact($vars)));
+
+ confirm_box(false, $user->lang['CONFIRM_OPERATION'], build_hidden_fields($hidden_fields));
}
}
}
else if ($unbansubmit)
{
- $ban = request_var('unban', array(''));
+ $ban = $request->variable('unban', array(''));
if ($ban)
{
@@ -157,9 +238,9 @@ class mcp_ban
}
// As a "service" we will check if any post id is specified and populate the username of the poster id if given
- $post_id = request_var('p', 0);
- $user_id = request_var('u', 0);
- $username = $pre_fill = false;
+ $post_id = $request->variable('p', 0);
+ $user_id = $request->variable('u', 0);
+ $pre_fill = false;
if ($user_id && $user_id <> ANONYMOUS)
{
@@ -172,7 +253,7 @@ class mcp_ban
case 'user':
$pre_fill = (string) $db->sql_fetchfield('username');
break;
-
+
case 'ip':
$pre_fill = (string) $db->sql_fetchfield('user_ip');
break;
@@ -185,7 +266,7 @@ class mcp_ban
}
else if ($post_id)
{
- $post_info = get_post_data($post_id, 'm_ban');
+ $post_info = phpbb_get_post_data($post_id, 'm_ban');
if (sizeof($post_info) && !empty($post_info[$post_id]))
{
@@ -215,5 +296,3 @@ class mcp_ban
}
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/mcp/mcp_forum.php b/phpBB/includes/mcp/mcp_forum.php
index 04e0e70f1d..3deb58b96a 100644
--- a/phpBB/includes/mcp/mcp_forum.php
+++ b/phpBB/includes/mcp/mcp_forum.php
@@ -1,10 +1,13 @@
<?php
/**
*
-* @package mcp
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -23,6 +26,7 @@ function mcp_forum_view($id, $mode, $action, $forum_info)
{
global $template, $db, $user, $auth, $cache, $module;
global $phpEx, $phpbb_root_path, $config;
+ global $request, $phpbb_dispatcher, $phpbb_container;
$user->add_lang(array('viewtopic', 'viewforum'));
@@ -31,12 +35,6 @@ function mcp_forum_view($id, $mode, $action, $forum_info)
// merge_topic is the quickmod action, merge_topics is the mcp_forum action, and merge_select is the mcp_topic action
$merge_select = ($action == 'merge_select' || $action == 'merge_topic' || $action == 'merge_topics') ? true : false;
- if ($merge_select)
- {
- // Fixes a "bug" that makes forum_view use the same ordering as topic_view
- unset($_POST['sk'], $_POST['sd'], $_REQUEST['sk'], $_REQUEST['sd']);
- }
-
$forum_id = $forum_info['forum_id'];
$start = request_var('start', 0);
$topic_id_list = request_var('topic_id_list', array(0));
@@ -70,6 +68,32 @@ function mcp_forum_view($id, $mode, $action, $forum_info)
break;
}
+ /**
+ * Get some data in order to execute other actions.
+ *
+ * @event core.mcp_forum_view_before
+ * @var string action The action
+ * @var array forum_info Array with forum infos
+ * @var int start Start value
+ * @var array topic_id_list Array of topics ids
+ * @var array post_id_list Array of posts ids
+ * @var array source_topic_ids Array of source topics ids
+ * @var int to_topic_id Array of destination topics ids
+ * @since 3.1.6-RC1
+ */
+ $vars = array(
+ 'action',
+ 'forum_info',
+ 'start',
+ 'topic_id_list',
+ 'post_id_list',
+ 'source_topic_ids',
+ 'to_topic_id',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.mcp_forum_view_before', compact($vars)));
+
+ $pagination = $phpbb_container->get('pagination');
+
$selected_ids = '';
if (sizeof($post_id_list) && $action != 'merge_topics')
{
@@ -93,11 +117,14 @@ function mcp_forum_view($id, $mode, $action, $forum_info)
$sort_days = $total = 0;
$sort_key = $sort_dir = '';
$sort_by_sql = $sort_order_sql = array();
- mcp_sorting('viewforum', $sort_days, $sort_key, $sort_dir, $sort_by_sql, $sort_order_sql, $total, $forum_id);
+ phpbb_mcp_sorting('viewforum', $sort_days, $sort_key, $sort_dir, $sort_by_sql, $sort_order_sql, $total, $forum_id);
- $forum_topics = ($total == -1) ? $forum_info['forum_topics'] : $total;
+ $forum_topics = ($total == -1) ? $forum_info['forum_topics_approved'] : $total;
$limit_time_sql = ($sort_days) ? 'AND t.topic_last_post_time >= ' . (time() - ($sort_days * 86400)) : '';
+ $base_url = $url . "&amp;i=$id&amp;action=$action&amp;mode=$mode&amp;sd=$sort_dir&amp;sk=$sort_key&amp;st=$sort_days" . (($merge_select) ? $selected_ids : '');
+ $pagination->generate_template_pagination($base_url, 'pagination', 'start', $forum_topics, $topics_per_page, $start);
+
$template->assign_vars(array(
'ACTION' => $action,
'FORUM_NAME' => $forum_info['forum_name'],
@@ -110,6 +137,7 @@ function mcp_forum_view($id, $mode, $action, $forum_info)
'S_CAN_REPORT' => $auth->acl_get('m_report', $forum_id),
'S_CAN_DELETE' => $auth->acl_get('m_delete', $forum_id),
+ 'S_CAN_RESTORE' => $auth->acl_get('m_approve', $forum_id),
'S_CAN_MERGE' => $auth->acl_get('m_merge', $forum_id),
'S_CAN_MOVE' => $auth->acl_get('m_move', $forum_id),
'S_CAN_FORK' => $auth->acl_get('m_', $forum_id),
@@ -126,9 +154,7 @@ function mcp_forum_view($id, $mode, $action, $forum_info)
'S_MCP_ACTION' => $url . "&amp;i=$id&amp;forum_action=$action&amp;mode=$mode&amp;start=$start" . (($merge_select) ? $selected_ids : ''),
- 'PAGINATION' => generate_pagination($url . "&amp;i=$id&amp;action=$action&amp;mode=$mode&amp;sd=$sort_dir&amp;sk=$sort_key&amp;st=$sort_days" . (($merge_select) ? $selected_ids : ''), $forum_topics, $topics_per_page, $start),
- 'PAGE_NUMBER' => on_page($forum_topics, $topics_per_page, $start),
- 'TOTAL_TOPICS' => ($forum_topics == 1) ? $user->lang['VIEW_FORUM_TOPIC'] : sprintf($user->lang['VIEW_FORUM_TOPICS'], $forum_topics),
+ 'TOTAL_TOPICS' => $user->lang('VIEW_FORUM_TOPICS', (int) $forum_topics),
));
// Grab icons
@@ -146,12 +172,30 @@ function mcp_forum_view($id, $mode, $action, $forum_info)
$read_tracking_join = $read_tracking_select = '';
}
- $sql = "SELECT t.topic_id
- FROM " . TOPICS_TABLE . " t
- WHERE t.forum_id IN($forum_id, 0)
- " . (($auth->acl_get('m_approve', $forum_id)) ? '' : 'AND t.topic_approved = 1') . "
+ $phpbb_content_visibility = $phpbb_container->get('content.visibility');
+
+ $sql = 'SELECT t.topic_id
+ FROM ' . TOPICS_TABLE . ' t
+ WHERE t.forum_id = ' . $forum_id . '
+ AND ' . $phpbb_content_visibility->get_visibility_sql('topic', $forum_id, 't.') . "
$limit_time_sql
ORDER BY t.topic_type DESC, $sort_order_sql";
+
+ /**
+ * Modify SQL query before MCP forum view topic list is queried
+ *
+ * @event core.mcp_view_forum_modify_sql
+ * @var string sql SQL query for forum view topic list
+ * @var int forum_id ID of the forum
+ * @var string limit_time_sql SQL query part for limit time
+ * @var string sort_order_sql SQL query part for sort order
+ * @var int topics_per_page Number of topics per page
+ * @var int start Start value
+ * @since 3.1.2-RC1
+ */
+ $vars = array('sql', 'forum_id', 'limit_time_sql', 'sort_order_sql', 'topics_per_page', 'start');
+ extract($phpbb_dispatcher->trigger_event('core.mcp_view_forum_modify_sql', compact($vars)));
+
$result = $db->sql_query_limit($sql, $topics_per_page, $start);
$topic_list = $topic_tracking_info = array();
@@ -184,11 +228,11 @@ function mcp_forum_view($id, $mode, $action, $forum_info)
{
if ($config['load_db_lastread'])
{
- $topic_tracking_info = get_topic_tracking($forum_id, $topic_list, $topic_rows, array($forum_id => $forum_info['mark_time']), array());
+ $topic_tracking_info = get_topic_tracking($forum_id, $topic_list, $topic_rows, array($forum_id => $forum_info['mark_time']));
}
else
{
- $topic_tracking_info = get_complete_topic_tracking($forum_id, $topic_list, array());
+ $topic_tracking_info = get_complete_topic_tracking($forum_id, $topic_list);
}
}
@@ -198,7 +242,7 @@ function mcp_forum_view($id, $mode, $action, $forum_info)
$row = &$topic_rows[$topic_id];
- $replies = ($auth->acl_get('m_approve', $forum_id)) ? $row['topic_replies_real'] : $row['topic_replies'];
+ $replies = $phpbb_content_visibility->get_count('topic_posts', $row, $forum_id) - 1;
if ($row['topic_status'] == ITEM_MOVED)
{
@@ -215,18 +259,21 @@ function mcp_forum_view($id, $mode, $action, $forum_info)
$topic_title = censor_text($row['topic_title']);
- $topic_unapproved = (!$row['topic_approved'] && $auth->acl_get('m_approve', $row['forum_id'])) ? true : false;
- $posts_unapproved = ($row['topic_approved'] && $row['topic_replies'] < $row['topic_replies_real'] && $auth->acl_get('m_approve', $row['forum_id'])) ? true : false;
+ $topic_unapproved = (($row['topic_visibility'] == ITEM_UNAPPROVED || $row['topic_visibility'] == ITEM_REAPPROVE) && $auth->acl_get('m_approve', $row['forum_id'])) ? true : false;
+ $posts_unapproved = ($row['topic_visibility'] == ITEM_APPROVED && $row['topic_posts_unapproved'] && $auth->acl_get('m_approve', $row['forum_id'])) ? true : false;
+ $topic_deleted = $row['topic_visibility'] == ITEM_DELETED;
$u_mcp_queue = ($topic_unapproved || $posts_unapproved) ? $url . '&amp;i=queue&amp;mode=' . (($topic_unapproved) ? 'approve_details' : 'unapproved_posts') . '&amp;t=' . $row['topic_id'] : '';
+ $u_mcp_queue = (!$u_mcp_queue && $topic_deleted) ? $url . '&amp;i=queue&amp;mode=deleted_topics&amp;t=' . $topic_id : $u_mcp_queue;
$topic_row = array(
'ATTACH_ICON_IMG' => ($auth->acl_get('u_download') && $auth->acl_get('f_download', $row['forum_id']) && $row['topic_attachment']) ? $user->img('icon_topic_attach', $user->lang['TOTAL_ATTACHMENTS']) : '',
+ 'TOPIC_IMG_STYLE' => $folder_img,
'TOPIC_FOLDER_IMG' => $user->img($folder_img, $folder_alt),
- 'TOPIC_FOLDER_IMG_SRC' => $user->img($folder_img, $folder_alt, false, '', 'src'),
'TOPIC_ICON_IMG' => (!empty($icons[$row['icon_id']])) ? $icons[$row['icon_id']]['img'] : '',
'TOPIC_ICON_IMG_WIDTH' => (!empty($icons[$row['icon_id']])) ? $icons[$row['icon_id']]['width'] : '',
'TOPIC_ICON_IMG_HEIGHT' => (!empty($icons[$row['icon_id']])) ? $icons[$row['icon_id']]['height'] : '',
'UNAPPROVED_IMG' => ($topic_unapproved || $posts_unapproved) ? $user->img('icon_topic_unapproved', ($topic_unapproved) ? 'TOPIC_UNAPPROVED' : 'POSTS_UNAPPROVED') : '',
+ 'DELETED_IMG' => ($topic_deleted) ? $user->img('icon_topic_deleted', 'TOPIC_DELETED') : '',
'TOPIC_AUTHOR' => get_username_string('username', $row['topic_poster'], $row['topic_first_poster_name'], $row['topic_first_poster_colour']),
'TOPIC_AUTHOR_COLOUR' => get_username_string('colour', $row['topic_poster'], $row['topic_first_poster_name'], $row['topic_first_poster_colour']),
@@ -240,7 +287,7 @@ function mcp_forum_view($id, $mode, $action, $forum_info)
'TOPIC_TYPE' => $topic_type,
'TOPIC_TITLE' => $topic_title,
- 'REPLIES' => ($auth->acl_get('m_approve', $row['forum_id'])) ? $row['topic_replies_real'] : $row['topic_replies'],
+ 'REPLIES' => $phpbb_content_visibility->get_count('topic_posts', $row, $row['forum_id']) - 1,
'LAST_POST_TIME' => $user->format_date($row['topic_last_post_time']),
'FIRST_POST_TIME' => $user->format_date($row['topic_time']),
'LAST_POST_SUBJECT' => $row['topic_last_post_subject'],
@@ -249,6 +296,7 @@ function mcp_forum_view($id, $mode, $action, $forum_info)
'S_TOPIC_REPORTED' => (!empty($row['topic_reported']) && empty($row['topic_moved_id']) && $auth->acl_get('m_report', $row['forum_id'])) ? true : false,
'S_TOPIC_UNAPPROVED' => $topic_unapproved,
'S_POSTS_UNAPPROVED' => $posts_unapproved,
+ 'S_TOPIC_DELETED' => $topic_deleted,
'S_UNREAD_TOPIC' => $unread_topic,
);
@@ -283,6 +331,17 @@ function mcp_forum_view($id, $mode, $action, $forum_info)
));
}
+ /**
+ * Modify the topic data before it is assigned to the template in MCP
+ *
+ * @event core.mcp_view_forum_modify_topicrow
+ * @var array row Array with topic data
+ * @var array topic_row Template array with topic data
+ * @since 3.1.0-a1
+ */
+ $vars = array('row', 'topic_row');
+ extract($phpbb_dispatcher->trigger_event('core.mcp_view_forum_modify_topicrow', compact($vars)));
+
$template->assign_block_vars('topicrow', $topic_row);
}
unset($topic_rows);
@@ -300,7 +359,7 @@ function mcp_resync_topics($topic_ids)
trigger_error('NO_TOPIC_SELECTED');
}
- if (!check_ids($topic_ids, TOPICS_TABLE, 'topic_id', array('m_')))
+ if (!phpbb_check_ids($topic_ids, TOPICS_TABLE, 'topic_id', array('m_')))
{
return;
}
@@ -337,7 +396,7 @@ function mcp_resync_topics($topic_ids)
*/
function merge_topics($forum_id, $topic_ids, $to_topic_id)
{
- global $db, $template, $user, $phpEx, $phpbb_root_path, $auth;
+ global $db, $template, $user, $phpEx, $phpbb_root_path, $auth, $phpbb_dispatcher;
if (!sizeof($topic_ids))
{
@@ -350,15 +409,25 @@ function merge_topics($forum_id, $topic_ids, $to_topic_id)
return;
}
- $topic_data = get_topic_data(array($to_topic_id), 'm_merge');
+ $sync_topics = array_merge($topic_ids, array($to_topic_id));
+
+ $all_topic_data = phpbb_get_topic_data($sync_topics, 'm_merge');
- if (!sizeof($topic_data))
+ if (!sizeof($all_topic_data) || empty($all_topic_data[$to_topic_id]))
{
$template->assign_var('MESSAGE', $user->lang['NO_FINAL_TOPIC_SELECTED']);
return;
}
- $topic_data = $topic_data[$to_topic_id];
+ $sync_forums = array();
+ $topic_views = 0;
+ foreach ($all_topic_data as $data)
+ {
+ $sync_forums[$data['forum_id']] = $data['forum_id'];
+ $topic_views = max($topic_views, $data['topic_views']);
+ }
+
+ $to_topic_data = $all_topic_data[$to_topic_id];
$post_id_list = request_var('post_id_list', array(0));
$start = request_var('start', 0);
@@ -384,12 +453,12 @@ function merge_topics($forum_id, $topic_ids, $to_topic_id)
return;
}
- if (!check_ids($post_id_list, POSTS_TABLE, 'post_id', array('m_merge')))
+ if (!phpbb_check_ids($post_id_list, POSTS_TABLE, 'post_id', array('m_merge')))
{
return;
}
- $redirect = request_var('redirect', build_url(array('quickmod')));
+ $redirect = request_var('redirect', "{$phpbb_root_path}mcp.$phpEx?f=$forum_id&amp;i=main&amp;mode=forum_view");
$s_hidden_fields = build_hidden_fields(array(
'i' => 'main',
@@ -406,10 +475,16 @@ function merge_topics($forum_id, $topic_ids, $to_topic_id)
if (confirm_box(true))
{
- $to_forum_id = $topic_data['forum_id'];
+ $to_forum_id = $to_topic_data['forum_id'];
+
+ move_posts($post_id_list, $to_topic_id, false);
+ add_log('mod', $to_forum_id, $to_topic_id, 'LOG_MERGE', $to_topic_data['topic_title']);
- move_posts($post_id_list, $to_topic_id);
- add_log('mod', $to_forum_id, $to_topic_id, 'LOG_MERGE', $topic_data['topic_title']);
+ // Update topic views count
+ $sql = 'UPDATE ' . TOPICS_TABLE . '
+ SET topic_views = ' . $topic_views . '
+ WHERE topic_id = ' . $to_topic_id;
+ $db->sql_query($sql);
// Message and return links
$success_msg = 'POSTS_MERGED_SUCCESS';
@@ -425,26 +500,36 @@ function merge_topics($forum_id, $topic_ids, $to_topic_id)
// Update the bookmarks table.
phpbb_update_rows_avoiding_duplicates($db, BOOKMARKS_TABLE, 'topic_id', $topic_ids, $to_topic_id);
+ // Re-sync the topics and forums because the auto-sync was deactivated in the call of move_posts()
+ sync('topic_reported', 'topic_id', $sync_topics);
+ sync('topic_attachment', 'topic_id', $sync_topics);
+ sync('topic', 'topic_id', $sync_topics, true);
+ sync('forum', 'forum_id', $sync_forums, true, true);
+
// Link to the new topic
$return_link .= (($return_link) ? '<br /><br />' : '') . sprintf($user->lang['RETURN_NEW_TOPIC'], '<a href="' . append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $to_forum_id . '&amp;t=' . $to_topic_id) . '">', '</a>');
- }
- else
- {
- confirm_box(false, 'MERGE_TOPICS', $s_hidden_fields);
- }
-
- $redirect = request_var('redirect', "index.$phpEx");
- $redirect = reapply_sid($redirect);
+ $redirect = request_var('redirect', "{$phpbb_root_path}viewtopic.$phpEx?f=$to_forum_id&amp;t=$to_topic_id");
+ $redirect = reapply_sid($redirect);
+
+ /**
+ * Perform additional actions after merging topics.
+ *
+ * @event core.mcp_forum_merge_topics_after
+ * @var array all_topic_data The data from all topics involved in the merge
+ * @var int to_topic_id The ID of the topic into which the rest are merged
+ * @since 3.1.11-RC1
+ */
+ $vars = array(
+ 'all_topic_data',
+ 'to_topic_id',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.mcp_forum_merge_topics_after', compact($vars)));
- if (!$success_msg)
- {
- return;
+ meta_refresh(3, $redirect);
+ trigger_error($user->lang[$success_msg] . '<br /><br />' . $return_link);
}
else
{
- meta_refresh(3, append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$to_forum_id&amp;t=$to_topic_id"));
- trigger_error($user->lang[$success_msg] . '<br /><br />' . $return_link);
+ confirm_box(false, 'MERGE_TOPICS', $s_hidden_fields);
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/mcp/mcp_front.php b/phpBB/includes/mcp/mcp_front.php
index af262baa29..5d8aa18c16 100644
--- a/phpBB/includes/mcp/mcp_front.php
+++ b/phpBB/includes/mcp/mcp_front.php
@@ -1,10 +1,13 @@
<?php
/**
*
-* @package mcp
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -23,6 +26,7 @@ function mcp_front_view($id, $mode, $action)
{
global $phpEx, $phpbb_root_path, $config;
global $template, $db, $user, $auth, $module;
+ global $phpbb_dispatcher;
// Latest 5 unapproved
if ($module->loaded('queue'))
@@ -37,18 +41,33 @@ function mcp_front_view($id, $mode, $action)
if (!empty($forum_list))
{
- $sql = 'SELECT COUNT(post_id) AS total
- FROM ' . POSTS_TABLE . '
- WHERE forum_id IN (0, ' . implode(', ', $forum_list) . ')
- AND post_approved = 0';
+ $sql_ary = array(
+ 'SELECT' => 'COUNT(post_id) AS total',
+ 'FROM' => array(
+ POSTS_TABLE => 'p',
+ ),
+ 'WHERE' => $db->sql_in_set('p.forum_id', $forum_list) . '
+ AND ' . $db->sql_in_set('p.post_visibility', array(ITEM_UNAPPROVED, ITEM_REAPPROVE))
+ );
+
+ /**
+ * Allow altering the query to get the number of unapproved posts
+ *
+ * @event core.mcp_front_queue_unapproved_total_before
+ * @var array sql_ary Query array to get the total number of unapproved posts
+ * @var array forum_list List of forums to look for unapproved posts
+ * @since 3.1.5-RC1
+ */
+ $vars = array('sql_ary', 'forum_list');
+ extract($phpbb_dispatcher->trigger_event('core.mcp_front_queue_unapproved_total_before', compact($vars)));
+
+ $sql = $db->sql_build_query('SELECT', $sql_ary);
$result = $db->sql_query($sql);
$total = (int) $db->sql_fetchfield('total');
$db->sql_freeresult($result);
if ($total)
{
- $global_id = $forum_list[0];
-
$sql = 'SELECT forum_id, forum_name
FROM ' . FORUMS_TABLE . '
WHERE ' . $db->sql_in_set('forum_id', $forum_list);
@@ -62,9 +81,9 @@ function mcp_front_view($id, $mode, $action)
$sql = 'SELECT post_id
FROM ' . POSTS_TABLE . '
- WHERE forum_id IN (0, ' . implode(', ', $forum_list) . ')
- AND post_approved = 0
- ORDER BY post_time DESC';
+ WHERE ' . $db->sql_in_set('forum_id', $forum_list) . '
+ AND ' . $db->sql_in_set('post_visibility', array(ITEM_UNAPPROVED, ITEM_REAPPROVE)) . '
+ ORDER BY post_time DESC, post_id DESC';
$result = $db->sql_query_limit($sql, 5);
while ($row = $db->sql_fetchrow($result))
@@ -79,29 +98,36 @@ function mcp_front_view($id, $mode, $action)
}
}
+ /**
+ * Alter list of posts and total as required
+ *
+ * @event core.mcp_front_view_queue_postid_list_after
+ * @var int total Number of unapproved posts
+ * @var array post_list List of unapproved posts
+ * @var array forum_list List of forums that contain the posts
+ * @var array forum_names Associative array with forum_id as key and it's corresponding forum_name as value
+ * @since 3.1.0-RC3
+ */
+ $vars = array('total', 'post_list', 'forum_list', 'forum_names');
+ extract($phpbb_dispatcher->trigger_event('core.mcp_front_view_queue_postid_list_after', compact($vars)));
+
if ($total)
{
- $sql = 'SELECT p.post_id, p.post_subject, p.post_time, p.poster_id, p.post_username, u.username, u.username_clean, u.user_colour, t.topic_id, t.topic_title, t.topic_first_post_id, p.forum_id
+ $sql = 'SELECT p.post_id, p.post_subject, p.post_time, p.post_attachment, p.poster_id, p.post_username, u.username, u.username_clean, u.user_colour, t.topic_id, t.topic_title, t.topic_first_post_id, p.forum_id
FROM ' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . ' t, ' . USERS_TABLE . ' u
WHERE ' . $db->sql_in_set('p.post_id', $post_list) . '
AND t.topic_id = p.topic_id
AND p.poster_id = u.user_id
- ORDER BY p.post_time DESC';
+ ORDER BY p.post_time DESC, p.post_id DESC';
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result))
{
- $global_topic = ($row['forum_id']) ? false : true;
- if ($global_topic)
- {
- $row['forum_id'] = $global_id;
- }
-
$template->assign_block_vars('unapproved', array(
'U_POST_DETAILS' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue&amp;mode=approve_details&amp;f=' . $row['forum_id'] . '&amp;p=' . $row['post_id']),
- 'U_MCP_FORUM' => (!$global_topic) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=main&amp;mode=forum_view&amp;f=' . $row['forum_id']) : '',
+ 'U_MCP_FORUM' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=main&amp;mode=forum_view&amp;f=' . $row['forum_id']),
'U_MCP_TOPIC' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=main&amp;mode=topic_view&amp;f=' . $row['forum_id'] . '&amp;t=' . $row['topic_id']),
- 'U_FORUM' => (!$global_topic) ? append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $row['forum_id']) : '',
+ 'U_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $row['forum_id']),
'U_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id'] . '&amp;t=' . $row['topic_id']),
'AUTHOR_FULL' => get_username_string('full', $row['poster_id'], $row['username'], $row['user_colour']),
@@ -109,12 +135,13 @@ function mcp_front_view($id, $mode, $action)
'AUTHOR_COLOUR' => get_username_string('colour', $row['poster_id'], $row['username'], $row['user_colour']),
'U_AUTHOR' => get_username_string('profile', $row['poster_id'], $row['username'], $row['user_colour']),
- 'FORUM_NAME' => (!$global_topic) ? $forum_names[$row['forum_id']] : $user->lang['GLOBAL_ANNOUNCEMENT'],
+ 'FORUM_NAME' => $forum_names[$row['forum_id']],
'POST_ID' => $row['post_id'],
'TOPIC_TITLE' => $row['topic_title'],
'SUBJECT' => ($row['post_subject']) ? $row['post_subject'] : $user->lang['NO_SUBJECT'],
- 'POST_TIME' => $user->format_date($row['post_time']))
- );
+ 'POST_TIME' => $user->format_date($row['post_time']),
+ 'ATTACH_ICON_IMG' => ($auth->acl_get('u_download') && $auth->acl_get('f_download', $row['forum_id']) && $row['post_attachment']) ? $user->img('icon_topic_attach', $user->lang['TOTAL_ATTACHMENTS']) : '',
+ ));
}
$db->sql_freeresult($result);
}
@@ -126,22 +153,9 @@ function mcp_front_view($id, $mode, $action)
$template->assign_vars(array(
'S_HIDDEN_FIELDS' => $s_hidden_fields,
'S_MCP_QUEUE_ACTION' => append_sid("{$phpbb_root_path}mcp.$phpEx", "i=queue"),
+ 'L_UNAPPROVED_TOTAL' => $user->lang('UNAPPROVED_POSTS_TOTAL', (int) $total),
+ 'S_HAS_UNAPPROVED_POSTS'=> ($total != 0),
));
-
- if ($total == 0)
- {
- $template->assign_vars(array(
- 'L_UNAPPROVED_TOTAL' => $user->lang['UNAPPROVED_POSTS_ZERO_TOTAL'],
- 'S_HAS_UNAPPROVED_POSTS' => false)
- );
- }
- else
- {
- $template->assign_vars(array(
- 'L_UNAPPROVED_TOTAL' => ($total == 1) ? $user->lang['UNAPPROVED_POST_TOTAL'] : sprintf($user->lang['UNAPPROVED_POSTS_TOTAL'], $total),
- 'S_HAS_UNAPPROVED_POSTS' => true)
- );
- }
}
}
@@ -159,31 +173,41 @@ function mcp_front_view($id, $mode, $action)
WHERE r.post_id = p.post_id
AND r.pm_id = 0
AND r.report_closed = 0
- AND p.forum_id IN (0, ' . implode(', ', $forum_list) . ')';
+ AND ' . $db->sql_in_set('p.forum_id', $forum_list);
+
+ /**
+ * Alter sql query to count the number of reported posts
+ *
+ * @event core.mcp_front_reports_count_query_before
+ * @var string sql The query string used to get the number of reports that exist
+ * @var array forum_list List of forums that contain the posts
+ * @since 3.1.5-RC1
+ */
+ $vars = array('sql', 'forum_list');
+ extract($phpbb_dispatcher->trigger_event('core.mcp_front_reports_count_query_before', compact($vars)));
+
$result = $db->sql_query($sql);
$total = (int) $db->sql_fetchfield('total');
$db->sql_freeresult($result);
if ($total)
{
- $global_id = $forum_list[0];
-
- $sql = $db->sql_build_query('SELECT', array(
- 'SELECT' => 'r.report_time, p.post_id, p.post_subject, p.post_time, u.username, u.username_clean, u.user_colour, u.user_id, u2.username as author_name, u2.username_clean as author_name_clean, u2.user_colour as author_colour, u2.user_id as author_id, t.topic_id, t.topic_title, f.forum_id, f.forum_name',
+ $sql_ary = array(
+ 'SELECT' => 'r.report_time, p.post_id, p.post_subject, p.post_time, p.post_attachment, u.username, u.username_clean, u.user_colour, u.user_id, u2.username as author_name, u2.username_clean as author_name_clean, u2.user_colour as author_colour, u2.user_id as author_id, t.topic_id, t.topic_title, f.forum_id, f.forum_name',
'FROM' => array(
REPORTS_TABLE => 'r',
REPORTS_REASONS_TABLE => 'rr',
TOPICS_TABLE => 't',
USERS_TABLE => array('u', 'u2'),
- POSTS_TABLE => 'p'
+ POSTS_TABLE => 'p',
),
'LEFT_JOIN' => array(
array(
'FROM' => array(FORUMS_TABLE => 'f'),
- 'ON' => 'f.forum_id = p.forum_id'
- )
+ 'ON' => 'f.forum_id = p.forum_id',
+ ),
),
'WHERE' => 'r.post_id = p.post_id
@@ -193,25 +217,32 @@ function mcp_front_view($id, $mode, $action)
AND p.topic_id = t.topic_id
AND r.user_id = u.user_id
AND p.poster_id = u2.user_id
- AND p.forum_id IN (0, ' . implode(', ', $forum_list) . ')',
+ AND ' . $db->sql_in_set('p.forum_id', $forum_list),
- 'ORDER_BY' => 'p.post_time DESC'
- ));
+ 'ORDER_BY' => 'p.post_time DESC, p.post_id DESC',
+ );
+
+ /**
+ * Alter sql query to get latest reported posts
+ *
+ * @event core.mcp_front_reports_listing_query_before
+ * @var array sql_ary Associative array with the query to be executed
+ * @var array forum_list List of forums that contain the posts
+ * @since 3.1.0-RC3
+ */
+ $vars = array('sql_ary', 'forum_list');
+ extract($phpbb_dispatcher->trigger_event('core.mcp_front_reports_listing_query_before', compact($vars)));
+
+ $sql = $db->sql_build_query('SELECT', $sql_ary);
$result = $db->sql_query_limit($sql, 5);
while ($row = $db->sql_fetchrow($result))
{
- $global_topic = ($row['forum_id']) ? false : true;
- if ($global_topic)
- {
- $row['forum_id'] = $global_id;
- }
-
$template->assign_block_vars('report', array(
'U_POST_DETAILS' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'f=' . $row['forum_id'] . '&amp;p=' . $row['post_id'] . "&amp;i=reports&amp;mode=report_details"),
- 'U_MCP_FORUM' => (!$global_topic) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'f=' . $row['forum_id'] . "&amp;i=$id&amp;mode=forum_view") : '',
+ 'U_MCP_FORUM' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'f=' . $row['forum_id'] . "&amp;i=$id&amp;mode=forum_view"),
'U_MCP_TOPIC' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'f=' . $row['forum_id'] . '&amp;t=' . $row['topic_id'] . "&amp;i=$id&amp;mode=topic_view"),
- 'U_FORUM' => (!$global_topic) ? append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $row['forum_id']) : '',
+ 'U_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $row['forum_id']),
'U_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id'] . '&amp;t=' . $row['topic_id']),
'REPORTER_FULL' => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']),
@@ -224,34 +255,26 @@ function mcp_front_view($id, $mode, $action)
'AUTHOR_COLOUR' => get_username_string('colour', $row['author_id'], $row['author_name'], $row['author_colour']),
'U_AUTHOR' => get_username_string('profile', $row['author_id'], $row['author_name'], $row['author_colour']),
- 'FORUM_NAME' => (!$global_topic) ? $row['forum_name'] : $user->lang['GLOBAL_ANNOUNCEMENT'],
+ 'FORUM_NAME' => $row['forum_name'],
'TOPIC_TITLE' => $row['topic_title'],
'SUBJECT' => ($row['post_subject']) ? $row['post_subject'] : $user->lang['NO_SUBJECT'],
'REPORT_TIME' => $user->format_date($row['report_time']),
'POST_TIME' => $user->format_date($row['post_time']),
+ 'ATTACH_ICON_IMG' => ($auth->acl_get('u_download') && $auth->acl_get('f_download', $row['forum_id']) && $row['post_attachment']) ? $user->img('icon_topic_attach', $user->lang['TOTAL_ATTACHMENTS']) : '',
));
}
+ $db->sql_freeresult($result);
}
- if ($total == 0)
- {
- $template->assign_vars(array(
- 'L_REPORTS_TOTAL' => $user->lang['REPORTS_ZERO_TOTAL'],
- 'S_HAS_REPORTS' => false)
- );
- }
- else
- {
- $template->assign_vars(array(
- 'L_REPORTS_TOTAL' => ($total == 1) ? $user->lang['REPORT_TOTAL'] : sprintf($user->lang['REPORTS_TOTAL'], $total),
- 'S_HAS_REPORTS' => true)
- );
- }
+ $template->assign_vars(array(
+ 'L_REPORTS_TOTAL' => $user->lang('REPORTS_TOTAL', (int) $total),
+ 'S_HAS_REPORTS' => ($total != 0),
+ ));
}
}
// Latest 5 reported PMs
- if ($module->loaded('pm_reports') && $auth->acl_getf_global('m_report'))
+ if ($module->loaded('pm_reports') && $auth->acl_get('m_pm_report'))
{
$template->assign_var('S_SHOW_PM_REPORTS', true);
$user->add_lang(array('ucp'));
@@ -269,14 +292,14 @@ function mcp_front_view($id, $mode, $action)
{
include($phpbb_root_path . 'includes/functions_privmsgs.' . $phpEx);
- $sql = $db->sql_build_query('SELECT', array(
- 'SELECT' => 'r.report_id, r.report_time, p.msg_id, p.message_subject, p.message_time, p.to_address, p.bcc_address, u.username, u.username_clean, u.user_colour, u.user_id, u2.username as author_name, u2.username_clean as author_name_clean, u2.user_colour as author_colour, u2.user_id as author_id',
+ $sql_ary = array(
+ 'SELECT' => 'r.report_id, r.report_time, p.msg_id, p.message_subject, p.message_time, p.to_address, p.bcc_address, p.message_attachment, u.username, u.username_clean, u.user_colour, u.user_id, u2.username as author_name, u2.username_clean as author_name_clean, u2.user_colour as author_colour, u2.user_id as author_id',
'FROM' => array(
REPORTS_TABLE => 'r',
REPORTS_REASONS_TABLE => 'rr',
USERS_TABLE => array('u', 'u2'),
- PRIVMSGS_TABLE => 'p'
+ PRIVMSGS_TABLE => 'p',
),
'WHERE' => 'r.pm_id = p.msg_id
@@ -286,8 +309,9 @@ function mcp_front_view($id, $mode, $action)
AND r.user_id = u.user_id
AND p.author_id = u2.user_id',
- 'ORDER_BY' => 'p.message_time DESC'
- ));
+ 'ORDER_BY' => 'p.message_time DESC',
+ );
+ $sql = $db->sql_build_query('SELECT', $sql_ary);
$result = $db->sql_query_limit($sql, 5);
$pm_by_id = $pm_list = array();
@@ -296,6 +320,7 @@ function mcp_front_view($id, $mode, $action)
$pm_by_id[(int) $row['msg_id']] = $row;
$pm_list[] = (int) $row['msg_id'];
}
+ $db->sql_freeresult($result);
$address_list = get_recipient_strings($pm_by_id);
@@ -320,24 +345,15 @@ function mcp_front_view($id, $mode, $action)
'REPORT_TIME' => $user->format_date($row['report_time']),
'PM_TIME' => $user->format_date($row['message_time']),
'RECIPIENTS' => implode(', ', $address_list[$row['msg_id']]),
+ 'ATTACH_ICON_IMG' => ($auth->acl_get('u_download') && $row['message_attachment']) ? $user->img('icon_topic_attach', $user->lang['TOTAL_ATTACHMENTS']) : '',
));
}
}
- if ($total == 0)
- {
- $template->assign_vars(array(
- 'L_PM_REPORTS_TOTAL' => $user->lang['PM_REPORTS_ZERO_TOTAL'],
- 'S_HAS_PM_REPORTS' => false)
- );
- }
- else
- {
- $template->assign_vars(array(
- 'L_PM_REPORTS_TOTAL' => ($total == 1) ? $user->lang['PM_REPORT_TOTAL'] : sprintf($user->lang['PM_REPORTS_TOTAL'], $total),
- 'S_HAS_PM_REPORTS' => true)
- );
- }
+ $template->assign_vars(array(
+ 'L_PM_REPORTS_TOTAL' => $user->lang('PM_REPORTS_TOTAL', (int) $total),
+ 'S_HAS_PM_REPORTS' => ($total != 0),
+ ));
}
// Latest 5 logs
@@ -347,9 +363,6 @@ function mcp_front_view($id, $mode, $action)
if (!empty($forum_list))
{
- // Add forum_id 0 for global announcements
- $forum_list[] = 0;
-
$log_count = false;
$log = array();
view_log('mod', $log, $log_count, 5, 0, $forum_list);
@@ -376,5 +389,3 @@ function mcp_front_view($id, $mode, $action)
$template->assign_var('S_MCP_ACTION', append_sid("{$phpbb_root_path}mcp.$phpEx"));
make_jumpbox(append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=main&amp;mode=forum_view'), 0, false, 'm_', true);
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/mcp/mcp_logs.php b/phpBB/includes/mcp/mcp_logs.php
index 73ff72c177..9c76f0df90 100644
--- a/phpBB/includes/mcp/mcp_logs.php
+++ b/phpBB/includes/mcp/mcp_logs.php
@@ -1,10 +1,13 @@
<?php
/**
*
-* @package mcp
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -19,7 +22,6 @@ if (!defined('IN_PHPBB'))
/**
* mcp_logs
* Handling warning the users
-* @package mcp
*/
class mcp_logs
{
@@ -34,7 +36,7 @@ class mcp_logs
function main($id, $mode)
{
global $auth, $db, $user, $template;
- global $config, $phpbb_root_path, $phpEx;
+ global $config, $phpbb_root_path, $phpEx, $phpbb_container, $phpbb_log;
$user->add_lang('acp/common');
@@ -63,6 +65,8 @@ class mcp_logs
$this->tpl_name = 'mcp_logs';
$this->page_title = 'MCP_LOGS';
+ $pagination = $phpbb_container->get('pagination');
+
$forum_list = array_values(array_intersect(get_forum_list('f_read'), get_forum_list('m_')));
$forum_list[] = 0;
@@ -110,27 +114,33 @@ class mcp_logs
{
if ($deletemark && sizeof($marked))
{
- $sql = 'DELETE FROM ' . LOG_TABLE . '
- WHERE log_type = ' . LOG_MOD . '
- AND ' . $db->sql_in_set('forum_id', $forum_list) . '
- AND ' . $db->sql_in_set('log_id', $marked);
- $db->sql_query($sql);
+ $conditions = array(
+ 'forum_id' => array('IN' => $forum_list),
+ 'log_id' => array('IN' => $marked),
+ );
- add_log('admin', 'LOG_CLEAR_MOD');
+ $phpbb_log->delete('mod', $conditions);
}
else if ($deleteall)
{
- $sql = 'DELETE FROM ' . LOG_TABLE . '
- WHERE log_type = ' . LOG_MOD . '
- AND ' . $db->sql_in_set('forum_id', $forum_list);
+ $keywords = utf8_normalize_nfc(request_var('keywords', '', true));
+
+ $conditions = array(
+ 'forum_id' => array('IN' => $forum_list),
+ 'keywords' => $keywords,
+ );
+
+ if ($sort_days)
+ {
+ $conditions['log_time'] = array('>=', time() - ($sort_days * 86400));
+ }
if ($mode == 'topic_logs')
{
- $sql .= ' AND topic_id = ' . $topic_id;
+ $conditions['topic_id'] = $topic_id;
}
- $db->sql_query($sql);
- add_log('admin', 'LOG_CLEAR_MOD');
+ $phpbb_log->delete('mod', $conditions);
}
}
else
@@ -172,10 +182,11 @@ class mcp_logs
$log_count = 0;
$start = view_log('mod', $log_data, $log_count, $config['topics_per_page'], $start, $forum_list, $topic_id, 0, $sql_where, $sql_sort, $keywords);
+ $base_url = $this->u_action . "&amp;$u_sort_param$keywords_param";
+ $pagination->generate_template_pagination($base_url, 'pagination', 'start', $log_count, $config['topics_per_page'], $start);
+
$template->assign_vars(array(
- 'PAGE_NUMBER' => on_page($log_count, $config['topics_per_page'], $start),
- 'TOTAL' => ($log_count == 1) ? $user->lang['TOTAL_LOG'] : sprintf($user->lang['TOTAL_LOGS'], $log_count),
- 'PAGINATION' => generate_pagination($this->u_action . "&amp;$u_sort_param$keywords_param", $log_count, $config['topics_per_page'], $start),
+ 'TOTAL' => $user->lang('TOTAL_LOGS', (int) $log_count),
'L_TITLE' => $user->lang['MCP_LOGS'],
@@ -214,5 +225,3 @@ class mcp_logs
}
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/mcp/mcp_main.php b/phpBB/includes/mcp/mcp_main.php
index 0cef8933fc..69c66639df 100644
--- a/phpBB/includes/mcp/mcp_main.php
+++ b/phpBB/includes/mcp/mcp_main.php
@@ -1,10 +1,13 @@
<?php
/**
*
-* @package mcp
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -19,7 +22,6 @@ if (!defined('IN_PHPBB'))
/**
* mcp_main
* Handling mcp actions
-* @package mcp
*/
class mcp_main
{
@@ -34,7 +36,8 @@ class mcp_main
function main($id, $mode)
{
global $auth, $db, $user, $template, $action;
- global $config, $phpbb_root_path, $phpEx;
+ global $config, $phpbb_root_path, $phpEx, $request;
+ global $phpbb_dispatcher;
$quickmod = ($mode == 'quickmod') ? true : false;
@@ -109,27 +112,62 @@ class mcp_main
case 'delete_topic':
$user->add_lang('viewtopic');
- $topic_ids = (!$quickmod) ? request_var('topic_id_list', array(0)) : array(request_var('t', 0));
+ // f parameter is not reliable for permission usage, however we just use it to decide
+ // which permission we will check later on. So if it is manipulated, we will still catch it later on.
+ $forum_id = $request->variable('f', 0);
+ $topic_ids = (!$quickmod) ? $request->variable('topic_id_list', array(0)) : array($request->variable('t', 0));
+ $soft_delete = (($request->is_set_post('confirm') && !$request->is_set_post('delete_permanent')) || !$auth->acl_get('m_delete', $forum_id)) ? true : false;
if (!sizeof($topic_ids))
{
trigger_error('NO_TOPIC_SELECTED');
}
- mcp_delete_topic($topic_ids);
+ mcp_delete_topic($topic_ids, $soft_delete, $request->variable('delete_reason', '', true));
break;
case 'delete_post':
$user->add_lang('posting');
- $post_ids = (!$quickmod) ? request_var('post_id_list', array(0)) : array(request_var('p', 0));
+ // f parameter is not reliable for permission usage, however we just use it to decide
+ // which permission we will check later on. So if it is manipulated, we will still catch it later on.
+ $forum_id = $request->variable('f', 0);
+ $post_ids = (!$quickmod) ? $request->variable('post_id_list', array(0)) : array($request->variable('p', 0));
+ $soft_delete = (($request->is_set_post('confirm') && !$request->is_set_post('delete_permanent')) || !$auth->acl_get('m_delete', $forum_id)) ? true : false;
if (!sizeof($post_ids))
{
trigger_error('NO_POST_SELECTED');
}
- mcp_delete_post($post_ids);
+ mcp_delete_post($post_ids, $soft_delete, $request->variable('delete_reason', '', true));
+ break;
+
+ case 'restore_topic':
+ $user->add_lang('posting');
+
+ $topic_ids = (!$quickmod) ? $request->variable('topic_id_list', array(0)) : array($request->variable('t', 0));
+
+ if (!sizeof($topic_ids))
+ {
+ trigger_error('NO_TOPIC_SELECTED');
+ }
+
+ mcp_restore_topic($topic_ids);
+ break;
+
+ default:
+ /**
+ * This event allows you to handle custom quickmod options
+ *
+ * @event core.modify_quickmod_actions
+ * @var string action Topic quick moderation action name
+ * @var bool quickmod Flag indicating whether MCP is in quick moderation mode
+ * @since 3.1.0-a4
+ * @changed 3.1.0-RC4 Added variables: action, quickmod
+ */
+ $vars = array('action', 'quickmod');
+ extract($phpbb_dispatcher->trigger_event('core.modify_quickmod_actions', compact($vars)));
break;
}
@@ -153,7 +191,7 @@ class mcp_main
$forum_id = request_var('f', 0);
- $forum_info = get_forum_data($forum_id, 'm_', true);
+ $forum_info = phpbb_get_forum_data($forum_id, 'm_', true);
if (!sizeof($forum_info))
{
@@ -188,6 +226,31 @@ class mcp_main
break;
default:
+ if ($quickmod)
+ {
+ switch ($action)
+ {
+ case 'lock':
+ case 'unlock':
+ case 'make_announce':
+ case 'make_sticky':
+ case 'make_global':
+ case 'make_normal':
+ case 'make_onindex':
+ case 'move':
+ case 'fork':
+ case 'delete_topic':
+ trigger_error('TOPIC_NOT_EXIST');
+ break;
+
+ case 'lock_post':
+ case 'unlock_post':
+ case 'delete_post':
+ trigger_error('POST_NOT_EXIST');
+ break;
+ }
+ }
+
trigger_error('NO_MODE', E_USER_ERROR);
break;
}
@@ -199,7 +262,7 @@ class mcp_main
*/
function lock_unlock($action, $ids)
{
- global $auth, $user, $db, $phpEx, $phpbb_root_path;
+ global $auth, $user, $db, $phpEx, $phpbb_root_path, $request, $phpbb_dispatcher;
if ($action == 'lock' || $action == 'unlock')
{
@@ -218,7 +281,7 @@ function lock_unlock($action, $ids)
$orig_ids = $ids;
- if (!check_ids($ids, $table, $sql_id, array('m_lock')))
+ if (!phpbb_check_ids($ids, $table, $sql_id, array('m_lock')))
{
// Make sure that for f_user_lock only the lock action is triggered.
if ($action != 'lock')
@@ -228,7 +291,7 @@ function lock_unlock($action, $ids)
$ids = $orig_ids;
- if (!check_ids($ids, $table, $sql_id, array('f_user_lock')))
+ if (!phpbb_check_ids($ids, $table, $sql_id, array('f_user_lock')))
{
return;
}
@@ -236,6 +299,7 @@ function lock_unlock($action, $ids)
unset($orig_ids);
$redirect = request_var('redirect', build_url(array('action', 'quickmod')));
+ $redirect = reapply_sid($redirect);
$s_hidden_fields = build_hidden_fields(array(
$sql_id . '_list' => $ids,
@@ -251,32 +315,46 @@ function lock_unlock($action, $ids)
WHERE ' . $db->sql_in_set($sql_id, $ids);
$db->sql_query($sql);
- $data = ($action == 'lock' || $action == 'unlock') ? get_topic_data($ids) : get_post_data($ids);
+ $data = ($action == 'lock' || $action == 'unlock') ? phpbb_get_topic_data($ids) : phpbb_get_post_data($ids);
foreach ($data as $id => $row)
{
add_log('mod', $row['forum_id'], $row['topic_id'], 'LOG_' . strtoupper($action), $row['topic_title']);
}
+ /**
+ * Perform additional actions after locking/unlocking posts/topics
+ *
+ * @event core.mcp_lock_unlock_after
+ * @var string action Variable containing the action we perform on the posts/topics ('lock', 'unlock', 'lock_post' or 'unlock_post')
+ * @var array ids Array containing the post/topic IDs that have been locked/unlocked
+ * @var array data Array containing posts/topics data
+ * @since 3.1.7-RC1
+ */
+ $vars = array(
+ 'action',
+ 'ids',
+ 'data',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.mcp_lock_unlock_after', compact($vars)));
+
$success_msg = $l_prefix . ((sizeof($ids) == 1) ? '' : 'S') . '_' . (($action == 'lock' || $action == 'lock_post') ? 'LOCKED' : 'UNLOCKED') . '_SUCCESS';
- }
- else
- {
- confirm_box(false, strtoupper($action) . '_' . $l_prefix . ((sizeof($ids) == 1) ? '' : 'S'), $s_hidden_fields);
- }
- $redirect = request_var('redirect', "index.$phpEx");
- $redirect = reapply_sid($redirect);
+ meta_refresh(2, $redirect);
+ $message = $user->lang[$success_msg];
- if (!$success_msg)
- {
- redirect($redirect);
+ if (!$request->is_ajax())
+ {
+ $message .= '<br /><br />' . $user->lang('RETURN_PAGE', '<a href="' . $redirect . '">', '</a>');
+ }
+ trigger_error($message);
}
else
{
- meta_refresh(2, $redirect);
- trigger_error($user->lang[$success_msg] . '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], '<a href="' . $redirect . '">', '</a>'));
+ confirm_box(false, strtoupper($action) . '_' . $l_prefix . ((sizeof($ids) == 1) ? '' : 'S'), $s_hidden_fields);
}
+
+ redirect($redirect);
}
/**
@@ -284,7 +362,7 @@ function lock_unlock($action, $ids)
*/
function change_topic_type($action, $topic_ids)
{
- global $auth, $user, $db, $phpEx, $phpbb_root_path;
+ global $auth, $user, $db, $phpEx, $phpbb_root_path, $request;
switch ($action)
{
@@ -313,7 +391,7 @@ function change_topic_type($action, $topic_ids)
break;
}
- $forum_id = check_ids($topic_ids, TOPICS_TABLE, 'topic_id', $check_acl, true);
+ $forum_id = phpbb_check_ids($topic_ids, TOPICS_TABLE, 'topic_id', $check_acl, true);
if ($forum_id === false)
{
@@ -321,6 +399,7 @@ function change_topic_type($action, $topic_ids)
}
$redirect = request_var('redirect', build_url(array('action', 'quickmod')));
+ $redirect = reapply_sid($redirect);
$s_hidden_fields = array(
'topic_id_list' => $topic_ids,
@@ -332,196 +411,51 @@ function change_topic_type($action, $topic_ids)
if (confirm_box(true))
{
- if ($new_topic_type != POST_GLOBAL)
+ $sql = 'UPDATE ' . TOPICS_TABLE . "
+ SET topic_type = $new_topic_type
+ WHERE " . $db->sql_in_set('topic_id', $topic_ids);
+ $db->sql_query($sql);
+
+ if (($new_topic_type == POST_GLOBAL) && sizeof($topic_ids))
{
+ // Delete topic shadows for global announcements
+ $sql = 'DELETE FROM ' . TOPICS_TABLE . '
+ WHERE ' . $db->sql_in_set('topic_moved_id', $topic_ids);
+ $db->sql_query($sql);
+
$sql = 'UPDATE ' . TOPICS_TABLE . "
SET topic_type = $new_topic_type
- WHERE " . $db->sql_in_set('topic_id', $topic_ids) . '
- AND forum_id <> 0';
+ WHERE " . $db->sql_in_set('topic_id', $topic_ids);
$db->sql_query($sql);
-
- // Reset forum id if a global topic is within the array
- $to_forum_id = request_var('to_forum_id', 0);
-
- if ($to_forum_id)
- {
- $sql = 'UPDATE ' . TOPICS_TABLE . "
- SET topic_type = $new_topic_type, forum_id = $to_forum_id
- WHERE " . $db->sql_in_set('topic_id', $topic_ids) . '
- AND forum_id = 0';
- $db->sql_query($sql);
-
- // Update forum_ids for all posts
- $sql = 'UPDATE ' . POSTS_TABLE . "
- SET forum_id = $to_forum_id
- WHERE " . $db->sql_in_set('topic_id', $topic_ids) . '
- AND forum_id = 0';
- $db->sql_query($sql);
-
- // Do a little forum sync stuff
- $sql = 'SELECT SUM(t.topic_replies + t.topic_approved) as topic_posts, COUNT(t.topic_approved) as topics_authed
- FROM ' . TOPICS_TABLE . ' t
- WHERE ' . $db->sql_in_set('t.topic_id', $topic_ids);
- $result = $db->sql_query($sql);
- $row_data = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
-
- $sync_sql = array();
-
- if ($row_data['topic_posts'])
- {
- $sync_sql[$to_forum_id][] = 'forum_posts = forum_posts + ' . (int) $row_data['topic_posts'];
- }
-
- if ($row_data['topics_authed'])
- {
- $sync_sql[$to_forum_id][] = 'forum_topics = forum_topics + ' . (int) $row_data['topics_authed'];
- }
-
- $sync_sql[$to_forum_id][] = 'forum_topics_real = forum_topics_real + ' . (int) sizeof($topic_ids);
-
- foreach ($sync_sql as $forum_id_key => $array)
- {
- $sql = 'UPDATE ' . FORUMS_TABLE . '
- SET ' . implode(', ', $array) . '
- WHERE forum_id = ' . $forum_id_key;
- $db->sql_query($sql);
- }
-
- sync('forum', 'forum_id', $to_forum_id);
- }
- }
- else
- {
- // Get away with those topics already being a global announcement by re-calculating $topic_ids
- $sql = 'SELECT topic_id
- FROM ' . TOPICS_TABLE . '
- WHERE ' . $db->sql_in_set('topic_id', $topic_ids) . '
- AND forum_id <> 0';
- $result = $db->sql_query($sql);
-
- $topic_ids = array();
- while ($row = $db->sql_fetchrow($result))
- {
- $topic_ids[] = $row['topic_id'];
- }
- $db->sql_freeresult($result);
-
- if (sizeof($topic_ids))
- {
- // Delete topic shadows for global announcements
- $sql = 'DELETE FROM ' . TOPICS_TABLE . '
- WHERE ' . $db->sql_in_set('topic_moved_id', $topic_ids);
- $db->sql_query($sql);
-
- $sql = 'UPDATE ' . TOPICS_TABLE . "
- SET topic_type = $new_topic_type, forum_id = 0
- WHERE " . $db->sql_in_set('topic_id', $topic_ids);
- $db->sql_query($sql);
-
- // Update forum_ids for all posts
- $sql = 'UPDATE ' . POSTS_TABLE . '
- SET forum_id = 0
- WHERE ' . $db->sql_in_set('topic_id', $topic_ids);
- $db->sql_query($sql);
-
- // Do a little forum sync stuff
- $sql = 'SELECT SUM(t.topic_replies + t.topic_approved) as topic_posts, COUNT(t.topic_approved) as topics_authed
- FROM ' . TOPICS_TABLE . ' t
- WHERE ' . $db->sql_in_set('t.topic_id', $topic_ids);
- $result = $db->sql_query($sql);
- $row_data = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
-
- $sync_sql = array();
-
- if ($row_data['topic_posts'])
- {
- $sync_sql[$forum_id][] = 'forum_posts = forum_posts - ' . (int) $row_data['topic_posts'];
- }
-
- if ($row_data['topics_authed'])
- {
- $sync_sql[$forum_id][] = 'forum_topics = forum_topics - ' . (int) $row_data['topics_authed'];
- }
-
- $sync_sql[$forum_id][] = 'forum_topics_real = forum_topics_real - ' . (int) sizeof($topic_ids);
-
- foreach ($sync_sql as $forum_id_key => $array)
- {
- $sql = 'UPDATE ' . FORUMS_TABLE . '
- SET ' . implode(', ', $array) . '
- WHERE forum_id = ' . $forum_id_key;
- $db->sql_query($sql);
- }
-
- sync('forum', 'forum_id', $forum_id);
- }
}
$success_msg = (sizeof($topic_ids) == 1) ? 'TOPIC_TYPE_CHANGED' : 'TOPICS_TYPE_CHANGED';
if (sizeof($topic_ids))
{
- $data = get_topic_data($topic_ids);
+ $data = phpbb_get_topic_data($topic_ids);
foreach ($data as $topic_id => $row)
{
add_log('mod', $forum_id, $topic_id, 'LOG_TOPIC_TYPE_CHANGED', $row['topic_title']);
}
}
- }
- else
- {
- // Global topic involved?
- $global_involved = false;
- if ($new_topic_type != POST_GLOBAL)
- {
- $sql = 'SELECT forum_id
- FROM ' . TOPICS_TABLE . '
- WHERE ' . $db->sql_in_set('topic_id', $topic_ids) . '
- AND forum_id = 0';
- $result = $db->sql_query($sql);
- $row = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
-
- if ($row)
- {
- $global_involved = true;
- }
- }
-
- if ($global_involved)
- {
- global $template;
-
- $template->assign_vars(array(
- 'S_FORUM_SELECT' => make_forum_select(request_var('f', $forum_id), false, false, true, true),
- 'S_CAN_LEAVE_SHADOW' => false,
- 'ADDITIONAL_MSG' => (sizeof($topic_ids) == 1) ? $user->lang['SELECT_FORUM_GLOBAL_ANNOUNCEMENT'] : $user->lang['SELECT_FORUM_GLOBAL_ANNOUNCEMENTS'])
- );
+ meta_refresh(2, $redirect);
+ $message = $user->lang[$success_msg];
- confirm_box(false, $l_new_type, build_hidden_fields($s_hidden_fields), 'mcp_move.html');
- }
- else
+ if (!$request->is_ajax())
{
- confirm_box(false, $l_new_type, build_hidden_fields($s_hidden_fields));
+ $message .= '<br /><br />' . $user->lang('RETURN_PAGE', '<a href="' . $redirect . '">', '</a>');
}
- }
-
- $redirect = request_var('redirect', "index.$phpEx");
- $redirect = reapply_sid($redirect);
-
- if (!$success_msg)
- {
- redirect($redirect);
+ trigger_error($message);
}
else
{
- meta_refresh(2, $redirect);
- trigger_error($user->lang[$success_msg] . '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], '<a href="' . $redirect . '">', '</a>'));
+ confirm_box(false, $l_new_type, build_hidden_fields($s_hidden_fields));
}
+
+ redirect($redirect);
}
/**
@@ -529,11 +463,11 @@ function change_topic_type($action, $topic_ids)
*/
function mcp_move_topic($topic_ids)
{
- global $auth, $user, $db, $template;
+ global $auth, $user, $db, $template, $phpbb_log, $request, $phpbb_dispatcher;
global $phpEx, $phpbb_root_path;
// Here we limit the operation to one forum only
- $forum_id = check_ids($topic_ids, TOPICS_TABLE, 'topic_id', array('m_move'), true);
+ $forum_id = phpbb_check_ids($topic_ids, TOPICS_TABLE, 'topic_id', array('m_move'), true);
if ($forum_id === false)
{
@@ -553,7 +487,7 @@ function mcp_move_topic($topic_ids)
if ($to_forum_id)
{
- $forum_data = get_forum_data($to_forum_id, 'f_post');
+ $forum_data = phpbb_get_forum_data($to_forum_id, 'f_post');
if (!sizeof($forum_data))
{
@@ -584,13 +518,13 @@ function mcp_move_topic($topic_ids)
if (!$to_forum_id || $additional_msg)
{
- unset($_POST['confirm']);
- unset($_REQUEST['confirm_key']);
+ $request->overwrite('confirm', null, \phpbb\request\request_interface::POST);
+ $request->overwrite('confirm_key', null);
}
if (confirm_box(true))
{
- $topic_data = get_topic_data($topic_ids);
+ $topic_data = phpbb_get_topic_data($topic_ids);
$leave_shadow = (isset($_POST['move_leave_shadow'])) ? true : false;
$forum_sync_data = array();
@@ -598,98 +532,77 @@ function mcp_move_topic($topic_ids)
$forum_sync_data[$forum_id] = current($topic_data);
$forum_sync_data[$to_forum_id] = $forum_data;
- // Real topics added to target forum
- $topics_moved = sizeof($topic_data);
-
- // Approved topics added to target forum
- $topics_authed_moved = 0;
-
- // Posts (topic replies + topic post if approved) added to target forum
- $topic_posts_added = 0;
-
- // Posts (topic replies + topic post if approved and not global announcement) removed from source forum
- $topic_posts_removed = 0;
-
- // Real topics removed from source forum (all topics without global announcements)
- $topics_removed = 0;
-
- // Approved topics removed from source forum (except global announcements)
- $topics_authed_removed = 0;
+ $topics_moved = $topics_moved_unapproved = $topics_moved_softdeleted = 0;
+ $posts_moved = $posts_moved_unapproved = $posts_moved_softdeleted = 0;
foreach ($topic_data as $topic_id => $topic_info)
{
- if ($topic_info['topic_approved'])
+ if ($topic_info['topic_visibility'] == ITEM_APPROVED)
{
- $topics_authed_moved++;
- $topic_posts_added++;
+ $topics_moved++;
}
-
- $topic_posts_added += $topic_info['topic_replies'];
-
- if ($topic_info['topic_type'] != POST_GLOBAL)
+ else if ($topic_info['topic_visibility'] == ITEM_UNAPPROVED || $topic_info['topic_visibility'] == ITEM_REAPPROVE)
{
- $topics_removed++;
- $topic_posts_removed += $topic_info['topic_replies'];
-
- if ($topic_info['topic_approved'])
- {
- $topics_authed_removed++;
- $topic_posts_removed++;
- }
+ $topics_moved_unapproved++;
}
+ else if ($topic_info['topic_visibility'] == ITEM_DELETED)
+ {
+ $topics_moved_softdeleted++;
+ }
+
+ $posts_moved += $topic_info['topic_posts_approved'];
+ $posts_moved_unapproved += $topic_info['topic_posts_unapproved'];
+ $posts_moved_softdeleted += $topic_info['topic_posts_softdeleted'];
}
$db->sql_transaction('begin');
- $sync_sql = array();
-
- if ($topic_posts_added)
- {
- $sync_sql[$to_forum_id][] = 'forum_posts = forum_posts + ' . $topic_posts_added;
- }
+ // Move topics, but do not resync yet
+ move_topics($topic_ids, $to_forum_id, false);
- if ($topics_authed_moved)
+ if ($request->is_set_post('move_lock_topics') && $auth->acl_get('m_lock', $to_forum_id))
{
- $sync_sql[$to_forum_id][] = 'forum_topics = forum_topics + ' . (int) $topics_authed_moved;
+ $sql = 'UPDATE ' . TOPICS_TABLE . '
+ SET topic_status = ' . ITEM_LOCKED . '
+ WHERE ' . $db->sql_in_set('topic_id', $topic_ids);
+ $db->sql_query($sql);
}
- $sync_sql[$to_forum_id][] = 'forum_topics_real = forum_topics_real + ' . (int) $topics_moved;
-
- // Move topics, but do not resync yet
- move_topics($topic_ids, $to_forum_id, false);
-
+ $shadow_topics = 0;
$forum_ids = array($to_forum_id);
foreach ($topic_data as $topic_id => $row)
{
- // Get the list of forums to resync, add a log entry
+ // Get the list of forums to resync
$forum_ids[] = $row['forum_id'];
- add_log('mod', $to_forum_id, $topic_id, 'LOG_MOVE', $row['forum_name'], $forum_data['forum_name']);
- // If we have moved a global announcement, we need to correct the topic type
- if ($row['topic_type'] == POST_GLOBAL)
- {
- $sql = 'UPDATE ' . TOPICS_TABLE . '
- SET topic_type = ' . POST_ANNOUNCE . '
- WHERE topic_id = ' . (int) $row['topic_id'];
- $db->sql_query($sql);
- }
+ // We add the $to_forum_id twice, because 'forum_id' is updated
+ // when the topic is moved again later.
+ $phpbb_log->add('mod', $user->data['user_id'], $user->ip, 'LOG_MOVE', false, array(
+ 'forum_id' => (int) $to_forum_id,
+ 'topic_id' => (int) $topic_id,
+ $row['forum_name'],
+ $forum_data['forum_name'],
+ (int) $row['forum_id'],
+ (int) $forum_data['forum_id'],
+ ));
// Leave a redirection if required and only if the topic is visible to users
- if ($leave_shadow && $row['topic_approved'] && $row['topic_type'] != POST_GLOBAL)
+ if ($leave_shadow && $row['topic_visibility'] == ITEM_APPROVED && $row['topic_type'] != POST_GLOBAL)
{
$shadow = array(
'forum_id' => (int) $row['forum_id'],
'icon_id' => (int) $row['icon_id'],
'topic_attachment' => (int) $row['topic_attachment'],
- 'topic_approved' => 1, // a shadow topic is always approved
+ 'topic_visibility' => ITEM_APPROVED, // a shadow topic is always approved
'topic_reported' => 0, // a shadow topic is never reported
'topic_title' => (string) $row['topic_title'],
'topic_poster' => (int) $row['topic_poster'],
'topic_time' => (int) $row['topic_time'],
'topic_time_limit' => (int) $row['topic_time_limit'],
'topic_views' => (int) $row['topic_views'],
- 'topic_replies' => (int) $row['topic_replies'],
- 'topic_replies_real' => (int) $row['topic_replies_real'],
+ 'topic_posts_approved' => (int) $row['topic_posts_approved'],
+ 'topic_posts_unapproved'=> (int) $row['topic_posts_unapproved'],
+ 'topic_posts_softdeleted'=> (int) $row['topic_posts_softdeleted'],
'topic_status' => ITEM_MOVED,
'topic_type' => POST_NORMAL,
'topic_first_post_id' => (int) $row['topic_first_post_id'],
@@ -699,7 +612,7 @@ function mcp_move_topic($topic_ids)
'topic_last_poster_id' => (int) $row['topic_last_poster_id'],
'topic_last_poster_colour'=>(string) $row['topic_last_poster_colour'],
'topic_last_poster_name'=> (string) $row['topic_last_poster_name'],
- 'topic_last_post_subject'=> (string) $row['topic_last_post_subject'],
+ 'topic_last_post_subject'=> (string) $row['topic_last_post_subject'],
'topic_last_post_time' => (int) $row['topic_last_post_time'],
'topic_last_view_time' => (int) $row['topic_last_view_time'],
'topic_moved_id' => (int) $row['topic_id'],
@@ -712,28 +625,63 @@ function mcp_move_topic($topic_ids)
'poll_last_vote' => (int) $row['poll_last_vote']
);
+ /**
+ * Perform actions before shadow topic is created.
+ *
+ * @event core.mcp_main_modify_shadow_sql
+ * @var array shadow SQL array to be used by $db->sql_build_array
+ * @var array row Topic data
+ * @since 3.1.11-RC1
+ * @changed 3.1.11-RC1 Added variable: row
+ */
+ $vars = array(
+ 'shadow',
+ 'row',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.mcp_main_modify_shadow_sql', compact($vars)));
+
$db->sql_query('INSERT INTO ' . TOPICS_TABLE . $db->sql_build_array('INSERT', $shadow));
// Shadow topics only count on new "topics" and not posts... a shadow topic alone has 0 posts
- $topics_removed--;
- $topics_authed_removed--;
+ $shadow_topics++;
}
}
unset($topic_data);
- if ($topic_posts_removed)
+ $sync_sql = array();
+ if ($posts_moved)
{
- $sync_sql[$forum_id][] = 'forum_posts = forum_posts - ' . $topic_posts_removed;
+ $sync_sql[$to_forum_id][] = 'forum_posts_approved = forum_posts_approved + ' . (int) $posts_moved;
+ $sync_sql[$forum_id][] = 'forum_posts_approved = forum_posts_approved - ' . (int) $posts_moved;
}
-
- if ($topics_removed)
+ if ($posts_moved_unapproved)
+ {
+ $sync_sql[$to_forum_id][] = 'forum_posts_unapproved = forum_posts_unapproved + ' . (int) $posts_moved_unapproved;
+ $sync_sql[$forum_id][] = 'forum_posts_unapproved = forum_posts_unapproved - ' . (int) $posts_moved_unapproved;
+ }
+ if ($posts_moved_softdeleted)
{
- $sync_sql[$forum_id][] = 'forum_topics_real = forum_topics_real - ' . (int) $topics_removed;
+ $sync_sql[$to_forum_id][] = 'forum_posts_softdeleted = forum_posts_softdeleted + ' . (int) $posts_moved_softdeleted;
+ $sync_sql[$forum_id][] = 'forum_posts_softdeleted = forum_posts_softdeleted - ' . (int) $posts_moved_softdeleted;
}
- if ($topics_authed_removed)
+ if ($topics_moved)
+ {
+ $sync_sql[$to_forum_id][] = 'forum_topics_approved = forum_topics_approved + ' . (int) $topics_moved;
+ if ($topics_moved - $shadow_topics > 0)
+ {
+ $sync_sql[$forum_id][] = 'forum_topics_approved = forum_topics_approved - ' . (int) ($topics_moved - $shadow_topics);
+ }
+ }
+ if ($topics_moved_unapproved)
{
- $sync_sql[$forum_id][] = 'forum_topics = forum_topics - ' . (int) $topics_authed_removed;
+ $sync_sql[$to_forum_id][] = 'forum_topics_unapproved = forum_topics_unapproved + ' . (int) $topics_moved_unapproved;
+ $sync_sql[$forum_id][] = 'forum_topics_unapproved = forum_topics_unapproved - ' . (int) $topics_moved_unapproved;
+ }
+ if ($topics_moved_softdeleted)
+ {
+ $sync_sql[$to_forum_id][] = 'forum_topics_softdeleted = forum_topics_softdeleted + ' . (int) $topics_moved_softdeleted;
+ $sync_sql[$forum_id][] = 'forum_topics_softdeleted = forum_topics_softdeleted - ' . (int) $topics_moved_softdeleted;
}
$success_msg = (sizeof($topic_ids) == 1) ? 'TOPIC_MOVED_SUCCESS' : 'TOPICS_MOVED_SUCCESS';
@@ -755,6 +703,7 @@ function mcp_move_topic($topic_ids)
$template->assign_vars(array(
'S_FORUM_SELECT' => make_forum_select($to_forum_id, $forum_id, false, true, true, true),
'S_CAN_LEAVE_SHADOW' => true,
+ 'S_CAN_LOCK_TOPIC' => ($auth->acl_get('m_lock', $to_forum_id)) ? true : false,
'ADDITIONAL_MSG' => $additional_msg)
);
@@ -782,25 +731,99 @@ function mcp_move_topic($topic_ids)
}
/**
-* Delete Topics
+* Restore Topics
*/
-function mcp_delete_topic($topic_ids)
+function mcp_restore_topic($topic_ids)
{
- global $auth, $user, $db, $phpEx, $phpbb_root_path;
+ global $auth, $user, $db, $phpEx, $phpbb_root_path, $request, $phpbb_container;
- if (!check_ids($topic_ids, TOPICS_TABLE, 'topic_id', array('m_delete')))
+ if (!phpbb_check_ids($topic_ids, TOPICS_TABLE, 'topic_id', array('m_approve')))
{
return;
}
- $redirect = request_var('redirect', build_url(array('action', 'quickmod')));
- $forum_id = request_var('f', 0);
+ $redirect = $request->variable('redirect', build_url(array('action', 'quickmod')));
+ $forum_id = $request->variable('f', 0);
$s_hidden_fields = build_hidden_fields(array(
'topic_id_list' => $topic_ids,
'f' => $forum_id,
- 'action' => 'delete_topic',
- 'redirect' => $redirect)
+ 'action' => 'restore_topic',
+ 'redirect' => $redirect,
+ ));
+ $success_msg = '';
+
+ if (confirm_box(true))
+ {
+ $success_msg = (sizeof($topic_ids) == 1) ? 'TOPIC_RESTORED_SUCCESS' : 'TOPICS_RESTORED_SUCCESS';
+
+ $data = phpbb_get_topic_data($topic_ids);
+
+ $phpbb_content_visibility = $phpbb_container->get('content.visibility');
+ foreach ($data as $topic_id => $row)
+ {
+ $return = $phpbb_content_visibility->set_topic_visibility(ITEM_APPROVED, $topic_id, $row['forum_id'], $user->data['user_id'], time(), '');
+ if (!empty($return))
+ {
+ add_log('mod', $row['forum_id'], $topic_id, 'LOG_RESTORE_TOPIC', $row['topic_title'], $row['topic_first_poster_name']);
+ }
+ }
+ }
+ else
+ {
+ confirm_box(false, (sizeof($topic_ids) == 1) ? 'RESTORE_TOPIC' : 'RESTORE_TOPICS', $s_hidden_fields);
+ }
+
+ $topic_id = $request->variable('t', 0);
+ if (!$request->is_set('quickmod', \phpbb\request\request_interface::REQUEST))
+ {
+ $redirect = $request->variable('redirect', "index.$phpEx");
+ $redirect = reapply_sid($redirect);
+ $redirect_message = 'PAGE';
+ }
+ else if ($topic_id)
+ {
+ $redirect = append_sid("{$phpbb_root_path}viewtopic.$phpEx", 't=' . $topic_id);
+ $redirect_message = 'TOPIC';
+ }
+ else
+ {
+ $redirect = append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_id);
+ $redirect_message = 'FORUM';
+ }
+
+ if (!$success_msg)
+ {
+ redirect($redirect);
+ }
+ else
+ {
+ meta_refresh(3, $redirect);
+ trigger_error($user->lang[$success_msg] . '<br /><br />' . sprintf($user->lang['RETURN_' . $redirect_message], '<a href="' . $redirect . '">', '</a>'));
+ }
+}
+
+/**
+* Delete Topics
+*/
+function mcp_delete_topic($topic_ids, $is_soft = false, $soft_delete_reason = '', $action = 'delete_topic')
+{
+ global $auth, $user, $db, $phpEx, $phpbb_root_path, $request, $phpbb_container;
+
+ $check_permission = ($is_soft) ? 'm_softdelete' : 'm_delete';
+ if (!phpbb_check_ids($topic_ids, TOPICS_TABLE, 'topic_id', array($check_permission)))
+ {
+ return;
+ }
+
+ $redirect = $request->variable('redirect', build_url(array('action', 'quickmod')));
+ $forum_id = $request->variable('f', 0);
+
+ $s_hidden_fields = array(
+ 'topic_id_list' => $topic_ids,
+ 'f' => $forum_id,
+ 'action' => $action,
+ 'redirect' => $redirect,
);
$success_msg = '';
@@ -808,7 +831,7 @@ function mcp_delete_topic($topic_ids)
{
$success_msg = (sizeof($topic_ids) == 1) ? 'TOPIC_DELETED_SUCCESS' : 'TOPICS_DELETED_SUCCESS';
- $data = get_topic_data($topic_ids);
+ $data = phpbb_get_topic_data($topic_ids);
foreach ($data as $topic_id => $row)
{
@@ -818,23 +841,91 @@ function mcp_delete_topic($topic_ids)
}
else
{
- add_log('mod', $row['forum_id'], $topic_id, 'LOG_DELETE_TOPIC', $row['topic_title'], $row['topic_first_poster_name']);
+ // Only soft delete non-shadow topics
+ if ($is_soft)
+ {
+ $phpbb_content_visibility = $phpbb_container->get('content.visibility');
+ $return = $phpbb_content_visibility->set_topic_visibility(ITEM_DELETED, $topic_id, $row['forum_id'], $user->data['user_id'], time(), $soft_delete_reason);
+ if (!empty($return))
+ {
+ add_log('mod', $row['forum_id'], $topic_id, 'LOG_SOFTDELETE_TOPIC', $row['topic_title'], $row['topic_first_poster_name'], $soft_delete_reason);
+ }
+ }
+ else
+ {
+ add_log('mod', $row['forum_id'], $topic_id, 'LOG_DELETE_TOPIC', $row['topic_title'], $row['topic_first_poster_name'], $soft_delete_reason);
+ }
}
}
- $return = delete_topics('topic_id', $topic_ids);
+ if (!$is_soft)
+ {
+ $return = delete_topics('topic_id', $topic_ids);
+ }
}
else
{
- confirm_box(false, (sizeof($topic_ids) == 1) ? 'DELETE_TOPIC' : 'DELETE_TOPICS', $s_hidden_fields);
+ global $template;
+
+ $user->add_lang('posting');
+
+ // If there are only shadow topics, we neither need a reason nor softdelete
+ $sql = 'SELECT topic_id
+ FROM ' . TOPICS_TABLE . '
+ WHERE ' . $db->sql_in_set('topic_id', $topic_ids) . '
+ AND topic_moved_id = 0';
+ $result = $db->sql_query_limit($sql, 1);
+ $only_shadow = !$db->sql_fetchfield('topic_id');
+ $db->sql_freeresult($result);
+
+ $only_softdeleted = false;
+ if (!$only_shadow && $auth->acl_get('m_delete', $forum_id) && $auth->acl_get('m_softdelete', $forum_id))
+ {
+ // If there are only soft deleted topics, we display a message why the option is not available
+ $sql = 'SELECT topic_id
+ FROM ' . TOPICS_TABLE . '
+ WHERE ' . $db->sql_in_set('topic_id', $topic_ids) . '
+ AND topic_visibility <> ' . ITEM_DELETED;
+ $result = $db->sql_query_limit($sql, 1);
+ $only_softdeleted = !$db->sql_fetchfield('topic_id');
+ $db->sql_freeresult($result);
+ }
+
+ $template->assign_vars(array(
+ 'S_SHADOW_TOPICS' => $only_shadow,
+ 'S_SOFTDELETED' => $only_softdeleted,
+ 'S_TOPIC_MODE' => true,
+ 'S_ALLOWED_DELETE' => $auth->acl_get('m_delete', $forum_id),
+ 'S_ALLOWED_SOFTDELETE' => $auth->acl_get('m_softdelete', $forum_id),
+ 'DELETE_TOPIC_PERMANENTLY_EXPLAIN' => $user->lang('DELETE_TOPIC_PERMANENTLY', sizeof($topic_ids)),
+ ));
+
+ $l_confirm = (sizeof($topic_ids) == 1) ? 'DELETE_TOPIC' : 'DELETE_TOPICS';
+ if ($only_softdeleted)
+ {
+ $l_confirm .= '_PERMANENTLY';
+ $s_hidden_fields['delete_permanent'] = '1';
+ }
+ else if ($only_shadow || !$auth->acl_get('m_softdelete', $forum_id))
+ {
+ $s_hidden_fields['delete_permanent'] = '1';
+ }
+
+ confirm_box(false, $l_confirm, build_hidden_fields($s_hidden_fields), 'confirm_delete_body.html');
}
- if (!isset($_REQUEST['quickmod']))
+ $topic_id = $request->variable('t', 0);
+ if (!$request->is_set('quickmod', \phpbb\request\request_interface::REQUEST))
{
- $redirect = request_var('redirect', "index.$phpEx");
+ $redirect = $request->variable('redirect', "index.$phpEx");
$redirect = reapply_sid($redirect);
$redirect_message = 'PAGE';
}
+ else if ($is_soft && $topic_id)
+ {
+ $redirect = append_sid("{$phpbb_root_path}viewtopic.$phpEx", 't=' . $topic_id);
+ $redirect_message = 'TOPIC';
+ }
else
{
$redirect = append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_id);
@@ -855,27 +946,94 @@ function mcp_delete_topic($topic_ids)
/**
* Delete Posts
*/
-function mcp_delete_post($post_ids)
+function mcp_delete_post($post_ids, $is_soft = false, $soft_delete_reason = '', $action = 'delete_post')
{
- global $auth, $user, $db, $phpEx, $phpbb_root_path;
+ global $auth, $user, $db, $phpEx, $phpbb_root_path, $request, $phpbb_container;
- if (!check_ids($post_ids, POSTS_TABLE, 'post_id', array('m_delete')))
+ $check_permission = ($is_soft) ? 'm_softdelete' : 'm_delete';
+ if (!phpbb_check_ids($post_ids, POSTS_TABLE, 'post_id', array($check_permission)))
{
return;
}
- $redirect = request_var('redirect', build_url(array('action', 'quickmod')));
- $forum_id = request_var('f', 0);
+ $redirect = $request->variable('redirect', build_url(array('action', 'quickmod')));
+ $forum_id = $request->variable('f', 0);
- $s_hidden_fields = build_hidden_fields(array(
+ $s_hidden_fields = array(
'post_id_list' => $post_ids,
'f' => $forum_id,
- 'action' => 'delete_post',
- 'redirect' => $redirect)
+ 'action' => $action,
+ 'redirect' => $redirect,
);
$success_msg = '';
- if (confirm_box(true))
+ if (confirm_box(true) && $is_soft)
+ {
+ $post_info = phpbb_get_post_data($post_ids);
+
+ $topic_info = $approve_log = array();
+
+ // Group the posts by topic_id
+ foreach ($post_info as $post_id => $post_data)
+ {
+ if ($post_data['post_visibility'] != ITEM_APPROVED)
+ {
+ continue;
+ }
+ $topic_id = (int) $post_data['topic_id'];
+
+ $topic_info[$topic_id]['posts'][] = (int) $post_id;
+ $topic_info[$topic_id]['forum_id'] = (int) $post_data['forum_id'];
+
+ if ($post_id == $post_data['topic_first_post_id'])
+ {
+ $topic_info[$topic_id]['first_post'] = true;
+ }
+
+ if ($post_id == $post_data['topic_last_post_id'])
+ {
+ $topic_info[$topic_id]['last_post'] = true;
+ }
+
+ $approve_log[] = array(
+ 'forum_id' => $post_data['forum_id'],
+ 'topic_id' => $post_data['topic_id'],
+ 'post_subject' => $post_data['post_subject'],
+ 'poster_id' => $post_data['poster_id'],
+ 'post_username' => $post_data['post_username'],
+ 'username' => $post_data['username'],
+ );
+ }
+
+ $phpbb_content_visibility = $phpbb_container->get('content.visibility');
+ foreach ($topic_info as $topic_id => $topic_data)
+ {
+ $phpbb_content_visibility->set_post_visibility(ITEM_DELETED, $topic_data['posts'], $topic_id, $topic_data['forum_id'], $user->data['user_id'], time(), $soft_delete_reason, isset($topic_data['first_post']), isset($topic_data['last_post']));
+ }
+ $affected_topics = sizeof($topic_info);
+ // None of the topics is really deleted, so a redirect won't hurt much.
+ $deleted_topics = 0;
+
+ $success_msg = (sizeof($post_info) == 1) ? $user->lang['POST_DELETED_SUCCESS'] : $user->lang['POSTS_DELETED_SUCCESS'];
+
+ foreach ($approve_log as $row)
+ {
+ $post_username = ($row['poster_id'] == ANONYMOUS && !empty($row['post_username'])) ? $row['post_username'] : $row['username'];
+ add_log('mod', $row['forum_id'], $row['topic_id'], 'LOG_SOFTDELETE_POST', $row['post_subject'], $post_username, $soft_delete_reason);
+ }
+
+ $topic_id = $request->variable('t', 0);
+
+ // Return links
+ $return_link = array();
+ if ($affected_topics == 1 && $topic_id)
+ {
+ $return_link[] = sprintf($user->lang['RETURN_TOPIC'], '<a href="' . append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&amp;t=$topic_id") . '">', '</a>');
+ }
+ $return_link[] = sprintf($user->lang['RETURN_FORUM'], '<a href="' . append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_id) . '">', '</a>');
+
+ }
+ else if (confirm_box(true))
{
if (!function_exists('delete_posts'))
{
@@ -899,12 +1057,12 @@ function mcp_delete_post($post_ids)
$affected_topics = sizeof($topic_id_list);
$db->sql_freeresult($result);
- $post_data = get_post_data($post_ids);
+ $post_data = phpbb_get_post_data($post_ids);
foreach ($post_data as $id => $row)
{
$post_username = ($row['poster_id'] == ANONYMOUS && !empty($row['post_username'])) ? $row['post_username'] : $row['username'];
- add_log('mod', $row['forum_id'], $row['topic_id'], 'LOG_DELETE_POST', $row['post_subject'], $post_username);
+ add_log('mod', $row['forum_id'], $row['topic_id'], 'LOG_DELETE_POST', $row['post_subject'], $post_username, $soft_delete_reason);
}
// Now delete the posts, topics and forums are automatically resync'ed
@@ -918,7 +1076,7 @@ function mcp_delete_post($post_ids)
$deleted_topics = ($row = $db->sql_fetchrow($result)) ? ($affected_topics - $row['topics_left']) : $affected_topics;
$db->sql_freeresult($result);
- $topic_id = request_var('t', 0);
+ $topic_id = $request->variable('t', 0);
// Return links
$return_link = array();
@@ -956,10 +1114,45 @@ function mcp_delete_post($post_ids)
}
else
{
- confirm_box(false, (sizeof($post_ids) == 1) ? 'DELETE_POST' : 'DELETE_POSTS', $s_hidden_fields);
+ global $template;
+
+ $user->add_lang('posting');
+
+ $only_softdeleted = false;
+ if ($auth->acl_get('m_delete', $forum_id) && $auth->acl_get('m_softdelete', $forum_id))
+ {
+ // If there are only soft deleted posts, we display a message why the option is not available
+ $sql = 'SELECT post_id
+ FROM ' . POSTS_TABLE . '
+ WHERE ' . $db->sql_in_set('post_id', $post_ids) . '
+ AND post_visibility <> ' . ITEM_DELETED;
+ $result = $db->sql_query_limit($sql, 1);
+ $only_softdeleted = !$db->sql_fetchfield('post_id');
+ $db->sql_freeresult($result);
+ }
+
+ $template->assign_vars(array(
+ 'S_SOFTDELETED' => $only_softdeleted,
+ 'S_ALLOWED_DELETE' => $auth->acl_get('m_delete', $forum_id),
+ 'S_ALLOWED_SOFTDELETE' => $auth->acl_get('m_softdelete', $forum_id),
+ 'DELETE_POST_PERMANENTLY_EXPLAIN' => $user->lang('DELETE_POST_PERMANENTLY', sizeof($post_ids)),
+ ));
+
+ $l_confirm = (sizeof($post_ids) == 1) ? 'DELETE_POST' : 'DELETE_POSTS';
+ if ($only_softdeleted)
+ {
+ $l_confirm .= '_PERMANENTLY';
+ $s_hidden_fields['delete_permanent'] = '1';
+ }
+ else if (!$auth->acl_get('m_softdelete', $forum_id))
+ {
+ $s_hidden_fields['delete_permanent'] = '1';
+ }
+
+ confirm_box(false, $l_confirm, build_hidden_fields($s_hidden_fields), 'confirm_delete_body.html');
}
- $redirect = request_var('redirect', "index.$phpEx");
+ $redirect = $request->variable('redirect', "index.$phpEx");
$redirect = reapply_sid($redirect);
if (!$success_msg)
@@ -984,9 +1177,9 @@ function mcp_delete_post($post_ids)
function mcp_fork_topic($topic_ids)
{
global $auth, $user, $db, $template, $config;
- global $phpEx, $phpbb_root_path;
+ global $phpEx, $phpbb_root_path, $phpbb_dispatcher;
- if (!check_ids($topic_ids, TOPICS_TABLE, 'topic_id', array('m_')))
+ if (!phpbb_check_ids($topic_ids, TOPICS_TABLE, 'topic_id', array('m_')))
{
return;
}
@@ -995,6 +1188,7 @@ function mcp_fork_topic($topic_ids)
$forum_id = request_var('f', 0);
$redirect = request_var('redirect', build_url(array('action', 'quickmod')));
$additional_msg = $success_msg = '';
+ $counter = array();
$s_hidden_fields = build_hidden_fields(array(
'topic_id_list' => $topic_ids,
@@ -1005,7 +1199,7 @@ function mcp_fork_topic($topic_ids)
if ($to_forum_id)
{
- $forum_data = get_forum_data($to_forum_id, 'f_post');
+ $forum_data = phpbb_get_forum_data($to_forum_id, 'f_post');
if (!sizeof($topic_ids))
{
@@ -1036,37 +1230,32 @@ function mcp_fork_topic($topic_ids)
if ($additional_msg)
{
- unset($_POST['confirm']);
- unset($_REQUEST['confirm_key']);
+ $request->overwrite('confirm', null, \phpbb\request\request_interface::POST);
+ $request->overwrite('confirm_key', null);
}
if (confirm_box(true))
{
- $topic_data = get_topic_data($topic_ids, 'f_post');
+ $topic_data = phpbb_get_topic_data($topic_ids, 'f_post');
- $total_posts = 0;
+ $total_topics = $total_topics_unapproved = $total_topics_softdeleted = 0;
+ $total_posts = $total_posts_unapproved = $total_posts_softdeleted = 0;
$new_topic_id_list = array();
-
foreach ($topic_data as $topic_id => $topic_row)
{
if (!isset($search_type) && $topic_row['enable_indexing'])
{
// Select the search method and do some additional checks to ensure it can actually be utilised
- $search_type = basename($config['search_type']);
-
- if (!file_exists($phpbb_root_path . 'includes/search/' . $search_type . '.' . $phpEx))
- {
- trigger_error('NO_SUCH_SEARCH_MODULE');
- }
+ $search_type = $config['search_type'];
if (!class_exists($search_type))
{
- include("{$phpbb_root_path}includes/search/$search_type.$phpEx");
+ trigger_error('NO_SUCH_SEARCH_MODULE');
}
$error = false;
- $search = new $search_type($error);
+ $search = new $search_type($error, $phpbb_root_path, $phpEx, $auth, $config, $db, $user, $phpbb_dispatcher);
$search_mode = 'post';
if ($error)
@@ -1083,13 +1272,14 @@ function mcp_fork_topic($topic_ids)
'forum_id' => (int) $to_forum_id,
'icon_id' => (int) $topic_row['icon_id'],
'topic_attachment' => (int) $topic_row['topic_attachment'],
- 'topic_approved' => 1,
+ 'topic_visibility' => (int) $topic_row['topic_visibility'],
'topic_reported' => 0,
'topic_title' => (string) $topic_row['topic_title'],
'topic_poster' => (int) $topic_row['topic_poster'],
'topic_time' => (int) $topic_row['topic_time'],
- 'topic_replies' => (int) $topic_row['topic_replies_real'],
- 'topic_replies_real' => (int) $topic_row['topic_replies_real'],
+ 'topic_posts_approved' => (int) $topic_row['topic_posts_approved'],
+ 'topic_posts_unapproved' => (int) $topic_row['topic_posts_unapproved'],
+ 'topic_posts_softdeleted' => (int) $topic_row['topic_posts_softdeleted'],
'topic_status' => (int) $topic_row['topic_status'],
'topic_type' => (int) $topic_row['topic_type'],
'topic_first_poster_name' => (string) $topic_row['topic_first_poster_name'],
@@ -1106,10 +1296,39 @@ function mcp_fork_topic($topic_ids)
'poll_vote_change' => (int) $topic_row['poll_vote_change'],
);
+ /**
+ * Perform actions before forked topic is created.
+ *
+ * @event core.mcp_main_modify_fork_sql
+ * @var array sql_ary SQL array to be used by $db->sql_build_array
+ * @var array topic_row Topic data
+ * @since 3.1.11-RC1
+ * @changed 3.1.11-RC1 Added variable: topic_row
+ */
+ $vars = array(
+ 'sql_ary',
+ 'topic_row',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.mcp_main_modify_fork_sql', compact($vars)));
+
$db->sql_query('INSERT INTO ' . TOPICS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary));
$new_topic_id = $db->sql_nextid();
$new_topic_id_list[$topic_id] = $new_topic_id;
+ switch ($topic_row['topic_visibility'])
+ {
+ case ITEM_APPROVED:
+ $total_topics++;
+ break;
+ case ITEM_UNAPPROVED:
+ case ITEM_REAPPROVE:
+ $total_topics_unapproved++;
+ break;
+ case ITEM_DELETED:
+ $total_topics_softdeleted++;
+ break;
+ }
+
if ($topic_row['poll_start'])
{
$poll_rows = array();
@@ -1130,12 +1349,13 @@ function mcp_fork_topic($topic_ids)
$db->sql_query('INSERT INTO ' . POLL_OPTIONS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary));
}
+ $db->sql_freeresult($result);
}
$sql = 'SELECT *
FROM ' . POSTS_TABLE . "
WHERE topic_id = $topic_id
- ORDER BY post_time ASC";
+ ORDER BY post_time ASC, post_id ASC";
$result = $db->sql_query($sql);
$post_rows = array();
@@ -1150,7 +1370,6 @@ function mcp_fork_topic($topic_ids)
continue;
}
- $total_posts += sizeof($post_rows);
foreach ($post_rows as $row)
{
$sql_ary = array(
@@ -1160,7 +1379,7 @@ function mcp_fork_topic($topic_ids)
'icon_id' => (int) $row['icon_id'],
'poster_ip' => (string) $row['poster_ip'],
'post_time' => (int) $row['post_time'],
- 'post_approved' => 1,
+ 'post_visibility' => (int) $row['post_visibility'],
'post_reported' => 0,
'enable_bbcode' => (int) $row['enable_bbcode'],
'enable_smilies' => (int) $row['enable_smilies'],
@@ -1178,12 +1397,37 @@ function mcp_fork_topic($topic_ids)
'post_edit_time' => (int) $row['post_edit_time'],
'post_edit_count' => (int) $row['post_edit_count'],
'post_edit_locked' => (int) $row['post_edit_locked'],
- 'post_postcount' => 0,
+ 'post_postcount' => $row['post_postcount'],
);
-
+ // Adjust post count only if the post can be incremented to the user counter
+ if ($row['post_postcount'])
+ {
+ if (isset($counter[$row['poster_id']]))
+ {
+ ++$counter[$row['poster_id']];
+ }
+ else
+ {
+ $counter[$row['poster_id']] = 1;
+ }
+ }
$db->sql_query('INSERT INTO ' . POSTS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary));
$new_post_id = $db->sql_nextid();
+ switch ($row['post_visibility'])
+ {
+ case ITEM_APPROVED:
+ $total_posts++;
+ break;
+ case ITEM_UNAPPROVED:
+ case ITEM_REAPPROVE:
+ $total_posts_unapproved++;
+ break;
+ case ITEM_DELETED:
+ $total_posts_softdeleted++;
+ break;
+ }
+
// Copy whether the topic is dotted
markread('post', $to_forum_id, $new_topic_id, 0, $row['poster_id']);
@@ -1276,23 +1520,31 @@ function mcp_fork_topic($topic_ids)
}
// Sync new topics, parent forums and board stats
- sync('topic', 'topic_id', $new_topic_id_list);
-
- $sync_sql = array();
-
- $sync_sql[$to_forum_id][] = 'forum_posts = forum_posts + ' . $total_posts;
- $sync_sql[$to_forum_id][] = 'forum_topics = forum_topics + ' . sizeof($new_topic_id_list);
- $sync_sql[$to_forum_id][] = 'forum_topics_real = forum_topics_real + ' . sizeof($new_topic_id_list);
+ $sql = 'UPDATE ' . FORUMS_TABLE . '
+ SET forum_posts_approved = forum_posts_approved + ' . $total_posts . ',
+ forum_posts_unapproved = forum_posts_unapproved + ' . $total_posts_unapproved . ',
+ forum_posts_softdeleted = forum_posts_softdeleted + ' . $total_posts_softdeleted . ',
+ forum_topics_approved = forum_topics_approved + ' . $total_topics . ',
+ forum_topics_unapproved = forum_topics_unapproved + ' . $total_topics_unapproved . ',
+ forum_topics_softdeleted = forum_topics_softdeleted + ' . $total_topics_softdeleted . '
+ WHERE forum_id = ' . $to_forum_id;
+ $db->sql_query($sql);
- foreach ($sync_sql as $forum_id_key => $array)
+ if (!empty($counter))
{
- $sql = 'UPDATE ' . FORUMS_TABLE . '
- SET ' . implode(', ', $array) . '
- WHERE forum_id = ' . $forum_id_key;
- $db->sql_query($sql);
+ // Do only one query per user and not a query per post.
+ foreach ($counter as $user_id => $count)
+ {
+ $sql = 'UPDATE ' . USERS_TABLE . '
+ SET user_posts = user_posts + ' . (int) $count . '
+ WHERE user_id = ' . (int) $user_id;
+ $db->sql_query($sql);
+ }
}
+ sync('topic', 'topic_id', $new_topic_id_list);
sync('forum', 'forum_id', $to_forum_id);
+
set_config_count('num_topics', sizeof($new_topic_id_list), true);
set_config_count('num_posts', $total_posts, true);
@@ -1335,5 +1587,3 @@ function mcp_fork_topic($topic_ids)
trigger_error($user->lang[$success_msg] . '<br /><br />' . $return_link);
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/mcp/mcp_notes.php b/phpBB/includes/mcp/mcp_notes.php
index 02a89c0251..465ee63a98 100644
--- a/phpBB/includes/mcp/mcp_notes.php
+++ b/phpBB/includes/mcp/mcp_notes.php
@@ -1,10 +1,13 @@
<?php
/**
*
-* @package mcp
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -19,7 +22,6 @@ if (!defined('IN_PHPBB'))
/**
* mcp_notes
* Displays notes about a user
-* @package mcp
*/
class mcp_notes
{
@@ -73,7 +75,7 @@ class mcp_notes
function mcp_notes_user_view($action)
{
global $phpEx, $phpbb_root_path, $config;
- global $template, $db, $user, $auth;
+ global $template, $db, $user, $auth, $phpbb_container;
$user_id = request_var('u', 0);
$username = request_var('username', '', true);
@@ -81,6 +83,7 @@ class mcp_notes
$st = request_var('st', 0);
$sk = request_var('sk', 'b');
$sd = request_var('sd', 'd');
+ $pagination = $phpbb_container->get('pagination');
add_form_key('mcp_notes');
@@ -174,13 +177,9 @@ class mcp_notes
}
// Generate the appropriate user information for the user we are looking at
- if (!function_exists('get_user_avatar'))
- {
- include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
- }
$rank_title = $rank_img = '';
- $avatar_img = get_user_avatar($userrow['user_avatar'], $userrow['user_avatar_type'], $userrow['user_avatar_width'], $userrow['user_avatar_height']);
+ $avatar_img = phpbb_get_user_avatar($userrow);
$limit_days = array(0 => $user->lang['ALL_ENTRIES'], 1 => $user->lang['1_DAY'], 7 => $user->lang['7_DAYS'], 14 => $user->lang['2_WEEKS'], 30 => $user->lang['1_MONTH'], 90 => $user->lang['3_MONTHS'], 180 => $user->lang['6_MONTHS'], 365 => $user->lang['1_YEAR']);
$sort_by_text = array('a' => $user->lang['SORT_USERNAME'], 'b' => $user->lang['SORT_DATE'], 'c' => $user->lang['SORT_IP'], 'd' => $user->lang['SORT_ACTION']);
@@ -216,6 +215,9 @@ class mcp_notes
}
}
+ $base_url = $this->u_action . "&amp;$u_sort_param$keywords_param";
+ $pagination->generate_template_pagination($base_url, 'pagination', 'start', $log_count, $config['topics_per_page'], $start);
+
$template->assign_vars(array(
'U_POST_ACTION' => $this->u_action,
'S_CLEAR_ALLOWED' => ($auth->acl_get('a_clearlogs')) ? true : false,
@@ -226,9 +228,7 @@ class mcp_notes
'L_TITLE' => $user->lang['MCP_NOTES_USER'],
- 'PAGE_NUMBER' => on_page($log_count, $config['topics_per_page'], $start),
- 'PAGINATION' => generate_pagination($this->u_action . "&amp;$u_sort_param$keywords_param", $log_count, $config['topics_per_page'], $start),
- 'TOTAL_REPORTS' => ($log_count == 1) ? $user->lang['LIST_REPORT'] : sprintf($user->lang['LIST_REPORTS'], $log_count),
+ 'TOTAL_REPORTS' => $user->lang('LIST_REPORTS', (int) $log_count),
'RANK_TITLE' => $rank_title,
'JOINED' => $user->format_date($userrow['user_regdate']),
@@ -247,5 +247,3 @@ class mcp_notes
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/mcp/mcp_pm_reports.php b/phpBB/includes/mcp/mcp_pm_reports.php
index 0a33c80a90..d76bedba98 100644
--- a/phpBB/includes/mcp/mcp_pm_reports.php
+++ b/phpBB/includes/mcp/mcp_pm_reports.php
@@ -1,10 +1,13 @@
<?php
/**
*
-* @package mcp
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -19,7 +22,6 @@ if (!defined('IN_PHPBB'))
/**
* mcp_reports
* Handling the reports queue
-* @package mcp
*/
class mcp_pm_reports
{
@@ -34,12 +36,13 @@ class mcp_pm_reports
function main($id, $mode)
{
global $auth, $db, $user, $template, $cache;
- global $config, $phpbb_root_path, $phpEx, $action;
+ global $config, $phpbb_root_path, $phpEx, $action, $phpbb_container;
include_once($phpbb_root_path . 'includes/functions_posting.' . $phpEx);
include_once($phpbb_root_path . 'includes/functions_privmsgs.' . $phpEx);
$start = request_var('start', 0);
+ $pagination = $phpbb_container->get('pagination');
$this->page_title = 'MCP_PM_REPORTS';
@@ -90,10 +93,14 @@ class mcp_pm_reports
trigger_error('NO_REPORT');
}
+ $phpbb_notifications = $phpbb_container->get('notification_manager');
+
+ $phpbb_notifications->mark_notifications_read_by_parent('notification.type.report_pm', $report_id, $user->data['user_id']);
+
$pm_id = $report['pm_id'];
$report_id = $report['report_id'];
- $pm_info = get_pm_data(array($pm_id));
+ $pm_info = phpbb_get_pm_data(array($pm_id));
if (!sizeof($pm_info))
{
@@ -112,17 +119,9 @@ class mcp_pm_reports
}
// Process message, leave it uncensored
- $message = $pm_info['message_text'];
+ $parse_flags = ($pm_info['bbcode_bitfield'] ? OPTION_FLAG_BBCODE : 0) | OPTION_FLAG_SMILIES;
+ $message = generate_text_for_display($pm_info['message_text'], $pm_info['bbcode_uid'], $pm_info['bbcode_bitfield'], $parse_flags, false);
- if ($pm_info['bbcode_bitfield'])
- {
- include_once($phpbb_root_path . 'includes/bbcode.' . $phpEx);
- $bbcode = new bbcode($pm_info['bbcode_bitfield']);
- $bbcode->bbcode_second_pass($message, $pm_info['bbcode_uid'], $pm_info['bbcode_bitfield']);
- }
-
- $message = bbcode_nl2br($message);
- $message = smiley_text($message);
$report['report_text'] = make_clickable(bbcode_nl2br($report['report_text']));
if ($pm_info['message_attachment'] && $auth->acl_get('u_pm_download'))
@@ -174,7 +173,7 @@ class mcp_pm_reports
'U_MCP_USER_NOTES' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&amp;mode=user_notes&amp;u=' . $pm_info['author_id']),
'U_MCP_WARN_REPORTER' => ($auth->acl_get('m_warn')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=warn&amp;mode=warn_user&amp;u=' . $report['user_id']) : '',
'U_MCP_WARN_USER' => ($auth->acl_get('m_warn')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=warn&amp;mode=warn_user&amp;u=' . $pm_info['author_id']) : '',
-
+
'EDIT_IMG' => $user->img('icon_post_edit', $user->lang['EDIT_POST']),
'MINI_POST_IMG' => $user->img('icon_post_target', 'POST'),
@@ -217,7 +216,7 @@ class mcp_pm_reports
$sort_days = $total = 0;
$sort_key = $sort_dir = '';
$sort_by_sql = $sort_order_sql = array();
- mcp_sorting($mode, $sort_days, $sort_key, $sort_dir, $sort_by_sql, $sort_order_sql, $total);
+ phpbb_mcp_sorting($mode, $sort_days, $sort_key, $sort_dir, $sort_by_sql, $sort_order_sql, $total);
$limit_time_sql = ($sort_days) ? 'AND r.report_time >= ' . (time() - ($sort_days * 86400)) : '';
@@ -294,25 +293,27 @@ class mcp_pm_reports
'REPORT_ID' => $row['report_id'],
'REPORT_TIME' => $user->format_date($row['report_time']),
- 'RECIPIENTS' => implode(', ', $address_list[$row['msg_id']]),
+ 'RECIPIENTS' => implode($user->lang['COMMA_SEPARATOR'], $address_list[$row['msg_id']]),
+ 'ATTACH_ICON_IMG' => ($auth->acl_get('u_download') && $row['message_attachment']) ? $user->img('icon_topic_attach', $user->lang['TOTAL_ATTACHMENTS']) : '',
));
}
}
}
+ $base_url = $this->u_action . "&amp;st=$sort_days&amp;sk=$sort_key&amp;sd=$sort_dir";
+ $pagination->generate_template_pagination($base_url, 'pagination', 'start', $total, $config['topics_per_page'], $start);
+
// Now display the page
$template->assign_vars(array(
'L_EXPLAIN' => ($mode == 'pm_reports') ? $user->lang['MCP_PM_REPORTS_OPEN_EXPLAIN'] : $user->lang['MCP_PM_REPORTS_CLOSED_EXPLAIN'],
'L_TITLE' => ($mode == 'pm_reports') ? $user->lang['MCP_PM_REPORTS_OPEN'] : $user->lang['MCP_PM_REPORTS_CLOSED'],
-
+
'S_PM' => true,
'S_MCP_ACTION' => $this->u_action,
'S_CLOSED' => ($mode == 'pm_reports_closed') ? true : false,
- 'PAGINATION' => generate_pagination($this->u_action . "&amp;st=$sort_days&amp;sk=$sort_key&amp;sd=$sort_dir", $total, $config['topics_per_page'], $start),
- 'PAGE_NUMBER' => on_page($total, $config['topics_per_page'], $start),
'TOTAL' => $total,
- 'TOTAL_REPORTS' => ($total == 1) ? $user->lang['LIST_REPORT'] : sprintf($user->lang['LIST_REPORTS'], $total),
+ 'TOTAL_REPORTS' => $user->lang('LIST_REPORTS', (int) $total),
)
);
@@ -321,5 +322,3 @@ class mcp_pm_reports
}
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/mcp/mcp_post.php b/phpBB/includes/mcp/mcp_post.php
index df5dc27996..1cf4a74234 100644
--- a/phpBB/includes/mcp/mcp_post.php
+++ b/phpBB/includes/mcp/mcp_post.php
@@ -1,10 +1,13 @@
<?php
/**
*
-* @package mcp
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -21,8 +24,9 @@ if (!defined('IN_PHPBB'))
*/
function mcp_post_details($id, $mode, $action)
{
- global $phpEx, $phpbb_root_path, $config;
- global $template, $db, $user, $auth, $cache;
+ global $phpEx, $phpbb_root_path, $config, $request;
+ global $template, $db, $user, $auth, $cache, $phpbb_container;
+ global $phpbb_dispatcher;
$user->add_lang('posting');
@@ -30,7 +34,7 @@ function mcp_post_details($id, $mode, $action)
$start = request_var('start', 0);
// Get post data
- $post_info = get_post_data(array($post_id), false, true);
+ $post_info = phpbb_get_post_data(array($post_id), false, true);
add_form_key('mcp_post_details');
@@ -40,7 +44,7 @@ function mcp_post_details($id, $mode, $action)
}
$post_info = $post_info[$post_id];
- $url = append_sid("{$phpbb_root_path}mcp.$phpEx?" . extra_url());
+ $url = append_sid("{$phpbb_root_path}mcp.$phpEx?" . phpbb_extra_url());
switch ($action)
{
@@ -49,7 +53,10 @@ function mcp_post_details($id, $mode, $action)
if ($auth->acl_get('m_info', $post_info['forum_id']))
{
$ip = request_var('ip', '');
- include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
+ if (!function_exists('user_ipwhois'))
+ {
+ include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
+ }
$template->assign_vars(array(
'RETURN_POST' => sprintf($user->lang['RETURN_POST'], '<a href="' . append_sid("{$phpbb_root_path}mcp.$phpEx", "i=$id&amp;mode=$mode&amp;p=$post_id") . '">', '</a>'),
@@ -103,6 +110,21 @@ function mcp_post_details($id, $mode, $action)
}
break;
+
+ default:
+
+ /**
+ * This event allows you to handle custom post moderation options
+ *
+ * @event core.mcp_post_additional_options
+ * @var string action Post moderation action name
+ * @var array post_info Information on the affected post
+ * @since 3.1.5-RC1
+ */
+ $vars = array('action', 'post_info');
+ extract($phpbb_dispatcher->trigger_event('core.mcp_post_additional_options', compact($vars)));
+
+ break;
}
// Set some vars
@@ -126,17 +148,8 @@ function mcp_post_details($id, $mode, $action)
$post_unread = (isset($topic_tracking_info[$post_info['topic_id']]) && $post_info['post_time'] > $topic_tracking_info[$post_info['topic_id']]) ? true : false;
// Process message, leave it uncensored
- $message = $post_info['post_text'];
-
- if ($post_info['bbcode_bitfield'])
- {
- include_once($phpbb_root_path . 'includes/bbcode.' . $phpEx);
- $bbcode = new bbcode($post_info['bbcode_bitfield']);
- $bbcode->bbcode_second_pass($message, $post_info['bbcode_uid'], $post_info['bbcode_bitfield']);
- }
-
- $message = bbcode_nl2br($message);
- $message = smiley_text($message);
+ $parse_flags = ($post_info['bbcode_bitfield'] ? OPTION_FLAG_BBCODE : 0) | OPTION_FLAG_SMILIES;
+ $message = generate_text_for_display($post_info['post_text'], $post_info['bbcode_uid'], $post_info['bbcode_bitfield'], $parse_flags, false);
if ($post_info['post_attachment'] && $auth->acl_get('u_download') && $auth->acl_get('f_download', $post_info['forum_id']))
{
@@ -176,7 +189,34 @@ function mcp_post_details($id, $mode, $action)
}
}
- $template->assign_vars(array(
+ // Deleting information
+ if ($post_info['post_visibility'] == ITEM_DELETED && $post_info['post_delete_user'])
+ {
+ // User having deleted the post also being the post author?
+ if (!$post_info['post_delete_user'] || $post_info['post_delete_user'] == $post_info['poster_id'])
+ {
+ $display_username = get_username_string('full', $post_info['poster_id'], $post_info['username'], $post_info['user_colour'], $post_info['post_username']);
+ }
+ else
+ {
+ $sql = 'SELECT user_id, username, user_colour
+ FROM ' . USERS_TABLE . '
+ WHERE user_id = ' . (int) $post_info['post_delete_user'];
+ $result = $db->sql_query($sql);
+ $user_delete_row = $db->sql_fetchrow($result);
+ $db->sql_freeresult($result);
+ $display_username = get_username_string('full', $post_info['post_delete_user'], $user_delete_row['username'], $user_delete_row['user_colour']);
+ }
+
+ $user->add_lang('viewtopic');
+ $l_deleted_by = $user->lang('DELETED_INFORMATION', $display_username, $user->format_date($post_info['post_delete_time'], false, true));
+ }
+ else
+ {
+ $l_deleted_by = '';
+ }
+
+ $mcp_post_template_data = array(
'U_MCP_ACTION' => "$url&amp;i=main&amp;quickmod=1&amp;mode=post_details", // Use this for mode paramaters
'U_POST_ACTION' => "$url&amp;i=$id&amp;mode=post_details", // Use this for action parameters
'U_APPROVE_ACTION' => append_sid("{$phpbb_root_path}mcp.$phpEx", "i=queue&amp;p=$post_id&amp;f={$post_info['forum_id']}"),
@@ -187,10 +227,13 @@ function mcp_post_details($id, $mode, $action)
'S_CAN_DELETE_POST' => $auth->acl_get('m_delete', $post_info['forum_id']),
'S_POST_REPORTED' => ($post_info['post_reported']) ? true : false,
- 'S_POST_UNAPPROVED' => (!$post_info['post_approved']) ? true : false,
+ 'S_POST_UNAPPROVED' => ($post_info['post_visibility'] == ITEM_UNAPPROVED || $post_info['post_visibility'] == ITEM_REAPPROVE) ? true : false,
+ 'S_POST_DELETED' => ($post_info['post_visibility'] == ITEM_DELETED) ? true : false,
'S_POST_LOCKED' => ($post_info['post_edit_locked']) ? true : false,
'S_USER_NOTES' => true,
'S_CLEAR_ALLOWED' => ($auth->acl_get('a_clearlogs')) ? true : false,
+ 'DELETED_MESSAGE' => $l_deleted_by,
+ 'DELETE_REASON' => $post_info['post_delete_reason'],
'U_EDIT' => ($auth->acl_get('m_edit', $post_info['forum_id'])) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=edit&amp;f={$post_info['forum_id']}&amp;p={$post_info['post_id']}") : '',
'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&amp;form=mcp_chgposter&amp;field=username&amp;select_single=true'),
@@ -207,6 +250,7 @@ function mcp_post_details($id, $mode, $action)
'RETURN_FORUM' => sprintf($user->lang['RETURN_FORUM'], '<a href="' . append_sid("{$phpbb_root_path}viewforum.$phpEx", "f={$post_info['forum_id']}&amp;start={$start}") . '">', '</a>'),
'REPORTED_IMG' => $user->img('icon_topic_reported', $user->lang['POST_REPORTED']),
'UNAPPROVED_IMG' => $user->img('icon_topic_unapproved', $user->lang['POST_UNAPPROVED']),
+ 'DELETED_IMG' => $user->img('icon_topic_deleted', $user->lang['POST_DELETED']),
'EDIT_IMG' => $user->img('icon_post_edit', $user->lang['EDIT_POST']),
'SEARCH_IMG' => $user->img('icon_user_search', $user->lang['SEARCH']),
@@ -224,7 +268,32 @@ function mcp_post_details($id, $mode, $action)
'U_LOOKUP_IP' => ($auth->acl_get('m_info', $post_info['forum_id'])) ? "$url&amp;i=$id&amp;mode=$mode&amp;lookup={$post_info['poster_ip']}#ip" : '',
'U_WHOIS' => ($auth->acl_get('m_info', $post_info['forum_id'])) ? append_sid("{$phpbb_root_path}mcp.$phpEx", "i=$id&amp;mode=$mode&amp;action=whois&amp;p=$post_id&amp;ip={$post_info['poster_ip']}") : '',
- ));
+ );
+
+ $s_additional_opts = false;
+
+ /**
+ * Event to add/modify MCP post template data
+ *
+ * @event core.mcp_post_template_data
+ * @var array post_info Array with the post information
+ * @var array mcp_post_template_data Array with the MCP post template data
+ * @var array attachments Array with the post attachments, if any
+ * @var bool s_additional_opts Must be set to true in extension if additional options are presented in MCP post panel
+ * @since 3.1.5-RC1
+ */
+ $vars = array(
+ 'post_info',
+ 'mcp_post_template_data',
+ 'attachments',
+ 's_additional_opts',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.mcp_post_template_data', compact($vars)));
+
+ $template->assign_vars($mcp_post_template_data);
+ $template->assign_var('S_MCP_POST_ADDITIONAL_OPTS', $s_additional_opts);
+
+ unset($mcp_post_template_data);
// Get User Notes
$log_data = array();
@@ -274,8 +343,8 @@ function mcp_post_details($id, $mode, $action)
'REPORT_ID' => $row['report_id'],
'REASON_TITLE' => $row['reason_title'],
'REASON_DESC' => $row['reason_description'],
- 'REPORTER' => ($row['user_id'] != ANONYMOUS) ? $row['username'] : $user->lang['GUEST'],
- 'U_REPORTER' => ($row['user_id'] != ANONYMOUS) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&amp;u=' . $row['user_id']) : '',
+ 'REPORTER' => get_username_string('username', $row['user_id'], $row['username']),
+ 'U_REPORTER' => get_username_string('profile', $row['user_id'], $row['username']),
'USER_NOTIFY' => ($row['user_notify']) ? true : false,
'REPORT_TIME' => $user->format_date($row['report_time']),
'REPORT_TEXT' => bbcode_nl2br(trim($row['report_text'])),
@@ -289,7 +358,11 @@ function mcp_post_details($id, $mode, $action)
// Get IP
if ($auth->acl_get('m_info', $post_info['forum_id']))
{
- $rdns_ip_num = request_var('rdns', '');
+ /** @var \phpbb\pagination $pagination */
+ $pagination = $phpbb_container->get('pagination');
+
+ $rdns_ip_num = $request->variable('rdns', '');
+ $start_users = $request->variable('start_users', 0);
if ($rdns_ip_num != 'all')
{
@@ -298,23 +371,46 @@ function mcp_post_details($id, $mode, $action)
);
}
+ $num_users = false;
+ if ($start_users)
+ {
+ $num_users = phpbb_get_num_posters_for_ip($db, $post_info['poster_ip']);
+ $start_users = $pagination->validate_start($start_users, $config['posts_per_page'], $num_users);
+ }
+
// Get other users who've posted under this IP
$sql = 'SELECT poster_id, COUNT(poster_id) as postings
FROM ' . POSTS_TABLE . "
WHERE poster_ip = '" . $db->sql_escape($post_info['poster_ip']) . "'
+ AND poster_id <> " . (int) $post_info['poster_id'] . "
GROUP BY poster_id
- ORDER BY postings DESC";
- $result = $db->sql_query($sql);
+ ORDER BY postings DESC, poster_id ASC";
+ $result = $db->sql_query_limit($sql, $config['posts_per_page'], $start_users);
+ $page_users = 0;
while ($row = $db->sql_fetchrow($result))
{
- // Fill the user select list with users who have posted under this IP
- if ($row['poster_id'] != $post_info['poster_id'])
+ $page_users++;
+ $users_ary[$row['poster_id']] = $row;
+ }
+ $db->sql_freeresult($result);
+
+ if ($page_users == $config['posts_per_page'] || $start_users)
+ {
+ if ($num_users === false)
{
- $users_ary[$row['poster_id']] = $row;
+ $num_users = phpbb_get_num_posters_for_ip($db, $post_info['poster_ip']);
}
+
+ $pagination->generate_template_pagination(
+ $url . '&amp;i=main&amp;mode=post_details',
+ 'pagination',
+ 'start_users',
+ $num_users,
+ $config['posts_per_page'],
+ $start_users
+ );
}
- $db->sql_freeresult($result);
if (sizeof($users_ary))
{
@@ -334,11 +430,11 @@ function mcp_post_details($id, $mode, $action)
foreach ($users_ary as $user_id => $user_row)
{
$template->assign_block_vars('userrow', array(
- 'USERNAME' => ($user_id == ANONYMOUS) ? $user->lang['GUEST'] : $user_row['username'],
+ 'USERNAME' => get_username_string('username', $user_id, $user_row['username']),
'NUM_POSTS' => $user_row['postings'],
'L_POST_S' => ($user_row['postings'] == 1) ? $user->lang['POST'] : $user->lang['POSTS'],
- 'U_PROFILE' => ($user_id == ANONYMOUS) ? '' : append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&amp;u=' . $user_id),
+ 'U_PROFILE' => get_username_string('profile', $user_id, $user_row['username']),
'U_SEARCHPOSTS' => append_sid("{$phpbb_root_path}search.$phpEx", 'author_id=' . $user_id . '&amp;sr=topics'))
);
}
@@ -349,16 +445,26 @@ function mcp_post_details($id, $mode, $action)
// A compound index on poster_id, poster_ip (posts table) would help speed up this query a lot,
// but the extra size is only valuable if there are persons having more than a thousands posts.
// This is better left to the really really big forums.
+ $start_ips = $request->variable('start_ips', 0);
+
+ $num_ips = false;
+ if ($start_ips)
+ {
+ $num_ips = phpbb_get_num_ips_for_poster($db, $post_info['poster_id']);
+ $start_ips = $pagination->validate_start($start_ips, $config['posts_per_page'], $num_ips);
+ }
$sql = 'SELECT poster_ip, COUNT(poster_ip) AS postings
FROM ' . POSTS_TABLE . '
WHERE poster_id = ' . $post_info['poster_id'] . "
GROUP BY poster_ip
- ORDER BY postings DESC";
- $result = $db->sql_query($sql);
+ ORDER BY postings DESC, poster_ip ASC";
+ $result = $db->sql_query_limit($sql, $config['posts_per_page'], $start_ips);
+ $page_ips = 0;
while ($row = $db->sql_fetchrow($result))
{
+ $page_ips++;
$hostname = (($rdns_ip_num == $row['poster_ip'] || $rdns_ip_num == 'all') && $row['poster_ip']) ? @gethostbyaddr($row['poster_ip']) : '';
$template->assign_block_vars('iprow', array(
@@ -373,6 +479,23 @@ function mcp_post_details($id, $mode, $action)
}
$db->sql_freeresult($result);
+ if ($page_ips == $config['posts_per_page'] || $start_ips)
+ {
+ if ($num_ips === false)
+ {
+ $num_ips = phpbb_get_num_ips_for_poster($db, $post_info['poster_id']);
+ }
+
+ $pagination->generate_template_pagination(
+ $url . '&amp;i=main&amp;mode=post_details',
+ 'pagination_ips',
+ 'start_ips',
+ $num_ips,
+ $config['posts_per_page'],
+ $start_ips
+ );
+ }
+
$user_select = '';
if (sizeof($usernames_ary))
@@ -391,11 +514,49 @@ function mcp_post_details($id, $mode, $action)
}
/**
+ * Get the number of posters for a given ip
+ *
+ * @param \phpbb\db\driver\driver_interface $db DBAL interface
+ * @param string $poster_ip IP
+ * @return int Number of posters
+ */
+function phpbb_get_num_posters_for_ip(\phpbb\db\driver\driver_interface $db, $poster_ip)
+{
+ $sql = 'SELECT COUNT(DISTINCT poster_id) as num_users
+ FROM ' . POSTS_TABLE . "
+ WHERE poster_ip = '" . $db->sql_escape($poster_ip) . "'";
+ $result = $db->sql_query($sql);
+ $num_users = (int) $db->sql_fetchfield('num_users');
+ $db->sql_freeresult($result);
+
+ return $num_users;
+}
+
+/**
+ * Get the number of ips for a given poster
+ *
+ * @param \phpbb\db\driver\driver_interface $db
+ * @param int $poster_id Poster user ID
+ * @return int Number of IPs for given poster
+ */
+function phpbb_get_num_ips_for_poster(\phpbb\db\driver\driver_interface $db, $poster_id)
+{
+ $sql = 'SELECT COUNT(DISTINCT poster_ip) as num_ips
+ FROM ' . POSTS_TABLE . '
+ WHERE poster_id = ' . (int) $poster_id;
+ $result = $db->sql_query($sql);
+ $num_ips = (int) $db->sql_fetchfield('num_ips');
+ $db->sql_freeresult($result);
+
+ return $num_ips;
+}
+
+/**
* Change a post's poster
*/
function change_poster(&$post_info, $userdata)
{
- global $auth, $db, $config, $phpbb_root_path, $phpEx;
+ global $auth, $db, $config, $phpbb_root_path, $phpEx, $user, $phpbb_dispatcher;
if (empty($userdata) || $userdata['user_id'] == $post_info['user_id'])
{
@@ -417,7 +578,7 @@ function change_poster(&$post_info, $userdata)
}
// Adjust post counts... only if the post is approved (else, it was not added the users post count anyway)
- if ($post_info['post_postcount'] && $post_info['post_approved'])
+ if ($post_info['post_postcount'] && $post_info['post_visibility'] == ITEM_APPROVED)
{
$sql = 'UPDATE ' . USERS_TABLE . '
SET user_posts = user_posts - 1
@@ -466,15 +627,13 @@ function change_poster(&$post_info, $userdata)
}
// refresh search cache of this post
- $search_type = basename($config['search_type']);
+ $search_type = $config['search_type'];
- if (file_exists($phpbb_root_path . 'includes/search/' . $search_type . '.' . $phpEx))
+ if (class_exists($search_type))
{
- require("{$phpbb_root_path}includes/search/$search_type.$phpEx");
-
// We do some additional checks in the module to ensure it can actually be utilised
$error = false;
- $search = new $search_type($error);
+ $search = new $search_type($error, $phpbb_root_path, $phpEx, $auth, $config, $db, $user, $phpbb_dispatcher);
if (!$error && method_exists($search, 'destroy_cache'))
{
@@ -485,8 +644,20 @@ function change_poster(&$post_info, $userdata)
$from_username = $post_info['username'];
$to_username = $userdata['username'];
+ /**
+ * This event allows you to perform additional tasks after changing a post's poster
+ *
+ * @event core.mcp_change_poster_after
+ * @var array userdata Information on a post's new poster
+ * @var array post_info Information on the affected post
+ * @since 3.1.6-RC1
+ * @changed 3.1.7-RC1 Change location to prevent post_info from being set to the new post information
+ */
+ $vars = array('userdata', 'post_info');
+ extract($phpbb_dispatcher->trigger_event('core.mcp_change_poster_after', compact($vars)));
+
// Renew post info
- $post_info = get_post_data(array($post_id), false, true);
+ $post_info = phpbb_get_post_data(array($post_id), false, true);
if (!sizeof($post_info))
{
@@ -498,5 +669,3 @@ function change_poster(&$post_info, $userdata)
// Now add log entry
add_log('mod', $post_info['forum_id'], $post_info['topic_id'], 'LOG_MCP_CHANGE_POSTER', $post_info['topic_title'], $from_username, $to_username);
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/mcp/mcp_queue.php b/phpBB/includes/mcp/mcp_queue.php
index acf344fd3c..3567e545f0 100644
--- a/phpBB/includes/mcp/mcp_queue.php
+++ b/phpBB/includes/mcp/mcp_queue.php
@@ -1,10 +1,13 @@
<?php
/**
*
-* @package mcp
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -19,22 +22,22 @@ if (!defined('IN_PHPBB'))
/**
* mcp_queue
* Handling the moderation queue
-* @package mcp
*/
class mcp_queue
{
var $p_master;
var $u_action;
- function mcp_queue(&$p_master)
+ public function mcp_queue(&$p_master)
{
$this->p_master = &$p_master;
}
- function main($id, $mode)
+ public function main($id, $mode)
{
- global $auth, $db, $user, $template, $cache;
- global $config, $phpbb_root_path, $phpEx, $action;
+ global $auth, $db, $user, $template, $cache, $request;
+ global $config, $phpbb_root_path, $phpEx, $action, $phpbb_container;
+ global $phpbb_dispatcher;
include_once($phpbb_root_path . 'includes/functions_posting.' . $phpEx);
@@ -46,25 +49,100 @@ class mcp_queue
switch ($action)
{
case 'approve':
- case 'disapprove':
+ case 'restore':
include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);
- $post_id_list = request_var('post_id_list', array(0));
+ $post_id_list = $request->variable('post_id_list', array(0));
+ $topic_id_list = $request->variable('topic_id_list', array(0));
- if (!sizeof($post_id_list))
+ if (!empty($post_id_list))
+ {
+ self::approve_posts($action, $post_id_list, 'queue', $mode);
+ }
+ else if (!empty($topic_id_list))
+ {
+ self::approve_topics($action, $topic_id_list, 'queue', $mode);
+ }
+ else
{
trigger_error('NO_POST_SELECTED');
}
+ break;
- if ($action == 'approve')
+ case 'delete':
+ $post_id_list = $request->variable('post_id_list', array(0));
+ $topic_id_list = $request->variable('topic_id_list', array(0));
+ $delete_reason = $request->variable('delete_reason', '', true);
+
+ if (!empty($post_id_list))
+ {
+ if (!function_exists('mcp_delete_post'))
+ {
+ global $phpbb_root_path, $phpEx;
+ include($phpbb_root_path . 'includes/mcp/mcp_main.' . $phpEx);
+ }
+ mcp_delete_post($post_id_list, false, $delete_reason, $action);
+ }
+ else if (!empty($topic_id_list))
{
- approve_post($post_id_list, 'queue', $mode);
+ if (!function_exists('mcp_delete_topic'))
+ {
+ global $phpbb_root_path, $phpEx;
+ include($phpbb_root_path . 'includes/mcp/mcp_main.' . $phpEx);
+ }
+ mcp_delete_topic($topic_id_list, false, $delete_reason, $action);
}
else
{
- disapprove_post($post_id_list, 'queue', $mode);
+ trigger_error('NO_POST_SELECTED');
+ }
+ break;
+
+ case 'disapprove':
+ $post_id_list = $request->variable('post_id_list', array(0));
+ $topic_id_list = $request->variable('topic_id_list', array(0));
+
+ if (!empty($topic_id_list) && $mode == 'deleted_topics')
+ {
+ if (!function_exists('mcp_delete_topics'))
+ {
+ global $phpbb_root_path, $phpEx;
+ include($phpbb_root_path . 'includes/mcp/mcp_main.' . $phpEx);
+ }
+ mcp_delete_topic($topic_id_list, false, '', 'disapprove');
+ return;
+ }
+
+ if (!class_exists('messenger'))
+ {
+ include($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);
+ }
+
+ if (!empty($topic_id_list))
+ {
+ $post_visibility = ($mode == 'deleted_topics') ? ITEM_DELETED : array(ITEM_UNAPPROVED, ITEM_REAPPROVE);
+ $sql = 'SELECT post_id
+ FROM ' . POSTS_TABLE . '
+ WHERE ' . $db->sql_in_set('post_visibility', $post_visibility) . '
+ AND ' . $db->sql_in_set('topic_id', $topic_id_list);
+ $result = $db->sql_query($sql);
+
+ $post_id_list = array();
+ while ($row = $db->sql_fetchrow($result))
+ {
+ $post_id_list[] = (int) $row['post_id'];
+ }
+ $db->sql_freeresult($result);
}
+ if (!empty($post_id_list))
+ {
+ self::disapprove_posts($post_id_list, 'queue', $mode);
+ }
+ else
+ {
+ trigger_error('NO_POST_SELECTED');
+ }
break;
}
@@ -79,12 +157,16 @@ class mcp_queue
$post_id = request_var('p', 0);
$topic_id = request_var('t', 0);
+ $phpbb_notifications = $phpbb_container->get('notification_manager');
+
if ($topic_id)
{
- $topic_info = get_topic_data(array($topic_id), 'm_approve');
+ $topic_info = phpbb_get_topic_data(array($topic_id), 'm_approve');
if (isset($topic_info[$topic_id]['topic_first_post_id']))
{
$post_id = (int) $topic_info[$topic_id]['topic_first_post_id'];
+
+ $phpbb_notifications->mark_notifications_read('notification.type.topic_in_queue', $topic_id, $user->data['user_id']);
}
else
{
@@ -92,7 +174,9 @@ class mcp_queue
}
}
- $post_info = get_post_data(array($post_id), 'm_approve', true);
+ $phpbb_notifications->mark_notifications_read('notification.type.post_in_queue', $post_id, $user->data['user_id']);
+
+ $post_info = phpbb_get_post_data(array($post_id), 'm_approve', true);
if (!sizeof($post_info))
{
@@ -106,8 +190,8 @@ class mcp_queue
$template->assign_vars(array(
'S_TOPIC_REVIEW' => true,
'S_BBCODE_ALLOWED' => $post_info['enable_bbcode'],
- 'TOPIC_TITLE' => $post_info['topic_title'])
- );
+ 'TOPIC_TITLE' => $post_info['topic_title'],
+ ));
}
$extensions = $attachments = $topic_tracking_info = array();
@@ -127,17 +211,8 @@ class mcp_queue
$post_unread = (isset($topic_tracking_info[$post_info['topic_id']]) && $post_info['post_time'] > $topic_tracking_info[$post_info['topic_id']]) ? true : false;
// Process message, leave it uncensored
- $message = $post_info['post_text'];
-
- if ($post_info['bbcode_bitfield'])
- {
- include_once($phpbb_root_path . 'includes/bbcode.' . $phpEx);
- $bbcode = new bbcode($post_info['bbcode_bitfield']);
- $bbcode->bbcode_second_pass($message, $post_info['bbcode_uid'], $post_info['bbcode_bitfield']);
- }
-
- $message = bbcode_nl2br($message);
- $message = smiley_text($message);
+ $parse_flags = ($post_info['bbcode_bitfield'] ? OPTION_FLAG_BBCODE : 0) | OPTION_FLAG_SMILIES;
+ $message = generate_text_for_display($post_info['post_text'], $post_info['bbcode_uid'], $post_info['bbcode_bitfield'], $parse_flags, false);
if ($post_info['post_attachment'] && $auth->acl_get('u_download') && $auth->acl_get('f_download', $post_info['forum_id']))
{
@@ -170,23 +245,54 @@ class mcp_queue
foreach ($attachments as $attachment)
{
$template->assign_block_vars('attachment', array(
- 'DISPLAY_ATTACHMENT' => $attachment)
- );
+ 'DISPLAY_ATTACHMENT' => $attachment,
+ ));
}
}
}
+ // Deleting information
+ if ($post_info['post_visibility'] == ITEM_DELETED && $post_info['post_delete_user'])
+ {
+ // User having deleted the post also being the post author?
+ if (!$post_info['post_delete_user'] || $post_info['post_delete_user'] == $post_info['poster_id'])
+ {
+ $display_username = get_username_string('full', $post_info['poster_id'], $post_info['username'], $post_info['user_colour'], $post_info['post_username']);
+ }
+ else
+ {
+ $sql = 'SELECT u.user_id, u.username, u.user_colour
+ FROM ' . POSTS_TABLE . ' p, ' . USERS_TABLE . ' u
+ WHERE p.post_id = ' . $post_info['post_id'] . '
+ AND p.post_delete_user = u.user_id';
+ $result = $db->sql_query($sql);
+ $post_delete_userinfo = $db->sql_fetchrow($result);
+ $db->sql_freeresult($result);
+ $display_username = get_username_string('full', $post_info['post_delete_user'], $post_delete_userinfo['username'], $post_delete_userinfo['user_colour']);
+ }
+
+ $l_deleted_by = $user->lang('DELETED_INFORMATION', $display_username, $user->format_date($post_info['post_delete_time'], false, true));
+ }
+ else
+ {
+ $l_deleted_by = '';
+ }
+
$post_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $post_info['forum_id'] . '&amp;p=' . $post_info['post_id'] . '#p' . $post_info['post_id']);
$topic_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $post_info['forum_id'] . '&amp;t=' . $post_info['topic_id']);
$template->assign_vars(array(
'S_MCP_QUEUE' => true,
'U_APPROVE_ACTION' => append_sid("{$phpbb_root_path}mcp.$phpEx", "i=queue&amp;p=$post_id&amp;f=$forum_id"),
+ 'S_CAN_DELETE_POST' => $auth->acl_get('m_delete', $post_info['forum_id']),
'S_CAN_VIEWIP' => $auth->acl_get('m_info', $post_info['forum_id']),
'S_POST_REPORTED' => $post_info['post_reported'],
- 'S_POST_UNAPPROVED' => !$post_info['post_approved'],
+ 'S_POST_UNAPPROVED' => $post_info['post_visibility'] == ITEM_UNAPPROVED || $post_info['post_visibility'] == ITEM_REAPPROVE,
'S_POST_LOCKED' => $post_info['post_edit_locked'],
'S_USER_NOTES' => true,
+ 'S_POST_DELETED' => ($post_info['post_visibility'] == ITEM_DELETED),
+ 'DELETED_MESSAGE' => $l_deleted_by,
+ 'DELETE_REASON' => $post_info['post_delete_reason'],
'U_EDIT' => ($auth->acl_get('m_edit', $post_info['forum_id'])) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=edit&amp;f={$post_info['forum_id']}&amp;p={$post_info['post_id']}") : '',
'U_MCP_APPROVE' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue&amp;mode=approve_details&amp;f=' . $post_info['forum_id'] . '&amp;p=' . $post_id),
@@ -198,7 +304,7 @@ class mcp_queue
'MINI_POST_IMG' => ($post_unread) ? $user->img('icon_post_target_unread', 'UNREAD_POST') : $user->img('icon_post_target', 'POST'),
- 'RETURN_QUEUE' => sprintf($user->lang['RETURN_QUEUE'], '<a href="' . append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue' . (($topic_id) ? '&amp;mode=unapproved_topics' : '&amp;mode=unapproved_posts')) . "&amp;start=$start\">", '</a>'),
+ 'RETURN_QUEUE' => sprintf($user->lang['RETURN_QUEUE'], '<a href="' . append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue' . (($topic_id) ? '&amp;mode=unapproved_topics' : '&amp;mode=unapproved_posts')) . '&amp;start=' . $start . '">', '</a>'),
'RETURN_POST' => sprintf($user->lang['RETURN_POST'], '<a href="' . $post_url . '">', '</a>'),
'RETURN_TOPIC_SIMPLE' => sprintf($user->lang['RETURN_TOPIC_SIMPLE'], '<a href="' . $topic_url . '">', '</a>'),
'REPORTED_IMG' => $user->img('icon_topic_reported', $user->lang['POST_REPORTED']),
@@ -225,14 +331,22 @@ class mcp_queue
case 'unapproved_topics':
case 'unapproved_posts':
+ case 'deleted_topics':
+ case 'deleted_posts':
+ $m_perm = 'm_approve';
+ $is_topics = ($mode == 'unapproved_topics' || $mode == 'deleted_topics') ? true : false;
+ $is_restore = ($mode == 'deleted_posts' || $mode == 'deleted_topics') ? true : false;
+ $visibility_const = (!$is_restore) ? array(ITEM_UNAPPROVED, ITEM_REAPPROVE) : ITEM_DELETED;
+
$user->add_lang(array('viewtopic', 'viewforum'));
- $topic_id = request_var('t', 0);
+ $topic_id = $request->variable('t', 0);
$forum_info = array();
+ $pagination = $phpbb_container->get('pagination');
if ($topic_id)
{
- $topic_info = get_topic_data(array($topic_id));
+ $topic_info = phpbb_get_topic_data(array($topic_id));
if (!sizeof($topic_info))
{
@@ -243,7 +357,7 @@ class mcp_queue
$forum_id = $topic_info['forum_id'];
}
- $forum_list_approve = get_forum_list('m_approve', false, true);
+ $forum_list_approve = get_forum_list($m_perm, false, true);
$forum_list_read = array_flip(get_forum_list('f_read', true, true)); // Flipped so we can isset() the forum IDs
// Remove forums we cannot read
@@ -269,20 +383,16 @@ class mcp_queue
trigger_error('NOT_MODERATOR');
}
- $global_id = $forum_list[0];
-
- $forum_list = implode(', ', $forum_list);
-
- $sql = 'SELECT SUM(forum_topics) as sum_forum_topics
- FROM ' . FORUMS_TABLE . "
- WHERE forum_id IN (0, $forum_list)";
+ $sql = 'SELECT SUM(forum_topics_approved) as sum_forum_topics
+ FROM ' . FORUMS_TABLE . '
+ WHERE ' . $db->sql_in_set('forum_id', $forum_list);
$result = $db->sql_query($sql);
- $forum_info['forum_topics'] = (int) $db->sql_fetchfield('sum_forum_topics');
+ $forum_info['forum_topics_approved'] = (int) $db->sql_fetchfield('sum_forum_topics');
$db->sql_freeresult($result);
}
else
{
- $forum_info = get_forum_data(array($forum_id), 'm_approve');
+ $forum_info = phpbb_get_forum_data(array($forum_id), $m_perm);
if (!sizeof($forum_info))
{
@@ -291,37 +401,60 @@ class mcp_queue
$forum_info = $forum_info[$forum_id];
$forum_list = $forum_id;
- $global_id = $forum_id;
}
$forum_options = '<option value="0"' . (($forum_id == 0) ? ' selected="selected"' : '') . '>' . $user->lang['ALL_FORUMS'] . '</option>';
foreach ($forum_list_approve as $row)
{
- $forum_options .= '<option value="' . $row['forum_id'] . '"' . (($forum_id == $row['forum_id']) ? ' selected="selected"' : '') . '>' . str_repeat('&nbsp; &nbsp;', $row['padding']) . $row['forum_name'] . '</option>';
+ $forum_options .= '<option value="' . $row['forum_id'] . '"' . (($forum_id == $row['forum_id']) ? ' selected="selected"' : '') . '>' . str_repeat('&nbsp; &nbsp;', $row['padding']) . truncate_string($row['forum_name'], 30, 255, false, $user->lang['ELLIPSIS']) . '</option>';
}
$sort_days = $total = 0;
$sort_key = $sort_dir = '';
$sort_by_sql = $sort_order_sql = array();
- mcp_sorting($mode, $sort_days, $sort_key, $sort_dir, $sort_by_sql, $sort_order_sql, $total, $forum_id, $topic_id);
+ phpbb_mcp_sorting($mode, $sort_days, $sort_key, $sort_dir, $sort_by_sql, $sort_order_sql, $total, $forum_id, $topic_id);
- $forum_topics = ($total == -1) ? $forum_info['forum_topics'] : $total;
+ $forum_topics = ($total == -1) ? $forum_info['forum_topics_approved'] : $total;
$limit_time_sql = ($sort_days) ? 'AND t.topic_last_post_time >= ' . (time() - ($sort_days * 86400)) : '';
$forum_names = array();
- if ($mode == 'unapproved_posts')
+ if (!$is_topics)
{
$sql = 'SELECT p.post_id
- FROM ' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . ' t' . (($sort_order_sql[0] == 'u') ? ', ' . USERS_TABLE . ' u' : '') . "
- WHERE p.forum_id IN (0, $forum_list)
- AND p.post_approved = 0
- " . (($sort_order_sql[0] == 'u') ? 'AND u.user_id = p.poster_id' : '') . '
+ FROM ' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . ' t' . (($sort_order_sql[0] == 'u') ? ', ' . USERS_TABLE . ' u' : '') . '
+ WHERE ' . $db->sql_in_set('p.forum_id', $forum_list) . '
+ AND ' . $db->sql_in_set('p.post_visibility', $visibility_const) . '
+ ' . (($sort_order_sql[0] == 'u') ? 'AND u.user_id = p.poster_id' : '') . '
' . (($topic_id) ? 'AND p.topic_id = ' . $topic_id : '') . "
AND t.topic_id = p.topic_id
- AND t.topic_first_post_id <> p.post_id
+ AND (t.topic_visibility <> p.post_visibility
+ OR t.topic_delete_user = 0)
$limit_time_sql
ORDER BY $sort_order_sql";
+
+ /**
+ * Alter sql query to get posts in queue to be accepted
+ *
+ * @event core.mcp_queue_get_posts_query_before
+ * @var string sql Associative array with the query to be executed
+ * @var array forum_list List of forums that contain the posts
+ * @var int visibility_const Integer with one of the possible ITEM_* constant values
+ * @var int topic_id If topic_id not equal to 0, the topic id to filter the posts to display
+ * @var string limit_time_sql String with the SQL code to limit the time interval of the post (Note: May be empty string)
+ * @var string sort_order_sql String with the ORDER BY SQL code used in this query
+ * @since 3.1.0-RC3
+ */
+ $vars = array(
+ 'sql',
+ 'forum_list',
+ 'visibility_const',
+ 'topic_id',
+ 'limit_time_sql',
+ 'sort_order_sql',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.mcp_queue_get_posts_query_before', compact($vars)));
+
$result = $db->sql_query_limit($sql, $config['topics_per_page'], $start);
$i = 0;
@@ -335,7 +468,7 @@ class mcp_queue
if (sizeof($post_ids))
{
- $sql = 'SELECT t.topic_id, t.topic_title, t.forum_id, p.post_id, p.post_subject, p.post_username, p.poster_id, p.post_time, u.username, u.username_clean, u.user_colour
+ $sql = 'SELECT t.topic_id, t.topic_title, t.forum_id, p.post_id, p.post_subject, p.post_username, p.poster_id, p.post_time, p.post_attachment, u.username, u.username_clean, u.user_colour
FROM ' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . ' t, ' . USERS_TABLE . ' u
WHERE ' . $db->sql_in_set('p.post_id', $post_ids) . '
AND t.topic_id = p.topic_id
@@ -346,10 +479,7 @@ class mcp_queue
$post_data = $rowset = array();
while ($row = $db->sql_fetchrow($result))
{
- if ($row['forum_id'])
- {
- $forum_names[] = $row['forum_id'];
- }
+ $forum_names[] = $row['forum_id'];
$post_data[$row['post_id']] = $row;
}
$db->sql_freeresult($result);
@@ -367,21 +497,42 @@ class mcp_queue
}
else
{
- $sql = 'SELECT t.forum_id, t.topic_id, t.topic_title, t.topic_title AS post_subject, t.topic_time AS post_time, t.topic_poster AS poster_id, t.topic_first_post_id AS post_id, t.topic_first_poster_name AS username, t.topic_first_poster_colour AS user_colour
- FROM ' . TOPICS_TABLE . " t
- WHERE forum_id IN (0, $forum_list)
- AND topic_approved = 0
+ $sql = 'SELECT t.forum_id, t.topic_id, t.topic_title, t.topic_title AS post_subject, t.topic_time AS post_time, t.topic_poster AS poster_id, t.topic_first_post_id AS post_id, t.topic_attachment AS post_attachment, t.topic_first_poster_name AS username, t.topic_first_poster_colour AS user_colour
+ FROM ' . TOPICS_TABLE . ' t
+ WHERE ' . $db->sql_in_set('forum_id', $forum_list) . '
+ AND ' . $db->sql_in_set('topic_visibility', $visibility_const) . "
+ AND topic_delete_user <> 0
$limit_time_sql
ORDER BY $sort_order_sql";
+
+ /**
+ * Alter sql query to get information on all topics in the list of forums provided.
+ *
+ * @event core.mcp_queue_get_posts_for_topics_query_before
+ * @var string sql String with the query to be executed
+ * @var array forum_list List of forums that contain the posts
+ * @var int visibility_const Integer with one of the possible ITEM_* constant values
+ * @var int topic_id topic_id in the page request
+ * @var string limit_time_sql String with the SQL code to limit the time interval of the post (Note: May be empty string)
+ * @var string sort_order_sql String with the ORDER BY SQL code used in this query
+ * @since 3.1.0-RC3
+ */
+ $vars = array(
+ 'sql',
+ 'forum_list',
+ 'visibility_const',
+ 'topic_id',
+ 'limit_time_sql',
+ 'sort_order_sql',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.mcp_queue_get_posts_for_topics_query_before', compact($vars)));
+
$result = $db->sql_query_limit($sql, $config['topics_per_page'], $start);
$rowset = array();
while ($row = $db->sql_fetchrow($result))
{
- if ($row['forum_id'])
- {
- $forum_names[] = $row['forum_id'];
- }
+ $forum_names[] = $row['forum_id'];
$rowset[] = $row;
}
$db->sql_freeresult($result);
@@ -405,20 +556,14 @@ class mcp_queue
foreach ($rowset as $row)
{
- $global_topic = ($row['forum_id']) ? false : true;
- if ($global_topic)
- {
- $row['forum_id'] = $global_id;
- }
-
if (empty($row['post_username']))
{
- $row['post_username'] = $user->lang['GUEST'];
+ $row['post_username'] = $row['username'] ?: $user->lang['GUEST'];
}
$template->assign_block_vars('postrow', array(
'U_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id'] . '&amp;t=' . $row['topic_id']),
- 'U_VIEWFORUM' => (!$global_topic) ? append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $row['forum_id']) : '',
+ 'U_VIEWFORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $row['forum_id']),
'U_VIEWPOST' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id'] . '&amp;p=' . $row['post_id']) . (($mode == 'unapproved_posts') ? '#p' . $row['post_id'] : ''),
'U_VIEW_DETAILS' => append_sid("{$phpbb_root_path}mcp.$phpEx", "i=queue&amp;start=$start&amp;mode=approve_details&amp;f={$row['forum_id']}&amp;p={$row['post_id']}" . (($mode == 'unapproved_topics') ? "&amp;t={$row['topic_id']}" : '')),
@@ -428,574 +573,866 @@ class mcp_queue
'U_POST_AUTHOR' => get_username_string('profile', $row['poster_id'], $row['username'], $row['user_colour'], $row['post_username']),
'POST_ID' => $row['post_id'],
- 'FORUM_NAME' => (!$global_topic) ? $forum_names[$row['forum_id']] : $user->lang['GLOBAL_ANNOUNCEMENT'],
+ 'TOPIC_ID' => $row['topic_id'],
+ 'FORUM_NAME' => $forum_names[$row['forum_id']],
'POST_SUBJECT' => ($row['post_subject'] != '') ? $row['post_subject'] : $user->lang['NO_SUBJECT'],
'TOPIC_TITLE' => $row['topic_title'],
- 'POST_TIME' => $user->format_date($row['post_time']))
- );
+ 'POST_TIME' => $user->format_date($row['post_time']),
+ 'ATTACH_ICON_IMG' => ($auth->acl_get('u_download') && $auth->acl_get('f_download', $row['forum_id']) && $row['post_attachment']) ? $user->img('icon_topic_attach', $user->lang['TOTAL_ATTACHMENTS']) : '',
+ ));
}
unset($rowset, $forum_names);
+ $base_url = $this->u_action . "&amp;f=$forum_id&amp;st=$sort_days&amp;sk=$sort_key&amp;sd=$sort_dir";
+ $pagination->generate_template_pagination($base_url, 'pagination', 'start', $total, $config['topics_per_page'], $start);
+
// Now display the page
$template->assign_vars(array(
- 'L_DISPLAY_ITEMS' => ($mode == 'unapproved_posts') ? $user->lang['DISPLAY_POSTS'] : $user->lang['DISPLAY_TOPICS'],
- 'L_EXPLAIN' => ($mode == 'unapproved_posts') ? $user->lang['MCP_QUEUE_UNAPPROVED_POSTS_EXPLAIN'] : $user->lang['MCP_QUEUE_UNAPPROVED_TOPICS_EXPLAIN'],
- 'L_TITLE' => ($mode == 'unapproved_posts') ? $user->lang['MCP_QUEUE_UNAPPROVED_POSTS'] : $user->lang['MCP_QUEUE_UNAPPROVED_TOPICS'],
+ 'L_DISPLAY_ITEMS' => (!$is_topics) ? $user->lang['DISPLAY_POSTS'] : $user->lang['DISPLAY_TOPICS'],
+ 'L_EXPLAIN' => $user->lang['MCP_QUEUE_' . strtoupper($mode) . '_EXPLAIN'],
+ 'L_TITLE' => $user->lang['MCP_QUEUE_' . strtoupper($mode)],
'L_ONLY_TOPIC' => ($topic_id) ? sprintf($user->lang['ONLY_TOPIC'], $topic_info['topic_title']) : '',
'S_FORUM_OPTIONS' => $forum_options,
'S_MCP_ACTION' => build_url(array('t', 'f', 'sd', 'st', 'sk')),
- 'S_TOPICS' => ($mode == 'unapproved_posts') ? false : true,
+ 'S_TOPICS' => $is_topics,
+ 'S_RESTORE' => $is_restore,
- 'PAGINATION' => generate_pagination($this->u_action . "&amp;f=$forum_id&amp;st=$sort_days&amp;sk=$sort_key&amp;sd=$sort_dir", $total, $config['topics_per_page'], $start),
- 'PAGE_NUMBER' => on_page($total, $config['topics_per_page'], $start),
'TOPIC_ID' => $topic_id,
- 'TOTAL' => ($total == 1) ? (($mode == 'unapproved_posts') ? $user->lang['VIEW_TOPIC_POST'] : $user->lang['VIEW_FORUM_TOPIC']) : sprintf((($mode == 'unapproved_posts') ? $user->lang['VIEW_TOPIC_POSTS'] : $user->lang['VIEW_FORUM_TOPICS']), $total),
+ 'TOTAL' => $user->lang(((!$is_topics) ? 'VIEW_TOPIC_POSTS' : 'VIEW_FORUM_TOPICS'), (int) $total),
));
$this->tpl_name = 'mcp_queue';
break;
}
}
-}
-
-/**
-* Approve Post/Topic
-*/
-function approve_post($post_id_list, $id, $mode)
-{
- global $db, $template, $user, $config;
- global $phpEx, $phpbb_root_path;
- if (!check_ids($post_id_list, POSTS_TABLE, 'post_id', array('m_approve')))
+ /**
+ * Approve/Restore posts
+ *
+ * @param $action string Action we perform on the posts ('approve' or 'restore')
+ * @param $post_id_list array IDs of the posts to approve/restore
+ * @param $id mixed Category of the current active module
+ * @param $mode string Active module
+ * @return null
+ */
+ static public function approve_posts($action, $post_id_list, $id, $mode)
{
- trigger_error('NOT_AUTHORISED');
- }
+ global $db, $template, $user, $config, $request, $phpbb_container, $phpbb_dispatcher;
+ global $phpEx, $phpbb_root_path;
- $redirect = request_var('redirect', build_url(array('quickmod')));
- $success_msg = '';
-
- $s_hidden_fields = build_hidden_fields(array(
- 'i' => $id,
- 'mode' => $mode,
- 'post_id_list' => $post_id_list,
- 'action' => 'approve',
- 'redirect' => $redirect)
- );
-
- $post_info = get_post_data($post_id_list, 'm_approve');
+ if (!phpbb_check_ids($post_id_list, POSTS_TABLE, 'post_id', array('m_approve')))
+ {
+ trigger_error('NOT_AUTHORISED');
+ }
- if (confirm_box(true))
- {
- $notify_poster = (isset($_REQUEST['notify_poster'])) ? true : false;
+ $redirect = $request->variable('redirect', build_url(array('quickmod')));
+ $redirect = reapply_sid($redirect);
+ $success_msg = $post_url = '';
+ $approve_log = array();
+ $num_topics = 0;
- // If Topic -> total_topics = total_topics+1, total_posts = total_posts+1, forum_topics = forum_topics+1, forum_posts = forum_posts+1
- // If Post -> total_posts = total_posts+1, forum_posts = forum_posts+1, topic_replies = topic_replies+1
+ $s_hidden_fields = build_hidden_fields(array(
+ 'i' => $id,
+ 'mode' => $mode,
+ 'post_id_list' => $post_id_list,
+ 'action' => $action,
+ 'redirect' => $redirect,
+ ));
- $total_topics = $total_posts = 0;
- $topic_approve_sql = $post_approve_sql = $topic_id_list = $forum_id_list = $approve_log = array();
- $user_posts_sql = $post_approved_list = array();
+ $post_info = phpbb_get_post_data($post_id_list, 'm_approve');
- foreach ($post_info as $post_id => $post_data)
+ if (confirm_box(true))
{
- if ($post_data['post_approved'])
- {
- $post_approved_list[] = $post_id;
- continue;
- }
+ $notify_poster = ($action == 'approve' && isset($_REQUEST['notify_poster']));
- $topic_id_list[$post_data['topic_id']] = 1;
+ $topic_info = array();
- if ($post_data['forum_id'])
+ // Group the posts by topic_id
+ foreach ($post_info as $post_id => $post_data)
{
- $forum_id_list[$post_data['forum_id']] = 1;
- }
+ if ($post_data['post_visibility'] == ITEM_APPROVED)
+ {
+ continue;
+ }
+ $topic_id = (int) $post_data['topic_id'];
- // User post update (we do not care about topic or post, since user posts are strictly connected to posts)
- // But we care about forums where post counts get not increased. ;)
- if ($post_data['post_postcount'])
- {
- $user_posts_sql[$post_data['poster_id']] = (empty($user_posts_sql[$post_data['poster_id']])) ? 1 : $user_posts_sql[$post_data['poster_id']] + 1;
- }
+ $topic_info[$topic_id]['posts'][] = (int) $post_id;
+ $topic_info[$topic_id]['forum_id'] = (int) $post_data['forum_id'];
- // Topic or Post. ;)
- if ($post_data['topic_first_post_id'] == $post_id)
- {
- if ($post_data['forum_id'])
+ // Refresh the first post, if the time or id is older then the current one
+ if ($post_id <= $post_data['topic_first_post_id'] || $post_data['post_time'] <= $post_data['topic_time'])
+ {
+ $topic_info[$topic_id]['first_post'] = true;
+ }
+
+ // Refresh the last post, if the time or id is newer then the current one
+ if ($post_id >= $post_data['topic_last_post_id'] || $post_data['post_time'] >= $post_data['topic_last_post_time'])
{
- $total_topics++;
+ $topic_info[$topic_id]['last_post'] = true;
}
- $topic_approve_sql[] = $post_data['topic_id'];
+
+ $post_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f={$post_data['forum_id']}&amp;t={$post_data['topic_id']}&amp;p={$post_data['post_id']}") . '#p' . $post_data['post_id'];
$approve_log[] = array(
- 'type' => 'topic',
- 'post_subject' => $post_data['post_subject'],
'forum_id' => $post_data['forum_id'],
'topic_id' => $post_data['topic_id'],
+ 'post_subject' => $post_data['post_subject'],
);
}
- else
+
+ $phpbb_content_visibility = $phpbb_container->get('content.visibility');
+ foreach ($topic_info as $topic_id => $topic_data)
{
- $approve_log[] = array(
- 'type' => 'post',
- 'post_subject' => $post_data['post_subject'],
- 'forum_id' => $post_data['forum_id'],
- 'topic_id' => $post_data['topic_id'],
- );
+ $phpbb_content_visibility->set_post_visibility(ITEM_APPROVED, $topic_data['posts'], $topic_id, $topic_data['forum_id'], $user->data['user_id'], time(), '', isset($topic_data['first_post']), isset($topic_data['last_post']));
+ }
+
+ foreach ($approve_log as $log_data)
+ {
+ add_log('mod', $log_data['forum_id'], $log_data['topic_id'], 'LOG_POST_' . strtoupper($action) . 'D', $log_data['post_subject']);
}
- if ($post_data['forum_id'])
+ // Only send out the mails, when the posts are being approved
+ if ($action == 'approve')
{
- $total_posts++;
+ $phpbb_notifications = $phpbb_container->get('notification_manager');
- // Increment by topic_replies if we approve a topic...
- // This works because we do not adjust the topic_replies when re-approving a topic after an edit.
- if ($post_data['topic_first_post_id'] == $post_id && $post_data['topic_replies'])
+ // Handle notifications
+ foreach ($post_info as $post_id => $post_data)
{
- $total_posts += $post_data['topic_replies'];
+ // A single topic approval may also happen here, so handle deleting the respective notification.
+ if (!$post_data['topic_posts_approved'])
+ {
+ $phpbb_notifications->delete_notifications('notification.type.topic_in_queue', $post_data['topic_id']);
+
+ if ($post_data['post_visibility'] == ITEM_UNAPPROVED)
+ {
+ $phpbb_notifications->add_notifications(array('notification.type.topic'), $post_data);
+ }
+ if ($post_data['post_visibility'] != ITEM_APPROVED)
+ {
+ $num_topics++;
+ }
+ }
+ else
+ {
+ // Only add notifications, if we are not reapproving post
+ // When the topic was already approved, but was edited and
+ // now needs re-approval, we don't want to notify the users
+ // again.
+ if ($post_data['post_visibility'] == ITEM_UNAPPROVED)
+ {
+ $phpbb_notifications->add_notifications(array(
+ 'notification.type.bookmark',
+ 'notification.type.post',
+ ), $post_data);
+ }
+ }
+ $phpbb_notifications->add_notifications(array('notification.type.quote'), $post_data);
+ $phpbb_notifications->delete_notifications('notification.type.post_in_queue', $post_id);
+
+ $phpbb_notifications->mark_notifications_read(array(
+ 'notification.type.quote',
+ 'notification.type.bookmark',
+ 'notification.type.post',
+ ), $post_data['post_id'], $user->data['user_id']);
+
+ // Notify Poster?
+ if ($notify_poster)
+ {
+ if ($post_data['poster_id'] == ANONYMOUS)
+ {
+ continue;
+ }
+
+ if (!$post_data['topic_posts_approved'])
+ {
+ $phpbb_notifications->add_notifications('notification.type.approve_topic', $post_data);
+ }
+ else
+ {
+ $phpbb_notifications->add_notifications('notification.type.approve_post', $post_data);
+ }
+ }
}
}
- $post_approve_sql[] = $post_id;
- }
+ if ($num_topics >= 1)
+ {
+ $success_msg = ($num_topics == 1) ? 'TOPIC_' . strtoupper($action) . 'D_SUCCESS' : 'TOPICS_' . strtoupper($action) . 'D_SUCCESS';
+ }
+ else
+ {
+ $success_msg = (sizeof($post_info) == 1) ? 'POST_' . strtoupper($action) . 'D_SUCCESS' : 'POSTS_' . strtoupper($action) . 'D_SUCCESS';
+ }
- $post_id_list = array_values(array_diff($post_id_list, $post_approved_list));
- for ($i = 0, $size = sizeof($post_approved_list); $i < $size; $i++)
- {
- unset($post_info[$post_approved_list[$i]]);
- }
+ /**
+ * Perform additional actions during post(s) approval
+ *
+ * @event core.approve_posts_after
+ * @var string action Variable containing the action we perform on the posts ('approve' or 'restore')
+ * @var array post_info Array containing info for all posts being approved
+ * @var array topic_info Array containing info for all parent topics of the posts
+ * @var int num_topics Variable containing number of topics
+ * @var bool notify_poster Variable telling if the post should be notified or not
+ * @var string success_msg Variable containing the language key for the success message
+ * @var string redirect Variable containing the redirect url
+ * @since 3.1.4-RC1
+ */
+ $vars = array(
+ 'action',
+ 'post_info',
+ 'topic_info',
+ 'num_topics',
+ 'notify_poster',
+ 'success_msg',
+ 'redirect',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.approve_posts_after', compact($vars)));
+
+ meta_refresh(3, $redirect);
+ $message = $user->lang[$success_msg];
+
+ if ($request->is_ajax())
+ {
+ $json_response = new \phpbb\json_response;
+ $json_response->send(array(
+ 'MESSAGE_TITLE' => $user->lang['INFORMATION'],
+ 'MESSAGE_TEXT' => $message,
+ 'REFRESH_DATA' => null,
+ 'visible' => true,
+ ));
+ }
+ $message .= '<br /><br />' . $user->lang('RETURN_PAGE', '<a href="' . $redirect . '">', '</a>');
- if (sizeof($topic_approve_sql))
- {
- $sql = 'UPDATE ' . TOPICS_TABLE . '
- SET topic_approved = 1
- WHERE ' . $db->sql_in_set('topic_id', $topic_approve_sql);
- $db->sql_query($sql);
+ // If approving one post, also give links back to post...
+ if (sizeof($post_info) == 1 && $post_url)
+ {
+ $message .= '<br /><br />' . $user->lang('RETURN_POST', '<a href="' . $post_url . '">', '</a>');
+ }
+ trigger_error($message);
}
-
- if (sizeof($post_approve_sql))
+ else
{
- $sql = 'UPDATE ' . POSTS_TABLE . '
- SET post_approved = 1
- WHERE ' . $db->sql_in_set('post_id', $post_approve_sql);
- $db->sql_query($sql);
- }
+ $show_notify = false;
- unset($topic_approve_sql, $post_approve_sql);
+ if ($action == 'approve')
+ {
+ foreach ($post_info as $post_data)
+ {
+ if (!$post_data['topic_posts_approved'])
+ {
+ $num_topics++;
+ }
- foreach ($approve_log as $log_data)
- {
- add_log('mod', $log_data['forum_id'], $log_data['topic_id'], ($log_data['type'] == 'topic') ? 'LOG_TOPIC_APPROVED' : 'LOG_POST_APPROVED', $log_data['post_subject']);
- }
+ if (!$show_notify && $post_data['poster_id'] != ANONYMOUS)
+ {
+ $show_notify = true;
+ }
+ }
+ }
- if (sizeof($user_posts_sql))
- {
- // Try to minimize the query count by merging users with the same post count additions
- $user_posts_update = array();
+ $template->assign_vars(array(
+ 'S_NOTIFY_POSTER' => $show_notify,
+ 'S_' . strtoupper($action) => true,
+ ));
- foreach ($user_posts_sql as $user_id => $user_posts)
+ // Create the confirm box message
+ $action_msg = strtoupper($action);
+ $num_posts = sizeof($post_id_list) - $num_topics;
+ if ($num_topics > 0 && $num_posts <= 0)
{
- $user_posts_update[$user_posts][] = $user_id;
+ $action_msg .= '_TOPIC' . (($num_topics == 1) ? '' : 'S');
}
-
- foreach ($user_posts_update as $user_posts => $user_id_ary)
+ else
{
- $sql = 'UPDATE ' . USERS_TABLE . '
- SET user_posts = user_posts + ' . $user_posts . '
- WHERE ' . $db->sql_in_set('user_id', $user_id_ary);
- $db->sql_query($sql);
+ $action_msg .= '_POST' . ((sizeof($post_id_list) == 1) ? '' : 'S');
}
+ confirm_box(false, $action_msg, $s_hidden_fields, 'mcp_approve.html');
}
- if ($total_topics)
- {
- set_config_count('num_topics', $total_topics, true);
- }
+ redirect($redirect);
+ }
- if ($total_posts)
+ /**
+ * Approve/Restore topics
+ *
+ * @param $action string Action we perform on the posts ('approve' or 'restore')
+ * @param $topic_id_list array IDs of the topics to approve/restore
+ * @param $id mixed Category of the current active module
+ * @param $mode string Active module
+ * @return null
+ */
+ static public function approve_topics($action, $topic_id_list, $id, $mode)
+ {
+ global $db, $template, $user, $config;
+ global $phpEx, $phpbb_root_path, $request, $phpbb_container, $phpbb_dispatcher;
+
+ if (!phpbb_check_ids($topic_id_list, TOPICS_TABLE, 'topic_id', array('m_approve')))
{
- set_config_count('num_posts', $total_posts, true);
+ trigger_error('NOT_AUTHORISED');
}
- sync('topic', 'topic_id', array_keys($topic_id_list), true);
- sync('forum', 'forum_id', array_keys($forum_id_list), true, true);
- unset($topic_id_list, $forum_id_list);
+ $redirect = $request->variable('redirect', build_url(array('quickmod')));
+ $redirect = reapply_sid($redirect);
+ $success_msg = $topic_url = '';
+ $approve_log = array();
- $messenger = new messenger();
+ $s_hidden_fields = build_hidden_fields(array(
+ 'i' => $id,
+ 'mode' => $mode,
+ 'topic_id_list' => $topic_id_list,
+ 'action' => $action,
+ 'redirect' => $redirect,
+ ));
- // Notify Poster?
- if ($notify_poster)
- {
- foreach ($post_info as $post_id => $post_data)
- {
- if ($post_data['poster_id'] == ANONYMOUS)
- {
- continue;
- }
+ $topic_info = phpbb_get_topic_data($topic_id_list, 'm_approve');
- $email_template = ($post_data['post_id'] == $post_data['topic_first_post_id'] && $post_data['post_id'] == $post_data['topic_last_post_id']) ? 'topic_approved' : 'post_approved';
+ if (confirm_box(true))
+ {
+ $notify_poster = ($action == 'approve' && isset($_REQUEST['notify_poster'])) ? true : false;
- $messenger->template($email_template, $post_data['user_lang']);
+ $phpbb_content_visibility = $phpbb_container->get('content.visibility');
+ $first_post_ids = array();
- $messenger->to($post_data['user_email'], $post_data['username']);
- $messenger->im($post_data['user_jabber'], $post_data['username']);
+ foreach ($topic_info as $topic_id => $topic_data)
+ {
+ $phpbb_content_visibility->set_topic_visibility(ITEM_APPROVED, $topic_id, $topic_data['forum_id'], $user->data['user_id'], time(), '');
+ $first_post_ids[$topic_id] = (int) $topic_data['topic_first_post_id'];
- $messenger->assign_vars(array(
- 'USERNAME' => htmlspecialchars_decode($post_data['username']),
- 'POST_SUBJECT' => htmlspecialchars_decode(censor_text($post_data['post_subject'])),
- 'TOPIC_TITLE' => htmlspecialchars_decode(censor_text($post_data['topic_title'])),
+ $topic_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f={$topic_data['forum_id']}&amp;t={$topic_id}");
- 'U_VIEW_TOPIC' => generate_board_url() . "/viewtopic.$phpEx?f={$post_data['forum_id']}&t={$post_data['topic_id']}&e=0",
- 'U_VIEW_POST' => generate_board_url() . "/viewtopic.$phpEx?f={$post_data['forum_id']}&t={$post_data['topic_id']}&p=$post_id&e=$post_id")
+ $approve_log[] = array(
+ 'forum_id' => $topic_data['forum_id'],
+ 'topic_id' => $topic_data['topic_id'],
+ 'topic_title' => $topic_data['topic_title'],
);
+ }
- $messenger->send($post_data['user_notify_type']);
+ if (sizeof($topic_info) >= 1)
+ {
+ $success_msg = (sizeof($topic_info) == 1) ? 'TOPIC_' . strtoupper($action) . 'D_SUCCESS' : 'TOPICS_' . strtoupper($action) . 'D_SUCCESS';
}
- }
- $messenger->save_queue();
+ foreach ($approve_log as $log_data)
+ {
+ add_log('mod', $log_data['forum_id'], $log_data['topic_id'], 'LOG_TOPIC_' . strtoupper($action) . 'D', $log_data['topic_title']);
+ }
- // Send out normal user notifications
- $email_sig = str_replace('<br />', "\n", "-- \n" . $config['board_email_sig']);
+ // Only send out the mails, when the posts are being approved
+ if ($action == 'approve')
+ {
+ // Grab the first post text as it's needed for the quote notification.
+ $sql = 'SELECT topic_id, post_text
+ FROM ' . POSTS_TABLE . '
+ WHERE ' . $db->sql_in_set('post_id', $first_post_ids);
+ $result = $db->sql_query($sql);
- foreach ($post_info as $post_id => $post_data)
- {
- $username = ($post_data['post_username']) ? $post_data['post_username'] : $post_data['username'];
+ while ($row = $db->sql_fetchrow($result))
+ {
+ $topic_info[$row['topic_id']]['post_text'] = $row['post_text'];
+ }
+ $db->sql_freeresult($result);
- if ($post_id == $post_data['topic_first_post_id'] && $post_id == $post_data['topic_last_post_id'])
- {
- // Forum Notifications
- user_notification('post', $post_data['topic_title'], $post_data['topic_title'], $post_data['forum_name'], $post_data['forum_id'], $post_data['topic_id'], $post_id, $username);
+ // Handle notifications
+ $phpbb_notifications = $phpbb_container->get('notification_manager');
+
+ foreach ($topic_info as $topic_id => $topic_data)
+ {
+ $topic_data = array_merge($topic_data, array(
+ 'post_id' => $topic_data['topic_first_post_id'],
+ 'post_subject' => $topic_data['topic_title'],
+ 'post_time' => $topic_data['topic_time'],
+ 'poster_id' => $topic_data['topic_poster'],
+ 'post_username' => $topic_data['topic_first_poster_name'],
+ ));
+
+ $phpbb_notifications->delete_notifications('notification.type.topic_in_queue', $topic_id);
+
+ // Only add notifications, if we are not reapproving post
+ // When the topic was already approved, but was edited and
+ // now needs re-approval, we don't want to notify the users
+ // again.
+ if ($topic_data['topic_visibility'] == ITEM_UNAPPROVED)
+ {
+ $phpbb_notifications->add_notifications(array(
+ 'notification.type.quote',
+ 'notification.type.topic',
+ ), $topic_data);
+ }
+
+ $phpbb_notifications->mark_notifications_read('notification.type.quote', $topic_data['post_id'], $user->data['user_id']);
+ $phpbb_notifications->mark_notifications_read('notification.type.topic', $topic_id, $user->data['user_id']);
+
+ if ($notify_poster)
+ {
+ $phpbb_notifications->add_notifications('notification.type.approve_topic', $topic_data);
+ }
+ }
}
- else
+
+ /**
+ * Perform additional actions during topics(s) approval
+ *
+ * @event core.approve_topics_after
+ * @var string action Variable containing the action we perform on the posts ('approve' or 'restore')
+ * @var mixed topic_info Array containing info for all topics being approved
+ * @var array first_post_ids Array containing ids of all first posts
+ * @var bool notify_poster Variable telling if the poster should be notified or not
+ * @var string success_msg Variable containing the language key for the success message
+ * @var string redirect Variable containing the redirect url
+ * @since 3.1.4-RC1
+ */
+ $vars = array(
+ 'action',
+ 'topic_info',
+ 'first_post_ids',
+ 'notify_poster',
+ 'success_msg',
+ 'redirect',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.approve_topics_after', compact($vars)));
+
+ meta_refresh(3, $redirect);
+ $message = $user->lang[$success_msg];
+
+ if ($request->is_ajax())
{
- // Topic Notifications
- user_notification('reply', $post_data['post_subject'], $post_data['topic_title'], $post_data['forum_name'], $post_data['forum_id'], $post_data['topic_id'], $post_id, $username);
+ $json_response = new \phpbb\json_response;
+ $json_response->send(array(
+ 'MESSAGE_TITLE' => $user->lang['INFORMATION'],
+ 'MESSAGE_TEXT' => $message,
+ 'REFRESH_DATA' => null,
+ 'visible' => true,
+ ));
}
- }
-
- if (sizeof($post_id_list) == 1)
- {
- $post_data = $post_info[$post_id_list[0]];
- $post_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f={$post_data['forum_id']}&amp;t={$post_data['topic_id']}&amp;p={$post_data['post_id']}") . '#p' . $post_data['post_id'];
- }
- unset($post_info);
+ $message .= '<br /><br />' . $user->lang('RETURN_PAGE', '<a href="' . $redirect . '">', '</a>');
- if ($total_topics)
- {
- $success_msg = ($total_topics == 1) ? 'TOPIC_APPROVED_SUCCESS' : 'TOPICS_APPROVED_SUCCESS';
+ // If approving one topic, also give links back to topic...
+ if (sizeof($topic_info) == 1 && $topic_url)
+ {
+ $message .= '<br /><br />' . $user->lang('RETURN_TOPIC', '<a href="' . $topic_url . '">', '</a>');
+ }
+ trigger_error($message);
}
else
{
- $success_msg = (sizeof($post_id_list) + sizeof($post_approved_list) == 1) ? 'POST_APPROVED_SUCCESS' : 'POSTS_APPROVED_SUCCESS';
- }
- }
- else
- {
- $show_notify = false;
+ $show_notify = false;
- if ($config['email_enable'] || $config['jab_enable'])
- {
- foreach ($post_info as $post_data)
+ if ($action == 'approve')
{
- if ($post_data['poster_id'] == ANONYMOUS)
- {
- continue;
- }
- else
+ foreach ($topic_info as $topic_data)
{
- $show_notify = true;
- break;
+ if ($topic_data['topic_poster'] == ANONYMOUS)
+ {
+ continue;
+ }
+ else
+ {
+ $show_notify = true;
+ break;
+ }
}
}
- }
-
- $template->assign_vars(array(
- 'S_NOTIFY_POSTER' => $show_notify,
- 'S_APPROVE' => true)
- );
- confirm_box(false, 'APPROVE_POST' . ((sizeof($post_id_list) == 1) ? '' : 'S'), $s_hidden_fields, 'mcp_approve.html');
- }
+ $template->assign_vars(array(
+ 'S_NOTIFY_POSTER' => $show_notify,
+ 'S_' . strtoupper($action) => true,
+ ));
- $redirect = request_var('redirect', "index.$phpEx");
- $redirect = reapply_sid($redirect);
+ confirm_box(false, strtoupper($action) . '_TOPIC' . ((sizeof($topic_id_list) == 1) ? '' : 'S'), $s_hidden_fields, 'mcp_approve.html');
+ }
- if (!$success_msg)
- {
redirect($redirect);
}
- else
+
+ /**
+ * Disapprove Post
+ *
+ * @param $post_id_list array IDs of the posts to disapprove/delete
+ * @param $id mixed Category of the current active module
+ * @param $mode string Active module
+ * @return null
+ */
+ static public function disapprove_posts($post_id_list, $id, $mode)
{
- meta_refresh(3, $redirect);
+ global $db, $template, $user, $config, $phpbb_container, $phpbb_dispatcher;
+ global $phpEx, $phpbb_root_path, $request;
- // If approving one post, also give links back to post...
- $add_message = '';
- if (sizeof($post_id_list) == 1 && !empty($post_url))
+ if (!phpbb_check_ids($post_id_list, POSTS_TABLE, 'post_id', array('m_approve')))
{
- $add_message = '<br /><br />' . sprintf($user->lang['RETURN_POST'], '<a href="' . $post_url . '">', '</a>');
+ trigger_error('NOT_AUTHORISED');
}
- trigger_error($user->lang[$success_msg] . '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], "<a href=\"$redirect\">", '</a>') . $add_message);
- }
-}
-
-/**
-* Disapprove Post/Topic
-*/
-function disapprove_post($post_id_list, $id, $mode)
-{
- global $db, $template, $user, $config;
- global $phpEx, $phpbb_root_path;
-
- if (!check_ids($post_id_list, POSTS_TABLE, 'post_id', array('m_approve')))
- {
- trigger_error('NOT_AUTHORISED');
- }
+ $redirect = $request->variable('redirect', build_url(array('t', 'mode', 'quickmod')) . "&amp;mode=$mode");
+ $redirect = reapply_sid($redirect);
+ $reason = $request->variable('reason', '', true);
+ $reason_id = $request->variable('reason_id', 0);
+ $success_msg = $additional_msg = '';
- $redirect = request_var('redirect', build_url(array('t', 'mode', 'quickmod')) . "&amp;mode=$mode");
- $reason = utf8_normalize_nfc(request_var('reason', '', true));
- $reason_id = request_var('reason_id', 0);
- $success_msg = $additional_msg = '';
+ $s_hidden_fields = build_hidden_fields(array(
+ 'i' => $id,
+ 'mode' => $mode,
+ 'post_id_list' => $post_id_list,
+ 'action' => 'disapprove',
+ 'redirect' => $redirect,
+ ));
- $s_hidden_fields = build_hidden_fields(array(
- 'i' => $id,
- 'mode' => $mode,
- 'post_id_list' => $post_id_list,
- 'action' => 'disapprove',
- 'redirect' => $redirect)
- );
+ $notify_poster = $request->is_set('notify_poster');
+ $disapprove_reason = '';
- $notify_poster = (isset($_REQUEST['notify_poster'])) ? true : false;
- $disapprove_reason = '';
-
- if ($reason_id)
- {
- $sql = 'SELECT reason_title, reason_description
- FROM ' . REPORTS_REASONS_TABLE . "
- WHERE reason_id = $reason_id";
- $result = $db->sql_query($sql);
- $row = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
-
- if (!$row || (!$reason && strtolower($row['reason_title']) == 'other'))
- {
- $additional_msg = $user->lang['NO_REASON_DISAPPROVAL'];
- unset($_REQUEST['confirm_key']);
- unset($_POST['confirm_key']);
- unset($_POST['confirm']);
- }
- else
+ if ($reason_id)
{
- // If the reason is defined within the language file, we will use the localized version, else just use the database entry...
- $disapprove_reason = (strtolower($row['reason_title']) != 'other') ? ((isset($user->lang['report_reasons']['DESCRIPTION'][strtoupper($row['reason_title'])])) ? $user->lang['report_reasons']['DESCRIPTION'][strtoupper($row['reason_title'])] : $row['reason_description']) : '';
- $disapprove_reason .= ($reason) ? "\n\n" . $reason : '';
-
- if (isset($user->lang['report_reasons']['DESCRIPTION'][strtoupper($row['reason_title'])]))
+ $sql = 'SELECT reason_title, reason_description
+ FROM ' . REPORTS_REASONS_TABLE . "
+ WHERE reason_id = $reason_id";
+ $result = $db->sql_query($sql);
+ $row = $db->sql_fetchrow($result);
+ $db->sql_freeresult($result);
+
+ if (!$row || (!$reason && strtolower($row['reason_title']) == 'other'))
{
- $disapprove_reason_lang = strtoupper($row['reason_title']);
+ $additional_msg = $user->lang['NO_REASON_DISAPPROVAL'];
+
+ $request->overwrite('confirm', null, \phpbb\request\request_interface::POST);
+ $request->overwrite('confirm_key', null, \phpbb\request\request_interface::POST);
+ $request->overwrite('confirm_key', null, \phpbb\request\request_interface::REQUEST);
}
+ else
+ {
+ // If the reason is defined within the language file, we will use the localized version, else just use the database entry...
+ $disapprove_reason = (strtolower($row['reason_title']) != 'other') ? ((isset($user->lang['report_reasons']['DESCRIPTION'][strtoupper($row['reason_title'])])) ? $user->lang['report_reasons']['DESCRIPTION'][strtoupper($row['reason_title'])] : $row['reason_description']) : '';
+ $disapprove_reason .= ($reason) ? "\n\n" . $reason : '';
- $email_disapprove_reason = $disapprove_reason;
+ if (isset($user->lang['report_reasons']['DESCRIPTION'][strtoupper($row['reason_title'])]))
+ {
+ $disapprove_reason_lang = strtoupper($row['reason_title']);
+ }
+ }
}
- }
-
- $post_info = get_post_data($post_id_list, 'm_approve');
- if (confirm_box(true))
- {
- $disapprove_log = $disapprove_log_topics = $disapprove_log_posts = array();
- $topic_replies_real = $post_disapprove_list = array();
+ $post_info = phpbb_get_post_data($post_id_list, 'm_approve');
- // Build a list of posts to be unapproved and get the related topics real replies count
+ $is_disapproving = false;
foreach ($post_info as $post_id => $post_data)
{
- $post_disapprove_list[$post_id] = $post_data['topic_id'];
- if (!isset($topic_replies_real[$post_data['topic_id']]))
+ if ($post_data['post_visibility'] == ITEM_DELETED)
{
- $topic_replies_real[$post_data['topic_id']] = $post_data['topic_replies_real'];
+ continue;
}
+
+ $is_disapproving = true;
}
- // Now we build the log array
- foreach ($post_disapprove_list as $post_id => $topic_id)
+ if (confirm_box(true))
{
- // If the count of disapproved posts for the topic is greater
- // than topic's real replies count, the whole topic is disapproved/deleted
- if (sizeof(array_keys($post_disapprove_list, $topic_id)) > $topic_replies_real[$topic_id])
+ $disapprove_log = $disapprove_log_topics = $disapprove_log_posts = array();
+ $topic_posts_unapproved = $post_disapprove_list = $topic_information = array();
+
+ // Build a list of posts to be disapproved and get the related topics real replies count
+ foreach ($post_info as $post_id => $post_data)
{
- // Don't write the log more than once for every topic
- if (!isset($disapprove_log_topics[$topic_id]))
+ if ($mode === 'unapproved_topics' && $post_data['post_visibility'] == ITEM_APPROVED)
{
- // Build disapproved topics log
- $disapprove_log_topics[$topic_id] = array(
- 'type' => 'topic',
- 'post_subject' => $post_info[$post_id]['topic_title'],
- 'forum_id' => $post_info[$post_id]['forum_id'],
- 'topic_id' => 0, // useless to log a topic id, as it will be deleted
- );
+ continue;
+ }
+
+ $post_disapprove_list[$post_id] = $post_data['topic_id'];
+ if (!isset($topic_posts_unapproved[$post_data['topic_id']]))
+ {
+ $topic_information[$post_data['topic_id']] = $post_data;
+ $topic_posts_unapproved[$post_data['topic_id']] = 0;
}
+ $topic_posts_unapproved[$post_data['topic_id']]++;
}
- else
+
+ // Do not try to disapprove if no posts are selected
+ if (empty($post_disapprove_list))
{
- // Build disapproved posts log
- $disapprove_log_posts[] = array(
- 'type' => 'post',
- 'post_subject' => $post_info[$post_id]['post_subject'],
- 'forum_id' => $post_info[$post_id]['forum_id'],
- 'topic_id' => $post_info[$post_id]['topic_id'],
- );
+ trigger_error('NO_POST_SELECTED');
+ }
+ // Now we build the log array
+ foreach ($post_disapprove_list as $post_id => $topic_id)
+ {
+ // If the count of disapproved posts for the topic is equal
+ // to the number of unapproved posts in the topic, and there are no different
+ // posts, we disapprove the hole topic
+ if ($topic_information[$topic_id]['topic_posts_approved'] == 0 &&
+ $topic_information[$topic_id]['topic_posts_softdeleted'] == 0 &&
+ $topic_information[$topic_id]['topic_posts_unapproved'] == $topic_posts_unapproved[$topic_id])
+ {
+ // Don't write the log more than once for every topic
+ if (!isset($disapprove_log_topics[$topic_id]))
+ {
+ // Build disapproved topics log
+ $disapprove_log_topics[$topic_id] = array(
+ 'type' => 'topic',
+ 'post_subject' => $post_info[$post_id]['topic_title'],
+ 'forum_id' => $post_info[$post_id]['forum_id'],
+ 'topic_id' => 0, // useless to log a topic id, as it will be deleted
+ 'post_username' => ($post_info[$post_id]['poster_id'] == ANONYMOUS && !empty($post_info[$post_id]['post_username'])) ? $post_info[$post_id]['post_username'] : $post_info[$post_id]['username'],
+ );
+ }
+ }
+ else
+ {
+ // Build disapproved posts log
+ $disapprove_log_posts[] = array(
+ 'type' => 'post',
+ 'post_subject' => $post_info[$post_id]['post_subject'],
+ 'forum_id' => $post_info[$post_id]['forum_id'],
+ 'topic_id' => $post_info[$post_id]['topic_id'],
+ 'post_username' => ($post_info[$post_id]['poster_id'] == ANONYMOUS && !empty($post_info[$post_id]['post_username'])) ? $post_info[$post_id]['post_username'] : $post_info[$post_id]['username'],
+ );
+
+ }
}
- }
- // Get disapproved posts/topics counts separately
- $num_disapproved_topics = sizeof($disapprove_log_topics);
- $num_disapproved_posts = sizeof($disapprove_log_posts);
+ // Get disapproved posts/topics counts separately
+ $num_disapproved_topics = sizeof($disapprove_log_topics);
+ $num_disapproved_posts = sizeof($disapprove_log_posts);
- // Build the whole log
- $disapprove_log = array_merge($disapprove_log_topics, $disapprove_log_posts);
+ // Build the whole log
+ $disapprove_log = array_merge($disapprove_log_topics, $disapprove_log_posts);
- // Unset unneeded arrays
- unset($post_data, $disapprove_log_topics, $disapprove_log_posts);
+ // Unset unneeded arrays
+ unset($post_data, $disapprove_log_topics, $disapprove_log_posts);
- // Let's do the job - delete disapproved posts
- if (sizeof($post_disapprove_list))
- {
- if (!function_exists('delete_posts'))
+ // Let's do the job - delete disapproved posts
+ if (sizeof($post_disapprove_list))
{
- include_once($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
- }
+ if (!function_exists('delete_posts'))
+ {
+ include($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
+ }
- // We do not check for permissions here, because the moderator allowed approval/disapproval should be allowed to delete the disapproved posts
- // Note: function delete_posts triggers related forums/topics sync,
- // so we don't need to call update_post_information later and to adjust real topic replies or forum topics count manually
- delete_posts('post_id', array_keys($post_disapprove_list));
+ // We do not check for permissions here, because the moderator allowed approval/disapproval should be allowed to delete the disapproved posts
+ // Note: function delete_posts triggers related forums/topics sync,
+ // so we don't need to call update_post_information later and to adjust real topic replies or forum topics count manually
+ delete_posts('post_id', array_keys($post_disapprove_list));
- foreach ($disapprove_log as $log_data)
- {
- add_log('mod', $log_data['forum_id'], $log_data['topic_id'], ($log_data['type'] == 'topic') ? 'LOG_TOPIC_DISAPPROVED' : 'LOG_POST_DISAPPROVED', $log_data['post_subject'], $disapprove_reason);
+ foreach ($disapprove_log as $log_data)
+ {
+ if ($is_disapproving)
+ {
+ $l_log_message = ($log_data['type'] == 'topic') ? 'LOG_TOPIC_DISAPPROVED' : 'LOG_POST_DISAPPROVED';
+ add_log('mod', $log_data['forum_id'], $log_data['topic_id'], $l_log_message, $log_data['post_subject'], $disapprove_reason, $log_data['post_username']);
+ }
+ else
+ {
+ $l_log_message = ($log_data['type'] == 'topic') ? 'LOG_DELETE_TOPIC' : 'LOG_DELETE_POST';
+ add_log('mod', $log_data['forum_id'], $log_data['topic_id'], $l_log_message, $log_data['post_subject'], $log_data['post_username']);
+ }
+ }
}
- }
- $messenger = new messenger();
+ $phpbb_notifications = $phpbb_container->get('notification_manager');
- // Notify Poster?
- if ($notify_poster)
- {
$lang_reasons = array();
foreach ($post_info as $post_id => $post_data)
{
- if ($post_data['poster_id'] == ANONYMOUS)
+ $disapprove_all_posts_in_topic = $topic_information[$topic_id]['topic_posts_approved'] == 0 &&
+ $topic_information[$topic_id]['topic_posts_softdeleted'] == 0 &&
+ $topic_information[$topic_id]['topic_posts_unapproved'] == $topic_posts_unapproved[$topic_id];
+
+ $phpbb_notifications->delete_notifications('notification.type.post_in_queue', $post_id);
+
+ // Do we disapprove the whole topic? Remove potential notifications
+ if ($disapprove_all_posts_in_topic)
{
- continue;
+ $phpbb_notifications->delete_notifications('notification.type.topic_in_queue', $post_data['topic_id']);
}
- if (isset($disapprove_reason_lang))
+ // Notify Poster?
+ if ($notify_poster)
{
- // Okay we need to get the reason from the posters language
- if (!isset($lang_reasons[$post_data['user_lang']]))
+ if ($post_data['poster_id'] == ANONYMOUS)
{
- // Assign the current users translation as the default, this is not ideal but getting the board default adds another layer of complexity.
- $lang_reasons[$post_data['user_lang']] = $user->lang['report_reasons']['DESCRIPTION'][$disapprove_reason_lang];
+ continue;
+ }
- // Only load up the language pack if the language is different to the current one
- if ($post_data['user_lang'] != $user->lang_name && file_exists($phpbb_root_path . '/language/' . $post_data['user_lang'] . '/mcp.' . $phpEx))
+ $post_data['disapprove_reason'] = $disapprove_reason;
+ if (isset($disapprove_reason_lang))
+ {
+ // Okay we need to get the reason from the posters language
+ if (!isset($lang_reasons[$post_data['user_lang']]))
{
- // Load up the language pack
- $lang = array();
- @include($phpbb_root_path . '/language/' . basename($post_data['user_lang']) . '/mcp.' . $phpEx);
+ // Assign the current users translation as the default, this is not ideal but getting the board default adds another layer of complexity.
+ $lang_reasons[$post_data['user_lang']] = $user->lang['report_reasons']['DESCRIPTION'][$disapprove_reason_lang];
- // If we find the reason in this language pack use it
- if (isset($lang['report_reasons']['DESCRIPTION'][$disapprove_reason_lang]))
+ // Only load up the language pack if the language is different to the current one
+ if ($post_data['user_lang'] != $user->lang_name && file_exists($phpbb_root_path . '/language/' . $post_data['user_lang'] . '/mcp.' . $phpEx))
{
- $lang_reasons[$post_data['user_lang']] = $lang['report_reasons']['DESCRIPTION'][$disapprove_reason_lang];
- }
+ // Load up the language pack
+ $lang = array();
+ @include($phpbb_root_path . '/language/' . basename($post_data['user_lang']) . '/mcp.' . $phpEx);
+
+ // If we find the reason in this language pack use it
+ if (isset($lang['report_reasons']['DESCRIPTION'][$disapprove_reason_lang]))
+ {
+ $lang_reasons[$post_data['user_lang']] = $lang['report_reasons']['DESCRIPTION'][$disapprove_reason_lang];
+ }
- unset($lang); // Free memory
+ unset($lang); // Free memory
+ }
}
+
+ $post_data['disapprove_reason'] = $lang_reasons[$post_data['user_lang']];
+ $post_data['disapprove_reason'] .= ($reason) ? "\n\n" . $reason : '';
}
- $email_disapprove_reason = $lang_reasons[$post_data['user_lang']];
- $email_disapprove_reason .= ($reason) ? "\n\n" . $reason : '';
+ if ($disapprove_all_posts_in_topic && $topic_information[$topic_id]['topic_posts_unapproved'] == 1)
+ {
+ // If there is only 1 post when disapproving the topic,
+ // we send the user a "disapprove topic" notification...
+ $phpbb_notifications->add_notifications('notification.type.disapprove_topic', $post_data);
+ }
+ else
+ {
+ // ... otherwise there are multiple unapproved posts and
+ // all of them are disapproved as posts.
+ $phpbb_notifications->add_notifications('notification.type.disapprove_post', $post_data);
+ }
}
+ }
- $email_template = ($post_data['post_id'] == $post_data['topic_first_post_id'] && $post_data['post_id'] == $post_data['topic_last_post_id']) ? 'topic_disapproved' : 'post_disapproved';
-
- $messenger->template($email_template, $post_data['user_lang']);
-
- $messenger->to($post_data['user_email'], $post_data['username']);
- $messenger->im($post_data['user_jabber'], $post_data['username']);
-
- $messenger->assign_vars(array(
- 'USERNAME' => htmlspecialchars_decode($post_data['username']),
- 'REASON' => htmlspecialchars_decode($email_disapprove_reason),
- 'POST_SUBJECT' => htmlspecialchars_decode(censor_text($post_data['post_subject'])),
- 'TOPIC_TITLE' => htmlspecialchars_decode(censor_text($post_data['topic_title'])))
- );
-
- $messenger->send($post_data['user_notify_type']);
+ if ($num_disapproved_topics)
+ {
+ $success_msg = ($num_disapproved_topics == 1) ? 'TOPIC' : 'TOPICS';
+ }
+ else
+ {
+ $success_msg = ($num_disapproved_posts == 1) ? 'POST' : 'POSTS';
}
- unset($lang_reasons);
- }
- unset($post_info, $disapprove_reason, $email_disapprove_reason, $disapprove_reason_lang);
+ if ($is_disapproving)
+ {
+ $success_msg .= '_DISAPPROVED_SUCCESS';
+ }
+ else
+ {
+ $success_msg .= '_DELETED_SUCCESS';
+ }
- $messenger->save_queue();
+ // If we came from viewtopic, we try to go back to it.
+ if (strpos($redirect, $phpbb_root_path . 'viewtopic.' . $phpEx) === 0)
+ {
+ if ($num_disapproved_topics == 0)
+ {
+ // So we need to remove the post id part from the Url
+ $redirect = str_replace("&amp;p={$post_id_list[0]}#p{$post_id_list[0]}", '', $redirect);
+ }
+ else
+ {
+ // However this is only possible if the topic still exists,
+ // Otherwise we go back to the viewforum page
+ $redirect = append_sid($phpbb_root_path . 'viewforum.' . $phpEx, 'f=' . $request->variable('f', 0));
+ }
+ }
- if ($num_disapproved_topics)
- {
- $success_msg = ($num_disapproved_topics == 1) ? 'TOPIC_DISAPPROVED_SUCCESS' : 'TOPICS_DISAPPROVED_SUCCESS';
+ /**
+ * Perform additional actions during post(s) disapproval
+ *
+ * @event core.disapprove_posts_after
+ * @var array post_info Array containing info for all posts being disapproved
+ * @var array topic_information Array containing information for the topics
+ * @var array topic_posts_unapproved Array containing list of topic ids and the count of disapproved posts in them
+ * @var array post_disapprove_list Array containing list of posts and their topic id
+ * @var int num_disapproved_topics Variable containing the number of disapproved topics
+ * @var int num_disapproved_posts Variable containing the number of disapproved posts
+ * @var array lang_reasons Array containing the language keys for reasons
+ * @var string disapprove_reason Variable containing the language key for the success message
+ * @var string disapprove_reason_lang Variable containing the language key for the success message
+ * @var bool is_disapproving Variable telling if anything is going to be disapproved
+ * @var bool notify_poster Variable telling if the post should be notified or not
+ * @var string success_msg Variable containing the language key for the success message
+ * @var string redirect Variable containing the redirect url
+ * @since 3.1.4-RC1
+ */
+ $vars = array(
+ 'post_info',
+ 'topic_information',
+ 'topic_posts_unapproved',
+ 'post_disapprove_list',
+ 'num_disapproved_topics',
+ 'num_disapproved_posts',
+ 'lang_reasons',
+ 'disapprove_reason',
+ 'disapprove_reason_lang',
+ 'is_disapproving',
+ 'notify_poster',
+ 'success_msg',
+ 'redirect',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.disapprove_posts_after', compact($vars)));
+
+ unset($lang_reasons, $post_info, $disapprove_reason, $disapprove_reason_lang);
+
+ meta_refresh(3, $redirect);
+ $message = $user->lang[$success_msg];
+
+ if ($request->is_ajax())
+ {
+ $json_response = new \phpbb\json_response;
+ $json_response->send(array(
+ 'MESSAGE_TITLE' => $user->lang['INFORMATION'],
+ 'MESSAGE_TEXT' => $message,
+ 'REFRESH_DATA' => null,
+ 'visible' => false,
+ ));
+ }
+ $message .= '<br /><br />' . $user->lang('RETURN_PAGE', '<a href="' . $redirect . '">', '</a>');
+ trigger_error($message);
}
else
{
- $success_msg = ($num_disapproved_posts == 1) ? 'POST_DISAPPROVED_SUCCESS' : 'POSTS_DISAPPROVED_SUCCESS';
- }
- }
- else
- {
- include_once($phpbb_root_path . 'includes/functions_display.' . $phpEx);
+ if (!function_exists('display_reasons'))
+ {
+ include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
+ }
- display_reasons($reason_id);
+ $show_notify = false;
- $show_notify = false;
+ foreach ($post_info as $post_data)
+ {
+ if ($post_data['poster_id'] == ANONYMOUS)
+ {
+ continue;
+ }
+ else
+ {
+ $show_notify = true;
+ break;
+ }
+ }
- foreach ($post_info as $post_data)
- {
- if ($post_data['poster_id'] == ANONYMOUS)
+ $l_confirm_msg = 'DISAPPROVE_POST';
+ $confirm_template = 'mcp_approve.html';
+ if ($is_disapproving)
{
- continue;
+ display_reasons($reason_id);
}
else
{
- $show_notify = true;
- break;
- }
- }
+ $user->add_lang('posting');
- $template->assign_vars(array(
- 'S_NOTIFY_POSTER' => $show_notify,
- 'S_APPROVE' => false,
- 'REASON' => $reason,
- 'ADDITIONAL_MSG' => $additional_msg)
- );
+ $l_confirm_msg = 'DELETE_POST_PERMANENTLY';
+ $confirm_template = 'confirm_delete_body.html';
+ }
+ $l_confirm_msg .= ((sizeof($post_id_list) == 1) ? '' : 'S');
- confirm_box(false, 'DISAPPROVE_POST' . ((sizeof($post_id_list) == 1) ? '' : 'S'), $s_hidden_fields, 'mcp_approve.html');
- }
+ $template->assign_vars(array(
+ 'S_NOTIFY_POSTER' => $show_notify,
+ 'S_APPROVE' => false,
+ 'REASON' => ($is_disapproving) ? $reason : '',
+ 'ADDITIONAL_MSG' => $additional_msg,
+ ));
- $redirect = request_var('redirect', "index.$phpEx");
- $redirect = reapply_sid($redirect);
+ confirm_box(false, $l_confirm_msg, $s_hidden_fields, $confirm_template);
+ }
- if (!$success_msg)
- {
redirect($redirect);
}
- else
- {
- meta_refresh(3, $redirect);
- trigger_error($user->lang[$success_msg] . '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], "<a href=\"$redirect\">", '</a>'));
- }
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/mcp/mcp_reports.php b/phpBB/includes/mcp/mcp_reports.php
index b13c8b20c6..6bb606a990 100644
--- a/phpBB/includes/mcp/mcp_reports.php
+++ b/phpBB/includes/mcp/mcp_reports.php
@@ -1,10 +1,13 @@
<?php
/**
*
-* @package mcp
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -19,7 +22,6 @@ if (!defined('IN_PHPBB'))
/**
* mcp_reports
* Handling the reports queue
-* @package mcp
*/
class mcp_reports
{
@@ -34,7 +36,7 @@ class mcp_reports
function main($id, $mode)
{
global $auth, $db, $user, $template, $cache;
- global $config, $phpbb_root_path, $phpEx, $action;
+ global $config, $phpbb_root_path, $phpEx, $action, $phpbb_container, $phpbb_dispatcher;
include_once($phpbb_root_path . 'includes/functions_posting.' . $phpEx);
@@ -71,23 +73,75 @@ class mcp_reports
// closed reports are accessed by report id
$report_id = request_var('r', 0);
+ $sql_ary = array(
+ 'SELECT' => 'r.post_id, r.user_id, r.report_id, r.report_closed, report_time, r.report_text, r.reported_post_text, r.reported_post_uid, r.reported_post_bitfield, r.reported_post_enable_magic_url, r.reported_post_enable_smilies, r.reported_post_enable_bbcode, rr.reason_title, rr.reason_description, u.username, u.username_clean, u.user_colour',
+
+ 'FROM' => array(
+ REPORTS_TABLE => 'r',
+ REPORTS_REASONS_TABLE => 'rr',
+ USERS_TABLE => 'u',
+ ),
- $sql = 'SELECT r.post_id, r.user_id, r.report_id, r.report_closed, report_time, r.report_text, rr.reason_title, rr.reason_description, u.username, u.username_clean, u.user_colour
- FROM ' . REPORTS_TABLE . ' r, ' . REPORTS_REASONS_TABLE . ' rr, ' . USERS_TABLE . ' u
- WHERE ' . (($report_id) ? 'r.report_id = ' . $report_id : "r.post_id = $post_id") . '
+ 'WHERE' => (($report_id) ? 'r.report_id = ' . $report_id : "r.post_id = $post_id") . '
AND rr.reason_id = r.reason_id
AND r.user_id = u.user_id
- AND r.pm_id = 0
- ORDER BY report_closed ASC';
+ AND r.pm_id = 0',
+
+ 'ORDER_BY' => 'report_closed ASC',
+ );
+
+ /**
+ * Allow changing the query to obtain the user-submitted report.
+ *
+ * @event core.mcp_reports_report_details_query_before
+ * @var array sql_ary The array in the format of the query builder with the query
+ * @var int forum_id The forum_id, the number in the f GET parameter
+ * @var int post_id The post_id of the report being viewed (if 0, it is meaningless)
+ * @var int report_id The report_id of the report being viewed
+ * @since 3.1.5-RC1
+ */
+ $vars = array(
+ 'sql_ary',
+ 'forum_id',
+ 'post_id',
+ 'report_id',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.mcp_reports_report_details_query_before', compact($vars)));
+
+ $sql = $db->sql_build_query('SELECT', $sql_ary);
$result = $db->sql_query_limit($sql, 1);
$report = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
+ /**
+ * Allow changing the data obtained from the user-submitted report.
+ *
+ * @event core.mcp_reports_report_details_query_after
+ * @var array sql_ary The array in the format of the query builder with the query that had been executted
+ * @var int forum_id The forum_id, the number in the f GET parameter
+ * @var int post_id The post_id of the report being viewed (if 0, it is meaningless)
+ * @var int report_id The report_id of the report being viewed
+ * @var array report The query's resulting row.
+ * @since 3.1.5-RC1
+ */
+ $vars = array(
+ 'sql_ary',
+ 'forum_id',
+ 'post_id',
+ 'report_id',
+ 'report',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.mcp_reports_report_details_query_after', compact($vars)));
+
if (!$report)
{
trigger_error('NO_REPORT');
}
+ $phpbb_notifications = $phpbb_container->get('notification_manager');
+
+ $phpbb_notifications->mark_notifications_read('notification.type.report_post', $post_id, $user->data['user_id']);
+
if (!$report_id && $report['report_closed'])
{
trigger_error('REPORT_CLOSED');
@@ -96,7 +150,11 @@ class mcp_reports
$post_id = $report['post_id'];
$report_id = $report['report_id'];
- $post_info = get_post_data(array($post_id), 'm_report', true);
+ $parse_post_flags = $report['reported_post_enable_bbcode'] ? OPTION_FLAG_BBCODE : 0;
+ $parse_post_flags += $report['reported_post_enable_smilies'] ? OPTION_FLAG_SMILIES : 0;
+ $parse_post_flags += $report['reported_post_enable_magic_url'] ? OPTION_FLAG_LINKS : 0;
+
+ $post_info = phpbb_get_post_data(array($post_id), 'm_report', true);
if (!sizeof($post_info))
{
@@ -117,8 +175,9 @@ class mcp_reports
$template->assign_vars(array(
'S_TOPIC_REVIEW' => true,
'S_BBCODE_ALLOWED' => $post_info['enable_bbcode'],
- 'TOPIC_TITLE' => $post_info['topic_title'])
- );
+ 'TOPIC_TITLE' => $post_info['topic_title'],
+ 'REPORTED_POST_ID' => $post_id,
+ ));
}
$topic_tracking_info = $extensions = $attachments = array();
@@ -135,19 +194,14 @@ class mcp_reports
}
$post_unread = (isset($topic_tracking_info[$post_info['topic_id']]) && $post_info['post_time'] > $topic_tracking_info[$post_info['topic_id']]) ? true : false;
+ $message = generate_text_for_display(
+ $report['reported_post_text'],
+ $report['reported_post_uid'],
+ $report['reported_post_bitfield'],
+ $parse_post_flags,
+ false
+ );
- // Process message, leave it uncensored
- $message = $post_info['post_text'];
-
- if ($post_info['bbcode_bitfield'])
- {
- include_once($phpbb_root_path . 'includes/bbcode.' . $phpEx);
- $bbcode = new bbcode($post_info['bbcode_bitfield']);
- $bbcode->bbcode_second_pass($message, $post_info['bbcode_uid'], $post_info['bbcode_bitfield']);
- }
-
- $message = bbcode_nl2br($message);
- $message = smiley_text($message);
$report['report_text'] = make_clickable(bbcode_nl2br($report['report_text']));
if ($post_info['post_attachment'] && $auth->acl_get('u_download') && $auth->acl_get('f_download', $post_info['forum_id']))
@@ -156,6 +210,7 @@ class mcp_reports
FROM ' . ATTACHMENTS_TABLE . '
WHERE post_msg_id = ' . $post_id . '
AND in_message = 0
+ AND filetime <= ' . (int) $report['report_time'] . '
ORDER BY filetime DESC';
$result = $db->sql_query($sql);
@@ -190,7 +245,7 @@ class mcp_reports
'S_CLOSE_ACTION' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=reports&amp;mode=report_details&amp;f=' . $post_info['forum_id'] . '&amp;p=' . $post_id),
'S_CAN_VIEWIP' => $auth->acl_get('m_info', $post_info['forum_id']),
'S_POST_REPORTED' => $post_info['post_reported'],
- 'S_POST_UNAPPROVED' => !$post_info['post_approved'],
+ 'S_POST_UNAPPROVED' => $post_info['post_visibility'] == ITEM_UNAPPROVED || $post_info['post_visibility'] == ITEM_REAPPROVE,
'S_POST_LOCKED' => $post_info['post_edit_locked'],
'S_REPORT_CLOSED' => $report['report_closed'],
'S_USER_NOTES' => true,
@@ -262,7 +317,7 @@ class mcp_reports
if ($topic_id)
{
- $topic_info = get_topic_data(array($topic_id));
+ $topic_info = phpbb_get_topic_data(array($topic_id));
if (!sizeof($topic_info))
{
@@ -296,16 +351,16 @@ class mcp_reports
$global_id = $forum_list[0];
- $sql = 'SELECT SUM(forum_topics) as sum_forum_topics
+ $sql = 'SELECT SUM(forum_topics_approved) as sum_forum_topics
FROM ' . FORUMS_TABLE . '
WHERE ' . $db->sql_in_set('forum_id', $forum_list);
$result = $db->sql_query($sql);
- $forum_info['forum_topics'] = (int) $db->sql_fetchfield('sum_forum_topics');
+ $forum_info['forum_topics_approved'] = (int) $db->sql_fetchfield('sum_forum_topics');
$db->sql_freeresult($result);
}
else
{
- $forum_info = get_forum_data(array($forum_id), 'm_report');
+ $forum_info = phpbb_get_forum_data(array($forum_id), 'm_report');
if (!sizeof($forum_info))
{
@@ -314,11 +369,11 @@ class mcp_reports
$forum_info = $forum_info[$forum_id];
$forum_list = array($forum_id);
- $global_id = $forum_id;
}
$forum_list[] = 0;
$forum_data = array();
+ $pagination = $phpbb_container->get('pagination');
$forum_options = '<option value="0"' . (($forum_id == 0) ? ' selected="selected"' : '') . '>' . $user->lang['ALL_FORUMS'] . '</option>';
foreach ($forum_list_reports as $row)
@@ -331,9 +386,9 @@ class mcp_reports
$sort_days = $total = 0;
$sort_key = $sort_dir = '';
$sort_by_sql = $sort_order_sql = array();
- mcp_sorting($mode, $sort_days, $sort_key, $sort_dir, $sort_by_sql, $sort_order_sql, $total, $forum_id, $topic_id);
+ phpbb_mcp_sorting($mode, $sort_days, $sort_key, $sort_dir, $sort_by_sql, $sort_order_sql, $total, $forum_id, $topic_id);
- $forum_topics = ($total == -1) ? $forum_info['forum_topics'] : $total;
+ $forum_topics = ($total == -1) ? $forum_info['forum_topics_approved'] : $total;
$limit_time_sql = ($sort_days) ? 'AND r.report_time >= ' . (time() - ($sort_days * 86400)) : '';
if ($mode == 'reports')
@@ -357,6 +412,27 @@ class mcp_reports
AND r.pm_id = 0
$limit_time_sql
ORDER BY $sort_order_sql";
+
+ /**
+ * Alter sql query to get report id of all reports for requested forum and topic or just forum
+ *
+ * @event core.mcp_reports_get_reports_query_before
+ * @var string sql String with the query to be executed
+ * @var array forum_list List of forums that contain the posts
+ * @var int topic_id topic_id in the page request
+ * @var string limit_time_sql String with the SQL code to limit the time interval of the post (Note: May be empty string)
+ * @var string sort_order_sql String with the ORDER BY SQL code used in this query
+ * @since 3.1.0-RC4
+ */
+ $vars = array(
+ 'sql',
+ 'forum_list',
+ 'topic_id',
+ 'limit_time_sql',
+ 'sort_order_sql',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.mcp_reports_get_reports_query_before', compact($vars)));
+
$result = $db->sql_query_limit($sql, $config['topics_per_page'], $start);
$i = 0;
@@ -370,7 +446,7 @@ class mcp_reports
if (sizeof($report_ids))
{
- $sql = 'SELECT t.forum_id, t.topic_id, t.topic_title, p.post_id, p.post_subject, p.post_username, p.poster_id, p.post_time, u.username, u.username_clean, u.user_colour, r.user_id as reporter_id, ru.username as reporter_name, ru.user_colour as reporter_colour, r.report_time, r.report_id
+ $sql = 'SELECT t.forum_id, t.topic_id, t.topic_title, p.post_id, p.post_subject, p.post_username, p.poster_id, p.post_time, p.post_attachment, u.username, u.username_clean, u.user_colour, r.user_id as reporter_id, ru.username as reporter_name, ru.user_colour as reporter_colour, r.report_time, r.report_id
FROM ' . REPORTS_TABLE . ' r, ' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . ' t, ' . USERS_TABLE . ' u, ' . USERS_TABLE . ' ru
WHERE ' . $db->sql_in_set('r.report_id', $report_ids) . '
AND t.topic_id = p.topic_id
@@ -384,14 +460,8 @@ class mcp_reports
$report_data = $rowset = array();
while ($row = $db->sql_fetchrow($result))
{
- $global_topic = ($row['forum_id']) ? false : true;
- if ($global_topic)
- {
- $row['forum_id'] = $global_id;
- }
-
$template->assign_block_vars('postrow', array(
- 'U_VIEWFORUM' => (!$global_topic) ? append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $row['forum_id']) : '',
+ 'U_VIEWFORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $row['forum_id']),
'U_VIEWPOST' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id'] . '&amp;p=' . $row['post_id']) . '#p' . $row['post_id'],
'U_VIEW_DETAILS' => append_sid("{$phpbb_root_path}mcp.$phpEx", "i=reports&amp;start=$start&amp;mode=report_details&amp;f={$row['forum_id']}&amp;r={$row['report_id']}"),
@@ -405,19 +475,23 @@ class mcp_reports
'REPORTER' => get_username_string('username', $row['reporter_id'], $row['reporter_name'], $row['reporter_colour']),
'U_REPORTER' => get_username_string('profile', $row['reporter_id'], $row['reporter_name'], $row['reporter_colour']),
- 'FORUM_NAME' => (!$global_topic) ? $forum_data[$row['forum_id']]['forum_name'] : $user->lang['GLOBAL_ANNOUNCEMENT'],
+ 'FORUM_NAME' => $forum_data[$row['forum_id']]['forum_name'],
'POST_ID' => $row['post_id'],
'POST_SUBJECT' => ($row['post_subject']) ? $row['post_subject'] : $user->lang['NO_SUBJECT'],
'POST_TIME' => $user->format_date($row['post_time']),
'REPORT_ID' => $row['report_id'],
'REPORT_TIME' => $user->format_date($row['report_time']),
- 'TOPIC_TITLE' => $row['topic_title'])
- );
+ 'TOPIC_TITLE' => $row['topic_title'],
+ 'ATTACH_ICON_IMG' => ($auth->acl_get('u_download') && $auth->acl_get('f_download', $row['forum_id']) && $row['post_attachment']) ? $user->img('icon_topic_attach', $user->lang['TOTAL_ATTACHMENTS']) : '',
+ ));
}
$db->sql_freeresult($result);
unset($report_ids, $row);
}
+ $base_url = $this->u_action . "&amp;f=$forum_id&amp;t=$topic_id&amp;st=$sort_days&amp;sk=$sort_key&amp;sd=$sort_dir";
+ $pagination->generate_template_pagination($base_url, 'pagination', 'start', $total, $config['topics_per_page'], $start);
+
// Now display the page
$template->assign_vars(array(
'L_EXPLAIN' => ($mode == 'reports') ? $user->lang['MCP_REPORTS_OPEN_EXPLAIN'] : $user->lang['MCP_REPORTS_CLOSED_EXPLAIN'],
@@ -428,11 +502,9 @@ class mcp_reports
'S_FORUM_OPTIONS' => $forum_options,
'S_CLOSED' => ($mode == 'reports_closed') ? true : false,
- 'PAGINATION' => generate_pagination($this->u_action . "&amp;f=$forum_id&amp;t=$topic_id&amp;st=$sort_days&amp;sk=$sort_key&amp;sd=$sort_dir", $total, $config['topics_per_page'], $start),
- 'PAGE_NUMBER' => on_page($total, $config['topics_per_page'], $start),
'TOPIC_ID' => $topic_id,
'TOTAL' => $total,
- 'TOTAL_REPORTS' => ($total == 1) ? $user->lang['LIST_REPORT'] : sprintf($user->lang['LIST_REPORTS'], $total),
+ 'TOTAL_REPORTS' => $user->lang('LIST_REPORTS', (int) $total),
)
);
@@ -448,7 +520,7 @@ class mcp_reports
function close_report($report_id_list, $mode, $action, $pm = false)
{
global $db, $template, $user, $config, $auth;
- global $phpEx, $phpbb_root_path;
+ global $phpEx, $phpbb_root_path, $phpbb_container;
$pm_where = ($pm) ? ' AND r.post_id = 0 ' : ' AND r.pm_id = 0 ';
$id_column = ($pm) ? 'pm_id' : 'post_id';
@@ -465,6 +537,7 @@ function close_report($report_id_list, $mode, $action, $pm = false)
{
$post_id_list[] = $row[$id_column];
}
+ $db->sql_freeresult($result);
$post_id_list = array_unique($post_id_list);
if ($pm)
@@ -476,7 +549,7 @@ function close_report($report_id_list, $mode, $action, $pm = false)
}
else
{
- if (!check_ids($post_id_list, POSTS_TABLE, 'post_id', array('m_report')))
+ if (!phpbb_check_ids($post_id_list, POSTS_TABLE, 'post_id', array('m_report')))
{
trigger_error('NOT_AUTHORISED');
}
@@ -486,7 +559,7 @@ function close_report($report_id_list, $mode, $action, $pm = false)
{
$redirect = request_var('redirect', build_url(array('mode', 'r', 'quickmod')) . '&amp;mode=reports');
}
- elseif ($action == 'delete' && strpos($user->data['session_page'], 'mode=pm_report_details') !== false)
+ else if ($action == 'delete' && strpos($user->data['session_page'], 'mode=pm_report_details') !== false)
{
$redirect = request_var('redirect', build_url(array('mode', 'r', 'quickmod')) . '&amp;mode=pm_reports');
}
@@ -512,7 +585,7 @@ function close_report($report_id_list, $mode, $action, $pm = false)
if (confirm_box(true))
{
- $post_info = ($pm) ? get_pm_data($post_id_list) : get_post_data($post_id_list, 'm_report');
+ $post_info = ($pm) ? phpbb_get_pm_data($post_id_list) : phpbb_get_post_data($post_id_list, 'm_report');
$sql = "SELECT r.report_id, r.$id_column, r.report_closed, r.user_id, r.user_notify, u.username, u.username_clean, u.user_email, u.user_jabber, u.user_lang, u.user_notify_type
FROM " . REPORTS_TABLE . ' r, ' . USERS_TABLE . ' u
@@ -585,7 +658,6 @@ function close_report($report_id_list, $mode, $action, $pm = false)
}
$db->sql_query($sql);
-
if (sizeof($close_report_posts))
{
if ($pm)
@@ -622,20 +694,22 @@ function close_report($report_id_list, $mode, $action, $pm = false)
}
unset($close_report_posts, $close_report_topics);
+ $phpbb_notifications = $phpbb_container->get('notification_manager');
+
foreach ($reports as $report)
{
if ($pm)
{
add_log('mod', 0, 0, 'LOG_PM_REPORT_' . strtoupper($action) . 'D', $post_info[$report['pm_id']]['message_subject']);
+ $phpbb_notifications->delete_notifications('notification.type.report_pm', $report['pm_id']);
}
else
{
add_log('mod', $post_info[$report['post_id']]['forum_id'], $post_info[$report['post_id']]['topic_id'], 'LOG_REPORT_' . strtoupper($action) . 'D', $post_info[$report['post_id']]['post_subject']);
+ $phpbb_notifications->delete_notifications('notification.type.report_post', $report['post_id']);
}
}
- $messenger = new messenger();
-
// Notify reporters
if (sizeof($notify_reporters))
{
@@ -648,30 +722,21 @@ function close_report($report_id_list, $mode, $action, $pm = false)
$post_id = $reporter[$id_column];
- $messenger->template((($pm) ? 'pm_report_' : 'report_') . $action . 'd', $reporter['user_lang']);
-
- $messenger->to($reporter['user_email'], $reporter['username']);
- $messenger->im($reporter['user_jabber'], $reporter['username']);
-
if ($pm)
{
- $messenger->assign_vars(array(
- 'USERNAME' => htmlspecialchars_decode($reporter['username']),
- 'CLOSER_NAME' => htmlspecialchars_decode($user->data['username']),
- 'PM_SUBJECT' => htmlspecialchars_decode(censor_text($post_info[$post_id]['message_subject'])),
- ));
+ $phpbb_notifications->add_notifications('notification.type.report_pm_closed', array_merge($post_info[$post_id], array(
+ 'reporter' => $reporter['user_id'],
+ 'closer_id' => $user->data['user_id'],
+ 'from_user_id' => $post_info[$post_id]['author_id'],
+ )));
}
else
{
- $messenger->assign_vars(array(
- 'USERNAME' => htmlspecialchars_decode($reporter['username']),
- 'CLOSER_NAME' => htmlspecialchars_decode($user->data['username']),
- 'POST_SUBJECT' => htmlspecialchars_decode(censor_text($post_info[$post_id]['post_subject'])),
- 'TOPIC_TITLE' => htmlspecialchars_decode(censor_text($post_info[$post_id]['topic_title'])))
- );
+ $phpbb_notifications->add_notifications('notification.type.report_post_closed', array_merge($post_info[$post_id], array(
+ 'reporter' => $reporter['user_id'],
+ 'closer_id' => $user->data['user_id'],
+ )));
}
-
- $messenger->send($reporter['user_notify_type']);
}
}
@@ -686,8 +751,6 @@ function close_report($report_id_list, $mode, $action, $pm = false)
unset($notify_reporters, $post_info, $reports);
- $messenger->save_queue();
-
$success_msg = (sizeof($report_id_list) == 1) ? "{$pm_prefix}REPORT_" . strtoupper($action) . 'D_SUCCESS' : "{$pm_prefix}REPORTS_" . strtoupper($action) . 'D_SUCCESS';
}
else
@@ -725,5 +788,3 @@ function close_report($report_id_list, $mode, $action, $pm = false)
trigger_error($user->lang[$success_msg] . '<br /><br />' . $return_forum . $return_topic . sprintf($user->lang['RETURN_PAGE'], "<a href=\"$redirect\">", '</a>'));
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/mcp/mcp_topic.php b/phpBB/includes/mcp/mcp_topic.php
index 8e0e89e3da..d5415302c8 100644
--- a/phpBB/includes/mcp/mcp_topic.php
+++ b/phpBB/includes/mcp/mcp_topic.php
@@ -1,10 +1,13 @@
<?php
/**
*
-* @package mcp
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -22,14 +25,15 @@ if (!defined('IN_PHPBB'))
function mcp_topic_view($id, $mode, $action)
{
global $phpEx, $phpbb_root_path, $config;
- global $template, $db, $user, $auth, $cache;
+ global $template, $db, $user, $auth, $cache, $phpbb_container, $phpbb_dispatcher;
- $url = append_sid("{$phpbb_root_path}mcp.$phpEx?" . extra_url());
+ $url = append_sid("{$phpbb_root_path}mcp.$phpEx?" . phpbb_extra_url());
$user->add_lang('viewtopic');
+ $pagination = $phpbb_container->get('pagination');
$topic_id = request_var('t', 0);
- $topic_info = get_topic_data(array($topic_id), false, true);
+ $topic_info = phpbb_get_topic_data(array($topic_id), false, true);
if (!sizeof($topic_info))
{
@@ -85,8 +89,8 @@ function mcp_topic_view($id, $mode, $action)
$subject = $topic_info['topic_title'];
}
- // Approve posts?
- if ($action == 'approve' && $auth->acl_get('m_approve', $topic_info['forum_id']))
+ // Restore or pprove posts?
+ if (($action == 'restore' || $action == 'approve') && $auth->acl_get('m_approve', $topic_info['forum_id']))
{
include($phpbb_root_path . 'includes/mcp/mcp_queue.' . $phpEx);
include_once($phpbb_root_path . 'includes/functions_posting.' . $phpEx);
@@ -99,7 +103,7 @@ function mcp_topic_view($id, $mode, $action)
if (!$sort)
{
- approve_post($post_id_list, $id, $mode);
+ mcp_queue::approve_posts($action, $post_id_list, $id, $mode);
}
}
@@ -110,20 +114,14 @@ function mcp_topic_view($id, $mode, $action)
$sort_days = $total = 0;
$sort_key = $sort_dir = '';
$sort_by_sql = $sort_order_sql = array();
- mcp_sorting('viewtopic', $sort_days, $sort_key, $sort_dir, $sort_by_sql, $sort_order_sql, $total, $topic_info['forum_id'], $topic_id, $where_sql);
+ phpbb_mcp_sorting('viewtopic', $sort_days, $sort_key, $sort_dir, $sort_by_sql, $sort_order_sql, $total, $topic_info['forum_id'], $topic_id, $where_sql);
$limit_time_sql = ($sort_days) ? 'AND p.post_time >= ' . (time() - ($sort_days * 86400)) : '';
+ $phpbb_content_visibility = $phpbb_container->get('content.visibility');
if ($total == -1)
{
- if ($auth->acl_get('m_approve', $topic_info['forum_id']))
- {
- $total = $topic_info['topic_replies_real'] + 1;
- }
- else
- {
- $total = $topic_info['topic_replies'] + 1;
- }
+ $total = $phpbb_content_visibility->get_count('topic_posts', $topic_info, $topic_info['forum_id']);
}
$posts_per_page = max(0, request_var('posts_per_page', intval($config['posts_per_page'])));
@@ -136,39 +134,26 @@ function mcp_topic_view($id, $mode, $action)
{
$start = 0;
}
-
- // Make sure $start is set to the last page if it exceeds the amount
- if ($start < 0 || $start >= $total)
- {
- $start = ($start < 0) ? 0 : floor(($total - 1) / $posts_per_page) * $posts_per_page;
- }
+ $start = $pagination->validate_start($start, $posts_per_page, $total);
$sql = 'SELECT u.username, u.username_clean, u.user_colour, p.*
FROM ' . POSTS_TABLE . ' p, ' . USERS_TABLE . ' u
WHERE ' . (($action == 'reports') ? 'p.post_reported = 1 AND ' : '') . '
- p.topic_id = ' . $topic_id . ' ' .
- ((!$auth->acl_get('m_approve', $topic_info['forum_id'])) ? ' AND p.post_approved = 1 ' : '') . '
+ p.topic_id = ' . $topic_id . '
+ AND ' . $phpbb_content_visibility->get_visibility_sql('post', $topic_info['forum_id'], 'p.') . '
AND p.poster_id = u.user_id ' .
$limit_time_sql . '
ORDER BY ' . $sort_order_sql;
$result = $db->sql_query_limit($sql, $posts_per_page, $start);
$rowset = $post_id_list = array();
- $bbcode_bitfield = '';
while ($row = $db->sql_fetchrow($result))
{
$rowset[] = $row;
$post_id_list[] = $row['post_id'];
- $bbcode_bitfield = $bbcode_bitfield | base64_decode($row['bbcode_bitfield']);
}
$db->sql_freeresult($result);
- if ($bbcode_bitfield !== '')
- {
- include_once($phpbb_root_path . 'includes/bbcode.' . $phpEx);
- $bbcode = new bbcode(base64_encode($bbcode_bitfield));
- }
-
$topic_tracking_info = array();
// Get topic tracking info
@@ -183,7 +168,7 @@ function mcp_topic_view($id, $mode, $action)
$topic_tracking_info = get_complete_topic_tracking($topic_info['forum_id'], $topic_id);
}
- $has_unapproved_posts = false;
+ $has_unapproved_posts = $has_deleted_posts = false;
// Grab extensions
$extensions = $attachments = array();
@@ -209,18 +194,37 @@ function mcp_topic_view($id, $mode, $action)
}
}
+ /**
+ * Event to modify the post data for the MCP topic review before assigning the posts
+ *
+ * @event core.mcp_topic_modify_post_data
+ * @var array attachments List of attachments post_id => array of attachments
+ * @var int forum_id The forum ID we are currently in
+ * @var int id ID of the tab we are displaying
+ * @var string mode Mode of the MCP page we are displaying
+ * @var array post_id_list Array with post ids we are going to display
+ * @var array rowset Array with the posts data
+ * @var int topic_id The topic ID we are currently reviewing
+ * @since 3.1.7-RC1
+ */
+ $vars = array(
+ 'attachments',
+ 'forum_id',
+ 'id',
+ 'mode',
+ 'post_id_list',
+ 'rowset',
+ 'topic_id',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.mcp_topic_modify_post_data', compact($vars)));
+
foreach ($rowset as $i => $row)
{
$message = $row['post_text'];
$post_subject = ($row['post_subject'] != '') ? $row['post_subject'] : $topic_info['topic_title'];
- if ($row['bbcode_bitfield'])
- {
- $bbcode->bbcode_second_pass($message, $row['bbcode_uid'], $row['bbcode_bitfield']);
- }
-
- $message = bbcode_nl2br($message);
- $message = smiley_text($message);
+ $parse_flags = ($row['bbcode_bitfield'] ? OPTION_FLAG_BBCODE : 0) | OPTION_FLAG_SMILIES;
+ $message = generate_text_for_display($message, $row['bbcode_uid'], $row['bbcode_bitfield'], $parse_flags, false);
if (!empty($attachments[$row['post_id']]))
{
@@ -228,14 +232,19 @@ function mcp_topic_view($id, $mode, $action)
parse_attachments($topic_info['forum_id'], $message, $attachments[$row['post_id']], $update_count);
}
- if (!$row['post_approved'])
+ if ($row['post_visibility'] == ITEM_UNAPPROVED || $row['post_visibility'] == ITEM_REAPPROVE)
{
$has_unapproved_posts = true;
}
+ if ($row['post_visibility'] == ITEM_DELETED)
+ {
+ $has_deleted_posts = true;
+ }
+
$post_unread = (isset($topic_tracking_info[$topic_id]) && $row['post_time'] > $topic_tracking_info[$topic_id]) ? true : false;
- $template->assign_block_vars('postrow', array(
+ $post_row = array(
'POST_AUTHOR_FULL' => get_username_string('full', $row['poster_id'], $row['username'], $row['user_colour'], $row['post_username']),
'POST_AUTHOR_COLOUR' => get_username_string('colour', $row['poster_id'], $row['username'], $row['user_colour'], $row['post_username']),
'POST_AUTHOR' => get_username_string('username', $row['poster_id'], $row['username'], $row['user_colour'], $row['post_username']),
@@ -250,14 +259,49 @@ function mcp_topic_view($id, $mode, $action)
'MINI_POST_IMG' => ($post_unread) ? $user->img('icon_post_target_unread', 'UNREAD_POST') : $user->img('icon_post_target', 'POST'),
'S_POST_REPORTED' => ($row['post_reported'] && $auth->acl_get('m_report', $topic_info['forum_id'])),
- 'S_POST_UNAPPROVED' => (!$row['post_approved'] && $auth->acl_get('m_approve', $topic_info['forum_id'])),
+ 'S_POST_UNAPPROVED' => (($row['post_visibility'] == ITEM_UNAPPROVED || $row['post_visibility'] == ITEM_REAPPROVE) && $auth->acl_get('m_approve', $topic_info['forum_id'])),
+ 'S_POST_DELETED' => ($row['post_visibility'] == ITEM_DELETED && $auth->acl_get('m_approve', $topic_info['forum_id'])),
'S_CHECKED' => (($submitted_id_list && !in_array(intval($row['post_id']), $submitted_id_list)) || in_array(intval($row['post_id']), $checked_ids)) ? true : false,
'S_HAS_ATTACHMENTS' => (!empty($attachments[$row['post_id']])) ? true : false,
'U_POST_DETAILS' => "$url&amp;i=$id&amp;p={$row['post_id']}&amp;mode=post_details" . (($forum_id) ? "&amp;f=$forum_id" : ''),
'U_MCP_APPROVE' => ($auth->acl_get('m_approve', $topic_info['forum_id'])) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue&amp;mode=approve_details&amp;f=' . $topic_info['forum_id'] . '&amp;p=' . $row['post_id']) : '',
- 'U_MCP_REPORT' => ($auth->acl_get('m_report', $topic_info['forum_id'])) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=reports&amp;mode=report_details&amp;f=' . $topic_info['forum_id'] . '&amp;p=' . $row['post_id']) : '')
+ 'U_MCP_REPORT' => ($auth->acl_get('m_report', $topic_info['forum_id'])) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=reports&amp;mode=report_details&amp;f=' . $topic_info['forum_id'] . '&amp;p=' . $row['post_id']) : '',
+ );
+
+ $current_row_number = $i;
+
+ /**
+ * Event to modify the template data block for topic reviews in the MCP
+ *
+ * @event core.mcp_topic_review_modify_row
+ * @var int id ID of the tab we are displaying
+ * @var string mode Mode of the MCP page we are displaying
+ * @var int topic_id The topic ID we are currently reviewing
+ * @var int forum_id The forum ID we are currently in
+ * @var int start Start item of this page
+ * @var int current_row_number Number of the post on this page
+ * @var array post_row Template block array of the current post
+ * @var array row Array with original post and user data
+ * @var array topic_info Array with topic data
+ * @var int total Total posts count
+ * @since 3.1.4-RC1
+ */
+ $vars = array(
+ 'id',
+ 'mode',
+ 'topic_id',
+ 'forum_id',
+ 'start',
+ 'current_row_number',
+ 'post_row',
+ 'row',
+ 'topic_info',
+ 'total',
);
+ extract($phpbb_dispatcher->trigger_event('core.mcp_topic_review_modify_row', compact($vars)));
+
+ $template->assign_block_vars('postrow', $post_row);
// Display not already displayed Attachments for this post, we already parsed them. ;)
if (!empty($attachments[$row['post_id']]))
@@ -284,7 +328,7 @@ function mcp_topic_view($id, $mode, $action)
// Has the user selected a topic for merge?
if ($to_topic_id)
{
- $to_topic_info = get_topic_data(array($to_topic_id), 'm_merge');
+ $to_topic_info = phpbb_get_topic_data(array($to_topic_id), 'm_merge');
if (!sizeof($to_topic_info))
{
@@ -307,6 +351,12 @@ function mcp_topic_view($id, $mode, $action)
'post_ids' => $post_id_list,
));
+ $base_url = append_sid("{$phpbb_root_path}mcp.$phpEx", "i=$id&amp;t={$topic_info['topic_id']}&amp;mode=$mode&amp;action=$action&amp;to_topic_id=$to_topic_id&amp;posts_per_page=$posts_per_page&amp;st=$sort_days&amp;sk=$sort_key&amp;sd=$sort_dir");
+ if ($posts_per_page)
+ {
+ $pagination->generate_template_pagination($base_url, 'pagination', 'start', $total, $posts_per_page, $start);
+ }
+
$template->assign_vars(array(
'TOPIC_TITLE' => $topic_info['topic_title'],
'U_VIEW_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $topic_info['forum_id'] . '&amp;t=' . $topic_info['topic_id']),
@@ -320,6 +370,7 @@ function mcp_topic_view($id, $mode, $action)
'REPORTED_IMG' => $user->img('icon_topic_reported', 'POST_REPORTED'),
'UNAPPROVED_IMG' => $user->img('icon_topic_unapproved', 'POST_UNAPPROVED'),
+ 'DELETED_IMG' => $user->img('icon_topic_deleted', 'POST_DELETED_RESTORE'),
'INFO_IMG' => $user->img('icon_post_info', 'VIEW_INFO'),
'S_MCP_ACTION' => "$url&amp;i=$id&amp;mode=$mode&amp;action=$action&amp;start=$start",
@@ -328,6 +379,7 @@ function mcp_topic_view($id, $mode, $action)
'S_CAN_MERGE' => ($auth->acl_get('m_merge', $topic_info['forum_id'])) ? true : false,
'S_CAN_DELETE' => ($auth->acl_get('m_delete', $topic_info['forum_id'])) ? true : false,
'S_CAN_APPROVE' => ($has_unapproved_posts && $auth->acl_get('m_approve', $topic_info['forum_id'])) ? true : false,
+ 'S_CAN_RESTORE' => ($has_deleted_posts && $auth->acl_get('m_approve', $topic_info['forum_id'])) ? true : false,
'S_CAN_LOCK' => ($auth->acl_get('m_lock', $topic_info['forum_id'])) ? true : false,
'S_CAN_REPORT' => ($auth->acl_get('m_report', $topic_info['forum_id'])) ? true : false,
'S_CAN_SYNC' => $auth->acl_get('m_', $topic_info['forum_id']),
@@ -345,9 +397,7 @@ function mcp_topic_view($id, $mode, $action)
'RETURN_TOPIC' => sprintf($user->lang['RETURN_TOPIC'], '<a href="' . append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f={$topic_info['forum_id']}&amp;t={$topic_info['topic_id']}&amp;start=$start") . '">', '</a>'),
'RETURN_FORUM' => sprintf($user->lang['RETURN_FORUM'], '<a href="' . append_sid("{$phpbb_root_path}viewforum.$phpEx", "f={$topic_info['forum_id']}&amp;start=$start") . '">', '</a>'),
- 'PAGE_NUMBER' => on_page($total, $posts_per_page, $start),
- 'PAGINATION' => (!$posts_per_page) ? '' : generate_pagination(append_sid("{$phpbb_root_path}mcp.$phpEx", "i=$id&amp;t={$topic_info['topic_id']}&amp;mode=$mode&amp;action=$action&amp;to_topic_id=$to_topic_id&amp;posts_per_page=$posts_per_page&amp;st=$sort_days&amp;sk=$sort_key&amp;sd=$sort_dir"), $total, $posts_per_page, $start),
- 'TOTAL_POSTS' => ($total == 1) ? $user->lang['VIEW_TOPIC_POST'] : sprintf($user->lang['VIEW_TOPIC_POSTS'], $total),
+ 'TOTAL_POSTS' => $user->lang('VIEW_TOPIC_POSTS', (int) $total),
));
}
@@ -357,6 +407,7 @@ function mcp_topic_view($id, $mode, $action)
function split_topic($action, $topic_id, $to_forum_id, $subject)
{
global $db, $template, $user, $phpEx, $phpbb_root_path, $auth, $config;
+ global $phpbb_dispatcher;
$post_id_list = request_var('post_id_list', array(0));
$forum_id = request_var('forum_id', 0);
@@ -368,13 +419,13 @@ function split_topic($action, $topic_id, $to_forum_id, $subject)
return;
}
- if (!check_ids($post_id_list, POSTS_TABLE, 'post_id', array('m_split')))
+ if (!phpbb_check_ids($post_id_list, POSTS_TABLE, 'post_id', array('m_split')))
{
return;
}
$post_id = $post_id_list[0];
- $post_info = get_post_data(array($post_id));
+ $post_info = phpbb_get_post_data(array($post_id));
if (!sizeof($post_info))
{
@@ -398,7 +449,7 @@ function split_topic($action, $topic_id, $to_forum_id, $subject)
return;
}
- $forum_info = get_forum_data(array($to_forum_id), 'f_post');
+ $forum_info = phpbb_get_forum_data(array($to_forum_id), 'f_post');
if (!sizeof($forum_info))
{
@@ -438,13 +489,13 @@ function split_topic($action, $topic_id, $to_forum_id, $subject)
$sort_days = $total = 0;
$sort_key = $sort_dir = '';
$sort_by_sql = $sort_order_sql = array();
- mcp_sorting('viewtopic', $sort_days, $sort_key, $sort_dir, $sort_by_sql, $sort_order_sql, $total, $forum_id, $topic_id);
+ phpbb_mcp_sorting('viewtopic', $sort_days, $sort_key, $sort_dir, $sort_by_sql, $sort_order_sql, $total, $forum_id, $topic_id);
$limit_time_sql = ($sort_days) ? 'AND t.topic_last_post_time >= ' . (time() - ($sort_days * 86400)) : '';
if ($sort_order_sql[0] == 'u')
{
- $sql = 'SELECT p.post_id, p.forum_id, p.post_approved
+ $sql = 'SELECT p.post_id, p.forum_id, p.post_visibility
FROM ' . POSTS_TABLE . ' p, ' . USERS_TABLE . " u
WHERE p.topic_id = $topic_id
AND p.poster_id = u.user_id
@@ -453,7 +504,7 @@ function split_topic($action, $topic_id, $to_forum_id, $subject)
}
else
{
- $sql = 'SELECT p.post_id, p.forum_id, p.post_approved
+ $sql = 'SELECT p.post_id, p.forum_id, p.post_visibility
FROM ' . POSTS_TABLE . " p
WHERE p.topic_id = $topic_id
$limit_time_sql
@@ -466,7 +517,7 @@ function split_topic($action, $topic_id, $to_forum_id, $subject)
while ($row = $db->sql_fetchrow($result))
{
// If split from selected post (split_beyond), we split the unapproved items too.
- if (!$row['post_approved'] && !$auth->acl_get('m_approve', $row['forum_id']))
+ if (($row['post_visibility'] == ITEM_UNAPPROVED || $row['post_visibility'] == ITEM_REAPPROVE) && !$auth->acl_get('m_approve', $row['forum_id']))
{
// continue;
}
@@ -493,10 +544,10 @@ function split_topic($action, $topic_id, $to_forum_id, $subject)
$icon_id = request_var('icon', 0);
$sql_ary = array(
- 'forum_id' => $to_forum_id,
- 'topic_title' => $subject,
- 'icon_id' => $icon_id,
- 'topic_approved'=> 1
+ 'forum_id' => $to_forum_id,
+ 'topic_title' => $subject,
+ 'icon_id' => $icon_id,
+ 'topic_visibility' => 1
);
$sql = 'INSERT INTO ' . TOPICS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary);
@@ -505,7 +556,7 @@ function split_topic($action, $topic_id, $to_forum_id, $subject)
$to_topic_id = $db->sql_nextid();
move_posts($post_id_list, $to_topic_id);
- $topic_info = get_topic_data(array($topic_id));
+ $topic_info = phpbb_get_topic_data(array($topic_id));
$topic_info = $topic_info[$topic_id];
add_log('mod', $to_forum_id, $to_topic_id, 'LOG_SPLIT_DESTINATION', $subject);
@@ -517,6 +568,47 @@ function split_topic($action, $topic_id, $to_forum_id, $subject)
WHERE post_id = {$post_id_list[0]}";
$db->sql_query($sql);
+ // Grab data for first post in split topic
+ $sql_array = array(
+ 'SELECT' => 'p.post_id, p.forum_id, p.poster_id, p.post_text, f.enable_indexing',
+ 'FROM' => array(
+ POSTS_TABLE => 'p',
+ ),
+ 'LEFT_JOIN' => array(
+ array(
+ 'FROM' => array(FORUMS_TABLE => 'f'),
+ 'ON' => 'p.forum_id = f.forum_id',
+ )
+ ),
+ 'WHERE' => "post_id = {$post_id_list[0]}",
+ );
+ $sql = $db->sql_build_query('SELECT', $sql_array);
+ $result = $db->sql_query($sql);
+ $first_post_data = $db->sql_fetchrow($result);
+ $db->sql_freeresult($result);
+
+ // Index first post as if it were edited
+ if ($first_post_data['enable_indexing'])
+ {
+ // Select the search method and do some additional checks to ensure it can actually be utilised
+ $search_type = $config['search_type'];
+
+ if (!class_exists($search_type))
+ {
+ trigger_error('NO_SUCH_SEARCH_MODULE');
+ }
+
+ $error = false;
+ $search = new $search_type($error, $phpbb_root_path, $phpEx, $auth, $config, $db, $user, $phpbb_dispatcher);
+
+ if ($error)
+ {
+ trigger_error($error);
+ }
+
+ $search->index('edit', $first_post_data['post_id'], $first_post_data['post_text'], $subject, $first_post_data['poster_id'], $first_post_data['forum_id']);
+ }
+
// Copy topic subscriptions to new topic
$sql = 'SELECT user_id, notify_status
FROM ' . TOPICS_WATCH_TABLE . '
@@ -567,23 +659,15 @@ function split_topic($action, $topic_id, $to_forum_id, $subject)
// Link back to both topics
$return_link = sprintf($user->lang['RETURN_TOPIC'], '<a href="' . append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $post_info['forum_id'] . '&amp;t=' . $post_info['topic_id']) . '">', '</a>') . '<br /><br />' . sprintf($user->lang['RETURN_NEW_TOPIC'], '<a href="' . append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $to_forum_id . '&amp;t=' . $to_topic_id) . '">', '</a>');
- }
- else
- {
- confirm_box(false, ($action == 'split_all') ? 'SPLIT_TOPIC_ALL' : 'SPLIT_TOPIC_BEYOND', $s_hidden_fields);
- }
-
- $redirect = request_var('redirect', "index.$phpEx");
- $redirect = reapply_sid($redirect);
+ $redirect = request_var('redirect', "{$phpbb_root_path}viewtopic.$phpEx?f=$to_forum_id&amp;t=$to_topic_id");
+ $redirect = reapply_sid($redirect);
- if (!$success_msg)
- {
- return;
+ meta_refresh(3, $redirect);
+ trigger_error($user->lang[$success_msg] . '<br /><br />' . $return_link);
}
else
{
- meta_refresh(3, append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$to_forum_id&amp;t=$to_topic_id"));
- trigger_error($user->lang[$success_msg] . '<br /><br />' . $return_link);
+ confirm_box(false, ($action == 'split_all') ? 'SPLIT_TOPIC_ALL' : 'SPLIT_TOPIC_BEYOND', $s_hidden_fields);
}
}
@@ -592,7 +676,7 @@ function split_topic($action, $topic_id, $to_forum_id, $subject)
*/
function merge_posts($topic_id, $to_topic_id)
{
- global $db, $template, $user, $phpEx, $phpbb_root_path, $auth;
+ global $db, $template, $user, $phpEx, $phpbb_root_path, $auth, $phpbb_dispatcher;
if (!$to_topic_id)
{
@@ -600,14 +684,22 @@ function merge_posts($topic_id, $to_topic_id)
return;
}
- $topic_data = get_topic_data(array($to_topic_id), 'm_merge');
+ $sync_topics = array($topic_id, $to_topic_id);
+
+ $topic_data = phpbb_get_topic_data($sync_topics, 'm_merge');
- if (!sizeof($topic_data))
+ if (!sizeof($topic_data) || empty($topic_data[$to_topic_id]))
{
$template->assign_var('MESSAGE', $user->lang['NO_FINAL_TOPIC_SELECTED']);
return;
}
+ $sync_forums = array();
+ foreach ($topic_data as $data)
+ {
+ $sync_forums[$data['forum_id']] = $data['forum_id'];
+ }
+
$topic_data = $topic_data[$to_topic_id];
$post_id_list = request_var('post_id_list', array(0));
@@ -619,7 +711,7 @@ function merge_posts($topic_id, $to_topic_id)
return;
}
- if (!check_ids($post_id_list, POSTS_TABLE, 'post_id', array('m_merge')))
+ if (!phpbb_check_ids($post_id_list, POSTS_TABLE, 'post_id', array('m_merge')))
{
return;
}
@@ -642,7 +734,7 @@ function merge_posts($topic_id, $to_topic_id)
{
$to_forum_id = $topic_data['forum_id'];
- move_posts($post_id_list, $to_topic_id);
+ move_posts($post_id_list, $to_topic_id, false);
add_log('mod', $to_forum_id, $to_topic_id, 'LOG_MERGE', $topic_data['topic_title']);
// Message and return links
@@ -650,7 +742,7 @@ function merge_posts($topic_id, $to_topic_id)
// Does the original topic still exist? If yes, link back to it
$sql = 'SELECT forum_id
- FROM ' . TOPICS_TABLE . '
+ FROM ' . POSTS_TABLE . '
WHERE topic_id = ' . $topic_id;
$result = $db->sql_query_limit($sql, 1);
$row = $db->sql_fetchrow($result);
@@ -674,26 +766,36 @@ function merge_posts($topic_id, $to_topic_id)
phpbb_update_rows_avoiding_duplicates($db, BOOKMARKS_TABLE, 'topic_id', array($topic_id), $to_topic_id);
}
+ // Re-sync the topics and forums because the auto-sync was deactivated in the call of move_posts()
+ sync('topic_reported', 'topic_id', $sync_topics);
+ sync('topic_attachment', 'topic_id', $sync_topics);
+ sync('topic', 'topic_id', $sync_topics, true);
+ sync('forum', 'forum_id', $sync_forums, true, true);
+
// Link to the new topic
$return_link .= (($return_link) ? '<br /><br />' : '') . sprintf($user->lang['RETURN_NEW_TOPIC'], '<a href="' . append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $to_forum_id . '&amp;t=' . $to_topic_id) . '">', '</a>');
- }
- else
- {
- confirm_box(false, 'MERGE_POSTS', $s_hidden_fields);
- }
-
- $redirect = request_var('redirect', "index.$phpEx");
- $redirect = reapply_sid($redirect);
+ $redirect = request_var('redirect', "{$phpbb_root_path}viewtopic.$phpEx?f=$to_forum_id&amp;t=$to_topic_id");
+ $redirect = reapply_sid($redirect);
+
+ /**
+ * Perform additional actions after merging posts.
+ *
+ * @event core.mcp_topics_merge_posts_after
+ * @var int topic_id The topic ID from which posts are being moved
+ * @var int to_topic_id The topic ID to which posts are being moved
+ * @since 3.1.11-RC1
+ */
+ $vars = array(
+ 'topic_id',
+ 'to_topic_id',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.mcp_topics_merge_posts_after', compact($vars)));
- if (!$success_msg)
- {
- return;
+ meta_refresh(3, $redirect);
+ trigger_error($user->lang[$success_msg] . '<br /><br />' . $return_link);
}
else
{
- meta_refresh(3, append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$to_forum_id&amp;t=$to_topic_id"));
- trigger_error($user->lang[$success_msg] . '<br /><br />' . $return_link);
+ confirm_box(false, 'MERGE_POSTS', $s_hidden_fields);
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/mcp/mcp_warn.php b/phpBB/includes/mcp/mcp_warn.php
index 1016204ff8..33c898ffc2 100644
--- a/phpBB/includes/mcp/mcp_warn.php
+++ b/phpBB/includes/mcp/mcp_warn.php
@@ -1,10 +1,13 @@
<?php
/**
*
-* @package mcp
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -19,7 +22,6 @@ if (!defined('IN_PHPBB'))
/**
* mcp_warn
* Handling warning the users
-* @package mcp
*/
class mcp_warn
{
@@ -97,9 +99,6 @@ class mcp_warn
'U_NOTES' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&amp;mode=user_notes&amp;u=' . $row['user_id']),
'USERNAME_FULL' => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']),
- 'USERNAME' => $row['username'],
- 'USERNAME_COLOUR' => ($row['user_colour']) ? '#' . $row['user_colour'] : '',
- 'U_USER' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&amp;u=' . $row['user_id']),
'WARNING_TIME' => $user->format_date($row['user_last_warning']),
'WARNINGS' => $row['user_warnings'],
@@ -119,9 +118,6 @@ class mcp_warn
'U_NOTES' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&amp;mode=user_notes&amp;u=' . $row['user_id']),
'USERNAME_FULL' => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']),
- 'USERNAME' => $row['username'],
- 'USERNAME_COLOUR' => ($row['user_colour']) ? '#' . $row['user_colour'] : '',
- 'U_USER' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&amp;u=' . $row['user_id']),
'WARNING_TIME' => $user->format_date($row['warning_time']),
'WARNINGS' => $row['user_warnings'],
@@ -135,10 +131,11 @@ class mcp_warn
*/
function mcp_warn_list_view($action)
{
- global $phpEx, $phpbb_root_path, $config;
+ global $phpEx, $phpbb_root_path, $config, $phpbb_container;
global $template, $db, $user, $auth;
$user->add_lang('memberlist');
+ $pagination = $phpbb_container->get('pagination');
$start = request_var('start', 0);
$st = request_var('st', 0);
@@ -167,15 +164,15 @@ class mcp_warn
'U_NOTES' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&amp;mode=user_notes&amp;u=' . $row['user_id']),
'USERNAME_FULL' => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']),
- 'USERNAME' => $row['username'],
- 'USERNAME_COLOUR' => ($row['user_colour']) ? '#' . $row['user_colour'] : '',
- 'U_USER' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&amp;u=' . $row['user_id']),
'WARNING_TIME' => $user->format_date($row['user_last_warning']),
'WARNINGS' => $row['user_warnings'],
));
}
+ $base_url = append_sid("{$phpbb_root_path}mcp.$phpEx", "i=warn&amp;mode=list&amp;st=$st&amp;sk=$sk&amp;sd=$sd");
+ $pagination->generate_template_pagination($base_url, 'pagination', 'start', $user_count, $config['topics_per_page'], $start);
+
$template->assign_vars(array(
'U_POST_ACTION' => $this->u_action,
'S_CLEAR_ALLOWED' => ($auth->acl_get('a_clearlogs')) ? true : false,
@@ -183,9 +180,7 @@ class mcp_warn
'S_SELECT_SORT_KEY' => $s_sort_key,
'S_SELECT_SORT_DAYS' => $s_limit_days,
- 'PAGE_NUMBER' => on_page($user_count, $config['topics_per_page'], $start),
- 'PAGINATION' => generate_pagination(append_sid("{$phpbb_root_path}mcp.$phpEx", "i=warn&amp;mode=list&amp;st=$st&amp;sk=$sk&amp;sd=$sd"), $user_count, $config['topics_per_page'], $start),
- 'TOTAL_USERS' => ($user_count == 1) ? $user->lang['LIST_USER'] : sprintf($user->lang['LIST_USERS'], $user_count),
+ 'TOTAL_USERS' => $user->lang('LIST_USERS', (int) $user_count),
));
}
@@ -195,7 +190,7 @@ class mcp_warn
function mcp_warn_post_view($action)
{
global $phpEx, $phpbb_root_path, $config;
- global $template, $db, $user, $auth;
+ global $template, $db, $user, $auth, $phpbb_dispatcher;
$post_id = request_var('p', 0);
$forum_id = request_var('f', 0);
@@ -252,7 +247,7 @@ class mcp_warn
// Check if can send a notification
if ($config['allow_privmsg'])
{
- $auth2 = new auth();
+ $auth2 = new \phpbb\auth\auth();
$auth2->acl($user_row);
$s_can_notify = ($auth2->acl_get('u_readpm')) ? true : false;
unset($auth2);
@@ -272,44 +267,82 @@ class mcp_warn
{
if (check_form_key('mcp_warn'))
{
- add_warning($user_row, $warning, $notify, $post_id);
- $msg = $user->lang['USER_WARNING_ADDED'];
+ $s_mcp_warn_post = true;
+
+ /**
+ * Event for before warning a user for a post.
+ *
+ * @event core.mcp_warn_post_before
+ * @var array user_row The entire user row
+ * @var string warning The warning message
+ * @var bool notify If true, we notify the user for the warning
+ * @var int post_id The post id for which the warning is added
+ * @var bool s_mcp_warn_post If true, we add the warning else we omit it
+ * @since 3.1.0-b4
+ */
+ $vars = array(
+ 'user_row',
+ 'warning',
+ 'notify',
+ 'post_id',
+ 's_mcp_warn_post',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.mcp_warn_post_before', compact($vars)));
+
+ if ($s_mcp_warn_post)
+ {
+ add_warning($user_row, $warning, $notify, $post_id);
+ $message = $user->lang['USER_WARNING_ADDED'];
+
+ /**
+ * Event for after warning a user for a post.
+ *
+ * @event core.mcp_warn_post_after
+ * @var array user_row The entire user row
+ * @var string warning The warning message
+ * @var bool notify If true, the user was notified for the warning
+ * @var int post_id The post id for which the warning is added
+ * @var string message Message displayed to the moderator
+ * @since 3.1.0-b4
+ */
+ $vars = array(
+ 'user_row',
+ 'warning',
+ 'notify',
+ 'post_id',
+ 'message',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.mcp_warn_post_after', compact($vars)));
+ }
}
else
{
- $msg = $user->lang['FORM_INVALID'];
+ $message = $user->lang['FORM_INVALID'];
+ }
+
+ if (!empty($message))
+ {
+ $redirect = append_sid("{$phpbb_root_path}mcp.$phpEx", "i=notes&amp;mode=user_notes&amp;u=$user_id");
+ meta_refresh(2, $redirect);
+ trigger_error($message . '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], '<a href="' . $redirect . '">', '</a>'));
}
- $redirect = append_sid("{$phpbb_root_path}mcp.$phpEx", "i=notes&amp;mode=user_notes&amp;u=$user_id");
- meta_refresh(2, $redirect);
- trigger_error($msg . '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], '<a href="' . $redirect . '">', '</a>'));
}
// OK, they didn't submit a warning so lets build the page for them to do so
// We want to make the message available here as a reminder
// Parse the message and subject
- $message = censor_text($user_row['post_text']);
-
- // Second parse bbcode here
- if ($user_row['bbcode_bitfield'])
- {
- include_once($phpbb_root_path . 'includes/bbcode.' . $phpEx);
-
- $bbcode = new bbcode($user_row['bbcode_bitfield']);
- $bbcode->bbcode_second_pass($message, $user_row['bbcode_uid'], $user_row['bbcode_bitfield']);
- }
-
- $message = bbcode_nl2br($message);
- $message = smiley_text($message);
+ $parse_flags = OPTION_FLAG_SMILIES | ($user_row['bbcode_bitfield'] ? OPTION_FLAG_BBCODE : 0);
+ $message = generate_text_for_display($user_row['post_text'], $user_row['bbcode_uid'], $user_row['bbcode_bitfield'], $parse_flags, true);
// Generate the appropriate user information for the user we are looking at
- if (!function_exists('get_user_avatar'))
+ if (!function_exists('phpbb_get_user_rank'))
{
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
}
- get_user_rank($user_row['user_rank'], $user_row['user_posts'], $rank_title, $rank_img, $rank_img_src);
- $avatar_img = get_user_avatar($user_row['user_avatar'], $user_row['user_avatar_type'], $user_row['user_avatar_width'], $user_row['user_avatar_height']);
+ $user_rank_data = phpbb_get_user_rank($user_row, $user_row['user_posts']);
+ $avatar_img = phpbb_get_user_avatar($user_row);
$template->assign_vars(array(
'U_POST_ACTION' => $this->u_action,
@@ -317,13 +350,13 @@ class mcp_warn
'POST' => $message,
'USERNAME' => $user_row['username'],
'USER_COLOR' => (!empty($user_row['user_colour'])) ? $user_row['user_colour'] : '',
- 'RANK_TITLE' => $rank_title,
+ 'RANK_TITLE' => $user_rank_data['title'],
'JOINED' => $user->format_date($user_row['user_regdate']),
'POSTS' => ($user_row['user_posts']) ? $user_row['user_posts'] : 0,
'WARNINGS' => ($user_row['user_warnings']) ? $user_row['user_warnings'] : 0,
'AVATAR_IMG' => $avatar_img,
- 'RANK_IMG' => $rank_img,
+ 'RANK_IMG' => $user_rank_data['img'],
'L_WARNING_POST_DEFAULT' => sprintf($user->lang['WARNING_POST_DEFAULT'], generate_board_url() . "/viewtopic.$phpEx?f=$forum_id&amp;p=$post_id#p$post_id"),
@@ -337,7 +370,7 @@ class mcp_warn
function mcp_warn_user_view($action)
{
global $phpEx, $phpbb_root_path, $config, $module;
- global $template, $db, $user, $auth;
+ global $template, $db, $user, $auth, $phpbb_dispatcher;
$user_id = request_var('u', 0);
$username = request_var('username', '', true);
@@ -375,7 +408,7 @@ class mcp_warn
// Check if can send a notification
if ($config['allow_privmsg'])
{
- $auth2 = new auth();
+ $auth2 = new \phpbb\auth\auth();
$auth2->acl($user_row);
$s_can_notify = ($auth2->acl_get('u_readpm')) ? true : false;
unset($auth2);
@@ -395,32 +428,76 @@ class mcp_warn
{
if (check_form_key('mcp_warn'))
{
- add_warning($user_row, $warning, $notify);
- $msg = $user->lang['USER_WARNING_ADDED'];
+ $s_mcp_warn_user = true;
+
+ /**
+ * Event for before warning a user from MCP.
+ *
+ * @event core.mcp_warn_user_before
+ * @var array user_row The entire user row
+ * @var string warning The warning message
+ * @var bool notify If true, we notify the user for the warning
+ * @var bool s_mcp_warn_user If true, we add the warning else we omit it
+ * @since 3.1.0-b4
+ */
+ $vars = array(
+ 'user_row',
+ 'warning',
+ 'notify',
+ 's_mcp_warn_user',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.mcp_warn_user_before', compact($vars)));
+
+ if ($s_mcp_warn_user)
+ {
+ add_warning($user_row, $warning, $notify);
+ $message = $user->lang['USER_WARNING_ADDED'];
+
+ /**
+ * Event for after warning a user from MCP.
+ *
+ * @event core.mcp_warn_user_after
+ * @var array user_row The entire user row
+ * @var string warning The warning message
+ * @var bool notify If true, the user was notified for the warning
+ * @var string message Message displayed to the moderator
+ * @since 3.1.0-b4
+ */
+ $vars = array(
+ 'user_row',
+ 'warning',
+ 'notify',
+ 'message',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.mcp_warn_user_after', compact($vars)));
+ }
}
else
{
- $msg = $user->lang['FORM_INVALID'];
+ $message = $user->lang['FORM_INVALID'];
+ }
+
+ if (!empty($message))
+ {
+ $redirect = append_sid("{$phpbb_root_path}mcp.$phpEx", "i=notes&amp;mode=user_notes&amp;u=$user_id");
+ meta_refresh(2, $redirect);
+ trigger_error($message . '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], '<a href="' . $redirect . '">', '</a>'));
}
- $redirect = append_sid("{$phpbb_root_path}mcp.$phpEx", "i=notes&amp;mode=user_notes&amp;u=$user_id");
- meta_refresh(2, $redirect);
- trigger_error($msg . '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], '<a href="' . $redirect . '">', '</a>'));
}
// Generate the appropriate user information for the user we are looking at
- if (!function_exists('get_user_avatar'))
+ if (!function_exists('phpbb_get_user_rank'))
{
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
}
-
- get_user_rank($user_row['user_rank'], $user_row['user_posts'], $rank_title, $rank_img, $rank_img_src);
- $avatar_img = get_user_avatar($user_row['user_avatar'], $user_row['user_avatar_type'], $user_row['user_avatar_width'], $user_row['user_avatar_height']);
+ $user_rank_data = phpbb_get_user_rank($user_row, $user_row['user_posts']);
+ $avatar_img = phpbb_get_user_avatar($user_row);
// OK, they didn't submit a warning so lets build the page for them to do so
$template->assign_vars(array(
'U_POST_ACTION' => $this->u_action,
- 'RANK_TITLE' => $rank_title,
+ 'RANK_TITLE' => $user_rank_data['title'],
'JOINED' => $user->format_date($user_row['user_regdate']),
'POSTS' => ($user_row['user_posts']) ? $user_row['user_posts'] : 0,
'WARNINGS' => ($user_row['user_warnings']) ? $user_row['user_warnings'] : 0,
@@ -431,7 +508,7 @@ class mcp_warn
'U_PROFILE' => get_username_string('profile', $user_row['user_id'], $user_row['username'], $user_row['user_colour']),
'AVATAR_IMG' => $avatar_img,
- 'RANK_IMG' => $rank_img,
+ 'RANK_IMG' => $user_rank_data['img'],
'S_CAN_NOTIFY' => $s_can_notify,
));
@@ -453,12 +530,28 @@ function add_warning($user_row, $warning, $send_pm = true, $post_id = 0)
include_once($phpbb_root_path . 'includes/functions_privmsgs.' . $phpEx);
include_once($phpbb_root_path . 'includes/message_parser.' . $phpEx);
- $user_row['user_lang'] = (file_exists($phpbb_root_path . 'language/' . $user_row['user_lang'] . "/mcp.$phpEx")) ? $user_row['user_lang'] : $config['default_lang'];
- include($phpbb_root_path . 'language/' . basename($user_row['user_lang']) . "/mcp.$phpEx");
+ // Attempt to translate warning to language of user being warned if user's language differs from issuer's language
+ if ($user_row['user_lang'] != $user->lang_name)
+ {
+ $lang = array();
+
+ $user_row['user_lang'] = (file_exists($phpbb_root_path . 'language/' . basename($user_row['user_lang']) . "/mcp." . $phpEx)) ? $user_row['user_lang'] : $config['default_lang'];
+ include($phpbb_root_path . 'language/' . basename($user_row['user_lang']) . "/mcp." . $phpEx);
+
+ $warn_pm_subject = $lang['WARNING_PM_SUBJECT'];
+ $warn_pm_body = sprintf($lang['WARNING_PM_BODY'], $warning);
+
+ unset($lang);
+ }
+ else
+ {
+ $warn_pm_subject = $user->lang('WARNING_PM_SUBJECT');
+ $warn_pm_body = $user->lang('WARNING_PM_BODY', $warning);
+ }
$message_parser = new parse_message();
- $message_parser->message = sprintf($lang['WARNING_PM_BODY'], $warning);
+ $message_parser->message = $warn_pm_body;
$message_parser->parse(true, true, true, false, false, true, true);
$pm_data = array(
@@ -476,7 +569,7 @@ function add_warning($user_row, $warning, $send_pm = true, $post_id = 0)
'address_list' => array('u' => array($user_row['user_id'] => 'to')),
);
- submit_pm('post', $lang['WARNING_PM_SUBJECT'], $pm_data, false);
+ submit_pm('post', $warn_pm_subject, $pm_data, false);
}
add_log('admin', 'LOG_USER_WARNING', $user_row['username']);
@@ -507,5 +600,3 @@ function add_warning($user_row, $warning, $send_pm = true, $post_id = 0)
add_log('mod', $row['forum_id'], $row['topic_id'], 'LOG_USER_WARNING', $user_row['username']);
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/message_parser.php b/phpBB/includes/message_parser.php
index a134fab5d3..bbd5e84233 100644
--- a/phpBB/includes/message_parser.php
+++ b/phpBB/includes/message_parser.php
@@ -1,10 +1,13 @@
<?php
/**
*
-* @package phpBB3
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -18,13 +21,25 @@ if (!defined('IN_PHPBB'))
if (!class_exists('bbcode'))
{
+ // The following lines are for extensions which include message_parser.php
+ // while $phpbb_root_path and $phpEx are out of the script scope
+ // which may lead to the 'Undefined variable' and 'failed to open stream' errors
+ if (!isset($phpbb_root_path))
+ {
+ global $phpbb_root_path;
+ }
+
+ if (!isset($phpEx))
+ {
+ global $phpEx;
+ }
+
include($phpbb_root_path . 'includes/bbcode.' . $phpEx);
}
/**
* BBCODE FIRSTPASS
* BBCODE first pass class (functions for parsing messages for db storage)
-* @package phpBB3
*/
class bbcode_firstpass extends bbcode
{
@@ -104,6 +119,8 @@ class bbcode_firstpass extends bbcode
*/
function bbcode_init($allow_custom_bbcode = true)
{
+ global $phpbb_dispatcher;
+
static $rowset;
// This array holds all bbcode data. BBCodes will be processed in this
@@ -111,6 +128,9 @@ class bbcode_firstpass extends bbcode
// [quote] in second position.
// To parse multiline URL we enable dotall option setting only for URL text
// but not for link itself, thus [url][/url] is not affected.
+ //
+ // To perform custom validation in extension, use $this->validate_bbcode_by_extension()
+ // method which accepts variable number of parameters
$this->bbcodes = array(
'code' => array('bbcode_id' => 8, 'regexp' => array('#\[code(?:=([a-z]+))?\](.+\[/code\])#uise' => "\$this->bbcode_code('\$1', '\$2')")),
'quote' => array('bbcode_id' => 0, 'regexp' => array('#\[quote(?:=&quot;(.*?)&quot;)?\](.+)\[/quote\]#uise' => "\$this->bbcode_quote('\$0')")),
@@ -163,6 +183,21 @@ class bbcode_firstpass extends bbcode
'regexp' => array($row['first_pass_match'] => str_replace('$uid', $this->bbcode_uid, $row['first_pass_replace']))
);
}
+
+ $bbcodes = $this->bbcodes;
+
+ /**
+ * Event to modify the bbcode data for later parsing
+ *
+ * @event core.modify_bbcode_init
+ * @var array bbcodes Array of bbcode data for use in parsing
+ * @var array rowset Array of bbcode data from the database
+ * @since 3.1.0-a3
+ */
+ $vars = array('bbcodes', 'rowset');
+ extract($phpbb_dispatcher->trigger_event('core.modify_bbcode_init', compact($vars)));
+
+ $this->bbcodes = $bbcodes;
}
/**
@@ -210,7 +245,7 @@ class bbcode_firstpass extends bbcode
if ($config['max_' . $this->mode . '_font_size'] && $config['max_' . $this->mode . '_font_size'] < $stx)
{
- $this->warn_msg[] = sprintf($user->lang['MAX_FONT_SIZE_EXCEEDED'], $config['max_' . $this->mode . '_font_size']);
+ $this->warn_msg[] = $user->lang('MAX_FONT_SIZE_EXCEEDED', (int) $config['max_' . $this->mode . '_font_size']);
return '[size=' . $stx . ']' . $in . '[/size]';
}
@@ -294,7 +329,7 @@ class bbcode_firstpass extends bbcode
$in = str_replace(' ', '%20', $in);
// Checking urls
- if (!preg_match('#^' . get_preg_expression('url') . '$#i', $in) && !preg_match('#^' . get_preg_expression('www_url') . '$#i', $in))
+ if (!preg_match('#^' . get_preg_expression('url') . '$#iu', $in) && !preg_match('#^' . get_preg_expression('www_url') . '$#iu', $in))
{
return '[img]' . $in . '[/img]';
}
@@ -319,13 +354,13 @@ class bbcode_firstpass extends bbcode
if ($config['max_' . $this->mode . '_img_height'] && $config['max_' . $this->mode . '_img_height'] < $stats[1])
{
$error = true;
- $this->warn_msg[] = sprintf($user->lang['MAX_IMG_HEIGHT_EXCEEDED'], $config['max_' . $this->mode . '_img_height']);
+ $this->warn_msg[] = $user->lang('MAX_IMG_HEIGHT_EXCEEDED', (int) $config['max_' . $this->mode . '_img_height']);
}
if ($config['max_' . $this->mode . '_img_width'] && $config['max_' . $this->mode . '_img_width'] < $stats[0])
{
$error = true;
- $this->warn_msg[] = sprintf($user->lang['MAX_IMG_WIDTH_EXCEEDED'], $config['max_' . $this->mode . '_img_width']);
+ $this->warn_msg[] = $user->lang('MAX_IMG_WIDTH_EXCEEDED', (int) $config['max_' . $this->mode . '_img_width']);
}
}
}
@@ -362,8 +397,8 @@ class bbcode_firstpass extends bbcode
$in = str_replace(' ', '%20', $in);
// Make sure $in is a URL.
- if (!preg_match('#^' . get_preg_expression('url') . '$#i', $in) &&
- !preg_match('#^' . get_preg_expression('www_url') . '$#i', $in))
+ if (!preg_match('#^' . get_preg_expression('url') . '$#iu', $in) &&
+ !preg_match('#^' . get_preg_expression('www_url') . '$#iu', $in))
{
return '[flash=' . $width . ',' . $height . ']' . $in . '[/flash]';
}
@@ -374,13 +409,13 @@ class bbcode_firstpass extends bbcode
if ($config['max_' . $this->mode . '_img_height'] && $config['max_' . $this->mode . '_img_height'] < $height)
{
$error = true;
- $this->warn_msg[] = sprintf($user->lang['MAX_FLASH_HEIGHT_EXCEEDED'], $config['max_' . $this->mode . '_img_height']);
+ $this->warn_msg[] = $user->lang('MAX_FLASH_HEIGHT_EXCEEDED', (int) $config['max_' . $this->mode . '_img_height']);
}
if ($config['max_' . $this->mode . '_img_width'] && $config['max_' . $this->mode . '_img_width'] < $width)
{
$error = true;
- $this->warn_msg[] = sprintf($user->lang['MAX_FLASH_WIDTH_EXCEEDED'], $config['max_' . $this->mode . '_img_width']);
+ $this->warn_msg[] = $user->lang('MAX_FLASH_WIDTH_EXCEEDED', (int) $config['max_' . $this->mode . '_img_width']);
}
}
@@ -703,17 +738,6 @@ class bbcode_firstpass extends bbcode
{
global $config, $user;
- /**
- * If you change this code, make sure the cases described within the following reports are still working:
- * #3572 - [quote="[test]test"]test [ test[/quote] - (correct: parsed)
- * #14667 - [quote]test[/quote] test ] and [ test [quote]test[/quote] (correct: parsed)
- * #14770 - [quote="["]test[/quote] (correct: parsed)
- * [quote="[i]test[/i]"]test[/quote] (correct: parsed)
- * [quote="[quote]test[/quote]"]test[/quote] (correct: parsed - Username displayed as [quote]test[/quote])
- * #20735 - [quote]test[/[/b]quote] test [/quote][/quote] test - (correct: quoted: "test[/[/b]quote] test" / non-quoted: "[/quote] test" - also failed if layout distorted)
- * #40565 - [quote="a"]a[/quote][quote="a]a[/quote] (correct: first quote tag parsed, second quote tag unparsed)
- */
-
$in = str_replace("\r\n", "\n", str_replace('\"', '"', trim($in)));
if (!$in)
@@ -767,20 +791,6 @@ class bbcode_firstpass extends bbcode
else if (preg_match('#^quote(?:=&quot;(.*?)&quot;)?$#is', $buffer, $m) && substr($out, -1, 1) == '[')
{
$this->parsed_items['quote']++;
-
- // the buffer holds a valid opening tag
- if ($config['max_quote_depth'] && sizeof($close_tags) >= $config['max_quote_depth'])
- {
- // there are too many nested quotes
- $error_ary['quote_depth'] = sprintf($user->lang['QUOTE_DEPTH_EXCEEDED'], $config['max_quote_depth']);
-
- $out .= $buffer . $tok;
- $tok = '[]';
- $buffer = '';
-
- continue;
- }
-
array_push($close_tags, '/quote:' . $this->bbcode_uid);
if (isset($m[1]) && $m[1])
@@ -957,9 +967,9 @@ class bbcode_firstpass extends bbcode
$url = str_replace(' ', '%20', $url);
// Checking urls
- if (preg_match('#^' . get_preg_expression('url') . '$#i', $url) ||
- preg_match('#^' . get_preg_expression('www_url') . '$#i', $url) ||
- preg_match('#^' . preg_quote(generate_board_url(), '#') . get_preg_expression('relative_url') . '$#i', $url))
+ if (preg_match('#^' . get_preg_expression('url') . '$#iu', $url) ||
+ preg_match('#^' . get_preg_expression('www_url') . '$#iu', $url) ||
+ preg_match('#^' . preg_quote(generate_board_url(), '#') . get_preg_expression('relative_url') . '$#iu', $url))
{
$valid = true;
}
@@ -1044,7 +1054,6 @@ class bbcode_firstpass extends bbcode
/**
* Main message parser for posting, pm, etc. takes raw message
* and parses it for attachments, bbcode and smilies
-* @package phpBB3
*/
class parse_message extends bbcode_firstpass
{
@@ -1062,6 +1071,18 @@ class parse_message extends bbcode_firstpass
var $mode;
/**
+ * The plupload object used for dealing with attachments
+ * @var \phpbb\plupload\plupload
+ */
+ protected $plupload;
+
+ /**
+ * The mimetype guesser object used for attachment mimetypes
+ * @var \phpbb\mimetype\guesser
+ */
+ protected $mimetype_guesser;
+
+ /**
* Init - give message here or manually
*/
function parse_message($message = '')
@@ -1076,7 +1097,7 @@ class parse_message extends bbcode_firstpass
*/
function parse($allow_bbcode, $allow_magic_url, $allow_smilies, $allow_img_bbcode = true, $allow_flash_bbcode = true, $allow_quote_bbcode = true, $allow_url_bbcode = true, $update_this_message = true, $mode = 'post')
{
- global $config, $db, $user;
+ global $config, $db, $user, $phpbb_dispatcher;
$this->mode = $mode;
@@ -1117,7 +1138,7 @@ class parse_message extends bbcode_firstpass
// Maximum message length check. 0 disables this check completely.
if ((int) $config['max_' . $mode . '_chars'] > 0 && $message_length > (int) $config['max_' . $mode . '_chars'])
{
- $this->warn_msg[] = sprintf($user->lang['TOO_MANY_CHARS_' . strtoupper($mode)], $message_length, (int) $config['max_' . $mode . '_chars']);
+ $this->warn_msg[] = $user->lang('CHARS_' . strtoupper($mode) . '_CONTAINS', $message_length) . '<br />' . $user->lang('TOO_MANY_CHARS_LIMIT', (int) $config['max_' . $mode . '_chars']);
return (!$update_this_message) ? $return_message : $this->warn_msg;
}
@@ -1126,11 +1147,63 @@ class parse_message extends bbcode_firstpass
{
if (!$message_length || $message_length < (int) $config['min_post_chars'])
{
- $this->warn_msg[] = (!$message_length) ? $user->lang['TOO_FEW_CHARS'] : sprintf($user->lang['TOO_FEW_CHARS_LIMIT'], $message_length, (int) $config['min_post_chars']);
+ $this->warn_msg[] = (!$message_length) ? $user->lang['TOO_FEW_CHARS'] : ($user->lang('CHARS_POST_CONTAINS', $message_length) . '<br />' . $user->lang('TOO_FEW_CHARS_LIMIT', (int) $config['min_post_chars']));
return (!$update_this_message) ? $return_message : $this->warn_msg;
}
}
+ /**
+ * This event can be used for additional message checks/cleanup before parsing
+ *
+ * @event core.message_parser_check_message
+ * @var bool allow_bbcode Do we allow BBCodes
+ * @var bool allow_magic_url Do we allow magic urls
+ * @var bool allow_smilies Do we allow smilies
+ * @var bool allow_img_bbcode Do we allow image BBCode
+ * @var bool allow_flash_bbcode Do we allow flash BBCode
+ * @var bool allow_quote_bbcode Do we allow quote BBCode
+ * @var bool allow_url_bbcode Do we allow url BBCode
+ * @var bool update_this_message Do we alter the parsed message
+ * @var string mode Posting mode
+ * @var string message The message text to parse
+ * @var string bbcode_bitfield The bbcode_bitfield before parsing
+ * @var string bbcode_uid The bbcode_uid before parsing
+ * @var bool return Do we return after the event is triggered if $warn_msg is not empty
+ * @var array warn_msg Array of the warning messages
+ * @since 3.1.2-RC1
+ * @changed 3.1.3-RC1 Added vars $bbcode_bitfield and $bbcode_uid
+ */
+ $message = $this->message;
+ $warn_msg = $this->warn_msg;
+ $return = false;
+ $bbcode_bitfield = $this->bbcode_bitfield;
+ $bbcode_uid = $this->bbcode_uid;
+ $vars = array(
+ 'allow_bbcode',
+ 'allow_magic_url',
+ 'allow_smilies',
+ 'allow_img_bbcode',
+ 'allow_flash_bbcode',
+ 'allow_quote_bbcode',
+ 'allow_url_bbcode',
+ 'update_this_message',
+ 'mode',
+ 'message',
+ 'bbcode_bitfield',
+ 'bbcode_uid',
+ 'return',
+ 'warn_msg',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.message_parser_check_message', compact($vars)));
+ $this->message = $message;
+ $this->warn_msg = $warn_msg;
+ $this->bbcode_bitfield = $bbcode_bitfield;
+ $this->bbcode_uid = $bbcode_uid;
+ if ($return && !empty($this->warn_msg))
+ {
+ return (!$update_this_message) ? $return_message : $this->warn_msg;
+ }
+
// Prepare BBcode (just prepares some tags for better parsing)
if ($allow_bbcode && strpos($this->message, '[') !== false)
{
@@ -1173,6 +1246,21 @@ class parse_message extends bbcode_firstpass
}
}
+ // Check for out-of-bounds characters that are currently
+ // not supported by utf8_bin in MySQL
+ if (preg_match_all('/[\x{10000}-\x{10FFFF}]/u', $this->message, $matches))
+ {
+ $character_list = implode('<br />', $matches[0]);
+ $this->warn_msg[] = $user->lang('UNSUPPORTED_CHARACTERS_MESSAGE', $character_list);
+ return $update_this_message ? $this->warn_msg : $return_message;
+ }
+
+ // Remove quotes that are nested too deep
+ if ($config['max_quote_depth'] > 0)
+ {
+ $this->remove_nested_quotes($config['max_quote_depth']);
+ }
+
// Check for "empty" message. We do not check here for maximum length, because bbcode, smilies, etc. can add to the length.
// The maximum length check happened before any parsings.
if ($mode === 'post' && utf8_clean_string($this->message) === '')
@@ -1204,6 +1292,8 @@ class parse_message extends bbcode_firstpass
*/
function format_display($allow_bbcode, $allow_magic_url, $allow_smilies, $update_this_message = true)
{
+ global $phpbb_dispatcher;
+
// If false, then the parsed message get returned but internal message not processed.
if (!$update_this_message)
{
@@ -1211,6 +1301,29 @@ class parse_message extends bbcode_firstpass
$return_message = &$this->message;
}
+ $text = $this->message;
+ $uid = $this->bbcode_uid;
+
+ /**
+ * Event to modify the text before it is parsed
+ *
+ * @event core.modify_format_display_text_before
+ * @var string text The message text to parse
+ * @var string uid The bbcode uid
+ * @var bool allow_bbcode Do we allow bbcodes
+ * @var bool allow_magic_url Do we allow magic urls
+ * @var bool allow_smilies Do we allow smilies
+ * @var bool update_this_message Do we update the internal message
+ * with the parsed result
+ * @since 3.1.6-RC1
+ */
+ $vars = array('text', 'uid', 'allow_bbcode', 'allow_magic_url', 'allow_smilies', 'update_this_message');
+ extract($phpbb_dispatcher->trigger_event('core.modify_format_display_text_before', compact($vars)));
+
+ $this->message = $text;
+ $this->bbcode_uid = $uid;
+ unset($text, $uid);
+
if ($this->message_status == 'plain')
{
// Force updating message - of course.
@@ -1232,6 +1345,28 @@ class parse_message extends bbcode_firstpass
$this->message = bbcode_nl2br($this->message);
$this->message = smiley_text($this->message, !$allow_smilies);
+ $text = $this->message;
+ $uid = $this->bbcode_uid;
+
+ /**
+ * Event to modify the text after it is parsed
+ *
+ * @event core.modify_format_display_text_after
+ * @var string text The message text to parse
+ * @var string uid The bbcode uid
+ * @var bool allow_bbcode Do we allow bbcodes
+ * @var bool allow_magic_url Do we allow magic urls
+ * @var bool allow_smilies Do we allow smilies
+ * @var bool update_this_message Do we update the internal message
+ * with the parsed result
+ * @since 3.1.0-a3
+ */
+ $vars = array('text', 'uid', 'allow_bbcode', 'allow_magic_url', 'allow_smilies', 'update_this_message');
+ extract($phpbb_dispatcher->trigger_event('core.modify_format_display_text_after', compact($vars)));
+
+ $this->message = $text;
+ $this->bbcode_uid = $uid;
+
if (!$update_this_message)
{
unset($this->message);
@@ -1296,7 +1431,7 @@ class parse_message extends bbcode_firstpass
// NOTE: obtain_* function? chaching the table contents?
// For now setting the ttl to 10 minutes
- switch ($db->sql_layer)
+ switch ($db->get_sql_layer())
{
case 'mssql':
case 'mssql_odbc':
@@ -1306,12 +1441,6 @@ class parse_message extends bbcode_firstpass
ORDER BY LEN(code) DESC';
break;
- case 'firebird':
- $sql = 'SELECT *
- FROM ' . SMILIES_TABLE . '
- ORDER BY CHAR_LENGTH(code) DESC';
- break;
-
// LENGTH supported by MySQL, IBM DB2, Oracle and Access for sure...
default:
$sql = 'SELECT *
@@ -1364,13 +1493,14 @@ class parse_message extends bbcode_firstpass
*/
function parse_attachments($form_name, $mode, $forum_id, $submit, $preview, $refresh, $is_message = false)
{
- global $config, $auth, $user, $phpbb_root_path, $phpEx, $db;
+ global $config, $auth, $user, $phpbb_root_path, $phpEx, $db, $request;
$error = array();
$num_attachments = sizeof($this->attachment_data);
$this->filename_data['filecomment'] = utf8_normalize_nfc(request_var('filecomment', '', true));
- $upload_file = (isset($_FILES[$form_name]) && $_FILES[$form_name]['name'] != 'none' && trim($_FILES[$form_name]['name'])) ? true : false;
+ $upload = $request->file($form_name);
+ $upload_file = (!empty($upload) && $upload['name'] !== 'none' && trim($upload['name']));
$add_file = (isset($_POST['add_file'])) ? true : false;
$delete_file = (isset($_POST['delete_file'])) ? true : false;
@@ -1425,6 +1555,7 @@ class parse_message extends bbcode_firstpass
'is_orphan' => 1,
'real_filename' => $filedata['real_filename'],
'attach_comment'=> $this->filename_data['filecomment'],
+ 'filesize' => $filedata['filesize'],
);
$this->attachment_data = array_merge(array(0 => $new_entry), $this->attachment_data);
@@ -1445,12 +1576,17 @@ class parse_message extends bbcode_firstpass
}
else
{
- $error[] = sprintf($user->lang['TOO_MANY_ATTACHMENTS'], $cfg['max_attachments']);
+ $error[] = $user->lang('TOO_MANY_ATTACHMENTS', (int) $cfg['max_attachments']);
}
}
if ($preview || $refresh || sizeof($error))
{
+ if (isset($this->plupload) && $this->plupload->is_active())
+ {
+ $json_response = new \phpbb\json_response();
+ }
+
// Perform actions on temporary attachments
if ($delete_file)
{
@@ -1495,13 +1631,17 @@ class parse_message extends bbcode_firstpass
// Reindex Array
$this->attachment_data = array_values($this->attachment_data);
+ if (isset($this->plupload) && $this->plupload->is_active())
+ {
+ $json_response->send($this->attachment_data);
+ }
}
}
else if (($add_file || $preview) && $upload_file)
{
if ($num_attachments < $cfg['max_attachments'] || $auth->acl_gets('m_', 'a_', $forum_id))
{
- $filedata = upload_attachment($form_name, $forum_id, false, '', $is_message);
+ $filedata = upload_attachment($form_name, $forum_id, false, '', $is_message, false, $this->mimetype_guesser, $this->plupload);
$error = array_merge($error, $filedata['error']);
if (!sizeof($error))
@@ -1527,16 +1667,39 @@ class parse_message extends bbcode_firstpass
'is_orphan' => 1,
'real_filename' => $filedata['real_filename'],
'attach_comment'=> $this->filename_data['filecomment'],
+ 'filesize' => $filedata['filesize'],
);
$this->attachment_data = array_merge(array(0 => $new_entry), $this->attachment_data);
$this->message = preg_replace('#\[attachment=([0-9]+)\](.*?)\[\/attachment\]#e', "'[attachment='.(\\1 + 1).']\\2[/attachment]'", $this->message);
$this->filename_data['filecomment'] = '';
+
+ if (isset($this->plupload) && $this->plupload->is_active())
+ {
+ $download_url = append_sid("{$phpbb_root_path}download/file.{$phpEx}", 'mode=view&amp;id=' . $new_entry['attach_id']);
+
+ // Send the client the attachment data to maintain state
+ $json_response->send(array('data' => $this->attachment_data, 'download_url' => $download_url));
+ }
}
}
else
{
- $error[] = sprintf($user->lang['TOO_MANY_ATTACHMENTS'], $cfg['max_attachments']);
+ $error[] = $user->lang('TOO_MANY_ATTACHMENTS', (int) $cfg['max_attachments']);
+ }
+
+ if (!empty($error) && isset($this->plupload) && $this->plupload->is_active())
+ {
+ // If this is a plupload (and thus ajax) request, give the
+ // client the first error we have
+ $json_response->send(array(
+ 'jsonrpc' => '2.0',
+ 'id' => 'id',
+ 'error' => array(
+ 'code' => 105,
+ 'message' => current($error),
+ ),
+ ));
}
}
}
@@ -1553,9 +1716,10 @@ class parse_message extends bbcode_firstpass
function get_submitted_attachment_data($check_user_id = false)
{
global $user, $db, $phpbb_root_path, $phpEx, $config;
+ global $request;
$this->filename_data['filecomment'] = utf8_normalize_nfc(request_var('filecomment', '', true));
- $attachment_data = (isset($_POST['attachment_data'])) ? $_POST['attachment_data'] : array();
+ $attachment_data = $request->variable('attachment_data', array(0 => array('' => '')), true, \phpbb\request\request_interface::POST);
$this->attachment_data = array();
$check_user_id = ($check_user_id === false) ? $user->data['user_id'] : $check_user_id;
@@ -1583,7 +1747,7 @@ class parse_message extends bbcode_firstpass
if (sizeof($not_orphan))
{
// Get the attachment data, based on the poster id...
- $sql = 'SELECT attach_id, is_orphan, real_filename, attach_comment
+ $sql = 'SELECT attach_id, is_orphan, real_filename, attach_comment, filesize
FROM ' . ATTACHMENTS_TABLE . '
WHERE ' . $db->sql_in_set('attach_id', array_keys($not_orphan)) . '
AND poster_id = ' . $check_user_id;
@@ -1593,7 +1757,7 @@ class parse_message extends bbcode_firstpass
{
$pos = $not_orphan[$row['attach_id']];
$this->attachment_data[$pos] = $row;
- set_var($this->attachment_data[$pos]['attach_comment'], $_POST['attachment_data'][$pos]['attach_comment'], 'string', true);
+ $this->attachment_data[$pos]['attach_comment'] = $attachment_data[$pos]['attach_comment'];
unset($not_orphan[$row['attach_id']]);
}
@@ -1608,7 +1772,7 @@ class parse_message extends bbcode_firstpass
// Regenerate newly uploaded attachments
if (sizeof($orphan))
{
- $sql = 'SELECT attach_id, is_orphan, real_filename, attach_comment
+ $sql = 'SELECT attach_id, is_orphan, real_filename, attach_comment, filesize
FROM ' . ATTACHMENTS_TABLE . '
WHERE ' . $db->sql_in_set('attach_id', array_keys($orphan)) . '
AND poster_id = ' . $user->data['user_id'] . '
@@ -1619,7 +1783,7 @@ class parse_message extends bbcode_firstpass
{
$pos = $orphan[$row['attach_id']];
$this->attachment_data[$pos] = $row;
- set_var($this->attachment_data[$pos]['attach_comment'], $_POST['attachment_data'][$pos]['attach_comment'], 'string', true);
+ $this->attachment_data[$pos]['attach_comment'] = $attachment_data[$pos]['attach_comment'];
unset($orphan[$row['attach_id']]);
}
@@ -1658,7 +1822,7 @@ class parse_message extends bbcode_firstpass
$this->message = $poll['poll_title'];
$this->bbcode_bitfield = $bbcode_bitfield;
- $poll['poll_options'] = explode("\n", trim($poll['poll_option_text']));
+ $poll['poll_options'] = preg_split('/\s*?\n\s*/', trim($poll['poll_option_text']));
$poll['poll_options_size'] = sizeof($poll['poll_options']);
if (!$poll['poll_title'] && $poll['poll_options_size'])
@@ -1697,6 +1861,104 @@ class parse_message extends bbcode_firstpass
$poll['poll_max_options'] = ($poll['poll_max_options'] < 1) ? 1 : (($poll['poll_max_options'] > $config['max_poll_options']) ? $config['max_poll_options'] : $poll['poll_max_options']);
}
-}
-?> \ No newline at end of file
+ /**
+ * Remove nested quotes at given depth in current parsed message
+ *
+ * @param integer $max_depth Depth limit
+ * @return null
+ */
+ public function remove_nested_quotes($max_depth)
+ {
+ // Capture all [quote] and [/quote] tags
+ preg_match_all('(\\[/?quote(?:=&quot;(.*?)&quot;)?:' . $this->bbcode_uid . '\\])', $this->message, $matches, PREG_OFFSET_CAPTURE);
+
+ // Iterate over the quote tags to mark the ranges that must be removed
+ $depth = 0;
+ $ranges = array();
+ $start_pos = 0;
+ foreach ($matches[0] as $match)
+ {
+ if ($match[0][1] === '/')
+ {
+ --$depth;
+ if ($depth == $max_depth)
+ {
+ $end_pos = $match[1] + strlen($match[0]);
+ $length = $end_pos - $start_pos;
+ $ranges[] = array($start_pos, $length);
+ }
+ }
+ else
+ {
+ ++$depth;
+ if ($depth == $max_depth + 1)
+ {
+ $start_pos = $match[1];
+ }
+ }
+ }
+
+ foreach (array_reverse($ranges) as $range)
+ {
+ list($start_pos, $length) = $range;
+ $this->message = substr_replace($this->message, '', $start_pos, $length);
+ }
+ }
+
+ /**
+ * Setter function for passing the plupload object
+ *
+ * @param \phpbb\plupload\plupload $plupload The plupload object
+ *
+ * @return null
+ */
+ public function set_plupload(\phpbb\plupload\plupload $plupload)
+ {
+ $this->plupload = $plupload;
+ }
+
+ /**
+ * Setter function for passing the mimetype_guesser object
+ *
+ * @param \phpbb\mimetype\guesser $mimetype_guesser The mimetype_guesser object
+ *
+ * @return null
+ */
+ public function set_mimetype_guesser(\phpbb\mimetype\guesser $mimetype_guesser)
+ {
+ $this->mimetype_guesser = $mimetype_guesser;
+ }
+
+ /**
+ * Function to perform custom bbcode validation by extensions
+ * can be used in bbcode_init() to assign regexp replacement
+ * Example: 'regexp' => array('#\[b\](.*?)\[/b\]#uise' => "\$this->validate_bbcode_by_extension('\$1')")
+ *
+ * Accepts variable number of parameters
+ *
+ * @return mixed Validation result
+ */
+ public function validate_bbcode_by_extension()
+ {
+ global $phpbb_dispatcher;
+
+ $return = false;
+ $params_array = func_get_args();
+
+ /**
+ * Event to validate bbcode with the custom validating methods
+ * provided by extensions
+ *
+ * @event core.validate_bbcode_by_extension
+ * @var array params_array Array with the function parameters
+ * @var mixed return Validation result to return
+ *
+ * @since 3.1.5-RC1
+ */
+ $vars = array('params_array', 'return');
+ extract($phpbb_dispatcher->trigger_event('core.validate_bbcode_by_extension', compact($vars)));
+
+ return $return;
+ }
+}
diff --git a/phpBB/includes/questionnaire/questionnaire.php b/phpBB/includes/questionnaire/questionnaire.php
index 3268775cb6..63ea432863 100644
--- a/phpBB/includes/questionnaire/questionnaire.php
+++ b/phpBB/includes/questionnaire/questionnaire.php
@@ -1,10 +1,13 @@
<?php
/**
*
-* @package phpBB3
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -88,7 +91,6 @@ class phpbb_questionnaire_data_collector
/**
* Questionnaire PHP data provider
-* @package phpBB3
*/
class phpbb_questionnaire_php_data_provider
{
@@ -132,7 +134,6 @@ class phpbb_questionnaire_php_data_provider
/**
* Questionnaire System data provider
-* @package phpBB3
*/
class phpbb_questionnaire_system_data_provider
{
@@ -148,23 +149,15 @@ class phpbb_questionnaire_system_data_provider
*/
function get_data()
{
- // Start discovering the IPV4 server address, if available
- $server_address = '0.0.0.0';
-
- if (!empty($_SERVER['SERVER_ADDR']))
- {
- $server_address = $_SERVER['SERVER_ADDR'];
- }
+ global $request;
- // Running on IIS?
- if (!empty($_SERVER['LOCAL_ADDR']))
- {
- $server_address = $_SERVER['LOCAL_ADDR'];
- }
+ // Start discovering the IPV4 server address, if available
+ // Try apache, IIS, fall back to 0.0.0.0
+ $server_address = htmlspecialchars_decode($request->server('SERVER_ADDR', $request->server('LOCAL_ADDR', '0.0.0.0')));
return array(
'os' => PHP_OS,
- 'httpd' => $_SERVER['SERVER_SOFTWARE'],
+ 'httpd' => htmlspecialchars_decode($request->server('SERVER_SOFTWARE')),
// we don't want the real IP address (for privacy policy reasons) but only
// a network address to see whether your installation is running on a private or public network.
'private_ip' => $this->is_private_ip($server_address),
@@ -220,7 +213,6 @@ class phpbb_questionnaire_system_data_provider
/**
* Questionnaire phpBB data provider
-* @package phpBB3
*/
class phpbb_questionnaire_phpbb_data_provider
{
@@ -265,10 +257,13 @@ class phpbb_questionnaire_phpbb_data_provider
*/
function get_data()
{
- global $phpbb_root_path, $phpEx;
- include("{$phpbb_root_path}config.$phpEx");
+ global $phpbb_root_path, $phpEx, $phpbb_config_php_file;
+
+ extract($phpbb_config_php_file->get_all());
unset($dbhost, $dbport, $dbname, $dbuser, $dbpasswd); // Just a precaution
+ $dbms = $phpbb_config_php_file->convert_30_dbms_to_31($dbms);
+
// Only send certain config vars
$config_vars = array(
'active_sessions' => true,
@@ -313,7 +308,6 @@ class phpbb_questionnaire_phpbb_data_provider
'avatar_max_width' => true,
'avatar_min_height' => true,
'avatar_min_width' => true,
- 'board_dst' => true,
'board_email_form' => true,
'board_hide_emails' => true,
'board_timezone' => true,
@@ -482,17 +476,16 @@ class phpbb_questionnaire_phpbb_data_provider
}
}
- global $db;
+ global $db, $request;
$result['dbms'] = $dbms;
$result['acm_type'] = $acm_type;
- $result['load_extensions'] = $load_extensions;
$result['user_agent'] = 'Unknown';
$result['dbms_version'] = $db->sql_server_info(true);
// Try to get user agent vendor and version
$match = array();
- $user_agent = (!empty($_SERVER['HTTP_USER_AGENT'])) ? (string) $_SERVER['HTTP_USER_AGENT'] : '';
+ $user_agent = $request->header('User-Agent');
$agents = array('firefox', 'msie', 'opera', 'chrome', 'safari', 'mozilla', 'seamonkey', 'konqueror', 'netscape', 'gecko', 'navigator', 'mosaic', 'lynx', 'amaya', 'omniweb', 'avant', 'camino', 'flock', 'aol');
// We check here 1 by 1 because some strings occur after others (for example Mozilla [...] Firefox/)
@@ -508,5 +501,3 @@ class phpbb_questionnaire_phpbb_data_provider
return $result;
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/search/fulltext_mysql.php b/phpBB/includes/search/fulltext_mysql.php
deleted file mode 100644
index f28b8885e7..0000000000
--- a/phpBB/includes/search/fulltext_mysql.php
+++ /dev/null
@@ -1,943 +0,0 @@
-<?php
-/**
-*
-* @package search
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
-*
-*/
-
-/**
-* @ignore
-*/
-if (!defined('IN_PHPBB'))
-{
- exit;
-}
-
-/**
-* @ignore
-*/
-include_once($phpbb_root_path . 'includes/search/search.' . $phpEx);
-
-/**
-* fulltext_mysql
-* Fulltext search for MySQL
-* @package search
-*/
-class fulltext_mysql extends search_backend
-{
- var $stats = array();
- var $word_length = array();
- var $split_words = array();
- var $search_query;
- var $common_words = array();
- var $pcre_properties = false;
- var $mbstring_regex = false;
-
- function fulltext_mysql(&$error)
- {
- global $config;
-
- $this->word_length = array('min' => $config['fulltext_mysql_min_word_len'], 'max' => $config['fulltext_mysql_max_word_len']);
-
- if (version_compare(PHP_VERSION, '5.1.0', '>=') || (version_compare(PHP_VERSION, '5.0.0-dev', '<=') && version_compare(PHP_VERSION, '4.4.0', '>=')))
- {
- // While this is the proper range of PHP versions, PHP may not be linked with the bundled PCRE lib and instead with an older version
- if (@preg_match('/\p{L}/u', 'a') !== false)
- {
- $this->pcre_properties = true;
- }
- }
-
- if (function_exists('mb_ereg'))
- {
- $this->mbstring_regex = true;
- mb_regex_encoding('UTF-8');
- }
-
- $error = false;
- }
-
- /**
- * Checks for correct MySQL version and stores min/max word length in the config
- */
- function init()
- {
- global $db, $user;
-
- if ($db->sql_layer != 'mysql4' && $db->sql_layer != 'mysqli')
- {
- return $user->lang['FULLTEXT_MYSQL_INCOMPATIBLE_VERSION'];
- }
-
- $result = $db->sql_query('SHOW TABLE STATUS LIKE \'' . POSTS_TABLE . '\'');
- $info = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
-
- $engine = '';
- if (isset($info['Engine']))
- {
- $engine = $info['Engine'];
- }
- else if (isset($info['Type']))
- {
- $engine = $info['Type'];
- }
-
- $fulltext_supported =
- $engine === 'MyISAM' ||
- // FULLTEXT is supported on InnoDB since MySQL 5.6.4 according to
- // http://dev.mysql.com/doc/refman/5.6/en/innodb-storage-engine.html
- $engine === 'InnoDB' &&
- phpbb_version_compare($db->sql_server_info(true), '5.6.4', '>=');
-
- if (!$fulltext_supported)
- {
- return $user->lang['FULLTEXT_MYSQL_NOT_SUPPORTED'];
- }
-
- $sql = 'SHOW VARIABLES
- LIKE \'ft\_%\'';
- $result = $db->sql_query($sql);
-
- $mysql_info = array();
- while ($row = $db->sql_fetchrow($result))
- {
- $mysql_info[$row['Variable_name']] = $row['Value'];
- }
- $db->sql_freeresult($result);
-
- set_config('fulltext_mysql_max_word_len', $mysql_info['ft_max_word_len']);
- set_config('fulltext_mysql_min_word_len', $mysql_info['ft_min_word_len']);
-
- return false;
- }
-
- /**
- * Splits keywords entered by a user into an array of words stored in $this->split_words
- * Stores the tidied search query in $this->search_query
- *
- * @param string &$keywords Contains the keyword as entered by the user
- * @param string $terms is either 'all' or 'any'
- * @return bool false if no valid keywords were found and otherwise true
- */
- function split_keywords(&$keywords, $terms)
- {
- global $config, $user;
-
- if ($terms == 'all')
- {
- $match = array('#\sand\s#iu', '#\sor\s#iu', '#\snot\s#iu', '#(^|\s)\+#', '#(^|\s)-#', '#(^|\s)\|#');
- $replace = array(' +', ' |', ' -', ' +', ' -', ' |');
-
- $keywords = preg_replace($match, $replace, $keywords);
- }
-
- // Filter out as above
- $split_keywords = preg_replace("#[\n\r\t]+#", ' ', trim(htmlspecialchars_decode($keywords)));
-
- // Split words
- if ($this->pcre_properties)
- {
- $split_keywords = preg_replace('#([^\p{L}\p{N}\'*"()])#u', '$1$1', str_replace('\'\'', '\' \'', trim($split_keywords)));
- }
- else if ($this->mbstring_regex)
- {
- $split_keywords = mb_ereg_replace('([^\w\'*"()])', '\\1\\1', str_replace('\'\'', '\' \'', trim($split_keywords)));
- }
- else
- {
- $split_keywords = preg_replace('#([^\w\'*"()])#u', '$1$1', str_replace('\'\'', '\' \'', trim($split_keywords)));
- }
-
- if ($this->pcre_properties)
- {
- $matches = array();
- preg_match_all('#(?:[^\p{L}\p{N}*"()]|^)([+\-|]?(?:[\p{L}\p{N}*"()]+\'?)*[\p{L}\p{N}*"()])(?:[^\p{L}\p{N}*"()]|$)#u', $split_keywords, $matches);
- $this->split_words = $matches[1];
- }
- else if ($this->mbstring_regex)
- {
- mb_ereg_search_init($split_keywords, '(?:[^\w*"()]|^)([+\-|]?(?:[\w*"()]+\'?)*[\w*"()])(?:[^\w*"()]|$)');
-
- while (($word = mb_ereg_search_regs()))
- {
- $this->split_words[] = $word[1];
- }
- }
- else
- {
- $matches = array();
- preg_match_all('#(?:[^\w*"()]|^)([+\-|]?(?:[\w*"()]+\'?)*[\w*"()])(?:[^\w*"()]|$)#u', $split_keywords, $matches);
- $this->split_words = $matches[1];
- }
-
- // We limit the number of allowed keywords to minimize load on the database
- if ($config['max_num_search_keywords'] && sizeof($this->split_words) > $config['max_num_search_keywords'])
- {
- trigger_error($user->lang('MAX_NUM_SEARCH_KEYWORDS_REFINE', $config['max_num_search_keywords'], sizeof($this->split_words)));
- }
-
- // to allow phrase search, we need to concatenate quoted words
- $tmp_split_words = array();
- $phrase = '';
- foreach ($this->split_words as $word)
- {
- if ($phrase)
- {
- $phrase .= ' ' . $word;
- if (strpos($word, '"') !== false && substr_count($word, '"') % 2 == 1)
- {
- $tmp_split_words[] = $phrase;
- $phrase = '';
- }
- }
- else if (strpos($word, '"') !== false && substr_count($word, '"') % 2 == 1)
- {
- $phrase = $word;
- }
- else
- {
- $tmp_split_words[] = $word . ' ';
- }
- }
- if ($phrase)
- {
- $tmp_split_words[] = $phrase;
- }
-
- $this->split_words = $tmp_split_words;
-
- unset($tmp_split_words);
- unset($phrase);
-
- foreach ($this->split_words as $i => $word)
- {
- $clean_word = preg_replace('#^[+\-|"]#', '', $word);
-
- // check word length
- $clean_len = utf8_strlen(str_replace('*', '', $clean_word));
- if (($clean_len < $config['fulltext_mysql_min_word_len']) || ($clean_len > $config['fulltext_mysql_max_word_len']))
- {
- $this->common_words[] = $word;
- unset($this->split_words[$i]);
- }
- }
-
- if ($terms == 'any')
- {
- $this->search_query = '';
- foreach ($this->split_words as $word)
- {
- if ((strpos($word, '+') === 0) || (strpos($word, '-') === 0) || (strpos($word, '|') === 0))
- {
- $word = substr($word, 1);
- }
- $this->search_query .= $word . ' ';
- }
- }
- else
- {
- $this->search_query = '';
- foreach ($this->split_words as $word)
- {
- if ((strpos($word, '+') === 0) || (strpos($word, '-') === 0))
- {
- $this->search_query .= $word . ' ';
- }
- else if (strpos($word, '|') === 0)
- {
- $this->search_query .= substr($word, 1) . ' ';
- }
- else
- {
- $this->search_query .= '+' . $word . ' ';
- }
- }
- }
-
- $this->search_query = utf8_htmlspecialchars($this->search_query);
-
- if ($this->search_query)
- {
- $this->split_words = array_values($this->split_words);
- sort($this->split_words);
- return true;
- }
- return false;
- }
-
- /**
- * Turns text into an array of words
- */
- function split_message($text)
- {
- global $config;
-
- // Split words
- if ($this->pcre_properties)
- {
- $text = preg_replace('#([^\p{L}\p{N}\'*])#u', '$1$1', str_replace('\'\'', '\' \'', trim($text)));
- }
- else if ($this->mbstring_regex)
- {
- $text = mb_ereg_replace('([^\w\'*])', '\\1\\1', str_replace('\'\'', '\' \'', trim($text)));
- }
- else
- {
- $text = preg_replace('#([^\w\'*])#u', '$1$1', str_replace('\'\'', '\' \'', trim($text)));
- }
-
- if ($this->pcre_properties)
- {
- $matches = array();
- preg_match_all('#(?:[^\p{L}\p{N}*]|^)([+\-|]?(?:[\p{L}\p{N}*]+\'?)*[\p{L}\p{N}*])(?:[^\p{L}\p{N}*]|$)#u', $text, $matches);
- $text = $matches[1];
- }
- else if ($this->mbstring_regex)
- {
- mb_ereg_search_init($text, '(?:[^\w*]|^)([+\-|]?(?:[\w*]+\'?)*[\w*])(?:[^\w*]|$)');
-
- $text = array();
- while (($word = mb_ereg_search_regs()))
- {
- $text[] = $word[1];
- }
- }
- else
- {
- $matches = array();
- preg_match_all('#(?:[^\w*]|^)([+\-|]?(?:[\w*]+\'?)*[\w*])(?:[^\w*]|$)#u', $text, $matches);
- $text = $matches[1];
- }
-
- // remove too short or too long words
- $text = array_values($text);
- for ($i = 0, $n = sizeof($text); $i < $n; $i++)
- {
- $text[$i] = trim($text[$i]);
- if (utf8_strlen($text[$i]) < $config['fulltext_mysql_min_word_len'] || utf8_strlen($text[$i]) > $config['fulltext_mysql_max_word_len'])
- {
- unset($text[$i]);
- }
- }
-
- return array_values($text);
- }
-
- /**
- * Performs a search on keywords depending on display specific params. You have to run split_keywords() first.
- *
- * @param string $type contains either posts or topics depending on what should be searched for
- * @param string $fields contains either titleonly (topic titles should be searched), msgonly (only message bodies should be searched), firstpost (only subject and body of the first post should be searched) or all (all post bodies and subjects should be searched)
- * @param string $terms is either 'all' (use query as entered, words without prefix should default to "have to be in field") or 'any' (ignore search query parts and just return all posts that contain any of the specified words)
- * @param array $sort_by_sql contains SQL code for the ORDER BY part of a query
- * @param string $sort_key is the key of $sort_by_sql for the selected sorting
- * @param string $sort_dir is either a or d representing ASC and DESC
- * @param string $sort_days specifies the maximum amount of days a post may be old
- * @param array $ex_fid_ary specifies an array of forum ids which should not be searched
- * @param array $m_approve_fid_ary specifies an array of forum ids in which the searcher is allowed to view unapproved posts
- * @param int $topic_id is set to 0 or a topic id, if it is not 0 then only posts in this topic should be searched
- * @param array $author_ary an array of author ids if the author should be ignored during the search the array is empty
- * @param string $author_name specifies the author match, when ANONYMOUS is also a search-match
- * @param array &$id_ary passed by reference, to be filled with ids for the page specified by $start and $per_page, should be ordered
- * @param int $start indicates the first index of the page
- * @param int $per_page number of ids each page is supposed to contain
- * @return boolean|int total number of results
- *
- * @access public
- */
- function keyword_search($type, $fields, $terms, $sort_by_sql, $sort_key, $sort_dir, $sort_days, $ex_fid_ary, $m_approve_fid_ary, $topic_id, $author_ary, $author_name, &$id_ary, $start, $per_page)
- {
- global $config, $db;
-
- // No keywords? No posts.
- if (!$this->search_query)
- {
- return false;
- }
-
- // generate a search_key from all the options to identify the results
- $search_key = md5(implode('#', array(
- implode(', ', $this->split_words),
- $type,
- $fields,
- $terms,
- $sort_days,
- $sort_key,
- $topic_id,
- implode(',', $ex_fid_ary),
- implode(',', $m_approve_fid_ary),
- implode(',', $author_ary)
- )));
-
- // try reading the results from cache
- $result_count = 0;
- if ($this->obtain_ids($search_key, $result_count, $id_ary, $start, $per_page, $sort_dir) == SEARCH_RESULT_IN_CACHE)
- {
- return $result_count;
- }
-
- $id_ary = array();
-
- $join_topic = ($type == 'posts') ? false : true;
-
- // Build sql strings for sorting
- $sql_sort = $sort_by_sql[$sort_key] . (($sort_dir == 'a') ? ' ASC' : ' DESC');
- $sql_sort_table = $sql_sort_join = '';
-
- switch ($sql_sort[0])
- {
- case 'u':
- $sql_sort_table = USERS_TABLE . ' u, ';
- $sql_sort_join = ($type == 'posts') ? ' AND u.user_id = p.poster_id ' : ' AND u.user_id = t.topic_poster ';
- break;
-
- case 't':
- $join_topic = true;
- break;
-
- case 'f':
- $sql_sort_table = FORUMS_TABLE . ' f, ';
- $sql_sort_join = ' AND f.forum_id = p.forum_id ';
- break;
- }
-
- // Build some display specific sql strings
- switch ($fields)
- {
- case 'titleonly':
- $sql_match = 'p.post_subject';
- $sql_match_where = ' AND p.post_id = t.topic_first_post_id';
- $join_topic = true;
- break;
-
- case 'msgonly':
- $sql_match = 'p.post_text';
- $sql_match_where = '';
- break;
-
- case 'firstpost':
- $sql_match = 'p.post_subject, p.post_text';
- $sql_match_where = ' AND p.post_id = t.topic_first_post_id';
- $join_topic = true;
- break;
-
- default:
- $sql_match = 'p.post_subject, p.post_text';
- $sql_match_where = '';
- break;
- }
-
- if (!sizeof($m_approve_fid_ary))
- {
- $m_approve_fid_sql = ' AND p.post_approved = 1';
- }
- else if ($m_approve_fid_ary === array(-1))
- {
- $m_approve_fid_sql = '';
- }
- else
- {
- $m_approve_fid_sql = ' AND (p.post_approved = 1 OR ' . $db->sql_in_set('p.forum_id', $m_approve_fid_ary, true) . ')';
- }
-
- $sql_select = (!$result_count) ? 'SQL_CALC_FOUND_ROWS ' : '';
- $sql_select = ($type == 'posts') ? $sql_select . 'p.post_id' : 'DISTINCT ' . $sql_select . 't.topic_id';
- $sql_from = ($join_topic) ? TOPICS_TABLE . ' t, ' : '';
- $field = ($type == 'posts') ? 'post_id' : 'topic_id';
- if (sizeof($author_ary) && $author_name)
- {
- // first one matches post of registered users, second one guests and deleted users
- $sql_author = ' AND (' . $db->sql_in_set('p.poster_id', array_diff($author_ary, array(ANONYMOUS)), false, true) . ' OR p.post_username ' . $author_name . ')';
- }
- else if (sizeof($author_ary))
- {
- $sql_author = ' AND ' . $db->sql_in_set('p.poster_id', $author_ary);
- }
- else
- {
- $sql_author = '';
- }
-
- $sql_where_options = $sql_sort_join;
- $sql_where_options .= ($topic_id) ? ' AND p.topic_id = ' . $topic_id : '';
- $sql_where_options .= ($join_topic) ? ' AND t.topic_id = p.topic_id' : '';
- $sql_where_options .= (sizeof($ex_fid_ary)) ? ' AND ' . $db->sql_in_set('p.forum_id', $ex_fid_ary, true) : '';
- $sql_where_options .= $m_approve_fid_sql;
- $sql_where_options .= $sql_author;
- $sql_where_options .= ($sort_days) ? ' AND p.post_time >= ' . (time() - ($sort_days * 86400)) : '';
- $sql_where_options .= $sql_match_where;
-
- $sql = "SELECT $sql_select
- FROM $sql_from$sql_sort_table" . POSTS_TABLE . " p
- WHERE MATCH ($sql_match) AGAINST ('" . $db->sql_escape(htmlspecialchars_decode($this->search_query)) . "' IN BOOLEAN MODE)
- $sql_where_options
- ORDER BY $sql_sort";
- $result = $db->sql_query_limit($sql, $config['search_block_size'], $start);
-
- while ($row = $db->sql_fetchrow($result))
- {
- $id_ary[] = (int) $row[$field];
- }
- $db->sql_freeresult($result);
-
- $id_ary = array_unique($id_ary);
-
- if (!sizeof($id_ary))
- {
- return false;
- }
-
- // if the total result count is not cached yet, retrieve it from the db
- if (!$result_count)
- {
- $sql = 'SELECT FOUND_ROWS() as result_count';
- $result = $db->sql_query($sql);
- $result_count = (int) $db->sql_fetchfield('result_count');
- $db->sql_freeresult($result);
-
- if (!$result_count)
- {
- return false;
- }
- }
-
- // store the ids, from start on then delete anything that isn't on the current page because we only need ids for one page
- $this->save_ids($search_key, implode(' ', $this->split_words), $author_ary, $result_count, $id_ary, $start, $sort_dir);
- $id_ary = array_slice($id_ary, 0, (int) $per_page);
-
- return $result_count;
- }
-
- /**
- * Performs a search on an author's posts without caring about message contents. Depends on display specific params
- *
- * @param string $type contains either posts or topics depending on what should be searched for
- * @param boolean $firstpost_only if true, only topic starting posts will be considered
- * @param array $sort_by_sql contains SQL code for the ORDER BY part of a query
- * @param string $sort_key is the key of $sort_by_sql for the selected sorting
- * @param string $sort_dir is either a or d representing ASC and DESC
- * @param string $sort_days specifies the maximum amount of days a post may be old
- * @param array $ex_fid_ary specifies an array of forum ids which should not be searched
- * @param array $m_approve_fid_ary specifies an array of forum ids in which the searcher is allowed to view unapproved posts
- * @param int $topic_id is set to 0 or a topic id, if it is not 0 then only posts in this topic should be searched
- * @param array $author_ary an array of author ids
- * @param string $author_name specifies the author match, when ANONYMOUS is also a search-match
- * @param array &$id_ary passed by reference, to be filled with ids for the page specified by $start and $per_page, should be ordered
- * @param int $start indicates the first index of the page
- * @param int $per_page number of ids each page is supposed to contain
- * @return boolean|int total number of results
- *
- * @access public
- */
- function author_search($type, $firstpost_only, $sort_by_sql, $sort_key, $sort_dir, $sort_days, $ex_fid_ary, $m_approve_fid_ary, $topic_id, $author_ary, $author_name, &$id_ary, $start, $per_page)
- {
- global $config, $db;
-
- // No author? No posts.
- if (!sizeof($author_ary))
- {
- return 0;
- }
-
- // generate a search_key from all the options to identify the results
- $search_key = md5(implode('#', array(
- '',
- $type,
- ($firstpost_only) ? 'firstpost' : '',
- '',
- '',
- $sort_days,
- $sort_key,
- $topic_id,
- implode(',', $ex_fid_ary),
- implode(',', $m_approve_fid_ary),
- implode(',', $author_ary),
- $author_name,
- )));
-
- // try reading the results from cache
- $result_count = 0;
- if ($this->obtain_ids($search_key, $result_count, $id_ary, $start, $per_page, $sort_dir) == SEARCH_RESULT_IN_CACHE)
- {
- return $result_count;
- }
-
- $id_ary = array();
-
- // Create some display specific sql strings
- if ($author_name)
- {
- // first one matches post of registered users, second one guests and deleted users
- $sql_author = '(' . $db->sql_in_set('p.poster_id', array_diff($author_ary, array(ANONYMOUS)), false, true) . ' OR p.post_username ' . $author_name . ')';
- }
- else
- {
- $sql_author = $db->sql_in_set('p.poster_id', $author_ary);
- }
- $sql_fora = (sizeof($ex_fid_ary)) ? ' AND ' . $db->sql_in_set('p.forum_id', $ex_fid_ary, true) : '';
- $sql_topic_id = ($topic_id) ? ' AND p.topic_id = ' . (int) $topic_id : '';
- $sql_time = ($sort_days) ? ' AND p.post_time >= ' . (time() - ($sort_days * 86400)) : '';
- $sql_firstpost = ($firstpost_only) ? ' AND p.post_id = t.topic_first_post_id' : '';
-
- // Build sql strings for sorting
- $sql_sort = $sort_by_sql[$sort_key] . (($sort_dir == 'a') ? ' ASC' : ' DESC');
- $sql_sort_table = $sql_sort_join = '';
- switch ($sql_sort[0])
- {
- case 'u':
- $sql_sort_table = USERS_TABLE . ' u, ';
- $sql_sort_join = ($type == 'posts') ? ' AND u.user_id = p.poster_id ' : ' AND u.user_id = t.topic_poster ';
- break;
-
- case 't':
- $sql_sort_table = ($type == 'posts' && !$firstpost_only) ? TOPICS_TABLE . ' t, ' : '';
- $sql_sort_join = ($type == 'posts' && !$firstpost_only) ? ' AND t.topic_id = p.topic_id ' : '';
- break;
-
- case 'f':
- $sql_sort_table = FORUMS_TABLE . ' f, ';
- $sql_sort_join = ' AND f.forum_id = p.forum_id ';
- break;
- }
-
- if (!sizeof($m_approve_fid_ary))
- {
- $m_approve_fid_sql = ' AND p.post_approved = 1';
- }
- else if ($m_approve_fid_ary == array(-1))
- {
- $m_approve_fid_sql = '';
- }
- else
- {
- $m_approve_fid_sql = ' AND (p.post_approved = 1 OR ' . $db->sql_in_set('p.forum_id', $m_approve_fid_ary, true) . ')';
- }
-
- // If the cache was completely empty count the results
- $calc_results = ($result_count) ? '' : 'SQL_CALC_FOUND_ROWS ';
-
- // Build the query for really selecting the post_ids
- if ($type == 'posts')
- {
- $sql = "SELECT {$calc_results}p.post_id
- FROM " . $sql_sort_table . POSTS_TABLE . ' p' . (($firstpost_only) ? ', ' . TOPICS_TABLE . ' t ' : ' ') . "
- WHERE $sql_author
- $sql_topic_id
- $sql_firstpost
- $m_approve_fid_sql
- $sql_fora
- $sql_sort_join
- $sql_time
- ORDER BY $sql_sort";
- $field = 'post_id';
- }
- else
- {
- $sql = "SELECT {$calc_results}t.topic_id
- FROM " . $sql_sort_table . TOPICS_TABLE . ' t, ' . POSTS_TABLE . " p
- WHERE $sql_author
- $sql_topic_id
- $sql_firstpost
- $m_approve_fid_sql
- $sql_fora
- AND t.topic_id = p.topic_id
- $sql_sort_join
- $sql_time
- GROUP BY t.topic_id
- ORDER BY $sql_sort";
- $field = 'topic_id';
- }
-
- // Only read one block of posts from the db and then cache it
- $result = $db->sql_query_limit($sql, $config['search_block_size'], $start);
-
- while ($row = $db->sql_fetchrow($result))
- {
- $id_ary[] = (int) $row[$field];
- }
- $db->sql_freeresult($result);
-
- // retrieve the total result count if needed
- if (!$result_count)
- {
- $sql = 'SELECT FOUND_ROWS() as result_count';
- $result = $db->sql_query($sql);
- $result_count = (int) $db->sql_fetchfield('result_count');
- $db->sql_freeresult($result);
-
- if (!$result_count)
- {
- return false;
- }
- }
-
- if (sizeof($id_ary))
- {
- $this->save_ids($search_key, '', $author_ary, $result_count, $id_ary, $start, $sort_dir);
- $id_ary = array_slice($id_ary, 0, $per_page);
-
- return $result_count;
- }
- return false;
- }
-
- /**
- * Destroys cached search results, that contained one of the new words in a post so the results won't be outdated.
- *
- * @param string $mode contains the post mode: edit, post, reply, quote ...
- */
- function index($mode, $post_id, &$message, &$subject, $poster_id, $forum_id)
- {
- global $db;
-
- // Split old and new post/subject to obtain array of words
- $split_text = $this->split_message($message);
- $split_title = ($subject) ? $this->split_message($subject) : array();
-
- $words = array_unique(array_merge($split_text, $split_title));
-
- unset($split_text);
- unset($split_title);
-
- // destroy cached search results containing any of the words removed or added
- $this->destroy_cache($words, array($poster_id));
-
- unset($words);
- }
-
- /**
- * Destroy cached results, that might be outdated after deleting a post
- */
- function index_remove($post_ids, $author_ids, $forum_ids)
- {
- $this->destroy_cache(array(), array_unique($author_ids));
- }
-
- /**
- * Destroy old cache entries
- */
- function tidy()
- {
- global $db, $config;
-
- // destroy too old cached search results
- $this->destroy_cache(array());
-
- set_config('search_last_gc', time(), true);
- }
-
- /**
- * Create fulltext index
- */
- function create_index($acp_module, $u_action)
- {
- global $db;
-
- // Make sure we can actually use MySQL with fulltext indexes
- if ($error = $this->init())
- {
- return $error;
- }
-
- if (empty($this->stats))
- {
- $this->get_stats();
- }
-
- $alter = array();
-
- if (!isset($this->stats['post_subject']))
- {
- if ($db->sql_layer == 'mysqli' || version_compare($db->sql_server_info(true), '4.1.3', '>='))
- {
- $alter[] = 'MODIFY post_subject varchar(255) COLLATE utf8_unicode_ci DEFAULT \'\' NOT NULL';
- }
- else
- {
- $alter[] = 'MODIFY post_subject text NOT NULL';
- }
- $alter[] = 'ADD FULLTEXT (post_subject)';
- }
-
- if (!isset($this->stats['post_text']))
- {
- if ($db->sql_layer == 'mysqli' || version_compare($db->sql_server_info(true), '4.1.3', '>='))
- {
- $alter[] = 'MODIFY post_text mediumtext COLLATE utf8_unicode_ci NOT NULL';
- }
- else
- {
- $alter[] = 'MODIFY post_text mediumtext NOT NULL';
- }
- $alter[] = 'ADD FULLTEXT (post_text)';
- }
-
- if (!isset($this->stats['post_content']))
- {
- $alter[] = 'ADD FULLTEXT post_content (post_subject, post_text)';
- }
-
- if (sizeof($alter))
- {
- $db->sql_query('ALTER TABLE ' . POSTS_TABLE . ' ' . implode(', ', $alter));
- }
-
- $db->sql_query('TRUNCATE TABLE ' . SEARCH_RESULTS_TABLE);
-
- return false;
- }
-
- /**
- * Drop fulltext index
- */
- function delete_index($acp_module, $u_action)
- {
- global $db;
-
- // Make sure we can actually use MySQL with fulltext indexes
- if ($error = $this->init())
- {
- return $error;
- }
-
- if (empty($this->stats))
- {
- $this->get_stats();
- }
-
- $alter = array();
-
- if (isset($this->stats['post_subject']))
- {
- $alter[] = 'DROP INDEX post_subject';
- }
-
- if (isset($this->stats['post_text']))
- {
- $alter[] = 'DROP INDEX post_text';
- }
-
- if (isset($this->stats['post_content']))
- {
- $alter[] = 'DROP INDEX post_content';
- }
-
- if (sizeof($alter))
- {
- $db->sql_query('ALTER TABLE ' . POSTS_TABLE . ' ' . implode(', ', $alter));
- }
-
- $db->sql_query('TRUNCATE TABLE ' . SEARCH_RESULTS_TABLE);
-
- return false;
- }
-
- /**
- * Returns true if both FULLTEXT indexes exist
- */
- function index_created()
- {
- if (empty($this->stats))
- {
- $this->get_stats();
- }
-
- return (isset($this->stats['post_text']) && isset($this->stats['post_subject']) && isset($this->stats['post_content'])) ? true : false;
- }
-
- /**
- * Returns an associative array containing information about the indexes
- */
- function index_stats()
- {
- global $user;
-
- if (empty($this->stats))
- {
- $this->get_stats();
- }
-
- return array(
- $user->lang['FULLTEXT_MYSQL_TOTAL_POSTS'] => ($this->index_created()) ? $this->stats['total_posts'] : 0,
- );
- }
-
- function get_stats()
- {
- global $db;
-
- if (strpos($db->sql_layer, 'mysql') === false)
- {
- $this->stats = array();
- return;
- }
-
- $sql = 'SHOW INDEX
- FROM ' . POSTS_TABLE;
- $result = $db->sql_query($sql);
-
- while ($row = $db->sql_fetchrow($result))
- {
- // deal with older MySQL versions which didn't use Index_type
- $index_type = (isset($row['Index_type'])) ? $row['Index_type'] : $row['Comment'];
-
- if ($index_type == 'FULLTEXT')
- {
- if ($row['Key_name'] == 'post_text')
- {
- $this->stats['post_text'] = $row;
- }
- else if ($row['Key_name'] == 'post_subject')
- {
- $this->stats['post_subject'] = $row;
- }
- else if ($row['Key_name'] == 'post_content')
- {
- $this->stats['post_content'] = $row;
- }
- }
- }
- $db->sql_freeresult($result);
-
- $this->stats['total_posts'] = empty($this->stats) ? 0 : $db->get_estimated_row_count(POSTS_TABLE);
- }
-
- /**
- * Display a note, that UTF-8 support is not available with certain versions of PHP
- */
- function acp()
- {
- global $user, $config;
-
- $tpl = '
- <dl>
- <dt><label>' . $user->lang['FULLTEXT_MYSQL_PCRE'] . '</label><br /><span>' . $user->lang['FULLTEXT_MYSQL_PCRE_EXPLAIN'] . '</span></dt>
- <dd>' . (($this->pcre_properties) ? $user->lang['YES'] : $user->lang['NO']) . ' (PHP ' . PHP_VERSION . ')</dd>
- </dl>
- <dl>
- <dt><label>' . $user->lang['FULLTEXT_MYSQL_MBSTRING'] . '</label><br /><span>' . $user->lang['FULLTEXT_MYSQL_MBSTRING_EXPLAIN'] . '</span></dt>
- <dd>' . (($this->mbstring_regex) ? $user->lang['YES'] : $user->lang['NO']). '</dd>
- </dl>
- <dl>
- <dt><label>' . $user->lang['MIN_SEARCH_CHARS'] . ':</label><br /><span>' . $user->lang['FULLTEXT_MYSQL_MIN_SEARCH_CHARS_EXPLAIN'] . '</span></dt>
- <dd>' . $config['fulltext_mysql_min_word_len'] . '</dd>
- </dl>
- <dl>
- <dt><label>' . $user->lang['MAX_SEARCH_CHARS'] . ':</label><br /><span>' . $user->lang['FULLTEXT_MYSQL_MAX_SEARCH_CHARS_EXPLAIN'] . '</span></dt>
- <dd>' . $config['fulltext_mysql_max_word_len'] . '</dd>
- </dl>
- ';
-
- // These are fields required in the config table
- return array(
- 'tpl' => $tpl,
- 'config' => array()
- );
- }
-}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/search/fulltext_native.php b/phpBB/includes/search/fulltext_native.php
deleted file mode 100644
index 948911bbfe..0000000000
--- a/phpBB/includes/search/fulltext_native.php
+++ /dev/null
@@ -1,1742 +0,0 @@
-<?php
-/**
-*
-* @package search
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
-*
-*/
-
-/**
-* @ignore
-*/
-if (!defined('IN_PHPBB'))
-{
- exit;
-}
-
-/**
-* @ignore
-*/
-include_once($phpbb_root_path . 'includes/search/search.' . $phpEx);
-
-/**
-* fulltext_native
-* phpBB's own db driven fulltext search, version 2
-* @package search
-*/
-class fulltext_native extends search_backend
-{
- var $stats = array();
- var $word_length = array();
- var $search_query;
- var $common_words = array();
-
- var $must_contain_ids = array();
- var $must_not_contain_ids = array();
- var $must_exclude_one_ids = array();
-
- /**
- * Initialises the fulltext_native search backend with min/max word length and makes sure the UTF-8 normalizer is loaded.
- *
- * @param boolean|string &$error is passed by reference and should either be set to false on success or an error message on failure.
- *
- * @access public
- */
- function fulltext_native(&$error)
- {
- global $phpbb_root_path, $phpEx, $config;
-
- $this->word_length = array('min' => $config['fulltext_native_min_chars'], 'max' => $config['fulltext_native_max_chars']);
-
- /**
- * Load the UTF tools
- */
- if (!class_exists('utf_normalizer'))
- {
- include($phpbb_root_path . 'includes/utf/utf_normalizer.' . $phpEx);
- }
-
-
- $error = false;
- }
-
- /**
- * This function fills $this->search_query with the cleaned user search query.
- *
- * If $terms is 'any' then the words will be extracted from the search query
- * and combined with | inside brackets. They will afterwards be treated like
- * an standard search query.
- *
- * Then it analyses the query and fills the internal arrays $must_not_contain_ids,
- * $must_contain_ids and $must_exclude_one_ids which are later used by keyword_search().
- *
- * @param string $keywords contains the search query string as entered by the user
- * @param string $terms is either 'all' (use search query as entered, default words to 'must be contained in post')
- * or 'any' (find all posts containing at least one of the given words)
- * @return boolean false if no valid keywords were found and otherwise true
- *
- * @access public
- */
- function split_keywords($keywords, $terms)
- {
- global $db, $user, $config;
-
- $tokens = '+-|()*';
-
- $keywords = trim($this->cleanup($keywords, $tokens));
-
- // allow word|word|word without brackets
- if ((strpos($keywords, ' ') === false) && (strpos($keywords, '|') !== false) && (strpos($keywords, '(') === false))
- {
- $keywords = '(' . $keywords . ')';
- }
-
- $open_bracket = $space = false;
- for ($i = 0, $n = strlen($keywords); $i < $n; $i++)
- {
- if ($open_bracket !== false)
- {
- switch ($keywords[$i])
- {
- case ')':
- if ($open_bracket + 1 == $i)
- {
- $keywords[$i - 1] = '|';
- $keywords[$i] = '|';
- }
- $open_bracket = false;
- break;
- case '(':
- $keywords[$i] = '|';
- break;
- case '+':
- case '-':
- case ' ':
- $keywords[$i] = '|';
- break;
- case '*':
- if ($i === 0 || ($keywords[$i - 1] !== '*' && strcspn($keywords[$i - 1], $tokens) === 0))
- {
- if ($i === $n - 1 || ($keywords[$i + 1] !== '*' && strcspn($keywords[$i + 1], $tokens) === 0))
- {
- $keywords = substr($keywords, 0, $i) . substr($keywords, $i + 1);
- }
- }
- break;
- }
- }
- else
- {
- switch ($keywords[$i])
- {
- case ')':
- $keywords[$i] = ' ';
- break;
- case '(':
- $open_bracket = $i;
- $space = false;
- break;
- case '|':
- $keywords[$i] = ' ';
- break;
- case '-':
- case '+':
- $space = $keywords[$i];
- break;
- case ' ':
- if ($space !== false)
- {
- $keywords[$i] = $space;
- }
- break;
- default:
- $space = false;
- }
- }
- }
-
- if ($open_bracket)
- {
- $keywords .= ')';
- }
-
- $match = array(
- '# +#',
- '#\|\|+#',
- '#(\+|\-)(?:\+|\-)+#',
- '#\(\|#',
- '#\|\)#',
- );
- $replace = array(
- ' ',
- '|',
- '$1',
- '(',
- ')',
- );
-
- $keywords = preg_replace($match, $replace, $keywords);
- $num_keywords = sizeof(explode(' ', $keywords));
-
- // We limit the number of allowed keywords to minimize load on the database
- if ($config['max_num_search_keywords'] && $num_keywords > $config['max_num_search_keywords'])
- {
- trigger_error($user->lang('MAX_NUM_SEARCH_KEYWORDS_REFINE', $config['max_num_search_keywords'], $num_keywords));
- }
-
- // $keywords input format: each word separated by a space, words in a bracket are not separated
-
- // the user wants to search for any word, convert the search query
- if ($terms == 'any')
- {
- $words = array();
-
- preg_match_all('#([^\\s+\\-|()]+)(?:$|[\\s+\\-|()])#u', $keywords, $words);
- if (sizeof($words[1]))
- {
- $keywords = '(' . implode('|', $words[1]) . ')';
- }
- }
-
- // set the search_query which is shown to the user
- $this->search_query = $keywords;
-
- $exact_words = array();
- preg_match_all('#([^\\s+\\-|()]+)(?:$|[\\s+\\-|()])#u', $keywords, $exact_words);
- $exact_words = $exact_words[1];
-
- $common_ids = $words = array();
-
- if (sizeof($exact_words))
- {
- $sql = 'SELECT word_id, word_text, word_common
- FROM ' . SEARCH_WORDLIST_TABLE . '
- WHERE ' . $db->sql_in_set('word_text', $exact_words) . '
- ORDER BY word_count ASC';
- $result = $db->sql_query($sql);
-
- // store an array of words and ids, remove common words
- while ($row = $db->sql_fetchrow($result))
- {
- if ($row['word_common'])
- {
- $this->common_words[] = $row['word_text'];
- $common_ids[$row['word_text']] = (int) $row['word_id'];
- continue;
- }
-
- $words[$row['word_text']] = (int) $row['word_id'];
- }
- $db->sql_freeresult($result);
- }
-
- // Handle +, - without preceeding whitespace character
- $match = array('#(\S)\+#', '#(\S)-#');
- $replace = array('$1 +', '$1 +');
-
- $keywords = preg_replace($match, $replace, $keywords);
-
- // now analyse the search query, first split it using the spaces
- $query = explode(' ', $keywords);
-
- $this->must_contain_ids = array();
- $this->must_not_contain_ids = array();
- $this->must_exclude_one_ids = array();
-
- $mode = '';
- $ignore_no_id = true;
-
- foreach ($query as $word)
- {
- if (empty($word))
- {
- continue;
- }
-
- // words which should not be included
- if ($word[0] == '-')
- {
- $word = substr($word, 1);
-
- // a group of which at least one may not be in the resulting posts
- if ($word[0] == '(')
- {
- $word = array_unique(explode('|', substr($word, 1, -1)));
- $mode = 'must_exclude_one';
- }
- // one word which should not be in the resulting posts
- else
- {
- $mode = 'must_not_contain';
- }
- $ignore_no_id = true;
- }
- // words which have to be included
- else
- {
- // no prefix is the same as a +prefix
- if ($word[0] == '+')
- {
- $word = substr($word, 1);
- }
-
- // a group of words of which at least one word should be in every resulting post
- if ($word[0] == '(')
- {
- $word = array_unique(explode('|', substr($word, 1, -1)));
- }
- $ignore_no_id = false;
- $mode = 'must_contain';
- }
-
- if (empty($word))
- {
- continue;
- }
-
- // if this is an array of words then retrieve an id for each
- if (is_array($word))
- {
- $non_common_words = array();
- $id_words = array();
- foreach ($word as $i => $word_part)
- {
- if (strpos($word_part, '*') !== false)
- {
- $id_words[] = '\'' . $db->sql_escape(str_replace('*', '%', $word_part)) . '\'';
- $non_common_words[] = $word_part;
- }
- else if (isset($words[$word_part]))
- {
- $id_words[] = $words[$word_part];
- $non_common_words[] = $word_part;
- }
- else
- {
- $len = utf8_strlen($word_part);
- if ($len < $this->word_length['min'] || $len > $this->word_length['max'])
- {
- $this->common_words[] = $word_part;
- }
- }
- }
- if (sizeof($id_words))
- {
- sort($id_words);
- if (sizeof($id_words) > 1)
- {
- $this->{$mode . '_ids'}[] = $id_words;
- }
- else
- {
- $mode = ($mode == 'must_exclude_one') ? 'must_not_contain' : $mode;
- $this->{$mode . '_ids'}[] = $id_words[0];
- }
- }
- // throw an error if we shall not ignore unexistant words
- else if (!$ignore_no_id && sizeof($non_common_words))
- {
- trigger_error(sprintf($user->lang['WORDS_IN_NO_POST'], implode(', ', $non_common_words)));
- }
- unset($non_common_words);
- }
- // else we only need one id
- else if (($wildcard = strpos($word, '*') !== false) || isset($words[$word]))
- {
- if ($wildcard)
- {
- $len = utf8_strlen(str_replace('*', '', $word));
- if ($len >= $this->word_length['min'] && $len <= $this->word_length['max'])
- {
- $this->{$mode . '_ids'}[] = '\'' . $db->sql_escape(str_replace('*', '%', $word)) . '\'';
- }
- else
- {
- $this->common_words[] = $word;
- }
- }
- else
- {
- $this->{$mode . '_ids'}[] = $words[$word];
- }
- }
- else
- {
- if (!isset($common_ids[$word]))
- {
- $len = utf8_strlen($word);
- if ($len < $this->word_length['min'] || $len > $this->word_length['max'])
- {
- $this->common_words[] = $word;
- }
- }
- }
- }
-
- // Return true if all words are not common words
- if (sizeof($exact_words) - sizeof($this->common_words) > 0)
- {
- return true;
- }
- return false;
- }
-
- /**
- * Performs a search on keywords depending on display specific params. You have to run split_keywords() first.
- *
- * @param string $type contains either posts or topics depending on what should be searched for
- * @param string $fields contains either titleonly (topic titles should be searched), msgonly (only message bodies should be searched), firstpost (only subject and body of the first post should be searched) or all (all post bodies and subjects should be searched)
- * @param string $terms is either 'all' (use query as entered, words without prefix should default to "have to be in field") or 'any' (ignore search query parts and just return all posts that contain any of the specified words)
- * @param array $sort_by_sql contains SQL code for the ORDER BY part of a query
- * @param string $sort_key is the key of $sort_by_sql for the selected sorting
- * @param string $sort_dir is either a or d representing ASC and DESC
- * @param string $sort_days specifies the maximum amount of days a post may be old
- * @param array $ex_fid_ary specifies an array of forum ids which should not be searched
- * @param array $m_approve_fid_ary specifies an array of forum ids in which the searcher is allowed to view unapproved posts
- * @param int $topic_id is set to 0 or a topic id, if it is not 0 then only posts in this topic should be searched
- * @param array $author_ary an array of author ids if the author should be ignored during the search the array is empty
- * @param string $author_name specifies the author match, when ANONYMOUS is also a search-match
- * @param array &$id_ary passed by reference, to be filled with ids for the page specified by $start and $per_page, should be ordered
- * @param int $start indicates the first index of the page
- * @param int $per_page number of ids each page is supposed to contain
- * @return boolean|int total number of results
- *
- * @access public
- */
- function keyword_search($type, $fields, $terms, $sort_by_sql, $sort_key, $sort_dir, $sort_days, $ex_fid_ary, $m_approve_fid_ary, $topic_id, $author_ary, $author_name, &$id_ary, $start, $per_page)
- {
- global $config, $db;
-
- // No keywords? No posts.
- if (empty($this->search_query))
- {
- return false;
- }
-
- // we can't search for negatives only
- if (empty($this->must_contain_ids))
- {
- return false;
- }
-
- $must_contain_ids = $this->must_contain_ids;
- $must_not_contain_ids = $this->must_not_contain_ids;
- $must_exclude_one_ids = $this->must_exclude_one_ids;
-
- sort($must_contain_ids);
- sort($must_not_contain_ids);
- sort($must_exclude_one_ids);
-
- // generate a search_key from all the options to identify the results
- $search_key = md5(implode('#', array(
- serialize($must_contain_ids),
- serialize($must_not_contain_ids),
- serialize($must_exclude_one_ids),
- $type,
- $fields,
- $terms,
- $sort_days,
- $sort_key,
- $topic_id,
- implode(',', $ex_fid_ary),
- implode(',', $m_approve_fid_ary),
- implode(',', $author_ary),
- $author_name,
- )));
-
- // try reading the results from cache
- $total_results = 0;
- if ($this->obtain_ids($search_key, $total_results, $id_ary, $start, $per_page, $sort_dir) == SEARCH_RESULT_IN_CACHE)
- {
- return $total_results;
- }
-
- $id_ary = array();
-
- $sql_where = array();
- $group_by = false;
- $m_num = 0;
- $w_num = 0;
-
- $sql_array = array(
- 'SELECT' => ($type == 'posts') ? 'p.post_id' : 'p.topic_id',
- 'FROM' => array(
- SEARCH_WORDMATCH_TABLE => array(),
- SEARCH_WORDLIST_TABLE => array(),
- ),
- 'LEFT_JOIN' => array(array(
- 'FROM' => array(POSTS_TABLE => 'p'),
- 'ON' => 'm0.post_id = p.post_id',
- )),
- );
-
- $title_match = '';
- $left_join_topics = false;
- $group_by = true;
- // Build some display specific sql strings
- switch ($fields)
- {
- case 'titleonly':
- $title_match = 'title_match = 1';
- $group_by = false;
- // no break
- case 'firstpost':
- $left_join_topics = true;
- $sql_where[] = 'p.post_id = t.topic_first_post_id';
- break;
-
- case 'msgonly':
- $title_match = 'title_match = 0';
- $group_by = false;
- break;
- }
-
- if ($type == 'topics')
- {
- $left_join_topics = true;
- $group_by = true;
- }
-
- /**
- * @todo Add a query optimizer (handle stuff like "+(4|3) +4")
- */
-
- foreach ($this->must_contain_ids as $subquery)
- {
- if (is_array($subquery))
- {
- $group_by = true;
-
- $word_id_sql = array();
- $word_ids = array();
- foreach ($subquery as $id)
- {
- if (is_string($id))
- {
- $sql_array['LEFT_JOIN'][] = array(
- 'FROM' => array(SEARCH_WORDLIST_TABLE => 'w' . $w_num),
- 'ON' => "w$w_num.word_text LIKE $id"
- );
- $word_ids[] = "w$w_num.word_id";
-
- $w_num++;
- }
- else
- {
- $word_ids[] = $id;
- }
- }
-
- $sql_where[] = $db->sql_in_set("m$m_num.word_id", $word_ids);
-
- unset($word_id_sql);
- unset($word_ids);
- }
- else if (is_string($subquery))
- {
- $sql_array['FROM'][SEARCH_WORDLIST_TABLE][] = 'w' . $w_num;
-
- $sql_where[] = "w$w_num.word_text LIKE $subquery";
- $sql_where[] = "m$m_num.word_id = w$w_num.word_id";
-
- $group_by = true;
- $w_num++;
- }
- else
- {
- $sql_where[] = "m$m_num.word_id = $subquery";
- }
-
- $sql_array['FROM'][SEARCH_WORDMATCH_TABLE][] = 'm' . $m_num;
-
- if ($title_match)
- {
- $sql_where[] = "m$m_num.$title_match";
- }
-
- if ($m_num != 0)
- {
- $sql_where[] = "m$m_num.post_id = m0.post_id";
- }
- $m_num++;
- }
-
- foreach ($this->must_not_contain_ids as $key => $subquery)
- {
- if (is_string($subquery))
- {
- $sql_array['LEFT_JOIN'][] = array(
- 'FROM' => array(SEARCH_WORDLIST_TABLE => 'w' . $w_num),
- 'ON' => "w$w_num.word_text LIKE $subquery"
- );
-
- $this->must_not_contain_ids[$key] = "w$w_num.word_id";
-
- $group_by = true;
- $w_num++;
- }
- }
-
- if (sizeof($this->must_not_contain_ids))
- {
- $sql_array['LEFT_JOIN'][] = array(
- 'FROM' => array(SEARCH_WORDMATCH_TABLE => 'm' . $m_num),
- 'ON' => $db->sql_in_set("m$m_num.word_id", $this->must_not_contain_ids) . (($title_match) ? " AND m$m_num.$title_match" : '') . " AND m$m_num.post_id = m0.post_id"
- );
-
- $sql_where[] = "m$m_num.word_id IS NULL";
- $m_num++;
- }
-
- foreach ($this->must_exclude_one_ids as $ids)
- {
- $is_null_joins = array();
- foreach ($ids as $id)
- {
- if (is_string($id))
- {
- $sql_array['LEFT_JOIN'][] = array(
- 'FROM' => array(SEARCH_WORDLIST_TABLE => 'w' . $w_num),
- 'ON' => "w$w_num.word_text LIKE $id"
- );
- $id = "w$w_num.word_id";
-
- $group_by = true;
- $w_num++;
- }
-
- $sql_array['LEFT_JOIN'][] = array(
- 'FROM' => array(SEARCH_WORDMATCH_TABLE => 'm' . $m_num),
- 'ON' => "m$m_num.word_id = $id AND m$m_num.post_id = m0.post_id" . (($title_match) ? " AND m$m_num.$title_match" : '')
- );
- $is_null_joins[] = "m$m_num.word_id IS NULL";
-
- $m_num++;
- }
- $sql_where[] = '(' . implode(' OR ', $is_null_joins) . ')';
- }
-
- if (!sizeof($m_approve_fid_ary))
- {
- $sql_where[] = 'p.post_approved = 1';
- }
- else if ($m_approve_fid_ary !== array(-1))
- {
- $sql_where[] = '(p.post_approved = 1 OR ' . $db->sql_in_set('p.forum_id', $m_approve_fid_ary, true) . ')';
- }
-
- if ($topic_id)
- {
- $sql_where[] = 'p.topic_id = ' . $topic_id;
- }
-
- if (sizeof($author_ary))
- {
- if ($author_name)
- {
- // first one matches post of registered users, second one guests and deleted users
- $sql_author = '(' . $db->sql_in_set('p.poster_id', array_diff($author_ary, array(ANONYMOUS)), false, true) . ' OR p.post_username ' . $author_name . ')';
- }
- else
- {
- $sql_author = $db->sql_in_set('p.poster_id', $author_ary);
- }
- $sql_where[] = $sql_author;
- }
-
- if (sizeof($ex_fid_ary))
- {
- $sql_where[] = $db->sql_in_set('p.forum_id', $ex_fid_ary, true);
- }
-
- if ($sort_days)
- {
- $sql_where[] = 'p.post_time >= ' . (time() - ($sort_days * 86400));
- }
-
- $sql_array['WHERE'] = implode(' AND ', $sql_where);
-
- $is_mysql = false;
- // if the total result count is not cached yet, retrieve it from the db
- if (!$total_results)
- {
- $sql = '';
- $sql_array_count = $sql_array;
-
- if ($left_join_topics)
- {
- $sql_array_count['LEFT_JOIN'][] = array(
- 'FROM' => array(TOPICS_TABLE => 't'),
- 'ON' => 'p.topic_id = t.topic_id'
- );
- }
-
- switch ($db->sql_layer)
- {
- case 'mysql4':
- case 'mysqli':
-
- // 3.x does not support SQL_CALC_FOUND_ROWS
- // $sql_array['SELECT'] = 'SQL_CALC_FOUND_ROWS ' . $sql_array['SELECT'];
- $is_mysql = true;
-
- break;
-
- case 'sqlite':
- $sql_array_count['SELECT'] = ($type == 'posts') ? 'DISTINCT p.post_id' : 'DISTINCT p.topic_id';
- $sql = 'SELECT COUNT(' . (($type == 'posts') ? 'post_id' : 'topic_id') . ') as total_results
- FROM (' . $db->sql_build_query('SELECT', $sql_array_count) . ')';
-
- // no break
-
- default:
- $sql_array_count['SELECT'] = ($type == 'posts') ? 'COUNT(DISTINCT p.post_id) AS total_results' : 'COUNT(DISTINCT p.topic_id) AS total_results';
- $sql = (!$sql) ? $db->sql_build_query('SELECT', $sql_array_count) : $sql;
-
- $result = $db->sql_query($sql);
- $total_results = (int) $db->sql_fetchfield('total_results');
- $db->sql_freeresult($result);
-
- if (!$total_results)
- {
- return false;
- }
- break;
- }
-
- unset($sql_array_count, $sql);
- }
-
- // Build sql strings for sorting
- $sql_sort = $sort_by_sql[$sort_key] . (($sort_dir == 'a') ? ' ASC' : ' DESC');
-
- switch ($sql_sort[0])
- {
- case 'u':
- $sql_array['FROM'][USERS_TABLE] = 'u';
- $sql_where[] = 'u.user_id = p.poster_id ';
- break;
-
- case 't':
- $left_join_topics = true;
- break;
-
- case 'f':
- $sql_array['FROM'][FORUMS_TABLE] = 'f';
- $sql_where[] = 'f.forum_id = p.forum_id';
- break;
- }
-
- if ($left_join_topics)
- {
- $sql_array['LEFT_JOIN'][] = array(
- 'FROM' => array(TOPICS_TABLE => 't'),
- 'ON' => 'p.topic_id = t.topic_id'
- );
- }
-
- $sql_array['WHERE'] = implode(' AND ', $sql_where);
- $sql_array['GROUP_BY'] = ($group_by) ? (($type == 'posts') ? 'p.post_id' : 'p.topic_id') . ', ' . $sort_by_sql[$sort_key] : '';
- $sql_array['ORDER_BY'] = $sql_sort;
-
- unset($sql_where, $sql_sort, $group_by);
-
- $sql = $db->sql_build_query('SELECT', $sql_array);
- $result = $db->sql_query_limit($sql, $config['search_block_size'], $start);
-
- while ($row = $db->sql_fetchrow($result))
- {
- $id_ary[] = (int) $row[(($type == 'posts') ? 'post_id' : 'topic_id')];
- }
- $db->sql_freeresult($result);
-
- if (!sizeof($id_ary))
- {
- return false;
- }
-
- // if we use mysql and the total result count is not cached yet, retrieve it from the db
- if (!$total_results && $is_mysql)
- {
- // Count rows for the executed queries. Replace $select within $sql with SQL_CALC_FOUND_ROWS, and run it.
- $sql_array_copy = $sql_array;
- $sql_array_copy['SELECT'] = 'SQL_CALC_FOUND_ROWS p.post_id ';
-
- $sql = $db->sql_build_query('SELECT', $sql_array_copy);
- unset($sql_array_copy);
-
- $db->sql_query($sql);
- $db->sql_freeresult($result);
-
- $sql = 'SELECT FOUND_ROWS() as total_results';
- $result = $db->sql_query($sql);
- $total_results = (int) $db->sql_fetchfield('total_results');
- $db->sql_freeresult($result);
-
- if (!$total_results)
- {
- return false;
- }
- }
-
- // store the ids, from start on then delete anything that isn't on the current page because we only need ids for one page
- $this->save_ids($search_key, $this->search_query, $author_ary, $total_results, $id_ary, $start, $sort_dir);
- $id_ary = array_slice($id_ary, 0, (int) $per_page);
-
- return $total_results;
- }
-
- /**
- * Performs a search on an author's posts without caring about message contents. Depends on display specific params
- *
- * @param string $type contains either posts or topics depending on what should be searched for
- * @param boolean $firstpost_only if true, only topic starting posts will be considered
- * @param array $sort_by_sql contains SQL code for the ORDER BY part of a query
- * @param string $sort_key is the key of $sort_by_sql for the selected sorting
- * @param string $sort_dir is either a or d representing ASC and DESC
- * @param string $sort_days specifies the maximum amount of days a post may be old
- * @param array $ex_fid_ary specifies an array of forum ids which should not be searched
- * @param array $m_approve_fid_ary specifies an array of forum ids in which the searcher is allowed to view unapproved posts
- * @param int $topic_id is set to 0 or a topic id, if it is not 0 then only posts in this topic should be searched
- * @param array $author_ary an array of author ids
- * @param string $author_name specifies the author match, when ANONYMOUS is also a search-match
- * @param array &$id_ary passed by reference, to be filled with ids for the page specified by $start and $per_page, should be ordered
- * @param int $start indicates the first index of the page
- * @param int $per_page number of ids each page is supposed to contain
- * @return boolean|int total number of results
- *
- * @access public
- */
- function author_search($type, $firstpost_only, $sort_by_sql, $sort_key, $sort_dir, $sort_days, $ex_fid_ary, $m_approve_fid_ary, $topic_id, $author_ary, $author_name, &$id_ary, $start, $per_page)
- {
- global $config, $db;
-
- // No author? No posts.
- if (!sizeof($author_ary))
- {
- return 0;
- }
-
- // generate a search_key from all the options to identify the results
- $search_key = md5(implode('#', array(
- '',
- $type,
- ($firstpost_only) ? 'firstpost' : '',
- '',
- '',
- $sort_days,
- $sort_key,
- $topic_id,
- implode(',', $ex_fid_ary),
- implode(',', $m_approve_fid_ary),
- implode(',', $author_ary),
- $author_name,
- )));
-
- // try reading the results from cache
- $total_results = 0;
- if ($this->obtain_ids($search_key, $total_results, $id_ary, $start, $per_page, $sort_dir) == SEARCH_RESULT_IN_CACHE)
- {
- return $total_results;
- }
-
- $id_ary = array();
-
- // Create some display specific sql strings
- if ($author_name)
- {
- // first one matches post of registered users, second one guests and deleted users
- $sql_author = '(' . $db->sql_in_set('p.poster_id', array_diff($author_ary, array(ANONYMOUS)), false, true) . ' OR p.post_username ' . $author_name . ')';
- }
- else
- {
- $sql_author = $db->sql_in_set('p.poster_id', $author_ary);
- }
- $sql_fora = (sizeof($ex_fid_ary)) ? ' AND ' . $db->sql_in_set('p.forum_id', $ex_fid_ary, true) : '';
- $sql_time = ($sort_days) ? ' AND p.post_time >= ' . (time() - ($sort_days * 86400)) : '';
- $sql_topic_id = ($topic_id) ? ' AND p.topic_id = ' . (int) $topic_id : '';
- $sql_firstpost = ($firstpost_only) ? ' AND p.post_id = t.topic_first_post_id' : '';
-
- // Build sql strings for sorting
- $sql_sort = $sort_by_sql[$sort_key] . (($sort_dir == 'a') ? ' ASC' : ' DESC');
- $sql_sort_table = $sql_sort_join = '';
- switch ($sql_sort[0])
- {
- case 'u':
- $sql_sort_table = USERS_TABLE . ' u, ';
- $sql_sort_join = ' AND u.user_id = p.poster_id ';
- break;
-
- case 't':
- $sql_sort_table = ($type == 'posts' && !$firstpost_only) ? TOPICS_TABLE . ' t, ' : '';
- $sql_sort_join = ($type == 'posts' && !$firstpost_only) ? ' AND t.topic_id = p.topic_id ' : '';
- break;
-
- case 'f':
- $sql_sort_table = FORUMS_TABLE . ' f, ';
- $sql_sort_join = ' AND f.forum_id = p.forum_id ';
- break;
- }
-
- if (!sizeof($m_approve_fid_ary))
- {
- $m_approve_fid_sql = ' AND p.post_approved = 1';
- }
- else if ($m_approve_fid_ary == array(-1))
- {
- $m_approve_fid_sql = '';
- }
- else
- {
- $m_approve_fid_sql = ' AND (p.post_approved = 1 OR ' . $db->sql_in_set('p.forum_id', $m_approve_fid_ary, true) . ')';
- }
-
- $select = ($type == 'posts') ? 'p.post_id' : 't.topic_id';
- $is_mysql = false;
-
- // If the cache was completely empty count the results
- if (!$total_results)
- {
- switch ($db->sql_layer)
- {
- case 'mysql4':
- case 'mysqli':
-// $select = 'SQL_CALC_FOUND_ROWS ' . $select;
- $is_mysql = true;
- break;
-
- default:
- if ($type == 'posts')
- {
- $sql = 'SELECT COUNT(p.post_id) as total_results
- FROM ' . POSTS_TABLE . ' p' . (($firstpost_only) ? ', ' . TOPICS_TABLE . ' t ' : ' ') . "
- WHERE $sql_author
- $sql_topic_id
- $sql_firstpost
- $m_approve_fid_sql
- $sql_fora
- $sql_time";
- }
- else
- {
- if ($db->sql_layer == 'sqlite')
- {
- $sql = 'SELECT COUNT(topic_id) as total_results
- FROM (SELECT DISTINCT t.topic_id';
- }
- else
- {
- $sql = 'SELECT COUNT(DISTINCT t.topic_id) as total_results';
- }
-
- $sql .= ' FROM ' . TOPICS_TABLE . ' t, ' . POSTS_TABLE . " p
- WHERE $sql_author
- $sql_topic_id
- $sql_firstpost
- $m_approve_fid_sql
- $sql_fora
- AND t.topic_id = p.topic_id
- $sql_time" . (($db->sql_layer == 'sqlite') ? ')' : '');
- }
- $result = $db->sql_query($sql);
-
- $total_results = (int) $db->sql_fetchfield('total_results');
- $db->sql_freeresult($result);
-
- if (!$total_results)
- {
- return false;
- }
- break;
- }
- }
-
- // Build the query for really selecting the post_ids
- if ($type == 'posts')
- {
- $sql = "SELECT $select
- FROM " . $sql_sort_table . POSTS_TABLE . ' p' . (($firstpost_only) ? ', ' . TOPICS_TABLE . ' t' : '') . "
- WHERE $sql_author
- $sql_topic_id
- $sql_firstpost
- $m_approve_fid_sql
- $sql_fora
- $sql_sort_join
- $sql_time
- ORDER BY $sql_sort";
- $field = 'post_id';
- }
- else
- {
- $sql = "SELECT $select
- FROM " . $sql_sort_table . TOPICS_TABLE . ' t, ' . POSTS_TABLE . " p
- WHERE $sql_author
- $sql_topic_id
- $sql_firstpost
- $m_approve_fid_sql
- $sql_fora
- AND t.topic_id = p.topic_id
- $sql_sort_join
- $sql_time
- GROUP BY t.topic_id, " . $sort_by_sql[$sort_key] . '
- ORDER BY ' . $sql_sort;
- $field = 'topic_id';
- }
-
- // Only read one block of posts from the db and then cache it
- $result = $db->sql_query_limit($sql, $config['search_block_size'], $start);
-
- while ($row = $db->sql_fetchrow($result))
- {
- $id_ary[] = (int) $row[$field];
- }
- $db->sql_freeresult($result);
-
- if (!$total_results && $is_mysql)
- {
- // Count rows for the executed queries. Replace $select within $sql with SQL_CALC_FOUND_ROWS, and run it.
- $sql = str_replace('SELECT ' . $select, 'SELECT DISTINCT SQL_CALC_FOUND_ROWS p.post_id', $sql);
-
- $db->sql_query($sql);
- $db->sql_freeresult($result);
-
- $sql = 'SELECT FOUND_ROWS() as total_results';
- $result = $db->sql_query($sql);
- $total_results = (int) $db->sql_fetchfield('total_results');
- $db->sql_freeresult($result);
-
- if (!$total_results)
- {
- return false;
- }
- }
-
- if (sizeof($id_ary))
- {
- $this->save_ids($search_key, '', $author_ary, $total_results, $id_ary, $start, $sort_dir);
- $id_ary = array_slice($id_ary, 0, $per_page);
-
- return $total_results;
- }
- return false;
- }
-
- /**
- * Split a text into words of a given length
- *
- * The text is converted to UTF-8, cleaned up, and split. Then, words that
- * conform to the defined length range are returned in an array.
- *
- * NOTE: duplicates are NOT removed from the return array
- *
- * @param string $text Text to split, encoded in UTF-8
- * @return array Array of UTF-8 words
- *
- * @access private
- */
- function split_message($text)
- {
- global $phpbb_root_path, $phpEx, $user;
-
- $match = $words = array();
-
- /**
- * Taken from the original code
- */
- // Do not index code
- $match[] = '#\[code(?:=.*?)?(\:?[0-9a-z]{5,})\].*?\[\/code(\:?[0-9a-z]{5,})\]#is';
- // BBcode
- $match[] = '#\[\/?[a-z0-9\*\+\-]+(?:=.*?)?(?::[a-z])?(\:?[0-9a-z]{5,})\]#';
-
- $min = $this->word_length['min'];
- $max = $this->word_length['max'];
-
- $isset_min = $min - 1;
-
- /**
- * Clean up the string, remove HTML tags, remove BBCodes
- */
- $word = strtok($this->cleanup(preg_replace($match, ' ', strip_tags($text)), -1), ' ');
-
- while (strlen($word))
- {
- if (strlen($word) > 255 || strlen($word) <= $isset_min)
- {
- /**
- * Words longer than 255 bytes are ignored. This will have to be
- * changed whenever we change the length of search_wordlist.word_text
- *
- * Words shorter than $isset_min bytes are ignored, too
- */
- $word = strtok(' ');
- continue;
- }
-
- $len = utf8_strlen($word);
-
- /**
- * Test whether the word is too short to be indexed.
- *
- * Note that this limit does NOT apply to CJK and Hangul
- */
- if ($len < $min)
- {
- /**
- * Note: this could be optimized. If the codepoint is lower than Hangul's range
- * we know that it will also be lower than CJK ranges
- */
- if ((strncmp($word, UTF8_HANGUL_FIRST, 3) < 0 || strncmp($word, UTF8_HANGUL_LAST, 3) > 0)
- && (strncmp($word, UTF8_CJK_FIRST, 3) < 0 || strncmp($word, UTF8_CJK_LAST, 3) > 0)
- && (strncmp($word, UTF8_CJK_B_FIRST, 4) < 0 || strncmp($word, UTF8_CJK_B_LAST, 4) > 0))
- {
- $word = strtok(' ');
- continue;
- }
- }
-
- $words[] = $word;
- $word = strtok(' ');
- }
-
- return $words;
- }
-
- /**
- * Updates wordlist and wordmatch tables when a message is posted or changed
- *
- * @param string $mode Contains the post mode: edit, post, reply, quote
- * @param int $post_id The id of the post which is modified/created
- * @param string &$message New or updated post content
- * @param string &$subject New or updated post subject
- * @param int $poster_id Post author's user id
- * @param int $forum_id The id of the forum in which the post is located
- *
- * @access public
- */
- function index($mode, $post_id, &$message, &$subject, $poster_id, $forum_id)
- {
- global $config, $db, $user;
-
- if (!$config['fulltext_native_load_upd'])
- {
- /**
- * The search indexer is disabled, return
- */
- return;
- }
-
- // Split old and new post/subject to obtain array of 'words'
- $split_text = $this->split_message($message);
- $split_title = $this->split_message($subject);
-
- $cur_words = array('post' => array(), 'title' => array());
-
- $words = array();
- if ($mode == 'edit')
- {
- $words['add']['post'] = array();
- $words['add']['title'] = array();
- $words['del']['post'] = array();
- $words['del']['title'] = array();
-
- $sql = 'SELECT w.word_id, w.word_text, m.title_match
- FROM ' . SEARCH_WORDLIST_TABLE . ' w, ' . SEARCH_WORDMATCH_TABLE . " m
- WHERE m.post_id = $post_id
- AND w.word_id = m.word_id";
- $result = $db->sql_query($sql);
-
- while ($row = $db->sql_fetchrow($result))
- {
- $which = ($row['title_match']) ? 'title' : 'post';
- $cur_words[$which][$row['word_text']] = $row['word_id'];
- }
- $db->sql_freeresult($result);
-
- $words['add']['post'] = array_diff($split_text, array_keys($cur_words['post']));
- $words['add']['title'] = array_diff($split_title, array_keys($cur_words['title']));
- $words['del']['post'] = array_diff(array_keys($cur_words['post']), $split_text);
- $words['del']['title'] = array_diff(array_keys($cur_words['title']), $split_title);
- }
- else
- {
- $words['add']['post'] = $split_text;
- $words['add']['title'] = $split_title;
- $words['del']['post'] = array();
- $words['del']['title'] = array();
- }
- unset($split_text);
- unset($split_title);
-
- // Get unique words from the above arrays
- $unique_add_words = array_unique(array_merge($words['add']['post'], $words['add']['title']));
-
- // We now have unique arrays of all words to be added and removed and
- // individual arrays of added and removed words for text and title. What
- // we need to do now is add the new words (if they don't already exist)
- // and then add (or remove) matches between the words and this post
- if (sizeof($unique_add_words))
- {
- $sql = 'SELECT word_id, word_text
- FROM ' . SEARCH_WORDLIST_TABLE . '
- WHERE ' . $db->sql_in_set('word_text', $unique_add_words);
- $result = $db->sql_query($sql);
-
- $word_ids = array();
- while ($row = $db->sql_fetchrow($result))
- {
- $word_ids[$row['word_text']] = $row['word_id'];
- }
- $db->sql_freeresult($result);
- $new_words = array_diff($unique_add_words, array_keys($word_ids));
-
- $db->sql_transaction('begin');
- if (sizeof($new_words))
- {
- $sql_ary = array();
-
- foreach ($new_words as $word)
- {
- $sql_ary[] = array('word_text' => (string) $word, 'word_count' => 0);
- }
- $db->sql_return_on_error(true);
- $db->sql_multi_insert(SEARCH_WORDLIST_TABLE, $sql_ary);
- $db->sql_return_on_error(false);
- }
- unset($new_words, $sql_ary);
- }
- else
- {
- $db->sql_transaction('begin');
- }
-
- // now update the search match table, remove links to removed words and add links to new words
- foreach ($words['del'] as $word_in => $word_ary)
- {
- $title_match = ($word_in == 'title') ? 1 : 0;
-
- if (sizeof($word_ary))
- {
- $sql_in = array();
- foreach ($word_ary as $word)
- {
- $sql_in[] = $cur_words[$word_in][$word];
- }
-
- $sql = 'DELETE FROM ' . SEARCH_WORDMATCH_TABLE . '
- WHERE ' . $db->sql_in_set('word_id', $sql_in) . '
- AND post_id = ' . intval($post_id) . "
- AND title_match = $title_match";
- $db->sql_query($sql);
-
- $sql = 'UPDATE ' . SEARCH_WORDLIST_TABLE . '
- SET word_count = word_count - 1
- WHERE ' . $db->sql_in_set('word_id', $sql_in) . '
- AND word_count > 0';
- $db->sql_query($sql);
-
- unset($sql_in);
- }
- }
-
- $db->sql_return_on_error(true);
- foreach ($words['add'] as $word_in => $word_ary)
- {
- $title_match = ($word_in == 'title') ? 1 : 0;
-
- if (sizeof($word_ary))
- {
- $sql = 'INSERT INTO ' . SEARCH_WORDMATCH_TABLE . ' (post_id, word_id, title_match)
- SELECT ' . (int) $post_id . ', word_id, ' . (int) $title_match . '
- FROM ' . SEARCH_WORDLIST_TABLE . '
- WHERE ' . $db->sql_in_set('word_text', $word_ary);
- $db->sql_query($sql);
-
- $sql = 'UPDATE ' . SEARCH_WORDLIST_TABLE . '
- SET word_count = word_count + 1
- WHERE ' . $db->sql_in_set('word_text', $word_ary);
- $db->sql_query($sql);
- }
- }
- $db->sql_return_on_error(false);
-
- $db->sql_transaction('commit');
-
- // destroy cached search results containing any of the words removed or added
- $this->destroy_cache(array_unique(array_merge($words['add']['post'], $words['add']['title'], $words['del']['post'], $words['del']['title'])), array($poster_id));
-
- unset($unique_add_words);
- unset($words);
- unset($cur_words);
- }
-
- /**
- * Removes entries from the wordmatch table for the specified post_ids
- */
- function index_remove($post_ids, $author_ids, $forum_ids)
- {
- global $db;
-
- if (sizeof($post_ids))
- {
- $sql = 'SELECT w.word_id, w.word_text, m.title_match
- FROM ' . SEARCH_WORDMATCH_TABLE . ' m, ' . SEARCH_WORDLIST_TABLE . ' w
- WHERE ' . $db->sql_in_set('m.post_id', $post_ids) . '
- AND w.word_id = m.word_id';
- $result = $db->sql_query($sql);
-
- $message_word_ids = $title_word_ids = $word_texts = array();
- while ($row = $db->sql_fetchrow($result))
- {
- if ($row['title_match'])
- {
- $title_word_ids[] = $row['word_id'];
- }
- else
- {
- $message_word_ids[] = $row['word_id'];
- }
- $word_texts[] = $row['word_text'];
- }
- $db->sql_freeresult($result);
-
- if (sizeof($title_word_ids))
- {
- $sql = 'UPDATE ' . SEARCH_WORDLIST_TABLE . '
- SET word_count = word_count - 1
- WHERE ' . $db->sql_in_set('word_id', $title_word_ids) . '
- AND word_count > 0';
- $db->sql_query($sql);
- }
-
- if (sizeof($message_word_ids))
- {
- $sql = 'UPDATE ' . SEARCH_WORDLIST_TABLE . '
- SET word_count = word_count - 1
- WHERE ' . $db->sql_in_set('word_id', $message_word_ids) . '
- AND word_count > 0';
- $db->sql_query($sql);
- }
-
- unset($title_word_ids);
- unset($message_word_ids);
-
- $sql = 'DELETE FROM ' . SEARCH_WORDMATCH_TABLE . '
- WHERE ' . $db->sql_in_set('post_id', $post_ids);
- $db->sql_query($sql);
- }
-
- $this->destroy_cache(array_unique($word_texts), array_unique($author_ids));
- }
-
- /**
- * Tidy up indexes: Tag 'common words' and remove
- * words no longer referenced in the match table
- */
- function tidy()
- {
- global $db, $config;
-
- // Is the fulltext indexer disabled? If yes then we need not
- // carry on ... it's okay ... I know when I'm not wanted boo hoo
- if (!$config['fulltext_native_load_upd'])
- {
- set_config('search_last_gc', time(), true);
- return;
- }
-
- $destroy_cache_words = array();
-
- // Remove common words
- if ($config['num_posts'] >= 100 && $config['fulltext_native_common_thres'])
- {
- $common_threshold = ((double) $config['fulltext_native_common_thres']) / 100.0;
- // First, get the IDs of common words
- $sql = 'SELECT word_id, word_text
- FROM ' . SEARCH_WORDLIST_TABLE . '
- WHERE word_count > ' . floor($config['num_posts'] * $common_threshold) . '
- OR word_common = 1';
- $result = $db->sql_query($sql);
-
- $sql_in = array();
- while ($row = $db->sql_fetchrow($result))
- {
- $sql_in[] = $row['word_id'];
- $destroy_cache_words[] = $row['word_text'];
- }
- $db->sql_freeresult($result);
-
- if (sizeof($sql_in))
- {
- // Flag the words
- $sql = 'UPDATE ' . SEARCH_WORDLIST_TABLE . '
- SET word_common = 1
- WHERE ' . $db->sql_in_set('word_id', $sql_in);
- $db->sql_query($sql);
-
- // by setting search_last_gc to the new time here we make sure that if a user reloads because the
- // following query takes too long, he won't run into it again
- set_config('search_last_gc', time(), true);
-
- // Delete the matches
- $sql = 'DELETE FROM ' . SEARCH_WORDMATCH_TABLE . '
- WHERE ' . $db->sql_in_set('word_id', $sql_in);
- $db->sql_query($sql);
- }
- unset($sql_in);
- }
-
- if (sizeof($destroy_cache_words))
- {
- // destroy cached search results containing any of the words that are now common or were removed
- $this->destroy_cache(array_unique($destroy_cache_words));
- }
-
- set_config('search_last_gc', time(), true);
- }
-
- /**
- * Deletes all words from the index
- */
- function delete_index($acp_module, $u_action)
- {
- global $db;
-
- switch ($db->sql_layer)
- {
- case 'sqlite':
- case 'firebird':
- $db->sql_query('DELETE FROM ' . SEARCH_WORDLIST_TABLE);
- $db->sql_query('DELETE FROM ' . SEARCH_WORDMATCH_TABLE);
- $db->sql_query('DELETE FROM ' . SEARCH_RESULTS_TABLE);
- break;
-
- default:
- $db->sql_query('TRUNCATE TABLE ' . SEARCH_WORDLIST_TABLE);
- $db->sql_query('TRUNCATE TABLE ' . SEARCH_WORDMATCH_TABLE);
- $db->sql_query('TRUNCATE TABLE ' . SEARCH_RESULTS_TABLE);
- break;
- }
- }
-
- /**
- * Returns true if both FULLTEXT indexes exist
- */
- function index_created()
- {
- if (!sizeof($this->stats))
- {
- $this->get_stats();
- }
-
- return ($this->stats['total_words'] && $this->stats['total_matches']) ? true : false;
- }
-
- /**
- * Returns an associative array containing information about the indexes
- */
- function index_stats()
- {
- global $user;
-
- if (!sizeof($this->stats))
- {
- $this->get_stats();
- }
-
- return array(
- $user->lang['TOTAL_WORDS'] => $this->stats['total_words'],
- $user->lang['TOTAL_MATCHES'] => $this->stats['total_matches']);
- }
-
- function get_stats()
- {
- global $db;
-
- $this->stats['total_words'] = $db->get_estimated_row_count(SEARCH_WORDLIST_TABLE);
- $this->stats['total_matches'] = $db->get_estimated_row_count(SEARCH_WORDMATCH_TABLE);
- }
-
- /**
- * Clean up a text to remove non-alphanumeric characters
- *
- * This method receives a UTF-8 string, normalizes and validates it, replaces all
- * non-alphanumeric characters with strings then returns the result.
- *
- * Any number of "allowed chars" can be passed as a UTF-8 string in NFC.
- *
- * @param string $text Text to split, in UTF-8 (not normalized or sanitized)
- * @param string $allowed_chars String of special chars to allow
- * @param string $encoding Text encoding
- * @return string Cleaned up text, only alphanumeric chars are left
- *
- * @todo normalizer::cleanup being able to be used?
- */
- function cleanup($text, $allowed_chars = null, $encoding = 'utf-8')
- {
- global $phpbb_root_path, $phpEx;
- static $conv = array(), $conv_loaded = array();
- $words = $allow = array();
-
- // Convert the text to UTF-8
- $encoding = strtolower($encoding);
- if ($encoding != 'utf-8')
- {
- $text = utf8_recode($text, $encoding);
- }
-
- $utf_len_mask = array(
- "\xC0" => 2,
- "\xD0" => 2,
- "\xE0" => 3,
- "\xF0" => 4
- );
-
- /**
- * Replace HTML entities and NCRs
- */
- $text = htmlspecialchars_decode(utf8_decode_ncr($text), ENT_QUOTES);
-
- /**
- * Load the UTF-8 normalizer
- *
- * If we use it more widely, an instance of that class should be held in a
- * a global variable instead
- */
- utf_normalizer::nfc($text);
-
- /**
- * The first thing we do is:
- *
- * - convert ASCII-7 letters to lowercase
- * - remove the ASCII-7 non-alpha characters
- * - remove the bytes that should not appear in a valid UTF-8 string: 0xC0,
- * 0xC1 and 0xF5-0xFF
- *
- * @todo in theory, the third one is already taken care of during normalization and those chars should have been replaced by Unicode replacement chars
- */
- $sb_match = "ISTCPAMELRDOJBNHFGVWUQKYXZ\r\n\t!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~\x00\x01\x02\x03\x04\x05\x06\x07\x08\x0B\x0C\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F\xC0\xC1\xF5\xF6\xF7\xF8\xF9\xFA\xFB\xFC\xFD\xFE\xFF";
- $sb_replace = 'istcpamelrdojbnhfgvwuqkyxz ';
-
- /**
- * This is the list of legal ASCII chars, it is automatically extended
- * with ASCII chars from $allowed_chars
- */
- $legal_ascii = ' eaisntroludcpmghbfvq10xy2j9kw354867z';
-
- /**
- * Prepare an array containing the extra chars to allow
- */
- if (isset($allowed_chars[0]))
- {
- $pos = 0;
- $len = strlen($allowed_chars);
- do
- {
- $c = $allowed_chars[$pos];
-
- if ($c < "\x80")
- {
- /**
- * ASCII char
- */
- $sb_pos = strpos($sb_match, $c);
- if (is_int($sb_pos))
- {
- /**
- * Remove the char from $sb_match and its corresponding
- * replacement in $sb_replace
- */
- $sb_match = substr($sb_match, 0, $sb_pos) . substr($sb_match, $sb_pos + 1);
- $sb_replace = substr($sb_replace, 0, $sb_pos) . substr($sb_replace, $sb_pos + 1);
- $legal_ascii .= $c;
- }
-
- ++$pos;
- }
- else
- {
- /**
- * UTF-8 char
- */
- $utf_len = $utf_len_mask[$c & "\xF0"];
- $allow[substr($allowed_chars, $pos, $utf_len)] = 1;
- $pos += $utf_len;
- }
- }
- while ($pos < $len);
- }
-
- $text = strtr($text, $sb_match, $sb_replace);
- $ret = '';
-
- $pos = 0;
- $len = strlen($text);
-
- do
- {
- /**
- * Do all consecutive ASCII chars at once
- */
- if ($spn = strspn($text, $legal_ascii, $pos))
- {
- $ret .= substr($text, $pos, $spn);
- $pos += $spn;
- }
-
- if ($pos >= $len)
- {
- return $ret;
- }
-
- /**
- * Capture the UTF char
- */
- $utf_len = $utf_len_mask[$text[$pos] & "\xF0"];
- $utf_char = substr($text, $pos, $utf_len);
- $pos += $utf_len;
-
- if (($utf_char >= UTF8_HANGUL_FIRST && $utf_char <= UTF8_HANGUL_LAST)
- || ($utf_char >= UTF8_CJK_FIRST && $utf_char <= UTF8_CJK_LAST)
- || ($utf_char >= UTF8_CJK_B_FIRST && $utf_char <= UTF8_CJK_B_LAST))
- {
- /**
- * All characters within these ranges are valid
- *
- * We separate them with a space in order to index each character
- * individually
- */
- $ret .= ' ' . $utf_char . ' ';
- continue;
- }
-
- if (isset($allow[$utf_char]))
- {
- /**
- * The char is explicitly allowed
- */
- $ret .= $utf_char;
- continue;
- }
-
- if (isset($conv[$utf_char]))
- {
- /**
- * The char is mapped to something, maybe to itself actually
- */
- $ret .= $conv[$utf_char];
- continue;
- }
-
- /**
- * The char isn't mapped, but did we load its conversion table?
- *
- * The search indexer table is split into blocks. The block number of
- * each char is equal to its codepoint right-shifted for 11 bits. It
- * means that out of the 11, 16 or 21 meaningful bits of a 2-, 3- or
- * 4- byte sequence we only keep the leftmost 0, 5 or 10 bits. Thus,
- * all UTF chars encoded in 2 bytes are in the same first block.
- */
- if (isset($utf_char[2]))
- {
- if (isset($utf_char[3]))
- {
- /**
- * 1111 0nnn 10nn nnnn 10nx xxxx 10xx xxxx
- * 0000 0111 0011 1111 0010 0000
- */
- $idx = ((ord($utf_char[0]) & 0x07) << 7) | ((ord($utf_char[1]) & 0x3F) << 1) | ((ord($utf_char[2]) & 0x20) >> 5);
- }
- else
- {
- /**
- * 1110 nnnn 10nx xxxx 10xx xxxx
- * 0000 0111 0010 0000
- */
- $idx = ((ord($utf_char[0]) & 0x07) << 1) | ((ord($utf_char[1]) & 0x20) >> 5);
- }
- }
- else
- {
- /**
- * 110x xxxx 10xx xxxx
- * 0000 0000 0000 0000
- */
- $idx = 0;
- }
-
- /**
- * Check if the required conv table has been loaded already
- */
- if (!isset($conv_loaded[$idx]))
- {
- $conv_loaded[$idx] = 1;
- $file = $phpbb_root_path . 'includes/utf/data/search_indexer_' . $idx . '.' . $phpEx;
-
- if (file_exists($file))
- {
- $conv += include($file);
- }
- }
-
- if (isset($conv[$utf_char]))
- {
- $ret .= $conv[$utf_char];
- }
- else
- {
- /**
- * We add an entry to the conversion table so that we
- * don't have to convert to codepoint and perform the checks
- * that are above this block
- */
- $conv[$utf_char] = ' ';
- $ret .= ' ';
- }
- }
- while (1);
-
- return $ret;
- }
-
- /**
- * Returns a list of options for the ACP to display
- */
- function acp()
- {
- global $user, $config;
-
-
- /**
- * if we need any options, copied from fulltext_native for now, will have to be adjusted or removed
- */
-
- $tpl = '
- <dl>
- <dt><label for="fulltext_native_load_upd">' . $user->lang['YES_SEARCH_UPDATE'] . ':</label><br /><span>' . $user->lang['YES_SEARCH_UPDATE_EXPLAIN'] . '</span></dt>
- <dd><label><input type="radio" id="fulltext_native_load_upd" name="config[fulltext_native_load_upd]" value="1"' . (($config['fulltext_native_load_upd']) ? ' checked="checked"' : '') . ' class="radio" /> ' . $user->lang['YES'] . '</label><label><input type="radio" name="config[fulltext_native_load_upd]" value="0"' . ((!$config['fulltext_native_load_upd']) ? ' checked="checked"' : '') . ' class="radio" /> ' . $user->lang['NO'] . '</label></dd>
- </dl>
- <dl>
- <dt><label for="fulltext_native_min_chars">' . $user->lang['MIN_SEARCH_CHARS'] . ':</label><br /><span>' . $user->lang['MIN_SEARCH_CHARS_EXPLAIN'] . '</span></dt>
- <dd><input id="fulltext_native_min_chars" type="text" size="3" maxlength="3" name="config[fulltext_native_min_chars]" value="' . (int) $config['fulltext_native_min_chars'] . '" /></dd>
- </dl>
- <dl>
- <dt><label for="fulltext_native_max_chars">' . $user->lang['MAX_SEARCH_CHARS'] . ':</label><br /><span>' . $user->lang['MAX_SEARCH_CHARS_EXPLAIN'] . '</span></dt>
- <dd><input id="fulltext_native_max_chars" type="text" size="3" maxlength="3" name="config[fulltext_native_max_chars]" value="' . (int) $config['fulltext_native_max_chars'] . '" /></dd>
- </dl>
- <dl>
- <dt><label for="fulltext_native_common_thres">' . $user->lang['COMMON_WORD_THRESHOLD'] . ':</label><br /><span>' . $user->lang['COMMON_WORD_THRESHOLD_EXPLAIN'] . '</span></dt>
- <dd><input id="fulltext_native_common_thres" type="text" size="3" maxlength="3" name="config[fulltext_native_common_thres]" value="' . (double) $config['fulltext_native_common_thres'] . '" /> %</dd>
- </dl>
- ';
-
- // These are fields required in the config table
- return array(
- 'tpl' => $tpl,
- 'config' => array('fulltext_native_load_upd' => 'bool', 'fulltext_native_min_chars' => 'integer:0:255', 'fulltext_native_max_chars' => 'integer:0:255', 'fulltext_native_common_thres' => 'double:0:100')
- );
- }
-}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/search/search.php b/phpBB/includes/search/search.php
deleted file mode 100644
index df7c8a0892..0000000000
--- a/phpBB/includes/search/search.php
+++ /dev/null
@@ -1,320 +0,0 @@
-<?php
-/**
-*
-* @package search
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
-*
-*/
-
-/**
-* @ignore
-*/
-if (!defined('IN_PHPBB'))
-{
- exit;
-}
-
-/**
-* @ignore
-*/
-define('SEARCH_RESULT_NOT_IN_CACHE', 0);
-define('SEARCH_RESULT_IN_CACHE', 1);
-define('SEARCH_RESULT_INCOMPLETE', 2);
-
-/**
-* search_backend
-* optional base class for search plugins providing simple caching based on ACM
-* and functions to retrieve ignore_words and synonyms
-* @package search
-*/
-class search_backend
-{
- var $ignore_words = array();
- var $match_synonym = array();
- var $replace_synonym = array();
-
- function search_backend(&$error)
- {
- // This class cannot be used as a search plugin
- $error = true;
- }
-
- /**
- * Retrieves a language dependend list of words that should be ignored by the search
- */
- function get_ignore_words()
- {
- if (!sizeof($this->ignore_words))
- {
- global $user, $phpEx;
-
- $words = array();
-
- if (file_exists("{$user->lang_path}{$user->lang_name}/search_ignore_words.$phpEx"))
- {
- // include the file containing ignore words
- include("{$user->lang_path}{$user->lang_name}/search_ignore_words.$phpEx");
- }
-
- $this->ignore_words = $words;
- unset($words);
- }
- }
-
- /**
- * Stores a list of synonyms that should be replaced in $this->match_synonym and $this->replace_synonym and caches them
- */
- function get_synonyms()
- {
- if (!sizeof($this->match_synonym))
- {
- global $user, $phpEx;
-
- $synonyms = array();
-
- if (file_exists("{$user->lang_path}{$user->lang_name}/search_synonyms.$phpEx"))
- {
- // include the file containing synonyms
- include("{$user->lang_path}{$user->lang_name}/search_synonyms.$phpEx");
- }
-
- $this->match_synonym = array_keys($synonyms);
- $this->replace_synonym = array_values($synonyms);
-
- unset($synonyms);
- }
- }
-
- /**
- * Retrieves cached search results
- *
- * @param int &$result_count will contain the number of all results for the search (not only for the current page)
- * @param array &$id_ary is filled with the ids belonging to the requested page that are stored in the cache
- *
- * @return int SEARCH_RESULT_NOT_IN_CACHE or SEARCH_RESULT_IN_CACHE or SEARCH_RESULT_INCOMPLETE
- */
- function obtain_ids($search_key, &$result_count, &$id_ary, $start, $per_page, $sort_dir)
- {
- global $cache;
-
- if (!($stored_ids = $cache->get('_search_results_' . $search_key)))
- {
- // no search results cached for this search_key
- return SEARCH_RESULT_NOT_IN_CACHE;
- }
- else
- {
- $result_count = $stored_ids[-1];
- $reverse_ids = ($stored_ids[-2] != $sort_dir) ? true : false;
- $complete = true;
-
- // change the start to the actual end of the current request if the sort direction differs
- // from the dirction in the cache and reverse the ids later
- if ($reverse_ids)
- {
- $start = $result_count - $start - $per_page;
-
- // the user requested a page past the last index
- if ($start < 0)
- {
- return SEARCH_RESULT_NOT_IN_CACHE;
- }
- }
-
- for ($i = $start, $n = $start + $per_page; ($i < $n) && ($i < $result_count); $i++)
- {
- if (!isset($stored_ids[$i]))
- {
- $complete = false;
- }
- else
- {
- $id_ary[] = $stored_ids[$i];
- }
- }
- unset($stored_ids);
-
- if ($reverse_ids)
- {
- $id_ary = array_reverse($id_ary);
- }
-
- if (!$complete)
- {
- return SEARCH_RESULT_INCOMPLETE;
- }
- return SEARCH_RESULT_IN_CACHE;
- }
- }
-
- /**
- * Caches post/topic ids
- *
- * @param array &$id_ary contains a list of post or topic ids that shall be cached, the first element
- * must have the absolute index $start in the result set.
- */
- function save_ids($search_key, $keywords, $author_ary, $result_count, &$id_ary, $start, $sort_dir)
- {
- global $cache, $config, $db, $user;
-
- $length = min(sizeof($id_ary), $config['search_block_size']);
-
- // nothing to cache so exit
- if (!$length)
- {
- return;
- }
-
- $store_ids = array_slice($id_ary, 0, $length);
-
- // create a new resultset if there is none for this search_key yet
- // or add the ids to the existing resultset
- if (!($store = $cache->get('_search_results_' . $search_key)))
- {
- // add the current keywords to the recent searches in the cache which are listed on the search page
- if (!empty($keywords) || sizeof($author_ary))
- {
- $sql = 'SELECT search_time
- FROM ' . SEARCH_RESULTS_TABLE . '
- WHERE search_key = \'' . $db->sql_escape($search_key) . '\'';
- $result = $db->sql_query($sql);
-
- if (!$db->sql_fetchrow($result))
- {
- $sql_ary = array(
- 'search_key' => $search_key,
- 'search_time' => time(),
- 'search_keywords' => $keywords,
- 'search_authors' => ' ' . implode(' ', $author_ary) . ' '
- );
-
- $sql = 'INSERT INTO ' . SEARCH_RESULTS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary);
- $db->sql_query($sql);
- }
- $db->sql_freeresult($result);
- }
-
- $sql = 'UPDATE ' . USERS_TABLE . '
- SET user_last_search = ' . time() . '
- WHERE user_id = ' . $user->data['user_id'];
- $db->sql_query($sql);
-
- $store = array(-1 => $result_count, -2 => $sort_dir);
- $id_range = range($start, $start + $length - 1);
- }
- else
- {
- // we use one set of results for both sort directions so we have to calculate the indizes
- // for the reversed array and we also have to reverse the ids themselves
- if ($store[-2] != $sort_dir)
- {
- $store_ids = array_reverse($store_ids);
- $id_range = range($store[-1] - $start - $length, $store[-1] - $start - 1);
- }
- else
- {
- $id_range = range($start, $start + $length - 1);
- }
- }
-
- $store_ids = array_combine($id_range, $store_ids);
-
- // append the ids
- if (is_array($store_ids))
- {
- $store += $store_ids;
-
- // if the cache is too big
- if (sizeof($store) - 2 > 20 * $config['search_block_size'])
- {
- // remove everything in front of two blocks in front of the current start index
- for ($i = 0, $n = $id_range[0] - 2 * $config['search_block_size']; $i < $n; $i++)
- {
- if (isset($store[$i]))
- {
- unset($store[$i]);
- }
- }
-
- // remove everything after two blocks after the current stop index
- end($id_range);
- for ($i = $store[-1] - 1, $n = current($id_range) + 2 * $config['search_block_size']; $i > $n; $i--)
- {
- if (isset($store[$i]))
- {
- unset($store[$i]);
- }
- }
- }
- $cache->put('_search_results_' . $search_key, $store, $config['search_store_results']);
-
- $sql = 'UPDATE ' . SEARCH_RESULTS_TABLE . '
- SET search_time = ' . time() . '
- WHERE search_key = \'' . $db->sql_escape($search_key) . '\'';
- $db->sql_query($sql);
- }
-
- unset($store);
- unset($store_ids);
- unset($id_range);
- }
-
- /**
- * Removes old entries from the search results table and removes searches with keywords that contain a word in $words.
- */
- function destroy_cache($words, $authors = false)
- {
- global $db, $cache, $config;
-
- // clear all searches that searched for the specified words
- if (sizeof($words))
- {
- $sql_where = '';
- foreach ($words as $word)
- {
- $sql_where .= " OR search_keywords " . $db->sql_like_expression($db->any_char . $word . $db->any_char);
- }
-
- $sql = 'SELECT search_key
- FROM ' . SEARCH_RESULTS_TABLE . "
- WHERE search_keywords LIKE '%*%' $sql_where";
- $result = $db->sql_query($sql);
-
- while ($row = $db->sql_fetchrow($result))
- {
- $cache->destroy('_search_results_' . $row['search_key']);
- }
- $db->sql_freeresult($result);
- }
-
- // clear all searches that searched for the specified authors
- if (is_array($authors) && sizeof($authors))
- {
- $sql_where = '';
- foreach ($authors as $author)
- {
- $sql_where .= (($sql_where) ? ' OR ' : '') . 'search_authors ' . $db->sql_like_expression($db->any_char . ' ' . (int) $author . ' ' . $db->any_char);
- }
-
- $sql = 'SELECT search_key
- FROM ' . SEARCH_RESULTS_TABLE . "
- WHERE $sql_where";
- $result = $db->sql_query($sql);
-
- while ($row = $db->sql_fetchrow($result))
- {
- $cache->destroy('_search_results_' . $row['search_key']);
- }
- $db->sql_freeresult($result);
- }
-
- $sql = 'DELETE
- FROM ' . SEARCH_RESULTS_TABLE . '
- WHERE search_time < ' . (time() - $config['search_store_results']);
- $db->sql_query($sql);
- }
-}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/session.php b/phpBB/includes/session.php
deleted file mode 100644
index 04b15b17d3..0000000000
--- a/phpBB/includes/session.php
+++ /dev/null
@@ -1,2473 +0,0 @@
-<?php
-/**
-*
-* @package phpBB3
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
-*
-*/
-
-/**
-* @ignore
-*/
-if (!defined('IN_PHPBB'))
-{
- exit;
-}
-
-/**
-* Session class
-* @package phpBB3
-*/
-class session
-{
- var $cookie_data = array();
- var $page = array();
- var $data = array();
- var $browser = '';
- var $forwarded_for = '';
- var $host = '';
- var $session_id = '';
- var $ip = '';
- var $load = 0;
- var $time_now = 0;
- var $update_session_page = true;
-
- /**
- * Extract current session page
- *
- * @param string $root_path current root path (phpbb_root_path)
- */
- function extract_current_page($root_path)
- {
- $page_array = array();
-
- // First of all, get the request uri...
- $script_name = (!empty($_SERVER['PHP_SELF'])) ? $_SERVER['PHP_SELF'] : getenv('PHP_SELF');
- $args = (!empty($_SERVER['QUERY_STRING'])) ? explode('&', $_SERVER['QUERY_STRING']) : explode('&', getenv('QUERY_STRING'));
-
- // If we are unable to get the script name we use REQUEST_URI as a failover and note it within the page array for easier support...
- if (!$script_name)
- {
- $script_name = (!empty($_SERVER['REQUEST_URI'])) ? $_SERVER['REQUEST_URI'] : getenv('REQUEST_URI');
- $script_name = (($pos = strpos($script_name, '?')) !== false) ? substr($script_name, 0, $pos) : $script_name;
- $page_array['failover'] = 1;
- }
-
- // Replace backslashes and doubled slashes (could happen on some proxy setups)
- $script_name = str_replace(array('\\', '//'), '/', $script_name);
-
- // Now, remove the sid and let us get a clean query string...
- $use_args = array();
-
- // Since some browser do not encode correctly we need to do this with some "special" characters...
- // " -> %22, ' => %27, < -> %3C, > -> %3E
- $find = array('"', "'", '<', '>');
- $replace = array('%22', '%27', '%3C', '%3E');
-
- foreach ($args as $key => $argument)
- {
- if (strpos($argument, 'sid=') === 0)
- {
- continue;
- }
-
- $use_args[] = str_replace($find, $replace, $argument);
- }
- unset($args);
-
- // The following examples given are for an request uri of {path to the phpbb directory}/adm/index.php?i=10&b=2
-
- // The current query string
- $query_string = trim(implode('&', $use_args));
-
- // basenamed page name (for example: index.php)
- $page_name = (substr($script_name, -1, 1) == '/') ? '' : basename($script_name);
- $page_name = urlencode(htmlspecialchars($page_name));
-
- // current directory within the phpBB root (for example: adm)
- $root_dirs = explode('/', str_replace('\\', '/', phpbb_realpath($root_path)));
- $page_dirs = explode('/', str_replace('\\', '/', phpbb_realpath('./')));
- $intersection = array_intersect_assoc($root_dirs, $page_dirs);
-
- $root_dirs = array_diff_assoc($root_dirs, $intersection);
- $page_dirs = array_diff_assoc($page_dirs, $intersection);
-
- $page_dir = str_repeat('../', sizeof($root_dirs)) . implode('/', $page_dirs);
-
- if ($page_dir && substr($page_dir, -1, 1) == '/')
- {
- $page_dir = substr($page_dir, 0, -1);
- }
-
- // Current page from phpBB root (for example: adm/index.php?i=10&b=2)
- $page = (($page_dir) ? $page_dir . '/' : '') . $page_name . (($query_string) ? "?$query_string" : '');
-
- // The script path from the webroot to the current directory (for example: /phpBB3/adm/) : always prefixed with / and ends in /
- $script_path = trim(str_replace('\\', '/', dirname($script_name)));
-
- // The script path from the webroot to the phpBB root (for example: /phpBB3/)
- $script_dirs = explode('/', $script_path);
- array_splice($script_dirs, -sizeof($page_dirs));
- $root_script_path = implode('/', $script_dirs) . (sizeof($root_dirs) ? '/' . implode('/', $root_dirs) : '');
-
- // We are on the base level (phpBB root == webroot), lets adjust the variables a bit...
- if (!$root_script_path)
- {
- $root_script_path = ($page_dir) ? str_replace($page_dir, '', $script_path) : $script_path;
- }
-
- $script_path .= (substr($script_path, -1, 1) == '/') ? '' : '/';
- $root_script_path .= (substr($root_script_path, -1, 1) == '/') ? '' : '/';
-
- $forum_id = (isset($_REQUEST['f']) && $_REQUEST['f'] > 0 && $_REQUEST['f'] < 16777215) ? (int) $_REQUEST['f'] : 0;
-
- $page_array += array(
- 'page_name' => $page_name,
- 'page_dir' => $page_dir,
-
- 'query_string' => $query_string,
- 'script_path' => str_replace(' ', '%20', htmlspecialchars($script_path)),
- 'root_script_path' => str_replace(' ', '%20', htmlspecialchars($root_script_path)),
-
- 'page' => $page,
- 'forum' => $forum_id,
- );
-
- return $page_array;
- }
-
- /**
- * Get valid hostname/port. HTTP_HOST is used, SERVER_NAME if HTTP_HOST not present.
- */
- function extract_current_hostname()
- {
- global $config;
-
- // Get hostname
- $host = (!empty($_SERVER['HTTP_HOST'])) ? $_SERVER['HTTP_HOST'] : ((!empty($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : getenv('SERVER_NAME'));
-
- // Should be a string and lowered
- $host = (string) strtolower($host);
-
- // If host is equal the cookie domain or the server name (if config is set), then we assume it is valid
- if ((isset($config['cookie_domain']) && $host === $config['cookie_domain']) || (isset($config['server_name']) && $host === $config['server_name']))
- {
- return $host;
- }
-
- // Is the host actually a IP? If so, we use the IP... (IPv4)
- if (long2ip(ip2long($host)) === $host)
- {
- return $host;
- }
-
- // Now return the hostname (this also removes any port definition). The http:// is prepended to construct a valid URL, hosts never have a scheme assigned
- $host = @parse_url('http://' . $host);
- $host = (!empty($host['host'])) ? $host['host'] : '';
-
- // Remove any portions not removed by parse_url (#)
- $host = str_replace('#', '', $host);
-
- // If, by any means, the host is now empty, we will use a "best approach" way to guess one
- if (empty($host))
- {
- if (!empty($config['server_name']))
- {
- $host = $config['server_name'];
- }
- else if (!empty($config['cookie_domain']))
- {
- $host = (strpos($config['cookie_domain'], '.') === 0) ? substr($config['cookie_domain'], 1) : $config['cookie_domain'];
- }
- else
- {
- // Set to OS hostname or localhost
- $host = (function_exists('php_uname')) ? php_uname('n') : 'localhost';
- }
- }
-
- // It may be still no valid host, but for sure only a hostname (we may further expand on the cookie domain... if set)
- return $host;
- }
-
- /**
- * Start session management
- *
- * This is where all session activity begins. We gather various pieces of
- * information from the client and server. We test to see if a session already
- * exists. If it does, fine and dandy. If it doesn't we'll go on to create a
- * new one ... pretty logical heh? We also examine the system load (if we're
- * running on a system which makes such information readily available) and
- * halt if it's above an admin definable limit.
- *
- * @param bool $update_session_page if true the session page gets updated.
- * This can be set to circumvent certain scripts to update the users last visited page.
- */
- function session_begin($update_session_page = true)
- {
- global $phpEx, $SID, $_SID, $_EXTRA_URL, $db, $config, $phpbb_root_path;
-
- // Give us some basic information
- $this->time_now = time();
- $this->cookie_data = array('u' => 0, 'k' => '');
- $this->update_session_page = $update_session_page;
- $this->browser = (!empty($_SERVER['HTTP_USER_AGENT'])) ? htmlspecialchars((string) $_SERVER['HTTP_USER_AGENT']) : '';
- $this->referer = (!empty($_SERVER['HTTP_REFERER'])) ? htmlspecialchars((string) $_SERVER['HTTP_REFERER']) : '';
- $this->forwarded_for = (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) ? htmlspecialchars((string) $_SERVER['HTTP_X_FORWARDED_FOR']) : '';
-
- $this->host = $this->extract_current_hostname();
- $this->page = $this->extract_current_page($phpbb_root_path);
-
- // if the forwarded for header shall be checked we have to validate its contents
- if ($config['forwarded_for_check'])
- {
- $this->forwarded_for = preg_replace('# {2,}#', ' ', str_replace(',', ' ', $this->forwarded_for));
-
- // split the list of IPs
- $ips = explode(' ', $this->forwarded_for);
- foreach ($ips as $ip)
- {
- // check IPv4 first, the IPv6 is hopefully only going to be used very seldomly
- if (!empty($ip) && !preg_match(get_preg_expression('ipv4'), $ip) && !preg_match(get_preg_expression('ipv6'), $ip))
- {
- // contains invalid data, don't use the forwarded for header
- $this->forwarded_for = '';
- break;
- }
- }
- }
- else
- {
- $this->forwarded_for = '';
- }
-
- if (isset($_COOKIE[$config['cookie_name'] . '_sid']) || isset($_COOKIE[$config['cookie_name'] . '_u']))
- {
- $this->cookie_data['u'] = request_var($config['cookie_name'] . '_u', 0, false, true);
- $this->cookie_data['k'] = request_var($config['cookie_name'] . '_k', '', false, true);
- $this->session_id = request_var($config['cookie_name'] . '_sid', '', false, true);
-
- $SID = (defined('NEED_SID')) ? '?sid=' . $this->session_id : '?sid=';
- $_SID = (defined('NEED_SID')) ? $this->session_id : '';
-
- if (empty($this->session_id))
- {
- $this->session_id = $_SID = request_var('sid', '');
- $SID = '?sid=' . $this->session_id;
- $this->cookie_data = array('u' => 0, 'k' => '');
- }
- }
- else
- {
- $this->session_id = $_SID = request_var('sid', '');
- $SID = '?sid=' . $this->session_id;
- }
-
- $_EXTRA_URL = array();
-
- // Why no forwarded_for et al? Well, too easily spoofed. With the results of my recent requests
- // it's pretty clear that in the majority of cases you'll at least be left with a proxy/cache ip.
- $this->ip = (!empty($_SERVER['REMOTE_ADDR'])) ? (string) $_SERVER['REMOTE_ADDR'] : '';
- $this->ip = preg_replace('# {2,}#', ' ', str_replace(',', ' ', $this->ip));
-
- // split the list of IPs
- $ips = explode(' ', trim($this->ip));
-
- // Default IP if REMOTE_ADDR is invalid
- $this->ip = '127.0.0.1';
-
- foreach ($ips as $ip)
- {
- if (preg_match(get_preg_expression('ipv4'), $ip))
- {
- $this->ip = $ip;
- }
- else if (preg_match(get_preg_expression('ipv6'), $ip))
- {
- // Quick check for IPv4-mapped address in IPv6
- if (stripos($ip, '::ffff:') === 0)
- {
- $ipv4 = substr($ip, 7);
-
- if (preg_match(get_preg_expression('ipv4'), $ipv4))
- {
- $ip = $ipv4;
- }
- }
-
- $this->ip = $ip;
- }
- else
- {
- // We want to use the last valid address in the chain
- // Leave foreach loop when address is invalid
- break;
- }
- }
-
- $this->load = false;
-
- // Load limit check (if applicable)
- if ($config['limit_load'] || $config['limit_search_load'])
- {
- if ((function_exists('sys_getloadavg') && $load = sys_getloadavg()) || ($load = explode(' ', @file_get_contents('/proc/loadavg'))))
- {
- $this->load = array_slice($load, 0, 1);
- $this->load = floatval($this->load[0]);
- }
- else
- {
- set_config('limit_load', '0');
- set_config('limit_search_load', '0');
- }
- }
-
- // if no session id is set, redirect to index.php
- if (defined('NEED_SID') && (!isset($_GET['sid']) || $this->session_id !== $_GET['sid']))
- {
- send_status_line(401, 'Unauthorized');
- redirect(append_sid("{$phpbb_root_path}index.$phpEx"));
- }
-
- // if session id is set
- if (!empty($this->session_id))
- {
- $sql = 'SELECT u.*, s.*
- FROM ' . SESSIONS_TABLE . ' s, ' . USERS_TABLE . " u
- WHERE s.session_id = '" . $db->sql_escape($this->session_id) . "'
- AND u.user_id = s.session_user_id";
- $result = $db->sql_query($sql);
- $this->data = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
-
- // Did the session exist in the DB?
- if (isset($this->data['user_id']))
- {
- // Validate IP length according to admin ... enforces an IP
- // check on bots if admin requires this
-// $quadcheck = ($config['ip_check_bot'] && $this->data['user_type'] & USER_BOT) ? 4 : $config['ip_check'];
-
- if (strpos($this->ip, ':') !== false && strpos($this->data['session_ip'], ':') !== false)
- {
- $s_ip = short_ipv6($this->data['session_ip'], $config['ip_check']);
- $u_ip = short_ipv6($this->ip, $config['ip_check']);
- }
- else
- {
- $s_ip = implode('.', array_slice(explode('.', $this->data['session_ip']), 0, $config['ip_check']));
- $u_ip = implode('.', array_slice(explode('.', $this->ip), 0, $config['ip_check']));
- }
-
- $s_browser = ($config['browser_check']) ? trim(strtolower(substr($this->data['session_browser'], 0, 149))) : '';
- $u_browser = ($config['browser_check']) ? trim(strtolower(substr($this->browser, 0, 149))) : '';
-
- $s_forwarded_for = ($config['forwarded_for_check']) ? substr($this->data['session_forwarded_for'], 0, 254) : '';
- $u_forwarded_for = ($config['forwarded_for_check']) ? substr($this->forwarded_for, 0, 254) : '';
-
- // referer checks
- // The @ before $config['referer_validation'] suppresses notices present while running the updater
- $check_referer_path = (@$config['referer_validation'] == REFERER_VALIDATE_PATH);
- $referer_valid = true;
-
- // we assume HEAD and TRACE to be foul play and thus only whitelist GET
- if (@$config['referer_validation'] && isset($_SERVER['REQUEST_METHOD']) && strtolower($_SERVER['REQUEST_METHOD']) !== 'get')
- {
- $referer_valid = $this->validate_referer($check_referer_path);
- }
-
- if ($u_ip === $s_ip && $s_browser === $u_browser && $s_forwarded_for === $u_forwarded_for && $referer_valid)
- {
- $session_expired = false;
-
- // Check whether the session is still valid if we have one
- $method = basename(trim($config['auth_method']));
- include_once($phpbb_root_path . 'includes/auth/auth_' . $method . '.' . $phpEx);
-
- $method = 'validate_session_' . $method;
- if (function_exists($method))
- {
- if (!$method($this->data))
- {
- $session_expired = true;
- }
- }
-
- if (!$session_expired)
- {
- // Check the session length timeframe if autologin is not enabled.
- // Else check the autologin length... and also removing those having autologin enabled but no longer allowed board-wide.
- if (!$this->data['session_autologin'])
- {
- if ($this->data['session_time'] < $this->time_now - ($config['session_length'] + 60))
- {
- $session_expired = true;
- }
- }
- else if (!$config['allow_autologin'] || ($config['max_autologin_time'] && $this->data['session_time'] < $this->time_now - (86400 * (int) $config['max_autologin_time']) + 60))
- {
- $session_expired = true;
- }
- }
-
- if (!$session_expired)
- {
- // Only update session DB a minute or so after last update or if page changes
- if ($this->time_now - $this->data['session_time'] > 60 || ($this->update_session_page && $this->data['session_page'] != $this->page['page']))
- {
- $sql_ary = array('session_time' => $this->time_now);
-
- if ($this->update_session_page)
- {
- $sql_ary['session_page'] = substr($this->page['page'], 0, 199);
- $sql_ary['session_forum_id'] = $this->page['forum'];
- }
-
- $db->sql_return_on_error(true);
-
- $sql = 'UPDATE ' . SESSIONS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . "
- WHERE session_id = '" . $db->sql_escape($this->session_id) . "'";
- $result = $db->sql_query($sql);
-
- $db->sql_return_on_error(false);
-
- // If the database is not yet updated, there will be an error due to the session_forum_id
- // @todo REMOVE for 3.0.2
- if ($result === false)
- {
- unset($sql_ary['session_forum_id']);
-
- $sql = 'UPDATE ' . SESSIONS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . "
- WHERE session_id = '" . $db->sql_escape($this->session_id) . "'";
- $db->sql_query($sql);
- }
-
- if ($this->data['user_id'] != ANONYMOUS && !empty($config['new_member_post_limit']) && $this->data['user_new'] && $config['new_member_post_limit'] <= $this->data['user_posts'])
- {
- $this->leave_newly_registered();
- }
- }
-
- $this->data['is_registered'] = ($this->data['user_id'] != ANONYMOUS && ($this->data['user_type'] == USER_NORMAL || $this->data['user_type'] == USER_FOUNDER)) ? true : false;
- $this->data['is_bot'] = (!$this->data['is_registered'] && $this->data['user_id'] != ANONYMOUS) ? true : false;
- $this->data['user_lang'] = basename($this->data['user_lang']);
-
- return true;
- }
- }
- else
- {
- // Added logging temporarly to help debug bugs...
- if (defined('DEBUG_EXTRA') && $this->data['user_id'] != ANONYMOUS)
- {
- if ($referer_valid)
- {
- add_log('critical', 'LOG_IP_BROWSER_FORWARDED_CHECK', $u_ip, $s_ip, $u_browser, $s_browser, htmlspecialchars($u_forwarded_for), htmlspecialchars($s_forwarded_for));
- }
- else
- {
- add_log('critical', 'LOG_REFERER_INVALID', $this->referer);
- }
- }
- }
- }
- }
-
- // If we reach here then no (valid) session exists. So we'll create a new one
- return $this->session_create();
- }
-
- /**
- * Create a new session
- *
- * If upon trying to start a session we discover there is nothing existing we
- * jump here. Additionally this method is called directly during login to regenerate
- * the session for the specific user. In this method we carry out a number of tasks;
- * garbage collection, (search)bot checking, banned user comparison. Basically
- * though this method will result in a new session for a specific user.
- */
- function session_create($user_id = false, $set_admin = false, $persist_login = false, $viewonline = true)
- {
- global $SID, $_SID, $db, $config, $cache, $phpbb_root_path, $phpEx;
-
- $this->data = array();
-
- /* Garbage collection ... remove old sessions updating user information
- // if necessary. It means (potentially) 11 queries but only infrequently
- if ($this->time_now > $config['session_last_gc'] + $config['session_gc'])
- {
- $this->session_gc();
- }*/
-
- // Do we allow autologin on this board? No? Then override anything
- // that may be requested here
- if (!$config['allow_autologin'])
- {
- $this->cookie_data['k'] = $persist_login = false;
- }
-
- /**
- * Here we do a bot check, oh er saucy! No, not that kind of bot
- * check. We loop through the list of bots defined by the admin and
- * see if we have any useragent and/or IP matches. If we do, this is a
- * bot, act accordingly
- */
- $bot = false;
- $active_bots = $cache->obtain_bots();
-
- foreach ($active_bots as $row)
- {
- if ($row['bot_agent'] && preg_match('#' . str_replace('\*', '.*?', preg_quote($row['bot_agent'], '#')) . '#i', $this->browser))
- {
- $bot = $row['user_id'];
- }
-
- // If ip is supplied, we will make sure the ip is matching too...
- if ($row['bot_ip'] && ($bot || !$row['bot_agent']))
- {
- // Set bot to false, then we only have to set it to true if it is matching
- $bot = false;
-
- foreach (explode(',', $row['bot_ip']) as $bot_ip)
- {
- $bot_ip = trim($bot_ip);
-
- if (!$bot_ip)
- {
- continue;
- }
-
- if (strpos($this->ip, $bot_ip) === 0)
- {
- $bot = (int) $row['user_id'];
- break;
- }
- }
- }
-
- if ($bot)
- {
- break;
- }
- }
-
- $method = basename(trim($config['auth_method']));
- include_once($phpbb_root_path . 'includes/auth/auth_' . $method . '.' . $phpEx);
-
- $method = 'autologin_' . $method;
- if (function_exists($method))
- {
- $user_data = $method();
-
- if ($user_id === false || (isset($user_data['user_id']) && $user_id == $user_data['user_id']))
- {
- $this->data = $user_data;
- }
-
- if (sizeof($this->data))
- {
- $this->cookie_data['k'] = '';
- $this->cookie_data['u'] = $this->data['user_id'];
- }
- }
-
- // If we're presented with an autologin key we'll join against it.
- // Else if we've been passed a user_id we'll grab data based on that
- if (isset($this->cookie_data['k']) && $this->cookie_data['k'] && $this->cookie_data['u'] && !sizeof($this->data))
- {
- $sql = 'SELECT u.*
- FROM ' . USERS_TABLE . ' u, ' . SESSIONS_KEYS_TABLE . ' k
- WHERE u.user_id = ' . (int) $this->cookie_data['u'] . '
- AND u.user_type IN (' . USER_NORMAL . ', ' . USER_FOUNDER . ")
- AND k.user_id = u.user_id
- AND k.key_id = '" . $db->sql_escape(md5($this->cookie_data['k'])) . "'";
- $result = $db->sql_query($sql);
- $user_data = $db->sql_fetchrow($result);
-
- if ($user_id === false || (isset($user_data['user_id']) && $user_id == $user_data['user_id']))
- {
- $this->data = $user_data;
- $bot = false;
- }
-
- $db->sql_freeresult($result);
- }
-
- if ($user_id !== false && !sizeof($this->data))
- {
- $this->cookie_data['k'] = '';
- $this->cookie_data['u'] = $user_id;
-
- $sql = 'SELECT *
- FROM ' . USERS_TABLE . '
- WHERE user_id = ' . (int) $this->cookie_data['u'] . '
- AND user_type IN (' . USER_NORMAL . ', ' . USER_FOUNDER . ')';
- $result = $db->sql_query($sql);
- $this->data = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
- $bot = false;
- }
-
- // Bot user, if they have a SID in the Request URI we need to get rid of it
- // otherwise they'll index this page with the SID, duplicate content oh my!
- if ($bot && isset($_GET['sid']))
- {
- send_status_line(301, 'Moved Permanently');
- redirect(build_url(array('sid')));
- }
-
- // If no data was returned one or more of the following occurred:
- // Key didn't match one in the DB
- // User does not exist
- // User is inactive
- // User is bot
- if (!sizeof($this->data) || !is_array($this->data))
- {
- $this->cookie_data['k'] = '';
- $this->cookie_data['u'] = ($bot) ? $bot : ANONYMOUS;
-
- if (!$bot)
- {
- $sql = 'SELECT *
- FROM ' . USERS_TABLE . '
- WHERE user_id = ' . (int) $this->cookie_data['u'];
- }
- else
- {
- // We give bots always the same session if it is not yet expired.
- $sql = 'SELECT u.*, s.*
- FROM ' . USERS_TABLE . ' u
- LEFT JOIN ' . SESSIONS_TABLE . ' s ON (s.session_user_id = u.user_id)
- WHERE u.user_id = ' . (int) $bot;
- }
-
- $result = $db->sql_query($sql);
- $this->data = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
- }
-
- if ($this->data['user_id'] != ANONYMOUS && !$bot)
- {
- $this->data['session_last_visit'] = (isset($this->data['session_time']) && $this->data['session_time']) ? $this->data['session_time'] : (($this->data['user_lastvisit']) ? $this->data['user_lastvisit'] : time());
- }
- else
- {
- $this->data['session_last_visit'] = $this->time_now;
- }
-
- // Force user id to be integer...
- $this->data['user_id'] = (int) $this->data['user_id'];
-
- // At this stage we should have a filled data array, defined cookie u and k data.
- // data array should contain recent session info if we're a real user and a recent
- // session exists in which case session_id will also be set
-
- // Is user banned? Are they excluded? Won't return on ban, exists within method
- if ($this->data['user_type'] != USER_FOUNDER)
- {
- if (!$config['forwarded_for_check'])
- {
- $this->check_ban($this->data['user_id'], $this->ip);
- }
- else
- {
- $ips = explode(' ', $this->forwarded_for);
- $ips[] = $this->ip;
- $this->check_ban($this->data['user_id'], $ips);
- }
- }
-
- $this->data['is_registered'] = (!$bot && $this->data['user_id'] != ANONYMOUS && ($this->data['user_type'] == USER_NORMAL || $this->data['user_type'] == USER_FOUNDER)) ? true : false;
- $this->data['is_bot'] = ($bot) ? true : false;
-
- // If our friend is a bot, we re-assign a previously assigned session
- if ($this->data['is_bot'] && $bot == $this->data['user_id'] && $this->data['session_id'])
- {
- // Only assign the current session if the ip, browser and forwarded_for match...
- if (strpos($this->ip, ':') !== false && strpos($this->data['session_ip'], ':') !== false)
- {
- $s_ip = short_ipv6($this->data['session_ip'], $config['ip_check']);
- $u_ip = short_ipv6($this->ip, $config['ip_check']);
- }
- else
- {
- $s_ip = implode('.', array_slice(explode('.', $this->data['session_ip']), 0, $config['ip_check']));
- $u_ip = implode('.', array_slice(explode('.', $this->ip), 0, $config['ip_check']));
- }
-
- $s_browser = ($config['browser_check']) ? trim(strtolower(substr($this->data['session_browser'], 0, 149))) : '';
- $u_browser = ($config['browser_check']) ? trim(strtolower(substr($this->browser, 0, 149))) : '';
-
- $s_forwarded_for = ($config['forwarded_for_check']) ? substr($this->data['session_forwarded_for'], 0, 254) : '';
- $u_forwarded_for = ($config['forwarded_for_check']) ? substr($this->forwarded_for, 0, 254) : '';
-
- if ($u_ip === $s_ip && $s_browser === $u_browser && $s_forwarded_for === $u_forwarded_for)
- {
- $this->session_id = $this->data['session_id'];
-
- // Only update session DB a minute or so after last update or if page changes
- if ($this->time_now - $this->data['session_time'] > 60 || ($this->update_session_page && $this->data['session_page'] != $this->page['page']))
- {
- $this->data['session_time'] = $this->data['session_last_visit'] = $this->time_now;
-
- $sql_ary = array('session_time' => $this->time_now, 'session_last_visit' => $this->time_now, 'session_admin' => 0);
-
- if ($this->update_session_page)
- {
- $sql_ary['session_page'] = substr($this->page['page'], 0, 199);
- $sql_ary['session_forum_id'] = $this->page['forum'];
- }
-
- $sql = 'UPDATE ' . SESSIONS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . "
- WHERE session_id = '" . $db->sql_escape($this->session_id) . "'";
- $db->sql_query($sql);
-
- // Update the last visit time
- $sql = 'UPDATE ' . USERS_TABLE . '
- SET user_lastvisit = ' . (int) $this->data['session_time'] . '
- WHERE user_id = ' . (int) $this->data['user_id'];
- $db->sql_query($sql);
- }
-
- $SID = '?sid=';
- $_SID = '';
- return true;
- }
- else
- {
- // If the ip and browser does not match make sure we only have one bot assigned to one session
- $db->sql_query('DELETE FROM ' . SESSIONS_TABLE . ' WHERE session_user_id = ' . $this->data['user_id']);
- }
- }
-
- $session_autologin = (($this->cookie_data['k'] || $persist_login) && $this->data['is_registered']) ? true : false;
- $set_admin = ($set_admin && $this->data['is_registered']) ? true : false;
-
- // Create or update the session
- $sql_ary = array(
- 'session_user_id' => (int) $this->data['user_id'],
- 'session_start' => (int) $this->time_now,
- 'session_last_visit' => (int) $this->data['session_last_visit'],
- 'session_time' => (int) $this->time_now,
- 'session_browser' => (string) trim(substr($this->browser, 0, 149)),
- 'session_forwarded_for' => (string) $this->forwarded_for,
- 'session_ip' => (string) $this->ip,
- 'session_autologin' => ($session_autologin) ? 1 : 0,
- 'session_admin' => ($set_admin) ? 1 : 0,
- 'session_viewonline' => ($viewonline) ? 1 : 0,
- );
-
- if ($this->update_session_page)
- {
- $sql_ary['session_page'] = (string) substr($this->page['page'], 0, 199);
- $sql_ary['session_forum_id'] = $this->page['forum'];
- }
-
- $db->sql_return_on_error(true);
-
- $sql = 'DELETE
- FROM ' . SESSIONS_TABLE . '
- WHERE session_id = \'' . $db->sql_escape($this->session_id) . '\'
- AND session_user_id = ' . ANONYMOUS;
-
- if (!defined('IN_ERROR_HANDLER') && (!$this->session_id || !$db->sql_query($sql) || !$db->sql_affectedrows()))
- {
- // Limit new sessions in 1 minute period (if required)
- if (empty($this->data['session_time']) && $config['active_sessions'])
- {
-// $db->sql_return_on_error(false);
-
- $sql = 'SELECT COUNT(session_id) AS sessions
- FROM ' . SESSIONS_TABLE . '
- WHERE session_time >= ' . ($this->time_now - 60);
- $result = $db->sql_query($sql);
- $row = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
-
- if ((int) $row['sessions'] > (int) $config['active_sessions'])
- {
- send_status_line(503, 'Service Unavailable');
- trigger_error('BOARD_UNAVAILABLE');
- }
- }
- }
-
- // Since we re-create the session id here, the inserted row must be unique. Therefore, we display potential errors.
- // Commented out because it will not allow forums to update correctly
-// $db->sql_return_on_error(false);
-
- // Something quite important: session_page always holds the *last* page visited, except for the *first* visit.
- // We are not able to simply have an empty session_page btw, therefore we need to tell phpBB how to detect this special case.
- // If the session id is empty, we have a completely new one and will set an "identifier" here. This identifier is able to be checked later.
- if (empty($this->data['session_id']))
- {
- // This is a temporary variable, only set for the very first visit
- $this->data['session_created'] = true;
- }
-
- $this->session_id = $this->data['session_id'] = md5(unique_id());
-
- $sql_ary['session_id'] = (string) $this->session_id;
- $sql_ary['session_page'] = (string) substr($this->page['page'], 0, 199);
- $sql_ary['session_forum_id'] = $this->page['forum'];
-
- $sql = 'INSERT INTO ' . SESSIONS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary);
- $db->sql_query($sql);
-
- $db->sql_return_on_error(false);
-
- // Regenerate autologin/persistent login key
- if ($session_autologin)
- {
- $this->set_login_key();
- }
-
- // refresh data
- $SID = '?sid=' . $this->session_id;
- $_SID = $this->session_id;
- $this->data = array_merge($this->data, $sql_ary);
-
- if (!$bot)
- {
- $cookie_expire = $this->time_now + (($config['max_autologin_time']) ? 86400 * (int) $config['max_autologin_time'] : 31536000);
-
- $this->set_cookie('u', $this->cookie_data['u'], $cookie_expire);
- $this->set_cookie('k', $this->cookie_data['k'], $cookie_expire);
- $this->set_cookie('sid', $this->session_id, $cookie_expire);
-
- unset($cookie_expire);
-
- $sql = 'SELECT COUNT(session_id) AS sessions
- FROM ' . SESSIONS_TABLE . '
- WHERE session_user_id = ' . (int) $this->data['user_id'] . '
- AND session_time >= ' . (int) ($this->time_now - (max($config['session_length'], $config['form_token_lifetime'])));
- $result = $db->sql_query($sql);
- $row = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
-
- if ((int) $row['sessions'] <= 1 || empty($this->data['user_form_salt']))
- {
- $this->data['user_form_salt'] = unique_id();
- // Update the form key
- $sql = 'UPDATE ' . USERS_TABLE . '
- SET user_form_salt = \'' . $db->sql_escape($this->data['user_form_salt']) . '\'
- WHERE user_id = ' . (int) $this->data['user_id'];
- $db->sql_query($sql);
- }
- }
- else
- {
- $this->data['session_time'] = $this->data['session_last_visit'] = $this->time_now;
-
- // Update the last visit time
- $sql = 'UPDATE ' . USERS_TABLE . '
- SET user_lastvisit = ' . (int) $this->data['session_time'] . '
- WHERE user_id = ' . (int) $this->data['user_id'];
- $db->sql_query($sql);
-
- $SID = '?sid=';
- $_SID = '';
- }
-
- return true;
- }
-
- /**
- * Kills a session
- *
- * This method does what it says on the tin. It will delete a pre-existing session.
- * It resets cookie information (destroying any autologin key within that cookie data)
- * and update the users information from the relevant session data. It will then
- * grab guest user information.
- */
- function session_kill($new_session = true)
- {
- global $SID, $_SID, $db, $config, $phpbb_root_path, $phpEx;
-
- $sql = 'DELETE FROM ' . SESSIONS_TABLE . "
- WHERE session_id = '" . $db->sql_escape($this->session_id) . "'
- AND session_user_id = " . (int) $this->data['user_id'];
- $db->sql_query($sql);
-
- // Allow connecting logout with external auth method logout
- $method = basename(trim($config['auth_method']));
- include_once($phpbb_root_path . 'includes/auth/auth_' . $method . '.' . $phpEx);
-
- $method = 'logout_' . $method;
- if (function_exists($method))
- {
- $method($this->data, $new_session);
- }
-
- if ($this->data['user_id'] != ANONYMOUS)
- {
- // Delete existing session, update last visit info first!
- if (!isset($this->data['session_time']))
- {
- $this->data['session_time'] = time();
- }
-
- $sql = 'UPDATE ' . USERS_TABLE . '
- SET user_lastvisit = ' . (int) $this->data['session_time'] . '
- WHERE user_id = ' . (int) $this->data['user_id'];
- $db->sql_query($sql);
-
- if ($this->cookie_data['k'])
- {
- $sql = 'DELETE FROM ' . SESSIONS_KEYS_TABLE . '
- WHERE user_id = ' . (int) $this->data['user_id'] . "
- AND key_id = '" . $db->sql_escape(md5($this->cookie_data['k'])) . "'";
- $db->sql_query($sql);
- }
-
- // Reset the data array
- $this->data = array();
-
- $sql = 'SELECT *
- FROM ' . USERS_TABLE . '
- WHERE user_id = ' . ANONYMOUS;
- $result = $db->sql_query($sql);
- $this->data = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
- }
-
- $cookie_expire = $this->time_now - 31536000;
- $this->set_cookie('u', '', $cookie_expire);
- $this->set_cookie('k', '', $cookie_expire);
- $this->set_cookie('sid', '', $cookie_expire);
- unset($cookie_expire);
-
- $SID = '?sid=';
- $this->session_id = $_SID = '';
-
- // To make sure a valid session is created we create one for the anonymous user
- if ($new_session)
- {
- $this->session_create(ANONYMOUS);
- }
-
- return true;
- }
-
- /**
- * Session garbage collection
- *
- * This looks a lot more complex than it really is. Effectively we are
- * deleting any sessions older than an admin definable limit. Due to the
- * way in which we maintain session data we have to ensure we update user
- * data before those sessions are destroyed. In addition this method
- * removes autologin key information that is older than an admin defined
- * limit.
- */
- function session_gc()
- {
- global $db, $config, $phpbb_root_path, $phpEx;
-
- $batch_size = 10;
-
- if (!$this->time_now)
- {
- $this->time_now = time();
- }
-
- // Firstly, delete guest sessions
- $sql = 'DELETE FROM ' . SESSIONS_TABLE . '
- WHERE session_user_id = ' . ANONYMOUS . '
- AND session_time < ' . (int) ($this->time_now - $config['session_length']);
- $db->sql_query($sql);
-
- // Get expired sessions, only most recent for each user
- $sql = 'SELECT session_user_id, session_page, MAX(session_time) AS recent_time
- FROM ' . SESSIONS_TABLE . '
- WHERE session_time < ' . ($this->time_now - $config['session_length']) . '
- GROUP BY session_user_id, session_page';
- $result = $db->sql_query_limit($sql, $batch_size);
-
- $del_user_id = array();
- $del_sessions = 0;
-
- while ($row = $db->sql_fetchrow($result))
- {
- $sql = 'UPDATE ' . USERS_TABLE . '
- SET user_lastvisit = ' . (int) $row['recent_time'] . ", user_lastpage = '" . $db->sql_escape($row['session_page']) . "'
- WHERE user_id = " . (int) $row['session_user_id'];
- $db->sql_query($sql);
-
- $del_user_id[] = (int) $row['session_user_id'];
- $del_sessions++;
- }
- $db->sql_freeresult($result);
-
- if (sizeof($del_user_id))
- {
- // Delete expired sessions
- $sql = 'DELETE FROM ' . SESSIONS_TABLE . '
- WHERE ' . $db->sql_in_set('session_user_id', $del_user_id) . '
- AND session_time < ' . ($this->time_now - $config['session_length']);
- $db->sql_query($sql);
- }
-
- if ($del_sessions < $batch_size)
- {
- // Less than 10 users, update gc timer ... else we want gc
- // called again to delete other sessions
- set_config('session_last_gc', $this->time_now, true);
-
- if ($config['max_autologin_time'])
- {
- $sql = 'DELETE FROM ' . SESSIONS_KEYS_TABLE . '
- WHERE last_login < ' . (time() - (86400 * (int) $config['max_autologin_time']));
- $db->sql_query($sql);
- }
-
- // only called from CRON; should be a safe workaround until the infrastructure gets going
- if (!class_exists('phpbb_captcha_factory'))
- {
- include($phpbb_root_path . "includes/captcha/captcha_factory." . $phpEx);
- }
- phpbb_captcha_factory::garbage_collect($config['captcha_plugin']);
-
- $sql = 'DELETE FROM ' . LOGIN_ATTEMPT_TABLE . '
- WHERE attempt_time < ' . (time() - (int) $config['ip_login_limit_time']);
- $db->sql_query($sql);
- }
-
- return;
- }
-
- /**
- * Sets a cookie
- *
- * Sets a cookie of the given name with the specified data for the given length of time. If no time is specified, a session cookie will be set.
- *
- * @param string $name Name of the cookie, will be automatically prefixed with the phpBB cookie name. track becomes [cookie_name]_track then.
- * @param string $cookiedata The data to hold within the cookie
- * @param int $cookietime The expiration time as UNIX timestamp. If 0 is provided, a session cookie is set.
- */
- function set_cookie($name, $cookiedata, $cookietime)
- {
- global $config;
-
- $name_data = rawurlencode($config['cookie_name'] . '_' . $name) . '=' . rawurlencode($cookiedata);
- $expire = gmdate('D, d-M-Y H:i:s \\G\\M\\T', $cookietime);
- $domain = (!$config['cookie_domain'] || $config['cookie_domain'] == '127.0.0.1' || strpos($config['cookie_domain'], '.') === false) ? '' : '; domain=' . $config['cookie_domain'];
-
- header('Set-Cookie: ' . $name_data . (($cookietime) ? '; expires=' . $expire : '') . '; path=' . $config['cookie_path'] . $domain . ((!$config['cookie_secure']) ? '' : '; secure') . '; HttpOnly', false);
- }
-
- /**
- * Check for banned user
- *
- * Checks whether the supplied user is banned by id, ip or email. If no parameters
- * are passed to the method pre-existing session data is used. If $return is false
- * this routine does not return on finding a banned user, it outputs a relevant
- * message and stops execution.
- *
- * @param string|array $user_ips Can contain a string with one IP or an array of multiple IPs
- */
- function check_ban($user_id = false, $user_ips = false, $user_email = false, $return = false)
- {
- global $config, $db;
-
- if (defined('IN_CHECK_BAN'))
- {
- return;
- }
-
- $banned = false;
- $cache_ttl = 3600;
- $where_sql = array();
-
- $sql = 'SELECT ban_ip, ban_userid, ban_email, ban_exclude, ban_give_reason, ban_end
- FROM ' . BANLIST_TABLE . '
- WHERE ';
-
- // Determine which entries to check, only return those
- if ($user_email === false)
- {
- $where_sql[] = "ban_email = ''";
- }
-
- if ($user_ips === false)
- {
- $where_sql[] = "(ban_ip = '' OR ban_exclude = 1)";
- }
-
- if ($user_id === false)
- {
- $where_sql[] = '(ban_userid = 0 OR ban_exclude = 1)';
- }
- else
- {
- $cache_ttl = ($user_id == ANONYMOUS) ? 3600 : 0;
- $_sql = '(ban_userid = ' . $user_id;
-
- if ($user_email !== false)
- {
- $_sql .= " OR ban_email <> ''";
- }
-
- if ($user_ips !== false)
- {
- $_sql .= " OR ban_ip <> ''";
- }
-
- $_sql .= ')';
-
- $where_sql[] = $_sql;
- }
-
- $sql .= (sizeof($where_sql)) ? implode(' AND ', $where_sql) : '';
- $result = $db->sql_query($sql, $cache_ttl);
-
- $ban_triggered_by = 'user';
- while ($row = $db->sql_fetchrow($result))
- {
- if ($row['ban_end'] && $row['ban_end'] < time())
- {
- continue;
- }
-
- $ip_banned = false;
- if (!empty($row['ban_ip']))
- {
- if (!is_array($user_ips))
- {
- $ip_banned = preg_match('#^' . str_replace('\*', '.*?', preg_quote($row['ban_ip'], '#')) . '$#i', $user_ips);
- }
- else
- {
- foreach ($user_ips as $user_ip)
- {
- if (preg_match('#^' . str_replace('\*', '.*?', preg_quote($row['ban_ip'], '#')) . '$#i', $user_ip))
- {
- $ip_banned = true;
- break;
- }
- }
- }
- }
-
- if ((!empty($row['ban_userid']) && intval($row['ban_userid']) == $user_id) ||
- $ip_banned ||
- (!empty($row['ban_email']) && preg_match('#^' . str_replace('\*', '.*?', preg_quote($row['ban_email'], '#')) . '$#i', $user_email)))
- {
- if (!empty($row['ban_exclude']))
- {
- $banned = false;
- break;
- }
- else
- {
- $banned = true;
- $ban_row = $row;
-
- if (!empty($row['ban_userid']) && intval($row['ban_userid']) == $user_id)
- {
- $ban_triggered_by = 'user';
- }
- else if ($ip_banned)
- {
- $ban_triggered_by = 'ip';
- }
- else
- {
- $ban_triggered_by = 'email';
- }
-
- // Don't break. Check if there is an exclude rule for this user
- }
- }
- }
- $db->sql_freeresult($result);
-
- if ($banned && !$return)
- {
- global $template;
-
- // If the session is empty we need to create a valid one...
- if (empty($this->session_id))
- {
- // This seems to be no longer needed? - #14971
-// $this->session_create(ANONYMOUS);
- }
-
- // Initiate environment ... since it won't be set at this stage
- $this->setup();
-
- // Logout the user, banned users are unable to use the normal 'logout' link
- if ($this->data['user_id'] != ANONYMOUS)
- {
- $this->session_kill();
- }
-
- // We show a login box here to allow founders accessing the board if banned by IP
- if (defined('IN_LOGIN') && $this->data['user_id'] == ANONYMOUS)
- {
- global $phpEx;
-
- $this->setup('ucp');
- $this->data['is_registered'] = $this->data['is_bot'] = false;
-
- // Set as a precaution to allow login_box() handling this case correctly as well as this function not being executed again.
- define('IN_CHECK_BAN', 1);
-
- login_box("index.$phpEx");
-
- // The false here is needed, else the user is able to circumvent the ban.
- $this->session_kill(false);
- }
-
- // Ok, we catch the case of an empty session id for the anonymous user...
- // This can happen if the user is logging in, banned by username and the login_box() being called "again".
- if (empty($this->session_id) && defined('IN_CHECK_BAN'))
- {
- $this->session_create(ANONYMOUS);
- }
-
-
- // Determine which message to output
- $till_date = ($ban_row['ban_end']) ? $this->format_date($ban_row['ban_end']) : '';
- $message = ($ban_row['ban_end']) ? 'BOARD_BAN_TIME' : 'BOARD_BAN_PERM';
-
- $message = sprintf($this->lang[$message], $till_date, '<a href="mailto:' . $config['board_contact'] . '">', '</a>');
- $message .= ($ban_row['ban_give_reason']) ? '<br /><br />' . sprintf($this->lang['BOARD_BAN_REASON'], $ban_row['ban_give_reason']) : '';
- $message .= '<br /><br /><em>' . $this->lang['BAN_TRIGGERED_BY_' . strtoupper($ban_triggered_by)] . '</em>';
-
- // To circumvent session_begin returning a valid value and the check_ban() not called on second page view, we kill the session again
- $this->session_kill(false);
-
- // A very special case... we are within the cron script which is not supposed to print out the ban message... show blank page
- if (defined('IN_CRON'))
- {
- garbage_collection();
- exit_handler();
- exit;
- }
-
- trigger_error($message);
- }
-
- return ($banned && $ban_row['ban_give_reason']) ? $ban_row['ban_give_reason'] : $banned;
- }
-
- /**
- * Check if ip is blacklisted
- * This should be called only where absolutly necessary
- *
- * Only IPv4 (rbldns does not support AAAA records/IPv6 lookups)
- *
- * @author satmd (from the php manual)
- * @param string $mode register/post - spamcop for example is ommitted for posting
- * @return false if ip is not blacklisted, else an array([checked server], [lookup])
- */
- function check_dnsbl($mode, $ip = false)
- {
- if ($ip === false)
- {
- $ip = $this->ip;
- }
-
- // Neither Spamhaus nor Spamcop supports IPv6 addresses.
- if (strpos($ip, ':') !== false)
- {
- return false;
- }
-
- $dnsbl_check = array(
- 'sbl.spamhaus.org' => 'http://www.spamhaus.org/query/bl?ip=',
- );
-
- if ($mode == 'register')
- {
- $dnsbl_check['bl.spamcop.net'] = 'http://spamcop.net/bl.shtml?';
- }
-
- if ($ip)
- {
- $quads = explode('.', $ip);
- $reverse_ip = $quads[3] . '.' . $quads[2] . '.' . $quads[1] . '.' . $quads[0];
-
- // Need to be listed on all servers...
- $listed = true;
- $info = array();
-
- foreach ($dnsbl_check as $dnsbl => $lookup)
- {
- if (phpbb_checkdnsrr($reverse_ip . '.' . $dnsbl . '.', 'A') === true)
- {
- $info = array($dnsbl, $lookup . $ip);
- }
- else
- {
- $listed = false;
- }
- }
-
- if ($listed)
- {
- return $info;
- }
- }
-
- return false;
- }
-
- /**
- * Check if URI is blacklisted
- * This should be called only where absolutly necessary, for example on the submitted website field
- * This function is not in use at the moment and is only included for testing purposes, it may not work at all!
- * This means it is untested at the moment and therefore commented out
- *
- * @param string $uri URI to check
- * @return true if uri is on blacklist, else false. Only blacklist is checked (~zero FP), no grey lists
- function check_uribl($uri)
- {
- // Normally parse_url() is not intended to parse uris
- // We need to get the top-level domain name anyway... change.
- $uri = parse_url($uri);
-
- if ($uri === false || empty($uri['host']))
- {
- return false;
- }
-
- $uri = trim($uri['host']);
-
- if ($uri)
- {
- // One problem here... the return parameter for the "windows" method is different from what
- // we expect... this may render this check useless...
- if (phpbb_checkdnsrr($uri . '.multi.uribl.com.', 'A') === true)
- {
- return true;
- }
- }
-
- return false;
- }
- */
-
- /**
- * Set/Update a persistent login key
- *
- * This method creates or updates a persistent session key. When a user makes
- * use of persistent (formerly auto-) logins a key is generated and stored in the
- * DB. When they revisit with the same key it's automatically updated in both the
- * DB and cookie. Multiple keys may exist for each user representing different
- * browsers or locations. As with _any_ non-secure-socket no passphrase login this
- * remains vulnerable to exploit.
- */
- function set_login_key($user_id = false, $key = false, $user_ip = false)
- {
- global $config, $db;
-
- $user_id = ($user_id === false) ? $this->data['user_id'] : $user_id;
- $user_ip = ($user_ip === false) ? $this->ip : $user_ip;
- $key = ($key === false) ? (($this->cookie_data['k']) ? $this->cookie_data['k'] : false) : $key;
-
- $key_id = unique_id(hexdec(substr($this->session_id, 0, 8)));
-
- $sql_ary = array(
- 'key_id' => (string) md5($key_id),
- 'last_ip' => (string) $this->ip,
- 'last_login' => (int) time()
- );
-
- if (!$key)
- {
- $sql_ary += array(
- 'user_id' => (int) $user_id
- );
- }
-
- if ($key)
- {
- $sql = 'UPDATE ' . SESSIONS_KEYS_TABLE . '
- SET ' . $db->sql_build_array('UPDATE', $sql_ary) . '
- WHERE user_id = ' . (int) $user_id . "
- AND key_id = '" . $db->sql_escape(md5($key)) . "'";
- }
- else
- {
- $sql = 'INSERT INTO ' . SESSIONS_KEYS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary);
- }
- $db->sql_query($sql);
-
- $this->cookie_data['k'] = $key_id;
-
- return false;
- }
-
- /**
- * Reset all login keys for the specified user
- *
- * This method removes all current login keys for a specified (or the current)
- * user. It will be called on password change to render old keys unusable
- */
- function reset_login_keys($user_id = false)
- {
- global $config, $db;
-
- $user_id = ($user_id === false) ? (int) $this->data['user_id'] : (int) $user_id;
-
- $sql = 'DELETE FROM ' . SESSIONS_KEYS_TABLE . '
- WHERE user_id = ' . (int) $user_id;
- $db->sql_query($sql);
-
- // If the user is logged in, update last visit info first before deleting sessions
- $sql = 'SELECT session_time, session_page
- FROM ' . SESSIONS_TABLE . '
- WHERE session_user_id = ' . (int) $user_id . '
- ORDER BY session_time DESC';
- $result = $db->sql_query_limit($sql, 1);
- $row = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
-
- if ($row)
- {
- $sql = 'UPDATE ' . USERS_TABLE . '
- SET user_lastvisit = ' . (int) $row['session_time'] . ", user_lastpage = '" . $db->sql_escape($row['session_page']) . "'
- WHERE user_id = " . (int) $user_id;
- $db->sql_query($sql);
- }
-
- // Let's also clear any current sessions for the specified user_id
- // If it's the current user then we'll leave this session intact
- $sql_where = 'session_user_id = ' . (int) $user_id;
- $sql_where .= ($user_id === (int) $this->data['user_id']) ? " AND session_id <> '" . $db->sql_escape($this->session_id) . "'" : '';
-
- $sql = 'DELETE FROM ' . SESSIONS_TABLE . "
- WHERE $sql_where";
- $db->sql_query($sql);
-
- // We're changing the password of the current user and they have a key
- // Lets regenerate it to be safe
- if ($user_id === (int) $this->data['user_id'] && $this->cookie_data['k'])
- {
- $this->set_login_key($user_id);
- }
- }
-
-
- /**
- * Check if the request originated from the same page.
- * @param bool $check_script_path If true, the path will be checked as well
- */
- function validate_referer($check_script_path = false)
- {
- global $config;
-
- // no referer - nothing to validate, user's fault for turning it off (we only check on POST; so meta can't be the reason)
- if (empty($this->referer) || empty($this->host))
- {
- return true;
- }
-
- $host = htmlspecialchars($this->host);
- $ref = substr($this->referer, strpos($this->referer, '://') + 3);
-
- if (!(stripos($ref, $host) === 0) && (!$config['force_server_vars'] || !(stripos($ref, $config['server_name']) === 0)))
- {
- return false;
- }
- else if ($check_script_path && rtrim($this->page['root_script_path'], '/') !== '')
- {
- $ref = substr($ref, strlen($host));
- $server_port = (!empty($_SERVER['SERVER_PORT'])) ? (int) $_SERVER['SERVER_PORT'] : (int) getenv('SERVER_PORT');
-
- if ($server_port !== 80 && $server_port !== 443 && stripos($ref, ":$server_port") === 0)
- {
- $ref = substr($ref, strlen(":$server_port"));
- }
-
- if (!(stripos(rtrim($ref, '/'), rtrim($this->page['root_script_path'], '/')) === 0))
- {
- return false;
- }
- }
-
- return true;
- }
-
-
- function unset_admin()
- {
- global $db;
- $sql = 'UPDATE ' . SESSIONS_TABLE . '
- SET session_admin = 0
- WHERE session_id = \'' . $db->sql_escape($this->session_id) . '\'';
- $db->sql_query($sql);
- }
-}
-
-
-/**
-* Base user class
-*
-* This is the overarching class which contains (through session extend)
-* all methods utilised for user functionality during a session.
-*
-* @package phpBB3
-*/
-class user extends session
-{
- var $lang = array();
- var $help = array();
- var $theme = array();
- var $date_format;
- var $timezone;
- var $dst;
-
- var $lang_name = false;
- var $lang_id = false;
- var $lang_path;
- var $img_lang;
- var $img_array = array();
-
- // Able to add new options (up to id 31)
- var $keyoptions = array('viewimg' => 0, 'viewflash' => 1, 'viewsmilies' => 2, 'viewsigs' => 3, 'viewavatars' => 4, 'viewcensors' => 5, 'attachsig' => 6, 'bbcode' => 8, 'smilies' => 9, 'popuppm' => 10, 'sig_bbcode' => 15, 'sig_smilies' => 16, 'sig_links' => 17);
-
- /**
- * Constructor to set the lang path
- */
- function user()
- {
- global $phpbb_root_path;
-
- $this->lang_path = $phpbb_root_path . 'language/';
- }
-
- /**
- * Function to set custom language path (able to use directory outside of phpBB)
- *
- * @param string $lang_path New language path used.
- * @access public
- */
- function set_custom_lang_path($lang_path)
- {
- $this->lang_path = $lang_path;
-
- if (substr($this->lang_path, -1) != '/')
- {
- $this->lang_path .= '/';
- }
- }
-
- /**
- * Setup basic user-specific items (style, language, ...)
- */
- function setup($lang_set = false, $style = false)
- {
- global $db, $template, $config, $auth, $phpEx, $phpbb_root_path, $cache;
-
- if ($this->data['user_id'] != ANONYMOUS)
- {
- $this->lang_name = (file_exists($this->lang_path . $this->data['user_lang'] . "/common.$phpEx")) ? $this->data['user_lang'] : basename($config['default_lang']);
-
- $this->date_format = $this->data['user_dateformat'];
- $this->timezone = $this->data['user_timezone'] * 3600;
- $this->dst = $this->data['user_dst'] * 3600;
- }
- else
- {
- $this->lang_name = basename($config['default_lang']);
- $this->date_format = $config['default_dateformat'];
- $this->timezone = $config['board_timezone'] * 3600;
- $this->dst = $config['board_dst'] * 3600;
-
- /**
- * If a guest user is surfing, we try to guess his/her language first by obtaining the browser language
- * If re-enabled we need to make sure only those languages installed are checked
- * Commented out so we do not loose the code.
-
- if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE']))
- {
- $accept_lang_ary = explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']);
-
- foreach ($accept_lang_ary as $accept_lang)
- {
- // Set correct format ... guess full xx_YY form
- $accept_lang = substr($accept_lang, 0, 2) . '_' . strtoupper(substr($accept_lang, 3, 2));
- $accept_lang = basename($accept_lang);
-
- if (file_exists($this->lang_path . $accept_lang . "/common.$phpEx"))
- {
- $this->lang_name = $config['default_lang'] = $accept_lang;
- break;
- }
- else
- {
- // No match on xx_YY so try xx
- $accept_lang = substr($accept_lang, 0, 2);
- $accept_lang = basename($accept_lang);
-
- if (file_exists($this->lang_path . $accept_lang . "/common.$phpEx"))
- {
- $this->lang_name = $config['default_lang'] = $accept_lang;
- break;
- }
- }
- }
- }
- */
- }
-
- // We include common language file here to not load it every time a custom language file is included
- $lang = &$this->lang;
-
- // Do not suppress error if in DEBUG_EXTRA mode
- $include_result = (defined('DEBUG_EXTRA')) ? (include $this->lang_path . $this->lang_name . "/common.$phpEx") : (@include $this->lang_path . $this->lang_name . "/common.$phpEx");
-
- if ($include_result === false)
- {
- die('Language file ' . $this->lang_path . $this->lang_name . "/common.$phpEx" . " couldn't be opened.");
- }
-
- $this->add_lang($lang_set);
- unset($lang_set);
-
- if (!empty($_GET['style']) && $auth->acl_get('a_styles') && !defined('ADMIN_START'))
- {
- global $SID, $_EXTRA_URL;
-
- $style = request_var('style', 0);
- $SID .= '&amp;style=' . $style;
- $_EXTRA_URL = array('style=' . $style);
- }
- else
- {
- // Set up style
- $style = ($style) ? $style : ((!$config['override_user_style']) ? $this->data['user_style'] : $config['default_style']);
- }
-
- $sql = 'SELECT s.style_id, t.template_storedb, t.template_path, t.template_id, t.bbcode_bitfield, t.template_inherits_id, t.template_inherit_path, c.theme_path, c.theme_name, c.theme_storedb, c.theme_id, i.imageset_path, i.imageset_id, i.imageset_name
- FROM ' . STYLES_TABLE . ' s, ' . STYLES_TEMPLATE_TABLE . ' t, ' . STYLES_THEME_TABLE . ' c, ' . STYLES_IMAGESET_TABLE . " i
- WHERE s.style_id = $style
- AND t.template_id = s.template_id
- AND c.theme_id = s.theme_id
- AND i.imageset_id = s.imageset_id";
- $result = $db->sql_query($sql, 3600);
- $this->theme = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
-
- // User has wrong style
- if (!$this->theme && $style == $this->data['user_style'])
- {
- $style = $this->data['user_style'] = $config['default_style'];
-
- $sql = 'UPDATE ' . USERS_TABLE . "
- SET user_style = $style
- WHERE user_id = {$this->data['user_id']}";
- $db->sql_query($sql);
-
- $sql = 'SELECT s.style_id, t.template_storedb, t.template_path, t.template_id, t.bbcode_bitfield, c.theme_path, c.theme_name, c.theme_storedb, c.theme_id, i.imageset_path, i.imageset_id, i.imageset_name
- FROM ' . STYLES_TABLE . ' s, ' . STYLES_TEMPLATE_TABLE . ' t, ' . STYLES_THEME_TABLE . ' c, ' . STYLES_IMAGESET_TABLE . " i
- WHERE s.style_id = $style
- AND t.template_id = s.template_id
- AND c.theme_id = s.theme_id
- AND i.imageset_id = s.imageset_id";
- $result = $db->sql_query($sql, 3600);
- $this->theme = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
- }
-
- if (!$this->theme)
- {
- trigger_error('NO_STYLE_DATA', E_USER_ERROR);
- }
-
- // Now parse the cfg file and cache it
- $parsed_items = $cache->obtain_cfg_items($this->theme);
-
- // We are only interested in the theme configuration for now
- $parsed_items = $parsed_items['theme'];
-
- $check_for = array(
- 'parse_css_file' => (int) 0,
- 'pagination_sep' => (string) ', '
- );
-
- foreach ($check_for as $key => $default_value)
- {
- $this->theme[$key] = (isset($parsed_items[$key])) ? $parsed_items[$key] : $default_value;
- settype($this->theme[$key], gettype($default_value));
-
- if (is_string($default_value))
- {
- $this->theme[$key] = htmlspecialchars($this->theme[$key]);
- }
- }
-
- // If the style author specified the theme needs to be cached
- // (because of the used paths and variables) than make sure it is the case.
- // For example, if the theme uses language-specific images it needs to be stored in db.
- if (!$this->theme['theme_storedb'] && $this->theme['parse_css_file'])
- {
- $this->theme['theme_storedb'] = 1;
-
- $stylesheet = file_get_contents("{$phpbb_root_path}styles/{$this->theme['theme_path']}/theme/stylesheet.css");
- // Match CSS imports
- $matches = array();
- preg_match_all('/@import url\(["\'](.*)["\']\);/i', $stylesheet, $matches);
-
- if (sizeof($matches))
- {
- $content = '';
- foreach ($matches[0] as $idx => $match)
- {
- if ($content = @file_get_contents("{$phpbb_root_path}styles/{$this->theme['theme_path']}/theme/" . $matches[1][$idx]))
- {
- $content = trim($content);
- }
- else
- {
- $content = '';
- }
- $stylesheet = str_replace($match, $content, $stylesheet);
- }
- unset($content);
- }
-
- $stylesheet = str_replace('./', 'styles/' . $this->theme['theme_path'] . '/theme/', $stylesheet);
-
- $sql_ary = array(
- 'theme_data' => $stylesheet,
- 'theme_mtime' => time(),
- 'theme_storedb' => 1
- );
-
- $sql = 'UPDATE ' . STYLES_THEME_TABLE . '
- SET ' . $db->sql_build_array('UPDATE', $sql_ary) . '
- WHERE theme_id = ' . $this->theme['theme_id'];
- $db->sql_query($sql);
-
- unset($sql_ary);
- }
-
- $template->set_template();
-
- $this->img_lang = (file_exists($phpbb_root_path . 'styles/' . $this->theme['imageset_path'] . '/imageset/' . $this->lang_name)) ? $this->lang_name : $config['default_lang'];
-
- // Same query in style.php
- $sql = 'SELECT *
- FROM ' . STYLES_IMAGESET_DATA_TABLE . '
- WHERE imageset_id = ' . $this->theme['imageset_id'] . "
- AND image_filename <> ''
- AND image_lang IN ('" . $db->sql_escape($this->img_lang) . "', '')";
- $result = $db->sql_query($sql, 3600);
-
- $localised_images = false;
- while ($row = $db->sql_fetchrow($result))
- {
- if ($row['image_lang'])
- {
- $localised_images = true;
- }
-
- $row['image_filename'] = rawurlencode($row['image_filename']);
- $this->img_array[$row['image_name']] = $row;
- }
- $db->sql_freeresult($result);
-
- // there were no localised images, try to refresh the localised imageset for the user's language
- if (!$localised_images)
- {
- // Attention: this code ignores the image definition list from acp_styles and just takes everything
- // that the config file contains
- $sql_ary = array();
-
- $db->sql_transaction('begin');
-
- $sql = 'DELETE FROM ' . STYLES_IMAGESET_DATA_TABLE . '
- WHERE imageset_id = ' . $this->theme['imageset_id'] . '
- AND image_lang = \'' . $db->sql_escape($this->img_lang) . '\'';
- $result = $db->sql_query($sql);
-
- if (@file_exists("{$phpbb_root_path}styles/{$this->theme['imageset_path']}/imageset/{$this->img_lang}/imageset.cfg"))
- {
- $cfg_data_imageset_data = parse_cfg_file("{$phpbb_root_path}styles/{$this->theme['imageset_path']}/imageset/{$this->img_lang}/imageset.cfg");
- foreach ($cfg_data_imageset_data as $image_name => $value)
- {
- if (strpos($value, '*') !== false)
- {
- if (substr($value, -1, 1) === '*')
- {
- list($image_filename, $image_height) = explode('*', $value);
- $image_width = 0;
- }
- else
- {
- list($image_filename, $image_height, $image_width) = explode('*', $value);
- }
- }
- else
- {
- $image_filename = $value;
- $image_height = $image_width = 0;
- }
-
- if (strpos($image_name, 'img_') === 0 && $image_filename)
- {
- $image_name = substr($image_name, 4);
- $sql_ary[] = array(
- 'image_name' => (string) $image_name,
- 'image_filename' => (string) $image_filename,
- 'image_height' => (int) $image_height,
- 'image_width' => (int) $image_width,
- 'imageset_id' => (int) $this->theme['imageset_id'],
- 'image_lang' => (string) $this->img_lang,
- );
- }
- }
- }
-
- if (sizeof($sql_ary))
- {
- $db->sql_multi_insert(STYLES_IMAGESET_DATA_TABLE, $sql_ary);
- $db->sql_transaction('commit');
- $cache->destroy('sql', STYLES_IMAGESET_DATA_TABLE);
-
- add_log('admin', 'LOG_IMAGESET_LANG_REFRESHED', $this->theme['imageset_name'], $this->img_lang);
- }
- else
- {
- $db->sql_transaction('commit');
- add_log('admin', 'LOG_IMAGESET_LANG_MISSING', $this->theme['imageset_name'], $this->img_lang);
- }
- }
-
- // Call phpbb_user_session_handler() in case external application want to "bend" some variables or replace classes...
- // After calling it we continue script execution...
- phpbb_user_session_handler();
-
- // If this function got called from the error handler we are finished here.
- if (defined('IN_ERROR_HANDLER'))
- {
- return;
- }
-
- // Disable board if the install/ directory is still present
- // For the brave development army we do not care about this, else we need to comment out this everytime we develop locally
- if (!defined('DEBUG_EXTRA') && !defined('ADMIN_START') && !defined('IN_INSTALL') && !defined('IN_LOGIN') && file_exists($phpbb_root_path . 'install') && !is_file($phpbb_root_path . 'install'))
- {
- // Adjust the message slightly according to the permissions
- if ($auth->acl_gets('a_', 'm_') || $auth->acl_getf_global('m_'))
- {
- $message = 'REMOVE_INSTALL';
- }
- else
- {
- $message = (!empty($config['board_disable_msg'])) ? $config['board_disable_msg'] : 'BOARD_DISABLE';
- }
- trigger_error($message);
- }
-
- // Is board disabled and user not an admin or moderator?
- if ($config['board_disable'] && !defined('IN_LOGIN') && !$auth->acl_gets('a_', 'm_') && !$auth->acl_getf_global('m_'))
- {
- if ($this->data['is_bot'])
- {
- send_status_line(503, 'Service Unavailable');
- }
-
- $message = (!empty($config['board_disable_msg'])) ? $config['board_disable_msg'] : 'BOARD_DISABLE';
- trigger_error($message);
- }
-
- // Is load exceeded?
- if ($config['limit_load'] && $this->load !== false)
- {
- if ($this->load > floatval($config['limit_load']) && !defined('IN_LOGIN') && !defined('IN_ADMIN'))
- {
- // Set board disabled to true to let the admins/mods get the proper notification
- $config['board_disable'] = '1';
-
- if (!$auth->acl_gets('a_', 'm_') && !$auth->acl_getf_global('m_'))
- {
- if ($this->data['is_bot'])
- {
- send_status_line(503, 'Service Unavailable');
- }
- trigger_error('BOARD_UNAVAILABLE');
- }
- }
- }
-
- if (isset($this->data['session_viewonline']))
- {
- // Make sure the user is able to hide his session
- if (!$this->data['session_viewonline'])
- {
- // Reset online status if not allowed to hide the session...
- if (!$auth->acl_get('u_hideonline'))
- {
- $sql = 'UPDATE ' . SESSIONS_TABLE . '
- SET session_viewonline = 1
- WHERE session_user_id = ' . $this->data['user_id'];
- $db->sql_query($sql);
- $this->data['session_viewonline'] = 1;
- }
- }
- else if (!$this->data['user_allow_viewonline'])
- {
- // the user wants to hide and is allowed to -> cloaking device on.
- if ($auth->acl_get('u_hideonline'))
- {
- $sql = 'UPDATE ' . SESSIONS_TABLE . '
- SET session_viewonline = 0
- WHERE session_user_id = ' . $this->data['user_id'];
- $db->sql_query($sql);
- $this->data['session_viewonline'] = 0;
- }
- }
- }
-
-
- // Does the user need to change their password? If so, redirect to the
- // ucp profile reg_details page ... of course do not redirect if we're already in the ucp
- if (!defined('IN_ADMIN') && !defined('ADMIN_START') && $config['chg_passforce'] && !empty($this->data['is_registered']) && $auth->acl_get('u_chgpasswd') && $this->data['user_passchg'] < time() - ($config['chg_passforce'] * 86400))
- {
- if (strpos($this->page['query_string'], 'mode=reg_details') === false && $this->page['page_name'] != "ucp.$phpEx")
- {
- redirect(append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=profile&amp;mode=reg_details'));
- }
- }
-
- return;
- }
-
- /**
- * More advanced language substitution
- * Function to mimic sprintf() with the possibility of using phpBB's language system to substitute nullar/singular/plural forms.
- * Params are the language key and the parameters to be substituted.
- * This function/functionality is inspired by SHS` and Ashe.
- *
- * Example call: <samp>$user->lang('NUM_POSTS_IN_QUEUE', 1);</samp>
- */
- function lang()
- {
- $args = func_get_args();
- $key = $args[0];
-
- if (is_array($key))
- {
- $lang = &$this->lang[array_shift($key)];
-
- foreach ($key as $_key)
- {
- $lang = &$lang[$_key];
- }
- }
- else
- {
- $lang = &$this->lang[$key];
- }
-
- // Return if language string does not exist
- if (!isset($lang) || (!is_string($lang) && !is_array($lang)))
- {
- return $key;
- }
-
- // If the language entry is a string, we simply mimic sprintf() behaviour
- if (is_string($lang))
- {
- if (sizeof($args) == 1)
- {
- return $lang;
- }
-
- // Replace key with language entry and simply pass along...
- $args[0] = $lang;
- return call_user_func_array('sprintf', $args);
- }
-
- // It is an array... now handle different nullar/singular/plural forms
- $key_found = false;
-
- // We now get the first number passed and will select the key based upon this number
- for ($i = 1, $num_args = sizeof($args); $i < $num_args; $i++)
- {
- if (is_int($args[$i]))
- {
- $numbers = array_keys($lang);
-
- foreach ($numbers as $num)
- {
- if ($num > $args[$i])
- {
- break;
- }
-
- $key_found = $num;
- }
- break;
- }
- }
-
- // Ok, let's check if the key was found, else use the last entry (because it is mostly the plural form)
- if ($key_found === false)
- {
- $numbers = array_keys($lang);
- $key_found = end($numbers);
- }
-
- // Use the language string we determined and pass it to sprintf()
- $args[0] = $lang[$key_found];
- return call_user_func_array('sprintf', $args);
- }
-
- /**
- * Add Language Items - use_db and use_help are assigned where needed (only use them to force inclusion)
- *
- * @param mixed $lang_set specifies the language entries to include
- * @param bool $use_db internal variable for recursion, do not use
- * @param bool $use_help internal variable for recursion, do not use
- *
- * Examples:
- * <code>
- * $lang_set = array('posting', 'help' => 'faq');
- * $lang_set = array('posting', 'viewtopic', 'help' => array('bbcode', 'faq'))
- * $lang_set = array(array('posting', 'viewtopic'), 'help' => array('bbcode', 'faq'))
- * $lang_set = 'posting'
- * $lang_set = array('help' => 'faq', 'db' => array('help:faq', 'posting'))
- * </code>
- */
- function add_lang($lang_set, $use_db = false, $use_help = false)
- {
- global $phpEx;
-
- if (is_array($lang_set))
- {
- foreach ($lang_set as $key => $lang_file)
- {
- // Please do not delete this line.
- // We have to force the type here, else [array] language inclusion will not work
- $key = (string) $key;
-
- if ($key == 'db')
- {
- $this->add_lang($lang_file, true, $use_help);
- }
- else if ($key == 'help')
- {
- $this->add_lang($lang_file, $use_db, true);
- }
- else if (!is_array($lang_file))
- {
- $this->set_lang($this->lang, $this->help, $lang_file, $use_db, $use_help);
- }
- else
- {
- $this->add_lang($lang_file, $use_db, $use_help);
- }
- }
- unset($lang_set);
- }
- else if ($lang_set)
- {
- $this->set_lang($this->lang, $this->help, $lang_set, $use_db, $use_help);
- }
- }
-
- /**
- * Set language entry (called by add_lang)
- * @access private
- */
- function set_lang(&$lang, &$help, $lang_file, $use_db = false, $use_help = false)
- {
- global $phpEx;
-
- // Make sure the language name is set (if the user setup did not happen it is not set)
- if (!$this->lang_name)
- {
- global $config;
- $this->lang_name = basename($config['default_lang']);
- }
-
- // $lang == $this->lang
- // $help == $this->help
- // - add appropriate variables here, name them as they are used within the language file...
- if (!$use_db)
- {
- if ($use_help && strpos($lang_file, '/') !== false)
- {
- $language_filename = $this->lang_path . $this->lang_name . '/' . substr($lang_file, 0, stripos($lang_file, '/') + 1) . 'help_' . substr($lang_file, stripos($lang_file, '/') + 1) . '.' . $phpEx;
- }
- else
- {
- $language_filename = $this->lang_path . $this->lang_name . '/' . (($use_help) ? 'help_' : '') . $lang_file . '.' . $phpEx;
- }
-
- if (!file_exists($language_filename))
- {
- global $config;
-
- if ($this->lang_name == 'en')
- {
- // The user's selected language is missing the file, the board default's language is missing the file, and the file doesn't exist in /en.
- $language_filename = str_replace($this->lang_path . 'en', $this->lang_path . $this->data['user_lang'], $language_filename);
- trigger_error('Language file ' . $language_filename . ' couldn\'t be opened.', E_USER_ERROR);
- }
- else if ($this->lang_name == basename($config['default_lang']))
- {
- // Fall back to the English Language
- $this->lang_name = 'en';
- $this->set_lang($lang, $help, $lang_file, $use_db, $use_help);
- }
- else if ($this->lang_name == $this->data['user_lang'])
- {
- // Fall back to the board default language
- $this->lang_name = basename($config['default_lang']);
- $this->set_lang($lang, $help, $lang_file, $use_db, $use_help);
- }
-
- // Reset the lang name
- $this->lang_name = (file_exists($this->lang_path . $this->data['user_lang'] . "/common.$phpEx")) ? $this->data['user_lang'] : basename($config['default_lang']);
- return;
- }
-
- // Do not suppress error if in DEBUG_EXTRA mode
- $include_result = (defined('DEBUG_EXTRA')) ? (include $language_filename) : (@include $language_filename);
-
- if ($include_result === false)
- {
- trigger_error('Language file ' . $language_filename . ' couldn\'t be opened.', E_USER_ERROR);
- }
- }
- else if ($use_db)
- {
- // Get Database Language Strings
- // Put them into $lang if nothing is prefixed, put them into $help if help: is prefixed
- // For example: help:faq, posting
- }
- }
-
- /**
- * Format user date
- *
- * @param int $gmepoch unix timestamp
- * @param string $format date format in date() notation. | used to indicate relative dates, for example |d m Y|, h:i is translated to Today, h:i.
- * @param bool $forcedate force non-relative date format.
- *
- * @return mixed translated date
- */
- function format_date($gmepoch, $format = false, $forcedate = false)
- {
- static $midnight;
- static $date_cache;
-
- $format = (!$format) ? $this->date_format : $format;
- $now = time();
- $delta = $now - $gmepoch;
-
- if (!isset($date_cache[$format]))
- {
- // Is the user requesting a friendly date format (i.e. 'Today 12:42')?
- $date_cache[$format] = array(
- 'is_short' => strpos($format, '|'),
- 'format_short' => substr($format, 0, strpos($format, '|')) . '||' . substr(strrchr($format, '|'), 1),
- 'format_long' => str_replace('|', '', $format),
- // Filter out values that are not strings (e.g. arrays) for strtr().
- 'lang' => array_filter($this->lang['datetime'], 'is_string'),
- );
-
- // Short representation of month in format? Some languages use different terms for the long and short format of May
- if ((strpos($format, '\M') === false && strpos($format, 'M') !== false) || (strpos($format, '\r') === false && strpos($format, 'r') !== false))
- {
- $date_cache[$format]['lang']['May'] = $this->lang['datetime']['May_short'];
- }
- }
-
- // Zone offset
- $zone_offset = $this->timezone + $this->dst;
-
- // Show date <= 1 hour ago as 'xx min ago' but not greater than 60 seconds in the future
- // A small tolerence is given for times in the future but in the same minute are displayed as '< than a minute ago'
- if ($delta <= 3600 && $delta > -60 && ($delta >= -5 || (($now / 60) % 60) == (($gmepoch / 60) % 60)) && $date_cache[$format]['is_short'] !== false && !$forcedate && isset($this->lang['datetime']['AGO']))
- {
- return $this->lang(array('datetime', 'AGO'), max(0, (int) floor($delta / 60)));
- }
-
- if (!$midnight)
- {
- list($d, $m, $y) = explode(' ', gmdate('j n Y', time() + $zone_offset));
- $midnight = gmmktime(0, 0, 0, $m, $d, $y) - $zone_offset;
- }
-
- if ($date_cache[$format]['is_short'] !== false && !$forcedate && !($gmepoch < $midnight - 86400 || $gmepoch > $midnight + 172800))
- {
- $day = false;
-
- if ($gmepoch > $midnight + 86400)
- {
- $day = 'TOMORROW';
- }
- else if ($gmepoch > $midnight)
- {
- $day = 'TODAY';
- }
- else if ($gmepoch > $midnight - 86400)
- {
- $day = 'YESTERDAY';
- }
-
- if ($day !== false)
- {
- return str_replace('||', $this->lang['datetime'][$day], strtr(@gmdate($date_cache[$format]['format_short'], $gmepoch + $zone_offset), $date_cache[$format]['lang']));
- }
- }
-
- return strtr(@gmdate($date_cache[$format]['format_long'], $gmepoch + $zone_offset), $date_cache[$format]['lang']);
- }
-
- /**
- * Get language id currently used by the user
- */
- function get_iso_lang_id()
- {
- global $config, $db;
-
- if (!empty($this->lang_id))
- {
- return $this->lang_id;
- }
-
- if (!$this->lang_name)
- {
- $this->lang_name = $config['default_lang'];
- }
-
- $sql = 'SELECT lang_id
- FROM ' . LANG_TABLE . "
- WHERE lang_iso = '" . $db->sql_escape($this->lang_name) . "'";
- $result = $db->sql_query($sql);
- $this->lang_id = (int) $db->sql_fetchfield('lang_id');
- $db->sql_freeresult($result);
-
- return $this->lang_id;
- }
-
- /**
- * Get users profile fields
- */
- function get_profile_fields($user_id)
- {
- global $db;
-
- if (isset($this->profile_fields))
- {
- return;
- }
-
- $sql = 'SELECT *
- FROM ' . PROFILE_FIELDS_DATA_TABLE . "
- WHERE user_id = $user_id";
- $result = $db->sql_query_limit($sql, 1);
- $this->profile_fields = (!($row = $db->sql_fetchrow($result))) ? array() : $row;
- $db->sql_freeresult($result);
- }
-
- /**
- * Specify/Get image
- * $suffix is no longer used - we know it. ;) It is there for backward compatibility.
- */
- function img($img, $alt = '', $width = false, $suffix = '', $type = 'full_tag')
- {
- static $imgs;
- global $phpbb_root_path;
-
- $img_data = &$imgs[$img];
-
- if (empty($img_data))
- {
- if (!isset($this->img_array[$img]))
- {
- // Do not fill the image to let designers decide what to do if the image is empty
- $img_data = '';
- return $img_data;
- }
-
- // Use URL if told so
- $root_path = (defined('PHPBB_USE_BOARD_URL_PATH') && PHPBB_USE_BOARD_URL_PATH) ? generate_board_url() . '/' : $phpbb_root_path;
-
- $path = 'styles/' . rawurlencode($this->theme['imageset_path']) . '/imageset/' . ($this->img_array[$img]['image_lang'] ? $this->img_array[$img]['image_lang'] .'/' : '') . $this->img_array[$img]['image_filename'];
-
- $img_data['src'] = $root_path . $path;
- $img_data['width'] = $this->img_array[$img]['image_width'];
- $img_data['height'] = $this->img_array[$img]['image_height'];
-
- // We overwrite the width and height to the phpbb logo's width
- // and height here if the contents of the site_logo file are
- // really equal to the phpbb_logo
- // This allows us to change the dimensions of the phpbb_logo without
- // modifying the imageset.cfg and causing a conflict for everyone
- // who modified it for their custom logo on updating
- if ($img == 'site_logo' && file_exists($phpbb_root_path . $path))
- {
- global $cache;
-
- $img_file_hashes = $cache->get('imageset_site_logo_md5');
-
- if ($img_file_hashes === false)
- {
- $img_file_hashes = array();
- }
-
- $key = $this->theme['imageset_path'] . '::' . $this->img_array[$img]['image_lang'];
- if (!isset($img_file_hashes[$key]))
- {
- $img_file_hashes[$key] = md5(file_get_contents($phpbb_root_path . $path));
- $cache->put('imageset_site_logo_md5', $img_file_hashes);
- }
-
- $phpbb_logo_hash = '0c461a32cd3621643105f0d02a772c10';
-
- if ($phpbb_logo_hash == $img_file_hashes[$key])
- {
- $img_data['width'] = '149';
- $img_data['height'] = '52';
- }
- }
- }
-
- $alt = (!empty($this->lang[$alt])) ? $this->lang[$alt] : $alt;
-
- switch ($type)
- {
- case 'src':
- return $img_data['src'];
- break;
-
- case 'width':
- return ($width === false) ? $img_data['width'] : $width;
- break;
-
- case 'height':
- return $img_data['height'];
- break;
-
- default:
- $use_width = ($width === false) ? $img_data['width'] : $width;
-
- return '<img src="' . $img_data['src'] . '"' . (($use_width) ? ' width="' . $use_width . '"' : '') . (($img_data['height']) ? ' height="' . $img_data['height'] . '"' : '') . ' alt="' . $alt . '" title="' . $alt . '" />';
- break;
- }
- }
-
- /**
- * Get option bit field from user options.
- *
- * @param int $key option key, as defined in $keyoptions property.
- * @param int $data bit field value to use, or false to use $this->data['user_options']
- * @return bool true if the option is set in the bit field, false otherwise
- */
- function optionget($key, $data = false)
- {
- $var = ($data !== false) ? $data : $this->data['user_options'];
- return phpbb_optionget($this->keyoptions[$key], $var);
- }
-
- /**
- * Set option bit field for user options.
- *
- * @param int $key Option key, as defined in $keyoptions property.
- * @param bool $value True to set the option, false to clear the option.
- * @param int $data Current bit field value, or false to use $this->data['user_options']
- * @return int|bool If $data is false, the bit field is modified and
- * written back to $this->data['user_options'], and
- * return value is true if the bit field changed and
- * false otherwise. If $data is not false, the new
- * bitfield value is returned.
- */
- function optionset($key, $value, $data = false)
- {
- $var = ($data !== false) ? $data : $this->data['user_options'];
-
- $new_var = phpbb_optionset($this->keyoptions[$key], $value, $var);
-
- if ($data === false)
- {
- if ($new_var != $var)
- {
- $this->data['user_options'] = $new_var;
- return true;
- }
- else
- {
- return false;
- }
- }
- else
- {
- return $new_var;
- }
- }
-
- /**
- * Funtion to make the user leave the NEWLY_REGISTERED system group.
- * @access public
- */
- function leave_newly_registered()
- {
- global $db;
-
- if (empty($this->data['user_new']))
- {
- return false;
- }
-
- if (!function_exists('remove_newly_registered'))
- {
- global $phpbb_root_path, $phpEx;
-
- include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
- }
- if ($group = remove_newly_registered($this->data['user_id'], $this->data))
- {
- $this->data['group_id'] = $group;
-
- }
- $this->data['user_permissions'] = '';
- $this->data['user_new'] = 0;
-
- return true;
- }
-
- /**
- * Returns all password protected forum ids the user is currently NOT authenticated for.
- *
- * @return array Array of forum ids
- * @access public
- */
- function get_passworded_forums()
- {
- global $db;
-
- $sql = 'SELECT f.forum_id, fa.user_id
- FROM ' . FORUMS_TABLE . ' f
- LEFT JOIN ' . FORUMS_ACCESS_TABLE . " fa
- ON (fa.forum_id = f.forum_id
- AND fa.session_id = '" . $db->sql_escape($this->session_id) . "')
- WHERE f.forum_password <> ''";
- $result = $db->sql_query($sql);
-
- $forum_ids = array();
- while ($row = $db->sql_fetchrow($result))
- {
- $forum_id = (int) $row['forum_id'];
-
- if ($row['user_id'] != $this->data['user_id'])
- {
- $forum_ids[$forum_id] = $forum_id;
- }
- }
- $db->sql_freeresult($result);
-
- return $forum_ids;
- }
-}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/sphinxapi.php b/phpBB/includes/sphinxapi.php
new file mode 100644
index 0000000000..6c3b66710c
--- /dev/null
+++ b/phpBB/includes/sphinxapi.php
@@ -0,0 +1,1712 @@
+<?php
+
+//
+// $Id: sphinxapi.php 3087 2012-01-30 23:07:35Z shodan $
+//
+
+//
+// Copyright (c) 2001-2012, Andrew Aksyonoff
+// Copyright (c) 2008-2012, Sphinx Technologies Inc
+// All rights reserved
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License. You should have
+// received a copy of the GPL license along with this program; if you
+// did not, you can find it at http://www.gnu.org/
+//
+
+/////////////////////////////////////////////////////////////////////////////
+// PHP version of Sphinx searchd client (PHP API)
+/////////////////////////////////////////////////////////////////////////////
+
+/// known searchd commands
+define ( "SEARCHD_COMMAND_SEARCH", 0 );
+define ( "SEARCHD_COMMAND_EXCERPT", 1 );
+define ( "SEARCHD_COMMAND_UPDATE", 2 );
+define ( "SEARCHD_COMMAND_KEYWORDS", 3 );
+define ( "SEARCHD_COMMAND_PERSIST", 4 );
+define ( "SEARCHD_COMMAND_STATUS", 5 );
+define ( "SEARCHD_COMMAND_FLUSHATTRS", 7 );
+
+/// current client-side command implementation versions
+define ( "VER_COMMAND_SEARCH", 0x119 );
+define ( "VER_COMMAND_EXCERPT", 0x104 );
+define ( "VER_COMMAND_UPDATE", 0x102 );
+define ( "VER_COMMAND_KEYWORDS", 0x100 );
+define ( "VER_COMMAND_STATUS", 0x100 );
+define ( "VER_COMMAND_QUERY", 0x100 );
+define ( "VER_COMMAND_FLUSHATTRS", 0x100 );
+
+/// known searchd status codes
+define ( "SEARCHD_OK", 0 );
+define ( "SEARCHD_ERROR", 1 );
+define ( "SEARCHD_RETRY", 2 );
+define ( "SEARCHD_WARNING", 3 );
+
+/// known match modes
+define ( "SPH_MATCH_ALL", 0 );
+define ( "SPH_MATCH_ANY", 1 );
+define ( "SPH_MATCH_PHRASE", 2 );
+define ( "SPH_MATCH_BOOLEAN", 3 );
+define ( "SPH_MATCH_EXTENDED", 4 );
+define ( "SPH_MATCH_FULLSCAN", 5 );
+define ( "SPH_MATCH_EXTENDED2", 6 ); // extended engine V2 (TEMPORARY, WILL BE REMOVED)
+
+/// known ranking modes (ext2 only)
+define ( "SPH_RANK_PROXIMITY_BM25", 0 ); ///< default mode, phrase proximity major factor and BM25 minor one
+define ( "SPH_RANK_BM25", 1 ); ///< statistical mode, BM25 ranking only (faster but worse quality)
+define ( "SPH_RANK_NONE", 2 ); ///< no ranking, all matches get a weight of 1
+define ( "SPH_RANK_WORDCOUNT", 3 ); ///< simple word-count weighting, rank is a weighted sum of per-field keyword occurence counts
+define ( "SPH_RANK_PROXIMITY", 4 );
+define ( "SPH_RANK_MATCHANY", 5 );
+define ( "SPH_RANK_FIELDMASK", 6 );
+define ( "SPH_RANK_SPH04", 7 );
+define ( "SPH_RANK_EXPR", 8 );
+define ( "SPH_RANK_TOTAL", 9 );
+
+/// known sort modes
+define ( "SPH_SORT_RELEVANCE", 0 );
+define ( "SPH_SORT_ATTR_DESC", 1 );
+define ( "SPH_SORT_ATTR_ASC", 2 );
+define ( "SPH_SORT_TIME_SEGMENTS", 3 );
+define ( "SPH_SORT_EXTENDED", 4 );
+define ( "SPH_SORT_EXPR", 5 );
+
+/// known filter types
+define ( "SPH_FILTER_VALUES", 0 );
+define ( "SPH_FILTER_RANGE", 1 );
+define ( "SPH_FILTER_FLOATRANGE", 2 );
+
+/// known attribute types
+define ( "SPH_ATTR_INTEGER", 1 );
+define ( "SPH_ATTR_TIMESTAMP", 2 );
+define ( "SPH_ATTR_ORDINAL", 3 );
+define ( "SPH_ATTR_BOOL", 4 );
+define ( "SPH_ATTR_FLOAT", 5 );
+define ( "SPH_ATTR_BIGINT", 6 );
+define ( "SPH_ATTR_STRING", 7 );
+define ( "SPH_ATTR_MULTI", 0x40000001 );
+define ( "SPH_ATTR_MULTI64", 0x40000002 );
+
+/// known grouping functions
+define ( "SPH_GROUPBY_DAY", 0 );
+define ( "SPH_GROUPBY_WEEK", 1 );
+define ( "SPH_GROUPBY_MONTH", 2 );
+define ( "SPH_GROUPBY_YEAR", 3 );
+define ( "SPH_GROUPBY_ATTR", 4 );
+define ( "SPH_GROUPBY_ATTRPAIR", 5 );
+
+// important properties of PHP's integers:
+// - always signed (one bit short of PHP_INT_SIZE)
+// - conversion from string to int is saturated
+// - float is double
+// - div converts arguments to floats
+// - mod converts arguments to ints
+
+// the packing code below works as follows:
+// - when we got an int, just pack it
+// if performance is a problem, this is the branch users should aim for
+//
+// - otherwise, we got a number in string form
+// this might be due to different reasons, but we assume that this is
+// because it didn't fit into PHP int
+//
+// - factor the string into high and low ints for packing
+// - if we have bcmath, then it is used
+// - if we don't, we have to do it manually (this is the fun part)
+//
+// - x64 branch does factoring using ints
+// - x32 (ab)uses floats, since we can't fit unsigned 32-bit number into an int
+//
+// unpacking routines are pretty much the same.
+// - return ints if we can
+// - otherwise format number into a string
+
+/// pack 64-bit signed
+function sphPackI64 ( $v )
+{
+ assert ( is_numeric($v) );
+
+ // x64
+ if ( PHP_INT_SIZE>=8 )
+ {
+ $v = (int)$v;
+ return pack ( "NN", $v>>32, $v&0xFFFFFFFF );
+ }
+
+ // x32, int
+ if ( is_int($v) )
+ return pack ( "NN", $v < 0 ? -1 : 0, $v );
+
+ // x32, bcmath
+ if ( function_exists("bcmul") )
+ {
+ if ( bccomp ( $v, 0 ) == -1 )
+ $v = bcadd ( "18446744073709551616", $v );
+ $h = bcdiv ( $v, "4294967296", 0 );
+ $l = bcmod ( $v, "4294967296" );
+ return pack ( "NN", (float)$h, (float)$l ); // conversion to float is intentional; int would lose 31st bit
+ }
+
+ // x32, no-bcmath
+ $p = max(0, strlen($v) - 13);
+ $lo = abs((float)substr($v, $p));
+ $hi = abs((float)substr($v, 0, $p));
+
+ $m = $lo + $hi*1316134912.0; // (10 ^ 13) % (1 << 32) = 1316134912
+ $q = floor($m/4294967296.0);
+ $l = $m - ($q*4294967296.0);
+ $h = $hi*2328.0 + $q; // (10 ^ 13) / (1 << 32) = 2328
+
+ if ( $v<0 )
+ {
+ if ( $l==0 )
+ $h = 4294967296.0 - $h;
+ else
+ {
+ $h = 4294967295.0 - $h;
+ $l = 4294967296.0 - $l;
+ }
+ }
+ return pack ( "NN", $h, $l );
+}
+
+/// pack 64-bit unsigned
+function sphPackU64 ( $v )
+{
+ assert ( is_numeric($v) );
+
+ // x64
+ if ( PHP_INT_SIZE>=8 )
+ {
+ assert ( $v>=0 );
+
+ // x64, int
+ if ( is_int($v) )
+ return pack ( "NN", $v>>32, $v&0xFFFFFFFF );
+
+ // x64, bcmath
+ if ( function_exists("bcmul") )
+ {
+ $h = bcdiv ( $v, 4294967296, 0 );
+ $l = bcmod ( $v, 4294967296 );
+ return pack ( "NN", $h, $l );
+ }
+
+ // x64, no-bcmath
+ $p = max ( 0, strlen($v) - 13 );
+ $lo = (int)substr ( $v, $p );
+ $hi = (int)substr ( $v, 0, $p );
+
+ $m = $lo + $hi*1316134912;
+ $l = $m % 4294967296;
+ $h = $hi*2328 + (int)($m/4294967296);
+
+ return pack ( "NN", $h, $l );
+ }
+
+ // x32, int
+ if ( is_int($v) )
+ return pack ( "NN", 0, $v );
+
+ // x32, bcmath
+ if ( function_exists("bcmul") )
+ {
+ $h = bcdiv ( $v, "4294967296", 0 );
+ $l = bcmod ( $v, "4294967296" );
+ return pack ( "NN", (float)$h, (float)$l ); // conversion to float is intentional; int would lose 31st bit
+ }
+
+ // x32, no-bcmath
+ $p = max(0, strlen($v) - 13);
+ $lo = (float)substr($v, $p);
+ $hi = (float)substr($v, 0, $p);
+
+ $m = $lo + $hi*1316134912.0;
+ $q = floor($m / 4294967296.0);
+ $l = $m - ($q * 4294967296.0);
+ $h = $hi*2328.0 + $q;
+
+ return pack ( "NN", $h, $l );
+}
+
+// unpack 64-bit unsigned
+function sphUnpackU64 ( $v )
+{
+ list ( $hi, $lo ) = array_values ( unpack ( "N*N*", $v ) );
+
+ if ( PHP_INT_SIZE>=8 )
+ {
+ if ( $hi<0 ) $hi += (1<<32); // because php 5.2.2 to 5.2.5 is totally fucked up again
+ if ( $lo<0 ) $lo += (1<<32);
+
+ // x64, int
+ if ( $hi<=2147483647 )
+ return ($hi<<32) + $lo;
+
+ // x64, bcmath
+ if ( function_exists("bcmul") )
+ return bcadd ( $lo, bcmul ( $hi, "4294967296" ) );
+
+ // x64, no-bcmath
+ $C = 100000;
+ $h = ((int)($hi / $C) << 32) + (int)($lo / $C);
+ $l = (($hi % $C) << 32) + ($lo % $C);
+ if ( $l>$C )
+ {
+ $h += (int)($l / $C);
+ $l = $l % $C;
+ }
+
+ if ( $h==0 )
+ return $l;
+ return sprintf ( "%d%05d", $h, $l );
+ }
+
+ // x32, int
+ if ( $hi==0 )
+ {
+ if ( $lo>0 )
+ return $lo;
+ return sprintf ( "%u", $lo );
+ }
+
+ $hi = sprintf ( "%u", $hi );
+ $lo = sprintf ( "%u", $lo );
+
+ // x32, bcmath
+ if ( function_exists("bcmul") )
+ return bcadd ( $lo, bcmul ( $hi, "4294967296" ) );
+
+ // x32, no-bcmath
+ $hi = (float)$hi;
+ $lo = (float)$lo;
+
+ $q = floor($hi/10000000.0);
+ $r = $hi - $q*10000000.0;
+ $m = $lo + $r*4967296.0;
+ $mq = floor($m/10000000.0);
+ $l = $m - $mq*10000000.0;
+ $h = $q*4294967296.0 + $r*429.0 + $mq;
+
+ $h = sprintf ( "%.0f", $h );
+ $l = sprintf ( "%07.0f", $l );
+ if ( $h=="0" )
+ return sprintf( "%.0f", (float)$l );
+ return $h . $l;
+}
+
+// unpack 64-bit signed
+function sphUnpackI64 ( $v )
+{
+ list ( $hi, $lo ) = array_values ( unpack ( "N*N*", $v ) );
+
+ // x64
+ if ( PHP_INT_SIZE>=8 )
+ {
+ if ( $hi<0 ) $hi += (1<<32); // because php 5.2.2 to 5.2.5 is totally fucked up again
+ if ( $lo<0 ) $lo += (1<<32);
+
+ return ($hi<<32) + $lo;
+ }
+
+ // x32, int
+ if ( $hi==0 )
+ {
+ if ( $lo>0 )
+ return $lo;
+ return sprintf ( "%u", $lo );
+ }
+ // x32, int
+ elseif ( $hi==-1 )
+ {
+ if ( $lo<0 )
+ return $lo;
+ return sprintf ( "%.0f", $lo - 4294967296.0 );
+ }
+
+ $neg = "";
+ $c = 0;
+ if ( $hi<0 )
+ {
+ $hi = ~$hi;
+ $lo = ~$lo;
+ $c = 1;
+ $neg = "-";
+ }
+
+ $hi = sprintf ( "%u", $hi );
+ $lo = sprintf ( "%u", $lo );
+
+ // x32, bcmath
+ if ( function_exists("bcmul") )
+ return $neg . bcadd ( bcadd ( $lo, bcmul ( $hi, "4294967296" ) ), $c );
+
+ // x32, no-bcmath
+ $hi = (float)$hi;
+ $lo = (float)$lo;
+
+ $q = floor($hi/10000000.0);
+ $r = $hi - $q*10000000.0;
+ $m = $lo + $r*4967296.0;
+ $mq = floor($m/10000000.0);
+ $l = $m - $mq*10000000.0 + $c;
+ $h = $q*4294967296.0 + $r*429.0 + $mq;
+ if ( $l==10000000 )
+ {
+ $l = 0;
+ $h += 1;
+ }
+
+ $h = sprintf ( "%.0f", $h );
+ $l = sprintf ( "%07.0f", $l );
+ if ( $h=="0" )
+ return $neg . sprintf( "%.0f", (float)$l );
+ return $neg . $h . $l;
+}
+
+
+function sphFixUint ( $value )
+{
+ if ( PHP_INT_SIZE>=8 )
+ {
+ // x64 route, workaround broken unpack() in 5.2.2+
+ if ( $value<0 ) $value += (1<<32);
+ return $value;
+ }
+ else
+ {
+ // x32 route, workaround php signed/unsigned braindamage
+ return sprintf ( "%u", $value );
+ }
+}
+
+
+/// sphinx searchd client class
+class SphinxClient
+{
+ var $_host; ///< searchd host (default is "localhost")
+ var $_port; ///< searchd port (default is 9312)
+ var $_offset; ///< how many records to seek from result-set start (default is 0)
+ var $_limit; ///< how many records to return from result-set starting at offset (default is 20)
+ var $_mode; ///< query matching mode (default is SPH_MATCH_ALL)
+ var $_weights; ///< per-field weights (default is 1 for all fields)
+ var $_sort; ///< match sorting mode (default is SPH_SORT_RELEVANCE)
+ var $_sortby; ///< attribute to sort by (defualt is "")
+ var $_min_id; ///< min ID to match (default is 0, which means no limit)
+ var $_max_id; ///< max ID to match (default is 0, which means no limit)
+ var $_filters; ///< search filters
+ var $_groupby; ///< group-by attribute name
+ var $_groupfunc; ///< group-by function (to pre-process group-by attribute value with)
+ var $_groupsort; ///< group-by sorting clause (to sort groups in result set with)
+ var $_groupdistinct;///< group-by count-distinct attribute
+ var $_maxmatches; ///< max matches to retrieve
+ var $_cutoff; ///< cutoff to stop searching at (default is 0)
+ var $_retrycount; ///< distributed retries count
+ var $_retrydelay; ///< distributed retries delay
+ var $_anchor; ///< geographical anchor point
+ var $_indexweights; ///< per-index weights
+ var $_ranker; ///< ranking mode (default is SPH_RANK_PROXIMITY_BM25)
+ var $_rankexpr; ///< ranking mode expression (for SPH_RANK_EXPR)
+ var $_maxquerytime; ///< max query time, milliseconds (default is 0, do not limit)
+ var $_fieldweights; ///< per-field-name weights
+ var $_overrides; ///< per-query attribute values overrides
+ var $_select; ///< select-list (attributes or expressions, with optional aliases)
+
+ var $_error; ///< last error message
+ var $_warning; ///< last warning message
+ var $_connerror; ///< connection error vs remote error flag
+
+ var $_reqs; ///< requests array for multi-query
+ var $_mbenc; ///< stored mbstring encoding
+ var $_arrayresult; ///< whether $result["matches"] should be a hash or an array
+ var $_timeout; ///< connect timeout
+
+ /////////////////////////////////////////////////////////////////////////////
+ // common stuff
+ /////////////////////////////////////////////////////////////////////////////
+
+ /// create a new client object and fill defaults
+ function SphinxClient ()
+ {
+ // per-client-object settings
+ $this->_host = "localhost";
+ $this->_port = 9312;
+ $this->_path = false;
+ $this->_socket = false;
+
+ // per-query settings
+ $this->_offset = 0;
+ $this->_limit = 20;
+ $this->_mode = SPH_MATCH_ALL;
+ $this->_weights = array ();
+ $this->_sort = SPH_SORT_RELEVANCE;
+ $this->_sortby = "";
+ $this->_min_id = 0;
+ $this->_max_id = 0;
+ $this->_filters = array ();
+ $this->_groupby = "";
+ $this->_groupfunc = SPH_GROUPBY_DAY;
+ $this->_groupsort = "@group desc";
+ $this->_groupdistinct= "";
+ $this->_maxmatches = 1000;
+ $this->_cutoff = 0;
+ $this->_retrycount = 0;
+ $this->_retrydelay = 0;
+ $this->_anchor = array ();
+ $this->_indexweights= array ();
+ $this->_ranker = SPH_RANK_PROXIMITY_BM25;
+ $this->_rankexpr = "";
+ $this->_maxquerytime= 0;
+ $this->_fieldweights= array();
+ $this->_overrides = array();
+ $this->_select = "*";
+
+ $this->_error = ""; // per-reply fields (for single-query case)
+ $this->_warning = "";
+ $this->_connerror = false;
+
+ $this->_reqs = array (); // requests storage (for multi-query case)
+ $this->_mbenc = "";
+ $this->_arrayresult = false;
+ $this->_timeout = 0;
+ }
+
+ function __destruct()
+ {
+ if ( $this->_socket !== false )
+ fclose ( $this->_socket );
+ }
+
+ /// get last error message (string)
+ function GetLastError ()
+ {
+ return $this->_error;
+ }
+
+ /// get last warning message (string)
+ function GetLastWarning ()
+ {
+ return $this->_warning;
+ }
+
+ /// get last error flag (to tell network connection errors from searchd errors or broken responses)
+ function IsConnectError()
+ {
+ return $this->_connerror;
+ }
+
+ /// set searchd host name (string) and port (integer)
+ function SetServer ( $host, $port = 0 )
+ {
+ assert ( is_string($host) );
+ if ( $host[0] == '/')
+ {
+ $this->_path = 'unix://' . $host;
+ return;
+ }
+ if ( substr ( $host, 0, 7 )=="unix://" )
+ {
+ $this->_path = $host;
+ return;
+ }
+
+ assert ( is_int($port) );
+ $this->_host = $host;
+ $this->_port = $port;
+ $this->_path = '';
+
+ }
+
+ /// set server connection timeout (0 to remove)
+ function SetConnectTimeout ( $timeout )
+ {
+ assert ( is_numeric($timeout) );
+ $this->_timeout = $timeout;
+ }
+
+
+ function _Send ( $handle, $data, $length )
+ {
+ if ( feof($handle) || fwrite ( $handle, $data, $length ) !== $length )
+ {
+ $this->_error = 'connection unexpectedly closed (timed out?)';
+ $this->_connerror = true;
+ return false;
+ }
+ return true;
+ }
+
+ /////////////////////////////////////////////////////////////////////////////
+
+ /// enter mbstring workaround mode
+ function _MBPush ()
+ {
+ $this->_mbenc = "";
+ if ( ini_get ( "mbstring.func_overload" ) & 2 )
+ {
+ $this->_mbenc = mb_internal_encoding();
+ mb_internal_encoding ( "latin1" );
+ }
+ }
+
+ /// leave mbstring workaround mode
+ function _MBPop ()
+ {
+ if ( $this->_mbenc )
+ mb_internal_encoding ( $this->_mbenc );
+ }
+
+ /// connect to searchd server
+ function _Connect ()
+ {
+ if ( $this->_socket!==false )
+ {
+ // we are in persistent connection mode, so we have a socket
+ // however, need to check whether it's still alive
+ if ( !@feof ( $this->_socket ) )
+ return $this->_socket;
+
+ // force reopen
+ $this->_socket = false;
+ }
+
+ $errno = 0;
+ $errstr = "";
+ $this->_connerror = false;
+
+ if ( $this->_path )
+ {
+ $host = $this->_path;
+ $port = 0;
+ }
+ else
+ {
+ $host = $this->_host;
+ $port = $this->_port;
+ }
+
+ if ( $this->_timeout<=0 )
+ $fp = @fsockopen ( $host, $port, $errno, $errstr );
+ else
+ $fp = @fsockopen ( $host, $port, $errno, $errstr, $this->_timeout );
+
+ if ( !$fp )
+ {
+ if ( $this->_path )
+ $location = $this->_path;
+ else
+ $location = "{$this->_host}:{$this->_port}";
+
+ $errstr = trim ( $errstr );
+ $this->_error = "connection to $location failed (errno=$errno, msg=$errstr)";
+ $this->_connerror = true;
+ return false;
+ }
+
+ // send my version
+ // this is a subtle part. we must do it before (!) reading back from searchd.
+ // because otherwise under some conditions (reported on FreeBSD for instance)
+ // TCP stack could throttle write-write-read pattern because of Nagle.
+ if ( !$this->_Send ( $fp, pack ( "N", 1 ), 4 ) )
+ {
+ fclose ( $fp );
+ $this->_error = "failed to send client protocol version";
+ return false;
+ }
+
+ // check version
+ list(,$v) = unpack ( "N*", fread ( $fp, 4 ) );
+ $v = (int)$v;
+ if ( $v<1 )
+ {
+ fclose ( $fp );
+ $this->_error = "expected searchd protocol version 1+, got version '$v'";
+ return false;
+ }
+
+ return $fp;
+ }
+
+ /// get and check response packet from searchd server
+ function _GetResponse ( $fp, $client_ver )
+ {
+ $response = "";
+ $len = 0;
+
+ $header = fread ( $fp, 8 );
+ if ( strlen($header)==8 )
+ {
+ list ( $status, $ver, $len ) = array_values ( unpack ( "n2a/Nb", $header ) );
+ $left = $len;
+ while ( $left>0 && !feof($fp) )
+ {
+ $chunk = fread ( $fp, min ( 8192, $left ) );
+ if ( $chunk )
+ {
+ $response .= $chunk;
+ $left -= strlen($chunk);
+ }
+ }
+ }
+ if ( $this->_socket === false )
+ fclose ( $fp );
+
+ // check response
+ $read = strlen ( $response );
+ if ( !$response || $read!=$len )
+ {
+ $this->_error = $len
+ ? "failed to read searchd response (status=$status, ver=$ver, len=$len, read=$read)"
+ : "received zero-sized searchd response";
+ return false;
+ }
+
+ // check status
+ if ( $status==SEARCHD_WARNING )
+ {
+ list(,$wlen) = unpack ( "N*", substr ( $response, 0, 4 ) );
+ $this->_warning = substr ( $response, 4, $wlen );
+ return substr ( $response, 4+$wlen );
+ }
+ if ( $status==SEARCHD_ERROR )
+ {
+ $this->_error = "searchd error: " . substr ( $response, 4 );
+ return false;
+ }
+ if ( $status==SEARCHD_RETRY )
+ {
+ $this->_error = "temporary searchd error: " . substr ( $response, 4 );
+ return false;
+ }
+ if ( $status!=SEARCHD_OK )
+ {
+ $this->_error = "unknown status code '$status'";
+ return false;
+ }
+
+ // check version
+ if ( $ver<$client_ver )
+ {
+ $this->_warning = sprintf ( "searchd command v.%d.%d older than client's v.%d.%d, some options might not work",
+ $ver>>8, $ver&0xff, $client_ver>>8, $client_ver&0xff );
+ }
+
+ return $response;
+ }
+
+ /////////////////////////////////////////////////////////////////////////////
+ // searching
+ /////////////////////////////////////////////////////////////////////////////
+
+ /// set offset and count into result set,
+ /// and optionally set max-matches and cutoff limits
+ function SetLimits ( $offset, $limit, $max=0, $cutoff=0 )
+ {
+ assert ( is_int($offset) );
+ assert ( is_int($limit) );
+ assert ( $offset>=0 );
+ assert ( $limit>0 );
+ assert ( $max>=0 );
+ $this->_offset = $offset;
+ $this->_limit = $limit;
+ if ( $max>0 )
+ $this->_maxmatches = $max;
+ if ( $cutoff>0 )
+ $this->_cutoff = $cutoff;
+ }
+
+ /// set maximum query time, in milliseconds, per-index
+ /// integer, 0 means "do not limit"
+ function SetMaxQueryTime ( $max )
+ {
+ assert ( is_int($max) );
+ assert ( $max>=0 );
+ $this->_maxquerytime = $max;
+ }
+
+ /// set matching mode
+ function SetMatchMode ( $mode )
+ {
+ assert ( $mode==SPH_MATCH_ALL
+ || $mode==SPH_MATCH_ANY
+ || $mode==SPH_MATCH_PHRASE
+ || $mode==SPH_MATCH_BOOLEAN
+ || $mode==SPH_MATCH_EXTENDED
+ || $mode==SPH_MATCH_FULLSCAN
+ || $mode==SPH_MATCH_EXTENDED2 );
+ $this->_mode = $mode;
+ }
+
+ /// set ranking mode
+ function SetRankingMode ( $ranker, $rankexpr="" )
+ {
+ assert ( $ranker>=0 && $ranker<SPH_RANK_TOTAL );
+ assert ( is_string($rankexpr) );
+ $this->_ranker = $ranker;
+ $this->_rankexpr = $rankexpr;
+ }
+
+ /// set matches sorting mode
+ function SetSortMode ( $mode, $sortby="" )
+ {
+ assert (
+ $mode==SPH_SORT_RELEVANCE ||
+ $mode==SPH_SORT_ATTR_DESC ||
+ $mode==SPH_SORT_ATTR_ASC ||
+ $mode==SPH_SORT_TIME_SEGMENTS ||
+ $mode==SPH_SORT_EXTENDED ||
+ $mode==SPH_SORT_EXPR );
+ assert ( is_string($sortby) );
+ assert ( $mode==SPH_SORT_RELEVANCE || strlen($sortby)>0 );
+
+ $this->_sort = $mode;
+ $this->_sortby = $sortby;
+ }
+
+ /// bind per-field weights by order
+ /// DEPRECATED; use SetFieldWeights() instead
+ function SetWeights ( $weights )
+ {
+ assert ( is_array($weights) );
+ foreach ( $weights as $weight )
+ assert ( is_int($weight) );
+
+ $this->_weights = $weights;
+ }
+
+ /// bind per-field weights by name
+ function SetFieldWeights ( $weights )
+ {
+ assert ( is_array($weights) );
+ foreach ( $weights as $name=>$weight )
+ {
+ assert ( is_string($name) );
+ assert ( is_int($weight) );
+ }
+ $this->_fieldweights = $weights;
+ }
+
+ /// bind per-index weights by name
+ function SetIndexWeights ( $weights )
+ {
+ assert ( is_array($weights) );
+ foreach ( $weights as $index=>$weight )
+ {
+ assert ( is_string($index) );
+ assert ( is_int($weight) );
+ }
+ $this->_indexweights = $weights;
+ }
+
+ /// set IDs range to match
+ /// only match records if document ID is beetwen $min and $max (inclusive)
+ function SetIDRange ( $min, $max )
+ {
+ assert ( is_numeric($min) );
+ assert ( is_numeric($max) );
+ assert ( $min<=$max );
+ $this->_min_id = $min;
+ $this->_max_id = $max;
+ }
+
+ /// set values set filter
+ /// only match records where $attribute value is in given set
+ function SetFilter ( $attribute, $values, $exclude=false )
+ {
+ assert ( is_string($attribute) );
+ assert ( is_array($values) );
+ assert ( count($values) );
+
+ if ( is_array($values) && count($values) )
+ {
+ foreach ( $values as $value )
+ assert ( is_numeric($value) );
+
+ $this->_filters[] = array ( "type"=>SPH_FILTER_VALUES, "attr"=>$attribute, "exclude"=>$exclude, "values"=>$values );
+ }
+ }
+
+ /// set range filter
+ /// only match records if $attribute value is beetwen $min and $max (inclusive)
+ function SetFilterRange ( $attribute, $min, $max, $exclude=false )
+ {
+ assert ( is_string($attribute) );
+ assert ( is_numeric($min) );
+ assert ( is_numeric($max) );
+ assert ( $min<=$max );
+
+ $this->_filters[] = array ( "type"=>SPH_FILTER_RANGE, "attr"=>$attribute, "exclude"=>$exclude, "min"=>$min, "max"=>$max );
+ }
+
+ /// set float range filter
+ /// only match records if $attribute value is beetwen $min and $max (inclusive)
+ function SetFilterFloatRange ( $attribute, $min, $max, $exclude=false )
+ {
+ assert ( is_string($attribute) );
+ assert ( is_float($min) );
+ assert ( is_float($max) );
+ assert ( $min<=$max );
+
+ $this->_filters[] = array ( "type"=>SPH_FILTER_FLOATRANGE, "attr"=>$attribute, "exclude"=>$exclude, "min"=>$min, "max"=>$max );
+ }
+
+ /// setup anchor point for geosphere distance calculations
+ /// required to use @geodist in filters and sorting
+ /// latitude and longitude must be in radians
+ function SetGeoAnchor ( $attrlat, $attrlong, $lat, $long )
+ {
+ assert ( is_string($attrlat) );
+ assert ( is_string($attrlong) );
+ assert ( is_float($lat) );
+ assert ( is_float($long) );
+
+ $this->_anchor = array ( "attrlat"=>$attrlat, "attrlong"=>$attrlong, "lat"=>$lat, "long"=>$long );
+ }
+
+ /// set grouping attribute and function
+ function SetGroupBy ( $attribute, $func, $groupsort="@group desc" )
+ {
+ assert ( is_string($attribute) );
+ assert ( is_string($groupsort) );
+ assert ( $func==SPH_GROUPBY_DAY
+ || $func==SPH_GROUPBY_WEEK
+ || $func==SPH_GROUPBY_MONTH
+ || $func==SPH_GROUPBY_YEAR
+ || $func==SPH_GROUPBY_ATTR
+ || $func==SPH_GROUPBY_ATTRPAIR );
+
+ $this->_groupby = $attribute;
+ $this->_groupfunc = $func;
+ $this->_groupsort = $groupsort;
+ }
+
+ /// set count-distinct attribute for group-by queries
+ function SetGroupDistinct ( $attribute )
+ {
+ assert ( is_string($attribute) );
+ $this->_groupdistinct = $attribute;
+ }
+
+ /// set distributed retries count and delay
+ function SetRetries ( $count, $delay=0 )
+ {
+ assert ( is_int($count) && $count>=0 );
+ assert ( is_int($delay) && $delay>=0 );
+ $this->_retrycount = $count;
+ $this->_retrydelay = $delay;
+ }
+
+ /// set result set format (hash or array; hash by default)
+ /// PHP specific; needed for group-by-MVA result sets that may contain duplicate IDs
+ function SetArrayResult ( $arrayresult )
+ {
+ assert ( is_bool($arrayresult) );
+ $this->_arrayresult = $arrayresult;
+ }
+
+ /// set attribute values override
+ /// there can be only one override per attribute
+ /// $values must be a hash that maps document IDs to attribute values
+ function SetOverride ( $attrname, $attrtype, $values )
+ {
+ assert ( is_string ( $attrname ) );
+ assert ( in_array ( $attrtype, array ( SPH_ATTR_INTEGER, SPH_ATTR_TIMESTAMP, SPH_ATTR_BOOL, SPH_ATTR_FLOAT, SPH_ATTR_BIGINT ) ) );
+ assert ( is_array ( $values ) );
+
+ $this->_overrides[$attrname] = array ( "attr"=>$attrname, "type"=>$attrtype, "values"=>$values );
+ }
+
+ /// set select-list (attributes or expressions), SQL-like syntax
+ function SetSelect ( $select )
+ {
+ assert ( is_string ( $select ) );
+ $this->_select = $select;
+ }
+
+ //////////////////////////////////////////////////////////////////////////////
+
+ /// clear all filters (for multi-queries)
+ function ResetFilters ()
+ {
+ $this->_filters = array();
+ $this->_anchor = array();
+ }
+
+ /// clear groupby settings (for multi-queries)
+ function ResetGroupBy ()
+ {
+ $this->_groupby = "";
+ $this->_groupfunc = SPH_GROUPBY_DAY;
+ $this->_groupsort = "@group desc";
+ $this->_groupdistinct= "";
+ }
+
+ /// clear all attribute value overrides (for multi-queries)
+ function ResetOverrides ()
+ {
+ $this->_overrides = array ();
+ }
+
+ //////////////////////////////////////////////////////////////////////////////
+
+ /// connect to searchd server, run given search query through given indexes,
+ /// and return the search results
+ function Query ( $query, $index="*", $comment="" )
+ {
+ assert ( empty($this->_reqs) );
+
+ $this->AddQuery ( $query, $index, $comment );
+ $results = $this->RunQueries ();
+ $this->_reqs = array (); // just in case it failed too early
+
+ if ( !is_array($results) )
+ return false; // probably network error; error message should be already filled
+
+ $this->_error = $results[0]["error"];
+ $this->_warning = $results[0]["warning"];
+ if ( $results[0]["status"]==SEARCHD_ERROR )
+ return false;
+ else
+ return $results[0];
+ }
+
+ /// helper to pack floats in network byte order
+ function _PackFloat ( $f )
+ {
+ $t1 = pack ( "f", $f ); // machine order
+ list(,$t2) = unpack ( "L*", $t1 ); // int in machine order
+ return pack ( "N", $t2 );
+ }
+
+ /// add query to multi-query batch
+ /// returns index into results array from RunQueries() call
+ function AddQuery ( $query, $index="*", $comment="" )
+ {
+ // mbstring workaround
+ $this->_MBPush ();
+
+ // build request
+ $req = pack ( "NNNN", $this->_offset, $this->_limit, $this->_mode, $this->_ranker );
+ if ( $this->_ranker==SPH_RANK_EXPR )
+ $req .= pack ( "N", strlen($this->_rankexpr) ) . $this->_rankexpr;
+ $req .= pack ( "N", $this->_sort ); // (deprecated) sort mode
+ $req .= pack ( "N", strlen($this->_sortby) ) . $this->_sortby;
+ $req .= pack ( "N", strlen($query) ) . $query; // query itself
+ $req .= pack ( "N", count($this->_weights) ); // weights
+ foreach ( $this->_weights as $weight )
+ $req .= pack ( "N", (int)$weight );
+ $req .= pack ( "N", strlen($index) ) . $index; // indexes
+ $req .= pack ( "N", 1 ); // id64 range marker
+ $req .= sphPackU64 ( $this->_min_id ) . sphPackU64 ( $this->_max_id ); // id64 range
+
+ // filters
+ $req .= pack ( "N", count($this->_filters) );
+ foreach ( $this->_filters as $filter )
+ {
+ $req .= pack ( "N", strlen($filter["attr"]) ) . $filter["attr"];
+ $req .= pack ( "N", $filter["type"] );
+ switch ( $filter["type"] )
+ {
+ case SPH_FILTER_VALUES:
+ $req .= pack ( "N", count($filter["values"]) );
+ foreach ( $filter["values"] as $value )
+ $req .= sphPackI64 ( $value );
+ break;
+
+ case SPH_FILTER_RANGE:
+ $req .= sphPackI64 ( $filter["min"] ) . sphPackI64 ( $filter["max"] );
+ break;
+
+ case SPH_FILTER_FLOATRANGE:
+ $req .= $this->_PackFloat ( $filter["min"] ) . $this->_PackFloat ( $filter["max"] );
+ break;
+
+ default:
+ assert ( 0 && "internal error: unhandled filter type" );
+ }
+ $req .= pack ( "N", $filter["exclude"] );
+ }
+
+ // group-by clause, max-matches count, group-sort clause, cutoff count
+ $req .= pack ( "NN", $this->_groupfunc, strlen($this->_groupby) ) . $this->_groupby;
+ $req .= pack ( "N", $this->_maxmatches );
+ $req .= pack ( "N", strlen($this->_groupsort) ) . $this->_groupsort;
+ $req .= pack ( "NNN", $this->_cutoff, $this->_retrycount, $this->_retrydelay );
+ $req .= pack ( "N", strlen($this->_groupdistinct) ) . $this->_groupdistinct;
+
+ // anchor point
+ if ( empty($this->_anchor) )
+ {
+ $req .= pack ( "N", 0 );
+ } else
+ {
+ $a =& $this->_anchor;
+ $req .= pack ( "N", 1 );
+ $req .= pack ( "N", strlen($a["attrlat"]) ) . $a["attrlat"];
+ $req .= pack ( "N", strlen($a["attrlong"]) ) . $a["attrlong"];
+ $req .= $this->_PackFloat ( $a["lat"] ) . $this->_PackFloat ( $a["long"] );
+ }
+
+ // per-index weights
+ $req .= pack ( "N", count($this->_indexweights) );
+ foreach ( $this->_indexweights as $idx=>$weight )
+ $req .= pack ( "N", strlen($idx) ) . $idx . pack ( "N", $weight );
+
+ // max query time
+ $req .= pack ( "N", $this->_maxquerytime );
+
+ // per-field weights
+ $req .= pack ( "N", count($this->_fieldweights) );
+ foreach ( $this->_fieldweights as $field=>$weight )
+ $req .= pack ( "N", strlen($field) ) . $field . pack ( "N", $weight );
+
+ // comment
+ $req .= pack ( "N", strlen($comment) ) . $comment;
+
+ // attribute overrides
+ $req .= pack ( "N", count($this->_overrides) );
+ foreach ( $this->_overrides as $key => $entry )
+ {
+ $req .= pack ( "N", strlen($entry["attr"]) ) . $entry["attr"];
+ $req .= pack ( "NN", $entry["type"], count($entry["values"]) );
+ foreach ( $entry["values"] as $id=>$val )
+ {
+ assert ( is_numeric($id) );
+ assert ( is_numeric($val) );
+
+ $req .= sphPackU64 ( $id );
+ switch ( $entry["type"] )
+ {
+ case SPH_ATTR_FLOAT: $req .= $this->_PackFloat ( $val ); break;
+ case SPH_ATTR_BIGINT: $req .= sphPackI64 ( $val ); break;
+ default: $req .= pack ( "N", $val ); break;
+ }
+ }
+ }
+
+ // select-list
+ $req .= pack ( "N", strlen($this->_select) ) . $this->_select;
+
+ // mbstring workaround
+ $this->_MBPop ();
+
+ // store request to requests array
+ $this->_reqs[] = $req;
+ return count($this->_reqs)-1;
+ }
+
+ /// connect to searchd, run queries batch, and return an array of result sets
+ function RunQueries ()
+ {
+ if ( empty($this->_reqs) )
+ {
+ $this->_error = "no queries defined, issue AddQuery() first";
+ return false;
+ }
+
+ // mbstring workaround
+ $this->_MBPush ();
+
+ if (!( $fp = $this->_Connect() ))
+ {
+ $this->_MBPop ();
+ return false;
+ }
+
+ // send query, get response
+ $nreqs = count($this->_reqs);
+ $req = join ( "", $this->_reqs );
+ $len = 8+strlen($req);
+ $req = pack ( "nnNNN", SEARCHD_COMMAND_SEARCH, VER_COMMAND_SEARCH, $len, 0, $nreqs ) . $req; // add header
+
+ if ( !( $this->_Send ( $fp, $req, $len+8 ) ) ||
+ !( $response = $this->_GetResponse ( $fp, VER_COMMAND_SEARCH ) ) )
+ {
+ $this->_MBPop ();
+ return false;
+ }
+
+ // query sent ok; we can reset reqs now
+ $this->_reqs = array ();
+
+ // parse and return response
+ return $this->_ParseSearchResponse ( $response, $nreqs );
+ }
+
+ /// parse and return search query (or queries) response
+ function _ParseSearchResponse ( $response, $nreqs )
+ {
+ $p = 0; // current position
+ $max = strlen($response); // max position for checks, to protect against broken responses
+
+ $results = array ();
+ for ( $ires=0; $ires<$nreqs && $p<$max; $ires++ )
+ {
+ $results[] = array();
+ $result =& $results[$ires];
+
+ $result["error"] = "";
+ $result["warning"] = "";
+
+ // extract status
+ list(,$status) = unpack ( "N*", substr ( $response, $p, 4 ) ); $p += 4;
+ $result["status"] = $status;
+ if ( $status!=SEARCHD_OK )
+ {
+ list(,$len) = unpack ( "N*", substr ( $response, $p, 4 ) ); $p += 4;
+ $message = substr ( $response, $p, $len ); $p += $len;
+
+ if ( $status==SEARCHD_WARNING )
+ {
+ $result["warning"] = $message;
+ } else
+ {
+ $result["error"] = $message;
+ continue;
+ }
+ }
+
+ // read schema
+ $fields = array ();
+ $attrs = array ();
+
+ list(,$nfields) = unpack ( "N*", substr ( $response, $p, 4 ) ); $p += 4;
+ while ( $nfields-->0 && $p<$max )
+ {
+ list(,$len) = unpack ( "N*", substr ( $response, $p, 4 ) ); $p += 4;
+ $fields[] = substr ( $response, $p, $len ); $p += $len;
+ }
+ $result["fields"] = $fields;
+
+ list(,$nattrs) = unpack ( "N*", substr ( $response, $p, 4 ) ); $p += 4;
+ while ( $nattrs-->0 && $p<$max )
+ {
+ list(,$len) = unpack ( "N*", substr ( $response, $p, 4 ) ); $p += 4;
+ $attr = substr ( $response, $p, $len ); $p += $len;
+ list(,$type) = unpack ( "N*", substr ( $response, $p, 4 ) ); $p += 4;
+ $attrs[$attr] = $type;
+ }
+ $result["attrs"] = $attrs;
+
+ // read match count
+ list(,$count) = unpack ( "N*", substr ( $response, $p, 4 ) ); $p += 4;
+ list(,$id64) = unpack ( "N*", substr ( $response, $p, 4 ) ); $p += 4;
+
+ // read matches
+ $idx = -1;
+ while ( $count-->0 && $p<$max )
+ {
+ // index into result array
+ $idx++;
+
+ // parse document id and weight
+ if ( $id64 )
+ {
+ $doc = sphUnpackU64 ( substr ( $response, $p, 8 ) ); $p += 8;
+ list(,$weight) = unpack ( "N*", substr ( $response, $p, 4 ) ); $p += 4;
+ }
+ else
+ {
+ list ( $doc, $weight ) = array_values ( unpack ( "N*N*",
+ substr ( $response, $p, 8 ) ) );
+ $p += 8;
+ $doc = sphFixUint($doc);
+ }
+ $weight = sprintf ( "%u", $weight );
+
+ // create match entry
+ if ( $this->_arrayresult )
+ $result["matches"][$idx] = array ( "id"=>$doc, "weight"=>$weight );
+ else
+ $result["matches"][$doc]["weight"] = $weight;
+
+ // parse and create attributes
+ $attrvals = array ();
+ foreach ( $attrs as $attr=>$type )
+ {
+ // handle 64bit ints
+ if ( $type==SPH_ATTR_BIGINT )
+ {
+ $attrvals[$attr] = sphUnpackI64 ( substr ( $response, $p, 8 ) ); $p += 8;
+ continue;
+ }
+
+ // handle floats
+ if ( $type==SPH_ATTR_FLOAT )
+ {
+ list(,$uval) = unpack ( "N*", substr ( $response, $p, 4 ) ); $p += 4;
+ list(,$fval) = unpack ( "f*", pack ( "L", $uval ) );
+ $attrvals[$attr] = $fval;
+ continue;
+ }
+
+ // handle everything else as unsigned ints
+ list(,$val) = unpack ( "N*", substr ( $response, $p, 4 ) ); $p += 4;
+ if ( $type==SPH_ATTR_MULTI )
+ {
+ $attrvals[$attr] = array ();
+ $nvalues = $val;
+ while ( $nvalues-->0 && $p<$max )
+ {
+ list(,$val) = unpack ( "N*", substr ( $response, $p, 4 ) ); $p += 4;
+ $attrvals[$attr][] = sphFixUint($val);
+ }
+ } else if ( $type==SPH_ATTR_MULTI64 )
+ {
+ $attrvals[$attr] = array ();
+ $nvalues = $val;
+ while ( $nvalues>0 && $p<$max )
+ {
+ $attrvals[$attr][] = sphUnpackU64 ( substr ( $response, $p, 8 ) ); $p += 8;
+ $nvalues -= 2;
+ }
+ } else if ( $type==SPH_ATTR_STRING )
+ {
+ $attrvals[$attr] = substr ( $response, $p, $val );
+ $p += $val;
+ } else
+ {
+ $attrvals[$attr] = sphFixUint($val);
+ }
+ }
+
+ if ( $this->_arrayresult )
+ $result["matches"][$idx]["attrs"] = $attrvals;
+ else
+ $result["matches"][$doc]["attrs"] = $attrvals;
+ }
+
+ list ( $total, $total_found, $msecs, $words ) =
+ array_values ( unpack ( "N*N*N*N*", substr ( $response, $p, 16 ) ) );
+ $result["total"] = sprintf ( "%u", $total );
+ $result["total_found"] = sprintf ( "%u", $total_found );
+ $result["time"] = sprintf ( "%.3f", $msecs/1000 );
+ $p += 16;
+
+ while ( $words-->0 && $p<$max )
+ {
+ list(,$len) = unpack ( "N*", substr ( $response, $p, 4 ) ); $p += 4;
+ $word = substr ( $response, $p, $len ); $p += $len;
+ list ( $docs, $hits ) = array_values ( unpack ( "N*N*", substr ( $response, $p, 8 ) ) ); $p += 8;
+ $result["words"][$word] = array (
+ "docs"=>sprintf ( "%u", $docs ),
+ "hits"=>sprintf ( "%u", $hits ) );
+ }
+ }
+
+ $this->_MBPop ();
+ return $results;
+ }
+
+ /////////////////////////////////////////////////////////////////////////////
+ // excerpts generation
+ /////////////////////////////////////////////////////////////////////////////
+
+ /// connect to searchd server, and generate exceprts (snippets)
+ /// of given documents for given query. returns false on failure,
+ /// an array of snippets on success
+ function BuildExcerpts ( $docs, $index, $words, $opts=array() )
+ {
+ assert ( is_array($docs) );
+ assert ( is_string($index) );
+ assert ( is_string($words) );
+ assert ( is_array($opts) );
+
+ $this->_MBPush ();
+
+ if (!( $fp = $this->_Connect() ))
+ {
+ $this->_MBPop();
+ return false;
+ }
+
+ /////////////////
+ // fixup options
+ /////////////////
+
+ if ( !isset($opts["before_match"]) ) $opts["before_match"] = "<b>";
+ if ( !isset($opts["after_match"]) ) $opts["after_match"] = "</b>";
+ if ( !isset($opts["chunk_separator"]) ) $opts["chunk_separator"] = " ... ";
+ if ( !isset($opts["limit"]) ) $opts["limit"] = 256;
+ if ( !isset($opts["limit_passages"]) ) $opts["limit_passages"] = 0;
+ if ( !isset($opts["limit_words"]) ) $opts["limit_words"] = 0;
+ if ( !isset($opts["around"]) ) $opts["around"] = 5;
+ if ( !isset($opts["exact_phrase"]) ) $opts["exact_phrase"] = false;
+ if ( !isset($opts["single_passage"]) ) $opts["single_passage"] = false;
+ if ( !isset($opts["use_boundaries"]) ) $opts["use_boundaries"] = false;
+ if ( !isset($opts["weight_order"]) ) $opts["weight_order"] = false;
+ if ( !isset($opts["query_mode"]) ) $opts["query_mode"] = false;
+ if ( !isset($opts["force_all_words"]) ) $opts["force_all_words"] = false;
+ if ( !isset($opts["start_passage_id"]) ) $opts["start_passage_id"] = 1;
+ if ( !isset($opts["load_files"]) ) $opts["load_files"] = false;
+ if ( !isset($opts["html_strip_mode"]) ) $opts["html_strip_mode"] = "index";
+ if ( !isset($opts["allow_empty"]) ) $opts["allow_empty"] = false;
+ if ( !isset($opts["passage_boundary"]) ) $opts["passage_boundary"] = "none";
+ if ( !isset($opts["emit_zones"]) ) $opts["emit_zones"] = false;
+ if ( !isset($opts["load_files_scattered"]) ) $opts["load_files_scattered"] = false;
+
+
+ /////////////////
+ // build request
+ /////////////////
+
+ // v.1.2 req
+ $flags = 1; // remove spaces
+ if ( $opts["exact_phrase"] ) $flags |= 2;
+ if ( $opts["single_passage"] ) $flags |= 4;
+ if ( $opts["use_boundaries"] ) $flags |= 8;
+ if ( $opts["weight_order"] ) $flags |= 16;
+ if ( $opts["query_mode"] ) $flags |= 32;
+ if ( $opts["force_all_words"] ) $flags |= 64;
+ if ( $opts["load_files"] ) $flags |= 128;
+ if ( $opts["allow_empty"] ) $flags |= 256;
+ if ( $opts["emit_zones"] ) $flags |= 512;
+ if ( $opts["load_files_scattered"] ) $flags |= 1024;
+ $req = pack ( "NN", 0, $flags ); // mode=0, flags=$flags
+ $req .= pack ( "N", strlen($index) ) . $index; // req index
+ $req .= pack ( "N", strlen($words) ) . $words; // req words
+
+ // options
+ $req .= pack ( "N", strlen($opts["before_match"]) ) . $opts["before_match"];
+ $req .= pack ( "N", strlen($opts["after_match"]) ) . $opts["after_match"];
+ $req .= pack ( "N", strlen($opts["chunk_separator"]) ) . $opts["chunk_separator"];
+ $req .= pack ( "NN", (int)$opts["limit"], (int)$opts["around"] );
+ $req .= pack ( "NNN", (int)$opts["limit_passages"], (int)$opts["limit_words"], (int)$opts["start_passage_id"] ); // v.1.2
+ $req .= pack ( "N", strlen($opts["html_strip_mode"]) ) . $opts["html_strip_mode"];
+ $req .= pack ( "N", strlen($opts["passage_boundary"]) ) . $opts["passage_boundary"];
+
+ // documents
+ $req .= pack ( "N", count($docs) );
+ foreach ( $docs as $doc )
+ {
+ assert ( is_string($doc) );
+ $req .= pack ( "N", strlen($doc) ) . $doc;
+ }
+
+ ////////////////////////////
+ // send query, get response
+ ////////////////////////////
+
+ $len = strlen($req);
+ $req = pack ( "nnN", SEARCHD_COMMAND_EXCERPT, VER_COMMAND_EXCERPT, $len ) . $req; // add header
+ if ( !( $this->_Send ( $fp, $req, $len+8 ) ) ||
+ !( $response = $this->_GetResponse ( $fp, VER_COMMAND_EXCERPT ) ) )
+ {
+ $this->_MBPop ();
+ return false;
+ }
+
+ //////////////////
+ // parse response
+ //////////////////
+
+ $pos = 0;
+ $res = array ();
+ $rlen = strlen($response);
+ for ( $i=0; $i<count($docs); $i++ )
+ {
+ list(,$len) = unpack ( "N*", substr ( $response, $pos, 4 ) );
+ $pos += 4;
+
+ if ( $pos+$len > $rlen )
+ {
+ $this->_error = "incomplete reply";
+ $this->_MBPop ();
+ return false;
+ }
+ $res[] = $len ? substr ( $response, $pos, $len ) : "";
+ $pos += $len;
+ }
+
+ $this->_MBPop ();
+ return $res;
+ }
+
+
+ /////////////////////////////////////////////////////////////////////////////
+ // keyword generation
+ /////////////////////////////////////////////////////////////////////////////
+
+ /// connect to searchd server, and generate keyword list for a given query
+ /// returns false on failure,
+ /// an array of words on success
+ function BuildKeywords ( $query, $index, $hits )
+ {
+ assert ( is_string($query) );
+ assert ( is_string($index) );
+ assert ( is_bool($hits) );
+
+ $this->_MBPush ();
+
+ if (!( $fp = $this->_Connect() ))
+ {
+ $this->_MBPop();
+ return false;
+ }
+
+ /////////////////
+ // build request
+ /////////////////
+
+ // v.1.0 req
+ $req = pack ( "N", strlen($query) ) . $query; // req query
+ $req .= pack ( "N", strlen($index) ) . $index; // req index
+ $req .= pack ( "N", (int)$hits );
+
+ ////////////////////////////
+ // send query, get response
+ ////////////////////////////
+
+ $len = strlen($req);
+ $req = pack ( "nnN", SEARCHD_COMMAND_KEYWORDS, VER_COMMAND_KEYWORDS, $len ) . $req; // add header
+ if ( !( $this->_Send ( $fp, $req, $len+8 ) ) ||
+ !( $response = $this->_GetResponse ( $fp, VER_COMMAND_KEYWORDS ) ) )
+ {
+ $this->_MBPop ();
+ return false;
+ }
+
+ //////////////////
+ // parse response
+ //////////////////
+
+ $pos = 0;
+ $res = array ();
+ $rlen = strlen($response);
+ list(,$nwords) = unpack ( "N*", substr ( $response, $pos, 4 ) );
+ $pos += 4;
+ for ( $i=0; $i<$nwords; $i++ )
+ {
+ list(,$len) = unpack ( "N*", substr ( $response, $pos, 4 ) ); $pos += 4;
+ $tokenized = $len ? substr ( $response, $pos, $len ) : "";
+ $pos += $len;
+
+ list(,$len) = unpack ( "N*", substr ( $response, $pos, 4 ) ); $pos += 4;
+ $normalized = $len ? substr ( $response, $pos, $len ) : "";
+ $pos += $len;
+
+ $res[] = array ( "tokenized"=>$tokenized, "normalized"=>$normalized );
+
+ if ( $hits )
+ {
+ list($ndocs,$nhits) = array_values ( unpack ( "N*N*", substr ( $response, $pos, 8 ) ) );
+ $pos += 8;
+ $res [$i]["docs"] = $ndocs;
+ $res [$i]["hits"] = $nhits;
+ }
+
+ if ( $pos > $rlen )
+ {
+ $this->_error = "incomplete reply";
+ $this->_MBPop ();
+ return false;
+ }
+ }
+
+ $this->_MBPop ();
+ return $res;
+ }
+
+ function EscapeString ( $string )
+ {
+ $from = array ( '\\', '(',')','|','-','!','@','~','"','&', '/', '^', '$', '=' );
+ $to = array ( '\\\\', '\(','\)','\|','\-','\!','\@','\~','\"', '\&', '\/', '\^', '\$', '\=' );
+
+ return str_replace ( $from, $to, $string );
+ }
+
+ /////////////////////////////////////////////////////////////////////////////
+ // attribute updates
+ /////////////////////////////////////////////////////////////////////////////
+
+ /// batch update given attributes in given rows in given indexes
+ /// returns amount of updated documents (0 or more) on success, or -1 on failure
+ function UpdateAttributes ( $index, $attrs, $values, $mva=false )
+ {
+ // verify everything
+ assert ( is_string($index) );
+ assert ( is_bool($mva) );
+
+ assert ( is_array($attrs) );
+ foreach ( $attrs as $attr )
+ assert ( is_string($attr) );
+
+ assert ( is_array($values) );
+ foreach ( $values as $id=>$entry )
+ {
+ assert ( is_numeric($id) );
+ assert ( is_array($entry) );
+ assert ( count($entry)==count($attrs) );
+ foreach ( $entry as $v )
+ {
+ if ( $mva )
+ {
+ assert ( is_array($v) );
+ foreach ( $v as $vv )
+ assert ( is_int($vv) );
+ } else
+ assert ( is_int($v) );
+ }
+ }
+
+ // build request
+ $this->_MBPush ();
+ $req = pack ( "N", strlen($index) ) . $index;
+
+ $req .= pack ( "N", count($attrs) );
+ foreach ( $attrs as $attr )
+ {
+ $req .= pack ( "N", strlen($attr) ) . $attr;
+ $req .= pack ( "N", $mva ? 1 : 0 );
+ }
+
+ $req .= pack ( "N", count($values) );
+ foreach ( $values as $id=>$entry )
+ {
+ $req .= sphPackU64 ( $id );
+ foreach ( $entry as $v )
+ {
+ $req .= pack ( "N", $mva ? count($v) : $v );
+ if ( $mva )
+ foreach ( $v as $vv )
+ $req .= pack ( "N", $vv );
+ }
+ }
+
+ // connect, send query, get response
+ if (!( $fp = $this->_Connect() ))
+ {
+ $this->_MBPop ();
+ return -1;
+ }
+
+ $len = strlen($req);
+ $req = pack ( "nnN", SEARCHD_COMMAND_UPDATE, VER_COMMAND_UPDATE, $len ) . $req; // add header
+ if ( !$this->_Send ( $fp, $req, $len+8 ) )
+ {
+ $this->_MBPop ();
+ return -1;
+ }
+
+ if (!( $response = $this->_GetResponse ( $fp, VER_COMMAND_UPDATE ) ))
+ {
+ $this->_MBPop ();
+ return -1;
+ }
+
+ // parse response
+ list(,$updated) = unpack ( "N*", substr ( $response, 0, 4 ) );
+ $this->_MBPop ();
+ return $updated;
+ }
+
+ /////////////////////////////////////////////////////////////////////////////
+ // persistent connections
+ /////////////////////////////////////////////////////////////////////////////
+
+ function Open()
+ {
+ if ( $this->_socket !== false )
+ {
+ $this->_error = 'already connected';
+ return false;
+ }
+ if ( !$fp = $this->_Connect() )
+ return false;
+
+ // command, command version = 0, body length = 4, body = 1
+ $req = pack ( "nnNN", SEARCHD_COMMAND_PERSIST, 0, 4, 1 );
+ if ( !$this->_Send ( $fp, $req, 12 ) )
+ return false;
+
+ $this->_socket = $fp;
+ return true;
+ }
+
+ function Close()
+ {
+ if ( $this->_socket === false )
+ {
+ $this->_error = 'not connected';
+ return false;
+ }
+
+ fclose ( $this->_socket );
+ $this->_socket = false;
+
+ return true;
+ }
+
+ //////////////////////////////////////////////////////////////////////////
+ // status
+ //////////////////////////////////////////////////////////////////////////
+
+ function Status ()
+ {
+ $this->_MBPush ();
+ if (!( $fp = $this->_Connect() ))
+ {
+ $this->_MBPop();
+ return false;
+ }
+
+ $req = pack ( "nnNN", SEARCHD_COMMAND_STATUS, VER_COMMAND_STATUS, 4, 1 ); // len=4, body=1
+ if ( !( $this->_Send ( $fp, $req, 12 ) ) ||
+ !( $response = $this->_GetResponse ( $fp, VER_COMMAND_STATUS ) ) )
+ {
+ $this->_MBPop ();
+ return false;
+ }
+
+ $res = substr ( $response, 4 ); // just ignore length, error handling, etc
+ $p = 0;
+ list ( $rows, $cols ) = array_values ( unpack ( "N*N*", substr ( $response, $p, 8 ) ) ); $p += 8;
+
+ $res = array();
+ for ( $i=0; $i<$rows; $i++ )
+ for ( $j=0; $j<$cols; $j++ )
+ {
+ list(,$len) = unpack ( "N*", substr ( $response, $p, 4 ) ); $p += 4;
+ $res[$i][] = substr ( $response, $p, $len ); $p += $len;
+ }
+
+ $this->_MBPop ();
+ return $res;
+ }
+
+ //////////////////////////////////////////////////////////////////////////
+ // flush
+ //////////////////////////////////////////////////////////////////////////
+
+ function FlushAttributes ()
+ {
+ $this->_MBPush ();
+ if (!( $fp = $this->_Connect() ))
+ {
+ $this->_MBPop();
+ return -1;
+ }
+
+ $req = pack ( "nnN", SEARCHD_COMMAND_FLUSHATTRS, VER_COMMAND_FLUSHATTRS, 0 ); // len=0
+ if ( !( $this->_Send ( $fp, $req, 8 ) ) ||
+ !( $response = $this->_GetResponse ( $fp, VER_COMMAND_FLUSHATTRS ) ) )
+ {
+ $this->_MBPop ();
+ return -1;
+ }
+
+ $tag = -1;
+ if ( strlen($response)==4 )
+ list(,$tag) = unpack ( "N*", $response );
+ else
+ $this->_error = "unexpected response length";
+
+ $this->_MBPop ();
+ return $tag;
+ }
+}
+
+//
+// $Id: sphinxapi.php 3087 2012-01-30 23:07:35Z shodan $
+//
diff --git a/phpBB/includes/startup.php b/phpBB/includes/startup.php
index 008651c236..7353b90d99 100644
--- a/phpBB/includes/startup.php
+++ b/phpBB/includes/startup.php
@@ -1,9 +1,13 @@
<?php
/**
*
-* @package phpBB3
-* @copyright (c) 2011 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -20,21 +24,6 @@ if (!defined('E_DEPRECATED'))
define('E_DEPRECATED', 8192);
}
$level = E_ALL & ~E_NOTICE & ~E_DEPRECATED;
-if (version_compare(PHP_VERSION, '5.4.0-dev', '>='))
-{
- // PHP 5.4 adds E_STRICT to E_ALL.
- // Our utf8 normalizer triggers E_STRICT output on PHP 5.4.
- // Unfortunately it cannot be made E_STRICT-clean while
- // continuing to work on PHP 4.
- // Therefore, in phpBB 3.0.x we disable E_STRICT on PHP 5.4+,
- // while phpBB 3.1 will fix utf8 normalizer.
- // E_STRICT is defined starting with PHP 5
- if (!defined('E_STRICT'))
- {
- define('E_STRICT', 2048);
- }
- $level &= ~E_STRICT;
-}
error_reporting($level);
/*
@@ -95,54 +84,6 @@ function deregister_globals()
unset($input);
}
-/**
- * Check if requested page uses a trailing path
- *
- * @param string $phpEx PHP extension
- *
- * @return bool True if trailing path is used, false if not
- */
-function phpbb_has_trailing_path($phpEx)
-{
- // Check if path_info is being used
- if (!empty($_SERVER['PATH_INFO']) || (!empty($_SERVER['ORIG_PATH_INFO']) && $_SERVER['SCRIPT_NAME'] != $_SERVER['ORIG_PATH_INFO']))
- {
- return true;
- }
-
- // Match any trailing path appended to a php script in the REQUEST_URI.
- // It is assumed that only actual PHP scripts use names like foo.php. Due
- // to this, any phpBB board inside a directory that has the php extension
- // appended to its name will stop working, i.e. if the board is at
- // example.com/phpBB/test.php/ or example.com/test.php/
- if (preg_match('#^[^?]+\.' . preg_quote($phpEx, '#') . '/#', $_SERVER['REQUEST_URI']))
- {
- return true;
- }
-
- return false;
-}
-
-// Check if trailing path is used
-if (phpbb_has_trailing_path($phpEx))
-{
- if (substr(strtolower(@php_sapi_name()), 0, 3) === 'cgi')
- {
- $prefix = 'Status:';
- }
- else if (!empty($_SERVER['SERVER_PROTOCOL']) && is_string($_SERVER['SERVER_PROTOCOL']) && preg_match('#^HTTP/[0-9]\.[0-9]$#', $_SERVER['SERVER_PROTOCOL']))
- {
- $prefix = $_SERVER['SERVER_PROTOCOL'];
- }
- else
- {
- $prefix = 'HTTP/1.0';
- }
- header("$prefix 404 Not Found", true, 404);
- echo 'Trailing paths and PATH_INFO is not supported by phpBB 3.0';
- exit;
-}
-
// Register globals and magic quotes have been dropped in PHP 5.4
if (version_compare(PHP_VERSION, '5.4.0-dev', '>='))
{
@@ -153,7 +94,11 @@ if (version_compare(PHP_VERSION, '5.4.0-dev', '>='))
}
else
{
- @set_magic_quotes_runtime(0);
+ if (get_magic_quotes_runtime())
+ {
+ // Deactivate
+ @set_magic_quotes_runtime(0);
+ }
// Be paranoid with passed vars
if (@ini_get('register_globals') == '1' || strtolower(@ini_get('register_globals')) == 'on' || !function_exists('ini_get'))
@@ -192,5 +137,40 @@ if (function_exists('date_default_timezone_set') && function_exists('date_defaul
date_default_timezone_set(@date_default_timezone_get());
}
+// Autoloading of dependencies.
+// Three options are supported:
+// 1. If dependencies are installed with Composer, Composer will create a
+// vendor/autoload.php. If this file exists it will be
+// automatically used by phpBB. This is the default mode that phpBB
+// will use when shipped.
+// 2. To disable composer autoloading, PHPBB_NO_COMPOSER_AUTOLOAD can be specified.
+// Additionally specify PHPBB_AUTOLOAD=/path/to/autoload.php in the
+// environment. This is useful for running CLI scripts and tests.
+// /path/to/autoload.php should define and register class loaders
+// for all of phpBB's dependencies.
+// 3. You can also set PHPBB_NO_COMPOSER_AUTOLOAD without setting PHPBB_AUTOLOAD.
+// In this case autoloading needs to be defined before running any phpBB
+// script. This might be useful in cases when phpBB is integrated into a
+// larger program.
+if (getenv('PHPBB_NO_COMPOSER_AUTOLOAD'))
+{
+ if (getenv('PHPBB_AUTOLOAD'))
+ {
+ require(getenv('PHPBB_AUTOLOAD'));
+ }
+}
+else
+{
+ if (!file_exists($phpbb_root_path . 'vendor/autoload.php'))
+ {
+ trigger_error(
+ 'Composer dependencies have not been set up yet, run ' .
+ "'php ../composer.phar install' from the phpBB directory to do so.",
+ E_USER_ERROR
+ );
+ }
+ require($phpbb_root_path . 'vendor/autoload.php');
+}
+
$starttime = explode(' ', microtime());
$starttime = $starttime[1] + $starttime[0];
diff --git a/phpBB/includes/template.php b/phpBB/includes/template.php
deleted file mode 100644
index 9ac395344f..0000000000
--- a/phpBB/includes/template.php
+++ /dev/null
@@ -1,692 +0,0 @@
-<?php
-/**
-*
-* @package phpBB3
-* @version $Id$
-* @copyright (c) 2005 phpBB Group, sections (c) 2001 ispi of Lincoln Inc
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
-*
-*/
-
-/**
-* @ignore
-*/
-if (!defined('IN_PHPBB'))
-{
- exit;
-}
-
-/**
-* Base Template class.
-* @package phpBB3
-*/
-class template
-{
- /** variable that holds all the data we'll be substituting into
- * the compiled templates. Takes form:
- * --> $this->_tpldata[block][iteration#][child][iteration#][child2][iteration#][variablename] == value
- * if it's a root-level variable, it'll be like this:
- * --> $this->_tpldata[.][0][varname] == value
- */
- var $_tpldata = array('.' => array(0 => array()));
- var $_rootref;
-
- // Root dir and hash of filenames for each template handle.
- var $root = '';
- var $cachepath = '';
- var $files = array();
- var $filename = array();
- var $files_inherit = array();
- var $files_template = array();
- var $inherit_root = '';
- var $orig_tpl_storedb;
- var $orig_tpl_inherits_id;
-
- // this will hash handle names to the compiled/uncompiled code for that handle.
- var $compiled_code = array();
-
- /**
- * Set template location
- * @access public
- */
- function set_template()
- {
- global $phpbb_root_path, $user;
-
- if (file_exists($phpbb_root_path . 'styles/' . $user->theme['template_path'] . '/template'))
- {
- $this->root = $phpbb_root_path . 'styles/' . $user->theme['template_path'] . '/template';
- $this->cachepath = $phpbb_root_path . 'cache/tpl_' . str_replace('_', '-', $user->theme['template_path']) . '_';
-
- if ($this->orig_tpl_storedb === null)
- {
- $this->orig_tpl_storedb = $user->theme['template_storedb'];
- }
-
- if ($this->orig_tpl_inherits_id === null)
- {
- $this->orig_tpl_inherits_id = $user->theme['template_inherits_id'];
- }
-
- $user->theme['template_storedb'] = $this->orig_tpl_storedb;
- $user->theme['template_inherits_id'] = $this->orig_tpl_inherits_id;
-
- if ($user->theme['template_inherits_id'])
- {
- $this->inherit_root = $phpbb_root_path . 'styles/' . $user->theme['template_inherit_path'] . '/template';
- }
- }
- else
- {
- trigger_error('Template path could not be found: styles/' . $user->theme['template_path'] . '/template', E_USER_ERROR);
- }
-
- $this->_rootref = &$this->_tpldata['.'][0];
-
- return true;
- }
-
- /**
- * Set custom template location (able to use directory outside of phpBB)
- * @access public
- */
- function set_custom_template($template_path, $template_name, $fallback_template_path = false)
- {
- global $phpbb_root_path, $user;
-
- // Make sure $template_path has no ending slash
- if (substr($template_path, -1) == '/')
- {
- $template_path = substr($template_path, 0, -1);
- }
-
- $this->root = $template_path;
- $this->cachepath = $phpbb_root_path . 'cache/ctpl_' . str_replace('_', '-', $template_name) . '_';
-
- if ($fallback_template_path !== false)
- {
- if (substr($fallback_template_path, -1) == '/')
- {
- $fallback_template_path = substr($fallback_template_path, 0, -1);
- }
-
- $this->inherit_root = $fallback_template_path;
- $this->orig_tpl_inherits_id = true;
- }
- else
- {
- $this->orig_tpl_inherits_id = false;
- }
-
- // the database does not store the path or name of a custom template
- // so there is no way we can properly store custom templates there
- $this->orig_tpl_storedb = false;
-
- $this->_rootref = &$this->_tpldata['.'][0];
-
- return true;
- }
-
- /**
- * Sets the template filenames for handles. $filename_array
- * should be a hash of handle => filename pairs.
- * @access public
- */
- function set_filenames($filename_array)
- {
- if (!is_array($filename_array))
- {
- return false;
- }
- foreach ($filename_array as $handle => $filename)
- {
- if (empty($filename))
- {
- trigger_error("template->set_filenames: Empty filename specified for $handle", E_USER_ERROR);
- }
-
- $this->filename[$handle] = $filename;
- $this->files[$handle] = $this->root . '/' . $filename;
-
- if ($this->inherit_root)
- {
- $this->files_inherit[$handle] = $this->inherit_root . '/' . $filename;
- }
- }
-
- return true;
- }
-
- /**
- * Destroy template data set
- * @access public
- */
- function destroy()
- {
- $this->_tpldata = array('.' => array(0 => array()));
- $this->_rootref = &$this->_tpldata['.'][0];
- }
-
- /**
- * Reset/empty complete block
- * @access public
- */
- function destroy_block_vars($blockname)
- {
- if (strpos($blockname, '.') !== false)
- {
- // Nested block.
- $blocks = explode('.', $blockname);
- $blockcount = sizeof($blocks) - 1;
-
- $str = &$this->_tpldata;
- for ($i = 0; $i < $blockcount; $i++)
- {
- $str = &$str[$blocks[$i]];
- $str = &$str[sizeof($str) - 1];
- }
-
- unset($str[$blocks[$blockcount]]);
- }
- else
- {
- // Top-level block.
- unset($this->_tpldata[$blockname]);
- }
-
- return true;
- }
-
- /**
- * Display handle
- * @access public
- */
- function display($handle, $include_once = true)
- {
- global $user, $phpbb_hook;
-
- if (!empty($phpbb_hook) && $phpbb_hook->call_hook(array(__CLASS__, __FUNCTION__), $handle, $include_once, $this))
- {
- if ($phpbb_hook->hook_return(array(__CLASS__, __FUNCTION__)))
- {
- return $phpbb_hook->hook_return_result(array(__CLASS__, __FUNCTION__));
- }
- }
-
- if (defined('IN_ERROR_HANDLER'))
- {
- if ((E_NOTICE & error_reporting()) == E_NOTICE)
- {
- error_reporting(error_reporting() ^ E_NOTICE);
- }
- }
-
- if ($filename = $this->_tpl_load($handle))
- {
- ($include_once) ? include_once($filename) : include($filename);
- }
- else
- {
- eval(' ?>' . $this->compiled_code[$handle] . '<?php ');
- }
-
- return true;
- }
-
- /**
- * Display the handle and assign the output to a template variable or return the compiled result.
- * @access public
- */
- function assign_display($handle, $template_var = '', $return_content = true, $include_once = false)
- {
- ob_start();
- $this->display($handle, $include_once);
- $contents = ob_get_clean();
-
- if ($return_content)
- {
- return $contents;
- }
-
- $this->assign_var($template_var, $contents);
-
- return true;
- }
-
- /**
- * Load a compiled template if possible, if not, recompile it
- * @access private
- */
- function _tpl_load(&$handle)
- {
- global $user, $phpEx, $config;
-
- if (!isset($this->filename[$handle]))
- {
- trigger_error("template->_tpl_load(): No file specified for handle $handle", E_USER_ERROR);
- }
-
- // reload these settings to have the values they had when this object was initialised
- // using set_template or set_custom_template, they might otherwise have been overwritten
- // by other template class instances in between.
- $user->theme['template_storedb'] = $this->orig_tpl_storedb;
- $user->theme['template_inherits_id'] = $this->orig_tpl_inherits_id;
-
- $filename = $this->cachepath . str_replace('/', '.', $this->filename[$handle]) . '.' . $phpEx;
- $this->files_template[$handle] = (isset($user->theme['template_id'])) ? $user->theme['template_id'] : 0;
-
- $recompile = false;
- if (!file_exists($filename) || @filesize($filename) === 0 || defined('DEBUG_EXTRA'))
- {
- $recompile = true;
- }
- else if ($config['load_tplcompile'])
- {
- // No way around it: we need to check inheritance here
- if ($user->theme['template_inherits_id'] && !file_exists($this->files[$handle]))
- {
- $this->files[$handle] = $this->files_inherit[$handle];
- $this->files_template[$handle] = $user->theme['template_inherits_id'];
- }
- $recompile = (@filemtime($filename) < filemtime($this->files[$handle])) ? true : false;
- }
-
- // Recompile page if the original template is newer, otherwise load the compiled version
- if (!$recompile)
- {
- return $filename;
- }
-
- global $db, $phpbb_root_path;
-
- if (!class_exists('template_compile'))
- {
- include($phpbb_root_path . 'includes/functions_template.' . $phpEx);
- }
-
- // Inheritance - we point to another template file for this one. Equality is also used for store_db
- if (isset($user->theme['template_inherits_id']) && $user->theme['template_inherits_id'] && !file_exists($this->files[$handle]))
- {
- $this->files[$handle] = $this->files_inherit[$handle];
- $this->files_template[$handle] = $user->theme['template_inherits_id'];
- }
-
- $compile = new template_compile($this);
-
- // If we don't have a file assigned to this handle, die.
- if (!isset($this->files[$handle]))
- {
- trigger_error("template->_tpl_load(): No file specified for handle $handle", E_USER_ERROR);
- }
-
- // Just compile if no user object is present (happens within the installer)
- if (!$user)
- {
- $compile->_tpl_load_file($handle);
- return false;
- }
-
- if (isset($user->theme['template_storedb']) && $user->theme['template_storedb'])
- {
- $rows = array();
- $ids = array();
- // Inheritance
- if (isset($user->theme['template_inherits_id']) && $user->theme['template_inherits_id'])
- {
- $ids[] = $user->theme['template_inherits_id'];
- }
- $ids[] = $user->theme['template_id'];
-
- foreach ($ids as $id)
- {
- $sql = 'SELECT *
- FROM ' . STYLES_TEMPLATE_DATA_TABLE . '
- WHERE template_id = ' . $id . "
- AND (template_filename = '" . $db->sql_escape($this->filename[$handle]) . "'
- OR template_included " . $db->sql_like_expression($db->any_char . $this->filename[$handle] . ':' . $db->any_char) . ')';
-
- $result = $db->sql_query($sql);
- while ($row = $db->sql_fetchrow($result))
- {
- $rows[$row['template_filename']] = $row;
- }
- $db->sql_freeresult($result);
- }
-
- if (sizeof($rows))
- {
- foreach ($rows as $row)
- {
- $file = $this->root . '/' . $row['template_filename'];
- $force_reload = false;
- if ($row['template_id'] != $user->theme['template_id'])
- {
- // make sure that we are not overlooking a file not in the db yet
- if (isset($user->theme['template_inherits_id']) && $user->theme['template_inherits_id'] && !file_exists($file))
- {
- $file = $this->inherit_root . '/' . $row['template_filename'];
- $this->files[$row['template_filename']] = $file;
- $this->files_inherit[$row['template_filename']] = $file;
- $this->files_template[$row['template_filename']] = $user->theme['template_inherits_id'];
- }
- else if (isset($user->theme['template_inherits_id']) && $user->theme['template_inherits_id'])
- {
- // Ok, we have a situation. There is a file in the subtemplate, but nothing in the DB. We have to fix that.
- $force_reload = true;
- $this->files_template[$row['template_filename']] = $user->theme['template_inherits_id'];
- }
- }
- else
- {
- $this->files_template[$row['template_filename']] = $user->theme['template_id'];
- }
-
- if ($force_reload || $row['template_mtime'] < filemtime($file))
- {
- if ($row['template_filename'] == $this->filename[$handle])
- {
- $compile->_tpl_load_file($handle, true);
- }
- else
- {
- $this->files[$row['template_filename']] = $file;
- $this->filename[$row['template_filename']] = $row['template_filename'];
- $compile->_tpl_load_file($row['template_filename'], true);
- unset($this->compiled_code[$row['template_filename']]);
- unset($this->files[$row['template_filename']]);
- unset($this->filename[$row['template_filename']]);
- }
- }
-
- if ($row['template_filename'] == $this->filename[$handle])
- {
- $this->compiled_code[$handle] = $compile->compile(trim($row['template_data']));
- $compile->compile_write($handle, $this->compiled_code[$handle]);
- }
- else
- {
- // Only bother compiling if it doesn't already exist
- if (!file_exists($this->cachepath . str_replace('/', '.', $row['template_filename']) . '.' . $phpEx))
- {
- $this->filename[$row['template_filename']] = $row['template_filename'];
- $compile->compile_write($row['template_filename'], $compile->compile(trim($row['template_data'])));
- unset($this->filename[$row['template_filename']]);
- }
- }
- }
- }
- else
- {
- $file = $this->root . '/' . $row['template_filename'];
-
- if (isset($user->theme['template_inherits_id']) && $user->theme['template_inherits_id'] && !file_exists($file))
- {
- $file = $this->inherit_root . '/' . $row['template_filename'];
- $this->files[$row['template_filename']] = $file;
- $this->files_inherit[$row['template_filename']] = $file;
- $this->files_template[$row['template_filename']] = $user->theme['template_inherits_id'];
- }
- // Try to load from filesystem and instruct to insert into the styles table...
- $compile->_tpl_load_file($handle, true);
- return false;
- }
-
- return false;
- }
-
- $compile->_tpl_load_file($handle);
- return false;
- }
-
- /**
- * Assign key variable pairs from an array
- * @access public
- */
- function assign_vars($vararray)
- {
- foreach ($vararray as $key => $val)
- {
- $this->_rootref[$key] = $val;
- }
-
- return true;
- }
-
- /**
- * Assign a single variable to a single key
- * @access public
- */
- function assign_var($varname, $varval)
- {
- $this->_rootref[$varname] = $varval;
-
- return true;
- }
-
- /**
- * Assign key variable pairs from an array to a specified block
- * @access public
- */
- function assign_block_vars($blockname, $vararray)
- {
- if (strpos($blockname, '.') !== false)
- {
- // Nested block.
- $blocks = explode('.', $blockname);
- $blockcount = sizeof($blocks) - 1;
-
- $str = &$this->_tpldata;
- for ($i = 0; $i < $blockcount; $i++)
- {
- $str = &$str[$blocks[$i]];
- $str = &$str[sizeof($str) - 1];
- }
-
- $s_row_count = isset($str[$blocks[$blockcount]]) ? sizeof($str[$blocks[$blockcount]]) : 0;
- $vararray['S_ROW_COUNT'] = $s_row_count;
-
- // Assign S_FIRST_ROW
- if (!$s_row_count)
- {
- $vararray['S_FIRST_ROW'] = true;
- }
-
- // Now the tricky part, we always assign S_LAST_ROW and remove the entry before
- // This is much more clever than going through the complete template data on display (phew)
- $vararray['S_LAST_ROW'] = true;
- if ($s_row_count > 0)
- {
- unset($str[$blocks[$blockcount]][($s_row_count - 1)]['S_LAST_ROW']);
- }
-
- // Now we add the block that we're actually assigning to.
- // We're adding a new iteration to this block with the given
- // variable assignments.
- $str[$blocks[$blockcount]][] = $vararray;
- }
- else
- {
- // Top-level block.
- $s_row_count = (isset($this->_tpldata[$blockname])) ? sizeof($this->_tpldata[$blockname]) : 0;
- $vararray['S_ROW_COUNT'] = $s_row_count;
-
- // Assign S_FIRST_ROW
- if (!$s_row_count)
- {
- $vararray['S_FIRST_ROW'] = true;
- }
-
- // We always assign S_LAST_ROW and remove the entry before
- $vararray['S_LAST_ROW'] = true;
- if ($s_row_count > 0)
- {
- unset($this->_tpldata[$blockname][($s_row_count - 1)]['S_LAST_ROW']);
- }
-
- // Add a new iteration to this block with the variable assignments we were given.
- $this->_tpldata[$blockname][] = $vararray;
- }
-
- return true;
- }
-
- /**
- * Change already assigned key variable pair (one-dimensional - single loop entry)
- *
- * An example of how to use this function:
- * {@example alter_block_array.php}
- *
- * @param string $blockname the blockname, for example 'loop'
- * @param array $vararray the var array to insert/add or merge
- * @param mixed $key Key to search for
- *
- * array: KEY => VALUE [the key/value pair to search for within the loop to determine the correct position]
- *
- * int: Position [the position to change or insert at directly given]
- *
- * If key is false the position is set to 0
- * If key is true the position is set to the last entry
- *
- * @param string $mode Mode to execute (valid modes are 'insert' and 'change')
- *
- * If insert, the vararray is inserted at the given position (position counting from zero).
- * If change, the current block gets merged with the vararray (resulting in new key/value pairs be added and existing keys be replaced by the new value).
- *
- * Since counting begins by zero, inserting at the last position will result in this array: array(vararray, last positioned array)
- * and inserting at position 1 will result in this array: array(first positioned array, vararray, following vars)
- *
- * @return bool false on error, true on success
- * @access public
- */
- function alter_block_array($blockname, $vararray, $key = false, $mode = 'insert')
- {
- if (strpos($blockname, '.') !== false)
- {
- // Nested blocks are not supported
- return false;
- }
-
- // Change key to zero (change first position) if false and to last position if true
- if ($key === false || $key === true)
- {
- $key = ($key === false) ? 0 : sizeof($this->_tpldata[$blockname]);
- }
-
- // Get correct position if array given
- if (is_array($key))
- {
- // Search array to get correct position
- list($search_key, $search_value) = @each($key);
-
- $key = NULL;
- foreach ($this->_tpldata[$blockname] as $i => $val_ary)
- {
- if ($val_ary[$search_key] === $search_value)
- {
- $key = $i;
- break;
- }
- }
-
- // key/value pair not found
- if ($key === NULL)
- {
- return false;
- }
- }
-
- // Insert Block
- if ($mode == 'insert')
- {
- // Make sure we are not exceeding the last iteration
- if ($key >= sizeof($this->_tpldata[$blockname]))
- {
- $key = sizeof($this->_tpldata[$blockname]);
- unset($this->_tpldata[$blockname][($key - 1)]['S_LAST_ROW']);
- $vararray['S_LAST_ROW'] = true;
- }
- else if ($key === 0)
- {
- unset($this->_tpldata[$blockname][0]['S_FIRST_ROW']);
- $vararray['S_FIRST_ROW'] = true;
- }
-
- // Re-position template blocks
- for ($i = sizeof($this->_tpldata[$blockname]); $i > $key; $i--)
- {
- $this->_tpldata[$blockname][$i] = $this->_tpldata[$blockname][$i-1];
- $this->_tpldata[$blockname][$i]['S_ROW_COUNT'] = $i;
- }
-
- // Insert vararray at given position
- $vararray['S_ROW_COUNT'] = $key;
- $this->_tpldata[$blockname][$key] = $vararray;
-
- return true;
- }
-
- // Which block to change?
- if ($mode == 'change')
- {
- if ($key == sizeof($this->_tpldata[$blockname]))
- {
- $key--;
- }
-
- $this->_tpldata[$blockname][$key] = array_merge($this->_tpldata[$blockname][$key], $vararray);
- return true;
- }
-
- return false;
- }
-
- /**
- * Include a separate template
- * @access private
- */
- function _tpl_include($filename, $include = true)
- {
- $handle = $filename;
- $this->filename[$handle] = $filename;
- $this->files[$handle] = $this->root . '/' . $filename;
- if ($this->inherit_root)
- {
- $this->files_inherit[$handle] = $this->inherit_root . '/' . $filename;
- }
-
- $filename = $this->_tpl_load($handle);
-
- if ($include)
- {
- global $user;
-
- if ($filename)
- {
- include($filename);
- return;
- }
- eval(' ?>' . $this->compiled_code[$handle] . '<?php ');
- }
- }
-
- /**
- * Include a php-file
- * @access private
- */
- function _php_include($filename)
- {
- global $phpbb_root_path;
-
- $file = $phpbb_root_path . $filename;
-
- if (!file_exists($file))
- {
- // trigger_error cannot be used here, as the output already started
- echo 'template->_php_include(): File ' . htmlspecialchars($file) . ' does not exist or is empty';
- return;
- }
- include($file);
- }
-}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/ucp/info/ucp_attachments.php b/phpBB/includes/ucp/info/ucp_attachments.php
index 84edce446c..2e20106f5c 100644
--- a/phpBB/includes/ucp/info/ucp_attachments.php
+++ b/phpBB/includes/ucp/info/ucp_attachments.php
@@ -1,16 +1,16 @@
<?php
/**
*
-* @package ucp
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
-/**
-* @package module_install
-*/
class ucp_attachments_info
{
function module()
@@ -33,5 +33,3 @@ class ucp_attachments_info
{
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/ucp/info/ucp_auth_link.php b/phpBB/includes/ucp/info/ucp_auth_link.php
new file mode 100644
index 0000000000..9ec4cb7b3a
--- /dev/null
+++ b/phpBB/includes/ucp/info/ucp_auth_link.php
@@ -0,0 +1,35 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+class ucp_auth_link_info
+{
+ function module()
+ {
+ return array(
+ 'filename' => 'ucp_auth_link',
+ 'title' => 'UCP_AUTH_LINK',
+ 'version' => '1.0.0',
+ 'modes' => array(
+ 'auth_link' => array('title' => 'UCP_AUTH_LINK_MANAGE', 'auth' => 'authmethod_oauth', 'cat' => array('UCP_PROFILE')),
+ ),
+ );
+ }
+
+ function install()
+ {
+ }
+
+ function uninstall()
+ {
+ }
+}
diff --git a/phpBB/includes/ucp/info/ucp_groups.php b/phpBB/includes/ucp/info/ucp_groups.php
index 2002123c50..6da2a4fe38 100644
--- a/phpBB/includes/ucp/info/ucp_groups.php
+++ b/phpBB/includes/ucp/info/ucp_groups.php
@@ -1,16 +1,16 @@
<?php
/**
*
-* @package ucp
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
-/**
-* @package module_install
-*/
class ucp_groups_info
{
function module()
@@ -34,5 +34,3 @@ class ucp_groups_info
{
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/ucp/info/ucp_main.php b/phpBB/includes/ucp/info/ucp_main.php
index 722b7865e6..de8e7d5602 100644
--- a/phpBB/includes/ucp/info/ucp_main.php
+++ b/phpBB/includes/ucp/info/ucp_main.php
@@ -1,16 +1,16 @@
<?php
/**
*
-* @package ucp
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
-/**
-* @package module_install
-*/
class ucp_main_info
{
function module()
@@ -36,5 +36,3 @@ class ucp_main_info
{
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/ucp/info/ucp_notifications.php b/phpBB/includes/ucp/info/ucp_notifications.php
new file mode 100644
index 0000000000..0cc011d96e
--- /dev/null
+++ b/phpBB/includes/ucp/info/ucp_notifications.php
@@ -0,0 +1,36 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+class ucp_notifications_info
+{
+ function module()
+ {
+ return array(
+ 'filename' => 'ucp_notifications',
+ 'title' => 'UCP_NOTIFICATION_OPTIONS',
+ 'version' => '1.0.0',
+ 'modes' => array(
+ 'notification_options' => array('title' => 'UCP_NOTIFICATION_OPTIONS', 'auth' => '', 'cat' => array('UCP_PREFS')),
+ 'notification_list' => array('title' => 'UCP_NOTIFICATION_LIST', 'auth' => '', 'cat' => array('UCP_MAIN')),
+ ),
+ );
+ }
+
+ function install()
+ {
+ }
+
+ function uninstall()
+ {
+ }
+}
diff --git a/phpBB/includes/ucp/info/ucp_pm.php b/phpBB/includes/ucp/info/ucp_pm.php
index ade12005c0..6aa1669cb6 100644
--- a/phpBB/includes/ucp/info/ucp_pm.php
+++ b/phpBB/includes/ucp/info/ucp_pm.php
@@ -1,15 +1,16 @@
<?php
/**
-* @package ucp
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
-/**
-* @package module_install
-*/
class ucp_pm_info
{
function module()
@@ -23,7 +24,6 @@ class ucp_pm_info
'compose' => array('title' => 'UCP_PM_COMPOSE', 'auth' => 'cfg_allow_privmsg', 'cat' => array('UCP_PM')),
'drafts' => array('title' => 'UCP_PM_DRAFTS', 'auth' => 'cfg_allow_privmsg', 'cat' => array('UCP_PM')),
'options' => array('title' => 'UCP_PM_OPTIONS', 'auth' => 'cfg_allow_privmsg', 'cat' => array('UCP_PM')),
- 'popup' => array('title' => 'UCP_PM_POPUP_TITLE', 'auth' => 'cfg_allow_privmsg', 'display' => false, 'cat' => array('UCP_PM')),
),
);
}
@@ -36,5 +36,3 @@ class ucp_pm_info
{
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/ucp/info/ucp_prefs.php b/phpBB/includes/ucp/info/ucp_prefs.php
index 58359e8a19..5c2d29ac73 100644
--- a/phpBB/includes/ucp/info/ucp_prefs.php
+++ b/phpBB/includes/ucp/info/ucp_prefs.php
@@ -1,16 +1,16 @@
<?php
/**
*
-* @package ucp
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
-/**
-* @package module_install
-*/
class ucp_prefs_info
{
function module()
@@ -35,5 +35,3 @@ class ucp_prefs_info
{
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/ucp/info/ucp_profile.php b/phpBB/includes/ucp/info/ucp_profile.php
index 4591776768..919de99a96 100644
--- a/phpBB/includes/ucp/info/ucp_profile.php
+++ b/phpBB/includes/ucp/info/ucp_profile.php
@@ -1,16 +1,16 @@
<?php
/**
*
-* @package ucp
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
-/**
-* @package module_install
-*/
class ucp_profile_info
{
function module()
@@ -20,10 +20,11 @@ class ucp_profile_info
'title' => 'UCP_PROFILE',
'version' => '1.0.0',
'modes' => array(
- 'profile_info' => array('title' => 'UCP_PROFILE_PROFILE_INFO', 'auth' => '', 'cat' => array('UCP_PROFILE')),
+ 'profile_info' => array('title' => 'UCP_PROFILE_PROFILE_INFO', 'auth' => 'acl_u_chgprofileinfo', 'cat' => array('UCP_PROFILE')),
'signature' => array('title' => 'UCP_PROFILE_SIGNATURE', 'auth' => 'acl_u_sig', 'cat' => array('UCP_PROFILE')),
- 'avatar' => array('title' => 'UCP_PROFILE_AVATAR', 'auth' => 'cfg_allow_avatar && (cfg_allow_avatar_local || cfg_allow_avatar_remote || cfg_allow_avatar_upload || cfg_allow_avatar_remote_upload)', 'cat' => array('UCP_PROFILE')),
+ 'avatar' => array('title' => 'UCP_PROFILE_AVATAR', 'auth' => 'cfg_allow_avatar', 'cat' => array('UCP_PROFILE')),
'reg_details' => array('title' => 'UCP_PROFILE_REG_DETAILS', 'auth' => '', 'cat' => array('UCP_PROFILE')),
+ 'autologin_keys'=> array('title' => 'UCP_PROFILE_AUTOLOGIN_KEYS', 'auth' => '', 'cat' => array('UCP_PROFILE')),
),
);
}
@@ -36,5 +37,3 @@ class ucp_profile_info
{
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/ucp/info/ucp_zebra.php b/phpBB/includes/ucp/info/ucp_zebra.php
index 5fc1f8bee7..99d4a4f4c0 100644
--- a/phpBB/includes/ucp/info/ucp_zebra.php
+++ b/phpBB/includes/ucp/info/ucp_zebra.php
@@ -1,16 +1,16 @@
<?php
/**
*
-* @package ucp
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
-/**
-* @package module_install
-*/
class ucp_zebra_info
{
function module()
@@ -34,5 +34,3 @@ class ucp_zebra_info
{
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/ucp/ucp_activate.php b/phpBB/includes/ucp/ucp_activate.php
index b262dc5c1c..1f5ce93277 100644
--- a/phpBB/includes/ucp/ucp_activate.php
+++ b/phpBB/includes/ucp/ucp_activate.php
@@ -1,10 +1,13 @@
<?php
/**
*
-* @package ucp
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -19,7 +22,6 @@ if (!defined('IN_PHPBB'))
/**
* ucp_activate
* User activation
-* @package ucp
*/
class ucp_activate
{
@@ -28,7 +30,7 @@ class ucp_activate
function main($id, $mode)
{
global $config, $phpbb_root_path, $phpEx;
- global $db, $user, $auth, $template;
+ global $db, $user, $auth, $template, $phpbb_container, $phpbb_dispatcher;
$user_id = request_var('u', 0);
$key = request_var('k', '');
@@ -76,7 +78,6 @@ class ucp_activate
'user_actkey' => '',
'user_password' => $user_row['user_newpasswd'],
'user_newpasswd' => '',
- 'user_pass_convert' => 0,
'user_login_attempts' => 0,
);
@@ -109,13 +110,16 @@ class ucp_activate
if ($config['require_activation'] == USER_ACTIVATION_ADMIN && !$update_password)
{
+ $phpbb_notifications = $phpbb_container->get('notification_manager');
+ $phpbb_notifications->delete_notifications('notification.type.admin_activate_user', $user_row['user_id']);
+
include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);
$messenger = new messenger(false);
$messenger->template('admin_welcome_activated', $user_row['user_lang']);
- $messenger->to($user_row['user_email'], $user_row['username']);
+ $messenger->set_addresses($user_row);
$messenger->anti_abuse_headers($config, $user);
@@ -139,9 +143,18 @@ class ucp_activate
}
}
+ /**
+ * This event can be used to modify data after user account's activation
+ *
+ * @event core.ucp_activate_after
+ * @var array user_row Array with some user data
+ * @var string message Language string of the message that will be displayed to the user
+ * @since 3.1.6-RC1
+ */
+ $vars = array('user_row', 'message');
+ extract($phpbb_dispatcher->trigger_event('core.ucp_activate_after', compact($vars)));
+
meta_refresh(3, append_sid("{$phpbb_root_path}index.$phpEx"));
trigger_error($user->lang[$message]);
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/ucp/ucp_attachments.php b/phpBB/includes/ucp/ucp_attachments.php
index b011b4f75d..42724209aa 100644
--- a/phpBB/includes/ucp/ucp_attachments.php
+++ b/phpBB/includes/ucp/ucp_attachments.php
@@ -1,10 +1,13 @@
<?php
/**
*
-* @package ucp
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -19,7 +22,6 @@ if (!defined('IN_PHPBB'))
/**
* ucp_attachments
* User attachments
-* @package ucp
*/
class ucp_attachments
{
@@ -27,7 +29,7 @@ class ucp_attachments
function main($id, $mode)
{
- global $template, $user, $db, $config, $phpEx, $phpbb_root_path;
+ global $template, $user, $db, $config, $phpEx, $phpbb_root_path, $phpbb_container;
$start = request_var('start', 0);
$sort_key = request_var('sk', 'a');
@@ -120,6 +122,10 @@ class ucp_attachments
$num_attachments = $db->sql_fetchfield('num_attachments');
$db->sql_freeresult($result);
+ // Ensure start is a valid value
+ $pagination = $phpbb_container->get('pagination');
+ $start = $pagination->validate_start($start, $config['topics_per_page'], $num_attachments);
+
$sql = 'SELECT a.*, t.topic_title, p.message_subject as message_title
FROM ' . ATTACHMENTS_TABLE . ' a
LEFT JOIN ' . TOPICS_TABLE . ' t ON (a.topic_id = t.topic_id AND a.in_message = 0)
@@ -171,10 +177,12 @@ class ucp_attachments
}
$db->sql_freeresult($result);
+ $base_url = $this->u_action . "&amp;sk=$sort_key&amp;sd=$sort_dir";
+ $pagination->generate_template_pagination($base_url, 'pagination', 'start', $num_attachments, $config['topics_per_page'], $start);
+
$template->assign_vars(array(
- 'PAGE_NUMBER' => on_page($num_attachments, $config['topics_per_page'], $start),
- 'PAGINATION' => generate_pagination($this->u_action . "&amp;sk=$sort_key&amp;sd=$sort_dir", $num_attachments, $config['topics_per_page'], $start),
'TOTAL_ATTACHMENTS' => $num_attachments,
+ 'NUM_ATTACHMENTS' => $user->lang('NUM_ATTACHMENTS', $num_attachments),
'L_TITLE' => $user->lang['UCP_ATTACHMENTS'],
@@ -197,5 +205,3 @@ class ucp_attachments
$this->page_title = 'UCP_ATTACHMENTS';
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/ucp/ucp_auth_link.php b/phpBB/includes/ucp/ucp_auth_link.php
new file mode 100644
index 0000000000..748f0fdec2
--- /dev/null
+++ b/phpBB/includes/ucp/ucp_auth_link.php
@@ -0,0 +1,147 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+/**
+* @ignore
+*/
+if (!defined('IN_PHPBB'))
+{
+ exit;
+}
+
+class ucp_auth_link
+{
+ /**
+ * @var string
+ */
+ public $u_action;
+
+ /**
+ * Generates the ucp_auth_link page and handles the auth link process
+ *
+ * @param int $id
+ * @param string $mode
+ */
+ public function main($id, $mode)
+ {
+ global $request, $template, $phpbb_container, $user;
+
+ $error = array();
+
+ $provider_collection = $phpbb_container->get('auth.provider_collection');
+ $auth_provider = $provider_collection->get_provider();
+
+ // confirm that the auth provider supports this page
+ $provider_data = $auth_provider->get_auth_link_data();
+ if ($provider_data === null)
+ {
+ $error[] = 'UCP_AUTH_LINK_NOT_SUPPORTED';
+ }
+
+ $s_hidden_fields = array();
+ add_form_key('ucp_auth_link');
+
+ $submit = $request->variable('submit', false, false, \phpbb\request\request_interface::POST);
+
+ // This path is only for primary actions
+ if (!sizeof($error) && $submit)
+ {
+ if (!check_form_key('ucp_auth_link'))
+ {
+ $error[] = 'FORM_INVALID';
+ }
+
+ if (!sizeof($error))
+ {
+ // Any post data could be necessary for auth (un)linking
+ $link_data = $request->get_super_global(\phpbb\request\request_interface::POST);
+
+ // The current user_id is also necessary
+ $link_data['user_id'] = $user->data['user_id'];
+
+ // Tell the provider that the method is auth_link not login_link
+ $link_data['link_method'] = 'auth_link';
+
+ if ($request->variable('link', 0, false, \phpbb\request\request_interface::POST))
+ {
+ $error[] = $auth_provider->link_account($link_data);
+ }
+ else
+ {
+ $error[] = $auth_provider->unlink_account($link_data);
+ }
+
+ // Template data may have changed, get new data
+ $provider_data = $auth_provider->get_auth_link_data();
+ }
+ }
+
+ // In some cases, a request to an external server may be required. In
+ // these cases, the GET parameter 'link' should exist and should be true
+ if ($request->variable('link', false))
+ {
+ // In this case the link data should only be populated with the
+ // link_method as the provider dictates how data is returned to it.
+ $link_data = array('link_method' => 'auth_link');
+
+ $error[] = $auth_provider->link_account($link_data);
+
+ // Template data may have changed, get new data
+ $provider_data = $auth_provider->get_auth_link_data();
+ }
+
+ if (isset($provider_data['VARS']))
+ {
+ // Handle hidden fields separately
+ if (isset($provider_data['VARS']['HIDDEN_FIELDS']))
+ {
+ $s_hidden_fields = array_merge($s_hidden_fields, $provider_data['VARS']['HIDDEN_FIELDS']);
+ unset($provider_data['VARS']['HIDDEN_FIELDS']);
+ }
+
+ $template->assign_vars($provider_data['VARS']);
+ }
+
+ if (isset($provider_data['BLOCK_VAR_NAME']))
+ {
+ foreach ($provider_data['BLOCK_VARS'] as $block_vars)
+ {
+ // See if there are additional hidden fields. This should be an associative array
+ if (isset($block_vars['HIDDEN_FIELDS']))
+ {
+ $block_vars['HIDDEN_FIELDS'] = build_hidden_fields($block_vars['HIDDEN_FIELDS']);
+ }
+
+ $template->assign_block_vars($provider_data['BLOCK_VAR_NAME'], $block_vars);
+ }
+ }
+
+ $s_hidden_fields = build_hidden_fields($s_hidden_fields);
+
+ // Replace "error" strings with their real, localised form
+ $error = array_map(array($user, 'lang'), $error);
+ $error = implode('<br />', $error);
+
+ $template->assign_vars(array(
+ 'ERROR' => $error,
+
+ 'PROVIDER_TEMPLATE_FILE' => $provider_data['TEMPLATE_FILE'],
+
+ 'S_HIDDEN_FIELDS' => $s_hidden_fields,
+ 'S_UCP_ACTION' => $this->u_action,
+ ));
+
+ $this->tpl_name = 'ucp_auth_link';
+ $this->page_title = 'UCP_AUTH_LINK';
+ }
+}
diff --git a/phpBB/includes/ucp/ucp_confirm.php b/phpBB/includes/ucp/ucp_confirm.php
index 445f7c7d2a..7392f8dea8 100644
--- a/phpBB/includes/ucp/ucp_confirm.php
+++ b/phpBB/includes/ucp/ucp_confirm.php
@@ -1,10 +1,13 @@
<?php
/**
*
-* @package VC
-* @version $Id$
-* @copyright (c) 2005 2008 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -26,8 +29,6 @@ if (!defined('IN_PHPBB'))
* to that licence. Do not incorporate this within software
* released or distributed in any way under a licence other
* than the GPL. We will be watching ... ;)
-*
-* @package VC
*/
class ucp_confirm
{
@@ -35,10 +36,9 @@ class ucp_confirm
function main($id, $mode)
{
- global $db, $user, $phpbb_root_path, $config, $phpEx;
+ global $db, $user, $phpbb_root_path, $config, $phpEx, $phpbb_container;
- include($phpbb_root_path . 'includes/captcha/captcha_factory.' . $phpEx);
- $captcha = phpbb_captcha_factory::get_instance($config['captcha_plugin']);
+ $captcha = $phpbb_container->get('captcha.factory')->get_instance($config['captcha_plugin']);
$captcha->init(request_var('type', 0));
$captcha->execute();
@@ -46,5 +46,3 @@ class ucp_confirm
exit_handler();
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/ucp/ucp_groups.php b/phpBB/includes/ucp/ucp_groups.php
index 663b5bc931..86a8226d5b 100644
--- a/phpBB/includes/ucp/ucp_groups.php
+++ b/phpBB/includes/ucp/ucp_groups.php
@@ -1,10 +1,13 @@
<?php
/**
*
-* @package ucp
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -18,7 +21,6 @@ if (!defined('IN_PHPBB'))
/**
* ucp_groups
-* @package ucp
*/
class ucp_groups
{
@@ -26,16 +28,17 @@ class ucp_groups
function main($id, $mode)
{
- global $config, $phpbb_root_path, $phpEx;
+ global $config, $phpbb_root_path, $phpEx, $phpbb_admin_path;
global $db, $user, $auth, $cache, $template;
+ global $request, $phpbb_container;
$user->add_lang('groups');
$return_page = '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], '<a href="' . $this->u_action . '">', '</a>');
$mark_ary = request_var('mark', array(0));
- $submit = (!empty($_POST['submit'])) ? true : false;
- $delete = (!empty($_POST['delete'])) ? true : false;
+ $submit = $request->variable('submit', false, false, \phpbb\request\request_interface::POST);
+ $delete = $request->variable('delete', false, false, \phpbb\request\request_interface::POST);
$error = $data = array();
switch ($mode)
@@ -197,38 +200,6 @@ class ucp_groups
else
{
group_user_add($group_id, $user->data['user_id'], false, false, false, 0, 1);
-
- include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);
- $messenger = new messenger();
-
- $sql = 'SELECT u.username, u.username_clean, u.user_email, u.user_notify_type, u.user_jabber, u.user_lang
- FROM ' . USER_GROUP_TABLE . ' ug, ' . USERS_TABLE . " u
- WHERE ug.user_id = u.user_id
- AND ug.group_leader = 1
- AND ug.group_id = $group_id";
- $result = $db->sql_query($sql);
-
- while ($row = $db->sql_fetchrow($result))
- {
- $messenger->template('group_request', $row['user_lang']);
-
- $messenger->to($row['user_email'], $row['username']);
- $messenger->im($row['user_jabber'], $row['username']);
-
- $messenger->assign_vars(array(
- 'USERNAME' => htmlspecialchars_decode($row['username']),
- 'GROUP_NAME' => htmlspecialchars_decode($group_row[$group_id]['group_name']),
- 'REQUEST_USERNAME' => $user->data['username'],
-
- 'U_PENDING' => generate_board_url() . "/ucp.$phpEx?i=groups&mode=manage&action=list&g=$group_id",
- 'U_GROUP' => generate_board_url() . "/memberlist.$phpEx?mode=group&g=$group_id")
- );
-
- $messenger->send($row['user_notify_type']);
- }
- $db->sql_freeresult($result);
-
- $messenger->save_queue();
}
add_log('user', $user->data['user_id'], 'LOG_USER_GROUP_JOIN' . (($group_row[$group_id]['group_type'] == GROUP_FREE) ? '' : '_PENDING'), $group_row[$group_id]['group_name']);
@@ -417,9 +388,11 @@ class ucp_groups
if ($group_id)
{
- $sql = 'SELECT *
- FROM ' . GROUPS_TABLE . "
- WHERE group_id = $group_id";
+ $sql = 'SELECT g.*, t.teampage_position AS group_teampage
+ FROM ' . GROUPS_TABLE . ' g
+ LEFT JOIN ' . TEAMPAGE_TABLE . ' t
+ ON (t.group_id = g.group_id)
+ WHERE g.group_id = ' . $group_id;
$result = $db->sql_query($sql);
$group_row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
@@ -438,7 +411,7 @@ class ucp_groups
$group_name = $group_row['group_name'];
$group_type = $group_row['group_type'];
- $avatar_img = (!empty($group_row['group_avatar'])) ? get_user_avatar($group_row['group_avatar'], $group_row['group_avatar_type'], $group_row['group_avatar_width'], $group_row['group_avatar_height'], 'GROUP_AVATAR') : '<img src="' . $phpbb_root_path . 'adm/images/no_avatar.gif" alt="" />';
+ $avatar = phpbb_get_group_avatar($group_row, 'GROUP_AVATAR', true);
$template->assign_vars(array(
'GROUP_NAME' => ($group_type == GROUP_SPECIAL) ? $user->lang['G_' . $group_name] : $group_name,
@@ -447,8 +420,8 @@ class ucp_groups
'GROUP_DESC_DISP' => generate_text_for_display($group_row['group_desc'], $group_row['group_desc_uid'], $group_row['group_desc_bitfield'], $group_row['group_desc_options']),
'GROUP_TYPE' => $group_row['group_type'],
- 'AVATAR' => $avatar_img,
- 'AVATAR_IMAGE' => $avatar_img,
+ 'AVATAR' => (empty($avatar) ? '<img src="' . $phpbb_admin_path . 'images/no_avatar.gif" alt="" />' : $avatar),
+ 'AVATAR_IMAGE' => (empty($avatar) ? '<img src="' . $phpbb_admin_path . 'images/no_avatar.gif" alt="" />' : $avatar),
'AVATAR_WIDTH' => (isset($group_row['group_avatar_width'])) ? $group_row['group_avatar_width'] : '',
'AVATAR_HEIGHT' => (isset($group_row['group_avatar_height'])) ? $group_row['group_avatar_height'] : '',
));
@@ -483,10 +456,45 @@ class ucp_groups
$error = array();
- $avatar_select = basename(request_var('avatar_select', ''));
- $category = basename(request_var('category', ''));
+ // Setup avatar data for later
+ $avatars_enabled = false;
+ $avatar_drivers = null;
+ $avatar_data = null;
+ $avatar_error = array();
+
+ /** @var \phpbb\avatar\manager $phpbb_avatar_manager */
+ $phpbb_avatar_manager = $phpbb_container->get('avatar.manager');
+
+ if ($config['allow_avatar'])
+ {
+ $avatar_drivers = $phpbb_avatar_manager->get_enabled_drivers();
+
+ // This is normalised data, without the group_ prefix
+ $avatar_data = \phpbb\avatar\manager::clean_row($group_row, 'group');
+ }
+
+ // Handle deletion of avatars
+ if ($request->is_set_post('avatar_delete'))
+ {
+ if (confirm_box(true))
+ {
+ $phpbb_avatar_manager->handle_avatar_delete($db, $user, $avatar_data, GROUPS_TABLE, 'group_');
+ $cache->destroy('sql', GROUPS_TABLE);
- $can_upload = (file_exists($phpbb_root_path . $config['avatar_path']) && phpbb_is_writable($phpbb_root_path . $config['avatar_path']) && $file_uploads) ? true : false;
+ $message = ($action == 'edit') ? 'GROUP_UPDATED' : 'GROUP_CREATED';
+ trigger_error($user->lang[$message] . $return_page);
+ }
+ else
+ {
+ confirm_box(false, $user->lang('CONFIRM_AVATAR_DELETE'), build_hidden_fields(array(
+ 'avatar_delete' => true,
+ 'i' => $id,
+ 'mode' => $mode,
+ 'g' => $group_id,
+ 'action' => $action))
+ );
+ }
+ }
// Did we submit?
if ($update)
@@ -505,89 +513,31 @@ class ucp_groups
'receive_pm' => isset($_REQUEST['group_receive_pm']) ? 1 : 0,
'message_limit' => request_var('group_message_limit', 0),
'max_recipients'=> request_var('group_max_recipients', 0),
+ 'legend' => $group_row['group_legend'],
+ 'teampage' => $group_row['group_teampage'],
);
- $data['uploadurl'] = request_var('uploadurl', '');
- $data['remotelink'] = request_var('remotelink', '');
- $data['width'] = request_var('width', '');
- $data['height'] = request_var('height', '');
- $delete = request_var('delete', '');
-
- if (!empty($_FILES['uploadfile']['tmp_name']) || $data['uploadurl'] || $data['remotelink'])
+ if ($config['allow_avatar'])
{
- // Avatar stuff
- $var_ary = array(
- 'uploadurl' => array('string', true, 5, 255),
- 'remotelink' => array('string', true, 5, 255),
- 'width' => array('string', true, 1, 3),
- 'height' => array('string', true, 1, 3),
- );
+ // Handle avatar
+ $driver_name = $phpbb_avatar_manager->clean_driver_name($request->variable('avatar_driver', ''));
+ $config_name = preg_replace('#^avatar\.driver.#', '', $driver_name);
- if (!($error = validate_data($data, $var_ary)))
- {
- $data['user_id'] = "g$group_id";
-
- if ((!empty($_FILES['uploadfile']['tmp_name']) || $data['uploadurl']) && $can_upload)
- {
- list($submit_ary['avatar_type'], $submit_ary['avatar'], $submit_ary['avatar_width'], $submit_ary['avatar_height']) = avatar_upload($data, $error);
- }
- else if ($data['remotelink'])
- {
- list($submit_ary['avatar_type'], $submit_ary['avatar'], $submit_ary['avatar_width'], $submit_ary['avatar_height']) = avatar_remote($data, $error);
- }
- }
- }
- else if ($avatar_select && $config['allow_avatar_local'])
- {
- // check avatar gallery
- if (is_dir($phpbb_root_path . $config['avatar_gallery_path'] . '/' . $category))
+ if (in_array($driver_name, $avatar_drivers) && !$request->is_set_post('avatar_delete'))
{
- $submit_ary['avatar_type'] = AVATAR_GALLERY;
+ $driver = $phpbb_avatar_manager->get_driver($driver_name);
+ $result = $driver->process_form($request, $template, $user, $avatar_data, $avatar_error);
- list($submit_ary['avatar_width'], $submit_ary['avatar_height']) = getimagesize($phpbb_root_path . $config['avatar_gallery_path'] . '/' . $category . '/' . $avatar_select);
- $submit_ary['avatar'] = $category . '/' . $avatar_select;
- }
- }
- else if ($delete)
- {
- $submit_ary['avatar'] = '';
- $submit_ary['avatar_type'] = $submit_ary['avatar_width'] = $submit_ary['avatar_height'] = 0;
- }
- else if ($data['width'] && $data['height'])
- {
- // Only update the dimensions?
- if ($config['avatar_max_width'] || $config['avatar_max_height'])
- {
- if ($data['width'] > $config['avatar_max_width'] || $data['height'] > $config['avatar_max_height'])
+ if ($result && empty($avatar_error))
{
- $error[] = sprintf($user->lang['AVATAR_WRONG_SIZE'], $config['avatar_min_width'], $config['avatar_min_height'], $config['avatar_max_width'], $config['avatar_max_height'], $data['width'], $data['height']);
- }
- }
+ $result['avatar_type'] = $driver_name;
- if (!sizeof($error))
- {
- if ($config['avatar_min_width'] || $config['avatar_min_height'])
- {
- if ($data['width'] < $config['avatar_min_width'] || $data['height'] < $config['avatar_min_height'])
- {
- $error[] = sprintf($user->lang['AVATAR_WRONG_SIZE'], $config['avatar_min_width'], $config['avatar_min_height'], $config['avatar_max_width'], $config['avatar_max_height'], $data['width'], $data['height']);
- }
+ $submit_ary = array_merge($submit_ary, $result);
}
}
- if (!sizeof($error))
- {
- $submit_ary['avatar_width'] = $data['width'];
- $submit_ary['avatar_height'] = $data['height'];
- }
- }
-
- if ((isset($submit_ary['avatar']) && $submit_ary['avatar'] && (!isset($group_row['group_avatar']))) || $delete)
- {
- if (isset($group_row['group_avatar']) && $group_row['group_avatar'])
- {
- avatar_delete('group', $group_row, true);
- }
+ // Merge any avatars errors into the primary error array
+ $error = array_merge($error, $phpbb_avatar_manager->localize_errors($user, $avatar_error));
}
if (!check_form_key('ucp_groups'))
@@ -607,24 +557,28 @@ class ucp_groups
// Only set the rank, colour, etc. if it's changed or if we're adding a new
// group. This prevents existing group members being updated if no changes
// were made.
+ // However there are some attributes that need to be set everytime,
+ // otherwise the group gets removed from the feature.
+ $set_attributes = array('legend', 'teampage');
$group_attributes = array();
$test_variables = array(
'rank' => 'int',
'colour' => 'string',
'avatar' => 'string',
- 'avatar_type' => 'int',
+ 'avatar_type' => 'string',
'avatar_width' => 'int',
'avatar_height' => 'int',
'receive_pm' => 'int',
'legend' => 'int',
+ 'teampage' => 'int',
'message_limit' => 'int',
'max_recipients'=> 'int',
);
foreach ($test_variables as $test => $type)
{
- if (isset($submit_ary[$test]) && ($action == 'add' || $group_row['group_' . $test] != $submit_ary[$test]))
+ if (isset($submit_ary[$test]) && ($action == 'add' || $group_row['group_' . $test] != $submit_ary[$test] || isset($group_attributes['group_avatar']) && strpos($test, 'avatar') === 0 || in_array($test, $set_attributes)))
{
settype($submit_ary[$test], $type);
$group_attributes['group_' . $test] = $group_row['group_' . $test] = $submit_ary[$test];
@@ -634,6 +588,7 @@ class ucp_groups
if (!($error = group_create($group_id, $group_type, $group_name, $group_desc, $group_attributes, $allow_desc_bbcode, $allow_desc_urls, $allow_desc_smilies)))
{
$cache->destroy('sql', GROUPS_TABLE);
+ $cache->destroy('sql', TEAMPAGE_TABLE);
$message = ($action == 'edit') ? 'GROUP_UPDATED' : 'GROUP_CREATED';
trigger_error($user->lang[$message] . $return_page);
@@ -690,28 +645,59 @@ class ucp_groups
$type_closed = ($group_type == GROUP_CLOSED) ? ' checked="checked"' : '';
$type_hidden = ($group_type == GROUP_HIDDEN) ? ' checked="checked"' : '';
- $display_gallery = (isset($_POST['display_gallery'])) ? true : false;
-
- if ($config['allow_avatar'] && $config['allow_avatar_local'] && $display_gallery)
+ // Load up stuff for avatars
+ if ($config['allow_avatar'])
{
- avatar_gallery($category, $avatar_select, 4);
+ $avatars_enabled = false;
+ $selected_driver = $phpbb_avatar_manager->clean_driver_name($request->variable('avatar_driver', $avatar_data['avatar_type']));
+
+ // Assign min and max values before generating avatar driver html
+ $template->assign_vars(array(
+ 'AVATAR_MIN_WIDTH' => $config['avatar_min_width'],
+ 'AVATAR_MAX_WIDTH' => $config['avatar_max_width'],
+ 'AVATAR_MIN_HEIGHT' => $config['avatar_min_height'],
+ 'AVATAR_MAX_HEIGHT' => $config['avatar_max_height'],
+ ));
+
+ foreach ($avatar_drivers as $current_driver)
+ {
+ $driver = $phpbb_avatar_manager->get_driver($current_driver);
+
+ $avatars_enabled = true;
+ $template->set_filenames(array(
+ 'avatar' => $driver->get_template_name(),
+ ));
+
+ if ($driver->prepare_form($request, $template, $user, $avatar_data, $avatar_error))
+ {
+ $driver_name = $phpbb_avatar_manager->prepare_driver_name($current_driver);
+ $driver_upper = strtoupper($driver_name);
+ $template->assign_block_vars('avatar_drivers', array(
+ 'L_TITLE' => $user->lang($driver_upper . '_TITLE'),
+ 'L_EXPLAIN' => $user->lang($driver_upper . '_EXPLAIN'),
+
+ 'DRIVER' => $driver_name,
+ 'SELECTED' => $current_driver == $selected_driver,
+ 'OUTPUT' => $template->assign_display('avatar'),
+ ));
+ }
+ }
}
- $avatars_enabled = ($config['allow_avatar'] && (($can_upload && ($config['allow_avatar_upload'] || $config['allow_avatar_remote_upload'])) || ($config['allow_avatar_local'] || $config['allow_avatar_remote']))) ? true : false;
+ if (isset($phpbb_avatar_manager) && !$update)
+ {
+ // Merge any avatars errors into the primary error array
+ $error = array_merge($error, $phpbb_avatar_manager->localize_errors($user, $avatar_error));
+ }
$template->assign_vars(array(
'S_EDIT' => true,
'S_INCLUDE_SWATCH' => true,
- 'S_FORM_ENCTYPE' => ($config['allow_avatar'] && $can_upload && ($config['allow_avatar_upload'] || $config['allow_avatar_remote_upload'])) ? ' enctype="multipart/form-data"' : '',
+ 'S_FORM_ENCTYPE' => ' enctype="multipart/form-data"',
'S_ERROR' => (sizeof($error)) ? true : false,
'S_SPECIAL_GROUP' => ($group_type == GROUP_SPECIAL) ? true : false,
- 'S_AVATARS_ENABLED' => $avatars_enabled,
- 'S_DISPLAY_GALLERY' => ($config['allow_avatar'] && $config['allow_avatar_local'] && !$display_gallery) ? true : false,
- 'S_IN_GALLERY' => ($config['allow_avatar_local'] && $display_gallery) ? true : false,
-
- 'S_UPLOAD_AVATAR_FILE' => ($config['allow_avatar'] && $config['allow_avatar_upload'] && $can_upload) ? true : false,
- 'S_UPLOAD_AVATAR_URL' => ($config['allow_avatar'] && $config['allow_avatar_remote_upload'] && $can_upload) ? true : false,
- 'S_LINK_AVATAR' => ($config['allow_avatar'] && $config['allow_avatar_remote']) ? true : false,
+ 'S_AVATARS_ENABLED' => ($config['allow_avatar'] && $avatars_enabled),
+ 'S_GROUP_MANAGE' => true,
'ERROR_MSG' => (sizeof($error)) ? implode('<br />', $error) : '',
'GROUP_RECEIVE_PM' => (isset($group_row['group_receive_pm']) && $group_row['group_receive_pm']) ? ' checked="checked"' : '',
@@ -724,7 +710,6 @@ class ucp_groups
'S_DESC_SMILIES_CHECKED'=> $group_desc_data['allow_smilies'],
'S_RANK_OPTIONS' => $rank_options,
- 'AVATAR_MAX_FILESIZE' => $config['avatar_filesize'],
'GROUP_TYPE_FREE' => GROUP_FREE,
'GROUP_TYPE_OPEN' => GROUP_OPEN,
@@ -737,9 +722,8 @@ class ucp_groups
'GROUP_CLOSED' => $type_closed,
'GROUP_HIDDEN' => $type_hidden,
- 'U_SWATCH' => append_sid("{$phpbb_root_path}adm/swatch.$phpEx", 'form=ucp&amp;name=group_colour'),
'S_UCP_ACTION' => $this->u_action . "&amp;action=$action&amp;g=$group_id",
- 'L_AVATAR_EXPLAIN' => sprintf($user->lang['AVATAR_EXPLAIN'], $config['avatar_max_width'], $config['avatar_max_height'], $config['avatar_filesize'] / 1024),
+ 'L_AVATAR_EXPLAIN' => phpbb_avatar_explanation_string(),
));
break;
@@ -852,11 +836,14 @@ class ucp_groups
$s_action_options .= '<option value="' . $option . '">' . $user->lang['GROUP_' . $lang] . '</option>';
}
+ $pagination = $phpbb_container->get('pagination');
+ $base_url = $this->u_action . "&amp;action=$action&amp;g=$group_id";
+ $start = $pagination->validate_start($start, $config['topics_per_page'], $total_members);
+ $pagination->generate_template_pagination($base_url, 'pagination', 'start', $total_members, $config['topics_per_page'], $start);
+
$template->assign_vars(array(
'S_LIST' => true,
'S_ACTION_OPTIONS' => $s_action_options,
- 'S_ON_PAGE' => on_page($total_members, $config['topics_per_page'], $start),
- 'PAGINATION' => generate_pagination($this->u_action . "&amp;action=$action&amp;g=$group_id", $total_members, $config['topics_per_page'], $start),
'U_ACTION' => $this->u_action . "&amp;g=$group_id",
'S_UCP_ACTION' => $this->u_action . "&amp;g=$group_id",
@@ -1075,7 +1062,8 @@ class ucp_groups
'mode' => $mode,
'action' => $action
);
- confirm_box(false, sprintf($user->lang['GROUP_CONFIRM_ADD_USER' . ((sizeof($name_ary) == 1) ? '' : 'S')], implode(', ', $name_ary)), build_hidden_fields($s_hidden_fields));
+
+ confirm_box(false, $user->lang('GROUP_CONFIRM_ADD_USERS', sizeof($name_ary), implode($user->lang['COMMA_SEPARATOR'], $name_ary)), build_hidden_fields($s_hidden_fields));
}
trigger_error($user->lang['NO_USERS_ADDED'] . '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], '<a href="' . $this->u_action . '&amp;action=list&amp;g=' . $group_id . '">', '</a>'));
@@ -1117,5 +1105,3 @@ class ucp_groups
$this->tpl_name = 'ucp_groups_' . $mode;
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/ucp/ucp_login_link.php b/phpBB/includes/ucp/ucp_login_link.php
new file mode 100644
index 0000000000..bfe4804286
--- /dev/null
+++ b/phpBB/includes/ucp/ucp_login_link.php
@@ -0,0 +1,246 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+/**
+* @ignore
+*/
+if (!defined('IN_PHPBB'))
+{
+ exit;
+}
+
+/**
+* ucp_login_link
+* Allows users of external accounts link those accounts to their phpBB accounts
+* during an attempted login.
+*/
+class ucp_login_link
+{
+ /**
+ * @var string
+ */
+ public $u_action;
+
+ /**
+ * Generates the ucp_login_link page and handles login link process
+ *
+ * @param int $id
+ * @param string $mode
+ */
+ function main($id, $mode)
+ {
+ global $phpbb_container, $request, $template, $user;
+ global $phpbb_root_path, $phpEx;
+
+ // Initialize necessary variables
+ $login_error = null;
+ $login_link_error = null;
+ $login_username = null;
+
+ // Build the data array
+ $data = $this->get_login_link_data_array();
+
+ // Ensure the person was sent here with login_link data
+ if (empty($data))
+ {
+ $login_link_error = $user->lang['LOGIN_LINK_NO_DATA_PROVIDED'];
+ }
+
+ // Use the auth_provider requested even if different from configured
+ $provider_collection = $phpbb_container->get('auth.provider_collection');
+ $auth_provider = $provider_collection->get_provider($request->variable('auth_provider', ''));
+
+ // Set the link_method to login_link
+ $data['link_method'] = 'login_link';
+
+ // Have the authentication provider check that all necessary data is available
+ $result = $auth_provider->login_link_has_necessary_data($data);
+ if ($result !== null)
+ {
+ $login_link_error = $user->lang[$result];
+ }
+
+ // Perform link action if there is no error
+ if (!$login_link_error)
+ {
+ if ($request->is_set_post('login'))
+ {
+ $login_username = $request->variable('login_username', '', true, \phpbb\request\request_interface::POST);
+ $login_password = $request->untrimmed_variable('login_password', '', true, \phpbb\request\request_interface::POST);
+
+ $login_result = $auth_provider->login($login_username, $login_password);
+
+ // We only care if there is or is not an error
+ $login_error = $this->process_login_result($login_result);
+
+ if (!$login_error)
+ {
+ // Give the user_id to the data
+ $data['user_id'] = $login_result['user_row']['user_id'];
+
+ // The user is now logged in, attempt to link the user to the external account
+ $result = $auth_provider->link_account($data);
+
+ if ($result)
+ {
+ $login_link_error = $user->lang[$result];
+ }
+ else
+ {
+ // Finish login
+ $result = $user->session_create($login_result['user_row']['user_id'], false, false, true);
+
+ // Perform a redirect as the account has been linked
+ $this->perform_redirect();
+ }
+ }
+ }
+ }
+
+ $template->assign_vars(array(
+ // Common template elements
+ 'LOGIN_LINK_ERROR' => $login_link_error,
+ 'PASSWORD_CREDENTIAL' => 'login_password',
+ 'USERNAME_CREDENTIAL' => 'login_username',
+ 'S_HIDDEN_FIELDS' => $this->get_hidden_fields($data),
+
+ // Registration elements
+ 'REGISTER_ACTION' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=register'),
+
+ // Login elements
+ 'LOGIN_ERROR' => $login_error,
+ 'LOGIN_USERNAME' => $login_username,
+ ));
+
+ $this->tpl_name = 'ucp_login_link';
+ $this->page_title = 'UCP_LOGIN_LINK';
+ }
+
+ /**
+ * Builds the hidden fields string from the data array.
+ *
+ * @param array $data This function only includes data in the array
+ * that has a key that begins with 'login_link_'
+ * @return string A string of hidden fields that can be included in the
+ * template
+ */
+ protected function get_hidden_fields($data)
+ {
+ $fields = array();
+
+ foreach ($data as $key => $value)
+ {
+ $fields['login_link_' . $key] = $value;
+ }
+
+ return build_hidden_fields($fields);
+ }
+
+ /**
+ * Builds the login_link data array
+ *
+ * @return array All login_link data. This is all GET data whose names
+ * begin with 'login_link_'
+ */
+ protected function get_login_link_data_array()
+ {
+ global $request;
+
+ $var_names = $request->variable_names(\phpbb\request\request_interface::GET);
+ $login_link_data = array();
+ $string_start_length = strlen('login_link_');
+
+ foreach ($var_names as $var_name)
+ {
+ if (strpos($var_name, 'login_link_') === 0)
+ {
+ $key_name = substr($var_name, $string_start_length);
+ $login_link_data[$key_name] = $request->variable($var_name, '', false, \phpbb\request\request_interface::GET);
+ }
+ }
+
+ return $login_link_data;
+ }
+
+ /**
+ * Processes the result array from the login process
+ * @param array $result The login result array
+ * @return string|null If there was an error in the process, a string is
+ * returned. If the login was successful, then null is
+ * returned.
+ */
+ protected function process_login_result($result)
+ {
+ global $config, $request, $template, $user, $phpbb_container;
+
+ $login_error = null;
+
+ if ($result['status'] != LOGIN_SUCCESS)
+ {
+ // Handle all errors first
+ if ($result['status'] == LOGIN_BREAK)
+ {
+ trigger_error($result['error_msg']);
+ }
+
+ switch ($result['status'])
+ {
+ case LOGIN_ERROR_ATTEMPTS:
+
+ $captcha = $phpbb_container->get('captcha.factory')->get_instance($config['captcha_plugin']);
+ $captcha->init(CONFIRM_LOGIN);
+
+ $template->assign_vars(array(
+ 'CAPTCHA_TEMPLATE' => $captcha->get_template(),
+ ));
+
+ $login_error = $user->lang[$result['error_msg']];
+ break;
+
+ case LOGIN_ERROR_PASSWORD_CONVERT:
+ $login_error = sprintf(
+ $user->lang[$result['error_msg']],
+ ($config['email_enable']) ? '<a href="' . append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=sendpassword') . '">' : '',
+ ($config['email_enable']) ? '</a>' : '',
+ ($config['board_contact']) ? '<a href="mailto:' . htmlspecialchars($config['board_contact']) . '">' : '',
+ ($config['board_contact']) ? '</a>' : ''
+ );
+ break;
+
+ // Username, password, etc...
+ default:
+ $login_error = $user->lang[$result['error_msg']];
+
+ // Assign admin contact to some error messages
+ if ($result['error_msg'] == 'LOGIN_ERROR_USERNAME' || $result['error_msg'] == 'LOGIN_ERROR_PASSWORD')
+ {
+ $login_error = (!$config['board_contact']) ? sprintf($user->lang[$result['error_msg']], '', '') : sprintf($user->lang[$result['error_msg']], '<a href="mailto:' . htmlspecialchars($config['board_contact']) . '">', '</a>');
+ }
+
+ break;
+ }
+ }
+
+ return $login_error;
+ }
+
+ /**
+ * Performs a post login redirect
+ */
+ protected function perform_redirect()
+ {
+ global $phpbb_root_path, $phpEx;
+ $url = append_sid($phpbb_root_path . 'index.' . $phpEx);
+ redirect($url);
+ }
+}
diff --git a/phpBB/includes/ucp/ucp_main.php b/phpBB/includes/ucp/ucp_main.php
index a6f71669ce..8584a9a0fd 100644
--- a/phpBB/includes/ucp/ucp_main.php
+++ b/phpBB/includes/ucp/ucp_main.php
@@ -1,10 +1,13 @@
<?php
/**
*
-* @package ucp
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -19,7 +22,6 @@ if (!defined('IN_PHPBB'))
/**
* ucp_main
* UCP Front Panel
-* @package ucp
*/
class ucp_main
{
@@ -33,7 +35,8 @@ class ucp_main
function main($id, $mode)
{
- global $config, $db, $user, $auth, $template, $phpbb_root_path, $phpEx;
+ global $config, $db, $user, $auth, $template, $phpbb_root_path, $phpEx, $phpbb_dispatcher;
+ global $request;
switch ($mode)
{
@@ -56,39 +59,29 @@ class ucp_main
$sql_from .= ' LEFT JOIN ' . TOPICS_TRACK_TABLE . ' tt ON (tt.topic_id = t.topic_id
AND tt.user_id = ' . $user->data['user_id'] . ')';
$sql_select .= ', tt.mark_time';
+
+ $sql_from .= ' LEFT JOIN ' . FORUMS_TRACK_TABLE . ' ft ON (ft.forum_id = t.forum_id
+ AND ft.user_id = ' . $user->data['user_id'] . ')';
+ $sql_select .= ', ft.mark_time AS forum_mark_time';
}
$topic_type = $user->lang['VIEW_TOPIC_GLOBAL'];
$folder = 'global_read';
$folder_new = 'global_unread';
- // Get cleaned up list... return only those forums not having the f_read permission
- $forum_ary = $auth->acl_getf('!f_read', true);
+ // Get cleaned up list... return only those forums having the f_read permission
+ $forum_ary = $auth->acl_getf('f_read', true);
$forum_ary = array_unique(array_keys($forum_ary));
-
- // Determine first forum the user is able to read into - for global announcement link
- $sql = 'SELECT forum_id
- FROM ' . FORUMS_TABLE . '
- WHERE forum_type = ' . FORUM_POST;
-
- if (sizeof($forum_ary))
- {
- $sql .= ' AND ' . $db->sql_in_set('forum_id', $forum_ary, true);
- }
- $result = $db->sql_query_limit($sql, 1);
- $g_forum_id = (int) $db->sql_fetchfield('forum_id');
- $db->sql_freeresult($result);
-
- $sql = "SELECT t.* $sql_select
- FROM $sql_from
- WHERE t.forum_id = 0
- AND t.topic_type = " . POST_GLOBAL . '
- ORDER BY t.topic_last_post_time DESC';
-
$topic_list = $rowset = array();
+
// If the user can't see any forums, he can't read any posts because fid of 0 is invalid
- if ($g_forum_id)
+ if (!empty($forum_ary))
{
+ $sql = "SELECT t.* $sql_select
+ FROM $sql_from
+ WHERE t.topic_type = " . POST_GLOBAL . '
+ AND ' . $db->sql_in_set('t.forum_id', $forum_ary) . '
+ ORDER BY t.topic_last_post_time DESC, t.topic_last_post_id DESC';
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result))
@@ -99,15 +92,34 @@ class ucp_main
$db->sql_freeresult($result);
}
- $topic_tracking_info = array();
+ $topic_forum_list = array();
+ foreach ($rowset as $t_id => $row)
+ {
+ if (isset($forum_tracking_info[$row['forum_id']]))
+ {
+ $row['forum_mark_time'] = $forum_tracking_info[$row['forum_id']];
+ }
+
+ $topic_forum_list[$row['forum_id']]['forum_mark_time'] = ($config['load_db_lastread'] && $user->data['is_registered'] && isset($row['forum_mark_time'])) ? $row['forum_mark_time'] : 0;
+ $topic_forum_list[$row['forum_id']]['topics'][] = (int) $t_id;
+ }
+
+ $topic_tracking_info = $tracking_topics = array();
if ($config['load_db_lastread'])
{
- $topic_tracking_info = get_topic_tracking(0, $topic_list, $rowset, false, $topic_list);
+ foreach ($topic_forum_list as $f_id => $topic_row)
+ {
+ $topic_tracking_info += get_topic_tracking($f_id, $topic_row['topics'], $rowset, array($f_id => $topic_row['forum_mark_time']));
+ }
}
else
{
- $topic_tracking_info = get_complete_topic_tracking(0, $topic_list, $topic_list);
+ foreach ($topic_forum_list as $f_id => $topic_row)
+ {
+ $topic_tracking_info += get_complete_topic_tracking($f_id, $topic_row['topics']);
+ }
}
+ unset($topic_forum_list);
foreach ($topic_list as $topic_id)
{
@@ -148,18 +160,18 @@ class ucp_main
'TOPIC_TITLE' => censor_text($row['topic_title']),
'TOPIC_TYPE' => $topic_type,
+ 'TOPIC_IMG_STYLE' => $folder_img,
'TOPIC_FOLDER_IMG' => $user->img($folder_img, $folder_alt),
- 'TOPIC_FOLDER_IMG_SRC' => $user->img($folder_img, $folder_alt, false, '', 'src'),
'ATTACH_ICON_IMG' => ($auth->acl_get('u_download') && $auth->acl_get('f_download', $forum_id) && $row['topic_attachment']) ? $user->img('icon_topic_attach', '') : '',
'S_USER_POSTED' => (!empty($row['topic_posted']) && $row['topic_posted']) ? true : false,
'S_UNREAD' => $unread_topic,
'U_TOPIC_AUTHOR' => get_username_string('profile', $row['topic_poster'], $row['topic_first_poster_name'], $row['topic_first_poster_colour']),
- 'U_LAST_POST' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$g_forum_id&amp;t=$topic_id&amp;p=" . $row['topic_last_post_id']) . '#p' . $row['topic_last_post_id'],
+ 'U_LAST_POST' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&amp;t=$topic_id&amp;p=" . $row['topic_last_post_id']) . '#p' . $row['topic_last_post_id'],
'U_LAST_POST_AUTHOR' => get_username_string('profile', $row['topic_last_poster_id'], $row['topic_last_poster_name'], $row['topic_last_poster_colour']),
- 'U_NEWEST_POST' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$g_forum_id&amp;t=$topic_id&amp;view=unread") . '#unread',
- 'U_VIEW_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$g_forum_id&amp;t=$topic_id"))
+ 'U_NEWEST_POST' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&amp;t=$topic_id&amp;view=unread") . '#unread',
+ 'U_VIEW_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&amp;t=$topic_id"))
);
}
@@ -180,14 +192,11 @@ class ucp_main
$template->assign_vars(array(
'USER_COLOR' => (!empty($user->data['user_colour'])) ? $user->data['user_colour'] : '',
'JOINED' => $user->format_date($user->data['user_regdate']),
- 'VISITED' => (empty($last_visit)) ? ' - ' : $user->format_date($last_visit),
+ 'LAST_ACTIVE' => (empty($last_active)) ? ' - ' : $user->format_date($last_active),
'WARNINGS' => ($user->data['user_warnings']) ? $user->data['user_warnings'] : 0,
'POSTS' => ($user->data['user_posts']) ? $user->data['user_posts'] : 0,
- 'POSTS_DAY' => sprintf($user->lang['POST_DAY'], $posts_per_day),
- 'POSTS_PCT' => sprintf($user->lang['POST_PCT'], $percentage),
-
- 'OCCUPATION' => (!empty($row['user_occ'])) ? $row['user_occ'] : '',
- 'INTERESTS' => (!empty($row['user_interests'])) ? $row['user_interests'] : '',
+ 'POSTS_DAY' => $user->lang('POST_DAY', $posts_per_day),
+ 'POSTS_PCT' => $user->lang('POST_PCT', $percentage),
// 'S_GROUP_OPTIONS' => $group_options,
@@ -206,6 +215,14 @@ class ucp_main
$unwatch = (isset($_POST['unwatch'])) ? true : false;
+ /**
+ * Read and potentially modify the post data used to remove subscriptions to forums/topics
+ *
+ * @event core.ucp_main_subscribed_post_data
+ * @since 3.1.10-RC1
+ */
+ $phpbb_dispatcher->dispatch('core.ucp_main_subscribed_post_data');
+
if ($unwatch)
{
if (check_form_key('ucp_front_subscribed'))
@@ -287,10 +304,24 @@ class ucp_main
}
else
{
- $tracking_topics = (isset($_COOKIE[$config['cookie_name'] . '_track'])) ? ((STRIP) ? stripslashes($_COOKIE[$config['cookie_name'] . '_track']) : $_COOKIE[$config['cookie_name'] . '_track']) : '';
+ $tracking_topics = $request->variable($config['cookie_name'] . '_track', '', true, \phpbb\request\request_interface::COOKIE);
$tracking_topics = ($tracking_topics) ? tracking_unserialize($tracking_topics) : array();
}
+ /**
+ * Modify the query used to retrieve a list of subscribed forums
+ *
+ * @event core.ucp_main_subscribed_forums_modify_query
+ * @var array sql_array The subscribed forums query
+ * @var array forbidden_forums The list of forbidden forums
+ * @since 3.1.10-RC1
+ */
+ $vars = array(
+ 'sql_array',
+ 'forbidden_forums',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.ucp_main_subscribed_forums_modify_query', compact($vars)));
+
$sql = $db->sql_build_query('SELECT', $sql_array);
$result = $db->sql_query($sql);
@@ -332,10 +363,10 @@ class ucp_main
$last_post_time = $last_post_url = '';
}
- $template->assign_block_vars('forumrow', array(
+ $template_vars = array(
'FORUM_ID' => $forum_id,
+ 'FORUM_IMG_STYLE' => $folder_image,
'FORUM_FOLDER_IMG' => $user->img($folder_image, $folder_alt),
- 'FORUM_FOLDER_IMG_SRC' => $user->img($folder_image, $folder_alt, false, '', 'src'),
'FORUM_IMAGE' => ($row['forum_image']) ? '<img src="' . $phpbb_root_path . $row['forum_image'] . '" alt="' . $user->lang[$folder_alt] . '" />' : '',
'FORUM_IMAGE_SRC' => ($row['forum_image']) ? $phpbb_root_path . $row['forum_image'] : '',
'FORUM_NAME' => $row['forum_name'],
@@ -348,9 +379,39 @@ class ucp_main
'LAST_POST_AUTHOR_FULL' => get_username_string('full', $row['forum_last_poster_id'], $row['forum_last_poster_name'], $row['forum_last_poster_colour']),
'U_LAST_POST_AUTHOR' => get_username_string('profile', $row['forum_last_poster_id'], $row['forum_last_poster_name'], $row['forum_last_poster_colour']),
+ 'S_UNREAD_FORUM' => $unread_forum,
+
'U_LAST_POST' => $last_post_url,
- 'U_VIEWFORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $row['forum_id']))
+ 'U_VIEWFORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $row['forum_id'])
+ );
+
+ /**
+ * Add template variables to a subscribed forum row.
+ *
+ * @event core.ucp_main_subscribed_forum_modify_template_vars
+ * @var array template_vars Array containing the template variables for the row
+ * @var array row Array containing the subscribed forum row data
+ * @var int forum_id Forum ID
+ * @var string folder_image Folder image
+ * @var string folder_alt Alt text for the folder image
+ * @var bool unread_forum Whether the forum has unread content or not
+ * @var string last_post_time The time of the most recent post, expressed as a formatted date string
+ * @var string last_post_url The URL of the most recent post in the forum
+ * @since 3.1.10-RC1
+ */
+ $vars = array(
+ 'template_vars',
+ 'row',
+ 'forum_id',
+ 'folder_image',
+ 'folder_alt',
+ 'unread_forum',
+ 'last_post_time',
+ 'last_post_url',
);
+ extract($phpbb_dispatcher->trigger_event('core.ucp_main_subscribed_forum_modify_template_vars', compact($vars)));
+
+ $template->assign_block_vars('forumrow', $template_vars);
}
$db->sql_freeresult($result);
}
@@ -435,7 +496,7 @@ class ucp_main
$edit = (isset($_REQUEST['edit'])) ? true : false;
$submit = (isset($_POST['submit'])) ? true : false;
- $draft_id = ($edit) ? intval($_REQUEST['edit']) : 0;
+ $draft_id = $request->variable('edit', 0);
$delete = (isset($_POST['delete'])) ? true : false;
$s_hidden_fields = ($edit) ? '<input type="hidden" name="edit" value="' . $draft_id . '" />' : '';
@@ -611,7 +672,6 @@ class ucp_main
break;
}
-
$template->assign_vars(array(
'L_TITLE' => $user->lang['UCP_MAIN_' . strtoupper($mode)],
@@ -633,10 +693,11 @@ class ucp_main
*/
function assign_topiclist($mode = 'subscribed', $forbidden_forum_ary = array())
{
- global $user, $db, $template, $config, $cache, $auth, $phpbb_root_path, $phpEx;
+ global $user, $db, $template, $config, $cache, $auth, $phpbb_root_path, $phpEx, $phpbb_container, $request, $phpbb_dispatcher;
$table = ($mode == 'subscribed') ? TOPICS_WATCH_TABLE : BOOKMARKS_TABLE;
$start = request_var('start', 0);
+ $pagination = $phpbb_container->get('pagination');
// Grab icons
$icons = $cache->obtain_icons();
@@ -653,6 +714,23 @@ class ucp_main
AND i.user_id = ' . $user->data['user_id'] . '
AND ' . $db->sql_in_set('t.forum_id', $forbidden_forum_ary, true, true),
);
+
+ /**
+ * Modify the query used to retrieve the count of subscribed/bookmarked topics
+ *
+ * @event core.ucp_main_topiclist_count_modify_query
+ * @var array sql_array The subscribed/bookmarked topics query
+ * @var array forbidden_forum_ary The list of forbidden forums
+ * @var string mode The type of topic list ('subscribed' or 'bookmarks')
+ * @since 3.1.10-RC1
+ */
+ $vars = array(
+ 'sql_array',
+ 'forbidden_forum_ary',
+ 'mode',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.ucp_main_topiclist_count_modify_query', compact($vars)));
+
$sql = $db->sql_build_query('SELECT', $sql_array);
$result = $db->sql_query($sql);
$topics_count = (int) $db->sql_fetchfield('topics_count');
@@ -660,11 +738,12 @@ class ucp_main
if ($topics_count)
{
+ $start = $pagination->validate_start($start, $config['topics_per_page'], $topics_count);
+ $pagination->generate_template_pagination($this->u_action, 'pagination', 'start', $topics_count, $config['topics_per_page'], $start);
+
$template->assign_vars(array(
- 'PAGINATION' => generate_pagination($this->u_action, $topics_count, $config['topics_per_page'], $start),
- 'PAGE_NUMBER' => on_page($topics_count, $config['topics_per_page'], $start),
- 'TOTAL_TOPICS' => ($topics_count == 1) ? $user->lang['VIEW_FORUM_TOPIC'] : sprintf($user->lang['VIEW_FORUM_TOPICS'], $topics_count))
- );
+ 'TOTAL_TOPICS' => $user->lang('VIEW_FORUM_TOPICS', (int) $topics_count),
+ ));
}
if ($mode == 'subscribed')
@@ -681,8 +760,7 @@ class ucp_main
AND t.topic_id = tw.topic_id
AND ' . $db->sql_in_set('t.forum_id', $forbidden_forum_ary, true, true),
-
- 'ORDER_BY' => 't.topic_last_post_time DESC'
+ 'ORDER_BY' => 't.topic_last_post_time DESC, t.topic_last_post_id DESC'
);
$sql_array['LEFT_JOIN'] = array();
@@ -699,7 +777,7 @@ class ucp_main
'WHERE' => 'b.user_id = ' . $user->data['user_id'] . '
AND ' . $db->sql_in_set('f.forum_id', $forbidden_forum_ary, true, true),
- 'ORDER_BY' => 't.topic_last_post_time DESC'
+ 'ORDER_BY' => 't.topic_last_post_time DESC, t.topic_last_post_id DESC'
);
$sql_array['LEFT_JOIN'] = array();
@@ -721,6 +799,22 @@ class ucp_main
$sql_array['SELECT'] .= ', tp.topic_posted';
}
+ /**
+ * Modify the query used to retrieve the list of subscribed/bookmarked topics
+ *
+ * @event core.ucp_main_topiclist_modify_query
+ * @var array sql_array The subscribed/bookmarked topics query
+ * @var array forbidden_forum_ary The list of forbidden forums
+ * @var string mode The type of topic list ('subscribed' or 'bookmarks')
+ * @since 3.1.10-RC1
+ */
+ $vars = array(
+ 'sql_array',
+ 'forbidden_forum_ary',
+ 'mode',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.ucp_main_topiclist_modify_query', compact($vars)));
+
$sql = $db->sql_build_query('SELECT', $sql_array);
$result = $db->sql_query_limit($sql, $config['topics_per_page'], $start);
@@ -747,17 +841,19 @@ class ucp_main
{
foreach ($topic_forum_list as $f_id => $topic_row)
{
- $topic_tracking_info += get_topic_tracking($f_id, $topic_row['topics'], $rowset, array($f_id => $topic_row['forum_mark_time']), ($f_id == 0) ? $global_announce_list : false);
+ $topic_tracking_info += get_topic_tracking($f_id, $topic_row['topics'], $rowset, array($f_id => $topic_row['forum_mark_time']));
}
}
else
{
foreach ($topic_forum_list as $f_id => $topic_row)
{
- $topic_tracking_info += get_complete_topic_tracking($f_id, $topic_row['topics'], $global_announce_list);
+ $topic_tracking_info += get_complete_topic_tracking($f_id, $topic_row['topics']);
}
}
+ $phpbb_content_visibility = $phpbb_container->get('content.visibility');
+
foreach ($topic_list as $topic_id)
{
$row = &$rowset[$topic_id];
@@ -768,7 +864,7 @@ class ucp_main
$unread_topic = (isset($topic_tracking_info[$topic_id]) && $row['topic_last_post_time'] > $topic_tracking_info[$topic_id]) ? true : false;
// Replies
- $replies = ($auth->acl_get('m_approve', $forum_id)) ? $row['topic_replies_real'] : $row['topic_replies'];
+ $replies = $phpbb_content_visibility->get_count('topic_posts', $row, $forum_id) - 1;
if ($row['topic_status'] == ITEM_MOVED && !empty($row['topic_moved_id']))
{
@@ -783,7 +879,7 @@ class ucp_main
$view_topic_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", $view_topic_url_params);
// Send vars to template
- $template->assign_block_vars('topicrow', array(
+ $template_vars = array(
'FORUM_ID' => $forum_id,
'TOPIC_ID' => $topic_id,
'FIRST_POST_TIME' => $user->format_date($row['topic_time']),
@@ -802,17 +898,15 @@ class ucp_main
'U_LAST_POST_AUTHOR' => get_username_string('profile', $row['topic_last_poster_id'], $row['topic_last_poster_name'], $row['topic_last_poster_colour']),
'S_DELETED_TOPIC' => (!$row['topic_id']) ? true : false,
- 'S_GLOBAL_TOPIC' => (!$forum_id) ? true : false,
- 'PAGINATION' => topic_generate_pagination($replies, append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . (($row['forum_id']) ? $row['forum_id'] : $forum_id) . "&amp;t=$topic_id")),
'REPLIES' => $replies,
'VIEWS' => $row['topic_views'],
'TOPIC_TITLE' => censor_text($row['topic_title']),
'TOPIC_TYPE' => $topic_type,
'FORUM_NAME' => $row['forum_name'],
+ 'TOPIC_IMG_STYLE' => $folder_img,
'TOPIC_FOLDER_IMG' => $user->img($folder_img, $folder_alt),
- 'TOPIC_FOLDER_IMG_SRC' => $user->img($folder_img, $folder_alt, false, '', 'src'),
'TOPIC_FOLDER_IMG_ALT' => $user->lang[$folder_alt],
'TOPIC_ICON_IMG' => (!empty($icons[$row['icon_id']])) ? $icons[$row['icon_id']]['img'] : '',
'TOPIC_ICON_IMG_WIDTH' => (!empty($icons[$row['icon_id']])) ? $icons[$row['icon_id']]['width'] : '',
@@ -827,9 +921,43 @@ class ucp_main
'U_LAST_POST' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", $view_topic_url_params . '&amp;p=' . $row['topic_last_post_id']) . '#p' . $row['topic_last_post_id'],
'U_VIEW_TOPIC' => $view_topic_url,
'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_id),
- ));
+ );
+
+ /**
+ * Add template variables to a subscribed/bookmarked topic row.
+ *
+ * @event core.ucp_main_topiclist_topic_modify_template_vars
+ * @var array template_vars Array containing the template variables for the row
+ * @var array row Array containing the subscribed/bookmarked topic row data
+ * @var int forum_id ID of the forum containing the topic
+ * @var int topic_id Topic ID
+ * @var int replies Number of replies in the topic
+ * @var string topic_type Topic type
+ * @var string folder_img Folder image
+ * @var string folder_alt Alt text for the folder image
+ * @var array icons Array containing topic icons
+ * @var bool unread_topic Whether the topic has unread content or not
+ * @var string view_topic_url The URL of the topic
+ * @since 3.1.10-RC1
+ */
+ $vars = array(
+ 'template_vars',
+ 'row',
+ 'forum_id',
+ 'topic_id',
+ 'replies',
+ 'topic_type',
+ 'folder_img',
+ 'folder_alt',
+ 'icons',
+ 'unread_topic',
+ 'view_topic_url',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.ucp_main_topiclist_topic_modify_template_vars', compact($vars)));
+
+ $template->assign_block_vars('topicrow', $template_vars);
+
+ $pagination->generate_template_pagination(append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id'] . "&amp;t=$topic_id"), 'topicrow.pagination', 'start', $replies + 1, $config['posts_per_page'], 1, true, true);
}
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/ucp/ucp_notifications.php b/phpBB/includes/ucp/ucp_notifications.php
new file mode 100644
index 0000000000..66dc651447
--- /dev/null
+++ b/phpBB/includes/ucp/ucp_notifications.php
@@ -0,0 +1,239 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+/**
+* @ignore
+*/
+if (!defined('IN_PHPBB'))
+{
+ exit;
+}
+
+class ucp_notifications
+{
+ public $u_action;
+
+ public function main($id, $mode)
+ {
+ global $config, $template, $user, $request, $phpbb_container;
+ global $phpbb_root_path, $phpEx;
+
+ add_form_key('ucp_notification');
+
+ $start = $request->variable('start', 0);
+ $form_time = $request->variable('form_time', 0);
+ $form_time = ($form_time <= 0 || $form_time > time()) ? time() : $form_time;
+
+ $phpbb_notifications = $phpbb_container->get('notification_manager');
+ $pagination = $phpbb_container->get('pagination');
+
+ switch ($mode)
+ {
+ case 'notification_options':
+ $subscriptions = $phpbb_notifications->get_global_subscriptions(false);
+
+ // Add/remove subscriptions
+ if ($request->is_set_post('submit'))
+ {
+ if (!check_form_key('ucp_notification'))
+ {
+ trigger_error('FORM_INVALID');
+ }
+
+ $notification_methods = $phpbb_notifications->get_subscription_methods();
+
+ foreach ($phpbb_notifications->get_subscription_types() as $group => $subscription_types)
+ {
+ foreach ($subscription_types as $type => $data)
+ {
+ foreach ($notification_methods as $method => $method_data)
+ {
+ if ($request->is_set_post(str_replace('.', '_', $type . '_' . $method_data['id'])) && (!isset($subscriptions[$type]) || !in_array($method_data['id'], $subscriptions[$type])))
+ {
+ $phpbb_notifications->add_subscription($type, 0, $method_data['id']);
+ }
+ else if (!$request->is_set_post(str_replace('.', '_', $type . '_' . $method_data['id'])) && isset($subscriptions[$type]) && in_array($method_data['id'], $subscriptions[$type]))
+ {
+ $phpbb_notifications->delete_subscription($type, 0, $method_data['id']);
+ }
+ }
+
+ if ($request->is_set_post(str_replace('.', '_', $type) . '_notification') && !isset($subscriptions[$type]))
+ {
+ $phpbb_notifications->add_subscription($type);
+ }
+ else if (!$request->is_set_post(str_replace('.', '_', $type) . '_notification') && isset($subscriptions[$type]))
+ {
+ $phpbb_notifications->delete_subscription($type);
+ }
+ }
+ }
+
+ meta_refresh(3, $this->u_action);
+ $message = $user->lang['PREFERENCES_UPDATED'] . '<br /><br />' . sprintf($user->lang['RETURN_UCP'], '<a href="' . $this->u_action . '">', '</a>');
+ trigger_error($message);
+ }
+
+ $this->output_notification_methods($phpbb_notifications, $template, $user, 'notification_methods');
+
+ $this->output_notification_types($subscriptions, $phpbb_notifications, $template, $user, 'notification_types');
+
+ $this->tpl_name = 'ucp_notifications';
+ $this->page_title = 'UCP_NOTIFICATION_OPTIONS';
+ break;
+
+ case 'notification_list':
+ default:
+ // Mark all items read
+ if ($request->variable('mark', '') == 'all' && check_link_hash($request->variable('token', ''), 'mark_all_notifications_read'))
+ {
+ $phpbb_notifications->mark_notifications_read(false, false, $user->data['user_id'], $form_time);
+
+ meta_refresh(3, $this->u_action);
+ $message = $user->lang['NOTIFICATIONS_MARK_ALL_READ_SUCCESS'];
+
+ if ($request->is_ajax())
+ {
+ $json_response = new \phpbb\json_response();
+ $json_response->send(array(
+ 'MESSAGE_TITLE' => $user->lang['INFORMATION'],
+ 'MESSAGE_TEXT' => $message,
+ 'success' => true,
+ ));
+ }
+ $message .= '<br /><br />' . $user->lang('RETURN_UCP', '<a href="' . $this->u_action . '">', '</a>');
+
+ trigger_error($message);
+ }
+
+ // Mark specific notifications read
+ if ($request->is_set_post('submit'))
+ {
+ if (!check_form_key('ucp_notification'))
+ {
+ trigger_error('FORM_INVALID');
+ }
+
+ $mark_read = $request->variable('mark', array(0));
+
+ if (!empty($mark_read))
+ {
+ $phpbb_notifications->mark_notifications_read_by_id($mark_read, $form_time);
+ }
+ }
+
+ $notifications = $phpbb_notifications->load_notifications(array(
+ 'start' => $start,
+ 'limit' => $config['topics_per_page'],
+ 'count_total' => true,
+ ));
+
+ foreach ($notifications['notifications'] as $notification)
+ {
+ $template->assign_block_vars('notification_list', $notification->prepare_for_display());
+ }
+
+ $base_url = append_sid("{$phpbb_root_path}ucp.$phpEx", "i=ucp_notifications&amp;mode=notification_list");
+ $start = $pagination->validate_start($start, $config['topics_per_page'], $notifications['total_count']);
+ $pagination->generate_template_pagination($base_url, 'pagination', 'start', $notifications['total_count'], $config['topics_per_page'], $start);
+
+ $template->assign_vars(array(
+ 'TOTAL_COUNT' => $notifications['total_count'],
+ 'U_MARK_ALL' => $base_url . '&amp;mark=all&amp;token=' . generate_link_hash('mark_all_notifications_read'),
+ ));
+
+ $this->tpl_name = 'ucp_notifications';
+ $this->page_title = 'UCP_NOTIFICATION_LIST';
+ break;
+ }
+
+ $template->assign_vars(array(
+ 'TITLE' => $user->lang($this->page_title),
+ 'TITLE_EXPLAIN' => $user->lang($this->page_title . '_EXPLAIN'),
+
+ 'MODE' => $mode,
+
+ 'FORM_TIME' => time(),
+ ));
+ }
+
+ /**
+ * Output all the notification types to the template
+ *
+ * @param array $subscriptions Array containing global subscriptions
+ * @param \phpbb\notification\manager $phpbb_notifications
+ * @param \phpbb\template\template $template
+ * @param \phpbb\user $user
+ * @param string $block
+ */
+ public function output_notification_types($subscriptions, \phpbb\notification\manager $phpbb_notifications, \phpbb\template\template $template, \phpbb\user $user, $block = 'notification_types')
+ {
+ $notification_methods = $phpbb_notifications->get_subscription_methods();
+
+ foreach ($phpbb_notifications->get_subscription_types() as $group => $subscription_types)
+ {
+ $template->assign_block_vars($block, array(
+ 'GROUP_NAME' => $user->lang($group),
+ ));
+
+ foreach ($subscription_types as $type => $data)
+ {
+ $template->assign_block_vars($block, array(
+ 'TYPE' => $type,
+
+ 'NAME' => $user->lang($data['lang']),
+ 'EXPLAIN' => (isset($user->lang[$data['lang'] . '_EXPLAIN'])) ? $user->lang($data['lang'] . '_EXPLAIN') : '',
+
+ 'SUBSCRIBED' => (isset($subscriptions[$type])) ? true : false,
+ ));
+
+ foreach ($notification_methods as $method => $method_data)
+ {
+ $template->assign_block_vars($block . '.notification_methods', array(
+ 'METHOD' => $method_data['id'],
+
+ 'NAME' => $user->lang($method_data['lang']),
+
+ 'SUBSCRIBED' => (isset($subscriptions[$type]) && in_array($method_data['id'], $subscriptions[$type])) ? true : false,
+ ));
+ }
+ }
+ }
+
+ $template->assign_vars(array(
+ strtoupper($block) . '_COLS' => sizeof($notification_methods) + 2,
+ ));
+ }
+
+ /**
+ * Output all the notification methods to the template
+ *
+ * @param \phpbb\notification\manager $phpbb_notifications
+ * @param \phpbb\template\template $template
+ * @param \phpbb\user $user
+ * @param string $block
+ */
+ public function output_notification_methods(\phpbb\notification\manager $phpbb_notifications, \phpbb\template\template $template, \phpbb\user $user, $block = 'notification_methods')
+ {
+ $notification_methods = $phpbb_notifications->get_subscription_methods();
+
+ foreach ($notification_methods as $method => $method_data)
+ {
+ $template->assign_block_vars($block, array(
+ 'METHOD' => $method_data['id'],
+
+ 'NAME' => $user->lang($method_data['lang']),
+ ));
+ }
+ }
+}
diff --git a/phpBB/includes/ucp/ucp_pm.php b/phpBB/includes/ucp/ucp_pm.php
index 447b6ebe87..f026cd3eb3 100644
--- a/phpBB/includes/ucp/ucp_pm.php
+++ b/phpBB/includes/ucp/ucp_pm.php
@@ -1,9 +1,13 @@
<?php
/**
-* @package ucp
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -34,8 +38,6 @@ if (!defined('IN_PHPBB'))
* Quoting a post (action=quotepost&p=[post_id])
* Quoting a PM (action=quote&p=[msg_id])
* Forwarding a PM (action=forward&p=[msg_id])
-*
-* @package ucp
*/
class ucp_pm
{
@@ -43,7 +45,7 @@ class ucp_pm
function main($id, $mode)
{
- global $user, $template, $phpbb_root_path, $auth, $phpEx, $db, $config;
+ global $user, $template, $phpbb_root_path, $auth, $phpEx, $db, $config, $request;
if (!$user->data['is_registered'])
{
@@ -84,40 +86,13 @@ class ucp_pm
switch ($mode)
{
- // New private messages popup
- case 'popup':
-
- $l_new_message = '';
- if ($user->data['is_registered'])
- {
- if ($user->data['user_new_privmsg'])
- {
- $l_new_message = ($user->data['user_new_privmsg'] == 1) ? $user->lang['YOU_NEW_PM'] : $user->lang['YOU_NEW_PMS'];
- }
- else
- {
- $l_new_message = $user->lang['YOU_NO_NEW_PM'];
- }
- }
-
- $template->assign_vars(array(
- 'MESSAGE' => $l_new_message,
- 'S_NOT_LOGGED_IN' => ($user->data['user_id'] == ANONYMOUS) ? true : false,
- 'CLICK_TO_VIEW' => sprintf($user->lang['CLICK_VIEW_PRIVMSG'], '<a href="' . append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&amp;folder=inbox') . '" onclick="jump_to_inbox(this.href); return false;">', '</a>'),
- 'U_INBOX' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&amp;folder=inbox'),
- 'UA_INBOX' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&folder=inbox', false))
- );
-
- $tpl_file = 'ucp_pm_popup';
- break;
-
// Compose message
case 'compose':
$action = request_var('action', 'post');
$user_folders = get_folder($user->data['user_id']);
- if (!$auth->acl_get('u_sendpm'))
+ if ($action != 'delete' && !$auth->acl_get('u_sendpm'))
{
// trigger_error('NO_AUTH_SEND_MESSAGE');
$template->assign_vars(array(
@@ -200,7 +175,6 @@ class ucp_pm
trigger_error('NO_AUTH_READ_HOLD_MESSAGE');
}
-
// First Handle Mark actions and moving messages
$submit_mark = (isset($_POST['submit_mark'])) ? true : false;
$move_pm = (isset($_POST['move_pm'])) ? true : false;
@@ -272,6 +246,27 @@ class ucp_pm
$folder_id = (int) $row['folder_id'];
}
+ if ($request->variable('mark', '') == 'all' && check_link_hash($request->variable('token', ''), 'mark_all_pms_read'))
+ {
+ mark_folder_read($user->data['user_id'], $folder_id);
+
+ meta_refresh(3, $this->u_action);
+ $message = $user->lang['PM_MARK_ALL_READ_SUCCESS'];
+
+ if ($request->is_ajax())
+ {
+ $json_response = new \phpbb\json_response();
+ $json_response->send(array(
+ 'MESSAGE_TITLE' => $user->lang['INFORMATION'],
+ 'MESSAGE_TEXT' => $message,
+ 'success' => true,
+ ));
+ }
+ $message .= '<br /><br />' . $user->lang('RETURN_UCP', '<a href="' . $this->u_action . '">', '</a>');
+
+ trigger_error($message);
+ }
+
$message_row = array();
if ($action == 'view_message' && $msg_id)
{
@@ -345,8 +340,8 @@ class ucp_pm
'NUM_NOT_MOVED' => $num_not_moved,
'NUM_REMOVED' => $num_removed,
'RELEASE_MESSAGE_INFO' => sprintf($user->lang['RELEASE_MESSAGES'], '<a href="' . $this->u_action . '&amp;folder=' . $folder_id . '&amp;release=1">', '</a>'),
- 'NOT_MOVED_MESSAGES' => ($num_not_moved == 1) ? $user->lang['NOT_MOVED_MESSAGE'] : sprintf($user->lang['NOT_MOVED_MESSAGES'], $num_not_moved),
- 'RULE_REMOVED_MESSAGES' => ($num_removed == 1) ? $user->lang['RULE_REMOVED_MESSAGE'] : sprintf($user->lang['RULE_REMOVED_MESSAGES'], $num_removed),
+ 'NOT_MOVED_MESSAGES' => $user->lang('NOT_MOVED_MESSAGES', (int) $num_not_moved),
+ 'RULE_REMOVED_MESSAGES' => $user->lang('RULE_REMOVED_MESSAGES', (int) $num_removed),
'S_FOLDER_OPTIONS' => $s_folder_options,
'S_TO_FOLDER_OPTIONS' => $s_to_folder_options,
@@ -358,6 +353,7 @@ class ucp_pm
'U_SENTBOX' => $this->u_action . '&amp;folder=sentbox',
'U_CREATE_FOLDER' => $this->u_action . '&amp;mode=options',
'U_CURRENT_FOLDER' => $this->u_action . '&amp;folder=' . $folder_id,
+ 'U_MARK_ALL' => $this->u_action . '&amp;folder=' . $folder_id . '&amp;mark=all&amp;token=' . generate_link_hash('mark_all_pms_read'),
'S_IN_INBOX' => ($folder_id == PRIVMSGS_INBOX) ? true : false,
'S_IN_OUTBOX' => ($folder_id == PRIVMSGS_OUTBOX) ? true : false,
@@ -380,9 +376,10 @@ class ucp_pm
else if ($action == 'view_message')
{
$template->assign_vars(array(
- 'S_VIEW_MESSAGE' => true,
- 'MSG_ID' => $msg_id)
- );
+ 'S_VIEW_MESSAGE' => true,
+ 'L_RETURN_TO_FOLDER' => $user->lang('RETURN_TO', $folder_status['folder_name']),
+ 'MSG_ID' => $msg_id,
+ ));
if (!$msg_id)
{
@@ -412,5 +409,3 @@ class ucp_pm
$this->page_title = 'UCP_PM_' . strtoupper($mode);
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/ucp/ucp_pm_compose.php b/phpBB/includes/ucp/ucp_pm_compose.php
index d7509a1072..4906eec1bb 100644
--- a/phpBB/includes/ucp/ucp_pm_compose.php
+++ b/phpBB/includes/ucp/ucp_pm_compose.php
@@ -1,10 +1,13 @@
<?php
/**
*
-* @package ucp
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -22,8 +25,9 @@ if (!defined('IN_PHPBB'))
*/
function compose_pm($id, $mode, $action, $user_folders = array())
{
- global $template, $db, $auth, $user;
+ global $template, $db, $auth, $user, $cache;
global $phpbb_root_path, $phpEx, $config;
+ global $request, $phpbb_dispatcher, $phpbb_container;
// Damn php and globals - i know, this is horrible
// Needed for handle_message_list_actions()
@@ -49,15 +53,8 @@ function compose_pm($id, $mode, $action, $user_folders = array())
// Reply to all triggered (quote/reply)
$reply_to_all = request_var('reply_to_all', 0);
- // Do NOT use request_var or specialchars here
- $address_list = isset($_REQUEST['address_list']) ? $_REQUEST['address_list'] : array();
-
- if (!is_array($address_list))
- {
- $address_list = array();
- }
+ $address_list = $request->variable('address_list', array('' => array(0 => '')));
- $submit = (isset($_POST['post'])) ? true : false;
$preview = (isset($_POST['preview'])) ? true : false;
$save = (isset($_POST['save'])) ? true : false;
$load = (isset($_POST['load'])) ? true : false;
@@ -71,6 +68,7 @@ function compose_pm($id, $mode, $action, $user_folders = array())
$refresh = isset($_POST['add_file']) || isset($_POST['delete_file']) || $save || $load
|| $remove_u || $remove_g || $add_to || $add_bcc;
+ $submit = $request->is_set_post('post') && !$refresh && !$preview;
$action = ($delete && !$preview && !$refresh && $submit) ? 'delete' : $action;
$select_single = ($config['allow_mass_pm'] && $auth->acl_get('u_masspm')) ? false : true;
@@ -92,6 +90,32 @@ function compose_pm($id, $mode, $action, $user_folders = array())
// we include the language file here
$user->add_lang('viewtopic');
+ /**
+ * Modify the default vars before composing a PM
+ *
+ * @event core.ucp_pm_compose_modify_data
+ * @var int msg_id post_id in the page request
+ * @var int to_user_id The id of whom the message is to
+ * @var int to_group_id The id of the group the message is to
+ * @var bool submit Whether the form has been submitted
+ * @var bool preview Whether the user is previewing the PM or not
+ * @var string action One of: post, reply, quote, forward, quotepost, edit, delete, smilies
+ * @var bool delete Whether the user is deleting the PM
+ * @var int reply_to_all Value of reply_to_all request variable.
+ * @since 3.1.4-RC1
+ */
+ $vars = array(
+ 'msg_id',
+ 'to_user_id',
+ 'to_group_id',
+ 'submit',
+ 'preview',
+ 'action',
+ 'delete',
+ 'reply_to_all',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.ucp_pm_compose_modify_data', compact($vars)));
+
// Output PM_TO box if message composing
if ($action != 'edit')
{
@@ -130,7 +154,7 @@ function compose_pm($id, $mode, $action, $user_folders = array())
'S_SHOW_PM_BOX' => true,
'S_ALLOW_MASS_PM' => ($config['allow_mass_pm'] && $auth->acl_get('u_masspm')) ? true : false,
'S_GROUP_OPTIONS' => ($config['allow_mass_pm'] && $auth->acl_get('u_masspm_group')) ? $group_options : '',
- 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=searchuser&amp;form=postform&amp;field=username_list&amp;select_single=$select_single"),
+ 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=searchuser&amp;form=postform&amp;field=username_list&amp;select_single=" . (int) $select_single),
));
}
@@ -234,6 +258,42 @@ function compose_pm($id, $mode, $action, $user_folders = array())
if ($sql)
{
+ /**
+ * Alter sql query to get message for user to write the PM
+ *
+ * @event core.ucp_pm_compose_compose_pm_basic_info_query_before
+ * @var string sql String with the query to be executed
+ * @var array forum_list List of forums that contain the posts
+ * @var int visibility_const Integer with one of the possible ITEM_* constant values
+ * @var int msg_id topic_id in the page request
+ * @var int to_user_id The id of whom the message is to
+ * @var int to_group_id The id of the group whom the message is to
+ * @var bool submit Whether the user is sending the PM or not
+ * @var bool preview Whether the user is previewing the PM or not
+ * @var string action One of: post, reply, quote, forward, quotepost, edit, delete, smilies
+ * @var bool delete Whether the user is deleting the PM
+ * @var int reply_to_all Value of reply_to_all request variable.
+ * @var string limit_time_sql String with the SQL code to limit the time interval of the post (Note: May be empty string)
+ * @var string sort_order_sql String with the ORDER BY SQL code used in this query
+ * @since 3.1.0-RC5
+ */
+ $vars = array(
+ 'sql',
+ 'forum_list',
+ 'visibility_const',
+ 'msg_id',
+ 'to_user_id',
+ 'to_group_id',
+ 'submit',
+ 'preview',
+ 'action',
+ 'delete',
+ 'reply_to_all',
+ 'limit_time_sql',
+ 'sort_order_sql',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.ucp_pm_compose_compose_pm_basic_info_query_before', compact($vars)));
+
$result = $db->sql_query($sql);
$post = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
@@ -268,6 +328,40 @@ function compose_pm($id, $mode, $action, $user_folders = array())
trigger_error('NOT_AUTHORISED');
}
+ /**
+ * Get the result of querying for the post to be quoted in the pm message
+ *
+ * @event core.ucp_pm_compose_quotepost_query_after
+ * @var string sql The original SQL used in the query
+ * @var array post Associative array with the data of the quoted post
+ * @var array msg_id The post_id that was searched to get the message for quoting
+ * @var int visibility_const Visibility of the quoted post (one of the possible ITEM_* constant values)
+ * @var int topic_id Topic ID of the quoted post
+ * @var int to_user_id Users the message is sent to
+ * @var int to_group_id Groups the message is sent to
+ * @var bool submit Whether the user is sending the PM or not
+ * @var bool preview Whether the user is previewing the PM or not
+ * @var string action One of: post, reply, quote, forward, quotepost, edit, delete, smilies
+ * @var bool delete If deleting message
+ * @var int reply_to_all Value of reply_to_all request variable.
+ * @since 3.1.0-RC5
+ */
+ $vars = array(
+ 'sql',
+ 'post',
+ 'msg_id',
+ 'visibility_const',
+ 'topic_id',
+ 'to_user_id',
+ 'to_group_id',
+ 'submit',
+ 'preview',
+ 'action',
+ 'delete',
+ 'reply_to_all',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.ucp_pm_compose_quotepost_query_after', compact($vars)));
+
// Passworded forum?
if ($post['forum_id'])
{
@@ -356,6 +450,17 @@ function compose_pm($id, $mode, $action, $user_folders = array())
$message_attachment = 0;
$message_text = $message_subject = '';
+ /**
+ * Predefine message text and subject
+ *
+ * @event core.ucp_pm_compose_predefined_message
+ * @var string message_text Message text
+ * @var string message_subject Messate subject
+ * @since 3.1.11-RC1
+ */
+ $vars = array('message_text', 'message_subject');
+ extract($phpbb_dispatcher->trigger_event('core.ucp_pm_compose_predefined_message', compact($vars)));
+
if ($to_user_id && $to_user_id != ANONYMOUS && $action == 'post')
{
$address_list['u'][$to_user_id] = 'to';
@@ -391,6 +496,8 @@ function compose_pm($id, $mode, $action, $user_folders = array())
}
$message_parser = new parse_message();
+ $plupload = $phpbb_container->get('plupload');
+ $message_parser->set_plupload($plupload);
$message_parser->message = ($action == 'reply') ? '' : $message_text;
unset($message_text);
@@ -495,7 +602,7 @@ function compose_pm($id, $mode, $action, $user_folders = array())
if ($message_attachment && !$submit && !$refresh && !$preview && $action == 'edit')
{
// Do not change to SELECT *
- $sql = 'SELECT attach_id, is_orphan, attach_comment, real_filename
+ $sql = 'SELECT attach_id, is_orphan, attach_comment, real_filename, filesize
FROM ' . ATTACHMENTS_TABLE . "
WHERE post_msg_id = $msg_id
AND in_message = 1
@@ -589,7 +696,6 @@ function compose_pm($id, $mode, $action, $user_folders = array())
);
$s_hidden_fields .= build_address_field($address_list);
-
confirm_box(false, 'SAVE_DRAFT', $s_hidden_fields);
}
}
@@ -656,6 +762,34 @@ function compose_pm($id, $mode, $action, $user_folders = array())
$enable_urls = (isset($_POST['disable_magic_url'])) ? 0 : 1;
$enable_sig = (!$config['allow_sig'] ||!$config['allow_sig_pm']) ? false : ((isset($_POST['attach_sig'])) ? true : false);
+ /**
+ * Modify private message
+ *
+ * @event core.ucp_pm_compose_modify_parse_before
+ * @var bool enable_bbcode Whether or not bbcode is enabled
+ * @var bool enable_smilies Whether or not smilies are enabled
+ * @var bool enable_urls Whether or not urls are enabled
+ * @var bool enable_sig Whether or not signature is enabled
+ * @var string subject PM subject text
+ * @var object message_parser The message parser object
+ * @var bool submit Whether or not the form has been sumitted
+ * @var bool preview Whether or not the signature is being previewed
+ * @var array error Any error strings
+ * @since 3.1.10-RC1
+ */
+ $vars = array(
+ 'enable_bbcode',
+ 'enable_smilies',
+ 'enable_urls',
+ 'enable_sig',
+ 'subject',
+ 'message_parser',
+ 'submit',
+ 'preview',
+ 'error',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.ucp_pm_compose_modify_parse_before', compact($vars)));
+
if ($submit)
{
$status_switch = (($enable_bbcode+1) << 8) + (($enable_smilies+1) << 4) + (($enable_urls+1) << 2) + (($enable_sig+1) << 1);
@@ -751,7 +885,6 @@ function compose_pm($id, $mode, $action, $user_folders = array())
$return_box_url = ($action === 'post' || $action === 'edit') ? $outbox_folder_url : $inbox_folder_url;
$return_box_lang = ($action === 'post' || $action === 'edit') ? 'PM_OUTBOX' : 'PM_INBOX';
-
$save_message = ($action === 'edit') ? $user->lang['MESSAGE_EDITED'] : $user->lang['MESSAGE_STORED'];
$message = $save_message . '<br /><br />' . $user->lang('VIEW_PRIVATE_MESSAGE', '<a href="' . $return_message_url . '">', '</a>');
@@ -841,11 +974,11 @@ function compose_pm($id, $mode, $action, $user_folders = array())
$post_id = request_var('p', 0);
if ($config['allow_post_links'])
{
- $message_link = "[url=" . generate_board_url() . "/viewtopic.$phpEx?p={$post_id}#p{$post_id}]{$user->lang['SUBJECT']}: {$message_subject}[/url]\n\n";
+ $message_link = "[url=" . generate_board_url() . "/viewtopic.$phpEx?p={$post_id}#p{$post_id}]{$user->lang['SUBJECT']}{$user->lang['COLON']} {$message_subject}[/url]\n\n";
}
else
{
- $message_link = $user->lang['SUBJECT'] . ': ' . $message_subject . " (" . generate_board_url() . "/viewtopic.$phpEx?p={$post_id}#p{$post_id})\n\n";
+ $message_link = $user->lang['SUBJECT'] . $user->lang['COLON'] . ' ' . $message_subject . " (" . generate_board_url() . "/viewtopic.$phpEx?p={$post_id}#p{$post_id})\n\n";
}
}
else
@@ -878,7 +1011,7 @@ function compose_pm($id, $mode, $action, $user_folders = array())
$forward_text[] = sprintf($user->lang['FWD_SUBJECT'], censor_text($message_subject));
$forward_text[] = sprintf($user->lang['FWD_DATE'], $user->format_date($message_time, false, true));
$forward_text[] = sprintf($user->lang['FWD_FROM'], $quote_username_text);
- $forward_text[] = sprintf($user->lang['FWD_TO'], implode(', ', $fwd_to_field['to']));
+ $forward_text[] = sprintf($user->lang['FWD_TO'], implode($user->lang['COMMA_SEPARATOR'], $fwd_to_field['to']));
$message_parser->message = implode("\n", $forward_text) . "\n\n[quote=&quot;{$quote_username}&quot;]\n" . censor_text(trim($message_parser->message)) . "\n[/quote]";
$message_subject = ((!preg_match('/^Fwd:/', $message_subject)) ? 'Fwd: ' : '') . censor_text($message_subject);
@@ -1009,7 +1142,6 @@ function compose_pm($id, $mode, $action, $user_folders = array())
// Build hidden address list
$s_hidden_address_field = build_address_field($address_list);
-
$bbcode_checked = (isset($enable_bbcode)) ? !$enable_bbcode : (($config['allow_bbcode'] && $auth->acl_get('u_pm_bbcode')) ? !$user->optionget('bbcode') : 1);
$smilies_checked = (isset($enable_smilies)) ? !$enable_smilies : (($config['allow_smilies'] && $auth->acl_get('u_pm_smilies')) ? !$user->optionget('smilies') : 1);
$urls_checked = (isset($enable_urls)) ? !$enable_urls : 0;
@@ -1048,7 +1180,7 @@ function compose_pm($id, $mode, $action, $user_folders = array())
$s_hidden_fields = '<input type="hidden" name="lastclick" value="' . $current_time . '" />';
$s_hidden_fields .= (isset($check_value)) ? '<input type="hidden" name="status_switch" value="' . $check_value . '" />' : '';
- $s_hidden_fields .= ($draft_id || isset($_REQUEST['draft_loaded'])) ? '<input type="hidden" name="draft_loaded" value="' . ((isset($_REQUEST['draft_loaded'])) ? intval($_REQUEST['draft_loaded']) : $draft_id) . '" />' : '';
+ $s_hidden_fields .= ($draft_id || isset($_REQUEST['draft_loaded'])) ? '<input type="hidden" name="draft_loaded" value="' . ((isset($_REQUEST['draft_loaded'])) ? $request->variable('draft_loaded', 0) : $draft_id) . '" />' : '';
$form_enctype = (@ini_get('file_uploads') == '0' || strtolower(@ini_get('file_uploads')) == 'off' || !$config['allow_pm_attach'] || !$auth->acl_get('u_pm_attach')) ? '' : ' enctype="multipart/form-data"';
@@ -1056,7 +1188,7 @@ function compose_pm($id, $mode, $action, $user_folders = array())
$template->assign_vars(array(
'L_POST_A' => $page_title,
'L_ICON' => $user->lang['PM_ICON'],
- 'L_MESSAGE_BODY_EXPLAIN' => (intval($config['max_post_chars'])) ? sprintf($user->lang['MESSAGE_BODY_EXPLAIN'], intval($config['max_post_chars'])) : '',
+ 'L_MESSAGE_BODY_EXPLAIN' => $user->lang('MESSAGE_BODY_EXPLAIN', (int) $config['max_post_chars']),
'SUBJECT' => (isset($message_subject)) ? $message_subject : '',
'MESSAGE' => $message_text,
@@ -1084,6 +1216,7 @@ function compose_pm($id, $mode, $action, $user_folders = array())
'S_SAVE_ALLOWED' => ($auth->acl_get('u_savedrafts') && $action != 'edit') ? true : false,
'S_HAS_DRAFTS' => ($auth->acl_get('u_savedrafts') && $drafts),
'S_FORM_ENCTYPE' => $form_enctype,
+ 'S_ATTACH_DATA' => json_encode($message_parser->attachment_data),
'S_BBCODE_IMG' => $img_status,
'S_BBCODE_FLASH' => $flash_status,
@@ -1105,6 +1238,12 @@ function compose_pm($id, $mode, $action, $user_folders = array())
// Show attachment box for adding attachments if true
$allowed = ($auth->acl_get('u_pm_attach') && $config['allow_pm_attach'] && $form_enctype);
+ if ($allowed)
+ {
+ $max_files = ($auth->acl_gets('a_', 'm_')) ? 0 : (int) $config['max_attachments_pm'];
+ $plupload->configure($cache, $template, $s_action, false, $max_files);
+ }
+
// Attachment entry
posting_gen_attachment_entry($attachment_data, $filename_data, $allowed);
@@ -1124,11 +1263,12 @@ function compose_pm($id, $mode, $action, $user_folders = array())
function handle_message_list_actions(&$address_list, &$error, $remove_u, $remove_g, $add_to, $add_bcc)
{
global $auth, $db, $user;
+ global $request;
// Delete User [TO/BCC]
- if ($remove_u && !empty($_REQUEST['remove_u']) && is_array($_REQUEST['remove_u']))
+ if ($remove_u && $request->variable('remove_u', array(0 => '')))
{
- $remove_user_id = array_keys($_REQUEST['remove_u']);
+ $remove_user_id = array_keys($request->variable('remove_u', array(0 => '')));
if (isset($remove_user_id[0]))
{
@@ -1137,9 +1277,9 @@ function handle_message_list_actions(&$address_list, &$error, $remove_u, $remove
}
// Delete Group [TO/BCC]
- if ($remove_g && !empty($_REQUEST['remove_g']) && is_array($_REQUEST['remove_g']))
+ if ($remove_g && $request->variable('remove_g', array(0 => '')))
{
- $remove_group_id = array_keys($_REQUEST['remove_g']);
+ $remove_group_id = array_keys($request->variable('remove_g', array(0 => '')));
if (isset($remove_group_id[0]))
{
@@ -1207,7 +1347,7 @@ function handle_message_list_actions(&$address_list, &$error, $remove_u, $remove
}
// Add Friends if specified
- $friend_list = (isset($_REQUEST['add_' . $type]) && is_array($_REQUEST['add_' . $type])) ? array_map('intval', array_keys($_REQUEST['add_' . $type])) : array();
+ $friend_list = array_keys($request->variable('add_' . $type, array(0)));
$user_id_ary = array_merge($user_id_ary, $friend_list);
foreach ($user_id_ary as $user_id)
@@ -1224,29 +1364,80 @@ function handle_message_list_actions(&$address_list, &$error, $remove_u, $remove
// Check for disallowed recipients
if (!empty($address_list['u']))
{
- // We need to check their PM status (do they want to receive PM's?)
- // Only check if not a moderator or admin, since they are allowed to override this user setting
- if (!$auth->acl_gets('a_', 'm_') && !$auth->acl_getf_global('m_'))
+ $can_ignore_allow_pm = $auth->acl_gets('a_', 'm_') || $auth->acl_getf_global('m_');
+
+ // Administrator deactivated users check and we need to check their
+ // PM status (do they want to receive PM's?)
+ // Only check PM status if not a moderator or admin, since they
+ // are allowed to override this user setting
+ $sql = 'SELECT user_id, user_allow_pm
+ FROM ' . USERS_TABLE . '
+ WHERE ' . $db->sql_in_set('user_id', array_keys($address_list['u'])) . '
+ AND (
+ (user_type = ' . USER_INACTIVE . '
+ AND user_inactive_reason = ' . INACTIVE_MANUAL . ')
+ ' . ($can_ignore_allow_pm ? '' : ' OR user_allow_pm = 0') . '
+ )';
+
+ $result = $db->sql_query($sql);
+
+ $removed_no_pm = $removed_no_permission = false;
+ while ($row = $db->sql_fetchrow($result))
{
- $sql = 'SELECT user_id
- FROM ' . USERS_TABLE . '
- WHERE ' . $db->sql_in_set('user_id', array_keys($address_list['u'])) . '
- AND user_allow_pm = 0';
- $result = $db->sql_query($sql);
+ if (!$can_ignore_allow_pm && !$row['user_allow_pm'])
+ {
+ $removed_no_pm = true;
+ }
+ else
+ {
+ $removed_no_permission = true;
+ }
- $removed = false;
- while ($row = $db->sql_fetchrow($result))
+ unset($address_list['u'][$row['user_id']]);
+ }
+ $db->sql_freeresult($result);
+
+ // print a notice about users not being added who do not want to receive pms
+ if ($removed_no_pm)
+ {
+ $error[] = $user->lang['PM_USERS_REMOVED_NO_PM'];
+ }
+
+ // print a notice about users not being added who do not have permission to receive PMs
+ if ($removed_no_permission)
+ {
+ $error[] = $user->lang['PM_USERS_REMOVED_NO_PERMISSION'];
+ }
+
+ if (!sizeof(array_keys($address_list['u'])))
+ {
+ return;
+ }
+
+ // Check if users have permission to read PMs
+ $can_read = $auth->acl_get_list(array_keys($address_list['u']), 'u_readpm');
+ $can_read = (empty($can_read) || !isset($can_read[0]['u_readpm'])) ? array() : $can_read[0]['u_readpm'];
+ $cannot_read_list = array_diff(array_keys($address_list['u']), $can_read);
+ if (!empty($cannot_read_list))
+ {
+ foreach ($cannot_read_list as $cannot_read)
{
- $removed = true;
- unset($address_list['u'][$row['user_id']]);
+ unset($address_list['u'][$cannot_read]);
}
- $db->sql_freeresult($result);
- // print a notice about users not being added who do not want to receive pms
- if ($removed)
+ $error[] = $user->lang['PM_USERS_REMOVED_NO_PERMISSION'];
+ }
+
+ // Check if users are banned
+ $banned_user_list = phpbb_get_banned_user_ids(array_keys($address_list['u']), false);
+ if (!empty($banned_user_list))
+ {
+ foreach ($banned_user_list as $banned_user)
{
- $error[] = $user->lang['PM_USERS_REMOVED_NO_PM'];
+ unset($address_list['u'][$banned_user]);
}
+
+ $error[] = $user->lang['PM_USERS_REMOVED_NO_PERMISSION'];
}
}
}
@@ -1305,5 +1496,3 @@ function get_recipients($address_list, $num_recipients = 1)
return $recipient;
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/ucp/ucp_pm_options.php b/phpBB/includes/ucp/ucp_pm_options.php
index 1d5c0ecce3..d1fc9d2c62 100644
--- a/phpBB/includes/ucp/ucp_pm_options.php
+++ b/phpBB/includes/ucp/ucp_pm_options.php
@@ -1,10 +1,13 @@
<?php
/**
*
-* @package ucp
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -70,7 +73,7 @@ function message_options($id, $mode, $global_privmsgs_rules, $global_rule_condit
trigger_error($message);
}
}
-
+
// Add Folder
if (isset($_POST['addfolder']))
{
@@ -231,11 +234,11 @@ function message_options($id, $mode, $global_privmsgs_rules, $global_rule_condit
// Move Messages
case 1:
$num_moved = move_pm($user->data['user_id'], $user->data['message_limit'], $msg_ids, $move_to, $remove_folder_id);
-
+
// Something went wrong, only partially moved?
if ($num_moved != $folder_row['pm_count'])
{
- trigger_error(sprintf($user->lang['MOVE_PM_ERROR'], $num_moved, $folder_row['pm_count']));
+ trigger_error($user->lang('MOVE_PM_ERROR', $user->lang('MESSAGES_COUNT', (int) $folder_row['pm_count']), $num_moved));
}
break;
@@ -423,10 +426,10 @@ function message_options($id, $mode, $global_privmsgs_rules, $global_rule_condit
$result = $db->sql_query($sql);
$num_messages = (int) $db->sql_fetchfield('num_messages');
$db->sql_freeresult($result);
-
+
$folder[PRIVMSGS_INBOX] = array(
'folder_name' => $user->lang['PM_INBOX'],
- 'message_status' => sprintf($user->lang['FOLDER_MESSAGE_STATUS'], $num_messages, $user->data['message_limit'])
+ 'message_status' => $user->lang('FOLDER_MESSAGE_STATUS', $user->lang('MESSAGES_COUNT', (int) $user->data['message_limit']), $num_messages),
);
$sql = 'SELECT folder_id, folder_name, pm_count
@@ -440,7 +443,7 @@ function message_options($id, $mode, $global_privmsgs_rules, $global_rule_condit
$num_user_folder++;
$folder[$row['folder_id']] = array(
'folder_name' => $row['folder_name'],
- 'message_status' => sprintf($user->lang['FOLDER_MESSAGE_STATUS'], $row['pm_count'], $user->data['message_limit'])
+ 'message_status' => $user->lang('FOLDER_MESSAGE_STATUS', $user->lang('MESSAGES_COUNT', (int) $user->data['message_limit']), (int) $row['pm_count']),
);
}
$db->sql_freeresult($result);
@@ -696,7 +699,7 @@ function define_rule_option($hardcoded, $rule_option, $rule_lang, $check_ary)
function define_cond_option($hardcoded, $cond_option, $rule_option, $global_rule_conditions)
{
global $db, $template, $auth, $user;
-
+
$template->assign_vars(array(
'S_COND_DEFINED' => true,
'S_COND_SELECT' => (!$hardcoded && isset($global_rule_conditions[$rule_option])) ? true : false)
@@ -720,7 +723,7 @@ function define_cond_option($hardcoded, $cond_option, $rule_option, $global_rule
{
case 'text':
$rule_string = utf8_normalize_nfc(request_var('rule_string', '', true));
-
+
$template->assign_vars(array(
'S_TEXT_CONDITION' => true,
'CURRENT_STRING' => $rule_string,
@@ -734,7 +737,7 @@ function define_cond_option($hardcoded, $cond_option, $rule_option, $global_rule
case 'user':
$rule_user_id = request_var('rule_user_id', 0);
$rule_string = utf8_normalize_nfc(request_var('rule_string', '', true));
-
+
if ($rule_string && !$rule_user_id)
{
$sql = 'SELECT user_id
@@ -796,10 +799,10 @@ function define_cond_option($hardcoded, $cond_option, $rule_option, $global_rule
{
$sql .= 'WHERE';
}
-
- $sql .= " (g.group_name NOT IN ('GUESTS', 'BOTS') OR g.group_type <> " . GROUP_SPECIAL . ')
+
+ $sql .= " (g.group_name NOT IN ('GUESTS', 'BOTS') OR g.group_type <> " . GROUP_SPECIAL . ')
ORDER BY g.group_type DESC, g.group_name ASC';
-
+
$result = $db->sql_query($sql);
$s_group_options = '';
@@ -812,7 +815,7 @@ function define_cond_option($hardcoded, $cond_option, $rule_option, $global_rule
$s_class = ($row['group_type'] == GROUP_SPECIAL) ? ' class="sep"' : '';
$s_selected = ($row['group_id'] == $rule_group_id) ? ' selected="selected"' : '';
-
+
$s_group_options .= '<option value="' . $row['group_id'] . '"' . $s_class . $s_selected . '>' . (($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']) . '</option>';
}
$db->sql_freeresult($result);
@@ -850,7 +853,7 @@ function show_defined_rules($user_id, $check_lang, $rule_lang, $action_lang, $fo
WHERE user_id = ' . $user_id . '
ORDER BY rule_id ASC';
$result = $db->sql_query($sql);
-
+
$count = 0;
while ($row = $db->sql_fetchrow($result))
{
@@ -866,5 +869,3 @@ function show_defined_rules($user_id, $check_lang, $rule_lang, $action_lang, $fo
}
$db->sql_freeresult($result);
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/ucp/ucp_pm_viewfolder.php b/phpBB/includes/ucp/ucp_pm_viewfolder.php
index bd7bf89854..3364206680 100644
--- a/phpBB/includes/ucp/ucp_pm_viewfolder.php
+++ b/phpBB/includes/ucp/ucp_pm_viewfolder.php
@@ -1,10 +1,13 @@
<?php
/**
*
-* @package ucp
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -165,7 +168,7 @@ function view_folder($id, $mode, $folder_id, $folder)
'PM_ICON_IMG' => (!empty($icons[$row['icon_id']])) ? '<img src="' . $config['icons_path'] . '/' . $icons[$row['icon_id']]['img'] . '" width="' . $icons[$row['icon_id']]['width'] . '" height="' . $icons[$row['icon_id']]['height'] . '" alt="" title="" />' : '',
'PM_ICON_URL' => (!empty($icons[$row['icon_id']])) ? $config['icons_path'] . '/' . $icons[$row['icon_id']]['img'] : '',
'FOLDER_IMG' => $user->img($folder_img, $folder_alt),
- 'FOLDER_IMG_SRC' => $user->img($folder_img, $folder_alt, false, '', 'src'),
+ 'FOLDER_IMG_STYLE' => $folder_img,
'PM_IMG' => ($row_indicator) ? $user->img('pm_' . $row_indicator, '') : '',
'ATTACH_ICON_IMG' => ($auth->acl_get('u_pm_download') && $row['message_attachment'] && $config['allow_pm_attach']) ? $user->img('icon_topic_attach', $user->lang['TOTAL_ATTACHMENTS']) : '',
@@ -177,7 +180,7 @@ function view_folder($id, $mode, $folder_id, $folder)
'U_VIEW_PM' => ($row['pm_deleted']) ? '' : $view_message_url,
'U_REMOVE_PM' => ($row['pm_deleted']) ? $remove_message_url : '',
'U_MCP_REPORT' => (isset($row['report_id'])) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=pm_reports&amp;mode=pm_report_details&amp;r=' . $row['report_id']) : '',
- 'RECIPIENTS' => ($folder_id == PRIVMSGS_OUTBOX || $folder_id == PRIVMSGS_SENTBOX) ? implode(', ', $address_list[$message_id]) : '')
+ 'RECIPIENTS' => ($folder_id == PRIVMSGS_OUTBOX || $folder_id == PRIVMSGS_SENTBOX) ? implode($user->lang['COMMA_SEPARATOR'], $address_list[$message_id]) : '')
);
}
unset($folder_info['rowset']);
@@ -267,10 +270,10 @@ function view_folder($id, $mode, $folder_id, $folder)
}
}
- // There is the chance that all recipients of the message got deleted. To avoid creating
+ // There is the chance that all recipients of the message got deleted. To avoid creating
// exports without recipients, we add a bogus "undisclosed recipient".
- if (!(isset($address[$message_id]['g']) && sizeof($address[$message_id]['g'])) &&
- !(isset($address[$message_id]['u']) && sizeof($address[$message_id]['u'])))
+ if (!(isset($address[$message_id]['g']) && sizeof($address[$message_id]['g'])) &&
+ !(isset($address[$message_id]['u']) && sizeof($address[$message_id]['u'])))
{
$address[$message_id]['u'] = array();
$address[$message_id]['u']['to'] = array();
@@ -278,12 +281,12 @@ function view_folder($id, $mode, $folder_id, $folder)
}
decode_message($message_row['message_text'], $message_row['bbcode_uid']);
-
+
$data[] = array(
'subject' => censor_text($row['message_subject']),
'sender' => $row['username'],
// ISO 8601 date. For PHP4 we are able to hardcode the timezone because $user->format_date() does not set it.
- 'date' => $user->format_date($row['message_time'], (PHP_VERSION >= 5) ? 'c' : "Y-m-d\TH:i:s+00:00", true),
+ 'date' => $user->format_date($row['message_time'], 'c', true),
'to' => ($folder_id == PRIVMSGS_OUTBOX || $folder_id == PRIVMSGS_SENTBOX) ? $address[$message_id] : '',
'message' => $message_row['message_text']
);
@@ -380,7 +383,7 @@ function view_folder($id, $mode, $folder_id, $folder)
break;
}
- header('Pragma: no-cache');
+ header('Cache-Control: private, no-cache');
header("Content-Type: $mimetype; name=\"data.$filetype\"");
header("Content-disposition: attachment; filename=data.$filetype");
echo $string;
@@ -394,7 +397,7 @@ function view_folder($id, $mode, $folder_id, $folder)
*/
function get_pm_from($folder_id, $folder, $user_id)
{
- global $user, $db, $template, $config, $auth, $phpbb_root_path, $phpEx;
+ global $user, $db, $template, $config, $auth, $phpbb_container, $phpbb_root_path, $phpEx, $phpbb_dispatcher;
$start = request_var('start', 0);
@@ -403,6 +406,8 @@ function get_pm_from($folder_id, $folder, $user_id)
$sort_key = request_var('sk', 't');
$sort_dir = request_var('sd', 'd');
+ $pagination = $phpbb_container->get('pagination');
+
// PM ordering options
$limit_days = array(0 => $user->lang['ALL_MESSAGES'], 1 => $user->lang['1_DAY'], 7 => $user->lang['7_DAYS'], 14 => $user->lang['2_WEEKS'], 30 => $user->lang['1_MONTH'], 90 => $user->lang['3_MONTHS'], 180 => $user->lang['6_MONTHS'], 365 => $user->lang['1_YEAR']);
@@ -452,10 +457,12 @@ function get_pm_from($folder_id, $folder, $user_id)
$sql_limit_time = '';
}
- $template->assign_vars(array(
- 'PAGINATION' => generate_pagination(append_sid("{$phpbb_root_path}ucp.$phpEx", "i=pm&amp;mode=view&amp;action=view_folder&amp;f=$folder_id&amp;$u_sort_param"), $pm_count, $config['topics_per_page'], $start),
- 'PAGE_NUMBER' => on_page($pm_count, $config['topics_per_page'], $start),
- 'TOTAL_MESSAGES' => (($pm_count == 1) ? $user->lang['VIEW_PM_MESSAGE'] : sprintf($user->lang['VIEW_PM_MESSAGES'], $pm_count)),
+ $base_url = append_sid("{$phpbb_root_path}ucp.$phpEx", "i=pm&amp;mode=view&amp;action=view_folder&amp;f=$folder_id&amp;$u_sort_param");
+ $start = $pagination->validate_start($start, $config['topics_per_page'], $pm_count);
+ $pagination->generate_template_pagination($base_url, 'pagination', 'start', $pm_count, $config['topics_per_page'], $start);
+
+ $template_vars = array(
+ 'TOTAL_MESSAGES' => $user->lang('VIEW_PM_MESSAGES', (int) $pm_count),
'POST_IMG' => (!$auth->acl_get('u_sendpm')) ? $user->img('button_topic_locked', 'POST_PM_LOCKED') : $user->img('button_pm_new', 'POST_NEW_PM'),
@@ -468,7 +475,33 @@ function get_pm_from($folder_id, $folder, $user_id)
'U_POST_NEW_TOPIC' => ($auth->acl_get('u_sendpm')) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&amp;mode=compose') : '',
'S_PM_ACTION' => append_sid("{$phpbb_root_path}ucp.$phpEx", "i=pm&amp;mode=view&amp;action=view_folder&amp;f=$folder_id" . (($start !== 0) ? "&amp;start=$start" : '')),
- ));
+ );
+
+ /**
+ * Modify template variables before they are assigned
+ *
+ * @event core.ucp_pm_view_folder_get_pm_from_template
+ * @var int folder_id Folder ID
+ * @var array folder Folder data
+ * @var int user_id User ID
+ * @var string base_url Pagination base URL
+ * @var int start Pagination start
+ * @var int pm_count Count of PMs
+ * @var array template_vars Template variables to be assigned
+ * @since 3.1.11-RC1
+ */
+ $vars = array(
+ 'folder_id',
+ 'folder',
+ 'user_id',
+ 'base_url',
+ 'start',
+ 'pm_count',
+ 'template_vars',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.ucp_pm_view_folder_get_pm_from_template', compact($vars)));
+
+ $template->assign_vars($template_vars);
// Grab all pm data
$rowset = $pm_list = array();
@@ -480,14 +513,10 @@ function get_pm_from($folder_id, $folder, $user_id)
{
$store_reverse = true;
- if ($start + $config['topics_per_page'] > $pm_count)
- {
- $sql_limit = min($config['topics_per_page'], max(1, $pm_count - $start));
- }
-
// Select the sort order
$direction = ($sort_dir == 'd') ? 'ASC' : 'DESC';
- $sql_start = max(0, $pm_count - $sql_limit - $start);
+ $sql_limit = $pagination->reverse_limit($start, $sql_limit, $pm_count);
+ $sql_start = $pagination->reverse_start($start, $sql_limit, $pm_count);
}
else
{
@@ -506,15 +535,38 @@ function get_pm_from($folder_id, $folder, $user_id)
$sql_sort_order = $sort_by_sql[$sort_key] . ' ' . $direction;
}
- $sql = 'SELECT t.*, p.root_level, p.message_time, p.message_subject, p.icon_id, p.to_address, p.message_attachment, p.bcc_address, u.username, u.username_clean, u.user_colour, p.message_reported
- FROM ' . PRIVMSGS_TO_TABLE . ' t, ' . PRIVMSGS_TABLE . ' p, ' . USERS_TABLE . " u
- WHERE t.user_id = $user_id
+ $sql_ary = array(
+ 'SELECT' => 't.*, p.root_level, p.message_time, p.message_subject, p.icon_id, p.to_address, p.message_attachment, p.bcc_address, u.username, u.username_clean, u.user_colour, p.message_reported',
+ 'FROM' => array(
+ PRIVMSGS_TO_TABLE => 't',
+ PRIVMSGS_TABLE => 'p',
+ USERS_TABLE => 'u',
+ ),
+ 'WHERE' => "t.user_id = $user_id
AND p.author_id = u.user_id
AND $folder_sql
AND t.msg_id = p.msg_id
- $sql_limit_time
- ORDER BY $sql_sort_order";
- $result = $db->sql_query_limit($sql, $sql_limit, $sql_start);
+ $sql_limit_time",
+ 'ORDER_BY' => $sql_sort_order,
+ );
+
+ /**
+ * Modify SQL before it is executed
+ *
+ * @event core.ucp_pm_view_folder_get_pm_from_sql
+ * @var array sql_ary SQL array
+ * @var int sql_limit SQL limit
+ * @var int sql_start SQL start
+ * @since 3.1.11-RC1
+ */
+ $vars = array(
+ 'sql_ary',
+ 'sql_limit',
+ 'sql_start',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.ucp_pm_view_folder_get_pm_from_sql', compact($vars)));
+
+ $result = $db->sql_query_limit($db->sql_build_query('SELECT', $sql_ary), $sql_limit, $sql_start);
$pm_reported = array();
while ($row = $db->sql_fetchrow($result))
@@ -552,5 +604,3 @@ function get_pm_from($folder_id, $folder, $user_id)
'rowset' => $rowset
);
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/ucp/ucp_pm_viewmessage.php b/phpBB/includes/ucp/ucp_pm_viewmessage.php
index 82a095dd9c..d7b9b32dbf 100644
--- a/phpBB/includes/ucp/ucp_pm_viewmessage.php
+++ b/phpBB/includes/ucp/ucp_pm_viewmessage.php
@@ -1,10 +1,13 @@
<?php
/**
*
-* @package ucp
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -21,8 +24,8 @@ if (!defined('IN_PHPBB'))
*/
function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row)
{
- global $user, $template, $auth, $db, $cache;
- global $phpbb_root_path, $phpEx, $config;
+ global $user, $template, $auth, $db, $cache, $phpbb_container;
+ global $phpbb_root_path, $request, $phpEx, $config, $phpbb_dispatcher;
$user->add_lang(array('viewtopic', 'memberlist'));
@@ -50,13 +53,12 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row)
// Grab icons
$icons = $cache->obtain_icons();
- $bbcode = false;
-
- // Instantiate BBCode if need be
- if ($message_row['bbcode_bitfield'])
+ // Load the custom profile fields
+ if ($config['load_cpf_pm'])
{
- include($phpbb_root_path . 'includes/bbcode.' . $phpEx);
- $bbcode = new bbcode($message_row['bbcode_bitfield']);
+ $cp = $phpbb_container->get('profilefields.manager');
+
+ $profile_fields = $cp->grab_profile_fields_data($author_id);
}
// Assign TO/BCC Addresses to template
@@ -65,17 +67,8 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row)
$user_info = get_user_information($author_id, $message_row);
// Parse the message and subject
- $message = censor_text($message_row['message_text']);
-
- // Second parse bbcode here
- if ($message_row['bbcode_bitfield'])
- {
- $bbcode->bbcode_second_pass($message, $message_row['bbcode_uid'], $message_row['bbcode_bitfield']);
- }
-
- // Always process smilies after parsing bbcodes
- $message = bbcode_nl2br($message);
- $message = smiley_text($message);
+ $parse_flags = ($message_row['bbcode_bitfield'] ? OPTION_FLAG_BBCODE : 0) | OPTION_FLAG_SMILIES;
+ $message = generate_text_for_display($message_row['message_text'], $message_row['bbcode_uid'], $message_row['bbcode_bitfield'], $parse_flags, true);
// Replace naughty words such as farty pants
$message_row['message_subject'] = censor_text($message_row['message_subject']);
@@ -83,8 +76,16 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row)
// Editing information
if ($message_row['message_edit_count'] && $config['display_last_edited'])
{
- $l_edit_time_total = ($message_row['message_edit_count'] == 1) ? $user->lang['EDITED_TIME_TOTAL'] : $user->lang['EDITED_TIMES_TOTAL'];
- $l_edited_by = '<br /><br />' . sprintf($l_edit_time_total, (!$message_row['message_edit_user']) ? $message_row['username'] : $message_row['message_edit_user'], $user->format_date($message_row['message_edit_time'], false, true), $message_row['message_edit_count']);
+ if (!$message_row['message_edit_user'])
+ {
+ $display_username = get_username_string('full', $author_id, $user_info['username'], $user_info['user_colour']);
+ }
+ else
+ {
+ $edit_user_info = get_user_information($message_row['message_edit_user'], false);
+ $display_username = get_username_string('full', $message_row['message_edit_user'], $edit_user_info['username'], $edit_user_info['user_colour']);
+ }
+ $l_edited_by = '<br /><br />' . $user->lang('EDITED_TIMES_TOTAL', (int) $message_row['message_edit_count'], $display_username, $user->format_date($message_row['message_edit_time'], false, true));
}
else
{
@@ -150,31 +151,49 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row)
// End signature parsing, only if needed
if ($signature)
{
- $signature = censor_text($signature);
+ $parse_flags = ($user_info['user_sig_bbcode_bitfield'] ? OPTION_FLAG_BBCODE : 0) | OPTION_FLAG_SMILIES;
+ $signature = generate_text_for_display($signature, $user_info['user_sig_bbcode_uid'], $user_info['user_sig_bbcode_bitfield'], $parse_flags, true);
+ }
+
+ $url = append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm');
- if ($user_info['user_sig_bbcode_bitfield'])
+ // Number of "to" recipients
+ $num_recipients = (int) preg_match_all('/:?(u|g)_([0-9]+):?/', $message_row['to_address'], $match);
+
+ $bbcode_status = ($config['allow_bbcode'] && $config['auth_bbcode_pm'] && $auth->acl_get('u_pm_bbcode')) ? true : false;
+
+ // Get the profile fields template data
+ $cp_row = array();
+ if ($config['load_cpf_pm'] && isset($profile_fields[$author_id]))
+ {
+ // Filter the fields we don't want to show
+ foreach ($profile_fields[$author_id] as $used_ident => $profile_field)
{
- if ($bbcode === false)
+ if (!$profile_field['data']['field_show_on_pm'])
{
- include($phpbb_root_path . 'includes/bbcode.' . $phpEx);
- $bbcode = new bbcode($user_info['user_sig_bbcode_bitfield']);
+ unset($profile_fields[$author_id][$used_ident]);
}
-
- $bbcode->bbcode_second_pass($signature, $user_info['user_sig_bbcode_uid'], $user_info['user_sig_bbcode_bitfield']);
}
- $signature = bbcode_nl2br($signature);
- $signature = smiley_text($signature);
+ if (isset($profile_fields[$author_id]))
+ {
+ $cp_row = $cp->generate_profile_fields_template_data($profile_fields[$author_id]);
+ }
}
- $url = append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm');
+ $u_pm = $u_jabber = '';
- // Number of "to" recipients
- $num_recipients = (int) preg_match_all('/:?(u|g)_([0-9]+):?/', $message_row['to_address'], $match);
+ if ($config['allow_privmsg'] && $auth->acl_get('u_sendpm') && ($user_info['user_allow_pm'] || $auth->acl_gets('a_', 'm_') || $auth->acl_getf_global('m_')))
+ {
+ $u_pm = append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&amp;mode=compose&amp;u=' . $author_id);
+ }
- $bbcode_status = ($config['allow_bbcode'] && $config['auth_bbcode_pm'] && $auth->acl_get('u_pm_bbcode')) ? true : false;
+ if ($config['jab_enable'] && $user_info['user_jabber'] && $auth->acl_get('u_sendim'))
+ {
+ $u_jabber = append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=contact&amp;action=jabber&amp;u=' . $author_id);
+ }
- $template->assign_vars(array(
+ $msg_data = array(
'MESSAGE_AUTHOR_FULL' => get_username_string('full', $author_id, $user_info['username'], $user_info['user_colour'], $user_info['username']),
'MESSAGE_AUTHOR_COLOUR' => get_username_string('colour', $author_id, $user_info['username'], $user_info['user_colour'], $user_info['username']),
'MESSAGE_AUTHOR' => get_username_string('username', $author_id, $user_info['username'], $user_info['user_colour'], $user_info['username']),
@@ -185,7 +204,8 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row)
'AUTHOR_AVATAR' => (isset($user_info['avatar'])) ? $user_info['avatar'] : '',
'AUTHOR_JOINED' => $user->format_date($user_info['user_regdate']),
'AUTHOR_POSTS' => (int) $user_info['user_posts'],
- 'AUTHOR_FROM' => (!empty($user_info['user_from'])) ? $user_info['user_from'] : '',
+ 'U_AUTHOR_POSTS' => ($config['load_search'] && $auth->acl_get('u_search')) ? append_sid("{$phpbb_root_path}search.$phpEx", "author_id=$author_id&amp;sr=posts") : '',
+ 'CONTACT_USER' => $user->lang('CONTACT_USER', get_username_string('username', $author_id, $user_info['username'], $user_info['user_colour'], $user_info['username'])),
'ONLINE_IMG' => (!$config['load_onlinetrack']) ? '' : ((isset($user_info['online']) && $user_info['online']) ? $user->img('icon_user_online', $user->lang['ONLINE']) : $user->img('icon_user_offline', $user->lang['OFFLINE'])),
'S_ONLINE' => (!$config['load_onlinetrack']) ? false : ((isset($user_info['online']) && $user_info['online']) ? true : false),
@@ -206,13 +226,8 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row)
'EDITED_MESSAGE' => $l_edited_by,
'MESSAGE_ID' => $message_row['msg_id'],
- 'U_PM' => ($config['allow_privmsg'] && $auth->acl_get('u_sendpm') && ($user_info['user_allow_pm'] || $auth->acl_gets('a_', 'm_') || $auth->acl_getf_global('m_'))) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&amp;mode=compose&amp;u=' . $author_id) : '',
- 'U_WWW' => (!empty($user_info['user_website'])) ? $user_info['user_website'] : '',
- 'U_ICQ' => ($user_info['user_icq']) ? 'http://www.icq.com/people/' . urlencode($user_info['user_icq']) . '/' : '',
- 'U_AIM' => ($user_info['user_aim'] && $auth->acl_get('u_sendim')) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=contact&amp;action=aim&amp;u=' . $author_id) : '',
- 'U_YIM' => ($user_info['user_yim']) ? 'http://edit.yahoo.com/config/send_webmesg?.target=' . urlencode($user_info['user_yim']) . '&amp;.src=pg' : '',
- 'U_MSN' => ($user_info['user_msnm'] && $auth->acl_get('u_sendim')) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=contact&amp;action=msnm&amp;u=' . $author_id) : '',
- 'U_JABBER' => ($user_info['user_jabber'] && $auth->acl_get('u_sendim')) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=contact&amp;action=jabber&amp;u=' . $author_id) : '',
+ 'U_PM' => $u_pm,
+ 'U_JABBER' => $u_jabber,
'U_DELETE' => ($auth->acl_get('u_pm_delete')) ? "$url&amp;mode=compose&amp;action=delete&amp;f=$folder_id&amp;p=" . $message_row['msg_id'] : '',
'U_EMAIL' => $user_info['email'],
@@ -232,11 +247,89 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row)
'S_SPECIAL_FOLDER' => in_array($folder_id, array(PRIVMSGS_NO_BOX, PRIVMSGS_OUTBOX)),
'S_PM_RECIPIENTS' => $num_recipients,
'S_BBCODE_ALLOWED' => ($bbcode_status) ? 1 : 0,
+ 'S_CUSTOM_FIELDS' => (!empty($cp_row['row'])) ? true : false,
'U_PRINT_PM' => ($config['print_pm'] && $auth->acl_get('u_pm_printpm')) ? "$url&amp;f=$folder_id&amp;p=" . $message_row['msg_id'] . "&amp;view=print" : '',
- 'U_FORWARD_PM' => ($config['forward_pm'] && $auth->acl_get('u_sendpm') && $auth->acl_get('u_pm_forward')) ? "$url&amp;mode=compose&amp;action=forward&amp;f=$folder_id&amp;p=" . $message_row['msg_id'] : '')
+ 'U_FORWARD_PM' => ($config['forward_pm'] && $auth->acl_get('u_sendpm') && $auth->acl_get('u_pm_forward')) ? "$url&amp;mode=compose&amp;action=forward&amp;f=$folder_id&amp;p=" . $message_row['msg_id'] : '',
);
+ /**
+ * Modify pm and sender data before it is assigned to the template
+ *
+ * @event core.ucp_pm_view_messsage
+ * @var mixed id Active module category (can be int or string)
+ * @var string mode Active module
+ * @var int folder_id ID of the folder the message is in
+ * @var int msg_id ID of the private message
+ * @var array folder Array with data of user's message folders
+ * @var array message_row Array with message data
+ * @var array cp_row Array with senders custom profile field data
+ * @var array msg_data Template array with message data
+ * @var array user_info User data of the sender
+ * @since 3.1.0-a1
+ * @changed 3.1.6-RC1 Added user_info into event
+ */
+ $vars = array(
+ 'id',
+ 'mode',
+ 'folder_id',
+ 'msg_id',
+ 'folder',
+ 'message_row',
+ 'cp_row',
+ 'msg_data',
+ 'user_info',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.ucp_pm_view_messsage', compact($vars)));
+
+ $template->assign_vars($msg_data);
+
+ $contact_fields = array(
+ array(
+ 'ID' => 'pm',
+ 'NAME' => $user->lang['SEND_PRIVATE_MESSAGE'],
+ 'U_CONTACT' => $u_pm,
+ ),
+ array(
+ 'ID' => 'email',
+ 'NAME' => $user->lang['SEND_EMAIL'],
+ 'U_CONTACT' => $user_info['email'],
+ ),
+ array(
+ 'ID' => 'jabber',
+ 'NAME' => $user->lang['JABBER'],
+ 'U_CONTACT' => $u_jabber,
+ ),
+ );
+
+ foreach ($contact_fields as $field)
+ {
+ if ($field['U_CONTACT'])
+ {
+ $template->assign_block_vars('contact', $field);
+ }
+ }
+
+ // Display the custom profile fields
+ if (!empty($cp_row['row']))
+ {
+ $template->assign_vars($cp_row['row']);
+
+ foreach ($cp_row['blockrow'] as $cp_block_row)
+ {
+ $template->assign_block_vars('custom_fields', $cp_block_row);
+
+ if ($cp_block_row['S_PROFILE_CONTACT'])
+ {
+ $template->assign_block_vars('contact', array(
+ 'ID' => $cp_block_row['PROFILE_FIELD_IDENT'],
+ 'NAME' => $cp_block_row['PROFILE_FIELD_NAME'],
+ 'U_CONTACT' => $cp_block_row['PROFILE_FIELD_CONTACT'],
+ ));
+ }
+ }
+ }
+
// Display not already displayed Attachments for this post, we already parsed them. ;)
if (isset($attachments) && sizeof($attachments))
{
@@ -248,7 +341,7 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row)
}
}
- if (!isset($_REQUEST['view']) || $_REQUEST['view'] != 'print')
+ if (!isset($_REQUEST['view']) || $request->variable('view', '') != 'print')
{
// Message History
if (message_history($msg_id, $user->data['user_id'], $message_row, $folder))
@@ -303,14 +396,17 @@ function get_user_information($user_id, $user_row)
}
}
- if (!function_exists('get_user_avatar'))
+ $user_row['avatar'] = ($user->optionget('viewavatars')) ? phpbb_get_user_avatar($user_row) : '';
+
+ if (!function_exists('phpbb_get_user_rank'))
{
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
}
- $user_row['avatar'] = ($user->optionget('viewavatars')) ? get_user_avatar($user_row['user_avatar'], $user_row['user_avatar_type'], $user_row['user_avatar_width'], $user_row['user_avatar_height']) : '';
-
- get_user_rank($user_row['user_rank'], $user_row['user_posts'], $user_row['rank_title'], $user_row['rank_image'], $user_row['rank_image_src']);
+ $user_rank_data = phpbb_get_user_rank($user_row, $user_row['user_posts']);
+ $user_row['rank_title'] = $user_rank_data['title'];
+ $user_row['rank_image'] = $user_rank_data['img'];
+ $user_row['rank_image_src'] = $user_rank_data['img_src'];
if ((!empty($user_row['user_allow_viewemail']) && $auth->acl_get('u_sendemail')) || $auth->acl_get('a_email'))
{
@@ -319,5 +415,3 @@ function get_user_information($user_id, $user_row)
return $user_row;
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/ucp/ucp_prefs.php b/phpBB/includes/ucp/ucp_prefs.php
index c6e43b831c..e63e9b4c08 100644
--- a/phpBB/includes/ucp/ucp_prefs.php
+++ b/phpBB/includes/ucp/ucp_prefs.php
@@ -1,10 +1,13 @@
<?php
/**
*
-* @package ucp
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -19,7 +22,6 @@ if (!defined('IN_PHPBB'))
/**
* ucp_prefs
* Changing user preferences
-* @package ucp
*/
class ucp_prefs
{
@@ -27,7 +29,7 @@ class ucp_prefs
function main($id, $mode)
{
- global $config, $db, $user, $auth, $template, $phpbb_root_path, $phpEx;
+ global $config, $db, $user, $auth, $template, $phpbb_dispatcher, $phpbb_root_path, $phpEx;
$submit = (isset($_POST['submit'])) ? true : false;
$error = $data = array();
@@ -41,15 +43,12 @@ class ucp_prefs
'notifymethod' => request_var('notifymethod', $user->data['user_notify_type']),
'dateformat' => request_var('dateformat', $user->data['user_dateformat'], true),
'lang' => basename(request_var('lang', $user->data['user_lang'])),
- 'style' => request_var('style', (int) $user->data['user_style']),
- 'tz' => request_var('tz', (float) $user->data['user_timezone']),
+ 'user_style' => request_var('user_style', (int) $user->data['user_style']),
+ 'tz' => request_var('tz', $user->data['user_timezone']),
- 'dst' => request_var('dst', (bool) $user->data['user_dst']),
'viewemail' => request_var('viewemail', (bool) $user->data['user_allow_viewemail']),
'massemail' => request_var('massemail', (bool) $user->data['user_allow_massemail']),
'hideonline' => request_var('hideonline', (bool) !$user->data['user_allow_viewonline']),
- 'notifypm' => request_var('notifypm', (bool) $user->data['user_notify_pm']),
- 'popuppm' => request_var('popuppm', (bool) $user->optionget('popuppm')),
'allowpm' => request_var('allowpm', (bool) $user->data['user_allow_pm']),
);
@@ -59,22 +58,38 @@ class ucp_prefs
$data['notifymethod'] = NOTIFY_BOTH;
}
+ /**
+ * Add UCP edit global settings data before they are assigned to the template or submitted
+ *
+ * To assign data to the template, use $template->assign_vars()
+ *
+ * @event core.ucp_prefs_personal_data
+ * @var bool submit Do we display the form only
+ * or did the user press submit
+ * @var array data Array with current ucp options data
+ * @var array error Array with list of errors
+ * @since 3.1.0-a1
+ * @changed 3.1.4-RC1 Added error variable to the event
+ */
+ $vars = array('submit', 'data', 'error');
+ extract($phpbb_dispatcher->trigger_event('core.ucp_prefs_personal_data', compact($vars)));
+
if ($submit)
{
if ($config['override_user_style'])
{
- $data['style'] = (int) $config['default_style'];
+ $data['user_style'] = (int) $config['default_style'];
}
- else if (!phpbb_style_is_active($data['style']))
+ else if (!phpbb_style_is_active($data['user_style']))
{
- $data['style'] = (int) $user->data['user_style'];
+ $data['user_style'] = (int) $user->data['user_style'];
}
- $error = validate_data($data, array(
- 'dateformat' => array('string', false, 1, 30),
+ $error = array_merge(validate_data($data, array(
+ 'dateformat' => array('string', false, 1, 64),
'lang' => array('language_iso_name'),
- 'tz' => array('num', false, -14, 14),
- ));
+ 'tz' => array('timezone'),
+ )), $error);
if (!check_form_key('ucp_prefs_personal'))
{
@@ -83,24 +98,31 @@ class ucp_prefs
if (!sizeof($error))
{
- $user->optionset('popuppm', $data['popuppm']);
-
$sql_ary = array(
'user_allow_pm' => $data['allowpm'],
'user_allow_viewemail' => $data['viewemail'],
'user_allow_massemail' => $data['massemail'],
'user_allow_viewonline' => ($auth->acl_get('u_hideonline')) ? !$data['hideonline'] : $user->data['user_allow_viewonline'],
'user_notify_type' => $data['notifymethod'],
- 'user_notify_pm' => $data['notifypm'],
'user_options' => $user->data['user_options'],
- 'user_dst' => $data['dst'],
'user_dateformat' => $data['dateformat'],
'user_lang' => $data['lang'],
'user_timezone' => $data['tz'],
- 'user_style' => $data['style'],
+ 'user_style' => $data['user_style'],
);
+ /**
+ * Update UCP edit global settings data on form submit
+ *
+ * @event core.ucp_prefs_personal_update_data
+ * @var array data Submitted display options data
+ * @var array sql_ary Display options data we update
+ * @since 3.1.0-a1
+ */
+ $vars = array('data', 'sql_ary');
+ extract($phpbb_dispatcher->trigger_event('core.ucp_prefs_personal_update_data', compact($vars)));
+
$sql = 'UPDATE ' . USERS_TABLE . '
SET ' . $db->sql_build_array('UPDATE', $sql_ary) . '
WHERE user_id = ' . $user->data['user_id'];
@@ -112,7 +134,7 @@ class ucp_prefs
}
// Replace "error" strings with their real, localised form
- $error = preg_replace('#^([A-Z_]+)$#e', "(!empty(\$user->lang['\\1'])) ? \$user->lang['\\1'] : '\\1'", $error);
+ $error = array_map(array($user, 'lang'), $error);
}
$dateformat_options = '';
@@ -134,6 +156,8 @@ class ucp_prefs
}
$dateformat_options .= '>' . $user->lang['CUSTOM_DATEFORMAT'] . '</option>';
+ phpbb_timezone_select($template, $user, $data['tz'], true);
+
// check if there are any user-selectable languages
$sql = 'SELECT COUNT(lang_id) as languages_count
FROM ' . LANG_TABLE;
@@ -173,9 +197,6 @@ class ucp_prefs
'S_MASS_EMAIL' => $data['massemail'],
'S_ALLOW_PM' => $data['allowpm'],
'S_HIDE_ONLINE' => $data['hideonline'],
- 'S_NOTIFY_PM' => $data['notifypm'],
- 'S_POPUP_PM' => $data['popuppm'],
- 'S_DST' => $data['dst'],
'DATE_FORMAT' => $data['dateformat'],
'A_DATE_FORMAT' => addslashes($data['dateformat']),
@@ -188,8 +209,7 @@ class ucp_prefs
'S_MORE_STYLES' => $s_more_styles,
'S_LANG_OPTIONS' => language_select($data['lang']),
- 'S_STYLE_OPTIONS' => ($config['override_user_style']) ? '' : style_select($data['style']),
- 'S_TZ_OPTIONS' => tz_select($data['tz'], true),
+ 'S_STYLE_OPTIONS' => ($config['override_user_style']) ? '' : style_select($data['user_style']),
'S_CAN_HIDE_ONLINE' => ($auth->acl_get('u_hideonline')) ? true : false,
'S_SELECT_NOTIFY' => ($config['jab_enable'] && $user->data['user_jabber'] && @extension_loaded('xml')) ? true : false)
);
@@ -203,11 +223,11 @@ class ucp_prefs
$data = array(
'topic_sk' => request_var('topic_sk', (!empty($user->data['user_topic_sortby_type'])) ? $user->data['user_topic_sortby_type'] : 't'),
'topic_sd' => request_var('topic_sd', (!empty($user->data['user_topic_sortby_dir'])) ? $user->data['user_topic_sortby_dir'] : 'd'),
- 'topic_st' => request_var('topic_st', (!empty($user->data['user_topic_show_days'])) ? $user->data['user_topic_show_days'] : 0),
+ 'topic_st' => request_var('topic_st', (!empty($user->data['user_topic_show_days'])) ? (int) $user->data['user_topic_show_days'] : 0),
'post_sk' => request_var('post_sk', (!empty($user->data['user_post_sortby_type'])) ? $user->data['user_post_sortby_type'] : 't'),
'post_sd' => request_var('post_sd', (!empty($user->data['user_post_sortby_dir'])) ? $user->data['user_post_sortby_dir'] : 'a'),
- 'post_st' => request_var('post_st', (!empty($user->data['user_post_show_days'])) ? $user->data['user_post_show_days'] : 0),
+ 'post_st' => request_var('post_st', (!empty($user->data['user_post_show_days'])) ? (int) $user->data['user_post_show_days'] : 0),
'images' => request_var('images', (bool) $user->optionget('viewimg')),
'flash' => request_var('flash', (bool) $user->optionget('viewflash')),
@@ -217,13 +237,39 @@ class ucp_prefs
'wordcensor' => request_var('wordcensor', (bool) $user->optionget('viewcensors')),
);
+ /**
+ * Add UCP edit display options data before they are assigned to the template or submitted
+ *
+ * To assign data to the template, use $template->assign_vars()
+ *
+ * @event core.ucp_prefs_view_data
+ * @var bool submit Do we display the form only
+ * or did the user press submit
+ * @var array data Array with current ucp options data
+ * @since 3.1.0-a1
+ */
+ $vars = array('submit', 'data');
+ extract($phpbb_dispatcher->trigger_event('core.ucp_prefs_view_data', compact($vars)));
+
if ($submit)
{
$error = validate_data($data, array(
- 'topic_sk' => array('string', false, 1, 1),
- 'topic_sd' => array('string', false, 1, 1),
- 'post_sk' => array('string', false, 1, 1),
- 'post_sd' => array('string', false, 1, 1),
+ 'topic_sk' => array(
+ array('string', false, 1, 1),
+ array('match', false, '#(a|r|s|t|v)#'),
+ ),
+ 'topic_sd' => array(
+ array('string', false, 1, 1),
+ array('match', false, '#(a|d)#'),
+ ),
+ 'post_sk' => array(
+ array('string', false, 1, 1),
+ array('match', false, '#(a|s|t)#'),
+ ),
+ 'post_sd' => array(
+ array('string', false, 1, 1),
+ array('match', false, '#(a|d)#'),
+ ),
));
if (!check_form_key('ucp_prefs_view'))
@@ -255,6 +301,17 @@ class ucp_prefs
'user_post_show_days' => $data['post_st'],
);
+ /**
+ * Update UCP edit display options data on form submit
+ *
+ * @event core.ucp_prefs_view_update_data
+ * @var array data Submitted display options data
+ * @var array sql_ary Display options data we update
+ * @since 3.1.0-a1
+ */
+ $vars = array('data', 'sql_ary');
+ extract($phpbb_dispatcher->trigger_event('core.ucp_prefs_view_update_data', compact($vars)));
+
$sql = 'UPDATE ' . USERS_TABLE . '
SET ' . $db->sql_build_array('UPDATE', $sql_ary) . '
WHERE user_id = ' . $user->data['user_id'];
@@ -266,7 +323,7 @@ class ucp_prefs
}
// Replace "error" strings with their real, localised form
- $error = preg_replace('#^([A-Z_]+)$#e', "(!empty(\$user->lang['\\1'])) ? \$user->lang['\\1'] : '\\1'", $error);
+ $error = array_map(array($user, 'lang'), $error);
}
$sort_dir_text = array('a' => $user->lang['ASCENDING'], 'd' => $user->lang['DESCENDING']);
@@ -275,7 +332,7 @@ class ucp_prefs
$limit_topic_days = array(0 => $user->lang['ALL_TOPICS'], 1 => $user->lang['1_DAY'], 7 => $user->lang['7_DAYS'], 14 => $user->lang['2_WEEKS'], 30 => $user->lang['1_MONTH'], 90 => $user->lang['3_MONTHS'], 180 => $user->lang['6_MONTHS'], 365 => $user->lang['1_YEAR']);
$sort_by_topic_text = array('a' => $user->lang['AUTHOR'], 't' => $user->lang['POST_TIME'], 'r' => $user->lang['REPLIES'], 's' => $user->lang['SUBJECT'], 'v' => $user->lang['VIEWS']);
- $sort_by_topic_sql = array('a' => 't.topic_first_poster_name', 't' => 't.topic_last_post_time', 'r' => 't.topic_replies', 's' => 't.topic_title', 'v' => 't.topic_views');
+ $sort_by_topic_sql = array('a' => 't.topic_first_poster_name', 't' => array('t.topic_last_post_time', 't.topic_last_post_id'), 'r' => 't.topic_posts_approved', 's' => 't.topic_title', 'v' => 't.topic_views');
// Post ordering options
$limit_post_days = array(0 => $user->lang['ALL_POSTS'], 1 => $user->lang['1_DAY'], 7 => $user->lang['7_DAYS'], 14 => $user->lang['2_WEEKS'], 30 => $user->lang['1_MONTH'], 90 => $user->lang['3_MONTHS'], 180 => $user->lang['6_MONTHS'], 365 => $user->lang['1_YEAR']);
@@ -311,6 +368,49 @@ class ucp_prefs
${'s_sort_' . $sort_option . '_dir'} .= '</select>';
}
+ /**
+ * Run code before view form is displayed
+ *
+ * @event core.ucp_prefs_view_after
+ * @var bool submit Do we display the form only
+ * or did the user press submit
+ * @var array data Array with current ucp options data
+ * @var array sort_dir_text Array with sort dir language strings
+ * @var array limit_topic_days Topic ordering options
+ * @var array sort_by_topic_text Topic ordering language strings
+ * @var array sort_by_topic_sql Topic ordering sql
+ * @var array limit_post_days Post ordering options
+ * @var array sort_by_post_text Post ordering language strings
+ * @var array sort_by_post_sql Post ordering sql
+ * @var array _options Sort options
+ * @var string s_limit_topic_days Sort limit topic by days select box
+ * @var string s_sort_topic_key Sort topic key select box
+ * @var string s_sort_topic_dir Sort topic dir select box
+ * @var string s_limit_post_days Sort limit post by days select box
+ * @var string s_sort_post_key Sort post key select box
+ * @var string s_sort_post_dir Sort post dir select box
+ * @since 3.1.8-RC1
+ */
+ $vars = array(
+ 'submit',
+ 'data',
+ 'sort_dir_text',
+ 'limit_topic_days',
+ 'sort_by_topic_text',
+ 'sort_by_topic_sql',
+ 'limit_post_days',
+ 'sort_by_post_text',
+ 'sort_by_post_sql',
+ '_options',
+ 's_limit_topic_days',
+ 's_sort_topic_key',
+ 's_sort_topic_dir',
+ 's_limit_post_days',
+ 's_sort_post_key',
+ 's_sort_post_dir',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.ucp_prefs_view_after', compact($vars)));
+
$template->assign_vars(array(
'ERROR' => (sizeof($error)) ? implode('<br />', $error) : '',
@@ -343,6 +443,20 @@ class ucp_prefs
);
add_form_key('ucp_prefs_post');
+ /**
+ * Add UCP edit posting defaults data before they are assigned to the template or submitted
+ *
+ * To assign data to the template, use $template->assign_vars()
+ *
+ * @event core.ucp_prefs_post_data
+ * @var bool submit Do we display the form only
+ * or did the user press submit
+ * @var array data Array with current ucp options data
+ * @since 3.1.0-a1
+ */
+ $vars = array('submit', 'data');
+ extract($phpbb_dispatcher->trigger_event('core.ucp_prefs_post_data', compact($vars)));
+
if ($submit)
{
if (check_form_key('ucp_prefs_post'))
@@ -356,6 +470,17 @@ class ucp_prefs
'user_notify' => $data['notify'],
);
+ /**
+ * Update UCP edit posting defaults data on form submit
+ *
+ * @event core.ucp_prefs_post_update_data
+ * @var array data Submitted display options data
+ * @var array sql_ary Display options data we update
+ * @since 3.1.0-a1
+ */
+ $vars = array('data', 'sql_ary');
+ extract($phpbb_dispatcher->trigger_event('core.ucp_prefs_post_update_data', compact($vars)));
+
$sql = 'UPDATE ' . USERS_TABLE . '
SET ' . $db->sql_build_array('UPDATE', $sql_ary) . '
WHERE user_id = ' . $user->data['user_id'];
@@ -381,6 +506,24 @@ class ucp_prefs
break;
}
+ /**
+ * Modify UCP preferences data before the page load
+ *
+ * @event core.ucp_prefs_modify_common
+ * @var array data Array with current/submitted UCP options data
+ * @var array error Errors data
+ * @var string mode UCP prefs operation mode
+ * @var string s_hidden_fields Hidden fields data
+ * @since 3.1.0-RC3
+ */
+ $vars = array(
+ 'data',
+ 'error',
+ 'mode',
+ 's_hidden_fields',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.ucp_prefs_modify_common', compact($vars)));
+
$template->assign_vars(array(
'L_TITLE' => $user->lang['UCP_PREFS_' . strtoupper($mode)],
@@ -392,5 +535,3 @@ class ucp_prefs
$this->page_title = 'UCP_PREFS_' . strtoupper($mode);
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/ucp/ucp_profile.php b/phpBB/includes/ucp/ucp_profile.php
index 847311058b..4a3d8133b3 100644
--- a/phpBB/includes/ucp/ucp_profile.php
+++ b/phpBB/includes/ucp/ucp_profile.php
@@ -1,10 +1,13 @@
<?php
/**
*
-* @package ucp
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -21,7 +24,6 @@ if (!defined('IN_PHPBB'))
* Changing profile settings
*
* @todo what about pertaining user_sig_options?
-* @package ucp
*/
class ucp_profile
{
@@ -29,13 +31,14 @@ class ucp_profile
function main($id, $mode)
{
- global $config, $db, $user, $auth, $template, $phpbb_root_path, $phpEx;
+ global $cache, $config, $db, $user, $auth, $template, $phpbb_root_path, $phpEx;
+ global $request, $phpbb_container, $phpbb_dispatcher;
$user->add_lang('posting');
- $preview = (!empty($_POST['preview'])) ? true : false;
- $submit = (!empty($_POST['submit'])) ? true : false;
- $delete = (!empty($_POST['delete'])) ? true : false;
+ $preview = $request->variable('preview', false, false, \phpbb\request\request_interface::POST);
+ $submit = $request->variable('submit', false, false, \phpbb\request\request_interface::POST);
+ $delete = $request->variable('delete', false, false, \phpbb\request\request_interface::POST);
$error = $data = array();
$s_hidden_fields = '';
@@ -46,12 +49,22 @@ class ucp_profile
$data = array(
'username' => utf8_normalize_nfc(request_var('username', $user->data['username'], true)),
'email' => strtolower(request_var('email', $user->data['user_email'])),
- 'email_confirm' => strtolower(request_var('email_confirm', '')),
- 'new_password' => request_var('new_password', '', true),
- 'cur_password' => request_var('cur_password', '', true),
- 'password_confirm' => request_var('password_confirm', '', true),
+ 'new_password' => $request->variable('new_password', '', true),
+ 'cur_password' => $request->variable('cur_password', '', true),
+ 'password_confirm' => $request->variable('password_confirm', '', true),
);
+ /**
+ * Modify user registration data on editing account settings in UCP
+ *
+ * @event core.ucp_profile_reg_details_data
+ * @var array data Array with current or updated user registration data
+ * @var bool submit Flag indicating if submit button has been pressed
+ * @since 3.1.4-RC1
+ */
+ $vars = array('data', 'submit');
+ extract($phpbb_dispatcher->trigger_event('core.ucp_profile_reg_details_data', compact($vars)));
+
add_form_key('ucp_reg_details');
if ($submit)
@@ -64,8 +77,7 @@ class ucp_profile
'password_confirm' => array('string', true, $config['min_pass_chars'], $config['max_pass_chars']),
'email' => array(
array('string', false, 6, 60),
- array('email')),
- 'email_confirm' => array('string', true, 6, 60),
+ array('user_email')),
);
if ($auth->acl_get('u_chgname') && $config['allow_namechange'])
@@ -78,23 +90,21 @@ class ucp_profile
$error = validate_data($data, $check_ary);
- if ($auth->acl_get('u_chgemail') && $data['email'] != $user->data['user_email'] && $data['email_confirm'] != $data['email'])
- {
- $error[] = ($data['email_confirm']) ? 'NEW_EMAIL_ERROR' : 'NEW_EMAIL_CONFIRM_EMPTY';
- }
-
if ($auth->acl_get('u_chgpasswd') && $data['new_password'] && $data['password_confirm'] != $data['new_password'])
{
$error[] = ($data['password_confirm']) ? 'NEW_PASSWORD_ERROR' : 'NEW_PASSWORD_CONFIRM_EMPTY';
}
+ // Instantiate passwords manager
+ $passwords_manager = $phpbb_container->get('passwords.manager');
+
// Only check the new password against the previous password if there have been no errors
- if (!sizeof($error) && $auth->acl_get('u_chgpasswd') && $data['new_password'] && phpbb_check_hash($data['new_password'], $user->data['user_password']))
+ if (!sizeof($error) && $auth->acl_get('u_chgpasswd') && $data['new_password'] && $passwords_manager->check($data['new_password'], $user->data['user_password']))
{
$error[] = 'SAME_PASSWORD_ERROR';
}
- if (!phpbb_check_hash($data['cur_password'], $user->data['user_password']))
+ if (!$passwords_manager->check($data['cur_password'], $user->data['user_password']))
{
$error[] = ($data['cur_password']) ? 'CUR_PASSWORD_ERROR' : 'CUR_PASSWORD_EMPTY';
}
@@ -104,6 +114,18 @@ class ucp_profile
$error[] = 'FORM_INVALID';
}
+ /**
+ * Validate user data on editing registration data in UCP
+ *
+ * @event core.ucp_profile_reg_details_validate
+ * @var array data Array with user profile data
+ * @var bool submit Flag indicating if submit button has been pressed
+ * @var array error Array of any generated errors
+ * @since 3.1.4-RC1
+ */
+ $vars = array('data', 'submit', 'error');
+ extract($phpbb_dispatcher->trigger_event('core.ucp_profile_reg_details_validate', compact($vars)));
+
if (!sizeof($error))
{
$sql_ary = array(
@@ -111,7 +133,7 @@ class ucp_profile
'username_clean' => ($auth->acl_get('u_chgname') && $config['allow_namechange']) ? utf8_clean_string($data['username']) : $user->data['username_clean'],
'user_email' => ($auth->acl_get('u_chgemail')) ? $data['email'] : $user->data['user_email'],
'user_email_hash' => ($auth->acl_get('u_chgemail')) ? phpbb_email_hash($data['email']) : $user->data['user_email_hash'],
- 'user_password' => ($auth->acl_get('u_chgpasswd') && $data['new_password']) ? phpbb_hash($data['new_password']) : $user->data['user_password'],
+ 'user_password' => ($auth->acl_get('u_chgpasswd') && $data['new_password']) ? $passwords_manager->hash($data['new_password']) : $user->data['user_password'],
'user_passchg' => ($auth->acl_get('u_chgpasswd') && $data['new_password']) ? time() : 0,
);
@@ -120,7 +142,7 @@ class ucp_profile
add_log('user', $user->data['user_id'], 'LOG_USER_UPDATE_NAME', $user->data['username'], $data['username']);
}
- if ($auth->acl_get('u_chgpasswd') && $data['new_password'] && !phpbb_check_hash($data['new_password'], $user->data['user_password']))
+ if ($auth->acl_get('u_chgpasswd') && $data['new_password'] && !$passwords_manager->check($data['new_password'], $user->data['user_password']))
{
$user->reset_login_keys();
add_log('user', $user->data['user_id'], 'LOG_USER_NEW_PASSWORD', $data['username']);
@@ -161,38 +183,12 @@ class ucp_profile
if ($config['require_activation'] == USER_ACTIVATION_ADMIN)
{
- // Grab an array of user_id's with a_user permissions ... these users can activate a user
- $admin_ary = $auth->acl_get_list(false, 'a_user', false);
- $admin_ary = (!empty($admin_ary[0]['a_user'])) ? $admin_ary[0]['a_user'] : array();
-
- // Also include founders
- $where_sql = ' WHERE user_type = ' . USER_FOUNDER;
-
- if (sizeof($admin_ary))
- {
- $where_sql .= ' OR ' . $db->sql_in_set('user_id', $admin_ary);
- }
-
- $sql = 'SELECT user_id, username, user_email, user_lang, user_jabber, user_notify_type
- FROM ' . USERS_TABLE . ' ' .
- $where_sql;
- $result = $db->sql_query($sql);
-
- while ($row = $db->sql_fetchrow($result))
- {
- $messenger->template('admin_activate', $row['user_lang']);
- $messenger->to($row['user_email'], $row['username']);
- $messenger->im($row['user_jabber'], $row['username']);
-
- $messenger->assign_vars(array(
- 'USERNAME' => htmlspecialchars_decode($data['username']),
- 'U_USER_DETAILS' => "$server_url/memberlist.$phpEx?mode=viewprofile&u={$user->data['user_id']}",
- 'U_ACTIVATE' => "$server_url/ucp.$phpEx?mode=activate&u={$user->data['user_id']}&k=$user_actkey")
- );
-
- $messenger->send($row['user_notify_type']);
- }
- $db->sql_freeresult($result);
+ $notifications_manager = $phpbb_container->get('notification_manager');
+ $notifications_manager->add_notifications('notification.type.admin_activate_user', array(
+ 'user_id' => $user->data['user_id'],
+ 'user_actkey' => $user_actkey,
+ 'user_regdate' => time(), // Notification time
+ ));
}
user_active_flip('deactivate', $user->data['user_id'], INACTIVE_PROFILE);
@@ -202,6 +198,17 @@ class ucp_profile
$sql_ary['user_newpasswd'] = '';
}
+ /**
+ * Modify user registration data before submitting it to the database
+ *
+ * @event core.ucp_profile_reg_details_sql_ary
+ * @var array data Array with current or updated user registration data
+ * @var array sql_ary Array with user registration data to submit to the database
+ * @since 3.1.4-RC1
+ */
+ $vars = array('data', 'sql_ary');
+ extract($phpbb_dispatcher->trigger_event('core.ucp_profile_reg_details_sql_ary', compact($vars)));
+
if (sizeof($sql_ary))
{
$sql = 'UPDATE ' . USERS_TABLE . '
@@ -235,7 +242,7 @@ class ucp_profile
}
// Replace "error" strings with their real, localised form
- $error = preg_replace('#^([A-Z_]+)$#e', "(!empty(\$user->lang['\\1'])) ? \$user->lang['\\1'] : '\\1'", $error);
+ $error = array_map(array($user, 'lang'), $error);
}
$template->assign_vars(array(
@@ -247,8 +254,8 @@ class ucp_profile
'NEW_PASSWORD' => $data['new_password'],
'CUR_PASSWORD' => '',
- 'L_USERNAME_EXPLAIN' => sprintf($user->lang[$config['allow_name_chars'] . '_EXPLAIN'], $config['min_name_chars'], $config['max_name_chars']),
- 'L_CHANGE_PASSWORD_EXPLAIN' => sprintf($user->lang[$config['pass_complex'] . '_EXPLAIN'], $config['min_pass_chars'], $config['max_pass_chars']),
+ 'L_USERNAME_EXPLAIN' => $user->lang($config['allow_name_chars'] . '_EXPLAIN', $user->lang('CHARACTERS', (int) $config['min_name_chars']), $user->lang('CHARACTERS', (int) $config['max_name_chars'])),
+ 'L_CHANGE_PASSWORD_EXPLAIN' => $user->lang($config['pass_complex'] . '_EXPLAIN', $user->lang('CHARACTERS', (int) $config['min_pass_chars']), $user->lang('CHARACTERS', (int) $config['max_pass_chars'])),
'S_FORCE_PASSWORD' => ($auth->acl_get('u_chgpasswd') && $config['chg_passforce'] && $user->data['user_passchg'] < time() - ($config['chg_passforce'] * 86400)) ? true : false,
'S_CHANGE_USERNAME' => ($config['allow_namechange'] && $auth->acl_get('u_chgname')) ? true : false,
@@ -258,23 +265,18 @@ class ucp_profile
break;
case 'profile_info':
+ // Do not display profile information panel if not authed to do so
+ if (!$auth->acl_get('u_chgprofileinfo'))
+ {
+ trigger_error('NO_AUTH_PROFILEINFO');
+ }
- include($phpbb_root_path . 'includes/functions_profile_fields.' . $phpEx);
-
- $cp = new custom_profile();
+ $cp = $phpbb_container->get('profilefields.manager');
$cp_data = $cp_error = array();
$data = array(
- 'icq' => request_var('icq', $user->data['user_icq']),
- 'aim' => request_var('aim', $user->data['user_aim']),
- 'msn' => request_var('msn', $user->data['user_msnm']),
- 'yim' => request_var('yim', $user->data['user_yim']),
'jabber' => utf8_normalize_nfc(request_var('jabber', $user->data['user_jabber'], true)),
- 'website' => request_var('website', $user->data['user_website']),
- 'location' => utf8_normalize_nfc(request_var('location', $user->data['user_from'], true)),
- 'occupation' => utf8_normalize_nfc(request_var('occupation', $user->data['user_occ'], true)),
- 'interests' => utf8_normalize_nfc(request_var('interests', $user->data['user_interests'], true)),
);
if ($config['allow_birthdays'])
@@ -292,26 +294,25 @@ class ucp_profile
$data['user_birthday'] = sprintf('%2d-%2d-%4d', $data['bday_day'], $data['bday_month'], $data['bday_year']);
}
+ /**
+ * Modify user data on editing profile in UCP
+ *
+ * @event core.ucp_profile_modify_profile_info
+ * @var array data Array with user profile data
+ * @var bool submit Flag indicating if submit button has been pressed
+ * @since 3.1.4-RC1
+ */
+ $vars = array('data', 'submit');
+ extract($phpbb_dispatcher->trigger_event('core.ucp_profile_modify_profile_info', compact($vars)));
+
add_form_key('ucp_profile_info');
if ($submit)
{
$validate_array = array(
- 'icq' => array(
- array('string', true, 3, 15),
- array('match', true, '#^[0-9]+$#i')),
- 'aim' => array('string', true, 3, 255),
- 'msn' => array('string', true, 5, 255),
'jabber' => array(
array('string', true, 5, 255),
array('jabber')),
- 'yim' => array('string', true, 5, 255),
- 'website' => array(
- array('string', true, 12, 255),
- array('match', true, '#^http[s]?://(.*?\.)*?[a-z0-9\-]+\.[a-z]{2,4}#i')),
- 'location' => array('string', true, 2, 100),
- 'occupation' => array('string', true, 2, 500),
- 'interests' => array('string', true, 2, 500),
);
if ($config['allow_birthdays'])
@@ -339,6 +340,18 @@ class ucp_profile
$error[] = 'FORM_INVALID';
}
+ /**
+ * Validate user data on editing profile in UCP
+ *
+ * @event core.ucp_profile_validate_profile_info
+ * @var array data Array with user profile data
+ * @var bool submit Flag indicating if submit button has been pressed
+ * @var array error Array of any generated errors
+ * @since 3.1.4-RC1
+ */
+ $vars = array('data', 'submit', 'error');
+ extract($phpbb_dispatcher->trigger_event('core.ucp_profile_validate_profile_info', compact($vars)));
+
if (!sizeof($error))
{
$data['notify'] = $user->data['user_notify_type'];
@@ -351,15 +364,7 @@ class ucp_profile
}
$sql_ary = array(
- 'user_icq' => $data['icq'],
- 'user_aim' => $data['aim'],
- 'user_msnm' => $data['msn'],
- 'user_yim' => $data['yim'],
'user_jabber' => $data['jabber'],
- 'user_website' => $data['website'],
- 'user_from' => $data['location'],
- 'user_occ' => $data['occupation'],
- 'user_interests'=> $data['interests'],
'user_notify_type' => $data['notify'],
);
@@ -368,6 +373,18 @@ class ucp_profile
$sql_ary['user_birthday'] = $data['user_birthday'];
}
+ /**
+ * Modify profile data in UCP before submitting to the database
+ *
+ * @event core.ucp_profile_info_modify_sql_ary
+ * @var array cp_data Array with the user custom profile fields data
+ * @var array data Array with user profile data
+ * @var array sql_ary user options data we update
+ * @since 3.1.4-RC1
+ */
+ $vars = array('cp_data', 'data', 'sql_ary');
+ extract($phpbb_dispatcher->trigger_event('core.ucp_profile_info_modify_sql_ary', compact($vars)));
+
$sql = 'UPDATE ' . USERS_TABLE . '
SET ' . $db->sql_build_array('UPDATE', $sql_ary) . '
WHERE user_id = ' . $user->data['user_id'];
@@ -382,7 +399,7 @@ class ucp_profile
}
// Replace "error" strings with their real, localised form
- $error = preg_replace('#^([A-Z_]+)$#e', "(!empty(\$user->lang['\\1'])) ? \$user->lang['\\1'] : '\\1'", $error);
+ $error = array_map(array($user, 'lang'), $error);
}
if ($config['allow_birthdays'])
@@ -420,17 +437,9 @@ class ucp_profile
}
$template->assign_vars(array(
- 'ERROR' => (sizeof($error)) ? implode('<br />', $error) : '',
-
- 'ICQ' => $data['icq'],
- 'YIM' => $data['yim'],
- 'AIM' => $data['aim'],
- 'MSN' => $data['msn'],
- 'JABBER' => $data['jabber'],
- 'WEBSITE' => $data['website'],
- 'LOCATION' => $data['location'],
- 'OCCUPATION'=> $data['occupation'],
- 'INTERESTS' => $data['interests'],
+ 'ERROR' => (sizeof($error)) ? implode('<br />', $error) : '',
+ 'S_JABBER_ENABLED' => $config['jab_enable'],
+ 'JABBER' => $data['jabber'],
));
// Get additional profile fields and assign them to the template block var 'profile_fields'
@@ -470,6 +479,32 @@ class ucp_profile
{
$message_parser = new parse_message($signature);
+ /**
+ * Modify user signature on editing profile in UCP
+ *
+ * @event core.ucp_profile_modify_signature
+ * @var bool enable_bbcode Whether or not bbcode is enabled
+ * @var bool enable_smilies Whether or not smilies are enabled
+ * @var bool enable_urls Whether or not urls are enabled
+ * @var string signature Users signature text
+ * @var object message_parser The message parser object
+ * @var array error Any error strings
+ * @var bool submit Whether or not the form has been sumitted
+ * @var bool preview Whether or not the signature is being previewed
+ * @since 3.1.10-RC1
+ */
+ $vars = array(
+ 'enable_bbcode',
+ 'enable_smilies',
+ 'enable_urls',
+ 'signature',
+ 'message_parser',
+ 'error',
+ 'submit',
+ 'preview',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.ucp_profile_modify_signature', compact($vars)));
+
// Allowing Quote BBCode
$message_parser->parse($enable_bbcode, $enable_urls, $enable_smilies, $config['allow_sig_img'], $config['allow_sig_flash'], true, $config['allow_sig_links'], true, 'sig');
@@ -496,6 +531,16 @@ class ucp_profile
'user_sig_bbcode_bitfield' => $message_parser->bbcode_bitfield
);
+ /**
+ * Modify user registration data before submitting it to the database
+ *
+ * @event core.ucp_profile_modify_signature_sql_ary
+ * @var array sql_ary Array with user signature data to submit to the database
+ * @since 3.1.10-RC1
+ */
+ $vars = array('sql_ary');
+ extract($phpbb_dispatcher->trigger_event('core.ucp_profile_modify_signature_sql_ary', compact($vars)));
+
$sql = 'UPDATE ' . USERS_TABLE . '
SET ' . $db->sql_build_array('UPDATE', $sql_ary) . '
WHERE user_id = ' . $user->data['user_id'];
@@ -507,7 +552,7 @@ class ucp_profile
}
// Replace "error" strings with their real, localised form
- $error = preg_replace('#^([A-Z_]+)$#e', "(!empty(\$user->lang['\\1'])) ? \$user->lang['\\1'] : '\\1'", $error);
+ $error = array_map(array($user, 'lang'), $error);
}
$signature_preview = '';
@@ -536,7 +581,7 @@ class ucp_profile
'URL_STATUS' => ($config['allow_sig_links']) ? $user->lang['URL_IS_ON'] : $user->lang['URL_IS_OFF'],
'MAX_FONT_SIZE' => (int) $config['max_sig_font_size'],
- 'L_SIGNATURE_EXPLAIN' => sprintf($user->lang['SIGNATURE_EXPLAIN'], $config['max_sig_chars']),
+ 'L_SIGNATURE_EXPLAIN' => $user->lang('SIGNATURE_EXPLAIN', (int) $config['max_sig_chars']),
'S_BBCODE_ALLOWED' => $config['allow_sig_bbcode'],
'S_SMILIES_ALLOWED' => $config['allow_sig_smilies'],
@@ -555,82 +600,202 @@ class ucp_profile
case 'avatar':
- include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
+ add_form_key('ucp_avatar');
- $display_gallery = request_var('display_gallery', '0');
- $avatar_select = basename(request_var('avatar_select', ''));
- $category = basename(request_var('category', ''));
+ $avatars_enabled = false;
- $can_upload = (file_exists($phpbb_root_path . $config['avatar_path']) && phpbb_is_writable($phpbb_root_path . $config['avatar_path']) && $auth->acl_get('u_chgavatar') && (@ini_get('file_uploads') || strtolower(@ini_get('file_uploads')) == 'on')) ? true : false;
+ if ($config['allow_avatar'] && $auth->acl_get('u_chgavatar'))
+ {
+ $phpbb_avatar_manager = $phpbb_container->get('avatar.manager');
+ $avatar_drivers = $phpbb_avatar_manager->get_enabled_drivers();
- add_form_key('ucp_avatar');
+ // This is normalised data, without the user_ prefix
+ $avatar_data = \phpbb\avatar\manager::clean_row($user->data, 'user');
- if ($submit)
- {
- if (check_form_key('ucp_avatar'))
+ if ($submit)
{
- if (avatar_process_user($error, false, $can_upload))
+ if (check_form_key('ucp_avatar'))
{
+ $driver_name = $phpbb_avatar_manager->clean_driver_name($request->variable('avatar_driver', ''));
+
+ if (in_array($driver_name, $avatar_drivers) && !$request->is_set_post('avatar_delete'))
+ {
+ $driver = $phpbb_avatar_manager->get_driver($driver_name);
+ $result = $driver->process_form($request, $template, $user, $avatar_data, $error);
+
+ if ($result && empty($error))
+ {
+ // Success! Lets save the result in the database
+ $result = array(
+ 'user_avatar_type' => $driver_name,
+ 'user_avatar' => $result['avatar'],
+ 'user_avatar_width' => $result['avatar_width'],
+ 'user_avatar_height' => $result['avatar_height'],
+ );
+
+ /**
+ * Trigger events on successfull avatar change
+ *
+ * @event core.ucp_profile_avatar_sql
+ * @var array result Array with data to be stored in DB
+ * @since 3.1.11-RC1
+ */
+ $vars = array('result');
+ extract($phpbb_dispatcher->trigger_event('core.ucp_profile_avatar_sql', compact($vars)));
+
+ $sql = 'UPDATE ' . USERS_TABLE . '
+ SET ' . $db->sql_build_array('UPDATE', $result) . '
+ WHERE user_id = ' . (int) $user->data['user_id'];
+ $db->sql_query($sql);
+
+ meta_refresh(3, $this->u_action);
+ $message = $user->lang['PROFILE_UPDATED'] . '<br /><br />' . sprintf($user->lang['RETURN_UCP'], '<a href="' . $this->u_action . '">', '</a>');
+ trigger_error($message);
+ }
+ }
+ }
+ else
+ {
+ $error[] = 'FORM_INVALID';
+ }
+ }
+
+ // Handle deletion of avatars
+ if ($request->is_set_post('avatar_delete'))
+ {
+ if (!confirm_box(true))
+ {
+ confirm_box(false, $user->lang('CONFIRM_AVATAR_DELETE'), build_hidden_fields(array(
+ 'avatar_delete' => true,
+ 'i' => $id,
+ 'mode' => $mode))
+ );
+ }
+ else
+ {
+ $phpbb_avatar_manager->handle_avatar_delete($db, $user, $avatar_data, USERS_TABLE, 'user_');
+
meta_refresh(3, $this->u_action);
$message = $user->lang['PROFILE_UPDATED'] . '<br /><br />' . sprintf($user->lang['RETURN_UCP'], '<a href="' . $this->u_action . '">', '</a>');
trigger_error($message);
}
}
- else
+
+ $selected_driver = $phpbb_avatar_manager->clean_driver_name($request->variable('avatar_driver', $user->data['user_avatar_type']));
+
+ $template->assign_vars(array(
+ 'AVATAR_MIN_WIDTH' => $config['avatar_min_width'],
+ 'AVATAR_MAX_WIDTH' => $config['avatar_max_width'],
+ 'AVATAR_MIN_HEIGHT' => $config['avatar_min_height'],
+ 'AVATAR_MAX_HEIGHT' => $config['avatar_max_height'],
+ ));
+
+ foreach ($avatar_drivers as $current_driver)
{
- $error[] = 'FORM_INVALID';
+ $driver = $phpbb_avatar_manager->get_driver($current_driver);
+
+ $avatars_enabled = true;
+ $template->set_filenames(array(
+ 'avatar' => $driver->get_template_name(),
+ ));
+
+ if ($driver->prepare_form($request, $template, $user, $avatar_data, $error))
+ {
+ $driver_name = $phpbb_avatar_manager->prepare_driver_name($current_driver);
+ $driver_upper = strtoupper($driver_name);
+
+ $template->assign_block_vars('avatar_drivers', array(
+ 'L_TITLE' => $user->lang($driver_upper . '_TITLE'),
+ 'L_EXPLAIN' => $user->lang($driver_upper . '_EXPLAIN'),
+
+ 'DRIVER' => $driver_name,
+ 'SELECTED' => $current_driver == $selected_driver,
+ 'OUTPUT' => $template->assign_display('avatar'),
+ ));
+ }
}
+
// Replace "error" strings with their real, localised form
- $error = preg_replace('#^([A-Z_]+)$#e', "(!empty(\$user->lang['\\1'])) ? \$user->lang['\\1'] : '\\1'", $error);
+ $error = $phpbb_avatar_manager->localize_errors($user, $error);
}
- if (!$config['allow_avatar'] && $user->data['user_avatar_type'])
- {
- $error[] = $user->lang['AVATAR_NOT_ALLOWED'];
- }
- else if ((($user->data['user_avatar_type'] == AVATAR_UPLOAD) && !$config['allow_avatar_upload']) ||
- (($user->data['user_avatar_type'] == AVATAR_REMOTE) && !$config['allow_avatar_remote']) ||
- (($user->data['user_avatar_type'] == AVATAR_GALLERY) && !$config['allow_avatar_local']))
- {
- $error[] = $user->lang['AVATAR_TYPE_NOT_ALLOWED'];
- }
+ $avatar = phpbb_get_user_avatar($user->data, 'USER_AVATAR', true);
$template->assign_vars(array(
'ERROR' => (sizeof($error)) ? implode('<br />', $error) : '',
- 'AVATAR' => get_user_avatar($user->data['user_avatar'], $user->data['user_avatar_type'], $user->data['user_avatar_width'], $user->data['user_avatar_height'], 'USER_AVATAR', true),
- 'AVATAR_SIZE' => $config['avatar_filesize'],
+ 'AVATAR' => $avatar,
- 'U_GALLERY' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=profile&amp;mode=avatar&amp;display_gallery=1'),
+ 'S_FORM_ENCTYPE' => ' enctype="multipart/form-data"',
- 'S_FORM_ENCTYPE' => ($can_upload && ($config['allow_avatar_upload'] || $config['allow_avatar_remote_upload'])) ? ' enctype="multipart/form-data"' : '',
+ 'L_AVATAR_EXPLAIN' => phpbb_avatar_explanation_string(),
- 'L_AVATAR_EXPLAIN' => sprintf($user->lang['AVATAR_EXPLAIN'], $config['avatar_max_width'], $config['avatar_max_height'], $config['avatar_filesize'] / 1024),
+ 'S_AVATARS_ENABLED' => ($config['allow_avatar'] && $avatars_enabled),
));
- if ($config['allow_avatar'] && $display_gallery && $auth->acl_get('u_chgavatar') && $config['allow_avatar_local'])
+ break;
+
+ case 'autologin_keys':
+
+ add_form_key('ucp_autologin_keys');
+
+ if ($submit)
{
- avatar_gallery($category, $avatar_select, 4);
+ $keys = request_var('keys', array(''));
+
+ if (!check_form_key('ucp_autologin_keys'))
+ {
+ $error[] = 'FORM_INVALID';
+ }
+
+ if (!sizeof($error))
+ {
+ if (!empty($keys))
+ {
+ foreach ($keys as $key => $id)
+ {
+ $keys[$key] = $db->sql_like_expression($id . $db->get_any_char());
+ }
+ $sql_where = '(key_id ' . implode(' OR key_id ', $keys) . ')';
+ $sql = 'DELETE FROM ' . SESSIONS_KEYS_TABLE . '
+ WHERE user_id = ' . (int) $user->data['user_id'] . '
+ AND ' . $sql_where ;
+
+ $db->sql_query($sql);
+
+ meta_refresh(3, $this->u_action);
+ $message = $user->lang['AUTOLOGIN_SESSION_KEYS_DELETED'] . '<br /><br />' . sprintf($user->lang['RETURN_UCP'], '<a href="' . $this->u_action . '">', '</a>');
+ trigger_error($message);
+ }
+ }
+
+ // Replace "error" strings with their real, localised form
+ $error = array_map(array($user, 'lang'), $error);
}
- else if ($config['allow_avatar'])
- {
- $avatars_enabled = (($can_upload && ($config['allow_avatar_upload'] || $config['allow_avatar_remote_upload'])) || ($auth->acl_get('u_chgavatar') && ($config['allow_avatar_local'] || $config['allow_avatar_remote']))) ? true : false;
- $template->assign_vars(array(
- 'AVATAR_WIDTH' => request_var('width', $user->data['user_avatar_width']),
- 'AVATAR_HEIGHT' => request_var('height', $user->data['user_avatar_height']),
-
- 'S_AVATARS_ENABLED' => $avatars_enabled,
- 'S_UPLOAD_AVATAR_FILE' => ($can_upload && $config['allow_avatar_upload']) ? true : false,
- 'S_UPLOAD_AVATAR_URL' => ($can_upload && $config['allow_avatar_remote_upload']) ? true : false,
- 'S_LINK_AVATAR' => ($auth->acl_get('u_chgavatar') && $config['allow_avatar_remote']) ? true : false,
- 'S_DISPLAY_GALLERY' => ($auth->acl_get('u_chgavatar') && $config['allow_avatar_local']) ? true : false)
- );
+ $sql = 'SELECT key_id, last_ip, last_login
+ FROM ' . SESSIONS_KEYS_TABLE . '
+ WHERE user_id = ' . (int) $user->data['user_id'] . '
+ ORDER BY last_login ASC';
+
+ $result = $db->sql_query($sql);
+
+ while ($row = $db->sql_fetchrow($result))
+ {
+ $template->assign_block_vars('sessions', array(
+ 'KEY' => substr($row['key_id'], 0, 8),
+ 'IP' => $row['last_ip'],
+ 'LOGIN_TIME' => $user->format_date($row['last_login']),
+ ));
}
+ $db->sql_freeresult($result);
+
break;
}
$template->assign_vars(array(
+ 'ERROR' => (sizeof($error)) ? implode('<br />', $error) : '',
+
'L_TITLE' => $user->lang['UCP_PROFILE_' . strtoupper($mode)],
'S_HIDDEN_FIELDS' => $s_hidden_fields,
@@ -642,5 +807,3 @@ class ucp_profile
$this->page_title = 'UCP_PROFILE_' . strtoupper($mode);
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/ucp/ucp_register.php b/phpBB/includes/ucp/ucp_register.php
index 6ad3a55589..52ed410b04 100644
--- a/phpBB/includes/ucp/ucp_register.php
+++ b/phpBB/includes/ucp/ucp_register.php
@@ -1,10 +1,13 @@
<?php
/**
*
-* @package ucp
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -19,7 +22,6 @@ if (!defined('IN_PHPBB'))
/**
* ucp_register
* Board registration
-* @package ucp
*/
class ucp_register
{
@@ -28,21 +30,43 @@ class ucp_register
function main($id, $mode)
{
global $config, $db, $user, $auth, $template, $phpbb_root_path, $phpEx;
+ global $request, $phpbb_container, $phpbb_dispatcher;
//
- if ($config['require_activation'] == USER_ACTIVATION_DISABLE)
+ if ($config['require_activation'] == USER_ACTIVATION_DISABLE ||
+ (in_array($config['require_activation'], array(USER_ACTIVATION_SELF, USER_ACTIVATION_ADMIN)) && !$config['email_enable']))
{
trigger_error('UCP_REGISTER_DISABLE');
}
- include($phpbb_root_path . 'includes/functions_profile_fields.' . $phpEx);
-
- $coppa = (isset($_REQUEST['coppa'])) ? ((!empty($_REQUEST['coppa'])) ? 1 : 0) : false;
- $agreed = (!empty($_POST['agreed'])) ? 1 : 0;
- $submit = (isset($_POST['submit'])) ? true : false;
+ $coppa = $request->is_set('coppa') ? (int) $request->variable('coppa', false) : false;
+ $agreed = $request->variable('agreed', false);
+ $submit = $request->is_set_post('submit');
$change_lang = request_var('change_lang', '');
$user_lang = request_var('lang', $user->lang_name);
+ /**
+ * Add UCP register data before they are assigned to the template or submitted
+ *
+ * To assign data to the template, use $template->assign_vars()
+ *
+ * @event core.ucp_register_requests_after
+ * @var bool coppa Is set coppa
+ * @var bool agreed Did user agree to coppa?
+ * @var bool submit Is set post submit?
+ * @var string change_lang Change language request
+ * @var string user_lang User language request
+ * @since 3.1.11-RC1
+ */
+ $vars = array(
+ 'coppa',
+ 'agreed',
+ 'submit',
+ 'change_lang',
+ 'user_lang',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.ucp_register_requests_after', compact($vars)));
+
if ($agreed)
{
add_form_key('ucp_register');
@@ -63,13 +87,10 @@ class ucp_register
$submit = false;
// Setting back agreed to let the user view the agreement in his/her language
- $agreed = (empty($_GET['change_lang'])) ? 0 : $agreed;
+ $agreed = false;
}
- $user->lang_name = $user_lang = $use_lang;
- $user->lang = array();
- $user->data['user_lang'] = $user->lang_name;
- $user->add_lang(array('common', 'ucp'));
+ $user_lang = $use_lang;
}
else
{
@@ -78,19 +99,36 @@ class ucp_register
}
}
-
- $cp = new custom_profile();
+ $cp = $phpbb_container->get('profilefields.manager');
$error = $cp_data = $cp_error = array();
+ $s_hidden_fields = array();
+
+ // Handle login_link data added to $_hidden_fields
+ $login_link_data = $this->get_login_link_data_array();
+
+ if (!empty($login_link_data))
+ {
+ // Confirm that we have all necessary data
+ $provider_collection = $phpbb_container->get('auth.provider_collection');
+ $auth_provider = $provider_collection->get_provider($request->variable('auth_provider', ''));
+
+ $result = $auth_provider->login_link_has_necessary_data($login_link_data);
+ if ($result !== null)
+ {
+ $error[] = $user->lang[$result];
+ }
+
+ $s_hidden_fields = array_merge($s_hidden_fields, $this->get_login_link_data_for_hidden_fields($login_link_data));
+ }
if (!$agreed || ($coppa === false && $config['coppa_enable']) || ($coppa && !$config['coppa_enable']))
{
- $add_lang = ($change_lang) ? '&amp;change_lang=' . urlencode($change_lang) : '';
$add_coppa = ($coppa !== false) ? '&amp;coppa=' . $coppa : '';
- $s_hidden_fields = array(
- 'change_lang' => $change_lang,
- );
+ $s_hidden_fields = array_merge($s_hidden_fields, array(
+ 'change_lang' => '',
+ ));
// If we change the language, we want to pass on some more possible parameter.
if ($change_lang)
@@ -99,9 +137,8 @@ class ucp_register
$s_hidden_fields = array_merge($s_hidden_fields, array(
'username' => utf8_normalize_nfc(request_var('username', '', true)),
'email' => strtolower(request_var('email', '')),
- 'email_confirm' => strtolower(request_var('email_confirm', '')),
'lang' => $user->lang_name,
- 'tz' => request_var('tz', (float) $config['board_timezone']),
+ 'tz' => request_var('tz', $config['board_timezone']),
));
}
@@ -121,7 +158,10 @@ class ucp_register
if ($coppa === false && $config['coppa_enable'])
{
$now = getdate();
- $coppa_birthday = $user->format_date(mktime($now['hours'] + $user->data['user_dst'], $now['minutes'], $now['seconds'], $now['mon'], $now['mday'] - 1, $now['year'] - 13), $user->lang['DATE_FORMAT']);
+ $coppa_birthday = $user->create_datetime()
+ ->setDate($now['year'] - 13, $now['mon'], $now['mday'] - 1)
+ ->setTime(0, 0, 0)
+ ->format($user->lang['DATE_FORMAT'], true);
unset($now);
$template->assign_vars(array(
@@ -129,12 +169,15 @@ class ucp_register
'L_COPPA_NO' => sprintf($user->lang['UCP_COPPA_BEFORE'], $coppa_birthday),
'L_COPPA_YES' => sprintf($user->lang['UCP_COPPA_ON_AFTER'], $coppa_birthday),
- 'U_COPPA_NO' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=register&amp;coppa=0' . $add_lang),
- 'U_COPPA_YES' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=register&amp;coppa=1' . $add_lang),
+ 'U_COPPA_NO' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=register&amp;coppa=0'),
+ 'U_COPPA_YES' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=register&amp;coppa=1'),
'S_SHOW_COPPA' => true,
'S_HIDDEN_FIELDS' => build_hidden_fields($s_hidden_fields),
- 'S_UCP_ACTION' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=register' . $add_lang),
+ 'S_UCP_ACTION' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=register'),
+
+ 'COOKIE_NAME' => $config['cookie_name'],
+ 'COOKIE_PATH' => $config['cookie_path'],
));
}
else
@@ -146,37 +189,59 @@ class ucp_register
'S_SHOW_COPPA' => false,
'S_REGISTRATION' => true,
'S_HIDDEN_FIELDS' => build_hidden_fields($s_hidden_fields),
- 'S_UCP_ACTION' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=register' . $add_lang . $add_coppa),
+ 'S_UCP_ACTION' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=register' . $add_coppa),
+
+ 'COOKIE_NAME' => $config['cookie_name'],
+ 'COOKIE_PATH' => $config['cookie_path'],
)
);
}
unset($lang_row);
+ /**
+ * Allows to modify the agreements.
+ *
+ * To assign data to the template, use $template->assign_vars()
+ *
+ * @event core.ucp_register_agreement
+ * @since 3.1.6-RC1
+ */
+ $phpbb_dispatcher->dispatch('core.ucp_register_agreement');
+
$this->tpl_name = 'ucp_agreement';
return;
}
-
- // The CAPTCHA kicks in here. We can't help that the information gets lost on language change.
+ // The CAPTCHA kicks in here. We can't help that the information gets lost on language change.
if ($config['enable_confirm'])
{
- include($phpbb_root_path . 'includes/captcha/captcha_factory.' . $phpEx);
- $captcha =& phpbb_captcha_factory::get_instance($config['captcha_plugin']);
+ $captcha = $phpbb_container->get('captcha.factory')->get_instance($config['captcha_plugin']);
$captcha->init(CONFIRM_REG);
}
- $is_dst = $config['board_dst'];
$timezone = $config['board_timezone'];
$data = array(
'username' => utf8_normalize_nfc(request_var('username', '', true)),
- 'new_password' => request_var('new_password', '', true),
- 'password_confirm' => request_var('password_confirm', '', true),
+ 'new_password' => $request->variable('new_password', '', true),
+ 'password_confirm' => $request->variable('password_confirm', '', true),
'email' => strtolower(request_var('email', '')),
- 'email_confirm' => strtolower(request_var('email_confirm', '')),
'lang' => basename(request_var('lang', $user->lang_name)),
- 'tz' => request_var('tz', (float) $timezone),
+ 'tz' => request_var('tz', $timezone),
);
+ /**
+ * Add UCP register data before they are assigned to the template or submitted
+ *
+ * To assign data to the template, use $template->assign_vars()
+ *
+ * @event core.ucp_register_data_before
+ * @var bool submit Do we display the form only
+ * or did the user press submit
+ * @var array data Array with current ucp registration data
+ * @since 3.1.4-RC1
+ */
+ $vars = array('submit', 'data');
+ extract($phpbb_dispatcher->trigger_event('core.ucp_register_data_before', compact($vars)));
// Check and initialize some variables if needed
if ($submit)
@@ -191,9 +256,8 @@ class ucp_register
'password_confirm' => array('string', false, $config['min_pass_chars'], $config['max_pass_chars']),
'email' => array(
array('string', false, 6, 60),
- array('email')),
- 'email_confirm' => array('string', false, 6, 60),
- 'tz' => array('num', false, -14, 14),
+ array('user_email')),
+ 'tz' => array('timezone'),
'lang' => array('language_iso_name'),
));
@@ -203,7 +267,7 @@ class ucp_register
}
// Replace "error" strings with their real, localised form
- $error = preg_replace('#^([A-Z_]+)$#e', "(!empty(\$user->lang['\\1'])) ? \$user->lang['\\1'] : '\\1'", $error);
+ $error = array_map(array($user, 'lang'), $error);
if ($config['enable_confirm'])
{
@@ -237,12 +301,20 @@ class ucp_register
{
$error[] = $user->lang['NEW_PASSWORD_ERROR'];
}
-
- if ($data['email'] != $data['email_confirm'])
- {
- $error[] = $user->lang['NEW_EMAIL_ERROR'];
- }
}
+ /**
+ * Check UCP registration data after they are submitted
+ *
+ * @event core.ucp_register_data_after
+ * @var bool submit Do we display the form only
+ * or did the user press submit
+ * @var array data Array with current ucp registration data
+ * @var array cp_data Array with custom profile fields data
+ * @var array error Array with list of errors
+ * @since 3.1.4-RC1
+ */
+ $vars = array('submit', 'data', 'cp_data', 'error');
+ extract($phpbb_dispatcher->trigger_event('core.ucp_register_data_after', compact($vars)));
if (!sizeof($error))
{
@@ -283,13 +355,15 @@ class ucp_register
$user_inactive_time = 0;
}
+ // Instantiate passwords manager
+ $passwords_manager = $phpbb_container->get('passwords.manager');
+
$user_row = array(
'username' => $data['username'],
- 'user_password' => phpbb_hash($data['new_password']),
+ 'user_password' => $passwords_manager->hash($data['new_password']),
'user_email' => $data['email'],
'group_id' => (int) $group_id,
- 'user_timezone' => (float) $data['tz'],
- 'user_dst' => $is_dst,
+ 'user_timezone' => $data['tz'],
'user_lang' => $data['lang'],
'user_type' => $user_type,
'user_actkey' => $user_actkey,
@@ -303,6 +377,20 @@ class ucp_register
{
$user_row['user_new'] = 1;
}
+ /**
+ * Add into $user_row before user_add
+ *
+ * user_add allows adding more data into the users table
+ *
+ * @event core.ucp_register_user_row_after
+ * @var bool submit Do we display the form only
+ * or did the user press submit
+ * @var array cp_data Array with custom profile fields data
+ * @var array user_row Array with current ucp registration data
+ * @since 3.1.4-RC1
+ */
+ $vars = array('submit', 'cp_data', 'user_row');
+ extract($phpbb_dispatcher->trigger_event('core.ucp_register_user_row_after', compact($vars)));
// Register user...
$user_id = user_add($user_row, $cp_data);
@@ -369,41 +457,28 @@ class ucp_register
}
$messenger->send(NOTIFY_EMAIL);
+ }
- if ($config['require_activation'] == USER_ACTIVATION_ADMIN)
+ if ($config['require_activation'] == USER_ACTIVATION_ADMIN)
+ {
+ $phpbb_notifications = $phpbb_container->get('notification_manager');
+ $phpbb_notifications->add_notifications('notification.type.admin_activate_user', array(
+ 'user_id' => $user_id,
+ 'user_actkey' => $user_row['user_actkey'],
+ 'user_regdate' => $user_row['user_regdate'],
+ ));
+ }
+
+ // Perform account linking if necessary
+ if (!empty($login_link_data))
+ {
+ $login_link_data['user_id'] = $user_id;
+
+ $result = $auth_provider->link_account($login_link_data);
+
+ if ($result)
{
- // Grab an array of user_id's with a_user permissions ... these users can activate a user
- $admin_ary = $auth->acl_get_list(false, 'a_user', false);
- $admin_ary = (!empty($admin_ary[0]['a_user'])) ? $admin_ary[0]['a_user'] : array();
-
- // Also include founders
- $where_sql = ' WHERE user_type = ' . USER_FOUNDER;
-
- if (sizeof($admin_ary))
- {
- $where_sql .= ' OR ' . $db->sql_in_set('user_id', $admin_ary);
- }
-
- $sql = 'SELECT user_id, username, user_email, user_lang, user_jabber, user_notify_type
- FROM ' . USERS_TABLE . ' ' .
- $where_sql;
- $result = $db->sql_query($sql);
-
- while ($row = $db->sql_fetchrow($result))
- {
- $messenger->template('admin_activate', $row['user_lang']);
- $messenger->to($row['user_email'], $row['username']);
- $messenger->im($row['user_jabber'], $row['username']);
-
- $messenger->assign_vars(array(
- 'USERNAME' => htmlspecialchars_decode($data['username']),
- 'U_USER_DETAILS' => "$server_url/memberlist.$phpEx?mode=viewprofile&u=$user_id",
- 'U_ACTIVATE' => "$server_url/ucp.$phpEx?mode=activate&u=$user_id&k=$user_actkey")
- );
-
- $messenger->send($row['user_notify_type']);
- }
- $db->sql_freeresult($result);
+ $message = $message . '<br /><br />' . $user->lang[$result];
}
}
@@ -412,10 +487,10 @@ class ucp_register
}
}
- $s_hidden_fields = array(
+ $s_hidden_fields = array_merge($s_hidden_fields, array(
'agreed' => 'true',
'change_lang' => 0,
- );
+ ));
if ($config['coppa_enable'])
{
@@ -450,25 +525,28 @@ class ucp_register
break;
}
+ $timezone_selects = phpbb_timezone_select($template, $user, $data['tz'], true);
$template->assign_vars(array(
'ERROR' => (sizeof($error)) ? implode('<br />', $error) : '',
'USERNAME' => $data['username'],
'PASSWORD' => $data['new_password'],
'PASSWORD_CONFIRM' => $data['password_confirm'],
'EMAIL' => $data['email'],
- 'EMAIL_CONFIRM' => $data['email_confirm'],
'L_REG_COND' => $l_reg_cond,
- 'L_USERNAME_EXPLAIN' => sprintf($user->lang[$config['allow_name_chars'] . '_EXPLAIN'], $config['min_name_chars'], $config['max_name_chars']),
- 'L_PASSWORD_EXPLAIN' => sprintf($user->lang[$config['pass_complex'] . '_EXPLAIN'], $config['min_pass_chars'], $config['max_pass_chars']),
+ 'L_USERNAME_EXPLAIN' => $user->lang($config['allow_name_chars'] . '_EXPLAIN', $user->lang('CHARACTERS', (int) $config['min_name_chars']), $user->lang('CHARACTERS', (int) $config['max_name_chars'])),
+ 'L_PASSWORD_EXPLAIN' => $user->lang($config['pass_complex'] . '_EXPLAIN', $user->lang('CHARACTERS', (int) $config['min_pass_chars']), $user->lang('CHARACTERS', (int) $config['max_pass_chars'])),
'S_LANG_OPTIONS' => language_select($data['lang']),
- 'S_TZ_OPTIONS' => tz_select($data['tz']),
+ 'S_TZ_PRESELECT' => !$submit,
'S_CONFIRM_REFRESH' => ($config['enable_confirm'] && $config['confirm_refresh']) ? true : false,
'S_REGISTRATION' => true,
'S_COPPA' => $coppa,
'S_HIDDEN_FIELDS' => $s_hidden_fields,
'S_UCP_ACTION' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=register'),
+
+ 'COOKIE_NAME' => $config['cookie_name'],
+ 'COOKIE_PATH' => $config['cookie_path'],
));
//
@@ -481,6 +559,49 @@ class ucp_register
$this->tpl_name = 'ucp_register';
$this->page_title = 'UCP_REGISTRATION';
}
-}
-?> \ No newline at end of file
+ /**
+ * Creates the login_link data array
+ *
+ * @return array Returns an array of all POST paramaters whose names
+ * begin with 'login_link_'
+ */
+ protected function get_login_link_data_array()
+ {
+ global $request;
+
+ $var_names = $request->variable_names(\phpbb\request\request_interface::POST);
+ $login_link_data = array();
+ $string_start_length = strlen('login_link_');
+
+ foreach ($var_names as $var_name)
+ {
+ if (strpos($var_name, 'login_link_') === 0)
+ {
+ $key_name = substr($var_name, $string_start_length);
+ $login_link_data[$key_name] = $request->variable($var_name, '', false, \phpbb\request\request_interface::POST);
+ }
+ }
+
+ return $login_link_data;
+ }
+
+ /**
+ * Prepends they key names of an associative array with 'login_link_' for
+ * inclusion on the page as hidden fields.
+ *
+ * @param array $data The array to be modified
+ * @return array The modified array
+ */
+ protected function get_login_link_data_for_hidden_fields($data)
+ {
+ $new_data = array();
+
+ foreach ($data as $key => $value)
+ {
+ $new_data['login_link_' . $key] = $value;
+ }
+
+ return $new_data;
+ }
+}
diff --git a/phpBB/includes/ucp/ucp_remind.php b/phpBB/includes/ucp/ucp_remind.php
index bcb21cbedc..497bf6a2c4 100644
--- a/phpBB/includes/ucp/ucp_remind.php
+++ b/phpBB/includes/ucp/ucp_remind.php
@@ -1,10 +1,13 @@
<?php
/**
*
-* @package ucp
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -19,7 +22,6 @@ if (!defined('IN_PHPBB'))
/**
* ucp_remind
* Sending password reminders
-* @package ucp
*/
class ucp_remind
{
@@ -28,18 +30,50 @@ class ucp_remind
function main($id, $mode)
{
global $config, $phpbb_root_path, $phpEx;
- global $db, $user, $auth, $template;
+ global $db, $user, $auth, $template, $phpbb_container, $phpbb_dispatcher;
+
+ if (!$config['allow_password_reset'])
+ {
+ trigger_error($user->lang('UCP_PASSWORD_RESET_DISABLED', '<a href="mailto:' . htmlspecialchars($config['board_contact']) . '">', '</a>'));
+ }
$username = request_var('username', '', true);
$email = strtolower(request_var('email', ''));
$submit = (isset($_POST['submit'])) ? true : false;
+ add_form_key('ucp_remind');
+
if ($submit)
{
- $sql = 'SELECT user_id, username, user_permissions, user_email, user_jabber, user_notify_type, user_type, user_lang, user_inactive_reason
- FROM ' . USERS_TABLE . "
- WHERE user_email_hash = '" . $db->sql_escape(phpbb_email_hash($email)) . "'
- AND username_clean = '" . $db->sql_escape(utf8_clean_string($username)) . "'";
+ if (!check_form_key('ucp_remind'))
+ {
+ trigger_error('FORM_INVALID');
+ }
+
+ $sql_array = array(
+ 'SELECT' => 'user_id, username, user_permissions, user_email, user_jabber, user_notify_type, user_type, user_lang, user_inactive_reason',
+ 'FROM' => array(USERS_TABLE => 'u'),
+ 'WHERE' => "user_email_hash = '" . $db->sql_escape(phpbb_email_hash($email)) . "'
+ AND username_clean = '" . $db->sql_escape(utf8_clean_string($username)) . "'"
+ );
+
+ /**
+ * Change SQL query for fetching user data
+ *
+ * @event core.ucp_remind_modify_select_sql
+ * @var string email User's email from the form
+ * @var string username User's username from the form
+ * @var array sql_array Fully assembled SQL query with keys SELECT, FROM, WHERE
+ * @since 3.1.11-RC1
+ */
+ $vars = array(
+ 'email',
+ 'username',
+ 'sql_array',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.ucp_remind_modify_select_sql', compact($vars)));
+
+ $sql = $db->sql_build_query('SELECT', $sql_array);
$result = $db->sql_query($sql);
$user_row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
@@ -67,7 +101,7 @@ class ucp_remind
}
// Check users permissions
- $auth2 = new auth();
+ $auth2 = new \phpbb\auth\auth();
$auth2->acl($user_row);
if (!$auth2->acl_get('u_chgpasswd'))
@@ -84,8 +118,11 @@ class ucp_remind
// For the activation key a random length between 6 and 10 will do.
$user_actkey = gen_rand_string(mt_rand(6, 10));
+ // Instantiate passwords manager
+ $passwords_manager = $phpbb_container->get('passwords.manager');
+
$sql = 'UPDATE ' . USERS_TABLE . "
- SET user_newpasswd = '" . $db->sql_escape(phpbb_hash($user_password)) . "', user_actkey = '" . $db->sql_escape($user_actkey) . "'
+ SET user_newpasswd = '" . $db->sql_escape($passwords_manager->hash($user_password)) . "', user_actkey = '" . $db->sql_escape($user_actkey) . "'
WHERE user_id = " . $user_row['user_id'];
$db->sql_query($sql);
@@ -95,8 +132,7 @@ class ucp_remind
$messenger->template('user_activate_passwd', $user_row['user_lang']);
- $messenger->to($user_row['user_email'], $user_row['username']);
- $messenger->im($user_row['user_jabber'], $user_row['username']);
+ $messenger->set_addresses($user_row);
$messenger->anti_abuse_headers($config, $user);
@@ -124,5 +160,3 @@ class ucp_remind
$this->page_title = 'UCP_REMIND';
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/ucp/ucp_resend.php b/phpBB/includes/ucp/ucp_resend.php
index 4d181dba49..9fe8850000 100644
--- a/phpBB/includes/ucp/ucp_resend.php
+++ b/phpBB/includes/ucp/ucp_resend.php
@@ -1,10 +1,13 @@
<?php
/**
*
-* @package ucp
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -19,7 +22,6 @@ if (!defined('IN_PHPBB'))
/**
* ucp_resend
* Resending activation emails
-* @package ucp
*/
class ucp_resend
{
@@ -92,7 +94,7 @@ class ucp_resend
if ($config['require_activation'] == USER_ACTIVATION_SELF || $coppa)
{
$messenger->template(($coppa) ? 'coppa_resend_inactive' : 'user_resend_inactive', $user_row['user_lang']);
- $messenger->to($user_row['user_email'], $user_row['username']);
+ $messenger->set_addresses($user_row);
$messenger->anti_abuse_headers($config, $user);
@@ -127,8 +129,7 @@ class ucp_resend
while ($row = $db->sql_fetchrow($result))
{
$messenger->template('admin_activate', $row['user_lang']);
- $messenger->to($row['user_email'], $row['username']);
- $messenger->im($row['user_jabber'], $row['username']);
+ $messenger->set_addresses($row);
$messenger->anti_abuse_headers($config, $user);
@@ -160,5 +161,3 @@ class ucp_resend
$this->page_title = 'UCP_RESEND';
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/ucp/ucp_zebra.php b/phpBB/includes/ucp/ucp_zebra.php
index 5ed4db7520..dbf8cf31c1 100644
--- a/phpBB/includes/ucp/ucp_zebra.php
+++ b/phpBB/includes/ucp/ucp_zebra.php
@@ -1,10 +1,13 @@
<?php
/**
*
-* @package ucp
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -16,17 +19,13 @@ if (!defined('IN_PHPBB'))
exit;
}
-/**
-* ucp_zebra
-* @package ucp
-*/
class ucp_zebra
{
var $u_action;
function main($id, $mode)
{
- global $config, $db, $user, $auth, $template, $phpbb_root_path, $phpEx;
+ global $config, $db, $user, $auth, $template, $phpbb_root_path, $phpEx, $request, $phpbb_dispatcher;
$submit = (isset($_POST['submit']) || isset($_GET['add']) || isset($_GET['remove'])) ? true : false;
$s_hidden_fields = '';
@@ -55,9 +54,22 @@ class ucp_zebra
// Remove users
if (!empty($data['usernames']))
{
+ $user_ids = $data['usernames'];
+
+ /**
+ * Remove users from friends/foes
+ *
+ * @event core.ucp_remove_zebra
+ * @var string mode Zebra type: friends|foes
+ * @var array user_ids User ids we remove
+ * @since 3.1.0-a1
+ */
+ $vars = array('mode', 'user_ids');
+ extract($phpbb_dispatcher->trigger_event('core.ucp_remove_zebra', compact($vars)));
+
$sql = 'DELETE FROM ' . ZEBRA_TABLE . '
WHERE user_id = ' . $user->data['user_id'] . '
- AND ' . $db->sql_in_set('zebra_id', $data['usernames']);
+ AND ' . $db->sql_in_set('zebra_id', $user_ids);
$db->sql_query($sql);
$updated = true;
@@ -187,6 +199,19 @@ class ucp_zebra
);
}
+ /**
+ * Add users to friends/foes
+ *
+ * @event core.ucp_add_zebra
+ * @var string mode Zebra type:
+ * friends|foes
+ * @var array sql_ary Array of
+ * entries we add
+ * @since 3.1.0-a1
+ */
+ $vars = array('mode', 'sql_ary');
+ extract($phpbb_dispatcher->trigger_event('core.ucp_add_zebra', compact($vars)));
+
$db->sql_multi_insert(ZEBRA_TABLE, $sql_ary);
$updated = true;
@@ -200,7 +225,23 @@ class ucp_zebra
}
}
- if ($updated)
+ if ($request->is_ajax())
+ {
+ $message = ($updated) ? $user->lang[$l_mode . '_UPDATED'] : implode('<br />', $error);
+
+ $json_response = new \phpbb\json_response;
+ $json_response->send(array(
+ 'success' => $updated,
+
+ 'MESSAGE_TITLE' => $user->lang['INFORMATION'],
+ 'MESSAGE_TEXT' => $message,
+ 'REFRESH_DATA' => array(
+ 'time' => 3,
+ 'url' => $this->u_action
+ )
+ ));
+ }
+ else if ($updated)
{
meta_refresh(3, $this->u_action);
$message = $user->lang[$l_mode . '_UPDATED'] . '<br />' . implode('<br />', $error) . ((sizeof($error)) ? '<br />' : '') . '<br />' . sprintf($user->lang['RETURN_UCP'], '<a href="' . $this->u_action . '">', '</a>');
@@ -253,5 +294,3 @@ class ucp_zebra
$this->page_title = 'UCP_ZEBRA_' . $l_mode;
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/utf/data/case_fold_c.php b/phpBB/includes/utf/data/case_fold_c.php
index 00de1ba349..a5e3fc7990 100644
--- a/phpBB/includes/utf/data/case_fold_c.php
+++ b/phpBB/includes/utf/data/case_fold_c.php
@@ -1 +1 @@
-<?php return array('A'=>'a','B'=>'b','C'=>'c','D'=>'d','E'=>'e','F'=>'f','G'=>'g','H'=>'h','I'=>'i','J'=>'j','K'=>'k','L'=>'l','M'=>'m','N'=>'n','O'=>'o','P'=>'p','Q'=>'q','R'=>'r','S'=>'s','T'=>'t','U'=>'u','V'=>'v','W'=>'w','X'=>'x','Y'=>'y','Z'=>'z','µ'=>'μ','À'=>'à','Á'=>'á','Â'=>'â','Ã'=>'ã','Ä'=>'ä','Å'=>'å','Æ'=>'æ','Ç'=>'ç','È'=>'è','É'=>'é','Ê'=>'ê','Ë'=>'ë','Ì'=>'ì','Í'=>'í','Î'=>'î','Ï'=>'ï','Ð'=>'ð','Ñ'=>'ñ','Ò'=>'ò','Ó'=>'ó','Ô'=>'ô','Õ'=>'õ','Ö'=>'ö','Ø'=>'ø','Ù'=>'ù','Ú'=>'ú','Û'=>'û','Ü'=>'ü','Ý'=>'ý','Þ'=>'þ','Ā'=>'ā','Ă'=>'ă','Ą'=>'ą','Ć'=>'ć','Ĉ'=>'ĉ','Ċ'=>'ċ','Č'=>'č','Ď'=>'ď','Đ'=>'đ','Ē'=>'ē','Ĕ'=>'ĕ','Ė'=>'ė','Ę'=>'ę','Ě'=>'ě','Ĝ'=>'ĝ','Ğ'=>'ğ','Ġ'=>'ġ','Ģ'=>'ģ','Ĥ'=>'ĥ','Ħ'=>'ħ','Ĩ'=>'ĩ','Ī'=>'ī','Ĭ'=>'ĭ','Į'=>'į','IJ'=>'ij','Ĵ'=>'ĵ','Ķ'=>'ķ','Ĺ'=>'ĺ','Ļ'=>'ļ','Ľ'=>'ľ','Ŀ'=>'ŀ','Ł'=>'ł','Ń'=>'ń','Ņ'=>'ņ','Ň'=>'ň','Ŋ'=>'ŋ','Ō'=>'ō','Ŏ'=>'ŏ','Ő'=>'ő','Œ'=>'œ','Ŕ'=>'ŕ','Ŗ'=>'ŗ','Ř'=>'ř','Ś'=>'ś','Ŝ'=>'ŝ','Ş'=>'ş','Š'=>'š','Ţ'=>'ţ','Ť'=>'ť','Ŧ'=>'ŧ','Ũ'=>'ũ','Ū'=>'ū','Ŭ'=>'ŭ','Ů'=>'ů','Ű'=>'ű','Ų'=>'ų','Ŵ'=>'ŵ','Ŷ'=>'ŷ','Ÿ'=>'ÿ','Ź'=>'ź','Ż'=>'ż','Ž'=>'ž','ſ'=>'s','Ɓ'=>'ɓ','Ƃ'=>'ƃ','Ƅ'=>'ƅ','Ɔ'=>'ɔ','Ƈ'=>'ƈ','Ɖ'=>'ɖ','Ɗ'=>'ɗ','Ƌ'=>'ƌ','Ǝ'=>'ǝ','Ə'=>'ə','Ɛ'=>'ɛ','Ƒ'=>'ƒ','Ɠ'=>'ɠ','Ɣ'=>'ɣ','Ɩ'=>'ɩ','Ɨ'=>'ɨ','Ƙ'=>'ƙ','Ɯ'=>'ɯ','Ɲ'=>'ɲ','Ɵ'=>'ɵ','Ơ'=>'ơ','Ƣ'=>'ƣ','Ƥ'=>'ƥ','Ʀ'=>'ʀ','Ƨ'=>'ƨ','Ʃ'=>'ʃ','Ƭ'=>'ƭ','Ʈ'=>'ʈ','Ư'=>'ư','Ʊ'=>'ʊ','Ʋ'=>'ʋ','Ƴ'=>'ƴ','Ƶ'=>'ƶ','Ʒ'=>'ʒ','Ƹ'=>'ƹ','Ƽ'=>'ƽ','DŽ'=>'dž','Dž'=>'dž','LJ'=>'lj','Lj'=>'lj','NJ'=>'nj','Nj'=>'nj','Ǎ'=>'ǎ','Ǐ'=>'ǐ','Ǒ'=>'ǒ','Ǔ'=>'ǔ','Ǖ'=>'ǖ','Ǘ'=>'ǘ','Ǚ'=>'ǚ','Ǜ'=>'ǜ','Ǟ'=>'ǟ','Ǡ'=>'ǡ','Ǣ'=>'ǣ','Ǥ'=>'ǥ','Ǧ'=>'ǧ','Ǩ'=>'ǩ','Ǫ'=>'ǫ','Ǭ'=>'ǭ','Ǯ'=>'ǯ','DZ'=>'dz','Dz'=>'dz','Ǵ'=>'ǵ','Ƕ'=>'ƕ','Ƿ'=>'ƿ','Ǹ'=>'ǹ','Ǻ'=>'ǻ','Ǽ'=>'ǽ','Ǿ'=>'ǿ','Ȁ'=>'ȁ','Ȃ'=>'ȃ','Ȅ'=>'ȅ','Ȇ'=>'ȇ','Ȉ'=>'ȉ','Ȋ'=>'ȋ','Ȍ'=>'ȍ','Ȏ'=>'ȏ','Ȑ'=>'ȑ','Ȓ'=>'ȓ','Ȕ'=>'ȕ','Ȗ'=>'ȗ','Ș'=>'ș','Ț'=>'ț','Ȝ'=>'ȝ','Ȟ'=>'ȟ','Ƞ'=>'ƞ','Ȣ'=>'ȣ','Ȥ'=>'ȥ','Ȧ'=>'ȧ','Ȩ'=>'ȩ','Ȫ'=>'ȫ','Ȭ'=>'ȭ','Ȯ'=>'ȯ','Ȱ'=>'ȱ','Ȳ'=>'ȳ','Ⱥ'=>'ⱥ','Ȼ'=>'ȼ','Ƚ'=>'ƚ','Ⱦ'=>'ⱦ','Ɂ'=>'ɂ','Ƀ'=>'ƀ','Ʉ'=>'ʉ','Ʌ'=>'ʌ','Ɇ'=>'ɇ','Ɉ'=>'ɉ','Ɋ'=>'ɋ','Ɍ'=>'ɍ','Ɏ'=>'ɏ','ͅ'=>'ι','Ά'=>'ά','Έ'=>'έ','Ή'=>'ή','Ί'=>'ί','Ό'=>'ό','Ύ'=>'ύ','Ώ'=>'ώ','Α'=>'α','Β'=>'β','Γ'=>'γ','Δ'=>'δ','Ε'=>'ε','Ζ'=>'ζ','Η'=>'η','Θ'=>'θ','Ι'=>'ι','Κ'=>'κ','Λ'=>'λ','Μ'=>'μ','Ν'=>'ν','Ξ'=>'ξ','Ο'=>'ο','Π'=>'π','Ρ'=>'ρ','Σ'=>'σ','Τ'=>'τ','Υ'=>'υ','Φ'=>'φ','Χ'=>'χ','Ψ'=>'ψ','Ω'=>'ω','Ϊ'=>'ϊ','Ϋ'=>'ϋ','ς'=>'σ','ϐ'=>'β','ϑ'=>'θ','ϕ'=>'φ','ϖ'=>'π','Ϙ'=>'ϙ','Ϛ'=>'ϛ','Ϝ'=>'ϝ','Ϟ'=>'ϟ','Ϡ'=>'ϡ','Ϣ'=>'ϣ','Ϥ'=>'ϥ','Ϧ'=>'ϧ','Ϩ'=>'ϩ','Ϫ'=>'ϫ','Ϭ'=>'ϭ','Ϯ'=>'ϯ','ϰ'=>'κ','ϱ'=>'ρ','ϴ'=>'θ','ϵ'=>'ε','Ϸ'=>'ϸ','Ϲ'=>'ϲ','Ϻ'=>'ϻ','Ͻ'=>'ͻ','Ͼ'=>'ͼ','Ͽ'=>'ͽ','Ѐ'=>'ѐ','Ё'=>'ё','Ђ'=>'ђ','Ѓ'=>'ѓ','Є'=>'є','Ѕ'=>'ѕ','І'=>'і','Ї'=>'ї','Ј'=>'ј','Љ'=>'љ','Њ'=>'њ','Ћ'=>'ћ','Ќ'=>'ќ','Ѝ'=>'ѝ','Ў'=>'ў','Џ'=>'џ','А'=>'а','Б'=>'б','В'=>'в','Г'=>'г','Д'=>'д','Е'=>'е','Ж'=>'ж','З'=>'з','И'=>'и','Й'=>'й','К'=>'к','Л'=>'л','М'=>'м','Н'=>'н','О'=>'о','П'=>'п','Р'=>'р','С'=>'с','Т'=>'т','У'=>'у','Ф'=>'ф','Х'=>'х','Ц'=>'ц','Ч'=>'ч','Ш'=>'ш','Щ'=>'щ','Ъ'=>'ъ','Ы'=>'ы','Ь'=>'ь','Э'=>'э','Ю'=>'ю','Я'=>'я','Ѡ'=>'ѡ','Ѣ'=>'ѣ','Ѥ'=>'ѥ','Ѧ'=>'ѧ','Ѩ'=>'ѩ','Ѫ'=>'ѫ','Ѭ'=>'ѭ','Ѯ'=>'ѯ','Ѱ'=>'ѱ','Ѳ'=>'ѳ','Ѵ'=>'ѵ','Ѷ'=>'ѷ','Ѹ'=>'ѹ','Ѻ'=>'ѻ','Ѽ'=>'ѽ','Ѿ'=>'ѿ','Ҁ'=>'ҁ','Ҋ'=>'ҋ','Ҍ'=>'ҍ','Ҏ'=>'ҏ','Ґ'=>'ґ','Ғ'=>'ғ','Ҕ'=>'ҕ','Җ'=>'җ','Ҙ'=>'ҙ','Қ'=>'қ','Ҝ'=>'ҝ','Ҟ'=>'ҟ','Ҡ'=>'ҡ','Ң'=>'ң','Ҥ'=>'ҥ','Ҧ'=>'ҧ','Ҩ'=>'ҩ','Ҫ'=>'ҫ','Ҭ'=>'ҭ','Ү'=>'ү','Ұ'=>'ұ','Ҳ'=>'ҳ','Ҵ'=>'ҵ','Ҷ'=>'ҷ','Ҹ'=>'ҹ','Һ'=>'һ','Ҽ'=>'ҽ','Ҿ'=>'ҿ','Ӏ'=>'ӏ','Ӂ'=>'ӂ','Ӄ'=>'ӄ','Ӆ'=>'ӆ','Ӈ'=>'ӈ','Ӊ'=>'ӊ','Ӌ'=>'ӌ','Ӎ'=>'ӎ','Ӑ'=>'ӑ','Ӓ'=>'ӓ','Ӕ'=>'ӕ','Ӗ'=>'ӗ','Ә'=>'ә','Ӛ'=>'ӛ','Ӝ'=>'ӝ','Ӟ'=>'ӟ','Ӡ'=>'ӡ','Ӣ'=>'ӣ','Ӥ'=>'ӥ','Ӧ'=>'ӧ','Ө'=>'ө','Ӫ'=>'ӫ','Ӭ'=>'ӭ','Ӯ'=>'ӯ','Ӱ'=>'ӱ','Ӳ'=>'ӳ','Ӵ'=>'ӵ','Ӷ'=>'ӷ','Ӹ'=>'ӹ','Ӻ'=>'ӻ','Ӽ'=>'ӽ','Ӿ'=>'ӿ','Ԁ'=>'ԁ','Ԃ'=>'ԃ','Ԅ'=>'ԅ','Ԇ'=>'ԇ','Ԉ'=>'ԉ','Ԋ'=>'ԋ','Ԍ'=>'ԍ','Ԏ'=>'ԏ','Ԑ'=>'ԑ','Ԓ'=>'ԓ','Ա'=>'ա','Բ'=>'բ','Գ'=>'գ','Դ'=>'դ','Ե'=>'ե','Զ'=>'զ','Է'=>'է','Ը'=>'ը','Թ'=>'թ','Ժ'=>'ժ','Ի'=>'ի','Լ'=>'լ','Խ'=>'խ','Ծ'=>'ծ','Կ'=>'կ','Հ'=>'հ','Ձ'=>'ձ','Ղ'=>'ղ','Ճ'=>'ճ','Մ'=>'մ','Յ'=>'յ','Ն'=>'ն','Շ'=>'շ','Ո'=>'ո','Չ'=>'չ','Պ'=>'պ','Ջ'=>'ջ','Ռ'=>'ռ','Ս'=>'ս','Վ'=>'վ','Տ'=>'տ','Ր'=>'ր','Ց'=>'ց','Ւ'=>'ւ','Փ'=>'փ','Ք'=>'ք','Օ'=>'օ','Ֆ'=>'ֆ','Ⴀ'=>'ⴀ','Ⴁ'=>'ⴁ','Ⴂ'=>'ⴂ','Ⴃ'=>'ⴃ','Ⴄ'=>'ⴄ','Ⴅ'=>'ⴅ','Ⴆ'=>'ⴆ','Ⴇ'=>'ⴇ','Ⴈ'=>'ⴈ','Ⴉ'=>'ⴉ','Ⴊ'=>'ⴊ','Ⴋ'=>'ⴋ','Ⴌ'=>'ⴌ','Ⴍ'=>'ⴍ','Ⴎ'=>'ⴎ','Ⴏ'=>'ⴏ','Ⴐ'=>'ⴐ','Ⴑ'=>'ⴑ','Ⴒ'=>'ⴒ','Ⴓ'=>'ⴓ','Ⴔ'=>'ⴔ','Ⴕ'=>'ⴕ','Ⴖ'=>'ⴖ','Ⴗ'=>'ⴗ','Ⴘ'=>'ⴘ','Ⴙ'=>'ⴙ','Ⴚ'=>'ⴚ','Ⴛ'=>'ⴛ','Ⴜ'=>'ⴜ','Ⴝ'=>'ⴝ','Ⴞ'=>'ⴞ','Ⴟ'=>'ⴟ','Ⴠ'=>'ⴠ','Ⴡ'=>'ⴡ','Ⴢ'=>'ⴢ','Ⴣ'=>'ⴣ','Ⴤ'=>'ⴤ','Ⴥ'=>'ⴥ','Ḁ'=>'ḁ','Ḃ'=>'ḃ','Ḅ'=>'ḅ','Ḇ'=>'ḇ','Ḉ'=>'ḉ','Ḋ'=>'ḋ','Ḍ'=>'ḍ','Ḏ'=>'ḏ','Ḑ'=>'ḑ','Ḓ'=>'ḓ','Ḕ'=>'ḕ','Ḗ'=>'ḗ','Ḙ'=>'ḙ','Ḛ'=>'ḛ','Ḝ'=>'ḝ','Ḟ'=>'ḟ','Ḡ'=>'ḡ','Ḣ'=>'ḣ','Ḥ'=>'ḥ','Ḧ'=>'ḧ','Ḩ'=>'ḩ','Ḫ'=>'ḫ','Ḭ'=>'ḭ','Ḯ'=>'ḯ','Ḱ'=>'ḱ','Ḳ'=>'ḳ','Ḵ'=>'ḵ','Ḷ'=>'ḷ','Ḹ'=>'ḹ','Ḻ'=>'ḻ','Ḽ'=>'ḽ','Ḿ'=>'ḿ','Ṁ'=>'ṁ','Ṃ'=>'ṃ','Ṅ'=>'ṅ','Ṇ'=>'ṇ','Ṉ'=>'ṉ','Ṋ'=>'ṋ','Ṍ'=>'ṍ','Ṏ'=>'ṏ','Ṑ'=>'ṑ','Ṓ'=>'ṓ','Ṕ'=>'ṕ','Ṗ'=>'ṗ','Ṙ'=>'ṙ','Ṛ'=>'ṛ','Ṝ'=>'ṝ','Ṟ'=>'ṟ','Ṡ'=>'ṡ','Ṣ'=>'ṣ','Ṥ'=>'ṥ','Ṧ'=>'ṧ','Ṩ'=>'ṩ','Ṫ'=>'ṫ','Ṭ'=>'ṭ','Ṯ'=>'ṯ','Ṱ'=>'ṱ','Ṳ'=>'ṳ','Ṵ'=>'ṵ','Ṷ'=>'ṷ','Ṹ'=>'ṹ','Ṻ'=>'ṻ','Ṽ'=>'ṽ','Ṿ'=>'ṿ','Ẁ'=>'ẁ','Ẃ'=>'ẃ','Ẅ'=>'ẅ','Ẇ'=>'ẇ','Ẉ'=>'ẉ','Ẋ'=>'ẋ','Ẍ'=>'ẍ','Ẏ'=>'ẏ','Ẑ'=>'ẑ','Ẓ'=>'ẓ','Ẕ'=>'ẕ','ẛ'=>'ṡ','Ạ'=>'ạ','Ả'=>'ả','Ấ'=>'ấ','Ầ'=>'ầ','Ẩ'=>'ẩ','Ẫ'=>'ẫ','Ậ'=>'ậ','Ắ'=>'ắ','Ằ'=>'ằ','Ẳ'=>'ẳ','Ẵ'=>'ẵ','Ặ'=>'ặ','Ẹ'=>'ẹ','Ẻ'=>'ẻ','Ẽ'=>'ẽ','Ế'=>'ế','Ề'=>'ề','Ể'=>'ể','Ễ'=>'ễ','Ệ'=>'ệ','Ỉ'=>'ỉ','Ị'=>'ị','Ọ'=>'ọ','Ỏ'=>'ỏ','Ố'=>'ố','Ồ'=>'ồ','Ổ'=>'ổ','Ỗ'=>'ỗ','Ộ'=>'ộ','Ớ'=>'ớ','Ờ'=>'ờ','Ở'=>'ở','Ỡ'=>'ỡ','Ợ'=>'ợ','Ụ'=>'ụ','Ủ'=>'ủ','Ứ'=>'ứ','Ừ'=>'ừ','Ử'=>'ử','Ữ'=>'ữ','Ự'=>'ự','Ỳ'=>'ỳ','Ỵ'=>'ỵ','Ỷ'=>'ỷ','Ỹ'=>'ỹ','Ἀ'=>'ἀ','Ἁ'=>'ἁ','Ἂ'=>'ἂ','Ἃ'=>'ἃ','Ἄ'=>'ἄ','Ἅ'=>'ἅ','Ἆ'=>'ἆ','Ἇ'=>'ἇ','Ἐ'=>'ἐ','Ἑ'=>'ἑ','Ἒ'=>'ἒ','Ἓ'=>'ἓ','Ἔ'=>'ἔ','Ἕ'=>'ἕ','Ἠ'=>'ἠ','Ἡ'=>'ἡ','Ἢ'=>'ἢ','Ἣ'=>'ἣ','Ἤ'=>'ἤ','Ἥ'=>'ἥ','Ἦ'=>'ἦ','Ἧ'=>'ἧ','Ἰ'=>'ἰ','Ἱ'=>'ἱ','Ἲ'=>'ἲ','Ἳ'=>'ἳ','Ἴ'=>'ἴ','Ἵ'=>'ἵ','Ἶ'=>'ἶ','Ἷ'=>'ἷ','Ὀ'=>'ὀ','Ὁ'=>'ὁ','Ὂ'=>'ὂ','Ὃ'=>'ὃ','Ὄ'=>'ὄ','Ὅ'=>'ὅ','Ὑ'=>'ὑ','Ὓ'=>'ὓ','Ὕ'=>'ὕ','Ὗ'=>'ὗ','Ὠ'=>'ὠ','Ὡ'=>'ὡ','Ὢ'=>'ὢ','Ὣ'=>'ὣ','Ὤ'=>'ὤ','Ὥ'=>'ὥ','Ὦ'=>'ὦ','Ὧ'=>'ὧ','Ᾰ'=>'ᾰ','Ᾱ'=>'ᾱ','Ὰ'=>'ὰ','Ά'=>'ά','ι'=>'ι','Ὲ'=>'ὲ','Έ'=>'έ','Ὴ'=>'ὴ','Ή'=>'ή','Ῐ'=>'ῐ','Ῑ'=>'ῑ','Ὶ'=>'ὶ','Ί'=>'ί','Ῠ'=>'ῠ','Ῡ'=>'ῡ','Ὺ'=>'ὺ','Ύ'=>'ύ','Ῥ'=>'ῥ','Ὸ'=>'ὸ','Ό'=>'ό','Ὼ'=>'ὼ','Ώ'=>'ώ','Ω'=>'ω','K'=>'k','Å'=>'å','Ⅎ'=>'ⅎ','Ⅰ'=>'ⅰ','Ⅱ'=>'ⅱ','Ⅲ'=>'ⅲ','Ⅳ'=>'ⅳ','Ⅴ'=>'ⅴ','Ⅵ'=>'ⅵ','Ⅶ'=>'ⅶ','Ⅷ'=>'ⅷ','Ⅸ'=>'ⅸ','Ⅹ'=>'ⅹ','Ⅺ'=>'ⅺ','Ⅻ'=>'ⅻ','Ⅼ'=>'ⅼ','Ⅽ'=>'ⅽ','Ⅾ'=>'ⅾ','Ⅿ'=>'ⅿ','Ↄ'=>'ↄ','Ⓐ'=>'ⓐ','Ⓑ'=>'ⓑ','Ⓒ'=>'ⓒ','Ⓓ'=>'ⓓ','Ⓔ'=>'ⓔ','Ⓕ'=>'ⓕ','Ⓖ'=>'ⓖ','Ⓗ'=>'ⓗ','Ⓘ'=>'ⓘ','Ⓙ'=>'ⓙ','Ⓚ'=>'ⓚ','Ⓛ'=>'ⓛ','Ⓜ'=>'ⓜ','Ⓝ'=>'ⓝ','Ⓞ'=>'ⓞ','Ⓟ'=>'ⓟ','Ⓠ'=>'ⓠ','Ⓡ'=>'ⓡ','Ⓢ'=>'ⓢ','Ⓣ'=>'ⓣ','Ⓤ'=>'ⓤ','Ⓥ'=>'ⓥ','Ⓦ'=>'ⓦ','Ⓧ'=>'ⓧ','Ⓨ'=>'ⓨ','Ⓩ'=>'ⓩ','Ⰰ'=>'ⰰ','Ⰱ'=>'ⰱ','Ⰲ'=>'ⰲ','Ⰳ'=>'ⰳ','Ⰴ'=>'ⰴ','Ⰵ'=>'ⰵ','Ⰶ'=>'ⰶ','Ⰷ'=>'ⰷ','Ⰸ'=>'ⰸ','Ⰹ'=>'ⰹ','Ⰺ'=>'ⰺ','Ⰻ'=>'ⰻ','Ⰼ'=>'ⰼ','Ⰽ'=>'ⰽ','Ⰾ'=>'ⰾ','Ⰿ'=>'ⰿ','Ⱀ'=>'ⱀ','Ⱁ'=>'ⱁ','Ⱂ'=>'ⱂ','Ⱃ'=>'ⱃ','Ⱄ'=>'ⱄ','Ⱅ'=>'ⱅ','Ⱆ'=>'ⱆ','Ⱇ'=>'ⱇ','Ⱈ'=>'ⱈ','Ⱉ'=>'ⱉ','Ⱊ'=>'ⱊ','Ⱋ'=>'ⱋ','Ⱌ'=>'ⱌ','Ⱍ'=>'ⱍ','Ⱎ'=>'ⱎ','Ⱏ'=>'ⱏ','Ⱐ'=>'ⱐ','Ⱑ'=>'ⱑ','Ⱒ'=>'ⱒ','Ⱓ'=>'ⱓ','Ⱔ'=>'ⱔ','Ⱕ'=>'ⱕ','Ⱖ'=>'ⱖ','Ⱗ'=>'ⱗ','Ⱘ'=>'ⱘ','Ⱙ'=>'ⱙ','Ⱚ'=>'ⱚ','Ⱛ'=>'ⱛ','Ⱜ'=>'ⱜ','Ⱝ'=>'ⱝ','Ⱞ'=>'ⱞ','Ⱡ'=>'ⱡ','Ɫ'=>'ɫ','Ᵽ'=>'ᵽ','Ɽ'=>'ɽ','Ⱨ'=>'ⱨ','Ⱪ'=>'ⱪ','Ⱬ'=>'ⱬ','Ⱶ'=>'ⱶ','Ⲁ'=>'ⲁ','Ⲃ'=>'ⲃ','Ⲅ'=>'ⲅ','Ⲇ'=>'ⲇ','Ⲉ'=>'ⲉ','Ⲋ'=>'ⲋ','Ⲍ'=>'ⲍ','Ⲏ'=>'ⲏ','Ⲑ'=>'ⲑ','Ⲓ'=>'ⲓ','Ⲕ'=>'ⲕ','Ⲗ'=>'ⲗ','Ⲙ'=>'ⲙ','Ⲛ'=>'ⲛ','Ⲝ'=>'ⲝ','Ⲟ'=>'ⲟ','Ⲡ'=>'ⲡ','Ⲣ'=>'ⲣ','Ⲥ'=>'ⲥ','Ⲧ'=>'ⲧ','Ⲩ'=>'ⲩ','Ⲫ'=>'ⲫ','Ⲭ'=>'ⲭ','Ⲯ'=>'ⲯ','Ⲱ'=>'ⲱ','Ⲳ'=>'ⲳ','Ⲵ'=>'ⲵ','Ⲷ'=>'ⲷ','Ⲹ'=>'ⲹ','Ⲻ'=>'ⲻ','Ⲽ'=>'ⲽ','Ⲿ'=>'ⲿ','Ⳁ'=>'ⳁ','Ⳃ'=>'ⳃ','Ⳅ'=>'ⳅ','Ⳇ'=>'ⳇ','Ⳉ'=>'ⳉ','Ⳋ'=>'ⳋ','Ⳍ'=>'ⳍ','Ⳏ'=>'ⳏ','Ⳑ'=>'ⳑ','Ⳓ'=>'ⳓ','Ⳕ'=>'ⳕ','Ⳗ'=>'ⳗ','Ⳙ'=>'ⳙ','Ⳛ'=>'ⳛ','Ⳝ'=>'ⳝ','Ⳟ'=>'ⳟ','Ⳡ'=>'ⳡ','Ⳣ'=>'ⳣ','A'=>'a','B'=>'b','C'=>'c','D'=>'d','E'=>'e','F'=>'f','G'=>'g','H'=>'h','I'=>'i','J'=>'j','K'=>'k','L'=>'l','M'=>'m','N'=>'n','O'=>'o','P'=>'p','Q'=>'q','R'=>'r','S'=>'s','T'=>'t','U'=>'u','V'=>'v','W'=>'w','X'=>'x','Y'=>'y','Z'=>'z','𐐀'=>'𐐨','𐐁'=>'𐐩','𐐂'=>'𐐪','𐐃'=>'𐐫','𐐄'=>'𐐬','𐐅'=>'𐐭','𐐆'=>'𐐮','𐐇'=>'𐐯','𐐈'=>'𐐰','𐐉'=>'𐐱','𐐊'=>'𐐲','𐐋'=>'𐐳','𐐌'=>'𐐴','𐐍'=>'𐐵','𐐎'=>'𐐶','𐐏'=>'𐐷','𐐐'=>'𐐸','𐐑'=>'𐐹','𐐒'=>'𐐺','𐐓'=>'𐐻','𐐔'=>'𐐼','𐐕'=>'𐐽','𐐖'=>'𐐾','𐐗'=>'𐐿','𐐘'=>'𐑀','𐐙'=>'𐑁','𐐚'=>'𐑂','𐐛'=>'𐑃','𐐜'=>'𐑄','𐐝'=>'𐑅','𐐞'=>'𐑆','𐐟'=>'𐑇','𐐠'=>'𐑈','𐐡'=>'𐑉','𐐢'=>'𐑊','𐐣'=>'𐑋','𐐤'=>'𐑌','𐐥'=>'𐑍','𐐦'=>'𐑎','𐐧'=>'𐑏'); \ No newline at end of file
+<?php return array('A'=>'a','B'=>'b','C'=>'c','D'=>'d','E'=>'e','F'=>'f','G'=>'g','H'=>'h','I'=>'i','J'=>'j','K'=>'k','L'=>'l','M'=>'m','N'=>'n','O'=>'o','P'=>'p','Q'=>'q','R'=>'r','S'=>'s','T'=>'t','U'=>'u','V'=>'v','W'=>'w','X'=>'x','Y'=>'y','Z'=>'z','µ'=>'μ','À'=>'à','Á'=>'á','Â'=>'â','Ã'=>'ã','Ä'=>'ä','Å'=>'å','Æ'=>'æ','Ç'=>'ç','È'=>'è','É'=>'é','Ê'=>'ê','Ë'=>'ë','Ì'=>'ì','Í'=>'í','Î'=>'î','Ï'=>'ï','Ð'=>'ð','Ñ'=>'ñ','Ò'=>'ò','Ó'=>'ó','Ô'=>'ô','Õ'=>'õ','Ö'=>'ö','Ø'=>'ø','Ù'=>'ù','Ú'=>'ú','Û'=>'û','Ü'=>'ü','Ý'=>'ý','Þ'=>'þ','Ā'=>'ā','Ă'=>'ă','Ą'=>'ą','Ć'=>'ć','Ĉ'=>'ĉ','Ċ'=>'ċ','Č'=>'č','Ď'=>'ď','Đ'=>'đ','Ē'=>'ē','Ĕ'=>'ĕ','Ė'=>'ė','Ę'=>'ę','Ě'=>'ě','Ĝ'=>'ĝ','Ğ'=>'ğ','Ġ'=>'ġ','Ģ'=>'ģ','Ĥ'=>'ĥ','Ħ'=>'ħ','Ĩ'=>'ĩ','Ī'=>'ī','Ĭ'=>'ĭ','Į'=>'į','IJ'=>'ij','Ĵ'=>'ĵ','Ķ'=>'ķ','Ĺ'=>'ĺ','Ļ'=>'ļ','Ľ'=>'ľ','Ŀ'=>'ŀ','Ł'=>'ł','Ń'=>'ń','Ņ'=>'ņ','Ň'=>'ň','Ŋ'=>'ŋ','Ō'=>'ō','Ŏ'=>'ŏ','Ő'=>'ő','Œ'=>'œ','Ŕ'=>'ŕ','Ŗ'=>'ŗ','Ř'=>'ř','Ś'=>'ś','Ŝ'=>'ŝ','Ş'=>'ş','Š'=>'š','Ţ'=>'ţ','Ť'=>'ť','Ŧ'=>'ŧ','Ũ'=>'ũ','Ū'=>'ū','Ŭ'=>'ŭ','Ů'=>'ů','Ű'=>'ű','Ų'=>'ų','Ŵ'=>'ŵ','Ŷ'=>'ŷ','Ÿ'=>'ÿ','Ź'=>'ź','Ż'=>'ż','Ž'=>'ž','ſ'=>'s','Ɓ'=>'ɓ','Ƃ'=>'ƃ','Ƅ'=>'ƅ','Ɔ'=>'ɔ','Ƈ'=>'ƈ','Ɖ'=>'ɖ','Ɗ'=>'ɗ','Ƌ'=>'ƌ','Ǝ'=>'ǝ','Ə'=>'ə','Ɛ'=>'ɛ','Ƒ'=>'ƒ','Ɠ'=>'ɠ','Ɣ'=>'ɣ','Ɩ'=>'ɩ','Ɨ'=>'ɨ','Ƙ'=>'ƙ','Ɯ'=>'ɯ','Ɲ'=>'ɲ','Ɵ'=>'ɵ','Ơ'=>'ơ','Ƣ'=>'ƣ','Ƥ'=>'ƥ','Ʀ'=>'ʀ','Ƨ'=>'ƨ','Ʃ'=>'ʃ','Ƭ'=>'ƭ','Ʈ'=>'ʈ','Ư'=>'ư','Ʊ'=>'ʊ','Ʋ'=>'ʋ','Ƴ'=>'ƴ','Ƶ'=>'ƶ','Ʒ'=>'ʒ','Ƹ'=>'ƹ','Ƽ'=>'ƽ','DŽ'=>'dž','Dž'=>'dž','LJ'=>'lj','Lj'=>'lj','NJ'=>'nj','Nj'=>'nj','Ǎ'=>'ǎ','Ǐ'=>'ǐ','Ǒ'=>'ǒ','Ǔ'=>'ǔ','Ǖ'=>'ǖ','Ǘ'=>'ǘ','Ǚ'=>'ǚ','Ǜ'=>'ǜ','Ǟ'=>'ǟ','Ǡ'=>'ǡ','Ǣ'=>'ǣ','Ǥ'=>'ǥ','Ǧ'=>'ǧ','Ǩ'=>'ǩ','Ǫ'=>'ǫ','Ǭ'=>'ǭ','Ǯ'=>'ǯ','DZ'=>'dz','Dz'=>'dz','Ǵ'=>'ǵ','Ƕ'=>'ƕ','Ƿ'=>'ƿ','Ǹ'=>'ǹ','Ǻ'=>'ǻ','Ǽ'=>'ǽ','Ǿ'=>'ǿ','Ȁ'=>'ȁ','Ȃ'=>'ȃ','Ȅ'=>'ȅ','Ȇ'=>'ȇ','Ȉ'=>'ȉ','Ȋ'=>'ȋ','Ȍ'=>'ȍ','Ȏ'=>'ȏ','Ȑ'=>'ȑ','Ȓ'=>'ȓ','Ȕ'=>'ȕ','Ȗ'=>'ȗ','Ș'=>'ș','Ț'=>'ț','Ȝ'=>'ȝ','Ȟ'=>'ȟ','Ƞ'=>'ƞ','Ȣ'=>'ȣ','Ȥ'=>'ȥ','Ȧ'=>'ȧ','Ȩ'=>'ȩ','Ȫ'=>'ȫ','Ȭ'=>'ȭ','Ȯ'=>'ȯ','Ȱ'=>'ȱ','Ȳ'=>'ȳ','Ⱥ'=>'ⱥ','Ȼ'=>'ȼ','Ƚ'=>'ƚ','Ⱦ'=>'ⱦ','Ɂ'=>'ɂ','Ƀ'=>'ƀ','Ʉ'=>'ʉ','Ʌ'=>'ʌ','Ɇ'=>'ɇ','Ɉ'=>'ɉ','Ɋ'=>'ɋ','Ɍ'=>'ɍ','Ɏ'=>'ɏ','ͅ'=>'ι','Ά'=>'ά','Έ'=>'έ','Ή'=>'ή','Ί'=>'ί','Ό'=>'ό','Ύ'=>'ύ','Ώ'=>'ώ','Α'=>'α','Β'=>'β','Γ'=>'γ','Δ'=>'δ','Ε'=>'ε','Ζ'=>'ζ','Η'=>'η','Θ'=>'θ','Ι'=>'ι','Κ'=>'κ','Λ'=>'λ','Μ'=>'μ','Ν'=>'ν','Ξ'=>'ξ','Ο'=>'ο','Π'=>'π','Ρ'=>'ρ','Σ'=>'σ','Τ'=>'τ','Υ'=>'υ','Φ'=>'φ','Χ'=>'χ','Ψ'=>'ψ','Ω'=>'ω','Ϊ'=>'ϊ','Ϋ'=>'ϋ','ς'=>'σ','ϐ'=>'β','ϑ'=>'θ','ϕ'=>'φ','ϖ'=>'π','Ϙ'=>'ϙ','Ϛ'=>'ϛ','Ϝ'=>'ϝ','Ϟ'=>'ϟ','Ϡ'=>'ϡ','Ϣ'=>'ϣ','Ϥ'=>'ϥ','Ϧ'=>'ϧ','Ϩ'=>'ϩ','Ϫ'=>'ϫ','Ϭ'=>'ϭ','Ϯ'=>'ϯ','ϰ'=>'κ','ϱ'=>'ρ','ϴ'=>'θ','ϵ'=>'ε','Ϸ'=>'ϸ','Ϲ'=>'ϲ','Ϻ'=>'ϻ','Ͻ'=>'ͻ','Ͼ'=>'ͼ','Ͽ'=>'ͽ','Ѐ'=>'ѐ','Ё'=>'ё','Ђ'=>'ђ','Ѓ'=>'ѓ','Є'=>'є','Ѕ'=>'ѕ','І'=>'і','Ї'=>'ї','Ј'=>'ј','Љ'=>'љ','Њ'=>'њ','Ћ'=>'ћ','Ќ'=>'ќ','Ѝ'=>'ѝ','Ў'=>'ў','Џ'=>'џ','А'=>'а','Б'=>'б','В'=>'в','Г'=>'г','Д'=>'д','Е'=>'е','Ж'=>'ж','З'=>'з','И'=>'и','Й'=>'й','К'=>'к','Л'=>'л','М'=>'м','Н'=>'н','О'=>'о','П'=>'п','Р'=>'р','С'=>'с','Т'=>'т','У'=>'у','Ф'=>'ф','Х'=>'х','Ц'=>'ц','Ч'=>'ч','Ш'=>'ш','Щ'=>'щ','Ъ'=>'ъ','Ы'=>'ы','Ь'=>'ь','Э'=>'э','Ю'=>'ю','Я'=>'я','Ѡ'=>'ѡ','Ѣ'=>'ѣ','Ѥ'=>'ѥ','Ѧ'=>'ѧ','Ѩ'=>'ѩ','Ѫ'=>'ѫ','Ѭ'=>'ѭ','Ѯ'=>'ѯ','Ѱ'=>'ѱ','Ѳ'=>'ѳ','Ѵ'=>'ѵ','Ѷ'=>'ѷ','Ѹ'=>'ѹ','Ѻ'=>'ѻ','Ѽ'=>'ѽ','Ѿ'=>'ѿ','Ҁ'=>'ҁ','Ҋ'=>'ҋ','Ҍ'=>'ҍ','Ҏ'=>'ҏ','Ґ'=>'ґ','Ғ'=>'ғ','Ҕ'=>'ҕ','Җ'=>'җ','Ҙ'=>'ҙ','Қ'=>'қ','Ҝ'=>'ҝ','Ҟ'=>'ҟ','Ҡ'=>'ҡ','Ң'=>'ң','Ҥ'=>'ҥ','Ҧ'=>'ҧ','Ҩ'=>'ҩ','Ҫ'=>'ҫ','Ҭ'=>'ҭ','Ү'=>'ү','Ұ'=>'ұ','Ҳ'=>'ҳ','Ҵ'=>'ҵ','Ҷ'=>'ҷ','Ҹ'=>'ҹ','Һ'=>'һ','Ҽ'=>'ҽ','Ҿ'=>'ҿ','Ӏ'=>'ӏ','Ӂ'=>'ӂ','Ӄ'=>'ӄ','Ӆ'=>'ӆ','Ӈ'=>'ӈ','Ӊ'=>'ӊ','Ӌ'=>'ӌ','Ӎ'=>'ӎ','Ӑ'=>'ӑ','Ӓ'=>'ӓ','Ӕ'=>'ӕ','Ӗ'=>'ӗ','Ә'=>'ә','Ӛ'=>'ӛ','Ӝ'=>'ӝ','Ӟ'=>'ӟ','Ӡ'=>'ӡ','Ӣ'=>'ӣ','Ӥ'=>'ӥ','Ӧ'=>'ӧ','Ө'=>'ө','Ӫ'=>'ӫ','Ӭ'=>'ӭ','Ӯ'=>'ӯ','Ӱ'=>'ӱ','Ӳ'=>'ӳ','Ӵ'=>'ӵ','Ӷ'=>'ӷ','Ӹ'=>'ӹ','Ӻ'=>'ӻ','Ӽ'=>'ӽ','Ӿ'=>'ӿ','Ԁ'=>'ԁ','Ԃ'=>'ԃ','Ԅ'=>'ԅ','Ԇ'=>'ԇ','Ԉ'=>'ԉ','Ԋ'=>'ԋ','Ԍ'=>'ԍ','Ԏ'=>'ԏ','Ԑ'=>'ԑ','Ԓ'=>'ԓ','Ա'=>'ա','Բ'=>'բ','Գ'=>'գ','Դ'=>'դ','Ե'=>'ե','Զ'=>'զ','Է'=>'է','Ը'=>'ը','Թ'=>'թ','Ժ'=>'ժ','Ի'=>'ի','Լ'=>'լ','Խ'=>'խ','Ծ'=>'ծ','Կ'=>'կ','Հ'=>'հ','Ձ'=>'ձ','Ղ'=>'ղ','Ճ'=>'ճ','Մ'=>'մ','Յ'=>'յ','Ն'=>'ն','Շ'=>'շ','Ո'=>'ո','Չ'=>'չ','Պ'=>'պ','Ջ'=>'ջ','Ռ'=>'ռ','Ս'=>'ս','Վ'=>'վ','Տ'=>'տ','Ր'=>'ր','Ց'=>'ց','Ւ'=>'ւ','Փ'=>'փ','Ք'=>'ք','Օ'=>'օ','Ֆ'=>'ֆ','Ⴀ'=>'ⴀ','Ⴁ'=>'ⴁ','Ⴂ'=>'ⴂ','Ⴃ'=>'ⴃ','Ⴄ'=>'ⴄ','Ⴅ'=>'ⴅ','Ⴆ'=>'ⴆ','Ⴇ'=>'ⴇ','Ⴈ'=>'ⴈ','Ⴉ'=>'ⴉ','Ⴊ'=>'ⴊ','Ⴋ'=>'ⴋ','Ⴌ'=>'ⴌ','Ⴍ'=>'ⴍ','Ⴎ'=>'ⴎ','Ⴏ'=>'ⴏ','Ⴐ'=>'ⴐ','Ⴑ'=>'ⴑ','Ⴒ'=>'ⴒ','Ⴓ'=>'ⴓ','Ⴔ'=>'ⴔ','Ⴕ'=>'ⴕ','Ⴖ'=>'ⴖ','Ⴗ'=>'ⴗ','Ⴘ'=>'ⴘ','Ⴙ'=>'ⴙ','Ⴚ'=>'ⴚ','Ⴛ'=>'ⴛ','Ⴜ'=>'ⴜ','Ⴝ'=>'ⴝ','Ⴞ'=>'ⴞ','Ⴟ'=>'ⴟ','Ⴠ'=>'ⴠ','Ⴡ'=>'ⴡ','Ⴢ'=>'ⴢ','Ⴣ'=>'ⴣ','Ⴤ'=>'ⴤ','Ⴥ'=>'ⴥ','Ḁ'=>'ḁ','Ḃ'=>'ḃ','Ḅ'=>'ḅ','Ḇ'=>'ḇ','Ḉ'=>'ḉ','Ḋ'=>'ḋ','Ḍ'=>'ḍ','Ḏ'=>'ḏ','Ḑ'=>'ḑ','Ḓ'=>'ḓ','Ḕ'=>'ḕ','Ḗ'=>'ḗ','Ḙ'=>'ḙ','Ḛ'=>'ḛ','Ḝ'=>'ḝ','Ḟ'=>'ḟ','Ḡ'=>'ḡ','Ḣ'=>'ḣ','Ḥ'=>'ḥ','Ḧ'=>'ḧ','Ḩ'=>'ḩ','Ḫ'=>'ḫ','Ḭ'=>'ḭ','Ḯ'=>'ḯ','Ḱ'=>'ḱ','Ḳ'=>'ḳ','Ḵ'=>'ḵ','Ḷ'=>'ḷ','Ḹ'=>'ḹ','Ḻ'=>'ḻ','Ḽ'=>'ḽ','Ḿ'=>'ḿ','Ṁ'=>'ṁ','Ṃ'=>'ṃ','Ṅ'=>'ṅ','Ṇ'=>'ṇ','Ṉ'=>'ṉ','Ṋ'=>'ṋ','Ṍ'=>'ṍ','Ṏ'=>'ṏ','Ṑ'=>'ṑ','Ṓ'=>'ṓ','Ṕ'=>'ṕ','Ṗ'=>'ṗ','Ṙ'=>'ṙ','Ṛ'=>'ṛ','Ṝ'=>'ṝ','Ṟ'=>'ṟ','Ṡ'=>'ṡ','Ṣ'=>'ṣ','Ṥ'=>'ṥ','Ṧ'=>'ṧ','Ṩ'=>'ṩ','Ṫ'=>'ṫ','Ṭ'=>'ṭ','Ṯ'=>'ṯ','Ṱ'=>'ṱ','Ṳ'=>'ṳ','Ṵ'=>'ṵ','Ṷ'=>'ṷ','Ṹ'=>'ṹ','Ṻ'=>'ṻ','Ṽ'=>'ṽ','Ṿ'=>'ṿ','Ẁ'=>'ẁ','Ẃ'=>'ẃ','Ẅ'=>'ẅ','Ẇ'=>'ẇ','Ẉ'=>'ẉ','Ẋ'=>'ẋ','Ẍ'=>'ẍ','Ẏ'=>'ẏ','Ẑ'=>'ẑ','Ẓ'=>'ẓ','Ẕ'=>'ẕ','ẛ'=>'ṡ','Ạ'=>'ạ','Ả'=>'ả','Ấ'=>'ấ','Ầ'=>'ầ','Ẩ'=>'ẩ','Ẫ'=>'ẫ','Ậ'=>'ậ','Ắ'=>'ắ','Ằ'=>'ằ','Ẳ'=>'ẳ','Ẵ'=>'ẵ','Ặ'=>'ặ','Ẹ'=>'ẹ','Ẻ'=>'ẻ','Ẽ'=>'ẽ','Ế'=>'ế','Ề'=>'ề','Ể'=>'ể','Ễ'=>'ễ','Ệ'=>'ệ','Ỉ'=>'ỉ','Ị'=>'ị','Ọ'=>'ọ','Ỏ'=>'ỏ','Ố'=>'ố','Ồ'=>'ồ','Ổ'=>'ổ','Ỗ'=>'ỗ','Ộ'=>'ộ','Ớ'=>'ớ','Ờ'=>'ờ','Ở'=>'ở','Ỡ'=>'ỡ','Ợ'=>'ợ','Ụ'=>'ụ','Ủ'=>'ủ','Ứ'=>'ứ','Ừ'=>'ừ','Ử'=>'ử','Ữ'=>'ữ','Ự'=>'ự','Ỳ'=>'ỳ','Ỵ'=>'ỵ','Ỷ'=>'ỷ','Ỹ'=>'ỹ','Ἀ'=>'ἀ','Ἁ'=>'ἁ','Ἂ'=>'ἂ','Ἃ'=>'ἃ','Ἄ'=>'ἄ','Ἅ'=>'ἅ','Ἆ'=>'ἆ','Ἇ'=>'ἇ','Ἐ'=>'ἐ','Ἑ'=>'ἑ','Ἒ'=>'ἒ','Ἓ'=>'ἓ','Ἔ'=>'ἔ','Ἕ'=>'ἕ','Ἠ'=>'ἠ','Ἡ'=>'ἡ','Ἢ'=>'ἢ','Ἣ'=>'ἣ','Ἤ'=>'ἤ','Ἥ'=>'ἥ','Ἦ'=>'ἦ','Ἧ'=>'ἧ','Ἰ'=>'ἰ','Ἱ'=>'ἱ','Ἲ'=>'ἲ','Ἳ'=>'ἳ','Ἴ'=>'ἴ','Ἵ'=>'ἵ','Ἶ'=>'ἶ','Ἷ'=>'ἷ','Ὀ'=>'ὀ','Ὁ'=>'ὁ','Ὂ'=>'ὂ','Ὃ'=>'ὃ','Ὄ'=>'ὄ','Ὅ'=>'ὅ','Ὑ'=>'ὑ','Ὓ'=>'ὓ','Ὕ'=>'ὕ','Ὗ'=>'ὗ','Ὠ'=>'ὠ','Ὡ'=>'ὡ','Ὢ'=>'ὢ','Ὣ'=>'ὣ','Ὤ'=>'ὤ','Ὥ'=>'ὥ','Ὦ'=>'ὦ','Ὧ'=>'ὧ','Ᾰ'=>'ᾰ','Ᾱ'=>'ᾱ','Ὰ'=>'ὰ','Ά'=>'ά','ι'=>'ι','Ὲ'=>'ὲ','Έ'=>'έ','Ὴ'=>'ὴ','Ή'=>'ή','Ῐ'=>'ῐ','Ῑ'=>'ῑ','Ὶ'=>'ὶ','Ί'=>'ί','Ῠ'=>'ῠ','Ῡ'=>'ῡ','Ὺ'=>'ὺ','Ύ'=>'ύ','Ῥ'=>'ῥ','Ὸ'=>'ὸ','Ό'=>'ό','Ὼ'=>'ὼ','Ώ'=>'ώ','Ω'=>'ω','K'=>'k','Å'=>'å','Ⅎ'=>'ⅎ','Ⅰ'=>'ⅰ','Ⅱ'=>'ⅱ','Ⅲ'=>'ⅲ','Ⅳ'=>'ⅳ','Ⅴ'=>'ⅴ','Ⅵ'=>'ⅵ','Ⅶ'=>'ⅶ','Ⅷ'=>'ⅷ','Ⅸ'=>'ⅸ','Ⅹ'=>'ⅹ','Ⅺ'=>'ⅺ','Ⅻ'=>'ⅻ','Ⅼ'=>'ⅼ','Ⅽ'=>'ⅽ','Ⅾ'=>'ⅾ','Ⅿ'=>'ⅿ','Ↄ'=>'ↄ','Ⓐ'=>'ⓐ','Ⓑ'=>'ⓑ','Ⓒ'=>'ⓒ','Ⓓ'=>'ⓓ','Ⓔ'=>'ⓔ','Ⓕ'=>'ⓕ','Ⓖ'=>'ⓖ','Ⓗ'=>'ⓗ','Ⓘ'=>'ⓘ','Ⓙ'=>'ⓙ','Ⓚ'=>'ⓚ','Ⓛ'=>'ⓛ','Ⓜ'=>'ⓜ','Ⓝ'=>'ⓝ','Ⓞ'=>'ⓞ','Ⓟ'=>'ⓟ','Ⓠ'=>'ⓠ','Ⓡ'=>'ⓡ','Ⓢ'=>'ⓢ','Ⓣ'=>'ⓣ','Ⓤ'=>'ⓤ','Ⓥ'=>'ⓥ','Ⓦ'=>'ⓦ','Ⓧ'=>'ⓧ','Ⓨ'=>'ⓨ','Ⓩ'=>'ⓩ','Ⰰ'=>'ⰰ','Ⰱ'=>'ⰱ','Ⰲ'=>'ⰲ','Ⰳ'=>'ⰳ','Ⰴ'=>'ⰴ','Ⰵ'=>'ⰵ','Ⰶ'=>'ⰶ','Ⰷ'=>'ⰷ','Ⰸ'=>'ⰸ','Ⰹ'=>'ⰹ','Ⰺ'=>'ⰺ','Ⰻ'=>'ⰻ','Ⰼ'=>'ⰼ','Ⰽ'=>'ⰽ','Ⰾ'=>'ⰾ','Ⰿ'=>'ⰿ','Ⱀ'=>'ⱀ','Ⱁ'=>'ⱁ','Ⱂ'=>'ⱂ','Ⱃ'=>'ⱃ','Ⱄ'=>'ⱄ','Ⱅ'=>'ⱅ','Ⱆ'=>'ⱆ','Ⱇ'=>'ⱇ','Ⱈ'=>'ⱈ','Ⱉ'=>'ⱉ','Ⱊ'=>'ⱊ','Ⱋ'=>'ⱋ','Ⱌ'=>'ⱌ','Ⱍ'=>'ⱍ','Ⱎ'=>'ⱎ','Ⱏ'=>'ⱏ','Ⱐ'=>'ⱐ','Ⱑ'=>'ⱑ','Ⱒ'=>'ⱒ','Ⱓ'=>'ⱓ','Ⱔ'=>'ⱔ','Ⱕ'=>'ⱕ','Ⱖ'=>'ⱖ','Ⱗ'=>'ⱗ','Ⱘ'=>'ⱘ','Ⱙ'=>'ⱙ','Ⱚ'=>'ⱚ','Ⱛ'=>'ⱛ','Ⱜ'=>'ⱜ','Ⱝ'=>'ⱝ','Ⱞ'=>'ⱞ','Ⱡ'=>'ⱡ','Ɫ'=>'ɫ','Ᵽ'=>'ᵽ','Ɽ'=>'ɽ','Ⱨ'=>'ⱨ','Ⱪ'=>'ⱪ','Ⱬ'=>'ⱬ','Ⱶ'=>'ⱶ','Ⲁ'=>'ⲁ','Ⲃ'=>'ⲃ','Ⲅ'=>'ⲅ','Ⲇ'=>'ⲇ','Ⲉ'=>'ⲉ','Ⲋ'=>'ⲋ','Ⲍ'=>'ⲍ','Ⲏ'=>'ⲏ','Ⲑ'=>'ⲑ','Ⲓ'=>'ⲓ','Ⲕ'=>'ⲕ','Ⲗ'=>'ⲗ','Ⲙ'=>'ⲙ','Ⲛ'=>'ⲛ','Ⲝ'=>'ⲝ','Ⲟ'=>'ⲟ','Ⲡ'=>'ⲡ','Ⲣ'=>'ⲣ','Ⲥ'=>'ⲥ','Ⲧ'=>'ⲧ','Ⲩ'=>'ⲩ','Ⲫ'=>'ⲫ','Ⲭ'=>'ⲭ','Ⲯ'=>'ⲯ','Ⲱ'=>'ⲱ','Ⲳ'=>'ⲳ','Ⲵ'=>'ⲵ','Ⲷ'=>'ⲷ','Ⲹ'=>'ⲹ','Ⲻ'=>'ⲻ','Ⲽ'=>'ⲽ','Ⲿ'=>'ⲿ','Ⳁ'=>'ⳁ','Ⳃ'=>'ⳃ','Ⳅ'=>'ⳅ','Ⳇ'=>'ⳇ','Ⳉ'=>'ⳉ','Ⳋ'=>'ⳋ','Ⳍ'=>'ⳍ','Ⳏ'=>'ⳏ','Ⳑ'=>'ⳑ','Ⳓ'=>'ⳓ','Ⳕ'=>'ⳕ','Ⳗ'=>'ⳗ','Ⳙ'=>'ⳙ','Ⳛ'=>'ⳛ','Ⳝ'=>'ⳝ','Ⳟ'=>'ⳟ','Ⳡ'=>'ⳡ','Ⳣ'=>'ⳣ','A'=>'a','B'=>'b','C'=>'c','D'=>'d','E'=>'e','F'=>'f','G'=>'g','H'=>'h','I'=>'i','J'=>'j','K'=>'k','L'=>'l','M'=>'m','N'=>'n','O'=>'o','P'=>'p','Q'=>'q','R'=>'r','S'=>'s','T'=>'t','U'=>'u','V'=>'v','W'=>'w','X'=>'x','Y'=>'y','Z'=>'z','𐐀'=>'𐐨','𐐁'=>'𐐩','𐐂'=>'𐐪','𐐃'=>'𐐫','𐐄'=>'𐐬','𐐅'=>'𐐭','𐐆'=>'𐐮','𐐇'=>'𐐯','𐐈'=>'𐐰','𐐉'=>'𐐱','𐐊'=>'𐐲','𐐋'=>'𐐳','𐐌'=>'𐐴','𐐍'=>'𐐵','𐐎'=>'𐐶','𐐏'=>'𐐷','𐐐'=>'𐐸','𐐑'=>'𐐹','𐐒'=>'𐐺','𐐓'=>'𐐻','𐐔'=>'𐐼','𐐕'=>'𐐽','𐐖'=>'𐐾','𐐗'=>'𐐿','𐐘'=>'𐑀','𐐙'=>'𐑁','𐐚'=>'𐑂','𐐛'=>'𐑃','𐐜'=>'𐑄','𐐝'=>'𐑅','𐐞'=>'𐑆','𐐟'=>'𐑇','𐐠'=>'𐑈','𐐡'=>'𐑉','𐐢'=>'𐑊','𐐣'=>'𐑋','𐐤'=>'𐑌','𐐥'=>'𐑍','𐐦'=>'𐑎','𐐧'=>'𐑏');
diff --git a/phpBB/includes/utf/data/case_fold_f.php b/phpBB/includes/utf/data/case_fold_f.php
index 7e2ffb25ec..5f2d88ec92 100644
--- a/phpBB/includes/utf/data/case_fold_f.php
+++ b/phpBB/includes/utf/data/case_fold_f.php
@@ -1 +1 @@
-<?php return array('ß'=>'ss','İ'=>'i̇','ʼn'=>'ʼn','ǰ'=>'ǰ','ΐ'=>'ΐ','ΰ'=>'ΰ','և'=>'եւ','ẖ'=>'ẖ','ẗ'=>'ẗ','ẘ'=>'ẘ','ẙ'=>'ẙ','ẚ'=>'aʾ','ὐ'=>'ὐ','ὒ'=>'ὒ','ὔ'=>'ὔ','ὖ'=>'ὖ','ᾀ'=>'ἀι','ᾁ'=>'ἁι','ᾂ'=>'ἂι','ᾃ'=>'ἃι','ᾄ'=>'ἄι','ᾅ'=>'ἅι','ᾆ'=>'ἆι','ᾇ'=>'ἇι','ᾈ'=>'ἀι','ᾉ'=>'ἁι','ᾊ'=>'ἂι','ᾋ'=>'ἃι','ᾌ'=>'ἄι','ᾍ'=>'ἅι','ᾎ'=>'ἆι','ᾏ'=>'ἇι','ᾐ'=>'ἠι','ᾑ'=>'ἡι','ᾒ'=>'ἢι','ᾓ'=>'ἣι','ᾔ'=>'ἤι','ᾕ'=>'ἥι','ᾖ'=>'ἦι','ᾗ'=>'ἧι','ᾘ'=>'ἠι','ᾙ'=>'ἡι','ᾚ'=>'ἢι','ᾛ'=>'ἣι','ᾜ'=>'ἤι','ᾝ'=>'ἥι','ᾞ'=>'ἦι','ᾟ'=>'ἧι','ᾠ'=>'ὠι','ᾡ'=>'ὡι','ᾢ'=>'ὢι','ᾣ'=>'ὣι','ᾤ'=>'ὤι','ᾥ'=>'ὥι','ᾦ'=>'ὦι','ᾧ'=>'ὧι','ᾨ'=>'ὠι','ᾩ'=>'ὡι','ᾪ'=>'ὢι','ᾫ'=>'ὣι','ᾬ'=>'ὤι','ᾭ'=>'ὥι','ᾮ'=>'ὦι','ᾯ'=>'ὧι','ᾲ'=>'ὰι','ᾳ'=>'αι','ᾴ'=>'άι','ᾶ'=>'ᾶ','ᾷ'=>'ᾶι','ᾼ'=>'αι','ῂ'=>'ὴι','ῃ'=>'ηι','ῄ'=>'ήι','ῆ'=>'ῆ','ῇ'=>'ῆι','ῌ'=>'ηι','ῒ'=>'ῒ','ΐ'=>'ΐ','ῖ'=>'ῖ','ῗ'=>'ῗ','ῢ'=>'ῢ','ΰ'=>'ΰ','ῤ'=>'ῤ','ῦ'=>'ῦ','ῧ'=>'ῧ','ῲ'=>'ὼι','ῳ'=>'ωι','ῴ'=>'ώι','ῶ'=>'ῶ','ῷ'=>'ῶι','ῼ'=>'ωι','ff'=>'ff','fi'=>'fi','fl'=>'fl','ffi'=>'ffi','ffl'=>'ffl','ſt'=>'st','st'=>'st','ﬓ'=>'մն','ﬔ'=>'մե','ﬕ'=>'մի','ﬖ'=>'վն','ﬗ'=>'մխ'); \ No newline at end of file
+<?php return array('ß'=>'ss','İ'=>'i̇','ʼn'=>'ʼn','ǰ'=>'ǰ','ΐ'=>'ΐ','ΰ'=>'ΰ','և'=>'եւ','ẖ'=>'ẖ','ẗ'=>'ẗ','ẘ'=>'ẘ','ẙ'=>'ẙ','ẚ'=>'aʾ','ὐ'=>'ὐ','ὒ'=>'ὒ','ὔ'=>'ὔ','ὖ'=>'ὖ','ᾀ'=>'ἀι','ᾁ'=>'ἁι','ᾂ'=>'ἂι','ᾃ'=>'ἃι','ᾄ'=>'ἄι','ᾅ'=>'ἅι','ᾆ'=>'ἆι','ᾇ'=>'ἇι','ᾈ'=>'ἀι','ᾉ'=>'ἁι','ᾊ'=>'ἂι','ᾋ'=>'ἃι','ᾌ'=>'ἄι','ᾍ'=>'ἅι','ᾎ'=>'ἆι','ᾏ'=>'ἇι','ᾐ'=>'ἠι','ᾑ'=>'ἡι','ᾒ'=>'ἢι','ᾓ'=>'ἣι','ᾔ'=>'ἤι','ᾕ'=>'ἥι','ᾖ'=>'ἦι','ᾗ'=>'ἧι','ᾘ'=>'ἠι','ᾙ'=>'ἡι','ᾚ'=>'ἢι','ᾛ'=>'ἣι','ᾜ'=>'ἤι','ᾝ'=>'ἥι','ᾞ'=>'ἦι','ᾟ'=>'ἧι','ᾠ'=>'ὠι','ᾡ'=>'ὡι','ᾢ'=>'ὢι','ᾣ'=>'ὣι','ᾤ'=>'ὤι','ᾥ'=>'ὥι','ᾦ'=>'ὦι','ᾧ'=>'ὧι','ᾨ'=>'ὠι','ᾩ'=>'ὡι','ᾪ'=>'ὢι','ᾫ'=>'ὣι','ᾬ'=>'ὤι','ᾭ'=>'ὥι','ᾮ'=>'ὦι','ᾯ'=>'ὧι','ᾲ'=>'ὰι','ᾳ'=>'αι','ᾴ'=>'άι','ᾶ'=>'ᾶ','ᾷ'=>'ᾶι','ᾼ'=>'αι','ῂ'=>'ὴι','ῃ'=>'ηι','ῄ'=>'ήι','ῆ'=>'ῆ','ῇ'=>'ῆι','ῌ'=>'ηι','ῒ'=>'ῒ','ΐ'=>'ΐ','ῖ'=>'ῖ','ῗ'=>'ῗ','ῢ'=>'ῢ','ΰ'=>'ΰ','ῤ'=>'ῤ','ῦ'=>'ῦ','ῧ'=>'ῧ','ῲ'=>'ὼι','ῳ'=>'ωι','ῴ'=>'ώι','ῶ'=>'ῶ','ῷ'=>'ῶι','ῼ'=>'ωι','ff'=>'ff','fi'=>'fi','fl'=>'fl','ffi'=>'ffi','ffl'=>'ffl','ſt'=>'st','st'=>'st','ﬓ'=>'մն','ﬔ'=>'մե','ﬕ'=>'մի','ﬖ'=>'վն','ﬗ'=>'մխ');
diff --git a/phpBB/includes/utf/data/case_fold_s.php b/phpBB/includes/utf/data/case_fold_s.php
index 5f09ffa1dd..4ee5d8dc69 100644
--- a/phpBB/includes/utf/data/case_fold_s.php
+++ b/phpBB/includes/utf/data/case_fold_s.php
@@ -1 +1 @@
-<?php return array('ᾈ'=>'ᾀ','ᾉ'=>'ᾁ','ᾊ'=>'ᾂ','ᾋ'=>'ᾃ','ᾌ'=>'ᾄ','ᾍ'=>'ᾅ','ᾎ'=>'ᾆ','ᾏ'=>'ᾇ','ᾘ'=>'ᾐ','ᾙ'=>'ᾑ','ᾚ'=>'ᾒ','ᾛ'=>'ᾓ','ᾜ'=>'ᾔ','ᾝ'=>'ᾕ','ᾞ'=>'ᾖ','ᾟ'=>'ᾗ','ᾨ'=>'ᾠ','ᾩ'=>'ᾡ','ᾪ'=>'ᾢ','ᾫ'=>'ᾣ','ᾬ'=>'ᾤ','ᾭ'=>'ᾥ','ᾮ'=>'ᾦ','ᾯ'=>'ᾧ','ᾼ'=>'ᾳ','ῌ'=>'ῃ','ῼ'=>'ῳ'); \ No newline at end of file
+<?php return array('ᾈ'=>'ᾀ','ᾉ'=>'ᾁ','ᾊ'=>'ᾂ','ᾋ'=>'ᾃ','ᾌ'=>'ᾄ','ᾍ'=>'ᾅ','ᾎ'=>'ᾆ','ᾏ'=>'ᾇ','ᾘ'=>'ᾐ','ᾙ'=>'ᾑ','ᾚ'=>'ᾒ','ᾛ'=>'ᾓ','ᾜ'=>'ᾔ','ᾝ'=>'ᾕ','ᾞ'=>'ᾖ','ᾟ'=>'ᾗ','ᾨ'=>'ᾠ','ᾩ'=>'ᾡ','ᾪ'=>'ᾢ','ᾫ'=>'ᾣ','ᾬ'=>'ᾤ','ᾭ'=>'ᾥ','ᾮ'=>'ᾦ','ᾯ'=>'ᾧ','ᾼ'=>'ᾳ','ῌ'=>'ῃ','ῼ'=>'ῳ');
diff --git a/phpBB/includes/utf/data/confusables.php b/phpBB/includes/utf/data/confusables.php
index 7564978a26..767d242948 100644
--- a/phpBB/includes/utf/data/confusables.php
+++ b/phpBB/includes/utf/data/confusables.php
@@ -1 +1 @@
-<?php return array('¡'=>'i','ǃ'=>'!','α'=>'a',' '=>' ','­'=>'','۝'=>'','܏'=>'','᠆'=>'','᠎'=>'','​'=>'','‌'=>'','‍'=>'','
'=>'','
'=>'','⁠'=>'','⁡'=>'','⁢'=>'','⁣'=>'',''=>'',''=>'',''=>'',''=>'',''=>'',''=>'',''=>'',''=>'',''=>'',''=>'',''=>'','𝅳'=>'','𝅴'=>'','𝅵'=>'','𝅶'=>'','𝅷'=>'','𝅸'=>'','𝅹'=>'','𝅺'=>'','۬'=>'۟','̓'=>'̓','ُ'=>'̓','֜'=>'́','́'=>'́','݇'=>'́','॔'=>'́','̀'=>'̀','॓'=>'̀','̌'=>'̆','̑'=>'̂','֯'=>'̊','ஂ'=>'̊','ํ'=>'̊','ໍ'=>'̊','ံ'=>'̊','ំ'=>'̊','៓'=>'̊','゚'=>'̊','゚'=>'̊','ͦ'=>'̊','͂'=>'̃','ׄ'=>'̇','ֹ'=>'̇','ׂ'=>'̇','ׁ'=>'̇','݁'=>'̇','ं'=>'̇','ਂ'=>'̇','ં'=>'̇','்'=>'̇','̅'=>'̄','〬'=>'̉','̱'=>'̠','॒'=>'̠','̧'=>'̡','̦'=>'̡','̨'=>'̢','़'=>'̣','়'=>'̣','਼'=>'̣','઼'=>'̣','଼'=>'̣','͇'=>'̳','̶'=>'̵','ﱞ'=>'ﹲّ','ﱟ'=>'ﹴّ','ﳲ'=>'ﹷّ','ﱠ'=>'ﹶّ','ﳳ'=>'ﹹّ','ﱡ'=>'ﹸّ','ﳴ'=>'ﹻّ','ﱢ'=>'ﹺّ','ﱣ'=>'ﹼٰ','ٴ'=>'ٔ','݂'=>'ܼ','౦'=>'o','೦'=>'o','゙'=>'゙',' '=>' ',' '=>' ',' '=>' ',' '=>' ',' '=>' ',' '=>' ',' '=>' ',' '=>' ',' '=>' ',' '=>' ',' '=>' ',' '=>' ',' '=>' ',' '=>' ',' '=>' ','`'=>'`','`'=>'`','῀'=>'˜','^'=>'^','︿'=>'^','_'=>'_','﹍'=>'_','﹎'=>'_','﹏'=>'_','⌇'=>'︴','-'=>'-','‐'=>'-','‑'=>'-','‒'=>'-','–'=>'-','﹘'=>'-','∼'=>'⁓','・'=>'・','•'=>'・',','=>',','‚'=>',','٬'=>'،','、'=>'、',';'=>';',';'=>';',':'=>':','։'=>':','︰'=>':','׃'=>':','⩴'=>'::=','.'=>'.','․'=>'.','܂'=>'.','‥'=>'..','…'=>'...','。'=>'。','·'=>'·','‧'=>'·','∙'=>'·','⋅'=>'·','ᐧ'=>'·','ᔯ'=>'·4','ᐌ'=>'·ᐁ','ᐎ'=>'·ᐃ','ᐐ'=>'·ᐄ','ᐒ'=>'·ᐅ','ᐔ'=>'·ᐆ','ᐗ'=>'·ᐊ','ᐙ'=>'·ᐋ','ᐷ'=>'·ᐳ','ᑀ'=>'·ᐳ','ᑂ'=>'·ᐴ','ᑄ'=>'·ᐸ','ᑆ'=>'·ᐹ','ᑗ'=>'·ᑌ','ᑙ'=>'·ᑎ','ᑛ'=>'·ᑏ','ᑔ'=>'·ᑐ','ᑝ'=>'·ᑐ','ᑟ'=>'·ᑑ','ᑡ'=>'·ᑕ','ᑣ'=>'·ᑖ','ᑴ'=>'·ᑫ','ᑸ'=>'·ᑮ','ᑼ'=>'·ᑰ','ᑾ'=>'·ᑲ','ᒀ'=>'·ᑳ','ᒒ'=>'·ᒉ','ᒔ'=>'·ᒋ','ᒖ'=>'·ᒌ','ᒚ'=>'·ᒎ','ᒜ'=>'·ᒐ','ᒞ'=>'·ᒑ','ᒬ'=>'·ᒣ','ᒮ'=>'·ᒥ','ᒰ'=>'·ᒦ','ᒲ'=>'·ᒧ','ᒴ'=>'·ᒨ','ᒶ'=>'·L','ᒸ'=>'·ᒫ','ᓉ'=>'·ᓀ','ᓋ'=>'·ᓇ','ᓍ'=>'·ᓈ','ᓜ'=>'·ᓓ','ᓞ'=>'·ᓕ','ᓠ'=>'·ᓖ','ᓢ'=>'·ᓗ','ᓤ'=>'·ᓘ','ᓦ'=>'·ᓚ','ᓨ'=>'·ᓛ','ᓶ'=>'·ᓭ','ᓸ'=>'·ᓯ','ᓺ'=>'·ᓰ','ᓼ'=>'·ᓱ','ᓾ'=>'·ᓲ','ᔀ'=>'·ᓴ','ᔂ'=>'·ᓵ','ᔗ'=>'·ᔐ','ᔙ'=>'·ᔑ','ᔛ'=>'·ᔒ','ᔝ'=>'·ᔓ','ᔟ'=>'·ᔔ','ᔡ'=>'·ᔕ','ᔣ'=>'·ᔖ','ᔱ'=>'·ᔨ','ᔳ'=>'·ᔩ','ᔵ'=>'·ᔪ','ᔷ'=>'·ᔫ','ᔹ'=>'·ᔭ','ᔻ'=>'·ᔮ','ᕎ'=>'·ᕌ','ᕛ'=>'·ᕚ','ᕨ'=>'·ᕧ','('=>'(','⑴'=>'(1)','⒧'=>'(l)','⑽'=>'(10)','⑾'=>'(11)','⑿'=>'(12)','⒀'=>'(13)','⒁'=>'(14)','⒂'=>'(15)','⒃'=>'(16)','⒄'=>'(17)','⒅'=>'(18)','⒆'=>'(19)','⑵'=>'(2)','⒇'=>'(20)','⑶'=>'(3)','⑷'=>'(4)','⑸'=>'(5)','⑹'=>'(6)','⑺'=>'(7)','⑻'=>'(8)','⑼'=>'(9)','⒜'=>'(a)','⒝'=>'(b)','⒞'=>'(c)','⒟'=>'(d)','⒠'=>'(e)','⒡'=>'(f)','⒢'=>'(g)','⒣'=>'(h)','⒤'=>'(i)','⒥'=>'(j)','⒦'=>'(k)','⒨'=>'(m)','⒩'=>'(n)','⒪'=>'(o)','⒫'=>'(p)','⒬'=>'(q)','⒭'=>'(r)','⒮'=>'(s)','⒯'=>'(t)','⒰'=>'(u)','⒱'=>'(v)','⒲'=>'(w)','⒳'=>'(x)','⒴'=>'(y)','⒵'=>'(z)','㈀'=>'(ᄀ)','㈎'=>'(가)','㈁'=>'(ᄂ)','㈏'=>'(나)','㈂'=>'(ᄃ)','㈐'=>'(다)','㈃'=>'(ᄅ)','㈑'=>'(라)','㈄'=>'(ᄆ)','㈒'=>'(마)','㈅'=>'(ᄇ)','㈓'=>'(바)','㈆'=>'(ᄉ)','㈔'=>'(사)','㈇'=>'(ᄋ)','㈕'=>'(아)','㈝'=>'(오전)','㈞'=>'(오후)','㈈'=>'(ᄌ)','㈖'=>'(자)','㈜'=>'(주)','㈉'=>'(ᄎ)','㈗'=>'(차)','㈊'=>'(ᄏ)','㈘'=>'(카)','㈋'=>'(ᄐ)','㈙'=>'(타)','㈌'=>'(ᄑ)','㈚'=>'(파)','㈍'=>'(ᄒ)','㈛'=>'(하)','㈠'=>'(一)','㈦'=>'(七)','㈢'=>'(三)','㈨'=>'(九)','㈡'=>'(二)','㈤'=>'(五)','㈹'=>'(代)','㈽'=>'(企)','㉁'=>'(休)','㈧'=>'(八)','㈥'=>'(六)','㈸'=>'(労)','㈩'=>'(十)','㈿'=>'(協)','㈴'=>'(名)','㈺'=>'(呼)','㈣'=>'(四)','㈯'=>'(土)','㈻'=>'(学)','㈰'=>'(日)','㈪'=>'(月)','㈲'=>'(有)','㈭'=>'(木)','㈱'=>'(株)','㈬'=>'(水)','㈫'=>'(火)','㈵'=>'(特)','㈼'=>'(監)','㈳'=>'(社)','㈷'=>'(祝)','㉀'=>'(祭)','㉂'=>'(自)','㉃'=>'(至)','㈶'=>'(財)','㈾'=>'(資)','㈮'=>'(金)',')'=>')','['=>'[','〔'=>'[',']'=>']','〕'=>']','{'=>'{','}'=>'}','⦅'=>'⦅','⦆'=>'⦆','「'=>'「','」'=>'」','@'=>'@','*'=>'*','/'=>'/','⁄'=>'/','∕'=>'/','\'=>'\\','&'=>'&','#'=>'#','%'=>'%','‶'=>'‵‵','‷'=>'‵‵‵','༌'=>'་','´'=>'ʹ','΄'=>'ʹ','´'=>'ʹ','\''=>'ʹ','''=>'ʹ','′'=>'ʹ','׳'=>'ʹ','ʹ'=>'ʹ','ˊ'=>'ʹ','"'=>'ʹʹ','"'=>'ʹʹ','″'=>'ʹʹ','〃'=>'ʹʹ','״'=>'ʹʹ','ʺ'=>'ʹʹ','‴'=>'ʹʹʹ','⁗'=>'ʹʹʹʹ','¯'=>'ˉ',' ̄'=>'ˉ','‾'=>'ˉ','﹉'=>'ˉ','﹊'=>'ˉ','﹋'=>'ˉ','﹌'=>'ˉ','˚'=>'°','௵'=>'௳','←'=>'←','→'=>'→','↑'=>'↑','↓'=>'↓','↵'=>'↲','⨡'=>'↾','𝛛'=>'∂','𝜕'=>'∂','𝝏'=>'∂','𝞉'=>'∂','𝟃'=>'∂','𝛁'=>'∇','𝛻'=>'∇','𝜵'=>'∇','𝝯'=>'∇','𝞩'=>'∇','+'=>'+','﬩'=>'+','‹'=>'<','<'=>'<','='=>'=','⩵'=>'==','⩶'=>'===','›'=>'>','>'=>'>','¬'=>'¬','¦'=>'¦','〜'=>'~','~'=>'~','﹨'=>'∖','⋀'=>'∧','⋁'=>'∨','⋂'=>'∩','⋃'=>'∪','∯'=>'∮∮','∰'=>'∮∮∮','≣'=>'≡','♁'=>'⊕','☉'=>'⊙','⟂'=>'⊥','▷'=>'⊲','⨝'=>'⋈','⨽'=>'⌙','☸'=>'⎈','⎮'=>'⎥','│'=>'│','▐'=>'▌','■'=>'■','☐'=>'□','○'=>'○','⦾'=>'◎','〛'=>'⟧','〈'=>'⟨','〈'=>'⟨','〉'=>'⟩','〉'=>'⟩','⧙'=>'⦚','〶'=>'〒','ー'=>'ー','¢'=>'¢','$'=>'$','£'=>'£','¥'=>'Y̵','₩'=>'W̵','0'=>'0','𝟎'=>'0','𝟘'=>'0','𝟢'=>'0','𝟬'=>'0','𝟶'=>'0','০'=>'0','୦'=>'0','௦'=>'0','᠐'=>'0','〇'=>'0','𝐎'=>'0','𝑂'=>'0','𝑶'=>'0','𝒪'=>'0','𝓞'=>'0','𝔒'=>'0','𝕆'=>'0','𝕺'=>'0','𝖮'=>'0','𝗢'=>'0','𝘖'=>'0','𝙊'=>'0','𝙾'=>'0','𝚶'=>'0','𝛰'=>'0','𝜪'=>'0','𝝤'=>'0','𝞞'=>'0','ⵔ'=>'0','ഠ'=>'0','⊖'=>'0̵','𝚯'=>'0̵','𝚹'=>'0̵','𝛩'=>'0̵','𝛳'=>'0̵','𝜣'=>'0̵','𝜭'=>'0̵','𝝝'=>'0̵','𝝧'=>'0̵','𝞗'=>'0̵','𝞡'=>'0̵','ⴱ'=>'0̵','Ꮎ'=>'0̵','۰'=>'٠','᭜'=>'᭐','㍘'=>'0点','1'=>'1','𝟏'=>'1','𝟙'=>'1','𝟣'=>'1','𝟭'=>'1','𝟷'=>'1','ℐ'=>'1','ℑ'=>'1','𝐈'=>'1','𝐼'=>'1','𝑰'=>'1','𝓘'=>'1','𝕀'=>'1','𝕴'=>'1','𝖨'=>'1','𝗜'=>'1','𝘐'=>'1','𝙄'=>'1','𝙸'=>'1','l'=>'l','l'=>'l','ⅼ'=>'1','ℓ'=>'l','𝐥'=>'l','𝑙'=>'l','𝒍'=>'l','𝓁'=>'l','𝓵'=>'l','𝔩'=>'l','𝕝'=>'l','𝖑'=>'l','𝗅'=>'l','𝗹'=>'l','𝘭'=>'l','𝙡'=>'l','𝚕'=>'l','𝚰'=>'l','𝛪'=>'l','𝜤'=>'l','𝝞'=>'l','𝞘'=>'l','①'=>'➀','ɭ'=>'l̢','ɫ'=>'l̴','ƚ'=>'l̵','ł'=>'l̷','۱'=>'١','⒈'=>'1.','ŀ'=>'l·','ᒷ'=>'1·','⑩'=>'➉','⒑'=>'10.','㏩'=>'10日','㋉'=>'10月','㍢'=>'10点','⒒'=>'11.','㏪'=>'11日','㋊'=>'11月','㍣'=>'11点','⒓'=>'12.','㏫'=>'12日','㋋'=>'12月','㍤'=>'12点','⒔'=>'13.','㏬'=>'13日','㍥'=>'13点','⒕'=>'14.','㏭'=>'14日','㍦'=>'14点','⒖'=>'15.','㏮'=>'15日','㍧'=>'15点','⒗'=>'16.','㏯'=>'16日','㍨'=>'16点','⒘'=>'17.','㏰'=>'17日','㍩'=>'17点','⒙'=>'18.','㏱'=>'18日','㍪'=>'18点','⒚'=>'19.','㏲'=>'19日','㍫'=>'19点','lj'=>'lj','㏠'=>'1日','㋀'=>'1月','㍙'=>'1点','2'=>'2','𝟐'=>'2','𝟚'=>'2','𝟤'=>'2','𝟮'=>'2','𝟸'=>'2','ᒿ'=>'2','②'=>'➁','۲'=>'٢','⒉'=>'2.','⒛'=>'20.','㏳'=>'20日','㍬'=>'20点','㏴'=>'21日','㍭'=>'21点','㏵'=>'22日','㍮'=>'22点','㏶'=>'23日','㍯'=>'23点','㏷'=>'24日','㍰'=>'24点','㏸'=>'25日','㏹'=>'26日','㏺'=>'27日','㏻'=>'28日','㏼'=>'29日','㏡'=>'2日','㋁'=>'2月','㍚'=>'2点','3'=>'3','𝟑'=>'3','𝟛'=>'3','𝟥'=>'3','𝟯'=>'3','𝟹'=>'3','③'=>'➂','۳'=>'٣','⒊'=>'3.','㏽'=>'30日','㏾'=>'31日','㏢'=>'3日','㋂'=>'3月','㍛'=>'3点','4'=>'4','𝟒'=>'4','𝟜'=>'4','𝟦'=>'4','𝟰'=>'4','𝟺'=>'4','Ꮞ'=>'4','④'=>'➃','⒋'=>'4.','ᔰ'=>'4·','㏣'=>'4日','㋃'=>'4月','㍜'=>'4点','5'=>'5','𝟓'=>'5','𝟝'=>'5','𝟧'=>'5','𝟱'=>'5','𝟻'=>'5','⑤'=>'➄','⒌'=>'5.','㏤'=>'5日','㋄'=>'5月','㍝'=>'5点','6'=>'6','𝟔'=>'6','𝟞'=>'6','𝟨'=>'6','𝟲'=>'6','𝟼'=>'6','б'=>'6','⑥'=>'➅','⒍'=>'6.','㏥'=>'6日','㋅'=>'6月','㍞'=>'6点','7'=>'7','𝟕'=>'7','𝟟'=>'7','𝟩'=>'7','𝟳'=>'7','𝟽'=>'7','⑦'=>'➆','۷'=>'٧','⒎'=>'7.','㏦'=>'7日','㋆'=>'7月','㍟'=>'7点','ଃ'=>'8','৪'=>'8','੪'=>'8','8'=>'8','𝟖'=>'8','𝟠'=>'8','𝟪'=>'8','𝟴'=>'8','𝟾'=>'8','ȣ'=>'8','⑧'=>'➇','۸'=>'٨','⒏'=>'8.','㏧'=>'8日','㋇'=>'8月','㍠'=>'8点','੧'=>'9','୨'=>'9','৭'=>'9','9'=>'9','𝟗'=>'9','𝟡'=>'9','𝟫'=>'9','𝟵'=>'9','𝟿'=>'9','⑨'=>'➈','۹'=>'٩','⒐'=>'9.','㏨'=>'9日','㋈'=>'9月','㍡'=>'9点','a'=>'a','𝐚'=>'a','𝑎'=>'a','𝒂'=>'a','𝒶'=>'a','𝓪'=>'a','𝔞'=>'a','𝕒'=>'a','𝖆'=>'a','𝖺'=>'a','𝗮'=>'a','𝘢'=>'a','𝙖'=>'a','𝚊'=>'a','℀'=>'a/c','℁'=>'a/s','æ'=>'ae','b'=>'b','𝐛'=>'b','𝑏'=>'b','𝒃'=>'b','𝒷'=>'b','𝓫'=>'b','𝔟'=>'b','𝕓'=>'b','𝖇'=>'b','𝖻'=>'b','𝗯'=>'b','𝘣'=>'b','𝙗'=>'b','𝚋'=>'b','ɓ'=>'b̔','ƃ'=>'b̄','ƀ'=>'b̵','c'=>'c','ⅽ'=>'c','𝐜'=>'c','𝑐'=>'c','𝒄'=>'c','𝒸'=>'c','𝓬'=>'c','𝔠'=>'c','𝕔'=>'c','𝖈'=>'c','𝖼'=>'c','𝗰'=>'c','𝘤'=>'c','𝙘'=>'c','𝚌'=>'c','𝛓'=>'c','𝜍'=>'c','𝝇'=>'c','𝞁'=>'c','𝞻'=>'c','℅'=>'c/o','℆'=>'c/u','d'=>'d','ⅾ'=>'d','ⅆ'=>'d','𝐝'=>'d','𝑑'=>'d','𝒅'=>'d','𝒹'=>'d','𝓭'=>'d','𝔡'=>'d','𝕕'=>'d','𝖉'=>'d','𝖽'=>'d','𝗱'=>'d','𝘥'=>'d','𝙙'=>'d','𝚍'=>'d','ɗ'=>'d̔','ƌ'=>'d̄','ɖ'=>'d̢','đ'=>'d̵','dz'=>'dz','dž'=>'dž','e'=>'e','ℯ'=>'e','ⅇ'=>'e','𝐞'=>'e','𝑒'=>'e','𝒆'=>'e','𝓮'=>'e','𝔢'=>'e','𝕖'=>'e','𝖊'=>'e','𝖾'=>'e','𝗲'=>'e','𝘦'=>'e','𝙚'=>'e','𝚎'=>'e','ⴹ'=>'E','ə'=>'ǝ','ɚ'=>'ǝ˞','⋴'=>'ɛ','𝛆'=>'ɛ','𝛜'=>'ɛ','𝜀'=>'ɛ','𝜖'=>'ɛ','𝜺'=>'ɛ','𝝐'=>'ɛ','𝝴'=>'ɛ','𝞊'=>'ɛ','𝞮'=>'ɛ','𝟄'=>'ɛ','f'=>'f','𝐟'=>'f','𝑓'=>'f','𝒇'=>'f','𝒻'=>'f','𝓯'=>'f','𝔣'=>'f','𝕗'=>'f','𝖋'=>'f','𝖿'=>'f','𝗳'=>'f','𝘧'=>'f','𝙛'=>'f','𝚏'=>'f','ƒ'=>'f̡','g'=>'g','ℊ'=>'g','𝐠'=>'g','𝑔'=>'g','𝒈'=>'g','𝓰'=>'g','𝔤'=>'g','𝕘'=>'g','𝖌'=>'g','𝗀'=>'g','𝗴'=>'g','𝘨'=>'g','𝙜'=>'g','𝚐'=>'g','ɡ'=>'g','ɠ'=>'g̔','ǥ'=>'g̵','h'=>'h','ℎ'=>'h','𝐡'=>'h','𝒉'=>'h','𝒽'=>'h','𝓱'=>'h','𝔥'=>'h','𝕙'=>'h','𝖍'=>'h','𝗁'=>'h','𝗵'=>'h','𝘩'=>'h','𝙝'=>'h','𝚑'=>'h','ɦ'=>'h̔','ħ'=>'h̵','ℏ'=>'h̵','῾'=>'ʻ','‘'=>'ʻ','‛'=>'ʻ','ʽ'=>'ʻ','⍳'=>'i','i'=>'i','ⅰ'=>'i','ℹ'=>'i','ⅈ'=>'i','𝐢'=>'i','𝑖'=>'i','𝒊'=>'i','𝒾'=>'i','𝓲'=>'i','𝔦'=>'i','𝕚'=>'i','𝖎'=>'i','𝗂'=>'i','𝗶'=>'i','𝘪'=>'i','𝙞'=>'i','𝚒'=>'i','ı'=>'i','𝚤'=>'i','ɪ'=>'i','ɩ'=>'i','𝛊'=>'i','𝜄'=>'i','𝜾'=>'i','𝝸'=>'i','𝞲'=>'i','ɨ'=>'i̵','ⅱ'=>'ii','ⅲ'=>'iii','ij'=>'ij','ⅳ'=>'iv','ⅸ'=>'ix','j'=>'j','ⅉ'=>'j','𝐣'=>'j','𝑗'=>'j','𝒋'=>'j','𝒿'=>'j','𝓳'=>'j','𝔧'=>'j','𝕛'=>'j','𝖏'=>'j','𝗃'=>'j','𝗷'=>'j','𝘫'=>'j','𝙟'=>'j','𝚓'=>'j','ϳ'=>'j','𝚥'=>'ȷ','k'=>'k','𝐤'=>'k','𝑘'=>'k','𝒌'=>'k','𝓀'=>'k','𝓴'=>'k','𝔨'=>'k','𝕜'=>'k','𝖐'=>'k','𝗄'=>'k','𝗸'=>'k','𝘬'=>'k','𝙠'=>'k','𝚔'=>'k','ƙ'=>'k̔','m'=>'m','ⅿ'=>'m','𝐦'=>'m','𝑚'=>'m','𝒎'=>'m','𝓂'=>'m','𝓶'=>'m','𝔪'=>'m','𝕞'=>'m','𝖒'=>'m','𝗆'=>'m','𝗺'=>'m','𝘮'=>'m','𝙢'=>'m','𝚖'=>'m','ɱ'=>'m̡','n'=>'n','𝐧'=>'n','𝑛'=>'n','𝒏'=>'n','𝓃'=>'n','𝓷'=>'n','𝔫'=>'n','𝕟'=>'n','𝖓'=>'n','𝗇'=>'n','𝗻'=>'n','𝘯'=>'n','𝙣'=>'n','𝚗'=>'n','𝐍'=>'N','𝑁'=>'N','𝑵'=>'N','𝒩'=>'N','𝓝'=>'N','𝔑'=>'N','𝕹'=>'N','𝖭'=>'N','𝗡'=>'N','𝘕'=>'N','𝙉'=>'N','𝙽'=>'N','𝚴'=>'N','𝛮'=>'N','𝜨'=>'N','𝝢'=>'N','𝞜'=>'N','ɲ'=>'ņ','ɳ'=>'n̢','ƞ'=>'n̩','𝛈'=>'n̩','𝜂'=>'n̩','𝜼'=>'n̩','𝝶'=>'n̩','𝞰'=>'n̩','nj'=>'nj','o'=>'o','ℴ'=>'o','𝐨'=>'o','𝑜'=>'o','𝒐'=>'o','𝓸'=>'o','𝔬'=>'o','𝕠'=>'o','𝖔'=>'o','𝗈'=>'o','𝗼'=>'o','𝘰'=>'o','𝙤'=>'o','𝚘'=>'o','ᴏ'=>'o','𝛐'=>'o','𝜊'=>'o','𝝄'=>'o','𝝾'=>'o','𝞸'=>'o','ɵ'=>'o̵','ǿ'=>'ó̵','ø'=>'o̷','œ'=>'oe','ơ'=>'oʼ','⍴'=>'p','p'=>'p','𝐩'=>'p','𝑝'=>'p','𝒑'=>'p','𝓅'=>'p','𝓹'=>'p','𝔭'=>'p','𝕡'=>'p','𝖕'=>'p','𝗉'=>'p','𝗽'=>'p','𝘱'=>'p','𝙥'=>'p','𝚙'=>'p','𝛒'=>'p','𝛠'=>'p','𝜌'=>'p','𝜚'=>'p','𝝆'=>'p','𝝔'=>'p','𝞀'=>'p','𝞎'=>'p','𝞺'=>'p','𝟈'=>'p','ƥ'=>'p̔','q'=>'q','𝐪'=>'q','𝑞'=>'q','𝒒'=>'q','𝓆'=>'q','𝓺'=>'q','𝔮'=>'q','𝕢'=>'q','𝖖'=>'q','𝗊'=>'q','𝗾'=>'q','𝘲'=>'q','𝙦'=>'q','𝚚'=>'q','𝐐'=>'Q','𝑄'=>'Q','𝑸'=>'Q','𝒬'=>'Q','𝓠'=>'Q','𝔔'=>'Q','𝕼'=>'Q','𝖰'=>'Q','𝗤'=>'Q','𝘘'=>'Q','𝙌'=>'Q','𝚀'=>'Q','ʠ'=>'q̔','𝛋'=>'ĸ','𝛞'=>'ĸ','𝜅'=>'ĸ','𝜘'=>'ĸ','𝜿'=>'ĸ','𝝒'=>'ĸ','𝝹'=>'ĸ','𝞌'=>'ĸ','𝞳'=>'ĸ','𝟆'=>'ĸ','r'=>'r','𝐫'=>'r','𝑟'=>'r','𝒓'=>'r','𝓇'=>'r','𝓻'=>'r','𝔯'=>'r','𝕣'=>'r','𝖗'=>'r','𝗋'=>'r','𝗿'=>'r','𝘳'=>'r','𝙧'=>'r','𝚛'=>'r','ɽ'=>'r̢','ɼ'=>'r̩','s'=>'s','𝐬'=>'s','𝑠'=>'s','𝒔'=>'s','𝓈'=>'s','𝓼'=>'s','𝔰'=>'s','𝕤'=>'s','𝖘'=>'s','𝗌'=>'s','𝘀'=>'s','𝘴'=>'s','𝙨'=>'s','𝚜'=>'s','ƽ'=>'s','ʂ'=>'s̢','∫'=>'ʃ','∬'=>'ʃʃ','∭'=>'ʃʃʃ','⨌'=>'ʃʃʃʃ','t'=>'t','𝐭'=>'t','𝑡'=>'t','𝒕'=>'t','𝓉'=>'t','𝓽'=>'t','𝔱'=>'t','𝕥'=>'t','𝖙'=>'t','𝗍'=>'t','𝘁'=>'t','𝘵'=>'t','𝙩'=>'t','𝚝'=>'t','𝑇'=>'T','𝑻'=>'T','𝒯'=>'T','𝓣'=>'T','𝔗'=>'T','𝕋'=>'T','𝕿'=>'T','𝖳'=>'T','𝗧'=>'T','𝘛'=>'T','𝙏'=>'T','𝚃'=>'T','𝚻'=>'T','𝛵'=>'T','𝜯'=>'T','𝝩'=>'T','𝞣'=>'T','ƭ'=>'t̔','ț'=>'ţ','ƫ'=>'ţ','ŧ'=>'t̵','u'=>'u','𝐮'=>'u','𝑢'=>'u','𝒖'=>'u','𝓊'=>'u','𝓾'=>'u','𝔲'=>'u','𝕦'=>'u','𝖚'=>'u','𝗎'=>'u','𝘂'=>'u','𝘶'=>'u','𝙪'=>'u','𝚞'=>'u','ʊ'=>'u','ʋ'=>'u','𝛖'=>'u','𝜐'=>'u','𝝊'=>'u','𝞄'=>'u','𝞾'=>'u','𝑈'=>'U','𝑼'=>'U','𝒰'=>'U','𝓤'=>'U','𝔘'=>'U','𝕌'=>'U','𝖀'=>'U','𝖴'=>'U','𝗨'=>'U','𝘜'=>'U','𝙐'=>'U','𝚄'=>'U','v'=>'v','ⅴ'=>'v','𝐯'=>'v','𝑣'=>'v','𝒗'=>'v','𝓋'=>'v','𝓿'=>'v','𝔳'=>'v','𝕧'=>'v','𝖛'=>'v','𝗏'=>'v','𝘃'=>'v','𝘷'=>'v','𝙫'=>'v','𝚟'=>'v','𝛎'=>'v','𝜈'=>'v','𝝂'=>'v','𝝼'=>'v','𝞶'=>'v','ⅵ'=>'vi','ⅶ'=>'vii','ⅷ'=>'viii','ɯ'=>'w','w'=>'w','𝐰'=>'w','𝑤'=>'w','𝒘'=>'w','𝓌'=>'w','𝔀'=>'w','𝔴'=>'w','𝕨'=>'w','𝖜'=>'w','𝗐'=>'w','𝘄'=>'w','𝘸'=>'w','𝙬'=>'w','𝚠'=>'w','𝑊'=>'W','𝑾'=>'W','𝒲'=>'W','𝓦'=>'W','𝔚'=>'W','𝕎'=>'W','𝖂'=>'W','𝖶'=>'W','𝗪'=>'W','𝘞'=>'W','𝙒'=>'W','𝚆'=>'W','×'=>'x','x'=>'x','ⅹ'=>'x','𝐱'=>'x','𝑥'=>'x','𝒙'=>'x','𝓍'=>'x','𝔁'=>'x','𝔵'=>'x','𝕩'=>'x','𝖝'=>'x','𝗑'=>'x','𝘅'=>'x','𝘹'=>'x','𝙭'=>'x','𝚡'=>'x','᙭'=>'X','𝑋'=>'X','𝑿'=>'X','𝒳'=>'X','𝓧'=>'X','𝔛'=>'X','𝕏'=>'X','𝖃'=>'X','𝖷'=>'X','𝗫'=>'X','𝘟'=>'X','𝙓'=>'X','𝚇'=>'X','𝚾'=>'X','𝛸'=>'X','𝜲'=>'X','𝝬'=>'X','𝞦'=>'X','ⅺ'=>'xi','ⅻ'=>'xii','y'=>'y','𝐲'=>'y','𝑦'=>'y','𝒚'=>'y','𝓎'=>'y','𝔂'=>'y','𝔶'=>'y','𝕪'=>'y','𝖞'=>'y','𝗒'=>'y','𝘆'=>'y','𝘺'=>'y','𝙮'=>'y','𝚢'=>'y','ƴ'=>'y̔','z'=>'z','𝐳'=>'z','𝑧'=>'z','𝒛'=>'z','𝓏'=>'z','𝔃'=>'z','𝔷'=>'z','𝕫'=>'z','𝖟'=>'z','𝗓'=>'z','𝘇'=>'z','𝘻'=>'z','𝙯'=>'z','𝚣'=>'z','ȥ'=>'z̡','ʐ'=>'z̢','ƶ'=>'z̵','ȝ'=>'ʒ','?'=>'ʔ','?'=>'ʔ','⁇'=>'ʔʔ','⁈'=>'ʔǃ','᾽'=>'ʼ','᾿'=>'ʼ','’'=>'ʼ','ʾ'=>'ʼ','!'=>'ǃ','!'=>'ǃ','⁉'=>'ǃʔ','‼'=>'ǃǃ','⍺'=>'α','𝛂'=>'α','𝛼'=>'α','𝜶'=>'α','𝝰'=>'α','𝞪'=>'α','𝛃'=>'β','𝛽'=>'β','𝜷'=>'β','𝝱'=>'β','𝞫'=>'β','ℽ'=>'γ','𝛄'=>'γ','𝛾'=>'γ','𝜸'=>'γ','𝝲'=>'γ','𝞬'=>'γ','𝛅'=>'δ','𝛿'=>'δ','𝜹'=>'δ','𝝳'=>'δ','𝞭'=>'δ','𝟋'=>'ϝ','𝛇'=>'ζ','𝜁'=>'ζ','𝜻'=>'ζ','𝝵'=>'ζ','𝞯'=>'ζ','⍬'=>'θ','𝛉'=>'θ','𝛝'=>'θ','𝜃'=>'θ','𝜗'=>'θ','𝜽'=>'θ','𝝑'=>'θ','𝝷'=>'θ','𝞋'=>'θ','𝞱'=>'θ','𝟅'=>'θ','𝛌'=>'λ','𝜆'=>'λ','𝝀'=>'λ','𝝺'=>'λ','𝞴'=>'λ','𝛬'=>'Λ','𝜦'=>'Λ','𝝠'=>'Λ','𝞚'=>'Λ','𝛍'=>'μ','𝜇'=>'μ','𝝁'=>'μ','𝝻'=>'μ','𝞵'=>'μ','𝛏'=>'ξ','𝜉'=>'ξ','𝝃'=>'ξ','𝝽'=>'ξ','𝞷'=>'ξ','𝛯'=>'Ξ','𝜩'=>'Ξ','𝝣'=>'Ξ','𝞝'=>'Ξ','ℼ'=>'π','𝛑'=>'π','𝛡'=>'π','𝜋'=>'π','𝜛'=>'π','𝝅'=>'π','𝝕'=>'π','𝝿'=>'π','𝞏'=>'π','𝞹'=>'π','𝟉'=>'π','ᴨ'=>'π','∏'=>'Π','𝚷'=>'Π','𝛱'=>'Π','𝜫'=>'Π','𝝥'=>'Π','𝞟'=>'Π','𝛔'=>'σ','𝜎'=>'σ','𝝈'=>'σ','𝞂'=>'σ','𝞼'=>'σ','𝛕'=>'τ','𝜏'=>'τ','𝝉'=>'τ','𝞃'=>'τ','𝞽'=>'τ','𝐘'=>'Y','𝑌'=>'Y','𝒀'=>'Y','𝒴'=>'Y','𝓨'=>'Y','𝔜'=>'Y','𝕐'=>'Y','𝖄'=>'Y','𝖸'=>'Y','𝗬'=>'Y','𝘠'=>'Y','𝙔'=>'Y','𝚈'=>'Y','𝚼'=>'Y','𝛶'=>'Y','𝜰'=>'Y','𝝪'=>'Y','𝞤'=>'Y','𝛗'=>'φ','𝛟'=>'φ','𝜑'=>'φ','𝜙'=>'φ','𝝋'=>'φ','𝝓'=>'φ','𝞅'=>'φ','𝞍'=>'φ','𝞿'=>'φ','𝟇'=>'φ','𝛷'=>'Φ','𝜱'=>'Φ','𝝫'=>'Φ','𝞥'=>'Φ','𝛘'=>'χ','𝜒'=>'χ','𝝌'=>'χ','𝞆'=>'χ','𝟀'=>'χ','𝛙'=>'ψ','𝜓'=>'ψ','𝝍'=>'ψ','𝞇'=>'ψ','𝟁'=>'ψ','𝛹'=>'Ψ','𝜳'=>'Ψ','𝝭'=>'Ψ','𝞧'=>'Ψ','⍵'=>'ω','𝛚'=>'ω','𝜔'=>'ω','𝝎'=>'ω','𝞈'=>'ω','𝟂'=>'ω','ӕ'=>'ae','ғ'=>'r̵','ґ'=>'rᑊ','җ'=>'ж̩','ҙ'=>'з̡','ӏ'=>'i','ҋ'=>'й̡','қ'=>'ĸ̩','ҟ'=>'ĸ̵','ᴫ'=>'л','ӆ'=>'л̡','ӎ'=>'м̡','ӊ'=>'н̡','ӈ'=>'н̡','ң'=>'н̩','ө'=>'o̵','ѳ'=>'o̵','ҫ'=>'c̡','ҭ'=>'т̩','ү'=>'y','ұ'=>'y̵','ћ'=>'h̵','ѽ'=>'ѡ҃','ӌ'=>'ҷ','ҿ'=>'ҽ̢','ҍ'=>'Ь̵','զ'=>'q','ռ'=>'n','ℵ'=>'א','ﬡ'=>'א','אָ'=>'אַ','אּ'=>'אַ','ﭏ'=>'אל','ℶ'=>'ב','ℷ'=>'ג','ℸ'=>'ד','ﬢ'=>'ד','ﬣ'=>'ה','ﬤ'=>'כ','ﬥ'=>'ל','ﬦ'=>'ם','ﬠ'=>'ע','ﬧ'=>'ר','ﬨ'=>'ת','ﺀ'=>'ء','ﺂ'=>'آ','ﺁ'=>'آ','ﺄ'=>'أ','ﺃ'=>'أ','ٵ'=>'أ','ﭑ'=>'ٱ','ﭐ'=>'ٱ','ﺆ'=>'ؤ','ﺅ'=>'ؤ','ٶ'=>'ؤ','ﺈ'=>'إ','ﺇ'=>'إ','ﺋ'=>'ئ','ﺌ'=>'ئ','ﺊ'=>'ئ','ﺉ'=>'ئ','ﯫ'=>'ئا','ﯪ'=>'ئا','ﯸ'=>'ئٻ','ﯷ'=>'ئٻ','ﯶ'=>'ئٻ','ﲗ'=>'ئج','ﰀ'=>'ئج','ﲘ'=>'ئح','ﰁ'=>'ئح','ﲙ'=>'ئخ','ﱤ'=>'ئر','ﱥ'=>'ئز','ﲚ'=>'ئم','ﳟ'=>'ئم','ﱦ'=>'ئم','ﰂ'=>'ئم','ﱧ'=>'ئن','ﲛ'=>'ئه','ﳠ'=>'ئه','ﯭ'=>'ئه','ﯬ'=>'ئه','ﯯ'=>'ئو','ﯮ'=>'ئو','ﯳ'=>'ئۆ','ﯲ'=>'ئۆ','ﯱ'=>'ئۇ','ﯰ'=>'ئۇ','ﯵ'=>'ئۈ','ﯴ'=>'ئۈ','ﯻ'=>'ئى','ﯺ'=>'ئى','ﱨ'=>'ئى','ﯹ'=>'ئى','ﰃ'=>'ئى','ﱩ'=>'ئى','ﰄ'=>'ئى','ﺎ'=>'ا','ﺍ'=>'ا','ﴼ'=>'اً','ﴽ'=>'اً','ﷳ'=>'اكبر','ﷲ'=>'الله','ﺑ'=>'ب','ﺒ'=>'ب','ﺐ'=>'ب','ﺏ'=>'ب','ﲜ'=>'بج','ﰅ'=>'بج','ﲝ'=>'بح','ﰆ'=>'بح','ﷂ'=>'بحى','ﲞ'=>'بخ','ﰇ'=>'بخ','ﶞ'=>'بخى','ﱪ'=>'بر','ﱫ'=>'بز','ﲟ'=>'بم','ﳡ'=>'بم','ﱬ'=>'بم','ﰈ'=>'بم','ﱭ'=>'بن','ﲠ'=>'به','ﳢ'=>'به','ﱮ'=>'بى','ﰉ'=>'بى','ﱯ'=>'بى','ﰊ'=>'بى','ﭔ'=>'ٻ','ﭕ'=>'ٻ','ﭓ'=>'ٻ','ﭒ'=>'ٻ','ې'=>'ٻ','ﯦ'=>'ٻ','ﯧ'=>'ٻ','ﯥ'=>'ٻ','ﯤ'=>'ٻ','ﭘ'=>'پ','ﭙ'=>'پ','ﭗ'=>'پ','ﭖ'=>'پ','ﭜ'=>'ڀ','ﭝ'=>'ڀ','ﭛ'=>'ڀ','ﭚ'=>'ڀ','ﺔ'=>'ة','ﺓ'=>'ة','ﺗ'=>'ت','ﺘ'=>'ت','ﺖ'=>'ت','ﺕ'=>'ت','ﲡ'=>'تج','ﰋ'=>'تج','ﵐ'=>'تجم','ﶠ'=>'تجى','ﶟ'=>'تجى','ﲢ'=>'تح','ﰌ'=>'تح','ﵒ'=>'تحج','ﵑ'=>'تحج','ﵓ'=>'تحم','ﲣ'=>'تخ','ﰍ'=>'تخ','ﵔ'=>'تخم','ﶢ'=>'تخى','ﶡ'=>'تخى','ﱰ'=>'تر','ﱱ'=>'تز','ﲤ'=>'تم','ﳣ'=>'تم','ﱲ'=>'تم','ﰎ'=>'تم','ﵕ'=>'تمج','ﵖ'=>'تمح','ﵗ'=>'تمخ','ﶤ'=>'تمى','ﶣ'=>'تمى','ﱳ'=>'تن','ﲥ'=>'ته','ﳤ'=>'ته','ﱴ'=>'تى','ﰏ'=>'تى','ﱵ'=>'تى','ﰐ'=>'تى','ﺛ'=>'ث','ﺜ'=>'ث','ﺚ'=>'ث','ﺙ'=>'ث','ﰑ'=>'ثج','ﱶ'=>'ثر','ﱷ'=>'ثز','ﲦ'=>'ثم','ﳥ'=>'ثم','ﱸ'=>'ثم','ﰒ'=>'ثم','ﱹ'=>'ثن','ﳦ'=>'ثه','ﱺ'=>'ثى','ﰓ'=>'ثى','ﱻ'=>'ثى','ﰔ'=>'ثى','ﭨ'=>'ٹ','ﭩ'=>'ٹ','ﭧ'=>'ٹ','ﭦ'=>'ٹ','ڻ'=>'ٹ','ﮢ'=>'ٹ','ﮣ'=>'ٹ','ﮡ'=>'ٹ','ﮠ'=>'ٹ','ﭠ'=>'ٺ','ﭡ'=>'ٺ','ﭟ'=>'ٺ','ﭞ'=>'ٺ','ﭤ'=>'ٿ','ﭥ'=>'ٿ','ﭣ'=>'ٿ','ﭢ'=>'ٿ','ﺟ'=>'ج','ﺠ'=>'ج','ﺞ'=>'ج','ﺝ'=>'ج','ﲧ'=>'جح','ﰕ'=>'جح','ﶦ'=>'جحى','ﶾ'=>'جحى','ﷻ'=>'جل جلاله','ﲨ'=>'جم','ﰖ'=>'جم','ﵙ'=>'جمح','ﵘ'=>'جمح','ﶧ'=>'جمى','ﶥ'=>'جمى','ﴝ'=>'جى','ﴁ'=>'جى','ﴞ'=>'جى','ﴂ'=>'جى','ﭸ'=>'ڃ','ﭹ'=>'ڃ','ﭷ'=>'ڃ','ﭶ'=>'ڃ','ﭴ'=>'ڄ','ﭵ'=>'ڄ','ﭳ'=>'ڄ','ﭲ'=>'ڄ','ﭼ'=>'چ','ﭽ'=>'چ','ﭻ'=>'چ','ﭺ'=>'چ','ﮀ'=>'ڇ','ﮁ'=>'ڇ','ﭿ'=>'ڇ','ﭾ'=>'ڇ','ﺣ'=>'ح','ﺤ'=>'ح','ﺢ'=>'ح','ﺡ'=>'ح','ﲩ'=>'حج','ﰗ'=>'حج','ﶿ'=>'حجى','ﲪ'=>'حم','ﰘ'=>'حم','ﵛ'=>'حمى','ﵚ'=>'حمى','ﴛ'=>'حى','ﳿ'=>'حى','ﴜ'=>'حى','ﴀ'=>'حى','ﺧ'=>'خ','ﺨ'=>'خ','ﺦ'=>'خ','ﺥ'=>'خ','ﲫ'=>'خج','ﰙ'=>'خج','ﰚ'=>'خح','ﲬ'=>'خم','ﰛ'=>'خم','ﴟ'=>'خى','ﴃ'=>'خى','ﴠ'=>'خى','ﴄ'=>'خى','ﺪ'=>'د','ﺩ'=>'د','ﺬ'=>'ذ','ﺫ'=>'ذ','ﱛ'=>'ذٰ','ﮉ'=>'ڈ','ﮈ'=>'ڈ','ﮅ'=>'ڌ','ﮄ'=>'ڌ','ﮃ'=>'ڍ','ﮂ'=>'ڍ','ﮇ'=>'ڎ','ﮆ'=>'ڎ','ﺮ'=>'ر','ﺭ'=>'ر','ﱜ'=>'رٰ','ﷶ'=>'رسول','﷼'=>'رىال','ﺰ'=>'ز','ﺯ'=>'ز','ﮍ'=>'ڑ','ﮌ'=>'ڑ','ﮋ'=>'ژ','ﮊ'=>'ژ','ﺳ'=>'س','ﺴ'=>'س','ﺲ'=>'س','ﺱ'=>'س','ﲭ'=>'سج','ﴴ'=>'سج','ﰜ'=>'سج','ﵝ'=>'سجح','ﵞ'=>'سجى','ﲮ'=>'سح','ﴵ'=>'سح','ﰝ'=>'سح','ﵜ'=>'سحج','ﲯ'=>'سخ','ﴶ'=>'سخ','ﰞ'=>'سخ','ﶨ'=>'سخى','ﷆ'=>'سخى','ﴪ'=>'سر','ﴎ'=>'سر','ﲰ'=>'سم','ﳧ'=>'سم','ﰟ'=>'سم','ﵡ'=>'سمج','ﵠ'=>'سمح','ﵟ'=>'سمح','ﵣ'=>'سمم','ﵢ'=>'سمم','ﴱ'=>'سه','ﳨ'=>'سه','ﴗ'=>'سى','ﳻ'=>'سى','ﴘ'=>'سى','ﳼ'=>'سى','ﺷ'=>'ش','ﺸ'=>'ش','ﺶ'=>'ش','ﺵ'=>'ش','ﴭ'=>'شج','ﴷ'=>'شج','ﴥ'=>'شج','ﴉ'=>'شج','ﵩ'=>'شجى','ﴮ'=>'شح','ﴸ'=>'شح','ﴦ'=>'شح','ﴊ'=>'شح','ﵨ'=>'شحم','ﵧ'=>'شحم','ﶪ'=>'شحى','ﴯ'=>'شخ','ﴹ'=>'شخ','ﴧ'=>'شخ','ﴋ'=>'شخ','ﴩ'=>'شر','ﴍ'=>'شر','ﴰ'=>'شم','ﳩ'=>'شم','ﴨ'=>'شم','ﴌ'=>'شم','ﵫ'=>'شمخ','ﵪ'=>'شمخ','ﵭ'=>'شمم','ﵬ'=>'شمم','ﴲ'=>'شه','ﳪ'=>'شه','ﴙ'=>'شى','ﳽ'=>'شى','ﴚ'=>'شى','ﳾ'=>'شى','ﺻ'=>'ص','ﺼ'=>'ص','ﺺ'=>'ص','ﺹ'=>'ص','ﲱ'=>'صح','ﰠ'=>'صح','ﵥ'=>'صحح','ﵤ'=>'صحح','ﶩ'=>'صحى','ﲲ'=>'صخ','ﴫ'=>'صر','ﴏ'=>'صر','ﷵ'=>'صلعم','ﷹ'=>'صلى','ﷺ'=>'صلى الله علىه وسلم','ﷰ'=>'صلے','ﲳ'=>'صم','ﰡ'=>'صم','ﷅ'=>'صمم','ﵦ'=>'صمم','ﴡ'=>'صى','ﴅ'=>'صى','ﴢ'=>'صى','ﴆ'=>'صى','ﺿ'=>'ض','ﻀ'=>'ض','ﺾ'=>'ض','ﺽ'=>'ض','ﲴ'=>'ضج','ﰢ'=>'ضج','ﲵ'=>'ضح','ﰣ'=>'ضح','ﵮ'=>'ضحى','ﶫ'=>'ضحى','ﲶ'=>'ضخ','ﰤ'=>'ضخ','ﵰ'=>'ضخم','ﵯ'=>'ضخم','ﴬ'=>'ضر','ﴐ'=>'ضر','ﲷ'=>'ضم','ﰥ'=>'ضم','ﴣ'=>'ضى','ﴇ'=>'ضى','ﴤ'=>'ضى','ﴈ'=>'ضى','ﻃ'=>'ط','ﻄ'=>'ط','ﻂ'=>'ط','ﻁ'=>'ط','ﲸ'=>'طح','ﰦ'=>'طح','ﴳ'=>'طم','ﴺ'=>'طم','ﰧ'=>'طم','ﵲ'=>'طمح','ﵱ'=>'طمح','ﵳ'=>'طمم','ﵴ'=>'طمى','ﴑ'=>'طى','ﳵ'=>'طى','ﴒ'=>'طى','ﳶ'=>'طى','ﻇ'=>'ظ','ﻈ'=>'ظ','ﻆ'=>'ظ','ﻅ'=>'ظ','ﲹ'=>'ظم','ﴻ'=>'ظم','ﰨ'=>'ظم','ﻋ'=>'ع','ﻌ'=>'ع','ﻊ'=>'ع','ﻉ'=>'ع','ﲺ'=>'عج','ﰩ'=>'عج','ﷄ'=>'عجم','ﵵ'=>'عجم','ﷷ'=>'علىه','ﲻ'=>'عم','ﰪ'=>'عم','ﵷ'=>'عمم','ﵶ'=>'عمم','ﵸ'=>'عمى','ﶶ'=>'عمى','ﴓ'=>'عى','ﳷ'=>'عى','ﴔ'=>'عى','ﳸ'=>'عى','ﻏ'=>'غ','ﻐ'=>'غ','ﻎ'=>'غ','ﻍ'=>'غ','ﲼ'=>'غج','ﰫ'=>'غج','ﲽ'=>'غم','ﰬ'=>'غم','ﵹ'=>'غمم','ﵻ'=>'غمى','ﵺ'=>'غمى','ﴕ'=>'غى','ﳹ'=>'غى','ﴖ'=>'غى','ﳺ'=>'غى','ﻓ'=>'ف','ﻔ'=>'ف','ﻒ'=>'ف','ﻑ'=>'ف','ﲾ'=>'فج','ﰭ'=>'فج','ﲿ'=>'فح','ﰮ'=>'فح','ﳀ'=>'فخ','ﰯ'=>'فخ','ﵽ'=>'فخم','ﵼ'=>'فخم','ﳁ'=>'فم','ﰰ'=>'فم','ﷁ'=>'فمى','ﱼ'=>'فى','ﰱ'=>'فى','ﱽ'=>'فى','ﰲ'=>'فى','ﭬ'=>'ڤ','ﭭ'=>'ڤ','ﭫ'=>'ڤ','ﭪ'=>'ڤ','ﭰ'=>'ڦ','ﭱ'=>'ڦ','ﭯ'=>'ڦ','ﭮ'=>'ڦ','ﻗ'=>'ق','ﻘ'=>'ق','ﻖ'=>'ق','ﻕ'=>'ق','ﳂ'=>'قح','ﰳ'=>'قح','ﷱ'=>'قلے','ﳃ'=>'قم','ﰴ'=>'قم','ﶴ'=>'قمح','ﵾ'=>'قمح','ﵿ'=>'قمم','ﶲ'=>'قمى','ﱾ'=>'قى','ﰵ'=>'قى','ﱿ'=>'قى','ﰶ'=>'قى','ﻛ'=>'ك','ﻜ'=>'ك','ﻚ'=>'ك','ﻙ'=>'ك','ک'=>'ك','ﮐ'=>'ك','ﮑ'=>'ك','ﮏ'=>'ك','ﮎ'=>'ك','ﲀ'=>'كا','ﰷ'=>'كا','ﳄ'=>'كج','ﰸ'=>'كج','ﳅ'=>'كح','ﰹ'=>'كح','ﳆ'=>'كخ','ﰺ'=>'كخ','ﳇ'=>'كل','ﳫ'=>'كل','ﲁ'=>'كل','ﰻ'=>'كل','ﳈ'=>'كم','ﳬ'=>'كم','ﲂ'=>'كم','ﰼ'=>'كم','ﷃ'=>'كمم','ﶻ'=>'كمم','ﶷ'=>'كمى','ﲃ'=>'كى','ﰽ'=>'كى','ﲄ'=>'كى','ﰾ'=>'كى','ﯕ'=>'ڭ','ﯖ'=>'ڭ','ﯔ'=>'ڭ','ﯓ'=>'ڭ','ﮔ'=>'گ','ﮕ'=>'گ','ﮓ'=>'گ','ﮒ'=>'گ','ﮜ'=>'ڱ','ﮝ'=>'ڱ','ﮛ'=>'ڱ','ﮚ'=>'ڱ','ﮘ'=>'ڳ','ﮙ'=>'ڳ','ﮗ'=>'ڳ','ﮖ'=>'ڳ','ﻟ'=>'ل','ﻠ'=>'ل','ﻞ'=>'ل','ﻝ'=>'ل','ﻶ'=>'لآ','ﻵ'=>'لآ','ﻸ'=>'لأ','ﻷ'=>'لأ','ﻺ'=>'لإ','ﻹ'=>'لإ','ﻼ'=>'لا','ﻻ'=>'لا','ﳉ'=>'لج','ﰿ'=>'لج','ﶃ'=>'لجج','ﶄ'=>'لجج','ﶺ'=>'لجم','ﶼ'=>'لجم','ﶬ'=>'لجى','ﳊ'=>'لح','ﱀ'=>'لح','ﶵ'=>'لحم','ﶀ'=>'لحم','ﶂ'=>'لحى','ﶁ'=>'لحى','ﳋ'=>'لخ','ﱁ'=>'لخ','ﶆ'=>'لخم','ﶅ'=>'لخم','ﳌ'=>'لم','ﳭ'=>'لم','ﲅ'=>'لم','ﱂ'=>'لم','ﶈ'=>'لمح','ﶇ'=>'لمح','ﶭ'=>'لمى','ﳍ'=>'له','ﲆ'=>'لى','ﱃ'=>'لى','ﲇ'=>'لى','ﱄ'=>'لى','ﻣ'=>'م','ﻤ'=>'م','ﻢ'=>'م','ﻡ'=>'م','ﲈ'=>'ما','ﳎ'=>'مج','ﱅ'=>'مج','ﶌ'=>'مجح','ﶒ'=>'مجخ','ﶍ'=>'مجم','ﷀ'=>'مجى','ﳏ'=>'مح','ﱆ'=>'مح','ﶉ'=>'محج','ﶊ'=>'محم','ﷴ'=>'محمد','ﶋ'=>'محى','ﳐ'=>'مخ','ﱇ'=>'مخ','ﶎ'=>'مخج','ﶏ'=>'مخم','ﶹ'=>'مخى','ﳑ'=>'مم','ﲉ'=>'مم','ﱈ'=>'مم','ﶱ'=>'ممى','ﱉ'=>'مى','ﱊ'=>'مى','ﻧ'=>'ن','ﻨ'=>'ن','ﻦ'=>'ن','ﻥ'=>'ن','ﳒ'=>'نج','ﱋ'=>'نج','ﶸ'=>'نجح','ﶽ'=>'نجح','ﶘ'=>'نجم','ﶗ'=>'نجم','ﶙ'=>'نجى','ﷇ'=>'نجى','ﳓ'=>'نح','ﱌ'=>'نح','ﶕ'=>'نحم','ﶖ'=>'نحى','ﶳ'=>'نحى','ﳔ'=>'نخ','ﱍ'=>'نخ','ﲊ'=>'نر','ﲋ'=>'نز','ﳕ'=>'نم','ﳮ'=>'نم','ﲌ'=>'نم','ﱎ'=>'نم','ﶛ'=>'نمى','ﶚ'=>'نمى','ﲍ'=>'نن','ﳖ'=>'نه','ﳯ'=>'نه','ﲎ'=>'نى','ﱏ'=>'نى','ﲏ'=>'نى','ﱐ'=>'نى','ﮟ'=>'ں','ﮞ'=>'ں','ﻫ'=>'ه','ﻬ'=>'ه','ﻪ'=>'ه','ﻩ'=>'ه','ھ'=>'ه','ﮬ'=>'ه','ﮭ'=>'ه','ﮫ'=>'ه','ﮪ'=>'ه','ہ'=>'ه','ﮨ'=>'ه','ﮩ'=>'ه','ﮧ'=>'ه','ﮦ'=>'ه','ە'=>'ه','ﳙ'=>'هٰ','ﳗ'=>'هج','ﱑ'=>'هج','ﳘ'=>'هم','ﱒ'=>'هم','ﶓ'=>'همج','ﶔ'=>'همم','ﱓ'=>'هى','ﱔ'=>'هى','ﮥ'=>'ۀ','ﮤ'=>'ۀ','ﻮ'=>'و','ﻭ'=>'و','ﷸ'=>'وسلم','ﯡ'=>'ۅ','ﯠ'=>'ۅ','ﯚ'=>'ۆ','ﯙ'=>'ۆ','ﯘ'=>'ۇ','ﯗ'=>'ۇ','ٷ'=>'ۇٔ','ﯝ'=>'ۇٔ','ﯜ'=>'ۈ','ﯛ'=>'ۈ','ﯣ'=>'ۉ','ﯢ'=>'ۉ','ﯟ'=>'ۋ','ﯞ'=>'ۋ','ﯨ'=>'ى','ﯩ'=>'ى','ﻰ'=>'ى','ﻯ'=>'ى','ي'=>'ى','ﻳ'=>'ى','ﻴ'=>'ى','ﻲ'=>'ى','ﻱ'=>'ى','ی'=>'ى','ﯾ'=>'ى','ﯿ'=>'ى','ﯽ'=>'ى','ﯼ'=>'ى','ٸ'=>'ىٔ','ﲐ'=>'ىٰ','ﱝ'=>'ىٰ','ﳚ'=>'ىج','ﱕ'=>'ىج','ﶯ'=>'ىجى','ﳛ'=>'ىح','ﱖ'=>'ىح','ﶮ'=>'ىحى','ﳜ'=>'ىخ','ﱗ'=>'ىخ','ﲑ'=>'ىر','ﲒ'=>'ىز','ﳝ'=>'ىم','ﳰ'=>'ىم','ﲓ'=>'ىم','ﱘ'=>'ىم','ﶝ'=>'ىمم','ﶜ'=>'ىمم','ﶰ'=>'ىمى','ﲔ'=>'ىن','ﳞ'=>'ىه','ﳱ'=>'ىه','ﲕ'=>'ىى','ﱙ'=>'ىى','ﲖ'=>'ىى','ﱚ'=>'ىى','ۧ'=>'ۦ','ﮯ'=>'ے','ﮮ'=>'ے','ﮱ'=>'ۓ','ﮰ'=>'ۓ','∃'=>'ⴺ','आ'=>'अा','ऒ'=>'अाॆ','ओ'=>'अाे','औ'=>'अाै','ऄ'=>'अॆ','ऑ'=>'अॉ','ऍ'=>'एॅ','ऎ'=>'एॆ','ऐ'=>'एे','ई'=>'र्इ','আ'=>'অা','ৠ'=>'ঋৃ','ৡ'=>'ঌৢ','ਉ'=>'ੳੁ','ਊ'=>'ੳੂ','ਆ'=>'ਅਾ','ਐ'=>'ਅੈ','ਔ'=>'ਅੌ','ਇ'=>'ੲਿ','ਈ'=>'ੲੀ','ਏ'=>'ੲੇ','આ'=>'અા','ઑ'=>'અાૅ','ઓ'=>'અાે','ઔ'=>'અાૈ','ઍ'=>'અૅ','એ'=>'અે','ઐ'=>'અૈ','ଆ'=>'ଅା','௮'=>'அ','ர'=>'ஈ','ா'=>'ஈ','௫'=>'ஈு','௨'=>'உ','ஊ'=>'உள','௭'=>'எ','௷'=>'எவ','ஜ'=>'ஐ','௧'=>'க','௪'=>'ச','௬'=>'சு','௲'=>'சூ','௺'=>'நீ','ை'=>'ன','௴'=>'மீ','௰'=>'ய','ௗ'=>'ள','௸'=>'ஷ','ொ'=>'ெஈ','ௌ'=>'ெள','ோ'=>'ேஈ','ౠ'=>'ఋా','ౡ'=>'ఌా','ఔ'=>'ఒౌ','ఓ'=>'ఒౕ','ఢ'=>'డ̣','భ'=>'బ̣','ష'=>'వ̣','హ'=>'వా','మ'=>'వు','ూ'=>'ుా','ౄ'=>'ృా','ೡ'=>'ಌಾ','ಔ'=>'ఒౌ','ഈ'=>'ഇൗ','ഊ'=>'உൗ','ഐ'=>'എെ','ഓ'=>'ഒാ','ഔ'=>'ഒൗ','ൡ'=>'ഞ','൫'=>'ദ്ര','ഌ'=>'നூ','ങ'=>'നூ','൯'=>'ന്','റ'=>'ര','൪'=>'ര്','൮'=>'വ്','ീ'=>'ி','ൂ'=>'ூ','ൃ'=>'ூ','ൈ'=>'െെ','ฃ'=>'ข','ด'=>'ค','ต'=>'ค','ม'=>'ฆ','ซ'=>'ช','ฏ'=>'ฎ','ท'=>'ฑ','ๅ'=>'า','ำ'=>'̊า','แ'=>'เเ','ໜ'=>'ຫນ','ໝ'=>'ຫມ','ຳ'=>'̊າ','ཷ'=>'ྲཱྀ','ཹ'=>'ླཱྀ','၀'=>'o','ឣ'=>'អ','᧐'=>'ᦞ','᭒'=>'ᬍ','᭓'=>'ᬑ','᭘'=>'ᬨ','ᢖ'=>'ᡜ','ᡕ'=>'ᠵ','Ꮢ'=>'Ꭱ','Ꮍ'=>'y','𝐀'=>'A','𝐴'=>'A','𝑨'=>'A','𝒜'=>'A','𝓐'=>'A','𝔄'=>'A','𝔸'=>'A','𝕬'=>'A','𝖠'=>'A','𝗔'=>'A','𝘈'=>'A','𝘼'=>'A','𝙰'=>'A','𝚨'=>'A','𝛢'=>'A','𝜜'=>'A','𝝖'=>'A','𝞐'=>'A','𝐉'=>'J','𝐽'=>'J','𝑱'=>'J','𝒥'=>'J','𝓙'=>'J','𝔍'=>'J','𝕁'=>'J','𝕵'=>'J','𝖩'=>'J','𝗝'=>'J','𝘑'=>'J','𝙅'=>'J','𝙹'=>'J','Ꮷ'=>'J','⋿'=>'E','ℰ'=>'E','𝐄'=>'E','𝐸'=>'E','𝑬'=>'E','𝓔'=>'E','𝔈'=>'E','𝔼'=>'E','𝕰'=>'E','𝖤'=>'E','𝗘'=>'E','𝘌'=>'E','𝙀'=>'E','𝙴'=>'E','𝚬'=>'E','𝛦'=>'E','𝜠'=>'E','𝝚'=>'E','𝞔'=>'E','ℾ'=>'Ꮁ','𝚪'=>'Ꮁ','𝛤'=>'Ꮁ','𝜞'=>'Ꮁ','𝝘'=>'Ꮁ','𝞒'=>'Ꮁ','Ꮤ'=>'w','ℳ'=>'M','𝐌'=>'M','𝑀'=>'M','𝑴'=>'M','𝓜'=>'M','𝔐'=>'M','𝕄'=>'M','𝕸'=>'M','𝖬'=>'M','𝗠'=>'M','𝘔'=>'M','𝙈'=>'M','𝙼'=>'M','𝚳'=>'M','𝛭'=>'M','𝜧'=>'M','𝝡'=>'M','𝞛'=>'M','ℋ'=>'H','ℌ'=>'H','ℍ'=>'H','𝐇'=>'H','𝐻'=>'H','𝑯'=>'H','𝓗'=>'H','𝕳'=>'H','𝖧'=>'H','𝗛'=>'H','𝘏'=>'H','𝙃'=>'H','𝙷'=>'H','𝚮'=>'H','𝛨'=>'H','𝜢'=>'H','𝝜'=>'H','𝞖'=>'H','𝐆'=>'G','𝐺'=>'G','𝑮'=>'G','𝒢'=>'G','𝓖'=>'G','𝔊'=>'G','𝔾'=>'G','𝕲'=>'G','𝖦'=>'G','𝗚'=>'G','𝘎'=>'G','𝙂'=>'G','𝙶'=>'G','Ᏻ'=>'G','ℤ'=>'Z','ℨ'=>'Z','𝐙'=>'Z','𝑍'=>'Z','𝒁'=>'Z','𝒵'=>'Z','𝓩'=>'Z','𝖅'=>'Z','𝖹'=>'Z','𝗭'=>'Z','𝘡'=>'Z','𝙕'=>'Z','𝚉'=>'Z','𝚭'=>'Z','𝛧'=>'Z','𝜡'=>'Z','𝝛'=>'Z','𝞕'=>'Z','𝐒'=>'S','𝑆'=>'S','𝑺'=>'S','𝒮'=>'S','𝓢'=>'S','𝔖'=>'S','𝕊'=>'S','𝕾'=>'S','𝖲'=>'S','𝗦'=>'S','𝘚'=>'S','𝙎'=>'S','𝚂'=>'S','Ꮪ'=>'S','𝐕'=>'V','𝑉'=>'V','𝑽'=>'V','𝒱'=>'V','𝓥'=>'V','𝔙'=>'V','𝕍'=>'V','𝖁'=>'V','𝖵'=>'V','𝗩'=>'V','𝘝'=>'V','𝙑'=>'V','𝚅'=>'V','ℒ'=>'L','𝐋'=>'L','𝐿'=>'L','𝑳'=>'L','𝓛'=>'L','𝔏'=>'L','𝕃'=>'L','𝕷'=>'L','𝖫'=>'L','𝗟'=>'L','𝘓'=>'L','𝙇'=>'L','𝙻'=>'L','∑'=>'C','⅀'=>'C','ℂ'=>'C','ℭ'=>'C','𝐂'=>'C','𝐶'=>'C','𝑪'=>'C','𝒞'=>'C','𝓒'=>'C','𝕮'=>'C','𝖢'=>'C','𝗖'=>'C','𝘊'=>'C','𝘾'=>'C','𝙲'=>'C','𝚺'=>'C','𝛴'=>'C','𝜮'=>'C','𝝨'=>'C','𝞢'=>'C','ℙ'=>'P','𝐏'=>'P','𝑃'=>'P','𝑷'=>'P','𝒫'=>'P','𝓟'=>'P','𝔓'=>'P','𝕻'=>'P','𝖯'=>'P','𝗣'=>'P','𝘗'=>'P','𝙋'=>'P','𝙿'=>'P','𝚸'=>'P','𝛲'=>'P','𝜬'=>'P','𝝦'=>'P','𝞠'=>'P','𝐊'=>'K','𝐾'=>'K','𝑲'=>'K','𝒦'=>'K','𝓚'=>'K','𝔎'=>'K','𝕂'=>'K','𝕶'=>'K','𝖪'=>'K','𝗞'=>'K','𝘒'=>'K','𝙆'=>'K','𝙺'=>'K','𝚱'=>'K','𝛫'=>'K','𝜥'=>'K','𝝟'=>'K','𝞙'=>'K','ℬ'=>'B','𝐁'=>'B','𝐵'=>'B','𝑩'=>'B','𝓑'=>'B','𝔅'=>'B','𝔹'=>'B','𝕭'=>'B','𝖡'=>'B','𝗕'=>'B','𝘉'=>'B','𝘽'=>'B','𝙱'=>'B','𝚩'=>'B','𝛣'=>'B','𝜝'=>'B','𝝗'=>'B','𝞑'=>'B','ᐍ'=>'ᐁ·','∆'=>'ᐃ','𝚫'=>'ᐃ','𝛥'=>'ᐃ','𝜟'=>'ᐃ','𝝙'=>'ᐃ','𝞓'=>'ᐃ','ᐏ'=>'ᐃ·','ᐑ'=>'ᐄ·','ᐓ'=>'ᐅ·','ᐕ'=>'ᐆ·','ᐘ'=>'ᐊ·','ᐚ'=>'ᐋ·','ᓑ'=>'ᐡ','ᑶ'=>'·P','ᑺ'=>'·d','ᒘ'=>'·J','ᑁ'=>'ᐳ·','ᑃ'=>'ᐴ·','ᑅ'=>'ᐸ·','ᑇ'=>'ᐹ·','ˈ'=>'ᑊ','ᑘ'=>'ᑌ·','ᑧ'=>'ᑌᑊ','ᑚ'=>'ᑎ·','ᑨ'=>'ᑎᑊ','ᑜ'=>'ᑏ·','ᑞ'=>'ᑐ·','ᑩ'=>'ᑐᑊ','ᑠ'=>'ᑑ·','ᑢ'=>'ᑕ·','ᑪ'=>'ᑕᑊ','ᑤ'=>'ᑖ·','ᑵ'=>'ᑫ·','ᒅ'=>'ᑫᑊ','ᑷ'=>'P·','ᒆ'=>'Pᑊ','ᑹ'=>'ᑮ·','ᑻ'=>'d·','ᒇ'=>'dᑊ','ᑽ'=>'ᑰ·','ᑿ'=>'ᑲ·','ᒈ'=>'ᑲᑊ','ᒁ'=>'ᑳ·','ᘃ'=>'ᒉ','ᒓ'=>'ᒉ·','ᒕ'=>'ᒋ·','ᒗ'=>'ᒌ·','ᒙ'=>'J·','ᒛ'=>'ᒎ·','ᘂ'=>'ᒐ','ᒝ'=>'ᒐ·','ᒟ'=>'ᒑ·','ᒭ'=>'ᒣ·','ᒯ'=>'ᒥ·','ᒱ'=>'ᒦ·','ᒳ'=>'ᒧ·','ᒵ'=>'ᒨ·','ᒹ'=>'ᒫ·','ᓊ'=>'ᓀ·','ᓌ'=>'ᓇ·','ᓎ'=>'ᓈᒫ','ᘄ'=>'ᓓ','ᓝ'=>'ᓓ·','ᓟ'=>'ᓕ·','ᓡ'=>'ᓖ·','ᓣ'=>'ᓗ·','ᓥ'=>'ᓘ·','ᘇ'=>'ᓚ','ᓧ'=>'ᓚ·','ᓩ'=>'ᓛ·','ᓷ'=>'ᓭ·','ᓹ'=>'ᓯ·','ᓻ'=>'ᓰ·','ᓽ'=>'ᓱ·','ᓿ'=>'ᓲ·','ᔁ'=>'ᓴ·','ᔃ'=>'ᓵ·','ᔌ'=>'ᔋᐸ','ᔍ'=>'ᔋᑕ','ᔎ'=>'ᔋᑲ','ᔏ'=>'ᔋᒐ','ᔘ'=>'ᔐ·','ᔚ'=>'ᔑ·','ᔜ'=>'ᔒ·','ᔞ'=>'ᔓ·','ᔠ'=>'ᔔ·','ᔢ'=>'ᔕ·','ᔤ'=>'ᔖ·','ᔲ'=>'ᔨ·','ᔴ'=>'ᔩ·','ᔶ'=>'ᔪ·','ᔸ'=>'ᔫ·','ᔺ'=>'ᔭ·','ᔼ'=>'ᔮ·','᙮'=>'x','ᕽ'=>'x','ᘢ'=>'ᕃ','ᘣ'=>'ᕆ','ᘤ'=>'ᕊ','ᕏ'=>'ᕌ·','ᙯ'=>'ᕐᑫ','ᕾ'=>'ᕐᑬ','ᕿ'=>'ᕐP','ᖀ'=>'ᕐᑮ','ᖁ'=>'ᕐd','ᖂ'=>'ᕐᑰ','ᖃ'=>'ᕐᑲ','ᖄ'=>'ᕐᑳ','ᖅ'=>'ᕐᒃ','ᕜ'=>'ᕚ·','ᕩ'=>'ᕧ·','ℛ'=>'R','ℜ'=>'R','ℝ'=>'R','𝐑'=>'R','𝑅'=>'R','𝑹'=>'R','𝓡'=>'R','𝕽'=>'R','𝖱'=>'R','𝗥'=>'R','𝘙'=>'R','𝙍'=>'R','𝚁'=>'R','ᙰ'=>'ᖕᒉ','ᖎ'=>'ᖕᒊ','ᖏ'=>'ᖕᒋ','ᖐ'=>'ᖕᒌ','ᖑ'=>'ᖕJ','ᖒ'=>'ᖕᒎ','ᖓ'=>'ᖕᒐ','ᖔ'=>'ᖕᒑ','ᙱ'=>'ᖖᒋ','ᙲ'=>'ᖖᒌ','ᙳ'=>'ᖖJ','ᙴ'=>'ᖖᒎ','ᙵ'=>'ᖖᒐ','ᙶ'=>'ᖖᒑ','ℱ'=>'F','𝐅'=>'F','𝐹'=>'F','𝑭'=>'F','𝓕'=>'F','𝔉'=>'F','𝔽'=>'F','𝕱'=>'F','𝖥'=>'F','𝗙'=>'F','𝘍'=>'F','𝙁'=>'F','𝙵'=>'F','𝟊'=>'F','ⅅ'=>'D','𝐃'=>'D','𝐷'=>'D','𝑫'=>'D','𝒟'=>'D','𝓓'=>'D','𝔇'=>'D','𝔻'=>'D','𝕯'=>'D','𝖣'=>'D','𝗗'=>'D','𝘋'=>'D','𝘿'=>'D','𝙳'=>'D','ᗪ'=>'D','℧'=>'ᘮ','ᘴ'=>'ᘮ','𝛀'=>'ᘯ','𝛺'=>'ᘯ','𝜴'=>'ᘯ','𝝮'=>'ᘯ','𝞨'=>'ᘯ','ᘵ'=>'ᘯ','ㄱ'=>'ᄀ','ᄀ'=>'ᄀ','ᆨ'=>'ᄀ','ㄲ'=>'ᄁ','ᄁ'=>'ᄁ','ᆩ'=>'ᄁ','ㄴ'=>'ᄂ','ᄂ'=>'ᄂ','ᆫ'=>'ᄂ','ㄷ'=>'ᄃ','ᄃ'=>'ᄃ','ᆮ'=>'ᄃ','ㄸ'=>'ᄄ','ᄄ'=>'ᄄ','ㄹ'=>'ᄅ','ᄅ'=>'ᄅ','ᆯ'=>'ᄅ','ㅁ'=>'ᄆ','ᄆ'=>'ᄆ','ᆷ'=>'ᄆ','ㅂ'=>'ᄇ','ᄇ'=>'ᄇ','ᆸ'=>'ᄇ','ㅃ'=>'ᄈ','ᄈ'=>'ᄈ','ㅅ'=>'ᄉ','ᄉ'=>'ᄉ','ᆺ'=>'ᄉ','ㅆ'=>'ᄊ','ᄊ'=>'ᄊ','ᆻ'=>'ᄊ','ㅇ'=>'ᄋ','ᄋ'=>'ᄋ','ᆼ'=>'ᄋ','ㅈ'=>'ᄌ','ᄌ'=>'ᄌ','ᆽ'=>'ᄌ','ㅉ'=>'ᄍ','ᄍ'=>'ᄍ','ㅊ'=>'ᄎ','ᄎ'=>'ᄎ','ᆾ'=>'ᄎ','ㅋ'=>'ᄏ','ᄏ'=>'ᄏ','ᆿ'=>'ᄏ','ㅌ'=>'ᄐ','ᄐ'=>'ᄐ','ᇀ'=>'ᄐ','ㅍ'=>'ᄑ','ᄑ'=>'ᄑ','ᇁ'=>'ᄑ','ㅎ'=>'ᄒ','ᄒ'=>'ᄒ','ᇂ'=>'ᄒ','ᇅ'=>'ᄓ','ㅥ'=>'ᄔ','ㅦ'=>'ᄕ','ᇆ'=>'ᄕ','ᇊ'=>'ᄗ','ᇍ'=>'ᄘ','ᇐ'=>'ᄙ','ㅀ'=>'ᄚ','ᄚ'=>'ᄚ','ᄻ'=>'ᄚ','ᆶ'=>'ᄚ','ㅮ'=>'ᄜ','ᇜ'=>'ᄜ','ㅱ'=>'ᄝ','ᇢ'=>'ᄝ','ㅲ'=>'ᄞ','ㅳ'=>'ᄠ','ㅄ'=>'ᄡ','ᄡ'=>'ᄡ','ᆹ'=>'ᄡ','ㅴ'=>'ᄢ','ㅵ'=>'ᄣ','ㅶ'=>'ᄧ','ㅷ'=>'ᄩ','ㅸ'=>'ᄫ','ᇦ'=>'ᄫ','ㅹ'=>'ᄬ','ㅺ'=>'ᄭ','ᇧ'=>'ᄭ','ㅻ'=>'ᄮ','ㅼ'=>'ᄯ','ᇨ'=>'ᄯ','ᇩ'=>'ᄰ','ㅽ'=>'ᄲ','ᇪ'=>'ᄲ','ㅾ'=>'ᄶ','ㅿ'=>'ᅀ','ᇫ'=>'ᅀ','ᇬ'=>'ᅁ','ᇱ'=>'ᅅ','ㆂ'=>'ᅅ','ᇲ'=>'ᅆ','ㆃ'=>'ᅆ','ㆀ'=>'ᅇ','ᇮ'=>'ᅇ','ㆁ'=>'ᅌ','ᇰ'=>'ᅌ','ᇳ'=>'ᅖ','ㆄ'=>'ᅗ','ᇴ'=>'ᅗ','ㆅ'=>'ᅘ','ㆆ'=>'ᅙ','ᇹ'=>'ᅙ','ㅤ'=>'ᅠ','ᅠ'=>'ᅠ','ㅏ'=>'ᅡ','ᅡ'=>'ᅡ','ㅐ'=>'ᅢ','ᅢ'=>'ᅢ','ㅑ'=>'ᅣ','ᅣ'=>'ᅣ','ㅒ'=>'ᅤ','ᅤ'=>'ᅤ','ㅓ'=>'ᅥ','ᅥ'=>'ᅥ','ㅔ'=>'ᅦ','ᅦ'=>'ᅦ','ㅕ'=>'ᅧ','ᅧ'=>'ᅧ','ㅖ'=>'ᅨ','ᅨ'=>'ᅨ','ㅗ'=>'ᅩ','ᅩ'=>'ᅩ','ㅘ'=>'ᅪ','ᅪ'=>'ᅪ','ㅙ'=>'ᅫ','ᅫ'=>'ᅫ','ㅚ'=>'ᅬ','ᅬ'=>'ᅬ','ㅛ'=>'ᅭ','ᅭ'=>'ᅭ','ㅜ'=>'ᅮ','ᅮ'=>'ᅮ','ㅝ'=>'ᅯ','ᅯ'=>'ᅯ','ㅞ'=>'ᅰ','ᅰ'=>'ᅰ','ㅟ'=>'ᅱ','ᅱ'=>'ᅱ','ㅠ'=>'ᅲ','ᅲ'=>'ᅲ','ㅡ'=>'一','ᅳ'=>'一','ㅢ'=>'ᅴ','ᅴ'=>'ᅴ','ㅣ'=>'丨','ᅵ'=>'丨','ㆇ'=>'ᆄ','ᆆ'=>'ᆄ','ㆈ'=>'ᆅ','ㆉ'=>'ᆈ','ㆊ'=>'ᆑ','ㆋ'=>'ᆒ','ㆌ'=>'ᆔ','ㆍ'=>'ᆞ','ㆎ'=>'ᆡ','ㄳ'=>'ᆪ','ᆪ'=>'ᆪ','ㄵ'=>'ᆬ','ᆬ'=>'ᆬ','ㄶ'=>'ᆭ','ᆭ'=>'ᆭ','ㄺ'=>'ᆰ','ᆰ'=>'ᆰ','ㄻ'=>'ᆱ','ᆱ'=>'ᆱ','ㄼ'=>'ᆲ','ᆲ'=>'ᆲ','ㄽ'=>'ᆳ','ᆳ'=>'ᆳ','ㄾ'=>'ᆴ','ᆴ'=>'ᆴ','ㄿ'=>'ᆵ','ᆵ'=>'ᆵ','ㅧ'=>'ᇇ','ㅨ'=>'ᇈ','ㅩ'=>'ᇌ','ㅪ'=>'ᇎ','ㅫ'=>'ᇓ','ㅬ'=>'ᇗ','ㅭ'=>'ᇙ','ㅯ'=>'ᇝ','ㅰ'=>'ᇟ','ァ'=>'ァ','ア'=>'ア','ィ'=>'ィ','イ'=>'イ','ゥ'=>'ゥ','ウ'=>'ウ','ェ'=>'ェ','エ'=>'エ','ォ'=>'ォ','オ'=>'オ','カ'=>'カ','キ'=>'キ','ク'=>'ク','ケ'=>'ケ','コ'=>'コ','サ'=>'サ','シ'=>'シ','ス'=>'ス','セ'=>'セ','ソ'=>'ソ','タ'=>'タ','チ'=>'チ','ッ'=>'ッ','ツ'=>'ツ','テ'=>'テ','ト'=>'ト','ナ'=>'ナ','ニ'=>'ニ','ヌ'=>'ヌ','ネ'=>'ネ','ノ'=>'ノ','ハ'=>'ハ','ヒ'=>'ヒ','フ'=>'フ','ヘ'=>'へ','ホ'=>'ホ','マ'=>'マ','⧄'=>'〼','ミ'=>'ミ','ム'=>'ム','メ'=>'メ','モ'=>'モ','ャ'=>'ャ','ヤ'=>'ヤ','ュ'=>'ュ','ユ'=>'ユ','ョ'=>'ョ','ヨ'=>'ヨ','ラ'=>'ラ','リ'=>'リ','ル'=>'ル','レ'=>'レ','ロ'=>'ロ','ワ'=>'ワ','ヲ'=>'ヲ','ン'=>'ン','꒞'=>'ꁊ','꒬'=>'ꁐ','꒜'=>'ꃀ','꒿'=>'ꉙ','꒾'=>'ꊱ','꓀'=>'ꎫ','꓂'=>'ꎵ','꒺'=>'ꎿ','꒰'=>'ꏂ','𐒠'=>'𐒆','—'=>'一','―'=>'一','−'=>'一','─'=>'一','⼀'=>'一','不'=>'不','並'=>'並','|'=>'丨','|'=>'丨','∣'=>'丨','⼁'=>'丨','‖'=>'丨丨','∥'=>'丨丨','串'=>'串','⼂'=>'丶','丸'=>'丸','丹'=>'丹','丽'=>'丽','⼃'=>'丿','乁'=>'乁','⼄'=>'乙','亂'=>'亂','⼅'=>'亅','了'=>'了','⼆'=>'二','⼇'=>'亠','亮'=>'亮','⼈'=>'人','什'=>'什','仌'=>'仌','令'=>'令','你'=>'你','倂'=>'併','倂'=>'併','侀'=>'侀','來'=>'來','例'=>'例','侮'=>'侮','侮'=>'侮','侻'=>'侻','便'=>'便','值'=>'値','倫'=>'倫','偺'=>'偺','備'=>'備','像'=>'像','僚'=>'僚','僧'=>'僧','僧'=>'僧','⼉'=>'儿','兀'=>'兀','充'=>'充','免'=>'免','免'=>'免','兔'=>'兔','兤'=>'兤','⼊'=>'入','內'=>'內','全'=>'全','兩'=>'兩','⼋'=>'八','六'=>'六','具'=>'具','冀'=>'冀','⼌'=>'冂','再'=>'再','冒'=>'冒','冕'=>'冕','⼍'=>'冖','冗'=>'冗','冤'=>'冤','⼎'=>'冫','冬'=>'冬','况'=>'况','况'=>'况','冷'=>'冷','凉'=>'凉','凌'=>'凌','凜'=>'凜','凞'=>'凞','⼏'=>'几','凵'=>'凵','⼐'=>'凵','⼑'=>'刀','刃'=>'刃','切'=>'切','切'=>'切','列'=>'列','利'=>'利','刺'=>'刺','刻'=>'刻','剆'=>'剆','割'=>'割','剷'=>'剷','劉'=>'劉','力'=>'力','⼒'=>'力','劣'=>'劣','劳'=>'劳','勇'=>'勇','勇'=>'勇','勉'=>'勉','勉'=>'勉','勒'=>'勒','勞'=>'勞','勤'=>'勤','勤'=>'勤','勵'=>'勵','⼓'=>'勹','勺'=>'勺','勺'=>'勺','包'=>'包','匆'=>'匆','⼔'=>'匕','北'=>'北','北'=>'北','⼕'=>'匚','⼖'=>'匸','匿'=>'匿','⼗'=>'十','〸'=>'十','〹'=>'卄','〺'=>'卅','卉'=>'卉','卑'=>'卑','卑'=>'卑','博'=>'博','⼘'=>'卜','⼙'=>'卩','即'=>'即','卵'=>'卵','卽'=>'卽','卿'=>'卿','卿'=>'卿','卿'=>'卿','⼚'=>'厂','⼛'=>'厶','參'=>'參','⼜'=>'又','及'=>'及','叟'=>'叟','⼝'=>'口','句'=>'句','叫'=>'叫','叱'=>'叱','吆'=>'吆','吏'=>'吏','吝'=>'吝','吸'=>'吸','呂'=>'呂','呈'=>'呈','周'=>'周','咞'=>'咞','咢'=>'咢','咽'=>'咽','哶'=>'哶','唐'=>'唐','啓'=>'啓','啟'=>'啓','啕'=>'啕','啣'=>'啣','善'=>'善','善'=>'善','喇'=>'喇','喙'=>'喙','喙'=>'喙','喝'=>'喝','喝'=>'喝','喫'=>'喫','喳'=>'喳','嗀'=>'嗀','嗂'=>'嗂','嗢'=>'嗢','嘆'=>'嘆','嘆'=>'嘆','噑'=>'噑','器'=>'器','噴'=>'噴','⼞'=>'囗','囹'=>'囹','圖'=>'圖','圗'=>'圗','⼟'=>'土','型'=>'型','城'=>'城','埴'=>'埴','堍'=>'堍','報'=>'報','堲'=>'堲','塀'=>'塀','塚'=>'塚','塚'=>'塚','塞'=>'塞','填'=>'塡','墨'=>'墨','壿'=>'墫','墬'=>'墬','墳'=>'墳','壘'=>'壘','壟'=>'壟','⼠'=>'士','壮'=>'壮','売'=>'売','壷'=>'壷','⼡'=>'夂','夆'=>'夆','⼢'=>'夊','⼣'=>'夕','多'=>'多','夢'=>'夢','⼤'=>'大','奄'=>'奄','奈'=>'奈','契'=>'契','奔'=>'奔','奢'=>'奢','女'=>'女','⼥'=>'女','姘'=>'姘','姬'=>'姬','娛'=>'娛','娧'=>'娧','婢'=>'婢','婦'=>'婦','嬀'=>'媯','媵'=>'媵','嬈'=>'嬈','嬨'=>'嬨','嬾'=>'嬾','嬾'=>'嬾','⼦'=>'子','⼧'=>'宀','宅'=>'宅','寃'=>'寃','寘'=>'寘','寧'=>'寧','寧'=>'寧','寧'=>'寧','寮'=>'寮','寳'=>'寳','⼨'=>'寸','寿'=>'寿','将'=>'将','⼩'=>'小','尢'=>'尢','⼪'=>'尢','⼫'=>'尸','尿'=>'尿','屠'=>'屠','屢'=>'屢','層'=>'層','履'=>'履','屮'=>'屮','屮'=>'屮','⼬'=>'屮','⼭'=>'山','岍'=>'岍','峀'=>'峀','崙'=>'崙','嵃'=>'嵃','嵐'=>'嵐','嵫'=>'嵫','嵮'=>'嵮','嵼'=>'嵼','嶲'=>'嶲','嶺'=>'嶺','⼮'=>'巛','巡'=>'巡','巢'=>'巢','⼯'=>'工','⼰'=>'己','巽'=>'巽','⼱'=>'巾','帲'=>'帡','帨'=>'帨','帽'=>'帽','幩'=>'幩','⼲'=>'干','年'=>'年','⼳'=>'幺','⼴'=>'广','度'=>'度','庰'=>'庰','庳'=>'庳','庶'=>'庶','廉'=>'廉','廊'=>'廊','廊'=>'廊','廒'=>'廒','廓'=>'廓','廙'=>'廙','廬'=>'廬','⼵'=>'廴','廾'=>'廾','⼶'=>'廾','弄'=>'弄','⼷'=>'弋','⼸'=>'弓','弢'=>'弢','弢'=>'弢','⼹'=>'彐','当'=>'当','⼺'=>'彡','形'=>'形','彩'=>'彩','彫'=>'彫','⼻'=>'彳','律'=>'律','徚'=>'徚','復'=>'復','徭'=>'徭','⼼'=>'心','忍'=>'忍','志'=>'志','念'=>'念','忹'=>'忹','怒'=>'怒','怜'=>'怜','悁'=>'悁','悔'=>'悔','悔'=>'悔','惇'=>'惇','惘'=>'惘','惡'=>'惡','愈'=>'愈','慄'=>'慄','慈'=>'慈','慌'=>'慌','慌'=>'慌','慎'=>'慎','慎'=>'慎','慠'=>'慠','慨'=>'慨','慺'=>'慺','憎'=>'憎','憎'=>'憎','憎'=>'憎','憐'=>'憐','憤'=>'憤','憯'=>'憯','憲'=>'憲','懞'=>'懞','懲'=>'懲','懲'=>'懲','懲'=>'懲','懶'=>'懶','懶'=>'懶','戀'=>'戀','⼽'=>'戈','成'=>'成','戛'=>'戛','戮'=>'戮','戴'=>'戴','⼾'=>'戶','⼿'=>'手','扝'=>'扝','抱'=>'抱','拉'=>'拉','拏'=>'拏','拓'=>'拓','拔'=>'拔','拼'=>'拼','拾'=>'拾','挽'=>'挽','捐'=>'捐','捨'=>'捨','捻'=>'捻','掃'=>'掃','掠'=>'掠','掩'=>'掩','揄'=>'揄','揅'=>'揅','揤'=>'揤','㩁'=>'搉','搜'=>'搜','搢'=>'搢','摒'=>'摒','摩'=>'摩','摷'=>'摷','摾'=>'摾','撚'=>'撚','撝'=>'撝','擄'=>'擄','⽀'=>'支','⽁'=>'攴','敏'=>'敏','敏'=>'敏','敖'=>'敖','敬'=>'敬','數'=>'數','⽂'=>'文','⽃'=>'斗','料'=>'料','⽄'=>'斤','⽅'=>'方','旅'=>'旅','⽆'=>'无','既'=>'既','旣'=>'旣','⽇'=>'日','易'=>'易','晉'=>'晉','晩'=>'晚','䀿'=>'晣','晴'=>'晴','晴'=>'晴','暈'=>'暈','暑'=>'暑','暑'=>'暑','暜'=>'暜','暴'=>'暴','曆'=>'曆','⽈'=>'曰','更'=>'更','㫚'=>'曶','書'=>'書','最'=>'最','⽉'=>'月','肦'=>'朌','胐'=>'朏','胊'=>'朐','脁'=>'朓','朗'=>'朗','朗'=>'朗','朗'=>'朗','脧'=>'朘','望'=>'望','望'=>'望','朡'=>'朡','膧'=>'朣','⽊'=>'木','李'=>'李','杓'=>'杓','杖'=>'杖','杞'=>'杞','柿'=>'杮','杻'=>'杻','枅'=>'枅','林'=>'林','柳'=>'柳','柺'=>'柺','栗'=>'栗','栟'=>'栟','桒'=>'桒','梁'=>'梁','梅'=>'梅','梅'=>'梅','梎'=>'梎','梨'=>'梨','椔'=>'椔','楂'=>'楂','樧'=>'榝','榣'=>'榣','槪'=>'槪','樂'=>'樂','樂'=>'樂','樂'=>'樂','樓'=>'樓','檨'=>'檨','櫓'=>'櫓','櫛'=>'櫛','欄'=>'欄','⽋'=>'欠','次'=>'次','歔'=>'歔','⽌'=>'止','歲'=>'歲','歷'=>'歷','歹'=>'歹','⽍'=>'歹','殟'=>'殟','殮'=>'殮','⽎'=>'殳','殺'=>'殺','殺'=>'殺','殺'=>'殺','殻'=>'殻','⽏'=>'毋','⺟'=>'母','⽐'=>'比','⽑'=>'毛','⽒'=>'氏','⽓'=>'气','⽔'=>'水','汎'=>'汎','汧'=>'汧','沈'=>'沈','沿'=>'沿','泌'=>'泌','泍'=>'泍','泥'=>'泥','洖'=>'洖','洛'=>'洛','洞'=>'洞','洴'=>'洴','派'=>'派','流'=>'流','流'=>'流','流'=>'流','浩'=>'浩','浪'=>'浪','海'=>'海','海'=>'海','浸'=>'浸','涅'=>'涅','淋'=>'淋','淚'=>'淚','淪'=>'淪','淹'=>'淹','渚'=>'渚','港'=>'港','湮'=>'湮','潙'=>'溈','溜'=>'溜','溺'=>'溺','滇'=>'滇','滋'=>'滋','滋'=>'滋','滑'=>'滑','滛'=>'滛','漏'=>'漏','漢'=>'漢','漢'=>'漢','漣'=>'漣','潮'=>'潮','濆'=>'濆','濫'=>'濫','濾'=>'濾','瀛'=>'瀛','瀞'=>'瀞','瀞'=>'瀞','瀹'=>'瀹','灊'=>'灊','⽕'=>'火','灰'=>'灰','灷'=>'灷','災'=>'災','炙'=>'炙','炭'=>'炭','烈'=>'烈','烙'=>'烙','煅'=>'煅','煉'=>'煉','煮'=>'煮','煮'=>'煮','熜'=>'熜','燎'=>'燎','燐'=>'燐','爐'=>'爐','爛'=>'爛','爨'=>'爨','⽖'=>'爪','爫'=>'爫','⺤'=>'爫','爵'=>'爵','爵'=>'爵','⽗'=>'父','⽘'=>'爻','⽙'=>'爿','⽚'=>'片','牐'=>'牐','⽛'=>'牙','⽜'=>'牛','牢'=>'牢','犀'=>'犀','犕'=>'犕','⽝'=>'犬','犯'=>'犯','狀'=>'狀','狼'=>'狼','猪'=>'猪','猪'=>'猪','獵'=>'獵','獺'=>'獺','⽞'=>'玄','率'=>'率','率'=>'率','⽟'=>'玉','王'=>'王','玥'=>'玥','玲'=>'玲','珞'=>'珞','理'=>'理','琉'=>'琉','琢'=>'琢','瑇'=>'瑇','瑜'=>'瑜','瑩'=>'瑩','瑱'=>'瑱','瑱'=>'瑱','璅'=>'璅','璉'=>'璉','璘'=>'璘','瓊'=>'瓊','⽠'=>'瓜','⽡'=>'瓦','甆'=>'甆','⽢'=>'甘','⽣'=>'生','甤'=>'甤','⽤'=>'用','⽥'=>'田','画'=>'画','甾'=>'甾','留'=>'留','略'=>'略','異'=>'異','異'=>'異','⽦'=>'疋','⽧'=>'疒','痢'=>'痢','瘐'=>'瘐','瘝'=>'瘝','瘟'=>'瘟','療'=>'療','癩'=>'癩','⽨'=>'癶','⽩'=>'白','⽪'=>'皮','⽫'=>'皿','益'=>'益','益'=>'益','盛'=>'盛','盧'=>'盧','⽬'=>'目','直'=>'直','直'=>'直','省'=>'省','眞'=>'眞','真'=>'真','真'=>'真','着'=>'着','睊'=>'睊','睊'=>'睊','瞋'=>'瞋','瞧'=>'瞧','⽭'=>'矛','⽮'=>'矢','⽯'=>'石','硏'=>'研','硎'=>'硎','硫'=>'硫','碌'=>'碌','碌'=>'碌','碑'=>'碑','磊'=>'磊','磌'=>'磌','磌'=>'磌','磻'=>'磻','礪'=>'礪','⽰'=>'示','礼'=>'礼','社'=>'社','祈'=>'祈','祉'=>'祉','祐'=>'祐','祖'=>'祖','祖'=>'祖','祝'=>'祝','神'=>'神','祥'=>'祥','祿'=>'祿','禍'=>'禍','禎'=>'禎','福'=>'福','福'=>'福','禮'=>'禮','⽱'=>'禸','⽲'=>'禾','秊'=>'秊','秫'=>'秫','稜'=>'稜','穀'=>'穀','穀'=>'穀','穊'=>'穊','穏'=>'穏','⽳'=>'穴','突'=>'突','窱'=>'窱','立'=>'立','⽴'=>'立','竮'=>'竮','⽵'=>'竹','笠'=>'笠','節'=>'節','節'=>'節','篆'=>'篆','築'=>'築','簾'=>'簾','籠'=>'籠','⽶'=>'米','类'=>'类','粒'=>'粒','精'=>'精','糒'=>'糒','糖'=>'糖','糣'=>'糣','糧'=>'糧','糨'=>'糨','⽷'=>'糸','紀'=>'紀','紐'=>'紐','索'=>'索','累'=>'累','絶'=>'絕','絛'=>'絛','絣'=>'絣','綠'=>'綠','綾'=>'綾','緇'=>'緇','練'=>'練','練'=>'練','練'=>'練','縂'=>'縂','縉'=>'縉','縷'=>'縷','繁'=>'繁','繅'=>'繅','⽸'=>'缶','缾'=>'缾','⽹'=>'网','⺫'=>'罒','署'=>'署','罹'=>'罹','罺'=>'罺','羅'=>'羅','⽺'=>'羊','羕'=>'羕','羚'=>'羚','羽'=>'羽','⽻'=>'羽','翺'=>'翺','老'=>'老','⽼'=>'老','者'=>'者','者'=>'者','者'=>'者','⽽'=>'而','⽾'=>'耒','⽿'=>'耳','聆'=>'聆','聠'=>'聠','聯'=>'聯','聰'=>'聰','聾'=>'聾','⾀'=>'聿','⾁'=>'肉','肋'=>'肋','肭'=>'肭','育'=>'育','㬵'=>'胶','腁'=>'胼','脃'=>'脃','脾'=>'脾','臘'=>'臘','⾂'=>'臣','臨'=>'臨','⾃'=>'自','臭'=>'臭','⾄'=>'至','⾅'=>'臼','舁'=>'舁','舁'=>'舁','舄'=>'舄','⾆'=>'舌','⾇'=>'舛','⾈'=>'舟','⾉'=>'艮','良'=>'良','⾊'=>'色','⾋'=>'艸','艹'=>'艹','艹'=>'艹','芋'=>'芋','芑'=>'芑','芝'=>'芝','花'=>'花','芳'=>'芳','芽'=>'芽','若'=>'若','若'=>'若','苦'=>'苦','茝'=>'茝','茣'=>'茣','茶'=>'茶','荒'=>'荒','荓'=>'荓','荣'=>'荣','莭'=>'莭','莽'=>'莽','菉'=>'菉','菊'=>'菊','菌'=>'菌','菜'=>'菜','菧'=>'菧','華'=>'華','菱'=>'菱','落'=>'落','葉'=>'葉','著'=>'著','著'=>'著','蔿'=>'蒍','蓮'=>'蓮','蓱'=>'蓱','蓳'=>'蓳','蓼'=>'蓼','蔖'=>'蔖','蕤'=>'蕤','藍'=>'藍','藺'=>'藺','蘆'=>'蘆','蘒'=>'蘒','蘭'=>'蘭','虁'=>'蘷','蘿'=>'蘿','⾌'=>'虍','虐'=>'虐','虜'=>'虜','虜'=>'虜','虧'=>'虧','虩'=>'虩','⾍'=>'虫','蚈'=>'蚈','蚩'=>'蚩','蛢'=>'蛢','蜎'=>'蜎','蜨'=>'蜨','蝫'=>'蝫','蝹'=>'蝹','蝹'=>'蝹','螆'=>'螆','螺'=>'螺','蟡'=>'蟡','蠁'=>'蠁','蠟'=>'蠟','⾎'=>'血','行'=>'行','⾏'=>'行','衠'=>'衠','衣'=>'衣','⾐'=>'衣','裂'=>'裂','裏'=>'裏','裗'=>'裗','裞'=>'裞','裡'=>'裡','裸'=>'裸','裺'=>'裺','褐'=>'褐','襁'=>'襁','襤'=>'襤','⾑'=>'襾','覆'=>'覆','見'=>'見','⾒'=>'見','視'=>'視','視'=>'視','⾓'=>'角','⾔'=>'言','䚶'=>'訞','詽'=>'訮','誠'=>'誠','說'=>'說','說'=>'說','調'=>'調','請'=>'請','諒'=>'諒','論'=>'論','諭'=>'諭','諭'=>'諭','諸'=>'諸','諸'=>'諸','諾'=>'諾','諾'=>'諾','謁'=>'謁','謁'=>'謁','謹'=>'謹','謹'=>'謹','識'=>'識','讀'=>'讀','讏'=>'讆','變'=>'變','變'=>'變','⾕'=>'谷','⾖'=>'豆','豈'=>'豈','豕'=>'豕','⾗'=>'豕','⾘'=>'豸','⾙'=>'貝','貫'=>'貫','賁'=>'賁','賂'=>'賂','賈'=>'賈','賓'=>'賓','贈'=>'贈','贈'=>'贈','贛'=>'贛','⾚'=>'赤','⾛'=>'走','起'=>'起','趆'=>'赿','⾜'=>'足','趼'=>'趼','跋'=>'跋','跺'=>'跥','路'=>'路','跰'=>'跰','躛'=>'躗','⾝'=>'身','車'=>'車','⾞'=>'車','軔'=>'軔','輧'=>'軿','輦'=>'輦','輪'=>'輪','輸'=>'輸','輸'=>'輸','輻'=>'輻','轢'=>'轢','⾟'=>'辛','辞'=>'辞','辰'=>'辰','⾠'=>'辰','⾡'=>'辵','辶'=>'辶','⻌'=>'辶','連'=>'連','逸'=>'逸','逸'=>'逸','遲'=>'遲','遼'=>'遼','邏'=>'邏','⾢'=>'邑','邔'=>'邔','郎'=>'郎','郱'=>'郱','都'=>'都','鄑'=>'鄑','鄛'=>'鄛','⾣'=>'酉','酪'=>'酪','醙'=>'醙','醴'=>'醴','⾤'=>'釆','里'=>'里','⾥'=>'里','量'=>'量','金'=>'金','⾦'=>'金','鈴'=>'鈴','鈸'=>'鈸','鉶'=>'鉶','鉼'=>'鉼','鋗'=>'鋗','鋘'=>'鋘','錄'=>'錄','鍊'=>'鍊','鎮'=>'鎭','鏹'=>'鏹','鐕'=>'鐕','⾧'=>'長','⾨'=>'門','開'=>'開','閭'=>'閭','閷'=>'閷','⾩'=>'阜','阮'=>'阮','陋'=>'陋','降'=>'降','陵'=>'陵','陸'=>'陸','陼'=>'陼','隆'=>'隆','隣'=>'隣','⾪'=>'隶','隸'=>'隸','⾫'=>'隹','雃'=>'雃','離'=>'離','難'=>'難','難'=>'難','⾬'=>'雨','零'=>'零','雷'=>'雷','霣'=>'霣','露'=>'露','靈'=>'靈','⾭'=>'靑','靖'=>'靖','靖'=>'靖','⾮'=>'非','⾯'=>'面','⾰'=>'革','⾱'=>'韋','韛'=>'韛','韠'=>'韠','⾲'=>'韭','⾳'=>'音','響'=>'響','響'=>'響','⾴'=>'頁','頋'=>'頋','頋'=>'頋','頋'=>'頋','領'=>'領','頩'=>'頩','頻'=>'頻','頻'=>'頻','類'=>'類','⾵'=>'風','⾶'=>'飛','⻝'=>'食','⾷'=>'食','飢'=>'飢','飯'=>'飯','飼'=>'飼','館'=>'館','餩'=>'餩','⾸'=>'首','⾹'=>'香','馧'=>'馧','⾺'=>'馬','駂'=>'駂','駱'=>'駱','駾'=>'駾','驪'=>'驪','⾻'=>'骨','⾼'=>'高','⾽'=>'髟','鬒'=>'鬒','鬒'=>'鬒','⾾'=>'鬥','⾿'=>'鬯','⿀'=>'鬲','⿁'=>'鬼','⿂'=>'魚','魯'=>'魯','鱀'=>'鱀','鱗'=>'鱗','⿃'=>'鳥','鳽'=>'鳽','鵧'=>'鵧','鶴'=>'鶴','鷺'=>'鷺','鸞'=>'鸞','鹃'=>'鹂','⿄'=>'鹵','鹿'=>'鹿','⿅'=>'鹿','麗'=>'麗','麟'=>'麟','⿆'=>'麥','麻'=>'麻','⿇'=>'麻','⿈'=>'黃','⿉'=>'黍','黎'=>'黎','⿊'=>'黑','黹'=>'黹','⿋'=>'黹','⿌'=>'黽','黾'=>'黾','鼅'=>'鼅','⿍'=>'鼎','鼏'=>'鼏','⿎'=>'鼓','鼖'=>'鼖','⿏'=>'鼠','鼻'=>'鼻','⿐'=>'鼻','齃'=>'齃','⿑'=>'齊','⿒'=>'齒','龍'=>'龍','⿓'=>'龍','龎'=>'龎','龜'=>'龜','龜'=>'龜','龜'=>'龜','⿔'=>'龜','⻳'=>'龟','⿕'=>'龠','㒞'=>'㒞','㒹'=>'㒹','㒻'=>'㒻','㓟'=>'㓟','㔕'=>'㔕','䎛'=>'㖈','㛮'=>'㛮','㛼'=>'㛼','㞁'=>'㞁','㠯'=>'㠯','㡢'=>'㡢','㡼'=>'㡼','㣇'=>'㣇','㣣'=>'㣣','㤜'=>'㤜','㤺'=>'㤺','㨮'=>'㨮','㩬'=>'㩬','㫤'=>'㫤','㬈'=>'㬈','㬙'=>'㬙','䐠'=>'㬻','㭉'=>'㭉','㮝'=>'㮝','㮝'=>'㮝','㰘'=>'㰘','㱎'=>'㱎','㴳'=>'㴳','㶖'=>'㶖','㺬'=>'㺬','㺸'=>'㺸','㺸'=>'㺸','㼛'=>'㼛','㿼'=>'㿼','䀈'=>'䀈','䀘'=>'䀘','䀹'=>'䀹','䀹'=>'䀹','䁆'=>'䁆','䂖'=>'䂖','䃣'=>'䃣','䄯'=>'䄯','䈂'=>'䈂','䈧'=>'䈧','䊠'=>'䊠','䌁'=>'䌁','䌴'=>'䌴','䍙'=>'䍙','䏕'=>'䏕','䏙'=>'䏙','䐋'=>'䐋','䑫'=>'䑫','䔫'=>'䔫','䕝'=>'䕝','䕡'=>'䕡','䕫'=>'䕫','䗗'=>'䗗','䗹'=>'䗹','䘵'=>'䘵','䚾'=>'䚾','䛇'=>'䛇','䦕'=>'䦕','䧦'=>'䧦','䩮'=>'䩮','䩶'=>'䩶','䪲'=>'䪲','䬳'=>'䬳','䯎'=>'䯎','䳎'=>'䳎','䳭'=>'䳭','䳸'=>'䳸','䵖'=>'䵖','𠄢'=>'𠄢','𠔜'=>'𠔜','𠔥'=>'𠔥','𠕋'=>'𠕋','𠘺'=>'𠘺','𠠄'=>'𠠄','𠣞'=>'𠣞','𠨬'=>'𠨬','𠭣'=>'𠭣','𡓤'=>'𡓤','𡚨'=>'𡚨','𡛪'=>'𡛪','𡧈'=>'𡧈','𡬘'=>'𡬘','𡴋'=>'𡴋','𡷤'=>'𡷤','𡷦'=>'𡷦','𢆃'=>'𢆃','𢆟'=>'𢆟','𢌱'=>'𢌱','𢌱'=>'𢌱','𢛔'=>'𢛔','𢡄'=>'𢡄','𢡊'=>'𢡊','𢬌'=>'𢬌','𢯱'=>'𢯱','𣀊'=>'𣀊','𣊸'=>'𣊸','𣍟'=>'𣍟','𣎓'=>'𣎓','𣎜'=>'𣎜','𣏃'=>'𣏃','𣏕'=>'𣏕','𣑭'=>'𣑭','𣚣'=>'𣚣','𣢧'=>'𣢧','𣪍'=>'𣪍','𣫺'=>'𣫺','𣲼'=>'𣲼','𣴞'=>'𣴞','𣻑'=>'𣻑','𣽞'=>'𣽞','𣾎'=>'𣾎','𤉣'=>'𤉣','𤎫'=>'𤎫','𤘈'=>'𤘈','𤜵'=>'𤜵','𤠔'=>'𤠔','𤰶'=>'𤰶','𤲒'=>'𤲒','𤾡'=>'𤾡','𤾸'=>'𤾸','𥁄'=>'𥁄','𥃲'=>'𥃲','𥃳'=>'𥃳','𥄙'=>'𥄙','𥄳'=>'𥄳','𥉉'=>'𥉉','𥐝'=>'𥐝','𥘦'=>'𥘦','𥚚'=>'𥚚','𥛅'=>'𥛅','𥥼'=>'𥥼','𥪧'=>'𥪧','𥪧'=>'𥪧','𥮫'=>'𥮫','𥲀'=>'𥲀','𥳐'=>'𥳐','𥾆'=>'𥾆','𦇚'=>'𦇚','𦈨'=>'𦈨','𦉇'=>'𦉇','𦋙'=>'𦋙','𦌾'=>'𦌾','𦓚'=>'𦓚','𦔣'=>'𦔣','𦖨'=>'𦖨','𦞧'=>'𦞧','𦞵'=>'𦞵','𦬼'=>'𦬼','𦰶'=>'𦰶','𦳕'=>'𦳕','𦵫'=>'𦵫','𦼬'=>'𦼬','𦾱'=>'𦾱','𧃒'=>'𧃒','𧏊'=>'𧏊','𧙧'=>'𧙧','𧢮'=>'𧢮','𧥦'=>'𧥦','𧲨'=>'𧲨','𧻓'=>'𧻓','𧼯'=>'𧼯','𨗒'=>'𨗒','𨗭'=>'𨗭','𨜮'=>'𨜮','𨯺'=>'𨯺','𨵷'=>'𨵷','𩅅'=>'𩅅','𩇟'=>'𩇟','𩈚'=>'𩈚','𩐊'=>'𩐊','𩒖'=>'𩒖','𩖶'=>'𩖶','𩬰'=>'𩬰','𪃎'=>'𪃎','𪄅'=>'𪄅','𪈎'=>'𪈎','𪊑'=>'𪊑','𪎒'=>'𪎒','𪘀'=>'𪘀','℃'=>'°C','℉'=>'°F','ℇ'=>'Ɛ','℻'=>'FAX','ℕ'=>'N','№'=>'No','ℚ'=>'Q','₨'=>'Rs','𝐓'=>'T','℡'=>'TEL','𝐔'=>'U','𝐖'=>'W','₩'=>'W̵','𝐗'=>'X','¥'=>'Y̵','𝚲'=>'Λ','𝚵'=>'Ξ','ℿ'=>'Π','ϲ'=>'c','ϒ'=>'Y','𝚽'=>'Φ','𝚿'=>'Ψ','ѣ'=>'Ь̵','ਃ'=>'ঃ','ಃ'=>'ః','່'=>'่','់'=>'่','້'=>'้','໊'=>'๊','໋'=>'๋','៕'=>'๚','៚'=>'๛','ъ'=>'ˉb','៙'=>'๏','೧'=>'౧','૨'=>'२','೨'=>'౨','૩'=>'३','૪'=>'४','૮'=>'८','೯'=>'౯','а'=>'a','Ꮟ'=>'b','ᖯ'=>'b','с'=>'c','ԁ'=>'d','ᑯ'=>'d','е'=>'e','ә'=>'ǝ','ε'=>'ɛ','є'=>'ɛ','ք'=>'f','ց'=>'g','һ'=>'h','հ'=>'h','Ꮒ'=>'h','Ᏺ'=>'h̔','ι'=>'i','і'=>'i','Ꭵ'=>'i','ј'=>'j','յ'=>'j','ᗰ'=>'m','ո'=>'n','η'=>'n̩','ం'=>'o','ಂ'=>'o','ം'=>'o','०'=>'o','੦'=>'o','૦'=>'o','๐'=>'o','໐'=>'o','ο'=>'o','о'=>'o','օ'=>'o','ဝ'=>'o','ρ'=>'p','р'=>'p','ᴩ'=>'ᴘ','գ'=>'q','κ'=>'ĸ','к'=>'ĸ','ᴦ'=>'r','г'=>'r','ѕ'=>'s','υ'=>'u','ս'=>'u','ν'=>'v','ѵ'=>'v','Ꮃ'=>'w','ᗯ'=>'w','х'=>'x','ᕁ'=>'x','у'=>'y','Ꭹ'=>'y','ӡ'=>'ʒ','ჳ'=>'ʒ','ϩ'=>'ƨ','ь'=>'ƅ','ы'=>'ƅi','ɑ'=>'α','ծ'=>'δ','ᕷ'=>'δ','п'=>'π','ɸ'=>'φ','ф'=>'φ','ʙ'=>'в','ɜ'=>'з','ᴍ'=>'м','ʜ'=>'н','ɢ'=>'ԍ','ᴛ'=>'т','ᴙ'=>'я','ઽ'=>'ऽ','ુ'=>'ु','ૂ'=>'ू','ੋ'=>'ॆ','੍'=>'्','્'=>'्','ഉ'=>'உ','ജ'=>'ஐ','ണ'=>'ண','ഴ'=>'ழ','ി'=>'ி','ു'=>'ூ','ಅ'=>'అ','ಆ'=>'ఆ','ಇ'=>'ఇ','ಒ'=>'ఒ','ಓ'=>'ఒౕ','ಜ'=>'జ','ಞ'=>'ఞ','ಣ'=>'ణ','థ'=>'ధּ','ಯ'=>'య','ఠ'=>'రּ','ಱ'=>'ఱ','ಲ'=>'ల','ඌ'=>'ന്ന','ஶ'=>'ശ','ຈ'=>'จ','ບ'=>'บ','ປ'=>'ป','ຝ'=>'ฝ','ພ'=>'พ','ຟ'=>'ฟ','ຍ'=>'ย','។'=>'ฯ','ិ'=>'ิ','ី'=>'ี','ឹ'=>'ึ','ឺ'=>'ื','ຸ'=>'ุ','ູ'=>'ู','ᗅ'=>'A','ᒍ'=>'J','ᕼ'=>'H','ᐯ'=>'V','ᑭ'=>'P','ᗷ'=>'B','ヘ'=>'へ','𐏑'=>'𐎂','𐏓'=>'𐎓','𒀸'=>'𐎚','ᅳ'=>'一','ǀ'=>'丨','ᅵ'=>'丨','Ꭺ'=>'A','Ᏼ'=>'B','Ꮯ'=>'C','ᗞ'=>'D','Ꭼ'=>'E','ᖴ'=>'F','Ꮐ'=>'G','Ꮋ'=>'H','Ꭻ'=>'J','Ꮶ'=>'K','Ꮮ'=>'L','Ꮇ'=>'M','Ꮲ'=>'P','ᖇ'=>'R','Ꮥ'=>'S','Ꮩ'=>'V','Ꮓ'=>'Z'); \ No newline at end of file
+<?php return array('¡'=>'i','ǃ'=>'!','α'=>'a',' '=>' ','­'=>'','۝'=>'','܏'=>'','᠆'=>'','᠎'=>'','​'=>'','‌'=>'','‍'=>'','
'=>'','
'=>'','⁠'=>'','⁡'=>'','⁢'=>'','⁣'=>'',''=>'',''=>'',''=>'',''=>'',''=>'',''=>'',''=>'',''=>'',''=>'',''=>'',''=>'','𝅳'=>'','𝅴'=>'','𝅵'=>'','𝅶'=>'','𝅷'=>'','𝅸'=>'','𝅹'=>'','𝅺'=>'','۬'=>'۟','̓'=>'̓','ُ'=>'̓','֜'=>'́','́'=>'́','݇'=>'́','॔'=>'́','̀'=>'̀','॓'=>'̀','̌'=>'̆','̑'=>'̂','֯'=>'̊','ஂ'=>'̊','ํ'=>'̊','ໍ'=>'̊','ံ'=>'̊','ំ'=>'̊','៓'=>'̊','゚'=>'̊','゚'=>'̊','ͦ'=>'̊','͂'=>'̃','ׄ'=>'̇','ֹ'=>'̇','ׂ'=>'̇','ׁ'=>'̇','݁'=>'̇','ं'=>'̇','ਂ'=>'̇','ં'=>'̇','்'=>'̇','̅'=>'̄','〬'=>'̉','̱'=>'̠','॒'=>'̠','̧'=>'̡','̦'=>'̡','̨'=>'̢','़'=>'̣','়'=>'̣','਼'=>'̣','઼'=>'̣','଼'=>'̣','͇'=>'̳','̶'=>'̵','ﱞ'=>'ﹲّ','ﱟ'=>'ﹴّ','ﳲ'=>'ﹷّ','ﱠ'=>'ﹶّ','ﳳ'=>'ﹹّ','ﱡ'=>'ﹸّ','ﳴ'=>'ﹻّ','ﱢ'=>'ﹺّ','ﱣ'=>'ﹼٰ','ٴ'=>'ٔ','݂'=>'ܼ','౦'=>'o','೦'=>'o','゙'=>'゙',' '=>' ',' '=>' ',' '=>' ',' '=>' ',' '=>' ',' '=>' ',' '=>' ',' '=>' ',' '=>' ',' '=>' ',' '=>' ',' '=>' ',' '=>' ',' '=>' ',' '=>' ','`'=>'`','`'=>'`','῀'=>'˜','^'=>'^','︿'=>'^','_'=>'_','﹍'=>'_','﹎'=>'_','﹏'=>'_','⌇'=>'︴','-'=>'-','‐'=>'-','‑'=>'-','‒'=>'-','–'=>'-','﹘'=>'-','∼'=>'⁓','・'=>'・','•'=>'・',','=>',','‚'=>',','٬'=>'،','、'=>'、',';'=>';',';'=>';',':'=>':','։'=>':','︰'=>':','׃'=>':','⩴'=>'::=','.'=>'.','․'=>'.','܂'=>'.','‥'=>'..','…'=>'...','。'=>'。','·'=>'·','‧'=>'·','∙'=>'·','⋅'=>'·','ᐧ'=>'·','ᔯ'=>'·4','ᐌ'=>'·ᐁ','ᐎ'=>'·ᐃ','ᐐ'=>'·ᐄ','ᐒ'=>'·ᐅ','ᐔ'=>'·ᐆ','ᐗ'=>'·ᐊ','ᐙ'=>'·ᐋ','ᐷ'=>'·ᐳ','ᑀ'=>'·ᐳ','ᑂ'=>'·ᐴ','ᑄ'=>'·ᐸ','ᑆ'=>'·ᐹ','ᑗ'=>'·ᑌ','ᑙ'=>'·ᑎ','ᑛ'=>'·ᑏ','ᑔ'=>'·ᑐ','ᑝ'=>'·ᑐ','ᑟ'=>'·ᑑ','ᑡ'=>'·ᑕ','ᑣ'=>'·ᑖ','ᑴ'=>'·ᑫ','ᑸ'=>'·ᑮ','ᑼ'=>'·ᑰ','ᑾ'=>'·ᑲ','ᒀ'=>'·ᑳ','ᒒ'=>'·ᒉ','ᒔ'=>'·ᒋ','ᒖ'=>'·ᒌ','ᒚ'=>'·ᒎ','ᒜ'=>'·ᒐ','ᒞ'=>'·ᒑ','ᒬ'=>'·ᒣ','ᒮ'=>'·ᒥ','ᒰ'=>'·ᒦ','ᒲ'=>'·ᒧ','ᒴ'=>'·ᒨ','ᒶ'=>'·L','ᒸ'=>'·ᒫ','ᓉ'=>'·ᓀ','ᓋ'=>'·ᓇ','ᓍ'=>'·ᓈ','ᓜ'=>'·ᓓ','ᓞ'=>'·ᓕ','ᓠ'=>'·ᓖ','ᓢ'=>'·ᓗ','ᓤ'=>'·ᓘ','ᓦ'=>'·ᓚ','ᓨ'=>'·ᓛ','ᓶ'=>'·ᓭ','ᓸ'=>'·ᓯ','ᓺ'=>'·ᓰ','ᓼ'=>'·ᓱ','ᓾ'=>'·ᓲ','ᔀ'=>'·ᓴ','ᔂ'=>'·ᓵ','ᔗ'=>'·ᔐ','ᔙ'=>'·ᔑ','ᔛ'=>'·ᔒ','ᔝ'=>'·ᔓ','ᔟ'=>'·ᔔ','ᔡ'=>'·ᔕ','ᔣ'=>'·ᔖ','ᔱ'=>'·ᔨ','ᔳ'=>'·ᔩ','ᔵ'=>'·ᔪ','ᔷ'=>'·ᔫ','ᔹ'=>'·ᔭ','ᔻ'=>'·ᔮ','ᕎ'=>'·ᕌ','ᕛ'=>'·ᕚ','ᕨ'=>'·ᕧ','('=>'(','⑴'=>'(1)','⒧'=>'(l)','⑽'=>'(10)','⑾'=>'(11)','⑿'=>'(12)','⒀'=>'(13)','⒁'=>'(14)','⒂'=>'(15)','⒃'=>'(16)','⒄'=>'(17)','⒅'=>'(18)','⒆'=>'(19)','⑵'=>'(2)','⒇'=>'(20)','⑶'=>'(3)','⑷'=>'(4)','⑸'=>'(5)','⑹'=>'(6)','⑺'=>'(7)','⑻'=>'(8)','⑼'=>'(9)','⒜'=>'(a)','⒝'=>'(b)','⒞'=>'(c)','⒟'=>'(d)','⒠'=>'(e)','⒡'=>'(f)','⒢'=>'(g)','⒣'=>'(h)','⒤'=>'(i)','⒥'=>'(j)','⒦'=>'(k)','⒨'=>'(m)','⒩'=>'(n)','⒪'=>'(o)','⒫'=>'(p)','⒬'=>'(q)','⒭'=>'(r)','⒮'=>'(s)','⒯'=>'(t)','⒰'=>'(u)','⒱'=>'(v)','⒲'=>'(w)','⒳'=>'(x)','⒴'=>'(y)','⒵'=>'(z)','㈀'=>'(ᄀ)','㈎'=>'(가)','㈁'=>'(ᄂ)','㈏'=>'(나)','㈂'=>'(ᄃ)','㈐'=>'(다)','㈃'=>'(ᄅ)','㈑'=>'(라)','㈄'=>'(ᄆ)','㈒'=>'(마)','㈅'=>'(ᄇ)','㈓'=>'(바)','㈆'=>'(ᄉ)','㈔'=>'(사)','㈇'=>'(ᄋ)','㈕'=>'(아)','㈝'=>'(오전)','㈞'=>'(오후)','㈈'=>'(ᄌ)','㈖'=>'(자)','㈜'=>'(주)','㈉'=>'(ᄎ)','㈗'=>'(차)','㈊'=>'(ᄏ)','㈘'=>'(카)','㈋'=>'(ᄐ)','㈙'=>'(타)','㈌'=>'(ᄑ)','㈚'=>'(파)','㈍'=>'(ᄒ)','㈛'=>'(하)','㈠'=>'(一)','㈦'=>'(七)','㈢'=>'(三)','㈨'=>'(九)','㈡'=>'(二)','㈤'=>'(五)','㈹'=>'(代)','㈽'=>'(企)','㉁'=>'(休)','㈧'=>'(八)','㈥'=>'(六)','㈸'=>'(労)','㈩'=>'(十)','㈿'=>'(協)','㈴'=>'(名)','㈺'=>'(呼)','㈣'=>'(四)','㈯'=>'(土)','㈻'=>'(学)','㈰'=>'(日)','㈪'=>'(月)','㈲'=>'(有)','㈭'=>'(木)','㈱'=>'(株)','㈬'=>'(水)','㈫'=>'(火)','㈵'=>'(特)','㈼'=>'(監)','㈳'=>'(社)','㈷'=>'(祝)','㉀'=>'(祭)','㉂'=>'(自)','㉃'=>'(至)','㈶'=>'(財)','㈾'=>'(資)','㈮'=>'(金)',')'=>')','['=>'[','〔'=>'[',']'=>']','〕'=>']','{'=>'{','}'=>'}','⦅'=>'⦅','⦆'=>'⦆','「'=>'「','」'=>'」','@'=>'@','*'=>'*','/'=>'/','⁄'=>'/','∕'=>'/','\'=>'\\','&'=>'&','#'=>'#','%'=>'%','‶'=>'‵‵','‷'=>'‵‵‵','༌'=>'་','´'=>'ʹ','΄'=>'ʹ','´'=>'ʹ','\''=>'ʹ','''=>'ʹ','′'=>'ʹ','׳'=>'ʹ','ʹ'=>'ʹ','ˊ'=>'ʹ','"'=>'ʹʹ','"'=>'ʹʹ','″'=>'ʹʹ','〃'=>'ʹʹ','״'=>'ʹʹ','ʺ'=>'ʹʹ','‴'=>'ʹʹʹ','⁗'=>'ʹʹʹʹ','¯'=>'ˉ',' ̄'=>'ˉ','‾'=>'ˉ','﹉'=>'ˉ','﹊'=>'ˉ','﹋'=>'ˉ','﹌'=>'ˉ','˚'=>'°','௵'=>'௳','←'=>'←','→'=>'→','↑'=>'↑','↓'=>'↓','↵'=>'↲','⨡'=>'↾','𝛛'=>'∂','𝜕'=>'∂','𝝏'=>'∂','𝞉'=>'∂','𝟃'=>'∂','𝛁'=>'∇','𝛻'=>'∇','𝜵'=>'∇','𝝯'=>'∇','𝞩'=>'∇','+'=>'+','﬩'=>'+','‹'=>'<','<'=>'<','='=>'=','⩵'=>'==','⩶'=>'===','›'=>'>','>'=>'>','¬'=>'¬','¦'=>'¦','〜'=>'~','~'=>'~','﹨'=>'∖','⋀'=>'∧','⋁'=>'∨','⋂'=>'∩','⋃'=>'∪','∯'=>'∮∮','∰'=>'∮∮∮','≣'=>'≡','♁'=>'⊕','☉'=>'⊙','⟂'=>'⊥','▷'=>'⊲','⨝'=>'⋈','⨽'=>'⌙','☸'=>'⎈','⎮'=>'⎥','│'=>'│','▐'=>'▌','■'=>'■','☐'=>'□','○'=>'○','⦾'=>'◎','〛'=>'⟧','〈'=>'⟨','〈'=>'⟨','〉'=>'⟩','〉'=>'⟩','⧙'=>'⦚','〶'=>'〒','ー'=>'ー','¢'=>'¢','$'=>'$','£'=>'£','¥'=>'Y̵','₩'=>'W̵','0'=>'0','𝟎'=>'0','𝟘'=>'0','𝟢'=>'0','𝟬'=>'0','𝟶'=>'0','০'=>'0','୦'=>'0','௦'=>'0','᠐'=>'0','〇'=>'0','𝐎'=>'0','𝑂'=>'0','𝑶'=>'0','𝒪'=>'0','𝓞'=>'0','𝔒'=>'0','𝕆'=>'0','𝕺'=>'0','𝖮'=>'0','𝗢'=>'0','𝘖'=>'0','𝙊'=>'0','𝙾'=>'0','𝚶'=>'0','𝛰'=>'0','𝜪'=>'0','𝝤'=>'0','𝞞'=>'0','ⵔ'=>'0','ഠ'=>'0','⊖'=>'0̵','𝚯'=>'0̵','𝚹'=>'0̵','𝛩'=>'0̵','𝛳'=>'0̵','𝜣'=>'0̵','𝜭'=>'0̵','𝝝'=>'0̵','𝝧'=>'0̵','𝞗'=>'0̵','𝞡'=>'0̵','ⴱ'=>'0̵','Ꮎ'=>'0̵','۰'=>'٠','᭜'=>'᭐','㍘'=>'0点','1'=>'1','𝟏'=>'1','𝟙'=>'1','𝟣'=>'1','𝟭'=>'1','𝟷'=>'1','ℐ'=>'1','ℑ'=>'1','𝐈'=>'1','𝐼'=>'1','𝑰'=>'1','𝓘'=>'1','𝕀'=>'1','𝕴'=>'1','𝖨'=>'1','𝗜'=>'1','𝘐'=>'1','𝙄'=>'1','𝙸'=>'1','l'=>'l','l'=>'l','ⅼ'=>'1','ℓ'=>'l','𝐥'=>'l','𝑙'=>'l','𝒍'=>'l','𝓁'=>'l','𝓵'=>'l','𝔩'=>'l','𝕝'=>'l','𝖑'=>'l','𝗅'=>'l','𝗹'=>'l','𝘭'=>'l','𝙡'=>'l','𝚕'=>'l','𝚰'=>'l','𝛪'=>'l','𝜤'=>'l','𝝞'=>'l','𝞘'=>'l','①'=>'➀','ɭ'=>'l̢','ɫ'=>'l̴','ƚ'=>'l̵','ł'=>'l̷','۱'=>'١','⒈'=>'1.','ŀ'=>'l·','ᒷ'=>'1·','⑩'=>'➉','⒑'=>'10.','㏩'=>'10日','㋉'=>'10月','㍢'=>'10点','⒒'=>'11.','㏪'=>'11日','㋊'=>'11月','㍣'=>'11点','⒓'=>'12.','㏫'=>'12日','㋋'=>'12月','㍤'=>'12点','⒔'=>'13.','㏬'=>'13日','㍥'=>'13点','⒕'=>'14.','㏭'=>'14日','㍦'=>'14点','⒖'=>'15.','㏮'=>'15日','㍧'=>'15点','⒗'=>'16.','㏯'=>'16日','㍨'=>'16点','⒘'=>'17.','㏰'=>'17日','㍩'=>'17点','⒙'=>'18.','㏱'=>'18日','㍪'=>'18点','⒚'=>'19.','㏲'=>'19日','㍫'=>'19点','lj'=>'lj','㏠'=>'1日','㋀'=>'1月','㍙'=>'1点','2'=>'2','𝟐'=>'2','𝟚'=>'2','𝟤'=>'2','𝟮'=>'2','𝟸'=>'2','ᒿ'=>'2','②'=>'➁','۲'=>'٢','⒉'=>'2.','⒛'=>'20.','㏳'=>'20日','㍬'=>'20点','㏴'=>'21日','㍭'=>'21点','㏵'=>'22日','㍮'=>'22点','㏶'=>'23日','㍯'=>'23点','㏷'=>'24日','㍰'=>'24点','㏸'=>'25日','㏹'=>'26日','㏺'=>'27日','㏻'=>'28日','㏼'=>'29日','㏡'=>'2日','㋁'=>'2月','㍚'=>'2点','3'=>'3','𝟑'=>'3','𝟛'=>'3','𝟥'=>'3','𝟯'=>'3','𝟹'=>'3','③'=>'➂','۳'=>'٣','⒊'=>'3.','㏽'=>'30日','㏾'=>'31日','㏢'=>'3日','㋂'=>'3月','㍛'=>'3点','4'=>'4','𝟒'=>'4','𝟜'=>'4','𝟦'=>'4','𝟰'=>'4','𝟺'=>'4','Ꮞ'=>'4','④'=>'➃','⒋'=>'4.','ᔰ'=>'4·','㏣'=>'4日','㋃'=>'4月','㍜'=>'4点','5'=>'5','𝟓'=>'5','𝟝'=>'5','𝟧'=>'5','𝟱'=>'5','𝟻'=>'5','⑤'=>'➄','⒌'=>'5.','㏤'=>'5日','㋄'=>'5月','㍝'=>'5点','6'=>'6','𝟔'=>'6','𝟞'=>'6','𝟨'=>'6','𝟲'=>'6','𝟼'=>'6','б'=>'6','⑥'=>'➅','⒍'=>'6.','㏥'=>'6日','㋅'=>'6月','㍞'=>'6点','7'=>'7','𝟕'=>'7','𝟟'=>'7','𝟩'=>'7','𝟳'=>'7','𝟽'=>'7','⑦'=>'➆','۷'=>'٧','⒎'=>'7.','㏦'=>'7日','㋆'=>'7月','㍟'=>'7点','ଃ'=>'8','৪'=>'8','੪'=>'8','8'=>'8','𝟖'=>'8','𝟠'=>'8','𝟪'=>'8','𝟴'=>'8','𝟾'=>'8','ȣ'=>'8','⑧'=>'➇','۸'=>'٨','⒏'=>'8.','㏧'=>'8日','㋇'=>'8月','㍠'=>'8点','੧'=>'9','୨'=>'9','৭'=>'9','9'=>'9','𝟗'=>'9','𝟡'=>'9','𝟫'=>'9','𝟵'=>'9','𝟿'=>'9','⑨'=>'➈','۹'=>'٩','⒐'=>'9.','㏨'=>'9日','㋈'=>'9月','㍡'=>'9点','a'=>'a','𝐚'=>'a','𝑎'=>'a','𝒂'=>'a','𝒶'=>'a','𝓪'=>'a','𝔞'=>'a','𝕒'=>'a','𝖆'=>'a','𝖺'=>'a','𝗮'=>'a','𝘢'=>'a','𝙖'=>'a','𝚊'=>'a','℀'=>'a/c','℁'=>'a/s','æ'=>'ae','b'=>'b','𝐛'=>'b','𝑏'=>'b','𝒃'=>'b','𝒷'=>'b','𝓫'=>'b','𝔟'=>'b','𝕓'=>'b','𝖇'=>'b','𝖻'=>'b','𝗯'=>'b','𝘣'=>'b','𝙗'=>'b','𝚋'=>'b','ɓ'=>'b̔','ƃ'=>'b̄','ƀ'=>'b̵','c'=>'c','ⅽ'=>'c','𝐜'=>'c','𝑐'=>'c','𝒄'=>'c','𝒸'=>'c','𝓬'=>'c','𝔠'=>'c','𝕔'=>'c','𝖈'=>'c','𝖼'=>'c','𝗰'=>'c','𝘤'=>'c','𝙘'=>'c','𝚌'=>'c','𝛓'=>'c','𝜍'=>'c','𝝇'=>'c','𝞁'=>'c','𝞻'=>'c','℅'=>'c/o','℆'=>'c/u','d'=>'d','ⅾ'=>'d','ⅆ'=>'d','𝐝'=>'d','𝑑'=>'d','𝒅'=>'d','𝒹'=>'d','𝓭'=>'d','𝔡'=>'d','𝕕'=>'d','𝖉'=>'d','𝖽'=>'d','𝗱'=>'d','𝘥'=>'d','𝙙'=>'d','𝚍'=>'d','ɗ'=>'d̔','ƌ'=>'d̄','ɖ'=>'d̢','đ'=>'d̵','dz'=>'dz','dž'=>'dž','e'=>'e','ℯ'=>'e','ⅇ'=>'e','𝐞'=>'e','𝑒'=>'e','𝒆'=>'e','𝓮'=>'e','𝔢'=>'e','𝕖'=>'e','𝖊'=>'e','𝖾'=>'e','𝗲'=>'e','𝘦'=>'e','𝙚'=>'e','𝚎'=>'e','ⴹ'=>'E','ə'=>'ǝ','ɚ'=>'ǝ˞','⋴'=>'ɛ','𝛆'=>'ɛ','𝛜'=>'ɛ','𝜀'=>'ɛ','𝜖'=>'ɛ','𝜺'=>'ɛ','𝝐'=>'ɛ','𝝴'=>'ɛ','𝞊'=>'ɛ','𝞮'=>'ɛ','𝟄'=>'ɛ','f'=>'f','𝐟'=>'f','𝑓'=>'f','𝒇'=>'f','𝒻'=>'f','𝓯'=>'f','𝔣'=>'f','𝕗'=>'f','𝖋'=>'f','𝖿'=>'f','𝗳'=>'f','𝘧'=>'f','𝙛'=>'f','𝚏'=>'f','ƒ'=>'f̡','g'=>'g','ℊ'=>'g','𝐠'=>'g','𝑔'=>'g','𝒈'=>'g','𝓰'=>'g','𝔤'=>'g','𝕘'=>'g','𝖌'=>'g','𝗀'=>'g','𝗴'=>'g','𝘨'=>'g','𝙜'=>'g','𝚐'=>'g','ɡ'=>'g','ɠ'=>'g̔','ǥ'=>'g̵','h'=>'h','ℎ'=>'h','𝐡'=>'h','𝒉'=>'h','𝒽'=>'h','𝓱'=>'h','𝔥'=>'h','𝕙'=>'h','𝖍'=>'h','𝗁'=>'h','𝗵'=>'h','𝘩'=>'h','𝙝'=>'h','𝚑'=>'h','ɦ'=>'h̔','ħ'=>'h̵','ℏ'=>'h̵','῾'=>'ʻ','‘'=>'ʻ','‛'=>'ʻ','ʽ'=>'ʻ','⍳'=>'i','i'=>'i','ⅰ'=>'i','ℹ'=>'i','ⅈ'=>'i','𝐢'=>'i','𝑖'=>'i','𝒊'=>'i','𝒾'=>'i','𝓲'=>'i','𝔦'=>'i','𝕚'=>'i','𝖎'=>'i','𝗂'=>'i','𝗶'=>'i','𝘪'=>'i','𝙞'=>'i','𝚒'=>'i','ı'=>'i','𝚤'=>'i','ɪ'=>'i','ɩ'=>'i','𝛊'=>'i','𝜄'=>'i','𝜾'=>'i','𝝸'=>'i','𝞲'=>'i','ɨ'=>'i̵','ⅱ'=>'ii','ⅲ'=>'iii','ij'=>'ij','ⅳ'=>'iv','ⅸ'=>'ix','j'=>'j','ⅉ'=>'j','𝐣'=>'j','𝑗'=>'j','𝒋'=>'j','𝒿'=>'j','𝓳'=>'j','𝔧'=>'j','𝕛'=>'j','𝖏'=>'j','𝗃'=>'j','𝗷'=>'j','𝘫'=>'j','𝙟'=>'j','𝚓'=>'j','ϳ'=>'j','𝚥'=>'ȷ','k'=>'k','𝐤'=>'k','𝑘'=>'k','𝒌'=>'k','𝓀'=>'k','𝓴'=>'k','𝔨'=>'k','𝕜'=>'k','𝖐'=>'k','𝗄'=>'k','𝗸'=>'k','𝘬'=>'k','𝙠'=>'k','𝚔'=>'k','ƙ'=>'k̔','m'=>'m','ⅿ'=>'m','𝐦'=>'m','𝑚'=>'m','𝒎'=>'m','𝓂'=>'m','𝓶'=>'m','𝔪'=>'m','𝕞'=>'m','𝖒'=>'m','𝗆'=>'m','𝗺'=>'m','𝘮'=>'m','𝙢'=>'m','𝚖'=>'m','ɱ'=>'m̡','n'=>'n','𝐧'=>'n','𝑛'=>'n','𝒏'=>'n','𝓃'=>'n','𝓷'=>'n','𝔫'=>'n','𝕟'=>'n','𝖓'=>'n','𝗇'=>'n','𝗻'=>'n','𝘯'=>'n','𝙣'=>'n','𝚗'=>'n','𝐍'=>'N','𝑁'=>'N','𝑵'=>'N','𝒩'=>'N','𝓝'=>'N','𝔑'=>'N','𝕹'=>'N','𝖭'=>'N','𝗡'=>'N','𝘕'=>'N','𝙉'=>'N','𝙽'=>'N','𝚴'=>'N','𝛮'=>'N','𝜨'=>'N','𝝢'=>'N','𝞜'=>'N','ɲ'=>'ņ','ɳ'=>'n̢','ƞ'=>'n̩','𝛈'=>'n̩','𝜂'=>'n̩','𝜼'=>'n̩','𝝶'=>'n̩','𝞰'=>'n̩','nj'=>'nj','o'=>'o','ℴ'=>'o','𝐨'=>'o','𝑜'=>'o','𝒐'=>'o','𝓸'=>'o','𝔬'=>'o','𝕠'=>'o','𝖔'=>'o','𝗈'=>'o','𝗼'=>'o','𝘰'=>'o','𝙤'=>'o','𝚘'=>'o','ᴏ'=>'o','𝛐'=>'o','𝜊'=>'o','𝝄'=>'o','𝝾'=>'o','𝞸'=>'o','ɵ'=>'o̵','ǿ'=>'ó̵','ø'=>'o̷','œ'=>'oe','ơ'=>'oʼ','⍴'=>'p','p'=>'p','𝐩'=>'p','𝑝'=>'p','𝒑'=>'p','𝓅'=>'p','𝓹'=>'p','𝔭'=>'p','𝕡'=>'p','𝖕'=>'p','𝗉'=>'p','𝗽'=>'p','𝘱'=>'p','𝙥'=>'p','𝚙'=>'p','𝛒'=>'p','𝛠'=>'p','𝜌'=>'p','𝜚'=>'p','𝝆'=>'p','𝝔'=>'p','𝞀'=>'p','𝞎'=>'p','𝞺'=>'p','𝟈'=>'p','ƥ'=>'p̔','q'=>'q','𝐪'=>'q','𝑞'=>'q','𝒒'=>'q','𝓆'=>'q','𝓺'=>'q','𝔮'=>'q','𝕢'=>'q','𝖖'=>'q','𝗊'=>'q','𝗾'=>'q','𝘲'=>'q','𝙦'=>'q','𝚚'=>'q','𝐐'=>'Q','𝑄'=>'Q','𝑸'=>'Q','𝒬'=>'Q','𝓠'=>'Q','𝔔'=>'Q','𝕼'=>'Q','𝖰'=>'Q','𝗤'=>'Q','𝘘'=>'Q','𝙌'=>'Q','𝚀'=>'Q','ʠ'=>'q̔','𝛋'=>'ĸ','𝛞'=>'ĸ','𝜅'=>'ĸ','𝜘'=>'ĸ','𝜿'=>'ĸ','𝝒'=>'ĸ','𝝹'=>'ĸ','𝞌'=>'ĸ','𝞳'=>'ĸ','𝟆'=>'ĸ','r'=>'r','𝐫'=>'r','𝑟'=>'r','𝒓'=>'r','𝓇'=>'r','𝓻'=>'r','𝔯'=>'r','𝕣'=>'r','𝖗'=>'r','𝗋'=>'r','𝗿'=>'r','𝘳'=>'r','𝙧'=>'r','𝚛'=>'r','ɽ'=>'r̢','ɼ'=>'r̩','s'=>'s','𝐬'=>'s','𝑠'=>'s','𝒔'=>'s','𝓈'=>'s','𝓼'=>'s','𝔰'=>'s','𝕤'=>'s','𝖘'=>'s','𝗌'=>'s','𝘀'=>'s','𝘴'=>'s','𝙨'=>'s','𝚜'=>'s','ƽ'=>'s','ʂ'=>'s̢','∫'=>'ʃ','∬'=>'ʃʃ','∭'=>'ʃʃʃ','⨌'=>'ʃʃʃʃ','t'=>'t','𝐭'=>'t','𝑡'=>'t','𝒕'=>'t','𝓉'=>'t','𝓽'=>'t','𝔱'=>'t','𝕥'=>'t','𝖙'=>'t','𝗍'=>'t','𝘁'=>'t','𝘵'=>'t','𝙩'=>'t','𝚝'=>'t','𝑇'=>'T','𝑻'=>'T','𝒯'=>'T','𝓣'=>'T','𝔗'=>'T','𝕋'=>'T','𝕿'=>'T','𝖳'=>'T','𝗧'=>'T','𝘛'=>'T','𝙏'=>'T','𝚃'=>'T','𝚻'=>'T','𝛵'=>'T','𝜯'=>'T','𝝩'=>'T','𝞣'=>'T','ƭ'=>'t̔','ț'=>'ţ','ƫ'=>'ţ','ŧ'=>'t̵','u'=>'u','𝐮'=>'u','𝑢'=>'u','𝒖'=>'u','𝓊'=>'u','𝓾'=>'u','𝔲'=>'u','𝕦'=>'u','𝖚'=>'u','𝗎'=>'u','𝘂'=>'u','𝘶'=>'u','𝙪'=>'u','𝚞'=>'u','ʊ'=>'u','ʋ'=>'u','𝛖'=>'u','𝜐'=>'u','𝝊'=>'u','𝞄'=>'u','𝞾'=>'u','𝑈'=>'U','𝑼'=>'U','𝒰'=>'U','𝓤'=>'U','𝔘'=>'U','𝕌'=>'U','𝖀'=>'U','𝖴'=>'U','𝗨'=>'U','𝘜'=>'U','𝙐'=>'U','𝚄'=>'U','v'=>'v','ⅴ'=>'v','𝐯'=>'v','𝑣'=>'v','𝒗'=>'v','𝓋'=>'v','𝓿'=>'v','𝔳'=>'v','𝕧'=>'v','𝖛'=>'v','𝗏'=>'v','𝘃'=>'v','𝘷'=>'v','𝙫'=>'v','𝚟'=>'v','𝛎'=>'v','𝜈'=>'v','𝝂'=>'v','𝝼'=>'v','𝞶'=>'v','ⅵ'=>'vi','ⅶ'=>'vii','ⅷ'=>'viii','ɯ'=>'w','w'=>'w','𝐰'=>'w','𝑤'=>'w','𝒘'=>'w','𝓌'=>'w','𝔀'=>'w','𝔴'=>'w','𝕨'=>'w','𝖜'=>'w','𝗐'=>'w','𝘄'=>'w','𝘸'=>'w','𝙬'=>'w','𝚠'=>'w','𝑊'=>'W','𝑾'=>'W','𝒲'=>'W','𝓦'=>'W','𝔚'=>'W','𝕎'=>'W','𝖂'=>'W','𝖶'=>'W','𝗪'=>'W','𝘞'=>'W','𝙒'=>'W','𝚆'=>'W','×'=>'x','x'=>'x','ⅹ'=>'x','𝐱'=>'x','𝑥'=>'x','𝒙'=>'x','𝓍'=>'x','𝔁'=>'x','𝔵'=>'x','𝕩'=>'x','𝖝'=>'x','𝗑'=>'x','𝘅'=>'x','𝘹'=>'x','𝙭'=>'x','𝚡'=>'x','᙭'=>'X','𝑋'=>'X','𝑿'=>'X','𝒳'=>'X','𝓧'=>'X','𝔛'=>'X','𝕏'=>'X','𝖃'=>'X','𝖷'=>'X','𝗫'=>'X','𝘟'=>'X','𝙓'=>'X','𝚇'=>'X','𝚾'=>'X','𝛸'=>'X','𝜲'=>'X','𝝬'=>'X','𝞦'=>'X','ⅺ'=>'xi','ⅻ'=>'xii','y'=>'y','𝐲'=>'y','𝑦'=>'y','𝒚'=>'y','𝓎'=>'y','𝔂'=>'y','𝔶'=>'y','𝕪'=>'y','𝖞'=>'y','𝗒'=>'y','𝘆'=>'y','𝘺'=>'y','𝙮'=>'y','𝚢'=>'y','ƴ'=>'y̔','z'=>'z','𝐳'=>'z','𝑧'=>'z','𝒛'=>'z','𝓏'=>'z','𝔃'=>'z','𝔷'=>'z','𝕫'=>'z','𝖟'=>'z','𝗓'=>'z','𝘇'=>'z','𝘻'=>'z','𝙯'=>'z','𝚣'=>'z','ȥ'=>'z̡','ʐ'=>'z̢','ƶ'=>'z̵','ȝ'=>'ʒ','?'=>'ʔ','?'=>'ʔ','⁇'=>'ʔʔ','⁈'=>'ʔǃ','᾽'=>'ʼ','᾿'=>'ʼ','’'=>'ʼ','ʾ'=>'ʼ','!'=>'ǃ','!'=>'ǃ','⁉'=>'ǃʔ','‼'=>'ǃǃ','⍺'=>'α','𝛂'=>'α','𝛼'=>'α','𝜶'=>'α','𝝰'=>'α','𝞪'=>'α','𝛃'=>'β','𝛽'=>'β','𝜷'=>'β','𝝱'=>'β','𝞫'=>'β','ℽ'=>'γ','𝛄'=>'γ','𝛾'=>'γ','𝜸'=>'γ','𝝲'=>'γ','𝞬'=>'γ','𝛅'=>'δ','𝛿'=>'δ','𝜹'=>'δ','𝝳'=>'δ','𝞭'=>'δ','𝟋'=>'ϝ','𝛇'=>'ζ','𝜁'=>'ζ','𝜻'=>'ζ','𝝵'=>'ζ','𝞯'=>'ζ','⍬'=>'θ','𝛉'=>'θ','𝛝'=>'θ','𝜃'=>'θ','𝜗'=>'θ','𝜽'=>'θ','𝝑'=>'θ','𝝷'=>'θ','𝞋'=>'θ','𝞱'=>'θ','𝟅'=>'θ','𝛌'=>'λ','𝜆'=>'λ','𝝀'=>'λ','𝝺'=>'λ','𝞴'=>'λ','𝛬'=>'Λ','𝜦'=>'Λ','𝝠'=>'Λ','𝞚'=>'Λ','𝛍'=>'μ','𝜇'=>'μ','𝝁'=>'μ','𝝻'=>'μ','𝞵'=>'μ','𝛏'=>'ξ','𝜉'=>'ξ','𝝃'=>'ξ','𝝽'=>'ξ','𝞷'=>'ξ','𝛯'=>'Ξ','𝜩'=>'Ξ','𝝣'=>'Ξ','𝞝'=>'Ξ','ℼ'=>'π','𝛑'=>'π','𝛡'=>'π','𝜋'=>'π','𝜛'=>'π','𝝅'=>'π','𝝕'=>'π','𝝿'=>'π','𝞏'=>'π','𝞹'=>'π','𝟉'=>'π','ᴨ'=>'π','∏'=>'Π','𝚷'=>'Π','𝛱'=>'Π','𝜫'=>'Π','𝝥'=>'Π','𝞟'=>'Π','𝛔'=>'σ','𝜎'=>'σ','𝝈'=>'σ','𝞂'=>'σ','𝞼'=>'σ','𝛕'=>'τ','𝜏'=>'τ','𝝉'=>'τ','𝞃'=>'τ','𝞽'=>'τ','𝐘'=>'Y','𝑌'=>'Y','𝒀'=>'Y','𝒴'=>'Y','𝓨'=>'Y','𝔜'=>'Y','𝕐'=>'Y','𝖄'=>'Y','𝖸'=>'Y','𝗬'=>'Y','𝘠'=>'Y','𝙔'=>'Y','𝚈'=>'Y','𝚼'=>'Y','𝛶'=>'Y','𝜰'=>'Y','𝝪'=>'Y','𝞤'=>'Y','𝛗'=>'φ','𝛟'=>'φ','𝜑'=>'φ','𝜙'=>'φ','𝝋'=>'φ','𝝓'=>'φ','𝞅'=>'φ','𝞍'=>'φ','𝞿'=>'φ','𝟇'=>'φ','𝛷'=>'Φ','𝜱'=>'Φ','𝝫'=>'Φ','𝞥'=>'Φ','𝛘'=>'χ','𝜒'=>'χ','𝝌'=>'χ','𝞆'=>'χ','𝟀'=>'χ','𝛙'=>'ψ','𝜓'=>'ψ','𝝍'=>'ψ','𝞇'=>'ψ','𝟁'=>'ψ','𝛹'=>'Ψ','𝜳'=>'Ψ','𝝭'=>'Ψ','𝞧'=>'Ψ','⍵'=>'ω','𝛚'=>'ω','𝜔'=>'ω','𝝎'=>'ω','𝞈'=>'ω','𝟂'=>'ω','ӕ'=>'ae','ғ'=>'r̵','ґ'=>'rᑊ','җ'=>'ж̩','ҙ'=>'з̡','ӏ'=>'i','ҋ'=>'й̡','қ'=>'ĸ̩','ҟ'=>'ĸ̵','ᴫ'=>'л','ӆ'=>'л̡','ӎ'=>'м̡','ӊ'=>'н̡','ӈ'=>'н̡','ң'=>'н̩','ө'=>'o̵','ѳ'=>'o̵','ҫ'=>'c̡','ҭ'=>'т̩','ү'=>'y','ұ'=>'y̵','ћ'=>'h̵','ѽ'=>'ѡ҃','ӌ'=>'ҷ','ҿ'=>'ҽ̢','ҍ'=>'Ь̵','զ'=>'q','ռ'=>'n','ℵ'=>'א','ﬡ'=>'א','אָ'=>'אַ','אּ'=>'אַ','ﭏ'=>'אל','ℶ'=>'ב','ℷ'=>'ג','ℸ'=>'ד','ﬢ'=>'ד','ﬣ'=>'ה','ﬤ'=>'כ','ﬥ'=>'ל','ﬦ'=>'ם','ﬠ'=>'ע','ﬧ'=>'ר','ﬨ'=>'ת','ﺀ'=>'ء','ﺂ'=>'آ','ﺁ'=>'آ','ﺄ'=>'أ','ﺃ'=>'أ','ٵ'=>'أ','ﭑ'=>'ٱ','ﭐ'=>'ٱ','ﺆ'=>'ؤ','ﺅ'=>'ؤ','ٶ'=>'ؤ','ﺈ'=>'إ','ﺇ'=>'إ','ﺋ'=>'ئ','ﺌ'=>'ئ','ﺊ'=>'ئ','ﺉ'=>'ئ','ﯫ'=>'ئا','ﯪ'=>'ئا','ﯸ'=>'ئٻ','ﯷ'=>'ئٻ','ﯶ'=>'ئٻ','ﲗ'=>'ئج','ﰀ'=>'ئج','ﲘ'=>'ئح','ﰁ'=>'ئح','ﲙ'=>'ئخ','ﱤ'=>'ئر','ﱥ'=>'ئز','ﲚ'=>'ئم','ﳟ'=>'ئم','ﱦ'=>'ئم','ﰂ'=>'ئم','ﱧ'=>'ئن','ﲛ'=>'ئه','ﳠ'=>'ئه','ﯭ'=>'ئه','ﯬ'=>'ئه','ﯯ'=>'ئو','ﯮ'=>'ئو','ﯳ'=>'ئۆ','ﯲ'=>'ئۆ','ﯱ'=>'ئۇ','ﯰ'=>'ئۇ','ﯵ'=>'ئۈ','ﯴ'=>'ئۈ','ﯻ'=>'ئى','ﯺ'=>'ئى','ﱨ'=>'ئى','ﯹ'=>'ئى','ﰃ'=>'ئى','ﱩ'=>'ئى','ﰄ'=>'ئى','ﺎ'=>'ا','ﺍ'=>'ا','ﴼ'=>'اً','ﴽ'=>'اً','ﷳ'=>'اكبر','ﷲ'=>'الله','ﺑ'=>'ب','ﺒ'=>'ب','ﺐ'=>'ب','ﺏ'=>'ب','ﲜ'=>'بج','ﰅ'=>'بج','ﲝ'=>'بح','ﰆ'=>'بح','ﷂ'=>'بحى','ﲞ'=>'بخ','ﰇ'=>'بخ','ﶞ'=>'بخى','ﱪ'=>'بر','ﱫ'=>'بز','ﲟ'=>'بم','ﳡ'=>'بم','ﱬ'=>'بم','ﰈ'=>'بم','ﱭ'=>'بن','ﲠ'=>'به','ﳢ'=>'به','ﱮ'=>'بى','ﰉ'=>'بى','ﱯ'=>'بى','ﰊ'=>'بى','ﭔ'=>'ٻ','ﭕ'=>'ٻ','ﭓ'=>'ٻ','ﭒ'=>'ٻ','ې'=>'ٻ','ﯦ'=>'ٻ','ﯧ'=>'ٻ','ﯥ'=>'ٻ','ﯤ'=>'ٻ','ﭘ'=>'پ','ﭙ'=>'پ','ﭗ'=>'پ','ﭖ'=>'پ','ﭜ'=>'ڀ','ﭝ'=>'ڀ','ﭛ'=>'ڀ','ﭚ'=>'ڀ','ﺔ'=>'ة','ﺓ'=>'ة','ﺗ'=>'ت','ﺘ'=>'ت','ﺖ'=>'ت','ﺕ'=>'ت','ﲡ'=>'تج','ﰋ'=>'تج','ﵐ'=>'تجم','ﶠ'=>'تجى','ﶟ'=>'تجى','ﲢ'=>'تح','ﰌ'=>'تح','ﵒ'=>'تحج','ﵑ'=>'تحج','ﵓ'=>'تحم','ﲣ'=>'تخ','ﰍ'=>'تخ','ﵔ'=>'تخم','ﶢ'=>'تخى','ﶡ'=>'تخى','ﱰ'=>'تر','ﱱ'=>'تز','ﲤ'=>'تم','ﳣ'=>'تم','ﱲ'=>'تم','ﰎ'=>'تم','ﵕ'=>'تمج','ﵖ'=>'تمح','ﵗ'=>'تمخ','ﶤ'=>'تمى','ﶣ'=>'تمى','ﱳ'=>'تن','ﲥ'=>'ته','ﳤ'=>'ته','ﱴ'=>'تى','ﰏ'=>'تى','ﱵ'=>'تى','ﰐ'=>'تى','ﺛ'=>'ث','ﺜ'=>'ث','ﺚ'=>'ث','ﺙ'=>'ث','ﰑ'=>'ثج','ﱶ'=>'ثر','ﱷ'=>'ثز','ﲦ'=>'ثم','ﳥ'=>'ثم','ﱸ'=>'ثم','ﰒ'=>'ثم','ﱹ'=>'ثن','ﳦ'=>'ثه','ﱺ'=>'ثى','ﰓ'=>'ثى','ﱻ'=>'ثى','ﰔ'=>'ثى','ﭨ'=>'ٹ','ﭩ'=>'ٹ','ﭧ'=>'ٹ','ﭦ'=>'ٹ','ڻ'=>'ٹ','ﮢ'=>'ٹ','ﮣ'=>'ٹ','ﮡ'=>'ٹ','ﮠ'=>'ٹ','ﭠ'=>'ٺ','ﭡ'=>'ٺ','ﭟ'=>'ٺ','ﭞ'=>'ٺ','ﭤ'=>'ٿ','ﭥ'=>'ٿ','ﭣ'=>'ٿ','ﭢ'=>'ٿ','ﺟ'=>'ج','ﺠ'=>'ج','ﺞ'=>'ج','ﺝ'=>'ج','ﲧ'=>'جح','ﰕ'=>'جح','ﶦ'=>'جحى','ﶾ'=>'جحى','ﷻ'=>'جل جلاله','ﲨ'=>'جم','ﰖ'=>'جم','ﵙ'=>'جمح','ﵘ'=>'جمح','ﶧ'=>'جمى','ﶥ'=>'جمى','ﴝ'=>'جى','ﴁ'=>'جى','ﴞ'=>'جى','ﴂ'=>'جى','ﭸ'=>'ڃ','ﭹ'=>'ڃ','ﭷ'=>'ڃ','ﭶ'=>'ڃ','ﭴ'=>'ڄ','ﭵ'=>'ڄ','ﭳ'=>'ڄ','ﭲ'=>'ڄ','ﭼ'=>'چ','ﭽ'=>'چ','ﭻ'=>'چ','ﭺ'=>'چ','ﮀ'=>'ڇ','ﮁ'=>'ڇ','ﭿ'=>'ڇ','ﭾ'=>'ڇ','ﺣ'=>'ح','ﺤ'=>'ح','ﺢ'=>'ح','ﺡ'=>'ح','ﲩ'=>'حج','ﰗ'=>'حج','ﶿ'=>'حجى','ﲪ'=>'حم','ﰘ'=>'حم','ﵛ'=>'حمى','ﵚ'=>'حمى','ﴛ'=>'حى','ﳿ'=>'حى','ﴜ'=>'حى','ﴀ'=>'حى','ﺧ'=>'خ','ﺨ'=>'خ','ﺦ'=>'خ','ﺥ'=>'خ','ﲫ'=>'خج','ﰙ'=>'خج','ﰚ'=>'خح','ﲬ'=>'خم','ﰛ'=>'خم','ﴟ'=>'خى','ﴃ'=>'خى','ﴠ'=>'خى','ﴄ'=>'خى','ﺪ'=>'د','ﺩ'=>'د','ﺬ'=>'ذ','ﺫ'=>'ذ','ﱛ'=>'ذٰ','ﮉ'=>'ڈ','ﮈ'=>'ڈ','ﮅ'=>'ڌ','ﮄ'=>'ڌ','ﮃ'=>'ڍ','ﮂ'=>'ڍ','ﮇ'=>'ڎ','ﮆ'=>'ڎ','ﺮ'=>'ر','ﺭ'=>'ر','ﱜ'=>'رٰ','ﷶ'=>'رسول','﷼'=>'رىال','ﺰ'=>'ز','ﺯ'=>'ز','ﮍ'=>'ڑ','ﮌ'=>'ڑ','ﮋ'=>'ژ','ﮊ'=>'ژ','ﺳ'=>'س','ﺴ'=>'س','ﺲ'=>'س','ﺱ'=>'س','ﲭ'=>'سج','ﴴ'=>'سج','ﰜ'=>'سج','ﵝ'=>'سجح','ﵞ'=>'سجى','ﲮ'=>'سح','ﴵ'=>'سح','ﰝ'=>'سح','ﵜ'=>'سحج','ﲯ'=>'سخ','ﴶ'=>'سخ','ﰞ'=>'سخ','ﶨ'=>'سخى','ﷆ'=>'سخى','ﴪ'=>'سر','ﴎ'=>'سر','ﲰ'=>'سم','ﳧ'=>'سم','ﰟ'=>'سم','ﵡ'=>'سمج','ﵠ'=>'سمح','ﵟ'=>'سمح','ﵣ'=>'سمم','ﵢ'=>'سمم','ﴱ'=>'سه','ﳨ'=>'سه','ﴗ'=>'سى','ﳻ'=>'سى','ﴘ'=>'سى','ﳼ'=>'سى','ﺷ'=>'ش','ﺸ'=>'ش','ﺶ'=>'ش','ﺵ'=>'ش','ﴭ'=>'شج','ﴷ'=>'شج','ﴥ'=>'شج','ﴉ'=>'شج','ﵩ'=>'شجى','ﴮ'=>'شح','ﴸ'=>'شح','ﴦ'=>'شح','ﴊ'=>'شح','ﵨ'=>'شحم','ﵧ'=>'شحم','ﶪ'=>'شحى','ﴯ'=>'شخ','ﴹ'=>'شخ','ﴧ'=>'شخ','ﴋ'=>'شخ','ﴩ'=>'شر','ﴍ'=>'شر','ﴰ'=>'شم','ﳩ'=>'شم','ﴨ'=>'شم','ﴌ'=>'شم','ﵫ'=>'شمخ','ﵪ'=>'شمخ','ﵭ'=>'شمم','ﵬ'=>'شمم','ﴲ'=>'شه','ﳪ'=>'شه','ﴙ'=>'شى','ﳽ'=>'شى','ﴚ'=>'شى','ﳾ'=>'شى','ﺻ'=>'ص','ﺼ'=>'ص','ﺺ'=>'ص','ﺹ'=>'ص','ﲱ'=>'صح','ﰠ'=>'صح','ﵥ'=>'صحح','ﵤ'=>'صحح','ﶩ'=>'صحى','ﲲ'=>'صخ','ﴫ'=>'صر','ﴏ'=>'صر','ﷵ'=>'صلعم','ﷹ'=>'صلى','ﷺ'=>'صلى الله علىه وسلم','ﷰ'=>'صلے','ﲳ'=>'صم','ﰡ'=>'صم','ﷅ'=>'صمم','ﵦ'=>'صمم','ﴡ'=>'صى','ﴅ'=>'صى','ﴢ'=>'صى','ﴆ'=>'صى','ﺿ'=>'ض','ﻀ'=>'ض','ﺾ'=>'ض','ﺽ'=>'ض','ﲴ'=>'ضج','ﰢ'=>'ضج','ﲵ'=>'ضح','ﰣ'=>'ضح','ﵮ'=>'ضحى','ﶫ'=>'ضحى','ﲶ'=>'ضخ','ﰤ'=>'ضخ','ﵰ'=>'ضخم','ﵯ'=>'ضخم','ﴬ'=>'ضر','ﴐ'=>'ضر','ﲷ'=>'ضم','ﰥ'=>'ضم','ﴣ'=>'ضى','ﴇ'=>'ضى','ﴤ'=>'ضى','ﴈ'=>'ضى','ﻃ'=>'ط','ﻄ'=>'ط','ﻂ'=>'ط','ﻁ'=>'ط','ﲸ'=>'طح','ﰦ'=>'طح','ﴳ'=>'طم','ﴺ'=>'طم','ﰧ'=>'طم','ﵲ'=>'طمح','ﵱ'=>'طمح','ﵳ'=>'طمم','ﵴ'=>'طمى','ﴑ'=>'طى','ﳵ'=>'طى','ﴒ'=>'طى','ﳶ'=>'طى','ﻇ'=>'ظ','ﻈ'=>'ظ','ﻆ'=>'ظ','ﻅ'=>'ظ','ﲹ'=>'ظم','ﴻ'=>'ظم','ﰨ'=>'ظم','ﻋ'=>'ع','ﻌ'=>'ع','ﻊ'=>'ع','ﻉ'=>'ع','ﲺ'=>'عج','ﰩ'=>'عج','ﷄ'=>'عجم','ﵵ'=>'عجم','ﷷ'=>'علىه','ﲻ'=>'عم','ﰪ'=>'عم','ﵷ'=>'عمم','ﵶ'=>'عمم','ﵸ'=>'عمى','ﶶ'=>'عمى','ﴓ'=>'عى','ﳷ'=>'عى','ﴔ'=>'عى','ﳸ'=>'عى','ﻏ'=>'غ','ﻐ'=>'غ','ﻎ'=>'غ','ﻍ'=>'غ','ﲼ'=>'غج','ﰫ'=>'غج','ﲽ'=>'غم','ﰬ'=>'غم','ﵹ'=>'غمم','ﵻ'=>'غمى','ﵺ'=>'غمى','ﴕ'=>'غى','ﳹ'=>'غى','ﴖ'=>'غى','ﳺ'=>'غى','ﻓ'=>'ف','ﻔ'=>'ف','ﻒ'=>'ف','ﻑ'=>'ف','ﲾ'=>'فج','ﰭ'=>'فج','ﲿ'=>'فح','ﰮ'=>'فح','ﳀ'=>'فخ','ﰯ'=>'فخ','ﵽ'=>'فخم','ﵼ'=>'فخم','ﳁ'=>'فم','ﰰ'=>'فم','ﷁ'=>'فمى','ﱼ'=>'فى','ﰱ'=>'فى','ﱽ'=>'فى','ﰲ'=>'فى','ﭬ'=>'ڤ','ﭭ'=>'ڤ','ﭫ'=>'ڤ','ﭪ'=>'ڤ','ﭰ'=>'ڦ','ﭱ'=>'ڦ','ﭯ'=>'ڦ','ﭮ'=>'ڦ','ﻗ'=>'ق','ﻘ'=>'ق','ﻖ'=>'ق','ﻕ'=>'ق','ﳂ'=>'قح','ﰳ'=>'قح','ﷱ'=>'قلے','ﳃ'=>'قم','ﰴ'=>'قم','ﶴ'=>'قمح','ﵾ'=>'قمح','ﵿ'=>'قمم','ﶲ'=>'قمى','ﱾ'=>'قى','ﰵ'=>'قى','ﱿ'=>'قى','ﰶ'=>'قى','ﻛ'=>'ك','ﻜ'=>'ك','ﻚ'=>'ك','ﻙ'=>'ك','ک'=>'ك','ﮐ'=>'ك','ﮑ'=>'ك','ﮏ'=>'ك','ﮎ'=>'ك','ﲀ'=>'كا','ﰷ'=>'كا','ﳄ'=>'كج','ﰸ'=>'كج','ﳅ'=>'كح','ﰹ'=>'كح','ﳆ'=>'كخ','ﰺ'=>'كخ','ﳇ'=>'كل','ﳫ'=>'كل','ﲁ'=>'كل','ﰻ'=>'كل','ﳈ'=>'كم','ﳬ'=>'كم','ﲂ'=>'كم','ﰼ'=>'كم','ﷃ'=>'كمم','ﶻ'=>'كمم','ﶷ'=>'كمى','ﲃ'=>'كى','ﰽ'=>'كى','ﲄ'=>'كى','ﰾ'=>'كى','ﯕ'=>'ڭ','ﯖ'=>'ڭ','ﯔ'=>'ڭ','ﯓ'=>'ڭ','ﮔ'=>'گ','ﮕ'=>'گ','ﮓ'=>'گ','ﮒ'=>'گ','ﮜ'=>'ڱ','ﮝ'=>'ڱ','ﮛ'=>'ڱ','ﮚ'=>'ڱ','ﮘ'=>'ڳ','ﮙ'=>'ڳ','ﮗ'=>'ڳ','ﮖ'=>'ڳ','ﻟ'=>'ل','ﻠ'=>'ل','ﻞ'=>'ل','ﻝ'=>'ل','ﻶ'=>'لآ','ﻵ'=>'لآ','ﻸ'=>'لأ','ﻷ'=>'لأ','ﻺ'=>'لإ','ﻹ'=>'لإ','ﻼ'=>'لا','ﻻ'=>'لا','ﳉ'=>'لج','ﰿ'=>'لج','ﶃ'=>'لجج','ﶄ'=>'لجج','ﶺ'=>'لجم','ﶼ'=>'لجم','ﶬ'=>'لجى','ﳊ'=>'لح','ﱀ'=>'لح','ﶵ'=>'لحم','ﶀ'=>'لحم','ﶂ'=>'لحى','ﶁ'=>'لحى','ﳋ'=>'لخ','ﱁ'=>'لخ','ﶆ'=>'لخم','ﶅ'=>'لخم','ﳌ'=>'لم','ﳭ'=>'لم','ﲅ'=>'لم','ﱂ'=>'لم','ﶈ'=>'لمح','ﶇ'=>'لمح','ﶭ'=>'لمى','ﳍ'=>'له','ﲆ'=>'لى','ﱃ'=>'لى','ﲇ'=>'لى','ﱄ'=>'لى','ﻣ'=>'م','ﻤ'=>'م','ﻢ'=>'م','ﻡ'=>'م','ﲈ'=>'ما','ﳎ'=>'مج','ﱅ'=>'مج','ﶌ'=>'مجح','ﶒ'=>'مجخ','ﶍ'=>'مجم','ﷀ'=>'مجى','ﳏ'=>'مح','ﱆ'=>'مح','ﶉ'=>'محج','ﶊ'=>'محم','ﷴ'=>'محمد','ﶋ'=>'محى','ﳐ'=>'مخ','ﱇ'=>'مخ','ﶎ'=>'مخج','ﶏ'=>'مخم','ﶹ'=>'مخى','ﳑ'=>'مم','ﲉ'=>'مم','ﱈ'=>'مم','ﶱ'=>'ممى','ﱉ'=>'مى','ﱊ'=>'مى','ﻧ'=>'ن','ﻨ'=>'ن','ﻦ'=>'ن','ﻥ'=>'ن','ﳒ'=>'نج','ﱋ'=>'نج','ﶸ'=>'نجح','ﶽ'=>'نجح','ﶘ'=>'نجم','ﶗ'=>'نجم','ﶙ'=>'نجى','ﷇ'=>'نجى','ﳓ'=>'نح','ﱌ'=>'نح','ﶕ'=>'نحم','ﶖ'=>'نحى','ﶳ'=>'نحى','ﳔ'=>'نخ','ﱍ'=>'نخ','ﲊ'=>'نر','ﲋ'=>'نز','ﳕ'=>'نم','ﳮ'=>'نم','ﲌ'=>'نم','ﱎ'=>'نم','ﶛ'=>'نمى','ﶚ'=>'نمى','ﲍ'=>'نن','ﳖ'=>'نه','ﳯ'=>'نه','ﲎ'=>'نى','ﱏ'=>'نى','ﲏ'=>'نى','ﱐ'=>'نى','ﮟ'=>'ں','ﮞ'=>'ں','ﻫ'=>'ه','ﻬ'=>'ه','ﻪ'=>'ه','ﻩ'=>'ه','ھ'=>'ه','ﮬ'=>'ه','ﮭ'=>'ه','ﮫ'=>'ه','ﮪ'=>'ه','ہ'=>'ه','ﮨ'=>'ه','ﮩ'=>'ه','ﮧ'=>'ه','ﮦ'=>'ه','ە'=>'ه','ﳙ'=>'هٰ','ﳗ'=>'هج','ﱑ'=>'هج','ﳘ'=>'هم','ﱒ'=>'هم','ﶓ'=>'همج','ﶔ'=>'همم','ﱓ'=>'هى','ﱔ'=>'هى','ﮥ'=>'ۀ','ﮤ'=>'ۀ','ﻮ'=>'و','ﻭ'=>'و','ﷸ'=>'وسلم','ﯡ'=>'ۅ','ﯠ'=>'ۅ','ﯚ'=>'ۆ','ﯙ'=>'ۆ','ﯘ'=>'ۇ','ﯗ'=>'ۇ','ٷ'=>'ۇٔ','ﯝ'=>'ۇٔ','ﯜ'=>'ۈ','ﯛ'=>'ۈ','ﯣ'=>'ۉ','ﯢ'=>'ۉ','ﯟ'=>'ۋ','ﯞ'=>'ۋ','ﯨ'=>'ى','ﯩ'=>'ى','ﻰ'=>'ى','ﻯ'=>'ى','ي'=>'ى','ﻳ'=>'ى','ﻴ'=>'ى','ﻲ'=>'ى','ﻱ'=>'ى','ی'=>'ى','ﯾ'=>'ى','ﯿ'=>'ى','ﯽ'=>'ى','ﯼ'=>'ى','ٸ'=>'ىٔ','ﲐ'=>'ىٰ','ﱝ'=>'ىٰ','ﳚ'=>'ىج','ﱕ'=>'ىج','ﶯ'=>'ىجى','ﳛ'=>'ىح','ﱖ'=>'ىح','ﶮ'=>'ىحى','ﳜ'=>'ىخ','ﱗ'=>'ىخ','ﲑ'=>'ىر','ﲒ'=>'ىز','ﳝ'=>'ىم','ﳰ'=>'ىم','ﲓ'=>'ىم','ﱘ'=>'ىم','ﶝ'=>'ىمم','ﶜ'=>'ىمم','ﶰ'=>'ىمى','ﲔ'=>'ىن','ﳞ'=>'ىه','ﳱ'=>'ىه','ﲕ'=>'ىى','ﱙ'=>'ىى','ﲖ'=>'ىى','ﱚ'=>'ىى','ۧ'=>'ۦ','ﮯ'=>'ے','ﮮ'=>'ے','ﮱ'=>'ۓ','ﮰ'=>'ۓ','∃'=>'ⴺ','आ'=>'अा','ऒ'=>'अाॆ','ओ'=>'अाे','औ'=>'अाै','ऄ'=>'अॆ','ऑ'=>'अॉ','ऍ'=>'एॅ','ऎ'=>'एॆ','ऐ'=>'एे','ई'=>'र्इ','আ'=>'অা','ৠ'=>'ঋৃ','ৡ'=>'ঌৢ','ਉ'=>'ੳੁ','ਊ'=>'ੳੂ','ਆ'=>'ਅਾ','ਐ'=>'ਅੈ','ਔ'=>'ਅੌ','ਇ'=>'ੲਿ','ਈ'=>'ੲੀ','ਏ'=>'ੲੇ','આ'=>'અા','ઑ'=>'અાૅ','ઓ'=>'અાે','ઔ'=>'અાૈ','ઍ'=>'અૅ','એ'=>'અે','ઐ'=>'અૈ','ଆ'=>'ଅା','௮'=>'அ','ர'=>'ஈ','ா'=>'ஈ','௫'=>'ஈு','௨'=>'உ','ஊ'=>'உள','௭'=>'எ','௷'=>'எவ','ஜ'=>'ஐ','௧'=>'க','௪'=>'ச','௬'=>'சு','௲'=>'சூ','௺'=>'நீ','ை'=>'ன','௴'=>'மீ','௰'=>'ய','ௗ'=>'ள','௸'=>'ஷ','ொ'=>'ெஈ','ௌ'=>'ெள','ோ'=>'ேஈ','ౠ'=>'ఋా','ౡ'=>'ఌా','ఔ'=>'ఒౌ','ఓ'=>'ఒౕ','ఢ'=>'డ̣','భ'=>'బ̣','ష'=>'వ̣','హ'=>'వా','మ'=>'వు','ూ'=>'ుా','ౄ'=>'ృా','ೡ'=>'ಌಾ','ಔ'=>'ఒౌ','ഈ'=>'ഇൗ','ഊ'=>'உൗ','ഐ'=>'എെ','ഓ'=>'ഒാ','ഔ'=>'ഒൗ','ൡ'=>'ഞ','൫'=>'ദ്ര','ഌ'=>'നூ','ങ'=>'നூ','൯'=>'ന്','റ'=>'ര','൪'=>'ര്','൮'=>'വ്','ീ'=>'ி','ൂ'=>'ூ','ൃ'=>'ூ','ൈ'=>'െെ','ฃ'=>'ข','ด'=>'ค','ต'=>'ค','ม'=>'ฆ','ซ'=>'ช','ฏ'=>'ฎ','ท'=>'ฑ','ๅ'=>'า','ำ'=>'̊า','แ'=>'เเ','ໜ'=>'ຫນ','ໝ'=>'ຫມ','ຳ'=>'̊າ','ཷ'=>'ྲཱྀ','ཹ'=>'ླཱྀ','၀'=>'o','ឣ'=>'អ','᧐'=>'ᦞ','᭒'=>'ᬍ','᭓'=>'ᬑ','᭘'=>'ᬨ','ᢖ'=>'ᡜ','ᡕ'=>'ᠵ','Ꮢ'=>'Ꭱ','Ꮍ'=>'y','𝐀'=>'A','𝐴'=>'A','𝑨'=>'A','𝒜'=>'A','𝓐'=>'A','𝔄'=>'A','𝔸'=>'A','𝕬'=>'A','𝖠'=>'A','𝗔'=>'A','𝘈'=>'A','𝘼'=>'A','𝙰'=>'A','𝚨'=>'A','𝛢'=>'A','𝜜'=>'A','𝝖'=>'A','𝞐'=>'A','𝐉'=>'J','𝐽'=>'J','𝑱'=>'J','𝒥'=>'J','𝓙'=>'J','𝔍'=>'J','𝕁'=>'J','𝕵'=>'J','𝖩'=>'J','𝗝'=>'J','𝘑'=>'J','𝙅'=>'J','𝙹'=>'J','Ꮷ'=>'J','⋿'=>'E','ℰ'=>'E','𝐄'=>'E','𝐸'=>'E','𝑬'=>'E','𝓔'=>'E','𝔈'=>'E','𝔼'=>'E','𝕰'=>'E','𝖤'=>'E','𝗘'=>'E','𝘌'=>'E','𝙀'=>'E','𝙴'=>'E','𝚬'=>'E','𝛦'=>'E','𝜠'=>'E','𝝚'=>'E','𝞔'=>'E','ℾ'=>'Ꮁ','𝚪'=>'Ꮁ','𝛤'=>'Ꮁ','𝜞'=>'Ꮁ','𝝘'=>'Ꮁ','𝞒'=>'Ꮁ','Ꮤ'=>'w','ℳ'=>'M','𝐌'=>'M','𝑀'=>'M','𝑴'=>'M','𝓜'=>'M','𝔐'=>'M','𝕄'=>'M','𝕸'=>'M','𝖬'=>'M','𝗠'=>'M','𝘔'=>'M','𝙈'=>'M','𝙼'=>'M','𝚳'=>'M','𝛭'=>'M','𝜧'=>'M','𝝡'=>'M','𝞛'=>'M','ℋ'=>'H','ℌ'=>'H','ℍ'=>'H','𝐇'=>'H','𝐻'=>'H','𝑯'=>'H','𝓗'=>'H','𝕳'=>'H','𝖧'=>'H','𝗛'=>'H','𝘏'=>'H','𝙃'=>'H','𝙷'=>'H','𝚮'=>'H','𝛨'=>'H','𝜢'=>'H','𝝜'=>'H','𝞖'=>'H','𝐆'=>'G','𝐺'=>'G','𝑮'=>'G','𝒢'=>'G','𝓖'=>'G','𝔊'=>'G','𝔾'=>'G','𝕲'=>'G','𝖦'=>'G','𝗚'=>'G','𝘎'=>'G','𝙂'=>'G','𝙶'=>'G','Ᏻ'=>'G','ℤ'=>'Z','ℨ'=>'Z','𝐙'=>'Z','𝑍'=>'Z','𝒁'=>'Z','𝒵'=>'Z','𝓩'=>'Z','𝖅'=>'Z','𝖹'=>'Z','𝗭'=>'Z','𝘡'=>'Z','𝙕'=>'Z','𝚉'=>'Z','𝚭'=>'Z','𝛧'=>'Z','𝜡'=>'Z','𝝛'=>'Z','𝞕'=>'Z','𝐒'=>'S','𝑆'=>'S','𝑺'=>'S','𝒮'=>'S','𝓢'=>'S','𝔖'=>'S','𝕊'=>'S','𝕾'=>'S','𝖲'=>'S','𝗦'=>'S','𝘚'=>'S','𝙎'=>'S','𝚂'=>'S','Ꮪ'=>'S','𝐕'=>'V','𝑉'=>'V','𝑽'=>'V','𝒱'=>'V','𝓥'=>'V','𝔙'=>'V','𝕍'=>'V','𝖁'=>'V','𝖵'=>'V','𝗩'=>'V','𝘝'=>'V','𝙑'=>'V','𝚅'=>'V','ℒ'=>'L','𝐋'=>'L','𝐿'=>'L','𝑳'=>'L','𝓛'=>'L','𝔏'=>'L','𝕃'=>'L','𝕷'=>'L','𝖫'=>'L','𝗟'=>'L','𝘓'=>'L','𝙇'=>'L','𝙻'=>'L','∑'=>'C','⅀'=>'C','ℂ'=>'C','ℭ'=>'C','𝐂'=>'C','𝐶'=>'C','𝑪'=>'C','𝒞'=>'C','𝓒'=>'C','𝕮'=>'C','𝖢'=>'C','𝗖'=>'C','𝘊'=>'C','𝘾'=>'C','𝙲'=>'C','𝚺'=>'C','𝛴'=>'C','𝜮'=>'C','𝝨'=>'C','𝞢'=>'C','ℙ'=>'P','𝐏'=>'P','𝑃'=>'P','𝑷'=>'P','𝒫'=>'P','𝓟'=>'P','𝔓'=>'P','𝕻'=>'P','𝖯'=>'P','𝗣'=>'P','𝘗'=>'P','𝙋'=>'P','𝙿'=>'P','𝚸'=>'P','𝛲'=>'P','𝜬'=>'P','𝝦'=>'P','𝞠'=>'P','𝐊'=>'K','𝐾'=>'K','𝑲'=>'K','𝒦'=>'K','𝓚'=>'K','𝔎'=>'K','𝕂'=>'K','𝕶'=>'K','𝖪'=>'K','𝗞'=>'K','𝘒'=>'K','𝙆'=>'K','𝙺'=>'K','𝚱'=>'K','𝛫'=>'K','𝜥'=>'K','𝝟'=>'K','𝞙'=>'K','ℬ'=>'B','𝐁'=>'B','𝐵'=>'B','𝑩'=>'B','𝓑'=>'B','𝔅'=>'B','𝔹'=>'B','𝕭'=>'B','𝖡'=>'B','𝗕'=>'B','𝘉'=>'B','𝘽'=>'B','𝙱'=>'B','𝚩'=>'B','𝛣'=>'B','𝜝'=>'B','𝝗'=>'B','𝞑'=>'B','ᐍ'=>'ᐁ·','∆'=>'ᐃ','𝚫'=>'ᐃ','𝛥'=>'ᐃ','𝜟'=>'ᐃ','𝝙'=>'ᐃ','𝞓'=>'ᐃ','ᐏ'=>'ᐃ·','ᐑ'=>'ᐄ·','ᐓ'=>'ᐅ·','ᐕ'=>'ᐆ·','ᐘ'=>'ᐊ·','ᐚ'=>'ᐋ·','ᓑ'=>'ᐡ','ᑶ'=>'·P','ᑺ'=>'·d','ᒘ'=>'·J','ᑁ'=>'ᐳ·','ᑃ'=>'ᐴ·','ᑅ'=>'ᐸ·','ᑇ'=>'ᐹ·','ˈ'=>'ᑊ','ᑘ'=>'ᑌ·','ᑧ'=>'ᑌᑊ','ᑚ'=>'ᑎ·','ᑨ'=>'ᑎᑊ','ᑜ'=>'ᑏ·','ᑞ'=>'ᑐ·','ᑩ'=>'ᑐᑊ','ᑠ'=>'ᑑ·','ᑢ'=>'ᑕ·','ᑪ'=>'ᑕᑊ','ᑤ'=>'ᑖ·','ᑵ'=>'ᑫ·','ᒅ'=>'ᑫᑊ','ᑷ'=>'P·','ᒆ'=>'Pᑊ','ᑹ'=>'ᑮ·','ᑻ'=>'d·','ᒇ'=>'dᑊ','ᑽ'=>'ᑰ·','ᑿ'=>'ᑲ·','ᒈ'=>'ᑲᑊ','ᒁ'=>'ᑳ·','ᘃ'=>'ᒉ','ᒓ'=>'ᒉ·','ᒕ'=>'ᒋ·','ᒗ'=>'ᒌ·','ᒙ'=>'J·','ᒛ'=>'ᒎ·','ᘂ'=>'ᒐ','ᒝ'=>'ᒐ·','ᒟ'=>'ᒑ·','ᒭ'=>'ᒣ·','ᒯ'=>'ᒥ·','ᒱ'=>'ᒦ·','ᒳ'=>'ᒧ·','ᒵ'=>'ᒨ·','ᒹ'=>'ᒫ·','ᓊ'=>'ᓀ·','ᓌ'=>'ᓇ·','ᓎ'=>'ᓈᒫ','ᘄ'=>'ᓓ','ᓝ'=>'ᓓ·','ᓟ'=>'ᓕ·','ᓡ'=>'ᓖ·','ᓣ'=>'ᓗ·','ᓥ'=>'ᓘ·','ᘇ'=>'ᓚ','ᓧ'=>'ᓚ·','ᓩ'=>'ᓛ·','ᓷ'=>'ᓭ·','ᓹ'=>'ᓯ·','ᓻ'=>'ᓰ·','ᓽ'=>'ᓱ·','ᓿ'=>'ᓲ·','ᔁ'=>'ᓴ·','ᔃ'=>'ᓵ·','ᔌ'=>'ᔋᐸ','ᔍ'=>'ᔋᑕ','ᔎ'=>'ᔋᑲ','ᔏ'=>'ᔋᒐ','ᔘ'=>'ᔐ·','ᔚ'=>'ᔑ·','ᔜ'=>'ᔒ·','ᔞ'=>'ᔓ·','ᔠ'=>'ᔔ·','ᔢ'=>'ᔕ·','ᔤ'=>'ᔖ·','ᔲ'=>'ᔨ·','ᔴ'=>'ᔩ·','ᔶ'=>'ᔪ·','ᔸ'=>'ᔫ·','ᔺ'=>'ᔭ·','ᔼ'=>'ᔮ·','᙮'=>'x','ᕽ'=>'x','ᘢ'=>'ᕃ','ᘣ'=>'ᕆ','ᘤ'=>'ᕊ','ᕏ'=>'ᕌ·','ᙯ'=>'ᕐᑫ','ᕾ'=>'ᕐᑬ','ᕿ'=>'ᕐP','ᖀ'=>'ᕐᑮ','ᖁ'=>'ᕐd','ᖂ'=>'ᕐᑰ','ᖃ'=>'ᕐᑲ','ᖄ'=>'ᕐᑳ','ᖅ'=>'ᕐᒃ','ᕜ'=>'ᕚ·','ᕩ'=>'ᕧ·','ℛ'=>'R','ℜ'=>'R','ℝ'=>'R','𝐑'=>'R','𝑅'=>'R','𝑹'=>'R','𝓡'=>'R','𝕽'=>'R','𝖱'=>'R','𝗥'=>'R','𝘙'=>'R','𝙍'=>'R','𝚁'=>'R','ᙰ'=>'ᖕᒉ','ᖎ'=>'ᖕᒊ','ᖏ'=>'ᖕᒋ','ᖐ'=>'ᖕᒌ','ᖑ'=>'ᖕJ','ᖒ'=>'ᖕᒎ','ᖓ'=>'ᖕᒐ','ᖔ'=>'ᖕᒑ','ᙱ'=>'ᖖᒋ','ᙲ'=>'ᖖᒌ','ᙳ'=>'ᖖJ','ᙴ'=>'ᖖᒎ','ᙵ'=>'ᖖᒐ','ᙶ'=>'ᖖᒑ','ℱ'=>'F','𝐅'=>'F','𝐹'=>'F','𝑭'=>'F','𝓕'=>'F','𝔉'=>'F','𝔽'=>'F','𝕱'=>'F','𝖥'=>'F','𝗙'=>'F','𝘍'=>'F','𝙁'=>'F','𝙵'=>'F','𝟊'=>'F','ⅅ'=>'D','𝐃'=>'D','𝐷'=>'D','𝑫'=>'D','𝒟'=>'D','𝓓'=>'D','𝔇'=>'D','𝔻'=>'D','𝕯'=>'D','𝖣'=>'D','𝗗'=>'D','𝘋'=>'D','𝘿'=>'D','𝙳'=>'D','ᗪ'=>'D','℧'=>'ᘮ','ᘴ'=>'ᘮ','𝛀'=>'ᘯ','𝛺'=>'ᘯ','𝜴'=>'ᘯ','𝝮'=>'ᘯ','𝞨'=>'ᘯ','ᘵ'=>'ᘯ','ㄱ'=>'ᄀ','ᄀ'=>'ᄀ','ᆨ'=>'ᄀ','ㄲ'=>'ᄁ','ᄁ'=>'ᄁ','ᆩ'=>'ᄁ','ㄴ'=>'ᄂ','ᄂ'=>'ᄂ','ᆫ'=>'ᄂ','ㄷ'=>'ᄃ','ᄃ'=>'ᄃ','ᆮ'=>'ᄃ','ㄸ'=>'ᄄ','ᄄ'=>'ᄄ','ㄹ'=>'ᄅ','ᄅ'=>'ᄅ','ᆯ'=>'ᄅ','ㅁ'=>'ᄆ','ᄆ'=>'ᄆ','ᆷ'=>'ᄆ','ㅂ'=>'ᄇ','ᄇ'=>'ᄇ','ᆸ'=>'ᄇ','ㅃ'=>'ᄈ','ᄈ'=>'ᄈ','ㅅ'=>'ᄉ','ᄉ'=>'ᄉ','ᆺ'=>'ᄉ','ㅆ'=>'ᄊ','ᄊ'=>'ᄊ','ᆻ'=>'ᄊ','ㅇ'=>'ᄋ','ᄋ'=>'ᄋ','ᆼ'=>'ᄋ','ㅈ'=>'ᄌ','ᄌ'=>'ᄌ','ᆽ'=>'ᄌ','ㅉ'=>'ᄍ','ᄍ'=>'ᄍ','ㅊ'=>'ᄎ','ᄎ'=>'ᄎ','ᆾ'=>'ᄎ','ㅋ'=>'ᄏ','ᄏ'=>'ᄏ','ᆿ'=>'ᄏ','ㅌ'=>'ᄐ','ᄐ'=>'ᄐ','ᇀ'=>'ᄐ','ㅍ'=>'ᄑ','ᄑ'=>'ᄑ','ᇁ'=>'ᄑ','ㅎ'=>'ᄒ','ᄒ'=>'ᄒ','ᇂ'=>'ᄒ','ᇅ'=>'ᄓ','ㅥ'=>'ᄔ','ㅦ'=>'ᄕ','ᇆ'=>'ᄕ','ᇊ'=>'ᄗ','ᇍ'=>'ᄘ','ᇐ'=>'ᄙ','ㅀ'=>'ᄚ','ᄚ'=>'ᄚ','ᄻ'=>'ᄚ','ᆶ'=>'ᄚ','ㅮ'=>'ᄜ','ᇜ'=>'ᄜ','ㅱ'=>'ᄝ','ᇢ'=>'ᄝ','ㅲ'=>'ᄞ','ㅳ'=>'ᄠ','ㅄ'=>'ᄡ','ᄡ'=>'ᄡ','ᆹ'=>'ᄡ','ㅴ'=>'ᄢ','ㅵ'=>'ᄣ','ㅶ'=>'ᄧ','ㅷ'=>'ᄩ','ㅸ'=>'ᄫ','ᇦ'=>'ᄫ','ㅹ'=>'ᄬ','ㅺ'=>'ᄭ','ᇧ'=>'ᄭ','ㅻ'=>'ᄮ','ㅼ'=>'ᄯ','ᇨ'=>'ᄯ','ᇩ'=>'ᄰ','ㅽ'=>'ᄲ','ᇪ'=>'ᄲ','ㅾ'=>'ᄶ','ㅿ'=>'ᅀ','ᇫ'=>'ᅀ','ᇬ'=>'ᅁ','ᇱ'=>'ᅅ','ㆂ'=>'ᅅ','ᇲ'=>'ᅆ','ㆃ'=>'ᅆ','ㆀ'=>'ᅇ','ᇮ'=>'ᅇ','ㆁ'=>'ᅌ','ᇰ'=>'ᅌ','ᇳ'=>'ᅖ','ㆄ'=>'ᅗ','ᇴ'=>'ᅗ','ㆅ'=>'ᅘ','ㆆ'=>'ᅙ','ᇹ'=>'ᅙ','ㅤ'=>'ᅠ','ᅠ'=>'ᅠ','ㅏ'=>'ᅡ','ᅡ'=>'ᅡ','ㅐ'=>'ᅢ','ᅢ'=>'ᅢ','ㅑ'=>'ᅣ','ᅣ'=>'ᅣ','ㅒ'=>'ᅤ','ᅤ'=>'ᅤ','ㅓ'=>'ᅥ','ᅥ'=>'ᅥ','ㅔ'=>'ᅦ','ᅦ'=>'ᅦ','ㅕ'=>'ᅧ','ᅧ'=>'ᅧ','ㅖ'=>'ᅨ','ᅨ'=>'ᅨ','ㅗ'=>'ᅩ','ᅩ'=>'ᅩ','ㅘ'=>'ᅪ','ᅪ'=>'ᅪ','ㅙ'=>'ᅫ','ᅫ'=>'ᅫ','ㅚ'=>'ᅬ','ᅬ'=>'ᅬ','ㅛ'=>'ᅭ','ᅭ'=>'ᅭ','ㅜ'=>'ᅮ','ᅮ'=>'ᅮ','ㅝ'=>'ᅯ','ᅯ'=>'ᅯ','ㅞ'=>'ᅰ','ᅰ'=>'ᅰ','ㅟ'=>'ᅱ','ᅱ'=>'ᅱ','ㅠ'=>'ᅲ','ᅲ'=>'ᅲ','ㅡ'=>'一','ᅳ'=>'一','ㅢ'=>'ᅴ','ᅴ'=>'ᅴ','ㅣ'=>'丨','ᅵ'=>'丨','ㆇ'=>'ᆄ','ᆆ'=>'ᆄ','ㆈ'=>'ᆅ','ㆉ'=>'ᆈ','ㆊ'=>'ᆑ','ㆋ'=>'ᆒ','ㆌ'=>'ᆔ','ㆍ'=>'ᆞ','ㆎ'=>'ᆡ','ㄳ'=>'ᆪ','ᆪ'=>'ᆪ','ㄵ'=>'ᆬ','ᆬ'=>'ᆬ','ㄶ'=>'ᆭ','ᆭ'=>'ᆭ','ㄺ'=>'ᆰ','ᆰ'=>'ᆰ','ㄻ'=>'ᆱ','ᆱ'=>'ᆱ','ㄼ'=>'ᆲ','ᆲ'=>'ᆲ','ㄽ'=>'ᆳ','ᆳ'=>'ᆳ','ㄾ'=>'ᆴ','ᆴ'=>'ᆴ','ㄿ'=>'ᆵ','ᆵ'=>'ᆵ','ㅧ'=>'ᇇ','ㅨ'=>'ᇈ','ㅩ'=>'ᇌ','ㅪ'=>'ᇎ','ㅫ'=>'ᇓ','ㅬ'=>'ᇗ','ㅭ'=>'ᇙ','ㅯ'=>'ᇝ','ㅰ'=>'ᇟ','ァ'=>'ァ','ア'=>'ア','ィ'=>'ィ','イ'=>'イ','ゥ'=>'ゥ','ウ'=>'ウ','ェ'=>'ェ','エ'=>'エ','ォ'=>'ォ','オ'=>'オ','カ'=>'カ','キ'=>'キ','ク'=>'ク','ケ'=>'ケ','コ'=>'コ','サ'=>'サ','シ'=>'シ','ス'=>'ス','セ'=>'セ','ソ'=>'ソ','タ'=>'タ','チ'=>'チ','ッ'=>'ッ','ツ'=>'ツ','テ'=>'テ','ト'=>'ト','ナ'=>'ナ','ニ'=>'ニ','ヌ'=>'ヌ','ネ'=>'ネ','ノ'=>'ノ','ハ'=>'ハ','ヒ'=>'ヒ','フ'=>'フ','ヘ'=>'へ','ホ'=>'ホ','マ'=>'マ','⧄'=>'〼','ミ'=>'ミ','ム'=>'ム','メ'=>'メ','モ'=>'モ','ャ'=>'ャ','ヤ'=>'ヤ','ュ'=>'ュ','ユ'=>'ユ','ョ'=>'ョ','ヨ'=>'ヨ','ラ'=>'ラ','リ'=>'リ','ル'=>'ル','レ'=>'レ','ロ'=>'ロ','ワ'=>'ワ','ヲ'=>'ヲ','ン'=>'ン','꒞'=>'ꁊ','꒬'=>'ꁐ','꒜'=>'ꃀ','꒿'=>'ꉙ','꒾'=>'ꊱ','꓀'=>'ꎫ','꓂'=>'ꎵ','꒺'=>'ꎿ','꒰'=>'ꏂ','𐒠'=>'𐒆','—'=>'一','―'=>'一','−'=>'一','─'=>'一','⼀'=>'一','不'=>'不','並'=>'並','|'=>'丨','|'=>'丨','∣'=>'丨','⼁'=>'丨','‖'=>'丨丨','∥'=>'丨丨','串'=>'串','⼂'=>'丶','丸'=>'丸','丹'=>'丹','丽'=>'丽','⼃'=>'丿','乁'=>'乁','⼄'=>'乙','亂'=>'亂','⼅'=>'亅','了'=>'了','⼆'=>'二','⼇'=>'亠','亮'=>'亮','⼈'=>'人','什'=>'什','仌'=>'仌','令'=>'令','你'=>'你','倂'=>'併','倂'=>'併','侀'=>'侀','來'=>'來','例'=>'例','侮'=>'侮','侮'=>'侮','侻'=>'侻','便'=>'便','值'=>'値','倫'=>'倫','偺'=>'偺','備'=>'備','像'=>'像','僚'=>'僚','僧'=>'僧','僧'=>'僧','⼉'=>'儿','兀'=>'兀','充'=>'充','免'=>'免','免'=>'免','兔'=>'兔','兤'=>'兤','⼊'=>'入','內'=>'內','全'=>'全','兩'=>'兩','⼋'=>'八','六'=>'六','具'=>'具','冀'=>'冀','⼌'=>'冂','再'=>'再','冒'=>'冒','冕'=>'冕','⼍'=>'冖','冗'=>'冗','冤'=>'冤','⼎'=>'冫','冬'=>'冬','况'=>'况','况'=>'况','冷'=>'冷','凉'=>'凉','凌'=>'凌','凜'=>'凜','凞'=>'凞','⼏'=>'几','凵'=>'凵','⼐'=>'凵','⼑'=>'刀','刃'=>'刃','切'=>'切','切'=>'切','列'=>'列','利'=>'利','刺'=>'刺','刻'=>'刻','剆'=>'剆','割'=>'割','剷'=>'剷','劉'=>'劉','力'=>'力','⼒'=>'力','劣'=>'劣','劳'=>'劳','勇'=>'勇','勇'=>'勇','勉'=>'勉','勉'=>'勉','勒'=>'勒','勞'=>'勞','勤'=>'勤','勤'=>'勤','勵'=>'勵','⼓'=>'勹','勺'=>'勺','勺'=>'勺','包'=>'包','匆'=>'匆','⼔'=>'匕','北'=>'北','北'=>'北','⼕'=>'匚','⼖'=>'匸','匿'=>'匿','⼗'=>'十','〸'=>'十','〹'=>'卄','〺'=>'卅','卉'=>'卉','卑'=>'卑','卑'=>'卑','博'=>'博','⼘'=>'卜','⼙'=>'卩','即'=>'即','卵'=>'卵','卽'=>'卽','卿'=>'卿','卿'=>'卿','卿'=>'卿','⼚'=>'厂','⼛'=>'厶','參'=>'參','⼜'=>'又','及'=>'及','叟'=>'叟','⼝'=>'口','句'=>'句','叫'=>'叫','叱'=>'叱','吆'=>'吆','吏'=>'吏','吝'=>'吝','吸'=>'吸','呂'=>'呂','呈'=>'呈','周'=>'周','咞'=>'咞','咢'=>'咢','咽'=>'咽','哶'=>'哶','唐'=>'唐','啓'=>'啓','啟'=>'啓','啕'=>'啕','啣'=>'啣','善'=>'善','善'=>'善','喇'=>'喇','喙'=>'喙','喙'=>'喙','喝'=>'喝','喝'=>'喝','喫'=>'喫','喳'=>'喳','嗀'=>'嗀','嗂'=>'嗂','嗢'=>'嗢','嘆'=>'嘆','嘆'=>'嘆','噑'=>'噑','器'=>'器','噴'=>'噴','⼞'=>'囗','囹'=>'囹','圖'=>'圖','圗'=>'圗','⼟'=>'土','型'=>'型','城'=>'城','埴'=>'埴','堍'=>'堍','報'=>'報','堲'=>'堲','塀'=>'塀','塚'=>'塚','塚'=>'塚','塞'=>'塞','填'=>'塡','墨'=>'墨','壿'=>'墫','墬'=>'墬','墳'=>'墳','壘'=>'壘','壟'=>'壟','⼠'=>'士','壮'=>'壮','売'=>'売','壷'=>'壷','⼡'=>'夂','夆'=>'夆','⼢'=>'夊','⼣'=>'夕','多'=>'多','夢'=>'夢','⼤'=>'大','奄'=>'奄','奈'=>'奈','契'=>'契','奔'=>'奔','奢'=>'奢','女'=>'女','⼥'=>'女','姘'=>'姘','姬'=>'姬','娛'=>'娛','娧'=>'娧','婢'=>'婢','婦'=>'婦','嬀'=>'媯','媵'=>'媵','嬈'=>'嬈','嬨'=>'嬨','嬾'=>'嬾','嬾'=>'嬾','⼦'=>'子','⼧'=>'宀','宅'=>'宅','寃'=>'寃','寘'=>'寘','寧'=>'寧','寧'=>'寧','寧'=>'寧','寮'=>'寮','寳'=>'寳','⼨'=>'寸','寿'=>'寿','将'=>'将','⼩'=>'小','尢'=>'尢','⼪'=>'尢','⼫'=>'尸','尿'=>'尿','屠'=>'屠','屢'=>'屢','層'=>'層','履'=>'履','屮'=>'屮','屮'=>'屮','⼬'=>'屮','⼭'=>'山','岍'=>'岍','峀'=>'峀','崙'=>'崙','嵃'=>'嵃','嵐'=>'嵐','嵫'=>'嵫','嵮'=>'嵮','嵼'=>'嵼','嶲'=>'嶲','嶺'=>'嶺','⼮'=>'巛','巡'=>'巡','巢'=>'巢','⼯'=>'工','⼰'=>'己','巽'=>'巽','⼱'=>'巾','帲'=>'帡','帨'=>'帨','帽'=>'帽','幩'=>'幩','⼲'=>'干','年'=>'年','⼳'=>'幺','⼴'=>'广','度'=>'度','庰'=>'庰','庳'=>'庳','庶'=>'庶','廉'=>'廉','廊'=>'廊','廊'=>'廊','廒'=>'廒','廓'=>'廓','廙'=>'廙','廬'=>'廬','⼵'=>'廴','廾'=>'廾','⼶'=>'廾','弄'=>'弄','⼷'=>'弋','⼸'=>'弓','弢'=>'弢','弢'=>'弢','⼹'=>'彐','当'=>'当','⼺'=>'彡','形'=>'形','彩'=>'彩','彫'=>'彫','⼻'=>'彳','律'=>'律','徚'=>'徚','復'=>'復','徭'=>'徭','⼼'=>'心','忍'=>'忍','志'=>'志','念'=>'念','忹'=>'忹','怒'=>'怒','怜'=>'怜','悁'=>'悁','悔'=>'悔','悔'=>'悔','惇'=>'惇','惘'=>'惘','惡'=>'惡','愈'=>'愈','慄'=>'慄','慈'=>'慈','慌'=>'慌','慌'=>'慌','慎'=>'慎','慎'=>'慎','慠'=>'慠','慨'=>'慨','慺'=>'慺','憎'=>'憎','憎'=>'憎','憎'=>'憎','憐'=>'憐','憤'=>'憤','憯'=>'憯','憲'=>'憲','懞'=>'懞','懲'=>'懲','懲'=>'懲','懲'=>'懲','懶'=>'懶','懶'=>'懶','戀'=>'戀','⼽'=>'戈','成'=>'成','戛'=>'戛','戮'=>'戮','戴'=>'戴','⼾'=>'戶','⼿'=>'手','扝'=>'扝','抱'=>'抱','拉'=>'拉','拏'=>'拏','拓'=>'拓','拔'=>'拔','拼'=>'拼','拾'=>'拾','挽'=>'挽','捐'=>'捐','捨'=>'捨','捻'=>'捻','掃'=>'掃','掠'=>'掠','掩'=>'掩','揄'=>'揄','揅'=>'揅','揤'=>'揤','㩁'=>'搉','搜'=>'搜','搢'=>'搢','摒'=>'摒','摩'=>'摩','摷'=>'摷','摾'=>'摾','撚'=>'撚','撝'=>'撝','擄'=>'擄','⽀'=>'支','⽁'=>'攴','敏'=>'敏','敏'=>'敏','敖'=>'敖','敬'=>'敬','數'=>'數','⽂'=>'文','⽃'=>'斗','料'=>'料','⽄'=>'斤','⽅'=>'方','旅'=>'旅','⽆'=>'无','既'=>'既','旣'=>'旣','⽇'=>'日','易'=>'易','晉'=>'晉','晩'=>'晚','䀿'=>'晣','晴'=>'晴','晴'=>'晴','暈'=>'暈','暑'=>'暑','暑'=>'暑','暜'=>'暜','暴'=>'暴','曆'=>'曆','⽈'=>'曰','更'=>'更','㫚'=>'曶','書'=>'書','最'=>'最','⽉'=>'月','肦'=>'朌','胐'=>'朏','胊'=>'朐','脁'=>'朓','朗'=>'朗','朗'=>'朗','朗'=>'朗','脧'=>'朘','望'=>'望','望'=>'望','朡'=>'朡','膧'=>'朣','⽊'=>'木','李'=>'李','杓'=>'杓','杖'=>'杖','杞'=>'杞','柿'=>'杮','杻'=>'杻','枅'=>'枅','林'=>'林','柳'=>'柳','柺'=>'柺','栗'=>'栗','栟'=>'栟','桒'=>'桒','梁'=>'梁','梅'=>'梅','梅'=>'梅','梎'=>'梎','梨'=>'梨','椔'=>'椔','楂'=>'楂','樧'=>'榝','榣'=>'榣','槪'=>'槪','樂'=>'樂','樂'=>'樂','樂'=>'樂','樓'=>'樓','檨'=>'檨','櫓'=>'櫓','櫛'=>'櫛','欄'=>'欄','⽋'=>'欠','次'=>'次','歔'=>'歔','⽌'=>'止','歲'=>'歲','歷'=>'歷','歹'=>'歹','⽍'=>'歹','殟'=>'殟','殮'=>'殮','⽎'=>'殳','殺'=>'殺','殺'=>'殺','殺'=>'殺','殻'=>'殻','⽏'=>'毋','⺟'=>'母','⽐'=>'比','⽑'=>'毛','⽒'=>'氏','⽓'=>'气','⽔'=>'水','汎'=>'汎','汧'=>'汧','沈'=>'沈','沿'=>'沿','泌'=>'泌','泍'=>'泍','泥'=>'泥','洖'=>'洖','洛'=>'洛','洞'=>'洞','洴'=>'洴','派'=>'派','流'=>'流','流'=>'流','流'=>'流','浩'=>'浩','浪'=>'浪','海'=>'海','海'=>'海','浸'=>'浸','涅'=>'涅','淋'=>'淋','淚'=>'淚','淪'=>'淪','淹'=>'淹','渚'=>'渚','港'=>'港','湮'=>'湮','潙'=>'溈','溜'=>'溜','溺'=>'溺','滇'=>'滇','滋'=>'滋','滋'=>'滋','滑'=>'滑','滛'=>'滛','漏'=>'漏','漢'=>'漢','漢'=>'漢','漣'=>'漣','潮'=>'潮','濆'=>'濆','濫'=>'濫','濾'=>'濾','瀛'=>'瀛','瀞'=>'瀞','瀞'=>'瀞','瀹'=>'瀹','灊'=>'灊','⽕'=>'火','灰'=>'灰','灷'=>'灷','災'=>'災','炙'=>'炙','炭'=>'炭','烈'=>'烈','烙'=>'烙','煅'=>'煅','煉'=>'煉','煮'=>'煮','煮'=>'煮','熜'=>'熜','燎'=>'燎','燐'=>'燐','爐'=>'爐','爛'=>'爛','爨'=>'爨','⽖'=>'爪','爫'=>'爫','⺤'=>'爫','爵'=>'爵','爵'=>'爵','⽗'=>'父','⽘'=>'爻','⽙'=>'爿','⽚'=>'片','牐'=>'牐','⽛'=>'牙','⽜'=>'牛','牢'=>'牢','犀'=>'犀','犕'=>'犕','⽝'=>'犬','犯'=>'犯','狀'=>'狀','狼'=>'狼','猪'=>'猪','猪'=>'猪','獵'=>'獵','獺'=>'獺','⽞'=>'玄','率'=>'率','率'=>'率','⽟'=>'玉','王'=>'王','玥'=>'玥','玲'=>'玲','珞'=>'珞','理'=>'理','琉'=>'琉','琢'=>'琢','瑇'=>'瑇','瑜'=>'瑜','瑩'=>'瑩','瑱'=>'瑱','瑱'=>'瑱','璅'=>'璅','璉'=>'璉','璘'=>'璘','瓊'=>'瓊','⽠'=>'瓜','⽡'=>'瓦','甆'=>'甆','⽢'=>'甘','⽣'=>'生','甤'=>'甤','⽤'=>'用','⽥'=>'田','画'=>'画','甾'=>'甾','留'=>'留','略'=>'略','異'=>'異','異'=>'異','⽦'=>'疋','⽧'=>'疒','痢'=>'痢','瘐'=>'瘐','瘝'=>'瘝','瘟'=>'瘟','療'=>'療','癩'=>'癩','⽨'=>'癶','⽩'=>'白','⽪'=>'皮','⽫'=>'皿','益'=>'益','益'=>'益','盛'=>'盛','盧'=>'盧','⽬'=>'目','直'=>'直','直'=>'直','省'=>'省','眞'=>'眞','真'=>'真','真'=>'真','着'=>'着','睊'=>'睊','睊'=>'睊','瞋'=>'瞋','瞧'=>'瞧','⽭'=>'矛','⽮'=>'矢','⽯'=>'石','硏'=>'研','硎'=>'硎','硫'=>'硫','碌'=>'碌','碌'=>'碌','碑'=>'碑','磊'=>'磊','磌'=>'磌','磌'=>'磌','磻'=>'磻','礪'=>'礪','⽰'=>'示','礼'=>'礼','社'=>'社','祈'=>'祈','祉'=>'祉','祐'=>'祐','祖'=>'祖','祖'=>'祖','祝'=>'祝','神'=>'神','祥'=>'祥','祿'=>'祿','禍'=>'禍','禎'=>'禎','福'=>'福','福'=>'福','禮'=>'禮','⽱'=>'禸','⽲'=>'禾','秊'=>'秊','秫'=>'秫','稜'=>'稜','穀'=>'穀','穀'=>'穀','穊'=>'穊','穏'=>'穏','⽳'=>'穴','突'=>'突','窱'=>'窱','立'=>'立','⽴'=>'立','竮'=>'竮','⽵'=>'竹','笠'=>'笠','節'=>'節','節'=>'節','篆'=>'篆','築'=>'築','簾'=>'簾','籠'=>'籠','⽶'=>'米','类'=>'类','粒'=>'粒','精'=>'精','糒'=>'糒','糖'=>'糖','糣'=>'糣','糧'=>'糧','糨'=>'糨','⽷'=>'糸','紀'=>'紀','紐'=>'紐','索'=>'索','累'=>'累','絶'=>'絕','絛'=>'絛','絣'=>'絣','綠'=>'綠','綾'=>'綾','緇'=>'緇','練'=>'練','練'=>'練','練'=>'練','縂'=>'縂','縉'=>'縉','縷'=>'縷','繁'=>'繁','繅'=>'繅','⽸'=>'缶','缾'=>'缾','⽹'=>'网','⺫'=>'罒','署'=>'署','罹'=>'罹','罺'=>'罺','羅'=>'羅','⽺'=>'羊','羕'=>'羕','羚'=>'羚','羽'=>'羽','⽻'=>'羽','翺'=>'翺','老'=>'老','⽼'=>'老','者'=>'者','者'=>'者','者'=>'者','⽽'=>'而','⽾'=>'耒','⽿'=>'耳','聆'=>'聆','聠'=>'聠','聯'=>'聯','聰'=>'聰','聾'=>'聾','⾀'=>'聿','⾁'=>'肉','肋'=>'肋','肭'=>'肭','育'=>'育','㬵'=>'胶','腁'=>'胼','脃'=>'脃','脾'=>'脾','臘'=>'臘','⾂'=>'臣','臨'=>'臨','⾃'=>'自','臭'=>'臭','⾄'=>'至','⾅'=>'臼','舁'=>'舁','舁'=>'舁','舄'=>'舄','⾆'=>'舌','⾇'=>'舛','⾈'=>'舟','⾉'=>'艮','良'=>'良','⾊'=>'色','⾋'=>'艸','艹'=>'艹','艹'=>'艹','芋'=>'芋','芑'=>'芑','芝'=>'芝','花'=>'花','芳'=>'芳','芽'=>'芽','若'=>'若','若'=>'若','苦'=>'苦','茝'=>'茝','茣'=>'茣','茶'=>'茶','荒'=>'荒','荓'=>'荓','荣'=>'荣','莭'=>'莭','莽'=>'莽','菉'=>'菉','菊'=>'菊','菌'=>'菌','菜'=>'菜','菧'=>'菧','華'=>'華','菱'=>'菱','落'=>'落','葉'=>'葉','著'=>'著','著'=>'著','蔿'=>'蒍','蓮'=>'蓮','蓱'=>'蓱','蓳'=>'蓳','蓼'=>'蓼','蔖'=>'蔖','蕤'=>'蕤','藍'=>'藍','藺'=>'藺','蘆'=>'蘆','蘒'=>'蘒','蘭'=>'蘭','虁'=>'蘷','蘿'=>'蘿','⾌'=>'虍','虐'=>'虐','虜'=>'虜','虜'=>'虜','虧'=>'虧','虩'=>'虩','⾍'=>'虫','蚈'=>'蚈','蚩'=>'蚩','蛢'=>'蛢','蜎'=>'蜎','蜨'=>'蜨','蝫'=>'蝫','蝹'=>'蝹','蝹'=>'蝹','螆'=>'螆','螺'=>'螺','蟡'=>'蟡','蠁'=>'蠁','蠟'=>'蠟','⾎'=>'血','行'=>'行','⾏'=>'行','衠'=>'衠','衣'=>'衣','⾐'=>'衣','裂'=>'裂','裏'=>'裏','裗'=>'裗','裞'=>'裞','裡'=>'裡','裸'=>'裸','裺'=>'裺','褐'=>'褐','襁'=>'襁','襤'=>'襤','⾑'=>'襾','覆'=>'覆','見'=>'見','⾒'=>'見','視'=>'視','視'=>'視','⾓'=>'角','⾔'=>'言','䚶'=>'訞','詽'=>'訮','誠'=>'誠','說'=>'說','說'=>'說','調'=>'調','請'=>'請','諒'=>'諒','論'=>'論','諭'=>'諭','諭'=>'諭','諸'=>'諸','諸'=>'諸','諾'=>'諾','諾'=>'諾','謁'=>'謁','謁'=>'謁','謹'=>'謹','謹'=>'謹','識'=>'識','讀'=>'讀','讏'=>'讆','變'=>'變','變'=>'變','⾕'=>'谷','⾖'=>'豆','豈'=>'豈','豕'=>'豕','⾗'=>'豕','⾘'=>'豸','⾙'=>'貝','貫'=>'貫','賁'=>'賁','賂'=>'賂','賈'=>'賈','賓'=>'賓','贈'=>'贈','贈'=>'贈','贛'=>'贛','⾚'=>'赤','⾛'=>'走','起'=>'起','趆'=>'赿','⾜'=>'足','趼'=>'趼','跋'=>'跋','跺'=>'跥','路'=>'路','跰'=>'跰','躛'=>'躗','⾝'=>'身','車'=>'車','⾞'=>'車','軔'=>'軔','輧'=>'軿','輦'=>'輦','輪'=>'輪','輸'=>'輸','輸'=>'輸','輻'=>'輻','轢'=>'轢','⾟'=>'辛','辞'=>'辞','辰'=>'辰','⾠'=>'辰','⾡'=>'辵','辶'=>'辶','⻌'=>'辶','連'=>'連','逸'=>'逸','逸'=>'逸','遲'=>'遲','遼'=>'遼','邏'=>'邏','⾢'=>'邑','邔'=>'邔','郎'=>'郎','郱'=>'郱','都'=>'都','鄑'=>'鄑','鄛'=>'鄛','⾣'=>'酉','酪'=>'酪','醙'=>'醙','醴'=>'醴','⾤'=>'釆','里'=>'里','⾥'=>'里','量'=>'量','金'=>'金','⾦'=>'金','鈴'=>'鈴','鈸'=>'鈸','鉶'=>'鉶','鉼'=>'鉼','鋗'=>'鋗','鋘'=>'鋘','錄'=>'錄','鍊'=>'鍊','鎮'=>'鎭','鏹'=>'鏹','鐕'=>'鐕','⾧'=>'長','⾨'=>'門','開'=>'開','閭'=>'閭','閷'=>'閷','⾩'=>'阜','阮'=>'阮','陋'=>'陋','降'=>'降','陵'=>'陵','陸'=>'陸','陼'=>'陼','隆'=>'隆','隣'=>'隣','⾪'=>'隶','隸'=>'隸','⾫'=>'隹','雃'=>'雃','離'=>'離','難'=>'難','難'=>'難','⾬'=>'雨','零'=>'零','雷'=>'雷','霣'=>'霣','露'=>'露','靈'=>'靈','⾭'=>'靑','靖'=>'靖','靖'=>'靖','⾮'=>'非','⾯'=>'面','⾰'=>'革','⾱'=>'韋','韛'=>'韛','韠'=>'韠','⾲'=>'韭','⾳'=>'音','響'=>'響','響'=>'響','⾴'=>'頁','頋'=>'頋','頋'=>'頋','頋'=>'頋','領'=>'領','頩'=>'頩','頻'=>'頻','頻'=>'頻','類'=>'類','⾵'=>'風','⾶'=>'飛','⻝'=>'食','⾷'=>'食','飢'=>'飢','飯'=>'飯','飼'=>'飼','館'=>'館','餩'=>'餩','⾸'=>'首','⾹'=>'香','馧'=>'馧','⾺'=>'馬','駂'=>'駂','駱'=>'駱','駾'=>'駾','驪'=>'驪','⾻'=>'骨','⾼'=>'高','⾽'=>'髟','鬒'=>'鬒','鬒'=>'鬒','⾾'=>'鬥','⾿'=>'鬯','⿀'=>'鬲','⿁'=>'鬼','⿂'=>'魚','魯'=>'魯','鱀'=>'鱀','鱗'=>'鱗','⿃'=>'鳥','鳽'=>'鳽','鵧'=>'鵧','鶴'=>'鶴','鷺'=>'鷺','鸞'=>'鸞','鹃'=>'鹂','⿄'=>'鹵','鹿'=>'鹿','⿅'=>'鹿','麗'=>'麗','麟'=>'麟','⿆'=>'麥','麻'=>'麻','⿇'=>'麻','⿈'=>'黃','⿉'=>'黍','黎'=>'黎','⿊'=>'黑','黹'=>'黹','⿋'=>'黹','⿌'=>'黽','黾'=>'黾','鼅'=>'鼅','⿍'=>'鼎','鼏'=>'鼏','⿎'=>'鼓','鼖'=>'鼖','⿏'=>'鼠','鼻'=>'鼻','⿐'=>'鼻','齃'=>'齃','⿑'=>'齊','⿒'=>'齒','龍'=>'龍','⿓'=>'龍','龎'=>'龎','龜'=>'龜','龜'=>'龜','龜'=>'龜','⿔'=>'龜','⻳'=>'龟','⿕'=>'龠','㒞'=>'㒞','㒹'=>'㒹','㒻'=>'㒻','㓟'=>'㓟','㔕'=>'㔕','䎛'=>'㖈','㛮'=>'㛮','㛼'=>'㛼','㞁'=>'㞁','㠯'=>'㠯','㡢'=>'㡢','㡼'=>'㡼','㣇'=>'㣇','㣣'=>'㣣','㤜'=>'㤜','㤺'=>'㤺','㨮'=>'㨮','㩬'=>'㩬','㫤'=>'㫤','㬈'=>'㬈','㬙'=>'㬙','䐠'=>'㬻','㭉'=>'㭉','㮝'=>'㮝','㮝'=>'㮝','㰘'=>'㰘','㱎'=>'㱎','㴳'=>'㴳','㶖'=>'㶖','㺬'=>'㺬','㺸'=>'㺸','㺸'=>'㺸','㼛'=>'㼛','㿼'=>'㿼','䀈'=>'䀈','䀘'=>'䀘','䀹'=>'䀹','䀹'=>'䀹','䁆'=>'䁆','䂖'=>'䂖','䃣'=>'䃣','䄯'=>'䄯','䈂'=>'䈂','䈧'=>'䈧','䊠'=>'䊠','䌁'=>'䌁','䌴'=>'䌴','䍙'=>'䍙','䏕'=>'䏕','䏙'=>'䏙','䐋'=>'䐋','䑫'=>'䑫','䔫'=>'䔫','䕝'=>'䕝','䕡'=>'䕡','䕫'=>'䕫','䗗'=>'䗗','䗹'=>'䗹','䘵'=>'䘵','䚾'=>'䚾','䛇'=>'䛇','䦕'=>'䦕','䧦'=>'䧦','䩮'=>'䩮','䩶'=>'䩶','䪲'=>'䪲','䬳'=>'䬳','䯎'=>'䯎','䳎'=>'䳎','䳭'=>'䳭','䳸'=>'䳸','䵖'=>'䵖','𠄢'=>'𠄢','𠔜'=>'𠔜','𠔥'=>'𠔥','𠕋'=>'𠕋','𠘺'=>'𠘺','𠠄'=>'𠠄','𠣞'=>'𠣞','𠨬'=>'𠨬','𠭣'=>'𠭣','𡓤'=>'𡓤','𡚨'=>'𡚨','𡛪'=>'𡛪','𡧈'=>'𡧈','𡬘'=>'𡬘','𡴋'=>'𡴋','𡷤'=>'𡷤','𡷦'=>'𡷦','𢆃'=>'𢆃','𢆟'=>'𢆟','𢌱'=>'𢌱','𢌱'=>'𢌱','𢛔'=>'𢛔','𢡄'=>'𢡄','𢡊'=>'𢡊','𢬌'=>'𢬌','𢯱'=>'𢯱','𣀊'=>'𣀊','𣊸'=>'𣊸','𣍟'=>'𣍟','𣎓'=>'𣎓','𣎜'=>'𣎜','𣏃'=>'𣏃','𣏕'=>'𣏕','𣑭'=>'𣑭','𣚣'=>'𣚣','𣢧'=>'𣢧','𣪍'=>'𣪍','𣫺'=>'𣫺','𣲼'=>'𣲼','𣴞'=>'𣴞','𣻑'=>'𣻑','𣽞'=>'𣽞','𣾎'=>'𣾎','𤉣'=>'𤉣','𤎫'=>'𤎫','𤘈'=>'𤘈','𤜵'=>'𤜵','𤠔'=>'𤠔','𤰶'=>'𤰶','𤲒'=>'𤲒','𤾡'=>'𤾡','𤾸'=>'𤾸','𥁄'=>'𥁄','𥃲'=>'𥃲','𥃳'=>'𥃳','𥄙'=>'𥄙','𥄳'=>'𥄳','𥉉'=>'𥉉','𥐝'=>'𥐝','𥘦'=>'𥘦','𥚚'=>'𥚚','𥛅'=>'𥛅','𥥼'=>'𥥼','𥪧'=>'𥪧','𥪧'=>'𥪧','𥮫'=>'𥮫','𥲀'=>'𥲀','𥳐'=>'𥳐','𥾆'=>'𥾆','𦇚'=>'𦇚','𦈨'=>'𦈨','𦉇'=>'𦉇','𦋙'=>'𦋙','𦌾'=>'𦌾','𦓚'=>'𦓚','𦔣'=>'𦔣','𦖨'=>'𦖨','𦞧'=>'𦞧','𦞵'=>'𦞵','𦬼'=>'𦬼','𦰶'=>'𦰶','𦳕'=>'𦳕','𦵫'=>'𦵫','𦼬'=>'𦼬','𦾱'=>'𦾱','𧃒'=>'𧃒','𧏊'=>'𧏊','𧙧'=>'𧙧','𧢮'=>'𧢮','𧥦'=>'𧥦','𧲨'=>'𧲨','𧻓'=>'𧻓','𧼯'=>'𧼯','𨗒'=>'𨗒','𨗭'=>'𨗭','𨜮'=>'𨜮','𨯺'=>'𨯺','𨵷'=>'𨵷','𩅅'=>'𩅅','𩇟'=>'𩇟','𩈚'=>'𩈚','𩐊'=>'𩐊','𩒖'=>'𩒖','𩖶'=>'𩖶','𩬰'=>'𩬰','𪃎'=>'𪃎','𪄅'=>'𪄅','𪈎'=>'𪈎','𪊑'=>'𪊑','𪎒'=>'𪎒','𪘀'=>'𪘀','℃'=>'°C','℉'=>'°F','ℇ'=>'Ɛ','℻'=>'FAX','ℕ'=>'N','№'=>'No','ℚ'=>'Q','₨'=>'Rs','𝐓'=>'T','℡'=>'TEL','𝐔'=>'U','𝐖'=>'W','₩'=>'W̵','𝐗'=>'X','¥'=>'Y̵','𝚲'=>'Λ','𝚵'=>'Ξ','ℿ'=>'Π','ϲ'=>'c','ϒ'=>'Y','𝚽'=>'Φ','𝚿'=>'Ψ','ѣ'=>'Ь̵','ਃ'=>'ঃ','ಃ'=>'ః','່'=>'่','់'=>'่','້'=>'้','໊'=>'๊','໋'=>'๋','៕'=>'๚','៚'=>'๛','ъ'=>'ˉb','៙'=>'๏','೧'=>'౧','૨'=>'२','೨'=>'౨','૩'=>'३','૪'=>'४','૮'=>'८','೯'=>'౯','а'=>'a','Ꮟ'=>'b','ᖯ'=>'b','с'=>'c','ԁ'=>'d','ᑯ'=>'d','е'=>'e','ә'=>'ǝ','ε'=>'ɛ','є'=>'ɛ','ք'=>'f','ց'=>'g','һ'=>'h','հ'=>'h','Ꮒ'=>'h','Ᏺ'=>'h̔','ι'=>'i','і'=>'i','Ꭵ'=>'i','ј'=>'j','յ'=>'j','ᗰ'=>'m','ո'=>'n','η'=>'n̩','ం'=>'o','ಂ'=>'o','ം'=>'o','०'=>'o','੦'=>'o','૦'=>'o','๐'=>'o','໐'=>'o','ο'=>'o','о'=>'o','օ'=>'o','ဝ'=>'o','ρ'=>'p','р'=>'p','ᴩ'=>'ᴘ','գ'=>'q','κ'=>'ĸ','к'=>'ĸ','ᴦ'=>'r','г'=>'r','ѕ'=>'s','υ'=>'u','ս'=>'u','ν'=>'v','ѵ'=>'v','Ꮃ'=>'w','ᗯ'=>'w','х'=>'x','ᕁ'=>'x','у'=>'y','Ꭹ'=>'y','ӡ'=>'ʒ','ჳ'=>'ʒ','ϩ'=>'ƨ','ь'=>'ƅ','ы'=>'ƅi','ɑ'=>'α','ծ'=>'δ','ᕷ'=>'δ','п'=>'π','ɸ'=>'φ','ф'=>'φ','ʙ'=>'в','ɜ'=>'з','ᴍ'=>'м','ʜ'=>'н','ɢ'=>'ԍ','ᴛ'=>'т','ᴙ'=>'я','ઽ'=>'ऽ','ુ'=>'ु','ૂ'=>'ू','ੋ'=>'ॆ','੍'=>'्','્'=>'्','ഉ'=>'உ','ജ'=>'ஐ','ണ'=>'ண','ഴ'=>'ழ','ി'=>'ி','ു'=>'ூ','ಅ'=>'అ','ಆ'=>'ఆ','ಇ'=>'ఇ','ಒ'=>'ఒ','ಓ'=>'ఒౕ','ಜ'=>'జ','ಞ'=>'ఞ','ಣ'=>'ణ','థ'=>'ధּ','ಯ'=>'య','ఠ'=>'రּ','ಱ'=>'ఱ','ಲ'=>'ల','ඌ'=>'ന്ന','ஶ'=>'ശ','ຈ'=>'จ','ບ'=>'บ','ປ'=>'ป','ຝ'=>'ฝ','ພ'=>'พ','ຟ'=>'ฟ','ຍ'=>'ย','។'=>'ฯ','ិ'=>'ิ','ី'=>'ี','ឹ'=>'ึ','ឺ'=>'ื','ຸ'=>'ุ','ູ'=>'ู','ᗅ'=>'A','ᒍ'=>'J','ᕼ'=>'H','ᐯ'=>'V','ᑭ'=>'P','ᗷ'=>'B','ヘ'=>'へ','𐏑'=>'𐎂','𐏓'=>'𐎓','𒀸'=>'𐎚','ᅳ'=>'一','ǀ'=>'丨','ᅵ'=>'丨','Ꭺ'=>'A','Ᏼ'=>'B','Ꮯ'=>'C','ᗞ'=>'D','Ꭼ'=>'E','ᖴ'=>'F','Ꮐ'=>'G','Ꮋ'=>'H','Ꭻ'=>'J','Ꮶ'=>'K','Ꮮ'=>'L','Ꮇ'=>'M','Ꮲ'=>'P','ᖇ'=>'R','Ꮥ'=>'S','Ꮩ'=>'V','Ꮓ'=>'Z');
diff --git a/phpBB/includes/utf/data/recode_basic.php b/phpBB/includes/utf/data/recode_basic.php
index 02e44d3e0d..8a9dc544e6 100644
--- a/phpBB/includes/utf/data/recode_basic.php
+++ b/phpBB/includes/utf/data/recode_basic.php
@@ -1539,5 +1539,3 @@ function utf8_to_cp1252($string)
);
return strtr($string, $transform);
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/utf/data/recode_cjk.php b/phpBB/includes/utf/data/recode_cjk.php
index f3f9a256d7..8c65274af0 100644
--- a/phpBB/includes/utf/data/recode_cjk.php
+++ b/phpBB/includes/utf/data/recode_cjk.php
@@ -45175,5 +45175,3 @@ function big5($string)
);
return strtr($string, $transform);
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/utf/data/search_indexer_0.php b/phpBB/includes/utf/data/search_indexer_0.php
index 3304b18cdd..e8a087c0bc 100644
--- a/phpBB/includes/utf/data/search_indexer_0.php
+++ b/phpBB/includes/utf/data/search_indexer_0.php
@@ -1 +1 @@
-<?php return array(0=>'0',1=>'1',2=>'2',3=>'3',4=>'4',5=>'5',6=>'6',7=>'7',8=>'8',9=>'9','A'=>'a','B'=>'b','C'=>'c','D'=>'d','E'=>'e','F'=>'f','G'=>'g','H'=>'h','I'=>'i','J'=>'j','K'=>'k','L'=>'l','M'=>'m','N'=>'n','O'=>'o','P'=>'p','Q'=>'q','R'=>'r','S'=>'s','T'=>'t','U'=>'u','V'=>'v','W'=>'w','X'=>'x','Y'=>'y','Z'=>'z','a'=>'a','b'=>'b','c'=>'c','d'=>'d','e'=>'e','f'=>'f','g'=>'g','h'=>'h','i'=>'i','j'=>'j','k'=>'k','l'=>'l','m'=>'m','n'=>'n','o'=>'o','p'=>'p','q'=>'q','r'=>'r','s'=>'s','t'=>'t','u'=>'u','v'=>'v','w'=>'w','x'=>'x','y'=>'y','z'=>'z','ª'=>'ª','²'=>'2','³'=>'3','µ'=>'µ','¹'=>'1','º'=>'º','¼'=>'1/4','½'=>'1/2','¾'=>'3/4','À'=>'à','Á'=>'á','Â'=>'â','Ã'=>'ã','Ä'=>'ae','Å'=>'å','Æ'=>'ae','Ç'=>'ç','È'=>'è','É'=>'é','Ê'=>'ê','Ë'=>'ë','Ì'=>'ì','Í'=>'í','Î'=>'î','Ï'=>'ï','Ð'=>'ð','Ñ'=>'ñ','Ò'=>'ò','Ó'=>'ó','Ô'=>'ô','Õ'=>'õ','Ö'=>'oe','Ø'=>'ø','Ù'=>'ù','Ú'=>'ú','Û'=>'û','Ü'=>'ü','Ý'=>'ý','Þ'=>'þ','ß'=>'ss','à'=>'à','á'=>'á','â'=>'â','ã'=>'ã','ä'=>'ae','å'=>'å','æ'=>'ae','ç'=>'ç','è'=>'è','é'=>'é','ê'=>'ê','ë'=>'ë','ì'=>'ì','í'=>'í','î'=>'î','ï'=>'ï','ð'=>'ð','ñ'=>'ñ','ò'=>'ò','ó'=>'ó','ô'=>'ô','õ'=>'õ','ö'=>'oe','ø'=>'ø','ù'=>'ù','ú'=>'ú','û'=>'û','ü'=>'ue','ý'=>'ý','þ'=>'þ','ÿ'=>'ÿ','Ā'=>'ā','ā'=>'ā','Ă'=>'ă','ă'=>'ă','Ą'=>'ą','ą'=>'ą','Ć'=>'ć','ć'=>'ć','Ĉ'=>'ĉ','ĉ'=>'ĉ','Ċ'=>'ċ','ċ'=>'ċ','Č'=>'č','č'=>'č','Ď'=>'ď','ď'=>'ď','Đ'=>'đ','đ'=>'đ','Ē'=>'ē','ē'=>'ē','Ĕ'=>'ĕ','ĕ'=>'ĕ','Ė'=>'ė','ė'=>'ė','Ę'=>'ę','ę'=>'ę','Ě'=>'ě','ě'=>'ě','Ĝ'=>'ĝ','ĝ'=>'ĝ','Ğ'=>'ğ','ğ'=>'ğ','Ġ'=>'ġ','ġ'=>'ġ','Ģ'=>'ģ','ģ'=>'ģ','Ĥ'=>'ĥ','ĥ'=>'ĥ','Ħ'=>'ħ','ħ'=>'ħ','Ĩ'=>'ĩ','ĩ'=>'ĩ','Ī'=>'ī','ī'=>'ī','Ĭ'=>'ĭ','ĭ'=>'ĭ','Į'=>'į','į'=>'į','İ'=>'i','ı'=>'ı','IJ'=>'ij','ij'=>'ij','Ĵ'=>'ĵ','ĵ'=>'ĵ','Ķ'=>'ķ','ķ'=>'ķ','ĸ'=>'ĸ','Ĺ'=>'ĺ','ĺ'=>'ĺ','Ļ'=>'ļ','ļ'=>'ļ','Ľ'=>'ľ','ľ'=>'ľ','Ŀ'=>'ŀ','ŀ'=>'ŀ','Ł'=>'ł','ł'=>'ł','Ń'=>'ń','ń'=>'ń','Ņ'=>'ņ','ņ'=>'ņ','Ň'=>'ň','ň'=>'ň','ʼn'=>'ʼn','Ŋ'=>'ŋ','ŋ'=>'ŋ','Ō'=>'ō','ō'=>'ō','Ŏ'=>'ŏ','ŏ'=>'ŏ','Ő'=>'ő','ő'=>'ő','Œ'=>'oe','œ'=>'oe','Ŕ'=>'ŕ','ŕ'=>'ŕ','Ŗ'=>'ŗ','ŗ'=>'ŗ','Ř'=>'ř','ř'=>'ř','Ś'=>'ś','ś'=>'ś','Ŝ'=>'ŝ','ŝ'=>'ŝ','Ş'=>'ş','ş'=>'ş','Š'=>'š','š'=>'š','Ţ'=>'ţ','ţ'=>'ţ','Ť'=>'ť','ť'=>'ť','Ŧ'=>'ŧ','ŧ'=>'ŧ','Ũ'=>'ũ','ũ'=>'ũ','Ū'=>'ū','ū'=>'ū','Ŭ'=>'ŭ','ŭ'=>'ŭ','Ů'=>'ů','ů'=>'ů','Ű'=>'ű','ű'=>'ű','Ų'=>'ų','ų'=>'ų','Ŵ'=>'ŵ','ŵ'=>'ŵ','Ŷ'=>'ŷ','ŷ'=>'ŷ','Ÿ'=>'ÿ','Ź'=>'ź','ź'=>'ź','Ż'=>'ż','ż'=>'ż','Ž'=>'ž','ž'=>'ž','ſ'=>'ſ','ƀ'=>'ƀ','Ɓ'=>'ɓ','Ƃ'=>'ƃ','ƃ'=>'ƃ','Ƅ'=>'ƅ','ƅ'=>'ƅ','Ɔ'=>'ɔ','Ƈ'=>'ƈ','ƈ'=>'ƈ','Ɖ'=>'ɖ','Ɗ'=>'ɗ','Ƌ'=>'ƌ','ƌ'=>'ƌ','ƍ'=>'ƍ','Ǝ'=>'ǝ','Ə'=>'ə','Ɛ'=>'ɛ','Ƒ'=>'ƒ','ƒ'=>'ƒ','Ɠ'=>'ɠ','Ɣ'=>'ɣ','ƕ'=>'hv','Ɩ'=>'ɩ','Ɨ'=>'ɨ','Ƙ'=>'ƙ','ƙ'=>'ƙ','ƚ'=>'ƚ','ƛ'=>'ƛ','Ɯ'=>'ɯ','Ɲ'=>'ɲ','ƞ'=>'ƞ','Ɵ'=>'ɵ','Ơ'=>'ơ','ơ'=>'ơ','Ƣ'=>'oi','ƣ'=>'oi','Ƥ'=>'ƥ','ƥ'=>'ƥ','Ʀ'=>'yr','Ƨ'=>'ƨ','ƨ'=>'ƨ','Ʃ'=>'ʃ','ƪ'=>'ƪ','ƫ'=>'ƫ','Ƭ'=>'ƭ','ƭ'=>'ƭ','Ʈ'=>'ʈ','Ư'=>'ư','ư'=>'ư','Ʊ'=>'ʊ','Ʋ'=>'ʋ','Ƴ'=>'ƴ','ƴ'=>'ƴ','Ƶ'=>'ƶ','ƶ'=>'ƶ','Ʒ'=>'ʒ','Ƹ'=>'ƹ','ƹ'=>'ƹ','ƺ'=>'ƺ','ƻ'=>'ƻ','Ƽ'=>'ƽ','ƽ'=>'ƽ','ƾ'=>'ƾ','ƿ'=>'ƿ','ǀ'=>'ǀ','ǁ'=>'ǁ','ǂ'=>'ǂ','ǃ'=>'ǃ','DŽ'=>'dž','Dž'=>'dž','dž'=>'dž','LJ'=>'lj','Lj'=>'lj','lj'=>'lj','NJ'=>'nj','Nj'=>'nj','nj'=>'nj','Ǎ'=>'ǎ','ǎ'=>'ǎ','Ǐ'=>'ǐ','ǐ'=>'ǐ','Ǒ'=>'ǒ','ǒ'=>'ǒ','Ǔ'=>'ǔ','ǔ'=>'ǔ','Ǖ'=>'ǖ','ǖ'=>'ǖ','Ǘ'=>'ǘ','ǘ'=>'ǘ','Ǚ'=>'ǚ','ǚ'=>'ǚ','Ǜ'=>'ǜ','ǜ'=>'ǜ','ǝ'=>'ǝ','Ǟ'=>'ǟ','ǟ'=>'ǟ','Ǡ'=>'ǡ','ǡ'=>'ǡ','Ǣ'=>'ǣ','ǣ'=>'ǣ','Ǥ'=>'ǥ','ǥ'=>'ǥ','Ǧ'=>'ǧ','ǧ'=>'ǧ','Ǩ'=>'ǩ','ǩ'=>'ǩ','Ǫ'=>'ǫ','ǫ'=>'ǫ','Ǭ'=>'ǭ','ǭ'=>'ǭ','Ǯ'=>'ǯ','ǯ'=>'ǯ','ǰ'=>'ǰ','DZ'=>'dz','Dz'=>'dz','dz'=>'dz','Ǵ'=>'ǵ','ǵ'=>'ǵ','Ƕ'=>'ƕ','Ƿ'=>'ƿ','Ǹ'=>'ǹ','ǹ'=>'ǹ','Ǻ'=>'ǻ','ǻ'=>'ǻ','Ǽ'=>'ǽ','ǽ'=>'ǽ','Ǿ'=>'ǿ','ǿ'=>'ǿ','Ȁ'=>'ȁ','ȁ'=>'ȁ','Ȃ'=>'ȃ','ȃ'=>'ȃ','Ȅ'=>'ȅ','ȅ'=>'ȅ','Ȇ'=>'ȇ','ȇ'=>'ȇ','Ȉ'=>'ȉ','ȉ'=>'ȉ','Ȋ'=>'ȋ','ȋ'=>'ȋ','Ȍ'=>'ȍ','ȍ'=>'ȍ','Ȏ'=>'ȏ','ȏ'=>'ȏ','Ȑ'=>'ȑ','ȑ'=>'ȑ','Ȓ'=>'ȓ','ȓ'=>'ȓ','Ȕ'=>'ȕ','ȕ'=>'ȕ','Ȗ'=>'ȗ','ȗ'=>'ȗ','Ș'=>'ș','ș'=>'ș','Ț'=>'ț','ț'=>'ț','Ȝ'=>'ȝ','ȝ'=>'ȝ','Ȟ'=>'ȟ','ȟ'=>'ȟ','Ƞ'=>'ƞ','ȡ'=>'ȡ','Ȣ'=>'ou','ȣ'=>'ou','Ȥ'=>'ȥ','ȥ'=>'ȥ','Ȧ'=>'ȧ','ȧ'=>'ȧ','Ȩ'=>'ȩ','ȩ'=>'ȩ','Ȫ'=>'ȫ','ȫ'=>'ȫ','Ȭ'=>'ȭ','ȭ'=>'ȭ','Ȯ'=>'ȯ','ȯ'=>'ȯ','Ȱ'=>'ȱ','ȱ'=>'ȱ','Ȳ'=>'ȳ','ȳ'=>'ȳ','ȴ'=>'ȴ','ȵ'=>'ȵ','ȶ'=>'ȶ','ȷ'=>'ȷ','ȸ'=>'ȸ','ȹ'=>'ȹ','Ⱥ'=>'ⱥ','Ȼ'=>'ȼ','ȼ'=>'ȼ','Ƚ'=>'ƚ','Ⱦ'=>'ⱦ','ȿ'=>'ȿ','ɀ'=>'ɀ','Ɂ'=>'ɂ','ɂ'=>'ɂ','Ƀ'=>'ƀ','Ʉ'=>'ʉ','Ʌ'=>'ʌ','Ɇ'=>'ɇ','ɇ'=>'ɇ','Ɉ'=>'ɉ','ɉ'=>'ɉ','Ɋ'=>'ɋ','ɋ'=>'ɋ','Ɍ'=>'ɍ','ɍ'=>'ɍ','Ɏ'=>'ɏ','ɏ'=>'ɏ','ɐ'=>'ɐ','ɑ'=>'ɑ','ɒ'=>'ɒ','ɓ'=>'ɓ','ɔ'=>'ɔ','ɕ'=>'ɕ','ɖ'=>'ɖ','ɗ'=>'ɗ','ɘ'=>'ɘ','ə'=>'ə','ɚ'=>'ɚ','ɛ'=>'ɛ','ɜ'=>'ɜ','ɝ'=>'ɝ','ɞ'=>'ɞ','ɟ'=>'ɟ','ɠ'=>'ɠ','ɡ'=>'ɡ','ɢ'=>'ɢ','ɣ'=>'ɣ','ɤ'=>'ɤ','ɥ'=>'ɥ','ɦ'=>'ɦ','ɧ'=>'ɧ','ɨ'=>'ɨ','ɩ'=>'ɩ','ɪ'=>'ɪ','ɫ'=>'ɫ','ɬ'=>'ɬ','ɭ'=>'ɭ','ɮ'=>'ɮ','ɯ'=>'ɯ','ɰ'=>'ɰ','ɱ'=>'ɱ','ɲ'=>'ɲ','ɳ'=>'ɳ','ɴ'=>'ɴ','ɵ'=>'ɵ','ɶ'=>'ɶ','ɷ'=>'ɷ','ɸ'=>'ɸ','ɹ'=>'ɹ','ɺ'=>'ɺ','ɻ'=>'ɻ','ɼ'=>'ɼ','ɽ'=>'ɽ','ɾ'=>'ɾ','ɿ'=>'ɿ','ʀ'=>'ʀ','ʁ'=>'ʁ','ʂ'=>'ʂ','ʃ'=>'ʃ','ʄ'=>'ʄ','ʅ'=>'ʅ','ʆ'=>'ʆ','ʇ'=>'ʇ','ʈ'=>'ʈ','ʉ'=>'ʉ','ʊ'=>'ʊ','ʋ'=>'ʋ','ʌ'=>'ʌ','ʍ'=>'ʍ','ʎ'=>'ʎ','ʏ'=>'ʏ','ʐ'=>'ʐ','ʑ'=>'ʑ','ʒ'=>'ʒ','ʓ'=>'ʓ','ʔ'=>'ʔ','ʕ'=>'ʕ','ʖ'=>'ʖ','ʗ'=>'ʗ','ʘ'=>'ʘ','ʙ'=>'ʙ','ʚ'=>'ʚ','ʛ'=>'ʛ','ʜ'=>'ʜ','ʝ'=>'ʝ','ʞ'=>'ʞ','ʟ'=>'ʟ','ʠ'=>'ʠ','ʡ'=>'ʡ','ʢ'=>'ʢ','ʣ'=>'ʣ','ʤ'=>'ʤ','ʥ'=>'ʥ','ʦ'=>'ʦ','ʧ'=>'ʧ','ʨ'=>'ʨ','ʩ'=>'ʩ','ʪ'=>'ʪ','ʫ'=>'ʫ','ʬ'=>'ʬ','ʭ'=>'ʭ','ʮ'=>'ʮ','ʯ'=>'ʯ','ʰ'=>'ʰ','ʱ'=>'ʱ','ʲ'=>'ʲ','ʳ'=>'ʳ','ʴ'=>'ʴ','ʵ'=>'ʵ','ʶ'=>'ʶ','ʷ'=>'ʷ','ʸ'=>'ʸ','ʹ'=>'ʹ','ʺ'=>'ʺ','ʻ'=>'ʻ','ʼ'=>'ʼ','ʽ'=>'ʽ','ʾ'=>'ʾ','ʿ'=>'ʿ','ˀ'=>'ˀ','ˁ'=>'ˁ','ˆ'=>'ˆ','ˇ'=>'ˇ','ˈ'=>'ˈ','ˉ'=>'ˉ','ˊ'=>'ˊ','ˋ'=>'ˋ','ˌ'=>'ˌ','ˍ'=>'ˍ','ˎ'=>'ˎ','ˏ'=>'ˏ','ː'=>'ː','ˑ'=>'ˑ','ˠ'=>'ˠ','ˡ'=>'ˡ','ˢ'=>'ˢ','ˣ'=>'ˣ','ˤ'=>'ˤ','ˮ'=>'ˮ','̀'=>'̀','́'=>'́','̂'=>'̂','̃'=>'̃','̄'=>'̄','̅'=>'̅','̆'=>'̆','̇'=>'̇','̈'=>'̈','̉'=>'̉','̊'=>'̊','̋'=>'̋','̌'=>'̌','̍'=>'̍','̎'=>'̎','̏'=>'̏','̐'=>'̐','̑'=>'̑','̒'=>'̒','̓'=>'̓','̔'=>'̔','̕'=>'̕','̖'=>'̖','̗'=>'̗','̘'=>'̘','̙'=>'̙','̚'=>'̚','̛'=>'̛','̜'=>'̜','̝'=>'̝','̞'=>'̞','̟'=>'̟','̠'=>'̠','̡'=>'̡','̢'=>'̢','̣'=>'̣','̤'=>'̤','̥'=>'̥','̦'=>'̦','̧'=>'̧','̨'=>'̨','̩'=>'̩','̪'=>'̪','̫'=>'̫','̬'=>'̬','̭'=>'̭','̮'=>'̮','̯'=>'̯','̰'=>'̰','̱'=>'̱','̲'=>'̲','̳'=>'̳','̴'=>'̴','̵'=>'̵','̶'=>'̶','̷'=>'̷','̸'=>'̸','̹'=>'̹','̺'=>'̺','̻'=>'̻','̼'=>'̼','̽'=>'̽','̾'=>'̾','̿'=>'̿','̀'=>'̀','́'=>'́','͂'=>'͂','̓'=>'̓','̈́'=>'̈́','ͅ'=>'ͅ','͆'=>'͆','͇'=>'͇','͈'=>'͈','͉'=>'͉','͊'=>'͊','͋'=>'͋','͌'=>'͌','͍'=>'͍','͎'=>'͎','͏'=>'͏','͐'=>'͐','͑'=>'͑','͒'=>'͒','͓'=>'͓','͔'=>'͔','͕'=>'͕','͖'=>'͖','͗'=>'͗','͘'=>'͘','͙'=>'͙','͚'=>'͚','͛'=>'͛','͜'=>'͜','͝'=>'͝','͞'=>'͞','͟'=>'͟','͠'=>'͠','͡'=>'͡','͢'=>'͢','ͣ'=>'ͣ','ͤ'=>'ͤ','ͥ'=>'ͥ','ͦ'=>'ͦ','ͧ'=>'ͧ','ͨ'=>'ͨ','ͩ'=>'ͩ','ͪ'=>'ͪ','ͫ'=>'ͫ','ͬ'=>'ͬ','ͭ'=>'ͭ','ͮ'=>'ͮ','ͯ'=>'ͯ','ͺ'=>'ͺ','ͻ'=>'ͻ','ͼ'=>'ͼ','ͽ'=>'ͽ','Ά'=>'ά','Έ'=>'έ','Ή'=>'ή','Ί'=>'ί','Ό'=>'ό','Ύ'=>'ύ','Ώ'=>'ώ','ΐ'=>'ΐ','Α'=>'α','Β'=>'β','Γ'=>'γ','Δ'=>'δ','Ε'=>'ε','Ζ'=>'ζ','Η'=>'η','Θ'=>'θ','Ι'=>'ι','Κ'=>'κ','Λ'=>'λ','Μ'=>'μ','Ν'=>'ν','Ξ'=>'ξ','Ο'=>'ο','Π'=>'π','Ρ'=>'ρ','Σ'=>'σ','Τ'=>'τ','Υ'=>'υ','Φ'=>'φ','Χ'=>'χ','Ψ'=>'ψ','Ω'=>'ω','Ϊ'=>'ϊ','Ϋ'=>'ϋ','ά'=>'ά','έ'=>'έ','ή'=>'ή','ί'=>'ί','ΰ'=>'ΰ','α'=>'α','β'=>'β','γ'=>'γ','δ'=>'δ','ε'=>'ε','ζ'=>'ζ','η'=>'η','θ'=>'θ','ι'=>'ι','κ'=>'κ','λ'=>'λ','μ'=>'μ','ν'=>'ν','ξ'=>'ξ','ο'=>'ο','π'=>'π','ρ'=>'ρ','ς'=>'ς','σ'=>'σ','τ'=>'τ','υ'=>'υ','φ'=>'φ','χ'=>'χ','ψ'=>'ψ','ω'=>'ω','ϊ'=>'ϊ','ϋ'=>'ϋ','ό'=>'ό','ύ'=>'ύ','ώ'=>'ώ','ϐ'=>'ϐ','ϑ'=>'ϑ','ϒ'=>'ϒ','ϓ'=>'ϓ','ϔ'=>'ϔ','ϕ'=>'ϕ','ϖ'=>'ϖ','ϗ'=>'ϗ','Ϙ'=>'ϙ','ϙ'=>'ϙ','Ϛ'=>'ϛ','ϛ'=>'ϛ','Ϝ'=>'ϝ','ϝ'=>'ϝ','Ϟ'=>'ϟ','ϟ'=>'ϟ','Ϡ'=>'ϡ','ϡ'=>'ϡ','Ϣ'=>'ϣ','ϣ'=>'ϣ','Ϥ'=>'ϥ','ϥ'=>'ϥ','Ϧ'=>'ϧ','ϧ'=>'ϧ','Ϩ'=>'ϩ','ϩ'=>'ϩ','Ϫ'=>'ϫ','ϫ'=>'ϫ','Ϭ'=>'ϭ','ϭ'=>'ϭ','Ϯ'=>'ϯ','ϯ'=>'ϯ','ϰ'=>'ϰ','ϱ'=>'ϱ','ϲ'=>'ϲ','ϳ'=>'ϳ','ϴ'=>'θ','ϵ'=>'ϵ','Ϸ'=>'ϸ','ϸ'=>'ϸ','Ϲ'=>'ϲ','Ϻ'=>'ϻ','ϻ'=>'ϻ','ϼ'=>'ϼ','Ͻ'=>'ͻ','Ͼ'=>'ͼ','Ͽ'=>'ͽ','Ѐ'=>'ѐ','Ё'=>'ё','Ђ'=>'ђ','Ѓ'=>'ѓ','Є'=>'є','Ѕ'=>'ѕ','І'=>'і','Ї'=>'ї','Ј'=>'ј','Љ'=>'љ','Њ'=>'њ','Ћ'=>'ћ','Ќ'=>'ќ','Ѝ'=>'ѝ','Ў'=>'ў','Џ'=>'џ','А'=>'а','Б'=>'б','В'=>'в','Г'=>'г','Д'=>'д','Е'=>'е','Ж'=>'ж','З'=>'з','И'=>'и','Й'=>'й','К'=>'к','Л'=>'л','М'=>'м','Н'=>'н','О'=>'о','П'=>'п','Р'=>'р','С'=>'с','Т'=>'т','У'=>'у','Ф'=>'ф','Х'=>'х','Ц'=>'ц','Ч'=>'ч','Ш'=>'ш','Щ'=>'щ','Ъ'=>'ъ','Ы'=>'ы','Ь'=>'ь','Э'=>'э','Ю'=>'ю','Я'=>'я','а'=>'а','б'=>'б','в'=>'в','г'=>'г','д'=>'д','е'=>'е','ж'=>'ж','з'=>'з','и'=>'и','й'=>'й','к'=>'к','л'=>'л','м'=>'м','н'=>'н','о'=>'о','п'=>'п','р'=>'р','с'=>'с','т'=>'т','у'=>'у','ф'=>'ф','х'=>'х','ц'=>'ц','ч'=>'ч','ш'=>'ш','щ'=>'щ','ъ'=>'ъ','ы'=>'ы','ь'=>'ь','э'=>'э','ю'=>'ю','я'=>'я','ѐ'=>'ѐ','ё'=>'ё','ђ'=>'ђ','ѓ'=>'ѓ','є'=>'є','ѕ'=>'ѕ','і'=>'і','ї'=>'ї','ј'=>'ј','љ'=>'љ','њ'=>'њ','ћ'=>'ћ','ќ'=>'ќ','ѝ'=>'ѝ','ў'=>'ў','џ'=>'џ','Ѡ'=>'ѡ','ѡ'=>'ѡ','Ѣ'=>'ѣ','ѣ'=>'ѣ','Ѥ'=>'ѥ','ѥ'=>'ѥ','Ѧ'=>'ѧ','ѧ'=>'ѧ','Ѩ'=>'ѩ','ѩ'=>'ѩ','Ѫ'=>'ѫ','ѫ'=>'ѫ','Ѭ'=>'ѭ','ѭ'=>'ѭ','Ѯ'=>'ѯ','ѯ'=>'ѯ','Ѱ'=>'ѱ','ѱ'=>'ѱ','Ѳ'=>'ѳ','ѳ'=>'ѳ','Ѵ'=>'ѵ','ѵ'=>'ѵ','Ѷ'=>'ѷ','ѷ'=>'ѷ','Ѹ'=>'ѹ','ѹ'=>'ѹ','Ѻ'=>'ѻ','ѻ'=>'ѻ','Ѽ'=>'ѽ','ѽ'=>'ѽ','Ѿ'=>'ѿ','ѿ'=>'ѿ','Ҁ'=>'ҁ','ҁ'=>'ҁ','҃'=>'҃','҄'=>'҄','҅'=>'҅','҆'=>'҆','҈'=>'҈','҉'=>'҉','Ҋ'=>'ҋ','ҋ'=>'ҋ','Ҍ'=>'ҍ','ҍ'=>'ҍ','Ҏ'=>'ҏ','ҏ'=>'ҏ','Ґ'=>'ґ','ґ'=>'ґ','Ғ'=>'ғ','ғ'=>'ғ','Ҕ'=>'ҕ','ҕ'=>'ҕ','Җ'=>'җ','җ'=>'җ','Ҙ'=>'ҙ','ҙ'=>'ҙ','Қ'=>'қ','қ'=>'қ','Ҝ'=>'ҝ','ҝ'=>'ҝ','Ҟ'=>'ҟ','ҟ'=>'ҟ','Ҡ'=>'ҡ','ҡ'=>'ҡ','Ң'=>'ң','ң'=>'ң','Ҥ'=>'ҥ','ҥ'=>'ҥ','Ҧ'=>'ҧ','ҧ'=>'ҧ','Ҩ'=>'ҩ','ҩ'=>'ҩ','Ҫ'=>'ҫ','ҫ'=>'ҫ','Ҭ'=>'ҭ','ҭ'=>'ҭ','Ү'=>'ү','ү'=>'ү','Ұ'=>'ұ','ұ'=>'ұ','Ҳ'=>'ҳ','ҳ'=>'ҳ','Ҵ'=>'ҵ','ҵ'=>'ҵ','Ҷ'=>'ҷ','ҷ'=>'ҷ','Ҹ'=>'ҹ','ҹ'=>'ҹ','Һ'=>'һ','һ'=>'һ','Ҽ'=>'ҽ','ҽ'=>'ҽ','Ҿ'=>'ҿ','ҿ'=>'ҿ','Ӏ'=>'ӏ','Ӂ'=>'ӂ','ӂ'=>'ӂ','Ӄ'=>'ӄ','ӄ'=>'ӄ','Ӆ'=>'ӆ','ӆ'=>'ӆ','Ӈ'=>'ӈ','ӈ'=>'ӈ','Ӊ'=>'ӊ','ӊ'=>'ӊ','Ӌ'=>'ӌ','ӌ'=>'ӌ','Ӎ'=>'ӎ','ӎ'=>'ӎ','ӏ'=>'ӏ','Ӑ'=>'ӑ','ӑ'=>'ӑ','Ӓ'=>'ӓ','ӓ'=>'ӓ','Ӕ'=>'ӕ','ӕ'=>'ӕ','Ӗ'=>'ӗ','ӗ'=>'ӗ','Ә'=>'ә','ә'=>'ә','Ӛ'=>'ӛ','ӛ'=>'ӛ','Ӝ'=>'ӝ','ӝ'=>'ӝ','Ӟ'=>'ӟ','ӟ'=>'ӟ','Ӡ'=>'ӡ','ӡ'=>'ӡ','Ӣ'=>'ӣ','ӣ'=>'ӣ','Ӥ'=>'ӥ','ӥ'=>'ӥ','Ӧ'=>'ӧ','ӧ'=>'ӧ','Ө'=>'ө','ө'=>'ө','Ӫ'=>'ӫ','ӫ'=>'ӫ','Ӭ'=>'ӭ','ӭ'=>'ӭ','Ӯ'=>'ӯ','ӯ'=>'ӯ','Ӱ'=>'ӱ','ӱ'=>'ӱ','Ӳ'=>'ӳ','ӳ'=>'ӳ','Ӵ'=>'ӵ','ӵ'=>'ӵ','Ӷ'=>'ӷ','ӷ'=>'ӷ','Ӹ'=>'ӹ','ӹ'=>'ӹ','Ӻ'=>'ӻ','ӻ'=>'ӻ','Ӽ'=>'ӽ','ӽ'=>'ӽ','Ӿ'=>'ӿ','ӿ'=>'ӿ','Ԁ'=>'ԁ','ԁ'=>'ԁ','Ԃ'=>'ԃ','ԃ'=>'ԃ','Ԅ'=>'ԅ','ԅ'=>'ԅ','Ԇ'=>'ԇ','ԇ'=>'ԇ','Ԉ'=>'ԉ','ԉ'=>'ԉ','Ԋ'=>'ԋ','ԋ'=>'ԋ','Ԍ'=>'ԍ','ԍ'=>'ԍ','Ԏ'=>'ԏ','ԏ'=>'ԏ','Ԑ'=>'ԑ','ԑ'=>'ԑ','Ԓ'=>'ԓ','ԓ'=>'ԓ','Ա'=>'ա','Բ'=>'բ','Գ'=>'գ','Դ'=>'դ','Ե'=>'ե','Զ'=>'զ','Է'=>'է','Ը'=>'ը','Թ'=>'թ','Ժ'=>'ժ','Ի'=>'ի','Լ'=>'լ','Խ'=>'խ','Ծ'=>'ծ','Կ'=>'կ','Հ'=>'հ','Ձ'=>'ձ','Ղ'=>'ղ','Ճ'=>'ճ','Մ'=>'մ','Յ'=>'յ','Ն'=>'ն','Շ'=>'շ','Ո'=>'ո','Չ'=>'չ','Պ'=>'պ','Ջ'=>'ջ','Ռ'=>'ռ','Ս'=>'ս','Վ'=>'վ','Տ'=>'տ','Ր'=>'ր','Ց'=>'ց','Ւ'=>'ւ','Փ'=>'փ','Ք'=>'ք','Օ'=>'օ','Ֆ'=>'ֆ','ՙ'=>'ՙ','ա'=>'ա','բ'=>'բ','գ'=>'գ','դ'=>'դ','ե'=>'ե','զ'=>'զ','է'=>'է','ը'=>'ը','թ'=>'թ','ժ'=>'ժ','ի'=>'ի','լ'=>'լ','խ'=>'խ','ծ'=>'ծ','կ'=>'կ','հ'=>'հ','ձ'=>'ձ','ղ'=>'ղ','ճ'=>'ճ','մ'=>'մ','յ'=>'յ','ն'=>'ն','շ'=>'շ','ո'=>'ո','չ'=>'չ','պ'=>'պ','ջ'=>'ջ','ռ'=>'ռ','ս'=>'ս','վ'=>'վ','տ'=>'տ','ր'=>'ր','ց'=>'ց','ւ'=>'ւ','փ'=>'փ','ք'=>'ք','օ'=>'օ','ֆ'=>'ֆ','և'=>'և','֑'=>'֑','֒'=>'֒','֓'=>'֓','֔'=>'֔','֕'=>'֕','֖'=>'֖','֗'=>'֗','֘'=>'֘','֙'=>'֙','֚'=>'֚','֛'=>'֛','֜'=>'֜','֝'=>'֝','֞'=>'֞','֟'=>'֟','֠'=>'֠','֡'=>'֡','֢'=>'֢','֣'=>'֣','֤'=>'֤','֥'=>'֥','֦'=>'֦','֧'=>'֧','֨'=>'֨','֩'=>'֩','֪'=>'֪','֫'=>'֫','֬'=>'֬','֭'=>'֭','֮'=>'֮','֯'=>'֯','ְ'=>'ְ','ֱ'=>'ֱ','ֲ'=>'ֲ','ֳ'=>'ֳ','ִ'=>'ִ','ֵ'=>'ֵ','ֶ'=>'ֶ','ַ'=>'ַ','ָ'=>'ָ','ֹ'=>'ֹ','ֺ'=>'ֺ','ֻ'=>'ֻ','ּ'=>'ּ','ֽ'=>'ֽ','ֿ'=>'ֿ','ׁ'=>'ׁ','ׂ'=>'ׂ','ׄ'=>'ׄ','ׅ'=>'ׅ','ׇ'=>'ׇ','א'=>'א','ב'=>'ב','ג'=>'ג','ד'=>'ד','ה'=>'ה','ו'=>'ו','ז'=>'ז','ח'=>'ח','ט'=>'ט','י'=>'י','ך'=>'ך','כ'=>'כ','ל'=>'ל','ם'=>'ם','מ'=>'מ','ן'=>'ן','נ'=>'נ','ס'=>'ס','ע'=>'ע','ף'=>'ף','פ'=>'פ','ץ'=>'ץ','צ'=>'צ','ק'=>'ק','ר'=>'ר','ש'=>'ש','ת'=>'ת','װ'=>'װ','ױ'=>'ױ','ײ'=>'ײ','ؐ'=>'ؐ','ؑ'=>'ؑ','ؒ'=>'ؒ','ؓ'=>'ؓ','ؔ'=>'ؔ','ؕ'=>'ؕ','ء'=>'ء','آ'=>'آ','أ'=>'أ','ؤ'=>'ؤ','إ'=>'إ','ئ'=>'ئ','ا'=>'ا','ب'=>'ب','ة'=>'ة','ت'=>'ت','ث'=>'ث','ج'=>'ج','ح'=>'ح','خ'=>'خ','د'=>'د','ذ'=>'ذ','ر'=>'ر','ز'=>'ز','س'=>'س','ش'=>'ش','ص'=>'ص','ض'=>'ض','ط'=>'ط','ظ'=>'ظ','ع'=>'ع','غ'=>'غ','ـ'=>'ـ','ف'=>'ف','ق'=>'ق','ك'=>'ك','ل'=>'ل','م'=>'م','ن'=>'ن','ه'=>'ه','و'=>'و','ى'=>'ى','ي'=>'ي','ً'=>'ً','ٌ'=>'ٌ','ٍ'=>'ٍ','َ'=>'َ','ُ'=>'ُ','ِ'=>'ِ','ّ'=>'ّ','ْ'=>'ْ','ٓ'=>'ٓ','ٔ'=>'ٔ','ٕ'=>'ٕ','ٖ'=>'ٖ','ٗ'=>'ٗ','٘'=>'٘','ٙ'=>'ٙ','ٚ'=>'ٚ','ٛ'=>'ٛ','ٜ'=>'ٜ','ٝ'=>'ٝ','ٞ'=>'ٞ','٠'=>'0','١'=>'1','٢'=>'2','٣'=>'3','٤'=>'4','٥'=>'5','٦'=>'6','٧'=>'7','٨'=>'8','٩'=>'9','ٮ'=>'ٮ','ٯ'=>'ٯ','ٰ'=>'ٰ','ٱ'=>'ٱ','ٲ'=>'ٲ','ٳ'=>'ٳ','ٴ'=>'ٴ','ٵ'=>'ٵ','ٶ'=>'ٶ','ٷ'=>'ٷ','ٸ'=>'ٸ','ٹ'=>'ٹ','ٺ'=>'ٺ','ٻ'=>'ٻ','ټ'=>'ټ','ٽ'=>'ٽ','پ'=>'پ','ٿ'=>'ٿ','ڀ'=>'ڀ','ځ'=>'ځ','ڂ'=>'ڂ','ڃ'=>'ڃ','ڄ'=>'ڄ','څ'=>'څ','چ'=>'چ','ڇ'=>'ڇ','ڈ'=>'ڈ','ډ'=>'ډ','ڊ'=>'ڊ','ڋ'=>'ڋ','ڌ'=>'ڌ','ڍ'=>'ڍ','ڎ'=>'ڎ','ڏ'=>'ڏ','ڐ'=>'ڐ','ڑ'=>'ڑ','ڒ'=>'ڒ','ړ'=>'ړ','ڔ'=>'ڔ','ڕ'=>'ڕ','ږ'=>'ږ','ڗ'=>'ڗ','ژ'=>'ژ','ڙ'=>'ڙ','ښ'=>'ښ','ڛ'=>'ڛ','ڜ'=>'ڜ','ڝ'=>'ڝ','ڞ'=>'ڞ','ڟ'=>'ڟ','ڠ'=>'ڠ','ڡ'=>'ڡ','ڢ'=>'ڢ','ڣ'=>'ڣ','ڤ'=>'ڤ','ڥ'=>'ڥ','ڦ'=>'ڦ','ڧ'=>'ڧ','ڨ'=>'ڨ','ک'=>'ک','ڪ'=>'ڪ','ګ'=>'ګ','ڬ'=>'ڬ','ڭ'=>'ڭ','ڮ'=>'ڮ','گ'=>'گ','ڰ'=>'ڰ','ڱ'=>'ڱ','ڲ'=>'ڲ','ڳ'=>'ڳ','ڴ'=>'ڴ','ڵ'=>'ڵ','ڶ'=>'ڶ','ڷ'=>'ڷ','ڸ'=>'ڸ','ڹ'=>'ڹ','ں'=>'ں','ڻ'=>'ڻ','ڼ'=>'ڼ','ڽ'=>'ڽ','ھ'=>'ھ','ڿ'=>'ڿ','ۀ'=>'ۀ','ہ'=>'ہ','ۂ'=>'ۂ','ۃ'=>'ۃ','ۄ'=>'ۄ','ۅ'=>'ۅ','ۆ'=>'ۆ','ۇ'=>'ۇ','ۈ'=>'ۈ','ۉ'=>'ۉ','ۊ'=>'ۊ','ۋ'=>'ۋ','ی'=>'ی','ۍ'=>'ۍ','ێ'=>'ێ','ۏ'=>'ۏ','ې'=>'ې','ۑ'=>'ۑ','ے'=>'ے','ۓ'=>'ۓ','ە'=>'ە','ۖ'=>'ۖ','ۗ'=>'ۗ','ۘ'=>'ۘ','ۙ'=>'ۙ','ۚ'=>'ۚ','ۛ'=>'ۛ','ۜ'=>'ۜ','۞'=>'۞','۟'=>'۟','۠'=>'۠','ۡ'=>'ۡ','ۢ'=>'ۢ','ۣ'=>'ۣ','ۤ'=>'ۤ','ۥ'=>'ۥ','ۦ'=>'ۦ','ۧ'=>'ۧ','ۨ'=>'ۨ','۪'=>'۪','۫'=>'۫','۬'=>'۬','ۭ'=>'ۭ','ۮ'=>'ۮ','ۯ'=>'ۯ','۰'=>'0','۱'=>'1','۲'=>'2','۳'=>'3','۴'=>'4','۵'=>'5','۶'=>'6','۷'=>'7','۸'=>'8','۹'=>'9','ۺ'=>'ۺ','ۻ'=>'ۻ','ۼ'=>'ۼ','ۿ'=>'ۿ','ܐ'=>'ܐ','ܑ'=>'ܑ','ܒ'=>'ܒ','ܓ'=>'ܓ','ܔ'=>'ܔ','ܕ'=>'ܕ','ܖ'=>'ܖ','ܗ'=>'ܗ','ܘ'=>'ܘ','ܙ'=>'ܙ','ܚ'=>'ܚ','ܛ'=>'ܛ','ܜ'=>'ܜ','ܝ'=>'ܝ','ܞ'=>'ܞ','ܟ'=>'ܟ','ܠ'=>'ܠ','ܡ'=>'ܡ','ܢ'=>'ܢ','ܣ'=>'ܣ','ܤ'=>'ܤ','ܥ'=>'ܥ','ܦ'=>'ܦ','ܧ'=>'ܧ','ܨ'=>'ܨ','ܩ'=>'ܩ','ܪ'=>'ܪ','ܫ'=>'ܫ','ܬ'=>'ܬ','ܭ'=>'ܭ','ܮ'=>'ܮ','ܯ'=>'ܯ','ܰ'=>'ܰ','ܱ'=>'ܱ','ܲ'=>'ܲ','ܳ'=>'ܳ','ܴ'=>'ܴ','ܵ'=>'ܵ','ܶ'=>'ܶ','ܷ'=>'ܷ','ܸ'=>'ܸ','ܹ'=>'ܹ','ܺ'=>'ܺ','ܻ'=>'ܻ','ܼ'=>'ܼ','ܽ'=>'ܽ','ܾ'=>'ܾ','ܿ'=>'ܿ','݀'=>'݀','݁'=>'݁','݂'=>'݂','݃'=>'݃','݄'=>'݄','݅'=>'݅','݆'=>'݆','݇'=>'݇','݈'=>'݈','݉'=>'݉','݊'=>'݊','ݍ'=>'ݍ','ݎ'=>'ݎ','ݏ'=>'ݏ','ݐ'=>'ݐ','ݑ'=>'ݑ','ݒ'=>'ݒ','ݓ'=>'ݓ','ݔ'=>'ݔ','ݕ'=>'ݕ','ݖ'=>'ݖ','ݗ'=>'ݗ','ݘ'=>'ݘ','ݙ'=>'ݙ','ݚ'=>'ݚ','ݛ'=>'ݛ','ݜ'=>'ݜ','ݝ'=>'ݝ','ݞ'=>'ݞ','ݟ'=>'ݟ','ݠ'=>'ݠ','ݡ'=>'ݡ','ݢ'=>'ݢ','ݣ'=>'ݣ','ݤ'=>'ݤ','ݥ'=>'ݥ','ݦ'=>'ݦ','ݧ'=>'ݧ','ݨ'=>'ݨ','ݩ'=>'ݩ','ݪ'=>'ݪ','ݫ'=>'ݫ','ݬ'=>'ݬ','ݭ'=>'ݭ','ހ'=>'ހ','ށ'=>'ށ','ނ'=>'ނ','ރ'=>'ރ','ބ'=>'ބ','ޅ'=>'ޅ','ކ'=>'ކ','އ'=>'އ','ވ'=>'ވ','މ'=>'މ','ފ'=>'ފ','ދ'=>'ދ','ތ'=>'ތ','ލ'=>'ލ','ގ'=>'ގ','ޏ'=>'ޏ','ސ'=>'ސ','ޑ'=>'ޑ','ޒ'=>'ޒ','ޓ'=>'ޓ','ޔ'=>'ޔ','ޕ'=>'ޕ','ޖ'=>'ޖ','ޗ'=>'ޗ','ޘ'=>'ޘ','ޙ'=>'ޙ','ޚ'=>'ޚ','ޛ'=>'ޛ','ޜ'=>'ޜ','ޝ'=>'ޝ','ޞ'=>'ޞ','ޟ'=>'ޟ','ޠ'=>'ޠ','ޡ'=>'ޡ','ޢ'=>'ޢ','ޣ'=>'ޣ','ޤ'=>'ޤ','ޥ'=>'ޥ','ަ'=>'ަ','ާ'=>'ާ','ި'=>'ި','ީ'=>'ީ','ު'=>'ު','ޫ'=>'ޫ','ެ'=>'ެ','ޭ'=>'ޭ','ޮ'=>'ޮ','ޯ'=>'ޯ','ް'=>'ް','ޱ'=>'ޱ','߀'=>'0','߁'=>'1','߂'=>'2','߃'=>'3','߄'=>'4','߅'=>'5','߆'=>'6','߇'=>'7','߈'=>'8','߉'=>'9','ߊ'=>'ߊ','ߋ'=>'ߋ','ߌ'=>'ߌ','ߍ'=>'ߍ','ߎ'=>'ߎ','ߏ'=>'ߏ','ߐ'=>'ߐ','ߑ'=>'ߑ','ߒ'=>'ߒ','ߓ'=>'ߓ','ߔ'=>'ߔ','ߕ'=>'ߕ','ߖ'=>'ߖ','ߗ'=>'ߗ','ߘ'=>'ߘ','ߙ'=>'ߙ','ߚ'=>'ߚ','ߛ'=>'ߛ','ߜ'=>'ߜ','ߝ'=>'ߝ','ߞ'=>'ߞ','ߟ'=>'ߟ','ߠ'=>'ߠ','ߡ'=>'ߡ','ߢ'=>'ߢ','ߣ'=>'ߣ','ߤ'=>'ߤ','ߥ'=>'ߥ','ߦ'=>'ߦ','ߧ'=>'ߧ','ߨ'=>'ߨ','ߩ'=>'ߩ','ߪ'=>'ߪ','߫'=>'߫','߬'=>'߬','߭'=>'߭','߮'=>'߮','߯'=>'߯','߰'=>'߰','߱'=>'߱','߲'=>'߲','߳'=>'߳','ߴ'=>'ߴ','ߵ'=>'ߵ','ߺ'=>'ߺ'); \ No newline at end of file
+<?php return array(0=>'0',1=>'1',2=>'2',3=>'3',4=>'4',5=>'5',6=>'6',7=>'7',8=>'8',9=>'9','A'=>'a','B'=>'b','C'=>'c','D'=>'d','E'=>'e','F'=>'f','G'=>'g','H'=>'h','I'=>'i','J'=>'j','K'=>'k','L'=>'l','M'=>'m','N'=>'n','O'=>'o','P'=>'p','Q'=>'q','R'=>'r','S'=>'s','T'=>'t','U'=>'u','V'=>'v','W'=>'w','X'=>'x','Y'=>'y','Z'=>'z','a'=>'a','b'=>'b','c'=>'c','d'=>'d','e'=>'e','f'=>'f','g'=>'g','h'=>'h','i'=>'i','j'=>'j','k'=>'k','l'=>'l','m'=>'m','n'=>'n','o'=>'o','p'=>'p','q'=>'q','r'=>'r','s'=>'s','t'=>'t','u'=>'u','v'=>'v','w'=>'w','x'=>'x','y'=>'y','z'=>'z','ª'=>'ª','²'=>'2','³'=>'3','µ'=>'µ','¹'=>'1','º'=>'º','¼'=>'1/4','½'=>'1/2','¾'=>'3/4','À'=>'à','Á'=>'á','Â'=>'â','Ã'=>'ã','Ä'=>'ae','Å'=>'å','Æ'=>'ae','Ç'=>'ç','È'=>'è','É'=>'é','Ê'=>'ê','Ë'=>'ë','Ì'=>'ì','Í'=>'í','Î'=>'î','Ï'=>'ï','Ð'=>'ð','Ñ'=>'ñ','Ò'=>'ò','Ó'=>'ó','Ô'=>'ô','Õ'=>'õ','Ö'=>'oe','Ø'=>'ø','Ù'=>'ù','Ú'=>'ú','Û'=>'û','Ü'=>'ü','Ý'=>'ý','Þ'=>'þ','ß'=>'ss','à'=>'à','á'=>'á','â'=>'â','ã'=>'ã','ä'=>'ae','å'=>'å','æ'=>'ae','ç'=>'ç','è'=>'è','é'=>'é','ê'=>'ê','ë'=>'ë','ì'=>'ì','í'=>'í','î'=>'î','ï'=>'ï','ð'=>'ð','ñ'=>'ñ','ò'=>'ò','ó'=>'ó','ô'=>'ô','õ'=>'õ','ö'=>'oe','ø'=>'ø','ù'=>'ù','ú'=>'ú','û'=>'û','ü'=>'ue','ý'=>'ý','þ'=>'þ','ÿ'=>'ÿ','Ā'=>'ā','ā'=>'ā','Ă'=>'ă','ă'=>'ă','Ą'=>'ą','ą'=>'ą','Ć'=>'ć','ć'=>'ć','Ĉ'=>'ĉ','ĉ'=>'ĉ','Ċ'=>'ċ','ċ'=>'ċ','Č'=>'č','č'=>'č','Ď'=>'ď','ď'=>'ď','Đ'=>'đ','đ'=>'đ','Ē'=>'ē','ē'=>'ē','Ĕ'=>'ĕ','ĕ'=>'ĕ','Ė'=>'ė','ė'=>'ė','Ę'=>'ę','ę'=>'ę','Ě'=>'ě','ě'=>'ě','Ĝ'=>'ĝ','ĝ'=>'ĝ','Ğ'=>'ğ','ğ'=>'ğ','Ġ'=>'ġ','ġ'=>'ġ','Ģ'=>'ģ','ģ'=>'ģ','Ĥ'=>'ĥ','ĥ'=>'ĥ','Ħ'=>'ħ','ħ'=>'ħ','Ĩ'=>'ĩ','ĩ'=>'ĩ','Ī'=>'ī','ī'=>'ī','Ĭ'=>'ĭ','ĭ'=>'ĭ','Į'=>'į','į'=>'į','İ'=>'i','ı'=>'ı','IJ'=>'ij','ij'=>'ij','Ĵ'=>'ĵ','ĵ'=>'ĵ','Ķ'=>'ķ','ķ'=>'ķ','ĸ'=>'ĸ','Ĺ'=>'ĺ','ĺ'=>'ĺ','Ļ'=>'ļ','ļ'=>'ļ','Ľ'=>'ľ','ľ'=>'ľ','Ŀ'=>'ŀ','ŀ'=>'ŀ','Ł'=>'ł','ł'=>'ł','Ń'=>'ń','ń'=>'ń','Ņ'=>'ņ','ņ'=>'ņ','Ň'=>'ň','ň'=>'ň','ʼn'=>'ʼn','Ŋ'=>'ŋ','ŋ'=>'ŋ','Ō'=>'ō','ō'=>'ō','Ŏ'=>'ŏ','ŏ'=>'ŏ','Ő'=>'ő','ő'=>'ő','Œ'=>'oe','œ'=>'oe','Ŕ'=>'ŕ','ŕ'=>'ŕ','Ŗ'=>'ŗ','ŗ'=>'ŗ','Ř'=>'ř','ř'=>'ř','Ś'=>'ś','ś'=>'ś','Ŝ'=>'ŝ','ŝ'=>'ŝ','Ş'=>'ş','ş'=>'ş','Š'=>'š','š'=>'š','Ţ'=>'ţ','ţ'=>'ţ','Ť'=>'ť','ť'=>'ť','Ŧ'=>'ŧ','ŧ'=>'ŧ','Ũ'=>'ũ','ũ'=>'ũ','Ū'=>'ū','ū'=>'ū','Ŭ'=>'ŭ','ŭ'=>'ŭ','Ů'=>'ů','ů'=>'ů','Ű'=>'ű','ű'=>'ű','Ų'=>'ų','ų'=>'ų','Ŵ'=>'ŵ','ŵ'=>'ŵ','Ŷ'=>'ŷ','ŷ'=>'ŷ','Ÿ'=>'ÿ','Ź'=>'ź','ź'=>'ź','Ż'=>'ż','ż'=>'ż','Ž'=>'ž','ž'=>'ž','ſ'=>'ſ','ƀ'=>'ƀ','Ɓ'=>'ɓ','Ƃ'=>'ƃ','ƃ'=>'ƃ','Ƅ'=>'ƅ','ƅ'=>'ƅ','Ɔ'=>'ɔ','Ƈ'=>'ƈ','ƈ'=>'ƈ','Ɖ'=>'ɖ','Ɗ'=>'ɗ','Ƌ'=>'ƌ','ƌ'=>'ƌ','ƍ'=>'ƍ','Ǝ'=>'ǝ','Ə'=>'ə','Ɛ'=>'ɛ','Ƒ'=>'ƒ','ƒ'=>'ƒ','Ɠ'=>'ɠ','Ɣ'=>'ɣ','ƕ'=>'hv','Ɩ'=>'ɩ','Ɨ'=>'ɨ','Ƙ'=>'ƙ','ƙ'=>'ƙ','ƚ'=>'ƚ','ƛ'=>'ƛ','Ɯ'=>'ɯ','Ɲ'=>'ɲ','ƞ'=>'ƞ','Ɵ'=>'ɵ','Ơ'=>'ơ','ơ'=>'ơ','Ƣ'=>'oi','ƣ'=>'oi','Ƥ'=>'ƥ','ƥ'=>'ƥ','Ʀ'=>'yr','Ƨ'=>'ƨ','ƨ'=>'ƨ','Ʃ'=>'ʃ','ƪ'=>'ƪ','ƫ'=>'ƫ','Ƭ'=>'ƭ','ƭ'=>'ƭ','Ʈ'=>'ʈ','Ư'=>'ư','ư'=>'ư','Ʊ'=>'ʊ','Ʋ'=>'ʋ','Ƴ'=>'ƴ','ƴ'=>'ƴ','Ƶ'=>'ƶ','ƶ'=>'ƶ','Ʒ'=>'ʒ','Ƹ'=>'ƹ','ƹ'=>'ƹ','ƺ'=>'ƺ','ƻ'=>'ƻ','Ƽ'=>'ƽ','ƽ'=>'ƽ','ƾ'=>'ƾ','ƿ'=>'ƿ','ǀ'=>'ǀ','ǁ'=>'ǁ','ǂ'=>'ǂ','ǃ'=>'ǃ','DŽ'=>'dž','Dž'=>'dž','dž'=>'dž','LJ'=>'lj','Lj'=>'lj','lj'=>'lj','NJ'=>'nj','Nj'=>'nj','nj'=>'nj','Ǎ'=>'ǎ','ǎ'=>'ǎ','Ǐ'=>'ǐ','ǐ'=>'ǐ','Ǒ'=>'ǒ','ǒ'=>'ǒ','Ǔ'=>'ǔ','ǔ'=>'ǔ','Ǖ'=>'ǖ','ǖ'=>'ǖ','Ǘ'=>'ǘ','ǘ'=>'ǘ','Ǚ'=>'ǚ','ǚ'=>'ǚ','Ǜ'=>'ǜ','ǜ'=>'ǜ','ǝ'=>'ǝ','Ǟ'=>'ǟ','ǟ'=>'ǟ','Ǡ'=>'ǡ','ǡ'=>'ǡ','Ǣ'=>'ǣ','ǣ'=>'ǣ','Ǥ'=>'ǥ','ǥ'=>'ǥ','Ǧ'=>'ǧ','ǧ'=>'ǧ','Ǩ'=>'ǩ','ǩ'=>'ǩ','Ǫ'=>'ǫ','ǫ'=>'ǫ','Ǭ'=>'ǭ','ǭ'=>'ǭ','Ǯ'=>'ǯ','ǯ'=>'ǯ','ǰ'=>'ǰ','DZ'=>'dz','Dz'=>'dz','dz'=>'dz','Ǵ'=>'ǵ','ǵ'=>'ǵ','Ƕ'=>'ƕ','Ƿ'=>'ƿ','Ǹ'=>'ǹ','ǹ'=>'ǹ','Ǻ'=>'ǻ','ǻ'=>'ǻ','Ǽ'=>'ǽ','ǽ'=>'ǽ','Ǿ'=>'ǿ','ǿ'=>'ǿ','Ȁ'=>'ȁ','ȁ'=>'ȁ','Ȃ'=>'ȃ','ȃ'=>'ȃ','Ȅ'=>'ȅ','ȅ'=>'ȅ','Ȇ'=>'ȇ','ȇ'=>'ȇ','Ȉ'=>'ȉ','ȉ'=>'ȉ','Ȋ'=>'ȋ','ȋ'=>'ȋ','Ȍ'=>'ȍ','ȍ'=>'ȍ','Ȏ'=>'ȏ','ȏ'=>'ȏ','Ȑ'=>'ȑ','ȑ'=>'ȑ','Ȓ'=>'ȓ','ȓ'=>'ȓ','Ȕ'=>'ȕ','ȕ'=>'ȕ','Ȗ'=>'ȗ','ȗ'=>'ȗ','Ș'=>'ș','ș'=>'ș','Ț'=>'ț','ț'=>'ț','Ȝ'=>'ȝ','ȝ'=>'ȝ','Ȟ'=>'ȟ','ȟ'=>'ȟ','Ƞ'=>'ƞ','ȡ'=>'ȡ','Ȣ'=>'ou','ȣ'=>'ou','Ȥ'=>'ȥ','ȥ'=>'ȥ','Ȧ'=>'ȧ','ȧ'=>'ȧ','Ȩ'=>'ȩ','ȩ'=>'ȩ','Ȫ'=>'ȫ','ȫ'=>'ȫ','Ȭ'=>'ȭ','ȭ'=>'ȭ','Ȯ'=>'ȯ','ȯ'=>'ȯ','Ȱ'=>'ȱ','ȱ'=>'ȱ','Ȳ'=>'ȳ','ȳ'=>'ȳ','ȴ'=>'ȴ','ȵ'=>'ȵ','ȶ'=>'ȶ','ȷ'=>'ȷ','ȸ'=>'ȸ','ȹ'=>'ȹ','Ⱥ'=>'ⱥ','Ȼ'=>'ȼ','ȼ'=>'ȼ','Ƚ'=>'ƚ','Ⱦ'=>'ⱦ','ȿ'=>'ȿ','ɀ'=>'ɀ','Ɂ'=>'ɂ','ɂ'=>'ɂ','Ƀ'=>'ƀ','Ʉ'=>'ʉ','Ʌ'=>'ʌ','Ɇ'=>'ɇ','ɇ'=>'ɇ','Ɉ'=>'ɉ','ɉ'=>'ɉ','Ɋ'=>'ɋ','ɋ'=>'ɋ','Ɍ'=>'ɍ','ɍ'=>'ɍ','Ɏ'=>'ɏ','ɏ'=>'ɏ','ɐ'=>'ɐ','ɑ'=>'ɑ','ɒ'=>'ɒ','ɓ'=>'ɓ','ɔ'=>'ɔ','ɕ'=>'ɕ','ɖ'=>'ɖ','ɗ'=>'ɗ','ɘ'=>'ɘ','ə'=>'ə','ɚ'=>'ɚ','ɛ'=>'ɛ','ɜ'=>'ɜ','ɝ'=>'ɝ','ɞ'=>'ɞ','ɟ'=>'ɟ','ɠ'=>'ɠ','ɡ'=>'ɡ','ɢ'=>'ɢ','ɣ'=>'ɣ','ɤ'=>'ɤ','ɥ'=>'ɥ','ɦ'=>'ɦ','ɧ'=>'ɧ','ɨ'=>'ɨ','ɩ'=>'ɩ','ɪ'=>'ɪ','ɫ'=>'ɫ','ɬ'=>'ɬ','ɭ'=>'ɭ','ɮ'=>'ɮ','ɯ'=>'ɯ','ɰ'=>'ɰ','ɱ'=>'ɱ','ɲ'=>'ɲ','ɳ'=>'ɳ','ɴ'=>'ɴ','ɵ'=>'ɵ','ɶ'=>'ɶ','ɷ'=>'ɷ','ɸ'=>'ɸ','ɹ'=>'ɹ','ɺ'=>'ɺ','ɻ'=>'ɻ','ɼ'=>'ɼ','ɽ'=>'ɽ','ɾ'=>'ɾ','ɿ'=>'ɿ','ʀ'=>'ʀ','ʁ'=>'ʁ','ʂ'=>'ʂ','ʃ'=>'ʃ','ʄ'=>'ʄ','ʅ'=>'ʅ','ʆ'=>'ʆ','ʇ'=>'ʇ','ʈ'=>'ʈ','ʉ'=>'ʉ','ʊ'=>'ʊ','ʋ'=>'ʋ','ʌ'=>'ʌ','ʍ'=>'ʍ','ʎ'=>'ʎ','ʏ'=>'ʏ','ʐ'=>'ʐ','ʑ'=>'ʑ','ʒ'=>'ʒ','ʓ'=>'ʓ','ʔ'=>'ʔ','ʕ'=>'ʕ','ʖ'=>'ʖ','ʗ'=>'ʗ','ʘ'=>'ʘ','ʙ'=>'ʙ','ʚ'=>'ʚ','ʛ'=>'ʛ','ʜ'=>'ʜ','ʝ'=>'ʝ','ʞ'=>'ʞ','ʟ'=>'ʟ','ʠ'=>'ʠ','ʡ'=>'ʡ','ʢ'=>'ʢ','ʣ'=>'ʣ','ʤ'=>'ʤ','ʥ'=>'ʥ','ʦ'=>'ʦ','ʧ'=>'ʧ','ʨ'=>'ʨ','ʩ'=>'ʩ','ʪ'=>'ʪ','ʫ'=>'ʫ','ʬ'=>'ʬ','ʭ'=>'ʭ','ʮ'=>'ʮ','ʯ'=>'ʯ','ʰ'=>'ʰ','ʱ'=>'ʱ','ʲ'=>'ʲ','ʳ'=>'ʳ','ʴ'=>'ʴ','ʵ'=>'ʵ','ʶ'=>'ʶ','ʷ'=>'ʷ','ʸ'=>'ʸ','ʹ'=>'ʹ','ʺ'=>'ʺ','ʻ'=>'ʻ','ʼ'=>'ʼ','ʽ'=>'ʽ','ʾ'=>'ʾ','ʿ'=>'ʿ','ˀ'=>'ˀ','ˁ'=>'ˁ','ˆ'=>'ˆ','ˇ'=>'ˇ','ˈ'=>'ˈ','ˉ'=>'ˉ','ˊ'=>'ˊ','ˋ'=>'ˋ','ˌ'=>'ˌ','ˍ'=>'ˍ','ˎ'=>'ˎ','ˏ'=>'ˏ','ː'=>'ː','ˑ'=>'ˑ','ˠ'=>'ˠ','ˡ'=>'ˡ','ˢ'=>'ˢ','ˣ'=>'ˣ','ˤ'=>'ˤ','ˮ'=>'ˮ','̀'=>'̀','́'=>'́','̂'=>'̂','̃'=>'̃','̄'=>'̄','̅'=>'̅','̆'=>'̆','̇'=>'̇','̈'=>'̈','̉'=>'̉','̊'=>'̊','̋'=>'̋','̌'=>'̌','̍'=>'̍','̎'=>'̎','̏'=>'̏','̐'=>'̐','̑'=>'̑','̒'=>'̒','̓'=>'̓','̔'=>'̔','̕'=>'̕','̖'=>'̖','̗'=>'̗','̘'=>'̘','̙'=>'̙','̚'=>'̚','̛'=>'̛','̜'=>'̜','̝'=>'̝','̞'=>'̞','̟'=>'̟','̠'=>'̠','̡'=>'̡','̢'=>'̢','̣'=>'̣','̤'=>'̤','̥'=>'̥','̦'=>'̦','̧'=>'̧','̨'=>'̨','̩'=>'̩','̪'=>'̪','̫'=>'̫','̬'=>'̬','̭'=>'̭','̮'=>'̮','̯'=>'̯','̰'=>'̰','̱'=>'̱','̲'=>'̲','̳'=>'̳','̴'=>'̴','̵'=>'̵','̶'=>'̶','̷'=>'̷','̸'=>'̸','̹'=>'̹','̺'=>'̺','̻'=>'̻','̼'=>'̼','̽'=>'̽','̾'=>'̾','̿'=>'̿','̀'=>'̀','́'=>'́','͂'=>'͂','̓'=>'̓','̈́'=>'̈́','ͅ'=>'ͅ','͆'=>'͆','͇'=>'͇','͈'=>'͈','͉'=>'͉','͊'=>'͊','͋'=>'͋','͌'=>'͌','͍'=>'͍','͎'=>'͎','͏'=>'͏','͐'=>'͐','͑'=>'͑','͒'=>'͒','͓'=>'͓','͔'=>'͔','͕'=>'͕','͖'=>'͖','͗'=>'͗','͘'=>'͘','͙'=>'͙','͚'=>'͚','͛'=>'͛','͜'=>'͜','͝'=>'͝','͞'=>'͞','͟'=>'͟','͠'=>'͠','͡'=>'͡','͢'=>'͢','ͣ'=>'ͣ','ͤ'=>'ͤ','ͥ'=>'ͥ','ͦ'=>'ͦ','ͧ'=>'ͧ','ͨ'=>'ͨ','ͩ'=>'ͩ','ͪ'=>'ͪ','ͫ'=>'ͫ','ͬ'=>'ͬ','ͭ'=>'ͭ','ͮ'=>'ͮ','ͯ'=>'ͯ','ͺ'=>'ͺ','ͻ'=>'ͻ','ͼ'=>'ͼ','ͽ'=>'ͽ','Ά'=>'ά','Έ'=>'έ','Ή'=>'ή','Ί'=>'ί','Ό'=>'ό','Ύ'=>'ύ','Ώ'=>'ώ','ΐ'=>'ΐ','Α'=>'α','Β'=>'β','Γ'=>'γ','Δ'=>'δ','Ε'=>'ε','Ζ'=>'ζ','Η'=>'η','Θ'=>'θ','Ι'=>'ι','Κ'=>'κ','Λ'=>'λ','Μ'=>'μ','Ν'=>'ν','Ξ'=>'ξ','Ο'=>'ο','Π'=>'π','Ρ'=>'ρ','Σ'=>'σ','Τ'=>'τ','Υ'=>'υ','Φ'=>'φ','Χ'=>'χ','Ψ'=>'ψ','Ω'=>'ω','Ϊ'=>'ϊ','Ϋ'=>'ϋ','ά'=>'ά','έ'=>'έ','ή'=>'ή','ί'=>'ί','ΰ'=>'ΰ','α'=>'α','β'=>'β','γ'=>'γ','δ'=>'δ','ε'=>'ε','ζ'=>'ζ','η'=>'η','θ'=>'θ','ι'=>'ι','κ'=>'κ','λ'=>'λ','μ'=>'μ','ν'=>'ν','ξ'=>'ξ','ο'=>'ο','π'=>'π','ρ'=>'ρ','ς'=>'ς','σ'=>'σ','τ'=>'τ','υ'=>'υ','φ'=>'φ','χ'=>'χ','ψ'=>'ψ','ω'=>'ω','ϊ'=>'ϊ','ϋ'=>'ϋ','ό'=>'ό','ύ'=>'ύ','ώ'=>'ώ','ϐ'=>'ϐ','ϑ'=>'ϑ','ϒ'=>'ϒ','ϓ'=>'ϓ','ϔ'=>'ϔ','ϕ'=>'ϕ','ϖ'=>'ϖ','ϗ'=>'ϗ','Ϙ'=>'ϙ','ϙ'=>'ϙ','Ϛ'=>'ϛ','ϛ'=>'ϛ','Ϝ'=>'ϝ','ϝ'=>'ϝ','Ϟ'=>'ϟ','ϟ'=>'ϟ','Ϡ'=>'ϡ','ϡ'=>'ϡ','Ϣ'=>'ϣ','ϣ'=>'ϣ','Ϥ'=>'ϥ','ϥ'=>'ϥ','Ϧ'=>'ϧ','ϧ'=>'ϧ','Ϩ'=>'ϩ','ϩ'=>'ϩ','Ϫ'=>'ϫ','ϫ'=>'ϫ','Ϭ'=>'ϭ','ϭ'=>'ϭ','Ϯ'=>'ϯ','ϯ'=>'ϯ','ϰ'=>'ϰ','ϱ'=>'ϱ','ϲ'=>'ϲ','ϳ'=>'ϳ','ϴ'=>'θ','ϵ'=>'ϵ','Ϸ'=>'ϸ','ϸ'=>'ϸ','Ϲ'=>'ϲ','Ϻ'=>'ϻ','ϻ'=>'ϻ','ϼ'=>'ϼ','Ͻ'=>'ͻ','Ͼ'=>'ͼ','Ͽ'=>'ͽ','Ѐ'=>'ѐ','Ё'=>'ё','Ђ'=>'ђ','Ѓ'=>'ѓ','Є'=>'є','Ѕ'=>'ѕ','І'=>'і','Ї'=>'ї','Ј'=>'ј','Љ'=>'љ','Њ'=>'њ','Ћ'=>'ћ','Ќ'=>'ќ','Ѝ'=>'ѝ','Ў'=>'ў','Џ'=>'џ','А'=>'а','Б'=>'б','В'=>'в','Г'=>'г','Д'=>'д','Е'=>'е','Ж'=>'ж','З'=>'з','И'=>'и','Й'=>'й','К'=>'к','Л'=>'л','М'=>'м','Н'=>'н','О'=>'о','П'=>'п','Р'=>'р','С'=>'с','Т'=>'т','У'=>'у','Ф'=>'ф','Х'=>'х','Ц'=>'ц','Ч'=>'ч','Ш'=>'ш','Щ'=>'щ','Ъ'=>'ъ','Ы'=>'ы','Ь'=>'ь','Э'=>'э','Ю'=>'ю','Я'=>'я','а'=>'а','б'=>'б','в'=>'в','г'=>'г','д'=>'д','е'=>'е','ж'=>'ж','з'=>'з','и'=>'и','й'=>'й','к'=>'к','л'=>'л','м'=>'м','н'=>'н','о'=>'о','п'=>'п','р'=>'р','с'=>'с','т'=>'т','у'=>'у','ф'=>'ф','х'=>'х','ц'=>'ц','ч'=>'ч','ш'=>'ш','щ'=>'щ','ъ'=>'ъ','ы'=>'ы','ь'=>'ь','э'=>'э','ю'=>'ю','я'=>'я','ѐ'=>'ѐ','ё'=>'ё','ђ'=>'ђ','ѓ'=>'ѓ','є'=>'є','ѕ'=>'ѕ','і'=>'і','ї'=>'ї','ј'=>'ј','љ'=>'љ','њ'=>'њ','ћ'=>'ћ','ќ'=>'ќ','ѝ'=>'ѝ','ў'=>'ў','џ'=>'џ','Ѡ'=>'ѡ','ѡ'=>'ѡ','Ѣ'=>'ѣ','ѣ'=>'ѣ','Ѥ'=>'ѥ','ѥ'=>'ѥ','Ѧ'=>'ѧ','ѧ'=>'ѧ','Ѩ'=>'ѩ','ѩ'=>'ѩ','Ѫ'=>'ѫ','ѫ'=>'ѫ','Ѭ'=>'ѭ','ѭ'=>'ѭ','Ѯ'=>'ѯ','ѯ'=>'ѯ','Ѱ'=>'ѱ','ѱ'=>'ѱ','Ѳ'=>'ѳ','ѳ'=>'ѳ','Ѵ'=>'ѵ','ѵ'=>'ѵ','Ѷ'=>'ѷ','ѷ'=>'ѷ','Ѹ'=>'ѹ','ѹ'=>'ѹ','Ѻ'=>'ѻ','ѻ'=>'ѻ','Ѽ'=>'ѽ','ѽ'=>'ѽ','Ѿ'=>'ѿ','ѿ'=>'ѿ','Ҁ'=>'ҁ','ҁ'=>'ҁ','҃'=>'҃','҄'=>'҄','҅'=>'҅','҆'=>'҆','҈'=>'҈','҉'=>'҉','Ҋ'=>'ҋ','ҋ'=>'ҋ','Ҍ'=>'ҍ','ҍ'=>'ҍ','Ҏ'=>'ҏ','ҏ'=>'ҏ','Ґ'=>'ґ','ґ'=>'ґ','Ғ'=>'ғ','ғ'=>'ғ','Ҕ'=>'ҕ','ҕ'=>'ҕ','Җ'=>'җ','җ'=>'җ','Ҙ'=>'ҙ','ҙ'=>'ҙ','Қ'=>'қ','қ'=>'қ','Ҝ'=>'ҝ','ҝ'=>'ҝ','Ҟ'=>'ҟ','ҟ'=>'ҟ','Ҡ'=>'ҡ','ҡ'=>'ҡ','Ң'=>'ң','ң'=>'ң','Ҥ'=>'ҥ','ҥ'=>'ҥ','Ҧ'=>'ҧ','ҧ'=>'ҧ','Ҩ'=>'ҩ','ҩ'=>'ҩ','Ҫ'=>'ҫ','ҫ'=>'ҫ','Ҭ'=>'ҭ','ҭ'=>'ҭ','Ү'=>'ү','ү'=>'ү','Ұ'=>'ұ','ұ'=>'ұ','Ҳ'=>'ҳ','ҳ'=>'ҳ','Ҵ'=>'ҵ','ҵ'=>'ҵ','Ҷ'=>'ҷ','ҷ'=>'ҷ','Ҹ'=>'ҹ','ҹ'=>'ҹ','Һ'=>'һ','һ'=>'һ','Ҽ'=>'ҽ','ҽ'=>'ҽ','Ҿ'=>'ҿ','ҿ'=>'ҿ','Ӏ'=>'ӏ','Ӂ'=>'ӂ','ӂ'=>'ӂ','Ӄ'=>'ӄ','ӄ'=>'ӄ','Ӆ'=>'ӆ','ӆ'=>'ӆ','Ӈ'=>'ӈ','ӈ'=>'ӈ','Ӊ'=>'ӊ','ӊ'=>'ӊ','Ӌ'=>'ӌ','ӌ'=>'ӌ','Ӎ'=>'ӎ','ӎ'=>'ӎ','ӏ'=>'ӏ','Ӑ'=>'ӑ','ӑ'=>'ӑ','Ӓ'=>'ӓ','ӓ'=>'ӓ','Ӕ'=>'ӕ','ӕ'=>'ӕ','Ӗ'=>'ӗ','ӗ'=>'ӗ','Ә'=>'ә','ә'=>'ә','Ӛ'=>'ӛ','ӛ'=>'ӛ','Ӝ'=>'ӝ','ӝ'=>'ӝ','Ӟ'=>'ӟ','ӟ'=>'ӟ','Ӡ'=>'ӡ','ӡ'=>'ӡ','Ӣ'=>'ӣ','ӣ'=>'ӣ','Ӥ'=>'ӥ','ӥ'=>'ӥ','Ӧ'=>'ӧ','ӧ'=>'ӧ','Ө'=>'ө','ө'=>'ө','Ӫ'=>'ӫ','ӫ'=>'ӫ','Ӭ'=>'ӭ','ӭ'=>'ӭ','Ӯ'=>'ӯ','ӯ'=>'ӯ','Ӱ'=>'ӱ','ӱ'=>'ӱ','Ӳ'=>'ӳ','ӳ'=>'ӳ','Ӵ'=>'ӵ','ӵ'=>'ӵ','Ӷ'=>'ӷ','ӷ'=>'ӷ','Ӹ'=>'ӹ','ӹ'=>'ӹ','Ӻ'=>'ӻ','ӻ'=>'ӻ','Ӽ'=>'ӽ','ӽ'=>'ӽ','Ӿ'=>'ӿ','ӿ'=>'ӿ','Ԁ'=>'ԁ','ԁ'=>'ԁ','Ԃ'=>'ԃ','ԃ'=>'ԃ','Ԅ'=>'ԅ','ԅ'=>'ԅ','Ԇ'=>'ԇ','ԇ'=>'ԇ','Ԉ'=>'ԉ','ԉ'=>'ԉ','Ԋ'=>'ԋ','ԋ'=>'ԋ','Ԍ'=>'ԍ','ԍ'=>'ԍ','Ԏ'=>'ԏ','ԏ'=>'ԏ','Ԑ'=>'ԑ','ԑ'=>'ԑ','Ԓ'=>'ԓ','ԓ'=>'ԓ','Ա'=>'ա','Բ'=>'բ','Գ'=>'գ','Դ'=>'դ','Ե'=>'ե','Զ'=>'զ','Է'=>'է','Ը'=>'ը','Թ'=>'թ','Ժ'=>'ժ','Ի'=>'ի','Լ'=>'լ','Խ'=>'խ','Ծ'=>'ծ','Կ'=>'կ','Հ'=>'հ','Ձ'=>'ձ','Ղ'=>'ղ','Ճ'=>'ճ','Մ'=>'մ','Յ'=>'յ','Ն'=>'ն','Շ'=>'շ','Ո'=>'ո','Չ'=>'չ','Պ'=>'պ','Ջ'=>'ջ','Ռ'=>'ռ','Ս'=>'ս','Վ'=>'վ','Տ'=>'տ','Ր'=>'ր','Ց'=>'ց','Ւ'=>'ւ','Փ'=>'փ','Ք'=>'ք','Օ'=>'օ','Ֆ'=>'ֆ','ՙ'=>'ՙ','ա'=>'ա','բ'=>'բ','գ'=>'գ','դ'=>'դ','ե'=>'ե','զ'=>'զ','է'=>'է','ը'=>'ը','թ'=>'թ','ժ'=>'ժ','ի'=>'ի','լ'=>'լ','խ'=>'խ','ծ'=>'ծ','կ'=>'կ','հ'=>'հ','ձ'=>'ձ','ղ'=>'ղ','ճ'=>'ճ','մ'=>'մ','յ'=>'յ','ն'=>'ն','շ'=>'շ','ո'=>'ո','չ'=>'չ','պ'=>'պ','ջ'=>'ջ','ռ'=>'ռ','ս'=>'ս','վ'=>'վ','տ'=>'տ','ր'=>'ր','ց'=>'ց','ւ'=>'ւ','փ'=>'փ','ք'=>'ք','օ'=>'օ','ֆ'=>'ֆ','և'=>'և','֑'=>'֑','֒'=>'֒','֓'=>'֓','֔'=>'֔','֕'=>'֕','֖'=>'֖','֗'=>'֗','֘'=>'֘','֙'=>'֙','֚'=>'֚','֛'=>'֛','֜'=>'֜','֝'=>'֝','֞'=>'֞','֟'=>'֟','֠'=>'֠','֡'=>'֡','֢'=>'֢','֣'=>'֣','֤'=>'֤','֥'=>'֥','֦'=>'֦','֧'=>'֧','֨'=>'֨','֩'=>'֩','֪'=>'֪','֫'=>'֫','֬'=>'֬','֭'=>'֭','֮'=>'֮','֯'=>'֯','ְ'=>'ְ','ֱ'=>'ֱ','ֲ'=>'ֲ','ֳ'=>'ֳ','ִ'=>'ִ','ֵ'=>'ֵ','ֶ'=>'ֶ','ַ'=>'ַ','ָ'=>'ָ','ֹ'=>'ֹ','ֺ'=>'ֺ','ֻ'=>'ֻ','ּ'=>'ּ','ֽ'=>'ֽ','ֿ'=>'ֿ','ׁ'=>'ׁ','ׂ'=>'ׂ','ׄ'=>'ׄ','ׅ'=>'ׅ','ׇ'=>'ׇ','א'=>'א','ב'=>'ב','ג'=>'ג','ד'=>'ד','ה'=>'ה','ו'=>'ו','ז'=>'ז','ח'=>'ח','ט'=>'ט','י'=>'י','ך'=>'ך','כ'=>'כ','ל'=>'ל','ם'=>'ם','מ'=>'מ','ן'=>'ן','נ'=>'נ','ס'=>'ס','ע'=>'ע','ף'=>'ף','פ'=>'פ','ץ'=>'ץ','צ'=>'צ','ק'=>'ק','ר'=>'ר','ש'=>'ש','ת'=>'ת','װ'=>'װ','ױ'=>'ױ','ײ'=>'ײ','ؐ'=>'ؐ','ؑ'=>'ؑ','ؒ'=>'ؒ','ؓ'=>'ؓ','ؔ'=>'ؔ','ؕ'=>'ؕ','ء'=>'ء','آ'=>'آ','أ'=>'أ','ؤ'=>'ؤ','إ'=>'إ','ئ'=>'ئ','ا'=>'ا','ب'=>'ب','ة'=>'ة','ت'=>'ت','ث'=>'ث','ج'=>'ج','ح'=>'ح','خ'=>'خ','د'=>'د','ذ'=>'ذ','ر'=>'ر','ز'=>'ز','س'=>'س','ش'=>'ش','ص'=>'ص','ض'=>'ض','ط'=>'ط','ظ'=>'ظ','ع'=>'ع','غ'=>'غ','ـ'=>'ـ','ف'=>'ف','ق'=>'ق','ك'=>'ك','ل'=>'ل','م'=>'م','ن'=>'ن','ه'=>'ه','و'=>'و','ى'=>'ى','ي'=>'ي','ً'=>'ً','ٌ'=>'ٌ','ٍ'=>'ٍ','َ'=>'َ','ُ'=>'ُ','ِ'=>'ِ','ّ'=>'ّ','ْ'=>'ْ','ٓ'=>'ٓ','ٔ'=>'ٔ','ٕ'=>'ٕ','ٖ'=>'ٖ','ٗ'=>'ٗ','٘'=>'٘','ٙ'=>'ٙ','ٚ'=>'ٚ','ٛ'=>'ٛ','ٜ'=>'ٜ','ٝ'=>'ٝ','ٞ'=>'ٞ','٠'=>'0','١'=>'1','٢'=>'2','٣'=>'3','٤'=>'4','٥'=>'5','٦'=>'6','٧'=>'7','٨'=>'8','٩'=>'9','ٮ'=>'ٮ','ٯ'=>'ٯ','ٰ'=>'ٰ','ٱ'=>'ٱ','ٲ'=>'ٲ','ٳ'=>'ٳ','ٴ'=>'ٴ','ٵ'=>'ٵ','ٶ'=>'ٶ','ٷ'=>'ٷ','ٸ'=>'ٸ','ٹ'=>'ٹ','ٺ'=>'ٺ','ٻ'=>'ٻ','ټ'=>'ټ','ٽ'=>'ٽ','پ'=>'پ','ٿ'=>'ٿ','ڀ'=>'ڀ','ځ'=>'ځ','ڂ'=>'ڂ','ڃ'=>'ڃ','ڄ'=>'ڄ','څ'=>'څ','چ'=>'چ','ڇ'=>'ڇ','ڈ'=>'ڈ','ډ'=>'ډ','ڊ'=>'ڊ','ڋ'=>'ڋ','ڌ'=>'ڌ','ڍ'=>'ڍ','ڎ'=>'ڎ','ڏ'=>'ڏ','ڐ'=>'ڐ','ڑ'=>'ڑ','ڒ'=>'ڒ','ړ'=>'ړ','ڔ'=>'ڔ','ڕ'=>'ڕ','ږ'=>'ږ','ڗ'=>'ڗ','ژ'=>'ژ','ڙ'=>'ڙ','ښ'=>'ښ','ڛ'=>'ڛ','ڜ'=>'ڜ','ڝ'=>'ڝ','ڞ'=>'ڞ','ڟ'=>'ڟ','ڠ'=>'ڠ','ڡ'=>'ڡ','ڢ'=>'ڢ','ڣ'=>'ڣ','ڤ'=>'ڤ','ڥ'=>'ڥ','ڦ'=>'ڦ','ڧ'=>'ڧ','ڨ'=>'ڨ','ک'=>'ک','ڪ'=>'ڪ','ګ'=>'ګ','ڬ'=>'ڬ','ڭ'=>'ڭ','ڮ'=>'ڮ','گ'=>'گ','ڰ'=>'ڰ','ڱ'=>'ڱ','ڲ'=>'ڲ','ڳ'=>'ڳ','ڴ'=>'ڴ','ڵ'=>'ڵ','ڶ'=>'ڶ','ڷ'=>'ڷ','ڸ'=>'ڸ','ڹ'=>'ڹ','ں'=>'ں','ڻ'=>'ڻ','ڼ'=>'ڼ','ڽ'=>'ڽ','ھ'=>'ھ','ڿ'=>'ڿ','ۀ'=>'ۀ','ہ'=>'ہ','ۂ'=>'ۂ','ۃ'=>'ۃ','ۄ'=>'ۄ','ۅ'=>'ۅ','ۆ'=>'ۆ','ۇ'=>'ۇ','ۈ'=>'ۈ','ۉ'=>'ۉ','ۊ'=>'ۊ','ۋ'=>'ۋ','ی'=>'ی','ۍ'=>'ۍ','ێ'=>'ێ','ۏ'=>'ۏ','ې'=>'ې','ۑ'=>'ۑ','ے'=>'ے','ۓ'=>'ۓ','ە'=>'ە','ۖ'=>'ۖ','ۗ'=>'ۗ','ۘ'=>'ۘ','ۙ'=>'ۙ','ۚ'=>'ۚ','ۛ'=>'ۛ','ۜ'=>'ۜ','۞'=>'۞','۟'=>'۟','۠'=>'۠','ۡ'=>'ۡ','ۢ'=>'ۢ','ۣ'=>'ۣ','ۤ'=>'ۤ','ۥ'=>'ۥ','ۦ'=>'ۦ','ۧ'=>'ۧ','ۨ'=>'ۨ','۪'=>'۪','۫'=>'۫','۬'=>'۬','ۭ'=>'ۭ','ۮ'=>'ۮ','ۯ'=>'ۯ','۰'=>'0','۱'=>'1','۲'=>'2','۳'=>'3','۴'=>'4','۵'=>'5','۶'=>'6','۷'=>'7','۸'=>'8','۹'=>'9','ۺ'=>'ۺ','ۻ'=>'ۻ','ۼ'=>'ۼ','ۿ'=>'ۿ','ܐ'=>'ܐ','ܑ'=>'ܑ','ܒ'=>'ܒ','ܓ'=>'ܓ','ܔ'=>'ܔ','ܕ'=>'ܕ','ܖ'=>'ܖ','ܗ'=>'ܗ','ܘ'=>'ܘ','ܙ'=>'ܙ','ܚ'=>'ܚ','ܛ'=>'ܛ','ܜ'=>'ܜ','ܝ'=>'ܝ','ܞ'=>'ܞ','ܟ'=>'ܟ','ܠ'=>'ܠ','ܡ'=>'ܡ','ܢ'=>'ܢ','ܣ'=>'ܣ','ܤ'=>'ܤ','ܥ'=>'ܥ','ܦ'=>'ܦ','ܧ'=>'ܧ','ܨ'=>'ܨ','ܩ'=>'ܩ','ܪ'=>'ܪ','ܫ'=>'ܫ','ܬ'=>'ܬ','ܭ'=>'ܭ','ܮ'=>'ܮ','ܯ'=>'ܯ','ܰ'=>'ܰ','ܱ'=>'ܱ','ܲ'=>'ܲ','ܳ'=>'ܳ','ܴ'=>'ܴ','ܵ'=>'ܵ','ܶ'=>'ܶ','ܷ'=>'ܷ','ܸ'=>'ܸ','ܹ'=>'ܹ','ܺ'=>'ܺ','ܻ'=>'ܻ','ܼ'=>'ܼ','ܽ'=>'ܽ','ܾ'=>'ܾ','ܿ'=>'ܿ','݀'=>'݀','݁'=>'݁','݂'=>'݂','݃'=>'݃','݄'=>'݄','݅'=>'݅','݆'=>'݆','݇'=>'݇','݈'=>'݈','݉'=>'݉','݊'=>'݊','ݍ'=>'ݍ','ݎ'=>'ݎ','ݏ'=>'ݏ','ݐ'=>'ݐ','ݑ'=>'ݑ','ݒ'=>'ݒ','ݓ'=>'ݓ','ݔ'=>'ݔ','ݕ'=>'ݕ','ݖ'=>'ݖ','ݗ'=>'ݗ','ݘ'=>'ݘ','ݙ'=>'ݙ','ݚ'=>'ݚ','ݛ'=>'ݛ','ݜ'=>'ݜ','ݝ'=>'ݝ','ݞ'=>'ݞ','ݟ'=>'ݟ','ݠ'=>'ݠ','ݡ'=>'ݡ','ݢ'=>'ݢ','ݣ'=>'ݣ','ݤ'=>'ݤ','ݥ'=>'ݥ','ݦ'=>'ݦ','ݧ'=>'ݧ','ݨ'=>'ݨ','ݩ'=>'ݩ','ݪ'=>'ݪ','ݫ'=>'ݫ','ݬ'=>'ݬ','ݭ'=>'ݭ','ހ'=>'ހ','ށ'=>'ށ','ނ'=>'ނ','ރ'=>'ރ','ބ'=>'ބ','ޅ'=>'ޅ','ކ'=>'ކ','އ'=>'އ','ވ'=>'ވ','މ'=>'މ','ފ'=>'ފ','ދ'=>'ދ','ތ'=>'ތ','ލ'=>'ލ','ގ'=>'ގ','ޏ'=>'ޏ','ސ'=>'ސ','ޑ'=>'ޑ','ޒ'=>'ޒ','ޓ'=>'ޓ','ޔ'=>'ޔ','ޕ'=>'ޕ','ޖ'=>'ޖ','ޗ'=>'ޗ','ޘ'=>'ޘ','ޙ'=>'ޙ','ޚ'=>'ޚ','ޛ'=>'ޛ','ޜ'=>'ޜ','ޝ'=>'ޝ','ޞ'=>'ޞ','ޟ'=>'ޟ','ޠ'=>'ޠ','ޡ'=>'ޡ','ޢ'=>'ޢ','ޣ'=>'ޣ','ޤ'=>'ޤ','ޥ'=>'ޥ','ަ'=>'ަ','ާ'=>'ާ','ި'=>'ި','ީ'=>'ީ','ު'=>'ު','ޫ'=>'ޫ','ެ'=>'ެ','ޭ'=>'ޭ','ޮ'=>'ޮ','ޯ'=>'ޯ','ް'=>'ް','ޱ'=>'ޱ','߀'=>'0','߁'=>'1','߂'=>'2','߃'=>'3','߄'=>'4','߅'=>'5','߆'=>'6','߇'=>'7','߈'=>'8','߉'=>'9','ߊ'=>'ߊ','ߋ'=>'ߋ','ߌ'=>'ߌ','ߍ'=>'ߍ','ߎ'=>'ߎ','ߏ'=>'ߏ','ߐ'=>'ߐ','ߑ'=>'ߑ','ߒ'=>'ߒ','ߓ'=>'ߓ','ߔ'=>'ߔ','ߕ'=>'ߕ','ߖ'=>'ߖ','ߗ'=>'ߗ','ߘ'=>'ߘ','ߙ'=>'ߙ','ߚ'=>'ߚ','ߛ'=>'ߛ','ߜ'=>'ߜ','ߝ'=>'ߝ','ߞ'=>'ߞ','ߟ'=>'ߟ','ߠ'=>'ߠ','ߡ'=>'ߡ','ߢ'=>'ߢ','ߣ'=>'ߣ','ߤ'=>'ߤ','ߥ'=>'ߥ','ߦ'=>'ߦ','ߧ'=>'ߧ','ߨ'=>'ߨ','ߩ'=>'ߩ','ߪ'=>'ߪ','߫'=>'߫','߬'=>'߬','߭'=>'߭','߮'=>'߮','߯'=>'߯','߰'=>'߰','߱'=>'߱','߲'=>'߲','߳'=>'߳','ߴ'=>'ߴ','ߵ'=>'ߵ','ߺ'=>'ߺ');
diff --git a/phpBB/includes/utf/data/search_indexer_1.php b/phpBB/includes/utf/data/search_indexer_1.php
index 6173117ffc..4dd142bb43 100644
--- a/phpBB/includes/utf/data/search_indexer_1.php
+++ b/phpBB/includes/utf/data/search_indexer_1.php
@@ -1 +1 @@
-<?php return array('ँ'=>'ँ','ं'=>'ं','ः'=>'ः','ऄ'=>'ऄ','अ'=>'अ','आ'=>'आ','इ'=>'इ','ई'=>'ई','उ'=>'उ','ऊ'=>'ऊ','ऋ'=>'ऋ','ऌ'=>'ऌ','ऍ'=>'ऍ','ऎ'=>'ऎ','ए'=>'ए','ऐ'=>'ऐ','ऑ'=>'ऑ','ऒ'=>'ऒ','ओ'=>'ओ','औ'=>'औ','क'=>'क','ख'=>'ख','ग'=>'ग','घ'=>'घ','ङ'=>'ङ','च'=>'च','छ'=>'छ','ज'=>'ज','झ'=>'झ','ञ'=>'ञ','ट'=>'ट','ठ'=>'ठ','ड'=>'ड','ढ'=>'ढ','ण'=>'ण','त'=>'त','थ'=>'थ','द'=>'द','ध'=>'ध','न'=>'न','ऩ'=>'ऩ','प'=>'प','फ'=>'फ','ब'=>'ब','भ'=>'भ','म'=>'म','य'=>'य','र'=>'र','ऱ'=>'ऱ','ल'=>'ल','ळ'=>'ळ','ऴ'=>'ऴ','व'=>'व','श'=>'श','ष'=>'ष','स'=>'स','ह'=>'ह','़'=>'़','ऽ'=>'ऽ','ा'=>'ा','ि'=>'ि','ी'=>'ी','ु'=>'ु','ू'=>'ू','ृ'=>'ृ','ॄ'=>'ॄ','ॅ'=>'ॅ','ॆ'=>'ॆ','े'=>'े','ै'=>'ै','ॉ'=>'ॉ','ॊ'=>'ॊ','ो'=>'ो','ौ'=>'ौ','्'=>'्','ॐ'=>'ॐ','॑'=>'॑','॒'=>'॒','॓'=>'॓','॔'=>'॔','क़'=>'क़','ख़'=>'ख़','ग़'=>'ग़','ज़'=>'ज़','ड़'=>'ड़','ढ़'=>'ढ़','फ़'=>'फ़','य़'=>'य़','ॠ'=>'ॠ','ॡ'=>'ॡ','ॢ'=>'ॢ','ॣ'=>'ॣ','०'=>'0','१'=>'1','२'=>'2','३'=>'3','४'=>'4','५'=>'5','६'=>'6','७'=>'7','८'=>'8','९'=>'9','ॻ'=>'ॻ','ॼ'=>'ॼ','ॽ'=>'ॽ','ॾ'=>'ॾ','ॿ'=>'ॿ','ঁ'=>'ঁ','ং'=>'ং','ঃ'=>'ঃ','অ'=>'অ','আ'=>'আ','ই'=>'ই','ঈ'=>'ঈ','উ'=>'উ','ঊ'=>'ঊ','ঋ'=>'ঋ','ঌ'=>'ঌ','এ'=>'এ','ঐ'=>'ঐ','ও'=>'ও','ঔ'=>'ঔ','ক'=>'ক','খ'=>'খ','গ'=>'গ','ঘ'=>'ঘ','ঙ'=>'ঙ','চ'=>'চ','ছ'=>'ছ','জ'=>'জ','ঝ'=>'ঝ','ঞ'=>'ঞ','ট'=>'ট','ঠ'=>'ঠ','ড'=>'ড','ঢ'=>'ঢ','ণ'=>'ণ','ত'=>'ত','থ'=>'থ','দ'=>'দ','ধ'=>'ধ','ন'=>'ন','প'=>'প','ফ'=>'ফ','ব'=>'ব','ভ'=>'ভ','ম'=>'ম','য'=>'য','র'=>'র','ল'=>'ল','শ'=>'শ','ষ'=>'ষ','স'=>'স','হ'=>'হ','়'=>'়','ঽ'=>'ঽ','া'=>'া','ি'=>'ি','ী'=>'ী','ু'=>'ু','ূ'=>'ূ','ৃ'=>'ৃ','ৄ'=>'ৄ','ে'=>'ে','ৈ'=>'ৈ','ো'=>'ো','ৌ'=>'ৌ','্'=>'্','ৎ'=>'ৎ','ৗ'=>'ৗ','ড়'=>'ড়','ঢ়'=>'ঢ়','য়'=>'য়','ৠ'=>'ৠ','ৡ'=>'ৡ','ৢ'=>'ৢ','ৣ'=>'ৣ','০'=>'0','১'=>'1','২'=>'2','৩'=>'3','৪'=>'4','৫'=>'5','৬'=>'6','৭'=>'7','৮'=>'8','৯'=>'9','ৰ'=>'ৰ','ৱ'=>'ৱ','৴'=>'1','৵'=>'2','৶'=>'3','৷'=>'4','৸'=>'৸','৹'=>'16','ਁ'=>'ਁ','ਂ'=>'ਂ','ਃ'=>'ਃ','ਅ'=>'ਅ','ਆ'=>'ਆ','ਇ'=>'ਇ','ਈ'=>'ਈ','ਉ'=>'ਉ','ਊ'=>'ਊ','ਏ'=>'ਏ','ਐ'=>'ਐ','ਓ'=>'ਓ','ਔ'=>'ਔ','ਕ'=>'ਕ','ਖ'=>'ਖ','ਗ'=>'ਗ','ਘ'=>'ਘ','ਙ'=>'ਙ','ਚ'=>'ਚ','ਛ'=>'ਛ','ਜ'=>'ਜ','ਝ'=>'ਝ','ਞ'=>'ਞ','ਟ'=>'ਟ','ਠ'=>'ਠ','ਡ'=>'ਡ','ਢ'=>'ਢ','ਣ'=>'ਣ','ਤ'=>'ਤ','ਥ'=>'ਥ','ਦ'=>'ਦ','ਧ'=>'ਧ','ਨ'=>'ਨ','ਪ'=>'ਪ','ਫ'=>'ਫ','ਬ'=>'ਬ','ਭ'=>'ਭ','ਮ'=>'ਮ','ਯ'=>'ਯ','ਰ'=>'ਰ','ਲ'=>'ਲ','ਲ਼'=>'ਲ਼','ਵ'=>'ਵ','ਸ਼'=>'ਸ਼','ਸ'=>'ਸ','ਹ'=>'ਹ','਼'=>'਼','ਾ'=>'ਾ','ਿ'=>'ਿ','ੀ'=>'ੀ','ੁ'=>'ੁ','ੂ'=>'ੂ','ੇ'=>'ੇ','ੈ'=>'ੈ','ੋ'=>'ੋ','ੌ'=>'ੌ','੍'=>'੍','ਖ਼'=>'ਖ਼','ਗ਼'=>'ਗ਼','ਜ਼'=>'ਜ਼','ੜ'=>'ੜ','ਫ਼'=>'ਫ਼','੦'=>'0','੧'=>'1','੨'=>'2','੩'=>'3','੪'=>'4','੫'=>'5','੬'=>'6','੭'=>'7','੮'=>'8','੯'=>'9','ੰ'=>'ੰ','ੱ'=>'ੱ','ੲ'=>'ੲ','ੳ'=>'ੳ','ੴ'=>'ੴ','ઁ'=>'ઁ','ં'=>'ં','ઃ'=>'ઃ','અ'=>'અ','આ'=>'આ','ઇ'=>'ઇ','ઈ'=>'ઈ','ઉ'=>'ઉ','ઊ'=>'ઊ','ઋ'=>'ઋ','ઌ'=>'ઌ','ઍ'=>'ઍ','એ'=>'એ','ઐ'=>'ઐ','ઑ'=>'ઑ','ઓ'=>'ઓ','ઔ'=>'ઔ','ક'=>'ક','ખ'=>'ખ','ગ'=>'ગ','ઘ'=>'ઘ','ઙ'=>'ઙ','ચ'=>'ચ','છ'=>'છ','જ'=>'જ','ઝ'=>'ઝ','ઞ'=>'ઞ','ટ'=>'ટ','ઠ'=>'ઠ','ડ'=>'ડ','ઢ'=>'ઢ','ણ'=>'ણ','ત'=>'ત','થ'=>'થ','દ'=>'દ','ધ'=>'ધ','ન'=>'ન','પ'=>'પ','ફ'=>'ફ','બ'=>'બ','ભ'=>'ભ','મ'=>'મ','ય'=>'ય','ર'=>'ર','લ'=>'લ','ળ'=>'ળ','વ'=>'વ','શ'=>'શ','ષ'=>'ષ','સ'=>'સ','હ'=>'હ','઼'=>'઼','ઽ'=>'ઽ','ા'=>'ા','િ'=>'િ','ી'=>'ી','ુ'=>'ુ','ૂ'=>'ૂ','ૃ'=>'ૃ','ૄ'=>'ૄ','ૅ'=>'ૅ','ે'=>'ે','ૈ'=>'ૈ','ૉ'=>'ૉ','ો'=>'ો','ૌ'=>'ૌ','્'=>'્','ૐ'=>'ૐ','ૠ'=>'ૠ','ૡ'=>'ૡ','ૢ'=>'ૢ','ૣ'=>'ૣ','૦'=>'0','૧'=>'1','૨'=>'2','૩'=>'3','૪'=>'4','૫'=>'5','૬'=>'6','૭'=>'7','૮'=>'8','૯'=>'9','ଁ'=>'ଁ','ଂ'=>'ଂ','ଃ'=>'ଃ','ଅ'=>'ଅ','ଆ'=>'ଆ','ଇ'=>'ଇ','ଈ'=>'ଈ','ଉ'=>'ଉ','ଊ'=>'ଊ','ଋ'=>'ଋ','ଌ'=>'ଌ','ଏ'=>'ଏ','ଐ'=>'ଐ','ଓ'=>'ଓ','ଔ'=>'ଔ','କ'=>'କ','ଖ'=>'ଖ','ଗ'=>'ଗ','ଘ'=>'ଘ','ଙ'=>'ଙ','ଚ'=>'ଚ','ଛ'=>'ଛ','ଜ'=>'ଜ','ଝ'=>'ଝ','ଞ'=>'ଞ','ଟ'=>'ଟ','ଠ'=>'ଠ','ଡ'=>'ଡ','ଢ'=>'ଢ','ଣ'=>'ଣ','ତ'=>'ତ','ଥ'=>'ଥ','ଦ'=>'ଦ','ଧ'=>'ଧ','ନ'=>'ନ','ପ'=>'ପ','ଫ'=>'ଫ','ବ'=>'ବ','ଭ'=>'ଭ','ମ'=>'ମ','ଯ'=>'ଯ','ର'=>'ର','ଲ'=>'ଲ','ଳ'=>'ଳ','ଵ'=>'ଵ','ଶ'=>'ଶ','ଷ'=>'ଷ','ସ'=>'ସ','ହ'=>'ହ','଼'=>'଼','ଽ'=>'ଽ','ା'=>'ା','ି'=>'ି','ୀ'=>'ୀ','ୁ'=>'ୁ','ୂ'=>'ୂ','ୃ'=>'ୃ','େ'=>'େ','ୈ'=>'ୈ','ୋ'=>'ୋ','ୌ'=>'ୌ','୍'=>'୍','ୖ'=>'ୖ','ୗ'=>'ୗ','ଡ଼'=>'ଡ଼','ଢ଼'=>'ଢ଼','ୟ'=>'ୟ','ୠ'=>'ୠ','ୡ'=>'ୡ','୦'=>'0','୧'=>'1','୨'=>'2','୩'=>'3','୪'=>'4','୫'=>'5','୬'=>'6','୭'=>'7','୮'=>'8','୯'=>'9','ୱ'=>'ୱ','ஂ'=>'ஂ','ஃ'=>'ஃ','அ'=>'அ','ஆ'=>'ஆ','இ'=>'இ','ஈ'=>'ஈ','உ'=>'உ','ஊ'=>'ஊ','எ'=>'எ','ஏ'=>'ஏ','ஐ'=>'ஐ','ஒ'=>'ஒ','ஓ'=>'ஓ','ஔ'=>'ஔ','க'=>'க','ங'=>'ங','ச'=>'ச','ஜ'=>'ஜ','ஞ'=>'ஞ','ட'=>'ட','ண'=>'ண','த'=>'த','ந'=>'ந','ன'=>'ன','ப'=>'ப','ம'=>'ம','ய'=>'ய','ர'=>'ர','ற'=>'ற','ல'=>'ல','ள'=>'ள','ழ'=>'ழ','வ'=>'வ','ஶ'=>'ஶ','ஷ'=>'ஷ','ஸ'=>'ஸ','ஹ'=>'ஹ','ா'=>'ா','ி'=>'ி','ீ'=>'ீ','ு'=>'ு','ூ'=>'ூ','ெ'=>'ெ','ே'=>'ே','ை'=>'ை','ொ'=>'ொ','ோ'=>'ோ','ௌ'=>'ௌ','்'=>'்','ௗ'=>'ௗ','௦'=>'0','௧'=>'1','௨'=>'2','௩'=>'3','௪'=>'4','௫'=>'5','௬'=>'6','௭'=>'7','௮'=>'8','௯'=>'9','௰'=>'10','௱'=>'100','௲'=>'1000','ఁ'=>'ఁ','ం'=>'ం','ః'=>'ః','అ'=>'అ','ఆ'=>'ఆ','ఇ'=>'ఇ','ఈ'=>'ఈ','ఉ'=>'ఉ','ఊ'=>'ఊ','ఋ'=>'ఋ','ఌ'=>'ఌ','ఎ'=>'ఎ','ఏ'=>'ఏ','ఐ'=>'ఐ','ఒ'=>'ఒ','ఓ'=>'ఓ','ఔ'=>'ఔ','క'=>'క','ఖ'=>'ఖ','గ'=>'గ','ఘ'=>'ఘ','ఙ'=>'ఙ','చ'=>'చ','ఛ'=>'ఛ','జ'=>'జ','ఝ'=>'ఝ','ఞ'=>'ఞ','ట'=>'ట','ఠ'=>'ఠ','డ'=>'డ','ఢ'=>'ఢ','ణ'=>'ణ','త'=>'త','థ'=>'థ','ద'=>'ద','ధ'=>'ధ','న'=>'న','ప'=>'ప','ఫ'=>'ఫ','బ'=>'బ','భ'=>'భ','మ'=>'మ','య'=>'య','ర'=>'ర','ఱ'=>'ఱ','ల'=>'ల','ళ'=>'ళ','వ'=>'వ','శ'=>'శ','ష'=>'ష','స'=>'స','హ'=>'హ','ా'=>'ా','ి'=>'ి','ీ'=>'ీ','ు'=>'ు','ూ'=>'ూ','ృ'=>'ృ','ౄ'=>'ౄ','ె'=>'ె','ే'=>'ే','ై'=>'ై','ొ'=>'ొ','ో'=>'ో','ౌ'=>'ౌ','్'=>'్','ౕ'=>'ౕ','ౖ'=>'ౖ','ౠ'=>'ౠ','ౡ'=>'ౡ','౦'=>'0','౧'=>'1','౨'=>'2','౩'=>'3','౪'=>'4','౫'=>'5','౬'=>'6','౭'=>'7','౮'=>'8','౯'=>'9','ಂ'=>'ಂ','ಃ'=>'ಃ','ಅ'=>'ಅ','ಆ'=>'ಆ','ಇ'=>'ಇ','ಈ'=>'ಈ','ಉ'=>'ಉ','ಊ'=>'ಊ','ಋ'=>'ಋ','ಌ'=>'ಌ','ಎ'=>'ಎ','ಏ'=>'ಏ','ಐ'=>'ಐ','ಒ'=>'ಒ','ಓ'=>'ಓ','ಔ'=>'ಔ','ಕ'=>'ಕ','ಖ'=>'ಖ','ಗ'=>'ಗ','ಘ'=>'ಘ','ಙ'=>'ಙ','ಚ'=>'ಚ','ಛ'=>'ಛ','ಜ'=>'ಜ','ಝ'=>'ಝ','ಞ'=>'ಞ','ಟ'=>'ಟ','ಠ'=>'ಠ','ಡ'=>'ಡ','ಢ'=>'ಢ','ಣ'=>'ಣ','ತ'=>'ತ','ಥ'=>'ಥ','ದ'=>'ದ','ಧ'=>'ಧ','ನ'=>'ನ','ಪ'=>'ಪ','ಫ'=>'ಫ','ಬ'=>'ಬ','ಭ'=>'ಭ','ಮ'=>'ಮ','ಯ'=>'ಯ','ರ'=>'ರ','ಱ'=>'ಱ','ಲ'=>'ಲ','ಳ'=>'ಳ','ವ'=>'ವ','ಶ'=>'ಶ','ಷ'=>'ಷ','ಸ'=>'ಸ','ಹ'=>'ಹ','಼'=>'಼','ಽ'=>'ಽ','ಾ'=>'ಾ','ಿ'=>'ಿ','ೀ'=>'ೀ','ು'=>'ು','ೂ'=>'ೂ','ೃ'=>'ೃ','ೄ'=>'ೄ','ೆ'=>'ೆ','ೇ'=>'ೇ','ೈ'=>'ೈ','ೊ'=>'ೊ','ೋ'=>'ೋ','ೌ'=>'ೌ','್'=>'್','ೕ'=>'ೕ','ೖ'=>'ೖ','ೞ'=>'ೞ','ೠ'=>'ೠ','ೡ'=>'ೡ','ೢ'=>'ೢ','ೣ'=>'ೣ','೦'=>'0','೧'=>'1','೨'=>'2','೩'=>'3','೪'=>'4','೫'=>'5','೬'=>'6','೭'=>'7','೮'=>'8','೯'=>'9','ം'=>'ം','ഃ'=>'ഃ','അ'=>'അ','ആ'=>'ആ','ഇ'=>'ഇ','ഈ'=>'ഈ','ഉ'=>'ഉ','ഊ'=>'ഊ','ഋ'=>'ഋ','ഌ'=>'ഌ','എ'=>'എ','ഏ'=>'ഏ','ഐ'=>'ഐ','ഒ'=>'ഒ','ഓ'=>'ഓ','ഔ'=>'ഔ','ക'=>'ക','ഖ'=>'ഖ','ഗ'=>'ഗ','ഘ'=>'ഘ','ങ'=>'ങ','ച'=>'ച','ഛ'=>'ഛ','ജ'=>'ജ','ഝ'=>'ഝ','ഞ'=>'ഞ','ട'=>'ട','ഠ'=>'ഠ','ഡ'=>'ഡ','ഢ'=>'ഢ','ണ'=>'ണ','ത'=>'ത','ഥ'=>'ഥ','ദ'=>'ദ','ധ'=>'ധ','ന'=>'ന','പ'=>'പ','ഫ'=>'ഫ','ബ'=>'ബ','ഭ'=>'ഭ','മ'=>'മ','യ'=>'യ','ര'=>'ര','റ'=>'റ','ല'=>'ല','ള'=>'ള','ഴ'=>'ഴ','വ'=>'വ','ശ'=>'ശ','ഷ'=>'ഷ','സ'=>'സ','ഹ'=>'ഹ','ാ'=>'ാ','ി'=>'ി','ീ'=>'ീ','ു'=>'ു','ൂ'=>'ൂ','ൃ'=>'ൃ','െ'=>'െ','േ'=>'േ','ൈ'=>'ൈ','ൊ'=>'ൊ','ോ'=>'ോ','ൌ'=>'ൌ','്'=>'്','ൗ'=>'ൗ','ൠ'=>'ൠ','ൡ'=>'ൡ','൦'=>'0','൧'=>'1','൨'=>'2','൩'=>'3','൪'=>'4','൫'=>'5','൬'=>'6','൭'=>'7','൮'=>'8','൯'=>'9','ං'=>'ං','ඃ'=>'ඃ','අ'=>'අ','ආ'=>'ආ','ඇ'=>'ඇ','ඈ'=>'ඈ','ඉ'=>'ඉ','ඊ'=>'ඊ','උ'=>'උ','ඌ'=>'ඌ','ඍ'=>'ඍ','ඎ'=>'ඎ','ඏ'=>'ඏ','ඐ'=>'ඐ','එ'=>'එ','ඒ'=>'ඒ','ඓ'=>'ඓ','ඔ'=>'ඔ','ඕ'=>'ඕ','ඖ'=>'ඖ','ක'=>'ක','ඛ'=>'ඛ','ග'=>'ග','ඝ'=>'ඝ','ඞ'=>'ඞ','ඟ'=>'ඟ','ච'=>'ච','ඡ'=>'ඡ','ජ'=>'ජ','ඣ'=>'ඣ','ඤ'=>'ඤ','ඥ'=>'ඥ','ඦ'=>'ඦ','ට'=>'ට','ඨ'=>'ඨ','ඩ'=>'ඩ','ඪ'=>'ඪ','ණ'=>'ණ','ඬ'=>'ඬ','ත'=>'ත','ථ'=>'ථ','ද'=>'ද','ධ'=>'ධ','න'=>'න','ඳ'=>'ඳ','ප'=>'ප','ඵ'=>'ඵ','බ'=>'බ','භ'=>'භ','ම'=>'ම','ඹ'=>'ඹ','ය'=>'ය','ර'=>'ර','ල'=>'ල','ව'=>'ව','ශ'=>'ශ','ෂ'=>'ෂ','ස'=>'ස','හ'=>'හ','ළ'=>'ළ','ෆ'=>'ෆ','්'=>'්','ා'=>'ා','ැ'=>'ැ','ෑ'=>'ෑ','ි'=>'ි','ී'=>'ී','ු'=>'ු','ූ'=>'ූ','ෘ'=>'ෘ','ෙ'=>'ෙ','ේ'=>'ේ','ෛ'=>'ෛ','ො'=>'ො','ෝ'=>'ෝ','ෞ'=>'ෞ','ෟ'=>'ෟ','ෲ'=>'ෲ','ෳ'=>'ෳ','ก'=>'ก','ข'=>'ข','ฃ'=>'ฃ','ค'=>'ค','ฅ'=>'ฅ','ฆ'=>'ฆ','ง'=>'ง','จ'=>'จ','ฉ'=>'ฉ','ช'=>'ช','ซ'=>'ซ','ฌ'=>'ฌ','ญ'=>'ญ','ฎ'=>'ฎ','ฏ'=>'ฏ','ฐ'=>'ฐ','ฑ'=>'ฑ','ฒ'=>'ฒ','ณ'=>'ณ','ด'=>'ด','ต'=>'ต','ถ'=>'ถ','ท'=>'ท','ธ'=>'ธ','น'=>'น','บ'=>'บ','ป'=>'ป','ผ'=>'ผ','ฝ'=>'ฝ','พ'=>'พ','ฟ'=>'ฟ','ภ'=>'ภ','ม'=>'ม','ย'=>'ย','ร'=>'ร','ฤ'=>'ฤ','ล'=>'ล','ฦ'=>'ฦ','ว'=>'ว','ศ'=>'ศ','ษ'=>'ษ','ส'=>'ส','ห'=>'ห','ฬ'=>'ฬ','อ'=>'อ','ฮ'=>'ฮ','ฯ'=>'ฯ','ะ'=>'ะ','ั'=>'ั','า'=>'า','ำ'=>'ำ','ิ'=>'ิ','ี'=>'ี','ึ'=>'ึ','ื'=>'ื','ุ'=>'ุ','ู'=>'ู','ฺ'=>'ฺ','เ'=>'เ','แ'=>'แ','โ'=>'โ','ใ'=>'ใ','ไ'=>'ไ','ๅ'=>'ๅ','ๆ'=>'ๆ','็'=>'็','่'=>'่','้'=>'้','๊'=>'๊','๋'=>'๋','์'=>'์','ํ'=>'ํ','๎'=>'๎','๐'=>'0','๑'=>'1','๒'=>'2','๓'=>'3','๔'=>'4','๕'=>'5','๖'=>'6','๗'=>'7','๘'=>'8','๙'=>'9','ກ'=>'ກ','ຂ'=>'ຂ','ຄ'=>'ຄ','ງ'=>'ງ','ຈ'=>'ຈ','ຊ'=>'ຊ','ຍ'=>'ຍ','ດ'=>'ດ','ຕ'=>'ຕ','ຖ'=>'ຖ','ທ'=>'ທ','ນ'=>'ນ','ບ'=>'ບ','ປ'=>'ປ','ຜ'=>'ຜ','ຝ'=>'ຝ','ພ'=>'ພ','ຟ'=>'ຟ','ມ'=>'ມ','ຢ'=>'ຢ','ຣ'=>'ຣ','ລ'=>'ລ','ວ'=>'ວ','ສ'=>'ສ','ຫ'=>'ຫ','ອ'=>'ອ','ຮ'=>'ຮ','ຯ'=>'ຯ','ະ'=>'ະ','ັ'=>'ັ','າ'=>'າ','ຳ'=>'ຳ','ິ'=>'ິ','ີ'=>'ີ','ຶ'=>'ຶ','ື'=>'ື','ຸ'=>'ຸ','ູ'=>'ູ','ົ'=>'ົ','ຼ'=>'ຼ','ຽ'=>'ຽ','ເ'=>'ເ','ແ'=>'ແ','ໂ'=>'ໂ','ໃ'=>'ໃ','ໄ'=>'ໄ','ໆ'=>'ໆ','່'=>'່','້'=>'້','໊'=>'໊','໋'=>'໋','໌'=>'໌','ໍ'=>'ໍ','໐'=>'0','໑'=>'1','໒'=>'2','໓'=>'3','໔'=>'4','໕'=>'5','໖'=>'6','໗'=>'7','໘'=>'8','໙'=>'9','ໜ'=>'ໜ','ໝ'=>'ໝ','ༀ'=>'ༀ','༘'=>'༘','༙'=>'༙','༠'=>'0','༡'=>'1','༢'=>'2','༣'=>'3','༤'=>'4','༥'=>'5','༦'=>'6','༧'=>'7','༨'=>'8','༩'=>'9','༪'=>'1/2','༫'=>'3/2','༬'=>'5/2','༭'=>'7/2','༮'=>'9/2','༯'=>'11/2','༰'=>'13/2','༱'=>'15/2','༲'=>'17/2','༳'=>'-1/2','༵'=>'༵','༷'=>'༷','༹'=>'༹','༾'=>'༾','༿'=>'༿','ཀ'=>'ཀ','ཁ'=>'ཁ','ག'=>'ག','གྷ'=>'གྷ','ང'=>'ང','ཅ'=>'ཅ','ཆ'=>'ཆ','ཇ'=>'ཇ','ཉ'=>'ཉ','ཊ'=>'ཊ','ཋ'=>'ཋ','ཌ'=>'ཌ','ཌྷ'=>'ཌྷ','ཎ'=>'ཎ','ཏ'=>'ཏ','ཐ'=>'ཐ','ད'=>'ད','དྷ'=>'དྷ','ན'=>'ན','པ'=>'པ','ཕ'=>'ཕ','བ'=>'བ','བྷ'=>'བྷ','མ'=>'མ','ཙ'=>'ཙ','ཚ'=>'ཚ','ཛ'=>'ཛ','ཛྷ'=>'ཛྷ','ཝ'=>'ཝ','ཞ'=>'ཞ','ཟ'=>'ཟ','འ'=>'འ','ཡ'=>'ཡ','ར'=>'ར','ལ'=>'ལ','ཤ'=>'ཤ','ཥ'=>'ཥ','ས'=>'ས','ཧ'=>'ཧ','ཨ'=>'ཨ','ཀྵ'=>'ཀྵ','ཪ'=>'ཪ','ཱ'=>'ཱ','ི'=>'ི','ཱི'=>'ཱི','ུ'=>'ུ','ཱུ'=>'ཱུ','ྲྀ'=>'ྲྀ','ཷ'=>'ཷ','ླྀ'=>'ླྀ','ཹ'=>'ཹ','ེ'=>'ེ','ཻ'=>'ཻ','ོ'=>'ོ','ཽ'=>'ཽ','ཾ'=>'ཾ','ཿ'=>'ཿ','ྀ'=>'ྀ','ཱྀ'=>'ཱྀ','ྂ'=>'ྂ','ྃ'=>'ྃ','྄'=>'྄','྆'=>'྆','྇'=>'྇','ྈ'=>'ྈ','ྉ'=>'ྉ','ྊ'=>'ྊ','ྋ'=>'ྋ','ྐ'=>'ྐ','ྑ'=>'ྑ','ྒ'=>'ྒ','ྒྷ'=>'ྒྷ','ྔ'=>'ྔ','ྕ'=>'ྕ','ྖ'=>'ྖ','ྗ'=>'ྗ','ྙ'=>'ྙ','ྚ'=>'ྚ','ྛ'=>'ྛ','ྜ'=>'ྜ','ྜྷ'=>'ྜྷ','ྞ'=>'ྞ','ྟ'=>'ྟ','ྠ'=>'ྠ','ྡ'=>'ྡ','ྡྷ'=>'ྡྷ','ྣ'=>'ྣ','ྤ'=>'ྤ','ྥ'=>'ྥ','ྦ'=>'ྦ','ྦྷ'=>'ྦྷ','ྨ'=>'ྨ','ྩ'=>'ྩ','ྪ'=>'ྪ','ྫ'=>'ྫ','ྫྷ'=>'ྫྷ','ྭ'=>'ྭ','ྮ'=>'ྮ','ྯ'=>'ྯ','ྰ'=>'ྰ','ྱ'=>'ྱ','ྲ'=>'ྲ','ླ'=>'ླ','ྴ'=>'ྴ','ྵ'=>'ྵ','ྶ'=>'ྶ','ྷ'=>'ྷ','ྸ'=>'ྸ','ྐྵ'=>'ྐྵ','ྺ'=>'ྺ','ྻ'=>'ྻ','ྼ'=>'ྼ','࿆'=>'࿆'); \ No newline at end of file
+<?php return array('ँ'=>'ँ','ं'=>'ं','ः'=>'ः','ऄ'=>'ऄ','अ'=>'अ','आ'=>'आ','इ'=>'इ','ई'=>'ई','उ'=>'उ','ऊ'=>'ऊ','ऋ'=>'ऋ','ऌ'=>'ऌ','ऍ'=>'ऍ','ऎ'=>'ऎ','ए'=>'ए','ऐ'=>'ऐ','ऑ'=>'ऑ','ऒ'=>'ऒ','ओ'=>'ओ','औ'=>'औ','क'=>'क','ख'=>'ख','ग'=>'ग','घ'=>'घ','ङ'=>'ङ','च'=>'च','छ'=>'छ','ज'=>'ज','झ'=>'झ','ञ'=>'ञ','ट'=>'ट','ठ'=>'ठ','ड'=>'ड','ढ'=>'ढ','ण'=>'ण','त'=>'त','थ'=>'थ','द'=>'द','ध'=>'ध','न'=>'न','ऩ'=>'ऩ','प'=>'प','फ'=>'फ','ब'=>'ब','भ'=>'भ','म'=>'म','य'=>'य','र'=>'र','ऱ'=>'ऱ','ल'=>'ल','ळ'=>'ळ','ऴ'=>'ऴ','व'=>'व','श'=>'श','ष'=>'ष','स'=>'स','ह'=>'ह','़'=>'़','ऽ'=>'ऽ','ा'=>'ा','ि'=>'ि','ी'=>'ी','ु'=>'ु','ू'=>'ू','ृ'=>'ृ','ॄ'=>'ॄ','ॅ'=>'ॅ','ॆ'=>'ॆ','े'=>'े','ै'=>'ै','ॉ'=>'ॉ','ॊ'=>'ॊ','ो'=>'ो','ौ'=>'ौ','्'=>'्','ॐ'=>'ॐ','॑'=>'॑','॒'=>'॒','॓'=>'॓','॔'=>'॔','क़'=>'क़','ख़'=>'ख़','ग़'=>'ग़','ज़'=>'ज़','ड़'=>'ड़','ढ़'=>'ढ़','फ़'=>'फ़','य़'=>'य़','ॠ'=>'ॠ','ॡ'=>'ॡ','ॢ'=>'ॢ','ॣ'=>'ॣ','०'=>'0','१'=>'1','२'=>'2','३'=>'3','४'=>'4','५'=>'5','६'=>'6','७'=>'7','८'=>'8','९'=>'9','ॻ'=>'ॻ','ॼ'=>'ॼ','ॽ'=>'ॽ','ॾ'=>'ॾ','ॿ'=>'ॿ','ঁ'=>'ঁ','ং'=>'ং','ঃ'=>'ঃ','অ'=>'অ','আ'=>'আ','ই'=>'ই','ঈ'=>'ঈ','উ'=>'উ','ঊ'=>'ঊ','ঋ'=>'ঋ','ঌ'=>'ঌ','এ'=>'এ','ঐ'=>'ঐ','ও'=>'ও','ঔ'=>'ঔ','ক'=>'ক','খ'=>'খ','গ'=>'গ','ঘ'=>'ঘ','ঙ'=>'ঙ','চ'=>'চ','ছ'=>'ছ','জ'=>'জ','ঝ'=>'ঝ','ঞ'=>'ঞ','ট'=>'ট','ঠ'=>'ঠ','ড'=>'ড','ঢ'=>'ঢ','ণ'=>'ণ','ত'=>'ত','থ'=>'থ','দ'=>'দ','ধ'=>'ধ','ন'=>'ন','প'=>'প','ফ'=>'ফ','ব'=>'ব','ভ'=>'ভ','ম'=>'ম','য'=>'য','র'=>'র','ল'=>'ল','শ'=>'শ','ষ'=>'ষ','স'=>'স','হ'=>'হ','়'=>'়','ঽ'=>'ঽ','া'=>'া','ি'=>'ি','ী'=>'ী','ু'=>'ু','ূ'=>'ূ','ৃ'=>'ৃ','ৄ'=>'ৄ','ে'=>'ে','ৈ'=>'ৈ','ো'=>'ো','ৌ'=>'ৌ','্'=>'্','ৎ'=>'ৎ','ৗ'=>'ৗ','ড়'=>'ড়','ঢ়'=>'ঢ়','য়'=>'য়','ৠ'=>'ৠ','ৡ'=>'ৡ','ৢ'=>'ৢ','ৣ'=>'ৣ','০'=>'0','১'=>'1','২'=>'2','৩'=>'3','৪'=>'4','৫'=>'5','৬'=>'6','৭'=>'7','৮'=>'8','৯'=>'9','ৰ'=>'ৰ','ৱ'=>'ৱ','৴'=>'1','৵'=>'2','৶'=>'3','৷'=>'4','৸'=>'৸','৹'=>'16','ਁ'=>'ਁ','ਂ'=>'ਂ','ਃ'=>'ਃ','ਅ'=>'ਅ','ਆ'=>'ਆ','ਇ'=>'ਇ','ਈ'=>'ਈ','ਉ'=>'ਉ','ਊ'=>'ਊ','ਏ'=>'ਏ','ਐ'=>'ਐ','ਓ'=>'ਓ','ਔ'=>'ਔ','ਕ'=>'ਕ','ਖ'=>'ਖ','ਗ'=>'ਗ','ਘ'=>'ਘ','ਙ'=>'ਙ','ਚ'=>'ਚ','ਛ'=>'ਛ','ਜ'=>'ਜ','ਝ'=>'ਝ','ਞ'=>'ਞ','ਟ'=>'ਟ','ਠ'=>'ਠ','ਡ'=>'ਡ','ਢ'=>'ਢ','ਣ'=>'ਣ','ਤ'=>'ਤ','ਥ'=>'ਥ','ਦ'=>'ਦ','ਧ'=>'ਧ','ਨ'=>'ਨ','ਪ'=>'ਪ','ਫ'=>'ਫ','ਬ'=>'ਬ','ਭ'=>'ਭ','ਮ'=>'ਮ','ਯ'=>'ਯ','ਰ'=>'ਰ','ਲ'=>'ਲ','ਲ਼'=>'ਲ਼','ਵ'=>'ਵ','ਸ਼'=>'ਸ਼','ਸ'=>'ਸ','ਹ'=>'ਹ','਼'=>'਼','ਾ'=>'ਾ','ਿ'=>'ਿ','ੀ'=>'ੀ','ੁ'=>'ੁ','ੂ'=>'ੂ','ੇ'=>'ੇ','ੈ'=>'ੈ','ੋ'=>'ੋ','ੌ'=>'ੌ','੍'=>'੍','ਖ਼'=>'ਖ਼','ਗ਼'=>'ਗ਼','ਜ਼'=>'ਜ਼','ੜ'=>'ੜ','ਫ਼'=>'ਫ਼','੦'=>'0','੧'=>'1','੨'=>'2','੩'=>'3','੪'=>'4','੫'=>'5','੬'=>'6','੭'=>'7','੮'=>'8','੯'=>'9','ੰ'=>'ੰ','ੱ'=>'ੱ','ੲ'=>'ੲ','ੳ'=>'ੳ','ੴ'=>'ੴ','ઁ'=>'ઁ','ં'=>'ં','ઃ'=>'ઃ','અ'=>'અ','આ'=>'આ','ઇ'=>'ઇ','ઈ'=>'ઈ','ઉ'=>'ઉ','ઊ'=>'ઊ','ઋ'=>'ઋ','ઌ'=>'ઌ','ઍ'=>'ઍ','એ'=>'એ','ઐ'=>'ઐ','ઑ'=>'ઑ','ઓ'=>'ઓ','ઔ'=>'ઔ','ક'=>'ક','ખ'=>'ખ','ગ'=>'ગ','ઘ'=>'ઘ','ઙ'=>'ઙ','ચ'=>'ચ','છ'=>'છ','જ'=>'જ','ઝ'=>'ઝ','ઞ'=>'ઞ','ટ'=>'ટ','ઠ'=>'ઠ','ડ'=>'ડ','ઢ'=>'ઢ','ણ'=>'ણ','ત'=>'ત','થ'=>'થ','દ'=>'દ','ધ'=>'ધ','ન'=>'ન','પ'=>'પ','ફ'=>'ફ','બ'=>'બ','ભ'=>'ભ','મ'=>'મ','ય'=>'ય','ર'=>'ર','લ'=>'લ','ળ'=>'ળ','વ'=>'વ','શ'=>'શ','ષ'=>'ષ','સ'=>'સ','હ'=>'હ','઼'=>'઼','ઽ'=>'ઽ','ા'=>'ા','િ'=>'િ','ી'=>'ી','ુ'=>'ુ','ૂ'=>'ૂ','ૃ'=>'ૃ','ૄ'=>'ૄ','ૅ'=>'ૅ','ે'=>'ે','ૈ'=>'ૈ','ૉ'=>'ૉ','ો'=>'ો','ૌ'=>'ૌ','્'=>'્','ૐ'=>'ૐ','ૠ'=>'ૠ','ૡ'=>'ૡ','ૢ'=>'ૢ','ૣ'=>'ૣ','૦'=>'0','૧'=>'1','૨'=>'2','૩'=>'3','૪'=>'4','૫'=>'5','૬'=>'6','૭'=>'7','૮'=>'8','૯'=>'9','ଁ'=>'ଁ','ଂ'=>'ଂ','ଃ'=>'ଃ','ଅ'=>'ଅ','ଆ'=>'ଆ','ଇ'=>'ଇ','ଈ'=>'ଈ','ଉ'=>'ଉ','ଊ'=>'ଊ','ଋ'=>'ଋ','ଌ'=>'ଌ','ଏ'=>'ଏ','ଐ'=>'ଐ','ଓ'=>'ଓ','ଔ'=>'ଔ','କ'=>'କ','ଖ'=>'ଖ','ଗ'=>'ଗ','ଘ'=>'ଘ','ଙ'=>'ଙ','ଚ'=>'ଚ','ଛ'=>'ଛ','ଜ'=>'ଜ','ଝ'=>'ଝ','ଞ'=>'ଞ','ଟ'=>'ଟ','ଠ'=>'ଠ','ଡ'=>'ଡ','ଢ'=>'ଢ','ଣ'=>'ଣ','ତ'=>'ତ','ଥ'=>'ଥ','ଦ'=>'ଦ','ଧ'=>'ଧ','ନ'=>'ନ','ପ'=>'ପ','ଫ'=>'ଫ','ବ'=>'ବ','ଭ'=>'ଭ','ମ'=>'ମ','ଯ'=>'ଯ','ର'=>'ର','ଲ'=>'ଲ','ଳ'=>'ଳ','ଵ'=>'ଵ','ଶ'=>'ଶ','ଷ'=>'ଷ','ସ'=>'ସ','ହ'=>'ହ','଼'=>'଼','ଽ'=>'ଽ','ା'=>'ା','ି'=>'ି','ୀ'=>'ୀ','ୁ'=>'ୁ','ୂ'=>'ୂ','ୃ'=>'ୃ','େ'=>'େ','ୈ'=>'ୈ','ୋ'=>'ୋ','ୌ'=>'ୌ','୍'=>'୍','ୖ'=>'ୖ','ୗ'=>'ୗ','ଡ଼'=>'ଡ଼','ଢ଼'=>'ଢ଼','ୟ'=>'ୟ','ୠ'=>'ୠ','ୡ'=>'ୡ','୦'=>'0','୧'=>'1','୨'=>'2','୩'=>'3','୪'=>'4','୫'=>'5','୬'=>'6','୭'=>'7','୮'=>'8','୯'=>'9','ୱ'=>'ୱ','ஂ'=>'ஂ','ஃ'=>'ஃ','அ'=>'அ','ஆ'=>'ஆ','இ'=>'இ','ஈ'=>'ஈ','உ'=>'உ','ஊ'=>'ஊ','எ'=>'எ','ஏ'=>'ஏ','ஐ'=>'ஐ','ஒ'=>'ஒ','ஓ'=>'ஓ','ஔ'=>'ஔ','க'=>'க','ங'=>'ங','ச'=>'ச','ஜ'=>'ஜ','ஞ'=>'ஞ','ட'=>'ட','ண'=>'ண','த'=>'த','ந'=>'ந','ன'=>'ன','ப'=>'ப','ம'=>'ம','ய'=>'ய','ர'=>'ர','ற'=>'ற','ல'=>'ல','ள'=>'ள','ழ'=>'ழ','வ'=>'வ','ஶ'=>'ஶ','ஷ'=>'ஷ','ஸ'=>'ஸ','ஹ'=>'ஹ','ா'=>'ா','ி'=>'ி','ீ'=>'ீ','ு'=>'ு','ூ'=>'ூ','ெ'=>'ெ','ே'=>'ே','ை'=>'ை','ொ'=>'ொ','ோ'=>'ோ','ௌ'=>'ௌ','்'=>'்','ௗ'=>'ௗ','௦'=>'0','௧'=>'1','௨'=>'2','௩'=>'3','௪'=>'4','௫'=>'5','௬'=>'6','௭'=>'7','௮'=>'8','௯'=>'9','௰'=>'10','௱'=>'100','௲'=>'1000','ఁ'=>'ఁ','ం'=>'ం','ః'=>'ః','అ'=>'అ','ఆ'=>'ఆ','ఇ'=>'ఇ','ఈ'=>'ఈ','ఉ'=>'ఉ','ఊ'=>'ఊ','ఋ'=>'ఋ','ఌ'=>'ఌ','ఎ'=>'ఎ','ఏ'=>'ఏ','ఐ'=>'ఐ','ఒ'=>'ఒ','ఓ'=>'ఓ','ఔ'=>'ఔ','క'=>'క','ఖ'=>'ఖ','గ'=>'గ','ఘ'=>'ఘ','ఙ'=>'ఙ','చ'=>'చ','ఛ'=>'ఛ','జ'=>'జ','ఝ'=>'ఝ','ఞ'=>'ఞ','ట'=>'ట','ఠ'=>'ఠ','డ'=>'డ','ఢ'=>'ఢ','ణ'=>'ణ','త'=>'త','థ'=>'థ','ద'=>'ద','ధ'=>'ధ','న'=>'న','ప'=>'ప','ఫ'=>'ఫ','బ'=>'బ','భ'=>'భ','మ'=>'మ','య'=>'య','ర'=>'ర','ఱ'=>'ఱ','ల'=>'ల','ళ'=>'ళ','వ'=>'వ','శ'=>'శ','ష'=>'ష','స'=>'స','హ'=>'హ','ా'=>'ా','ి'=>'ి','ీ'=>'ీ','ు'=>'ు','ూ'=>'ూ','ృ'=>'ృ','ౄ'=>'ౄ','ె'=>'ె','ే'=>'ే','ై'=>'ై','ొ'=>'ొ','ో'=>'ో','ౌ'=>'ౌ','్'=>'్','ౕ'=>'ౕ','ౖ'=>'ౖ','ౠ'=>'ౠ','ౡ'=>'ౡ','౦'=>'0','౧'=>'1','౨'=>'2','౩'=>'3','౪'=>'4','౫'=>'5','౬'=>'6','౭'=>'7','౮'=>'8','౯'=>'9','ಂ'=>'ಂ','ಃ'=>'ಃ','ಅ'=>'ಅ','ಆ'=>'ಆ','ಇ'=>'ಇ','ಈ'=>'ಈ','ಉ'=>'ಉ','ಊ'=>'ಊ','ಋ'=>'ಋ','ಌ'=>'ಌ','ಎ'=>'ಎ','ಏ'=>'ಏ','ಐ'=>'ಐ','ಒ'=>'ಒ','ಓ'=>'ಓ','ಔ'=>'ಔ','ಕ'=>'ಕ','ಖ'=>'ಖ','ಗ'=>'ಗ','ಘ'=>'ಘ','ಙ'=>'ಙ','ಚ'=>'ಚ','ಛ'=>'ಛ','ಜ'=>'ಜ','ಝ'=>'ಝ','ಞ'=>'ಞ','ಟ'=>'ಟ','ಠ'=>'ಠ','ಡ'=>'ಡ','ಢ'=>'ಢ','ಣ'=>'ಣ','ತ'=>'ತ','ಥ'=>'ಥ','ದ'=>'ದ','ಧ'=>'ಧ','ನ'=>'ನ','ಪ'=>'ಪ','ಫ'=>'ಫ','ಬ'=>'ಬ','ಭ'=>'ಭ','ಮ'=>'ಮ','ಯ'=>'ಯ','ರ'=>'ರ','ಱ'=>'ಱ','ಲ'=>'ಲ','ಳ'=>'ಳ','ವ'=>'ವ','ಶ'=>'ಶ','ಷ'=>'ಷ','ಸ'=>'ಸ','ಹ'=>'ಹ','಼'=>'಼','ಽ'=>'ಽ','ಾ'=>'ಾ','ಿ'=>'ಿ','ೀ'=>'ೀ','ು'=>'ು','ೂ'=>'ೂ','ೃ'=>'ೃ','ೄ'=>'ೄ','ೆ'=>'ೆ','ೇ'=>'ೇ','ೈ'=>'ೈ','ೊ'=>'ೊ','ೋ'=>'ೋ','ೌ'=>'ೌ','್'=>'್','ೕ'=>'ೕ','ೖ'=>'ೖ','ೞ'=>'ೞ','ೠ'=>'ೠ','ೡ'=>'ೡ','ೢ'=>'ೢ','ೣ'=>'ೣ','೦'=>'0','೧'=>'1','೨'=>'2','೩'=>'3','೪'=>'4','೫'=>'5','೬'=>'6','೭'=>'7','೮'=>'8','೯'=>'9','ം'=>'ം','ഃ'=>'ഃ','അ'=>'അ','ആ'=>'ആ','ഇ'=>'ഇ','ഈ'=>'ഈ','ഉ'=>'ഉ','ഊ'=>'ഊ','ഋ'=>'ഋ','ഌ'=>'ഌ','എ'=>'എ','ഏ'=>'ഏ','ഐ'=>'ഐ','ഒ'=>'ഒ','ഓ'=>'ഓ','ഔ'=>'ഔ','ക'=>'ക','ഖ'=>'ഖ','ഗ'=>'ഗ','ഘ'=>'ഘ','ങ'=>'ങ','ച'=>'ച','ഛ'=>'ഛ','ജ'=>'ജ','ഝ'=>'ഝ','ഞ'=>'ഞ','ട'=>'ട','ഠ'=>'ഠ','ഡ'=>'ഡ','ഢ'=>'ഢ','ണ'=>'ണ','ത'=>'ത','ഥ'=>'ഥ','ദ'=>'ദ','ധ'=>'ധ','ന'=>'ന','പ'=>'പ','ഫ'=>'ഫ','ബ'=>'ബ','ഭ'=>'ഭ','മ'=>'മ','യ'=>'യ','ര'=>'ര','റ'=>'റ','ല'=>'ല','ള'=>'ള','ഴ'=>'ഴ','വ'=>'വ','ശ'=>'ശ','ഷ'=>'ഷ','സ'=>'സ','ഹ'=>'ഹ','ാ'=>'ാ','ി'=>'ി','ീ'=>'ീ','ു'=>'ു','ൂ'=>'ൂ','ൃ'=>'ൃ','െ'=>'െ','േ'=>'േ','ൈ'=>'ൈ','ൊ'=>'ൊ','ോ'=>'ോ','ൌ'=>'ൌ','്'=>'്','ൗ'=>'ൗ','ൠ'=>'ൠ','ൡ'=>'ൡ','൦'=>'0','൧'=>'1','൨'=>'2','൩'=>'3','൪'=>'4','൫'=>'5','൬'=>'6','൭'=>'7','൮'=>'8','൯'=>'9','ං'=>'ං','ඃ'=>'ඃ','අ'=>'අ','ආ'=>'ආ','ඇ'=>'ඇ','ඈ'=>'ඈ','ඉ'=>'ඉ','ඊ'=>'ඊ','උ'=>'උ','ඌ'=>'ඌ','ඍ'=>'ඍ','ඎ'=>'ඎ','ඏ'=>'ඏ','ඐ'=>'ඐ','එ'=>'එ','ඒ'=>'ඒ','ඓ'=>'ඓ','ඔ'=>'ඔ','ඕ'=>'ඕ','ඖ'=>'ඖ','ක'=>'ක','ඛ'=>'ඛ','ග'=>'ග','ඝ'=>'ඝ','ඞ'=>'ඞ','ඟ'=>'ඟ','ච'=>'ච','ඡ'=>'ඡ','ජ'=>'ජ','ඣ'=>'ඣ','ඤ'=>'ඤ','ඥ'=>'ඥ','ඦ'=>'ඦ','ට'=>'ට','ඨ'=>'ඨ','ඩ'=>'ඩ','ඪ'=>'ඪ','ණ'=>'ණ','ඬ'=>'ඬ','ත'=>'ත','ථ'=>'ථ','ද'=>'ද','ධ'=>'ධ','න'=>'න','ඳ'=>'ඳ','ප'=>'ප','ඵ'=>'ඵ','බ'=>'බ','භ'=>'භ','ම'=>'ම','ඹ'=>'ඹ','ය'=>'ය','ර'=>'ර','ල'=>'ල','ව'=>'ව','ශ'=>'ශ','ෂ'=>'ෂ','ස'=>'ස','හ'=>'හ','ළ'=>'ළ','ෆ'=>'ෆ','්'=>'්','ා'=>'ා','ැ'=>'ැ','ෑ'=>'ෑ','ි'=>'ි','ී'=>'ී','ු'=>'ු','ූ'=>'ූ','ෘ'=>'ෘ','ෙ'=>'ෙ','ේ'=>'ේ','ෛ'=>'ෛ','ො'=>'ො','ෝ'=>'ෝ','ෞ'=>'ෞ','ෟ'=>'ෟ','ෲ'=>'ෲ','ෳ'=>'ෳ','ก'=>'ก','ข'=>'ข','ฃ'=>'ฃ','ค'=>'ค','ฅ'=>'ฅ','ฆ'=>'ฆ','ง'=>'ง','จ'=>'จ','ฉ'=>'ฉ','ช'=>'ช','ซ'=>'ซ','ฌ'=>'ฌ','ญ'=>'ญ','ฎ'=>'ฎ','ฏ'=>'ฏ','ฐ'=>'ฐ','ฑ'=>'ฑ','ฒ'=>'ฒ','ณ'=>'ณ','ด'=>'ด','ต'=>'ต','ถ'=>'ถ','ท'=>'ท','ธ'=>'ธ','น'=>'น','บ'=>'บ','ป'=>'ป','ผ'=>'ผ','ฝ'=>'ฝ','พ'=>'พ','ฟ'=>'ฟ','ภ'=>'ภ','ม'=>'ม','ย'=>'ย','ร'=>'ร','ฤ'=>'ฤ','ล'=>'ล','ฦ'=>'ฦ','ว'=>'ว','ศ'=>'ศ','ษ'=>'ษ','ส'=>'ส','ห'=>'ห','ฬ'=>'ฬ','อ'=>'อ','ฮ'=>'ฮ','ฯ'=>'ฯ','ะ'=>'ะ','ั'=>'ั','า'=>'า','ำ'=>'ำ','ิ'=>'ิ','ี'=>'ี','ึ'=>'ึ','ื'=>'ื','ุ'=>'ุ','ู'=>'ู','ฺ'=>'ฺ','เ'=>'เ','แ'=>'แ','โ'=>'โ','ใ'=>'ใ','ไ'=>'ไ','ๅ'=>'ๅ','ๆ'=>'ๆ','็'=>'็','่'=>'่','้'=>'้','๊'=>'๊','๋'=>'๋','์'=>'์','ํ'=>'ํ','๎'=>'๎','๐'=>'0','๑'=>'1','๒'=>'2','๓'=>'3','๔'=>'4','๕'=>'5','๖'=>'6','๗'=>'7','๘'=>'8','๙'=>'9','ກ'=>'ກ','ຂ'=>'ຂ','ຄ'=>'ຄ','ງ'=>'ງ','ຈ'=>'ຈ','ຊ'=>'ຊ','ຍ'=>'ຍ','ດ'=>'ດ','ຕ'=>'ຕ','ຖ'=>'ຖ','ທ'=>'ທ','ນ'=>'ນ','ບ'=>'ບ','ປ'=>'ປ','ຜ'=>'ຜ','ຝ'=>'ຝ','ພ'=>'ພ','ຟ'=>'ຟ','ມ'=>'ມ','ຢ'=>'ຢ','ຣ'=>'ຣ','ລ'=>'ລ','ວ'=>'ວ','ສ'=>'ສ','ຫ'=>'ຫ','ອ'=>'ອ','ຮ'=>'ຮ','ຯ'=>'ຯ','ະ'=>'ະ','ັ'=>'ັ','າ'=>'າ','ຳ'=>'ຳ','ິ'=>'ິ','ີ'=>'ີ','ຶ'=>'ຶ','ື'=>'ື','ຸ'=>'ຸ','ູ'=>'ູ','ົ'=>'ົ','ຼ'=>'ຼ','ຽ'=>'ຽ','ເ'=>'ເ','ແ'=>'ແ','ໂ'=>'ໂ','ໃ'=>'ໃ','ໄ'=>'ໄ','ໆ'=>'ໆ','່'=>'່','້'=>'້','໊'=>'໊','໋'=>'໋','໌'=>'໌','ໍ'=>'ໍ','໐'=>'0','໑'=>'1','໒'=>'2','໓'=>'3','໔'=>'4','໕'=>'5','໖'=>'6','໗'=>'7','໘'=>'8','໙'=>'9','ໜ'=>'ໜ','ໝ'=>'ໝ','ༀ'=>'ༀ','༘'=>'༘','༙'=>'༙','༠'=>'0','༡'=>'1','༢'=>'2','༣'=>'3','༤'=>'4','༥'=>'5','༦'=>'6','༧'=>'7','༨'=>'8','༩'=>'9','༪'=>'1/2','༫'=>'3/2','༬'=>'5/2','༭'=>'7/2','༮'=>'9/2','༯'=>'11/2','༰'=>'13/2','༱'=>'15/2','༲'=>'17/2','༳'=>'-1/2','༵'=>'༵','༷'=>'༷','༹'=>'༹','༾'=>'༾','༿'=>'༿','ཀ'=>'ཀ','ཁ'=>'ཁ','ག'=>'ག','གྷ'=>'གྷ','ང'=>'ང','ཅ'=>'ཅ','ཆ'=>'ཆ','ཇ'=>'ཇ','ཉ'=>'ཉ','ཊ'=>'ཊ','ཋ'=>'ཋ','ཌ'=>'ཌ','ཌྷ'=>'ཌྷ','ཎ'=>'ཎ','ཏ'=>'ཏ','ཐ'=>'ཐ','ད'=>'ད','དྷ'=>'དྷ','ན'=>'ན','པ'=>'པ','ཕ'=>'ཕ','བ'=>'བ','བྷ'=>'བྷ','མ'=>'མ','ཙ'=>'ཙ','ཚ'=>'ཚ','ཛ'=>'ཛ','ཛྷ'=>'ཛྷ','ཝ'=>'ཝ','ཞ'=>'ཞ','ཟ'=>'ཟ','འ'=>'འ','ཡ'=>'ཡ','ར'=>'ར','ལ'=>'ལ','ཤ'=>'ཤ','ཥ'=>'ཥ','ས'=>'ས','ཧ'=>'ཧ','ཨ'=>'ཨ','ཀྵ'=>'ཀྵ','ཪ'=>'ཪ','ཱ'=>'ཱ','ི'=>'ི','ཱི'=>'ཱི','ུ'=>'ུ','ཱུ'=>'ཱུ','ྲྀ'=>'ྲྀ','ཷ'=>'ཷ','ླྀ'=>'ླྀ','ཹ'=>'ཹ','ེ'=>'ེ','ཻ'=>'ཻ','ོ'=>'ོ','ཽ'=>'ཽ','ཾ'=>'ཾ','ཿ'=>'ཿ','ྀ'=>'ྀ','ཱྀ'=>'ཱྀ','ྂ'=>'ྂ','ྃ'=>'ྃ','྄'=>'྄','྆'=>'྆','྇'=>'྇','ྈ'=>'ྈ','ྉ'=>'ྉ','ྊ'=>'ྊ','ྋ'=>'ྋ','ྐ'=>'ྐ','ྑ'=>'ྑ','ྒ'=>'ྒ','ྒྷ'=>'ྒྷ','ྔ'=>'ྔ','ྕ'=>'ྕ','ྖ'=>'ྖ','ྗ'=>'ྗ','ྙ'=>'ྙ','ྚ'=>'ྚ','ྛ'=>'ྛ','ྜ'=>'ྜ','ྜྷ'=>'ྜྷ','ྞ'=>'ྞ','ྟ'=>'ྟ','ྠ'=>'ྠ','ྡ'=>'ྡ','ྡྷ'=>'ྡྷ','ྣ'=>'ྣ','ྤ'=>'ྤ','ྥ'=>'ྥ','ྦ'=>'ྦ','ྦྷ'=>'ྦྷ','ྨ'=>'ྨ','ྩ'=>'ྩ','ྪ'=>'ྪ','ྫ'=>'ྫ','ྫྷ'=>'ྫྷ','ྭ'=>'ྭ','ྮ'=>'ྮ','ྯ'=>'ྯ','ྰ'=>'ྰ','ྱ'=>'ྱ','ྲ'=>'ྲ','ླ'=>'ླ','ྴ'=>'ྴ','ྵ'=>'ྵ','ྶ'=>'ྶ','ྷ'=>'ྷ','ྸ'=>'ྸ','ྐྵ'=>'ྐྵ','ྺ'=>'ྺ','ྻ'=>'ྻ','ྼ'=>'ྼ','࿆'=>'࿆');
diff --git a/phpBB/includes/utf/data/search_indexer_19.php b/phpBB/includes/utf/data/search_indexer_19.php
index e26f7d81a0..d10d09f061 100644
--- a/phpBB/includes/utf/data/search_indexer_19.php
+++ b/phpBB/includes/utf/data/search_indexer_19.php
@@ -1 +1 @@
-<?php return array('龻'=>'龻'); \ No newline at end of file
+<?php return array('龻'=>'龻');
diff --git a/phpBB/includes/utf/data/search_indexer_2.php b/phpBB/includes/utf/data/search_indexer_2.php
index 751226ed22..5b5f03448f 100644
--- a/phpBB/includes/utf/data/search_indexer_2.php
+++ b/phpBB/includes/utf/data/search_indexer_2.php
@@ -1 +1 @@
-<?php return array('က'=>'က','ခ'=>'ခ','ဂ'=>'ဂ','ဃ'=>'ဃ','င'=>'င','စ'=>'စ','ဆ'=>'ဆ','ဇ'=>'ဇ','ဈ'=>'ဈ','ဉ'=>'ဉ','ည'=>'ည','ဋ'=>'ဋ','ဌ'=>'ဌ','ဍ'=>'ဍ','ဎ'=>'ဎ','ဏ'=>'ဏ','တ'=>'တ','ထ'=>'ထ','ဒ'=>'ဒ','ဓ'=>'ဓ','န'=>'န','ပ'=>'ပ','ဖ'=>'ဖ','ဗ'=>'ဗ','ဘ'=>'ဘ','မ'=>'မ','ယ'=>'ယ','ရ'=>'ရ','လ'=>'လ','ဝ'=>'ဝ','သ'=>'သ','ဟ'=>'ဟ','ဠ'=>'ဠ','အ'=>'အ','ဣ'=>'ဣ','ဤ'=>'ဤ','ဥ'=>'ဥ','ဦ'=>'ဦ','ဧ'=>'ဧ','ဩ'=>'ဩ','ဪ'=>'ဪ','ာ'=>'ာ','ိ'=>'ိ','ီ'=>'ီ','ု'=>'ု','ူ'=>'ူ','ေ'=>'ေ','ဲ'=>'ဲ','ံ'=>'ံ','့'=>'့','း'=>'း','္'=>'္','၀'=>'0','၁'=>'1','၂'=>'2','၃'=>'3','၄'=>'4','၅'=>'5','၆'=>'6','၇'=>'7','၈'=>'8','၉'=>'9','ၐ'=>'ၐ','ၑ'=>'ၑ','ၒ'=>'ၒ','ၓ'=>'ၓ','ၔ'=>'ၔ','ၕ'=>'ၕ','ၖ'=>'ၖ','ၗ'=>'ၗ','ၘ'=>'ၘ','ၙ'=>'ၙ','Ⴀ'=>'ⴀ','Ⴁ'=>'ⴁ','Ⴂ'=>'ⴂ','Ⴃ'=>'ⴃ','Ⴄ'=>'ⴄ','Ⴅ'=>'ⴅ','Ⴆ'=>'ⴆ','Ⴇ'=>'ⴇ','Ⴈ'=>'ⴈ','Ⴉ'=>'ⴉ','Ⴊ'=>'ⴊ','Ⴋ'=>'ⴋ','Ⴌ'=>'ⴌ','Ⴍ'=>'ⴍ','Ⴎ'=>'ⴎ','Ⴏ'=>'ⴏ','Ⴐ'=>'ⴐ','Ⴑ'=>'ⴑ','Ⴒ'=>'ⴒ','Ⴓ'=>'ⴓ','Ⴔ'=>'ⴔ','Ⴕ'=>'ⴕ','Ⴖ'=>'ⴖ','Ⴗ'=>'ⴗ','Ⴘ'=>'ⴘ','Ⴙ'=>'ⴙ','Ⴚ'=>'ⴚ','Ⴛ'=>'ⴛ','Ⴜ'=>'ⴜ','Ⴝ'=>'ⴝ','Ⴞ'=>'ⴞ','Ⴟ'=>'ⴟ','Ⴠ'=>'ⴠ','Ⴡ'=>'ⴡ','Ⴢ'=>'ⴢ','Ⴣ'=>'ⴣ','Ⴤ'=>'ⴤ','Ⴥ'=>'ⴥ','ა'=>'ა','ბ'=>'ბ','გ'=>'გ','დ'=>'დ','ე'=>'ე','ვ'=>'ვ','ზ'=>'ზ','თ'=>'თ','ი'=>'ი','კ'=>'კ','ლ'=>'ლ','მ'=>'მ','ნ'=>'ნ','ო'=>'ო','პ'=>'პ','ჟ'=>'ჟ','რ'=>'რ','ს'=>'ს','ტ'=>'ტ','უ'=>'უ','ფ'=>'ფ','ქ'=>'ქ','ღ'=>'ღ','ყ'=>'ყ','შ'=>'შ','ჩ'=>'ჩ','ც'=>'ც','ძ'=>'ძ','წ'=>'წ','ჭ'=>'ჭ','ხ'=>'ხ','ჯ'=>'ჯ','ჰ'=>'ჰ','ჱ'=>'ჱ','ჲ'=>'ჲ','ჳ'=>'ჳ','ჴ'=>'ჴ','ჵ'=>'ჵ','ჶ'=>'ჶ','ჷ'=>'ჷ','ჸ'=>'ჸ','ჹ'=>'ჹ','ჺ'=>'ჺ','ჼ'=>'ჼ','ᄀ'=>'ᄀ','ᄁ'=>'ᄁ','ᄂ'=>'ᄂ','ᄃ'=>'ᄃ','ᄄ'=>'ᄄ','ᄅ'=>'ᄅ','ᄆ'=>'ᄆ','ᄇ'=>'ᄇ','ᄈ'=>'ᄈ','ᄉ'=>'ᄉ','ᄊ'=>'ᄊ','ᄋ'=>'ᄋ','ᄌ'=>'ᄌ','ᄍ'=>'ᄍ','ᄎ'=>'ᄎ','ᄏ'=>'ᄏ','ᄐ'=>'ᄐ','ᄑ'=>'ᄑ','ᄒ'=>'ᄒ','ᄓ'=>'ᄓ','ᄔ'=>'ᄔ','ᄕ'=>'ᄕ','ᄖ'=>'ᄖ','ᄗ'=>'ᄗ','ᄘ'=>'ᄘ','ᄙ'=>'ᄙ','ᄚ'=>'ᄚ','ᄛ'=>'ᄛ','ᄜ'=>'ᄜ','ᄝ'=>'ᄝ','ᄞ'=>'ᄞ','ᄟ'=>'ᄟ','ᄠ'=>'ᄠ','ᄡ'=>'ᄡ','ᄢ'=>'ᄢ','ᄣ'=>'ᄣ','ᄤ'=>'ᄤ','ᄥ'=>'ᄥ','ᄦ'=>'ᄦ','ᄧ'=>'ᄧ','ᄨ'=>'ᄨ','ᄩ'=>'ᄩ','ᄪ'=>'ᄪ','ᄫ'=>'ᄫ','ᄬ'=>'ᄬ','ᄭ'=>'ᄭ','ᄮ'=>'ᄮ','ᄯ'=>'ᄯ','ᄰ'=>'ᄰ','ᄱ'=>'ᄱ','ᄲ'=>'ᄲ','ᄳ'=>'ᄳ','ᄴ'=>'ᄴ','ᄵ'=>'ᄵ','ᄶ'=>'ᄶ','ᄷ'=>'ᄷ','ᄸ'=>'ᄸ','ᄹ'=>'ᄹ','ᄺ'=>'ᄺ','ᄻ'=>'ᄻ','ᄼ'=>'ᄼ','ᄽ'=>'ᄽ','ᄾ'=>'ᄾ','ᄿ'=>'ᄿ','ᅀ'=>'ᅀ','ᅁ'=>'ᅁ','ᅂ'=>'ᅂ','ᅃ'=>'ᅃ','ᅄ'=>'ᅄ','ᅅ'=>'ᅅ','ᅆ'=>'ᅆ','ᅇ'=>'ᅇ','ᅈ'=>'ᅈ','ᅉ'=>'ᅉ','ᅊ'=>'ᅊ','ᅋ'=>'ᅋ','ᅌ'=>'ᅌ','ᅍ'=>'ᅍ','ᅎ'=>'ᅎ','ᅏ'=>'ᅏ','ᅐ'=>'ᅐ','ᅑ'=>'ᅑ','ᅒ'=>'ᅒ','ᅓ'=>'ᅓ','ᅔ'=>'ᅔ','ᅕ'=>'ᅕ','ᅖ'=>'ᅖ','ᅗ'=>'ᅗ','ᅘ'=>'ᅘ','ᅙ'=>'ᅙ','ᅟ'=>'ᅟ','ᅠ'=>'ᅠ','ᅡ'=>'ᅡ','ᅢ'=>'ᅢ','ᅣ'=>'ᅣ','ᅤ'=>'ᅤ','ᅥ'=>'ᅥ','ᅦ'=>'ᅦ','ᅧ'=>'ᅧ','ᅨ'=>'ᅨ','ᅩ'=>'ᅩ','ᅪ'=>'ᅪ','ᅫ'=>'ᅫ','ᅬ'=>'ᅬ','ᅭ'=>'ᅭ','ᅮ'=>'ᅮ','ᅯ'=>'ᅯ','ᅰ'=>'ᅰ','ᅱ'=>'ᅱ','ᅲ'=>'ᅲ','ᅳ'=>'ᅳ','ᅴ'=>'ᅴ','ᅵ'=>'ᅵ','ᅶ'=>'ᅶ','ᅷ'=>'ᅷ','ᅸ'=>'ᅸ','ᅹ'=>'ᅹ','ᅺ'=>'ᅺ','ᅻ'=>'ᅻ','ᅼ'=>'ᅼ','ᅽ'=>'ᅽ','ᅾ'=>'ᅾ','ᅿ'=>'ᅿ','ᆀ'=>'ᆀ','ᆁ'=>'ᆁ','ᆂ'=>'ᆂ','ᆃ'=>'ᆃ','ᆄ'=>'ᆄ','ᆅ'=>'ᆅ','ᆆ'=>'ᆆ','ᆇ'=>'ᆇ','ᆈ'=>'ᆈ','ᆉ'=>'ᆉ','ᆊ'=>'ᆊ','ᆋ'=>'ᆋ','ᆌ'=>'ᆌ','ᆍ'=>'ᆍ','ᆎ'=>'ᆎ','ᆏ'=>'ᆏ','ᆐ'=>'ᆐ','ᆑ'=>'ᆑ','ᆒ'=>'ᆒ','ᆓ'=>'ᆓ','ᆔ'=>'ᆔ','ᆕ'=>'ᆕ','ᆖ'=>'ᆖ','ᆗ'=>'ᆗ','ᆘ'=>'ᆘ','ᆙ'=>'ᆙ','ᆚ'=>'ᆚ','ᆛ'=>'ᆛ','ᆜ'=>'ᆜ','ᆝ'=>'ᆝ','ᆞ'=>'ᆞ','ᆟ'=>'ᆟ','ᆠ'=>'ᆠ','ᆡ'=>'ᆡ','ᆢ'=>'ᆢ','ᆨ'=>'ᆨ','ᆩ'=>'ᆩ','ᆪ'=>'ᆪ','ᆫ'=>'ᆫ','ᆬ'=>'ᆬ','ᆭ'=>'ᆭ','ᆮ'=>'ᆮ','ᆯ'=>'ᆯ','ᆰ'=>'ᆰ','ᆱ'=>'ᆱ','ᆲ'=>'ᆲ','ᆳ'=>'ᆳ','ᆴ'=>'ᆴ','ᆵ'=>'ᆵ','ᆶ'=>'ᆶ','ᆷ'=>'ᆷ','ᆸ'=>'ᆸ','ᆹ'=>'ᆹ','ᆺ'=>'ᆺ','ᆻ'=>'ᆻ','ᆼ'=>'ᆼ','ᆽ'=>'ᆽ','ᆾ'=>'ᆾ','ᆿ'=>'ᆿ','ᇀ'=>'ᇀ','ᇁ'=>'ᇁ','ᇂ'=>'ᇂ','ᇃ'=>'ᇃ','ᇄ'=>'ᇄ','ᇅ'=>'ᇅ','ᇆ'=>'ᇆ','ᇇ'=>'ᇇ','ᇈ'=>'ᇈ','ᇉ'=>'ᇉ','ᇊ'=>'ᇊ','ᇋ'=>'ᇋ','ᇌ'=>'ᇌ','ᇍ'=>'ᇍ','ᇎ'=>'ᇎ','ᇏ'=>'ᇏ','ᇐ'=>'ᇐ','ᇑ'=>'ᇑ','ᇒ'=>'ᇒ','ᇓ'=>'ᇓ','ᇔ'=>'ᇔ','ᇕ'=>'ᇕ','ᇖ'=>'ᇖ','ᇗ'=>'ᇗ','ᇘ'=>'ᇘ','ᇙ'=>'ᇙ','ᇚ'=>'ᇚ','ᇛ'=>'ᇛ','ᇜ'=>'ᇜ','ᇝ'=>'ᇝ','ᇞ'=>'ᇞ','ᇟ'=>'ᇟ','ᇠ'=>'ᇠ','ᇡ'=>'ᇡ','ᇢ'=>'ᇢ','ᇣ'=>'ᇣ','ᇤ'=>'ᇤ','ᇥ'=>'ᇥ','ᇦ'=>'ᇦ','ᇧ'=>'ᇧ','ᇨ'=>'ᇨ','ᇩ'=>'ᇩ','ᇪ'=>'ᇪ','ᇫ'=>'ᇫ','ᇬ'=>'ᇬ','ᇭ'=>'ᇭ','ᇮ'=>'ᇮ','ᇯ'=>'ᇯ','ᇰ'=>'ᇰ','ᇱ'=>'ᇱ','ᇲ'=>'ᇲ','ᇳ'=>'ᇳ','ᇴ'=>'ᇴ','ᇵ'=>'ᇵ','ᇶ'=>'ᇶ','ᇷ'=>'ᇷ','ᇸ'=>'ᇸ','ᇹ'=>'ᇹ','ሀ'=>'ሀ','ሁ'=>'ሁ','ሂ'=>'ሂ','ሃ'=>'ሃ','ሄ'=>'ሄ','ህ'=>'ህ','ሆ'=>'ሆ','ሇ'=>'ሇ','ለ'=>'ለ','ሉ'=>'ሉ','ሊ'=>'ሊ','ላ'=>'ላ','ሌ'=>'ሌ','ል'=>'ል','ሎ'=>'ሎ','ሏ'=>'ሏ','ሐ'=>'ሐ','ሑ'=>'ሑ','ሒ'=>'ሒ','ሓ'=>'ሓ','ሔ'=>'ሔ','ሕ'=>'ሕ','ሖ'=>'ሖ','ሗ'=>'ሗ','መ'=>'መ','ሙ'=>'ሙ','ሚ'=>'ሚ','ማ'=>'ማ','ሜ'=>'ሜ','ም'=>'ም','ሞ'=>'ሞ','ሟ'=>'ሟ','ሠ'=>'ሠ','ሡ'=>'ሡ','ሢ'=>'ሢ','ሣ'=>'ሣ','ሤ'=>'ሤ','ሥ'=>'ሥ','ሦ'=>'ሦ','ሧ'=>'ሧ','ረ'=>'ረ','ሩ'=>'ሩ','ሪ'=>'ሪ','ራ'=>'ራ','ሬ'=>'ሬ','ር'=>'ር','ሮ'=>'ሮ','ሯ'=>'ሯ','ሰ'=>'ሰ','ሱ'=>'ሱ','ሲ'=>'ሲ','ሳ'=>'ሳ','ሴ'=>'ሴ','ስ'=>'ስ','ሶ'=>'ሶ','ሷ'=>'ሷ','ሸ'=>'ሸ','ሹ'=>'ሹ','ሺ'=>'ሺ','ሻ'=>'ሻ','ሼ'=>'ሼ','ሽ'=>'ሽ','ሾ'=>'ሾ','ሿ'=>'ሿ','ቀ'=>'ቀ','ቁ'=>'ቁ','ቂ'=>'ቂ','ቃ'=>'ቃ','ቄ'=>'ቄ','ቅ'=>'ቅ','ቆ'=>'ቆ','ቇ'=>'ቇ','ቈ'=>'ቈ','ቊ'=>'ቊ','ቋ'=>'ቋ','ቌ'=>'ቌ','ቍ'=>'ቍ','ቐ'=>'ቐ','ቑ'=>'ቑ','ቒ'=>'ቒ','ቓ'=>'ቓ','ቔ'=>'ቔ','ቕ'=>'ቕ','ቖ'=>'ቖ','ቘ'=>'ቘ','ቚ'=>'ቚ','ቛ'=>'ቛ','ቜ'=>'ቜ','ቝ'=>'ቝ','በ'=>'በ','ቡ'=>'ቡ','ቢ'=>'ቢ','ባ'=>'ባ','ቤ'=>'ቤ','ብ'=>'ብ','ቦ'=>'ቦ','ቧ'=>'ቧ','ቨ'=>'ቨ','ቩ'=>'ቩ','ቪ'=>'ቪ','ቫ'=>'ቫ','ቬ'=>'ቬ','ቭ'=>'ቭ','ቮ'=>'ቮ','ቯ'=>'ቯ','ተ'=>'ተ','ቱ'=>'ቱ','ቲ'=>'ቲ','ታ'=>'ታ','ቴ'=>'ቴ','ት'=>'ት','ቶ'=>'ቶ','ቷ'=>'ቷ','ቸ'=>'ቸ','ቹ'=>'ቹ','ቺ'=>'ቺ','ቻ'=>'ቻ','ቼ'=>'ቼ','ች'=>'ች','ቾ'=>'ቾ','ቿ'=>'ቿ','ኀ'=>'ኀ','ኁ'=>'ኁ','ኂ'=>'ኂ','ኃ'=>'ኃ','ኄ'=>'ኄ','ኅ'=>'ኅ','ኆ'=>'ኆ','ኇ'=>'ኇ','ኈ'=>'ኈ','ኊ'=>'ኊ','ኋ'=>'ኋ','ኌ'=>'ኌ','ኍ'=>'ኍ','ነ'=>'ነ','ኑ'=>'ኑ','ኒ'=>'ኒ','ና'=>'ና','ኔ'=>'ኔ','ን'=>'ን','ኖ'=>'ኖ','ኗ'=>'ኗ','ኘ'=>'ኘ','ኙ'=>'ኙ','ኚ'=>'ኚ','ኛ'=>'ኛ','ኜ'=>'ኜ','ኝ'=>'ኝ','ኞ'=>'ኞ','ኟ'=>'ኟ','አ'=>'አ','ኡ'=>'ኡ','ኢ'=>'ኢ','ኣ'=>'ኣ','ኤ'=>'ኤ','እ'=>'እ','ኦ'=>'ኦ','ኧ'=>'ኧ','ከ'=>'ከ','ኩ'=>'ኩ','ኪ'=>'ኪ','ካ'=>'ካ','ኬ'=>'ኬ','ክ'=>'ክ','ኮ'=>'ኮ','ኯ'=>'ኯ','ኰ'=>'ኰ','ኲ'=>'ኲ','ኳ'=>'ኳ','ኴ'=>'ኴ','ኵ'=>'ኵ','ኸ'=>'ኸ','ኹ'=>'ኹ','ኺ'=>'ኺ','ኻ'=>'ኻ','ኼ'=>'ኼ','ኽ'=>'ኽ','ኾ'=>'ኾ','ዀ'=>'ዀ','ዂ'=>'ዂ','ዃ'=>'ዃ','ዄ'=>'ዄ','ዅ'=>'ዅ','ወ'=>'ወ','ዉ'=>'ዉ','ዊ'=>'ዊ','ዋ'=>'ዋ','ዌ'=>'ዌ','ው'=>'ው','ዎ'=>'ዎ','ዏ'=>'ዏ','ዐ'=>'ዐ','ዑ'=>'ዑ','ዒ'=>'ዒ','ዓ'=>'ዓ','ዔ'=>'ዔ','ዕ'=>'ዕ','ዖ'=>'ዖ','ዘ'=>'ዘ','ዙ'=>'ዙ','ዚ'=>'ዚ','ዛ'=>'ዛ','ዜ'=>'ዜ','ዝ'=>'ዝ','ዞ'=>'ዞ','ዟ'=>'ዟ','ዠ'=>'ዠ','ዡ'=>'ዡ','ዢ'=>'ዢ','ዣ'=>'ዣ','ዤ'=>'ዤ','ዥ'=>'ዥ','ዦ'=>'ዦ','ዧ'=>'ዧ','የ'=>'የ','ዩ'=>'ዩ','ዪ'=>'ዪ','ያ'=>'ያ','ዬ'=>'ዬ','ይ'=>'ይ','ዮ'=>'ዮ','ዯ'=>'ዯ','ደ'=>'ደ','ዱ'=>'ዱ','ዲ'=>'ዲ','ዳ'=>'ዳ','ዴ'=>'ዴ','ድ'=>'ድ','ዶ'=>'ዶ','ዷ'=>'ዷ','ዸ'=>'ዸ','ዹ'=>'ዹ','ዺ'=>'ዺ','ዻ'=>'ዻ','ዼ'=>'ዼ','ዽ'=>'ዽ','ዾ'=>'ዾ','ዿ'=>'ዿ','ጀ'=>'ጀ','ጁ'=>'ጁ','ጂ'=>'ጂ','ጃ'=>'ጃ','ጄ'=>'ጄ','ጅ'=>'ጅ','ጆ'=>'ጆ','ጇ'=>'ጇ','ገ'=>'ገ','ጉ'=>'ጉ','ጊ'=>'ጊ','ጋ'=>'ጋ','ጌ'=>'ጌ','ግ'=>'ግ','ጎ'=>'ጎ','ጏ'=>'ጏ','ጐ'=>'ጐ','ጒ'=>'ጒ','ጓ'=>'ጓ','ጔ'=>'ጔ','ጕ'=>'ጕ','ጘ'=>'ጘ','ጙ'=>'ጙ','ጚ'=>'ጚ','ጛ'=>'ጛ','ጜ'=>'ጜ','ጝ'=>'ጝ','ጞ'=>'ጞ','ጟ'=>'ጟ','ጠ'=>'ጠ','ጡ'=>'ጡ','ጢ'=>'ጢ','ጣ'=>'ጣ','ጤ'=>'ጤ','ጥ'=>'ጥ','ጦ'=>'ጦ','ጧ'=>'ጧ','ጨ'=>'ጨ','ጩ'=>'ጩ','ጪ'=>'ጪ','ጫ'=>'ጫ','ጬ'=>'ጬ','ጭ'=>'ጭ','ጮ'=>'ጮ','ጯ'=>'ጯ','ጰ'=>'ጰ','ጱ'=>'ጱ','ጲ'=>'ጲ','ጳ'=>'ጳ','ጴ'=>'ጴ','ጵ'=>'ጵ','ጶ'=>'ጶ','ጷ'=>'ጷ','ጸ'=>'ጸ','ጹ'=>'ጹ','ጺ'=>'ጺ','ጻ'=>'ጻ','ጼ'=>'ጼ','ጽ'=>'ጽ','ጾ'=>'ጾ','ጿ'=>'ጿ','ፀ'=>'ፀ','ፁ'=>'ፁ','ፂ'=>'ፂ','ፃ'=>'ፃ','ፄ'=>'ፄ','ፅ'=>'ፅ','ፆ'=>'ፆ','ፇ'=>'ፇ','ፈ'=>'ፈ','ፉ'=>'ፉ','ፊ'=>'ፊ','ፋ'=>'ፋ','ፌ'=>'ፌ','ፍ'=>'ፍ','ፎ'=>'ፎ','ፏ'=>'ፏ','ፐ'=>'ፐ','ፑ'=>'ፑ','ፒ'=>'ፒ','ፓ'=>'ፓ','ፔ'=>'ፔ','ፕ'=>'ፕ','ፖ'=>'ፖ','ፗ'=>'ፗ','ፘ'=>'ፘ','ፙ'=>'ፙ','ፚ'=>'ፚ','፟'=>'፟','፩'=>'1','፪'=>'2','፫'=>'3','፬'=>'4','፭'=>'5','፮'=>'6','፯'=>'7','፰'=>'8','፱'=>'9','፲'=>'10','፳'=>'20','፴'=>'30','፵'=>'40','፶'=>'50','፷'=>'60','፸'=>'70','፹'=>'80','፺'=>'90','፻'=>'100','፼'=>'10000','ᎀ'=>'ᎀ','ᎁ'=>'ᎁ','ᎂ'=>'ᎂ','ᎃ'=>'ᎃ','ᎄ'=>'ᎄ','ᎅ'=>'ᎅ','ᎆ'=>'ᎆ','ᎇ'=>'ᎇ','ᎈ'=>'ᎈ','ᎉ'=>'ᎉ','ᎊ'=>'ᎊ','ᎋ'=>'ᎋ','ᎌ'=>'ᎌ','ᎍ'=>'ᎍ','ᎎ'=>'ᎎ','ᎏ'=>'ᎏ','Ꭰ'=>'Ꭰ','Ꭱ'=>'Ꭱ','Ꭲ'=>'Ꭲ','Ꭳ'=>'Ꭳ','Ꭴ'=>'Ꭴ','Ꭵ'=>'Ꭵ','Ꭶ'=>'Ꭶ','Ꭷ'=>'Ꭷ','Ꭸ'=>'Ꭸ','Ꭹ'=>'Ꭹ','Ꭺ'=>'Ꭺ','Ꭻ'=>'Ꭻ','Ꭼ'=>'Ꭼ','Ꭽ'=>'Ꭽ','Ꭾ'=>'Ꭾ','Ꭿ'=>'Ꭿ','Ꮀ'=>'Ꮀ','Ꮁ'=>'Ꮁ','Ꮂ'=>'Ꮂ','Ꮃ'=>'Ꮃ','Ꮄ'=>'Ꮄ','Ꮅ'=>'Ꮅ','Ꮆ'=>'Ꮆ','Ꮇ'=>'Ꮇ','Ꮈ'=>'Ꮈ','Ꮉ'=>'Ꮉ','Ꮊ'=>'Ꮊ','Ꮋ'=>'Ꮋ','Ꮌ'=>'Ꮌ','Ꮍ'=>'Ꮍ','Ꮎ'=>'Ꮎ','Ꮏ'=>'Ꮏ','Ꮐ'=>'Ꮐ','Ꮑ'=>'Ꮑ','Ꮒ'=>'Ꮒ','Ꮓ'=>'Ꮓ','Ꮔ'=>'Ꮔ','Ꮕ'=>'Ꮕ','Ꮖ'=>'Ꮖ','Ꮗ'=>'Ꮗ','Ꮘ'=>'Ꮘ','Ꮙ'=>'Ꮙ','Ꮚ'=>'Ꮚ','Ꮛ'=>'Ꮛ','Ꮜ'=>'Ꮜ','Ꮝ'=>'Ꮝ','Ꮞ'=>'Ꮞ','Ꮟ'=>'Ꮟ','Ꮠ'=>'Ꮠ','Ꮡ'=>'Ꮡ','Ꮢ'=>'Ꮢ','Ꮣ'=>'Ꮣ','Ꮤ'=>'Ꮤ','Ꮥ'=>'Ꮥ','Ꮦ'=>'Ꮦ','Ꮧ'=>'Ꮧ','Ꮨ'=>'Ꮨ','Ꮩ'=>'Ꮩ','Ꮪ'=>'Ꮪ','Ꮫ'=>'Ꮫ','Ꮬ'=>'Ꮬ','Ꮭ'=>'Ꮭ','Ꮮ'=>'Ꮮ','Ꮯ'=>'Ꮯ','Ꮰ'=>'Ꮰ','Ꮱ'=>'Ꮱ','Ꮲ'=>'Ꮲ','Ꮳ'=>'Ꮳ','Ꮴ'=>'Ꮴ','Ꮵ'=>'Ꮵ','Ꮶ'=>'Ꮶ','Ꮷ'=>'Ꮷ','Ꮸ'=>'Ꮸ','Ꮹ'=>'Ꮹ','Ꮺ'=>'Ꮺ','Ꮻ'=>'Ꮻ','Ꮼ'=>'Ꮼ','Ꮽ'=>'Ꮽ','Ꮾ'=>'Ꮾ','Ꮿ'=>'Ꮿ','Ᏸ'=>'Ᏸ','Ᏹ'=>'Ᏹ','Ᏺ'=>'Ᏺ','Ᏻ'=>'Ᏻ','Ᏼ'=>'Ᏼ','ᐁ'=>'ᐁ','ᐂ'=>'ᐂ','ᐃ'=>'ᐃ','ᐄ'=>'ᐄ','ᐅ'=>'ᐅ','ᐆ'=>'ᐆ','ᐇ'=>'ᐇ','ᐈ'=>'ᐈ','ᐉ'=>'ᐉ','ᐊ'=>'ᐊ','ᐋ'=>'ᐋ','ᐌ'=>'ᐌ','ᐍ'=>'ᐍ','ᐎ'=>'ᐎ','ᐏ'=>'ᐏ','ᐐ'=>'ᐐ','ᐑ'=>'ᐑ','ᐒ'=>'ᐒ','ᐓ'=>'ᐓ','ᐔ'=>'ᐔ','ᐕ'=>'ᐕ','ᐖ'=>'ᐖ','ᐗ'=>'ᐗ','ᐘ'=>'ᐘ','ᐙ'=>'ᐙ','ᐚ'=>'ᐚ','ᐛ'=>'ᐛ','ᐜ'=>'ᐜ','ᐝ'=>'ᐝ','ᐞ'=>'ᐞ','ᐟ'=>'ᐟ','ᐠ'=>'ᐠ','ᐡ'=>'ᐡ','ᐢ'=>'ᐢ','ᐣ'=>'ᐣ','ᐤ'=>'ᐤ','ᐥ'=>'ᐥ','ᐦ'=>'ᐦ','ᐧ'=>'ᐧ','ᐨ'=>'ᐨ','ᐩ'=>'ᐩ','ᐪ'=>'ᐪ','ᐫ'=>'ᐫ','ᐬ'=>'ᐬ','ᐭ'=>'ᐭ','ᐮ'=>'ᐮ','ᐯ'=>'ᐯ','ᐰ'=>'ᐰ','ᐱ'=>'ᐱ','ᐲ'=>'ᐲ','ᐳ'=>'ᐳ','ᐴ'=>'ᐴ','ᐵ'=>'ᐵ','ᐶ'=>'ᐶ','ᐷ'=>'ᐷ','ᐸ'=>'ᐸ','ᐹ'=>'ᐹ','ᐺ'=>'ᐺ','ᐻ'=>'ᐻ','ᐼ'=>'ᐼ','ᐽ'=>'ᐽ','ᐾ'=>'ᐾ','ᐿ'=>'ᐿ','ᑀ'=>'ᑀ','ᑁ'=>'ᑁ','ᑂ'=>'ᑂ','ᑃ'=>'ᑃ','ᑄ'=>'ᑄ','ᑅ'=>'ᑅ','ᑆ'=>'ᑆ','ᑇ'=>'ᑇ','ᑈ'=>'ᑈ','ᑉ'=>'ᑉ','ᑊ'=>'ᑊ','ᑋ'=>'ᑋ','ᑌ'=>'ᑌ','ᑍ'=>'ᑍ','ᑎ'=>'ᑎ','ᑏ'=>'ᑏ','ᑐ'=>'ᑐ','ᑑ'=>'ᑑ','ᑒ'=>'ᑒ','ᑓ'=>'ᑓ','ᑔ'=>'ᑔ','ᑕ'=>'ᑕ','ᑖ'=>'ᑖ','ᑗ'=>'ᑗ','ᑘ'=>'ᑘ','ᑙ'=>'ᑙ','ᑚ'=>'ᑚ','ᑛ'=>'ᑛ','ᑜ'=>'ᑜ','ᑝ'=>'ᑝ','ᑞ'=>'ᑞ','ᑟ'=>'ᑟ','ᑠ'=>'ᑠ','ᑡ'=>'ᑡ','ᑢ'=>'ᑢ','ᑣ'=>'ᑣ','ᑤ'=>'ᑤ','ᑥ'=>'ᑥ','ᑦ'=>'ᑦ','ᑧ'=>'ᑧ','ᑨ'=>'ᑨ','ᑩ'=>'ᑩ','ᑪ'=>'ᑪ','ᑫ'=>'ᑫ','ᑬ'=>'ᑬ','ᑭ'=>'ᑭ','ᑮ'=>'ᑮ','ᑯ'=>'ᑯ','ᑰ'=>'ᑰ','ᑱ'=>'ᑱ','ᑲ'=>'ᑲ','ᑳ'=>'ᑳ','ᑴ'=>'ᑴ','ᑵ'=>'ᑵ','ᑶ'=>'ᑶ','ᑷ'=>'ᑷ','ᑸ'=>'ᑸ','ᑹ'=>'ᑹ','ᑺ'=>'ᑺ','ᑻ'=>'ᑻ','ᑼ'=>'ᑼ','ᑽ'=>'ᑽ','ᑾ'=>'ᑾ','ᑿ'=>'ᑿ','ᒀ'=>'ᒀ','ᒁ'=>'ᒁ','ᒂ'=>'ᒂ','ᒃ'=>'ᒃ','ᒄ'=>'ᒄ','ᒅ'=>'ᒅ','ᒆ'=>'ᒆ','ᒇ'=>'ᒇ','ᒈ'=>'ᒈ','ᒉ'=>'ᒉ','ᒊ'=>'ᒊ','ᒋ'=>'ᒋ','ᒌ'=>'ᒌ','ᒍ'=>'ᒍ','ᒎ'=>'ᒎ','ᒏ'=>'ᒏ','ᒐ'=>'ᒐ','ᒑ'=>'ᒑ','ᒒ'=>'ᒒ','ᒓ'=>'ᒓ','ᒔ'=>'ᒔ','ᒕ'=>'ᒕ','ᒖ'=>'ᒖ','ᒗ'=>'ᒗ','ᒘ'=>'ᒘ','ᒙ'=>'ᒙ','ᒚ'=>'ᒚ','ᒛ'=>'ᒛ','ᒜ'=>'ᒜ','ᒝ'=>'ᒝ','ᒞ'=>'ᒞ','ᒟ'=>'ᒟ','ᒠ'=>'ᒠ','ᒡ'=>'ᒡ','ᒢ'=>'ᒢ','ᒣ'=>'ᒣ','ᒤ'=>'ᒤ','ᒥ'=>'ᒥ','ᒦ'=>'ᒦ','ᒧ'=>'ᒧ','ᒨ'=>'ᒨ','ᒩ'=>'ᒩ','ᒪ'=>'ᒪ','ᒫ'=>'ᒫ','ᒬ'=>'ᒬ','ᒭ'=>'ᒭ','ᒮ'=>'ᒮ','ᒯ'=>'ᒯ','ᒰ'=>'ᒰ','ᒱ'=>'ᒱ','ᒲ'=>'ᒲ','ᒳ'=>'ᒳ','ᒴ'=>'ᒴ','ᒵ'=>'ᒵ','ᒶ'=>'ᒶ','ᒷ'=>'ᒷ','ᒸ'=>'ᒸ','ᒹ'=>'ᒹ','ᒺ'=>'ᒺ','ᒻ'=>'ᒻ','ᒼ'=>'ᒼ','ᒽ'=>'ᒽ','ᒾ'=>'ᒾ','ᒿ'=>'ᒿ','ᓀ'=>'ᓀ','ᓁ'=>'ᓁ','ᓂ'=>'ᓂ','ᓃ'=>'ᓃ','ᓄ'=>'ᓄ','ᓅ'=>'ᓅ','ᓆ'=>'ᓆ','ᓇ'=>'ᓇ','ᓈ'=>'ᓈ','ᓉ'=>'ᓉ','ᓊ'=>'ᓊ','ᓋ'=>'ᓋ','ᓌ'=>'ᓌ','ᓍ'=>'ᓍ','ᓎ'=>'ᓎ','ᓏ'=>'ᓏ','ᓐ'=>'ᓐ','ᓑ'=>'ᓑ','ᓒ'=>'ᓒ','ᓓ'=>'ᓓ','ᓔ'=>'ᓔ','ᓕ'=>'ᓕ','ᓖ'=>'ᓖ','ᓗ'=>'ᓗ','ᓘ'=>'ᓘ','ᓙ'=>'ᓙ','ᓚ'=>'ᓚ','ᓛ'=>'ᓛ','ᓜ'=>'ᓜ','ᓝ'=>'ᓝ','ᓞ'=>'ᓞ','ᓟ'=>'ᓟ','ᓠ'=>'ᓠ','ᓡ'=>'ᓡ','ᓢ'=>'ᓢ','ᓣ'=>'ᓣ','ᓤ'=>'ᓤ','ᓥ'=>'ᓥ','ᓦ'=>'ᓦ','ᓧ'=>'ᓧ','ᓨ'=>'ᓨ','ᓩ'=>'ᓩ','ᓪ'=>'ᓪ','ᓫ'=>'ᓫ','ᓬ'=>'ᓬ','ᓭ'=>'ᓭ','ᓮ'=>'ᓮ','ᓯ'=>'ᓯ','ᓰ'=>'ᓰ','ᓱ'=>'ᓱ','ᓲ'=>'ᓲ','ᓳ'=>'ᓳ','ᓴ'=>'ᓴ','ᓵ'=>'ᓵ','ᓶ'=>'ᓶ','ᓷ'=>'ᓷ','ᓸ'=>'ᓸ','ᓹ'=>'ᓹ','ᓺ'=>'ᓺ','ᓻ'=>'ᓻ','ᓼ'=>'ᓼ','ᓽ'=>'ᓽ','ᓾ'=>'ᓾ','ᓿ'=>'ᓿ','ᔀ'=>'ᔀ','ᔁ'=>'ᔁ','ᔂ'=>'ᔂ','ᔃ'=>'ᔃ','ᔄ'=>'ᔄ','ᔅ'=>'ᔅ','ᔆ'=>'ᔆ','ᔇ'=>'ᔇ','ᔈ'=>'ᔈ','ᔉ'=>'ᔉ','ᔊ'=>'ᔊ','ᔋ'=>'ᔋ','ᔌ'=>'ᔌ','ᔍ'=>'ᔍ','ᔎ'=>'ᔎ','ᔏ'=>'ᔏ','ᔐ'=>'ᔐ','ᔑ'=>'ᔑ','ᔒ'=>'ᔒ','ᔓ'=>'ᔓ','ᔔ'=>'ᔔ','ᔕ'=>'ᔕ','ᔖ'=>'ᔖ','ᔗ'=>'ᔗ','ᔘ'=>'ᔘ','ᔙ'=>'ᔙ','ᔚ'=>'ᔚ','ᔛ'=>'ᔛ','ᔜ'=>'ᔜ','ᔝ'=>'ᔝ','ᔞ'=>'ᔞ','ᔟ'=>'ᔟ','ᔠ'=>'ᔠ','ᔡ'=>'ᔡ','ᔢ'=>'ᔢ','ᔣ'=>'ᔣ','ᔤ'=>'ᔤ','ᔥ'=>'ᔥ','ᔦ'=>'ᔦ','ᔧ'=>'ᔧ','ᔨ'=>'ᔨ','ᔩ'=>'ᔩ','ᔪ'=>'ᔪ','ᔫ'=>'ᔫ','ᔬ'=>'ᔬ','ᔭ'=>'ᔭ','ᔮ'=>'ᔮ','ᔯ'=>'ᔯ','ᔰ'=>'ᔰ','ᔱ'=>'ᔱ','ᔲ'=>'ᔲ','ᔳ'=>'ᔳ','ᔴ'=>'ᔴ','ᔵ'=>'ᔵ','ᔶ'=>'ᔶ','ᔷ'=>'ᔷ','ᔸ'=>'ᔸ','ᔹ'=>'ᔹ','ᔺ'=>'ᔺ','ᔻ'=>'ᔻ','ᔼ'=>'ᔼ','ᔽ'=>'ᔽ','ᔾ'=>'ᔾ','ᔿ'=>'ᔿ','ᕀ'=>'ᕀ','ᕁ'=>'ᕁ','ᕂ'=>'ᕂ','ᕃ'=>'ᕃ','ᕄ'=>'ᕄ','ᕅ'=>'ᕅ','ᕆ'=>'ᕆ','ᕇ'=>'ᕇ','ᕈ'=>'ᕈ','ᕉ'=>'ᕉ','ᕊ'=>'ᕊ','ᕋ'=>'ᕋ','ᕌ'=>'ᕌ','ᕍ'=>'ᕍ','ᕎ'=>'ᕎ','ᕏ'=>'ᕏ','ᕐ'=>'ᕐ','ᕑ'=>'ᕑ','ᕒ'=>'ᕒ','ᕓ'=>'ᕓ','ᕔ'=>'ᕔ','ᕕ'=>'ᕕ','ᕖ'=>'ᕖ','ᕗ'=>'ᕗ','ᕘ'=>'ᕘ','ᕙ'=>'ᕙ','ᕚ'=>'ᕚ','ᕛ'=>'ᕛ','ᕜ'=>'ᕜ','ᕝ'=>'ᕝ','ᕞ'=>'ᕞ','ᕟ'=>'ᕟ','ᕠ'=>'ᕠ','ᕡ'=>'ᕡ','ᕢ'=>'ᕢ','ᕣ'=>'ᕣ','ᕤ'=>'ᕤ','ᕥ'=>'ᕥ','ᕦ'=>'ᕦ','ᕧ'=>'ᕧ','ᕨ'=>'ᕨ','ᕩ'=>'ᕩ','ᕪ'=>'ᕪ','ᕫ'=>'ᕫ','ᕬ'=>'ᕬ','ᕭ'=>'ᕭ','ᕮ'=>'ᕮ','ᕯ'=>'ᕯ','ᕰ'=>'ᕰ','ᕱ'=>'ᕱ','ᕲ'=>'ᕲ','ᕳ'=>'ᕳ','ᕴ'=>'ᕴ','ᕵ'=>'ᕵ','ᕶ'=>'ᕶ','ᕷ'=>'ᕷ','ᕸ'=>'ᕸ','ᕹ'=>'ᕹ','ᕺ'=>'ᕺ','ᕻ'=>'ᕻ','ᕼ'=>'ᕼ','ᕽ'=>'ᕽ','ᕾ'=>'ᕾ','ᕿ'=>'ᕿ','ᖀ'=>'ᖀ','ᖁ'=>'ᖁ','ᖂ'=>'ᖂ','ᖃ'=>'ᖃ','ᖄ'=>'ᖄ','ᖅ'=>'ᖅ','ᖆ'=>'ᖆ','ᖇ'=>'ᖇ','ᖈ'=>'ᖈ','ᖉ'=>'ᖉ','ᖊ'=>'ᖊ','ᖋ'=>'ᖋ','ᖌ'=>'ᖌ','ᖍ'=>'ᖍ','ᖎ'=>'ᖎ','ᖏ'=>'ᖏ','ᖐ'=>'ᖐ','ᖑ'=>'ᖑ','ᖒ'=>'ᖒ','ᖓ'=>'ᖓ','ᖔ'=>'ᖔ','ᖕ'=>'ᖕ','ᖖ'=>'ᖖ','ᖗ'=>'ᖗ','ᖘ'=>'ᖘ','ᖙ'=>'ᖙ','ᖚ'=>'ᖚ','ᖛ'=>'ᖛ','ᖜ'=>'ᖜ','ᖝ'=>'ᖝ','ᖞ'=>'ᖞ','ᖟ'=>'ᖟ','ᖠ'=>'ᖠ','ᖡ'=>'ᖡ','ᖢ'=>'ᖢ','ᖣ'=>'ᖣ','ᖤ'=>'ᖤ','ᖥ'=>'ᖥ','ᖦ'=>'ᖦ','ᖧ'=>'ᖧ','ᖨ'=>'ᖨ','ᖩ'=>'ᖩ','ᖪ'=>'ᖪ','ᖫ'=>'ᖫ','ᖬ'=>'ᖬ','ᖭ'=>'ᖭ','ᖮ'=>'ᖮ','ᖯ'=>'ᖯ','ᖰ'=>'ᖰ','ᖱ'=>'ᖱ','ᖲ'=>'ᖲ','ᖳ'=>'ᖳ','ᖴ'=>'ᖴ','ᖵ'=>'ᖵ','ᖶ'=>'ᖶ','ᖷ'=>'ᖷ','ᖸ'=>'ᖸ','ᖹ'=>'ᖹ','ᖺ'=>'ᖺ','ᖻ'=>'ᖻ','ᖼ'=>'ᖼ','ᖽ'=>'ᖽ','ᖾ'=>'ᖾ','ᖿ'=>'ᖿ','ᗀ'=>'ᗀ','ᗁ'=>'ᗁ','ᗂ'=>'ᗂ','ᗃ'=>'ᗃ','ᗄ'=>'ᗄ','ᗅ'=>'ᗅ','ᗆ'=>'ᗆ','ᗇ'=>'ᗇ','ᗈ'=>'ᗈ','ᗉ'=>'ᗉ','ᗊ'=>'ᗊ','ᗋ'=>'ᗋ','ᗌ'=>'ᗌ','ᗍ'=>'ᗍ','ᗎ'=>'ᗎ','ᗏ'=>'ᗏ','ᗐ'=>'ᗐ','ᗑ'=>'ᗑ','ᗒ'=>'ᗒ','ᗓ'=>'ᗓ','ᗔ'=>'ᗔ','ᗕ'=>'ᗕ','ᗖ'=>'ᗖ','ᗗ'=>'ᗗ','ᗘ'=>'ᗘ','ᗙ'=>'ᗙ','ᗚ'=>'ᗚ','ᗛ'=>'ᗛ','ᗜ'=>'ᗜ','ᗝ'=>'ᗝ','ᗞ'=>'ᗞ','ᗟ'=>'ᗟ','ᗠ'=>'ᗠ','ᗡ'=>'ᗡ','ᗢ'=>'ᗢ','ᗣ'=>'ᗣ','ᗤ'=>'ᗤ','ᗥ'=>'ᗥ','ᗦ'=>'ᗦ','ᗧ'=>'ᗧ','ᗨ'=>'ᗨ','ᗩ'=>'ᗩ','ᗪ'=>'ᗪ','ᗫ'=>'ᗫ','ᗬ'=>'ᗬ','ᗭ'=>'ᗭ','ᗮ'=>'ᗮ','ᗯ'=>'ᗯ','ᗰ'=>'ᗰ','ᗱ'=>'ᗱ','ᗲ'=>'ᗲ','ᗳ'=>'ᗳ','ᗴ'=>'ᗴ','ᗵ'=>'ᗵ','ᗶ'=>'ᗶ','ᗷ'=>'ᗷ','ᗸ'=>'ᗸ','ᗹ'=>'ᗹ','ᗺ'=>'ᗺ','ᗻ'=>'ᗻ','ᗼ'=>'ᗼ','ᗽ'=>'ᗽ','ᗾ'=>'ᗾ','ᗿ'=>'ᗿ','ᘀ'=>'ᘀ','ᘁ'=>'ᘁ','ᘂ'=>'ᘂ','ᘃ'=>'ᘃ','ᘄ'=>'ᘄ','ᘅ'=>'ᘅ','ᘆ'=>'ᘆ','ᘇ'=>'ᘇ','ᘈ'=>'ᘈ','ᘉ'=>'ᘉ','ᘊ'=>'ᘊ','ᘋ'=>'ᘋ','ᘌ'=>'ᘌ','ᘍ'=>'ᘍ','ᘎ'=>'ᘎ','ᘏ'=>'ᘏ','ᘐ'=>'ᘐ','ᘑ'=>'ᘑ','ᘒ'=>'ᘒ','ᘓ'=>'ᘓ','ᘔ'=>'ᘔ','ᘕ'=>'ᘕ','ᘖ'=>'ᘖ','ᘗ'=>'ᘗ','ᘘ'=>'ᘘ','ᘙ'=>'ᘙ','ᘚ'=>'ᘚ','ᘛ'=>'ᘛ','ᘜ'=>'ᘜ','ᘝ'=>'ᘝ','ᘞ'=>'ᘞ','ᘟ'=>'ᘟ','ᘠ'=>'ᘠ','ᘡ'=>'ᘡ','ᘢ'=>'ᘢ','ᘣ'=>'ᘣ','ᘤ'=>'ᘤ','ᘥ'=>'ᘥ','ᘦ'=>'ᘦ','ᘧ'=>'ᘧ','ᘨ'=>'ᘨ','ᘩ'=>'ᘩ','ᘪ'=>'ᘪ','ᘫ'=>'ᘫ','ᘬ'=>'ᘬ','ᘭ'=>'ᘭ','ᘮ'=>'ᘮ','ᘯ'=>'ᘯ','ᘰ'=>'ᘰ','ᘱ'=>'ᘱ','ᘲ'=>'ᘲ','ᘳ'=>'ᘳ','ᘴ'=>'ᘴ','ᘵ'=>'ᘵ','ᘶ'=>'ᘶ','ᘷ'=>'ᘷ','ᘸ'=>'ᘸ','ᘹ'=>'ᘹ','ᘺ'=>'ᘺ','ᘻ'=>'ᘻ','ᘼ'=>'ᘼ','ᘽ'=>'ᘽ','ᘾ'=>'ᘾ','ᘿ'=>'ᘿ','ᙀ'=>'ᙀ','ᙁ'=>'ᙁ','ᙂ'=>'ᙂ','ᙃ'=>'ᙃ','ᙄ'=>'ᙄ','ᙅ'=>'ᙅ','ᙆ'=>'ᙆ','ᙇ'=>'ᙇ','ᙈ'=>'ᙈ','ᙉ'=>'ᙉ','ᙊ'=>'ᙊ','ᙋ'=>'ᙋ','ᙌ'=>'ᙌ','ᙍ'=>'ᙍ','ᙎ'=>'ᙎ','ᙏ'=>'ᙏ','ᙐ'=>'ᙐ','ᙑ'=>'ᙑ','ᙒ'=>'ᙒ','ᙓ'=>'ᙓ','ᙔ'=>'ᙔ','ᙕ'=>'ᙕ','ᙖ'=>'ᙖ','ᙗ'=>'ᙗ','ᙘ'=>'ᙘ','ᙙ'=>'ᙙ','ᙚ'=>'ᙚ','ᙛ'=>'ᙛ','ᙜ'=>'ᙜ','ᙝ'=>'ᙝ','ᙞ'=>'ᙞ','ᙟ'=>'ᙟ','ᙠ'=>'ᙠ','ᙡ'=>'ᙡ','ᙢ'=>'ᙢ','ᙣ'=>'ᙣ','ᙤ'=>'ᙤ','ᙥ'=>'ᙥ','ᙦ'=>'ᙦ','ᙧ'=>'ᙧ','ᙨ'=>'ᙨ','ᙩ'=>'ᙩ','ᙪ'=>'ᙪ','ᙫ'=>'ᙫ','ᙬ'=>'ᙬ','ᙯ'=>'ᙯ','ᙰ'=>'ᙰ','ᙱ'=>'ᙱ','ᙲ'=>'ᙲ','ᙳ'=>'ᙳ','ᙴ'=>'ᙴ','ᙵ'=>'ᙵ','ᙶ'=>'ᙶ','ᚁ'=>'ᚁ','ᚂ'=>'ᚂ','ᚃ'=>'ᚃ','ᚄ'=>'ᚄ','ᚅ'=>'ᚅ','ᚆ'=>'ᚆ','ᚇ'=>'ᚇ','ᚈ'=>'ᚈ','ᚉ'=>'ᚉ','ᚊ'=>'ᚊ','ᚋ'=>'ᚋ','ᚌ'=>'ᚌ','ᚍ'=>'ᚍ','ᚎ'=>'ᚎ','ᚏ'=>'ᚏ','ᚐ'=>'ᚐ','ᚑ'=>'ᚑ','ᚒ'=>'ᚒ','ᚓ'=>'ᚓ','ᚔ'=>'ᚔ','ᚕ'=>'ᚕ','ᚖ'=>'ᚖ','ᚗ'=>'ᚗ','ᚘ'=>'ᚘ','ᚙ'=>'ᚙ','ᚚ'=>'ᚚ','ᚠ'=>'ᚠ','ᚡ'=>'ᚡ','ᚢ'=>'ᚢ','ᚣ'=>'ᚣ','ᚤ'=>'ᚤ','ᚥ'=>'ᚥ','ᚦ'=>'ᚦ','ᚧ'=>'ᚧ','ᚨ'=>'ᚨ','ᚩ'=>'ᚩ','ᚪ'=>'ᚪ','ᚫ'=>'ᚫ','ᚬ'=>'ᚬ','ᚭ'=>'ᚭ','ᚮ'=>'ᚮ','ᚯ'=>'ᚯ','ᚰ'=>'ᚰ','ᚱ'=>'ᚱ','ᚲ'=>'ᚲ','ᚳ'=>'ᚳ','ᚴ'=>'ᚴ','ᚵ'=>'ᚵ','ᚶ'=>'ᚶ','ᚷ'=>'ᚷ','ᚸ'=>'ᚸ','ᚹ'=>'ᚹ','ᚺ'=>'ᚺ','ᚻ'=>'ᚻ','ᚼ'=>'ᚼ','ᚽ'=>'ᚽ','ᚾ'=>'ᚾ','ᚿ'=>'ᚿ','ᛀ'=>'ᛀ','ᛁ'=>'ᛁ','ᛂ'=>'ᛂ','ᛃ'=>'ᛃ','ᛄ'=>'ᛄ','ᛅ'=>'ᛅ','ᛆ'=>'ᛆ','ᛇ'=>'ᛇ','ᛈ'=>'ᛈ','ᛉ'=>'ᛉ','ᛊ'=>'ᛊ','ᛋ'=>'ᛋ','ᛌ'=>'ᛌ','ᛍ'=>'ᛍ','ᛎ'=>'ᛎ','ᛏ'=>'ᛏ','ᛐ'=>'ᛐ','ᛑ'=>'ᛑ','ᛒ'=>'ᛒ','ᛓ'=>'ᛓ','ᛔ'=>'ᛔ','ᛕ'=>'ᛕ','ᛖ'=>'ᛖ','ᛗ'=>'ᛗ','ᛘ'=>'ᛘ','ᛙ'=>'ᛙ','ᛚ'=>'ᛚ','ᛛ'=>'ᛛ','ᛜ'=>'ᛜ','ᛝ'=>'ᛝ','ᛞ'=>'ᛞ','ᛟ'=>'ᛟ','ᛠ'=>'ᛠ','ᛡ'=>'ᛡ','ᛢ'=>'ᛢ','ᛣ'=>'ᛣ','ᛤ'=>'ᛤ','ᛥ'=>'ᛥ','ᛦ'=>'ᛦ','ᛧ'=>'ᛧ','ᛨ'=>'ᛨ','ᛩ'=>'ᛩ','ᛪ'=>'ᛪ','ᛮ'=>'17','ᛯ'=>'18','ᛰ'=>'19','ᜀ'=>'ᜀ','ᜁ'=>'ᜁ','ᜂ'=>'ᜂ','ᜃ'=>'ᜃ','ᜄ'=>'ᜄ','ᜅ'=>'ᜅ','ᜆ'=>'ᜆ','ᜇ'=>'ᜇ','ᜈ'=>'ᜈ','ᜉ'=>'ᜉ','ᜊ'=>'ᜊ','ᜋ'=>'ᜋ','ᜌ'=>'ᜌ','ᜎ'=>'ᜎ','ᜏ'=>'ᜏ','ᜐ'=>'ᜐ','ᜑ'=>'ᜑ','ᜒ'=>'ᜒ','ᜓ'=>'ᜓ','᜔'=>'᜔','ᜠ'=>'ᜠ','ᜡ'=>'ᜡ','ᜢ'=>'ᜢ','ᜣ'=>'ᜣ','ᜤ'=>'ᜤ','ᜥ'=>'ᜥ','ᜦ'=>'ᜦ','ᜧ'=>'ᜧ','ᜨ'=>'ᜨ','ᜩ'=>'ᜩ','ᜪ'=>'ᜪ','ᜫ'=>'ᜫ','ᜬ'=>'ᜬ','ᜭ'=>'ᜭ','ᜮ'=>'ᜮ','ᜯ'=>'ᜯ','ᜰ'=>'ᜰ','ᜱ'=>'ᜱ','ᜲ'=>'ᜲ','ᜳ'=>'ᜳ','᜴'=>'᜴','ᝀ'=>'ᝀ','ᝁ'=>'ᝁ','ᝂ'=>'ᝂ','ᝃ'=>'ᝃ','ᝄ'=>'ᝄ','ᝅ'=>'ᝅ','ᝆ'=>'ᝆ','ᝇ'=>'ᝇ','ᝈ'=>'ᝈ','ᝉ'=>'ᝉ','ᝊ'=>'ᝊ','ᝋ'=>'ᝋ','ᝌ'=>'ᝌ','ᝍ'=>'ᝍ','ᝎ'=>'ᝎ','ᝏ'=>'ᝏ','ᝐ'=>'ᝐ','ᝑ'=>'ᝑ','ᝒ'=>'ᝒ','ᝓ'=>'ᝓ','ᝠ'=>'ᝠ','ᝡ'=>'ᝡ','ᝢ'=>'ᝢ','ᝣ'=>'ᝣ','ᝤ'=>'ᝤ','ᝥ'=>'ᝥ','ᝦ'=>'ᝦ','ᝧ'=>'ᝧ','ᝨ'=>'ᝨ','ᝩ'=>'ᝩ','ᝪ'=>'ᝪ','ᝫ'=>'ᝫ','ᝬ'=>'ᝬ','ᝮ'=>'ᝮ','ᝯ'=>'ᝯ','ᝰ'=>'ᝰ','ᝲ'=>'ᝲ','ᝳ'=>'ᝳ','ក'=>'ក','ខ'=>'ខ','គ'=>'គ','ឃ'=>'ឃ','ង'=>'ង','ច'=>'ច','ឆ'=>'ឆ','ជ'=>'ជ','ឈ'=>'ឈ','ញ'=>'ញ','ដ'=>'ដ','ឋ'=>'ឋ','ឌ'=>'ឌ','ឍ'=>'ឍ','ណ'=>'ណ','ត'=>'ត','ថ'=>'ថ','ទ'=>'ទ','ធ'=>'ធ','ន'=>'ន','ប'=>'ប','ផ'=>'ផ','ព'=>'ព','ភ'=>'ភ','ម'=>'ម','យ'=>'យ','រ'=>'រ','ល'=>'ល','វ'=>'វ','ឝ'=>'ឝ','ឞ'=>'ឞ','ស'=>'ស','ហ'=>'ហ','ឡ'=>'ឡ','អ'=>'អ','ឣ'=>'ឣ','ឤ'=>'ឤ','ឥ'=>'ឥ','ឦ'=>'ឦ','ឧ'=>'ឧ','ឨ'=>'ឨ','ឩ'=>'ឩ','ឪ'=>'ឪ','ឫ'=>'ឫ','ឬ'=>'ឬ','ឭ'=>'ឭ','ឮ'=>'ឮ','ឯ'=>'ឯ','ឰ'=>'ឰ','ឱ'=>'ឱ','ឲ'=>'ឲ','ឳ'=>'ឳ','ា'=>'ា','ិ'=>'ិ','ី'=>'ី','ឹ'=>'ឹ','ឺ'=>'ឺ','ុ'=>'ុ','ូ'=>'ូ','ួ'=>'ួ','ើ'=>'ើ','ឿ'=>'ឿ','ៀ'=>'ៀ','េ'=>'េ','ែ'=>'ែ','ៃ'=>'ៃ','ោ'=>'ោ','ៅ'=>'ៅ','ំ'=>'ំ','ះ'=>'ះ','ៈ'=>'ៈ','៉'=>'៉','៊'=>'៊','់'=>'់','៌'=>'៌','៍'=>'៍','៎'=>'៎','៏'=>'៏','័'=>'័','៑'=>'៑','្'=>'្','៓'=>'៓','ៗ'=>'ៗ','ៜ'=>'ៜ','៝'=>'៝','០'=>'0','១'=>'1','២'=>'2','៣'=>'3','៤'=>'4','៥'=>'5','៦'=>'6','៧'=>'7','៨'=>'8','៩'=>'9','៰'=>'0','៱'=>'1','៲'=>'2','៳'=>'3','៴'=>'4','៵'=>'5','៶'=>'6','៷'=>'7','៸'=>'8','៹'=>'9'); \ No newline at end of file
+<?php return array('က'=>'က','ခ'=>'ခ','ဂ'=>'ဂ','ဃ'=>'ဃ','င'=>'င','စ'=>'စ','ဆ'=>'ဆ','ဇ'=>'ဇ','ဈ'=>'ဈ','ဉ'=>'ဉ','ည'=>'ည','ဋ'=>'ဋ','ဌ'=>'ဌ','ဍ'=>'ဍ','ဎ'=>'ဎ','ဏ'=>'ဏ','တ'=>'တ','ထ'=>'ထ','ဒ'=>'ဒ','ဓ'=>'ဓ','န'=>'န','ပ'=>'ပ','ဖ'=>'ဖ','ဗ'=>'ဗ','ဘ'=>'ဘ','မ'=>'မ','ယ'=>'ယ','ရ'=>'ရ','လ'=>'လ','ဝ'=>'ဝ','သ'=>'သ','ဟ'=>'ဟ','ဠ'=>'ဠ','အ'=>'အ','ဣ'=>'ဣ','ဤ'=>'ဤ','ဥ'=>'ဥ','ဦ'=>'ဦ','ဧ'=>'ဧ','ဩ'=>'ဩ','ဪ'=>'ဪ','ာ'=>'ာ','ိ'=>'ိ','ီ'=>'ီ','ု'=>'ု','ူ'=>'ူ','ေ'=>'ေ','ဲ'=>'ဲ','ံ'=>'ံ','့'=>'့','း'=>'း','္'=>'္','၀'=>'0','၁'=>'1','၂'=>'2','၃'=>'3','၄'=>'4','၅'=>'5','၆'=>'6','၇'=>'7','၈'=>'8','၉'=>'9','ၐ'=>'ၐ','ၑ'=>'ၑ','ၒ'=>'ၒ','ၓ'=>'ၓ','ၔ'=>'ၔ','ၕ'=>'ၕ','ၖ'=>'ၖ','ၗ'=>'ၗ','ၘ'=>'ၘ','ၙ'=>'ၙ','Ⴀ'=>'ⴀ','Ⴁ'=>'ⴁ','Ⴂ'=>'ⴂ','Ⴃ'=>'ⴃ','Ⴄ'=>'ⴄ','Ⴅ'=>'ⴅ','Ⴆ'=>'ⴆ','Ⴇ'=>'ⴇ','Ⴈ'=>'ⴈ','Ⴉ'=>'ⴉ','Ⴊ'=>'ⴊ','Ⴋ'=>'ⴋ','Ⴌ'=>'ⴌ','Ⴍ'=>'ⴍ','Ⴎ'=>'ⴎ','Ⴏ'=>'ⴏ','Ⴐ'=>'ⴐ','Ⴑ'=>'ⴑ','Ⴒ'=>'ⴒ','Ⴓ'=>'ⴓ','Ⴔ'=>'ⴔ','Ⴕ'=>'ⴕ','Ⴖ'=>'ⴖ','Ⴗ'=>'ⴗ','Ⴘ'=>'ⴘ','Ⴙ'=>'ⴙ','Ⴚ'=>'ⴚ','Ⴛ'=>'ⴛ','Ⴜ'=>'ⴜ','Ⴝ'=>'ⴝ','Ⴞ'=>'ⴞ','Ⴟ'=>'ⴟ','Ⴠ'=>'ⴠ','Ⴡ'=>'ⴡ','Ⴢ'=>'ⴢ','Ⴣ'=>'ⴣ','Ⴤ'=>'ⴤ','Ⴥ'=>'ⴥ','ა'=>'ა','ბ'=>'ბ','გ'=>'გ','დ'=>'დ','ე'=>'ე','ვ'=>'ვ','ზ'=>'ზ','თ'=>'თ','ი'=>'ი','კ'=>'კ','ლ'=>'ლ','მ'=>'მ','ნ'=>'ნ','ო'=>'ო','პ'=>'პ','ჟ'=>'ჟ','რ'=>'რ','ს'=>'ს','ტ'=>'ტ','უ'=>'უ','ფ'=>'ფ','ქ'=>'ქ','ღ'=>'ღ','ყ'=>'ყ','შ'=>'შ','ჩ'=>'ჩ','ც'=>'ც','ძ'=>'ძ','წ'=>'წ','ჭ'=>'ჭ','ხ'=>'ხ','ჯ'=>'ჯ','ჰ'=>'ჰ','ჱ'=>'ჱ','ჲ'=>'ჲ','ჳ'=>'ჳ','ჴ'=>'ჴ','ჵ'=>'ჵ','ჶ'=>'ჶ','ჷ'=>'ჷ','ჸ'=>'ჸ','ჹ'=>'ჹ','ჺ'=>'ჺ','ჼ'=>'ჼ','ᄀ'=>'ᄀ','ᄁ'=>'ᄁ','ᄂ'=>'ᄂ','ᄃ'=>'ᄃ','ᄄ'=>'ᄄ','ᄅ'=>'ᄅ','ᄆ'=>'ᄆ','ᄇ'=>'ᄇ','ᄈ'=>'ᄈ','ᄉ'=>'ᄉ','ᄊ'=>'ᄊ','ᄋ'=>'ᄋ','ᄌ'=>'ᄌ','ᄍ'=>'ᄍ','ᄎ'=>'ᄎ','ᄏ'=>'ᄏ','ᄐ'=>'ᄐ','ᄑ'=>'ᄑ','ᄒ'=>'ᄒ','ᄓ'=>'ᄓ','ᄔ'=>'ᄔ','ᄕ'=>'ᄕ','ᄖ'=>'ᄖ','ᄗ'=>'ᄗ','ᄘ'=>'ᄘ','ᄙ'=>'ᄙ','ᄚ'=>'ᄚ','ᄛ'=>'ᄛ','ᄜ'=>'ᄜ','ᄝ'=>'ᄝ','ᄞ'=>'ᄞ','ᄟ'=>'ᄟ','ᄠ'=>'ᄠ','ᄡ'=>'ᄡ','ᄢ'=>'ᄢ','ᄣ'=>'ᄣ','ᄤ'=>'ᄤ','ᄥ'=>'ᄥ','ᄦ'=>'ᄦ','ᄧ'=>'ᄧ','ᄨ'=>'ᄨ','ᄩ'=>'ᄩ','ᄪ'=>'ᄪ','ᄫ'=>'ᄫ','ᄬ'=>'ᄬ','ᄭ'=>'ᄭ','ᄮ'=>'ᄮ','ᄯ'=>'ᄯ','ᄰ'=>'ᄰ','ᄱ'=>'ᄱ','ᄲ'=>'ᄲ','ᄳ'=>'ᄳ','ᄴ'=>'ᄴ','ᄵ'=>'ᄵ','ᄶ'=>'ᄶ','ᄷ'=>'ᄷ','ᄸ'=>'ᄸ','ᄹ'=>'ᄹ','ᄺ'=>'ᄺ','ᄻ'=>'ᄻ','ᄼ'=>'ᄼ','ᄽ'=>'ᄽ','ᄾ'=>'ᄾ','ᄿ'=>'ᄿ','ᅀ'=>'ᅀ','ᅁ'=>'ᅁ','ᅂ'=>'ᅂ','ᅃ'=>'ᅃ','ᅄ'=>'ᅄ','ᅅ'=>'ᅅ','ᅆ'=>'ᅆ','ᅇ'=>'ᅇ','ᅈ'=>'ᅈ','ᅉ'=>'ᅉ','ᅊ'=>'ᅊ','ᅋ'=>'ᅋ','ᅌ'=>'ᅌ','ᅍ'=>'ᅍ','ᅎ'=>'ᅎ','ᅏ'=>'ᅏ','ᅐ'=>'ᅐ','ᅑ'=>'ᅑ','ᅒ'=>'ᅒ','ᅓ'=>'ᅓ','ᅔ'=>'ᅔ','ᅕ'=>'ᅕ','ᅖ'=>'ᅖ','ᅗ'=>'ᅗ','ᅘ'=>'ᅘ','ᅙ'=>'ᅙ','ᅟ'=>'ᅟ','ᅠ'=>'ᅠ','ᅡ'=>'ᅡ','ᅢ'=>'ᅢ','ᅣ'=>'ᅣ','ᅤ'=>'ᅤ','ᅥ'=>'ᅥ','ᅦ'=>'ᅦ','ᅧ'=>'ᅧ','ᅨ'=>'ᅨ','ᅩ'=>'ᅩ','ᅪ'=>'ᅪ','ᅫ'=>'ᅫ','ᅬ'=>'ᅬ','ᅭ'=>'ᅭ','ᅮ'=>'ᅮ','ᅯ'=>'ᅯ','ᅰ'=>'ᅰ','ᅱ'=>'ᅱ','ᅲ'=>'ᅲ','ᅳ'=>'ᅳ','ᅴ'=>'ᅴ','ᅵ'=>'ᅵ','ᅶ'=>'ᅶ','ᅷ'=>'ᅷ','ᅸ'=>'ᅸ','ᅹ'=>'ᅹ','ᅺ'=>'ᅺ','ᅻ'=>'ᅻ','ᅼ'=>'ᅼ','ᅽ'=>'ᅽ','ᅾ'=>'ᅾ','ᅿ'=>'ᅿ','ᆀ'=>'ᆀ','ᆁ'=>'ᆁ','ᆂ'=>'ᆂ','ᆃ'=>'ᆃ','ᆄ'=>'ᆄ','ᆅ'=>'ᆅ','ᆆ'=>'ᆆ','ᆇ'=>'ᆇ','ᆈ'=>'ᆈ','ᆉ'=>'ᆉ','ᆊ'=>'ᆊ','ᆋ'=>'ᆋ','ᆌ'=>'ᆌ','ᆍ'=>'ᆍ','ᆎ'=>'ᆎ','ᆏ'=>'ᆏ','ᆐ'=>'ᆐ','ᆑ'=>'ᆑ','ᆒ'=>'ᆒ','ᆓ'=>'ᆓ','ᆔ'=>'ᆔ','ᆕ'=>'ᆕ','ᆖ'=>'ᆖ','ᆗ'=>'ᆗ','ᆘ'=>'ᆘ','ᆙ'=>'ᆙ','ᆚ'=>'ᆚ','ᆛ'=>'ᆛ','ᆜ'=>'ᆜ','ᆝ'=>'ᆝ','ᆞ'=>'ᆞ','ᆟ'=>'ᆟ','ᆠ'=>'ᆠ','ᆡ'=>'ᆡ','ᆢ'=>'ᆢ','ᆨ'=>'ᆨ','ᆩ'=>'ᆩ','ᆪ'=>'ᆪ','ᆫ'=>'ᆫ','ᆬ'=>'ᆬ','ᆭ'=>'ᆭ','ᆮ'=>'ᆮ','ᆯ'=>'ᆯ','ᆰ'=>'ᆰ','ᆱ'=>'ᆱ','ᆲ'=>'ᆲ','ᆳ'=>'ᆳ','ᆴ'=>'ᆴ','ᆵ'=>'ᆵ','ᆶ'=>'ᆶ','ᆷ'=>'ᆷ','ᆸ'=>'ᆸ','ᆹ'=>'ᆹ','ᆺ'=>'ᆺ','ᆻ'=>'ᆻ','ᆼ'=>'ᆼ','ᆽ'=>'ᆽ','ᆾ'=>'ᆾ','ᆿ'=>'ᆿ','ᇀ'=>'ᇀ','ᇁ'=>'ᇁ','ᇂ'=>'ᇂ','ᇃ'=>'ᇃ','ᇄ'=>'ᇄ','ᇅ'=>'ᇅ','ᇆ'=>'ᇆ','ᇇ'=>'ᇇ','ᇈ'=>'ᇈ','ᇉ'=>'ᇉ','ᇊ'=>'ᇊ','ᇋ'=>'ᇋ','ᇌ'=>'ᇌ','ᇍ'=>'ᇍ','ᇎ'=>'ᇎ','ᇏ'=>'ᇏ','ᇐ'=>'ᇐ','ᇑ'=>'ᇑ','ᇒ'=>'ᇒ','ᇓ'=>'ᇓ','ᇔ'=>'ᇔ','ᇕ'=>'ᇕ','ᇖ'=>'ᇖ','ᇗ'=>'ᇗ','ᇘ'=>'ᇘ','ᇙ'=>'ᇙ','ᇚ'=>'ᇚ','ᇛ'=>'ᇛ','ᇜ'=>'ᇜ','ᇝ'=>'ᇝ','ᇞ'=>'ᇞ','ᇟ'=>'ᇟ','ᇠ'=>'ᇠ','ᇡ'=>'ᇡ','ᇢ'=>'ᇢ','ᇣ'=>'ᇣ','ᇤ'=>'ᇤ','ᇥ'=>'ᇥ','ᇦ'=>'ᇦ','ᇧ'=>'ᇧ','ᇨ'=>'ᇨ','ᇩ'=>'ᇩ','ᇪ'=>'ᇪ','ᇫ'=>'ᇫ','ᇬ'=>'ᇬ','ᇭ'=>'ᇭ','ᇮ'=>'ᇮ','ᇯ'=>'ᇯ','ᇰ'=>'ᇰ','ᇱ'=>'ᇱ','ᇲ'=>'ᇲ','ᇳ'=>'ᇳ','ᇴ'=>'ᇴ','ᇵ'=>'ᇵ','ᇶ'=>'ᇶ','ᇷ'=>'ᇷ','ᇸ'=>'ᇸ','ᇹ'=>'ᇹ','ሀ'=>'ሀ','ሁ'=>'ሁ','ሂ'=>'ሂ','ሃ'=>'ሃ','ሄ'=>'ሄ','ህ'=>'ህ','ሆ'=>'ሆ','ሇ'=>'ሇ','ለ'=>'ለ','ሉ'=>'ሉ','ሊ'=>'ሊ','ላ'=>'ላ','ሌ'=>'ሌ','ል'=>'ል','ሎ'=>'ሎ','ሏ'=>'ሏ','ሐ'=>'ሐ','ሑ'=>'ሑ','ሒ'=>'ሒ','ሓ'=>'ሓ','ሔ'=>'ሔ','ሕ'=>'ሕ','ሖ'=>'ሖ','ሗ'=>'ሗ','መ'=>'መ','ሙ'=>'ሙ','ሚ'=>'ሚ','ማ'=>'ማ','ሜ'=>'ሜ','ም'=>'ም','ሞ'=>'ሞ','ሟ'=>'ሟ','ሠ'=>'ሠ','ሡ'=>'ሡ','ሢ'=>'ሢ','ሣ'=>'ሣ','ሤ'=>'ሤ','ሥ'=>'ሥ','ሦ'=>'ሦ','ሧ'=>'ሧ','ረ'=>'ረ','ሩ'=>'ሩ','ሪ'=>'ሪ','ራ'=>'ራ','ሬ'=>'ሬ','ር'=>'ር','ሮ'=>'ሮ','ሯ'=>'ሯ','ሰ'=>'ሰ','ሱ'=>'ሱ','ሲ'=>'ሲ','ሳ'=>'ሳ','ሴ'=>'ሴ','ስ'=>'ስ','ሶ'=>'ሶ','ሷ'=>'ሷ','ሸ'=>'ሸ','ሹ'=>'ሹ','ሺ'=>'ሺ','ሻ'=>'ሻ','ሼ'=>'ሼ','ሽ'=>'ሽ','ሾ'=>'ሾ','ሿ'=>'ሿ','ቀ'=>'ቀ','ቁ'=>'ቁ','ቂ'=>'ቂ','ቃ'=>'ቃ','ቄ'=>'ቄ','ቅ'=>'ቅ','ቆ'=>'ቆ','ቇ'=>'ቇ','ቈ'=>'ቈ','ቊ'=>'ቊ','ቋ'=>'ቋ','ቌ'=>'ቌ','ቍ'=>'ቍ','ቐ'=>'ቐ','ቑ'=>'ቑ','ቒ'=>'ቒ','ቓ'=>'ቓ','ቔ'=>'ቔ','ቕ'=>'ቕ','ቖ'=>'ቖ','ቘ'=>'ቘ','ቚ'=>'ቚ','ቛ'=>'ቛ','ቜ'=>'ቜ','ቝ'=>'ቝ','በ'=>'በ','ቡ'=>'ቡ','ቢ'=>'ቢ','ባ'=>'ባ','ቤ'=>'ቤ','ብ'=>'ብ','ቦ'=>'ቦ','ቧ'=>'ቧ','ቨ'=>'ቨ','ቩ'=>'ቩ','ቪ'=>'ቪ','ቫ'=>'ቫ','ቬ'=>'ቬ','ቭ'=>'ቭ','ቮ'=>'ቮ','ቯ'=>'ቯ','ተ'=>'ተ','ቱ'=>'ቱ','ቲ'=>'ቲ','ታ'=>'ታ','ቴ'=>'ቴ','ት'=>'ት','ቶ'=>'ቶ','ቷ'=>'ቷ','ቸ'=>'ቸ','ቹ'=>'ቹ','ቺ'=>'ቺ','ቻ'=>'ቻ','ቼ'=>'ቼ','ች'=>'ች','ቾ'=>'ቾ','ቿ'=>'ቿ','ኀ'=>'ኀ','ኁ'=>'ኁ','ኂ'=>'ኂ','ኃ'=>'ኃ','ኄ'=>'ኄ','ኅ'=>'ኅ','ኆ'=>'ኆ','ኇ'=>'ኇ','ኈ'=>'ኈ','ኊ'=>'ኊ','ኋ'=>'ኋ','ኌ'=>'ኌ','ኍ'=>'ኍ','ነ'=>'ነ','ኑ'=>'ኑ','ኒ'=>'ኒ','ና'=>'ና','ኔ'=>'ኔ','ን'=>'ን','ኖ'=>'ኖ','ኗ'=>'ኗ','ኘ'=>'ኘ','ኙ'=>'ኙ','ኚ'=>'ኚ','ኛ'=>'ኛ','ኜ'=>'ኜ','ኝ'=>'ኝ','ኞ'=>'ኞ','ኟ'=>'ኟ','አ'=>'አ','ኡ'=>'ኡ','ኢ'=>'ኢ','ኣ'=>'ኣ','ኤ'=>'ኤ','እ'=>'እ','ኦ'=>'ኦ','ኧ'=>'ኧ','ከ'=>'ከ','ኩ'=>'ኩ','ኪ'=>'ኪ','ካ'=>'ካ','ኬ'=>'ኬ','ክ'=>'ክ','ኮ'=>'ኮ','ኯ'=>'ኯ','ኰ'=>'ኰ','ኲ'=>'ኲ','ኳ'=>'ኳ','ኴ'=>'ኴ','ኵ'=>'ኵ','ኸ'=>'ኸ','ኹ'=>'ኹ','ኺ'=>'ኺ','ኻ'=>'ኻ','ኼ'=>'ኼ','ኽ'=>'ኽ','ኾ'=>'ኾ','ዀ'=>'ዀ','ዂ'=>'ዂ','ዃ'=>'ዃ','ዄ'=>'ዄ','ዅ'=>'ዅ','ወ'=>'ወ','ዉ'=>'ዉ','ዊ'=>'ዊ','ዋ'=>'ዋ','ዌ'=>'ዌ','ው'=>'ው','ዎ'=>'ዎ','ዏ'=>'ዏ','ዐ'=>'ዐ','ዑ'=>'ዑ','ዒ'=>'ዒ','ዓ'=>'ዓ','ዔ'=>'ዔ','ዕ'=>'ዕ','ዖ'=>'ዖ','ዘ'=>'ዘ','ዙ'=>'ዙ','ዚ'=>'ዚ','ዛ'=>'ዛ','ዜ'=>'ዜ','ዝ'=>'ዝ','ዞ'=>'ዞ','ዟ'=>'ዟ','ዠ'=>'ዠ','ዡ'=>'ዡ','ዢ'=>'ዢ','ዣ'=>'ዣ','ዤ'=>'ዤ','ዥ'=>'ዥ','ዦ'=>'ዦ','ዧ'=>'ዧ','የ'=>'የ','ዩ'=>'ዩ','ዪ'=>'ዪ','ያ'=>'ያ','ዬ'=>'ዬ','ይ'=>'ይ','ዮ'=>'ዮ','ዯ'=>'ዯ','ደ'=>'ደ','ዱ'=>'ዱ','ዲ'=>'ዲ','ዳ'=>'ዳ','ዴ'=>'ዴ','ድ'=>'ድ','ዶ'=>'ዶ','ዷ'=>'ዷ','ዸ'=>'ዸ','ዹ'=>'ዹ','ዺ'=>'ዺ','ዻ'=>'ዻ','ዼ'=>'ዼ','ዽ'=>'ዽ','ዾ'=>'ዾ','ዿ'=>'ዿ','ጀ'=>'ጀ','ጁ'=>'ጁ','ጂ'=>'ጂ','ጃ'=>'ጃ','ጄ'=>'ጄ','ጅ'=>'ጅ','ጆ'=>'ጆ','ጇ'=>'ጇ','ገ'=>'ገ','ጉ'=>'ጉ','ጊ'=>'ጊ','ጋ'=>'ጋ','ጌ'=>'ጌ','ግ'=>'ግ','ጎ'=>'ጎ','ጏ'=>'ጏ','ጐ'=>'ጐ','ጒ'=>'ጒ','ጓ'=>'ጓ','ጔ'=>'ጔ','ጕ'=>'ጕ','ጘ'=>'ጘ','ጙ'=>'ጙ','ጚ'=>'ጚ','ጛ'=>'ጛ','ጜ'=>'ጜ','ጝ'=>'ጝ','ጞ'=>'ጞ','ጟ'=>'ጟ','ጠ'=>'ጠ','ጡ'=>'ጡ','ጢ'=>'ጢ','ጣ'=>'ጣ','ጤ'=>'ጤ','ጥ'=>'ጥ','ጦ'=>'ጦ','ጧ'=>'ጧ','ጨ'=>'ጨ','ጩ'=>'ጩ','ጪ'=>'ጪ','ጫ'=>'ጫ','ጬ'=>'ጬ','ጭ'=>'ጭ','ጮ'=>'ጮ','ጯ'=>'ጯ','ጰ'=>'ጰ','ጱ'=>'ጱ','ጲ'=>'ጲ','ጳ'=>'ጳ','ጴ'=>'ጴ','ጵ'=>'ጵ','ጶ'=>'ጶ','ጷ'=>'ጷ','ጸ'=>'ጸ','ጹ'=>'ጹ','ጺ'=>'ጺ','ጻ'=>'ጻ','ጼ'=>'ጼ','ጽ'=>'ጽ','ጾ'=>'ጾ','ጿ'=>'ጿ','ፀ'=>'ፀ','ፁ'=>'ፁ','ፂ'=>'ፂ','ፃ'=>'ፃ','ፄ'=>'ፄ','ፅ'=>'ፅ','ፆ'=>'ፆ','ፇ'=>'ፇ','ፈ'=>'ፈ','ፉ'=>'ፉ','ፊ'=>'ፊ','ፋ'=>'ፋ','ፌ'=>'ፌ','ፍ'=>'ፍ','ፎ'=>'ፎ','ፏ'=>'ፏ','ፐ'=>'ፐ','ፑ'=>'ፑ','ፒ'=>'ፒ','ፓ'=>'ፓ','ፔ'=>'ፔ','ፕ'=>'ፕ','ፖ'=>'ፖ','ፗ'=>'ፗ','ፘ'=>'ፘ','ፙ'=>'ፙ','ፚ'=>'ፚ','፟'=>'፟','፩'=>'1','፪'=>'2','፫'=>'3','፬'=>'4','፭'=>'5','፮'=>'6','፯'=>'7','፰'=>'8','፱'=>'9','፲'=>'10','፳'=>'20','፴'=>'30','፵'=>'40','፶'=>'50','፷'=>'60','፸'=>'70','፹'=>'80','፺'=>'90','፻'=>'100','፼'=>'10000','ᎀ'=>'ᎀ','ᎁ'=>'ᎁ','ᎂ'=>'ᎂ','ᎃ'=>'ᎃ','ᎄ'=>'ᎄ','ᎅ'=>'ᎅ','ᎆ'=>'ᎆ','ᎇ'=>'ᎇ','ᎈ'=>'ᎈ','ᎉ'=>'ᎉ','ᎊ'=>'ᎊ','ᎋ'=>'ᎋ','ᎌ'=>'ᎌ','ᎍ'=>'ᎍ','ᎎ'=>'ᎎ','ᎏ'=>'ᎏ','Ꭰ'=>'Ꭰ','Ꭱ'=>'Ꭱ','Ꭲ'=>'Ꭲ','Ꭳ'=>'Ꭳ','Ꭴ'=>'Ꭴ','Ꭵ'=>'Ꭵ','Ꭶ'=>'Ꭶ','Ꭷ'=>'Ꭷ','Ꭸ'=>'Ꭸ','Ꭹ'=>'Ꭹ','Ꭺ'=>'Ꭺ','Ꭻ'=>'Ꭻ','Ꭼ'=>'Ꭼ','Ꭽ'=>'Ꭽ','Ꭾ'=>'Ꭾ','Ꭿ'=>'Ꭿ','Ꮀ'=>'Ꮀ','Ꮁ'=>'Ꮁ','Ꮂ'=>'Ꮂ','Ꮃ'=>'Ꮃ','Ꮄ'=>'Ꮄ','Ꮅ'=>'Ꮅ','Ꮆ'=>'Ꮆ','Ꮇ'=>'Ꮇ','Ꮈ'=>'Ꮈ','Ꮉ'=>'Ꮉ','Ꮊ'=>'Ꮊ','Ꮋ'=>'Ꮋ','Ꮌ'=>'Ꮌ','Ꮍ'=>'Ꮍ','Ꮎ'=>'Ꮎ','Ꮏ'=>'Ꮏ','Ꮐ'=>'Ꮐ','Ꮑ'=>'Ꮑ','Ꮒ'=>'Ꮒ','Ꮓ'=>'Ꮓ','Ꮔ'=>'Ꮔ','Ꮕ'=>'Ꮕ','Ꮖ'=>'Ꮖ','Ꮗ'=>'Ꮗ','Ꮘ'=>'Ꮘ','Ꮙ'=>'Ꮙ','Ꮚ'=>'Ꮚ','Ꮛ'=>'Ꮛ','Ꮜ'=>'Ꮜ','Ꮝ'=>'Ꮝ','Ꮞ'=>'Ꮞ','Ꮟ'=>'Ꮟ','Ꮠ'=>'Ꮠ','Ꮡ'=>'Ꮡ','Ꮢ'=>'Ꮢ','Ꮣ'=>'Ꮣ','Ꮤ'=>'Ꮤ','Ꮥ'=>'Ꮥ','Ꮦ'=>'Ꮦ','Ꮧ'=>'Ꮧ','Ꮨ'=>'Ꮨ','Ꮩ'=>'Ꮩ','Ꮪ'=>'Ꮪ','Ꮫ'=>'Ꮫ','Ꮬ'=>'Ꮬ','Ꮭ'=>'Ꮭ','Ꮮ'=>'Ꮮ','Ꮯ'=>'Ꮯ','Ꮰ'=>'Ꮰ','Ꮱ'=>'Ꮱ','Ꮲ'=>'Ꮲ','Ꮳ'=>'Ꮳ','Ꮴ'=>'Ꮴ','Ꮵ'=>'Ꮵ','Ꮶ'=>'Ꮶ','Ꮷ'=>'Ꮷ','Ꮸ'=>'Ꮸ','Ꮹ'=>'Ꮹ','Ꮺ'=>'Ꮺ','Ꮻ'=>'Ꮻ','Ꮼ'=>'Ꮼ','Ꮽ'=>'Ꮽ','Ꮾ'=>'Ꮾ','Ꮿ'=>'Ꮿ','Ᏸ'=>'Ᏸ','Ᏹ'=>'Ᏹ','Ᏺ'=>'Ᏺ','Ᏻ'=>'Ᏻ','Ᏼ'=>'Ᏼ','ᐁ'=>'ᐁ','ᐂ'=>'ᐂ','ᐃ'=>'ᐃ','ᐄ'=>'ᐄ','ᐅ'=>'ᐅ','ᐆ'=>'ᐆ','ᐇ'=>'ᐇ','ᐈ'=>'ᐈ','ᐉ'=>'ᐉ','ᐊ'=>'ᐊ','ᐋ'=>'ᐋ','ᐌ'=>'ᐌ','ᐍ'=>'ᐍ','ᐎ'=>'ᐎ','ᐏ'=>'ᐏ','ᐐ'=>'ᐐ','ᐑ'=>'ᐑ','ᐒ'=>'ᐒ','ᐓ'=>'ᐓ','ᐔ'=>'ᐔ','ᐕ'=>'ᐕ','ᐖ'=>'ᐖ','ᐗ'=>'ᐗ','ᐘ'=>'ᐘ','ᐙ'=>'ᐙ','ᐚ'=>'ᐚ','ᐛ'=>'ᐛ','ᐜ'=>'ᐜ','ᐝ'=>'ᐝ','ᐞ'=>'ᐞ','ᐟ'=>'ᐟ','ᐠ'=>'ᐠ','ᐡ'=>'ᐡ','ᐢ'=>'ᐢ','ᐣ'=>'ᐣ','ᐤ'=>'ᐤ','ᐥ'=>'ᐥ','ᐦ'=>'ᐦ','ᐧ'=>'ᐧ','ᐨ'=>'ᐨ','ᐩ'=>'ᐩ','ᐪ'=>'ᐪ','ᐫ'=>'ᐫ','ᐬ'=>'ᐬ','ᐭ'=>'ᐭ','ᐮ'=>'ᐮ','ᐯ'=>'ᐯ','ᐰ'=>'ᐰ','ᐱ'=>'ᐱ','ᐲ'=>'ᐲ','ᐳ'=>'ᐳ','ᐴ'=>'ᐴ','ᐵ'=>'ᐵ','ᐶ'=>'ᐶ','ᐷ'=>'ᐷ','ᐸ'=>'ᐸ','ᐹ'=>'ᐹ','ᐺ'=>'ᐺ','ᐻ'=>'ᐻ','ᐼ'=>'ᐼ','ᐽ'=>'ᐽ','ᐾ'=>'ᐾ','ᐿ'=>'ᐿ','ᑀ'=>'ᑀ','ᑁ'=>'ᑁ','ᑂ'=>'ᑂ','ᑃ'=>'ᑃ','ᑄ'=>'ᑄ','ᑅ'=>'ᑅ','ᑆ'=>'ᑆ','ᑇ'=>'ᑇ','ᑈ'=>'ᑈ','ᑉ'=>'ᑉ','ᑊ'=>'ᑊ','ᑋ'=>'ᑋ','ᑌ'=>'ᑌ','ᑍ'=>'ᑍ','ᑎ'=>'ᑎ','ᑏ'=>'ᑏ','ᑐ'=>'ᑐ','ᑑ'=>'ᑑ','ᑒ'=>'ᑒ','ᑓ'=>'ᑓ','ᑔ'=>'ᑔ','ᑕ'=>'ᑕ','ᑖ'=>'ᑖ','ᑗ'=>'ᑗ','ᑘ'=>'ᑘ','ᑙ'=>'ᑙ','ᑚ'=>'ᑚ','ᑛ'=>'ᑛ','ᑜ'=>'ᑜ','ᑝ'=>'ᑝ','ᑞ'=>'ᑞ','ᑟ'=>'ᑟ','ᑠ'=>'ᑠ','ᑡ'=>'ᑡ','ᑢ'=>'ᑢ','ᑣ'=>'ᑣ','ᑤ'=>'ᑤ','ᑥ'=>'ᑥ','ᑦ'=>'ᑦ','ᑧ'=>'ᑧ','ᑨ'=>'ᑨ','ᑩ'=>'ᑩ','ᑪ'=>'ᑪ','ᑫ'=>'ᑫ','ᑬ'=>'ᑬ','ᑭ'=>'ᑭ','ᑮ'=>'ᑮ','ᑯ'=>'ᑯ','ᑰ'=>'ᑰ','ᑱ'=>'ᑱ','ᑲ'=>'ᑲ','ᑳ'=>'ᑳ','ᑴ'=>'ᑴ','ᑵ'=>'ᑵ','ᑶ'=>'ᑶ','ᑷ'=>'ᑷ','ᑸ'=>'ᑸ','ᑹ'=>'ᑹ','ᑺ'=>'ᑺ','ᑻ'=>'ᑻ','ᑼ'=>'ᑼ','ᑽ'=>'ᑽ','ᑾ'=>'ᑾ','ᑿ'=>'ᑿ','ᒀ'=>'ᒀ','ᒁ'=>'ᒁ','ᒂ'=>'ᒂ','ᒃ'=>'ᒃ','ᒄ'=>'ᒄ','ᒅ'=>'ᒅ','ᒆ'=>'ᒆ','ᒇ'=>'ᒇ','ᒈ'=>'ᒈ','ᒉ'=>'ᒉ','ᒊ'=>'ᒊ','ᒋ'=>'ᒋ','ᒌ'=>'ᒌ','ᒍ'=>'ᒍ','ᒎ'=>'ᒎ','ᒏ'=>'ᒏ','ᒐ'=>'ᒐ','ᒑ'=>'ᒑ','ᒒ'=>'ᒒ','ᒓ'=>'ᒓ','ᒔ'=>'ᒔ','ᒕ'=>'ᒕ','ᒖ'=>'ᒖ','ᒗ'=>'ᒗ','ᒘ'=>'ᒘ','ᒙ'=>'ᒙ','ᒚ'=>'ᒚ','ᒛ'=>'ᒛ','ᒜ'=>'ᒜ','ᒝ'=>'ᒝ','ᒞ'=>'ᒞ','ᒟ'=>'ᒟ','ᒠ'=>'ᒠ','ᒡ'=>'ᒡ','ᒢ'=>'ᒢ','ᒣ'=>'ᒣ','ᒤ'=>'ᒤ','ᒥ'=>'ᒥ','ᒦ'=>'ᒦ','ᒧ'=>'ᒧ','ᒨ'=>'ᒨ','ᒩ'=>'ᒩ','ᒪ'=>'ᒪ','ᒫ'=>'ᒫ','ᒬ'=>'ᒬ','ᒭ'=>'ᒭ','ᒮ'=>'ᒮ','ᒯ'=>'ᒯ','ᒰ'=>'ᒰ','ᒱ'=>'ᒱ','ᒲ'=>'ᒲ','ᒳ'=>'ᒳ','ᒴ'=>'ᒴ','ᒵ'=>'ᒵ','ᒶ'=>'ᒶ','ᒷ'=>'ᒷ','ᒸ'=>'ᒸ','ᒹ'=>'ᒹ','ᒺ'=>'ᒺ','ᒻ'=>'ᒻ','ᒼ'=>'ᒼ','ᒽ'=>'ᒽ','ᒾ'=>'ᒾ','ᒿ'=>'ᒿ','ᓀ'=>'ᓀ','ᓁ'=>'ᓁ','ᓂ'=>'ᓂ','ᓃ'=>'ᓃ','ᓄ'=>'ᓄ','ᓅ'=>'ᓅ','ᓆ'=>'ᓆ','ᓇ'=>'ᓇ','ᓈ'=>'ᓈ','ᓉ'=>'ᓉ','ᓊ'=>'ᓊ','ᓋ'=>'ᓋ','ᓌ'=>'ᓌ','ᓍ'=>'ᓍ','ᓎ'=>'ᓎ','ᓏ'=>'ᓏ','ᓐ'=>'ᓐ','ᓑ'=>'ᓑ','ᓒ'=>'ᓒ','ᓓ'=>'ᓓ','ᓔ'=>'ᓔ','ᓕ'=>'ᓕ','ᓖ'=>'ᓖ','ᓗ'=>'ᓗ','ᓘ'=>'ᓘ','ᓙ'=>'ᓙ','ᓚ'=>'ᓚ','ᓛ'=>'ᓛ','ᓜ'=>'ᓜ','ᓝ'=>'ᓝ','ᓞ'=>'ᓞ','ᓟ'=>'ᓟ','ᓠ'=>'ᓠ','ᓡ'=>'ᓡ','ᓢ'=>'ᓢ','ᓣ'=>'ᓣ','ᓤ'=>'ᓤ','ᓥ'=>'ᓥ','ᓦ'=>'ᓦ','ᓧ'=>'ᓧ','ᓨ'=>'ᓨ','ᓩ'=>'ᓩ','ᓪ'=>'ᓪ','ᓫ'=>'ᓫ','ᓬ'=>'ᓬ','ᓭ'=>'ᓭ','ᓮ'=>'ᓮ','ᓯ'=>'ᓯ','ᓰ'=>'ᓰ','ᓱ'=>'ᓱ','ᓲ'=>'ᓲ','ᓳ'=>'ᓳ','ᓴ'=>'ᓴ','ᓵ'=>'ᓵ','ᓶ'=>'ᓶ','ᓷ'=>'ᓷ','ᓸ'=>'ᓸ','ᓹ'=>'ᓹ','ᓺ'=>'ᓺ','ᓻ'=>'ᓻ','ᓼ'=>'ᓼ','ᓽ'=>'ᓽ','ᓾ'=>'ᓾ','ᓿ'=>'ᓿ','ᔀ'=>'ᔀ','ᔁ'=>'ᔁ','ᔂ'=>'ᔂ','ᔃ'=>'ᔃ','ᔄ'=>'ᔄ','ᔅ'=>'ᔅ','ᔆ'=>'ᔆ','ᔇ'=>'ᔇ','ᔈ'=>'ᔈ','ᔉ'=>'ᔉ','ᔊ'=>'ᔊ','ᔋ'=>'ᔋ','ᔌ'=>'ᔌ','ᔍ'=>'ᔍ','ᔎ'=>'ᔎ','ᔏ'=>'ᔏ','ᔐ'=>'ᔐ','ᔑ'=>'ᔑ','ᔒ'=>'ᔒ','ᔓ'=>'ᔓ','ᔔ'=>'ᔔ','ᔕ'=>'ᔕ','ᔖ'=>'ᔖ','ᔗ'=>'ᔗ','ᔘ'=>'ᔘ','ᔙ'=>'ᔙ','ᔚ'=>'ᔚ','ᔛ'=>'ᔛ','ᔜ'=>'ᔜ','ᔝ'=>'ᔝ','ᔞ'=>'ᔞ','ᔟ'=>'ᔟ','ᔠ'=>'ᔠ','ᔡ'=>'ᔡ','ᔢ'=>'ᔢ','ᔣ'=>'ᔣ','ᔤ'=>'ᔤ','ᔥ'=>'ᔥ','ᔦ'=>'ᔦ','ᔧ'=>'ᔧ','ᔨ'=>'ᔨ','ᔩ'=>'ᔩ','ᔪ'=>'ᔪ','ᔫ'=>'ᔫ','ᔬ'=>'ᔬ','ᔭ'=>'ᔭ','ᔮ'=>'ᔮ','ᔯ'=>'ᔯ','ᔰ'=>'ᔰ','ᔱ'=>'ᔱ','ᔲ'=>'ᔲ','ᔳ'=>'ᔳ','ᔴ'=>'ᔴ','ᔵ'=>'ᔵ','ᔶ'=>'ᔶ','ᔷ'=>'ᔷ','ᔸ'=>'ᔸ','ᔹ'=>'ᔹ','ᔺ'=>'ᔺ','ᔻ'=>'ᔻ','ᔼ'=>'ᔼ','ᔽ'=>'ᔽ','ᔾ'=>'ᔾ','ᔿ'=>'ᔿ','ᕀ'=>'ᕀ','ᕁ'=>'ᕁ','ᕂ'=>'ᕂ','ᕃ'=>'ᕃ','ᕄ'=>'ᕄ','ᕅ'=>'ᕅ','ᕆ'=>'ᕆ','ᕇ'=>'ᕇ','ᕈ'=>'ᕈ','ᕉ'=>'ᕉ','ᕊ'=>'ᕊ','ᕋ'=>'ᕋ','ᕌ'=>'ᕌ','ᕍ'=>'ᕍ','ᕎ'=>'ᕎ','ᕏ'=>'ᕏ','ᕐ'=>'ᕐ','ᕑ'=>'ᕑ','ᕒ'=>'ᕒ','ᕓ'=>'ᕓ','ᕔ'=>'ᕔ','ᕕ'=>'ᕕ','ᕖ'=>'ᕖ','ᕗ'=>'ᕗ','ᕘ'=>'ᕘ','ᕙ'=>'ᕙ','ᕚ'=>'ᕚ','ᕛ'=>'ᕛ','ᕜ'=>'ᕜ','ᕝ'=>'ᕝ','ᕞ'=>'ᕞ','ᕟ'=>'ᕟ','ᕠ'=>'ᕠ','ᕡ'=>'ᕡ','ᕢ'=>'ᕢ','ᕣ'=>'ᕣ','ᕤ'=>'ᕤ','ᕥ'=>'ᕥ','ᕦ'=>'ᕦ','ᕧ'=>'ᕧ','ᕨ'=>'ᕨ','ᕩ'=>'ᕩ','ᕪ'=>'ᕪ','ᕫ'=>'ᕫ','ᕬ'=>'ᕬ','ᕭ'=>'ᕭ','ᕮ'=>'ᕮ','ᕯ'=>'ᕯ','ᕰ'=>'ᕰ','ᕱ'=>'ᕱ','ᕲ'=>'ᕲ','ᕳ'=>'ᕳ','ᕴ'=>'ᕴ','ᕵ'=>'ᕵ','ᕶ'=>'ᕶ','ᕷ'=>'ᕷ','ᕸ'=>'ᕸ','ᕹ'=>'ᕹ','ᕺ'=>'ᕺ','ᕻ'=>'ᕻ','ᕼ'=>'ᕼ','ᕽ'=>'ᕽ','ᕾ'=>'ᕾ','ᕿ'=>'ᕿ','ᖀ'=>'ᖀ','ᖁ'=>'ᖁ','ᖂ'=>'ᖂ','ᖃ'=>'ᖃ','ᖄ'=>'ᖄ','ᖅ'=>'ᖅ','ᖆ'=>'ᖆ','ᖇ'=>'ᖇ','ᖈ'=>'ᖈ','ᖉ'=>'ᖉ','ᖊ'=>'ᖊ','ᖋ'=>'ᖋ','ᖌ'=>'ᖌ','ᖍ'=>'ᖍ','ᖎ'=>'ᖎ','ᖏ'=>'ᖏ','ᖐ'=>'ᖐ','ᖑ'=>'ᖑ','ᖒ'=>'ᖒ','ᖓ'=>'ᖓ','ᖔ'=>'ᖔ','ᖕ'=>'ᖕ','ᖖ'=>'ᖖ','ᖗ'=>'ᖗ','ᖘ'=>'ᖘ','ᖙ'=>'ᖙ','ᖚ'=>'ᖚ','ᖛ'=>'ᖛ','ᖜ'=>'ᖜ','ᖝ'=>'ᖝ','ᖞ'=>'ᖞ','ᖟ'=>'ᖟ','ᖠ'=>'ᖠ','ᖡ'=>'ᖡ','ᖢ'=>'ᖢ','ᖣ'=>'ᖣ','ᖤ'=>'ᖤ','ᖥ'=>'ᖥ','ᖦ'=>'ᖦ','ᖧ'=>'ᖧ','ᖨ'=>'ᖨ','ᖩ'=>'ᖩ','ᖪ'=>'ᖪ','ᖫ'=>'ᖫ','ᖬ'=>'ᖬ','ᖭ'=>'ᖭ','ᖮ'=>'ᖮ','ᖯ'=>'ᖯ','ᖰ'=>'ᖰ','ᖱ'=>'ᖱ','ᖲ'=>'ᖲ','ᖳ'=>'ᖳ','ᖴ'=>'ᖴ','ᖵ'=>'ᖵ','ᖶ'=>'ᖶ','ᖷ'=>'ᖷ','ᖸ'=>'ᖸ','ᖹ'=>'ᖹ','ᖺ'=>'ᖺ','ᖻ'=>'ᖻ','ᖼ'=>'ᖼ','ᖽ'=>'ᖽ','ᖾ'=>'ᖾ','ᖿ'=>'ᖿ','ᗀ'=>'ᗀ','ᗁ'=>'ᗁ','ᗂ'=>'ᗂ','ᗃ'=>'ᗃ','ᗄ'=>'ᗄ','ᗅ'=>'ᗅ','ᗆ'=>'ᗆ','ᗇ'=>'ᗇ','ᗈ'=>'ᗈ','ᗉ'=>'ᗉ','ᗊ'=>'ᗊ','ᗋ'=>'ᗋ','ᗌ'=>'ᗌ','ᗍ'=>'ᗍ','ᗎ'=>'ᗎ','ᗏ'=>'ᗏ','ᗐ'=>'ᗐ','ᗑ'=>'ᗑ','ᗒ'=>'ᗒ','ᗓ'=>'ᗓ','ᗔ'=>'ᗔ','ᗕ'=>'ᗕ','ᗖ'=>'ᗖ','ᗗ'=>'ᗗ','ᗘ'=>'ᗘ','ᗙ'=>'ᗙ','ᗚ'=>'ᗚ','ᗛ'=>'ᗛ','ᗜ'=>'ᗜ','ᗝ'=>'ᗝ','ᗞ'=>'ᗞ','ᗟ'=>'ᗟ','ᗠ'=>'ᗠ','ᗡ'=>'ᗡ','ᗢ'=>'ᗢ','ᗣ'=>'ᗣ','ᗤ'=>'ᗤ','ᗥ'=>'ᗥ','ᗦ'=>'ᗦ','ᗧ'=>'ᗧ','ᗨ'=>'ᗨ','ᗩ'=>'ᗩ','ᗪ'=>'ᗪ','ᗫ'=>'ᗫ','ᗬ'=>'ᗬ','ᗭ'=>'ᗭ','ᗮ'=>'ᗮ','ᗯ'=>'ᗯ','ᗰ'=>'ᗰ','ᗱ'=>'ᗱ','ᗲ'=>'ᗲ','ᗳ'=>'ᗳ','ᗴ'=>'ᗴ','ᗵ'=>'ᗵ','ᗶ'=>'ᗶ','ᗷ'=>'ᗷ','ᗸ'=>'ᗸ','ᗹ'=>'ᗹ','ᗺ'=>'ᗺ','ᗻ'=>'ᗻ','ᗼ'=>'ᗼ','ᗽ'=>'ᗽ','ᗾ'=>'ᗾ','ᗿ'=>'ᗿ','ᘀ'=>'ᘀ','ᘁ'=>'ᘁ','ᘂ'=>'ᘂ','ᘃ'=>'ᘃ','ᘄ'=>'ᘄ','ᘅ'=>'ᘅ','ᘆ'=>'ᘆ','ᘇ'=>'ᘇ','ᘈ'=>'ᘈ','ᘉ'=>'ᘉ','ᘊ'=>'ᘊ','ᘋ'=>'ᘋ','ᘌ'=>'ᘌ','ᘍ'=>'ᘍ','ᘎ'=>'ᘎ','ᘏ'=>'ᘏ','ᘐ'=>'ᘐ','ᘑ'=>'ᘑ','ᘒ'=>'ᘒ','ᘓ'=>'ᘓ','ᘔ'=>'ᘔ','ᘕ'=>'ᘕ','ᘖ'=>'ᘖ','ᘗ'=>'ᘗ','ᘘ'=>'ᘘ','ᘙ'=>'ᘙ','ᘚ'=>'ᘚ','ᘛ'=>'ᘛ','ᘜ'=>'ᘜ','ᘝ'=>'ᘝ','ᘞ'=>'ᘞ','ᘟ'=>'ᘟ','ᘠ'=>'ᘠ','ᘡ'=>'ᘡ','ᘢ'=>'ᘢ','ᘣ'=>'ᘣ','ᘤ'=>'ᘤ','ᘥ'=>'ᘥ','ᘦ'=>'ᘦ','ᘧ'=>'ᘧ','ᘨ'=>'ᘨ','ᘩ'=>'ᘩ','ᘪ'=>'ᘪ','ᘫ'=>'ᘫ','ᘬ'=>'ᘬ','ᘭ'=>'ᘭ','ᘮ'=>'ᘮ','ᘯ'=>'ᘯ','ᘰ'=>'ᘰ','ᘱ'=>'ᘱ','ᘲ'=>'ᘲ','ᘳ'=>'ᘳ','ᘴ'=>'ᘴ','ᘵ'=>'ᘵ','ᘶ'=>'ᘶ','ᘷ'=>'ᘷ','ᘸ'=>'ᘸ','ᘹ'=>'ᘹ','ᘺ'=>'ᘺ','ᘻ'=>'ᘻ','ᘼ'=>'ᘼ','ᘽ'=>'ᘽ','ᘾ'=>'ᘾ','ᘿ'=>'ᘿ','ᙀ'=>'ᙀ','ᙁ'=>'ᙁ','ᙂ'=>'ᙂ','ᙃ'=>'ᙃ','ᙄ'=>'ᙄ','ᙅ'=>'ᙅ','ᙆ'=>'ᙆ','ᙇ'=>'ᙇ','ᙈ'=>'ᙈ','ᙉ'=>'ᙉ','ᙊ'=>'ᙊ','ᙋ'=>'ᙋ','ᙌ'=>'ᙌ','ᙍ'=>'ᙍ','ᙎ'=>'ᙎ','ᙏ'=>'ᙏ','ᙐ'=>'ᙐ','ᙑ'=>'ᙑ','ᙒ'=>'ᙒ','ᙓ'=>'ᙓ','ᙔ'=>'ᙔ','ᙕ'=>'ᙕ','ᙖ'=>'ᙖ','ᙗ'=>'ᙗ','ᙘ'=>'ᙘ','ᙙ'=>'ᙙ','ᙚ'=>'ᙚ','ᙛ'=>'ᙛ','ᙜ'=>'ᙜ','ᙝ'=>'ᙝ','ᙞ'=>'ᙞ','ᙟ'=>'ᙟ','ᙠ'=>'ᙠ','ᙡ'=>'ᙡ','ᙢ'=>'ᙢ','ᙣ'=>'ᙣ','ᙤ'=>'ᙤ','ᙥ'=>'ᙥ','ᙦ'=>'ᙦ','ᙧ'=>'ᙧ','ᙨ'=>'ᙨ','ᙩ'=>'ᙩ','ᙪ'=>'ᙪ','ᙫ'=>'ᙫ','ᙬ'=>'ᙬ','ᙯ'=>'ᙯ','ᙰ'=>'ᙰ','ᙱ'=>'ᙱ','ᙲ'=>'ᙲ','ᙳ'=>'ᙳ','ᙴ'=>'ᙴ','ᙵ'=>'ᙵ','ᙶ'=>'ᙶ','ᚁ'=>'ᚁ','ᚂ'=>'ᚂ','ᚃ'=>'ᚃ','ᚄ'=>'ᚄ','ᚅ'=>'ᚅ','ᚆ'=>'ᚆ','ᚇ'=>'ᚇ','ᚈ'=>'ᚈ','ᚉ'=>'ᚉ','ᚊ'=>'ᚊ','ᚋ'=>'ᚋ','ᚌ'=>'ᚌ','ᚍ'=>'ᚍ','ᚎ'=>'ᚎ','ᚏ'=>'ᚏ','ᚐ'=>'ᚐ','ᚑ'=>'ᚑ','ᚒ'=>'ᚒ','ᚓ'=>'ᚓ','ᚔ'=>'ᚔ','ᚕ'=>'ᚕ','ᚖ'=>'ᚖ','ᚗ'=>'ᚗ','ᚘ'=>'ᚘ','ᚙ'=>'ᚙ','ᚚ'=>'ᚚ','ᚠ'=>'ᚠ','ᚡ'=>'ᚡ','ᚢ'=>'ᚢ','ᚣ'=>'ᚣ','ᚤ'=>'ᚤ','ᚥ'=>'ᚥ','ᚦ'=>'ᚦ','ᚧ'=>'ᚧ','ᚨ'=>'ᚨ','ᚩ'=>'ᚩ','ᚪ'=>'ᚪ','ᚫ'=>'ᚫ','ᚬ'=>'ᚬ','ᚭ'=>'ᚭ','ᚮ'=>'ᚮ','ᚯ'=>'ᚯ','ᚰ'=>'ᚰ','ᚱ'=>'ᚱ','ᚲ'=>'ᚲ','ᚳ'=>'ᚳ','ᚴ'=>'ᚴ','ᚵ'=>'ᚵ','ᚶ'=>'ᚶ','ᚷ'=>'ᚷ','ᚸ'=>'ᚸ','ᚹ'=>'ᚹ','ᚺ'=>'ᚺ','ᚻ'=>'ᚻ','ᚼ'=>'ᚼ','ᚽ'=>'ᚽ','ᚾ'=>'ᚾ','ᚿ'=>'ᚿ','ᛀ'=>'ᛀ','ᛁ'=>'ᛁ','ᛂ'=>'ᛂ','ᛃ'=>'ᛃ','ᛄ'=>'ᛄ','ᛅ'=>'ᛅ','ᛆ'=>'ᛆ','ᛇ'=>'ᛇ','ᛈ'=>'ᛈ','ᛉ'=>'ᛉ','ᛊ'=>'ᛊ','ᛋ'=>'ᛋ','ᛌ'=>'ᛌ','ᛍ'=>'ᛍ','ᛎ'=>'ᛎ','ᛏ'=>'ᛏ','ᛐ'=>'ᛐ','ᛑ'=>'ᛑ','ᛒ'=>'ᛒ','ᛓ'=>'ᛓ','ᛔ'=>'ᛔ','ᛕ'=>'ᛕ','ᛖ'=>'ᛖ','ᛗ'=>'ᛗ','ᛘ'=>'ᛘ','ᛙ'=>'ᛙ','ᛚ'=>'ᛚ','ᛛ'=>'ᛛ','ᛜ'=>'ᛜ','ᛝ'=>'ᛝ','ᛞ'=>'ᛞ','ᛟ'=>'ᛟ','ᛠ'=>'ᛠ','ᛡ'=>'ᛡ','ᛢ'=>'ᛢ','ᛣ'=>'ᛣ','ᛤ'=>'ᛤ','ᛥ'=>'ᛥ','ᛦ'=>'ᛦ','ᛧ'=>'ᛧ','ᛨ'=>'ᛨ','ᛩ'=>'ᛩ','ᛪ'=>'ᛪ','ᛮ'=>'17','ᛯ'=>'18','ᛰ'=>'19','ᜀ'=>'ᜀ','ᜁ'=>'ᜁ','ᜂ'=>'ᜂ','ᜃ'=>'ᜃ','ᜄ'=>'ᜄ','ᜅ'=>'ᜅ','ᜆ'=>'ᜆ','ᜇ'=>'ᜇ','ᜈ'=>'ᜈ','ᜉ'=>'ᜉ','ᜊ'=>'ᜊ','ᜋ'=>'ᜋ','ᜌ'=>'ᜌ','ᜎ'=>'ᜎ','ᜏ'=>'ᜏ','ᜐ'=>'ᜐ','ᜑ'=>'ᜑ','ᜒ'=>'ᜒ','ᜓ'=>'ᜓ','᜔'=>'᜔','ᜠ'=>'ᜠ','ᜡ'=>'ᜡ','ᜢ'=>'ᜢ','ᜣ'=>'ᜣ','ᜤ'=>'ᜤ','ᜥ'=>'ᜥ','ᜦ'=>'ᜦ','ᜧ'=>'ᜧ','ᜨ'=>'ᜨ','ᜩ'=>'ᜩ','ᜪ'=>'ᜪ','ᜫ'=>'ᜫ','ᜬ'=>'ᜬ','ᜭ'=>'ᜭ','ᜮ'=>'ᜮ','ᜯ'=>'ᜯ','ᜰ'=>'ᜰ','ᜱ'=>'ᜱ','ᜲ'=>'ᜲ','ᜳ'=>'ᜳ','᜴'=>'᜴','ᝀ'=>'ᝀ','ᝁ'=>'ᝁ','ᝂ'=>'ᝂ','ᝃ'=>'ᝃ','ᝄ'=>'ᝄ','ᝅ'=>'ᝅ','ᝆ'=>'ᝆ','ᝇ'=>'ᝇ','ᝈ'=>'ᝈ','ᝉ'=>'ᝉ','ᝊ'=>'ᝊ','ᝋ'=>'ᝋ','ᝌ'=>'ᝌ','ᝍ'=>'ᝍ','ᝎ'=>'ᝎ','ᝏ'=>'ᝏ','ᝐ'=>'ᝐ','ᝑ'=>'ᝑ','ᝒ'=>'ᝒ','ᝓ'=>'ᝓ','ᝠ'=>'ᝠ','ᝡ'=>'ᝡ','ᝢ'=>'ᝢ','ᝣ'=>'ᝣ','ᝤ'=>'ᝤ','ᝥ'=>'ᝥ','ᝦ'=>'ᝦ','ᝧ'=>'ᝧ','ᝨ'=>'ᝨ','ᝩ'=>'ᝩ','ᝪ'=>'ᝪ','ᝫ'=>'ᝫ','ᝬ'=>'ᝬ','ᝮ'=>'ᝮ','ᝯ'=>'ᝯ','ᝰ'=>'ᝰ','ᝲ'=>'ᝲ','ᝳ'=>'ᝳ','ក'=>'ក','ខ'=>'ខ','គ'=>'គ','ឃ'=>'ឃ','ង'=>'ង','ច'=>'ច','ឆ'=>'ឆ','ជ'=>'ជ','ឈ'=>'ឈ','ញ'=>'ញ','ដ'=>'ដ','ឋ'=>'ឋ','ឌ'=>'ឌ','ឍ'=>'ឍ','ណ'=>'ណ','ត'=>'ត','ថ'=>'ថ','ទ'=>'ទ','ធ'=>'ធ','ន'=>'ន','ប'=>'ប','ផ'=>'ផ','ព'=>'ព','ភ'=>'ភ','ម'=>'ម','យ'=>'យ','រ'=>'រ','ល'=>'ល','វ'=>'វ','ឝ'=>'ឝ','ឞ'=>'ឞ','ស'=>'ស','ហ'=>'ហ','ឡ'=>'ឡ','អ'=>'អ','ឣ'=>'ឣ','ឤ'=>'ឤ','ឥ'=>'ឥ','ឦ'=>'ឦ','ឧ'=>'ឧ','ឨ'=>'ឨ','ឩ'=>'ឩ','ឪ'=>'ឪ','ឫ'=>'ឫ','ឬ'=>'ឬ','ឭ'=>'ឭ','ឮ'=>'ឮ','ឯ'=>'ឯ','ឰ'=>'ឰ','ឱ'=>'ឱ','ឲ'=>'ឲ','ឳ'=>'ឳ','ា'=>'ា','ិ'=>'ិ','ី'=>'ី','ឹ'=>'ឹ','ឺ'=>'ឺ','ុ'=>'ុ','ូ'=>'ូ','ួ'=>'ួ','ើ'=>'ើ','ឿ'=>'ឿ','ៀ'=>'ៀ','េ'=>'េ','ែ'=>'ែ','ៃ'=>'ៃ','ោ'=>'ោ','ៅ'=>'ៅ','ំ'=>'ំ','ះ'=>'ះ','ៈ'=>'ៈ','៉'=>'៉','៊'=>'៊','់'=>'់','៌'=>'៌','៍'=>'៍','៎'=>'៎','៏'=>'៏','័'=>'័','៑'=>'៑','្'=>'្','៓'=>'៓','ៗ'=>'ៗ','ៜ'=>'ៜ','៝'=>'៝','០'=>'0','១'=>'1','២'=>'2','៣'=>'3','៤'=>'4','៥'=>'5','៦'=>'6','៧'=>'7','៨'=>'8','៩'=>'9','៰'=>'0','៱'=>'1','៲'=>'2','៳'=>'3','៴'=>'4','៵'=>'5','៶'=>'6','៷'=>'7','៸'=>'8','៹'=>'9');
diff --git a/phpBB/includes/utf/data/search_indexer_20.php b/phpBB/includes/utf/data/search_indexer_20.php
index caab3c540b..0d2dfa6340 100644
--- a/phpBB/includes/utf/data/search_indexer_20.php
+++ b/phpBB/includes/utf/data/search_indexer_20.php
@@ -1 +1 @@
-<?php return array('ꀀ'=>'ꀀ','ꀁ'=>'ꀁ','ꀂ'=>'ꀂ','ꀃ'=>'ꀃ','ꀄ'=>'ꀄ','ꀅ'=>'ꀅ','ꀆ'=>'ꀆ','ꀇ'=>'ꀇ','ꀈ'=>'ꀈ','ꀉ'=>'ꀉ','ꀊ'=>'ꀊ','ꀋ'=>'ꀋ','ꀌ'=>'ꀌ','ꀍ'=>'ꀍ','ꀎ'=>'ꀎ','ꀏ'=>'ꀏ','ꀐ'=>'ꀐ','ꀑ'=>'ꀑ','ꀒ'=>'ꀒ','ꀓ'=>'ꀓ','ꀔ'=>'ꀔ','ꀕ'=>'ꀕ','ꀖ'=>'ꀖ','ꀗ'=>'ꀗ','ꀘ'=>'ꀘ','ꀙ'=>'ꀙ','ꀚ'=>'ꀚ','ꀛ'=>'ꀛ','ꀜ'=>'ꀜ','ꀝ'=>'ꀝ','ꀞ'=>'ꀞ','ꀟ'=>'ꀟ','ꀠ'=>'ꀠ','ꀡ'=>'ꀡ','ꀢ'=>'ꀢ','ꀣ'=>'ꀣ','ꀤ'=>'ꀤ','ꀥ'=>'ꀥ','ꀦ'=>'ꀦ','ꀧ'=>'ꀧ','ꀨ'=>'ꀨ','ꀩ'=>'ꀩ','ꀪ'=>'ꀪ','ꀫ'=>'ꀫ','ꀬ'=>'ꀬ','ꀭ'=>'ꀭ','ꀮ'=>'ꀮ','ꀯ'=>'ꀯ','ꀰ'=>'ꀰ','ꀱ'=>'ꀱ','ꀲ'=>'ꀲ','ꀳ'=>'ꀳ','ꀴ'=>'ꀴ','ꀵ'=>'ꀵ','ꀶ'=>'ꀶ','ꀷ'=>'ꀷ','ꀸ'=>'ꀸ','ꀹ'=>'ꀹ','ꀺ'=>'ꀺ','ꀻ'=>'ꀻ','ꀼ'=>'ꀼ','ꀽ'=>'ꀽ','ꀾ'=>'ꀾ','ꀿ'=>'ꀿ','ꁀ'=>'ꁀ','ꁁ'=>'ꁁ','ꁂ'=>'ꁂ','ꁃ'=>'ꁃ','ꁄ'=>'ꁄ','ꁅ'=>'ꁅ','ꁆ'=>'ꁆ','ꁇ'=>'ꁇ','ꁈ'=>'ꁈ','ꁉ'=>'ꁉ','ꁊ'=>'ꁊ','ꁋ'=>'ꁋ','ꁌ'=>'ꁌ','ꁍ'=>'ꁍ','ꁎ'=>'ꁎ','ꁏ'=>'ꁏ','ꁐ'=>'ꁐ','ꁑ'=>'ꁑ','ꁒ'=>'ꁒ','ꁓ'=>'ꁓ','ꁔ'=>'ꁔ','ꁕ'=>'ꁕ','ꁖ'=>'ꁖ','ꁗ'=>'ꁗ','ꁘ'=>'ꁘ','ꁙ'=>'ꁙ','ꁚ'=>'ꁚ','ꁛ'=>'ꁛ','ꁜ'=>'ꁜ','ꁝ'=>'ꁝ','ꁞ'=>'ꁞ','ꁟ'=>'ꁟ','ꁠ'=>'ꁠ','ꁡ'=>'ꁡ','ꁢ'=>'ꁢ','ꁣ'=>'ꁣ','ꁤ'=>'ꁤ','ꁥ'=>'ꁥ','ꁦ'=>'ꁦ','ꁧ'=>'ꁧ','ꁨ'=>'ꁨ','ꁩ'=>'ꁩ','ꁪ'=>'ꁪ','ꁫ'=>'ꁫ','ꁬ'=>'ꁬ','ꁭ'=>'ꁭ','ꁮ'=>'ꁮ','ꁯ'=>'ꁯ','ꁰ'=>'ꁰ','ꁱ'=>'ꁱ','ꁲ'=>'ꁲ','ꁳ'=>'ꁳ','ꁴ'=>'ꁴ','ꁵ'=>'ꁵ','ꁶ'=>'ꁶ','ꁷ'=>'ꁷ','ꁸ'=>'ꁸ','ꁹ'=>'ꁹ','ꁺ'=>'ꁺ','ꁻ'=>'ꁻ','ꁼ'=>'ꁼ','ꁽ'=>'ꁽ','ꁾ'=>'ꁾ','ꁿ'=>'ꁿ','ꂀ'=>'ꂀ','ꂁ'=>'ꂁ','ꂂ'=>'ꂂ','ꂃ'=>'ꂃ','ꂄ'=>'ꂄ','ꂅ'=>'ꂅ','ꂆ'=>'ꂆ','ꂇ'=>'ꂇ','ꂈ'=>'ꂈ','ꂉ'=>'ꂉ','ꂊ'=>'ꂊ','ꂋ'=>'ꂋ','ꂌ'=>'ꂌ','ꂍ'=>'ꂍ','ꂎ'=>'ꂎ','ꂏ'=>'ꂏ','ꂐ'=>'ꂐ','ꂑ'=>'ꂑ','ꂒ'=>'ꂒ','ꂓ'=>'ꂓ','ꂔ'=>'ꂔ','ꂕ'=>'ꂕ','ꂖ'=>'ꂖ','ꂗ'=>'ꂗ','ꂘ'=>'ꂘ','ꂙ'=>'ꂙ','ꂚ'=>'ꂚ','ꂛ'=>'ꂛ','ꂜ'=>'ꂜ','ꂝ'=>'ꂝ','ꂞ'=>'ꂞ','ꂟ'=>'ꂟ','ꂠ'=>'ꂠ','ꂡ'=>'ꂡ','ꂢ'=>'ꂢ','ꂣ'=>'ꂣ','ꂤ'=>'ꂤ','ꂥ'=>'ꂥ','ꂦ'=>'ꂦ','ꂧ'=>'ꂧ','ꂨ'=>'ꂨ','ꂩ'=>'ꂩ','ꂪ'=>'ꂪ','ꂫ'=>'ꂫ','ꂬ'=>'ꂬ','ꂭ'=>'ꂭ','ꂮ'=>'ꂮ','ꂯ'=>'ꂯ','ꂰ'=>'ꂰ','ꂱ'=>'ꂱ','ꂲ'=>'ꂲ','ꂳ'=>'ꂳ','ꂴ'=>'ꂴ','ꂵ'=>'ꂵ','ꂶ'=>'ꂶ','ꂷ'=>'ꂷ','ꂸ'=>'ꂸ','ꂹ'=>'ꂹ','ꂺ'=>'ꂺ','ꂻ'=>'ꂻ','ꂼ'=>'ꂼ','ꂽ'=>'ꂽ','ꂾ'=>'ꂾ','ꂿ'=>'ꂿ','ꃀ'=>'ꃀ','ꃁ'=>'ꃁ','ꃂ'=>'ꃂ','ꃃ'=>'ꃃ','ꃄ'=>'ꃄ','ꃅ'=>'ꃅ','ꃆ'=>'ꃆ','ꃇ'=>'ꃇ','ꃈ'=>'ꃈ','ꃉ'=>'ꃉ','ꃊ'=>'ꃊ','ꃋ'=>'ꃋ','ꃌ'=>'ꃌ','ꃍ'=>'ꃍ','ꃎ'=>'ꃎ','ꃏ'=>'ꃏ','ꃐ'=>'ꃐ','ꃑ'=>'ꃑ','ꃒ'=>'ꃒ','ꃓ'=>'ꃓ','ꃔ'=>'ꃔ','ꃕ'=>'ꃕ','ꃖ'=>'ꃖ','ꃗ'=>'ꃗ','ꃘ'=>'ꃘ','ꃙ'=>'ꃙ','ꃚ'=>'ꃚ','ꃛ'=>'ꃛ','ꃜ'=>'ꃜ','ꃝ'=>'ꃝ','ꃞ'=>'ꃞ','ꃟ'=>'ꃟ','ꃠ'=>'ꃠ','ꃡ'=>'ꃡ','ꃢ'=>'ꃢ','ꃣ'=>'ꃣ','ꃤ'=>'ꃤ','ꃥ'=>'ꃥ','ꃦ'=>'ꃦ','ꃧ'=>'ꃧ','ꃨ'=>'ꃨ','ꃩ'=>'ꃩ','ꃪ'=>'ꃪ','ꃫ'=>'ꃫ','ꃬ'=>'ꃬ','ꃭ'=>'ꃭ','ꃮ'=>'ꃮ','ꃯ'=>'ꃯ','ꃰ'=>'ꃰ','ꃱ'=>'ꃱ','ꃲ'=>'ꃲ','ꃳ'=>'ꃳ','ꃴ'=>'ꃴ','ꃵ'=>'ꃵ','ꃶ'=>'ꃶ','ꃷ'=>'ꃷ','ꃸ'=>'ꃸ','ꃹ'=>'ꃹ','ꃺ'=>'ꃺ','ꃻ'=>'ꃻ','ꃼ'=>'ꃼ','ꃽ'=>'ꃽ','ꃾ'=>'ꃾ','ꃿ'=>'ꃿ','ꄀ'=>'ꄀ','ꄁ'=>'ꄁ','ꄂ'=>'ꄂ','ꄃ'=>'ꄃ','ꄄ'=>'ꄄ','ꄅ'=>'ꄅ','ꄆ'=>'ꄆ','ꄇ'=>'ꄇ','ꄈ'=>'ꄈ','ꄉ'=>'ꄉ','ꄊ'=>'ꄊ','ꄋ'=>'ꄋ','ꄌ'=>'ꄌ','ꄍ'=>'ꄍ','ꄎ'=>'ꄎ','ꄏ'=>'ꄏ','ꄐ'=>'ꄐ','ꄑ'=>'ꄑ','ꄒ'=>'ꄒ','ꄓ'=>'ꄓ','ꄔ'=>'ꄔ','ꄕ'=>'ꄕ','ꄖ'=>'ꄖ','ꄗ'=>'ꄗ','ꄘ'=>'ꄘ','ꄙ'=>'ꄙ','ꄚ'=>'ꄚ','ꄛ'=>'ꄛ','ꄜ'=>'ꄜ','ꄝ'=>'ꄝ','ꄞ'=>'ꄞ','ꄟ'=>'ꄟ','ꄠ'=>'ꄠ','ꄡ'=>'ꄡ','ꄢ'=>'ꄢ','ꄣ'=>'ꄣ','ꄤ'=>'ꄤ','ꄥ'=>'ꄥ','ꄦ'=>'ꄦ','ꄧ'=>'ꄧ','ꄨ'=>'ꄨ','ꄩ'=>'ꄩ','ꄪ'=>'ꄪ','ꄫ'=>'ꄫ','ꄬ'=>'ꄬ','ꄭ'=>'ꄭ','ꄮ'=>'ꄮ','ꄯ'=>'ꄯ','ꄰ'=>'ꄰ','ꄱ'=>'ꄱ','ꄲ'=>'ꄲ','ꄳ'=>'ꄳ','ꄴ'=>'ꄴ','ꄵ'=>'ꄵ','ꄶ'=>'ꄶ','ꄷ'=>'ꄷ','ꄸ'=>'ꄸ','ꄹ'=>'ꄹ','ꄺ'=>'ꄺ','ꄻ'=>'ꄻ','ꄼ'=>'ꄼ','ꄽ'=>'ꄽ','ꄾ'=>'ꄾ','ꄿ'=>'ꄿ','ꅀ'=>'ꅀ','ꅁ'=>'ꅁ','ꅂ'=>'ꅂ','ꅃ'=>'ꅃ','ꅄ'=>'ꅄ','ꅅ'=>'ꅅ','ꅆ'=>'ꅆ','ꅇ'=>'ꅇ','ꅈ'=>'ꅈ','ꅉ'=>'ꅉ','ꅊ'=>'ꅊ','ꅋ'=>'ꅋ','ꅌ'=>'ꅌ','ꅍ'=>'ꅍ','ꅎ'=>'ꅎ','ꅏ'=>'ꅏ','ꅐ'=>'ꅐ','ꅑ'=>'ꅑ','ꅒ'=>'ꅒ','ꅓ'=>'ꅓ','ꅔ'=>'ꅔ','ꅕ'=>'ꅕ','ꅖ'=>'ꅖ','ꅗ'=>'ꅗ','ꅘ'=>'ꅘ','ꅙ'=>'ꅙ','ꅚ'=>'ꅚ','ꅛ'=>'ꅛ','ꅜ'=>'ꅜ','ꅝ'=>'ꅝ','ꅞ'=>'ꅞ','ꅟ'=>'ꅟ','ꅠ'=>'ꅠ','ꅡ'=>'ꅡ','ꅢ'=>'ꅢ','ꅣ'=>'ꅣ','ꅤ'=>'ꅤ','ꅥ'=>'ꅥ','ꅦ'=>'ꅦ','ꅧ'=>'ꅧ','ꅨ'=>'ꅨ','ꅩ'=>'ꅩ','ꅪ'=>'ꅪ','ꅫ'=>'ꅫ','ꅬ'=>'ꅬ','ꅭ'=>'ꅭ','ꅮ'=>'ꅮ','ꅯ'=>'ꅯ','ꅰ'=>'ꅰ','ꅱ'=>'ꅱ','ꅲ'=>'ꅲ','ꅳ'=>'ꅳ','ꅴ'=>'ꅴ','ꅵ'=>'ꅵ','ꅶ'=>'ꅶ','ꅷ'=>'ꅷ','ꅸ'=>'ꅸ','ꅹ'=>'ꅹ','ꅺ'=>'ꅺ','ꅻ'=>'ꅻ','ꅼ'=>'ꅼ','ꅽ'=>'ꅽ','ꅾ'=>'ꅾ','ꅿ'=>'ꅿ','ꆀ'=>'ꆀ','ꆁ'=>'ꆁ','ꆂ'=>'ꆂ','ꆃ'=>'ꆃ','ꆄ'=>'ꆄ','ꆅ'=>'ꆅ','ꆆ'=>'ꆆ','ꆇ'=>'ꆇ','ꆈ'=>'ꆈ','ꆉ'=>'ꆉ','ꆊ'=>'ꆊ','ꆋ'=>'ꆋ','ꆌ'=>'ꆌ','ꆍ'=>'ꆍ','ꆎ'=>'ꆎ','ꆏ'=>'ꆏ','ꆐ'=>'ꆐ','ꆑ'=>'ꆑ','ꆒ'=>'ꆒ','ꆓ'=>'ꆓ','ꆔ'=>'ꆔ','ꆕ'=>'ꆕ','ꆖ'=>'ꆖ','ꆗ'=>'ꆗ','ꆘ'=>'ꆘ','ꆙ'=>'ꆙ','ꆚ'=>'ꆚ','ꆛ'=>'ꆛ','ꆜ'=>'ꆜ','ꆝ'=>'ꆝ','ꆞ'=>'ꆞ','ꆟ'=>'ꆟ','ꆠ'=>'ꆠ','ꆡ'=>'ꆡ','ꆢ'=>'ꆢ','ꆣ'=>'ꆣ','ꆤ'=>'ꆤ','ꆥ'=>'ꆥ','ꆦ'=>'ꆦ','ꆧ'=>'ꆧ','ꆨ'=>'ꆨ','ꆩ'=>'ꆩ','ꆪ'=>'ꆪ','ꆫ'=>'ꆫ','ꆬ'=>'ꆬ','ꆭ'=>'ꆭ','ꆮ'=>'ꆮ','ꆯ'=>'ꆯ','ꆰ'=>'ꆰ','ꆱ'=>'ꆱ','ꆲ'=>'ꆲ','ꆳ'=>'ꆳ','ꆴ'=>'ꆴ','ꆵ'=>'ꆵ','ꆶ'=>'ꆶ','ꆷ'=>'ꆷ','ꆸ'=>'ꆸ','ꆹ'=>'ꆹ','ꆺ'=>'ꆺ','ꆻ'=>'ꆻ','ꆼ'=>'ꆼ','ꆽ'=>'ꆽ','ꆾ'=>'ꆾ','ꆿ'=>'ꆿ','ꇀ'=>'ꇀ','ꇁ'=>'ꇁ','ꇂ'=>'ꇂ','ꇃ'=>'ꇃ','ꇄ'=>'ꇄ','ꇅ'=>'ꇅ','ꇆ'=>'ꇆ','ꇇ'=>'ꇇ','ꇈ'=>'ꇈ','ꇉ'=>'ꇉ','ꇊ'=>'ꇊ','ꇋ'=>'ꇋ','ꇌ'=>'ꇌ','ꇍ'=>'ꇍ','ꇎ'=>'ꇎ','ꇏ'=>'ꇏ','ꇐ'=>'ꇐ','ꇑ'=>'ꇑ','ꇒ'=>'ꇒ','ꇓ'=>'ꇓ','ꇔ'=>'ꇔ','ꇕ'=>'ꇕ','ꇖ'=>'ꇖ','ꇗ'=>'ꇗ','ꇘ'=>'ꇘ','ꇙ'=>'ꇙ','ꇚ'=>'ꇚ','ꇛ'=>'ꇛ','ꇜ'=>'ꇜ','ꇝ'=>'ꇝ','ꇞ'=>'ꇞ','ꇟ'=>'ꇟ','ꇠ'=>'ꇠ','ꇡ'=>'ꇡ','ꇢ'=>'ꇢ','ꇣ'=>'ꇣ','ꇤ'=>'ꇤ','ꇥ'=>'ꇥ','ꇦ'=>'ꇦ','ꇧ'=>'ꇧ','ꇨ'=>'ꇨ','ꇩ'=>'ꇩ','ꇪ'=>'ꇪ','ꇫ'=>'ꇫ','ꇬ'=>'ꇬ','ꇭ'=>'ꇭ','ꇮ'=>'ꇮ','ꇯ'=>'ꇯ','ꇰ'=>'ꇰ','ꇱ'=>'ꇱ','ꇲ'=>'ꇲ','ꇳ'=>'ꇳ','ꇴ'=>'ꇴ','ꇵ'=>'ꇵ','ꇶ'=>'ꇶ','ꇷ'=>'ꇷ','ꇸ'=>'ꇸ','ꇹ'=>'ꇹ','ꇺ'=>'ꇺ','ꇻ'=>'ꇻ','ꇼ'=>'ꇼ','ꇽ'=>'ꇽ','ꇾ'=>'ꇾ','ꇿ'=>'ꇿ','ꈀ'=>'ꈀ','ꈁ'=>'ꈁ','ꈂ'=>'ꈂ','ꈃ'=>'ꈃ','ꈄ'=>'ꈄ','ꈅ'=>'ꈅ','ꈆ'=>'ꈆ','ꈇ'=>'ꈇ','ꈈ'=>'ꈈ','ꈉ'=>'ꈉ','ꈊ'=>'ꈊ','ꈋ'=>'ꈋ','ꈌ'=>'ꈌ','ꈍ'=>'ꈍ','ꈎ'=>'ꈎ','ꈏ'=>'ꈏ','ꈐ'=>'ꈐ','ꈑ'=>'ꈑ','ꈒ'=>'ꈒ','ꈓ'=>'ꈓ','ꈔ'=>'ꈔ','ꈕ'=>'ꈕ','ꈖ'=>'ꈖ','ꈗ'=>'ꈗ','ꈘ'=>'ꈘ','ꈙ'=>'ꈙ','ꈚ'=>'ꈚ','ꈛ'=>'ꈛ','ꈜ'=>'ꈜ','ꈝ'=>'ꈝ','ꈞ'=>'ꈞ','ꈟ'=>'ꈟ','ꈠ'=>'ꈠ','ꈡ'=>'ꈡ','ꈢ'=>'ꈢ','ꈣ'=>'ꈣ','ꈤ'=>'ꈤ','ꈥ'=>'ꈥ','ꈦ'=>'ꈦ','ꈧ'=>'ꈧ','ꈨ'=>'ꈨ','ꈩ'=>'ꈩ','ꈪ'=>'ꈪ','ꈫ'=>'ꈫ','ꈬ'=>'ꈬ','ꈭ'=>'ꈭ','ꈮ'=>'ꈮ','ꈯ'=>'ꈯ','ꈰ'=>'ꈰ','ꈱ'=>'ꈱ','ꈲ'=>'ꈲ','ꈳ'=>'ꈳ','ꈴ'=>'ꈴ','ꈵ'=>'ꈵ','ꈶ'=>'ꈶ','ꈷ'=>'ꈷ','ꈸ'=>'ꈸ','ꈹ'=>'ꈹ','ꈺ'=>'ꈺ','ꈻ'=>'ꈻ','ꈼ'=>'ꈼ','ꈽ'=>'ꈽ','ꈾ'=>'ꈾ','ꈿ'=>'ꈿ','ꉀ'=>'ꉀ','ꉁ'=>'ꉁ','ꉂ'=>'ꉂ','ꉃ'=>'ꉃ','ꉄ'=>'ꉄ','ꉅ'=>'ꉅ','ꉆ'=>'ꉆ','ꉇ'=>'ꉇ','ꉈ'=>'ꉈ','ꉉ'=>'ꉉ','ꉊ'=>'ꉊ','ꉋ'=>'ꉋ','ꉌ'=>'ꉌ','ꉍ'=>'ꉍ','ꉎ'=>'ꉎ','ꉏ'=>'ꉏ','ꉐ'=>'ꉐ','ꉑ'=>'ꉑ','ꉒ'=>'ꉒ','ꉓ'=>'ꉓ','ꉔ'=>'ꉔ','ꉕ'=>'ꉕ','ꉖ'=>'ꉖ','ꉗ'=>'ꉗ','ꉘ'=>'ꉘ','ꉙ'=>'ꉙ','ꉚ'=>'ꉚ','ꉛ'=>'ꉛ','ꉜ'=>'ꉜ','ꉝ'=>'ꉝ','ꉞ'=>'ꉞ','ꉟ'=>'ꉟ','ꉠ'=>'ꉠ','ꉡ'=>'ꉡ','ꉢ'=>'ꉢ','ꉣ'=>'ꉣ','ꉤ'=>'ꉤ','ꉥ'=>'ꉥ','ꉦ'=>'ꉦ','ꉧ'=>'ꉧ','ꉨ'=>'ꉨ','ꉩ'=>'ꉩ','ꉪ'=>'ꉪ','ꉫ'=>'ꉫ','ꉬ'=>'ꉬ','ꉭ'=>'ꉭ','ꉮ'=>'ꉮ','ꉯ'=>'ꉯ','ꉰ'=>'ꉰ','ꉱ'=>'ꉱ','ꉲ'=>'ꉲ','ꉳ'=>'ꉳ','ꉴ'=>'ꉴ','ꉵ'=>'ꉵ','ꉶ'=>'ꉶ','ꉷ'=>'ꉷ','ꉸ'=>'ꉸ','ꉹ'=>'ꉹ','ꉺ'=>'ꉺ','ꉻ'=>'ꉻ','ꉼ'=>'ꉼ','ꉽ'=>'ꉽ','ꉾ'=>'ꉾ','ꉿ'=>'ꉿ','ꊀ'=>'ꊀ','ꊁ'=>'ꊁ','ꊂ'=>'ꊂ','ꊃ'=>'ꊃ','ꊄ'=>'ꊄ','ꊅ'=>'ꊅ','ꊆ'=>'ꊆ','ꊇ'=>'ꊇ','ꊈ'=>'ꊈ','ꊉ'=>'ꊉ','ꊊ'=>'ꊊ','ꊋ'=>'ꊋ','ꊌ'=>'ꊌ','ꊍ'=>'ꊍ','ꊎ'=>'ꊎ','ꊏ'=>'ꊏ','ꊐ'=>'ꊐ','ꊑ'=>'ꊑ','ꊒ'=>'ꊒ','ꊓ'=>'ꊓ','ꊔ'=>'ꊔ','ꊕ'=>'ꊕ','ꊖ'=>'ꊖ','ꊗ'=>'ꊗ','ꊘ'=>'ꊘ','ꊙ'=>'ꊙ','ꊚ'=>'ꊚ','ꊛ'=>'ꊛ','ꊜ'=>'ꊜ','ꊝ'=>'ꊝ','ꊞ'=>'ꊞ','ꊟ'=>'ꊟ','ꊠ'=>'ꊠ','ꊡ'=>'ꊡ','ꊢ'=>'ꊢ','ꊣ'=>'ꊣ','ꊤ'=>'ꊤ','ꊥ'=>'ꊥ','ꊦ'=>'ꊦ','ꊧ'=>'ꊧ','ꊨ'=>'ꊨ','ꊩ'=>'ꊩ','ꊪ'=>'ꊪ','ꊫ'=>'ꊫ','ꊬ'=>'ꊬ','ꊭ'=>'ꊭ','ꊮ'=>'ꊮ','ꊯ'=>'ꊯ','ꊰ'=>'ꊰ','ꊱ'=>'ꊱ','ꊲ'=>'ꊲ','ꊳ'=>'ꊳ','ꊴ'=>'ꊴ','ꊵ'=>'ꊵ','ꊶ'=>'ꊶ','ꊷ'=>'ꊷ','ꊸ'=>'ꊸ','ꊹ'=>'ꊹ','ꊺ'=>'ꊺ','ꊻ'=>'ꊻ','ꊼ'=>'ꊼ','ꊽ'=>'ꊽ','ꊾ'=>'ꊾ','ꊿ'=>'ꊿ','ꋀ'=>'ꋀ','ꋁ'=>'ꋁ','ꋂ'=>'ꋂ','ꋃ'=>'ꋃ','ꋄ'=>'ꋄ','ꋅ'=>'ꋅ','ꋆ'=>'ꋆ','ꋇ'=>'ꋇ','ꋈ'=>'ꋈ','ꋉ'=>'ꋉ','ꋊ'=>'ꋊ','ꋋ'=>'ꋋ','ꋌ'=>'ꋌ','ꋍ'=>'ꋍ','ꋎ'=>'ꋎ','ꋏ'=>'ꋏ','ꋐ'=>'ꋐ','ꋑ'=>'ꋑ','ꋒ'=>'ꋒ','ꋓ'=>'ꋓ','ꋔ'=>'ꋔ','ꋕ'=>'ꋕ','ꋖ'=>'ꋖ','ꋗ'=>'ꋗ','ꋘ'=>'ꋘ','ꋙ'=>'ꋙ','ꋚ'=>'ꋚ','ꋛ'=>'ꋛ','ꋜ'=>'ꋜ','ꋝ'=>'ꋝ','ꋞ'=>'ꋞ','ꋟ'=>'ꋟ','ꋠ'=>'ꋠ','ꋡ'=>'ꋡ','ꋢ'=>'ꋢ','ꋣ'=>'ꋣ','ꋤ'=>'ꋤ','ꋥ'=>'ꋥ','ꋦ'=>'ꋦ','ꋧ'=>'ꋧ','ꋨ'=>'ꋨ','ꋩ'=>'ꋩ','ꋪ'=>'ꋪ','ꋫ'=>'ꋫ','ꋬ'=>'ꋬ','ꋭ'=>'ꋭ','ꋮ'=>'ꋮ','ꋯ'=>'ꋯ','ꋰ'=>'ꋰ','ꋱ'=>'ꋱ','ꋲ'=>'ꋲ','ꋳ'=>'ꋳ','ꋴ'=>'ꋴ','ꋵ'=>'ꋵ','ꋶ'=>'ꋶ','ꋷ'=>'ꋷ','ꋸ'=>'ꋸ','ꋹ'=>'ꋹ','ꋺ'=>'ꋺ','ꋻ'=>'ꋻ','ꋼ'=>'ꋼ','ꋽ'=>'ꋽ','ꋾ'=>'ꋾ','ꋿ'=>'ꋿ','ꌀ'=>'ꌀ','ꌁ'=>'ꌁ','ꌂ'=>'ꌂ','ꌃ'=>'ꌃ','ꌄ'=>'ꌄ','ꌅ'=>'ꌅ','ꌆ'=>'ꌆ','ꌇ'=>'ꌇ','ꌈ'=>'ꌈ','ꌉ'=>'ꌉ','ꌊ'=>'ꌊ','ꌋ'=>'ꌋ','ꌌ'=>'ꌌ','ꌍ'=>'ꌍ','ꌎ'=>'ꌎ','ꌏ'=>'ꌏ','ꌐ'=>'ꌐ','ꌑ'=>'ꌑ','ꌒ'=>'ꌒ','ꌓ'=>'ꌓ','ꌔ'=>'ꌔ','ꌕ'=>'ꌕ','ꌖ'=>'ꌖ','ꌗ'=>'ꌗ','ꌘ'=>'ꌘ','ꌙ'=>'ꌙ','ꌚ'=>'ꌚ','ꌛ'=>'ꌛ','ꌜ'=>'ꌜ','ꌝ'=>'ꌝ','ꌞ'=>'ꌞ','ꌟ'=>'ꌟ','ꌠ'=>'ꌠ','ꌡ'=>'ꌡ','ꌢ'=>'ꌢ','ꌣ'=>'ꌣ','ꌤ'=>'ꌤ','ꌥ'=>'ꌥ','ꌦ'=>'ꌦ','ꌧ'=>'ꌧ','ꌨ'=>'ꌨ','ꌩ'=>'ꌩ','ꌪ'=>'ꌪ','ꌫ'=>'ꌫ','ꌬ'=>'ꌬ','ꌭ'=>'ꌭ','ꌮ'=>'ꌮ','ꌯ'=>'ꌯ','ꌰ'=>'ꌰ','ꌱ'=>'ꌱ','ꌲ'=>'ꌲ','ꌳ'=>'ꌳ','ꌴ'=>'ꌴ','ꌵ'=>'ꌵ','ꌶ'=>'ꌶ','ꌷ'=>'ꌷ','ꌸ'=>'ꌸ','ꌹ'=>'ꌹ','ꌺ'=>'ꌺ','ꌻ'=>'ꌻ','ꌼ'=>'ꌼ','ꌽ'=>'ꌽ','ꌾ'=>'ꌾ','ꌿ'=>'ꌿ','ꍀ'=>'ꍀ','ꍁ'=>'ꍁ','ꍂ'=>'ꍂ','ꍃ'=>'ꍃ','ꍄ'=>'ꍄ','ꍅ'=>'ꍅ','ꍆ'=>'ꍆ','ꍇ'=>'ꍇ','ꍈ'=>'ꍈ','ꍉ'=>'ꍉ','ꍊ'=>'ꍊ','ꍋ'=>'ꍋ','ꍌ'=>'ꍌ','ꍍ'=>'ꍍ','ꍎ'=>'ꍎ','ꍏ'=>'ꍏ','ꍐ'=>'ꍐ','ꍑ'=>'ꍑ','ꍒ'=>'ꍒ','ꍓ'=>'ꍓ','ꍔ'=>'ꍔ','ꍕ'=>'ꍕ','ꍖ'=>'ꍖ','ꍗ'=>'ꍗ','ꍘ'=>'ꍘ','ꍙ'=>'ꍙ','ꍚ'=>'ꍚ','ꍛ'=>'ꍛ','ꍜ'=>'ꍜ','ꍝ'=>'ꍝ','ꍞ'=>'ꍞ','ꍟ'=>'ꍟ','ꍠ'=>'ꍠ','ꍡ'=>'ꍡ','ꍢ'=>'ꍢ','ꍣ'=>'ꍣ','ꍤ'=>'ꍤ','ꍥ'=>'ꍥ','ꍦ'=>'ꍦ','ꍧ'=>'ꍧ','ꍨ'=>'ꍨ','ꍩ'=>'ꍩ','ꍪ'=>'ꍪ','ꍫ'=>'ꍫ','ꍬ'=>'ꍬ','ꍭ'=>'ꍭ','ꍮ'=>'ꍮ','ꍯ'=>'ꍯ','ꍰ'=>'ꍰ','ꍱ'=>'ꍱ','ꍲ'=>'ꍲ','ꍳ'=>'ꍳ','ꍴ'=>'ꍴ','ꍵ'=>'ꍵ','ꍶ'=>'ꍶ','ꍷ'=>'ꍷ','ꍸ'=>'ꍸ','ꍹ'=>'ꍹ','ꍺ'=>'ꍺ','ꍻ'=>'ꍻ','ꍼ'=>'ꍼ','ꍽ'=>'ꍽ','ꍾ'=>'ꍾ','ꍿ'=>'ꍿ','ꎀ'=>'ꎀ','ꎁ'=>'ꎁ','ꎂ'=>'ꎂ','ꎃ'=>'ꎃ','ꎄ'=>'ꎄ','ꎅ'=>'ꎅ','ꎆ'=>'ꎆ','ꎇ'=>'ꎇ','ꎈ'=>'ꎈ','ꎉ'=>'ꎉ','ꎊ'=>'ꎊ','ꎋ'=>'ꎋ','ꎌ'=>'ꎌ','ꎍ'=>'ꎍ','ꎎ'=>'ꎎ','ꎏ'=>'ꎏ','ꎐ'=>'ꎐ','ꎑ'=>'ꎑ','ꎒ'=>'ꎒ','ꎓ'=>'ꎓ','ꎔ'=>'ꎔ','ꎕ'=>'ꎕ','ꎖ'=>'ꎖ','ꎗ'=>'ꎗ','ꎘ'=>'ꎘ','ꎙ'=>'ꎙ','ꎚ'=>'ꎚ','ꎛ'=>'ꎛ','ꎜ'=>'ꎜ','ꎝ'=>'ꎝ','ꎞ'=>'ꎞ','ꎟ'=>'ꎟ','ꎠ'=>'ꎠ','ꎡ'=>'ꎡ','ꎢ'=>'ꎢ','ꎣ'=>'ꎣ','ꎤ'=>'ꎤ','ꎥ'=>'ꎥ','ꎦ'=>'ꎦ','ꎧ'=>'ꎧ','ꎨ'=>'ꎨ','ꎩ'=>'ꎩ','ꎪ'=>'ꎪ','ꎫ'=>'ꎫ','ꎬ'=>'ꎬ','ꎭ'=>'ꎭ','ꎮ'=>'ꎮ','ꎯ'=>'ꎯ','ꎰ'=>'ꎰ','ꎱ'=>'ꎱ','ꎲ'=>'ꎲ','ꎳ'=>'ꎳ','ꎴ'=>'ꎴ','ꎵ'=>'ꎵ','ꎶ'=>'ꎶ','ꎷ'=>'ꎷ','ꎸ'=>'ꎸ','ꎹ'=>'ꎹ','ꎺ'=>'ꎺ','ꎻ'=>'ꎻ','ꎼ'=>'ꎼ','ꎽ'=>'ꎽ','ꎾ'=>'ꎾ','ꎿ'=>'ꎿ','ꏀ'=>'ꏀ','ꏁ'=>'ꏁ','ꏂ'=>'ꏂ','ꏃ'=>'ꏃ','ꏄ'=>'ꏄ','ꏅ'=>'ꏅ','ꏆ'=>'ꏆ','ꏇ'=>'ꏇ','ꏈ'=>'ꏈ','ꏉ'=>'ꏉ','ꏊ'=>'ꏊ','ꏋ'=>'ꏋ','ꏌ'=>'ꏌ','ꏍ'=>'ꏍ','ꏎ'=>'ꏎ','ꏏ'=>'ꏏ','ꏐ'=>'ꏐ','ꏑ'=>'ꏑ','ꏒ'=>'ꏒ','ꏓ'=>'ꏓ','ꏔ'=>'ꏔ','ꏕ'=>'ꏕ','ꏖ'=>'ꏖ','ꏗ'=>'ꏗ','ꏘ'=>'ꏘ','ꏙ'=>'ꏙ','ꏚ'=>'ꏚ','ꏛ'=>'ꏛ','ꏜ'=>'ꏜ','ꏝ'=>'ꏝ','ꏞ'=>'ꏞ','ꏟ'=>'ꏟ','ꏠ'=>'ꏠ','ꏡ'=>'ꏡ','ꏢ'=>'ꏢ','ꏣ'=>'ꏣ','ꏤ'=>'ꏤ','ꏥ'=>'ꏥ','ꏦ'=>'ꏦ','ꏧ'=>'ꏧ','ꏨ'=>'ꏨ','ꏩ'=>'ꏩ','ꏪ'=>'ꏪ','ꏫ'=>'ꏫ','ꏬ'=>'ꏬ','ꏭ'=>'ꏭ','ꏮ'=>'ꏮ','ꏯ'=>'ꏯ','ꏰ'=>'ꏰ','ꏱ'=>'ꏱ','ꏲ'=>'ꏲ','ꏳ'=>'ꏳ','ꏴ'=>'ꏴ','ꏵ'=>'ꏵ','ꏶ'=>'ꏶ','ꏷ'=>'ꏷ','ꏸ'=>'ꏸ','ꏹ'=>'ꏹ','ꏺ'=>'ꏺ','ꏻ'=>'ꏻ','ꏼ'=>'ꏼ','ꏽ'=>'ꏽ','ꏾ'=>'ꏾ','ꏿ'=>'ꏿ','ꐀ'=>'ꐀ','ꐁ'=>'ꐁ','ꐂ'=>'ꐂ','ꐃ'=>'ꐃ','ꐄ'=>'ꐄ','ꐅ'=>'ꐅ','ꐆ'=>'ꐆ','ꐇ'=>'ꐇ','ꐈ'=>'ꐈ','ꐉ'=>'ꐉ','ꐊ'=>'ꐊ','ꐋ'=>'ꐋ','ꐌ'=>'ꐌ','ꐍ'=>'ꐍ','ꐎ'=>'ꐎ','ꐏ'=>'ꐏ','ꐐ'=>'ꐐ','ꐑ'=>'ꐑ','ꐒ'=>'ꐒ','ꐓ'=>'ꐓ','ꐔ'=>'ꐔ','ꐕ'=>'ꐕ','ꐖ'=>'ꐖ','ꐗ'=>'ꐗ','ꐘ'=>'ꐘ','ꐙ'=>'ꐙ','ꐚ'=>'ꐚ','ꐛ'=>'ꐛ','ꐜ'=>'ꐜ','ꐝ'=>'ꐝ','ꐞ'=>'ꐞ','ꐟ'=>'ꐟ','ꐠ'=>'ꐠ','ꐡ'=>'ꐡ','ꐢ'=>'ꐢ','ꐣ'=>'ꐣ','ꐤ'=>'ꐤ','ꐥ'=>'ꐥ','ꐦ'=>'ꐦ','ꐧ'=>'ꐧ','ꐨ'=>'ꐨ','ꐩ'=>'ꐩ','ꐪ'=>'ꐪ','ꐫ'=>'ꐫ','ꐬ'=>'ꐬ','ꐭ'=>'ꐭ','ꐮ'=>'ꐮ','ꐯ'=>'ꐯ','ꐰ'=>'ꐰ','ꐱ'=>'ꐱ','ꐲ'=>'ꐲ','ꐳ'=>'ꐳ','ꐴ'=>'ꐴ','ꐵ'=>'ꐵ','ꐶ'=>'ꐶ','ꐷ'=>'ꐷ','ꐸ'=>'ꐸ','ꐹ'=>'ꐹ','ꐺ'=>'ꐺ','ꐻ'=>'ꐻ','ꐼ'=>'ꐼ','ꐽ'=>'ꐽ','ꐾ'=>'ꐾ','ꐿ'=>'ꐿ','ꑀ'=>'ꑀ','ꑁ'=>'ꑁ','ꑂ'=>'ꑂ','ꑃ'=>'ꑃ','ꑄ'=>'ꑄ','ꑅ'=>'ꑅ','ꑆ'=>'ꑆ','ꑇ'=>'ꑇ','ꑈ'=>'ꑈ','ꑉ'=>'ꑉ','ꑊ'=>'ꑊ','ꑋ'=>'ꑋ','ꑌ'=>'ꑌ','ꑍ'=>'ꑍ','ꑎ'=>'ꑎ','ꑏ'=>'ꑏ','ꑐ'=>'ꑐ','ꑑ'=>'ꑑ','ꑒ'=>'ꑒ','ꑓ'=>'ꑓ','ꑔ'=>'ꑔ','ꑕ'=>'ꑕ','ꑖ'=>'ꑖ','ꑗ'=>'ꑗ','ꑘ'=>'ꑘ','ꑙ'=>'ꑙ','ꑚ'=>'ꑚ','ꑛ'=>'ꑛ','ꑜ'=>'ꑜ','ꑝ'=>'ꑝ','ꑞ'=>'ꑞ','ꑟ'=>'ꑟ','ꑠ'=>'ꑠ','ꑡ'=>'ꑡ','ꑢ'=>'ꑢ','ꑣ'=>'ꑣ','ꑤ'=>'ꑤ','ꑥ'=>'ꑥ','ꑦ'=>'ꑦ','ꑧ'=>'ꑧ','ꑨ'=>'ꑨ','ꑩ'=>'ꑩ','ꑪ'=>'ꑪ','ꑫ'=>'ꑫ','ꑬ'=>'ꑬ','ꑭ'=>'ꑭ','ꑮ'=>'ꑮ','ꑯ'=>'ꑯ','ꑰ'=>'ꑰ','ꑱ'=>'ꑱ','ꑲ'=>'ꑲ','ꑳ'=>'ꑳ','ꑴ'=>'ꑴ','ꑵ'=>'ꑵ','ꑶ'=>'ꑶ','ꑷ'=>'ꑷ','ꑸ'=>'ꑸ','ꑹ'=>'ꑹ','ꑺ'=>'ꑺ','ꑻ'=>'ꑻ','ꑼ'=>'ꑼ','ꑽ'=>'ꑽ','ꑾ'=>'ꑾ','ꑿ'=>'ꑿ','ꒀ'=>'ꒀ','ꒁ'=>'ꒁ','ꒂ'=>'ꒂ','ꒃ'=>'ꒃ','ꒄ'=>'ꒄ','ꒅ'=>'ꒅ','ꒆ'=>'ꒆ','ꒇ'=>'ꒇ','ꒈ'=>'ꒈ','ꒉ'=>'ꒉ','ꒊ'=>'ꒊ','ꒋ'=>'ꒋ','ꒌ'=>'ꒌ','ꜗ'=>'ꜗ','ꜘ'=>'ꜘ','ꜙ'=>'ꜙ','ꜚ'=>'ꜚ'); \ No newline at end of file
+<?php return array('ꀀ'=>'ꀀ','ꀁ'=>'ꀁ','ꀂ'=>'ꀂ','ꀃ'=>'ꀃ','ꀄ'=>'ꀄ','ꀅ'=>'ꀅ','ꀆ'=>'ꀆ','ꀇ'=>'ꀇ','ꀈ'=>'ꀈ','ꀉ'=>'ꀉ','ꀊ'=>'ꀊ','ꀋ'=>'ꀋ','ꀌ'=>'ꀌ','ꀍ'=>'ꀍ','ꀎ'=>'ꀎ','ꀏ'=>'ꀏ','ꀐ'=>'ꀐ','ꀑ'=>'ꀑ','ꀒ'=>'ꀒ','ꀓ'=>'ꀓ','ꀔ'=>'ꀔ','ꀕ'=>'ꀕ','ꀖ'=>'ꀖ','ꀗ'=>'ꀗ','ꀘ'=>'ꀘ','ꀙ'=>'ꀙ','ꀚ'=>'ꀚ','ꀛ'=>'ꀛ','ꀜ'=>'ꀜ','ꀝ'=>'ꀝ','ꀞ'=>'ꀞ','ꀟ'=>'ꀟ','ꀠ'=>'ꀠ','ꀡ'=>'ꀡ','ꀢ'=>'ꀢ','ꀣ'=>'ꀣ','ꀤ'=>'ꀤ','ꀥ'=>'ꀥ','ꀦ'=>'ꀦ','ꀧ'=>'ꀧ','ꀨ'=>'ꀨ','ꀩ'=>'ꀩ','ꀪ'=>'ꀪ','ꀫ'=>'ꀫ','ꀬ'=>'ꀬ','ꀭ'=>'ꀭ','ꀮ'=>'ꀮ','ꀯ'=>'ꀯ','ꀰ'=>'ꀰ','ꀱ'=>'ꀱ','ꀲ'=>'ꀲ','ꀳ'=>'ꀳ','ꀴ'=>'ꀴ','ꀵ'=>'ꀵ','ꀶ'=>'ꀶ','ꀷ'=>'ꀷ','ꀸ'=>'ꀸ','ꀹ'=>'ꀹ','ꀺ'=>'ꀺ','ꀻ'=>'ꀻ','ꀼ'=>'ꀼ','ꀽ'=>'ꀽ','ꀾ'=>'ꀾ','ꀿ'=>'ꀿ','ꁀ'=>'ꁀ','ꁁ'=>'ꁁ','ꁂ'=>'ꁂ','ꁃ'=>'ꁃ','ꁄ'=>'ꁄ','ꁅ'=>'ꁅ','ꁆ'=>'ꁆ','ꁇ'=>'ꁇ','ꁈ'=>'ꁈ','ꁉ'=>'ꁉ','ꁊ'=>'ꁊ','ꁋ'=>'ꁋ','ꁌ'=>'ꁌ','ꁍ'=>'ꁍ','ꁎ'=>'ꁎ','ꁏ'=>'ꁏ','ꁐ'=>'ꁐ','ꁑ'=>'ꁑ','ꁒ'=>'ꁒ','ꁓ'=>'ꁓ','ꁔ'=>'ꁔ','ꁕ'=>'ꁕ','ꁖ'=>'ꁖ','ꁗ'=>'ꁗ','ꁘ'=>'ꁘ','ꁙ'=>'ꁙ','ꁚ'=>'ꁚ','ꁛ'=>'ꁛ','ꁜ'=>'ꁜ','ꁝ'=>'ꁝ','ꁞ'=>'ꁞ','ꁟ'=>'ꁟ','ꁠ'=>'ꁠ','ꁡ'=>'ꁡ','ꁢ'=>'ꁢ','ꁣ'=>'ꁣ','ꁤ'=>'ꁤ','ꁥ'=>'ꁥ','ꁦ'=>'ꁦ','ꁧ'=>'ꁧ','ꁨ'=>'ꁨ','ꁩ'=>'ꁩ','ꁪ'=>'ꁪ','ꁫ'=>'ꁫ','ꁬ'=>'ꁬ','ꁭ'=>'ꁭ','ꁮ'=>'ꁮ','ꁯ'=>'ꁯ','ꁰ'=>'ꁰ','ꁱ'=>'ꁱ','ꁲ'=>'ꁲ','ꁳ'=>'ꁳ','ꁴ'=>'ꁴ','ꁵ'=>'ꁵ','ꁶ'=>'ꁶ','ꁷ'=>'ꁷ','ꁸ'=>'ꁸ','ꁹ'=>'ꁹ','ꁺ'=>'ꁺ','ꁻ'=>'ꁻ','ꁼ'=>'ꁼ','ꁽ'=>'ꁽ','ꁾ'=>'ꁾ','ꁿ'=>'ꁿ','ꂀ'=>'ꂀ','ꂁ'=>'ꂁ','ꂂ'=>'ꂂ','ꂃ'=>'ꂃ','ꂄ'=>'ꂄ','ꂅ'=>'ꂅ','ꂆ'=>'ꂆ','ꂇ'=>'ꂇ','ꂈ'=>'ꂈ','ꂉ'=>'ꂉ','ꂊ'=>'ꂊ','ꂋ'=>'ꂋ','ꂌ'=>'ꂌ','ꂍ'=>'ꂍ','ꂎ'=>'ꂎ','ꂏ'=>'ꂏ','ꂐ'=>'ꂐ','ꂑ'=>'ꂑ','ꂒ'=>'ꂒ','ꂓ'=>'ꂓ','ꂔ'=>'ꂔ','ꂕ'=>'ꂕ','ꂖ'=>'ꂖ','ꂗ'=>'ꂗ','ꂘ'=>'ꂘ','ꂙ'=>'ꂙ','ꂚ'=>'ꂚ','ꂛ'=>'ꂛ','ꂜ'=>'ꂜ','ꂝ'=>'ꂝ','ꂞ'=>'ꂞ','ꂟ'=>'ꂟ','ꂠ'=>'ꂠ','ꂡ'=>'ꂡ','ꂢ'=>'ꂢ','ꂣ'=>'ꂣ','ꂤ'=>'ꂤ','ꂥ'=>'ꂥ','ꂦ'=>'ꂦ','ꂧ'=>'ꂧ','ꂨ'=>'ꂨ','ꂩ'=>'ꂩ','ꂪ'=>'ꂪ','ꂫ'=>'ꂫ','ꂬ'=>'ꂬ','ꂭ'=>'ꂭ','ꂮ'=>'ꂮ','ꂯ'=>'ꂯ','ꂰ'=>'ꂰ','ꂱ'=>'ꂱ','ꂲ'=>'ꂲ','ꂳ'=>'ꂳ','ꂴ'=>'ꂴ','ꂵ'=>'ꂵ','ꂶ'=>'ꂶ','ꂷ'=>'ꂷ','ꂸ'=>'ꂸ','ꂹ'=>'ꂹ','ꂺ'=>'ꂺ','ꂻ'=>'ꂻ','ꂼ'=>'ꂼ','ꂽ'=>'ꂽ','ꂾ'=>'ꂾ','ꂿ'=>'ꂿ','ꃀ'=>'ꃀ','ꃁ'=>'ꃁ','ꃂ'=>'ꃂ','ꃃ'=>'ꃃ','ꃄ'=>'ꃄ','ꃅ'=>'ꃅ','ꃆ'=>'ꃆ','ꃇ'=>'ꃇ','ꃈ'=>'ꃈ','ꃉ'=>'ꃉ','ꃊ'=>'ꃊ','ꃋ'=>'ꃋ','ꃌ'=>'ꃌ','ꃍ'=>'ꃍ','ꃎ'=>'ꃎ','ꃏ'=>'ꃏ','ꃐ'=>'ꃐ','ꃑ'=>'ꃑ','ꃒ'=>'ꃒ','ꃓ'=>'ꃓ','ꃔ'=>'ꃔ','ꃕ'=>'ꃕ','ꃖ'=>'ꃖ','ꃗ'=>'ꃗ','ꃘ'=>'ꃘ','ꃙ'=>'ꃙ','ꃚ'=>'ꃚ','ꃛ'=>'ꃛ','ꃜ'=>'ꃜ','ꃝ'=>'ꃝ','ꃞ'=>'ꃞ','ꃟ'=>'ꃟ','ꃠ'=>'ꃠ','ꃡ'=>'ꃡ','ꃢ'=>'ꃢ','ꃣ'=>'ꃣ','ꃤ'=>'ꃤ','ꃥ'=>'ꃥ','ꃦ'=>'ꃦ','ꃧ'=>'ꃧ','ꃨ'=>'ꃨ','ꃩ'=>'ꃩ','ꃪ'=>'ꃪ','ꃫ'=>'ꃫ','ꃬ'=>'ꃬ','ꃭ'=>'ꃭ','ꃮ'=>'ꃮ','ꃯ'=>'ꃯ','ꃰ'=>'ꃰ','ꃱ'=>'ꃱ','ꃲ'=>'ꃲ','ꃳ'=>'ꃳ','ꃴ'=>'ꃴ','ꃵ'=>'ꃵ','ꃶ'=>'ꃶ','ꃷ'=>'ꃷ','ꃸ'=>'ꃸ','ꃹ'=>'ꃹ','ꃺ'=>'ꃺ','ꃻ'=>'ꃻ','ꃼ'=>'ꃼ','ꃽ'=>'ꃽ','ꃾ'=>'ꃾ','ꃿ'=>'ꃿ','ꄀ'=>'ꄀ','ꄁ'=>'ꄁ','ꄂ'=>'ꄂ','ꄃ'=>'ꄃ','ꄄ'=>'ꄄ','ꄅ'=>'ꄅ','ꄆ'=>'ꄆ','ꄇ'=>'ꄇ','ꄈ'=>'ꄈ','ꄉ'=>'ꄉ','ꄊ'=>'ꄊ','ꄋ'=>'ꄋ','ꄌ'=>'ꄌ','ꄍ'=>'ꄍ','ꄎ'=>'ꄎ','ꄏ'=>'ꄏ','ꄐ'=>'ꄐ','ꄑ'=>'ꄑ','ꄒ'=>'ꄒ','ꄓ'=>'ꄓ','ꄔ'=>'ꄔ','ꄕ'=>'ꄕ','ꄖ'=>'ꄖ','ꄗ'=>'ꄗ','ꄘ'=>'ꄘ','ꄙ'=>'ꄙ','ꄚ'=>'ꄚ','ꄛ'=>'ꄛ','ꄜ'=>'ꄜ','ꄝ'=>'ꄝ','ꄞ'=>'ꄞ','ꄟ'=>'ꄟ','ꄠ'=>'ꄠ','ꄡ'=>'ꄡ','ꄢ'=>'ꄢ','ꄣ'=>'ꄣ','ꄤ'=>'ꄤ','ꄥ'=>'ꄥ','ꄦ'=>'ꄦ','ꄧ'=>'ꄧ','ꄨ'=>'ꄨ','ꄩ'=>'ꄩ','ꄪ'=>'ꄪ','ꄫ'=>'ꄫ','ꄬ'=>'ꄬ','ꄭ'=>'ꄭ','ꄮ'=>'ꄮ','ꄯ'=>'ꄯ','ꄰ'=>'ꄰ','ꄱ'=>'ꄱ','ꄲ'=>'ꄲ','ꄳ'=>'ꄳ','ꄴ'=>'ꄴ','ꄵ'=>'ꄵ','ꄶ'=>'ꄶ','ꄷ'=>'ꄷ','ꄸ'=>'ꄸ','ꄹ'=>'ꄹ','ꄺ'=>'ꄺ','ꄻ'=>'ꄻ','ꄼ'=>'ꄼ','ꄽ'=>'ꄽ','ꄾ'=>'ꄾ','ꄿ'=>'ꄿ','ꅀ'=>'ꅀ','ꅁ'=>'ꅁ','ꅂ'=>'ꅂ','ꅃ'=>'ꅃ','ꅄ'=>'ꅄ','ꅅ'=>'ꅅ','ꅆ'=>'ꅆ','ꅇ'=>'ꅇ','ꅈ'=>'ꅈ','ꅉ'=>'ꅉ','ꅊ'=>'ꅊ','ꅋ'=>'ꅋ','ꅌ'=>'ꅌ','ꅍ'=>'ꅍ','ꅎ'=>'ꅎ','ꅏ'=>'ꅏ','ꅐ'=>'ꅐ','ꅑ'=>'ꅑ','ꅒ'=>'ꅒ','ꅓ'=>'ꅓ','ꅔ'=>'ꅔ','ꅕ'=>'ꅕ','ꅖ'=>'ꅖ','ꅗ'=>'ꅗ','ꅘ'=>'ꅘ','ꅙ'=>'ꅙ','ꅚ'=>'ꅚ','ꅛ'=>'ꅛ','ꅜ'=>'ꅜ','ꅝ'=>'ꅝ','ꅞ'=>'ꅞ','ꅟ'=>'ꅟ','ꅠ'=>'ꅠ','ꅡ'=>'ꅡ','ꅢ'=>'ꅢ','ꅣ'=>'ꅣ','ꅤ'=>'ꅤ','ꅥ'=>'ꅥ','ꅦ'=>'ꅦ','ꅧ'=>'ꅧ','ꅨ'=>'ꅨ','ꅩ'=>'ꅩ','ꅪ'=>'ꅪ','ꅫ'=>'ꅫ','ꅬ'=>'ꅬ','ꅭ'=>'ꅭ','ꅮ'=>'ꅮ','ꅯ'=>'ꅯ','ꅰ'=>'ꅰ','ꅱ'=>'ꅱ','ꅲ'=>'ꅲ','ꅳ'=>'ꅳ','ꅴ'=>'ꅴ','ꅵ'=>'ꅵ','ꅶ'=>'ꅶ','ꅷ'=>'ꅷ','ꅸ'=>'ꅸ','ꅹ'=>'ꅹ','ꅺ'=>'ꅺ','ꅻ'=>'ꅻ','ꅼ'=>'ꅼ','ꅽ'=>'ꅽ','ꅾ'=>'ꅾ','ꅿ'=>'ꅿ','ꆀ'=>'ꆀ','ꆁ'=>'ꆁ','ꆂ'=>'ꆂ','ꆃ'=>'ꆃ','ꆄ'=>'ꆄ','ꆅ'=>'ꆅ','ꆆ'=>'ꆆ','ꆇ'=>'ꆇ','ꆈ'=>'ꆈ','ꆉ'=>'ꆉ','ꆊ'=>'ꆊ','ꆋ'=>'ꆋ','ꆌ'=>'ꆌ','ꆍ'=>'ꆍ','ꆎ'=>'ꆎ','ꆏ'=>'ꆏ','ꆐ'=>'ꆐ','ꆑ'=>'ꆑ','ꆒ'=>'ꆒ','ꆓ'=>'ꆓ','ꆔ'=>'ꆔ','ꆕ'=>'ꆕ','ꆖ'=>'ꆖ','ꆗ'=>'ꆗ','ꆘ'=>'ꆘ','ꆙ'=>'ꆙ','ꆚ'=>'ꆚ','ꆛ'=>'ꆛ','ꆜ'=>'ꆜ','ꆝ'=>'ꆝ','ꆞ'=>'ꆞ','ꆟ'=>'ꆟ','ꆠ'=>'ꆠ','ꆡ'=>'ꆡ','ꆢ'=>'ꆢ','ꆣ'=>'ꆣ','ꆤ'=>'ꆤ','ꆥ'=>'ꆥ','ꆦ'=>'ꆦ','ꆧ'=>'ꆧ','ꆨ'=>'ꆨ','ꆩ'=>'ꆩ','ꆪ'=>'ꆪ','ꆫ'=>'ꆫ','ꆬ'=>'ꆬ','ꆭ'=>'ꆭ','ꆮ'=>'ꆮ','ꆯ'=>'ꆯ','ꆰ'=>'ꆰ','ꆱ'=>'ꆱ','ꆲ'=>'ꆲ','ꆳ'=>'ꆳ','ꆴ'=>'ꆴ','ꆵ'=>'ꆵ','ꆶ'=>'ꆶ','ꆷ'=>'ꆷ','ꆸ'=>'ꆸ','ꆹ'=>'ꆹ','ꆺ'=>'ꆺ','ꆻ'=>'ꆻ','ꆼ'=>'ꆼ','ꆽ'=>'ꆽ','ꆾ'=>'ꆾ','ꆿ'=>'ꆿ','ꇀ'=>'ꇀ','ꇁ'=>'ꇁ','ꇂ'=>'ꇂ','ꇃ'=>'ꇃ','ꇄ'=>'ꇄ','ꇅ'=>'ꇅ','ꇆ'=>'ꇆ','ꇇ'=>'ꇇ','ꇈ'=>'ꇈ','ꇉ'=>'ꇉ','ꇊ'=>'ꇊ','ꇋ'=>'ꇋ','ꇌ'=>'ꇌ','ꇍ'=>'ꇍ','ꇎ'=>'ꇎ','ꇏ'=>'ꇏ','ꇐ'=>'ꇐ','ꇑ'=>'ꇑ','ꇒ'=>'ꇒ','ꇓ'=>'ꇓ','ꇔ'=>'ꇔ','ꇕ'=>'ꇕ','ꇖ'=>'ꇖ','ꇗ'=>'ꇗ','ꇘ'=>'ꇘ','ꇙ'=>'ꇙ','ꇚ'=>'ꇚ','ꇛ'=>'ꇛ','ꇜ'=>'ꇜ','ꇝ'=>'ꇝ','ꇞ'=>'ꇞ','ꇟ'=>'ꇟ','ꇠ'=>'ꇠ','ꇡ'=>'ꇡ','ꇢ'=>'ꇢ','ꇣ'=>'ꇣ','ꇤ'=>'ꇤ','ꇥ'=>'ꇥ','ꇦ'=>'ꇦ','ꇧ'=>'ꇧ','ꇨ'=>'ꇨ','ꇩ'=>'ꇩ','ꇪ'=>'ꇪ','ꇫ'=>'ꇫ','ꇬ'=>'ꇬ','ꇭ'=>'ꇭ','ꇮ'=>'ꇮ','ꇯ'=>'ꇯ','ꇰ'=>'ꇰ','ꇱ'=>'ꇱ','ꇲ'=>'ꇲ','ꇳ'=>'ꇳ','ꇴ'=>'ꇴ','ꇵ'=>'ꇵ','ꇶ'=>'ꇶ','ꇷ'=>'ꇷ','ꇸ'=>'ꇸ','ꇹ'=>'ꇹ','ꇺ'=>'ꇺ','ꇻ'=>'ꇻ','ꇼ'=>'ꇼ','ꇽ'=>'ꇽ','ꇾ'=>'ꇾ','ꇿ'=>'ꇿ','ꈀ'=>'ꈀ','ꈁ'=>'ꈁ','ꈂ'=>'ꈂ','ꈃ'=>'ꈃ','ꈄ'=>'ꈄ','ꈅ'=>'ꈅ','ꈆ'=>'ꈆ','ꈇ'=>'ꈇ','ꈈ'=>'ꈈ','ꈉ'=>'ꈉ','ꈊ'=>'ꈊ','ꈋ'=>'ꈋ','ꈌ'=>'ꈌ','ꈍ'=>'ꈍ','ꈎ'=>'ꈎ','ꈏ'=>'ꈏ','ꈐ'=>'ꈐ','ꈑ'=>'ꈑ','ꈒ'=>'ꈒ','ꈓ'=>'ꈓ','ꈔ'=>'ꈔ','ꈕ'=>'ꈕ','ꈖ'=>'ꈖ','ꈗ'=>'ꈗ','ꈘ'=>'ꈘ','ꈙ'=>'ꈙ','ꈚ'=>'ꈚ','ꈛ'=>'ꈛ','ꈜ'=>'ꈜ','ꈝ'=>'ꈝ','ꈞ'=>'ꈞ','ꈟ'=>'ꈟ','ꈠ'=>'ꈠ','ꈡ'=>'ꈡ','ꈢ'=>'ꈢ','ꈣ'=>'ꈣ','ꈤ'=>'ꈤ','ꈥ'=>'ꈥ','ꈦ'=>'ꈦ','ꈧ'=>'ꈧ','ꈨ'=>'ꈨ','ꈩ'=>'ꈩ','ꈪ'=>'ꈪ','ꈫ'=>'ꈫ','ꈬ'=>'ꈬ','ꈭ'=>'ꈭ','ꈮ'=>'ꈮ','ꈯ'=>'ꈯ','ꈰ'=>'ꈰ','ꈱ'=>'ꈱ','ꈲ'=>'ꈲ','ꈳ'=>'ꈳ','ꈴ'=>'ꈴ','ꈵ'=>'ꈵ','ꈶ'=>'ꈶ','ꈷ'=>'ꈷ','ꈸ'=>'ꈸ','ꈹ'=>'ꈹ','ꈺ'=>'ꈺ','ꈻ'=>'ꈻ','ꈼ'=>'ꈼ','ꈽ'=>'ꈽ','ꈾ'=>'ꈾ','ꈿ'=>'ꈿ','ꉀ'=>'ꉀ','ꉁ'=>'ꉁ','ꉂ'=>'ꉂ','ꉃ'=>'ꉃ','ꉄ'=>'ꉄ','ꉅ'=>'ꉅ','ꉆ'=>'ꉆ','ꉇ'=>'ꉇ','ꉈ'=>'ꉈ','ꉉ'=>'ꉉ','ꉊ'=>'ꉊ','ꉋ'=>'ꉋ','ꉌ'=>'ꉌ','ꉍ'=>'ꉍ','ꉎ'=>'ꉎ','ꉏ'=>'ꉏ','ꉐ'=>'ꉐ','ꉑ'=>'ꉑ','ꉒ'=>'ꉒ','ꉓ'=>'ꉓ','ꉔ'=>'ꉔ','ꉕ'=>'ꉕ','ꉖ'=>'ꉖ','ꉗ'=>'ꉗ','ꉘ'=>'ꉘ','ꉙ'=>'ꉙ','ꉚ'=>'ꉚ','ꉛ'=>'ꉛ','ꉜ'=>'ꉜ','ꉝ'=>'ꉝ','ꉞ'=>'ꉞ','ꉟ'=>'ꉟ','ꉠ'=>'ꉠ','ꉡ'=>'ꉡ','ꉢ'=>'ꉢ','ꉣ'=>'ꉣ','ꉤ'=>'ꉤ','ꉥ'=>'ꉥ','ꉦ'=>'ꉦ','ꉧ'=>'ꉧ','ꉨ'=>'ꉨ','ꉩ'=>'ꉩ','ꉪ'=>'ꉪ','ꉫ'=>'ꉫ','ꉬ'=>'ꉬ','ꉭ'=>'ꉭ','ꉮ'=>'ꉮ','ꉯ'=>'ꉯ','ꉰ'=>'ꉰ','ꉱ'=>'ꉱ','ꉲ'=>'ꉲ','ꉳ'=>'ꉳ','ꉴ'=>'ꉴ','ꉵ'=>'ꉵ','ꉶ'=>'ꉶ','ꉷ'=>'ꉷ','ꉸ'=>'ꉸ','ꉹ'=>'ꉹ','ꉺ'=>'ꉺ','ꉻ'=>'ꉻ','ꉼ'=>'ꉼ','ꉽ'=>'ꉽ','ꉾ'=>'ꉾ','ꉿ'=>'ꉿ','ꊀ'=>'ꊀ','ꊁ'=>'ꊁ','ꊂ'=>'ꊂ','ꊃ'=>'ꊃ','ꊄ'=>'ꊄ','ꊅ'=>'ꊅ','ꊆ'=>'ꊆ','ꊇ'=>'ꊇ','ꊈ'=>'ꊈ','ꊉ'=>'ꊉ','ꊊ'=>'ꊊ','ꊋ'=>'ꊋ','ꊌ'=>'ꊌ','ꊍ'=>'ꊍ','ꊎ'=>'ꊎ','ꊏ'=>'ꊏ','ꊐ'=>'ꊐ','ꊑ'=>'ꊑ','ꊒ'=>'ꊒ','ꊓ'=>'ꊓ','ꊔ'=>'ꊔ','ꊕ'=>'ꊕ','ꊖ'=>'ꊖ','ꊗ'=>'ꊗ','ꊘ'=>'ꊘ','ꊙ'=>'ꊙ','ꊚ'=>'ꊚ','ꊛ'=>'ꊛ','ꊜ'=>'ꊜ','ꊝ'=>'ꊝ','ꊞ'=>'ꊞ','ꊟ'=>'ꊟ','ꊠ'=>'ꊠ','ꊡ'=>'ꊡ','ꊢ'=>'ꊢ','ꊣ'=>'ꊣ','ꊤ'=>'ꊤ','ꊥ'=>'ꊥ','ꊦ'=>'ꊦ','ꊧ'=>'ꊧ','ꊨ'=>'ꊨ','ꊩ'=>'ꊩ','ꊪ'=>'ꊪ','ꊫ'=>'ꊫ','ꊬ'=>'ꊬ','ꊭ'=>'ꊭ','ꊮ'=>'ꊮ','ꊯ'=>'ꊯ','ꊰ'=>'ꊰ','ꊱ'=>'ꊱ','ꊲ'=>'ꊲ','ꊳ'=>'ꊳ','ꊴ'=>'ꊴ','ꊵ'=>'ꊵ','ꊶ'=>'ꊶ','ꊷ'=>'ꊷ','ꊸ'=>'ꊸ','ꊹ'=>'ꊹ','ꊺ'=>'ꊺ','ꊻ'=>'ꊻ','ꊼ'=>'ꊼ','ꊽ'=>'ꊽ','ꊾ'=>'ꊾ','ꊿ'=>'ꊿ','ꋀ'=>'ꋀ','ꋁ'=>'ꋁ','ꋂ'=>'ꋂ','ꋃ'=>'ꋃ','ꋄ'=>'ꋄ','ꋅ'=>'ꋅ','ꋆ'=>'ꋆ','ꋇ'=>'ꋇ','ꋈ'=>'ꋈ','ꋉ'=>'ꋉ','ꋊ'=>'ꋊ','ꋋ'=>'ꋋ','ꋌ'=>'ꋌ','ꋍ'=>'ꋍ','ꋎ'=>'ꋎ','ꋏ'=>'ꋏ','ꋐ'=>'ꋐ','ꋑ'=>'ꋑ','ꋒ'=>'ꋒ','ꋓ'=>'ꋓ','ꋔ'=>'ꋔ','ꋕ'=>'ꋕ','ꋖ'=>'ꋖ','ꋗ'=>'ꋗ','ꋘ'=>'ꋘ','ꋙ'=>'ꋙ','ꋚ'=>'ꋚ','ꋛ'=>'ꋛ','ꋜ'=>'ꋜ','ꋝ'=>'ꋝ','ꋞ'=>'ꋞ','ꋟ'=>'ꋟ','ꋠ'=>'ꋠ','ꋡ'=>'ꋡ','ꋢ'=>'ꋢ','ꋣ'=>'ꋣ','ꋤ'=>'ꋤ','ꋥ'=>'ꋥ','ꋦ'=>'ꋦ','ꋧ'=>'ꋧ','ꋨ'=>'ꋨ','ꋩ'=>'ꋩ','ꋪ'=>'ꋪ','ꋫ'=>'ꋫ','ꋬ'=>'ꋬ','ꋭ'=>'ꋭ','ꋮ'=>'ꋮ','ꋯ'=>'ꋯ','ꋰ'=>'ꋰ','ꋱ'=>'ꋱ','ꋲ'=>'ꋲ','ꋳ'=>'ꋳ','ꋴ'=>'ꋴ','ꋵ'=>'ꋵ','ꋶ'=>'ꋶ','ꋷ'=>'ꋷ','ꋸ'=>'ꋸ','ꋹ'=>'ꋹ','ꋺ'=>'ꋺ','ꋻ'=>'ꋻ','ꋼ'=>'ꋼ','ꋽ'=>'ꋽ','ꋾ'=>'ꋾ','ꋿ'=>'ꋿ','ꌀ'=>'ꌀ','ꌁ'=>'ꌁ','ꌂ'=>'ꌂ','ꌃ'=>'ꌃ','ꌄ'=>'ꌄ','ꌅ'=>'ꌅ','ꌆ'=>'ꌆ','ꌇ'=>'ꌇ','ꌈ'=>'ꌈ','ꌉ'=>'ꌉ','ꌊ'=>'ꌊ','ꌋ'=>'ꌋ','ꌌ'=>'ꌌ','ꌍ'=>'ꌍ','ꌎ'=>'ꌎ','ꌏ'=>'ꌏ','ꌐ'=>'ꌐ','ꌑ'=>'ꌑ','ꌒ'=>'ꌒ','ꌓ'=>'ꌓ','ꌔ'=>'ꌔ','ꌕ'=>'ꌕ','ꌖ'=>'ꌖ','ꌗ'=>'ꌗ','ꌘ'=>'ꌘ','ꌙ'=>'ꌙ','ꌚ'=>'ꌚ','ꌛ'=>'ꌛ','ꌜ'=>'ꌜ','ꌝ'=>'ꌝ','ꌞ'=>'ꌞ','ꌟ'=>'ꌟ','ꌠ'=>'ꌠ','ꌡ'=>'ꌡ','ꌢ'=>'ꌢ','ꌣ'=>'ꌣ','ꌤ'=>'ꌤ','ꌥ'=>'ꌥ','ꌦ'=>'ꌦ','ꌧ'=>'ꌧ','ꌨ'=>'ꌨ','ꌩ'=>'ꌩ','ꌪ'=>'ꌪ','ꌫ'=>'ꌫ','ꌬ'=>'ꌬ','ꌭ'=>'ꌭ','ꌮ'=>'ꌮ','ꌯ'=>'ꌯ','ꌰ'=>'ꌰ','ꌱ'=>'ꌱ','ꌲ'=>'ꌲ','ꌳ'=>'ꌳ','ꌴ'=>'ꌴ','ꌵ'=>'ꌵ','ꌶ'=>'ꌶ','ꌷ'=>'ꌷ','ꌸ'=>'ꌸ','ꌹ'=>'ꌹ','ꌺ'=>'ꌺ','ꌻ'=>'ꌻ','ꌼ'=>'ꌼ','ꌽ'=>'ꌽ','ꌾ'=>'ꌾ','ꌿ'=>'ꌿ','ꍀ'=>'ꍀ','ꍁ'=>'ꍁ','ꍂ'=>'ꍂ','ꍃ'=>'ꍃ','ꍄ'=>'ꍄ','ꍅ'=>'ꍅ','ꍆ'=>'ꍆ','ꍇ'=>'ꍇ','ꍈ'=>'ꍈ','ꍉ'=>'ꍉ','ꍊ'=>'ꍊ','ꍋ'=>'ꍋ','ꍌ'=>'ꍌ','ꍍ'=>'ꍍ','ꍎ'=>'ꍎ','ꍏ'=>'ꍏ','ꍐ'=>'ꍐ','ꍑ'=>'ꍑ','ꍒ'=>'ꍒ','ꍓ'=>'ꍓ','ꍔ'=>'ꍔ','ꍕ'=>'ꍕ','ꍖ'=>'ꍖ','ꍗ'=>'ꍗ','ꍘ'=>'ꍘ','ꍙ'=>'ꍙ','ꍚ'=>'ꍚ','ꍛ'=>'ꍛ','ꍜ'=>'ꍜ','ꍝ'=>'ꍝ','ꍞ'=>'ꍞ','ꍟ'=>'ꍟ','ꍠ'=>'ꍠ','ꍡ'=>'ꍡ','ꍢ'=>'ꍢ','ꍣ'=>'ꍣ','ꍤ'=>'ꍤ','ꍥ'=>'ꍥ','ꍦ'=>'ꍦ','ꍧ'=>'ꍧ','ꍨ'=>'ꍨ','ꍩ'=>'ꍩ','ꍪ'=>'ꍪ','ꍫ'=>'ꍫ','ꍬ'=>'ꍬ','ꍭ'=>'ꍭ','ꍮ'=>'ꍮ','ꍯ'=>'ꍯ','ꍰ'=>'ꍰ','ꍱ'=>'ꍱ','ꍲ'=>'ꍲ','ꍳ'=>'ꍳ','ꍴ'=>'ꍴ','ꍵ'=>'ꍵ','ꍶ'=>'ꍶ','ꍷ'=>'ꍷ','ꍸ'=>'ꍸ','ꍹ'=>'ꍹ','ꍺ'=>'ꍺ','ꍻ'=>'ꍻ','ꍼ'=>'ꍼ','ꍽ'=>'ꍽ','ꍾ'=>'ꍾ','ꍿ'=>'ꍿ','ꎀ'=>'ꎀ','ꎁ'=>'ꎁ','ꎂ'=>'ꎂ','ꎃ'=>'ꎃ','ꎄ'=>'ꎄ','ꎅ'=>'ꎅ','ꎆ'=>'ꎆ','ꎇ'=>'ꎇ','ꎈ'=>'ꎈ','ꎉ'=>'ꎉ','ꎊ'=>'ꎊ','ꎋ'=>'ꎋ','ꎌ'=>'ꎌ','ꎍ'=>'ꎍ','ꎎ'=>'ꎎ','ꎏ'=>'ꎏ','ꎐ'=>'ꎐ','ꎑ'=>'ꎑ','ꎒ'=>'ꎒ','ꎓ'=>'ꎓ','ꎔ'=>'ꎔ','ꎕ'=>'ꎕ','ꎖ'=>'ꎖ','ꎗ'=>'ꎗ','ꎘ'=>'ꎘ','ꎙ'=>'ꎙ','ꎚ'=>'ꎚ','ꎛ'=>'ꎛ','ꎜ'=>'ꎜ','ꎝ'=>'ꎝ','ꎞ'=>'ꎞ','ꎟ'=>'ꎟ','ꎠ'=>'ꎠ','ꎡ'=>'ꎡ','ꎢ'=>'ꎢ','ꎣ'=>'ꎣ','ꎤ'=>'ꎤ','ꎥ'=>'ꎥ','ꎦ'=>'ꎦ','ꎧ'=>'ꎧ','ꎨ'=>'ꎨ','ꎩ'=>'ꎩ','ꎪ'=>'ꎪ','ꎫ'=>'ꎫ','ꎬ'=>'ꎬ','ꎭ'=>'ꎭ','ꎮ'=>'ꎮ','ꎯ'=>'ꎯ','ꎰ'=>'ꎰ','ꎱ'=>'ꎱ','ꎲ'=>'ꎲ','ꎳ'=>'ꎳ','ꎴ'=>'ꎴ','ꎵ'=>'ꎵ','ꎶ'=>'ꎶ','ꎷ'=>'ꎷ','ꎸ'=>'ꎸ','ꎹ'=>'ꎹ','ꎺ'=>'ꎺ','ꎻ'=>'ꎻ','ꎼ'=>'ꎼ','ꎽ'=>'ꎽ','ꎾ'=>'ꎾ','ꎿ'=>'ꎿ','ꏀ'=>'ꏀ','ꏁ'=>'ꏁ','ꏂ'=>'ꏂ','ꏃ'=>'ꏃ','ꏄ'=>'ꏄ','ꏅ'=>'ꏅ','ꏆ'=>'ꏆ','ꏇ'=>'ꏇ','ꏈ'=>'ꏈ','ꏉ'=>'ꏉ','ꏊ'=>'ꏊ','ꏋ'=>'ꏋ','ꏌ'=>'ꏌ','ꏍ'=>'ꏍ','ꏎ'=>'ꏎ','ꏏ'=>'ꏏ','ꏐ'=>'ꏐ','ꏑ'=>'ꏑ','ꏒ'=>'ꏒ','ꏓ'=>'ꏓ','ꏔ'=>'ꏔ','ꏕ'=>'ꏕ','ꏖ'=>'ꏖ','ꏗ'=>'ꏗ','ꏘ'=>'ꏘ','ꏙ'=>'ꏙ','ꏚ'=>'ꏚ','ꏛ'=>'ꏛ','ꏜ'=>'ꏜ','ꏝ'=>'ꏝ','ꏞ'=>'ꏞ','ꏟ'=>'ꏟ','ꏠ'=>'ꏠ','ꏡ'=>'ꏡ','ꏢ'=>'ꏢ','ꏣ'=>'ꏣ','ꏤ'=>'ꏤ','ꏥ'=>'ꏥ','ꏦ'=>'ꏦ','ꏧ'=>'ꏧ','ꏨ'=>'ꏨ','ꏩ'=>'ꏩ','ꏪ'=>'ꏪ','ꏫ'=>'ꏫ','ꏬ'=>'ꏬ','ꏭ'=>'ꏭ','ꏮ'=>'ꏮ','ꏯ'=>'ꏯ','ꏰ'=>'ꏰ','ꏱ'=>'ꏱ','ꏲ'=>'ꏲ','ꏳ'=>'ꏳ','ꏴ'=>'ꏴ','ꏵ'=>'ꏵ','ꏶ'=>'ꏶ','ꏷ'=>'ꏷ','ꏸ'=>'ꏸ','ꏹ'=>'ꏹ','ꏺ'=>'ꏺ','ꏻ'=>'ꏻ','ꏼ'=>'ꏼ','ꏽ'=>'ꏽ','ꏾ'=>'ꏾ','ꏿ'=>'ꏿ','ꐀ'=>'ꐀ','ꐁ'=>'ꐁ','ꐂ'=>'ꐂ','ꐃ'=>'ꐃ','ꐄ'=>'ꐄ','ꐅ'=>'ꐅ','ꐆ'=>'ꐆ','ꐇ'=>'ꐇ','ꐈ'=>'ꐈ','ꐉ'=>'ꐉ','ꐊ'=>'ꐊ','ꐋ'=>'ꐋ','ꐌ'=>'ꐌ','ꐍ'=>'ꐍ','ꐎ'=>'ꐎ','ꐏ'=>'ꐏ','ꐐ'=>'ꐐ','ꐑ'=>'ꐑ','ꐒ'=>'ꐒ','ꐓ'=>'ꐓ','ꐔ'=>'ꐔ','ꐕ'=>'ꐕ','ꐖ'=>'ꐖ','ꐗ'=>'ꐗ','ꐘ'=>'ꐘ','ꐙ'=>'ꐙ','ꐚ'=>'ꐚ','ꐛ'=>'ꐛ','ꐜ'=>'ꐜ','ꐝ'=>'ꐝ','ꐞ'=>'ꐞ','ꐟ'=>'ꐟ','ꐠ'=>'ꐠ','ꐡ'=>'ꐡ','ꐢ'=>'ꐢ','ꐣ'=>'ꐣ','ꐤ'=>'ꐤ','ꐥ'=>'ꐥ','ꐦ'=>'ꐦ','ꐧ'=>'ꐧ','ꐨ'=>'ꐨ','ꐩ'=>'ꐩ','ꐪ'=>'ꐪ','ꐫ'=>'ꐫ','ꐬ'=>'ꐬ','ꐭ'=>'ꐭ','ꐮ'=>'ꐮ','ꐯ'=>'ꐯ','ꐰ'=>'ꐰ','ꐱ'=>'ꐱ','ꐲ'=>'ꐲ','ꐳ'=>'ꐳ','ꐴ'=>'ꐴ','ꐵ'=>'ꐵ','ꐶ'=>'ꐶ','ꐷ'=>'ꐷ','ꐸ'=>'ꐸ','ꐹ'=>'ꐹ','ꐺ'=>'ꐺ','ꐻ'=>'ꐻ','ꐼ'=>'ꐼ','ꐽ'=>'ꐽ','ꐾ'=>'ꐾ','ꐿ'=>'ꐿ','ꑀ'=>'ꑀ','ꑁ'=>'ꑁ','ꑂ'=>'ꑂ','ꑃ'=>'ꑃ','ꑄ'=>'ꑄ','ꑅ'=>'ꑅ','ꑆ'=>'ꑆ','ꑇ'=>'ꑇ','ꑈ'=>'ꑈ','ꑉ'=>'ꑉ','ꑊ'=>'ꑊ','ꑋ'=>'ꑋ','ꑌ'=>'ꑌ','ꑍ'=>'ꑍ','ꑎ'=>'ꑎ','ꑏ'=>'ꑏ','ꑐ'=>'ꑐ','ꑑ'=>'ꑑ','ꑒ'=>'ꑒ','ꑓ'=>'ꑓ','ꑔ'=>'ꑔ','ꑕ'=>'ꑕ','ꑖ'=>'ꑖ','ꑗ'=>'ꑗ','ꑘ'=>'ꑘ','ꑙ'=>'ꑙ','ꑚ'=>'ꑚ','ꑛ'=>'ꑛ','ꑜ'=>'ꑜ','ꑝ'=>'ꑝ','ꑞ'=>'ꑞ','ꑟ'=>'ꑟ','ꑠ'=>'ꑠ','ꑡ'=>'ꑡ','ꑢ'=>'ꑢ','ꑣ'=>'ꑣ','ꑤ'=>'ꑤ','ꑥ'=>'ꑥ','ꑦ'=>'ꑦ','ꑧ'=>'ꑧ','ꑨ'=>'ꑨ','ꑩ'=>'ꑩ','ꑪ'=>'ꑪ','ꑫ'=>'ꑫ','ꑬ'=>'ꑬ','ꑭ'=>'ꑭ','ꑮ'=>'ꑮ','ꑯ'=>'ꑯ','ꑰ'=>'ꑰ','ꑱ'=>'ꑱ','ꑲ'=>'ꑲ','ꑳ'=>'ꑳ','ꑴ'=>'ꑴ','ꑵ'=>'ꑵ','ꑶ'=>'ꑶ','ꑷ'=>'ꑷ','ꑸ'=>'ꑸ','ꑹ'=>'ꑹ','ꑺ'=>'ꑺ','ꑻ'=>'ꑻ','ꑼ'=>'ꑼ','ꑽ'=>'ꑽ','ꑾ'=>'ꑾ','ꑿ'=>'ꑿ','ꒀ'=>'ꒀ','ꒁ'=>'ꒁ','ꒂ'=>'ꒂ','ꒃ'=>'ꒃ','ꒄ'=>'ꒄ','ꒅ'=>'ꒅ','ꒆ'=>'ꒆ','ꒇ'=>'ꒇ','ꒈ'=>'ꒈ','ꒉ'=>'ꒉ','ꒊ'=>'ꒊ','ꒋ'=>'ꒋ','ꒌ'=>'ꒌ','ꜗ'=>'ꜗ','ꜘ'=>'ꜘ','ꜙ'=>'ꜙ','ꜚ'=>'ꜚ');
diff --git a/phpBB/includes/utf/data/search_indexer_21.php b/phpBB/includes/utf/data/search_indexer_21.php
index 7fc3e4dc09..34994b47d7 100644
--- a/phpBB/includes/utf/data/search_indexer_21.php
+++ b/phpBB/includes/utf/data/search_indexer_21.php
@@ -1 +1 @@
-<?php return array('ꠀ'=>'ꠀ','ꠁ'=>'ꠁ','ꠂ'=>'ꠂ','ꠃ'=>'ꠃ','ꠄ'=>'ꠄ','ꠅ'=>'ꠅ','꠆'=>'꠆','ꠇ'=>'ꠇ','ꠈ'=>'ꠈ','ꠉ'=>'ꠉ','ꠊ'=>'ꠊ','ꠋ'=>'ꠋ','ꠌ'=>'ꠌ','ꠍ'=>'ꠍ','ꠎ'=>'ꠎ','ꠏ'=>'ꠏ','ꠐ'=>'ꠐ','ꠑ'=>'ꠑ','ꠒ'=>'ꠒ','ꠓ'=>'ꠓ','ꠔ'=>'ꠔ','ꠕ'=>'ꠕ','ꠖ'=>'ꠖ','ꠗ'=>'ꠗ','ꠘ'=>'ꠘ','ꠙ'=>'ꠙ','ꠚ'=>'ꠚ','ꠛ'=>'ꠛ','ꠜ'=>'ꠜ','ꠝ'=>'ꠝ','ꠞ'=>'ꠞ','ꠟ'=>'ꠟ','ꠠ'=>'ꠠ','ꠡ'=>'ꠡ','ꠢ'=>'ꠢ','ꠣ'=>'ꠣ','ꠤ'=>'ꠤ','ꠥ'=>'ꠥ','ꠦ'=>'ꠦ','ꠧ'=>'ꠧ','ꡀ'=>'ꡀ','ꡁ'=>'ꡁ','ꡂ'=>'ꡂ','ꡃ'=>'ꡃ','ꡄ'=>'ꡄ','ꡅ'=>'ꡅ','ꡆ'=>'ꡆ','ꡇ'=>'ꡇ','ꡈ'=>'ꡈ','ꡉ'=>'ꡉ','ꡊ'=>'ꡊ','ꡋ'=>'ꡋ','ꡌ'=>'ꡌ','ꡍ'=>'ꡍ','ꡎ'=>'ꡎ','ꡏ'=>'ꡏ','ꡐ'=>'ꡐ','ꡑ'=>'ꡑ','ꡒ'=>'ꡒ','ꡓ'=>'ꡓ','ꡔ'=>'ꡔ','ꡕ'=>'ꡕ','ꡖ'=>'ꡖ','ꡗ'=>'ꡗ','ꡘ'=>'ꡘ','ꡙ'=>'ꡙ','ꡚ'=>'ꡚ','ꡛ'=>'ꡛ','ꡜ'=>'ꡜ','ꡝ'=>'ꡝ','ꡞ'=>'ꡞ','ꡟ'=>'ꡟ','ꡠ'=>'ꡠ','ꡡ'=>'ꡡ','ꡢ'=>'ꡢ','ꡣ'=>'ꡣ','ꡤ'=>'ꡤ','ꡥ'=>'ꡥ','ꡦ'=>'ꡦ','ꡧ'=>'ꡧ','ꡨ'=>'ꡨ','ꡩ'=>'ꡩ','ꡪ'=>'ꡪ','ꡫ'=>'ꡫ','ꡬ'=>'ꡬ','ꡭ'=>'ꡭ','ꡮ'=>'ꡮ','ꡯ'=>'ꡯ','ꡰ'=>'ꡰ','ꡱ'=>'ꡱ','ꡲ'=>'ꡲ','ꡳ'=>'ꡳ','가'=>'가'); \ No newline at end of file
+<?php return array('ꠀ'=>'ꠀ','ꠁ'=>'ꠁ','ꠂ'=>'ꠂ','ꠃ'=>'ꠃ','ꠄ'=>'ꠄ','ꠅ'=>'ꠅ','꠆'=>'꠆','ꠇ'=>'ꠇ','ꠈ'=>'ꠈ','ꠉ'=>'ꠉ','ꠊ'=>'ꠊ','ꠋ'=>'ꠋ','ꠌ'=>'ꠌ','ꠍ'=>'ꠍ','ꠎ'=>'ꠎ','ꠏ'=>'ꠏ','ꠐ'=>'ꠐ','ꠑ'=>'ꠑ','ꠒ'=>'ꠒ','ꠓ'=>'ꠓ','ꠔ'=>'ꠔ','ꠕ'=>'ꠕ','ꠖ'=>'ꠖ','ꠗ'=>'ꠗ','ꠘ'=>'ꠘ','ꠙ'=>'ꠙ','ꠚ'=>'ꠚ','ꠛ'=>'ꠛ','ꠜ'=>'ꠜ','ꠝ'=>'ꠝ','ꠞ'=>'ꠞ','ꠟ'=>'ꠟ','ꠠ'=>'ꠠ','ꠡ'=>'ꠡ','ꠢ'=>'ꠢ','ꠣ'=>'ꠣ','ꠤ'=>'ꠤ','ꠥ'=>'ꠥ','ꠦ'=>'ꠦ','ꠧ'=>'ꠧ','ꡀ'=>'ꡀ','ꡁ'=>'ꡁ','ꡂ'=>'ꡂ','ꡃ'=>'ꡃ','ꡄ'=>'ꡄ','ꡅ'=>'ꡅ','ꡆ'=>'ꡆ','ꡇ'=>'ꡇ','ꡈ'=>'ꡈ','ꡉ'=>'ꡉ','ꡊ'=>'ꡊ','ꡋ'=>'ꡋ','ꡌ'=>'ꡌ','ꡍ'=>'ꡍ','ꡎ'=>'ꡎ','ꡏ'=>'ꡏ','ꡐ'=>'ꡐ','ꡑ'=>'ꡑ','ꡒ'=>'ꡒ','ꡓ'=>'ꡓ','ꡔ'=>'ꡔ','ꡕ'=>'ꡕ','ꡖ'=>'ꡖ','ꡗ'=>'ꡗ','ꡘ'=>'ꡘ','ꡙ'=>'ꡙ','ꡚ'=>'ꡚ','ꡛ'=>'ꡛ','ꡜ'=>'ꡜ','ꡝ'=>'ꡝ','ꡞ'=>'ꡞ','ꡟ'=>'ꡟ','ꡠ'=>'ꡠ','ꡡ'=>'ꡡ','ꡢ'=>'ꡢ','ꡣ'=>'ꡣ','ꡤ'=>'ꡤ','ꡥ'=>'ꡥ','ꡦ'=>'ꡦ','ꡧ'=>'ꡧ','ꡨ'=>'ꡨ','ꡩ'=>'ꡩ','ꡪ'=>'ꡪ','ꡫ'=>'ꡫ','ꡬ'=>'ꡬ','ꡭ'=>'ꡭ','ꡮ'=>'ꡮ','ꡯ'=>'ꡯ','ꡰ'=>'ꡰ','ꡱ'=>'ꡱ','ꡲ'=>'ꡲ','ꡳ'=>'ꡳ','가'=>'가');
diff --git a/phpBB/includes/utf/data/search_indexer_26.php b/phpBB/includes/utf/data/search_indexer_26.php
index b8718bd608..444ab96ba8 100644
--- a/phpBB/includes/utf/data/search_indexer_26.php
+++ b/phpBB/includes/utf/data/search_indexer_26.php
@@ -1 +1 @@
-<?php return array('힣'=>'힣'); \ No newline at end of file
+<?php return array('힣'=>'힣');
diff --git a/phpBB/includes/utf/data/search_indexer_3.php b/phpBB/includes/utf/data/search_indexer_3.php
index 41798c9e86..ceab762ca9 100644
--- a/phpBB/includes/utf/data/search_indexer_3.php
+++ b/phpBB/includes/utf/data/search_indexer_3.php
@@ -1 +1 @@
-<?php return array('᠋'=>'᠋','᠌'=>'᠌','᠍'=>'᠍','᠐'=>'0','᠑'=>'1','᠒'=>'2','᠓'=>'3','᠔'=>'4','᠕'=>'5','᠖'=>'6','᠗'=>'7','᠘'=>'8','᠙'=>'9','ᠠ'=>'ᠠ','ᠡ'=>'ᠡ','ᠢ'=>'ᠢ','ᠣ'=>'ᠣ','ᠤ'=>'ᠤ','ᠥ'=>'ᠥ','ᠦ'=>'ᠦ','ᠧ'=>'ᠧ','ᠨ'=>'ᠨ','ᠩ'=>'ᠩ','ᠪ'=>'ᠪ','ᠫ'=>'ᠫ','ᠬ'=>'ᠬ','ᠭ'=>'ᠭ','ᠮ'=>'ᠮ','ᠯ'=>'ᠯ','ᠰ'=>'ᠰ','ᠱ'=>'ᠱ','ᠲ'=>'ᠲ','ᠳ'=>'ᠳ','ᠴ'=>'ᠴ','ᠵ'=>'ᠵ','ᠶ'=>'ᠶ','ᠷ'=>'ᠷ','ᠸ'=>'ᠸ','ᠹ'=>'ᠹ','ᠺ'=>'ᠺ','ᠻ'=>'ᠻ','ᠼ'=>'ᠼ','ᠽ'=>'ᠽ','ᠾ'=>'ᠾ','ᠿ'=>'ᠿ','ᡀ'=>'ᡀ','ᡁ'=>'ᡁ','ᡂ'=>'ᡂ','ᡃ'=>'ᡃ','ᡄ'=>'ᡄ','ᡅ'=>'ᡅ','ᡆ'=>'ᡆ','ᡇ'=>'ᡇ','ᡈ'=>'ᡈ','ᡉ'=>'ᡉ','ᡊ'=>'ᡊ','ᡋ'=>'ᡋ','ᡌ'=>'ᡌ','ᡍ'=>'ᡍ','ᡎ'=>'ᡎ','ᡏ'=>'ᡏ','ᡐ'=>'ᡐ','ᡑ'=>'ᡑ','ᡒ'=>'ᡒ','ᡓ'=>'ᡓ','ᡔ'=>'ᡔ','ᡕ'=>'ᡕ','ᡖ'=>'ᡖ','ᡗ'=>'ᡗ','ᡘ'=>'ᡘ','ᡙ'=>'ᡙ','ᡚ'=>'ᡚ','ᡛ'=>'ᡛ','ᡜ'=>'ᡜ','ᡝ'=>'ᡝ','ᡞ'=>'ᡞ','ᡟ'=>'ᡟ','ᡠ'=>'ᡠ','ᡡ'=>'ᡡ','ᡢ'=>'ᡢ','ᡣ'=>'ᡣ','ᡤ'=>'ᡤ','ᡥ'=>'ᡥ','ᡦ'=>'ᡦ','ᡧ'=>'ᡧ','ᡨ'=>'ᡨ','ᡩ'=>'ᡩ','ᡪ'=>'ᡪ','ᡫ'=>'ᡫ','ᡬ'=>'ᡬ','ᡭ'=>'ᡭ','ᡮ'=>'ᡮ','ᡯ'=>'ᡯ','ᡰ'=>'ᡰ','ᡱ'=>'ᡱ','ᡲ'=>'ᡲ','ᡳ'=>'ᡳ','ᡴ'=>'ᡴ','ᡵ'=>'ᡵ','ᡶ'=>'ᡶ','ᡷ'=>'ᡷ','ᢀ'=>'ᢀ','ᢁ'=>'ᢁ','ᢂ'=>'ᢂ','ᢃ'=>'ᢃ','ᢄ'=>'ᢄ','ᢅ'=>'ᢅ','ᢆ'=>'ᢆ','ᢇ'=>'ᢇ','ᢈ'=>'ᢈ','ᢉ'=>'ᢉ','ᢊ'=>'ᢊ','ᢋ'=>'ᢋ','ᢌ'=>'ᢌ','ᢍ'=>'ᢍ','ᢎ'=>'ᢎ','ᢏ'=>'ᢏ','ᢐ'=>'ᢐ','ᢑ'=>'ᢑ','ᢒ'=>'ᢒ','ᢓ'=>'ᢓ','ᢔ'=>'ᢔ','ᢕ'=>'ᢕ','ᢖ'=>'ᢖ','ᢗ'=>'ᢗ','ᢘ'=>'ᢘ','ᢙ'=>'ᢙ','ᢚ'=>'ᢚ','ᢛ'=>'ᢛ','ᢜ'=>'ᢜ','ᢝ'=>'ᢝ','ᢞ'=>'ᢞ','ᢟ'=>'ᢟ','ᢠ'=>'ᢠ','ᢡ'=>'ᢡ','ᢢ'=>'ᢢ','ᢣ'=>'ᢣ','ᢤ'=>'ᢤ','ᢥ'=>'ᢥ','ᢦ'=>'ᢦ','ᢧ'=>'ᢧ','ᢨ'=>'ᢨ','ᢩ'=>'ᢩ','ᤀ'=>'ᤀ','ᤁ'=>'ᤁ','ᤂ'=>'ᤂ','ᤃ'=>'ᤃ','ᤄ'=>'ᤄ','ᤅ'=>'ᤅ','ᤆ'=>'ᤆ','ᤇ'=>'ᤇ','ᤈ'=>'ᤈ','ᤉ'=>'ᤉ','ᤊ'=>'ᤊ','ᤋ'=>'ᤋ','ᤌ'=>'ᤌ','ᤍ'=>'ᤍ','ᤎ'=>'ᤎ','ᤏ'=>'ᤏ','ᤐ'=>'ᤐ','ᤑ'=>'ᤑ','ᤒ'=>'ᤒ','ᤓ'=>'ᤓ','ᤔ'=>'ᤔ','ᤕ'=>'ᤕ','ᤖ'=>'ᤖ','ᤗ'=>'ᤗ','ᤘ'=>'ᤘ','ᤙ'=>'ᤙ','ᤚ'=>'ᤚ','ᤛ'=>'ᤛ','ᤜ'=>'ᤜ','ᤠ'=>'ᤠ','ᤡ'=>'ᤡ','ᤢ'=>'ᤢ','ᤣ'=>'ᤣ','ᤤ'=>'ᤤ','ᤥ'=>'ᤥ','ᤦ'=>'ᤦ','ᤧ'=>'ᤧ','ᤨ'=>'ᤨ','ᤩ'=>'ᤩ','ᤪ'=>'ᤪ','ᤫ'=>'ᤫ','ᤰ'=>'ᤰ','ᤱ'=>'ᤱ','ᤲ'=>'ᤲ','ᤳ'=>'ᤳ','ᤴ'=>'ᤴ','ᤵ'=>'ᤵ','ᤶ'=>'ᤶ','ᤷ'=>'ᤷ','ᤸ'=>'ᤸ','᤹'=>'᤹','᤺'=>'᤺','᤻'=>'᤻','᥆'=>'0','᥇'=>'1','᥈'=>'2','᥉'=>'3','᥊'=>'4','᥋'=>'5','᥌'=>'6','᥍'=>'7','᥎'=>'8','᥏'=>'9','ᥐ'=>'ᥐ','ᥑ'=>'ᥑ','ᥒ'=>'ᥒ','ᥓ'=>'ᥓ','ᥔ'=>'ᥔ','ᥕ'=>'ᥕ','ᥖ'=>'ᥖ','ᥗ'=>'ᥗ','ᥘ'=>'ᥘ','ᥙ'=>'ᥙ','ᥚ'=>'ᥚ','ᥛ'=>'ᥛ','ᥜ'=>'ᥜ','ᥝ'=>'ᥝ','ᥞ'=>'ᥞ','ᥟ'=>'ᥟ','ᥠ'=>'ᥠ','ᥡ'=>'ᥡ','ᥢ'=>'ᥢ','ᥣ'=>'ᥣ','ᥤ'=>'ᥤ','ᥥ'=>'ᥥ','ᥦ'=>'ᥦ','ᥧ'=>'ᥧ','ᥨ'=>'ᥨ','ᥩ'=>'ᥩ','ᥪ'=>'ᥪ','ᥫ'=>'ᥫ','ᥬ'=>'ᥬ','ᥭ'=>'ᥭ','ᥰ'=>'ᥰ','ᥱ'=>'ᥱ','ᥲ'=>'ᥲ','ᥳ'=>'ᥳ','ᥴ'=>'ᥴ','ᦀ'=>'ᦀ','ᦁ'=>'ᦁ','ᦂ'=>'ᦂ','ᦃ'=>'ᦃ','ᦄ'=>'ᦄ','ᦅ'=>'ᦅ','ᦆ'=>'ᦆ','ᦇ'=>'ᦇ','ᦈ'=>'ᦈ','ᦉ'=>'ᦉ','ᦊ'=>'ᦊ','ᦋ'=>'ᦋ','ᦌ'=>'ᦌ','ᦍ'=>'ᦍ','ᦎ'=>'ᦎ','ᦏ'=>'ᦏ','ᦐ'=>'ᦐ','ᦑ'=>'ᦑ','ᦒ'=>'ᦒ','ᦓ'=>'ᦓ','ᦔ'=>'ᦔ','ᦕ'=>'ᦕ','ᦖ'=>'ᦖ','ᦗ'=>'ᦗ','ᦘ'=>'ᦘ','ᦙ'=>'ᦙ','ᦚ'=>'ᦚ','ᦛ'=>'ᦛ','ᦜ'=>'ᦜ','ᦝ'=>'ᦝ','ᦞ'=>'ᦞ','ᦟ'=>'ᦟ','ᦠ'=>'ᦠ','ᦡ'=>'ᦡ','ᦢ'=>'ᦢ','ᦣ'=>'ᦣ','ᦤ'=>'ᦤ','ᦥ'=>'ᦥ','ᦦ'=>'ᦦ','ᦧ'=>'ᦧ','ᦨ'=>'ᦨ','ᦩ'=>'ᦩ','ᦰ'=>'ᦰ','ᦱ'=>'ᦱ','ᦲ'=>'ᦲ','ᦳ'=>'ᦳ','ᦴ'=>'ᦴ','ᦵ'=>'ᦵ','ᦶ'=>'ᦶ','ᦷ'=>'ᦷ','ᦸ'=>'ᦸ','ᦹ'=>'ᦹ','ᦺ'=>'ᦺ','ᦻ'=>'ᦻ','ᦼ'=>'ᦼ','ᦽ'=>'ᦽ','ᦾ'=>'ᦾ','ᦿ'=>'ᦿ','ᧀ'=>'ᧀ','ᧁ'=>'ᧁ','ᧂ'=>'ᧂ','ᧃ'=>'ᧃ','ᧄ'=>'ᧄ','ᧅ'=>'ᧅ','ᧆ'=>'ᧆ','ᧇ'=>'ᧇ','ᧈ'=>'ᧈ','ᧉ'=>'ᧉ','᧐'=>'0','᧑'=>'1','᧒'=>'2','᧓'=>'3','᧔'=>'4','᧕'=>'5','᧖'=>'6','᧗'=>'7','᧘'=>'8','᧙'=>'9','ᨀ'=>'ᨀ','ᨁ'=>'ᨁ','ᨂ'=>'ᨂ','ᨃ'=>'ᨃ','ᨄ'=>'ᨄ','ᨅ'=>'ᨅ','ᨆ'=>'ᨆ','ᨇ'=>'ᨇ','ᨈ'=>'ᨈ','ᨉ'=>'ᨉ','ᨊ'=>'ᨊ','ᨋ'=>'ᨋ','ᨌ'=>'ᨌ','ᨍ'=>'ᨍ','ᨎ'=>'ᨎ','ᨏ'=>'ᨏ','ᨐ'=>'ᨐ','ᨑ'=>'ᨑ','ᨒ'=>'ᨒ','ᨓ'=>'ᨓ','ᨔ'=>'ᨔ','ᨕ'=>'ᨕ','ᨖ'=>'ᨖ','ᨗ'=>'ᨗ','ᨘ'=>'ᨘ','ᨙ'=>'ᨙ','ᨚ'=>'ᨚ','ᨛ'=>'ᨛ','ᬀ'=>'ᬀ','ᬁ'=>'ᬁ','ᬂ'=>'ᬂ','ᬃ'=>'ᬃ','ᬄ'=>'ᬄ','ᬅ'=>'ᬅ','ᬆ'=>'ᬆ','ᬇ'=>'ᬇ','ᬈ'=>'ᬈ','ᬉ'=>'ᬉ','ᬊ'=>'ᬊ','ᬋ'=>'ᬋ','ᬌ'=>'ᬌ','ᬍ'=>'ᬍ','ᬎ'=>'ᬎ','ᬏ'=>'ᬏ','ᬐ'=>'ᬐ','ᬑ'=>'ᬑ','ᬒ'=>'ᬒ','ᬓ'=>'ᬓ','ᬔ'=>'ᬔ','ᬕ'=>'ᬕ','ᬖ'=>'ᬖ','ᬗ'=>'ᬗ','ᬘ'=>'ᬘ','ᬙ'=>'ᬙ','ᬚ'=>'ᬚ','ᬛ'=>'ᬛ','ᬜ'=>'ᬜ','ᬝ'=>'ᬝ','ᬞ'=>'ᬞ','ᬟ'=>'ᬟ','ᬠ'=>'ᬠ','ᬡ'=>'ᬡ','ᬢ'=>'ᬢ','ᬣ'=>'ᬣ','ᬤ'=>'ᬤ','ᬥ'=>'ᬥ','ᬦ'=>'ᬦ','ᬧ'=>'ᬧ','ᬨ'=>'ᬨ','ᬩ'=>'ᬩ','ᬪ'=>'ᬪ','ᬫ'=>'ᬫ','ᬬ'=>'ᬬ','ᬭ'=>'ᬭ','ᬮ'=>'ᬮ','ᬯ'=>'ᬯ','ᬰ'=>'ᬰ','ᬱ'=>'ᬱ','ᬲ'=>'ᬲ','ᬳ'=>'ᬳ','᬴'=>'᬴','ᬵ'=>'ᬵ','ᬶ'=>'ᬶ','ᬷ'=>'ᬷ','ᬸ'=>'ᬸ','ᬹ'=>'ᬹ','ᬺ'=>'ᬺ','ᬻ'=>'ᬻ','ᬼ'=>'ᬼ','ᬽ'=>'ᬽ','ᬾ'=>'ᬾ','ᬿ'=>'ᬿ','ᭀ'=>'ᭀ','ᭁ'=>'ᭁ','ᭂ'=>'ᭂ','ᭃ'=>'ᭃ','᭄'=>'᭄','ᭅ'=>'ᭅ','ᭆ'=>'ᭆ','ᭇ'=>'ᭇ','ᭈ'=>'ᭈ','ᭉ'=>'ᭉ','ᭊ'=>'ᭊ','ᭋ'=>'ᭋ','᭐'=>'0','᭑'=>'1','᭒'=>'2','᭓'=>'3','᭔'=>'4','᭕'=>'5','᭖'=>'6','᭗'=>'7','᭘'=>'8','᭙'=>'9','᭫'=>'᭫','᭬'=>'᭬','᭭'=>'᭭','᭮'=>'᭮','᭯'=>'᭯','᭰'=>'᭰','᭱'=>'᭱','᭲'=>'᭲','᭳'=>'᭳','ᴀ'=>'ᴀ','ᴁ'=>'ᴁ','ᴂ'=>'ᴂ','ᴃ'=>'ᴃ','ᴄ'=>'ᴄ','ᴅ'=>'ᴅ','ᴆ'=>'ᴆ','ᴇ'=>'ᴇ','ᴈ'=>'ᴈ','ᴉ'=>'ᴉ','ᴊ'=>'ᴊ','ᴋ'=>'ᴋ','ᴌ'=>'ᴌ','ᴍ'=>'ᴍ','ᴎ'=>'ᴎ','ᴏ'=>'ᴏ','ᴐ'=>'ᴐ','ᴑ'=>'ᴑ','ᴒ'=>'ᴒ','ᴓ'=>'ᴓ','ᴔ'=>'ᴔ','ᴕ'=>'ᴕ','ᴖ'=>'ᴖ','ᴗ'=>'ᴗ','ᴘ'=>'ᴘ','ᴙ'=>'ᴙ','ᴚ'=>'ᴚ','ᴛ'=>'ᴛ','ᴜ'=>'ᴜ','ᴝ'=>'ᴝ','ᴞ'=>'ᴞ','ᴟ'=>'ᴟ','ᴠ'=>'ᴠ','ᴡ'=>'ᴡ','ᴢ'=>'ᴢ','ᴣ'=>'ᴣ','ᴤ'=>'ᴤ','ᴥ'=>'ᴥ','ᴦ'=>'ᴦ','ᴧ'=>'ᴧ','ᴨ'=>'ᴨ','ᴩ'=>'ᴩ','ᴪ'=>'ᴪ','ᴫ'=>'ᴫ','ᴬ'=>'ᴬ','ᴭ'=>'ᴭ','ᴮ'=>'ᴮ','ᴯ'=>'ᴯ','ᴰ'=>'ᴰ','ᴱ'=>'ᴱ','ᴲ'=>'ᴲ','ᴳ'=>'ᴳ','ᴴ'=>'ᴴ','ᴵ'=>'ᴵ','ᴶ'=>'ᴶ','ᴷ'=>'ᴷ','ᴸ'=>'ᴸ','ᴹ'=>'ᴹ','ᴺ'=>'ᴺ','ᴻ'=>'ᴻ','ᴼ'=>'ᴼ','ᴽ'=>'ᴽ','ᴾ'=>'ᴾ','ᴿ'=>'ᴿ','ᵀ'=>'ᵀ','ᵁ'=>'ᵁ','ᵂ'=>'ᵂ','ᵃ'=>'ᵃ','ᵄ'=>'ᵄ','ᵅ'=>'ᵅ','ᵆ'=>'ᵆ','ᵇ'=>'ᵇ','ᵈ'=>'ᵈ','ᵉ'=>'ᵉ','ᵊ'=>'ᵊ','ᵋ'=>'ᵋ','ᵌ'=>'ᵌ','ᵍ'=>'ᵍ','ᵎ'=>'ᵎ','ᵏ'=>'ᵏ','ᵐ'=>'ᵐ','ᵑ'=>'ᵑ','ᵒ'=>'ᵒ','ᵓ'=>'ᵓ','ᵔ'=>'ᵔ','ᵕ'=>'ᵕ','ᵖ'=>'ᵖ','ᵗ'=>'ᵗ','ᵘ'=>'ᵘ','ᵙ'=>'ᵙ','ᵚ'=>'ᵚ','ᵛ'=>'ᵛ','ᵜ'=>'ᵜ','ᵝ'=>'ᵝ','ᵞ'=>'ᵞ','ᵟ'=>'ᵟ','ᵠ'=>'ᵠ','ᵡ'=>'ᵡ','ᵢ'=>'ᵢ','ᵣ'=>'ᵣ','ᵤ'=>'ᵤ','ᵥ'=>'ᵥ','ᵦ'=>'ᵦ','ᵧ'=>'ᵧ','ᵨ'=>'ᵨ','ᵩ'=>'ᵩ','ᵪ'=>'ᵪ','ᵫ'=>'ue','ᵬ'=>'ᵬ','ᵭ'=>'ᵭ','ᵮ'=>'ᵮ','ᵯ'=>'ᵯ','ᵰ'=>'ᵰ','ᵱ'=>'ᵱ','ᵲ'=>'ᵲ','ᵳ'=>'ᵳ','ᵴ'=>'ᵴ','ᵵ'=>'ᵵ','ᵶ'=>'ᵶ','ᵷ'=>'ᵷ','ᵸ'=>'ᵸ','ᵹ'=>'ᵹ','ᵺ'=>'ᵺ','ᵻ'=>'ᵻ','ᵼ'=>'ᵼ','ᵽ'=>'ᵽ','ᵾ'=>'ᵾ','ᵿ'=>'ᵿ','ᶀ'=>'ᶀ','ᶁ'=>'ᶁ','ᶂ'=>'ᶂ','ᶃ'=>'ᶃ','ᶄ'=>'ᶄ','ᶅ'=>'ᶅ','ᶆ'=>'ᶆ','ᶇ'=>'ᶇ','ᶈ'=>'ᶈ','ᶉ'=>'ᶉ','ᶊ'=>'ᶊ','ᶋ'=>'ᶋ','ᶌ'=>'ᶌ','ᶍ'=>'ᶍ','ᶎ'=>'ᶎ','ᶏ'=>'ᶏ','ᶐ'=>'ᶐ','ᶑ'=>'ᶑ','ᶒ'=>'ᶒ','ᶓ'=>'ᶓ','ᶔ'=>'ᶔ','ᶕ'=>'ᶕ','ᶖ'=>'ᶖ','ᶗ'=>'ᶗ','ᶘ'=>'ᶘ','ᶙ'=>'ᶙ','ᶚ'=>'ᶚ','ᶛ'=>'ᶛ','ᶜ'=>'ᶜ','ᶝ'=>'ᶝ','ᶞ'=>'ᶞ','ᶟ'=>'ᶟ','ᶠ'=>'ᶠ','ᶡ'=>'ᶡ','ᶢ'=>'ᶢ','ᶣ'=>'ᶣ','ᶤ'=>'ᶤ','ᶥ'=>'ᶥ','ᶦ'=>'ᶦ','ᶧ'=>'ᶧ','ᶨ'=>'ᶨ','ᶩ'=>'ᶩ','ᶪ'=>'ᶪ','ᶫ'=>'ᶫ','ᶬ'=>'ᶬ','ᶭ'=>'ᶭ','ᶮ'=>'ᶮ','ᶯ'=>'ᶯ','ᶰ'=>'ᶰ','ᶱ'=>'ᶱ','ᶲ'=>'ᶲ','ᶳ'=>'ᶳ','ᶴ'=>'ᶴ','ᶵ'=>'ᶵ','ᶶ'=>'ᶶ','ᶷ'=>'ᶷ','ᶸ'=>'ᶸ','ᶹ'=>'ᶹ','ᶺ'=>'ᶺ','ᶻ'=>'ᶻ','ᶼ'=>'ᶼ','ᶽ'=>'ᶽ','ᶾ'=>'ᶾ','ᶿ'=>'ᶿ','᷀'=>'᷀','᷁'=>'᷁','᷂'=>'᷂','᷃'=>'᷃','᷄'=>'᷄','᷅'=>'᷅','᷆'=>'᷆','᷇'=>'᷇','᷈'=>'᷈','᷉'=>'᷉','᷊'=>'᷊','᷾'=>'᷾','᷿'=>'᷿','Ḁ'=>'ḁ','ḁ'=>'ḁ','Ḃ'=>'ḃ','ḃ'=>'ḃ','Ḅ'=>'ḅ','ḅ'=>'ḅ','Ḇ'=>'ḇ','ḇ'=>'ḇ','Ḉ'=>'ḉ','ḉ'=>'ḉ','Ḋ'=>'ḋ','ḋ'=>'ḋ','Ḍ'=>'ḍ','ḍ'=>'ḍ','Ḏ'=>'ḏ','ḏ'=>'ḏ','Ḑ'=>'ḑ','ḑ'=>'ḑ','Ḓ'=>'ḓ','ḓ'=>'ḓ','Ḕ'=>'ḕ','ḕ'=>'ḕ','Ḗ'=>'ḗ','ḗ'=>'ḗ','Ḙ'=>'ḙ','ḙ'=>'ḙ','Ḛ'=>'ḛ','ḛ'=>'ḛ','Ḝ'=>'ḝ','ḝ'=>'ḝ','Ḟ'=>'ḟ','ḟ'=>'ḟ','Ḡ'=>'ḡ','ḡ'=>'ḡ','Ḣ'=>'ḣ','ḣ'=>'ḣ','Ḥ'=>'ḥ','ḥ'=>'ḥ','Ḧ'=>'ḧ','ḧ'=>'ḧ','Ḩ'=>'ḩ','ḩ'=>'ḩ','Ḫ'=>'ḫ','ḫ'=>'ḫ','Ḭ'=>'ḭ','ḭ'=>'ḭ','Ḯ'=>'ḯ','ḯ'=>'ḯ','Ḱ'=>'ḱ','ḱ'=>'ḱ','Ḳ'=>'ḳ','ḳ'=>'ḳ','Ḵ'=>'ḵ','ḵ'=>'ḵ','Ḷ'=>'ḷ','ḷ'=>'ḷ','Ḹ'=>'ḹ','ḹ'=>'ḹ','Ḻ'=>'ḻ','ḻ'=>'ḻ','Ḽ'=>'ḽ','ḽ'=>'ḽ','Ḿ'=>'ḿ','ḿ'=>'ḿ','Ṁ'=>'ṁ','ṁ'=>'ṁ','Ṃ'=>'ṃ','ṃ'=>'ṃ','Ṅ'=>'ṅ','ṅ'=>'ṅ','Ṇ'=>'ṇ','ṇ'=>'ṇ','Ṉ'=>'ṉ','ṉ'=>'ṉ','Ṋ'=>'ṋ','ṋ'=>'ṋ','Ṍ'=>'ṍ','ṍ'=>'ṍ','Ṏ'=>'ṏ','ṏ'=>'ṏ','Ṑ'=>'ṑ','ṑ'=>'ṑ','Ṓ'=>'ṓ','ṓ'=>'ṓ','Ṕ'=>'ṕ','ṕ'=>'ṕ','Ṗ'=>'ṗ','ṗ'=>'ṗ','Ṙ'=>'ṙ','ṙ'=>'ṙ','Ṛ'=>'ṛ','ṛ'=>'ṛ','Ṝ'=>'ṝ','ṝ'=>'ṝ','Ṟ'=>'ṟ','ṟ'=>'ṟ','Ṡ'=>'ṡ','ṡ'=>'ṡ','Ṣ'=>'ṣ','ṣ'=>'ṣ','Ṥ'=>'ṥ','ṥ'=>'ṥ','Ṧ'=>'ṧ','ṧ'=>'ṧ','Ṩ'=>'ṩ','ṩ'=>'ṩ','Ṫ'=>'ṫ','ṫ'=>'ṫ','Ṭ'=>'ṭ','ṭ'=>'ṭ','Ṯ'=>'ṯ','ṯ'=>'ṯ','Ṱ'=>'ṱ','ṱ'=>'ṱ','Ṳ'=>'ṳ','ṳ'=>'ṳ','Ṵ'=>'ṵ','ṵ'=>'ṵ','Ṷ'=>'ṷ','ṷ'=>'ṷ','Ṹ'=>'ṹ','ṹ'=>'ṹ','Ṻ'=>'ṻ','ṻ'=>'ṻ','Ṽ'=>'ṽ','ṽ'=>'ṽ','Ṿ'=>'ṿ','ṿ'=>'ṿ','Ẁ'=>'ẁ','ẁ'=>'ẁ','Ẃ'=>'ẃ','ẃ'=>'ẃ','Ẅ'=>'ẅ','ẅ'=>'ẅ','Ẇ'=>'ẇ','ẇ'=>'ẇ','Ẉ'=>'ẉ','ẉ'=>'ẉ','Ẋ'=>'ẋ','ẋ'=>'ẋ','Ẍ'=>'ẍ','ẍ'=>'ẍ','Ẏ'=>'ẏ','ẏ'=>'ẏ','Ẑ'=>'ẑ','ẑ'=>'ẑ','Ẓ'=>'ẓ','ẓ'=>'ẓ','Ẕ'=>'ẕ','ẕ'=>'ẕ','ẖ'=>'ẖ','ẗ'=>'ẗ','ẘ'=>'ẘ','ẙ'=>'ẙ','ẚ'=>'ẚ','ẛ'=>'ẛ','Ạ'=>'ạ','ạ'=>'ạ','Ả'=>'ả','ả'=>'ả','Ấ'=>'ấ','ấ'=>'ấ','Ầ'=>'ầ','ầ'=>'ầ','Ẩ'=>'ẩ','ẩ'=>'ẩ','Ẫ'=>'ẫ','ẫ'=>'ẫ','Ậ'=>'ậ','ậ'=>'ậ','Ắ'=>'ắ','ắ'=>'ắ','Ằ'=>'ằ','ằ'=>'ằ','Ẳ'=>'ẳ','ẳ'=>'ẳ','Ẵ'=>'ẵ','ẵ'=>'ẵ','Ặ'=>'ặ','ặ'=>'ặ','Ẹ'=>'ẹ','ẹ'=>'ẹ','Ẻ'=>'ẻ','ẻ'=>'ẻ','Ẽ'=>'ẽ','ẽ'=>'ẽ','Ế'=>'ế','ế'=>'ế','Ề'=>'ề','ề'=>'ề','Ể'=>'ể','ể'=>'ể','Ễ'=>'ễ','ễ'=>'ễ','Ệ'=>'ệ','ệ'=>'ệ','Ỉ'=>'ỉ','ỉ'=>'ỉ','Ị'=>'ị','ị'=>'ị','Ọ'=>'ọ','ọ'=>'ọ','Ỏ'=>'ỏ','ỏ'=>'ỏ','Ố'=>'ố','ố'=>'ố','Ồ'=>'ồ','ồ'=>'ồ','Ổ'=>'ổ','ổ'=>'ổ','Ỗ'=>'ỗ','ỗ'=>'ỗ','Ộ'=>'ộ','ộ'=>'ộ','Ớ'=>'ớ','ớ'=>'ớ','Ờ'=>'ờ','ờ'=>'ờ','Ở'=>'ở','ở'=>'ở','Ỡ'=>'ỡ','ỡ'=>'ỡ','Ợ'=>'ợ','ợ'=>'ợ','Ụ'=>'ụ','ụ'=>'ụ','Ủ'=>'ủ','ủ'=>'ủ','Ứ'=>'ứ','ứ'=>'ứ','Ừ'=>'ừ','ừ'=>'ừ','Ử'=>'ử','ử'=>'ử','Ữ'=>'ữ','ữ'=>'ữ','Ự'=>'ự','ự'=>'ự','Ỳ'=>'ỳ','ỳ'=>'ỳ','Ỵ'=>'ỵ','ỵ'=>'ỵ','Ỷ'=>'ỷ','ỷ'=>'ỷ','Ỹ'=>'ỹ','ỹ'=>'ỹ','ἀ'=>'ἀ','ἁ'=>'ἁ','ἂ'=>'ἂ','ἃ'=>'ἃ','ἄ'=>'ἄ','ἅ'=>'ἅ','ἆ'=>'ἆ','ἇ'=>'ἇ','Ἀ'=>'ἀ','Ἁ'=>'ἁ','Ἂ'=>'ἂ','Ἃ'=>'ἃ','Ἄ'=>'ἄ','Ἅ'=>'ἅ','Ἆ'=>'ἆ','Ἇ'=>'ἇ','ἐ'=>'ἐ','ἑ'=>'ἑ','ἒ'=>'ἒ','ἓ'=>'ἓ','ἔ'=>'ἔ','ἕ'=>'ἕ','Ἐ'=>'ἐ','Ἑ'=>'ἑ','Ἒ'=>'ἒ','Ἓ'=>'ἓ','Ἔ'=>'ἔ','Ἕ'=>'ἕ','ἠ'=>'ἠ','ἡ'=>'ἡ','ἢ'=>'ἢ','ἣ'=>'ἣ','ἤ'=>'ἤ','ἥ'=>'ἥ','ἦ'=>'ἦ','ἧ'=>'ἧ','Ἠ'=>'ἠ','Ἡ'=>'ἡ','Ἢ'=>'ἢ','Ἣ'=>'ἣ','Ἤ'=>'ἤ','Ἥ'=>'ἥ','Ἦ'=>'ἦ','Ἧ'=>'ἧ','ἰ'=>'ἰ','ἱ'=>'ἱ','ἲ'=>'ἲ','ἳ'=>'ἳ','ἴ'=>'ἴ','ἵ'=>'ἵ','ἶ'=>'ἶ','ἷ'=>'ἷ','Ἰ'=>'ἰ','Ἱ'=>'ἱ','Ἲ'=>'ἲ','Ἳ'=>'ἳ','Ἴ'=>'ἴ','Ἵ'=>'ἵ','Ἶ'=>'ἶ','Ἷ'=>'ἷ','ὀ'=>'ὀ','ὁ'=>'ὁ','ὂ'=>'ὂ','ὃ'=>'ὃ','ὄ'=>'ὄ','ὅ'=>'ὅ','Ὀ'=>'ὀ','Ὁ'=>'ὁ','Ὂ'=>'ὂ','Ὃ'=>'ὃ','Ὄ'=>'ὄ','Ὅ'=>'ὅ','ὐ'=>'ὐ','ὑ'=>'ὑ','ὒ'=>'ὒ','ὓ'=>'ὓ','ὔ'=>'ὔ','ὕ'=>'ὕ','ὖ'=>'ὖ','ὗ'=>'ὗ','Ὑ'=>'ὑ','Ὓ'=>'ὓ','Ὕ'=>'ὕ','Ὗ'=>'ὗ','ὠ'=>'ὠ','ὡ'=>'ὡ','ὢ'=>'ὢ','ὣ'=>'ὣ','ὤ'=>'ὤ','ὥ'=>'ὥ','ὦ'=>'ὦ','ὧ'=>'ὧ','Ὠ'=>'ὠ','Ὡ'=>'ὡ','Ὢ'=>'ὢ','Ὣ'=>'ὣ','Ὤ'=>'ὤ','Ὥ'=>'ὥ','Ὦ'=>'ὦ','Ὧ'=>'ὧ','ὰ'=>'ὰ','ά'=>'ά','ὲ'=>'ὲ','έ'=>'έ','ὴ'=>'ὴ','ή'=>'ή','ὶ'=>'ὶ','ί'=>'ί','ὸ'=>'ὸ','ό'=>'ό','ὺ'=>'ὺ','ύ'=>'ύ','ὼ'=>'ὼ','ώ'=>'ώ','ᾀ'=>'ᾀ','ᾁ'=>'ᾁ','ᾂ'=>'ᾂ','ᾃ'=>'ᾃ','ᾄ'=>'ᾄ','ᾅ'=>'ᾅ','ᾆ'=>'ᾆ','ᾇ'=>'ᾇ','ᾈ'=>'ᾀ','ᾉ'=>'ᾁ','ᾊ'=>'ᾂ','ᾋ'=>'ᾃ','ᾌ'=>'ᾄ','ᾍ'=>'ᾅ','ᾎ'=>'ᾆ','ᾏ'=>'ᾇ','ᾐ'=>'ᾐ','ᾑ'=>'ᾑ','ᾒ'=>'ᾒ','ᾓ'=>'ᾓ','ᾔ'=>'ᾔ','ᾕ'=>'ᾕ','ᾖ'=>'ᾖ','ᾗ'=>'ᾗ','ᾘ'=>'ᾐ','ᾙ'=>'ᾑ','ᾚ'=>'ᾒ','ᾛ'=>'ᾓ','ᾜ'=>'ᾔ','ᾝ'=>'ᾕ','ᾞ'=>'ᾖ','ᾟ'=>'ᾗ','ᾠ'=>'ᾠ','ᾡ'=>'ᾡ','ᾢ'=>'ᾢ','ᾣ'=>'ᾣ','ᾤ'=>'ᾤ','ᾥ'=>'ᾥ','ᾦ'=>'ᾦ','ᾧ'=>'ᾧ','ᾨ'=>'ᾠ','ᾩ'=>'ᾡ','ᾪ'=>'ᾢ','ᾫ'=>'ᾣ','ᾬ'=>'ᾤ','ᾭ'=>'ᾥ','ᾮ'=>'ᾦ','ᾯ'=>'ᾧ','ᾰ'=>'ᾰ','ᾱ'=>'ᾱ','ᾲ'=>'ᾲ','ᾳ'=>'ᾳ','ᾴ'=>'ᾴ','ᾶ'=>'ᾶ','ᾷ'=>'ᾷ','Ᾰ'=>'ᾰ','Ᾱ'=>'ᾱ','Ὰ'=>'ὰ','Ά'=>'ά','ᾼ'=>'ᾳ','ι'=>'ι','ῂ'=>'ῂ','ῃ'=>'ῃ','ῄ'=>'ῄ','ῆ'=>'ῆ','ῇ'=>'ῇ','Ὲ'=>'ὲ','Έ'=>'έ','Ὴ'=>'ὴ','Ή'=>'ή','ῌ'=>'ῃ','ῐ'=>'ῐ','ῑ'=>'ῑ','ῒ'=>'ῒ','ΐ'=>'ΐ','ῖ'=>'ῖ','ῗ'=>'ῗ','Ῐ'=>'ῐ','Ῑ'=>'ῑ','Ὶ'=>'ὶ','Ί'=>'ί','ῠ'=>'ῠ','ῡ'=>'ῡ','ῢ'=>'ῢ','ΰ'=>'ΰ','ῤ'=>'ῤ','ῥ'=>'ῥ','ῦ'=>'ῦ','ῧ'=>'ῧ','Ῠ'=>'ῠ','Ῡ'=>'ῡ','Ὺ'=>'ὺ','Ύ'=>'ύ','Ῥ'=>'ῥ','ῲ'=>'ῲ','ῳ'=>'ῳ','ῴ'=>'ῴ','ῶ'=>'ῶ','ῷ'=>'ῷ','Ὸ'=>'ὸ','Ό'=>'ό','Ὼ'=>'ὼ','Ώ'=>'ώ','ῼ'=>'ῳ'); \ No newline at end of file
+<?php return array('᠋'=>'᠋','᠌'=>'᠌','᠍'=>'᠍','᠐'=>'0','᠑'=>'1','᠒'=>'2','᠓'=>'3','᠔'=>'4','᠕'=>'5','᠖'=>'6','᠗'=>'7','᠘'=>'8','᠙'=>'9','ᠠ'=>'ᠠ','ᠡ'=>'ᠡ','ᠢ'=>'ᠢ','ᠣ'=>'ᠣ','ᠤ'=>'ᠤ','ᠥ'=>'ᠥ','ᠦ'=>'ᠦ','ᠧ'=>'ᠧ','ᠨ'=>'ᠨ','ᠩ'=>'ᠩ','ᠪ'=>'ᠪ','ᠫ'=>'ᠫ','ᠬ'=>'ᠬ','ᠭ'=>'ᠭ','ᠮ'=>'ᠮ','ᠯ'=>'ᠯ','ᠰ'=>'ᠰ','ᠱ'=>'ᠱ','ᠲ'=>'ᠲ','ᠳ'=>'ᠳ','ᠴ'=>'ᠴ','ᠵ'=>'ᠵ','ᠶ'=>'ᠶ','ᠷ'=>'ᠷ','ᠸ'=>'ᠸ','ᠹ'=>'ᠹ','ᠺ'=>'ᠺ','ᠻ'=>'ᠻ','ᠼ'=>'ᠼ','ᠽ'=>'ᠽ','ᠾ'=>'ᠾ','ᠿ'=>'ᠿ','ᡀ'=>'ᡀ','ᡁ'=>'ᡁ','ᡂ'=>'ᡂ','ᡃ'=>'ᡃ','ᡄ'=>'ᡄ','ᡅ'=>'ᡅ','ᡆ'=>'ᡆ','ᡇ'=>'ᡇ','ᡈ'=>'ᡈ','ᡉ'=>'ᡉ','ᡊ'=>'ᡊ','ᡋ'=>'ᡋ','ᡌ'=>'ᡌ','ᡍ'=>'ᡍ','ᡎ'=>'ᡎ','ᡏ'=>'ᡏ','ᡐ'=>'ᡐ','ᡑ'=>'ᡑ','ᡒ'=>'ᡒ','ᡓ'=>'ᡓ','ᡔ'=>'ᡔ','ᡕ'=>'ᡕ','ᡖ'=>'ᡖ','ᡗ'=>'ᡗ','ᡘ'=>'ᡘ','ᡙ'=>'ᡙ','ᡚ'=>'ᡚ','ᡛ'=>'ᡛ','ᡜ'=>'ᡜ','ᡝ'=>'ᡝ','ᡞ'=>'ᡞ','ᡟ'=>'ᡟ','ᡠ'=>'ᡠ','ᡡ'=>'ᡡ','ᡢ'=>'ᡢ','ᡣ'=>'ᡣ','ᡤ'=>'ᡤ','ᡥ'=>'ᡥ','ᡦ'=>'ᡦ','ᡧ'=>'ᡧ','ᡨ'=>'ᡨ','ᡩ'=>'ᡩ','ᡪ'=>'ᡪ','ᡫ'=>'ᡫ','ᡬ'=>'ᡬ','ᡭ'=>'ᡭ','ᡮ'=>'ᡮ','ᡯ'=>'ᡯ','ᡰ'=>'ᡰ','ᡱ'=>'ᡱ','ᡲ'=>'ᡲ','ᡳ'=>'ᡳ','ᡴ'=>'ᡴ','ᡵ'=>'ᡵ','ᡶ'=>'ᡶ','ᡷ'=>'ᡷ','ᢀ'=>'ᢀ','ᢁ'=>'ᢁ','ᢂ'=>'ᢂ','ᢃ'=>'ᢃ','ᢄ'=>'ᢄ','ᢅ'=>'ᢅ','ᢆ'=>'ᢆ','ᢇ'=>'ᢇ','ᢈ'=>'ᢈ','ᢉ'=>'ᢉ','ᢊ'=>'ᢊ','ᢋ'=>'ᢋ','ᢌ'=>'ᢌ','ᢍ'=>'ᢍ','ᢎ'=>'ᢎ','ᢏ'=>'ᢏ','ᢐ'=>'ᢐ','ᢑ'=>'ᢑ','ᢒ'=>'ᢒ','ᢓ'=>'ᢓ','ᢔ'=>'ᢔ','ᢕ'=>'ᢕ','ᢖ'=>'ᢖ','ᢗ'=>'ᢗ','ᢘ'=>'ᢘ','ᢙ'=>'ᢙ','ᢚ'=>'ᢚ','ᢛ'=>'ᢛ','ᢜ'=>'ᢜ','ᢝ'=>'ᢝ','ᢞ'=>'ᢞ','ᢟ'=>'ᢟ','ᢠ'=>'ᢠ','ᢡ'=>'ᢡ','ᢢ'=>'ᢢ','ᢣ'=>'ᢣ','ᢤ'=>'ᢤ','ᢥ'=>'ᢥ','ᢦ'=>'ᢦ','ᢧ'=>'ᢧ','ᢨ'=>'ᢨ','ᢩ'=>'ᢩ','ᤀ'=>'ᤀ','ᤁ'=>'ᤁ','ᤂ'=>'ᤂ','ᤃ'=>'ᤃ','ᤄ'=>'ᤄ','ᤅ'=>'ᤅ','ᤆ'=>'ᤆ','ᤇ'=>'ᤇ','ᤈ'=>'ᤈ','ᤉ'=>'ᤉ','ᤊ'=>'ᤊ','ᤋ'=>'ᤋ','ᤌ'=>'ᤌ','ᤍ'=>'ᤍ','ᤎ'=>'ᤎ','ᤏ'=>'ᤏ','ᤐ'=>'ᤐ','ᤑ'=>'ᤑ','ᤒ'=>'ᤒ','ᤓ'=>'ᤓ','ᤔ'=>'ᤔ','ᤕ'=>'ᤕ','ᤖ'=>'ᤖ','ᤗ'=>'ᤗ','ᤘ'=>'ᤘ','ᤙ'=>'ᤙ','ᤚ'=>'ᤚ','ᤛ'=>'ᤛ','ᤜ'=>'ᤜ','ᤠ'=>'ᤠ','ᤡ'=>'ᤡ','ᤢ'=>'ᤢ','ᤣ'=>'ᤣ','ᤤ'=>'ᤤ','ᤥ'=>'ᤥ','ᤦ'=>'ᤦ','ᤧ'=>'ᤧ','ᤨ'=>'ᤨ','ᤩ'=>'ᤩ','ᤪ'=>'ᤪ','ᤫ'=>'ᤫ','ᤰ'=>'ᤰ','ᤱ'=>'ᤱ','ᤲ'=>'ᤲ','ᤳ'=>'ᤳ','ᤴ'=>'ᤴ','ᤵ'=>'ᤵ','ᤶ'=>'ᤶ','ᤷ'=>'ᤷ','ᤸ'=>'ᤸ','᤹'=>'᤹','᤺'=>'᤺','᤻'=>'᤻','᥆'=>'0','᥇'=>'1','᥈'=>'2','᥉'=>'3','᥊'=>'4','᥋'=>'5','᥌'=>'6','᥍'=>'7','᥎'=>'8','᥏'=>'9','ᥐ'=>'ᥐ','ᥑ'=>'ᥑ','ᥒ'=>'ᥒ','ᥓ'=>'ᥓ','ᥔ'=>'ᥔ','ᥕ'=>'ᥕ','ᥖ'=>'ᥖ','ᥗ'=>'ᥗ','ᥘ'=>'ᥘ','ᥙ'=>'ᥙ','ᥚ'=>'ᥚ','ᥛ'=>'ᥛ','ᥜ'=>'ᥜ','ᥝ'=>'ᥝ','ᥞ'=>'ᥞ','ᥟ'=>'ᥟ','ᥠ'=>'ᥠ','ᥡ'=>'ᥡ','ᥢ'=>'ᥢ','ᥣ'=>'ᥣ','ᥤ'=>'ᥤ','ᥥ'=>'ᥥ','ᥦ'=>'ᥦ','ᥧ'=>'ᥧ','ᥨ'=>'ᥨ','ᥩ'=>'ᥩ','ᥪ'=>'ᥪ','ᥫ'=>'ᥫ','ᥬ'=>'ᥬ','ᥭ'=>'ᥭ','ᥰ'=>'ᥰ','ᥱ'=>'ᥱ','ᥲ'=>'ᥲ','ᥳ'=>'ᥳ','ᥴ'=>'ᥴ','ᦀ'=>'ᦀ','ᦁ'=>'ᦁ','ᦂ'=>'ᦂ','ᦃ'=>'ᦃ','ᦄ'=>'ᦄ','ᦅ'=>'ᦅ','ᦆ'=>'ᦆ','ᦇ'=>'ᦇ','ᦈ'=>'ᦈ','ᦉ'=>'ᦉ','ᦊ'=>'ᦊ','ᦋ'=>'ᦋ','ᦌ'=>'ᦌ','ᦍ'=>'ᦍ','ᦎ'=>'ᦎ','ᦏ'=>'ᦏ','ᦐ'=>'ᦐ','ᦑ'=>'ᦑ','ᦒ'=>'ᦒ','ᦓ'=>'ᦓ','ᦔ'=>'ᦔ','ᦕ'=>'ᦕ','ᦖ'=>'ᦖ','ᦗ'=>'ᦗ','ᦘ'=>'ᦘ','ᦙ'=>'ᦙ','ᦚ'=>'ᦚ','ᦛ'=>'ᦛ','ᦜ'=>'ᦜ','ᦝ'=>'ᦝ','ᦞ'=>'ᦞ','ᦟ'=>'ᦟ','ᦠ'=>'ᦠ','ᦡ'=>'ᦡ','ᦢ'=>'ᦢ','ᦣ'=>'ᦣ','ᦤ'=>'ᦤ','ᦥ'=>'ᦥ','ᦦ'=>'ᦦ','ᦧ'=>'ᦧ','ᦨ'=>'ᦨ','ᦩ'=>'ᦩ','ᦰ'=>'ᦰ','ᦱ'=>'ᦱ','ᦲ'=>'ᦲ','ᦳ'=>'ᦳ','ᦴ'=>'ᦴ','ᦵ'=>'ᦵ','ᦶ'=>'ᦶ','ᦷ'=>'ᦷ','ᦸ'=>'ᦸ','ᦹ'=>'ᦹ','ᦺ'=>'ᦺ','ᦻ'=>'ᦻ','ᦼ'=>'ᦼ','ᦽ'=>'ᦽ','ᦾ'=>'ᦾ','ᦿ'=>'ᦿ','ᧀ'=>'ᧀ','ᧁ'=>'ᧁ','ᧂ'=>'ᧂ','ᧃ'=>'ᧃ','ᧄ'=>'ᧄ','ᧅ'=>'ᧅ','ᧆ'=>'ᧆ','ᧇ'=>'ᧇ','ᧈ'=>'ᧈ','ᧉ'=>'ᧉ','᧐'=>'0','᧑'=>'1','᧒'=>'2','᧓'=>'3','᧔'=>'4','᧕'=>'5','᧖'=>'6','᧗'=>'7','᧘'=>'8','᧙'=>'9','ᨀ'=>'ᨀ','ᨁ'=>'ᨁ','ᨂ'=>'ᨂ','ᨃ'=>'ᨃ','ᨄ'=>'ᨄ','ᨅ'=>'ᨅ','ᨆ'=>'ᨆ','ᨇ'=>'ᨇ','ᨈ'=>'ᨈ','ᨉ'=>'ᨉ','ᨊ'=>'ᨊ','ᨋ'=>'ᨋ','ᨌ'=>'ᨌ','ᨍ'=>'ᨍ','ᨎ'=>'ᨎ','ᨏ'=>'ᨏ','ᨐ'=>'ᨐ','ᨑ'=>'ᨑ','ᨒ'=>'ᨒ','ᨓ'=>'ᨓ','ᨔ'=>'ᨔ','ᨕ'=>'ᨕ','ᨖ'=>'ᨖ','ᨗ'=>'ᨗ','ᨘ'=>'ᨘ','ᨙ'=>'ᨙ','ᨚ'=>'ᨚ','ᨛ'=>'ᨛ','ᬀ'=>'ᬀ','ᬁ'=>'ᬁ','ᬂ'=>'ᬂ','ᬃ'=>'ᬃ','ᬄ'=>'ᬄ','ᬅ'=>'ᬅ','ᬆ'=>'ᬆ','ᬇ'=>'ᬇ','ᬈ'=>'ᬈ','ᬉ'=>'ᬉ','ᬊ'=>'ᬊ','ᬋ'=>'ᬋ','ᬌ'=>'ᬌ','ᬍ'=>'ᬍ','ᬎ'=>'ᬎ','ᬏ'=>'ᬏ','ᬐ'=>'ᬐ','ᬑ'=>'ᬑ','ᬒ'=>'ᬒ','ᬓ'=>'ᬓ','ᬔ'=>'ᬔ','ᬕ'=>'ᬕ','ᬖ'=>'ᬖ','ᬗ'=>'ᬗ','ᬘ'=>'ᬘ','ᬙ'=>'ᬙ','ᬚ'=>'ᬚ','ᬛ'=>'ᬛ','ᬜ'=>'ᬜ','ᬝ'=>'ᬝ','ᬞ'=>'ᬞ','ᬟ'=>'ᬟ','ᬠ'=>'ᬠ','ᬡ'=>'ᬡ','ᬢ'=>'ᬢ','ᬣ'=>'ᬣ','ᬤ'=>'ᬤ','ᬥ'=>'ᬥ','ᬦ'=>'ᬦ','ᬧ'=>'ᬧ','ᬨ'=>'ᬨ','ᬩ'=>'ᬩ','ᬪ'=>'ᬪ','ᬫ'=>'ᬫ','ᬬ'=>'ᬬ','ᬭ'=>'ᬭ','ᬮ'=>'ᬮ','ᬯ'=>'ᬯ','ᬰ'=>'ᬰ','ᬱ'=>'ᬱ','ᬲ'=>'ᬲ','ᬳ'=>'ᬳ','᬴'=>'᬴','ᬵ'=>'ᬵ','ᬶ'=>'ᬶ','ᬷ'=>'ᬷ','ᬸ'=>'ᬸ','ᬹ'=>'ᬹ','ᬺ'=>'ᬺ','ᬻ'=>'ᬻ','ᬼ'=>'ᬼ','ᬽ'=>'ᬽ','ᬾ'=>'ᬾ','ᬿ'=>'ᬿ','ᭀ'=>'ᭀ','ᭁ'=>'ᭁ','ᭂ'=>'ᭂ','ᭃ'=>'ᭃ','᭄'=>'᭄','ᭅ'=>'ᭅ','ᭆ'=>'ᭆ','ᭇ'=>'ᭇ','ᭈ'=>'ᭈ','ᭉ'=>'ᭉ','ᭊ'=>'ᭊ','ᭋ'=>'ᭋ','᭐'=>'0','᭑'=>'1','᭒'=>'2','᭓'=>'3','᭔'=>'4','᭕'=>'5','᭖'=>'6','᭗'=>'7','᭘'=>'8','᭙'=>'9','᭫'=>'᭫','᭬'=>'᭬','᭭'=>'᭭','᭮'=>'᭮','᭯'=>'᭯','᭰'=>'᭰','᭱'=>'᭱','᭲'=>'᭲','᭳'=>'᭳','ᴀ'=>'ᴀ','ᴁ'=>'ᴁ','ᴂ'=>'ᴂ','ᴃ'=>'ᴃ','ᴄ'=>'ᴄ','ᴅ'=>'ᴅ','ᴆ'=>'ᴆ','ᴇ'=>'ᴇ','ᴈ'=>'ᴈ','ᴉ'=>'ᴉ','ᴊ'=>'ᴊ','ᴋ'=>'ᴋ','ᴌ'=>'ᴌ','ᴍ'=>'ᴍ','ᴎ'=>'ᴎ','ᴏ'=>'ᴏ','ᴐ'=>'ᴐ','ᴑ'=>'ᴑ','ᴒ'=>'ᴒ','ᴓ'=>'ᴓ','ᴔ'=>'ᴔ','ᴕ'=>'ᴕ','ᴖ'=>'ᴖ','ᴗ'=>'ᴗ','ᴘ'=>'ᴘ','ᴙ'=>'ᴙ','ᴚ'=>'ᴚ','ᴛ'=>'ᴛ','ᴜ'=>'ᴜ','ᴝ'=>'ᴝ','ᴞ'=>'ᴞ','ᴟ'=>'ᴟ','ᴠ'=>'ᴠ','ᴡ'=>'ᴡ','ᴢ'=>'ᴢ','ᴣ'=>'ᴣ','ᴤ'=>'ᴤ','ᴥ'=>'ᴥ','ᴦ'=>'ᴦ','ᴧ'=>'ᴧ','ᴨ'=>'ᴨ','ᴩ'=>'ᴩ','ᴪ'=>'ᴪ','ᴫ'=>'ᴫ','ᴬ'=>'ᴬ','ᴭ'=>'ᴭ','ᴮ'=>'ᴮ','ᴯ'=>'ᴯ','ᴰ'=>'ᴰ','ᴱ'=>'ᴱ','ᴲ'=>'ᴲ','ᴳ'=>'ᴳ','ᴴ'=>'ᴴ','ᴵ'=>'ᴵ','ᴶ'=>'ᴶ','ᴷ'=>'ᴷ','ᴸ'=>'ᴸ','ᴹ'=>'ᴹ','ᴺ'=>'ᴺ','ᴻ'=>'ᴻ','ᴼ'=>'ᴼ','ᴽ'=>'ᴽ','ᴾ'=>'ᴾ','ᴿ'=>'ᴿ','ᵀ'=>'ᵀ','ᵁ'=>'ᵁ','ᵂ'=>'ᵂ','ᵃ'=>'ᵃ','ᵄ'=>'ᵄ','ᵅ'=>'ᵅ','ᵆ'=>'ᵆ','ᵇ'=>'ᵇ','ᵈ'=>'ᵈ','ᵉ'=>'ᵉ','ᵊ'=>'ᵊ','ᵋ'=>'ᵋ','ᵌ'=>'ᵌ','ᵍ'=>'ᵍ','ᵎ'=>'ᵎ','ᵏ'=>'ᵏ','ᵐ'=>'ᵐ','ᵑ'=>'ᵑ','ᵒ'=>'ᵒ','ᵓ'=>'ᵓ','ᵔ'=>'ᵔ','ᵕ'=>'ᵕ','ᵖ'=>'ᵖ','ᵗ'=>'ᵗ','ᵘ'=>'ᵘ','ᵙ'=>'ᵙ','ᵚ'=>'ᵚ','ᵛ'=>'ᵛ','ᵜ'=>'ᵜ','ᵝ'=>'ᵝ','ᵞ'=>'ᵞ','ᵟ'=>'ᵟ','ᵠ'=>'ᵠ','ᵡ'=>'ᵡ','ᵢ'=>'ᵢ','ᵣ'=>'ᵣ','ᵤ'=>'ᵤ','ᵥ'=>'ᵥ','ᵦ'=>'ᵦ','ᵧ'=>'ᵧ','ᵨ'=>'ᵨ','ᵩ'=>'ᵩ','ᵪ'=>'ᵪ','ᵫ'=>'ue','ᵬ'=>'ᵬ','ᵭ'=>'ᵭ','ᵮ'=>'ᵮ','ᵯ'=>'ᵯ','ᵰ'=>'ᵰ','ᵱ'=>'ᵱ','ᵲ'=>'ᵲ','ᵳ'=>'ᵳ','ᵴ'=>'ᵴ','ᵵ'=>'ᵵ','ᵶ'=>'ᵶ','ᵷ'=>'ᵷ','ᵸ'=>'ᵸ','ᵹ'=>'ᵹ','ᵺ'=>'ᵺ','ᵻ'=>'ᵻ','ᵼ'=>'ᵼ','ᵽ'=>'ᵽ','ᵾ'=>'ᵾ','ᵿ'=>'ᵿ','ᶀ'=>'ᶀ','ᶁ'=>'ᶁ','ᶂ'=>'ᶂ','ᶃ'=>'ᶃ','ᶄ'=>'ᶄ','ᶅ'=>'ᶅ','ᶆ'=>'ᶆ','ᶇ'=>'ᶇ','ᶈ'=>'ᶈ','ᶉ'=>'ᶉ','ᶊ'=>'ᶊ','ᶋ'=>'ᶋ','ᶌ'=>'ᶌ','ᶍ'=>'ᶍ','ᶎ'=>'ᶎ','ᶏ'=>'ᶏ','ᶐ'=>'ᶐ','ᶑ'=>'ᶑ','ᶒ'=>'ᶒ','ᶓ'=>'ᶓ','ᶔ'=>'ᶔ','ᶕ'=>'ᶕ','ᶖ'=>'ᶖ','ᶗ'=>'ᶗ','ᶘ'=>'ᶘ','ᶙ'=>'ᶙ','ᶚ'=>'ᶚ','ᶛ'=>'ᶛ','ᶜ'=>'ᶜ','ᶝ'=>'ᶝ','ᶞ'=>'ᶞ','ᶟ'=>'ᶟ','ᶠ'=>'ᶠ','ᶡ'=>'ᶡ','ᶢ'=>'ᶢ','ᶣ'=>'ᶣ','ᶤ'=>'ᶤ','ᶥ'=>'ᶥ','ᶦ'=>'ᶦ','ᶧ'=>'ᶧ','ᶨ'=>'ᶨ','ᶩ'=>'ᶩ','ᶪ'=>'ᶪ','ᶫ'=>'ᶫ','ᶬ'=>'ᶬ','ᶭ'=>'ᶭ','ᶮ'=>'ᶮ','ᶯ'=>'ᶯ','ᶰ'=>'ᶰ','ᶱ'=>'ᶱ','ᶲ'=>'ᶲ','ᶳ'=>'ᶳ','ᶴ'=>'ᶴ','ᶵ'=>'ᶵ','ᶶ'=>'ᶶ','ᶷ'=>'ᶷ','ᶸ'=>'ᶸ','ᶹ'=>'ᶹ','ᶺ'=>'ᶺ','ᶻ'=>'ᶻ','ᶼ'=>'ᶼ','ᶽ'=>'ᶽ','ᶾ'=>'ᶾ','ᶿ'=>'ᶿ','᷀'=>'᷀','᷁'=>'᷁','᷂'=>'᷂','᷃'=>'᷃','᷄'=>'᷄','᷅'=>'᷅','᷆'=>'᷆','᷇'=>'᷇','᷈'=>'᷈','᷉'=>'᷉','᷊'=>'᷊','᷾'=>'᷾','᷿'=>'᷿','Ḁ'=>'ḁ','ḁ'=>'ḁ','Ḃ'=>'ḃ','ḃ'=>'ḃ','Ḅ'=>'ḅ','ḅ'=>'ḅ','Ḇ'=>'ḇ','ḇ'=>'ḇ','Ḉ'=>'ḉ','ḉ'=>'ḉ','Ḋ'=>'ḋ','ḋ'=>'ḋ','Ḍ'=>'ḍ','ḍ'=>'ḍ','Ḏ'=>'ḏ','ḏ'=>'ḏ','Ḑ'=>'ḑ','ḑ'=>'ḑ','Ḓ'=>'ḓ','ḓ'=>'ḓ','Ḕ'=>'ḕ','ḕ'=>'ḕ','Ḗ'=>'ḗ','ḗ'=>'ḗ','Ḙ'=>'ḙ','ḙ'=>'ḙ','Ḛ'=>'ḛ','ḛ'=>'ḛ','Ḝ'=>'ḝ','ḝ'=>'ḝ','Ḟ'=>'ḟ','ḟ'=>'ḟ','Ḡ'=>'ḡ','ḡ'=>'ḡ','Ḣ'=>'ḣ','ḣ'=>'ḣ','Ḥ'=>'ḥ','ḥ'=>'ḥ','Ḧ'=>'ḧ','ḧ'=>'ḧ','Ḩ'=>'ḩ','ḩ'=>'ḩ','Ḫ'=>'ḫ','ḫ'=>'ḫ','Ḭ'=>'ḭ','ḭ'=>'ḭ','Ḯ'=>'ḯ','ḯ'=>'ḯ','Ḱ'=>'ḱ','ḱ'=>'ḱ','Ḳ'=>'ḳ','ḳ'=>'ḳ','Ḵ'=>'ḵ','ḵ'=>'ḵ','Ḷ'=>'ḷ','ḷ'=>'ḷ','Ḹ'=>'ḹ','ḹ'=>'ḹ','Ḻ'=>'ḻ','ḻ'=>'ḻ','Ḽ'=>'ḽ','ḽ'=>'ḽ','Ḿ'=>'ḿ','ḿ'=>'ḿ','Ṁ'=>'ṁ','ṁ'=>'ṁ','Ṃ'=>'ṃ','ṃ'=>'ṃ','Ṅ'=>'ṅ','ṅ'=>'ṅ','Ṇ'=>'ṇ','ṇ'=>'ṇ','Ṉ'=>'ṉ','ṉ'=>'ṉ','Ṋ'=>'ṋ','ṋ'=>'ṋ','Ṍ'=>'ṍ','ṍ'=>'ṍ','Ṏ'=>'ṏ','ṏ'=>'ṏ','Ṑ'=>'ṑ','ṑ'=>'ṑ','Ṓ'=>'ṓ','ṓ'=>'ṓ','Ṕ'=>'ṕ','ṕ'=>'ṕ','Ṗ'=>'ṗ','ṗ'=>'ṗ','Ṙ'=>'ṙ','ṙ'=>'ṙ','Ṛ'=>'ṛ','ṛ'=>'ṛ','Ṝ'=>'ṝ','ṝ'=>'ṝ','Ṟ'=>'ṟ','ṟ'=>'ṟ','Ṡ'=>'ṡ','ṡ'=>'ṡ','Ṣ'=>'ṣ','ṣ'=>'ṣ','Ṥ'=>'ṥ','ṥ'=>'ṥ','Ṧ'=>'ṧ','ṧ'=>'ṧ','Ṩ'=>'ṩ','ṩ'=>'ṩ','Ṫ'=>'ṫ','ṫ'=>'ṫ','Ṭ'=>'ṭ','ṭ'=>'ṭ','Ṯ'=>'ṯ','ṯ'=>'ṯ','Ṱ'=>'ṱ','ṱ'=>'ṱ','Ṳ'=>'ṳ','ṳ'=>'ṳ','Ṵ'=>'ṵ','ṵ'=>'ṵ','Ṷ'=>'ṷ','ṷ'=>'ṷ','Ṹ'=>'ṹ','ṹ'=>'ṹ','Ṻ'=>'ṻ','ṻ'=>'ṻ','Ṽ'=>'ṽ','ṽ'=>'ṽ','Ṿ'=>'ṿ','ṿ'=>'ṿ','Ẁ'=>'ẁ','ẁ'=>'ẁ','Ẃ'=>'ẃ','ẃ'=>'ẃ','Ẅ'=>'ẅ','ẅ'=>'ẅ','Ẇ'=>'ẇ','ẇ'=>'ẇ','Ẉ'=>'ẉ','ẉ'=>'ẉ','Ẋ'=>'ẋ','ẋ'=>'ẋ','Ẍ'=>'ẍ','ẍ'=>'ẍ','Ẏ'=>'ẏ','ẏ'=>'ẏ','Ẑ'=>'ẑ','ẑ'=>'ẑ','Ẓ'=>'ẓ','ẓ'=>'ẓ','Ẕ'=>'ẕ','ẕ'=>'ẕ','ẖ'=>'ẖ','ẗ'=>'ẗ','ẘ'=>'ẘ','ẙ'=>'ẙ','ẚ'=>'ẚ','ẛ'=>'ẛ','Ạ'=>'ạ','ạ'=>'ạ','Ả'=>'ả','ả'=>'ả','Ấ'=>'ấ','ấ'=>'ấ','Ầ'=>'ầ','ầ'=>'ầ','Ẩ'=>'ẩ','ẩ'=>'ẩ','Ẫ'=>'ẫ','ẫ'=>'ẫ','Ậ'=>'ậ','ậ'=>'ậ','Ắ'=>'ắ','ắ'=>'ắ','Ằ'=>'ằ','ằ'=>'ằ','Ẳ'=>'ẳ','ẳ'=>'ẳ','Ẵ'=>'ẵ','ẵ'=>'ẵ','Ặ'=>'ặ','ặ'=>'ặ','Ẹ'=>'ẹ','ẹ'=>'ẹ','Ẻ'=>'ẻ','ẻ'=>'ẻ','Ẽ'=>'ẽ','ẽ'=>'ẽ','Ế'=>'ế','ế'=>'ế','Ề'=>'ề','ề'=>'ề','Ể'=>'ể','ể'=>'ể','Ễ'=>'ễ','ễ'=>'ễ','Ệ'=>'ệ','ệ'=>'ệ','Ỉ'=>'ỉ','ỉ'=>'ỉ','Ị'=>'ị','ị'=>'ị','Ọ'=>'ọ','ọ'=>'ọ','Ỏ'=>'ỏ','ỏ'=>'ỏ','Ố'=>'ố','ố'=>'ố','Ồ'=>'ồ','ồ'=>'ồ','Ổ'=>'ổ','ổ'=>'ổ','Ỗ'=>'ỗ','ỗ'=>'ỗ','Ộ'=>'ộ','ộ'=>'ộ','Ớ'=>'ớ','ớ'=>'ớ','Ờ'=>'ờ','ờ'=>'ờ','Ở'=>'ở','ở'=>'ở','Ỡ'=>'ỡ','ỡ'=>'ỡ','Ợ'=>'ợ','ợ'=>'ợ','Ụ'=>'ụ','ụ'=>'ụ','Ủ'=>'ủ','ủ'=>'ủ','Ứ'=>'ứ','ứ'=>'ứ','Ừ'=>'ừ','ừ'=>'ừ','Ử'=>'ử','ử'=>'ử','Ữ'=>'ữ','ữ'=>'ữ','Ự'=>'ự','ự'=>'ự','Ỳ'=>'ỳ','ỳ'=>'ỳ','Ỵ'=>'ỵ','ỵ'=>'ỵ','Ỷ'=>'ỷ','ỷ'=>'ỷ','Ỹ'=>'ỹ','ỹ'=>'ỹ','ἀ'=>'ἀ','ἁ'=>'ἁ','ἂ'=>'ἂ','ἃ'=>'ἃ','ἄ'=>'ἄ','ἅ'=>'ἅ','ἆ'=>'ἆ','ἇ'=>'ἇ','Ἀ'=>'ἀ','Ἁ'=>'ἁ','Ἂ'=>'ἂ','Ἃ'=>'ἃ','Ἄ'=>'ἄ','Ἅ'=>'ἅ','Ἆ'=>'ἆ','Ἇ'=>'ἇ','ἐ'=>'ἐ','ἑ'=>'ἑ','ἒ'=>'ἒ','ἓ'=>'ἓ','ἔ'=>'ἔ','ἕ'=>'ἕ','Ἐ'=>'ἐ','Ἑ'=>'ἑ','Ἒ'=>'ἒ','Ἓ'=>'ἓ','Ἔ'=>'ἔ','Ἕ'=>'ἕ','ἠ'=>'ἠ','ἡ'=>'ἡ','ἢ'=>'ἢ','ἣ'=>'ἣ','ἤ'=>'ἤ','ἥ'=>'ἥ','ἦ'=>'ἦ','ἧ'=>'ἧ','Ἠ'=>'ἠ','Ἡ'=>'ἡ','Ἢ'=>'ἢ','Ἣ'=>'ἣ','Ἤ'=>'ἤ','Ἥ'=>'ἥ','Ἦ'=>'ἦ','Ἧ'=>'ἧ','ἰ'=>'ἰ','ἱ'=>'ἱ','ἲ'=>'ἲ','ἳ'=>'ἳ','ἴ'=>'ἴ','ἵ'=>'ἵ','ἶ'=>'ἶ','ἷ'=>'ἷ','Ἰ'=>'ἰ','Ἱ'=>'ἱ','Ἲ'=>'ἲ','Ἳ'=>'ἳ','Ἴ'=>'ἴ','Ἵ'=>'ἵ','Ἶ'=>'ἶ','Ἷ'=>'ἷ','ὀ'=>'ὀ','ὁ'=>'ὁ','ὂ'=>'ὂ','ὃ'=>'ὃ','ὄ'=>'ὄ','ὅ'=>'ὅ','Ὀ'=>'ὀ','Ὁ'=>'ὁ','Ὂ'=>'ὂ','Ὃ'=>'ὃ','Ὄ'=>'ὄ','Ὅ'=>'ὅ','ὐ'=>'ὐ','ὑ'=>'ὑ','ὒ'=>'ὒ','ὓ'=>'ὓ','ὔ'=>'ὔ','ὕ'=>'ὕ','ὖ'=>'ὖ','ὗ'=>'ὗ','Ὑ'=>'ὑ','Ὓ'=>'ὓ','Ὕ'=>'ὕ','Ὗ'=>'ὗ','ὠ'=>'ὠ','ὡ'=>'ὡ','ὢ'=>'ὢ','ὣ'=>'ὣ','ὤ'=>'ὤ','ὥ'=>'ὥ','ὦ'=>'ὦ','ὧ'=>'ὧ','Ὠ'=>'ὠ','Ὡ'=>'ὡ','Ὢ'=>'ὢ','Ὣ'=>'ὣ','Ὤ'=>'ὤ','Ὥ'=>'ὥ','Ὦ'=>'ὦ','Ὧ'=>'ὧ','ὰ'=>'ὰ','ά'=>'ά','ὲ'=>'ὲ','έ'=>'έ','ὴ'=>'ὴ','ή'=>'ή','ὶ'=>'ὶ','ί'=>'ί','ὸ'=>'ὸ','ό'=>'ό','ὺ'=>'ὺ','ύ'=>'ύ','ὼ'=>'ὼ','ώ'=>'ώ','ᾀ'=>'ᾀ','ᾁ'=>'ᾁ','ᾂ'=>'ᾂ','ᾃ'=>'ᾃ','ᾄ'=>'ᾄ','ᾅ'=>'ᾅ','ᾆ'=>'ᾆ','ᾇ'=>'ᾇ','ᾈ'=>'ᾀ','ᾉ'=>'ᾁ','ᾊ'=>'ᾂ','ᾋ'=>'ᾃ','ᾌ'=>'ᾄ','ᾍ'=>'ᾅ','ᾎ'=>'ᾆ','ᾏ'=>'ᾇ','ᾐ'=>'ᾐ','ᾑ'=>'ᾑ','ᾒ'=>'ᾒ','ᾓ'=>'ᾓ','ᾔ'=>'ᾔ','ᾕ'=>'ᾕ','ᾖ'=>'ᾖ','ᾗ'=>'ᾗ','ᾘ'=>'ᾐ','ᾙ'=>'ᾑ','ᾚ'=>'ᾒ','ᾛ'=>'ᾓ','ᾜ'=>'ᾔ','ᾝ'=>'ᾕ','ᾞ'=>'ᾖ','ᾟ'=>'ᾗ','ᾠ'=>'ᾠ','ᾡ'=>'ᾡ','ᾢ'=>'ᾢ','ᾣ'=>'ᾣ','ᾤ'=>'ᾤ','ᾥ'=>'ᾥ','ᾦ'=>'ᾦ','ᾧ'=>'ᾧ','ᾨ'=>'ᾠ','ᾩ'=>'ᾡ','ᾪ'=>'ᾢ','ᾫ'=>'ᾣ','ᾬ'=>'ᾤ','ᾭ'=>'ᾥ','ᾮ'=>'ᾦ','ᾯ'=>'ᾧ','ᾰ'=>'ᾰ','ᾱ'=>'ᾱ','ᾲ'=>'ᾲ','ᾳ'=>'ᾳ','ᾴ'=>'ᾴ','ᾶ'=>'ᾶ','ᾷ'=>'ᾷ','Ᾰ'=>'ᾰ','Ᾱ'=>'ᾱ','Ὰ'=>'ὰ','Ά'=>'ά','ᾼ'=>'ᾳ','ι'=>'ι','ῂ'=>'ῂ','ῃ'=>'ῃ','ῄ'=>'ῄ','ῆ'=>'ῆ','ῇ'=>'ῇ','Ὲ'=>'ὲ','Έ'=>'έ','Ὴ'=>'ὴ','Ή'=>'ή','ῌ'=>'ῃ','ῐ'=>'ῐ','ῑ'=>'ῑ','ῒ'=>'ῒ','ΐ'=>'ΐ','ῖ'=>'ῖ','ῗ'=>'ῗ','Ῐ'=>'ῐ','Ῑ'=>'ῑ','Ὶ'=>'ὶ','Ί'=>'ί','ῠ'=>'ῠ','ῡ'=>'ῡ','ῢ'=>'ῢ','ΰ'=>'ΰ','ῤ'=>'ῤ','ῥ'=>'ῥ','ῦ'=>'ῦ','ῧ'=>'ῧ','Ῠ'=>'ῠ','Ῡ'=>'ῡ','Ὺ'=>'ὺ','Ύ'=>'ύ','Ῥ'=>'ῥ','ῲ'=>'ῲ','ῳ'=>'ῳ','ῴ'=>'ῴ','ῶ'=>'ῶ','ῷ'=>'ῷ','Ὸ'=>'ὸ','Ό'=>'ό','Ὼ'=>'ὼ','Ώ'=>'ώ','ῼ'=>'ῳ');
diff --git a/phpBB/includes/utf/data/search_indexer_31.php b/phpBB/includes/utf/data/search_indexer_31.php
index 191365a313..85961d36fc 100644
--- a/phpBB/includes/utf/data/search_indexer_31.php
+++ b/phpBB/includes/utf/data/search_indexer_31.php
@@ -1 +1 @@
-<?php return array('豈'=>'豈','更'=>'更','車'=>'車','賈'=>'賈','滑'=>'滑','串'=>'串','句'=>'句','龜'=>'龜','龜'=>'龜','契'=>'契','金'=>'金','喇'=>'喇','奈'=>'奈','懶'=>'懶','癩'=>'癩','羅'=>'羅','蘿'=>'蘿','螺'=>'螺','裸'=>'裸','邏'=>'邏','樂'=>'樂','洛'=>'洛','烙'=>'烙','珞'=>'珞','落'=>'落','酪'=>'酪','駱'=>'駱','亂'=>'亂','卵'=>'卵','欄'=>'欄','爛'=>'爛','蘭'=>'蘭','鸞'=>'鸞','嵐'=>'嵐','濫'=>'濫','藍'=>'藍','襤'=>'襤','拉'=>'拉','臘'=>'臘','蠟'=>'蠟','廊'=>'廊','朗'=>'朗','浪'=>'浪','狼'=>'狼','郎'=>'郎','來'=>'來','冷'=>'冷','勞'=>'勞','擄'=>'擄','櫓'=>'櫓','爐'=>'爐','盧'=>'盧','老'=>'老','蘆'=>'蘆','虜'=>'虜','路'=>'路','露'=>'露','魯'=>'魯','鷺'=>'鷺','碌'=>'碌','祿'=>'祿','綠'=>'綠','菉'=>'菉','錄'=>'錄','鹿'=>'鹿','論'=>'論','壟'=>'壟','弄'=>'弄','籠'=>'籠','聾'=>'聾','牢'=>'牢','磊'=>'磊','賂'=>'賂','雷'=>'雷','壘'=>'壘','屢'=>'屢','樓'=>'樓','淚'=>'淚','漏'=>'漏','累'=>'累','縷'=>'縷','陋'=>'陋','勒'=>'勒','肋'=>'肋','凜'=>'凜','凌'=>'凌','稜'=>'稜','綾'=>'綾','菱'=>'菱','陵'=>'陵','讀'=>'讀','拏'=>'拏','樂'=>'樂','諾'=>'諾','丹'=>'丹','寧'=>'寧','怒'=>'怒','率'=>'率','異'=>'異','北'=>'北','磻'=>'磻','便'=>'便','復'=>'復','不'=>'不','泌'=>'泌','數'=>'數','索'=>'索','參'=>'參','塞'=>'塞','省'=>'省','葉'=>'葉','說'=>'說','殺'=>'殺','辰'=>'辰','沈'=>'沈','拾'=>'拾','若'=>'若','掠'=>'掠','略'=>'略','亮'=>'亮','兩'=>'兩','凉'=>'凉','梁'=>'梁','糧'=>'糧','良'=>'良','諒'=>'諒','量'=>'量','勵'=>'勵','呂'=>'呂','女'=>'女','廬'=>'廬','旅'=>'旅','濾'=>'濾','礪'=>'礪','閭'=>'閭','驪'=>'驪','麗'=>'麗','黎'=>'黎','力'=>'力','曆'=>'曆','歷'=>'歷','轢'=>'轢','年'=>'年','憐'=>'憐','戀'=>'戀','撚'=>'撚','漣'=>'漣','煉'=>'煉','璉'=>'璉','秊'=>'秊','練'=>'練','聯'=>'聯','輦'=>'輦','蓮'=>'蓮','連'=>'連','鍊'=>'鍊','列'=>'列','劣'=>'劣','咽'=>'咽','烈'=>'烈','裂'=>'裂','說'=>'說','廉'=>'廉','念'=>'念','捻'=>'捻','殮'=>'殮','簾'=>'簾','獵'=>'獵','令'=>'令','囹'=>'囹','寧'=>'寧','嶺'=>'嶺','怜'=>'怜','玲'=>'玲','瑩'=>'瑩','羚'=>'羚','聆'=>'聆','鈴'=>'鈴','零'=>'零','靈'=>'靈','領'=>'領','例'=>'例','禮'=>'禮','醴'=>'醴','隸'=>'隸','惡'=>'惡','了'=>'了','僚'=>'僚','寮'=>'寮','尿'=>'尿','料'=>'料','樂'=>'樂','燎'=>'燎','療'=>'療','蓼'=>'蓼','遼'=>'遼','龍'=>'龍','暈'=>'暈','阮'=>'阮','劉'=>'劉','杻'=>'杻','柳'=>'柳','流'=>'流','溜'=>'溜','琉'=>'琉','留'=>'留','硫'=>'硫','紐'=>'紐','類'=>'類','六'=>'六','戮'=>'戮','陸'=>'陸','倫'=>'倫','崙'=>'崙','淪'=>'淪','輪'=>'輪','律'=>'律','慄'=>'慄','栗'=>'栗','率'=>'率','隆'=>'隆','利'=>'利','吏'=>'吏','履'=>'履','易'=>'易','李'=>'李','梨'=>'梨','泥'=>'泥','理'=>'理','痢'=>'痢','罹'=>'罹','裏'=>'裏','裡'=>'裡','里'=>'里','離'=>'離','匿'=>'匿','溺'=>'溺','吝'=>'吝','燐'=>'燐','璘'=>'璘','藺'=>'藺','隣'=>'隣','鱗'=>'鱗','麟'=>'麟','林'=>'林','淋'=>'淋','臨'=>'臨','立'=>'立','笠'=>'笠','粒'=>'粒','狀'=>'狀','炙'=>'炙','識'=>'識','什'=>'什','茶'=>'茶','刺'=>'刺','切'=>'切','度'=>'度','拓'=>'拓','糖'=>'糖','宅'=>'宅','洞'=>'洞','暴'=>'暴','輻'=>'輻','行'=>'行','降'=>'降','見'=>'見','廓'=>'廓','兀'=>'兀','嗀'=>'嗀','﨎'=>'﨎','﨏'=>'﨏','塚'=>'塚','﨑'=>'﨑','晴'=>'晴','﨓'=>'﨓','﨔'=>'﨔','凞'=>'凞','猪'=>'猪','益'=>'益','礼'=>'礼','神'=>'神','祥'=>'祥','福'=>'福','靖'=>'靖','精'=>'精','羽'=>'羽','﨟'=>'﨟','蘒'=>'蘒','﨡'=>'﨡','諸'=>'諸','﨣'=>'﨣','﨤'=>'﨤','逸'=>'逸','都'=>'都','﨧'=>'﨧','﨨'=>'﨨','﨩'=>'﨩','飯'=>'飯','飼'=>'飼','館'=>'館','鶴'=>'鶴','侮'=>'侮','僧'=>'僧','免'=>'免','勉'=>'勉','勤'=>'勤','卑'=>'卑','喝'=>'喝','嘆'=>'嘆','器'=>'器','塀'=>'塀','墨'=>'墨','層'=>'層','屮'=>'屮','悔'=>'悔','慨'=>'慨','憎'=>'憎','懲'=>'懲','敏'=>'敏','既'=>'既','暑'=>'暑','梅'=>'梅','海'=>'海','渚'=>'渚','漢'=>'漢','煮'=>'煮','爫'=>'爫','琢'=>'琢','碑'=>'碑','社'=>'社','祉'=>'祉','祈'=>'祈','祐'=>'祐','祖'=>'祖','祝'=>'祝','禍'=>'禍','禎'=>'禎','穀'=>'穀','突'=>'突','節'=>'節','練'=>'練','縉'=>'縉','繁'=>'繁','署'=>'署','者'=>'者','臭'=>'臭','艹'=>'艹','艹'=>'艹','著'=>'著','褐'=>'褐','視'=>'視','謁'=>'謁','謹'=>'謹','賓'=>'賓','贈'=>'贈','辶'=>'辶','逸'=>'逸','難'=>'難','響'=>'響','頻'=>'頻','並'=>'並','况'=>'况','全'=>'全','侀'=>'侀','充'=>'充','冀'=>'冀','勇'=>'勇','勺'=>'勺','喝'=>'喝','啕'=>'啕','喙'=>'喙','嗢'=>'嗢','塚'=>'塚','墳'=>'墳','奄'=>'奄','奔'=>'奔','婢'=>'婢','嬨'=>'嬨','廒'=>'廒','廙'=>'廙','彩'=>'彩','徭'=>'徭','惘'=>'惘','慎'=>'慎','愈'=>'愈','憎'=>'憎','慠'=>'慠','懲'=>'懲','戴'=>'戴','揄'=>'揄','搜'=>'搜','摒'=>'摒','敖'=>'敖','晴'=>'晴','朗'=>'朗','望'=>'望','杖'=>'杖','歹'=>'歹','殺'=>'殺','流'=>'流','滛'=>'滛','滋'=>'滋','漢'=>'漢','瀞'=>'瀞','煮'=>'煮','瞧'=>'瞧','爵'=>'爵','犯'=>'犯','猪'=>'猪','瑱'=>'瑱','甆'=>'甆','画'=>'画','瘝'=>'瘝','瘟'=>'瘟','益'=>'益','盛'=>'盛','直'=>'直','睊'=>'睊','着'=>'着','磌'=>'磌','窱'=>'窱','節'=>'節','类'=>'类','絛'=>'絛','練'=>'練','缾'=>'缾','者'=>'者','荒'=>'荒','華'=>'華','蝹'=>'蝹','襁'=>'襁','覆'=>'覆','視'=>'視','調'=>'調','諸'=>'諸','請'=>'請','謁'=>'謁','諾'=>'諾','諭'=>'諭','謹'=>'謹','變'=>'變','贈'=>'贈','輸'=>'輸','遲'=>'遲','醙'=>'醙','鉶'=>'鉶','陼'=>'陼','難'=>'難','靖'=>'靖','韛'=>'韛','響'=>'響','頋'=>'頋','頻'=>'頻','鬒'=>'鬒','龜'=>'龜','𢡊'=>'𢡊','𢡄'=>'𢡄','𣏕'=>'𣏕','㮝'=>'㮝','䀘'=>'䀘','䀹'=>'䀹','𥉉'=>'𥉉','𥳐'=>'𥳐','𧻓'=>'𧻓','齃'=>'齃','龎'=>'龎','ff'=>'ff','fi'=>'fi','fl'=>'fl','ffi'=>'ffi','ffl'=>'ffl','ſt'=>'ſt','st'=>'st','ﬓ'=>'ﬓ','ﬔ'=>'ﬔ','ﬕ'=>'ﬕ','ﬖ'=>'ﬖ','ﬗ'=>'ﬗ','יִ'=>'יִ','ﬞ'=>'ﬞ','ײַ'=>'ײַ','ﬠ'=>'ﬠ','ﬡ'=>'ﬡ','ﬢ'=>'ﬢ','ﬣ'=>'ﬣ','ﬤ'=>'ﬤ','ﬥ'=>'ﬥ','ﬦ'=>'ﬦ','ﬧ'=>'ﬧ','ﬨ'=>'ﬨ','שׁ'=>'שׁ','שׂ'=>'שׂ','שּׁ'=>'שּׁ','שּׂ'=>'שּׂ','אַ'=>'אַ','אָ'=>'אָ','אּ'=>'אּ','בּ'=>'בּ','גּ'=>'גּ','דּ'=>'דּ','הּ'=>'הּ','וּ'=>'וּ','זּ'=>'זּ','טּ'=>'טּ','יּ'=>'יּ','ךּ'=>'ךּ','כּ'=>'כּ','לּ'=>'לּ','מּ'=>'מּ','נּ'=>'נּ','סּ'=>'סּ','ףּ'=>'ףּ','פּ'=>'פּ','צּ'=>'צּ','קּ'=>'קּ','רּ'=>'רּ','שּ'=>'שּ','תּ'=>'תּ','וֹ'=>'וֹ','בֿ'=>'בֿ','כֿ'=>'כֿ','פֿ'=>'פֿ','ﭏ'=>'ﭏ','ﭐ'=>'ﭐ','ﭑ'=>'ﭑ','ﭒ'=>'ﭒ','ﭓ'=>'ﭓ','ﭔ'=>'ﭔ','ﭕ'=>'ﭕ','ﭖ'=>'ﭖ','ﭗ'=>'ﭗ','ﭘ'=>'ﭘ','ﭙ'=>'ﭙ','ﭚ'=>'ﭚ','ﭛ'=>'ﭛ','ﭜ'=>'ﭜ','ﭝ'=>'ﭝ','ﭞ'=>'ﭞ','ﭟ'=>'ﭟ','ﭠ'=>'ﭠ','ﭡ'=>'ﭡ','ﭢ'=>'ﭢ','ﭣ'=>'ﭣ','ﭤ'=>'ﭤ','ﭥ'=>'ﭥ','ﭦ'=>'ﭦ','ﭧ'=>'ﭧ','ﭨ'=>'ﭨ','ﭩ'=>'ﭩ','ﭪ'=>'ﭪ','ﭫ'=>'ﭫ','ﭬ'=>'ﭬ','ﭭ'=>'ﭭ','ﭮ'=>'ﭮ','ﭯ'=>'ﭯ','ﭰ'=>'ﭰ','ﭱ'=>'ﭱ','ﭲ'=>'ﭲ','ﭳ'=>'ﭳ','ﭴ'=>'ﭴ','ﭵ'=>'ﭵ','ﭶ'=>'ﭶ','ﭷ'=>'ﭷ','ﭸ'=>'ﭸ','ﭹ'=>'ﭹ','ﭺ'=>'ﭺ','ﭻ'=>'ﭻ','ﭼ'=>'ﭼ','ﭽ'=>'ﭽ','ﭾ'=>'ﭾ','ﭿ'=>'ﭿ','ﮀ'=>'ﮀ','ﮁ'=>'ﮁ','ﮂ'=>'ﮂ','ﮃ'=>'ﮃ','ﮄ'=>'ﮄ','ﮅ'=>'ﮅ','ﮆ'=>'ﮆ','ﮇ'=>'ﮇ','ﮈ'=>'ﮈ','ﮉ'=>'ﮉ','ﮊ'=>'ﮊ','ﮋ'=>'ﮋ','ﮌ'=>'ﮌ','ﮍ'=>'ﮍ','ﮎ'=>'ﮎ','ﮏ'=>'ﮏ','ﮐ'=>'ﮐ','ﮑ'=>'ﮑ','ﮒ'=>'ﮒ','ﮓ'=>'ﮓ','ﮔ'=>'ﮔ','ﮕ'=>'ﮕ','ﮖ'=>'ﮖ','ﮗ'=>'ﮗ','ﮘ'=>'ﮘ','ﮙ'=>'ﮙ','ﮚ'=>'ﮚ','ﮛ'=>'ﮛ','ﮜ'=>'ﮜ','ﮝ'=>'ﮝ','ﮞ'=>'ﮞ','ﮟ'=>'ﮟ','ﮠ'=>'ﮠ','ﮡ'=>'ﮡ','ﮢ'=>'ﮢ','ﮣ'=>'ﮣ','ﮤ'=>'ﮤ','ﮥ'=>'ﮥ','ﮦ'=>'ﮦ','ﮧ'=>'ﮧ','ﮨ'=>'ﮨ','ﮩ'=>'ﮩ','ﮪ'=>'ﮪ','ﮫ'=>'ﮫ','ﮬ'=>'ﮬ','ﮭ'=>'ﮭ','ﮮ'=>'ﮮ','ﮯ'=>'ﮯ','ﮰ'=>'ﮰ','ﮱ'=>'ﮱ','ﯓ'=>'ﯓ','ﯔ'=>'ﯔ','ﯕ'=>'ﯕ','ﯖ'=>'ﯖ','ﯗ'=>'ﯗ','ﯘ'=>'ﯘ','ﯙ'=>'ﯙ','ﯚ'=>'ﯚ','ﯛ'=>'ﯛ','ﯜ'=>'ﯜ','ﯝ'=>'ﯝ','ﯞ'=>'ﯞ','ﯟ'=>'ﯟ','ﯠ'=>'ﯠ','ﯡ'=>'ﯡ','ﯢ'=>'ﯢ','ﯣ'=>'ﯣ','ﯤ'=>'ﯤ','ﯥ'=>'ﯥ','ﯦ'=>'ﯦ','ﯧ'=>'ﯧ','ﯨ'=>'ﯨ','ﯩ'=>'ﯩ','ﯪ'=>'ﯪ','ﯫ'=>'ﯫ','ﯬ'=>'ﯬ','ﯭ'=>'ﯭ','ﯮ'=>'ﯮ','ﯯ'=>'ﯯ','ﯰ'=>'ﯰ','ﯱ'=>'ﯱ','ﯲ'=>'ﯲ','ﯳ'=>'ﯳ','ﯴ'=>'ﯴ','ﯵ'=>'ﯵ','ﯶ'=>'ﯶ','ﯷ'=>'ﯷ','ﯸ'=>'ﯸ','ﯹ'=>'ﯹ','ﯺ'=>'ﯺ','ﯻ'=>'ﯻ','ﯼ'=>'ﯼ','ﯽ'=>'ﯽ','ﯾ'=>'ﯾ','ﯿ'=>'ﯿ','ﰀ'=>'ﰀ','ﰁ'=>'ﰁ','ﰂ'=>'ﰂ','ﰃ'=>'ﰃ','ﰄ'=>'ﰄ','ﰅ'=>'ﰅ','ﰆ'=>'ﰆ','ﰇ'=>'ﰇ','ﰈ'=>'ﰈ','ﰉ'=>'ﰉ','ﰊ'=>'ﰊ','ﰋ'=>'ﰋ','ﰌ'=>'ﰌ','ﰍ'=>'ﰍ','ﰎ'=>'ﰎ','ﰏ'=>'ﰏ','ﰐ'=>'ﰐ','ﰑ'=>'ﰑ','ﰒ'=>'ﰒ','ﰓ'=>'ﰓ','ﰔ'=>'ﰔ','ﰕ'=>'ﰕ','ﰖ'=>'ﰖ','ﰗ'=>'ﰗ','ﰘ'=>'ﰘ','ﰙ'=>'ﰙ','ﰚ'=>'ﰚ','ﰛ'=>'ﰛ','ﰜ'=>'ﰜ','ﰝ'=>'ﰝ','ﰞ'=>'ﰞ','ﰟ'=>'ﰟ','ﰠ'=>'ﰠ','ﰡ'=>'ﰡ','ﰢ'=>'ﰢ','ﰣ'=>'ﰣ','ﰤ'=>'ﰤ','ﰥ'=>'ﰥ','ﰦ'=>'ﰦ','ﰧ'=>'ﰧ','ﰨ'=>'ﰨ','ﰩ'=>'ﰩ','ﰪ'=>'ﰪ','ﰫ'=>'ﰫ','ﰬ'=>'ﰬ','ﰭ'=>'ﰭ','ﰮ'=>'ﰮ','ﰯ'=>'ﰯ','ﰰ'=>'ﰰ','ﰱ'=>'ﰱ','ﰲ'=>'ﰲ','ﰳ'=>'ﰳ','ﰴ'=>'ﰴ','ﰵ'=>'ﰵ','ﰶ'=>'ﰶ','ﰷ'=>'ﰷ','ﰸ'=>'ﰸ','ﰹ'=>'ﰹ','ﰺ'=>'ﰺ','ﰻ'=>'ﰻ','ﰼ'=>'ﰼ','ﰽ'=>'ﰽ','ﰾ'=>'ﰾ','ﰿ'=>'ﰿ','ﱀ'=>'ﱀ','ﱁ'=>'ﱁ','ﱂ'=>'ﱂ','ﱃ'=>'ﱃ','ﱄ'=>'ﱄ','ﱅ'=>'ﱅ','ﱆ'=>'ﱆ','ﱇ'=>'ﱇ','ﱈ'=>'ﱈ','ﱉ'=>'ﱉ','ﱊ'=>'ﱊ','ﱋ'=>'ﱋ','ﱌ'=>'ﱌ','ﱍ'=>'ﱍ','ﱎ'=>'ﱎ','ﱏ'=>'ﱏ','ﱐ'=>'ﱐ','ﱑ'=>'ﱑ','ﱒ'=>'ﱒ','ﱓ'=>'ﱓ','ﱔ'=>'ﱔ','ﱕ'=>'ﱕ','ﱖ'=>'ﱖ','ﱗ'=>'ﱗ','ﱘ'=>'ﱘ','ﱙ'=>'ﱙ','ﱚ'=>'ﱚ','ﱛ'=>'ﱛ','ﱜ'=>'ﱜ','ﱝ'=>'ﱝ','ﱞ'=>'ﱞ','ﱟ'=>'ﱟ','ﱠ'=>'ﱠ','ﱡ'=>'ﱡ','ﱢ'=>'ﱢ','ﱣ'=>'ﱣ','ﱤ'=>'ﱤ','ﱥ'=>'ﱥ','ﱦ'=>'ﱦ','ﱧ'=>'ﱧ','ﱨ'=>'ﱨ','ﱩ'=>'ﱩ','ﱪ'=>'ﱪ','ﱫ'=>'ﱫ','ﱬ'=>'ﱬ','ﱭ'=>'ﱭ','ﱮ'=>'ﱮ','ﱯ'=>'ﱯ','ﱰ'=>'ﱰ','ﱱ'=>'ﱱ','ﱲ'=>'ﱲ','ﱳ'=>'ﱳ','ﱴ'=>'ﱴ','ﱵ'=>'ﱵ','ﱶ'=>'ﱶ','ﱷ'=>'ﱷ','ﱸ'=>'ﱸ','ﱹ'=>'ﱹ','ﱺ'=>'ﱺ','ﱻ'=>'ﱻ','ﱼ'=>'ﱼ','ﱽ'=>'ﱽ','ﱾ'=>'ﱾ','ﱿ'=>'ﱿ','ﲀ'=>'ﲀ','ﲁ'=>'ﲁ','ﲂ'=>'ﲂ','ﲃ'=>'ﲃ','ﲄ'=>'ﲄ','ﲅ'=>'ﲅ','ﲆ'=>'ﲆ','ﲇ'=>'ﲇ','ﲈ'=>'ﲈ','ﲉ'=>'ﲉ','ﲊ'=>'ﲊ','ﲋ'=>'ﲋ','ﲌ'=>'ﲌ','ﲍ'=>'ﲍ','ﲎ'=>'ﲎ','ﲏ'=>'ﲏ','ﲐ'=>'ﲐ','ﲑ'=>'ﲑ','ﲒ'=>'ﲒ','ﲓ'=>'ﲓ','ﲔ'=>'ﲔ','ﲕ'=>'ﲕ','ﲖ'=>'ﲖ','ﲗ'=>'ﲗ','ﲘ'=>'ﲘ','ﲙ'=>'ﲙ','ﲚ'=>'ﲚ','ﲛ'=>'ﲛ','ﲜ'=>'ﲜ','ﲝ'=>'ﲝ','ﲞ'=>'ﲞ','ﲟ'=>'ﲟ','ﲠ'=>'ﲠ','ﲡ'=>'ﲡ','ﲢ'=>'ﲢ','ﲣ'=>'ﲣ','ﲤ'=>'ﲤ','ﲥ'=>'ﲥ','ﲦ'=>'ﲦ','ﲧ'=>'ﲧ','ﲨ'=>'ﲨ','ﲩ'=>'ﲩ','ﲪ'=>'ﲪ','ﲫ'=>'ﲫ','ﲬ'=>'ﲬ','ﲭ'=>'ﲭ','ﲮ'=>'ﲮ','ﲯ'=>'ﲯ','ﲰ'=>'ﲰ','ﲱ'=>'ﲱ','ﲲ'=>'ﲲ','ﲳ'=>'ﲳ','ﲴ'=>'ﲴ','ﲵ'=>'ﲵ','ﲶ'=>'ﲶ','ﲷ'=>'ﲷ','ﲸ'=>'ﲸ','ﲹ'=>'ﲹ','ﲺ'=>'ﲺ','ﲻ'=>'ﲻ','ﲼ'=>'ﲼ','ﲽ'=>'ﲽ','ﲾ'=>'ﲾ','ﲿ'=>'ﲿ','ﳀ'=>'ﳀ','ﳁ'=>'ﳁ','ﳂ'=>'ﳂ','ﳃ'=>'ﳃ','ﳄ'=>'ﳄ','ﳅ'=>'ﳅ','ﳆ'=>'ﳆ','ﳇ'=>'ﳇ','ﳈ'=>'ﳈ','ﳉ'=>'ﳉ','ﳊ'=>'ﳊ','ﳋ'=>'ﳋ','ﳌ'=>'ﳌ','ﳍ'=>'ﳍ','ﳎ'=>'ﳎ','ﳏ'=>'ﳏ','ﳐ'=>'ﳐ','ﳑ'=>'ﳑ','ﳒ'=>'ﳒ','ﳓ'=>'ﳓ','ﳔ'=>'ﳔ','ﳕ'=>'ﳕ','ﳖ'=>'ﳖ','ﳗ'=>'ﳗ','ﳘ'=>'ﳘ','ﳙ'=>'ﳙ','ﳚ'=>'ﳚ','ﳛ'=>'ﳛ','ﳜ'=>'ﳜ','ﳝ'=>'ﳝ','ﳞ'=>'ﳞ','ﳟ'=>'ﳟ','ﳠ'=>'ﳠ','ﳡ'=>'ﳡ','ﳢ'=>'ﳢ','ﳣ'=>'ﳣ','ﳤ'=>'ﳤ','ﳥ'=>'ﳥ','ﳦ'=>'ﳦ','ﳧ'=>'ﳧ','ﳨ'=>'ﳨ','ﳩ'=>'ﳩ','ﳪ'=>'ﳪ','ﳫ'=>'ﳫ','ﳬ'=>'ﳬ','ﳭ'=>'ﳭ','ﳮ'=>'ﳮ','ﳯ'=>'ﳯ','ﳰ'=>'ﳰ','ﳱ'=>'ﳱ','ﳲ'=>'ﳲ','ﳳ'=>'ﳳ','ﳴ'=>'ﳴ','ﳵ'=>'ﳵ','ﳶ'=>'ﳶ','ﳷ'=>'ﳷ','ﳸ'=>'ﳸ','ﳹ'=>'ﳹ','ﳺ'=>'ﳺ','ﳻ'=>'ﳻ','ﳼ'=>'ﳼ','ﳽ'=>'ﳽ','ﳾ'=>'ﳾ','ﳿ'=>'ﳿ','ﴀ'=>'ﴀ','ﴁ'=>'ﴁ','ﴂ'=>'ﴂ','ﴃ'=>'ﴃ','ﴄ'=>'ﴄ','ﴅ'=>'ﴅ','ﴆ'=>'ﴆ','ﴇ'=>'ﴇ','ﴈ'=>'ﴈ','ﴉ'=>'ﴉ','ﴊ'=>'ﴊ','ﴋ'=>'ﴋ','ﴌ'=>'ﴌ','ﴍ'=>'ﴍ','ﴎ'=>'ﴎ','ﴏ'=>'ﴏ','ﴐ'=>'ﴐ','ﴑ'=>'ﴑ','ﴒ'=>'ﴒ','ﴓ'=>'ﴓ','ﴔ'=>'ﴔ','ﴕ'=>'ﴕ','ﴖ'=>'ﴖ','ﴗ'=>'ﴗ','ﴘ'=>'ﴘ','ﴙ'=>'ﴙ','ﴚ'=>'ﴚ','ﴛ'=>'ﴛ','ﴜ'=>'ﴜ','ﴝ'=>'ﴝ','ﴞ'=>'ﴞ','ﴟ'=>'ﴟ','ﴠ'=>'ﴠ','ﴡ'=>'ﴡ','ﴢ'=>'ﴢ','ﴣ'=>'ﴣ','ﴤ'=>'ﴤ','ﴥ'=>'ﴥ','ﴦ'=>'ﴦ','ﴧ'=>'ﴧ','ﴨ'=>'ﴨ','ﴩ'=>'ﴩ','ﴪ'=>'ﴪ','ﴫ'=>'ﴫ','ﴬ'=>'ﴬ','ﴭ'=>'ﴭ','ﴮ'=>'ﴮ','ﴯ'=>'ﴯ','ﴰ'=>'ﴰ','ﴱ'=>'ﴱ','ﴲ'=>'ﴲ','ﴳ'=>'ﴳ','ﴴ'=>'ﴴ','ﴵ'=>'ﴵ','ﴶ'=>'ﴶ','ﴷ'=>'ﴷ','ﴸ'=>'ﴸ','ﴹ'=>'ﴹ','ﴺ'=>'ﴺ','ﴻ'=>'ﴻ','ﴼ'=>'ﴼ','ﴽ'=>'ﴽ','ﵐ'=>'ﵐ','ﵑ'=>'ﵑ','ﵒ'=>'ﵒ','ﵓ'=>'ﵓ','ﵔ'=>'ﵔ','ﵕ'=>'ﵕ','ﵖ'=>'ﵖ','ﵗ'=>'ﵗ','ﵘ'=>'ﵘ','ﵙ'=>'ﵙ','ﵚ'=>'ﵚ','ﵛ'=>'ﵛ','ﵜ'=>'ﵜ','ﵝ'=>'ﵝ','ﵞ'=>'ﵞ','ﵟ'=>'ﵟ','ﵠ'=>'ﵠ','ﵡ'=>'ﵡ','ﵢ'=>'ﵢ','ﵣ'=>'ﵣ','ﵤ'=>'ﵤ','ﵥ'=>'ﵥ','ﵦ'=>'ﵦ','ﵧ'=>'ﵧ','ﵨ'=>'ﵨ','ﵩ'=>'ﵩ','ﵪ'=>'ﵪ','ﵫ'=>'ﵫ','ﵬ'=>'ﵬ','ﵭ'=>'ﵭ','ﵮ'=>'ﵮ','ﵯ'=>'ﵯ','ﵰ'=>'ﵰ','ﵱ'=>'ﵱ','ﵲ'=>'ﵲ','ﵳ'=>'ﵳ','ﵴ'=>'ﵴ','ﵵ'=>'ﵵ','ﵶ'=>'ﵶ','ﵷ'=>'ﵷ','ﵸ'=>'ﵸ','ﵹ'=>'ﵹ','ﵺ'=>'ﵺ','ﵻ'=>'ﵻ','ﵼ'=>'ﵼ','ﵽ'=>'ﵽ','ﵾ'=>'ﵾ','ﵿ'=>'ﵿ','ﶀ'=>'ﶀ','ﶁ'=>'ﶁ','ﶂ'=>'ﶂ','ﶃ'=>'ﶃ','ﶄ'=>'ﶄ','ﶅ'=>'ﶅ','ﶆ'=>'ﶆ','ﶇ'=>'ﶇ','ﶈ'=>'ﶈ','ﶉ'=>'ﶉ','ﶊ'=>'ﶊ','ﶋ'=>'ﶋ','ﶌ'=>'ﶌ','ﶍ'=>'ﶍ','ﶎ'=>'ﶎ','ﶏ'=>'ﶏ','ﶒ'=>'ﶒ','ﶓ'=>'ﶓ','ﶔ'=>'ﶔ','ﶕ'=>'ﶕ','ﶖ'=>'ﶖ','ﶗ'=>'ﶗ','ﶘ'=>'ﶘ','ﶙ'=>'ﶙ','ﶚ'=>'ﶚ','ﶛ'=>'ﶛ','ﶜ'=>'ﶜ','ﶝ'=>'ﶝ','ﶞ'=>'ﶞ','ﶟ'=>'ﶟ','ﶠ'=>'ﶠ','ﶡ'=>'ﶡ','ﶢ'=>'ﶢ','ﶣ'=>'ﶣ','ﶤ'=>'ﶤ','ﶥ'=>'ﶥ','ﶦ'=>'ﶦ','ﶧ'=>'ﶧ','ﶨ'=>'ﶨ','ﶩ'=>'ﶩ','ﶪ'=>'ﶪ','ﶫ'=>'ﶫ','ﶬ'=>'ﶬ','ﶭ'=>'ﶭ','ﶮ'=>'ﶮ','ﶯ'=>'ﶯ','ﶰ'=>'ﶰ','ﶱ'=>'ﶱ','ﶲ'=>'ﶲ','ﶳ'=>'ﶳ','ﶴ'=>'ﶴ','ﶵ'=>'ﶵ','ﶶ'=>'ﶶ','ﶷ'=>'ﶷ','ﶸ'=>'ﶸ','ﶹ'=>'ﶹ','ﶺ'=>'ﶺ','ﶻ'=>'ﶻ','ﶼ'=>'ﶼ','ﶽ'=>'ﶽ','ﶾ'=>'ﶾ','ﶿ'=>'ﶿ','ﷀ'=>'ﷀ','ﷁ'=>'ﷁ','ﷂ'=>'ﷂ','ﷃ'=>'ﷃ','ﷄ'=>'ﷄ','ﷅ'=>'ﷅ','ﷆ'=>'ﷆ','ﷇ'=>'ﷇ','ﷰ'=>'ﷰ','ﷱ'=>'ﷱ','ﷲ'=>'ﷲ','ﷳ'=>'ﷳ','ﷴ'=>'ﷴ','ﷵ'=>'ﷵ','ﷶ'=>'ﷶ','ﷷ'=>'ﷷ','ﷸ'=>'ﷸ','ﷹ'=>'ﷹ','ﷺ'=>'ﷺ','ﷻ'=>'ﷻ','︀'=>'︀','︁'=>'︁','︂'=>'︂','︃'=>'︃','︄'=>'︄','︅'=>'︅','︆'=>'︆','︇'=>'︇','︈'=>'︈','︉'=>'︉','︊'=>'︊','︋'=>'︋','︌'=>'︌','︍'=>'︍','︎'=>'︎','️'=>'️','︠'=>'︠','︡'=>'︡','︢'=>'︢','︣'=>'︣','ﹰ'=>'ﹰ','ﹱ'=>'ﹱ','ﹲ'=>'ﹲ','ﹳ'=>'ﹳ','ﹴ'=>'ﹴ','ﹶ'=>'ﹶ','ﹷ'=>'ﹷ','ﹸ'=>'ﹸ','ﹹ'=>'ﹹ','ﹺ'=>'ﹺ','ﹻ'=>'ﹻ','ﹼ'=>'ﹼ','ﹽ'=>'ﹽ','ﹾ'=>'ﹾ','ﹿ'=>'ﹿ','ﺀ'=>'ﺀ','ﺁ'=>'ﺁ','ﺂ'=>'ﺂ','ﺃ'=>'ﺃ','ﺄ'=>'ﺄ','ﺅ'=>'ﺅ','ﺆ'=>'ﺆ','ﺇ'=>'ﺇ','ﺈ'=>'ﺈ','ﺉ'=>'ﺉ','ﺊ'=>'ﺊ','ﺋ'=>'ﺋ','ﺌ'=>'ﺌ','ﺍ'=>'ﺍ','ﺎ'=>'ﺎ','ﺏ'=>'ﺏ','ﺐ'=>'ﺐ','ﺑ'=>'ﺑ','ﺒ'=>'ﺒ','ﺓ'=>'ﺓ','ﺔ'=>'ﺔ','ﺕ'=>'ﺕ','ﺖ'=>'ﺖ','ﺗ'=>'ﺗ','ﺘ'=>'ﺘ','ﺙ'=>'ﺙ','ﺚ'=>'ﺚ','ﺛ'=>'ﺛ','ﺜ'=>'ﺜ','ﺝ'=>'ﺝ','ﺞ'=>'ﺞ','ﺟ'=>'ﺟ','ﺠ'=>'ﺠ','ﺡ'=>'ﺡ','ﺢ'=>'ﺢ','ﺣ'=>'ﺣ','ﺤ'=>'ﺤ','ﺥ'=>'ﺥ','ﺦ'=>'ﺦ','ﺧ'=>'ﺧ','ﺨ'=>'ﺨ','ﺩ'=>'ﺩ','ﺪ'=>'ﺪ','ﺫ'=>'ﺫ','ﺬ'=>'ﺬ','ﺭ'=>'ﺭ','ﺮ'=>'ﺮ','ﺯ'=>'ﺯ','ﺰ'=>'ﺰ','ﺱ'=>'ﺱ','ﺲ'=>'ﺲ','ﺳ'=>'ﺳ','ﺴ'=>'ﺴ','ﺵ'=>'ﺵ','ﺶ'=>'ﺶ','ﺷ'=>'ﺷ','ﺸ'=>'ﺸ','ﺹ'=>'ﺹ','ﺺ'=>'ﺺ','ﺻ'=>'ﺻ','ﺼ'=>'ﺼ','ﺽ'=>'ﺽ','ﺾ'=>'ﺾ','ﺿ'=>'ﺿ','ﻀ'=>'ﻀ','ﻁ'=>'ﻁ','ﻂ'=>'ﻂ','ﻃ'=>'ﻃ','ﻄ'=>'ﻄ','ﻅ'=>'ﻅ','ﻆ'=>'ﻆ','ﻇ'=>'ﻇ','ﻈ'=>'ﻈ','ﻉ'=>'ﻉ','ﻊ'=>'ﻊ','ﻋ'=>'ﻋ','ﻌ'=>'ﻌ','ﻍ'=>'ﻍ','ﻎ'=>'ﻎ','ﻏ'=>'ﻏ','ﻐ'=>'ﻐ','ﻑ'=>'ﻑ','ﻒ'=>'ﻒ','ﻓ'=>'ﻓ','ﻔ'=>'ﻔ','ﻕ'=>'ﻕ','ﻖ'=>'ﻖ','ﻗ'=>'ﻗ','ﻘ'=>'ﻘ','ﻙ'=>'ﻙ','ﻚ'=>'ﻚ','ﻛ'=>'ﻛ','ﻜ'=>'ﻜ','ﻝ'=>'ﻝ','ﻞ'=>'ﻞ','ﻟ'=>'ﻟ','ﻠ'=>'ﻠ','ﻡ'=>'ﻡ','ﻢ'=>'ﻢ','ﻣ'=>'ﻣ','ﻤ'=>'ﻤ','ﻥ'=>'ﻥ','ﻦ'=>'ﻦ','ﻧ'=>'ﻧ','ﻨ'=>'ﻨ','ﻩ'=>'ﻩ','ﻪ'=>'ﻪ','ﻫ'=>'ﻫ','ﻬ'=>'ﻬ','ﻭ'=>'ﻭ','ﻮ'=>'ﻮ','ﻯ'=>'ﻯ','ﻰ'=>'ﻰ','ﻱ'=>'ﻱ','ﻲ'=>'ﻲ','ﻳ'=>'ﻳ','ﻴ'=>'ﻴ','ﻵ'=>'ﻵ','ﻶ'=>'ﻶ','ﻷ'=>'ﻷ','ﻸ'=>'ﻸ','ﻹ'=>'ﻹ','ﻺ'=>'ﻺ','ﻻ'=>'ﻻ','ﻼ'=>'ﻼ','0'=>'0','1'=>'1','2'=>'2','3'=>'3','4'=>'4','5'=>'5','6'=>'6','7'=>'7','8'=>'8','9'=>'9','A'=>'a','B'=>'b','C'=>'c','D'=>'d','E'=>'e','F'=>'f','G'=>'g','H'=>'h','I'=>'i','J'=>'j','K'=>'k','L'=>'l','M'=>'m','N'=>'n','O'=>'o','P'=>'p','Q'=>'q','R'=>'r','S'=>'s','T'=>'t','U'=>'u','V'=>'v','W'=>'w','X'=>'x','Y'=>'y','Z'=>'z','a'=>'a','b'=>'b','c'=>'c','d'=>'d','e'=>'e','f'=>'f','g'=>'g','h'=>'h','i'=>'i','j'=>'j','k'=>'k','l'=>'l','m'=>'m','n'=>'n','o'=>'o','p'=>'p','q'=>'q','r'=>'r','s'=>'s','t'=>'t','u'=>'u','v'=>'v','w'=>'w','x'=>'x','y'=>'y','z'=>'z','ヲ'=>'ヲ','ァ'=>'ァ','ィ'=>'ィ','ゥ'=>'ゥ','ェ'=>'ェ','ォ'=>'ォ','ャ'=>'ャ','ュ'=>'ュ','ョ'=>'ョ','ッ'=>'ッ','ー'=>'ー','ア'=>'ア','イ'=>'イ','ウ'=>'ウ','エ'=>'エ','オ'=>'オ','カ'=>'カ','キ'=>'キ','ク'=>'ク','ケ'=>'ケ','コ'=>'コ','サ'=>'サ','シ'=>'シ','ス'=>'ス','セ'=>'セ','ソ'=>'ソ','タ'=>'タ','チ'=>'チ','ツ'=>'ツ','テ'=>'テ','ト'=>'ト','ナ'=>'ナ','ニ'=>'ニ','ヌ'=>'ヌ','ネ'=>'ネ','ノ'=>'ノ','ハ'=>'ハ','ヒ'=>'ヒ','フ'=>'フ','ヘ'=>'ヘ','ホ'=>'ホ','マ'=>'マ','ミ'=>'ミ','ム'=>'ム','メ'=>'メ','モ'=>'モ','ヤ'=>'ヤ','ユ'=>'ユ','ヨ'=>'ヨ','ラ'=>'ラ','リ'=>'リ','ル'=>'ル','レ'=>'レ','ロ'=>'ロ','ワ'=>'ワ','ン'=>'ン','゙'=>'゙','゚'=>'゚','ᅠ'=>'ᅠ','ᄀ'=>'ᄀ','ᄁ'=>'ᄁ','ᆪ'=>'ᆪ','ᄂ'=>'ᄂ','ᆬ'=>'ᆬ','ᆭ'=>'ᆭ','ᄃ'=>'ᄃ','ᄄ'=>'ᄄ','ᄅ'=>'ᄅ','ᆰ'=>'ᆰ','ᆱ'=>'ᆱ','ᆲ'=>'ᆲ','ᆳ'=>'ᆳ','ᆴ'=>'ᆴ','ᆵ'=>'ᆵ','ᄚ'=>'ᄚ','ᄆ'=>'ᄆ','ᄇ'=>'ᄇ','ᄈ'=>'ᄈ','ᄡ'=>'ᄡ','ᄉ'=>'ᄉ','ᄊ'=>'ᄊ','ᄋ'=>'ᄋ','ᄌ'=>'ᄌ','ᄍ'=>'ᄍ','ᄎ'=>'ᄎ','ᄏ'=>'ᄏ','ᄐ'=>'ᄐ','ᄑ'=>'ᄑ','ᄒ'=>'ᄒ','ᅡ'=>'ᅡ','ᅢ'=>'ᅢ','ᅣ'=>'ᅣ','ᅤ'=>'ᅤ','ᅥ'=>'ᅥ','ᅦ'=>'ᅦ','ᅧ'=>'ᅧ','ᅨ'=>'ᅨ','ᅩ'=>'ᅩ','ᅪ'=>'ᅪ','ᅫ'=>'ᅫ','ᅬ'=>'ᅬ','ᅭ'=>'ᅭ','ᅮ'=>'ᅮ','ᅯ'=>'ᅯ','ᅰ'=>'ᅰ','ᅱ'=>'ᅱ','ᅲ'=>'ᅲ','ᅳ'=>'ᅳ','ᅴ'=>'ᅴ','ᅵ'=>'ᅵ'); \ No newline at end of file
+<?php return array('豈'=>'豈','更'=>'更','車'=>'車','賈'=>'賈','滑'=>'滑','串'=>'串','句'=>'句','龜'=>'龜','龜'=>'龜','契'=>'契','金'=>'金','喇'=>'喇','奈'=>'奈','懶'=>'懶','癩'=>'癩','羅'=>'羅','蘿'=>'蘿','螺'=>'螺','裸'=>'裸','邏'=>'邏','樂'=>'樂','洛'=>'洛','烙'=>'烙','珞'=>'珞','落'=>'落','酪'=>'酪','駱'=>'駱','亂'=>'亂','卵'=>'卵','欄'=>'欄','爛'=>'爛','蘭'=>'蘭','鸞'=>'鸞','嵐'=>'嵐','濫'=>'濫','藍'=>'藍','襤'=>'襤','拉'=>'拉','臘'=>'臘','蠟'=>'蠟','廊'=>'廊','朗'=>'朗','浪'=>'浪','狼'=>'狼','郎'=>'郎','來'=>'來','冷'=>'冷','勞'=>'勞','擄'=>'擄','櫓'=>'櫓','爐'=>'爐','盧'=>'盧','老'=>'老','蘆'=>'蘆','虜'=>'虜','路'=>'路','露'=>'露','魯'=>'魯','鷺'=>'鷺','碌'=>'碌','祿'=>'祿','綠'=>'綠','菉'=>'菉','錄'=>'錄','鹿'=>'鹿','論'=>'論','壟'=>'壟','弄'=>'弄','籠'=>'籠','聾'=>'聾','牢'=>'牢','磊'=>'磊','賂'=>'賂','雷'=>'雷','壘'=>'壘','屢'=>'屢','樓'=>'樓','淚'=>'淚','漏'=>'漏','累'=>'累','縷'=>'縷','陋'=>'陋','勒'=>'勒','肋'=>'肋','凜'=>'凜','凌'=>'凌','稜'=>'稜','綾'=>'綾','菱'=>'菱','陵'=>'陵','讀'=>'讀','拏'=>'拏','樂'=>'樂','諾'=>'諾','丹'=>'丹','寧'=>'寧','怒'=>'怒','率'=>'率','異'=>'異','北'=>'北','磻'=>'磻','便'=>'便','復'=>'復','不'=>'不','泌'=>'泌','數'=>'數','索'=>'索','參'=>'參','塞'=>'塞','省'=>'省','葉'=>'葉','說'=>'說','殺'=>'殺','辰'=>'辰','沈'=>'沈','拾'=>'拾','若'=>'若','掠'=>'掠','略'=>'略','亮'=>'亮','兩'=>'兩','凉'=>'凉','梁'=>'梁','糧'=>'糧','良'=>'良','諒'=>'諒','量'=>'量','勵'=>'勵','呂'=>'呂','女'=>'女','廬'=>'廬','旅'=>'旅','濾'=>'濾','礪'=>'礪','閭'=>'閭','驪'=>'驪','麗'=>'麗','黎'=>'黎','力'=>'力','曆'=>'曆','歷'=>'歷','轢'=>'轢','年'=>'年','憐'=>'憐','戀'=>'戀','撚'=>'撚','漣'=>'漣','煉'=>'煉','璉'=>'璉','秊'=>'秊','練'=>'練','聯'=>'聯','輦'=>'輦','蓮'=>'蓮','連'=>'連','鍊'=>'鍊','列'=>'列','劣'=>'劣','咽'=>'咽','烈'=>'烈','裂'=>'裂','說'=>'說','廉'=>'廉','念'=>'念','捻'=>'捻','殮'=>'殮','簾'=>'簾','獵'=>'獵','令'=>'令','囹'=>'囹','寧'=>'寧','嶺'=>'嶺','怜'=>'怜','玲'=>'玲','瑩'=>'瑩','羚'=>'羚','聆'=>'聆','鈴'=>'鈴','零'=>'零','靈'=>'靈','領'=>'領','例'=>'例','禮'=>'禮','醴'=>'醴','隸'=>'隸','惡'=>'惡','了'=>'了','僚'=>'僚','寮'=>'寮','尿'=>'尿','料'=>'料','樂'=>'樂','燎'=>'燎','療'=>'療','蓼'=>'蓼','遼'=>'遼','龍'=>'龍','暈'=>'暈','阮'=>'阮','劉'=>'劉','杻'=>'杻','柳'=>'柳','流'=>'流','溜'=>'溜','琉'=>'琉','留'=>'留','硫'=>'硫','紐'=>'紐','類'=>'類','六'=>'六','戮'=>'戮','陸'=>'陸','倫'=>'倫','崙'=>'崙','淪'=>'淪','輪'=>'輪','律'=>'律','慄'=>'慄','栗'=>'栗','率'=>'率','隆'=>'隆','利'=>'利','吏'=>'吏','履'=>'履','易'=>'易','李'=>'李','梨'=>'梨','泥'=>'泥','理'=>'理','痢'=>'痢','罹'=>'罹','裏'=>'裏','裡'=>'裡','里'=>'里','離'=>'離','匿'=>'匿','溺'=>'溺','吝'=>'吝','燐'=>'燐','璘'=>'璘','藺'=>'藺','隣'=>'隣','鱗'=>'鱗','麟'=>'麟','林'=>'林','淋'=>'淋','臨'=>'臨','立'=>'立','笠'=>'笠','粒'=>'粒','狀'=>'狀','炙'=>'炙','識'=>'識','什'=>'什','茶'=>'茶','刺'=>'刺','切'=>'切','度'=>'度','拓'=>'拓','糖'=>'糖','宅'=>'宅','洞'=>'洞','暴'=>'暴','輻'=>'輻','行'=>'行','降'=>'降','見'=>'見','廓'=>'廓','兀'=>'兀','嗀'=>'嗀','﨎'=>'﨎','﨏'=>'﨏','塚'=>'塚','﨑'=>'﨑','晴'=>'晴','﨓'=>'﨓','﨔'=>'﨔','凞'=>'凞','猪'=>'猪','益'=>'益','礼'=>'礼','神'=>'神','祥'=>'祥','福'=>'福','靖'=>'靖','精'=>'精','羽'=>'羽','﨟'=>'﨟','蘒'=>'蘒','﨡'=>'﨡','諸'=>'諸','﨣'=>'﨣','﨤'=>'﨤','逸'=>'逸','都'=>'都','﨧'=>'﨧','﨨'=>'﨨','﨩'=>'﨩','飯'=>'飯','飼'=>'飼','館'=>'館','鶴'=>'鶴','侮'=>'侮','僧'=>'僧','免'=>'免','勉'=>'勉','勤'=>'勤','卑'=>'卑','喝'=>'喝','嘆'=>'嘆','器'=>'器','塀'=>'塀','墨'=>'墨','層'=>'層','屮'=>'屮','悔'=>'悔','慨'=>'慨','憎'=>'憎','懲'=>'懲','敏'=>'敏','既'=>'既','暑'=>'暑','梅'=>'梅','海'=>'海','渚'=>'渚','漢'=>'漢','煮'=>'煮','爫'=>'爫','琢'=>'琢','碑'=>'碑','社'=>'社','祉'=>'祉','祈'=>'祈','祐'=>'祐','祖'=>'祖','祝'=>'祝','禍'=>'禍','禎'=>'禎','穀'=>'穀','突'=>'突','節'=>'節','練'=>'練','縉'=>'縉','繁'=>'繁','署'=>'署','者'=>'者','臭'=>'臭','艹'=>'艹','艹'=>'艹','著'=>'著','褐'=>'褐','視'=>'視','謁'=>'謁','謹'=>'謹','賓'=>'賓','贈'=>'贈','辶'=>'辶','逸'=>'逸','難'=>'難','響'=>'響','頻'=>'頻','並'=>'並','况'=>'况','全'=>'全','侀'=>'侀','充'=>'充','冀'=>'冀','勇'=>'勇','勺'=>'勺','喝'=>'喝','啕'=>'啕','喙'=>'喙','嗢'=>'嗢','塚'=>'塚','墳'=>'墳','奄'=>'奄','奔'=>'奔','婢'=>'婢','嬨'=>'嬨','廒'=>'廒','廙'=>'廙','彩'=>'彩','徭'=>'徭','惘'=>'惘','慎'=>'慎','愈'=>'愈','憎'=>'憎','慠'=>'慠','懲'=>'懲','戴'=>'戴','揄'=>'揄','搜'=>'搜','摒'=>'摒','敖'=>'敖','晴'=>'晴','朗'=>'朗','望'=>'望','杖'=>'杖','歹'=>'歹','殺'=>'殺','流'=>'流','滛'=>'滛','滋'=>'滋','漢'=>'漢','瀞'=>'瀞','煮'=>'煮','瞧'=>'瞧','爵'=>'爵','犯'=>'犯','猪'=>'猪','瑱'=>'瑱','甆'=>'甆','画'=>'画','瘝'=>'瘝','瘟'=>'瘟','益'=>'益','盛'=>'盛','直'=>'直','睊'=>'睊','着'=>'着','磌'=>'磌','窱'=>'窱','節'=>'節','类'=>'类','絛'=>'絛','練'=>'練','缾'=>'缾','者'=>'者','荒'=>'荒','華'=>'華','蝹'=>'蝹','襁'=>'襁','覆'=>'覆','視'=>'視','調'=>'調','諸'=>'諸','請'=>'請','謁'=>'謁','諾'=>'諾','諭'=>'諭','謹'=>'謹','變'=>'變','贈'=>'贈','輸'=>'輸','遲'=>'遲','醙'=>'醙','鉶'=>'鉶','陼'=>'陼','難'=>'難','靖'=>'靖','韛'=>'韛','響'=>'響','頋'=>'頋','頻'=>'頻','鬒'=>'鬒','龜'=>'龜','𢡊'=>'𢡊','𢡄'=>'𢡄','𣏕'=>'𣏕','㮝'=>'㮝','䀘'=>'䀘','䀹'=>'䀹','𥉉'=>'𥉉','𥳐'=>'𥳐','𧻓'=>'𧻓','齃'=>'齃','龎'=>'龎','ff'=>'ff','fi'=>'fi','fl'=>'fl','ffi'=>'ffi','ffl'=>'ffl','ſt'=>'ſt','st'=>'st','ﬓ'=>'ﬓ','ﬔ'=>'ﬔ','ﬕ'=>'ﬕ','ﬖ'=>'ﬖ','ﬗ'=>'ﬗ','יִ'=>'יִ','ﬞ'=>'ﬞ','ײַ'=>'ײַ','ﬠ'=>'ﬠ','ﬡ'=>'ﬡ','ﬢ'=>'ﬢ','ﬣ'=>'ﬣ','ﬤ'=>'ﬤ','ﬥ'=>'ﬥ','ﬦ'=>'ﬦ','ﬧ'=>'ﬧ','ﬨ'=>'ﬨ','שׁ'=>'שׁ','שׂ'=>'שׂ','שּׁ'=>'שּׁ','שּׂ'=>'שּׂ','אַ'=>'אַ','אָ'=>'אָ','אּ'=>'אּ','בּ'=>'בּ','גּ'=>'גּ','דּ'=>'דּ','הּ'=>'הּ','וּ'=>'וּ','זּ'=>'זּ','טּ'=>'טּ','יּ'=>'יּ','ךּ'=>'ךּ','כּ'=>'כּ','לּ'=>'לּ','מּ'=>'מּ','נּ'=>'נּ','סּ'=>'סּ','ףּ'=>'ףּ','פּ'=>'פּ','צּ'=>'צּ','קּ'=>'קּ','רּ'=>'רּ','שּ'=>'שּ','תּ'=>'תּ','וֹ'=>'וֹ','בֿ'=>'בֿ','כֿ'=>'כֿ','פֿ'=>'פֿ','ﭏ'=>'ﭏ','ﭐ'=>'ﭐ','ﭑ'=>'ﭑ','ﭒ'=>'ﭒ','ﭓ'=>'ﭓ','ﭔ'=>'ﭔ','ﭕ'=>'ﭕ','ﭖ'=>'ﭖ','ﭗ'=>'ﭗ','ﭘ'=>'ﭘ','ﭙ'=>'ﭙ','ﭚ'=>'ﭚ','ﭛ'=>'ﭛ','ﭜ'=>'ﭜ','ﭝ'=>'ﭝ','ﭞ'=>'ﭞ','ﭟ'=>'ﭟ','ﭠ'=>'ﭠ','ﭡ'=>'ﭡ','ﭢ'=>'ﭢ','ﭣ'=>'ﭣ','ﭤ'=>'ﭤ','ﭥ'=>'ﭥ','ﭦ'=>'ﭦ','ﭧ'=>'ﭧ','ﭨ'=>'ﭨ','ﭩ'=>'ﭩ','ﭪ'=>'ﭪ','ﭫ'=>'ﭫ','ﭬ'=>'ﭬ','ﭭ'=>'ﭭ','ﭮ'=>'ﭮ','ﭯ'=>'ﭯ','ﭰ'=>'ﭰ','ﭱ'=>'ﭱ','ﭲ'=>'ﭲ','ﭳ'=>'ﭳ','ﭴ'=>'ﭴ','ﭵ'=>'ﭵ','ﭶ'=>'ﭶ','ﭷ'=>'ﭷ','ﭸ'=>'ﭸ','ﭹ'=>'ﭹ','ﭺ'=>'ﭺ','ﭻ'=>'ﭻ','ﭼ'=>'ﭼ','ﭽ'=>'ﭽ','ﭾ'=>'ﭾ','ﭿ'=>'ﭿ','ﮀ'=>'ﮀ','ﮁ'=>'ﮁ','ﮂ'=>'ﮂ','ﮃ'=>'ﮃ','ﮄ'=>'ﮄ','ﮅ'=>'ﮅ','ﮆ'=>'ﮆ','ﮇ'=>'ﮇ','ﮈ'=>'ﮈ','ﮉ'=>'ﮉ','ﮊ'=>'ﮊ','ﮋ'=>'ﮋ','ﮌ'=>'ﮌ','ﮍ'=>'ﮍ','ﮎ'=>'ﮎ','ﮏ'=>'ﮏ','ﮐ'=>'ﮐ','ﮑ'=>'ﮑ','ﮒ'=>'ﮒ','ﮓ'=>'ﮓ','ﮔ'=>'ﮔ','ﮕ'=>'ﮕ','ﮖ'=>'ﮖ','ﮗ'=>'ﮗ','ﮘ'=>'ﮘ','ﮙ'=>'ﮙ','ﮚ'=>'ﮚ','ﮛ'=>'ﮛ','ﮜ'=>'ﮜ','ﮝ'=>'ﮝ','ﮞ'=>'ﮞ','ﮟ'=>'ﮟ','ﮠ'=>'ﮠ','ﮡ'=>'ﮡ','ﮢ'=>'ﮢ','ﮣ'=>'ﮣ','ﮤ'=>'ﮤ','ﮥ'=>'ﮥ','ﮦ'=>'ﮦ','ﮧ'=>'ﮧ','ﮨ'=>'ﮨ','ﮩ'=>'ﮩ','ﮪ'=>'ﮪ','ﮫ'=>'ﮫ','ﮬ'=>'ﮬ','ﮭ'=>'ﮭ','ﮮ'=>'ﮮ','ﮯ'=>'ﮯ','ﮰ'=>'ﮰ','ﮱ'=>'ﮱ','ﯓ'=>'ﯓ','ﯔ'=>'ﯔ','ﯕ'=>'ﯕ','ﯖ'=>'ﯖ','ﯗ'=>'ﯗ','ﯘ'=>'ﯘ','ﯙ'=>'ﯙ','ﯚ'=>'ﯚ','ﯛ'=>'ﯛ','ﯜ'=>'ﯜ','ﯝ'=>'ﯝ','ﯞ'=>'ﯞ','ﯟ'=>'ﯟ','ﯠ'=>'ﯠ','ﯡ'=>'ﯡ','ﯢ'=>'ﯢ','ﯣ'=>'ﯣ','ﯤ'=>'ﯤ','ﯥ'=>'ﯥ','ﯦ'=>'ﯦ','ﯧ'=>'ﯧ','ﯨ'=>'ﯨ','ﯩ'=>'ﯩ','ﯪ'=>'ﯪ','ﯫ'=>'ﯫ','ﯬ'=>'ﯬ','ﯭ'=>'ﯭ','ﯮ'=>'ﯮ','ﯯ'=>'ﯯ','ﯰ'=>'ﯰ','ﯱ'=>'ﯱ','ﯲ'=>'ﯲ','ﯳ'=>'ﯳ','ﯴ'=>'ﯴ','ﯵ'=>'ﯵ','ﯶ'=>'ﯶ','ﯷ'=>'ﯷ','ﯸ'=>'ﯸ','ﯹ'=>'ﯹ','ﯺ'=>'ﯺ','ﯻ'=>'ﯻ','ﯼ'=>'ﯼ','ﯽ'=>'ﯽ','ﯾ'=>'ﯾ','ﯿ'=>'ﯿ','ﰀ'=>'ﰀ','ﰁ'=>'ﰁ','ﰂ'=>'ﰂ','ﰃ'=>'ﰃ','ﰄ'=>'ﰄ','ﰅ'=>'ﰅ','ﰆ'=>'ﰆ','ﰇ'=>'ﰇ','ﰈ'=>'ﰈ','ﰉ'=>'ﰉ','ﰊ'=>'ﰊ','ﰋ'=>'ﰋ','ﰌ'=>'ﰌ','ﰍ'=>'ﰍ','ﰎ'=>'ﰎ','ﰏ'=>'ﰏ','ﰐ'=>'ﰐ','ﰑ'=>'ﰑ','ﰒ'=>'ﰒ','ﰓ'=>'ﰓ','ﰔ'=>'ﰔ','ﰕ'=>'ﰕ','ﰖ'=>'ﰖ','ﰗ'=>'ﰗ','ﰘ'=>'ﰘ','ﰙ'=>'ﰙ','ﰚ'=>'ﰚ','ﰛ'=>'ﰛ','ﰜ'=>'ﰜ','ﰝ'=>'ﰝ','ﰞ'=>'ﰞ','ﰟ'=>'ﰟ','ﰠ'=>'ﰠ','ﰡ'=>'ﰡ','ﰢ'=>'ﰢ','ﰣ'=>'ﰣ','ﰤ'=>'ﰤ','ﰥ'=>'ﰥ','ﰦ'=>'ﰦ','ﰧ'=>'ﰧ','ﰨ'=>'ﰨ','ﰩ'=>'ﰩ','ﰪ'=>'ﰪ','ﰫ'=>'ﰫ','ﰬ'=>'ﰬ','ﰭ'=>'ﰭ','ﰮ'=>'ﰮ','ﰯ'=>'ﰯ','ﰰ'=>'ﰰ','ﰱ'=>'ﰱ','ﰲ'=>'ﰲ','ﰳ'=>'ﰳ','ﰴ'=>'ﰴ','ﰵ'=>'ﰵ','ﰶ'=>'ﰶ','ﰷ'=>'ﰷ','ﰸ'=>'ﰸ','ﰹ'=>'ﰹ','ﰺ'=>'ﰺ','ﰻ'=>'ﰻ','ﰼ'=>'ﰼ','ﰽ'=>'ﰽ','ﰾ'=>'ﰾ','ﰿ'=>'ﰿ','ﱀ'=>'ﱀ','ﱁ'=>'ﱁ','ﱂ'=>'ﱂ','ﱃ'=>'ﱃ','ﱄ'=>'ﱄ','ﱅ'=>'ﱅ','ﱆ'=>'ﱆ','ﱇ'=>'ﱇ','ﱈ'=>'ﱈ','ﱉ'=>'ﱉ','ﱊ'=>'ﱊ','ﱋ'=>'ﱋ','ﱌ'=>'ﱌ','ﱍ'=>'ﱍ','ﱎ'=>'ﱎ','ﱏ'=>'ﱏ','ﱐ'=>'ﱐ','ﱑ'=>'ﱑ','ﱒ'=>'ﱒ','ﱓ'=>'ﱓ','ﱔ'=>'ﱔ','ﱕ'=>'ﱕ','ﱖ'=>'ﱖ','ﱗ'=>'ﱗ','ﱘ'=>'ﱘ','ﱙ'=>'ﱙ','ﱚ'=>'ﱚ','ﱛ'=>'ﱛ','ﱜ'=>'ﱜ','ﱝ'=>'ﱝ','ﱞ'=>'ﱞ','ﱟ'=>'ﱟ','ﱠ'=>'ﱠ','ﱡ'=>'ﱡ','ﱢ'=>'ﱢ','ﱣ'=>'ﱣ','ﱤ'=>'ﱤ','ﱥ'=>'ﱥ','ﱦ'=>'ﱦ','ﱧ'=>'ﱧ','ﱨ'=>'ﱨ','ﱩ'=>'ﱩ','ﱪ'=>'ﱪ','ﱫ'=>'ﱫ','ﱬ'=>'ﱬ','ﱭ'=>'ﱭ','ﱮ'=>'ﱮ','ﱯ'=>'ﱯ','ﱰ'=>'ﱰ','ﱱ'=>'ﱱ','ﱲ'=>'ﱲ','ﱳ'=>'ﱳ','ﱴ'=>'ﱴ','ﱵ'=>'ﱵ','ﱶ'=>'ﱶ','ﱷ'=>'ﱷ','ﱸ'=>'ﱸ','ﱹ'=>'ﱹ','ﱺ'=>'ﱺ','ﱻ'=>'ﱻ','ﱼ'=>'ﱼ','ﱽ'=>'ﱽ','ﱾ'=>'ﱾ','ﱿ'=>'ﱿ','ﲀ'=>'ﲀ','ﲁ'=>'ﲁ','ﲂ'=>'ﲂ','ﲃ'=>'ﲃ','ﲄ'=>'ﲄ','ﲅ'=>'ﲅ','ﲆ'=>'ﲆ','ﲇ'=>'ﲇ','ﲈ'=>'ﲈ','ﲉ'=>'ﲉ','ﲊ'=>'ﲊ','ﲋ'=>'ﲋ','ﲌ'=>'ﲌ','ﲍ'=>'ﲍ','ﲎ'=>'ﲎ','ﲏ'=>'ﲏ','ﲐ'=>'ﲐ','ﲑ'=>'ﲑ','ﲒ'=>'ﲒ','ﲓ'=>'ﲓ','ﲔ'=>'ﲔ','ﲕ'=>'ﲕ','ﲖ'=>'ﲖ','ﲗ'=>'ﲗ','ﲘ'=>'ﲘ','ﲙ'=>'ﲙ','ﲚ'=>'ﲚ','ﲛ'=>'ﲛ','ﲜ'=>'ﲜ','ﲝ'=>'ﲝ','ﲞ'=>'ﲞ','ﲟ'=>'ﲟ','ﲠ'=>'ﲠ','ﲡ'=>'ﲡ','ﲢ'=>'ﲢ','ﲣ'=>'ﲣ','ﲤ'=>'ﲤ','ﲥ'=>'ﲥ','ﲦ'=>'ﲦ','ﲧ'=>'ﲧ','ﲨ'=>'ﲨ','ﲩ'=>'ﲩ','ﲪ'=>'ﲪ','ﲫ'=>'ﲫ','ﲬ'=>'ﲬ','ﲭ'=>'ﲭ','ﲮ'=>'ﲮ','ﲯ'=>'ﲯ','ﲰ'=>'ﲰ','ﲱ'=>'ﲱ','ﲲ'=>'ﲲ','ﲳ'=>'ﲳ','ﲴ'=>'ﲴ','ﲵ'=>'ﲵ','ﲶ'=>'ﲶ','ﲷ'=>'ﲷ','ﲸ'=>'ﲸ','ﲹ'=>'ﲹ','ﲺ'=>'ﲺ','ﲻ'=>'ﲻ','ﲼ'=>'ﲼ','ﲽ'=>'ﲽ','ﲾ'=>'ﲾ','ﲿ'=>'ﲿ','ﳀ'=>'ﳀ','ﳁ'=>'ﳁ','ﳂ'=>'ﳂ','ﳃ'=>'ﳃ','ﳄ'=>'ﳄ','ﳅ'=>'ﳅ','ﳆ'=>'ﳆ','ﳇ'=>'ﳇ','ﳈ'=>'ﳈ','ﳉ'=>'ﳉ','ﳊ'=>'ﳊ','ﳋ'=>'ﳋ','ﳌ'=>'ﳌ','ﳍ'=>'ﳍ','ﳎ'=>'ﳎ','ﳏ'=>'ﳏ','ﳐ'=>'ﳐ','ﳑ'=>'ﳑ','ﳒ'=>'ﳒ','ﳓ'=>'ﳓ','ﳔ'=>'ﳔ','ﳕ'=>'ﳕ','ﳖ'=>'ﳖ','ﳗ'=>'ﳗ','ﳘ'=>'ﳘ','ﳙ'=>'ﳙ','ﳚ'=>'ﳚ','ﳛ'=>'ﳛ','ﳜ'=>'ﳜ','ﳝ'=>'ﳝ','ﳞ'=>'ﳞ','ﳟ'=>'ﳟ','ﳠ'=>'ﳠ','ﳡ'=>'ﳡ','ﳢ'=>'ﳢ','ﳣ'=>'ﳣ','ﳤ'=>'ﳤ','ﳥ'=>'ﳥ','ﳦ'=>'ﳦ','ﳧ'=>'ﳧ','ﳨ'=>'ﳨ','ﳩ'=>'ﳩ','ﳪ'=>'ﳪ','ﳫ'=>'ﳫ','ﳬ'=>'ﳬ','ﳭ'=>'ﳭ','ﳮ'=>'ﳮ','ﳯ'=>'ﳯ','ﳰ'=>'ﳰ','ﳱ'=>'ﳱ','ﳲ'=>'ﳲ','ﳳ'=>'ﳳ','ﳴ'=>'ﳴ','ﳵ'=>'ﳵ','ﳶ'=>'ﳶ','ﳷ'=>'ﳷ','ﳸ'=>'ﳸ','ﳹ'=>'ﳹ','ﳺ'=>'ﳺ','ﳻ'=>'ﳻ','ﳼ'=>'ﳼ','ﳽ'=>'ﳽ','ﳾ'=>'ﳾ','ﳿ'=>'ﳿ','ﴀ'=>'ﴀ','ﴁ'=>'ﴁ','ﴂ'=>'ﴂ','ﴃ'=>'ﴃ','ﴄ'=>'ﴄ','ﴅ'=>'ﴅ','ﴆ'=>'ﴆ','ﴇ'=>'ﴇ','ﴈ'=>'ﴈ','ﴉ'=>'ﴉ','ﴊ'=>'ﴊ','ﴋ'=>'ﴋ','ﴌ'=>'ﴌ','ﴍ'=>'ﴍ','ﴎ'=>'ﴎ','ﴏ'=>'ﴏ','ﴐ'=>'ﴐ','ﴑ'=>'ﴑ','ﴒ'=>'ﴒ','ﴓ'=>'ﴓ','ﴔ'=>'ﴔ','ﴕ'=>'ﴕ','ﴖ'=>'ﴖ','ﴗ'=>'ﴗ','ﴘ'=>'ﴘ','ﴙ'=>'ﴙ','ﴚ'=>'ﴚ','ﴛ'=>'ﴛ','ﴜ'=>'ﴜ','ﴝ'=>'ﴝ','ﴞ'=>'ﴞ','ﴟ'=>'ﴟ','ﴠ'=>'ﴠ','ﴡ'=>'ﴡ','ﴢ'=>'ﴢ','ﴣ'=>'ﴣ','ﴤ'=>'ﴤ','ﴥ'=>'ﴥ','ﴦ'=>'ﴦ','ﴧ'=>'ﴧ','ﴨ'=>'ﴨ','ﴩ'=>'ﴩ','ﴪ'=>'ﴪ','ﴫ'=>'ﴫ','ﴬ'=>'ﴬ','ﴭ'=>'ﴭ','ﴮ'=>'ﴮ','ﴯ'=>'ﴯ','ﴰ'=>'ﴰ','ﴱ'=>'ﴱ','ﴲ'=>'ﴲ','ﴳ'=>'ﴳ','ﴴ'=>'ﴴ','ﴵ'=>'ﴵ','ﴶ'=>'ﴶ','ﴷ'=>'ﴷ','ﴸ'=>'ﴸ','ﴹ'=>'ﴹ','ﴺ'=>'ﴺ','ﴻ'=>'ﴻ','ﴼ'=>'ﴼ','ﴽ'=>'ﴽ','ﵐ'=>'ﵐ','ﵑ'=>'ﵑ','ﵒ'=>'ﵒ','ﵓ'=>'ﵓ','ﵔ'=>'ﵔ','ﵕ'=>'ﵕ','ﵖ'=>'ﵖ','ﵗ'=>'ﵗ','ﵘ'=>'ﵘ','ﵙ'=>'ﵙ','ﵚ'=>'ﵚ','ﵛ'=>'ﵛ','ﵜ'=>'ﵜ','ﵝ'=>'ﵝ','ﵞ'=>'ﵞ','ﵟ'=>'ﵟ','ﵠ'=>'ﵠ','ﵡ'=>'ﵡ','ﵢ'=>'ﵢ','ﵣ'=>'ﵣ','ﵤ'=>'ﵤ','ﵥ'=>'ﵥ','ﵦ'=>'ﵦ','ﵧ'=>'ﵧ','ﵨ'=>'ﵨ','ﵩ'=>'ﵩ','ﵪ'=>'ﵪ','ﵫ'=>'ﵫ','ﵬ'=>'ﵬ','ﵭ'=>'ﵭ','ﵮ'=>'ﵮ','ﵯ'=>'ﵯ','ﵰ'=>'ﵰ','ﵱ'=>'ﵱ','ﵲ'=>'ﵲ','ﵳ'=>'ﵳ','ﵴ'=>'ﵴ','ﵵ'=>'ﵵ','ﵶ'=>'ﵶ','ﵷ'=>'ﵷ','ﵸ'=>'ﵸ','ﵹ'=>'ﵹ','ﵺ'=>'ﵺ','ﵻ'=>'ﵻ','ﵼ'=>'ﵼ','ﵽ'=>'ﵽ','ﵾ'=>'ﵾ','ﵿ'=>'ﵿ','ﶀ'=>'ﶀ','ﶁ'=>'ﶁ','ﶂ'=>'ﶂ','ﶃ'=>'ﶃ','ﶄ'=>'ﶄ','ﶅ'=>'ﶅ','ﶆ'=>'ﶆ','ﶇ'=>'ﶇ','ﶈ'=>'ﶈ','ﶉ'=>'ﶉ','ﶊ'=>'ﶊ','ﶋ'=>'ﶋ','ﶌ'=>'ﶌ','ﶍ'=>'ﶍ','ﶎ'=>'ﶎ','ﶏ'=>'ﶏ','ﶒ'=>'ﶒ','ﶓ'=>'ﶓ','ﶔ'=>'ﶔ','ﶕ'=>'ﶕ','ﶖ'=>'ﶖ','ﶗ'=>'ﶗ','ﶘ'=>'ﶘ','ﶙ'=>'ﶙ','ﶚ'=>'ﶚ','ﶛ'=>'ﶛ','ﶜ'=>'ﶜ','ﶝ'=>'ﶝ','ﶞ'=>'ﶞ','ﶟ'=>'ﶟ','ﶠ'=>'ﶠ','ﶡ'=>'ﶡ','ﶢ'=>'ﶢ','ﶣ'=>'ﶣ','ﶤ'=>'ﶤ','ﶥ'=>'ﶥ','ﶦ'=>'ﶦ','ﶧ'=>'ﶧ','ﶨ'=>'ﶨ','ﶩ'=>'ﶩ','ﶪ'=>'ﶪ','ﶫ'=>'ﶫ','ﶬ'=>'ﶬ','ﶭ'=>'ﶭ','ﶮ'=>'ﶮ','ﶯ'=>'ﶯ','ﶰ'=>'ﶰ','ﶱ'=>'ﶱ','ﶲ'=>'ﶲ','ﶳ'=>'ﶳ','ﶴ'=>'ﶴ','ﶵ'=>'ﶵ','ﶶ'=>'ﶶ','ﶷ'=>'ﶷ','ﶸ'=>'ﶸ','ﶹ'=>'ﶹ','ﶺ'=>'ﶺ','ﶻ'=>'ﶻ','ﶼ'=>'ﶼ','ﶽ'=>'ﶽ','ﶾ'=>'ﶾ','ﶿ'=>'ﶿ','ﷀ'=>'ﷀ','ﷁ'=>'ﷁ','ﷂ'=>'ﷂ','ﷃ'=>'ﷃ','ﷄ'=>'ﷄ','ﷅ'=>'ﷅ','ﷆ'=>'ﷆ','ﷇ'=>'ﷇ','ﷰ'=>'ﷰ','ﷱ'=>'ﷱ','ﷲ'=>'ﷲ','ﷳ'=>'ﷳ','ﷴ'=>'ﷴ','ﷵ'=>'ﷵ','ﷶ'=>'ﷶ','ﷷ'=>'ﷷ','ﷸ'=>'ﷸ','ﷹ'=>'ﷹ','ﷺ'=>'ﷺ','ﷻ'=>'ﷻ','︀'=>'︀','︁'=>'︁','︂'=>'︂','︃'=>'︃','︄'=>'︄','︅'=>'︅','︆'=>'︆','︇'=>'︇','︈'=>'︈','︉'=>'︉','︊'=>'︊','︋'=>'︋','︌'=>'︌','︍'=>'︍','︎'=>'︎','️'=>'️','︠'=>'︠','︡'=>'︡','︢'=>'︢','︣'=>'︣','ﹰ'=>'ﹰ','ﹱ'=>'ﹱ','ﹲ'=>'ﹲ','ﹳ'=>'ﹳ','ﹴ'=>'ﹴ','ﹶ'=>'ﹶ','ﹷ'=>'ﹷ','ﹸ'=>'ﹸ','ﹹ'=>'ﹹ','ﹺ'=>'ﹺ','ﹻ'=>'ﹻ','ﹼ'=>'ﹼ','ﹽ'=>'ﹽ','ﹾ'=>'ﹾ','ﹿ'=>'ﹿ','ﺀ'=>'ﺀ','ﺁ'=>'ﺁ','ﺂ'=>'ﺂ','ﺃ'=>'ﺃ','ﺄ'=>'ﺄ','ﺅ'=>'ﺅ','ﺆ'=>'ﺆ','ﺇ'=>'ﺇ','ﺈ'=>'ﺈ','ﺉ'=>'ﺉ','ﺊ'=>'ﺊ','ﺋ'=>'ﺋ','ﺌ'=>'ﺌ','ﺍ'=>'ﺍ','ﺎ'=>'ﺎ','ﺏ'=>'ﺏ','ﺐ'=>'ﺐ','ﺑ'=>'ﺑ','ﺒ'=>'ﺒ','ﺓ'=>'ﺓ','ﺔ'=>'ﺔ','ﺕ'=>'ﺕ','ﺖ'=>'ﺖ','ﺗ'=>'ﺗ','ﺘ'=>'ﺘ','ﺙ'=>'ﺙ','ﺚ'=>'ﺚ','ﺛ'=>'ﺛ','ﺜ'=>'ﺜ','ﺝ'=>'ﺝ','ﺞ'=>'ﺞ','ﺟ'=>'ﺟ','ﺠ'=>'ﺠ','ﺡ'=>'ﺡ','ﺢ'=>'ﺢ','ﺣ'=>'ﺣ','ﺤ'=>'ﺤ','ﺥ'=>'ﺥ','ﺦ'=>'ﺦ','ﺧ'=>'ﺧ','ﺨ'=>'ﺨ','ﺩ'=>'ﺩ','ﺪ'=>'ﺪ','ﺫ'=>'ﺫ','ﺬ'=>'ﺬ','ﺭ'=>'ﺭ','ﺮ'=>'ﺮ','ﺯ'=>'ﺯ','ﺰ'=>'ﺰ','ﺱ'=>'ﺱ','ﺲ'=>'ﺲ','ﺳ'=>'ﺳ','ﺴ'=>'ﺴ','ﺵ'=>'ﺵ','ﺶ'=>'ﺶ','ﺷ'=>'ﺷ','ﺸ'=>'ﺸ','ﺹ'=>'ﺹ','ﺺ'=>'ﺺ','ﺻ'=>'ﺻ','ﺼ'=>'ﺼ','ﺽ'=>'ﺽ','ﺾ'=>'ﺾ','ﺿ'=>'ﺿ','ﻀ'=>'ﻀ','ﻁ'=>'ﻁ','ﻂ'=>'ﻂ','ﻃ'=>'ﻃ','ﻄ'=>'ﻄ','ﻅ'=>'ﻅ','ﻆ'=>'ﻆ','ﻇ'=>'ﻇ','ﻈ'=>'ﻈ','ﻉ'=>'ﻉ','ﻊ'=>'ﻊ','ﻋ'=>'ﻋ','ﻌ'=>'ﻌ','ﻍ'=>'ﻍ','ﻎ'=>'ﻎ','ﻏ'=>'ﻏ','ﻐ'=>'ﻐ','ﻑ'=>'ﻑ','ﻒ'=>'ﻒ','ﻓ'=>'ﻓ','ﻔ'=>'ﻔ','ﻕ'=>'ﻕ','ﻖ'=>'ﻖ','ﻗ'=>'ﻗ','ﻘ'=>'ﻘ','ﻙ'=>'ﻙ','ﻚ'=>'ﻚ','ﻛ'=>'ﻛ','ﻜ'=>'ﻜ','ﻝ'=>'ﻝ','ﻞ'=>'ﻞ','ﻟ'=>'ﻟ','ﻠ'=>'ﻠ','ﻡ'=>'ﻡ','ﻢ'=>'ﻢ','ﻣ'=>'ﻣ','ﻤ'=>'ﻤ','ﻥ'=>'ﻥ','ﻦ'=>'ﻦ','ﻧ'=>'ﻧ','ﻨ'=>'ﻨ','ﻩ'=>'ﻩ','ﻪ'=>'ﻪ','ﻫ'=>'ﻫ','ﻬ'=>'ﻬ','ﻭ'=>'ﻭ','ﻮ'=>'ﻮ','ﻯ'=>'ﻯ','ﻰ'=>'ﻰ','ﻱ'=>'ﻱ','ﻲ'=>'ﻲ','ﻳ'=>'ﻳ','ﻴ'=>'ﻴ','ﻵ'=>'ﻵ','ﻶ'=>'ﻶ','ﻷ'=>'ﻷ','ﻸ'=>'ﻸ','ﻹ'=>'ﻹ','ﻺ'=>'ﻺ','ﻻ'=>'ﻻ','ﻼ'=>'ﻼ','0'=>'0','1'=>'1','2'=>'2','3'=>'3','4'=>'4','5'=>'5','6'=>'6','7'=>'7','8'=>'8','9'=>'9','A'=>'a','B'=>'b','C'=>'c','D'=>'d','E'=>'e','F'=>'f','G'=>'g','H'=>'h','I'=>'i','J'=>'j','K'=>'k','L'=>'l','M'=>'m','N'=>'n','O'=>'o','P'=>'p','Q'=>'q','R'=>'r','S'=>'s','T'=>'t','U'=>'u','V'=>'v','W'=>'w','X'=>'x','Y'=>'y','Z'=>'z','a'=>'a','b'=>'b','c'=>'c','d'=>'d','e'=>'e','f'=>'f','g'=>'g','h'=>'h','i'=>'i','j'=>'j','k'=>'k','l'=>'l','m'=>'m','n'=>'n','o'=>'o','p'=>'p','q'=>'q','r'=>'r','s'=>'s','t'=>'t','u'=>'u','v'=>'v','w'=>'w','x'=>'x','y'=>'y','z'=>'z','ヲ'=>'ヲ','ァ'=>'ァ','ィ'=>'ィ','ゥ'=>'ゥ','ェ'=>'ェ','ォ'=>'ォ','ャ'=>'ャ','ュ'=>'ュ','ョ'=>'ョ','ッ'=>'ッ','ー'=>'ー','ア'=>'ア','イ'=>'イ','ウ'=>'ウ','エ'=>'エ','オ'=>'オ','カ'=>'カ','キ'=>'キ','ク'=>'ク','ケ'=>'ケ','コ'=>'コ','サ'=>'サ','シ'=>'シ','ス'=>'ス','セ'=>'セ','ソ'=>'ソ','タ'=>'タ','チ'=>'チ','ツ'=>'ツ','テ'=>'テ','ト'=>'ト','ナ'=>'ナ','ニ'=>'ニ','ヌ'=>'ヌ','ネ'=>'ネ','ノ'=>'ノ','ハ'=>'ハ','ヒ'=>'ヒ','フ'=>'フ','ヘ'=>'ヘ','ホ'=>'ホ','マ'=>'マ','ミ'=>'ミ','ム'=>'ム','メ'=>'メ','モ'=>'モ','ヤ'=>'ヤ','ユ'=>'ユ','ヨ'=>'ヨ','ラ'=>'ラ','リ'=>'リ','ル'=>'ル','レ'=>'レ','ロ'=>'ロ','ワ'=>'ワ','ン'=>'ン','゙'=>'゙','゚'=>'゚','ᅠ'=>'ᅠ','ᄀ'=>'ᄀ','ᄁ'=>'ᄁ','ᆪ'=>'ᆪ','ᄂ'=>'ᄂ','ᆬ'=>'ᆬ','ᆭ'=>'ᆭ','ᄃ'=>'ᄃ','ᄄ'=>'ᄄ','ᄅ'=>'ᄅ','ᆰ'=>'ᆰ','ᆱ'=>'ᆱ','ᆲ'=>'ᆲ','ᆳ'=>'ᆳ','ᆴ'=>'ᆴ','ᆵ'=>'ᆵ','ᄚ'=>'ᄚ','ᄆ'=>'ᄆ','ᄇ'=>'ᄇ','ᄈ'=>'ᄈ','ᄡ'=>'ᄡ','ᄉ'=>'ᄉ','ᄊ'=>'ᄊ','ᄋ'=>'ᄋ','ᄌ'=>'ᄌ','ᄍ'=>'ᄍ','ᄎ'=>'ᄎ','ᄏ'=>'ᄏ','ᄐ'=>'ᄐ','ᄑ'=>'ᄑ','ᄒ'=>'ᄒ','ᅡ'=>'ᅡ','ᅢ'=>'ᅢ','ᅣ'=>'ᅣ','ᅤ'=>'ᅤ','ᅥ'=>'ᅥ','ᅦ'=>'ᅦ','ᅧ'=>'ᅧ','ᅨ'=>'ᅨ','ᅩ'=>'ᅩ','ᅪ'=>'ᅪ','ᅫ'=>'ᅫ','ᅬ'=>'ᅬ','ᅭ'=>'ᅭ','ᅮ'=>'ᅮ','ᅯ'=>'ᅯ','ᅰ'=>'ᅰ','ᅱ'=>'ᅱ','ᅲ'=>'ᅲ','ᅳ'=>'ᅳ','ᅴ'=>'ᅴ','ᅵ'=>'ᅵ');
diff --git a/phpBB/includes/utf/data/search_indexer_32.php b/phpBB/includes/utf/data/search_indexer_32.php
index 73ed2924ab..cea5ebad6a 100644
--- a/phpBB/includes/utf/data/search_indexer_32.php
+++ b/phpBB/includes/utf/data/search_indexer_32.php
@@ -1 +1 @@
-<?php return array('𐀀'=>'𐀀','𐀁'=>'𐀁','𐀂'=>'𐀂','𐀃'=>'𐀃','𐀄'=>'𐀄','𐀅'=>'𐀅','𐀆'=>'𐀆','𐀇'=>'𐀇','𐀈'=>'𐀈','𐀉'=>'𐀉','𐀊'=>'𐀊','𐀋'=>'𐀋','𐀍'=>'𐀍','𐀎'=>'𐀎','𐀏'=>'𐀏','𐀐'=>'𐀐','𐀑'=>'𐀑','𐀒'=>'𐀒','𐀓'=>'𐀓','𐀔'=>'𐀔','𐀕'=>'𐀕','𐀖'=>'𐀖','𐀗'=>'𐀗','𐀘'=>'𐀘','𐀙'=>'𐀙','𐀚'=>'𐀚','𐀛'=>'𐀛','𐀜'=>'𐀜','𐀝'=>'𐀝','𐀞'=>'𐀞','𐀟'=>'𐀟','𐀠'=>'𐀠','𐀡'=>'𐀡','𐀢'=>'𐀢','𐀣'=>'𐀣','𐀤'=>'𐀤','𐀥'=>'𐀥','𐀦'=>'𐀦','𐀨'=>'𐀨','𐀩'=>'𐀩','𐀪'=>'𐀪','𐀫'=>'𐀫','𐀬'=>'𐀬','𐀭'=>'𐀭','𐀮'=>'𐀮','𐀯'=>'𐀯','𐀰'=>'𐀰','𐀱'=>'𐀱','𐀲'=>'𐀲','𐀳'=>'𐀳','𐀴'=>'𐀴','𐀵'=>'𐀵','𐀶'=>'𐀶','𐀷'=>'𐀷','𐀸'=>'𐀸','𐀹'=>'𐀹','𐀺'=>'𐀺','𐀼'=>'𐀼','𐀽'=>'𐀽','𐀿'=>'𐀿','𐁀'=>'𐁀','𐁁'=>'𐁁','𐁂'=>'𐁂','𐁃'=>'𐁃','𐁄'=>'𐁄','𐁅'=>'𐁅','𐁆'=>'𐁆','𐁇'=>'𐁇','𐁈'=>'𐁈','𐁉'=>'𐁉','𐁊'=>'𐁊','𐁋'=>'𐁋','𐁌'=>'𐁌','𐁍'=>'𐁍','𐁐'=>'𐁐','𐁑'=>'𐁑','𐁒'=>'𐁒','𐁓'=>'𐁓','𐁔'=>'𐁔','𐁕'=>'𐁕','𐁖'=>'𐁖','𐁗'=>'𐁗','𐁘'=>'𐁘','𐁙'=>'𐁙','𐁚'=>'𐁚','𐁛'=>'𐁛','𐁜'=>'𐁜','𐁝'=>'𐁝','𐂀'=>'𐂀','𐂁'=>'𐂁','𐂂'=>'𐂂','𐂃'=>'𐂃','𐂄'=>'𐂄','𐂅'=>'𐂅','𐂆'=>'𐂆','𐂇'=>'𐂇','𐂈'=>'𐂈','𐂉'=>'𐂉','𐂊'=>'𐂊','𐂋'=>'𐂋','𐂌'=>'𐂌','𐂍'=>'𐂍','𐂎'=>'𐂎','𐂏'=>'𐂏','𐂐'=>'𐂐','𐂑'=>'𐂑','𐂒'=>'𐂒','𐂓'=>'𐂓','𐂔'=>'𐂔','𐂕'=>'𐂕','𐂖'=>'𐂖','𐂗'=>'𐂗','𐂘'=>'𐂘','𐂙'=>'𐂙','𐂚'=>'𐂚','𐂛'=>'𐂛','𐂜'=>'𐂜','𐂝'=>'𐂝','𐂞'=>'𐂞','𐂟'=>'𐂟','𐂠'=>'𐂠','𐂡'=>'𐂡','𐂢'=>'𐂢','𐂣'=>'𐂣','𐂤'=>'𐂤','𐂥'=>'𐂥','𐂦'=>'𐂦','𐂧'=>'𐂧','𐂨'=>'𐂨','𐂩'=>'𐂩','𐂪'=>'𐂪','𐂫'=>'𐂫','𐂬'=>'𐂬','𐂭'=>'𐂭','𐂮'=>'𐂮','𐂯'=>'𐂯','𐂰'=>'𐂰','𐂱'=>'𐂱','𐂲'=>'𐂲','𐂳'=>'𐂳','𐂴'=>'𐂴','𐂵'=>'𐂵','𐂶'=>'𐂶','𐂷'=>'𐂷','𐂸'=>'𐂸','𐂹'=>'𐂹','𐂺'=>'𐂺','𐂻'=>'𐂻','𐂼'=>'𐂼','𐂽'=>'𐂽','𐂾'=>'𐂾','𐂿'=>'𐂿','𐃀'=>'𐃀','𐃁'=>'𐃁','𐃂'=>'𐃂','𐃃'=>'𐃃','𐃄'=>'𐃄','𐃅'=>'𐃅','𐃆'=>'𐃆','𐃇'=>'𐃇','𐃈'=>'𐃈','𐃉'=>'𐃉','𐃊'=>'𐃊','𐃋'=>'𐃋','𐃌'=>'𐃌','𐃍'=>'𐃍','𐃎'=>'𐃎','𐃏'=>'𐃏','𐃐'=>'𐃐','𐃑'=>'𐃑','𐃒'=>'𐃒','𐃓'=>'𐃓','𐃔'=>'𐃔','𐃕'=>'𐃕','𐃖'=>'𐃖','𐃗'=>'𐃗','𐃘'=>'𐃘','𐃙'=>'𐃙','𐃚'=>'𐃚','𐃛'=>'𐃛','𐃜'=>'𐃜','𐃝'=>'𐃝','𐃞'=>'𐃞','𐃟'=>'𐃟','𐃠'=>'𐃠','𐃡'=>'𐃡','𐃢'=>'𐃢','𐃣'=>'𐃣','𐃤'=>'𐃤','𐃥'=>'𐃥','𐃦'=>'𐃦','𐃧'=>'𐃧','𐃨'=>'𐃨','𐃩'=>'𐃩','𐃪'=>'𐃪','𐃫'=>'𐃫','𐃬'=>'𐃬','𐃭'=>'𐃭','𐃮'=>'𐃮','𐃯'=>'𐃯','𐃰'=>'𐃰','𐃱'=>'𐃱','𐃲'=>'𐃲','𐃳'=>'𐃳','𐃴'=>'𐃴','𐃵'=>'𐃵','𐃶'=>'𐃶','𐃷'=>'𐃷','𐃸'=>'𐃸','𐃹'=>'𐃹','𐃺'=>'𐃺','𐄇'=>'1','𐄈'=>'2','𐄉'=>'3','𐄊'=>'4','𐄋'=>'5','𐄌'=>'6','𐄍'=>'7','𐄎'=>'8','𐄏'=>'9','𐄐'=>'10','𐄑'=>'20','𐄒'=>'30','𐄓'=>'40','𐄔'=>'50','𐄕'=>'60','𐄖'=>'70','𐄗'=>'80','𐄘'=>'90','𐄙'=>'100','𐄚'=>'200','𐄛'=>'300','𐄜'=>'400','𐄝'=>'500','𐄞'=>'600','𐄟'=>'700','𐄠'=>'800','𐄡'=>'900','𐄢'=>'1000','𐄣'=>'2000','𐄤'=>'3000','𐄥'=>'4000','𐄦'=>'5000','𐄧'=>'6000','𐄨'=>'7000','𐄩'=>'8000','𐄪'=>'9000','𐄫'=>'10000','𐄬'=>'20000','𐄭'=>'30000','𐄮'=>'40000','𐄯'=>'50000','𐄰'=>'60000','𐄱'=>'70000','𐄲'=>'80000','𐄳'=>'90000','𐅀'=>'1/4','𐅁'=>'1/2','𐅂'=>'1','𐅃'=>'5','𐅄'=>'50','𐅅'=>'500','𐅆'=>'5000','𐅇'=>'50000','𐅈'=>'5','𐅉'=>'10','𐅊'=>'50','𐅋'=>'100','𐅌'=>'500','𐅍'=>'1000','𐅎'=>'5000','𐅏'=>'5','𐅐'=>'10','𐅑'=>'50','𐅒'=>'100','𐅓'=>'500','𐅔'=>'1000','𐅕'=>'10000','𐅖'=>'50000','𐅗'=>'10','𐅘'=>'1','𐅙'=>'1','𐅚'=>'1','𐅛'=>'2','𐅜'=>'2','𐅝'=>'2','𐅞'=>'2','𐅟'=>'5','𐅠'=>'10','𐅡'=>'10','𐅢'=>'10','𐅣'=>'10','𐅤'=>'10','𐅥'=>'30','𐅦'=>'50','𐅧'=>'50','𐅨'=>'50','𐅩'=>'50','𐅪'=>'100','𐅫'=>'300','𐅬'=>'500','𐅭'=>'500','𐅮'=>'500','𐅯'=>'500','𐅰'=>'500','𐅱'=>'1000','𐅲'=>'5000','𐅳'=>'5','𐅴'=>'50','𐅵'=>'1/2','𐅶'=>'1/2','𐅷'=>'2/3','𐅸'=>'3/4','𐆊'=>'0','𐌀'=>'𐌀','𐌁'=>'𐌁','𐌂'=>'𐌂','𐌃'=>'𐌃','𐌄'=>'𐌄','𐌅'=>'𐌅','𐌆'=>'𐌆','𐌇'=>'𐌇','𐌈'=>'𐌈','𐌉'=>'𐌉','𐌊'=>'𐌊','𐌋'=>'𐌋','𐌌'=>'𐌌','𐌍'=>'𐌍','𐌎'=>'𐌎','𐌏'=>'𐌏','𐌐'=>'𐌐','𐌑'=>'𐌑','𐌒'=>'𐌒','𐌓'=>'𐌓','𐌔'=>'𐌔','𐌕'=>'𐌕','𐌖'=>'𐌖','𐌗'=>'𐌗','𐌘'=>'𐌘','𐌙'=>'𐌙','𐌚'=>'𐌚','𐌛'=>'𐌛','𐌜'=>'𐌜','𐌝'=>'𐌝','𐌞'=>'𐌞','𐌠'=>'1','𐌡'=>'5','𐌢'=>'10','𐌣'=>'50','𐌰'=>'𐌰','𐌱'=>'𐌱','𐌲'=>'𐌲','𐌳'=>'𐌳','𐌴'=>'𐌴','𐌵'=>'𐌵','𐌶'=>'𐌶','𐌷'=>'𐌷','𐌸'=>'𐌸','𐌹'=>'𐌹','𐌺'=>'𐌺','𐌻'=>'𐌻','𐌼'=>'𐌼','𐌽'=>'𐌽','𐌾'=>'𐌾','𐌿'=>'𐌿','𐍀'=>'𐍀','𐍁'=>'90','𐍂'=>'𐍂','𐍃'=>'𐍃','𐍄'=>'𐍄','𐍅'=>'𐍅','𐍆'=>'𐍆','𐍇'=>'𐍇','𐍈'=>'𐍈','𐍉'=>'𐍉','𐍊'=>'900','𐎀'=>'𐎀','𐎁'=>'𐎁','𐎂'=>'𐎂','𐎃'=>'𐎃','𐎄'=>'𐎄','𐎅'=>'𐎅','𐎆'=>'𐎆','𐎇'=>'𐎇','𐎈'=>'𐎈','𐎉'=>'𐎉','𐎊'=>'𐎊','𐎋'=>'𐎋','𐎌'=>'𐎌','𐎍'=>'𐎍','𐎎'=>'𐎎','𐎏'=>'𐎏','𐎐'=>'𐎐','𐎑'=>'𐎑','𐎒'=>'𐎒','𐎓'=>'𐎓','𐎔'=>'𐎔','𐎕'=>'𐎕','𐎖'=>'𐎖','𐎗'=>'𐎗','𐎘'=>'𐎘','𐎙'=>'𐎙','𐎚'=>'𐎚','𐎛'=>'𐎛','𐎜'=>'𐎜','𐎝'=>'𐎝','𐎠'=>'𐎠','𐎡'=>'𐎡','𐎢'=>'𐎢','𐎣'=>'𐎣','𐎤'=>'𐎤','𐎥'=>'𐎥','𐎦'=>'𐎦','𐎧'=>'𐎧','𐎨'=>'𐎨','𐎩'=>'𐎩','𐎪'=>'𐎪','𐎫'=>'𐎫','𐎬'=>'𐎬','𐎭'=>'𐎭','𐎮'=>'𐎮','𐎯'=>'𐎯','𐎰'=>'𐎰','𐎱'=>'𐎱','𐎲'=>'𐎲','𐎳'=>'𐎳','𐎴'=>'𐎴','𐎵'=>'𐎵','𐎶'=>'𐎶','𐎷'=>'𐎷','𐎸'=>'𐎸','𐎹'=>'𐎹','𐎺'=>'𐎺','𐎻'=>'𐎻','𐎼'=>'𐎼','𐎽'=>'𐎽','𐎾'=>'𐎾','𐎿'=>'𐎿','𐏀'=>'𐏀','𐏁'=>'𐏁','𐏂'=>'𐏂','𐏃'=>'𐏃','𐏈'=>'𐏈','𐏉'=>'𐏉','𐏊'=>'𐏊','𐏋'=>'𐏋','𐏌'=>'𐏌','𐏍'=>'𐏍','𐏎'=>'𐏎','𐏏'=>'𐏏','𐏑'=>'1','𐏒'=>'2','𐏓'=>'10','𐏔'=>'20','𐏕'=>'100','𐐀'=>'𐐨','𐐁'=>'𐐩','𐐂'=>'𐐪','𐐃'=>'𐐫','𐐄'=>'𐐬','𐐅'=>'𐐭','𐐆'=>'𐐮','𐐇'=>'𐐯','𐐈'=>'𐐰','𐐉'=>'𐐱','𐐊'=>'𐐲','𐐋'=>'𐐳','𐐌'=>'𐐴','𐐍'=>'𐐵','𐐎'=>'𐐶','𐐏'=>'𐐷','𐐐'=>'𐐸','𐐑'=>'𐐹','𐐒'=>'𐐺','𐐓'=>'𐐻','𐐔'=>'𐐼','𐐕'=>'𐐽','𐐖'=>'𐐾','𐐗'=>'𐐿','𐐘'=>'𐑀','𐐙'=>'𐑁','𐐚'=>'𐑂','𐐛'=>'𐑃','𐐜'=>'𐑄','𐐝'=>'𐑅','𐐞'=>'𐑆','𐐟'=>'𐑇','𐐠'=>'𐑈','𐐡'=>'𐑉','𐐢'=>'𐑊','𐐣'=>'𐑋','𐐤'=>'𐑌','𐐥'=>'𐑍','𐐦'=>'𐑎','𐐧'=>'𐑏','𐐨'=>'𐐨','𐐩'=>'𐐩','𐐪'=>'𐐪','𐐫'=>'𐐫','𐐬'=>'𐐬','𐐭'=>'𐐭','𐐮'=>'𐐮','𐐯'=>'𐐯','𐐰'=>'𐐰','𐐱'=>'𐐱','𐐲'=>'𐐲','𐐳'=>'𐐳','𐐴'=>'𐐴','𐐵'=>'𐐵','𐐶'=>'𐐶','𐐷'=>'𐐷','𐐸'=>'𐐸','𐐹'=>'𐐹','𐐺'=>'𐐺','𐐻'=>'𐐻','𐐼'=>'𐐼','𐐽'=>'𐐽','𐐾'=>'𐐾','𐐿'=>'𐐿','𐑀'=>'𐑀','𐑁'=>'𐑁','𐑂'=>'𐑂','𐑃'=>'𐑃','𐑄'=>'𐑄','𐑅'=>'𐑅','𐑆'=>'𐑆','𐑇'=>'𐑇','𐑈'=>'𐑈','𐑉'=>'𐑉','𐑊'=>'𐑊','𐑋'=>'𐑋','𐑌'=>'𐑌','𐑍'=>'𐑍','𐑎'=>'𐑎','𐑏'=>'𐑏','𐑐'=>'𐑐','𐑑'=>'𐑑','𐑒'=>'𐑒','𐑓'=>'𐑓','𐑔'=>'𐑔','𐑕'=>'𐑕','𐑖'=>'𐑖','𐑗'=>'𐑗','𐑘'=>'𐑘','𐑙'=>'𐑙','𐑚'=>'𐑚','𐑛'=>'𐑛','𐑜'=>'𐑜','𐑝'=>'𐑝','𐑞'=>'𐑞','𐑟'=>'𐑟','𐑠'=>'𐑠','𐑡'=>'𐑡','𐑢'=>'𐑢','𐑣'=>'𐑣','𐑤'=>'𐑤','𐑥'=>'𐑥','𐑦'=>'𐑦','𐑧'=>'𐑧','𐑨'=>'𐑨','𐑩'=>'𐑩','𐑪'=>'𐑪','𐑫'=>'𐑫','𐑬'=>'𐑬','𐑭'=>'𐑭','𐑮'=>'𐑮','𐑯'=>'𐑯','𐑰'=>'𐑰','𐑱'=>'𐑱','𐑲'=>'𐑲','𐑳'=>'𐑳','𐑴'=>'𐑴','𐑵'=>'𐑵','𐑶'=>'𐑶','𐑷'=>'𐑷','𐑸'=>'𐑸','𐑹'=>'𐑹','𐑺'=>'𐑺','𐑻'=>'𐑻','𐑼'=>'𐑼','𐑽'=>'𐑽','𐑾'=>'𐑾','𐑿'=>'𐑿','𐒀'=>'𐒀','𐒁'=>'𐒁','𐒂'=>'𐒂','𐒃'=>'𐒃','𐒄'=>'𐒄','𐒅'=>'𐒅','𐒆'=>'𐒆','𐒇'=>'𐒇','𐒈'=>'𐒈','𐒉'=>'𐒉','𐒊'=>'𐒊','𐒋'=>'𐒋','𐒌'=>'𐒌','𐒍'=>'𐒍','𐒎'=>'𐒎','𐒏'=>'𐒏','𐒐'=>'𐒐','𐒑'=>'𐒑','𐒒'=>'𐒒','𐒓'=>'𐒓','𐒔'=>'𐒔','𐒕'=>'𐒕','𐒖'=>'𐒖','𐒗'=>'𐒗','𐒘'=>'𐒘','𐒙'=>'𐒙','𐒚'=>'𐒚','𐒛'=>'𐒛','𐒜'=>'𐒜','𐒝'=>'𐒝','𐒠'=>'0','𐒡'=>'1','𐒢'=>'2','𐒣'=>'3','𐒤'=>'4','𐒥'=>'5','𐒦'=>'6','𐒧'=>'7','𐒨'=>'8','𐒩'=>'9'); \ No newline at end of file
+<?php return array('𐀀'=>'𐀀','𐀁'=>'𐀁','𐀂'=>'𐀂','𐀃'=>'𐀃','𐀄'=>'𐀄','𐀅'=>'𐀅','𐀆'=>'𐀆','𐀇'=>'𐀇','𐀈'=>'𐀈','𐀉'=>'𐀉','𐀊'=>'𐀊','𐀋'=>'𐀋','𐀍'=>'𐀍','𐀎'=>'𐀎','𐀏'=>'𐀏','𐀐'=>'𐀐','𐀑'=>'𐀑','𐀒'=>'𐀒','𐀓'=>'𐀓','𐀔'=>'𐀔','𐀕'=>'𐀕','𐀖'=>'𐀖','𐀗'=>'𐀗','𐀘'=>'𐀘','𐀙'=>'𐀙','𐀚'=>'𐀚','𐀛'=>'𐀛','𐀜'=>'𐀜','𐀝'=>'𐀝','𐀞'=>'𐀞','𐀟'=>'𐀟','𐀠'=>'𐀠','𐀡'=>'𐀡','𐀢'=>'𐀢','𐀣'=>'𐀣','𐀤'=>'𐀤','𐀥'=>'𐀥','𐀦'=>'𐀦','𐀨'=>'𐀨','𐀩'=>'𐀩','𐀪'=>'𐀪','𐀫'=>'𐀫','𐀬'=>'𐀬','𐀭'=>'𐀭','𐀮'=>'𐀮','𐀯'=>'𐀯','𐀰'=>'𐀰','𐀱'=>'𐀱','𐀲'=>'𐀲','𐀳'=>'𐀳','𐀴'=>'𐀴','𐀵'=>'𐀵','𐀶'=>'𐀶','𐀷'=>'𐀷','𐀸'=>'𐀸','𐀹'=>'𐀹','𐀺'=>'𐀺','𐀼'=>'𐀼','𐀽'=>'𐀽','𐀿'=>'𐀿','𐁀'=>'𐁀','𐁁'=>'𐁁','𐁂'=>'𐁂','𐁃'=>'𐁃','𐁄'=>'𐁄','𐁅'=>'𐁅','𐁆'=>'𐁆','𐁇'=>'𐁇','𐁈'=>'𐁈','𐁉'=>'𐁉','𐁊'=>'𐁊','𐁋'=>'𐁋','𐁌'=>'𐁌','𐁍'=>'𐁍','𐁐'=>'𐁐','𐁑'=>'𐁑','𐁒'=>'𐁒','𐁓'=>'𐁓','𐁔'=>'𐁔','𐁕'=>'𐁕','𐁖'=>'𐁖','𐁗'=>'𐁗','𐁘'=>'𐁘','𐁙'=>'𐁙','𐁚'=>'𐁚','𐁛'=>'𐁛','𐁜'=>'𐁜','𐁝'=>'𐁝','𐂀'=>'𐂀','𐂁'=>'𐂁','𐂂'=>'𐂂','𐂃'=>'𐂃','𐂄'=>'𐂄','𐂅'=>'𐂅','𐂆'=>'𐂆','𐂇'=>'𐂇','𐂈'=>'𐂈','𐂉'=>'𐂉','𐂊'=>'𐂊','𐂋'=>'𐂋','𐂌'=>'𐂌','𐂍'=>'𐂍','𐂎'=>'𐂎','𐂏'=>'𐂏','𐂐'=>'𐂐','𐂑'=>'𐂑','𐂒'=>'𐂒','𐂓'=>'𐂓','𐂔'=>'𐂔','𐂕'=>'𐂕','𐂖'=>'𐂖','𐂗'=>'𐂗','𐂘'=>'𐂘','𐂙'=>'𐂙','𐂚'=>'𐂚','𐂛'=>'𐂛','𐂜'=>'𐂜','𐂝'=>'𐂝','𐂞'=>'𐂞','𐂟'=>'𐂟','𐂠'=>'𐂠','𐂡'=>'𐂡','𐂢'=>'𐂢','𐂣'=>'𐂣','𐂤'=>'𐂤','𐂥'=>'𐂥','𐂦'=>'𐂦','𐂧'=>'𐂧','𐂨'=>'𐂨','𐂩'=>'𐂩','𐂪'=>'𐂪','𐂫'=>'𐂫','𐂬'=>'𐂬','𐂭'=>'𐂭','𐂮'=>'𐂮','𐂯'=>'𐂯','𐂰'=>'𐂰','𐂱'=>'𐂱','𐂲'=>'𐂲','𐂳'=>'𐂳','𐂴'=>'𐂴','𐂵'=>'𐂵','𐂶'=>'𐂶','𐂷'=>'𐂷','𐂸'=>'𐂸','𐂹'=>'𐂹','𐂺'=>'𐂺','𐂻'=>'𐂻','𐂼'=>'𐂼','𐂽'=>'𐂽','𐂾'=>'𐂾','𐂿'=>'𐂿','𐃀'=>'𐃀','𐃁'=>'𐃁','𐃂'=>'𐃂','𐃃'=>'𐃃','𐃄'=>'𐃄','𐃅'=>'𐃅','𐃆'=>'𐃆','𐃇'=>'𐃇','𐃈'=>'𐃈','𐃉'=>'𐃉','𐃊'=>'𐃊','𐃋'=>'𐃋','𐃌'=>'𐃌','𐃍'=>'𐃍','𐃎'=>'𐃎','𐃏'=>'𐃏','𐃐'=>'𐃐','𐃑'=>'𐃑','𐃒'=>'𐃒','𐃓'=>'𐃓','𐃔'=>'𐃔','𐃕'=>'𐃕','𐃖'=>'𐃖','𐃗'=>'𐃗','𐃘'=>'𐃘','𐃙'=>'𐃙','𐃚'=>'𐃚','𐃛'=>'𐃛','𐃜'=>'𐃜','𐃝'=>'𐃝','𐃞'=>'𐃞','𐃟'=>'𐃟','𐃠'=>'𐃠','𐃡'=>'𐃡','𐃢'=>'𐃢','𐃣'=>'𐃣','𐃤'=>'𐃤','𐃥'=>'𐃥','𐃦'=>'𐃦','𐃧'=>'𐃧','𐃨'=>'𐃨','𐃩'=>'𐃩','𐃪'=>'𐃪','𐃫'=>'𐃫','𐃬'=>'𐃬','𐃭'=>'𐃭','𐃮'=>'𐃮','𐃯'=>'𐃯','𐃰'=>'𐃰','𐃱'=>'𐃱','𐃲'=>'𐃲','𐃳'=>'𐃳','𐃴'=>'𐃴','𐃵'=>'𐃵','𐃶'=>'𐃶','𐃷'=>'𐃷','𐃸'=>'𐃸','𐃹'=>'𐃹','𐃺'=>'𐃺','𐄇'=>'1','𐄈'=>'2','𐄉'=>'3','𐄊'=>'4','𐄋'=>'5','𐄌'=>'6','𐄍'=>'7','𐄎'=>'8','𐄏'=>'9','𐄐'=>'10','𐄑'=>'20','𐄒'=>'30','𐄓'=>'40','𐄔'=>'50','𐄕'=>'60','𐄖'=>'70','𐄗'=>'80','𐄘'=>'90','𐄙'=>'100','𐄚'=>'200','𐄛'=>'300','𐄜'=>'400','𐄝'=>'500','𐄞'=>'600','𐄟'=>'700','𐄠'=>'800','𐄡'=>'900','𐄢'=>'1000','𐄣'=>'2000','𐄤'=>'3000','𐄥'=>'4000','𐄦'=>'5000','𐄧'=>'6000','𐄨'=>'7000','𐄩'=>'8000','𐄪'=>'9000','𐄫'=>'10000','𐄬'=>'20000','𐄭'=>'30000','𐄮'=>'40000','𐄯'=>'50000','𐄰'=>'60000','𐄱'=>'70000','𐄲'=>'80000','𐄳'=>'90000','𐅀'=>'1/4','𐅁'=>'1/2','𐅂'=>'1','𐅃'=>'5','𐅄'=>'50','𐅅'=>'500','𐅆'=>'5000','𐅇'=>'50000','𐅈'=>'5','𐅉'=>'10','𐅊'=>'50','𐅋'=>'100','𐅌'=>'500','𐅍'=>'1000','𐅎'=>'5000','𐅏'=>'5','𐅐'=>'10','𐅑'=>'50','𐅒'=>'100','𐅓'=>'500','𐅔'=>'1000','𐅕'=>'10000','𐅖'=>'50000','𐅗'=>'10','𐅘'=>'1','𐅙'=>'1','𐅚'=>'1','𐅛'=>'2','𐅜'=>'2','𐅝'=>'2','𐅞'=>'2','𐅟'=>'5','𐅠'=>'10','𐅡'=>'10','𐅢'=>'10','𐅣'=>'10','𐅤'=>'10','𐅥'=>'30','𐅦'=>'50','𐅧'=>'50','𐅨'=>'50','𐅩'=>'50','𐅪'=>'100','𐅫'=>'300','𐅬'=>'500','𐅭'=>'500','𐅮'=>'500','𐅯'=>'500','𐅰'=>'500','𐅱'=>'1000','𐅲'=>'5000','𐅳'=>'5','𐅴'=>'50','𐅵'=>'1/2','𐅶'=>'1/2','𐅷'=>'2/3','𐅸'=>'3/4','𐆊'=>'0','𐌀'=>'𐌀','𐌁'=>'𐌁','𐌂'=>'𐌂','𐌃'=>'𐌃','𐌄'=>'𐌄','𐌅'=>'𐌅','𐌆'=>'𐌆','𐌇'=>'𐌇','𐌈'=>'𐌈','𐌉'=>'𐌉','𐌊'=>'𐌊','𐌋'=>'𐌋','𐌌'=>'𐌌','𐌍'=>'𐌍','𐌎'=>'𐌎','𐌏'=>'𐌏','𐌐'=>'𐌐','𐌑'=>'𐌑','𐌒'=>'𐌒','𐌓'=>'𐌓','𐌔'=>'𐌔','𐌕'=>'𐌕','𐌖'=>'𐌖','𐌗'=>'𐌗','𐌘'=>'𐌘','𐌙'=>'𐌙','𐌚'=>'𐌚','𐌛'=>'𐌛','𐌜'=>'𐌜','𐌝'=>'𐌝','𐌞'=>'𐌞','𐌠'=>'1','𐌡'=>'5','𐌢'=>'10','𐌣'=>'50','𐌰'=>'𐌰','𐌱'=>'𐌱','𐌲'=>'𐌲','𐌳'=>'𐌳','𐌴'=>'𐌴','𐌵'=>'𐌵','𐌶'=>'𐌶','𐌷'=>'𐌷','𐌸'=>'𐌸','𐌹'=>'𐌹','𐌺'=>'𐌺','𐌻'=>'𐌻','𐌼'=>'𐌼','𐌽'=>'𐌽','𐌾'=>'𐌾','𐌿'=>'𐌿','𐍀'=>'𐍀','𐍁'=>'90','𐍂'=>'𐍂','𐍃'=>'𐍃','𐍄'=>'𐍄','𐍅'=>'𐍅','𐍆'=>'𐍆','𐍇'=>'𐍇','𐍈'=>'𐍈','𐍉'=>'𐍉','𐍊'=>'900','𐎀'=>'𐎀','𐎁'=>'𐎁','𐎂'=>'𐎂','𐎃'=>'𐎃','𐎄'=>'𐎄','𐎅'=>'𐎅','𐎆'=>'𐎆','𐎇'=>'𐎇','𐎈'=>'𐎈','𐎉'=>'𐎉','𐎊'=>'𐎊','𐎋'=>'𐎋','𐎌'=>'𐎌','𐎍'=>'𐎍','𐎎'=>'𐎎','𐎏'=>'𐎏','𐎐'=>'𐎐','𐎑'=>'𐎑','𐎒'=>'𐎒','𐎓'=>'𐎓','𐎔'=>'𐎔','𐎕'=>'𐎕','𐎖'=>'𐎖','𐎗'=>'𐎗','𐎘'=>'𐎘','𐎙'=>'𐎙','𐎚'=>'𐎚','𐎛'=>'𐎛','𐎜'=>'𐎜','𐎝'=>'𐎝','𐎠'=>'𐎠','𐎡'=>'𐎡','𐎢'=>'𐎢','𐎣'=>'𐎣','𐎤'=>'𐎤','𐎥'=>'𐎥','𐎦'=>'𐎦','𐎧'=>'𐎧','𐎨'=>'𐎨','𐎩'=>'𐎩','𐎪'=>'𐎪','𐎫'=>'𐎫','𐎬'=>'𐎬','𐎭'=>'𐎭','𐎮'=>'𐎮','𐎯'=>'𐎯','𐎰'=>'𐎰','𐎱'=>'𐎱','𐎲'=>'𐎲','𐎳'=>'𐎳','𐎴'=>'𐎴','𐎵'=>'𐎵','𐎶'=>'𐎶','𐎷'=>'𐎷','𐎸'=>'𐎸','𐎹'=>'𐎹','𐎺'=>'𐎺','𐎻'=>'𐎻','𐎼'=>'𐎼','𐎽'=>'𐎽','𐎾'=>'𐎾','𐎿'=>'𐎿','𐏀'=>'𐏀','𐏁'=>'𐏁','𐏂'=>'𐏂','𐏃'=>'𐏃','𐏈'=>'𐏈','𐏉'=>'𐏉','𐏊'=>'𐏊','𐏋'=>'𐏋','𐏌'=>'𐏌','𐏍'=>'𐏍','𐏎'=>'𐏎','𐏏'=>'𐏏','𐏑'=>'1','𐏒'=>'2','𐏓'=>'10','𐏔'=>'20','𐏕'=>'100','𐐀'=>'𐐨','𐐁'=>'𐐩','𐐂'=>'𐐪','𐐃'=>'𐐫','𐐄'=>'𐐬','𐐅'=>'𐐭','𐐆'=>'𐐮','𐐇'=>'𐐯','𐐈'=>'𐐰','𐐉'=>'𐐱','𐐊'=>'𐐲','𐐋'=>'𐐳','𐐌'=>'𐐴','𐐍'=>'𐐵','𐐎'=>'𐐶','𐐏'=>'𐐷','𐐐'=>'𐐸','𐐑'=>'𐐹','𐐒'=>'𐐺','𐐓'=>'𐐻','𐐔'=>'𐐼','𐐕'=>'𐐽','𐐖'=>'𐐾','𐐗'=>'𐐿','𐐘'=>'𐑀','𐐙'=>'𐑁','𐐚'=>'𐑂','𐐛'=>'𐑃','𐐜'=>'𐑄','𐐝'=>'𐑅','𐐞'=>'𐑆','𐐟'=>'𐑇','𐐠'=>'𐑈','𐐡'=>'𐑉','𐐢'=>'𐑊','𐐣'=>'𐑋','𐐤'=>'𐑌','𐐥'=>'𐑍','𐐦'=>'𐑎','𐐧'=>'𐑏','𐐨'=>'𐐨','𐐩'=>'𐐩','𐐪'=>'𐐪','𐐫'=>'𐐫','𐐬'=>'𐐬','𐐭'=>'𐐭','𐐮'=>'𐐮','𐐯'=>'𐐯','𐐰'=>'𐐰','𐐱'=>'𐐱','𐐲'=>'𐐲','𐐳'=>'𐐳','𐐴'=>'𐐴','𐐵'=>'𐐵','𐐶'=>'𐐶','𐐷'=>'𐐷','𐐸'=>'𐐸','𐐹'=>'𐐹','𐐺'=>'𐐺','𐐻'=>'𐐻','𐐼'=>'𐐼','𐐽'=>'𐐽','𐐾'=>'𐐾','𐐿'=>'𐐿','𐑀'=>'𐑀','𐑁'=>'𐑁','𐑂'=>'𐑂','𐑃'=>'𐑃','𐑄'=>'𐑄','𐑅'=>'𐑅','𐑆'=>'𐑆','𐑇'=>'𐑇','𐑈'=>'𐑈','𐑉'=>'𐑉','𐑊'=>'𐑊','𐑋'=>'𐑋','𐑌'=>'𐑌','𐑍'=>'𐑍','𐑎'=>'𐑎','𐑏'=>'𐑏','𐑐'=>'𐑐','𐑑'=>'𐑑','𐑒'=>'𐑒','𐑓'=>'𐑓','𐑔'=>'𐑔','𐑕'=>'𐑕','𐑖'=>'𐑖','𐑗'=>'𐑗','𐑘'=>'𐑘','𐑙'=>'𐑙','𐑚'=>'𐑚','𐑛'=>'𐑛','𐑜'=>'𐑜','𐑝'=>'𐑝','𐑞'=>'𐑞','𐑟'=>'𐑟','𐑠'=>'𐑠','𐑡'=>'𐑡','𐑢'=>'𐑢','𐑣'=>'𐑣','𐑤'=>'𐑤','𐑥'=>'𐑥','𐑦'=>'𐑦','𐑧'=>'𐑧','𐑨'=>'𐑨','𐑩'=>'𐑩','𐑪'=>'𐑪','𐑫'=>'𐑫','𐑬'=>'𐑬','𐑭'=>'𐑭','𐑮'=>'𐑮','𐑯'=>'𐑯','𐑰'=>'𐑰','𐑱'=>'𐑱','𐑲'=>'𐑲','𐑳'=>'𐑳','𐑴'=>'𐑴','𐑵'=>'𐑵','𐑶'=>'𐑶','𐑷'=>'𐑷','𐑸'=>'𐑸','𐑹'=>'𐑹','𐑺'=>'𐑺','𐑻'=>'𐑻','𐑼'=>'𐑼','𐑽'=>'𐑽','𐑾'=>'𐑾','𐑿'=>'𐑿','𐒀'=>'𐒀','𐒁'=>'𐒁','𐒂'=>'𐒂','𐒃'=>'𐒃','𐒄'=>'𐒄','𐒅'=>'𐒅','𐒆'=>'𐒆','𐒇'=>'𐒇','𐒈'=>'𐒈','𐒉'=>'𐒉','𐒊'=>'𐒊','𐒋'=>'𐒋','𐒌'=>'𐒌','𐒍'=>'𐒍','𐒎'=>'𐒎','𐒏'=>'𐒏','𐒐'=>'𐒐','𐒑'=>'𐒑','𐒒'=>'𐒒','𐒓'=>'𐒓','𐒔'=>'𐒔','𐒕'=>'𐒕','𐒖'=>'𐒖','𐒗'=>'𐒗','𐒘'=>'𐒘','𐒙'=>'𐒙','𐒚'=>'𐒚','𐒛'=>'𐒛','𐒜'=>'𐒜','𐒝'=>'𐒝','𐒠'=>'0','𐒡'=>'1','𐒢'=>'2','𐒣'=>'3','𐒤'=>'4','𐒥'=>'5','𐒦'=>'6','𐒧'=>'7','𐒨'=>'8','𐒩'=>'9');
diff --git a/phpBB/includes/utf/data/search_indexer_33.php b/phpBB/includes/utf/data/search_indexer_33.php
index 4e8762a646..3b77ca26f7 100644
--- a/phpBB/includes/utf/data/search_indexer_33.php
+++ b/phpBB/includes/utf/data/search_indexer_33.php
@@ -1 +1 @@
-<?php return array('𐠀'=>'𐠀','𐠁'=>'𐠁','𐠂'=>'𐠂','𐠃'=>'𐠃','𐠄'=>'𐠄','𐠅'=>'𐠅','𐠈'=>'𐠈','𐠊'=>'𐠊','𐠋'=>'𐠋','𐠌'=>'𐠌','𐠍'=>'𐠍','𐠎'=>'𐠎','𐠏'=>'𐠏','𐠐'=>'𐠐','𐠑'=>'𐠑','𐠒'=>'𐠒','𐠓'=>'𐠓','𐠔'=>'𐠔','𐠕'=>'𐠕','𐠖'=>'𐠖','𐠗'=>'𐠗','𐠘'=>'𐠘','𐠙'=>'𐠙','𐠚'=>'𐠚','𐠛'=>'𐠛','𐠜'=>'𐠜','𐠝'=>'𐠝','𐠞'=>'𐠞','𐠟'=>'𐠟','𐠠'=>'𐠠','𐠡'=>'𐠡','𐠢'=>'𐠢','𐠣'=>'𐠣','𐠤'=>'𐠤','𐠥'=>'𐠥','𐠦'=>'𐠦','𐠧'=>'𐠧','𐠨'=>'𐠨','𐠩'=>'𐠩','𐠪'=>'𐠪','𐠫'=>'𐠫','𐠬'=>'𐠬','𐠭'=>'𐠭','𐠮'=>'𐠮','𐠯'=>'𐠯','𐠰'=>'𐠰','𐠱'=>'𐠱','𐠲'=>'𐠲','𐠳'=>'𐠳','𐠴'=>'𐠴','𐠵'=>'𐠵','𐠷'=>'𐠷','𐠸'=>'𐠸','𐠼'=>'𐠼','𐠿'=>'𐠿','𐤀'=>'𐤀','𐤁'=>'𐤁','𐤂'=>'𐤂','𐤃'=>'𐤃','𐤄'=>'𐤄','𐤅'=>'𐤅','𐤆'=>'𐤆','𐤇'=>'𐤇','𐤈'=>'𐤈','𐤉'=>'𐤉','𐤊'=>'𐤊','𐤋'=>'𐤋','𐤌'=>'𐤌','𐤍'=>'𐤍','𐤎'=>'𐤎','𐤏'=>'𐤏','𐤐'=>'𐤐','𐤑'=>'𐤑','𐤒'=>'𐤒','𐤓'=>'𐤓','𐤔'=>'𐤔','𐤕'=>'𐤕','𐤖'=>'1','𐤗'=>'10','𐤘'=>'20','𐤙'=>'100','𐨀'=>'𐨀','𐨁'=>'𐨁','𐨂'=>'𐨂','𐨃'=>'𐨃','𐨅'=>'𐨅','𐨆'=>'𐨆','𐨌'=>'𐨌','𐨍'=>'𐨍','𐨎'=>'𐨎','𐨏'=>'𐨏','𐨐'=>'𐨐','𐨑'=>'𐨑','𐨒'=>'𐨒','𐨓'=>'𐨓','𐨕'=>'𐨕','𐨖'=>'𐨖','𐨗'=>'𐨗','𐨙'=>'𐨙','𐨚'=>'𐨚','𐨛'=>'𐨛','𐨜'=>'𐨜','𐨝'=>'𐨝','𐨞'=>'𐨞','𐨟'=>'𐨟','𐨠'=>'𐨠','𐨡'=>'𐨡','𐨢'=>'𐨢','𐨣'=>'𐨣','𐨤'=>'𐨤','𐨥'=>'𐨥','𐨦'=>'𐨦','𐨧'=>'𐨧','𐨨'=>'𐨨','𐨩'=>'𐨩','𐨪'=>'𐨪','𐨫'=>'𐨫','𐨬'=>'𐨬','𐨭'=>'𐨭','𐨮'=>'𐨮','𐨯'=>'𐨯','𐨰'=>'𐨰','𐨱'=>'𐨱','𐨲'=>'𐨲','𐨳'=>'𐨳','𐨸'=>'𐨸','𐨹'=>'𐨹','𐨺'=>'𐨺','𐨿'=>'𐨿','𐩀'=>'1','𐩁'=>'2','𐩂'=>'3','𐩃'=>'4','𐩄'=>'10','𐩅'=>'20','𐩆'=>'100','𐩇'=>'1000'); \ No newline at end of file
+<?php return array('𐠀'=>'𐠀','𐠁'=>'𐠁','𐠂'=>'𐠂','𐠃'=>'𐠃','𐠄'=>'𐠄','𐠅'=>'𐠅','𐠈'=>'𐠈','𐠊'=>'𐠊','𐠋'=>'𐠋','𐠌'=>'𐠌','𐠍'=>'𐠍','𐠎'=>'𐠎','𐠏'=>'𐠏','𐠐'=>'𐠐','𐠑'=>'𐠑','𐠒'=>'𐠒','𐠓'=>'𐠓','𐠔'=>'𐠔','𐠕'=>'𐠕','𐠖'=>'𐠖','𐠗'=>'𐠗','𐠘'=>'𐠘','𐠙'=>'𐠙','𐠚'=>'𐠚','𐠛'=>'𐠛','𐠜'=>'𐠜','𐠝'=>'𐠝','𐠞'=>'𐠞','𐠟'=>'𐠟','𐠠'=>'𐠠','𐠡'=>'𐠡','𐠢'=>'𐠢','𐠣'=>'𐠣','𐠤'=>'𐠤','𐠥'=>'𐠥','𐠦'=>'𐠦','𐠧'=>'𐠧','𐠨'=>'𐠨','𐠩'=>'𐠩','𐠪'=>'𐠪','𐠫'=>'𐠫','𐠬'=>'𐠬','𐠭'=>'𐠭','𐠮'=>'𐠮','𐠯'=>'𐠯','𐠰'=>'𐠰','𐠱'=>'𐠱','𐠲'=>'𐠲','𐠳'=>'𐠳','𐠴'=>'𐠴','𐠵'=>'𐠵','𐠷'=>'𐠷','𐠸'=>'𐠸','𐠼'=>'𐠼','𐠿'=>'𐠿','𐤀'=>'𐤀','𐤁'=>'𐤁','𐤂'=>'𐤂','𐤃'=>'𐤃','𐤄'=>'𐤄','𐤅'=>'𐤅','𐤆'=>'𐤆','𐤇'=>'𐤇','𐤈'=>'𐤈','𐤉'=>'𐤉','𐤊'=>'𐤊','𐤋'=>'𐤋','𐤌'=>'𐤌','𐤍'=>'𐤍','𐤎'=>'𐤎','𐤏'=>'𐤏','𐤐'=>'𐤐','𐤑'=>'𐤑','𐤒'=>'𐤒','𐤓'=>'𐤓','𐤔'=>'𐤔','𐤕'=>'𐤕','𐤖'=>'1','𐤗'=>'10','𐤘'=>'20','𐤙'=>'100','𐨀'=>'𐨀','𐨁'=>'𐨁','𐨂'=>'𐨂','𐨃'=>'𐨃','𐨅'=>'𐨅','𐨆'=>'𐨆','𐨌'=>'𐨌','𐨍'=>'𐨍','𐨎'=>'𐨎','𐨏'=>'𐨏','𐨐'=>'𐨐','𐨑'=>'𐨑','𐨒'=>'𐨒','𐨓'=>'𐨓','𐨕'=>'𐨕','𐨖'=>'𐨖','𐨗'=>'𐨗','𐨙'=>'𐨙','𐨚'=>'𐨚','𐨛'=>'𐨛','𐨜'=>'𐨜','𐨝'=>'𐨝','𐨞'=>'𐨞','𐨟'=>'𐨟','𐨠'=>'𐨠','𐨡'=>'𐨡','𐨢'=>'𐨢','𐨣'=>'𐨣','𐨤'=>'𐨤','𐨥'=>'𐨥','𐨦'=>'𐨦','𐨧'=>'𐨧','𐨨'=>'𐨨','𐨩'=>'𐨩','𐨪'=>'𐨪','𐨫'=>'𐨫','𐨬'=>'𐨬','𐨭'=>'𐨭','𐨮'=>'𐨮','𐨯'=>'𐨯','𐨰'=>'𐨰','𐨱'=>'𐨱','𐨲'=>'𐨲','𐨳'=>'𐨳','𐨸'=>'𐨸','𐨹'=>'𐨹','𐨺'=>'𐨺','𐨿'=>'𐨿','𐩀'=>'1','𐩁'=>'2','𐩂'=>'3','𐩃'=>'4','𐩄'=>'10','𐩅'=>'20','𐩆'=>'100','𐩇'=>'1000');
diff --git a/phpBB/includes/utf/data/search_indexer_36.php b/phpBB/includes/utf/data/search_indexer_36.php
index 8bf908e514..a970fa295b 100644
--- a/phpBB/includes/utf/data/search_indexer_36.php
+++ b/phpBB/includes/utf/data/search_indexer_36.php
@@ -1 +1 @@
-<?php return array('𒀀'=>'𒀀','𒀁'=>'𒀁','𒀂'=>'𒀂','𒀃'=>'𒀃','𒀄'=>'𒀄','𒀅'=>'𒀅','𒀆'=>'𒀆','𒀇'=>'𒀇','𒀈'=>'𒀈','𒀉'=>'𒀉','𒀊'=>'𒀊','𒀋'=>'𒀋','𒀌'=>'𒀌','𒀍'=>'𒀍','𒀎'=>'𒀎','𒀏'=>'𒀏','𒀐'=>'𒀐','𒀑'=>'𒀑','𒀒'=>'𒀒','𒀓'=>'𒀓','𒀔'=>'𒀔','𒀕'=>'𒀕','𒀖'=>'𒀖','𒀗'=>'𒀗','𒀘'=>'𒀘','𒀙'=>'𒀙','𒀚'=>'𒀚','𒀛'=>'𒀛','𒀜'=>'𒀜','𒀝'=>'𒀝','𒀞'=>'𒀞','𒀟'=>'𒀟','𒀠'=>'𒀠','𒀡'=>'𒀡','𒀢'=>'𒀢','𒀣'=>'𒀣','𒀤'=>'𒀤','𒀥'=>'𒀥','𒀦'=>'𒀦','𒀧'=>'𒀧','𒀨'=>'𒀨','𒀩'=>'𒀩','𒀪'=>'𒀪','𒀫'=>'𒀫','𒀬'=>'𒀬','𒀭'=>'𒀭','𒀮'=>'𒀮','𒀯'=>'𒀯','𒀰'=>'𒀰','𒀱'=>'𒀱','𒀲'=>'𒀲','𒀳'=>'𒀳','𒀴'=>'𒀴','𒀵'=>'𒀵','𒀶'=>'𒀶','𒀷'=>'𒀷','𒀸'=>'𒀸','𒀹'=>'𒀹','𒀺'=>'𒀺','𒀻'=>'𒀻','𒀼'=>'𒀼','𒀽'=>'𒀽','𒀾'=>'𒀾','𒀿'=>'𒀿','𒁀'=>'𒁀','𒁁'=>'𒁁','𒁂'=>'𒁂','𒁃'=>'𒁃','𒁄'=>'𒁄','𒁅'=>'𒁅','𒁆'=>'𒁆','𒁇'=>'𒁇','𒁈'=>'𒁈','𒁉'=>'𒁉','𒁊'=>'𒁊','𒁋'=>'𒁋','𒁌'=>'𒁌','𒁍'=>'𒁍','𒁎'=>'𒁎','𒁏'=>'𒁏','𒁐'=>'𒁐','𒁑'=>'𒁑','𒁒'=>'𒁒','𒁓'=>'𒁓','𒁔'=>'𒁔','𒁕'=>'𒁕','𒁖'=>'𒁖','𒁗'=>'𒁗','𒁘'=>'𒁘','𒁙'=>'𒁙','𒁚'=>'𒁚','𒁛'=>'𒁛','𒁜'=>'𒁜','𒁝'=>'𒁝','𒁞'=>'𒁞','𒁟'=>'𒁟','𒁠'=>'𒁠','𒁡'=>'𒁡','𒁢'=>'𒁢','𒁣'=>'𒁣','𒁤'=>'𒁤','𒁥'=>'𒁥','𒁦'=>'𒁦','𒁧'=>'𒁧','𒁨'=>'𒁨','𒁩'=>'𒁩','𒁪'=>'𒁪','𒁫'=>'𒁫','𒁬'=>'𒁬','𒁭'=>'𒁭','𒁮'=>'𒁮','𒁯'=>'𒁯','𒁰'=>'𒁰','𒁱'=>'𒁱','𒁲'=>'𒁲','𒁳'=>'𒁳','𒁴'=>'𒁴','𒁵'=>'𒁵','𒁶'=>'𒁶','𒁷'=>'𒁷','𒁸'=>'𒁸','𒁹'=>'𒁹','𒁺'=>'𒁺','𒁻'=>'𒁻','𒁼'=>'𒁼','𒁽'=>'𒁽','𒁾'=>'𒁾','𒁿'=>'𒁿','𒂀'=>'𒂀','𒂁'=>'𒂁','𒂂'=>'𒂂','𒂃'=>'𒂃','𒂄'=>'𒂄','𒂅'=>'𒂅','𒂆'=>'𒂆','𒂇'=>'𒂇','𒂈'=>'𒂈','𒂉'=>'𒂉','𒂊'=>'𒂊','𒂋'=>'𒂋','𒂌'=>'𒂌','𒂍'=>'𒂍','𒂎'=>'𒂎','𒂏'=>'𒂏','𒂐'=>'𒂐','𒂑'=>'𒂑','𒂒'=>'𒂒','𒂓'=>'𒂓','𒂔'=>'𒂔','𒂕'=>'𒂕','𒂖'=>'𒂖','𒂗'=>'𒂗','𒂘'=>'𒂘','𒂙'=>'𒂙','𒂚'=>'𒂚','𒂛'=>'𒂛','𒂜'=>'𒂜','𒂝'=>'𒂝','𒂞'=>'𒂞','𒂟'=>'𒂟','𒂠'=>'𒂠','𒂡'=>'𒂡','𒂢'=>'𒂢','𒂣'=>'𒂣','𒂤'=>'𒂤','𒂥'=>'𒂥','𒂦'=>'𒂦','𒂧'=>'𒂧','𒂨'=>'𒂨','𒂩'=>'𒂩','𒂪'=>'𒂪','𒂫'=>'𒂫','𒂬'=>'𒂬','𒂭'=>'𒂭','𒂮'=>'𒂮','𒂯'=>'𒂯','𒂰'=>'𒂰','𒂱'=>'𒂱','𒂲'=>'𒂲','𒂳'=>'𒂳','𒂴'=>'𒂴','𒂵'=>'𒂵','𒂶'=>'𒂶','𒂷'=>'𒂷','𒂸'=>'𒂸','𒂹'=>'𒂹','𒂺'=>'𒂺','𒂻'=>'𒂻','𒂼'=>'𒂼','𒂽'=>'𒂽','𒂾'=>'𒂾','𒂿'=>'𒂿','𒃀'=>'𒃀','𒃁'=>'𒃁','𒃂'=>'𒃂','𒃃'=>'𒃃','𒃄'=>'𒃄','𒃅'=>'𒃅','𒃆'=>'𒃆','𒃇'=>'𒃇','𒃈'=>'𒃈','𒃉'=>'𒃉','𒃊'=>'𒃊','𒃋'=>'𒃋','𒃌'=>'𒃌','𒃍'=>'𒃍','𒃎'=>'𒃎','𒃏'=>'𒃏','𒃐'=>'𒃐','𒃑'=>'𒃑','𒃒'=>'𒃒','𒃓'=>'𒃓','𒃔'=>'𒃔','𒃕'=>'𒃕','𒃖'=>'𒃖','𒃗'=>'𒃗','𒃘'=>'𒃘','𒃙'=>'𒃙','𒃚'=>'𒃚','𒃛'=>'𒃛','𒃜'=>'𒃜','𒃝'=>'𒃝','𒃞'=>'𒃞','𒃟'=>'𒃟','𒃠'=>'𒃠','𒃡'=>'𒃡','𒃢'=>'𒃢','𒃣'=>'𒃣','𒃤'=>'𒃤','𒃥'=>'𒃥','𒃦'=>'𒃦','𒃧'=>'𒃧','𒃨'=>'𒃨','𒃩'=>'𒃩','𒃪'=>'𒃪','𒃫'=>'𒃫','𒃬'=>'𒃬','𒃭'=>'𒃭','𒃮'=>'𒃮','𒃯'=>'𒃯','𒃰'=>'𒃰','𒃱'=>'𒃱','𒃲'=>'𒃲','𒃳'=>'𒃳','𒃴'=>'𒃴','𒃵'=>'𒃵','𒃶'=>'𒃶','𒃷'=>'𒃷','𒃸'=>'𒃸','𒃹'=>'𒃹','𒃺'=>'𒃺','𒃻'=>'𒃻','𒃼'=>'𒃼','𒃽'=>'𒃽','𒃾'=>'𒃾','𒃿'=>'𒃿','𒄀'=>'𒄀','𒄁'=>'𒄁','𒄂'=>'𒄂','𒄃'=>'𒄃','𒄄'=>'𒄄','𒄅'=>'𒄅','𒄆'=>'𒄆','𒄇'=>'𒄇','𒄈'=>'𒄈','𒄉'=>'𒄉','𒄊'=>'𒄊','𒄋'=>'𒄋','𒄌'=>'𒄌','𒄍'=>'𒄍','𒄎'=>'𒄎','𒄏'=>'𒄏','𒄐'=>'𒄐','𒄑'=>'𒄑','𒄒'=>'𒄒','𒄓'=>'𒄓','𒄔'=>'𒄔','𒄕'=>'𒄕','𒄖'=>'𒄖','𒄗'=>'𒄗','𒄘'=>'𒄘','𒄙'=>'𒄙','𒄚'=>'𒄚','𒄛'=>'𒄛','𒄜'=>'𒄜','𒄝'=>'𒄝','𒄞'=>'𒄞','𒄟'=>'𒄟','𒄠'=>'𒄠','𒄡'=>'𒄡','𒄢'=>'𒄢','𒄣'=>'𒄣','𒄤'=>'𒄤','𒄥'=>'𒄥','𒄦'=>'𒄦','𒄧'=>'𒄧','𒄨'=>'𒄨','𒄩'=>'𒄩','𒄪'=>'𒄪','𒄫'=>'𒄫','𒄬'=>'𒄬','𒄭'=>'𒄭','𒄮'=>'𒄮','𒄯'=>'𒄯','𒄰'=>'𒄰','𒄱'=>'𒄱','𒄲'=>'𒄲','𒄳'=>'𒄳','𒄴'=>'𒄴','𒄵'=>'𒄵','𒄶'=>'𒄶','𒄷'=>'𒄷','𒄸'=>'𒄸','𒄹'=>'𒄹','𒄺'=>'𒄺','𒄻'=>'𒄻','𒄼'=>'𒄼','𒄽'=>'𒄽','𒄾'=>'𒄾','𒄿'=>'𒄿','𒅀'=>'𒅀','𒅁'=>'𒅁','𒅂'=>'𒅂','𒅃'=>'𒅃','𒅄'=>'𒅄','𒅅'=>'𒅅','𒅆'=>'𒅆','𒅇'=>'𒅇','𒅈'=>'𒅈','𒅉'=>'𒅉','𒅊'=>'𒅊','𒅋'=>'𒅋','𒅌'=>'𒅌','𒅍'=>'𒅍','𒅎'=>'𒅎','𒅏'=>'𒅏','𒅐'=>'𒅐','𒅑'=>'𒅑','𒅒'=>'𒅒','𒅓'=>'𒅓','𒅔'=>'𒅔','𒅕'=>'𒅕','𒅖'=>'𒅖','𒅗'=>'𒅗','𒅘'=>'𒅘','𒅙'=>'𒅙','𒅚'=>'𒅚','𒅛'=>'𒅛','𒅜'=>'𒅜','𒅝'=>'𒅝','𒅞'=>'𒅞','𒅟'=>'𒅟','𒅠'=>'𒅠','𒅡'=>'𒅡','𒅢'=>'𒅢','𒅣'=>'𒅣','𒅤'=>'𒅤','𒅥'=>'𒅥','𒅦'=>'𒅦','𒅧'=>'𒅧','𒅨'=>'𒅨','𒅩'=>'𒅩','𒅪'=>'𒅪','𒅫'=>'𒅫','𒅬'=>'𒅬','𒅭'=>'𒅭','𒅮'=>'𒅮','𒅯'=>'𒅯','𒅰'=>'𒅰','𒅱'=>'𒅱','𒅲'=>'𒅲','𒅳'=>'𒅳','𒅴'=>'𒅴','𒅵'=>'𒅵','𒅶'=>'𒅶','𒅷'=>'𒅷','𒅸'=>'𒅸','𒅹'=>'𒅹','𒅺'=>'𒅺','𒅻'=>'𒅻','𒅼'=>'𒅼','𒅽'=>'𒅽','𒅾'=>'𒅾','𒅿'=>'𒅿','𒆀'=>'𒆀','𒆁'=>'𒆁','𒆂'=>'𒆂','𒆃'=>'𒆃','𒆄'=>'𒆄','𒆅'=>'𒆅','𒆆'=>'𒆆','𒆇'=>'𒆇','𒆈'=>'𒆈','𒆉'=>'𒆉','𒆊'=>'𒆊','𒆋'=>'𒆋','𒆌'=>'𒆌','𒆍'=>'𒆍','𒆎'=>'𒆎','𒆏'=>'𒆏','𒆐'=>'𒆐','𒆑'=>'𒆑','𒆒'=>'𒆒','𒆓'=>'𒆓','𒆔'=>'𒆔','𒆕'=>'𒆕','𒆖'=>'𒆖','𒆗'=>'𒆗','𒆘'=>'𒆘','𒆙'=>'𒆙','𒆚'=>'𒆚','𒆛'=>'𒆛','𒆜'=>'𒆜','𒆝'=>'𒆝','𒆞'=>'𒆞','𒆟'=>'𒆟','𒆠'=>'𒆠','𒆡'=>'𒆡','𒆢'=>'𒆢','𒆣'=>'𒆣','𒆤'=>'𒆤','𒆥'=>'𒆥','𒆦'=>'𒆦','𒆧'=>'𒆧','𒆨'=>'𒆨','𒆩'=>'𒆩','𒆪'=>'𒆪','𒆫'=>'𒆫','𒆬'=>'𒆬','𒆭'=>'𒆭','𒆮'=>'𒆮','𒆯'=>'𒆯','𒆰'=>'𒆰','𒆱'=>'𒆱','𒆲'=>'𒆲','𒆳'=>'𒆳','𒆴'=>'𒆴','𒆵'=>'𒆵','𒆶'=>'𒆶','𒆷'=>'𒆷','𒆸'=>'𒆸','𒆹'=>'𒆹','𒆺'=>'𒆺','𒆻'=>'𒆻','𒆼'=>'𒆼','𒆽'=>'𒆽','𒆾'=>'𒆾','𒆿'=>'𒆿','𒇀'=>'𒇀','𒇁'=>'𒇁','𒇂'=>'𒇂','𒇃'=>'𒇃','𒇄'=>'𒇄','𒇅'=>'𒇅','𒇆'=>'𒇆','𒇇'=>'𒇇','𒇈'=>'𒇈','𒇉'=>'𒇉','𒇊'=>'𒇊','𒇋'=>'𒇋','𒇌'=>'𒇌','𒇍'=>'𒇍','𒇎'=>'𒇎','𒇏'=>'𒇏','𒇐'=>'𒇐','𒇑'=>'𒇑','𒇒'=>'𒇒','𒇓'=>'𒇓','𒇔'=>'𒇔','𒇕'=>'𒇕','𒇖'=>'𒇖','𒇗'=>'𒇗','𒇘'=>'𒇘','𒇙'=>'𒇙','𒇚'=>'𒇚','𒇛'=>'𒇛','𒇜'=>'𒇜','𒇝'=>'𒇝','𒇞'=>'𒇞','𒇟'=>'𒇟','𒇠'=>'𒇠','𒇡'=>'𒇡','𒇢'=>'𒇢','𒇣'=>'𒇣','𒇤'=>'𒇤','𒇥'=>'𒇥','𒇦'=>'𒇦','𒇧'=>'𒇧','𒇨'=>'𒇨','𒇩'=>'𒇩','𒇪'=>'𒇪','𒇫'=>'𒇫','𒇬'=>'𒇬','𒇭'=>'𒇭','𒇮'=>'𒇮','𒇯'=>'𒇯','𒇰'=>'𒇰','𒇱'=>'𒇱','𒇲'=>'𒇲','𒇳'=>'𒇳','𒇴'=>'𒇴','𒇵'=>'𒇵','𒇶'=>'𒇶','𒇷'=>'𒇷','𒇸'=>'𒇸','𒇹'=>'𒇹','𒇺'=>'𒇺','𒇻'=>'𒇻','𒇼'=>'𒇼','𒇽'=>'𒇽','𒇾'=>'𒇾','𒇿'=>'𒇿','𒈀'=>'𒈀','𒈁'=>'𒈁','𒈂'=>'𒈂','𒈃'=>'𒈃','𒈄'=>'𒈄','𒈅'=>'𒈅','𒈆'=>'𒈆','𒈇'=>'𒈇','𒈈'=>'𒈈','𒈉'=>'𒈉','𒈊'=>'𒈊','𒈋'=>'𒈋','𒈌'=>'𒈌','𒈍'=>'𒈍','𒈎'=>'𒈎','𒈏'=>'𒈏','𒈐'=>'𒈐','𒈑'=>'𒈑','𒈒'=>'𒈒','𒈓'=>'𒈓','𒈔'=>'𒈔','𒈕'=>'𒈕','𒈖'=>'𒈖','𒈗'=>'𒈗','𒈘'=>'𒈘','𒈙'=>'𒈙','𒈚'=>'𒈚','𒈛'=>'𒈛','𒈜'=>'𒈜','𒈝'=>'𒈝','𒈞'=>'𒈞','𒈟'=>'𒈟','𒈠'=>'𒈠','𒈡'=>'𒈡','𒈢'=>'𒈢','𒈣'=>'𒈣','𒈤'=>'𒈤','𒈥'=>'𒈥','𒈦'=>'𒈦','𒈧'=>'𒈧','𒈨'=>'𒈨','𒈩'=>'𒈩','𒈪'=>'𒈪','𒈫'=>'𒈫','𒈬'=>'𒈬','𒈭'=>'𒈭','𒈮'=>'𒈮','𒈯'=>'𒈯','𒈰'=>'𒈰','𒈱'=>'𒈱','𒈲'=>'𒈲','𒈳'=>'𒈳','𒈴'=>'𒈴','𒈵'=>'𒈵','𒈶'=>'𒈶','𒈷'=>'𒈷','𒈸'=>'𒈸','𒈹'=>'𒈹','𒈺'=>'𒈺','𒈻'=>'𒈻','𒈼'=>'𒈼','𒈽'=>'𒈽','𒈾'=>'𒈾','𒈿'=>'𒈿','𒉀'=>'𒉀','𒉁'=>'𒉁','𒉂'=>'𒉂','𒉃'=>'𒉃','𒉄'=>'𒉄','𒉅'=>'𒉅','𒉆'=>'𒉆','𒉇'=>'𒉇','𒉈'=>'𒉈','𒉉'=>'𒉉','𒉊'=>'𒉊','𒉋'=>'𒉋','𒉌'=>'𒉌','𒉍'=>'𒉍','𒉎'=>'𒉎','𒉏'=>'𒉏','𒉐'=>'𒉐','𒉑'=>'𒉑','𒉒'=>'𒉒','𒉓'=>'𒉓','𒉔'=>'𒉔','𒉕'=>'𒉕','𒉖'=>'𒉖','𒉗'=>'𒉗','𒉘'=>'𒉘','𒉙'=>'𒉙','𒉚'=>'𒉚','𒉛'=>'𒉛','𒉜'=>'𒉜','𒉝'=>'𒉝','𒉞'=>'𒉞','𒉟'=>'𒉟','𒉠'=>'𒉠','𒉡'=>'𒉡','𒉢'=>'𒉢','𒉣'=>'𒉣','𒉤'=>'𒉤','𒉥'=>'𒉥','𒉦'=>'𒉦','𒉧'=>'𒉧','𒉨'=>'𒉨','𒉩'=>'𒉩','𒉪'=>'𒉪','𒉫'=>'𒉫','𒉬'=>'𒉬','𒉭'=>'𒉭','𒉮'=>'𒉮','𒉯'=>'𒉯','𒉰'=>'𒉰','𒉱'=>'𒉱','𒉲'=>'𒉲','𒉳'=>'𒉳','𒉴'=>'𒉴','𒉵'=>'𒉵','𒉶'=>'𒉶','𒉷'=>'𒉷','𒉸'=>'𒉸','𒉹'=>'𒉹','𒉺'=>'𒉺','𒉻'=>'𒉻','𒉼'=>'𒉼','𒉽'=>'𒉽','𒉾'=>'𒉾','𒉿'=>'𒉿','𒊀'=>'𒊀','𒊁'=>'𒊁','𒊂'=>'𒊂','𒊃'=>'𒊃','𒊄'=>'𒊄','𒊅'=>'𒊅','𒊆'=>'𒊆','𒊇'=>'𒊇','𒊈'=>'𒊈','𒊉'=>'𒊉','𒊊'=>'𒊊','𒊋'=>'𒊋','𒊌'=>'𒊌','𒊍'=>'𒊍','𒊎'=>'𒊎','𒊏'=>'𒊏','𒊐'=>'𒊐','𒊑'=>'𒊑','𒊒'=>'𒊒','𒊓'=>'𒊓','𒊔'=>'𒊔','𒊕'=>'𒊕','𒊖'=>'𒊖','𒊗'=>'𒊗','𒊘'=>'𒊘','𒊙'=>'𒊙','𒊚'=>'𒊚','𒊛'=>'𒊛','𒊜'=>'𒊜','𒊝'=>'𒊝','𒊞'=>'𒊞','𒊟'=>'𒊟','𒊠'=>'𒊠','𒊡'=>'𒊡','𒊢'=>'𒊢','𒊣'=>'𒊣','𒊤'=>'𒊤','𒊥'=>'𒊥','𒊦'=>'𒊦','𒊧'=>'𒊧','𒊨'=>'𒊨','𒊩'=>'𒊩','𒊪'=>'𒊪','𒊫'=>'𒊫','𒊬'=>'𒊬','𒊭'=>'𒊭','𒊮'=>'𒊮','𒊯'=>'𒊯','𒊰'=>'𒊰','𒊱'=>'𒊱','𒊲'=>'𒊲','𒊳'=>'𒊳','𒊴'=>'𒊴','𒊵'=>'𒊵','𒊶'=>'𒊶','𒊷'=>'𒊷','𒊸'=>'𒊸','𒊹'=>'𒊹','𒊺'=>'𒊺','𒊻'=>'𒊻','𒊼'=>'𒊼','𒊽'=>'𒊽','𒊾'=>'𒊾','𒊿'=>'𒊿','𒋀'=>'𒋀','𒋁'=>'𒋁','𒋂'=>'𒋂','𒋃'=>'𒋃','𒋄'=>'𒋄','𒋅'=>'𒋅','𒋆'=>'𒋆','𒋇'=>'𒋇','𒋈'=>'𒋈','𒋉'=>'𒋉','𒋊'=>'𒋊','𒋋'=>'𒋋','𒋌'=>'𒋌','𒋍'=>'𒋍','𒋎'=>'𒋎','𒋏'=>'𒋏','𒋐'=>'𒋐','𒋑'=>'𒋑','𒋒'=>'𒋒','𒋓'=>'𒋓','𒋔'=>'𒋔','𒋕'=>'𒋕','𒋖'=>'𒋖','𒋗'=>'𒋗','𒋘'=>'𒋘','𒋙'=>'𒋙','𒋚'=>'𒋚','𒋛'=>'𒋛','𒋜'=>'𒋜','𒋝'=>'𒋝','𒋞'=>'𒋞','𒋟'=>'𒋟','𒋠'=>'𒋠','𒋡'=>'𒋡','𒋢'=>'𒋢','𒋣'=>'𒋣','𒋤'=>'𒋤','𒋥'=>'𒋥','𒋦'=>'𒋦','𒋧'=>'𒋧','𒋨'=>'𒋨','𒋩'=>'𒋩','𒋪'=>'𒋪','𒋫'=>'𒋫','𒋬'=>'𒋬','𒋭'=>'𒋭','𒋮'=>'𒋮','𒋯'=>'𒋯','𒋰'=>'𒋰','𒋱'=>'𒋱','𒋲'=>'𒋲','𒋳'=>'𒋳','𒋴'=>'𒋴','𒋵'=>'𒋵','𒋶'=>'𒋶','𒋷'=>'𒋷','𒋸'=>'𒋸','𒋹'=>'𒋹','𒋺'=>'𒋺','𒋻'=>'𒋻','𒋼'=>'𒋼','𒋽'=>'𒋽','𒋾'=>'𒋾','𒋿'=>'𒋿','𒌀'=>'𒌀','𒌁'=>'𒌁','𒌂'=>'𒌂','𒌃'=>'𒌃','𒌄'=>'𒌄','𒌅'=>'𒌅','𒌆'=>'𒌆','𒌇'=>'𒌇','𒌈'=>'𒌈','𒌉'=>'𒌉','𒌊'=>'𒌊','𒌋'=>'𒌋','𒌌'=>'𒌌','𒌍'=>'𒌍','𒌎'=>'𒌎','𒌏'=>'𒌏','𒌐'=>'𒌐','𒌑'=>'𒌑','𒌒'=>'𒌒','𒌓'=>'𒌓','𒌔'=>'𒌔','𒌕'=>'𒌕','𒌖'=>'𒌖','𒌗'=>'𒌗','𒌘'=>'𒌘','𒌙'=>'𒌙','𒌚'=>'𒌚','𒌛'=>'𒌛','𒌜'=>'𒌜','𒌝'=>'𒌝','𒌞'=>'𒌞','𒌟'=>'𒌟','𒌠'=>'𒌠','𒌡'=>'𒌡','𒌢'=>'𒌢','𒌣'=>'𒌣','𒌤'=>'𒌤','𒌥'=>'𒌥','𒌦'=>'𒌦','𒌧'=>'𒌧','𒌨'=>'𒌨','𒌩'=>'𒌩','𒌪'=>'𒌪','𒌫'=>'𒌫','𒌬'=>'𒌬','𒌭'=>'𒌭','𒌮'=>'𒌮','𒌯'=>'𒌯','𒌰'=>'𒌰','𒌱'=>'𒌱','𒌲'=>'𒌲','𒌳'=>'𒌳','𒌴'=>'𒌴','𒌵'=>'𒌵','𒌶'=>'𒌶','𒌷'=>'𒌷','𒌸'=>'𒌸','𒌹'=>'𒌹','𒌺'=>'𒌺','𒌻'=>'𒌻','𒌼'=>'𒌼','𒌽'=>'𒌽','𒌾'=>'𒌾','𒌿'=>'𒌿','𒍀'=>'𒍀','𒍁'=>'𒍁','𒍂'=>'𒍂','𒍃'=>'𒍃','𒍄'=>'𒍄','𒍅'=>'𒍅','𒍆'=>'𒍆','𒍇'=>'𒍇','𒍈'=>'𒍈','𒍉'=>'𒍉','𒍊'=>'𒍊','𒍋'=>'𒍋','𒍌'=>'𒍌','𒍍'=>'𒍍','𒍎'=>'𒍎','𒍏'=>'𒍏','𒍐'=>'𒍐','𒍑'=>'𒍑','𒍒'=>'𒍒','𒍓'=>'𒍓','𒍔'=>'𒍔','𒍕'=>'𒍕','𒍖'=>'𒍖','𒍗'=>'𒍗','𒍘'=>'𒍘','𒍙'=>'𒍙','𒍚'=>'𒍚','𒍛'=>'𒍛','𒍜'=>'𒍜','𒍝'=>'𒍝','𒍞'=>'𒍞','𒍟'=>'𒍟','𒍠'=>'𒍠','𒍡'=>'𒍡','𒍢'=>'𒍢','𒍣'=>'𒍣','𒍤'=>'𒍤','𒍥'=>'𒍥','𒍦'=>'𒍦','𒍧'=>'𒍧','𒍨'=>'𒍨','𒍩'=>'𒍩','𒍪'=>'𒍪','𒍫'=>'𒍫','𒍬'=>'𒍬','𒍭'=>'𒍭','𒍮'=>'𒍮','𒐀'=>'2','𒐁'=>'3','𒐂'=>'4','𒐃'=>'5','𒐄'=>'6','𒐅'=>'7','𒐆'=>'8','𒐇'=>'9','𒐈'=>'3','𒐉'=>'4','𒐊'=>'5','𒐋'=>'6','𒐌'=>'7','𒐍'=>'8','𒐎'=>'9','𒐏'=>'4','𒐐'=>'5','𒐑'=>'6','𒐒'=>'7','𒐓'=>'8','𒐔'=>'9','𒐕'=>'1','𒐖'=>'2','𒐗'=>'3','𒐘'=>'4','𒐙'=>'5','𒐚'=>'6','𒐛'=>'7','𒐜'=>'8','𒐝'=>'9','𒐞'=>'1','𒐟'=>'2','𒐠'=>'3','𒐡'=>'4','𒐢'=>'5','𒐣'=>'2','𒐤'=>'3','𒐥'=>'3','𒐦'=>'4','𒐧'=>'5','𒐨'=>'6','𒐩'=>'7','𒐪'=>'8','𒐫'=>'9','𒐬'=>'1','𒐭'=>'2','𒐮'=>'3','𒐯'=>'3','𒐰'=>'4','𒐱'=>'5','𒐲'=>'𒐲','𒐳'=>'𒐳','𒐴'=>'1','𒐵'=>'2','𒐶'=>'3','𒐷'=>'3','𒐸'=>'4','𒐹'=>'5','𒐺'=>'3','𒐻'=>'3','𒐼'=>'4','𒐽'=>'4','𒐾'=>'4','𒐿'=>'4','𒑀'=>'6','𒑁'=>'7','𒑂'=>'7','𒑃'=>'7','𒑄'=>'8','𒑅'=>'8','𒑆'=>'9','𒑇'=>'9','𒑈'=>'9','𒑉'=>'9','𒑊'=>'2','𒑋'=>'3','𒑌'=>'4','𒑍'=>'5','𒑎'=>'6','𒑏'=>'1','𒑐'=>'2','𒑑'=>'3','𒑒'=>'4','𒑓'=>'4','𒑔'=>'5','𒑕'=>'5','𒑖'=>'𒑖','𒑗'=>'𒑗','𒑘'=>'1','𒑙'=>'2','𒑚'=>'1/3','𒑛'=>'2/3','𒑜'=>'5/6','𒑝'=>'1/3','𒑞'=>'2/3','𒑟'=>'1/8','𒑠'=>'1/4','𒑡'=>'1/6','𒑢'=>'1/4'); \ No newline at end of file
+<?php return array('𒀀'=>'𒀀','𒀁'=>'𒀁','𒀂'=>'𒀂','𒀃'=>'𒀃','𒀄'=>'𒀄','𒀅'=>'𒀅','𒀆'=>'𒀆','𒀇'=>'𒀇','𒀈'=>'𒀈','𒀉'=>'𒀉','𒀊'=>'𒀊','𒀋'=>'𒀋','𒀌'=>'𒀌','𒀍'=>'𒀍','𒀎'=>'𒀎','𒀏'=>'𒀏','𒀐'=>'𒀐','𒀑'=>'𒀑','𒀒'=>'𒀒','𒀓'=>'𒀓','𒀔'=>'𒀔','𒀕'=>'𒀕','𒀖'=>'𒀖','𒀗'=>'𒀗','𒀘'=>'𒀘','𒀙'=>'𒀙','𒀚'=>'𒀚','𒀛'=>'𒀛','𒀜'=>'𒀜','𒀝'=>'𒀝','𒀞'=>'𒀞','𒀟'=>'𒀟','𒀠'=>'𒀠','𒀡'=>'𒀡','𒀢'=>'𒀢','𒀣'=>'𒀣','𒀤'=>'𒀤','𒀥'=>'𒀥','𒀦'=>'𒀦','𒀧'=>'𒀧','𒀨'=>'𒀨','𒀩'=>'𒀩','𒀪'=>'𒀪','𒀫'=>'𒀫','𒀬'=>'𒀬','𒀭'=>'𒀭','𒀮'=>'𒀮','𒀯'=>'𒀯','𒀰'=>'𒀰','𒀱'=>'𒀱','𒀲'=>'𒀲','𒀳'=>'𒀳','𒀴'=>'𒀴','𒀵'=>'𒀵','𒀶'=>'𒀶','𒀷'=>'𒀷','𒀸'=>'𒀸','𒀹'=>'𒀹','𒀺'=>'𒀺','𒀻'=>'𒀻','𒀼'=>'𒀼','𒀽'=>'𒀽','𒀾'=>'𒀾','𒀿'=>'𒀿','𒁀'=>'𒁀','𒁁'=>'𒁁','𒁂'=>'𒁂','𒁃'=>'𒁃','𒁄'=>'𒁄','𒁅'=>'𒁅','𒁆'=>'𒁆','𒁇'=>'𒁇','𒁈'=>'𒁈','𒁉'=>'𒁉','𒁊'=>'𒁊','𒁋'=>'𒁋','𒁌'=>'𒁌','𒁍'=>'𒁍','𒁎'=>'𒁎','𒁏'=>'𒁏','𒁐'=>'𒁐','𒁑'=>'𒁑','𒁒'=>'𒁒','𒁓'=>'𒁓','𒁔'=>'𒁔','𒁕'=>'𒁕','𒁖'=>'𒁖','𒁗'=>'𒁗','𒁘'=>'𒁘','𒁙'=>'𒁙','𒁚'=>'𒁚','𒁛'=>'𒁛','𒁜'=>'𒁜','𒁝'=>'𒁝','𒁞'=>'𒁞','𒁟'=>'𒁟','𒁠'=>'𒁠','𒁡'=>'𒁡','𒁢'=>'𒁢','𒁣'=>'𒁣','𒁤'=>'𒁤','𒁥'=>'𒁥','𒁦'=>'𒁦','𒁧'=>'𒁧','𒁨'=>'𒁨','𒁩'=>'𒁩','𒁪'=>'𒁪','𒁫'=>'𒁫','𒁬'=>'𒁬','𒁭'=>'𒁭','𒁮'=>'𒁮','𒁯'=>'𒁯','𒁰'=>'𒁰','𒁱'=>'𒁱','𒁲'=>'𒁲','𒁳'=>'𒁳','𒁴'=>'𒁴','𒁵'=>'𒁵','𒁶'=>'𒁶','𒁷'=>'𒁷','𒁸'=>'𒁸','𒁹'=>'𒁹','𒁺'=>'𒁺','𒁻'=>'𒁻','𒁼'=>'𒁼','𒁽'=>'𒁽','𒁾'=>'𒁾','𒁿'=>'𒁿','𒂀'=>'𒂀','𒂁'=>'𒂁','𒂂'=>'𒂂','𒂃'=>'𒂃','𒂄'=>'𒂄','𒂅'=>'𒂅','𒂆'=>'𒂆','𒂇'=>'𒂇','𒂈'=>'𒂈','𒂉'=>'𒂉','𒂊'=>'𒂊','𒂋'=>'𒂋','𒂌'=>'𒂌','𒂍'=>'𒂍','𒂎'=>'𒂎','𒂏'=>'𒂏','𒂐'=>'𒂐','𒂑'=>'𒂑','𒂒'=>'𒂒','𒂓'=>'𒂓','𒂔'=>'𒂔','𒂕'=>'𒂕','𒂖'=>'𒂖','𒂗'=>'𒂗','𒂘'=>'𒂘','𒂙'=>'𒂙','𒂚'=>'𒂚','𒂛'=>'𒂛','𒂜'=>'𒂜','𒂝'=>'𒂝','𒂞'=>'𒂞','𒂟'=>'𒂟','𒂠'=>'𒂠','𒂡'=>'𒂡','𒂢'=>'𒂢','𒂣'=>'𒂣','𒂤'=>'𒂤','𒂥'=>'𒂥','𒂦'=>'𒂦','𒂧'=>'𒂧','𒂨'=>'𒂨','𒂩'=>'𒂩','𒂪'=>'𒂪','𒂫'=>'𒂫','𒂬'=>'𒂬','𒂭'=>'𒂭','𒂮'=>'𒂮','𒂯'=>'𒂯','𒂰'=>'𒂰','𒂱'=>'𒂱','𒂲'=>'𒂲','𒂳'=>'𒂳','𒂴'=>'𒂴','𒂵'=>'𒂵','𒂶'=>'𒂶','𒂷'=>'𒂷','𒂸'=>'𒂸','𒂹'=>'𒂹','𒂺'=>'𒂺','𒂻'=>'𒂻','𒂼'=>'𒂼','𒂽'=>'𒂽','𒂾'=>'𒂾','𒂿'=>'𒂿','𒃀'=>'𒃀','𒃁'=>'𒃁','𒃂'=>'𒃂','𒃃'=>'𒃃','𒃄'=>'𒃄','𒃅'=>'𒃅','𒃆'=>'𒃆','𒃇'=>'𒃇','𒃈'=>'𒃈','𒃉'=>'𒃉','𒃊'=>'𒃊','𒃋'=>'𒃋','𒃌'=>'𒃌','𒃍'=>'𒃍','𒃎'=>'𒃎','𒃏'=>'𒃏','𒃐'=>'𒃐','𒃑'=>'𒃑','𒃒'=>'𒃒','𒃓'=>'𒃓','𒃔'=>'𒃔','𒃕'=>'𒃕','𒃖'=>'𒃖','𒃗'=>'𒃗','𒃘'=>'𒃘','𒃙'=>'𒃙','𒃚'=>'𒃚','𒃛'=>'𒃛','𒃜'=>'𒃜','𒃝'=>'𒃝','𒃞'=>'𒃞','𒃟'=>'𒃟','𒃠'=>'𒃠','𒃡'=>'𒃡','𒃢'=>'𒃢','𒃣'=>'𒃣','𒃤'=>'𒃤','𒃥'=>'𒃥','𒃦'=>'𒃦','𒃧'=>'𒃧','𒃨'=>'𒃨','𒃩'=>'𒃩','𒃪'=>'𒃪','𒃫'=>'𒃫','𒃬'=>'𒃬','𒃭'=>'𒃭','𒃮'=>'𒃮','𒃯'=>'𒃯','𒃰'=>'𒃰','𒃱'=>'𒃱','𒃲'=>'𒃲','𒃳'=>'𒃳','𒃴'=>'𒃴','𒃵'=>'𒃵','𒃶'=>'𒃶','𒃷'=>'𒃷','𒃸'=>'𒃸','𒃹'=>'𒃹','𒃺'=>'𒃺','𒃻'=>'𒃻','𒃼'=>'𒃼','𒃽'=>'𒃽','𒃾'=>'𒃾','𒃿'=>'𒃿','𒄀'=>'𒄀','𒄁'=>'𒄁','𒄂'=>'𒄂','𒄃'=>'𒄃','𒄄'=>'𒄄','𒄅'=>'𒄅','𒄆'=>'𒄆','𒄇'=>'𒄇','𒄈'=>'𒄈','𒄉'=>'𒄉','𒄊'=>'𒄊','𒄋'=>'𒄋','𒄌'=>'𒄌','𒄍'=>'𒄍','𒄎'=>'𒄎','𒄏'=>'𒄏','𒄐'=>'𒄐','𒄑'=>'𒄑','𒄒'=>'𒄒','𒄓'=>'𒄓','𒄔'=>'𒄔','𒄕'=>'𒄕','𒄖'=>'𒄖','𒄗'=>'𒄗','𒄘'=>'𒄘','𒄙'=>'𒄙','𒄚'=>'𒄚','𒄛'=>'𒄛','𒄜'=>'𒄜','𒄝'=>'𒄝','𒄞'=>'𒄞','𒄟'=>'𒄟','𒄠'=>'𒄠','𒄡'=>'𒄡','𒄢'=>'𒄢','𒄣'=>'𒄣','𒄤'=>'𒄤','𒄥'=>'𒄥','𒄦'=>'𒄦','𒄧'=>'𒄧','𒄨'=>'𒄨','𒄩'=>'𒄩','𒄪'=>'𒄪','𒄫'=>'𒄫','𒄬'=>'𒄬','𒄭'=>'𒄭','𒄮'=>'𒄮','𒄯'=>'𒄯','𒄰'=>'𒄰','𒄱'=>'𒄱','𒄲'=>'𒄲','𒄳'=>'𒄳','𒄴'=>'𒄴','𒄵'=>'𒄵','𒄶'=>'𒄶','𒄷'=>'𒄷','𒄸'=>'𒄸','𒄹'=>'𒄹','𒄺'=>'𒄺','𒄻'=>'𒄻','𒄼'=>'𒄼','𒄽'=>'𒄽','𒄾'=>'𒄾','𒄿'=>'𒄿','𒅀'=>'𒅀','𒅁'=>'𒅁','𒅂'=>'𒅂','𒅃'=>'𒅃','𒅄'=>'𒅄','𒅅'=>'𒅅','𒅆'=>'𒅆','𒅇'=>'𒅇','𒅈'=>'𒅈','𒅉'=>'𒅉','𒅊'=>'𒅊','𒅋'=>'𒅋','𒅌'=>'𒅌','𒅍'=>'𒅍','𒅎'=>'𒅎','𒅏'=>'𒅏','𒅐'=>'𒅐','𒅑'=>'𒅑','𒅒'=>'𒅒','𒅓'=>'𒅓','𒅔'=>'𒅔','𒅕'=>'𒅕','𒅖'=>'𒅖','𒅗'=>'𒅗','𒅘'=>'𒅘','𒅙'=>'𒅙','𒅚'=>'𒅚','𒅛'=>'𒅛','𒅜'=>'𒅜','𒅝'=>'𒅝','𒅞'=>'𒅞','𒅟'=>'𒅟','𒅠'=>'𒅠','𒅡'=>'𒅡','𒅢'=>'𒅢','𒅣'=>'𒅣','𒅤'=>'𒅤','𒅥'=>'𒅥','𒅦'=>'𒅦','𒅧'=>'𒅧','𒅨'=>'𒅨','𒅩'=>'𒅩','𒅪'=>'𒅪','𒅫'=>'𒅫','𒅬'=>'𒅬','𒅭'=>'𒅭','𒅮'=>'𒅮','𒅯'=>'𒅯','𒅰'=>'𒅰','𒅱'=>'𒅱','𒅲'=>'𒅲','𒅳'=>'𒅳','𒅴'=>'𒅴','𒅵'=>'𒅵','𒅶'=>'𒅶','𒅷'=>'𒅷','𒅸'=>'𒅸','𒅹'=>'𒅹','𒅺'=>'𒅺','𒅻'=>'𒅻','𒅼'=>'𒅼','𒅽'=>'𒅽','𒅾'=>'𒅾','𒅿'=>'𒅿','𒆀'=>'𒆀','𒆁'=>'𒆁','𒆂'=>'𒆂','𒆃'=>'𒆃','𒆄'=>'𒆄','𒆅'=>'𒆅','𒆆'=>'𒆆','𒆇'=>'𒆇','𒆈'=>'𒆈','𒆉'=>'𒆉','𒆊'=>'𒆊','𒆋'=>'𒆋','𒆌'=>'𒆌','𒆍'=>'𒆍','𒆎'=>'𒆎','𒆏'=>'𒆏','𒆐'=>'𒆐','𒆑'=>'𒆑','𒆒'=>'𒆒','𒆓'=>'𒆓','𒆔'=>'𒆔','𒆕'=>'𒆕','𒆖'=>'𒆖','𒆗'=>'𒆗','𒆘'=>'𒆘','𒆙'=>'𒆙','𒆚'=>'𒆚','𒆛'=>'𒆛','𒆜'=>'𒆜','𒆝'=>'𒆝','𒆞'=>'𒆞','𒆟'=>'𒆟','𒆠'=>'𒆠','𒆡'=>'𒆡','𒆢'=>'𒆢','𒆣'=>'𒆣','𒆤'=>'𒆤','𒆥'=>'𒆥','𒆦'=>'𒆦','𒆧'=>'𒆧','𒆨'=>'𒆨','𒆩'=>'𒆩','𒆪'=>'𒆪','𒆫'=>'𒆫','𒆬'=>'𒆬','𒆭'=>'𒆭','𒆮'=>'𒆮','𒆯'=>'𒆯','𒆰'=>'𒆰','𒆱'=>'𒆱','𒆲'=>'𒆲','𒆳'=>'𒆳','𒆴'=>'𒆴','𒆵'=>'𒆵','𒆶'=>'𒆶','𒆷'=>'𒆷','𒆸'=>'𒆸','𒆹'=>'𒆹','𒆺'=>'𒆺','𒆻'=>'𒆻','𒆼'=>'𒆼','𒆽'=>'𒆽','𒆾'=>'𒆾','𒆿'=>'𒆿','𒇀'=>'𒇀','𒇁'=>'𒇁','𒇂'=>'𒇂','𒇃'=>'𒇃','𒇄'=>'𒇄','𒇅'=>'𒇅','𒇆'=>'𒇆','𒇇'=>'𒇇','𒇈'=>'𒇈','𒇉'=>'𒇉','𒇊'=>'𒇊','𒇋'=>'𒇋','𒇌'=>'𒇌','𒇍'=>'𒇍','𒇎'=>'𒇎','𒇏'=>'𒇏','𒇐'=>'𒇐','𒇑'=>'𒇑','𒇒'=>'𒇒','𒇓'=>'𒇓','𒇔'=>'𒇔','𒇕'=>'𒇕','𒇖'=>'𒇖','𒇗'=>'𒇗','𒇘'=>'𒇘','𒇙'=>'𒇙','𒇚'=>'𒇚','𒇛'=>'𒇛','𒇜'=>'𒇜','𒇝'=>'𒇝','𒇞'=>'𒇞','𒇟'=>'𒇟','𒇠'=>'𒇠','𒇡'=>'𒇡','𒇢'=>'𒇢','𒇣'=>'𒇣','𒇤'=>'𒇤','𒇥'=>'𒇥','𒇦'=>'𒇦','𒇧'=>'𒇧','𒇨'=>'𒇨','𒇩'=>'𒇩','𒇪'=>'𒇪','𒇫'=>'𒇫','𒇬'=>'𒇬','𒇭'=>'𒇭','𒇮'=>'𒇮','𒇯'=>'𒇯','𒇰'=>'𒇰','𒇱'=>'𒇱','𒇲'=>'𒇲','𒇳'=>'𒇳','𒇴'=>'𒇴','𒇵'=>'𒇵','𒇶'=>'𒇶','𒇷'=>'𒇷','𒇸'=>'𒇸','𒇹'=>'𒇹','𒇺'=>'𒇺','𒇻'=>'𒇻','𒇼'=>'𒇼','𒇽'=>'𒇽','𒇾'=>'𒇾','𒇿'=>'𒇿','𒈀'=>'𒈀','𒈁'=>'𒈁','𒈂'=>'𒈂','𒈃'=>'𒈃','𒈄'=>'𒈄','𒈅'=>'𒈅','𒈆'=>'𒈆','𒈇'=>'𒈇','𒈈'=>'𒈈','𒈉'=>'𒈉','𒈊'=>'𒈊','𒈋'=>'𒈋','𒈌'=>'𒈌','𒈍'=>'𒈍','𒈎'=>'𒈎','𒈏'=>'𒈏','𒈐'=>'𒈐','𒈑'=>'𒈑','𒈒'=>'𒈒','𒈓'=>'𒈓','𒈔'=>'𒈔','𒈕'=>'𒈕','𒈖'=>'𒈖','𒈗'=>'𒈗','𒈘'=>'𒈘','𒈙'=>'𒈙','𒈚'=>'𒈚','𒈛'=>'𒈛','𒈜'=>'𒈜','𒈝'=>'𒈝','𒈞'=>'𒈞','𒈟'=>'𒈟','𒈠'=>'𒈠','𒈡'=>'𒈡','𒈢'=>'𒈢','𒈣'=>'𒈣','𒈤'=>'𒈤','𒈥'=>'𒈥','𒈦'=>'𒈦','𒈧'=>'𒈧','𒈨'=>'𒈨','𒈩'=>'𒈩','𒈪'=>'𒈪','𒈫'=>'𒈫','𒈬'=>'𒈬','𒈭'=>'𒈭','𒈮'=>'𒈮','𒈯'=>'𒈯','𒈰'=>'𒈰','𒈱'=>'𒈱','𒈲'=>'𒈲','𒈳'=>'𒈳','𒈴'=>'𒈴','𒈵'=>'𒈵','𒈶'=>'𒈶','𒈷'=>'𒈷','𒈸'=>'𒈸','𒈹'=>'𒈹','𒈺'=>'𒈺','𒈻'=>'𒈻','𒈼'=>'𒈼','𒈽'=>'𒈽','𒈾'=>'𒈾','𒈿'=>'𒈿','𒉀'=>'𒉀','𒉁'=>'𒉁','𒉂'=>'𒉂','𒉃'=>'𒉃','𒉄'=>'𒉄','𒉅'=>'𒉅','𒉆'=>'𒉆','𒉇'=>'𒉇','𒉈'=>'𒉈','𒉉'=>'𒉉','𒉊'=>'𒉊','𒉋'=>'𒉋','𒉌'=>'𒉌','𒉍'=>'𒉍','𒉎'=>'𒉎','𒉏'=>'𒉏','𒉐'=>'𒉐','𒉑'=>'𒉑','𒉒'=>'𒉒','𒉓'=>'𒉓','𒉔'=>'𒉔','𒉕'=>'𒉕','𒉖'=>'𒉖','𒉗'=>'𒉗','𒉘'=>'𒉘','𒉙'=>'𒉙','𒉚'=>'𒉚','𒉛'=>'𒉛','𒉜'=>'𒉜','𒉝'=>'𒉝','𒉞'=>'𒉞','𒉟'=>'𒉟','𒉠'=>'𒉠','𒉡'=>'𒉡','𒉢'=>'𒉢','𒉣'=>'𒉣','𒉤'=>'𒉤','𒉥'=>'𒉥','𒉦'=>'𒉦','𒉧'=>'𒉧','𒉨'=>'𒉨','𒉩'=>'𒉩','𒉪'=>'𒉪','𒉫'=>'𒉫','𒉬'=>'𒉬','𒉭'=>'𒉭','𒉮'=>'𒉮','𒉯'=>'𒉯','𒉰'=>'𒉰','𒉱'=>'𒉱','𒉲'=>'𒉲','𒉳'=>'𒉳','𒉴'=>'𒉴','𒉵'=>'𒉵','𒉶'=>'𒉶','𒉷'=>'𒉷','𒉸'=>'𒉸','𒉹'=>'𒉹','𒉺'=>'𒉺','𒉻'=>'𒉻','𒉼'=>'𒉼','𒉽'=>'𒉽','𒉾'=>'𒉾','𒉿'=>'𒉿','𒊀'=>'𒊀','𒊁'=>'𒊁','𒊂'=>'𒊂','𒊃'=>'𒊃','𒊄'=>'𒊄','𒊅'=>'𒊅','𒊆'=>'𒊆','𒊇'=>'𒊇','𒊈'=>'𒊈','𒊉'=>'𒊉','𒊊'=>'𒊊','𒊋'=>'𒊋','𒊌'=>'𒊌','𒊍'=>'𒊍','𒊎'=>'𒊎','𒊏'=>'𒊏','𒊐'=>'𒊐','𒊑'=>'𒊑','𒊒'=>'𒊒','𒊓'=>'𒊓','𒊔'=>'𒊔','𒊕'=>'𒊕','𒊖'=>'𒊖','𒊗'=>'𒊗','𒊘'=>'𒊘','𒊙'=>'𒊙','𒊚'=>'𒊚','𒊛'=>'𒊛','𒊜'=>'𒊜','𒊝'=>'𒊝','𒊞'=>'𒊞','𒊟'=>'𒊟','𒊠'=>'𒊠','𒊡'=>'𒊡','𒊢'=>'𒊢','𒊣'=>'𒊣','𒊤'=>'𒊤','𒊥'=>'𒊥','𒊦'=>'𒊦','𒊧'=>'𒊧','𒊨'=>'𒊨','𒊩'=>'𒊩','𒊪'=>'𒊪','𒊫'=>'𒊫','𒊬'=>'𒊬','𒊭'=>'𒊭','𒊮'=>'𒊮','𒊯'=>'𒊯','𒊰'=>'𒊰','𒊱'=>'𒊱','𒊲'=>'𒊲','𒊳'=>'𒊳','𒊴'=>'𒊴','𒊵'=>'𒊵','𒊶'=>'𒊶','𒊷'=>'𒊷','𒊸'=>'𒊸','𒊹'=>'𒊹','𒊺'=>'𒊺','𒊻'=>'𒊻','𒊼'=>'𒊼','𒊽'=>'𒊽','𒊾'=>'𒊾','𒊿'=>'𒊿','𒋀'=>'𒋀','𒋁'=>'𒋁','𒋂'=>'𒋂','𒋃'=>'𒋃','𒋄'=>'𒋄','𒋅'=>'𒋅','𒋆'=>'𒋆','𒋇'=>'𒋇','𒋈'=>'𒋈','𒋉'=>'𒋉','𒋊'=>'𒋊','𒋋'=>'𒋋','𒋌'=>'𒋌','𒋍'=>'𒋍','𒋎'=>'𒋎','𒋏'=>'𒋏','𒋐'=>'𒋐','𒋑'=>'𒋑','𒋒'=>'𒋒','𒋓'=>'𒋓','𒋔'=>'𒋔','𒋕'=>'𒋕','𒋖'=>'𒋖','𒋗'=>'𒋗','𒋘'=>'𒋘','𒋙'=>'𒋙','𒋚'=>'𒋚','𒋛'=>'𒋛','𒋜'=>'𒋜','𒋝'=>'𒋝','𒋞'=>'𒋞','𒋟'=>'𒋟','𒋠'=>'𒋠','𒋡'=>'𒋡','𒋢'=>'𒋢','𒋣'=>'𒋣','𒋤'=>'𒋤','𒋥'=>'𒋥','𒋦'=>'𒋦','𒋧'=>'𒋧','𒋨'=>'𒋨','𒋩'=>'𒋩','𒋪'=>'𒋪','𒋫'=>'𒋫','𒋬'=>'𒋬','𒋭'=>'𒋭','𒋮'=>'𒋮','𒋯'=>'𒋯','𒋰'=>'𒋰','𒋱'=>'𒋱','𒋲'=>'𒋲','𒋳'=>'𒋳','𒋴'=>'𒋴','𒋵'=>'𒋵','𒋶'=>'𒋶','𒋷'=>'𒋷','𒋸'=>'𒋸','𒋹'=>'𒋹','𒋺'=>'𒋺','𒋻'=>'𒋻','𒋼'=>'𒋼','𒋽'=>'𒋽','𒋾'=>'𒋾','𒋿'=>'𒋿','𒌀'=>'𒌀','𒌁'=>'𒌁','𒌂'=>'𒌂','𒌃'=>'𒌃','𒌄'=>'𒌄','𒌅'=>'𒌅','𒌆'=>'𒌆','𒌇'=>'𒌇','𒌈'=>'𒌈','𒌉'=>'𒌉','𒌊'=>'𒌊','𒌋'=>'𒌋','𒌌'=>'𒌌','𒌍'=>'𒌍','𒌎'=>'𒌎','𒌏'=>'𒌏','𒌐'=>'𒌐','𒌑'=>'𒌑','𒌒'=>'𒌒','𒌓'=>'𒌓','𒌔'=>'𒌔','𒌕'=>'𒌕','𒌖'=>'𒌖','𒌗'=>'𒌗','𒌘'=>'𒌘','𒌙'=>'𒌙','𒌚'=>'𒌚','𒌛'=>'𒌛','𒌜'=>'𒌜','𒌝'=>'𒌝','𒌞'=>'𒌞','𒌟'=>'𒌟','𒌠'=>'𒌠','𒌡'=>'𒌡','𒌢'=>'𒌢','𒌣'=>'𒌣','𒌤'=>'𒌤','𒌥'=>'𒌥','𒌦'=>'𒌦','𒌧'=>'𒌧','𒌨'=>'𒌨','𒌩'=>'𒌩','𒌪'=>'𒌪','𒌫'=>'𒌫','𒌬'=>'𒌬','𒌭'=>'𒌭','𒌮'=>'𒌮','𒌯'=>'𒌯','𒌰'=>'𒌰','𒌱'=>'𒌱','𒌲'=>'𒌲','𒌳'=>'𒌳','𒌴'=>'𒌴','𒌵'=>'𒌵','𒌶'=>'𒌶','𒌷'=>'𒌷','𒌸'=>'𒌸','𒌹'=>'𒌹','𒌺'=>'𒌺','𒌻'=>'𒌻','𒌼'=>'𒌼','𒌽'=>'𒌽','𒌾'=>'𒌾','𒌿'=>'𒌿','𒍀'=>'𒍀','𒍁'=>'𒍁','𒍂'=>'𒍂','𒍃'=>'𒍃','𒍄'=>'𒍄','𒍅'=>'𒍅','𒍆'=>'𒍆','𒍇'=>'𒍇','𒍈'=>'𒍈','𒍉'=>'𒍉','𒍊'=>'𒍊','𒍋'=>'𒍋','𒍌'=>'𒍌','𒍍'=>'𒍍','𒍎'=>'𒍎','𒍏'=>'𒍏','𒍐'=>'𒍐','𒍑'=>'𒍑','𒍒'=>'𒍒','𒍓'=>'𒍓','𒍔'=>'𒍔','𒍕'=>'𒍕','𒍖'=>'𒍖','𒍗'=>'𒍗','𒍘'=>'𒍘','𒍙'=>'𒍙','𒍚'=>'𒍚','𒍛'=>'𒍛','𒍜'=>'𒍜','𒍝'=>'𒍝','𒍞'=>'𒍞','𒍟'=>'𒍟','𒍠'=>'𒍠','𒍡'=>'𒍡','𒍢'=>'𒍢','𒍣'=>'𒍣','𒍤'=>'𒍤','𒍥'=>'𒍥','𒍦'=>'𒍦','𒍧'=>'𒍧','𒍨'=>'𒍨','𒍩'=>'𒍩','𒍪'=>'𒍪','𒍫'=>'𒍫','𒍬'=>'𒍬','𒍭'=>'𒍭','𒍮'=>'𒍮','𒐀'=>'2','𒐁'=>'3','𒐂'=>'4','𒐃'=>'5','𒐄'=>'6','𒐅'=>'7','𒐆'=>'8','𒐇'=>'9','𒐈'=>'3','𒐉'=>'4','𒐊'=>'5','𒐋'=>'6','𒐌'=>'7','𒐍'=>'8','𒐎'=>'9','𒐏'=>'4','𒐐'=>'5','𒐑'=>'6','𒐒'=>'7','𒐓'=>'8','𒐔'=>'9','𒐕'=>'1','𒐖'=>'2','𒐗'=>'3','𒐘'=>'4','𒐙'=>'5','𒐚'=>'6','𒐛'=>'7','𒐜'=>'8','𒐝'=>'9','𒐞'=>'1','𒐟'=>'2','𒐠'=>'3','𒐡'=>'4','𒐢'=>'5','𒐣'=>'2','𒐤'=>'3','𒐥'=>'3','𒐦'=>'4','𒐧'=>'5','𒐨'=>'6','𒐩'=>'7','𒐪'=>'8','𒐫'=>'9','𒐬'=>'1','𒐭'=>'2','𒐮'=>'3','𒐯'=>'3','𒐰'=>'4','𒐱'=>'5','𒐲'=>'𒐲','𒐳'=>'𒐳','𒐴'=>'1','𒐵'=>'2','𒐶'=>'3','𒐷'=>'3','𒐸'=>'4','𒐹'=>'5','𒐺'=>'3','𒐻'=>'3','𒐼'=>'4','𒐽'=>'4','𒐾'=>'4','𒐿'=>'4','𒑀'=>'6','𒑁'=>'7','𒑂'=>'7','𒑃'=>'7','𒑄'=>'8','𒑅'=>'8','𒑆'=>'9','𒑇'=>'9','𒑈'=>'9','𒑉'=>'9','𒑊'=>'2','𒑋'=>'3','𒑌'=>'4','𒑍'=>'5','𒑎'=>'6','𒑏'=>'1','𒑐'=>'2','𒑑'=>'3','𒑒'=>'4','𒑓'=>'4','𒑔'=>'5','𒑕'=>'5','𒑖'=>'𒑖','𒑗'=>'𒑗','𒑘'=>'1','𒑙'=>'2','𒑚'=>'1/3','𒑛'=>'2/3','𒑜'=>'5/6','𒑝'=>'1/3','𒑞'=>'2/3','𒑟'=>'1/8','𒑠'=>'1/4','𒑡'=>'1/6','𒑢'=>'1/4');
diff --git a/phpBB/includes/utf/data/search_indexer_4.php b/phpBB/includes/utf/data/search_indexer_4.php
index 51acbff1c2..6697501a89 100644
--- a/phpBB/includes/utf/data/search_indexer_4.php
+++ b/phpBB/includes/utf/data/search_indexer_4.php
@@ -1 +1 @@
-<?php return array('⁰'=>'0','ⁱ'=>'ⁱ','⁴'=>'4','⁵'=>'5','⁶'=>'6','⁷'=>'7','⁸'=>'8','⁹'=>'9','ⁿ'=>'ⁿ','₀'=>'0','₁'=>'1','₂'=>'2','₃'=>'3','₄'=>'4','₅'=>'5','₆'=>'6','₇'=>'7','₈'=>'8','₉'=>'9','ₐ'=>'ₐ','ₑ'=>'ₑ','ₒ'=>'ₒ','ₓ'=>'ₓ','ₔ'=>'ₔ','⃐'=>'⃐','⃑'=>'⃑','⃒'=>'⃒','⃓'=>'⃓','⃔'=>'⃔','⃕'=>'⃕','⃖'=>'⃖','⃗'=>'⃗','⃘'=>'⃘','⃙'=>'⃙','⃚'=>'⃚','⃛'=>'⃛','⃜'=>'⃜','⃝'=>'⃝','⃞'=>'⃞','⃟'=>'⃟','⃠'=>'⃠','⃡'=>'⃡','⃢'=>'⃢','⃣'=>'⃣','⃤'=>'⃤','⃥'=>'⃥','⃦'=>'⃦','⃧'=>'⃧','⃨'=>'⃨','⃩'=>'⃩','⃪'=>'⃪','⃫'=>'⃫','⃬'=>'⃬','⃭'=>'⃭','⃮'=>'⃮','⃯'=>'⃯','ℂ'=>'ℂ','ℇ'=>'ℇ','ℊ'=>'ℊ','ℋ'=>'ℋ','ℌ'=>'ℌ','ℍ'=>'ℍ','ℎ'=>'ℎ','ℏ'=>'ℏ','ℐ'=>'ℐ','ℑ'=>'ℑ','ℒ'=>'ℒ','ℓ'=>'ℓ','ℕ'=>'ℕ','ℙ'=>'ℙ','ℚ'=>'ℚ','ℛ'=>'ℛ','ℜ'=>'ℜ','ℝ'=>'ℝ','ℤ'=>'ℤ','Ω'=>'ω','ℨ'=>'ℨ','K'=>'k','Å'=>'å','ℬ'=>'ℬ','ℭ'=>'ℭ','ℯ'=>'ℯ','ℰ'=>'ℰ','ℱ'=>'ℱ','Ⅎ'=>'ⅎ','ℳ'=>'ℳ','ℴ'=>'ℴ','ℵ'=>'ℵ','ℶ'=>'ℶ','ℷ'=>'ℷ','ℸ'=>'ℸ','ℹ'=>'ℹ','ℼ'=>'ℼ','ℽ'=>'ℽ','ℾ'=>'ℾ','ℿ'=>'ℿ','ⅅ'=>'ⅅ','ⅆ'=>'ⅆ','ⅇ'=>'ⅇ','ⅈ'=>'ⅈ','ⅉ'=>'ⅉ','ⅎ'=>'ⅎ','⅓'=>'1/3','⅔'=>'2/3','⅕'=>'1/5','⅖'=>'2/5','⅗'=>'3/5','⅘'=>'4/5','⅙'=>'1/6','⅚'=>'5/6','⅛'=>'1/8','⅜'=>'3/8','⅝'=>'5/8','⅞'=>'7/8','⅟'=>'1','Ⅰ'=>'1','Ⅱ'=>'2','Ⅲ'=>'3','Ⅳ'=>'4','Ⅴ'=>'5','Ⅵ'=>'6','Ⅶ'=>'7','Ⅷ'=>'8','Ⅸ'=>'9','Ⅹ'=>'10','Ⅺ'=>'11','Ⅻ'=>'12','Ⅼ'=>'50','Ⅽ'=>'100','Ⅾ'=>'500','Ⅿ'=>'1000','ⅰ'=>'1','ⅱ'=>'2','ⅲ'=>'3','ⅳ'=>'4','ⅴ'=>'5','ⅵ'=>'6','ⅶ'=>'7','ⅷ'=>'8','ⅸ'=>'9','ⅹ'=>'10','ⅺ'=>'11','ⅻ'=>'12','ⅼ'=>'50','ⅽ'=>'100','ⅾ'=>'500','ⅿ'=>'1000','ↀ'=>'1000','ↁ'=>'5000','ↂ'=>'10000','Ↄ'=>'ↄ','ↄ'=>'ↄ','①'=>'1','②'=>'2','③'=>'3','④'=>'4','⑤'=>'5','⑥'=>'6','⑦'=>'7','⑧'=>'8','⑨'=>'9','⑩'=>'10','⑪'=>'11','⑫'=>'12','⑬'=>'13','⑭'=>'14','⑮'=>'15','⑯'=>'16','⑰'=>'17','⑱'=>'18','⑲'=>'19','⑳'=>'20','⑴'=>'1','⑵'=>'2','⑶'=>'3','⑷'=>'4','⑸'=>'5','⑹'=>'6','⑺'=>'7','⑻'=>'8','⑼'=>'9','⑽'=>'10','⑾'=>'11','⑿'=>'12','⒀'=>'13','⒁'=>'14','⒂'=>'15','⒃'=>'16','⒄'=>'17','⒅'=>'18','⒆'=>'19','⒇'=>'20','⒈'=>'1','⒉'=>'2','⒊'=>'3','⒋'=>'4','⒌'=>'5','⒍'=>'6','⒎'=>'7','⒏'=>'8','⒐'=>'9','⒑'=>'10','⒒'=>'11','⒓'=>'12','⒔'=>'13','⒕'=>'14','⒖'=>'15','⒗'=>'16','⒘'=>'17','⒙'=>'18','⒚'=>'19','⒛'=>'20','⓪'=>'0','⓫'=>'11','⓬'=>'12','⓭'=>'13','⓮'=>'14','⓯'=>'15','⓰'=>'16','⓱'=>'17','⓲'=>'18','⓳'=>'19','⓴'=>'20','⓵'=>'1','⓶'=>'2','⓷'=>'3','⓸'=>'4','⓹'=>'5','⓺'=>'6','⓻'=>'7','⓼'=>'8','⓽'=>'9','⓾'=>'10','⓿'=>'0','❶'=>'1','❷'=>'2','❸'=>'3','❹'=>'4','❺'=>'5','❻'=>'6','❼'=>'7','❽'=>'8','❾'=>'9','❿'=>'10','➀'=>'1','➁'=>'2','➂'=>'3','➃'=>'4','➄'=>'5','➅'=>'6','➆'=>'7','➇'=>'8','➈'=>'9','➉'=>'10','➊'=>'1','➋'=>'2','➌'=>'3','➍'=>'4','➎'=>'5','➏'=>'6','➐'=>'7','➑'=>'8','➒'=>'9','➓'=>'10'); \ No newline at end of file
+<?php return array('⁰'=>'0','ⁱ'=>'ⁱ','⁴'=>'4','⁵'=>'5','⁶'=>'6','⁷'=>'7','⁸'=>'8','⁹'=>'9','ⁿ'=>'ⁿ','₀'=>'0','₁'=>'1','₂'=>'2','₃'=>'3','₄'=>'4','₅'=>'5','₆'=>'6','₇'=>'7','₈'=>'8','₉'=>'9','ₐ'=>'ₐ','ₑ'=>'ₑ','ₒ'=>'ₒ','ₓ'=>'ₓ','ₔ'=>'ₔ','⃐'=>'⃐','⃑'=>'⃑','⃒'=>'⃒','⃓'=>'⃓','⃔'=>'⃔','⃕'=>'⃕','⃖'=>'⃖','⃗'=>'⃗','⃘'=>'⃘','⃙'=>'⃙','⃚'=>'⃚','⃛'=>'⃛','⃜'=>'⃜','⃝'=>'⃝','⃞'=>'⃞','⃟'=>'⃟','⃠'=>'⃠','⃡'=>'⃡','⃢'=>'⃢','⃣'=>'⃣','⃤'=>'⃤','⃥'=>'⃥','⃦'=>'⃦','⃧'=>'⃧','⃨'=>'⃨','⃩'=>'⃩','⃪'=>'⃪','⃫'=>'⃫','⃬'=>'⃬','⃭'=>'⃭','⃮'=>'⃮','⃯'=>'⃯','ℂ'=>'ℂ','ℇ'=>'ℇ','ℊ'=>'ℊ','ℋ'=>'ℋ','ℌ'=>'ℌ','ℍ'=>'ℍ','ℎ'=>'ℎ','ℏ'=>'ℏ','ℐ'=>'ℐ','ℑ'=>'ℑ','ℒ'=>'ℒ','ℓ'=>'ℓ','ℕ'=>'ℕ','ℙ'=>'ℙ','ℚ'=>'ℚ','ℛ'=>'ℛ','ℜ'=>'ℜ','ℝ'=>'ℝ','ℤ'=>'ℤ','Ω'=>'ω','ℨ'=>'ℨ','K'=>'k','Å'=>'å','ℬ'=>'ℬ','ℭ'=>'ℭ','ℯ'=>'ℯ','ℰ'=>'ℰ','ℱ'=>'ℱ','Ⅎ'=>'ⅎ','ℳ'=>'ℳ','ℴ'=>'ℴ','ℵ'=>'ℵ','ℶ'=>'ℶ','ℷ'=>'ℷ','ℸ'=>'ℸ','ℹ'=>'ℹ','ℼ'=>'ℼ','ℽ'=>'ℽ','ℾ'=>'ℾ','ℿ'=>'ℿ','ⅅ'=>'ⅅ','ⅆ'=>'ⅆ','ⅇ'=>'ⅇ','ⅈ'=>'ⅈ','ⅉ'=>'ⅉ','ⅎ'=>'ⅎ','⅓'=>'1/3','⅔'=>'2/3','⅕'=>'1/5','⅖'=>'2/5','⅗'=>'3/5','⅘'=>'4/5','⅙'=>'1/6','⅚'=>'5/6','⅛'=>'1/8','⅜'=>'3/8','⅝'=>'5/8','⅞'=>'7/8','⅟'=>'1','Ⅰ'=>'1','Ⅱ'=>'2','Ⅲ'=>'3','Ⅳ'=>'4','Ⅴ'=>'5','Ⅵ'=>'6','Ⅶ'=>'7','Ⅷ'=>'8','Ⅸ'=>'9','Ⅹ'=>'10','Ⅺ'=>'11','Ⅻ'=>'12','Ⅼ'=>'50','Ⅽ'=>'100','Ⅾ'=>'500','Ⅿ'=>'1000','ⅰ'=>'1','ⅱ'=>'2','ⅲ'=>'3','ⅳ'=>'4','ⅴ'=>'5','ⅵ'=>'6','ⅶ'=>'7','ⅷ'=>'8','ⅸ'=>'9','ⅹ'=>'10','ⅺ'=>'11','ⅻ'=>'12','ⅼ'=>'50','ⅽ'=>'100','ⅾ'=>'500','ⅿ'=>'1000','ↀ'=>'1000','ↁ'=>'5000','ↂ'=>'10000','Ↄ'=>'ↄ','ↄ'=>'ↄ','①'=>'1','②'=>'2','③'=>'3','④'=>'4','⑤'=>'5','⑥'=>'6','⑦'=>'7','⑧'=>'8','⑨'=>'9','⑩'=>'10','⑪'=>'11','⑫'=>'12','⑬'=>'13','⑭'=>'14','⑮'=>'15','⑯'=>'16','⑰'=>'17','⑱'=>'18','⑲'=>'19','⑳'=>'20','⑴'=>'1','⑵'=>'2','⑶'=>'3','⑷'=>'4','⑸'=>'5','⑹'=>'6','⑺'=>'7','⑻'=>'8','⑼'=>'9','⑽'=>'10','⑾'=>'11','⑿'=>'12','⒀'=>'13','⒁'=>'14','⒂'=>'15','⒃'=>'16','⒄'=>'17','⒅'=>'18','⒆'=>'19','⒇'=>'20','⒈'=>'1','⒉'=>'2','⒊'=>'3','⒋'=>'4','⒌'=>'5','⒍'=>'6','⒎'=>'7','⒏'=>'8','⒐'=>'9','⒑'=>'10','⒒'=>'11','⒓'=>'12','⒔'=>'13','⒕'=>'14','⒖'=>'15','⒗'=>'16','⒘'=>'17','⒙'=>'18','⒚'=>'19','⒛'=>'20','⓪'=>'0','⓫'=>'11','⓬'=>'12','⓭'=>'13','⓮'=>'14','⓯'=>'15','⓰'=>'16','⓱'=>'17','⓲'=>'18','⓳'=>'19','⓴'=>'20','⓵'=>'1','⓶'=>'2','⓷'=>'3','⓸'=>'4','⓹'=>'5','⓺'=>'6','⓻'=>'7','⓼'=>'8','⓽'=>'9','⓾'=>'10','⓿'=>'0','❶'=>'1','❷'=>'2','❸'=>'3','❹'=>'4','❺'=>'5','❻'=>'6','❼'=>'7','❽'=>'8','❾'=>'9','❿'=>'10','➀'=>'1','➁'=>'2','➂'=>'3','➃'=>'4','➄'=>'5','➅'=>'6','➆'=>'7','➇'=>'8','➈'=>'9','➉'=>'10','➊'=>'1','➋'=>'2','➌'=>'3','➍'=>'4','➎'=>'5','➏'=>'6','➐'=>'7','➑'=>'8','➒'=>'9','➓'=>'10');
diff --git a/phpBB/includes/utf/data/search_indexer_448.php b/phpBB/includes/utf/data/search_indexer_448.php
index 32ac28a549..6cbf6643e1 100644
--- a/phpBB/includes/utf/data/search_indexer_448.php
+++ b/phpBB/includes/utf/data/search_indexer_448.php
@@ -1 +1 @@
-<?php return array('󠄀'=>'󠄀','󠄁'=>'󠄁','󠄂'=>'󠄂','󠄃'=>'󠄃','󠄄'=>'󠄄','󠄅'=>'󠄅','󠄆'=>'󠄆','󠄇'=>'󠄇','󠄈'=>'󠄈','󠄉'=>'󠄉','󠄊'=>'󠄊','󠄋'=>'󠄋','󠄌'=>'󠄌','󠄍'=>'󠄍','󠄎'=>'󠄎','󠄏'=>'󠄏','󠄐'=>'󠄐','󠄑'=>'󠄑','󠄒'=>'󠄒','󠄓'=>'󠄓','󠄔'=>'󠄔','󠄕'=>'󠄕','󠄖'=>'󠄖','󠄗'=>'󠄗','󠄘'=>'󠄘','󠄙'=>'󠄙','󠄚'=>'󠄚','󠄛'=>'󠄛','󠄜'=>'󠄜','󠄝'=>'󠄝','󠄞'=>'󠄞','󠄟'=>'󠄟','󠄠'=>'󠄠','󠄡'=>'󠄡','󠄢'=>'󠄢','󠄣'=>'󠄣','󠄤'=>'󠄤','󠄥'=>'󠄥','󠄦'=>'󠄦','󠄧'=>'󠄧','󠄨'=>'󠄨','󠄩'=>'󠄩','󠄪'=>'󠄪','󠄫'=>'󠄫','󠄬'=>'󠄬','󠄭'=>'󠄭','󠄮'=>'󠄮','󠄯'=>'󠄯','󠄰'=>'󠄰','󠄱'=>'󠄱','󠄲'=>'󠄲','󠄳'=>'󠄳','󠄴'=>'󠄴','󠄵'=>'󠄵','󠄶'=>'󠄶','󠄷'=>'󠄷','󠄸'=>'󠄸','󠄹'=>'󠄹','󠄺'=>'󠄺','󠄻'=>'󠄻','󠄼'=>'󠄼','󠄽'=>'󠄽','󠄾'=>'󠄾','󠄿'=>'󠄿','󠅀'=>'󠅀','󠅁'=>'󠅁','󠅂'=>'󠅂','󠅃'=>'󠅃','󠅄'=>'󠅄','󠅅'=>'󠅅','󠅆'=>'󠅆','󠅇'=>'󠅇','󠅈'=>'󠅈','󠅉'=>'󠅉','󠅊'=>'󠅊','󠅋'=>'󠅋','󠅌'=>'󠅌','󠅍'=>'󠅍','󠅎'=>'󠅎','󠅏'=>'󠅏','󠅐'=>'󠅐','󠅑'=>'󠅑','󠅒'=>'󠅒','󠅓'=>'󠅓','󠅔'=>'󠅔','󠅕'=>'󠅕','󠅖'=>'󠅖','󠅗'=>'󠅗','󠅘'=>'󠅘','󠅙'=>'󠅙','󠅚'=>'󠅚','󠅛'=>'󠅛','󠅜'=>'󠅜','󠅝'=>'󠅝','󠅞'=>'󠅞','󠅟'=>'󠅟','󠅠'=>'󠅠','󠅡'=>'󠅡','󠅢'=>'󠅢','󠅣'=>'󠅣','󠅤'=>'󠅤','󠅥'=>'󠅥','󠅦'=>'󠅦','󠅧'=>'󠅧','󠅨'=>'󠅨','󠅩'=>'󠅩','󠅪'=>'󠅪','󠅫'=>'󠅫','󠅬'=>'󠅬','󠅭'=>'󠅭','󠅮'=>'󠅮','󠅯'=>'󠅯','󠅰'=>'󠅰','󠅱'=>'󠅱','󠅲'=>'󠅲','󠅳'=>'󠅳','󠅴'=>'󠅴','󠅵'=>'󠅵','󠅶'=>'󠅶','󠅷'=>'󠅷','󠅸'=>'󠅸','󠅹'=>'󠅹','󠅺'=>'󠅺','󠅻'=>'󠅻','󠅼'=>'󠅼','󠅽'=>'󠅽','󠅾'=>'󠅾','󠅿'=>'󠅿','󠆀'=>'󠆀','󠆁'=>'󠆁','󠆂'=>'󠆂','󠆃'=>'󠆃','󠆄'=>'󠆄','󠆅'=>'󠆅','󠆆'=>'󠆆','󠆇'=>'󠆇','󠆈'=>'󠆈','󠆉'=>'󠆉','󠆊'=>'󠆊','󠆋'=>'󠆋','󠆌'=>'󠆌','󠆍'=>'󠆍','󠆎'=>'󠆎','󠆏'=>'󠆏','󠆐'=>'󠆐','󠆑'=>'󠆑','󠆒'=>'󠆒','󠆓'=>'󠆓','󠆔'=>'󠆔','󠆕'=>'󠆕','󠆖'=>'󠆖','󠆗'=>'󠆗','󠆘'=>'󠆘','󠆙'=>'󠆙','󠆚'=>'󠆚','󠆛'=>'󠆛','󠆜'=>'󠆜','󠆝'=>'󠆝','󠆞'=>'󠆞','󠆟'=>'󠆟','󠆠'=>'󠆠','󠆡'=>'󠆡','󠆢'=>'󠆢','󠆣'=>'󠆣','󠆤'=>'󠆤','󠆥'=>'󠆥','󠆦'=>'󠆦','󠆧'=>'󠆧','󠆨'=>'󠆨','󠆩'=>'󠆩','󠆪'=>'󠆪','󠆫'=>'󠆫','󠆬'=>'󠆬','󠆭'=>'󠆭','󠆮'=>'󠆮','󠆯'=>'󠆯','󠆰'=>'󠆰','󠆱'=>'󠆱','󠆲'=>'󠆲','󠆳'=>'󠆳','󠆴'=>'󠆴','󠆵'=>'󠆵','󠆶'=>'󠆶','󠆷'=>'󠆷','󠆸'=>'󠆸','󠆹'=>'󠆹','󠆺'=>'󠆺','󠆻'=>'󠆻','󠆼'=>'󠆼','󠆽'=>'󠆽','󠆾'=>'󠆾','󠆿'=>'󠆿','󠇀'=>'󠇀','󠇁'=>'󠇁','󠇂'=>'󠇂','󠇃'=>'󠇃','󠇄'=>'󠇄','󠇅'=>'󠇅','󠇆'=>'󠇆','󠇇'=>'󠇇','󠇈'=>'󠇈','󠇉'=>'󠇉','󠇊'=>'󠇊','󠇋'=>'󠇋','󠇌'=>'󠇌','󠇍'=>'󠇍','󠇎'=>'󠇎','󠇏'=>'󠇏','󠇐'=>'󠇐','󠇑'=>'󠇑','󠇒'=>'󠇒','󠇓'=>'󠇓','󠇔'=>'󠇔','󠇕'=>'󠇕','󠇖'=>'󠇖','󠇗'=>'󠇗','󠇘'=>'󠇘','󠇙'=>'󠇙','󠇚'=>'󠇚','󠇛'=>'󠇛','󠇜'=>'󠇜','󠇝'=>'󠇝','󠇞'=>'󠇞','󠇟'=>'󠇟','󠇠'=>'󠇠','󠇡'=>'󠇡','󠇢'=>'󠇢','󠇣'=>'󠇣','󠇤'=>'󠇤','󠇥'=>'󠇥','󠇦'=>'󠇦','󠇧'=>'󠇧','󠇨'=>'󠇨','󠇩'=>'󠇩','󠇪'=>'󠇪','󠇫'=>'󠇫','󠇬'=>'󠇬','󠇭'=>'󠇭','󠇮'=>'󠇮','󠇯'=>'󠇯'); \ No newline at end of file
+<?php return array('󠄀'=>'󠄀','󠄁'=>'󠄁','󠄂'=>'󠄂','󠄃'=>'󠄃','󠄄'=>'󠄄','󠄅'=>'󠄅','󠄆'=>'󠄆','󠄇'=>'󠄇','󠄈'=>'󠄈','󠄉'=>'󠄉','󠄊'=>'󠄊','󠄋'=>'󠄋','󠄌'=>'󠄌','󠄍'=>'󠄍','󠄎'=>'󠄎','󠄏'=>'󠄏','󠄐'=>'󠄐','󠄑'=>'󠄑','󠄒'=>'󠄒','󠄓'=>'󠄓','󠄔'=>'󠄔','󠄕'=>'󠄕','󠄖'=>'󠄖','󠄗'=>'󠄗','󠄘'=>'󠄘','󠄙'=>'󠄙','󠄚'=>'󠄚','󠄛'=>'󠄛','󠄜'=>'󠄜','󠄝'=>'󠄝','󠄞'=>'󠄞','󠄟'=>'󠄟','󠄠'=>'󠄠','󠄡'=>'󠄡','󠄢'=>'󠄢','󠄣'=>'󠄣','󠄤'=>'󠄤','󠄥'=>'󠄥','󠄦'=>'󠄦','󠄧'=>'󠄧','󠄨'=>'󠄨','󠄩'=>'󠄩','󠄪'=>'󠄪','󠄫'=>'󠄫','󠄬'=>'󠄬','󠄭'=>'󠄭','󠄮'=>'󠄮','󠄯'=>'󠄯','󠄰'=>'󠄰','󠄱'=>'󠄱','󠄲'=>'󠄲','󠄳'=>'󠄳','󠄴'=>'󠄴','󠄵'=>'󠄵','󠄶'=>'󠄶','󠄷'=>'󠄷','󠄸'=>'󠄸','󠄹'=>'󠄹','󠄺'=>'󠄺','󠄻'=>'󠄻','󠄼'=>'󠄼','󠄽'=>'󠄽','󠄾'=>'󠄾','󠄿'=>'󠄿','󠅀'=>'󠅀','󠅁'=>'󠅁','󠅂'=>'󠅂','󠅃'=>'󠅃','󠅄'=>'󠅄','󠅅'=>'󠅅','󠅆'=>'󠅆','󠅇'=>'󠅇','󠅈'=>'󠅈','󠅉'=>'󠅉','󠅊'=>'󠅊','󠅋'=>'󠅋','󠅌'=>'󠅌','󠅍'=>'󠅍','󠅎'=>'󠅎','󠅏'=>'󠅏','󠅐'=>'󠅐','󠅑'=>'󠅑','󠅒'=>'󠅒','󠅓'=>'󠅓','󠅔'=>'󠅔','󠅕'=>'󠅕','󠅖'=>'󠅖','󠅗'=>'󠅗','󠅘'=>'󠅘','󠅙'=>'󠅙','󠅚'=>'󠅚','󠅛'=>'󠅛','󠅜'=>'󠅜','󠅝'=>'󠅝','󠅞'=>'󠅞','󠅟'=>'󠅟','󠅠'=>'󠅠','󠅡'=>'󠅡','󠅢'=>'󠅢','󠅣'=>'󠅣','󠅤'=>'󠅤','󠅥'=>'󠅥','󠅦'=>'󠅦','󠅧'=>'󠅧','󠅨'=>'󠅨','󠅩'=>'󠅩','󠅪'=>'󠅪','󠅫'=>'󠅫','󠅬'=>'󠅬','󠅭'=>'󠅭','󠅮'=>'󠅮','󠅯'=>'󠅯','󠅰'=>'󠅰','󠅱'=>'󠅱','󠅲'=>'󠅲','󠅳'=>'󠅳','󠅴'=>'󠅴','󠅵'=>'󠅵','󠅶'=>'󠅶','󠅷'=>'󠅷','󠅸'=>'󠅸','󠅹'=>'󠅹','󠅺'=>'󠅺','󠅻'=>'󠅻','󠅼'=>'󠅼','󠅽'=>'󠅽','󠅾'=>'󠅾','󠅿'=>'󠅿','󠆀'=>'󠆀','󠆁'=>'󠆁','󠆂'=>'󠆂','󠆃'=>'󠆃','󠆄'=>'󠆄','󠆅'=>'󠆅','󠆆'=>'󠆆','󠆇'=>'󠆇','󠆈'=>'󠆈','󠆉'=>'󠆉','󠆊'=>'󠆊','󠆋'=>'󠆋','󠆌'=>'󠆌','󠆍'=>'󠆍','󠆎'=>'󠆎','󠆏'=>'󠆏','󠆐'=>'󠆐','󠆑'=>'󠆑','󠆒'=>'󠆒','󠆓'=>'󠆓','󠆔'=>'󠆔','󠆕'=>'󠆕','󠆖'=>'󠆖','󠆗'=>'󠆗','󠆘'=>'󠆘','󠆙'=>'󠆙','󠆚'=>'󠆚','󠆛'=>'󠆛','󠆜'=>'󠆜','󠆝'=>'󠆝','󠆞'=>'󠆞','󠆟'=>'󠆟','󠆠'=>'󠆠','󠆡'=>'󠆡','󠆢'=>'󠆢','󠆣'=>'󠆣','󠆤'=>'󠆤','󠆥'=>'󠆥','󠆦'=>'󠆦','󠆧'=>'󠆧','󠆨'=>'󠆨','󠆩'=>'󠆩','󠆪'=>'󠆪','󠆫'=>'󠆫','󠆬'=>'󠆬','󠆭'=>'󠆭','󠆮'=>'󠆮','󠆯'=>'󠆯','󠆰'=>'󠆰','󠆱'=>'󠆱','󠆲'=>'󠆲','󠆳'=>'󠆳','󠆴'=>'󠆴','󠆵'=>'󠆵','󠆶'=>'󠆶','󠆷'=>'󠆷','󠆸'=>'󠆸','󠆹'=>'󠆹','󠆺'=>'󠆺','󠆻'=>'󠆻','󠆼'=>'󠆼','󠆽'=>'󠆽','󠆾'=>'󠆾','󠆿'=>'󠆿','󠇀'=>'󠇀','󠇁'=>'󠇁','󠇂'=>'󠇂','󠇃'=>'󠇃','󠇄'=>'󠇄','󠇅'=>'󠇅','󠇆'=>'󠇆','󠇇'=>'󠇇','󠇈'=>'󠇈','󠇉'=>'󠇉','󠇊'=>'󠇊','󠇋'=>'󠇋','󠇌'=>'󠇌','󠇍'=>'󠇍','󠇎'=>'󠇎','󠇏'=>'󠇏','󠇐'=>'󠇐','󠇑'=>'󠇑','󠇒'=>'󠇒','󠇓'=>'󠇓','󠇔'=>'󠇔','󠇕'=>'󠇕','󠇖'=>'󠇖','󠇗'=>'󠇗','󠇘'=>'󠇘','󠇙'=>'󠇙','󠇚'=>'󠇚','󠇛'=>'󠇛','󠇜'=>'󠇜','󠇝'=>'󠇝','󠇞'=>'󠇞','󠇟'=>'󠇟','󠇠'=>'󠇠','󠇡'=>'󠇡','󠇢'=>'󠇢','󠇣'=>'󠇣','󠇤'=>'󠇤','󠇥'=>'󠇥','󠇦'=>'󠇦','󠇧'=>'󠇧','󠇨'=>'󠇨','󠇩'=>'󠇩','󠇪'=>'󠇪','󠇫'=>'󠇫','󠇬'=>'󠇬','󠇭'=>'󠇭','󠇮'=>'󠇮','󠇯'=>'󠇯');
diff --git a/phpBB/includes/utf/data/search_indexer_5.php b/phpBB/includes/utf/data/search_indexer_5.php
index 0f1228a394..cef8fe91fc 100644
--- a/phpBB/includes/utf/data/search_indexer_5.php
+++ b/phpBB/includes/utf/data/search_indexer_5.php
@@ -1 +1 @@
-<?php return array('Ⰰ'=>'ⰰ','Ⰱ'=>'ⰱ','Ⰲ'=>'ⰲ','Ⰳ'=>'ⰳ','Ⰴ'=>'ⰴ','Ⰵ'=>'ⰵ','Ⰶ'=>'ⰶ','Ⰷ'=>'ⰷ','Ⰸ'=>'ⰸ','Ⰹ'=>'ⰹ','Ⰺ'=>'ⰺ','Ⰻ'=>'ⰻ','Ⰼ'=>'ⰼ','Ⰽ'=>'ⰽ','Ⰾ'=>'ⰾ','Ⰿ'=>'ⰿ','Ⱀ'=>'ⱀ','Ⱁ'=>'ⱁ','Ⱂ'=>'ⱂ','Ⱃ'=>'ⱃ','Ⱄ'=>'ⱄ','Ⱅ'=>'ⱅ','Ⱆ'=>'ⱆ','Ⱇ'=>'ⱇ','Ⱈ'=>'ⱈ','Ⱉ'=>'ⱉ','Ⱊ'=>'ⱊ','Ⱋ'=>'ⱋ','Ⱌ'=>'ⱌ','Ⱍ'=>'ⱍ','Ⱎ'=>'ⱎ','Ⱏ'=>'ⱏ','Ⱐ'=>'ⱐ','Ⱑ'=>'ⱑ','Ⱒ'=>'ⱒ','Ⱓ'=>'ⱓ','Ⱔ'=>'ⱔ','Ⱕ'=>'ⱕ','Ⱖ'=>'ⱖ','Ⱗ'=>'ⱗ','Ⱘ'=>'ⱘ','Ⱙ'=>'ⱙ','Ⱚ'=>'ⱚ','Ⱛ'=>'ⱛ','Ⱜ'=>'ⱜ','Ⱝ'=>'ⱝ','Ⱞ'=>'ⱞ','ⰰ'=>'ⰰ','ⰱ'=>'ⰱ','ⰲ'=>'ⰲ','ⰳ'=>'ⰳ','ⰴ'=>'ⰴ','ⰵ'=>'ⰵ','ⰶ'=>'ⰶ','ⰷ'=>'ⰷ','ⰸ'=>'ⰸ','ⰹ'=>'ⰹ','ⰺ'=>'ⰺ','ⰻ'=>'ⰻ','ⰼ'=>'ⰼ','ⰽ'=>'ⰽ','ⰾ'=>'ⰾ','ⰿ'=>'ⰿ','ⱀ'=>'ⱀ','ⱁ'=>'ⱁ','ⱂ'=>'ⱂ','ⱃ'=>'ⱃ','ⱄ'=>'ⱄ','ⱅ'=>'ⱅ','ⱆ'=>'ⱆ','ⱇ'=>'ⱇ','ⱈ'=>'ⱈ','ⱉ'=>'ⱉ','ⱊ'=>'ⱊ','ⱋ'=>'ⱋ','ⱌ'=>'ⱌ','ⱍ'=>'ⱍ','ⱎ'=>'ⱎ','ⱏ'=>'ⱏ','ⱐ'=>'ⱐ','ⱑ'=>'ⱑ','ⱒ'=>'ⱒ','ⱓ'=>'ⱓ','ⱔ'=>'ⱔ','ⱕ'=>'ⱕ','ⱖ'=>'ⱖ','ⱗ'=>'ⱗ','ⱘ'=>'ⱘ','ⱙ'=>'ⱙ','ⱚ'=>'ⱚ','ⱛ'=>'ⱛ','ⱜ'=>'ⱜ','ⱝ'=>'ⱝ','ⱞ'=>'ⱞ','Ⱡ'=>'ⱡ','ⱡ'=>'ⱡ','Ɫ'=>'ɫ','Ᵽ'=>'ᵽ','Ɽ'=>'ɽ','ⱥ'=>'ⱥ','ⱦ'=>'ⱦ','Ⱨ'=>'ⱨ','ⱨ'=>'ⱨ','Ⱪ'=>'ⱪ','ⱪ'=>'ⱪ','Ⱬ'=>'ⱬ','ⱬ'=>'ⱬ','ⱴ'=>'ⱴ','Ⱶ'=>'ⱶ','ⱶ'=>'ⱶ','ⱷ'=>'ⱷ','Ⲁ'=>'ⲁ','ⲁ'=>'ⲁ','Ⲃ'=>'ⲃ','ⲃ'=>'ⲃ','Ⲅ'=>'ⲅ','ⲅ'=>'ⲅ','Ⲇ'=>'ⲇ','ⲇ'=>'ⲇ','Ⲉ'=>'ⲉ','ⲉ'=>'ⲉ','Ⲋ'=>'ⲋ','ⲋ'=>'ⲋ','Ⲍ'=>'ⲍ','ⲍ'=>'ⲍ','Ⲏ'=>'ⲏ','ⲏ'=>'ⲏ','Ⲑ'=>'ⲑ','ⲑ'=>'ⲑ','Ⲓ'=>'ⲓ','ⲓ'=>'ⲓ','Ⲕ'=>'ⲕ','ⲕ'=>'ⲕ','Ⲗ'=>'ⲗ','ⲗ'=>'ⲗ','Ⲙ'=>'ⲙ','ⲙ'=>'ⲙ','Ⲛ'=>'ⲛ','ⲛ'=>'ⲛ','Ⲝ'=>'ⲝ','ⲝ'=>'ⲝ','Ⲟ'=>'ⲟ','ⲟ'=>'ⲟ','Ⲡ'=>'ⲡ','ⲡ'=>'ⲡ','Ⲣ'=>'ⲣ','ⲣ'=>'ⲣ','Ⲥ'=>'ⲥ','ⲥ'=>'ⲥ','Ⲧ'=>'ⲧ','ⲧ'=>'ⲧ','Ⲩ'=>'ⲩ','ⲩ'=>'ⲩ','Ⲫ'=>'ⲫ','ⲫ'=>'ⲫ','Ⲭ'=>'ⲭ','ⲭ'=>'ⲭ','Ⲯ'=>'ⲯ','ⲯ'=>'ⲯ','Ⲱ'=>'ⲱ','ⲱ'=>'ⲱ','Ⲳ'=>'ⲳ','ⲳ'=>'ⲳ','Ⲵ'=>'ⲵ','ⲵ'=>'ⲵ','Ⲷ'=>'ⲷ','ⲷ'=>'ⲷ','Ⲹ'=>'ⲹ','ⲹ'=>'ⲹ','Ⲻ'=>'ⲻ','ⲻ'=>'ⲻ','Ⲽ'=>'ⲽ','ⲽ'=>'ⲽ','Ⲿ'=>'ⲿ','ⲿ'=>'ⲿ','Ⳁ'=>'ⳁ','ⳁ'=>'ⳁ','Ⳃ'=>'ⳃ','ⳃ'=>'ⳃ','Ⳅ'=>'ⳅ','ⳅ'=>'ⳅ','Ⳇ'=>'ⳇ','ⳇ'=>'ⳇ','Ⳉ'=>'ⳉ','ⳉ'=>'ⳉ','Ⳋ'=>'ⳋ','ⳋ'=>'ⳋ','Ⳍ'=>'ⳍ','ⳍ'=>'ⳍ','Ⳏ'=>'ⳏ','ⳏ'=>'ⳏ','Ⳑ'=>'ⳑ','ⳑ'=>'ⳑ','Ⳓ'=>'ⳓ','ⳓ'=>'ⳓ','Ⳕ'=>'ⳕ','ⳕ'=>'ⳕ','Ⳗ'=>'ⳗ','ⳗ'=>'ⳗ','Ⳙ'=>'ⳙ','ⳙ'=>'ⳙ','Ⳛ'=>'ⳛ','ⳛ'=>'ⳛ','Ⳝ'=>'ⳝ','ⳝ'=>'ⳝ','Ⳟ'=>'ⳟ','ⳟ'=>'ⳟ','Ⳡ'=>'ⳡ','ⳡ'=>'ⳡ','Ⳣ'=>'ⳣ','ⳣ'=>'ⳣ','ⳤ'=>'ⳤ','⳽'=>'1/2','ⴀ'=>'ⴀ','ⴁ'=>'ⴁ','ⴂ'=>'ⴂ','ⴃ'=>'ⴃ','ⴄ'=>'ⴄ','ⴅ'=>'ⴅ','ⴆ'=>'ⴆ','ⴇ'=>'ⴇ','ⴈ'=>'ⴈ','ⴉ'=>'ⴉ','ⴊ'=>'ⴊ','ⴋ'=>'ⴋ','ⴌ'=>'ⴌ','ⴍ'=>'ⴍ','ⴎ'=>'ⴎ','ⴏ'=>'ⴏ','ⴐ'=>'ⴐ','ⴑ'=>'ⴑ','ⴒ'=>'ⴒ','ⴓ'=>'ⴓ','ⴔ'=>'ⴔ','ⴕ'=>'ⴕ','ⴖ'=>'ⴖ','ⴗ'=>'ⴗ','ⴘ'=>'ⴘ','ⴙ'=>'ⴙ','ⴚ'=>'ⴚ','ⴛ'=>'ⴛ','ⴜ'=>'ⴜ','ⴝ'=>'ⴝ','ⴞ'=>'ⴞ','ⴟ'=>'ⴟ','ⴠ'=>'ⴠ','ⴡ'=>'ⴡ','ⴢ'=>'ⴢ','ⴣ'=>'ⴣ','ⴤ'=>'ⴤ','ⴥ'=>'ⴥ','ⴰ'=>'ⴰ','ⴱ'=>'ⴱ','ⴲ'=>'ⴲ','ⴳ'=>'ⴳ','ⴴ'=>'ⴴ','ⴵ'=>'ⴵ','ⴶ'=>'ⴶ','ⴷ'=>'ⴷ','ⴸ'=>'ⴸ','ⴹ'=>'ⴹ','ⴺ'=>'ⴺ','ⴻ'=>'ⴻ','ⴼ'=>'ⴼ','ⴽ'=>'ⴽ','ⴾ'=>'ⴾ','ⴿ'=>'ⴿ','ⵀ'=>'ⵀ','ⵁ'=>'ⵁ','ⵂ'=>'ⵂ','ⵃ'=>'ⵃ','ⵄ'=>'ⵄ','ⵅ'=>'ⵅ','ⵆ'=>'ⵆ','ⵇ'=>'ⵇ','ⵈ'=>'ⵈ','ⵉ'=>'ⵉ','ⵊ'=>'ⵊ','ⵋ'=>'ⵋ','ⵌ'=>'ⵌ','ⵍ'=>'ⵍ','ⵎ'=>'ⵎ','ⵏ'=>'ⵏ','ⵐ'=>'ⵐ','ⵑ'=>'ⵑ','ⵒ'=>'ⵒ','ⵓ'=>'ⵓ','ⵔ'=>'ⵔ','ⵕ'=>'ⵕ','ⵖ'=>'ⵖ','ⵗ'=>'ⵗ','ⵘ'=>'ⵘ','ⵙ'=>'ⵙ','ⵚ'=>'ⵚ','ⵛ'=>'ⵛ','ⵜ'=>'ⵜ','ⵝ'=>'ⵝ','ⵞ'=>'ⵞ','ⵟ'=>'ⵟ','ⵠ'=>'ⵠ','ⵡ'=>'ⵡ','ⵢ'=>'ⵢ','ⵣ'=>'ⵣ','ⵤ'=>'ⵤ','ⵥ'=>'ⵥ','ⵯ'=>'ⵯ','ⶀ'=>'ⶀ','ⶁ'=>'ⶁ','ⶂ'=>'ⶂ','ⶃ'=>'ⶃ','ⶄ'=>'ⶄ','ⶅ'=>'ⶅ','ⶆ'=>'ⶆ','ⶇ'=>'ⶇ','ⶈ'=>'ⶈ','ⶉ'=>'ⶉ','ⶊ'=>'ⶊ','ⶋ'=>'ⶋ','ⶌ'=>'ⶌ','ⶍ'=>'ⶍ','ⶎ'=>'ⶎ','ⶏ'=>'ⶏ','ⶐ'=>'ⶐ','ⶑ'=>'ⶑ','ⶒ'=>'ⶒ','ⶓ'=>'ⶓ','ⶔ'=>'ⶔ','ⶕ'=>'ⶕ','ⶖ'=>'ⶖ','ⶠ'=>'ⶠ','ⶡ'=>'ⶡ','ⶢ'=>'ⶢ','ⶣ'=>'ⶣ','ⶤ'=>'ⶤ','ⶥ'=>'ⶥ','ⶦ'=>'ⶦ','ⶨ'=>'ⶨ','ⶩ'=>'ⶩ','ⶪ'=>'ⶪ','ⶫ'=>'ⶫ','ⶬ'=>'ⶬ','ⶭ'=>'ⶭ','ⶮ'=>'ⶮ','ⶰ'=>'ⶰ','ⶱ'=>'ⶱ','ⶲ'=>'ⶲ','ⶳ'=>'ⶳ','ⶴ'=>'ⶴ','ⶵ'=>'ⶵ','ⶶ'=>'ⶶ','ⶸ'=>'ⶸ','ⶹ'=>'ⶹ','ⶺ'=>'ⶺ','ⶻ'=>'ⶻ','ⶼ'=>'ⶼ','ⶽ'=>'ⶽ','ⶾ'=>'ⶾ','ⷀ'=>'ⷀ','ⷁ'=>'ⷁ','ⷂ'=>'ⷂ','ⷃ'=>'ⷃ','ⷄ'=>'ⷄ','ⷅ'=>'ⷅ','ⷆ'=>'ⷆ','ⷈ'=>'ⷈ','ⷉ'=>'ⷉ','ⷊ'=>'ⷊ','ⷋ'=>'ⷋ','ⷌ'=>'ⷌ','ⷍ'=>'ⷍ','ⷎ'=>'ⷎ','ⷐ'=>'ⷐ','ⷑ'=>'ⷑ','ⷒ'=>'ⷒ','ⷓ'=>'ⷓ','ⷔ'=>'ⷔ','ⷕ'=>'ⷕ','ⷖ'=>'ⷖ','ⷘ'=>'ⷘ','ⷙ'=>'ⷙ','ⷚ'=>'ⷚ','ⷛ'=>'ⷛ','ⷜ'=>'ⷜ','ⷝ'=>'ⷝ','ⷞ'=>'ⷞ'); \ No newline at end of file
+<?php return array('Ⰰ'=>'ⰰ','Ⰱ'=>'ⰱ','Ⰲ'=>'ⰲ','Ⰳ'=>'ⰳ','Ⰴ'=>'ⰴ','Ⰵ'=>'ⰵ','Ⰶ'=>'ⰶ','Ⰷ'=>'ⰷ','Ⰸ'=>'ⰸ','Ⰹ'=>'ⰹ','Ⰺ'=>'ⰺ','Ⰻ'=>'ⰻ','Ⰼ'=>'ⰼ','Ⰽ'=>'ⰽ','Ⰾ'=>'ⰾ','Ⰿ'=>'ⰿ','Ⱀ'=>'ⱀ','Ⱁ'=>'ⱁ','Ⱂ'=>'ⱂ','Ⱃ'=>'ⱃ','Ⱄ'=>'ⱄ','Ⱅ'=>'ⱅ','Ⱆ'=>'ⱆ','Ⱇ'=>'ⱇ','Ⱈ'=>'ⱈ','Ⱉ'=>'ⱉ','Ⱊ'=>'ⱊ','Ⱋ'=>'ⱋ','Ⱌ'=>'ⱌ','Ⱍ'=>'ⱍ','Ⱎ'=>'ⱎ','Ⱏ'=>'ⱏ','Ⱐ'=>'ⱐ','Ⱑ'=>'ⱑ','Ⱒ'=>'ⱒ','Ⱓ'=>'ⱓ','Ⱔ'=>'ⱔ','Ⱕ'=>'ⱕ','Ⱖ'=>'ⱖ','Ⱗ'=>'ⱗ','Ⱘ'=>'ⱘ','Ⱙ'=>'ⱙ','Ⱚ'=>'ⱚ','Ⱛ'=>'ⱛ','Ⱜ'=>'ⱜ','Ⱝ'=>'ⱝ','Ⱞ'=>'ⱞ','ⰰ'=>'ⰰ','ⰱ'=>'ⰱ','ⰲ'=>'ⰲ','ⰳ'=>'ⰳ','ⰴ'=>'ⰴ','ⰵ'=>'ⰵ','ⰶ'=>'ⰶ','ⰷ'=>'ⰷ','ⰸ'=>'ⰸ','ⰹ'=>'ⰹ','ⰺ'=>'ⰺ','ⰻ'=>'ⰻ','ⰼ'=>'ⰼ','ⰽ'=>'ⰽ','ⰾ'=>'ⰾ','ⰿ'=>'ⰿ','ⱀ'=>'ⱀ','ⱁ'=>'ⱁ','ⱂ'=>'ⱂ','ⱃ'=>'ⱃ','ⱄ'=>'ⱄ','ⱅ'=>'ⱅ','ⱆ'=>'ⱆ','ⱇ'=>'ⱇ','ⱈ'=>'ⱈ','ⱉ'=>'ⱉ','ⱊ'=>'ⱊ','ⱋ'=>'ⱋ','ⱌ'=>'ⱌ','ⱍ'=>'ⱍ','ⱎ'=>'ⱎ','ⱏ'=>'ⱏ','ⱐ'=>'ⱐ','ⱑ'=>'ⱑ','ⱒ'=>'ⱒ','ⱓ'=>'ⱓ','ⱔ'=>'ⱔ','ⱕ'=>'ⱕ','ⱖ'=>'ⱖ','ⱗ'=>'ⱗ','ⱘ'=>'ⱘ','ⱙ'=>'ⱙ','ⱚ'=>'ⱚ','ⱛ'=>'ⱛ','ⱜ'=>'ⱜ','ⱝ'=>'ⱝ','ⱞ'=>'ⱞ','Ⱡ'=>'ⱡ','ⱡ'=>'ⱡ','Ɫ'=>'ɫ','Ᵽ'=>'ᵽ','Ɽ'=>'ɽ','ⱥ'=>'ⱥ','ⱦ'=>'ⱦ','Ⱨ'=>'ⱨ','ⱨ'=>'ⱨ','Ⱪ'=>'ⱪ','ⱪ'=>'ⱪ','Ⱬ'=>'ⱬ','ⱬ'=>'ⱬ','ⱴ'=>'ⱴ','Ⱶ'=>'ⱶ','ⱶ'=>'ⱶ','ⱷ'=>'ⱷ','Ⲁ'=>'ⲁ','ⲁ'=>'ⲁ','Ⲃ'=>'ⲃ','ⲃ'=>'ⲃ','Ⲅ'=>'ⲅ','ⲅ'=>'ⲅ','Ⲇ'=>'ⲇ','ⲇ'=>'ⲇ','Ⲉ'=>'ⲉ','ⲉ'=>'ⲉ','Ⲋ'=>'ⲋ','ⲋ'=>'ⲋ','Ⲍ'=>'ⲍ','ⲍ'=>'ⲍ','Ⲏ'=>'ⲏ','ⲏ'=>'ⲏ','Ⲑ'=>'ⲑ','ⲑ'=>'ⲑ','Ⲓ'=>'ⲓ','ⲓ'=>'ⲓ','Ⲕ'=>'ⲕ','ⲕ'=>'ⲕ','Ⲗ'=>'ⲗ','ⲗ'=>'ⲗ','Ⲙ'=>'ⲙ','ⲙ'=>'ⲙ','Ⲛ'=>'ⲛ','ⲛ'=>'ⲛ','Ⲝ'=>'ⲝ','ⲝ'=>'ⲝ','Ⲟ'=>'ⲟ','ⲟ'=>'ⲟ','Ⲡ'=>'ⲡ','ⲡ'=>'ⲡ','Ⲣ'=>'ⲣ','ⲣ'=>'ⲣ','Ⲥ'=>'ⲥ','ⲥ'=>'ⲥ','Ⲧ'=>'ⲧ','ⲧ'=>'ⲧ','Ⲩ'=>'ⲩ','ⲩ'=>'ⲩ','Ⲫ'=>'ⲫ','ⲫ'=>'ⲫ','Ⲭ'=>'ⲭ','ⲭ'=>'ⲭ','Ⲯ'=>'ⲯ','ⲯ'=>'ⲯ','Ⲱ'=>'ⲱ','ⲱ'=>'ⲱ','Ⲳ'=>'ⲳ','ⲳ'=>'ⲳ','Ⲵ'=>'ⲵ','ⲵ'=>'ⲵ','Ⲷ'=>'ⲷ','ⲷ'=>'ⲷ','Ⲹ'=>'ⲹ','ⲹ'=>'ⲹ','Ⲻ'=>'ⲻ','ⲻ'=>'ⲻ','Ⲽ'=>'ⲽ','ⲽ'=>'ⲽ','Ⲿ'=>'ⲿ','ⲿ'=>'ⲿ','Ⳁ'=>'ⳁ','ⳁ'=>'ⳁ','Ⳃ'=>'ⳃ','ⳃ'=>'ⳃ','Ⳅ'=>'ⳅ','ⳅ'=>'ⳅ','Ⳇ'=>'ⳇ','ⳇ'=>'ⳇ','Ⳉ'=>'ⳉ','ⳉ'=>'ⳉ','Ⳋ'=>'ⳋ','ⳋ'=>'ⳋ','Ⳍ'=>'ⳍ','ⳍ'=>'ⳍ','Ⳏ'=>'ⳏ','ⳏ'=>'ⳏ','Ⳑ'=>'ⳑ','ⳑ'=>'ⳑ','Ⳓ'=>'ⳓ','ⳓ'=>'ⳓ','Ⳕ'=>'ⳕ','ⳕ'=>'ⳕ','Ⳗ'=>'ⳗ','ⳗ'=>'ⳗ','Ⳙ'=>'ⳙ','ⳙ'=>'ⳙ','Ⳛ'=>'ⳛ','ⳛ'=>'ⳛ','Ⳝ'=>'ⳝ','ⳝ'=>'ⳝ','Ⳟ'=>'ⳟ','ⳟ'=>'ⳟ','Ⳡ'=>'ⳡ','ⳡ'=>'ⳡ','Ⳣ'=>'ⳣ','ⳣ'=>'ⳣ','ⳤ'=>'ⳤ','⳽'=>'1/2','ⴀ'=>'ⴀ','ⴁ'=>'ⴁ','ⴂ'=>'ⴂ','ⴃ'=>'ⴃ','ⴄ'=>'ⴄ','ⴅ'=>'ⴅ','ⴆ'=>'ⴆ','ⴇ'=>'ⴇ','ⴈ'=>'ⴈ','ⴉ'=>'ⴉ','ⴊ'=>'ⴊ','ⴋ'=>'ⴋ','ⴌ'=>'ⴌ','ⴍ'=>'ⴍ','ⴎ'=>'ⴎ','ⴏ'=>'ⴏ','ⴐ'=>'ⴐ','ⴑ'=>'ⴑ','ⴒ'=>'ⴒ','ⴓ'=>'ⴓ','ⴔ'=>'ⴔ','ⴕ'=>'ⴕ','ⴖ'=>'ⴖ','ⴗ'=>'ⴗ','ⴘ'=>'ⴘ','ⴙ'=>'ⴙ','ⴚ'=>'ⴚ','ⴛ'=>'ⴛ','ⴜ'=>'ⴜ','ⴝ'=>'ⴝ','ⴞ'=>'ⴞ','ⴟ'=>'ⴟ','ⴠ'=>'ⴠ','ⴡ'=>'ⴡ','ⴢ'=>'ⴢ','ⴣ'=>'ⴣ','ⴤ'=>'ⴤ','ⴥ'=>'ⴥ','ⴰ'=>'ⴰ','ⴱ'=>'ⴱ','ⴲ'=>'ⴲ','ⴳ'=>'ⴳ','ⴴ'=>'ⴴ','ⴵ'=>'ⴵ','ⴶ'=>'ⴶ','ⴷ'=>'ⴷ','ⴸ'=>'ⴸ','ⴹ'=>'ⴹ','ⴺ'=>'ⴺ','ⴻ'=>'ⴻ','ⴼ'=>'ⴼ','ⴽ'=>'ⴽ','ⴾ'=>'ⴾ','ⴿ'=>'ⴿ','ⵀ'=>'ⵀ','ⵁ'=>'ⵁ','ⵂ'=>'ⵂ','ⵃ'=>'ⵃ','ⵄ'=>'ⵄ','ⵅ'=>'ⵅ','ⵆ'=>'ⵆ','ⵇ'=>'ⵇ','ⵈ'=>'ⵈ','ⵉ'=>'ⵉ','ⵊ'=>'ⵊ','ⵋ'=>'ⵋ','ⵌ'=>'ⵌ','ⵍ'=>'ⵍ','ⵎ'=>'ⵎ','ⵏ'=>'ⵏ','ⵐ'=>'ⵐ','ⵑ'=>'ⵑ','ⵒ'=>'ⵒ','ⵓ'=>'ⵓ','ⵔ'=>'ⵔ','ⵕ'=>'ⵕ','ⵖ'=>'ⵖ','ⵗ'=>'ⵗ','ⵘ'=>'ⵘ','ⵙ'=>'ⵙ','ⵚ'=>'ⵚ','ⵛ'=>'ⵛ','ⵜ'=>'ⵜ','ⵝ'=>'ⵝ','ⵞ'=>'ⵞ','ⵟ'=>'ⵟ','ⵠ'=>'ⵠ','ⵡ'=>'ⵡ','ⵢ'=>'ⵢ','ⵣ'=>'ⵣ','ⵤ'=>'ⵤ','ⵥ'=>'ⵥ','ⵯ'=>'ⵯ','ⶀ'=>'ⶀ','ⶁ'=>'ⶁ','ⶂ'=>'ⶂ','ⶃ'=>'ⶃ','ⶄ'=>'ⶄ','ⶅ'=>'ⶅ','ⶆ'=>'ⶆ','ⶇ'=>'ⶇ','ⶈ'=>'ⶈ','ⶉ'=>'ⶉ','ⶊ'=>'ⶊ','ⶋ'=>'ⶋ','ⶌ'=>'ⶌ','ⶍ'=>'ⶍ','ⶎ'=>'ⶎ','ⶏ'=>'ⶏ','ⶐ'=>'ⶐ','ⶑ'=>'ⶑ','ⶒ'=>'ⶒ','ⶓ'=>'ⶓ','ⶔ'=>'ⶔ','ⶕ'=>'ⶕ','ⶖ'=>'ⶖ','ⶠ'=>'ⶠ','ⶡ'=>'ⶡ','ⶢ'=>'ⶢ','ⶣ'=>'ⶣ','ⶤ'=>'ⶤ','ⶥ'=>'ⶥ','ⶦ'=>'ⶦ','ⶨ'=>'ⶨ','ⶩ'=>'ⶩ','ⶪ'=>'ⶪ','ⶫ'=>'ⶫ','ⶬ'=>'ⶬ','ⶭ'=>'ⶭ','ⶮ'=>'ⶮ','ⶰ'=>'ⶰ','ⶱ'=>'ⶱ','ⶲ'=>'ⶲ','ⶳ'=>'ⶳ','ⶴ'=>'ⶴ','ⶵ'=>'ⶵ','ⶶ'=>'ⶶ','ⶸ'=>'ⶸ','ⶹ'=>'ⶹ','ⶺ'=>'ⶺ','ⶻ'=>'ⶻ','ⶼ'=>'ⶼ','ⶽ'=>'ⶽ','ⶾ'=>'ⶾ','ⷀ'=>'ⷀ','ⷁ'=>'ⷁ','ⷂ'=>'ⷂ','ⷃ'=>'ⷃ','ⷄ'=>'ⷄ','ⷅ'=>'ⷅ','ⷆ'=>'ⷆ','ⷈ'=>'ⷈ','ⷉ'=>'ⷉ','ⷊ'=>'ⷊ','ⷋ'=>'ⷋ','ⷌ'=>'ⷌ','ⷍ'=>'ⷍ','ⷎ'=>'ⷎ','ⷐ'=>'ⷐ','ⷑ'=>'ⷑ','ⷒ'=>'ⷒ','ⷓ'=>'ⷓ','ⷔ'=>'ⷔ','ⷕ'=>'ⷕ','ⷖ'=>'ⷖ','ⷘ'=>'ⷘ','ⷙ'=>'ⷙ','ⷚ'=>'ⷚ','ⷛ'=>'ⷛ','ⷜ'=>'ⷜ','ⷝ'=>'ⷝ','ⷞ'=>'ⷞ');
diff --git a/phpBB/includes/utf/data/search_indexer_58.php b/phpBB/includes/utf/data/search_indexer_58.php
index 8902bc7995..ec86a4bd62 100644
--- a/phpBB/includes/utf/data/search_indexer_58.php
+++ b/phpBB/includes/utf/data/search_indexer_58.php
@@ -1 +1 @@
-<?php return array('𝅥'=>'𝅥','𝅦'=>'𝅦','𝅧'=>'𝅧','𝅨'=>'𝅨','𝅩'=>'𝅩','𝅭'=>'𝅭','𝅮'=>'𝅮','𝅯'=>'𝅯','𝅰'=>'𝅰','𝅱'=>'𝅱','𝅲'=>'𝅲','𝅻'=>'𝅻','𝅼'=>'𝅼','𝅽'=>'𝅽','𝅾'=>'𝅾','𝅿'=>'𝅿','𝆀'=>'𝆀','𝆁'=>'𝆁','𝆂'=>'𝆂','𝆅'=>'𝆅','𝆆'=>'𝆆','𝆇'=>'𝆇','𝆈'=>'𝆈','𝆉'=>'𝆉','𝆊'=>'𝆊','𝆋'=>'𝆋','𝆪'=>'𝆪','𝆫'=>'𝆫','𝆬'=>'𝆬','𝆭'=>'𝆭','𝉂'=>'𝉂','𝉃'=>'𝉃','𝉄'=>'𝉄','𝍠'=>'1','𝍡'=>'2','𝍢'=>'3','𝍣'=>'4','𝍤'=>'5','𝍥'=>'6','𝍦'=>'7','𝍧'=>'8','𝍨'=>'9','𝍩'=>'10','𝍪'=>'20','𝍫'=>'30','𝍬'=>'40','𝍭'=>'50','𝍮'=>'60','𝍯'=>'70','𝍰'=>'80','𝍱'=>'90','𝐀'=>'𝐀','𝐁'=>'𝐁','𝐂'=>'𝐂','𝐃'=>'𝐃','𝐄'=>'𝐄','𝐅'=>'𝐅','𝐆'=>'𝐆','𝐇'=>'𝐇','𝐈'=>'𝐈','𝐉'=>'𝐉','𝐊'=>'𝐊','𝐋'=>'𝐋','𝐌'=>'𝐌','𝐍'=>'𝐍','𝐎'=>'𝐎','𝐏'=>'𝐏','𝐐'=>'𝐐','𝐑'=>'𝐑','𝐒'=>'𝐒','𝐓'=>'𝐓','𝐔'=>'𝐔','𝐕'=>'𝐕','𝐖'=>'𝐖','𝐗'=>'𝐗','𝐘'=>'𝐘','𝐙'=>'𝐙','𝐚'=>'𝐚','𝐛'=>'𝐛','𝐜'=>'𝐜','𝐝'=>'𝐝','𝐞'=>'𝐞','𝐟'=>'𝐟','𝐠'=>'𝐠','𝐡'=>'𝐡','𝐢'=>'𝐢','𝐣'=>'𝐣','𝐤'=>'𝐤','𝐥'=>'𝐥','𝐦'=>'𝐦','𝐧'=>'𝐧','𝐨'=>'𝐨','𝐩'=>'𝐩','𝐪'=>'𝐪','𝐫'=>'𝐫','𝐬'=>'𝐬','𝐭'=>'𝐭','𝐮'=>'𝐮','𝐯'=>'𝐯','𝐰'=>'𝐰','𝐱'=>'𝐱','𝐲'=>'𝐲','𝐳'=>'𝐳','𝐴'=>'𝐴','𝐵'=>'𝐵','𝐶'=>'𝐶','𝐷'=>'𝐷','𝐸'=>'𝐸','𝐹'=>'𝐹','𝐺'=>'𝐺','𝐻'=>'𝐻','𝐼'=>'𝐼','𝐽'=>'𝐽','𝐾'=>'𝐾','𝐿'=>'𝐿','𝑀'=>'𝑀','𝑁'=>'𝑁','𝑂'=>'𝑂','𝑃'=>'𝑃','𝑄'=>'𝑄','𝑅'=>'𝑅','𝑆'=>'𝑆','𝑇'=>'𝑇','𝑈'=>'𝑈','𝑉'=>'𝑉','𝑊'=>'𝑊','𝑋'=>'𝑋','𝑌'=>'𝑌','𝑍'=>'𝑍','𝑎'=>'𝑎','𝑏'=>'𝑏','𝑐'=>'𝑐','𝑑'=>'𝑑','𝑒'=>'𝑒','𝑓'=>'𝑓','𝑔'=>'𝑔','𝑖'=>'𝑖','𝑗'=>'𝑗','𝑘'=>'𝑘','𝑙'=>'𝑙','𝑚'=>'𝑚','𝑛'=>'𝑛','𝑜'=>'𝑜','𝑝'=>'𝑝','𝑞'=>'𝑞','𝑟'=>'𝑟','𝑠'=>'𝑠','𝑡'=>'𝑡','𝑢'=>'𝑢','𝑣'=>'𝑣','𝑤'=>'𝑤','𝑥'=>'𝑥','𝑦'=>'𝑦','𝑧'=>'𝑧','𝑨'=>'𝑨','𝑩'=>'𝑩','𝑪'=>'𝑪','𝑫'=>'𝑫','𝑬'=>'𝑬','𝑭'=>'𝑭','𝑮'=>'𝑮','𝑯'=>'𝑯','𝑰'=>'𝑰','𝑱'=>'𝑱','𝑲'=>'𝑲','𝑳'=>'𝑳','𝑴'=>'𝑴','𝑵'=>'𝑵','𝑶'=>'𝑶','𝑷'=>'𝑷','𝑸'=>'𝑸','𝑹'=>'𝑹','𝑺'=>'𝑺','𝑻'=>'𝑻','𝑼'=>'𝑼','𝑽'=>'𝑽','𝑾'=>'𝑾','𝑿'=>'𝑿','𝒀'=>'𝒀','𝒁'=>'𝒁','𝒂'=>'𝒂','𝒃'=>'𝒃','𝒄'=>'𝒄','𝒅'=>'𝒅','𝒆'=>'𝒆','𝒇'=>'𝒇','𝒈'=>'𝒈','𝒉'=>'𝒉','𝒊'=>'𝒊','𝒋'=>'𝒋','𝒌'=>'𝒌','𝒍'=>'𝒍','𝒎'=>'𝒎','𝒏'=>'𝒏','𝒐'=>'𝒐','𝒑'=>'𝒑','𝒒'=>'𝒒','𝒓'=>'𝒓','𝒔'=>'𝒔','𝒕'=>'𝒕','𝒖'=>'𝒖','𝒗'=>'𝒗','𝒘'=>'𝒘','𝒙'=>'𝒙','𝒚'=>'𝒚','𝒛'=>'𝒛','𝒜'=>'𝒜','𝒞'=>'𝒞','𝒟'=>'𝒟','𝒢'=>'𝒢','𝒥'=>'𝒥','𝒦'=>'𝒦','𝒩'=>'𝒩','𝒪'=>'𝒪','𝒫'=>'𝒫','𝒬'=>'𝒬','𝒮'=>'𝒮','𝒯'=>'𝒯','𝒰'=>'𝒰','𝒱'=>'𝒱','𝒲'=>'𝒲','𝒳'=>'𝒳','𝒴'=>'𝒴','𝒵'=>'𝒵','𝒶'=>'𝒶','𝒷'=>'𝒷','𝒸'=>'𝒸','𝒹'=>'𝒹','𝒻'=>'𝒻','𝒽'=>'𝒽','𝒾'=>'𝒾','𝒿'=>'𝒿','𝓀'=>'𝓀','𝓁'=>'𝓁','𝓂'=>'𝓂','𝓃'=>'𝓃','𝓅'=>'𝓅','𝓆'=>'𝓆','𝓇'=>'𝓇','𝓈'=>'𝓈','𝓉'=>'𝓉','𝓊'=>'𝓊','𝓋'=>'𝓋','𝓌'=>'𝓌','𝓍'=>'𝓍','𝓎'=>'𝓎','𝓏'=>'𝓏','𝓐'=>'𝓐','𝓑'=>'𝓑','𝓒'=>'𝓒','𝓓'=>'𝓓','𝓔'=>'𝓔','𝓕'=>'𝓕','𝓖'=>'𝓖','𝓗'=>'𝓗','𝓘'=>'𝓘','𝓙'=>'𝓙','𝓚'=>'𝓚','𝓛'=>'𝓛','𝓜'=>'𝓜','𝓝'=>'𝓝','𝓞'=>'𝓞','𝓟'=>'𝓟','𝓠'=>'𝓠','𝓡'=>'𝓡','𝓢'=>'𝓢','𝓣'=>'𝓣','𝓤'=>'𝓤','𝓥'=>'𝓥','𝓦'=>'𝓦','𝓧'=>'𝓧','𝓨'=>'𝓨','𝓩'=>'𝓩','𝓪'=>'𝓪','𝓫'=>'𝓫','𝓬'=>'𝓬','𝓭'=>'𝓭','𝓮'=>'𝓮','𝓯'=>'𝓯','𝓰'=>'𝓰','𝓱'=>'𝓱','𝓲'=>'𝓲','𝓳'=>'𝓳','𝓴'=>'𝓴','𝓵'=>'𝓵','𝓶'=>'𝓶','𝓷'=>'𝓷','𝓸'=>'𝓸','𝓹'=>'𝓹','𝓺'=>'𝓺','𝓻'=>'𝓻','𝓼'=>'𝓼','𝓽'=>'𝓽','𝓾'=>'𝓾','𝓿'=>'𝓿','𝔀'=>'𝔀','𝔁'=>'𝔁','𝔂'=>'𝔂','𝔃'=>'𝔃','𝔄'=>'𝔄','𝔅'=>'𝔅','𝔇'=>'𝔇','𝔈'=>'𝔈','𝔉'=>'𝔉','𝔊'=>'𝔊','𝔍'=>'𝔍','𝔎'=>'𝔎','𝔏'=>'𝔏','𝔐'=>'𝔐','𝔑'=>'𝔑','𝔒'=>'𝔒','𝔓'=>'𝔓','𝔔'=>'𝔔','𝔖'=>'𝔖','𝔗'=>'𝔗','𝔘'=>'𝔘','𝔙'=>'𝔙','𝔚'=>'𝔚','𝔛'=>'𝔛','𝔜'=>'𝔜','𝔞'=>'𝔞','𝔟'=>'𝔟','𝔠'=>'𝔠','𝔡'=>'𝔡','𝔢'=>'𝔢','𝔣'=>'𝔣','𝔤'=>'𝔤','𝔥'=>'𝔥','𝔦'=>'𝔦','𝔧'=>'𝔧','𝔨'=>'𝔨','𝔩'=>'𝔩','𝔪'=>'𝔪','𝔫'=>'𝔫','𝔬'=>'𝔬','𝔭'=>'𝔭','𝔮'=>'𝔮','𝔯'=>'𝔯','𝔰'=>'𝔰','𝔱'=>'𝔱','𝔲'=>'𝔲','𝔳'=>'𝔳','𝔴'=>'𝔴','𝔵'=>'𝔵','𝔶'=>'𝔶','𝔷'=>'𝔷','𝔸'=>'𝔸','𝔹'=>'𝔹','𝔻'=>'𝔻','𝔼'=>'𝔼','𝔽'=>'𝔽','𝔾'=>'𝔾','𝕀'=>'𝕀','𝕁'=>'𝕁','𝕂'=>'𝕂','𝕃'=>'𝕃','𝕄'=>'𝕄','𝕆'=>'𝕆','𝕊'=>'𝕊','𝕋'=>'𝕋','𝕌'=>'𝕌','𝕍'=>'𝕍','𝕎'=>'𝕎','𝕏'=>'𝕏','𝕐'=>'𝕐','𝕒'=>'𝕒','𝕓'=>'𝕓','𝕔'=>'𝕔','𝕕'=>'𝕕','𝕖'=>'𝕖','𝕗'=>'𝕗','𝕘'=>'𝕘','𝕙'=>'𝕙','𝕚'=>'𝕚','𝕛'=>'𝕛','𝕜'=>'𝕜','𝕝'=>'𝕝','𝕞'=>'𝕞','𝕟'=>'𝕟','𝕠'=>'𝕠','𝕡'=>'𝕡','𝕢'=>'𝕢','𝕣'=>'𝕣','𝕤'=>'𝕤','𝕥'=>'𝕥','𝕦'=>'𝕦','𝕧'=>'𝕧','𝕨'=>'𝕨','𝕩'=>'𝕩','𝕪'=>'𝕪','𝕫'=>'𝕫','𝕬'=>'𝕬','𝕭'=>'𝕭','𝕮'=>'𝕮','𝕯'=>'𝕯','𝕰'=>'𝕰','𝕱'=>'𝕱','𝕲'=>'𝕲','𝕳'=>'𝕳','𝕴'=>'𝕴','𝕵'=>'𝕵','𝕶'=>'𝕶','𝕷'=>'𝕷','𝕸'=>'𝕸','𝕹'=>'𝕹','𝕺'=>'𝕺','𝕻'=>'𝕻','𝕼'=>'𝕼','𝕽'=>'𝕽','𝕾'=>'𝕾','𝕿'=>'𝕿','𝖀'=>'𝖀','𝖁'=>'𝖁','𝖂'=>'𝖂','𝖃'=>'𝖃','𝖄'=>'𝖄','𝖅'=>'𝖅','𝖆'=>'𝖆','𝖇'=>'𝖇','𝖈'=>'𝖈','𝖉'=>'𝖉','𝖊'=>'𝖊','𝖋'=>'𝖋','𝖌'=>'𝖌','𝖍'=>'𝖍','𝖎'=>'𝖎','𝖏'=>'𝖏','𝖐'=>'𝖐','𝖑'=>'𝖑','𝖒'=>'𝖒','𝖓'=>'𝖓','𝖔'=>'𝖔','𝖕'=>'𝖕','𝖖'=>'𝖖','𝖗'=>'𝖗','𝖘'=>'𝖘','𝖙'=>'𝖙','𝖚'=>'𝖚','𝖛'=>'𝖛','𝖜'=>'𝖜','𝖝'=>'𝖝','𝖞'=>'𝖞','𝖟'=>'𝖟','𝖠'=>'𝖠','𝖡'=>'𝖡','𝖢'=>'𝖢','𝖣'=>'𝖣','𝖤'=>'𝖤','𝖥'=>'𝖥','𝖦'=>'𝖦','𝖧'=>'𝖧','𝖨'=>'𝖨','𝖩'=>'𝖩','𝖪'=>'𝖪','𝖫'=>'𝖫','𝖬'=>'𝖬','𝖭'=>'𝖭','𝖮'=>'𝖮','𝖯'=>'𝖯','𝖰'=>'𝖰','𝖱'=>'𝖱','𝖲'=>'𝖲','𝖳'=>'𝖳','𝖴'=>'𝖴','𝖵'=>'𝖵','𝖶'=>'𝖶','𝖷'=>'𝖷','𝖸'=>'𝖸','𝖹'=>'𝖹','𝖺'=>'𝖺','𝖻'=>'𝖻','𝖼'=>'𝖼','𝖽'=>'𝖽','𝖾'=>'𝖾','𝖿'=>'𝖿','𝗀'=>'𝗀','𝗁'=>'𝗁','𝗂'=>'𝗂','𝗃'=>'𝗃','𝗄'=>'𝗄','𝗅'=>'𝗅','𝗆'=>'𝗆','𝗇'=>'𝗇','𝗈'=>'𝗈','𝗉'=>'𝗉','𝗊'=>'𝗊','𝗋'=>'𝗋','𝗌'=>'𝗌','𝗍'=>'𝗍','𝗎'=>'𝗎','𝗏'=>'𝗏','𝗐'=>'𝗐','𝗑'=>'𝗑','𝗒'=>'𝗒','𝗓'=>'𝗓','𝗔'=>'𝗔','𝗕'=>'𝗕','𝗖'=>'𝗖','𝗗'=>'𝗗','𝗘'=>'𝗘','𝗙'=>'𝗙','𝗚'=>'𝗚','𝗛'=>'𝗛','𝗜'=>'𝗜','𝗝'=>'𝗝','𝗞'=>'𝗞','𝗟'=>'𝗟','𝗠'=>'𝗠','𝗡'=>'𝗡','𝗢'=>'𝗢','𝗣'=>'𝗣','𝗤'=>'𝗤','𝗥'=>'𝗥','𝗦'=>'𝗦','𝗧'=>'𝗧','𝗨'=>'𝗨','𝗩'=>'𝗩','𝗪'=>'𝗪','𝗫'=>'𝗫','𝗬'=>'𝗬','𝗭'=>'𝗭','𝗮'=>'𝗮','𝗯'=>'𝗯','𝗰'=>'𝗰','𝗱'=>'𝗱','𝗲'=>'𝗲','𝗳'=>'𝗳','𝗴'=>'𝗴','𝗵'=>'𝗵','𝗶'=>'𝗶','𝗷'=>'𝗷','𝗸'=>'𝗸','𝗹'=>'𝗹','𝗺'=>'𝗺','𝗻'=>'𝗻','𝗼'=>'𝗼','𝗽'=>'𝗽','𝗾'=>'𝗾','𝗿'=>'𝗿','𝘀'=>'𝘀','𝘁'=>'𝘁','𝘂'=>'𝘂','𝘃'=>'𝘃','𝘄'=>'𝘄','𝘅'=>'𝘅','𝘆'=>'𝘆','𝘇'=>'𝘇','𝘈'=>'𝘈','𝘉'=>'𝘉','𝘊'=>'𝘊','𝘋'=>'𝘋','𝘌'=>'𝘌','𝘍'=>'𝘍','𝘎'=>'𝘎','𝘏'=>'𝘏','𝘐'=>'𝘐','𝘑'=>'𝘑','𝘒'=>'𝘒','𝘓'=>'𝘓','𝘔'=>'𝘔','𝘕'=>'𝘕','𝘖'=>'𝘖','𝘗'=>'𝘗','𝘘'=>'𝘘','𝘙'=>'𝘙','𝘚'=>'𝘚','𝘛'=>'𝘛','𝘜'=>'𝘜','𝘝'=>'𝘝','𝘞'=>'𝘞','𝘟'=>'𝘟','𝘠'=>'𝘠','𝘡'=>'𝘡','𝘢'=>'𝘢','𝘣'=>'𝘣','𝘤'=>'𝘤','𝘥'=>'𝘥','𝘦'=>'𝘦','𝘧'=>'𝘧','𝘨'=>'𝘨','𝘩'=>'𝘩','𝘪'=>'𝘪','𝘫'=>'𝘫','𝘬'=>'𝘬','𝘭'=>'𝘭','𝘮'=>'𝘮','𝘯'=>'𝘯','𝘰'=>'𝘰','𝘱'=>'𝘱','𝘲'=>'𝘲','𝘳'=>'𝘳','𝘴'=>'𝘴','𝘵'=>'𝘵','𝘶'=>'𝘶','𝘷'=>'𝘷','𝘸'=>'𝘸','𝘹'=>'𝘹','𝘺'=>'𝘺','𝘻'=>'𝘻','𝘼'=>'𝘼','𝘽'=>'𝘽','𝘾'=>'𝘾','𝘿'=>'𝘿','𝙀'=>'𝙀','𝙁'=>'𝙁','𝙂'=>'𝙂','𝙃'=>'𝙃','𝙄'=>'𝙄','𝙅'=>'𝙅','𝙆'=>'𝙆','𝙇'=>'𝙇','𝙈'=>'𝙈','𝙉'=>'𝙉','𝙊'=>'𝙊','𝙋'=>'𝙋','𝙌'=>'𝙌','𝙍'=>'𝙍','𝙎'=>'𝙎','𝙏'=>'𝙏','𝙐'=>'𝙐','𝙑'=>'𝙑','𝙒'=>'𝙒','𝙓'=>'𝙓','𝙔'=>'𝙔','𝙕'=>'𝙕','𝙖'=>'𝙖','𝙗'=>'𝙗','𝙘'=>'𝙘','𝙙'=>'𝙙','𝙚'=>'𝙚','𝙛'=>'𝙛','𝙜'=>'𝙜','𝙝'=>'𝙝','𝙞'=>'𝙞','𝙟'=>'𝙟','𝙠'=>'𝙠','𝙡'=>'𝙡','𝙢'=>'𝙢','𝙣'=>'𝙣','𝙤'=>'𝙤','𝙥'=>'𝙥','𝙦'=>'𝙦','𝙧'=>'𝙧','𝙨'=>'𝙨','𝙩'=>'𝙩','𝙪'=>'𝙪','𝙫'=>'𝙫','𝙬'=>'𝙬','𝙭'=>'𝙭','𝙮'=>'𝙮','𝙯'=>'𝙯','𝙰'=>'𝙰','𝙱'=>'𝙱','𝙲'=>'𝙲','𝙳'=>'𝙳','𝙴'=>'𝙴','𝙵'=>'𝙵','𝙶'=>'𝙶','𝙷'=>'𝙷','𝙸'=>'𝙸','𝙹'=>'𝙹','𝙺'=>'𝙺','𝙻'=>'𝙻','𝙼'=>'𝙼','𝙽'=>'𝙽','𝙾'=>'𝙾','𝙿'=>'𝙿','𝚀'=>'𝚀','𝚁'=>'𝚁','𝚂'=>'𝚂','𝚃'=>'𝚃','𝚄'=>'𝚄','𝚅'=>'𝚅','𝚆'=>'𝚆','𝚇'=>'𝚇','𝚈'=>'𝚈','𝚉'=>'𝚉','𝚊'=>'𝚊','𝚋'=>'𝚋','𝚌'=>'𝚌','𝚍'=>'𝚍','𝚎'=>'𝚎','𝚏'=>'𝚏','𝚐'=>'𝚐','𝚑'=>'𝚑','𝚒'=>'𝚒','𝚓'=>'𝚓','𝚔'=>'𝚔','𝚕'=>'𝚕','𝚖'=>'𝚖','𝚗'=>'𝚗','𝚘'=>'𝚘','𝚙'=>'𝚙','𝚚'=>'𝚚','𝚛'=>'𝚛','𝚜'=>'𝚜','𝚝'=>'𝚝','𝚞'=>'𝚞','𝚟'=>'𝚟','𝚠'=>'𝚠','𝚡'=>'𝚡','𝚢'=>'𝚢','𝚣'=>'𝚣','𝚤'=>'𝚤','𝚥'=>'𝚥','𝚨'=>'𝚨','𝚩'=>'𝚩','𝚪'=>'𝚪','𝚫'=>'𝚫','𝚬'=>'𝚬','𝚭'=>'𝚭','𝚮'=>'𝚮','𝚯'=>'𝚯','𝚰'=>'𝚰','𝚱'=>'𝚱','𝚲'=>'𝚲','𝚳'=>'𝚳','𝚴'=>'𝚴','𝚵'=>'𝚵','𝚶'=>'𝚶','𝚷'=>'𝚷','𝚸'=>'𝚸','𝚹'=>'𝚹','𝚺'=>'𝚺','𝚻'=>'𝚻','𝚼'=>'𝚼','𝚽'=>'𝚽','𝚾'=>'𝚾','𝚿'=>'𝚿','𝛀'=>'𝛀','𝛂'=>'𝛂','𝛃'=>'𝛃','𝛄'=>'𝛄','𝛅'=>'𝛅','𝛆'=>'𝛆','𝛇'=>'𝛇','𝛈'=>'𝛈','𝛉'=>'𝛉','𝛊'=>'𝛊','𝛋'=>'𝛋','𝛌'=>'𝛌','𝛍'=>'𝛍','𝛎'=>'𝛎','𝛏'=>'𝛏','𝛐'=>'𝛐','𝛑'=>'𝛑','𝛒'=>'𝛒','𝛓'=>'𝛓','𝛔'=>'𝛔','𝛕'=>'𝛕','𝛖'=>'𝛖','𝛗'=>'𝛗','𝛘'=>'𝛘','𝛙'=>'𝛙','𝛚'=>'𝛚','𝛜'=>'𝛜','𝛝'=>'𝛝','𝛞'=>'𝛞','𝛟'=>'𝛟','𝛠'=>'𝛠','𝛡'=>'𝛡','𝛢'=>'𝛢','𝛣'=>'𝛣','𝛤'=>'𝛤','𝛥'=>'𝛥','𝛦'=>'𝛦','𝛧'=>'𝛧','𝛨'=>'𝛨','𝛩'=>'𝛩','𝛪'=>'𝛪','𝛫'=>'𝛫','𝛬'=>'𝛬','𝛭'=>'𝛭','𝛮'=>'𝛮','𝛯'=>'𝛯','𝛰'=>'𝛰','𝛱'=>'𝛱','𝛲'=>'𝛲','𝛳'=>'𝛳','𝛴'=>'𝛴','𝛵'=>'𝛵','𝛶'=>'𝛶','𝛷'=>'𝛷','𝛸'=>'𝛸','𝛹'=>'𝛹','𝛺'=>'𝛺','𝛼'=>'𝛼','𝛽'=>'𝛽','𝛾'=>'𝛾','𝛿'=>'𝛿','𝜀'=>'𝜀','𝜁'=>'𝜁','𝜂'=>'𝜂','𝜃'=>'𝜃','𝜄'=>'𝜄','𝜅'=>'𝜅','𝜆'=>'𝜆','𝜇'=>'𝜇','𝜈'=>'𝜈','𝜉'=>'𝜉','𝜊'=>'𝜊','𝜋'=>'𝜋','𝜌'=>'𝜌','𝜍'=>'𝜍','𝜎'=>'𝜎','𝜏'=>'𝜏','𝜐'=>'𝜐','𝜑'=>'𝜑','𝜒'=>'𝜒','𝜓'=>'𝜓','𝜔'=>'𝜔','𝜖'=>'𝜖','𝜗'=>'𝜗','𝜘'=>'𝜘','𝜙'=>'𝜙','𝜚'=>'𝜚','𝜛'=>'𝜛','𝜜'=>'𝜜','𝜝'=>'𝜝','𝜞'=>'𝜞','𝜟'=>'𝜟','𝜠'=>'𝜠','𝜡'=>'𝜡','𝜢'=>'𝜢','𝜣'=>'𝜣','𝜤'=>'𝜤','𝜥'=>'𝜥','𝜦'=>'𝜦','𝜧'=>'𝜧','𝜨'=>'𝜨','𝜩'=>'𝜩','𝜪'=>'𝜪','𝜫'=>'𝜫','𝜬'=>'𝜬','𝜭'=>'𝜭','𝜮'=>'𝜮','𝜯'=>'𝜯','𝜰'=>'𝜰','𝜱'=>'𝜱','𝜲'=>'𝜲','𝜳'=>'𝜳','𝜴'=>'𝜴','𝜶'=>'𝜶','𝜷'=>'𝜷','𝜸'=>'𝜸','𝜹'=>'𝜹','𝜺'=>'𝜺','𝜻'=>'𝜻','𝜼'=>'𝜼','𝜽'=>'𝜽','𝜾'=>'𝜾','𝜿'=>'𝜿','𝝀'=>'𝝀','𝝁'=>'𝝁','𝝂'=>'𝝂','𝝃'=>'𝝃','𝝄'=>'𝝄','𝝅'=>'𝝅','𝝆'=>'𝝆','𝝇'=>'𝝇','𝝈'=>'𝝈','𝝉'=>'𝝉','𝝊'=>'𝝊','𝝋'=>'𝝋','𝝌'=>'𝝌','𝝍'=>'𝝍','𝝎'=>'𝝎','𝝐'=>'𝝐','𝝑'=>'𝝑','𝝒'=>'𝝒','𝝓'=>'𝝓','𝝔'=>'𝝔','𝝕'=>'𝝕','𝝖'=>'𝝖','𝝗'=>'𝝗','𝝘'=>'𝝘','𝝙'=>'𝝙','𝝚'=>'𝝚','𝝛'=>'𝝛','𝝜'=>'𝝜','𝝝'=>'𝝝','𝝞'=>'𝝞','𝝟'=>'𝝟','𝝠'=>'𝝠','𝝡'=>'𝝡','𝝢'=>'𝝢','𝝣'=>'𝝣','𝝤'=>'𝝤','𝝥'=>'𝝥','𝝦'=>'𝝦','𝝧'=>'𝝧','𝝨'=>'𝝨','𝝩'=>'𝝩','𝝪'=>'𝝪','𝝫'=>'𝝫','𝝬'=>'𝝬','𝝭'=>'𝝭','𝝮'=>'𝝮','𝝰'=>'𝝰','𝝱'=>'𝝱','𝝲'=>'𝝲','𝝳'=>'𝝳','𝝴'=>'𝝴','𝝵'=>'𝝵','𝝶'=>'𝝶','𝝷'=>'𝝷','𝝸'=>'𝝸','𝝹'=>'𝝹','𝝺'=>'𝝺','𝝻'=>'𝝻','𝝼'=>'𝝼','𝝽'=>'𝝽','𝝾'=>'𝝾','𝝿'=>'𝝿','𝞀'=>'𝞀','𝞁'=>'𝞁','𝞂'=>'𝞂','𝞃'=>'𝞃','𝞄'=>'𝞄','𝞅'=>'𝞅','𝞆'=>'𝞆','𝞇'=>'𝞇','𝞈'=>'𝞈','𝞊'=>'𝞊','𝞋'=>'𝞋','𝞌'=>'𝞌','𝞍'=>'𝞍','𝞎'=>'𝞎','𝞏'=>'𝞏','𝞐'=>'𝞐','𝞑'=>'𝞑','𝞒'=>'𝞒','𝞓'=>'𝞓','𝞔'=>'𝞔','𝞕'=>'𝞕','𝞖'=>'𝞖','𝞗'=>'𝞗','𝞘'=>'𝞘','𝞙'=>'𝞙','𝞚'=>'𝞚','𝞛'=>'𝞛','𝞜'=>'𝞜','𝞝'=>'𝞝','𝞞'=>'𝞞','𝞟'=>'𝞟','𝞠'=>'𝞠','𝞡'=>'𝞡','𝞢'=>'𝞢','𝞣'=>'𝞣','𝞤'=>'𝞤','𝞥'=>'𝞥','𝞦'=>'𝞦','𝞧'=>'𝞧','𝞨'=>'𝞨','𝞪'=>'𝞪','𝞫'=>'𝞫','𝞬'=>'𝞬','𝞭'=>'𝞭','𝞮'=>'𝞮','𝞯'=>'𝞯','𝞰'=>'𝞰','𝞱'=>'𝞱','𝞲'=>'𝞲','𝞳'=>'𝞳','𝞴'=>'𝞴','𝞵'=>'𝞵','𝞶'=>'𝞶','𝞷'=>'𝞷','𝞸'=>'𝞸','𝞹'=>'𝞹','𝞺'=>'𝞺','𝞻'=>'𝞻','𝞼'=>'𝞼','𝞽'=>'𝞽','𝞾'=>'𝞾','𝞿'=>'𝞿','𝟀'=>'𝟀','𝟁'=>'𝟁','𝟂'=>'𝟂','𝟄'=>'𝟄','𝟅'=>'𝟅','𝟆'=>'𝟆','𝟇'=>'𝟇','𝟈'=>'𝟈','𝟉'=>'𝟉','𝟊'=>'𝟊','𝟋'=>'𝟋','𝟎'=>'0','𝟏'=>'1','𝟐'=>'2','𝟑'=>'3','𝟒'=>'4','𝟓'=>'5','𝟔'=>'6','𝟕'=>'7','𝟖'=>'8','𝟗'=>'9','𝟘'=>'0','𝟙'=>'1','𝟚'=>'2','𝟛'=>'3','𝟜'=>'4','𝟝'=>'5','𝟞'=>'6','𝟟'=>'7','𝟠'=>'8','𝟡'=>'9','𝟢'=>'0','𝟣'=>'1','𝟤'=>'2','𝟥'=>'3','𝟦'=>'4','𝟧'=>'5','𝟨'=>'6','𝟩'=>'7','𝟪'=>'8','𝟫'=>'9','𝟬'=>'0','𝟭'=>'1','𝟮'=>'2','𝟯'=>'3','𝟰'=>'4','𝟱'=>'5','𝟲'=>'6','𝟳'=>'7','𝟴'=>'8','𝟵'=>'9','𝟶'=>'0','𝟷'=>'1','𝟸'=>'2','𝟹'=>'3','𝟺'=>'4','𝟻'=>'5','𝟼'=>'6','𝟽'=>'7','𝟾'=>'8','𝟿'=>'9'); \ No newline at end of file
+<?php return array('𝅥'=>'𝅥','𝅦'=>'𝅦','𝅧'=>'𝅧','𝅨'=>'𝅨','𝅩'=>'𝅩','𝅭'=>'𝅭','𝅮'=>'𝅮','𝅯'=>'𝅯','𝅰'=>'𝅰','𝅱'=>'𝅱','𝅲'=>'𝅲','𝅻'=>'𝅻','𝅼'=>'𝅼','𝅽'=>'𝅽','𝅾'=>'𝅾','𝅿'=>'𝅿','𝆀'=>'𝆀','𝆁'=>'𝆁','𝆂'=>'𝆂','𝆅'=>'𝆅','𝆆'=>'𝆆','𝆇'=>'𝆇','𝆈'=>'𝆈','𝆉'=>'𝆉','𝆊'=>'𝆊','𝆋'=>'𝆋','𝆪'=>'𝆪','𝆫'=>'𝆫','𝆬'=>'𝆬','𝆭'=>'𝆭','𝉂'=>'𝉂','𝉃'=>'𝉃','𝉄'=>'𝉄','𝍠'=>'1','𝍡'=>'2','𝍢'=>'3','𝍣'=>'4','𝍤'=>'5','𝍥'=>'6','𝍦'=>'7','𝍧'=>'8','𝍨'=>'9','𝍩'=>'10','𝍪'=>'20','𝍫'=>'30','𝍬'=>'40','𝍭'=>'50','𝍮'=>'60','𝍯'=>'70','𝍰'=>'80','𝍱'=>'90','𝐀'=>'𝐀','𝐁'=>'𝐁','𝐂'=>'𝐂','𝐃'=>'𝐃','𝐄'=>'𝐄','𝐅'=>'𝐅','𝐆'=>'𝐆','𝐇'=>'𝐇','𝐈'=>'𝐈','𝐉'=>'𝐉','𝐊'=>'𝐊','𝐋'=>'𝐋','𝐌'=>'𝐌','𝐍'=>'𝐍','𝐎'=>'𝐎','𝐏'=>'𝐏','𝐐'=>'𝐐','𝐑'=>'𝐑','𝐒'=>'𝐒','𝐓'=>'𝐓','𝐔'=>'𝐔','𝐕'=>'𝐕','𝐖'=>'𝐖','𝐗'=>'𝐗','𝐘'=>'𝐘','𝐙'=>'𝐙','𝐚'=>'𝐚','𝐛'=>'𝐛','𝐜'=>'𝐜','𝐝'=>'𝐝','𝐞'=>'𝐞','𝐟'=>'𝐟','𝐠'=>'𝐠','𝐡'=>'𝐡','𝐢'=>'𝐢','𝐣'=>'𝐣','𝐤'=>'𝐤','𝐥'=>'𝐥','𝐦'=>'𝐦','𝐧'=>'𝐧','𝐨'=>'𝐨','𝐩'=>'𝐩','𝐪'=>'𝐪','𝐫'=>'𝐫','𝐬'=>'𝐬','𝐭'=>'𝐭','𝐮'=>'𝐮','𝐯'=>'𝐯','𝐰'=>'𝐰','𝐱'=>'𝐱','𝐲'=>'𝐲','𝐳'=>'𝐳','𝐴'=>'𝐴','𝐵'=>'𝐵','𝐶'=>'𝐶','𝐷'=>'𝐷','𝐸'=>'𝐸','𝐹'=>'𝐹','𝐺'=>'𝐺','𝐻'=>'𝐻','𝐼'=>'𝐼','𝐽'=>'𝐽','𝐾'=>'𝐾','𝐿'=>'𝐿','𝑀'=>'𝑀','𝑁'=>'𝑁','𝑂'=>'𝑂','𝑃'=>'𝑃','𝑄'=>'𝑄','𝑅'=>'𝑅','𝑆'=>'𝑆','𝑇'=>'𝑇','𝑈'=>'𝑈','𝑉'=>'𝑉','𝑊'=>'𝑊','𝑋'=>'𝑋','𝑌'=>'𝑌','𝑍'=>'𝑍','𝑎'=>'𝑎','𝑏'=>'𝑏','𝑐'=>'𝑐','𝑑'=>'𝑑','𝑒'=>'𝑒','𝑓'=>'𝑓','𝑔'=>'𝑔','𝑖'=>'𝑖','𝑗'=>'𝑗','𝑘'=>'𝑘','𝑙'=>'𝑙','𝑚'=>'𝑚','𝑛'=>'𝑛','𝑜'=>'𝑜','𝑝'=>'𝑝','𝑞'=>'𝑞','𝑟'=>'𝑟','𝑠'=>'𝑠','𝑡'=>'𝑡','𝑢'=>'𝑢','𝑣'=>'𝑣','𝑤'=>'𝑤','𝑥'=>'𝑥','𝑦'=>'𝑦','𝑧'=>'𝑧','𝑨'=>'𝑨','𝑩'=>'𝑩','𝑪'=>'𝑪','𝑫'=>'𝑫','𝑬'=>'𝑬','𝑭'=>'𝑭','𝑮'=>'𝑮','𝑯'=>'𝑯','𝑰'=>'𝑰','𝑱'=>'𝑱','𝑲'=>'𝑲','𝑳'=>'𝑳','𝑴'=>'𝑴','𝑵'=>'𝑵','𝑶'=>'𝑶','𝑷'=>'𝑷','𝑸'=>'𝑸','𝑹'=>'𝑹','𝑺'=>'𝑺','𝑻'=>'𝑻','𝑼'=>'𝑼','𝑽'=>'𝑽','𝑾'=>'𝑾','𝑿'=>'𝑿','𝒀'=>'𝒀','𝒁'=>'𝒁','𝒂'=>'𝒂','𝒃'=>'𝒃','𝒄'=>'𝒄','𝒅'=>'𝒅','𝒆'=>'𝒆','𝒇'=>'𝒇','𝒈'=>'𝒈','𝒉'=>'𝒉','𝒊'=>'𝒊','𝒋'=>'𝒋','𝒌'=>'𝒌','𝒍'=>'𝒍','𝒎'=>'𝒎','𝒏'=>'𝒏','𝒐'=>'𝒐','𝒑'=>'𝒑','𝒒'=>'𝒒','𝒓'=>'𝒓','𝒔'=>'𝒔','𝒕'=>'𝒕','𝒖'=>'𝒖','𝒗'=>'𝒗','𝒘'=>'𝒘','𝒙'=>'𝒙','𝒚'=>'𝒚','𝒛'=>'𝒛','𝒜'=>'𝒜','𝒞'=>'𝒞','𝒟'=>'𝒟','𝒢'=>'𝒢','𝒥'=>'𝒥','𝒦'=>'𝒦','𝒩'=>'𝒩','𝒪'=>'𝒪','𝒫'=>'𝒫','𝒬'=>'𝒬','𝒮'=>'𝒮','𝒯'=>'𝒯','𝒰'=>'𝒰','𝒱'=>'𝒱','𝒲'=>'𝒲','𝒳'=>'𝒳','𝒴'=>'𝒴','𝒵'=>'𝒵','𝒶'=>'𝒶','𝒷'=>'𝒷','𝒸'=>'𝒸','𝒹'=>'𝒹','𝒻'=>'𝒻','𝒽'=>'𝒽','𝒾'=>'𝒾','𝒿'=>'𝒿','𝓀'=>'𝓀','𝓁'=>'𝓁','𝓂'=>'𝓂','𝓃'=>'𝓃','𝓅'=>'𝓅','𝓆'=>'𝓆','𝓇'=>'𝓇','𝓈'=>'𝓈','𝓉'=>'𝓉','𝓊'=>'𝓊','𝓋'=>'𝓋','𝓌'=>'𝓌','𝓍'=>'𝓍','𝓎'=>'𝓎','𝓏'=>'𝓏','𝓐'=>'𝓐','𝓑'=>'𝓑','𝓒'=>'𝓒','𝓓'=>'𝓓','𝓔'=>'𝓔','𝓕'=>'𝓕','𝓖'=>'𝓖','𝓗'=>'𝓗','𝓘'=>'𝓘','𝓙'=>'𝓙','𝓚'=>'𝓚','𝓛'=>'𝓛','𝓜'=>'𝓜','𝓝'=>'𝓝','𝓞'=>'𝓞','𝓟'=>'𝓟','𝓠'=>'𝓠','𝓡'=>'𝓡','𝓢'=>'𝓢','𝓣'=>'𝓣','𝓤'=>'𝓤','𝓥'=>'𝓥','𝓦'=>'𝓦','𝓧'=>'𝓧','𝓨'=>'𝓨','𝓩'=>'𝓩','𝓪'=>'𝓪','𝓫'=>'𝓫','𝓬'=>'𝓬','𝓭'=>'𝓭','𝓮'=>'𝓮','𝓯'=>'𝓯','𝓰'=>'𝓰','𝓱'=>'𝓱','𝓲'=>'𝓲','𝓳'=>'𝓳','𝓴'=>'𝓴','𝓵'=>'𝓵','𝓶'=>'𝓶','𝓷'=>'𝓷','𝓸'=>'𝓸','𝓹'=>'𝓹','𝓺'=>'𝓺','𝓻'=>'𝓻','𝓼'=>'𝓼','𝓽'=>'𝓽','𝓾'=>'𝓾','𝓿'=>'𝓿','𝔀'=>'𝔀','𝔁'=>'𝔁','𝔂'=>'𝔂','𝔃'=>'𝔃','𝔄'=>'𝔄','𝔅'=>'𝔅','𝔇'=>'𝔇','𝔈'=>'𝔈','𝔉'=>'𝔉','𝔊'=>'𝔊','𝔍'=>'𝔍','𝔎'=>'𝔎','𝔏'=>'𝔏','𝔐'=>'𝔐','𝔑'=>'𝔑','𝔒'=>'𝔒','𝔓'=>'𝔓','𝔔'=>'𝔔','𝔖'=>'𝔖','𝔗'=>'𝔗','𝔘'=>'𝔘','𝔙'=>'𝔙','𝔚'=>'𝔚','𝔛'=>'𝔛','𝔜'=>'𝔜','𝔞'=>'𝔞','𝔟'=>'𝔟','𝔠'=>'𝔠','𝔡'=>'𝔡','𝔢'=>'𝔢','𝔣'=>'𝔣','𝔤'=>'𝔤','𝔥'=>'𝔥','𝔦'=>'𝔦','𝔧'=>'𝔧','𝔨'=>'𝔨','𝔩'=>'𝔩','𝔪'=>'𝔪','𝔫'=>'𝔫','𝔬'=>'𝔬','𝔭'=>'𝔭','𝔮'=>'𝔮','𝔯'=>'𝔯','𝔰'=>'𝔰','𝔱'=>'𝔱','𝔲'=>'𝔲','𝔳'=>'𝔳','𝔴'=>'𝔴','𝔵'=>'𝔵','𝔶'=>'𝔶','𝔷'=>'𝔷','𝔸'=>'𝔸','𝔹'=>'𝔹','𝔻'=>'𝔻','𝔼'=>'𝔼','𝔽'=>'𝔽','𝔾'=>'𝔾','𝕀'=>'𝕀','𝕁'=>'𝕁','𝕂'=>'𝕂','𝕃'=>'𝕃','𝕄'=>'𝕄','𝕆'=>'𝕆','𝕊'=>'𝕊','𝕋'=>'𝕋','𝕌'=>'𝕌','𝕍'=>'𝕍','𝕎'=>'𝕎','𝕏'=>'𝕏','𝕐'=>'𝕐','𝕒'=>'𝕒','𝕓'=>'𝕓','𝕔'=>'𝕔','𝕕'=>'𝕕','𝕖'=>'𝕖','𝕗'=>'𝕗','𝕘'=>'𝕘','𝕙'=>'𝕙','𝕚'=>'𝕚','𝕛'=>'𝕛','𝕜'=>'𝕜','𝕝'=>'𝕝','𝕞'=>'𝕞','𝕟'=>'𝕟','𝕠'=>'𝕠','𝕡'=>'𝕡','𝕢'=>'𝕢','𝕣'=>'𝕣','𝕤'=>'𝕤','𝕥'=>'𝕥','𝕦'=>'𝕦','𝕧'=>'𝕧','𝕨'=>'𝕨','𝕩'=>'𝕩','𝕪'=>'𝕪','𝕫'=>'𝕫','𝕬'=>'𝕬','𝕭'=>'𝕭','𝕮'=>'𝕮','𝕯'=>'𝕯','𝕰'=>'𝕰','𝕱'=>'𝕱','𝕲'=>'𝕲','𝕳'=>'𝕳','𝕴'=>'𝕴','𝕵'=>'𝕵','𝕶'=>'𝕶','𝕷'=>'𝕷','𝕸'=>'𝕸','𝕹'=>'𝕹','𝕺'=>'𝕺','𝕻'=>'𝕻','𝕼'=>'𝕼','𝕽'=>'𝕽','𝕾'=>'𝕾','𝕿'=>'𝕿','𝖀'=>'𝖀','𝖁'=>'𝖁','𝖂'=>'𝖂','𝖃'=>'𝖃','𝖄'=>'𝖄','𝖅'=>'𝖅','𝖆'=>'𝖆','𝖇'=>'𝖇','𝖈'=>'𝖈','𝖉'=>'𝖉','𝖊'=>'𝖊','𝖋'=>'𝖋','𝖌'=>'𝖌','𝖍'=>'𝖍','𝖎'=>'𝖎','𝖏'=>'𝖏','𝖐'=>'𝖐','𝖑'=>'𝖑','𝖒'=>'𝖒','𝖓'=>'𝖓','𝖔'=>'𝖔','𝖕'=>'𝖕','𝖖'=>'𝖖','𝖗'=>'𝖗','𝖘'=>'𝖘','𝖙'=>'𝖙','𝖚'=>'𝖚','𝖛'=>'𝖛','𝖜'=>'𝖜','𝖝'=>'𝖝','𝖞'=>'𝖞','𝖟'=>'𝖟','𝖠'=>'𝖠','𝖡'=>'𝖡','𝖢'=>'𝖢','𝖣'=>'𝖣','𝖤'=>'𝖤','𝖥'=>'𝖥','𝖦'=>'𝖦','𝖧'=>'𝖧','𝖨'=>'𝖨','𝖩'=>'𝖩','𝖪'=>'𝖪','𝖫'=>'𝖫','𝖬'=>'𝖬','𝖭'=>'𝖭','𝖮'=>'𝖮','𝖯'=>'𝖯','𝖰'=>'𝖰','𝖱'=>'𝖱','𝖲'=>'𝖲','𝖳'=>'𝖳','𝖴'=>'𝖴','𝖵'=>'𝖵','𝖶'=>'𝖶','𝖷'=>'𝖷','𝖸'=>'𝖸','𝖹'=>'𝖹','𝖺'=>'𝖺','𝖻'=>'𝖻','𝖼'=>'𝖼','𝖽'=>'𝖽','𝖾'=>'𝖾','𝖿'=>'𝖿','𝗀'=>'𝗀','𝗁'=>'𝗁','𝗂'=>'𝗂','𝗃'=>'𝗃','𝗄'=>'𝗄','𝗅'=>'𝗅','𝗆'=>'𝗆','𝗇'=>'𝗇','𝗈'=>'𝗈','𝗉'=>'𝗉','𝗊'=>'𝗊','𝗋'=>'𝗋','𝗌'=>'𝗌','𝗍'=>'𝗍','𝗎'=>'𝗎','𝗏'=>'𝗏','𝗐'=>'𝗐','𝗑'=>'𝗑','𝗒'=>'𝗒','𝗓'=>'𝗓','𝗔'=>'𝗔','𝗕'=>'𝗕','𝗖'=>'𝗖','𝗗'=>'𝗗','𝗘'=>'𝗘','𝗙'=>'𝗙','𝗚'=>'𝗚','𝗛'=>'𝗛','𝗜'=>'𝗜','𝗝'=>'𝗝','𝗞'=>'𝗞','𝗟'=>'𝗟','𝗠'=>'𝗠','𝗡'=>'𝗡','𝗢'=>'𝗢','𝗣'=>'𝗣','𝗤'=>'𝗤','𝗥'=>'𝗥','𝗦'=>'𝗦','𝗧'=>'𝗧','𝗨'=>'𝗨','𝗩'=>'𝗩','𝗪'=>'𝗪','𝗫'=>'𝗫','𝗬'=>'𝗬','𝗭'=>'𝗭','𝗮'=>'𝗮','𝗯'=>'𝗯','𝗰'=>'𝗰','𝗱'=>'𝗱','𝗲'=>'𝗲','𝗳'=>'𝗳','𝗴'=>'𝗴','𝗵'=>'𝗵','𝗶'=>'𝗶','𝗷'=>'𝗷','𝗸'=>'𝗸','𝗹'=>'𝗹','𝗺'=>'𝗺','𝗻'=>'𝗻','𝗼'=>'𝗼','𝗽'=>'𝗽','𝗾'=>'𝗾','𝗿'=>'𝗿','𝘀'=>'𝘀','𝘁'=>'𝘁','𝘂'=>'𝘂','𝘃'=>'𝘃','𝘄'=>'𝘄','𝘅'=>'𝘅','𝘆'=>'𝘆','𝘇'=>'𝘇','𝘈'=>'𝘈','𝘉'=>'𝘉','𝘊'=>'𝘊','𝘋'=>'𝘋','𝘌'=>'𝘌','𝘍'=>'𝘍','𝘎'=>'𝘎','𝘏'=>'𝘏','𝘐'=>'𝘐','𝘑'=>'𝘑','𝘒'=>'𝘒','𝘓'=>'𝘓','𝘔'=>'𝘔','𝘕'=>'𝘕','𝘖'=>'𝘖','𝘗'=>'𝘗','𝘘'=>'𝘘','𝘙'=>'𝘙','𝘚'=>'𝘚','𝘛'=>'𝘛','𝘜'=>'𝘜','𝘝'=>'𝘝','𝘞'=>'𝘞','𝘟'=>'𝘟','𝘠'=>'𝘠','𝘡'=>'𝘡','𝘢'=>'𝘢','𝘣'=>'𝘣','𝘤'=>'𝘤','𝘥'=>'𝘥','𝘦'=>'𝘦','𝘧'=>'𝘧','𝘨'=>'𝘨','𝘩'=>'𝘩','𝘪'=>'𝘪','𝘫'=>'𝘫','𝘬'=>'𝘬','𝘭'=>'𝘭','𝘮'=>'𝘮','𝘯'=>'𝘯','𝘰'=>'𝘰','𝘱'=>'𝘱','𝘲'=>'𝘲','𝘳'=>'𝘳','𝘴'=>'𝘴','𝘵'=>'𝘵','𝘶'=>'𝘶','𝘷'=>'𝘷','𝘸'=>'𝘸','𝘹'=>'𝘹','𝘺'=>'𝘺','𝘻'=>'𝘻','𝘼'=>'𝘼','𝘽'=>'𝘽','𝘾'=>'𝘾','𝘿'=>'𝘿','𝙀'=>'𝙀','𝙁'=>'𝙁','𝙂'=>'𝙂','𝙃'=>'𝙃','𝙄'=>'𝙄','𝙅'=>'𝙅','𝙆'=>'𝙆','𝙇'=>'𝙇','𝙈'=>'𝙈','𝙉'=>'𝙉','𝙊'=>'𝙊','𝙋'=>'𝙋','𝙌'=>'𝙌','𝙍'=>'𝙍','𝙎'=>'𝙎','𝙏'=>'𝙏','𝙐'=>'𝙐','𝙑'=>'𝙑','𝙒'=>'𝙒','𝙓'=>'𝙓','𝙔'=>'𝙔','𝙕'=>'𝙕','𝙖'=>'𝙖','𝙗'=>'𝙗','𝙘'=>'𝙘','𝙙'=>'𝙙','𝙚'=>'𝙚','𝙛'=>'𝙛','𝙜'=>'𝙜','𝙝'=>'𝙝','𝙞'=>'𝙞','𝙟'=>'𝙟','𝙠'=>'𝙠','𝙡'=>'𝙡','𝙢'=>'𝙢','𝙣'=>'𝙣','𝙤'=>'𝙤','𝙥'=>'𝙥','𝙦'=>'𝙦','𝙧'=>'𝙧','𝙨'=>'𝙨','𝙩'=>'𝙩','𝙪'=>'𝙪','𝙫'=>'𝙫','𝙬'=>'𝙬','𝙭'=>'𝙭','𝙮'=>'𝙮','𝙯'=>'𝙯','𝙰'=>'𝙰','𝙱'=>'𝙱','𝙲'=>'𝙲','𝙳'=>'𝙳','𝙴'=>'𝙴','𝙵'=>'𝙵','𝙶'=>'𝙶','𝙷'=>'𝙷','𝙸'=>'𝙸','𝙹'=>'𝙹','𝙺'=>'𝙺','𝙻'=>'𝙻','𝙼'=>'𝙼','𝙽'=>'𝙽','𝙾'=>'𝙾','𝙿'=>'𝙿','𝚀'=>'𝚀','𝚁'=>'𝚁','𝚂'=>'𝚂','𝚃'=>'𝚃','𝚄'=>'𝚄','𝚅'=>'𝚅','𝚆'=>'𝚆','𝚇'=>'𝚇','𝚈'=>'𝚈','𝚉'=>'𝚉','𝚊'=>'𝚊','𝚋'=>'𝚋','𝚌'=>'𝚌','𝚍'=>'𝚍','𝚎'=>'𝚎','𝚏'=>'𝚏','𝚐'=>'𝚐','𝚑'=>'𝚑','𝚒'=>'𝚒','𝚓'=>'𝚓','𝚔'=>'𝚔','𝚕'=>'𝚕','𝚖'=>'𝚖','𝚗'=>'𝚗','𝚘'=>'𝚘','𝚙'=>'𝚙','𝚚'=>'𝚚','𝚛'=>'𝚛','𝚜'=>'𝚜','𝚝'=>'𝚝','𝚞'=>'𝚞','𝚟'=>'𝚟','𝚠'=>'𝚠','𝚡'=>'𝚡','𝚢'=>'𝚢','𝚣'=>'𝚣','𝚤'=>'𝚤','𝚥'=>'𝚥','𝚨'=>'𝚨','𝚩'=>'𝚩','𝚪'=>'𝚪','𝚫'=>'𝚫','𝚬'=>'𝚬','𝚭'=>'𝚭','𝚮'=>'𝚮','𝚯'=>'𝚯','𝚰'=>'𝚰','𝚱'=>'𝚱','𝚲'=>'𝚲','𝚳'=>'𝚳','𝚴'=>'𝚴','𝚵'=>'𝚵','𝚶'=>'𝚶','𝚷'=>'𝚷','𝚸'=>'𝚸','𝚹'=>'𝚹','𝚺'=>'𝚺','𝚻'=>'𝚻','𝚼'=>'𝚼','𝚽'=>'𝚽','𝚾'=>'𝚾','𝚿'=>'𝚿','𝛀'=>'𝛀','𝛂'=>'𝛂','𝛃'=>'𝛃','𝛄'=>'𝛄','𝛅'=>'𝛅','𝛆'=>'𝛆','𝛇'=>'𝛇','𝛈'=>'𝛈','𝛉'=>'𝛉','𝛊'=>'𝛊','𝛋'=>'𝛋','𝛌'=>'𝛌','𝛍'=>'𝛍','𝛎'=>'𝛎','𝛏'=>'𝛏','𝛐'=>'𝛐','𝛑'=>'𝛑','𝛒'=>'𝛒','𝛓'=>'𝛓','𝛔'=>'𝛔','𝛕'=>'𝛕','𝛖'=>'𝛖','𝛗'=>'𝛗','𝛘'=>'𝛘','𝛙'=>'𝛙','𝛚'=>'𝛚','𝛜'=>'𝛜','𝛝'=>'𝛝','𝛞'=>'𝛞','𝛟'=>'𝛟','𝛠'=>'𝛠','𝛡'=>'𝛡','𝛢'=>'𝛢','𝛣'=>'𝛣','𝛤'=>'𝛤','𝛥'=>'𝛥','𝛦'=>'𝛦','𝛧'=>'𝛧','𝛨'=>'𝛨','𝛩'=>'𝛩','𝛪'=>'𝛪','𝛫'=>'𝛫','𝛬'=>'𝛬','𝛭'=>'𝛭','𝛮'=>'𝛮','𝛯'=>'𝛯','𝛰'=>'𝛰','𝛱'=>'𝛱','𝛲'=>'𝛲','𝛳'=>'𝛳','𝛴'=>'𝛴','𝛵'=>'𝛵','𝛶'=>'𝛶','𝛷'=>'𝛷','𝛸'=>'𝛸','𝛹'=>'𝛹','𝛺'=>'𝛺','𝛼'=>'𝛼','𝛽'=>'𝛽','𝛾'=>'𝛾','𝛿'=>'𝛿','𝜀'=>'𝜀','𝜁'=>'𝜁','𝜂'=>'𝜂','𝜃'=>'𝜃','𝜄'=>'𝜄','𝜅'=>'𝜅','𝜆'=>'𝜆','𝜇'=>'𝜇','𝜈'=>'𝜈','𝜉'=>'𝜉','𝜊'=>'𝜊','𝜋'=>'𝜋','𝜌'=>'𝜌','𝜍'=>'𝜍','𝜎'=>'𝜎','𝜏'=>'𝜏','𝜐'=>'𝜐','𝜑'=>'𝜑','𝜒'=>'𝜒','𝜓'=>'𝜓','𝜔'=>'𝜔','𝜖'=>'𝜖','𝜗'=>'𝜗','𝜘'=>'𝜘','𝜙'=>'𝜙','𝜚'=>'𝜚','𝜛'=>'𝜛','𝜜'=>'𝜜','𝜝'=>'𝜝','𝜞'=>'𝜞','𝜟'=>'𝜟','𝜠'=>'𝜠','𝜡'=>'𝜡','𝜢'=>'𝜢','𝜣'=>'𝜣','𝜤'=>'𝜤','𝜥'=>'𝜥','𝜦'=>'𝜦','𝜧'=>'𝜧','𝜨'=>'𝜨','𝜩'=>'𝜩','𝜪'=>'𝜪','𝜫'=>'𝜫','𝜬'=>'𝜬','𝜭'=>'𝜭','𝜮'=>'𝜮','𝜯'=>'𝜯','𝜰'=>'𝜰','𝜱'=>'𝜱','𝜲'=>'𝜲','𝜳'=>'𝜳','𝜴'=>'𝜴','𝜶'=>'𝜶','𝜷'=>'𝜷','𝜸'=>'𝜸','𝜹'=>'𝜹','𝜺'=>'𝜺','𝜻'=>'𝜻','𝜼'=>'𝜼','𝜽'=>'𝜽','𝜾'=>'𝜾','𝜿'=>'𝜿','𝝀'=>'𝝀','𝝁'=>'𝝁','𝝂'=>'𝝂','𝝃'=>'𝝃','𝝄'=>'𝝄','𝝅'=>'𝝅','𝝆'=>'𝝆','𝝇'=>'𝝇','𝝈'=>'𝝈','𝝉'=>'𝝉','𝝊'=>'𝝊','𝝋'=>'𝝋','𝝌'=>'𝝌','𝝍'=>'𝝍','𝝎'=>'𝝎','𝝐'=>'𝝐','𝝑'=>'𝝑','𝝒'=>'𝝒','𝝓'=>'𝝓','𝝔'=>'𝝔','𝝕'=>'𝝕','𝝖'=>'𝝖','𝝗'=>'𝝗','𝝘'=>'𝝘','𝝙'=>'𝝙','𝝚'=>'𝝚','𝝛'=>'𝝛','𝝜'=>'𝝜','𝝝'=>'𝝝','𝝞'=>'𝝞','𝝟'=>'𝝟','𝝠'=>'𝝠','𝝡'=>'𝝡','𝝢'=>'𝝢','𝝣'=>'𝝣','𝝤'=>'𝝤','𝝥'=>'𝝥','𝝦'=>'𝝦','𝝧'=>'𝝧','𝝨'=>'𝝨','𝝩'=>'𝝩','𝝪'=>'𝝪','𝝫'=>'𝝫','𝝬'=>'𝝬','𝝭'=>'𝝭','𝝮'=>'𝝮','𝝰'=>'𝝰','𝝱'=>'𝝱','𝝲'=>'𝝲','𝝳'=>'𝝳','𝝴'=>'𝝴','𝝵'=>'𝝵','𝝶'=>'𝝶','𝝷'=>'𝝷','𝝸'=>'𝝸','𝝹'=>'𝝹','𝝺'=>'𝝺','𝝻'=>'𝝻','𝝼'=>'𝝼','𝝽'=>'𝝽','𝝾'=>'𝝾','𝝿'=>'𝝿','𝞀'=>'𝞀','𝞁'=>'𝞁','𝞂'=>'𝞂','𝞃'=>'𝞃','𝞄'=>'𝞄','𝞅'=>'𝞅','𝞆'=>'𝞆','𝞇'=>'𝞇','𝞈'=>'𝞈','𝞊'=>'𝞊','𝞋'=>'𝞋','𝞌'=>'𝞌','𝞍'=>'𝞍','𝞎'=>'𝞎','𝞏'=>'𝞏','𝞐'=>'𝞐','𝞑'=>'𝞑','𝞒'=>'𝞒','𝞓'=>'𝞓','𝞔'=>'𝞔','𝞕'=>'𝞕','𝞖'=>'𝞖','𝞗'=>'𝞗','𝞘'=>'𝞘','𝞙'=>'𝞙','𝞚'=>'𝞚','𝞛'=>'𝞛','𝞜'=>'𝞜','𝞝'=>'𝞝','𝞞'=>'𝞞','𝞟'=>'𝞟','𝞠'=>'𝞠','𝞡'=>'𝞡','𝞢'=>'𝞢','𝞣'=>'𝞣','𝞤'=>'𝞤','𝞥'=>'𝞥','𝞦'=>'𝞦','𝞧'=>'𝞧','𝞨'=>'𝞨','𝞪'=>'𝞪','𝞫'=>'𝞫','𝞬'=>'𝞬','𝞭'=>'𝞭','𝞮'=>'𝞮','𝞯'=>'𝞯','𝞰'=>'𝞰','𝞱'=>'𝞱','𝞲'=>'𝞲','𝞳'=>'𝞳','𝞴'=>'𝞴','𝞵'=>'𝞵','𝞶'=>'𝞶','𝞷'=>'𝞷','𝞸'=>'𝞸','𝞹'=>'𝞹','𝞺'=>'𝞺','𝞻'=>'𝞻','𝞼'=>'𝞼','𝞽'=>'𝞽','𝞾'=>'𝞾','𝞿'=>'𝞿','𝟀'=>'𝟀','𝟁'=>'𝟁','𝟂'=>'𝟂','𝟄'=>'𝟄','𝟅'=>'𝟅','𝟆'=>'𝟆','𝟇'=>'𝟇','𝟈'=>'𝟈','𝟉'=>'𝟉','𝟊'=>'𝟊','𝟋'=>'𝟋','𝟎'=>'0','𝟏'=>'1','𝟐'=>'2','𝟑'=>'3','𝟒'=>'4','𝟓'=>'5','𝟔'=>'6','𝟕'=>'7','𝟖'=>'8','𝟗'=>'9','𝟘'=>'0','𝟙'=>'1','𝟚'=>'2','𝟛'=>'3','𝟜'=>'4','𝟝'=>'5','𝟞'=>'6','𝟟'=>'7','𝟠'=>'8','𝟡'=>'9','𝟢'=>'0','𝟣'=>'1','𝟤'=>'2','𝟥'=>'3','𝟦'=>'4','𝟧'=>'5','𝟨'=>'6','𝟩'=>'7','𝟪'=>'8','𝟫'=>'9','𝟬'=>'0','𝟭'=>'1','𝟮'=>'2','𝟯'=>'3','𝟰'=>'4','𝟱'=>'5','𝟲'=>'6','𝟳'=>'7','𝟴'=>'8','𝟵'=>'9','𝟶'=>'0','𝟷'=>'1','𝟸'=>'2','𝟹'=>'3','𝟺'=>'4','𝟻'=>'5','𝟼'=>'6','𝟽'=>'7','𝟾'=>'8','𝟿'=>'9');
diff --git a/phpBB/includes/utf/data/search_indexer_6.php b/phpBB/includes/utf/data/search_indexer_6.php
index f6d2ac0665..1ccce03a51 100644
--- a/phpBB/includes/utf/data/search_indexer_6.php
+++ b/phpBB/includes/utf/data/search_indexer_6.php
@@ -1 +1 @@
-<?php return array('々'=>'々','〆'=>'〆','〇'=>'0','〡'=>'1','〢'=>'2','〣'=>'3','〤'=>'4','〥'=>'5','〦'=>'6','〧'=>'7','〨'=>'8','〩'=>'9','〪'=>'〪','〫'=>'〫','〬'=>'〬','〭'=>'〭','〮'=>'〮','〯'=>'〯','〱'=>'〱','〲'=>'〲','〳'=>'〳','〴'=>'〴','〵'=>'〵','〸'=>'10','〹'=>'20','〺'=>'30','〻'=>'〻','〼'=>'〼','ぁ'=>'ぁ','あ'=>'あ','ぃ'=>'ぃ','い'=>'い','ぅ'=>'ぅ','う'=>'う','ぇ'=>'ぇ','え'=>'え','ぉ'=>'ぉ','お'=>'お','か'=>'か','が'=>'が','き'=>'き','ぎ'=>'ぎ','く'=>'く','ぐ'=>'ぐ','け'=>'け','げ'=>'げ','こ'=>'こ','ご'=>'ご','さ'=>'さ','ざ'=>'ざ','し'=>'し','じ'=>'じ','す'=>'す','ず'=>'ず','せ'=>'せ','ぜ'=>'ぜ','そ'=>'そ','ぞ'=>'ぞ','た'=>'た','だ'=>'だ','ち'=>'ち','ぢ'=>'ぢ','っ'=>'っ','つ'=>'つ','づ'=>'づ','て'=>'て','で'=>'で','と'=>'と','ど'=>'ど','な'=>'な','に'=>'に','ぬ'=>'ぬ','ね'=>'ね','の'=>'の','は'=>'は','ば'=>'ば','ぱ'=>'ぱ','ひ'=>'ひ','び'=>'び','ぴ'=>'ぴ','ふ'=>'ふ','ぶ'=>'ぶ','ぷ'=>'ぷ','へ'=>'へ','べ'=>'べ','ぺ'=>'ぺ','ほ'=>'ほ','ぼ'=>'ぼ','ぽ'=>'ぽ','ま'=>'ま','み'=>'み','む'=>'む','め'=>'め','も'=>'も','ゃ'=>'ゃ','や'=>'や','ゅ'=>'ゅ','ゆ'=>'ゆ','ょ'=>'ょ','よ'=>'よ','ら'=>'ら','り'=>'り','る'=>'る','れ'=>'れ','ろ'=>'ろ','ゎ'=>'ゎ','わ'=>'わ','ゐ'=>'ゐ','ゑ'=>'ゑ','を'=>'を','ん'=>'ん','ゔ'=>'ゔ','ゕ'=>'ゕ','ゖ'=>'ゖ','゙'=>'゙','゚'=>'゚','ゝ'=>'ゝ','ゞ'=>'ゞ','ゟ'=>'ゟ','ァ'=>'ァ','ア'=>'ア','ィ'=>'ィ','イ'=>'イ','ゥ'=>'ゥ','ウ'=>'ウ','ェ'=>'ェ','エ'=>'エ','ォ'=>'ォ','オ'=>'オ','カ'=>'カ','ガ'=>'ガ','キ'=>'キ','ギ'=>'ギ','ク'=>'ク','グ'=>'グ','ケ'=>'ケ','ゲ'=>'ゲ','コ'=>'コ','ゴ'=>'ゴ','サ'=>'サ','ザ'=>'ザ','シ'=>'シ','ジ'=>'ジ','ス'=>'ス','ズ'=>'ズ','セ'=>'セ','ゼ'=>'ゼ','ソ'=>'ソ','ゾ'=>'ゾ','タ'=>'タ','ダ'=>'ダ','チ'=>'チ','ヂ'=>'ヂ','ッ'=>'ッ','ツ'=>'ツ','ヅ'=>'ヅ','テ'=>'テ','デ'=>'デ','ト'=>'ト','ド'=>'ド','ナ'=>'ナ','ニ'=>'ニ','ヌ'=>'ヌ','ネ'=>'ネ','ノ'=>'ノ','ハ'=>'ハ','バ'=>'バ','パ'=>'パ','ヒ'=>'ヒ','ビ'=>'ビ','ピ'=>'ピ','フ'=>'フ','ブ'=>'ブ','プ'=>'プ','ヘ'=>'ヘ','ベ'=>'ベ','ペ'=>'ペ','ホ'=>'ホ','ボ'=>'ボ','ポ'=>'ポ','マ'=>'マ','ミ'=>'ミ','ム'=>'ム','メ'=>'メ','モ'=>'モ','ャ'=>'ャ','ヤ'=>'ヤ','ュ'=>'ュ','ユ'=>'ユ','ョ'=>'ョ','ヨ'=>'ヨ','ラ'=>'ラ','リ'=>'リ','ル'=>'ル','レ'=>'レ','ロ'=>'ロ','ヮ'=>'ヮ','ワ'=>'ワ','ヰ'=>'ヰ','ヱ'=>'ヱ','ヲ'=>'ヲ','ン'=>'ン','ヴ'=>'ヴ','ヵ'=>'ヵ','ヶ'=>'ヶ','ヷ'=>'ヷ','ヸ'=>'ヸ','ヹ'=>'ヹ','ヺ'=>'ヺ','ー'=>'ー','ヽ'=>'ヽ','ヾ'=>'ヾ','ヿ'=>'ヿ','ㄅ'=>'ㄅ','ㄆ'=>'ㄆ','ㄇ'=>'ㄇ','ㄈ'=>'ㄈ','ㄉ'=>'ㄉ','ㄊ'=>'ㄊ','ㄋ'=>'ㄋ','ㄌ'=>'ㄌ','ㄍ'=>'ㄍ','ㄎ'=>'ㄎ','ㄏ'=>'ㄏ','ㄐ'=>'ㄐ','ㄑ'=>'ㄑ','ㄒ'=>'ㄒ','ㄓ'=>'ㄓ','ㄔ'=>'ㄔ','ㄕ'=>'ㄕ','ㄖ'=>'ㄖ','ㄗ'=>'ㄗ','ㄘ'=>'ㄘ','ㄙ'=>'ㄙ','ㄚ'=>'ㄚ','ㄛ'=>'ㄛ','ㄜ'=>'ㄜ','ㄝ'=>'ㄝ','ㄞ'=>'ㄞ','ㄟ'=>'ㄟ','ㄠ'=>'ㄠ','ㄡ'=>'ㄡ','ㄢ'=>'ㄢ','ㄣ'=>'ㄣ','ㄤ'=>'ㄤ','ㄥ'=>'ㄥ','ㄦ'=>'ㄦ','ㄧ'=>'ㄧ','ㄨ'=>'ㄨ','ㄩ'=>'ㄩ','ㄪ'=>'ㄪ','ㄫ'=>'ㄫ','ㄬ'=>'ㄬ','ㄱ'=>'ㄱ','ㄲ'=>'ㄲ','ㄳ'=>'ㄳ','ㄴ'=>'ㄴ','ㄵ'=>'ㄵ','ㄶ'=>'ㄶ','ㄷ'=>'ㄷ','ㄸ'=>'ㄸ','ㄹ'=>'ㄹ','ㄺ'=>'ㄺ','ㄻ'=>'ㄻ','ㄼ'=>'ㄼ','ㄽ'=>'ㄽ','ㄾ'=>'ㄾ','ㄿ'=>'ㄿ','ㅀ'=>'ㅀ','ㅁ'=>'ㅁ','ㅂ'=>'ㅂ','ㅃ'=>'ㅃ','ㅄ'=>'ㅄ','ㅅ'=>'ㅅ','ㅆ'=>'ㅆ','ㅇ'=>'ㅇ','ㅈ'=>'ㅈ','ㅉ'=>'ㅉ','ㅊ'=>'ㅊ','ㅋ'=>'ㅋ','ㅌ'=>'ㅌ','ㅍ'=>'ㅍ','ㅎ'=>'ㅎ','ㅏ'=>'ㅏ','ㅐ'=>'ㅐ','ㅑ'=>'ㅑ','ㅒ'=>'ㅒ','ㅓ'=>'ㅓ','ㅔ'=>'ㅔ','ㅕ'=>'ㅕ','ㅖ'=>'ㅖ','ㅗ'=>'ㅗ','ㅘ'=>'ㅘ','ㅙ'=>'ㅙ','ㅚ'=>'ㅚ','ㅛ'=>'ㅛ','ㅜ'=>'ㅜ','ㅝ'=>'ㅝ','ㅞ'=>'ㅞ','ㅟ'=>'ㅟ','ㅠ'=>'ㅠ','ㅡ'=>'ㅡ','ㅢ'=>'ㅢ','ㅣ'=>'ㅣ','ㅤ'=>'ㅤ','ㅥ'=>'ㅥ','ㅦ'=>'ㅦ','ㅧ'=>'ㅧ','ㅨ'=>'ㅨ','ㅩ'=>'ㅩ','ㅪ'=>'ㅪ','ㅫ'=>'ㅫ','ㅬ'=>'ㅬ','ㅭ'=>'ㅭ','ㅮ'=>'ㅮ','ㅯ'=>'ㅯ','ㅰ'=>'ㅰ','ㅱ'=>'ㅱ','ㅲ'=>'ㅲ','ㅳ'=>'ㅳ','ㅴ'=>'ㅴ','ㅵ'=>'ㅵ','ㅶ'=>'ㅶ','ㅷ'=>'ㅷ','ㅸ'=>'ㅸ','ㅹ'=>'ㅹ','ㅺ'=>'ㅺ','ㅻ'=>'ㅻ','ㅼ'=>'ㅼ','ㅽ'=>'ㅽ','ㅾ'=>'ㅾ','ㅿ'=>'ㅿ','ㆀ'=>'ㆀ','ㆁ'=>'ㆁ','ㆂ'=>'ㆂ','ㆃ'=>'ㆃ','ㆄ'=>'ㆄ','ㆅ'=>'ㆅ','ㆆ'=>'ㆆ','ㆇ'=>'ㆇ','ㆈ'=>'ㆈ','ㆉ'=>'ㆉ','ㆊ'=>'ㆊ','ㆋ'=>'ㆋ','ㆌ'=>'ㆌ','ㆍ'=>'ㆍ','ㆎ'=>'ㆎ','㆒'=>'1','㆓'=>'2','㆔'=>'3','㆕'=>'4','ㆠ'=>'ㆠ','ㆡ'=>'ㆡ','ㆢ'=>'ㆢ','ㆣ'=>'ㆣ','ㆤ'=>'ㆤ','ㆥ'=>'ㆥ','ㆦ'=>'ㆦ','ㆧ'=>'ㆧ','ㆨ'=>'ㆨ','ㆩ'=>'ㆩ','ㆪ'=>'ㆪ','ㆫ'=>'ㆫ','ㆬ'=>'ㆬ','ㆭ'=>'ㆭ','ㆮ'=>'ㆮ','ㆯ'=>'ㆯ','ㆰ'=>'ㆰ','ㆱ'=>'ㆱ','ㆲ'=>'ㆲ','ㆳ'=>'ㆳ','ㆴ'=>'ㆴ','ㆵ'=>'ㆵ','ㆶ'=>'ㆶ','ㆷ'=>'ㆷ','ㇰ'=>'ㇰ','ㇱ'=>'ㇱ','ㇲ'=>'ㇲ','ㇳ'=>'ㇳ','ㇴ'=>'ㇴ','ㇵ'=>'ㇵ','ㇶ'=>'ㇶ','ㇷ'=>'ㇷ','ㇸ'=>'ㇸ','ㇹ'=>'ㇹ','ㇺ'=>'ㇺ','ㇻ'=>'ㇻ','ㇼ'=>'ㇼ','ㇽ'=>'ㇽ','ㇾ'=>'ㇾ','ㇿ'=>'ㇿ','㈠'=>'1','㈡'=>'2','㈢'=>'3','㈣'=>'4','㈤'=>'5','㈥'=>'6','㈦'=>'7','㈧'=>'8','㈨'=>'9','㈩'=>'10','㉑'=>'21','㉒'=>'22','㉓'=>'23','㉔'=>'24','㉕'=>'25','㉖'=>'26','㉗'=>'27','㉘'=>'28','㉙'=>'29','㉚'=>'30','㉛'=>'31','㉜'=>'32','㉝'=>'33','㉞'=>'34','㉟'=>'35','㊀'=>'1','㊁'=>'2','㊂'=>'3','㊃'=>'4','㊄'=>'5','㊅'=>'6','㊆'=>'7','㊇'=>'8','㊈'=>'9','㊉'=>'10','㊱'=>'36','㊲'=>'37','㊳'=>'38','㊴'=>'39','㊵'=>'40','㊶'=>'41','㊷'=>'42','㊸'=>'43','㊹'=>'44','㊺'=>'45','㊻'=>'46','㊼'=>'47','㊽'=>'48','㊾'=>'49','㊿'=>'50','㐀'=>'㐀'); \ No newline at end of file
+<?php return array('々'=>'々','〆'=>'〆','〇'=>'0','〡'=>'1','〢'=>'2','〣'=>'3','〤'=>'4','〥'=>'5','〦'=>'6','〧'=>'7','〨'=>'8','〩'=>'9','〪'=>'〪','〫'=>'〫','〬'=>'〬','〭'=>'〭','〮'=>'〮','〯'=>'〯','〱'=>'〱','〲'=>'〲','〳'=>'〳','〴'=>'〴','〵'=>'〵','〸'=>'10','〹'=>'20','〺'=>'30','〻'=>'〻','〼'=>'〼','ぁ'=>'ぁ','あ'=>'あ','ぃ'=>'ぃ','い'=>'い','ぅ'=>'ぅ','う'=>'う','ぇ'=>'ぇ','え'=>'え','ぉ'=>'ぉ','お'=>'お','か'=>'か','が'=>'が','き'=>'き','ぎ'=>'ぎ','く'=>'く','ぐ'=>'ぐ','け'=>'け','げ'=>'げ','こ'=>'こ','ご'=>'ご','さ'=>'さ','ざ'=>'ざ','し'=>'し','じ'=>'じ','す'=>'す','ず'=>'ず','せ'=>'せ','ぜ'=>'ぜ','そ'=>'そ','ぞ'=>'ぞ','た'=>'た','だ'=>'だ','ち'=>'ち','ぢ'=>'ぢ','っ'=>'っ','つ'=>'つ','づ'=>'づ','て'=>'て','で'=>'で','と'=>'と','ど'=>'ど','な'=>'な','に'=>'に','ぬ'=>'ぬ','ね'=>'ね','の'=>'の','は'=>'は','ば'=>'ば','ぱ'=>'ぱ','ひ'=>'ひ','び'=>'び','ぴ'=>'ぴ','ふ'=>'ふ','ぶ'=>'ぶ','ぷ'=>'ぷ','へ'=>'へ','べ'=>'べ','ぺ'=>'ぺ','ほ'=>'ほ','ぼ'=>'ぼ','ぽ'=>'ぽ','ま'=>'ま','み'=>'み','む'=>'む','め'=>'め','も'=>'も','ゃ'=>'ゃ','や'=>'や','ゅ'=>'ゅ','ゆ'=>'ゆ','ょ'=>'ょ','よ'=>'よ','ら'=>'ら','り'=>'り','る'=>'る','れ'=>'れ','ろ'=>'ろ','ゎ'=>'ゎ','わ'=>'わ','ゐ'=>'ゐ','ゑ'=>'ゑ','を'=>'を','ん'=>'ん','ゔ'=>'ゔ','ゕ'=>'ゕ','ゖ'=>'ゖ','゙'=>'゙','゚'=>'゚','ゝ'=>'ゝ','ゞ'=>'ゞ','ゟ'=>'ゟ','ァ'=>'ァ','ア'=>'ア','ィ'=>'ィ','イ'=>'イ','ゥ'=>'ゥ','ウ'=>'ウ','ェ'=>'ェ','エ'=>'エ','ォ'=>'ォ','オ'=>'オ','カ'=>'カ','ガ'=>'ガ','キ'=>'キ','ギ'=>'ギ','ク'=>'ク','グ'=>'グ','ケ'=>'ケ','ゲ'=>'ゲ','コ'=>'コ','ゴ'=>'ゴ','サ'=>'サ','ザ'=>'ザ','シ'=>'シ','ジ'=>'ジ','ス'=>'ス','ズ'=>'ズ','セ'=>'セ','ゼ'=>'ゼ','ソ'=>'ソ','ゾ'=>'ゾ','タ'=>'タ','ダ'=>'ダ','チ'=>'チ','ヂ'=>'ヂ','ッ'=>'ッ','ツ'=>'ツ','ヅ'=>'ヅ','テ'=>'テ','デ'=>'デ','ト'=>'ト','ド'=>'ド','ナ'=>'ナ','ニ'=>'ニ','ヌ'=>'ヌ','ネ'=>'ネ','ノ'=>'ノ','ハ'=>'ハ','バ'=>'バ','パ'=>'パ','ヒ'=>'ヒ','ビ'=>'ビ','ピ'=>'ピ','フ'=>'フ','ブ'=>'ブ','プ'=>'プ','ヘ'=>'ヘ','ベ'=>'ベ','ペ'=>'ペ','ホ'=>'ホ','ボ'=>'ボ','ポ'=>'ポ','マ'=>'マ','ミ'=>'ミ','ム'=>'ム','メ'=>'メ','モ'=>'モ','ャ'=>'ャ','ヤ'=>'ヤ','ュ'=>'ュ','ユ'=>'ユ','ョ'=>'ョ','ヨ'=>'ヨ','ラ'=>'ラ','リ'=>'リ','ル'=>'ル','レ'=>'レ','ロ'=>'ロ','ヮ'=>'ヮ','ワ'=>'ワ','ヰ'=>'ヰ','ヱ'=>'ヱ','ヲ'=>'ヲ','ン'=>'ン','ヴ'=>'ヴ','ヵ'=>'ヵ','ヶ'=>'ヶ','ヷ'=>'ヷ','ヸ'=>'ヸ','ヹ'=>'ヹ','ヺ'=>'ヺ','ー'=>'ー','ヽ'=>'ヽ','ヾ'=>'ヾ','ヿ'=>'ヿ','ㄅ'=>'ㄅ','ㄆ'=>'ㄆ','ㄇ'=>'ㄇ','ㄈ'=>'ㄈ','ㄉ'=>'ㄉ','ㄊ'=>'ㄊ','ㄋ'=>'ㄋ','ㄌ'=>'ㄌ','ㄍ'=>'ㄍ','ㄎ'=>'ㄎ','ㄏ'=>'ㄏ','ㄐ'=>'ㄐ','ㄑ'=>'ㄑ','ㄒ'=>'ㄒ','ㄓ'=>'ㄓ','ㄔ'=>'ㄔ','ㄕ'=>'ㄕ','ㄖ'=>'ㄖ','ㄗ'=>'ㄗ','ㄘ'=>'ㄘ','ㄙ'=>'ㄙ','ㄚ'=>'ㄚ','ㄛ'=>'ㄛ','ㄜ'=>'ㄜ','ㄝ'=>'ㄝ','ㄞ'=>'ㄞ','ㄟ'=>'ㄟ','ㄠ'=>'ㄠ','ㄡ'=>'ㄡ','ㄢ'=>'ㄢ','ㄣ'=>'ㄣ','ㄤ'=>'ㄤ','ㄥ'=>'ㄥ','ㄦ'=>'ㄦ','ㄧ'=>'ㄧ','ㄨ'=>'ㄨ','ㄩ'=>'ㄩ','ㄪ'=>'ㄪ','ㄫ'=>'ㄫ','ㄬ'=>'ㄬ','ㄱ'=>'ㄱ','ㄲ'=>'ㄲ','ㄳ'=>'ㄳ','ㄴ'=>'ㄴ','ㄵ'=>'ㄵ','ㄶ'=>'ㄶ','ㄷ'=>'ㄷ','ㄸ'=>'ㄸ','ㄹ'=>'ㄹ','ㄺ'=>'ㄺ','ㄻ'=>'ㄻ','ㄼ'=>'ㄼ','ㄽ'=>'ㄽ','ㄾ'=>'ㄾ','ㄿ'=>'ㄿ','ㅀ'=>'ㅀ','ㅁ'=>'ㅁ','ㅂ'=>'ㅂ','ㅃ'=>'ㅃ','ㅄ'=>'ㅄ','ㅅ'=>'ㅅ','ㅆ'=>'ㅆ','ㅇ'=>'ㅇ','ㅈ'=>'ㅈ','ㅉ'=>'ㅉ','ㅊ'=>'ㅊ','ㅋ'=>'ㅋ','ㅌ'=>'ㅌ','ㅍ'=>'ㅍ','ㅎ'=>'ㅎ','ㅏ'=>'ㅏ','ㅐ'=>'ㅐ','ㅑ'=>'ㅑ','ㅒ'=>'ㅒ','ㅓ'=>'ㅓ','ㅔ'=>'ㅔ','ㅕ'=>'ㅕ','ㅖ'=>'ㅖ','ㅗ'=>'ㅗ','ㅘ'=>'ㅘ','ㅙ'=>'ㅙ','ㅚ'=>'ㅚ','ㅛ'=>'ㅛ','ㅜ'=>'ㅜ','ㅝ'=>'ㅝ','ㅞ'=>'ㅞ','ㅟ'=>'ㅟ','ㅠ'=>'ㅠ','ㅡ'=>'ㅡ','ㅢ'=>'ㅢ','ㅣ'=>'ㅣ','ㅤ'=>'ㅤ','ㅥ'=>'ㅥ','ㅦ'=>'ㅦ','ㅧ'=>'ㅧ','ㅨ'=>'ㅨ','ㅩ'=>'ㅩ','ㅪ'=>'ㅪ','ㅫ'=>'ㅫ','ㅬ'=>'ㅬ','ㅭ'=>'ㅭ','ㅮ'=>'ㅮ','ㅯ'=>'ㅯ','ㅰ'=>'ㅰ','ㅱ'=>'ㅱ','ㅲ'=>'ㅲ','ㅳ'=>'ㅳ','ㅴ'=>'ㅴ','ㅵ'=>'ㅵ','ㅶ'=>'ㅶ','ㅷ'=>'ㅷ','ㅸ'=>'ㅸ','ㅹ'=>'ㅹ','ㅺ'=>'ㅺ','ㅻ'=>'ㅻ','ㅼ'=>'ㅼ','ㅽ'=>'ㅽ','ㅾ'=>'ㅾ','ㅿ'=>'ㅿ','ㆀ'=>'ㆀ','ㆁ'=>'ㆁ','ㆂ'=>'ㆂ','ㆃ'=>'ㆃ','ㆄ'=>'ㆄ','ㆅ'=>'ㆅ','ㆆ'=>'ㆆ','ㆇ'=>'ㆇ','ㆈ'=>'ㆈ','ㆉ'=>'ㆉ','ㆊ'=>'ㆊ','ㆋ'=>'ㆋ','ㆌ'=>'ㆌ','ㆍ'=>'ㆍ','ㆎ'=>'ㆎ','㆒'=>'1','㆓'=>'2','㆔'=>'3','㆕'=>'4','ㆠ'=>'ㆠ','ㆡ'=>'ㆡ','ㆢ'=>'ㆢ','ㆣ'=>'ㆣ','ㆤ'=>'ㆤ','ㆥ'=>'ㆥ','ㆦ'=>'ㆦ','ㆧ'=>'ㆧ','ㆨ'=>'ㆨ','ㆩ'=>'ㆩ','ㆪ'=>'ㆪ','ㆫ'=>'ㆫ','ㆬ'=>'ㆬ','ㆭ'=>'ㆭ','ㆮ'=>'ㆮ','ㆯ'=>'ㆯ','ㆰ'=>'ㆰ','ㆱ'=>'ㆱ','ㆲ'=>'ㆲ','ㆳ'=>'ㆳ','ㆴ'=>'ㆴ','ㆵ'=>'ㆵ','ㆶ'=>'ㆶ','ㆷ'=>'ㆷ','ㇰ'=>'ㇰ','ㇱ'=>'ㇱ','ㇲ'=>'ㇲ','ㇳ'=>'ㇳ','ㇴ'=>'ㇴ','ㇵ'=>'ㇵ','ㇶ'=>'ㇶ','ㇷ'=>'ㇷ','ㇸ'=>'ㇸ','ㇹ'=>'ㇹ','ㇺ'=>'ㇺ','ㇻ'=>'ㇻ','ㇼ'=>'ㇼ','ㇽ'=>'ㇽ','ㇾ'=>'ㇾ','ㇿ'=>'ㇿ','㈠'=>'1','㈡'=>'2','㈢'=>'3','㈣'=>'4','㈤'=>'5','㈥'=>'6','㈦'=>'7','㈧'=>'8','㈨'=>'9','㈩'=>'10','㉑'=>'21','㉒'=>'22','㉓'=>'23','㉔'=>'24','㉕'=>'25','㉖'=>'26','㉗'=>'27','㉘'=>'28','㉙'=>'29','㉚'=>'30','㉛'=>'31','㉜'=>'32','㉝'=>'33','㉞'=>'34','㉟'=>'35','㊀'=>'1','㊁'=>'2','㊂'=>'3','㊃'=>'4','㊄'=>'5','㊅'=>'6','㊆'=>'7','㊇'=>'8','㊈'=>'9','㊉'=>'10','㊱'=>'36','㊲'=>'37','㊳'=>'38','㊴'=>'39','㊵'=>'40','㊶'=>'41','㊷'=>'42','㊸'=>'43','㊹'=>'44','㊺'=>'45','㊻'=>'46','㊼'=>'47','㊽'=>'48','㊾'=>'49','㊿'=>'50','㐀'=>'㐀');
diff --git a/phpBB/includes/utf/data/search_indexer_64.php b/phpBB/includes/utf/data/search_indexer_64.php
index 44d0beb624..b5002d4c42 100644
--- a/phpBB/includes/utf/data/search_indexer_64.php
+++ b/phpBB/includes/utf/data/search_indexer_64.php
@@ -1 +1 @@
-<?php return array('𠀀'=>'𠀀'); \ No newline at end of file
+<?php return array('𠀀'=>'𠀀');
diff --git a/phpBB/includes/utf/data/search_indexer_84.php b/phpBB/includes/utf/data/search_indexer_84.php
index 5c3f1d54b8..c038215e58 100644
--- a/phpBB/includes/utf/data/search_indexer_84.php
+++ b/phpBB/includes/utf/data/search_indexer_84.php
@@ -1 +1 @@
-<?php return array('𪛖'=>'𪛖'); \ No newline at end of file
+<?php return array('𪛖'=>'𪛖');
diff --git a/phpBB/includes/utf/data/search_indexer_9.php b/phpBB/includes/utf/data/search_indexer_9.php
index bdf188291f..a358f784b9 100644
--- a/phpBB/includes/utf/data/search_indexer_9.php
+++ b/phpBB/includes/utf/data/search_indexer_9.php
@@ -1 +1 @@
-<?php return array('䶵'=>'䶵','一'=>'一'); \ No newline at end of file
+<?php return array('䶵'=>'䶵','一'=>'一');
diff --git a/phpBB/includes/utf/data/search_indexer_95.php b/phpBB/includes/utf/data/search_indexer_95.php
index b0f8eed3aa..63d27fbcd6 100644
--- a/phpBB/includes/utf/data/search_indexer_95.php
+++ b/phpBB/includes/utf/data/search_indexer_95.php
@@ -1 +1 @@
-<?php return array('丽'=>'丽','丸'=>'丸','乁'=>'乁','𠄢'=>'𠄢','你'=>'你','侮'=>'侮','侻'=>'侻','倂'=>'倂','偺'=>'偺','備'=>'備','僧'=>'僧','像'=>'像','㒞'=>'㒞','𠘺'=>'𠘺','免'=>'免','兔'=>'兔','兤'=>'兤','具'=>'具','𠔜'=>'𠔜','㒹'=>'㒹','內'=>'內','再'=>'再','𠕋'=>'𠕋','冗'=>'冗','冤'=>'冤','仌'=>'仌','冬'=>'冬','况'=>'况','𩇟'=>'𩇟','凵'=>'凵','刃'=>'刃','㓟'=>'㓟','刻'=>'刻','剆'=>'剆','割'=>'割','剷'=>'剷','㔕'=>'㔕','勇'=>'勇','勉'=>'勉','勤'=>'勤','勺'=>'勺','包'=>'包','匆'=>'匆','北'=>'北','卉'=>'卉','卑'=>'卑','博'=>'博','即'=>'即','卽'=>'卽','卿'=>'卿','卿'=>'卿','卿'=>'卿','𠨬'=>'𠨬','灰'=>'灰','及'=>'及','叟'=>'叟','𠭣'=>'𠭣','叫'=>'叫','叱'=>'叱','吆'=>'吆','咞'=>'咞','吸'=>'吸','呈'=>'呈','周'=>'周','咢'=>'咢','哶'=>'哶','唐'=>'唐','啓'=>'啓','啣'=>'啣','善'=>'善','善'=>'善','喙'=>'喙','喫'=>'喫','喳'=>'喳','嗂'=>'嗂','圖'=>'圖','嘆'=>'嘆','圗'=>'圗','噑'=>'噑','噴'=>'噴','切'=>'切','壮'=>'壮','城'=>'城','埴'=>'埴','堍'=>'堍','型'=>'型','堲'=>'堲','報'=>'報','墬'=>'墬','𡓤'=>'𡓤','売'=>'売','壷'=>'壷','夆'=>'夆','多'=>'多','夢'=>'夢','奢'=>'奢','𡚨'=>'𡚨','𡛪'=>'𡛪','姬'=>'姬','娛'=>'娛','娧'=>'娧','姘'=>'姘','婦'=>'婦','㛮'=>'㛮','㛼'=>'㛼','嬈'=>'嬈','嬾'=>'嬾','嬾'=>'嬾','𡧈'=>'𡧈','寃'=>'寃','寘'=>'寘','寧'=>'寧','寳'=>'寳','𡬘'=>'𡬘','寿'=>'寿','将'=>'将','当'=>'当','尢'=>'尢','㞁'=>'㞁','屠'=>'屠','屮'=>'屮','峀'=>'峀','岍'=>'岍','𡷤'=>'𡷤','嵃'=>'嵃','𡷦'=>'𡷦','嵮'=>'嵮','嵫'=>'嵫','嵼'=>'嵼','巡'=>'巡','巢'=>'巢','㠯'=>'㠯','巽'=>'巽','帨'=>'帨','帽'=>'帽','幩'=>'幩','㡢'=>'㡢','𢆃'=>'𢆃','㡼'=>'㡼','庰'=>'庰','庳'=>'庳','庶'=>'庶','廊'=>'廊','𪎒'=>'𪎒','廾'=>'廾','𢌱'=>'𢌱','𢌱'=>'𢌱','舁'=>'舁','弢'=>'弢','弢'=>'弢','㣇'=>'㣇','𣊸'=>'𣊸','𦇚'=>'𦇚','形'=>'形','彫'=>'彫','㣣'=>'㣣','徚'=>'徚','忍'=>'忍','志'=>'志','忹'=>'忹','悁'=>'悁','㤺'=>'㤺','㤜'=>'㤜','悔'=>'悔','𢛔'=>'𢛔','惇'=>'惇','慈'=>'慈','慌'=>'慌','慎'=>'慎','慌'=>'慌','慺'=>'慺','憎'=>'憎','憲'=>'憲','憤'=>'憤','憯'=>'憯','懞'=>'懞','懲'=>'懲','懶'=>'懶','成'=>'成','戛'=>'戛','扝'=>'扝','抱'=>'抱','拔'=>'拔','捐'=>'捐','𢬌'=>'𢬌','挽'=>'挽','拼'=>'拼','捨'=>'捨','掃'=>'掃','揤'=>'揤','𢯱'=>'𢯱','搢'=>'搢','揅'=>'揅','掩'=>'掩','㨮'=>'㨮','摩'=>'摩','摾'=>'摾','撝'=>'撝','摷'=>'摷','㩬'=>'㩬','敏'=>'敏','敬'=>'敬','𣀊'=>'𣀊','旣'=>'旣','書'=>'書','晉'=>'晉','㬙'=>'㬙','暑'=>'暑','㬈'=>'㬈','㫤'=>'㫤','冒'=>'冒','冕'=>'冕','最'=>'最','暜'=>'暜','肭'=>'肭','䏙'=>'䏙','朗'=>'朗','望'=>'望','朡'=>'朡','杞'=>'杞','杓'=>'杓','𣏃'=>'𣏃','㭉'=>'㭉','柺'=>'柺','枅'=>'枅','桒'=>'桒','梅'=>'梅','𣑭'=>'𣑭','梎'=>'梎','栟'=>'栟','椔'=>'椔','㮝'=>'㮝','楂'=>'楂','榣'=>'榣','槪'=>'槪','檨'=>'檨','𣚣'=>'𣚣','櫛'=>'櫛','㰘'=>'㰘','次'=>'次','𣢧'=>'𣢧','歔'=>'歔','㱎'=>'㱎','歲'=>'歲','殟'=>'殟','殺'=>'殺','殻'=>'殻','𣪍'=>'𣪍','𡴋'=>'𡴋','𣫺'=>'𣫺','汎'=>'汎','𣲼'=>'𣲼','沿'=>'沿','泍'=>'泍','汧'=>'汧','洖'=>'洖','派'=>'派','海'=>'海','流'=>'流','浩'=>'浩','浸'=>'浸','涅'=>'涅','𣴞'=>'𣴞','洴'=>'洴','港'=>'港','湮'=>'湮','㴳'=>'㴳','滋'=>'滋','滇'=>'滇','𣻑'=>'𣻑','淹'=>'淹','潮'=>'潮','𣽞'=>'𣽞','𣾎'=>'𣾎','濆'=>'濆','瀹'=>'瀹','瀞'=>'瀞','瀛'=>'瀛','㶖'=>'㶖','灊'=>'灊','災'=>'災','灷'=>'灷','炭'=>'炭','𠔥'=>'𠔥','煅'=>'煅','𤉣'=>'𤉣','熜'=>'熜','𤎫'=>'𤎫','爨'=>'爨','爵'=>'爵','牐'=>'牐','𤘈'=>'𤘈','犀'=>'犀','犕'=>'犕','𤜵'=>'𤜵','𤠔'=>'𤠔','獺'=>'獺','王'=>'王','㺬'=>'㺬','玥'=>'玥','㺸'=>'㺸','㺸'=>'㺸','瑇'=>'瑇','瑜'=>'瑜','瑱'=>'瑱','璅'=>'璅','瓊'=>'瓊','㼛'=>'㼛','甤'=>'甤','𤰶'=>'𤰶','甾'=>'甾','𤲒'=>'𤲒','異'=>'異','𢆟'=>'𢆟','瘐'=>'瘐','𤾡'=>'𤾡','𤾸'=>'𤾸','𥁄'=>'𥁄','㿼'=>'㿼','䀈'=>'䀈','直'=>'直','𥃳'=>'𥃳','𥃲'=>'𥃲','𥄙'=>'𥄙','𥄳'=>'𥄳','眞'=>'眞','真'=>'真','真'=>'真','睊'=>'睊','䀹'=>'䀹','瞋'=>'瞋','䁆'=>'䁆','䂖'=>'䂖','𥐝'=>'𥐝','硎'=>'硎','碌'=>'碌','磌'=>'磌','䃣'=>'䃣','𥘦'=>'𥘦','祖'=>'祖','𥚚'=>'𥚚','𥛅'=>'𥛅','福'=>'福','秫'=>'秫','䄯'=>'䄯','穀'=>'穀','穊'=>'穊','穏'=>'穏','𥥼'=>'𥥼','𥪧'=>'𥪧','𥪧'=>'𥪧','竮'=>'竮','䈂'=>'䈂','𥮫'=>'𥮫','篆'=>'篆','築'=>'築','䈧'=>'䈧','𥲀'=>'𥲀','糒'=>'糒','䊠'=>'䊠','糨'=>'糨','糣'=>'糣','紀'=>'紀','𥾆'=>'𥾆','絣'=>'絣','䌁'=>'䌁','緇'=>'緇','縂'=>'縂','繅'=>'繅','䌴'=>'䌴','𦈨'=>'𦈨','𦉇'=>'𦉇','䍙'=>'䍙','𦋙'=>'𦋙','罺'=>'罺','𦌾'=>'𦌾','羕'=>'羕','翺'=>'翺','者'=>'者','𦓚'=>'𦓚','𦔣'=>'𦔣','聠'=>'聠','𦖨'=>'𦖨','聰'=>'聰','𣍟'=>'𣍟','䏕'=>'䏕','育'=>'育','脃'=>'脃','䐋'=>'䐋','脾'=>'脾','媵'=>'媵','𦞧'=>'𦞧','𦞵'=>'𦞵','𣎓'=>'𣎓','𣎜'=>'𣎜','舁'=>'舁','舄'=>'舄','辞'=>'辞','䑫'=>'䑫','芑'=>'芑','芋'=>'芋','芝'=>'芝','劳'=>'劳','花'=>'花','芳'=>'芳','芽'=>'芽','苦'=>'苦','𦬼'=>'𦬼','若'=>'若','茝'=>'茝','荣'=>'荣','莭'=>'莭','茣'=>'茣','莽'=>'莽','菧'=>'菧','著'=>'著','荓'=>'荓','菊'=>'菊','菌'=>'菌','菜'=>'菜','𦰶'=>'𦰶','𦵫'=>'𦵫','𦳕'=>'𦳕','䔫'=>'䔫','蓱'=>'蓱','蓳'=>'蓳','蔖'=>'蔖','𧏊'=>'𧏊','蕤'=>'蕤','𦼬'=>'𦼬','䕝'=>'䕝','䕡'=>'䕡','𦾱'=>'𦾱','𧃒'=>'𧃒','䕫'=>'䕫','虐'=>'虐','虜'=>'虜','虧'=>'虧','虩'=>'虩','蚩'=>'蚩','蚈'=>'蚈','蜎'=>'蜎','蛢'=>'蛢','蝹'=>'蝹','蜨'=>'蜨','蝫'=>'蝫','螆'=>'螆','䗗'=>'䗗','蟡'=>'蟡','蠁'=>'蠁','䗹'=>'䗹','衠'=>'衠','衣'=>'衣','𧙧'=>'𧙧','裗'=>'裗','裞'=>'裞','䘵'=>'䘵','裺'=>'裺','㒻'=>'㒻','𧢮'=>'𧢮','𧥦'=>'𧥦','䚾'=>'䚾','䛇'=>'䛇','誠'=>'誠','諭'=>'諭','變'=>'變','豕'=>'豕','𧲨'=>'𧲨','貫'=>'貫','賁'=>'賁','贛'=>'贛','起'=>'起','𧼯'=>'𧼯','𠠄'=>'𠠄','跋'=>'跋','趼'=>'趼','跰'=>'跰','𠣞'=>'𠣞','軔'=>'軔','輸'=>'輸','𨗒'=>'𨗒','𨗭'=>'𨗭','邔'=>'邔','郱'=>'郱','鄑'=>'鄑','𨜮'=>'𨜮','鄛'=>'鄛','鈸'=>'鈸','鋗'=>'鋗','鋘'=>'鋘','鉼'=>'鉼','鏹'=>'鏹','鐕'=>'鐕','𨯺'=>'𨯺','開'=>'開','䦕'=>'䦕','閷'=>'閷','𨵷'=>'𨵷','䧦'=>'䧦','雃'=>'雃','嶲'=>'嶲','霣'=>'霣','𩅅'=>'𩅅','𩈚'=>'𩈚','䩮'=>'䩮','䩶'=>'䩶','韠'=>'韠','𩐊'=>'𩐊','䪲'=>'䪲','𩒖'=>'𩒖','頋'=>'頋','頋'=>'頋','頩'=>'頩','𩖶'=>'𩖶','飢'=>'飢','䬳'=>'䬳','餩'=>'餩','馧'=>'馧','駂'=>'駂','駾'=>'駾','䯎'=>'䯎','𩬰'=>'𩬰','鬒'=>'鬒','鱀'=>'鱀','鳽'=>'鳽','䳎'=>'䳎','䳭'=>'䳭','鵧'=>'鵧','𪃎'=>'𪃎','䳸'=>'䳸','𪄅'=>'𪄅','𪈎'=>'𪈎','𪊑'=>'𪊑','麻'=>'麻','䵖'=>'䵖','黹'=>'黹','黾'=>'黾','鼅'=>'鼅','鼏'=>'鼏','鼖'=>'鼖','鼻'=>'鼻','𪘀'=>'𪘀'); \ No newline at end of file
+<?php return array('丽'=>'丽','丸'=>'丸','乁'=>'乁','𠄢'=>'𠄢','你'=>'你','侮'=>'侮','侻'=>'侻','倂'=>'倂','偺'=>'偺','備'=>'備','僧'=>'僧','像'=>'像','㒞'=>'㒞','𠘺'=>'𠘺','免'=>'免','兔'=>'兔','兤'=>'兤','具'=>'具','𠔜'=>'𠔜','㒹'=>'㒹','內'=>'內','再'=>'再','𠕋'=>'𠕋','冗'=>'冗','冤'=>'冤','仌'=>'仌','冬'=>'冬','况'=>'况','𩇟'=>'𩇟','凵'=>'凵','刃'=>'刃','㓟'=>'㓟','刻'=>'刻','剆'=>'剆','割'=>'割','剷'=>'剷','㔕'=>'㔕','勇'=>'勇','勉'=>'勉','勤'=>'勤','勺'=>'勺','包'=>'包','匆'=>'匆','北'=>'北','卉'=>'卉','卑'=>'卑','博'=>'博','即'=>'即','卽'=>'卽','卿'=>'卿','卿'=>'卿','卿'=>'卿','𠨬'=>'𠨬','灰'=>'灰','及'=>'及','叟'=>'叟','𠭣'=>'𠭣','叫'=>'叫','叱'=>'叱','吆'=>'吆','咞'=>'咞','吸'=>'吸','呈'=>'呈','周'=>'周','咢'=>'咢','哶'=>'哶','唐'=>'唐','啓'=>'啓','啣'=>'啣','善'=>'善','善'=>'善','喙'=>'喙','喫'=>'喫','喳'=>'喳','嗂'=>'嗂','圖'=>'圖','嘆'=>'嘆','圗'=>'圗','噑'=>'噑','噴'=>'噴','切'=>'切','壮'=>'壮','城'=>'城','埴'=>'埴','堍'=>'堍','型'=>'型','堲'=>'堲','報'=>'報','墬'=>'墬','𡓤'=>'𡓤','売'=>'売','壷'=>'壷','夆'=>'夆','多'=>'多','夢'=>'夢','奢'=>'奢','𡚨'=>'𡚨','𡛪'=>'𡛪','姬'=>'姬','娛'=>'娛','娧'=>'娧','姘'=>'姘','婦'=>'婦','㛮'=>'㛮','㛼'=>'㛼','嬈'=>'嬈','嬾'=>'嬾','嬾'=>'嬾','𡧈'=>'𡧈','寃'=>'寃','寘'=>'寘','寧'=>'寧','寳'=>'寳','𡬘'=>'𡬘','寿'=>'寿','将'=>'将','当'=>'当','尢'=>'尢','㞁'=>'㞁','屠'=>'屠','屮'=>'屮','峀'=>'峀','岍'=>'岍','𡷤'=>'𡷤','嵃'=>'嵃','𡷦'=>'𡷦','嵮'=>'嵮','嵫'=>'嵫','嵼'=>'嵼','巡'=>'巡','巢'=>'巢','㠯'=>'㠯','巽'=>'巽','帨'=>'帨','帽'=>'帽','幩'=>'幩','㡢'=>'㡢','𢆃'=>'𢆃','㡼'=>'㡼','庰'=>'庰','庳'=>'庳','庶'=>'庶','廊'=>'廊','𪎒'=>'𪎒','廾'=>'廾','𢌱'=>'𢌱','𢌱'=>'𢌱','舁'=>'舁','弢'=>'弢','弢'=>'弢','㣇'=>'㣇','𣊸'=>'𣊸','𦇚'=>'𦇚','形'=>'形','彫'=>'彫','㣣'=>'㣣','徚'=>'徚','忍'=>'忍','志'=>'志','忹'=>'忹','悁'=>'悁','㤺'=>'㤺','㤜'=>'㤜','悔'=>'悔','𢛔'=>'𢛔','惇'=>'惇','慈'=>'慈','慌'=>'慌','慎'=>'慎','慌'=>'慌','慺'=>'慺','憎'=>'憎','憲'=>'憲','憤'=>'憤','憯'=>'憯','懞'=>'懞','懲'=>'懲','懶'=>'懶','成'=>'成','戛'=>'戛','扝'=>'扝','抱'=>'抱','拔'=>'拔','捐'=>'捐','𢬌'=>'𢬌','挽'=>'挽','拼'=>'拼','捨'=>'捨','掃'=>'掃','揤'=>'揤','𢯱'=>'𢯱','搢'=>'搢','揅'=>'揅','掩'=>'掩','㨮'=>'㨮','摩'=>'摩','摾'=>'摾','撝'=>'撝','摷'=>'摷','㩬'=>'㩬','敏'=>'敏','敬'=>'敬','𣀊'=>'𣀊','旣'=>'旣','書'=>'書','晉'=>'晉','㬙'=>'㬙','暑'=>'暑','㬈'=>'㬈','㫤'=>'㫤','冒'=>'冒','冕'=>'冕','最'=>'最','暜'=>'暜','肭'=>'肭','䏙'=>'䏙','朗'=>'朗','望'=>'望','朡'=>'朡','杞'=>'杞','杓'=>'杓','𣏃'=>'𣏃','㭉'=>'㭉','柺'=>'柺','枅'=>'枅','桒'=>'桒','梅'=>'梅','𣑭'=>'𣑭','梎'=>'梎','栟'=>'栟','椔'=>'椔','㮝'=>'㮝','楂'=>'楂','榣'=>'榣','槪'=>'槪','檨'=>'檨','𣚣'=>'𣚣','櫛'=>'櫛','㰘'=>'㰘','次'=>'次','𣢧'=>'𣢧','歔'=>'歔','㱎'=>'㱎','歲'=>'歲','殟'=>'殟','殺'=>'殺','殻'=>'殻','𣪍'=>'𣪍','𡴋'=>'𡴋','𣫺'=>'𣫺','汎'=>'汎','𣲼'=>'𣲼','沿'=>'沿','泍'=>'泍','汧'=>'汧','洖'=>'洖','派'=>'派','海'=>'海','流'=>'流','浩'=>'浩','浸'=>'浸','涅'=>'涅','𣴞'=>'𣴞','洴'=>'洴','港'=>'港','湮'=>'湮','㴳'=>'㴳','滋'=>'滋','滇'=>'滇','𣻑'=>'𣻑','淹'=>'淹','潮'=>'潮','𣽞'=>'𣽞','𣾎'=>'𣾎','濆'=>'濆','瀹'=>'瀹','瀞'=>'瀞','瀛'=>'瀛','㶖'=>'㶖','灊'=>'灊','災'=>'災','灷'=>'灷','炭'=>'炭','𠔥'=>'𠔥','煅'=>'煅','𤉣'=>'𤉣','熜'=>'熜','𤎫'=>'𤎫','爨'=>'爨','爵'=>'爵','牐'=>'牐','𤘈'=>'𤘈','犀'=>'犀','犕'=>'犕','𤜵'=>'𤜵','𤠔'=>'𤠔','獺'=>'獺','王'=>'王','㺬'=>'㺬','玥'=>'玥','㺸'=>'㺸','㺸'=>'㺸','瑇'=>'瑇','瑜'=>'瑜','瑱'=>'瑱','璅'=>'璅','瓊'=>'瓊','㼛'=>'㼛','甤'=>'甤','𤰶'=>'𤰶','甾'=>'甾','𤲒'=>'𤲒','異'=>'異','𢆟'=>'𢆟','瘐'=>'瘐','𤾡'=>'𤾡','𤾸'=>'𤾸','𥁄'=>'𥁄','㿼'=>'㿼','䀈'=>'䀈','直'=>'直','𥃳'=>'𥃳','𥃲'=>'𥃲','𥄙'=>'𥄙','𥄳'=>'𥄳','眞'=>'眞','真'=>'真','真'=>'真','睊'=>'睊','䀹'=>'䀹','瞋'=>'瞋','䁆'=>'䁆','䂖'=>'䂖','𥐝'=>'𥐝','硎'=>'硎','碌'=>'碌','磌'=>'磌','䃣'=>'䃣','𥘦'=>'𥘦','祖'=>'祖','𥚚'=>'𥚚','𥛅'=>'𥛅','福'=>'福','秫'=>'秫','䄯'=>'䄯','穀'=>'穀','穊'=>'穊','穏'=>'穏','𥥼'=>'𥥼','𥪧'=>'𥪧','𥪧'=>'𥪧','竮'=>'竮','䈂'=>'䈂','𥮫'=>'𥮫','篆'=>'篆','築'=>'築','䈧'=>'䈧','𥲀'=>'𥲀','糒'=>'糒','䊠'=>'䊠','糨'=>'糨','糣'=>'糣','紀'=>'紀','𥾆'=>'𥾆','絣'=>'絣','䌁'=>'䌁','緇'=>'緇','縂'=>'縂','繅'=>'繅','䌴'=>'䌴','𦈨'=>'𦈨','𦉇'=>'𦉇','䍙'=>'䍙','𦋙'=>'𦋙','罺'=>'罺','𦌾'=>'𦌾','羕'=>'羕','翺'=>'翺','者'=>'者','𦓚'=>'𦓚','𦔣'=>'𦔣','聠'=>'聠','𦖨'=>'𦖨','聰'=>'聰','𣍟'=>'𣍟','䏕'=>'䏕','育'=>'育','脃'=>'脃','䐋'=>'䐋','脾'=>'脾','媵'=>'媵','𦞧'=>'𦞧','𦞵'=>'𦞵','𣎓'=>'𣎓','𣎜'=>'𣎜','舁'=>'舁','舄'=>'舄','辞'=>'辞','䑫'=>'䑫','芑'=>'芑','芋'=>'芋','芝'=>'芝','劳'=>'劳','花'=>'花','芳'=>'芳','芽'=>'芽','苦'=>'苦','𦬼'=>'𦬼','若'=>'若','茝'=>'茝','荣'=>'荣','莭'=>'莭','茣'=>'茣','莽'=>'莽','菧'=>'菧','著'=>'著','荓'=>'荓','菊'=>'菊','菌'=>'菌','菜'=>'菜','𦰶'=>'𦰶','𦵫'=>'𦵫','𦳕'=>'𦳕','䔫'=>'䔫','蓱'=>'蓱','蓳'=>'蓳','蔖'=>'蔖','𧏊'=>'𧏊','蕤'=>'蕤','𦼬'=>'𦼬','䕝'=>'䕝','䕡'=>'䕡','𦾱'=>'𦾱','𧃒'=>'𧃒','䕫'=>'䕫','虐'=>'虐','虜'=>'虜','虧'=>'虧','虩'=>'虩','蚩'=>'蚩','蚈'=>'蚈','蜎'=>'蜎','蛢'=>'蛢','蝹'=>'蝹','蜨'=>'蜨','蝫'=>'蝫','螆'=>'螆','䗗'=>'䗗','蟡'=>'蟡','蠁'=>'蠁','䗹'=>'䗹','衠'=>'衠','衣'=>'衣','𧙧'=>'𧙧','裗'=>'裗','裞'=>'裞','䘵'=>'䘵','裺'=>'裺','㒻'=>'㒻','𧢮'=>'𧢮','𧥦'=>'𧥦','䚾'=>'䚾','䛇'=>'䛇','誠'=>'誠','諭'=>'諭','變'=>'變','豕'=>'豕','𧲨'=>'𧲨','貫'=>'貫','賁'=>'賁','贛'=>'贛','起'=>'起','𧼯'=>'𧼯','𠠄'=>'𠠄','跋'=>'跋','趼'=>'趼','跰'=>'跰','𠣞'=>'𠣞','軔'=>'軔','輸'=>'輸','𨗒'=>'𨗒','𨗭'=>'𨗭','邔'=>'邔','郱'=>'郱','鄑'=>'鄑','𨜮'=>'𨜮','鄛'=>'鄛','鈸'=>'鈸','鋗'=>'鋗','鋘'=>'鋘','鉼'=>'鉼','鏹'=>'鏹','鐕'=>'鐕','𨯺'=>'𨯺','開'=>'開','䦕'=>'䦕','閷'=>'閷','𨵷'=>'𨵷','䧦'=>'䧦','雃'=>'雃','嶲'=>'嶲','霣'=>'霣','𩅅'=>'𩅅','𩈚'=>'𩈚','䩮'=>'䩮','䩶'=>'䩶','韠'=>'韠','𩐊'=>'𩐊','䪲'=>'䪲','𩒖'=>'𩒖','頋'=>'頋','頋'=>'頋','頩'=>'頩','𩖶'=>'𩖶','飢'=>'飢','䬳'=>'䬳','餩'=>'餩','馧'=>'馧','駂'=>'駂','駾'=>'駾','䯎'=>'䯎','𩬰'=>'𩬰','鬒'=>'鬒','鱀'=>'鱀','鳽'=>'鳽','䳎'=>'䳎','䳭'=>'䳭','鵧'=>'鵧','𪃎'=>'𪃎','䳸'=>'䳸','𪄅'=>'𪄅','𪈎'=>'𪈎','𪊑'=>'𪊑','麻'=>'麻','䵖'=>'䵖','黹'=>'黹','黾'=>'黾','鼅'=>'鼅','鼏'=>'鼏','鼖'=>'鼖','鼻'=>'鼻','𪘀'=>'𪘀');
diff --git a/phpBB/includes/utf/data/utf_canonical_comp.php b/phpBB/includes/utf/data/utf_canonical_comp.php
index a3ed3ee602..2de3149ee8 100644
--- a/phpBB/includes/utf/data/utf_canonical_comp.php
+++ b/phpBB/includes/utf/data/utf_canonical_comp.php
@@ -1,2 +1,2 @@
<?php
-$GLOBALS['utf_canonical_comp']=array('À'=>'À','Á'=>'Á','Â'=>'Â','Ã'=>'Ã','Ä'=>'Ä','Å'=>'Å','Ç'=>'Ç','È'=>'È','É'=>'É','Ê'=>'Ê','Ë'=>'Ë','Ì'=>'Ì','Í'=>'Í','Î'=>'Î','Ï'=>'Ï','Ñ'=>'Ñ','Ò'=>'Ò','Ó'=>'Ó','Ô'=>'Ô','Õ'=>'Õ','Ö'=>'Ö','Ù'=>'Ù','Ú'=>'Ú','Û'=>'Û','Ü'=>'Ü','Ý'=>'Ý','à'=>'à','á'=>'á','â'=>'â','ã'=>'ã','ä'=>'ä','å'=>'å','ç'=>'ç','è'=>'è','é'=>'é','ê'=>'ê','ë'=>'ë','ì'=>'ì','í'=>'í','î'=>'î','ï'=>'ï','ñ'=>'ñ','ò'=>'ò','ó'=>'ó','ô'=>'ô','õ'=>'õ','ö'=>'ö','ù'=>'ù','ú'=>'ú','û'=>'û','ü'=>'ü','ý'=>'ý','ÿ'=>'ÿ','Ā'=>'Ā','ā'=>'ā','Ă'=>'Ă','ă'=>'ă','Ą'=>'Ą','ą'=>'ą','Ć'=>'Ć','ć'=>'ć','Ĉ'=>'Ĉ','ĉ'=>'ĉ','Ċ'=>'Ċ','ċ'=>'ċ','Č'=>'Č','č'=>'č','Ď'=>'Ď','ď'=>'ď','Ē'=>'Ē','ē'=>'ē','Ĕ'=>'Ĕ','ĕ'=>'ĕ','Ė'=>'Ė','ė'=>'ė','Ę'=>'Ę','ę'=>'ę','Ě'=>'Ě','ě'=>'ě','Ĝ'=>'Ĝ','ĝ'=>'ĝ','Ğ'=>'Ğ','ğ'=>'ğ','Ġ'=>'Ġ','ġ'=>'ġ','Ģ'=>'Ģ','ģ'=>'ģ','Ĥ'=>'Ĥ','ĥ'=>'ĥ','Ĩ'=>'Ĩ','ĩ'=>'ĩ','Ī'=>'Ī','ī'=>'ī','Ĭ'=>'Ĭ','ĭ'=>'ĭ','Į'=>'Į','į'=>'į','İ'=>'İ','Ĵ'=>'Ĵ','ĵ'=>'ĵ','Ķ'=>'Ķ','ķ'=>'ķ','Ĺ'=>'Ĺ','ĺ'=>'ĺ','Ļ'=>'Ļ','ļ'=>'ļ','Ľ'=>'Ľ','ľ'=>'ľ','Ń'=>'Ń','ń'=>'ń','Ņ'=>'Ņ','ņ'=>'ņ','Ň'=>'Ň','ň'=>'ň','Ō'=>'Ō','ō'=>'ō','Ŏ'=>'Ŏ','ŏ'=>'ŏ','Ő'=>'Ő','ő'=>'ő','Ŕ'=>'Ŕ','ŕ'=>'ŕ','Ŗ'=>'Ŗ','ŗ'=>'ŗ','Ř'=>'Ř','ř'=>'ř','Ś'=>'Ś','ś'=>'ś','Ŝ'=>'Ŝ','ŝ'=>'ŝ','Ş'=>'Ş','ş'=>'ş','Š'=>'Š','š'=>'š','Ţ'=>'Ţ','ţ'=>'ţ','Ť'=>'Ť','ť'=>'ť','Ũ'=>'Ũ','ũ'=>'ũ','Ū'=>'Ū','ū'=>'ū','Ŭ'=>'Ŭ','ŭ'=>'ŭ','Ů'=>'Ů','ů'=>'ů','Ű'=>'Ű','ű'=>'ű','Ų'=>'Ų','ų'=>'ų','Ŵ'=>'Ŵ','ŵ'=>'ŵ','Ŷ'=>'Ŷ','ŷ'=>'ŷ','Ÿ'=>'Ÿ','Ź'=>'Ź','ź'=>'ź','Ż'=>'Ż','ż'=>'ż','Ž'=>'Ž','ž'=>'ž','Ơ'=>'Ơ','ơ'=>'ơ','Ư'=>'Ư','ư'=>'ư','Ǎ'=>'Ǎ','ǎ'=>'ǎ','Ǐ'=>'Ǐ','ǐ'=>'ǐ','Ǒ'=>'Ǒ','ǒ'=>'ǒ','Ǔ'=>'Ǔ','ǔ'=>'ǔ','Ǖ'=>'Ǖ','ǖ'=>'ǖ','Ǘ'=>'Ǘ','ǘ'=>'ǘ','Ǚ'=>'Ǚ','ǚ'=>'ǚ','Ǜ'=>'Ǜ','ǜ'=>'ǜ','Ǟ'=>'Ǟ','ǟ'=>'ǟ','Ǡ'=>'Ǡ','ǡ'=>'ǡ','Ǣ'=>'Ǣ','ǣ'=>'ǣ','Ǧ'=>'Ǧ','ǧ'=>'ǧ','Ǩ'=>'Ǩ','ǩ'=>'ǩ','Ǫ'=>'Ǫ','ǫ'=>'ǫ','Ǭ'=>'Ǭ','ǭ'=>'ǭ','Ǯ'=>'Ǯ','ǯ'=>'ǯ','ǰ'=>'ǰ','Ǵ'=>'Ǵ','ǵ'=>'ǵ','Ǹ'=>'Ǹ','ǹ'=>'ǹ','Ǻ'=>'Ǻ','ǻ'=>'ǻ','Ǽ'=>'Ǽ','ǽ'=>'ǽ','Ǿ'=>'Ǿ','ǿ'=>'ǿ','Ȁ'=>'Ȁ','ȁ'=>'ȁ','Ȃ'=>'Ȃ','ȃ'=>'ȃ','Ȅ'=>'Ȅ','ȅ'=>'ȅ','Ȇ'=>'Ȇ','ȇ'=>'ȇ','Ȉ'=>'Ȉ','ȉ'=>'ȉ','Ȋ'=>'Ȋ','ȋ'=>'ȋ','Ȍ'=>'Ȍ','ȍ'=>'ȍ','Ȏ'=>'Ȏ','ȏ'=>'ȏ','Ȑ'=>'Ȑ','ȑ'=>'ȑ','Ȓ'=>'Ȓ','ȓ'=>'ȓ','Ȕ'=>'Ȕ','ȕ'=>'ȕ','Ȗ'=>'Ȗ','ȗ'=>'ȗ','Ș'=>'Ș','ș'=>'ș','Ț'=>'Ț','ț'=>'ț','Ȟ'=>'Ȟ','ȟ'=>'ȟ','Ȧ'=>'Ȧ','ȧ'=>'ȧ','Ȩ'=>'Ȩ','ȩ'=>'ȩ','Ȫ'=>'Ȫ','ȫ'=>'ȫ','Ȭ'=>'Ȭ','ȭ'=>'ȭ','Ȯ'=>'Ȯ','ȯ'=>'ȯ','Ȱ'=>'Ȱ','ȱ'=>'ȱ','Ȳ'=>'Ȳ','ȳ'=>'ȳ','̈́'=>'̈́','΅'=>'΅','Ά'=>'Ά','Έ'=>'Έ','Ή'=>'Ή','Ί'=>'Ί','Ό'=>'Ό','Ύ'=>'Ύ','Ώ'=>'Ώ','ΐ'=>'ΐ','Ϊ'=>'Ϊ','Ϋ'=>'Ϋ','ά'=>'ά','έ'=>'έ','ή'=>'ή','ί'=>'ί','ΰ'=>'ΰ','ϊ'=>'ϊ','ϋ'=>'ϋ','ό'=>'ό','ύ'=>'ύ','ώ'=>'ώ','ϓ'=>'ϓ','ϔ'=>'ϔ','Ѐ'=>'Ѐ','Ё'=>'Ё','Ѓ'=>'Ѓ','Ї'=>'Ї','Ќ'=>'Ќ','Ѝ'=>'Ѝ','Ў'=>'Ў','Й'=>'Й','й'=>'й','ѐ'=>'ѐ','ё'=>'ё','ѓ'=>'ѓ','ї'=>'ї','ќ'=>'ќ','ѝ'=>'ѝ','ў'=>'ў','Ѷ'=>'Ѷ','ѷ'=>'ѷ','Ӂ'=>'Ӂ','ӂ'=>'ӂ','Ӑ'=>'Ӑ','ӑ'=>'ӑ','Ӓ'=>'Ӓ','ӓ'=>'ӓ','Ӗ'=>'Ӗ','ӗ'=>'ӗ','Ӛ'=>'Ӛ','ӛ'=>'ӛ','Ӝ'=>'Ӝ','ӝ'=>'ӝ','Ӟ'=>'Ӟ','ӟ'=>'ӟ','Ӣ'=>'Ӣ','ӣ'=>'ӣ','Ӥ'=>'Ӥ','ӥ'=>'ӥ','Ӧ'=>'Ӧ','ӧ'=>'ӧ','Ӫ'=>'Ӫ','ӫ'=>'ӫ','Ӭ'=>'Ӭ','ӭ'=>'ӭ','Ӯ'=>'Ӯ','ӯ'=>'ӯ','Ӱ'=>'Ӱ','ӱ'=>'ӱ','Ӳ'=>'Ӳ','ӳ'=>'ӳ','Ӵ'=>'Ӵ','ӵ'=>'ӵ','Ӹ'=>'Ӹ','ӹ'=>'ӹ','آ'=>'آ','أ'=>'أ','ؤ'=>'ؤ','إ'=>'إ','ئ'=>'ئ','ۀ'=>'ۀ','ۂ'=>'ۂ','ۓ'=>'ۓ','ऩ'=>'ऩ','ऱ'=>'ऱ','ऴ'=>'ऴ','ো'=>'ো','ৌ'=>'ৌ','ୈ'=>'ୈ','ୋ'=>'ୋ','ୌ'=>'ୌ','ஔ'=>'ஔ','ொ'=>'ொ','ோ'=>'ோ','ௌ'=>'ௌ','ై'=>'ై','ೀ'=>'ೀ','ೇ'=>'ೇ','ೈ'=>'ೈ','ೊ'=>'ೊ','ೋ'=>'ೋ','ൊ'=>'ൊ','ോ'=>'ോ','ൌ'=>'ൌ','ේ'=>'ේ','ො'=>'ො','ෝ'=>'ෝ','ෞ'=>'ෞ','ཱི'=>'ཱི','ཱུ'=>'ཱུ','ཱྀ'=>'ཱྀ','ဦ'=>'ဦ','ᬆ'=>'ᬆ','ᬈ'=>'ᬈ','ᬊ'=>'ᬊ','ᬌ'=>'ᬌ','ᬎ'=>'ᬎ','ᬒ'=>'ᬒ','ᬻ'=>'ᬻ','ᬽ'=>'ᬽ','ᭀ'=>'ᭀ','ᭁ'=>'ᭁ','ᭃ'=>'ᭃ','Ḁ'=>'Ḁ','ḁ'=>'ḁ','Ḃ'=>'Ḃ','ḃ'=>'ḃ','Ḅ'=>'Ḅ','ḅ'=>'ḅ','Ḇ'=>'Ḇ','ḇ'=>'ḇ','Ḉ'=>'Ḉ','ḉ'=>'ḉ','Ḋ'=>'Ḋ','ḋ'=>'ḋ','Ḍ'=>'Ḍ','ḍ'=>'ḍ','Ḏ'=>'Ḏ','ḏ'=>'ḏ','Ḑ'=>'Ḑ','ḑ'=>'ḑ','Ḓ'=>'Ḓ','ḓ'=>'ḓ','Ḕ'=>'Ḕ','ḕ'=>'ḕ','Ḗ'=>'Ḗ','ḗ'=>'ḗ','Ḙ'=>'Ḙ','ḙ'=>'ḙ','Ḛ'=>'Ḛ','ḛ'=>'ḛ','Ḝ'=>'Ḝ','ḝ'=>'ḝ','Ḟ'=>'Ḟ','ḟ'=>'ḟ','Ḡ'=>'Ḡ','ḡ'=>'ḡ','Ḣ'=>'Ḣ','ḣ'=>'ḣ','Ḥ'=>'Ḥ','ḥ'=>'ḥ','Ḧ'=>'Ḧ','ḧ'=>'ḧ','Ḩ'=>'Ḩ','ḩ'=>'ḩ','Ḫ'=>'Ḫ','ḫ'=>'ḫ','Ḭ'=>'Ḭ','ḭ'=>'ḭ','Ḯ'=>'Ḯ','ḯ'=>'ḯ','Ḱ'=>'Ḱ','ḱ'=>'ḱ','Ḳ'=>'Ḳ','ḳ'=>'ḳ','Ḵ'=>'Ḵ','ḵ'=>'ḵ','Ḷ'=>'Ḷ','ḷ'=>'ḷ','Ḹ'=>'Ḹ','ḹ'=>'ḹ','Ḻ'=>'Ḻ','ḻ'=>'ḻ','Ḽ'=>'Ḽ','ḽ'=>'ḽ','Ḿ'=>'Ḿ','ḿ'=>'ḿ','Ṁ'=>'Ṁ','ṁ'=>'ṁ','Ṃ'=>'Ṃ','ṃ'=>'ṃ','Ṅ'=>'Ṅ','ṅ'=>'ṅ','Ṇ'=>'Ṇ','ṇ'=>'ṇ','Ṉ'=>'Ṉ','ṉ'=>'ṉ','Ṋ'=>'Ṋ','ṋ'=>'ṋ','Ṍ'=>'Ṍ','ṍ'=>'ṍ','Ṏ'=>'Ṏ','ṏ'=>'ṏ','Ṑ'=>'Ṑ','ṑ'=>'ṑ','Ṓ'=>'Ṓ','ṓ'=>'ṓ','Ṕ'=>'Ṕ','ṕ'=>'ṕ','Ṗ'=>'Ṗ','ṗ'=>'ṗ','Ṙ'=>'Ṙ','ṙ'=>'ṙ','Ṛ'=>'Ṛ','ṛ'=>'ṛ','Ṝ'=>'Ṝ','ṝ'=>'ṝ','Ṟ'=>'Ṟ','ṟ'=>'ṟ','Ṡ'=>'Ṡ','ṡ'=>'ṡ','Ṣ'=>'Ṣ','ṣ'=>'ṣ','Ṥ'=>'Ṥ','ṥ'=>'ṥ','Ṧ'=>'Ṧ','ṧ'=>'ṧ','Ṩ'=>'Ṩ','ṩ'=>'ṩ','Ṫ'=>'Ṫ','ṫ'=>'ṫ','Ṭ'=>'Ṭ','ṭ'=>'ṭ','Ṯ'=>'Ṯ','ṯ'=>'ṯ','Ṱ'=>'Ṱ','ṱ'=>'ṱ','Ṳ'=>'Ṳ','ṳ'=>'ṳ','Ṵ'=>'Ṵ','ṵ'=>'ṵ','Ṷ'=>'Ṷ','ṷ'=>'ṷ','Ṹ'=>'Ṹ','ṹ'=>'ṹ','Ṻ'=>'Ṻ','ṻ'=>'ṻ','Ṽ'=>'Ṽ','ṽ'=>'ṽ','Ṿ'=>'Ṿ','ṿ'=>'ṿ','Ẁ'=>'Ẁ','ẁ'=>'ẁ','Ẃ'=>'Ẃ','ẃ'=>'ẃ','Ẅ'=>'Ẅ','ẅ'=>'ẅ','Ẇ'=>'Ẇ','ẇ'=>'ẇ','Ẉ'=>'Ẉ','ẉ'=>'ẉ','Ẋ'=>'Ẋ','ẋ'=>'ẋ','Ẍ'=>'Ẍ','ẍ'=>'ẍ','Ẏ'=>'Ẏ','ẏ'=>'ẏ','Ẑ'=>'Ẑ','ẑ'=>'ẑ','Ẓ'=>'Ẓ','ẓ'=>'ẓ','Ẕ'=>'Ẕ','ẕ'=>'ẕ','ẖ'=>'ẖ','ẗ'=>'ẗ','ẘ'=>'ẘ','ẙ'=>'ẙ','ẛ'=>'ẛ','Ạ'=>'Ạ','ạ'=>'ạ','Ả'=>'Ả','ả'=>'ả','Ấ'=>'Ấ','ấ'=>'ấ','Ầ'=>'Ầ','ầ'=>'ầ','Ẩ'=>'Ẩ','ẩ'=>'ẩ','Ẫ'=>'Ẫ','ẫ'=>'ẫ','Ậ'=>'Ậ','ậ'=>'ậ','Ắ'=>'Ắ','ắ'=>'ắ','Ằ'=>'Ằ','ằ'=>'ằ','Ẳ'=>'Ẳ','ẳ'=>'ẳ','Ẵ'=>'Ẵ','ẵ'=>'ẵ','Ặ'=>'Ặ','ặ'=>'ặ','Ẹ'=>'Ẹ','ẹ'=>'ẹ','Ẻ'=>'Ẻ','ẻ'=>'ẻ','Ẽ'=>'Ẽ','ẽ'=>'ẽ','Ế'=>'Ế','ế'=>'ế','Ề'=>'Ề','ề'=>'ề','Ể'=>'Ể','ể'=>'ể','Ễ'=>'Ễ','ễ'=>'ễ','Ệ'=>'Ệ','ệ'=>'ệ','Ỉ'=>'Ỉ','ỉ'=>'ỉ','Ị'=>'Ị','ị'=>'ị','Ọ'=>'Ọ','ọ'=>'ọ','Ỏ'=>'Ỏ','ỏ'=>'ỏ','Ố'=>'Ố','ố'=>'ố','Ồ'=>'Ồ','ồ'=>'ồ','Ổ'=>'Ổ','ổ'=>'ổ','Ỗ'=>'Ỗ','ỗ'=>'ỗ','Ộ'=>'Ộ','ộ'=>'ộ','Ớ'=>'Ớ','ớ'=>'ớ','Ờ'=>'Ờ','ờ'=>'ờ','Ở'=>'Ở','ở'=>'ở','Ỡ'=>'Ỡ','ỡ'=>'ỡ','Ợ'=>'Ợ','ợ'=>'ợ','Ụ'=>'Ụ','ụ'=>'ụ','Ủ'=>'Ủ','ủ'=>'ủ','Ứ'=>'Ứ','ứ'=>'ứ','Ừ'=>'Ừ','ừ'=>'ừ','Ử'=>'Ử','ử'=>'ử','Ữ'=>'Ữ','ữ'=>'ữ','Ự'=>'Ự','ự'=>'ự','Ỳ'=>'Ỳ','ỳ'=>'ỳ','Ỵ'=>'Ỵ','ỵ'=>'ỵ','Ỷ'=>'Ỷ','ỷ'=>'ỷ','Ỹ'=>'Ỹ','ỹ'=>'ỹ','ἀ'=>'ἀ','ἁ'=>'ἁ','ἂ'=>'ἂ','ἃ'=>'ἃ','ἄ'=>'ἄ','ἅ'=>'ἅ','ἆ'=>'ἆ','ἇ'=>'ἇ','Ἀ'=>'Ἀ','Ἁ'=>'Ἁ','Ἂ'=>'Ἂ','Ἃ'=>'Ἃ','Ἄ'=>'Ἄ','Ἅ'=>'Ἅ','Ἆ'=>'Ἆ','Ἇ'=>'Ἇ','ἐ'=>'ἐ','ἑ'=>'ἑ','ἒ'=>'ἒ','ἓ'=>'ἓ','ἔ'=>'ἔ','ἕ'=>'ἕ','Ἐ'=>'Ἐ','Ἑ'=>'Ἑ','Ἒ'=>'Ἒ','Ἓ'=>'Ἓ','Ἔ'=>'Ἔ','Ἕ'=>'Ἕ','ἠ'=>'ἠ','ἡ'=>'ἡ','ἢ'=>'ἢ','ἣ'=>'ἣ','ἤ'=>'ἤ','ἥ'=>'ἥ','ἦ'=>'ἦ','ἧ'=>'ἧ','Ἠ'=>'Ἠ','Ἡ'=>'Ἡ','Ἢ'=>'Ἢ','Ἣ'=>'Ἣ','Ἤ'=>'Ἤ','Ἥ'=>'Ἥ','Ἦ'=>'Ἦ','Ἧ'=>'Ἧ','ἰ'=>'ἰ','ἱ'=>'ἱ','ἲ'=>'ἲ','ἳ'=>'ἳ','ἴ'=>'ἴ','ἵ'=>'ἵ','ἶ'=>'ἶ','ἷ'=>'ἷ','Ἰ'=>'Ἰ','Ἱ'=>'Ἱ','Ἲ'=>'Ἲ','Ἳ'=>'Ἳ','Ἴ'=>'Ἴ','Ἵ'=>'Ἵ','Ἶ'=>'Ἶ','Ἷ'=>'Ἷ','ὀ'=>'ὀ','ὁ'=>'ὁ','ὂ'=>'ὂ','ὃ'=>'ὃ','ὄ'=>'ὄ','ὅ'=>'ὅ','Ὀ'=>'Ὀ','Ὁ'=>'Ὁ','Ὂ'=>'Ὂ','Ὃ'=>'Ὃ','Ὄ'=>'Ὄ','Ὅ'=>'Ὅ','ὐ'=>'ὐ','ὑ'=>'ὑ','ὒ'=>'ὒ','ὓ'=>'ὓ','ὔ'=>'ὔ','ὕ'=>'ὕ','ὖ'=>'ὖ','ὗ'=>'ὗ','Ὑ'=>'Ὑ','Ὓ'=>'Ὓ','Ὕ'=>'Ὕ','Ὗ'=>'Ὗ','ὠ'=>'ὠ','ὡ'=>'ὡ','ὢ'=>'ὢ','ὣ'=>'ὣ','ὤ'=>'ὤ','ὥ'=>'ὥ','ὦ'=>'ὦ','ὧ'=>'ὧ','Ὠ'=>'Ὠ','Ὡ'=>'Ὡ','Ὢ'=>'Ὢ','Ὣ'=>'Ὣ','Ὤ'=>'Ὤ','Ὥ'=>'Ὥ','Ὦ'=>'Ὦ','Ὧ'=>'Ὧ','ὰ'=>'ὰ','ὲ'=>'ὲ','ὴ'=>'ὴ','ὶ'=>'ὶ','ὸ'=>'ὸ','ὺ'=>'ὺ','ὼ'=>'ὼ','ᾀ'=>'ᾀ','ᾁ'=>'ᾁ','ᾂ'=>'ᾂ','ᾃ'=>'ᾃ','ᾄ'=>'ᾄ','ᾅ'=>'ᾅ','ᾆ'=>'ᾆ','ᾇ'=>'ᾇ','ᾈ'=>'ᾈ','ᾉ'=>'ᾉ','ᾊ'=>'ᾊ','ᾋ'=>'ᾋ','ᾌ'=>'ᾌ','ᾍ'=>'ᾍ','ᾎ'=>'ᾎ','ᾏ'=>'ᾏ','ᾐ'=>'ᾐ','ᾑ'=>'ᾑ','ᾒ'=>'ᾒ','ᾓ'=>'ᾓ','ᾔ'=>'ᾔ','ᾕ'=>'ᾕ','ᾖ'=>'ᾖ','ᾗ'=>'ᾗ','ᾘ'=>'ᾘ','ᾙ'=>'ᾙ','ᾚ'=>'ᾚ','ᾛ'=>'ᾛ','ᾜ'=>'ᾜ','ᾝ'=>'ᾝ','ᾞ'=>'ᾞ','ᾟ'=>'ᾟ','ᾠ'=>'ᾠ','ᾡ'=>'ᾡ','ᾢ'=>'ᾢ','ᾣ'=>'ᾣ','ᾤ'=>'ᾤ','ᾥ'=>'ᾥ','ᾦ'=>'ᾦ','ᾧ'=>'ᾧ','ᾨ'=>'ᾨ','ᾩ'=>'ᾩ','ᾪ'=>'ᾪ','ᾫ'=>'ᾫ','ᾬ'=>'ᾬ','ᾭ'=>'ᾭ','ᾮ'=>'ᾮ','ᾯ'=>'ᾯ','ᾰ'=>'ᾰ','ᾱ'=>'ᾱ','ᾲ'=>'ᾲ','ᾳ'=>'ᾳ','ᾴ'=>'ᾴ','ᾶ'=>'ᾶ','ᾷ'=>'ᾷ','Ᾰ'=>'Ᾰ','Ᾱ'=>'Ᾱ','Ὰ'=>'Ὰ','ᾼ'=>'ᾼ','῁'=>'῁','ῂ'=>'ῂ','ῃ'=>'ῃ','ῄ'=>'ῄ','ῆ'=>'ῆ','ῇ'=>'ῇ','Ὲ'=>'Ὲ','Ὴ'=>'Ὴ','ῌ'=>'ῌ','῍'=>'῍','῎'=>'῎','῏'=>'῏','ῐ'=>'ῐ','ῑ'=>'ῑ','ῒ'=>'ῒ','ῖ'=>'ῖ','ῗ'=>'ῗ','Ῐ'=>'Ῐ','Ῑ'=>'Ῑ','Ὶ'=>'Ὶ','῝'=>'῝','῞'=>'῞','῟'=>'῟','ῠ'=>'ῠ','ῡ'=>'ῡ','ῢ'=>'ῢ','ῤ'=>'ῤ','ῥ'=>'ῥ','ῦ'=>'ῦ','ῧ'=>'ῧ','Ῠ'=>'Ῠ','Ῡ'=>'Ῡ','Ὺ'=>'Ὺ','Ῥ'=>'Ῥ','῭'=>'῭','ῲ'=>'ῲ','ῳ'=>'ῳ','ῴ'=>'ῴ','ῶ'=>'ῶ','ῷ'=>'ῷ','Ὸ'=>'Ὸ','Ὼ'=>'Ὼ','ῼ'=>'ῼ','↚'=>'↚','↛'=>'↛','↮'=>'↮','⇍'=>'⇍','⇎'=>'⇎','⇏'=>'⇏','∄'=>'∄','∉'=>'∉','∌'=>'∌','∤'=>'∤','∦'=>'∦','≁'=>'≁','≄'=>'≄','≇'=>'≇','≉'=>'≉','≠'=>'≠','≢'=>'≢','≭'=>'≭','≮'=>'≮','≯'=>'≯','≰'=>'≰','≱'=>'≱','≴'=>'≴','≵'=>'≵','≸'=>'≸','≹'=>'≹','⊀'=>'⊀','⊁'=>'⊁','⊄'=>'⊄','⊅'=>'⊅','⊈'=>'⊈','⊉'=>'⊉','⊬'=>'⊬','⊭'=>'⊭','⊮'=>'⊮','⊯'=>'⊯','⋠'=>'⋠','⋡'=>'⋡','⋢'=>'⋢','⋣'=>'⋣','⋪'=>'⋪','⋫'=>'⋫','⋬'=>'⋬','⋭'=>'⋭','が'=>'が','ぎ'=>'ぎ','ぐ'=>'ぐ','げ'=>'げ','ご'=>'ご','ざ'=>'ざ','じ'=>'じ','ず'=>'ず','ぜ'=>'ぜ','ぞ'=>'ぞ','だ'=>'だ','ぢ'=>'ぢ','づ'=>'づ','で'=>'で','ど'=>'ど','ば'=>'ば','ぱ'=>'ぱ','び'=>'び','ぴ'=>'ぴ','ぶ'=>'ぶ','ぷ'=>'ぷ','べ'=>'べ','ぺ'=>'ぺ','ぼ'=>'ぼ','ぽ'=>'ぽ','ゔ'=>'ゔ','ゞ'=>'ゞ','ガ'=>'ガ','ギ'=>'ギ','グ'=>'グ','ゲ'=>'ゲ','ゴ'=>'ゴ','ザ'=>'ザ','ジ'=>'ジ','ズ'=>'ズ','ゼ'=>'ゼ','ゾ'=>'ゾ','ダ'=>'ダ','ヂ'=>'ヂ','ヅ'=>'ヅ','デ'=>'デ','ド'=>'ド','バ'=>'バ','パ'=>'パ','ビ'=>'ビ','ピ'=>'ピ','ブ'=>'ブ','プ'=>'プ','ベ'=>'ベ','ペ'=>'ペ','ボ'=>'ボ','ポ'=>'ポ','ヴ'=>'ヴ','ヷ'=>'ヷ','ヸ'=>'ヸ','ヹ'=>'ヹ','ヺ'=>'ヺ','ヾ'=>'ヾ'); \ No newline at end of file
+$GLOBALS['utf_canonical_comp']=array('À'=>'À','Á'=>'Á','Â'=>'Â','Ã'=>'Ã','Ä'=>'Ä','Å'=>'Å','Ç'=>'Ç','È'=>'È','É'=>'É','Ê'=>'Ê','Ë'=>'Ë','Ì'=>'Ì','Í'=>'Í','Î'=>'Î','Ï'=>'Ï','Ñ'=>'Ñ','Ò'=>'Ò','Ó'=>'Ó','Ô'=>'Ô','Õ'=>'Õ','Ö'=>'Ö','Ù'=>'Ù','Ú'=>'Ú','Û'=>'Û','Ü'=>'Ü','Ý'=>'Ý','à'=>'à','á'=>'á','â'=>'â','ã'=>'ã','ä'=>'ä','å'=>'å','ç'=>'ç','è'=>'è','é'=>'é','ê'=>'ê','ë'=>'ë','ì'=>'ì','í'=>'í','î'=>'î','ï'=>'ï','ñ'=>'ñ','ò'=>'ò','ó'=>'ó','ô'=>'ô','õ'=>'õ','ö'=>'ö','ù'=>'ù','ú'=>'ú','û'=>'û','ü'=>'ü','ý'=>'ý','ÿ'=>'ÿ','Ā'=>'Ā','ā'=>'ā','Ă'=>'Ă','ă'=>'ă','Ą'=>'Ą','ą'=>'ą','Ć'=>'Ć','ć'=>'ć','Ĉ'=>'Ĉ','ĉ'=>'ĉ','Ċ'=>'Ċ','ċ'=>'ċ','Č'=>'Č','č'=>'č','Ď'=>'Ď','ď'=>'ď','Ē'=>'Ē','ē'=>'ē','Ĕ'=>'Ĕ','ĕ'=>'ĕ','Ė'=>'Ė','ė'=>'ė','Ę'=>'Ę','ę'=>'ę','Ě'=>'Ě','ě'=>'ě','Ĝ'=>'Ĝ','ĝ'=>'ĝ','Ğ'=>'Ğ','ğ'=>'ğ','Ġ'=>'Ġ','ġ'=>'ġ','Ģ'=>'Ģ','ģ'=>'ģ','Ĥ'=>'Ĥ','ĥ'=>'ĥ','Ĩ'=>'Ĩ','ĩ'=>'ĩ','Ī'=>'Ī','ī'=>'ī','Ĭ'=>'Ĭ','ĭ'=>'ĭ','Į'=>'Į','į'=>'į','İ'=>'İ','Ĵ'=>'Ĵ','ĵ'=>'ĵ','Ķ'=>'Ķ','ķ'=>'ķ','Ĺ'=>'Ĺ','ĺ'=>'ĺ','Ļ'=>'Ļ','ļ'=>'ļ','Ľ'=>'Ľ','ľ'=>'ľ','Ń'=>'Ń','ń'=>'ń','Ņ'=>'Ņ','ņ'=>'ņ','Ň'=>'Ň','ň'=>'ň','Ō'=>'Ō','ō'=>'ō','Ŏ'=>'Ŏ','ŏ'=>'ŏ','Ő'=>'Ő','ő'=>'ő','Ŕ'=>'Ŕ','ŕ'=>'ŕ','Ŗ'=>'Ŗ','ŗ'=>'ŗ','Ř'=>'Ř','ř'=>'ř','Ś'=>'Ś','ś'=>'ś','Ŝ'=>'Ŝ','ŝ'=>'ŝ','Ş'=>'Ş','ş'=>'ş','Š'=>'Š','š'=>'š','Ţ'=>'Ţ','ţ'=>'ţ','Ť'=>'Ť','ť'=>'ť','Ũ'=>'Ũ','ũ'=>'ũ','Ū'=>'Ū','ū'=>'ū','Ŭ'=>'Ŭ','ŭ'=>'ŭ','Ů'=>'Ů','ů'=>'ů','Ű'=>'Ű','ű'=>'ű','Ų'=>'Ų','ų'=>'ų','Ŵ'=>'Ŵ','ŵ'=>'ŵ','Ŷ'=>'Ŷ','ŷ'=>'ŷ','Ÿ'=>'Ÿ','Ź'=>'Ź','ź'=>'ź','Ż'=>'Ż','ż'=>'ż','Ž'=>'Ž','ž'=>'ž','Ơ'=>'Ơ','ơ'=>'ơ','Ư'=>'Ư','ư'=>'ư','Ǎ'=>'Ǎ','ǎ'=>'ǎ','Ǐ'=>'Ǐ','ǐ'=>'ǐ','Ǒ'=>'Ǒ','ǒ'=>'ǒ','Ǔ'=>'Ǔ','ǔ'=>'ǔ','Ǖ'=>'Ǖ','ǖ'=>'ǖ','Ǘ'=>'Ǘ','ǘ'=>'ǘ','Ǚ'=>'Ǚ','ǚ'=>'ǚ','Ǜ'=>'Ǜ','ǜ'=>'ǜ','Ǟ'=>'Ǟ','ǟ'=>'ǟ','Ǡ'=>'Ǡ','ǡ'=>'ǡ','Ǣ'=>'Ǣ','ǣ'=>'ǣ','Ǧ'=>'Ǧ','ǧ'=>'ǧ','Ǩ'=>'Ǩ','ǩ'=>'ǩ','Ǫ'=>'Ǫ','ǫ'=>'ǫ','Ǭ'=>'Ǭ','ǭ'=>'ǭ','Ǯ'=>'Ǯ','ǯ'=>'ǯ','ǰ'=>'ǰ','Ǵ'=>'Ǵ','ǵ'=>'ǵ','Ǹ'=>'Ǹ','ǹ'=>'ǹ','Ǻ'=>'Ǻ','ǻ'=>'ǻ','Ǽ'=>'Ǽ','ǽ'=>'ǽ','Ǿ'=>'Ǿ','ǿ'=>'ǿ','Ȁ'=>'Ȁ','ȁ'=>'ȁ','Ȃ'=>'Ȃ','ȃ'=>'ȃ','Ȅ'=>'Ȅ','ȅ'=>'ȅ','Ȇ'=>'Ȇ','ȇ'=>'ȇ','Ȉ'=>'Ȉ','ȉ'=>'ȉ','Ȋ'=>'Ȋ','ȋ'=>'ȋ','Ȍ'=>'Ȍ','ȍ'=>'ȍ','Ȏ'=>'Ȏ','ȏ'=>'ȏ','Ȑ'=>'Ȑ','ȑ'=>'ȑ','Ȓ'=>'Ȓ','ȓ'=>'ȓ','Ȕ'=>'Ȕ','ȕ'=>'ȕ','Ȗ'=>'Ȗ','ȗ'=>'ȗ','Ș'=>'Ș','ș'=>'ș','Ț'=>'Ț','ț'=>'ț','Ȟ'=>'Ȟ','ȟ'=>'ȟ','Ȧ'=>'Ȧ','ȧ'=>'ȧ','Ȩ'=>'Ȩ','ȩ'=>'ȩ','Ȫ'=>'Ȫ','ȫ'=>'ȫ','Ȭ'=>'Ȭ','ȭ'=>'ȭ','Ȯ'=>'Ȯ','ȯ'=>'ȯ','Ȱ'=>'Ȱ','ȱ'=>'ȱ','Ȳ'=>'Ȳ','ȳ'=>'ȳ','̈́'=>'̈́','΅'=>'΅','Ά'=>'Ά','Έ'=>'Έ','Ή'=>'Ή','Ί'=>'Ί','Ό'=>'Ό','Ύ'=>'Ύ','Ώ'=>'Ώ','ΐ'=>'ΐ','Ϊ'=>'Ϊ','Ϋ'=>'Ϋ','ά'=>'ά','έ'=>'έ','ή'=>'ή','ί'=>'ί','ΰ'=>'ΰ','ϊ'=>'ϊ','ϋ'=>'ϋ','ό'=>'ό','ύ'=>'ύ','ώ'=>'ώ','ϓ'=>'ϓ','ϔ'=>'ϔ','Ѐ'=>'Ѐ','Ё'=>'Ё','Ѓ'=>'Ѓ','Ї'=>'Ї','Ќ'=>'Ќ','Ѝ'=>'Ѝ','Ў'=>'Ў','Й'=>'Й','й'=>'й','ѐ'=>'ѐ','ё'=>'ё','ѓ'=>'ѓ','ї'=>'ї','ќ'=>'ќ','ѝ'=>'ѝ','ў'=>'ў','Ѷ'=>'Ѷ','ѷ'=>'ѷ','Ӂ'=>'Ӂ','ӂ'=>'ӂ','Ӑ'=>'Ӑ','ӑ'=>'ӑ','Ӓ'=>'Ӓ','ӓ'=>'ӓ','Ӗ'=>'Ӗ','ӗ'=>'ӗ','Ӛ'=>'Ӛ','ӛ'=>'ӛ','Ӝ'=>'Ӝ','ӝ'=>'ӝ','Ӟ'=>'Ӟ','ӟ'=>'ӟ','Ӣ'=>'Ӣ','ӣ'=>'ӣ','Ӥ'=>'Ӥ','ӥ'=>'ӥ','Ӧ'=>'Ӧ','ӧ'=>'ӧ','Ӫ'=>'Ӫ','ӫ'=>'ӫ','Ӭ'=>'Ӭ','ӭ'=>'ӭ','Ӯ'=>'Ӯ','ӯ'=>'ӯ','Ӱ'=>'Ӱ','ӱ'=>'ӱ','Ӳ'=>'Ӳ','ӳ'=>'ӳ','Ӵ'=>'Ӵ','ӵ'=>'ӵ','Ӹ'=>'Ӹ','ӹ'=>'ӹ','آ'=>'آ','أ'=>'أ','ؤ'=>'ؤ','إ'=>'إ','ئ'=>'ئ','ۀ'=>'ۀ','ۂ'=>'ۂ','ۓ'=>'ۓ','ऩ'=>'ऩ','ऱ'=>'ऱ','ऴ'=>'ऴ','ো'=>'ো','ৌ'=>'ৌ','ୈ'=>'ୈ','ୋ'=>'ୋ','ୌ'=>'ୌ','ஔ'=>'ஔ','ொ'=>'ொ','ோ'=>'ோ','ௌ'=>'ௌ','ై'=>'ై','ೀ'=>'ೀ','ೇ'=>'ೇ','ೈ'=>'ೈ','ೊ'=>'ೊ','ೋ'=>'ೋ','ൊ'=>'ൊ','ോ'=>'ോ','ൌ'=>'ൌ','ේ'=>'ේ','ො'=>'ො','ෝ'=>'ෝ','ෞ'=>'ෞ','ཱི'=>'ཱི','ཱུ'=>'ཱུ','ཱྀ'=>'ཱྀ','ဦ'=>'ဦ','ᬆ'=>'ᬆ','ᬈ'=>'ᬈ','ᬊ'=>'ᬊ','ᬌ'=>'ᬌ','ᬎ'=>'ᬎ','ᬒ'=>'ᬒ','ᬻ'=>'ᬻ','ᬽ'=>'ᬽ','ᭀ'=>'ᭀ','ᭁ'=>'ᭁ','ᭃ'=>'ᭃ','Ḁ'=>'Ḁ','ḁ'=>'ḁ','Ḃ'=>'Ḃ','ḃ'=>'ḃ','Ḅ'=>'Ḅ','ḅ'=>'ḅ','Ḇ'=>'Ḇ','ḇ'=>'ḇ','Ḉ'=>'Ḉ','ḉ'=>'ḉ','Ḋ'=>'Ḋ','ḋ'=>'ḋ','Ḍ'=>'Ḍ','ḍ'=>'ḍ','Ḏ'=>'Ḏ','ḏ'=>'ḏ','Ḑ'=>'Ḑ','ḑ'=>'ḑ','Ḓ'=>'Ḓ','ḓ'=>'ḓ','Ḕ'=>'Ḕ','ḕ'=>'ḕ','Ḗ'=>'Ḗ','ḗ'=>'ḗ','Ḙ'=>'Ḙ','ḙ'=>'ḙ','Ḛ'=>'Ḛ','ḛ'=>'ḛ','Ḝ'=>'Ḝ','ḝ'=>'ḝ','Ḟ'=>'Ḟ','ḟ'=>'ḟ','Ḡ'=>'Ḡ','ḡ'=>'ḡ','Ḣ'=>'Ḣ','ḣ'=>'ḣ','Ḥ'=>'Ḥ','ḥ'=>'ḥ','Ḧ'=>'Ḧ','ḧ'=>'ḧ','Ḩ'=>'Ḩ','ḩ'=>'ḩ','Ḫ'=>'Ḫ','ḫ'=>'ḫ','Ḭ'=>'Ḭ','ḭ'=>'ḭ','Ḯ'=>'Ḯ','ḯ'=>'ḯ','Ḱ'=>'Ḱ','ḱ'=>'ḱ','Ḳ'=>'Ḳ','ḳ'=>'ḳ','Ḵ'=>'Ḵ','ḵ'=>'ḵ','Ḷ'=>'Ḷ','ḷ'=>'ḷ','Ḹ'=>'Ḹ','ḹ'=>'ḹ','Ḻ'=>'Ḻ','ḻ'=>'ḻ','Ḽ'=>'Ḽ','ḽ'=>'ḽ','Ḿ'=>'Ḿ','ḿ'=>'ḿ','Ṁ'=>'Ṁ','ṁ'=>'ṁ','Ṃ'=>'Ṃ','ṃ'=>'ṃ','Ṅ'=>'Ṅ','ṅ'=>'ṅ','Ṇ'=>'Ṇ','ṇ'=>'ṇ','Ṉ'=>'Ṉ','ṉ'=>'ṉ','Ṋ'=>'Ṋ','ṋ'=>'ṋ','Ṍ'=>'Ṍ','ṍ'=>'ṍ','Ṏ'=>'Ṏ','ṏ'=>'ṏ','Ṑ'=>'Ṑ','ṑ'=>'ṑ','Ṓ'=>'Ṓ','ṓ'=>'ṓ','Ṕ'=>'Ṕ','ṕ'=>'ṕ','Ṗ'=>'Ṗ','ṗ'=>'ṗ','Ṙ'=>'Ṙ','ṙ'=>'ṙ','Ṛ'=>'Ṛ','ṛ'=>'ṛ','Ṝ'=>'Ṝ','ṝ'=>'ṝ','Ṟ'=>'Ṟ','ṟ'=>'ṟ','Ṡ'=>'Ṡ','ṡ'=>'ṡ','Ṣ'=>'Ṣ','ṣ'=>'ṣ','Ṥ'=>'Ṥ','ṥ'=>'ṥ','Ṧ'=>'Ṧ','ṧ'=>'ṧ','Ṩ'=>'Ṩ','ṩ'=>'ṩ','Ṫ'=>'Ṫ','ṫ'=>'ṫ','Ṭ'=>'Ṭ','ṭ'=>'ṭ','Ṯ'=>'Ṯ','ṯ'=>'ṯ','Ṱ'=>'Ṱ','ṱ'=>'ṱ','Ṳ'=>'Ṳ','ṳ'=>'ṳ','Ṵ'=>'Ṵ','ṵ'=>'ṵ','Ṷ'=>'Ṷ','ṷ'=>'ṷ','Ṹ'=>'Ṹ','ṹ'=>'ṹ','Ṻ'=>'Ṻ','ṻ'=>'ṻ','Ṽ'=>'Ṽ','ṽ'=>'ṽ','Ṿ'=>'Ṿ','ṿ'=>'ṿ','Ẁ'=>'Ẁ','ẁ'=>'ẁ','Ẃ'=>'Ẃ','ẃ'=>'ẃ','Ẅ'=>'Ẅ','ẅ'=>'ẅ','Ẇ'=>'Ẇ','ẇ'=>'ẇ','Ẉ'=>'Ẉ','ẉ'=>'ẉ','Ẋ'=>'Ẋ','ẋ'=>'ẋ','Ẍ'=>'Ẍ','ẍ'=>'ẍ','Ẏ'=>'Ẏ','ẏ'=>'ẏ','Ẑ'=>'Ẑ','ẑ'=>'ẑ','Ẓ'=>'Ẓ','ẓ'=>'ẓ','Ẕ'=>'Ẕ','ẕ'=>'ẕ','ẖ'=>'ẖ','ẗ'=>'ẗ','ẘ'=>'ẘ','ẙ'=>'ẙ','ẛ'=>'ẛ','Ạ'=>'Ạ','ạ'=>'ạ','Ả'=>'Ả','ả'=>'ả','Ấ'=>'Ấ','ấ'=>'ấ','Ầ'=>'Ầ','ầ'=>'ầ','Ẩ'=>'Ẩ','ẩ'=>'ẩ','Ẫ'=>'Ẫ','ẫ'=>'ẫ','Ậ'=>'Ậ','ậ'=>'ậ','Ắ'=>'Ắ','ắ'=>'ắ','Ằ'=>'Ằ','ằ'=>'ằ','Ẳ'=>'Ẳ','ẳ'=>'ẳ','Ẵ'=>'Ẵ','ẵ'=>'ẵ','Ặ'=>'Ặ','ặ'=>'ặ','Ẹ'=>'Ẹ','ẹ'=>'ẹ','Ẻ'=>'Ẻ','ẻ'=>'ẻ','Ẽ'=>'Ẽ','ẽ'=>'ẽ','Ế'=>'Ế','ế'=>'ế','Ề'=>'Ề','ề'=>'ề','Ể'=>'Ể','ể'=>'ể','Ễ'=>'Ễ','ễ'=>'ễ','Ệ'=>'Ệ','ệ'=>'ệ','Ỉ'=>'Ỉ','ỉ'=>'ỉ','Ị'=>'Ị','ị'=>'ị','Ọ'=>'Ọ','ọ'=>'ọ','Ỏ'=>'Ỏ','ỏ'=>'ỏ','Ố'=>'Ố','ố'=>'ố','Ồ'=>'Ồ','ồ'=>'ồ','Ổ'=>'Ổ','ổ'=>'ổ','Ỗ'=>'Ỗ','ỗ'=>'ỗ','Ộ'=>'Ộ','ộ'=>'ộ','Ớ'=>'Ớ','ớ'=>'ớ','Ờ'=>'Ờ','ờ'=>'ờ','Ở'=>'Ở','ở'=>'ở','Ỡ'=>'Ỡ','ỡ'=>'ỡ','Ợ'=>'Ợ','ợ'=>'ợ','Ụ'=>'Ụ','ụ'=>'ụ','Ủ'=>'Ủ','ủ'=>'ủ','Ứ'=>'Ứ','ứ'=>'ứ','Ừ'=>'Ừ','ừ'=>'ừ','Ử'=>'Ử','ử'=>'ử','Ữ'=>'Ữ','ữ'=>'ữ','Ự'=>'Ự','ự'=>'ự','Ỳ'=>'Ỳ','ỳ'=>'ỳ','Ỵ'=>'Ỵ','ỵ'=>'ỵ','Ỷ'=>'Ỷ','ỷ'=>'ỷ','Ỹ'=>'Ỹ','ỹ'=>'ỹ','ἀ'=>'ἀ','ἁ'=>'ἁ','ἂ'=>'ἂ','ἃ'=>'ἃ','ἄ'=>'ἄ','ἅ'=>'ἅ','ἆ'=>'ἆ','ἇ'=>'ἇ','Ἀ'=>'Ἀ','Ἁ'=>'Ἁ','Ἂ'=>'Ἂ','Ἃ'=>'Ἃ','Ἄ'=>'Ἄ','Ἅ'=>'Ἅ','Ἆ'=>'Ἆ','Ἇ'=>'Ἇ','ἐ'=>'ἐ','ἑ'=>'ἑ','ἒ'=>'ἒ','ἓ'=>'ἓ','ἔ'=>'ἔ','ἕ'=>'ἕ','Ἐ'=>'Ἐ','Ἑ'=>'Ἑ','Ἒ'=>'Ἒ','Ἓ'=>'Ἓ','Ἔ'=>'Ἔ','Ἕ'=>'Ἕ','ἠ'=>'ἠ','ἡ'=>'ἡ','ἢ'=>'ἢ','ἣ'=>'ἣ','ἤ'=>'ἤ','ἥ'=>'ἥ','ἦ'=>'ἦ','ἧ'=>'ἧ','Ἠ'=>'Ἠ','Ἡ'=>'Ἡ','Ἢ'=>'Ἢ','Ἣ'=>'Ἣ','Ἤ'=>'Ἤ','Ἥ'=>'Ἥ','Ἦ'=>'Ἦ','Ἧ'=>'Ἧ','ἰ'=>'ἰ','ἱ'=>'ἱ','ἲ'=>'ἲ','ἳ'=>'ἳ','ἴ'=>'ἴ','ἵ'=>'ἵ','ἶ'=>'ἶ','ἷ'=>'ἷ','Ἰ'=>'Ἰ','Ἱ'=>'Ἱ','Ἲ'=>'Ἲ','Ἳ'=>'Ἳ','Ἴ'=>'Ἴ','Ἵ'=>'Ἵ','Ἶ'=>'Ἶ','Ἷ'=>'Ἷ','ὀ'=>'ὀ','ὁ'=>'ὁ','ὂ'=>'ὂ','ὃ'=>'ὃ','ὄ'=>'ὄ','ὅ'=>'ὅ','Ὀ'=>'Ὀ','Ὁ'=>'Ὁ','Ὂ'=>'Ὂ','Ὃ'=>'Ὃ','Ὄ'=>'Ὄ','Ὅ'=>'Ὅ','ὐ'=>'ὐ','ὑ'=>'ὑ','ὒ'=>'ὒ','ὓ'=>'ὓ','ὔ'=>'ὔ','ὕ'=>'ὕ','ὖ'=>'ὖ','ὗ'=>'ὗ','Ὑ'=>'Ὑ','Ὓ'=>'Ὓ','Ὕ'=>'Ὕ','Ὗ'=>'Ὗ','ὠ'=>'ὠ','ὡ'=>'ὡ','ὢ'=>'ὢ','ὣ'=>'ὣ','ὤ'=>'ὤ','ὥ'=>'ὥ','ὦ'=>'ὦ','ὧ'=>'ὧ','Ὠ'=>'Ὠ','Ὡ'=>'Ὡ','Ὢ'=>'Ὢ','Ὣ'=>'Ὣ','Ὤ'=>'Ὤ','Ὥ'=>'Ὥ','Ὦ'=>'Ὦ','Ὧ'=>'Ὧ','ὰ'=>'ὰ','ὲ'=>'ὲ','ὴ'=>'ὴ','ὶ'=>'ὶ','ὸ'=>'ὸ','ὺ'=>'ὺ','ὼ'=>'ὼ','ᾀ'=>'ᾀ','ᾁ'=>'ᾁ','ᾂ'=>'ᾂ','ᾃ'=>'ᾃ','ᾄ'=>'ᾄ','ᾅ'=>'ᾅ','ᾆ'=>'ᾆ','ᾇ'=>'ᾇ','ᾈ'=>'ᾈ','ᾉ'=>'ᾉ','ᾊ'=>'ᾊ','ᾋ'=>'ᾋ','ᾌ'=>'ᾌ','ᾍ'=>'ᾍ','ᾎ'=>'ᾎ','ᾏ'=>'ᾏ','ᾐ'=>'ᾐ','ᾑ'=>'ᾑ','ᾒ'=>'ᾒ','ᾓ'=>'ᾓ','ᾔ'=>'ᾔ','ᾕ'=>'ᾕ','ᾖ'=>'ᾖ','ᾗ'=>'ᾗ','ᾘ'=>'ᾘ','ᾙ'=>'ᾙ','ᾚ'=>'ᾚ','ᾛ'=>'ᾛ','ᾜ'=>'ᾜ','ᾝ'=>'ᾝ','ᾞ'=>'ᾞ','ᾟ'=>'ᾟ','ᾠ'=>'ᾠ','ᾡ'=>'ᾡ','ᾢ'=>'ᾢ','ᾣ'=>'ᾣ','ᾤ'=>'ᾤ','ᾥ'=>'ᾥ','ᾦ'=>'ᾦ','ᾧ'=>'ᾧ','ᾨ'=>'ᾨ','ᾩ'=>'ᾩ','ᾪ'=>'ᾪ','ᾫ'=>'ᾫ','ᾬ'=>'ᾬ','ᾭ'=>'ᾭ','ᾮ'=>'ᾮ','ᾯ'=>'ᾯ','ᾰ'=>'ᾰ','ᾱ'=>'ᾱ','ᾲ'=>'ᾲ','ᾳ'=>'ᾳ','ᾴ'=>'ᾴ','ᾶ'=>'ᾶ','ᾷ'=>'ᾷ','Ᾰ'=>'Ᾰ','Ᾱ'=>'Ᾱ','Ὰ'=>'Ὰ','ᾼ'=>'ᾼ','῁'=>'῁','ῂ'=>'ῂ','ῃ'=>'ῃ','ῄ'=>'ῄ','ῆ'=>'ῆ','ῇ'=>'ῇ','Ὲ'=>'Ὲ','Ὴ'=>'Ὴ','ῌ'=>'ῌ','῍'=>'῍','῎'=>'῎','῏'=>'῏','ῐ'=>'ῐ','ῑ'=>'ῑ','ῒ'=>'ῒ','ῖ'=>'ῖ','ῗ'=>'ῗ','Ῐ'=>'Ῐ','Ῑ'=>'Ῑ','Ὶ'=>'Ὶ','῝'=>'῝','῞'=>'῞','῟'=>'῟','ῠ'=>'ῠ','ῡ'=>'ῡ','ῢ'=>'ῢ','ῤ'=>'ῤ','ῥ'=>'ῥ','ῦ'=>'ῦ','ῧ'=>'ῧ','Ῠ'=>'Ῠ','Ῡ'=>'Ῡ','Ὺ'=>'Ὺ','Ῥ'=>'Ῥ','῭'=>'῭','ῲ'=>'ῲ','ῳ'=>'ῳ','ῴ'=>'ῴ','ῶ'=>'ῶ','ῷ'=>'ῷ','Ὸ'=>'Ὸ','Ὼ'=>'Ὼ','ῼ'=>'ῼ','↚'=>'↚','↛'=>'↛','↮'=>'↮','⇍'=>'⇍','⇎'=>'⇎','⇏'=>'⇏','∄'=>'∄','∉'=>'∉','∌'=>'∌','∤'=>'∤','∦'=>'∦','≁'=>'≁','≄'=>'≄','≇'=>'≇','≉'=>'≉','≠'=>'≠','≢'=>'≢','≭'=>'≭','≮'=>'≮','≯'=>'≯','≰'=>'≰','≱'=>'≱','≴'=>'≴','≵'=>'≵','≸'=>'≸','≹'=>'≹','⊀'=>'⊀','⊁'=>'⊁','⊄'=>'⊄','⊅'=>'⊅','⊈'=>'⊈','⊉'=>'⊉','⊬'=>'⊬','⊭'=>'⊭','⊮'=>'⊮','⊯'=>'⊯','⋠'=>'⋠','⋡'=>'⋡','⋢'=>'⋢','⋣'=>'⋣','⋪'=>'⋪','⋫'=>'⋫','⋬'=>'⋬','⋭'=>'⋭','が'=>'が','ぎ'=>'ぎ','ぐ'=>'ぐ','げ'=>'げ','ご'=>'ご','ざ'=>'ざ','じ'=>'じ','ず'=>'ず','ぜ'=>'ぜ','ぞ'=>'ぞ','だ'=>'だ','ぢ'=>'ぢ','づ'=>'づ','で'=>'で','ど'=>'ど','ば'=>'ば','ぱ'=>'ぱ','び'=>'び','ぴ'=>'ぴ','ぶ'=>'ぶ','ぷ'=>'ぷ','べ'=>'べ','ぺ'=>'ぺ','ぼ'=>'ぼ','ぽ'=>'ぽ','ゔ'=>'ゔ','ゞ'=>'ゞ','ガ'=>'ガ','ギ'=>'ギ','グ'=>'グ','ゲ'=>'ゲ','ゴ'=>'ゴ','ザ'=>'ザ','ジ'=>'ジ','ズ'=>'ズ','ゼ'=>'ゼ','ゾ'=>'ゾ','ダ'=>'ダ','ヂ'=>'ヂ','ヅ'=>'ヅ','デ'=>'デ','ド'=>'ド','バ'=>'バ','パ'=>'パ','ビ'=>'ビ','ピ'=>'ピ','ブ'=>'ブ','プ'=>'プ','ベ'=>'ベ','ペ'=>'ペ','ボ'=>'ボ','ポ'=>'ポ','ヴ'=>'ヴ','ヷ'=>'ヷ','ヸ'=>'ヸ','ヹ'=>'ヹ','ヺ'=>'ヺ','ヾ'=>'ヾ');
diff --git a/phpBB/includes/utf/data/utf_canonical_decomp.php b/phpBB/includes/utf/data/utf_canonical_decomp.php
index 460a0cf323..9fb90803e2 100644
--- a/phpBB/includes/utf/data/utf_canonical_decomp.php
+++ b/phpBB/includes/utf/data/utf_canonical_decomp.php
@@ -1,2 +1,2 @@
<?php
-$GLOBALS['utf_canonical_decomp']=array('À'=>'À','Á'=>'Á','Â'=>'Â','Ã'=>'Ã','Ä'=>'Ä','Å'=>'Å','Ç'=>'Ç','È'=>'È','É'=>'É','Ê'=>'Ê','Ë'=>'Ë','Ì'=>'Ì','Í'=>'Í','Î'=>'Î','Ï'=>'Ï','Ñ'=>'Ñ','Ò'=>'Ò','Ó'=>'Ó','Ô'=>'Ô','Õ'=>'Õ','Ö'=>'Ö','Ù'=>'Ù','Ú'=>'Ú','Û'=>'Û','Ü'=>'Ü','Ý'=>'Ý','à'=>'à','á'=>'á','â'=>'â','ã'=>'ã','ä'=>'ä','å'=>'å','ç'=>'ç','è'=>'è','é'=>'é','ê'=>'ê','ë'=>'ë','ì'=>'ì','í'=>'í','î'=>'î','ï'=>'ï','ñ'=>'ñ','ò'=>'ò','ó'=>'ó','ô'=>'ô','õ'=>'õ','ö'=>'ö','ù'=>'ù','ú'=>'ú','û'=>'û','ü'=>'ü','ý'=>'ý','ÿ'=>'ÿ','Ā'=>'Ā','ā'=>'ā','Ă'=>'Ă','ă'=>'ă','Ą'=>'Ą','ą'=>'ą','Ć'=>'Ć','ć'=>'ć','Ĉ'=>'Ĉ','ĉ'=>'ĉ','Ċ'=>'Ċ','ċ'=>'ċ','Č'=>'Č','č'=>'č','Ď'=>'Ď','ď'=>'ď','Ē'=>'Ē','ē'=>'ē','Ĕ'=>'Ĕ','ĕ'=>'ĕ','Ė'=>'Ė','ė'=>'ė','Ę'=>'Ę','ę'=>'ę','Ě'=>'Ě','ě'=>'ě','Ĝ'=>'Ĝ','ĝ'=>'ĝ','Ğ'=>'Ğ','ğ'=>'ğ','Ġ'=>'Ġ','ġ'=>'ġ','Ģ'=>'Ģ','ģ'=>'ģ','Ĥ'=>'Ĥ','ĥ'=>'ĥ','Ĩ'=>'Ĩ','ĩ'=>'ĩ','Ī'=>'Ī','ī'=>'ī','Ĭ'=>'Ĭ','ĭ'=>'ĭ','Į'=>'Į','į'=>'į','İ'=>'İ','Ĵ'=>'Ĵ','ĵ'=>'ĵ','Ķ'=>'Ķ','ķ'=>'ķ','Ĺ'=>'Ĺ','ĺ'=>'ĺ','Ļ'=>'Ļ','ļ'=>'ļ','Ľ'=>'Ľ','ľ'=>'ľ','Ń'=>'Ń','ń'=>'ń','Ņ'=>'Ņ','ņ'=>'ņ','Ň'=>'Ň','ň'=>'ň','Ō'=>'Ō','ō'=>'ō','Ŏ'=>'Ŏ','ŏ'=>'ŏ','Ő'=>'Ő','ő'=>'ő','Ŕ'=>'Ŕ','ŕ'=>'ŕ','Ŗ'=>'Ŗ','ŗ'=>'ŗ','Ř'=>'Ř','ř'=>'ř','Ś'=>'Ś','ś'=>'ś','Ŝ'=>'Ŝ','ŝ'=>'ŝ','Ş'=>'Ş','ş'=>'ş','Š'=>'Š','š'=>'š','Ţ'=>'Ţ','ţ'=>'ţ','Ť'=>'Ť','ť'=>'ť','Ũ'=>'Ũ','ũ'=>'ũ','Ū'=>'Ū','ū'=>'ū','Ŭ'=>'Ŭ','ŭ'=>'ŭ','Ů'=>'Ů','ů'=>'ů','Ű'=>'Ű','ű'=>'ű','Ų'=>'Ų','ų'=>'ų','Ŵ'=>'Ŵ','ŵ'=>'ŵ','Ŷ'=>'Ŷ','ŷ'=>'ŷ','Ÿ'=>'Ÿ','Ź'=>'Ź','ź'=>'ź','Ż'=>'Ż','ż'=>'ż','Ž'=>'Ž','ž'=>'ž','Ơ'=>'Ơ','ơ'=>'ơ','Ư'=>'Ư','ư'=>'ư','Ǎ'=>'Ǎ','ǎ'=>'ǎ','Ǐ'=>'Ǐ','ǐ'=>'ǐ','Ǒ'=>'Ǒ','ǒ'=>'ǒ','Ǔ'=>'Ǔ','ǔ'=>'ǔ','Ǖ'=>'Ǖ','ǖ'=>'ǖ','Ǘ'=>'Ǘ','ǘ'=>'ǘ','Ǚ'=>'Ǚ','ǚ'=>'ǚ','Ǜ'=>'Ǜ','ǜ'=>'ǜ','Ǟ'=>'Ǟ','ǟ'=>'ǟ','Ǡ'=>'Ǡ','ǡ'=>'ǡ','Ǣ'=>'Ǣ','ǣ'=>'ǣ','Ǧ'=>'Ǧ','ǧ'=>'ǧ','Ǩ'=>'Ǩ','ǩ'=>'ǩ','Ǫ'=>'Ǫ','ǫ'=>'ǫ','Ǭ'=>'Ǭ','ǭ'=>'ǭ','Ǯ'=>'Ǯ','ǯ'=>'ǯ','ǰ'=>'ǰ','Ǵ'=>'Ǵ','ǵ'=>'ǵ','Ǹ'=>'Ǹ','ǹ'=>'ǹ','Ǻ'=>'Ǻ','ǻ'=>'ǻ','Ǽ'=>'Ǽ','ǽ'=>'ǽ','Ǿ'=>'Ǿ','ǿ'=>'ǿ','Ȁ'=>'Ȁ','ȁ'=>'ȁ','Ȃ'=>'Ȃ','ȃ'=>'ȃ','Ȅ'=>'Ȅ','ȅ'=>'ȅ','Ȇ'=>'Ȇ','ȇ'=>'ȇ','Ȉ'=>'Ȉ','ȉ'=>'ȉ','Ȋ'=>'Ȋ','ȋ'=>'ȋ','Ȍ'=>'Ȍ','ȍ'=>'ȍ','Ȏ'=>'Ȏ','ȏ'=>'ȏ','Ȑ'=>'Ȑ','ȑ'=>'ȑ','Ȓ'=>'Ȓ','ȓ'=>'ȓ','Ȕ'=>'Ȕ','ȕ'=>'ȕ','Ȗ'=>'Ȗ','ȗ'=>'ȗ','Ș'=>'Ș','ș'=>'ș','Ț'=>'Ț','ț'=>'ț','Ȟ'=>'Ȟ','ȟ'=>'ȟ','Ȧ'=>'Ȧ','ȧ'=>'ȧ','Ȩ'=>'Ȩ','ȩ'=>'ȩ','Ȫ'=>'Ȫ','ȫ'=>'ȫ','Ȭ'=>'Ȭ','ȭ'=>'ȭ','Ȯ'=>'Ȯ','ȯ'=>'ȯ','Ȱ'=>'Ȱ','ȱ'=>'ȱ','Ȳ'=>'Ȳ','ȳ'=>'ȳ','̀'=>'̀','́'=>'́','̓'=>'̓','̈́'=>'̈́','ʹ'=>'ʹ',';'=>';','΅'=>'΅','Ά'=>'Ά','·'=>'·','Έ'=>'Έ','Ή'=>'Ή','Ί'=>'Ί','Ό'=>'Ό','Ύ'=>'Ύ','Ώ'=>'Ώ','ΐ'=>'ΐ','Ϊ'=>'Ϊ','Ϋ'=>'Ϋ','ά'=>'ά','έ'=>'έ','ή'=>'ή','ί'=>'ί','ΰ'=>'ΰ','ϊ'=>'ϊ','ϋ'=>'ϋ','ό'=>'ό','ύ'=>'ύ','ώ'=>'ώ','ϓ'=>'ϓ','ϔ'=>'ϔ','Ѐ'=>'Ѐ','Ё'=>'Ё','Ѓ'=>'Ѓ','Ї'=>'Ї','Ќ'=>'Ќ','Ѝ'=>'Ѝ','Ў'=>'Ў','Й'=>'Й','й'=>'й','ѐ'=>'ѐ','ё'=>'ё','ѓ'=>'ѓ','ї'=>'ї','ќ'=>'ќ','ѝ'=>'ѝ','ў'=>'ў','Ѷ'=>'Ѷ','ѷ'=>'ѷ','Ӂ'=>'Ӂ','ӂ'=>'ӂ','Ӑ'=>'Ӑ','ӑ'=>'ӑ','Ӓ'=>'Ӓ','ӓ'=>'ӓ','Ӗ'=>'Ӗ','ӗ'=>'ӗ','Ӛ'=>'Ӛ','ӛ'=>'ӛ','Ӝ'=>'Ӝ','ӝ'=>'ӝ','Ӟ'=>'Ӟ','ӟ'=>'ӟ','Ӣ'=>'Ӣ','ӣ'=>'ӣ','Ӥ'=>'Ӥ','ӥ'=>'ӥ','Ӧ'=>'Ӧ','ӧ'=>'ӧ','Ӫ'=>'Ӫ','ӫ'=>'ӫ','Ӭ'=>'Ӭ','ӭ'=>'ӭ','Ӯ'=>'Ӯ','ӯ'=>'ӯ','Ӱ'=>'Ӱ','ӱ'=>'ӱ','Ӳ'=>'Ӳ','ӳ'=>'ӳ','Ӵ'=>'Ӵ','ӵ'=>'ӵ','Ӹ'=>'Ӹ','ӹ'=>'ӹ','آ'=>'آ','أ'=>'أ','ؤ'=>'ؤ','إ'=>'إ','ئ'=>'ئ','ۀ'=>'ۀ','ۂ'=>'ۂ','ۓ'=>'ۓ','ऩ'=>'ऩ','ऱ'=>'ऱ','ऴ'=>'ऴ','क़'=>'क़','ख़'=>'ख़','ग़'=>'ग़','ज़'=>'ज़','ड़'=>'ड़','ढ़'=>'ढ़','फ़'=>'फ़','य़'=>'य़','ো'=>'ো','ৌ'=>'ৌ','ড়'=>'ড়','ঢ়'=>'ঢ়','য়'=>'য়','ਲ਼'=>'ਲ਼','ਸ਼'=>'ਸ਼','ਖ਼'=>'ਖ਼','ਗ਼'=>'ਗ਼','ਜ਼'=>'ਜ਼','ਫ਼'=>'ਫ਼','ୈ'=>'ୈ','ୋ'=>'ୋ','ୌ'=>'ୌ','ଡ଼'=>'ଡ଼','ଢ଼'=>'ଢ଼','ஔ'=>'ஔ','ொ'=>'ொ','ோ'=>'ோ','ௌ'=>'ௌ','ై'=>'ై','ೀ'=>'ೀ','ೇ'=>'ೇ','ೈ'=>'ೈ','ೊ'=>'ೊ','ೋ'=>'ೋ','ൊ'=>'ൊ','ോ'=>'ോ','ൌ'=>'ൌ','ේ'=>'ේ','ො'=>'ො','ෝ'=>'ෝ','ෞ'=>'ෞ','གྷ'=>'གྷ','ཌྷ'=>'ཌྷ','དྷ'=>'དྷ','བྷ'=>'བྷ','ཛྷ'=>'ཛྷ','ཀྵ'=>'ཀྵ','ཱི'=>'ཱི','ཱུ'=>'ཱུ','ྲྀ'=>'ྲྀ','ླྀ'=>'ླྀ','ཱྀ'=>'ཱྀ','ྒྷ'=>'ྒྷ','ྜྷ'=>'ྜྷ','ྡྷ'=>'ྡྷ','ྦྷ'=>'ྦྷ','ྫྷ'=>'ྫྷ','ྐྵ'=>'ྐྵ','ဦ'=>'ဦ','ᬆ'=>'ᬆ','ᬈ'=>'ᬈ','ᬊ'=>'ᬊ','ᬌ'=>'ᬌ','ᬎ'=>'ᬎ','ᬒ'=>'ᬒ','ᬻ'=>'ᬻ','ᬽ'=>'ᬽ','ᭀ'=>'ᭀ','ᭁ'=>'ᭁ','ᭃ'=>'ᭃ','Ḁ'=>'Ḁ','ḁ'=>'ḁ','Ḃ'=>'Ḃ','ḃ'=>'ḃ','Ḅ'=>'Ḅ','ḅ'=>'ḅ','Ḇ'=>'Ḇ','ḇ'=>'ḇ','Ḉ'=>'Ḉ','ḉ'=>'ḉ','Ḋ'=>'Ḋ','ḋ'=>'ḋ','Ḍ'=>'Ḍ','ḍ'=>'ḍ','Ḏ'=>'Ḏ','ḏ'=>'ḏ','Ḑ'=>'Ḑ','ḑ'=>'ḑ','Ḓ'=>'Ḓ','ḓ'=>'ḓ','Ḕ'=>'Ḕ','ḕ'=>'ḕ','Ḗ'=>'Ḗ','ḗ'=>'ḗ','Ḙ'=>'Ḙ','ḙ'=>'ḙ','Ḛ'=>'Ḛ','ḛ'=>'ḛ','Ḝ'=>'Ḝ','ḝ'=>'ḝ','Ḟ'=>'Ḟ','ḟ'=>'ḟ','Ḡ'=>'Ḡ','ḡ'=>'ḡ','Ḣ'=>'Ḣ','ḣ'=>'ḣ','Ḥ'=>'Ḥ','ḥ'=>'ḥ','Ḧ'=>'Ḧ','ḧ'=>'ḧ','Ḩ'=>'Ḩ','ḩ'=>'ḩ','Ḫ'=>'Ḫ','ḫ'=>'ḫ','Ḭ'=>'Ḭ','ḭ'=>'ḭ','Ḯ'=>'Ḯ','ḯ'=>'ḯ','Ḱ'=>'Ḱ','ḱ'=>'ḱ','Ḳ'=>'Ḳ','ḳ'=>'ḳ','Ḵ'=>'Ḵ','ḵ'=>'ḵ','Ḷ'=>'Ḷ','ḷ'=>'ḷ','Ḹ'=>'Ḹ','ḹ'=>'ḹ','Ḻ'=>'Ḻ','ḻ'=>'ḻ','Ḽ'=>'Ḽ','ḽ'=>'ḽ','Ḿ'=>'Ḿ','ḿ'=>'ḿ','Ṁ'=>'Ṁ','ṁ'=>'ṁ','Ṃ'=>'Ṃ','ṃ'=>'ṃ','Ṅ'=>'Ṅ','ṅ'=>'ṅ','Ṇ'=>'Ṇ','ṇ'=>'ṇ','Ṉ'=>'Ṉ','ṉ'=>'ṉ','Ṋ'=>'Ṋ','ṋ'=>'ṋ','Ṍ'=>'Ṍ','ṍ'=>'ṍ','Ṏ'=>'Ṏ','ṏ'=>'ṏ','Ṑ'=>'Ṑ','ṑ'=>'ṑ','Ṓ'=>'Ṓ','ṓ'=>'ṓ','Ṕ'=>'Ṕ','ṕ'=>'ṕ','Ṗ'=>'Ṗ','ṗ'=>'ṗ','Ṙ'=>'Ṙ','ṙ'=>'ṙ','Ṛ'=>'Ṛ','ṛ'=>'ṛ','Ṝ'=>'Ṝ','ṝ'=>'ṝ','Ṟ'=>'Ṟ','ṟ'=>'ṟ','Ṡ'=>'Ṡ','ṡ'=>'ṡ','Ṣ'=>'Ṣ','ṣ'=>'ṣ','Ṥ'=>'Ṥ','ṥ'=>'ṥ','Ṧ'=>'Ṧ','ṧ'=>'ṧ','Ṩ'=>'Ṩ','ṩ'=>'ṩ','Ṫ'=>'Ṫ','ṫ'=>'ṫ','Ṭ'=>'Ṭ','ṭ'=>'ṭ','Ṯ'=>'Ṯ','ṯ'=>'ṯ','Ṱ'=>'Ṱ','ṱ'=>'ṱ','Ṳ'=>'Ṳ','ṳ'=>'ṳ','Ṵ'=>'Ṵ','ṵ'=>'ṵ','Ṷ'=>'Ṷ','ṷ'=>'ṷ','Ṹ'=>'Ṹ','ṹ'=>'ṹ','Ṻ'=>'Ṻ','ṻ'=>'ṻ','Ṽ'=>'Ṽ','ṽ'=>'ṽ','Ṿ'=>'Ṿ','ṿ'=>'ṿ','Ẁ'=>'Ẁ','ẁ'=>'ẁ','Ẃ'=>'Ẃ','ẃ'=>'ẃ','Ẅ'=>'Ẅ','ẅ'=>'ẅ','Ẇ'=>'Ẇ','ẇ'=>'ẇ','Ẉ'=>'Ẉ','ẉ'=>'ẉ','Ẋ'=>'Ẋ','ẋ'=>'ẋ','Ẍ'=>'Ẍ','ẍ'=>'ẍ','Ẏ'=>'Ẏ','ẏ'=>'ẏ','Ẑ'=>'Ẑ','ẑ'=>'ẑ','Ẓ'=>'Ẓ','ẓ'=>'ẓ','Ẕ'=>'Ẕ','ẕ'=>'ẕ','ẖ'=>'ẖ','ẗ'=>'ẗ','ẘ'=>'ẘ','ẙ'=>'ẙ','ẛ'=>'ẛ','Ạ'=>'Ạ','ạ'=>'ạ','Ả'=>'Ả','ả'=>'ả','Ấ'=>'Ấ','ấ'=>'ấ','Ầ'=>'Ầ','ầ'=>'ầ','Ẩ'=>'Ẩ','ẩ'=>'ẩ','Ẫ'=>'Ẫ','ẫ'=>'ẫ','Ậ'=>'Ậ','ậ'=>'ậ','Ắ'=>'Ắ','ắ'=>'ắ','Ằ'=>'Ằ','ằ'=>'ằ','Ẳ'=>'Ẳ','ẳ'=>'ẳ','Ẵ'=>'Ẵ','ẵ'=>'ẵ','Ặ'=>'Ặ','ặ'=>'ặ','Ẹ'=>'Ẹ','ẹ'=>'ẹ','Ẻ'=>'Ẻ','ẻ'=>'ẻ','Ẽ'=>'Ẽ','ẽ'=>'ẽ','Ế'=>'Ế','ế'=>'ế','Ề'=>'Ề','ề'=>'ề','Ể'=>'Ể','ể'=>'ể','Ễ'=>'Ễ','ễ'=>'ễ','Ệ'=>'Ệ','ệ'=>'ệ','Ỉ'=>'Ỉ','ỉ'=>'ỉ','Ị'=>'Ị','ị'=>'ị','Ọ'=>'Ọ','ọ'=>'ọ','Ỏ'=>'Ỏ','ỏ'=>'ỏ','Ố'=>'Ố','ố'=>'ố','Ồ'=>'Ồ','ồ'=>'ồ','Ổ'=>'Ổ','ổ'=>'ổ','Ỗ'=>'Ỗ','ỗ'=>'ỗ','Ộ'=>'Ộ','ộ'=>'ộ','Ớ'=>'Ớ','ớ'=>'ớ','Ờ'=>'Ờ','ờ'=>'ờ','Ở'=>'Ở','ở'=>'ở','Ỡ'=>'Ỡ','ỡ'=>'ỡ','Ợ'=>'Ợ','ợ'=>'ợ','Ụ'=>'Ụ','ụ'=>'ụ','Ủ'=>'Ủ','ủ'=>'ủ','Ứ'=>'Ứ','ứ'=>'ứ','Ừ'=>'Ừ','ừ'=>'ừ','Ử'=>'Ử','ử'=>'ử','Ữ'=>'Ữ','ữ'=>'ữ','Ự'=>'Ự','ự'=>'ự','Ỳ'=>'Ỳ','ỳ'=>'ỳ','Ỵ'=>'Ỵ','ỵ'=>'ỵ','Ỷ'=>'Ỷ','ỷ'=>'ỷ','Ỹ'=>'Ỹ','ỹ'=>'ỹ','ἀ'=>'ἀ','ἁ'=>'ἁ','ἂ'=>'ἂ','ἃ'=>'ἃ','ἄ'=>'ἄ','ἅ'=>'ἅ','ἆ'=>'ἆ','ἇ'=>'ἇ','Ἀ'=>'Ἀ','Ἁ'=>'Ἁ','Ἂ'=>'Ἂ','Ἃ'=>'Ἃ','Ἄ'=>'Ἄ','Ἅ'=>'Ἅ','Ἆ'=>'Ἆ','Ἇ'=>'Ἇ','ἐ'=>'ἐ','ἑ'=>'ἑ','ἒ'=>'ἒ','ἓ'=>'ἓ','ἔ'=>'ἔ','ἕ'=>'ἕ','Ἐ'=>'Ἐ','Ἑ'=>'Ἑ','Ἒ'=>'Ἒ','Ἓ'=>'Ἓ','Ἔ'=>'Ἔ','Ἕ'=>'Ἕ','ἠ'=>'ἠ','ἡ'=>'ἡ','ἢ'=>'ἢ','ἣ'=>'ἣ','ἤ'=>'ἤ','ἥ'=>'ἥ','ἦ'=>'ἦ','ἧ'=>'ἧ','Ἠ'=>'Ἠ','Ἡ'=>'Ἡ','Ἢ'=>'Ἢ','Ἣ'=>'Ἣ','Ἤ'=>'Ἤ','Ἥ'=>'Ἥ','Ἦ'=>'Ἦ','Ἧ'=>'Ἧ','ἰ'=>'ἰ','ἱ'=>'ἱ','ἲ'=>'ἲ','ἳ'=>'ἳ','ἴ'=>'ἴ','ἵ'=>'ἵ','ἶ'=>'ἶ','ἷ'=>'ἷ','Ἰ'=>'Ἰ','Ἱ'=>'Ἱ','Ἲ'=>'Ἲ','Ἳ'=>'Ἳ','Ἴ'=>'Ἴ','Ἵ'=>'Ἵ','Ἶ'=>'Ἶ','Ἷ'=>'Ἷ','ὀ'=>'ὀ','ὁ'=>'ὁ','ὂ'=>'ὂ','ὃ'=>'ὃ','ὄ'=>'ὄ','ὅ'=>'ὅ','Ὀ'=>'Ὀ','Ὁ'=>'Ὁ','Ὂ'=>'Ὂ','Ὃ'=>'Ὃ','Ὄ'=>'Ὄ','Ὅ'=>'Ὅ','ὐ'=>'ὐ','ὑ'=>'ὑ','ὒ'=>'ὒ','ὓ'=>'ὓ','ὔ'=>'ὔ','ὕ'=>'ὕ','ὖ'=>'ὖ','ὗ'=>'ὗ','Ὑ'=>'Ὑ','Ὓ'=>'Ὓ','Ὕ'=>'Ὕ','Ὗ'=>'Ὗ','ὠ'=>'ὠ','ὡ'=>'ὡ','ὢ'=>'ὢ','ὣ'=>'ὣ','ὤ'=>'ὤ','ὥ'=>'ὥ','ὦ'=>'ὦ','ὧ'=>'ὧ','Ὠ'=>'Ὠ','Ὡ'=>'Ὡ','Ὢ'=>'Ὢ','Ὣ'=>'Ὣ','Ὤ'=>'Ὤ','Ὥ'=>'Ὥ','Ὦ'=>'Ὦ','Ὧ'=>'Ὧ','ὰ'=>'ὰ','ά'=>'ά','ὲ'=>'ὲ','έ'=>'έ','ὴ'=>'ὴ','ή'=>'ή','ὶ'=>'ὶ','ί'=>'ί','ὸ'=>'ὸ','ό'=>'ό','ὺ'=>'ὺ','ύ'=>'ύ','ὼ'=>'ὼ','ώ'=>'ώ','ᾀ'=>'ᾀ','ᾁ'=>'ᾁ','ᾂ'=>'ᾂ','ᾃ'=>'ᾃ','ᾄ'=>'ᾄ','ᾅ'=>'ᾅ','ᾆ'=>'ᾆ','ᾇ'=>'ᾇ','ᾈ'=>'ᾈ','ᾉ'=>'ᾉ','ᾊ'=>'ᾊ','ᾋ'=>'ᾋ','ᾌ'=>'ᾌ','ᾍ'=>'ᾍ','ᾎ'=>'ᾎ','ᾏ'=>'ᾏ','ᾐ'=>'ᾐ','ᾑ'=>'ᾑ','ᾒ'=>'ᾒ','ᾓ'=>'ᾓ','ᾔ'=>'ᾔ','ᾕ'=>'ᾕ','ᾖ'=>'ᾖ','ᾗ'=>'ᾗ','ᾘ'=>'ᾘ','ᾙ'=>'ᾙ','ᾚ'=>'ᾚ','ᾛ'=>'ᾛ','ᾜ'=>'ᾜ','ᾝ'=>'ᾝ','ᾞ'=>'ᾞ','ᾟ'=>'ᾟ','ᾠ'=>'ᾠ','ᾡ'=>'ᾡ','ᾢ'=>'ᾢ','ᾣ'=>'ᾣ','ᾤ'=>'ᾤ','ᾥ'=>'ᾥ','ᾦ'=>'ᾦ','ᾧ'=>'ᾧ','ᾨ'=>'ᾨ','ᾩ'=>'ᾩ','ᾪ'=>'ᾪ','ᾫ'=>'ᾫ','ᾬ'=>'ᾬ','ᾭ'=>'ᾭ','ᾮ'=>'ᾮ','ᾯ'=>'ᾯ','ᾰ'=>'ᾰ','ᾱ'=>'ᾱ','ᾲ'=>'ᾲ','ᾳ'=>'ᾳ','ᾴ'=>'ᾴ','ᾶ'=>'ᾶ','ᾷ'=>'ᾷ','Ᾰ'=>'Ᾰ','Ᾱ'=>'Ᾱ','Ὰ'=>'Ὰ','Ά'=>'Ά','ᾼ'=>'ᾼ','ι'=>'ι','῁'=>'῁','ῂ'=>'ῂ','ῃ'=>'ῃ','ῄ'=>'ῄ','ῆ'=>'ῆ','ῇ'=>'ῇ','Ὲ'=>'Ὲ','Έ'=>'Έ','Ὴ'=>'Ὴ','Ή'=>'Ή','ῌ'=>'ῌ','῍'=>'῍','῎'=>'῎','῏'=>'῏','ῐ'=>'ῐ','ῑ'=>'ῑ','ῒ'=>'ῒ','ΐ'=>'ΐ','ῖ'=>'ῖ','ῗ'=>'ῗ','Ῐ'=>'Ῐ','Ῑ'=>'Ῑ','Ὶ'=>'Ὶ','Ί'=>'Ί','῝'=>'῝','῞'=>'῞','῟'=>'῟','ῠ'=>'ῠ','ῡ'=>'ῡ','ῢ'=>'ῢ','ΰ'=>'ΰ','ῤ'=>'ῤ','ῥ'=>'ῥ','ῦ'=>'ῦ','ῧ'=>'ῧ','Ῠ'=>'Ῠ','Ῡ'=>'Ῡ','Ὺ'=>'Ὺ','Ύ'=>'Ύ','Ῥ'=>'Ῥ','῭'=>'῭','΅'=>'΅','`'=>'`','ῲ'=>'ῲ','ῳ'=>'ῳ','ῴ'=>'ῴ','ῶ'=>'ῶ','ῷ'=>'ῷ','Ὸ'=>'Ὸ','Ό'=>'Ό','Ὼ'=>'Ὼ','Ώ'=>'Ώ','ῼ'=>'ῼ','´'=>'´',' '=>' ',' '=>' ','Ω'=>'Ω','K'=>'K','Å'=>'Å','↚'=>'↚','↛'=>'↛','↮'=>'↮','⇍'=>'⇍','⇎'=>'⇎','⇏'=>'⇏','∄'=>'∄','∉'=>'∉','∌'=>'∌','∤'=>'∤','∦'=>'∦','≁'=>'≁','≄'=>'≄','≇'=>'≇','≉'=>'≉','≠'=>'≠','≢'=>'≢','≭'=>'≭','≮'=>'≮','≯'=>'≯','≰'=>'≰','≱'=>'≱','≴'=>'≴','≵'=>'≵','≸'=>'≸','≹'=>'≹','⊀'=>'⊀','⊁'=>'⊁','⊄'=>'⊄','⊅'=>'⊅','⊈'=>'⊈','⊉'=>'⊉','⊬'=>'⊬','⊭'=>'⊭','⊮'=>'⊮','⊯'=>'⊯','⋠'=>'⋠','⋡'=>'⋡','⋢'=>'⋢','⋣'=>'⋣','⋪'=>'⋪','⋫'=>'⋫','⋬'=>'⋬','⋭'=>'⋭','〈'=>'〈','〉'=>'〉','⫝̸'=>'⫝̸','が'=>'が','ぎ'=>'ぎ','ぐ'=>'ぐ','げ'=>'げ','ご'=>'ご','ざ'=>'ざ','じ'=>'じ','ず'=>'ず','ぜ'=>'ぜ','ぞ'=>'ぞ','だ'=>'だ','ぢ'=>'ぢ','づ'=>'づ','で'=>'で','ど'=>'ど','ば'=>'ば','ぱ'=>'ぱ','び'=>'び','ぴ'=>'ぴ','ぶ'=>'ぶ','ぷ'=>'ぷ','べ'=>'べ','ぺ'=>'ぺ','ぼ'=>'ぼ','ぽ'=>'ぽ','ゔ'=>'ゔ','ゞ'=>'ゞ','ガ'=>'ガ','ギ'=>'ギ','グ'=>'グ','ゲ'=>'ゲ','ゴ'=>'ゴ','ザ'=>'ザ','ジ'=>'ジ','ズ'=>'ズ','ゼ'=>'ゼ','ゾ'=>'ゾ','ダ'=>'ダ','ヂ'=>'ヂ','ヅ'=>'ヅ','デ'=>'デ','ド'=>'ド','バ'=>'バ','パ'=>'パ','ビ'=>'ビ','ピ'=>'ピ','ブ'=>'ブ','プ'=>'プ','ベ'=>'ベ','ペ'=>'ペ','ボ'=>'ボ','ポ'=>'ポ','ヴ'=>'ヴ','ヷ'=>'ヷ','ヸ'=>'ヸ','ヹ'=>'ヹ','ヺ'=>'ヺ','ヾ'=>'ヾ','豈'=>'豈','更'=>'更','車'=>'車','賈'=>'賈','滑'=>'滑','串'=>'串','句'=>'句','龜'=>'龜','龜'=>'龜','契'=>'契','金'=>'金','喇'=>'喇','奈'=>'奈','懶'=>'懶','癩'=>'癩','羅'=>'羅','蘿'=>'蘿','螺'=>'螺','裸'=>'裸','邏'=>'邏','樂'=>'樂','洛'=>'洛','烙'=>'烙','珞'=>'珞','落'=>'落','酪'=>'酪','駱'=>'駱','亂'=>'亂','卵'=>'卵','欄'=>'欄','爛'=>'爛','蘭'=>'蘭','鸞'=>'鸞','嵐'=>'嵐','濫'=>'濫','藍'=>'藍','襤'=>'襤','拉'=>'拉','臘'=>'臘','蠟'=>'蠟','廊'=>'廊','朗'=>'朗','浪'=>'浪','狼'=>'狼','郎'=>'郎','來'=>'來','冷'=>'冷','勞'=>'勞','擄'=>'擄','櫓'=>'櫓','爐'=>'爐','盧'=>'盧','老'=>'老','蘆'=>'蘆','虜'=>'虜','路'=>'路','露'=>'露','魯'=>'魯','鷺'=>'鷺','碌'=>'碌','祿'=>'祿','綠'=>'綠','菉'=>'菉','錄'=>'錄','鹿'=>'鹿','論'=>'論','壟'=>'壟','弄'=>'弄','籠'=>'籠','聾'=>'聾','牢'=>'牢','磊'=>'磊','賂'=>'賂','雷'=>'雷','壘'=>'壘','屢'=>'屢','樓'=>'樓','淚'=>'淚','漏'=>'漏','累'=>'累','縷'=>'縷','陋'=>'陋','勒'=>'勒','肋'=>'肋','凜'=>'凜','凌'=>'凌','稜'=>'稜','綾'=>'綾','菱'=>'菱','陵'=>'陵','讀'=>'讀','拏'=>'拏','樂'=>'樂','諾'=>'諾','丹'=>'丹','寧'=>'寧','怒'=>'怒','率'=>'率','異'=>'異','北'=>'北','磻'=>'磻','便'=>'便','復'=>'復','不'=>'不','泌'=>'泌','數'=>'數','索'=>'索','參'=>'參','塞'=>'塞','省'=>'省','葉'=>'葉','說'=>'說','殺'=>'殺','辰'=>'辰','沈'=>'沈','拾'=>'拾','若'=>'若','掠'=>'掠','略'=>'略','亮'=>'亮','兩'=>'兩','凉'=>'凉','梁'=>'梁','糧'=>'糧','良'=>'良','諒'=>'諒','量'=>'量','勵'=>'勵','呂'=>'呂','女'=>'女','廬'=>'廬','旅'=>'旅','濾'=>'濾','礪'=>'礪','閭'=>'閭','驪'=>'驪','麗'=>'麗','黎'=>'黎','力'=>'力','曆'=>'曆','歷'=>'歷','轢'=>'轢','年'=>'年','憐'=>'憐','戀'=>'戀','撚'=>'撚','漣'=>'漣','煉'=>'煉','璉'=>'璉','秊'=>'秊','練'=>'練','聯'=>'聯','輦'=>'輦','蓮'=>'蓮','連'=>'連','鍊'=>'鍊','列'=>'列','劣'=>'劣','咽'=>'咽','烈'=>'烈','裂'=>'裂','說'=>'說','廉'=>'廉','念'=>'念','捻'=>'捻','殮'=>'殮','簾'=>'簾','獵'=>'獵','令'=>'令','囹'=>'囹','寧'=>'寧','嶺'=>'嶺','怜'=>'怜','玲'=>'玲','瑩'=>'瑩','羚'=>'羚','聆'=>'聆','鈴'=>'鈴','零'=>'零','靈'=>'靈','領'=>'領','例'=>'例','禮'=>'禮','醴'=>'醴','隸'=>'隸','惡'=>'惡','了'=>'了','僚'=>'僚','寮'=>'寮','尿'=>'尿','料'=>'料','樂'=>'樂','燎'=>'燎','療'=>'療','蓼'=>'蓼','遼'=>'遼','龍'=>'龍','暈'=>'暈','阮'=>'阮','劉'=>'劉','杻'=>'杻','柳'=>'柳','流'=>'流','溜'=>'溜','琉'=>'琉','留'=>'留','硫'=>'硫','紐'=>'紐','類'=>'類','六'=>'六','戮'=>'戮','陸'=>'陸','倫'=>'倫','崙'=>'崙','淪'=>'淪','輪'=>'輪','律'=>'律','慄'=>'慄','栗'=>'栗','率'=>'率','隆'=>'隆','利'=>'利','吏'=>'吏','履'=>'履','易'=>'易','李'=>'李','梨'=>'梨','泥'=>'泥','理'=>'理','痢'=>'痢','罹'=>'罹','裏'=>'裏','裡'=>'裡','里'=>'里','離'=>'離','匿'=>'匿','溺'=>'溺','吝'=>'吝','燐'=>'燐','璘'=>'璘','藺'=>'藺','隣'=>'隣','鱗'=>'鱗','麟'=>'麟','林'=>'林','淋'=>'淋','臨'=>'臨','立'=>'立','笠'=>'笠','粒'=>'粒','狀'=>'狀','炙'=>'炙','識'=>'識','什'=>'什','茶'=>'茶','刺'=>'刺','切'=>'切','度'=>'度','拓'=>'拓','糖'=>'糖','宅'=>'宅','洞'=>'洞','暴'=>'暴','輻'=>'輻','行'=>'行','降'=>'降','見'=>'見','廓'=>'廓','兀'=>'兀','嗀'=>'嗀','塚'=>'塚','晴'=>'晴','凞'=>'凞','猪'=>'猪','益'=>'益','礼'=>'礼','神'=>'神','祥'=>'祥','福'=>'福','靖'=>'靖','精'=>'精','羽'=>'羽','蘒'=>'蘒','諸'=>'諸','逸'=>'逸','都'=>'都','飯'=>'飯','飼'=>'飼','館'=>'館','鶴'=>'鶴','侮'=>'侮','僧'=>'僧','免'=>'免','勉'=>'勉','勤'=>'勤','卑'=>'卑','喝'=>'喝','嘆'=>'嘆','器'=>'器','塀'=>'塀','墨'=>'墨','層'=>'層','屮'=>'屮','悔'=>'悔','慨'=>'慨','憎'=>'憎','懲'=>'懲','敏'=>'敏','既'=>'既','暑'=>'暑','梅'=>'梅','海'=>'海','渚'=>'渚','漢'=>'漢','煮'=>'煮','爫'=>'爫','琢'=>'琢','碑'=>'碑','社'=>'社','祉'=>'祉','祈'=>'祈','祐'=>'祐','祖'=>'祖','祝'=>'祝','禍'=>'禍','禎'=>'禎','穀'=>'穀','突'=>'突','節'=>'節','練'=>'練','縉'=>'縉','繁'=>'繁','署'=>'署','者'=>'者','臭'=>'臭','艹'=>'艹','艹'=>'艹','著'=>'著','褐'=>'褐','視'=>'視','謁'=>'謁','謹'=>'謹','賓'=>'賓','贈'=>'贈','辶'=>'辶','逸'=>'逸','難'=>'難','響'=>'響','頻'=>'頻','並'=>'並','况'=>'况','全'=>'全','侀'=>'侀','充'=>'充','冀'=>'冀','勇'=>'勇','勺'=>'勺','喝'=>'喝','啕'=>'啕','喙'=>'喙','嗢'=>'嗢','塚'=>'塚','墳'=>'墳','奄'=>'奄','奔'=>'奔','婢'=>'婢','嬨'=>'嬨','廒'=>'廒','廙'=>'廙','彩'=>'彩','徭'=>'徭','惘'=>'惘','慎'=>'慎','愈'=>'愈','憎'=>'憎','慠'=>'慠','懲'=>'懲','戴'=>'戴','揄'=>'揄','搜'=>'搜','摒'=>'摒','敖'=>'敖','晴'=>'晴','朗'=>'朗','望'=>'望','杖'=>'杖','歹'=>'歹','殺'=>'殺','流'=>'流','滛'=>'滛','滋'=>'滋','漢'=>'漢','瀞'=>'瀞','煮'=>'煮','瞧'=>'瞧','爵'=>'爵','犯'=>'犯','猪'=>'猪','瑱'=>'瑱','甆'=>'甆','画'=>'画','瘝'=>'瘝','瘟'=>'瘟','益'=>'益','盛'=>'盛','直'=>'直','睊'=>'睊','着'=>'着','磌'=>'磌','窱'=>'窱','節'=>'節','类'=>'类','絛'=>'絛','練'=>'練','缾'=>'缾','者'=>'者','荒'=>'荒','華'=>'華','蝹'=>'蝹','襁'=>'襁','覆'=>'覆','視'=>'視','調'=>'調','諸'=>'諸','請'=>'請','謁'=>'謁','諾'=>'諾','諭'=>'諭','謹'=>'謹','變'=>'變','贈'=>'贈','輸'=>'輸','遲'=>'遲','醙'=>'醙','鉶'=>'鉶','陼'=>'陼','難'=>'難','靖'=>'靖','韛'=>'韛','響'=>'響','頋'=>'頋','頻'=>'頻','鬒'=>'鬒','龜'=>'龜','𢡊'=>'𢡊','𢡄'=>'𢡄','𣏕'=>'𣏕','㮝'=>'㮝','䀘'=>'䀘','䀹'=>'䀹','𥉉'=>'𥉉','𥳐'=>'𥳐','𧻓'=>'𧻓','齃'=>'齃','龎'=>'龎','יִ'=>'יִ','ײַ'=>'ײַ','שׁ'=>'שׁ','שׂ'=>'שׂ','שּׁ'=>'שּׁ','שּׂ'=>'שּׂ','אַ'=>'אַ','אָ'=>'אָ','אּ'=>'אּ','בּ'=>'בּ','גּ'=>'גּ','דּ'=>'דּ','הּ'=>'הּ','וּ'=>'וּ','זּ'=>'זּ','טּ'=>'טּ','יּ'=>'יּ','ךּ'=>'ךּ','כּ'=>'כּ','לּ'=>'לּ','מּ'=>'מּ','נּ'=>'נּ','סּ'=>'סּ','ףּ'=>'ףּ','פּ'=>'פּ','צּ'=>'צּ','קּ'=>'קּ','רּ'=>'רּ','שּ'=>'שּ','תּ'=>'תּ','וֹ'=>'וֹ','בֿ'=>'בֿ','כֿ'=>'כֿ','פֿ'=>'פֿ','𝅗𝅥'=>'𝅗𝅥','𝅘𝅥'=>'𝅘𝅥','𝅘𝅥𝅮'=>'𝅘𝅥𝅮','𝅘𝅥𝅯'=>'𝅘𝅥𝅯','𝅘𝅥𝅰'=>'𝅘𝅥𝅰','𝅘𝅥𝅱'=>'𝅘𝅥𝅱','𝅘𝅥𝅲'=>'𝅘𝅥𝅲','𝆹𝅥'=>'𝆹𝅥','𝆺𝅥'=>'𝆺𝅥','𝆹𝅥𝅮'=>'𝆹𝅥𝅮','𝆺𝅥𝅮'=>'𝆺𝅥𝅮','𝆹𝅥𝅯'=>'𝆹𝅥𝅯','𝆺𝅥𝅯'=>'𝆺𝅥𝅯','丽'=>'丽','丸'=>'丸','乁'=>'乁','𠄢'=>'𠄢','你'=>'你','侮'=>'侮','侻'=>'侻','倂'=>'倂','偺'=>'偺','備'=>'備','僧'=>'僧','像'=>'像','㒞'=>'㒞','𠘺'=>'𠘺','免'=>'免','兔'=>'兔','兤'=>'兤','具'=>'具','𠔜'=>'𠔜','㒹'=>'㒹','內'=>'內','再'=>'再','𠕋'=>'𠕋','冗'=>'冗','冤'=>'冤','仌'=>'仌','冬'=>'冬','况'=>'况','𩇟'=>'𩇟','凵'=>'凵','刃'=>'刃','㓟'=>'㓟','刻'=>'刻','剆'=>'剆','割'=>'割','剷'=>'剷','㔕'=>'㔕','勇'=>'勇','勉'=>'勉','勤'=>'勤','勺'=>'勺','包'=>'包','匆'=>'匆','北'=>'北','卉'=>'卉','卑'=>'卑','博'=>'博','即'=>'即','卽'=>'卽','卿'=>'卿','卿'=>'卿','卿'=>'卿','𠨬'=>'𠨬','灰'=>'灰','及'=>'及','叟'=>'叟','𠭣'=>'𠭣','叫'=>'叫','叱'=>'叱','吆'=>'吆','咞'=>'咞','吸'=>'吸','呈'=>'呈','周'=>'周','咢'=>'咢','哶'=>'哶','唐'=>'唐','啓'=>'啓','啣'=>'啣','善'=>'善','善'=>'善','喙'=>'喙','喫'=>'喫','喳'=>'喳','嗂'=>'嗂','圖'=>'圖','嘆'=>'嘆','圗'=>'圗','噑'=>'噑','噴'=>'噴','切'=>'切','壮'=>'壮','城'=>'城','埴'=>'埴','堍'=>'堍','型'=>'型','堲'=>'堲','報'=>'報','墬'=>'墬','𡓤'=>'𡓤','売'=>'売','壷'=>'壷','夆'=>'夆','多'=>'多','夢'=>'夢','奢'=>'奢','𡚨'=>'𡚨','𡛪'=>'𡛪','姬'=>'姬','娛'=>'娛','娧'=>'娧','姘'=>'姘','婦'=>'婦','㛮'=>'㛮','㛼'=>'㛼','嬈'=>'嬈','嬾'=>'嬾','嬾'=>'嬾','𡧈'=>'𡧈','寃'=>'寃','寘'=>'寘','寧'=>'寧','寳'=>'寳','𡬘'=>'𡬘','寿'=>'寿','将'=>'将','当'=>'当','尢'=>'尢','㞁'=>'㞁','屠'=>'屠','屮'=>'屮','峀'=>'峀','岍'=>'岍','𡷤'=>'𡷤','嵃'=>'嵃','𡷦'=>'𡷦','嵮'=>'嵮','嵫'=>'嵫','嵼'=>'嵼','巡'=>'巡','巢'=>'巢','㠯'=>'㠯','巽'=>'巽','帨'=>'帨','帽'=>'帽','幩'=>'幩','㡢'=>'㡢','𢆃'=>'𢆃','㡼'=>'㡼','庰'=>'庰','庳'=>'庳','庶'=>'庶','廊'=>'廊','𪎒'=>'𪎒','廾'=>'廾','𢌱'=>'𢌱','𢌱'=>'𢌱','舁'=>'舁','弢'=>'弢','弢'=>'弢','㣇'=>'㣇','𣊸'=>'𣊸','𦇚'=>'𦇚','形'=>'形','彫'=>'彫','㣣'=>'㣣','徚'=>'徚','忍'=>'忍','志'=>'志','忹'=>'忹','悁'=>'悁','㤺'=>'㤺','㤜'=>'㤜','悔'=>'悔','𢛔'=>'𢛔','惇'=>'惇','慈'=>'慈','慌'=>'慌','慎'=>'慎','慌'=>'慌','慺'=>'慺','憎'=>'憎','憲'=>'憲','憤'=>'憤','憯'=>'憯','懞'=>'懞','懲'=>'懲','懶'=>'懶','成'=>'成','戛'=>'戛','扝'=>'扝','抱'=>'抱','拔'=>'拔','捐'=>'捐','𢬌'=>'𢬌','挽'=>'挽','拼'=>'拼','捨'=>'捨','掃'=>'掃','揤'=>'揤','𢯱'=>'𢯱','搢'=>'搢','揅'=>'揅','掩'=>'掩','㨮'=>'㨮','摩'=>'摩','摾'=>'摾','撝'=>'撝','摷'=>'摷','㩬'=>'㩬','敏'=>'敏','敬'=>'敬','𣀊'=>'𣀊','旣'=>'旣','書'=>'書','晉'=>'晉','㬙'=>'㬙','暑'=>'暑','㬈'=>'㬈','㫤'=>'㫤','冒'=>'冒','冕'=>'冕','最'=>'最','暜'=>'暜','肭'=>'肭','䏙'=>'䏙','朗'=>'朗','望'=>'望','朡'=>'朡','杞'=>'杞','杓'=>'杓','𣏃'=>'𣏃','㭉'=>'㭉','柺'=>'柺','枅'=>'枅','桒'=>'桒','梅'=>'梅','𣑭'=>'𣑭','梎'=>'梎','栟'=>'栟','椔'=>'椔','㮝'=>'㮝','楂'=>'楂','榣'=>'榣','槪'=>'槪','檨'=>'檨','𣚣'=>'𣚣','櫛'=>'櫛','㰘'=>'㰘','次'=>'次','𣢧'=>'𣢧','歔'=>'歔','㱎'=>'㱎','歲'=>'歲','殟'=>'殟','殺'=>'殺','殻'=>'殻','𣪍'=>'𣪍','𡴋'=>'𡴋','𣫺'=>'𣫺','汎'=>'汎','𣲼'=>'𣲼','沿'=>'沿','泍'=>'泍','汧'=>'汧','洖'=>'洖','派'=>'派','海'=>'海','流'=>'流','浩'=>'浩','浸'=>'浸','涅'=>'涅','𣴞'=>'𣴞','洴'=>'洴','港'=>'港','湮'=>'湮','㴳'=>'㴳','滋'=>'滋','滇'=>'滇','𣻑'=>'𣻑','淹'=>'淹','潮'=>'潮','𣽞'=>'𣽞','𣾎'=>'𣾎','濆'=>'濆','瀹'=>'瀹','瀞'=>'瀞','瀛'=>'瀛','㶖'=>'㶖','灊'=>'灊','災'=>'災','灷'=>'灷','炭'=>'炭','𠔥'=>'𠔥','煅'=>'煅','𤉣'=>'𤉣','熜'=>'熜','𤎫'=>'𤎫','爨'=>'爨','爵'=>'爵','牐'=>'牐','𤘈'=>'𤘈','犀'=>'犀','犕'=>'犕','𤜵'=>'𤜵','𤠔'=>'𤠔','獺'=>'獺','王'=>'王','㺬'=>'㺬','玥'=>'玥','㺸'=>'㺸','㺸'=>'㺸','瑇'=>'瑇','瑜'=>'瑜','瑱'=>'瑱','璅'=>'璅','瓊'=>'瓊','㼛'=>'㼛','甤'=>'甤','𤰶'=>'𤰶','甾'=>'甾','𤲒'=>'𤲒','異'=>'異','𢆟'=>'𢆟','瘐'=>'瘐','𤾡'=>'𤾡','𤾸'=>'𤾸','𥁄'=>'𥁄','㿼'=>'㿼','䀈'=>'䀈','直'=>'直','𥃳'=>'𥃳','𥃲'=>'𥃲','𥄙'=>'𥄙','𥄳'=>'𥄳','眞'=>'眞','真'=>'真','真'=>'真','睊'=>'睊','䀹'=>'䀹','瞋'=>'瞋','䁆'=>'䁆','䂖'=>'䂖','𥐝'=>'𥐝','硎'=>'硎','碌'=>'碌','磌'=>'磌','䃣'=>'䃣','𥘦'=>'𥘦','祖'=>'祖','𥚚'=>'𥚚','𥛅'=>'𥛅','福'=>'福','秫'=>'秫','䄯'=>'䄯','穀'=>'穀','穊'=>'穊','穏'=>'穏','𥥼'=>'𥥼','𥪧'=>'𥪧','𥪧'=>'𥪧','竮'=>'竮','䈂'=>'䈂','𥮫'=>'𥮫','篆'=>'篆','築'=>'築','䈧'=>'䈧','𥲀'=>'𥲀','糒'=>'糒','䊠'=>'䊠','糨'=>'糨','糣'=>'糣','紀'=>'紀','𥾆'=>'𥾆','絣'=>'絣','䌁'=>'䌁','緇'=>'緇','縂'=>'縂','繅'=>'繅','䌴'=>'䌴','𦈨'=>'𦈨','𦉇'=>'𦉇','䍙'=>'䍙','𦋙'=>'𦋙','罺'=>'罺','𦌾'=>'𦌾','羕'=>'羕','翺'=>'翺','者'=>'者','𦓚'=>'𦓚','𦔣'=>'𦔣','聠'=>'聠','𦖨'=>'𦖨','聰'=>'聰','𣍟'=>'𣍟','䏕'=>'䏕','育'=>'育','脃'=>'脃','䐋'=>'䐋','脾'=>'脾','媵'=>'媵','𦞧'=>'𦞧','𦞵'=>'𦞵','𣎓'=>'𣎓','𣎜'=>'𣎜','舁'=>'舁','舄'=>'舄','辞'=>'辞','䑫'=>'䑫','芑'=>'芑','芋'=>'芋','芝'=>'芝','劳'=>'劳','花'=>'花','芳'=>'芳','芽'=>'芽','苦'=>'苦','𦬼'=>'𦬼','若'=>'若','茝'=>'茝','荣'=>'荣','莭'=>'莭','茣'=>'茣','莽'=>'莽','菧'=>'菧','著'=>'著','荓'=>'荓','菊'=>'菊','菌'=>'菌','菜'=>'菜','𦰶'=>'𦰶','𦵫'=>'𦵫','𦳕'=>'𦳕','䔫'=>'䔫','蓱'=>'蓱','蓳'=>'蓳','蔖'=>'蔖','𧏊'=>'𧏊','蕤'=>'蕤','𦼬'=>'𦼬','䕝'=>'䕝','䕡'=>'䕡','𦾱'=>'𦾱','𧃒'=>'𧃒','䕫'=>'䕫','虐'=>'虐','虜'=>'虜','虧'=>'虧','虩'=>'虩','蚩'=>'蚩','蚈'=>'蚈','蜎'=>'蜎','蛢'=>'蛢','蝹'=>'蝹','蜨'=>'蜨','蝫'=>'蝫','螆'=>'螆','䗗'=>'䗗','蟡'=>'蟡','蠁'=>'蠁','䗹'=>'䗹','衠'=>'衠','衣'=>'衣','𧙧'=>'𧙧','裗'=>'裗','裞'=>'裞','䘵'=>'䘵','裺'=>'裺','㒻'=>'㒻','𧢮'=>'𧢮','𧥦'=>'𧥦','䚾'=>'䚾','䛇'=>'䛇','誠'=>'誠','諭'=>'諭','變'=>'變','豕'=>'豕','𧲨'=>'𧲨','貫'=>'貫','賁'=>'賁','贛'=>'贛','起'=>'起','𧼯'=>'𧼯','𠠄'=>'𠠄','跋'=>'跋','趼'=>'趼','跰'=>'跰','𠣞'=>'𠣞','軔'=>'軔','輸'=>'輸','𨗒'=>'𨗒','𨗭'=>'𨗭','邔'=>'邔','郱'=>'郱','鄑'=>'鄑','𨜮'=>'𨜮','鄛'=>'鄛','鈸'=>'鈸','鋗'=>'鋗','鋘'=>'鋘','鉼'=>'鉼','鏹'=>'鏹','鐕'=>'鐕','𨯺'=>'𨯺','開'=>'開','䦕'=>'䦕','閷'=>'閷','𨵷'=>'𨵷','䧦'=>'䧦','雃'=>'雃','嶲'=>'嶲','霣'=>'霣','𩅅'=>'𩅅','𩈚'=>'𩈚','䩮'=>'䩮','䩶'=>'䩶','韠'=>'韠','𩐊'=>'𩐊','䪲'=>'䪲','𩒖'=>'𩒖','頋'=>'頋','頋'=>'頋','頩'=>'頩','𩖶'=>'𩖶','飢'=>'飢','䬳'=>'䬳','餩'=>'餩','馧'=>'馧','駂'=>'駂','駾'=>'駾','䯎'=>'䯎','𩬰'=>'𩬰','鬒'=>'鬒','鱀'=>'鱀','鳽'=>'鳽','䳎'=>'䳎','䳭'=>'䳭','鵧'=>'鵧','𪃎'=>'𪃎','䳸'=>'䳸','𪄅'=>'𪄅','𪈎'=>'𪈎','𪊑'=>'𪊑','麻'=>'麻','䵖'=>'䵖','黹'=>'黹','黾'=>'黾','鼅'=>'鼅','鼏'=>'鼏','鼖'=>'鼖','鼻'=>'鼻','𪘀'=>'𪘀'); \ No newline at end of file
+$GLOBALS['utf_canonical_decomp']=array('À'=>'À','Á'=>'Á','Â'=>'Â','Ã'=>'Ã','Ä'=>'Ä','Å'=>'Å','Ç'=>'Ç','È'=>'È','É'=>'É','Ê'=>'Ê','Ë'=>'Ë','Ì'=>'Ì','Í'=>'Í','Î'=>'Î','Ï'=>'Ï','Ñ'=>'Ñ','Ò'=>'Ò','Ó'=>'Ó','Ô'=>'Ô','Õ'=>'Õ','Ö'=>'Ö','Ù'=>'Ù','Ú'=>'Ú','Û'=>'Û','Ü'=>'Ü','Ý'=>'Ý','à'=>'à','á'=>'á','â'=>'â','ã'=>'ã','ä'=>'ä','å'=>'å','ç'=>'ç','è'=>'è','é'=>'é','ê'=>'ê','ë'=>'ë','ì'=>'ì','í'=>'í','î'=>'î','ï'=>'ï','ñ'=>'ñ','ò'=>'ò','ó'=>'ó','ô'=>'ô','õ'=>'õ','ö'=>'ö','ù'=>'ù','ú'=>'ú','û'=>'û','ü'=>'ü','ý'=>'ý','ÿ'=>'ÿ','Ā'=>'Ā','ā'=>'ā','Ă'=>'Ă','ă'=>'ă','Ą'=>'Ą','ą'=>'ą','Ć'=>'Ć','ć'=>'ć','Ĉ'=>'Ĉ','ĉ'=>'ĉ','Ċ'=>'Ċ','ċ'=>'ċ','Č'=>'Č','č'=>'č','Ď'=>'Ď','ď'=>'ď','Ē'=>'Ē','ē'=>'ē','Ĕ'=>'Ĕ','ĕ'=>'ĕ','Ė'=>'Ė','ė'=>'ė','Ę'=>'Ę','ę'=>'ę','Ě'=>'Ě','ě'=>'ě','Ĝ'=>'Ĝ','ĝ'=>'ĝ','Ğ'=>'Ğ','ğ'=>'ğ','Ġ'=>'Ġ','ġ'=>'ġ','Ģ'=>'Ģ','ģ'=>'ģ','Ĥ'=>'Ĥ','ĥ'=>'ĥ','Ĩ'=>'Ĩ','ĩ'=>'ĩ','Ī'=>'Ī','ī'=>'ī','Ĭ'=>'Ĭ','ĭ'=>'ĭ','Į'=>'Į','į'=>'į','İ'=>'İ','Ĵ'=>'Ĵ','ĵ'=>'ĵ','Ķ'=>'Ķ','ķ'=>'ķ','Ĺ'=>'Ĺ','ĺ'=>'ĺ','Ļ'=>'Ļ','ļ'=>'ļ','Ľ'=>'Ľ','ľ'=>'ľ','Ń'=>'Ń','ń'=>'ń','Ņ'=>'Ņ','ņ'=>'ņ','Ň'=>'Ň','ň'=>'ň','Ō'=>'Ō','ō'=>'ō','Ŏ'=>'Ŏ','ŏ'=>'ŏ','Ő'=>'Ő','ő'=>'ő','Ŕ'=>'Ŕ','ŕ'=>'ŕ','Ŗ'=>'Ŗ','ŗ'=>'ŗ','Ř'=>'Ř','ř'=>'ř','Ś'=>'Ś','ś'=>'ś','Ŝ'=>'Ŝ','ŝ'=>'ŝ','Ş'=>'Ş','ş'=>'ş','Š'=>'Š','š'=>'š','Ţ'=>'Ţ','ţ'=>'ţ','Ť'=>'Ť','ť'=>'ť','Ũ'=>'Ũ','ũ'=>'ũ','Ū'=>'Ū','ū'=>'ū','Ŭ'=>'Ŭ','ŭ'=>'ŭ','Ů'=>'Ů','ů'=>'ů','Ű'=>'Ű','ű'=>'ű','Ų'=>'Ų','ų'=>'ų','Ŵ'=>'Ŵ','ŵ'=>'ŵ','Ŷ'=>'Ŷ','ŷ'=>'ŷ','Ÿ'=>'Ÿ','Ź'=>'Ź','ź'=>'ź','Ż'=>'Ż','ż'=>'ż','Ž'=>'Ž','ž'=>'ž','Ơ'=>'Ơ','ơ'=>'ơ','Ư'=>'Ư','ư'=>'ư','Ǎ'=>'Ǎ','ǎ'=>'ǎ','Ǐ'=>'Ǐ','ǐ'=>'ǐ','Ǒ'=>'Ǒ','ǒ'=>'ǒ','Ǔ'=>'Ǔ','ǔ'=>'ǔ','Ǖ'=>'Ǖ','ǖ'=>'ǖ','Ǘ'=>'Ǘ','ǘ'=>'ǘ','Ǚ'=>'Ǚ','ǚ'=>'ǚ','Ǜ'=>'Ǜ','ǜ'=>'ǜ','Ǟ'=>'Ǟ','ǟ'=>'ǟ','Ǡ'=>'Ǡ','ǡ'=>'ǡ','Ǣ'=>'Ǣ','ǣ'=>'ǣ','Ǧ'=>'Ǧ','ǧ'=>'ǧ','Ǩ'=>'Ǩ','ǩ'=>'ǩ','Ǫ'=>'Ǫ','ǫ'=>'ǫ','Ǭ'=>'Ǭ','ǭ'=>'ǭ','Ǯ'=>'Ǯ','ǯ'=>'ǯ','ǰ'=>'ǰ','Ǵ'=>'Ǵ','ǵ'=>'ǵ','Ǹ'=>'Ǹ','ǹ'=>'ǹ','Ǻ'=>'Ǻ','ǻ'=>'ǻ','Ǽ'=>'Ǽ','ǽ'=>'ǽ','Ǿ'=>'Ǿ','ǿ'=>'ǿ','Ȁ'=>'Ȁ','ȁ'=>'ȁ','Ȃ'=>'Ȃ','ȃ'=>'ȃ','Ȅ'=>'Ȅ','ȅ'=>'ȅ','Ȇ'=>'Ȇ','ȇ'=>'ȇ','Ȉ'=>'Ȉ','ȉ'=>'ȉ','Ȋ'=>'Ȋ','ȋ'=>'ȋ','Ȍ'=>'Ȍ','ȍ'=>'ȍ','Ȏ'=>'Ȏ','ȏ'=>'ȏ','Ȑ'=>'Ȑ','ȑ'=>'ȑ','Ȓ'=>'Ȓ','ȓ'=>'ȓ','Ȕ'=>'Ȕ','ȕ'=>'ȕ','Ȗ'=>'Ȗ','ȗ'=>'ȗ','Ș'=>'Ș','ș'=>'ș','Ț'=>'Ț','ț'=>'ț','Ȟ'=>'Ȟ','ȟ'=>'ȟ','Ȧ'=>'Ȧ','ȧ'=>'ȧ','Ȩ'=>'Ȩ','ȩ'=>'ȩ','Ȫ'=>'Ȫ','ȫ'=>'ȫ','Ȭ'=>'Ȭ','ȭ'=>'ȭ','Ȯ'=>'Ȯ','ȯ'=>'ȯ','Ȱ'=>'Ȱ','ȱ'=>'ȱ','Ȳ'=>'Ȳ','ȳ'=>'ȳ','̀'=>'̀','́'=>'́','̓'=>'̓','̈́'=>'̈́','ʹ'=>'ʹ',';'=>';','΅'=>'΅','Ά'=>'Ά','·'=>'·','Έ'=>'Έ','Ή'=>'Ή','Ί'=>'Ί','Ό'=>'Ό','Ύ'=>'Ύ','Ώ'=>'Ώ','ΐ'=>'ΐ','Ϊ'=>'Ϊ','Ϋ'=>'Ϋ','ά'=>'ά','έ'=>'έ','ή'=>'ή','ί'=>'ί','ΰ'=>'ΰ','ϊ'=>'ϊ','ϋ'=>'ϋ','ό'=>'ό','ύ'=>'ύ','ώ'=>'ώ','ϓ'=>'ϓ','ϔ'=>'ϔ','Ѐ'=>'Ѐ','Ё'=>'Ё','Ѓ'=>'Ѓ','Ї'=>'Ї','Ќ'=>'Ќ','Ѝ'=>'Ѝ','Ў'=>'Ў','Й'=>'Й','й'=>'й','ѐ'=>'ѐ','ё'=>'ё','ѓ'=>'ѓ','ї'=>'ї','ќ'=>'ќ','ѝ'=>'ѝ','ў'=>'ў','Ѷ'=>'Ѷ','ѷ'=>'ѷ','Ӂ'=>'Ӂ','ӂ'=>'ӂ','Ӑ'=>'Ӑ','ӑ'=>'ӑ','Ӓ'=>'Ӓ','ӓ'=>'ӓ','Ӗ'=>'Ӗ','ӗ'=>'ӗ','Ӛ'=>'Ӛ','ӛ'=>'ӛ','Ӝ'=>'Ӝ','ӝ'=>'ӝ','Ӟ'=>'Ӟ','ӟ'=>'ӟ','Ӣ'=>'Ӣ','ӣ'=>'ӣ','Ӥ'=>'Ӥ','ӥ'=>'ӥ','Ӧ'=>'Ӧ','ӧ'=>'ӧ','Ӫ'=>'Ӫ','ӫ'=>'ӫ','Ӭ'=>'Ӭ','ӭ'=>'ӭ','Ӯ'=>'Ӯ','ӯ'=>'ӯ','Ӱ'=>'Ӱ','ӱ'=>'ӱ','Ӳ'=>'Ӳ','ӳ'=>'ӳ','Ӵ'=>'Ӵ','ӵ'=>'ӵ','Ӹ'=>'Ӹ','ӹ'=>'ӹ','آ'=>'آ','أ'=>'أ','ؤ'=>'ؤ','إ'=>'إ','ئ'=>'ئ','ۀ'=>'ۀ','ۂ'=>'ۂ','ۓ'=>'ۓ','ऩ'=>'ऩ','ऱ'=>'ऱ','ऴ'=>'ऴ','क़'=>'क़','ख़'=>'ख़','ग़'=>'ग़','ज़'=>'ज़','ड़'=>'ड़','ढ़'=>'ढ़','फ़'=>'फ़','य़'=>'य़','ো'=>'ো','ৌ'=>'ৌ','ড়'=>'ড়','ঢ়'=>'ঢ়','য়'=>'য়','ਲ਼'=>'ਲ਼','ਸ਼'=>'ਸ਼','ਖ਼'=>'ਖ਼','ਗ਼'=>'ਗ਼','ਜ਼'=>'ਜ਼','ਫ਼'=>'ਫ਼','ୈ'=>'ୈ','ୋ'=>'ୋ','ୌ'=>'ୌ','ଡ଼'=>'ଡ଼','ଢ଼'=>'ଢ଼','ஔ'=>'ஔ','ொ'=>'ொ','ோ'=>'ோ','ௌ'=>'ௌ','ై'=>'ై','ೀ'=>'ೀ','ೇ'=>'ೇ','ೈ'=>'ೈ','ೊ'=>'ೊ','ೋ'=>'ೋ','ൊ'=>'ൊ','ോ'=>'ോ','ൌ'=>'ൌ','ේ'=>'ේ','ො'=>'ො','ෝ'=>'ෝ','ෞ'=>'ෞ','གྷ'=>'གྷ','ཌྷ'=>'ཌྷ','དྷ'=>'དྷ','བྷ'=>'བྷ','ཛྷ'=>'ཛྷ','ཀྵ'=>'ཀྵ','ཱི'=>'ཱི','ཱུ'=>'ཱུ','ྲྀ'=>'ྲྀ','ླྀ'=>'ླྀ','ཱྀ'=>'ཱྀ','ྒྷ'=>'ྒྷ','ྜྷ'=>'ྜྷ','ྡྷ'=>'ྡྷ','ྦྷ'=>'ྦྷ','ྫྷ'=>'ྫྷ','ྐྵ'=>'ྐྵ','ဦ'=>'ဦ','ᬆ'=>'ᬆ','ᬈ'=>'ᬈ','ᬊ'=>'ᬊ','ᬌ'=>'ᬌ','ᬎ'=>'ᬎ','ᬒ'=>'ᬒ','ᬻ'=>'ᬻ','ᬽ'=>'ᬽ','ᭀ'=>'ᭀ','ᭁ'=>'ᭁ','ᭃ'=>'ᭃ','Ḁ'=>'Ḁ','ḁ'=>'ḁ','Ḃ'=>'Ḃ','ḃ'=>'ḃ','Ḅ'=>'Ḅ','ḅ'=>'ḅ','Ḇ'=>'Ḇ','ḇ'=>'ḇ','Ḉ'=>'Ḉ','ḉ'=>'ḉ','Ḋ'=>'Ḋ','ḋ'=>'ḋ','Ḍ'=>'Ḍ','ḍ'=>'ḍ','Ḏ'=>'Ḏ','ḏ'=>'ḏ','Ḑ'=>'Ḑ','ḑ'=>'ḑ','Ḓ'=>'Ḓ','ḓ'=>'ḓ','Ḕ'=>'Ḕ','ḕ'=>'ḕ','Ḗ'=>'Ḗ','ḗ'=>'ḗ','Ḙ'=>'Ḙ','ḙ'=>'ḙ','Ḛ'=>'Ḛ','ḛ'=>'ḛ','Ḝ'=>'Ḝ','ḝ'=>'ḝ','Ḟ'=>'Ḟ','ḟ'=>'ḟ','Ḡ'=>'Ḡ','ḡ'=>'ḡ','Ḣ'=>'Ḣ','ḣ'=>'ḣ','Ḥ'=>'Ḥ','ḥ'=>'ḥ','Ḧ'=>'Ḧ','ḧ'=>'ḧ','Ḩ'=>'Ḩ','ḩ'=>'ḩ','Ḫ'=>'Ḫ','ḫ'=>'ḫ','Ḭ'=>'Ḭ','ḭ'=>'ḭ','Ḯ'=>'Ḯ','ḯ'=>'ḯ','Ḱ'=>'Ḱ','ḱ'=>'ḱ','Ḳ'=>'Ḳ','ḳ'=>'ḳ','Ḵ'=>'Ḵ','ḵ'=>'ḵ','Ḷ'=>'Ḷ','ḷ'=>'ḷ','Ḹ'=>'Ḹ','ḹ'=>'ḹ','Ḻ'=>'Ḻ','ḻ'=>'ḻ','Ḽ'=>'Ḽ','ḽ'=>'ḽ','Ḿ'=>'Ḿ','ḿ'=>'ḿ','Ṁ'=>'Ṁ','ṁ'=>'ṁ','Ṃ'=>'Ṃ','ṃ'=>'ṃ','Ṅ'=>'Ṅ','ṅ'=>'ṅ','Ṇ'=>'Ṇ','ṇ'=>'ṇ','Ṉ'=>'Ṉ','ṉ'=>'ṉ','Ṋ'=>'Ṋ','ṋ'=>'ṋ','Ṍ'=>'Ṍ','ṍ'=>'ṍ','Ṏ'=>'Ṏ','ṏ'=>'ṏ','Ṑ'=>'Ṑ','ṑ'=>'ṑ','Ṓ'=>'Ṓ','ṓ'=>'ṓ','Ṕ'=>'Ṕ','ṕ'=>'ṕ','Ṗ'=>'Ṗ','ṗ'=>'ṗ','Ṙ'=>'Ṙ','ṙ'=>'ṙ','Ṛ'=>'Ṛ','ṛ'=>'ṛ','Ṝ'=>'Ṝ','ṝ'=>'ṝ','Ṟ'=>'Ṟ','ṟ'=>'ṟ','Ṡ'=>'Ṡ','ṡ'=>'ṡ','Ṣ'=>'Ṣ','ṣ'=>'ṣ','Ṥ'=>'Ṥ','ṥ'=>'ṥ','Ṧ'=>'Ṧ','ṧ'=>'ṧ','Ṩ'=>'Ṩ','ṩ'=>'ṩ','Ṫ'=>'Ṫ','ṫ'=>'ṫ','Ṭ'=>'Ṭ','ṭ'=>'ṭ','Ṯ'=>'Ṯ','ṯ'=>'ṯ','Ṱ'=>'Ṱ','ṱ'=>'ṱ','Ṳ'=>'Ṳ','ṳ'=>'ṳ','Ṵ'=>'Ṵ','ṵ'=>'ṵ','Ṷ'=>'Ṷ','ṷ'=>'ṷ','Ṹ'=>'Ṹ','ṹ'=>'ṹ','Ṻ'=>'Ṻ','ṻ'=>'ṻ','Ṽ'=>'Ṽ','ṽ'=>'ṽ','Ṿ'=>'Ṿ','ṿ'=>'ṿ','Ẁ'=>'Ẁ','ẁ'=>'ẁ','Ẃ'=>'Ẃ','ẃ'=>'ẃ','Ẅ'=>'Ẅ','ẅ'=>'ẅ','Ẇ'=>'Ẇ','ẇ'=>'ẇ','Ẉ'=>'Ẉ','ẉ'=>'ẉ','Ẋ'=>'Ẋ','ẋ'=>'ẋ','Ẍ'=>'Ẍ','ẍ'=>'ẍ','Ẏ'=>'Ẏ','ẏ'=>'ẏ','Ẑ'=>'Ẑ','ẑ'=>'ẑ','Ẓ'=>'Ẓ','ẓ'=>'ẓ','Ẕ'=>'Ẕ','ẕ'=>'ẕ','ẖ'=>'ẖ','ẗ'=>'ẗ','ẘ'=>'ẘ','ẙ'=>'ẙ','ẛ'=>'ẛ','Ạ'=>'Ạ','ạ'=>'ạ','Ả'=>'Ả','ả'=>'ả','Ấ'=>'Ấ','ấ'=>'ấ','Ầ'=>'Ầ','ầ'=>'ầ','Ẩ'=>'Ẩ','ẩ'=>'ẩ','Ẫ'=>'Ẫ','ẫ'=>'ẫ','Ậ'=>'Ậ','ậ'=>'ậ','Ắ'=>'Ắ','ắ'=>'ắ','Ằ'=>'Ằ','ằ'=>'ằ','Ẳ'=>'Ẳ','ẳ'=>'ẳ','Ẵ'=>'Ẵ','ẵ'=>'ẵ','Ặ'=>'Ặ','ặ'=>'ặ','Ẹ'=>'Ẹ','ẹ'=>'ẹ','Ẻ'=>'Ẻ','ẻ'=>'ẻ','Ẽ'=>'Ẽ','ẽ'=>'ẽ','Ế'=>'Ế','ế'=>'ế','Ề'=>'Ề','ề'=>'ề','Ể'=>'Ể','ể'=>'ể','Ễ'=>'Ễ','ễ'=>'ễ','Ệ'=>'Ệ','ệ'=>'ệ','Ỉ'=>'Ỉ','ỉ'=>'ỉ','Ị'=>'Ị','ị'=>'ị','Ọ'=>'Ọ','ọ'=>'ọ','Ỏ'=>'Ỏ','ỏ'=>'ỏ','Ố'=>'Ố','ố'=>'ố','Ồ'=>'Ồ','ồ'=>'ồ','Ổ'=>'Ổ','ổ'=>'ổ','Ỗ'=>'Ỗ','ỗ'=>'ỗ','Ộ'=>'Ộ','ộ'=>'ộ','Ớ'=>'Ớ','ớ'=>'ớ','Ờ'=>'Ờ','ờ'=>'ờ','Ở'=>'Ở','ở'=>'ở','Ỡ'=>'Ỡ','ỡ'=>'ỡ','Ợ'=>'Ợ','ợ'=>'ợ','Ụ'=>'Ụ','ụ'=>'ụ','Ủ'=>'Ủ','ủ'=>'ủ','Ứ'=>'Ứ','ứ'=>'ứ','Ừ'=>'Ừ','ừ'=>'ừ','Ử'=>'Ử','ử'=>'ử','Ữ'=>'Ữ','ữ'=>'ữ','Ự'=>'Ự','ự'=>'ự','Ỳ'=>'Ỳ','ỳ'=>'ỳ','Ỵ'=>'Ỵ','ỵ'=>'ỵ','Ỷ'=>'Ỷ','ỷ'=>'ỷ','Ỹ'=>'Ỹ','ỹ'=>'ỹ','ἀ'=>'ἀ','ἁ'=>'ἁ','ἂ'=>'ἂ','ἃ'=>'ἃ','ἄ'=>'ἄ','ἅ'=>'ἅ','ἆ'=>'ἆ','ἇ'=>'ἇ','Ἀ'=>'Ἀ','Ἁ'=>'Ἁ','Ἂ'=>'Ἂ','Ἃ'=>'Ἃ','Ἄ'=>'Ἄ','Ἅ'=>'Ἅ','Ἆ'=>'Ἆ','Ἇ'=>'Ἇ','ἐ'=>'ἐ','ἑ'=>'ἑ','ἒ'=>'ἒ','ἓ'=>'ἓ','ἔ'=>'ἔ','ἕ'=>'ἕ','Ἐ'=>'Ἐ','Ἑ'=>'Ἑ','Ἒ'=>'Ἒ','Ἓ'=>'Ἓ','Ἔ'=>'Ἔ','Ἕ'=>'Ἕ','ἠ'=>'ἠ','ἡ'=>'ἡ','ἢ'=>'ἢ','ἣ'=>'ἣ','ἤ'=>'ἤ','ἥ'=>'ἥ','ἦ'=>'ἦ','ἧ'=>'ἧ','Ἠ'=>'Ἠ','Ἡ'=>'Ἡ','Ἢ'=>'Ἢ','Ἣ'=>'Ἣ','Ἤ'=>'Ἤ','Ἥ'=>'Ἥ','Ἦ'=>'Ἦ','Ἧ'=>'Ἧ','ἰ'=>'ἰ','ἱ'=>'ἱ','ἲ'=>'ἲ','ἳ'=>'ἳ','ἴ'=>'ἴ','ἵ'=>'ἵ','ἶ'=>'ἶ','ἷ'=>'ἷ','Ἰ'=>'Ἰ','Ἱ'=>'Ἱ','Ἲ'=>'Ἲ','Ἳ'=>'Ἳ','Ἴ'=>'Ἴ','Ἵ'=>'Ἵ','Ἶ'=>'Ἶ','Ἷ'=>'Ἷ','ὀ'=>'ὀ','ὁ'=>'ὁ','ὂ'=>'ὂ','ὃ'=>'ὃ','ὄ'=>'ὄ','ὅ'=>'ὅ','Ὀ'=>'Ὀ','Ὁ'=>'Ὁ','Ὂ'=>'Ὂ','Ὃ'=>'Ὃ','Ὄ'=>'Ὄ','Ὅ'=>'Ὅ','ὐ'=>'ὐ','ὑ'=>'ὑ','ὒ'=>'ὒ','ὓ'=>'ὓ','ὔ'=>'ὔ','ὕ'=>'ὕ','ὖ'=>'ὖ','ὗ'=>'ὗ','Ὑ'=>'Ὑ','Ὓ'=>'Ὓ','Ὕ'=>'Ὕ','Ὗ'=>'Ὗ','ὠ'=>'ὠ','ὡ'=>'ὡ','ὢ'=>'ὢ','ὣ'=>'ὣ','ὤ'=>'ὤ','ὥ'=>'ὥ','ὦ'=>'ὦ','ὧ'=>'ὧ','Ὠ'=>'Ὠ','Ὡ'=>'Ὡ','Ὢ'=>'Ὢ','Ὣ'=>'Ὣ','Ὤ'=>'Ὤ','Ὥ'=>'Ὥ','Ὦ'=>'Ὦ','Ὧ'=>'Ὧ','ὰ'=>'ὰ','ά'=>'ά','ὲ'=>'ὲ','έ'=>'έ','ὴ'=>'ὴ','ή'=>'ή','ὶ'=>'ὶ','ί'=>'ί','ὸ'=>'ὸ','ό'=>'ό','ὺ'=>'ὺ','ύ'=>'ύ','ὼ'=>'ὼ','ώ'=>'ώ','ᾀ'=>'ᾀ','ᾁ'=>'ᾁ','ᾂ'=>'ᾂ','ᾃ'=>'ᾃ','ᾄ'=>'ᾄ','ᾅ'=>'ᾅ','ᾆ'=>'ᾆ','ᾇ'=>'ᾇ','ᾈ'=>'ᾈ','ᾉ'=>'ᾉ','ᾊ'=>'ᾊ','ᾋ'=>'ᾋ','ᾌ'=>'ᾌ','ᾍ'=>'ᾍ','ᾎ'=>'ᾎ','ᾏ'=>'ᾏ','ᾐ'=>'ᾐ','ᾑ'=>'ᾑ','ᾒ'=>'ᾒ','ᾓ'=>'ᾓ','ᾔ'=>'ᾔ','ᾕ'=>'ᾕ','ᾖ'=>'ᾖ','ᾗ'=>'ᾗ','ᾘ'=>'ᾘ','ᾙ'=>'ᾙ','ᾚ'=>'ᾚ','ᾛ'=>'ᾛ','ᾜ'=>'ᾜ','ᾝ'=>'ᾝ','ᾞ'=>'ᾞ','ᾟ'=>'ᾟ','ᾠ'=>'ᾠ','ᾡ'=>'ᾡ','ᾢ'=>'ᾢ','ᾣ'=>'ᾣ','ᾤ'=>'ᾤ','ᾥ'=>'ᾥ','ᾦ'=>'ᾦ','ᾧ'=>'ᾧ','ᾨ'=>'ᾨ','ᾩ'=>'ᾩ','ᾪ'=>'ᾪ','ᾫ'=>'ᾫ','ᾬ'=>'ᾬ','ᾭ'=>'ᾭ','ᾮ'=>'ᾮ','ᾯ'=>'ᾯ','ᾰ'=>'ᾰ','ᾱ'=>'ᾱ','ᾲ'=>'ᾲ','ᾳ'=>'ᾳ','ᾴ'=>'ᾴ','ᾶ'=>'ᾶ','ᾷ'=>'ᾷ','Ᾰ'=>'Ᾰ','Ᾱ'=>'Ᾱ','Ὰ'=>'Ὰ','Ά'=>'Ά','ᾼ'=>'ᾼ','ι'=>'ι','῁'=>'῁','ῂ'=>'ῂ','ῃ'=>'ῃ','ῄ'=>'ῄ','ῆ'=>'ῆ','ῇ'=>'ῇ','Ὲ'=>'Ὲ','Έ'=>'Έ','Ὴ'=>'Ὴ','Ή'=>'Ή','ῌ'=>'ῌ','῍'=>'῍','῎'=>'῎','῏'=>'῏','ῐ'=>'ῐ','ῑ'=>'ῑ','ῒ'=>'ῒ','ΐ'=>'ΐ','ῖ'=>'ῖ','ῗ'=>'ῗ','Ῐ'=>'Ῐ','Ῑ'=>'Ῑ','Ὶ'=>'Ὶ','Ί'=>'Ί','῝'=>'῝','῞'=>'῞','῟'=>'῟','ῠ'=>'ῠ','ῡ'=>'ῡ','ῢ'=>'ῢ','ΰ'=>'ΰ','ῤ'=>'ῤ','ῥ'=>'ῥ','ῦ'=>'ῦ','ῧ'=>'ῧ','Ῠ'=>'Ῠ','Ῡ'=>'Ῡ','Ὺ'=>'Ὺ','Ύ'=>'Ύ','Ῥ'=>'Ῥ','῭'=>'῭','΅'=>'΅','`'=>'`','ῲ'=>'ῲ','ῳ'=>'ῳ','ῴ'=>'ῴ','ῶ'=>'ῶ','ῷ'=>'ῷ','Ὸ'=>'Ὸ','Ό'=>'Ό','Ὼ'=>'Ὼ','Ώ'=>'Ώ','ῼ'=>'ῼ','´'=>'´',' '=>' ',' '=>' ','Ω'=>'Ω','K'=>'K','Å'=>'Å','↚'=>'↚','↛'=>'↛','↮'=>'↮','⇍'=>'⇍','⇎'=>'⇎','⇏'=>'⇏','∄'=>'∄','∉'=>'∉','∌'=>'∌','∤'=>'∤','∦'=>'∦','≁'=>'≁','≄'=>'≄','≇'=>'≇','≉'=>'≉','≠'=>'≠','≢'=>'≢','≭'=>'≭','≮'=>'≮','≯'=>'≯','≰'=>'≰','≱'=>'≱','≴'=>'≴','≵'=>'≵','≸'=>'≸','≹'=>'≹','⊀'=>'⊀','⊁'=>'⊁','⊄'=>'⊄','⊅'=>'⊅','⊈'=>'⊈','⊉'=>'⊉','⊬'=>'⊬','⊭'=>'⊭','⊮'=>'⊮','⊯'=>'⊯','⋠'=>'⋠','⋡'=>'⋡','⋢'=>'⋢','⋣'=>'⋣','⋪'=>'⋪','⋫'=>'⋫','⋬'=>'⋬','⋭'=>'⋭','〈'=>'〈','〉'=>'〉','⫝̸'=>'⫝̸','が'=>'が','ぎ'=>'ぎ','ぐ'=>'ぐ','げ'=>'げ','ご'=>'ご','ざ'=>'ざ','じ'=>'じ','ず'=>'ず','ぜ'=>'ぜ','ぞ'=>'ぞ','だ'=>'だ','ぢ'=>'ぢ','づ'=>'づ','で'=>'で','ど'=>'ど','ば'=>'ば','ぱ'=>'ぱ','び'=>'び','ぴ'=>'ぴ','ぶ'=>'ぶ','ぷ'=>'ぷ','べ'=>'べ','ぺ'=>'ぺ','ぼ'=>'ぼ','ぽ'=>'ぽ','ゔ'=>'ゔ','ゞ'=>'ゞ','ガ'=>'ガ','ギ'=>'ギ','グ'=>'グ','ゲ'=>'ゲ','ゴ'=>'ゴ','ザ'=>'ザ','ジ'=>'ジ','ズ'=>'ズ','ゼ'=>'ゼ','ゾ'=>'ゾ','ダ'=>'ダ','ヂ'=>'ヂ','ヅ'=>'ヅ','デ'=>'デ','ド'=>'ド','バ'=>'バ','パ'=>'パ','ビ'=>'ビ','ピ'=>'ピ','ブ'=>'ブ','プ'=>'プ','ベ'=>'ベ','ペ'=>'ペ','ボ'=>'ボ','ポ'=>'ポ','ヴ'=>'ヴ','ヷ'=>'ヷ','ヸ'=>'ヸ','ヹ'=>'ヹ','ヺ'=>'ヺ','ヾ'=>'ヾ','豈'=>'豈','更'=>'更','車'=>'車','賈'=>'賈','滑'=>'滑','串'=>'串','句'=>'句','龜'=>'龜','龜'=>'龜','契'=>'契','金'=>'金','喇'=>'喇','奈'=>'奈','懶'=>'懶','癩'=>'癩','羅'=>'羅','蘿'=>'蘿','螺'=>'螺','裸'=>'裸','邏'=>'邏','樂'=>'樂','洛'=>'洛','烙'=>'烙','珞'=>'珞','落'=>'落','酪'=>'酪','駱'=>'駱','亂'=>'亂','卵'=>'卵','欄'=>'欄','爛'=>'爛','蘭'=>'蘭','鸞'=>'鸞','嵐'=>'嵐','濫'=>'濫','藍'=>'藍','襤'=>'襤','拉'=>'拉','臘'=>'臘','蠟'=>'蠟','廊'=>'廊','朗'=>'朗','浪'=>'浪','狼'=>'狼','郎'=>'郎','來'=>'來','冷'=>'冷','勞'=>'勞','擄'=>'擄','櫓'=>'櫓','爐'=>'爐','盧'=>'盧','老'=>'老','蘆'=>'蘆','虜'=>'虜','路'=>'路','露'=>'露','魯'=>'魯','鷺'=>'鷺','碌'=>'碌','祿'=>'祿','綠'=>'綠','菉'=>'菉','錄'=>'錄','鹿'=>'鹿','論'=>'論','壟'=>'壟','弄'=>'弄','籠'=>'籠','聾'=>'聾','牢'=>'牢','磊'=>'磊','賂'=>'賂','雷'=>'雷','壘'=>'壘','屢'=>'屢','樓'=>'樓','淚'=>'淚','漏'=>'漏','累'=>'累','縷'=>'縷','陋'=>'陋','勒'=>'勒','肋'=>'肋','凜'=>'凜','凌'=>'凌','稜'=>'稜','綾'=>'綾','菱'=>'菱','陵'=>'陵','讀'=>'讀','拏'=>'拏','樂'=>'樂','諾'=>'諾','丹'=>'丹','寧'=>'寧','怒'=>'怒','率'=>'率','異'=>'異','北'=>'北','磻'=>'磻','便'=>'便','復'=>'復','不'=>'不','泌'=>'泌','數'=>'數','索'=>'索','參'=>'參','塞'=>'塞','省'=>'省','葉'=>'葉','說'=>'說','殺'=>'殺','辰'=>'辰','沈'=>'沈','拾'=>'拾','若'=>'若','掠'=>'掠','略'=>'略','亮'=>'亮','兩'=>'兩','凉'=>'凉','梁'=>'梁','糧'=>'糧','良'=>'良','諒'=>'諒','量'=>'量','勵'=>'勵','呂'=>'呂','女'=>'女','廬'=>'廬','旅'=>'旅','濾'=>'濾','礪'=>'礪','閭'=>'閭','驪'=>'驪','麗'=>'麗','黎'=>'黎','力'=>'力','曆'=>'曆','歷'=>'歷','轢'=>'轢','年'=>'年','憐'=>'憐','戀'=>'戀','撚'=>'撚','漣'=>'漣','煉'=>'煉','璉'=>'璉','秊'=>'秊','練'=>'練','聯'=>'聯','輦'=>'輦','蓮'=>'蓮','連'=>'連','鍊'=>'鍊','列'=>'列','劣'=>'劣','咽'=>'咽','烈'=>'烈','裂'=>'裂','說'=>'說','廉'=>'廉','念'=>'念','捻'=>'捻','殮'=>'殮','簾'=>'簾','獵'=>'獵','令'=>'令','囹'=>'囹','寧'=>'寧','嶺'=>'嶺','怜'=>'怜','玲'=>'玲','瑩'=>'瑩','羚'=>'羚','聆'=>'聆','鈴'=>'鈴','零'=>'零','靈'=>'靈','領'=>'領','例'=>'例','禮'=>'禮','醴'=>'醴','隸'=>'隸','惡'=>'惡','了'=>'了','僚'=>'僚','寮'=>'寮','尿'=>'尿','料'=>'料','樂'=>'樂','燎'=>'燎','療'=>'療','蓼'=>'蓼','遼'=>'遼','龍'=>'龍','暈'=>'暈','阮'=>'阮','劉'=>'劉','杻'=>'杻','柳'=>'柳','流'=>'流','溜'=>'溜','琉'=>'琉','留'=>'留','硫'=>'硫','紐'=>'紐','類'=>'類','六'=>'六','戮'=>'戮','陸'=>'陸','倫'=>'倫','崙'=>'崙','淪'=>'淪','輪'=>'輪','律'=>'律','慄'=>'慄','栗'=>'栗','率'=>'率','隆'=>'隆','利'=>'利','吏'=>'吏','履'=>'履','易'=>'易','李'=>'李','梨'=>'梨','泥'=>'泥','理'=>'理','痢'=>'痢','罹'=>'罹','裏'=>'裏','裡'=>'裡','里'=>'里','離'=>'離','匿'=>'匿','溺'=>'溺','吝'=>'吝','燐'=>'燐','璘'=>'璘','藺'=>'藺','隣'=>'隣','鱗'=>'鱗','麟'=>'麟','林'=>'林','淋'=>'淋','臨'=>'臨','立'=>'立','笠'=>'笠','粒'=>'粒','狀'=>'狀','炙'=>'炙','識'=>'識','什'=>'什','茶'=>'茶','刺'=>'刺','切'=>'切','度'=>'度','拓'=>'拓','糖'=>'糖','宅'=>'宅','洞'=>'洞','暴'=>'暴','輻'=>'輻','行'=>'行','降'=>'降','見'=>'見','廓'=>'廓','兀'=>'兀','嗀'=>'嗀','塚'=>'塚','晴'=>'晴','凞'=>'凞','猪'=>'猪','益'=>'益','礼'=>'礼','神'=>'神','祥'=>'祥','福'=>'福','靖'=>'靖','精'=>'精','羽'=>'羽','蘒'=>'蘒','諸'=>'諸','逸'=>'逸','都'=>'都','飯'=>'飯','飼'=>'飼','館'=>'館','鶴'=>'鶴','侮'=>'侮','僧'=>'僧','免'=>'免','勉'=>'勉','勤'=>'勤','卑'=>'卑','喝'=>'喝','嘆'=>'嘆','器'=>'器','塀'=>'塀','墨'=>'墨','層'=>'層','屮'=>'屮','悔'=>'悔','慨'=>'慨','憎'=>'憎','懲'=>'懲','敏'=>'敏','既'=>'既','暑'=>'暑','梅'=>'梅','海'=>'海','渚'=>'渚','漢'=>'漢','煮'=>'煮','爫'=>'爫','琢'=>'琢','碑'=>'碑','社'=>'社','祉'=>'祉','祈'=>'祈','祐'=>'祐','祖'=>'祖','祝'=>'祝','禍'=>'禍','禎'=>'禎','穀'=>'穀','突'=>'突','節'=>'節','練'=>'練','縉'=>'縉','繁'=>'繁','署'=>'署','者'=>'者','臭'=>'臭','艹'=>'艹','艹'=>'艹','著'=>'著','褐'=>'褐','視'=>'視','謁'=>'謁','謹'=>'謹','賓'=>'賓','贈'=>'贈','辶'=>'辶','逸'=>'逸','難'=>'難','響'=>'響','頻'=>'頻','並'=>'並','况'=>'况','全'=>'全','侀'=>'侀','充'=>'充','冀'=>'冀','勇'=>'勇','勺'=>'勺','喝'=>'喝','啕'=>'啕','喙'=>'喙','嗢'=>'嗢','塚'=>'塚','墳'=>'墳','奄'=>'奄','奔'=>'奔','婢'=>'婢','嬨'=>'嬨','廒'=>'廒','廙'=>'廙','彩'=>'彩','徭'=>'徭','惘'=>'惘','慎'=>'慎','愈'=>'愈','憎'=>'憎','慠'=>'慠','懲'=>'懲','戴'=>'戴','揄'=>'揄','搜'=>'搜','摒'=>'摒','敖'=>'敖','晴'=>'晴','朗'=>'朗','望'=>'望','杖'=>'杖','歹'=>'歹','殺'=>'殺','流'=>'流','滛'=>'滛','滋'=>'滋','漢'=>'漢','瀞'=>'瀞','煮'=>'煮','瞧'=>'瞧','爵'=>'爵','犯'=>'犯','猪'=>'猪','瑱'=>'瑱','甆'=>'甆','画'=>'画','瘝'=>'瘝','瘟'=>'瘟','益'=>'益','盛'=>'盛','直'=>'直','睊'=>'睊','着'=>'着','磌'=>'磌','窱'=>'窱','節'=>'節','类'=>'类','絛'=>'絛','練'=>'練','缾'=>'缾','者'=>'者','荒'=>'荒','華'=>'華','蝹'=>'蝹','襁'=>'襁','覆'=>'覆','視'=>'視','調'=>'調','諸'=>'諸','請'=>'請','謁'=>'謁','諾'=>'諾','諭'=>'諭','謹'=>'謹','變'=>'變','贈'=>'贈','輸'=>'輸','遲'=>'遲','醙'=>'醙','鉶'=>'鉶','陼'=>'陼','難'=>'難','靖'=>'靖','韛'=>'韛','響'=>'響','頋'=>'頋','頻'=>'頻','鬒'=>'鬒','龜'=>'龜','𢡊'=>'𢡊','𢡄'=>'𢡄','𣏕'=>'𣏕','㮝'=>'㮝','䀘'=>'䀘','䀹'=>'䀹','𥉉'=>'𥉉','𥳐'=>'𥳐','𧻓'=>'𧻓','齃'=>'齃','龎'=>'龎','יִ'=>'יִ','ײַ'=>'ײַ','שׁ'=>'שׁ','שׂ'=>'שׂ','שּׁ'=>'שּׁ','שּׂ'=>'שּׂ','אַ'=>'אַ','אָ'=>'אָ','אּ'=>'אּ','בּ'=>'בּ','גּ'=>'גּ','דּ'=>'דּ','הּ'=>'הּ','וּ'=>'וּ','זּ'=>'זּ','טּ'=>'טּ','יּ'=>'יּ','ךּ'=>'ךּ','כּ'=>'כּ','לּ'=>'לּ','מּ'=>'מּ','נּ'=>'נּ','סּ'=>'סּ','ףּ'=>'ףּ','פּ'=>'פּ','צּ'=>'צּ','קּ'=>'קּ','רּ'=>'רּ','שּ'=>'שּ','תּ'=>'תּ','וֹ'=>'וֹ','בֿ'=>'בֿ','כֿ'=>'כֿ','פֿ'=>'פֿ','𝅗𝅥'=>'𝅗𝅥','𝅘𝅥'=>'𝅘𝅥','𝅘𝅥𝅮'=>'𝅘𝅥𝅮','𝅘𝅥𝅯'=>'𝅘𝅥𝅯','𝅘𝅥𝅰'=>'𝅘𝅥𝅰','𝅘𝅥𝅱'=>'𝅘𝅥𝅱','𝅘𝅥𝅲'=>'𝅘𝅥𝅲','𝆹𝅥'=>'𝆹𝅥','𝆺𝅥'=>'𝆺𝅥','𝆹𝅥𝅮'=>'𝆹𝅥𝅮','𝆺𝅥𝅮'=>'𝆺𝅥𝅮','𝆹𝅥𝅯'=>'𝆹𝅥𝅯','𝆺𝅥𝅯'=>'𝆺𝅥𝅯','丽'=>'丽','丸'=>'丸','乁'=>'乁','𠄢'=>'𠄢','你'=>'你','侮'=>'侮','侻'=>'侻','倂'=>'倂','偺'=>'偺','備'=>'備','僧'=>'僧','像'=>'像','㒞'=>'㒞','𠘺'=>'𠘺','免'=>'免','兔'=>'兔','兤'=>'兤','具'=>'具','𠔜'=>'𠔜','㒹'=>'㒹','內'=>'內','再'=>'再','𠕋'=>'𠕋','冗'=>'冗','冤'=>'冤','仌'=>'仌','冬'=>'冬','况'=>'况','𩇟'=>'𩇟','凵'=>'凵','刃'=>'刃','㓟'=>'㓟','刻'=>'刻','剆'=>'剆','割'=>'割','剷'=>'剷','㔕'=>'㔕','勇'=>'勇','勉'=>'勉','勤'=>'勤','勺'=>'勺','包'=>'包','匆'=>'匆','北'=>'北','卉'=>'卉','卑'=>'卑','博'=>'博','即'=>'即','卽'=>'卽','卿'=>'卿','卿'=>'卿','卿'=>'卿','𠨬'=>'𠨬','灰'=>'灰','及'=>'及','叟'=>'叟','𠭣'=>'𠭣','叫'=>'叫','叱'=>'叱','吆'=>'吆','咞'=>'咞','吸'=>'吸','呈'=>'呈','周'=>'周','咢'=>'咢','哶'=>'哶','唐'=>'唐','啓'=>'啓','啣'=>'啣','善'=>'善','善'=>'善','喙'=>'喙','喫'=>'喫','喳'=>'喳','嗂'=>'嗂','圖'=>'圖','嘆'=>'嘆','圗'=>'圗','噑'=>'噑','噴'=>'噴','切'=>'切','壮'=>'壮','城'=>'城','埴'=>'埴','堍'=>'堍','型'=>'型','堲'=>'堲','報'=>'報','墬'=>'墬','𡓤'=>'𡓤','売'=>'売','壷'=>'壷','夆'=>'夆','多'=>'多','夢'=>'夢','奢'=>'奢','𡚨'=>'𡚨','𡛪'=>'𡛪','姬'=>'姬','娛'=>'娛','娧'=>'娧','姘'=>'姘','婦'=>'婦','㛮'=>'㛮','㛼'=>'㛼','嬈'=>'嬈','嬾'=>'嬾','嬾'=>'嬾','𡧈'=>'𡧈','寃'=>'寃','寘'=>'寘','寧'=>'寧','寳'=>'寳','𡬘'=>'𡬘','寿'=>'寿','将'=>'将','当'=>'当','尢'=>'尢','㞁'=>'㞁','屠'=>'屠','屮'=>'屮','峀'=>'峀','岍'=>'岍','𡷤'=>'𡷤','嵃'=>'嵃','𡷦'=>'𡷦','嵮'=>'嵮','嵫'=>'嵫','嵼'=>'嵼','巡'=>'巡','巢'=>'巢','㠯'=>'㠯','巽'=>'巽','帨'=>'帨','帽'=>'帽','幩'=>'幩','㡢'=>'㡢','𢆃'=>'𢆃','㡼'=>'㡼','庰'=>'庰','庳'=>'庳','庶'=>'庶','廊'=>'廊','𪎒'=>'𪎒','廾'=>'廾','𢌱'=>'𢌱','𢌱'=>'𢌱','舁'=>'舁','弢'=>'弢','弢'=>'弢','㣇'=>'㣇','𣊸'=>'𣊸','𦇚'=>'𦇚','形'=>'形','彫'=>'彫','㣣'=>'㣣','徚'=>'徚','忍'=>'忍','志'=>'志','忹'=>'忹','悁'=>'悁','㤺'=>'㤺','㤜'=>'㤜','悔'=>'悔','𢛔'=>'𢛔','惇'=>'惇','慈'=>'慈','慌'=>'慌','慎'=>'慎','慌'=>'慌','慺'=>'慺','憎'=>'憎','憲'=>'憲','憤'=>'憤','憯'=>'憯','懞'=>'懞','懲'=>'懲','懶'=>'懶','成'=>'成','戛'=>'戛','扝'=>'扝','抱'=>'抱','拔'=>'拔','捐'=>'捐','𢬌'=>'𢬌','挽'=>'挽','拼'=>'拼','捨'=>'捨','掃'=>'掃','揤'=>'揤','𢯱'=>'𢯱','搢'=>'搢','揅'=>'揅','掩'=>'掩','㨮'=>'㨮','摩'=>'摩','摾'=>'摾','撝'=>'撝','摷'=>'摷','㩬'=>'㩬','敏'=>'敏','敬'=>'敬','𣀊'=>'𣀊','旣'=>'旣','書'=>'書','晉'=>'晉','㬙'=>'㬙','暑'=>'暑','㬈'=>'㬈','㫤'=>'㫤','冒'=>'冒','冕'=>'冕','最'=>'最','暜'=>'暜','肭'=>'肭','䏙'=>'䏙','朗'=>'朗','望'=>'望','朡'=>'朡','杞'=>'杞','杓'=>'杓','𣏃'=>'𣏃','㭉'=>'㭉','柺'=>'柺','枅'=>'枅','桒'=>'桒','梅'=>'梅','𣑭'=>'𣑭','梎'=>'梎','栟'=>'栟','椔'=>'椔','㮝'=>'㮝','楂'=>'楂','榣'=>'榣','槪'=>'槪','檨'=>'檨','𣚣'=>'𣚣','櫛'=>'櫛','㰘'=>'㰘','次'=>'次','𣢧'=>'𣢧','歔'=>'歔','㱎'=>'㱎','歲'=>'歲','殟'=>'殟','殺'=>'殺','殻'=>'殻','𣪍'=>'𣪍','𡴋'=>'𡴋','𣫺'=>'𣫺','汎'=>'汎','𣲼'=>'𣲼','沿'=>'沿','泍'=>'泍','汧'=>'汧','洖'=>'洖','派'=>'派','海'=>'海','流'=>'流','浩'=>'浩','浸'=>'浸','涅'=>'涅','𣴞'=>'𣴞','洴'=>'洴','港'=>'港','湮'=>'湮','㴳'=>'㴳','滋'=>'滋','滇'=>'滇','𣻑'=>'𣻑','淹'=>'淹','潮'=>'潮','𣽞'=>'𣽞','𣾎'=>'𣾎','濆'=>'濆','瀹'=>'瀹','瀞'=>'瀞','瀛'=>'瀛','㶖'=>'㶖','灊'=>'灊','災'=>'災','灷'=>'灷','炭'=>'炭','𠔥'=>'𠔥','煅'=>'煅','𤉣'=>'𤉣','熜'=>'熜','𤎫'=>'𤎫','爨'=>'爨','爵'=>'爵','牐'=>'牐','𤘈'=>'𤘈','犀'=>'犀','犕'=>'犕','𤜵'=>'𤜵','𤠔'=>'𤠔','獺'=>'獺','王'=>'王','㺬'=>'㺬','玥'=>'玥','㺸'=>'㺸','㺸'=>'㺸','瑇'=>'瑇','瑜'=>'瑜','瑱'=>'瑱','璅'=>'璅','瓊'=>'瓊','㼛'=>'㼛','甤'=>'甤','𤰶'=>'𤰶','甾'=>'甾','𤲒'=>'𤲒','異'=>'異','𢆟'=>'𢆟','瘐'=>'瘐','𤾡'=>'𤾡','𤾸'=>'𤾸','𥁄'=>'𥁄','㿼'=>'㿼','䀈'=>'䀈','直'=>'直','𥃳'=>'𥃳','𥃲'=>'𥃲','𥄙'=>'𥄙','𥄳'=>'𥄳','眞'=>'眞','真'=>'真','真'=>'真','睊'=>'睊','䀹'=>'䀹','瞋'=>'瞋','䁆'=>'䁆','䂖'=>'䂖','𥐝'=>'𥐝','硎'=>'硎','碌'=>'碌','磌'=>'磌','䃣'=>'䃣','𥘦'=>'𥘦','祖'=>'祖','𥚚'=>'𥚚','𥛅'=>'𥛅','福'=>'福','秫'=>'秫','䄯'=>'䄯','穀'=>'穀','穊'=>'穊','穏'=>'穏','𥥼'=>'𥥼','𥪧'=>'𥪧','𥪧'=>'𥪧','竮'=>'竮','䈂'=>'䈂','𥮫'=>'𥮫','篆'=>'篆','築'=>'築','䈧'=>'䈧','𥲀'=>'𥲀','糒'=>'糒','䊠'=>'䊠','糨'=>'糨','糣'=>'糣','紀'=>'紀','𥾆'=>'𥾆','絣'=>'絣','䌁'=>'䌁','緇'=>'緇','縂'=>'縂','繅'=>'繅','䌴'=>'䌴','𦈨'=>'𦈨','𦉇'=>'𦉇','䍙'=>'䍙','𦋙'=>'𦋙','罺'=>'罺','𦌾'=>'𦌾','羕'=>'羕','翺'=>'翺','者'=>'者','𦓚'=>'𦓚','𦔣'=>'𦔣','聠'=>'聠','𦖨'=>'𦖨','聰'=>'聰','𣍟'=>'𣍟','䏕'=>'䏕','育'=>'育','脃'=>'脃','䐋'=>'䐋','脾'=>'脾','媵'=>'媵','𦞧'=>'𦞧','𦞵'=>'𦞵','𣎓'=>'𣎓','𣎜'=>'𣎜','舁'=>'舁','舄'=>'舄','辞'=>'辞','䑫'=>'䑫','芑'=>'芑','芋'=>'芋','芝'=>'芝','劳'=>'劳','花'=>'花','芳'=>'芳','芽'=>'芽','苦'=>'苦','𦬼'=>'𦬼','若'=>'若','茝'=>'茝','荣'=>'荣','莭'=>'莭','茣'=>'茣','莽'=>'莽','菧'=>'菧','著'=>'著','荓'=>'荓','菊'=>'菊','菌'=>'菌','菜'=>'菜','𦰶'=>'𦰶','𦵫'=>'𦵫','𦳕'=>'𦳕','䔫'=>'䔫','蓱'=>'蓱','蓳'=>'蓳','蔖'=>'蔖','𧏊'=>'𧏊','蕤'=>'蕤','𦼬'=>'𦼬','䕝'=>'䕝','䕡'=>'䕡','𦾱'=>'𦾱','𧃒'=>'𧃒','䕫'=>'䕫','虐'=>'虐','虜'=>'虜','虧'=>'虧','虩'=>'虩','蚩'=>'蚩','蚈'=>'蚈','蜎'=>'蜎','蛢'=>'蛢','蝹'=>'蝹','蜨'=>'蜨','蝫'=>'蝫','螆'=>'螆','䗗'=>'䗗','蟡'=>'蟡','蠁'=>'蠁','䗹'=>'䗹','衠'=>'衠','衣'=>'衣','𧙧'=>'𧙧','裗'=>'裗','裞'=>'裞','䘵'=>'䘵','裺'=>'裺','㒻'=>'㒻','𧢮'=>'𧢮','𧥦'=>'𧥦','䚾'=>'䚾','䛇'=>'䛇','誠'=>'誠','諭'=>'諭','變'=>'變','豕'=>'豕','𧲨'=>'𧲨','貫'=>'貫','賁'=>'賁','贛'=>'贛','起'=>'起','𧼯'=>'𧼯','𠠄'=>'𠠄','跋'=>'跋','趼'=>'趼','跰'=>'跰','𠣞'=>'𠣞','軔'=>'軔','輸'=>'輸','𨗒'=>'𨗒','𨗭'=>'𨗭','邔'=>'邔','郱'=>'郱','鄑'=>'鄑','𨜮'=>'𨜮','鄛'=>'鄛','鈸'=>'鈸','鋗'=>'鋗','鋘'=>'鋘','鉼'=>'鉼','鏹'=>'鏹','鐕'=>'鐕','𨯺'=>'𨯺','開'=>'開','䦕'=>'䦕','閷'=>'閷','𨵷'=>'𨵷','䧦'=>'䧦','雃'=>'雃','嶲'=>'嶲','霣'=>'霣','𩅅'=>'𩅅','𩈚'=>'𩈚','䩮'=>'䩮','䩶'=>'䩶','韠'=>'韠','𩐊'=>'𩐊','䪲'=>'䪲','𩒖'=>'𩒖','頋'=>'頋','頋'=>'頋','頩'=>'頩','𩖶'=>'𩖶','飢'=>'飢','䬳'=>'䬳','餩'=>'餩','馧'=>'馧','駂'=>'駂','駾'=>'駾','䯎'=>'䯎','𩬰'=>'𩬰','鬒'=>'鬒','鱀'=>'鱀','鳽'=>'鳽','䳎'=>'䳎','䳭'=>'䳭','鵧'=>'鵧','𪃎'=>'𪃎','䳸'=>'䳸','𪄅'=>'𪄅','𪈎'=>'𪈎','𪊑'=>'𪊑','麻'=>'麻','䵖'=>'䵖','黹'=>'黹','黾'=>'黾','鼅'=>'鼅','鼏'=>'鼏','鼖'=>'鼖','鼻'=>'鼻','𪘀'=>'𪘀');
diff --git a/phpBB/includes/utf/data/utf_compatibility_decomp.php b/phpBB/includes/utf/data/utf_compatibility_decomp.php
index 08a7a047a4..c62948e81a 100644
--- a/phpBB/includes/utf/data/utf_compatibility_decomp.php
+++ b/phpBB/includes/utf/data/utf_compatibility_decomp.php
@@ -1,2 +1,2 @@
<?php
-$GLOBALS['utf_compatibility_decomp']=array(' '=>' ','¨'=>' ̈','ª'=>'a','¯'=>' ̄','²'=>'2','³'=>'3','´'=>' ́','µ'=>'μ','¸'=>' ̧','¹'=>'1','º'=>'o','¼'=>'1⁄4','½'=>'1⁄2','¾'=>'3⁄4','À'=>'À','Á'=>'Á','Â'=>'Â','Ã'=>'Ã','Ä'=>'Ä','Å'=>'Å','Ç'=>'Ç','È'=>'È','É'=>'É','Ê'=>'Ê','Ë'=>'Ë','Ì'=>'Ì','Í'=>'Í','Î'=>'Î','Ï'=>'Ï','Ñ'=>'Ñ','Ò'=>'Ò','Ó'=>'Ó','Ô'=>'Ô','Õ'=>'Õ','Ö'=>'Ö','Ù'=>'Ù','Ú'=>'Ú','Û'=>'Û','Ü'=>'Ü','Ý'=>'Ý','à'=>'à','á'=>'á','â'=>'â','ã'=>'ã','ä'=>'ä','å'=>'å','ç'=>'ç','è'=>'è','é'=>'é','ê'=>'ê','ë'=>'ë','ì'=>'ì','í'=>'í','î'=>'î','ï'=>'ï','ñ'=>'ñ','ò'=>'ò','ó'=>'ó','ô'=>'ô','õ'=>'õ','ö'=>'ö','ù'=>'ù','ú'=>'ú','û'=>'û','ü'=>'ü','ý'=>'ý','ÿ'=>'ÿ','Ā'=>'Ā','ā'=>'ā','Ă'=>'Ă','ă'=>'ă','Ą'=>'Ą','ą'=>'ą','Ć'=>'Ć','ć'=>'ć','Ĉ'=>'Ĉ','ĉ'=>'ĉ','Ċ'=>'Ċ','ċ'=>'ċ','Č'=>'Č','č'=>'č','Ď'=>'Ď','ď'=>'ď','Ē'=>'Ē','ē'=>'ē','Ĕ'=>'Ĕ','ĕ'=>'ĕ','Ė'=>'Ė','ė'=>'ė','Ę'=>'Ę','ę'=>'ę','Ě'=>'Ě','ě'=>'ě','Ĝ'=>'Ĝ','ĝ'=>'ĝ','Ğ'=>'Ğ','ğ'=>'ğ','Ġ'=>'Ġ','ġ'=>'ġ','Ģ'=>'Ģ','ģ'=>'ģ','Ĥ'=>'Ĥ','ĥ'=>'ĥ','Ĩ'=>'Ĩ','ĩ'=>'ĩ','Ī'=>'Ī','ī'=>'ī','Ĭ'=>'Ĭ','ĭ'=>'ĭ','Į'=>'Į','į'=>'į','İ'=>'İ','IJ'=>'IJ','ij'=>'ij','Ĵ'=>'Ĵ','ĵ'=>'ĵ','Ķ'=>'Ķ','ķ'=>'ķ','Ĺ'=>'Ĺ','ĺ'=>'ĺ','Ļ'=>'Ļ','ļ'=>'ļ','Ľ'=>'Ľ','ľ'=>'ľ','Ŀ'=>'L·','ŀ'=>'l·','Ń'=>'Ń','ń'=>'ń','Ņ'=>'Ņ','ņ'=>'ņ','Ň'=>'Ň','ň'=>'ň','ʼn'=>'ʼn','Ō'=>'Ō','ō'=>'ō','Ŏ'=>'Ŏ','ŏ'=>'ŏ','Ő'=>'Ő','ő'=>'ő','Ŕ'=>'Ŕ','ŕ'=>'ŕ','Ŗ'=>'Ŗ','ŗ'=>'ŗ','Ř'=>'Ř','ř'=>'ř','Ś'=>'Ś','ś'=>'ś','Ŝ'=>'Ŝ','ŝ'=>'ŝ','Ş'=>'Ş','ş'=>'ş','Š'=>'Š','š'=>'š','Ţ'=>'Ţ','ţ'=>'ţ','Ť'=>'Ť','ť'=>'ť','Ũ'=>'Ũ','ũ'=>'ũ','Ū'=>'Ū','ū'=>'ū','Ŭ'=>'Ŭ','ŭ'=>'ŭ','Ů'=>'Ů','ů'=>'ů','Ű'=>'Ű','ű'=>'ű','Ų'=>'Ų','ų'=>'ų','Ŵ'=>'Ŵ','ŵ'=>'ŵ','Ŷ'=>'Ŷ','ŷ'=>'ŷ','Ÿ'=>'Ÿ','Ź'=>'Ź','ź'=>'ź','Ż'=>'Ż','ż'=>'ż','Ž'=>'Ž','ž'=>'ž','ſ'=>'s','Ơ'=>'Ơ','ơ'=>'ơ','Ư'=>'Ư','ư'=>'ư','DŽ'=>'DŽ','Dž'=>'Dž','dž'=>'dž','LJ'=>'LJ','Lj'=>'Lj','lj'=>'lj','NJ'=>'NJ','Nj'=>'Nj','nj'=>'nj','Ǎ'=>'Ǎ','ǎ'=>'ǎ','Ǐ'=>'Ǐ','ǐ'=>'ǐ','Ǒ'=>'Ǒ','ǒ'=>'ǒ','Ǔ'=>'Ǔ','ǔ'=>'ǔ','Ǖ'=>'Ǖ','ǖ'=>'ǖ','Ǘ'=>'Ǘ','ǘ'=>'ǘ','Ǚ'=>'Ǚ','ǚ'=>'ǚ','Ǜ'=>'Ǜ','ǜ'=>'ǜ','Ǟ'=>'Ǟ','ǟ'=>'ǟ','Ǡ'=>'Ǡ','ǡ'=>'ǡ','Ǣ'=>'Ǣ','ǣ'=>'ǣ','Ǧ'=>'Ǧ','ǧ'=>'ǧ','Ǩ'=>'Ǩ','ǩ'=>'ǩ','Ǫ'=>'Ǫ','ǫ'=>'ǫ','Ǭ'=>'Ǭ','ǭ'=>'ǭ','Ǯ'=>'Ǯ','ǯ'=>'ǯ','ǰ'=>'ǰ','DZ'=>'DZ','Dz'=>'Dz','dz'=>'dz','Ǵ'=>'Ǵ','ǵ'=>'ǵ','Ǹ'=>'Ǹ','ǹ'=>'ǹ','Ǻ'=>'Ǻ','ǻ'=>'ǻ','Ǽ'=>'Ǽ','ǽ'=>'ǽ','Ǿ'=>'Ǿ','ǿ'=>'ǿ','Ȁ'=>'Ȁ','ȁ'=>'ȁ','Ȃ'=>'Ȃ','ȃ'=>'ȃ','Ȅ'=>'Ȅ','ȅ'=>'ȅ','Ȇ'=>'Ȇ','ȇ'=>'ȇ','Ȉ'=>'Ȉ','ȉ'=>'ȉ','Ȋ'=>'Ȋ','ȋ'=>'ȋ','Ȍ'=>'Ȍ','ȍ'=>'ȍ','Ȏ'=>'Ȏ','ȏ'=>'ȏ','Ȑ'=>'Ȑ','ȑ'=>'ȑ','Ȓ'=>'Ȓ','ȓ'=>'ȓ','Ȕ'=>'Ȕ','ȕ'=>'ȕ','Ȗ'=>'Ȗ','ȗ'=>'ȗ','Ș'=>'Ș','ș'=>'ș','Ț'=>'Ț','ț'=>'ț','Ȟ'=>'Ȟ','ȟ'=>'ȟ','Ȧ'=>'Ȧ','ȧ'=>'ȧ','Ȩ'=>'Ȩ','ȩ'=>'ȩ','Ȫ'=>'Ȫ','ȫ'=>'ȫ','Ȭ'=>'Ȭ','ȭ'=>'ȭ','Ȯ'=>'Ȯ','ȯ'=>'ȯ','Ȱ'=>'Ȱ','ȱ'=>'ȱ','Ȳ'=>'Ȳ','ȳ'=>'ȳ','ʰ'=>'h','ʱ'=>'ɦ','ʲ'=>'j','ʳ'=>'r','ʴ'=>'ɹ','ʵ'=>'ɻ','ʶ'=>'ʁ','ʷ'=>'w','ʸ'=>'y','˘'=>' ̆','˙'=>' ̇','˚'=>' ̊','˛'=>' ̨','˜'=>' ̃','˝'=>' ̋','ˠ'=>'ɣ','ˡ'=>'l','ˢ'=>'s','ˣ'=>'x','ˤ'=>'ʕ','̀'=>'̀','́'=>'́','̓'=>'̓','̈́'=>'̈́','ʹ'=>'ʹ','ͺ'=>' ͅ',';'=>';','΄'=>' ́','΅'=>' ̈́','Ά'=>'Ά','·'=>'·','Έ'=>'Έ','Ή'=>'Ή','Ί'=>'Ί','Ό'=>'Ό','Ύ'=>'Ύ','Ώ'=>'Ώ','ΐ'=>'ΐ','Ϊ'=>'Ϊ','Ϋ'=>'Ϋ','ά'=>'ά','έ'=>'έ','ή'=>'ή','ί'=>'ί','ΰ'=>'ΰ','ϊ'=>'ϊ','ϋ'=>'ϋ','ό'=>'ό','ύ'=>'ύ','ώ'=>'ώ','ϐ'=>'β','ϑ'=>'θ','ϒ'=>'Υ','ϓ'=>'Ύ','ϔ'=>'Ϋ','ϕ'=>'φ','ϖ'=>'π','ϰ'=>'κ','ϱ'=>'ρ','ϲ'=>'ς','ϴ'=>'Θ','ϵ'=>'ε','Ϲ'=>'Σ','Ѐ'=>'Ѐ','Ё'=>'Ё','Ѓ'=>'Ѓ','Ї'=>'Ї','Ќ'=>'Ќ','Ѝ'=>'Ѝ','Ў'=>'Ў','Й'=>'Й','й'=>'й','ѐ'=>'ѐ','ё'=>'ё','ѓ'=>'ѓ','ї'=>'ї','ќ'=>'ќ','ѝ'=>'ѝ','ў'=>'ў','Ѷ'=>'Ѷ','ѷ'=>'ѷ','Ӂ'=>'Ӂ','ӂ'=>'ӂ','Ӑ'=>'Ӑ','ӑ'=>'ӑ','Ӓ'=>'Ӓ','ӓ'=>'ӓ','Ӗ'=>'Ӗ','ӗ'=>'ӗ','Ӛ'=>'Ӛ','ӛ'=>'ӛ','Ӝ'=>'Ӝ','ӝ'=>'ӝ','Ӟ'=>'Ӟ','ӟ'=>'ӟ','Ӣ'=>'Ӣ','ӣ'=>'ӣ','Ӥ'=>'Ӥ','ӥ'=>'ӥ','Ӧ'=>'Ӧ','ӧ'=>'ӧ','Ӫ'=>'Ӫ','ӫ'=>'ӫ','Ӭ'=>'Ӭ','ӭ'=>'ӭ','Ӯ'=>'Ӯ','ӯ'=>'ӯ','Ӱ'=>'Ӱ','ӱ'=>'ӱ','Ӳ'=>'Ӳ','ӳ'=>'ӳ','Ӵ'=>'Ӵ','ӵ'=>'ӵ','Ӹ'=>'Ӹ','ӹ'=>'ӹ','և'=>'եւ','آ'=>'آ','أ'=>'أ','ؤ'=>'ؤ','إ'=>'إ','ئ'=>'ئ','ٵ'=>'اٴ','ٶ'=>'وٴ','ٷ'=>'ۇٴ','ٸ'=>'يٴ','ۀ'=>'ۀ','ۂ'=>'ۂ','ۓ'=>'ۓ','ऩ'=>'ऩ','ऱ'=>'ऱ','ऴ'=>'ऴ','क़'=>'क़','ख़'=>'ख़','ग़'=>'ग़','ज़'=>'ज़','ड़'=>'ड़','ढ़'=>'ढ़','फ़'=>'फ़','य़'=>'य़','ো'=>'ো','ৌ'=>'ৌ','ড়'=>'ড়','ঢ়'=>'ঢ়','য়'=>'য়','ਲ਼'=>'ਲ਼','ਸ਼'=>'ਸ਼','ਖ਼'=>'ਖ਼','ਗ਼'=>'ਗ਼','ਜ਼'=>'ਜ਼','ਫ਼'=>'ਫ਼','ୈ'=>'ୈ','ୋ'=>'ୋ','ୌ'=>'ୌ','ଡ଼'=>'ଡ଼','ଢ଼'=>'ଢ଼','ஔ'=>'ஔ','ொ'=>'ொ','ோ'=>'ோ','ௌ'=>'ௌ','ై'=>'ై','ೀ'=>'ೀ','ೇ'=>'ೇ','ೈ'=>'ೈ','ೊ'=>'ೊ','ೋ'=>'ೋ','ൊ'=>'ൊ','ോ'=>'ോ','ൌ'=>'ൌ','ේ'=>'ේ','ො'=>'ො','ෝ'=>'ෝ','ෞ'=>'ෞ','ำ'=>'ํา','ຳ'=>'ໍາ','ໜ'=>'ຫນ','ໝ'=>'ຫມ','༌'=>'་','གྷ'=>'གྷ','ཌྷ'=>'ཌྷ','དྷ'=>'དྷ','བྷ'=>'བྷ','ཛྷ'=>'ཛྷ','ཀྵ'=>'ཀྵ','ཱི'=>'ཱི','ཱུ'=>'ཱུ','ྲྀ'=>'ྲྀ','ཷ'=>'ྲཱྀ','ླྀ'=>'ླྀ','ཹ'=>'ླཱྀ','ཱྀ'=>'ཱྀ','ྒྷ'=>'ྒྷ','ྜྷ'=>'ྜྷ','ྡྷ'=>'ྡྷ','ྦྷ'=>'ྦྷ','ྫྷ'=>'ྫྷ','ྐྵ'=>'ྐྵ','ဦ'=>'ဦ','ჼ'=>'ნ','ᬆ'=>'ᬆ','ᬈ'=>'ᬈ','ᬊ'=>'ᬊ','ᬌ'=>'ᬌ','ᬎ'=>'ᬎ','ᬒ'=>'ᬒ','ᬻ'=>'ᬻ','ᬽ'=>'ᬽ','ᭀ'=>'ᭀ','ᭁ'=>'ᭁ','ᭃ'=>'ᭃ','ᴬ'=>'A','ᴭ'=>'Æ','ᴮ'=>'B','ᴰ'=>'D','ᴱ'=>'E','ᴲ'=>'Ǝ','ᴳ'=>'G','ᴴ'=>'H','ᴵ'=>'I','ᴶ'=>'J','ᴷ'=>'K','ᴸ'=>'L','ᴹ'=>'M','ᴺ'=>'N','ᴼ'=>'O','ᴽ'=>'Ȣ','ᴾ'=>'P','ᴿ'=>'R','ᵀ'=>'T','ᵁ'=>'U','ᵂ'=>'W','ᵃ'=>'a','ᵄ'=>'ɐ','ᵅ'=>'ɑ','ᵆ'=>'ᴂ','ᵇ'=>'b','ᵈ'=>'d','ᵉ'=>'e','ᵊ'=>'ə','ᵋ'=>'ɛ','ᵌ'=>'ɜ','ᵍ'=>'g','ᵏ'=>'k','ᵐ'=>'m','ᵑ'=>'ŋ','ᵒ'=>'o','ᵓ'=>'ɔ','ᵔ'=>'ᴖ','ᵕ'=>'ᴗ','ᵖ'=>'p','ᵗ'=>'t','ᵘ'=>'u','ᵙ'=>'ᴝ','ᵚ'=>'ɯ','ᵛ'=>'v','ᵜ'=>'ᴥ','ᵝ'=>'β','ᵞ'=>'γ','ᵟ'=>'δ','ᵠ'=>'φ','ᵡ'=>'χ','ᵢ'=>'i','ᵣ'=>'r','ᵤ'=>'u','ᵥ'=>'v','ᵦ'=>'β','ᵧ'=>'γ','ᵨ'=>'ρ','ᵩ'=>'φ','ᵪ'=>'χ','ᵸ'=>'н','ᶛ'=>'ɒ','ᶜ'=>'c','ᶝ'=>'ɕ','ᶞ'=>'ð','ᶟ'=>'ɜ','ᶠ'=>'f','ᶡ'=>'ɟ','ᶢ'=>'ɡ','ᶣ'=>'ɥ','ᶤ'=>'ɨ','ᶥ'=>'ɩ','ᶦ'=>'ɪ','ᶧ'=>'ᵻ','ᶨ'=>'ʝ','ᶩ'=>'ɭ','ᶪ'=>'ᶅ','ᶫ'=>'ʟ','ᶬ'=>'ɱ','ᶭ'=>'ɰ','ᶮ'=>'ɲ','ᶯ'=>'ɳ','ᶰ'=>'ɴ','ᶱ'=>'ɵ','ᶲ'=>'ɸ','ᶳ'=>'ʂ','ᶴ'=>'ʃ','ᶵ'=>'ƫ','ᶶ'=>'ʉ','ᶷ'=>'ʊ','ᶸ'=>'ᴜ','ᶹ'=>'ʋ','ᶺ'=>'ʌ','ᶻ'=>'z','ᶼ'=>'ʐ','ᶽ'=>'ʑ','ᶾ'=>'ʒ','ᶿ'=>'θ','Ḁ'=>'Ḁ','ḁ'=>'ḁ','Ḃ'=>'Ḃ','ḃ'=>'ḃ','Ḅ'=>'Ḅ','ḅ'=>'ḅ','Ḇ'=>'Ḇ','ḇ'=>'ḇ','Ḉ'=>'Ḉ','ḉ'=>'ḉ','Ḋ'=>'Ḋ','ḋ'=>'ḋ','Ḍ'=>'Ḍ','ḍ'=>'ḍ','Ḏ'=>'Ḏ','ḏ'=>'ḏ','Ḑ'=>'Ḑ','ḑ'=>'ḑ','Ḓ'=>'Ḓ','ḓ'=>'ḓ','Ḕ'=>'Ḕ','ḕ'=>'ḕ','Ḗ'=>'Ḗ','ḗ'=>'ḗ','Ḙ'=>'Ḙ','ḙ'=>'ḙ','Ḛ'=>'Ḛ','ḛ'=>'ḛ','Ḝ'=>'Ḝ','ḝ'=>'ḝ','Ḟ'=>'Ḟ','ḟ'=>'ḟ','Ḡ'=>'Ḡ','ḡ'=>'ḡ','Ḣ'=>'Ḣ','ḣ'=>'ḣ','Ḥ'=>'Ḥ','ḥ'=>'ḥ','Ḧ'=>'Ḧ','ḧ'=>'ḧ','Ḩ'=>'Ḩ','ḩ'=>'ḩ','Ḫ'=>'Ḫ','ḫ'=>'ḫ','Ḭ'=>'Ḭ','ḭ'=>'ḭ','Ḯ'=>'Ḯ','ḯ'=>'ḯ','Ḱ'=>'Ḱ','ḱ'=>'ḱ','Ḳ'=>'Ḳ','ḳ'=>'ḳ','Ḵ'=>'Ḵ','ḵ'=>'ḵ','Ḷ'=>'Ḷ','ḷ'=>'ḷ','Ḹ'=>'Ḹ','ḹ'=>'ḹ','Ḻ'=>'Ḻ','ḻ'=>'ḻ','Ḽ'=>'Ḽ','ḽ'=>'ḽ','Ḿ'=>'Ḿ','ḿ'=>'ḿ','Ṁ'=>'Ṁ','ṁ'=>'ṁ','Ṃ'=>'Ṃ','ṃ'=>'ṃ','Ṅ'=>'Ṅ','ṅ'=>'ṅ','Ṇ'=>'Ṇ','ṇ'=>'ṇ','Ṉ'=>'Ṉ','ṉ'=>'ṉ','Ṋ'=>'Ṋ','ṋ'=>'ṋ','Ṍ'=>'Ṍ','ṍ'=>'ṍ','Ṏ'=>'Ṏ','ṏ'=>'ṏ','Ṑ'=>'Ṑ','ṑ'=>'ṑ','Ṓ'=>'Ṓ','ṓ'=>'ṓ','Ṕ'=>'Ṕ','ṕ'=>'ṕ','Ṗ'=>'Ṗ','ṗ'=>'ṗ','Ṙ'=>'Ṙ','ṙ'=>'ṙ','Ṛ'=>'Ṛ','ṛ'=>'ṛ','Ṝ'=>'Ṝ','ṝ'=>'ṝ','Ṟ'=>'Ṟ','ṟ'=>'ṟ','Ṡ'=>'Ṡ','ṡ'=>'ṡ','Ṣ'=>'Ṣ','ṣ'=>'ṣ','Ṥ'=>'Ṥ','ṥ'=>'ṥ','Ṧ'=>'Ṧ','ṧ'=>'ṧ','Ṩ'=>'Ṩ','ṩ'=>'ṩ','Ṫ'=>'Ṫ','ṫ'=>'ṫ','Ṭ'=>'Ṭ','ṭ'=>'ṭ','Ṯ'=>'Ṯ','ṯ'=>'ṯ','Ṱ'=>'Ṱ','ṱ'=>'ṱ','Ṳ'=>'Ṳ','ṳ'=>'ṳ','Ṵ'=>'Ṵ','ṵ'=>'ṵ','Ṷ'=>'Ṷ','ṷ'=>'ṷ','Ṹ'=>'Ṹ','ṹ'=>'ṹ','Ṻ'=>'Ṻ','ṻ'=>'ṻ','Ṽ'=>'Ṽ','ṽ'=>'ṽ','Ṿ'=>'Ṿ','ṿ'=>'ṿ','Ẁ'=>'Ẁ','ẁ'=>'ẁ','Ẃ'=>'Ẃ','ẃ'=>'ẃ','Ẅ'=>'Ẅ','ẅ'=>'ẅ','Ẇ'=>'Ẇ','ẇ'=>'ẇ','Ẉ'=>'Ẉ','ẉ'=>'ẉ','Ẋ'=>'Ẋ','ẋ'=>'ẋ','Ẍ'=>'Ẍ','ẍ'=>'ẍ','Ẏ'=>'Ẏ','ẏ'=>'ẏ','Ẑ'=>'Ẑ','ẑ'=>'ẑ','Ẓ'=>'Ẓ','ẓ'=>'ẓ','Ẕ'=>'Ẕ','ẕ'=>'ẕ','ẖ'=>'ẖ','ẗ'=>'ẗ','ẘ'=>'ẘ','ẙ'=>'ẙ','ẚ'=>'aʾ','ẛ'=>'ṡ','Ạ'=>'Ạ','ạ'=>'ạ','Ả'=>'Ả','ả'=>'ả','Ấ'=>'Ấ','ấ'=>'ấ','Ầ'=>'Ầ','ầ'=>'ầ','Ẩ'=>'Ẩ','ẩ'=>'ẩ','Ẫ'=>'Ẫ','ẫ'=>'ẫ','Ậ'=>'Ậ','ậ'=>'ậ','Ắ'=>'Ắ','ắ'=>'ắ','Ằ'=>'Ằ','ằ'=>'ằ','Ẳ'=>'Ẳ','ẳ'=>'ẳ','Ẵ'=>'Ẵ','ẵ'=>'ẵ','Ặ'=>'Ặ','ặ'=>'ặ','Ẹ'=>'Ẹ','ẹ'=>'ẹ','Ẻ'=>'Ẻ','ẻ'=>'ẻ','Ẽ'=>'Ẽ','ẽ'=>'ẽ','Ế'=>'Ế','ế'=>'ế','Ề'=>'Ề','ề'=>'ề','Ể'=>'Ể','ể'=>'ể','Ễ'=>'Ễ','ễ'=>'ễ','Ệ'=>'Ệ','ệ'=>'ệ','Ỉ'=>'Ỉ','ỉ'=>'ỉ','Ị'=>'Ị','ị'=>'ị','Ọ'=>'Ọ','ọ'=>'ọ','Ỏ'=>'Ỏ','ỏ'=>'ỏ','Ố'=>'Ố','ố'=>'ố','Ồ'=>'Ồ','ồ'=>'ồ','Ổ'=>'Ổ','ổ'=>'ổ','Ỗ'=>'Ỗ','ỗ'=>'ỗ','Ộ'=>'Ộ','ộ'=>'ộ','Ớ'=>'Ớ','ớ'=>'ớ','Ờ'=>'Ờ','ờ'=>'ờ','Ở'=>'Ở','ở'=>'ở','Ỡ'=>'Ỡ','ỡ'=>'ỡ','Ợ'=>'Ợ','ợ'=>'ợ','Ụ'=>'Ụ','ụ'=>'ụ','Ủ'=>'Ủ','ủ'=>'ủ','Ứ'=>'Ứ','ứ'=>'ứ','Ừ'=>'Ừ','ừ'=>'ừ','Ử'=>'Ử','ử'=>'ử','Ữ'=>'Ữ','ữ'=>'ữ','Ự'=>'Ự','ự'=>'ự','Ỳ'=>'Ỳ','ỳ'=>'ỳ','Ỵ'=>'Ỵ','ỵ'=>'ỵ','Ỷ'=>'Ỷ','ỷ'=>'ỷ','Ỹ'=>'Ỹ','ỹ'=>'ỹ','ἀ'=>'ἀ','ἁ'=>'ἁ','ἂ'=>'ἂ','ἃ'=>'ἃ','ἄ'=>'ἄ','ἅ'=>'ἅ','ἆ'=>'ἆ','ἇ'=>'ἇ','Ἀ'=>'Ἀ','Ἁ'=>'Ἁ','Ἂ'=>'Ἂ','Ἃ'=>'Ἃ','Ἄ'=>'Ἄ','Ἅ'=>'Ἅ','Ἆ'=>'Ἆ','Ἇ'=>'Ἇ','ἐ'=>'ἐ','ἑ'=>'ἑ','ἒ'=>'ἒ','ἓ'=>'ἓ','ἔ'=>'ἔ','ἕ'=>'ἕ','Ἐ'=>'Ἐ','Ἑ'=>'Ἑ','Ἒ'=>'Ἒ','Ἓ'=>'Ἓ','Ἔ'=>'Ἔ','Ἕ'=>'Ἕ','ἠ'=>'ἠ','ἡ'=>'ἡ','ἢ'=>'ἢ','ἣ'=>'ἣ','ἤ'=>'ἤ','ἥ'=>'ἥ','ἦ'=>'ἦ','ἧ'=>'ἧ','Ἠ'=>'Ἠ','Ἡ'=>'Ἡ','Ἢ'=>'Ἢ','Ἣ'=>'Ἣ','Ἤ'=>'Ἤ','Ἥ'=>'Ἥ','Ἦ'=>'Ἦ','Ἧ'=>'Ἧ','ἰ'=>'ἰ','ἱ'=>'ἱ','ἲ'=>'ἲ','ἳ'=>'ἳ','ἴ'=>'ἴ','ἵ'=>'ἵ','ἶ'=>'ἶ','ἷ'=>'ἷ','Ἰ'=>'Ἰ','Ἱ'=>'Ἱ','Ἲ'=>'Ἲ','Ἳ'=>'Ἳ','Ἴ'=>'Ἴ','Ἵ'=>'Ἵ','Ἶ'=>'Ἶ','Ἷ'=>'Ἷ','ὀ'=>'ὀ','ὁ'=>'ὁ','ὂ'=>'ὂ','ὃ'=>'ὃ','ὄ'=>'ὄ','ὅ'=>'ὅ','Ὀ'=>'Ὀ','Ὁ'=>'Ὁ','Ὂ'=>'Ὂ','Ὃ'=>'Ὃ','Ὄ'=>'Ὄ','Ὅ'=>'Ὅ','ὐ'=>'ὐ','ὑ'=>'ὑ','ὒ'=>'ὒ','ὓ'=>'ὓ','ὔ'=>'ὔ','ὕ'=>'ὕ','ὖ'=>'ὖ','ὗ'=>'ὗ','Ὑ'=>'Ὑ','Ὓ'=>'Ὓ','Ὕ'=>'Ὕ','Ὗ'=>'Ὗ','ὠ'=>'ὠ','ὡ'=>'ὡ','ὢ'=>'ὢ','ὣ'=>'ὣ','ὤ'=>'ὤ','ὥ'=>'ὥ','ὦ'=>'ὦ','ὧ'=>'ὧ','Ὠ'=>'Ὠ','Ὡ'=>'Ὡ','Ὢ'=>'Ὢ','Ὣ'=>'Ὣ','Ὤ'=>'Ὤ','Ὥ'=>'Ὥ','Ὦ'=>'Ὦ','Ὧ'=>'Ὧ','ὰ'=>'ὰ','ά'=>'ά','ὲ'=>'ὲ','έ'=>'έ','ὴ'=>'ὴ','ή'=>'ή','ὶ'=>'ὶ','ί'=>'ί','ὸ'=>'ὸ','ό'=>'ό','ὺ'=>'ὺ','ύ'=>'ύ','ὼ'=>'ὼ','ώ'=>'ώ','ᾀ'=>'ᾀ','ᾁ'=>'ᾁ','ᾂ'=>'ᾂ','ᾃ'=>'ᾃ','ᾄ'=>'ᾄ','ᾅ'=>'ᾅ','ᾆ'=>'ᾆ','ᾇ'=>'ᾇ','ᾈ'=>'ᾈ','ᾉ'=>'ᾉ','ᾊ'=>'ᾊ','ᾋ'=>'ᾋ','ᾌ'=>'ᾌ','ᾍ'=>'ᾍ','ᾎ'=>'ᾎ','ᾏ'=>'ᾏ','ᾐ'=>'ᾐ','ᾑ'=>'ᾑ','ᾒ'=>'ᾒ','ᾓ'=>'ᾓ','ᾔ'=>'ᾔ','ᾕ'=>'ᾕ','ᾖ'=>'ᾖ','ᾗ'=>'ᾗ','ᾘ'=>'ᾘ','ᾙ'=>'ᾙ','ᾚ'=>'ᾚ','ᾛ'=>'ᾛ','ᾜ'=>'ᾜ','ᾝ'=>'ᾝ','ᾞ'=>'ᾞ','ᾟ'=>'ᾟ','ᾠ'=>'ᾠ','ᾡ'=>'ᾡ','ᾢ'=>'ᾢ','ᾣ'=>'ᾣ','ᾤ'=>'ᾤ','ᾥ'=>'ᾥ','ᾦ'=>'ᾦ','ᾧ'=>'ᾧ','ᾨ'=>'ᾨ','ᾩ'=>'ᾩ','ᾪ'=>'ᾪ','ᾫ'=>'ᾫ','ᾬ'=>'ᾬ','ᾭ'=>'ᾭ','ᾮ'=>'ᾮ','ᾯ'=>'ᾯ','ᾰ'=>'ᾰ','ᾱ'=>'ᾱ','ᾲ'=>'ᾲ','ᾳ'=>'ᾳ','ᾴ'=>'ᾴ','ᾶ'=>'ᾶ','ᾷ'=>'ᾷ','Ᾰ'=>'Ᾰ','Ᾱ'=>'Ᾱ','Ὰ'=>'Ὰ','Ά'=>'Ά','ᾼ'=>'ᾼ','᾽'=>' ̓','ι'=>'ι','᾿'=>' ̓','῀'=>' ͂','῁'=>' ̈͂','ῂ'=>'ῂ','ῃ'=>'ῃ','ῄ'=>'ῄ','ῆ'=>'ῆ','ῇ'=>'ῇ','Ὲ'=>'Ὲ','Έ'=>'Έ','Ὴ'=>'Ὴ','Ή'=>'Ή','ῌ'=>'ῌ','῍'=>' ̓̀','῎'=>' ̓́','῏'=>' ̓͂','ῐ'=>'ῐ','ῑ'=>'ῑ','ῒ'=>'ῒ','ΐ'=>'ΐ','ῖ'=>'ῖ','ῗ'=>'ῗ','Ῐ'=>'Ῐ','Ῑ'=>'Ῑ','Ὶ'=>'Ὶ','Ί'=>'Ί','῝'=>' ̔̀','῞'=>' ̔́','῟'=>' ̔͂','ῠ'=>'ῠ','ῡ'=>'ῡ','ῢ'=>'ῢ','ΰ'=>'ΰ','ῤ'=>'ῤ','ῥ'=>'ῥ','ῦ'=>'ῦ','ῧ'=>'ῧ','Ῠ'=>'Ῠ','Ῡ'=>'Ῡ','Ὺ'=>'Ὺ','Ύ'=>'Ύ','Ῥ'=>'Ῥ','῭'=>' ̈̀','΅'=>' ̈́','`'=>'`','ῲ'=>'ῲ','ῳ'=>'ῳ','ῴ'=>'ῴ','ῶ'=>'ῶ','ῷ'=>'ῷ','Ὸ'=>'Ὸ','Ό'=>'Ό','Ὼ'=>'Ὼ','Ώ'=>'Ώ','ῼ'=>'ῼ','´'=>' ́','῾'=>' ̔',' '=>' ',' '=>' ',' '=>' ',' '=>' ',' '=>' ',' '=>' ',' '=>' ',' '=>' ',' '=>' ',' '=>' ',' '=>' ','‑'=>'‐','‗'=>' ̳','․'=>'.','‥'=>'..','…'=>'...',' '=>' ','″'=>'′′','‴'=>'′′′','‶'=>'‵‵','‷'=>'‵‵‵','‼'=>'!!','‾'=>' ̅','⁇'=>'??','⁈'=>'?!','⁉'=>'!?','⁗'=>'′′′′',' '=>' ','⁰'=>'0','ⁱ'=>'i','⁴'=>'4','⁵'=>'5','⁶'=>'6','⁷'=>'7','⁸'=>'8','⁹'=>'9','⁺'=>'+','⁻'=>'−','⁼'=>'=','⁽'=>'(','⁾'=>')','ⁿ'=>'n','₀'=>'0','₁'=>'1','₂'=>'2','₃'=>'3','₄'=>'4','₅'=>'5','₆'=>'6','₇'=>'7','₈'=>'8','₉'=>'9','₊'=>'+','₋'=>'−','₌'=>'=','₍'=>'(','₎'=>')','ₐ'=>'a','ₑ'=>'e','ₒ'=>'o','ₓ'=>'x','ₔ'=>'ə','₨'=>'Rs','℀'=>'a/c','℁'=>'a/s','ℂ'=>'C','℃'=>'°C','℅'=>'c/o','℆'=>'c/u','ℇ'=>'Ɛ','℉'=>'°F','ℊ'=>'g','ℋ'=>'H','ℌ'=>'H','ℍ'=>'H','ℎ'=>'h','ℏ'=>'ħ','ℐ'=>'I','ℑ'=>'I','ℒ'=>'L','ℓ'=>'l','ℕ'=>'N','№'=>'No','ℙ'=>'P','ℚ'=>'Q','ℛ'=>'R','ℜ'=>'R','ℝ'=>'R','℠'=>'SM','℡'=>'TEL','™'=>'TM','ℤ'=>'Z','Ω'=>'Ω','ℨ'=>'Z','K'=>'K','Å'=>'Å','ℬ'=>'B','ℭ'=>'C','ℯ'=>'e','ℰ'=>'E','ℱ'=>'F','ℳ'=>'M','ℴ'=>'o','ℵ'=>'א','ℶ'=>'ב','ℷ'=>'ג','ℸ'=>'ד','ℹ'=>'i','℻'=>'FAX','ℼ'=>'π','ℽ'=>'γ','ℾ'=>'Γ','ℿ'=>'Π','⅀'=>'∑','ⅅ'=>'D','ⅆ'=>'d','ⅇ'=>'e','ⅈ'=>'i','ⅉ'=>'j','⅓'=>'1⁄3','⅔'=>'2⁄3','⅕'=>'1⁄5','⅖'=>'2⁄5','⅗'=>'3⁄5','⅘'=>'4⁄5','⅙'=>'1⁄6','⅚'=>'5⁄6','⅛'=>'1⁄8','⅜'=>'3⁄8','⅝'=>'5⁄8','⅞'=>'7⁄8','⅟'=>'1⁄','Ⅰ'=>'I','Ⅱ'=>'II','Ⅲ'=>'III','Ⅳ'=>'IV','Ⅴ'=>'V','Ⅵ'=>'VI','Ⅶ'=>'VII','Ⅷ'=>'VIII','Ⅸ'=>'IX','Ⅹ'=>'X','Ⅺ'=>'XI','Ⅻ'=>'XII','Ⅼ'=>'L','Ⅽ'=>'C','Ⅾ'=>'D','Ⅿ'=>'M','ⅰ'=>'i','ⅱ'=>'ii','ⅲ'=>'iii','ⅳ'=>'iv','ⅴ'=>'v','ⅵ'=>'vi','ⅶ'=>'vii','ⅷ'=>'viii','ⅸ'=>'ix','ⅹ'=>'x','ⅺ'=>'xi','ⅻ'=>'xii','ⅼ'=>'l','ⅽ'=>'c','ⅾ'=>'d','ⅿ'=>'m','↚'=>'↚','↛'=>'↛','↮'=>'↮','⇍'=>'⇍','⇎'=>'⇎','⇏'=>'⇏','∄'=>'∄','∉'=>'∉','∌'=>'∌','∤'=>'∤','∦'=>'∦','∬'=>'∫∫','∭'=>'∫∫∫','∯'=>'∮∮','∰'=>'∮∮∮','≁'=>'≁','≄'=>'≄','≇'=>'≇','≉'=>'≉','≠'=>'≠','≢'=>'≢','≭'=>'≭','≮'=>'≮','≯'=>'≯','≰'=>'≰','≱'=>'≱','≴'=>'≴','≵'=>'≵','≸'=>'≸','≹'=>'≹','⊀'=>'⊀','⊁'=>'⊁','⊄'=>'⊄','⊅'=>'⊅','⊈'=>'⊈','⊉'=>'⊉','⊬'=>'⊬','⊭'=>'⊭','⊮'=>'⊮','⊯'=>'⊯','⋠'=>'⋠','⋡'=>'⋡','⋢'=>'⋢','⋣'=>'⋣','⋪'=>'⋪','⋫'=>'⋫','⋬'=>'⋬','⋭'=>'⋭','〈'=>'〈','〉'=>'〉','①'=>'1','②'=>'2','③'=>'3','④'=>'4','⑤'=>'5','⑥'=>'6','⑦'=>'7','⑧'=>'8','⑨'=>'9','⑩'=>'10','⑪'=>'11','⑫'=>'12','⑬'=>'13','⑭'=>'14','⑮'=>'15','⑯'=>'16','⑰'=>'17','⑱'=>'18','⑲'=>'19','⑳'=>'20','⑴'=>'(1)','⑵'=>'(2)','⑶'=>'(3)','⑷'=>'(4)','⑸'=>'(5)','⑹'=>'(6)','⑺'=>'(7)','⑻'=>'(8)','⑼'=>'(9)','⑽'=>'(10)','⑾'=>'(11)','⑿'=>'(12)','⒀'=>'(13)','⒁'=>'(14)','⒂'=>'(15)','⒃'=>'(16)','⒄'=>'(17)','⒅'=>'(18)','⒆'=>'(19)','⒇'=>'(20)','⒈'=>'1.','⒉'=>'2.','⒊'=>'3.','⒋'=>'4.','⒌'=>'5.','⒍'=>'6.','⒎'=>'7.','⒏'=>'8.','⒐'=>'9.','⒑'=>'10.','⒒'=>'11.','⒓'=>'12.','⒔'=>'13.','⒕'=>'14.','⒖'=>'15.','⒗'=>'16.','⒘'=>'17.','⒙'=>'18.','⒚'=>'19.','⒛'=>'20.','⒜'=>'(a)','⒝'=>'(b)','⒞'=>'(c)','⒟'=>'(d)','⒠'=>'(e)','⒡'=>'(f)','⒢'=>'(g)','⒣'=>'(h)','⒤'=>'(i)','⒥'=>'(j)','⒦'=>'(k)','⒧'=>'(l)','⒨'=>'(m)','⒩'=>'(n)','⒪'=>'(o)','⒫'=>'(p)','⒬'=>'(q)','⒭'=>'(r)','⒮'=>'(s)','⒯'=>'(t)','⒰'=>'(u)','⒱'=>'(v)','⒲'=>'(w)','⒳'=>'(x)','⒴'=>'(y)','⒵'=>'(z)','Ⓐ'=>'A','Ⓑ'=>'B','Ⓒ'=>'C','Ⓓ'=>'D','Ⓔ'=>'E','Ⓕ'=>'F','Ⓖ'=>'G','Ⓗ'=>'H','Ⓘ'=>'I','Ⓙ'=>'J','Ⓚ'=>'K','Ⓛ'=>'L','Ⓜ'=>'M','Ⓝ'=>'N','Ⓞ'=>'O','Ⓟ'=>'P','Ⓠ'=>'Q','Ⓡ'=>'R','Ⓢ'=>'S','Ⓣ'=>'T','Ⓤ'=>'U','Ⓥ'=>'V','Ⓦ'=>'W','Ⓧ'=>'X','Ⓨ'=>'Y','Ⓩ'=>'Z','ⓐ'=>'a','ⓑ'=>'b','ⓒ'=>'c','ⓓ'=>'d','ⓔ'=>'e','ⓕ'=>'f','ⓖ'=>'g','ⓗ'=>'h','ⓘ'=>'i','ⓙ'=>'j','ⓚ'=>'k','ⓛ'=>'l','ⓜ'=>'m','ⓝ'=>'n','ⓞ'=>'o','ⓟ'=>'p','ⓠ'=>'q','ⓡ'=>'r','ⓢ'=>'s','ⓣ'=>'t','ⓤ'=>'u','ⓥ'=>'v','ⓦ'=>'w','ⓧ'=>'x','ⓨ'=>'y','ⓩ'=>'z','⓪'=>'0','⨌'=>'∫∫∫∫','⩴'=>'::=','⩵'=>'==','⩶'=>'===','⫝̸'=>'⫝̸','ⵯ'=>'ⵡ','⺟'=>'母','⻳'=>'龟','⼀'=>'一','⼁'=>'丨','⼂'=>'丶','⼃'=>'丿','⼄'=>'乙','⼅'=>'亅','⼆'=>'二','⼇'=>'亠','⼈'=>'人','⼉'=>'儿','⼊'=>'入','⼋'=>'八','⼌'=>'冂','⼍'=>'冖','⼎'=>'冫','⼏'=>'几','⼐'=>'凵','⼑'=>'刀','⼒'=>'力','⼓'=>'勹','⼔'=>'匕','⼕'=>'匚','⼖'=>'匸','⼗'=>'十','⼘'=>'卜','⼙'=>'卩','⼚'=>'厂','⼛'=>'厶','⼜'=>'又','⼝'=>'口','⼞'=>'囗','⼟'=>'土','⼠'=>'士','⼡'=>'夂','⼢'=>'夊','⼣'=>'夕','⼤'=>'大','⼥'=>'女','⼦'=>'子','⼧'=>'宀','⼨'=>'寸','⼩'=>'小','⼪'=>'尢','⼫'=>'尸','⼬'=>'屮','⼭'=>'山','⼮'=>'巛','⼯'=>'工','⼰'=>'己','⼱'=>'巾','⼲'=>'干','⼳'=>'幺','⼴'=>'广','⼵'=>'廴','⼶'=>'廾','⼷'=>'弋','⼸'=>'弓','⼹'=>'彐','⼺'=>'彡','⼻'=>'彳','⼼'=>'心','⼽'=>'戈','⼾'=>'戶','⼿'=>'手','⽀'=>'支','⽁'=>'攴','⽂'=>'文','⽃'=>'斗','⽄'=>'斤','⽅'=>'方','⽆'=>'无','⽇'=>'日','⽈'=>'曰','⽉'=>'月','⽊'=>'木','⽋'=>'欠','⽌'=>'止','⽍'=>'歹','⽎'=>'殳','⽏'=>'毋','⽐'=>'比','⽑'=>'毛','⽒'=>'氏','⽓'=>'气','⽔'=>'水','⽕'=>'火','⽖'=>'爪','⽗'=>'父','⽘'=>'爻','⽙'=>'爿','⽚'=>'片','⽛'=>'牙','⽜'=>'牛','⽝'=>'犬','⽞'=>'玄','⽟'=>'玉','⽠'=>'瓜','⽡'=>'瓦','⽢'=>'甘','⽣'=>'生','⽤'=>'用','⽥'=>'田','⽦'=>'疋','⽧'=>'疒','⽨'=>'癶','⽩'=>'白','⽪'=>'皮','⽫'=>'皿','⽬'=>'目','⽭'=>'矛','⽮'=>'矢','⽯'=>'石','⽰'=>'示','⽱'=>'禸','⽲'=>'禾','⽳'=>'穴','⽴'=>'立','⽵'=>'竹','⽶'=>'米','⽷'=>'糸','⽸'=>'缶','⽹'=>'网','⽺'=>'羊','⽻'=>'羽','⽼'=>'老','⽽'=>'而','⽾'=>'耒','⽿'=>'耳','⾀'=>'聿','⾁'=>'肉','⾂'=>'臣','⾃'=>'自','⾄'=>'至','⾅'=>'臼','⾆'=>'舌','⾇'=>'舛','⾈'=>'舟','⾉'=>'艮','⾊'=>'色','⾋'=>'艸','⾌'=>'虍','⾍'=>'虫','⾎'=>'血','⾏'=>'行','⾐'=>'衣','⾑'=>'襾','⾒'=>'見','⾓'=>'角','⾔'=>'言','⾕'=>'谷','⾖'=>'豆','⾗'=>'豕','⾘'=>'豸','⾙'=>'貝','⾚'=>'赤','⾛'=>'走','⾜'=>'足','⾝'=>'身','⾞'=>'車','⾟'=>'辛','⾠'=>'辰','⾡'=>'辵','⾢'=>'邑','⾣'=>'酉','⾤'=>'釆','⾥'=>'里','⾦'=>'金','⾧'=>'長','⾨'=>'門','⾩'=>'阜','⾪'=>'隶','⾫'=>'隹','⾬'=>'雨','⾭'=>'靑','⾮'=>'非','⾯'=>'面','⾰'=>'革','⾱'=>'韋','⾲'=>'韭','⾳'=>'音','⾴'=>'頁','⾵'=>'風','⾶'=>'飛','⾷'=>'食','⾸'=>'首','⾹'=>'香','⾺'=>'馬','⾻'=>'骨','⾼'=>'高','⾽'=>'髟','⾾'=>'鬥','⾿'=>'鬯','⿀'=>'鬲','⿁'=>'鬼','⿂'=>'魚','⿃'=>'鳥','⿄'=>'鹵','⿅'=>'鹿','⿆'=>'麥','⿇'=>'麻','⿈'=>'黃','⿉'=>'黍','⿊'=>'黑','⿋'=>'黹','⿌'=>'黽','⿍'=>'鼎','⿎'=>'鼓','⿏'=>'鼠','⿐'=>'鼻','⿑'=>'齊','⿒'=>'齒','⿓'=>'龍','⿔'=>'龜','⿕'=>'龠',' '=>' ','〶'=>'〒','〸'=>'十','〹'=>'卄','〺'=>'卅','が'=>'が','ぎ'=>'ぎ','ぐ'=>'ぐ','げ'=>'げ','ご'=>'ご','ざ'=>'ざ','じ'=>'じ','ず'=>'ず','ぜ'=>'ぜ','ぞ'=>'ぞ','だ'=>'だ','ぢ'=>'ぢ','づ'=>'づ','で'=>'で','ど'=>'ど','ば'=>'ば','ぱ'=>'ぱ','び'=>'び','ぴ'=>'ぴ','ぶ'=>'ぶ','ぷ'=>'ぷ','べ'=>'べ','ぺ'=>'ぺ','ぼ'=>'ぼ','ぽ'=>'ぽ','ゔ'=>'ゔ','゛'=>' ゙','゜'=>' ゚','ゞ'=>'ゞ','ゟ'=>'より','ガ'=>'ガ','ギ'=>'ギ','グ'=>'グ','ゲ'=>'ゲ','ゴ'=>'ゴ','ザ'=>'ザ','ジ'=>'ジ','ズ'=>'ズ','ゼ'=>'ゼ','ゾ'=>'ゾ','ダ'=>'ダ','ヂ'=>'ヂ','ヅ'=>'ヅ','デ'=>'デ','ド'=>'ド','バ'=>'バ','パ'=>'パ','ビ'=>'ビ','ピ'=>'ピ','ブ'=>'ブ','プ'=>'プ','ベ'=>'ベ','ペ'=>'ペ','ボ'=>'ボ','ポ'=>'ポ','ヴ'=>'ヴ','ヷ'=>'ヷ','ヸ'=>'ヸ','ヹ'=>'ヹ','ヺ'=>'ヺ','ヾ'=>'ヾ','ヿ'=>'コト','ㄱ'=>'ᄀ','ㄲ'=>'ᄁ','ㄳ'=>'ᆪ','ㄴ'=>'ᄂ','ㄵ'=>'ᆬ','ㄶ'=>'ᆭ','ㄷ'=>'ᄃ','ㄸ'=>'ᄄ','ㄹ'=>'ᄅ','ㄺ'=>'ᆰ','ㄻ'=>'ᆱ','ㄼ'=>'ᆲ','ㄽ'=>'ᆳ','ㄾ'=>'ᆴ','ㄿ'=>'ᆵ','ㅀ'=>'ᄚ','ㅁ'=>'ᄆ','ㅂ'=>'ᄇ','ㅃ'=>'ᄈ','ㅄ'=>'ᄡ','ㅅ'=>'ᄉ','ㅆ'=>'ᄊ','ㅇ'=>'ᄋ','ㅈ'=>'ᄌ','ㅉ'=>'ᄍ','ㅊ'=>'ᄎ','ㅋ'=>'ᄏ','ㅌ'=>'ᄐ','ㅍ'=>'ᄑ','ㅎ'=>'ᄒ','ㅏ'=>'ᅡ','ㅐ'=>'ᅢ','ㅑ'=>'ᅣ','ㅒ'=>'ᅤ','ㅓ'=>'ᅥ','ㅔ'=>'ᅦ','ㅕ'=>'ᅧ','ㅖ'=>'ᅨ','ㅗ'=>'ᅩ','ㅘ'=>'ᅪ','ㅙ'=>'ᅫ','ㅚ'=>'ᅬ','ㅛ'=>'ᅭ','ㅜ'=>'ᅮ','ㅝ'=>'ᅯ','ㅞ'=>'ᅰ','ㅟ'=>'ᅱ','ㅠ'=>'ᅲ','ㅡ'=>'ᅳ','ㅢ'=>'ᅴ','ㅣ'=>'ᅵ','ㅤ'=>'ᅠ','ㅥ'=>'ᄔ','ㅦ'=>'ᄕ','ㅧ'=>'ᇇ','ㅨ'=>'ᇈ','ㅩ'=>'ᇌ','ㅪ'=>'ᇎ','ㅫ'=>'ᇓ','ㅬ'=>'ᇗ','ㅭ'=>'ᇙ','ㅮ'=>'ᄜ','ㅯ'=>'ᇝ','ㅰ'=>'ᇟ','ㅱ'=>'ᄝ','ㅲ'=>'ᄞ','ㅳ'=>'ᄠ','ㅴ'=>'ᄢ','ㅵ'=>'ᄣ','ㅶ'=>'ᄧ','ㅷ'=>'ᄩ','ㅸ'=>'ᄫ','ㅹ'=>'ᄬ','ㅺ'=>'ᄭ','ㅻ'=>'ᄮ','ㅼ'=>'ᄯ','ㅽ'=>'ᄲ','ㅾ'=>'ᄶ','ㅿ'=>'ᅀ','ㆀ'=>'ᅇ','ㆁ'=>'ᅌ','ㆂ'=>'ᇱ','ㆃ'=>'ᇲ','ㆄ'=>'ᅗ','ㆅ'=>'ᅘ','ㆆ'=>'ᅙ','ㆇ'=>'ᆄ','ㆈ'=>'ᆅ','ㆉ'=>'ᆈ','ㆊ'=>'ᆑ','ㆋ'=>'ᆒ','ㆌ'=>'ᆔ','ㆍ'=>'ᆞ','ㆎ'=>'ᆡ','㆒'=>'一','㆓'=>'二','㆔'=>'三','㆕'=>'四','㆖'=>'上','㆗'=>'中','㆘'=>'下','㆙'=>'甲','㆚'=>'乙','㆛'=>'丙','㆜'=>'丁','㆝'=>'天','㆞'=>'地','㆟'=>'人','㈀'=>'(ᄀ)','㈁'=>'(ᄂ)','㈂'=>'(ᄃ)','㈃'=>'(ᄅ)','㈄'=>'(ᄆ)','㈅'=>'(ᄇ)','㈆'=>'(ᄉ)','㈇'=>'(ᄋ)','㈈'=>'(ᄌ)','㈉'=>'(ᄎ)','㈊'=>'(ᄏ)','㈋'=>'(ᄐ)','㈌'=>'(ᄑ)','㈍'=>'(ᄒ)','㈎'=>'(가)','㈏'=>'(나)','㈐'=>'(다)','㈑'=>'(라)','㈒'=>'(마)','㈓'=>'(바)','㈔'=>'(사)','㈕'=>'(아)','㈖'=>'(자)','㈗'=>'(차)','㈘'=>'(카)','㈙'=>'(타)','㈚'=>'(파)','㈛'=>'(하)','㈜'=>'(주)','㈝'=>'(오전)','㈞'=>'(오후)','㈠'=>'(一)','㈡'=>'(二)','㈢'=>'(三)','㈣'=>'(四)','㈤'=>'(五)','㈥'=>'(六)','㈦'=>'(七)','㈧'=>'(八)','㈨'=>'(九)','㈩'=>'(十)','㈪'=>'(月)','㈫'=>'(火)','㈬'=>'(水)','㈭'=>'(木)','㈮'=>'(金)','㈯'=>'(土)','㈰'=>'(日)','㈱'=>'(株)','㈲'=>'(有)','㈳'=>'(社)','㈴'=>'(名)','㈵'=>'(特)','㈶'=>'(財)','㈷'=>'(祝)','㈸'=>'(労)','㈹'=>'(代)','㈺'=>'(呼)','㈻'=>'(学)','㈼'=>'(監)','㈽'=>'(企)','㈾'=>'(資)','㈿'=>'(協)','㉀'=>'(祭)','㉁'=>'(休)','㉂'=>'(自)','㉃'=>'(至)','㉐'=>'PTE','㉑'=>'21','㉒'=>'22','㉓'=>'23','㉔'=>'24','㉕'=>'25','㉖'=>'26','㉗'=>'27','㉘'=>'28','㉙'=>'29','㉚'=>'30','㉛'=>'31','㉜'=>'32','㉝'=>'33','㉞'=>'34','㉟'=>'35','㉠'=>'ᄀ','㉡'=>'ᄂ','㉢'=>'ᄃ','㉣'=>'ᄅ','㉤'=>'ᄆ','㉥'=>'ᄇ','㉦'=>'ᄉ','㉧'=>'ᄋ','㉨'=>'ᄌ','㉩'=>'ᄎ','㉪'=>'ᄏ','㉫'=>'ᄐ','㉬'=>'ᄑ','㉭'=>'ᄒ','㉮'=>'가','㉯'=>'나','㉰'=>'다','㉱'=>'라','㉲'=>'마','㉳'=>'바','㉴'=>'사','㉵'=>'아','㉶'=>'자','㉷'=>'차','㉸'=>'카','㉹'=>'타','㉺'=>'파','㉻'=>'하','㉼'=>'참고','㉽'=>'주의','㉾'=>'우','㊀'=>'一','㊁'=>'二','㊂'=>'三','㊃'=>'四','㊄'=>'五','㊅'=>'六','㊆'=>'七','㊇'=>'八','㊈'=>'九','㊉'=>'十','㊊'=>'月','㊋'=>'火','㊌'=>'水','㊍'=>'木','㊎'=>'金','㊏'=>'土','㊐'=>'日','㊑'=>'株','㊒'=>'有','㊓'=>'社','㊔'=>'名','㊕'=>'特','㊖'=>'財','㊗'=>'祝','㊘'=>'労','㊙'=>'秘','㊚'=>'男','㊛'=>'女','㊜'=>'適','㊝'=>'優','㊞'=>'印','㊟'=>'注','㊠'=>'項','㊡'=>'休','㊢'=>'写','㊣'=>'正','㊤'=>'上','㊥'=>'中','㊦'=>'下','㊧'=>'左','㊨'=>'右','㊩'=>'医','㊪'=>'宗','㊫'=>'学','㊬'=>'監','㊭'=>'企','㊮'=>'資','㊯'=>'協','㊰'=>'夜','㊱'=>'36','㊲'=>'37','㊳'=>'38','㊴'=>'39','㊵'=>'40','㊶'=>'41','㊷'=>'42','㊸'=>'43','㊹'=>'44','㊺'=>'45','㊻'=>'46','㊼'=>'47','㊽'=>'48','㊾'=>'49','㊿'=>'50','㋀'=>'1月','㋁'=>'2月','㋂'=>'3月','㋃'=>'4月','㋄'=>'5月','㋅'=>'6月','㋆'=>'7月','㋇'=>'8月','㋈'=>'9月','㋉'=>'10月','㋊'=>'11月','㋋'=>'12月','㋌'=>'Hg','㋍'=>'erg','㋎'=>'eV','㋏'=>'LTD','㋐'=>'ア','㋑'=>'イ','㋒'=>'ウ','㋓'=>'エ','㋔'=>'オ','㋕'=>'カ','㋖'=>'キ','㋗'=>'ク','㋘'=>'ケ','㋙'=>'コ','㋚'=>'サ','㋛'=>'シ','㋜'=>'ス','㋝'=>'セ','㋞'=>'ソ','㋟'=>'タ','㋠'=>'チ','㋡'=>'ツ','㋢'=>'テ','㋣'=>'ト','㋤'=>'ナ','㋥'=>'ニ','㋦'=>'ヌ','㋧'=>'ネ','㋨'=>'ノ','㋩'=>'ハ','㋪'=>'ヒ','㋫'=>'フ','㋬'=>'ヘ','㋭'=>'ホ','㋮'=>'マ','㋯'=>'ミ','㋰'=>'ム','㋱'=>'メ','㋲'=>'モ','㋳'=>'ヤ','㋴'=>'ユ','㋵'=>'ヨ','㋶'=>'ラ','㋷'=>'リ','㋸'=>'ル','㋹'=>'レ','㋺'=>'ロ','㋻'=>'ワ','㋼'=>'ヰ','㋽'=>'ヱ','㋾'=>'ヲ','㌀'=>'アパート','㌁'=>'アルファ','㌂'=>'アンペア','㌃'=>'アール','㌄'=>'イニング','㌅'=>'インチ','㌆'=>'ウォン','㌇'=>'エスクード','㌈'=>'エーカー','㌉'=>'オンス','㌊'=>'オーム','㌋'=>'カイリ','㌌'=>'カラット','㌍'=>'カロリー','㌎'=>'ガロン','㌏'=>'ガンマ','㌐'=>'ギガ','㌑'=>'ギニー','㌒'=>'キュリー','㌓'=>'ギルダー','㌔'=>'キロ','㌕'=>'キログラム','㌖'=>'キロメートル','㌗'=>'キロワット','㌘'=>'グラム','㌙'=>'グラムトン','㌚'=>'クルゼイロ','㌛'=>'クローネ','㌜'=>'ケース','㌝'=>'コルナ','㌞'=>'コーポ','㌟'=>'サイクル','㌠'=>'サンチーム','㌡'=>'シリング','㌢'=>'センチ','㌣'=>'セント','㌤'=>'ダース','㌥'=>'デシ','㌦'=>'ドル','㌧'=>'トン','㌨'=>'ナノ','㌩'=>'ノット','㌪'=>'ハイツ','㌫'=>'パーセント','㌬'=>'パーツ','㌭'=>'バーレル','㌮'=>'ピアストル','㌯'=>'ピクル','㌰'=>'ピコ','㌱'=>'ビル','㌲'=>'ファラッド','㌳'=>'フィート','㌴'=>'ブッシェル','㌵'=>'フラン','㌶'=>'ヘクタール','㌷'=>'ペソ','㌸'=>'ペニヒ','㌹'=>'ヘルツ','㌺'=>'ペンス','㌻'=>'ページ','㌼'=>'ベータ','㌽'=>'ポイント','㌾'=>'ボルト','㌿'=>'ホン','㍀'=>'ポンド','㍁'=>'ホール','㍂'=>'ホーン','㍃'=>'マイクロ','㍄'=>'マイル','㍅'=>'マッハ','㍆'=>'マルク','㍇'=>'マンション','㍈'=>'ミクロン','㍉'=>'ミリ','㍊'=>'ミリバール','㍋'=>'メガ','㍌'=>'メガトン','㍍'=>'メートル','㍎'=>'ヤード','㍏'=>'ヤール','㍐'=>'ユアン','㍑'=>'リットル','㍒'=>'リラ','㍓'=>'ルピー','㍔'=>'ルーブル','㍕'=>'レム','㍖'=>'レントゲン','㍗'=>'ワット','㍘'=>'0点','㍙'=>'1点','㍚'=>'2点','㍛'=>'3点','㍜'=>'4点','㍝'=>'5点','㍞'=>'6点','㍟'=>'7点','㍠'=>'8点','㍡'=>'9点','㍢'=>'10点','㍣'=>'11点','㍤'=>'12点','㍥'=>'13点','㍦'=>'14点','㍧'=>'15点','㍨'=>'16点','㍩'=>'17点','㍪'=>'18点','㍫'=>'19点','㍬'=>'20点','㍭'=>'21点','㍮'=>'22点','㍯'=>'23点','㍰'=>'24点','㍱'=>'hPa','㍲'=>'da','㍳'=>'AU','㍴'=>'bar','㍵'=>'oV','㍶'=>'pc','㍷'=>'dm','㍸'=>'dm2','㍹'=>'dm3','㍺'=>'IU','㍻'=>'平成','㍼'=>'昭和','㍽'=>'大正','㍾'=>'明治','㍿'=>'株式会社','㎀'=>'pA','㎁'=>'nA','㎂'=>'μA','㎃'=>'mA','㎄'=>'kA','㎅'=>'KB','㎆'=>'MB','㎇'=>'GB','㎈'=>'cal','㎉'=>'kcal','㎊'=>'pF','㎋'=>'nF','㎌'=>'μF','㎍'=>'μg','㎎'=>'mg','㎏'=>'kg','㎐'=>'Hz','㎑'=>'kHz','㎒'=>'MHz','㎓'=>'GHz','㎔'=>'THz','㎕'=>'μl','㎖'=>'ml','㎗'=>'dl','㎘'=>'kl','㎙'=>'fm','㎚'=>'nm','㎛'=>'μm','㎜'=>'mm','㎝'=>'cm','㎞'=>'km','㎟'=>'mm2','㎠'=>'cm2','㎡'=>'m2','㎢'=>'km2','㎣'=>'mm3','㎤'=>'cm3','㎥'=>'m3','㎦'=>'km3','㎧'=>'m∕s','㎨'=>'m∕s2','㎩'=>'Pa','㎪'=>'kPa','㎫'=>'MPa','㎬'=>'GPa','㎭'=>'rad','㎮'=>'rad∕s','㎯'=>'rad∕s2','㎰'=>'ps','㎱'=>'ns','㎲'=>'μs','㎳'=>'ms','㎴'=>'pV','㎵'=>'nV','㎶'=>'μV','㎷'=>'mV','㎸'=>'kV','㎹'=>'MV','㎺'=>'pW','㎻'=>'nW','㎼'=>'μW','㎽'=>'mW','㎾'=>'kW','㎿'=>'MW','㏀'=>'kΩ','㏁'=>'MΩ','㏂'=>'a.m.','㏃'=>'Bq','㏄'=>'cc','㏅'=>'cd','㏆'=>'C∕kg','㏇'=>'Co.','㏈'=>'dB','㏉'=>'Gy','㏊'=>'ha','㏋'=>'HP','㏌'=>'in','㏍'=>'KK','㏎'=>'KM','㏏'=>'kt','㏐'=>'lm','㏑'=>'ln','㏒'=>'log','㏓'=>'lx','㏔'=>'mb','㏕'=>'mil','㏖'=>'mol','㏗'=>'PH','㏘'=>'p.m.','㏙'=>'PPM','㏚'=>'PR','㏛'=>'sr','㏜'=>'Sv','㏝'=>'Wb','㏞'=>'V∕m','㏟'=>'A∕m','㏠'=>'1日','㏡'=>'2日','㏢'=>'3日','㏣'=>'4日','㏤'=>'5日','㏥'=>'6日','㏦'=>'7日','㏧'=>'8日','㏨'=>'9日','㏩'=>'10日','㏪'=>'11日','㏫'=>'12日','㏬'=>'13日','㏭'=>'14日','㏮'=>'15日','㏯'=>'16日','㏰'=>'17日','㏱'=>'18日','㏲'=>'19日','㏳'=>'20日','㏴'=>'21日','㏵'=>'22日','㏶'=>'23日','㏷'=>'24日','㏸'=>'25日','㏹'=>'26日','㏺'=>'27日','㏻'=>'28日','㏼'=>'29日','㏽'=>'30日','㏾'=>'31日','㏿'=>'gal','豈'=>'豈','更'=>'更','車'=>'車','賈'=>'賈','滑'=>'滑','串'=>'串','句'=>'句','龜'=>'龜','龜'=>'龜','契'=>'契','金'=>'金','喇'=>'喇','奈'=>'奈','懶'=>'懶','癩'=>'癩','羅'=>'羅','蘿'=>'蘿','螺'=>'螺','裸'=>'裸','邏'=>'邏','樂'=>'樂','洛'=>'洛','烙'=>'烙','珞'=>'珞','落'=>'落','酪'=>'酪','駱'=>'駱','亂'=>'亂','卵'=>'卵','欄'=>'欄','爛'=>'爛','蘭'=>'蘭','鸞'=>'鸞','嵐'=>'嵐','濫'=>'濫','藍'=>'藍','襤'=>'襤','拉'=>'拉','臘'=>'臘','蠟'=>'蠟','廊'=>'廊','朗'=>'朗','浪'=>'浪','狼'=>'狼','郎'=>'郎','來'=>'來','冷'=>'冷','勞'=>'勞','擄'=>'擄','櫓'=>'櫓','爐'=>'爐','盧'=>'盧','老'=>'老','蘆'=>'蘆','虜'=>'虜','路'=>'路','露'=>'露','魯'=>'魯','鷺'=>'鷺','碌'=>'碌','祿'=>'祿','綠'=>'綠','菉'=>'菉','錄'=>'錄','鹿'=>'鹿','論'=>'論','壟'=>'壟','弄'=>'弄','籠'=>'籠','聾'=>'聾','牢'=>'牢','磊'=>'磊','賂'=>'賂','雷'=>'雷','壘'=>'壘','屢'=>'屢','樓'=>'樓','淚'=>'淚','漏'=>'漏','累'=>'累','縷'=>'縷','陋'=>'陋','勒'=>'勒','肋'=>'肋','凜'=>'凜','凌'=>'凌','稜'=>'稜','綾'=>'綾','菱'=>'菱','陵'=>'陵','讀'=>'讀','拏'=>'拏','樂'=>'樂','諾'=>'諾','丹'=>'丹','寧'=>'寧','怒'=>'怒','率'=>'率','異'=>'異','北'=>'北','磻'=>'磻','便'=>'便','復'=>'復','不'=>'不','泌'=>'泌','數'=>'數','索'=>'索','參'=>'參','塞'=>'塞','省'=>'省','葉'=>'葉','說'=>'說','殺'=>'殺','辰'=>'辰','沈'=>'沈','拾'=>'拾','若'=>'若','掠'=>'掠','略'=>'略','亮'=>'亮','兩'=>'兩','凉'=>'凉','梁'=>'梁','糧'=>'糧','良'=>'良','諒'=>'諒','量'=>'量','勵'=>'勵','呂'=>'呂','女'=>'女','廬'=>'廬','旅'=>'旅','濾'=>'濾','礪'=>'礪','閭'=>'閭','驪'=>'驪','麗'=>'麗','黎'=>'黎','力'=>'力','曆'=>'曆','歷'=>'歷','轢'=>'轢','年'=>'年','憐'=>'憐','戀'=>'戀','撚'=>'撚','漣'=>'漣','煉'=>'煉','璉'=>'璉','秊'=>'秊','練'=>'練','聯'=>'聯','輦'=>'輦','蓮'=>'蓮','連'=>'連','鍊'=>'鍊','列'=>'列','劣'=>'劣','咽'=>'咽','烈'=>'烈','裂'=>'裂','說'=>'說','廉'=>'廉','念'=>'念','捻'=>'捻','殮'=>'殮','簾'=>'簾','獵'=>'獵','令'=>'令','囹'=>'囹','寧'=>'寧','嶺'=>'嶺','怜'=>'怜','玲'=>'玲','瑩'=>'瑩','羚'=>'羚','聆'=>'聆','鈴'=>'鈴','零'=>'零','靈'=>'靈','領'=>'領','例'=>'例','禮'=>'禮','醴'=>'醴','隸'=>'隸','惡'=>'惡','了'=>'了','僚'=>'僚','寮'=>'寮','尿'=>'尿','料'=>'料','樂'=>'樂','燎'=>'燎','療'=>'療','蓼'=>'蓼','遼'=>'遼','龍'=>'龍','暈'=>'暈','阮'=>'阮','劉'=>'劉','杻'=>'杻','柳'=>'柳','流'=>'流','溜'=>'溜','琉'=>'琉','留'=>'留','硫'=>'硫','紐'=>'紐','類'=>'類','六'=>'六','戮'=>'戮','陸'=>'陸','倫'=>'倫','崙'=>'崙','淪'=>'淪','輪'=>'輪','律'=>'律','慄'=>'慄','栗'=>'栗','率'=>'率','隆'=>'隆','利'=>'利','吏'=>'吏','履'=>'履','易'=>'易','李'=>'李','梨'=>'梨','泥'=>'泥','理'=>'理','痢'=>'痢','罹'=>'罹','裏'=>'裏','裡'=>'裡','里'=>'里','離'=>'離','匿'=>'匿','溺'=>'溺','吝'=>'吝','燐'=>'燐','璘'=>'璘','藺'=>'藺','隣'=>'隣','鱗'=>'鱗','麟'=>'麟','林'=>'林','淋'=>'淋','臨'=>'臨','立'=>'立','笠'=>'笠','粒'=>'粒','狀'=>'狀','炙'=>'炙','識'=>'識','什'=>'什','茶'=>'茶','刺'=>'刺','切'=>'切','度'=>'度','拓'=>'拓','糖'=>'糖','宅'=>'宅','洞'=>'洞','暴'=>'暴','輻'=>'輻','行'=>'行','降'=>'降','見'=>'見','廓'=>'廓','兀'=>'兀','嗀'=>'嗀','塚'=>'塚','晴'=>'晴','凞'=>'凞','猪'=>'猪','益'=>'益','礼'=>'礼','神'=>'神','祥'=>'祥','福'=>'福','靖'=>'靖','精'=>'精','羽'=>'羽','蘒'=>'蘒','諸'=>'諸','逸'=>'逸','都'=>'都','飯'=>'飯','飼'=>'飼','館'=>'館','鶴'=>'鶴','侮'=>'侮','僧'=>'僧','免'=>'免','勉'=>'勉','勤'=>'勤','卑'=>'卑','喝'=>'喝','嘆'=>'嘆','器'=>'器','塀'=>'塀','墨'=>'墨','層'=>'層','屮'=>'屮','悔'=>'悔','慨'=>'慨','憎'=>'憎','懲'=>'懲','敏'=>'敏','既'=>'既','暑'=>'暑','梅'=>'梅','海'=>'海','渚'=>'渚','漢'=>'漢','煮'=>'煮','爫'=>'爫','琢'=>'琢','碑'=>'碑','社'=>'社','祉'=>'祉','祈'=>'祈','祐'=>'祐','祖'=>'祖','祝'=>'祝','禍'=>'禍','禎'=>'禎','穀'=>'穀','突'=>'突','節'=>'節','練'=>'練','縉'=>'縉','繁'=>'繁','署'=>'署','者'=>'者','臭'=>'臭','艹'=>'艹','艹'=>'艹','著'=>'著','褐'=>'褐','視'=>'視','謁'=>'謁','謹'=>'謹','賓'=>'賓','贈'=>'贈','辶'=>'辶','逸'=>'逸','難'=>'難','響'=>'響','頻'=>'頻','並'=>'並','况'=>'况','全'=>'全','侀'=>'侀','充'=>'充','冀'=>'冀','勇'=>'勇','勺'=>'勺','喝'=>'喝','啕'=>'啕','喙'=>'喙','嗢'=>'嗢','塚'=>'塚','墳'=>'墳','奄'=>'奄','奔'=>'奔','婢'=>'婢','嬨'=>'嬨','廒'=>'廒','廙'=>'廙','彩'=>'彩','徭'=>'徭','惘'=>'惘','慎'=>'慎','愈'=>'愈','憎'=>'憎','慠'=>'慠','懲'=>'懲','戴'=>'戴','揄'=>'揄','搜'=>'搜','摒'=>'摒','敖'=>'敖','晴'=>'晴','朗'=>'朗','望'=>'望','杖'=>'杖','歹'=>'歹','殺'=>'殺','流'=>'流','滛'=>'滛','滋'=>'滋','漢'=>'漢','瀞'=>'瀞','煮'=>'煮','瞧'=>'瞧','爵'=>'爵','犯'=>'犯','猪'=>'猪','瑱'=>'瑱','甆'=>'甆','画'=>'画','瘝'=>'瘝','瘟'=>'瘟','益'=>'益','盛'=>'盛','直'=>'直','睊'=>'睊','着'=>'着','磌'=>'磌','窱'=>'窱','節'=>'節','类'=>'类','絛'=>'絛','練'=>'練','缾'=>'缾','者'=>'者','荒'=>'荒','華'=>'華','蝹'=>'蝹','襁'=>'襁','覆'=>'覆','視'=>'視','調'=>'調','諸'=>'諸','請'=>'請','謁'=>'謁','諾'=>'諾','諭'=>'諭','謹'=>'謹','變'=>'變','贈'=>'贈','輸'=>'輸','遲'=>'遲','醙'=>'醙','鉶'=>'鉶','陼'=>'陼','難'=>'難','靖'=>'靖','韛'=>'韛','響'=>'響','頋'=>'頋','頻'=>'頻','鬒'=>'鬒','龜'=>'龜','𢡊'=>'𢡊','𢡄'=>'𢡄','𣏕'=>'𣏕','㮝'=>'㮝','䀘'=>'䀘','䀹'=>'䀹','𥉉'=>'𥉉','𥳐'=>'𥳐','𧻓'=>'𧻓','齃'=>'齃','龎'=>'龎','ff'=>'ff','fi'=>'fi','fl'=>'fl','ffi'=>'ffi','ffl'=>'ffl','ſt'=>'st','st'=>'st','ﬓ'=>'մն','ﬔ'=>'մե','ﬕ'=>'մի','ﬖ'=>'վն','ﬗ'=>'մխ','יִ'=>'יִ','ײַ'=>'ײַ','ﬠ'=>'ע','ﬡ'=>'א','ﬢ'=>'ד','ﬣ'=>'ה','ﬤ'=>'כ','ﬥ'=>'ל','ﬦ'=>'ם','ﬧ'=>'ר','ﬨ'=>'ת','﬩'=>'+','שׁ'=>'שׁ','שׂ'=>'שׂ','שּׁ'=>'שּׁ','שּׂ'=>'שּׂ','אַ'=>'אַ','אָ'=>'אָ','אּ'=>'אּ','בּ'=>'בּ','גּ'=>'גּ','דּ'=>'דּ','הּ'=>'הּ','וּ'=>'וּ','זּ'=>'זּ','טּ'=>'טּ','יּ'=>'יּ','ךּ'=>'ךּ','כּ'=>'כּ','לּ'=>'לּ','מּ'=>'מּ','נּ'=>'נּ','סּ'=>'סּ','ףּ'=>'ףּ','פּ'=>'פּ','צּ'=>'צּ','קּ'=>'קּ','רּ'=>'רּ','שּ'=>'שּ','תּ'=>'תּ','וֹ'=>'וֹ','בֿ'=>'בֿ','כֿ'=>'כֿ','פֿ'=>'פֿ','ﭏ'=>'אל','ﭐ'=>'ٱ','ﭑ'=>'ٱ','ﭒ'=>'ٻ','ﭓ'=>'ٻ','ﭔ'=>'ٻ','ﭕ'=>'ٻ','ﭖ'=>'پ','ﭗ'=>'پ','ﭘ'=>'پ','ﭙ'=>'پ','ﭚ'=>'ڀ','ﭛ'=>'ڀ','ﭜ'=>'ڀ','ﭝ'=>'ڀ','ﭞ'=>'ٺ','ﭟ'=>'ٺ','ﭠ'=>'ٺ','ﭡ'=>'ٺ','ﭢ'=>'ٿ','ﭣ'=>'ٿ','ﭤ'=>'ٿ','ﭥ'=>'ٿ','ﭦ'=>'ٹ','ﭧ'=>'ٹ','ﭨ'=>'ٹ','ﭩ'=>'ٹ','ﭪ'=>'ڤ','ﭫ'=>'ڤ','ﭬ'=>'ڤ','ﭭ'=>'ڤ','ﭮ'=>'ڦ','ﭯ'=>'ڦ','ﭰ'=>'ڦ','ﭱ'=>'ڦ','ﭲ'=>'ڄ','ﭳ'=>'ڄ','ﭴ'=>'ڄ','ﭵ'=>'ڄ','ﭶ'=>'ڃ','ﭷ'=>'ڃ','ﭸ'=>'ڃ','ﭹ'=>'ڃ','ﭺ'=>'چ','ﭻ'=>'چ','ﭼ'=>'چ','ﭽ'=>'چ','ﭾ'=>'ڇ','ﭿ'=>'ڇ','ﮀ'=>'ڇ','ﮁ'=>'ڇ','ﮂ'=>'ڍ','ﮃ'=>'ڍ','ﮄ'=>'ڌ','ﮅ'=>'ڌ','ﮆ'=>'ڎ','ﮇ'=>'ڎ','ﮈ'=>'ڈ','ﮉ'=>'ڈ','ﮊ'=>'ژ','ﮋ'=>'ژ','ﮌ'=>'ڑ','ﮍ'=>'ڑ','ﮎ'=>'ک','ﮏ'=>'ک','ﮐ'=>'ک','ﮑ'=>'ک','ﮒ'=>'گ','ﮓ'=>'گ','ﮔ'=>'گ','ﮕ'=>'گ','ﮖ'=>'ڳ','ﮗ'=>'ڳ','ﮘ'=>'ڳ','ﮙ'=>'ڳ','ﮚ'=>'ڱ','ﮛ'=>'ڱ','ﮜ'=>'ڱ','ﮝ'=>'ڱ','ﮞ'=>'ں','ﮟ'=>'ں','ﮠ'=>'ڻ','ﮡ'=>'ڻ','ﮢ'=>'ڻ','ﮣ'=>'ڻ','ﮤ'=>'ۀ','ﮥ'=>'ۀ','ﮦ'=>'ہ','ﮧ'=>'ہ','ﮨ'=>'ہ','ﮩ'=>'ہ','ﮪ'=>'ھ','ﮫ'=>'ھ','ﮬ'=>'ھ','ﮭ'=>'ھ','ﮮ'=>'ے','ﮯ'=>'ے','ﮰ'=>'ۓ','ﮱ'=>'ۓ','ﯓ'=>'ڭ','ﯔ'=>'ڭ','ﯕ'=>'ڭ','ﯖ'=>'ڭ','ﯗ'=>'ۇ','ﯘ'=>'ۇ','ﯙ'=>'ۆ','ﯚ'=>'ۆ','ﯛ'=>'ۈ','ﯜ'=>'ۈ','ﯝ'=>'ۇٴ','ﯞ'=>'ۋ','ﯟ'=>'ۋ','ﯠ'=>'ۅ','ﯡ'=>'ۅ','ﯢ'=>'ۉ','ﯣ'=>'ۉ','ﯤ'=>'ې','ﯥ'=>'ې','ﯦ'=>'ې','ﯧ'=>'ې','ﯨ'=>'ى','ﯩ'=>'ى','ﯪ'=>'ئا','ﯫ'=>'ئا','ﯬ'=>'ئە','ﯭ'=>'ئە','ﯮ'=>'ئو','ﯯ'=>'ئو','ﯰ'=>'ئۇ','ﯱ'=>'ئۇ','ﯲ'=>'ئۆ','ﯳ'=>'ئۆ','ﯴ'=>'ئۈ','ﯵ'=>'ئۈ','ﯶ'=>'ئې','ﯷ'=>'ئې','ﯸ'=>'ئې','ﯹ'=>'ئى','ﯺ'=>'ئى','ﯻ'=>'ئى','ﯼ'=>'ی','ﯽ'=>'ی','ﯾ'=>'ی','ﯿ'=>'ی','ﰀ'=>'ئج','ﰁ'=>'ئح','ﰂ'=>'ئم','ﰃ'=>'ئى','ﰄ'=>'ئي','ﰅ'=>'بج','ﰆ'=>'بح','ﰇ'=>'بخ','ﰈ'=>'بم','ﰉ'=>'بى','ﰊ'=>'بي','ﰋ'=>'تج','ﰌ'=>'تح','ﰍ'=>'تخ','ﰎ'=>'تم','ﰏ'=>'تى','ﰐ'=>'تي','ﰑ'=>'ثج','ﰒ'=>'ثم','ﰓ'=>'ثى','ﰔ'=>'ثي','ﰕ'=>'جح','ﰖ'=>'جم','ﰗ'=>'حج','ﰘ'=>'حم','ﰙ'=>'خج','ﰚ'=>'خح','ﰛ'=>'خم','ﰜ'=>'سج','ﰝ'=>'سح','ﰞ'=>'سخ','ﰟ'=>'سم','ﰠ'=>'صح','ﰡ'=>'صم','ﰢ'=>'ضج','ﰣ'=>'ضح','ﰤ'=>'ضخ','ﰥ'=>'ضم','ﰦ'=>'طح','ﰧ'=>'طم','ﰨ'=>'ظم','ﰩ'=>'عج','ﰪ'=>'عم','ﰫ'=>'غج','ﰬ'=>'غم','ﰭ'=>'فج','ﰮ'=>'فح','ﰯ'=>'فخ','ﰰ'=>'فم','ﰱ'=>'فى','ﰲ'=>'في','ﰳ'=>'قح','ﰴ'=>'قم','ﰵ'=>'قى','ﰶ'=>'قي','ﰷ'=>'كا','ﰸ'=>'كج','ﰹ'=>'كح','ﰺ'=>'كخ','ﰻ'=>'كل','ﰼ'=>'كم','ﰽ'=>'كى','ﰾ'=>'كي','ﰿ'=>'لج','ﱀ'=>'لح','ﱁ'=>'لخ','ﱂ'=>'لم','ﱃ'=>'لى','ﱄ'=>'لي','ﱅ'=>'مج','ﱆ'=>'مح','ﱇ'=>'مخ','ﱈ'=>'مم','ﱉ'=>'مى','ﱊ'=>'مي','ﱋ'=>'نج','ﱌ'=>'نح','ﱍ'=>'نخ','ﱎ'=>'نم','ﱏ'=>'نى','ﱐ'=>'ني','ﱑ'=>'هج','ﱒ'=>'هم','ﱓ'=>'هى','ﱔ'=>'هي','ﱕ'=>'يج','ﱖ'=>'يح','ﱗ'=>'يخ','ﱘ'=>'يم','ﱙ'=>'يى','ﱚ'=>'يي','ﱛ'=>'ذٰ','ﱜ'=>'رٰ','ﱝ'=>'ىٰ','ﱞ'=>' ٌّ','ﱟ'=>' ٍّ','ﱠ'=>' َّ','ﱡ'=>' ُّ','ﱢ'=>' ِّ','ﱣ'=>' ّٰ','ﱤ'=>'ئر','ﱥ'=>'ئز','ﱦ'=>'ئم','ﱧ'=>'ئن','ﱨ'=>'ئى','ﱩ'=>'ئي','ﱪ'=>'بر','ﱫ'=>'بز','ﱬ'=>'بم','ﱭ'=>'بن','ﱮ'=>'بى','ﱯ'=>'بي','ﱰ'=>'تر','ﱱ'=>'تز','ﱲ'=>'تم','ﱳ'=>'تن','ﱴ'=>'تى','ﱵ'=>'تي','ﱶ'=>'ثر','ﱷ'=>'ثز','ﱸ'=>'ثم','ﱹ'=>'ثن','ﱺ'=>'ثى','ﱻ'=>'ثي','ﱼ'=>'فى','ﱽ'=>'في','ﱾ'=>'قى','ﱿ'=>'قي','ﲀ'=>'كا','ﲁ'=>'كل','ﲂ'=>'كم','ﲃ'=>'كى','ﲄ'=>'كي','ﲅ'=>'لم','ﲆ'=>'لى','ﲇ'=>'لي','ﲈ'=>'ما','ﲉ'=>'مم','ﲊ'=>'نر','ﲋ'=>'نز','ﲌ'=>'نم','ﲍ'=>'نن','ﲎ'=>'نى','ﲏ'=>'ني','ﲐ'=>'ىٰ','ﲑ'=>'ير','ﲒ'=>'يز','ﲓ'=>'يم','ﲔ'=>'ين','ﲕ'=>'يى','ﲖ'=>'يي','ﲗ'=>'ئج','ﲘ'=>'ئح','ﲙ'=>'ئخ','ﲚ'=>'ئم','ﲛ'=>'ئه','ﲜ'=>'بج','ﲝ'=>'بح','ﲞ'=>'بخ','ﲟ'=>'بم','ﲠ'=>'به','ﲡ'=>'تج','ﲢ'=>'تح','ﲣ'=>'تخ','ﲤ'=>'تم','ﲥ'=>'ته','ﲦ'=>'ثم','ﲧ'=>'جح','ﲨ'=>'جم','ﲩ'=>'حج','ﲪ'=>'حم','ﲫ'=>'خج','ﲬ'=>'خم','ﲭ'=>'سج','ﲮ'=>'سح','ﲯ'=>'سخ','ﲰ'=>'سم','ﲱ'=>'صح','ﲲ'=>'صخ','ﲳ'=>'صم','ﲴ'=>'ضج','ﲵ'=>'ضح','ﲶ'=>'ضخ','ﲷ'=>'ضم','ﲸ'=>'طح','ﲹ'=>'ظم','ﲺ'=>'عج','ﲻ'=>'عم','ﲼ'=>'غج','ﲽ'=>'غم','ﲾ'=>'فج','ﲿ'=>'فح','ﳀ'=>'فخ','ﳁ'=>'فم','ﳂ'=>'قح','ﳃ'=>'قم','ﳄ'=>'كج','ﳅ'=>'كح','ﳆ'=>'كخ','ﳇ'=>'كل','ﳈ'=>'كم','ﳉ'=>'لج','ﳊ'=>'لح','ﳋ'=>'لخ','ﳌ'=>'لم','ﳍ'=>'له','ﳎ'=>'مج','ﳏ'=>'مح','ﳐ'=>'مخ','ﳑ'=>'مم','ﳒ'=>'نج','ﳓ'=>'نح','ﳔ'=>'نخ','ﳕ'=>'نم','ﳖ'=>'نه','ﳗ'=>'هج','ﳘ'=>'هم','ﳙ'=>'هٰ','ﳚ'=>'يج','ﳛ'=>'يح','ﳜ'=>'يخ','ﳝ'=>'يم','ﳞ'=>'يه','ﳟ'=>'ئم','ﳠ'=>'ئه','ﳡ'=>'بم','ﳢ'=>'به','ﳣ'=>'تم','ﳤ'=>'ته','ﳥ'=>'ثم','ﳦ'=>'ثه','ﳧ'=>'سم','ﳨ'=>'سه','ﳩ'=>'شم','ﳪ'=>'شه','ﳫ'=>'كل','ﳬ'=>'كم','ﳭ'=>'لم','ﳮ'=>'نم','ﳯ'=>'نه','ﳰ'=>'يم','ﳱ'=>'يه','ﳲ'=>'ـَّ','ﳳ'=>'ـُّ','ﳴ'=>'ـِّ','ﳵ'=>'طى','ﳶ'=>'طي','ﳷ'=>'عى','ﳸ'=>'عي','ﳹ'=>'غى','ﳺ'=>'غي','ﳻ'=>'سى','ﳼ'=>'سي','ﳽ'=>'شى','ﳾ'=>'شي','ﳿ'=>'حى','ﴀ'=>'حي','ﴁ'=>'جى','ﴂ'=>'جي','ﴃ'=>'خى','ﴄ'=>'خي','ﴅ'=>'صى','ﴆ'=>'صي','ﴇ'=>'ضى','ﴈ'=>'ضي','ﴉ'=>'شج','ﴊ'=>'شح','ﴋ'=>'شخ','ﴌ'=>'شم','ﴍ'=>'شر','ﴎ'=>'سر','ﴏ'=>'صر','ﴐ'=>'ضر','ﴑ'=>'طى','ﴒ'=>'طي','ﴓ'=>'عى','ﴔ'=>'عي','ﴕ'=>'غى','ﴖ'=>'غي','ﴗ'=>'سى','ﴘ'=>'سي','ﴙ'=>'شى','ﴚ'=>'شي','ﴛ'=>'حى','ﴜ'=>'حي','ﴝ'=>'جى','ﴞ'=>'جي','ﴟ'=>'خى','ﴠ'=>'خي','ﴡ'=>'صى','ﴢ'=>'صي','ﴣ'=>'ضى','ﴤ'=>'ضي','ﴥ'=>'شج','ﴦ'=>'شح','ﴧ'=>'شخ','ﴨ'=>'شم','ﴩ'=>'شر','ﴪ'=>'سر','ﴫ'=>'صر','ﴬ'=>'ضر','ﴭ'=>'شج','ﴮ'=>'شح','ﴯ'=>'شخ','ﴰ'=>'شم','ﴱ'=>'سه','ﴲ'=>'شه','ﴳ'=>'طم','ﴴ'=>'سج','ﴵ'=>'سح','ﴶ'=>'سخ','ﴷ'=>'شج','ﴸ'=>'شح','ﴹ'=>'شخ','ﴺ'=>'طم','ﴻ'=>'ظم','ﴼ'=>'اً','ﴽ'=>'اً','ﵐ'=>'تجم','ﵑ'=>'تحج','ﵒ'=>'تحج','ﵓ'=>'تحم','ﵔ'=>'تخم','ﵕ'=>'تمج','ﵖ'=>'تمح','ﵗ'=>'تمخ','ﵘ'=>'جمح','ﵙ'=>'جمح','ﵚ'=>'حمي','ﵛ'=>'حمى','ﵜ'=>'سحج','ﵝ'=>'سجح','ﵞ'=>'سجى','ﵟ'=>'سمح','ﵠ'=>'سمح','ﵡ'=>'سمج','ﵢ'=>'سمم','ﵣ'=>'سمم','ﵤ'=>'صحح','ﵥ'=>'صحح','ﵦ'=>'صمم','ﵧ'=>'شحم','ﵨ'=>'شحم','ﵩ'=>'شجي','ﵪ'=>'شمخ','ﵫ'=>'شمخ','ﵬ'=>'شمم','ﵭ'=>'شمم','ﵮ'=>'ضحى','ﵯ'=>'ضخم','ﵰ'=>'ضخم','ﵱ'=>'طمح','ﵲ'=>'طمح','ﵳ'=>'طمم','ﵴ'=>'طمي','ﵵ'=>'عجم','ﵶ'=>'عمم','ﵷ'=>'عمم','ﵸ'=>'عمى','ﵹ'=>'غمم','ﵺ'=>'غمي','ﵻ'=>'غمى','ﵼ'=>'فخم','ﵽ'=>'فخم','ﵾ'=>'قمح','ﵿ'=>'قمم','ﶀ'=>'لحم','ﶁ'=>'لحي','ﶂ'=>'لحى','ﶃ'=>'لجج','ﶄ'=>'لجج','ﶅ'=>'لخم','ﶆ'=>'لخم','ﶇ'=>'لمح','ﶈ'=>'لمح','ﶉ'=>'محج','ﶊ'=>'محم','ﶋ'=>'محي','ﶌ'=>'مجح','ﶍ'=>'مجم','ﶎ'=>'مخج','ﶏ'=>'مخم','ﶒ'=>'مجخ','ﶓ'=>'همج','ﶔ'=>'همم','ﶕ'=>'نحم','ﶖ'=>'نحى','ﶗ'=>'نجم','ﶘ'=>'نجم','ﶙ'=>'نجى','ﶚ'=>'نمي','ﶛ'=>'نمى','ﶜ'=>'يمم','ﶝ'=>'يمم','ﶞ'=>'بخي','ﶟ'=>'تجي','ﶠ'=>'تجى','ﶡ'=>'تخي','ﶢ'=>'تخى','ﶣ'=>'تمي','ﶤ'=>'تمى','ﶥ'=>'جمي','ﶦ'=>'جحى','ﶧ'=>'جمى','ﶨ'=>'سخى','ﶩ'=>'صحي','ﶪ'=>'شحي','ﶫ'=>'ضحي','ﶬ'=>'لجي','ﶭ'=>'لمي','ﶮ'=>'يحي','ﶯ'=>'يجي','ﶰ'=>'يمي','ﶱ'=>'ممي','ﶲ'=>'قمي','ﶳ'=>'نحي','ﶴ'=>'قمح','ﶵ'=>'لحم','ﶶ'=>'عمي','ﶷ'=>'كمي','ﶸ'=>'نجح','ﶹ'=>'مخي','ﶺ'=>'لجم','ﶻ'=>'كمم','ﶼ'=>'لجم','ﶽ'=>'نجح','ﶾ'=>'جحي','ﶿ'=>'حجي','ﷀ'=>'مجي','ﷁ'=>'فمي','ﷂ'=>'بحي','ﷃ'=>'كمم','ﷄ'=>'عجم','ﷅ'=>'صمم','ﷆ'=>'سخي','ﷇ'=>'نجي','ﷰ'=>'صلے','ﷱ'=>'قلے','ﷲ'=>'الله','ﷳ'=>'اكبر','ﷴ'=>'محمد','ﷵ'=>'صلعم','ﷶ'=>'رسول','ﷷ'=>'عليه','ﷸ'=>'وسلم','ﷹ'=>'صلى','ﷺ'=>'صلى الله عليه وسلم','ﷻ'=>'جل جلاله','﷼'=>'ریال','︐'=>',','︑'=>'、','︒'=>'。','︓'=>':','︔'=>';','︕'=>'!','︖'=>'?','︗'=>'〖','︘'=>'〗','︙'=>'...','︰'=>'..','︱'=>'—','︲'=>'–','︳'=>'_','︴'=>'_','︵'=>'(','︶'=>')','︷'=>'{','︸'=>'}','︹'=>'〔','︺'=>'〕','︻'=>'【','︼'=>'】','︽'=>'《','︾'=>'》','︿'=>'〈','﹀'=>'〉','﹁'=>'「','﹂'=>'」','﹃'=>'『','﹄'=>'』','﹇'=>'[','﹈'=>']','﹉'=>' ̅','﹊'=>' ̅','﹋'=>' ̅','﹌'=>' ̅','﹍'=>'_','﹎'=>'_','﹏'=>'_','﹐'=>',','﹑'=>'、','﹒'=>'.','﹔'=>';','﹕'=>':','﹖'=>'?','﹗'=>'!','﹘'=>'—','﹙'=>'(','﹚'=>')','﹛'=>'{','﹜'=>'}','﹝'=>'〔','﹞'=>'〕','﹟'=>'#','﹠'=>'&','﹡'=>'*','﹢'=>'+','﹣'=>'-','﹤'=>'<','﹥'=>'>','﹦'=>'=','﹨'=>'\\','﹩'=>'$','﹪'=>'%','﹫'=>'@','ﹰ'=>' ً','ﹱ'=>'ـً','ﹲ'=>' ٌ','ﹴ'=>' ٍ','ﹶ'=>' َ','ﹷ'=>'ـَ','ﹸ'=>' ُ','ﹹ'=>'ـُ','ﹺ'=>' ِ','ﹻ'=>'ـِ','ﹼ'=>' ّ','ﹽ'=>'ـّ','ﹾ'=>' ْ','ﹿ'=>'ـْ','ﺀ'=>'ء','ﺁ'=>'آ','ﺂ'=>'آ','ﺃ'=>'أ','ﺄ'=>'أ','ﺅ'=>'ؤ','ﺆ'=>'ؤ','ﺇ'=>'إ','ﺈ'=>'إ','ﺉ'=>'ئ','ﺊ'=>'ئ','ﺋ'=>'ئ','ﺌ'=>'ئ','ﺍ'=>'ا','ﺎ'=>'ا','ﺏ'=>'ب','ﺐ'=>'ب','ﺑ'=>'ب','ﺒ'=>'ب','ﺓ'=>'ة','ﺔ'=>'ة','ﺕ'=>'ت','ﺖ'=>'ت','ﺗ'=>'ت','ﺘ'=>'ت','ﺙ'=>'ث','ﺚ'=>'ث','ﺛ'=>'ث','ﺜ'=>'ث','ﺝ'=>'ج','ﺞ'=>'ج','ﺟ'=>'ج','ﺠ'=>'ج','ﺡ'=>'ح','ﺢ'=>'ح','ﺣ'=>'ح','ﺤ'=>'ح','ﺥ'=>'خ','ﺦ'=>'خ','ﺧ'=>'خ','ﺨ'=>'خ','ﺩ'=>'د','ﺪ'=>'د','ﺫ'=>'ذ','ﺬ'=>'ذ','ﺭ'=>'ر','ﺮ'=>'ر','ﺯ'=>'ز','ﺰ'=>'ز','ﺱ'=>'س','ﺲ'=>'س','ﺳ'=>'س','ﺴ'=>'س','ﺵ'=>'ش','ﺶ'=>'ش','ﺷ'=>'ش','ﺸ'=>'ش','ﺹ'=>'ص','ﺺ'=>'ص','ﺻ'=>'ص','ﺼ'=>'ص','ﺽ'=>'ض','ﺾ'=>'ض','ﺿ'=>'ض','ﻀ'=>'ض','ﻁ'=>'ط','ﻂ'=>'ط','ﻃ'=>'ط','ﻄ'=>'ط','ﻅ'=>'ظ','ﻆ'=>'ظ','ﻇ'=>'ظ','ﻈ'=>'ظ','ﻉ'=>'ع','ﻊ'=>'ع','ﻋ'=>'ع','ﻌ'=>'ع','ﻍ'=>'غ','ﻎ'=>'غ','ﻏ'=>'غ','ﻐ'=>'غ','ﻑ'=>'ف','ﻒ'=>'ف','ﻓ'=>'ف','ﻔ'=>'ف','ﻕ'=>'ق','ﻖ'=>'ق','ﻗ'=>'ق','ﻘ'=>'ق','ﻙ'=>'ك','ﻚ'=>'ك','ﻛ'=>'ك','ﻜ'=>'ك','ﻝ'=>'ل','ﻞ'=>'ل','ﻟ'=>'ل','ﻠ'=>'ل','ﻡ'=>'م','ﻢ'=>'م','ﻣ'=>'م','ﻤ'=>'م','ﻥ'=>'ن','ﻦ'=>'ن','ﻧ'=>'ن','ﻨ'=>'ن','ﻩ'=>'ه','ﻪ'=>'ه','ﻫ'=>'ه','ﻬ'=>'ه','ﻭ'=>'و','ﻮ'=>'و','ﻯ'=>'ى','ﻰ'=>'ى','ﻱ'=>'ي','ﻲ'=>'ي','ﻳ'=>'ي','ﻴ'=>'ي','ﻵ'=>'لآ','ﻶ'=>'لآ','ﻷ'=>'لأ','ﻸ'=>'لأ','ﻹ'=>'لإ','ﻺ'=>'لإ','ﻻ'=>'لا','ﻼ'=>'لا','!'=>'!','"'=>'"','#'=>'#','$'=>'$','%'=>'%','&'=>'&','''=>'\'','('=>'(',')'=>')','*'=>'*','+'=>'+',','=>',','-'=>'-','.'=>'.','/'=>'/','0'=>'0','1'=>'1','2'=>'2','3'=>'3','4'=>'4','5'=>'5','6'=>'6','7'=>'7','8'=>'8','9'=>'9',':'=>':',';'=>';','<'=>'<','='=>'=','>'=>'>','?'=>'?','@'=>'@','A'=>'A','B'=>'B','C'=>'C','D'=>'D','E'=>'E','F'=>'F','G'=>'G','H'=>'H','I'=>'I','J'=>'J','K'=>'K','L'=>'L','M'=>'M','N'=>'N','O'=>'O','P'=>'P','Q'=>'Q','R'=>'R','S'=>'S','T'=>'T','U'=>'U','V'=>'V','W'=>'W','X'=>'X','Y'=>'Y','Z'=>'Z','['=>'[','\'=>'\\',']'=>']','^'=>'^','_'=>'_','`'=>'`','a'=>'a','b'=>'b','c'=>'c','d'=>'d','e'=>'e','f'=>'f','g'=>'g','h'=>'h','i'=>'i','j'=>'j','k'=>'k','l'=>'l','m'=>'m','n'=>'n','o'=>'o','p'=>'p','q'=>'q','r'=>'r','s'=>'s','t'=>'t','u'=>'u','v'=>'v','w'=>'w','x'=>'x','y'=>'y','z'=>'z','{'=>'{','|'=>'|','}'=>'}','~'=>'~','⦅'=>'⦅','⦆'=>'⦆','。'=>'。','「'=>'「','」'=>'」','、'=>'、','・'=>'・','ヲ'=>'ヲ','ァ'=>'ァ','ィ'=>'ィ','ゥ'=>'ゥ','ェ'=>'ェ','ォ'=>'ォ','ャ'=>'ャ','ュ'=>'ュ','ョ'=>'ョ','ッ'=>'ッ','ー'=>'ー','ア'=>'ア','イ'=>'イ','ウ'=>'ウ','エ'=>'エ','オ'=>'オ','カ'=>'カ','キ'=>'キ','ク'=>'ク','ケ'=>'ケ','コ'=>'コ','サ'=>'サ','シ'=>'シ','ス'=>'ス','セ'=>'セ','ソ'=>'ソ','タ'=>'タ','チ'=>'チ','ツ'=>'ツ','テ'=>'テ','ト'=>'ト','ナ'=>'ナ','ニ'=>'ニ','ヌ'=>'ヌ','ネ'=>'ネ','ノ'=>'ノ','ハ'=>'ハ','ヒ'=>'ヒ','フ'=>'フ','ヘ'=>'ヘ','ホ'=>'ホ','マ'=>'マ','ミ'=>'ミ','ム'=>'ム','メ'=>'メ','モ'=>'モ','ヤ'=>'ヤ','ユ'=>'ユ','ヨ'=>'ヨ','ラ'=>'ラ','リ'=>'リ','ル'=>'ル','レ'=>'レ','ロ'=>'ロ','ワ'=>'ワ','ン'=>'ン','゙'=>'゙','゚'=>'゚','ᅠ'=>'ᅠ','ᄀ'=>'ᄀ','ᄁ'=>'ᄁ','ᆪ'=>'ᆪ','ᄂ'=>'ᄂ','ᆬ'=>'ᆬ','ᆭ'=>'ᆭ','ᄃ'=>'ᄃ','ᄄ'=>'ᄄ','ᄅ'=>'ᄅ','ᆰ'=>'ᆰ','ᆱ'=>'ᆱ','ᆲ'=>'ᆲ','ᆳ'=>'ᆳ','ᆴ'=>'ᆴ','ᆵ'=>'ᆵ','ᄚ'=>'ᄚ','ᄆ'=>'ᄆ','ᄇ'=>'ᄇ','ᄈ'=>'ᄈ','ᄡ'=>'ᄡ','ᄉ'=>'ᄉ','ᄊ'=>'ᄊ','ᄋ'=>'ᄋ','ᄌ'=>'ᄌ','ᄍ'=>'ᄍ','ᄎ'=>'ᄎ','ᄏ'=>'ᄏ','ᄐ'=>'ᄐ','ᄑ'=>'ᄑ','ᄒ'=>'ᄒ','ᅡ'=>'ᅡ','ᅢ'=>'ᅢ','ᅣ'=>'ᅣ','ᅤ'=>'ᅤ','ᅥ'=>'ᅥ','ᅦ'=>'ᅦ','ᅧ'=>'ᅧ','ᅨ'=>'ᅨ','ᅩ'=>'ᅩ','ᅪ'=>'ᅪ','ᅫ'=>'ᅫ','ᅬ'=>'ᅬ','ᅭ'=>'ᅭ','ᅮ'=>'ᅮ','ᅯ'=>'ᅯ','ᅰ'=>'ᅰ','ᅱ'=>'ᅱ','ᅲ'=>'ᅲ','ᅳ'=>'ᅳ','ᅴ'=>'ᅴ','ᅵ'=>'ᅵ','¢'=>'¢','£'=>'£','¬'=>'¬',' ̄'=>' ̄','¦'=>'¦','¥'=>'¥','₩'=>'₩','│'=>'│','←'=>'←','↑'=>'↑','→'=>'→','↓'=>'↓','■'=>'■','○'=>'○','𝅗𝅥'=>'𝅗𝅥','𝅘𝅥'=>'𝅘𝅥','𝅘𝅥𝅮'=>'𝅘𝅥𝅮','𝅘𝅥𝅯'=>'𝅘𝅥𝅯','𝅘𝅥𝅰'=>'𝅘𝅥𝅰','𝅘𝅥𝅱'=>'𝅘𝅥𝅱','𝅘𝅥𝅲'=>'𝅘𝅥𝅲','𝆹𝅥'=>'𝆹𝅥','𝆺𝅥'=>'𝆺𝅥','𝆹𝅥𝅮'=>'𝆹𝅥𝅮','𝆺𝅥𝅮'=>'𝆺𝅥𝅮','𝆹𝅥𝅯'=>'𝆹𝅥𝅯','𝆺𝅥𝅯'=>'𝆺𝅥𝅯','𝐀'=>'A','𝐁'=>'B','𝐂'=>'C','𝐃'=>'D','𝐄'=>'E','𝐅'=>'F','𝐆'=>'G','𝐇'=>'H','𝐈'=>'I','𝐉'=>'J','𝐊'=>'K','𝐋'=>'L','𝐌'=>'M','𝐍'=>'N','𝐎'=>'O','𝐏'=>'P','𝐐'=>'Q','𝐑'=>'R','𝐒'=>'S','𝐓'=>'T','𝐔'=>'U','𝐕'=>'V','𝐖'=>'W','𝐗'=>'X','𝐘'=>'Y','𝐙'=>'Z','𝐚'=>'a','𝐛'=>'b','𝐜'=>'c','𝐝'=>'d','𝐞'=>'e','𝐟'=>'f','𝐠'=>'g','𝐡'=>'h','𝐢'=>'i','𝐣'=>'j','𝐤'=>'k','𝐥'=>'l','𝐦'=>'m','𝐧'=>'n','𝐨'=>'o','𝐩'=>'p','𝐪'=>'q','𝐫'=>'r','𝐬'=>'s','𝐭'=>'t','𝐮'=>'u','𝐯'=>'v','𝐰'=>'w','𝐱'=>'x','𝐲'=>'y','𝐳'=>'z','𝐴'=>'A','𝐵'=>'B','𝐶'=>'C','𝐷'=>'D','𝐸'=>'E','𝐹'=>'F','𝐺'=>'G','𝐻'=>'H','𝐼'=>'I','𝐽'=>'J','𝐾'=>'K','𝐿'=>'L','𝑀'=>'M','𝑁'=>'N','𝑂'=>'O','𝑃'=>'P','𝑄'=>'Q','𝑅'=>'R','𝑆'=>'S','𝑇'=>'T','𝑈'=>'U','𝑉'=>'V','𝑊'=>'W','𝑋'=>'X','𝑌'=>'Y','𝑍'=>'Z','𝑎'=>'a','𝑏'=>'b','𝑐'=>'c','𝑑'=>'d','𝑒'=>'e','𝑓'=>'f','𝑔'=>'g','𝑖'=>'i','𝑗'=>'j','𝑘'=>'k','𝑙'=>'l','𝑚'=>'m','𝑛'=>'n','𝑜'=>'o','𝑝'=>'p','𝑞'=>'q','𝑟'=>'r','𝑠'=>'s','𝑡'=>'t','𝑢'=>'u','𝑣'=>'v','𝑤'=>'w','𝑥'=>'x','𝑦'=>'y','𝑧'=>'z','𝑨'=>'A','𝑩'=>'B','𝑪'=>'C','𝑫'=>'D','𝑬'=>'E','𝑭'=>'F','𝑮'=>'G','𝑯'=>'H','𝑰'=>'I','𝑱'=>'J','𝑲'=>'K','𝑳'=>'L','𝑴'=>'M','𝑵'=>'N','𝑶'=>'O','𝑷'=>'P','𝑸'=>'Q','𝑹'=>'R','𝑺'=>'S','𝑻'=>'T','𝑼'=>'U','𝑽'=>'V','𝑾'=>'W','𝑿'=>'X','𝒀'=>'Y','𝒁'=>'Z','𝒂'=>'a','𝒃'=>'b','𝒄'=>'c','𝒅'=>'d','𝒆'=>'e','𝒇'=>'f','𝒈'=>'g','𝒉'=>'h','𝒊'=>'i','𝒋'=>'j','𝒌'=>'k','𝒍'=>'l','𝒎'=>'m','𝒏'=>'n','𝒐'=>'o','𝒑'=>'p','𝒒'=>'q','𝒓'=>'r','𝒔'=>'s','𝒕'=>'t','𝒖'=>'u','𝒗'=>'v','𝒘'=>'w','𝒙'=>'x','𝒚'=>'y','𝒛'=>'z','𝒜'=>'A','𝒞'=>'C','𝒟'=>'D','𝒢'=>'G','𝒥'=>'J','𝒦'=>'K','𝒩'=>'N','𝒪'=>'O','𝒫'=>'P','𝒬'=>'Q','𝒮'=>'S','𝒯'=>'T','𝒰'=>'U','𝒱'=>'V','𝒲'=>'W','𝒳'=>'X','𝒴'=>'Y','𝒵'=>'Z','𝒶'=>'a','𝒷'=>'b','𝒸'=>'c','𝒹'=>'d','𝒻'=>'f','𝒽'=>'h','𝒾'=>'i','𝒿'=>'j','𝓀'=>'k','𝓁'=>'l','𝓂'=>'m','𝓃'=>'n','𝓅'=>'p','𝓆'=>'q','𝓇'=>'r','𝓈'=>'s','𝓉'=>'t','𝓊'=>'u','𝓋'=>'v','𝓌'=>'w','𝓍'=>'x','𝓎'=>'y','𝓏'=>'z','𝓐'=>'A','𝓑'=>'B','𝓒'=>'C','𝓓'=>'D','𝓔'=>'E','𝓕'=>'F','𝓖'=>'G','𝓗'=>'H','𝓘'=>'I','𝓙'=>'J','𝓚'=>'K','𝓛'=>'L','𝓜'=>'M','𝓝'=>'N','𝓞'=>'O','𝓟'=>'P','𝓠'=>'Q','𝓡'=>'R','𝓢'=>'S','𝓣'=>'T','𝓤'=>'U','𝓥'=>'V','𝓦'=>'W','𝓧'=>'X','𝓨'=>'Y','𝓩'=>'Z','𝓪'=>'a','𝓫'=>'b','𝓬'=>'c','𝓭'=>'d','𝓮'=>'e','𝓯'=>'f','𝓰'=>'g','𝓱'=>'h','𝓲'=>'i','𝓳'=>'j','𝓴'=>'k','𝓵'=>'l','𝓶'=>'m','𝓷'=>'n','𝓸'=>'o','𝓹'=>'p','𝓺'=>'q','𝓻'=>'r','𝓼'=>'s','𝓽'=>'t','𝓾'=>'u','𝓿'=>'v','𝔀'=>'w','𝔁'=>'x','𝔂'=>'y','𝔃'=>'z','𝔄'=>'A','𝔅'=>'B','𝔇'=>'D','𝔈'=>'E','𝔉'=>'F','𝔊'=>'G','𝔍'=>'J','𝔎'=>'K','𝔏'=>'L','𝔐'=>'M','𝔑'=>'N','𝔒'=>'O','𝔓'=>'P','𝔔'=>'Q','𝔖'=>'S','𝔗'=>'T','𝔘'=>'U','𝔙'=>'V','𝔚'=>'W','𝔛'=>'X','𝔜'=>'Y','𝔞'=>'a','𝔟'=>'b','𝔠'=>'c','𝔡'=>'d','𝔢'=>'e','𝔣'=>'f','𝔤'=>'g','𝔥'=>'h','𝔦'=>'i','𝔧'=>'j','𝔨'=>'k','𝔩'=>'l','𝔪'=>'m','𝔫'=>'n','𝔬'=>'o','𝔭'=>'p','𝔮'=>'q','𝔯'=>'r','𝔰'=>'s','𝔱'=>'t','𝔲'=>'u','𝔳'=>'v','𝔴'=>'w','𝔵'=>'x','𝔶'=>'y','𝔷'=>'z','𝔸'=>'A','𝔹'=>'B','𝔻'=>'D','𝔼'=>'E','𝔽'=>'F','𝔾'=>'G','𝕀'=>'I','𝕁'=>'J','𝕂'=>'K','𝕃'=>'L','𝕄'=>'M','𝕆'=>'O','𝕊'=>'S','𝕋'=>'T','𝕌'=>'U','𝕍'=>'V','𝕎'=>'W','𝕏'=>'X','𝕐'=>'Y','𝕒'=>'a','𝕓'=>'b','𝕔'=>'c','𝕕'=>'d','𝕖'=>'e','𝕗'=>'f','𝕘'=>'g','𝕙'=>'h','𝕚'=>'i','𝕛'=>'j','𝕜'=>'k','𝕝'=>'l','𝕞'=>'m','𝕟'=>'n','𝕠'=>'o','𝕡'=>'p','𝕢'=>'q','𝕣'=>'r','𝕤'=>'s','𝕥'=>'t','𝕦'=>'u','𝕧'=>'v','𝕨'=>'w','𝕩'=>'x','𝕪'=>'y','𝕫'=>'z','𝕬'=>'A','𝕭'=>'B','𝕮'=>'C','𝕯'=>'D','𝕰'=>'E','𝕱'=>'F','𝕲'=>'G','𝕳'=>'H','𝕴'=>'I','𝕵'=>'J','𝕶'=>'K','𝕷'=>'L','𝕸'=>'M','𝕹'=>'N','𝕺'=>'O','𝕻'=>'P','𝕼'=>'Q','𝕽'=>'R','𝕾'=>'S','𝕿'=>'T','𝖀'=>'U','𝖁'=>'V','𝖂'=>'W','𝖃'=>'X','𝖄'=>'Y','𝖅'=>'Z','𝖆'=>'a','𝖇'=>'b','𝖈'=>'c','𝖉'=>'d','𝖊'=>'e','𝖋'=>'f','𝖌'=>'g','𝖍'=>'h','𝖎'=>'i','𝖏'=>'j','𝖐'=>'k','𝖑'=>'l','𝖒'=>'m','𝖓'=>'n','𝖔'=>'o','𝖕'=>'p','𝖖'=>'q','𝖗'=>'r','𝖘'=>'s','𝖙'=>'t','𝖚'=>'u','𝖛'=>'v','𝖜'=>'w','𝖝'=>'x','𝖞'=>'y','𝖟'=>'z','𝖠'=>'A','𝖡'=>'B','𝖢'=>'C','𝖣'=>'D','𝖤'=>'E','𝖥'=>'F','𝖦'=>'G','𝖧'=>'H','𝖨'=>'I','𝖩'=>'J','𝖪'=>'K','𝖫'=>'L','𝖬'=>'M','𝖭'=>'N','𝖮'=>'O','𝖯'=>'P','𝖰'=>'Q','𝖱'=>'R','𝖲'=>'S','𝖳'=>'T','𝖴'=>'U','𝖵'=>'V','𝖶'=>'W','𝖷'=>'X','𝖸'=>'Y','𝖹'=>'Z','𝖺'=>'a','𝖻'=>'b','𝖼'=>'c','𝖽'=>'d','𝖾'=>'e','𝖿'=>'f','𝗀'=>'g','𝗁'=>'h','𝗂'=>'i','𝗃'=>'j','𝗄'=>'k','𝗅'=>'l','𝗆'=>'m','𝗇'=>'n','𝗈'=>'o','𝗉'=>'p','𝗊'=>'q','𝗋'=>'r','𝗌'=>'s','𝗍'=>'t','𝗎'=>'u','𝗏'=>'v','𝗐'=>'w','𝗑'=>'x','𝗒'=>'y','𝗓'=>'z','𝗔'=>'A','𝗕'=>'B','𝗖'=>'C','𝗗'=>'D','𝗘'=>'E','𝗙'=>'F','𝗚'=>'G','𝗛'=>'H','𝗜'=>'I','𝗝'=>'J','𝗞'=>'K','𝗟'=>'L','𝗠'=>'M','𝗡'=>'N','𝗢'=>'O','𝗣'=>'P','𝗤'=>'Q','𝗥'=>'R','𝗦'=>'S','𝗧'=>'T','𝗨'=>'U','𝗩'=>'V','𝗪'=>'W','𝗫'=>'X','𝗬'=>'Y','𝗭'=>'Z','𝗮'=>'a','𝗯'=>'b','𝗰'=>'c','𝗱'=>'d','𝗲'=>'e','𝗳'=>'f','𝗴'=>'g','𝗵'=>'h','𝗶'=>'i','𝗷'=>'j','𝗸'=>'k','𝗹'=>'l','𝗺'=>'m','𝗻'=>'n','𝗼'=>'o','𝗽'=>'p','𝗾'=>'q','𝗿'=>'r','𝘀'=>'s','𝘁'=>'t','𝘂'=>'u','𝘃'=>'v','𝘄'=>'w','𝘅'=>'x','𝘆'=>'y','𝘇'=>'z','𝘈'=>'A','𝘉'=>'B','𝘊'=>'C','𝘋'=>'D','𝘌'=>'E','𝘍'=>'F','𝘎'=>'G','𝘏'=>'H','𝘐'=>'I','𝘑'=>'J','𝘒'=>'K','𝘓'=>'L','𝘔'=>'M','𝘕'=>'N','𝘖'=>'O','𝘗'=>'P','𝘘'=>'Q','𝘙'=>'R','𝘚'=>'S','𝘛'=>'T','𝘜'=>'U','𝘝'=>'V','𝘞'=>'W','𝘟'=>'X','𝘠'=>'Y','𝘡'=>'Z','𝘢'=>'a','𝘣'=>'b','𝘤'=>'c','𝘥'=>'d','𝘦'=>'e','𝘧'=>'f','𝘨'=>'g','𝘩'=>'h','𝘪'=>'i','𝘫'=>'j','𝘬'=>'k','𝘭'=>'l','𝘮'=>'m','𝘯'=>'n','𝘰'=>'o','𝘱'=>'p','𝘲'=>'q','𝘳'=>'r','𝘴'=>'s','𝘵'=>'t','𝘶'=>'u','𝘷'=>'v','𝘸'=>'w','𝘹'=>'x','𝘺'=>'y','𝘻'=>'z','𝘼'=>'A','𝘽'=>'B','𝘾'=>'C','𝘿'=>'D','𝙀'=>'E','𝙁'=>'F','𝙂'=>'G','𝙃'=>'H','𝙄'=>'I','𝙅'=>'J','𝙆'=>'K','𝙇'=>'L','𝙈'=>'M','𝙉'=>'N','𝙊'=>'O','𝙋'=>'P','𝙌'=>'Q','𝙍'=>'R','𝙎'=>'S','𝙏'=>'T','𝙐'=>'U','𝙑'=>'V','𝙒'=>'W','𝙓'=>'X','𝙔'=>'Y','𝙕'=>'Z','𝙖'=>'a','𝙗'=>'b','𝙘'=>'c','𝙙'=>'d','𝙚'=>'e','𝙛'=>'f','𝙜'=>'g','𝙝'=>'h','𝙞'=>'i','𝙟'=>'j','𝙠'=>'k','𝙡'=>'l','𝙢'=>'m','𝙣'=>'n','𝙤'=>'o','𝙥'=>'p','𝙦'=>'q','𝙧'=>'r','𝙨'=>'s','𝙩'=>'t','𝙪'=>'u','𝙫'=>'v','𝙬'=>'w','𝙭'=>'x','𝙮'=>'y','𝙯'=>'z','𝙰'=>'A','𝙱'=>'B','𝙲'=>'C','𝙳'=>'D','𝙴'=>'E','𝙵'=>'F','𝙶'=>'G','𝙷'=>'H','𝙸'=>'I','𝙹'=>'J','𝙺'=>'K','𝙻'=>'L','𝙼'=>'M','𝙽'=>'N','𝙾'=>'O','𝙿'=>'P','𝚀'=>'Q','𝚁'=>'R','𝚂'=>'S','𝚃'=>'T','𝚄'=>'U','𝚅'=>'V','𝚆'=>'W','𝚇'=>'X','𝚈'=>'Y','𝚉'=>'Z','𝚊'=>'a','𝚋'=>'b','𝚌'=>'c','𝚍'=>'d','𝚎'=>'e','𝚏'=>'f','𝚐'=>'g','𝚑'=>'h','𝚒'=>'i','𝚓'=>'j','𝚔'=>'k','𝚕'=>'l','𝚖'=>'m','𝚗'=>'n','𝚘'=>'o','𝚙'=>'p','𝚚'=>'q','𝚛'=>'r','𝚜'=>'s','𝚝'=>'t','𝚞'=>'u','𝚟'=>'v','𝚠'=>'w','𝚡'=>'x','𝚢'=>'y','𝚣'=>'z','𝚤'=>'ı','𝚥'=>'ȷ','𝚨'=>'Α','𝚩'=>'Β','𝚪'=>'Γ','𝚫'=>'Δ','𝚬'=>'Ε','𝚭'=>'Ζ','𝚮'=>'Η','𝚯'=>'Θ','𝚰'=>'Ι','𝚱'=>'Κ','𝚲'=>'Λ','𝚳'=>'Μ','𝚴'=>'Ν','𝚵'=>'Ξ','𝚶'=>'Ο','𝚷'=>'Π','𝚸'=>'Ρ','𝚹'=>'Θ','𝚺'=>'Σ','𝚻'=>'Τ','𝚼'=>'Υ','𝚽'=>'Φ','𝚾'=>'Χ','𝚿'=>'Ψ','𝛀'=>'Ω','𝛁'=>'∇','𝛂'=>'α','𝛃'=>'β','𝛄'=>'γ','𝛅'=>'δ','𝛆'=>'ε','𝛇'=>'ζ','𝛈'=>'η','𝛉'=>'θ','𝛊'=>'ι','𝛋'=>'κ','𝛌'=>'λ','𝛍'=>'μ','𝛎'=>'ν','𝛏'=>'ξ','𝛐'=>'ο','𝛑'=>'π','𝛒'=>'ρ','𝛓'=>'ς','𝛔'=>'σ','𝛕'=>'τ','𝛖'=>'υ','𝛗'=>'φ','𝛘'=>'χ','𝛙'=>'ψ','𝛚'=>'ω','𝛛'=>'∂','𝛜'=>'ε','𝛝'=>'θ','𝛞'=>'κ','𝛟'=>'φ','𝛠'=>'ρ','𝛡'=>'π','𝛢'=>'Α','𝛣'=>'Β','𝛤'=>'Γ','𝛥'=>'Δ','𝛦'=>'Ε','𝛧'=>'Ζ','𝛨'=>'Η','𝛩'=>'Θ','𝛪'=>'Ι','𝛫'=>'Κ','𝛬'=>'Λ','𝛭'=>'Μ','𝛮'=>'Ν','𝛯'=>'Ξ','𝛰'=>'Ο','𝛱'=>'Π','𝛲'=>'Ρ','𝛳'=>'Θ','𝛴'=>'Σ','𝛵'=>'Τ','𝛶'=>'Υ','𝛷'=>'Φ','𝛸'=>'Χ','𝛹'=>'Ψ','𝛺'=>'Ω','𝛻'=>'∇','𝛼'=>'α','𝛽'=>'β','𝛾'=>'γ','𝛿'=>'δ','𝜀'=>'ε','𝜁'=>'ζ','𝜂'=>'η','𝜃'=>'θ','𝜄'=>'ι','𝜅'=>'κ','𝜆'=>'λ','𝜇'=>'μ','𝜈'=>'ν','𝜉'=>'ξ','𝜊'=>'ο','𝜋'=>'π','𝜌'=>'ρ','𝜍'=>'ς','𝜎'=>'σ','𝜏'=>'τ','𝜐'=>'υ','𝜑'=>'φ','𝜒'=>'χ','𝜓'=>'ψ','𝜔'=>'ω','𝜕'=>'∂','𝜖'=>'ε','𝜗'=>'θ','𝜘'=>'κ','𝜙'=>'φ','𝜚'=>'ρ','𝜛'=>'π','𝜜'=>'Α','𝜝'=>'Β','𝜞'=>'Γ','𝜟'=>'Δ','𝜠'=>'Ε','𝜡'=>'Ζ','𝜢'=>'Η','𝜣'=>'Θ','𝜤'=>'Ι','𝜥'=>'Κ','𝜦'=>'Λ','𝜧'=>'Μ','𝜨'=>'Ν','𝜩'=>'Ξ','𝜪'=>'Ο','𝜫'=>'Π','𝜬'=>'Ρ','𝜭'=>'Θ','𝜮'=>'Σ','𝜯'=>'Τ','𝜰'=>'Υ','𝜱'=>'Φ','𝜲'=>'Χ','𝜳'=>'Ψ','𝜴'=>'Ω','𝜵'=>'∇','𝜶'=>'α','𝜷'=>'β','𝜸'=>'γ','𝜹'=>'δ','𝜺'=>'ε','𝜻'=>'ζ','𝜼'=>'η','𝜽'=>'θ','𝜾'=>'ι','𝜿'=>'κ','𝝀'=>'λ','𝝁'=>'μ','𝝂'=>'ν','𝝃'=>'ξ','𝝄'=>'ο','𝝅'=>'π','𝝆'=>'ρ','𝝇'=>'ς','𝝈'=>'σ','𝝉'=>'τ','𝝊'=>'υ','𝝋'=>'φ','𝝌'=>'χ','𝝍'=>'ψ','𝝎'=>'ω','𝝏'=>'∂','𝝐'=>'ε','𝝑'=>'θ','𝝒'=>'κ','𝝓'=>'φ','𝝔'=>'ρ','𝝕'=>'π','𝝖'=>'Α','𝝗'=>'Β','𝝘'=>'Γ','𝝙'=>'Δ','𝝚'=>'Ε','𝝛'=>'Ζ','𝝜'=>'Η','𝝝'=>'Θ','𝝞'=>'Ι','𝝟'=>'Κ','𝝠'=>'Λ','𝝡'=>'Μ','𝝢'=>'Ν','𝝣'=>'Ξ','𝝤'=>'Ο','𝝥'=>'Π','𝝦'=>'Ρ','𝝧'=>'Θ','𝝨'=>'Σ','𝝩'=>'Τ','𝝪'=>'Υ','𝝫'=>'Φ','𝝬'=>'Χ','𝝭'=>'Ψ','𝝮'=>'Ω','𝝯'=>'∇','𝝰'=>'α','𝝱'=>'β','𝝲'=>'γ','𝝳'=>'δ','𝝴'=>'ε','𝝵'=>'ζ','𝝶'=>'η','𝝷'=>'θ','𝝸'=>'ι','𝝹'=>'κ','𝝺'=>'λ','𝝻'=>'μ','𝝼'=>'ν','𝝽'=>'ξ','𝝾'=>'ο','𝝿'=>'π','𝞀'=>'ρ','𝞁'=>'ς','𝞂'=>'σ','𝞃'=>'τ','𝞄'=>'υ','𝞅'=>'φ','𝞆'=>'χ','𝞇'=>'ψ','𝞈'=>'ω','𝞉'=>'∂','𝞊'=>'ε','𝞋'=>'θ','𝞌'=>'κ','𝞍'=>'φ','𝞎'=>'ρ','𝞏'=>'π','𝞐'=>'Α','𝞑'=>'Β','𝞒'=>'Γ','𝞓'=>'Δ','𝞔'=>'Ε','𝞕'=>'Ζ','𝞖'=>'Η','𝞗'=>'Θ','𝞘'=>'Ι','𝞙'=>'Κ','𝞚'=>'Λ','𝞛'=>'Μ','𝞜'=>'Ν','𝞝'=>'Ξ','𝞞'=>'Ο','𝞟'=>'Π','𝞠'=>'Ρ','𝞡'=>'Θ','𝞢'=>'Σ','𝞣'=>'Τ','𝞤'=>'Υ','𝞥'=>'Φ','𝞦'=>'Χ','𝞧'=>'Ψ','𝞨'=>'Ω','𝞩'=>'∇','𝞪'=>'α','𝞫'=>'β','𝞬'=>'γ','𝞭'=>'δ','𝞮'=>'ε','𝞯'=>'ζ','𝞰'=>'η','𝞱'=>'θ','𝞲'=>'ι','𝞳'=>'κ','𝞴'=>'λ','𝞵'=>'μ','𝞶'=>'ν','𝞷'=>'ξ','𝞸'=>'ο','𝞹'=>'π','𝞺'=>'ρ','𝞻'=>'ς','𝞼'=>'σ','𝞽'=>'τ','𝞾'=>'υ','𝞿'=>'φ','𝟀'=>'χ','𝟁'=>'ψ','𝟂'=>'ω','𝟃'=>'∂','𝟄'=>'ε','𝟅'=>'θ','𝟆'=>'κ','𝟇'=>'φ','𝟈'=>'ρ','𝟉'=>'π','𝟊'=>'Ϝ','𝟋'=>'ϝ','𝟎'=>'0','𝟏'=>'1','𝟐'=>'2','𝟑'=>'3','𝟒'=>'4','𝟓'=>'5','𝟔'=>'6','𝟕'=>'7','𝟖'=>'8','𝟗'=>'9','𝟘'=>'0','𝟙'=>'1','𝟚'=>'2','𝟛'=>'3','𝟜'=>'4','𝟝'=>'5','𝟞'=>'6','𝟟'=>'7','𝟠'=>'8','𝟡'=>'9','𝟢'=>'0','𝟣'=>'1','𝟤'=>'2','𝟥'=>'3','𝟦'=>'4','𝟧'=>'5','𝟨'=>'6','𝟩'=>'7','𝟪'=>'8','𝟫'=>'9','𝟬'=>'0','𝟭'=>'1','𝟮'=>'2','𝟯'=>'3','𝟰'=>'4','𝟱'=>'5','𝟲'=>'6','𝟳'=>'7','𝟴'=>'8','𝟵'=>'9','𝟶'=>'0','𝟷'=>'1','𝟸'=>'2','𝟹'=>'3','𝟺'=>'4','𝟻'=>'5','𝟼'=>'6','𝟽'=>'7','𝟾'=>'8','𝟿'=>'9','丽'=>'丽','丸'=>'丸','乁'=>'乁','𠄢'=>'𠄢','你'=>'你','侮'=>'侮','侻'=>'侻','倂'=>'倂','偺'=>'偺','備'=>'備','僧'=>'僧','像'=>'像','㒞'=>'㒞','𠘺'=>'𠘺','免'=>'免','兔'=>'兔','兤'=>'兤','具'=>'具','𠔜'=>'𠔜','㒹'=>'㒹','內'=>'內','再'=>'再','𠕋'=>'𠕋','冗'=>'冗','冤'=>'冤','仌'=>'仌','冬'=>'冬','况'=>'况','𩇟'=>'𩇟','凵'=>'凵','刃'=>'刃','㓟'=>'㓟','刻'=>'刻','剆'=>'剆','割'=>'割','剷'=>'剷','㔕'=>'㔕','勇'=>'勇','勉'=>'勉','勤'=>'勤','勺'=>'勺','包'=>'包','匆'=>'匆','北'=>'北','卉'=>'卉','卑'=>'卑','博'=>'博','即'=>'即','卽'=>'卽','卿'=>'卿','卿'=>'卿','卿'=>'卿','𠨬'=>'𠨬','灰'=>'灰','及'=>'及','叟'=>'叟','𠭣'=>'𠭣','叫'=>'叫','叱'=>'叱','吆'=>'吆','咞'=>'咞','吸'=>'吸','呈'=>'呈','周'=>'周','咢'=>'咢','哶'=>'哶','唐'=>'唐','啓'=>'啓','啣'=>'啣','善'=>'善','善'=>'善','喙'=>'喙','喫'=>'喫','喳'=>'喳','嗂'=>'嗂','圖'=>'圖','嘆'=>'嘆','圗'=>'圗','噑'=>'噑','噴'=>'噴','切'=>'切','壮'=>'壮','城'=>'城','埴'=>'埴','堍'=>'堍','型'=>'型','堲'=>'堲','報'=>'報','墬'=>'墬','𡓤'=>'𡓤','売'=>'売','壷'=>'壷','夆'=>'夆','多'=>'多','夢'=>'夢','奢'=>'奢','𡚨'=>'𡚨','𡛪'=>'𡛪','姬'=>'姬','娛'=>'娛','娧'=>'娧','姘'=>'姘','婦'=>'婦','㛮'=>'㛮','㛼'=>'㛼','嬈'=>'嬈','嬾'=>'嬾','嬾'=>'嬾','𡧈'=>'𡧈','寃'=>'寃','寘'=>'寘','寧'=>'寧','寳'=>'寳','𡬘'=>'𡬘','寿'=>'寿','将'=>'将','当'=>'当','尢'=>'尢','㞁'=>'㞁','屠'=>'屠','屮'=>'屮','峀'=>'峀','岍'=>'岍','𡷤'=>'𡷤','嵃'=>'嵃','𡷦'=>'𡷦','嵮'=>'嵮','嵫'=>'嵫','嵼'=>'嵼','巡'=>'巡','巢'=>'巢','㠯'=>'㠯','巽'=>'巽','帨'=>'帨','帽'=>'帽','幩'=>'幩','㡢'=>'㡢','𢆃'=>'𢆃','㡼'=>'㡼','庰'=>'庰','庳'=>'庳','庶'=>'庶','廊'=>'廊','𪎒'=>'𪎒','廾'=>'廾','𢌱'=>'𢌱','𢌱'=>'𢌱','舁'=>'舁','弢'=>'弢','弢'=>'弢','㣇'=>'㣇','𣊸'=>'𣊸','𦇚'=>'𦇚','形'=>'形','彫'=>'彫','㣣'=>'㣣','徚'=>'徚','忍'=>'忍','志'=>'志','忹'=>'忹','悁'=>'悁','㤺'=>'㤺','㤜'=>'㤜','悔'=>'悔','𢛔'=>'𢛔','惇'=>'惇','慈'=>'慈','慌'=>'慌','慎'=>'慎','慌'=>'慌','慺'=>'慺','憎'=>'憎','憲'=>'憲','憤'=>'憤','憯'=>'憯','懞'=>'懞','懲'=>'懲','懶'=>'懶','成'=>'成','戛'=>'戛','扝'=>'扝','抱'=>'抱','拔'=>'拔','捐'=>'捐','𢬌'=>'𢬌','挽'=>'挽','拼'=>'拼','捨'=>'捨','掃'=>'掃','揤'=>'揤','𢯱'=>'𢯱','搢'=>'搢','揅'=>'揅','掩'=>'掩','㨮'=>'㨮','摩'=>'摩','摾'=>'摾','撝'=>'撝','摷'=>'摷','㩬'=>'㩬','敏'=>'敏','敬'=>'敬','𣀊'=>'𣀊','旣'=>'旣','書'=>'書','晉'=>'晉','㬙'=>'㬙','暑'=>'暑','㬈'=>'㬈','㫤'=>'㫤','冒'=>'冒','冕'=>'冕','最'=>'最','暜'=>'暜','肭'=>'肭','䏙'=>'䏙','朗'=>'朗','望'=>'望','朡'=>'朡','杞'=>'杞','杓'=>'杓','𣏃'=>'𣏃','㭉'=>'㭉','柺'=>'柺','枅'=>'枅','桒'=>'桒','梅'=>'梅','𣑭'=>'𣑭','梎'=>'梎','栟'=>'栟','椔'=>'椔','㮝'=>'㮝','楂'=>'楂','榣'=>'榣','槪'=>'槪','檨'=>'檨','𣚣'=>'𣚣','櫛'=>'櫛','㰘'=>'㰘','次'=>'次','𣢧'=>'𣢧','歔'=>'歔','㱎'=>'㱎','歲'=>'歲','殟'=>'殟','殺'=>'殺','殻'=>'殻','𣪍'=>'𣪍','𡴋'=>'𡴋','𣫺'=>'𣫺','汎'=>'汎','𣲼'=>'𣲼','沿'=>'沿','泍'=>'泍','汧'=>'汧','洖'=>'洖','派'=>'派','海'=>'海','流'=>'流','浩'=>'浩','浸'=>'浸','涅'=>'涅','𣴞'=>'𣴞','洴'=>'洴','港'=>'港','湮'=>'湮','㴳'=>'㴳','滋'=>'滋','滇'=>'滇','𣻑'=>'𣻑','淹'=>'淹','潮'=>'潮','𣽞'=>'𣽞','𣾎'=>'𣾎','濆'=>'濆','瀹'=>'瀹','瀞'=>'瀞','瀛'=>'瀛','㶖'=>'㶖','灊'=>'灊','災'=>'災','灷'=>'灷','炭'=>'炭','𠔥'=>'𠔥','煅'=>'煅','𤉣'=>'𤉣','熜'=>'熜','𤎫'=>'𤎫','爨'=>'爨','爵'=>'爵','牐'=>'牐','𤘈'=>'𤘈','犀'=>'犀','犕'=>'犕','𤜵'=>'𤜵','𤠔'=>'𤠔','獺'=>'獺','王'=>'王','㺬'=>'㺬','玥'=>'玥','㺸'=>'㺸','㺸'=>'㺸','瑇'=>'瑇','瑜'=>'瑜','瑱'=>'瑱','璅'=>'璅','瓊'=>'瓊','㼛'=>'㼛','甤'=>'甤','𤰶'=>'𤰶','甾'=>'甾','𤲒'=>'𤲒','異'=>'異','𢆟'=>'𢆟','瘐'=>'瘐','𤾡'=>'𤾡','𤾸'=>'𤾸','𥁄'=>'𥁄','㿼'=>'㿼','䀈'=>'䀈','直'=>'直','𥃳'=>'𥃳','𥃲'=>'𥃲','𥄙'=>'𥄙','𥄳'=>'𥄳','眞'=>'眞','真'=>'真','真'=>'真','睊'=>'睊','䀹'=>'䀹','瞋'=>'瞋','䁆'=>'䁆','䂖'=>'䂖','𥐝'=>'𥐝','硎'=>'硎','碌'=>'碌','磌'=>'磌','䃣'=>'䃣','𥘦'=>'𥘦','祖'=>'祖','𥚚'=>'𥚚','𥛅'=>'𥛅','福'=>'福','秫'=>'秫','䄯'=>'䄯','穀'=>'穀','穊'=>'穊','穏'=>'穏','𥥼'=>'𥥼','𥪧'=>'𥪧','𥪧'=>'𥪧','竮'=>'竮','䈂'=>'䈂','𥮫'=>'𥮫','篆'=>'篆','築'=>'築','䈧'=>'䈧','𥲀'=>'𥲀','糒'=>'糒','䊠'=>'䊠','糨'=>'糨','糣'=>'糣','紀'=>'紀','𥾆'=>'𥾆','絣'=>'絣','䌁'=>'䌁','緇'=>'緇','縂'=>'縂','繅'=>'繅','䌴'=>'䌴','𦈨'=>'𦈨','𦉇'=>'𦉇','䍙'=>'䍙','𦋙'=>'𦋙','罺'=>'罺','𦌾'=>'𦌾','羕'=>'羕','翺'=>'翺','者'=>'者','𦓚'=>'𦓚','𦔣'=>'𦔣','聠'=>'聠','𦖨'=>'𦖨','聰'=>'聰','𣍟'=>'𣍟','䏕'=>'䏕','育'=>'育','脃'=>'脃','䐋'=>'䐋','脾'=>'脾','媵'=>'媵','𦞧'=>'𦞧','𦞵'=>'𦞵','𣎓'=>'𣎓','𣎜'=>'𣎜','舁'=>'舁','舄'=>'舄','辞'=>'辞','䑫'=>'䑫','芑'=>'芑','芋'=>'芋','芝'=>'芝','劳'=>'劳','花'=>'花','芳'=>'芳','芽'=>'芽','苦'=>'苦','𦬼'=>'𦬼','若'=>'若','茝'=>'茝','荣'=>'荣','莭'=>'莭','茣'=>'茣','莽'=>'莽','菧'=>'菧','著'=>'著','荓'=>'荓','菊'=>'菊','菌'=>'菌','菜'=>'菜','𦰶'=>'𦰶','𦵫'=>'𦵫','𦳕'=>'𦳕','䔫'=>'䔫','蓱'=>'蓱','蓳'=>'蓳','蔖'=>'蔖','𧏊'=>'𧏊','蕤'=>'蕤','𦼬'=>'𦼬','䕝'=>'䕝','䕡'=>'䕡','𦾱'=>'𦾱','𧃒'=>'𧃒','䕫'=>'䕫','虐'=>'虐','虜'=>'虜','虧'=>'虧','虩'=>'虩','蚩'=>'蚩','蚈'=>'蚈','蜎'=>'蜎','蛢'=>'蛢','蝹'=>'蝹','蜨'=>'蜨','蝫'=>'蝫','螆'=>'螆','䗗'=>'䗗','蟡'=>'蟡','蠁'=>'蠁','䗹'=>'䗹','衠'=>'衠','衣'=>'衣','𧙧'=>'𧙧','裗'=>'裗','裞'=>'裞','䘵'=>'䘵','裺'=>'裺','㒻'=>'㒻','𧢮'=>'𧢮','𧥦'=>'𧥦','䚾'=>'䚾','䛇'=>'䛇','誠'=>'誠','諭'=>'諭','變'=>'變','豕'=>'豕','𧲨'=>'𧲨','貫'=>'貫','賁'=>'賁','贛'=>'贛','起'=>'起','𧼯'=>'𧼯','𠠄'=>'𠠄','跋'=>'跋','趼'=>'趼','跰'=>'跰','𠣞'=>'𠣞','軔'=>'軔','輸'=>'輸','𨗒'=>'𨗒','𨗭'=>'𨗭','邔'=>'邔','郱'=>'郱','鄑'=>'鄑','𨜮'=>'𨜮','鄛'=>'鄛','鈸'=>'鈸','鋗'=>'鋗','鋘'=>'鋘','鉼'=>'鉼','鏹'=>'鏹','鐕'=>'鐕','𨯺'=>'𨯺','開'=>'開','䦕'=>'䦕','閷'=>'閷','𨵷'=>'𨵷','䧦'=>'䧦','雃'=>'雃','嶲'=>'嶲','霣'=>'霣','𩅅'=>'𩅅','𩈚'=>'𩈚','䩮'=>'䩮','䩶'=>'䩶','韠'=>'韠','𩐊'=>'𩐊','䪲'=>'䪲','𩒖'=>'𩒖','頋'=>'頋','頋'=>'頋','頩'=>'頩','𩖶'=>'𩖶','飢'=>'飢','䬳'=>'䬳','餩'=>'餩','馧'=>'馧','駂'=>'駂','駾'=>'駾','䯎'=>'䯎','𩬰'=>'𩬰','鬒'=>'鬒','鱀'=>'鱀','鳽'=>'鳽','䳎'=>'䳎','䳭'=>'䳭','鵧'=>'鵧','𪃎'=>'𪃎','䳸'=>'䳸','𪄅'=>'𪄅','𪈎'=>'𪈎','𪊑'=>'𪊑','麻'=>'麻','䵖'=>'䵖','黹'=>'黹','黾'=>'黾','鼅'=>'鼅','鼏'=>'鼏','鼖'=>'鼖','鼻'=>'鼻','𪘀'=>'𪘀'); \ No newline at end of file
+$GLOBALS['utf_compatibility_decomp']=array(' '=>' ','¨'=>' ̈','ª'=>'a','¯'=>' ̄','²'=>'2','³'=>'3','´'=>' ́','µ'=>'μ','¸'=>' ̧','¹'=>'1','º'=>'o','¼'=>'1⁄4','½'=>'1⁄2','¾'=>'3⁄4','À'=>'À','Á'=>'Á','Â'=>'Â','Ã'=>'Ã','Ä'=>'Ä','Å'=>'Å','Ç'=>'Ç','È'=>'È','É'=>'É','Ê'=>'Ê','Ë'=>'Ë','Ì'=>'Ì','Í'=>'Í','Î'=>'Î','Ï'=>'Ï','Ñ'=>'Ñ','Ò'=>'Ò','Ó'=>'Ó','Ô'=>'Ô','Õ'=>'Õ','Ö'=>'Ö','Ù'=>'Ù','Ú'=>'Ú','Û'=>'Û','Ü'=>'Ü','Ý'=>'Ý','à'=>'à','á'=>'á','â'=>'â','ã'=>'ã','ä'=>'ä','å'=>'å','ç'=>'ç','è'=>'è','é'=>'é','ê'=>'ê','ë'=>'ë','ì'=>'ì','í'=>'í','î'=>'î','ï'=>'ï','ñ'=>'ñ','ò'=>'ò','ó'=>'ó','ô'=>'ô','õ'=>'õ','ö'=>'ö','ù'=>'ù','ú'=>'ú','û'=>'û','ü'=>'ü','ý'=>'ý','ÿ'=>'ÿ','Ā'=>'Ā','ā'=>'ā','Ă'=>'Ă','ă'=>'ă','Ą'=>'Ą','ą'=>'ą','Ć'=>'Ć','ć'=>'ć','Ĉ'=>'Ĉ','ĉ'=>'ĉ','Ċ'=>'Ċ','ċ'=>'ċ','Č'=>'Č','č'=>'č','Ď'=>'Ď','ď'=>'ď','Ē'=>'Ē','ē'=>'ē','Ĕ'=>'Ĕ','ĕ'=>'ĕ','Ė'=>'Ė','ė'=>'ė','Ę'=>'Ę','ę'=>'ę','Ě'=>'Ě','ě'=>'ě','Ĝ'=>'Ĝ','ĝ'=>'ĝ','Ğ'=>'Ğ','ğ'=>'ğ','Ġ'=>'Ġ','ġ'=>'ġ','Ģ'=>'Ģ','ģ'=>'ģ','Ĥ'=>'Ĥ','ĥ'=>'ĥ','Ĩ'=>'Ĩ','ĩ'=>'ĩ','Ī'=>'Ī','ī'=>'ī','Ĭ'=>'Ĭ','ĭ'=>'ĭ','Į'=>'Į','į'=>'į','İ'=>'İ','IJ'=>'IJ','ij'=>'ij','Ĵ'=>'Ĵ','ĵ'=>'ĵ','Ķ'=>'Ķ','ķ'=>'ķ','Ĺ'=>'Ĺ','ĺ'=>'ĺ','Ļ'=>'Ļ','ļ'=>'ļ','Ľ'=>'Ľ','ľ'=>'ľ','Ŀ'=>'L·','ŀ'=>'l·','Ń'=>'Ń','ń'=>'ń','Ņ'=>'Ņ','ņ'=>'ņ','Ň'=>'Ň','ň'=>'ň','ʼn'=>'ʼn','Ō'=>'Ō','ō'=>'ō','Ŏ'=>'Ŏ','ŏ'=>'ŏ','Ő'=>'Ő','ő'=>'ő','Ŕ'=>'Ŕ','ŕ'=>'ŕ','Ŗ'=>'Ŗ','ŗ'=>'ŗ','Ř'=>'Ř','ř'=>'ř','Ś'=>'Ś','ś'=>'ś','Ŝ'=>'Ŝ','ŝ'=>'ŝ','Ş'=>'Ş','ş'=>'ş','Š'=>'Š','š'=>'š','Ţ'=>'Ţ','ţ'=>'ţ','Ť'=>'Ť','ť'=>'ť','Ũ'=>'Ũ','ũ'=>'ũ','Ū'=>'Ū','ū'=>'ū','Ŭ'=>'Ŭ','ŭ'=>'ŭ','Ů'=>'Ů','ů'=>'ů','Ű'=>'Ű','ű'=>'ű','Ų'=>'Ų','ų'=>'ų','Ŵ'=>'Ŵ','ŵ'=>'ŵ','Ŷ'=>'Ŷ','ŷ'=>'ŷ','Ÿ'=>'Ÿ','Ź'=>'Ź','ź'=>'ź','Ż'=>'Ż','ż'=>'ż','Ž'=>'Ž','ž'=>'ž','ſ'=>'s','Ơ'=>'Ơ','ơ'=>'ơ','Ư'=>'Ư','ư'=>'ư','DŽ'=>'DŽ','Dž'=>'Dž','dž'=>'dž','LJ'=>'LJ','Lj'=>'Lj','lj'=>'lj','NJ'=>'NJ','Nj'=>'Nj','nj'=>'nj','Ǎ'=>'Ǎ','ǎ'=>'ǎ','Ǐ'=>'Ǐ','ǐ'=>'ǐ','Ǒ'=>'Ǒ','ǒ'=>'ǒ','Ǔ'=>'Ǔ','ǔ'=>'ǔ','Ǖ'=>'Ǖ','ǖ'=>'ǖ','Ǘ'=>'Ǘ','ǘ'=>'ǘ','Ǚ'=>'Ǚ','ǚ'=>'ǚ','Ǜ'=>'Ǜ','ǜ'=>'ǜ','Ǟ'=>'Ǟ','ǟ'=>'ǟ','Ǡ'=>'Ǡ','ǡ'=>'ǡ','Ǣ'=>'Ǣ','ǣ'=>'ǣ','Ǧ'=>'Ǧ','ǧ'=>'ǧ','Ǩ'=>'Ǩ','ǩ'=>'ǩ','Ǫ'=>'Ǫ','ǫ'=>'ǫ','Ǭ'=>'Ǭ','ǭ'=>'ǭ','Ǯ'=>'Ǯ','ǯ'=>'ǯ','ǰ'=>'ǰ','DZ'=>'DZ','Dz'=>'Dz','dz'=>'dz','Ǵ'=>'Ǵ','ǵ'=>'ǵ','Ǹ'=>'Ǹ','ǹ'=>'ǹ','Ǻ'=>'Ǻ','ǻ'=>'ǻ','Ǽ'=>'Ǽ','ǽ'=>'ǽ','Ǿ'=>'Ǿ','ǿ'=>'ǿ','Ȁ'=>'Ȁ','ȁ'=>'ȁ','Ȃ'=>'Ȃ','ȃ'=>'ȃ','Ȅ'=>'Ȅ','ȅ'=>'ȅ','Ȇ'=>'Ȇ','ȇ'=>'ȇ','Ȉ'=>'Ȉ','ȉ'=>'ȉ','Ȋ'=>'Ȋ','ȋ'=>'ȋ','Ȍ'=>'Ȍ','ȍ'=>'ȍ','Ȏ'=>'Ȏ','ȏ'=>'ȏ','Ȑ'=>'Ȑ','ȑ'=>'ȑ','Ȓ'=>'Ȓ','ȓ'=>'ȓ','Ȕ'=>'Ȕ','ȕ'=>'ȕ','Ȗ'=>'Ȗ','ȗ'=>'ȗ','Ș'=>'Ș','ș'=>'ș','Ț'=>'Ț','ț'=>'ț','Ȟ'=>'Ȟ','ȟ'=>'ȟ','Ȧ'=>'Ȧ','ȧ'=>'ȧ','Ȩ'=>'Ȩ','ȩ'=>'ȩ','Ȫ'=>'Ȫ','ȫ'=>'ȫ','Ȭ'=>'Ȭ','ȭ'=>'ȭ','Ȯ'=>'Ȯ','ȯ'=>'ȯ','Ȱ'=>'Ȱ','ȱ'=>'ȱ','Ȳ'=>'Ȳ','ȳ'=>'ȳ','ʰ'=>'h','ʱ'=>'ɦ','ʲ'=>'j','ʳ'=>'r','ʴ'=>'ɹ','ʵ'=>'ɻ','ʶ'=>'ʁ','ʷ'=>'w','ʸ'=>'y','˘'=>' ̆','˙'=>' ̇','˚'=>' ̊','˛'=>' ̨','˜'=>' ̃','˝'=>' ̋','ˠ'=>'ɣ','ˡ'=>'l','ˢ'=>'s','ˣ'=>'x','ˤ'=>'ʕ','̀'=>'̀','́'=>'́','̓'=>'̓','̈́'=>'̈́','ʹ'=>'ʹ','ͺ'=>' ͅ',';'=>';','΄'=>' ́','΅'=>' ̈́','Ά'=>'Ά','·'=>'·','Έ'=>'Έ','Ή'=>'Ή','Ί'=>'Ί','Ό'=>'Ό','Ύ'=>'Ύ','Ώ'=>'Ώ','ΐ'=>'ΐ','Ϊ'=>'Ϊ','Ϋ'=>'Ϋ','ά'=>'ά','έ'=>'έ','ή'=>'ή','ί'=>'ί','ΰ'=>'ΰ','ϊ'=>'ϊ','ϋ'=>'ϋ','ό'=>'ό','ύ'=>'ύ','ώ'=>'ώ','ϐ'=>'β','ϑ'=>'θ','ϒ'=>'Υ','ϓ'=>'Ύ','ϔ'=>'Ϋ','ϕ'=>'φ','ϖ'=>'π','ϰ'=>'κ','ϱ'=>'ρ','ϲ'=>'ς','ϴ'=>'Θ','ϵ'=>'ε','Ϲ'=>'Σ','Ѐ'=>'Ѐ','Ё'=>'Ё','Ѓ'=>'Ѓ','Ї'=>'Ї','Ќ'=>'Ќ','Ѝ'=>'Ѝ','Ў'=>'Ў','Й'=>'Й','й'=>'й','ѐ'=>'ѐ','ё'=>'ё','ѓ'=>'ѓ','ї'=>'ї','ќ'=>'ќ','ѝ'=>'ѝ','ў'=>'ў','Ѷ'=>'Ѷ','ѷ'=>'ѷ','Ӂ'=>'Ӂ','ӂ'=>'ӂ','Ӑ'=>'Ӑ','ӑ'=>'ӑ','Ӓ'=>'Ӓ','ӓ'=>'ӓ','Ӗ'=>'Ӗ','ӗ'=>'ӗ','Ӛ'=>'Ӛ','ӛ'=>'ӛ','Ӝ'=>'Ӝ','ӝ'=>'ӝ','Ӟ'=>'Ӟ','ӟ'=>'ӟ','Ӣ'=>'Ӣ','ӣ'=>'ӣ','Ӥ'=>'Ӥ','ӥ'=>'ӥ','Ӧ'=>'Ӧ','ӧ'=>'ӧ','Ӫ'=>'Ӫ','ӫ'=>'ӫ','Ӭ'=>'Ӭ','ӭ'=>'ӭ','Ӯ'=>'Ӯ','ӯ'=>'ӯ','Ӱ'=>'Ӱ','ӱ'=>'ӱ','Ӳ'=>'Ӳ','ӳ'=>'ӳ','Ӵ'=>'Ӵ','ӵ'=>'ӵ','Ӹ'=>'Ӹ','ӹ'=>'ӹ','և'=>'եւ','آ'=>'آ','أ'=>'أ','ؤ'=>'ؤ','إ'=>'إ','ئ'=>'ئ','ٵ'=>'اٴ','ٶ'=>'وٴ','ٷ'=>'ۇٴ','ٸ'=>'يٴ','ۀ'=>'ۀ','ۂ'=>'ۂ','ۓ'=>'ۓ','ऩ'=>'ऩ','ऱ'=>'ऱ','ऴ'=>'ऴ','क़'=>'क़','ख़'=>'ख़','ग़'=>'ग़','ज़'=>'ज़','ड़'=>'ड़','ढ़'=>'ढ़','फ़'=>'फ़','य़'=>'य़','ো'=>'ো','ৌ'=>'ৌ','ড়'=>'ড়','ঢ়'=>'ঢ়','য়'=>'য়','ਲ਼'=>'ਲ਼','ਸ਼'=>'ਸ਼','ਖ਼'=>'ਖ਼','ਗ਼'=>'ਗ਼','ਜ਼'=>'ਜ਼','ਫ਼'=>'ਫ਼','ୈ'=>'ୈ','ୋ'=>'ୋ','ୌ'=>'ୌ','ଡ଼'=>'ଡ଼','ଢ଼'=>'ଢ଼','ஔ'=>'ஔ','ொ'=>'ொ','ோ'=>'ோ','ௌ'=>'ௌ','ై'=>'ై','ೀ'=>'ೀ','ೇ'=>'ೇ','ೈ'=>'ೈ','ೊ'=>'ೊ','ೋ'=>'ೋ','ൊ'=>'ൊ','ോ'=>'ോ','ൌ'=>'ൌ','ේ'=>'ේ','ො'=>'ො','ෝ'=>'ෝ','ෞ'=>'ෞ','ำ'=>'ํา','ຳ'=>'ໍາ','ໜ'=>'ຫນ','ໝ'=>'ຫມ','༌'=>'་','གྷ'=>'གྷ','ཌྷ'=>'ཌྷ','དྷ'=>'དྷ','བྷ'=>'བྷ','ཛྷ'=>'ཛྷ','ཀྵ'=>'ཀྵ','ཱི'=>'ཱི','ཱུ'=>'ཱུ','ྲྀ'=>'ྲྀ','ཷ'=>'ྲཱྀ','ླྀ'=>'ླྀ','ཹ'=>'ླཱྀ','ཱྀ'=>'ཱྀ','ྒྷ'=>'ྒྷ','ྜྷ'=>'ྜྷ','ྡྷ'=>'ྡྷ','ྦྷ'=>'ྦྷ','ྫྷ'=>'ྫྷ','ྐྵ'=>'ྐྵ','ဦ'=>'ဦ','ჼ'=>'ნ','ᬆ'=>'ᬆ','ᬈ'=>'ᬈ','ᬊ'=>'ᬊ','ᬌ'=>'ᬌ','ᬎ'=>'ᬎ','ᬒ'=>'ᬒ','ᬻ'=>'ᬻ','ᬽ'=>'ᬽ','ᭀ'=>'ᭀ','ᭁ'=>'ᭁ','ᭃ'=>'ᭃ','ᴬ'=>'A','ᴭ'=>'Æ','ᴮ'=>'B','ᴰ'=>'D','ᴱ'=>'E','ᴲ'=>'Ǝ','ᴳ'=>'G','ᴴ'=>'H','ᴵ'=>'I','ᴶ'=>'J','ᴷ'=>'K','ᴸ'=>'L','ᴹ'=>'M','ᴺ'=>'N','ᴼ'=>'O','ᴽ'=>'Ȣ','ᴾ'=>'P','ᴿ'=>'R','ᵀ'=>'T','ᵁ'=>'U','ᵂ'=>'W','ᵃ'=>'a','ᵄ'=>'ɐ','ᵅ'=>'ɑ','ᵆ'=>'ᴂ','ᵇ'=>'b','ᵈ'=>'d','ᵉ'=>'e','ᵊ'=>'ə','ᵋ'=>'ɛ','ᵌ'=>'ɜ','ᵍ'=>'g','ᵏ'=>'k','ᵐ'=>'m','ᵑ'=>'ŋ','ᵒ'=>'o','ᵓ'=>'ɔ','ᵔ'=>'ᴖ','ᵕ'=>'ᴗ','ᵖ'=>'p','ᵗ'=>'t','ᵘ'=>'u','ᵙ'=>'ᴝ','ᵚ'=>'ɯ','ᵛ'=>'v','ᵜ'=>'ᴥ','ᵝ'=>'β','ᵞ'=>'γ','ᵟ'=>'δ','ᵠ'=>'φ','ᵡ'=>'χ','ᵢ'=>'i','ᵣ'=>'r','ᵤ'=>'u','ᵥ'=>'v','ᵦ'=>'β','ᵧ'=>'γ','ᵨ'=>'ρ','ᵩ'=>'φ','ᵪ'=>'χ','ᵸ'=>'н','ᶛ'=>'ɒ','ᶜ'=>'c','ᶝ'=>'ɕ','ᶞ'=>'ð','ᶟ'=>'ɜ','ᶠ'=>'f','ᶡ'=>'ɟ','ᶢ'=>'ɡ','ᶣ'=>'ɥ','ᶤ'=>'ɨ','ᶥ'=>'ɩ','ᶦ'=>'ɪ','ᶧ'=>'ᵻ','ᶨ'=>'ʝ','ᶩ'=>'ɭ','ᶪ'=>'ᶅ','ᶫ'=>'ʟ','ᶬ'=>'ɱ','ᶭ'=>'ɰ','ᶮ'=>'ɲ','ᶯ'=>'ɳ','ᶰ'=>'ɴ','ᶱ'=>'ɵ','ᶲ'=>'ɸ','ᶳ'=>'ʂ','ᶴ'=>'ʃ','ᶵ'=>'ƫ','ᶶ'=>'ʉ','ᶷ'=>'ʊ','ᶸ'=>'ᴜ','ᶹ'=>'ʋ','ᶺ'=>'ʌ','ᶻ'=>'z','ᶼ'=>'ʐ','ᶽ'=>'ʑ','ᶾ'=>'ʒ','ᶿ'=>'θ','Ḁ'=>'Ḁ','ḁ'=>'ḁ','Ḃ'=>'Ḃ','ḃ'=>'ḃ','Ḅ'=>'Ḅ','ḅ'=>'ḅ','Ḇ'=>'Ḇ','ḇ'=>'ḇ','Ḉ'=>'Ḉ','ḉ'=>'ḉ','Ḋ'=>'Ḋ','ḋ'=>'ḋ','Ḍ'=>'Ḍ','ḍ'=>'ḍ','Ḏ'=>'Ḏ','ḏ'=>'ḏ','Ḑ'=>'Ḑ','ḑ'=>'ḑ','Ḓ'=>'Ḓ','ḓ'=>'ḓ','Ḕ'=>'Ḕ','ḕ'=>'ḕ','Ḗ'=>'Ḗ','ḗ'=>'ḗ','Ḙ'=>'Ḙ','ḙ'=>'ḙ','Ḛ'=>'Ḛ','ḛ'=>'ḛ','Ḝ'=>'Ḝ','ḝ'=>'ḝ','Ḟ'=>'Ḟ','ḟ'=>'ḟ','Ḡ'=>'Ḡ','ḡ'=>'ḡ','Ḣ'=>'Ḣ','ḣ'=>'ḣ','Ḥ'=>'Ḥ','ḥ'=>'ḥ','Ḧ'=>'Ḧ','ḧ'=>'ḧ','Ḩ'=>'Ḩ','ḩ'=>'ḩ','Ḫ'=>'Ḫ','ḫ'=>'ḫ','Ḭ'=>'Ḭ','ḭ'=>'ḭ','Ḯ'=>'Ḯ','ḯ'=>'ḯ','Ḱ'=>'Ḱ','ḱ'=>'ḱ','Ḳ'=>'Ḳ','ḳ'=>'ḳ','Ḵ'=>'Ḵ','ḵ'=>'ḵ','Ḷ'=>'Ḷ','ḷ'=>'ḷ','Ḹ'=>'Ḹ','ḹ'=>'ḹ','Ḻ'=>'Ḻ','ḻ'=>'ḻ','Ḽ'=>'Ḽ','ḽ'=>'ḽ','Ḿ'=>'Ḿ','ḿ'=>'ḿ','Ṁ'=>'Ṁ','ṁ'=>'ṁ','Ṃ'=>'Ṃ','ṃ'=>'ṃ','Ṅ'=>'Ṅ','ṅ'=>'ṅ','Ṇ'=>'Ṇ','ṇ'=>'ṇ','Ṉ'=>'Ṉ','ṉ'=>'ṉ','Ṋ'=>'Ṋ','ṋ'=>'ṋ','Ṍ'=>'Ṍ','ṍ'=>'ṍ','Ṏ'=>'Ṏ','ṏ'=>'ṏ','Ṑ'=>'Ṑ','ṑ'=>'ṑ','Ṓ'=>'Ṓ','ṓ'=>'ṓ','Ṕ'=>'Ṕ','ṕ'=>'ṕ','Ṗ'=>'Ṗ','ṗ'=>'ṗ','Ṙ'=>'Ṙ','ṙ'=>'ṙ','Ṛ'=>'Ṛ','ṛ'=>'ṛ','Ṝ'=>'Ṝ','ṝ'=>'ṝ','Ṟ'=>'Ṟ','ṟ'=>'ṟ','Ṡ'=>'Ṡ','ṡ'=>'ṡ','Ṣ'=>'Ṣ','ṣ'=>'ṣ','Ṥ'=>'Ṥ','ṥ'=>'ṥ','Ṧ'=>'Ṧ','ṧ'=>'ṧ','Ṩ'=>'Ṩ','ṩ'=>'ṩ','Ṫ'=>'Ṫ','ṫ'=>'ṫ','Ṭ'=>'Ṭ','ṭ'=>'ṭ','Ṯ'=>'Ṯ','ṯ'=>'ṯ','Ṱ'=>'Ṱ','ṱ'=>'ṱ','Ṳ'=>'Ṳ','ṳ'=>'ṳ','Ṵ'=>'Ṵ','ṵ'=>'ṵ','Ṷ'=>'Ṷ','ṷ'=>'ṷ','Ṹ'=>'Ṹ','ṹ'=>'ṹ','Ṻ'=>'Ṻ','ṻ'=>'ṻ','Ṽ'=>'Ṽ','ṽ'=>'ṽ','Ṿ'=>'Ṿ','ṿ'=>'ṿ','Ẁ'=>'Ẁ','ẁ'=>'ẁ','Ẃ'=>'Ẃ','ẃ'=>'ẃ','Ẅ'=>'Ẅ','ẅ'=>'ẅ','Ẇ'=>'Ẇ','ẇ'=>'ẇ','Ẉ'=>'Ẉ','ẉ'=>'ẉ','Ẋ'=>'Ẋ','ẋ'=>'ẋ','Ẍ'=>'Ẍ','ẍ'=>'ẍ','Ẏ'=>'Ẏ','ẏ'=>'ẏ','Ẑ'=>'Ẑ','ẑ'=>'ẑ','Ẓ'=>'Ẓ','ẓ'=>'ẓ','Ẕ'=>'Ẕ','ẕ'=>'ẕ','ẖ'=>'ẖ','ẗ'=>'ẗ','ẘ'=>'ẘ','ẙ'=>'ẙ','ẚ'=>'aʾ','ẛ'=>'ṡ','Ạ'=>'Ạ','ạ'=>'ạ','Ả'=>'Ả','ả'=>'ả','Ấ'=>'Ấ','ấ'=>'ấ','Ầ'=>'Ầ','ầ'=>'ầ','Ẩ'=>'Ẩ','ẩ'=>'ẩ','Ẫ'=>'Ẫ','ẫ'=>'ẫ','Ậ'=>'Ậ','ậ'=>'ậ','Ắ'=>'Ắ','ắ'=>'ắ','Ằ'=>'Ằ','ằ'=>'ằ','Ẳ'=>'Ẳ','ẳ'=>'ẳ','Ẵ'=>'Ẵ','ẵ'=>'ẵ','Ặ'=>'Ặ','ặ'=>'ặ','Ẹ'=>'Ẹ','ẹ'=>'ẹ','Ẻ'=>'Ẻ','ẻ'=>'ẻ','Ẽ'=>'Ẽ','ẽ'=>'ẽ','Ế'=>'Ế','ế'=>'ế','Ề'=>'Ề','ề'=>'ề','Ể'=>'Ể','ể'=>'ể','Ễ'=>'Ễ','ễ'=>'ễ','Ệ'=>'Ệ','ệ'=>'ệ','Ỉ'=>'Ỉ','ỉ'=>'ỉ','Ị'=>'Ị','ị'=>'ị','Ọ'=>'Ọ','ọ'=>'ọ','Ỏ'=>'Ỏ','ỏ'=>'ỏ','Ố'=>'Ố','ố'=>'ố','Ồ'=>'Ồ','ồ'=>'ồ','Ổ'=>'Ổ','ổ'=>'ổ','Ỗ'=>'Ỗ','ỗ'=>'ỗ','Ộ'=>'Ộ','ộ'=>'ộ','Ớ'=>'Ớ','ớ'=>'ớ','Ờ'=>'Ờ','ờ'=>'ờ','Ở'=>'Ở','ở'=>'ở','Ỡ'=>'Ỡ','ỡ'=>'ỡ','Ợ'=>'Ợ','ợ'=>'ợ','Ụ'=>'Ụ','ụ'=>'ụ','Ủ'=>'Ủ','ủ'=>'ủ','Ứ'=>'Ứ','ứ'=>'ứ','Ừ'=>'Ừ','ừ'=>'ừ','Ử'=>'Ử','ử'=>'ử','Ữ'=>'Ữ','ữ'=>'ữ','Ự'=>'Ự','ự'=>'ự','Ỳ'=>'Ỳ','ỳ'=>'ỳ','Ỵ'=>'Ỵ','ỵ'=>'ỵ','Ỷ'=>'Ỷ','ỷ'=>'ỷ','Ỹ'=>'Ỹ','ỹ'=>'ỹ','ἀ'=>'ἀ','ἁ'=>'ἁ','ἂ'=>'ἂ','ἃ'=>'ἃ','ἄ'=>'ἄ','ἅ'=>'ἅ','ἆ'=>'ἆ','ἇ'=>'ἇ','Ἀ'=>'Ἀ','Ἁ'=>'Ἁ','Ἂ'=>'Ἂ','Ἃ'=>'Ἃ','Ἄ'=>'Ἄ','Ἅ'=>'Ἅ','Ἆ'=>'Ἆ','Ἇ'=>'Ἇ','ἐ'=>'ἐ','ἑ'=>'ἑ','ἒ'=>'ἒ','ἓ'=>'ἓ','ἔ'=>'ἔ','ἕ'=>'ἕ','Ἐ'=>'Ἐ','Ἑ'=>'Ἑ','Ἒ'=>'Ἒ','Ἓ'=>'Ἓ','Ἔ'=>'Ἔ','Ἕ'=>'Ἕ','ἠ'=>'ἠ','ἡ'=>'ἡ','ἢ'=>'ἢ','ἣ'=>'ἣ','ἤ'=>'ἤ','ἥ'=>'ἥ','ἦ'=>'ἦ','ἧ'=>'ἧ','Ἠ'=>'Ἠ','Ἡ'=>'Ἡ','Ἢ'=>'Ἢ','Ἣ'=>'Ἣ','Ἤ'=>'Ἤ','Ἥ'=>'Ἥ','Ἦ'=>'Ἦ','Ἧ'=>'Ἧ','ἰ'=>'ἰ','ἱ'=>'ἱ','ἲ'=>'ἲ','ἳ'=>'ἳ','ἴ'=>'ἴ','ἵ'=>'ἵ','ἶ'=>'ἶ','ἷ'=>'ἷ','Ἰ'=>'Ἰ','Ἱ'=>'Ἱ','Ἲ'=>'Ἲ','Ἳ'=>'Ἳ','Ἴ'=>'Ἴ','Ἵ'=>'Ἵ','Ἶ'=>'Ἶ','Ἷ'=>'Ἷ','ὀ'=>'ὀ','ὁ'=>'ὁ','ὂ'=>'ὂ','ὃ'=>'ὃ','ὄ'=>'ὄ','ὅ'=>'ὅ','Ὀ'=>'Ὀ','Ὁ'=>'Ὁ','Ὂ'=>'Ὂ','Ὃ'=>'Ὃ','Ὄ'=>'Ὄ','Ὅ'=>'Ὅ','ὐ'=>'ὐ','ὑ'=>'ὑ','ὒ'=>'ὒ','ὓ'=>'ὓ','ὔ'=>'ὔ','ὕ'=>'ὕ','ὖ'=>'ὖ','ὗ'=>'ὗ','Ὑ'=>'Ὑ','Ὓ'=>'Ὓ','Ὕ'=>'Ὕ','Ὗ'=>'Ὗ','ὠ'=>'ὠ','ὡ'=>'ὡ','ὢ'=>'ὢ','ὣ'=>'ὣ','ὤ'=>'ὤ','ὥ'=>'ὥ','ὦ'=>'ὦ','ὧ'=>'ὧ','Ὠ'=>'Ὠ','Ὡ'=>'Ὡ','Ὢ'=>'Ὢ','Ὣ'=>'Ὣ','Ὤ'=>'Ὤ','Ὥ'=>'Ὥ','Ὦ'=>'Ὦ','Ὧ'=>'Ὧ','ὰ'=>'ὰ','ά'=>'ά','ὲ'=>'ὲ','έ'=>'έ','ὴ'=>'ὴ','ή'=>'ή','ὶ'=>'ὶ','ί'=>'ί','ὸ'=>'ὸ','ό'=>'ό','ὺ'=>'ὺ','ύ'=>'ύ','ὼ'=>'ὼ','ώ'=>'ώ','ᾀ'=>'ᾀ','ᾁ'=>'ᾁ','ᾂ'=>'ᾂ','ᾃ'=>'ᾃ','ᾄ'=>'ᾄ','ᾅ'=>'ᾅ','ᾆ'=>'ᾆ','ᾇ'=>'ᾇ','ᾈ'=>'ᾈ','ᾉ'=>'ᾉ','ᾊ'=>'ᾊ','ᾋ'=>'ᾋ','ᾌ'=>'ᾌ','ᾍ'=>'ᾍ','ᾎ'=>'ᾎ','ᾏ'=>'ᾏ','ᾐ'=>'ᾐ','ᾑ'=>'ᾑ','ᾒ'=>'ᾒ','ᾓ'=>'ᾓ','ᾔ'=>'ᾔ','ᾕ'=>'ᾕ','ᾖ'=>'ᾖ','ᾗ'=>'ᾗ','ᾘ'=>'ᾘ','ᾙ'=>'ᾙ','ᾚ'=>'ᾚ','ᾛ'=>'ᾛ','ᾜ'=>'ᾜ','ᾝ'=>'ᾝ','ᾞ'=>'ᾞ','ᾟ'=>'ᾟ','ᾠ'=>'ᾠ','ᾡ'=>'ᾡ','ᾢ'=>'ᾢ','ᾣ'=>'ᾣ','ᾤ'=>'ᾤ','ᾥ'=>'ᾥ','ᾦ'=>'ᾦ','ᾧ'=>'ᾧ','ᾨ'=>'ᾨ','ᾩ'=>'ᾩ','ᾪ'=>'ᾪ','ᾫ'=>'ᾫ','ᾬ'=>'ᾬ','ᾭ'=>'ᾭ','ᾮ'=>'ᾮ','ᾯ'=>'ᾯ','ᾰ'=>'ᾰ','ᾱ'=>'ᾱ','ᾲ'=>'ᾲ','ᾳ'=>'ᾳ','ᾴ'=>'ᾴ','ᾶ'=>'ᾶ','ᾷ'=>'ᾷ','Ᾰ'=>'Ᾰ','Ᾱ'=>'Ᾱ','Ὰ'=>'Ὰ','Ά'=>'Ά','ᾼ'=>'ᾼ','᾽'=>' ̓','ι'=>'ι','᾿'=>' ̓','῀'=>' ͂','῁'=>' ̈͂','ῂ'=>'ῂ','ῃ'=>'ῃ','ῄ'=>'ῄ','ῆ'=>'ῆ','ῇ'=>'ῇ','Ὲ'=>'Ὲ','Έ'=>'Έ','Ὴ'=>'Ὴ','Ή'=>'Ή','ῌ'=>'ῌ','῍'=>' ̓̀','῎'=>' ̓́','῏'=>' ̓͂','ῐ'=>'ῐ','ῑ'=>'ῑ','ῒ'=>'ῒ','ΐ'=>'ΐ','ῖ'=>'ῖ','ῗ'=>'ῗ','Ῐ'=>'Ῐ','Ῑ'=>'Ῑ','Ὶ'=>'Ὶ','Ί'=>'Ί','῝'=>' ̔̀','῞'=>' ̔́','῟'=>' ̔͂','ῠ'=>'ῠ','ῡ'=>'ῡ','ῢ'=>'ῢ','ΰ'=>'ΰ','ῤ'=>'ῤ','ῥ'=>'ῥ','ῦ'=>'ῦ','ῧ'=>'ῧ','Ῠ'=>'Ῠ','Ῡ'=>'Ῡ','Ὺ'=>'Ὺ','Ύ'=>'Ύ','Ῥ'=>'Ῥ','῭'=>' ̈̀','΅'=>' ̈́','`'=>'`','ῲ'=>'ῲ','ῳ'=>'ῳ','ῴ'=>'ῴ','ῶ'=>'ῶ','ῷ'=>'ῷ','Ὸ'=>'Ὸ','Ό'=>'Ό','Ὼ'=>'Ὼ','Ώ'=>'Ώ','ῼ'=>'ῼ','´'=>' ́','῾'=>' ̔',' '=>' ',' '=>' ',' '=>' ',' '=>' ',' '=>' ',' '=>' ',' '=>' ',' '=>' ',' '=>' ',' '=>' ',' '=>' ','‑'=>'‐','‗'=>' ̳','․'=>'.','‥'=>'..','…'=>'...',' '=>' ','″'=>'′′','‴'=>'′′′','‶'=>'‵‵','‷'=>'‵‵‵','‼'=>'!!','‾'=>' ̅','⁇'=>'??','⁈'=>'?!','⁉'=>'!?','⁗'=>'′′′′',' '=>' ','⁰'=>'0','ⁱ'=>'i','⁴'=>'4','⁵'=>'5','⁶'=>'6','⁷'=>'7','⁸'=>'8','⁹'=>'9','⁺'=>'+','⁻'=>'−','⁼'=>'=','⁽'=>'(','⁾'=>')','ⁿ'=>'n','₀'=>'0','₁'=>'1','₂'=>'2','₃'=>'3','₄'=>'4','₅'=>'5','₆'=>'6','₇'=>'7','₈'=>'8','₉'=>'9','₊'=>'+','₋'=>'−','₌'=>'=','₍'=>'(','₎'=>')','ₐ'=>'a','ₑ'=>'e','ₒ'=>'o','ₓ'=>'x','ₔ'=>'ə','₨'=>'Rs','℀'=>'a/c','℁'=>'a/s','ℂ'=>'C','℃'=>'°C','℅'=>'c/o','℆'=>'c/u','ℇ'=>'Ɛ','℉'=>'°F','ℊ'=>'g','ℋ'=>'H','ℌ'=>'H','ℍ'=>'H','ℎ'=>'h','ℏ'=>'ħ','ℐ'=>'I','ℑ'=>'I','ℒ'=>'L','ℓ'=>'l','ℕ'=>'N','№'=>'No','ℙ'=>'P','ℚ'=>'Q','ℛ'=>'R','ℜ'=>'R','ℝ'=>'R','℠'=>'SM','℡'=>'TEL','™'=>'TM','ℤ'=>'Z','Ω'=>'Ω','ℨ'=>'Z','K'=>'K','Å'=>'Å','ℬ'=>'B','ℭ'=>'C','ℯ'=>'e','ℰ'=>'E','ℱ'=>'F','ℳ'=>'M','ℴ'=>'o','ℵ'=>'א','ℶ'=>'ב','ℷ'=>'ג','ℸ'=>'ד','ℹ'=>'i','℻'=>'FAX','ℼ'=>'π','ℽ'=>'γ','ℾ'=>'Γ','ℿ'=>'Π','⅀'=>'∑','ⅅ'=>'D','ⅆ'=>'d','ⅇ'=>'e','ⅈ'=>'i','ⅉ'=>'j','⅓'=>'1⁄3','⅔'=>'2⁄3','⅕'=>'1⁄5','⅖'=>'2⁄5','⅗'=>'3⁄5','⅘'=>'4⁄5','⅙'=>'1⁄6','⅚'=>'5⁄6','⅛'=>'1⁄8','⅜'=>'3⁄8','⅝'=>'5⁄8','⅞'=>'7⁄8','⅟'=>'1⁄','Ⅰ'=>'I','Ⅱ'=>'II','Ⅲ'=>'III','Ⅳ'=>'IV','Ⅴ'=>'V','Ⅵ'=>'VI','Ⅶ'=>'VII','Ⅷ'=>'VIII','Ⅸ'=>'IX','Ⅹ'=>'X','Ⅺ'=>'XI','Ⅻ'=>'XII','Ⅼ'=>'L','Ⅽ'=>'C','Ⅾ'=>'D','Ⅿ'=>'M','ⅰ'=>'i','ⅱ'=>'ii','ⅲ'=>'iii','ⅳ'=>'iv','ⅴ'=>'v','ⅵ'=>'vi','ⅶ'=>'vii','ⅷ'=>'viii','ⅸ'=>'ix','ⅹ'=>'x','ⅺ'=>'xi','ⅻ'=>'xii','ⅼ'=>'l','ⅽ'=>'c','ⅾ'=>'d','ⅿ'=>'m','↚'=>'↚','↛'=>'↛','↮'=>'↮','⇍'=>'⇍','⇎'=>'⇎','⇏'=>'⇏','∄'=>'∄','∉'=>'∉','∌'=>'∌','∤'=>'∤','∦'=>'∦','∬'=>'∫∫','∭'=>'∫∫∫','∯'=>'∮∮','∰'=>'∮∮∮','≁'=>'≁','≄'=>'≄','≇'=>'≇','≉'=>'≉','≠'=>'≠','≢'=>'≢','≭'=>'≭','≮'=>'≮','≯'=>'≯','≰'=>'≰','≱'=>'≱','≴'=>'≴','≵'=>'≵','≸'=>'≸','≹'=>'≹','⊀'=>'⊀','⊁'=>'⊁','⊄'=>'⊄','⊅'=>'⊅','⊈'=>'⊈','⊉'=>'⊉','⊬'=>'⊬','⊭'=>'⊭','⊮'=>'⊮','⊯'=>'⊯','⋠'=>'⋠','⋡'=>'⋡','⋢'=>'⋢','⋣'=>'⋣','⋪'=>'⋪','⋫'=>'⋫','⋬'=>'⋬','⋭'=>'⋭','〈'=>'〈','〉'=>'〉','①'=>'1','②'=>'2','③'=>'3','④'=>'4','⑤'=>'5','⑥'=>'6','⑦'=>'7','⑧'=>'8','⑨'=>'9','⑩'=>'10','⑪'=>'11','⑫'=>'12','⑬'=>'13','⑭'=>'14','⑮'=>'15','⑯'=>'16','⑰'=>'17','⑱'=>'18','⑲'=>'19','⑳'=>'20','⑴'=>'(1)','⑵'=>'(2)','⑶'=>'(3)','⑷'=>'(4)','⑸'=>'(5)','⑹'=>'(6)','⑺'=>'(7)','⑻'=>'(8)','⑼'=>'(9)','⑽'=>'(10)','⑾'=>'(11)','⑿'=>'(12)','⒀'=>'(13)','⒁'=>'(14)','⒂'=>'(15)','⒃'=>'(16)','⒄'=>'(17)','⒅'=>'(18)','⒆'=>'(19)','⒇'=>'(20)','⒈'=>'1.','⒉'=>'2.','⒊'=>'3.','⒋'=>'4.','⒌'=>'5.','⒍'=>'6.','⒎'=>'7.','⒏'=>'8.','⒐'=>'9.','⒑'=>'10.','⒒'=>'11.','⒓'=>'12.','⒔'=>'13.','⒕'=>'14.','⒖'=>'15.','⒗'=>'16.','⒘'=>'17.','⒙'=>'18.','⒚'=>'19.','⒛'=>'20.','⒜'=>'(a)','⒝'=>'(b)','⒞'=>'(c)','⒟'=>'(d)','⒠'=>'(e)','⒡'=>'(f)','⒢'=>'(g)','⒣'=>'(h)','⒤'=>'(i)','⒥'=>'(j)','⒦'=>'(k)','⒧'=>'(l)','⒨'=>'(m)','⒩'=>'(n)','⒪'=>'(o)','⒫'=>'(p)','⒬'=>'(q)','⒭'=>'(r)','⒮'=>'(s)','⒯'=>'(t)','⒰'=>'(u)','⒱'=>'(v)','⒲'=>'(w)','⒳'=>'(x)','⒴'=>'(y)','⒵'=>'(z)','Ⓐ'=>'A','Ⓑ'=>'B','Ⓒ'=>'C','Ⓓ'=>'D','Ⓔ'=>'E','Ⓕ'=>'F','Ⓖ'=>'G','Ⓗ'=>'H','Ⓘ'=>'I','Ⓙ'=>'J','Ⓚ'=>'K','Ⓛ'=>'L','Ⓜ'=>'M','Ⓝ'=>'N','Ⓞ'=>'O','Ⓟ'=>'P','Ⓠ'=>'Q','Ⓡ'=>'R','Ⓢ'=>'S','Ⓣ'=>'T','Ⓤ'=>'U','Ⓥ'=>'V','Ⓦ'=>'W','Ⓧ'=>'X','Ⓨ'=>'Y','Ⓩ'=>'Z','ⓐ'=>'a','ⓑ'=>'b','ⓒ'=>'c','ⓓ'=>'d','ⓔ'=>'e','ⓕ'=>'f','ⓖ'=>'g','ⓗ'=>'h','ⓘ'=>'i','ⓙ'=>'j','ⓚ'=>'k','ⓛ'=>'l','ⓜ'=>'m','ⓝ'=>'n','ⓞ'=>'o','ⓟ'=>'p','ⓠ'=>'q','ⓡ'=>'r','ⓢ'=>'s','ⓣ'=>'t','ⓤ'=>'u','ⓥ'=>'v','ⓦ'=>'w','ⓧ'=>'x','ⓨ'=>'y','ⓩ'=>'z','⓪'=>'0','⨌'=>'∫∫∫∫','⩴'=>'::=','⩵'=>'==','⩶'=>'===','⫝̸'=>'⫝̸','ⵯ'=>'ⵡ','⺟'=>'母','⻳'=>'龟','⼀'=>'一','⼁'=>'丨','⼂'=>'丶','⼃'=>'丿','⼄'=>'乙','⼅'=>'亅','⼆'=>'二','⼇'=>'亠','⼈'=>'人','⼉'=>'儿','⼊'=>'入','⼋'=>'八','⼌'=>'冂','⼍'=>'冖','⼎'=>'冫','⼏'=>'几','⼐'=>'凵','⼑'=>'刀','⼒'=>'力','⼓'=>'勹','⼔'=>'匕','⼕'=>'匚','⼖'=>'匸','⼗'=>'十','⼘'=>'卜','⼙'=>'卩','⼚'=>'厂','⼛'=>'厶','⼜'=>'又','⼝'=>'口','⼞'=>'囗','⼟'=>'土','⼠'=>'士','⼡'=>'夂','⼢'=>'夊','⼣'=>'夕','⼤'=>'大','⼥'=>'女','⼦'=>'子','⼧'=>'宀','⼨'=>'寸','⼩'=>'小','⼪'=>'尢','⼫'=>'尸','⼬'=>'屮','⼭'=>'山','⼮'=>'巛','⼯'=>'工','⼰'=>'己','⼱'=>'巾','⼲'=>'干','⼳'=>'幺','⼴'=>'广','⼵'=>'廴','⼶'=>'廾','⼷'=>'弋','⼸'=>'弓','⼹'=>'彐','⼺'=>'彡','⼻'=>'彳','⼼'=>'心','⼽'=>'戈','⼾'=>'戶','⼿'=>'手','⽀'=>'支','⽁'=>'攴','⽂'=>'文','⽃'=>'斗','⽄'=>'斤','⽅'=>'方','⽆'=>'无','⽇'=>'日','⽈'=>'曰','⽉'=>'月','⽊'=>'木','⽋'=>'欠','⽌'=>'止','⽍'=>'歹','⽎'=>'殳','⽏'=>'毋','⽐'=>'比','⽑'=>'毛','⽒'=>'氏','⽓'=>'气','⽔'=>'水','⽕'=>'火','⽖'=>'爪','⽗'=>'父','⽘'=>'爻','⽙'=>'爿','⽚'=>'片','⽛'=>'牙','⽜'=>'牛','⽝'=>'犬','⽞'=>'玄','⽟'=>'玉','⽠'=>'瓜','⽡'=>'瓦','⽢'=>'甘','⽣'=>'生','⽤'=>'用','⽥'=>'田','⽦'=>'疋','⽧'=>'疒','⽨'=>'癶','⽩'=>'白','⽪'=>'皮','⽫'=>'皿','⽬'=>'目','⽭'=>'矛','⽮'=>'矢','⽯'=>'石','⽰'=>'示','⽱'=>'禸','⽲'=>'禾','⽳'=>'穴','⽴'=>'立','⽵'=>'竹','⽶'=>'米','⽷'=>'糸','⽸'=>'缶','⽹'=>'网','⽺'=>'羊','⽻'=>'羽','⽼'=>'老','⽽'=>'而','⽾'=>'耒','⽿'=>'耳','⾀'=>'聿','⾁'=>'肉','⾂'=>'臣','⾃'=>'自','⾄'=>'至','⾅'=>'臼','⾆'=>'舌','⾇'=>'舛','⾈'=>'舟','⾉'=>'艮','⾊'=>'色','⾋'=>'艸','⾌'=>'虍','⾍'=>'虫','⾎'=>'血','⾏'=>'行','⾐'=>'衣','⾑'=>'襾','⾒'=>'見','⾓'=>'角','⾔'=>'言','⾕'=>'谷','⾖'=>'豆','⾗'=>'豕','⾘'=>'豸','⾙'=>'貝','⾚'=>'赤','⾛'=>'走','⾜'=>'足','⾝'=>'身','⾞'=>'車','⾟'=>'辛','⾠'=>'辰','⾡'=>'辵','⾢'=>'邑','⾣'=>'酉','⾤'=>'釆','⾥'=>'里','⾦'=>'金','⾧'=>'長','⾨'=>'門','⾩'=>'阜','⾪'=>'隶','⾫'=>'隹','⾬'=>'雨','⾭'=>'靑','⾮'=>'非','⾯'=>'面','⾰'=>'革','⾱'=>'韋','⾲'=>'韭','⾳'=>'音','⾴'=>'頁','⾵'=>'風','⾶'=>'飛','⾷'=>'食','⾸'=>'首','⾹'=>'香','⾺'=>'馬','⾻'=>'骨','⾼'=>'高','⾽'=>'髟','⾾'=>'鬥','⾿'=>'鬯','⿀'=>'鬲','⿁'=>'鬼','⿂'=>'魚','⿃'=>'鳥','⿄'=>'鹵','⿅'=>'鹿','⿆'=>'麥','⿇'=>'麻','⿈'=>'黃','⿉'=>'黍','⿊'=>'黑','⿋'=>'黹','⿌'=>'黽','⿍'=>'鼎','⿎'=>'鼓','⿏'=>'鼠','⿐'=>'鼻','⿑'=>'齊','⿒'=>'齒','⿓'=>'龍','⿔'=>'龜','⿕'=>'龠',' '=>' ','〶'=>'〒','〸'=>'十','〹'=>'卄','〺'=>'卅','が'=>'が','ぎ'=>'ぎ','ぐ'=>'ぐ','げ'=>'げ','ご'=>'ご','ざ'=>'ざ','じ'=>'じ','ず'=>'ず','ぜ'=>'ぜ','ぞ'=>'ぞ','だ'=>'だ','ぢ'=>'ぢ','づ'=>'づ','で'=>'で','ど'=>'ど','ば'=>'ば','ぱ'=>'ぱ','び'=>'び','ぴ'=>'ぴ','ぶ'=>'ぶ','ぷ'=>'ぷ','べ'=>'べ','ぺ'=>'ぺ','ぼ'=>'ぼ','ぽ'=>'ぽ','ゔ'=>'ゔ','゛'=>' ゙','゜'=>' ゚','ゞ'=>'ゞ','ゟ'=>'より','ガ'=>'ガ','ギ'=>'ギ','グ'=>'グ','ゲ'=>'ゲ','ゴ'=>'ゴ','ザ'=>'ザ','ジ'=>'ジ','ズ'=>'ズ','ゼ'=>'ゼ','ゾ'=>'ゾ','ダ'=>'ダ','ヂ'=>'ヂ','ヅ'=>'ヅ','デ'=>'デ','ド'=>'ド','バ'=>'バ','パ'=>'パ','ビ'=>'ビ','ピ'=>'ピ','ブ'=>'ブ','プ'=>'プ','ベ'=>'ベ','ペ'=>'ペ','ボ'=>'ボ','ポ'=>'ポ','ヴ'=>'ヴ','ヷ'=>'ヷ','ヸ'=>'ヸ','ヹ'=>'ヹ','ヺ'=>'ヺ','ヾ'=>'ヾ','ヿ'=>'コト','ㄱ'=>'ᄀ','ㄲ'=>'ᄁ','ㄳ'=>'ᆪ','ㄴ'=>'ᄂ','ㄵ'=>'ᆬ','ㄶ'=>'ᆭ','ㄷ'=>'ᄃ','ㄸ'=>'ᄄ','ㄹ'=>'ᄅ','ㄺ'=>'ᆰ','ㄻ'=>'ᆱ','ㄼ'=>'ᆲ','ㄽ'=>'ᆳ','ㄾ'=>'ᆴ','ㄿ'=>'ᆵ','ㅀ'=>'ᄚ','ㅁ'=>'ᄆ','ㅂ'=>'ᄇ','ㅃ'=>'ᄈ','ㅄ'=>'ᄡ','ㅅ'=>'ᄉ','ㅆ'=>'ᄊ','ㅇ'=>'ᄋ','ㅈ'=>'ᄌ','ㅉ'=>'ᄍ','ㅊ'=>'ᄎ','ㅋ'=>'ᄏ','ㅌ'=>'ᄐ','ㅍ'=>'ᄑ','ㅎ'=>'ᄒ','ㅏ'=>'ᅡ','ㅐ'=>'ᅢ','ㅑ'=>'ᅣ','ㅒ'=>'ᅤ','ㅓ'=>'ᅥ','ㅔ'=>'ᅦ','ㅕ'=>'ᅧ','ㅖ'=>'ᅨ','ㅗ'=>'ᅩ','ㅘ'=>'ᅪ','ㅙ'=>'ᅫ','ㅚ'=>'ᅬ','ㅛ'=>'ᅭ','ㅜ'=>'ᅮ','ㅝ'=>'ᅯ','ㅞ'=>'ᅰ','ㅟ'=>'ᅱ','ㅠ'=>'ᅲ','ㅡ'=>'ᅳ','ㅢ'=>'ᅴ','ㅣ'=>'ᅵ','ㅤ'=>'ᅠ','ㅥ'=>'ᄔ','ㅦ'=>'ᄕ','ㅧ'=>'ᇇ','ㅨ'=>'ᇈ','ㅩ'=>'ᇌ','ㅪ'=>'ᇎ','ㅫ'=>'ᇓ','ㅬ'=>'ᇗ','ㅭ'=>'ᇙ','ㅮ'=>'ᄜ','ㅯ'=>'ᇝ','ㅰ'=>'ᇟ','ㅱ'=>'ᄝ','ㅲ'=>'ᄞ','ㅳ'=>'ᄠ','ㅴ'=>'ᄢ','ㅵ'=>'ᄣ','ㅶ'=>'ᄧ','ㅷ'=>'ᄩ','ㅸ'=>'ᄫ','ㅹ'=>'ᄬ','ㅺ'=>'ᄭ','ㅻ'=>'ᄮ','ㅼ'=>'ᄯ','ㅽ'=>'ᄲ','ㅾ'=>'ᄶ','ㅿ'=>'ᅀ','ㆀ'=>'ᅇ','ㆁ'=>'ᅌ','ㆂ'=>'ᇱ','ㆃ'=>'ᇲ','ㆄ'=>'ᅗ','ㆅ'=>'ᅘ','ㆆ'=>'ᅙ','ㆇ'=>'ᆄ','ㆈ'=>'ᆅ','ㆉ'=>'ᆈ','ㆊ'=>'ᆑ','ㆋ'=>'ᆒ','ㆌ'=>'ᆔ','ㆍ'=>'ᆞ','ㆎ'=>'ᆡ','㆒'=>'一','㆓'=>'二','㆔'=>'三','㆕'=>'四','㆖'=>'上','㆗'=>'中','㆘'=>'下','㆙'=>'甲','㆚'=>'乙','㆛'=>'丙','㆜'=>'丁','㆝'=>'天','㆞'=>'地','㆟'=>'人','㈀'=>'(ᄀ)','㈁'=>'(ᄂ)','㈂'=>'(ᄃ)','㈃'=>'(ᄅ)','㈄'=>'(ᄆ)','㈅'=>'(ᄇ)','㈆'=>'(ᄉ)','㈇'=>'(ᄋ)','㈈'=>'(ᄌ)','㈉'=>'(ᄎ)','㈊'=>'(ᄏ)','㈋'=>'(ᄐ)','㈌'=>'(ᄑ)','㈍'=>'(ᄒ)','㈎'=>'(가)','㈏'=>'(나)','㈐'=>'(다)','㈑'=>'(라)','㈒'=>'(마)','㈓'=>'(바)','㈔'=>'(사)','㈕'=>'(아)','㈖'=>'(자)','㈗'=>'(차)','㈘'=>'(카)','㈙'=>'(타)','㈚'=>'(파)','㈛'=>'(하)','㈜'=>'(주)','㈝'=>'(오전)','㈞'=>'(오후)','㈠'=>'(一)','㈡'=>'(二)','㈢'=>'(三)','㈣'=>'(四)','㈤'=>'(五)','㈥'=>'(六)','㈦'=>'(七)','㈧'=>'(八)','㈨'=>'(九)','㈩'=>'(十)','㈪'=>'(月)','㈫'=>'(火)','㈬'=>'(水)','㈭'=>'(木)','㈮'=>'(金)','㈯'=>'(土)','㈰'=>'(日)','㈱'=>'(株)','㈲'=>'(有)','㈳'=>'(社)','㈴'=>'(名)','㈵'=>'(特)','㈶'=>'(財)','㈷'=>'(祝)','㈸'=>'(労)','㈹'=>'(代)','㈺'=>'(呼)','㈻'=>'(学)','㈼'=>'(監)','㈽'=>'(企)','㈾'=>'(資)','㈿'=>'(協)','㉀'=>'(祭)','㉁'=>'(休)','㉂'=>'(自)','㉃'=>'(至)','㉐'=>'PTE','㉑'=>'21','㉒'=>'22','㉓'=>'23','㉔'=>'24','㉕'=>'25','㉖'=>'26','㉗'=>'27','㉘'=>'28','㉙'=>'29','㉚'=>'30','㉛'=>'31','㉜'=>'32','㉝'=>'33','㉞'=>'34','㉟'=>'35','㉠'=>'ᄀ','㉡'=>'ᄂ','㉢'=>'ᄃ','㉣'=>'ᄅ','㉤'=>'ᄆ','㉥'=>'ᄇ','㉦'=>'ᄉ','㉧'=>'ᄋ','㉨'=>'ᄌ','㉩'=>'ᄎ','㉪'=>'ᄏ','㉫'=>'ᄐ','㉬'=>'ᄑ','㉭'=>'ᄒ','㉮'=>'가','㉯'=>'나','㉰'=>'다','㉱'=>'라','㉲'=>'마','㉳'=>'바','㉴'=>'사','㉵'=>'아','㉶'=>'자','㉷'=>'차','㉸'=>'카','㉹'=>'타','㉺'=>'파','㉻'=>'하','㉼'=>'참고','㉽'=>'주의','㉾'=>'우','㊀'=>'一','㊁'=>'二','㊂'=>'三','㊃'=>'四','㊄'=>'五','㊅'=>'六','㊆'=>'七','㊇'=>'八','㊈'=>'九','㊉'=>'十','㊊'=>'月','㊋'=>'火','㊌'=>'水','㊍'=>'木','㊎'=>'金','㊏'=>'土','㊐'=>'日','㊑'=>'株','㊒'=>'有','㊓'=>'社','㊔'=>'名','㊕'=>'特','㊖'=>'財','㊗'=>'祝','㊘'=>'労','㊙'=>'秘','㊚'=>'男','㊛'=>'女','㊜'=>'適','㊝'=>'優','㊞'=>'印','㊟'=>'注','㊠'=>'項','㊡'=>'休','㊢'=>'写','㊣'=>'正','㊤'=>'上','㊥'=>'中','㊦'=>'下','㊧'=>'左','㊨'=>'右','㊩'=>'医','㊪'=>'宗','㊫'=>'学','㊬'=>'監','㊭'=>'企','㊮'=>'資','㊯'=>'協','㊰'=>'夜','㊱'=>'36','㊲'=>'37','㊳'=>'38','㊴'=>'39','㊵'=>'40','㊶'=>'41','㊷'=>'42','㊸'=>'43','㊹'=>'44','㊺'=>'45','㊻'=>'46','㊼'=>'47','㊽'=>'48','㊾'=>'49','㊿'=>'50','㋀'=>'1月','㋁'=>'2月','㋂'=>'3月','㋃'=>'4月','㋄'=>'5月','㋅'=>'6月','㋆'=>'7月','㋇'=>'8月','㋈'=>'9月','㋉'=>'10月','㋊'=>'11月','㋋'=>'12月','㋌'=>'Hg','㋍'=>'erg','㋎'=>'eV','㋏'=>'LTD','㋐'=>'ア','㋑'=>'イ','㋒'=>'ウ','㋓'=>'エ','㋔'=>'オ','㋕'=>'カ','㋖'=>'キ','㋗'=>'ク','㋘'=>'ケ','㋙'=>'コ','㋚'=>'サ','㋛'=>'シ','㋜'=>'ス','㋝'=>'セ','㋞'=>'ソ','㋟'=>'タ','㋠'=>'チ','㋡'=>'ツ','㋢'=>'テ','㋣'=>'ト','㋤'=>'ナ','㋥'=>'ニ','㋦'=>'ヌ','㋧'=>'ネ','㋨'=>'ノ','㋩'=>'ハ','㋪'=>'ヒ','㋫'=>'フ','㋬'=>'ヘ','㋭'=>'ホ','㋮'=>'マ','㋯'=>'ミ','㋰'=>'ム','㋱'=>'メ','㋲'=>'モ','㋳'=>'ヤ','㋴'=>'ユ','㋵'=>'ヨ','㋶'=>'ラ','㋷'=>'リ','㋸'=>'ル','㋹'=>'レ','㋺'=>'ロ','㋻'=>'ワ','㋼'=>'ヰ','㋽'=>'ヱ','㋾'=>'ヲ','㌀'=>'アパート','㌁'=>'アルファ','㌂'=>'アンペア','㌃'=>'アール','㌄'=>'イニング','㌅'=>'インチ','㌆'=>'ウォン','㌇'=>'エスクード','㌈'=>'エーカー','㌉'=>'オンス','㌊'=>'オーム','㌋'=>'カイリ','㌌'=>'カラット','㌍'=>'カロリー','㌎'=>'ガロン','㌏'=>'ガンマ','㌐'=>'ギガ','㌑'=>'ギニー','㌒'=>'キュリー','㌓'=>'ギルダー','㌔'=>'キロ','㌕'=>'キログラム','㌖'=>'キロメートル','㌗'=>'キロワット','㌘'=>'グラム','㌙'=>'グラムトン','㌚'=>'クルゼイロ','㌛'=>'クローネ','㌜'=>'ケース','㌝'=>'コルナ','㌞'=>'コーポ','㌟'=>'サイクル','㌠'=>'サンチーム','㌡'=>'シリング','㌢'=>'センチ','㌣'=>'セント','㌤'=>'ダース','㌥'=>'デシ','㌦'=>'ドル','㌧'=>'トン','㌨'=>'ナノ','㌩'=>'ノット','㌪'=>'ハイツ','㌫'=>'パーセント','㌬'=>'パーツ','㌭'=>'バーレル','㌮'=>'ピアストル','㌯'=>'ピクル','㌰'=>'ピコ','㌱'=>'ビル','㌲'=>'ファラッド','㌳'=>'フィート','㌴'=>'ブッシェル','㌵'=>'フラン','㌶'=>'ヘクタール','㌷'=>'ペソ','㌸'=>'ペニヒ','㌹'=>'ヘルツ','㌺'=>'ペンス','㌻'=>'ページ','㌼'=>'ベータ','㌽'=>'ポイント','㌾'=>'ボルト','㌿'=>'ホン','㍀'=>'ポンド','㍁'=>'ホール','㍂'=>'ホーン','㍃'=>'マイクロ','㍄'=>'マイル','㍅'=>'マッハ','㍆'=>'マルク','㍇'=>'マンション','㍈'=>'ミクロン','㍉'=>'ミリ','㍊'=>'ミリバール','㍋'=>'メガ','㍌'=>'メガトン','㍍'=>'メートル','㍎'=>'ヤード','㍏'=>'ヤール','㍐'=>'ユアン','㍑'=>'リットル','㍒'=>'リラ','㍓'=>'ルピー','㍔'=>'ルーブル','㍕'=>'レム','㍖'=>'レントゲン','㍗'=>'ワット','㍘'=>'0点','㍙'=>'1点','㍚'=>'2点','㍛'=>'3点','㍜'=>'4点','㍝'=>'5点','㍞'=>'6点','㍟'=>'7点','㍠'=>'8点','㍡'=>'9点','㍢'=>'10点','㍣'=>'11点','㍤'=>'12点','㍥'=>'13点','㍦'=>'14点','㍧'=>'15点','㍨'=>'16点','㍩'=>'17点','㍪'=>'18点','㍫'=>'19点','㍬'=>'20点','㍭'=>'21点','㍮'=>'22点','㍯'=>'23点','㍰'=>'24点','㍱'=>'hPa','㍲'=>'da','㍳'=>'AU','㍴'=>'bar','㍵'=>'oV','㍶'=>'pc','㍷'=>'dm','㍸'=>'dm2','㍹'=>'dm3','㍺'=>'IU','㍻'=>'平成','㍼'=>'昭和','㍽'=>'大正','㍾'=>'明治','㍿'=>'株式会社','㎀'=>'pA','㎁'=>'nA','㎂'=>'μA','㎃'=>'mA','㎄'=>'kA','㎅'=>'KB','㎆'=>'MB','㎇'=>'GB','㎈'=>'cal','㎉'=>'kcal','㎊'=>'pF','㎋'=>'nF','㎌'=>'μF','㎍'=>'μg','㎎'=>'mg','㎏'=>'kg','㎐'=>'Hz','㎑'=>'kHz','㎒'=>'MHz','㎓'=>'GHz','㎔'=>'THz','㎕'=>'μl','㎖'=>'ml','㎗'=>'dl','㎘'=>'kl','㎙'=>'fm','㎚'=>'nm','㎛'=>'μm','㎜'=>'mm','㎝'=>'cm','㎞'=>'km','㎟'=>'mm2','㎠'=>'cm2','㎡'=>'m2','㎢'=>'km2','㎣'=>'mm3','㎤'=>'cm3','㎥'=>'m3','㎦'=>'km3','㎧'=>'m∕s','㎨'=>'m∕s2','㎩'=>'Pa','㎪'=>'kPa','㎫'=>'MPa','㎬'=>'GPa','㎭'=>'rad','㎮'=>'rad∕s','㎯'=>'rad∕s2','㎰'=>'ps','㎱'=>'ns','㎲'=>'μs','㎳'=>'ms','㎴'=>'pV','㎵'=>'nV','㎶'=>'μV','㎷'=>'mV','㎸'=>'kV','㎹'=>'MV','㎺'=>'pW','㎻'=>'nW','㎼'=>'μW','㎽'=>'mW','㎾'=>'kW','㎿'=>'MW','㏀'=>'kΩ','㏁'=>'MΩ','㏂'=>'a.m.','㏃'=>'Bq','㏄'=>'cc','㏅'=>'cd','㏆'=>'C∕kg','㏇'=>'Co.','㏈'=>'dB','㏉'=>'Gy','㏊'=>'ha','㏋'=>'HP','㏌'=>'in','㏍'=>'KK','㏎'=>'KM','㏏'=>'kt','㏐'=>'lm','㏑'=>'ln','㏒'=>'log','㏓'=>'lx','㏔'=>'mb','㏕'=>'mil','㏖'=>'mol','㏗'=>'PH','㏘'=>'p.m.','㏙'=>'PPM','㏚'=>'PR','㏛'=>'sr','㏜'=>'Sv','㏝'=>'Wb','㏞'=>'V∕m','㏟'=>'A∕m','㏠'=>'1日','㏡'=>'2日','㏢'=>'3日','㏣'=>'4日','㏤'=>'5日','㏥'=>'6日','㏦'=>'7日','㏧'=>'8日','㏨'=>'9日','㏩'=>'10日','㏪'=>'11日','㏫'=>'12日','㏬'=>'13日','㏭'=>'14日','㏮'=>'15日','㏯'=>'16日','㏰'=>'17日','㏱'=>'18日','㏲'=>'19日','㏳'=>'20日','㏴'=>'21日','㏵'=>'22日','㏶'=>'23日','㏷'=>'24日','㏸'=>'25日','㏹'=>'26日','㏺'=>'27日','㏻'=>'28日','㏼'=>'29日','㏽'=>'30日','㏾'=>'31日','㏿'=>'gal','豈'=>'豈','更'=>'更','車'=>'車','賈'=>'賈','滑'=>'滑','串'=>'串','句'=>'句','龜'=>'龜','龜'=>'龜','契'=>'契','金'=>'金','喇'=>'喇','奈'=>'奈','懶'=>'懶','癩'=>'癩','羅'=>'羅','蘿'=>'蘿','螺'=>'螺','裸'=>'裸','邏'=>'邏','樂'=>'樂','洛'=>'洛','烙'=>'烙','珞'=>'珞','落'=>'落','酪'=>'酪','駱'=>'駱','亂'=>'亂','卵'=>'卵','欄'=>'欄','爛'=>'爛','蘭'=>'蘭','鸞'=>'鸞','嵐'=>'嵐','濫'=>'濫','藍'=>'藍','襤'=>'襤','拉'=>'拉','臘'=>'臘','蠟'=>'蠟','廊'=>'廊','朗'=>'朗','浪'=>'浪','狼'=>'狼','郎'=>'郎','來'=>'來','冷'=>'冷','勞'=>'勞','擄'=>'擄','櫓'=>'櫓','爐'=>'爐','盧'=>'盧','老'=>'老','蘆'=>'蘆','虜'=>'虜','路'=>'路','露'=>'露','魯'=>'魯','鷺'=>'鷺','碌'=>'碌','祿'=>'祿','綠'=>'綠','菉'=>'菉','錄'=>'錄','鹿'=>'鹿','論'=>'論','壟'=>'壟','弄'=>'弄','籠'=>'籠','聾'=>'聾','牢'=>'牢','磊'=>'磊','賂'=>'賂','雷'=>'雷','壘'=>'壘','屢'=>'屢','樓'=>'樓','淚'=>'淚','漏'=>'漏','累'=>'累','縷'=>'縷','陋'=>'陋','勒'=>'勒','肋'=>'肋','凜'=>'凜','凌'=>'凌','稜'=>'稜','綾'=>'綾','菱'=>'菱','陵'=>'陵','讀'=>'讀','拏'=>'拏','樂'=>'樂','諾'=>'諾','丹'=>'丹','寧'=>'寧','怒'=>'怒','率'=>'率','異'=>'異','北'=>'北','磻'=>'磻','便'=>'便','復'=>'復','不'=>'不','泌'=>'泌','數'=>'數','索'=>'索','參'=>'參','塞'=>'塞','省'=>'省','葉'=>'葉','說'=>'說','殺'=>'殺','辰'=>'辰','沈'=>'沈','拾'=>'拾','若'=>'若','掠'=>'掠','略'=>'略','亮'=>'亮','兩'=>'兩','凉'=>'凉','梁'=>'梁','糧'=>'糧','良'=>'良','諒'=>'諒','量'=>'量','勵'=>'勵','呂'=>'呂','女'=>'女','廬'=>'廬','旅'=>'旅','濾'=>'濾','礪'=>'礪','閭'=>'閭','驪'=>'驪','麗'=>'麗','黎'=>'黎','力'=>'力','曆'=>'曆','歷'=>'歷','轢'=>'轢','年'=>'年','憐'=>'憐','戀'=>'戀','撚'=>'撚','漣'=>'漣','煉'=>'煉','璉'=>'璉','秊'=>'秊','練'=>'練','聯'=>'聯','輦'=>'輦','蓮'=>'蓮','連'=>'連','鍊'=>'鍊','列'=>'列','劣'=>'劣','咽'=>'咽','烈'=>'烈','裂'=>'裂','說'=>'說','廉'=>'廉','念'=>'念','捻'=>'捻','殮'=>'殮','簾'=>'簾','獵'=>'獵','令'=>'令','囹'=>'囹','寧'=>'寧','嶺'=>'嶺','怜'=>'怜','玲'=>'玲','瑩'=>'瑩','羚'=>'羚','聆'=>'聆','鈴'=>'鈴','零'=>'零','靈'=>'靈','領'=>'領','例'=>'例','禮'=>'禮','醴'=>'醴','隸'=>'隸','惡'=>'惡','了'=>'了','僚'=>'僚','寮'=>'寮','尿'=>'尿','料'=>'料','樂'=>'樂','燎'=>'燎','療'=>'療','蓼'=>'蓼','遼'=>'遼','龍'=>'龍','暈'=>'暈','阮'=>'阮','劉'=>'劉','杻'=>'杻','柳'=>'柳','流'=>'流','溜'=>'溜','琉'=>'琉','留'=>'留','硫'=>'硫','紐'=>'紐','類'=>'類','六'=>'六','戮'=>'戮','陸'=>'陸','倫'=>'倫','崙'=>'崙','淪'=>'淪','輪'=>'輪','律'=>'律','慄'=>'慄','栗'=>'栗','率'=>'率','隆'=>'隆','利'=>'利','吏'=>'吏','履'=>'履','易'=>'易','李'=>'李','梨'=>'梨','泥'=>'泥','理'=>'理','痢'=>'痢','罹'=>'罹','裏'=>'裏','裡'=>'裡','里'=>'里','離'=>'離','匿'=>'匿','溺'=>'溺','吝'=>'吝','燐'=>'燐','璘'=>'璘','藺'=>'藺','隣'=>'隣','鱗'=>'鱗','麟'=>'麟','林'=>'林','淋'=>'淋','臨'=>'臨','立'=>'立','笠'=>'笠','粒'=>'粒','狀'=>'狀','炙'=>'炙','識'=>'識','什'=>'什','茶'=>'茶','刺'=>'刺','切'=>'切','度'=>'度','拓'=>'拓','糖'=>'糖','宅'=>'宅','洞'=>'洞','暴'=>'暴','輻'=>'輻','行'=>'行','降'=>'降','見'=>'見','廓'=>'廓','兀'=>'兀','嗀'=>'嗀','塚'=>'塚','晴'=>'晴','凞'=>'凞','猪'=>'猪','益'=>'益','礼'=>'礼','神'=>'神','祥'=>'祥','福'=>'福','靖'=>'靖','精'=>'精','羽'=>'羽','蘒'=>'蘒','諸'=>'諸','逸'=>'逸','都'=>'都','飯'=>'飯','飼'=>'飼','館'=>'館','鶴'=>'鶴','侮'=>'侮','僧'=>'僧','免'=>'免','勉'=>'勉','勤'=>'勤','卑'=>'卑','喝'=>'喝','嘆'=>'嘆','器'=>'器','塀'=>'塀','墨'=>'墨','層'=>'層','屮'=>'屮','悔'=>'悔','慨'=>'慨','憎'=>'憎','懲'=>'懲','敏'=>'敏','既'=>'既','暑'=>'暑','梅'=>'梅','海'=>'海','渚'=>'渚','漢'=>'漢','煮'=>'煮','爫'=>'爫','琢'=>'琢','碑'=>'碑','社'=>'社','祉'=>'祉','祈'=>'祈','祐'=>'祐','祖'=>'祖','祝'=>'祝','禍'=>'禍','禎'=>'禎','穀'=>'穀','突'=>'突','節'=>'節','練'=>'練','縉'=>'縉','繁'=>'繁','署'=>'署','者'=>'者','臭'=>'臭','艹'=>'艹','艹'=>'艹','著'=>'著','褐'=>'褐','視'=>'視','謁'=>'謁','謹'=>'謹','賓'=>'賓','贈'=>'贈','辶'=>'辶','逸'=>'逸','難'=>'難','響'=>'響','頻'=>'頻','並'=>'並','况'=>'况','全'=>'全','侀'=>'侀','充'=>'充','冀'=>'冀','勇'=>'勇','勺'=>'勺','喝'=>'喝','啕'=>'啕','喙'=>'喙','嗢'=>'嗢','塚'=>'塚','墳'=>'墳','奄'=>'奄','奔'=>'奔','婢'=>'婢','嬨'=>'嬨','廒'=>'廒','廙'=>'廙','彩'=>'彩','徭'=>'徭','惘'=>'惘','慎'=>'慎','愈'=>'愈','憎'=>'憎','慠'=>'慠','懲'=>'懲','戴'=>'戴','揄'=>'揄','搜'=>'搜','摒'=>'摒','敖'=>'敖','晴'=>'晴','朗'=>'朗','望'=>'望','杖'=>'杖','歹'=>'歹','殺'=>'殺','流'=>'流','滛'=>'滛','滋'=>'滋','漢'=>'漢','瀞'=>'瀞','煮'=>'煮','瞧'=>'瞧','爵'=>'爵','犯'=>'犯','猪'=>'猪','瑱'=>'瑱','甆'=>'甆','画'=>'画','瘝'=>'瘝','瘟'=>'瘟','益'=>'益','盛'=>'盛','直'=>'直','睊'=>'睊','着'=>'着','磌'=>'磌','窱'=>'窱','節'=>'節','类'=>'类','絛'=>'絛','練'=>'練','缾'=>'缾','者'=>'者','荒'=>'荒','華'=>'華','蝹'=>'蝹','襁'=>'襁','覆'=>'覆','視'=>'視','調'=>'調','諸'=>'諸','請'=>'請','謁'=>'謁','諾'=>'諾','諭'=>'諭','謹'=>'謹','變'=>'變','贈'=>'贈','輸'=>'輸','遲'=>'遲','醙'=>'醙','鉶'=>'鉶','陼'=>'陼','難'=>'難','靖'=>'靖','韛'=>'韛','響'=>'響','頋'=>'頋','頻'=>'頻','鬒'=>'鬒','龜'=>'龜','𢡊'=>'𢡊','𢡄'=>'𢡄','𣏕'=>'𣏕','㮝'=>'㮝','䀘'=>'䀘','䀹'=>'䀹','𥉉'=>'𥉉','𥳐'=>'𥳐','𧻓'=>'𧻓','齃'=>'齃','龎'=>'龎','ff'=>'ff','fi'=>'fi','fl'=>'fl','ffi'=>'ffi','ffl'=>'ffl','ſt'=>'st','st'=>'st','ﬓ'=>'մն','ﬔ'=>'մե','ﬕ'=>'մի','ﬖ'=>'վն','ﬗ'=>'մխ','יִ'=>'יִ','ײַ'=>'ײַ','ﬠ'=>'ע','ﬡ'=>'א','ﬢ'=>'ד','ﬣ'=>'ה','ﬤ'=>'כ','ﬥ'=>'ל','ﬦ'=>'ם','ﬧ'=>'ר','ﬨ'=>'ת','﬩'=>'+','שׁ'=>'שׁ','שׂ'=>'שׂ','שּׁ'=>'שּׁ','שּׂ'=>'שּׂ','אַ'=>'אַ','אָ'=>'אָ','אּ'=>'אּ','בּ'=>'בּ','גּ'=>'גּ','דּ'=>'דּ','הּ'=>'הּ','וּ'=>'וּ','זּ'=>'זּ','טּ'=>'טּ','יּ'=>'יּ','ךּ'=>'ךּ','כּ'=>'כּ','לּ'=>'לּ','מּ'=>'מּ','נּ'=>'נּ','סּ'=>'סּ','ףּ'=>'ףּ','פּ'=>'פּ','צּ'=>'צּ','קּ'=>'קּ','רּ'=>'רּ','שּ'=>'שּ','תּ'=>'תּ','וֹ'=>'וֹ','בֿ'=>'בֿ','כֿ'=>'כֿ','פֿ'=>'פֿ','ﭏ'=>'אל','ﭐ'=>'ٱ','ﭑ'=>'ٱ','ﭒ'=>'ٻ','ﭓ'=>'ٻ','ﭔ'=>'ٻ','ﭕ'=>'ٻ','ﭖ'=>'پ','ﭗ'=>'پ','ﭘ'=>'پ','ﭙ'=>'پ','ﭚ'=>'ڀ','ﭛ'=>'ڀ','ﭜ'=>'ڀ','ﭝ'=>'ڀ','ﭞ'=>'ٺ','ﭟ'=>'ٺ','ﭠ'=>'ٺ','ﭡ'=>'ٺ','ﭢ'=>'ٿ','ﭣ'=>'ٿ','ﭤ'=>'ٿ','ﭥ'=>'ٿ','ﭦ'=>'ٹ','ﭧ'=>'ٹ','ﭨ'=>'ٹ','ﭩ'=>'ٹ','ﭪ'=>'ڤ','ﭫ'=>'ڤ','ﭬ'=>'ڤ','ﭭ'=>'ڤ','ﭮ'=>'ڦ','ﭯ'=>'ڦ','ﭰ'=>'ڦ','ﭱ'=>'ڦ','ﭲ'=>'ڄ','ﭳ'=>'ڄ','ﭴ'=>'ڄ','ﭵ'=>'ڄ','ﭶ'=>'ڃ','ﭷ'=>'ڃ','ﭸ'=>'ڃ','ﭹ'=>'ڃ','ﭺ'=>'چ','ﭻ'=>'چ','ﭼ'=>'چ','ﭽ'=>'چ','ﭾ'=>'ڇ','ﭿ'=>'ڇ','ﮀ'=>'ڇ','ﮁ'=>'ڇ','ﮂ'=>'ڍ','ﮃ'=>'ڍ','ﮄ'=>'ڌ','ﮅ'=>'ڌ','ﮆ'=>'ڎ','ﮇ'=>'ڎ','ﮈ'=>'ڈ','ﮉ'=>'ڈ','ﮊ'=>'ژ','ﮋ'=>'ژ','ﮌ'=>'ڑ','ﮍ'=>'ڑ','ﮎ'=>'ک','ﮏ'=>'ک','ﮐ'=>'ک','ﮑ'=>'ک','ﮒ'=>'گ','ﮓ'=>'گ','ﮔ'=>'گ','ﮕ'=>'گ','ﮖ'=>'ڳ','ﮗ'=>'ڳ','ﮘ'=>'ڳ','ﮙ'=>'ڳ','ﮚ'=>'ڱ','ﮛ'=>'ڱ','ﮜ'=>'ڱ','ﮝ'=>'ڱ','ﮞ'=>'ں','ﮟ'=>'ں','ﮠ'=>'ڻ','ﮡ'=>'ڻ','ﮢ'=>'ڻ','ﮣ'=>'ڻ','ﮤ'=>'ۀ','ﮥ'=>'ۀ','ﮦ'=>'ہ','ﮧ'=>'ہ','ﮨ'=>'ہ','ﮩ'=>'ہ','ﮪ'=>'ھ','ﮫ'=>'ھ','ﮬ'=>'ھ','ﮭ'=>'ھ','ﮮ'=>'ے','ﮯ'=>'ے','ﮰ'=>'ۓ','ﮱ'=>'ۓ','ﯓ'=>'ڭ','ﯔ'=>'ڭ','ﯕ'=>'ڭ','ﯖ'=>'ڭ','ﯗ'=>'ۇ','ﯘ'=>'ۇ','ﯙ'=>'ۆ','ﯚ'=>'ۆ','ﯛ'=>'ۈ','ﯜ'=>'ۈ','ﯝ'=>'ۇٴ','ﯞ'=>'ۋ','ﯟ'=>'ۋ','ﯠ'=>'ۅ','ﯡ'=>'ۅ','ﯢ'=>'ۉ','ﯣ'=>'ۉ','ﯤ'=>'ې','ﯥ'=>'ې','ﯦ'=>'ې','ﯧ'=>'ې','ﯨ'=>'ى','ﯩ'=>'ى','ﯪ'=>'ئا','ﯫ'=>'ئا','ﯬ'=>'ئە','ﯭ'=>'ئە','ﯮ'=>'ئو','ﯯ'=>'ئو','ﯰ'=>'ئۇ','ﯱ'=>'ئۇ','ﯲ'=>'ئۆ','ﯳ'=>'ئۆ','ﯴ'=>'ئۈ','ﯵ'=>'ئۈ','ﯶ'=>'ئې','ﯷ'=>'ئې','ﯸ'=>'ئې','ﯹ'=>'ئى','ﯺ'=>'ئى','ﯻ'=>'ئى','ﯼ'=>'ی','ﯽ'=>'ی','ﯾ'=>'ی','ﯿ'=>'ی','ﰀ'=>'ئج','ﰁ'=>'ئح','ﰂ'=>'ئم','ﰃ'=>'ئى','ﰄ'=>'ئي','ﰅ'=>'بج','ﰆ'=>'بح','ﰇ'=>'بخ','ﰈ'=>'بم','ﰉ'=>'بى','ﰊ'=>'بي','ﰋ'=>'تج','ﰌ'=>'تح','ﰍ'=>'تخ','ﰎ'=>'تم','ﰏ'=>'تى','ﰐ'=>'تي','ﰑ'=>'ثج','ﰒ'=>'ثم','ﰓ'=>'ثى','ﰔ'=>'ثي','ﰕ'=>'جح','ﰖ'=>'جم','ﰗ'=>'حج','ﰘ'=>'حم','ﰙ'=>'خج','ﰚ'=>'خح','ﰛ'=>'خم','ﰜ'=>'سج','ﰝ'=>'سح','ﰞ'=>'سخ','ﰟ'=>'سم','ﰠ'=>'صح','ﰡ'=>'صم','ﰢ'=>'ضج','ﰣ'=>'ضح','ﰤ'=>'ضخ','ﰥ'=>'ضم','ﰦ'=>'طح','ﰧ'=>'طم','ﰨ'=>'ظم','ﰩ'=>'عج','ﰪ'=>'عم','ﰫ'=>'غج','ﰬ'=>'غم','ﰭ'=>'فج','ﰮ'=>'فح','ﰯ'=>'فخ','ﰰ'=>'فم','ﰱ'=>'فى','ﰲ'=>'في','ﰳ'=>'قح','ﰴ'=>'قم','ﰵ'=>'قى','ﰶ'=>'قي','ﰷ'=>'كا','ﰸ'=>'كج','ﰹ'=>'كح','ﰺ'=>'كخ','ﰻ'=>'كل','ﰼ'=>'كم','ﰽ'=>'كى','ﰾ'=>'كي','ﰿ'=>'لج','ﱀ'=>'لح','ﱁ'=>'لخ','ﱂ'=>'لم','ﱃ'=>'لى','ﱄ'=>'لي','ﱅ'=>'مج','ﱆ'=>'مح','ﱇ'=>'مخ','ﱈ'=>'مم','ﱉ'=>'مى','ﱊ'=>'مي','ﱋ'=>'نج','ﱌ'=>'نح','ﱍ'=>'نخ','ﱎ'=>'نم','ﱏ'=>'نى','ﱐ'=>'ني','ﱑ'=>'هج','ﱒ'=>'هم','ﱓ'=>'هى','ﱔ'=>'هي','ﱕ'=>'يج','ﱖ'=>'يح','ﱗ'=>'يخ','ﱘ'=>'يم','ﱙ'=>'يى','ﱚ'=>'يي','ﱛ'=>'ذٰ','ﱜ'=>'رٰ','ﱝ'=>'ىٰ','ﱞ'=>' ٌّ','ﱟ'=>' ٍّ','ﱠ'=>' َّ','ﱡ'=>' ُّ','ﱢ'=>' ِّ','ﱣ'=>' ّٰ','ﱤ'=>'ئر','ﱥ'=>'ئز','ﱦ'=>'ئم','ﱧ'=>'ئن','ﱨ'=>'ئى','ﱩ'=>'ئي','ﱪ'=>'بر','ﱫ'=>'بز','ﱬ'=>'بم','ﱭ'=>'بن','ﱮ'=>'بى','ﱯ'=>'بي','ﱰ'=>'تر','ﱱ'=>'تز','ﱲ'=>'تم','ﱳ'=>'تن','ﱴ'=>'تى','ﱵ'=>'تي','ﱶ'=>'ثر','ﱷ'=>'ثز','ﱸ'=>'ثم','ﱹ'=>'ثن','ﱺ'=>'ثى','ﱻ'=>'ثي','ﱼ'=>'فى','ﱽ'=>'في','ﱾ'=>'قى','ﱿ'=>'قي','ﲀ'=>'كا','ﲁ'=>'كل','ﲂ'=>'كم','ﲃ'=>'كى','ﲄ'=>'كي','ﲅ'=>'لم','ﲆ'=>'لى','ﲇ'=>'لي','ﲈ'=>'ما','ﲉ'=>'مم','ﲊ'=>'نر','ﲋ'=>'نز','ﲌ'=>'نم','ﲍ'=>'نن','ﲎ'=>'نى','ﲏ'=>'ني','ﲐ'=>'ىٰ','ﲑ'=>'ير','ﲒ'=>'يز','ﲓ'=>'يم','ﲔ'=>'ين','ﲕ'=>'يى','ﲖ'=>'يي','ﲗ'=>'ئج','ﲘ'=>'ئح','ﲙ'=>'ئخ','ﲚ'=>'ئم','ﲛ'=>'ئه','ﲜ'=>'بج','ﲝ'=>'بح','ﲞ'=>'بخ','ﲟ'=>'بم','ﲠ'=>'به','ﲡ'=>'تج','ﲢ'=>'تح','ﲣ'=>'تخ','ﲤ'=>'تم','ﲥ'=>'ته','ﲦ'=>'ثم','ﲧ'=>'جح','ﲨ'=>'جم','ﲩ'=>'حج','ﲪ'=>'حم','ﲫ'=>'خج','ﲬ'=>'خم','ﲭ'=>'سج','ﲮ'=>'سح','ﲯ'=>'سخ','ﲰ'=>'سم','ﲱ'=>'صح','ﲲ'=>'صخ','ﲳ'=>'صم','ﲴ'=>'ضج','ﲵ'=>'ضح','ﲶ'=>'ضخ','ﲷ'=>'ضم','ﲸ'=>'طح','ﲹ'=>'ظم','ﲺ'=>'عج','ﲻ'=>'عم','ﲼ'=>'غج','ﲽ'=>'غم','ﲾ'=>'فج','ﲿ'=>'فح','ﳀ'=>'فخ','ﳁ'=>'فم','ﳂ'=>'قح','ﳃ'=>'قم','ﳄ'=>'كج','ﳅ'=>'كح','ﳆ'=>'كخ','ﳇ'=>'كل','ﳈ'=>'كم','ﳉ'=>'لج','ﳊ'=>'لح','ﳋ'=>'لخ','ﳌ'=>'لم','ﳍ'=>'له','ﳎ'=>'مج','ﳏ'=>'مح','ﳐ'=>'مخ','ﳑ'=>'مم','ﳒ'=>'نج','ﳓ'=>'نح','ﳔ'=>'نخ','ﳕ'=>'نم','ﳖ'=>'نه','ﳗ'=>'هج','ﳘ'=>'هم','ﳙ'=>'هٰ','ﳚ'=>'يج','ﳛ'=>'يح','ﳜ'=>'يخ','ﳝ'=>'يم','ﳞ'=>'يه','ﳟ'=>'ئم','ﳠ'=>'ئه','ﳡ'=>'بم','ﳢ'=>'به','ﳣ'=>'تم','ﳤ'=>'ته','ﳥ'=>'ثم','ﳦ'=>'ثه','ﳧ'=>'سم','ﳨ'=>'سه','ﳩ'=>'شم','ﳪ'=>'شه','ﳫ'=>'كل','ﳬ'=>'كم','ﳭ'=>'لم','ﳮ'=>'نم','ﳯ'=>'نه','ﳰ'=>'يم','ﳱ'=>'يه','ﳲ'=>'ـَّ','ﳳ'=>'ـُّ','ﳴ'=>'ـِّ','ﳵ'=>'طى','ﳶ'=>'طي','ﳷ'=>'عى','ﳸ'=>'عي','ﳹ'=>'غى','ﳺ'=>'غي','ﳻ'=>'سى','ﳼ'=>'سي','ﳽ'=>'شى','ﳾ'=>'شي','ﳿ'=>'حى','ﴀ'=>'حي','ﴁ'=>'جى','ﴂ'=>'جي','ﴃ'=>'خى','ﴄ'=>'خي','ﴅ'=>'صى','ﴆ'=>'صي','ﴇ'=>'ضى','ﴈ'=>'ضي','ﴉ'=>'شج','ﴊ'=>'شح','ﴋ'=>'شخ','ﴌ'=>'شم','ﴍ'=>'شر','ﴎ'=>'سر','ﴏ'=>'صر','ﴐ'=>'ضر','ﴑ'=>'طى','ﴒ'=>'طي','ﴓ'=>'عى','ﴔ'=>'عي','ﴕ'=>'غى','ﴖ'=>'غي','ﴗ'=>'سى','ﴘ'=>'سي','ﴙ'=>'شى','ﴚ'=>'شي','ﴛ'=>'حى','ﴜ'=>'حي','ﴝ'=>'جى','ﴞ'=>'جي','ﴟ'=>'خى','ﴠ'=>'خي','ﴡ'=>'صى','ﴢ'=>'صي','ﴣ'=>'ضى','ﴤ'=>'ضي','ﴥ'=>'شج','ﴦ'=>'شح','ﴧ'=>'شخ','ﴨ'=>'شم','ﴩ'=>'شر','ﴪ'=>'سر','ﴫ'=>'صر','ﴬ'=>'ضر','ﴭ'=>'شج','ﴮ'=>'شح','ﴯ'=>'شخ','ﴰ'=>'شم','ﴱ'=>'سه','ﴲ'=>'شه','ﴳ'=>'طم','ﴴ'=>'سج','ﴵ'=>'سح','ﴶ'=>'سخ','ﴷ'=>'شج','ﴸ'=>'شح','ﴹ'=>'شخ','ﴺ'=>'طم','ﴻ'=>'ظم','ﴼ'=>'اً','ﴽ'=>'اً','ﵐ'=>'تجم','ﵑ'=>'تحج','ﵒ'=>'تحج','ﵓ'=>'تحم','ﵔ'=>'تخم','ﵕ'=>'تمج','ﵖ'=>'تمح','ﵗ'=>'تمخ','ﵘ'=>'جمح','ﵙ'=>'جمح','ﵚ'=>'حمي','ﵛ'=>'حمى','ﵜ'=>'سحج','ﵝ'=>'سجح','ﵞ'=>'سجى','ﵟ'=>'سمح','ﵠ'=>'سمح','ﵡ'=>'سمج','ﵢ'=>'سمم','ﵣ'=>'سمم','ﵤ'=>'صحح','ﵥ'=>'صحح','ﵦ'=>'صمم','ﵧ'=>'شحم','ﵨ'=>'شحم','ﵩ'=>'شجي','ﵪ'=>'شمخ','ﵫ'=>'شمخ','ﵬ'=>'شمم','ﵭ'=>'شمم','ﵮ'=>'ضحى','ﵯ'=>'ضخم','ﵰ'=>'ضخم','ﵱ'=>'طمح','ﵲ'=>'طمح','ﵳ'=>'طمم','ﵴ'=>'طمي','ﵵ'=>'عجم','ﵶ'=>'عمم','ﵷ'=>'عمم','ﵸ'=>'عمى','ﵹ'=>'غمم','ﵺ'=>'غمي','ﵻ'=>'غمى','ﵼ'=>'فخم','ﵽ'=>'فخم','ﵾ'=>'قمح','ﵿ'=>'قمم','ﶀ'=>'لحم','ﶁ'=>'لحي','ﶂ'=>'لحى','ﶃ'=>'لجج','ﶄ'=>'لجج','ﶅ'=>'لخم','ﶆ'=>'لخم','ﶇ'=>'لمح','ﶈ'=>'لمح','ﶉ'=>'محج','ﶊ'=>'محم','ﶋ'=>'محي','ﶌ'=>'مجح','ﶍ'=>'مجم','ﶎ'=>'مخج','ﶏ'=>'مخم','ﶒ'=>'مجخ','ﶓ'=>'همج','ﶔ'=>'همم','ﶕ'=>'نحم','ﶖ'=>'نحى','ﶗ'=>'نجم','ﶘ'=>'نجم','ﶙ'=>'نجى','ﶚ'=>'نمي','ﶛ'=>'نمى','ﶜ'=>'يمم','ﶝ'=>'يمم','ﶞ'=>'بخي','ﶟ'=>'تجي','ﶠ'=>'تجى','ﶡ'=>'تخي','ﶢ'=>'تخى','ﶣ'=>'تمي','ﶤ'=>'تمى','ﶥ'=>'جمي','ﶦ'=>'جحى','ﶧ'=>'جمى','ﶨ'=>'سخى','ﶩ'=>'صحي','ﶪ'=>'شحي','ﶫ'=>'ضحي','ﶬ'=>'لجي','ﶭ'=>'لمي','ﶮ'=>'يحي','ﶯ'=>'يجي','ﶰ'=>'يمي','ﶱ'=>'ممي','ﶲ'=>'قمي','ﶳ'=>'نحي','ﶴ'=>'قمح','ﶵ'=>'لحم','ﶶ'=>'عمي','ﶷ'=>'كمي','ﶸ'=>'نجح','ﶹ'=>'مخي','ﶺ'=>'لجم','ﶻ'=>'كمم','ﶼ'=>'لجم','ﶽ'=>'نجح','ﶾ'=>'جحي','ﶿ'=>'حجي','ﷀ'=>'مجي','ﷁ'=>'فمي','ﷂ'=>'بحي','ﷃ'=>'كمم','ﷄ'=>'عجم','ﷅ'=>'صمم','ﷆ'=>'سخي','ﷇ'=>'نجي','ﷰ'=>'صلے','ﷱ'=>'قلے','ﷲ'=>'الله','ﷳ'=>'اكبر','ﷴ'=>'محمد','ﷵ'=>'صلعم','ﷶ'=>'رسول','ﷷ'=>'عليه','ﷸ'=>'وسلم','ﷹ'=>'صلى','ﷺ'=>'صلى الله عليه وسلم','ﷻ'=>'جل جلاله','﷼'=>'ریال','︐'=>',','︑'=>'、','︒'=>'。','︓'=>':','︔'=>';','︕'=>'!','︖'=>'?','︗'=>'〖','︘'=>'〗','︙'=>'...','︰'=>'..','︱'=>'—','︲'=>'–','︳'=>'_','︴'=>'_','︵'=>'(','︶'=>')','︷'=>'{','︸'=>'}','︹'=>'〔','︺'=>'〕','︻'=>'【','︼'=>'】','︽'=>'《','︾'=>'》','︿'=>'〈','﹀'=>'〉','﹁'=>'「','﹂'=>'」','﹃'=>'『','﹄'=>'』','﹇'=>'[','﹈'=>']','﹉'=>' ̅','﹊'=>' ̅','﹋'=>' ̅','﹌'=>' ̅','﹍'=>'_','﹎'=>'_','﹏'=>'_','﹐'=>',','﹑'=>'、','﹒'=>'.','﹔'=>';','﹕'=>':','﹖'=>'?','﹗'=>'!','﹘'=>'—','﹙'=>'(','﹚'=>')','﹛'=>'{','﹜'=>'}','﹝'=>'〔','﹞'=>'〕','﹟'=>'#','﹠'=>'&','﹡'=>'*','﹢'=>'+','﹣'=>'-','﹤'=>'<','﹥'=>'>','﹦'=>'=','﹨'=>'\\','﹩'=>'$','﹪'=>'%','﹫'=>'@','ﹰ'=>' ً','ﹱ'=>'ـً','ﹲ'=>' ٌ','ﹴ'=>' ٍ','ﹶ'=>' َ','ﹷ'=>'ـَ','ﹸ'=>' ُ','ﹹ'=>'ـُ','ﹺ'=>' ِ','ﹻ'=>'ـِ','ﹼ'=>' ّ','ﹽ'=>'ـّ','ﹾ'=>' ْ','ﹿ'=>'ـْ','ﺀ'=>'ء','ﺁ'=>'آ','ﺂ'=>'آ','ﺃ'=>'أ','ﺄ'=>'أ','ﺅ'=>'ؤ','ﺆ'=>'ؤ','ﺇ'=>'إ','ﺈ'=>'إ','ﺉ'=>'ئ','ﺊ'=>'ئ','ﺋ'=>'ئ','ﺌ'=>'ئ','ﺍ'=>'ا','ﺎ'=>'ا','ﺏ'=>'ب','ﺐ'=>'ب','ﺑ'=>'ب','ﺒ'=>'ب','ﺓ'=>'ة','ﺔ'=>'ة','ﺕ'=>'ت','ﺖ'=>'ت','ﺗ'=>'ت','ﺘ'=>'ت','ﺙ'=>'ث','ﺚ'=>'ث','ﺛ'=>'ث','ﺜ'=>'ث','ﺝ'=>'ج','ﺞ'=>'ج','ﺟ'=>'ج','ﺠ'=>'ج','ﺡ'=>'ح','ﺢ'=>'ح','ﺣ'=>'ح','ﺤ'=>'ح','ﺥ'=>'خ','ﺦ'=>'خ','ﺧ'=>'خ','ﺨ'=>'خ','ﺩ'=>'د','ﺪ'=>'د','ﺫ'=>'ذ','ﺬ'=>'ذ','ﺭ'=>'ر','ﺮ'=>'ر','ﺯ'=>'ز','ﺰ'=>'ز','ﺱ'=>'س','ﺲ'=>'س','ﺳ'=>'س','ﺴ'=>'س','ﺵ'=>'ش','ﺶ'=>'ش','ﺷ'=>'ش','ﺸ'=>'ش','ﺹ'=>'ص','ﺺ'=>'ص','ﺻ'=>'ص','ﺼ'=>'ص','ﺽ'=>'ض','ﺾ'=>'ض','ﺿ'=>'ض','ﻀ'=>'ض','ﻁ'=>'ط','ﻂ'=>'ط','ﻃ'=>'ط','ﻄ'=>'ط','ﻅ'=>'ظ','ﻆ'=>'ظ','ﻇ'=>'ظ','ﻈ'=>'ظ','ﻉ'=>'ع','ﻊ'=>'ع','ﻋ'=>'ع','ﻌ'=>'ع','ﻍ'=>'غ','ﻎ'=>'غ','ﻏ'=>'غ','ﻐ'=>'غ','ﻑ'=>'ف','ﻒ'=>'ف','ﻓ'=>'ف','ﻔ'=>'ف','ﻕ'=>'ق','ﻖ'=>'ق','ﻗ'=>'ق','ﻘ'=>'ق','ﻙ'=>'ك','ﻚ'=>'ك','ﻛ'=>'ك','ﻜ'=>'ك','ﻝ'=>'ل','ﻞ'=>'ل','ﻟ'=>'ل','ﻠ'=>'ل','ﻡ'=>'م','ﻢ'=>'م','ﻣ'=>'م','ﻤ'=>'م','ﻥ'=>'ن','ﻦ'=>'ن','ﻧ'=>'ن','ﻨ'=>'ن','ﻩ'=>'ه','ﻪ'=>'ه','ﻫ'=>'ه','ﻬ'=>'ه','ﻭ'=>'و','ﻮ'=>'و','ﻯ'=>'ى','ﻰ'=>'ى','ﻱ'=>'ي','ﻲ'=>'ي','ﻳ'=>'ي','ﻴ'=>'ي','ﻵ'=>'لآ','ﻶ'=>'لآ','ﻷ'=>'لأ','ﻸ'=>'لأ','ﻹ'=>'لإ','ﻺ'=>'لإ','ﻻ'=>'لا','ﻼ'=>'لا','!'=>'!','"'=>'"','#'=>'#','$'=>'$','%'=>'%','&'=>'&','''=>'\'','('=>'(',')'=>')','*'=>'*','+'=>'+',','=>',','-'=>'-','.'=>'.','/'=>'/','0'=>'0','1'=>'1','2'=>'2','3'=>'3','4'=>'4','5'=>'5','6'=>'6','7'=>'7','8'=>'8','9'=>'9',':'=>':',';'=>';','<'=>'<','='=>'=','>'=>'>','?'=>'?','@'=>'@','A'=>'A','B'=>'B','C'=>'C','D'=>'D','E'=>'E','F'=>'F','G'=>'G','H'=>'H','I'=>'I','J'=>'J','K'=>'K','L'=>'L','M'=>'M','N'=>'N','O'=>'O','P'=>'P','Q'=>'Q','R'=>'R','S'=>'S','T'=>'T','U'=>'U','V'=>'V','W'=>'W','X'=>'X','Y'=>'Y','Z'=>'Z','['=>'[','\'=>'\\',']'=>']','^'=>'^','_'=>'_','`'=>'`','a'=>'a','b'=>'b','c'=>'c','d'=>'d','e'=>'e','f'=>'f','g'=>'g','h'=>'h','i'=>'i','j'=>'j','k'=>'k','l'=>'l','m'=>'m','n'=>'n','o'=>'o','p'=>'p','q'=>'q','r'=>'r','s'=>'s','t'=>'t','u'=>'u','v'=>'v','w'=>'w','x'=>'x','y'=>'y','z'=>'z','{'=>'{','|'=>'|','}'=>'}','~'=>'~','⦅'=>'⦅','⦆'=>'⦆','。'=>'。','「'=>'「','」'=>'」','、'=>'、','・'=>'・','ヲ'=>'ヲ','ァ'=>'ァ','ィ'=>'ィ','ゥ'=>'ゥ','ェ'=>'ェ','ォ'=>'ォ','ャ'=>'ャ','ュ'=>'ュ','ョ'=>'ョ','ッ'=>'ッ','ー'=>'ー','ア'=>'ア','イ'=>'イ','ウ'=>'ウ','エ'=>'エ','オ'=>'オ','カ'=>'カ','キ'=>'キ','ク'=>'ク','ケ'=>'ケ','コ'=>'コ','サ'=>'サ','シ'=>'シ','ス'=>'ス','セ'=>'セ','ソ'=>'ソ','タ'=>'タ','チ'=>'チ','ツ'=>'ツ','テ'=>'テ','ト'=>'ト','ナ'=>'ナ','ニ'=>'ニ','ヌ'=>'ヌ','ネ'=>'ネ','ノ'=>'ノ','ハ'=>'ハ','ヒ'=>'ヒ','フ'=>'フ','ヘ'=>'ヘ','ホ'=>'ホ','マ'=>'マ','ミ'=>'ミ','ム'=>'ム','メ'=>'メ','モ'=>'モ','ヤ'=>'ヤ','ユ'=>'ユ','ヨ'=>'ヨ','ラ'=>'ラ','リ'=>'リ','ル'=>'ル','レ'=>'レ','ロ'=>'ロ','ワ'=>'ワ','ン'=>'ン','゙'=>'゙','゚'=>'゚','ᅠ'=>'ᅠ','ᄀ'=>'ᄀ','ᄁ'=>'ᄁ','ᆪ'=>'ᆪ','ᄂ'=>'ᄂ','ᆬ'=>'ᆬ','ᆭ'=>'ᆭ','ᄃ'=>'ᄃ','ᄄ'=>'ᄄ','ᄅ'=>'ᄅ','ᆰ'=>'ᆰ','ᆱ'=>'ᆱ','ᆲ'=>'ᆲ','ᆳ'=>'ᆳ','ᆴ'=>'ᆴ','ᆵ'=>'ᆵ','ᄚ'=>'ᄚ','ᄆ'=>'ᄆ','ᄇ'=>'ᄇ','ᄈ'=>'ᄈ','ᄡ'=>'ᄡ','ᄉ'=>'ᄉ','ᄊ'=>'ᄊ','ᄋ'=>'ᄋ','ᄌ'=>'ᄌ','ᄍ'=>'ᄍ','ᄎ'=>'ᄎ','ᄏ'=>'ᄏ','ᄐ'=>'ᄐ','ᄑ'=>'ᄑ','ᄒ'=>'ᄒ','ᅡ'=>'ᅡ','ᅢ'=>'ᅢ','ᅣ'=>'ᅣ','ᅤ'=>'ᅤ','ᅥ'=>'ᅥ','ᅦ'=>'ᅦ','ᅧ'=>'ᅧ','ᅨ'=>'ᅨ','ᅩ'=>'ᅩ','ᅪ'=>'ᅪ','ᅫ'=>'ᅫ','ᅬ'=>'ᅬ','ᅭ'=>'ᅭ','ᅮ'=>'ᅮ','ᅯ'=>'ᅯ','ᅰ'=>'ᅰ','ᅱ'=>'ᅱ','ᅲ'=>'ᅲ','ᅳ'=>'ᅳ','ᅴ'=>'ᅴ','ᅵ'=>'ᅵ','¢'=>'¢','£'=>'£','¬'=>'¬',' ̄'=>' ̄','¦'=>'¦','¥'=>'¥','₩'=>'₩','│'=>'│','←'=>'←','↑'=>'↑','→'=>'→','↓'=>'↓','■'=>'■','○'=>'○','𝅗𝅥'=>'𝅗𝅥','𝅘𝅥'=>'𝅘𝅥','𝅘𝅥𝅮'=>'𝅘𝅥𝅮','𝅘𝅥𝅯'=>'𝅘𝅥𝅯','𝅘𝅥𝅰'=>'𝅘𝅥𝅰','𝅘𝅥𝅱'=>'𝅘𝅥𝅱','𝅘𝅥𝅲'=>'𝅘𝅥𝅲','𝆹𝅥'=>'𝆹𝅥','𝆺𝅥'=>'𝆺𝅥','𝆹𝅥𝅮'=>'𝆹𝅥𝅮','𝆺𝅥𝅮'=>'𝆺𝅥𝅮','𝆹𝅥𝅯'=>'𝆹𝅥𝅯','𝆺𝅥𝅯'=>'𝆺𝅥𝅯','𝐀'=>'A','𝐁'=>'B','𝐂'=>'C','𝐃'=>'D','𝐄'=>'E','𝐅'=>'F','𝐆'=>'G','𝐇'=>'H','𝐈'=>'I','𝐉'=>'J','𝐊'=>'K','𝐋'=>'L','𝐌'=>'M','𝐍'=>'N','𝐎'=>'O','𝐏'=>'P','𝐐'=>'Q','𝐑'=>'R','𝐒'=>'S','𝐓'=>'T','𝐔'=>'U','𝐕'=>'V','𝐖'=>'W','𝐗'=>'X','𝐘'=>'Y','𝐙'=>'Z','𝐚'=>'a','𝐛'=>'b','𝐜'=>'c','𝐝'=>'d','𝐞'=>'e','𝐟'=>'f','𝐠'=>'g','𝐡'=>'h','𝐢'=>'i','𝐣'=>'j','𝐤'=>'k','𝐥'=>'l','𝐦'=>'m','𝐧'=>'n','𝐨'=>'o','𝐩'=>'p','𝐪'=>'q','𝐫'=>'r','𝐬'=>'s','𝐭'=>'t','𝐮'=>'u','𝐯'=>'v','𝐰'=>'w','𝐱'=>'x','𝐲'=>'y','𝐳'=>'z','𝐴'=>'A','𝐵'=>'B','𝐶'=>'C','𝐷'=>'D','𝐸'=>'E','𝐹'=>'F','𝐺'=>'G','𝐻'=>'H','𝐼'=>'I','𝐽'=>'J','𝐾'=>'K','𝐿'=>'L','𝑀'=>'M','𝑁'=>'N','𝑂'=>'O','𝑃'=>'P','𝑄'=>'Q','𝑅'=>'R','𝑆'=>'S','𝑇'=>'T','𝑈'=>'U','𝑉'=>'V','𝑊'=>'W','𝑋'=>'X','𝑌'=>'Y','𝑍'=>'Z','𝑎'=>'a','𝑏'=>'b','𝑐'=>'c','𝑑'=>'d','𝑒'=>'e','𝑓'=>'f','𝑔'=>'g','𝑖'=>'i','𝑗'=>'j','𝑘'=>'k','𝑙'=>'l','𝑚'=>'m','𝑛'=>'n','𝑜'=>'o','𝑝'=>'p','𝑞'=>'q','𝑟'=>'r','𝑠'=>'s','𝑡'=>'t','𝑢'=>'u','𝑣'=>'v','𝑤'=>'w','𝑥'=>'x','𝑦'=>'y','𝑧'=>'z','𝑨'=>'A','𝑩'=>'B','𝑪'=>'C','𝑫'=>'D','𝑬'=>'E','𝑭'=>'F','𝑮'=>'G','𝑯'=>'H','𝑰'=>'I','𝑱'=>'J','𝑲'=>'K','𝑳'=>'L','𝑴'=>'M','𝑵'=>'N','𝑶'=>'O','𝑷'=>'P','𝑸'=>'Q','𝑹'=>'R','𝑺'=>'S','𝑻'=>'T','𝑼'=>'U','𝑽'=>'V','𝑾'=>'W','𝑿'=>'X','𝒀'=>'Y','𝒁'=>'Z','𝒂'=>'a','𝒃'=>'b','𝒄'=>'c','𝒅'=>'d','𝒆'=>'e','𝒇'=>'f','𝒈'=>'g','𝒉'=>'h','𝒊'=>'i','𝒋'=>'j','𝒌'=>'k','𝒍'=>'l','𝒎'=>'m','𝒏'=>'n','𝒐'=>'o','𝒑'=>'p','𝒒'=>'q','𝒓'=>'r','𝒔'=>'s','𝒕'=>'t','𝒖'=>'u','𝒗'=>'v','𝒘'=>'w','𝒙'=>'x','𝒚'=>'y','𝒛'=>'z','𝒜'=>'A','𝒞'=>'C','𝒟'=>'D','𝒢'=>'G','𝒥'=>'J','𝒦'=>'K','𝒩'=>'N','𝒪'=>'O','𝒫'=>'P','𝒬'=>'Q','𝒮'=>'S','𝒯'=>'T','𝒰'=>'U','𝒱'=>'V','𝒲'=>'W','𝒳'=>'X','𝒴'=>'Y','𝒵'=>'Z','𝒶'=>'a','𝒷'=>'b','𝒸'=>'c','𝒹'=>'d','𝒻'=>'f','𝒽'=>'h','𝒾'=>'i','𝒿'=>'j','𝓀'=>'k','𝓁'=>'l','𝓂'=>'m','𝓃'=>'n','𝓅'=>'p','𝓆'=>'q','𝓇'=>'r','𝓈'=>'s','𝓉'=>'t','𝓊'=>'u','𝓋'=>'v','𝓌'=>'w','𝓍'=>'x','𝓎'=>'y','𝓏'=>'z','𝓐'=>'A','𝓑'=>'B','𝓒'=>'C','𝓓'=>'D','𝓔'=>'E','𝓕'=>'F','𝓖'=>'G','𝓗'=>'H','𝓘'=>'I','𝓙'=>'J','𝓚'=>'K','𝓛'=>'L','𝓜'=>'M','𝓝'=>'N','𝓞'=>'O','𝓟'=>'P','𝓠'=>'Q','𝓡'=>'R','𝓢'=>'S','𝓣'=>'T','𝓤'=>'U','𝓥'=>'V','𝓦'=>'W','𝓧'=>'X','𝓨'=>'Y','𝓩'=>'Z','𝓪'=>'a','𝓫'=>'b','𝓬'=>'c','𝓭'=>'d','𝓮'=>'e','𝓯'=>'f','𝓰'=>'g','𝓱'=>'h','𝓲'=>'i','𝓳'=>'j','𝓴'=>'k','𝓵'=>'l','𝓶'=>'m','𝓷'=>'n','𝓸'=>'o','𝓹'=>'p','𝓺'=>'q','𝓻'=>'r','𝓼'=>'s','𝓽'=>'t','𝓾'=>'u','𝓿'=>'v','𝔀'=>'w','𝔁'=>'x','𝔂'=>'y','𝔃'=>'z','𝔄'=>'A','𝔅'=>'B','𝔇'=>'D','𝔈'=>'E','𝔉'=>'F','𝔊'=>'G','𝔍'=>'J','𝔎'=>'K','𝔏'=>'L','𝔐'=>'M','𝔑'=>'N','𝔒'=>'O','𝔓'=>'P','𝔔'=>'Q','𝔖'=>'S','𝔗'=>'T','𝔘'=>'U','𝔙'=>'V','𝔚'=>'W','𝔛'=>'X','𝔜'=>'Y','𝔞'=>'a','𝔟'=>'b','𝔠'=>'c','𝔡'=>'d','𝔢'=>'e','𝔣'=>'f','𝔤'=>'g','𝔥'=>'h','𝔦'=>'i','𝔧'=>'j','𝔨'=>'k','𝔩'=>'l','𝔪'=>'m','𝔫'=>'n','𝔬'=>'o','𝔭'=>'p','𝔮'=>'q','𝔯'=>'r','𝔰'=>'s','𝔱'=>'t','𝔲'=>'u','𝔳'=>'v','𝔴'=>'w','𝔵'=>'x','𝔶'=>'y','𝔷'=>'z','𝔸'=>'A','𝔹'=>'B','𝔻'=>'D','𝔼'=>'E','𝔽'=>'F','𝔾'=>'G','𝕀'=>'I','𝕁'=>'J','𝕂'=>'K','𝕃'=>'L','𝕄'=>'M','𝕆'=>'O','𝕊'=>'S','𝕋'=>'T','𝕌'=>'U','𝕍'=>'V','𝕎'=>'W','𝕏'=>'X','𝕐'=>'Y','𝕒'=>'a','𝕓'=>'b','𝕔'=>'c','𝕕'=>'d','𝕖'=>'e','𝕗'=>'f','𝕘'=>'g','𝕙'=>'h','𝕚'=>'i','𝕛'=>'j','𝕜'=>'k','𝕝'=>'l','𝕞'=>'m','𝕟'=>'n','𝕠'=>'o','𝕡'=>'p','𝕢'=>'q','𝕣'=>'r','𝕤'=>'s','𝕥'=>'t','𝕦'=>'u','𝕧'=>'v','𝕨'=>'w','𝕩'=>'x','𝕪'=>'y','𝕫'=>'z','𝕬'=>'A','𝕭'=>'B','𝕮'=>'C','𝕯'=>'D','𝕰'=>'E','𝕱'=>'F','𝕲'=>'G','𝕳'=>'H','𝕴'=>'I','𝕵'=>'J','𝕶'=>'K','𝕷'=>'L','𝕸'=>'M','𝕹'=>'N','𝕺'=>'O','𝕻'=>'P','𝕼'=>'Q','𝕽'=>'R','𝕾'=>'S','𝕿'=>'T','𝖀'=>'U','𝖁'=>'V','𝖂'=>'W','𝖃'=>'X','𝖄'=>'Y','𝖅'=>'Z','𝖆'=>'a','𝖇'=>'b','𝖈'=>'c','𝖉'=>'d','𝖊'=>'e','𝖋'=>'f','𝖌'=>'g','𝖍'=>'h','𝖎'=>'i','𝖏'=>'j','𝖐'=>'k','𝖑'=>'l','𝖒'=>'m','𝖓'=>'n','𝖔'=>'o','𝖕'=>'p','𝖖'=>'q','𝖗'=>'r','𝖘'=>'s','𝖙'=>'t','𝖚'=>'u','𝖛'=>'v','𝖜'=>'w','𝖝'=>'x','𝖞'=>'y','𝖟'=>'z','𝖠'=>'A','𝖡'=>'B','𝖢'=>'C','𝖣'=>'D','𝖤'=>'E','𝖥'=>'F','𝖦'=>'G','𝖧'=>'H','𝖨'=>'I','𝖩'=>'J','𝖪'=>'K','𝖫'=>'L','𝖬'=>'M','𝖭'=>'N','𝖮'=>'O','𝖯'=>'P','𝖰'=>'Q','𝖱'=>'R','𝖲'=>'S','𝖳'=>'T','𝖴'=>'U','𝖵'=>'V','𝖶'=>'W','𝖷'=>'X','𝖸'=>'Y','𝖹'=>'Z','𝖺'=>'a','𝖻'=>'b','𝖼'=>'c','𝖽'=>'d','𝖾'=>'e','𝖿'=>'f','𝗀'=>'g','𝗁'=>'h','𝗂'=>'i','𝗃'=>'j','𝗄'=>'k','𝗅'=>'l','𝗆'=>'m','𝗇'=>'n','𝗈'=>'o','𝗉'=>'p','𝗊'=>'q','𝗋'=>'r','𝗌'=>'s','𝗍'=>'t','𝗎'=>'u','𝗏'=>'v','𝗐'=>'w','𝗑'=>'x','𝗒'=>'y','𝗓'=>'z','𝗔'=>'A','𝗕'=>'B','𝗖'=>'C','𝗗'=>'D','𝗘'=>'E','𝗙'=>'F','𝗚'=>'G','𝗛'=>'H','𝗜'=>'I','𝗝'=>'J','𝗞'=>'K','𝗟'=>'L','𝗠'=>'M','𝗡'=>'N','𝗢'=>'O','𝗣'=>'P','𝗤'=>'Q','𝗥'=>'R','𝗦'=>'S','𝗧'=>'T','𝗨'=>'U','𝗩'=>'V','𝗪'=>'W','𝗫'=>'X','𝗬'=>'Y','𝗭'=>'Z','𝗮'=>'a','𝗯'=>'b','𝗰'=>'c','𝗱'=>'d','𝗲'=>'e','𝗳'=>'f','𝗴'=>'g','𝗵'=>'h','𝗶'=>'i','𝗷'=>'j','𝗸'=>'k','𝗹'=>'l','𝗺'=>'m','𝗻'=>'n','𝗼'=>'o','𝗽'=>'p','𝗾'=>'q','𝗿'=>'r','𝘀'=>'s','𝘁'=>'t','𝘂'=>'u','𝘃'=>'v','𝘄'=>'w','𝘅'=>'x','𝘆'=>'y','𝘇'=>'z','𝘈'=>'A','𝘉'=>'B','𝘊'=>'C','𝘋'=>'D','𝘌'=>'E','𝘍'=>'F','𝘎'=>'G','𝘏'=>'H','𝘐'=>'I','𝘑'=>'J','𝘒'=>'K','𝘓'=>'L','𝘔'=>'M','𝘕'=>'N','𝘖'=>'O','𝘗'=>'P','𝘘'=>'Q','𝘙'=>'R','𝘚'=>'S','𝘛'=>'T','𝘜'=>'U','𝘝'=>'V','𝘞'=>'W','𝘟'=>'X','𝘠'=>'Y','𝘡'=>'Z','𝘢'=>'a','𝘣'=>'b','𝘤'=>'c','𝘥'=>'d','𝘦'=>'e','𝘧'=>'f','𝘨'=>'g','𝘩'=>'h','𝘪'=>'i','𝘫'=>'j','𝘬'=>'k','𝘭'=>'l','𝘮'=>'m','𝘯'=>'n','𝘰'=>'o','𝘱'=>'p','𝘲'=>'q','𝘳'=>'r','𝘴'=>'s','𝘵'=>'t','𝘶'=>'u','𝘷'=>'v','𝘸'=>'w','𝘹'=>'x','𝘺'=>'y','𝘻'=>'z','𝘼'=>'A','𝘽'=>'B','𝘾'=>'C','𝘿'=>'D','𝙀'=>'E','𝙁'=>'F','𝙂'=>'G','𝙃'=>'H','𝙄'=>'I','𝙅'=>'J','𝙆'=>'K','𝙇'=>'L','𝙈'=>'M','𝙉'=>'N','𝙊'=>'O','𝙋'=>'P','𝙌'=>'Q','𝙍'=>'R','𝙎'=>'S','𝙏'=>'T','𝙐'=>'U','𝙑'=>'V','𝙒'=>'W','𝙓'=>'X','𝙔'=>'Y','𝙕'=>'Z','𝙖'=>'a','𝙗'=>'b','𝙘'=>'c','𝙙'=>'d','𝙚'=>'e','𝙛'=>'f','𝙜'=>'g','𝙝'=>'h','𝙞'=>'i','𝙟'=>'j','𝙠'=>'k','𝙡'=>'l','𝙢'=>'m','𝙣'=>'n','𝙤'=>'o','𝙥'=>'p','𝙦'=>'q','𝙧'=>'r','𝙨'=>'s','𝙩'=>'t','𝙪'=>'u','𝙫'=>'v','𝙬'=>'w','𝙭'=>'x','𝙮'=>'y','𝙯'=>'z','𝙰'=>'A','𝙱'=>'B','𝙲'=>'C','𝙳'=>'D','𝙴'=>'E','𝙵'=>'F','𝙶'=>'G','𝙷'=>'H','𝙸'=>'I','𝙹'=>'J','𝙺'=>'K','𝙻'=>'L','𝙼'=>'M','𝙽'=>'N','𝙾'=>'O','𝙿'=>'P','𝚀'=>'Q','𝚁'=>'R','𝚂'=>'S','𝚃'=>'T','𝚄'=>'U','𝚅'=>'V','𝚆'=>'W','𝚇'=>'X','𝚈'=>'Y','𝚉'=>'Z','𝚊'=>'a','𝚋'=>'b','𝚌'=>'c','𝚍'=>'d','𝚎'=>'e','𝚏'=>'f','𝚐'=>'g','𝚑'=>'h','𝚒'=>'i','𝚓'=>'j','𝚔'=>'k','𝚕'=>'l','𝚖'=>'m','𝚗'=>'n','𝚘'=>'o','𝚙'=>'p','𝚚'=>'q','𝚛'=>'r','𝚜'=>'s','𝚝'=>'t','𝚞'=>'u','𝚟'=>'v','𝚠'=>'w','𝚡'=>'x','𝚢'=>'y','𝚣'=>'z','𝚤'=>'ı','𝚥'=>'ȷ','𝚨'=>'Α','𝚩'=>'Β','𝚪'=>'Γ','𝚫'=>'Δ','𝚬'=>'Ε','𝚭'=>'Ζ','𝚮'=>'Η','𝚯'=>'Θ','𝚰'=>'Ι','𝚱'=>'Κ','𝚲'=>'Λ','𝚳'=>'Μ','𝚴'=>'Ν','𝚵'=>'Ξ','𝚶'=>'Ο','𝚷'=>'Π','𝚸'=>'Ρ','𝚹'=>'Θ','𝚺'=>'Σ','𝚻'=>'Τ','𝚼'=>'Υ','𝚽'=>'Φ','𝚾'=>'Χ','𝚿'=>'Ψ','𝛀'=>'Ω','𝛁'=>'∇','𝛂'=>'α','𝛃'=>'β','𝛄'=>'γ','𝛅'=>'δ','𝛆'=>'ε','𝛇'=>'ζ','𝛈'=>'η','𝛉'=>'θ','𝛊'=>'ι','𝛋'=>'κ','𝛌'=>'λ','𝛍'=>'μ','𝛎'=>'ν','𝛏'=>'ξ','𝛐'=>'ο','𝛑'=>'π','𝛒'=>'ρ','𝛓'=>'ς','𝛔'=>'σ','𝛕'=>'τ','𝛖'=>'υ','𝛗'=>'φ','𝛘'=>'χ','𝛙'=>'ψ','𝛚'=>'ω','𝛛'=>'∂','𝛜'=>'ε','𝛝'=>'θ','𝛞'=>'κ','𝛟'=>'φ','𝛠'=>'ρ','𝛡'=>'π','𝛢'=>'Α','𝛣'=>'Β','𝛤'=>'Γ','𝛥'=>'Δ','𝛦'=>'Ε','𝛧'=>'Ζ','𝛨'=>'Η','𝛩'=>'Θ','𝛪'=>'Ι','𝛫'=>'Κ','𝛬'=>'Λ','𝛭'=>'Μ','𝛮'=>'Ν','𝛯'=>'Ξ','𝛰'=>'Ο','𝛱'=>'Π','𝛲'=>'Ρ','𝛳'=>'Θ','𝛴'=>'Σ','𝛵'=>'Τ','𝛶'=>'Υ','𝛷'=>'Φ','𝛸'=>'Χ','𝛹'=>'Ψ','𝛺'=>'Ω','𝛻'=>'∇','𝛼'=>'α','𝛽'=>'β','𝛾'=>'γ','𝛿'=>'δ','𝜀'=>'ε','𝜁'=>'ζ','𝜂'=>'η','𝜃'=>'θ','𝜄'=>'ι','𝜅'=>'κ','𝜆'=>'λ','𝜇'=>'μ','𝜈'=>'ν','𝜉'=>'ξ','𝜊'=>'ο','𝜋'=>'π','𝜌'=>'ρ','𝜍'=>'ς','𝜎'=>'σ','𝜏'=>'τ','𝜐'=>'υ','𝜑'=>'φ','𝜒'=>'χ','𝜓'=>'ψ','𝜔'=>'ω','𝜕'=>'∂','𝜖'=>'ε','𝜗'=>'θ','𝜘'=>'κ','𝜙'=>'φ','𝜚'=>'ρ','𝜛'=>'π','𝜜'=>'Α','𝜝'=>'Β','𝜞'=>'Γ','𝜟'=>'Δ','𝜠'=>'Ε','𝜡'=>'Ζ','𝜢'=>'Η','𝜣'=>'Θ','𝜤'=>'Ι','𝜥'=>'Κ','𝜦'=>'Λ','𝜧'=>'Μ','𝜨'=>'Ν','𝜩'=>'Ξ','𝜪'=>'Ο','𝜫'=>'Π','𝜬'=>'Ρ','𝜭'=>'Θ','𝜮'=>'Σ','𝜯'=>'Τ','𝜰'=>'Υ','𝜱'=>'Φ','𝜲'=>'Χ','𝜳'=>'Ψ','𝜴'=>'Ω','𝜵'=>'∇','𝜶'=>'α','𝜷'=>'β','𝜸'=>'γ','𝜹'=>'δ','𝜺'=>'ε','𝜻'=>'ζ','𝜼'=>'η','𝜽'=>'θ','𝜾'=>'ι','𝜿'=>'κ','𝝀'=>'λ','𝝁'=>'μ','𝝂'=>'ν','𝝃'=>'ξ','𝝄'=>'ο','𝝅'=>'π','𝝆'=>'ρ','𝝇'=>'ς','𝝈'=>'σ','𝝉'=>'τ','𝝊'=>'υ','𝝋'=>'φ','𝝌'=>'χ','𝝍'=>'ψ','𝝎'=>'ω','𝝏'=>'∂','𝝐'=>'ε','𝝑'=>'θ','𝝒'=>'κ','𝝓'=>'φ','𝝔'=>'ρ','𝝕'=>'π','𝝖'=>'Α','𝝗'=>'Β','𝝘'=>'Γ','𝝙'=>'Δ','𝝚'=>'Ε','𝝛'=>'Ζ','𝝜'=>'Η','𝝝'=>'Θ','𝝞'=>'Ι','𝝟'=>'Κ','𝝠'=>'Λ','𝝡'=>'Μ','𝝢'=>'Ν','𝝣'=>'Ξ','𝝤'=>'Ο','𝝥'=>'Π','𝝦'=>'Ρ','𝝧'=>'Θ','𝝨'=>'Σ','𝝩'=>'Τ','𝝪'=>'Υ','𝝫'=>'Φ','𝝬'=>'Χ','𝝭'=>'Ψ','𝝮'=>'Ω','𝝯'=>'∇','𝝰'=>'α','𝝱'=>'β','𝝲'=>'γ','𝝳'=>'δ','𝝴'=>'ε','𝝵'=>'ζ','𝝶'=>'η','𝝷'=>'θ','𝝸'=>'ι','𝝹'=>'κ','𝝺'=>'λ','𝝻'=>'μ','𝝼'=>'ν','𝝽'=>'ξ','𝝾'=>'ο','𝝿'=>'π','𝞀'=>'ρ','𝞁'=>'ς','𝞂'=>'σ','𝞃'=>'τ','𝞄'=>'υ','𝞅'=>'φ','𝞆'=>'χ','𝞇'=>'ψ','𝞈'=>'ω','𝞉'=>'∂','𝞊'=>'ε','𝞋'=>'θ','𝞌'=>'κ','𝞍'=>'φ','𝞎'=>'ρ','𝞏'=>'π','𝞐'=>'Α','𝞑'=>'Β','𝞒'=>'Γ','𝞓'=>'Δ','𝞔'=>'Ε','𝞕'=>'Ζ','𝞖'=>'Η','𝞗'=>'Θ','𝞘'=>'Ι','𝞙'=>'Κ','𝞚'=>'Λ','𝞛'=>'Μ','𝞜'=>'Ν','𝞝'=>'Ξ','𝞞'=>'Ο','𝞟'=>'Π','𝞠'=>'Ρ','𝞡'=>'Θ','𝞢'=>'Σ','𝞣'=>'Τ','𝞤'=>'Υ','𝞥'=>'Φ','𝞦'=>'Χ','𝞧'=>'Ψ','𝞨'=>'Ω','𝞩'=>'∇','𝞪'=>'α','𝞫'=>'β','𝞬'=>'γ','𝞭'=>'δ','𝞮'=>'ε','𝞯'=>'ζ','𝞰'=>'η','𝞱'=>'θ','𝞲'=>'ι','𝞳'=>'κ','𝞴'=>'λ','𝞵'=>'μ','𝞶'=>'ν','𝞷'=>'ξ','𝞸'=>'ο','𝞹'=>'π','𝞺'=>'ρ','𝞻'=>'ς','𝞼'=>'σ','𝞽'=>'τ','𝞾'=>'υ','𝞿'=>'φ','𝟀'=>'χ','𝟁'=>'ψ','𝟂'=>'ω','𝟃'=>'∂','𝟄'=>'ε','𝟅'=>'θ','𝟆'=>'κ','𝟇'=>'φ','𝟈'=>'ρ','𝟉'=>'π','𝟊'=>'Ϝ','𝟋'=>'ϝ','𝟎'=>'0','𝟏'=>'1','𝟐'=>'2','𝟑'=>'3','𝟒'=>'4','𝟓'=>'5','𝟔'=>'6','𝟕'=>'7','𝟖'=>'8','𝟗'=>'9','𝟘'=>'0','𝟙'=>'1','𝟚'=>'2','𝟛'=>'3','𝟜'=>'4','𝟝'=>'5','𝟞'=>'6','𝟟'=>'7','𝟠'=>'8','𝟡'=>'9','𝟢'=>'0','𝟣'=>'1','𝟤'=>'2','𝟥'=>'3','𝟦'=>'4','𝟧'=>'5','𝟨'=>'6','𝟩'=>'7','𝟪'=>'8','𝟫'=>'9','𝟬'=>'0','𝟭'=>'1','𝟮'=>'2','𝟯'=>'3','𝟰'=>'4','𝟱'=>'5','𝟲'=>'6','𝟳'=>'7','𝟴'=>'8','𝟵'=>'9','𝟶'=>'0','𝟷'=>'1','𝟸'=>'2','𝟹'=>'3','𝟺'=>'4','𝟻'=>'5','𝟼'=>'6','𝟽'=>'7','𝟾'=>'8','𝟿'=>'9','丽'=>'丽','丸'=>'丸','乁'=>'乁','𠄢'=>'𠄢','你'=>'你','侮'=>'侮','侻'=>'侻','倂'=>'倂','偺'=>'偺','備'=>'備','僧'=>'僧','像'=>'像','㒞'=>'㒞','𠘺'=>'𠘺','免'=>'免','兔'=>'兔','兤'=>'兤','具'=>'具','𠔜'=>'𠔜','㒹'=>'㒹','內'=>'內','再'=>'再','𠕋'=>'𠕋','冗'=>'冗','冤'=>'冤','仌'=>'仌','冬'=>'冬','况'=>'况','𩇟'=>'𩇟','凵'=>'凵','刃'=>'刃','㓟'=>'㓟','刻'=>'刻','剆'=>'剆','割'=>'割','剷'=>'剷','㔕'=>'㔕','勇'=>'勇','勉'=>'勉','勤'=>'勤','勺'=>'勺','包'=>'包','匆'=>'匆','北'=>'北','卉'=>'卉','卑'=>'卑','博'=>'博','即'=>'即','卽'=>'卽','卿'=>'卿','卿'=>'卿','卿'=>'卿','𠨬'=>'𠨬','灰'=>'灰','及'=>'及','叟'=>'叟','𠭣'=>'𠭣','叫'=>'叫','叱'=>'叱','吆'=>'吆','咞'=>'咞','吸'=>'吸','呈'=>'呈','周'=>'周','咢'=>'咢','哶'=>'哶','唐'=>'唐','啓'=>'啓','啣'=>'啣','善'=>'善','善'=>'善','喙'=>'喙','喫'=>'喫','喳'=>'喳','嗂'=>'嗂','圖'=>'圖','嘆'=>'嘆','圗'=>'圗','噑'=>'噑','噴'=>'噴','切'=>'切','壮'=>'壮','城'=>'城','埴'=>'埴','堍'=>'堍','型'=>'型','堲'=>'堲','報'=>'報','墬'=>'墬','𡓤'=>'𡓤','売'=>'売','壷'=>'壷','夆'=>'夆','多'=>'多','夢'=>'夢','奢'=>'奢','𡚨'=>'𡚨','𡛪'=>'𡛪','姬'=>'姬','娛'=>'娛','娧'=>'娧','姘'=>'姘','婦'=>'婦','㛮'=>'㛮','㛼'=>'㛼','嬈'=>'嬈','嬾'=>'嬾','嬾'=>'嬾','𡧈'=>'𡧈','寃'=>'寃','寘'=>'寘','寧'=>'寧','寳'=>'寳','𡬘'=>'𡬘','寿'=>'寿','将'=>'将','当'=>'当','尢'=>'尢','㞁'=>'㞁','屠'=>'屠','屮'=>'屮','峀'=>'峀','岍'=>'岍','𡷤'=>'𡷤','嵃'=>'嵃','𡷦'=>'𡷦','嵮'=>'嵮','嵫'=>'嵫','嵼'=>'嵼','巡'=>'巡','巢'=>'巢','㠯'=>'㠯','巽'=>'巽','帨'=>'帨','帽'=>'帽','幩'=>'幩','㡢'=>'㡢','𢆃'=>'𢆃','㡼'=>'㡼','庰'=>'庰','庳'=>'庳','庶'=>'庶','廊'=>'廊','𪎒'=>'𪎒','廾'=>'廾','𢌱'=>'𢌱','𢌱'=>'𢌱','舁'=>'舁','弢'=>'弢','弢'=>'弢','㣇'=>'㣇','𣊸'=>'𣊸','𦇚'=>'𦇚','形'=>'形','彫'=>'彫','㣣'=>'㣣','徚'=>'徚','忍'=>'忍','志'=>'志','忹'=>'忹','悁'=>'悁','㤺'=>'㤺','㤜'=>'㤜','悔'=>'悔','𢛔'=>'𢛔','惇'=>'惇','慈'=>'慈','慌'=>'慌','慎'=>'慎','慌'=>'慌','慺'=>'慺','憎'=>'憎','憲'=>'憲','憤'=>'憤','憯'=>'憯','懞'=>'懞','懲'=>'懲','懶'=>'懶','成'=>'成','戛'=>'戛','扝'=>'扝','抱'=>'抱','拔'=>'拔','捐'=>'捐','𢬌'=>'𢬌','挽'=>'挽','拼'=>'拼','捨'=>'捨','掃'=>'掃','揤'=>'揤','𢯱'=>'𢯱','搢'=>'搢','揅'=>'揅','掩'=>'掩','㨮'=>'㨮','摩'=>'摩','摾'=>'摾','撝'=>'撝','摷'=>'摷','㩬'=>'㩬','敏'=>'敏','敬'=>'敬','𣀊'=>'𣀊','旣'=>'旣','書'=>'書','晉'=>'晉','㬙'=>'㬙','暑'=>'暑','㬈'=>'㬈','㫤'=>'㫤','冒'=>'冒','冕'=>'冕','最'=>'最','暜'=>'暜','肭'=>'肭','䏙'=>'䏙','朗'=>'朗','望'=>'望','朡'=>'朡','杞'=>'杞','杓'=>'杓','𣏃'=>'𣏃','㭉'=>'㭉','柺'=>'柺','枅'=>'枅','桒'=>'桒','梅'=>'梅','𣑭'=>'𣑭','梎'=>'梎','栟'=>'栟','椔'=>'椔','㮝'=>'㮝','楂'=>'楂','榣'=>'榣','槪'=>'槪','檨'=>'檨','𣚣'=>'𣚣','櫛'=>'櫛','㰘'=>'㰘','次'=>'次','𣢧'=>'𣢧','歔'=>'歔','㱎'=>'㱎','歲'=>'歲','殟'=>'殟','殺'=>'殺','殻'=>'殻','𣪍'=>'𣪍','𡴋'=>'𡴋','𣫺'=>'𣫺','汎'=>'汎','𣲼'=>'𣲼','沿'=>'沿','泍'=>'泍','汧'=>'汧','洖'=>'洖','派'=>'派','海'=>'海','流'=>'流','浩'=>'浩','浸'=>'浸','涅'=>'涅','𣴞'=>'𣴞','洴'=>'洴','港'=>'港','湮'=>'湮','㴳'=>'㴳','滋'=>'滋','滇'=>'滇','𣻑'=>'𣻑','淹'=>'淹','潮'=>'潮','𣽞'=>'𣽞','𣾎'=>'𣾎','濆'=>'濆','瀹'=>'瀹','瀞'=>'瀞','瀛'=>'瀛','㶖'=>'㶖','灊'=>'灊','災'=>'災','灷'=>'灷','炭'=>'炭','𠔥'=>'𠔥','煅'=>'煅','𤉣'=>'𤉣','熜'=>'熜','𤎫'=>'𤎫','爨'=>'爨','爵'=>'爵','牐'=>'牐','𤘈'=>'𤘈','犀'=>'犀','犕'=>'犕','𤜵'=>'𤜵','𤠔'=>'𤠔','獺'=>'獺','王'=>'王','㺬'=>'㺬','玥'=>'玥','㺸'=>'㺸','㺸'=>'㺸','瑇'=>'瑇','瑜'=>'瑜','瑱'=>'瑱','璅'=>'璅','瓊'=>'瓊','㼛'=>'㼛','甤'=>'甤','𤰶'=>'𤰶','甾'=>'甾','𤲒'=>'𤲒','異'=>'異','𢆟'=>'𢆟','瘐'=>'瘐','𤾡'=>'𤾡','𤾸'=>'𤾸','𥁄'=>'𥁄','㿼'=>'㿼','䀈'=>'䀈','直'=>'直','𥃳'=>'𥃳','𥃲'=>'𥃲','𥄙'=>'𥄙','𥄳'=>'𥄳','眞'=>'眞','真'=>'真','真'=>'真','睊'=>'睊','䀹'=>'䀹','瞋'=>'瞋','䁆'=>'䁆','䂖'=>'䂖','𥐝'=>'𥐝','硎'=>'硎','碌'=>'碌','磌'=>'磌','䃣'=>'䃣','𥘦'=>'𥘦','祖'=>'祖','𥚚'=>'𥚚','𥛅'=>'𥛅','福'=>'福','秫'=>'秫','䄯'=>'䄯','穀'=>'穀','穊'=>'穊','穏'=>'穏','𥥼'=>'𥥼','𥪧'=>'𥪧','𥪧'=>'𥪧','竮'=>'竮','䈂'=>'䈂','𥮫'=>'𥮫','篆'=>'篆','築'=>'築','䈧'=>'䈧','𥲀'=>'𥲀','糒'=>'糒','䊠'=>'䊠','糨'=>'糨','糣'=>'糣','紀'=>'紀','𥾆'=>'𥾆','絣'=>'絣','䌁'=>'䌁','緇'=>'緇','縂'=>'縂','繅'=>'繅','䌴'=>'䌴','𦈨'=>'𦈨','𦉇'=>'𦉇','䍙'=>'䍙','𦋙'=>'𦋙','罺'=>'罺','𦌾'=>'𦌾','羕'=>'羕','翺'=>'翺','者'=>'者','𦓚'=>'𦓚','𦔣'=>'𦔣','聠'=>'聠','𦖨'=>'𦖨','聰'=>'聰','𣍟'=>'𣍟','䏕'=>'䏕','育'=>'育','脃'=>'脃','䐋'=>'䐋','脾'=>'脾','媵'=>'媵','𦞧'=>'𦞧','𦞵'=>'𦞵','𣎓'=>'𣎓','𣎜'=>'𣎜','舁'=>'舁','舄'=>'舄','辞'=>'辞','䑫'=>'䑫','芑'=>'芑','芋'=>'芋','芝'=>'芝','劳'=>'劳','花'=>'花','芳'=>'芳','芽'=>'芽','苦'=>'苦','𦬼'=>'𦬼','若'=>'若','茝'=>'茝','荣'=>'荣','莭'=>'莭','茣'=>'茣','莽'=>'莽','菧'=>'菧','著'=>'著','荓'=>'荓','菊'=>'菊','菌'=>'菌','菜'=>'菜','𦰶'=>'𦰶','𦵫'=>'𦵫','𦳕'=>'𦳕','䔫'=>'䔫','蓱'=>'蓱','蓳'=>'蓳','蔖'=>'蔖','𧏊'=>'𧏊','蕤'=>'蕤','𦼬'=>'𦼬','䕝'=>'䕝','䕡'=>'䕡','𦾱'=>'𦾱','𧃒'=>'𧃒','䕫'=>'䕫','虐'=>'虐','虜'=>'虜','虧'=>'虧','虩'=>'虩','蚩'=>'蚩','蚈'=>'蚈','蜎'=>'蜎','蛢'=>'蛢','蝹'=>'蝹','蜨'=>'蜨','蝫'=>'蝫','螆'=>'螆','䗗'=>'䗗','蟡'=>'蟡','蠁'=>'蠁','䗹'=>'䗹','衠'=>'衠','衣'=>'衣','𧙧'=>'𧙧','裗'=>'裗','裞'=>'裞','䘵'=>'䘵','裺'=>'裺','㒻'=>'㒻','𧢮'=>'𧢮','𧥦'=>'𧥦','䚾'=>'䚾','䛇'=>'䛇','誠'=>'誠','諭'=>'諭','變'=>'變','豕'=>'豕','𧲨'=>'𧲨','貫'=>'貫','賁'=>'賁','贛'=>'贛','起'=>'起','𧼯'=>'𧼯','𠠄'=>'𠠄','跋'=>'跋','趼'=>'趼','跰'=>'跰','𠣞'=>'𠣞','軔'=>'軔','輸'=>'輸','𨗒'=>'𨗒','𨗭'=>'𨗭','邔'=>'邔','郱'=>'郱','鄑'=>'鄑','𨜮'=>'𨜮','鄛'=>'鄛','鈸'=>'鈸','鋗'=>'鋗','鋘'=>'鋘','鉼'=>'鉼','鏹'=>'鏹','鐕'=>'鐕','𨯺'=>'𨯺','開'=>'開','䦕'=>'䦕','閷'=>'閷','𨵷'=>'𨵷','䧦'=>'䧦','雃'=>'雃','嶲'=>'嶲','霣'=>'霣','𩅅'=>'𩅅','𩈚'=>'𩈚','䩮'=>'䩮','䩶'=>'䩶','韠'=>'韠','𩐊'=>'𩐊','䪲'=>'䪲','𩒖'=>'𩒖','頋'=>'頋','頋'=>'頋','頩'=>'頩','𩖶'=>'𩖶','飢'=>'飢','䬳'=>'䬳','餩'=>'餩','馧'=>'馧','駂'=>'駂','駾'=>'駾','䯎'=>'䯎','𩬰'=>'𩬰','鬒'=>'鬒','鱀'=>'鱀','鳽'=>'鳽','䳎'=>'䳎','䳭'=>'䳭','鵧'=>'鵧','𪃎'=>'𪃎','䳸'=>'䳸','𪄅'=>'𪄅','𪈎'=>'𪈎','𪊑'=>'𪊑','麻'=>'麻','䵖'=>'䵖','黹'=>'黹','黾'=>'黾','鼅'=>'鼅','鼏'=>'鼏','鼖'=>'鼖','鼻'=>'鼻','𪘀'=>'𪘀');
diff --git a/phpBB/includes/utf/data/utf_nfc_qc.php b/phpBB/includes/utf/data/utf_nfc_qc.php
index 03031f8b6d..ff56357ea6 100644
--- a/phpBB/includes/utf/data/utf_nfc_qc.php
+++ b/phpBB/includes/utf/data/utf_nfc_qc.php
@@ -1,2 +1,2 @@
<?php
-$GLOBALS['utf_nfc_qc']=array('̀'=>1,'́'=>1,'̓'=>1,'̈́'=>1,'ʹ'=>1,';'=>1,'·'=>1,'क़'=>1,'ख़'=>1,'ग़'=>1,'ज़'=>1,'ड़'=>1,'ढ़'=>1,'फ़'=>1,'य़'=>1,'ড়'=>1,'ঢ়'=>1,'য়'=>1,'ਲ਼'=>1,'ਸ਼'=>1,'ਖ਼'=>1,'ਗ਼'=>1,'ਜ਼'=>1,'ਫ਼'=>1,'ଡ଼'=>1,'ଢ଼'=>1,'གྷ'=>1,'ཌྷ'=>1,'དྷ'=>1,'བྷ'=>1,'ཛྷ'=>1,'ཀྵ'=>1,'ཱི'=>1,'ཱུ'=>1,'ྲྀ'=>1,'ླྀ'=>1,'ཱྀ'=>1,'ྒྷ'=>1,'ྜྷ'=>1,'ྡྷ'=>1,'ྦྷ'=>1,'ྫྷ'=>1,'ྐྵ'=>1,'ά'=>1,'έ'=>1,'ή'=>1,'ί'=>1,'ό'=>1,'ύ'=>1,'ώ'=>1,'Ά'=>1,'ι'=>1,'Έ'=>1,'Ή'=>1,'ΐ'=>1,'Ί'=>1,'ΰ'=>1,'Ύ'=>1,'΅'=>1,'`'=>1,'Ό'=>1,'Ώ'=>1,'´'=>1,' '=>1,' '=>1,'Ω'=>1,'K'=>1,'Å'=>1,'〈'=>1,'〉'=>1,'⫝̸'=>1,'豈'=>1,'更'=>1,'車'=>1,'賈'=>1,'滑'=>1,'串'=>1,'句'=>1,'龜'=>1,'龜'=>1,'契'=>1,'金'=>1,'喇'=>1,'奈'=>1,'懶'=>1,'癩'=>1,'羅'=>1,'蘿'=>1,'螺'=>1,'裸'=>1,'邏'=>1,'樂'=>1,'洛'=>1,'烙'=>1,'珞'=>1,'落'=>1,'酪'=>1,'駱'=>1,'亂'=>1,'卵'=>1,'欄'=>1,'爛'=>1,'蘭'=>1,'鸞'=>1,'嵐'=>1,'濫'=>1,'藍'=>1,'襤'=>1,'拉'=>1,'臘'=>1,'蠟'=>1,'廊'=>1,'朗'=>1,'浪'=>1,'狼'=>1,'郎'=>1,'來'=>1,'冷'=>1,'勞'=>1,'擄'=>1,'櫓'=>1,'爐'=>1,'盧'=>1,'老'=>1,'蘆'=>1,'虜'=>1,'路'=>1,'露'=>1,'魯'=>1,'鷺'=>1,'碌'=>1,'祿'=>1,'綠'=>1,'菉'=>1,'錄'=>1,'鹿'=>1,'論'=>1,'壟'=>1,'弄'=>1,'籠'=>1,'聾'=>1,'牢'=>1,'磊'=>1,'賂'=>1,'雷'=>1,'壘'=>1,'屢'=>1,'樓'=>1,'淚'=>1,'漏'=>1,'累'=>1,'縷'=>1,'陋'=>1,'勒'=>1,'肋'=>1,'凜'=>1,'凌'=>1,'稜'=>1,'綾'=>1,'菱'=>1,'陵'=>1,'讀'=>1,'拏'=>1,'樂'=>1,'諾'=>1,'丹'=>1,'寧'=>1,'怒'=>1,'率'=>1,'異'=>1,'北'=>1,'磻'=>1,'便'=>1,'復'=>1,'不'=>1,'泌'=>1,'數'=>1,'索'=>1,'參'=>1,'塞'=>1,'省'=>1,'葉'=>1,'說'=>1,'殺'=>1,'辰'=>1,'沈'=>1,'拾'=>1,'若'=>1,'掠'=>1,'略'=>1,'亮'=>1,'兩'=>1,'凉'=>1,'梁'=>1,'糧'=>1,'良'=>1,'諒'=>1,'量'=>1,'勵'=>1,'呂'=>1,'女'=>1,'廬'=>1,'旅'=>1,'濾'=>1,'礪'=>1,'閭'=>1,'驪'=>1,'麗'=>1,'黎'=>1,'力'=>1,'曆'=>1,'歷'=>1,'轢'=>1,'年'=>1,'憐'=>1,'戀'=>1,'撚'=>1,'漣'=>1,'煉'=>1,'璉'=>1,'秊'=>1,'練'=>1,'聯'=>1,'輦'=>1,'蓮'=>1,'連'=>1,'鍊'=>1,'列'=>1,'劣'=>1,'咽'=>1,'烈'=>1,'裂'=>1,'說'=>1,'廉'=>1,'念'=>1,'捻'=>1,'殮'=>1,'簾'=>1,'獵'=>1,'令'=>1,'囹'=>1,'寧'=>1,'嶺'=>1,'怜'=>1,'玲'=>1,'瑩'=>1,'羚'=>1,'聆'=>1,'鈴'=>1,'零'=>1,'靈'=>1,'領'=>1,'例'=>1,'禮'=>1,'醴'=>1,'隸'=>1,'惡'=>1,'了'=>1,'僚'=>1,'寮'=>1,'尿'=>1,'料'=>1,'樂'=>1,'燎'=>1,'療'=>1,'蓼'=>1,'遼'=>1,'龍'=>1,'暈'=>1,'阮'=>1,'劉'=>1,'杻'=>1,'柳'=>1,'流'=>1,'溜'=>1,'琉'=>1,'留'=>1,'硫'=>1,'紐'=>1,'類'=>1,'六'=>1,'戮'=>1,'陸'=>1,'倫'=>1,'崙'=>1,'淪'=>1,'輪'=>1,'律'=>1,'慄'=>1,'栗'=>1,'率'=>1,'隆'=>1,'利'=>1,'吏'=>1,'履'=>1,'易'=>1,'李'=>1,'梨'=>1,'泥'=>1,'理'=>1,'痢'=>1,'罹'=>1,'裏'=>1,'裡'=>1,'里'=>1,'離'=>1,'匿'=>1,'溺'=>1,'吝'=>1,'燐'=>1,'璘'=>1,'藺'=>1,'隣'=>1,'鱗'=>1,'麟'=>1,'林'=>1,'淋'=>1,'臨'=>1,'立'=>1,'笠'=>1,'粒'=>1,'狀'=>1,'炙'=>1,'識'=>1,'什'=>1,'茶'=>1,'刺'=>1,'切'=>1,'度'=>1,'拓'=>1,'糖'=>1,'宅'=>1,'洞'=>1,'暴'=>1,'輻'=>1,'行'=>1,'降'=>1,'見'=>1,'廓'=>1,'兀'=>1,'嗀'=>1,'塚'=>1,'晴'=>1,'凞'=>1,'猪'=>1,'益'=>1,'礼'=>1,'神'=>1,'祥'=>1,'福'=>1,'靖'=>1,'精'=>1,'羽'=>1,'蘒'=>1,'諸'=>1,'逸'=>1,'都'=>1,'飯'=>1,'飼'=>1,'館'=>1,'鶴'=>1,'侮'=>1,'僧'=>1,'免'=>1,'勉'=>1,'勤'=>1,'卑'=>1,'喝'=>1,'嘆'=>1,'器'=>1,'塀'=>1,'墨'=>1,'層'=>1,'屮'=>1,'悔'=>1,'慨'=>1,'憎'=>1,'懲'=>1,'敏'=>1,'既'=>1,'暑'=>1,'梅'=>1,'海'=>1,'渚'=>1,'漢'=>1,'煮'=>1,'爫'=>1,'琢'=>1,'碑'=>1,'社'=>1,'祉'=>1,'祈'=>1,'祐'=>1,'祖'=>1,'祝'=>1,'禍'=>1,'禎'=>1,'穀'=>1,'突'=>1,'節'=>1,'練'=>1,'縉'=>1,'繁'=>1,'署'=>1,'者'=>1,'臭'=>1,'艹'=>1,'艹'=>1,'著'=>1,'褐'=>1,'視'=>1,'謁'=>1,'謹'=>1,'賓'=>1,'贈'=>1,'辶'=>1,'逸'=>1,'難'=>1,'響'=>1,'頻'=>1,'並'=>1,'况'=>1,'全'=>1,'侀'=>1,'充'=>1,'冀'=>1,'勇'=>1,'勺'=>1,'喝'=>1,'啕'=>1,'喙'=>1,'嗢'=>1,'塚'=>1,'墳'=>1,'奄'=>1,'奔'=>1,'婢'=>1,'嬨'=>1,'廒'=>1,'廙'=>1,'彩'=>1,'徭'=>1,'惘'=>1,'慎'=>1,'愈'=>1,'憎'=>1,'慠'=>1,'懲'=>1,'戴'=>1,'揄'=>1,'搜'=>1,'摒'=>1,'敖'=>1,'晴'=>1,'朗'=>1,'望'=>1,'杖'=>1,'歹'=>1,'殺'=>1,'流'=>1,'滛'=>1,'滋'=>1,'漢'=>1,'瀞'=>1,'煮'=>1,'瞧'=>1,'爵'=>1,'犯'=>1,'猪'=>1,'瑱'=>1,'甆'=>1,'画'=>1,'瘝'=>1,'瘟'=>1,'益'=>1,'盛'=>1,'直'=>1,'睊'=>1,'着'=>1,'磌'=>1,'窱'=>1,'節'=>1,'类'=>1,'絛'=>1,'練'=>1,'缾'=>1,'者'=>1,'荒'=>1,'華'=>1,'蝹'=>1,'襁'=>1,'覆'=>1,'視'=>1,'調'=>1,'諸'=>1,'請'=>1,'謁'=>1,'諾'=>1,'諭'=>1,'謹'=>1,'變'=>1,'贈'=>1,'輸'=>1,'遲'=>1,'醙'=>1,'鉶'=>1,'陼'=>1,'難'=>1,'靖'=>1,'韛'=>1,'響'=>1,'頋'=>1,'頻'=>1,'鬒'=>1,'龜'=>1,'𢡊'=>1,'𢡄'=>1,'𣏕'=>1,'㮝'=>1,'䀘'=>1,'䀹'=>1,'𥉉'=>1,'𥳐'=>1,'𧻓'=>1,'齃'=>1,'龎'=>1,'יִ'=>1,'ײַ'=>1,'שׁ'=>1,'שׂ'=>1,'שּׁ'=>1,'שּׂ'=>1,'אַ'=>1,'אָ'=>1,'אּ'=>1,'בּ'=>1,'גּ'=>1,'דּ'=>1,'הּ'=>1,'וּ'=>1,'זּ'=>1,'טּ'=>1,'יּ'=>1,'ךּ'=>1,'כּ'=>1,'לּ'=>1,'מּ'=>1,'נּ'=>1,'סּ'=>1,'ףּ'=>1,'פּ'=>1,'צּ'=>1,'קּ'=>1,'רּ'=>1,'שּ'=>1,'תּ'=>1,'וֹ'=>1,'בֿ'=>1,'כֿ'=>1,'פֿ'=>1,'𝅗𝅥'=>1,'𝅘𝅥'=>1,'𝅘𝅥𝅮'=>1,'𝅘𝅥𝅯'=>1,'𝅘𝅥𝅰'=>1,'𝅘𝅥𝅱'=>1,'𝅘𝅥𝅲'=>1,'𝆹𝅥'=>1,'𝆺𝅥'=>1,'𝆹𝅥𝅮'=>1,'𝆺𝅥𝅮'=>1,'𝆹𝅥𝅯'=>1,'𝆺𝅥𝅯'=>1,'丽'=>1,'丸'=>1,'乁'=>1,'𠄢'=>1,'你'=>1,'侮'=>1,'侻'=>1,'倂'=>1,'偺'=>1,'備'=>1,'僧'=>1,'像'=>1,'㒞'=>1,'𠘺'=>1,'免'=>1,'兔'=>1,'兤'=>1,'具'=>1,'𠔜'=>1,'㒹'=>1,'內'=>1,'再'=>1,'𠕋'=>1,'冗'=>1,'冤'=>1,'仌'=>1,'冬'=>1,'况'=>1,'𩇟'=>1,'凵'=>1,'刃'=>1,'㓟'=>1,'刻'=>1,'剆'=>1,'割'=>1,'剷'=>1,'㔕'=>1,'勇'=>1,'勉'=>1,'勤'=>1,'勺'=>1,'包'=>1,'匆'=>1,'北'=>1,'卉'=>1,'卑'=>1,'博'=>1,'即'=>1,'卽'=>1,'卿'=>1,'卿'=>1,'卿'=>1,'𠨬'=>1,'灰'=>1,'及'=>1,'叟'=>1,'𠭣'=>1,'叫'=>1,'叱'=>1,'吆'=>1,'咞'=>1,'吸'=>1,'呈'=>1,'周'=>1,'咢'=>1,'哶'=>1,'唐'=>1,'啓'=>1,'啣'=>1,'善'=>1,'善'=>1,'喙'=>1,'喫'=>1,'喳'=>1,'嗂'=>1,'圖'=>1,'嘆'=>1,'圗'=>1,'噑'=>1,'噴'=>1,'切'=>1,'壮'=>1,'城'=>1,'埴'=>1,'堍'=>1,'型'=>1,'堲'=>1,'報'=>1,'墬'=>1,'𡓤'=>1,'売'=>1,'壷'=>1,'夆'=>1,'多'=>1,'夢'=>1,'奢'=>1,'𡚨'=>1,'𡛪'=>1,'姬'=>1,'娛'=>1,'娧'=>1,'姘'=>1,'婦'=>1,'㛮'=>1,'㛼'=>1,'嬈'=>1,'嬾'=>1,'嬾'=>1,'𡧈'=>1,'寃'=>1,'寘'=>1,'寧'=>1,'寳'=>1,'𡬘'=>1,'寿'=>1,'将'=>1,'当'=>1,'尢'=>1,'㞁'=>1,'屠'=>1,'屮'=>1,'峀'=>1,'岍'=>1,'𡷤'=>1,'嵃'=>1,'𡷦'=>1,'嵮'=>1,'嵫'=>1,'嵼'=>1,'巡'=>1,'巢'=>1,'㠯'=>1,'巽'=>1,'帨'=>1,'帽'=>1,'幩'=>1,'㡢'=>1,'𢆃'=>1,'㡼'=>1,'庰'=>1,'庳'=>1,'庶'=>1,'廊'=>1,'𪎒'=>1,'廾'=>1,'𢌱'=>1,'𢌱'=>1,'舁'=>1,'弢'=>1,'弢'=>1,'㣇'=>1,'𣊸'=>1,'𦇚'=>1,'形'=>1,'彫'=>1,'㣣'=>1,'徚'=>1,'忍'=>1,'志'=>1,'忹'=>1,'悁'=>1,'㤺'=>1,'㤜'=>1,'悔'=>1,'𢛔'=>1,'惇'=>1,'慈'=>1,'慌'=>1,'慎'=>1,'慌'=>1,'慺'=>1,'憎'=>1,'憲'=>1,'憤'=>1,'憯'=>1,'懞'=>1,'懲'=>1,'懶'=>1,'成'=>1,'戛'=>1,'扝'=>1,'抱'=>1,'拔'=>1,'捐'=>1,'𢬌'=>1,'挽'=>1,'拼'=>1,'捨'=>1,'掃'=>1,'揤'=>1,'𢯱'=>1,'搢'=>1,'揅'=>1,'掩'=>1,'㨮'=>1,'摩'=>1,'摾'=>1,'撝'=>1,'摷'=>1,'㩬'=>1,'敏'=>1,'敬'=>1,'𣀊'=>1,'旣'=>1,'書'=>1,'晉'=>1,'㬙'=>1,'暑'=>1,'㬈'=>1,'㫤'=>1,'冒'=>1,'冕'=>1,'最'=>1,'暜'=>1,'肭'=>1,'䏙'=>1,'朗'=>1,'望'=>1,'朡'=>1,'杞'=>1,'杓'=>1,'𣏃'=>1,'㭉'=>1,'柺'=>1,'枅'=>1,'桒'=>1,'梅'=>1,'𣑭'=>1,'梎'=>1,'栟'=>1,'椔'=>1,'㮝'=>1,'楂'=>1,'榣'=>1,'槪'=>1,'檨'=>1,'𣚣'=>1,'櫛'=>1,'㰘'=>1,'次'=>1,'𣢧'=>1,'歔'=>1,'㱎'=>1,'歲'=>1,'殟'=>1,'殺'=>1,'殻'=>1,'𣪍'=>1,'𡴋'=>1,'𣫺'=>1,'汎'=>1,'𣲼'=>1,'沿'=>1,'泍'=>1,'汧'=>1,'洖'=>1,'派'=>1,'海'=>1,'流'=>1,'浩'=>1,'浸'=>1,'涅'=>1,'𣴞'=>1,'洴'=>1,'港'=>1,'湮'=>1,'㴳'=>1,'滋'=>1,'滇'=>1,'𣻑'=>1,'淹'=>1,'潮'=>1,'𣽞'=>1,'𣾎'=>1,'濆'=>1,'瀹'=>1,'瀞'=>1,'瀛'=>1,'㶖'=>1,'灊'=>1,'災'=>1,'灷'=>1,'炭'=>1,'𠔥'=>1,'煅'=>1,'𤉣'=>1,'熜'=>1,'𤎫'=>1,'爨'=>1,'爵'=>1,'牐'=>1,'𤘈'=>1,'犀'=>1,'犕'=>1,'𤜵'=>1,'𤠔'=>1,'獺'=>1,'王'=>1,'㺬'=>1,'玥'=>1,'㺸'=>1,'㺸'=>1,'瑇'=>1,'瑜'=>1,'瑱'=>1,'璅'=>1,'瓊'=>1,'㼛'=>1,'甤'=>1,'𤰶'=>1,'甾'=>1,'𤲒'=>1,'異'=>1,'𢆟'=>1,'瘐'=>1,'𤾡'=>1,'𤾸'=>1,'𥁄'=>1,'㿼'=>1,'䀈'=>1,'直'=>1,'𥃳'=>1,'𥃲'=>1,'𥄙'=>1,'𥄳'=>1,'眞'=>1,'真'=>1,'真'=>1,'睊'=>1,'䀹'=>1,'瞋'=>1,'䁆'=>1,'䂖'=>1,'𥐝'=>1,'硎'=>1,'碌'=>1,'磌'=>1,'䃣'=>1,'𥘦'=>1,'祖'=>1,'𥚚'=>1,'𥛅'=>1,'福'=>1,'秫'=>1,'䄯'=>1,'穀'=>1,'穊'=>1,'穏'=>1,'𥥼'=>1,'𥪧'=>1,'𥪧'=>1,'竮'=>1,'䈂'=>1,'𥮫'=>1,'篆'=>1,'築'=>1,'䈧'=>1,'𥲀'=>1,'糒'=>1,'䊠'=>1,'糨'=>1,'糣'=>1,'紀'=>1,'𥾆'=>1,'絣'=>1,'䌁'=>1,'緇'=>1,'縂'=>1,'繅'=>1,'䌴'=>1,'𦈨'=>1,'𦉇'=>1,'䍙'=>1,'𦋙'=>1,'罺'=>1,'𦌾'=>1,'羕'=>1,'翺'=>1,'者'=>1,'𦓚'=>1,'𦔣'=>1,'聠'=>1,'𦖨'=>1,'聰'=>1,'𣍟'=>1,'䏕'=>1,'育'=>1,'脃'=>1,'䐋'=>1,'脾'=>1,'媵'=>1,'𦞧'=>1,'𦞵'=>1,'𣎓'=>1,'𣎜'=>1,'舁'=>1,'舄'=>1,'辞'=>1,'䑫'=>1,'芑'=>1,'芋'=>1,'芝'=>1,'劳'=>1,'花'=>1,'芳'=>1,'芽'=>1,'苦'=>1,'𦬼'=>1,'若'=>1,'茝'=>1,'荣'=>1,'莭'=>1,'茣'=>1,'莽'=>1,'菧'=>1,'著'=>1,'荓'=>1,'菊'=>1,'菌'=>1,'菜'=>1,'𦰶'=>1,'𦵫'=>1,'𦳕'=>1,'䔫'=>1,'蓱'=>1,'蓳'=>1,'蔖'=>1,'𧏊'=>1,'蕤'=>1,'𦼬'=>1,'䕝'=>1,'䕡'=>1,'𦾱'=>1,'𧃒'=>1,'䕫'=>1,'虐'=>1,'虜'=>1,'虧'=>1,'虩'=>1,'蚩'=>1,'蚈'=>1,'蜎'=>1,'蛢'=>1,'蝹'=>1,'蜨'=>1,'蝫'=>1,'螆'=>1,'䗗'=>1,'蟡'=>1,'蠁'=>1,'䗹'=>1,'衠'=>1,'衣'=>1,'𧙧'=>1,'裗'=>1,'裞'=>1,'䘵'=>1,'裺'=>1,'㒻'=>1,'𧢮'=>1,'𧥦'=>1,'䚾'=>1,'䛇'=>1,'誠'=>1,'諭'=>1,'變'=>1,'豕'=>1,'𧲨'=>1,'貫'=>1,'賁'=>1,'贛'=>1,'起'=>1,'𧼯'=>1,'𠠄'=>1,'跋'=>1,'趼'=>1,'跰'=>1,'𠣞'=>1,'軔'=>1,'輸'=>1,'𨗒'=>1,'𨗭'=>1,'邔'=>1,'郱'=>1,'鄑'=>1,'𨜮'=>1,'鄛'=>1,'鈸'=>1,'鋗'=>1,'鋘'=>1,'鉼'=>1,'鏹'=>1,'鐕'=>1,'𨯺'=>1,'開'=>1,'䦕'=>1,'閷'=>1,'𨵷'=>1,'䧦'=>1,'雃'=>1,'嶲'=>1,'霣'=>1,'𩅅'=>1,'𩈚'=>1,'䩮'=>1,'䩶'=>1,'韠'=>1,'𩐊'=>1,'䪲'=>1,'𩒖'=>1,'頋'=>1,'頋'=>1,'頩'=>1,'𩖶'=>1,'飢'=>1,'䬳'=>1,'餩'=>1,'馧'=>1,'駂'=>1,'駾'=>1,'䯎'=>1,'𩬰'=>1,'鬒'=>1,'鱀'=>1,'鳽'=>1,'䳎'=>1,'䳭'=>1,'鵧'=>1,'𪃎'=>1,'䳸'=>1,'𪄅'=>1,'𪈎'=>1,'𪊑'=>1,'麻'=>1,'䵖'=>1,'黹'=>1,'黾'=>1,'鼅'=>1,'鼏'=>1,'鼖'=>1,'鼻'=>1,'𪘀'=>1,'̀'=>0,'́'=>0,'̂'=>0,'̃'=>0,'̄'=>0,'̆'=>0,'̇'=>0,'̈'=>0,'̉'=>0,'̊'=>0,'̋'=>0,'̌'=>0,'̏'=>0,'̑'=>0,'̓'=>0,'̔'=>0,'̛'=>0,'̣'=>0,'̤'=>0,'̥'=>0,'̦'=>0,'̧'=>0,'̨'=>0,'̭'=>0,'̮'=>0,'̰'=>0,'̱'=>0,'̸'=>0,'͂'=>0,'ͅ'=>0,'ٓ'=>0,'ٔ'=>0,'ٕ'=>0,'़'=>0,'া'=>0,'ৗ'=>0,'ା'=>0,'ୖ'=>0,'ୗ'=>0,'ா'=>0,'ௗ'=>0,'ౖ'=>0,'ೂ'=>0,'ೕ'=>0,'ೖ'=>0,'ാ'=>0,'ൗ'=>0,'්'=>0,'ා'=>0,'ෟ'=>0,'ီ'=>0,'ᅡ'=>0,'ᅢ'=>0,'ᅣ'=>0,'ᅤ'=>0,'ᅥ'=>0,'ᅦ'=>0,'ᅧ'=>0,'ᅨ'=>0,'ᅩ'=>0,'ᅪ'=>0,'ᅫ'=>0,'ᅬ'=>0,'ᅭ'=>0,'ᅮ'=>0,'ᅯ'=>0,'ᅰ'=>0,'ᅱ'=>0,'ᅲ'=>0,'ᅳ'=>0,'ᅴ'=>0,'ᅵ'=>0,'ᆨ'=>0,'ᆩ'=>0,'ᆪ'=>0,'ᆫ'=>0,'ᆬ'=>0,'ᆭ'=>0,'ᆮ'=>0,'ᆯ'=>0,'ᆰ'=>0,'ᆱ'=>0,'ᆲ'=>0,'ᆳ'=>0,'ᆴ'=>0,'ᆵ'=>0,'ᆶ'=>0,'ᆷ'=>0,'ᆸ'=>0,'ᆹ'=>0,'ᆺ'=>0,'ᆻ'=>0,'ᆼ'=>0,'ᆽ'=>0,'ᆾ'=>0,'ᆿ'=>0,'ᇀ'=>0,'ᇁ'=>0,'ᇂ'=>0,'ᬵ'=>0,'゙'=>0,'゚'=>0); \ No newline at end of file
+$GLOBALS['utf_nfc_qc']=array('̀'=>1,'́'=>1,'̓'=>1,'̈́'=>1,'ʹ'=>1,';'=>1,'·'=>1,'क़'=>1,'ख़'=>1,'ग़'=>1,'ज़'=>1,'ड़'=>1,'ढ़'=>1,'फ़'=>1,'य़'=>1,'ড়'=>1,'ঢ়'=>1,'য়'=>1,'ਲ਼'=>1,'ਸ਼'=>1,'ਖ਼'=>1,'ਗ਼'=>1,'ਜ਼'=>1,'ਫ਼'=>1,'ଡ଼'=>1,'ଢ଼'=>1,'གྷ'=>1,'ཌྷ'=>1,'དྷ'=>1,'བྷ'=>1,'ཛྷ'=>1,'ཀྵ'=>1,'ཱི'=>1,'ཱུ'=>1,'ྲྀ'=>1,'ླྀ'=>1,'ཱྀ'=>1,'ྒྷ'=>1,'ྜྷ'=>1,'ྡྷ'=>1,'ྦྷ'=>1,'ྫྷ'=>1,'ྐྵ'=>1,'ά'=>1,'έ'=>1,'ή'=>1,'ί'=>1,'ό'=>1,'ύ'=>1,'ώ'=>1,'Ά'=>1,'ι'=>1,'Έ'=>1,'Ή'=>1,'ΐ'=>1,'Ί'=>1,'ΰ'=>1,'Ύ'=>1,'΅'=>1,'`'=>1,'Ό'=>1,'Ώ'=>1,'´'=>1,' '=>1,' '=>1,'Ω'=>1,'K'=>1,'Å'=>1,'〈'=>1,'〉'=>1,'⫝̸'=>1,'豈'=>1,'更'=>1,'車'=>1,'賈'=>1,'滑'=>1,'串'=>1,'句'=>1,'龜'=>1,'龜'=>1,'契'=>1,'金'=>1,'喇'=>1,'奈'=>1,'懶'=>1,'癩'=>1,'羅'=>1,'蘿'=>1,'螺'=>1,'裸'=>1,'邏'=>1,'樂'=>1,'洛'=>1,'烙'=>1,'珞'=>1,'落'=>1,'酪'=>1,'駱'=>1,'亂'=>1,'卵'=>1,'欄'=>1,'爛'=>1,'蘭'=>1,'鸞'=>1,'嵐'=>1,'濫'=>1,'藍'=>1,'襤'=>1,'拉'=>1,'臘'=>1,'蠟'=>1,'廊'=>1,'朗'=>1,'浪'=>1,'狼'=>1,'郎'=>1,'來'=>1,'冷'=>1,'勞'=>1,'擄'=>1,'櫓'=>1,'爐'=>1,'盧'=>1,'老'=>1,'蘆'=>1,'虜'=>1,'路'=>1,'露'=>1,'魯'=>1,'鷺'=>1,'碌'=>1,'祿'=>1,'綠'=>1,'菉'=>1,'錄'=>1,'鹿'=>1,'論'=>1,'壟'=>1,'弄'=>1,'籠'=>1,'聾'=>1,'牢'=>1,'磊'=>1,'賂'=>1,'雷'=>1,'壘'=>1,'屢'=>1,'樓'=>1,'淚'=>1,'漏'=>1,'累'=>1,'縷'=>1,'陋'=>1,'勒'=>1,'肋'=>1,'凜'=>1,'凌'=>1,'稜'=>1,'綾'=>1,'菱'=>1,'陵'=>1,'讀'=>1,'拏'=>1,'樂'=>1,'諾'=>1,'丹'=>1,'寧'=>1,'怒'=>1,'率'=>1,'異'=>1,'北'=>1,'磻'=>1,'便'=>1,'復'=>1,'不'=>1,'泌'=>1,'數'=>1,'索'=>1,'參'=>1,'塞'=>1,'省'=>1,'葉'=>1,'說'=>1,'殺'=>1,'辰'=>1,'沈'=>1,'拾'=>1,'若'=>1,'掠'=>1,'略'=>1,'亮'=>1,'兩'=>1,'凉'=>1,'梁'=>1,'糧'=>1,'良'=>1,'諒'=>1,'量'=>1,'勵'=>1,'呂'=>1,'女'=>1,'廬'=>1,'旅'=>1,'濾'=>1,'礪'=>1,'閭'=>1,'驪'=>1,'麗'=>1,'黎'=>1,'力'=>1,'曆'=>1,'歷'=>1,'轢'=>1,'年'=>1,'憐'=>1,'戀'=>1,'撚'=>1,'漣'=>1,'煉'=>1,'璉'=>1,'秊'=>1,'練'=>1,'聯'=>1,'輦'=>1,'蓮'=>1,'連'=>1,'鍊'=>1,'列'=>1,'劣'=>1,'咽'=>1,'烈'=>1,'裂'=>1,'說'=>1,'廉'=>1,'念'=>1,'捻'=>1,'殮'=>1,'簾'=>1,'獵'=>1,'令'=>1,'囹'=>1,'寧'=>1,'嶺'=>1,'怜'=>1,'玲'=>1,'瑩'=>1,'羚'=>1,'聆'=>1,'鈴'=>1,'零'=>1,'靈'=>1,'領'=>1,'例'=>1,'禮'=>1,'醴'=>1,'隸'=>1,'惡'=>1,'了'=>1,'僚'=>1,'寮'=>1,'尿'=>1,'料'=>1,'樂'=>1,'燎'=>1,'療'=>1,'蓼'=>1,'遼'=>1,'龍'=>1,'暈'=>1,'阮'=>1,'劉'=>1,'杻'=>1,'柳'=>1,'流'=>1,'溜'=>1,'琉'=>1,'留'=>1,'硫'=>1,'紐'=>1,'類'=>1,'六'=>1,'戮'=>1,'陸'=>1,'倫'=>1,'崙'=>1,'淪'=>1,'輪'=>1,'律'=>1,'慄'=>1,'栗'=>1,'率'=>1,'隆'=>1,'利'=>1,'吏'=>1,'履'=>1,'易'=>1,'李'=>1,'梨'=>1,'泥'=>1,'理'=>1,'痢'=>1,'罹'=>1,'裏'=>1,'裡'=>1,'里'=>1,'離'=>1,'匿'=>1,'溺'=>1,'吝'=>1,'燐'=>1,'璘'=>1,'藺'=>1,'隣'=>1,'鱗'=>1,'麟'=>1,'林'=>1,'淋'=>1,'臨'=>1,'立'=>1,'笠'=>1,'粒'=>1,'狀'=>1,'炙'=>1,'識'=>1,'什'=>1,'茶'=>1,'刺'=>1,'切'=>1,'度'=>1,'拓'=>1,'糖'=>1,'宅'=>1,'洞'=>1,'暴'=>1,'輻'=>1,'行'=>1,'降'=>1,'見'=>1,'廓'=>1,'兀'=>1,'嗀'=>1,'塚'=>1,'晴'=>1,'凞'=>1,'猪'=>1,'益'=>1,'礼'=>1,'神'=>1,'祥'=>1,'福'=>1,'靖'=>1,'精'=>1,'羽'=>1,'蘒'=>1,'諸'=>1,'逸'=>1,'都'=>1,'飯'=>1,'飼'=>1,'館'=>1,'鶴'=>1,'侮'=>1,'僧'=>1,'免'=>1,'勉'=>1,'勤'=>1,'卑'=>1,'喝'=>1,'嘆'=>1,'器'=>1,'塀'=>1,'墨'=>1,'層'=>1,'屮'=>1,'悔'=>1,'慨'=>1,'憎'=>1,'懲'=>1,'敏'=>1,'既'=>1,'暑'=>1,'梅'=>1,'海'=>1,'渚'=>1,'漢'=>1,'煮'=>1,'爫'=>1,'琢'=>1,'碑'=>1,'社'=>1,'祉'=>1,'祈'=>1,'祐'=>1,'祖'=>1,'祝'=>1,'禍'=>1,'禎'=>1,'穀'=>1,'突'=>1,'節'=>1,'練'=>1,'縉'=>1,'繁'=>1,'署'=>1,'者'=>1,'臭'=>1,'艹'=>1,'艹'=>1,'著'=>1,'褐'=>1,'視'=>1,'謁'=>1,'謹'=>1,'賓'=>1,'贈'=>1,'辶'=>1,'逸'=>1,'難'=>1,'響'=>1,'頻'=>1,'並'=>1,'况'=>1,'全'=>1,'侀'=>1,'充'=>1,'冀'=>1,'勇'=>1,'勺'=>1,'喝'=>1,'啕'=>1,'喙'=>1,'嗢'=>1,'塚'=>1,'墳'=>1,'奄'=>1,'奔'=>1,'婢'=>1,'嬨'=>1,'廒'=>1,'廙'=>1,'彩'=>1,'徭'=>1,'惘'=>1,'慎'=>1,'愈'=>1,'憎'=>1,'慠'=>1,'懲'=>1,'戴'=>1,'揄'=>1,'搜'=>1,'摒'=>1,'敖'=>1,'晴'=>1,'朗'=>1,'望'=>1,'杖'=>1,'歹'=>1,'殺'=>1,'流'=>1,'滛'=>1,'滋'=>1,'漢'=>1,'瀞'=>1,'煮'=>1,'瞧'=>1,'爵'=>1,'犯'=>1,'猪'=>1,'瑱'=>1,'甆'=>1,'画'=>1,'瘝'=>1,'瘟'=>1,'益'=>1,'盛'=>1,'直'=>1,'睊'=>1,'着'=>1,'磌'=>1,'窱'=>1,'節'=>1,'类'=>1,'絛'=>1,'練'=>1,'缾'=>1,'者'=>1,'荒'=>1,'華'=>1,'蝹'=>1,'襁'=>1,'覆'=>1,'視'=>1,'調'=>1,'諸'=>1,'請'=>1,'謁'=>1,'諾'=>1,'諭'=>1,'謹'=>1,'變'=>1,'贈'=>1,'輸'=>1,'遲'=>1,'醙'=>1,'鉶'=>1,'陼'=>1,'難'=>1,'靖'=>1,'韛'=>1,'響'=>1,'頋'=>1,'頻'=>1,'鬒'=>1,'龜'=>1,'𢡊'=>1,'𢡄'=>1,'𣏕'=>1,'㮝'=>1,'䀘'=>1,'䀹'=>1,'𥉉'=>1,'𥳐'=>1,'𧻓'=>1,'齃'=>1,'龎'=>1,'יִ'=>1,'ײַ'=>1,'שׁ'=>1,'שׂ'=>1,'שּׁ'=>1,'שּׂ'=>1,'אַ'=>1,'אָ'=>1,'אּ'=>1,'בּ'=>1,'גּ'=>1,'דּ'=>1,'הּ'=>1,'וּ'=>1,'זּ'=>1,'טּ'=>1,'יּ'=>1,'ךּ'=>1,'כּ'=>1,'לּ'=>1,'מּ'=>1,'נּ'=>1,'סּ'=>1,'ףּ'=>1,'פּ'=>1,'צּ'=>1,'קּ'=>1,'רּ'=>1,'שּ'=>1,'תּ'=>1,'וֹ'=>1,'בֿ'=>1,'כֿ'=>1,'פֿ'=>1,'𝅗𝅥'=>1,'𝅘𝅥'=>1,'𝅘𝅥𝅮'=>1,'𝅘𝅥𝅯'=>1,'𝅘𝅥𝅰'=>1,'𝅘𝅥𝅱'=>1,'𝅘𝅥𝅲'=>1,'𝆹𝅥'=>1,'𝆺𝅥'=>1,'𝆹𝅥𝅮'=>1,'𝆺𝅥𝅮'=>1,'𝆹𝅥𝅯'=>1,'𝆺𝅥𝅯'=>1,'丽'=>1,'丸'=>1,'乁'=>1,'𠄢'=>1,'你'=>1,'侮'=>1,'侻'=>1,'倂'=>1,'偺'=>1,'備'=>1,'僧'=>1,'像'=>1,'㒞'=>1,'𠘺'=>1,'免'=>1,'兔'=>1,'兤'=>1,'具'=>1,'𠔜'=>1,'㒹'=>1,'內'=>1,'再'=>1,'𠕋'=>1,'冗'=>1,'冤'=>1,'仌'=>1,'冬'=>1,'况'=>1,'𩇟'=>1,'凵'=>1,'刃'=>1,'㓟'=>1,'刻'=>1,'剆'=>1,'割'=>1,'剷'=>1,'㔕'=>1,'勇'=>1,'勉'=>1,'勤'=>1,'勺'=>1,'包'=>1,'匆'=>1,'北'=>1,'卉'=>1,'卑'=>1,'博'=>1,'即'=>1,'卽'=>1,'卿'=>1,'卿'=>1,'卿'=>1,'𠨬'=>1,'灰'=>1,'及'=>1,'叟'=>1,'𠭣'=>1,'叫'=>1,'叱'=>1,'吆'=>1,'咞'=>1,'吸'=>1,'呈'=>1,'周'=>1,'咢'=>1,'哶'=>1,'唐'=>1,'啓'=>1,'啣'=>1,'善'=>1,'善'=>1,'喙'=>1,'喫'=>1,'喳'=>1,'嗂'=>1,'圖'=>1,'嘆'=>1,'圗'=>1,'噑'=>1,'噴'=>1,'切'=>1,'壮'=>1,'城'=>1,'埴'=>1,'堍'=>1,'型'=>1,'堲'=>1,'報'=>1,'墬'=>1,'𡓤'=>1,'売'=>1,'壷'=>1,'夆'=>1,'多'=>1,'夢'=>1,'奢'=>1,'𡚨'=>1,'𡛪'=>1,'姬'=>1,'娛'=>1,'娧'=>1,'姘'=>1,'婦'=>1,'㛮'=>1,'㛼'=>1,'嬈'=>1,'嬾'=>1,'嬾'=>1,'𡧈'=>1,'寃'=>1,'寘'=>1,'寧'=>1,'寳'=>1,'𡬘'=>1,'寿'=>1,'将'=>1,'当'=>1,'尢'=>1,'㞁'=>1,'屠'=>1,'屮'=>1,'峀'=>1,'岍'=>1,'𡷤'=>1,'嵃'=>1,'𡷦'=>1,'嵮'=>1,'嵫'=>1,'嵼'=>1,'巡'=>1,'巢'=>1,'㠯'=>1,'巽'=>1,'帨'=>1,'帽'=>1,'幩'=>1,'㡢'=>1,'𢆃'=>1,'㡼'=>1,'庰'=>1,'庳'=>1,'庶'=>1,'廊'=>1,'𪎒'=>1,'廾'=>1,'𢌱'=>1,'𢌱'=>1,'舁'=>1,'弢'=>1,'弢'=>1,'㣇'=>1,'𣊸'=>1,'𦇚'=>1,'形'=>1,'彫'=>1,'㣣'=>1,'徚'=>1,'忍'=>1,'志'=>1,'忹'=>1,'悁'=>1,'㤺'=>1,'㤜'=>1,'悔'=>1,'𢛔'=>1,'惇'=>1,'慈'=>1,'慌'=>1,'慎'=>1,'慌'=>1,'慺'=>1,'憎'=>1,'憲'=>1,'憤'=>1,'憯'=>1,'懞'=>1,'懲'=>1,'懶'=>1,'成'=>1,'戛'=>1,'扝'=>1,'抱'=>1,'拔'=>1,'捐'=>1,'𢬌'=>1,'挽'=>1,'拼'=>1,'捨'=>1,'掃'=>1,'揤'=>1,'𢯱'=>1,'搢'=>1,'揅'=>1,'掩'=>1,'㨮'=>1,'摩'=>1,'摾'=>1,'撝'=>1,'摷'=>1,'㩬'=>1,'敏'=>1,'敬'=>1,'𣀊'=>1,'旣'=>1,'書'=>1,'晉'=>1,'㬙'=>1,'暑'=>1,'㬈'=>1,'㫤'=>1,'冒'=>1,'冕'=>1,'最'=>1,'暜'=>1,'肭'=>1,'䏙'=>1,'朗'=>1,'望'=>1,'朡'=>1,'杞'=>1,'杓'=>1,'𣏃'=>1,'㭉'=>1,'柺'=>1,'枅'=>1,'桒'=>1,'梅'=>1,'𣑭'=>1,'梎'=>1,'栟'=>1,'椔'=>1,'㮝'=>1,'楂'=>1,'榣'=>1,'槪'=>1,'檨'=>1,'𣚣'=>1,'櫛'=>1,'㰘'=>1,'次'=>1,'𣢧'=>1,'歔'=>1,'㱎'=>1,'歲'=>1,'殟'=>1,'殺'=>1,'殻'=>1,'𣪍'=>1,'𡴋'=>1,'𣫺'=>1,'汎'=>1,'𣲼'=>1,'沿'=>1,'泍'=>1,'汧'=>1,'洖'=>1,'派'=>1,'海'=>1,'流'=>1,'浩'=>1,'浸'=>1,'涅'=>1,'𣴞'=>1,'洴'=>1,'港'=>1,'湮'=>1,'㴳'=>1,'滋'=>1,'滇'=>1,'𣻑'=>1,'淹'=>1,'潮'=>1,'𣽞'=>1,'𣾎'=>1,'濆'=>1,'瀹'=>1,'瀞'=>1,'瀛'=>1,'㶖'=>1,'灊'=>1,'災'=>1,'灷'=>1,'炭'=>1,'𠔥'=>1,'煅'=>1,'𤉣'=>1,'熜'=>1,'𤎫'=>1,'爨'=>1,'爵'=>1,'牐'=>1,'𤘈'=>1,'犀'=>1,'犕'=>1,'𤜵'=>1,'𤠔'=>1,'獺'=>1,'王'=>1,'㺬'=>1,'玥'=>1,'㺸'=>1,'㺸'=>1,'瑇'=>1,'瑜'=>1,'瑱'=>1,'璅'=>1,'瓊'=>1,'㼛'=>1,'甤'=>1,'𤰶'=>1,'甾'=>1,'𤲒'=>1,'異'=>1,'𢆟'=>1,'瘐'=>1,'𤾡'=>1,'𤾸'=>1,'𥁄'=>1,'㿼'=>1,'䀈'=>1,'直'=>1,'𥃳'=>1,'𥃲'=>1,'𥄙'=>1,'𥄳'=>1,'眞'=>1,'真'=>1,'真'=>1,'睊'=>1,'䀹'=>1,'瞋'=>1,'䁆'=>1,'䂖'=>1,'𥐝'=>1,'硎'=>1,'碌'=>1,'磌'=>1,'䃣'=>1,'𥘦'=>1,'祖'=>1,'𥚚'=>1,'𥛅'=>1,'福'=>1,'秫'=>1,'䄯'=>1,'穀'=>1,'穊'=>1,'穏'=>1,'𥥼'=>1,'𥪧'=>1,'𥪧'=>1,'竮'=>1,'䈂'=>1,'𥮫'=>1,'篆'=>1,'築'=>1,'䈧'=>1,'𥲀'=>1,'糒'=>1,'䊠'=>1,'糨'=>1,'糣'=>1,'紀'=>1,'𥾆'=>1,'絣'=>1,'䌁'=>1,'緇'=>1,'縂'=>1,'繅'=>1,'䌴'=>1,'𦈨'=>1,'𦉇'=>1,'䍙'=>1,'𦋙'=>1,'罺'=>1,'𦌾'=>1,'羕'=>1,'翺'=>1,'者'=>1,'𦓚'=>1,'𦔣'=>1,'聠'=>1,'𦖨'=>1,'聰'=>1,'𣍟'=>1,'䏕'=>1,'育'=>1,'脃'=>1,'䐋'=>1,'脾'=>1,'媵'=>1,'𦞧'=>1,'𦞵'=>1,'𣎓'=>1,'𣎜'=>1,'舁'=>1,'舄'=>1,'辞'=>1,'䑫'=>1,'芑'=>1,'芋'=>1,'芝'=>1,'劳'=>1,'花'=>1,'芳'=>1,'芽'=>1,'苦'=>1,'𦬼'=>1,'若'=>1,'茝'=>1,'荣'=>1,'莭'=>1,'茣'=>1,'莽'=>1,'菧'=>1,'著'=>1,'荓'=>1,'菊'=>1,'菌'=>1,'菜'=>1,'𦰶'=>1,'𦵫'=>1,'𦳕'=>1,'䔫'=>1,'蓱'=>1,'蓳'=>1,'蔖'=>1,'𧏊'=>1,'蕤'=>1,'𦼬'=>1,'䕝'=>1,'䕡'=>1,'𦾱'=>1,'𧃒'=>1,'䕫'=>1,'虐'=>1,'虜'=>1,'虧'=>1,'虩'=>1,'蚩'=>1,'蚈'=>1,'蜎'=>1,'蛢'=>1,'蝹'=>1,'蜨'=>1,'蝫'=>1,'螆'=>1,'䗗'=>1,'蟡'=>1,'蠁'=>1,'䗹'=>1,'衠'=>1,'衣'=>1,'𧙧'=>1,'裗'=>1,'裞'=>1,'䘵'=>1,'裺'=>1,'㒻'=>1,'𧢮'=>1,'𧥦'=>1,'䚾'=>1,'䛇'=>1,'誠'=>1,'諭'=>1,'變'=>1,'豕'=>1,'𧲨'=>1,'貫'=>1,'賁'=>1,'贛'=>1,'起'=>1,'𧼯'=>1,'𠠄'=>1,'跋'=>1,'趼'=>1,'跰'=>1,'𠣞'=>1,'軔'=>1,'輸'=>1,'𨗒'=>1,'𨗭'=>1,'邔'=>1,'郱'=>1,'鄑'=>1,'𨜮'=>1,'鄛'=>1,'鈸'=>1,'鋗'=>1,'鋘'=>1,'鉼'=>1,'鏹'=>1,'鐕'=>1,'𨯺'=>1,'開'=>1,'䦕'=>1,'閷'=>1,'𨵷'=>1,'䧦'=>1,'雃'=>1,'嶲'=>1,'霣'=>1,'𩅅'=>1,'𩈚'=>1,'䩮'=>1,'䩶'=>1,'韠'=>1,'𩐊'=>1,'䪲'=>1,'𩒖'=>1,'頋'=>1,'頋'=>1,'頩'=>1,'𩖶'=>1,'飢'=>1,'䬳'=>1,'餩'=>1,'馧'=>1,'駂'=>1,'駾'=>1,'䯎'=>1,'𩬰'=>1,'鬒'=>1,'鱀'=>1,'鳽'=>1,'䳎'=>1,'䳭'=>1,'鵧'=>1,'𪃎'=>1,'䳸'=>1,'𪄅'=>1,'𪈎'=>1,'𪊑'=>1,'麻'=>1,'䵖'=>1,'黹'=>1,'黾'=>1,'鼅'=>1,'鼏'=>1,'鼖'=>1,'鼻'=>1,'𪘀'=>1,'̀'=>0,'́'=>0,'̂'=>0,'̃'=>0,'̄'=>0,'̆'=>0,'̇'=>0,'̈'=>0,'̉'=>0,'̊'=>0,'̋'=>0,'̌'=>0,'̏'=>0,'̑'=>0,'̓'=>0,'̔'=>0,'̛'=>0,'̣'=>0,'̤'=>0,'̥'=>0,'̦'=>0,'̧'=>0,'̨'=>0,'̭'=>0,'̮'=>0,'̰'=>0,'̱'=>0,'̸'=>0,'͂'=>0,'ͅ'=>0,'ٓ'=>0,'ٔ'=>0,'ٕ'=>0,'़'=>0,'া'=>0,'ৗ'=>0,'ା'=>0,'ୖ'=>0,'ୗ'=>0,'ா'=>0,'ௗ'=>0,'ౖ'=>0,'ೂ'=>0,'ೕ'=>0,'ೖ'=>0,'ാ'=>0,'ൗ'=>0,'්'=>0,'ා'=>0,'ෟ'=>0,'ီ'=>0,'ᅡ'=>0,'ᅢ'=>0,'ᅣ'=>0,'ᅤ'=>0,'ᅥ'=>0,'ᅦ'=>0,'ᅧ'=>0,'ᅨ'=>0,'ᅩ'=>0,'ᅪ'=>0,'ᅫ'=>0,'ᅬ'=>0,'ᅭ'=>0,'ᅮ'=>0,'ᅯ'=>0,'ᅰ'=>0,'ᅱ'=>0,'ᅲ'=>0,'ᅳ'=>0,'ᅴ'=>0,'ᅵ'=>0,'ᆨ'=>0,'ᆩ'=>0,'ᆪ'=>0,'ᆫ'=>0,'ᆬ'=>0,'ᆭ'=>0,'ᆮ'=>0,'ᆯ'=>0,'ᆰ'=>0,'ᆱ'=>0,'ᆲ'=>0,'ᆳ'=>0,'ᆴ'=>0,'ᆵ'=>0,'ᆶ'=>0,'ᆷ'=>0,'ᆸ'=>0,'ᆹ'=>0,'ᆺ'=>0,'ᆻ'=>0,'ᆼ'=>0,'ᆽ'=>0,'ᆾ'=>0,'ᆿ'=>0,'ᇀ'=>0,'ᇁ'=>0,'ᇂ'=>0,'ᬵ'=>0,'゙'=>0,'゚'=>0);
diff --git a/phpBB/includes/utf/data/utf_nfkc_qc.php b/phpBB/includes/utf/data/utf_nfkc_qc.php
index da9a8a0e89..181a07b351 100644
--- a/phpBB/includes/utf/data/utf_nfkc_qc.php
+++ b/phpBB/includes/utf/data/utf_nfkc_qc.php
@@ -1,2 +1,2 @@
<?php
-$GLOBALS['utf_nfkc_qc']=array(' '=>1,'¨'=>1,'ª'=>1,'¯'=>1,'²'=>1,'³'=>1,'´'=>1,'µ'=>1,'¸'=>1,'¹'=>1,'º'=>1,'¼'=>1,'½'=>1,'¾'=>1,'IJ'=>1,'ij'=>1,'Ŀ'=>1,'ŀ'=>1,'ʼn'=>1,'ſ'=>1,'DŽ'=>1,'Dž'=>1,'dž'=>1,'LJ'=>1,'Lj'=>1,'lj'=>1,'NJ'=>1,'Nj'=>1,'nj'=>1,'DZ'=>1,'Dz'=>1,'dz'=>1,'ʰ'=>1,'ʱ'=>1,'ʲ'=>1,'ʳ'=>1,'ʴ'=>1,'ʵ'=>1,'ʶ'=>1,'ʷ'=>1,'ʸ'=>1,'˘'=>1,'˙'=>1,'˚'=>1,'˛'=>1,'˜'=>1,'˝'=>1,'ˠ'=>1,'ˡ'=>1,'ˢ'=>1,'ˣ'=>1,'ˤ'=>1,'̀'=>1,'́'=>1,'̓'=>1,'̈́'=>1,'ʹ'=>1,'ͺ'=>1,';'=>1,'΄'=>1,'΅'=>1,'·'=>1,'ϐ'=>1,'ϑ'=>1,'ϒ'=>1,'ϓ'=>1,'ϔ'=>1,'ϕ'=>1,'ϖ'=>1,'ϰ'=>1,'ϱ'=>1,'ϲ'=>1,'ϴ'=>1,'ϵ'=>1,'Ϲ'=>1,'և'=>1,'ٵ'=>1,'ٶ'=>1,'ٷ'=>1,'ٸ'=>1,'क़'=>1,'ख़'=>1,'ग़'=>1,'ज़'=>1,'ड़'=>1,'ढ़'=>1,'फ़'=>1,'य़'=>1,'ড়'=>1,'ঢ়'=>1,'য়'=>1,'ਲ਼'=>1,'ਸ਼'=>1,'ਖ਼'=>1,'ਗ਼'=>1,'ਜ਼'=>1,'ਫ਼'=>1,'ଡ଼'=>1,'ଢ଼'=>1,'ำ'=>1,'ຳ'=>1,'ໜ'=>1,'ໝ'=>1,'༌'=>1,'གྷ'=>1,'ཌྷ'=>1,'དྷ'=>1,'བྷ'=>1,'ཛྷ'=>1,'ཀྵ'=>1,'ཱི'=>1,'ཱུ'=>1,'ྲྀ'=>1,'ཷ'=>1,'ླྀ'=>1,'ཹ'=>1,'ཱྀ'=>1,'ྒྷ'=>1,'ྜྷ'=>1,'ྡྷ'=>1,'ྦྷ'=>1,'ྫྷ'=>1,'ྐྵ'=>1,'ჼ'=>1,'ᴬ'=>1,'ᴭ'=>1,'ᴮ'=>1,'ᴰ'=>1,'ᴱ'=>1,'ᴲ'=>1,'ᴳ'=>1,'ᴴ'=>1,'ᴵ'=>1,'ᴶ'=>1,'ᴷ'=>1,'ᴸ'=>1,'ᴹ'=>1,'ᴺ'=>1,'ᴼ'=>1,'ᴽ'=>1,'ᴾ'=>1,'ᴿ'=>1,'ᵀ'=>1,'ᵁ'=>1,'ᵂ'=>1,'ᵃ'=>1,'ᵄ'=>1,'ᵅ'=>1,'ᵆ'=>1,'ᵇ'=>1,'ᵈ'=>1,'ᵉ'=>1,'ᵊ'=>1,'ᵋ'=>1,'ᵌ'=>1,'ᵍ'=>1,'ᵏ'=>1,'ᵐ'=>1,'ᵑ'=>1,'ᵒ'=>1,'ᵓ'=>1,'ᵔ'=>1,'ᵕ'=>1,'ᵖ'=>1,'ᵗ'=>1,'ᵘ'=>1,'ᵙ'=>1,'ᵚ'=>1,'ᵛ'=>1,'ᵜ'=>1,'ᵝ'=>1,'ᵞ'=>1,'ᵟ'=>1,'ᵠ'=>1,'ᵡ'=>1,'ᵢ'=>1,'ᵣ'=>1,'ᵤ'=>1,'ᵥ'=>1,'ᵦ'=>1,'ᵧ'=>1,'ᵨ'=>1,'ᵩ'=>1,'ᵪ'=>1,'ᵸ'=>1,'ᶛ'=>1,'ᶜ'=>1,'ᶝ'=>1,'ᶞ'=>1,'ᶟ'=>1,'ᶠ'=>1,'ᶡ'=>1,'ᶢ'=>1,'ᶣ'=>1,'ᶤ'=>1,'ᶥ'=>1,'ᶦ'=>1,'ᶧ'=>1,'ᶨ'=>1,'ᶩ'=>1,'ᶪ'=>1,'ᶫ'=>1,'ᶬ'=>1,'ᶭ'=>1,'ᶮ'=>1,'ᶯ'=>1,'ᶰ'=>1,'ᶱ'=>1,'ᶲ'=>1,'ᶳ'=>1,'ᶴ'=>1,'ᶵ'=>1,'ᶶ'=>1,'ᶷ'=>1,'ᶸ'=>1,'ᶹ'=>1,'ᶺ'=>1,'ᶻ'=>1,'ᶼ'=>1,'ᶽ'=>1,'ᶾ'=>1,'ᶿ'=>1,'ẚ'=>1,'ẛ'=>1,'ά'=>1,'έ'=>1,'ή'=>1,'ί'=>1,'ό'=>1,'ύ'=>1,'ώ'=>1,'Ά'=>1,'᾽'=>1,'ι'=>1,'᾿'=>1,'῀'=>1,'῁'=>1,'Έ'=>1,'Ή'=>1,'῍'=>1,'῎'=>1,'῏'=>1,'ΐ'=>1,'Ί'=>1,'῝'=>1,'῞'=>1,'῟'=>1,'ΰ'=>1,'Ύ'=>1,'῭'=>1,'΅'=>1,'`'=>1,'Ό'=>1,'Ώ'=>1,'´'=>1,'῾'=>1,' '=>1,' '=>1,' '=>1,' '=>1,' '=>1,' '=>1,' '=>1,' '=>1,' '=>1,' '=>1,' '=>1,'‑'=>1,'‗'=>1,'․'=>1,'‥'=>1,'…'=>1,' '=>1,'″'=>1,'‴'=>1,'‶'=>1,'‷'=>1,'‼'=>1,'‾'=>1,'⁇'=>1,'⁈'=>1,'⁉'=>1,'⁗'=>1,' '=>1,'⁰'=>1,'ⁱ'=>1,'⁴'=>1,'⁵'=>1,'⁶'=>1,'⁷'=>1,'⁸'=>1,'⁹'=>1,'⁺'=>1,'⁻'=>1,'⁼'=>1,'⁽'=>1,'⁾'=>1,'ⁿ'=>1,'₀'=>1,'₁'=>1,'₂'=>1,'₃'=>1,'₄'=>1,'₅'=>1,'₆'=>1,'₇'=>1,'₈'=>1,'₉'=>1,'₊'=>1,'₋'=>1,'₌'=>1,'₍'=>1,'₎'=>1,'ₐ'=>1,'ₑ'=>1,'ₒ'=>1,'ₓ'=>1,'ₔ'=>1,'₨'=>1,'℀'=>1,'℁'=>1,'ℂ'=>1,'℃'=>1,'℅'=>1,'℆'=>1,'ℇ'=>1,'℉'=>1,'ℊ'=>1,'ℋ'=>1,'ℌ'=>1,'ℍ'=>1,'ℎ'=>1,'ℏ'=>1,'ℐ'=>1,'ℑ'=>1,'ℒ'=>1,'ℓ'=>1,'ℕ'=>1,'№'=>1,'ℙ'=>1,'ℚ'=>1,'ℛ'=>1,'ℜ'=>1,'ℝ'=>1,'℠'=>1,'℡'=>1,'™'=>1,'ℤ'=>1,'Ω'=>1,'ℨ'=>1,'K'=>1,'Å'=>1,'ℬ'=>1,'ℭ'=>1,'ℯ'=>1,'ℰ'=>1,'ℱ'=>1,'ℳ'=>1,'ℴ'=>1,'ℵ'=>1,'ℶ'=>1,'ℷ'=>1,'ℸ'=>1,'ℹ'=>1,'℻'=>1,'ℼ'=>1,'ℽ'=>1,'ℾ'=>1,'ℿ'=>1,'⅀'=>1,'ⅅ'=>1,'ⅆ'=>1,'ⅇ'=>1,'ⅈ'=>1,'ⅉ'=>1,'⅓'=>1,'⅔'=>1,'⅕'=>1,'⅖'=>1,'⅗'=>1,'⅘'=>1,'⅙'=>1,'⅚'=>1,'⅛'=>1,'⅜'=>1,'⅝'=>1,'⅞'=>1,'⅟'=>1,'Ⅰ'=>1,'Ⅱ'=>1,'Ⅲ'=>1,'Ⅳ'=>1,'Ⅴ'=>1,'Ⅵ'=>1,'Ⅶ'=>1,'Ⅷ'=>1,'Ⅸ'=>1,'Ⅹ'=>1,'Ⅺ'=>1,'Ⅻ'=>1,'Ⅼ'=>1,'Ⅽ'=>1,'Ⅾ'=>1,'Ⅿ'=>1,'ⅰ'=>1,'ⅱ'=>1,'ⅲ'=>1,'ⅳ'=>1,'ⅴ'=>1,'ⅵ'=>1,'ⅶ'=>1,'ⅷ'=>1,'ⅸ'=>1,'ⅹ'=>1,'ⅺ'=>1,'ⅻ'=>1,'ⅼ'=>1,'ⅽ'=>1,'ⅾ'=>1,'ⅿ'=>1,'∬'=>1,'∭'=>1,'∯'=>1,'∰'=>1,'〈'=>1,'〉'=>1,'①'=>1,'②'=>1,'③'=>1,'④'=>1,'⑤'=>1,'⑥'=>1,'⑦'=>1,'⑧'=>1,'⑨'=>1,'⑩'=>1,'⑪'=>1,'⑫'=>1,'⑬'=>1,'⑭'=>1,'⑮'=>1,'⑯'=>1,'⑰'=>1,'⑱'=>1,'⑲'=>1,'⑳'=>1,'⑴'=>1,'⑵'=>1,'⑶'=>1,'⑷'=>1,'⑸'=>1,'⑹'=>1,'⑺'=>1,'⑻'=>1,'⑼'=>1,'⑽'=>1,'⑾'=>1,'⑿'=>1,'⒀'=>1,'⒁'=>1,'⒂'=>1,'⒃'=>1,'⒄'=>1,'⒅'=>1,'⒆'=>1,'⒇'=>1,'⒈'=>1,'⒉'=>1,'⒊'=>1,'⒋'=>1,'⒌'=>1,'⒍'=>1,'⒎'=>1,'⒏'=>1,'⒐'=>1,'⒑'=>1,'⒒'=>1,'⒓'=>1,'⒔'=>1,'⒕'=>1,'⒖'=>1,'⒗'=>1,'⒘'=>1,'⒙'=>1,'⒚'=>1,'⒛'=>1,'⒜'=>1,'⒝'=>1,'⒞'=>1,'⒟'=>1,'⒠'=>1,'⒡'=>1,'⒢'=>1,'⒣'=>1,'⒤'=>1,'⒥'=>1,'⒦'=>1,'⒧'=>1,'⒨'=>1,'⒩'=>1,'⒪'=>1,'⒫'=>1,'⒬'=>1,'⒭'=>1,'⒮'=>1,'⒯'=>1,'⒰'=>1,'⒱'=>1,'⒲'=>1,'⒳'=>1,'⒴'=>1,'⒵'=>1,'Ⓐ'=>1,'Ⓑ'=>1,'Ⓒ'=>1,'Ⓓ'=>1,'Ⓔ'=>1,'Ⓕ'=>1,'Ⓖ'=>1,'Ⓗ'=>1,'Ⓘ'=>1,'Ⓙ'=>1,'Ⓚ'=>1,'Ⓛ'=>1,'Ⓜ'=>1,'Ⓝ'=>1,'Ⓞ'=>1,'Ⓟ'=>1,'Ⓠ'=>1,'Ⓡ'=>1,'Ⓢ'=>1,'Ⓣ'=>1,'Ⓤ'=>1,'Ⓥ'=>1,'Ⓦ'=>1,'Ⓧ'=>1,'Ⓨ'=>1,'Ⓩ'=>1,'ⓐ'=>1,'ⓑ'=>1,'ⓒ'=>1,'ⓓ'=>1,'ⓔ'=>1,'ⓕ'=>1,'ⓖ'=>1,'ⓗ'=>1,'ⓘ'=>1,'ⓙ'=>1,'ⓚ'=>1,'ⓛ'=>1,'ⓜ'=>1,'ⓝ'=>1,'ⓞ'=>1,'ⓟ'=>1,'ⓠ'=>1,'ⓡ'=>1,'ⓢ'=>1,'ⓣ'=>1,'ⓤ'=>1,'ⓥ'=>1,'ⓦ'=>1,'ⓧ'=>1,'ⓨ'=>1,'ⓩ'=>1,'⓪'=>1,'⨌'=>1,'⩴'=>1,'⩵'=>1,'⩶'=>1,'⫝̸'=>1,'ⵯ'=>1,'⺟'=>1,'⻳'=>1,'⼀'=>1,'⼁'=>1,'⼂'=>1,'⼃'=>1,'⼄'=>1,'⼅'=>1,'⼆'=>1,'⼇'=>1,'⼈'=>1,'⼉'=>1,'⼊'=>1,'⼋'=>1,'⼌'=>1,'⼍'=>1,'⼎'=>1,'⼏'=>1,'⼐'=>1,'⼑'=>1,'⼒'=>1,'⼓'=>1,'⼔'=>1,'⼕'=>1,'⼖'=>1,'⼗'=>1,'⼘'=>1,'⼙'=>1,'⼚'=>1,'⼛'=>1,'⼜'=>1,'⼝'=>1,'⼞'=>1,'⼟'=>1,'⼠'=>1,'⼡'=>1,'⼢'=>1,'⼣'=>1,'⼤'=>1,'⼥'=>1,'⼦'=>1,'⼧'=>1,'⼨'=>1,'⼩'=>1,'⼪'=>1,'⼫'=>1,'⼬'=>1,'⼭'=>1,'⼮'=>1,'⼯'=>1,'⼰'=>1,'⼱'=>1,'⼲'=>1,'⼳'=>1,'⼴'=>1,'⼵'=>1,'⼶'=>1,'⼷'=>1,'⼸'=>1,'⼹'=>1,'⼺'=>1,'⼻'=>1,'⼼'=>1,'⼽'=>1,'⼾'=>1,'⼿'=>1,'⽀'=>1,'⽁'=>1,'⽂'=>1,'⽃'=>1,'⽄'=>1,'⽅'=>1,'⽆'=>1,'⽇'=>1,'⽈'=>1,'⽉'=>1,'⽊'=>1,'⽋'=>1,'⽌'=>1,'⽍'=>1,'⽎'=>1,'⽏'=>1,'⽐'=>1,'⽑'=>1,'⽒'=>1,'⽓'=>1,'⽔'=>1,'⽕'=>1,'⽖'=>1,'⽗'=>1,'⽘'=>1,'⽙'=>1,'⽚'=>1,'⽛'=>1,'⽜'=>1,'⽝'=>1,'⽞'=>1,'⽟'=>1,'⽠'=>1,'⽡'=>1,'⽢'=>1,'⽣'=>1,'⽤'=>1,'⽥'=>1,'⽦'=>1,'⽧'=>1,'⽨'=>1,'⽩'=>1,'⽪'=>1,'⽫'=>1,'⽬'=>1,'⽭'=>1,'⽮'=>1,'⽯'=>1,'⽰'=>1,'⽱'=>1,'⽲'=>1,'⽳'=>1,'⽴'=>1,'⽵'=>1,'⽶'=>1,'⽷'=>1,'⽸'=>1,'⽹'=>1,'⽺'=>1,'⽻'=>1,'⽼'=>1,'⽽'=>1,'⽾'=>1,'⽿'=>1,'⾀'=>1,'⾁'=>1,'⾂'=>1,'⾃'=>1,'⾄'=>1,'⾅'=>1,'⾆'=>1,'⾇'=>1,'⾈'=>1,'⾉'=>1,'⾊'=>1,'⾋'=>1,'⾌'=>1,'⾍'=>1,'⾎'=>1,'⾏'=>1,'⾐'=>1,'⾑'=>1,'⾒'=>1,'⾓'=>1,'⾔'=>1,'⾕'=>1,'⾖'=>1,'⾗'=>1,'⾘'=>1,'⾙'=>1,'⾚'=>1,'⾛'=>1,'⾜'=>1,'⾝'=>1,'⾞'=>1,'⾟'=>1,'⾠'=>1,'⾡'=>1,'⾢'=>1,'⾣'=>1,'⾤'=>1,'⾥'=>1,'⾦'=>1,'⾧'=>1,'⾨'=>1,'⾩'=>1,'⾪'=>1,'⾫'=>1,'⾬'=>1,'⾭'=>1,'⾮'=>1,'⾯'=>1,'⾰'=>1,'⾱'=>1,'⾲'=>1,'⾳'=>1,'⾴'=>1,'⾵'=>1,'⾶'=>1,'⾷'=>1,'⾸'=>1,'⾹'=>1,'⾺'=>1,'⾻'=>1,'⾼'=>1,'⾽'=>1,'⾾'=>1,'⾿'=>1,'⿀'=>1,'⿁'=>1,'⿂'=>1,'⿃'=>1,'⿄'=>1,'⿅'=>1,'⿆'=>1,'⿇'=>1,'⿈'=>1,'⿉'=>1,'⿊'=>1,'⿋'=>1,'⿌'=>1,'⿍'=>1,'⿎'=>1,'⿏'=>1,'⿐'=>1,'⿑'=>1,'⿒'=>1,'⿓'=>1,'⿔'=>1,'⿕'=>1,' '=>1,'〶'=>1,'〸'=>1,'〹'=>1,'〺'=>1,'゛'=>1,'゜'=>1,'ゟ'=>1,'ヿ'=>1,'ㄱ'=>1,'ㄲ'=>1,'ㄳ'=>1,'ㄴ'=>1,'ㄵ'=>1,'ㄶ'=>1,'ㄷ'=>1,'ㄸ'=>1,'ㄹ'=>1,'ㄺ'=>1,'ㄻ'=>1,'ㄼ'=>1,'ㄽ'=>1,'ㄾ'=>1,'ㄿ'=>1,'ㅀ'=>1,'ㅁ'=>1,'ㅂ'=>1,'ㅃ'=>1,'ㅄ'=>1,'ㅅ'=>1,'ㅆ'=>1,'ㅇ'=>1,'ㅈ'=>1,'ㅉ'=>1,'ㅊ'=>1,'ㅋ'=>1,'ㅌ'=>1,'ㅍ'=>1,'ㅎ'=>1,'ㅏ'=>1,'ㅐ'=>1,'ㅑ'=>1,'ㅒ'=>1,'ㅓ'=>1,'ㅔ'=>1,'ㅕ'=>1,'ㅖ'=>1,'ㅗ'=>1,'ㅘ'=>1,'ㅙ'=>1,'ㅚ'=>1,'ㅛ'=>1,'ㅜ'=>1,'ㅝ'=>1,'ㅞ'=>1,'ㅟ'=>1,'ㅠ'=>1,'ㅡ'=>1,'ㅢ'=>1,'ㅣ'=>1,'ㅤ'=>1,'ㅥ'=>1,'ㅦ'=>1,'ㅧ'=>1,'ㅨ'=>1,'ㅩ'=>1,'ㅪ'=>1,'ㅫ'=>1,'ㅬ'=>1,'ㅭ'=>1,'ㅮ'=>1,'ㅯ'=>1,'ㅰ'=>1,'ㅱ'=>1,'ㅲ'=>1,'ㅳ'=>1,'ㅴ'=>1,'ㅵ'=>1,'ㅶ'=>1,'ㅷ'=>1,'ㅸ'=>1,'ㅹ'=>1,'ㅺ'=>1,'ㅻ'=>1,'ㅼ'=>1,'ㅽ'=>1,'ㅾ'=>1,'ㅿ'=>1,'ㆀ'=>1,'ㆁ'=>1,'ㆂ'=>1,'ㆃ'=>1,'ㆄ'=>1,'ㆅ'=>1,'ㆆ'=>1,'ㆇ'=>1,'ㆈ'=>1,'ㆉ'=>1,'ㆊ'=>1,'ㆋ'=>1,'ㆌ'=>1,'ㆍ'=>1,'ㆎ'=>1,'㆒'=>1,'㆓'=>1,'㆔'=>1,'㆕'=>1,'㆖'=>1,'㆗'=>1,'㆘'=>1,'㆙'=>1,'㆚'=>1,'㆛'=>1,'㆜'=>1,'㆝'=>1,'㆞'=>1,'㆟'=>1,'㈀'=>1,'㈁'=>1,'㈂'=>1,'㈃'=>1,'㈄'=>1,'㈅'=>1,'㈆'=>1,'㈇'=>1,'㈈'=>1,'㈉'=>1,'㈊'=>1,'㈋'=>1,'㈌'=>1,'㈍'=>1,'㈎'=>1,'㈏'=>1,'㈐'=>1,'㈑'=>1,'㈒'=>1,'㈓'=>1,'㈔'=>1,'㈕'=>1,'㈖'=>1,'㈗'=>1,'㈘'=>1,'㈙'=>1,'㈚'=>1,'㈛'=>1,'㈜'=>1,'㈝'=>1,'㈞'=>1,'㈠'=>1,'㈡'=>1,'㈢'=>1,'㈣'=>1,'㈤'=>1,'㈥'=>1,'㈦'=>1,'㈧'=>1,'㈨'=>1,'㈩'=>1,'㈪'=>1,'㈫'=>1,'㈬'=>1,'㈭'=>1,'㈮'=>1,'㈯'=>1,'㈰'=>1,'㈱'=>1,'㈲'=>1,'㈳'=>1,'㈴'=>1,'㈵'=>1,'㈶'=>1,'㈷'=>1,'㈸'=>1,'㈹'=>1,'㈺'=>1,'㈻'=>1,'㈼'=>1,'㈽'=>1,'㈾'=>1,'㈿'=>1,'㉀'=>1,'㉁'=>1,'㉂'=>1,'㉃'=>1,'㉐'=>1,'㉑'=>1,'㉒'=>1,'㉓'=>1,'㉔'=>1,'㉕'=>1,'㉖'=>1,'㉗'=>1,'㉘'=>1,'㉙'=>1,'㉚'=>1,'㉛'=>1,'㉜'=>1,'㉝'=>1,'㉞'=>1,'㉟'=>1,'㉠'=>1,'㉡'=>1,'㉢'=>1,'㉣'=>1,'㉤'=>1,'㉥'=>1,'㉦'=>1,'㉧'=>1,'㉨'=>1,'㉩'=>1,'㉪'=>1,'㉫'=>1,'㉬'=>1,'㉭'=>1,'㉮'=>1,'㉯'=>1,'㉰'=>1,'㉱'=>1,'㉲'=>1,'㉳'=>1,'㉴'=>1,'㉵'=>1,'㉶'=>1,'㉷'=>1,'㉸'=>1,'㉹'=>1,'㉺'=>1,'㉻'=>1,'㉼'=>1,'㉽'=>1,'㉾'=>1,'㊀'=>1,'㊁'=>1,'㊂'=>1,'㊃'=>1,'㊄'=>1,'㊅'=>1,'㊆'=>1,'㊇'=>1,'㊈'=>1,'㊉'=>1,'㊊'=>1,'㊋'=>1,'㊌'=>1,'㊍'=>1,'㊎'=>1,'㊏'=>1,'㊐'=>1,'㊑'=>1,'㊒'=>1,'㊓'=>1,'㊔'=>1,'㊕'=>1,'㊖'=>1,'㊗'=>1,'㊘'=>1,'㊙'=>1,'㊚'=>1,'㊛'=>1,'㊜'=>1,'㊝'=>1,'㊞'=>1,'㊟'=>1,'㊠'=>1,'㊡'=>1,'㊢'=>1,'㊣'=>1,'㊤'=>1,'㊥'=>1,'㊦'=>1,'㊧'=>1,'㊨'=>1,'㊩'=>1,'㊪'=>1,'㊫'=>1,'㊬'=>1,'㊭'=>1,'㊮'=>1,'㊯'=>1,'㊰'=>1,'㊱'=>1,'㊲'=>1,'㊳'=>1,'㊴'=>1,'㊵'=>1,'㊶'=>1,'㊷'=>1,'㊸'=>1,'㊹'=>1,'㊺'=>1,'㊻'=>1,'㊼'=>1,'㊽'=>1,'㊾'=>1,'㊿'=>1,'㋀'=>1,'㋁'=>1,'㋂'=>1,'㋃'=>1,'㋄'=>1,'㋅'=>1,'㋆'=>1,'㋇'=>1,'㋈'=>1,'㋉'=>1,'㋊'=>1,'㋋'=>1,'㋌'=>1,'㋍'=>1,'㋎'=>1,'㋏'=>1,'㋐'=>1,'㋑'=>1,'㋒'=>1,'㋓'=>1,'㋔'=>1,'㋕'=>1,'㋖'=>1,'㋗'=>1,'㋘'=>1,'㋙'=>1,'㋚'=>1,'㋛'=>1,'㋜'=>1,'㋝'=>1,'㋞'=>1,'㋟'=>1,'㋠'=>1,'㋡'=>1,'㋢'=>1,'㋣'=>1,'㋤'=>1,'㋥'=>1,'㋦'=>1,'㋧'=>1,'㋨'=>1,'㋩'=>1,'㋪'=>1,'㋫'=>1,'㋬'=>1,'㋭'=>1,'㋮'=>1,'㋯'=>1,'㋰'=>1,'㋱'=>1,'㋲'=>1,'㋳'=>1,'㋴'=>1,'㋵'=>1,'㋶'=>1,'㋷'=>1,'㋸'=>1,'㋹'=>1,'㋺'=>1,'㋻'=>1,'㋼'=>1,'㋽'=>1,'㋾'=>1,'㌀'=>1,'㌁'=>1,'㌂'=>1,'㌃'=>1,'㌄'=>1,'㌅'=>1,'㌆'=>1,'㌇'=>1,'㌈'=>1,'㌉'=>1,'㌊'=>1,'㌋'=>1,'㌌'=>1,'㌍'=>1,'㌎'=>1,'㌏'=>1,'㌐'=>1,'㌑'=>1,'㌒'=>1,'㌓'=>1,'㌔'=>1,'㌕'=>1,'㌖'=>1,'㌗'=>1,'㌘'=>1,'㌙'=>1,'㌚'=>1,'㌛'=>1,'㌜'=>1,'㌝'=>1,'㌞'=>1,'㌟'=>1,'㌠'=>1,'㌡'=>1,'㌢'=>1,'㌣'=>1,'㌤'=>1,'㌥'=>1,'㌦'=>1,'㌧'=>1,'㌨'=>1,'㌩'=>1,'㌪'=>1,'㌫'=>1,'㌬'=>1,'㌭'=>1,'㌮'=>1,'㌯'=>1,'㌰'=>1,'㌱'=>1,'㌲'=>1,'㌳'=>1,'㌴'=>1,'㌵'=>1,'㌶'=>1,'㌷'=>1,'㌸'=>1,'㌹'=>1,'㌺'=>1,'㌻'=>1,'㌼'=>1,'㌽'=>1,'㌾'=>1,'㌿'=>1,'㍀'=>1,'㍁'=>1,'㍂'=>1,'㍃'=>1,'㍄'=>1,'㍅'=>1,'㍆'=>1,'㍇'=>1,'㍈'=>1,'㍉'=>1,'㍊'=>1,'㍋'=>1,'㍌'=>1,'㍍'=>1,'㍎'=>1,'㍏'=>1,'㍐'=>1,'㍑'=>1,'㍒'=>1,'㍓'=>1,'㍔'=>1,'㍕'=>1,'㍖'=>1,'㍗'=>1,'㍘'=>1,'㍙'=>1,'㍚'=>1,'㍛'=>1,'㍜'=>1,'㍝'=>1,'㍞'=>1,'㍟'=>1,'㍠'=>1,'㍡'=>1,'㍢'=>1,'㍣'=>1,'㍤'=>1,'㍥'=>1,'㍦'=>1,'㍧'=>1,'㍨'=>1,'㍩'=>1,'㍪'=>1,'㍫'=>1,'㍬'=>1,'㍭'=>1,'㍮'=>1,'㍯'=>1,'㍰'=>1,'㍱'=>1,'㍲'=>1,'㍳'=>1,'㍴'=>1,'㍵'=>1,'㍶'=>1,'㍷'=>1,'㍸'=>1,'㍹'=>1,'㍺'=>1,'㍻'=>1,'㍼'=>1,'㍽'=>1,'㍾'=>1,'㍿'=>1,'㎀'=>1,'㎁'=>1,'㎂'=>1,'㎃'=>1,'㎄'=>1,'㎅'=>1,'㎆'=>1,'㎇'=>1,'㎈'=>1,'㎉'=>1,'㎊'=>1,'㎋'=>1,'㎌'=>1,'㎍'=>1,'㎎'=>1,'㎏'=>1,'㎐'=>1,'㎑'=>1,'㎒'=>1,'㎓'=>1,'㎔'=>1,'㎕'=>1,'㎖'=>1,'㎗'=>1,'㎘'=>1,'㎙'=>1,'㎚'=>1,'㎛'=>1,'㎜'=>1,'㎝'=>1,'㎞'=>1,'㎟'=>1,'㎠'=>1,'㎡'=>1,'㎢'=>1,'㎣'=>1,'㎤'=>1,'㎥'=>1,'㎦'=>1,'㎧'=>1,'㎨'=>1,'㎩'=>1,'㎪'=>1,'㎫'=>1,'㎬'=>1,'㎭'=>1,'㎮'=>1,'㎯'=>1,'㎰'=>1,'㎱'=>1,'㎲'=>1,'㎳'=>1,'㎴'=>1,'㎵'=>1,'㎶'=>1,'㎷'=>1,'㎸'=>1,'㎹'=>1,'㎺'=>1,'㎻'=>1,'㎼'=>1,'㎽'=>1,'㎾'=>1,'㎿'=>1,'㏀'=>1,'㏁'=>1,'㏂'=>1,'㏃'=>1,'㏄'=>1,'㏅'=>1,'㏆'=>1,'㏇'=>1,'㏈'=>1,'㏉'=>1,'㏊'=>1,'㏋'=>1,'㏌'=>1,'㏍'=>1,'㏎'=>1,'㏏'=>1,'㏐'=>1,'㏑'=>1,'㏒'=>1,'㏓'=>1,'㏔'=>1,'㏕'=>1,'㏖'=>1,'㏗'=>1,'㏘'=>1,'㏙'=>1,'㏚'=>1,'㏛'=>1,'㏜'=>1,'㏝'=>1,'㏞'=>1,'㏟'=>1,'㏠'=>1,'㏡'=>1,'㏢'=>1,'㏣'=>1,'㏤'=>1,'㏥'=>1,'㏦'=>1,'㏧'=>1,'㏨'=>1,'㏩'=>1,'㏪'=>1,'㏫'=>1,'㏬'=>1,'㏭'=>1,'㏮'=>1,'㏯'=>1,'㏰'=>1,'㏱'=>1,'㏲'=>1,'㏳'=>1,'㏴'=>1,'㏵'=>1,'㏶'=>1,'㏷'=>1,'㏸'=>1,'㏹'=>1,'㏺'=>1,'㏻'=>1,'㏼'=>1,'㏽'=>1,'㏾'=>1,'㏿'=>1,'豈'=>1,'更'=>1,'車'=>1,'賈'=>1,'滑'=>1,'串'=>1,'句'=>1,'龜'=>1,'龜'=>1,'契'=>1,'金'=>1,'喇'=>1,'奈'=>1,'懶'=>1,'癩'=>1,'羅'=>1,'蘿'=>1,'螺'=>1,'裸'=>1,'邏'=>1,'樂'=>1,'洛'=>1,'烙'=>1,'珞'=>1,'落'=>1,'酪'=>1,'駱'=>1,'亂'=>1,'卵'=>1,'欄'=>1,'爛'=>1,'蘭'=>1,'鸞'=>1,'嵐'=>1,'濫'=>1,'藍'=>1,'襤'=>1,'拉'=>1,'臘'=>1,'蠟'=>1,'廊'=>1,'朗'=>1,'浪'=>1,'狼'=>1,'郎'=>1,'來'=>1,'冷'=>1,'勞'=>1,'擄'=>1,'櫓'=>1,'爐'=>1,'盧'=>1,'老'=>1,'蘆'=>1,'虜'=>1,'路'=>1,'露'=>1,'魯'=>1,'鷺'=>1,'碌'=>1,'祿'=>1,'綠'=>1,'菉'=>1,'錄'=>1,'鹿'=>1,'論'=>1,'壟'=>1,'弄'=>1,'籠'=>1,'聾'=>1,'牢'=>1,'磊'=>1,'賂'=>1,'雷'=>1,'壘'=>1,'屢'=>1,'樓'=>1,'淚'=>1,'漏'=>1,'累'=>1,'縷'=>1,'陋'=>1,'勒'=>1,'肋'=>1,'凜'=>1,'凌'=>1,'稜'=>1,'綾'=>1,'菱'=>1,'陵'=>1,'讀'=>1,'拏'=>1,'樂'=>1,'諾'=>1,'丹'=>1,'寧'=>1,'怒'=>1,'率'=>1,'異'=>1,'北'=>1,'磻'=>1,'便'=>1,'復'=>1,'不'=>1,'泌'=>1,'數'=>1,'索'=>1,'參'=>1,'塞'=>1,'省'=>1,'葉'=>1,'說'=>1,'殺'=>1,'辰'=>1,'沈'=>1,'拾'=>1,'若'=>1,'掠'=>1,'略'=>1,'亮'=>1,'兩'=>1,'凉'=>1,'梁'=>1,'糧'=>1,'良'=>1,'諒'=>1,'量'=>1,'勵'=>1,'呂'=>1,'女'=>1,'廬'=>1,'旅'=>1,'濾'=>1,'礪'=>1,'閭'=>1,'驪'=>1,'麗'=>1,'黎'=>1,'力'=>1,'曆'=>1,'歷'=>1,'轢'=>1,'年'=>1,'憐'=>1,'戀'=>1,'撚'=>1,'漣'=>1,'煉'=>1,'璉'=>1,'秊'=>1,'練'=>1,'聯'=>1,'輦'=>1,'蓮'=>1,'連'=>1,'鍊'=>1,'列'=>1,'劣'=>1,'咽'=>1,'烈'=>1,'裂'=>1,'說'=>1,'廉'=>1,'念'=>1,'捻'=>1,'殮'=>1,'簾'=>1,'獵'=>1,'令'=>1,'囹'=>1,'寧'=>1,'嶺'=>1,'怜'=>1,'玲'=>1,'瑩'=>1,'羚'=>1,'聆'=>1,'鈴'=>1,'零'=>1,'靈'=>1,'領'=>1,'例'=>1,'禮'=>1,'醴'=>1,'隸'=>1,'惡'=>1,'了'=>1,'僚'=>1,'寮'=>1,'尿'=>1,'料'=>1,'樂'=>1,'燎'=>1,'療'=>1,'蓼'=>1,'遼'=>1,'龍'=>1,'暈'=>1,'阮'=>1,'劉'=>1,'杻'=>1,'柳'=>1,'流'=>1,'溜'=>1,'琉'=>1,'留'=>1,'硫'=>1,'紐'=>1,'類'=>1,'六'=>1,'戮'=>1,'陸'=>1,'倫'=>1,'崙'=>1,'淪'=>1,'輪'=>1,'律'=>1,'慄'=>1,'栗'=>1,'率'=>1,'隆'=>1,'利'=>1,'吏'=>1,'履'=>1,'易'=>1,'李'=>1,'梨'=>1,'泥'=>1,'理'=>1,'痢'=>1,'罹'=>1,'裏'=>1,'裡'=>1,'里'=>1,'離'=>1,'匿'=>1,'溺'=>1,'吝'=>1,'燐'=>1,'璘'=>1,'藺'=>1,'隣'=>1,'鱗'=>1,'麟'=>1,'林'=>1,'淋'=>1,'臨'=>1,'立'=>1,'笠'=>1,'粒'=>1,'狀'=>1,'炙'=>1,'識'=>1,'什'=>1,'茶'=>1,'刺'=>1,'切'=>1,'度'=>1,'拓'=>1,'糖'=>1,'宅'=>1,'洞'=>1,'暴'=>1,'輻'=>1,'行'=>1,'降'=>1,'見'=>1,'廓'=>1,'兀'=>1,'嗀'=>1,'塚'=>1,'晴'=>1,'凞'=>1,'猪'=>1,'益'=>1,'礼'=>1,'神'=>1,'祥'=>1,'福'=>1,'靖'=>1,'精'=>1,'羽'=>1,'蘒'=>1,'諸'=>1,'逸'=>1,'都'=>1,'飯'=>1,'飼'=>1,'館'=>1,'鶴'=>1,'侮'=>1,'僧'=>1,'免'=>1,'勉'=>1,'勤'=>1,'卑'=>1,'喝'=>1,'嘆'=>1,'器'=>1,'塀'=>1,'墨'=>1,'層'=>1,'屮'=>1,'悔'=>1,'慨'=>1,'憎'=>1,'懲'=>1,'敏'=>1,'既'=>1,'暑'=>1,'梅'=>1,'海'=>1,'渚'=>1,'漢'=>1,'煮'=>1,'爫'=>1,'琢'=>1,'碑'=>1,'社'=>1,'祉'=>1,'祈'=>1,'祐'=>1,'祖'=>1,'祝'=>1,'禍'=>1,'禎'=>1,'穀'=>1,'突'=>1,'節'=>1,'練'=>1,'縉'=>1,'繁'=>1,'署'=>1,'者'=>1,'臭'=>1,'艹'=>1,'艹'=>1,'著'=>1,'褐'=>1,'視'=>1,'謁'=>1,'謹'=>1,'賓'=>1,'贈'=>1,'辶'=>1,'逸'=>1,'難'=>1,'響'=>1,'頻'=>1,'並'=>1,'况'=>1,'全'=>1,'侀'=>1,'充'=>1,'冀'=>1,'勇'=>1,'勺'=>1,'喝'=>1,'啕'=>1,'喙'=>1,'嗢'=>1,'塚'=>1,'墳'=>1,'奄'=>1,'奔'=>1,'婢'=>1,'嬨'=>1,'廒'=>1,'廙'=>1,'彩'=>1,'徭'=>1,'惘'=>1,'慎'=>1,'愈'=>1,'憎'=>1,'慠'=>1,'懲'=>1,'戴'=>1,'揄'=>1,'搜'=>1,'摒'=>1,'敖'=>1,'晴'=>1,'朗'=>1,'望'=>1,'杖'=>1,'歹'=>1,'殺'=>1,'流'=>1,'滛'=>1,'滋'=>1,'漢'=>1,'瀞'=>1,'煮'=>1,'瞧'=>1,'爵'=>1,'犯'=>1,'猪'=>1,'瑱'=>1,'甆'=>1,'画'=>1,'瘝'=>1,'瘟'=>1,'益'=>1,'盛'=>1,'直'=>1,'睊'=>1,'着'=>1,'磌'=>1,'窱'=>1,'節'=>1,'类'=>1,'絛'=>1,'練'=>1,'缾'=>1,'者'=>1,'荒'=>1,'華'=>1,'蝹'=>1,'襁'=>1,'覆'=>1,'視'=>1,'調'=>1,'諸'=>1,'請'=>1,'謁'=>1,'諾'=>1,'諭'=>1,'謹'=>1,'變'=>1,'贈'=>1,'輸'=>1,'遲'=>1,'醙'=>1,'鉶'=>1,'陼'=>1,'難'=>1,'靖'=>1,'韛'=>1,'響'=>1,'頋'=>1,'頻'=>1,'鬒'=>1,'龜'=>1,'𢡊'=>1,'𢡄'=>1,'𣏕'=>1,'㮝'=>1,'䀘'=>1,'䀹'=>1,'𥉉'=>1,'𥳐'=>1,'𧻓'=>1,'齃'=>1,'龎'=>1,'ff'=>1,'fi'=>1,'fl'=>1,'ffi'=>1,'ffl'=>1,'ſt'=>1,'st'=>1,'ﬓ'=>1,'ﬔ'=>1,'ﬕ'=>1,'ﬖ'=>1,'ﬗ'=>1,'יִ'=>1,'ײַ'=>1,'ﬠ'=>1,'ﬡ'=>1,'ﬢ'=>1,'ﬣ'=>1,'ﬤ'=>1,'ﬥ'=>1,'ﬦ'=>1,'ﬧ'=>1,'ﬨ'=>1,'﬩'=>1,'שׁ'=>1,'שׂ'=>1,'שּׁ'=>1,'שּׂ'=>1,'אַ'=>1,'אָ'=>1,'אּ'=>1,'בּ'=>1,'גּ'=>1,'דּ'=>1,'הּ'=>1,'וּ'=>1,'זּ'=>1,'טּ'=>1,'יּ'=>1,'ךּ'=>1,'כּ'=>1,'לּ'=>1,'מּ'=>1,'נּ'=>1,'סּ'=>1,'ףּ'=>1,'פּ'=>1,'צּ'=>1,'קּ'=>1,'רּ'=>1,'שּ'=>1,'תּ'=>1,'וֹ'=>1,'בֿ'=>1,'כֿ'=>1,'פֿ'=>1,'ﭏ'=>1,'ﭐ'=>1,'ﭑ'=>1,'ﭒ'=>1,'ﭓ'=>1,'ﭔ'=>1,'ﭕ'=>1,'ﭖ'=>1,'ﭗ'=>1,'ﭘ'=>1,'ﭙ'=>1,'ﭚ'=>1,'ﭛ'=>1,'ﭜ'=>1,'ﭝ'=>1,'ﭞ'=>1,'ﭟ'=>1,'ﭠ'=>1,'ﭡ'=>1,'ﭢ'=>1,'ﭣ'=>1,'ﭤ'=>1,'ﭥ'=>1,'ﭦ'=>1,'ﭧ'=>1,'ﭨ'=>1,'ﭩ'=>1,'ﭪ'=>1,'ﭫ'=>1,'ﭬ'=>1,'ﭭ'=>1,'ﭮ'=>1,'ﭯ'=>1,'ﭰ'=>1,'ﭱ'=>1,'ﭲ'=>1,'ﭳ'=>1,'ﭴ'=>1,'ﭵ'=>1,'ﭶ'=>1,'ﭷ'=>1,'ﭸ'=>1,'ﭹ'=>1,'ﭺ'=>1,'ﭻ'=>1,'ﭼ'=>1,'ﭽ'=>1,'ﭾ'=>1,'ﭿ'=>1,'ﮀ'=>1,'ﮁ'=>1,'ﮂ'=>1,'ﮃ'=>1,'ﮄ'=>1,'ﮅ'=>1,'ﮆ'=>1,'ﮇ'=>1,'ﮈ'=>1,'ﮉ'=>1,'ﮊ'=>1,'ﮋ'=>1,'ﮌ'=>1,'ﮍ'=>1,'ﮎ'=>1,'ﮏ'=>1,'ﮐ'=>1,'ﮑ'=>1,'ﮒ'=>1,'ﮓ'=>1,'ﮔ'=>1,'ﮕ'=>1,'ﮖ'=>1,'ﮗ'=>1,'ﮘ'=>1,'ﮙ'=>1,'ﮚ'=>1,'ﮛ'=>1,'ﮜ'=>1,'ﮝ'=>1,'ﮞ'=>1,'ﮟ'=>1,'ﮠ'=>1,'ﮡ'=>1,'ﮢ'=>1,'ﮣ'=>1,'ﮤ'=>1,'ﮥ'=>1,'ﮦ'=>1,'ﮧ'=>1,'ﮨ'=>1,'ﮩ'=>1,'ﮪ'=>1,'ﮫ'=>1,'ﮬ'=>1,'ﮭ'=>1,'ﮮ'=>1,'ﮯ'=>1,'ﮰ'=>1,'ﮱ'=>1,'ﯓ'=>1,'ﯔ'=>1,'ﯕ'=>1,'ﯖ'=>1,'ﯗ'=>1,'ﯘ'=>1,'ﯙ'=>1,'ﯚ'=>1,'ﯛ'=>1,'ﯜ'=>1,'ﯝ'=>1,'ﯞ'=>1,'ﯟ'=>1,'ﯠ'=>1,'ﯡ'=>1,'ﯢ'=>1,'ﯣ'=>1,'ﯤ'=>1,'ﯥ'=>1,'ﯦ'=>1,'ﯧ'=>1,'ﯨ'=>1,'ﯩ'=>1,'ﯪ'=>1,'ﯫ'=>1,'ﯬ'=>1,'ﯭ'=>1,'ﯮ'=>1,'ﯯ'=>1,'ﯰ'=>1,'ﯱ'=>1,'ﯲ'=>1,'ﯳ'=>1,'ﯴ'=>1,'ﯵ'=>1,'ﯶ'=>1,'ﯷ'=>1,'ﯸ'=>1,'ﯹ'=>1,'ﯺ'=>1,'ﯻ'=>1,'ﯼ'=>1,'ﯽ'=>1,'ﯾ'=>1,'ﯿ'=>1,'ﰀ'=>1,'ﰁ'=>1,'ﰂ'=>1,'ﰃ'=>1,'ﰄ'=>1,'ﰅ'=>1,'ﰆ'=>1,'ﰇ'=>1,'ﰈ'=>1,'ﰉ'=>1,'ﰊ'=>1,'ﰋ'=>1,'ﰌ'=>1,'ﰍ'=>1,'ﰎ'=>1,'ﰏ'=>1,'ﰐ'=>1,'ﰑ'=>1,'ﰒ'=>1,'ﰓ'=>1,'ﰔ'=>1,'ﰕ'=>1,'ﰖ'=>1,'ﰗ'=>1,'ﰘ'=>1,'ﰙ'=>1,'ﰚ'=>1,'ﰛ'=>1,'ﰜ'=>1,'ﰝ'=>1,'ﰞ'=>1,'ﰟ'=>1,'ﰠ'=>1,'ﰡ'=>1,'ﰢ'=>1,'ﰣ'=>1,'ﰤ'=>1,'ﰥ'=>1,'ﰦ'=>1,'ﰧ'=>1,'ﰨ'=>1,'ﰩ'=>1,'ﰪ'=>1,'ﰫ'=>1,'ﰬ'=>1,'ﰭ'=>1,'ﰮ'=>1,'ﰯ'=>1,'ﰰ'=>1,'ﰱ'=>1,'ﰲ'=>1,'ﰳ'=>1,'ﰴ'=>1,'ﰵ'=>1,'ﰶ'=>1,'ﰷ'=>1,'ﰸ'=>1,'ﰹ'=>1,'ﰺ'=>1,'ﰻ'=>1,'ﰼ'=>1,'ﰽ'=>1,'ﰾ'=>1,'ﰿ'=>1,'ﱀ'=>1,'ﱁ'=>1,'ﱂ'=>1,'ﱃ'=>1,'ﱄ'=>1,'ﱅ'=>1,'ﱆ'=>1,'ﱇ'=>1,'ﱈ'=>1,'ﱉ'=>1,'ﱊ'=>1,'ﱋ'=>1,'ﱌ'=>1,'ﱍ'=>1,'ﱎ'=>1,'ﱏ'=>1,'ﱐ'=>1,'ﱑ'=>1,'ﱒ'=>1,'ﱓ'=>1,'ﱔ'=>1,'ﱕ'=>1,'ﱖ'=>1,'ﱗ'=>1,'ﱘ'=>1,'ﱙ'=>1,'ﱚ'=>1,'ﱛ'=>1,'ﱜ'=>1,'ﱝ'=>1,'ﱞ'=>1,'ﱟ'=>1,'ﱠ'=>1,'ﱡ'=>1,'ﱢ'=>1,'ﱣ'=>1,'ﱤ'=>1,'ﱥ'=>1,'ﱦ'=>1,'ﱧ'=>1,'ﱨ'=>1,'ﱩ'=>1,'ﱪ'=>1,'ﱫ'=>1,'ﱬ'=>1,'ﱭ'=>1,'ﱮ'=>1,'ﱯ'=>1,'ﱰ'=>1,'ﱱ'=>1,'ﱲ'=>1,'ﱳ'=>1,'ﱴ'=>1,'ﱵ'=>1,'ﱶ'=>1,'ﱷ'=>1,'ﱸ'=>1,'ﱹ'=>1,'ﱺ'=>1,'ﱻ'=>1,'ﱼ'=>1,'ﱽ'=>1,'ﱾ'=>1,'ﱿ'=>1,'ﲀ'=>1,'ﲁ'=>1,'ﲂ'=>1,'ﲃ'=>1,'ﲄ'=>1,'ﲅ'=>1,'ﲆ'=>1,'ﲇ'=>1,'ﲈ'=>1,'ﲉ'=>1,'ﲊ'=>1,'ﲋ'=>1,'ﲌ'=>1,'ﲍ'=>1,'ﲎ'=>1,'ﲏ'=>1,'ﲐ'=>1,'ﲑ'=>1,'ﲒ'=>1,'ﲓ'=>1,'ﲔ'=>1,'ﲕ'=>1,'ﲖ'=>1,'ﲗ'=>1,'ﲘ'=>1,'ﲙ'=>1,'ﲚ'=>1,'ﲛ'=>1,'ﲜ'=>1,'ﲝ'=>1,'ﲞ'=>1,'ﲟ'=>1,'ﲠ'=>1,'ﲡ'=>1,'ﲢ'=>1,'ﲣ'=>1,'ﲤ'=>1,'ﲥ'=>1,'ﲦ'=>1,'ﲧ'=>1,'ﲨ'=>1,'ﲩ'=>1,'ﲪ'=>1,'ﲫ'=>1,'ﲬ'=>1,'ﲭ'=>1,'ﲮ'=>1,'ﲯ'=>1,'ﲰ'=>1,'ﲱ'=>1,'ﲲ'=>1,'ﲳ'=>1,'ﲴ'=>1,'ﲵ'=>1,'ﲶ'=>1,'ﲷ'=>1,'ﲸ'=>1,'ﲹ'=>1,'ﲺ'=>1,'ﲻ'=>1,'ﲼ'=>1,'ﲽ'=>1,'ﲾ'=>1,'ﲿ'=>1,'ﳀ'=>1,'ﳁ'=>1,'ﳂ'=>1,'ﳃ'=>1,'ﳄ'=>1,'ﳅ'=>1,'ﳆ'=>1,'ﳇ'=>1,'ﳈ'=>1,'ﳉ'=>1,'ﳊ'=>1,'ﳋ'=>1,'ﳌ'=>1,'ﳍ'=>1,'ﳎ'=>1,'ﳏ'=>1,'ﳐ'=>1,'ﳑ'=>1,'ﳒ'=>1,'ﳓ'=>1,'ﳔ'=>1,'ﳕ'=>1,'ﳖ'=>1,'ﳗ'=>1,'ﳘ'=>1,'ﳙ'=>1,'ﳚ'=>1,'ﳛ'=>1,'ﳜ'=>1,'ﳝ'=>1,'ﳞ'=>1,'ﳟ'=>1,'ﳠ'=>1,'ﳡ'=>1,'ﳢ'=>1,'ﳣ'=>1,'ﳤ'=>1,'ﳥ'=>1,'ﳦ'=>1,'ﳧ'=>1,'ﳨ'=>1,'ﳩ'=>1,'ﳪ'=>1,'ﳫ'=>1,'ﳬ'=>1,'ﳭ'=>1,'ﳮ'=>1,'ﳯ'=>1,'ﳰ'=>1,'ﳱ'=>1,'ﳲ'=>1,'ﳳ'=>1,'ﳴ'=>1,'ﳵ'=>1,'ﳶ'=>1,'ﳷ'=>1,'ﳸ'=>1,'ﳹ'=>1,'ﳺ'=>1,'ﳻ'=>1,'ﳼ'=>1,'ﳽ'=>1,'ﳾ'=>1,'ﳿ'=>1,'ﴀ'=>1,'ﴁ'=>1,'ﴂ'=>1,'ﴃ'=>1,'ﴄ'=>1,'ﴅ'=>1,'ﴆ'=>1,'ﴇ'=>1,'ﴈ'=>1,'ﴉ'=>1,'ﴊ'=>1,'ﴋ'=>1,'ﴌ'=>1,'ﴍ'=>1,'ﴎ'=>1,'ﴏ'=>1,'ﴐ'=>1,'ﴑ'=>1,'ﴒ'=>1,'ﴓ'=>1,'ﴔ'=>1,'ﴕ'=>1,'ﴖ'=>1,'ﴗ'=>1,'ﴘ'=>1,'ﴙ'=>1,'ﴚ'=>1,'ﴛ'=>1,'ﴜ'=>1,'ﴝ'=>1,'ﴞ'=>1,'ﴟ'=>1,'ﴠ'=>1,'ﴡ'=>1,'ﴢ'=>1,'ﴣ'=>1,'ﴤ'=>1,'ﴥ'=>1,'ﴦ'=>1,'ﴧ'=>1,'ﴨ'=>1,'ﴩ'=>1,'ﴪ'=>1,'ﴫ'=>1,'ﴬ'=>1,'ﴭ'=>1,'ﴮ'=>1,'ﴯ'=>1,'ﴰ'=>1,'ﴱ'=>1,'ﴲ'=>1,'ﴳ'=>1,'ﴴ'=>1,'ﴵ'=>1,'ﴶ'=>1,'ﴷ'=>1,'ﴸ'=>1,'ﴹ'=>1,'ﴺ'=>1,'ﴻ'=>1,'ﴼ'=>1,'ﴽ'=>1,'ﵐ'=>1,'ﵑ'=>1,'ﵒ'=>1,'ﵓ'=>1,'ﵔ'=>1,'ﵕ'=>1,'ﵖ'=>1,'ﵗ'=>1,'ﵘ'=>1,'ﵙ'=>1,'ﵚ'=>1,'ﵛ'=>1,'ﵜ'=>1,'ﵝ'=>1,'ﵞ'=>1,'ﵟ'=>1,'ﵠ'=>1,'ﵡ'=>1,'ﵢ'=>1,'ﵣ'=>1,'ﵤ'=>1,'ﵥ'=>1,'ﵦ'=>1,'ﵧ'=>1,'ﵨ'=>1,'ﵩ'=>1,'ﵪ'=>1,'ﵫ'=>1,'ﵬ'=>1,'ﵭ'=>1,'ﵮ'=>1,'ﵯ'=>1,'ﵰ'=>1,'ﵱ'=>1,'ﵲ'=>1,'ﵳ'=>1,'ﵴ'=>1,'ﵵ'=>1,'ﵶ'=>1,'ﵷ'=>1,'ﵸ'=>1,'ﵹ'=>1,'ﵺ'=>1,'ﵻ'=>1,'ﵼ'=>1,'ﵽ'=>1,'ﵾ'=>1,'ﵿ'=>1,'ﶀ'=>1,'ﶁ'=>1,'ﶂ'=>1,'ﶃ'=>1,'ﶄ'=>1,'ﶅ'=>1,'ﶆ'=>1,'ﶇ'=>1,'ﶈ'=>1,'ﶉ'=>1,'ﶊ'=>1,'ﶋ'=>1,'ﶌ'=>1,'ﶍ'=>1,'ﶎ'=>1,'ﶏ'=>1,'ﶒ'=>1,'ﶓ'=>1,'ﶔ'=>1,'ﶕ'=>1,'ﶖ'=>1,'ﶗ'=>1,'ﶘ'=>1,'ﶙ'=>1,'ﶚ'=>1,'ﶛ'=>1,'ﶜ'=>1,'ﶝ'=>1,'ﶞ'=>1,'ﶟ'=>1,'ﶠ'=>1,'ﶡ'=>1,'ﶢ'=>1,'ﶣ'=>1,'ﶤ'=>1,'ﶥ'=>1,'ﶦ'=>1,'ﶧ'=>1,'ﶨ'=>1,'ﶩ'=>1,'ﶪ'=>1,'ﶫ'=>1,'ﶬ'=>1,'ﶭ'=>1,'ﶮ'=>1,'ﶯ'=>1,'ﶰ'=>1,'ﶱ'=>1,'ﶲ'=>1,'ﶳ'=>1,'ﶴ'=>1,'ﶵ'=>1,'ﶶ'=>1,'ﶷ'=>1,'ﶸ'=>1,'ﶹ'=>1,'ﶺ'=>1,'ﶻ'=>1,'ﶼ'=>1,'ﶽ'=>1,'ﶾ'=>1,'ﶿ'=>1,'ﷀ'=>1,'ﷁ'=>1,'ﷂ'=>1,'ﷃ'=>1,'ﷄ'=>1,'ﷅ'=>1,'ﷆ'=>1,'ﷇ'=>1,'ﷰ'=>1,'ﷱ'=>1,'ﷲ'=>1,'ﷳ'=>1,'ﷴ'=>1,'ﷵ'=>1,'ﷶ'=>1,'ﷷ'=>1,'ﷸ'=>1,'ﷹ'=>1,'ﷺ'=>1,'ﷻ'=>1,'﷼'=>1,'︐'=>1,'︑'=>1,'︒'=>1,'︓'=>1,'︔'=>1,'︕'=>1,'︖'=>1,'︗'=>1,'︘'=>1,'︙'=>1,'︰'=>1,'︱'=>1,'︲'=>1,'︳'=>1,'︴'=>1,'︵'=>1,'︶'=>1,'︷'=>1,'︸'=>1,'︹'=>1,'︺'=>1,'︻'=>1,'︼'=>1,'︽'=>1,'︾'=>1,'︿'=>1,'﹀'=>1,'﹁'=>1,'﹂'=>1,'﹃'=>1,'﹄'=>1,'﹇'=>1,'﹈'=>1,'﹉'=>1,'﹊'=>1,'﹋'=>1,'﹌'=>1,'﹍'=>1,'﹎'=>1,'﹏'=>1,'﹐'=>1,'﹑'=>1,'﹒'=>1,'﹔'=>1,'﹕'=>1,'﹖'=>1,'﹗'=>1,'﹘'=>1,'﹙'=>1,'﹚'=>1,'﹛'=>1,'﹜'=>1,'﹝'=>1,'﹞'=>1,'﹟'=>1,'﹠'=>1,'﹡'=>1,'﹢'=>1,'﹣'=>1,'﹤'=>1,'﹥'=>1,'﹦'=>1,'﹨'=>1,'﹩'=>1,'﹪'=>1,'﹫'=>1,'ﹰ'=>1,'ﹱ'=>1,'ﹲ'=>1,'ﹴ'=>1,'ﹶ'=>1,'ﹷ'=>1,'ﹸ'=>1,'ﹹ'=>1,'ﹺ'=>1,'ﹻ'=>1,'ﹼ'=>1,'ﹽ'=>1,'ﹾ'=>1,'ﹿ'=>1,'ﺀ'=>1,'ﺁ'=>1,'ﺂ'=>1,'ﺃ'=>1,'ﺄ'=>1,'ﺅ'=>1,'ﺆ'=>1,'ﺇ'=>1,'ﺈ'=>1,'ﺉ'=>1,'ﺊ'=>1,'ﺋ'=>1,'ﺌ'=>1,'ﺍ'=>1,'ﺎ'=>1,'ﺏ'=>1,'ﺐ'=>1,'ﺑ'=>1,'ﺒ'=>1,'ﺓ'=>1,'ﺔ'=>1,'ﺕ'=>1,'ﺖ'=>1,'ﺗ'=>1,'ﺘ'=>1,'ﺙ'=>1,'ﺚ'=>1,'ﺛ'=>1,'ﺜ'=>1,'ﺝ'=>1,'ﺞ'=>1,'ﺟ'=>1,'ﺠ'=>1,'ﺡ'=>1,'ﺢ'=>1,'ﺣ'=>1,'ﺤ'=>1,'ﺥ'=>1,'ﺦ'=>1,'ﺧ'=>1,'ﺨ'=>1,'ﺩ'=>1,'ﺪ'=>1,'ﺫ'=>1,'ﺬ'=>1,'ﺭ'=>1,'ﺮ'=>1,'ﺯ'=>1,'ﺰ'=>1,'ﺱ'=>1,'ﺲ'=>1,'ﺳ'=>1,'ﺴ'=>1,'ﺵ'=>1,'ﺶ'=>1,'ﺷ'=>1,'ﺸ'=>1,'ﺹ'=>1,'ﺺ'=>1,'ﺻ'=>1,'ﺼ'=>1,'ﺽ'=>1,'ﺾ'=>1,'ﺿ'=>1,'ﻀ'=>1,'ﻁ'=>1,'ﻂ'=>1,'ﻃ'=>1,'ﻄ'=>1,'ﻅ'=>1,'ﻆ'=>1,'ﻇ'=>1,'ﻈ'=>1,'ﻉ'=>1,'ﻊ'=>1,'ﻋ'=>1,'ﻌ'=>1,'ﻍ'=>1,'ﻎ'=>1,'ﻏ'=>1,'ﻐ'=>1,'ﻑ'=>1,'ﻒ'=>1,'ﻓ'=>1,'ﻔ'=>1,'ﻕ'=>1,'ﻖ'=>1,'ﻗ'=>1,'ﻘ'=>1,'ﻙ'=>1,'ﻚ'=>1,'ﻛ'=>1,'ﻜ'=>1,'ﻝ'=>1,'ﻞ'=>1,'ﻟ'=>1,'ﻠ'=>1,'ﻡ'=>1,'ﻢ'=>1,'ﻣ'=>1,'ﻤ'=>1,'ﻥ'=>1,'ﻦ'=>1,'ﻧ'=>1,'ﻨ'=>1,'ﻩ'=>1,'ﻪ'=>1,'ﻫ'=>1,'ﻬ'=>1,'ﻭ'=>1,'ﻮ'=>1,'ﻯ'=>1,'ﻰ'=>1,'ﻱ'=>1,'ﻲ'=>1,'ﻳ'=>1,'ﻴ'=>1,'ﻵ'=>1,'ﻶ'=>1,'ﻷ'=>1,'ﻸ'=>1,'ﻹ'=>1,'ﻺ'=>1,'ﻻ'=>1,'ﻼ'=>1,'!'=>1,'"'=>1,'#'=>1,'$'=>1,'%'=>1,'&'=>1,'''=>1,'('=>1,')'=>1,'*'=>1,'+'=>1,','=>1,'-'=>1,'.'=>1,'/'=>1,'0'=>1,'1'=>1,'2'=>1,'3'=>1,'4'=>1,'5'=>1,'6'=>1,'7'=>1,'8'=>1,'9'=>1,':'=>1,';'=>1,'<'=>1,'='=>1,'>'=>1,'?'=>1,'@'=>1,'A'=>1,'B'=>1,'C'=>1,'D'=>1,'E'=>1,'F'=>1,'G'=>1,'H'=>1,'I'=>1,'J'=>1,'K'=>1,'L'=>1,'M'=>1,'N'=>1,'O'=>1,'P'=>1,'Q'=>1,'R'=>1,'S'=>1,'T'=>1,'U'=>1,'V'=>1,'W'=>1,'X'=>1,'Y'=>1,'Z'=>1,'['=>1,'\'=>1,']'=>1,'^'=>1,'_'=>1,'`'=>1,'a'=>1,'b'=>1,'c'=>1,'d'=>1,'e'=>1,'f'=>1,'g'=>1,'h'=>1,'i'=>1,'j'=>1,'k'=>1,'l'=>1,'m'=>1,'n'=>1,'o'=>1,'p'=>1,'q'=>1,'r'=>1,'s'=>1,'t'=>1,'u'=>1,'v'=>1,'w'=>1,'x'=>1,'y'=>1,'z'=>1,'{'=>1,'|'=>1,'}'=>1,'~'=>1,'⦅'=>1,'⦆'=>1,'。'=>1,'「'=>1,'」'=>1,'、'=>1,'・'=>1,'ヲ'=>1,'ァ'=>1,'ィ'=>1,'ゥ'=>1,'ェ'=>1,'ォ'=>1,'ャ'=>1,'ュ'=>1,'ョ'=>1,'ッ'=>1,'ー'=>1,'ア'=>1,'イ'=>1,'ウ'=>1,'エ'=>1,'オ'=>1,'カ'=>1,'キ'=>1,'ク'=>1,'ケ'=>1,'コ'=>1,'サ'=>1,'シ'=>1,'ス'=>1,'セ'=>1,'ソ'=>1,'タ'=>1,'チ'=>1,'ツ'=>1,'テ'=>1,'ト'=>1,'ナ'=>1,'ニ'=>1,'ヌ'=>1,'ネ'=>1,'ノ'=>1,'ハ'=>1,'ヒ'=>1,'フ'=>1,'ヘ'=>1,'ホ'=>1,'マ'=>1,'ミ'=>1,'ム'=>1,'メ'=>1,'モ'=>1,'ヤ'=>1,'ユ'=>1,'ヨ'=>1,'ラ'=>1,'リ'=>1,'ル'=>1,'レ'=>1,'ロ'=>1,'ワ'=>1,'ン'=>1,'゙'=>1,'゚'=>1,'ᅠ'=>1,'ᄀ'=>1,'ᄁ'=>1,'ᆪ'=>1,'ᄂ'=>1,'ᆬ'=>1,'ᆭ'=>1,'ᄃ'=>1,'ᄄ'=>1,'ᄅ'=>1,'ᆰ'=>1,'ᆱ'=>1,'ᆲ'=>1,'ᆳ'=>1,'ᆴ'=>1,'ᆵ'=>1,'ᄚ'=>1,'ᄆ'=>1,'ᄇ'=>1,'ᄈ'=>1,'ᄡ'=>1,'ᄉ'=>1,'ᄊ'=>1,'ᄋ'=>1,'ᄌ'=>1,'ᄍ'=>1,'ᄎ'=>1,'ᄏ'=>1,'ᄐ'=>1,'ᄑ'=>1,'ᄒ'=>1,'ᅡ'=>1,'ᅢ'=>1,'ᅣ'=>1,'ᅤ'=>1,'ᅥ'=>1,'ᅦ'=>1,'ᅧ'=>1,'ᅨ'=>1,'ᅩ'=>1,'ᅪ'=>1,'ᅫ'=>1,'ᅬ'=>1,'ᅭ'=>1,'ᅮ'=>1,'ᅯ'=>1,'ᅰ'=>1,'ᅱ'=>1,'ᅲ'=>1,'ᅳ'=>1,'ᅴ'=>1,'ᅵ'=>1,'¢'=>1,'£'=>1,'¬'=>1,' ̄'=>1,'¦'=>1,'¥'=>1,'₩'=>1,'│'=>1,'←'=>1,'↑'=>1,'→'=>1,'↓'=>1,'■'=>1,'○'=>1,'𝅗𝅥'=>1,'𝅘𝅥'=>1,'𝅘𝅥𝅮'=>1,'𝅘𝅥𝅯'=>1,'𝅘𝅥𝅰'=>1,'𝅘𝅥𝅱'=>1,'𝅘𝅥𝅲'=>1,'𝆹𝅥'=>1,'𝆺𝅥'=>1,'𝆹𝅥𝅮'=>1,'𝆺𝅥𝅮'=>1,'𝆹𝅥𝅯'=>1,'𝆺𝅥𝅯'=>1,'𝐀'=>1,'𝐁'=>1,'𝐂'=>1,'𝐃'=>1,'𝐄'=>1,'𝐅'=>1,'𝐆'=>1,'𝐇'=>1,'𝐈'=>1,'𝐉'=>1,'𝐊'=>1,'𝐋'=>1,'𝐌'=>1,'𝐍'=>1,'𝐎'=>1,'𝐏'=>1,'𝐐'=>1,'𝐑'=>1,'𝐒'=>1,'𝐓'=>1,'𝐔'=>1,'𝐕'=>1,'𝐖'=>1,'𝐗'=>1,'𝐘'=>1,'𝐙'=>1,'𝐚'=>1,'𝐛'=>1,'𝐜'=>1,'𝐝'=>1,'𝐞'=>1,'𝐟'=>1,'𝐠'=>1,'𝐡'=>1,'𝐢'=>1,'𝐣'=>1,'𝐤'=>1,'𝐥'=>1,'𝐦'=>1,'𝐧'=>1,'𝐨'=>1,'𝐩'=>1,'𝐪'=>1,'𝐫'=>1,'𝐬'=>1,'𝐭'=>1,'𝐮'=>1,'𝐯'=>1,'𝐰'=>1,'𝐱'=>1,'𝐲'=>1,'𝐳'=>1,'𝐴'=>1,'𝐵'=>1,'𝐶'=>1,'𝐷'=>1,'𝐸'=>1,'𝐹'=>1,'𝐺'=>1,'𝐻'=>1,'𝐼'=>1,'𝐽'=>1,'𝐾'=>1,'𝐿'=>1,'𝑀'=>1,'𝑁'=>1,'𝑂'=>1,'𝑃'=>1,'𝑄'=>1,'𝑅'=>1,'𝑆'=>1,'𝑇'=>1,'𝑈'=>1,'𝑉'=>1,'𝑊'=>1,'𝑋'=>1,'𝑌'=>1,'𝑍'=>1,'𝑎'=>1,'𝑏'=>1,'𝑐'=>1,'𝑑'=>1,'𝑒'=>1,'𝑓'=>1,'𝑔'=>1,'𝑖'=>1,'𝑗'=>1,'𝑘'=>1,'𝑙'=>1,'𝑚'=>1,'𝑛'=>1,'𝑜'=>1,'𝑝'=>1,'𝑞'=>1,'𝑟'=>1,'𝑠'=>1,'𝑡'=>1,'𝑢'=>1,'𝑣'=>1,'𝑤'=>1,'𝑥'=>1,'𝑦'=>1,'𝑧'=>1,'𝑨'=>1,'𝑩'=>1,'𝑪'=>1,'𝑫'=>1,'𝑬'=>1,'𝑭'=>1,'𝑮'=>1,'𝑯'=>1,'𝑰'=>1,'𝑱'=>1,'𝑲'=>1,'𝑳'=>1,'𝑴'=>1,'𝑵'=>1,'𝑶'=>1,'𝑷'=>1,'𝑸'=>1,'𝑹'=>1,'𝑺'=>1,'𝑻'=>1,'𝑼'=>1,'𝑽'=>1,'𝑾'=>1,'𝑿'=>1,'𝒀'=>1,'𝒁'=>1,'𝒂'=>1,'𝒃'=>1,'𝒄'=>1,'𝒅'=>1,'𝒆'=>1,'𝒇'=>1,'𝒈'=>1,'𝒉'=>1,'𝒊'=>1,'𝒋'=>1,'𝒌'=>1,'𝒍'=>1,'𝒎'=>1,'𝒏'=>1,'𝒐'=>1,'𝒑'=>1,'𝒒'=>1,'𝒓'=>1,'𝒔'=>1,'𝒕'=>1,'𝒖'=>1,'𝒗'=>1,'𝒘'=>1,'𝒙'=>1,'𝒚'=>1,'𝒛'=>1,'𝒜'=>1,'𝒞'=>1,'𝒟'=>1,'𝒢'=>1,'𝒥'=>1,'𝒦'=>1,'𝒩'=>1,'𝒪'=>1,'𝒫'=>1,'𝒬'=>1,'𝒮'=>1,'𝒯'=>1,'𝒰'=>1,'𝒱'=>1,'𝒲'=>1,'𝒳'=>1,'𝒴'=>1,'𝒵'=>1,'𝒶'=>1,'𝒷'=>1,'𝒸'=>1,'𝒹'=>1,'𝒻'=>1,'𝒽'=>1,'𝒾'=>1,'𝒿'=>1,'𝓀'=>1,'𝓁'=>1,'𝓂'=>1,'𝓃'=>1,'𝓅'=>1,'𝓆'=>1,'𝓇'=>1,'𝓈'=>1,'𝓉'=>1,'𝓊'=>1,'𝓋'=>1,'𝓌'=>1,'𝓍'=>1,'𝓎'=>1,'𝓏'=>1,'𝓐'=>1,'𝓑'=>1,'𝓒'=>1,'𝓓'=>1,'𝓔'=>1,'𝓕'=>1,'𝓖'=>1,'𝓗'=>1,'𝓘'=>1,'𝓙'=>1,'𝓚'=>1,'𝓛'=>1,'𝓜'=>1,'𝓝'=>1,'𝓞'=>1,'𝓟'=>1,'𝓠'=>1,'𝓡'=>1,'𝓢'=>1,'𝓣'=>1,'𝓤'=>1,'𝓥'=>1,'𝓦'=>1,'𝓧'=>1,'𝓨'=>1,'𝓩'=>1,'𝓪'=>1,'𝓫'=>1,'𝓬'=>1,'𝓭'=>1,'𝓮'=>1,'𝓯'=>1,'𝓰'=>1,'𝓱'=>1,'𝓲'=>1,'𝓳'=>1,'𝓴'=>1,'𝓵'=>1,'𝓶'=>1,'𝓷'=>1,'𝓸'=>1,'𝓹'=>1,'𝓺'=>1,'𝓻'=>1,'𝓼'=>1,'𝓽'=>1,'𝓾'=>1,'𝓿'=>1,'𝔀'=>1,'𝔁'=>1,'𝔂'=>1,'𝔃'=>1,'𝔄'=>1,'𝔅'=>1,'𝔇'=>1,'𝔈'=>1,'𝔉'=>1,'𝔊'=>1,'𝔍'=>1,'𝔎'=>1,'𝔏'=>1,'𝔐'=>1,'𝔑'=>1,'𝔒'=>1,'𝔓'=>1,'𝔔'=>1,'𝔖'=>1,'𝔗'=>1,'𝔘'=>1,'𝔙'=>1,'𝔚'=>1,'𝔛'=>1,'𝔜'=>1,'𝔞'=>1,'𝔟'=>1,'𝔠'=>1,'𝔡'=>1,'𝔢'=>1,'𝔣'=>1,'𝔤'=>1,'𝔥'=>1,'𝔦'=>1,'𝔧'=>1,'𝔨'=>1,'𝔩'=>1,'𝔪'=>1,'𝔫'=>1,'𝔬'=>1,'𝔭'=>1,'𝔮'=>1,'𝔯'=>1,'𝔰'=>1,'𝔱'=>1,'𝔲'=>1,'𝔳'=>1,'𝔴'=>1,'𝔵'=>1,'𝔶'=>1,'𝔷'=>1,'𝔸'=>1,'𝔹'=>1,'𝔻'=>1,'𝔼'=>1,'𝔽'=>1,'𝔾'=>1,'𝕀'=>1,'𝕁'=>1,'𝕂'=>1,'𝕃'=>1,'𝕄'=>1,'𝕆'=>1,'𝕊'=>1,'𝕋'=>1,'𝕌'=>1,'𝕍'=>1,'𝕎'=>1,'𝕏'=>1,'𝕐'=>1,'𝕒'=>1,'𝕓'=>1,'𝕔'=>1,'𝕕'=>1,'𝕖'=>1,'𝕗'=>1,'𝕘'=>1,'𝕙'=>1,'𝕚'=>1,'𝕛'=>1,'𝕜'=>1,'𝕝'=>1,'𝕞'=>1,'𝕟'=>1,'𝕠'=>1,'𝕡'=>1,'𝕢'=>1,'𝕣'=>1,'𝕤'=>1,'𝕥'=>1,'𝕦'=>1,'𝕧'=>1,'𝕨'=>1,'𝕩'=>1,'𝕪'=>1,'𝕫'=>1,'𝕬'=>1,'𝕭'=>1,'𝕮'=>1,'𝕯'=>1,'𝕰'=>1,'𝕱'=>1,'𝕲'=>1,'𝕳'=>1,'𝕴'=>1,'𝕵'=>1,'𝕶'=>1,'𝕷'=>1,'𝕸'=>1,'𝕹'=>1,'𝕺'=>1,'𝕻'=>1,'𝕼'=>1,'𝕽'=>1,'𝕾'=>1,'𝕿'=>1,'𝖀'=>1,'𝖁'=>1,'𝖂'=>1,'𝖃'=>1,'𝖄'=>1,'𝖅'=>1,'𝖆'=>1,'𝖇'=>1,'𝖈'=>1,'𝖉'=>1,'𝖊'=>1,'𝖋'=>1,'𝖌'=>1,'𝖍'=>1,'𝖎'=>1,'𝖏'=>1,'𝖐'=>1,'𝖑'=>1,'𝖒'=>1,'𝖓'=>1,'𝖔'=>1,'𝖕'=>1,'𝖖'=>1,'𝖗'=>1,'𝖘'=>1,'𝖙'=>1,'𝖚'=>1,'𝖛'=>1,'𝖜'=>1,'𝖝'=>1,'𝖞'=>1,'𝖟'=>1,'𝖠'=>1,'𝖡'=>1,'𝖢'=>1,'𝖣'=>1,'𝖤'=>1,'𝖥'=>1,'𝖦'=>1,'𝖧'=>1,'𝖨'=>1,'𝖩'=>1,'𝖪'=>1,'𝖫'=>1,'𝖬'=>1,'𝖭'=>1,'𝖮'=>1,'𝖯'=>1,'𝖰'=>1,'𝖱'=>1,'𝖲'=>1,'𝖳'=>1,'𝖴'=>1,'𝖵'=>1,'𝖶'=>1,'𝖷'=>1,'𝖸'=>1,'𝖹'=>1,'𝖺'=>1,'𝖻'=>1,'𝖼'=>1,'𝖽'=>1,'𝖾'=>1,'𝖿'=>1,'𝗀'=>1,'𝗁'=>1,'𝗂'=>1,'𝗃'=>1,'𝗄'=>1,'𝗅'=>1,'𝗆'=>1,'𝗇'=>1,'𝗈'=>1,'𝗉'=>1,'𝗊'=>1,'𝗋'=>1,'𝗌'=>1,'𝗍'=>1,'𝗎'=>1,'𝗏'=>1,'𝗐'=>1,'𝗑'=>1,'𝗒'=>1,'𝗓'=>1,'𝗔'=>1,'𝗕'=>1,'𝗖'=>1,'𝗗'=>1,'𝗘'=>1,'𝗙'=>1,'𝗚'=>1,'𝗛'=>1,'𝗜'=>1,'𝗝'=>1,'𝗞'=>1,'𝗟'=>1,'𝗠'=>1,'𝗡'=>1,'𝗢'=>1,'𝗣'=>1,'𝗤'=>1,'𝗥'=>1,'𝗦'=>1,'𝗧'=>1,'𝗨'=>1,'𝗩'=>1,'𝗪'=>1,'𝗫'=>1,'𝗬'=>1,'𝗭'=>1,'𝗮'=>1,'𝗯'=>1,'𝗰'=>1,'𝗱'=>1,'𝗲'=>1,'𝗳'=>1,'𝗴'=>1,'𝗵'=>1,'𝗶'=>1,'𝗷'=>1,'𝗸'=>1,'𝗹'=>1,'𝗺'=>1,'𝗻'=>1,'𝗼'=>1,'𝗽'=>1,'𝗾'=>1,'𝗿'=>1,'𝘀'=>1,'𝘁'=>1,'𝘂'=>1,'𝘃'=>1,'𝘄'=>1,'𝘅'=>1,'𝘆'=>1,'𝘇'=>1,'𝘈'=>1,'𝘉'=>1,'𝘊'=>1,'𝘋'=>1,'𝘌'=>1,'𝘍'=>1,'𝘎'=>1,'𝘏'=>1,'𝘐'=>1,'𝘑'=>1,'𝘒'=>1,'𝘓'=>1,'𝘔'=>1,'𝘕'=>1,'𝘖'=>1,'𝘗'=>1,'𝘘'=>1,'𝘙'=>1,'𝘚'=>1,'𝘛'=>1,'𝘜'=>1,'𝘝'=>1,'𝘞'=>1,'𝘟'=>1,'𝘠'=>1,'𝘡'=>1,'𝘢'=>1,'𝘣'=>1,'𝘤'=>1,'𝘥'=>1,'𝘦'=>1,'𝘧'=>1,'𝘨'=>1,'𝘩'=>1,'𝘪'=>1,'𝘫'=>1,'𝘬'=>1,'𝘭'=>1,'𝘮'=>1,'𝘯'=>1,'𝘰'=>1,'𝘱'=>1,'𝘲'=>1,'𝘳'=>1,'𝘴'=>1,'𝘵'=>1,'𝘶'=>1,'𝘷'=>1,'𝘸'=>1,'𝘹'=>1,'𝘺'=>1,'𝘻'=>1,'𝘼'=>1,'𝘽'=>1,'𝘾'=>1,'𝘿'=>1,'𝙀'=>1,'𝙁'=>1,'𝙂'=>1,'𝙃'=>1,'𝙄'=>1,'𝙅'=>1,'𝙆'=>1,'𝙇'=>1,'𝙈'=>1,'𝙉'=>1,'𝙊'=>1,'𝙋'=>1,'𝙌'=>1,'𝙍'=>1,'𝙎'=>1,'𝙏'=>1,'𝙐'=>1,'𝙑'=>1,'𝙒'=>1,'𝙓'=>1,'𝙔'=>1,'𝙕'=>1,'𝙖'=>1,'𝙗'=>1,'𝙘'=>1,'𝙙'=>1,'𝙚'=>1,'𝙛'=>1,'𝙜'=>1,'𝙝'=>1,'𝙞'=>1,'𝙟'=>1,'𝙠'=>1,'𝙡'=>1,'𝙢'=>1,'𝙣'=>1,'𝙤'=>1,'𝙥'=>1,'𝙦'=>1,'𝙧'=>1,'𝙨'=>1,'𝙩'=>1,'𝙪'=>1,'𝙫'=>1,'𝙬'=>1,'𝙭'=>1,'𝙮'=>1,'𝙯'=>1,'𝙰'=>1,'𝙱'=>1,'𝙲'=>1,'𝙳'=>1,'𝙴'=>1,'𝙵'=>1,'𝙶'=>1,'𝙷'=>1,'𝙸'=>1,'𝙹'=>1,'𝙺'=>1,'𝙻'=>1,'𝙼'=>1,'𝙽'=>1,'𝙾'=>1,'𝙿'=>1,'𝚀'=>1,'𝚁'=>1,'𝚂'=>1,'𝚃'=>1,'𝚄'=>1,'𝚅'=>1,'𝚆'=>1,'𝚇'=>1,'𝚈'=>1,'𝚉'=>1,'𝚊'=>1,'𝚋'=>1,'𝚌'=>1,'𝚍'=>1,'𝚎'=>1,'𝚏'=>1,'𝚐'=>1,'𝚑'=>1,'𝚒'=>1,'𝚓'=>1,'𝚔'=>1,'𝚕'=>1,'𝚖'=>1,'𝚗'=>1,'𝚘'=>1,'𝚙'=>1,'𝚚'=>1,'𝚛'=>1,'𝚜'=>1,'𝚝'=>1,'𝚞'=>1,'𝚟'=>1,'𝚠'=>1,'𝚡'=>1,'𝚢'=>1,'𝚣'=>1,'𝚤'=>1,'𝚥'=>1,'𝚨'=>1,'𝚩'=>1,'𝚪'=>1,'𝚫'=>1,'𝚬'=>1,'𝚭'=>1,'𝚮'=>1,'𝚯'=>1,'𝚰'=>1,'𝚱'=>1,'𝚲'=>1,'𝚳'=>1,'𝚴'=>1,'𝚵'=>1,'𝚶'=>1,'𝚷'=>1,'𝚸'=>1,'𝚹'=>1,'𝚺'=>1,'𝚻'=>1,'𝚼'=>1,'𝚽'=>1,'𝚾'=>1,'𝚿'=>1,'𝛀'=>1,'𝛁'=>1,'𝛂'=>1,'𝛃'=>1,'𝛄'=>1,'𝛅'=>1,'𝛆'=>1,'𝛇'=>1,'𝛈'=>1,'𝛉'=>1,'𝛊'=>1,'𝛋'=>1,'𝛌'=>1,'𝛍'=>1,'𝛎'=>1,'𝛏'=>1,'𝛐'=>1,'𝛑'=>1,'𝛒'=>1,'𝛓'=>1,'𝛔'=>1,'𝛕'=>1,'𝛖'=>1,'𝛗'=>1,'𝛘'=>1,'𝛙'=>1,'𝛚'=>1,'𝛛'=>1,'𝛜'=>1,'𝛝'=>1,'𝛞'=>1,'𝛟'=>1,'𝛠'=>1,'𝛡'=>1,'𝛢'=>1,'𝛣'=>1,'𝛤'=>1,'𝛥'=>1,'𝛦'=>1,'𝛧'=>1,'𝛨'=>1,'𝛩'=>1,'𝛪'=>1,'𝛫'=>1,'𝛬'=>1,'𝛭'=>1,'𝛮'=>1,'𝛯'=>1,'𝛰'=>1,'𝛱'=>1,'𝛲'=>1,'𝛳'=>1,'𝛴'=>1,'𝛵'=>1,'𝛶'=>1,'𝛷'=>1,'𝛸'=>1,'𝛹'=>1,'𝛺'=>1,'𝛻'=>1,'𝛼'=>1,'𝛽'=>1,'𝛾'=>1,'𝛿'=>1,'𝜀'=>1,'𝜁'=>1,'𝜂'=>1,'𝜃'=>1,'𝜄'=>1,'𝜅'=>1,'𝜆'=>1,'𝜇'=>1,'𝜈'=>1,'𝜉'=>1,'𝜊'=>1,'𝜋'=>1,'𝜌'=>1,'𝜍'=>1,'𝜎'=>1,'𝜏'=>1,'𝜐'=>1,'𝜑'=>1,'𝜒'=>1,'𝜓'=>1,'𝜔'=>1,'𝜕'=>1,'𝜖'=>1,'𝜗'=>1,'𝜘'=>1,'𝜙'=>1,'𝜚'=>1,'𝜛'=>1,'𝜜'=>1,'𝜝'=>1,'𝜞'=>1,'𝜟'=>1,'𝜠'=>1,'𝜡'=>1,'𝜢'=>1,'𝜣'=>1,'𝜤'=>1,'𝜥'=>1,'𝜦'=>1,'𝜧'=>1,'𝜨'=>1,'𝜩'=>1,'𝜪'=>1,'𝜫'=>1,'𝜬'=>1,'𝜭'=>1,'𝜮'=>1,'𝜯'=>1,'𝜰'=>1,'𝜱'=>1,'𝜲'=>1,'𝜳'=>1,'𝜴'=>1,'𝜵'=>1,'𝜶'=>1,'𝜷'=>1,'𝜸'=>1,'𝜹'=>1,'𝜺'=>1,'𝜻'=>1,'𝜼'=>1,'𝜽'=>1,'𝜾'=>1,'𝜿'=>1,'𝝀'=>1,'𝝁'=>1,'𝝂'=>1,'𝝃'=>1,'𝝄'=>1,'𝝅'=>1,'𝝆'=>1,'𝝇'=>1,'𝝈'=>1,'𝝉'=>1,'𝝊'=>1,'𝝋'=>1,'𝝌'=>1,'𝝍'=>1,'𝝎'=>1,'𝝏'=>1,'𝝐'=>1,'𝝑'=>1,'𝝒'=>1,'𝝓'=>1,'𝝔'=>1,'𝝕'=>1,'𝝖'=>1,'𝝗'=>1,'𝝘'=>1,'𝝙'=>1,'𝝚'=>1,'𝝛'=>1,'𝝜'=>1,'𝝝'=>1,'𝝞'=>1,'𝝟'=>1,'𝝠'=>1,'𝝡'=>1,'𝝢'=>1,'𝝣'=>1,'𝝤'=>1,'𝝥'=>1,'𝝦'=>1,'𝝧'=>1,'𝝨'=>1,'𝝩'=>1,'𝝪'=>1,'𝝫'=>1,'𝝬'=>1,'𝝭'=>1,'𝝮'=>1,'𝝯'=>1,'𝝰'=>1,'𝝱'=>1,'𝝲'=>1,'𝝳'=>1,'𝝴'=>1,'𝝵'=>1,'𝝶'=>1,'𝝷'=>1,'𝝸'=>1,'𝝹'=>1,'𝝺'=>1,'𝝻'=>1,'𝝼'=>1,'𝝽'=>1,'𝝾'=>1,'𝝿'=>1,'𝞀'=>1,'𝞁'=>1,'𝞂'=>1,'𝞃'=>1,'𝞄'=>1,'𝞅'=>1,'𝞆'=>1,'𝞇'=>1,'𝞈'=>1,'𝞉'=>1,'𝞊'=>1,'𝞋'=>1,'𝞌'=>1,'𝞍'=>1,'𝞎'=>1,'𝞏'=>1,'𝞐'=>1,'𝞑'=>1,'𝞒'=>1,'𝞓'=>1,'𝞔'=>1,'𝞕'=>1,'𝞖'=>1,'𝞗'=>1,'𝞘'=>1,'𝞙'=>1,'𝞚'=>1,'𝞛'=>1,'𝞜'=>1,'𝞝'=>1,'𝞞'=>1,'𝞟'=>1,'𝞠'=>1,'𝞡'=>1,'𝞢'=>1,'𝞣'=>1,'𝞤'=>1,'𝞥'=>1,'𝞦'=>1,'𝞧'=>1,'𝞨'=>1,'𝞩'=>1,'𝞪'=>1,'𝞫'=>1,'𝞬'=>1,'𝞭'=>1,'𝞮'=>1,'𝞯'=>1,'𝞰'=>1,'𝞱'=>1,'𝞲'=>1,'𝞳'=>1,'𝞴'=>1,'𝞵'=>1,'𝞶'=>1,'𝞷'=>1,'𝞸'=>1,'𝞹'=>1,'𝞺'=>1,'𝞻'=>1,'𝞼'=>1,'𝞽'=>1,'𝞾'=>1,'𝞿'=>1,'𝟀'=>1,'𝟁'=>1,'𝟂'=>1,'𝟃'=>1,'𝟄'=>1,'𝟅'=>1,'𝟆'=>1,'𝟇'=>1,'𝟈'=>1,'𝟉'=>1,'𝟊'=>1,'𝟋'=>1,'𝟎'=>1,'𝟏'=>1,'𝟐'=>1,'𝟑'=>1,'𝟒'=>1,'𝟓'=>1,'𝟔'=>1,'𝟕'=>1,'𝟖'=>1,'𝟗'=>1,'𝟘'=>1,'𝟙'=>1,'𝟚'=>1,'𝟛'=>1,'𝟜'=>1,'𝟝'=>1,'𝟞'=>1,'𝟟'=>1,'𝟠'=>1,'𝟡'=>1,'𝟢'=>1,'𝟣'=>1,'𝟤'=>1,'𝟥'=>1,'𝟦'=>1,'𝟧'=>1,'𝟨'=>1,'𝟩'=>1,'𝟪'=>1,'𝟫'=>1,'𝟬'=>1,'𝟭'=>1,'𝟮'=>1,'𝟯'=>1,'𝟰'=>1,'𝟱'=>1,'𝟲'=>1,'𝟳'=>1,'𝟴'=>1,'𝟵'=>1,'𝟶'=>1,'𝟷'=>1,'𝟸'=>1,'𝟹'=>1,'𝟺'=>1,'𝟻'=>1,'𝟼'=>1,'𝟽'=>1,'𝟾'=>1,'𝟿'=>1,'丽'=>1,'丸'=>1,'乁'=>1,'𠄢'=>1,'你'=>1,'侮'=>1,'侻'=>1,'倂'=>1,'偺'=>1,'備'=>1,'僧'=>1,'像'=>1,'㒞'=>1,'𠘺'=>1,'免'=>1,'兔'=>1,'兤'=>1,'具'=>1,'𠔜'=>1,'㒹'=>1,'內'=>1,'再'=>1,'𠕋'=>1,'冗'=>1,'冤'=>1,'仌'=>1,'冬'=>1,'况'=>1,'𩇟'=>1,'凵'=>1,'刃'=>1,'㓟'=>1,'刻'=>1,'剆'=>1,'割'=>1,'剷'=>1,'㔕'=>1,'勇'=>1,'勉'=>1,'勤'=>1,'勺'=>1,'包'=>1,'匆'=>1,'北'=>1,'卉'=>1,'卑'=>1,'博'=>1,'即'=>1,'卽'=>1,'卿'=>1,'卿'=>1,'卿'=>1,'𠨬'=>1,'灰'=>1,'及'=>1,'叟'=>1,'𠭣'=>1,'叫'=>1,'叱'=>1,'吆'=>1,'咞'=>1,'吸'=>1,'呈'=>1,'周'=>1,'咢'=>1,'哶'=>1,'唐'=>1,'啓'=>1,'啣'=>1,'善'=>1,'善'=>1,'喙'=>1,'喫'=>1,'喳'=>1,'嗂'=>1,'圖'=>1,'嘆'=>1,'圗'=>1,'噑'=>1,'噴'=>1,'切'=>1,'壮'=>1,'城'=>1,'埴'=>1,'堍'=>1,'型'=>1,'堲'=>1,'報'=>1,'墬'=>1,'𡓤'=>1,'売'=>1,'壷'=>1,'夆'=>1,'多'=>1,'夢'=>1,'奢'=>1,'𡚨'=>1,'𡛪'=>1,'姬'=>1,'娛'=>1,'娧'=>1,'姘'=>1,'婦'=>1,'㛮'=>1,'㛼'=>1,'嬈'=>1,'嬾'=>1,'嬾'=>1,'𡧈'=>1,'寃'=>1,'寘'=>1,'寧'=>1,'寳'=>1,'𡬘'=>1,'寿'=>1,'将'=>1,'当'=>1,'尢'=>1,'㞁'=>1,'屠'=>1,'屮'=>1,'峀'=>1,'岍'=>1,'𡷤'=>1,'嵃'=>1,'𡷦'=>1,'嵮'=>1,'嵫'=>1,'嵼'=>1,'巡'=>1,'巢'=>1,'㠯'=>1,'巽'=>1,'帨'=>1,'帽'=>1,'幩'=>1,'㡢'=>1,'𢆃'=>1,'㡼'=>1,'庰'=>1,'庳'=>1,'庶'=>1,'廊'=>1,'𪎒'=>1,'廾'=>1,'𢌱'=>1,'𢌱'=>1,'舁'=>1,'弢'=>1,'弢'=>1,'㣇'=>1,'𣊸'=>1,'𦇚'=>1,'形'=>1,'彫'=>1,'㣣'=>1,'徚'=>1,'忍'=>1,'志'=>1,'忹'=>1,'悁'=>1,'㤺'=>1,'㤜'=>1,'悔'=>1,'𢛔'=>1,'惇'=>1,'慈'=>1,'慌'=>1,'慎'=>1,'慌'=>1,'慺'=>1,'憎'=>1,'憲'=>1,'憤'=>1,'憯'=>1,'懞'=>1,'懲'=>1,'懶'=>1,'成'=>1,'戛'=>1,'扝'=>1,'抱'=>1,'拔'=>1,'捐'=>1,'𢬌'=>1,'挽'=>1,'拼'=>1,'捨'=>1,'掃'=>1,'揤'=>1,'𢯱'=>1,'搢'=>1,'揅'=>1,'掩'=>1,'㨮'=>1,'摩'=>1,'摾'=>1,'撝'=>1,'摷'=>1,'㩬'=>1,'敏'=>1,'敬'=>1,'𣀊'=>1,'旣'=>1,'書'=>1,'晉'=>1,'㬙'=>1,'暑'=>1,'㬈'=>1,'㫤'=>1,'冒'=>1,'冕'=>1,'最'=>1,'暜'=>1,'肭'=>1,'䏙'=>1,'朗'=>1,'望'=>1,'朡'=>1,'杞'=>1,'杓'=>1,'𣏃'=>1,'㭉'=>1,'柺'=>1,'枅'=>1,'桒'=>1,'梅'=>1,'𣑭'=>1,'梎'=>1,'栟'=>1,'椔'=>1,'㮝'=>1,'楂'=>1,'榣'=>1,'槪'=>1,'檨'=>1,'𣚣'=>1,'櫛'=>1,'㰘'=>1,'次'=>1,'𣢧'=>1,'歔'=>1,'㱎'=>1,'歲'=>1,'殟'=>1,'殺'=>1,'殻'=>1,'𣪍'=>1,'𡴋'=>1,'𣫺'=>1,'汎'=>1,'𣲼'=>1,'沿'=>1,'泍'=>1,'汧'=>1,'洖'=>1,'派'=>1,'海'=>1,'流'=>1,'浩'=>1,'浸'=>1,'涅'=>1,'𣴞'=>1,'洴'=>1,'港'=>1,'湮'=>1,'㴳'=>1,'滋'=>1,'滇'=>1,'𣻑'=>1,'淹'=>1,'潮'=>1,'𣽞'=>1,'𣾎'=>1,'濆'=>1,'瀹'=>1,'瀞'=>1,'瀛'=>1,'㶖'=>1,'灊'=>1,'災'=>1,'灷'=>1,'炭'=>1,'𠔥'=>1,'煅'=>1,'𤉣'=>1,'熜'=>1,'𤎫'=>1,'爨'=>1,'爵'=>1,'牐'=>1,'𤘈'=>1,'犀'=>1,'犕'=>1,'𤜵'=>1,'𤠔'=>1,'獺'=>1,'王'=>1,'㺬'=>1,'玥'=>1,'㺸'=>1,'㺸'=>1,'瑇'=>1,'瑜'=>1,'瑱'=>1,'璅'=>1,'瓊'=>1,'㼛'=>1,'甤'=>1,'𤰶'=>1,'甾'=>1,'𤲒'=>1,'異'=>1,'𢆟'=>1,'瘐'=>1,'𤾡'=>1,'𤾸'=>1,'𥁄'=>1,'㿼'=>1,'䀈'=>1,'直'=>1,'𥃳'=>1,'𥃲'=>1,'𥄙'=>1,'𥄳'=>1,'眞'=>1,'真'=>1,'真'=>1,'睊'=>1,'䀹'=>1,'瞋'=>1,'䁆'=>1,'䂖'=>1,'𥐝'=>1,'硎'=>1,'碌'=>1,'磌'=>1,'䃣'=>1,'𥘦'=>1,'祖'=>1,'𥚚'=>1,'𥛅'=>1,'福'=>1,'秫'=>1,'䄯'=>1,'穀'=>1,'穊'=>1,'穏'=>1,'𥥼'=>1,'𥪧'=>1,'𥪧'=>1,'竮'=>1,'䈂'=>1,'𥮫'=>1,'篆'=>1,'築'=>1,'䈧'=>1,'𥲀'=>1,'糒'=>1,'䊠'=>1,'糨'=>1,'糣'=>1,'紀'=>1,'𥾆'=>1,'絣'=>1,'䌁'=>1,'緇'=>1,'縂'=>1,'繅'=>1,'䌴'=>1,'𦈨'=>1,'𦉇'=>1,'䍙'=>1,'𦋙'=>1,'罺'=>1,'𦌾'=>1,'羕'=>1,'翺'=>1,'者'=>1,'𦓚'=>1,'𦔣'=>1,'聠'=>1,'𦖨'=>1,'聰'=>1,'𣍟'=>1,'䏕'=>1,'育'=>1,'脃'=>1,'䐋'=>1,'脾'=>1,'媵'=>1,'𦞧'=>1,'𦞵'=>1,'𣎓'=>1,'𣎜'=>1,'舁'=>1,'舄'=>1,'辞'=>1,'䑫'=>1,'芑'=>1,'芋'=>1,'芝'=>1,'劳'=>1,'花'=>1,'芳'=>1,'芽'=>1,'苦'=>1,'𦬼'=>1,'若'=>1,'茝'=>1,'荣'=>1,'莭'=>1,'茣'=>1,'莽'=>1,'菧'=>1,'著'=>1,'荓'=>1,'菊'=>1,'菌'=>1,'菜'=>1,'𦰶'=>1,'𦵫'=>1,'𦳕'=>1,'䔫'=>1,'蓱'=>1,'蓳'=>1,'蔖'=>1,'𧏊'=>1,'蕤'=>1,'𦼬'=>1,'䕝'=>1,'䕡'=>1,'𦾱'=>1,'𧃒'=>1,'䕫'=>1,'虐'=>1,'虜'=>1,'虧'=>1,'虩'=>1,'蚩'=>1,'蚈'=>1,'蜎'=>1,'蛢'=>1,'蝹'=>1,'蜨'=>1,'蝫'=>1,'螆'=>1,'䗗'=>1,'蟡'=>1,'蠁'=>1,'䗹'=>1,'衠'=>1,'衣'=>1,'𧙧'=>1,'裗'=>1,'裞'=>1,'䘵'=>1,'裺'=>1,'㒻'=>1,'𧢮'=>1,'𧥦'=>1,'䚾'=>1,'䛇'=>1,'誠'=>1,'諭'=>1,'變'=>1,'豕'=>1,'𧲨'=>1,'貫'=>1,'賁'=>1,'贛'=>1,'起'=>1,'𧼯'=>1,'𠠄'=>1,'跋'=>1,'趼'=>1,'跰'=>1,'𠣞'=>1,'軔'=>1,'輸'=>1,'𨗒'=>1,'𨗭'=>1,'邔'=>1,'郱'=>1,'鄑'=>1,'𨜮'=>1,'鄛'=>1,'鈸'=>1,'鋗'=>1,'鋘'=>1,'鉼'=>1,'鏹'=>1,'鐕'=>1,'𨯺'=>1,'開'=>1,'䦕'=>1,'閷'=>1,'𨵷'=>1,'䧦'=>1,'雃'=>1,'嶲'=>1,'霣'=>1,'𩅅'=>1,'𩈚'=>1,'䩮'=>1,'䩶'=>1,'韠'=>1,'𩐊'=>1,'䪲'=>1,'𩒖'=>1,'頋'=>1,'頋'=>1,'頩'=>1,'𩖶'=>1,'飢'=>1,'䬳'=>1,'餩'=>1,'馧'=>1,'駂'=>1,'駾'=>1,'䯎'=>1,'𩬰'=>1,'鬒'=>1,'鱀'=>1,'鳽'=>1,'䳎'=>1,'䳭'=>1,'鵧'=>1,'𪃎'=>1,'䳸'=>1,'𪄅'=>1,'𪈎'=>1,'𪊑'=>1,'麻'=>1,'䵖'=>1,'黹'=>1,'黾'=>1,'鼅'=>1,'鼏'=>1,'鼖'=>1,'鼻'=>1,'𪘀'=>1,'̀'=>0,'́'=>0,'̂'=>0,'̃'=>0,'̄'=>0,'̆'=>0,'̇'=>0,'̈'=>0,'̉'=>0,'̊'=>0,'̋'=>0,'̌'=>0,'̏'=>0,'̑'=>0,'̓'=>0,'̔'=>0,'̛'=>0,'̣'=>0,'̤'=>0,'̥'=>0,'̦'=>0,'̧'=>0,'̨'=>0,'̭'=>0,'̮'=>0,'̰'=>0,'̱'=>0,'̸'=>0,'͂'=>0,'ͅ'=>0,'ٓ'=>0,'ٔ'=>0,'ٕ'=>0,'़'=>0,'া'=>0,'ৗ'=>0,'ା'=>0,'ୖ'=>0,'ୗ'=>0,'ா'=>0,'ௗ'=>0,'ౖ'=>0,'ೂ'=>0,'ೕ'=>0,'ೖ'=>0,'ാ'=>0,'ൗ'=>0,'්'=>0,'ා'=>0,'ෟ'=>0,'ီ'=>0,'ᅡ'=>0,'ᅢ'=>0,'ᅣ'=>0,'ᅤ'=>0,'ᅥ'=>0,'ᅦ'=>0,'ᅧ'=>0,'ᅨ'=>0,'ᅩ'=>0,'ᅪ'=>0,'ᅫ'=>0,'ᅬ'=>0,'ᅭ'=>0,'ᅮ'=>0,'ᅯ'=>0,'ᅰ'=>0,'ᅱ'=>0,'ᅲ'=>0,'ᅳ'=>0,'ᅴ'=>0,'ᅵ'=>0,'ᆨ'=>0,'ᆩ'=>0,'ᆪ'=>0,'ᆫ'=>0,'ᆬ'=>0,'ᆭ'=>0,'ᆮ'=>0,'ᆯ'=>0,'ᆰ'=>0,'ᆱ'=>0,'ᆲ'=>0,'ᆳ'=>0,'ᆴ'=>0,'ᆵ'=>0,'ᆶ'=>0,'ᆷ'=>0,'ᆸ'=>0,'ᆹ'=>0,'ᆺ'=>0,'ᆻ'=>0,'ᆼ'=>0,'ᆽ'=>0,'ᆾ'=>0,'ᆿ'=>0,'ᇀ'=>0,'ᇁ'=>0,'ᇂ'=>0,'ᬵ'=>0,'゙'=>0,'゚'=>0); \ No newline at end of file
+$GLOBALS['utf_nfkc_qc']=array(' '=>1,'¨'=>1,'ª'=>1,'¯'=>1,'²'=>1,'³'=>1,'´'=>1,'µ'=>1,'¸'=>1,'¹'=>1,'º'=>1,'¼'=>1,'½'=>1,'¾'=>1,'IJ'=>1,'ij'=>1,'Ŀ'=>1,'ŀ'=>1,'ʼn'=>1,'ſ'=>1,'DŽ'=>1,'Dž'=>1,'dž'=>1,'LJ'=>1,'Lj'=>1,'lj'=>1,'NJ'=>1,'Nj'=>1,'nj'=>1,'DZ'=>1,'Dz'=>1,'dz'=>1,'ʰ'=>1,'ʱ'=>1,'ʲ'=>1,'ʳ'=>1,'ʴ'=>1,'ʵ'=>1,'ʶ'=>1,'ʷ'=>1,'ʸ'=>1,'˘'=>1,'˙'=>1,'˚'=>1,'˛'=>1,'˜'=>1,'˝'=>1,'ˠ'=>1,'ˡ'=>1,'ˢ'=>1,'ˣ'=>1,'ˤ'=>1,'̀'=>1,'́'=>1,'̓'=>1,'̈́'=>1,'ʹ'=>1,'ͺ'=>1,';'=>1,'΄'=>1,'΅'=>1,'·'=>1,'ϐ'=>1,'ϑ'=>1,'ϒ'=>1,'ϓ'=>1,'ϔ'=>1,'ϕ'=>1,'ϖ'=>1,'ϰ'=>1,'ϱ'=>1,'ϲ'=>1,'ϴ'=>1,'ϵ'=>1,'Ϲ'=>1,'և'=>1,'ٵ'=>1,'ٶ'=>1,'ٷ'=>1,'ٸ'=>1,'क़'=>1,'ख़'=>1,'ग़'=>1,'ज़'=>1,'ड़'=>1,'ढ़'=>1,'फ़'=>1,'य़'=>1,'ড়'=>1,'ঢ়'=>1,'য়'=>1,'ਲ਼'=>1,'ਸ਼'=>1,'ਖ਼'=>1,'ਗ਼'=>1,'ਜ਼'=>1,'ਫ਼'=>1,'ଡ଼'=>1,'ଢ଼'=>1,'ำ'=>1,'ຳ'=>1,'ໜ'=>1,'ໝ'=>1,'༌'=>1,'གྷ'=>1,'ཌྷ'=>1,'དྷ'=>1,'བྷ'=>1,'ཛྷ'=>1,'ཀྵ'=>1,'ཱི'=>1,'ཱུ'=>1,'ྲྀ'=>1,'ཷ'=>1,'ླྀ'=>1,'ཹ'=>1,'ཱྀ'=>1,'ྒྷ'=>1,'ྜྷ'=>1,'ྡྷ'=>1,'ྦྷ'=>1,'ྫྷ'=>1,'ྐྵ'=>1,'ჼ'=>1,'ᴬ'=>1,'ᴭ'=>1,'ᴮ'=>1,'ᴰ'=>1,'ᴱ'=>1,'ᴲ'=>1,'ᴳ'=>1,'ᴴ'=>1,'ᴵ'=>1,'ᴶ'=>1,'ᴷ'=>1,'ᴸ'=>1,'ᴹ'=>1,'ᴺ'=>1,'ᴼ'=>1,'ᴽ'=>1,'ᴾ'=>1,'ᴿ'=>1,'ᵀ'=>1,'ᵁ'=>1,'ᵂ'=>1,'ᵃ'=>1,'ᵄ'=>1,'ᵅ'=>1,'ᵆ'=>1,'ᵇ'=>1,'ᵈ'=>1,'ᵉ'=>1,'ᵊ'=>1,'ᵋ'=>1,'ᵌ'=>1,'ᵍ'=>1,'ᵏ'=>1,'ᵐ'=>1,'ᵑ'=>1,'ᵒ'=>1,'ᵓ'=>1,'ᵔ'=>1,'ᵕ'=>1,'ᵖ'=>1,'ᵗ'=>1,'ᵘ'=>1,'ᵙ'=>1,'ᵚ'=>1,'ᵛ'=>1,'ᵜ'=>1,'ᵝ'=>1,'ᵞ'=>1,'ᵟ'=>1,'ᵠ'=>1,'ᵡ'=>1,'ᵢ'=>1,'ᵣ'=>1,'ᵤ'=>1,'ᵥ'=>1,'ᵦ'=>1,'ᵧ'=>1,'ᵨ'=>1,'ᵩ'=>1,'ᵪ'=>1,'ᵸ'=>1,'ᶛ'=>1,'ᶜ'=>1,'ᶝ'=>1,'ᶞ'=>1,'ᶟ'=>1,'ᶠ'=>1,'ᶡ'=>1,'ᶢ'=>1,'ᶣ'=>1,'ᶤ'=>1,'ᶥ'=>1,'ᶦ'=>1,'ᶧ'=>1,'ᶨ'=>1,'ᶩ'=>1,'ᶪ'=>1,'ᶫ'=>1,'ᶬ'=>1,'ᶭ'=>1,'ᶮ'=>1,'ᶯ'=>1,'ᶰ'=>1,'ᶱ'=>1,'ᶲ'=>1,'ᶳ'=>1,'ᶴ'=>1,'ᶵ'=>1,'ᶶ'=>1,'ᶷ'=>1,'ᶸ'=>1,'ᶹ'=>1,'ᶺ'=>1,'ᶻ'=>1,'ᶼ'=>1,'ᶽ'=>1,'ᶾ'=>1,'ᶿ'=>1,'ẚ'=>1,'ẛ'=>1,'ά'=>1,'έ'=>1,'ή'=>1,'ί'=>1,'ό'=>1,'ύ'=>1,'ώ'=>1,'Ά'=>1,'᾽'=>1,'ι'=>1,'᾿'=>1,'῀'=>1,'῁'=>1,'Έ'=>1,'Ή'=>1,'῍'=>1,'῎'=>1,'῏'=>1,'ΐ'=>1,'Ί'=>1,'῝'=>1,'῞'=>1,'῟'=>1,'ΰ'=>1,'Ύ'=>1,'῭'=>1,'΅'=>1,'`'=>1,'Ό'=>1,'Ώ'=>1,'´'=>1,'῾'=>1,' '=>1,' '=>1,' '=>1,' '=>1,' '=>1,' '=>1,' '=>1,' '=>1,' '=>1,' '=>1,' '=>1,'‑'=>1,'‗'=>1,'․'=>1,'‥'=>1,'…'=>1,' '=>1,'″'=>1,'‴'=>1,'‶'=>1,'‷'=>1,'‼'=>1,'‾'=>1,'⁇'=>1,'⁈'=>1,'⁉'=>1,'⁗'=>1,' '=>1,'⁰'=>1,'ⁱ'=>1,'⁴'=>1,'⁵'=>1,'⁶'=>1,'⁷'=>1,'⁸'=>1,'⁹'=>1,'⁺'=>1,'⁻'=>1,'⁼'=>1,'⁽'=>1,'⁾'=>1,'ⁿ'=>1,'₀'=>1,'₁'=>1,'₂'=>1,'₃'=>1,'₄'=>1,'₅'=>1,'₆'=>1,'₇'=>1,'₈'=>1,'₉'=>1,'₊'=>1,'₋'=>1,'₌'=>1,'₍'=>1,'₎'=>1,'ₐ'=>1,'ₑ'=>1,'ₒ'=>1,'ₓ'=>1,'ₔ'=>1,'₨'=>1,'℀'=>1,'℁'=>1,'ℂ'=>1,'℃'=>1,'℅'=>1,'℆'=>1,'ℇ'=>1,'℉'=>1,'ℊ'=>1,'ℋ'=>1,'ℌ'=>1,'ℍ'=>1,'ℎ'=>1,'ℏ'=>1,'ℐ'=>1,'ℑ'=>1,'ℒ'=>1,'ℓ'=>1,'ℕ'=>1,'№'=>1,'ℙ'=>1,'ℚ'=>1,'ℛ'=>1,'ℜ'=>1,'ℝ'=>1,'℠'=>1,'℡'=>1,'™'=>1,'ℤ'=>1,'Ω'=>1,'ℨ'=>1,'K'=>1,'Å'=>1,'ℬ'=>1,'ℭ'=>1,'ℯ'=>1,'ℰ'=>1,'ℱ'=>1,'ℳ'=>1,'ℴ'=>1,'ℵ'=>1,'ℶ'=>1,'ℷ'=>1,'ℸ'=>1,'ℹ'=>1,'℻'=>1,'ℼ'=>1,'ℽ'=>1,'ℾ'=>1,'ℿ'=>1,'⅀'=>1,'ⅅ'=>1,'ⅆ'=>1,'ⅇ'=>1,'ⅈ'=>1,'ⅉ'=>1,'⅓'=>1,'⅔'=>1,'⅕'=>1,'⅖'=>1,'⅗'=>1,'⅘'=>1,'⅙'=>1,'⅚'=>1,'⅛'=>1,'⅜'=>1,'⅝'=>1,'⅞'=>1,'⅟'=>1,'Ⅰ'=>1,'Ⅱ'=>1,'Ⅲ'=>1,'Ⅳ'=>1,'Ⅴ'=>1,'Ⅵ'=>1,'Ⅶ'=>1,'Ⅷ'=>1,'Ⅸ'=>1,'Ⅹ'=>1,'Ⅺ'=>1,'Ⅻ'=>1,'Ⅼ'=>1,'Ⅽ'=>1,'Ⅾ'=>1,'Ⅿ'=>1,'ⅰ'=>1,'ⅱ'=>1,'ⅲ'=>1,'ⅳ'=>1,'ⅴ'=>1,'ⅵ'=>1,'ⅶ'=>1,'ⅷ'=>1,'ⅸ'=>1,'ⅹ'=>1,'ⅺ'=>1,'ⅻ'=>1,'ⅼ'=>1,'ⅽ'=>1,'ⅾ'=>1,'ⅿ'=>1,'∬'=>1,'∭'=>1,'∯'=>1,'∰'=>1,'〈'=>1,'〉'=>1,'①'=>1,'②'=>1,'③'=>1,'④'=>1,'⑤'=>1,'⑥'=>1,'⑦'=>1,'⑧'=>1,'⑨'=>1,'⑩'=>1,'⑪'=>1,'⑫'=>1,'⑬'=>1,'⑭'=>1,'⑮'=>1,'⑯'=>1,'⑰'=>1,'⑱'=>1,'⑲'=>1,'⑳'=>1,'⑴'=>1,'⑵'=>1,'⑶'=>1,'⑷'=>1,'⑸'=>1,'⑹'=>1,'⑺'=>1,'⑻'=>1,'⑼'=>1,'⑽'=>1,'⑾'=>1,'⑿'=>1,'⒀'=>1,'⒁'=>1,'⒂'=>1,'⒃'=>1,'⒄'=>1,'⒅'=>1,'⒆'=>1,'⒇'=>1,'⒈'=>1,'⒉'=>1,'⒊'=>1,'⒋'=>1,'⒌'=>1,'⒍'=>1,'⒎'=>1,'⒏'=>1,'⒐'=>1,'⒑'=>1,'⒒'=>1,'⒓'=>1,'⒔'=>1,'⒕'=>1,'⒖'=>1,'⒗'=>1,'⒘'=>1,'⒙'=>1,'⒚'=>1,'⒛'=>1,'⒜'=>1,'⒝'=>1,'⒞'=>1,'⒟'=>1,'⒠'=>1,'⒡'=>1,'⒢'=>1,'⒣'=>1,'⒤'=>1,'⒥'=>1,'⒦'=>1,'⒧'=>1,'⒨'=>1,'⒩'=>1,'⒪'=>1,'⒫'=>1,'⒬'=>1,'⒭'=>1,'⒮'=>1,'⒯'=>1,'⒰'=>1,'⒱'=>1,'⒲'=>1,'⒳'=>1,'⒴'=>1,'⒵'=>1,'Ⓐ'=>1,'Ⓑ'=>1,'Ⓒ'=>1,'Ⓓ'=>1,'Ⓔ'=>1,'Ⓕ'=>1,'Ⓖ'=>1,'Ⓗ'=>1,'Ⓘ'=>1,'Ⓙ'=>1,'Ⓚ'=>1,'Ⓛ'=>1,'Ⓜ'=>1,'Ⓝ'=>1,'Ⓞ'=>1,'Ⓟ'=>1,'Ⓠ'=>1,'Ⓡ'=>1,'Ⓢ'=>1,'Ⓣ'=>1,'Ⓤ'=>1,'Ⓥ'=>1,'Ⓦ'=>1,'Ⓧ'=>1,'Ⓨ'=>1,'Ⓩ'=>1,'ⓐ'=>1,'ⓑ'=>1,'ⓒ'=>1,'ⓓ'=>1,'ⓔ'=>1,'ⓕ'=>1,'ⓖ'=>1,'ⓗ'=>1,'ⓘ'=>1,'ⓙ'=>1,'ⓚ'=>1,'ⓛ'=>1,'ⓜ'=>1,'ⓝ'=>1,'ⓞ'=>1,'ⓟ'=>1,'ⓠ'=>1,'ⓡ'=>1,'ⓢ'=>1,'ⓣ'=>1,'ⓤ'=>1,'ⓥ'=>1,'ⓦ'=>1,'ⓧ'=>1,'ⓨ'=>1,'ⓩ'=>1,'⓪'=>1,'⨌'=>1,'⩴'=>1,'⩵'=>1,'⩶'=>1,'⫝̸'=>1,'ⵯ'=>1,'⺟'=>1,'⻳'=>1,'⼀'=>1,'⼁'=>1,'⼂'=>1,'⼃'=>1,'⼄'=>1,'⼅'=>1,'⼆'=>1,'⼇'=>1,'⼈'=>1,'⼉'=>1,'⼊'=>1,'⼋'=>1,'⼌'=>1,'⼍'=>1,'⼎'=>1,'⼏'=>1,'⼐'=>1,'⼑'=>1,'⼒'=>1,'⼓'=>1,'⼔'=>1,'⼕'=>1,'⼖'=>1,'⼗'=>1,'⼘'=>1,'⼙'=>1,'⼚'=>1,'⼛'=>1,'⼜'=>1,'⼝'=>1,'⼞'=>1,'⼟'=>1,'⼠'=>1,'⼡'=>1,'⼢'=>1,'⼣'=>1,'⼤'=>1,'⼥'=>1,'⼦'=>1,'⼧'=>1,'⼨'=>1,'⼩'=>1,'⼪'=>1,'⼫'=>1,'⼬'=>1,'⼭'=>1,'⼮'=>1,'⼯'=>1,'⼰'=>1,'⼱'=>1,'⼲'=>1,'⼳'=>1,'⼴'=>1,'⼵'=>1,'⼶'=>1,'⼷'=>1,'⼸'=>1,'⼹'=>1,'⼺'=>1,'⼻'=>1,'⼼'=>1,'⼽'=>1,'⼾'=>1,'⼿'=>1,'⽀'=>1,'⽁'=>1,'⽂'=>1,'⽃'=>1,'⽄'=>1,'⽅'=>1,'⽆'=>1,'⽇'=>1,'⽈'=>1,'⽉'=>1,'⽊'=>1,'⽋'=>1,'⽌'=>1,'⽍'=>1,'⽎'=>1,'⽏'=>1,'⽐'=>1,'⽑'=>1,'⽒'=>1,'⽓'=>1,'⽔'=>1,'⽕'=>1,'⽖'=>1,'⽗'=>1,'⽘'=>1,'⽙'=>1,'⽚'=>1,'⽛'=>1,'⽜'=>1,'⽝'=>1,'⽞'=>1,'⽟'=>1,'⽠'=>1,'⽡'=>1,'⽢'=>1,'⽣'=>1,'⽤'=>1,'⽥'=>1,'⽦'=>1,'⽧'=>1,'⽨'=>1,'⽩'=>1,'⽪'=>1,'⽫'=>1,'⽬'=>1,'⽭'=>1,'⽮'=>1,'⽯'=>1,'⽰'=>1,'⽱'=>1,'⽲'=>1,'⽳'=>1,'⽴'=>1,'⽵'=>1,'⽶'=>1,'⽷'=>1,'⽸'=>1,'⽹'=>1,'⽺'=>1,'⽻'=>1,'⽼'=>1,'⽽'=>1,'⽾'=>1,'⽿'=>1,'⾀'=>1,'⾁'=>1,'⾂'=>1,'⾃'=>1,'⾄'=>1,'⾅'=>1,'⾆'=>1,'⾇'=>1,'⾈'=>1,'⾉'=>1,'⾊'=>1,'⾋'=>1,'⾌'=>1,'⾍'=>1,'⾎'=>1,'⾏'=>1,'⾐'=>1,'⾑'=>1,'⾒'=>1,'⾓'=>1,'⾔'=>1,'⾕'=>1,'⾖'=>1,'⾗'=>1,'⾘'=>1,'⾙'=>1,'⾚'=>1,'⾛'=>1,'⾜'=>1,'⾝'=>1,'⾞'=>1,'⾟'=>1,'⾠'=>1,'⾡'=>1,'⾢'=>1,'⾣'=>1,'⾤'=>1,'⾥'=>1,'⾦'=>1,'⾧'=>1,'⾨'=>1,'⾩'=>1,'⾪'=>1,'⾫'=>1,'⾬'=>1,'⾭'=>1,'⾮'=>1,'⾯'=>1,'⾰'=>1,'⾱'=>1,'⾲'=>1,'⾳'=>1,'⾴'=>1,'⾵'=>1,'⾶'=>1,'⾷'=>1,'⾸'=>1,'⾹'=>1,'⾺'=>1,'⾻'=>1,'⾼'=>1,'⾽'=>1,'⾾'=>1,'⾿'=>1,'⿀'=>1,'⿁'=>1,'⿂'=>1,'⿃'=>1,'⿄'=>1,'⿅'=>1,'⿆'=>1,'⿇'=>1,'⿈'=>1,'⿉'=>1,'⿊'=>1,'⿋'=>1,'⿌'=>1,'⿍'=>1,'⿎'=>1,'⿏'=>1,'⿐'=>1,'⿑'=>1,'⿒'=>1,'⿓'=>1,'⿔'=>1,'⿕'=>1,' '=>1,'〶'=>1,'〸'=>1,'〹'=>1,'〺'=>1,'゛'=>1,'゜'=>1,'ゟ'=>1,'ヿ'=>1,'ㄱ'=>1,'ㄲ'=>1,'ㄳ'=>1,'ㄴ'=>1,'ㄵ'=>1,'ㄶ'=>1,'ㄷ'=>1,'ㄸ'=>1,'ㄹ'=>1,'ㄺ'=>1,'ㄻ'=>1,'ㄼ'=>1,'ㄽ'=>1,'ㄾ'=>1,'ㄿ'=>1,'ㅀ'=>1,'ㅁ'=>1,'ㅂ'=>1,'ㅃ'=>1,'ㅄ'=>1,'ㅅ'=>1,'ㅆ'=>1,'ㅇ'=>1,'ㅈ'=>1,'ㅉ'=>1,'ㅊ'=>1,'ㅋ'=>1,'ㅌ'=>1,'ㅍ'=>1,'ㅎ'=>1,'ㅏ'=>1,'ㅐ'=>1,'ㅑ'=>1,'ㅒ'=>1,'ㅓ'=>1,'ㅔ'=>1,'ㅕ'=>1,'ㅖ'=>1,'ㅗ'=>1,'ㅘ'=>1,'ㅙ'=>1,'ㅚ'=>1,'ㅛ'=>1,'ㅜ'=>1,'ㅝ'=>1,'ㅞ'=>1,'ㅟ'=>1,'ㅠ'=>1,'ㅡ'=>1,'ㅢ'=>1,'ㅣ'=>1,'ㅤ'=>1,'ㅥ'=>1,'ㅦ'=>1,'ㅧ'=>1,'ㅨ'=>1,'ㅩ'=>1,'ㅪ'=>1,'ㅫ'=>1,'ㅬ'=>1,'ㅭ'=>1,'ㅮ'=>1,'ㅯ'=>1,'ㅰ'=>1,'ㅱ'=>1,'ㅲ'=>1,'ㅳ'=>1,'ㅴ'=>1,'ㅵ'=>1,'ㅶ'=>1,'ㅷ'=>1,'ㅸ'=>1,'ㅹ'=>1,'ㅺ'=>1,'ㅻ'=>1,'ㅼ'=>1,'ㅽ'=>1,'ㅾ'=>1,'ㅿ'=>1,'ㆀ'=>1,'ㆁ'=>1,'ㆂ'=>1,'ㆃ'=>1,'ㆄ'=>1,'ㆅ'=>1,'ㆆ'=>1,'ㆇ'=>1,'ㆈ'=>1,'ㆉ'=>1,'ㆊ'=>1,'ㆋ'=>1,'ㆌ'=>1,'ㆍ'=>1,'ㆎ'=>1,'㆒'=>1,'㆓'=>1,'㆔'=>1,'㆕'=>1,'㆖'=>1,'㆗'=>1,'㆘'=>1,'㆙'=>1,'㆚'=>1,'㆛'=>1,'㆜'=>1,'㆝'=>1,'㆞'=>1,'㆟'=>1,'㈀'=>1,'㈁'=>1,'㈂'=>1,'㈃'=>1,'㈄'=>1,'㈅'=>1,'㈆'=>1,'㈇'=>1,'㈈'=>1,'㈉'=>1,'㈊'=>1,'㈋'=>1,'㈌'=>1,'㈍'=>1,'㈎'=>1,'㈏'=>1,'㈐'=>1,'㈑'=>1,'㈒'=>1,'㈓'=>1,'㈔'=>1,'㈕'=>1,'㈖'=>1,'㈗'=>1,'㈘'=>1,'㈙'=>1,'㈚'=>1,'㈛'=>1,'㈜'=>1,'㈝'=>1,'㈞'=>1,'㈠'=>1,'㈡'=>1,'㈢'=>1,'㈣'=>1,'㈤'=>1,'㈥'=>1,'㈦'=>1,'㈧'=>1,'㈨'=>1,'㈩'=>1,'㈪'=>1,'㈫'=>1,'㈬'=>1,'㈭'=>1,'㈮'=>1,'㈯'=>1,'㈰'=>1,'㈱'=>1,'㈲'=>1,'㈳'=>1,'㈴'=>1,'㈵'=>1,'㈶'=>1,'㈷'=>1,'㈸'=>1,'㈹'=>1,'㈺'=>1,'㈻'=>1,'㈼'=>1,'㈽'=>1,'㈾'=>1,'㈿'=>1,'㉀'=>1,'㉁'=>1,'㉂'=>1,'㉃'=>1,'㉐'=>1,'㉑'=>1,'㉒'=>1,'㉓'=>1,'㉔'=>1,'㉕'=>1,'㉖'=>1,'㉗'=>1,'㉘'=>1,'㉙'=>1,'㉚'=>1,'㉛'=>1,'㉜'=>1,'㉝'=>1,'㉞'=>1,'㉟'=>1,'㉠'=>1,'㉡'=>1,'㉢'=>1,'㉣'=>1,'㉤'=>1,'㉥'=>1,'㉦'=>1,'㉧'=>1,'㉨'=>1,'㉩'=>1,'㉪'=>1,'㉫'=>1,'㉬'=>1,'㉭'=>1,'㉮'=>1,'㉯'=>1,'㉰'=>1,'㉱'=>1,'㉲'=>1,'㉳'=>1,'㉴'=>1,'㉵'=>1,'㉶'=>1,'㉷'=>1,'㉸'=>1,'㉹'=>1,'㉺'=>1,'㉻'=>1,'㉼'=>1,'㉽'=>1,'㉾'=>1,'㊀'=>1,'㊁'=>1,'㊂'=>1,'㊃'=>1,'㊄'=>1,'㊅'=>1,'㊆'=>1,'㊇'=>1,'㊈'=>1,'㊉'=>1,'㊊'=>1,'㊋'=>1,'㊌'=>1,'㊍'=>1,'㊎'=>1,'㊏'=>1,'㊐'=>1,'㊑'=>1,'㊒'=>1,'㊓'=>1,'㊔'=>1,'㊕'=>1,'㊖'=>1,'㊗'=>1,'㊘'=>1,'㊙'=>1,'㊚'=>1,'㊛'=>1,'㊜'=>1,'㊝'=>1,'㊞'=>1,'㊟'=>1,'㊠'=>1,'㊡'=>1,'㊢'=>1,'㊣'=>1,'㊤'=>1,'㊥'=>1,'㊦'=>1,'㊧'=>1,'㊨'=>1,'㊩'=>1,'㊪'=>1,'㊫'=>1,'㊬'=>1,'㊭'=>1,'㊮'=>1,'㊯'=>1,'㊰'=>1,'㊱'=>1,'㊲'=>1,'㊳'=>1,'㊴'=>1,'㊵'=>1,'㊶'=>1,'㊷'=>1,'㊸'=>1,'㊹'=>1,'㊺'=>1,'㊻'=>1,'㊼'=>1,'㊽'=>1,'㊾'=>1,'㊿'=>1,'㋀'=>1,'㋁'=>1,'㋂'=>1,'㋃'=>1,'㋄'=>1,'㋅'=>1,'㋆'=>1,'㋇'=>1,'㋈'=>1,'㋉'=>1,'㋊'=>1,'㋋'=>1,'㋌'=>1,'㋍'=>1,'㋎'=>1,'㋏'=>1,'㋐'=>1,'㋑'=>1,'㋒'=>1,'㋓'=>1,'㋔'=>1,'㋕'=>1,'㋖'=>1,'㋗'=>1,'㋘'=>1,'㋙'=>1,'㋚'=>1,'㋛'=>1,'㋜'=>1,'㋝'=>1,'㋞'=>1,'㋟'=>1,'㋠'=>1,'㋡'=>1,'㋢'=>1,'㋣'=>1,'㋤'=>1,'㋥'=>1,'㋦'=>1,'㋧'=>1,'㋨'=>1,'㋩'=>1,'㋪'=>1,'㋫'=>1,'㋬'=>1,'㋭'=>1,'㋮'=>1,'㋯'=>1,'㋰'=>1,'㋱'=>1,'㋲'=>1,'㋳'=>1,'㋴'=>1,'㋵'=>1,'㋶'=>1,'㋷'=>1,'㋸'=>1,'㋹'=>1,'㋺'=>1,'㋻'=>1,'㋼'=>1,'㋽'=>1,'㋾'=>1,'㌀'=>1,'㌁'=>1,'㌂'=>1,'㌃'=>1,'㌄'=>1,'㌅'=>1,'㌆'=>1,'㌇'=>1,'㌈'=>1,'㌉'=>1,'㌊'=>1,'㌋'=>1,'㌌'=>1,'㌍'=>1,'㌎'=>1,'㌏'=>1,'㌐'=>1,'㌑'=>1,'㌒'=>1,'㌓'=>1,'㌔'=>1,'㌕'=>1,'㌖'=>1,'㌗'=>1,'㌘'=>1,'㌙'=>1,'㌚'=>1,'㌛'=>1,'㌜'=>1,'㌝'=>1,'㌞'=>1,'㌟'=>1,'㌠'=>1,'㌡'=>1,'㌢'=>1,'㌣'=>1,'㌤'=>1,'㌥'=>1,'㌦'=>1,'㌧'=>1,'㌨'=>1,'㌩'=>1,'㌪'=>1,'㌫'=>1,'㌬'=>1,'㌭'=>1,'㌮'=>1,'㌯'=>1,'㌰'=>1,'㌱'=>1,'㌲'=>1,'㌳'=>1,'㌴'=>1,'㌵'=>1,'㌶'=>1,'㌷'=>1,'㌸'=>1,'㌹'=>1,'㌺'=>1,'㌻'=>1,'㌼'=>1,'㌽'=>1,'㌾'=>1,'㌿'=>1,'㍀'=>1,'㍁'=>1,'㍂'=>1,'㍃'=>1,'㍄'=>1,'㍅'=>1,'㍆'=>1,'㍇'=>1,'㍈'=>1,'㍉'=>1,'㍊'=>1,'㍋'=>1,'㍌'=>1,'㍍'=>1,'㍎'=>1,'㍏'=>1,'㍐'=>1,'㍑'=>1,'㍒'=>1,'㍓'=>1,'㍔'=>1,'㍕'=>1,'㍖'=>1,'㍗'=>1,'㍘'=>1,'㍙'=>1,'㍚'=>1,'㍛'=>1,'㍜'=>1,'㍝'=>1,'㍞'=>1,'㍟'=>1,'㍠'=>1,'㍡'=>1,'㍢'=>1,'㍣'=>1,'㍤'=>1,'㍥'=>1,'㍦'=>1,'㍧'=>1,'㍨'=>1,'㍩'=>1,'㍪'=>1,'㍫'=>1,'㍬'=>1,'㍭'=>1,'㍮'=>1,'㍯'=>1,'㍰'=>1,'㍱'=>1,'㍲'=>1,'㍳'=>1,'㍴'=>1,'㍵'=>1,'㍶'=>1,'㍷'=>1,'㍸'=>1,'㍹'=>1,'㍺'=>1,'㍻'=>1,'㍼'=>1,'㍽'=>1,'㍾'=>1,'㍿'=>1,'㎀'=>1,'㎁'=>1,'㎂'=>1,'㎃'=>1,'㎄'=>1,'㎅'=>1,'㎆'=>1,'㎇'=>1,'㎈'=>1,'㎉'=>1,'㎊'=>1,'㎋'=>1,'㎌'=>1,'㎍'=>1,'㎎'=>1,'㎏'=>1,'㎐'=>1,'㎑'=>1,'㎒'=>1,'㎓'=>1,'㎔'=>1,'㎕'=>1,'㎖'=>1,'㎗'=>1,'㎘'=>1,'㎙'=>1,'㎚'=>1,'㎛'=>1,'㎜'=>1,'㎝'=>1,'㎞'=>1,'㎟'=>1,'㎠'=>1,'㎡'=>1,'㎢'=>1,'㎣'=>1,'㎤'=>1,'㎥'=>1,'㎦'=>1,'㎧'=>1,'㎨'=>1,'㎩'=>1,'㎪'=>1,'㎫'=>1,'㎬'=>1,'㎭'=>1,'㎮'=>1,'㎯'=>1,'㎰'=>1,'㎱'=>1,'㎲'=>1,'㎳'=>1,'㎴'=>1,'㎵'=>1,'㎶'=>1,'㎷'=>1,'㎸'=>1,'㎹'=>1,'㎺'=>1,'㎻'=>1,'㎼'=>1,'㎽'=>1,'㎾'=>1,'㎿'=>1,'㏀'=>1,'㏁'=>1,'㏂'=>1,'㏃'=>1,'㏄'=>1,'㏅'=>1,'㏆'=>1,'㏇'=>1,'㏈'=>1,'㏉'=>1,'㏊'=>1,'㏋'=>1,'㏌'=>1,'㏍'=>1,'㏎'=>1,'㏏'=>1,'㏐'=>1,'㏑'=>1,'㏒'=>1,'㏓'=>1,'㏔'=>1,'㏕'=>1,'㏖'=>1,'㏗'=>1,'㏘'=>1,'㏙'=>1,'㏚'=>1,'㏛'=>1,'㏜'=>1,'㏝'=>1,'㏞'=>1,'㏟'=>1,'㏠'=>1,'㏡'=>1,'㏢'=>1,'㏣'=>1,'㏤'=>1,'㏥'=>1,'㏦'=>1,'㏧'=>1,'㏨'=>1,'㏩'=>1,'㏪'=>1,'㏫'=>1,'㏬'=>1,'㏭'=>1,'㏮'=>1,'㏯'=>1,'㏰'=>1,'㏱'=>1,'㏲'=>1,'㏳'=>1,'㏴'=>1,'㏵'=>1,'㏶'=>1,'㏷'=>1,'㏸'=>1,'㏹'=>1,'㏺'=>1,'㏻'=>1,'㏼'=>1,'㏽'=>1,'㏾'=>1,'㏿'=>1,'豈'=>1,'更'=>1,'車'=>1,'賈'=>1,'滑'=>1,'串'=>1,'句'=>1,'龜'=>1,'龜'=>1,'契'=>1,'金'=>1,'喇'=>1,'奈'=>1,'懶'=>1,'癩'=>1,'羅'=>1,'蘿'=>1,'螺'=>1,'裸'=>1,'邏'=>1,'樂'=>1,'洛'=>1,'烙'=>1,'珞'=>1,'落'=>1,'酪'=>1,'駱'=>1,'亂'=>1,'卵'=>1,'欄'=>1,'爛'=>1,'蘭'=>1,'鸞'=>1,'嵐'=>1,'濫'=>1,'藍'=>1,'襤'=>1,'拉'=>1,'臘'=>1,'蠟'=>1,'廊'=>1,'朗'=>1,'浪'=>1,'狼'=>1,'郎'=>1,'來'=>1,'冷'=>1,'勞'=>1,'擄'=>1,'櫓'=>1,'爐'=>1,'盧'=>1,'老'=>1,'蘆'=>1,'虜'=>1,'路'=>1,'露'=>1,'魯'=>1,'鷺'=>1,'碌'=>1,'祿'=>1,'綠'=>1,'菉'=>1,'錄'=>1,'鹿'=>1,'論'=>1,'壟'=>1,'弄'=>1,'籠'=>1,'聾'=>1,'牢'=>1,'磊'=>1,'賂'=>1,'雷'=>1,'壘'=>1,'屢'=>1,'樓'=>1,'淚'=>1,'漏'=>1,'累'=>1,'縷'=>1,'陋'=>1,'勒'=>1,'肋'=>1,'凜'=>1,'凌'=>1,'稜'=>1,'綾'=>1,'菱'=>1,'陵'=>1,'讀'=>1,'拏'=>1,'樂'=>1,'諾'=>1,'丹'=>1,'寧'=>1,'怒'=>1,'率'=>1,'異'=>1,'北'=>1,'磻'=>1,'便'=>1,'復'=>1,'不'=>1,'泌'=>1,'數'=>1,'索'=>1,'參'=>1,'塞'=>1,'省'=>1,'葉'=>1,'說'=>1,'殺'=>1,'辰'=>1,'沈'=>1,'拾'=>1,'若'=>1,'掠'=>1,'略'=>1,'亮'=>1,'兩'=>1,'凉'=>1,'梁'=>1,'糧'=>1,'良'=>1,'諒'=>1,'量'=>1,'勵'=>1,'呂'=>1,'女'=>1,'廬'=>1,'旅'=>1,'濾'=>1,'礪'=>1,'閭'=>1,'驪'=>1,'麗'=>1,'黎'=>1,'力'=>1,'曆'=>1,'歷'=>1,'轢'=>1,'年'=>1,'憐'=>1,'戀'=>1,'撚'=>1,'漣'=>1,'煉'=>1,'璉'=>1,'秊'=>1,'練'=>1,'聯'=>1,'輦'=>1,'蓮'=>1,'連'=>1,'鍊'=>1,'列'=>1,'劣'=>1,'咽'=>1,'烈'=>1,'裂'=>1,'說'=>1,'廉'=>1,'念'=>1,'捻'=>1,'殮'=>1,'簾'=>1,'獵'=>1,'令'=>1,'囹'=>1,'寧'=>1,'嶺'=>1,'怜'=>1,'玲'=>1,'瑩'=>1,'羚'=>1,'聆'=>1,'鈴'=>1,'零'=>1,'靈'=>1,'領'=>1,'例'=>1,'禮'=>1,'醴'=>1,'隸'=>1,'惡'=>1,'了'=>1,'僚'=>1,'寮'=>1,'尿'=>1,'料'=>1,'樂'=>1,'燎'=>1,'療'=>1,'蓼'=>1,'遼'=>1,'龍'=>1,'暈'=>1,'阮'=>1,'劉'=>1,'杻'=>1,'柳'=>1,'流'=>1,'溜'=>1,'琉'=>1,'留'=>1,'硫'=>1,'紐'=>1,'類'=>1,'六'=>1,'戮'=>1,'陸'=>1,'倫'=>1,'崙'=>1,'淪'=>1,'輪'=>1,'律'=>1,'慄'=>1,'栗'=>1,'率'=>1,'隆'=>1,'利'=>1,'吏'=>1,'履'=>1,'易'=>1,'李'=>1,'梨'=>1,'泥'=>1,'理'=>1,'痢'=>1,'罹'=>1,'裏'=>1,'裡'=>1,'里'=>1,'離'=>1,'匿'=>1,'溺'=>1,'吝'=>1,'燐'=>1,'璘'=>1,'藺'=>1,'隣'=>1,'鱗'=>1,'麟'=>1,'林'=>1,'淋'=>1,'臨'=>1,'立'=>1,'笠'=>1,'粒'=>1,'狀'=>1,'炙'=>1,'識'=>1,'什'=>1,'茶'=>1,'刺'=>1,'切'=>1,'度'=>1,'拓'=>1,'糖'=>1,'宅'=>1,'洞'=>1,'暴'=>1,'輻'=>1,'行'=>1,'降'=>1,'見'=>1,'廓'=>1,'兀'=>1,'嗀'=>1,'塚'=>1,'晴'=>1,'凞'=>1,'猪'=>1,'益'=>1,'礼'=>1,'神'=>1,'祥'=>1,'福'=>1,'靖'=>1,'精'=>1,'羽'=>1,'蘒'=>1,'諸'=>1,'逸'=>1,'都'=>1,'飯'=>1,'飼'=>1,'館'=>1,'鶴'=>1,'侮'=>1,'僧'=>1,'免'=>1,'勉'=>1,'勤'=>1,'卑'=>1,'喝'=>1,'嘆'=>1,'器'=>1,'塀'=>1,'墨'=>1,'層'=>1,'屮'=>1,'悔'=>1,'慨'=>1,'憎'=>1,'懲'=>1,'敏'=>1,'既'=>1,'暑'=>1,'梅'=>1,'海'=>1,'渚'=>1,'漢'=>1,'煮'=>1,'爫'=>1,'琢'=>1,'碑'=>1,'社'=>1,'祉'=>1,'祈'=>1,'祐'=>1,'祖'=>1,'祝'=>1,'禍'=>1,'禎'=>1,'穀'=>1,'突'=>1,'節'=>1,'練'=>1,'縉'=>1,'繁'=>1,'署'=>1,'者'=>1,'臭'=>1,'艹'=>1,'艹'=>1,'著'=>1,'褐'=>1,'視'=>1,'謁'=>1,'謹'=>1,'賓'=>1,'贈'=>1,'辶'=>1,'逸'=>1,'難'=>1,'響'=>1,'頻'=>1,'並'=>1,'况'=>1,'全'=>1,'侀'=>1,'充'=>1,'冀'=>1,'勇'=>1,'勺'=>1,'喝'=>1,'啕'=>1,'喙'=>1,'嗢'=>1,'塚'=>1,'墳'=>1,'奄'=>1,'奔'=>1,'婢'=>1,'嬨'=>1,'廒'=>1,'廙'=>1,'彩'=>1,'徭'=>1,'惘'=>1,'慎'=>1,'愈'=>1,'憎'=>1,'慠'=>1,'懲'=>1,'戴'=>1,'揄'=>1,'搜'=>1,'摒'=>1,'敖'=>1,'晴'=>1,'朗'=>1,'望'=>1,'杖'=>1,'歹'=>1,'殺'=>1,'流'=>1,'滛'=>1,'滋'=>1,'漢'=>1,'瀞'=>1,'煮'=>1,'瞧'=>1,'爵'=>1,'犯'=>1,'猪'=>1,'瑱'=>1,'甆'=>1,'画'=>1,'瘝'=>1,'瘟'=>1,'益'=>1,'盛'=>1,'直'=>1,'睊'=>1,'着'=>1,'磌'=>1,'窱'=>1,'節'=>1,'类'=>1,'絛'=>1,'練'=>1,'缾'=>1,'者'=>1,'荒'=>1,'華'=>1,'蝹'=>1,'襁'=>1,'覆'=>1,'視'=>1,'調'=>1,'諸'=>1,'請'=>1,'謁'=>1,'諾'=>1,'諭'=>1,'謹'=>1,'變'=>1,'贈'=>1,'輸'=>1,'遲'=>1,'醙'=>1,'鉶'=>1,'陼'=>1,'難'=>1,'靖'=>1,'韛'=>1,'響'=>1,'頋'=>1,'頻'=>1,'鬒'=>1,'龜'=>1,'𢡊'=>1,'𢡄'=>1,'𣏕'=>1,'㮝'=>1,'䀘'=>1,'䀹'=>1,'𥉉'=>1,'𥳐'=>1,'𧻓'=>1,'齃'=>1,'龎'=>1,'ff'=>1,'fi'=>1,'fl'=>1,'ffi'=>1,'ffl'=>1,'ſt'=>1,'st'=>1,'ﬓ'=>1,'ﬔ'=>1,'ﬕ'=>1,'ﬖ'=>1,'ﬗ'=>1,'יִ'=>1,'ײַ'=>1,'ﬠ'=>1,'ﬡ'=>1,'ﬢ'=>1,'ﬣ'=>1,'ﬤ'=>1,'ﬥ'=>1,'ﬦ'=>1,'ﬧ'=>1,'ﬨ'=>1,'﬩'=>1,'שׁ'=>1,'שׂ'=>1,'שּׁ'=>1,'שּׂ'=>1,'אַ'=>1,'אָ'=>1,'אּ'=>1,'בּ'=>1,'גּ'=>1,'דּ'=>1,'הּ'=>1,'וּ'=>1,'זּ'=>1,'טּ'=>1,'יּ'=>1,'ךּ'=>1,'כּ'=>1,'לּ'=>1,'מּ'=>1,'נּ'=>1,'סּ'=>1,'ףּ'=>1,'פּ'=>1,'צּ'=>1,'קּ'=>1,'רּ'=>1,'שּ'=>1,'תּ'=>1,'וֹ'=>1,'בֿ'=>1,'כֿ'=>1,'פֿ'=>1,'ﭏ'=>1,'ﭐ'=>1,'ﭑ'=>1,'ﭒ'=>1,'ﭓ'=>1,'ﭔ'=>1,'ﭕ'=>1,'ﭖ'=>1,'ﭗ'=>1,'ﭘ'=>1,'ﭙ'=>1,'ﭚ'=>1,'ﭛ'=>1,'ﭜ'=>1,'ﭝ'=>1,'ﭞ'=>1,'ﭟ'=>1,'ﭠ'=>1,'ﭡ'=>1,'ﭢ'=>1,'ﭣ'=>1,'ﭤ'=>1,'ﭥ'=>1,'ﭦ'=>1,'ﭧ'=>1,'ﭨ'=>1,'ﭩ'=>1,'ﭪ'=>1,'ﭫ'=>1,'ﭬ'=>1,'ﭭ'=>1,'ﭮ'=>1,'ﭯ'=>1,'ﭰ'=>1,'ﭱ'=>1,'ﭲ'=>1,'ﭳ'=>1,'ﭴ'=>1,'ﭵ'=>1,'ﭶ'=>1,'ﭷ'=>1,'ﭸ'=>1,'ﭹ'=>1,'ﭺ'=>1,'ﭻ'=>1,'ﭼ'=>1,'ﭽ'=>1,'ﭾ'=>1,'ﭿ'=>1,'ﮀ'=>1,'ﮁ'=>1,'ﮂ'=>1,'ﮃ'=>1,'ﮄ'=>1,'ﮅ'=>1,'ﮆ'=>1,'ﮇ'=>1,'ﮈ'=>1,'ﮉ'=>1,'ﮊ'=>1,'ﮋ'=>1,'ﮌ'=>1,'ﮍ'=>1,'ﮎ'=>1,'ﮏ'=>1,'ﮐ'=>1,'ﮑ'=>1,'ﮒ'=>1,'ﮓ'=>1,'ﮔ'=>1,'ﮕ'=>1,'ﮖ'=>1,'ﮗ'=>1,'ﮘ'=>1,'ﮙ'=>1,'ﮚ'=>1,'ﮛ'=>1,'ﮜ'=>1,'ﮝ'=>1,'ﮞ'=>1,'ﮟ'=>1,'ﮠ'=>1,'ﮡ'=>1,'ﮢ'=>1,'ﮣ'=>1,'ﮤ'=>1,'ﮥ'=>1,'ﮦ'=>1,'ﮧ'=>1,'ﮨ'=>1,'ﮩ'=>1,'ﮪ'=>1,'ﮫ'=>1,'ﮬ'=>1,'ﮭ'=>1,'ﮮ'=>1,'ﮯ'=>1,'ﮰ'=>1,'ﮱ'=>1,'ﯓ'=>1,'ﯔ'=>1,'ﯕ'=>1,'ﯖ'=>1,'ﯗ'=>1,'ﯘ'=>1,'ﯙ'=>1,'ﯚ'=>1,'ﯛ'=>1,'ﯜ'=>1,'ﯝ'=>1,'ﯞ'=>1,'ﯟ'=>1,'ﯠ'=>1,'ﯡ'=>1,'ﯢ'=>1,'ﯣ'=>1,'ﯤ'=>1,'ﯥ'=>1,'ﯦ'=>1,'ﯧ'=>1,'ﯨ'=>1,'ﯩ'=>1,'ﯪ'=>1,'ﯫ'=>1,'ﯬ'=>1,'ﯭ'=>1,'ﯮ'=>1,'ﯯ'=>1,'ﯰ'=>1,'ﯱ'=>1,'ﯲ'=>1,'ﯳ'=>1,'ﯴ'=>1,'ﯵ'=>1,'ﯶ'=>1,'ﯷ'=>1,'ﯸ'=>1,'ﯹ'=>1,'ﯺ'=>1,'ﯻ'=>1,'ﯼ'=>1,'ﯽ'=>1,'ﯾ'=>1,'ﯿ'=>1,'ﰀ'=>1,'ﰁ'=>1,'ﰂ'=>1,'ﰃ'=>1,'ﰄ'=>1,'ﰅ'=>1,'ﰆ'=>1,'ﰇ'=>1,'ﰈ'=>1,'ﰉ'=>1,'ﰊ'=>1,'ﰋ'=>1,'ﰌ'=>1,'ﰍ'=>1,'ﰎ'=>1,'ﰏ'=>1,'ﰐ'=>1,'ﰑ'=>1,'ﰒ'=>1,'ﰓ'=>1,'ﰔ'=>1,'ﰕ'=>1,'ﰖ'=>1,'ﰗ'=>1,'ﰘ'=>1,'ﰙ'=>1,'ﰚ'=>1,'ﰛ'=>1,'ﰜ'=>1,'ﰝ'=>1,'ﰞ'=>1,'ﰟ'=>1,'ﰠ'=>1,'ﰡ'=>1,'ﰢ'=>1,'ﰣ'=>1,'ﰤ'=>1,'ﰥ'=>1,'ﰦ'=>1,'ﰧ'=>1,'ﰨ'=>1,'ﰩ'=>1,'ﰪ'=>1,'ﰫ'=>1,'ﰬ'=>1,'ﰭ'=>1,'ﰮ'=>1,'ﰯ'=>1,'ﰰ'=>1,'ﰱ'=>1,'ﰲ'=>1,'ﰳ'=>1,'ﰴ'=>1,'ﰵ'=>1,'ﰶ'=>1,'ﰷ'=>1,'ﰸ'=>1,'ﰹ'=>1,'ﰺ'=>1,'ﰻ'=>1,'ﰼ'=>1,'ﰽ'=>1,'ﰾ'=>1,'ﰿ'=>1,'ﱀ'=>1,'ﱁ'=>1,'ﱂ'=>1,'ﱃ'=>1,'ﱄ'=>1,'ﱅ'=>1,'ﱆ'=>1,'ﱇ'=>1,'ﱈ'=>1,'ﱉ'=>1,'ﱊ'=>1,'ﱋ'=>1,'ﱌ'=>1,'ﱍ'=>1,'ﱎ'=>1,'ﱏ'=>1,'ﱐ'=>1,'ﱑ'=>1,'ﱒ'=>1,'ﱓ'=>1,'ﱔ'=>1,'ﱕ'=>1,'ﱖ'=>1,'ﱗ'=>1,'ﱘ'=>1,'ﱙ'=>1,'ﱚ'=>1,'ﱛ'=>1,'ﱜ'=>1,'ﱝ'=>1,'ﱞ'=>1,'ﱟ'=>1,'ﱠ'=>1,'ﱡ'=>1,'ﱢ'=>1,'ﱣ'=>1,'ﱤ'=>1,'ﱥ'=>1,'ﱦ'=>1,'ﱧ'=>1,'ﱨ'=>1,'ﱩ'=>1,'ﱪ'=>1,'ﱫ'=>1,'ﱬ'=>1,'ﱭ'=>1,'ﱮ'=>1,'ﱯ'=>1,'ﱰ'=>1,'ﱱ'=>1,'ﱲ'=>1,'ﱳ'=>1,'ﱴ'=>1,'ﱵ'=>1,'ﱶ'=>1,'ﱷ'=>1,'ﱸ'=>1,'ﱹ'=>1,'ﱺ'=>1,'ﱻ'=>1,'ﱼ'=>1,'ﱽ'=>1,'ﱾ'=>1,'ﱿ'=>1,'ﲀ'=>1,'ﲁ'=>1,'ﲂ'=>1,'ﲃ'=>1,'ﲄ'=>1,'ﲅ'=>1,'ﲆ'=>1,'ﲇ'=>1,'ﲈ'=>1,'ﲉ'=>1,'ﲊ'=>1,'ﲋ'=>1,'ﲌ'=>1,'ﲍ'=>1,'ﲎ'=>1,'ﲏ'=>1,'ﲐ'=>1,'ﲑ'=>1,'ﲒ'=>1,'ﲓ'=>1,'ﲔ'=>1,'ﲕ'=>1,'ﲖ'=>1,'ﲗ'=>1,'ﲘ'=>1,'ﲙ'=>1,'ﲚ'=>1,'ﲛ'=>1,'ﲜ'=>1,'ﲝ'=>1,'ﲞ'=>1,'ﲟ'=>1,'ﲠ'=>1,'ﲡ'=>1,'ﲢ'=>1,'ﲣ'=>1,'ﲤ'=>1,'ﲥ'=>1,'ﲦ'=>1,'ﲧ'=>1,'ﲨ'=>1,'ﲩ'=>1,'ﲪ'=>1,'ﲫ'=>1,'ﲬ'=>1,'ﲭ'=>1,'ﲮ'=>1,'ﲯ'=>1,'ﲰ'=>1,'ﲱ'=>1,'ﲲ'=>1,'ﲳ'=>1,'ﲴ'=>1,'ﲵ'=>1,'ﲶ'=>1,'ﲷ'=>1,'ﲸ'=>1,'ﲹ'=>1,'ﲺ'=>1,'ﲻ'=>1,'ﲼ'=>1,'ﲽ'=>1,'ﲾ'=>1,'ﲿ'=>1,'ﳀ'=>1,'ﳁ'=>1,'ﳂ'=>1,'ﳃ'=>1,'ﳄ'=>1,'ﳅ'=>1,'ﳆ'=>1,'ﳇ'=>1,'ﳈ'=>1,'ﳉ'=>1,'ﳊ'=>1,'ﳋ'=>1,'ﳌ'=>1,'ﳍ'=>1,'ﳎ'=>1,'ﳏ'=>1,'ﳐ'=>1,'ﳑ'=>1,'ﳒ'=>1,'ﳓ'=>1,'ﳔ'=>1,'ﳕ'=>1,'ﳖ'=>1,'ﳗ'=>1,'ﳘ'=>1,'ﳙ'=>1,'ﳚ'=>1,'ﳛ'=>1,'ﳜ'=>1,'ﳝ'=>1,'ﳞ'=>1,'ﳟ'=>1,'ﳠ'=>1,'ﳡ'=>1,'ﳢ'=>1,'ﳣ'=>1,'ﳤ'=>1,'ﳥ'=>1,'ﳦ'=>1,'ﳧ'=>1,'ﳨ'=>1,'ﳩ'=>1,'ﳪ'=>1,'ﳫ'=>1,'ﳬ'=>1,'ﳭ'=>1,'ﳮ'=>1,'ﳯ'=>1,'ﳰ'=>1,'ﳱ'=>1,'ﳲ'=>1,'ﳳ'=>1,'ﳴ'=>1,'ﳵ'=>1,'ﳶ'=>1,'ﳷ'=>1,'ﳸ'=>1,'ﳹ'=>1,'ﳺ'=>1,'ﳻ'=>1,'ﳼ'=>1,'ﳽ'=>1,'ﳾ'=>1,'ﳿ'=>1,'ﴀ'=>1,'ﴁ'=>1,'ﴂ'=>1,'ﴃ'=>1,'ﴄ'=>1,'ﴅ'=>1,'ﴆ'=>1,'ﴇ'=>1,'ﴈ'=>1,'ﴉ'=>1,'ﴊ'=>1,'ﴋ'=>1,'ﴌ'=>1,'ﴍ'=>1,'ﴎ'=>1,'ﴏ'=>1,'ﴐ'=>1,'ﴑ'=>1,'ﴒ'=>1,'ﴓ'=>1,'ﴔ'=>1,'ﴕ'=>1,'ﴖ'=>1,'ﴗ'=>1,'ﴘ'=>1,'ﴙ'=>1,'ﴚ'=>1,'ﴛ'=>1,'ﴜ'=>1,'ﴝ'=>1,'ﴞ'=>1,'ﴟ'=>1,'ﴠ'=>1,'ﴡ'=>1,'ﴢ'=>1,'ﴣ'=>1,'ﴤ'=>1,'ﴥ'=>1,'ﴦ'=>1,'ﴧ'=>1,'ﴨ'=>1,'ﴩ'=>1,'ﴪ'=>1,'ﴫ'=>1,'ﴬ'=>1,'ﴭ'=>1,'ﴮ'=>1,'ﴯ'=>1,'ﴰ'=>1,'ﴱ'=>1,'ﴲ'=>1,'ﴳ'=>1,'ﴴ'=>1,'ﴵ'=>1,'ﴶ'=>1,'ﴷ'=>1,'ﴸ'=>1,'ﴹ'=>1,'ﴺ'=>1,'ﴻ'=>1,'ﴼ'=>1,'ﴽ'=>1,'ﵐ'=>1,'ﵑ'=>1,'ﵒ'=>1,'ﵓ'=>1,'ﵔ'=>1,'ﵕ'=>1,'ﵖ'=>1,'ﵗ'=>1,'ﵘ'=>1,'ﵙ'=>1,'ﵚ'=>1,'ﵛ'=>1,'ﵜ'=>1,'ﵝ'=>1,'ﵞ'=>1,'ﵟ'=>1,'ﵠ'=>1,'ﵡ'=>1,'ﵢ'=>1,'ﵣ'=>1,'ﵤ'=>1,'ﵥ'=>1,'ﵦ'=>1,'ﵧ'=>1,'ﵨ'=>1,'ﵩ'=>1,'ﵪ'=>1,'ﵫ'=>1,'ﵬ'=>1,'ﵭ'=>1,'ﵮ'=>1,'ﵯ'=>1,'ﵰ'=>1,'ﵱ'=>1,'ﵲ'=>1,'ﵳ'=>1,'ﵴ'=>1,'ﵵ'=>1,'ﵶ'=>1,'ﵷ'=>1,'ﵸ'=>1,'ﵹ'=>1,'ﵺ'=>1,'ﵻ'=>1,'ﵼ'=>1,'ﵽ'=>1,'ﵾ'=>1,'ﵿ'=>1,'ﶀ'=>1,'ﶁ'=>1,'ﶂ'=>1,'ﶃ'=>1,'ﶄ'=>1,'ﶅ'=>1,'ﶆ'=>1,'ﶇ'=>1,'ﶈ'=>1,'ﶉ'=>1,'ﶊ'=>1,'ﶋ'=>1,'ﶌ'=>1,'ﶍ'=>1,'ﶎ'=>1,'ﶏ'=>1,'ﶒ'=>1,'ﶓ'=>1,'ﶔ'=>1,'ﶕ'=>1,'ﶖ'=>1,'ﶗ'=>1,'ﶘ'=>1,'ﶙ'=>1,'ﶚ'=>1,'ﶛ'=>1,'ﶜ'=>1,'ﶝ'=>1,'ﶞ'=>1,'ﶟ'=>1,'ﶠ'=>1,'ﶡ'=>1,'ﶢ'=>1,'ﶣ'=>1,'ﶤ'=>1,'ﶥ'=>1,'ﶦ'=>1,'ﶧ'=>1,'ﶨ'=>1,'ﶩ'=>1,'ﶪ'=>1,'ﶫ'=>1,'ﶬ'=>1,'ﶭ'=>1,'ﶮ'=>1,'ﶯ'=>1,'ﶰ'=>1,'ﶱ'=>1,'ﶲ'=>1,'ﶳ'=>1,'ﶴ'=>1,'ﶵ'=>1,'ﶶ'=>1,'ﶷ'=>1,'ﶸ'=>1,'ﶹ'=>1,'ﶺ'=>1,'ﶻ'=>1,'ﶼ'=>1,'ﶽ'=>1,'ﶾ'=>1,'ﶿ'=>1,'ﷀ'=>1,'ﷁ'=>1,'ﷂ'=>1,'ﷃ'=>1,'ﷄ'=>1,'ﷅ'=>1,'ﷆ'=>1,'ﷇ'=>1,'ﷰ'=>1,'ﷱ'=>1,'ﷲ'=>1,'ﷳ'=>1,'ﷴ'=>1,'ﷵ'=>1,'ﷶ'=>1,'ﷷ'=>1,'ﷸ'=>1,'ﷹ'=>1,'ﷺ'=>1,'ﷻ'=>1,'﷼'=>1,'︐'=>1,'︑'=>1,'︒'=>1,'︓'=>1,'︔'=>1,'︕'=>1,'︖'=>1,'︗'=>1,'︘'=>1,'︙'=>1,'︰'=>1,'︱'=>1,'︲'=>1,'︳'=>1,'︴'=>1,'︵'=>1,'︶'=>1,'︷'=>1,'︸'=>1,'︹'=>1,'︺'=>1,'︻'=>1,'︼'=>1,'︽'=>1,'︾'=>1,'︿'=>1,'﹀'=>1,'﹁'=>1,'﹂'=>1,'﹃'=>1,'﹄'=>1,'﹇'=>1,'﹈'=>1,'﹉'=>1,'﹊'=>1,'﹋'=>1,'﹌'=>1,'﹍'=>1,'﹎'=>1,'﹏'=>1,'﹐'=>1,'﹑'=>1,'﹒'=>1,'﹔'=>1,'﹕'=>1,'﹖'=>1,'﹗'=>1,'﹘'=>1,'﹙'=>1,'﹚'=>1,'﹛'=>1,'﹜'=>1,'﹝'=>1,'﹞'=>1,'﹟'=>1,'﹠'=>1,'﹡'=>1,'﹢'=>1,'﹣'=>1,'﹤'=>1,'﹥'=>1,'﹦'=>1,'﹨'=>1,'﹩'=>1,'﹪'=>1,'﹫'=>1,'ﹰ'=>1,'ﹱ'=>1,'ﹲ'=>1,'ﹴ'=>1,'ﹶ'=>1,'ﹷ'=>1,'ﹸ'=>1,'ﹹ'=>1,'ﹺ'=>1,'ﹻ'=>1,'ﹼ'=>1,'ﹽ'=>1,'ﹾ'=>1,'ﹿ'=>1,'ﺀ'=>1,'ﺁ'=>1,'ﺂ'=>1,'ﺃ'=>1,'ﺄ'=>1,'ﺅ'=>1,'ﺆ'=>1,'ﺇ'=>1,'ﺈ'=>1,'ﺉ'=>1,'ﺊ'=>1,'ﺋ'=>1,'ﺌ'=>1,'ﺍ'=>1,'ﺎ'=>1,'ﺏ'=>1,'ﺐ'=>1,'ﺑ'=>1,'ﺒ'=>1,'ﺓ'=>1,'ﺔ'=>1,'ﺕ'=>1,'ﺖ'=>1,'ﺗ'=>1,'ﺘ'=>1,'ﺙ'=>1,'ﺚ'=>1,'ﺛ'=>1,'ﺜ'=>1,'ﺝ'=>1,'ﺞ'=>1,'ﺟ'=>1,'ﺠ'=>1,'ﺡ'=>1,'ﺢ'=>1,'ﺣ'=>1,'ﺤ'=>1,'ﺥ'=>1,'ﺦ'=>1,'ﺧ'=>1,'ﺨ'=>1,'ﺩ'=>1,'ﺪ'=>1,'ﺫ'=>1,'ﺬ'=>1,'ﺭ'=>1,'ﺮ'=>1,'ﺯ'=>1,'ﺰ'=>1,'ﺱ'=>1,'ﺲ'=>1,'ﺳ'=>1,'ﺴ'=>1,'ﺵ'=>1,'ﺶ'=>1,'ﺷ'=>1,'ﺸ'=>1,'ﺹ'=>1,'ﺺ'=>1,'ﺻ'=>1,'ﺼ'=>1,'ﺽ'=>1,'ﺾ'=>1,'ﺿ'=>1,'ﻀ'=>1,'ﻁ'=>1,'ﻂ'=>1,'ﻃ'=>1,'ﻄ'=>1,'ﻅ'=>1,'ﻆ'=>1,'ﻇ'=>1,'ﻈ'=>1,'ﻉ'=>1,'ﻊ'=>1,'ﻋ'=>1,'ﻌ'=>1,'ﻍ'=>1,'ﻎ'=>1,'ﻏ'=>1,'ﻐ'=>1,'ﻑ'=>1,'ﻒ'=>1,'ﻓ'=>1,'ﻔ'=>1,'ﻕ'=>1,'ﻖ'=>1,'ﻗ'=>1,'ﻘ'=>1,'ﻙ'=>1,'ﻚ'=>1,'ﻛ'=>1,'ﻜ'=>1,'ﻝ'=>1,'ﻞ'=>1,'ﻟ'=>1,'ﻠ'=>1,'ﻡ'=>1,'ﻢ'=>1,'ﻣ'=>1,'ﻤ'=>1,'ﻥ'=>1,'ﻦ'=>1,'ﻧ'=>1,'ﻨ'=>1,'ﻩ'=>1,'ﻪ'=>1,'ﻫ'=>1,'ﻬ'=>1,'ﻭ'=>1,'ﻮ'=>1,'ﻯ'=>1,'ﻰ'=>1,'ﻱ'=>1,'ﻲ'=>1,'ﻳ'=>1,'ﻴ'=>1,'ﻵ'=>1,'ﻶ'=>1,'ﻷ'=>1,'ﻸ'=>1,'ﻹ'=>1,'ﻺ'=>1,'ﻻ'=>1,'ﻼ'=>1,'!'=>1,'"'=>1,'#'=>1,'$'=>1,'%'=>1,'&'=>1,'''=>1,'('=>1,')'=>1,'*'=>1,'+'=>1,','=>1,'-'=>1,'.'=>1,'/'=>1,'0'=>1,'1'=>1,'2'=>1,'3'=>1,'4'=>1,'5'=>1,'6'=>1,'7'=>1,'8'=>1,'9'=>1,':'=>1,';'=>1,'<'=>1,'='=>1,'>'=>1,'?'=>1,'@'=>1,'A'=>1,'B'=>1,'C'=>1,'D'=>1,'E'=>1,'F'=>1,'G'=>1,'H'=>1,'I'=>1,'J'=>1,'K'=>1,'L'=>1,'M'=>1,'N'=>1,'O'=>1,'P'=>1,'Q'=>1,'R'=>1,'S'=>1,'T'=>1,'U'=>1,'V'=>1,'W'=>1,'X'=>1,'Y'=>1,'Z'=>1,'['=>1,'\'=>1,']'=>1,'^'=>1,'_'=>1,'`'=>1,'a'=>1,'b'=>1,'c'=>1,'d'=>1,'e'=>1,'f'=>1,'g'=>1,'h'=>1,'i'=>1,'j'=>1,'k'=>1,'l'=>1,'m'=>1,'n'=>1,'o'=>1,'p'=>1,'q'=>1,'r'=>1,'s'=>1,'t'=>1,'u'=>1,'v'=>1,'w'=>1,'x'=>1,'y'=>1,'z'=>1,'{'=>1,'|'=>1,'}'=>1,'~'=>1,'⦅'=>1,'⦆'=>1,'。'=>1,'「'=>1,'」'=>1,'、'=>1,'・'=>1,'ヲ'=>1,'ァ'=>1,'ィ'=>1,'ゥ'=>1,'ェ'=>1,'ォ'=>1,'ャ'=>1,'ュ'=>1,'ョ'=>1,'ッ'=>1,'ー'=>1,'ア'=>1,'イ'=>1,'ウ'=>1,'エ'=>1,'オ'=>1,'カ'=>1,'キ'=>1,'ク'=>1,'ケ'=>1,'コ'=>1,'サ'=>1,'シ'=>1,'ス'=>1,'セ'=>1,'ソ'=>1,'タ'=>1,'チ'=>1,'ツ'=>1,'テ'=>1,'ト'=>1,'ナ'=>1,'ニ'=>1,'ヌ'=>1,'ネ'=>1,'ノ'=>1,'ハ'=>1,'ヒ'=>1,'フ'=>1,'ヘ'=>1,'ホ'=>1,'マ'=>1,'ミ'=>1,'ム'=>1,'メ'=>1,'モ'=>1,'ヤ'=>1,'ユ'=>1,'ヨ'=>1,'ラ'=>1,'リ'=>1,'ル'=>1,'レ'=>1,'ロ'=>1,'ワ'=>1,'ン'=>1,'゙'=>1,'゚'=>1,'ᅠ'=>1,'ᄀ'=>1,'ᄁ'=>1,'ᆪ'=>1,'ᄂ'=>1,'ᆬ'=>1,'ᆭ'=>1,'ᄃ'=>1,'ᄄ'=>1,'ᄅ'=>1,'ᆰ'=>1,'ᆱ'=>1,'ᆲ'=>1,'ᆳ'=>1,'ᆴ'=>1,'ᆵ'=>1,'ᄚ'=>1,'ᄆ'=>1,'ᄇ'=>1,'ᄈ'=>1,'ᄡ'=>1,'ᄉ'=>1,'ᄊ'=>1,'ᄋ'=>1,'ᄌ'=>1,'ᄍ'=>1,'ᄎ'=>1,'ᄏ'=>1,'ᄐ'=>1,'ᄑ'=>1,'ᄒ'=>1,'ᅡ'=>1,'ᅢ'=>1,'ᅣ'=>1,'ᅤ'=>1,'ᅥ'=>1,'ᅦ'=>1,'ᅧ'=>1,'ᅨ'=>1,'ᅩ'=>1,'ᅪ'=>1,'ᅫ'=>1,'ᅬ'=>1,'ᅭ'=>1,'ᅮ'=>1,'ᅯ'=>1,'ᅰ'=>1,'ᅱ'=>1,'ᅲ'=>1,'ᅳ'=>1,'ᅴ'=>1,'ᅵ'=>1,'¢'=>1,'£'=>1,'¬'=>1,' ̄'=>1,'¦'=>1,'¥'=>1,'₩'=>1,'│'=>1,'←'=>1,'↑'=>1,'→'=>1,'↓'=>1,'■'=>1,'○'=>1,'𝅗𝅥'=>1,'𝅘𝅥'=>1,'𝅘𝅥𝅮'=>1,'𝅘𝅥𝅯'=>1,'𝅘𝅥𝅰'=>1,'𝅘𝅥𝅱'=>1,'𝅘𝅥𝅲'=>1,'𝆹𝅥'=>1,'𝆺𝅥'=>1,'𝆹𝅥𝅮'=>1,'𝆺𝅥𝅮'=>1,'𝆹𝅥𝅯'=>1,'𝆺𝅥𝅯'=>1,'𝐀'=>1,'𝐁'=>1,'𝐂'=>1,'𝐃'=>1,'𝐄'=>1,'𝐅'=>1,'𝐆'=>1,'𝐇'=>1,'𝐈'=>1,'𝐉'=>1,'𝐊'=>1,'𝐋'=>1,'𝐌'=>1,'𝐍'=>1,'𝐎'=>1,'𝐏'=>1,'𝐐'=>1,'𝐑'=>1,'𝐒'=>1,'𝐓'=>1,'𝐔'=>1,'𝐕'=>1,'𝐖'=>1,'𝐗'=>1,'𝐘'=>1,'𝐙'=>1,'𝐚'=>1,'𝐛'=>1,'𝐜'=>1,'𝐝'=>1,'𝐞'=>1,'𝐟'=>1,'𝐠'=>1,'𝐡'=>1,'𝐢'=>1,'𝐣'=>1,'𝐤'=>1,'𝐥'=>1,'𝐦'=>1,'𝐧'=>1,'𝐨'=>1,'𝐩'=>1,'𝐪'=>1,'𝐫'=>1,'𝐬'=>1,'𝐭'=>1,'𝐮'=>1,'𝐯'=>1,'𝐰'=>1,'𝐱'=>1,'𝐲'=>1,'𝐳'=>1,'𝐴'=>1,'𝐵'=>1,'𝐶'=>1,'𝐷'=>1,'𝐸'=>1,'𝐹'=>1,'𝐺'=>1,'𝐻'=>1,'𝐼'=>1,'𝐽'=>1,'𝐾'=>1,'𝐿'=>1,'𝑀'=>1,'𝑁'=>1,'𝑂'=>1,'𝑃'=>1,'𝑄'=>1,'𝑅'=>1,'𝑆'=>1,'𝑇'=>1,'𝑈'=>1,'𝑉'=>1,'𝑊'=>1,'𝑋'=>1,'𝑌'=>1,'𝑍'=>1,'𝑎'=>1,'𝑏'=>1,'𝑐'=>1,'𝑑'=>1,'𝑒'=>1,'𝑓'=>1,'𝑔'=>1,'𝑖'=>1,'𝑗'=>1,'𝑘'=>1,'𝑙'=>1,'𝑚'=>1,'𝑛'=>1,'𝑜'=>1,'𝑝'=>1,'𝑞'=>1,'𝑟'=>1,'𝑠'=>1,'𝑡'=>1,'𝑢'=>1,'𝑣'=>1,'𝑤'=>1,'𝑥'=>1,'𝑦'=>1,'𝑧'=>1,'𝑨'=>1,'𝑩'=>1,'𝑪'=>1,'𝑫'=>1,'𝑬'=>1,'𝑭'=>1,'𝑮'=>1,'𝑯'=>1,'𝑰'=>1,'𝑱'=>1,'𝑲'=>1,'𝑳'=>1,'𝑴'=>1,'𝑵'=>1,'𝑶'=>1,'𝑷'=>1,'𝑸'=>1,'𝑹'=>1,'𝑺'=>1,'𝑻'=>1,'𝑼'=>1,'𝑽'=>1,'𝑾'=>1,'𝑿'=>1,'𝒀'=>1,'𝒁'=>1,'𝒂'=>1,'𝒃'=>1,'𝒄'=>1,'𝒅'=>1,'𝒆'=>1,'𝒇'=>1,'𝒈'=>1,'𝒉'=>1,'𝒊'=>1,'𝒋'=>1,'𝒌'=>1,'𝒍'=>1,'𝒎'=>1,'𝒏'=>1,'𝒐'=>1,'𝒑'=>1,'𝒒'=>1,'𝒓'=>1,'𝒔'=>1,'𝒕'=>1,'𝒖'=>1,'𝒗'=>1,'𝒘'=>1,'𝒙'=>1,'𝒚'=>1,'𝒛'=>1,'𝒜'=>1,'𝒞'=>1,'𝒟'=>1,'𝒢'=>1,'𝒥'=>1,'𝒦'=>1,'𝒩'=>1,'𝒪'=>1,'𝒫'=>1,'𝒬'=>1,'𝒮'=>1,'𝒯'=>1,'𝒰'=>1,'𝒱'=>1,'𝒲'=>1,'𝒳'=>1,'𝒴'=>1,'𝒵'=>1,'𝒶'=>1,'𝒷'=>1,'𝒸'=>1,'𝒹'=>1,'𝒻'=>1,'𝒽'=>1,'𝒾'=>1,'𝒿'=>1,'𝓀'=>1,'𝓁'=>1,'𝓂'=>1,'𝓃'=>1,'𝓅'=>1,'𝓆'=>1,'𝓇'=>1,'𝓈'=>1,'𝓉'=>1,'𝓊'=>1,'𝓋'=>1,'𝓌'=>1,'𝓍'=>1,'𝓎'=>1,'𝓏'=>1,'𝓐'=>1,'𝓑'=>1,'𝓒'=>1,'𝓓'=>1,'𝓔'=>1,'𝓕'=>1,'𝓖'=>1,'𝓗'=>1,'𝓘'=>1,'𝓙'=>1,'𝓚'=>1,'𝓛'=>1,'𝓜'=>1,'𝓝'=>1,'𝓞'=>1,'𝓟'=>1,'𝓠'=>1,'𝓡'=>1,'𝓢'=>1,'𝓣'=>1,'𝓤'=>1,'𝓥'=>1,'𝓦'=>1,'𝓧'=>1,'𝓨'=>1,'𝓩'=>1,'𝓪'=>1,'𝓫'=>1,'𝓬'=>1,'𝓭'=>1,'𝓮'=>1,'𝓯'=>1,'𝓰'=>1,'𝓱'=>1,'𝓲'=>1,'𝓳'=>1,'𝓴'=>1,'𝓵'=>1,'𝓶'=>1,'𝓷'=>1,'𝓸'=>1,'𝓹'=>1,'𝓺'=>1,'𝓻'=>1,'𝓼'=>1,'𝓽'=>1,'𝓾'=>1,'𝓿'=>1,'𝔀'=>1,'𝔁'=>1,'𝔂'=>1,'𝔃'=>1,'𝔄'=>1,'𝔅'=>1,'𝔇'=>1,'𝔈'=>1,'𝔉'=>1,'𝔊'=>1,'𝔍'=>1,'𝔎'=>1,'𝔏'=>1,'𝔐'=>1,'𝔑'=>1,'𝔒'=>1,'𝔓'=>1,'𝔔'=>1,'𝔖'=>1,'𝔗'=>1,'𝔘'=>1,'𝔙'=>1,'𝔚'=>1,'𝔛'=>1,'𝔜'=>1,'𝔞'=>1,'𝔟'=>1,'𝔠'=>1,'𝔡'=>1,'𝔢'=>1,'𝔣'=>1,'𝔤'=>1,'𝔥'=>1,'𝔦'=>1,'𝔧'=>1,'𝔨'=>1,'𝔩'=>1,'𝔪'=>1,'𝔫'=>1,'𝔬'=>1,'𝔭'=>1,'𝔮'=>1,'𝔯'=>1,'𝔰'=>1,'𝔱'=>1,'𝔲'=>1,'𝔳'=>1,'𝔴'=>1,'𝔵'=>1,'𝔶'=>1,'𝔷'=>1,'𝔸'=>1,'𝔹'=>1,'𝔻'=>1,'𝔼'=>1,'𝔽'=>1,'𝔾'=>1,'𝕀'=>1,'𝕁'=>1,'𝕂'=>1,'𝕃'=>1,'𝕄'=>1,'𝕆'=>1,'𝕊'=>1,'𝕋'=>1,'𝕌'=>1,'𝕍'=>1,'𝕎'=>1,'𝕏'=>1,'𝕐'=>1,'𝕒'=>1,'𝕓'=>1,'𝕔'=>1,'𝕕'=>1,'𝕖'=>1,'𝕗'=>1,'𝕘'=>1,'𝕙'=>1,'𝕚'=>1,'𝕛'=>1,'𝕜'=>1,'𝕝'=>1,'𝕞'=>1,'𝕟'=>1,'𝕠'=>1,'𝕡'=>1,'𝕢'=>1,'𝕣'=>1,'𝕤'=>1,'𝕥'=>1,'𝕦'=>1,'𝕧'=>1,'𝕨'=>1,'𝕩'=>1,'𝕪'=>1,'𝕫'=>1,'𝕬'=>1,'𝕭'=>1,'𝕮'=>1,'𝕯'=>1,'𝕰'=>1,'𝕱'=>1,'𝕲'=>1,'𝕳'=>1,'𝕴'=>1,'𝕵'=>1,'𝕶'=>1,'𝕷'=>1,'𝕸'=>1,'𝕹'=>1,'𝕺'=>1,'𝕻'=>1,'𝕼'=>1,'𝕽'=>1,'𝕾'=>1,'𝕿'=>1,'𝖀'=>1,'𝖁'=>1,'𝖂'=>1,'𝖃'=>1,'𝖄'=>1,'𝖅'=>1,'𝖆'=>1,'𝖇'=>1,'𝖈'=>1,'𝖉'=>1,'𝖊'=>1,'𝖋'=>1,'𝖌'=>1,'𝖍'=>1,'𝖎'=>1,'𝖏'=>1,'𝖐'=>1,'𝖑'=>1,'𝖒'=>1,'𝖓'=>1,'𝖔'=>1,'𝖕'=>1,'𝖖'=>1,'𝖗'=>1,'𝖘'=>1,'𝖙'=>1,'𝖚'=>1,'𝖛'=>1,'𝖜'=>1,'𝖝'=>1,'𝖞'=>1,'𝖟'=>1,'𝖠'=>1,'𝖡'=>1,'𝖢'=>1,'𝖣'=>1,'𝖤'=>1,'𝖥'=>1,'𝖦'=>1,'𝖧'=>1,'𝖨'=>1,'𝖩'=>1,'𝖪'=>1,'𝖫'=>1,'𝖬'=>1,'𝖭'=>1,'𝖮'=>1,'𝖯'=>1,'𝖰'=>1,'𝖱'=>1,'𝖲'=>1,'𝖳'=>1,'𝖴'=>1,'𝖵'=>1,'𝖶'=>1,'𝖷'=>1,'𝖸'=>1,'𝖹'=>1,'𝖺'=>1,'𝖻'=>1,'𝖼'=>1,'𝖽'=>1,'𝖾'=>1,'𝖿'=>1,'𝗀'=>1,'𝗁'=>1,'𝗂'=>1,'𝗃'=>1,'𝗄'=>1,'𝗅'=>1,'𝗆'=>1,'𝗇'=>1,'𝗈'=>1,'𝗉'=>1,'𝗊'=>1,'𝗋'=>1,'𝗌'=>1,'𝗍'=>1,'𝗎'=>1,'𝗏'=>1,'𝗐'=>1,'𝗑'=>1,'𝗒'=>1,'𝗓'=>1,'𝗔'=>1,'𝗕'=>1,'𝗖'=>1,'𝗗'=>1,'𝗘'=>1,'𝗙'=>1,'𝗚'=>1,'𝗛'=>1,'𝗜'=>1,'𝗝'=>1,'𝗞'=>1,'𝗟'=>1,'𝗠'=>1,'𝗡'=>1,'𝗢'=>1,'𝗣'=>1,'𝗤'=>1,'𝗥'=>1,'𝗦'=>1,'𝗧'=>1,'𝗨'=>1,'𝗩'=>1,'𝗪'=>1,'𝗫'=>1,'𝗬'=>1,'𝗭'=>1,'𝗮'=>1,'𝗯'=>1,'𝗰'=>1,'𝗱'=>1,'𝗲'=>1,'𝗳'=>1,'𝗴'=>1,'𝗵'=>1,'𝗶'=>1,'𝗷'=>1,'𝗸'=>1,'𝗹'=>1,'𝗺'=>1,'𝗻'=>1,'𝗼'=>1,'𝗽'=>1,'𝗾'=>1,'𝗿'=>1,'𝘀'=>1,'𝘁'=>1,'𝘂'=>1,'𝘃'=>1,'𝘄'=>1,'𝘅'=>1,'𝘆'=>1,'𝘇'=>1,'𝘈'=>1,'𝘉'=>1,'𝘊'=>1,'𝘋'=>1,'𝘌'=>1,'𝘍'=>1,'𝘎'=>1,'𝘏'=>1,'𝘐'=>1,'𝘑'=>1,'𝘒'=>1,'𝘓'=>1,'𝘔'=>1,'𝘕'=>1,'𝘖'=>1,'𝘗'=>1,'𝘘'=>1,'𝘙'=>1,'𝘚'=>1,'𝘛'=>1,'𝘜'=>1,'𝘝'=>1,'𝘞'=>1,'𝘟'=>1,'𝘠'=>1,'𝘡'=>1,'𝘢'=>1,'𝘣'=>1,'𝘤'=>1,'𝘥'=>1,'𝘦'=>1,'𝘧'=>1,'𝘨'=>1,'𝘩'=>1,'𝘪'=>1,'𝘫'=>1,'𝘬'=>1,'𝘭'=>1,'𝘮'=>1,'𝘯'=>1,'𝘰'=>1,'𝘱'=>1,'𝘲'=>1,'𝘳'=>1,'𝘴'=>1,'𝘵'=>1,'𝘶'=>1,'𝘷'=>1,'𝘸'=>1,'𝘹'=>1,'𝘺'=>1,'𝘻'=>1,'𝘼'=>1,'𝘽'=>1,'𝘾'=>1,'𝘿'=>1,'𝙀'=>1,'𝙁'=>1,'𝙂'=>1,'𝙃'=>1,'𝙄'=>1,'𝙅'=>1,'𝙆'=>1,'𝙇'=>1,'𝙈'=>1,'𝙉'=>1,'𝙊'=>1,'𝙋'=>1,'𝙌'=>1,'𝙍'=>1,'𝙎'=>1,'𝙏'=>1,'𝙐'=>1,'𝙑'=>1,'𝙒'=>1,'𝙓'=>1,'𝙔'=>1,'𝙕'=>1,'𝙖'=>1,'𝙗'=>1,'𝙘'=>1,'𝙙'=>1,'𝙚'=>1,'𝙛'=>1,'𝙜'=>1,'𝙝'=>1,'𝙞'=>1,'𝙟'=>1,'𝙠'=>1,'𝙡'=>1,'𝙢'=>1,'𝙣'=>1,'𝙤'=>1,'𝙥'=>1,'𝙦'=>1,'𝙧'=>1,'𝙨'=>1,'𝙩'=>1,'𝙪'=>1,'𝙫'=>1,'𝙬'=>1,'𝙭'=>1,'𝙮'=>1,'𝙯'=>1,'𝙰'=>1,'𝙱'=>1,'𝙲'=>1,'𝙳'=>1,'𝙴'=>1,'𝙵'=>1,'𝙶'=>1,'𝙷'=>1,'𝙸'=>1,'𝙹'=>1,'𝙺'=>1,'𝙻'=>1,'𝙼'=>1,'𝙽'=>1,'𝙾'=>1,'𝙿'=>1,'𝚀'=>1,'𝚁'=>1,'𝚂'=>1,'𝚃'=>1,'𝚄'=>1,'𝚅'=>1,'𝚆'=>1,'𝚇'=>1,'𝚈'=>1,'𝚉'=>1,'𝚊'=>1,'𝚋'=>1,'𝚌'=>1,'𝚍'=>1,'𝚎'=>1,'𝚏'=>1,'𝚐'=>1,'𝚑'=>1,'𝚒'=>1,'𝚓'=>1,'𝚔'=>1,'𝚕'=>1,'𝚖'=>1,'𝚗'=>1,'𝚘'=>1,'𝚙'=>1,'𝚚'=>1,'𝚛'=>1,'𝚜'=>1,'𝚝'=>1,'𝚞'=>1,'𝚟'=>1,'𝚠'=>1,'𝚡'=>1,'𝚢'=>1,'𝚣'=>1,'𝚤'=>1,'𝚥'=>1,'𝚨'=>1,'𝚩'=>1,'𝚪'=>1,'𝚫'=>1,'𝚬'=>1,'𝚭'=>1,'𝚮'=>1,'𝚯'=>1,'𝚰'=>1,'𝚱'=>1,'𝚲'=>1,'𝚳'=>1,'𝚴'=>1,'𝚵'=>1,'𝚶'=>1,'𝚷'=>1,'𝚸'=>1,'𝚹'=>1,'𝚺'=>1,'𝚻'=>1,'𝚼'=>1,'𝚽'=>1,'𝚾'=>1,'𝚿'=>1,'𝛀'=>1,'𝛁'=>1,'𝛂'=>1,'𝛃'=>1,'𝛄'=>1,'𝛅'=>1,'𝛆'=>1,'𝛇'=>1,'𝛈'=>1,'𝛉'=>1,'𝛊'=>1,'𝛋'=>1,'𝛌'=>1,'𝛍'=>1,'𝛎'=>1,'𝛏'=>1,'𝛐'=>1,'𝛑'=>1,'𝛒'=>1,'𝛓'=>1,'𝛔'=>1,'𝛕'=>1,'𝛖'=>1,'𝛗'=>1,'𝛘'=>1,'𝛙'=>1,'𝛚'=>1,'𝛛'=>1,'𝛜'=>1,'𝛝'=>1,'𝛞'=>1,'𝛟'=>1,'𝛠'=>1,'𝛡'=>1,'𝛢'=>1,'𝛣'=>1,'𝛤'=>1,'𝛥'=>1,'𝛦'=>1,'𝛧'=>1,'𝛨'=>1,'𝛩'=>1,'𝛪'=>1,'𝛫'=>1,'𝛬'=>1,'𝛭'=>1,'𝛮'=>1,'𝛯'=>1,'𝛰'=>1,'𝛱'=>1,'𝛲'=>1,'𝛳'=>1,'𝛴'=>1,'𝛵'=>1,'𝛶'=>1,'𝛷'=>1,'𝛸'=>1,'𝛹'=>1,'𝛺'=>1,'𝛻'=>1,'𝛼'=>1,'𝛽'=>1,'𝛾'=>1,'𝛿'=>1,'𝜀'=>1,'𝜁'=>1,'𝜂'=>1,'𝜃'=>1,'𝜄'=>1,'𝜅'=>1,'𝜆'=>1,'𝜇'=>1,'𝜈'=>1,'𝜉'=>1,'𝜊'=>1,'𝜋'=>1,'𝜌'=>1,'𝜍'=>1,'𝜎'=>1,'𝜏'=>1,'𝜐'=>1,'𝜑'=>1,'𝜒'=>1,'𝜓'=>1,'𝜔'=>1,'𝜕'=>1,'𝜖'=>1,'𝜗'=>1,'𝜘'=>1,'𝜙'=>1,'𝜚'=>1,'𝜛'=>1,'𝜜'=>1,'𝜝'=>1,'𝜞'=>1,'𝜟'=>1,'𝜠'=>1,'𝜡'=>1,'𝜢'=>1,'𝜣'=>1,'𝜤'=>1,'𝜥'=>1,'𝜦'=>1,'𝜧'=>1,'𝜨'=>1,'𝜩'=>1,'𝜪'=>1,'𝜫'=>1,'𝜬'=>1,'𝜭'=>1,'𝜮'=>1,'𝜯'=>1,'𝜰'=>1,'𝜱'=>1,'𝜲'=>1,'𝜳'=>1,'𝜴'=>1,'𝜵'=>1,'𝜶'=>1,'𝜷'=>1,'𝜸'=>1,'𝜹'=>1,'𝜺'=>1,'𝜻'=>1,'𝜼'=>1,'𝜽'=>1,'𝜾'=>1,'𝜿'=>1,'𝝀'=>1,'𝝁'=>1,'𝝂'=>1,'𝝃'=>1,'𝝄'=>1,'𝝅'=>1,'𝝆'=>1,'𝝇'=>1,'𝝈'=>1,'𝝉'=>1,'𝝊'=>1,'𝝋'=>1,'𝝌'=>1,'𝝍'=>1,'𝝎'=>1,'𝝏'=>1,'𝝐'=>1,'𝝑'=>1,'𝝒'=>1,'𝝓'=>1,'𝝔'=>1,'𝝕'=>1,'𝝖'=>1,'𝝗'=>1,'𝝘'=>1,'𝝙'=>1,'𝝚'=>1,'𝝛'=>1,'𝝜'=>1,'𝝝'=>1,'𝝞'=>1,'𝝟'=>1,'𝝠'=>1,'𝝡'=>1,'𝝢'=>1,'𝝣'=>1,'𝝤'=>1,'𝝥'=>1,'𝝦'=>1,'𝝧'=>1,'𝝨'=>1,'𝝩'=>1,'𝝪'=>1,'𝝫'=>1,'𝝬'=>1,'𝝭'=>1,'𝝮'=>1,'𝝯'=>1,'𝝰'=>1,'𝝱'=>1,'𝝲'=>1,'𝝳'=>1,'𝝴'=>1,'𝝵'=>1,'𝝶'=>1,'𝝷'=>1,'𝝸'=>1,'𝝹'=>1,'𝝺'=>1,'𝝻'=>1,'𝝼'=>1,'𝝽'=>1,'𝝾'=>1,'𝝿'=>1,'𝞀'=>1,'𝞁'=>1,'𝞂'=>1,'𝞃'=>1,'𝞄'=>1,'𝞅'=>1,'𝞆'=>1,'𝞇'=>1,'𝞈'=>1,'𝞉'=>1,'𝞊'=>1,'𝞋'=>1,'𝞌'=>1,'𝞍'=>1,'𝞎'=>1,'𝞏'=>1,'𝞐'=>1,'𝞑'=>1,'𝞒'=>1,'𝞓'=>1,'𝞔'=>1,'𝞕'=>1,'𝞖'=>1,'𝞗'=>1,'𝞘'=>1,'𝞙'=>1,'𝞚'=>1,'𝞛'=>1,'𝞜'=>1,'𝞝'=>1,'𝞞'=>1,'𝞟'=>1,'𝞠'=>1,'𝞡'=>1,'𝞢'=>1,'𝞣'=>1,'𝞤'=>1,'𝞥'=>1,'𝞦'=>1,'𝞧'=>1,'𝞨'=>1,'𝞩'=>1,'𝞪'=>1,'𝞫'=>1,'𝞬'=>1,'𝞭'=>1,'𝞮'=>1,'𝞯'=>1,'𝞰'=>1,'𝞱'=>1,'𝞲'=>1,'𝞳'=>1,'𝞴'=>1,'𝞵'=>1,'𝞶'=>1,'𝞷'=>1,'𝞸'=>1,'𝞹'=>1,'𝞺'=>1,'𝞻'=>1,'𝞼'=>1,'𝞽'=>1,'𝞾'=>1,'𝞿'=>1,'𝟀'=>1,'𝟁'=>1,'𝟂'=>1,'𝟃'=>1,'𝟄'=>1,'𝟅'=>1,'𝟆'=>1,'𝟇'=>1,'𝟈'=>1,'𝟉'=>1,'𝟊'=>1,'𝟋'=>1,'𝟎'=>1,'𝟏'=>1,'𝟐'=>1,'𝟑'=>1,'𝟒'=>1,'𝟓'=>1,'𝟔'=>1,'𝟕'=>1,'𝟖'=>1,'𝟗'=>1,'𝟘'=>1,'𝟙'=>1,'𝟚'=>1,'𝟛'=>1,'𝟜'=>1,'𝟝'=>1,'𝟞'=>1,'𝟟'=>1,'𝟠'=>1,'𝟡'=>1,'𝟢'=>1,'𝟣'=>1,'𝟤'=>1,'𝟥'=>1,'𝟦'=>1,'𝟧'=>1,'𝟨'=>1,'𝟩'=>1,'𝟪'=>1,'𝟫'=>1,'𝟬'=>1,'𝟭'=>1,'𝟮'=>1,'𝟯'=>1,'𝟰'=>1,'𝟱'=>1,'𝟲'=>1,'𝟳'=>1,'𝟴'=>1,'𝟵'=>1,'𝟶'=>1,'𝟷'=>1,'𝟸'=>1,'𝟹'=>1,'𝟺'=>1,'𝟻'=>1,'𝟼'=>1,'𝟽'=>1,'𝟾'=>1,'𝟿'=>1,'丽'=>1,'丸'=>1,'乁'=>1,'𠄢'=>1,'你'=>1,'侮'=>1,'侻'=>1,'倂'=>1,'偺'=>1,'備'=>1,'僧'=>1,'像'=>1,'㒞'=>1,'𠘺'=>1,'免'=>1,'兔'=>1,'兤'=>1,'具'=>1,'𠔜'=>1,'㒹'=>1,'內'=>1,'再'=>1,'𠕋'=>1,'冗'=>1,'冤'=>1,'仌'=>1,'冬'=>1,'况'=>1,'𩇟'=>1,'凵'=>1,'刃'=>1,'㓟'=>1,'刻'=>1,'剆'=>1,'割'=>1,'剷'=>1,'㔕'=>1,'勇'=>1,'勉'=>1,'勤'=>1,'勺'=>1,'包'=>1,'匆'=>1,'北'=>1,'卉'=>1,'卑'=>1,'博'=>1,'即'=>1,'卽'=>1,'卿'=>1,'卿'=>1,'卿'=>1,'𠨬'=>1,'灰'=>1,'及'=>1,'叟'=>1,'𠭣'=>1,'叫'=>1,'叱'=>1,'吆'=>1,'咞'=>1,'吸'=>1,'呈'=>1,'周'=>1,'咢'=>1,'哶'=>1,'唐'=>1,'啓'=>1,'啣'=>1,'善'=>1,'善'=>1,'喙'=>1,'喫'=>1,'喳'=>1,'嗂'=>1,'圖'=>1,'嘆'=>1,'圗'=>1,'噑'=>1,'噴'=>1,'切'=>1,'壮'=>1,'城'=>1,'埴'=>1,'堍'=>1,'型'=>1,'堲'=>1,'報'=>1,'墬'=>1,'𡓤'=>1,'売'=>1,'壷'=>1,'夆'=>1,'多'=>1,'夢'=>1,'奢'=>1,'𡚨'=>1,'𡛪'=>1,'姬'=>1,'娛'=>1,'娧'=>1,'姘'=>1,'婦'=>1,'㛮'=>1,'㛼'=>1,'嬈'=>1,'嬾'=>1,'嬾'=>1,'𡧈'=>1,'寃'=>1,'寘'=>1,'寧'=>1,'寳'=>1,'𡬘'=>1,'寿'=>1,'将'=>1,'当'=>1,'尢'=>1,'㞁'=>1,'屠'=>1,'屮'=>1,'峀'=>1,'岍'=>1,'𡷤'=>1,'嵃'=>1,'𡷦'=>1,'嵮'=>1,'嵫'=>1,'嵼'=>1,'巡'=>1,'巢'=>1,'㠯'=>1,'巽'=>1,'帨'=>1,'帽'=>1,'幩'=>1,'㡢'=>1,'𢆃'=>1,'㡼'=>1,'庰'=>1,'庳'=>1,'庶'=>1,'廊'=>1,'𪎒'=>1,'廾'=>1,'𢌱'=>1,'𢌱'=>1,'舁'=>1,'弢'=>1,'弢'=>1,'㣇'=>1,'𣊸'=>1,'𦇚'=>1,'形'=>1,'彫'=>1,'㣣'=>1,'徚'=>1,'忍'=>1,'志'=>1,'忹'=>1,'悁'=>1,'㤺'=>1,'㤜'=>1,'悔'=>1,'𢛔'=>1,'惇'=>1,'慈'=>1,'慌'=>1,'慎'=>1,'慌'=>1,'慺'=>1,'憎'=>1,'憲'=>1,'憤'=>1,'憯'=>1,'懞'=>1,'懲'=>1,'懶'=>1,'成'=>1,'戛'=>1,'扝'=>1,'抱'=>1,'拔'=>1,'捐'=>1,'𢬌'=>1,'挽'=>1,'拼'=>1,'捨'=>1,'掃'=>1,'揤'=>1,'𢯱'=>1,'搢'=>1,'揅'=>1,'掩'=>1,'㨮'=>1,'摩'=>1,'摾'=>1,'撝'=>1,'摷'=>1,'㩬'=>1,'敏'=>1,'敬'=>1,'𣀊'=>1,'旣'=>1,'書'=>1,'晉'=>1,'㬙'=>1,'暑'=>1,'㬈'=>1,'㫤'=>1,'冒'=>1,'冕'=>1,'最'=>1,'暜'=>1,'肭'=>1,'䏙'=>1,'朗'=>1,'望'=>1,'朡'=>1,'杞'=>1,'杓'=>1,'𣏃'=>1,'㭉'=>1,'柺'=>1,'枅'=>1,'桒'=>1,'梅'=>1,'𣑭'=>1,'梎'=>1,'栟'=>1,'椔'=>1,'㮝'=>1,'楂'=>1,'榣'=>1,'槪'=>1,'檨'=>1,'𣚣'=>1,'櫛'=>1,'㰘'=>1,'次'=>1,'𣢧'=>1,'歔'=>1,'㱎'=>1,'歲'=>1,'殟'=>1,'殺'=>1,'殻'=>1,'𣪍'=>1,'𡴋'=>1,'𣫺'=>1,'汎'=>1,'𣲼'=>1,'沿'=>1,'泍'=>1,'汧'=>1,'洖'=>1,'派'=>1,'海'=>1,'流'=>1,'浩'=>1,'浸'=>1,'涅'=>1,'𣴞'=>1,'洴'=>1,'港'=>1,'湮'=>1,'㴳'=>1,'滋'=>1,'滇'=>1,'𣻑'=>1,'淹'=>1,'潮'=>1,'𣽞'=>1,'𣾎'=>1,'濆'=>1,'瀹'=>1,'瀞'=>1,'瀛'=>1,'㶖'=>1,'灊'=>1,'災'=>1,'灷'=>1,'炭'=>1,'𠔥'=>1,'煅'=>1,'𤉣'=>1,'熜'=>1,'𤎫'=>1,'爨'=>1,'爵'=>1,'牐'=>1,'𤘈'=>1,'犀'=>1,'犕'=>1,'𤜵'=>1,'𤠔'=>1,'獺'=>1,'王'=>1,'㺬'=>1,'玥'=>1,'㺸'=>1,'㺸'=>1,'瑇'=>1,'瑜'=>1,'瑱'=>1,'璅'=>1,'瓊'=>1,'㼛'=>1,'甤'=>1,'𤰶'=>1,'甾'=>1,'𤲒'=>1,'異'=>1,'𢆟'=>1,'瘐'=>1,'𤾡'=>1,'𤾸'=>1,'𥁄'=>1,'㿼'=>1,'䀈'=>1,'直'=>1,'𥃳'=>1,'𥃲'=>1,'𥄙'=>1,'𥄳'=>1,'眞'=>1,'真'=>1,'真'=>1,'睊'=>1,'䀹'=>1,'瞋'=>1,'䁆'=>1,'䂖'=>1,'𥐝'=>1,'硎'=>1,'碌'=>1,'磌'=>1,'䃣'=>1,'𥘦'=>1,'祖'=>1,'𥚚'=>1,'𥛅'=>1,'福'=>1,'秫'=>1,'䄯'=>1,'穀'=>1,'穊'=>1,'穏'=>1,'𥥼'=>1,'𥪧'=>1,'𥪧'=>1,'竮'=>1,'䈂'=>1,'𥮫'=>1,'篆'=>1,'築'=>1,'䈧'=>1,'𥲀'=>1,'糒'=>1,'䊠'=>1,'糨'=>1,'糣'=>1,'紀'=>1,'𥾆'=>1,'絣'=>1,'䌁'=>1,'緇'=>1,'縂'=>1,'繅'=>1,'䌴'=>1,'𦈨'=>1,'𦉇'=>1,'䍙'=>1,'𦋙'=>1,'罺'=>1,'𦌾'=>1,'羕'=>1,'翺'=>1,'者'=>1,'𦓚'=>1,'𦔣'=>1,'聠'=>1,'𦖨'=>1,'聰'=>1,'𣍟'=>1,'䏕'=>1,'育'=>1,'脃'=>1,'䐋'=>1,'脾'=>1,'媵'=>1,'𦞧'=>1,'𦞵'=>1,'𣎓'=>1,'𣎜'=>1,'舁'=>1,'舄'=>1,'辞'=>1,'䑫'=>1,'芑'=>1,'芋'=>1,'芝'=>1,'劳'=>1,'花'=>1,'芳'=>1,'芽'=>1,'苦'=>1,'𦬼'=>1,'若'=>1,'茝'=>1,'荣'=>1,'莭'=>1,'茣'=>1,'莽'=>1,'菧'=>1,'著'=>1,'荓'=>1,'菊'=>1,'菌'=>1,'菜'=>1,'𦰶'=>1,'𦵫'=>1,'𦳕'=>1,'䔫'=>1,'蓱'=>1,'蓳'=>1,'蔖'=>1,'𧏊'=>1,'蕤'=>1,'𦼬'=>1,'䕝'=>1,'䕡'=>1,'𦾱'=>1,'𧃒'=>1,'䕫'=>1,'虐'=>1,'虜'=>1,'虧'=>1,'虩'=>1,'蚩'=>1,'蚈'=>1,'蜎'=>1,'蛢'=>1,'蝹'=>1,'蜨'=>1,'蝫'=>1,'螆'=>1,'䗗'=>1,'蟡'=>1,'蠁'=>1,'䗹'=>1,'衠'=>1,'衣'=>1,'𧙧'=>1,'裗'=>1,'裞'=>1,'䘵'=>1,'裺'=>1,'㒻'=>1,'𧢮'=>1,'𧥦'=>1,'䚾'=>1,'䛇'=>1,'誠'=>1,'諭'=>1,'變'=>1,'豕'=>1,'𧲨'=>1,'貫'=>1,'賁'=>1,'贛'=>1,'起'=>1,'𧼯'=>1,'𠠄'=>1,'跋'=>1,'趼'=>1,'跰'=>1,'𠣞'=>1,'軔'=>1,'輸'=>1,'𨗒'=>1,'𨗭'=>1,'邔'=>1,'郱'=>1,'鄑'=>1,'𨜮'=>1,'鄛'=>1,'鈸'=>1,'鋗'=>1,'鋘'=>1,'鉼'=>1,'鏹'=>1,'鐕'=>1,'𨯺'=>1,'開'=>1,'䦕'=>1,'閷'=>1,'𨵷'=>1,'䧦'=>1,'雃'=>1,'嶲'=>1,'霣'=>1,'𩅅'=>1,'𩈚'=>1,'䩮'=>1,'䩶'=>1,'韠'=>1,'𩐊'=>1,'䪲'=>1,'𩒖'=>1,'頋'=>1,'頋'=>1,'頩'=>1,'𩖶'=>1,'飢'=>1,'䬳'=>1,'餩'=>1,'馧'=>1,'駂'=>1,'駾'=>1,'䯎'=>1,'𩬰'=>1,'鬒'=>1,'鱀'=>1,'鳽'=>1,'䳎'=>1,'䳭'=>1,'鵧'=>1,'𪃎'=>1,'䳸'=>1,'𪄅'=>1,'𪈎'=>1,'𪊑'=>1,'麻'=>1,'䵖'=>1,'黹'=>1,'黾'=>1,'鼅'=>1,'鼏'=>1,'鼖'=>1,'鼻'=>1,'𪘀'=>1,'̀'=>0,'́'=>0,'̂'=>0,'̃'=>0,'̄'=>0,'̆'=>0,'̇'=>0,'̈'=>0,'̉'=>0,'̊'=>0,'̋'=>0,'̌'=>0,'̏'=>0,'̑'=>0,'̓'=>0,'̔'=>0,'̛'=>0,'̣'=>0,'̤'=>0,'̥'=>0,'̦'=>0,'̧'=>0,'̨'=>0,'̭'=>0,'̮'=>0,'̰'=>0,'̱'=>0,'̸'=>0,'͂'=>0,'ͅ'=>0,'ٓ'=>0,'ٔ'=>0,'ٕ'=>0,'़'=>0,'া'=>0,'ৗ'=>0,'ା'=>0,'ୖ'=>0,'ୗ'=>0,'ா'=>0,'ௗ'=>0,'ౖ'=>0,'ೂ'=>0,'ೕ'=>0,'ೖ'=>0,'ാ'=>0,'ൗ'=>0,'්'=>0,'ා'=>0,'ෟ'=>0,'ီ'=>0,'ᅡ'=>0,'ᅢ'=>0,'ᅣ'=>0,'ᅤ'=>0,'ᅥ'=>0,'ᅦ'=>0,'ᅧ'=>0,'ᅨ'=>0,'ᅩ'=>0,'ᅪ'=>0,'ᅫ'=>0,'ᅬ'=>0,'ᅭ'=>0,'ᅮ'=>0,'ᅯ'=>0,'ᅰ'=>0,'ᅱ'=>0,'ᅲ'=>0,'ᅳ'=>0,'ᅴ'=>0,'ᅵ'=>0,'ᆨ'=>0,'ᆩ'=>0,'ᆪ'=>0,'ᆫ'=>0,'ᆬ'=>0,'ᆭ'=>0,'ᆮ'=>0,'ᆯ'=>0,'ᆰ'=>0,'ᆱ'=>0,'ᆲ'=>0,'ᆳ'=>0,'ᆴ'=>0,'ᆵ'=>0,'ᆶ'=>0,'ᆷ'=>0,'ᆸ'=>0,'ᆹ'=>0,'ᆺ'=>0,'ᆻ'=>0,'ᆼ'=>0,'ᆽ'=>0,'ᆾ'=>0,'ᆿ'=>0,'ᇀ'=>0,'ᇁ'=>0,'ᇂ'=>0,'ᬵ'=>0,'゙'=>0,'゚'=>0);
diff --git a/phpBB/includes/utf/data/utf_normalizer_common.php b/phpBB/includes/utf/data/utf_normalizer_common.php
index befc17d410..2eb7feac69 100644
--- a/phpBB/includes/utf/data/utf_normalizer_common.php
+++ b/phpBB/includes/utf/data/utf_normalizer_common.php
@@ -1,4 +1,4 @@
<?php
$GLOBALS['utf_jamo_index']=array('ᄀ'=>44032,'ᄁ'=>44620,'ᄂ'=>45208,'ᄃ'=>45796,'ᄄ'=>46384,'ᄅ'=>46972,'ᄆ'=>47560,'ᄇ'=>48148,'ᄈ'=>48736,'ᄉ'=>49324,'ᄊ'=>49912,'ᄋ'=>50500,'ᄌ'=>51088,'ᄍ'=>51676,'ᄎ'=>52264,'ᄏ'=>52852,'ᄐ'=>53440,'ᄑ'=>54028,'ᄒ'=>54616,'ᅡ'=>0,'ᅢ'=>28,'ᅣ'=>56,'ᅤ'=>84,'ᅥ'=>112,'ᅦ'=>140,'ᅧ'=>168,'ᅨ'=>196,'ᅩ'=>224,'ᅪ'=>252,'ᅫ'=>280,'ᅬ'=>308,'ᅭ'=>336,'ᅮ'=>364,'ᅯ'=>392,'ᅰ'=>420,'ᅱ'=>448,'ᅲ'=>476,'ᅳ'=>504,'ᅴ'=>532,'ᅵ'=>560,'ᆧ'=>0,'ᆨ'=>1,'ᆩ'=>2,'ᆪ'=>3,'ᆫ'=>4,'ᆬ'=>5,'ᆭ'=>6,'ᆮ'=>7,'ᆯ'=>8,'ᆰ'=>9,'ᆱ'=>10,'ᆲ'=>11,'ᆳ'=>12,'ᆴ'=>13,'ᆵ'=>14,'ᆶ'=>15,'ᆷ'=>16,'ᆸ'=>17,'ᆹ'=>18,'ᆺ'=>19,'ᆻ'=>20,'ᆼ'=>21,'ᆽ'=>22,'ᆾ'=>23,'ᆿ'=>24,'ᇀ'=>25,'ᇁ'=>26,'ᇂ'=>27);
$GLOBALS['utf_jamo_type']=array('ᄀ'=>0,'ᄁ'=>0,'ᄂ'=>0,'ᄃ'=>0,'ᄄ'=>0,'ᄅ'=>0,'ᄆ'=>0,'ᄇ'=>0,'ᄈ'=>0,'ᄉ'=>0,'ᄊ'=>0,'ᄋ'=>0,'ᄌ'=>0,'ᄍ'=>0,'ᄎ'=>0,'ᄏ'=>0,'ᄐ'=>0,'ᄑ'=>0,'ᄒ'=>0,'ᅡ'=>1,'ᅢ'=>1,'ᅣ'=>1,'ᅤ'=>1,'ᅥ'=>1,'ᅦ'=>1,'ᅧ'=>1,'ᅨ'=>1,'ᅩ'=>1,'ᅪ'=>1,'ᅫ'=>1,'ᅬ'=>1,'ᅭ'=>1,'ᅮ'=>1,'ᅯ'=>1,'ᅰ'=>1,'ᅱ'=>1,'ᅲ'=>1,'ᅳ'=>1,'ᅴ'=>1,'ᅵ'=>1,'ᆧ'=>2,'ᆨ'=>2,'ᆩ'=>2,'ᆪ'=>2,'ᆫ'=>2,'ᆬ'=>2,'ᆭ'=>2,'ᆮ'=>2,'ᆯ'=>2,'ᆰ'=>2,'ᆱ'=>2,'ᆲ'=>2,'ᆳ'=>2,'ᆴ'=>2,'ᆵ'=>2,'ᆶ'=>2,'ᆷ'=>2,'ᆸ'=>2,'ᆹ'=>2,'ᆺ'=>2,'ᆻ'=>2,'ᆼ'=>2,'ᆽ'=>2,'ᆾ'=>2,'ᆿ'=>2,'ᇀ'=>2,'ᇁ'=>2,'ᇂ'=>2);
-$GLOBALS['utf_combining_class']=array('̀'=>230,'́'=>230,'̂'=>230,'̃'=>230,'̄'=>230,'̅'=>230,'̆'=>230,'̇'=>230,'̈'=>230,'̉'=>230,'̊'=>230,'̋'=>230,'̌'=>230,'̍'=>230,'̎'=>230,'̏'=>230,'̐'=>230,'̑'=>230,'̒'=>230,'̓'=>230,'̔'=>230,'̕'=>232,'̖'=>220,'̗'=>220,'̘'=>220,'̙'=>220,'̚'=>232,'̛'=>216,'̜'=>220,'̝'=>220,'̞'=>220,'̟'=>220,'̠'=>220,'̡'=>202,'̢'=>202,'̣'=>220,'̤'=>220,'̥'=>220,'̦'=>220,'̧'=>202,'̨'=>202,'̩'=>220,'̪'=>220,'̫'=>220,'̬'=>220,'̭'=>220,'̮'=>220,'̯'=>220,'̰'=>220,'̱'=>220,'̲'=>220,'̳'=>220,'̴'=>1,'̵'=>1,'̶'=>1,'̷'=>1,'̸'=>1,'̹'=>220,'̺'=>220,'̻'=>220,'̼'=>220,'̽'=>230,'̾'=>230,'̿'=>230,'̀'=>230,'́'=>230,'͂'=>230,'̓'=>230,'̈́'=>230,'ͅ'=>240,'͆'=>230,'͇'=>220,'͈'=>220,'͉'=>220,'͊'=>230,'͋'=>230,'͌'=>230,'͍'=>220,'͎'=>220,'͐'=>230,'͑'=>230,'͒'=>230,'͓'=>220,'͔'=>220,'͕'=>220,'͖'=>220,'͗'=>230,'͘'=>232,'͙'=>220,'͚'=>220,'͛'=>230,'͜'=>233,'͝'=>234,'͞'=>234,'͟'=>233,'͠'=>234,'͡'=>234,'͢'=>233,'ͣ'=>230,'ͤ'=>230,'ͥ'=>230,'ͦ'=>230,'ͧ'=>230,'ͨ'=>230,'ͩ'=>230,'ͪ'=>230,'ͫ'=>230,'ͬ'=>230,'ͭ'=>230,'ͮ'=>230,'ͯ'=>230,'҃'=>230,'҄'=>230,'҅'=>230,'҆'=>230,'֑'=>220,'֒'=>230,'֓'=>230,'֔'=>230,'֕'=>230,'֖'=>220,'֗'=>230,'֘'=>230,'֙'=>230,'֚'=>222,'֛'=>220,'֜'=>230,'֝'=>230,'֞'=>230,'֟'=>230,'֠'=>230,'֡'=>230,'֢'=>220,'֣'=>220,'֤'=>220,'֥'=>220,'֦'=>220,'֧'=>220,'֨'=>230,'֩'=>230,'֪'=>220,'֫'=>230,'֬'=>230,'֭'=>222,'֮'=>228,'֯'=>230,'ְ'=>10,'ֱ'=>11,'ֲ'=>12,'ֳ'=>13,'ִ'=>14,'ֵ'=>15,'ֶ'=>16,'ַ'=>17,'ָ'=>18,'ֹ'=>19,'ֺ'=>19,'ֻ'=>20,'ּ'=>21,'ֽ'=>22,'ֿ'=>23,'ׁ'=>24,'ׂ'=>25,'ׄ'=>230,'ׅ'=>220,'ׇ'=>18,'ؐ'=>230,'ؑ'=>230,'ؒ'=>230,'ؓ'=>230,'ؔ'=>230,'ؕ'=>230,'ً'=>27,'ٌ'=>28,'ٍ'=>29,'َ'=>30,'ُ'=>31,'ِ'=>32,'ّ'=>33,'ْ'=>34,'ٓ'=>230,'ٔ'=>230,'ٕ'=>220,'ٖ'=>220,'ٗ'=>230,'٘'=>230,'ٙ'=>230,'ٚ'=>230,'ٛ'=>230,'ٜ'=>220,'ٝ'=>230,'ٞ'=>230,'ٰ'=>35,'ۖ'=>230,'ۗ'=>230,'ۘ'=>230,'ۙ'=>230,'ۚ'=>230,'ۛ'=>230,'ۜ'=>230,'۟'=>230,'۠'=>230,'ۡ'=>230,'ۢ'=>230,'ۣ'=>220,'ۤ'=>230,'ۧ'=>230,'ۨ'=>230,'۪'=>220,'۫'=>230,'۬'=>230,'ۭ'=>220,'ܑ'=>36,'ܰ'=>230,'ܱ'=>220,'ܲ'=>230,'ܳ'=>230,'ܴ'=>220,'ܵ'=>230,'ܶ'=>230,'ܷ'=>220,'ܸ'=>220,'ܹ'=>220,'ܺ'=>230,'ܻ'=>220,'ܼ'=>220,'ܽ'=>230,'ܾ'=>220,'ܿ'=>230,'݀'=>230,'݁'=>230,'݂'=>220,'݃'=>230,'݄'=>220,'݅'=>230,'݆'=>220,'݇'=>230,'݈'=>220,'݉'=>230,'݊'=>230,'߫'=>230,'߬'=>230,'߭'=>230,'߮'=>230,'߯'=>230,'߰'=>230,'߱'=>230,'߲'=>220,'߳'=>230,'़'=>7,'्'=>9,'॑'=>230,'॒'=>220,'॓'=>230,'॔'=>230,'়'=>7,'্'=>9,'਼'=>7,'੍'=>9,'઼'=>7,'્'=>9,'଼'=>7,'୍'=>9,'்'=>9,'్'=>9,'ౕ'=>84,'ౖ'=>91,'಼'=>7,'್'=>9,'്'=>9,'්'=>9,'ุ'=>103,'ู'=>103,'ฺ'=>9,'่'=>107,'้'=>107,'๊'=>107,'๋'=>107,'ຸ'=>118,'ູ'=>118,'່'=>122,'້'=>122,'໊'=>122,'໋'=>122,'༘'=>220,'༙'=>220,'༵'=>220,'༷'=>220,'༹'=>216,'ཱ'=>129,'ི'=>130,'ུ'=>132,'ེ'=>130,'ཻ'=>130,'ོ'=>130,'ཽ'=>130,'ྀ'=>130,'ྂ'=>230,'ྃ'=>230,'྄'=>9,'྆'=>230,'྇'=>230,'࿆'=>220,'့'=>7,'္'=>9,'፟'=>230,'᜔'=>9,'᜴'=>9,'្'=>9,'៝'=>230,'ᢩ'=>228,'᤹'=>222,'᤺'=>230,'᤻'=>220,'ᨗ'=>230,'ᨘ'=>220,'᬴'=>7,'᭄'=>9,'᭫'=>230,'᭬'=>220,'᭭'=>230,'᭮'=>230,'᭯'=>230,'᭰'=>230,'᭱'=>230,'᭲'=>230,'᭳'=>230,'᷀'=>230,'᷁'=>230,'᷂'=>220,'᷃'=>230,'᷄'=>230,'᷅'=>230,'᷆'=>230,'᷇'=>230,'᷈'=>230,'᷉'=>230,'᷊'=>220,'᷾'=>230,'᷿'=>220,'⃐'=>230,'⃑'=>230,'⃒'=>1,'⃓'=>1,'⃔'=>230,'⃕'=>230,'⃖'=>230,'⃗'=>230,'⃘'=>1,'⃙'=>1,'⃚'=>1,'⃛'=>230,'⃜'=>230,'⃡'=>230,'⃥'=>1,'⃦'=>1,'⃧'=>230,'⃨'=>220,'⃩'=>230,'⃪'=>1,'⃫'=>1,'⃬'=>220,'⃭'=>220,'⃮'=>220,'⃯'=>220,'〪'=>218,'〫'=>228,'〬'=>232,'〭'=>222,'〮'=>224,'〯'=>224,'゙'=>8,'゚'=>8,'꠆'=>9,'ﬞ'=>26,'︠'=>230,'︡'=>230,'︢'=>230,'︣'=>230,'𐨍'=>220,'𐨏'=>230,'𐨸'=>230,'𐨹'=>1,'𐨺'=>220,'𐨿'=>9,'𝅥'=>216,'𝅦'=>216,'𝅧'=>1,'𝅨'=>1,'𝅩'=>1,'𝅭'=>226,'𝅮'=>216,'𝅯'=>216,'𝅰'=>216,'𝅱'=>216,'𝅲'=>216,'𝅻'=>220,'𝅼'=>220,'𝅽'=>220,'𝅾'=>220,'𝅿'=>220,'𝆀'=>220,'𝆁'=>220,'𝆂'=>220,'𝆅'=>230,'𝆆'=>230,'𝆇'=>230,'𝆈'=>230,'𝆉'=>230,'𝆊'=>220,'𝆋'=>220,'𝆪'=>230,'𝆫'=>230,'𝆬'=>230,'𝆭'=>230,'𝉂'=>230,'𝉃'=>230,'𝉄'=>230); \ No newline at end of file
+$GLOBALS['utf_combining_class']=array('̀'=>230,'́'=>230,'̂'=>230,'̃'=>230,'̄'=>230,'̅'=>230,'̆'=>230,'̇'=>230,'̈'=>230,'̉'=>230,'̊'=>230,'̋'=>230,'̌'=>230,'̍'=>230,'̎'=>230,'̏'=>230,'̐'=>230,'̑'=>230,'̒'=>230,'̓'=>230,'̔'=>230,'̕'=>232,'̖'=>220,'̗'=>220,'̘'=>220,'̙'=>220,'̚'=>232,'̛'=>216,'̜'=>220,'̝'=>220,'̞'=>220,'̟'=>220,'̠'=>220,'̡'=>202,'̢'=>202,'̣'=>220,'̤'=>220,'̥'=>220,'̦'=>220,'̧'=>202,'̨'=>202,'̩'=>220,'̪'=>220,'̫'=>220,'̬'=>220,'̭'=>220,'̮'=>220,'̯'=>220,'̰'=>220,'̱'=>220,'̲'=>220,'̳'=>220,'̴'=>1,'̵'=>1,'̶'=>1,'̷'=>1,'̸'=>1,'̹'=>220,'̺'=>220,'̻'=>220,'̼'=>220,'̽'=>230,'̾'=>230,'̿'=>230,'̀'=>230,'́'=>230,'͂'=>230,'̓'=>230,'̈́'=>230,'ͅ'=>240,'͆'=>230,'͇'=>220,'͈'=>220,'͉'=>220,'͊'=>230,'͋'=>230,'͌'=>230,'͍'=>220,'͎'=>220,'͐'=>230,'͑'=>230,'͒'=>230,'͓'=>220,'͔'=>220,'͕'=>220,'͖'=>220,'͗'=>230,'͘'=>232,'͙'=>220,'͚'=>220,'͛'=>230,'͜'=>233,'͝'=>234,'͞'=>234,'͟'=>233,'͠'=>234,'͡'=>234,'͢'=>233,'ͣ'=>230,'ͤ'=>230,'ͥ'=>230,'ͦ'=>230,'ͧ'=>230,'ͨ'=>230,'ͩ'=>230,'ͪ'=>230,'ͫ'=>230,'ͬ'=>230,'ͭ'=>230,'ͮ'=>230,'ͯ'=>230,'҃'=>230,'҄'=>230,'҅'=>230,'҆'=>230,'֑'=>220,'֒'=>230,'֓'=>230,'֔'=>230,'֕'=>230,'֖'=>220,'֗'=>230,'֘'=>230,'֙'=>230,'֚'=>222,'֛'=>220,'֜'=>230,'֝'=>230,'֞'=>230,'֟'=>230,'֠'=>230,'֡'=>230,'֢'=>220,'֣'=>220,'֤'=>220,'֥'=>220,'֦'=>220,'֧'=>220,'֨'=>230,'֩'=>230,'֪'=>220,'֫'=>230,'֬'=>230,'֭'=>222,'֮'=>228,'֯'=>230,'ְ'=>10,'ֱ'=>11,'ֲ'=>12,'ֳ'=>13,'ִ'=>14,'ֵ'=>15,'ֶ'=>16,'ַ'=>17,'ָ'=>18,'ֹ'=>19,'ֺ'=>19,'ֻ'=>20,'ּ'=>21,'ֽ'=>22,'ֿ'=>23,'ׁ'=>24,'ׂ'=>25,'ׄ'=>230,'ׅ'=>220,'ׇ'=>18,'ؐ'=>230,'ؑ'=>230,'ؒ'=>230,'ؓ'=>230,'ؔ'=>230,'ؕ'=>230,'ً'=>27,'ٌ'=>28,'ٍ'=>29,'َ'=>30,'ُ'=>31,'ِ'=>32,'ّ'=>33,'ْ'=>34,'ٓ'=>230,'ٔ'=>230,'ٕ'=>220,'ٖ'=>220,'ٗ'=>230,'٘'=>230,'ٙ'=>230,'ٚ'=>230,'ٛ'=>230,'ٜ'=>220,'ٝ'=>230,'ٞ'=>230,'ٰ'=>35,'ۖ'=>230,'ۗ'=>230,'ۘ'=>230,'ۙ'=>230,'ۚ'=>230,'ۛ'=>230,'ۜ'=>230,'۟'=>230,'۠'=>230,'ۡ'=>230,'ۢ'=>230,'ۣ'=>220,'ۤ'=>230,'ۧ'=>230,'ۨ'=>230,'۪'=>220,'۫'=>230,'۬'=>230,'ۭ'=>220,'ܑ'=>36,'ܰ'=>230,'ܱ'=>220,'ܲ'=>230,'ܳ'=>230,'ܴ'=>220,'ܵ'=>230,'ܶ'=>230,'ܷ'=>220,'ܸ'=>220,'ܹ'=>220,'ܺ'=>230,'ܻ'=>220,'ܼ'=>220,'ܽ'=>230,'ܾ'=>220,'ܿ'=>230,'݀'=>230,'݁'=>230,'݂'=>220,'݃'=>230,'݄'=>220,'݅'=>230,'݆'=>220,'݇'=>230,'݈'=>220,'݉'=>230,'݊'=>230,'߫'=>230,'߬'=>230,'߭'=>230,'߮'=>230,'߯'=>230,'߰'=>230,'߱'=>230,'߲'=>220,'߳'=>230,'़'=>7,'्'=>9,'॑'=>230,'॒'=>220,'॓'=>230,'॔'=>230,'়'=>7,'্'=>9,'਼'=>7,'੍'=>9,'઼'=>7,'્'=>9,'଼'=>7,'୍'=>9,'்'=>9,'్'=>9,'ౕ'=>84,'ౖ'=>91,'಼'=>7,'್'=>9,'്'=>9,'්'=>9,'ุ'=>103,'ู'=>103,'ฺ'=>9,'่'=>107,'้'=>107,'๊'=>107,'๋'=>107,'ຸ'=>118,'ູ'=>118,'່'=>122,'້'=>122,'໊'=>122,'໋'=>122,'༘'=>220,'༙'=>220,'༵'=>220,'༷'=>220,'༹'=>216,'ཱ'=>129,'ི'=>130,'ུ'=>132,'ེ'=>130,'ཻ'=>130,'ོ'=>130,'ཽ'=>130,'ྀ'=>130,'ྂ'=>230,'ྃ'=>230,'྄'=>9,'྆'=>230,'྇'=>230,'࿆'=>220,'့'=>7,'္'=>9,'፟'=>230,'᜔'=>9,'᜴'=>9,'្'=>9,'៝'=>230,'ᢩ'=>228,'᤹'=>222,'᤺'=>230,'᤻'=>220,'ᨗ'=>230,'ᨘ'=>220,'᬴'=>7,'᭄'=>9,'᭫'=>230,'᭬'=>220,'᭭'=>230,'᭮'=>230,'᭯'=>230,'᭰'=>230,'᭱'=>230,'᭲'=>230,'᭳'=>230,'᷀'=>230,'᷁'=>230,'᷂'=>220,'᷃'=>230,'᷄'=>230,'᷅'=>230,'᷆'=>230,'᷇'=>230,'᷈'=>230,'᷉'=>230,'᷊'=>220,'᷾'=>230,'᷿'=>220,'⃐'=>230,'⃑'=>230,'⃒'=>1,'⃓'=>1,'⃔'=>230,'⃕'=>230,'⃖'=>230,'⃗'=>230,'⃘'=>1,'⃙'=>1,'⃚'=>1,'⃛'=>230,'⃜'=>230,'⃡'=>230,'⃥'=>1,'⃦'=>1,'⃧'=>230,'⃨'=>220,'⃩'=>230,'⃪'=>1,'⃫'=>1,'⃬'=>220,'⃭'=>220,'⃮'=>220,'⃯'=>220,'〪'=>218,'〫'=>228,'〬'=>232,'〭'=>222,'〮'=>224,'〯'=>224,'゙'=>8,'゚'=>8,'꠆'=>9,'ﬞ'=>26,'︠'=>230,'︡'=>230,'︢'=>230,'︣'=>230,'𐨍'=>220,'𐨏'=>230,'𐨸'=>230,'𐨹'=>1,'𐨺'=>220,'𐨿'=>9,'𝅥'=>216,'𝅦'=>216,'𝅧'=>1,'𝅨'=>1,'𝅩'=>1,'𝅭'=>226,'𝅮'=>216,'𝅯'=>216,'𝅰'=>216,'𝅱'=>216,'𝅲'=>216,'𝅻'=>220,'𝅼'=>220,'𝅽'=>220,'𝅾'=>220,'𝅿'=>220,'𝆀'=>220,'𝆁'=>220,'𝆂'=>220,'𝆅'=>230,'𝆆'=>230,'𝆇'=>230,'𝆈'=>230,'𝆉'=>230,'𝆊'=>220,'𝆋'=>220,'𝆪'=>230,'𝆫'=>230,'𝆬'=>230,'𝆭'=>230,'𝉂'=>230,'𝉃'=>230,'𝉄'=>230);
diff --git a/phpBB/includes/utf/utf_normalizer.php b/phpBB/includes/utf/utf_normalizer.php
index a77952499a..bbb23a6617 100644
--- a/phpBB/includes/utf/utf_normalizer.php
+++ b/phpBB/includes/utf/utf_normalizer.php
@@ -1,10 +1,13 @@
<?php
/**
*
-* @package utf
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -63,8 +66,6 @@ define('UNICODE_JAMO_T', 2);
/**
* Unicode normalization routines
-*
-* @package utf
*/
class utf_normalizer
{
@@ -77,7 +78,7 @@ class utf_normalizer
* @param string &$str The dirty string
* @return string The same string, all shiny and cleaned-up
*/
- function cleanup(&$str)
+ static function cleanup(&$str)
{
// The string below is the list of all autorized characters, sorted by frequency in latin text
$pos = strspn($str, "\x20\x65\x69\x61\x73\x6E\x74\x72\x6F\x6C\x75\x64\x5D\x5B\x63\x6D\x70\x27\x0A\x67\x7C\x68\x76\x2E\x66\x62\x2C\x3A\x3D\x2D\x71\x31\x30\x43\x32\x2A\x79\x78\x29\x28\x4C\x39\x41\x53\x2F\x50\x22\x45\x6A\x4D\x49\x6B\x33\x3E\x35\x54\x3C\x44\x34\x7D\x42\x7B\x38\x46\x77\x52\x36\x37\x55\x47\x4E\x3B\x4A\x7A\x56\x23\x48\x4F\x57\x5F\x26\x21\x4B\x3F\x58\x51\x25\x59\x5C\x09\x5A\x2B\x7E\x5E\x24\x40\x60\x7F\x0D");
@@ -119,7 +120,7 @@ class utf_normalizer
* @param string &$str Unchecked UTF string
* @return string The string, validated and in normal form
*/
- function nfc(&$str)
+ static function nfc(&$str)
{
$pos = strspn($str, UTF8_ASCII_RANGE);
$len = strlen($str);
@@ -151,7 +152,7 @@ class utf_normalizer
* @param string &$str Unchecked UTF string
* @return string The string, validated and in normal form
*/
- function nfkc(&$str)
+ static function nfkc(&$str)
{
$pos = strspn($str, UTF8_ASCII_RANGE);
$len = strlen($str);
@@ -183,7 +184,7 @@ class utf_normalizer
* @param string &$str Unchecked UTF string
* @return string The string, validated and in normal form
*/
- function nfd(&$str)
+ static function nfd(&$str)
{
$pos = strspn($str, UTF8_ASCII_RANGE);
$len = strlen($str);
@@ -209,7 +210,7 @@ class utf_normalizer
* @param string &$str Unchecked UTF string
* @return string The string, validated and in normal form
*/
- function nfkd(&$str)
+ static function nfkd(&$str)
{
$pos = strspn($str, UTF8_ASCII_RANGE);
$len = strlen($str);
@@ -242,7 +243,7 @@ class utf_normalizer
*
* @access private
*/
- function recompose($str, $pos, $len, &$qc, &$decomp_map)
+ static function recompose($str, $pos, $len, &$qc, &$decomp_map)
{
global $utf_combining_class, $utf_canonical_comp, $utf_jamo_type, $utf_jamo_index;
@@ -480,7 +481,6 @@ class utf_normalizer
continue;
}
-
// STEP 1: Decompose current char
// We have found a character that is either:
@@ -528,7 +528,6 @@ class utf_normalizer
$utf_seq = array($utf_char);
}
-
// STEP 2: Capture the starter
// Check out the combining class of the first character of the UTF sequence
@@ -684,7 +683,6 @@ class utf_normalizer
}
}
-
// STEP 3: Capture following combining modifiers
while ($pos < $len)
@@ -753,7 +751,6 @@ class utf_normalizer
}
}
-
// STEP 4: Sort and combine
// Here we sort...
@@ -944,7 +941,7 @@ class utf_normalizer
*
* @access private
*/
- function decompose($str, $pos, $len, &$decomp_map)
+ static function decompose($str, $pos, $len, &$decomp_map)
{
global $utf_combining_class;
@@ -992,7 +989,6 @@ class utf_normalizer
$tmp_pos = $last_cc = $sort = $dump = 0;
$utf_sort = array();
-
// Main loop
do
{
@@ -1048,7 +1044,6 @@ class utf_normalizer
continue;
}
-
// STEP 1: Decide what to do with current char
// Now, in that order:
@@ -1512,5 +1507,3 @@ class utf_normalizer
return $str;
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/utf/utf_tools.php b/phpBB/includes/utf/utf_tools.php
index 6f3ac93305..e60a40a195 100644
--- a/phpBB/includes/utf/utf_tools.php
+++ b/phpBB/includes/utf/utf_tools.php
@@ -1,10 +1,13 @@
<?php
/**
*
-* @package utf
-* @version $Id$
-* @copyright (c) 2006 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -24,7 +27,6 @@ setlocale(LC_CTYPE, 'C');
* Whenever possible, these functions will try to use PHP's built-in functions or
* extensions, otherwise they will default to custom routines.
*
-* @package utf
*/
if (!extension_loaded('xml'))
@@ -109,70 +111,26 @@ if (extension_loaded('mbstring'))
/**
* UTF-8 aware alternative to strrpos
* Find position of last occurrence of a char in a string
- *
- * Notes:
- * - offset for mb_strrpos was added in 5.2.0, we emulate if it is lower
*/
- if (version_compare(PHP_VERSION, '5.2.0', '>='))
+ /**
+ * UTF-8 aware alternative to strrpos
+ * @ignore
+ */
+ function utf8_strrpos($str, $needle, $offset = null)
{
- /**
- * UTF-8 aware alternative to strrpos
- * @ignore
- */
- function utf8_strrpos($str, $needle, $offset = null)
+ // Emulate behaviour of strrpos rather than raising warning
+ if (empty($str))
{
- // Emulate behaviour of strrpos rather than raising warning
- if (empty($str))
- {
- return false;
- }
+ return false;
+ }
- if (is_null($offset))
- {
- return mb_strrpos($str, $needle);
- }
- else
- {
- return mb_strrpos($str, $needle, $offset);
- }
+ if (is_null($offset))
+ {
+ return mb_strrpos($str, $needle);
}
- }
- else
- {
- /**
- * UTF-8 aware alternative to strrpos
- * @ignore
- */
- function utf8_strrpos($str, $needle, $offset = null)
+ else
{
- // offset for mb_strrpos was added in 5.2.0
- if (is_null($offset))
- {
- // Emulate behaviour of strrpos rather than raising warning
- if (empty($str))
- {
- return false;
- }
-
- return mb_strrpos($str, $needle);
- }
- else
- {
- if (!is_int($offset))
- {
- trigger_error('utf8_strrpos expects parameter 3 to be long', E_USER_ERROR);
- return false;
- }
-
- $str = mb_substr($str, $offset);
-
- if (false !== ($pos = mb_strrpos($str, $needle)))
- {
- return $pos + $offset;
- }
-
- return false;
- }
+ return mb_strrpos($str, $needle, $offset);
}
}
@@ -576,7 +534,7 @@ else
return '';
}
- $lx = (int)((-$length) / 65535);
+ $lx = (int) ((-$length) / 65535);
$ly = (-$length) % 65535;
// negative length requires ... capture everything
@@ -1756,49 +1714,106 @@ function utf8_case_fold_nfc($text, $option = 'full')
return $text;
}
-/**
-* A wrapper function for the normalizer which takes care of including the class if required and modifies the passed strings
-* to be in NFC (Normalization Form Composition).
-*
-* @param mixed $strings a string or an array of strings to normalize
-* @return mixed the normalized content, preserving array keys if array given.
-*/
-function utf8_normalize_nfc($strings)
+if (extension_loaded('intl'))
{
- if (empty($strings))
+ /**
+ * wrapper around PHP's native normalizer from intl
+ * previously a PECL extension, included in the core since PHP 5.3.0
+ * http://php.net/manual/en/normalizer.normalize.php
+ *
+ * @param mixed $strings a string or an array of strings to normalize
+ * @return mixed the normalized content, preserving array keys if array given.
+ */
+ function utf8_normalize_nfc($strings)
{
- return $strings;
- }
+ if (empty($strings))
+ {
+ return $strings;
+ }
- if (!class_exists('utf_normalizer'))
- {
- global $phpbb_root_path, $phpEx;
- include($phpbb_root_path . 'includes/utf/utf_normalizer.' . $phpEx);
- }
+ if (!is_array($strings))
+ {
+ if (Normalizer::isNormalized($strings))
+ {
+ return $strings;
+ }
+ return (string) Normalizer::normalize($strings);
+ }
+ else
+ {
+ foreach ($strings as $key => $string)
+ {
+ if (is_array($string))
+ {
+ foreach ($string as $_key => $_string)
+ {
+ if (Normalizer::isNormalized($strings[$key][$_key]))
+ {
+ continue;
+ }
+ $strings[$key][$_key] = (string) Normalizer::normalize($strings[$key][$_key]);
+ }
+ }
+ else
+ {
+ if (Normalizer::isNormalized($strings[$key]))
+ {
+ continue;
+ }
+ $strings[$key] = (string) Normalizer::normalize($strings[$key]);
+ }
+ }
+ }
- if (!is_array($strings))
- {
- utf_normalizer::nfc($strings);
+ return $strings;
}
- else if (is_array($strings))
+}
+else
+{
+ /**
+ * A wrapper function for the normalizer which takes care of including the class if
+ * required and modifies the passed strings to be in NFC (Normalization Form Composition).
+ *
+ * @param mixed $strings a string or an array of strings to normalize
+ * @return mixed the normalized content, preserving array keys if array given.
+ */
+ function utf8_normalize_nfc($strings)
{
- foreach ($strings as $key => $string)
+ if (empty($strings))
+ {
+ return $strings;
+ }
+
+ if (!class_exists('utf_normalizer'))
+ {
+ global $phpbb_root_path, $phpEx;
+ include($phpbb_root_path . 'includes/utf/utf_normalizer.' . $phpEx);
+ }
+
+ if (!is_array($strings))
+ {
+ utf_normalizer::nfc($strings);
+ }
+ else if (is_array($strings))
{
- if (is_array($string))
+ foreach ($strings as $key => $string)
{
- foreach ($string as $_key => $_string)
+ if (is_array($string))
{
- utf_normalizer::nfc($strings[$key][$_key]);
+ foreach ($string as $_key => $_string)
+ {
+ utf_normalizer::nfc($strings[$key][$_key]);
+ }
+ }
+ else
+ {
+ utf_normalizer::nfc($strings[$key]);
}
- }
- else
- {
- utf_normalizer::nfc($strings[$key]);
}
}
- }
- return $strings;
+ return $strings;
+ }
}
/**
@@ -1921,7 +1936,7 @@ function utf8_wordwrap($string, $width = 75, $break = "\n", $cut = false)
* UTF8-safe basename() function
*
* basename() has some limitations and is dependent on the locale setting
-* according to the PHP manual. Therefore we provide our own locale independant
+* according to the PHP manual. Therefore we provide our own locale independent
* basename function.
*
* @param string $filename The filename basename() should be applied to
@@ -1991,5 +2006,3 @@ function utf8_str_replace($search, $replace, $subject)
return $subject;
}
-
-?> \ No newline at end of file
diff --git a/phpBB/index.php b/phpBB/index.php
index 46694a6ec2..e4c03949c1 100644
--- a/phpBB/index.php
+++ b/phpBB/index.php
@@ -1,10 +1,13 @@
<?php
/**
*
-* @package phpBB3
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -25,28 +28,64 @@ $user->session_begin();
$auth->acl($user->data);
$user->setup('viewforum');
-display_forums('', $config['load_moderators']);
+// Mark notifications read
+if (($mark_notification = $request->variable('mark_notification', 0)))
+{
+ if ($user->data['user_id'] == ANONYMOUS)
+ {
+ if ($request->is_ajax())
+ {
+ trigger_error('LOGIN_REQUIRED');
+ }
+ login_box('', $user->lang['LOGIN_REQUIRED']);
+ }
+
+ if (check_link_hash($request->variable('hash', ''), 'mark_notification_read'))
+ {
+ $phpbb_notifications = $phpbb_container->get('notification_manager');
+
+ $notification = $phpbb_notifications->load_notifications(array(
+ 'notification_id' => $mark_notification,
+ ));
+
+ if (isset($notification['notifications'][$mark_notification]))
+ {
+ $notification = $notification['notifications'][$mark_notification];
+
+ $notification->mark_read();
+
+ if ($request->is_ajax())
+ {
+ $json_response = new \phpbb\json_response();
+ $json_response->send(array(
+ 'success' => true,
+ ));
+ }
+
+ if (($redirect = $request->variable('redirect', '')))
+ {
+ redirect(append_sid($phpbb_root_path . $redirect));
+ }
-// Set some stats, get posts count from forums data if we... hum... retrieve all forums data
-$total_posts = $config['num_posts'];
-$total_topics = $config['num_topics'];
-$total_users = $config['num_users'];
+ redirect($notification->get_redirect_url());
+ }
+ }
+}
-$l_total_user_s = ($total_users == 0) ? 'TOTAL_USERS_ZERO' : 'TOTAL_USERS_OTHER';
-$l_total_post_s = ($total_posts == 0) ? 'TOTAL_POSTS_ZERO' : 'TOTAL_POSTS_OTHER';
-$l_total_topic_s = ($total_topics == 0) ? 'TOTAL_TOPICS_ZERO' : 'TOTAL_TOPICS_OTHER';
+display_forums('', $config['load_moderators']);
+$order_legend = ($config['legend_sort_groupname']) ? 'group_name' : 'group_legend';
// Grab group details for legend display
if ($auth->acl_gets('a_group', 'a_groupadd', 'a_groupdel'))
{
- $sql = 'SELECT group_id, group_name, group_colour, group_type
+ $sql = 'SELECT group_id, group_name, group_colour, group_type, group_legend
FROM ' . GROUPS_TABLE . '
- WHERE group_legend = 1
- ORDER BY group_name ASC';
+ WHERE group_legend > 0
+ ORDER BY ' . $order_legend . ' ASC';
}
else
{
- $sql = 'SELECT g.group_id, g.group_name, g.group_colour, g.group_type
+ $sql = 'SELECT g.group_id, g.group_name, g.group_colour, g.group_type, g.group_legend
FROM ' . GROUPS_TABLE . ' g
LEFT JOIN ' . USER_GROUP_TABLE . ' ug
ON (
@@ -54,9 +93,9 @@ else
AND ug.user_id = ' . $user->data['user_id'] . '
AND ug.user_pending = 0
)
- WHERE g.group_legend = 1
+ WHERE g.group_legend > 0
AND (g.group_type <> ' . GROUP_HIDDEN . ' OR ug.user_id = ' . $user->data['user_id'] . ')
- ORDER BY g.group_name ASC';
+ ORDER BY g.' . $order_legend . ' ASC';
}
$result = $db->sql_query($sql);
@@ -77,51 +116,93 @@ while ($row = $db->sql_fetchrow($result))
}
$db->sql_freeresult($result);
-$legend = implode(', ', $legend);
+$legend = implode($user->lang['COMMA_SEPARATOR'], $legend);
// Generate birthday list if required ...
-$birthday_list = '';
+$birthdays = $birthday_list = array();
if ($config['load_birthdays'] && $config['allow_birthdays'] && $auth->acl_gets('u_viewprofile', 'a_user', 'a_useradd', 'a_userdel'))
{
- $now = phpbb_gmgetdate(time() + $user->timezone + $user->dst);
+ $time = $user->create_datetime();
+ $now = phpbb_gmgetdate($time->getTimestamp() + $time->getOffset());
// Display birthdays of 29th february on 28th february in non-leap-years
$leap_year_birthdays = '';
- if ($now['mday'] == 28 && $now['mon'] == 2 && !$user->format_date(time(), 'L'))
+ if ($now['mday'] == 28 && $now['mon'] == 2 && !$time->format('L'))
{
$leap_year_birthdays = " OR u.user_birthday LIKE '" . $db->sql_escape(sprintf('%2d-%2d-', 29, 2)) . "%'";
}
- $sql = 'SELECT u.user_id, u.username, u.user_colour, u.user_birthday
- FROM ' . USERS_TABLE . ' u
- LEFT JOIN ' . BANLIST_TABLE . " b ON (u.user_id = b.ban_userid)
- WHERE (b.ban_id IS NULL
- OR b.ban_exclude = 1)
+ $sql_ary = array(
+ 'SELECT' => 'u.user_id, u.username, u.user_colour, u.user_birthday',
+ 'FROM' => array(
+ USERS_TABLE => 'u',
+ ),
+ 'LEFT_JOIN' => array(
+ array(
+ 'FROM' => array(BANLIST_TABLE => 'b'),
+ 'ON' => 'u.user_id = b.ban_userid',
+ ),
+ ),
+ 'WHERE' => "(b.ban_id IS NULL OR b.ban_exclude = 1)
AND (u.user_birthday LIKE '" . $db->sql_escape(sprintf('%2d-%2d-', $now['mday'], $now['mon'])) . "%' $leap_year_birthdays)
- AND u.user_type IN (" . USER_NORMAL . ', ' . USER_FOUNDER . ')';
+ AND u.user_type IN (" . USER_NORMAL . ', ' . USER_FOUNDER . ')',
+ );
+
+ /**
+ * Event to modify the SQL query to get birthdays data
+ *
+ * @event core.index_modify_birthdays_sql
+ * @var array now The assoc array with the 'now' local timestamp data
+ * @var array sql_ary The SQL array to get the birthdays data
+ * @var object time The user related Datetime object
+ * @since 3.1.7-RC1
+ */
+ $vars = array('now', 'sql_ary', 'time');
+ extract($phpbb_dispatcher->trigger_event('core.index_modify_birthdays_sql', compact($vars)));
+
+ $sql = $db->sql_build_query('SELECT', $sql_ary);
$result = $db->sql_query($sql);
+ $rows = $db->sql_fetchrowset($result);
+ $db->sql_freeresult($result);
- while ($row = $db->sql_fetchrow($result))
+ foreach ($rows as $row)
{
- $birthday_list .= (($birthday_list != '') ? ', ' : '') . get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']);
+ $birthday_username = get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']);
+ $birthday_year = (int) substr($row['user_birthday'], -4);
+ $birthday_age = ($birthday_year) ? max(0, $now['year'] - $birthday_year) : '';
- if ($age = (int) substr($row['user_birthday'], -4))
- {
- $birthday_list .= ' (' . max(0, $now['year'] - $age) . ')';
- }
+ $birthdays[] = array(
+ 'USERNAME' => $birthday_username,
+ 'AGE' => $birthday_age,
+ );
+
+ // For 3.0 compatibility
+ $birthday_list[] = $birthday_username . (($birthday_age) ? " ({$birthday_age})" : '');
}
- $db->sql_freeresult($result);
+
+ /**
+ * Event to modify the birthdays list
+ *
+ * @event core.index_modify_birthdays_list
+ * @var array birthdays Array with the users birthdays data
+ * @var array rows Array with the birthdays SQL query result
+ * @since 3.1.7-RC1
+ */
+ $vars = array('birthdays', 'rows');
+ extract($phpbb_dispatcher->trigger_event('core.index_modify_birthdays_list', compact($vars)));
+
+ $template->assign_block_vars_array('birthdays', $birthdays);
}
// Assign index specific vars
$template->assign_vars(array(
- 'TOTAL_POSTS' => sprintf($user->lang[$l_total_post_s], $total_posts),
- 'TOTAL_TOPICS' => sprintf($user->lang[$l_total_topic_s], $total_topics),
- 'TOTAL_USERS' => sprintf($user->lang[$l_total_user_s], $total_users),
- 'NEWEST_USER' => sprintf($user->lang['NEWEST_USER'], get_username_string('full', $config['newest_user_id'], $config['newest_username'], $config['newest_user_colour'])),
+ 'TOTAL_POSTS' => $user->lang('TOTAL_POSTS_COUNT', (int) $config['num_posts']),
+ 'TOTAL_TOPICS' => $user->lang('TOTAL_TOPICS', (int) $config['num_topics']),
+ 'TOTAL_USERS' => $user->lang('TOTAL_USERS', (int) $config['num_users']),
+ 'NEWEST_USER' => $user->lang('NEWEST_USER', get_username_string('full', $config['newest_user_id'], $config['newest_username'], $config['newest_user_colour'])),
'LEGEND' => $legend,
- 'BIRTHDAY_LIST' => $birthday_list,
+ 'BIRTHDAY_LIST' => (empty($birthday_list)) ? '' : implode($user->lang['COMMA_SEPARATOR'], $birthday_list),
'FORUM_IMG' => $user->img('forum_read', 'NO_UNREAD_POSTS'),
'FORUM_UNREAD_IMG' => $user->img('forum_unread', 'UNREAD_POSTS'),
@@ -129,19 +210,31 @@ $template->assign_vars(array(
'FORUM_UNREAD_LOCKED_IMG' => $user->img('forum_unread_locked', 'UNREAD_POSTS_LOCKED'),
'S_LOGIN_ACTION' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=login'),
+ 'U_SEND_PASSWORD' => ($config['email_enable']) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=sendpassword') : '',
'S_DISPLAY_BIRTHDAY_LIST' => ($config['load_birthdays']) ? true : false,
+ 'S_INDEX' => true,
- 'U_MARK_FORUMS' => ($user->data['is_registered'] || $config['load_anon_lastread']) ? append_sid("{$phpbb_root_path}index.$phpEx", 'hash=' . generate_link_hash('global') . '&amp;mark=forums') : '',
+ 'U_MARK_FORUMS' => ($user->data['is_registered'] || $config['load_anon_lastread']) ? append_sid("{$phpbb_root_path}index.$phpEx", 'hash=' . generate_link_hash('global') . '&amp;mark=forums&amp;mark_time=' . time()) : '',
'U_MCP' => ($auth->acl_get('m_') || $auth->acl_getf_global('m_')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=main&amp;mode=front', true, $user->session_id) : '')
);
+$page_title = ($config['board_index_text'] !== '') ? $config['board_index_text'] : $user->lang['INDEX'];
+
+/**
+* You can use this event to modify the page title and load data for the index
+*
+* @event core.index_modify_page_title
+* @var string page_title Title of the index page
+* @since 3.1.0-a1
+*/
+$vars = array('page_title');
+extract($phpbb_dispatcher->trigger_event('core.index_modify_page_title', compact($vars)));
+
// Output page
-page_header($user->lang['INDEX']);
+page_header($page_title, true);
$template->set_filenames(array(
'body' => 'index_body.html')
);
page_footer();
-
-?> \ No newline at end of file
diff --git a/phpBB/install/convertors/convert_phpbb20.php b/phpBB/install/convertors/convert_phpbb20.php
index e726695ee9..4aca80188a 100644
--- a/phpBB/install/convertors/convert_phpbb20.php
+++ b/phpBB/install/convertors/convert_phpbb20.php
@@ -1,10 +1,13 @@
<?php
/**
*
-* @package install
-* @version $Id$
-* @copyright (c) 2006 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -22,9 +25,12 @@ if (!defined('IN_PHPBB'))
exit;
}
-include($phpbb_root_path . 'config.' . $phpEx);
+$phpbb_config_php_file = new \phpbb\config_php_file($phpbb_root_path, $phpEx);
+extract($phpbb_config_php_file->get_all());
unset($dbpasswd);
+$dbms = $phpbb_config_php_file->convert_30_dbms_to_31($dbms);
+
/**
* $convertor_data provides some basic information about this convertor which is
* used on the initial list of convertors and to populate the default settings
@@ -32,8 +38,8 @@ unset($dbpasswd);
$convertor_data = array(
'forum_name' => 'phpBB 2.0.x',
'version' => '1.0.3',
- 'phpbb_version' => '3.0.14',
- 'author' => '<a href="https://www.phpbb.com/">phpBB Group</a>',
+ 'phpbb_version' => '3.1.11',
+ 'author' => '<a href="https://www.phpbb.com/">phpBB Limited</a>',
'dbms' => $dbms,
'dbhost' => $dbhost,
'dbport' => $dbport,
@@ -135,7 +141,7 @@ $config_schema = array(
'avatar_max_width' => 'avatar_max_width',
'avatar_max_height' => 'avatar_max_height',
'default_dateformat' => 'phpbb_set_encoding(default_dateformat)',
- 'board_timezone' => 'board_timezone',
+ 'board_timezone' => 'phpbb_convert_timezone(board_timezone)',
'allow_privmsg' => 'not(privmsg_disable)',
'gzip_compress' => 'gzip_compress',
'coppa_enable' => '!is_empty(coppa_mail)',
@@ -340,6 +346,9 @@ if (!$get_info)
update_folder_pm_count();
', '
update_unread_count();
+ ', (defined('MOD_ATTACHMENT')) ? '
+ phpbb_attachment_extension_group_name();
+ ' : '
', '
phpbb_convert_authentication(\'start\');
', '
@@ -398,7 +407,7 @@ if (!$get_info)
array('is_orphan', 0, ''),
array('poster_id', 'attachments.user_id_1 AS poster_id', 'phpbb_user_id'),
array('physical_filename', 'attachments_desc.physical_filename', 'import_attachment'),
- array('real_filename', 'attachments_desc.real_filename', ''),
+ array('real_filename', 'attachments_desc.real_filename', 'phpbb_set_encoding'),
array('download_count', 'attachments_desc.download_count', ''),
array('attach_comment', 'attachments_desc.comment', array('function1' => 'phpbb_set_encoding', 'function2' => 'utf8_htmlspecialchars')),
array('extension', 'attachments_desc.extension', ''),
@@ -496,14 +505,17 @@ if (!$get_info)
array('topic_title', 'topics.topic_title', 'phpbb_set_encoding'),
array('topic_time', 'topics.topic_time', ''),
array('topic_views', 'topics.topic_views', ''),
- array('topic_replies', 'topics.topic_replies', ''),
- array('topic_replies_real', 'topics.topic_replies', ''),
+ array('topic_posts_approved', 'topics.topic_replies', 'phpbb_topic_replies_to_posts'),
+ array('topic_posts_unapproved', 0, ''),
+ array('topic_posts_softdeleted',0, ''),
array('topic_last_post_id', 'topics.topic_last_post_id', ''),
array('topic_status', 'topics.topic_status', 'is_topic_locked'),
array('topic_moved_id', 0, ''),
array('topic_type', 'topics.topic_type', 'phpbb_convert_topic_type'),
array('topic_first_post_id', 'topics.topic_first_post_id', ''),
array('topic_last_view_time', 'posts.post_time', 'intval'),
+ array('topic_visibility', ITEM_APPROVED, ''),
+
array('poll_title', 'vote_desc.vote_text', array('function1' => 'null_to_str', 'function2' => 'phpbb_set_encoding', 'function3' => 'htmlspecialchars_decode', 'function4' => 'utf8_htmlspecialchars')),
array('poll_start', 'vote_desc.vote_start', 'null_to_zero'),
array('poll_length', 'vote_desc.vote_length', 'null_to_zero'),
@@ -529,13 +541,15 @@ if (!$get_info)
array('topic_title', 'topics.topic_title', 'phpbb_set_encoding'),
array('topic_time', 'topics.topic_time', ''),
array('topic_views', 'topics.topic_views', ''),
- array('topic_replies', 'topics.topic_replies', ''),
- array('topic_replies_real', 'topics.topic_replies', ''),
+ array('topic_posts_approved', 'topics.topic_replies', 'phpbb_topic_replies_to_posts'),
+ array('topic_posts_unapproved', 0, ''),
+ array('topic_posts_softdeleted',0, ''),
array('topic_last_post_id', 'topics.topic_last_post_id', ''),
array('topic_status', ITEM_MOVED, ''),
array('topic_moved_id', 'topics.topic_moved_id', ''),
array('topic_type', 'topics.topic_type', 'phpbb_convert_topic_type'),
array('topic_first_post_id', 'topics.topic_first_post_id', ''),
+ array('topic_visibility', ITEM_APPROVED, ''),
array('poll_title', 'vote_desc.vote_text', array('function1' => 'null_to_str', 'function2' => 'phpbb_set_encoding', 'function3' => 'htmlspecialchars_decode', 'function4' => 'utf8_htmlspecialchars')),
array('poll_start', 'vote_desc.vote_start', 'null_to_zero'),
@@ -643,6 +657,7 @@ if (!$get_info)
array('post_edit_count', 'posts.post_edit_count', ''),
array('post_edit_reason', '', ''),
array('post_edit_user', '', 'phpbb_post_edit_user'),
+ array('post_visibility', ITEM_APPROVED, ''),
array('bbcode_uid', 'posts.post_time', 'make_uid'),
array('post_text', 'posts_text.post_text', 'phpbb_prepare_message'),
@@ -818,7 +833,10 @@ if (!$get_info)
array(
'target' => GROUPS_TABLE,
'autoincrement' => 'group_id',
- 'query_first' => array('target', $convert->truncate_statement . GROUPS_TABLE),
+ 'query_first' => array(
+ array('target', $convert->truncate_statement . GROUPS_TABLE),
+ array('target', $convert->truncate_statement . TEAMPAGE_TABLE),
+ ),
array('group_id', 'groups.group_id', ''),
array('group_type', 'groups.group_type', 'phpbb_convert_group_type'),
@@ -835,6 +853,7 @@ if (!$get_info)
'query_first' => array('target', $convert->truncate_statement . USER_GROUP_TABLE),
'execute_first' => '
add_default_groups();
+ add_groups_to_teampage();
',
array('group_id', 'groups.group_id', ''),
@@ -862,7 +881,8 @@ if (!$get_info)
'autoincrement' => 'user_id',
'query_first' => array(
array('target', 'DELETE FROM ' . USERS_TABLE . ' WHERE user_id <> ' . ANONYMOUS),
- array('target', $convert->truncate_statement . BOTS_TABLE)
+ array('target', $convert->truncate_statement . BOTS_TABLE),
+ array('target', $convert->truncate_statement . USER_NOTIFICATIONS_TABLE),
),
'execute_last' => '
@@ -876,8 +896,7 @@ if (!$get_info)
array('user_regdate', 'users.user_regdate', ''),
array('username', 'users.username', 'phpbb_set_default_encoding'), // recode to utf8 with default lang
array('username_clean', 'users.username', array('function1' => 'phpbb_set_default_encoding', 'function2' => 'utf8_clean_string')),
- array('user_password', 'users.user_password', 'phpbb_hash'),
- array('user_pass_convert', 1, ''),
+ array('user_password', 'users.user_password', 'phpbb_convert_password_hash'),
array('user_posts', 'users.user_posts', 'intval'),
array('user_email', 'users.user_email', 'strtolower'),
array('user_email_hash', 'users.user_email', 'gen_email_hash'),
@@ -886,20 +905,12 @@ if (!$get_info)
array('user_lastmark', 'users.user_lastvisit', 'intval'),
array('user_lang', $config['default_lang'], ''),
array('', 'users.user_lang', ''),
- array('user_timezone', 'users.user_timezone', 'floatval'),
+ array('user_timezone', 'users.user_timezone', 'phpbb_convert_timezone'),
array('user_dateformat', 'users.user_dateformat', array('function1' => 'phpbb_set_encoding', 'function2' => 'fill_dateformat')),
array('user_inactive_reason', '', 'phpbb_inactive_reason'),
array('user_inactive_time', '', 'phpbb_inactive_time'),
- array('user_interests', 'users.user_interests', array('function1' => 'phpbb_set_encoding')),
- array('user_occ', 'users.user_occ', array('function1' => 'phpbb_set_encoding')),
- array('user_website', 'users.user_website', 'validate_website'),
array('user_jabber', '', ''),
- array('user_msnm', 'users.user_msnm', array('function1' => 'phpbb_set_encoding')),
- array('user_yim', 'users.user_yim', array('function1' => 'phpbb_set_encoding')),
- array('user_aim', 'users.user_aim', array('function1' => 'phpbb_set_encoding')),
- array('user_icq', 'users.user_icq', array('function1' => 'phpbb_set_encoding')),
- array('user_from', 'users.user_from', array('function1' => 'phpbb_set_encoding')),
array('user_rank', 'users.user_rank', 'intval'),
array('user_permissions', '', ''),
@@ -935,10 +946,30 @@ if (!$get_info)
array('user_sig_bbcode_bitfield', '', 'get_bbcode_bitfield'),
array('', 'users.user_regdate AS post_time', ''),
+ array('', 'users.user_notify_pm', 'phpbb_add_notification_options'),
+
+ 'where' => 'users.user_id <> -1',
+ ),
+
+ array(
+ 'target' => PROFILE_FIELDS_DATA_TABLE,
+ 'primary' => 'users.user_id',
+ 'query_first' => array(
+ array('target', $convert->truncate_statement . PROFILE_FIELDS_DATA_TABLE),
+ ),
+
+ array('user_id', 'users.user_id', 'phpbb_user_id'),
+ array('pf_phpbb_occupation', 'users.user_occ', array('function1' => 'phpbb_set_encoding')),
+ array('pf_phpbb_interests', 'users.user_interests', array('function1' => 'phpbb_set_encoding')),
+ array('pf_phpbb_location', 'users.user_from', array('function1' => 'phpbb_set_encoding')),
+ array('pf_phpbb_icq', 'users.user_icq', array('function1' => 'phpbb_set_encoding')),
+ array('pf_phpbb_wlm', 'users.user_msnm', array('function1' => 'phpbb_set_encoding')),
+ array('pf_phpbb_yahoo', 'users.user_yim', array('function1' => 'phpbb_set_encoding')),
+ array('pf_phpbb_aol', 'users.user_aim', array('function1' => 'phpbb_set_encoding')),
+ array('pf_phpbb_website', 'users.user_website', 'validate_website'),
+
'where' => 'users.user_id <> -1',
),
),
);
}
-
-?> \ No newline at end of file
diff --git a/phpBB/install/convertors/functions_phpbb20.php b/phpBB/install/convertors/functions_phpbb20.php
index 466f57a572..817c007274 100644
--- a/phpBB/install/convertors/functions_phpbb20.php
+++ b/phpBB/install/convertors/functions_phpbb20.php
@@ -1,10 +1,13 @@
<?php
/**
*
-* @package install
-* @version $Id$
-* @copyright (c) 2006 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -14,7 +17,7 @@ if (!defined('IN_PHPBB'))
}
/**
-* Helper functions for phpBB 2.0.x to phpBB 3.0.x conversion
+* Helper functions for phpBB 2.0.x to phpBB 3.1.x conversion
*/
/**
@@ -72,7 +75,6 @@ function phpbb_insert_forums()
$prune_enabled = (int) $src_db->sql_fetchfield('config_value');
$src_db->sql_freeresult($result);
-
// Insert categories
$sql = 'SELECT cat_id, cat_title
FROM ' . $convert->src_table_prefix . 'categories
@@ -90,7 +92,7 @@ function phpbb_insert_forums()
$src_db->sql_query("SET NAMES 'utf8'");
}
- switch ($db->sql_layer)
+ switch ($db->get_sql_layer())
{
case 'mssql':
case 'mssql_odbc':
@@ -221,7 +223,7 @@ function phpbb_insert_forums()
'forum_desc' => htmlspecialchars(phpbb_set_default_encoding($row['forum_desc']), ENT_COMPAT, 'UTF-8'),
'forum_type' => FORUM_POST,
'forum_status' => is_item_locked($row['forum_status']),
- 'enable_prune' => ($prune_enabled) ? (int)$row['prune_enable'] : 0,
+ 'enable_prune' => ($prune_enabled) ? (int) $row['prune_enable'] : 0,
'prune_next' => (int) null_to_zero($row['prune_next']),
'prune_days' => (int) null_to_zero($row['prune_days']),
'prune_viewed' => 0,
@@ -244,9 +246,12 @@ function phpbb_insert_forums()
'forum_rules_options' => 7,
'forum_rules_uid' => '',
'forum_topics_per_page' => 0,
- 'forum_posts' => 0,
- 'forum_topics' => 0,
- 'forum_topics_real' => 0,
+ 'forum_posts_approved' => 0,
+ 'forum_posts_unapproved' => 0,
+ 'forum_posts_softdeleted' => 0,
+ 'forum_topics_approved' => 0,
+ 'forum_topics_unapproved' => 0,
+ 'forum_topics_softdeleted' => 0,
'forum_last_post_id' => 0,
'forum_last_poster_id' => 0,
'forum_last_post_subject' => '',
@@ -284,7 +289,7 @@ function phpbb_insert_forums()
}
$src_db->sql_freeresult($result);
- switch ($db->sql_layer)
+ switch ($db->get_sql_layer())
{
case 'postgres':
$db->sql_query("SELECT SETVAL('" . FORUMS_TABLE . "_seq',(select case when max(forum_id)>0 then max(forum_id)+1 else 1 end from " . FORUMS_TABLE . '));');
@@ -458,7 +463,7 @@ function phpbb_get_birthday($birthday = '')
{
$birthday = (int) $birthday;
- if (!$birthday || $birthday == 999999 || ((version_compare(PHP_VERSION, '5.1.0') < 0) && $birthday < 0))
+ if (!$birthday || $birthday == 999999)
{
return ' 0- 0- 0';
}
@@ -538,6 +543,15 @@ function phpbb_user_id($user_id)
return (int) $user_id;
}
+/**
+* Return correct user id value
+* Everyone's id will be one higher to allow the guest/anonymous user to have a positive id as well
+*/
+function phpbb_topic_replies_to_posts($num_replies)
+{
+ return (int) $num_replies + 1;
+}
+
/* Copy additional table fields from old forum to new forum if user wants this (for Mod compatibility for example)
function phpbb_copy_table_fields()
{
@@ -560,7 +574,6 @@ function phpbb_convert_authentication($mode)
// What we will do is handling all 2.0.x admins as founder to replicate what is common in 2.0.x.
// After conversion the main admin need to make sure he is removing permissions and the founder status if wanted.
-
// Grab user ids of users with user_level of ADMIN
$sql = "SELECT user_id
FROM {$convert->src_table_prefix}users
@@ -1404,6 +1417,55 @@ function phpbb_attachment_category($cat_id)
}
/**
+* Convert the attachment extension names
+* This is only used if the Attachment MOD was installed
+*/
+function phpbb_attachment_extension_group_name()
+{
+ global $db, $phpbb_root_path, $phpEx;
+
+ // Update file extension group names to use language strings.
+ $sql = 'SELECT lang_dir
+ FROM ' . LANG_TABLE;
+ $result = $db->sql_query($sql);
+
+ $extension_groups_updated = array();
+ while ($lang_dir = $db->sql_fetchfield('lang_dir'))
+ {
+ $lang_dir = basename($lang_dir);
+ $lang_file = $phpbb_root_path . 'language/' . $lang_dir . '/acp/attachments.' . $phpEx;
+
+ if (!file_exists($lang_file))
+ {
+ continue;
+ }
+
+ $lang = array();
+ include($lang_file);
+
+ foreach ($lang as $lang_key => $lang_val)
+ {
+ if (isset($extension_groups_updated[$lang_key]) || strpos($lang_key, 'EXT_GROUP_') !== 0)
+ {
+ continue;
+ }
+
+ $sql_ary = array(
+ 'group_name' => substr($lang_key, 10), // Strip off 'EXT_GROUP_'
+ );
+
+ $sql = 'UPDATE ' . EXTENSION_GROUPS_TABLE . '
+ SET ' . $db->sql_build_array('UPDATE', $sql_ary) . "
+ WHERE group_name = '" . $db->sql_escape($lang_val) . "'";
+ $db->sql_query($sql);
+
+ $extension_groups_updated[$lang_key] = true;
+ }
+ }
+ $db->sql_freeresult($result);
+}
+
+/**
* Obtain list of forums in which different attachment categories can be used
*/
function phpbb_attachment_forum_perms($forum_permissions)
@@ -1706,7 +1768,7 @@ function phpbb_create_userconv_table()
global $db, $src_db, $convert, $table_prefix, $user, $lang;
$map_dbms = '';
- switch ($db->sql_layer)
+ switch ($db->get_sql_layer())
{
case 'mysql':
$map_dbms = 'mysql_40';
@@ -1734,7 +1796,7 @@ function phpbb_create_userconv_table()
break;
default:
- $map_dbms = $db->sql_layer;
+ $map_dbms = $db->get_sql_layer();
break;
}
@@ -1742,13 +1804,6 @@ function phpbb_create_userconv_table()
$drop_sql = 'DROP TABLE ' . USERCONV_TABLE;
switch ($map_dbms)
{
- case 'firebird':
- $create_sql = 'CREATE TABLE ' . USERCONV_TABLE . ' (
- user_id INTEGER NOT NULL,
- username_clean VARCHAR(255) CHARACTER SET UTF8 DEFAULT \'\' NOT NULL COLLATE UNICODE
- )';
- break;
-
case 'mssql':
$create_sql = 'CREATE TABLE [' . USERCONV_TABLE . '] (
[user_id] [int] NOT NULL ,
@@ -1785,6 +1840,7 @@ function phpbb_create_userconv_table()
break;
case 'sqlite':
+ case 'sqlite3':
$create_sql = 'CREATE TABLE ' . USERCONV_TABLE . ' (
user_id INTEGER NOT NULL DEFAULT \'0\',
username_clean varchar(255) NOT NULL DEFAULT \'\'
@@ -1867,4 +1923,59 @@ function phpbb_check_username_collisions()
$db->sql_query($drop_sql);
}
-?> \ No newline at end of file
+function phpbb_convert_timezone($timezone)
+{
+ global $config, $db, $phpbb_root_path, $phpEx, $table_prefix;
+ $timezone_migration = new \phpbb\db\migration\data\v310\timezone($config, $db, new \phpbb\db\tools($db), $phpbb_root_path, $phpEx, $table_prefix);
+ return $timezone_migration->convert_phpbb30_timezone($timezone, 0);
+}
+
+function phpbb_add_notification_options($user_notify_pm)
+{
+ global $convert_row, $db;
+
+ $user_id = phpbb_user_id($convert_row['user_id']);
+ if ($user_id == ANONYMOUS)
+ {
+ return;
+ }
+
+ $rows = array();
+
+ $rows[] = array(
+ 'item_type' => 'post',
+ 'item_id' => 0,
+ 'user_id' => (int) $user_id,
+ 'notify' => 1,
+ 'method' => 'email',
+ );
+ $rows[] = array(
+ 'item_type' => 'topic',
+ 'item_id' => 0,
+ 'user_id' => (int) $user_id,
+ 'notify' => 1,
+ 'method' => 'email',
+ );
+ if ($user_notify_pm)
+ {
+ $rows[] = array(
+ 'item_type' => 'pm',
+ 'item_id' => 0,
+ 'user_id' => (int) $user_id,
+ 'notify' => 1,
+ 'method' => 'email',
+ );
+ }
+
+ $sql = $db->sql_multi_insert(USER_NOTIFICATIONS_TABLE, $rows);
+}
+
+function phpbb_convert_password_hash($hash)
+{
+ global $phpbb_container;
+
+ $manager = $phpbb_container->get('passwords.manager');
+ $hash = $manager->hash($hash, '$H$');
+
+ return '$CP$' . $hash;
+}
diff --git a/phpBB/install/data/confusables.php b/phpBB/install/data/confusables.php
index c543ddfc81..e3e8c41e62 100644
--- a/phpBB/install/data/confusables.php
+++ b/phpBB/install/data/confusables.php
@@ -1,10 +1,13 @@
<?php
/**
*
-* @package install
-* @version $Id$
-* @copyright (c) 2007 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -646,5 +649,3 @@ function utf8_new_case_fold_nfkc($text, $option = 'full')
}
return array('¡'=>'i','ǃ'=>'!','α'=>'a',' '=>' ','­'=>'','۝'=>'','܏'=>'','᠆'=>'','᠎'=>'','​'=>'','‌'=>'','‍'=>'','
'=>'','
'=>'','⁠'=>'','⁡'=>'','⁢'=>'','⁣'=>'',''=>'',''=>'',''=>'',''=>'',''=>'',''=>'',''=>'',''=>'',''=>'',''=>'',''=>'','𝅳'=>'','𝅴'=>'','𝅵'=>'','𝅶'=>'','𝅷'=>'','𝅸'=>'','𝅹'=>'','𝅺'=>'','۬'=>'۟','̓'=>'̓','ُ'=>'̓','֜'=>'́','́'=>'́','݇'=>'́','॔'=>'́','̀'=>'̀','॓'=>'̀','̌'=>'̆','̑'=>'̂','֯'=>'̊','ஂ'=>'̊','ํ'=>'̊','ໍ'=>'̊','ံ'=>'̊','ំ'=>'̊','៓'=>'̊','゚'=>'̊','゚'=>'̊','ͦ'=>'̊','͂'=>'̃','ׄ'=>'̇','ֹ'=>'̇','ׂ'=>'̇','ׁ'=>'̇','݁'=>'̇','ं'=>'̇','ਂ'=>'̇','ં'=>'̇','்'=>'̇','̅'=>'̄','〬'=>'̉','̱'=>'̠','॒'=>'̠','̧'=>'̡','̦'=>'̡','̨'=>'̢','़'=>'̣','়'=>'̣','਼'=>'̣','઼'=>'̣','଼'=>'̣','͇'=>'̳','̶'=>'̵','ﱞ'=>'ﹲّ','ﱟ'=>'ﹴّ','ﳲ'=>'ﹷّ','ﱠ'=>'ﹶّ','ﳳ'=>'ﹹّ','ﱡ'=>'ﹸّ','ﳴ'=>'ﹻّ','ﱢ'=>'ﹺّ','ﱣ'=>'ﹼٰ','ٴ'=>'ٔ','݂'=>'ܼ','౦'=>'o','೦'=>'o','゙'=>'゙',' '=>' ',' '=>' ',' '=>' ',' '=>' ',' '=>' ',' '=>' ',' '=>' ',' '=>' ',' '=>' ',' '=>' ',' '=>' ',' '=>' ',' '=>' ',' '=>' ',' '=>' ','`'=>'`','`'=>'`','῀'=>'˜','^'=>'^','︿'=>'^','_'=>'_','﹍'=>'_','﹎'=>'_','﹏'=>'_','⌇'=>'︴','-'=>'-','‐'=>'-','‑'=>'-','‒'=>'-','–'=>'-','﹘'=>'-','∼'=>'⁓','・'=>'・','•'=>'・',','=>',','‚'=>',','٬'=>'،','、'=>'、',';'=>';',';'=>';',':'=>':','։'=>':','︰'=>':','׃'=>':','⩴'=>'::=','.'=>'.','․'=>'.','܂'=>'.','‥'=>'..','…'=>'...','。'=>'。','·'=>'·','‧'=>'·','∙'=>'·','⋅'=>'·','ᐧ'=>'·','ᔯ'=>'·4','ᐌ'=>'·ᐁ','ᐎ'=>'·ᐃ','ᐐ'=>'·ᐄ','ᐒ'=>'·ᐅ','ᐔ'=>'·ᐆ','ᐗ'=>'·ᐊ','ᐙ'=>'·ᐋ','ᐷ'=>'·ᐳ','ᑀ'=>'·ᐳ','ᑂ'=>'·ᐴ','ᑄ'=>'·ᐸ','ᑆ'=>'·ᐹ','ᑗ'=>'·ᑌ','ᑙ'=>'·ᑎ','ᑛ'=>'·ᑏ','ᑔ'=>'·ᑐ','ᑝ'=>'·ᑐ','ᑟ'=>'·ᑑ','ᑡ'=>'·ᑕ','ᑣ'=>'·ᑖ','ᑴ'=>'·ᑫ','ᑸ'=>'·ᑮ','ᑼ'=>'·ᑰ','ᑾ'=>'·ᑲ','ᒀ'=>'·ᑳ','ᒒ'=>'·ᒉ','ᒔ'=>'·ᒋ','ᒖ'=>'·ᒌ','ᒚ'=>'·ᒎ','ᒜ'=>'·ᒐ','ᒞ'=>'·ᒑ','ᒬ'=>'·ᒣ','ᒮ'=>'·ᒥ','ᒰ'=>'·ᒦ','ᒲ'=>'·ᒧ','ᒴ'=>'·ᒨ','ᒶ'=>'·L','ᒸ'=>'·ᒫ','ᓉ'=>'·ᓀ','ᓋ'=>'·ᓇ','ᓍ'=>'·ᓈ','ᓜ'=>'·ᓓ','ᓞ'=>'·ᓕ','ᓠ'=>'·ᓖ','ᓢ'=>'·ᓗ','ᓤ'=>'·ᓘ','ᓦ'=>'·ᓚ','ᓨ'=>'·ᓛ','ᓶ'=>'·ᓭ','ᓸ'=>'·ᓯ','ᓺ'=>'·ᓰ','ᓼ'=>'·ᓱ','ᓾ'=>'·ᓲ','ᔀ'=>'·ᓴ','ᔂ'=>'·ᓵ','ᔗ'=>'·ᔐ','ᔙ'=>'·ᔑ','ᔛ'=>'·ᔒ','ᔝ'=>'·ᔓ','ᔟ'=>'·ᔔ','ᔡ'=>'·ᔕ','ᔣ'=>'·ᔖ','ᔱ'=>'·ᔨ','ᔳ'=>'·ᔩ','ᔵ'=>'·ᔪ','ᔷ'=>'·ᔫ','ᔹ'=>'·ᔭ','ᔻ'=>'·ᔮ','ᕎ'=>'·ᕌ','ᕛ'=>'·ᕚ','ᕨ'=>'·ᕧ','('=>'(','⑴'=>'(1)','⒧'=>'(l)','⑽'=>'(10)','⑾'=>'(11)','⑿'=>'(12)','⒀'=>'(13)','⒁'=>'(14)','⒂'=>'(15)','⒃'=>'(16)','⒄'=>'(17)','⒅'=>'(18)','⒆'=>'(19)','⑵'=>'(2)','⒇'=>'(20)','⑶'=>'(3)','⑷'=>'(4)','⑸'=>'(5)','⑹'=>'(6)','⑺'=>'(7)','⑻'=>'(8)','⑼'=>'(9)','⒜'=>'(a)','⒝'=>'(b)','⒞'=>'(c)','⒟'=>'(d)','⒠'=>'(e)','⒡'=>'(f)','⒢'=>'(g)','⒣'=>'(h)','⒤'=>'(i)','⒥'=>'(j)','⒦'=>'(k)','⒨'=>'(m)','⒩'=>'(n)','⒪'=>'(o)','⒫'=>'(p)','⒬'=>'(q)','⒭'=>'(r)','⒮'=>'(s)','⒯'=>'(t)','⒰'=>'(u)','⒱'=>'(v)','⒲'=>'(w)','⒳'=>'(x)','⒴'=>'(y)','⒵'=>'(z)','㈀'=>'(ᄀ)','㈎'=>'(가)','㈁'=>'(ᄂ)','㈏'=>'(나)','㈂'=>'(ᄃ)','㈐'=>'(다)','㈃'=>'(ᄅ)','㈑'=>'(라)','㈄'=>'(ᄆ)','㈒'=>'(마)','㈅'=>'(ᄇ)','㈓'=>'(바)','㈆'=>'(ᄉ)','㈔'=>'(사)','㈇'=>'(ᄋ)','㈕'=>'(아)','㈝'=>'(오전)','㈞'=>'(오후)','㈈'=>'(ᄌ)','㈖'=>'(자)','㈜'=>'(주)','㈉'=>'(ᄎ)','㈗'=>'(차)','㈊'=>'(ᄏ)','㈘'=>'(카)','㈋'=>'(ᄐ)','㈙'=>'(타)','㈌'=>'(ᄑ)','㈚'=>'(파)','㈍'=>'(ᄒ)','㈛'=>'(하)','㈠'=>'(一)','㈦'=>'(七)','㈢'=>'(三)','㈨'=>'(九)','㈡'=>'(二)','㈤'=>'(五)','㈹'=>'(代)','㈽'=>'(企)','㉁'=>'(休)','㈧'=>'(八)','㈥'=>'(六)','㈸'=>'(労)','㈩'=>'(十)','㈿'=>'(協)','㈴'=>'(名)','㈺'=>'(呼)','㈣'=>'(四)','㈯'=>'(土)','㈻'=>'(学)','㈰'=>'(日)','㈪'=>'(月)','㈲'=>'(有)','㈭'=>'(木)','㈱'=>'(株)','㈬'=>'(水)','㈫'=>'(火)','㈵'=>'(特)','㈼'=>'(監)','㈳'=>'(社)','㈷'=>'(祝)','㉀'=>'(祭)','㉂'=>'(自)','㉃'=>'(至)','㈶'=>'(財)','㈾'=>'(資)','㈮'=>'(金)',')'=>')','['=>'[','〔'=>'[',']'=>']','〕'=>']','{'=>'{','}'=>'}','⦅'=>'⦅','⦆'=>'⦆','「'=>'「','」'=>'」','@'=>'@','*'=>'*','/'=>'/','⁄'=>'/','∕'=>'/','\'=>'\\','&'=>'&','#'=>'#','%'=>'%','‶'=>'‵‵','‷'=>'‵‵‵','༌'=>'་','´'=>'ʹ','΄'=>'ʹ','´'=>'ʹ','\''=>'ʹ','''=>'ʹ','′'=>'ʹ','׳'=>'ʹ','ʹ'=>'ʹ','ˊ'=>'ʹ','"'=>'ʹʹ','"'=>'ʹʹ','″'=>'ʹʹ','〃'=>'ʹʹ','״'=>'ʹʹ','ʺ'=>'ʹʹ','‴'=>'ʹʹʹ','⁗'=>'ʹʹʹʹ','¯'=>'ˉ',' ̄'=>'ˉ','‾'=>'ˉ','﹉'=>'ˉ','﹊'=>'ˉ','﹋'=>'ˉ','﹌'=>'ˉ','˚'=>'°','௵'=>'௳','←'=>'←','→'=>'→','↑'=>'↑','↓'=>'↓','↵'=>'↲','⨡'=>'↾','𝛛'=>'∂','𝜕'=>'∂','𝝏'=>'∂','𝞉'=>'∂','𝟃'=>'∂','𝛁'=>'∇','𝛻'=>'∇','𝜵'=>'∇','𝝯'=>'∇','𝞩'=>'∇','+'=>'+','﬩'=>'+','‹'=>'<','<'=>'<','='=>'=','⩵'=>'==','⩶'=>'===','›'=>'>','>'=>'>','¬'=>'¬','¦'=>'¦','〜'=>'~','~'=>'~','﹨'=>'∖','⋀'=>'∧','⋁'=>'∨','⋂'=>'∩','⋃'=>'∪','∯'=>'∮∮','∰'=>'∮∮∮','≣'=>'≡','♁'=>'⊕','☉'=>'⊙','⟂'=>'⊥','▷'=>'⊲','⨝'=>'⋈','⨽'=>'⌙','☸'=>'⎈','⎮'=>'⎥','│'=>'│','▐'=>'▌','■'=>'■','☐'=>'□','○'=>'○','⦾'=>'◎','〛'=>'⟧','〈'=>'⟨','〈'=>'⟨','〉'=>'⟩','〉'=>'⟩','⧙'=>'⦚','〶'=>'〒','ー'=>'ー','¢'=>'¢','$'=>'$','£'=>'£','¥'=>'Y̵','₩'=>'W̵','0'=>'0','𝟎'=>'0','𝟘'=>'0','𝟢'=>'0','𝟬'=>'0','𝟶'=>'0','০'=>'0','୦'=>'0','௦'=>'0','᠐'=>'0','〇'=>'0','𝐎'=>'0','𝑂'=>'0','𝑶'=>'0','𝒪'=>'0','𝓞'=>'0','𝔒'=>'0','𝕆'=>'0','𝕺'=>'0','𝖮'=>'0','𝗢'=>'0','𝘖'=>'0','𝙊'=>'0','𝙾'=>'0','𝚶'=>'0','𝛰'=>'0','𝜪'=>'0','𝝤'=>'0','𝞞'=>'0','ⵔ'=>'0','ഠ'=>'0','⊖'=>'0̵','𝚯'=>'0̵','𝚹'=>'0̵','𝛩'=>'0̵','𝛳'=>'0̵','𝜣'=>'0̵','𝜭'=>'0̵','𝝝'=>'0̵','𝝧'=>'0̵','𝞗'=>'0̵','𝞡'=>'0̵','ⴱ'=>'0̵','Ꮎ'=>'0̵','۰'=>'٠','᭜'=>'᭐','㍘'=>'0点','1'=>'1','𝟏'=>'1','𝟙'=>'1','𝟣'=>'1','𝟭'=>'1','𝟷'=>'1','ℐ'=>'1','ℑ'=>'1','𝐈'=>'1','𝐼'=>'1','𝑰'=>'1','𝓘'=>'1','𝕀'=>'1','𝕴'=>'1','𝖨'=>'1','𝗜'=>'1','𝘐'=>'1','𝙄'=>'1','𝙸'=>'1','l'=>'l','l'=>'l','ⅼ'=>'1','ℓ'=>'l','𝐥'=>'l','𝑙'=>'l','𝒍'=>'l','𝓁'=>'l','𝓵'=>'l','𝔩'=>'l','𝕝'=>'l','𝖑'=>'l','𝗅'=>'l','𝗹'=>'l','𝘭'=>'l','𝙡'=>'l','𝚕'=>'l','𝚰'=>'l','𝛪'=>'l','𝜤'=>'l','𝝞'=>'l','𝞘'=>'l','①'=>'➀','ɭ'=>'l̢','ɫ'=>'l̴','ƚ'=>'l̵','ł'=>'l̷','۱'=>'١','⒈'=>'1.','ŀ'=>'l·','ᒷ'=>'1·','⑩'=>'➉','⒑'=>'10.','㏩'=>'10日','㋉'=>'10月','㍢'=>'10点','⒒'=>'11.','㏪'=>'11日','㋊'=>'11月','㍣'=>'11点','⒓'=>'12.','㏫'=>'12日','㋋'=>'12月','㍤'=>'12点','⒔'=>'13.','㏬'=>'13日','㍥'=>'13点','⒕'=>'14.','㏭'=>'14日','㍦'=>'14点','⒖'=>'15.','㏮'=>'15日','㍧'=>'15点','⒗'=>'16.','㏯'=>'16日','㍨'=>'16点','⒘'=>'17.','㏰'=>'17日','㍩'=>'17点','⒙'=>'18.','㏱'=>'18日','㍪'=>'18点','⒚'=>'19.','㏲'=>'19日','㍫'=>'19点','lj'=>'lj','㏠'=>'1日','㋀'=>'1月','㍙'=>'1点','2'=>'2','𝟐'=>'2','𝟚'=>'2','𝟤'=>'2','𝟮'=>'2','𝟸'=>'2','ᒿ'=>'2','②'=>'➁','۲'=>'٢','⒉'=>'2.','⒛'=>'20.','㏳'=>'20日','㍬'=>'20点','㏴'=>'21日','㍭'=>'21点','㏵'=>'22日','㍮'=>'22点','㏶'=>'23日','㍯'=>'23点','㏷'=>'24日','㍰'=>'24点','㏸'=>'25日','㏹'=>'26日','㏺'=>'27日','㏻'=>'28日','㏼'=>'29日','㏡'=>'2日','㋁'=>'2月','㍚'=>'2点','3'=>'3','𝟑'=>'3','𝟛'=>'3','𝟥'=>'3','𝟯'=>'3','𝟹'=>'3','③'=>'➂','۳'=>'٣','⒊'=>'3.','㏽'=>'30日','㏾'=>'31日','㏢'=>'3日','㋂'=>'3月','㍛'=>'3点','4'=>'4','𝟒'=>'4','𝟜'=>'4','𝟦'=>'4','𝟰'=>'4','𝟺'=>'4','Ꮞ'=>'4','④'=>'➃','⒋'=>'4.','ᔰ'=>'4·','㏣'=>'4日','㋃'=>'4月','㍜'=>'4点','5'=>'5','𝟓'=>'5','𝟝'=>'5','𝟧'=>'5','𝟱'=>'5','𝟻'=>'5','⑤'=>'➄','⒌'=>'5.','㏤'=>'5日','㋄'=>'5月','㍝'=>'5点','6'=>'6','𝟔'=>'6','𝟞'=>'6','𝟨'=>'6','𝟲'=>'6','𝟼'=>'6','б'=>'6','⑥'=>'➅','⒍'=>'6.','㏥'=>'6日','㋅'=>'6月','㍞'=>'6点','7'=>'7','𝟕'=>'7','𝟟'=>'7','𝟩'=>'7','𝟳'=>'7','𝟽'=>'7','⑦'=>'➆','۷'=>'٧','⒎'=>'7.','㏦'=>'7日','㋆'=>'7月','㍟'=>'7点','ଃ'=>'8','৪'=>'8','੪'=>'8','8'=>'8','𝟖'=>'8','𝟠'=>'8','𝟪'=>'8','𝟴'=>'8','𝟾'=>'8','ȣ'=>'8','⑧'=>'➇','۸'=>'٨','⒏'=>'8.','㏧'=>'8日','㋇'=>'8月','㍠'=>'8点','੧'=>'9','୨'=>'9','৭'=>'9','9'=>'9','𝟗'=>'9','𝟡'=>'9','𝟫'=>'9','𝟵'=>'9','𝟿'=>'9','⑨'=>'➈','۹'=>'٩','⒐'=>'9.','㏨'=>'9日','㋈'=>'9月','㍡'=>'9点','a'=>'a','𝐚'=>'a','𝑎'=>'a','𝒂'=>'a','𝒶'=>'a','𝓪'=>'a','𝔞'=>'a','𝕒'=>'a','𝖆'=>'a','𝖺'=>'a','𝗮'=>'a','𝘢'=>'a','𝙖'=>'a','𝚊'=>'a','℀'=>'a/c','℁'=>'a/s','æ'=>'ae','b'=>'b','𝐛'=>'b','𝑏'=>'b','𝒃'=>'b','𝒷'=>'b','𝓫'=>'b','𝔟'=>'b','𝕓'=>'b','𝖇'=>'b','𝖻'=>'b','𝗯'=>'b','𝘣'=>'b','𝙗'=>'b','𝚋'=>'b','ɓ'=>'b̔','ƃ'=>'b̄','ƀ'=>'b̵','c'=>'c','ⅽ'=>'c','𝐜'=>'c','𝑐'=>'c','𝒄'=>'c','𝒸'=>'c','𝓬'=>'c','𝔠'=>'c','𝕔'=>'c','𝖈'=>'c','𝖼'=>'c','𝗰'=>'c','𝘤'=>'c','𝙘'=>'c','𝚌'=>'c','𝛓'=>'c','𝜍'=>'c','𝝇'=>'c','𝞁'=>'c','𝞻'=>'c','℅'=>'c/o','℆'=>'c/u','d'=>'d','ⅾ'=>'d','ⅆ'=>'d','𝐝'=>'d','𝑑'=>'d','𝒅'=>'d','𝒹'=>'d','𝓭'=>'d','𝔡'=>'d','𝕕'=>'d','𝖉'=>'d','𝖽'=>'d','𝗱'=>'d','𝘥'=>'d','𝙙'=>'d','𝚍'=>'d','ɗ'=>'d̔','ƌ'=>'d̄','ɖ'=>'d̢','đ'=>'d̵','dz'=>'dz','dž'=>'dž','e'=>'e','ℯ'=>'e','ⅇ'=>'e','𝐞'=>'e','𝑒'=>'e','𝒆'=>'e','𝓮'=>'e','𝔢'=>'e','𝕖'=>'e','𝖊'=>'e','𝖾'=>'e','𝗲'=>'e','𝘦'=>'e','𝙚'=>'e','𝚎'=>'e','ⴹ'=>'E','ə'=>'ǝ','ɚ'=>'ǝ˞','⋴'=>'ɛ','𝛆'=>'ɛ','𝛜'=>'ɛ','𝜀'=>'ɛ','𝜖'=>'ɛ','𝜺'=>'ɛ','𝝐'=>'ɛ','𝝴'=>'ɛ','𝞊'=>'ɛ','𝞮'=>'ɛ','𝟄'=>'ɛ','f'=>'f','𝐟'=>'f','𝑓'=>'f','𝒇'=>'f','𝒻'=>'f','𝓯'=>'f','𝔣'=>'f','𝕗'=>'f','𝖋'=>'f','𝖿'=>'f','𝗳'=>'f','𝘧'=>'f','𝙛'=>'f','𝚏'=>'f','ƒ'=>'f̡','g'=>'g','ℊ'=>'g','𝐠'=>'g','𝑔'=>'g','𝒈'=>'g','𝓰'=>'g','𝔤'=>'g','𝕘'=>'g','𝖌'=>'g','𝗀'=>'g','𝗴'=>'g','𝘨'=>'g','𝙜'=>'g','𝚐'=>'g','ɡ'=>'g','ɠ'=>'g̔','ǥ'=>'g̵','h'=>'h','ℎ'=>'h','𝐡'=>'h','𝒉'=>'h','𝒽'=>'h','𝓱'=>'h','𝔥'=>'h','𝕙'=>'h','𝖍'=>'h','𝗁'=>'h','𝗵'=>'h','𝘩'=>'h','𝙝'=>'h','𝚑'=>'h','ɦ'=>'h̔','ħ'=>'h̵','ℏ'=>'h̵','῾'=>'ʻ','‘'=>'ʻ','‛'=>'ʻ','ʽ'=>'ʻ','⍳'=>'i','i'=>'i','ⅰ'=>'i','ℹ'=>'i','ⅈ'=>'i','𝐢'=>'i','𝑖'=>'i','𝒊'=>'i','𝒾'=>'i','𝓲'=>'i','𝔦'=>'i','𝕚'=>'i','𝖎'=>'i','𝗂'=>'i','𝗶'=>'i','𝘪'=>'i','𝙞'=>'i','𝚒'=>'i','ı'=>'i','𝚤'=>'i','ɪ'=>'i','ɩ'=>'i','𝛊'=>'i','𝜄'=>'i','𝜾'=>'i','𝝸'=>'i','𝞲'=>'i','ɨ'=>'i̵','ⅱ'=>'ii','ⅲ'=>'iii','ij'=>'ij','ⅳ'=>'iv','ⅸ'=>'ix','j'=>'j','ⅉ'=>'j','𝐣'=>'j','𝑗'=>'j','𝒋'=>'j','𝒿'=>'j','𝓳'=>'j','𝔧'=>'j','𝕛'=>'j','𝖏'=>'j','𝗃'=>'j','𝗷'=>'j','𝘫'=>'j','𝙟'=>'j','𝚓'=>'j','ϳ'=>'j','𝚥'=>'ȷ','k'=>'k','𝐤'=>'k','𝑘'=>'k','𝒌'=>'k','𝓀'=>'k','𝓴'=>'k','𝔨'=>'k','𝕜'=>'k','𝖐'=>'k','𝗄'=>'k','𝗸'=>'k','𝘬'=>'k','𝙠'=>'k','𝚔'=>'k','ƙ'=>'k̔','m'=>'m','ⅿ'=>'m','𝐦'=>'m','𝑚'=>'m','𝒎'=>'m','𝓂'=>'m','𝓶'=>'m','𝔪'=>'m','𝕞'=>'m','𝖒'=>'m','𝗆'=>'m','𝗺'=>'m','𝘮'=>'m','𝙢'=>'m','𝚖'=>'m','ɱ'=>'m̡','n'=>'n','𝐧'=>'n','𝑛'=>'n','𝒏'=>'n','𝓃'=>'n','𝓷'=>'n','𝔫'=>'n','𝕟'=>'n','𝖓'=>'n','𝗇'=>'n','𝗻'=>'n','𝘯'=>'n','𝙣'=>'n','𝚗'=>'n','𝐍'=>'N','𝑁'=>'N','𝑵'=>'N','𝒩'=>'N','𝓝'=>'N','𝔑'=>'N','𝕹'=>'N','𝖭'=>'N','𝗡'=>'N','𝘕'=>'N','𝙉'=>'N','𝙽'=>'N','𝚴'=>'N','𝛮'=>'N','𝜨'=>'N','𝝢'=>'N','𝞜'=>'N','ɲ'=>'ņ','ɳ'=>'n̢','ƞ'=>'n̩','𝛈'=>'n̩','𝜂'=>'n̩','𝜼'=>'n̩','𝝶'=>'n̩','𝞰'=>'n̩','nj'=>'nj','o'=>'o','ℴ'=>'o','𝐨'=>'o','𝑜'=>'o','𝒐'=>'o','𝓸'=>'o','𝔬'=>'o','𝕠'=>'o','𝖔'=>'o','𝗈'=>'o','𝗼'=>'o','𝘰'=>'o','𝙤'=>'o','𝚘'=>'o','ᴏ'=>'o','𝛐'=>'o','𝜊'=>'o','𝝄'=>'o','𝝾'=>'o','𝞸'=>'o','ɵ'=>'o̵','ǿ'=>'ó̵','ø'=>'o̷','œ'=>'oe','ơ'=>'oʼ','⍴'=>'p','p'=>'p','𝐩'=>'p','𝑝'=>'p','𝒑'=>'p','𝓅'=>'p','𝓹'=>'p','𝔭'=>'p','𝕡'=>'p','𝖕'=>'p','𝗉'=>'p','𝗽'=>'p','𝘱'=>'p','𝙥'=>'p','𝚙'=>'p','𝛒'=>'p','𝛠'=>'p','𝜌'=>'p','𝜚'=>'p','𝝆'=>'p','𝝔'=>'p','𝞀'=>'p','𝞎'=>'p','𝞺'=>'p','𝟈'=>'p','ƥ'=>'p̔','q'=>'q','𝐪'=>'q','𝑞'=>'q','𝒒'=>'q','𝓆'=>'q','𝓺'=>'q','𝔮'=>'q','𝕢'=>'q','𝖖'=>'q','𝗊'=>'q','𝗾'=>'q','𝘲'=>'q','𝙦'=>'q','𝚚'=>'q','𝐐'=>'Q','𝑄'=>'Q','𝑸'=>'Q','𝒬'=>'Q','𝓠'=>'Q','𝔔'=>'Q','𝕼'=>'Q','𝖰'=>'Q','𝗤'=>'Q','𝘘'=>'Q','𝙌'=>'Q','𝚀'=>'Q','ʠ'=>'q̔','𝛋'=>'ĸ','𝛞'=>'ĸ','𝜅'=>'ĸ','𝜘'=>'ĸ','𝜿'=>'ĸ','𝝒'=>'ĸ','𝝹'=>'ĸ','𝞌'=>'ĸ','𝞳'=>'ĸ','𝟆'=>'ĸ','r'=>'r','𝐫'=>'r','𝑟'=>'r','𝒓'=>'r','𝓇'=>'r','𝓻'=>'r','𝔯'=>'r','𝕣'=>'r','𝖗'=>'r','𝗋'=>'r','𝗿'=>'r','𝘳'=>'r','𝙧'=>'r','𝚛'=>'r','ɽ'=>'r̢','ɼ'=>'r̩','s'=>'s','𝐬'=>'s','𝑠'=>'s','𝒔'=>'s','𝓈'=>'s','𝓼'=>'s','𝔰'=>'s','𝕤'=>'s','𝖘'=>'s','𝗌'=>'s','𝘀'=>'s','𝘴'=>'s','𝙨'=>'s','𝚜'=>'s','ƽ'=>'s','ʂ'=>'s̢','∫'=>'ʃ','∬'=>'ʃʃ','∭'=>'ʃʃʃ','⨌'=>'ʃʃʃʃ','t'=>'t','𝐭'=>'t','𝑡'=>'t','𝒕'=>'t','𝓉'=>'t','𝓽'=>'t','𝔱'=>'t','𝕥'=>'t','𝖙'=>'t','𝗍'=>'t','𝘁'=>'t','𝘵'=>'t','𝙩'=>'t','𝚝'=>'t','𝑇'=>'T','𝑻'=>'T','𝒯'=>'T','𝓣'=>'T','𝔗'=>'T','𝕋'=>'T','𝕿'=>'T','𝖳'=>'T','𝗧'=>'T','𝘛'=>'T','𝙏'=>'T','𝚃'=>'T','𝚻'=>'T','𝛵'=>'T','𝜯'=>'T','𝝩'=>'T','𝞣'=>'T','ƭ'=>'t̔','ț'=>'ţ','ƫ'=>'ţ','ŧ'=>'t̵','u'=>'u','𝐮'=>'u','𝑢'=>'u','𝒖'=>'u','𝓊'=>'u','𝓾'=>'u','𝔲'=>'u','𝕦'=>'u','𝖚'=>'u','𝗎'=>'u','𝘂'=>'u','𝘶'=>'u','𝙪'=>'u','𝚞'=>'u','ʊ'=>'u','ʋ'=>'u','𝛖'=>'u','𝜐'=>'u','𝝊'=>'u','𝞄'=>'u','𝞾'=>'u','𝑈'=>'U','𝑼'=>'U','𝒰'=>'U','𝓤'=>'U','𝔘'=>'U','𝕌'=>'U','𝖀'=>'U','𝖴'=>'U','𝗨'=>'U','𝘜'=>'U','𝙐'=>'U','𝚄'=>'U','v'=>'v','ⅴ'=>'v','𝐯'=>'v','𝑣'=>'v','𝒗'=>'v','𝓋'=>'v','𝓿'=>'v','𝔳'=>'v','𝕧'=>'v','𝖛'=>'v','𝗏'=>'v','𝘃'=>'v','𝘷'=>'v','𝙫'=>'v','𝚟'=>'v','𝛎'=>'v','𝜈'=>'v','𝝂'=>'v','𝝼'=>'v','𝞶'=>'v','ⅵ'=>'vi','ⅶ'=>'vii','ⅷ'=>'viii','ɯ'=>'w','w'=>'w','𝐰'=>'w','𝑤'=>'w','𝒘'=>'w','𝓌'=>'w','𝔀'=>'w','𝔴'=>'w','𝕨'=>'w','𝖜'=>'w','𝗐'=>'w','𝘄'=>'w','𝘸'=>'w','𝙬'=>'w','𝚠'=>'w','𝑊'=>'W','𝑾'=>'W','𝒲'=>'W','𝓦'=>'W','𝔚'=>'W','𝕎'=>'W','𝖂'=>'W','𝖶'=>'W','𝗪'=>'W','𝘞'=>'W','𝙒'=>'W','𝚆'=>'W','×'=>'x','x'=>'x','ⅹ'=>'x','𝐱'=>'x','𝑥'=>'x','𝒙'=>'x','𝓍'=>'x','𝔁'=>'x','𝔵'=>'x','𝕩'=>'x','𝖝'=>'x','𝗑'=>'x','𝘅'=>'x','𝘹'=>'x','𝙭'=>'x','𝚡'=>'x','᙭'=>'X','𝑋'=>'X','𝑿'=>'X','𝒳'=>'X','𝓧'=>'X','𝔛'=>'X','𝕏'=>'X','𝖃'=>'X','𝖷'=>'X','𝗫'=>'X','𝘟'=>'X','𝙓'=>'X','𝚇'=>'X','𝚾'=>'X','𝛸'=>'X','𝜲'=>'X','𝝬'=>'X','𝞦'=>'X','ⅺ'=>'xi','ⅻ'=>'xii','y'=>'y','𝐲'=>'y','𝑦'=>'y','𝒚'=>'y','𝓎'=>'y','𝔂'=>'y','𝔶'=>'y','𝕪'=>'y','𝖞'=>'y','𝗒'=>'y','𝘆'=>'y','𝘺'=>'y','𝙮'=>'y','𝚢'=>'y','ƴ'=>'y̔','z'=>'z','𝐳'=>'z','𝑧'=>'z','𝒛'=>'z','𝓏'=>'z','𝔃'=>'z','𝔷'=>'z','𝕫'=>'z','𝖟'=>'z','𝗓'=>'z','𝘇'=>'z','𝘻'=>'z','𝙯'=>'z','𝚣'=>'z','ȥ'=>'z̡','ʐ'=>'z̢','ƶ'=>'z̵','ȝ'=>'ʒ','?'=>'ʔ','?'=>'ʔ','⁇'=>'ʔʔ','⁈'=>'ʔǃ','᾽'=>'ʼ','᾿'=>'ʼ','’'=>'ʼ','ʾ'=>'ʼ','!'=>'ǃ','!'=>'ǃ','⁉'=>'ǃʔ','‼'=>'ǃǃ','⍺'=>'α','𝛂'=>'α','𝛼'=>'α','𝜶'=>'α','𝝰'=>'α','𝞪'=>'α','𝛃'=>'β','𝛽'=>'β','𝜷'=>'β','𝝱'=>'β','𝞫'=>'β','ℽ'=>'γ','𝛄'=>'γ','𝛾'=>'γ','𝜸'=>'γ','𝝲'=>'γ','𝞬'=>'γ','𝛅'=>'δ','𝛿'=>'δ','𝜹'=>'δ','𝝳'=>'δ','𝞭'=>'δ','𝟋'=>'ϝ','𝛇'=>'ζ','𝜁'=>'ζ','𝜻'=>'ζ','𝝵'=>'ζ','𝞯'=>'ζ','⍬'=>'θ','𝛉'=>'θ','𝛝'=>'θ','𝜃'=>'θ','𝜗'=>'θ','𝜽'=>'θ','𝝑'=>'θ','𝝷'=>'θ','𝞋'=>'θ','𝞱'=>'θ','𝟅'=>'θ','𝛌'=>'λ','𝜆'=>'λ','𝝀'=>'λ','𝝺'=>'λ','𝞴'=>'λ','𝛬'=>'Λ','𝜦'=>'Λ','𝝠'=>'Λ','𝞚'=>'Λ','𝛍'=>'μ','𝜇'=>'μ','𝝁'=>'μ','𝝻'=>'μ','𝞵'=>'μ','𝛏'=>'ξ','𝜉'=>'ξ','𝝃'=>'ξ','𝝽'=>'ξ','𝞷'=>'ξ','𝛯'=>'Ξ','𝜩'=>'Ξ','𝝣'=>'Ξ','𝞝'=>'Ξ','ℼ'=>'π','𝛑'=>'π','𝛡'=>'π','𝜋'=>'π','𝜛'=>'π','𝝅'=>'π','𝝕'=>'π','𝝿'=>'π','𝞏'=>'π','𝞹'=>'π','𝟉'=>'π','ᴨ'=>'π','∏'=>'Π','𝚷'=>'Π','𝛱'=>'Π','𝜫'=>'Π','𝝥'=>'Π','𝞟'=>'Π','𝛔'=>'σ','𝜎'=>'σ','𝝈'=>'σ','𝞂'=>'σ','𝞼'=>'σ','𝛕'=>'τ','𝜏'=>'τ','𝝉'=>'τ','𝞃'=>'τ','𝞽'=>'τ','𝐘'=>'Y','𝑌'=>'Y','𝒀'=>'Y','𝒴'=>'Y','𝓨'=>'Y','𝔜'=>'Y','𝕐'=>'Y','𝖄'=>'Y','𝖸'=>'Y','𝗬'=>'Y','𝘠'=>'Y','𝙔'=>'Y','𝚈'=>'Y','𝚼'=>'Y','𝛶'=>'Y','𝜰'=>'Y','𝝪'=>'Y','𝞤'=>'Y','𝛗'=>'φ','𝛟'=>'φ','𝜑'=>'φ','𝜙'=>'φ','𝝋'=>'φ','𝝓'=>'φ','𝞅'=>'φ','𝞍'=>'φ','𝞿'=>'φ','𝟇'=>'φ','𝛷'=>'Φ','𝜱'=>'Φ','𝝫'=>'Φ','𝞥'=>'Φ','𝛘'=>'χ','𝜒'=>'χ','𝝌'=>'χ','𝞆'=>'χ','𝟀'=>'χ','𝛙'=>'ψ','𝜓'=>'ψ','𝝍'=>'ψ','𝞇'=>'ψ','𝟁'=>'ψ','𝛹'=>'Ψ','𝜳'=>'Ψ','𝝭'=>'Ψ','𝞧'=>'Ψ','⍵'=>'ω','𝛚'=>'ω','𝜔'=>'ω','𝝎'=>'ω','𝞈'=>'ω','𝟂'=>'ω','ӕ'=>'ae','ғ'=>'r̵','ґ'=>'rᑊ','җ'=>'ж̩','ҙ'=>'з̡','ӏ'=>'i','ҋ'=>'й̡','қ'=>'ĸ̩','ҟ'=>'ĸ̵','ᴫ'=>'л','ӆ'=>'л̡','ӎ'=>'м̡','ӊ'=>'н̡','ӈ'=>'н̡','ң'=>'н̩','ө'=>'o̵','ѳ'=>'o̵','ҫ'=>'c̡','ҭ'=>'т̩','ү'=>'y','ұ'=>'y̵','ћ'=>'h̵','ѽ'=>'ѡ҃','ӌ'=>'ҷ','ҿ'=>'ҽ̢','ҍ'=>'Ь̵','զ'=>'q','ռ'=>'n','ℵ'=>'א','ﬡ'=>'א','אָ'=>'אַ','אּ'=>'אַ','ﭏ'=>'אל','ℶ'=>'ב','ℷ'=>'ג','ℸ'=>'ד','ﬢ'=>'ד','ﬣ'=>'ה','ﬤ'=>'כ','ﬥ'=>'ל','ﬦ'=>'ם','ﬠ'=>'ע','ﬧ'=>'ר','ﬨ'=>'ת','ﺀ'=>'ء','ﺂ'=>'آ','ﺁ'=>'آ','ﺄ'=>'أ','ﺃ'=>'أ','ٵ'=>'أ','ﭑ'=>'ٱ','ﭐ'=>'ٱ','ﺆ'=>'ؤ','ﺅ'=>'ؤ','ٶ'=>'ؤ','ﺈ'=>'إ','ﺇ'=>'إ','ﺋ'=>'ئ','ﺌ'=>'ئ','ﺊ'=>'ئ','ﺉ'=>'ئ','ﯫ'=>'ئا','ﯪ'=>'ئا','ﯸ'=>'ئٻ','ﯷ'=>'ئٻ','ﯶ'=>'ئٻ','ﲗ'=>'ئج','ﰀ'=>'ئج','ﲘ'=>'ئح','ﰁ'=>'ئح','ﲙ'=>'ئخ','ﱤ'=>'ئر','ﱥ'=>'ئز','ﲚ'=>'ئم','ﳟ'=>'ئم','ﱦ'=>'ئم','ﰂ'=>'ئم','ﱧ'=>'ئن','ﲛ'=>'ئه','ﳠ'=>'ئه','ﯭ'=>'ئه','ﯬ'=>'ئه','ﯯ'=>'ئو','ﯮ'=>'ئو','ﯳ'=>'ئۆ','ﯲ'=>'ئۆ','ﯱ'=>'ئۇ','ﯰ'=>'ئۇ','ﯵ'=>'ئۈ','ﯴ'=>'ئۈ','ﯻ'=>'ئى','ﯺ'=>'ئى','ﱨ'=>'ئى','ﯹ'=>'ئى','ﰃ'=>'ئى','ﱩ'=>'ئى','ﰄ'=>'ئى','ﺎ'=>'ا','ﺍ'=>'ا','ﴼ'=>'اً','ﴽ'=>'اً','ﷳ'=>'اكبر','ﷲ'=>'الله','ﺑ'=>'ب','ﺒ'=>'ب','ﺐ'=>'ب','ﺏ'=>'ب','ﲜ'=>'بج','ﰅ'=>'بج','ﲝ'=>'بح','ﰆ'=>'بح','ﷂ'=>'بحى','ﲞ'=>'بخ','ﰇ'=>'بخ','ﶞ'=>'بخى','ﱪ'=>'بر','ﱫ'=>'بز','ﲟ'=>'بم','ﳡ'=>'بم','ﱬ'=>'بم','ﰈ'=>'بم','ﱭ'=>'بن','ﲠ'=>'به','ﳢ'=>'به','ﱮ'=>'بى','ﰉ'=>'بى','ﱯ'=>'بى','ﰊ'=>'بى','ﭔ'=>'ٻ','ﭕ'=>'ٻ','ﭓ'=>'ٻ','ﭒ'=>'ٻ','ې'=>'ٻ','ﯦ'=>'ٻ','ﯧ'=>'ٻ','ﯥ'=>'ٻ','ﯤ'=>'ٻ','ﭘ'=>'پ','ﭙ'=>'پ','ﭗ'=>'پ','ﭖ'=>'پ','ﭜ'=>'ڀ','ﭝ'=>'ڀ','ﭛ'=>'ڀ','ﭚ'=>'ڀ','ﺔ'=>'ة','ﺓ'=>'ة','ﺗ'=>'ت','ﺘ'=>'ت','ﺖ'=>'ت','ﺕ'=>'ت','ﲡ'=>'تج','ﰋ'=>'تج','ﵐ'=>'تجم','ﶠ'=>'تجى','ﶟ'=>'تجى','ﲢ'=>'تح','ﰌ'=>'تح','ﵒ'=>'تحج','ﵑ'=>'تحج','ﵓ'=>'تحم','ﲣ'=>'تخ','ﰍ'=>'تخ','ﵔ'=>'تخم','ﶢ'=>'تخى','ﶡ'=>'تخى','ﱰ'=>'تر','ﱱ'=>'تز','ﲤ'=>'تم','ﳣ'=>'تم','ﱲ'=>'تم','ﰎ'=>'تم','ﵕ'=>'تمج','ﵖ'=>'تمح','ﵗ'=>'تمخ','ﶤ'=>'تمى','ﶣ'=>'تمى','ﱳ'=>'تن','ﲥ'=>'ته','ﳤ'=>'ته','ﱴ'=>'تى','ﰏ'=>'تى','ﱵ'=>'تى','ﰐ'=>'تى','ﺛ'=>'ث','ﺜ'=>'ث','ﺚ'=>'ث','ﺙ'=>'ث','ﰑ'=>'ثج','ﱶ'=>'ثر','ﱷ'=>'ثز','ﲦ'=>'ثم','ﳥ'=>'ثم','ﱸ'=>'ثم','ﰒ'=>'ثم','ﱹ'=>'ثن','ﳦ'=>'ثه','ﱺ'=>'ثى','ﰓ'=>'ثى','ﱻ'=>'ثى','ﰔ'=>'ثى','ﭨ'=>'ٹ','ﭩ'=>'ٹ','ﭧ'=>'ٹ','ﭦ'=>'ٹ','ڻ'=>'ٹ','ﮢ'=>'ٹ','ﮣ'=>'ٹ','ﮡ'=>'ٹ','ﮠ'=>'ٹ','ﭠ'=>'ٺ','ﭡ'=>'ٺ','ﭟ'=>'ٺ','ﭞ'=>'ٺ','ﭤ'=>'ٿ','ﭥ'=>'ٿ','ﭣ'=>'ٿ','ﭢ'=>'ٿ','ﺟ'=>'ج','ﺠ'=>'ج','ﺞ'=>'ج','ﺝ'=>'ج','ﲧ'=>'جح','ﰕ'=>'جح','ﶦ'=>'جحى','ﶾ'=>'جحى','ﷻ'=>'جل جلاله','ﲨ'=>'جم','ﰖ'=>'جم','ﵙ'=>'جمح','ﵘ'=>'جمح','ﶧ'=>'جمى','ﶥ'=>'جمى','ﴝ'=>'جى','ﴁ'=>'جى','ﴞ'=>'جى','ﴂ'=>'جى','ﭸ'=>'ڃ','ﭹ'=>'ڃ','ﭷ'=>'ڃ','ﭶ'=>'ڃ','ﭴ'=>'ڄ','ﭵ'=>'ڄ','ﭳ'=>'ڄ','ﭲ'=>'ڄ','ﭼ'=>'چ','ﭽ'=>'چ','ﭻ'=>'چ','ﭺ'=>'چ','ﮀ'=>'ڇ','ﮁ'=>'ڇ','ﭿ'=>'ڇ','ﭾ'=>'ڇ','ﺣ'=>'ح','ﺤ'=>'ح','ﺢ'=>'ح','ﺡ'=>'ح','ﲩ'=>'حج','ﰗ'=>'حج','ﶿ'=>'حجى','ﲪ'=>'حم','ﰘ'=>'حم','ﵛ'=>'حمى','ﵚ'=>'حمى','ﴛ'=>'حى','ﳿ'=>'حى','ﴜ'=>'حى','ﴀ'=>'حى','ﺧ'=>'خ','ﺨ'=>'خ','ﺦ'=>'خ','ﺥ'=>'خ','ﲫ'=>'خج','ﰙ'=>'خج','ﰚ'=>'خح','ﲬ'=>'خم','ﰛ'=>'خم','ﴟ'=>'خى','ﴃ'=>'خى','ﴠ'=>'خى','ﴄ'=>'خى','ﺪ'=>'د','ﺩ'=>'د','ﺬ'=>'ذ','ﺫ'=>'ذ','ﱛ'=>'ذٰ','ﮉ'=>'ڈ','ﮈ'=>'ڈ','ﮅ'=>'ڌ','ﮄ'=>'ڌ','ﮃ'=>'ڍ','ﮂ'=>'ڍ','ﮇ'=>'ڎ','ﮆ'=>'ڎ','ﺮ'=>'ر','ﺭ'=>'ر','ﱜ'=>'رٰ','ﷶ'=>'رسول','﷼'=>'رىال','ﺰ'=>'ز','ﺯ'=>'ز','ﮍ'=>'ڑ','ﮌ'=>'ڑ','ﮋ'=>'ژ','ﮊ'=>'ژ','ﺳ'=>'س','ﺴ'=>'س','ﺲ'=>'س','ﺱ'=>'س','ﲭ'=>'سج','ﴴ'=>'سج','ﰜ'=>'سج','ﵝ'=>'سجح','ﵞ'=>'سجى','ﲮ'=>'سح','ﴵ'=>'سح','ﰝ'=>'سح','ﵜ'=>'سحج','ﲯ'=>'سخ','ﴶ'=>'سخ','ﰞ'=>'سخ','ﶨ'=>'سخى','ﷆ'=>'سخى','ﴪ'=>'سر','ﴎ'=>'سر','ﲰ'=>'سم','ﳧ'=>'سم','ﰟ'=>'سم','ﵡ'=>'سمج','ﵠ'=>'سمح','ﵟ'=>'سمح','ﵣ'=>'سمم','ﵢ'=>'سمم','ﴱ'=>'سه','ﳨ'=>'سه','ﴗ'=>'سى','ﳻ'=>'سى','ﴘ'=>'سى','ﳼ'=>'سى','ﺷ'=>'ش','ﺸ'=>'ش','ﺶ'=>'ش','ﺵ'=>'ش','ﴭ'=>'شج','ﴷ'=>'شج','ﴥ'=>'شج','ﴉ'=>'شج','ﵩ'=>'شجى','ﴮ'=>'شح','ﴸ'=>'شح','ﴦ'=>'شح','ﴊ'=>'شح','ﵨ'=>'شحم','ﵧ'=>'شحم','ﶪ'=>'شحى','ﴯ'=>'شخ','ﴹ'=>'شخ','ﴧ'=>'شخ','ﴋ'=>'شخ','ﴩ'=>'شر','ﴍ'=>'شر','ﴰ'=>'شم','ﳩ'=>'شم','ﴨ'=>'شم','ﴌ'=>'شم','ﵫ'=>'شمخ','ﵪ'=>'شمخ','ﵭ'=>'شمم','ﵬ'=>'شمم','ﴲ'=>'شه','ﳪ'=>'شه','ﴙ'=>'شى','ﳽ'=>'شى','ﴚ'=>'شى','ﳾ'=>'شى','ﺻ'=>'ص','ﺼ'=>'ص','ﺺ'=>'ص','ﺹ'=>'ص','ﲱ'=>'صح','ﰠ'=>'صح','ﵥ'=>'صحح','ﵤ'=>'صحح','ﶩ'=>'صحى','ﲲ'=>'صخ','ﴫ'=>'صر','ﴏ'=>'صر','ﷵ'=>'صلعم','ﷹ'=>'صلى','ﷺ'=>'صلى الله علىه وسلم','ﷰ'=>'صلے','ﲳ'=>'صم','ﰡ'=>'صم','ﷅ'=>'صمم','ﵦ'=>'صمم','ﴡ'=>'صى','ﴅ'=>'صى','ﴢ'=>'صى','ﴆ'=>'صى','ﺿ'=>'ض','ﻀ'=>'ض','ﺾ'=>'ض','ﺽ'=>'ض','ﲴ'=>'ضج','ﰢ'=>'ضج','ﲵ'=>'ضح','ﰣ'=>'ضح','ﵮ'=>'ضحى','ﶫ'=>'ضحى','ﲶ'=>'ضخ','ﰤ'=>'ضخ','ﵰ'=>'ضخم','ﵯ'=>'ضخم','ﴬ'=>'ضر','ﴐ'=>'ضر','ﲷ'=>'ضم','ﰥ'=>'ضم','ﴣ'=>'ضى','ﴇ'=>'ضى','ﴤ'=>'ضى','ﴈ'=>'ضى','ﻃ'=>'ط','ﻄ'=>'ط','ﻂ'=>'ط','ﻁ'=>'ط','ﲸ'=>'طح','ﰦ'=>'طح','ﴳ'=>'طم','ﴺ'=>'طم','ﰧ'=>'طم','ﵲ'=>'طمح','ﵱ'=>'طمح','ﵳ'=>'طمم','ﵴ'=>'طمى','ﴑ'=>'طى','ﳵ'=>'طى','ﴒ'=>'طى','ﳶ'=>'طى','ﻇ'=>'ظ','ﻈ'=>'ظ','ﻆ'=>'ظ','ﻅ'=>'ظ','ﲹ'=>'ظم','ﴻ'=>'ظم','ﰨ'=>'ظم','ﻋ'=>'ع','ﻌ'=>'ع','ﻊ'=>'ع','ﻉ'=>'ع','ﲺ'=>'عج','ﰩ'=>'عج','ﷄ'=>'عجم','ﵵ'=>'عجم','ﷷ'=>'علىه','ﲻ'=>'عم','ﰪ'=>'عم','ﵷ'=>'عمم','ﵶ'=>'عمم','ﵸ'=>'عمى','ﶶ'=>'عمى','ﴓ'=>'عى','ﳷ'=>'عى','ﴔ'=>'عى','ﳸ'=>'عى','ﻏ'=>'غ','ﻐ'=>'غ','ﻎ'=>'غ','ﻍ'=>'غ','ﲼ'=>'غج','ﰫ'=>'غج','ﲽ'=>'غم','ﰬ'=>'غم','ﵹ'=>'غمم','ﵻ'=>'غمى','ﵺ'=>'غمى','ﴕ'=>'غى','ﳹ'=>'غى','ﴖ'=>'غى','ﳺ'=>'غى','ﻓ'=>'ف','ﻔ'=>'ف','ﻒ'=>'ف','ﻑ'=>'ف','ﲾ'=>'فج','ﰭ'=>'فج','ﲿ'=>'فح','ﰮ'=>'فح','ﳀ'=>'فخ','ﰯ'=>'فخ','ﵽ'=>'فخم','ﵼ'=>'فخم','ﳁ'=>'فم','ﰰ'=>'فم','ﷁ'=>'فمى','ﱼ'=>'فى','ﰱ'=>'فى','ﱽ'=>'فى','ﰲ'=>'فى','ﭬ'=>'ڤ','ﭭ'=>'ڤ','ﭫ'=>'ڤ','ﭪ'=>'ڤ','ﭰ'=>'ڦ','ﭱ'=>'ڦ','ﭯ'=>'ڦ','ﭮ'=>'ڦ','ﻗ'=>'ق','ﻘ'=>'ق','ﻖ'=>'ق','ﻕ'=>'ق','ﳂ'=>'قح','ﰳ'=>'قح','ﷱ'=>'قلے','ﳃ'=>'قم','ﰴ'=>'قم','ﶴ'=>'قمح','ﵾ'=>'قمح','ﵿ'=>'قمم','ﶲ'=>'قمى','ﱾ'=>'قى','ﰵ'=>'قى','ﱿ'=>'قى','ﰶ'=>'قى','ﻛ'=>'ك','ﻜ'=>'ك','ﻚ'=>'ك','ﻙ'=>'ك','ک'=>'ك','ﮐ'=>'ك','ﮑ'=>'ك','ﮏ'=>'ك','ﮎ'=>'ك','ﲀ'=>'كا','ﰷ'=>'كا','ﳄ'=>'كج','ﰸ'=>'كج','ﳅ'=>'كح','ﰹ'=>'كح','ﳆ'=>'كخ','ﰺ'=>'كخ','ﳇ'=>'كل','ﳫ'=>'كل','ﲁ'=>'كل','ﰻ'=>'كل','ﳈ'=>'كم','ﳬ'=>'كم','ﲂ'=>'كم','ﰼ'=>'كم','ﷃ'=>'كمم','ﶻ'=>'كمم','ﶷ'=>'كمى','ﲃ'=>'كى','ﰽ'=>'كى','ﲄ'=>'كى','ﰾ'=>'كى','ﯕ'=>'ڭ','ﯖ'=>'ڭ','ﯔ'=>'ڭ','ﯓ'=>'ڭ','ﮔ'=>'گ','ﮕ'=>'گ','ﮓ'=>'گ','ﮒ'=>'گ','ﮜ'=>'ڱ','ﮝ'=>'ڱ','ﮛ'=>'ڱ','ﮚ'=>'ڱ','ﮘ'=>'ڳ','ﮙ'=>'ڳ','ﮗ'=>'ڳ','ﮖ'=>'ڳ','ﻟ'=>'ل','ﻠ'=>'ل','ﻞ'=>'ل','ﻝ'=>'ل','ﻶ'=>'لآ','ﻵ'=>'لآ','ﻸ'=>'لأ','ﻷ'=>'لأ','ﻺ'=>'لإ','ﻹ'=>'لإ','ﻼ'=>'لا','ﻻ'=>'لا','ﳉ'=>'لج','ﰿ'=>'لج','ﶃ'=>'لجج','ﶄ'=>'لجج','ﶺ'=>'لجم','ﶼ'=>'لجم','ﶬ'=>'لجى','ﳊ'=>'لح','ﱀ'=>'لح','ﶵ'=>'لحم','ﶀ'=>'لحم','ﶂ'=>'لحى','ﶁ'=>'لحى','ﳋ'=>'لخ','ﱁ'=>'لخ','ﶆ'=>'لخم','ﶅ'=>'لخم','ﳌ'=>'لم','ﳭ'=>'لم','ﲅ'=>'لم','ﱂ'=>'لم','ﶈ'=>'لمح','ﶇ'=>'لمح','ﶭ'=>'لمى','ﳍ'=>'له','ﲆ'=>'لى','ﱃ'=>'لى','ﲇ'=>'لى','ﱄ'=>'لى','ﻣ'=>'م','ﻤ'=>'م','ﻢ'=>'م','ﻡ'=>'م','ﲈ'=>'ما','ﳎ'=>'مج','ﱅ'=>'مج','ﶌ'=>'مجح','ﶒ'=>'مجخ','ﶍ'=>'مجم','ﷀ'=>'مجى','ﳏ'=>'مح','ﱆ'=>'مح','ﶉ'=>'محج','ﶊ'=>'محم','ﷴ'=>'محمد','ﶋ'=>'محى','ﳐ'=>'مخ','ﱇ'=>'مخ','ﶎ'=>'مخج','ﶏ'=>'مخم','ﶹ'=>'مخى','ﳑ'=>'مم','ﲉ'=>'مم','ﱈ'=>'مم','ﶱ'=>'ممى','ﱉ'=>'مى','ﱊ'=>'مى','ﻧ'=>'ن','ﻨ'=>'ن','ﻦ'=>'ن','ﻥ'=>'ن','ﳒ'=>'نج','ﱋ'=>'نج','ﶸ'=>'نجح','ﶽ'=>'نجح','ﶘ'=>'نجم','ﶗ'=>'نجم','ﶙ'=>'نجى','ﷇ'=>'نجى','ﳓ'=>'نح','ﱌ'=>'نح','ﶕ'=>'نحم','ﶖ'=>'نحى','ﶳ'=>'نحى','ﳔ'=>'نخ','ﱍ'=>'نخ','ﲊ'=>'نر','ﲋ'=>'نز','ﳕ'=>'نم','ﳮ'=>'نم','ﲌ'=>'نم','ﱎ'=>'نم','ﶛ'=>'نمى','ﶚ'=>'نمى','ﲍ'=>'نن','ﳖ'=>'نه','ﳯ'=>'نه','ﲎ'=>'نى','ﱏ'=>'نى','ﲏ'=>'نى','ﱐ'=>'نى','ﮟ'=>'ں','ﮞ'=>'ں','ﻫ'=>'ه','ﻬ'=>'ه','ﻪ'=>'ه','ﻩ'=>'ه','ھ'=>'ه','ﮬ'=>'ه','ﮭ'=>'ه','ﮫ'=>'ه','ﮪ'=>'ه','ہ'=>'ه','ﮨ'=>'ه','ﮩ'=>'ه','ﮧ'=>'ه','ﮦ'=>'ه','ە'=>'ه','ﳙ'=>'هٰ','ﳗ'=>'هج','ﱑ'=>'هج','ﳘ'=>'هم','ﱒ'=>'هم','ﶓ'=>'همج','ﶔ'=>'همم','ﱓ'=>'هى','ﱔ'=>'هى','ﮥ'=>'ۀ','ﮤ'=>'ۀ','ﻮ'=>'و','ﻭ'=>'و','ﷸ'=>'وسلم','ﯡ'=>'ۅ','ﯠ'=>'ۅ','ﯚ'=>'ۆ','ﯙ'=>'ۆ','ﯘ'=>'ۇ','ﯗ'=>'ۇ','ٷ'=>'ۇٔ','ﯝ'=>'ۇٔ','ﯜ'=>'ۈ','ﯛ'=>'ۈ','ﯣ'=>'ۉ','ﯢ'=>'ۉ','ﯟ'=>'ۋ','ﯞ'=>'ۋ','ﯨ'=>'ى','ﯩ'=>'ى','ﻰ'=>'ى','ﻯ'=>'ى','ي'=>'ى','ﻳ'=>'ى','ﻴ'=>'ى','ﻲ'=>'ى','ﻱ'=>'ى','ی'=>'ى','ﯾ'=>'ى','ﯿ'=>'ى','ﯽ'=>'ى','ﯼ'=>'ى','ٸ'=>'ىٔ','ﲐ'=>'ىٰ','ﱝ'=>'ىٰ','ﳚ'=>'ىج','ﱕ'=>'ىج','ﶯ'=>'ىجى','ﳛ'=>'ىح','ﱖ'=>'ىح','ﶮ'=>'ىحى','ﳜ'=>'ىخ','ﱗ'=>'ىخ','ﲑ'=>'ىر','ﲒ'=>'ىز','ﳝ'=>'ىم','ﳰ'=>'ىم','ﲓ'=>'ىم','ﱘ'=>'ىم','ﶝ'=>'ىمم','ﶜ'=>'ىمم','ﶰ'=>'ىمى','ﲔ'=>'ىن','ﳞ'=>'ىه','ﳱ'=>'ىه','ﲕ'=>'ىى','ﱙ'=>'ىى','ﲖ'=>'ىى','ﱚ'=>'ىى','ۧ'=>'ۦ','ﮯ'=>'ے','ﮮ'=>'ے','ﮱ'=>'ۓ','ﮰ'=>'ۓ','∃'=>'ⴺ','आ'=>'अा','ऒ'=>'अाॆ','ओ'=>'अाे','औ'=>'अाै','ऄ'=>'अॆ','ऑ'=>'अॉ','ऍ'=>'एॅ','ऎ'=>'एॆ','ऐ'=>'एे','ई'=>'र्इ','আ'=>'অা','ৠ'=>'ঋৃ','ৡ'=>'ঌৢ','ਉ'=>'ੳੁ','ਊ'=>'ੳੂ','ਆ'=>'ਅਾ','ਐ'=>'ਅੈ','ਔ'=>'ਅੌ','ਇ'=>'ੲਿ','ਈ'=>'ੲੀ','ਏ'=>'ੲੇ','આ'=>'અા','ઑ'=>'અાૅ','ઓ'=>'અાે','ઔ'=>'અાૈ','ઍ'=>'અૅ','એ'=>'અે','ઐ'=>'અૈ','ଆ'=>'ଅା','௮'=>'அ','ர'=>'ஈ','ா'=>'ஈ','௫'=>'ஈு','௨'=>'உ','ஊ'=>'உள','௭'=>'எ','௷'=>'எவ','ஜ'=>'ஐ','௧'=>'க','௪'=>'ச','௬'=>'சு','௲'=>'சூ','௺'=>'நீ','ை'=>'ன','௴'=>'மீ','௰'=>'ய','ௗ'=>'ள','௸'=>'ஷ','ொ'=>'ெஈ','ௌ'=>'ெள','ோ'=>'ேஈ','ౠ'=>'ఋా','ౡ'=>'ఌా','ఔ'=>'ఒౌ','ఓ'=>'ఒౕ','ఢ'=>'డ̣','భ'=>'బ̣','ష'=>'వ̣','హ'=>'వా','మ'=>'వు','ూ'=>'ుా','ౄ'=>'ృా','ೡ'=>'ಌಾ','ಔ'=>'ఒౌ','ഈ'=>'ഇൗ','ഊ'=>'உൗ','ഐ'=>'എെ','ഓ'=>'ഒാ','ഔ'=>'ഒൗ','ൡ'=>'ഞ','൫'=>'ദ്ര','ഌ'=>'നூ','ങ'=>'നூ','൯'=>'ന്','റ'=>'ര','൪'=>'ര്','൮'=>'വ്','ീ'=>'ி','ൂ'=>'ூ','ൃ'=>'ூ','ൈ'=>'െെ','ฃ'=>'ข','ด'=>'ค','ต'=>'ค','ม'=>'ฆ','ซ'=>'ช','ฏ'=>'ฎ','ท'=>'ฑ','ๅ'=>'า','ำ'=>'̊า','แ'=>'เเ','ໜ'=>'ຫນ','ໝ'=>'ຫມ','ຳ'=>'̊າ','ཷ'=>'ྲཱྀ','ཹ'=>'ླཱྀ','၀'=>'o','ឣ'=>'អ','᧐'=>'ᦞ','᭒'=>'ᬍ','᭓'=>'ᬑ','᭘'=>'ᬨ','ᢖ'=>'ᡜ','ᡕ'=>'ᠵ','Ꮢ'=>'Ꭱ','Ꮍ'=>'y','𝐀'=>'A','𝐴'=>'A','𝑨'=>'A','𝒜'=>'A','𝓐'=>'A','𝔄'=>'A','𝔸'=>'A','𝕬'=>'A','𝖠'=>'A','𝗔'=>'A','𝘈'=>'A','𝘼'=>'A','𝙰'=>'A','𝚨'=>'A','𝛢'=>'A','𝜜'=>'A','𝝖'=>'A','𝞐'=>'A','𝐉'=>'J','𝐽'=>'J','𝑱'=>'J','𝒥'=>'J','𝓙'=>'J','𝔍'=>'J','𝕁'=>'J','𝕵'=>'J','𝖩'=>'J','𝗝'=>'J','𝘑'=>'J','𝙅'=>'J','𝙹'=>'J','Ꮷ'=>'J','⋿'=>'E','ℰ'=>'E','𝐄'=>'E','𝐸'=>'E','𝑬'=>'E','𝓔'=>'E','𝔈'=>'E','𝔼'=>'E','𝕰'=>'E','𝖤'=>'E','𝗘'=>'E','𝘌'=>'E','𝙀'=>'E','𝙴'=>'E','𝚬'=>'E','𝛦'=>'E','𝜠'=>'E','𝝚'=>'E','𝞔'=>'E','ℾ'=>'Ꮁ','𝚪'=>'Ꮁ','𝛤'=>'Ꮁ','𝜞'=>'Ꮁ','𝝘'=>'Ꮁ','𝞒'=>'Ꮁ','Ꮤ'=>'w','ℳ'=>'M','𝐌'=>'M','𝑀'=>'M','𝑴'=>'M','𝓜'=>'M','𝔐'=>'M','𝕄'=>'M','𝕸'=>'M','𝖬'=>'M','𝗠'=>'M','𝘔'=>'M','𝙈'=>'M','𝙼'=>'M','𝚳'=>'M','𝛭'=>'M','𝜧'=>'M','𝝡'=>'M','𝞛'=>'M','ℋ'=>'H','ℌ'=>'H','ℍ'=>'H','𝐇'=>'H','𝐻'=>'H','𝑯'=>'H','𝓗'=>'H','𝕳'=>'H','𝖧'=>'H','𝗛'=>'H','𝘏'=>'H','𝙃'=>'H','𝙷'=>'H','𝚮'=>'H','𝛨'=>'H','𝜢'=>'H','𝝜'=>'H','𝞖'=>'H','𝐆'=>'G','𝐺'=>'G','𝑮'=>'G','𝒢'=>'G','𝓖'=>'G','𝔊'=>'G','𝔾'=>'G','𝕲'=>'G','𝖦'=>'G','𝗚'=>'G','𝘎'=>'G','𝙂'=>'G','𝙶'=>'G','Ᏻ'=>'G','ℤ'=>'Z','ℨ'=>'Z','𝐙'=>'Z','𝑍'=>'Z','𝒁'=>'Z','𝒵'=>'Z','𝓩'=>'Z','𝖅'=>'Z','𝖹'=>'Z','𝗭'=>'Z','𝘡'=>'Z','𝙕'=>'Z','𝚉'=>'Z','𝚭'=>'Z','𝛧'=>'Z','𝜡'=>'Z','𝝛'=>'Z','𝞕'=>'Z','𝐒'=>'S','𝑆'=>'S','𝑺'=>'S','𝒮'=>'S','𝓢'=>'S','𝔖'=>'S','𝕊'=>'S','𝕾'=>'S','𝖲'=>'S','𝗦'=>'S','𝘚'=>'S','𝙎'=>'S','𝚂'=>'S','Ꮪ'=>'S','𝐕'=>'V','𝑉'=>'V','𝑽'=>'V','𝒱'=>'V','𝓥'=>'V','𝔙'=>'V','𝕍'=>'V','𝖁'=>'V','𝖵'=>'V','𝗩'=>'V','𝘝'=>'V','𝙑'=>'V','𝚅'=>'V','ℒ'=>'L','𝐋'=>'L','𝐿'=>'L','𝑳'=>'L','𝓛'=>'L','𝔏'=>'L','𝕃'=>'L','𝕷'=>'L','𝖫'=>'L','𝗟'=>'L','𝘓'=>'L','𝙇'=>'L','𝙻'=>'L','∑'=>'C','⅀'=>'C','ℂ'=>'C','ℭ'=>'C','𝐂'=>'C','𝐶'=>'C','𝑪'=>'C','𝒞'=>'C','𝓒'=>'C','𝕮'=>'C','𝖢'=>'C','𝗖'=>'C','𝘊'=>'C','𝘾'=>'C','𝙲'=>'C','𝚺'=>'C','𝛴'=>'C','𝜮'=>'C','𝝨'=>'C','𝞢'=>'C','ℙ'=>'P','𝐏'=>'P','𝑃'=>'P','𝑷'=>'P','𝒫'=>'P','𝓟'=>'P','𝔓'=>'P','𝕻'=>'P','𝖯'=>'P','𝗣'=>'P','𝘗'=>'P','𝙋'=>'P','𝙿'=>'P','𝚸'=>'P','𝛲'=>'P','𝜬'=>'P','𝝦'=>'P','𝞠'=>'P','𝐊'=>'K','𝐾'=>'K','𝑲'=>'K','𝒦'=>'K','𝓚'=>'K','𝔎'=>'K','𝕂'=>'K','𝕶'=>'K','𝖪'=>'K','𝗞'=>'K','𝘒'=>'K','𝙆'=>'K','𝙺'=>'K','𝚱'=>'K','𝛫'=>'K','𝜥'=>'K','𝝟'=>'K','𝞙'=>'K','ℬ'=>'B','𝐁'=>'B','𝐵'=>'B','𝑩'=>'B','𝓑'=>'B','𝔅'=>'B','𝔹'=>'B','𝕭'=>'B','𝖡'=>'B','𝗕'=>'B','𝘉'=>'B','𝘽'=>'B','𝙱'=>'B','𝚩'=>'B','𝛣'=>'B','𝜝'=>'B','𝝗'=>'B','𝞑'=>'B','ᐍ'=>'ᐁ·','∆'=>'ᐃ','𝚫'=>'ᐃ','𝛥'=>'ᐃ','𝜟'=>'ᐃ','𝝙'=>'ᐃ','𝞓'=>'ᐃ','ᐏ'=>'ᐃ·','ᐑ'=>'ᐄ·','ᐓ'=>'ᐅ·','ᐕ'=>'ᐆ·','ᐘ'=>'ᐊ·','ᐚ'=>'ᐋ·','ᓑ'=>'ᐡ','ᑶ'=>'·P','ᑺ'=>'·d','ᒘ'=>'·J','ᑁ'=>'ᐳ·','ᑃ'=>'ᐴ·','ᑅ'=>'ᐸ·','ᑇ'=>'ᐹ·','ˈ'=>'ᑊ','ᑘ'=>'ᑌ·','ᑧ'=>'ᑌᑊ','ᑚ'=>'ᑎ·','ᑨ'=>'ᑎᑊ','ᑜ'=>'ᑏ·','ᑞ'=>'ᑐ·','ᑩ'=>'ᑐᑊ','ᑠ'=>'ᑑ·','ᑢ'=>'ᑕ·','ᑪ'=>'ᑕᑊ','ᑤ'=>'ᑖ·','ᑵ'=>'ᑫ·','ᒅ'=>'ᑫᑊ','ᑷ'=>'P·','ᒆ'=>'Pᑊ','ᑹ'=>'ᑮ·','ᑻ'=>'d·','ᒇ'=>'dᑊ','ᑽ'=>'ᑰ·','ᑿ'=>'ᑲ·','ᒈ'=>'ᑲᑊ','ᒁ'=>'ᑳ·','ᘃ'=>'ᒉ','ᒓ'=>'ᒉ·','ᒕ'=>'ᒋ·','ᒗ'=>'ᒌ·','ᒙ'=>'J·','ᒛ'=>'ᒎ·','ᘂ'=>'ᒐ','ᒝ'=>'ᒐ·','ᒟ'=>'ᒑ·','ᒭ'=>'ᒣ·','ᒯ'=>'ᒥ·','ᒱ'=>'ᒦ·','ᒳ'=>'ᒧ·','ᒵ'=>'ᒨ·','ᒹ'=>'ᒫ·','ᓊ'=>'ᓀ·','ᓌ'=>'ᓇ·','ᓎ'=>'ᓈᒫ','ᘄ'=>'ᓓ','ᓝ'=>'ᓓ·','ᓟ'=>'ᓕ·','ᓡ'=>'ᓖ·','ᓣ'=>'ᓗ·','ᓥ'=>'ᓘ·','ᘇ'=>'ᓚ','ᓧ'=>'ᓚ·','ᓩ'=>'ᓛ·','ᓷ'=>'ᓭ·','ᓹ'=>'ᓯ·','ᓻ'=>'ᓰ·','ᓽ'=>'ᓱ·','ᓿ'=>'ᓲ·','ᔁ'=>'ᓴ·','ᔃ'=>'ᓵ·','ᔌ'=>'ᔋᐸ','ᔍ'=>'ᔋᑕ','ᔎ'=>'ᔋᑲ','ᔏ'=>'ᔋᒐ','ᔘ'=>'ᔐ·','ᔚ'=>'ᔑ·','ᔜ'=>'ᔒ·','ᔞ'=>'ᔓ·','ᔠ'=>'ᔔ·','ᔢ'=>'ᔕ·','ᔤ'=>'ᔖ·','ᔲ'=>'ᔨ·','ᔴ'=>'ᔩ·','ᔶ'=>'ᔪ·','ᔸ'=>'ᔫ·','ᔺ'=>'ᔭ·','ᔼ'=>'ᔮ·','᙮'=>'x','ᕽ'=>'x','ᘢ'=>'ᕃ','ᘣ'=>'ᕆ','ᘤ'=>'ᕊ','ᕏ'=>'ᕌ·','ᙯ'=>'ᕐᑫ','ᕾ'=>'ᕐᑬ','ᕿ'=>'ᕐP','ᖀ'=>'ᕐᑮ','ᖁ'=>'ᕐd','ᖂ'=>'ᕐᑰ','ᖃ'=>'ᕐᑲ','ᖄ'=>'ᕐᑳ','ᖅ'=>'ᕐᒃ','ᕜ'=>'ᕚ·','ᕩ'=>'ᕧ·','ℛ'=>'R','ℜ'=>'R','ℝ'=>'R','𝐑'=>'R','𝑅'=>'R','𝑹'=>'R','𝓡'=>'R','𝕽'=>'R','𝖱'=>'R','𝗥'=>'R','𝘙'=>'R','𝙍'=>'R','𝚁'=>'R','ᙰ'=>'ᖕᒉ','ᖎ'=>'ᖕᒊ','ᖏ'=>'ᖕᒋ','ᖐ'=>'ᖕᒌ','ᖑ'=>'ᖕJ','ᖒ'=>'ᖕᒎ','ᖓ'=>'ᖕᒐ','ᖔ'=>'ᖕᒑ','ᙱ'=>'ᖖᒋ','ᙲ'=>'ᖖᒌ','ᙳ'=>'ᖖJ','ᙴ'=>'ᖖᒎ','ᙵ'=>'ᖖᒐ','ᙶ'=>'ᖖᒑ','ℱ'=>'F','𝐅'=>'F','𝐹'=>'F','𝑭'=>'F','𝓕'=>'F','𝔉'=>'F','𝔽'=>'F','𝕱'=>'F','𝖥'=>'F','𝗙'=>'F','𝘍'=>'F','𝙁'=>'F','𝙵'=>'F','𝟊'=>'F','ⅅ'=>'D','𝐃'=>'D','𝐷'=>'D','𝑫'=>'D','𝒟'=>'D','𝓓'=>'D','𝔇'=>'D','𝔻'=>'D','𝕯'=>'D','𝖣'=>'D','𝗗'=>'D','𝘋'=>'D','𝘿'=>'D','𝙳'=>'D','ᗪ'=>'D','℧'=>'ᘮ','ᘴ'=>'ᘮ','𝛀'=>'ᘯ','𝛺'=>'ᘯ','𝜴'=>'ᘯ','𝝮'=>'ᘯ','𝞨'=>'ᘯ','ᘵ'=>'ᘯ','ㄱ'=>'ᄀ','ᄀ'=>'ᄀ','ᆨ'=>'ᄀ','ㄲ'=>'ᄁ','ᄁ'=>'ᄁ','ᆩ'=>'ᄁ','ㄴ'=>'ᄂ','ᄂ'=>'ᄂ','ᆫ'=>'ᄂ','ㄷ'=>'ᄃ','ᄃ'=>'ᄃ','ᆮ'=>'ᄃ','ㄸ'=>'ᄄ','ᄄ'=>'ᄄ','ㄹ'=>'ᄅ','ᄅ'=>'ᄅ','ᆯ'=>'ᄅ','ㅁ'=>'ᄆ','ᄆ'=>'ᄆ','ᆷ'=>'ᄆ','ㅂ'=>'ᄇ','ᄇ'=>'ᄇ','ᆸ'=>'ᄇ','ㅃ'=>'ᄈ','ᄈ'=>'ᄈ','ㅅ'=>'ᄉ','ᄉ'=>'ᄉ','ᆺ'=>'ᄉ','ㅆ'=>'ᄊ','ᄊ'=>'ᄊ','ᆻ'=>'ᄊ','ㅇ'=>'ᄋ','ᄋ'=>'ᄋ','ᆼ'=>'ᄋ','ㅈ'=>'ᄌ','ᄌ'=>'ᄌ','ᆽ'=>'ᄌ','ㅉ'=>'ᄍ','ᄍ'=>'ᄍ','ㅊ'=>'ᄎ','ᄎ'=>'ᄎ','ᆾ'=>'ᄎ','ㅋ'=>'ᄏ','ᄏ'=>'ᄏ','ᆿ'=>'ᄏ','ㅌ'=>'ᄐ','ᄐ'=>'ᄐ','ᇀ'=>'ᄐ','ㅍ'=>'ᄑ','ᄑ'=>'ᄑ','ᇁ'=>'ᄑ','ㅎ'=>'ᄒ','ᄒ'=>'ᄒ','ᇂ'=>'ᄒ','ᇅ'=>'ᄓ','ㅥ'=>'ᄔ','ㅦ'=>'ᄕ','ᇆ'=>'ᄕ','ᇊ'=>'ᄗ','ᇍ'=>'ᄘ','ᇐ'=>'ᄙ','ㅀ'=>'ᄚ','ᄚ'=>'ᄚ','ᄻ'=>'ᄚ','ᆶ'=>'ᄚ','ㅮ'=>'ᄜ','ᇜ'=>'ᄜ','ㅱ'=>'ᄝ','ᇢ'=>'ᄝ','ㅲ'=>'ᄞ','ㅳ'=>'ᄠ','ㅄ'=>'ᄡ','ᄡ'=>'ᄡ','ᆹ'=>'ᄡ','ㅴ'=>'ᄢ','ㅵ'=>'ᄣ','ㅶ'=>'ᄧ','ㅷ'=>'ᄩ','ㅸ'=>'ᄫ','ᇦ'=>'ᄫ','ㅹ'=>'ᄬ','ㅺ'=>'ᄭ','ᇧ'=>'ᄭ','ㅻ'=>'ᄮ','ㅼ'=>'ᄯ','ᇨ'=>'ᄯ','ᇩ'=>'ᄰ','ㅽ'=>'ᄲ','ᇪ'=>'ᄲ','ㅾ'=>'ᄶ','ㅿ'=>'ᅀ','ᇫ'=>'ᅀ','ᇬ'=>'ᅁ','ᇱ'=>'ᅅ','ㆂ'=>'ᅅ','ᇲ'=>'ᅆ','ㆃ'=>'ᅆ','ㆀ'=>'ᅇ','ᇮ'=>'ᅇ','ㆁ'=>'ᅌ','ᇰ'=>'ᅌ','ᇳ'=>'ᅖ','ㆄ'=>'ᅗ','ᇴ'=>'ᅗ','ㆅ'=>'ᅘ','ㆆ'=>'ᅙ','ᇹ'=>'ᅙ','ㅤ'=>'ᅠ','ᅠ'=>'ᅠ','ㅏ'=>'ᅡ','ᅡ'=>'ᅡ','ㅐ'=>'ᅢ','ᅢ'=>'ᅢ','ㅑ'=>'ᅣ','ᅣ'=>'ᅣ','ㅒ'=>'ᅤ','ᅤ'=>'ᅤ','ㅓ'=>'ᅥ','ᅥ'=>'ᅥ','ㅔ'=>'ᅦ','ᅦ'=>'ᅦ','ㅕ'=>'ᅧ','ᅧ'=>'ᅧ','ㅖ'=>'ᅨ','ᅨ'=>'ᅨ','ㅗ'=>'ᅩ','ᅩ'=>'ᅩ','ㅘ'=>'ᅪ','ᅪ'=>'ᅪ','ㅙ'=>'ᅫ','ᅫ'=>'ᅫ','ㅚ'=>'ᅬ','ᅬ'=>'ᅬ','ㅛ'=>'ᅭ','ᅭ'=>'ᅭ','ㅜ'=>'ᅮ','ᅮ'=>'ᅮ','ㅝ'=>'ᅯ','ᅯ'=>'ᅯ','ㅞ'=>'ᅰ','ᅰ'=>'ᅰ','ㅟ'=>'ᅱ','ᅱ'=>'ᅱ','ㅠ'=>'ᅲ','ᅲ'=>'ᅲ','ㅡ'=>'一','ᅳ'=>'一','ㅢ'=>'ᅴ','ᅴ'=>'ᅴ','ㅣ'=>'丨','ᅵ'=>'丨','ㆇ'=>'ᆄ','ᆆ'=>'ᆄ','ㆈ'=>'ᆅ','ㆉ'=>'ᆈ','ㆊ'=>'ᆑ','ㆋ'=>'ᆒ','ㆌ'=>'ᆔ','ㆍ'=>'ᆞ','ㆎ'=>'ᆡ','ㄳ'=>'ᆪ','ᆪ'=>'ᆪ','ㄵ'=>'ᆬ','ᆬ'=>'ᆬ','ㄶ'=>'ᆭ','ᆭ'=>'ᆭ','ㄺ'=>'ᆰ','ᆰ'=>'ᆰ','ㄻ'=>'ᆱ','ᆱ'=>'ᆱ','ㄼ'=>'ᆲ','ᆲ'=>'ᆲ','ㄽ'=>'ᆳ','ᆳ'=>'ᆳ','ㄾ'=>'ᆴ','ᆴ'=>'ᆴ','ㄿ'=>'ᆵ','ᆵ'=>'ᆵ','ㅧ'=>'ᇇ','ㅨ'=>'ᇈ','ㅩ'=>'ᇌ','ㅪ'=>'ᇎ','ㅫ'=>'ᇓ','ㅬ'=>'ᇗ','ㅭ'=>'ᇙ','ㅯ'=>'ᇝ','ㅰ'=>'ᇟ','ァ'=>'ァ','ア'=>'ア','ィ'=>'ィ','イ'=>'イ','ゥ'=>'ゥ','ウ'=>'ウ','ェ'=>'ェ','エ'=>'エ','ォ'=>'ォ','オ'=>'オ','カ'=>'カ','キ'=>'キ','ク'=>'ク','ケ'=>'ケ','コ'=>'コ','サ'=>'サ','シ'=>'シ','ス'=>'ス','セ'=>'セ','ソ'=>'ソ','タ'=>'タ','チ'=>'チ','ッ'=>'ッ','ツ'=>'ツ','テ'=>'テ','ト'=>'ト','ナ'=>'ナ','ニ'=>'ニ','ヌ'=>'ヌ','ネ'=>'ネ','ノ'=>'ノ','ハ'=>'ハ','ヒ'=>'ヒ','フ'=>'フ','ヘ'=>'へ','ホ'=>'ホ','マ'=>'マ','⧄'=>'〼','ミ'=>'ミ','ム'=>'ム','メ'=>'メ','モ'=>'モ','ャ'=>'ャ','ヤ'=>'ヤ','ュ'=>'ュ','ユ'=>'ユ','ョ'=>'ョ','ヨ'=>'ヨ','ラ'=>'ラ','リ'=>'リ','ル'=>'ル','レ'=>'レ','ロ'=>'ロ','ワ'=>'ワ','ヲ'=>'ヲ','ン'=>'ン','꒞'=>'ꁊ','꒬'=>'ꁐ','꒜'=>'ꃀ','꒿'=>'ꉙ','꒾'=>'ꊱ','꓀'=>'ꎫ','꓂'=>'ꎵ','꒺'=>'ꎿ','꒰'=>'ꏂ','𐒠'=>'𐒆','—'=>'一','―'=>'一','−'=>'一','─'=>'一','⼀'=>'一','不'=>'不','並'=>'並','|'=>'丨','|'=>'丨','∣'=>'丨','⼁'=>'丨','‖'=>'丨丨','∥'=>'丨丨','串'=>'串','⼂'=>'丶','丸'=>'丸','丹'=>'丹','丽'=>'丽','⼃'=>'丿','乁'=>'乁','⼄'=>'乙','亂'=>'亂','⼅'=>'亅','了'=>'了','⼆'=>'二','⼇'=>'亠','亮'=>'亮','⼈'=>'人','什'=>'什','仌'=>'仌','令'=>'令','你'=>'你','倂'=>'併','倂'=>'併','侀'=>'侀','來'=>'來','例'=>'例','侮'=>'侮','侮'=>'侮','侻'=>'侻','便'=>'便','值'=>'値','倫'=>'倫','偺'=>'偺','備'=>'備','像'=>'像','僚'=>'僚','僧'=>'僧','僧'=>'僧','⼉'=>'儿','兀'=>'兀','充'=>'充','免'=>'免','免'=>'免','兔'=>'兔','兤'=>'兤','⼊'=>'入','內'=>'內','全'=>'全','兩'=>'兩','⼋'=>'八','六'=>'六','具'=>'具','冀'=>'冀','⼌'=>'冂','再'=>'再','冒'=>'冒','冕'=>'冕','⼍'=>'冖','冗'=>'冗','冤'=>'冤','⼎'=>'冫','冬'=>'冬','况'=>'况','况'=>'况','冷'=>'冷','凉'=>'凉','凌'=>'凌','凜'=>'凜','凞'=>'凞','⼏'=>'几','凵'=>'凵','⼐'=>'凵','⼑'=>'刀','刃'=>'刃','切'=>'切','切'=>'切','列'=>'列','利'=>'利','刺'=>'刺','刻'=>'刻','剆'=>'剆','割'=>'割','剷'=>'剷','劉'=>'劉','力'=>'力','⼒'=>'力','劣'=>'劣','劳'=>'劳','勇'=>'勇','勇'=>'勇','勉'=>'勉','勉'=>'勉','勒'=>'勒','勞'=>'勞','勤'=>'勤','勤'=>'勤','勵'=>'勵','⼓'=>'勹','勺'=>'勺','勺'=>'勺','包'=>'包','匆'=>'匆','⼔'=>'匕','北'=>'北','北'=>'北','⼕'=>'匚','⼖'=>'匸','匿'=>'匿','⼗'=>'十','〸'=>'十','〹'=>'卄','〺'=>'卅','卉'=>'卉','卑'=>'卑','卑'=>'卑','博'=>'博','⼘'=>'卜','⼙'=>'卩','即'=>'即','卵'=>'卵','卽'=>'卽','卿'=>'卿','卿'=>'卿','卿'=>'卿','⼚'=>'厂','⼛'=>'厶','參'=>'參','⼜'=>'又','及'=>'及','叟'=>'叟','⼝'=>'口','句'=>'句','叫'=>'叫','叱'=>'叱','吆'=>'吆','吏'=>'吏','吝'=>'吝','吸'=>'吸','呂'=>'呂','呈'=>'呈','周'=>'周','咞'=>'咞','咢'=>'咢','咽'=>'咽','哶'=>'哶','唐'=>'唐','啓'=>'啓','啟'=>'啓','啕'=>'啕','啣'=>'啣','善'=>'善','善'=>'善','喇'=>'喇','喙'=>'喙','喙'=>'喙','喝'=>'喝','喝'=>'喝','喫'=>'喫','喳'=>'喳','嗀'=>'嗀','嗂'=>'嗂','嗢'=>'嗢','嘆'=>'嘆','嘆'=>'嘆','噑'=>'噑','器'=>'器','噴'=>'噴','⼞'=>'囗','囹'=>'囹','圖'=>'圖','圗'=>'圗','⼟'=>'土','型'=>'型','城'=>'城','埴'=>'埴','堍'=>'堍','報'=>'報','堲'=>'堲','塀'=>'塀','塚'=>'塚','塚'=>'塚','塞'=>'塞','填'=>'塡','墨'=>'墨','壿'=>'墫','墬'=>'墬','墳'=>'墳','壘'=>'壘','壟'=>'壟','⼠'=>'士','壮'=>'壮','売'=>'売','壷'=>'壷','⼡'=>'夂','夆'=>'夆','⼢'=>'夊','⼣'=>'夕','多'=>'多','夢'=>'夢','⼤'=>'大','奄'=>'奄','奈'=>'奈','契'=>'契','奔'=>'奔','奢'=>'奢','女'=>'女','⼥'=>'女','姘'=>'姘','姬'=>'姬','娛'=>'娛','娧'=>'娧','婢'=>'婢','婦'=>'婦','嬀'=>'媯','媵'=>'媵','嬈'=>'嬈','嬨'=>'嬨','嬾'=>'嬾','嬾'=>'嬾','⼦'=>'子','⼧'=>'宀','宅'=>'宅','寃'=>'寃','寘'=>'寘','寧'=>'寧','寧'=>'寧','寧'=>'寧','寮'=>'寮','寳'=>'寳','⼨'=>'寸','寿'=>'寿','将'=>'将','⼩'=>'小','尢'=>'尢','⼪'=>'尢','⼫'=>'尸','尿'=>'尿','屠'=>'屠','屢'=>'屢','層'=>'層','履'=>'履','屮'=>'屮','屮'=>'屮','⼬'=>'屮','⼭'=>'山','岍'=>'岍','峀'=>'峀','崙'=>'崙','嵃'=>'嵃','嵐'=>'嵐','嵫'=>'嵫','嵮'=>'嵮','嵼'=>'嵼','嶲'=>'嶲','嶺'=>'嶺','⼮'=>'巛','巡'=>'巡','巢'=>'巢','⼯'=>'工','⼰'=>'己','巽'=>'巽','⼱'=>'巾','帲'=>'帡','帨'=>'帨','帽'=>'帽','幩'=>'幩','⼲'=>'干','年'=>'年','⼳'=>'幺','⼴'=>'广','度'=>'度','庰'=>'庰','庳'=>'庳','庶'=>'庶','廉'=>'廉','廊'=>'廊','廊'=>'廊','廒'=>'廒','廓'=>'廓','廙'=>'廙','廬'=>'廬','⼵'=>'廴','廾'=>'廾','⼶'=>'廾','弄'=>'弄','⼷'=>'弋','⼸'=>'弓','弢'=>'弢','弢'=>'弢','⼹'=>'彐','当'=>'当','⼺'=>'彡','形'=>'形','彩'=>'彩','彫'=>'彫','⼻'=>'彳','律'=>'律','徚'=>'徚','復'=>'復','徭'=>'徭','⼼'=>'心','忍'=>'忍','志'=>'志','念'=>'念','忹'=>'忹','怒'=>'怒','怜'=>'怜','悁'=>'悁','悔'=>'悔','悔'=>'悔','惇'=>'惇','惘'=>'惘','惡'=>'惡','愈'=>'愈','慄'=>'慄','慈'=>'慈','慌'=>'慌','慌'=>'慌','慎'=>'慎','慎'=>'慎','慠'=>'慠','慨'=>'慨','慺'=>'慺','憎'=>'憎','憎'=>'憎','憎'=>'憎','憐'=>'憐','憤'=>'憤','憯'=>'憯','憲'=>'憲','懞'=>'懞','懲'=>'懲','懲'=>'懲','懲'=>'懲','懶'=>'懶','懶'=>'懶','戀'=>'戀','⼽'=>'戈','成'=>'成','戛'=>'戛','戮'=>'戮','戴'=>'戴','⼾'=>'戶','⼿'=>'手','扝'=>'扝','抱'=>'抱','拉'=>'拉','拏'=>'拏','拓'=>'拓','拔'=>'拔','拼'=>'拼','拾'=>'拾','挽'=>'挽','捐'=>'捐','捨'=>'捨','捻'=>'捻','掃'=>'掃','掠'=>'掠','掩'=>'掩','揄'=>'揄','揅'=>'揅','揤'=>'揤','㩁'=>'搉','搜'=>'搜','搢'=>'搢','摒'=>'摒','摩'=>'摩','摷'=>'摷','摾'=>'摾','撚'=>'撚','撝'=>'撝','擄'=>'擄','⽀'=>'支','⽁'=>'攴','敏'=>'敏','敏'=>'敏','敖'=>'敖','敬'=>'敬','數'=>'數','⽂'=>'文','⽃'=>'斗','料'=>'料','⽄'=>'斤','⽅'=>'方','旅'=>'旅','⽆'=>'无','既'=>'既','旣'=>'旣','⽇'=>'日','易'=>'易','晉'=>'晉','晩'=>'晚','䀿'=>'晣','晴'=>'晴','晴'=>'晴','暈'=>'暈','暑'=>'暑','暑'=>'暑','暜'=>'暜','暴'=>'暴','曆'=>'曆','⽈'=>'曰','更'=>'更','㫚'=>'曶','書'=>'書','最'=>'最','⽉'=>'月','肦'=>'朌','胐'=>'朏','胊'=>'朐','脁'=>'朓','朗'=>'朗','朗'=>'朗','朗'=>'朗','脧'=>'朘','望'=>'望','望'=>'望','朡'=>'朡','膧'=>'朣','⽊'=>'木','李'=>'李','杓'=>'杓','杖'=>'杖','杞'=>'杞','柿'=>'杮','杻'=>'杻','枅'=>'枅','林'=>'林','柳'=>'柳','柺'=>'柺','栗'=>'栗','栟'=>'栟','桒'=>'桒','梁'=>'梁','梅'=>'梅','梅'=>'梅','梎'=>'梎','梨'=>'梨','椔'=>'椔','楂'=>'楂','樧'=>'榝','榣'=>'榣','槪'=>'槪','樂'=>'樂','樂'=>'樂','樂'=>'樂','樓'=>'樓','檨'=>'檨','櫓'=>'櫓','櫛'=>'櫛','欄'=>'欄','⽋'=>'欠','次'=>'次','歔'=>'歔','⽌'=>'止','歲'=>'歲','歷'=>'歷','歹'=>'歹','⽍'=>'歹','殟'=>'殟','殮'=>'殮','⽎'=>'殳','殺'=>'殺','殺'=>'殺','殺'=>'殺','殻'=>'殻','⽏'=>'毋','⺟'=>'母','⽐'=>'比','⽑'=>'毛','⽒'=>'氏','⽓'=>'气','⽔'=>'水','汎'=>'汎','汧'=>'汧','沈'=>'沈','沿'=>'沿','泌'=>'泌','泍'=>'泍','泥'=>'泥','洖'=>'洖','洛'=>'洛','洞'=>'洞','洴'=>'洴','派'=>'派','流'=>'流','流'=>'流','流'=>'流','浩'=>'浩','浪'=>'浪','海'=>'海','海'=>'海','浸'=>'浸','涅'=>'涅','淋'=>'淋','淚'=>'淚','淪'=>'淪','淹'=>'淹','渚'=>'渚','港'=>'港','湮'=>'湮','潙'=>'溈','溜'=>'溜','溺'=>'溺','滇'=>'滇','滋'=>'滋','滋'=>'滋','滑'=>'滑','滛'=>'滛','漏'=>'漏','漢'=>'漢','漢'=>'漢','漣'=>'漣','潮'=>'潮','濆'=>'濆','濫'=>'濫','濾'=>'濾','瀛'=>'瀛','瀞'=>'瀞','瀞'=>'瀞','瀹'=>'瀹','灊'=>'灊','⽕'=>'火','灰'=>'灰','灷'=>'灷','災'=>'災','炙'=>'炙','炭'=>'炭','烈'=>'烈','烙'=>'烙','煅'=>'煅','煉'=>'煉','煮'=>'煮','煮'=>'煮','熜'=>'熜','燎'=>'燎','燐'=>'燐','爐'=>'爐','爛'=>'爛','爨'=>'爨','⽖'=>'爪','爫'=>'爫','⺤'=>'爫','爵'=>'爵','爵'=>'爵','⽗'=>'父','⽘'=>'爻','⽙'=>'爿','⽚'=>'片','牐'=>'牐','⽛'=>'牙','⽜'=>'牛','牢'=>'牢','犀'=>'犀','犕'=>'犕','⽝'=>'犬','犯'=>'犯','狀'=>'狀','狼'=>'狼','猪'=>'猪','猪'=>'猪','獵'=>'獵','獺'=>'獺','⽞'=>'玄','率'=>'率','率'=>'率','⽟'=>'玉','王'=>'王','玥'=>'玥','玲'=>'玲','珞'=>'珞','理'=>'理','琉'=>'琉','琢'=>'琢','瑇'=>'瑇','瑜'=>'瑜','瑩'=>'瑩','瑱'=>'瑱','瑱'=>'瑱','璅'=>'璅','璉'=>'璉','璘'=>'璘','瓊'=>'瓊','⽠'=>'瓜','⽡'=>'瓦','甆'=>'甆','⽢'=>'甘','⽣'=>'生','甤'=>'甤','⽤'=>'用','⽥'=>'田','画'=>'画','甾'=>'甾','留'=>'留','略'=>'略','異'=>'異','異'=>'異','⽦'=>'疋','⽧'=>'疒','痢'=>'痢','瘐'=>'瘐','瘝'=>'瘝','瘟'=>'瘟','療'=>'療','癩'=>'癩','⽨'=>'癶','⽩'=>'白','⽪'=>'皮','⽫'=>'皿','益'=>'益','益'=>'益','盛'=>'盛','盧'=>'盧','⽬'=>'目','直'=>'直','直'=>'直','省'=>'省','眞'=>'眞','真'=>'真','真'=>'真','着'=>'着','睊'=>'睊','睊'=>'睊','瞋'=>'瞋','瞧'=>'瞧','⽭'=>'矛','⽮'=>'矢','⽯'=>'石','硏'=>'研','硎'=>'硎','硫'=>'硫','碌'=>'碌','碌'=>'碌','碑'=>'碑','磊'=>'磊','磌'=>'磌','磌'=>'磌','磻'=>'磻','礪'=>'礪','⽰'=>'示','礼'=>'礼','社'=>'社','祈'=>'祈','祉'=>'祉','祐'=>'祐','祖'=>'祖','祖'=>'祖','祝'=>'祝','神'=>'神','祥'=>'祥','祿'=>'祿','禍'=>'禍','禎'=>'禎','福'=>'福','福'=>'福','禮'=>'禮','⽱'=>'禸','⽲'=>'禾','秊'=>'秊','秫'=>'秫','稜'=>'稜','穀'=>'穀','穀'=>'穀','穊'=>'穊','穏'=>'穏','⽳'=>'穴','突'=>'突','窱'=>'窱','立'=>'立','⽴'=>'立','竮'=>'竮','⽵'=>'竹','笠'=>'笠','節'=>'節','節'=>'節','篆'=>'篆','築'=>'築','簾'=>'簾','籠'=>'籠','⽶'=>'米','类'=>'类','粒'=>'粒','精'=>'精','糒'=>'糒','糖'=>'糖','糣'=>'糣','糧'=>'糧','糨'=>'糨','⽷'=>'糸','紀'=>'紀','紐'=>'紐','索'=>'索','累'=>'累','絶'=>'絕','絛'=>'絛','絣'=>'絣','綠'=>'綠','綾'=>'綾','緇'=>'緇','練'=>'練','練'=>'練','練'=>'練','縂'=>'縂','縉'=>'縉','縷'=>'縷','繁'=>'繁','繅'=>'繅','⽸'=>'缶','缾'=>'缾','⽹'=>'网','⺫'=>'罒','署'=>'署','罹'=>'罹','罺'=>'罺','羅'=>'羅','⽺'=>'羊','羕'=>'羕','羚'=>'羚','羽'=>'羽','⽻'=>'羽','翺'=>'翺','老'=>'老','⽼'=>'老','者'=>'者','者'=>'者','者'=>'者','⽽'=>'而','⽾'=>'耒','⽿'=>'耳','聆'=>'聆','聠'=>'聠','聯'=>'聯','聰'=>'聰','聾'=>'聾','⾀'=>'聿','⾁'=>'肉','肋'=>'肋','肭'=>'肭','育'=>'育','㬵'=>'胶','腁'=>'胼','脃'=>'脃','脾'=>'脾','臘'=>'臘','⾂'=>'臣','臨'=>'臨','⾃'=>'自','臭'=>'臭','⾄'=>'至','⾅'=>'臼','舁'=>'舁','舁'=>'舁','舄'=>'舄','⾆'=>'舌','⾇'=>'舛','⾈'=>'舟','⾉'=>'艮','良'=>'良','⾊'=>'色','⾋'=>'艸','艹'=>'艹','艹'=>'艹','芋'=>'芋','芑'=>'芑','芝'=>'芝','花'=>'花','芳'=>'芳','芽'=>'芽','若'=>'若','若'=>'若','苦'=>'苦','茝'=>'茝','茣'=>'茣','茶'=>'茶','荒'=>'荒','荓'=>'荓','荣'=>'荣','莭'=>'莭','莽'=>'莽','菉'=>'菉','菊'=>'菊','菌'=>'菌','菜'=>'菜','菧'=>'菧','華'=>'華','菱'=>'菱','落'=>'落','葉'=>'葉','著'=>'著','著'=>'著','蔿'=>'蒍','蓮'=>'蓮','蓱'=>'蓱','蓳'=>'蓳','蓼'=>'蓼','蔖'=>'蔖','蕤'=>'蕤','藍'=>'藍','藺'=>'藺','蘆'=>'蘆','蘒'=>'蘒','蘭'=>'蘭','虁'=>'蘷','蘿'=>'蘿','⾌'=>'虍','虐'=>'虐','虜'=>'虜','虜'=>'虜','虧'=>'虧','虩'=>'虩','⾍'=>'虫','蚈'=>'蚈','蚩'=>'蚩','蛢'=>'蛢','蜎'=>'蜎','蜨'=>'蜨','蝫'=>'蝫','蝹'=>'蝹','蝹'=>'蝹','螆'=>'螆','螺'=>'螺','蟡'=>'蟡','蠁'=>'蠁','蠟'=>'蠟','⾎'=>'血','行'=>'行','⾏'=>'行','衠'=>'衠','衣'=>'衣','⾐'=>'衣','裂'=>'裂','裏'=>'裏','裗'=>'裗','裞'=>'裞','裡'=>'裡','裸'=>'裸','裺'=>'裺','褐'=>'褐','襁'=>'襁','襤'=>'襤','⾑'=>'襾','覆'=>'覆','見'=>'見','⾒'=>'見','視'=>'視','視'=>'視','⾓'=>'角','⾔'=>'言','䚶'=>'訞','詽'=>'訮','誠'=>'誠','說'=>'說','說'=>'說','調'=>'調','請'=>'請','諒'=>'諒','論'=>'論','諭'=>'諭','諭'=>'諭','諸'=>'諸','諸'=>'諸','諾'=>'諾','諾'=>'諾','謁'=>'謁','謁'=>'謁','謹'=>'謹','謹'=>'謹','識'=>'識','讀'=>'讀','讏'=>'讆','變'=>'變','變'=>'變','⾕'=>'谷','⾖'=>'豆','豈'=>'豈','豕'=>'豕','⾗'=>'豕','⾘'=>'豸','⾙'=>'貝','貫'=>'貫','賁'=>'賁','賂'=>'賂','賈'=>'賈','賓'=>'賓','贈'=>'贈','贈'=>'贈','贛'=>'贛','⾚'=>'赤','⾛'=>'走','起'=>'起','趆'=>'赿','⾜'=>'足','趼'=>'趼','跋'=>'跋','跺'=>'跥','路'=>'路','跰'=>'跰','躛'=>'躗','⾝'=>'身','車'=>'車','⾞'=>'車','軔'=>'軔','輧'=>'軿','輦'=>'輦','輪'=>'輪','輸'=>'輸','輸'=>'輸','輻'=>'輻','轢'=>'轢','⾟'=>'辛','辞'=>'辞','辰'=>'辰','⾠'=>'辰','⾡'=>'辵','辶'=>'辶','⻌'=>'辶','連'=>'連','逸'=>'逸','逸'=>'逸','遲'=>'遲','遼'=>'遼','邏'=>'邏','⾢'=>'邑','邔'=>'邔','郎'=>'郎','郱'=>'郱','都'=>'都','鄑'=>'鄑','鄛'=>'鄛','⾣'=>'酉','酪'=>'酪','醙'=>'醙','醴'=>'醴','⾤'=>'釆','里'=>'里','⾥'=>'里','量'=>'量','金'=>'金','⾦'=>'金','鈴'=>'鈴','鈸'=>'鈸','鉶'=>'鉶','鉼'=>'鉼','鋗'=>'鋗','鋘'=>'鋘','錄'=>'錄','鍊'=>'鍊','鎮'=>'鎭','鏹'=>'鏹','鐕'=>'鐕','⾧'=>'長','⾨'=>'門','開'=>'開','閭'=>'閭','閷'=>'閷','⾩'=>'阜','阮'=>'阮','陋'=>'陋','降'=>'降','陵'=>'陵','陸'=>'陸','陼'=>'陼','隆'=>'隆','隣'=>'隣','⾪'=>'隶','隸'=>'隸','⾫'=>'隹','雃'=>'雃','離'=>'離','難'=>'難','難'=>'難','⾬'=>'雨','零'=>'零','雷'=>'雷','霣'=>'霣','露'=>'露','靈'=>'靈','⾭'=>'靑','靖'=>'靖','靖'=>'靖','⾮'=>'非','⾯'=>'面','⾰'=>'革','⾱'=>'韋','韛'=>'韛','韠'=>'韠','⾲'=>'韭','⾳'=>'音','響'=>'響','響'=>'響','⾴'=>'頁','頋'=>'頋','頋'=>'頋','頋'=>'頋','領'=>'領','頩'=>'頩','頻'=>'頻','頻'=>'頻','類'=>'類','⾵'=>'風','⾶'=>'飛','⻝'=>'食','⾷'=>'食','飢'=>'飢','飯'=>'飯','飼'=>'飼','館'=>'館','餩'=>'餩','⾸'=>'首','⾹'=>'香','馧'=>'馧','⾺'=>'馬','駂'=>'駂','駱'=>'駱','駾'=>'駾','驪'=>'驪','⾻'=>'骨','⾼'=>'高','⾽'=>'髟','鬒'=>'鬒','鬒'=>'鬒','⾾'=>'鬥','⾿'=>'鬯','⿀'=>'鬲','⿁'=>'鬼','⿂'=>'魚','魯'=>'魯','鱀'=>'鱀','鱗'=>'鱗','⿃'=>'鳥','鳽'=>'鳽','鵧'=>'鵧','鶴'=>'鶴','鷺'=>'鷺','鸞'=>'鸞','鹃'=>'鹂','⿄'=>'鹵','鹿'=>'鹿','⿅'=>'鹿','麗'=>'麗','麟'=>'麟','⿆'=>'麥','麻'=>'麻','⿇'=>'麻','⿈'=>'黃','⿉'=>'黍','黎'=>'黎','⿊'=>'黑','黹'=>'黹','⿋'=>'黹','⿌'=>'黽','黾'=>'黾','鼅'=>'鼅','⿍'=>'鼎','鼏'=>'鼏','⿎'=>'鼓','鼖'=>'鼖','⿏'=>'鼠','鼻'=>'鼻','⿐'=>'鼻','齃'=>'齃','⿑'=>'齊','⿒'=>'齒','龍'=>'龍','⿓'=>'龍','龎'=>'龎','龜'=>'龜','龜'=>'龜','龜'=>'龜','⿔'=>'龜','⻳'=>'龟','⿕'=>'龠','㒞'=>'㒞','㒹'=>'㒹','㒻'=>'㒻','㓟'=>'㓟','㔕'=>'㔕','䎛'=>'㖈','㛮'=>'㛮','㛼'=>'㛼','㞁'=>'㞁','㠯'=>'㠯','㡢'=>'㡢','㡼'=>'㡼','㣇'=>'㣇','㣣'=>'㣣','㤜'=>'㤜','㤺'=>'㤺','㨮'=>'㨮','㩬'=>'㩬','㫤'=>'㫤','㬈'=>'㬈','㬙'=>'㬙','䐠'=>'㬻','㭉'=>'㭉','㮝'=>'㮝','㮝'=>'㮝','㰘'=>'㰘','㱎'=>'㱎','㴳'=>'㴳','㶖'=>'㶖','㺬'=>'㺬','㺸'=>'㺸','㺸'=>'㺸','㼛'=>'㼛','㿼'=>'㿼','䀈'=>'䀈','䀘'=>'䀘','䀹'=>'䀹','䀹'=>'䀹','䁆'=>'䁆','䂖'=>'䂖','䃣'=>'䃣','䄯'=>'䄯','䈂'=>'䈂','䈧'=>'䈧','䊠'=>'䊠','䌁'=>'䌁','䌴'=>'䌴','䍙'=>'䍙','䏕'=>'䏕','䏙'=>'䏙','䐋'=>'䐋','䑫'=>'䑫','䔫'=>'䔫','䕝'=>'䕝','䕡'=>'䕡','䕫'=>'䕫','䗗'=>'䗗','䗹'=>'䗹','䘵'=>'䘵','䚾'=>'䚾','䛇'=>'䛇','䦕'=>'䦕','䧦'=>'䧦','䩮'=>'䩮','䩶'=>'䩶','䪲'=>'䪲','䬳'=>'䬳','䯎'=>'䯎','䳎'=>'䳎','䳭'=>'䳭','䳸'=>'䳸','䵖'=>'䵖','𠄢'=>'𠄢','𠔜'=>'𠔜','𠔥'=>'𠔥','𠕋'=>'𠕋','𠘺'=>'𠘺','𠠄'=>'𠠄','𠣞'=>'𠣞','𠨬'=>'𠨬','𠭣'=>'𠭣','𡓤'=>'𡓤','𡚨'=>'𡚨','𡛪'=>'𡛪','𡧈'=>'𡧈','𡬘'=>'𡬘','𡴋'=>'𡴋','𡷤'=>'𡷤','𡷦'=>'𡷦','𢆃'=>'𢆃','𢆟'=>'𢆟','𢌱'=>'𢌱','𢌱'=>'𢌱','𢛔'=>'𢛔','𢡄'=>'𢡄','𢡊'=>'𢡊','𢬌'=>'𢬌','𢯱'=>'𢯱','𣀊'=>'𣀊','𣊸'=>'𣊸','𣍟'=>'𣍟','𣎓'=>'𣎓','𣎜'=>'𣎜','𣏃'=>'𣏃','𣏕'=>'𣏕','𣑭'=>'𣑭','𣚣'=>'𣚣','𣢧'=>'𣢧','𣪍'=>'𣪍','𣫺'=>'𣫺','𣲼'=>'𣲼','𣴞'=>'𣴞','𣻑'=>'𣻑','𣽞'=>'𣽞','𣾎'=>'𣾎','𤉣'=>'𤉣','𤎫'=>'𤎫','𤘈'=>'𤘈','𤜵'=>'𤜵','𤠔'=>'𤠔','𤰶'=>'𤰶','𤲒'=>'𤲒','𤾡'=>'𤾡','𤾸'=>'𤾸','𥁄'=>'𥁄','𥃲'=>'𥃲','𥃳'=>'𥃳','𥄙'=>'𥄙','𥄳'=>'𥄳','𥉉'=>'𥉉','𥐝'=>'𥐝','𥘦'=>'𥘦','𥚚'=>'𥚚','𥛅'=>'𥛅','𥥼'=>'𥥼','𥪧'=>'𥪧','𥪧'=>'𥪧','𥮫'=>'𥮫','𥲀'=>'𥲀','𥳐'=>'𥳐','𥾆'=>'𥾆','𦇚'=>'𦇚','𦈨'=>'𦈨','𦉇'=>'𦉇','𦋙'=>'𦋙','𦌾'=>'𦌾','𦓚'=>'𦓚','𦔣'=>'𦔣','𦖨'=>'𦖨','𦞧'=>'𦞧','𦞵'=>'𦞵','𦬼'=>'𦬼','𦰶'=>'𦰶','𦳕'=>'𦳕','𦵫'=>'𦵫','𦼬'=>'𦼬','𦾱'=>'𦾱','𧃒'=>'𧃒','𧏊'=>'𧏊','𧙧'=>'𧙧','𧢮'=>'𧢮','𧥦'=>'𧥦','𧲨'=>'𧲨','𧻓'=>'𧻓','𧼯'=>'𧼯','𨗒'=>'𨗒','𨗭'=>'𨗭','𨜮'=>'𨜮','𨯺'=>'𨯺','𨵷'=>'𨵷','𩅅'=>'𩅅','𩇟'=>'𩇟','𩈚'=>'𩈚','𩐊'=>'𩐊','𩒖'=>'𩒖','𩖶'=>'𩖶','𩬰'=>'𩬰','𪃎'=>'𪃎','𪄅'=>'𪄅','𪈎'=>'𪈎','𪊑'=>'𪊑','𪎒'=>'𪎒','𪘀'=>'𪘀','℃'=>'°C','℉'=>'°F','ℇ'=>'Ɛ','℻'=>'FAX','ℕ'=>'N','№'=>'No','ℚ'=>'Q','₨'=>'Rs','𝐓'=>'T','℡'=>'TEL','𝐔'=>'U','𝐖'=>'W','₩'=>'W̵','𝐗'=>'X','¥'=>'Y̵','𝚲'=>'Λ','𝚵'=>'Ξ','ℿ'=>'Π','ϲ'=>'c','ϒ'=>'Y','𝚽'=>'Φ','𝚿'=>'Ψ','ѣ'=>'Ь̵','ਃ'=>'ঃ','ಃ'=>'ః','່'=>'่','់'=>'่','້'=>'้','໊'=>'๊','໋'=>'๋','៕'=>'๚','៚'=>'๛','ъ'=>'ˉb','៙'=>'๏','೧'=>'౧','૨'=>'२','೨'=>'౨','૩'=>'३','૪'=>'४','૮'=>'८','೯'=>'౯','а'=>'a','Ꮟ'=>'b','ᖯ'=>'b','с'=>'c','ԁ'=>'d','ᑯ'=>'d','е'=>'e','ә'=>'ǝ','ε'=>'ɛ','є'=>'ɛ','ք'=>'f','ց'=>'g','һ'=>'h','հ'=>'h','Ꮒ'=>'h','Ᏺ'=>'h̔','ι'=>'i','і'=>'i','Ꭵ'=>'i','ј'=>'j','յ'=>'j','ᗰ'=>'m','ո'=>'n','η'=>'n̩','ం'=>'o','ಂ'=>'o','ം'=>'o','०'=>'o','੦'=>'o','૦'=>'o','๐'=>'o','໐'=>'o','ο'=>'o','о'=>'o','օ'=>'o','ဝ'=>'o','ρ'=>'p','р'=>'p','ᴩ'=>'ᴘ','գ'=>'q','κ'=>'ĸ','к'=>'ĸ','ᴦ'=>'r','г'=>'r','ѕ'=>'s','υ'=>'u','ս'=>'u','ν'=>'v','ѵ'=>'v','Ꮃ'=>'w','ᗯ'=>'w','х'=>'x','ᕁ'=>'x','у'=>'y','Ꭹ'=>'y','ӡ'=>'ʒ','ჳ'=>'ʒ','ϩ'=>'ƨ','ь'=>'ƅ','ы'=>'ƅi','ɑ'=>'α','ծ'=>'δ','ᕷ'=>'δ','п'=>'π','ɸ'=>'φ','ф'=>'φ','ʙ'=>'в','ɜ'=>'з','ᴍ'=>'м','ʜ'=>'н','ɢ'=>'ԍ','ᴛ'=>'т','ᴙ'=>'я','ઽ'=>'ऽ','ુ'=>'ु','ૂ'=>'ू','ੋ'=>'ॆ','੍'=>'्','્'=>'्','ഉ'=>'உ','ജ'=>'ஐ','ണ'=>'ண','ഴ'=>'ழ','ി'=>'ி','ു'=>'ூ','ಅ'=>'అ','ಆ'=>'ఆ','ಇ'=>'ఇ','ಒ'=>'ఒ','ಓ'=>'ఒౕ','ಜ'=>'జ','ಞ'=>'ఞ','ಣ'=>'ణ','థ'=>'ధּ','ಯ'=>'య','ఠ'=>'రּ','ಱ'=>'ఱ','ಲ'=>'ల','ඌ'=>'ന്ന','ஶ'=>'ശ','ຈ'=>'จ','ບ'=>'บ','ປ'=>'ป','ຝ'=>'ฝ','ພ'=>'พ','ຟ'=>'ฟ','ຍ'=>'ย','។'=>'ฯ','ិ'=>'ิ','ី'=>'ี','ឹ'=>'ึ','ឺ'=>'ื','ຸ'=>'ุ','ູ'=>'ู','ᗅ'=>'A','ᒍ'=>'J','ᕼ'=>'H','ᐯ'=>'V','ᑭ'=>'P','ᗷ'=>'B','ヘ'=>'へ','𐏑'=>'𐎂','𐏓'=>'𐎓','𒀸'=>'𐎚','ᅳ'=>'一','ǀ'=>'丨','ᅵ'=>'丨','Ꭺ'=>'A','Ᏼ'=>'B','Ꮯ'=>'C','ᗞ'=>'D','Ꭼ'=>'E','ᖴ'=>'F','Ꮐ'=>'G','Ꮋ'=>'H','Ꭻ'=>'J','Ꮶ'=>'K','Ꮮ'=>'L','Ꮇ'=>'M','Ꮲ'=>'P','ᖇ'=>'R','Ꮥ'=>'S','Ꮩ'=>'V','Ꮓ'=>'Z');
-
-?> \ No newline at end of file
diff --git a/phpBB/install/data/new_normalizer.php b/phpBB/install/data/new_normalizer.php
index e266f73408..52652a4f6d 100644
--- a/phpBB/install/data/new_normalizer.php
+++ b/phpBB/install/data/new_normalizer.php
@@ -1,10 +1,13 @@
<?php
/**
*
-* @package install
-* @version $Id$
-* @copyright (c) 2007 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -192,5 +195,3 @@ class utf_new_normalizer
return utf_normalizer::recompose($str, $pos, $len, $qc, $decomp_map);
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php
index a8c3ed385f..f367ae1fc0 100644
--- a/phpBB/install/database_update.php
+++ b/phpBB/install/database_update.php
@@ -1,114 +1,118 @@
<?php
/**
*
-* @package install
-* @version $Id$
-* @copyright (c) 2006 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
-define('UPDATES_TO_VERSION', '3.0.14');
-
-// Enter any version to update from to test updates. The version within the db will not be updated.
-define('DEBUG_FROM_VERSION', false);
-
-// Which oldest version does this updater support?
-define('OLDEST_FROM_VERSION', '3.0.0');
-
-// Return if we "just include it" to find out for which version the database update is responsible for
-if (defined('IN_PHPBB') && defined('IN_INSTALL'))
-{
- $updates_to_version = UPDATES_TO_VERSION;
- $debug_from_version = DEBUG_FROM_VERSION;
- $oldest_from_version = OLDEST_FROM_VERSION;
-
- return;
-}
+$update_start_time = time();
/**
+* @ignore
*/
define('IN_PHPBB', true);
define('IN_INSTALL', true);
-
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './../';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
-if (!function_exists('phpbb_require_updated'))
+function phpbb_end_update($cache, $config)
{
- function phpbb_require_updated($path, $optional = false)
- {
- global $phpbb_root_path;
+ $cache->purge();
- $new_path = $phpbb_root_path . 'install/update/new/' . $path;
- $old_path = $phpbb_root_path . $path;
+ $config->increment('assets_version', 1);
- if (file_exists($new_path))
- {
- require($new_path);
- }
- else if (!$optional || file_exists($old_path))
- {
- require($old_path);
- }
- }
-}
+?>
+ </p>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
-phpbb_require_updated('includes/startup.' . $phpEx);
+ <div id="page-footer">
+ <div class="copyright">
+ Powered by <a href="https://www.phpbb.com/">phpBB</a>&reg; Forum Software &copy; phpBB Limited
+ </div>
+ </div>
+ </div>
+</body>
+</html>
-$updates_to_version = UPDATES_TO_VERSION;
-$debug_from_version = DEBUG_FROM_VERSION;
-$oldest_from_version = OLDEST_FROM_VERSION;
+<?php
-@set_time_limit(0);
+ garbage_collection();
+ exit_handler();
+}
+
+require($phpbb_root_path . 'includes/startup.' . $phpEx);
+require($phpbb_root_path . 'phpbb/class_loader.' . $phpEx);
-// Include essential scripts
-include($phpbb_root_path . 'config.' . $phpEx);
+$phpbb_class_loader = new \phpbb\class_loader('phpbb\\', "{$phpbb_root_path}phpbb/", $phpEx);
+$phpbb_class_loader->register();
+
+$phpbb_config_php_file = new \phpbb\config_php_file($phpbb_root_path, $phpEx);
+extract($phpbb_config_php_file->get_all());
if (!defined('PHPBB_INSTALLED') || empty($dbms) || empty($acm_type))
{
die("Please read: <a href='../docs/INSTALL.html'>INSTALL.html</a> before attempting to update.");
}
-// Load Extensions
-if (!empty($load_extensions) && function_exists('dl'))
-{
- $load_extensions = explode(',', $load_extensions);
-
- foreach ($load_extensions as $extension)
- {
- @dl(trim($extension));
- }
-}
+// In case $phpbb_adm_relative_path is not set (in case of an update), use the default.
+$phpbb_adm_relative_path = (isset($phpbb_adm_relative_path)) ? $phpbb_adm_relative_path : 'adm/';
+$phpbb_admin_path = (defined('PHPBB_ADMIN_PATH')) ? PHPBB_ADMIN_PATH : $phpbb_root_path . $phpbb_adm_relative_path;
// Include files
-require($phpbb_root_path . 'includes/acm/acm_' . $acm_type . '.' . $phpEx);
-require($phpbb_root_path . 'includes/cache.' . $phpEx);
-require($phpbb_root_path . 'includes/template.' . $phpEx);
-require($phpbb_root_path . 'includes/session.' . $phpEx);
-require($phpbb_root_path . 'includes/auth.' . $phpEx);
-
require($phpbb_root_path . 'includes/functions.' . $phpEx);
+require($phpbb_root_path . 'includes/functions_content.' . $phpEx);
-phpbb_require_updated('includes/functions_content.' . $phpEx, true);
-
-require($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
require($phpbb_root_path . 'includes/constants.' . $phpEx);
-require($phpbb_root_path . 'includes/db/' . $dbms . '.' . $phpEx);
+include($phpbb_root_path . 'includes/utf/utf_normalizer.' . $phpEx);
require($phpbb_root_path . 'includes/utf/utf_tools.' . $phpEx);
-phpbb_require_updated('includes/db/db_tools.' . $phpEx);
+// Set PHP error handler to ours
+set_error_handler(defined('PHPBB_MSG_HANDLER') ? PHPBB_MSG_HANDLER : 'msg_handler');
+
+// Set up container (must be done here because extensions table may not exist)
+$phpbb_container_builder = new \phpbb\di\container_builder($phpbb_config_php_file, $phpbb_root_path, $phpEx);
+$phpbb_container_builder->set_use_extensions(false);
+$phpbb_container_builder->set_use_kernel_pass(false);
+$phpbb_container_builder->set_dump_container(false);
+$phpbb_container = $phpbb_container_builder->get_container();
+
+// set up caching
+$cache = $phpbb_container->get('cache');
+
+// Instantiate some basic classes
+$phpbb_dispatcher = $phpbb_container->get('dispatcher');
+$request = $phpbb_container->get('request');
+$user = $phpbb_container->get('user');
+$auth = $phpbb_container->get('auth');
+$db = $phpbb_container->get('dbal.conn');
+$phpbb_log = $phpbb_container->get('log');
+
+// make sure request_var uses this request instance
+request_var('', 0, false, false, $request); // "dependency injection" for a function
-// new table constants are separately defined here in case the updater is run
-// before the files are updated
-if (!defined('LOGIN_ATTEMPT_TABLE'))
+// Grab global variables, re-cache if necessary
+$config = $phpbb_container->get('config');
+set_config(null, null, null, $config);
+set_config_count(null, null, null, $config);
+
+if (!isset($config['version_update_from']))
{
- define('LOGIN_ATTEMPT_TABLE', $table_prefix . 'login_attempts');
+ $config->set('version_update_from', $config['version']);
}
-$user = new user();
-$cache = new cache();
-$db = new $sql_db();
+$orig_version = $config['version_update_from'];
+
+$user->add_lang(array('common', 'acp/common', 'install', 'migrator'));
// Add own hook handler, if present. :o
if (file_exists($phpbb_root_path . 'includes/hooks/index.' . $phpEx))
@@ -116,7 +120,8 @@ if (file_exists($phpbb_root_path . 'includes/hooks/index.' . $phpEx))
require($phpbb_root_path . 'includes/hooks/index.' . $phpEx);
$phpbb_hook = new phpbb_hook(array('exit_handler', 'phpbb_user_session_handler', 'append_sid', array('template', 'display')));
- foreach ($cache->obtain_hooks() as $hook)
+ $phpbb_hook_finder = $phpbb_container->get('hook_finder');
+ foreach ($phpbb_hook_finder->find() as $hook)
{
@include($phpbb_root_path . 'includes/hooks/' . $hook . '.' . $phpEx);
}
@@ -126,2165 +131,114 @@ else
$phpbb_hook = false;
}
-// Connect to DB
-$db->sql_connect($dbhost, $dbuser, $dbpasswd, $dbname, $dbport, false, false);
-
-// We do not need this any longer, unset for safety purposes
-unset($dbpasswd);
-
-$user->ip = (!empty($_SERVER['REMOTE_ADDR'])) ? htmlspecialchars($_SERVER['REMOTE_ADDR']) : '';
-$user->ip = (stripos($user->ip, '::ffff:') === 0) ? substr($user->ip, 7) : $user->ip;
-
-$sql = "SELECT config_value
- FROM " . CONFIG_TABLE . "
- WHERE config_name = 'default_lang'";
-$result = $db->sql_query($sql);
-$row = $db->sql_fetchrow($result);
-$db->sql_freeresult($result);
-
-$language = basename(request_var('language', ''));
-
-if (!$language)
-{
- $language = $row['config_value'];
-}
-
-if (!file_exists($phpbb_root_path . 'language/' . $language))
-{
- die('No language found!');
-}
-
-// And finally, load the relevant language files
-include($phpbb_root_path . 'language/' . $language . '/common.' . $phpEx);
-include($phpbb_root_path . 'language/' . $language . '/acp/common.' . $phpEx);
-include($phpbb_root_path . 'language/' . $language . '/install.' . $phpEx);
-
-// Set PHP error handler to ours
-//set_error_handler('msg_handler');
-
-// Define some variables for the database update
-$inline_update = (request_var('type', 0)) ? true : false;
-
-// To let set_config() calls succeed, we need to make the config array available globally
-$config = array();
-
-$sql = 'SELECT *
- FROM ' . CONFIG_TABLE;
-$result = $db->sql_query($sql);
-
-while ($row = $db->sql_fetchrow($result))
-{
- $config[$row['config_name']] = $row['config_value'];
-}
-$db->sql_freeresult($result);
-
-// phpbb_db_tools will be taken from new files (under install/update/new)
-// if possible, falling back to the board's copy.
-$db_tools = new phpbb_db_tools($db, true);
-
-$database_update_info = database_update_info();
-
-$error_ary = array();
-$errored = false;
-
header('Content-type: text/html; charset=UTF-8');
-
?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" dir="<?php echo $lang['DIRECTION']; ?>" lang="<?php echo $lang['USER_LANG']; ?>" xml:lang="<?php echo $lang['USER_LANG']; ?>">
+<!DOCTYPE html>
+<html dir="<?php echo $user->lang['DIRECTION']; ?>" lang="<?php echo $user->lang['USER_LANG']; ?>">
<head>
+<meta charset="utf-8">
+<meta http-equiv="X-UA-Compatible" content="IE=edge">
-<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
-<meta http-equiv="content-language" content="<?php echo $lang['USER_LANG']; ?>" />
-<meta http-equiv="content-style-type" content="text/css" />
-<meta http-equiv="imagetoolbar" content="no" />
-
-<title><?php echo $lang['UPDATING_TO_LATEST_STABLE']; ?></title>
+<title><?php echo $user->lang['UPDATING_TO_LATEST_STABLE']; ?></title>
-<link href="../adm/style/admin.css" rel="stylesheet" type="text/css" media="screen" />
+<link href="<?php echo htmlspecialchars($phpbb_admin_path); ?>style/admin.css" rel="stylesheet" type="text/css" media="screen" />
</head>
<body>
-<div id="wrap">
- <div id="page-header">&nbsp;</div>
+ <div id="wrap">
+ <div id="page-header">&nbsp;</div>
- <div id="page-body">
- <div id="acp">
- <div class="panel">
- <span class="corners-top"><span></span></span>
- <div id="content">
- <div id="main" class="install-body">
+ <div id="page-body">
+ <div id="acp">
+ <div class="panel">
+ <div id="content">
+ <div id="main" class="install-body">
- <h1><?php echo $lang['UPDATING_TO_LATEST_STABLE']; ?></h1>
+ <h1><?php echo $user->lang['UPDATING_TO_LATEST_STABLE']; ?></h1>
- <br />
-
- <p><?php echo $lang['DATABASE_TYPE']; ?> :: <strong><?php echo $db->sql_layer; ?></strong><br />
-<?php
+ <br />
-if ($debug_from_version !== false)
-{
- $config['version'] = $debug_from_version;
-}
-
-echo $lang['PREVIOUS_VERSION'] . ' :: <strong>' . $config['version'] . '</strong><br />';
-echo $lang['UPDATED_VERSION'] . ' :: <strong>' . $updates_to_version . '</strong></p>';
-
-$current_version = str_replace('rc', 'RC', strtolower($config['version']));
-$latest_version = str_replace('rc', 'RC', strtolower($updates_to_version));
-$orig_version = $config['version'];
-
-// Fill DB version
-if (empty($config['dbms_version']))
-{
- set_config('dbms_version', $db->sql_server_info(true));
-}
+ <p><?php echo $user->lang['DATABASE_TYPE']; ?> :: <strong><?php echo $db->get_sql_layer(); ?></strong><br />
+ <?php echo $user->lang['PREVIOUS_VERSION']; ?> :: <strong><?php echo $config['version']; ?></strong><br />
-// Firebird update from Firebird 2.0 to 2.1+ required?
-if ($db->sql_layer == 'firebird')
-{
- // We do not trust any PHP5 function enabled, we will simply test for a function new in 2.1
- $db->sql_return_on_error(true);
-
- $sql = 'SELECT 1 FROM RDB$DATABASE
- WHERE BIN_AND(10, 1) = 0';
- $result = $db->sql_query($sql);
-
- if (!$result || $db->sql_error_triggered)
- {
- echo '<br /><br />';
- echo '<h1>' . $lang['ERROR'] . '</h1><br />';
-
- echo '<p>' . $lang['FIREBIRD_DBMS_UPDATE_REQUIRED'] . '</p>';
-
- _print_footer();
-
- exit_handler();
- exit;
- }
+<?php
- $db->sql_freeresult($result);
- $db->sql_return_on_error(false);
-}
+define('IN_DB_UPDATE', true);
-// MySQL update from MySQL 3.x/4.x to > 4.1.x required?
-if ($db->sql_layer == 'mysql' || $db->sql_layer == 'mysql4' || $db->sql_layer == 'mysqli')
-{
- // Verify by fetching column... if the column type matches the new type we update dbms_version...
- $sql = "SHOW COLUMNS FROM " . CONFIG_TABLE;
- $result = $db->sql_query($sql);
+/**
+* @todo mysql update?
+*/
- $column_type = '';
- while ($row = $db->sql_fetchrow($result))
- {
- $field = strtolower($row['Field']);
+// End startup code
- if ($field == 'config_value')
- {
- $column_type = strtolower($row['Type']);
- break;
- }
- }
- $db->sql_freeresult($result);
+$migrator = $phpbb_container->get('migrator');
+$migrator->set_output_handler(new \phpbb\db\log_wrapper_migrator_output_handler($user, new \phpbb\db\html_migrator_output_handler($user), $phpbb_root_path . 'store/migrations_' . time() . '.log'));
- // If column type is blob, but mysql version says we are on > 4.1.3, then the schema needs an update
- if (strpos($column_type, 'blob') !== false && version_compare($db->sql_server_info(true), '4.1.3', '>='))
- {
- echo '<br /><br />';
- echo '<h1>' . $lang['ERROR'] . '</h1><br />';
+$migrator->create_migrations_table();
- echo '<p>' . sprintf($lang['MYSQL_SCHEMA_UPDATE_REQUIRED'], $config['dbms_version'], $db->sql_server_info(true)) . '</p>';
+$phpbb_extension_manager = $phpbb_container->get('ext.manager');
- _print_footer();
+$migrations = $phpbb_extension_manager
+ ->get_finder()
+ ->core_path('phpbb/db/migration/data/')
+ ->extension_directory('/migrations')
+ ->get_classes();
- exit_handler();
- exit;
- }
-}
+$migrator->set_migrations($migrations);
-// Now check if the user wants to update from a version we no longer support updates from
-if (version_compare($current_version, $oldest_from_version, '<'))
-{
- echo '<br /><br /><h1>' . $lang['ERROR'] . '</h1><br />';
- echo '<p>' . sprintf($lang['DB_UPDATE_NOT_SUPPORTED'], $oldest_from_version, $current_version) . '</p>';
+// What is a safe limit of execution time? Half the max execution time should be safe.
+// No more than 15 seconds so the user isn't sitting and waiting for a very long time
+$phpbb_ini = new \phpbb\php\ini();
+$safe_time_limit = min(15, ($phpbb_ini->get_int('max_execution_time') / 2));
- _print_footer();
- exit_handler();
- exit;
-}
+// While we're going to try limit this to half the max execution time,
+// we want to try and take additional measures to prevent hitting the
+// max execution time (if, say, one migration step takes much longer
+// than the max execution time)
+@set_time_limit(0);
-// If the latest version and the current version are 'unequal', we will update the version_update_from, else we do not update anything.
-if ($inline_update)
+while (!$migrator->finished())
{
- if ($current_version !== $latest_version)
+ try
{
- set_config('version_update_from', $orig_version);
+ $migrator->update();
}
-}
-else
-{
- // If not called from the update script, we will actually remove the traces
- $db->sql_query('DELETE FROM ' . CONFIG_TABLE . " WHERE config_name = 'version_update_from'");
-}
-
-// Schema updates
-?>
- <br /><br />
-
- <h1><?php echo $lang['UPDATE_DATABASE_SCHEMA']; ?></h1>
-
- <br />
- <p><?php echo $lang['PROGRESS']; ?> :: <strong>
-
-<?php
-
-flush();
-
-// We go through the schema changes from the lowest to the highest version
-// We try to also include versions 'in-between'...
-$no_updates = true;
-$versions = array_keys($database_update_info);
-for ($i = 0; $i < sizeof($versions); $i++)
-{
- $version = $versions[$i];
- $schema_changes = $database_update_info[$version];
-
- $next_version = (isset($versions[$i + 1])) ? $versions[$i + 1] : $updates_to_version;
-
- // If the installed version to be updated to is < than the current version, and if the current version is >= as the version to be updated to next, we will skip the process
- if (version_compare($version, $current_version, '<') && version_compare($current_version, $next_version, '>='))
+ catch (\phpbb\db\migration\exception $e)
{
- continue;
- }
+ echo $e->getLocalisedMessage($user);
- if (!sizeof($schema_changes))
- {
- continue;
+ phpbb_end_update($cache, $config);
}
- $no_updates = false;
-
- // We run one index after the other... to be consistent with schema changes...
- foreach ($schema_changes as $key => $changes)
+ // Are we approaching the time limit? If so we want to pause the update and continue after refreshing
+ if ((time() - $update_start_time) >= $safe_time_limit)
{
- $statements = $db_tools->perform_schema_changes(array($key => $changes));
-
- foreach ($statements as $sql)
- {
- _sql($sql, $errored, $error_ary);
- }
- }
-}
+ echo '<br />' . $user->lang['DATABASE_UPDATE_NOT_COMPLETED'] . '<br /><br />';
+ echo '<a href="' . append_sid($phpbb_root_path . 'install/database_update.' . $phpEx, 'type=' . $request->variable('type', 0) . '&amp;language=' . $request->variable('language', 'en')) . '" class="button1">' . $user->lang['DATABASE_UPDATE_CONTINUE'] . '</a>';
-_write_result($no_updates, $errored, $error_ary);
-
-// Data updates
-$error_ary = array();
-$errored = $no_updates = false;
-
-?>
-
-<br /><br />
-<h1><?php echo $lang['UPDATING_DATA']; ?></h1>
-<br />
-<p><?php echo $lang['PROGRESS']; ?> :: <strong>
-
-<?php
-
-flush();
-
-$no_updates = true;
-$versions = array_keys($database_update_info);
-
-// some code magic
-for ($i = 0; $i < sizeof($versions); $i++)
-{
- $version = $versions[$i];
- $next_version = (isset($versions[$i + 1])) ? $versions[$i + 1] : $updates_to_version;
-
- // If the installed version to be updated to is < than the current version, and if the current version is >= as the version to be updated to next, we will skip the process
- if (version_compare($version, $current_version, '<') && version_compare($current_version, $next_version, '>='))
- {
- continue;
+ phpbb_end_update($cache, $config);
}
-
- change_database_data($no_updates, $version);
}
-_write_result($no_updates, $errored, $error_ary);
-
-$error_ary = array();
-$errored = $no_updates = false;
-
-?>
-
-<br /><br />
-<h1><?php echo $lang['UPDATE_VERSION_OPTIMIZE']; ?></h1>
-<br />
-<p><?php echo $lang['PROGRESS']; ?> :: <strong>
-
-<?php
-
-flush();
-
-if ($debug_from_version === false)
-{
- // update the version
- $sql = "UPDATE " . CONFIG_TABLE . "
- SET config_value = '$updates_to_version'
- WHERE config_name = 'version'";
- _sql($sql, $errored, $error_ary);
-}
-
-// Reset permissions
-$sql = 'UPDATE ' . USERS_TABLE . "
- SET user_permissions = '',
- user_perm_from = 0";
-_sql($sql, $errored, $error_ary);
-
-// Update the dbms version if everything is ok...
-set_config('dbms_version', $db->sql_server_info(true));
-
-/* Optimize/vacuum analyze the tables where appropriate
-// this should be done for each version in future along with
-// the version number update
-switch ($db->sql_layer)
+if ($orig_version != $config['version'])
{
- case 'mysql':
- case 'mysqli':
- case 'mysql4':
- $sql = 'OPTIMIZE TABLE ' . $table_prefix . 'auth_access, ' . $table_prefix . 'banlist, ' . $table_prefix . 'categories, ' . $table_prefix . 'config, ' . $table_prefix . 'disallow, ' . $table_prefix . 'forum_prune, ' . $table_prefix . 'forums, ' . $table_prefix . 'groups, ' . $table_prefix . 'posts, ' . $table_prefix . 'posts_text, ' . $table_prefix . 'privmsgs, ' . $table_prefix . 'privmsgs_text, ' . $table_prefix . 'ranks, ' . $table_prefix . 'search_results, ' . $table_prefix . 'search_wordlist, ' . $table_prefix . 'search_wordmatch, ' . $table_prefix . 'sessions_keys' . $table_prefix . 'smilies, ' . $table_prefix . 'themes, ' . $table_prefix . 'themes_name, ' . $table_prefix . 'topics, ' . $table_prefix . 'topics_watch, ' . $table_prefix . 'user_group, ' . $table_prefix . 'users, ' . $table_prefix . 'vote_desc, ' . $table_prefix . 'vote_results, ' . $table_prefix . 'vote_voters, ' . $table_prefix . 'words';
- _sql($sql, $errored, $error_ary);
- break;
-
- case 'postgresql':
- _sql("VACUUM ANALYZE", $errored, $error_ary);
- break;
+ add_log('admin', 'LOG_UPDATE_DATABASE', $orig_version, $config['version']);
}
-*/
-
-_write_result($no_updates, $errored, $error_ary);
-?>
-
-<br />
-<h1><?php echo $lang['UPDATE_COMPLETED']; ?></h1>
-
-<br />
-
-<?php
+echo $user->lang['DATABASE_UPDATE_COMPLETE'] . '<br />';
-if (!$inline_update)
+if ($request->variable('type', 0))
{
-?>
-
- <p style="color:red"><?php echo $lang['UPDATE_FILES_NOTICE']; ?></p>
-
- <p><?php echo $lang['COMPLETE_LOGIN_TO_BOARD']; ?></p>
-
-<?php
+ echo $user->lang['INLINE_UPDATE_SUCCESSFUL'] . '<br /><br />';
+ echo '<a href="' . append_sid($phpbb_root_path . 'install/index.' . $phpEx, 'mode=update&amp;sub=update_db&amp;language=' . $request->variable('language', 'en')) . '" class="button1">' . $user->lang['CONTINUE_UPDATE_NOW'] . '</a>';
}
else
{
-?>
-
- <p><?php echo ((isset($lang['INLINE_UPDATE_SUCCESSFUL'])) ? $lang['INLINE_UPDATE_SUCCESSFUL'] : 'The database update was successful. Now you need to continue the update process.'); ?></p>
-
- <p><a href="<?php echo append_sid("{$phpbb_root_path}install/index.{$phpEx}", "mode=update&amp;sub=file_check&amp;language=$language"); ?>" class="button1"><?php echo (isset($lang['CONTINUE_UPDATE_NOW'])) ? $lang['CONTINUE_UPDATE_NOW'] : 'Continue the update process now'; ?></a></p>
-
-<?php
-}
-
-// Add database update to log
-add_log('admin', 'LOG_UPDATE_DATABASE', $orig_version, $updates_to_version);
-
-// Now we purge the session table as well as all cache files
-$cache->purge();
-
-_print_footer();
-
-garbage_collection();
-
-if (function_exists('exit_handler'))
-{
- exit_handler();
-}
-
-/**
-* Print out footer
-*/
-function _print_footer()
-{
- echo <<<EOF
- </div>
- </div>
- <span class="corners-bottom"><span></span></span>
- </div>
- </div>
- </div>
-
- <div id="page-footer">
- Powered by <a href="https://www.phpbb.com/">phpBB</a>&reg; Forum Software &copy; phpBB Group
- </div>
-</div>
-
-</body>
-</html>
-EOF;
-}
-
-/**
-* Function for triggering an sql statement
-*/
-function _sql($sql, &$errored, &$error_ary, $echo_dot = true)
-{
- global $db;
-
- if (defined('DEBUG_EXTRA'))
- {
- echo "<br />\n{$sql}\n<br />";
- }
-
- $db->sql_return_on_error(true);
-
- if ($sql === 'begin')
- {
- $result = $db->sql_transaction('begin');
- }
- else if ($sql === 'commit')
- {
- $result = $db->sql_transaction('commit');
- }
- else
- {
- $result = $db->sql_query($sql);
- if ($db->sql_error_triggered)
- {
- $errored = true;
- $error_ary['sql'][] = $db->sql_error_sql;
- $error_ary['error_code'][] = $db->sql_error_returned;
- }
- }
-
- $db->sql_return_on_error(false);
-
- if ($echo_dot)
- {
- echo ". \n";
- flush();
- }
-
- return $result;
-}
-
-function _write_result($no_updates, $errored, $error_ary)
-{
- global $lang;
-
- if ($no_updates)
- {
- echo ' ' . $lang['NO_UPDATES_REQUIRED'] . '</strong></p>';
- }
- else
- {
- echo ' <span class="success">' . $lang['DONE'] . '</span></strong><br />' . $lang['RESULT'] . ' :: ';
-
- if ($errored)
- {
- echo ' <strong>' . $lang['SOME_QUERIES_FAILED'] . '</strong> <ul>';
-
- for ($i = 0; $i < sizeof($error_ary['sql']); $i++)
- {
- echo '<li>' . $lang['ERROR'] . ' :: <strong>' . htmlspecialchars($error_ary['error_code'][$i]['message']) . '</strong><br />';
- echo $lang['SQL'] . ' :: <strong>' . htmlspecialchars($error_ary['sql'][$i]) . '</strong><br /><br /></li>';
- }
-
- echo '</ul> <br /><br />' . $lang['SQL_FAILURE_EXPLAIN'] . '</p>';
- }
- else
- {
- echo '<strong>' . $lang['NO_ERRORS'] . '</strong></p>';
- }
- }
+ echo '<div class="errorbox">' . $user->lang['UPDATE_FILES_NOTICE'] . '</div>';
+ echo $user->lang['COMPLETE_LOGIN_TO_BOARD'];
}
-function _add_modules($modules_to_install)
-{
- global $phpbb_root_path, $phpEx, $db;
-
- include_once($phpbb_root_path . 'includes/acp/acp_modules.' . $phpEx);
-
- $_module = new acp_modules();
-
- foreach ($modules_to_install as $module_mode => $module_data)
- {
- $_module->module_class = $module_data['class'];
-
- // Determine parent id first
- $sql = 'SELECT module_id
- FROM ' . MODULES_TABLE . "
- WHERE module_class = '" . $db->sql_escape($module_data['class']) . "'
- AND module_langname = '" . $db->sql_escape($module_data['cat']) . "'
- AND module_mode = ''
- AND module_basename = ''";
- $result = $db->sql_query($sql);
-
- // There may be more than one categories with the same name
- $categories = array();
- while ($row = $db->sql_fetchrow($result))
- {
- $categories[] = (int) $row['module_id'];
- }
- $db->sql_freeresult($result);
-
- if (!sizeof($categories))
- {
- continue;
- }
-
- // Add the module to all categories found
- foreach ($categories as $parent_id)
- {
- // Check if the module already exists
- $sql = 'SELECT *
- FROM ' . MODULES_TABLE . "
- WHERE module_basename = '" . $db->sql_escape($module_data['base']) . "'
- AND module_class = '" . $db->sql_escape($module_data['class']) . "'
- AND module_langname = '" . $db->sql_escape($module_data['title']) . "'
- AND module_mode = '" . $db->sql_escape($module_mode) . "'
- AND module_auth = '" . $db->sql_escape($module_data['auth']) . "'
- AND parent_id = {$parent_id}";
- $result = $db->sql_query($sql);
- $row = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
-
- // If it exists, we simply continue with the next category
- if ($row)
- {
- continue;
- }
-
- // Build the module sql row
- $module_row = array(
- 'module_basename' => $module_data['base'],
- 'module_enabled' => (isset($module_data['enabled'])) ? (int) $module_data['enabled'] : 1,
- 'module_display' => (isset($module_data['display'])) ? (int) $module_data['display'] : 1,
- 'parent_id' => $parent_id,
- 'module_class' => $module_data['class'],
- 'module_langname' => $module_data['title'],
- 'module_mode' => $module_mode,
- 'module_auth' => $module_data['auth'],
- );
-
- $_module->update_module_data($module_row, true);
-
- // Ok, do we need to re-order the module, move it up or down?
- if (!isset($module_data['after']))
- {
- continue;
- }
-
- $after_mode = $module_data['after'][0];
- $after_langname = $module_data['after'][1];
-
- // First of all, get the module id for the module this one has to be placed after
- $sql = 'SELECT left_id
- FROM ' . MODULES_TABLE . "
- WHERE module_class = '" . $db->sql_escape($module_data['class']) . "'
- AND module_basename = '" . $db->sql_escape($module_data['base']) . "'
- AND module_langname = '" . $db->sql_escape($after_langname) . "'
- AND module_mode = '" . $db->sql_escape($after_mode) . "'
- AND parent_id = '{$parent_id}'";
- $result = $db->sql_query($sql);
- $first_left_id = (int) $db->sql_fetchfield('left_id');
- $db->sql_freeresult($result);
-
- if (!$first_left_id)
- {
- continue;
- }
-
- // Ok, count the number of modules between $after_mode and the added module
- $sql = 'SELECT COUNT(module_id) as num_modules
- FROM ' . MODULES_TABLE . "
- WHERE module_class = '" . $db->sql_escape($module_data['class']) . "'
- AND parent_id = {$parent_id}
- AND left_id BETWEEN {$first_left_id} AND {$module_row['left_id']}";
- $result = $db->sql_query($sql);
- $steps = (int) $db->sql_fetchfield('num_modules');
- $db->sql_freeresult($result);
-
- // We need to substract 2
- $steps -= 2;
+$config->delete('version_update_from');
- if ($steps <= 0)
- {
- continue;
- }
-
- // Ok, move module up $num_modules times. ;)
- $_module->move_module_by($module_row, 'move_up', $steps);
- }
- }
-
- $_module->remove_cache_file();
-}
-
-/****************************************************************************
-* ADD YOUR DATABASE SCHEMA CHANGES HERE *
-*****************************************************************************/
-function database_update_info()
-{
- return array(
- // Changes from 3.0.0 to the next version
- '3.0.0' => array(
- // Add the following columns
- 'add_columns' => array(
- FORUMS_TABLE => array(
- 'display_subforum_list' => array('BOOL', 1),
- ),
- SESSIONS_TABLE => array(
- 'session_forum_id' => array('UINT', 0),
- ),
- ),
- 'drop_keys' => array(
- GROUPS_TABLE => array('group_legend'),
- ),
- 'add_index' => array(
- SESSIONS_TABLE => array(
- 'session_forum_id' => array('session_forum_id'),
- ),
- GROUPS_TABLE => array(
- 'group_legend_name' => array('group_legend', 'group_name'),
- ),
- ),
- ),
- // No changes from 3.0.1-RC1 to 3.0.1
- '3.0.1-RC1' => array(),
- // No changes from 3.0.1 to 3.0.2-RC1
- '3.0.1' => array(),
- // Changes from 3.0.2-RC1 to 3.0.2-RC2
- '3.0.2-RC1' => array(
- 'change_columns' => array(
- DRAFTS_TABLE => array(
- 'draft_subject' => array('STEXT_UNI', ''),
- ),
- FORUMS_TABLE => array(
- 'forum_last_post_subject' => array('STEXT_UNI', ''),
- ),
- POSTS_TABLE => array(
- 'post_subject' => array('STEXT_UNI', '', 'true_sort'),
- ),
- PRIVMSGS_TABLE => array(
- 'message_subject' => array('STEXT_UNI', ''),
- ),
- TOPICS_TABLE => array(
- 'topic_title' => array('STEXT_UNI', '', 'true_sort'),
- 'topic_last_post_subject' => array('STEXT_UNI', ''),
- ),
- ),
- 'drop_keys' => array(
- SESSIONS_TABLE => array('session_forum_id'),
- ),
- 'add_index' => array(
- SESSIONS_TABLE => array(
- 'session_fid' => array('session_forum_id'),
- ),
- ),
- ),
- // No changes from 3.0.2-RC2 to 3.0.2
- '3.0.2-RC2' => array(),
-
- // Changes from 3.0.2 to 3.0.3-RC1
- '3.0.2' => array(
- // Add the following columns
- 'add_columns' => array(
- STYLES_TEMPLATE_TABLE => array(
- 'template_inherits_id' => array('UINT:4', 0),
- 'template_inherit_path' => array('VCHAR', ''),
- ),
- GROUPS_TABLE => array(
- 'group_max_recipients' => array('UINT', 0),
- ),
- ),
- ),
-
- // No changes from 3.0.3-RC1 to 3.0.3
- '3.0.3-RC1' => array(),
-
- // Changes from 3.0.3 to 3.0.4-RC1
- '3.0.3' => array(
- 'add_columns' => array(
- PROFILE_FIELDS_TABLE => array(
- 'field_show_profile' => array('BOOL', 0),
- ),
- ),
- 'change_columns' => array(
- STYLES_TABLE => array(
- 'style_id' => array('UINT', NULL, 'auto_increment'),
- 'template_id' => array('UINT', 0),
- 'theme_id' => array('UINT', 0),
- 'imageset_id' => array('UINT', 0),
- ),
- STYLES_IMAGESET_TABLE => array(
- 'imageset_id' => array('UINT', NULL, 'auto_increment'),
- ),
- STYLES_IMAGESET_DATA_TABLE => array(
- 'image_id' => array('UINT', NULL, 'auto_increment'),
- 'imageset_id' => array('UINT', 0),
- ),
- STYLES_THEME_TABLE => array(
- 'theme_id' => array('UINT', NULL, 'auto_increment'),
- ),
- STYLES_TEMPLATE_TABLE => array(
- 'template_id' => array('UINT', NULL, 'auto_increment'),
- ),
- STYLES_TEMPLATE_DATA_TABLE => array(
- 'template_id' => array('UINT', 0),
- ),
- FORUMS_TABLE => array(
- 'forum_style' => array('UINT', 0),
- ),
- USERS_TABLE => array(
- 'user_style' => array('UINT', 0),
- ),
- ),
- ),
-
- // Changes from 3.0.4-RC1 to 3.0.4
- '3.0.4-RC1' => array(),
-
- // Changes from 3.0.4 to 3.0.5-RC1
- '3.0.4' => array(
- 'change_columns' => array(
- FORUMS_TABLE => array(
- 'forum_style' => array('UINT', 0),
- ),
- ),
- ),
-
- // No changes from 3.0.5-RC1 to 3.0.5
- '3.0.5-RC1' => array(),
-
- // Changes from 3.0.5 to 3.0.6-RC1
- '3.0.5' => array(
- 'add_columns' => array(
- CONFIRM_TABLE => array(
- 'attempts' => array('UINT', 0),
- ),
- USERS_TABLE => array(
- 'user_new' => array('BOOL', 1),
- 'user_reminded' => array('TINT:4', 0),
- 'user_reminded_time'=> array('TIMESTAMP', 0),
- ),
- GROUPS_TABLE => array(
- 'group_skip_auth' => array('BOOL', 0, 'after' => 'group_founder_manage'),
- ),
- PRIVMSGS_TABLE => array(
- 'message_reported' => array('BOOL', 0),
- ),
- REPORTS_TABLE => array(
- 'pm_id' => array('UINT', 0),
- ),
- PROFILE_FIELDS_TABLE => array(
- 'field_show_on_vt' => array('BOOL', 0),
- ),
- FORUMS_TABLE => array(
- 'forum_options' => array('UINT:20', 0),
- ),
- ),
- 'change_columns' => array(
- USERS_TABLE => array(
- 'user_options' => array('UINT:11', 230271),
- ),
- ),
- 'add_index' => array(
- REPORTS_TABLE => array(
- 'post_id' => array('post_id'),
- 'pm_id' => array('pm_id'),
- ),
- POSTS_TABLE => array(
- 'post_username' => array('post_username:255'),
- ),
- ),
- ),
-
- // No changes from 3.0.6-RC1 to 3.0.6-RC2
- '3.0.6-RC1' => array(),
- // No changes from 3.0.6-RC2 to 3.0.6-RC3
- '3.0.6-RC2' => array(),
- // No changes from 3.0.6-RC3 to 3.0.6-RC4
- '3.0.6-RC3' => array(),
- // No changes from 3.0.6-RC4 to 3.0.6
- '3.0.6-RC4' => array(),
-
- // Changes from 3.0.6 to 3.0.7-RC1
- '3.0.6' => array(
- 'drop_keys' => array(
- LOG_TABLE => array('log_time'),
- ),
- 'add_index' => array(
- TOPICS_TRACK_TABLE => array(
- 'topic_id' => array('topic_id'),
- ),
- ),
- ),
-
- // No changes from 3.0.7-RC1 to 3.0.7-RC2
- '3.0.7-RC1' => array(),
- // No changes from 3.0.7-RC2 to 3.0.7
- '3.0.7-RC2' => array(),
- // No changes from 3.0.7 to 3.0.7-PL1
- '3.0.7' => array(),
- // No changes from 3.0.7-PL1 to 3.0.8-RC1
- '3.0.7-PL1' => array(),
- // No changes from 3.0.8-RC1 to 3.0.8
- '3.0.8-RC1' => array(),
- // Changes from 3.0.8 to 3.0.9-RC1
- '3.0.8' => array(
- 'add_tables' => array(
- LOGIN_ATTEMPT_TABLE => array(
- 'COLUMNS' => array(
- // this column was removed from the database updater
- // after 3.0.9-RC3 was released. It might still exist
- // in 3.0.9-RCX installations and has to be dropped in
- // 3.0.15 after the db_tools class is capable of properly
- // removing a primary key.
- // 'attempt_id' => array('UINT', NULL, 'auto_increment'),
- 'attempt_ip' => array('VCHAR:40', ''),
- 'attempt_browser' => array('VCHAR:150', ''),
- 'attempt_forwarded_for' => array('VCHAR:255', ''),
- 'attempt_time' => array('TIMESTAMP', 0),
- 'user_id' => array('UINT', 0),
- 'username' => array('VCHAR_UNI:255', 0),
- 'username_clean' => array('VCHAR_CI', 0),
- ),
- //'PRIMARY_KEY' => 'attempt_id',
- 'KEYS' => array(
- 'att_ip' => array('INDEX', array('attempt_ip', 'attempt_time')),
- 'att_for' => array('INDEX', array('attempt_forwarded_for', 'attempt_time')),
- 'att_time' => array('INDEX', array('attempt_time')),
- 'user_id' => array('INDEX', 'user_id'),
- ),
- ),
- ),
- 'change_columns' => array(
- BBCODES_TABLE => array(
- 'bbcode_id' => array('USINT', 0),
- ),
- ),
- ),
- // No changes from 3.0.9-RC1 to 3.0.9-RC2
- '3.0.9-RC1' => array(),
- // No changes from 3.0.9-RC2 to 3.0.9-RC3
- '3.0.9-RC2' => array(),
- // No changes from 3.0.9-RC3 to 3.0.9-RC4
- '3.0.9-RC3' => array(),
- // No changes from 3.0.9-RC4 to 3.0.9
- '3.0.9-RC4' => array(),
- // No changes from 3.0.9 to 3.0.10-RC1
- '3.0.9' => array(),
- // No changes from 3.0.10-RC1 to 3.0.10-RC2
- '3.0.10-RC1' => array(),
- // No changes from 3.0.10-RC2 to 3.0.10-RC3
- '3.0.10-RC2' => array(),
- // No changes from 3.0.10-RC3 to 3.0.10
- '3.0.10-RC3' => array(),
- // No changes from 3.0.10 to 3.0.11-RC1
- '3.0.10' => array(),
- // Changes from 3.0.11-RC1 to 3.0.11-RC2
- '3.0.11-RC1' => array(
- 'add_columns' => array(
- PROFILE_FIELDS_TABLE => array(
- 'field_show_novalue' => array('BOOL', 0),
- ),
- ),
- ),
- // No changes from 3.0.11-RC2 to 3.0.11
- '3.0.11-RC2' => array(),
- // No changes from 3.0.11 to 3.0.12-RC1
- '3.0.11' => array(),
- // No changes from 3.0.12-RC1 to 3.0.12-RC2
- '3.0.12-RC1' => array(),
- // No changes from 3.0.12-RC2 to 3.0.12-RC3
- '3.0.12-RC2' => array(),
- // No changes from 3.0.12-RC3 to 3.0.12
- '3.0.12-RC3' => array(),
- // No changes from 3.0.12 to 3.0.13-RC1
- '3.0.12' => array(),
- // No changes from 3.0.13-RC1 to 3.0.13
- '3.0.13-RC1' => array(),
- // No changes from 3.0.13 to 3.0.13-PL1
- '3.0.13' => array(),
- // No changes from 3.0.13-PL1 to 3.0.14-RC1
- '3.0.13-PL1' => array(),
- // No changes from 3.0.14-RC1 to 3.0.14
- '3.0.14-RC1' => array(),
-
- /** @todo DROP LOGIN_ATTEMPT_TABLE.attempt_id in 3.0.15-RC1 */
- );
-}
-
-/****************************************************************************
-* ADD YOUR DATABASE DATA CHANGES HERE *
-* REMEMBER: You NEED to enter a schema array above and a data array here, *
-* even if both or one of them are empty. *
-*****************************************************************************/
-function change_database_data(&$no_updates, $version)
-{
- global $db, $db_tools, $errored, $error_ary, $config, $table_prefix, $phpbb_root_path, $phpEx;
-
- switch ($version)
- {
- case '3.0.0':
-
- $sql = 'UPDATE ' . TOPICS_TABLE . "
- SET topic_last_view_time = topic_last_post_time
- WHERE topic_last_view_time = 0";
- _sql($sql, $errored, $error_ary);
-
- // Update smiley sizes
- $smileys = array('icon_e_surprised.gif', 'icon_eek.gif', 'icon_cool.gif', 'icon_lol.gif', 'icon_mad.gif', 'icon_razz.gif', 'icon_redface.gif', 'icon_cry.gif', 'icon_evil.gif', 'icon_twisted.gif', 'icon_rolleyes.gif', 'icon_exclaim.gif', 'icon_question.gif', 'icon_idea.gif', 'icon_arrow.gif', 'icon_neutral.gif', 'icon_mrgreen.gif', 'icon_e_ugeek.gif');
-
- foreach ($smileys as $smiley)
- {
- if (file_exists($phpbb_root_path . 'images/smilies/' . $smiley))
- {
- list($width, $height) = getimagesize($phpbb_root_path . 'images/smilies/' . $smiley);
-
- $sql = 'UPDATE ' . SMILIES_TABLE . '
- SET smiley_width = ' . $width . ', smiley_height = ' . $height . "
- WHERE smiley_url = '" . $db->sql_escape($smiley) . "'";
-
- _sql($sql, $errored, $error_ary);
- }
- }
-
- $no_updates = false;
- break;
-
- // No changes from 3.0.1-RC1 to 3.0.1
- case '3.0.1-RC1':
- break;
-
- // changes from 3.0.1 to 3.0.2-RC1
- case '3.0.1':
-
- set_config('referer_validation', '1');
- set_config('check_attachment_content', '1');
- set_config('mime_triggers', 'body|head|html|img|plaintext|a href|pre|script|table|title');
-
- $no_updates = false;
- break;
-
- // No changes from 3.0.2-RC1 to 3.0.2-RC2
- case '3.0.2-RC1':
- break;
-
- // No changes from 3.0.2-RC2 to 3.0.2
- case '3.0.2-RC2':
- break;
-
- // Changes from 3.0.2 to 3.0.3-RC1
- case '3.0.2':
- set_config('enable_queue_trigger', '0');
- set_config('queue_trigger_posts', '3');
-
- set_config('pm_max_recipients', '0');
-
- // Set maximum number of recipients for the registered users, bots, guests group
- $sql = 'UPDATE ' . GROUPS_TABLE . ' SET group_max_recipients = 5
- WHERE ' . $db->sql_in_set('group_name', array('GUESTS', 'REGISTERED', 'REGISTERED_COPPA', 'BOTS'));
- _sql($sql, $errored, $error_ary);
-
- // Not prefilling yet
- set_config('dbms_version', '');
-
- // Add new permission u_masspm_group and duplicate settings from u_masspm
- include_once($phpbb_root_path . 'includes/acp/auth.' . $phpEx);
- $auth_admin = new auth_admin();
-
- // Only add the new permission if it does not already exist
- if (empty($auth_admin->acl_options['id']['u_masspm_group']))
- {
- $auth_admin->acl_add_option(array('global' => array('u_masspm_group')));
-
- // Now the tricky part, filling the permission
- $old_id = $auth_admin->acl_options['id']['u_masspm'];
- $new_id = $auth_admin->acl_options['id']['u_masspm_group'];
-
- $tables = array(ACL_GROUPS_TABLE, ACL_ROLES_DATA_TABLE, ACL_USERS_TABLE);
-
- foreach ($tables as $table)
- {
- $sql = 'SELECT *
- FROM ' . $table . '
- WHERE auth_option_id = ' . $old_id;
- $result = _sql($sql, $errored, $error_ary);
-
- $sql_ary = array();
- while ($row = $db->sql_fetchrow($result))
- {
- $row['auth_option_id'] = $new_id;
- $sql_ary[] = $row;
- }
- $db->sql_freeresult($result);
-
- if (sizeof($sql_ary))
- {
- $db->sql_multi_insert($table, $sql_ary);
- }
- }
-
- // Remove any old permission entries
- $auth_admin->acl_clear_prefetch();
- }
-
- /**
- * Do not resync post counts here. An admin may do this later from the ACP
- $start = 0;
- $step = ($config['num_posts']) ? (max((int) ($config['num_posts'] / 5), 20000)) : 20000;
-
- $sql = 'UPDATE ' . USERS_TABLE . ' SET user_posts = 0';
- _sql($sql, $errored, $error_ary);
-
- do
- {
- $sql = 'SELECT COUNT(post_id) AS num_posts, poster_id
- FROM ' . POSTS_TABLE . '
- WHERE post_id BETWEEN ' . ($start + 1) . ' AND ' . ($start + $step) . '
- AND post_postcount = 1 AND post_approved = 1
- GROUP BY poster_id';
- $result = _sql($sql, $errored, $error_ary);
-
- if ($row = $db->sql_fetchrow($result))
- {
- do
- {
- $sql = 'UPDATE ' . USERS_TABLE . " SET user_posts = user_posts + {$row['num_posts']} WHERE user_id = {$row['poster_id']}";
- _sql($sql, $errored, $error_ary);
- }
- while ($row = $db->sql_fetchrow($result));
-
- $start += $step;
- }
- else
- {
- $start = 0;
- }
- $db->sql_freeresult($result);
- }
- while ($start);
- */
-
- $sql = 'UPDATE ' . MODULES_TABLE . '
- SET module_auth = \'acl_a_email && cfg_email_enable\'
- WHERE module_class = \'acp\'
- AND module_basename = \'email\'';
- _sql($sql, $errored, $error_ary);
-
- $no_updates = false;
- break;
-
- // Changes from 3.0.3-RC1 to 3.0.3
- case '3.0.3-RC1':
- if ($db->sql_layer == 'oracle')
- {
- // log_operation is CLOB - but we can change this later
- $sql = 'UPDATE ' . LOG_TABLE . "
- SET log_operation = 'LOG_DELETE_TOPIC'
- WHERE log_operation LIKE 'LOG_TOPIC_DELETED'";
- _sql($sql, $errored, $error_ary);
- }
- else
- {
- $sql = 'UPDATE ' . LOG_TABLE . "
- SET log_operation = 'LOG_DELETE_TOPIC'
- WHERE log_operation = 'LOG_TOPIC_DELETED'";
- _sql($sql, $errored, $error_ary);
- }
-
- $no_updates = false;
- break;
-
- // Changes from 3.0.3 to 3.0.4-RC1
- case '3.0.3':
- // Update the Custom Profile Fields based on previous settings to the new format
- $sql = 'SELECT field_id, field_required, field_show_on_reg, field_hide
- FROM ' . PROFILE_FIELDS_TABLE;
- $result = _sql($sql, $errored, $error_ary);
-
- while ($row = $db->sql_fetchrow($result))
- {
- $sql_ary = array(
- 'field_required' => 0,
- 'field_show_on_reg' => 0,
- 'field_hide' => 0,
- 'field_show_profile'=> 0,
- );
-
- if ($row['field_required'])
- {
- $sql_ary['field_required'] = $sql_ary['field_show_on_reg'] = $sql_ary['field_show_profile'] = 1;
- }
- else if ($row['field_show_on_reg'])
- {
- $sql_ary['field_show_on_reg'] = $sql_ary['field_show_profile'] = 1;
- }
- else if ($row['field_hide'])
- {
- // Only administrators and moderators can see this CPF, if the view is enabled, they can see it, otherwise just admins in the acp_users module
- $sql_ary['field_hide'] = 1;
- }
- else
- {
- // equivelant to "none", which is the "Display in user control panel" option
- $sql_ary['field_show_profile'] = 1;
- }
-
- _sql('UPDATE ' . PROFILE_FIELDS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . ' WHERE field_id = ' . $row['field_id'], $errored, $error_ary);
- }
- $no_updates = false;
-
- break;
-
- // Changes from 3.0.4-RC1 to 3.0.4
- case '3.0.4-RC1':
- break;
-
- // Changes from 3.0.4 to 3.0.5-RC1
- case '3.0.4':
-
- // Captcha config variables
- set_config('captcha_gd_wave', 0);
- set_config('captcha_gd_3d_noise', 1);
- set_config('captcha_gd_fonts', 1);
- set_config('confirm_refresh', 1);
-
- // Maximum number of keywords
- set_config('max_num_search_keywords', 10);
-
- // Remove static config var and put it back as dynamic variable
- $sql = 'UPDATE ' . CONFIG_TABLE . "
- SET is_dynamic = 1
- WHERE config_name = 'search_indexing_state'";
- _sql($sql, $errored, $error_ary);
-
- // Hash old MD5 passwords
- $sql = 'SELECT user_id, user_password
- FROM ' . USERS_TABLE . '
- WHERE user_pass_convert = 1';
- $result = _sql($sql, $errored, $error_ary);
-
- while ($row = $db->sql_fetchrow($result))
- {
- if (strlen($row['user_password']) == 32)
- {
- $sql_ary = array(
- 'user_password' => phpbb_hash($row['user_password']),
- );
-
- _sql('UPDATE ' . USERS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . ' WHERE user_id = ' . $row['user_id'], $errored, $error_ary);
- }
- }
- $db->sql_freeresult($result);
-
- // Adjust bot entry
- $sql = 'UPDATE ' . BOTS_TABLE . "
- SET bot_agent = 'ichiro/'
- WHERE bot_agent = 'ichiro/2'";
- _sql($sql, $errored, $error_ary);
-
-
- // Before we are able to add a unique key to auth_option, we need to remove duplicate entries
-
- // We get duplicate entries first
- $sql = 'SELECT auth_option
- FROM ' . ACL_OPTIONS_TABLE . '
- GROUP BY auth_option
- HAVING COUNT(*) >= 2';
- $result = $db->sql_query($sql);
-
- $auth_options = array();
- while ($row = $db->sql_fetchrow($result))
- {
- $auth_options[] = $row['auth_option'];
- }
- $db->sql_freeresult($result);
-
- // Remove specific auth options
- if (!empty($auth_options))
- {
- foreach ($auth_options as $option)
- {
- // Select auth_option_ids... the largest id will be preserved
- $sql = 'SELECT auth_option_id
- FROM ' . ACL_OPTIONS_TABLE . "
- WHERE auth_option = '" . $db->sql_escape($option) . "'
- ORDER BY auth_option_id DESC";
- // sql_query_limit not possible here, due to bug in postgresql layer
- $result = $db->sql_query($sql);
-
- // Skip first row, this is our original auth option we want to preserve
- $row = $db->sql_fetchrow($result);
-
- while ($row = $db->sql_fetchrow($result))
- {
- // Ok, remove this auth option...
- _sql('DELETE FROM ' . ACL_OPTIONS_TABLE . ' WHERE auth_option_id = ' . $row['auth_option_id'], $errored, $error_ary);
- _sql('DELETE FROM ' . ACL_ROLES_DATA_TABLE . ' WHERE auth_option_id = ' . $row['auth_option_id'], $errored, $error_ary);
- _sql('DELETE FROM ' . ACL_GROUPS_TABLE . ' WHERE auth_option_id = ' . $row['auth_option_id'], $errored, $error_ary);
- _sql('DELETE FROM ' . ACL_USERS_TABLE . ' WHERE auth_option_id = ' . $row['auth_option_id'], $errored, $error_ary);
- }
- $db->sql_freeresult($result);
- }
- }
-
- // Now make auth_option UNIQUE, by dropping the old index and adding a UNIQUE one.
- $changes = array(
- 'drop_keys' => array(
- ACL_OPTIONS_TABLE => array('auth_option'),
- ),
- );
-
- $statements = $db_tools->perform_schema_changes($changes);
-
- foreach ($statements as $sql)
- {
- _sql($sql, $errored, $error_ary);
- }
-
- $changes = array(
- 'add_unique_index' => array(
- ACL_OPTIONS_TABLE => array(
- 'auth_option' => array('auth_option'),
- ),
- ),
- );
-
- $statements = $db_tools->perform_schema_changes($changes);
-
- foreach ($statements as $sql)
- {
- _sql($sql, $errored, $error_ary);
- }
-
- $no_updates = false;
-
- break;
-
- // No changes from 3.0.5-RC1 to 3.0.5
- case '3.0.5-RC1':
- break;
-
- // Changes from 3.0.5 to 3.0.6-RC1
- case '3.0.5':
- // Let's see if the GD Captcha can be enabled... we simply look for what *is* enabled...
- if (!empty($config['captcha_gd']) && !isset($config['captcha_plugin']))
- {
- set_config('captcha_plugin', 'phpbb_captcha_gd');
- }
- else if (!isset($config['captcha_plugin']))
- {
- set_config('captcha_plugin', 'phpbb_captcha_nogd');
- }
-
- // Entries for the Feed Feature
- set_config('feed_enable', '0');
- set_config('feed_limit', '10');
-
- set_config('feed_overall_forums', '1');
- set_config('feed_overall_forums_limit', '15');
-
- set_config('feed_overall_topics', '0');
- set_config('feed_overall_topics_limit', '15');
-
- set_config('feed_forum', '1');
- set_config('feed_topic', '1');
- set_config('feed_item_statistics', '1');
-
- // Entries for smiley pagination
- set_config('smilies_per_page', '50');
-
- // Entry for reporting PMs
- set_config('allow_pm_report', '1');
-
- // Install modules
- $modules_to_install = array(
- 'feed' => array(
- 'base' => 'board',
- 'class' => 'acp',
- 'title' => 'ACP_FEED_SETTINGS',
- 'auth' => 'acl_a_board',
- 'cat' => 'ACP_BOARD_CONFIGURATION',
- 'after' => array('signature', 'ACP_SIGNATURE_SETTINGS')
- ),
- 'warnings' => array(
- 'base' => 'users',
- 'class' => 'acp',
- 'title' => 'ACP_USER_WARNINGS',
- 'auth' => 'acl_a_user',
- 'display' => 0,
- 'cat' => 'ACP_CAT_USERS',
- 'after' => array('feedback', 'ACP_USER_FEEDBACK')
- ),
- 'send_statistics' => array(
- 'base' => 'send_statistics',
- 'class' => 'acp',
- 'title' => 'ACP_SEND_STATISTICS',
- 'auth' => 'acl_a_server',
- 'cat' => 'ACP_SERVER_CONFIGURATION'
- ),
- 'setting_forum_copy' => array(
- 'base' => 'permissions',
- 'class' => 'acp',
- 'title' => 'ACP_FORUM_PERMISSIONS_COPY',
- 'auth' => 'acl_a_fauth && acl_a_authusers && acl_a_authgroups && acl_a_mauth',
- 'cat' => 'ACP_FORUM_BASED_PERMISSIONS',
- 'after' => array('setting_forum_local', 'ACP_FORUM_PERMISSIONS')
- ),
- 'pm_reports' => array(
- 'base' => 'pm_reports',
- 'class' => 'mcp',
- 'title' => 'MCP_PM_REPORTS_OPEN',
- 'auth' => 'aclf_m_report',
- 'cat' => 'MCP_REPORTS'
- ),
- 'pm_reports_closed' => array(
- 'base' => 'pm_reports',
- 'class' => 'mcp',
- 'title' => 'MCP_PM_REPORTS_CLOSED',
- 'auth' => 'aclf_m_report',
- 'cat' => 'MCP_REPORTS'
- ),
- 'pm_report_details' => array(
- 'base' => 'pm_reports',
- 'class' => 'mcp',
- 'title' => 'MCP_PM_REPORT_DETAILS',
- 'auth' => 'aclf_m_report',
- 'cat' => 'MCP_REPORTS'
- ),
- );
-
- _add_modules($modules_to_install);
-
- // Add newly_registered group... but check if it already exists (we always supported running the updater on any schema)
- $sql = 'SELECT group_id
- FROM ' . GROUPS_TABLE . "
- WHERE group_name = 'NEWLY_REGISTERED'";
- $result = $db->sql_query($sql);
- $group_id = (int) $db->sql_fetchfield('group_id');
- $db->sql_freeresult($result);
-
- if (!$group_id)
- {
- $sql = 'INSERT INTO ' . GROUPS_TABLE . " (group_name, group_type, group_founder_manage, group_colour, group_legend, group_avatar, group_desc, group_desc_uid, group_max_recipients) VALUES ('NEWLY_REGISTERED', 3, 0, '', 0, '', '', '', 5)";
- _sql($sql, $errored, $error_ary);
-
- $group_id = $db->sql_nextid();
- }
-
- // Insert new user role... at the end of the chain
- $sql = 'SELECT role_id
- FROM ' . ACL_ROLES_TABLE . "
- WHERE role_name = 'ROLE_USER_NEW_MEMBER'
- AND role_type = 'u_'";
- $result = $db->sql_query($sql);
- $u_role = (int) $db->sql_fetchfield('role_id');
- $db->sql_freeresult($result);
-
- if (!$u_role)
- {
- $sql = 'SELECT MAX(role_order) as max_order_id
- FROM ' . ACL_ROLES_TABLE . "
- WHERE role_type = 'u_'";
- $result = $db->sql_query($sql);
- $next_order_id = (int) $db->sql_fetchfield('max_order_id');
- $db->sql_freeresult($result);
-
- $next_order_id++;
-
- $sql = 'INSERT INTO ' . ACL_ROLES_TABLE . " (role_name, role_description, role_type, role_order) VALUES ('ROLE_USER_NEW_MEMBER', 'ROLE_DESCRIPTION_USER_NEW_MEMBER', 'u_', $next_order_id)";
- _sql($sql, $errored, $error_ary);
- $u_role = $db->sql_nextid();
-
- if (!$errored)
- {
- // Now add the correct data to the roles...
- // The standard role says that new users are not able to send a PM, Mass PM, are not able to PM groups
- $sql = 'INSERT INTO ' . ACL_ROLES_DATA_TABLE . " (role_id, auth_option_id, auth_setting) SELECT $u_role, auth_option_id, 0 FROM " . ACL_OPTIONS_TABLE . " WHERE auth_option LIKE 'u_%' AND auth_option IN ('u_sendpm', 'u_masspm', 'u_masspm_group')";
- _sql($sql, $errored, $error_ary);
-
- // Add user role to group
- $sql = 'INSERT INTO ' . ACL_GROUPS_TABLE . " (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES ($group_id, 0, 0, $u_role, 0)";
- _sql($sql, $errored, $error_ary);
- }
- }
-
- // Insert new forum role
- $sql = 'SELECT role_id
- FROM ' . ACL_ROLES_TABLE . "
- WHERE role_name = 'ROLE_FORUM_NEW_MEMBER'
- AND role_type = 'f_'";
- $result = $db->sql_query($sql);
- $f_role = (int) $db->sql_fetchfield('role_id');
- $db->sql_freeresult($result);
-
- if (!$f_role)
- {
- $sql = 'SELECT MAX(role_order) as max_order_id
- FROM ' . ACL_ROLES_TABLE . "
- WHERE role_type = 'f_'";
- $result = $db->sql_query($sql);
- $next_order_id = (int) $db->sql_fetchfield('max_order_id');
- $db->sql_freeresult($result);
-
- $next_order_id++;
-
- $sql = 'INSERT INTO ' . ACL_ROLES_TABLE . " (role_name, role_description, role_type, role_order) VALUES ('ROLE_FORUM_NEW_MEMBER', 'ROLE_DESCRIPTION_FORUM_NEW_MEMBER', 'f_', $next_order_id)";
- _sql($sql, $errored, $error_ary);
- $f_role = $db->sql_nextid();
-
- if (!$errored)
- {
- $sql = 'INSERT INTO ' . ACL_ROLES_DATA_TABLE . " (role_id, auth_option_id, auth_setting) SELECT $f_role, auth_option_id, 0 FROM " . ACL_OPTIONS_TABLE . " WHERE auth_option LIKE 'f_%' AND auth_option IN ('f_noapprove')";
- _sql($sql, $errored, $error_ary);
- }
- }
-
- // Set every members user_new column to 0 (old users) only if there is no one yet (this makes sure we do not execute this more than once)
- $sql = 'SELECT 1
- FROM ' . USERS_TABLE . '
- WHERE user_new = 0';
- $result = $db->sql_query_limit($sql, 1);
- $row = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
-
- if (!$row)
- {
- $sql = 'UPDATE ' . USERS_TABLE . ' SET user_new = 0';
- _sql($sql, $errored, $error_ary);
- }
-
- // Newly registered users limit
- if (!isset($config['new_member_post_limit']))
- {
- set_config('new_member_post_limit', (!empty($config['enable_queue_trigger'])) ? $config['queue_trigger_posts'] : 0);
- }
-
- if (!isset($config['new_member_group_default']))
- {
- set_config('new_member_group_default', 0);
- }
-
- // To mimick the old "feature" we will assign the forum role to every forum, regardless of the setting (this makes sure there are no "this does not work!!!! YUO!!!" posts...
- // Check if the role is already assigned...
- $sql = 'SELECT forum_id
- FROM ' . ACL_GROUPS_TABLE . '
- WHERE group_id = ' . $group_id . '
- AND auth_role_id = ' . $f_role;
- $result = $db->sql_query($sql);
- $is_options = (int) $db->sql_fetchfield('forum_id');
- $db->sql_freeresult($result);
-
- // Not assigned at all... :/
- if (!$is_options)
- {
- // Get postable forums
- $sql = 'SELECT forum_id
- FROM ' . FORUMS_TABLE . '
- WHERE forum_type != ' . FORUM_LINK;
- $result = $db->sql_query($sql);
-
- while ($row = $db->sql_fetchrow($result))
- {
- _sql('INSERT INTO ' . ACL_GROUPS_TABLE . ' (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES (' . $group_id . ', ' . (int) $row['forum_id'] . ', 0, ' . $f_role . ', 0)', $errored, $error_ary);
- }
- $db->sql_freeresult($result);
- }
-
- // Clear permissions...
- include_once($phpbb_root_path . 'includes/acp/auth.' . $phpEx);
- $auth_admin = new auth_admin();
- $auth_admin->acl_clear_prefetch();
-
- if (!isset($config['allow_avatar']))
- {
- if ($config['allow_avatar_upload'] || $config['allow_avatar_local'] || $config['allow_avatar_remote'])
- {
- set_config('allow_avatar', '1');
- }
- else
- {
- set_config('allow_avatar', '0');
- }
- }
-
- if (!isset($config['allow_avatar_remote_upload']))
- {
- if ($config['allow_avatar_remote'] && $config['allow_avatar_upload'])
- {
- set_config('allow_avatar_remote_upload', '1');
- }
- else
- {
- set_config('allow_avatar_remote_upload', '0');
- }
- }
-
- // Minimum number of characters
- if (!isset($config['min_post_chars']))
- {
- set_config('min_post_chars', '1');
- }
-
- if (!isset($config['allow_quick_reply']))
- {
- set_config('allow_quick_reply', '1');
- }
-
- // Set every members user_options column to enable
- // bbcode, smilies and URLs for signatures by default
- $sql = 'SELECT user_options
- FROM ' . USERS_TABLE . '
- WHERE user_type IN (' . USER_NORMAL . ', ' . USER_FOUNDER . ')';
- $result = $db->sql_query_limit($sql, 1);
- $user_option = (int) $db->sql_fetchfield('user_options');
- $db->sql_freeresult($result);
-
- // Check if we already updated the database by checking bit 15 which we used to store the sig_bbcode option
- if (!($user_option & 1 << 15))
- {
- // 229376 is the added value to enable all three signature options
- $sql = 'UPDATE ' . USERS_TABLE . ' SET user_options = user_options + 229376';
- _sql($sql, $errored, $error_ary);
- }
-
- if (!isset($config['delete_time']))
- {
- set_config('delete_time', $config['edit_time']);
- }
-
- $no_updates = false;
- break;
-
- // No changes from 3.0.6-RC1 to 3.0.6-RC2
- case '3.0.6-RC1':
- break;
-
- // Changes from 3.0.6-RC2 to 3.0.6-RC3
- case '3.0.6-RC2':
-
- // Update the Custom Profile Fields based on previous settings to the new format
- $sql = 'UPDATE ' . PROFILE_FIELDS_TABLE . '
- SET field_show_on_vt = 1
- WHERE field_hide = 0
- AND (field_required = 1 OR field_show_on_reg = 1 OR field_show_profile = 1)';
- _sql($sql, $errored, $error_ary);
- $no_updates = false;
-
- break;
-
- // No changes from 3.0.6-RC3 to 3.0.6-RC4
- case '3.0.6-RC3':
- break;
-
- // No changes from 3.0.6-RC4 to 3.0.6
- case '3.0.6-RC4':
- break;
-
- // Changes from 3.0.6 to 3.0.7-RC1
- case '3.0.6':
-
- // ATOM Feeds
- set_config('feed_overall', '1');
- set_config('feed_http_auth', '0');
- set_config('feed_limit_post', (string) (isset($config['feed_limit']) ? (int) $config['feed_limit'] : 15));
- set_config('feed_limit_topic', (string) (isset($config['feed_overall_topics_limit']) ? (int) $config['feed_overall_topics_limit'] : 10));
- set_config('feed_topics_new', (!empty($config['feed_overall_topics']) ? '1' : '0'));
- set_config('feed_topics_active', (!empty($config['feed_overall_topics']) ? '1' : '0'));
-
- // Delete all text-templates from the template_data
- $sql = 'DELETE FROM ' . STYLES_TEMPLATE_DATA_TABLE . '
- WHERE template_filename ' . $db->sql_like_expression($db->any_char . '.txt');
- _sql($sql, $errored, $error_ary);
-
- $no_updates = false;
- break;
-
- // Changes from 3.0.7-RC1 to 3.0.7-RC2
- case '3.0.7-RC1':
-
- $sql = 'SELECT user_id, user_email, user_email_hash
- FROM ' . USERS_TABLE . '
- WHERE user_type <> ' . USER_IGNORE . "
- AND user_email <> ''";
- $result = $db->sql_query($sql);
-
- $i = 0;
- while ($row = $db->sql_fetchrow($result))
- {
- // Snapshot of the phpbb_email_hash() function
- // We cannot call it directly because the auto updater updates the DB first. :/
- $user_email_hash = sprintf('%u', crc32(strtolower($row['user_email']))) . strlen($row['user_email']);
-
- if ($user_email_hash != $row['user_email_hash'])
- {
- $sql_ary = array(
- 'user_email_hash' => $user_email_hash,
- );
-
- $sql = 'UPDATE ' . USERS_TABLE . '
- SET ' . $db->sql_build_array('UPDATE', $sql_ary) . '
- WHERE user_id = ' . (int) $row['user_id'];
- _sql($sql, $errored, $error_ary, ($i % 100 == 0));
-
- ++$i;
- }
- }
- $db->sql_freeresult($result);
-
- $no_updates = false;
-
- break;
-
- // No changes from 3.0.7-RC2 to 3.0.7
- case '3.0.7-RC2':
- break;
-
- // No changes from 3.0.7 to 3.0.7-PL1
- case '3.0.7':
- break;
-
- // Changes from 3.0.7-PL1 to 3.0.8-RC1
- case '3.0.7-PL1':
- // Update file extension group names to use language strings.
- $sql = 'SELECT lang_dir
- FROM ' . LANG_TABLE;
- $result = $db->sql_query($sql);
-
- $extension_groups_updated = array();
- while ($lang_dir = $db->sql_fetchfield('lang_dir'))
- {
- $lang_dir = basename($lang_dir);
-
- // The language strings we need are either in language/.../acp/attachments.php
- // in the update package if we're updating to 3.0.8-RC1 or later,
- // or they are in language/.../install.php when we're updating from 3.0.7-PL1 or earlier.
- // On an already updated board, they can also already be in language/.../acp/attachments.php
- // in the board root.
- $lang_files = array(
- "{$phpbb_root_path}install/update/new/language/$lang_dir/acp/attachments.$phpEx",
- "{$phpbb_root_path}language/$lang_dir/install.$phpEx",
- "{$phpbb_root_path}language/$lang_dir/acp/attachments.$phpEx",
- );
-
- foreach ($lang_files as $lang_file)
- {
- if (!file_exists($lang_file))
- {
- continue;
- }
-
- $lang = array();
- include($lang_file);
-
- foreach($lang as $lang_key => $lang_val)
- {
- if (isset($extension_groups_updated[$lang_key]) || strpos($lang_key, 'EXT_GROUP_') !== 0)
- {
- continue;
- }
-
- $sql_ary = array(
- 'group_name' => substr($lang_key, 10), // Strip off 'EXT_GROUP_'
- );
-
- $sql = 'UPDATE ' . EXTENSION_GROUPS_TABLE . '
- SET ' . $db->sql_build_array('UPDATE', $sql_ary) . "
- WHERE group_name = '" . $db->sql_escape($lang_val) . "'";
- _sql($sql, $errored, $error_ary);
-
- $extension_groups_updated[$lang_key] = true;
- }
- }
- }
- $db->sql_freeresult($result);
-
- // Install modules
- $modules_to_install = array(
- 'post' => array(
- 'base' => 'board',
- 'class' => 'acp',
- 'title' => 'ACP_POST_SETTINGS',
- 'auth' => 'acl_a_board',
- 'cat' => 'ACP_MESSAGES',
- 'after' => array('message', 'ACP_MESSAGE_SETTINGS')
- ),
- );
-
- _add_modules($modules_to_install);
-
- // update
- $sql = 'UPDATE ' . MODULES_TABLE . '
- SET module_auth = \'cfg_allow_avatar && (cfg_allow_avatar_local || cfg_allow_avatar_remote || cfg_allow_avatar_upload || cfg_allow_avatar_remote_upload)\'
- WHERE module_class = \'ucp\'
- AND module_basename = \'profile\'
- AND module_mode = \'avatar\'';
- _sql($sql, $errored, $error_ary);
-
- // add Bing Bot
- $bot_name = 'Bing [Bot]';
- $bot_name_clean = utf8_clean_string($bot_name);
-
- $sql = 'SELECT user_id
- FROM ' . USERS_TABLE . "
- WHERE username_clean = '" . $db->sql_escape($bot_name_clean) . "'";
- $result = $db->sql_query($sql);
- $bing_already_added = (bool) $db->sql_fetchfield('user_id');
- $db->sql_freeresult($result);
-
- if (!$bing_already_added)
- {
- $bot_agent = 'bingbot/';
- $bot_ip = '';
- $sql = 'SELECT group_id, group_colour
- FROM ' . GROUPS_TABLE . "
- WHERE group_name = 'BOTS'";
- $result = $db->sql_query($sql);
- $group_row = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
-
- if (!$group_row)
- {
- // default fallback, should never get here
- $group_row['group_id'] = 6;
- $group_row['group_colour'] = '9E8DA7';
- }
-
- if (!function_exists('user_add'))
- {
- include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
- }
-
- $user_row = array(
- 'user_type' => USER_IGNORE,
- 'group_id' => $group_row['group_id'],
- 'username' => $bot_name,
- 'user_regdate' => time(),
- 'user_password' => '',
- 'user_colour' => $group_row['group_colour'],
- 'user_email' => '',
- 'user_lang' => $config['default_lang'],
- 'user_style' => $config['default_style'],
- 'user_timezone' => 0,
- 'user_dateformat' => $config['default_dateformat'],
- 'user_allow_massemail' => 0,
- );
-
- $user_id = user_add($user_row);
-
- $sql = 'INSERT INTO ' . BOTS_TABLE . ' ' . $db->sql_build_array('INSERT', array(
- 'bot_active' => 1,
- 'bot_name' => (string) $bot_name,
- 'user_id' => (int) $user_id,
- 'bot_agent' => (string) $bot_agent,
- 'bot_ip' => (string) $bot_ip,
- ));
-
- _sql($sql, $errored, $error_ary);
- }
- // end Bing Bot addition
-
- // Delete shadow topics pointing to not existing topics
- $batch_size = 500;
-
- // Set of affected forums we have to resync
- $sync_forum_ids = array();
-
- do
- {
- $sql_array = array(
- 'SELECT' => 't1.topic_id, t1.forum_id',
- 'FROM' => array(
- TOPICS_TABLE => 't1',
- ),
- 'LEFT_JOIN' => array(
- array(
- 'FROM' => array(TOPICS_TABLE => 't2'),
- 'ON' => 't1.topic_moved_id = t2.topic_id',
- ),
- ),
- 'WHERE' => 't1.topic_moved_id <> 0
- AND t2.topic_id IS NULL',
- );
- $sql = $db->sql_build_query('SELECT', $sql_array);
- $result = $db->sql_query_limit($sql, $batch_size);
-
- $topic_ids = array();
- while ($row = $db->sql_fetchrow($result))
- {
- $topic_ids[] = (int) $row['topic_id'];
-
- $sync_forum_ids[(int) $row['forum_id']] = (int) $row['forum_id'];
- }
- $db->sql_freeresult($result);
-
- if (!empty($topic_ids))
- {
- $sql = 'DELETE FROM ' . TOPICS_TABLE . '
- WHERE ' . $db->sql_in_set('topic_id', $topic_ids);
- $db->sql_query($sql);
- }
- }
- while (sizeof($topic_ids) == $batch_size);
-
- // Sync the forums we have deleted shadow topics from.
- sync('forum', 'forum_id', $sync_forum_ids, true, true);
-
- // Unread posts search load switch
- set_config('load_unreads_search', '1');
-
- // Reduce queue interval to 60 seconds, email package size to 20
- if ($config['queue_interval'] == 600)
- {
- set_config('queue_interval', '60');
- }
-
- if ($config['email_package_size'] == 50)
- {
- set_config('email_package_size', '20');
- }
-
- $no_updates = false;
- break;
-
- // No changes from 3.0.8-RC1 to 3.0.8
- case '3.0.8-RC1':
- break;
-
- // Changes from 3.0.8 to 3.0.9-RC1
- case '3.0.8':
- set_config('ip_login_limit_max', '50');
- set_config('ip_login_limit_time', '21600');
- set_config('ip_login_limit_use_forwarded', '0');
-
- // Update file extension group names to use language strings, again.
- $sql = 'SELECT group_id, group_name
- FROM ' . EXTENSION_GROUPS_TABLE . '
- WHERE group_name ' . $db->sql_like_expression('EXT_GROUP_' . $db->any_char);
- $result = $db->sql_query($sql);
-
- while ($row = $db->sql_fetchrow($result))
- {
- $sql_ary = array(
- 'group_name' => substr($row['group_name'], 10), // Strip off 'EXT_GROUP_'
- );
-
- $sql = 'UPDATE ' . EXTENSION_GROUPS_TABLE . '
- SET ' . $db->sql_build_array('UPDATE', $sql_ary) . '
- WHERE group_id = ' . $row['group_id'];
- _sql($sql, $errored, $error_ary);
- }
- $db->sql_freeresult($result);
-
- /*
- * Due to a bug, vanilla phpbb could not create captcha tables
- * in 3.0.8 on firebird. It was possible for board administrators
- * to adjust the code to work. If code was manually adjusted by
- * board administrators, index names would not be the same as
- * what 3.0.9 and newer expect. This code fragment drops captcha
- * tables, destroying all entered Q&A captcha configuration, such
- * that when Q&A is configured next the respective tables will be
- * created with correct index names.
- *
- * If you wish to preserve your Q&A captcha configuration, you can
- * manually rename indexes to the currently expected name:
- * phpbb_captcha_questions_lang_iso => phpbb_captcha_questions_lang
- * phpbb_captcha_answers_question_id => phpbb_captcha_answers_qid
- *
- * Again, this needs to be done only if a board was manually modified
- * to fix broken captcha code.
- *
- if ($db_tools->sql_layer == 'firebird')
- {
- $changes = array(
- 'drop_tables' => array(
- $table_prefix . 'captcha_questions',
- $table_prefix . 'captcha_answers',
- $table_prefix . 'qa_confirm',
- ),
- );
- $statements = $db_tools->perform_schema_changes($changes);
-
- foreach ($statements as $sql)
- {
- _sql($sql, $errored, $error_ary);
- }
- }
- */
-
- $no_updates = false;
- break;
-
- // No changes from 3.0.9-RC1 to 3.0.9-RC2
- case '3.0.9-RC1':
- break;
-
- // No changes from 3.0.9-RC2 to 3.0.9-RC3
- case '3.0.9-RC2':
- break;
-
- // No changes from 3.0.9-RC3 to 3.0.9-RC4
- case '3.0.9-RC3':
- break;
-
- // No changes from 3.0.9-RC4 to 3.0.9
- case '3.0.9-RC4':
- break;
-
- // Changes from 3.0.9 to 3.0.10-RC1
- case '3.0.9':
- if (!isset($config['email_max_chunk_size']))
- {
- set_config('email_max_chunk_size', '50');
- }
-
- $no_updates = false;
- break;
-
- // No changes from 3.0.10-RC1 to 3.0.10-RC2
- case '3.0.10-RC1':
- break;
-
- // No changes from 3.0.10-RC2 to 3.0.10-RC3
- case '3.0.10-RC2':
- break;
-
- // No changes from 3.0.10-RC3 to 3.0.10
- case '3.0.10-RC3':
- break;
-
- // Changes from 3.0.10 to 3.0.11-RC1
- case '3.0.10':
- // Updates users having current style a deactivated one
- $sql = 'SELECT style_id
- FROM ' . STYLES_TABLE . '
- WHERE style_active = 0';
- $result = $db->sql_query($sql);
-
- $deactivated_style_ids = array();
- while ($style_id = $db->sql_fetchfield('style_id', false, $result))
- {
- $deactivated_style_ids[] = (int) $style_id;
- }
- $db->sql_freeresult($result);
-
- if (!empty($deactivated_style_ids))
- {
- $sql = 'UPDATE ' . USERS_TABLE . '
- SET user_style = ' . (int) $config['default_style'] .'
- WHERE ' . $db->sql_in_set('user_style', $deactivated_style_ids);
- _sql($sql, $errored, $error_ary);
- }
-
- // Delete orphan private messages
- $batch_size = 500;
-
- $sql_array = array(
- 'SELECT' => 'p.msg_id',
- 'FROM' => array(
- PRIVMSGS_TABLE => 'p',
- ),
- 'LEFT_JOIN' => array(
- array(
- 'FROM' => array(PRIVMSGS_TO_TABLE => 't'),
- 'ON' => 'p.msg_id = t.msg_id',
- ),
- ),
- 'WHERE' => 't.user_id IS NULL',
- );
- $sql = $db->sql_build_query('SELECT', $sql_array);
-
- do
- {
- $result = $db->sql_query_limit($sql, $batch_size);
-
- $delete_pms = array();
- while ($row = $db->sql_fetchrow($result))
- {
- $delete_pms[] = (int) $row['msg_id'];
- }
- $db->sql_freeresult($result);
-
- if (!empty($delete_pms))
- {
- $sql = 'DELETE FROM ' . PRIVMSGS_TABLE . '
- WHERE ' . $db->sql_in_set('msg_id', $delete_pms);
- _sql($sql, $errored, $error_ary);
- }
- }
- while (sizeof($delete_pms) == $batch_size);
-
- $no_updates = false;
- break;
-
- // No changes from 3.0.11-RC1 to 3.0.11-RC2
- case '3.0.11-RC1':
- break;
-
- // No changes from 3.0.11-RC2 to 3.0.11
- case '3.0.11-RC2':
- break;
-
- // Changes from 3.0.11 to 3.0.12-RC1
- case '3.0.11':
- $sql = 'UPDATE ' . MODULES_TABLE . '
- SET module_auth = \'acl_u_sig\'
- WHERE module_class = \'ucp\'
- AND module_basename = \'profile\'
- AND module_mode = \'signature\'';
- _sql($sql, $errored, $error_ary);
-
- // Update bots
- if (!function_exists('user_delete'))
- {
- include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
- }
-
- $bots_updates = array(
- // Bot Deletions
- 'NG-Search [Bot]' => false,
- 'Nutch/CVS [Bot]' => false,
- 'OmniExplorer [Bot]' => false,
- 'Seekport [Bot]' => false,
- 'Synoo [Bot]' => false,
- 'WiseNut [Bot]' => false,
-
- // Bot Updates
- // Bot name to bot user agent map
- 'Baidu [Spider]' => 'Baiduspider',
- 'Exabot [Bot]' => 'Exabot',
- 'Voyager [Bot]' => 'voyager/',
- 'W3C [Validator]' => 'W3C_Validator',
- );
-
- foreach ($bots_updates as $bot_name => $bot_agent)
- {
- $sql = 'SELECT user_id
- FROM ' . USERS_TABLE . '
- WHERE user_type = ' . USER_IGNORE . "
- AND username_clean = '" . $db->sql_escape(utf8_clean_string($bot_name)) . "'";
- $result = $db->sql_query($sql);
- $bot_user_id = (int) $db->sql_fetchfield('user_id');
- $db->sql_freeresult($result);
-
- if ($bot_user_id)
- {
- if ($bot_agent === false)
- {
- $sql = 'DELETE FROM ' . BOTS_TABLE . "
- WHERE user_id = $bot_user_id";
- _sql($sql, $errored, $error_ary);
-
- user_delete('remove', $bot_user_id);
- }
- else
- {
- $sql = 'UPDATE ' . BOTS_TABLE . "
- SET bot_agent = '" . $db->sql_escape($bot_agent) . "'
- WHERE user_id = $bot_user_id";
- _sql($sql, $errored, $error_ary);
- }
- }
- }
-
- // Disable receiving pms for bots
- $sql = 'SELECT user_id
- FROM ' . BOTS_TABLE;
- $result = $db->sql_query($sql);
-
- $bot_user_ids = array();
- while ($row = $db->sql_fetchrow($result))
- {
- $bot_user_ids[] = (int) $row['user_id'];
- }
- $db->sql_freeresult($result);
-
- if (!empty($bot_user_ids))
- {
- $sql = 'UPDATE ' . USERS_TABLE . '
- SET user_allow_pm = 0
- WHERE ' . $db->sql_in_set('user_id', $bot_user_ids);
- _sql($sql, $errored, $error_ary);
- }
-
- /**
- * Update BBCodes that currently use the LOCAL_URL tag
- *
- * To fix http://tracker.phpbb.com/browse/PHPBB3-8319 we changed
- * the second_pass_replace value, so that needs updating for existing ones
- */
- $sql = 'SELECT *
- FROM ' . BBCODES_TABLE . '
- WHERE bbcode_match ' . $db->sql_like_expression($db->any_char . 'LOCAL_URL' . $db->any_char);
- $result = $db->sql_query($sql);
-
- while ($row = $db->sql_fetchrow($result))
- {
- if (!class_exists('acp_bbcodes'))
- {
- phpbb_require_updated('includes/acp/acp_bbcodes.' . $phpEx);
- }
- $bbcode_match = $row['bbcode_match'];
- $bbcode_tpl = $row['bbcode_tpl'];
-
- $acp_bbcodes = new acp_bbcodes();
- $sql_ary = $acp_bbcodes->build_regexp($bbcode_match, $bbcode_tpl);
-
- $sql = 'UPDATE ' . BBCODES_TABLE . '
- SET ' . $db->sql_build_array('UPDATE', $sql_ary) . '
- WHERE bbcode_id = ' . (int) $row['bbcode_id'];
- $db->sql_query($sql);
- }
- $db->sql_freeresult($result);
-
- $no_updates = false;
- break;
-
- // No changes from 3.0.12-RC1 to 3.0.12-RC2
- case '3.0.12-RC1':
- break;
-
- // No changes from 3.0.12-RC2 to 3.0.12-RC3
- case '3.0.12-RC2':
- break;
-
- // No changes from 3.0.12-RC3 to 3.0.12
- case '3.0.12-RC3':
- break;
-
- // No changes from 3.0.12 to 3.0.13-RC1
- case '3.0.12':
- break;
-
- // No changes from 3.0.13-RC1 to 3.0.13
- case '3.0.13-RC1':
- break;
-
- // No changes from 3.0.13 to 3.0.13-PL1
- case '3.0.13':
- break;
-
- // No changes from 3.0.13-PL1 to 3.0.14-RC1
- case '3.0.13-PL1':
- break;
-
- // No changes from 3.0.14-RC1 to 3.0.14
- case '3.0.14-RC1':
- break;
- }
-}
-
-?>
+phpbb_end_update($cache, $config);
diff --git a/phpBB/install/index.php b/phpBB/install/index.php
index 35e7c70e1d..b5d14f27cf 100644
--- a/phpBB/install/index.php
+++ b/phpBB/install/index.php
@@ -1,10 +1,13 @@
<?php
/**
*
-* @package install
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -18,15 +21,14 @@ define('IN_INSTALL', true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './../';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
-// @todo Review this test and see if we can find out what it is which prevents PHP 4.2.x from even displaying the page with requirements on it
-if (version_compare(PHP_VERSION, '4.3.3') < 0)
+if (version_compare(PHP_VERSION, '5.3.3') < 0)
{
- die('You are running an unsupported PHP version. Please upgrade to PHP 4.3.3 or higher before trying to install phpBB 3.0');
+ die('You are running an unsupported PHP version. Please upgrade to PHP 5.3.3 or higher before trying to install phpBB 3.1');
}
function phpbb_require_updated($path, $optional = false)
{
- global $phpbb_root_path;
+ global $phpbb_root_path, $table_prefix;
$new_path = $phpbb_root_path . 'install/update/new/' . $path;
$old_path = $phpbb_root_path . $path;
@@ -41,6 +43,23 @@ function phpbb_require_updated($path, $optional = false)
}
}
+function phpbb_include_updated($path, $optional = false)
+{
+ global $phpbb_root_path;
+
+ $new_path = $phpbb_root_path . 'install/update/new/' . $path;
+ $old_path = $phpbb_root_path . $path;
+
+ if (file_exists($new_path))
+ {
+ include($new_path);
+ }
+ else if (!$optional || file_exists($old_path))
+ {
+ include($old_path);
+ }
+}
+
phpbb_require_updated('includes/startup.' . $phpEx);
// Try to override some limits - maybe it helps some...
@@ -71,26 +90,70 @@ else
}
@ini_set('memory_limit', $mem_limit);
+// In case $phpbb_adm_relative_path is not set (in case of an update), use the default.
+$phpbb_adm_relative_path = (isset($phpbb_adm_relative_path)) ? $phpbb_adm_relative_path : 'adm/';
+$phpbb_admin_path = (defined('PHPBB_ADMIN_PATH')) ? PHPBB_ADMIN_PATH : $phpbb_root_path . $phpbb_adm_relative_path;
+
// Include essential scripts
-require($phpbb_root_path . 'includes/functions.' . $phpEx);
+phpbb_require_updated('phpbb/class_loader.' . $phpEx);
+
+phpbb_require_updated('includes/functions.' . $phpEx);
phpbb_require_updated('includes/functions_content.' . $phpEx, true);
-include($phpbb_root_path . 'includes/auth.' . $phpEx);
-include($phpbb_root_path . 'includes/session.' . $phpEx);
-include($phpbb_root_path . 'includes/template.' . $phpEx);
-include($phpbb_root_path . 'includes/acm/acm_file.' . $phpEx);
-include($phpbb_root_path . 'includes/cache.' . $phpEx);
-include($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
-include($phpbb_root_path . 'includes/utf/utf_tools.' . $phpEx);
-require($phpbb_root_path . 'includes/functions_install.' . $phpEx);
+phpbb_include_updated('includes/functions_admin.' . $phpEx);
+phpbb_include_updated('includes/utf/utf_normalizer.' . $phpEx);
+phpbb_include_updated('includes/utf/utf_tools.' . $phpEx);
+phpbb_require_updated('includes/functions_install.' . $phpEx);
+
+// Setup class loader first
+$phpbb_class_loader_new = new \phpbb\class_loader('phpbb\\', "{$phpbb_root_path}install/update/new/phpbb/", $phpEx);
+$phpbb_class_loader_new->register();
+$phpbb_class_loader = new \phpbb\class_loader('phpbb\\', "{$phpbb_root_path}phpbb/", $phpEx);
+$phpbb_class_loader->register();
+$phpbb_class_loader_ext = new \phpbb\class_loader('\\', "{$phpbb_root_path}ext/", $phpEx);
+$phpbb_class_loader_ext->register();
+
+// Set up container
+$phpbb_config_php_file = new \phpbb\config_php_file($phpbb_root_path, $phpEx);
+$phpbb_container_builder = new \phpbb\di\container_builder($phpbb_config_php_file, $phpbb_root_path, $phpEx);
+$phpbb_container_builder->set_use_extensions(false);
+$phpbb_container_builder->set_dump_container(false);
+$phpbb_container_builder->set_use_custom_pass(false);
+$phpbb_container_builder->set_inject_config(false);
+$phpbb_container_builder->set_compile_container(false);
+
+$other_config_path = $phpbb_root_path . 'install/update/new/config/';
+$config_path = file_exists($other_config_path . 'services.yml') ? $other_config_path : $phpbb_root_path . 'config/';
+$phpbb_container_builder->set_config_path($config_path);
+
+$phpbb_container_builder->set_custom_parameters(array(
+ 'core.root_path' => $phpbb_root_path,
+ 'core.adm_relative_path' => $phpbb_adm_relative_path,
+ 'core.php_ext' => $phpEx,
+ 'core.table_prefix' => '',
+ 'cache.driver.class' => 'phpbb\cache\driver\file',
+));
+
+$phpbb_container = $phpbb_container_builder->get_container();
+$phpbb_container->register('dbal.conn.driver')->setSynthetic(true);
+$phpbb_container->compile();
+
+$phpbb_class_loader->set_cache($phpbb_container->get('cache.driver'));
+$phpbb_class_loader_ext->set_cache($phpbb_container->get('cache.driver'));
+
+$phpbb_dispatcher = $phpbb_container->get('dispatcher');
+$request = $phpbb_container->get('request');
+
+// make sure request_var uses this request instance
+request_var('', 0, false, false, $request); // "dependency injection" for a function
// Try and load an appropriate language if required
-$language = basename(request_var('language', ''));
+$language = basename($request->variable('language', ''));
-if (!empty($_SERVER['HTTP_ACCEPT_LANGUAGE']) && !$language)
+if ($request->header('Accept-Language') && !$language)
{
- $accept_lang_ary = explode(',', strtolower($_SERVER['HTTP_ACCEPT_LANGUAGE']));
+ $accept_lang_ary = explode(',', strtolower($request->header('Accept-Language')));
foreach ($accept_lang_ary as $accept_lang)
{
// Set correct format ... guess full xx_yy form
@@ -145,11 +208,23 @@ if (!file_exists($phpbb_root_path . 'language/' . $language) || !is_dir($phpbb_r
}
// And finally, load the relevant language files
-include($phpbb_root_path . 'language/' . $language . '/common.' . $phpEx);
-include($phpbb_root_path . 'language/' . $language . '/acp/common.' . $phpEx);
-include($phpbb_root_path . 'language/' . $language . '/acp/board.' . $phpEx);
-include($phpbb_root_path . 'language/' . $language . '/install.' . $phpEx);
-include($phpbb_root_path . 'language/' . $language . '/posting.' . $phpEx);
+$load_lang_files = array('common', 'acp/common', 'acp/board', 'install', 'posting');
+$new_path = $phpbb_root_path . 'install/update/new/language/' . $language . '/';
+$old_path = $phpbb_root_path . 'language/' . $language . '/';
+
+// NOTE: we can not use "phpbb_include_updated" as the files uses vars which would be required
+// to be global while loading.
+foreach ($load_lang_files as $lang_file)
+{
+ if (file_exists($new_path . $lang_file . '.' . $phpEx))
+ {
+ include($new_path . $lang_file . '.' . $phpEx);
+ }
+ else
+ {
+ include($old_path . $lang_file . '.' . $phpEx);
+ }
+}
// usually we would need every single constant here - and it would be consistent. For 3.0.x, use a dirty hack... :(
@@ -159,16 +234,14 @@ define('CHMOD_READ', 4);
define('CHMOD_WRITE', 2);
define('CHMOD_EXECUTE', 1);
-$mode = request_var('mode', 'overview');
-$sub = request_var('sub', '');
+$mode = $request->variable('mode', 'overview');
+$sub = $request->variable('sub', '');
// Set PHP error handler to ours
set_error_handler(defined('PHPBB_MSG_HANDLER') ? PHPBB_MSG_HANDLER : 'msg_handler');
-$user = new user();
-$auth = new auth();
-$cache = new cache();
-$template = new template();
+$user = new \phpbb\user('\phpbb\datetime');
+$auth = new \phpbb\auth\auth();
// Add own hook handler, if present. :o
if (file_exists($phpbb_root_path . 'includes/hooks/index.' . $phpEx))
@@ -176,7 +249,8 @@ if (file_exists($phpbb_root_path . 'includes/hooks/index.' . $phpEx))
require($phpbb_root_path . 'includes/hooks/index.' . $phpEx);
$phpbb_hook = new phpbb_hook(array('exit_handler', 'phpbb_user_session_handler', 'append_sid', array('template', 'display')));
- foreach ($cache->obtain_hooks() as $hook)
+ $phpbb_hook_finder = $phpbb_container->get('hook_finder');
+ foreach ($phpbb_hook_finder->find() as $hook)
{
@include($phpbb_root_path . 'includes/hooks/' . $hook . '.' . $phpEx);
}
@@ -187,15 +261,27 @@ else
}
// Set some standard variables we want to force
-$config = array(
+$config = new \phpbb\config\config(array(
'load_tplcompile' => '1'
-);
-
-$template->set_custom_template('../adm/style', 'admin');
-$template->assign_var('T_TEMPLATE_PATH', '../adm/style');
-
-// the acp template is never stored in the database
-$user->theme['template_storedb'] = false;
+));
+
+$symfony_request = $phpbb_container->get('symfony_request');
+$phpbb_filesystem = $phpbb_container->get('filesystem');
+$phpbb_path_helper = $phpbb_container->get('path_helper');
+$template = new \phpbb\template\twig\twig($phpbb_path_helper, $config, $user, new \phpbb\template\context());
+$paths = array($phpbb_root_path . 'install/update/new/adm/style', $phpbb_admin_path . 'style');
+$paths = array_filter($paths, 'is_dir');
+$template->set_custom_style(array(
+ array(
+ 'name' => 'adm',
+ 'ext_path' => 'adm/style/',
+ ),
+), $paths);
+
+$path = array_shift($paths);
+
+$template->assign_var('T_ASSETS_PATH', $path . '/../../assets');
+$template->assign_var('T_TEMPLATE_PATH', $path);
$install = new module();
@@ -212,9 +298,6 @@ $template->set_filenames(array(
$install->page_footer();
-/**
-* @package install
-*/
class module
{
var $id = 0;
@@ -339,15 +422,17 @@ class module
}
define('HEADER_INC', true);
- global $template, $lang, $stage, $phpbb_root_path;
+ global $template, $lang, $stage, $phpbb_admin_path, $path;
$template->assign_vars(array(
'L_CHANGE' => $lang['CHANGE'],
+ 'L_COLON' => $lang['COLON'],
'L_INSTALL_PANEL' => $lang['INSTALL_PANEL'],
'L_SELECT_LANG' => $lang['SELECT_LANG'],
'L_SKIP' => $lang['SKIP'],
'PAGE_TITLE' => $this->get_page_title(),
- 'T_IMAGE_PATH' => $phpbb_root_path . 'adm/images/',
+ 'T_IMAGE_PATH' => htmlspecialchars($phpbb_admin_path) . 'images/',
+ 'T_JQUERY_LINK' => $path . '/../../assets/javascript/jquery.min.js',
'S_CONTENT_DIRECTION' => $lang['DIRECTION'],
'S_CONTENT_FLOW_BEGIN' => ($lang['DIRECTION'] == 'ltr') ? 'left' : 'right',
@@ -360,8 +445,7 @@ class module
header('Content-type: text/html; charset=UTF-8');
header('Cache-Control: private, no-cache="set-cookie"');
- header('Expires: 0');
- header('Pragma: no-cache');
+ header('Expires: ' . gmdate('D, d M Y H:i:s', time()) . ' GMT');
return;
}
@@ -417,15 +501,17 @@ class module
*/
function redirect($page)
{
+ global $request;
+
// HTTP_HOST is having the correct browser url in most cases...
- $server_name = (!empty($_SERVER['HTTP_HOST'])) ? strtolower($_SERVER['HTTP_HOST']) : ((!empty($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : getenv('SERVER_NAME'));
- $server_port = (!empty($_SERVER['SERVER_PORT'])) ? (int) $_SERVER['SERVER_PORT'] : (int) getenv('SERVER_PORT');
- $secure = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 1 : 0;
+ $server_name = strtolower(htmlspecialchars_decode($request->header('Host', $request->server('SERVER_NAME'))));
+ $server_port = $request->server('SERVER_PORT', 0);
+ $secure = $request->is_secure() ? 1 : 0;
- $script_name = (!empty($_SERVER['PHP_SELF'])) ? $_SERVER['PHP_SELF'] : getenv('PHP_SELF');
+ $script_name = htmlspecialchars_decode($request->server('PHP_SELF'));
if (!$script_name)
{
- $script_name = (!empty($_SERVER['REQUEST_URI'])) ? $_SERVER['REQUEST_URI'] : getenv('REQUEST_URI');
+ $script_name = htmlspecialchars_decode($request->server('REQUEST_URI'));
}
// Replace backslashes and doubled slashes (could happen on some proxy setups)
@@ -526,7 +612,7 @@ class module
*/
function error($error, $line, $file, $skip = false)
{
- global $lang, $db, $template;
+ global $lang, $db, $template, $phpbb_admin_path;
if ($skip)
{
@@ -543,12 +629,13 @@ class module
return;
}
- echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">';
- echo '<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr">';
+ echo '<!DOCTYPE html>';
+ echo '<html dir="ltr">';
echo '<head>';
- echo '<meta http-equiv="content-type" content="text/html; charset=utf-8" />';
+ echo '<meta charset="utf-8">';
+ echo '<meta http-equiv="X-UA-Compatible" content="IE=edge">';
echo '<title>' . $lang['INST_ERR_FATAL'] . '</title>';
- echo '<link href="../adm/style/admin.css" rel="stylesheet" type="text/css" media="screen" />';
+ echo '<link href="' . htmlspecialchars($phpbb_admin_path) . 'style/admin.css" rel="stylesheet" type="text/css" media="screen" />';
echo '</head>';
echo '<body id="errorpage">';
echo '<div id="wrap">';
@@ -569,7 +656,7 @@ class module
echo ' </div>';
echo ' </div>';
echo ' <div id="page-footer">';
- echo ' Powered by <a href="https://www.phpbb.com/">phpBB</a>&reg; Forum Software &copy; phpBB Group';
+ echo ' Powered by <a href="https://www.phpbb.com/">phpBB</a>&reg; Forum Software &copy; phpBB Limited';
echo ' </div>';
echo '</div>';
echo '</body>';
@@ -618,7 +705,7 @@ class module
));
// Rollback if in transaction
- if ($db->transaction)
+ if ($db->get_transaction())
{
$db->sql_transaction('rollback');
}
@@ -629,7 +716,7 @@ class module
/**
* Generate the relevant HTML for an input field and the associated label and explanatory text
*/
- function input_field($name, $type, $value='', $options='')
+ function input_field($name, $type, $value = '', $options = '')
{
global $lang;
$tpl_type = explode(':', $type);
@@ -639,6 +726,21 @@ class module
{
case 'text':
case 'password':
+ // HTML5 text-like input types
+ case 'color':
+ case 'date':
+ case 'time':
+ case 'datetime':
+ case 'datetime-local':
+ case 'email':
+ case 'month':
+ case 'number':
+ case 'range':
+ case 'search':
+ case 'tel':
+ case 'url':
+ case 'week':
+
$size = (int) $tpl_type[1];
$maxlength = (int) $tpl_type[2];
$autocomplete = (isset($options['autocomplete']) && $options['autocomplete'] == 'off') ? ' autocomplete="off"' : '';
@@ -667,12 +769,16 @@ class module
break;
case 'select':
+ // @codingStandardsIgnoreStart
eval('$s_options = ' . str_replace('{VALUE}', $value, $options) . ';');
+ // @codingStandardsIgnoreEnd
$tpl = '<select id="' . $name . '" name="' . $name . '">' . $s_options . '</select>';
break;
case 'custom':
+ // @codingStandardsIgnoreStart
eval('$tpl = ' . str_replace('{VALUE}', $value, $options) . ';');
+ // @codingStandardsIgnoreEnd
break;
default:
@@ -726,5 +832,3 @@ class module
return $user_select;
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/install/install_convert.php b/phpBB/install/install_convert.php
index 725cb4fdee..10b05eb559 100644
--- a/phpBB/install/install_convert.php
+++ b/phpBB/install/install_convert.php
@@ -1,10 +1,13 @@
<?php
/**
*
-* @package install
-* @version $Id$
-* @copyright (c) 2006 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -32,7 +35,6 @@ if (!empty($setmodules))
/**
* Class holding all convertor-specific details.
-* @package install
*/
class convert
{
@@ -76,10 +78,24 @@ class convert
/**
* Convert class for conversions
-* @package install
*/
class install_convert extends module
{
+ /** @var array */
+ protected $lang;
+
+ /** @var string */
+ protected $language;
+
+ /** @var \phpbb\template\template */
+ protected $template;
+
+ /** @var string */
+ protected $phpbb_root_path;
+
+ /** @var string */
+ protected $php_ext;
+
/**
* Variables used while converting, they are accessible from the global variable $convert
*/
@@ -91,55 +107,50 @@ class install_convert extends module
function main($mode, $sub)
{
global $lang, $template, $phpbb_root_path, $phpEx, $cache, $config, $language, $table_prefix;
- global $convert;
+ global $convert, $request, $phpbb_container, $phpbb_config_php_file;
$this->tpl_name = 'install_convert';
$this->mode = $mode;
+ $this->lang = $lang;
+ $this->language = $language;
+ $this->template = $template;
+ $this->phpbb_root_path = $phpbb_root_path;
+ $this->php_ext = $phpEx;
+
+ if (!$this->check_phpbb_installed())
+ {
+ return;
+ }
$convert = new convert($this->p_master);
+ // Enable super globals to prevent issues with the new \phpbb\request\request object
+ $request->enable_super_globals();
+ // Create a normal container now
+ $phpbb_container_builder = new \phpbb\di\container_builder($phpbb_config_php_file, $phpbb_root_path, $phpEx);
+ $phpbb_container = $phpbb_container_builder->get_container();
+
+ // Create cache
+ $cache = $phpbb_container->get('cache');
+
switch ($sub)
{
case 'intro':
- // Try opening config file
- // @todo If phpBB is not installed, we need to do a cut-down installation here
- // For now, we redirect to the installation script instead
- if (@file_exists($phpbb_root_path . 'config.' . $phpEx))
- {
- include($phpbb_root_path . 'config.' . $phpEx);
- }
+ extract($phpbb_config_php_file->get_all());
- if (!defined('PHPBB_INSTALLED'))
- {
- $template->assign_vars(array(
- 'S_NOT_INSTALLED' => true,
- 'TITLE' => $lang['BOARD_NOT_INSTALLED'],
- 'BODY' => sprintf($lang['BOARD_NOT_INSTALLED_EXPLAIN'], append_sid($phpbb_root_path . 'install/index.' . $phpEx, 'mode=install&amp;language=' . $language)),
- ));
-
- return;
- }
-
- require($phpbb_root_path . 'config.' . $phpEx);
require($phpbb_root_path . 'includes/constants.' . $phpEx);
- require($phpbb_root_path . 'includes/db/' . $dbms . '.' . $phpEx);
require($phpbb_root_path . 'includes/functions_convert.' . $phpEx);
- $db = new $sql_db();
+ $dbms = $phpbb_config_php_file->convert_30_dbms_to_31($dbms);
+
+ $db = new $dbms();
$db->sql_connect($dbhost, $dbuser, $dbpasswd, $dbname, $dbport, false, true);
unset($dbpasswd);
// We need to fill the config to let internal functions correctly work
- $sql = 'SELECT *
- FROM ' . CONFIG_TABLE;
- $result = $db->sql_query($sql);
-
- $config = array();
- while ($row = $db->sql_fetchrow($result))
- {
- $config[$row['config_name']] = $row['config_value'];
- }
- $db->sql_freeresult($result);
+ $config = new \phpbb\config\db($db, new \phpbb\cache\driver\null, CONFIG_TABLE);
+ set_config(null, null, null, $config);
+ set_config_count(null, null, null, $config);
// Detect if there is already a conversion in progress at this point and offer to resume
// It's quite possible that the user will get disconnected during a large conversion so they need to be able to resume it
@@ -215,12 +226,14 @@ class install_convert extends module
// This is for making sure the session get not screwed due to the 3.0.x users table being completely new.
$cache->purge();
- require($phpbb_root_path . 'config.' . $phpEx);
+ extract($phpbb_config_php_file->get_all());
+
require($phpbb_root_path . 'includes/constants.' . $phpEx);
- require($phpbb_root_path . 'includes/db/' . $dbms . '.' . $phpEx);
require($phpbb_root_path . 'includes/functions_convert.' . $phpEx);
- $db = new $sql_db();
+ $dbms = $phpbb_config_php_file->convert_30_dbms_to_31($dbms);
+
+ $db = new $dbms();
$db->sql_connect($dbhost, $dbuser, $dbpasswd, $dbname, $dbport, false, true);
unset($dbpasswd);
@@ -238,10 +251,10 @@ class install_convert extends module
));
}
- switch ($db->sql_layer)
+ switch ($db->get_sql_layer())
{
case 'sqlite':
- case 'firebird':
+ case 'sqlite3':
$db->sql_query('DELETE FROM ' . SESSIONS_KEYS_TABLE);
$db->sql_query('DELETE FROM ' . SESSIONS_TABLE);
break;
@@ -257,6 +270,30 @@ class install_convert extends module
}
/**
+ * Check whether phpBB is installed.
+ * Assigns error template vars if not installed.
+ *
+ * @return bool Returns true if phpBB is installed.
+ */
+ public function check_phpbb_installed()
+ {
+ if (phpbb_check_installation_exists($this->phpbb_root_path, $this->php_ext))
+ {
+ return true;
+ }
+
+ $this->page_title = 'BOARD_NOT_INSTALLED';
+ $install_url = append_sid($this->phpbb_root_path . 'install/index.' . $this->php_ext, 'mode=install&amp;language=' . $this->language);
+
+ $this->template->assign_vars(array(
+ 'S_NOT_INSTALLED' => true,
+ 'BODY' => sprintf($this->lang['BOARD_NOT_INSTALLED_EXPLAIN'], $install_url),
+ ));
+
+ return false;
+ }
+
+ /**
* Generate a list of all available conversion modules
*/
function list_convertors($sub)
@@ -336,30 +373,25 @@ class install_convert extends module
*/
function get_convert_settings($sub)
{
- global $lang, $language, $template, $db, $phpbb_root_path, $phpEx, $config, $cache;
+ global $lang, $language, $template, $db, $phpbb_root_path, $phpEx, $config, $cache, $phpbb_config_php_file;
+
+ extract($phpbb_config_php_file->get_all());
- require($phpbb_root_path . 'config.' . $phpEx);
require($phpbb_root_path . 'includes/constants.' . $phpEx);
- require($phpbb_root_path . 'includes/db/' . $dbms . '.' . $phpEx);
require($phpbb_root_path . 'includes/functions_convert.' . $phpEx);
- $db = new $sql_db();
+ $dbms = $phpbb_config_php_file->convert_30_dbms_to_31($dbms);
+
+ $db = new $dbms();
$db->sql_connect($dbhost, $dbuser, $dbpasswd, $dbname, $dbport, false, true);
unset($dbpasswd);
$this->page_title = $lang['STAGE_SETTINGS'];
// We need to fill the config to let internal functions correctly work
- $sql = 'SELECT *
- FROM ' . CONFIG_TABLE;
- $result = $db->sql_query($sql);
-
- $config = array();
- while ($row = $db->sql_fetchrow($result))
- {
- $config[$row['config_name']] = $row['config_value'];
- }
- $db->sql_freeresult($result);
+ $config = new \phpbb\config\db($db, new \phpbb\cache\driver\null, CONFIG_TABLE);
+ set_config(null, null, null, $config);
+ set_config_count(null, null, null, $config);
$convertor_tag = request_var('tag', '');
@@ -431,6 +463,8 @@ class install_convert extends module
$error[] = sprintf($lang['TABLE_PREFIX_SAME'], $src_table_prefix);
}
+ $src_dbms = $phpbb_config_php_file->convert_30_dbms_to_31($src_dbms);
+
// Check table prefix
if (!sizeof($error))
{
@@ -440,8 +474,7 @@ class install_convert extends module
if ($src_dbms != $dbms || $src_dbhost != $dbhost || $src_dbport != $dbport || $src_dbname != $dbname || $src_dbuser != $dbuser)
{
- $sql_db = 'dbal_' . $src_dbms;
- $src_db = new $sql_db();
+ $src_db = new $src_dbms();
$src_db->sql_connect($src_dbhost, $src_dbuser, htmlspecialchars_decode($src_dbpasswd), $src_dbname, $src_dbport, false, true);
$same_db = false;
}
@@ -566,7 +599,7 @@ class install_convert extends module
'S_EXPLAIN' => $vars['explain'],
'S_LEGEND' => false,
'TITLE_EXPLAIN' => ($vars['explain']) ? $lang[$vars['lang'] . '_EXPLAIN'] : '',
- 'CONTENT' => $this->p_master->input_field($config_key, $vars['type'], $$config_key, $options),
+ 'CONTENT' => $this->p_master->input_field($config_key, $vars['type'], ${$config_key}, $options),
)
);
}
@@ -584,28 +617,25 @@ class install_convert extends module
*/
function convert_data($sub)
{
- global $template, $user, $phpbb_root_path, $phpEx, $db, $lang, $config, $cache;
+ global $template, $user, $phpbb_root_path, $phpEx, $db, $lang, $config, $cache, $auth;
global $convert, $convert_row, $message_parser, $skip_rows, $language;
+ global $request, $phpbb_config_php_file, $phpbb_dispatcher;
+
+ extract($phpbb_config_php_file->get_all());
- require($phpbb_root_path . 'config.' . $phpEx);
require($phpbb_root_path . 'includes/constants.' . $phpEx);
- require($phpbb_root_path . 'includes/db/' . $dbms . '.' . $phpEx);
require($phpbb_root_path . 'includes/functions_convert.' . $phpEx);
- $db = new $sql_db();
+ $dbms = $phpbb_config_php_file->convert_30_dbms_to_31($dbms);
+
+ $db = new $dbms();
$db->sql_connect($dbhost, $dbuser, $dbpasswd, $dbname, $dbport, false, true);
unset($dbpasswd);
- $sql = 'SELECT *
- FROM ' . CONFIG_TABLE;
- $result = $db->sql_query($sql);
-
- $config = array();
- while ($row = $db->sql_fetchrow($result))
- {
- $config[$row['config_name']] = $row['config_value'];
- }
- $db->sql_freeresult($result);
+ // We need to fill the config to let internal functions correctly work
+ $config = new \phpbb\config\db($db, new \phpbb\cache\driver\null, CONFIG_TABLE);
+ set_config(null, null, null, $config);
+ set_config_count(null, null, null, $config);
// Override a couple of config variables for the duration
$config['max_quote_depth'] = 0;
@@ -659,12 +689,8 @@ class install_convert extends module
$src_db = $same_db = null;
if ($convert->src_dbms != $dbms || $convert->src_dbhost != $dbhost || $convert->src_dbport != $dbport || $convert->src_dbname != $dbname || $convert->src_dbuser != $dbuser)
{
- if ($convert->src_dbms != $dbms)
- {
- require($phpbb_root_path . 'includes/db/' . $convert->src_dbms . '.' . $phpEx);
- }
- $sql_db = 'dbal_' . $convert->src_dbms;
- $src_db = new $sql_db();
+ $dbms = $convert->src_dbms;
+ $src_db = new $dbms();
$src_db->sql_connect($convert->src_dbhost, $convert->src_dbuser, htmlspecialchars_decode($convert->src_dbpasswd), $convert->src_dbname, $convert->src_dbport, false, true);
$same_db = false;
}
@@ -678,7 +704,7 @@ class install_convert extends module
switch ($src_db->sql_layer)
{
case 'sqlite':
- case 'firebird':
+ case 'sqlite3':
$convert->src_truncate_statement = 'DELETE FROM ';
break;
@@ -707,10 +733,10 @@ class install_convert extends module
$src_db->sql_query("SET NAMES 'binary'");
}
- switch ($db->sql_layer)
+ switch ($db->get_sql_layer())
{
case 'sqlite':
- case 'firebird':
+ case 'sqlite3':
$convert->truncate_statement = 'DELETE FROM ';
break;
@@ -755,24 +781,22 @@ class install_convert extends module
$this->p_master->error(sprintf($user->lang['COULD_NOT_FIND_PATH'], $convert->options['forum_path']), __LINE__, __FILE__);
}
- $search_type = basename(trim($config['search_type']));
+ $search_type = $config['search_type'];
// For conversions we are a bit less strict and set to a search backend we know exist...
- if (!file_exists($phpbb_root_path . 'includes/search/' . $search_type . '.' . $phpEx))
+ if (!class_exists($search_type))
{
- $search_type = 'fulltext_native';
+ $search_type = '\phpbb\search\fulltext_native';
set_config('search_type', $search_type);
}
- if (!file_exists($phpbb_root_path . 'includes/search/' . $search_type . '.' . $phpEx))
+ if (!class_exists($search_type))
{
trigger_error('NO_SUCH_SEARCH_MODULE');
}
- require($phpbb_root_path . 'includes/search/' . $search_type . '.' . $phpEx);
-
$error = false;
- $convert->fulltext_search = new $search_type($error);
+ $convert->fulltext_search = new $search_type($error, $phpbb_root_path, $phpEx, $auth, $config, $db, $user, $phpbb_dispatcher);
if ($error)
{
@@ -812,7 +836,7 @@ class install_convert extends module
if (!$current_table && !$skip_rows)
{
- if (empty($_REQUEST['confirm']))
+ if (!$request->variable('confirm', false))
{
// If avatars / ranks / smilies folders are specified make sure they are writable
$bad_folders = array();
@@ -908,7 +932,7 @@ class install_convert extends module
$val = array($val);
}
- for ($j = 0; $j < sizeof($val); ++$j)
+ for ($j = 0, $size = sizeof($val); $j < $size; ++$j)
{
if (preg_match('/LEFT JOIN ([a-z0-9_]+) AS ([a-z0-9_]+)/i', $val[$j], $m))
{
@@ -955,7 +979,7 @@ class install_convert extends module
}
else if (sizeof($missing_tables))
{
- $this->p_master->error(sprintf($user->lang['TABLES_MISSING'], implode(', ', $missing_tables)) . '<br /><br />' . $user->lang['CHECK_TABLE_PREFIX'], __LINE__, __FILE__);
+ $this->p_master->error(sprintf($user->lang['TABLES_MISSING'], implode($user->lang['COMMA_SEPARATOR'], $missing_tables)) . '<br /><br />' . $user->lang['CHECK_TABLE_PREFIX'], __LINE__, __FILE__);
}
$url = $this->save_convert_progress('&amp;confirm=1');
@@ -973,7 +997,7 @@ class install_convert extends module
));
return;
- } // if (empty($_REQUEST['confirm']))
+ } // if (!$request->variable('confirm', false)))
$template->assign_block_vars('checks', array(
'S_LEGEND' => true,
@@ -1000,7 +1024,9 @@ class install_convert extends module
// Now process queries and execute functions that have to be executed prior to the conversion
if (!empty($convert->convertor['execute_first']))
{
+ // @codingStandardsIgnoreStart
eval($convert->convertor['execute_first']);
+ // @codingStandardsIgnoreEnd
}
if (!empty($convert->convertor['query_first']))
@@ -1070,7 +1096,9 @@ class install_convert extends module
// process execute_first and query_first for this table...
if (!empty($schema['execute_first']))
{
+ // @codingStandardsIgnoreStart
eval($schema['execute_first']);
+ // @codingStandardsIgnoreEnd
}
if (!empty($schema['query_first']))
@@ -1107,7 +1135,7 @@ class install_convert extends module
if (!empty($schema['autoincrement']))
{
- switch ($db->sql_layer)
+ switch ($db->get_sql_layer())
{
case 'postgres':
$db->sql_query("SELECT SETVAL('" . $schema['target'] . "_seq',(select case when max(" . $schema['autoincrement'] . ")>0 then max(" . $schema['autoincrement'] . ")+1 else 1 end from " . $schema['target'] . '));');
@@ -1135,7 +1163,9 @@ class install_convert extends module
// it gets split because of time restrictions
if (!empty($schema['execute_always']))
{
+ // @codingStandardsIgnoreStart
eval($schema['execute_always']);
+ // @codingStandardsIgnoreEnd
}
//
@@ -1218,7 +1248,7 @@ class install_convert extends module
$template->assign_block_vars('checks', array(
'TITLE' => "skip_rows = $skip_rows",
- 'RESULT' => $rows . ((defined('DEBUG_EXTRA') && function_exists('memory_get_usage')) ? ceil(memory_get_usage()/1024) . ' ' . $user->lang['KIB'] : ''),
+ 'RESULT' => $rows . ((defined('DEBUG') && function_exists('memory_get_usage')) ? ceil(memory_get_usage()/1024) . ' ' . $user->lang['KIB'] : ''),
));
$mtime = explode(' ', microtime());
@@ -1244,7 +1274,7 @@ class install_convert extends module
if (!empty($schema['autoincrement']))
{
- switch ($db->sql_layer)
+ switch ($db->get_sql_layer())
{
case 'mssql':
case 'mssql_odbc':
@@ -1277,7 +1307,7 @@ class install_convert extends module
if ($sql_flag === true)
{
- switch ($db->sql_layer)
+ switch ($db->get_sql_layer())
{
// If MySQL, we'll wait to have num_wait_rows rows to submit at once
case 'mysql':
@@ -1372,7 +1402,7 @@ class install_convert extends module
if (!empty($schema['autoincrement']))
{
- switch ($db->sql_layer)
+ switch ($db->get_sql_layer())
{
case 'mssql':
case 'mssql_odbc':
@@ -1402,7 +1432,7 @@ class install_convert extends module
}
// When we reach this point, either the current table has been processed or we're running out of time.
- if (still_on_time() && $counting < $convert->batch_size/* && !defined('DEBUG_EXTRA')*/)
+ if (still_on_time() && $counting < $convert->batch_size/* && !defined('DEBUG')*/)
{
$skip_rows = 0;
$current_table++;
@@ -1487,11 +1517,10 @@ class install_convert extends module
$end = ($sync_batch + $batch_size - 1);
// Sync all topics in batch mode...
- sync('topic_approved', 'range', 'topic_id BETWEEN ' . $sync_batch . ' AND ' . $end, true, false);
sync('topic', 'range', 'topic_id BETWEEN ' . $sync_batch . ' AND ' . $end, true, true);
$template->assign_block_vars('checks', array(
- 'TITLE' => sprintf($user->lang['SYNC_TOPIC_ID'], $sync_batch, ($sync_batch + $batch_size)) . ((defined('DEBUG_EXTRA') && function_exists('memory_get_usage')) ? ' [' . ceil(memory_get_usage()/1024) . ' ' . $user->lang['KIB'] . ']' : ''),
+ 'TITLE' => sprintf($user->lang['SYNC_TOPIC_ID'], $sync_batch, ($sync_batch + $batch_size)) . ((defined('DEBUG') && function_exists('memory_get_usage')) ? ' [' . ceil(memory_get_usage()/1024) . ' ' . $user->lang['KIB'] . ']' : ''),
'RESULT' => $user->lang['DONE'],
));
@@ -1561,6 +1590,7 @@ class install_convert extends module
function finish_conversion()
{
global $db, $phpbb_root_path, $phpEx, $convert, $config, $language, $user, $template;
+ global $cache, $auth, $phpbb_container, $phpbb_log;
$db->sql_query('DELETE FROM ' . CONFIG_TABLE . "
WHERE config_name = 'convert_progress'
@@ -1570,9 +1600,10 @@ class install_convert extends module
$db->sql_query('DELETE FROM ' . SESSIONS_TABLE);
@unlink($phpbb_root_path . 'cache/data_global.' . $phpEx);
- cache_moderators();
+ phpbb_cache_moderators($db, $cache, $auth);
// And finally, add a note to the log
+ $phpbb_log = $phpbb_container->get('log');
add_log('admin', 'LOG_INSTALL_CONVERTED', $convert->convertor_data['forum_name'], $config['version']);
$url = $this->p_master->module_url . "?mode={$this->mode}&amp;sub=final&amp;language=$language";
@@ -1610,7 +1641,7 @@ class install_convert extends module
'RESULT' => $user->lang['DONE'],
));
- if ($db->sql_error_triggered)
+ if ($db->get_sql_error_triggered())
{
$template->assign_vars(array(
'S_ERROR_BOX' => true,
@@ -1645,13 +1676,17 @@ class install_convert extends module
{
if (!is_array($convert->convertor['execute_last']))
{
+ // @codingStandardsIgnoreStart
eval($convert->convertor['execute_last']);
+ // @codingStandardsIgnoreEnd
}
else
{
while ($last_statement < sizeof($convert->convertor['execute_last']))
{
+ // @codingStandardsIgnoreStart
eval($convert->convertor['execute_last'][$last_statement]);
+ // @codingStandardsIgnoreEnd
$template->assign_block_vars('checks', array(
'TITLE' => $convert->convertor['execute_last'][$last_statement],
@@ -1779,7 +1814,7 @@ class install_convert extends module
global $convert;
// Can we use IGNORE with this DBMS?
- $sql_ignore = (strpos($db->sql_layer, 'mysql') === 0 && !defined('DEBUG_EXTRA')) ? 'IGNORE ' : '';
+ $sql_ignore = (strpos($db->get_sql_layer(), 'mysql') === 0 && !defined('DEBUG')) ? 'IGNORE ' : '';
$insert_query = 'INSERT ' . $sql_ignore . 'INTO ' . $schema['target'] . ' (';
$aliases = array();
@@ -1979,7 +2014,7 @@ class install_convert extends module
{
$value = $fields[1][$firstkey];
}
- else if (is_array($fields[2]))
+ else if (is_array($fields[2]) && !is_callable($fields[2]))
{
// Execute complex function/eval/typecast
$value = $fields[1];
@@ -2013,7 +2048,9 @@ class install_convert extends module
$execution = str_replace('{RESULT}', '$value', $execution);
$execution = str_replace('{VALUE}', '$value', $execution);
+ // @codingStandardsIgnoreStart
eval($execution);
+ // @codingStandardsIgnoreEnd
}
}
}
@@ -2060,7 +2097,9 @@ class install_convert extends module
$execution = str_replace('{RESULT}', '$value', $execution);
$execution = str_replace('{VALUE}', '$value', $execution);
+ // @codingStandardsIgnoreStart
eval($execution);
+ // @codingStandardsIgnoreEnd
}
}
}
@@ -2109,5 +2148,3 @@ class install_convert extends module
'refresh' => array('lang' => 'REFRESH_PAGE', 'type' => 'radio:yes_no', 'explain' => true),
);
}
-
-?> \ No newline at end of file
diff --git a/phpBB/install/install_install.php b/phpBB/install/install_install.php
index cb63c70e11..8e57ed3edd 100644
--- a/phpBB/install/install_install.php
+++ b/phpBB/install/install_install.php
@@ -1,10 +1,13 @@
<?php
/**
*
-* @package install
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -19,14 +22,9 @@ if (!defined('IN_INSTALL'))
if (!empty($setmodules))
{
// If phpBB is already installed we do not include this module
- if (@file_exists($phpbb_root_path . 'config.' . $phpEx) && !file_exists($phpbb_root_path . 'cache/install_lock'))
+ if (phpbb_check_installation_exists($phpbb_root_path, $phpEx) && !file_exists($phpbb_root_path . 'cache/install_lock'))
{
- include_once($phpbb_root_path . 'config.' . $phpEx);
-
- if (defined('PHPBB_INSTALLED'))
- {
- return;
- }
+ return;
}
$module[] = array(
@@ -42,7 +40,6 @@ if (!empty($setmodules))
/**
* Installation
-* @package install
*/
class install_install extends module
{
@@ -53,12 +50,13 @@ class install_install extends module
function main($mode, $sub)
{
- global $lang, $template, $language, $phpbb_root_path, $cache;
+ global $lang, $template, $language, $phpbb_root_path, $phpEx;
+ global $phpbb_container, $cache, $phpbb_log, $request, $phpbb_config_php_file;
switch ($sub)
{
case 'intro':
- $cache->purge();
+ $phpbb_container->get('cache.driver')->purge();
$this->page_title = $lang['SUB_INTRO'];
@@ -102,12 +100,24 @@ class install_install extends module
break;
case 'final':
+ // Enable super globals to prevent issues with the new \phpbb\request\request object
+ $request->enable_super_globals();
+
+ // Create a normal container now
+ $phpbb_container_builder = new \phpbb\di\container_builder($phpbb_config_php_file, $phpbb_root_path, $phpEx);
+ $phpbb_container = $phpbb_container_builder->get_container();
+
+ // Sets the global variables
+ $cache = $phpbb_container->get('cache');
+ $phpbb_log = $phpbb_container->get('log');
+
$this->build_search_index($mode, $sub);
$this->add_modules($mode, $sub);
$this->add_language($mode, $sub);
$this->add_bots($mode, $sub);
$this->email_admin($mode, $sub);
$this->disable_avatars_if_unwritable();
+ $this->populate_migrations($phpbb_container->get('ext.manager'), $phpbb_container->get('migrator'));
// Remove the lock file
@unlink($phpbb_root_path . 'cache/install_lock');
@@ -132,7 +142,7 @@ class install_install extends module
'BODY' => $lang['REQUIREMENTS_EXPLAIN'],
));
- $passed = array('php' => false, 'db' => false, 'files' => false, 'pcre' => false, 'imagesize' => false,);
+ $passed = array('php' => false, 'db' => false, 'files' => false, 'pcre' => false, 'imagesize' => false, 'json' => false,);
// Test for basic PHP settings
$template->assign_block_vars('checks', array(
@@ -141,10 +151,10 @@ class install_install extends module
'LEGEND_EXPLAIN' => $lang['PHP_SETTINGS_EXPLAIN'],
));
- // Test the minimum PHP version
+ // Test the minimum and maximum version of PHP
$php_version = PHP_VERSION;
- if (version_compare($php_version, '4.3.3') < 0)
+ if ((version_compare($php_version, '5.3.3') < 0) || (version_compare($php_version, '7.0.0-dev', '>=')))
{
$result = '<strong style="color:red">' . $lang['NO'] . '</strong>';
}
@@ -211,7 +221,6 @@ class install_install extends module
'S_LEGEND' => false,
));
-
// Check for getimagesize
if (@function_exists('getimagesize'))
{
@@ -252,13 +261,25 @@ class install_install extends module
'S_LEGEND' => false,
));
-/**
-* Better not enabling and adding to the loaded extensions due to the specific requirements needed
- if (!@extension_loaded('mbstring'))
+ // Check for php json support
+ if (@extension_loaded('json'))
{
- can_load_dll('mbstring');
+ $passed['json'] = true;
+ $result = '<strong style="color:green">' . $lang['YES'] . '</strong>';
}
-*/
+ else
+ {
+ $result = '<strong style="color:red">' . $lang['NO'] . '</strong>';
+ }
+
+ $template->assign_block_vars('checks', array(
+ 'TITLE' => $lang['PHP_JSON_SUPPORT'],
+ 'TITLE_EXPLAIN' => $lang['PHP_JSON_SUPPORT_EXPLAIN'],
+ 'RESULT' => $result,
+
+ 'S_EXPLAIN' => true,
+ 'S_LEGEND' => false,
+ ));
$passed['mbstring'] = true;
if (@extension_loaded('mbstring'))
@@ -364,17 +385,14 @@ class install_install extends module
{
if (!@extension_loaded($dll))
{
- if (!can_load_dll($dll))
- {
- $template->assign_block_vars('checks', array(
- 'TITLE' => $lang['DLL_' . strtoupper($dll)],
- 'RESULT' => '<strong style="color:red">' . $lang['UNAVAILABLE'] . '</strong>',
+ $template->assign_block_vars('checks', array(
+ 'TITLE' => $lang['DLL_' . strtoupper($dll)],
+ 'RESULT' => '<strong style="color:red">' . $lang['UNAVAILABLE'] . '</strong>',
- 'S_EXPLAIN' => false,
- 'S_LEGEND' => false,
- ));
- continue;
- }
+ 'S_EXPLAIN' => false,
+ 'S_LEGEND' => false,
+ ));
+ continue;
}
$template->assign_block_vars('checks', array(
@@ -386,7 +404,7 @@ class install_install extends module
));
}
- // Can we find Imagemagick anywhere on the system?
+ // Can we find ImageMagick anywhere on the system?
$exe = (DIRECTORY_SEPARATOR == '\\') ? '.exe' : '';
$magic_home = getenv('MAGICK_HOME');
@@ -521,7 +539,6 @@ class install_install extends module
$url = (!in_array(false, $passed)) ? $this->p_master->module_url . "?mode=$mode&amp;sub=database&amp;language=$language" : $this->p_master->module_url . "?mode=$mode&amp;sub=requirements&amp;language=$language ";
$submit = (!in_array(false, $passed)) ? $lang['INSTALL_START'] : $lang['INSTALL_TEST'];
-
$template->assign_vars(array(
'L_SUBMIT' => $submit,
'S_HIDDEN' => $s_hidden_fields,
@@ -697,7 +714,7 @@ class install_install extends module
$error = array();
// Check the entered email address and password
- if ($data['admin_name'] == '' || $data['admin_pass1'] == '' || $data['admin_pass2'] == '' || $data['board_email1'] == '' || $data['board_email2'] == '')
+ if ($data['admin_name'] == '' || $data['admin_pass1'] == '' || $data['admin_pass2'] == '' || $data['board_email'] == '')
{
$error[] = $lang['INST_ERR_MISSING_DATA'];
}
@@ -729,12 +746,7 @@ class install_install extends module
$error[] = $lang['INST_ERR_PASSWORD_TOO_LONG'];
}
- if ($data['board_email1'] != $data['board_email2'] && $data['board_email1'] != '')
- {
- $error[] = $lang['INST_ERR_EMAIL_MISMATCH'];
- }
-
- if ($data['board_email1'] != '' && !preg_match('/^' . get_preg_expression('email') . '$/i', $data['board_email1']))
+ if ($data['board_email'] != '' && !preg_match('/^' . get_preg_expression('email') . '$/i', $data['board_email']))
{
$error[] = $lang['INST_ERR_EMAIL_INVALID'];
}
@@ -860,22 +872,7 @@ class install_install extends module
$written = false;
// Create a list of any PHP modules we wish to have loaded
- $load_extensions = array();
$available_dbms = get_available_dbms($data['dbms']);
- $check_exts = array_merge(array($available_dbms[$data['dbms']]['MODULE']), $this->php_dlls_other);
-
- foreach ($check_exts as $dll)
- {
- if (!@extension_loaded($dll))
- {
- if (!can_load_dll($dll))
- {
- continue;
- }
-
- $load_extensions[] = $dll . '.' . PHP_SHLIB_SUFFIX;
- }
- }
// Create a lock file to indicate that there is an install in progress
$fp = @fopen($phpbb_root_path . 'cache/install_lock', 'wb');
@@ -889,7 +886,7 @@ class install_install extends module
@chmod($phpbb_root_path . 'cache/install_lock', 0777);
// Time to convert the data provided into a config file
- $config_data = phpbb_create_config_file_data($data, $available_dbms[$data['dbms']]['DRIVER'], $load_extensions);
+ $config_data = phpbb_create_config_file_data($data, $available_dbms[$data['dbms']]['DRIVER']);
// Attempt to write out the config file directly. If it works, this is the easiest way to do it ...
if ((file_exists($phpbb_root_path . 'config.' . $phpEx) && phpbb_is_writable($phpbb_root_path . 'config.' . $phpEx)) || phpbb_is_writable($phpbb_root_path))
@@ -985,7 +982,7 @@ class install_install extends module
*/
function obtain_advanced_settings($mode, $sub)
{
- global $lang, $template, $phpEx;
+ global $lang, $template, $phpEx, $request;
$this->page_title = $lang['STAGE_ADVANCED'];
@@ -1003,7 +1000,7 @@ class install_install extends module
$s_hidden_fields .= '<input type="hidden" name="language" value="' . $data['language'] . '" />';
// HTTP_HOST is having the correct browser url in most cases...
- $server_name = (!empty($_SERVER['HTTP_HOST'])) ? strtolower($_SERVER['HTTP_HOST']) : ((!empty($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : getenv('SERVER_NAME'));
+ $server_name = strtolower(htmlspecialchars_decode($request->header('Host', $request->server('SERVER_NAME'))));
// HTTP HOST can carry a port number...
if (strpos($server_name, ':') !== false)
@@ -1013,16 +1010,16 @@ class install_install extends module
$data['email_enable'] = ($data['email_enable'] !== '') ? $data['email_enable'] : true;
$data['server_name'] = ($data['server_name'] !== '') ? $data['server_name'] : $server_name;
- $data['server_port'] = ($data['server_port'] !== '') ? $data['server_port'] : ((!empty($_SERVER['SERVER_PORT'])) ? (int) $_SERVER['SERVER_PORT'] : (int) getenv('SERVER_PORT'));
- $data['server_protocol'] = ($data['server_protocol'] !== '') ? $data['server_protocol'] : ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 'https://' : 'http://');
- $data['cookie_secure'] = ($data['cookie_secure'] !== '') ? $data['cookie_secure'] : ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? true : false);
+ $data['server_port'] = ($data['server_port'] !== '') ? $data['server_port'] : $request->server('SERVER_PORT', 0);
+ $data['server_protocol'] = ($data['server_protocol'] !== '') ? $data['server_protocol'] : ($request->is_secure() ? 'https://' : 'http://');
+ $data['cookie_secure'] = ($data['cookie_secure'] !== '') ? $data['cookie_secure'] : $request->is_secure();
if ($data['script_path'] === '')
{
- $name = (!empty($_SERVER['PHP_SELF'])) ? $_SERVER['PHP_SELF'] : getenv('PHP_SELF');
+ $name = htmlspecialchars_decode($request->server('PHP_SELF'));
if (!$name)
{
- $name = (!empty($_SERVER['REQUEST_URI'])) ? $_SERVER['REQUEST_URI'] : getenv('REQUEST_URI');
+ $name = htmlspecialchars_decode($request->server('REQUEST_URI'));
}
// Replace backslashes and doubled slashes (could happen on some proxy setups)
@@ -1087,7 +1084,7 @@ class install_install extends module
*/
function load_schema($mode, $sub)
{
- global $db, $lang, $template, $phpbb_root_path, $phpEx;
+ global $db, $lang, $template, $phpbb_root_path, $phpEx, $request;
$this->page_title = $lang['STAGE_CREATE_TABLE'];
$s_hidden_fields = '';
@@ -1103,8 +1100,8 @@ class install_install extends module
}
// HTTP_HOST is having the correct browser url in most cases...
- $server_name = (!empty($_SERVER['HTTP_HOST'])) ? strtolower($_SERVER['HTTP_HOST']) : ((!empty($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : getenv('SERVER_NAME'));
- $referer = (!empty($_SERVER['HTTP_REFERER'])) ? strtolower($_SERVER['HTTP_REFERER']) : getenv('HTTP_REFERER');
+ $server_name = strtolower(htmlspecialchars_decode($request->header('Host', $request->server('SERVER_NAME'))));
+ $referer = strtolower($request->header('Referer'));
// HTTP HOST can carry a port number...
if (strpos($server_name, ':') !== false)
@@ -1131,11 +1128,8 @@ class install_install extends module
$dbms = $available_dbms[$data['dbms']]['DRIVER'];
- // Load the appropriate database class if not already loaded
- include($phpbb_root_path . 'includes/db/' . $dbms . '.' . $phpEx);
-
// Instantiate the database
- $db = new $sql_db();
+ $db = new $dbms();
$db->sql_connect($data['dbhost'], $data['dbuser'], htmlspecialchars_decode($data['dbpasswd']), $data['dbname'], $data['dbport'], false, false);
// NOTE: trigger_error does not work here.
@@ -1161,29 +1155,71 @@ class install_install extends module
// How should we treat this schema?
$delimiter = $available_dbms[$data['dbms']]['DELIM'];
- $sql_query = @file_get_contents($dbms_schema);
-
- $sql_query = preg_replace('#phpbb_#i', $data['table_prefix'], $sql_query);
-
- $sql_query = phpbb_remove_comments($sql_query);
+ if (file_exists($dbms_schema))
+ {
+ $sql_query = @file_get_contents($dbms_schema);
+ $sql_query = preg_replace('#phpbb_#i', $data['table_prefix'], $sql_query);
+ $sql_query = phpbb_remove_comments($sql_query);
+ $sql_query = split_sql_file($sql_query, $delimiter);
- $sql_query = split_sql_file($sql_query, $delimiter);
+ foreach ($sql_query as $sql)
+ {
+ // Ignore errors when the functions or types already exist
+ // to allow installing phpBB twice in the same database with
+ // a different prefix
+ $db->sql_query($sql);
+ }
+ unset($sql_query);
+ }
- foreach ($sql_query as $sql)
+ // Ok we have the db info go ahead and work on building the table
+ if (file_exists('schemas/schema.json'))
{
- //$sql = trim(str_replace('|', ';', $sql));
- if (!$db->sql_query($sql))
+ $db_table_schema = @file_get_contents('schemas/schema.json');
+ $db_table_schema = json_decode($db_table_schema, true);
+ }
+ else
+ {
+ global $phpbb_root_path, $phpEx, $table_prefix;
+ $table_prefix = 'phpbb_';
+
+ if (!defined('CONFIG_TABLE'))
{
- $error = $db->sql_error();
- $this->p_master->db_error($error['message'], $sql, __LINE__, __FILE__);
+ // We need to include the constants file for the table constants
+ // when we generate the schema from the migration files.
+ include($phpbb_root_path . 'includes/constants.' . $phpEx);
}
+
+ $finder = new \phpbb\finder(new \phpbb\filesystem(), $phpbb_root_path, null, $phpEx);
+ $classes = $finder->core_path('phpbb/db/migration/data/')
+ ->get_classes();
+
+ $sqlite_db = new \phpbb\db\driver\sqlite();
+ $schema_generator = new \phpbb\db\migration\schema_generator($classes, new \phpbb\config\config(array()), $sqlite_db, new \phpbb\db\tools($sqlite_db, true), $phpbb_root_path, $phpEx, $table_prefix);
+ $db_table_schema = $schema_generator->get_schema();
+ }
+
+ if (!defined('CONFIG_TABLE'))
+ {
+ // CONFIG_TABLE is required by sql_create_index() to check the
+ // length of index names. However table_prefix is not defined
+ // here yet, so we need to create the constant ourselves.
+ define('CONFIG_TABLE', $data['table_prefix'] . 'config');
+ }
+
+ $db_tools = new \phpbb\db\tools($db);
+ foreach ($db_table_schema as $table_name => $table_data)
+ {
+ $db_tools->sql_create_table(
+ $data['table_prefix'] . substr($table_name, 6),
+ $table_data
+ );
}
- unset($sql_query);
// Ok tables have been built, let's fill in the basic information
$sql_query = file_get_contents('schemas/schema_data.sql');
- // Deal with any special comments
+ // Deal with any special comments and characters
switch ($data['dbms'])
{
case 'mssql':
@@ -1195,6 +1231,11 @@ class install_install extends module
case 'postgres':
$sql_query = preg_replace('#\# POSTGRES (BEGIN|COMMIT) \##s', '\1; ', $sql_query);
break;
+
+ case 'mysql':
+ case 'mysqli':
+ $sql_query = str_replace('\\', '\\\\', $sql_query);
+ break;
}
// Change prefix
@@ -1219,8 +1260,7 @@ class install_install extends module
$current_time = time();
- $user_ip = (!empty($_SERVER['REMOTE_ADDR'])) ? htmlspecialchars($_SERVER['REMOTE_ADDR']) : '';
- $user_ip = (stripos($user_ip, '::ffff:') === 0) ? substr($user_ip, 7) : $user_ip;
+ $user_ip = $request->server('REMOTE_ADDR') ? phpbb_ip_normalise($request->server('REMOTE_ADDR')) : '';
if ($data['script_path'] !== '/')
{
@@ -1259,11 +1299,11 @@ class install_install extends module
WHERE config_name = 'server_port'",
'UPDATE ' . $data['table_prefix'] . "config
- SET config_value = '" . $db->sql_escape($data['board_email1']) . "'
+ SET config_value = '" . $db->sql_escape($data['board_email']) . "'
WHERE config_name = 'board_email'",
'UPDATE ' . $data['table_prefix'] . "config
- SET config_value = '" . $db->sql_escape($data['board_email1']) . "'
+ SET config_value = '" . $db->sql_escape($data['board_email']) . "'
WHERE config_name = 'board_contact'",
'UPDATE ' . $data['table_prefix'] . "config
@@ -1322,8 +1362,12 @@ class install_install extends module
SET config_value = '" . md5(mt_rand()) . "'
WHERE config_name = 'avatar_salt'",
+ 'UPDATE ' . $data['table_prefix'] . "config
+ SET config_value = '" . md5(mt_rand()) . "'
+ WHERE config_name = 'plupload_salt'",
+
'UPDATE ' . $data['table_prefix'] . "users
- SET username = '" . $db->sql_escape($data['admin_name']) . "', user_password='" . $db->sql_escape(md5($data['admin_pass1'])) . "', user_ip = '" . $db->sql_escape($user_ip) . "', user_lang = '" . $db->sql_escape($data['default_lang']) . "', user_email='" . $db->sql_escape($data['board_email1']) . "', user_dateformat='" . $db->sql_escape($lang['default_dateformat']) . "', user_email_hash = " . $db->sql_escape(phpbb_email_hash($data['board_email1'])) . ", username_clean = '" . $db->sql_escape(utf8_clean_string($data['admin_name'])) . "'
+ SET username = '" . $db->sql_escape($data['admin_name']) . "', user_password='" . $db->sql_escape(md5($data['admin_pass1'])) . "', user_ip = '" . $db->sql_escape($user_ip) . "', user_lang = '" . $db->sql_escape($data['default_lang']) . "', user_email='" . $db->sql_escape($data['board_email']) . "', user_dateformat='" . $db->sql_escape($lang['default_dateformat']) . "', user_email_hash = " . $db->sql_escape(phpbb_email_hash($data['board_email'])) . ", username_clean = '" . $db->sql_escape(utf8_clean_string($data['admin_name'])) . "'
WHERE username = 'Admin'",
'UPDATE ' . $data['table_prefix'] . "moderator_cache
@@ -1356,10 +1400,10 @@ class install_install extends module
WHERE config_name = 'dbms_version'",
);
- if (@extension_loaded('gd') || can_load_dll('gd'))
+ if (@extension_loaded('gd'))
{
$sql_ary[] = 'UPDATE ' . $data['table_prefix'] . "config
- SET config_value = 'phpbb_captcha_gd'
+ SET config_value = 'core.captcha.plugins.gd'
WHERE config_name = 'captcha_plugin'";
$sql_ary[] = 'UPDATE ' . $data['table_prefix'] . "config
@@ -1415,7 +1459,7 @@ class install_install extends module
*/
function build_search_index($mode, $sub)
{
- global $db, $lang, $phpbb_root_path, $phpEx, $config;
+ global $db, $lang, $phpbb_root_path, $phpbb_dispatcher, $phpEx, $config, $auth, $user;
// Obtain any submitted data
$data = $this->get_submitted_data();
@@ -1432,33 +1476,23 @@ class install_install extends module
$dbms = $available_dbms[$data['dbms']]['DRIVER'];
- // Load the appropriate database class if not already loaded
- include($phpbb_root_path . 'includes/db/' . $dbms . '.' . $phpEx);
-
// Instantiate the database
- $db = new $sql_db();
+ $db = new $dbms();
$db->sql_connect($data['dbhost'], $data['dbuser'], htmlspecialchars_decode($data['dbpasswd']), $data['dbname'], $data['dbport'], false, false);
// NOTE: trigger_error does not work here.
$db->sql_return_on_error(true);
include_once($phpbb_root_path . 'includes/constants.' . $phpEx);
- include_once($phpbb_root_path . 'includes/search/fulltext_native.' . $phpEx);
+ include_once($phpbb_root_path . 'phpbb/search/fulltext_native.' . $phpEx);
- // Fill the config array - it is needed by those functions we call
- $sql = 'SELECT *
- FROM ' . CONFIG_TABLE;
- $result = $db->sql_query($sql);
-
- $config = array();
- while ($row = $db->sql_fetchrow($result))
- {
- $config[$row['config_name']] = $row['config_value'];
- }
- $db->sql_freeresult($result);
+ // We need to fill the config to let internal functions correctly work
+ $config = new \phpbb\config\db($db, new \phpbb\cache\driver\null, CONFIG_TABLE);
+ set_config(null, null, null, $config);
+ set_config_count(null, null, null, $config);
$error = false;
- $search = new fulltext_native($error);
+ $search = new \phpbb\search\fulltext_native($error, $phpbb_root_path, $phpEx, $auth, $config, $db, $user, $phpbb_dispatcher);
$sql = 'SELECT post_id, post_subject, post_text, poster_id, forum_id
FROM ' . POSTS_TABLE;
@@ -1476,7 +1510,13 @@ class install_install extends module
*/
function add_modules($mode, $sub)
{
- global $db, $lang, $phpbb_root_path, $phpEx;
+ global $db, $lang, $phpbb_root_path, $phpEx, $phpbb_extension_manager, $config, $phpbb_container;
+
+ // modules require an extension manager
+ if (empty($phpbb_extension_manager))
+ {
+ $phpbb_extension_manager = $phpbb_container->get('ext.manager');
+ }
include_once($phpbb_root_path . 'includes/acp/acp_modules.' . $phpEx);
@@ -1493,8 +1533,14 @@ class install_install extends module
foreach ($this->module_categories[$module_class] as $cat_name => $subs)
{
+ $basename = '';
+ // Check if this sub-category has a basename. If it has, use it.
+ if (isset($this->module_categories_basenames[$cat_name]))
+ {
+ $basename = $this->module_categories_basenames[$cat_name];
+ }
$module_data = array(
- 'module_basename' => '',
+ 'module_basename' => $basename,
'module_enabled' => 1,
'module_display' => 1,
'parent_id' => 0,
@@ -1508,10 +1554,10 @@ class install_install extends module
$_module->update_module_data($module_data, true);
// Check for last sql error happened
- if ($db->sql_error_triggered)
+ if ($db->get_sql_error_triggered())
{
- $error = $db->sql_error($db->sql_error_sql);
- $this->p_master->db_error($error['message'], $db->sql_error_sql, __LINE__, __FILE__);
+ $error = $db->sql_error($db->get_sql_error_sql());
+ $this->p_master->db_error($error['message'], $db->get_sql_error_sql(), __LINE__, __FILE__);
}
$categories[$cat_name]['id'] = (int) $module_data['module_id'];
@@ -1522,8 +1568,14 @@ class install_install extends module
{
foreach ($subs as $level2_name)
{
+ $basename = '';
+ // Check if this sub-category has a basename. If it has, use it.
+ if (isset($this->module_categories_basenames[$level2_name]))
+ {
+ $basename = $this->module_categories_basenames[$level2_name];
+ }
$module_data = array(
- 'module_basename' => '',
+ 'module_basename' => $basename,
'module_enabled' => 1,
'module_display' => 1,
'parent_id' => (int) $categories[$cat_name]['id'],
@@ -1536,10 +1588,10 @@ class install_install extends module
$_module->update_module_data($module_data, true);
// Check for last sql error happened
- if ($db->sql_error_triggered)
+ if ($db->get_sql_error_triggered())
{
- $error = $db->sql_error($db->sql_error_sql);
- $this->p_master->db_error($error['message'], $db->sql_error_sql, __LINE__, __FILE__);
+ $error = $db->sql_error($db->get_sql_error_sql());
+ $this->p_master->db_error($error['message'], $db->get_sql_error_sql(), __LINE__, __FILE__);
}
$categories[$level2_name]['id'] = (int) $module_data['module_id'];
@@ -1576,10 +1628,10 @@ class install_install extends module
$_module->update_module_data($module_data, true);
// Check for last sql error happened
- if ($db->sql_error_triggered)
+ if ($db->get_sql_error_triggered())
{
- $error = $db->sql_error($db->sql_error_sql);
- $this->p_master->db_error($error['message'], $db->sql_error_sql, __LINE__, __FILE__);
+ $error = $db->sql_error($db->get_sql_error_sql());
+ $this->p_master->db_error($error['message'], $db->get_sql_error_sql(), __LINE__, __FILE__);
}
}
}
@@ -1591,7 +1643,7 @@ class install_install extends module
// Move main module 4 up...
$sql = 'SELECT *
FROM ' . MODULES_TABLE . "
- WHERE module_basename = 'main'
+ WHERE module_basename = 'acp_main'
AND module_class = 'acp'
AND module_mode = 'main'";
$result = $db->sql_query($sql);
@@ -1603,7 +1655,7 @@ class install_install extends module
// Move permissions intro screen module 4 up...
$sql = 'SELECT *
FROM ' . MODULES_TABLE . "
- WHERE module_basename = 'permissions'
+ WHERE module_basename = 'acp_permissions'
AND module_class = 'acp'
AND module_mode = 'intro'";
$result = $db->sql_query($sql);
@@ -1615,7 +1667,7 @@ class install_install extends module
// Move manage users screen module 5 up...
$sql = 'SELECT *
FROM ' . MODULES_TABLE . "
- WHERE module_basename = 'users'
+ WHERE module_basename = 'acp_users'
AND module_class = 'acp'
AND module_mode = 'overview'";
$result = $db->sql_query($sql);
@@ -1623,6 +1675,19 @@ class install_install extends module
$db->sql_freeresult($result);
$_module->move_module_by($row, 'move_up', 5);
+
+ // Move extension management module 1 up...
+ $sql = 'SELECT *
+ FROM ' . MODULES_TABLE . "
+ WHERE module_langname = 'ACP_EXTENSION_MANAGEMENT'
+ AND module_class = 'acp'
+ AND module_mode = ''
+ AND module_basename = ''";
+ $result = $db->sql_query($sql);
+ $row = $db->sql_fetchrow($result);
+ $db->sql_freeresult($result);
+
+ $_module->move_module_by($row, 'move_up', 1);
}
if ($module_class == 'mcp')
@@ -1630,7 +1695,7 @@ class install_install extends module
// Move pm report details module 3 down...
$sql = 'SELECT *
FROM ' . MODULES_TABLE . "
- WHERE module_basename = 'pm_reports'
+ WHERE module_basename = 'mcp_pm_reports'
AND module_class = 'mcp'
AND module_mode = 'pm_report_details'";
$result = $db->sql_query($sql);
@@ -1642,7 +1707,7 @@ class install_install extends module
// Move closed pm reports module 3 down...
$sql = 'SELECT *
FROM ' . MODULES_TABLE . "
- WHERE module_basename = 'pm_reports'
+ WHERE module_basename = 'mcp_pm_reports'
AND module_class = 'mcp'
AND module_mode = 'pm_reports_closed'";
$result = $db->sql_query($sql);
@@ -1654,7 +1719,7 @@ class install_install extends module
// Move open pm reports module 3 down...
$sql = 'SELECT *
FROM ' . MODULES_TABLE . "
- WHERE module_basename = 'pm_reports'
+ WHERE module_basename = 'mcp_pm_reports'
AND module_class = 'mcp'
AND module_mode = 'pm_reports'";
$result = $db->sql_query($sql);
@@ -1669,7 +1734,7 @@ class install_install extends module
// Move attachment module 4 down...
$sql = 'SELECT *
FROM ' . MODULES_TABLE . "
- WHERE module_basename = 'attachments'
+ WHERE module_basename = 'ucp_attachments'
AND module_class = 'ucp'
AND module_mode = 'attachments'";
$result = $db->sql_query($sql);
@@ -1677,6 +1742,30 @@ class install_install extends module
$db->sql_freeresult($result);
$_module->move_module_by($row, 'move_down', 4);
+
+ // Move notification options module 4 down...
+ $sql = 'SELECT *
+ FROM ' . MODULES_TABLE . "
+ WHERE module_basename = 'ucp_notifications'
+ AND module_class = 'ucp'
+ AND module_mode = 'notification_options'";
+ $result = $db->sql_query($sql);
+ $row = $db->sql_fetchrow($result);
+ $db->sql_freeresult($result);
+
+ $_module->move_module_by($row, 'move_down', 4);
+
+ // Move OAuth module 5 down...
+ $sql = 'SELECT *
+ FROM ' . MODULES_TABLE . "
+ WHERE module_basename = 'ucp_auth_link'
+ AND module_class = 'ucp'
+ AND module_mode = 'auth_link'";
+ $result = $db->sql_query($sql);
+ $row = $db->sql_fetchrow($result);
+ $db->sql_freeresult($result);
+
+ $_module->move_module_by($row, 'move_down', 5);
}
// And now for the special ones
@@ -1718,10 +1807,10 @@ class install_install extends module
$_module->update_module_data($module_data, true);
// Check for last sql error happened
- if ($db->sql_error_triggered)
+ if ($db->get_sql_error_triggered())
{
- $error = $db->sql_error($db->sql_error_sql);
- $this->p_master->db_error($error['message'], $db->sql_error_sql, __LINE__, __FILE__);
+ $error = $db->sql_error($db->get_sql_error_sql());
+ $this->p_master->db_error($error['message'], $db->get_sql_error_sql(), __LINE__, __FILE__);
}
}
}
@@ -1745,6 +1834,7 @@ class install_install extends module
$this->error('Unable to access the language directory', __LINE__, __FILE__);
}
+ $installed_languages = array();
while (($file = readdir($dir)) !== false)
{
$path = $phpbb_root_path . 'language/' . $file;
@@ -1768,80 +1858,38 @@ class install_install extends module
$db->sql_query('INSERT INTO ' . LANG_TABLE . ' ' . $db->sql_build_array('INSERT', $lang_pack));
- if ($db->sql_error_triggered)
+ $installed_languages[] = (int) $db->sql_nextid();
+ if ($db->get_sql_error_triggered())
{
- $error = $db->sql_error($db->sql_error_sql);
- $this->p_master->db_error($error['message'], $db->sql_error_sql, __LINE__, __FILE__);
+ $error = $db->sql_error($db->get_sql_error_sql());
+ $this->p_master->db_error($error['message'], $db->get_sql_error_sql(), __LINE__, __FILE__);
}
+ }
+ }
+ closedir($dir);
- $valid_localized = array(
- 'icon_back_top', 'icon_contact_aim', 'icon_contact_email', 'icon_contact_icq', 'icon_contact_jabber', 'icon_contact_msnm', 'icon_contact_pm', 'icon_contact_yahoo', 'icon_contact_www', 'icon_post_delete', 'icon_post_edit', 'icon_post_info', 'icon_post_quote', 'icon_post_report', 'icon_user_online', 'icon_user_offline', 'icon_user_profile', 'icon_user_search', 'icon_user_warn', 'button_pm_forward', 'button_pm_new', 'button_pm_reply', 'button_topic_locked', 'button_topic_new', 'button_topic_reply',
- );
-
- $sql_ary = array();
-
- $sql = 'SELECT *
- FROM ' . STYLES_IMAGESET_TABLE;
- $result = $db->sql_query($sql);
-
- while ($imageset_row = $db->sql_fetchrow($result))
- {
- if (@file_exists("{$phpbb_root_path}styles/{$imageset_row['imageset_path']}/imageset/{$lang_pack['lang_iso']}/imageset.cfg"))
- {
- $cfg_data_imageset_data = parse_cfg_file("{$phpbb_root_path}styles/{$imageset_row['imageset_path']}/imageset/{$lang_pack['lang_iso']}/imageset.cfg");
- foreach ($cfg_data_imageset_data as $image_name => $value)
- {
- if (strpos($value, '*') !== false)
- {
- if (substr($value, -1, 1) === '*')
- {
- list($image_filename, $image_height) = explode('*', $value);
- $image_width = 0;
- }
- else
- {
- list($image_filename, $image_height, $image_width) = explode('*', $value);
- }
- }
- else
- {
- $image_filename = $value;
- $image_height = $image_width = 0;
- }
-
- if (strpos($image_name, 'img_') === 0 && $image_filename)
- {
- $image_name = substr($image_name, 4);
- if (in_array($image_name, $valid_localized))
- {
- $sql_ary[] = array(
- 'image_name' => (string) $image_name,
- 'image_filename' => (string) $image_filename,
- 'image_height' => (int) $image_height,
- 'image_width' => (int) $image_width,
- 'imageset_id' => (int) $imageset_row['imageset_id'],
- 'image_lang' => (string) $lang_pack['lang_iso'],
- );
- }
- }
- }
- }
- }
- $db->sql_freeresult($result);
-
- if (sizeof($sql_ary))
- {
- $db->sql_multi_insert(STYLES_IMAGESET_DATA_TABLE, $sql_ary);
+ $sql = 'SELECT *
+ FROM ' . PROFILE_FIELDS_TABLE;
+ $result = $db->sql_query($sql);
- if ($db->sql_error_triggered)
- {
- $error = $db->sql_error($db->sql_error_sql);
- $this->p_master->db_error($error['message'], $db->sql_error_sql, __LINE__, __FILE__);
- }
- }
+ $profile_fields = array();
+ $insert_buffer = new \phpbb\db\sql_insert_buffer($db, PROFILE_LANG_TABLE);
+ while ($row = $db->sql_fetchrow($result))
+ {
+ foreach ($installed_languages as $lang_id)
+ {
+ $insert_buffer->insert(array(
+ 'field_id' => $row['field_id'],
+ 'lang_id' => $lang_id,
+ 'lang_name' => strtoupper(substr($row['field_name'], 6)),// Remove phpbb_ from field name
+ 'lang_explain' => '',
+ 'lang_default_value' => '',
+ ));
}
}
- closedir($dir);
+ $db->sql_freeresult($result);
+
+ $insert_buffer->flush();
}
/**
@@ -1854,17 +1902,10 @@ class install_install extends module
// Obtain any submitted data
$data = $this->get_submitted_data();
- // Fill the config array - it is needed by those functions we call
- $sql = 'SELECT *
- FROM ' . CONFIG_TABLE;
- $result = $db->sql_query($sql);
-
- $config = array();
- while ($row = $db->sql_fetchrow($result))
- {
- $config[$row['config_name']] = $row['config_value'];
- }
- $db->sql_freeresult($result);
+ // We need to fill the config to let internal functions correctly work
+ $config = new \phpbb\config\db($db, new \phpbb\cache\driver\null, CONFIG_TABLE);
+ set_config(null, null, null, $config);
+ set_config_count(null, null, null, $config);
$sql = 'SELECT group_id
FROM ' . GROUPS_TABLE . "
@@ -1896,7 +1937,7 @@ class install_install extends module
'user_email' => '',
'user_lang' => $data['default_lang'],
'user_style' => 1,
- 'user_timezone' => 0,
+ 'user_timezone' => 'UTC',
'user_dateformat' => $lang['default_dateformat'],
'user_allow_massemail' => 0,
'user_allow_pm' => 0,
@@ -1907,7 +1948,7 @@ class install_install extends module
if (!$user_id)
{
// If we can't insert this user then continue to the next one to avoid inconsistent data
- $this->p_master->db_error('Unable to insert bot into users table', $db->sql_error_sql, __LINE__, __FILE__, true);
+ $this->p_master->db_error('Unable to insert bot into users table', $db->get_sql_error_sql(), __LINE__, __FILE__, true);
continue;
}
@@ -1919,7 +1960,7 @@ class install_install extends module
'bot_ip' => (string) $bot_ary[1],
));
- $result = $db->sql_query($sql);
+ $db->sql_query($sql);
}
}
@@ -1928,23 +1969,17 @@ class install_install extends module
*/
function email_admin($mode, $sub)
{
- global $auth, $config, $db, $lang, $template, $user, $phpbb_root_path, $phpEx;
+ global $auth, $config, $db, $lang, $template, $user, $phpbb_root_path, $phpbb_admin_path, $phpEx;
$this->page_title = $lang['STAGE_FINAL'];
// Obtain any submitted data
$data = $this->get_submitted_data();
- $sql = 'SELECT *
- FROM ' . CONFIG_TABLE;
- $result = $db->sql_query($sql);
-
- $config = array();
- while ($row = $db->sql_fetchrow($result))
- {
- $config[$row['config_name']] = $row['config_value'];
- }
- $db->sql_freeresult($result);
+ // We need to fill the config to let internal functions correctly work
+ $config = new \phpbb\config\db($db, new \phpbb\cache\driver\null, CONFIG_TABLE);
+ set_config(null, null, null, $config);
+ set_config_count(null, null, null, $config);
$user->session_begin();
$auth->login($data['admin_name'], $data['admin_pass1'], false, true, true);
@@ -1962,7 +1997,7 @@ class install_install extends module
$messenger->template('installed', $data['language']);
- $messenger->to($data['board_email1'], $data['admin_name']);
+ $messenger->to($data['board_email'], $data['admin_name']);
$messenger->anti_abuse_headers($config, $user);
@@ -1981,7 +2016,7 @@ class install_install extends module
'TITLE' => $lang['INSTALL_CONGRATS'],
'BODY' => sprintf($lang['INSTALL_CONGRATS_EXPLAIN'], $config['version'], append_sid($phpbb_root_path . 'install/index.' . $phpEx, 'mode=convert&amp;language=' . $data['language']), '../docs/README.html'),
'L_SUBMIT' => $lang['INSTALL_LOGIN'],
- 'U_ACTION' => append_sid($phpbb_root_path . 'adm/index.' . $phpEx, 'i=send_statistics&amp;mode=send_statistics'),
+ 'U_ACTION' => append_sid($phpbb_admin_path . 'index.' . $phpEx, 'i=send_statistics&amp;mode=send_statistics'),
));
}
@@ -2001,6 +2036,26 @@ class install_install extends module
}
/**
+ * Populate migrations for the installation
+ *
+ * This "installs" all migrations from (root path)/phpbb/db/migrations/data.
+ * "installs" means it adds all migrations to the migrations table, but does not
+ * perform any of the actions in the migrations.
+ *
+ * @param \phpbb\extension\manager $extension_manager
+ * @param \phpbb\db\migrator $migrator
+ */
+ function populate_migrations($extension_manager, $migrator)
+ {
+ $finder = $extension_manager->get_finder();
+
+ $migrations = $finder
+ ->core_path('phpbb/db/migration/data/')
+ ->get_classes();
+ $migrator->populate_migrations($migrations);
+ }
+
+ /**
* Generate a list of available mail server authentication methods
*/
function mail_auth_select($selected_method)
@@ -2026,7 +2081,7 @@ class install_install extends module
return array(
'language' => basename(request_var('language', '')),
'dbms' => request_var('dbms', ''),
- 'dbhost' => request_var('dbhost', ''),
+ 'dbhost' => request_var('dbhost', '', true),
'dbport' => request_var('dbport', ''),
'dbuser' => request_var('dbuser', ''),
'dbpasswd' => request_var('dbpasswd', '', true),
@@ -2036,8 +2091,7 @@ class install_install extends module
'admin_name' => utf8_normalize_nfc(request_var('admin_name', '', true)),
'admin_pass1' => request_var('admin_pass1', '', true),
'admin_pass2' => request_var('admin_pass2', '', true),
- 'board_email1' => strtolower(request_var('board_email1', '')),
- 'board_email2' => strtolower(request_var('board_email2', '')),
+ 'board_email' => strtolower(request_var('board_email', '')),
'img_imagick' => request_var('img_imagick', ''),
'ftp_path' => request_var('ftp_path', ''),
'ftp_user' => request_var('ftp_user', ''),
@@ -2076,8 +2130,7 @@ class install_install extends module
'admin_name' => array('lang' => 'ADMIN_USERNAME', 'type' => 'text:25:100', 'explain' => true),
'admin_pass1' => array('lang' => 'ADMIN_PASSWORD', 'type' => 'password:25:100', 'explain' => true),
'admin_pass2' => array('lang' => 'ADMIN_PASSWORD_CONFIRM', 'type' => 'password:25:100', 'explain' => false),
- 'board_email1' => array('lang' => 'CONTACT_EMAIL', 'type' => 'text:25:100', 'explain' => false),
- 'board_email2' => array('lang' => 'CONTACT_EMAIL_CONFIRM', 'type' => 'text:25:100', 'explain' => false),
+ 'board_email' => array('lang' => 'CONTACT_EMAIL', 'type' => 'email:25:100', 'explain' => false),
);
var $advanced_config_options = array(
'legend1' => 'ACP_EMAIL_SETTINGS',
@@ -2218,9 +2271,10 @@ class install_install extends module
'ACP_PERMISSION_ROLES',
'ACP_PERMISSION_MASKS',
),
- 'ACP_CAT_STYLES' => array(
+ 'ACP_CAT_CUSTOMISE' => array(
'ACP_STYLE_MANAGEMENT',
- 'ACP_STYLE_COMPONENTS',
+ 'ACP_EXTENSION_MANAGEMENT',
+ 'ACP_LANGUAGE',
),
'ACP_CAT_MAINTENANCE' => array(
'ACP_FORUM_LOGS',
@@ -2251,6 +2305,9 @@ class install_install extends module
'UCP_ZEBRA' => null,
),
);
+ var $module_categories_basenames = array(
+ 'UCP_PM' => 'ucp_pm',
+ );
var $module_extras = array(
'acp' => array(
@@ -2272,5 +2329,3 @@ class install_install extends module
),
);
}
-
-?> \ No newline at end of file
diff --git a/phpBB/install/install_main.php b/phpBB/install/install_main.php
index e9f35efa1d..d5874dac83 100644
--- a/phpBB/install/install_main.php
+++ b/phpBB/install/install_main.php
@@ -1,10 +1,13 @@
<?php
/**
*
-* @package install
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -32,7 +35,6 @@ if (!empty($setmodules))
/**
* Main Tab - Installation
-* @package install
*/
class install_main extends module
{
@@ -54,7 +56,7 @@ class install_main extends module
case 'license' :
$title = $lang['GPL'];
- $body = implode("<br/>\n", file('../docs/COPYING'));
+ $body = implode("<br/>\n", file(__DIR__ . '/../docs/LICENSE.txt'));
break;
case 'support' :
@@ -74,5 +76,3 @@ class install_main extends module
));
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/install/install_update.php b/phpBB/install/install_update.php
index 2f3ee1c55a..a00280a925 100644
--- a/phpBB/install/install_update.php
+++ b/phpBB/install/install_update.php
@@ -1,16 +1,20 @@
<?php
/**
*
-* @package install
-* @version $Id$
-* @copyright (c) 2006 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
-* @todo check for writable cache/store/files directory
*/
/**
+* @todo check for writable cache/store/files directory
*/
+
if (!defined('IN_INSTALL'))
{
// Someone has tried to access the file directly. This is not a good idea, so exit
@@ -20,16 +24,7 @@ if (!defined('IN_INSTALL'))
if (!empty($setmodules))
{
// If phpBB is not installed we do not include this module
- if (@file_exists($phpbb_root_path . 'config.' . $phpEx) && !@file_exists($phpbb_root_path . 'cache/install_lock'))
- {
- include_once($phpbb_root_path . 'config.' . $phpEx);
-
- if (!defined('PHPBB_INSTALLED'))
- {
- return;
- }
- }
- else
+ if (!phpbb_check_installation_exists($phpbb_root_path, $phpEx) || file_exists($phpbb_root_path . 'cache/install_lock'))
{
return;
}
@@ -40,14 +35,13 @@ if (!empty($setmodules))
'module_filename' => substr(basename(__FILE__), 0, -strlen($phpEx)-1),
'module_order' => 30,
'module_subs' => '',
- 'module_stages' => array('INTRO', 'VERSION_CHECK', 'UPDATE_DB', 'FILE_CHECK', 'UPDATE_FILES'),
+ 'module_stages' => array('INTRO', 'VERSION_CHECK', 'FILE_CHECK', 'UPDATE_FILES', 'UPDATE_DB'),
'module_reqs' => ''
);
}
/**
* Update Installation
-* @package install
*/
class install_update extends module
{
@@ -72,6 +66,25 @@ class install_update extends module
function main($mode, $sub)
{
global $template, $phpEx, $phpbb_root_path, $user, $db, $config, $cache, $auth, $language;
+ global $request, $phpbb_admin_path, $phpbb_adm_relative_path, $phpbb_container, $phpbb_config_php_file;
+
+ // We must enable super globals, otherwise creating a new instance of the request class,
+ // using the new container with a dbal connection will fail with the following PHP Notice:
+ // Object of class phpbb_request_deactivated_super_global could not be converted to int
+ $request->enable_super_globals();
+
+ // Create a normal container now
+ $phpbb_container_builder = new \phpbb\di\container_builder($phpbb_config_php_file, $phpbb_root_path, $phpEx);
+ $phpbb_container_builder->set_dump_container(false);
+ $phpbb_container_builder->set_use_extensions(false);
+ if (file_exists($phpbb_root_path . 'install/update/new/config'))
+ {
+ $phpbb_container_builder->set_config_path($phpbb_root_path . 'install/update/new/config');
+ }
+ $phpbb_container = $phpbb_container_builder->get_container();
+
+ // Writes into global $cache
+ $cache = $phpbb_container->get('cache');
$this->tpl_name = 'install_update';
$this->page_title = 'UPDATE_INSTALLATION';
@@ -80,8 +93,7 @@ class install_update extends module
$this->new_location = $phpbb_root_path . 'install/update/new/';
// Init DB
- require($phpbb_root_path . 'config.' . $phpEx);
- require($phpbb_root_path . 'includes/db/' . $dbms . '.' . $phpEx);
+ extract($phpbb_config_php_file->get_all());
require($phpbb_root_path . 'includes/constants.' . $phpEx);
// Special options for conflicts/modified files
@@ -90,7 +102,9 @@ class install_update extends module
define('MERGE_NEW_FILE', 3);
define('MERGE_MOD_FILE', 4);
- $db = new $sql_db();
+ $dbms = $phpbb_config_php_file->convert_30_dbms_to_31($dbms);
+
+ $db = new $dbms();
// Connect to DB
$db->sql_connect($dbhost, $dbuser, $dbpasswd, $dbname, $dbport, false, false);
@@ -98,17 +112,10 @@ class install_update extends module
// We do not need this any longer, unset for safety purposes
unset($dbpasswd);
- $config = array();
-
- $sql = 'SELECT config_name, config_value
- FROM ' . CONFIG_TABLE;
- $result = $db->sql_query($sql);
-
- while ($row = $db->sql_fetchrow($result))
- {
- $config[$row['config_name']] = $row['config_value'];
- }
- $db->sql_freeresult($result);
+ // We need to fill the config to let internal functions correctly work
+ $config = new \phpbb\config\db($db, new \phpbb\cache\driver\null, CONFIG_TABLE);
+ set_config(null, null, null, $config);
+ set_config_count(null, null, null, $config);
// Force template recompile
$config['load_tplcompile'] = 1;
@@ -123,7 +130,7 @@ class install_update extends module
$config['default_lang'] = $language;
$user->data['user_lang'] = $language;
- $user->setup(array('common', 'acp/common', 'acp/board', 'install', 'posting'));
+ $user->add_lang(array('common', 'acp/common', 'acp/board', 'install', 'posting'));
// Reset the default_lang
$config['default_lang'] = $config_default_lang;
@@ -136,10 +143,14 @@ class install_update extends module
}
// Set custom template again. ;)
- $template->set_custom_template('../adm/style', 'admin');
-
- // still, the acp template is never stored in the database
- $user->theme['template_storedb'] = false;
+ $paths = array($phpbb_root_path . 'install/update/new/adm/style', $phpbb_admin_path . 'style');
+ $paths = array_filter($paths, 'is_dir');
+ $template->set_custom_style(array(
+ array(
+ 'name' => 'adm',
+ 'ext_path' => 'adm/style/',
+ ),
+ ), $paths);
$template->assign_vars(array(
'S_USER_LANG' => $user->lang['USER_LANG'],
@@ -150,14 +161,23 @@ class install_update extends module
));
// Get current and latest version
- if (($latest_version = $cache->get('_version_info')) === false)
+ $version_helper = $phpbb_container->get('version_helper');
+ try
{
- $this->latest_version = $this->get_file('version_info');
- $cache->put('_version_info', $this->latest_version);
+ $this->latest_version = $version_helper->get_latest_on_current_branch(true);
}
- else
+ catch (\RuntimeException $e)
{
- $this->latest_version = $latest_version;
+ $this->latest_version = false;
+
+ $update_info = array();
+ include($phpbb_root_path . 'install/update/index.' . $phpEx);
+ $info = (empty($update_info) || !is_array($update_info)) ? false : $update_info;
+
+ if ($info !== false)
+ {
+ $this->latest_version = (!empty($info['version']['to'])) ? trim($info['version']['to']) : false;
+ }
}
// For the current version we trick a bit. ;)
@@ -219,12 +239,6 @@ class install_update extends module
if ($this->test_update === false)
{
- // Got the updater template itself updated? If so, we are able to directly use it - but only if all three files are present
- if (in_array('adm/style/install_update.html', $this->update_info['files']))
- {
- $this->tpl_name = '../../install/update/new/adm/style/install_update';
- }
-
// What about the language file? Got it updated?
if (in_array('language/' . $language . '/install.' . $phpEx, $this->update_info['files']))
{
@@ -252,7 +266,7 @@ class install_update extends module
$this->include_file('includes/diff/renderer.' . $phpEx);
// Make sure we stay at the file check if checking the files again
- if (!empty($_POST['check_again']))
+ if ($request->variable('check_again', false, false, \phpbb\request\request_interface::POST))
{
$sub = $this->p_master->sub = 'file_check';
}
@@ -269,6 +283,7 @@ class install_update extends module
// Make sure the update list is destroyed.
$cache->destroy('_update_list');
+ $cache->destroy('_update_list_time');
$cache->destroy('_diff_files');
$cache->destroy('_expected_files');
break;
@@ -277,15 +292,14 @@ class install_update extends module
$this->page_title = 'STAGE_VERSION_CHECK';
$template->assign_vars(array(
- 'S_UP_TO_DATE' => $up_to_date,
'S_VERSION_CHECK' => true,
- 'U_ACTION' => append_sid($this->p_master->module_url, "language=$language&amp;mode=$mode&amp;sub=file_check"),
- 'U_DB_UPDATE_ACTION' => append_sid($this->p_master->module_url, "language=$language&amp;mode=$mode&amp;sub=update_db"),
+ 'U_ACTION' => append_sid($this->p_master->module_url, "language=$language&amp;mode=$mode&amp;sub=file_check"),
+ 'S_UP_TO_DATE' => $up_to_date,
'LATEST_VERSION' => $this->latest_version,
- 'CURRENT_VERSION' => $this->current_version)
- );
+ 'CURRENT_VERSION' => $this->current_version,
+ ));
// Print out version the update package updates to
if ($this->latest_version != $this->update_info['version']['to'])
@@ -306,30 +320,6 @@ class install_update extends module
break;
case 'update_db':
-
- // Make sure the database update is valid for the latest version
- $valid = false;
- $updates_to_version = '';
-
- if (file_exists($phpbb_root_path . 'install/database_update.' . $phpEx))
- {
- include_once($phpbb_root_path . 'install/database_update.' . $phpEx);
-
- if ($updates_to_version === $this->update_info['version']['to'])
- {
- $valid = true;
- }
- }
-
- // Should not happen at all
- if (!$valid)
- {
- trigger_error($user->lang['DATABASE_UPDATE_INFO_OLD'], E_USER_ERROR);
- }
-
- // Just a precaution
- $cache->purge();
-
// Redirect the user to the database update script with some explanations...
$template->assign_vars(array(
'S_DB_UPDATE' => true,
@@ -337,8 +327,14 @@ class install_update extends module
'U_DB_UPDATE' => append_sid($phpbb_root_path . 'install/database_update.' . $phpEx, 'type=1&amp;language=' . $user->data['user_lang']),
'U_DB_UPDATE_ACTION' => append_sid($this->p_master->module_url, "language=$language&amp;mode=$mode&amp;sub=update_db"),
'U_ACTION' => append_sid($this->p_master->module_url, "language=$language&amp;mode=$mode&amp;sub=file_check"),
+ 'L_EVERYTHING_UP_TO_DATE' => $user->lang('EVERYTHING_UP_TO_DATE', append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=login'), append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=login&amp;redirect=' . $phpbb_adm_relative_path . 'index.php%3Fi=send_statistics%26mode=send_statistics')),
));
+ // Do not display incompatible package note after successful update
+ if ($config['version'] == $this->update_info['version']['to'])
+ {
+ $template->assign_var('S_ERROR', false);
+ }
break;
case 'file_check':
@@ -359,8 +355,8 @@ class install_update extends module
$action = request_var('action', '');
// We are directly within an update. To make sure our update list is correct we check its status.
- $update_list = (!empty($_POST['check_again'])) ? false : $cache->get('_update_list');
- $modified = ($update_list !== false) ? @filemtime($cache->cache_dir . 'data_update_list.' . $phpEx) : 0;
+ $update_list = ($request->variable('check_again', false, false, \phpbb\request\request_interface::POST)) ? false : $cache->get('_update_list');
+ $modified = ($update_list !== false) ? $cache->get('_update_list_time') : 0;
// Make sure the list is up-to-date
if ($update_list !== false)
@@ -389,6 +385,7 @@ class install_update extends module
{
$this->get_update_structure($update_list, $expected_files);
$cache->put('_update_list', $update_list);
+ $cache->put('_update_list_time', time());
// Refresh the page if we are still not finished...
if ($update_list['status'] != -1)
@@ -401,7 +398,7 @@ class install_update extends module
'S_COLLECTED' => (int) $update_list['status'],
'S_TO_COLLECT' => sizeof($this->update_info['files']),
'L_IN_PROGRESS' => $user->lang['COLLECTING_FILE_DIFFS'],
- 'L_IN_PROGRESS_EXPLAIN' => sprintf($user->lang['NUMBER_OF_FILES_COLLECTED'], (int) $update_list['status'], sizeof($this->update_info['files'])),
+ 'L_IN_PROGRESS_EXPLAIN' => sprintf($user->lang['NUMBER_OF_FILES_COLLECTED'], (int) $update_list['status'], sizeof($this->update_info['files']) + sizeof($this->update_info['deleted'])),
));
return;
@@ -427,7 +424,7 @@ class install_update extends module
// Now assign the list to the template
foreach ($update_list as $status => $filelist)
{
- if ($status == 'no_update' || !sizeof($filelist) || $status == 'status')
+ if ($status == 'no_update' || !sizeof($filelist) || $status == 'status' || $status == 'status_deleted')
{
continue;
}
@@ -494,7 +491,7 @@ class install_update extends module
$all_up_to_date = true;
foreach ($update_list as $status => $filelist)
{
- if ($status != 'up_to_date' && $status != 'custom' && $status != 'status' && sizeof($filelist))
+ if ($status != 'up_to_date' && $status != 'custom' && $status != 'status' && $status != 'status_deleted' && sizeof($filelist))
{
$all_up_to_date = false;
break;
@@ -505,65 +502,29 @@ class install_update extends module
'S_FILE_CHECK' => true,
'S_ALL_UP_TO_DATE' => $all_up_to_date,
'S_VERSION_UP_TO_DATE' => $up_to_date,
+ 'S_UP_TO_DATE' => $up_to_date,
'U_ACTION' => append_sid($this->p_master->module_url, "language=$language&amp;mode=$mode&amp;sub=file_check"),
'U_UPDATE_ACTION' => append_sid($this->p_master->module_url, "language=$language&amp;mode=$mode&amp;sub=update_files"),
'U_DB_UPDATE_ACTION' => append_sid($this->p_master->module_url, "language=$language&amp;mode=$mode&amp;sub=update_db"),
));
- if ($all_up_to_date)
+ // Since some people try to update to RC releases, but phpBB.com tells them the last version is the version they currently run
+ // we are faced with the updater thinking the database schema is up-to-date; which it is, but should be updated none-the-less
+ // We now try to cope with this by triggering the update process
+ if (version_compare(str_replace('rc', 'RC', strtolower($this->current_version)), str_replace('rc', 'RC', strtolower($this->update_info['version']['to'])), '<'))
{
- // Add database update to log
- add_log('admin', 'LOG_UPDATE_PHPBB', $this->current_version, $this->update_to_version);
-
- // Refresh prosilver css data - this may cause some unhappy users, but
- $sql = 'SELECT *
- FROM ' . STYLES_THEME_TABLE . "
- WHERE LOWER(theme_name) = 'prosilver'";
- $result = $db->sql_query($sql);
- $theme = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
-
- if ($theme)
- {
- $recache = (empty($theme['theme_data'])) ? true : false;
- $update_time = time();
-
- // We test for stylesheet.css because it is faster and most likely the only file changed on common themes
- if (!$recache && $theme['theme_mtime'] < @filemtime("{$phpbb_root_path}styles/" . $theme['theme_path'] . '/theme/stylesheet.css'))
- {
- $recache = true;
- $update_time = @filemtime("{$phpbb_root_path}styles/" . $theme['theme_path'] . '/theme/stylesheet.css');
- }
- else if (!$recache)
- {
- $last_change = $theme['theme_mtime'];
- $dir = @opendir("{$phpbb_root_path}styles/{$theme['theme_path']}/theme");
-
- if ($dir)
- {
- while (($entry = readdir($dir)) !== false)
- {
- if (substr(strrchr($entry, '.'), 1) == 'css' && $last_change < @filemtime("{$phpbb_root_path}styles/{$theme['theme_path']}/theme/{$entry}"))
- {
- $recache = true;
- break;
- }
- }
- closedir($dir);
- }
- }
+ $template->assign_vars(array(
+ 'S_UP_TO_DATE' => false,
+ ));
+ }
- if ($recache)
- {
- // Instead of re-caching here, we simply remove theme_data... HAR HAR HAR (think about a carribean pirate)
- $sql = 'UPDATE ' . STYLES_THEME_TABLE . " SET theme_data = ''
- WHERE theme_id = " . $theme['theme_id'];
- $db->sql_query($sql);
+ if ($all_up_to_date)
+ {
+ global $phpbb_container;
+ $phpbb_log = $phpbb_container->get('log');
- $cache->destroy('sql', STYLES_THEME_TABLE);
- $cache->destroy('sql', STYLES_TABLE);
- }
- }
+ // Add database update to log
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_UPDATE_PHPBB', time(), array($this->current_version, $this->update_to_version));
$db->sql_return_on_error(true);
$db->sql_query('DELETE FROM ' . CONFIG_TABLE . " WHERE config_name = 'version_update_from'");
@@ -715,7 +676,7 @@ class install_update extends module
{
$cache->put('_diff_files', $file_list);
- if (!empty($_REQUEST['download']))
+ if ($request->variable('download', false))
{
$params[] = 'download=1';
}
@@ -830,7 +791,7 @@ class install_update extends module
$file_list['status'] = -1;
$cache->put('_diff_files', $file_list);
- if (!empty($_REQUEST['download']))
+ if ($request->variable('download', false))
{
$this->include_file('includes/functions_compress.' . $phpEx);
@@ -872,7 +833,7 @@ class install_update extends module
foreach ($update_list as $status => $files)
{
- if ($status == 'up_to_date' || $status == 'no_update' || $status == 'status')
+ if ($status == 'up_to_date' || $status == 'no_update' || $status == 'status' || $status == 'status_deleted')
{
continue;
}
@@ -923,7 +884,14 @@ class install_update extends module
$test_connection = false;
if ($test_ftp_connection || $submit)
{
- $transfer = new $method(request_var('host', ''), request_var('username', ''), request_var('password', ''), request_var('root_path', ''), request_var('port', ''), request_var('timeout', ''));
+ $transfer = new $method(
+ request_var('host', ''),
+ request_var('username', ''),
+ htmlspecialchars_decode($request->untrimmed_variable('password', '')),
+ request_var('root_path', ''),
+ request_var('port', ''),
+ request_var('timeout', '')
+ );
$test_connection = $transfer->open_session();
// Make sure that the directory is correct by checking for the existence of common.php
@@ -964,7 +932,7 @@ class install_update extends module
'DATA' => $data,
'NAME' => $user->lang[strtoupper($method . '_' . $data)],
'EXPLAIN' => $user->lang[strtoupper($method . '_' . $data) . '_EXPLAIN'],
- 'DEFAULT' => (!empty($_REQUEST[$data])) ? request_var($data, '') : $default
+ 'DEFAULT' => $request->variable($data, (string) $default),
));
}
@@ -1009,7 +977,14 @@ class install_update extends module
}
else
{
- $transfer = new $method(request_var('host', ''), request_var('username', ''), request_var('password', ''), request_var('root_path', ''), request_var('port', ''), request_var('timeout', ''));
+ $transfer = new $method(
+ request_var('host', ''),
+ request_var('username', ''),
+ htmlspecialchars_decode($request->untrimmed_variable('password', '')),
+ request_var('root_path', ''),
+ request_var('port', ''),
+ request_var('timeout', '')
+ );
$transfer->open_session();
}
@@ -1090,6 +1065,14 @@ class install_update extends module
$transfer->write_file($file_struct['filename'], $contents);
}
break;
+
+ case 'deleted':
+
+ if ($update_mode != 'download')
+ {
+ $transfer->rename($file_struct['filename'], $file_struct['filename'] . '.bak');
+ }
+ break;
}
}
}
@@ -1124,16 +1107,10 @@ class install_update extends module
*/
function show_diff(&$update_list)
{
- global $phpbb_root_path, $template, $user;
+ global $phpbb_root_path, $template, $user, $phpbb_adm_relative_path;
$this->tpl_name = 'install_update_diff';
- // Got the diff template itself updated? If so, we are able to directly use it
- if (in_array('adm/style/install_update_diff.html', $this->update_info['files']))
- {
- $this->tpl_name = '../../install/update/new/adm/style/install_update_diff';
- }
-
$this->page_title = 'VIEWING_FILE_DIFF';
$status = request_var('status', '');
@@ -1254,6 +1231,16 @@ class install_update extends module
$this->page_title = 'VIEWING_FILE_CONTENTS';
break;
+
+ case 'deleted':
+
+ $diff = $this->return_diff(array(), $phpbb_root_path . $original_file);
+
+ $template->assign_var('S_DIFF_NEW_FILE', true);
+ $diff_mode = 'inline';
+ $this->page_title = 'VIEWING_FILE_CONTENTS';
+
+ break;
}
$diff_mode_options = '';
@@ -1299,7 +1286,9 @@ class install_update extends module
'new_conflict' => array(),
'conflict' => array(),
'no_update' => array(),
+ 'deleted' => array(),
'status' => 0,
+ 'status_deleted'=> 0,
);
}
@@ -1360,7 +1349,7 @@ class install_update extends module
}
}*/
- if (file_exists($phpbb_root_path . dirname($file)) || (strpos($file, 'styles/') !== 0 && strpos($file, 'language/') !== 0))
+ if (!phpbb_ignore_new_file_on_update($phpbb_root_path, $file))
{
$this->get_custom_info($update_list['new'], $file);
$update_list['new'][] = array('filename' => $file, 'custom' => false);
@@ -1378,7 +1367,31 @@ class install_update extends module
$update_list['status']++;
}
+ foreach ($this->update_info['deleted'] as $index => $file)
+ {
+ if (is_int($update_list['status_deleted']) && $index < $update_list['status_deleted'])
+ {
+ continue;
+ }
+
+ if ($num_bytes_processed >= 500 * 1024)
+ {
+ return;
+ }
+
+ if (file_exists($phpbb_root_path . $file))
+ {
+ $update_list['deleted'][] = array('filename' => $file, 'custom' => false, 'as_expected' => false);
+ $num_bytes_processed += filesize($phpbb_root_path . $file);
+ }
+
+ $update_list['status_deleted']++;
+ $update_list['status']++;
+ }
+
+ $update_list['status_deleted'] = -1;
$update_list['status'] = -1;
+
/* if (!sizeof($this->update_info['files']))
{
return $update_list;
@@ -1655,37 +1668,6 @@ class install_update extends module
switch ($mode)
{
- case 'version_info':
- global $phpbb_root_path, $phpEx;
-
- $info = get_remote_file('version.phpbb.com', '/phpbb',
- ((defined('PHPBB_QA')) ? '30x_qa.txt' : '30x.txt'), $errstr, $errno);
-
- if ($info !== false)
- {
- $info = explode("\n", $info);
- $info = trim($info[0]);
- }
-
- if ($this->test_update !== false)
- {
- $info = $this->test_update;
- }
-
- // If info is false the fsockopen function may not be working. Instead get the latest version from our update file (and pray it is up-to-date)
- if ($info === false)
- {
- $update_info = array();
- include($phpbb_root_path . 'install/update/index.' . $phpEx);
- $info = (empty($update_info) || !is_array($update_info)) ? false : $update_info;
-
- if ($info !== false)
- {
- $info = (!empty($info['version']['to'])) ? trim($info['version']['to']) : false;
- }
- }
- break;
-
case 'update_info':
global $phpbb_root_path, $phpEx;
@@ -1707,9 +1689,9 @@ class install_update extends module
$info['custom'] = array();
/*
// Get custom installed styles...
- $sql = 'SELECT template_name, template_path
- FROM ' . STYLES_TEMPLATE_TABLE . "
- WHERE LOWER(template_name) NOT IN ('subsilver2', 'prosilver')";
+ $sql = 'SELECT style_name, style_path
+ FROM ' . STYLES_TABLE . "
+ WHERE LOWER(style_name) NOT IN ('subsilver2', 'prosilver')";
$result = $db->sql_query($sql);
$templates = array();
@@ -1728,7 +1710,7 @@ class install_update extends module
{
foreach ($templates as $row)
{
- $info['custom'][$filename][] = str_replace('/prosilver/', '/' . $row['template_path'] . '/', $filename);
+ $info['custom'][$filename][] = str_replace('/prosilver/', '/' . $row['style_path'] . '/', $filename);
}
}
}
@@ -1798,5 +1780,3 @@ class install_update extends module
return $diff;
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/install/phpinfo.php b/phpBB/install/phpinfo.php
index 6480abf34a..1512b00563 100644
--- a/phpBB/install/phpinfo.php
+++ b/phpBB/install/phpinfo.php
@@ -1,5 +1,14 @@
<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
phpinfo();
-
-?> \ No newline at end of file
diff --git a/phpBB/install/schemas/firebird_schema.sql b/phpBB/install/schemas/firebird_schema.sql
deleted file mode 100644
index eae692f529..0000000000
--- a/phpBB/install/schemas/firebird_schema.sql
+++ /dev/null
@@ -1,1471 +0,0 @@
-# DO NOT EDIT THIS FILE, IT IS GENERATED
-#
-# To change the contents of this file, edit
-# phpBB/develop/create_schema_files.php and
-# run it.
-
-# Table: 'phpbb_attachments'
-CREATE TABLE phpbb_attachments (
- attach_id INTEGER NOT NULL,
- post_msg_id INTEGER DEFAULT 0 NOT NULL,
- topic_id INTEGER DEFAULT 0 NOT NULL,
- in_message INTEGER DEFAULT 0 NOT NULL,
- poster_id INTEGER DEFAULT 0 NOT NULL,
- is_orphan INTEGER DEFAULT 1 NOT NULL,
- physical_filename VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL,
- real_filename VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL,
- download_count INTEGER DEFAULT 0 NOT NULL,
- attach_comment BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL,
- extension VARCHAR(100) CHARACTER SET NONE DEFAULT '' NOT NULL,
- mimetype VARCHAR(100) CHARACTER SET NONE DEFAULT '' NOT NULL,
- filesize INTEGER DEFAULT 0 NOT NULL,
- filetime INTEGER DEFAULT 0 NOT NULL,
- thumbnail INTEGER DEFAULT 0 NOT NULL
-);;
-
-ALTER TABLE phpbb_attachments ADD PRIMARY KEY (attach_id);;
-
-CREATE INDEX phpbb_attachments_filetime ON phpbb_attachments(filetime);;
-CREATE INDEX phpbb_attachments_post_msg_id ON phpbb_attachments(post_msg_id);;
-CREATE INDEX phpbb_attachments_topic_id ON phpbb_attachments(topic_id);;
-CREATE INDEX phpbb_attachments_poster_id ON phpbb_attachments(poster_id);;
-CREATE INDEX phpbb_attachments_is_orphan ON phpbb_attachments(is_orphan);;
-
-CREATE GENERATOR phpbb_attachments_gen;;
-SET GENERATOR phpbb_attachments_gen TO 0;;
-
-CREATE TRIGGER t_phpbb_attachments FOR phpbb_attachments
-BEFORE INSERT
-AS
-BEGIN
- NEW.attach_id = GEN_ID(phpbb_attachments_gen, 1);
-END;;
-
-
-# Table: 'phpbb_acl_groups'
-CREATE TABLE phpbb_acl_groups (
- group_id INTEGER DEFAULT 0 NOT NULL,
- forum_id INTEGER DEFAULT 0 NOT NULL,
- auth_option_id INTEGER DEFAULT 0 NOT NULL,
- auth_role_id INTEGER DEFAULT 0 NOT NULL,
- auth_setting INTEGER DEFAULT 0 NOT NULL
-);;
-
-CREATE INDEX phpbb_acl_groups_group_id ON phpbb_acl_groups(group_id);;
-CREATE INDEX phpbb_acl_groups_auth_opt_id ON phpbb_acl_groups(auth_option_id);;
-CREATE INDEX phpbb_acl_groups_auth_role_id ON phpbb_acl_groups(auth_role_id);;
-
-# Table: 'phpbb_acl_options'
-CREATE TABLE phpbb_acl_options (
- auth_option_id INTEGER NOT NULL,
- auth_option VARCHAR(50) CHARACTER SET NONE DEFAULT '' NOT NULL,
- is_global INTEGER DEFAULT 0 NOT NULL,
- is_local INTEGER DEFAULT 0 NOT NULL,
- founder_only INTEGER DEFAULT 0 NOT NULL
-);;
-
-ALTER TABLE phpbb_acl_options ADD PRIMARY KEY (auth_option_id);;
-
-CREATE UNIQUE INDEX phpbb_acl_options_auth_option ON phpbb_acl_options(auth_option);;
-
-CREATE GENERATOR phpbb_acl_options_gen;;
-SET GENERATOR phpbb_acl_options_gen TO 0;;
-
-CREATE TRIGGER t_phpbb_acl_options FOR phpbb_acl_options
-BEFORE INSERT
-AS
-BEGIN
- NEW.auth_option_id = GEN_ID(phpbb_acl_options_gen, 1);
-END;;
-
-
-# Table: 'phpbb_acl_roles'
-CREATE TABLE phpbb_acl_roles (
- role_id INTEGER NOT NULL,
- role_name VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- role_description BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL,
- role_type VARCHAR(10) CHARACTER SET NONE DEFAULT '' NOT NULL,
- role_order INTEGER DEFAULT 0 NOT NULL
-);;
-
-ALTER TABLE phpbb_acl_roles ADD PRIMARY KEY (role_id);;
-
-CREATE INDEX phpbb_acl_roles_role_type ON phpbb_acl_roles(role_type);;
-CREATE INDEX phpbb_acl_roles_role_order ON phpbb_acl_roles(role_order);;
-
-CREATE GENERATOR phpbb_acl_roles_gen;;
-SET GENERATOR phpbb_acl_roles_gen TO 0;;
-
-CREATE TRIGGER t_phpbb_acl_roles FOR phpbb_acl_roles
-BEFORE INSERT
-AS
-BEGIN
- NEW.role_id = GEN_ID(phpbb_acl_roles_gen, 1);
-END;;
-
-
-# Table: 'phpbb_acl_roles_data'
-CREATE TABLE phpbb_acl_roles_data (
- role_id INTEGER DEFAULT 0 NOT NULL,
- auth_option_id INTEGER DEFAULT 0 NOT NULL,
- auth_setting INTEGER DEFAULT 0 NOT NULL
-);;
-
-ALTER TABLE phpbb_acl_roles_data ADD PRIMARY KEY (role_id, auth_option_id);;
-
-CREATE INDEX phpbb_acl_roles_data_ath_op_id ON phpbb_acl_roles_data(auth_option_id);;
-
-# Table: 'phpbb_acl_users'
-CREATE TABLE phpbb_acl_users (
- user_id INTEGER DEFAULT 0 NOT NULL,
- forum_id INTEGER DEFAULT 0 NOT NULL,
- auth_option_id INTEGER DEFAULT 0 NOT NULL,
- auth_role_id INTEGER DEFAULT 0 NOT NULL,
- auth_setting INTEGER DEFAULT 0 NOT NULL
-);;
-
-CREATE INDEX phpbb_acl_users_user_id ON phpbb_acl_users(user_id);;
-CREATE INDEX phpbb_acl_users_auth_option_id ON phpbb_acl_users(auth_option_id);;
-CREATE INDEX phpbb_acl_users_auth_role_id ON phpbb_acl_users(auth_role_id);;
-
-# Table: 'phpbb_banlist'
-CREATE TABLE phpbb_banlist (
- ban_id INTEGER NOT NULL,
- ban_userid INTEGER DEFAULT 0 NOT NULL,
- ban_ip VARCHAR(40) CHARACTER SET NONE DEFAULT '' NOT NULL,
- ban_email VARCHAR(100) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- ban_start INTEGER DEFAULT 0 NOT NULL,
- ban_end INTEGER DEFAULT 0 NOT NULL,
- ban_exclude INTEGER DEFAULT 0 NOT NULL,
- ban_reason VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- ban_give_reason VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE
-);;
-
-ALTER TABLE phpbb_banlist ADD PRIMARY KEY (ban_id);;
-
-CREATE INDEX phpbb_banlist_ban_end ON phpbb_banlist(ban_end);;
-CREATE INDEX phpbb_banlist_ban_user ON phpbb_banlist(ban_userid, ban_exclude);;
-CREATE INDEX phpbb_banlist_ban_email ON phpbb_banlist(ban_email, ban_exclude);;
-CREATE INDEX phpbb_banlist_ban_ip ON phpbb_banlist(ban_ip, ban_exclude);;
-
-CREATE GENERATOR phpbb_banlist_gen;;
-SET GENERATOR phpbb_banlist_gen TO 0;;
-
-CREATE TRIGGER t_phpbb_banlist FOR phpbb_banlist
-BEFORE INSERT
-AS
-BEGIN
- NEW.ban_id = GEN_ID(phpbb_banlist_gen, 1);
-END;;
-
-
-# Table: 'phpbb_bbcodes'
-CREATE TABLE phpbb_bbcodes (
- bbcode_id INTEGER DEFAULT 0 NOT NULL,
- bbcode_tag VARCHAR(16) CHARACTER SET NONE DEFAULT '' NOT NULL,
- bbcode_helpline VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- display_on_posting INTEGER DEFAULT 0 NOT NULL,
- bbcode_match BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL,
- bbcode_tpl BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL,
- first_pass_match BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL,
- first_pass_replace BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL,
- second_pass_match BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL,
- second_pass_replace BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL
-);;
-
-ALTER TABLE phpbb_bbcodes ADD PRIMARY KEY (bbcode_id);;
-
-CREATE INDEX phpbb_bbcodes_display_on_post ON phpbb_bbcodes(display_on_posting);;
-
-# Table: 'phpbb_bookmarks'
-CREATE TABLE phpbb_bookmarks (
- topic_id INTEGER DEFAULT 0 NOT NULL,
- user_id INTEGER DEFAULT 0 NOT NULL
-);;
-
-ALTER TABLE phpbb_bookmarks ADD PRIMARY KEY (topic_id, user_id);;
-
-
-# Table: 'phpbb_bots'
-CREATE TABLE phpbb_bots (
- bot_id INTEGER NOT NULL,
- bot_active INTEGER DEFAULT 1 NOT NULL,
- bot_name VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- user_id INTEGER DEFAULT 0 NOT NULL,
- bot_agent VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL,
- bot_ip VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL
-);;
-
-ALTER TABLE phpbb_bots ADD PRIMARY KEY (bot_id);;
-
-CREATE INDEX phpbb_bots_bot_active ON phpbb_bots(bot_active);;
-
-CREATE GENERATOR phpbb_bots_gen;;
-SET GENERATOR phpbb_bots_gen TO 0;;
-
-CREATE TRIGGER t_phpbb_bots FOR phpbb_bots
-BEFORE INSERT
-AS
-BEGIN
- NEW.bot_id = GEN_ID(phpbb_bots_gen, 1);
-END;;
-
-
-# Table: 'phpbb_config'
-CREATE TABLE phpbb_config (
- config_name VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL,
- config_value VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- is_dynamic INTEGER DEFAULT 0 NOT NULL
-);;
-
-ALTER TABLE phpbb_config ADD PRIMARY KEY (config_name);;
-
-CREATE INDEX phpbb_config_is_dynamic ON phpbb_config(is_dynamic);;
-
-# Table: 'phpbb_confirm'
-CREATE TABLE phpbb_confirm (
- confirm_id CHAR(32) CHARACTER SET NONE DEFAULT '' NOT NULL,
- session_id CHAR(32) CHARACTER SET NONE DEFAULT '' NOT NULL,
- confirm_type INTEGER DEFAULT 0 NOT NULL,
- code VARCHAR(8) CHARACTER SET NONE DEFAULT '' NOT NULL,
- seed INTEGER DEFAULT 0 NOT NULL,
- attempts INTEGER DEFAULT 0 NOT NULL
-);;
-
-ALTER TABLE phpbb_confirm ADD PRIMARY KEY (session_id, confirm_id);;
-
-CREATE INDEX phpbb_confirm_confirm_type ON phpbb_confirm(confirm_type);;
-
-# Table: 'phpbb_disallow'
-CREATE TABLE phpbb_disallow (
- disallow_id INTEGER NOT NULL,
- disallow_username VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE
-);;
-
-ALTER TABLE phpbb_disallow ADD PRIMARY KEY (disallow_id);;
-
-
-CREATE GENERATOR phpbb_disallow_gen;;
-SET GENERATOR phpbb_disallow_gen TO 0;;
-
-CREATE TRIGGER t_phpbb_disallow FOR phpbb_disallow
-BEFORE INSERT
-AS
-BEGIN
- NEW.disallow_id = GEN_ID(phpbb_disallow_gen, 1);
-END;;
-
-
-# Table: 'phpbb_drafts'
-CREATE TABLE phpbb_drafts (
- draft_id INTEGER NOT NULL,
- user_id INTEGER DEFAULT 0 NOT NULL,
- topic_id INTEGER DEFAULT 0 NOT NULL,
- forum_id INTEGER DEFAULT 0 NOT NULL,
- save_time INTEGER DEFAULT 0 NOT NULL,
- draft_subject VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- draft_message BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL
-);;
-
-ALTER TABLE phpbb_drafts ADD PRIMARY KEY (draft_id);;
-
-CREATE INDEX phpbb_drafts_save_time ON phpbb_drafts(save_time);;
-
-CREATE GENERATOR phpbb_drafts_gen;;
-SET GENERATOR phpbb_drafts_gen TO 0;;
-
-CREATE TRIGGER t_phpbb_drafts FOR phpbb_drafts
-BEFORE INSERT
-AS
-BEGIN
- NEW.draft_id = GEN_ID(phpbb_drafts_gen, 1);
-END;;
-
-
-# Table: 'phpbb_extensions'
-CREATE TABLE phpbb_extensions (
- extension_id INTEGER NOT NULL,
- group_id INTEGER DEFAULT 0 NOT NULL,
- extension VARCHAR(100) CHARACTER SET NONE DEFAULT '' NOT NULL
-);;
-
-ALTER TABLE phpbb_extensions ADD PRIMARY KEY (extension_id);;
-
-
-CREATE GENERATOR phpbb_extensions_gen;;
-SET GENERATOR phpbb_extensions_gen TO 0;;
-
-CREATE TRIGGER t_phpbb_extensions FOR phpbb_extensions
-BEFORE INSERT
-AS
-BEGIN
- NEW.extension_id = GEN_ID(phpbb_extensions_gen, 1);
-END;;
-
-
-# Table: 'phpbb_extension_groups'
-CREATE TABLE phpbb_extension_groups (
- group_id INTEGER NOT NULL,
- group_name VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- cat_id INTEGER DEFAULT 0 NOT NULL,
- allow_group INTEGER DEFAULT 0 NOT NULL,
- download_mode INTEGER DEFAULT 1 NOT NULL,
- upload_icon VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL,
- max_filesize INTEGER DEFAULT 0 NOT NULL,
- allowed_forums BLOB SUB_TYPE TEXT CHARACTER SET NONE DEFAULT '' NOT NULL,
- allow_in_pm INTEGER DEFAULT 0 NOT NULL
-);;
-
-ALTER TABLE phpbb_extension_groups ADD PRIMARY KEY (group_id);;
-
-
-CREATE GENERATOR phpbb_extension_groups_gen;;
-SET GENERATOR phpbb_extension_groups_gen TO 0;;
-
-CREATE TRIGGER t_phpbb_extension_groups FOR phpbb_extension_groups
-BEFORE INSERT
-AS
-BEGIN
- NEW.group_id = GEN_ID(phpbb_extension_groups_gen, 1);
-END;;
-
-
-# Table: 'phpbb_forums'
-CREATE TABLE phpbb_forums (
- forum_id INTEGER NOT NULL,
- parent_id INTEGER DEFAULT 0 NOT NULL,
- left_id INTEGER DEFAULT 0 NOT NULL,
- right_id INTEGER DEFAULT 0 NOT NULL,
- forum_parents BLOB SUB_TYPE TEXT CHARACTER SET NONE DEFAULT '' NOT NULL,
- forum_name VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- forum_desc BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL,
- forum_desc_bitfield VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL,
- forum_desc_options INTEGER DEFAULT 7 NOT NULL,
- forum_desc_uid VARCHAR(8) CHARACTER SET NONE DEFAULT '' NOT NULL,
- forum_link VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- forum_password VARCHAR(40) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- forum_style INTEGER DEFAULT 0 NOT NULL,
- forum_image VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL,
- forum_rules BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL,
- forum_rules_link VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- forum_rules_bitfield VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL,
- forum_rules_options INTEGER DEFAULT 7 NOT NULL,
- forum_rules_uid VARCHAR(8) CHARACTER SET NONE DEFAULT '' NOT NULL,
- forum_topics_per_page INTEGER DEFAULT 0 NOT NULL,
- forum_type INTEGER DEFAULT 0 NOT NULL,
- forum_status INTEGER DEFAULT 0 NOT NULL,
- forum_posts INTEGER DEFAULT 0 NOT NULL,
- forum_topics INTEGER DEFAULT 0 NOT NULL,
- forum_topics_real INTEGER DEFAULT 0 NOT NULL,
- forum_last_post_id INTEGER DEFAULT 0 NOT NULL,
- forum_last_poster_id INTEGER DEFAULT 0 NOT NULL,
- forum_last_post_subject VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- forum_last_post_time INTEGER DEFAULT 0 NOT NULL,
- forum_last_poster_name VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- forum_last_poster_colour VARCHAR(6) CHARACTER SET NONE DEFAULT '' NOT NULL,
- forum_flags INTEGER DEFAULT 32 NOT NULL,
- forum_options INTEGER DEFAULT 0 NOT NULL,
- display_subforum_list INTEGER DEFAULT 1 NOT NULL,
- display_on_index INTEGER DEFAULT 1 NOT NULL,
- enable_indexing INTEGER DEFAULT 1 NOT NULL,
- enable_icons INTEGER DEFAULT 1 NOT NULL,
- enable_prune INTEGER DEFAULT 0 NOT NULL,
- prune_next INTEGER DEFAULT 0 NOT NULL,
- prune_days INTEGER DEFAULT 0 NOT NULL,
- prune_viewed INTEGER DEFAULT 0 NOT NULL,
- prune_freq INTEGER DEFAULT 0 NOT NULL
-);;
-
-ALTER TABLE phpbb_forums ADD PRIMARY KEY (forum_id);;
-
-CREATE INDEX phpbb_forums_left_right_id ON phpbb_forums(left_id, right_id);;
-CREATE INDEX phpbb_forums_forum_lastpost_id ON phpbb_forums(forum_last_post_id);;
-
-CREATE GENERATOR phpbb_forums_gen;;
-SET GENERATOR phpbb_forums_gen TO 0;;
-
-CREATE TRIGGER t_phpbb_forums FOR phpbb_forums
-BEFORE INSERT
-AS
-BEGIN
- NEW.forum_id = GEN_ID(phpbb_forums_gen, 1);
-END;;
-
-
-# Table: 'phpbb_forums_access'
-CREATE TABLE phpbb_forums_access (
- forum_id INTEGER DEFAULT 0 NOT NULL,
- user_id INTEGER DEFAULT 0 NOT NULL,
- session_id CHAR(32) CHARACTER SET NONE DEFAULT '' NOT NULL
-);;
-
-ALTER TABLE phpbb_forums_access ADD PRIMARY KEY (forum_id, user_id, session_id);;
-
-
-# Table: 'phpbb_forums_track'
-CREATE TABLE phpbb_forums_track (
- user_id INTEGER DEFAULT 0 NOT NULL,
- forum_id INTEGER DEFAULT 0 NOT NULL,
- mark_time INTEGER DEFAULT 0 NOT NULL
-);;
-
-ALTER TABLE phpbb_forums_track ADD PRIMARY KEY (user_id, forum_id);;
-
-
-# Table: 'phpbb_forums_watch'
-CREATE TABLE phpbb_forums_watch (
- forum_id INTEGER DEFAULT 0 NOT NULL,
- user_id INTEGER DEFAULT 0 NOT NULL,
- notify_status INTEGER DEFAULT 0 NOT NULL
-);;
-
-CREATE INDEX phpbb_forums_watch_forum_id ON phpbb_forums_watch(forum_id);;
-CREATE INDEX phpbb_forums_watch_user_id ON phpbb_forums_watch(user_id);;
-CREATE INDEX phpbb_forums_watch_notify_stat ON phpbb_forums_watch(notify_status);;
-
-# Table: 'phpbb_groups'
-CREATE TABLE phpbb_groups (
- group_id INTEGER NOT NULL,
- group_type INTEGER DEFAULT 1 NOT NULL,
- group_founder_manage INTEGER DEFAULT 0 NOT NULL,
- group_skip_auth INTEGER DEFAULT 0 NOT NULL,
- group_name VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- group_desc BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL,
- group_desc_bitfield VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL,
- group_desc_options INTEGER DEFAULT 7 NOT NULL,
- group_desc_uid VARCHAR(8) CHARACTER SET NONE DEFAULT '' NOT NULL,
- group_display INTEGER DEFAULT 0 NOT NULL,
- group_avatar VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL,
- group_avatar_type INTEGER DEFAULT 0 NOT NULL,
- group_avatar_width INTEGER DEFAULT 0 NOT NULL,
- group_avatar_height INTEGER DEFAULT 0 NOT NULL,
- group_rank INTEGER DEFAULT 0 NOT NULL,
- group_colour VARCHAR(6) CHARACTER SET NONE DEFAULT '' NOT NULL,
- group_sig_chars INTEGER DEFAULT 0 NOT NULL,
- group_receive_pm INTEGER DEFAULT 0 NOT NULL,
- group_message_limit INTEGER DEFAULT 0 NOT NULL,
- group_max_recipients INTEGER DEFAULT 0 NOT NULL,
- group_legend INTEGER DEFAULT 1 NOT NULL
-);;
-
-ALTER TABLE phpbb_groups ADD PRIMARY KEY (group_id);;
-
-CREATE INDEX phpbb_groups_group_legend_name ON phpbb_groups(group_legend, group_name);;
-
-CREATE GENERATOR phpbb_groups_gen;;
-SET GENERATOR phpbb_groups_gen TO 0;;
-
-CREATE TRIGGER t_phpbb_groups FOR phpbb_groups
-BEFORE INSERT
-AS
-BEGIN
- NEW.group_id = GEN_ID(phpbb_groups_gen, 1);
-END;;
-
-
-# Table: 'phpbb_icons'
-CREATE TABLE phpbb_icons (
- icons_id INTEGER NOT NULL,
- icons_url VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL,
- icons_width INTEGER DEFAULT 0 NOT NULL,
- icons_height INTEGER DEFAULT 0 NOT NULL,
- icons_order INTEGER DEFAULT 0 NOT NULL,
- display_on_posting INTEGER DEFAULT 1 NOT NULL
-);;
-
-ALTER TABLE phpbb_icons ADD PRIMARY KEY (icons_id);;
-
-CREATE INDEX phpbb_icons_display_on_posting ON phpbb_icons(display_on_posting);;
-
-CREATE GENERATOR phpbb_icons_gen;;
-SET GENERATOR phpbb_icons_gen TO 0;;
-
-CREATE TRIGGER t_phpbb_icons FOR phpbb_icons
-BEFORE INSERT
-AS
-BEGIN
- NEW.icons_id = GEN_ID(phpbb_icons_gen, 1);
-END;;
-
-
-# Table: 'phpbb_lang'
-CREATE TABLE phpbb_lang (
- lang_id INTEGER NOT NULL,
- lang_iso VARCHAR(30) CHARACTER SET NONE DEFAULT '' NOT NULL,
- lang_dir VARCHAR(30) CHARACTER SET NONE DEFAULT '' NOT NULL,
- lang_english_name VARCHAR(100) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- lang_local_name VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- lang_author VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE
-);;
-
-ALTER TABLE phpbb_lang ADD PRIMARY KEY (lang_id);;
-
-CREATE INDEX phpbb_lang_lang_iso ON phpbb_lang(lang_iso);;
-
-CREATE GENERATOR phpbb_lang_gen;;
-SET GENERATOR phpbb_lang_gen TO 0;;
-
-CREATE TRIGGER t_phpbb_lang FOR phpbb_lang
-BEFORE INSERT
-AS
-BEGIN
- NEW.lang_id = GEN_ID(phpbb_lang_gen, 1);
-END;;
-
-
-# Table: 'phpbb_log'
-CREATE TABLE phpbb_log (
- log_id INTEGER NOT NULL,
- log_type INTEGER DEFAULT 0 NOT NULL,
- user_id INTEGER DEFAULT 0 NOT NULL,
- forum_id INTEGER DEFAULT 0 NOT NULL,
- topic_id INTEGER DEFAULT 0 NOT NULL,
- reportee_id INTEGER DEFAULT 0 NOT NULL,
- log_ip VARCHAR(40) CHARACTER SET NONE DEFAULT '' NOT NULL,
- log_time INTEGER DEFAULT 0 NOT NULL,
- log_operation BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL,
- log_data BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL
-);;
-
-ALTER TABLE phpbb_log ADD PRIMARY KEY (log_id);;
-
-CREATE INDEX phpbb_log_log_type ON phpbb_log(log_type);;
-CREATE INDEX phpbb_log_forum_id ON phpbb_log(forum_id);;
-CREATE INDEX phpbb_log_topic_id ON phpbb_log(topic_id);;
-CREATE INDEX phpbb_log_reportee_id ON phpbb_log(reportee_id);;
-CREATE INDEX phpbb_log_user_id ON phpbb_log(user_id);;
-
-CREATE GENERATOR phpbb_log_gen;;
-SET GENERATOR phpbb_log_gen TO 0;;
-
-CREATE TRIGGER t_phpbb_log FOR phpbb_log
-BEFORE INSERT
-AS
-BEGIN
- NEW.log_id = GEN_ID(phpbb_log_gen, 1);
-END;;
-
-
-# Table: 'phpbb_login_attempts'
-CREATE TABLE phpbb_login_attempts (
- attempt_ip VARCHAR(40) CHARACTER SET NONE DEFAULT '' NOT NULL,
- attempt_browser VARCHAR(150) CHARACTER SET NONE DEFAULT '' NOT NULL,
- attempt_forwarded_for VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL,
- attempt_time INTEGER DEFAULT 0 NOT NULL,
- user_id INTEGER DEFAULT 0 NOT NULL,
- username VARCHAR(255) CHARACTER SET UTF8 DEFAULT 0 NOT NULL COLLATE UNICODE,
- username_clean VARCHAR(255) CHARACTER SET UTF8 DEFAULT 0 NOT NULL COLLATE UNICODE
-);;
-
-CREATE INDEX phpbb_login_attempts_att_ip ON phpbb_login_attempts(attempt_ip, attempt_time);;
-CREATE INDEX phpbb_login_attempts_att_for ON phpbb_login_attempts(attempt_forwarded_for, attempt_time);;
-CREATE INDEX phpbb_login_attempts_att_time ON phpbb_login_attempts(attempt_time);;
-CREATE INDEX phpbb_login_attempts_user_id ON phpbb_login_attempts(user_id);;
-
-# Table: 'phpbb_moderator_cache'
-CREATE TABLE phpbb_moderator_cache (
- forum_id INTEGER DEFAULT 0 NOT NULL,
- user_id INTEGER DEFAULT 0 NOT NULL,
- username VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- group_id INTEGER DEFAULT 0 NOT NULL,
- group_name VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- display_on_index INTEGER DEFAULT 1 NOT NULL
-);;
-
-CREATE INDEX phpbb_moderator_cache_disp_idx ON phpbb_moderator_cache(display_on_index);;
-CREATE INDEX phpbb_moderator_cache_forum_id ON phpbb_moderator_cache(forum_id);;
-
-# Table: 'phpbb_modules'
-CREATE TABLE phpbb_modules (
- module_id INTEGER NOT NULL,
- module_enabled INTEGER DEFAULT 1 NOT NULL,
- module_display INTEGER DEFAULT 1 NOT NULL,
- module_basename VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL,
- module_class VARCHAR(10) CHARACTER SET NONE DEFAULT '' NOT NULL,
- parent_id INTEGER DEFAULT 0 NOT NULL,
- left_id INTEGER DEFAULT 0 NOT NULL,
- right_id INTEGER DEFAULT 0 NOT NULL,
- module_langname VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL,
- module_mode VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL,
- module_auth VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL
-);;
-
-ALTER TABLE phpbb_modules ADD PRIMARY KEY (module_id);;
-
-CREATE INDEX phpbb_modules_left_right_id ON phpbb_modules(left_id, right_id);;
-CREATE INDEX phpbb_modules_module_enabled ON phpbb_modules(module_enabled);;
-CREATE INDEX phpbb_modules_class_left_id ON phpbb_modules(module_class, left_id);;
-
-CREATE GENERATOR phpbb_modules_gen;;
-SET GENERATOR phpbb_modules_gen TO 0;;
-
-CREATE TRIGGER t_phpbb_modules FOR phpbb_modules
-BEFORE INSERT
-AS
-BEGIN
- NEW.module_id = GEN_ID(phpbb_modules_gen, 1);
-END;;
-
-
-# Table: 'phpbb_poll_options'
-CREATE TABLE phpbb_poll_options (
- poll_option_id INTEGER DEFAULT 0 NOT NULL,
- topic_id INTEGER DEFAULT 0 NOT NULL,
- poll_option_text BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL,
- poll_option_total INTEGER DEFAULT 0 NOT NULL
-);;
-
-CREATE INDEX phpbb_poll_options_poll_opt_id ON phpbb_poll_options(poll_option_id);;
-CREATE INDEX phpbb_poll_options_topic_id ON phpbb_poll_options(topic_id);;
-
-# Table: 'phpbb_poll_votes'
-CREATE TABLE phpbb_poll_votes (
- topic_id INTEGER DEFAULT 0 NOT NULL,
- poll_option_id INTEGER DEFAULT 0 NOT NULL,
- vote_user_id INTEGER DEFAULT 0 NOT NULL,
- vote_user_ip VARCHAR(40) CHARACTER SET NONE DEFAULT '' NOT NULL
-);;
-
-CREATE INDEX phpbb_poll_votes_topic_id ON phpbb_poll_votes(topic_id);;
-CREATE INDEX phpbb_poll_votes_vote_user_id ON phpbb_poll_votes(vote_user_id);;
-CREATE INDEX phpbb_poll_votes_vote_user_ip ON phpbb_poll_votes(vote_user_ip);;
-
-# Table: 'phpbb_posts'
-CREATE TABLE phpbb_posts (
- post_id INTEGER NOT NULL,
- topic_id INTEGER DEFAULT 0 NOT NULL,
- forum_id INTEGER DEFAULT 0 NOT NULL,
- poster_id INTEGER DEFAULT 0 NOT NULL,
- icon_id INTEGER DEFAULT 0 NOT NULL,
- poster_ip VARCHAR(40) CHARACTER SET NONE DEFAULT '' NOT NULL,
- post_time INTEGER DEFAULT 0 NOT NULL,
- post_approved INTEGER DEFAULT 1 NOT NULL,
- post_reported INTEGER DEFAULT 0 NOT NULL,
- enable_bbcode INTEGER DEFAULT 1 NOT NULL,
- enable_smilies INTEGER DEFAULT 1 NOT NULL,
- enable_magic_url INTEGER DEFAULT 1 NOT NULL,
- enable_sig INTEGER DEFAULT 1 NOT NULL,
- post_username VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- post_subject VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- post_text BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL,
- post_checksum VARCHAR(32) CHARACTER SET NONE DEFAULT '' NOT NULL,
- post_attachment INTEGER DEFAULT 0 NOT NULL,
- bbcode_bitfield VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL,
- bbcode_uid VARCHAR(8) CHARACTER SET NONE DEFAULT '' NOT NULL,
- post_postcount INTEGER DEFAULT 1 NOT NULL,
- post_edit_time INTEGER DEFAULT 0 NOT NULL,
- post_edit_reason VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- post_edit_user INTEGER DEFAULT 0 NOT NULL,
- post_edit_count INTEGER DEFAULT 0 NOT NULL,
- post_edit_locked INTEGER DEFAULT 0 NOT NULL
-);;
-
-ALTER TABLE phpbb_posts ADD PRIMARY KEY (post_id);;
-
-CREATE INDEX phpbb_posts_forum_id ON phpbb_posts(forum_id);;
-CREATE INDEX phpbb_posts_topic_id ON phpbb_posts(topic_id);;
-CREATE INDEX phpbb_posts_poster_ip ON phpbb_posts(poster_ip);;
-CREATE INDEX phpbb_posts_poster_id ON phpbb_posts(poster_id);;
-CREATE INDEX phpbb_posts_post_approved ON phpbb_posts(post_approved);;
-CREATE INDEX phpbb_posts_post_username ON phpbb_posts(post_username);;
-CREATE INDEX phpbb_posts_tid_post_time ON phpbb_posts(topic_id, post_time);;
-
-CREATE GENERATOR phpbb_posts_gen;;
-SET GENERATOR phpbb_posts_gen TO 0;;
-
-CREATE TRIGGER t_phpbb_posts FOR phpbb_posts
-BEFORE INSERT
-AS
-BEGIN
- NEW.post_id = GEN_ID(phpbb_posts_gen, 1);
-END;;
-
-
-# Table: 'phpbb_privmsgs'
-CREATE TABLE phpbb_privmsgs (
- msg_id INTEGER NOT NULL,
- root_level INTEGER DEFAULT 0 NOT NULL,
- author_id INTEGER DEFAULT 0 NOT NULL,
- icon_id INTEGER DEFAULT 0 NOT NULL,
- author_ip VARCHAR(40) CHARACTER SET NONE DEFAULT '' NOT NULL,
- message_time INTEGER DEFAULT 0 NOT NULL,
- enable_bbcode INTEGER DEFAULT 1 NOT NULL,
- enable_smilies INTEGER DEFAULT 1 NOT NULL,
- enable_magic_url INTEGER DEFAULT 1 NOT NULL,
- enable_sig INTEGER DEFAULT 1 NOT NULL,
- message_subject VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- message_text BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL,
- message_edit_reason VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- message_edit_user INTEGER DEFAULT 0 NOT NULL,
- message_attachment INTEGER DEFAULT 0 NOT NULL,
- bbcode_bitfield VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL,
- bbcode_uid VARCHAR(8) CHARACTER SET NONE DEFAULT '' NOT NULL,
- message_edit_time INTEGER DEFAULT 0 NOT NULL,
- message_edit_count INTEGER DEFAULT 0 NOT NULL,
- to_address BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL,
- bcc_address BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL,
- message_reported INTEGER DEFAULT 0 NOT NULL
-);;
-
-ALTER TABLE phpbb_privmsgs ADD PRIMARY KEY (msg_id);;
-
-CREATE INDEX phpbb_privmsgs_author_ip ON phpbb_privmsgs(author_ip);;
-CREATE INDEX phpbb_privmsgs_message_time ON phpbb_privmsgs(message_time);;
-CREATE INDEX phpbb_privmsgs_author_id ON phpbb_privmsgs(author_id);;
-CREATE INDEX phpbb_privmsgs_root_level ON phpbb_privmsgs(root_level);;
-
-CREATE GENERATOR phpbb_privmsgs_gen;;
-SET GENERATOR phpbb_privmsgs_gen TO 0;;
-
-CREATE TRIGGER t_phpbb_privmsgs FOR phpbb_privmsgs
-BEFORE INSERT
-AS
-BEGIN
- NEW.msg_id = GEN_ID(phpbb_privmsgs_gen, 1);
-END;;
-
-
-# Table: 'phpbb_privmsgs_folder'
-CREATE TABLE phpbb_privmsgs_folder (
- folder_id INTEGER NOT NULL,
- user_id INTEGER DEFAULT 0 NOT NULL,
- folder_name VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- pm_count INTEGER DEFAULT 0 NOT NULL
-);;
-
-ALTER TABLE phpbb_privmsgs_folder ADD PRIMARY KEY (folder_id);;
-
-CREATE INDEX phpbb_privmsgs_folder_user_id ON phpbb_privmsgs_folder(user_id);;
-
-CREATE GENERATOR phpbb_privmsgs_folder_gen;;
-SET GENERATOR phpbb_privmsgs_folder_gen TO 0;;
-
-CREATE TRIGGER t_phpbb_privmsgs_folder FOR phpbb_privmsgs_folder
-BEFORE INSERT
-AS
-BEGIN
- NEW.folder_id = GEN_ID(phpbb_privmsgs_folder_gen, 1);
-END;;
-
-
-# Table: 'phpbb_privmsgs_rules'
-CREATE TABLE phpbb_privmsgs_rules (
- rule_id INTEGER NOT NULL,
- user_id INTEGER DEFAULT 0 NOT NULL,
- rule_check INTEGER DEFAULT 0 NOT NULL,
- rule_connection INTEGER DEFAULT 0 NOT NULL,
- rule_string VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- rule_user_id INTEGER DEFAULT 0 NOT NULL,
- rule_group_id INTEGER DEFAULT 0 NOT NULL,
- rule_action INTEGER DEFAULT 0 NOT NULL,
- rule_folder_id INTEGER DEFAULT 0 NOT NULL
-);;
-
-ALTER TABLE phpbb_privmsgs_rules ADD PRIMARY KEY (rule_id);;
-
-CREATE INDEX phpbb_privmsgs_rules_user_id ON phpbb_privmsgs_rules(user_id);;
-
-CREATE GENERATOR phpbb_privmsgs_rules_gen;;
-SET GENERATOR phpbb_privmsgs_rules_gen TO 0;;
-
-CREATE TRIGGER t_phpbb_privmsgs_rules FOR phpbb_privmsgs_rules
-BEFORE INSERT
-AS
-BEGIN
- NEW.rule_id = GEN_ID(phpbb_privmsgs_rules_gen, 1);
-END;;
-
-
-# Table: 'phpbb_privmsgs_to'
-CREATE TABLE phpbb_privmsgs_to (
- msg_id INTEGER DEFAULT 0 NOT NULL,
- user_id INTEGER DEFAULT 0 NOT NULL,
- author_id INTEGER DEFAULT 0 NOT NULL,
- pm_deleted INTEGER DEFAULT 0 NOT NULL,
- pm_new INTEGER DEFAULT 1 NOT NULL,
- pm_unread INTEGER DEFAULT 1 NOT NULL,
- pm_replied INTEGER DEFAULT 0 NOT NULL,
- pm_marked INTEGER DEFAULT 0 NOT NULL,
- pm_forwarded INTEGER DEFAULT 0 NOT NULL,
- folder_id INTEGER DEFAULT 0 NOT NULL
-);;
-
-CREATE INDEX phpbb_privmsgs_to_msg_id ON phpbb_privmsgs_to(msg_id);;
-CREATE INDEX phpbb_privmsgs_to_author_id ON phpbb_privmsgs_to(author_id);;
-CREATE INDEX phpbb_privmsgs_to_usr_flder_id ON phpbb_privmsgs_to(user_id, folder_id);;
-
-# Table: 'phpbb_profile_fields'
-CREATE TABLE phpbb_profile_fields (
- field_id INTEGER NOT NULL,
- field_name VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- field_type INTEGER DEFAULT 0 NOT NULL,
- field_ident VARCHAR(20) CHARACTER SET NONE DEFAULT '' NOT NULL,
- field_length VARCHAR(20) CHARACTER SET NONE DEFAULT '' NOT NULL,
- field_minlen VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL,
- field_maxlen VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL,
- field_novalue VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- field_default_value VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- field_validation VARCHAR(20) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- field_required INTEGER DEFAULT 0 NOT NULL,
- field_show_novalue INTEGER DEFAULT 0 NOT NULL,
- field_show_on_reg INTEGER DEFAULT 0 NOT NULL,
- field_show_on_vt INTEGER DEFAULT 0 NOT NULL,
- field_show_profile INTEGER DEFAULT 0 NOT NULL,
- field_hide INTEGER DEFAULT 0 NOT NULL,
- field_no_view INTEGER DEFAULT 0 NOT NULL,
- field_active INTEGER DEFAULT 0 NOT NULL,
- field_order INTEGER DEFAULT 0 NOT NULL
-);;
-
-ALTER TABLE phpbb_profile_fields ADD PRIMARY KEY (field_id);;
-
-CREATE INDEX phpbb_profile_fields_fld_type ON phpbb_profile_fields(field_type);;
-CREATE INDEX phpbb_profile_fields_fld_ordr ON phpbb_profile_fields(field_order);;
-
-CREATE GENERATOR phpbb_profile_fields_gen;;
-SET GENERATOR phpbb_profile_fields_gen TO 0;;
-
-CREATE TRIGGER t_phpbb_profile_fields FOR phpbb_profile_fields
-BEFORE INSERT
-AS
-BEGIN
- NEW.field_id = GEN_ID(phpbb_profile_fields_gen, 1);
-END;;
-
-
-# Table: 'phpbb_profile_fields_data'
-CREATE TABLE phpbb_profile_fields_data (
- user_id INTEGER DEFAULT 0 NOT NULL
-);;
-
-ALTER TABLE phpbb_profile_fields_data ADD PRIMARY KEY (user_id);;
-
-
-# Table: 'phpbb_profile_fields_lang'
-CREATE TABLE phpbb_profile_fields_lang (
- field_id INTEGER DEFAULT 0 NOT NULL,
- lang_id INTEGER DEFAULT 0 NOT NULL,
- option_id INTEGER DEFAULT 0 NOT NULL,
- field_type INTEGER DEFAULT 0 NOT NULL,
- lang_value VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE
-);;
-
-ALTER TABLE phpbb_profile_fields_lang ADD PRIMARY KEY (field_id, lang_id, option_id);;
-
-
-# Table: 'phpbb_profile_lang'
-CREATE TABLE phpbb_profile_lang (
- field_id INTEGER DEFAULT 0 NOT NULL,
- lang_id INTEGER DEFAULT 0 NOT NULL,
- lang_name VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- lang_explain BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL,
- lang_default_value VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE
-);;
-
-ALTER TABLE phpbb_profile_lang ADD PRIMARY KEY (field_id, lang_id);;
-
-
-# Table: 'phpbb_ranks'
-CREATE TABLE phpbb_ranks (
- rank_id INTEGER NOT NULL,
- rank_title VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- rank_min INTEGER DEFAULT 0 NOT NULL,
- rank_special INTEGER DEFAULT 0 NOT NULL,
- rank_image VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL
-);;
-
-ALTER TABLE phpbb_ranks ADD PRIMARY KEY (rank_id);;
-
-
-CREATE GENERATOR phpbb_ranks_gen;;
-SET GENERATOR phpbb_ranks_gen TO 0;;
-
-CREATE TRIGGER t_phpbb_ranks FOR phpbb_ranks
-BEFORE INSERT
-AS
-BEGIN
- NEW.rank_id = GEN_ID(phpbb_ranks_gen, 1);
-END;;
-
-
-# Table: 'phpbb_reports'
-CREATE TABLE phpbb_reports (
- report_id INTEGER NOT NULL,
- reason_id INTEGER DEFAULT 0 NOT NULL,
- post_id INTEGER DEFAULT 0 NOT NULL,
- pm_id INTEGER DEFAULT 0 NOT NULL,
- user_id INTEGER DEFAULT 0 NOT NULL,
- user_notify INTEGER DEFAULT 0 NOT NULL,
- report_closed INTEGER DEFAULT 0 NOT NULL,
- report_time INTEGER DEFAULT 0 NOT NULL,
- report_text BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL
-);;
-
-ALTER TABLE phpbb_reports ADD PRIMARY KEY (report_id);;
-
-CREATE INDEX phpbb_reports_post_id ON phpbb_reports(post_id);;
-CREATE INDEX phpbb_reports_pm_id ON phpbb_reports(pm_id);;
-
-CREATE GENERATOR phpbb_reports_gen;;
-SET GENERATOR phpbb_reports_gen TO 0;;
-
-CREATE TRIGGER t_phpbb_reports FOR phpbb_reports
-BEFORE INSERT
-AS
-BEGIN
- NEW.report_id = GEN_ID(phpbb_reports_gen, 1);
-END;;
-
-
-# Table: 'phpbb_reports_reasons'
-CREATE TABLE phpbb_reports_reasons (
- reason_id INTEGER NOT NULL,
- reason_title VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- reason_description BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL,
- reason_order INTEGER DEFAULT 0 NOT NULL
-);;
-
-ALTER TABLE phpbb_reports_reasons ADD PRIMARY KEY (reason_id);;
-
-
-CREATE GENERATOR phpbb_reports_reasons_gen;;
-SET GENERATOR phpbb_reports_reasons_gen TO 0;;
-
-CREATE TRIGGER t_phpbb_reports_reasons FOR phpbb_reports_reasons
-BEFORE INSERT
-AS
-BEGIN
- NEW.reason_id = GEN_ID(phpbb_reports_reasons_gen, 1);
-END;;
-
-
-# Table: 'phpbb_search_results'
-CREATE TABLE phpbb_search_results (
- search_key VARCHAR(32) CHARACTER SET NONE DEFAULT '' NOT NULL,
- search_time INTEGER DEFAULT 0 NOT NULL,
- search_keywords BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL,
- search_authors BLOB SUB_TYPE TEXT CHARACTER SET NONE DEFAULT '' NOT NULL
-);;
-
-ALTER TABLE phpbb_search_results ADD PRIMARY KEY (search_key);;
-
-
-# Table: 'phpbb_search_wordlist'
-CREATE TABLE phpbb_search_wordlist (
- word_id INTEGER NOT NULL,
- word_text VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- word_common INTEGER DEFAULT 0 NOT NULL,
- word_count INTEGER DEFAULT 0 NOT NULL
-);;
-
-ALTER TABLE phpbb_search_wordlist ADD PRIMARY KEY (word_id);;
-
-CREATE UNIQUE INDEX phpbb_search_wordlist_wrd_txt ON phpbb_search_wordlist(word_text);;
-CREATE INDEX phpbb_search_wordlist_wrd_cnt ON phpbb_search_wordlist(word_count);;
-
-CREATE GENERATOR phpbb_search_wordlist_gen;;
-SET GENERATOR phpbb_search_wordlist_gen TO 0;;
-
-CREATE TRIGGER t_phpbb_search_wordlist FOR phpbb_search_wordlist
-BEFORE INSERT
-AS
-BEGIN
- NEW.word_id = GEN_ID(phpbb_search_wordlist_gen, 1);
-END;;
-
-
-# Table: 'phpbb_search_wordmatch'
-CREATE TABLE phpbb_search_wordmatch (
- post_id INTEGER DEFAULT 0 NOT NULL,
- word_id INTEGER DEFAULT 0 NOT NULL,
- title_match INTEGER DEFAULT 0 NOT NULL
-);;
-
-CREATE UNIQUE INDEX phpbb_search_wordmatch_unq_mtch ON phpbb_search_wordmatch(word_id, post_id, title_match);;
-CREATE INDEX phpbb_search_wordmatch_word_id ON phpbb_search_wordmatch(word_id);;
-CREATE INDEX phpbb_search_wordmatch_post_id ON phpbb_search_wordmatch(post_id);;
-
-# Table: 'phpbb_sessions'
-CREATE TABLE phpbb_sessions (
- session_id CHAR(32) CHARACTER SET NONE DEFAULT '' NOT NULL,
- session_user_id INTEGER DEFAULT 0 NOT NULL,
- session_forum_id INTEGER DEFAULT 0 NOT NULL,
- session_last_visit INTEGER DEFAULT 0 NOT NULL,
- session_start INTEGER DEFAULT 0 NOT NULL,
- session_time INTEGER DEFAULT 0 NOT NULL,
- session_ip VARCHAR(40) CHARACTER SET NONE DEFAULT '' NOT NULL,
- session_browser VARCHAR(150) CHARACTER SET NONE DEFAULT '' NOT NULL,
- session_forwarded_for VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL,
- session_page VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- session_viewonline INTEGER DEFAULT 1 NOT NULL,
- session_autologin INTEGER DEFAULT 0 NOT NULL,
- session_admin INTEGER DEFAULT 0 NOT NULL
-);;
-
-ALTER TABLE phpbb_sessions ADD PRIMARY KEY (session_id);;
-
-CREATE INDEX phpbb_sessions_session_time ON phpbb_sessions(session_time);;
-CREATE INDEX phpbb_sessions_session_user_id ON phpbb_sessions(session_user_id);;
-CREATE INDEX phpbb_sessions_session_fid ON phpbb_sessions(session_forum_id);;
-
-# Table: 'phpbb_sessions_keys'
-CREATE TABLE phpbb_sessions_keys (
- key_id CHAR(32) CHARACTER SET NONE DEFAULT '' NOT NULL,
- user_id INTEGER DEFAULT 0 NOT NULL,
- last_ip VARCHAR(40) CHARACTER SET NONE DEFAULT '' NOT NULL,
- last_login INTEGER DEFAULT 0 NOT NULL
-);;
-
-ALTER TABLE phpbb_sessions_keys ADD PRIMARY KEY (key_id, user_id);;
-
-CREATE INDEX phpbb_sessions_keys_last_login ON phpbb_sessions_keys(last_login);;
-
-# Table: 'phpbb_sitelist'
-CREATE TABLE phpbb_sitelist (
- site_id INTEGER NOT NULL,
- site_ip VARCHAR(40) CHARACTER SET NONE DEFAULT '' NOT NULL,
- site_hostname VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL,
- ip_exclude INTEGER DEFAULT 0 NOT NULL
-);;
-
-ALTER TABLE phpbb_sitelist ADD PRIMARY KEY (site_id);;
-
-
-CREATE GENERATOR phpbb_sitelist_gen;;
-SET GENERATOR phpbb_sitelist_gen TO 0;;
-
-CREATE TRIGGER t_phpbb_sitelist FOR phpbb_sitelist
-BEFORE INSERT
-AS
-BEGIN
- NEW.site_id = GEN_ID(phpbb_sitelist_gen, 1);
-END;;
-
-
-# Table: 'phpbb_smilies'
-CREATE TABLE phpbb_smilies (
- smiley_id INTEGER NOT NULL,
- code VARCHAR(50) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- emotion VARCHAR(50) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- smiley_url VARCHAR(50) CHARACTER SET NONE DEFAULT '' NOT NULL,
- smiley_width INTEGER DEFAULT 0 NOT NULL,
- smiley_height INTEGER DEFAULT 0 NOT NULL,
- smiley_order INTEGER DEFAULT 0 NOT NULL,
- display_on_posting INTEGER DEFAULT 1 NOT NULL
-);;
-
-ALTER TABLE phpbb_smilies ADD PRIMARY KEY (smiley_id);;
-
-CREATE INDEX phpbb_smilies_display_on_post ON phpbb_smilies(display_on_posting);;
-
-CREATE GENERATOR phpbb_smilies_gen;;
-SET GENERATOR phpbb_smilies_gen TO 0;;
-
-CREATE TRIGGER t_phpbb_smilies FOR phpbb_smilies
-BEFORE INSERT
-AS
-BEGIN
- NEW.smiley_id = GEN_ID(phpbb_smilies_gen, 1);
-END;;
-
-
-# Table: 'phpbb_styles'
-CREATE TABLE phpbb_styles (
- style_id INTEGER NOT NULL,
- style_name VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- style_copyright VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- style_active INTEGER DEFAULT 1 NOT NULL,
- template_id INTEGER DEFAULT 0 NOT NULL,
- theme_id INTEGER DEFAULT 0 NOT NULL,
- imageset_id INTEGER DEFAULT 0 NOT NULL
-);;
-
-ALTER TABLE phpbb_styles ADD PRIMARY KEY (style_id);;
-
-CREATE UNIQUE INDEX phpbb_styles_style_name ON phpbb_styles(style_name);;
-CREATE INDEX phpbb_styles_template_id ON phpbb_styles(template_id);;
-CREATE INDEX phpbb_styles_theme_id ON phpbb_styles(theme_id);;
-CREATE INDEX phpbb_styles_imageset_id ON phpbb_styles(imageset_id);;
-
-CREATE GENERATOR phpbb_styles_gen;;
-SET GENERATOR phpbb_styles_gen TO 0;;
-
-CREATE TRIGGER t_phpbb_styles FOR phpbb_styles
-BEFORE INSERT
-AS
-BEGIN
- NEW.style_id = GEN_ID(phpbb_styles_gen, 1);
-END;;
-
-
-# Table: 'phpbb_styles_template'
-CREATE TABLE phpbb_styles_template (
- template_id INTEGER NOT NULL,
- template_name VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- template_copyright VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- template_path VARCHAR(100) CHARACTER SET NONE DEFAULT '' NOT NULL,
- bbcode_bitfield VARCHAR(255) CHARACTER SET NONE DEFAULT 'kNg=' NOT NULL,
- template_storedb INTEGER DEFAULT 0 NOT NULL,
- template_inherits_id INTEGER DEFAULT 0 NOT NULL,
- template_inherit_path VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL
-);;
-
-ALTER TABLE phpbb_styles_template ADD PRIMARY KEY (template_id);;
-
-CREATE UNIQUE INDEX phpbb_styles_template_tmplte_nm ON phpbb_styles_template(template_name);;
-
-CREATE GENERATOR phpbb_styles_template_gen;;
-SET GENERATOR phpbb_styles_template_gen TO 0;;
-
-CREATE TRIGGER t_phpbb_styles_template FOR phpbb_styles_template
-BEFORE INSERT
-AS
-BEGIN
- NEW.template_id = GEN_ID(phpbb_styles_template_gen, 1);
-END;;
-
-
-# Table: 'phpbb_styles_template_data'
-CREATE TABLE phpbb_styles_template_data (
- template_id INTEGER DEFAULT 0 NOT NULL,
- template_filename VARCHAR(100) CHARACTER SET NONE DEFAULT '' NOT NULL,
- template_included BLOB SUB_TYPE TEXT CHARACTER SET NONE DEFAULT '' NOT NULL,
- template_mtime INTEGER DEFAULT 0 NOT NULL,
- template_data BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL
-);;
-
-CREATE INDEX phpbb_styles_template_data_tid ON phpbb_styles_template_data(template_id);;
-CREATE INDEX phpbb_styles_template_data_tfn ON phpbb_styles_template_data(template_filename);;
-
-# Table: 'phpbb_styles_theme'
-CREATE TABLE phpbb_styles_theme (
- theme_id INTEGER NOT NULL,
- theme_name VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- theme_copyright VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- theme_path VARCHAR(100) CHARACTER SET NONE DEFAULT '' NOT NULL,
- theme_storedb INTEGER DEFAULT 0 NOT NULL,
- theme_mtime INTEGER DEFAULT 0 NOT NULL,
- theme_data BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL
-);;
-
-ALTER TABLE phpbb_styles_theme ADD PRIMARY KEY (theme_id);;
-
-CREATE UNIQUE INDEX phpbb_styles_theme_theme_name ON phpbb_styles_theme(theme_name);;
-
-CREATE GENERATOR phpbb_styles_theme_gen;;
-SET GENERATOR phpbb_styles_theme_gen TO 0;;
-
-CREATE TRIGGER t_phpbb_styles_theme FOR phpbb_styles_theme
-BEFORE INSERT
-AS
-BEGIN
- NEW.theme_id = GEN_ID(phpbb_styles_theme_gen, 1);
-END;;
-
-
-# Table: 'phpbb_styles_imageset'
-CREATE TABLE phpbb_styles_imageset (
- imageset_id INTEGER NOT NULL,
- imageset_name VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- imageset_copyright VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- imageset_path VARCHAR(100) CHARACTER SET NONE DEFAULT '' NOT NULL
-);;
-
-ALTER TABLE phpbb_styles_imageset ADD PRIMARY KEY (imageset_id);;
-
-CREATE UNIQUE INDEX phpbb_styles_imageset_imgset_nm ON phpbb_styles_imageset(imageset_name);;
-
-CREATE GENERATOR phpbb_styles_imageset_gen;;
-SET GENERATOR phpbb_styles_imageset_gen TO 0;;
-
-CREATE TRIGGER t_phpbb_styles_imageset FOR phpbb_styles_imageset
-BEFORE INSERT
-AS
-BEGIN
- NEW.imageset_id = GEN_ID(phpbb_styles_imageset_gen, 1);
-END;;
-
-
-# Table: 'phpbb_styles_imageset_data'
-CREATE TABLE phpbb_styles_imageset_data (
- image_id INTEGER NOT NULL,
- image_name VARCHAR(200) CHARACTER SET NONE DEFAULT '' NOT NULL,
- image_filename VARCHAR(200) CHARACTER SET NONE DEFAULT '' NOT NULL,
- image_lang VARCHAR(30) CHARACTER SET NONE DEFAULT '' NOT NULL,
- image_height INTEGER DEFAULT 0 NOT NULL,
- image_width INTEGER DEFAULT 0 NOT NULL,
- imageset_id INTEGER DEFAULT 0 NOT NULL
-);;
-
-ALTER TABLE phpbb_styles_imageset_data ADD PRIMARY KEY (image_id);;
-
-CREATE INDEX phpbb_styles_imageset_data_i_d ON phpbb_styles_imageset_data(imageset_id);;
-
-CREATE GENERATOR phpbb_styles_imageset_data_gen;;
-SET GENERATOR phpbb_styles_imageset_data_gen TO 0;;
-
-CREATE TRIGGER t_phpbb_styles_imageset_data FOR phpbb_styles_imageset_data
-BEFORE INSERT
-AS
-BEGIN
- NEW.image_id = GEN_ID(phpbb_styles_imageset_data_gen, 1);
-END;;
-
-
-# Table: 'phpbb_topics'
-CREATE TABLE phpbb_topics (
- topic_id INTEGER NOT NULL,
- forum_id INTEGER DEFAULT 0 NOT NULL,
- icon_id INTEGER DEFAULT 0 NOT NULL,
- topic_attachment INTEGER DEFAULT 0 NOT NULL,
- topic_approved INTEGER DEFAULT 1 NOT NULL,
- topic_reported INTEGER DEFAULT 0 NOT NULL,
- topic_title VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- topic_poster INTEGER DEFAULT 0 NOT NULL,
- topic_time INTEGER DEFAULT 0 NOT NULL,
- topic_time_limit INTEGER DEFAULT 0 NOT NULL,
- topic_views INTEGER DEFAULT 0 NOT NULL,
- topic_replies INTEGER DEFAULT 0 NOT NULL,
- topic_replies_real INTEGER DEFAULT 0 NOT NULL,
- topic_status INTEGER DEFAULT 0 NOT NULL,
- topic_type INTEGER DEFAULT 0 NOT NULL,
- topic_first_post_id INTEGER DEFAULT 0 NOT NULL,
- topic_first_poster_name VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- topic_first_poster_colour VARCHAR(6) CHARACTER SET NONE DEFAULT '' NOT NULL,
- topic_last_post_id INTEGER DEFAULT 0 NOT NULL,
- topic_last_poster_id INTEGER DEFAULT 0 NOT NULL,
- topic_last_poster_name VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- topic_last_poster_colour VARCHAR(6) CHARACTER SET NONE DEFAULT '' NOT NULL,
- topic_last_post_subject VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- topic_last_post_time INTEGER DEFAULT 0 NOT NULL,
- topic_last_view_time INTEGER DEFAULT 0 NOT NULL,
- topic_moved_id INTEGER DEFAULT 0 NOT NULL,
- topic_bumped INTEGER DEFAULT 0 NOT NULL,
- topic_bumper INTEGER DEFAULT 0 NOT NULL,
- poll_title VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- poll_start INTEGER DEFAULT 0 NOT NULL,
- poll_length INTEGER DEFAULT 0 NOT NULL,
- poll_max_options INTEGER DEFAULT 1 NOT NULL,
- poll_last_vote INTEGER DEFAULT 0 NOT NULL,
- poll_vote_change INTEGER DEFAULT 0 NOT NULL
-);;
-
-ALTER TABLE phpbb_topics ADD PRIMARY KEY (topic_id);;
-
-CREATE INDEX phpbb_topics_forum_id ON phpbb_topics(forum_id);;
-CREATE INDEX phpbb_topics_forum_id_type ON phpbb_topics(forum_id, topic_type);;
-CREATE INDEX phpbb_topics_last_post_time ON phpbb_topics(topic_last_post_time);;
-CREATE INDEX phpbb_topics_topic_approved ON phpbb_topics(topic_approved);;
-CREATE INDEX phpbb_topics_forum_appr_last ON phpbb_topics(forum_id, topic_approved, topic_last_post_id);;
-CREATE INDEX phpbb_topics_fid_time_moved ON phpbb_topics(forum_id, topic_last_post_time, topic_moved_id);;
-
-CREATE GENERATOR phpbb_topics_gen;;
-SET GENERATOR phpbb_topics_gen TO 0;;
-
-CREATE TRIGGER t_phpbb_topics FOR phpbb_topics
-BEFORE INSERT
-AS
-BEGIN
- NEW.topic_id = GEN_ID(phpbb_topics_gen, 1);
-END;;
-
-
-# Table: 'phpbb_topics_track'
-CREATE TABLE phpbb_topics_track (
- user_id INTEGER DEFAULT 0 NOT NULL,
- topic_id INTEGER DEFAULT 0 NOT NULL,
- forum_id INTEGER DEFAULT 0 NOT NULL,
- mark_time INTEGER DEFAULT 0 NOT NULL
-);;
-
-ALTER TABLE phpbb_topics_track ADD PRIMARY KEY (user_id, topic_id);;
-
-CREATE INDEX phpbb_topics_track_topic_id ON phpbb_topics_track(topic_id);;
-CREATE INDEX phpbb_topics_track_forum_id ON phpbb_topics_track(forum_id);;
-
-# Table: 'phpbb_topics_posted'
-CREATE TABLE phpbb_topics_posted (
- user_id INTEGER DEFAULT 0 NOT NULL,
- topic_id INTEGER DEFAULT 0 NOT NULL,
- topic_posted INTEGER DEFAULT 0 NOT NULL
-);;
-
-ALTER TABLE phpbb_topics_posted ADD PRIMARY KEY (user_id, topic_id);;
-
-
-# Table: 'phpbb_topics_watch'
-CREATE TABLE phpbb_topics_watch (
- topic_id INTEGER DEFAULT 0 NOT NULL,
- user_id INTEGER DEFAULT 0 NOT NULL,
- notify_status INTEGER DEFAULT 0 NOT NULL
-);;
-
-CREATE INDEX phpbb_topics_watch_topic_id ON phpbb_topics_watch(topic_id);;
-CREATE INDEX phpbb_topics_watch_user_id ON phpbb_topics_watch(user_id);;
-CREATE INDEX phpbb_topics_watch_notify_stat ON phpbb_topics_watch(notify_status);;
-
-# Table: 'phpbb_user_group'
-CREATE TABLE phpbb_user_group (
- group_id INTEGER DEFAULT 0 NOT NULL,
- user_id INTEGER DEFAULT 0 NOT NULL,
- group_leader INTEGER DEFAULT 0 NOT NULL,
- user_pending INTEGER DEFAULT 1 NOT NULL
-);;
-
-CREATE INDEX phpbb_user_group_group_id ON phpbb_user_group(group_id);;
-CREATE INDEX phpbb_user_group_user_id ON phpbb_user_group(user_id);;
-CREATE INDEX phpbb_user_group_group_leader ON phpbb_user_group(group_leader);;
-
-# Table: 'phpbb_users'
-CREATE TABLE phpbb_users (
- user_id INTEGER NOT NULL,
- user_type INTEGER DEFAULT 0 NOT NULL,
- group_id INTEGER DEFAULT 3 NOT NULL,
- user_permissions BLOB SUB_TYPE TEXT CHARACTER SET NONE DEFAULT '' NOT NULL,
- user_perm_from INTEGER DEFAULT 0 NOT NULL,
- user_ip VARCHAR(40) CHARACTER SET NONE DEFAULT '' NOT NULL,
- user_regdate INTEGER DEFAULT 0 NOT NULL,
- username VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- username_clean VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- user_password VARCHAR(40) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- user_passchg INTEGER DEFAULT 0 NOT NULL,
- user_pass_convert INTEGER DEFAULT 0 NOT NULL,
- user_email VARCHAR(100) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- user_email_hash DOUBLE PRECISION DEFAULT 0 NOT NULL,
- user_birthday VARCHAR(10) CHARACTER SET NONE DEFAULT '' NOT NULL,
- user_lastvisit INTEGER DEFAULT 0 NOT NULL,
- user_lastmark INTEGER DEFAULT 0 NOT NULL,
- user_lastpost_time INTEGER DEFAULT 0 NOT NULL,
- user_lastpage VARCHAR(200) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- user_last_confirm_key VARCHAR(10) CHARACTER SET NONE DEFAULT '' NOT NULL,
- user_last_search INTEGER DEFAULT 0 NOT NULL,
- user_warnings INTEGER DEFAULT 0 NOT NULL,
- user_last_warning INTEGER DEFAULT 0 NOT NULL,
- user_login_attempts INTEGER DEFAULT 0 NOT NULL,
- user_inactive_reason INTEGER DEFAULT 0 NOT NULL,
- user_inactive_time INTEGER DEFAULT 0 NOT NULL,
- user_posts INTEGER DEFAULT 0 NOT NULL,
- user_lang VARCHAR(30) CHARACTER SET NONE DEFAULT '' NOT NULL,
- user_timezone DOUBLE PRECISION DEFAULT 0 NOT NULL,
- user_dst INTEGER DEFAULT 0 NOT NULL,
- user_dateformat VARCHAR(30) CHARACTER SET UTF8 DEFAULT 'd M Y H:i' NOT NULL COLLATE UNICODE,
- user_style INTEGER DEFAULT 0 NOT NULL,
- user_rank INTEGER DEFAULT 0 NOT NULL,
- user_colour VARCHAR(6) CHARACTER SET NONE DEFAULT '' NOT NULL,
- user_new_privmsg INTEGER DEFAULT 0 NOT NULL,
- user_unread_privmsg INTEGER DEFAULT 0 NOT NULL,
- user_last_privmsg INTEGER DEFAULT 0 NOT NULL,
- user_message_rules INTEGER DEFAULT 0 NOT NULL,
- user_full_folder INTEGER DEFAULT -3 NOT NULL,
- user_emailtime INTEGER DEFAULT 0 NOT NULL,
- user_topic_show_days INTEGER DEFAULT 0 NOT NULL,
- user_topic_sortby_type VARCHAR(1) CHARACTER SET NONE DEFAULT 't' NOT NULL,
- user_topic_sortby_dir VARCHAR(1) CHARACTER SET NONE DEFAULT 'd' NOT NULL,
- user_post_show_days INTEGER DEFAULT 0 NOT NULL,
- user_post_sortby_type VARCHAR(1) CHARACTER SET NONE DEFAULT 't' NOT NULL,
- user_post_sortby_dir VARCHAR(1) CHARACTER SET NONE DEFAULT 'a' NOT NULL,
- user_notify INTEGER DEFAULT 0 NOT NULL,
- user_notify_pm INTEGER DEFAULT 1 NOT NULL,
- user_notify_type INTEGER DEFAULT 0 NOT NULL,
- user_allow_pm INTEGER DEFAULT 1 NOT NULL,
- user_allow_viewonline INTEGER DEFAULT 1 NOT NULL,
- user_allow_viewemail INTEGER DEFAULT 1 NOT NULL,
- user_allow_massemail INTEGER DEFAULT 1 NOT NULL,
- user_options INTEGER DEFAULT 230271 NOT NULL,
- user_avatar VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL,
- user_avatar_type INTEGER DEFAULT 0 NOT NULL,
- user_avatar_width INTEGER DEFAULT 0 NOT NULL,
- user_avatar_height INTEGER DEFAULT 0 NOT NULL,
- user_sig BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL,
- user_sig_bbcode_uid VARCHAR(8) CHARACTER SET NONE DEFAULT '' NOT NULL,
- user_sig_bbcode_bitfield VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL,
- user_from VARCHAR(100) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- user_icq VARCHAR(15) CHARACTER SET NONE DEFAULT '' NOT NULL,
- user_aim VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- user_yim VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- user_msnm VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- user_jabber VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- user_website VARCHAR(200) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- user_occ BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL,
- user_interests BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL,
- user_actkey VARCHAR(32) CHARACTER SET NONE DEFAULT '' NOT NULL,
- user_newpasswd VARCHAR(40) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- user_form_salt VARCHAR(32) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- user_new INTEGER DEFAULT 1 NOT NULL,
- user_reminded INTEGER DEFAULT 0 NOT NULL,
- user_reminded_time INTEGER DEFAULT 0 NOT NULL
-);;
-
-ALTER TABLE phpbb_users ADD PRIMARY KEY (user_id);;
-
-CREATE INDEX phpbb_users_user_birthday ON phpbb_users(user_birthday);;
-CREATE INDEX phpbb_users_user_email_hash ON phpbb_users(user_email_hash);;
-CREATE INDEX phpbb_users_user_type ON phpbb_users(user_type);;
-CREATE UNIQUE INDEX phpbb_users_username_clean ON phpbb_users(username_clean);;
-
-CREATE GENERATOR phpbb_users_gen;;
-SET GENERATOR phpbb_users_gen TO 0;;
-
-CREATE TRIGGER t_phpbb_users FOR phpbb_users
-BEFORE INSERT
-AS
-BEGIN
- NEW.user_id = GEN_ID(phpbb_users_gen, 1);
-END;;
-
-
-# Table: 'phpbb_warnings'
-CREATE TABLE phpbb_warnings (
- warning_id INTEGER NOT NULL,
- user_id INTEGER DEFAULT 0 NOT NULL,
- post_id INTEGER DEFAULT 0 NOT NULL,
- log_id INTEGER DEFAULT 0 NOT NULL,
- warning_time INTEGER DEFAULT 0 NOT NULL
-);;
-
-ALTER TABLE phpbb_warnings ADD PRIMARY KEY (warning_id);;
-
-
-CREATE GENERATOR phpbb_warnings_gen;;
-SET GENERATOR phpbb_warnings_gen TO 0;;
-
-CREATE TRIGGER t_phpbb_warnings FOR phpbb_warnings
-BEFORE INSERT
-AS
-BEGIN
- NEW.warning_id = GEN_ID(phpbb_warnings_gen, 1);
-END;;
-
-
-# Table: 'phpbb_words'
-CREATE TABLE phpbb_words (
- word_id INTEGER NOT NULL,
- word VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- replacement VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE
-);;
-
-ALTER TABLE phpbb_words ADD PRIMARY KEY (word_id);;
-
-
-CREATE GENERATOR phpbb_words_gen;;
-SET GENERATOR phpbb_words_gen TO 0;;
-
-CREATE TRIGGER t_phpbb_words FOR phpbb_words
-BEFORE INSERT
-AS
-BEGIN
- NEW.word_id = GEN_ID(phpbb_words_gen, 1);
-END;;
-
-
-# Table: 'phpbb_zebra'
-CREATE TABLE phpbb_zebra (
- user_id INTEGER DEFAULT 0 NOT NULL,
- zebra_id INTEGER DEFAULT 0 NOT NULL,
- friend INTEGER DEFAULT 0 NOT NULL,
- foe INTEGER DEFAULT 0 NOT NULL
-);;
-
-ALTER TABLE phpbb_zebra ADD PRIMARY KEY (user_id, zebra_id);;
-
-
diff --git a/phpBB/install/schemas/mssql_schema.sql b/phpBB/install/schemas/mssql_schema.sql
deleted file mode 100644
index 68993d45ee..0000000000
--- a/phpBB/install/schemas/mssql_schema.sql
+++ /dev/null
@@ -1,1796 +0,0 @@
-/*
- * DO NOT EDIT THIS FILE, IT IS GENERATED
- *
- * To change the contents of this file, edit
- * phpBB/develop/create_schema_files.php and
- * run it.
- */
-
-/*
- Table: 'phpbb_attachments'
-*/
-CREATE TABLE [phpbb_attachments] (
- [attach_id] [int] IDENTITY (1, 1) NOT NULL ,
- [post_msg_id] [int] DEFAULT (0) NOT NULL ,
- [topic_id] [int] DEFAULT (0) NOT NULL ,
- [in_message] [int] DEFAULT (0) NOT NULL ,
- [poster_id] [int] DEFAULT (0) NOT NULL ,
- [is_orphan] [int] DEFAULT (1) NOT NULL ,
- [physical_filename] [varchar] (255) DEFAULT ('') NOT NULL ,
- [real_filename] [varchar] (255) DEFAULT ('') NOT NULL ,
- [download_count] [int] DEFAULT (0) NOT NULL ,
- [attach_comment] [varchar] (4000) DEFAULT ('') NOT NULL ,
- [extension] [varchar] (100) DEFAULT ('') NOT NULL ,
- [mimetype] [varchar] (100) DEFAULT ('') NOT NULL ,
- [filesize] [int] DEFAULT (0) NOT NULL ,
- [filetime] [int] DEFAULT (0) NOT NULL ,
- [thumbnail] [int] DEFAULT (0) NOT NULL
-)GO
-
-ALTER TABLE [phpbb_attachments] WITH NOCHECK ADD
- CONSTRAINT [PK_phpbb_attachments] PRIMARY KEY CLUSTERED
- (
- [attach_id]
- )
-GO
-
-CREATE INDEX [filetime] ON [phpbb_attachments]([filetime])
-GO
-
-CREATE INDEX [post_msg_id] ON [phpbb_attachments]([post_msg_id])
-GO
-
-CREATE INDEX [topic_id] ON [phpbb_attachments]([topic_id])
-GO
-
-CREATE INDEX [poster_id] ON [phpbb_attachments]([poster_id])
-GO
-
-CREATE INDEX [is_orphan] ON [phpbb_attachments]([is_orphan])
-GO
-
-
-/*
- Table: 'phpbb_acl_groups'
-*/
-CREATE TABLE [phpbb_acl_groups] (
- [group_id] [int] DEFAULT (0) NOT NULL ,
- [forum_id] [int] DEFAULT (0) NOT NULL ,
- [auth_option_id] [int] DEFAULT (0) NOT NULL ,
- [auth_role_id] [int] DEFAULT (0) NOT NULL ,
- [auth_setting] [int] DEFAULT (0) NOT NULL ,
- [mssqlindex] [int] IDENTITY (1, 1) NOT NULL
-)GO
-
-ALTER TABLE [phpbb_acl_groups] WITH NOCHECK ADD
- CONSTRAINT [PK_phpbb_acl_groups] PRIMARY KEY CLUSTERED
- (
- [mssqlindex]
- )
-GO
-
-CREATE INDEX [group_id] ON [phpbb_acl_groups]([group_id])
-GO
-
-CREATE INDEX [auth_opt_id] ON [phpbb_acl_groups]([auth_option_id])
-GO
-
-CREATE INDEX [auth_role_id] ON [phpbb_acl_groups]([auth_role_id])
-GO
-
-
-/*
- Table: 'phpbb_acl_options'
-*/
-CREATE TABLE [phpbb_acl_options] (
- [auth_option_id] [int] IDENTITY (1, 1) NOT NULL ,
- [auth_option] [varchar] (50) DEFAULT ('') NOT NULL ,
- [is_global] [int] DEFAULT (0) NOT NULL ,
- [is_local] [int] DEFAULT (0) NOT NULL ,
- [founder_only] [int] DEFAULT (0) NOT NULL
-)GO
-
-ALTER TABLE [phpbb_acl_options] WITH NOCHECK ADD
- CONSTRAINT [PK_phpbb_acl_options] PRIMARY KEY CLUSTERED
- (
- [auth_option_id]
- )
-GO
-
-CREATE UNIQUE INDEX [auth_option] ON [phpbb_acl_options]([auth_option])
-GO
-
-
-/*
- Table: 'phpbb_acl_roles'
-*/
-CREATE TABLE [phpbb_acl_roles] (
- [role_id] [int] IDENTITY (1, 1) NOT NULL ,
- [role_name] [varchar] (255) DEFAULT ('') NOT NULL ,
- [role_description] [varchar] (4000) DEFAULT ('') NOT NULL ,
- [role_type] [varchar] (10) DEFAULT ('') NOT NULL ,
- [role_order] [int] DEFAULT (0) NOT NULL
-)GO
-
-ALTER TABLE [phpbb_acl_roles] WITH NOCHECK ADD
- CONSTRAINT [PK_phpbb_acl_roles] PRIMARY KEY CLUSTERED
- (
- [role_id]
- )
-GO
-
-CREATE INDEX [role_type] ON [phpbb_acl_roles]([role_type])
-GO
-
-CREATE INDEX [role_order] ON [phpbb_acl_roles]([role_order])
-GO
-
-
-/*
- Table: 'phpbb_acl_roles_data'
-*/
-CREATE TABLE [phpbb_acl_roles_data] (
- [role_id] [int] DEFAULT (0) NOT NULL ,
- [auth_option_id] [int] DEFAULT (0) NOT NULL ,
- [auth_setting] [int] DEFAULT (0) NOT NULL
-)GO
-
-ALTER TABLE [phpbb_acl_roles_data] WITH NOCHECK ADD
- CONSTRAINT [PK_phpbb_acl_roles_data] PRIMARY KEY CLUSTERED
- (
- [role_id],
- [auth_option_id]
- )
-GO
-
-CREATE INDEX [ath_op_id] ON [phpbb_acl_roles_data]([auth_option_id])
-GO
-
-
-/*
- Table: 'phpbb_acl_users'
-*/
-CREATE TABLE [phpbb_acl_users] (
- [user_id] [int] DEFAULT (0) NOT NULL ,
- [forum_id] [int] DEFAULT (0) NOT NULL ,
- [auth_option_id] [int] DEFAULT (0) NOT NULL ,
- [auth_role_id] [int] DEFAULT (0) NOT NULL ,
- [auth_setting] [int] DEFAULT (0) NOT NULL ,
- [mssqlindex] [int] IDENTITY (1, 1) NOT NULL
-)GO
-
-ALTER TABLE [phpbb_acl_users] WITH NOCHECK ADD
- CONSTRAINT [PK_phpbb_acl_users] PRIMARY KEY CLUSTERED
- (
- [mssqlindex]
- )
-GO
-
-CREATE INDEX [user_id] ON [phpbb_acl_users]([user_id])
-GO
-
-CREATE INDEX [auth_option_id] ON [phpbb_acl_users]([auth_option_id])
-GO
-
-CREATE INDEX [auth_role_id] ON [phpbb_acl_users]([auth_role_id])
-GO
-
-
-/*
- Table: 'phpbb_banlist'
-*/
-CREATE TABLE [phpbb_banlist] (
- [ban_id] [int] IDENTITY (1, 1) NOT NULL ,
- [ban_userid] [int] DEFAULT (0) NOT NULL ,
- [ban_ip] [varchar] (40) DEFAULT ('') NOT NULL ,
- [ban_email] [varchar] (100) DEFAULT ('') NOT NULL ,
- [ban_start] [int] DEFAULT (0) NOT NULL ,
- [ban_end] [int] DEFAULT (0) NOT NULL ,
- [ban_exclude] [int] DEFAULT (0) NOT NULL ,
- [ban_reason] [varchar] (255) DEFAULT ('') NOT NULL ,
- [ban_give_reason] [varchar] (255) DEFAULT ('') NOT NULL
-)GO
-
-ALTER TABLE [phpbb_banlist] WITH NOCHECK ADD
- CONSTRAINT [PK_phpbb_banlist] PRIMARY KEY CLUSTERED
- (
- [ban_id]
- )
-GO
-
-CREATE INDEX [ban_end] ON [phpbb_banlist]([ban_end])
-GO
-
-CREATE INDEX [ban_user] ON [phpbb_banlist]([ban_userid], [ban_exclude])
-GO
-
-CREATE INDEX [ban_email] ON [phpbb_banlist]([ban_email], [ban_exclude])
-GO
-
-CREATE INDEX [ban_ip] ON [phpbb_banlist]([ban_ip], [ban_exclude])
-GO
-
-
-/*
- Table: 'phpbb_bbcodes'
-*/
-CREATE TABLE [phpbb_bbcodes] (
- [bbcode_id] [int] DEFAULT (0) NOT NULL ,
- [bbcode_tag] [varchar] (16) DEFAULT ('') NOT NULL ,
- [bbcode_helpline] [varchar] (255) DEFAULT ('') NOT NULL ,
- [display_on_posting] [int] DEFAULT (0) NOT NULL ,
- [bbcode_match] [varchar] (4000) DEFAULT ('') NOT NULL ,
- [bbcode_tpl] [text] DEFAULT ('') NOT NULL ,
- [first_pass_match] [text] DEFAULT ('') NOT NULL ,
- [first_pass_replace] [text] DEFAULT ('') NOT NULL ,
- [second_pass_match] [text] DEFAULT ('') NOT NULL ,
- [second_pass_replace] [text] DEFAULT ('') NOT NULL
-)GO
-
-ALTER TABLE [phpbb_bbcodes] WITH NOCHECK ADD
- CONSTRAINT [PK_phpbb_bbcodes] PRIMARY KEY CLUSTERED
- (
- [bbcode_id]
- )
-GO
-
-CREATE INDEX [display_on_post] ON [phpbb_bbcodes]([display_on_posting])
-GO
-
-
-/*
- Table: 'phpbb_bookmarks'
-*/
-CREATE TABLE [phpbb_bookmarks] (
- [topic_id] [int] DEFAULT (0) NOT NULL ,
- [user_id] [int] DEFAULT (0) NOT NULL
-)GO
-
-ALTER TABLE [phpbb_bookmarks] WITH NOCHECK ADD
- CONSTRAINT [PK_phpbb_bookmarks] PRIMARY KEY CLUSTERED
- (
- [topic_id],
- [user_id]
- )
-GO
-
-
-/*
- Table: 'phpbb_bots'
-*/
-CREATE TABLE [phpbb_bots] (
- [bot_id] [int] IDENTITY (1, 1) NOT NULL ,
- [bot_active] [int] DEFAULT (1) NOT NULL ,
- [bot_name] [varchar] (255) DEFAULT ('') NOT NULL ,
- [user_id] [int] DEFAULT (0) NOT NULL ,
- [bot_agent] [varchar] (255) DEFAULT ('') NOT NULL ,
- [bot_ip] [varchar] (255) DEFAULT ('') NOT NULL
-)GO
-
-ALTER TABLE [phpbb_bots] WITH NOCHECK ADD
- CONSTRAINT [PK_phpbb_bots] PRIMARY KEY CLUSTERED
- (
- [bot_id]
- )
-GO
-
-CREATE INDEX [bot_active] ON [phpbb_bots]([bot_active])
-GO
-
-
-/*
- Table: 'phpbb_config'
-*/
-CREATE TABLE [phpbb_config] (
- [config_name] [varchar] (255) DEFAULT ('') NOT NULL ,
- [config_value] [varchar] (255) DEFAULT ('') NOT NULL ,
- [is_dynamic] [int] DEFAULT (0) NOT NULL
-)GO
-
-ALTER TABLE [phpbb_config] WITH NOCHECK ADD
- CONSTRAINT [PK_phpbb_config] PRIMARY KEY CLUSTERED
- (
- [config_name]
- )
-GO
-
-CREATE INDEX [is_dynamic] ON [phpbb_config]([is_dynamic])
-GO
-
-
-/*
- Table: 'phpbb_confirm'
-*/
-CREATE TABLE [phpbb_confirm] (
- [confirm_id] [char] (32) DEFAULT ('') NOT NULL ,
- [session_id] [char] (32) DEFAULT ('') NOT NULL ,
- [confirm_type] [int] DEFAULT (0) NOT NULL ,
- [code] [varchar] (8) DEFAULT ('') NOT NULL ,
- [seed] [int] DEFAULT (0) NOT NULL ,
- [attempts] [int] DEFAULT (0) NOT NULL
-)GO
-
-ALTER TABLE [phpbb_confirm] WITH NOCHECK ADD
- CONSTRAINT [PK_phpbb_confirm] PRIMARY KEY CLUSTERED
- (
- [session_id],
- [confirm_id]
- )
-GO
-
-CREATE INDEX [confirm_type] ON [phpbb_confirm]([confirm_type])
-GO
-
-
-/*
- Table: 'phpbb_disallow'
-*/
-CREATE TABLE [phpbb_disallow] (
- [disallow_id] [int] IDENTITY (1, 1) NOT NULL ,
- [disallow_username] [varchar] (255) DEFAULT ('') NOT NULL
-)GO
-
-ALTER TABLE [phpbb_disallow] WITH NOCHECK ADD
- CONSTRAINT [PK_phpbb_disallow] PRIMARY KEY CLUSTERED
- (
- [disallow_id]
- )
-GO
-
-
-/*
- Table: 'phpbb_drafts'
-*/
-CREATE TABLE [phpbb_drafts] (
- [draft_id] [int] IDENTITY (1, 1) NOT NULL ,
- [user_id] [int] DEFAULT (0) NOT NULL ,
- [topic_id] [int] DEFAULT (0) NOT NULL ,
- [forum_id] [int] DEFAULT (0) NOT NULL ,
- [save_time] [int] DEFAULT (0) NOT NULL ,
- [draft_subject] [varchar] (255) DEFAULT ('') NOT NULL ,
- [draft_message] [text] DEFAULT ('') NOT NULL
-)GO
-
-ALTER TABLE [phpbb_drafts] WITH NOCHECK ADD
- CONSTRAINT [PK_phpbb_drafts] PRIMARY KEY CLUSTERED
- (
- [draft_id]
- )
-GO
-
-CREATE INDEX [save_time] ON [phpbb_drafts]([save_time])
-GO
-
-
-/*
- Table: 'phpbb_extensions'
-*/
-CREATE TABLE [phpbb_extensions] (
- [extension_id] [int] IDENTITY (1, 1) NOT NULL ,
- [group_id] [int] DEFAULT (0) NOT NULL ,
- [extension] [varchar] (100) DEFAULT ('') NOT NULL
-)GO
-
-ALTER TABLE [phpbb_extensions] WITH NOCHECK ADD
- CONSTRAINT [PK_phpbb_extensions] PRIMARY KEY CLUSTERED
- (
- [extension_id]
- )
-GO
-
-
-/*
- Table: 'phpbb_extension_groups'
-*/
-CREATE TABLE [phpbb_extension_groups] (
- [group_id] [int] IDENTITY (1, 1) NOT NULL ,
- [group_name] [varchar] (255) DEFAULT ('') NOT NULL ,
- [cat_id] [int] DEFAULT (0) NOT NULL ,
- [allow_group] [int] DEFAULT (0) NOT NULL ,
- [download_mode] [int] DEFAULT (1) NOT NULL ,
- [upload_icon] [varchar] (255) DEFAULT ('') NOT NULL ,
- [max_filesize] [int] DEFAULT (0) NOT NULL ,
- [allowed_forums] [varchar] (8000) DEFAULT ('') NOT NULL ,
- [allow_in_pm] [int] DEFAULT (0) NOT NULL
-)GO
-
-ALTER TABLE [phpbb_extension_groups] WITH NOCHECK ADD
- CONSTRAINT [PK_phpbb_extension_groups] PRIMARY KEY CLUSTERED
- (
- [group_id]
- )
-GO
-
-
-/*
- Table: 'phpbb_forums'
-*/
-CREATE TABLE [phpbb_forums] (
- [forum_id] [int] IDENTITY (1, 1) NOT NULL ,
- [parent_id] [int] DEFAULT (0) NOT NULL ,
- [left_id] [int] DEFAULT (0) NOT NULL ,
- [right_id] [int] DEFAULT (0) NOT NULL ,
- [forum_parents] [text] DEFAULT ('') NOT NULL ,
- [forum_name] [varchar] (255) DEFAULT ('') NOT NULL ,
- [forum_desc] [varchar] (4000) DEFAULT ('') NOT NULL ,
- [forum_desc_bitfield] [varchar] (255) DEFAULT ('') NOT NULL ,
- [forum_desc_options] [int] DEFAULT (7) NOT NULL ,
- [forum_desc_uid] [varchar] (8) DEFAULT ('') NOT NULL ,
- [forum_link] [varchar] (255) DEFAULT ('') NOT NULL ,
- [forum_password] [varchar] (40) DEFAULT ('') NOT NULL ,
- [forum_style] [int] DEFAULT (0) NOT NULL ,
- [forum_image] [varchar] (255) DEFAULT ('') NOT NULL ,
- [forum_rules] [varchar] (4000) DEFAULT ('') NOT NULL ,
- [forum_rules_link] [varchar] (255) DEFAULT ('') NOT NULL ,
- [forum_rules_bitfield] [varchar] (255) DEFAULT ('') NOT NULL ,
- [forum_rules_options] [int] DEFAULT (7) NOT NULL ,
- [forum_rules_uid] [varchar] (8) DEFAULT ('') NOT NULL ,
- [forum_topics_per_page] [int] DEFAULT (0) NOT NULL ,
- [forum_type] [int] DEFAULT (0) NOT NULL ,
- [forum_status] [int] DEFAULT (0) NOT NULL ,
- [forum_posts] [int] DEFAULT (0) NOT NULL ,
- [forum_topics] [int] DEFAULT (0) NOT NULL ,
- [forum_topics_real] [int] DEFAULT (0) NOT NULL ,
- [forum_last_post_id] [int] DEFAULT (0) NOT NULL ,
- [forum_last_poster_id] [int] DEFAULT (0) NOT NULL ,
- [forum_last_post_subject] [varchar] (255) DEFAULT ('') NOT NULL ,
- [forum_last_post_time] [int] DEFAULT (0) NOT NULL ,
- [forum_last_poster_name] [varchar] (255) DEFAULT ('') NOT NULL ,
- [forum_last_poster_colour] [varchar] (6) DEFAULT ('') NOT NULL ,
- [forum_flags] [int] DEFAULT (32) NOT NULL ,
- [forum_options] [int] DEFAULT (0) NOT NULL ,
- [display_subforum_list] [int] DEFAULT (1) NOT NULL ,
- [display_on_index] [int] DEFAULT (1) NOT NULL ,
- [enable_indexing] [int] DEFAULT (1) NOT NULL ,
- [enable_icons] [int] DEFAULT (1) NOT NULL ,
- [enable_prune] [int] DEFAULT (0) NOT NULL ,
- [prune_next] [int] DEFAULT (0) NOT NULL ,
- [prune_days] [int] DEFAULT (0) NOT NULL ,
- [prune_viewed] [int] DEFAULT (0) NOT NULL ,
- [prune_freq] [int] DEFAULT (0) NOT NULL
-)GO
-
-ALTER TABLE [phpbb_forums] WITH NOCHECK ADD
- CONSTRAINT [PK_phpbb_forums] PRIMARY KEY CLUSTERED
- (
- [forum_id]
- )
-GO
-
-CREATE INDEX [left_right_id] ON [phpbb_forums]([left_id], [right_id])
-GO
-
-CREATE INDEX [forum_lastpost_id] ON [phpbb_forums]([forum_last_post_id])
-GO
-
-
-/*
- Table: 'phpbb_forums_access'
-*/
-CREATE TABLE [phpbb_forums_access] (
- [forum_id] [int] DEFAULT (0) NOT NULL ,
- [user_id] [int] DEFAULT (0) NOT NULL ,
- [session_id] [char] (32) DEFAULT ('') NOT NULL
-)GO
-
-ALTER TABLE [phpbb_forums_access] WITH NOCHECK ADD
- CONSTRAINT [PK_phpbb_forums_access] PRIMARY KEY CLUSTERED
- (
- [forum_id],
- [user_id],
- [session_id]
- )
-GO
-
-
-/*
- Table: 'phpbb_forums_track'
-*/
-CREATE TABLE [phpbb_forums_track] (
- [user_id] [int] DEFAULT (0) NOT NULL ,
- [forum_id] [int] DEFAULT (0) NOT NULL ,
- [mark_time] [int] DEFAULT (0) NOT NULL
-)GO
-
-ALTER TABLE [phpbb_forums_track] WITH NOCHECK ADD
- CONSTRAINT [PK_phpbb_forums_track] PRIMARY KEY CLUSTERED
- (
- [user_id],
- [forum_id]
- )
-GO
-
-
-/*
- Table: 'phpbb_forums_watch'
-*/
-CREATE TABLE [phpbb_forums_watch] (
- [forum_id] [int] DEFAULT (0) NOT NULL ,
- [user_id] [int] DEFAULT (0) NOT NULL ,
- [notify_status] [int] DEFAULT (0) NOT NULL ,
- [mssqlindex] [int] IDENTITY (1, 1) NOT NULL
-)GO
-
-ALTER TABLE [phpbb_forums_watch] WITH NOCHECK ADD
- CONSTRAINT [PK_phpbb_forums_watch] PRIMARY KEY CLUSTERED
- (
- [mssqlindex]
- )
-GO
-
-CREATE INDEX [forum_id] ON [phpbb_forums_watch]([forum_id])
-GO
-
-CREATE INDEX [user_id] ON [phpbb_forums_watch]([user_id])
-GO
-
-CREATE INDEX [notify_stat] ON [phpbb_forums_watch]([notify_status])
-GO
-
-
-/*
- Table: 'phpbb_groups'
-*/
-CREATE TABLE [phpbb_groups] (
- [group_id] [int] IDENTITY (1, 1) NOT NULL ,
- [group_type] [int] DEFAULT (1) NOT NULL ,
- [group_founder_manage] [int] DEFAULT (0) NOT NULL ,
- [group_skip_auth] [int] DEFAULT (0) NOT NULL ,
- [group_name] [varchar] (255) DEFAULT ('') NOT NULL ,
- [group_desc] [varchar] (4000) DEFAULT ('') NOT NULL ,
- [group_desc_bitfield] [varchar] (255) DEFAULT ('') NOT NULL ,
- [group_desc_options] [int] DEFAULT (7) NOT NULL ,
- [group_desc_uid] [varchar] (8) DEFAULT ('') NOT NULL ,
- [group_display] [int] DEFAULT (0) NOT NULL ,
- [group_avatar] [varchar] (255) DEFAULT ('') NOT NULL ,
- [group_avatar_type] [int] DEFAULT (0) NOT NULL ,
- [group_avatar_width] [int] DEFAULT (0) NOT NULL ,
- [group_avatar_height] [int] DEFAULT (0) NOT NULL ,
- [group_rank] [int] DEFAULT (0) NOT NULL ,
- [group_colour] [varchar] (6) DEFAULT ('') NOT NULL ,
- [group_sig_chars] [int] DEFAULT (0) NOT NULL ,
- [group_receive_pm] [int] DEFAULT (0) NOT NULL ,
- [group_message_limit] [int] DEFAULT (0) NOT NULL ,
- [group_max_recipients] [int] DEFAULT (0) NOT NULL ,
- [group_legend] [int] DEFAULT (1) NOT NULL
-)GO
-
-ALTER TABLE [phpbb_groups] WITH NOCHECK ADD
- CONSTRAINT [PK_phpbb_groups] PRIMARY KEY CLUSTERED
- (
- [group_id]
- )
-GO
-
-CREATE INDEX [group_legend_name] ON [phpbb_groups]([group_legend], [group_name])
-GO
-
-
-/*
- Table: 'phpbb_icons'
-*/
-CREATE TABLE [phpbb_icons] (
- [icons_id] [int] IDENTITY (1, 1) NOT NULL ,
- [icons_url] [varchar] (255) DEFAULT ('') NOT NULL ,
- [icons_width] [int] DEFAULT (0) NOT NULL ,
- [icons_height] [int] DEFAULT (0) NOT NULL ,
- [icons_order] [int] DEFAULT (0) NOT NULL ,
- [display_on_posting] [int] DEFAULT (1) NOT NULL
-)GO
-
-ALTER TABLE [phpbb_icons] WITH NOCHECK ADD
- CONSTRAINT [PK_phpbb_icons] PRIMARY KEY CLUSTERED
- (
- [icons_id]
- )
-GO
-
-CREATE INDEX [display_on_posting] ON [phpbb_icons]([display_on_posting])
-GO
-
-
-/*
- Table: 'phpbb_lang'
-*/
-CREATE TABLE [phpbb_lang] (
- [lang_id] [int] IDENTITY (1, 1) NOT NULL ,
- [lang_iso] [varchar] (30) DEFAULT ('') NOT NULL ,
- [lang_dir] [varchar] (30) DEFAULT ('') NOT NULL ,
- [lang_english_name] [varchar] (100) DEFAULT ('') NOT NULL ,
- [lang_local_name] [varchar] (255) DEFAULT ('') NOT NULL ,
- [lang_author] [varchar] (255) DEFAULT ('') NOT NULL
-)GO
-
-ALTER TABLE [phpbb_lang] WITH NOCHECK ADD
- CONSTRAINT [PK_phpbb_lang] PRIMARY KEY CLUSTERED
- (
- [lang_id]
- )
-GO
-
-CREATE INDEX [lang_iso] ON [phpbb_lang]([lang_iso])
-GO
-
-
-/*
- Table: 'phpbb_log'
-*/
-CREATE TABLE [phpbb_log] (
- [log_id] [int] IDENTITY (1, 1) NOT NULL ,
- [log_type] [int] DEFAULT (0) NOT NULL ,
- [user_id] [int] DEFAULT (0) NOT NULL ,
- [forum_id] [int] DEFAULT (0) NOT NULL ,
- [topic_id] [int] DEFAULT (0) NOT NULL ,
- [reportee_id] [int] DEFAULT (0) NOT NULL ,
- [log_ip] [varchar] (40) DEFAULT ('') NOT NULL ,
- [log_time] [int] DEFAULT (0) NOT NULL ,
- [log_operation] [varchar] (4000) DEFAULT ('') NOT NULL ,
- [log_data] [text] DEFAULT ('') NOT NULL
-)GO
-
-ALTER TABLE [phpbb_log] WITH NOCHECK ADD
- CONSTRAINT [PK_phpbb_log] PRIMARY KEY CLUSTERED
- (
- [log_id]
- )
-GO
-
-CREATE INDEX [log_type] ON [phpbb_log]([log_type])
-GO
-
-CREATE INDEX [forum_id] ON [phpbb_log]([forum_id])
-GO
-
-CREATE INDEX [topic_id] ON [phpbb_log]([topic_id])
-GO
-
-CREATE INDEX [reportee_id] ON [phpbb_log]([reportee_id])
-GO
-
-CREATE INDEX [user_id] ON [phpbb_log]([user_id])
-GO
-
-
-/*
- Table: 'phpbb_login_attempts'
-*/
-CREATE TABLE [phpbb_login_attempts] (
- [attempt_ip] [varchar] (40) DEFAULT ('') NOT NULL ,
- [attempt_browser] [varchar] (150) DEFAULT ('') NOT NULL ,
- [attempt_forwarded_for] [varchar] (255) DEFAULT ('') NOT NULL ,
- [attempt_time] [int] DEFAULT (0) NOT NULL ,
- [user_id] [int] DEFAULT (0) NOT NULL ,
- [username] [varchar] (255) DEFAULT (0) NOT NULL ,
- [username_clean] [varchar] (255) DEFAULT (0) NOT NULL ,
- [mssqlindex] [int] IDENTITY (1, 1) NOT NULL
-)GO
-
-ALTER TABLE [phpbb_login_attempts] WITH NOCHECK ADD
- CONSTRAINT [PK_phpbb_login_attempts] PRIMARY KEY CLUSTERED
- (
- [mssqlindex]
- )
-GO
-
-CREATE INDEX [att_ip] ON [phpbb_login_attempts]([attempt_ip], [attempt_time])
-GO
-
-CREATE INDEX [att_for] ON [phpbb_login_attempts]([attempt_forwarded_for], [attempt_time])
-GO
-
-CREATE INDEX [att_time] ON [phpbb_login_attempts]([attempt_time])
-GO
-
-CREATE INDEX [user_id] ON [phpbb_login_attempts]([user_id])
-GO
-
-
-/*
- Table: 'phpbb_moderator_cache'
-*/
-CREATE TABLE [phpbb_moderator_cache] (
- [forum_id] [int] DEFAULT (0) NOT NULL ,
- [user_id] [int] DEFAULT (0) NOT NULL ,
- [username] [varchar] (255) DEFAULT ('') NOT NULL ,
- [group_id] [int] DEFAULT (0) NOT NULL ,
- [group_name] [varchar] (255) DEFAULT ('') NOT NULL ,
- [display_on_index] [int] DEFAULT (1) NOT NULL ,
- [mssqlindex] [int] IDENTITY (1, 1) NOT NULL
-)GO
-
-ALTER TABLE [phpbb_moderator_cache] WITH NOCHECK ADD
- CONSTRAINT [PK_phpbb_moderator_cache] PRIMARY KEY CLUSTERED
- (
- [mssqlindex]
- )
-GO
-
-CREATE INDEX [disp_idx] ON [phpbb_moderator_cache]([display_on_index])
-GO
-
-CREATE INDEX [forum_id] ON [phpbb_moderator_cache]([forum_id])
-GO
-
-
-/*
- Table: 'phpbb_modules'
-*/
-CREATE TABLE [phpbb_modules] (
- [module_id] [int] IDENTITY (1, 1) NOT NULL ,
- [module_enabled] [int] DEFAULT (1) NOT NULL ,
- [module_display] [int] DEFAULT (1) NOT NULL ,
- [module_basename] [varchar] (255) DEFAULT ('') NOT NULL ,
- [module_class] [varchar] (10) DEFAULT ('') NOT NULL ,
- [parent_id] [int] DEFAULT (0) NOT NULL ,
- [left_id] [int] DEFAULT (0) NOT NULL ,
- [right_id] [int] DEFAULT (0) NOT NULL ,
- [module_langname] [varchar] (255) DEFAULT ('') NOT NULL ,
- [module_mode] [varchar] (255) DEFAULT ('') NOT NULL ,
- [module_auth] [varchar] (255) DEFAULT ('') NOT NULL
-)GO
-
-ALTER TABLE [phpbb_modules] WITH NOCHECK ADD
- CONSTRAINT [PK_phpbb_modules] PRIMARY KEY CLUSTERED
- (
- [module_id]
- )
-GO
-
-CREATE INDEX [left_right_id] ON [phpbb_modules]([left_id], [right_id])
-GO
-
-CREATE INDEX [module_enabled] ON [phpbb_modules]([module_enabled])
-GO
-
-CREATE INDEX [class_left_id] ON [phpbb_modules]([module_class], [left_id])
-GO
-
-
-/*
- Table: 'phpbb_poll_options'
-*/
-CREATE TABLE [phpbb_poll_options] (
- [poll_option_id] [int] DEFAULT (0) NOT NULL ,
- [topic_id] [int] DEFAULT (0) NOT NULL ,
- [poll_option_text] [varchar] (4000) DEFAULT ('') NOT NULL ,
- [poll_option_total] [int] DEFAULT (0) NOT NULL ,
- [mssqlindex] [int] IDENTITY (1, 1) NOT NULL
-)GO
-
-ALTER TABLE [phpbb_poll_options] WITH NOCHECK ADD
- CONSTRAINT [PK_phpbb_poll_options] PRIMARY KEY CLUSTERED
- (
- [mssqlindex]
- )
-GO
-
-CREATE INDEX [poll_opt_id] ON [phpbb_poll_options]([poll_option_id])
-GO
-
-CREATE INDEX [topic_id] ON [phpbb_poll_options]([topic_id])
-GO
-
-
-/*
- Table: 'phpbb_poll_votes'
-*/
-CREATE TABLE [phpbb_poll_votes] (
- [topic_id] [int] DEFAULT (0) NOT NULL ,
- [poll_option_id] [int] DEFAULT (0) NOT NULL ,
- [vote_user_id] [int] DEFAULT (0) NOT NULL ,
- [vote_user_ip] [varchar] (40) DEFAULT ('') NOT NULL ,
- [mssqlindex] [int] IDENTITY (1, 1) NOT NULL
-)GO
-
-ALTER TABLE [phpbb_poll_votes] WITH NOCHECK ADD
- CONSTRAINT [PK_phpbb_poll_votes] PRIMARY KEY CLUSTERED
- (
- [mssqlindex]
- )
-GO
-
-CREATE INDEX [topic_id] ON [phpbb_poll_votes]([topic_id])
-GO
-
-CREATE INDEX [vote_user_id] ON [phpbb_poll_votes]([vote_user_id])
-GO
-
-CREATE INDEX [vote_user_ip] ON [phpbb_poll_votes]([vote_user_ip])
-GO
-
-
-/*
- Table: 'phpbb_posts'
-*/
-CREATE TABLE [phpbb_posts] (
- [post_id] [int] IDENTITY (1, 1) NOT NULL ,
- [topic_id] [int] DEFAULT (0) NOT NULL ,
- [forum_id] [int] DEFAULT (0) NOT NULL ,
- [poster_id] [int] DEFAULT (0) NOT NULL ,
- [icon_id] [int] DEFAULT (0) NOT NULL ,
- [poster_ip] [varchar] (40) DEFAULT ('') NOT NULL ,
- [post_time] [int] DEFAULT (0) NOT NULL ,
- [post_approved] [int] DEFAULT (1) NOT NULL ,
- [post_reported] [int] DEFAULT (0) NOT NULL ,
- [enable_bbcode] [int] DEFAULT (1) NOT NULL ,
- [enable_smilies] [int] DEFAULT (1) NOT NULL ,
- [enable_magic_url] [int] DEFAULT (1) NOT NULL ,
- [enable_sig] [int] DEFAULT (1) NOT NULL ,
- [post_username] [varchar] (255) DEFAULT ('') NOT NULL ,
- [post_subject] [varchar] (255) DEFAULT ('') NOT NULL ,
- [post_text] [text] DEFAULT ('') NOT NULL ,
- [post_checksum] [varchar] (32) DEFAULT ('') NOT NULL ,
- [post_attachment] [int] DEFAULT (0) NOT NULL ,
- [bbcode_bitfield] [varchar] (255) DEFAULT ('') NOT NULL ,
- [bbcode_uid] [varchar] (8) DEFAULT ('') NOT NULL ,
- [post_postcount] [int] DEFAULT (1) NOT NULL ,
- [post_edit_time] [int] DEFAULT (0) NOT NULL ,
- [post_edit_reason] [varchar] (255) DEFAULT ('') NOT NULL ,
- [post_edit_user] [int] DEFAULT (0) NOT NULL ,
- [post_edit_count] [int] DEFAULT (0) NOT NULL ,
- [post_edit_locked] [int] DEFAULT (0) NOT NULL
-)GO
-
-ALTER TABLE [phpbb_posts] WITH NOCHECK ADD
- CONSTRAINT [PK_phpbb_posts] PRIMARY KEY CLUSTERED
- (
- [post_id]
- )
-GO
-
-CREATE INDEX [forum_id] ON [phpbb_posts]([forum_id])
-GO
-
-CREATE INDEX [topic_id] ON [phpbb_posts]([topic_id])
-GO
-
-CREATE INDEX [poster_ip] ON [phpbb_posts]([poster_ip])
-GO
-
-CREATE INDEX [poster_id] ON [phpbb_posts]([poster_id])
-GO
-
-CREATE INDEX [post_approved] ON [phpbb_posts]([post_approved])
-GO
-
-CREATE INDEX [post_username] ON [phpbb_posts]([post_username])
-GO
-
-CREATE INDEX [tid_post_time] ON [phpbb_posts]([topic_id], [post_time])
-GO
-
-
-/*
- Table: 'phpbb_privmsgs'
-*/
-CREATE TABLE [phpbb_privmsgs] (
- [msg_id] [int] IDENTITY (1, 1) NOT NULL ,
- [root_level] [int] DEFAULT (0) NOT NULL ,
- [author_id] [int] DEFAULT (0) NOT NULL ,
- [icon_id] [int] DEFAULT (0) NOT NULL ,
- [author_ip] [varchar] (40) DEFAULT ('') NOT NULL ,
- [message_time] [int] DEFAULT (0) NOT NULL ,
- [enable_bbcode] [int] DEFAULT (1) NOT NULL ,
- [enable_smilies] [int] DEFAULT (1) NOT NULL ,
- [enable_magic_url] [int] DEFAULT (1) NOT NULL ,
- [enable_sig] [int] DEFAULT (1) NOT NULL ,
- [message_subject] [varchar] (255) DEFAULT ('') NOT NULL ,
- [message_text] [text] DEFAULT ('') NOT NULL ,
- [message_edit_reason] [varchar] (255) DEFAULT ('') NOT NULL ,
- [message_edit_user] [int] DEFAULT (0) NOT NULL ,
- [message_attachment] [int] DEFAULT (0) NOT NULL ,
- [bbcode_bitfield] [varchar] (255) DEFAULT ('') NOT NULL ,
- [bbcode_uid] [varchar] (8) DEFAULT ('') NOT NULL ,
- [message_edit_time] [int] DEFAULT (0) NOT NULL ,
- [message_edit_count] [int] DEFAULT (0) NOT NULL ,
- [to_address] [varchar] (4000) DEFAULT ('') NOT NULL ,
- [bcc_address] [varchar] (4000) DEFAULT ('') NOT NULL ,
- [message_reported] [int] DEFAULT (0) NOT NULL
-)GO
-
-ALTER TABLE [phpbb_privmsgs] WITH NOCHECK ADD
- CONSTRAINT [PK_phpbb_privmsgs] PRIMARY KEY CLUSTERED
- (
- [msg_id]
- )
-GO
-
-CREATE INDEX [author_ip] ON [phpbb_privmsgs]([author_ip])
-GO
-
-CREATE INDEX [message_time] ON [phpbb_privmsgs]([message_time])
-GO
-
-CREATE INDEX [author_id] ON [phpbb_privmsgs]([author_id])
-GO
-
-CREATE INDEX [root_level] ON [phpbb_privmsgs]([root_level])
-GO
-
-
-/*
- Table: 'phpbb_privmsgs_folder'
-*/
-CREATE TABLE [phpbb_privmsgs_folder] (
- [folder_id] [int] IDENTITY (1, 1) NOT NULL ,
- [user_id] [int] DEFAULT (0) NOT NULL ,
- [folder_name] [varchar] (255) DEFAULT ('') NOT NULL ,
- [pm_count] [int] DEFAULT (0) NOT NULL
-)GO
-
-ALTER TABLE [phpbb_privmsgs_folder] WITH NOCHECK ADD
- CONSTRAINT [PK_phpbb_privmsgs_folder] PRIMARY KEY CLUSTERED
- (
- [folder_id]
- )
-GO
-
-CREATE INDEX [user_id] ON [phpbb_privmsgs_folder]([user_id])
-GO
-
-
-/*
- Table: 'phpbb_privmsgs_rules'
-*/
-CREATE TABLE [phpbb_privmsgs_rules] (
- [rule_id] [int] IDENTITY (1, 1) NOT NULL ,
- [user_id] [int] DEFAULT (0) NOT NULL ,
- [rule_check] [int] DEFAULT (0) NOT NULL ,
- [rule_connection] [int] DEFAULT (0) NOT NULL ,
- [rule_string] [varchar] (255) DEFAULT ('') NOT NULL ,
- [rule_user_id] [int] DEFAULT (0) NOT NULL ,
- [rule_group_id] [int] DEFAULT (0) NOT NULL ,
- [rule_action] [int] DEFAULT (0) NOT NULL ,
- [rule_folder_id] [int] DEFAULT (0) NOT NULL
-)GO
-
-ALTER TABLE [phpbb_privmsgs_rules] WITH NOCHECK ADD
- CONSTRAINT [PK_phpbb_privmsgs_rules] PRIMARY KEY CLUSTERED
- (
- [rule_id]
- )
-GO
-
-CREATE INDEX [user_id] ON [phpbb_privmsgs_rules]([user_id])
-GO
-
-
-/*
- Table: 'phpbb_privmsgs_to'
-*/
-CREATE TABLE [phpbb_privmsgs_to] (
- [msg_id] [int] DEFAULT (0) NOT NULL ,
- [user_id] [int] DEFAULT (0) NOT NULL ,
- [author_id] [int] DEFAULT (0) NOT NULL ,
- [pm_deleted] [int] DEFAULT (0) NOT NULL ,
- [pm_new] [int] DEFAULT (1) NOT NULL ,
- [pm_unread] [int] DEFAULT (1) NOT NULL ,
- [pm_replied] [int] DEFAULT (0) NOT NULL ,
- [pm_marked] [int] DEFAULT (0) NOT NULL ,
- [pm_forwarded] [int] DEFAULT (0) NOT NULL ,
- [folder_id] [int] DEFAULT (0) NOT NULL ,
- [mssqlindex] [int] IDENTITY (1, 1) NOT NULL
-)GO
-
-ALTER TABLE [phpbb_privmsgs_to] WITH NOCHECK ADD
- CONSTRAINT [PK_phpbb_privmsgs_to] PRIMARY KEY CLUSTERED
- (
- [mssqlindex]
- )
-GO
-
-CREATE INDEX [msg_id] ON [phpbb_privmsgs_to]([msg_id])
-GO
-
-CREATE INDEX [author_id] ON [phpbb_privmsgs_to]([author_id])
-GO
-
-CREATE INDEX [usr_flder_id] ON [phpbb_privmsgs_to]([user_id], [folder_id])
-GO
-
-
-/*
- Table: 'phpbb_profile_fields'
-*/
-CREATE TABLE [phpbb_profile_fields] (
- [field_id] [int] IDENTITY (1, 1) NOT NULL ,
- [field_name] [varchar] (255) DEFAULT ('') NOT NULL ,
- [field_type] [int] DEFAULT (0) NOT NULL ,
- [field_ident] [varchar] (20) DEFAULT ('') NOT NULL ,
- [field_length] [varchar] (20) DEFAULT ('') NOT NULL ,
- [field_minlen] [varchar] (255) DEFAULT ('') NOT NULL ,
- [field_maxlen] [varchar] (255) DEFAULT ('') NOT NULL ,
- [field_novalue] [varchar] (255) DEFAULT ('') NOT NULL ,
- [field_default_value] [varchar] (255) DEFAULT ('') NOT NULL ,
- [field_validation] [varchar] (20) DEFAULT ('') NOT NULL ,
- [field_required] [int] DEFAULT (0) NOT NULL ,
- [field_show_novalue] [int] DEFAULT (0) NOT NULL ,
- [field_show_on_reg] [int] DEFAULT (0) NOT NULL ,
- [field_show_on_vt] [int] DEFAULT (0) NOT NULL ,
- [field_show_profile] [int] DEFAULT (0) NOT NULL ,
- [field_hide] [int] DEFAULT (0) NOT NULL ,
- [field_no_view] [int] DEFAULT (0) NOT NULL ,
- [field_active] [int] DEFAULT (0) NOT NULL ,
- [field_order] [int] DEFAULT (0) NOT NULL
-)GO
-
-ALTER TABLE [phpbb_profile_fields] WITH NOCHECK ADD
- CONSTRAINT [PK_phpbb_profile_fields] PRIMARY KEY CLUSTERED
- (
- [field_id]
- )
-GO
-
-CREATE INDEX [fld_type] ON [phpbb_profile_fields]([field_type])
-GO
-
-CREATE INDEX [fld_ordr] ON [phpbb_profile_fields]([field_order])
-GO
-
-
-/*
- Table: 'phpbb_profile_fields_data'
-*/
-CREATE TABLE [phpbb_profile_fields_data] (
- [user_id] [int] DEFAULT (0) NOT NULL
-)GO
-
-ALTER TABLE [phpbb_profile_fields_data] WITH NOCHECK ADD
- CONSTRAINT [PK_phpbb_profile_fields_data] PRIMARY KEY CLUSTERED
- (
- [user_id]
- )
-GO
-
-
-/*
- Table: 'phpbb_profile_fields_lang'
-*/
-CREATE TABLE [phpbb_profile_fields_lang] (
- [field_id] [int] DEFAULT (0) NOT NULL ,
- [lang_id] [int] DEFAULT (0) NOT NULL ,
- [option_id] [int] DEFAULT (0) NOT NULL ,
- [field_type] [int] DEFAULT (0) NOT NULL ,
- [lang_value] [varchar] (255) DEFAULT ('') NOT NULL
-)GO
-
-ALTER TABLE [phpbb_profile_fields_lang] WITH NOCHECK ADD
- CONSTRAINT [PK_phpbb_profile_fields_lang] PRIMARY KEY CLUSTERED
- (
- [field_id],
- [lang_id],
- [option_id]
- )
-GO
-
-
-/*
- Table: 'phpbb_profile_lang'
-*/
-CREATE TABLE [phpbb_profile_lang] (
- [field_id] [int] DEFAULT (0) NOT NULL ,
- [lang_id] [int] DEFAULT (0) NOT NULL ,
- [lang_name] [varchar] (255) DEFAULT ('') NOT NULL ,
- [lang_explain] [varchar] (4000) DEFAULT ('') NOT NULL ,
- [lang_default_value] [varchar] (255) DEFAULT ('') NOT NULL
-)GO
-
-ALTER TABLE [phpbb_profile_lang] WITH NOCHECK ADD
- CONSTRAINT [PK_phpbb_profile_lang] PRIMARY KEY CLUSTERED
- (
- [field_id],
- [lang_id]
- )
-GO
-
-
-/*
- Table: 'phpbb_ranks'
-*/
-CREATE TABLE [phpbb_ranks] (
- [rank_id] [int] IDENTITY (1, 1) NOT NULL ,
- [rank_title] [varchar] (255) DEFAULT ('') NOT NULL ,
- [rank_min] [int] DEFAULT (0) NOT NULL ,
- [rank_special] [int] DEFAULT (0) NOT NULL ,
- [rank_image] [varchar] (255) DEFAULT ('') NOT NULL
-)GO
-
-ALTER TABLE [phpbb_ranks] WITH NOCHECK ADD
- CONSTRAINT [PK_phpbb_ranks] PRIMARY KEY CLUSTERED
- (
- [rank_id]
- )
-GO
-
-
-/*
- Table: 'phpbb_reports'
-*/
-CREATE TABLE [phpbb_reports] (
- [report_id] [int] IDENTITY (1, 1) NOT NULL ,
- [reason_id] [int] DEFAULT (0) NOT NULL ,
- [post_id] [int] DEFAULT (0) NOT NULL ,
- [pm_id] [int] DEFAULT (0) NOT NULL ,
- [user_id] [int] DEFAULT (0) NOT NULL ,
- [user_notify] [int] DEFAULT (0) NOT NULL ,
- [report_closed] [int] DEFAULT (0) NOT NULL ,
- [report_time] [int] DEFAULT (0) NOT NULL ,
- [report_text] [text] DEFAULT ('') NOT NULL
-)GO
-
-ALTER TABLE [phpbb_reports] WITH NOCHECK ADD
- CONSTRAINT [PK_phpbb_reports] PRIMARY KEY CLUSTERED
- (
- [report_id]
- )
-GO
-
-CREATE INDEX [post_id] ON [phpbb_reports]([post_id])
-GO
-
-CREATE INDEX [pm_id] ON [phpbb_reports]([pm_id])
-GO
-
-
-/*
- Table: 'phpbb_reports_reasons'
-*/
-CREATE TABLE [phpbb_reports_reasons] (
- [reason_id] [int] IDENTITY (1, 1) NOT NULL ,
- [reason_title] [varchar] (255) DEFAULT ('') NOT NULL ,
- [reason_description] [text] DEFAULT ('') NOT NULL ,
- [reason_order] [int] DEFAULT (0) NOT NULL
-)GO
-
-ALTER TABLE [phpbb_reports_reasons] WITH NOCHECK ADD
- CONSTRAINT [PK_phpbb_reports_reasons] PRIMARY KEY CLUSTERED
- (
- [reason_id]
- )
-GO
-
-
-/*
- Table: 'phpbb_search_results'
-*/
-CREATE TABLE [phpbb_search_results] (
- [search_key] [varchar] (32) DEFAULT ('') NOT NULL ,
- [search_time] [int] DEFAULT (0) NOT NULL ,
- [search_keywords] [text] DEFAULT ('') NOT NULL ,
- [search_authors] [text] DEFAULT ('') NOT NULL
-)GO
-
-ALTER TABLE [phpbb_search_results] WITH NOCHECK ADD
- CONSTRAINT [PK_phpbb_search_results] PRIMARY KEY CLUSTERED
- (
- [search_key]
- )
-GO
-
-
-/*
- Table: 'phpbb_search_wordlist'
-*/
-CREATE TABLE [phpbb_search_wordlist] (
- [word_id] [int] IDENTITY (1, 1) NOT NULL ,
- [word_text] [varchar] (255) DEFAULT ('') NOT NULL ,
- [word_common] [int] DEFAULT (0) NOT NULL ,
- [word_count] [int] DEFAULT (0) NOT NULL
-)GO
-
-ALTER TABLE [phpbb_search_wordlist] WITH NOCHECK ADD
- CONSTRAINT [PK_phpbb_search_wordlist] PRIMARY KEY CLUSTERED
- (
- [word_id]
- )
-GO
-
-CREATE UNIQUE INDEX [wrd_txt] ON [phpbb_search_wordlist]([word_text])
-GO
-
-CREATE INDEX [wrd_cnt] ON [phpbb_search_wordlist]([word_count])
-GO
-
-
-/*
- Table: 'phpbb_search_wordmatch'
-*/
-CREATE TABLE [phpbb_search_wordmatch] (
- [post_id] [int] DEFAULT (0) NOT NULL ,
- [word_id] [int] DEFAULT (0) NOT NULL ,
- [title_match] [int] DEFAULT (0) NOT NULL ,
- [mssqlindex] [int] IDENTITY (1, 1) NOT NULL
-)GO
-
-ALTER TABLE [phpbb_search_wordmatch] WITH NOCHECK ADD
- CONSTRAINT [PK_phpbb_search_wordmatch] PRIMARY KEY CLUSTERED
- (
- [mssqlindex]
- )
-GO
-
-CREATE UNIQUE INDEX [unq_mtch] ON [phpbb_search_wordmatch]([word_id], [post_id], [title_match])
-GO
-
-CREATE INDEX [word_id] ON [phpbb_search_wordmatch]([word_id])
-GO
-
-CREATE INDEX [post_id] ON [phpbb_search_wordmatch]([post_id])
-GO
-
-
-/*
- Table: 'phpbb_sessions'
-*/
-CREATE TABLE [phpbb_sessions] (
- [session_id] [char] (32) DEFAULT ('') NOT NULL ,
- [session_user_id] [int] DEFAULT (0) NOT NULL ,
- [session_forum_id] [int] DEFAULT (0) NOT NULL ,
- [session_last_visit] [int] DEFAULT (0) NOT NULL ,
- [session_start] [int] DEFAULT (0) NOT NULL ,
- [session_time] [int] DEFAULT (0) NOT NULL ,
- [session_ip] [varchar] (40) DEFAULT ('') NOT NULL ,
- [session_browser] [varchar] (150) DEFAULT ('') NOT NULL ,
- [session_forwarded_for] [varchar] (255) DEFAULT ('') NOT NULL ,
- [session_page] [varchar] (255) DEFAULT ('') NOT NULL ,
- [session_viewonline] [int] DEFAULT (1) NOT NULL ,
- [session_autologin] [int] DEFAULT (0) NOT NULL ,
- [session_admin] [int] DEFAULT (0) NOT NULL
-)GO
-
-ALTER TABLE [phpbb_sessions] WITH NOCHECK ADD
- CONSTRAINT [PK_phpbb_sessions] PRIMARY KEY CLUSTERED
- (
- [session_id]
- )
-GO
-
-CREATE INDEX [session_time] ON [phpbb_sessions]([session_time])
-GO
-
-CREATE INDEX [session_user_id] ON [phpbb_sessions]([session_user_id])
-GO
-
-CREATE INDEX [session_fid] ON [phpbb_sessions]([session_forum_id])
-GO
-
-
-/*
- Table: 'phpbb_sessions_keys'
-*/
-CREATE TABLE [phpbb_sessions_keys] (
- [key_id] [char] (32) DEFAULT ('') NOT NULL ,
- [user_id] [int] DEFAULT (0) NOT NULL ,
- [last_ip] [varchar] (40) DEFAULT ('') NOT NULL ,
- [last_login] [int] DEFAULT (0) NOT NULL
-)GO
-
-ALTER TABLE [phpbb_sessions_keys] WITH NOCHECK ADD
- CONSTRAINT [PK_phpbb_sessions_keys] PRIMARY KEY CLUSTERED
- (
- [key_id],
- [user_id]
- )
-GO
-
-CREATE INDEX [last_login] ON [phpbb_sessions_keys]([last_login])
-GO
-
-
-/*
- Table: 'phpbb_sitelist'
-*/
-CREATE TABLE [phpbb_sitelist] (
- [site_id] [int] IDENTITY (1, 1) NOT NULL ,
- [site_ip] [varchar] (40) DEFAULT ('') NOT NULL ,
- [site_hostname] [varchar] (255) DEFAULT ('') NOT NULL ,
- [ip_exclude] [int] DEFAULT (0) NOT NULL
-)GO
-
-ALTER TABLE [phpbb_sitelist] WITH NOCHECK ADD
- CONSTRAINT [PK_phpbb_sitelist] PRIMARY KEY CLUSTERED
- (
- [site_id]
- )
-GO
-
-
-/*
- Table: 'phpbb_smilies'
-*/
-CREATE TABLE [phpbb_smilies] (
- [smiley_id] [int] IDENTITY (1, 1) NOT NULL ,
- [code] [varchar] (50) DEFAULT ('') NOT NULL ,
- [emotion] [varchar] (50) DEFAULT ('') NOT NULL ,
- [smiley_url] [varchar] (50) DEFAULT ('') NOT NULL ,
- [smiley_width] [int] DEFAULT (0) NOT NULL ,
- [smiley_height] [int] DEFAULT (0) NOT NULL ,
- [smiley_order] [int] DEFAULT (0) NOT NULL ,
- [display_on_posting] [int] DEFAULT (1) NOT NULL
-)GO
-
-ALTER TABLE [phpbb_smilies] WITH NOCHECK ADD
- CONSTRAINT [PK_phpbb_smilies] PRIMARY KEY CLUSTERED
- (
- [smiley_id]
- )
-GO
-
-CREATE INDEX [display_on_post] ON [phpbb_smilies]([display_on_posting])
-GO
-
-
-/*
- Table: 'phpbb_styles'
-*/
-CREATE TABLE [phpbb_styles] (
- [style_id] [int] IDENTITY (1, 1) NOT NULL ,
- [style_name] [varchar] (255) DEFAULT ('') NOT NULL ,
- [style_copyright] [varchar] (255) DEFAULT ('') NOT NULL ,
- [style_active] [int] DEFAULT (1) NOT NULL ,
- [template_id] [int] DEFAULT (0) NOT NULL ,
- [theme_id] [int] DEFAULT (0) NOT NULL ,
- [imageset_id] [int] DEFAULT (0) NOT NULL
-)GO
-
-ALTER TABLE [phpbb_styles] WITH NOCHECK ADD
- CONSTRAINT [PK_phpbb_styles] PRIMARY KEY CLUSTERED
- (
- [style_id]
- )
-GO
-
-CREATE UNIQUE INDEX [style_name] ON [phpbb_styles]([style_name])
-GO
-
-CREATE INDEX [template_id] ON [phpbb_styles]([template_id])
-GO
-
-CREATE INDEX [theme_id] ON [phpbb_styles]([theme_id])
-GO
-
-CREATE INDEX [imageset_id] ON [phpbb_styles]([imageset_id])
-GO
-
-
-/*
- Table: 'phpbb_styles_template'
-*/
-CREATE TABLE [phpbb_styles_template] (
- [template_id] [int] IDENTITY (1, 1) NOT NULL ,
- [template_name] [varchar] (255) DEFAULT ('') NOT NULL ,
- [template_copyright] [varchar] (255) DEFAULT ('') NOT NULL ,
- [template_path] [varchar] (100) DEFAULT ('') NOT NULL ,
- [bbcode_bitfield] [varchar] (255) DEFAULT ('kNg=') NOT NULL ,
- [template_storedb] [int] DEFAULT (0) NOT NULL ,
- [template_inherits_id] [int] DEFAULT (0) NOT NULL ,
- [template_inherit_path] [varchar] (255) DEFAULT ('') NOT NULL
-)GO
-
-ALTER TABLE [phpbb_styles_template] WITH NOCHECK ADD
- CONSTRAINT [PK_phpbb_styles_template] PRIMARY KEY CLUSTERED
- (
- [template_id]
- )
-GO
-
-CREATE UNIQUE INDEX [tmplte_nm] ON [phpbb_styles_template]([template_name])
-GO
-
-
-/*
- Table: 'phpbb_styles_template_data'
-*/
-CREATE TABLE [phpbb_styles_template_data] (
- [template_id] [int] DEFAULT (0) NOT NULL ,
- [template_filename] [varchar] (100) DEFAULT ('') NOT NULL ,
- [template_included] [varchar] (8000) DEFAULT ('') NOT NULL ,
- [template_mtime] [int] DEFAULT (0) NOT NULL ,
- [template_data] [text] DEFAULT ('') NOT NULL ,
- [mssqlindex] [int] IDENTITY (1, 1) NOT NULL
-)GO
-
-ALTER TABLE [phpbb_styles_template_data] WITH NOCHECK ADD
- CONSTRAINT [PK_phpbb_styles_template_data] PRIMARY KEY CLUSTERED
- (
- [mssqlindex]
- )
-GO
-
-CREATE INDEX [tid] ON [phpbb_styles_template_data]([template_id])
-GO
-
-CREATE INDEX [tfn] ON [phpbb_styles_template_data]([template_filename])
-GO
-
-
-/*
- Table: 'phpbb_styles_theme'
-*/
-CREATE TABLE [phpbb_styles_theme] (
- [theme_id] [int] IDENTITY (1, 1) NOT NULL ,
- [theme_name] [varchar] (255) DEFAULT ('') NOT NULL ,
- [theme_copyright] [varchar] (255) DEFAULT ('') NOT NULL ,
- [theme_path] [varchar] (100) DEFAULT ('') NOT NULL ,
- [theme_storedb] [int] DEFAULT (0) NOT NULL ,
- [theme_mtime] [int] DEFAULT (0) NOT NULL ,
- [theme_data] [text] DEFAULT ('') NOT NULL
-)GO
-
-ALTER TABLE [phpbb_styles_theme] WITH NOCHECK ADD
- CONSTRAINT [PK_phpbb_styles_theme] PRIMARY KEY CLUSTERED
- (
- [theme_id]
- )
-GO
-
-CREATE UNIQUE INDEX [theme_name] ON [phpbb_styles_theme]([theme_name])
-GO
-
-
-/*
- Table: 'phpbb_styles_imageset'
-*/
-CREATE TABLE [phpbb_styles_imageset] (
- [imageset_id] [int] IDENTITY (1, 1) NOT NULL ,
- [imageset_name] [varchar] (255) DEFAULT ('') NOT NULL ,
- [imageset_copyright] [varchar] (255) DEFAULT ('') NOT NULL ,
- [imageset_path] [varchar] (100) DEFAULT ('') NOT NULL
-)GO
-
-ALTER TABLE [phpbb_styles_imageset] WITH NOCHECK ADD
- CONSTRAINT [PK_phpbb_styles_imageset] PRIMARY KEY CLUSTERED
- (
- [imageset_id]
- )
-GO
-
-CREATE UNIQUE INDEX [imgset_nm] ON [phpbb_styles_imageset]([imageset_name])
-GO
-
-
-/*
- Table: 'phpbb_styles_imageset_data'
-*/
-CREATE TABLE [phpbb_styles_imageset_data] (
- [image_id] [int] IDENTITY (1, 1) NOT NULL ,
- [image_name] [varchar] (200) DEFAULT ('') NOT NULL ,
- [image_filename] [varchar] (200) DEFAULT ('') NOT NULL ,
- [image_lang] [varchar] (30) DEFAULT ('') NOT NULL ,
- [image_height] [int] DEFAULT (0) NOT NULL ,
- [image_width] [int] DEFAULT (0) NOT NULL ,
- [imageset_id] [int] DEFAULT (0) NOT NULL
-)GO
-
-ALTER TABLE [phpbb_styles_imageset_data] WITH NOCHECK ADD
- CONSTRAINT [PK_phpbb_styles_imageset_data] PRIMARY KEY CLUSTERED
- (
- [image_id]
- )
-GO
-
-CREATE INDEX [i_d] ON [phpbb_styles_imageset_data]([imageset_id])
-GO
-
-
-/*
- Table: 'phpbb_topics'
-*/
-CREATE TABLE [phpbb_topics] (
- [topic_id] [int] IDENTITY (1, 1) NOT NULL ,
- [forum_id] [int] DEFAULT (0) NOT NULL ,
- [icon_id] [int] DEFAULT (0) NOT NULL ,
- [topic_attachment] [int] DEFAULT (0) NOT NULL ,
- [topic_approved] [int] DEFAULT (1) NOT NULL ,
- [topic_reported] [int] DEFAULT (0) NOT NULL ,
- [topic_title] [varchar] (255) DEFAULT ('') NOT NULL ,
- [topic_poster] [int] DEFAULT (0) NOT NULL ,
- [topic_time] [int] DEFAULT (0) NOT NULL ,
- [topic_time_limit] [int] DEFAULT (0) NOT NULL ,
- [topic_views] [int] DEFAULT (0) NOT NULL ,
- [topic_replies] [int] DEFAULT (0) NOT NULL ,
- [topic_replies_real] [int] DEFAULT (0) NOT NULL ,
- [topic_status] [int] DEFAULT (0) NOT NULL ,
- [topic_type] [int] DEFAULT (0) NOT NULL ,
- [topic_first_post_id] [int] DEFAULT (0) NOT NULL ,
- [topic_first_poster_name] [varchar] (255) DEFAULT ('') NOT NULL ,
- [topic_first_poster_colour] [varchar] (6) DEFAULT ('') NOT NULL ,
- [topic_last_post_id] [int] DEFAULT (0) NOT NULL ,
- [topic_last_poster_id] [int] DEFAULT (0) NOT NULL ,
- [topic_last_poster_name] [varchar] (255) DEFAULT ('') NOT NULL ,
- [topic_last_poster_colour] [varchar] (6) DEFAULT ('') NOT NULL ,
- [topic_last_post_subject] [varchar] (255) DEFAULT ('') NOT NULL ,
- [topic_last_post_time] [int] DEFAULT (0) NOT NULL ,
- [topic_last_view_time] [int] DEFAULT (0) NOT NULL ,
- [topic_moved_id] [int] DEFAULT (0) NOT NULL ,
- [topic_bumped] [int] DEFAULT (0) NOT NULL ,
- [topic_bumper] [int] DEFAULT (0) NOT NULL ,
- [poll_title] [varchar] (255) DEFAULT ('') NOT NULL ,
- [poll_start] [int] DEFAULT (0) NOT NULL ,
- [poll_length] [int] DEFAULT (0) NOT NULL ,
- [poll_max_options] [int] DEFAULT (1) NOT NULL ,
- [poll_last_vote] [int] DEFAULT (0) NOT NULL ,
- [poll_vote_change] [int] DEFAULT (0) NOT NULL
-)GO
-
-ALTER TABLE [phpbb_topics] WITH NOCHECK ADD
- CONSTRAINT [PK_phpbb_topics] PRIMARY KEY CLUSTERED
- (
- [topic_id]
- )
-GO
-
-CREATE INDEX [forum_id] ON [phpbb_topics]([forum_id])
-GO
-
-CREATE INDEX [forum_id_type] ON [phpbb_topics]([forum_id], [topic_type])
-GO
-
-CREATE INDEX [last_post_time] ON [phpbb_topics]([topic_last_post_time])
-GO
-
-CREATE INDEX [topic_approved] ON [phpbb_topics]([topic_approved])
-GO
-
-CREATE INDEX [forum_appr_last] ON [phpbb_topics]([forum_id], [topic_approved], [topic_last_post_id])
-GO
-
-CREATE INDEX [fid_time_moved] ON [phpbb_topics]([forum_id], [topic_last_post_time], [topic_moved_id])
-GO
-
-
-/*
- Table: 'phpbb_topics_track'
-*/
-CREATE TABLE [phpbb_topics_track] (
- [user_id] [int] DEFAULT (0) NOT NULL ,
- [topic_id] [int] DEFAULT (0) NOT NULL ,
- [forum_id] [int] DEFAULT (0) NOT NULL ,
- [mark_time] [int] DEFAULT (0) NOT NULL
-)GO
-
-ALTER TABLE [phpbb_topics_track] WITH NOCHECK ADD
- CONSTRAINT [PK_phpbb_topics_track] PRIMARY KEY CLUSTERED
- (
- [user_id],
- [topic_id]
- )
-GO
-
-CREATE INDEX [topic_id] ON [phpbb_topics_track]([topic_id])
-GO
-
-CREATE INDEX [forum_id] ON [phpbb_topics_track]([forum_id])
-GO
-
-
-/*
- Table: 'phpbb_topics_posted'
-*/
-CREATE TABLE [phpbb_topics_posted] (
- [user_id] [int] DEFAULT (0) NOT NULL ,
- [topic_id] [int] DEFAULT (0) NOT NULL ,
- [topic_posted] [int] DEFAULT (0) NOT NULL
-)GO
-
-ALTER TABLE [phpbb_topics_posted] WITH NOCHECK ADD
- CONSTRAINT [PK_phpbb_topics_posted] PRIMARY KEY CLUSTERED
- (
- [user_id],
- [topic_id]
- )
-GO
-
-
-/*
- Table: 'phpbb_topics_watch'
-*/
-CREATE TABLE [phpbb_topics_watch] (
- [topic_id] [int] DEFAULT (0) NOT NULL ,
- [user_id] [int] DEFAULT (0) NOT NULL ,
- [notify_status] [int] DEFAULT (0) NOT NULL ,
- [mssqlindex] [int] IDENTITY (1, 1) NOT NULL
-)GO
-
-ALTER TABLE [phpbb_topics_watch] WITH NOCHECK ADD
- CONSTRAINT [PK_phpbb_topics_watch] PRIMARY KEY CLUSTERED
- (
- [mssqlindex]
- )
-GO
-
-CREATE INDEX [topic_id] ON [phpbb_topics_watch]([topic_id])
-GO
-
-CREATE INDEX [user_id] ON [phpbb_topics_watch]([user_id])
-GO
-
-CREATE INDEX [notify_stat] ON [phpbb_topics_watch]([notify_status])
-GO
-
-
-/*
- Table: 'phpbb_user_group'
-*/
-CREATE TABLE [phpbb_user_group] (
- [group_id] [int] DEFAULT (0) NOT NULL ,
- [user_id] [int] DEFAULT (0) NOT NULL ,
- [group_leader] [int] DEFAULT (0) NOT NULL ,
- [user_pending] [int] DEFAULT (1) NOT NULL ,
- [mssqlindex] [int] IDENTITY (1, 1) NOT NULL
-)GO
-
-ALTER TABLE [phpbb_user_group] WITH NOCHECK ADD
- CONSTRAINT [PK_phpbb_user_group] PRIMARY KEY CLUSTERED
- (
- [mssqlindex]
- )
-GO
-
-CREATE INDEX [group_id] ON [phpbb_user_group]([group_id])
-GO
-
-CREATE INDEX [user_id] ON [phpbb_user_group]([user_id])
-GO
-
-CREATE INDEX [group_leader] ON [phpbb_user_group]([group_leader])
-GO
-
-
-/*
- Table: 'phpbb_users'
-*/
-CREATE TABLE [phpbb_users] (
- [user_id] [int] IDENTITY (1, 1) NOT NULL ,
- [user_type] [int] DEFAULT (0) NOT NULL ,
- [group_id] [int] DEFAULT (3) NOT NULL ,
- [user_permissions] [text] DEFAULT ('') NOT NULL ,
- [user_perm_from] [int] DEFAULT (0) NOT NULL ,
- [user_ip] [varchar] (40) DEFAULT ('') NOT NULL ,
- [user_regdate] [int] DEFAULT (0) NOT NULL ,
- [username] [varchar] (255) DEFAULT ('') NOT NULL ,
- [username_clean] [varchar] (255) DEFAULT ('') NOT NULL ,
- [user_password] [varchar] (40) DEFAULT ('') NOT NULL ,
- [user_passchg] [int] DEFAULT (0) NOT NULL ,
- [user_pass_convert] [int] DEFAULT (0) NOT NULL ,
- [user_email] [varchar] (100) DEFAULT ('') NOT NULL ,
- [user_email_hash] [float] DEFAULT (0) NOT NULL ,
- [user_birthday] [varchar] (10) DEFAULT ('') NOT NULL ,
- [user_lastvisit] [int] DEFAULT (0) NOT NULL ,
- [user_lastmark] [int] DEFAULT (0) NOT NULL ,
- [user_lastpost_time] [int] DEFAULT (0) NOT NULL ,
- [user_lastpage] [varchar] (200) DEFAULT ('') NOT NULL ,
- [user_last_confirm_key] [varchar] (10) DEFAULT ('') NOT NULL ,
- [user_last_search] [int] DEFAULT (0) NOT NULL ,
- [user_warnings] [int] DEFAULT (0) NOT NULL ,
- [user_last_warning] [int] DEFAULT (0) NOT NULL ,
- [user_login_attempts] [int] DEFAULT (0) NOT NULL ,
- [user_inactive_reason] [int] DEFAULT (0) NOT NULL ,
- [user_inactive_time] [int] DEFAULT (0) NOT NULL ,
- [user_posts] [int] DEFAULT (0) NOT NULL ,
- [user_lang] [varchar] (30) DEFAULT ('') NOT NULL ,
- [user_timezone] [float] DEFAULT (0) NOT NULL ,
- [user_dst] [int] DEFAULT (0) NOT NULL ,
- [user_dateformat] [varchar] (30) DEFAULT ('d M Y H:i') NOT NULL ,
- [user_style] [int] DEFAULT (0) NOT NULL ,
- [user_rank] [int] DEFAULT (0) NOT NULL ,
- [user_colour] [varchar] (6) DEFAULT ('') NOT NULL ,
- [user_new_privmsg] [int] DEFAULT (0) NOT NULL ,
- [user_unread_privmsg] [int] DEFAULT (0) NOT NULL ,
- [user_last_privmsg] [int] DEFAULT (0) NOT NULL ,
- [user_message_rules] [int] DEFAULT (0) NOT NULL ,
- [user_full_folder] [int] DEFAULT (-3) NOT NULL ,
- [user_emailtime] [int] DEFAULT (0) NOT NULL ,
- [user_topic_show_days] [int] DEFAULT (0) NOT NULL ,
- [user_topic_sortby_type] [varchar] (1) DEFAULT ('t') NOT NULL ,
- [user_topic_sortby_dir] [varchar] (1) DEFAULT ('d') NOT NULL ,
- [user_post_show_days] [int] DEFAULT (0) NOT NULL ,
- [user_post_sortby_type] [varchar] (1) DEFAULT ('t') NOT NULL ,
- [user_post_sortby_dir] [varchar] (1) DEFAULT ('a') NOT NULL ,
- [user_notify] [int] DEFAULT (0) NOT NULL ,
- [user_notify_pm] [int] DEFAULT (1) NOT NULL ,
- [user_notify_type] [int] DEFAULT (0) NOT NULL ,
- [user_allow_pm] [int] DEFAULT (1) NOT NULL ,
- [user_allow_viewonline] [int] DEFAULT (1) NOT NULL ,
- [user_allow_viewemail] [int] DEFAULT (1) NOT NULL ,
- [user_allow_massemail] [int] DEFAULT (1) NOT NULL ,
- [user_options] [int] DEFAULT (230271) NOT NULL ,
- [user_avatar] [varchar] (255) DEFAULT ('') NOT NULL ,
- [user_avatar_type] [int] DEFAULT (0) NOT NULL ,
- [user_avatar_width] [int] DEFAULT (0) NOT NULL ,
- [user_avatar_height] [int] DEFAULT (0) NOT NULL ,
- [user_sig] [text] DEFAULT ('') NOT NULL ,
- [user_sig_bbcode_uid] [varchar] (8) DEFAULT ('') NOT NULL ,
- [user_sig_bbcode_bitfield] [varchar] (255) DEFAULT ('') NOT NULL ,
- [user_from] [varchar] (100) DEFAULT ('') NOT NULL ,
- [user_icq] [varchar] (15) DEFAULT ('') NOT NULL ,
- [user_aim] [varchar] (255) DEFAULT ('') NOT NULL ,
- [user_yim] [varchar] (255) DEFAULT ('') NOT NULL ,
- [user_msnm] [varchar] (255) DEFAULT ('') NOT NULL ,
- [user_jabber] [varchar] (255) DEFAULT ('') NOT NULL ,
- [user_website] [varchar] (200) DEFAULT ('') NOT NULL ,
- [user_occ] [varchar] (4000) DEFAULT ('') NOT NULL ,
- [user_interests] [varchar] (4000) DEFAULT ('') NOT NULL ,
- [user_actkey] [varchar] (32) DEFAULT ('') NOT NULL ,
- [user_newpasswd] [varchar] (40) DEFAULT ('') NOT NULL ,
- [user_form_salt] [varchar] (32) DEFAULT ('') NOT NULL ,
- [user_new] [int] DEFAULT (1) NOT NULL ,
- [user_reminded] [int] DEFAULT (0) NOT NULL ,
- [user_reminded_time] [int] DEFAULT (0) NOT NULL
-)GO
-
-ALTER TABLE [phpbb_users] WITH NOCHECK ADD
- CONSTRAINT [PK_phpbb_users] PRIMARY KEY CLUSTERED
- (
- [user_id]
- )
-GO
-
-CREATE INDEX [user_birthday] ON [phpbb_users]([user_birthday])
-GO
-
-CREATE INDEX [user_email_hash] ON [phpbb_users]([user_email_hash])
-GO
-
-CREATE INDEX [user_type] ON [phpbb_users]([user_type])
-GO
-
-CREATE UNIQUE INDEX [username_clean] ON [phpbb_users]([username_clean])
-GO
-
-
-/*
- Table: 'phpbb_warnings'
-*/
-CREATE TABLE [phpbb_warnings] (
- [warning_id] [int] IDENTITY (1, 1) NOT NULL ,
- [user_id] [int] DEFAULT (0) NOT NULL ,
- [post_id] [int] DEFAULT (0) NOT NULL ,
- [log_id] [int] DEFAULT (0) NOT NULL ,
- [warning_time] [int] DEFAULT (0) NOT NULL
-)GO
-
-ALTER TABLE [phpbb_warnings] WITH NOCHECK ADD
- CONSTRAINT [PK_phpbb_warnings] PRIMARY KEY CLUSTERED
- (
- [warning_id]
- )
-GO
-
-
-/*
- Table: 'phpbb_words'
-*/
-CREATE TABLE [phpbb_words] (
- [word_id] [int] IDENTITY (1, 1) NOT NULL ,
- [word] [varchar] (255) DEFAULT ('') NOT NULL ,
- [replacement] [varchar] (255) DEFAULT ('') NOT NULL
-)GO
-
-ALTER TABLE [phpbb_words] WITH NOCHECK ADD
- CONSTRAINT [PK_phpbb_words] PRIMARY KEY CLUSTERED
- (
- [word_id]
- )
-GO
-
-
-/*
- Table: 'phpbb_zebra'
-*/
-CREATE TABLE [phpbb_zebra] (
- [user_id] [int] DEFAULT (0) NOT NULL ,
- [zebra_id] [int] DEFAULT (0) NOT NULL ,
- [friend] [int] DEFAULT (0) NOT NULL ,
- [foe] [int] DEFAULT (0) NOT NULL
-)GO
-
-ALTER TABLE [phpbb_zebra] WITH NOCHECK ADD
- CONSTRAINT [PK_phpbb_zebra] PRIMARY KEY CLUSTERED
- (
- [user_id],
- [zebra_id]
- )
-GO
-
-
diff --git a/phpBB/install/schemas/mysql_40_schema.sql b/phpBB/install/schemas/mysql_40_schema.sql
deleted file mode 100644
index 969cbe0472..0000000000
--- a/phpBB/install/schemas/mysql_40_schema.sql
+++ /dev/null
@@ -1,1034 +0,0 @@
-# DO NOT EDIT THIS FILE, IT IS GENERATED
-#
-# To change the contents of this file, edit
-# phpBB/develop/create_schema_files.php and
-# run it.
-# Table: 'phpbb_attachments'
-CREATE TABLE phpbb_attachments (
- attach_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- post_msg_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- topic_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- in_message tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- poster_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- is_orphan tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- physical_filename varbinary(255) DEFAULT '' NOT NULL,
- real_filename varbinary(255) DEFAULT '' NOT NULL,
- download_count mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- attach_comment blob NOT NULL,
- extension varbinary(100) DEFAULT '' NOT NULL,
- mimetype varbinary(100) DEFAULT '' NOT NULL,
- filesize int(20) UNSIGNED DEFAULT '0' NOT NULL,
- filetime int(11) UNSIGNED DEFAULT '0' NOT NULL,
- thumbnail tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- PRIMARY KEY (attach_id),
- KEY filetime (filetime),
- KEY post_msg_id (post_msg_id),
- KEY topic_id (topic_id),
- KEY poster_id (poster_id),
- KEY is_orphan (is_orphan)
-);
-
-
-# Table: 'phpbb_acl_groups'
-CREATE TABLE phpbb_acl_groups (
- group_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- forum_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- auth_option_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- auth_role_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- auth_setting tinyint(2) DEFAULT '0' NOT NULL,
- KEY group_id (group_id),
- KEY auth_opt_id (auth_option_id),
- KEY auth_role_id (auth_role_id)
-);
-
-
-# Table: 'phpbb_acl_options'
-CREATE TABLE phpbb_acl_options (
- auth_option_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- auth_option varbinary(50) DEFAULT '' NOT NULL,
- is_global tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- is_local tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- founder_only tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- PRIMARY KEY (auth_option_id),
- UNIQUE auth_option (auth_option)
-);
-
-
-# Table: 'phpbb_acl_roles'
-CREATE TABLE phpbb_acl_roles (
- role_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- role_name blob NOT NULL,
- role_description blob NOT NULL,
- role_type varbinary(10) DEFAULT '' NOT NULL,
- role_order smallint(4) UNSIGNED DEFAULT '0' NOT NULL,
- PRIMARY KEY (role_id),
- KEY role_type (role_type),
- KEY role_order (role_order)
-);
-
-
-# Table: 'phpbb_acl_roles_data'
-CREATE TABLE phpbb_acl_roles_data (
- role_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- auth_option_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- auth_setting tinyint(2) DEFAULT '0' NOT NULL,
- PRIMARY KEY (role_id, auth_option_id),
- KEY ath_op_id (auth_option_id)
-);
-
-
-# Table: 'phpbb_acl_users'
-CREATE TABLE phpbb_acl_users (
- user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- forum_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- auth_option_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- auth_role_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- auth_setting tinyint(2) DEFAULT '0' NOT NULL,
- KEY user_id (user_id),
- KEY auth_option_id (auth_option_id),
- KEY auth_role_id (auth_role_id)
-);
-
-
-# Table: 'phpbb_banlist'
-CREATE TABLE phpbb_banlist (
- ban_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- ban_userid mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- ban_ip varbinary(40) DEFAULT '' NOT NULL,
- ban_email blob NOT NULL,
- ban_start int(11) UNSIGNED DEFAULT '0' NOT NULL,
- ban_end int(11) UNSIGNED DEFAULT '0' NOT NULL,
- ban_exclude tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- ban_reason blob NOT NULL,
- ban_give_reason blob NOT NULL,
- PRIMARY KEY (ban_id),
- KEY ban_end (ban_end),
- KEY ban_user (ban_userid, ban_exclude),
- KEY ban_email (ban_email(255), ban_exclude),
- KEY ban_ip (ban_ip, ban_exclude)
-);
-
-
-# Table: 'phpbb_bbcodes'
-CREATE TABLE phpbb_bbcodes (
- bbcode_id smallint(4) UNSIGNED DEFAULT '0' NOT NULL,
- bbcode_tag varbinary(16) DEFAULT '' NOT NULL,
- bbcode_helpline blob NOT NULL,
- display_on_posting tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- bbcode_match blob NOT NULL,
- bbcode_tpl mediumblob NOT NULL,
- first_pass_match mediumblob NOT NULL,
- first_pass_replace mediumblob NOT NULL,
- second_pass_match mediumblob NOT NULL,
- second_pass_replace mediumblob NOT NULL,
- PRIMARY KEY (bbcode_id),
- KEY display_on_post (display_on_posting)
-);
-
-
-# Table: 'phpbb_bookmarks'
-CREATE TABLE phpbb_bookmarks (
- topic_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- PRIMARY KEY (topic_id, user_id)
-);
-
-
-# Table: 'phpbb_bots'
-CREATE TABLE phpbb_bots (
- bot_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- bot_active tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- bot_name blob NOT NULL,
- user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- bot_agent varbinary(255) DEFAULT '' NOT NULL,
- bot_ip varbinary(255) DEFAULT '' NOT NULL,
- PRIMARY KEY (bot_id),
- KEY bot_active (bot_active)
-);
-
-
-# Table: 'phpbb_config'
-CREATE TABLE phpbb_config (
- config_name varbinary(255) DEFAULT '' NOT NULL,
- config_value blob NOT NULL,
- is_dynamic tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- PRIMARY KEY (config_name),
- KEY is_dynamic (is_dynamic)
-);
-
-
-# Table: 'phpbb_confirm'
-CREATE TABLE phpbb_confirm (
- confirm_id binary(32) DEFAULT '' NOT NULL,
- session_id binary(32) DEFAULT '' NOT NULL,
- confirm_type tinyint(3) DEFAULT '0' NOT NULL,
- code varbinary(8) DEFAULT '' NOT NULL,
- seed int(10) UNSIGNED DEFAULT '0' NOT NULL,
- attempts mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- PRIMARY KEY (session_id, confirm_id),
- KEY confirm_type (confirm_type)
-);
-
-
-# Table: 'phpbb_disallow'
-CREATE TABLE phpbb_disallow (
- disallow_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- disallow_username blob NOT NULL,
- PRIMARY KEY (disallow_id)
-);
-
-
-# Table: 'phpbb_drafts'
-CREATE TABLE phpbb_drafts (
- draft_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- topic_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- forum_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- save_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
- draft_subject blob NOT NULL,
- draft_message mediumblob NOT NULL,
- PRIMARY KEY (draft_id),
- KEY save_time (save_time)
-);
-
-
-# Table: 'phpbb_extensions'
-CREATE TABLE phpbb_extensions (
- extension_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- group_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- extension varbinary(100) DEFAULT '' NOT NULL,
- PRIMARY KEY (extension_id)
-);
-
-
-# Table: 'phpbb_extension_groups'
-CREATE TABLE phpbb_extension_groups (
- group_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- group_name blob NOT NULL,
- cat_id tinyint(2) DEFAULT '0' NOT NULL,
- allow_group tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- download_mode tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- upload_icon varbinary(255) DEFAULT '' NOT NULL,
- max_filesize int(20) UNSIGNED DEFAULT '0' NOT NULL,
- allowed_forums blob NOT NULL,
- allow_in_pm tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- PRIMARY KEY (group_id)
-);
-
-
-# Table: 'phpbb_forums'
-CREATE TABLE phpbb_forums (
- forum_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- parent_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- left_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- right_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- forum_parents mediumblob NOT NULL,
- forum_name blob NOT NULL,
- forum_desc blob NOT NULL,
- forum_desc_bitfield varbinary(255) DEFAULT '' NOT NULL,
- forum_desc_options int(11) UNSIGNED DEFAULT '7' NOT NULL,
- forum_desc_uid varbinary(8) DEFAULT '' NOT NULL,
- forum_link blob NOT NULL,
- forum_password varbinary(120) DEFAULT '' NOT NULL,
- forum_style mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- forum_image varbinary(255) DEFAULT '' NOT NULL,
- forum_rules blob NOT NULL,
- forum_rules_link blob NOT NULL,
- forum_rules_bitfield varbinary(255) DEFAULT '' NOT NULL,
- forum_rules_options int(11) UNSIGNED DEFAULT '7' NOT NULL,
- forum_rules_uid varbinary(8) DEFAULT '' NOT NULL,
- forum_topics_per_page tinyint(4) DEFAULT '0' NOT NULL,
- forum_type tinyint(4) DEFAULT '0' NOT NULL,
- forum_status tinyint(4) DEFAULT '0' NOT NULL,
- forum_posts mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- forum_topics mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- forum_topics_real mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- forum_last_post_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- forum_last_poster_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- forum_last_post_subject blob NOT NULL,
- forum_last_post_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
- forum_last_poster_name blob NOT NULL,
- forum_last_poster_colour varbinary(6) DEFAULT '' NOT NULL,
- forum_flags tinyint(4) DEFAULT '32' NOT NULL,
- forum_options int(20) UNSIGNED DEFAULT '0' NOT NULL,
- display_subforum_list tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- display_on_index tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- enable_indexing tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- enable_icons tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- enable_prune tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- prune_next int(11) UNSIGNED DEFAULT '0' NOT NULL,
- prune_days mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- prune_viewed mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- prune_freq mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- PRIMARY KEY (forum_id),
- KEY left_right_id (left_id, right_id),
- KEY forum_lastpost_id (forum_last_post_id)
-);
-
-
-# Table: 'phpbb_forums_access'
-CREATE TABLE phpbb_forums_access (
- forum_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- session_id binary(32) DEFAULT '' NOT NULL,
- PRIMARY KEY (forum_id, user_id, session_id)
-);
-
-
-# Table: 'phpbb_forums_track'
-CREATE TABLE phpbb_forums_track (
- user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- forum_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- mark_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
- PRIMARY KEY (user_id, forum_id)
-);
-
-
-# Table: 'phpbb_forums_watch'
-CREATE TABLE phpbb_forums_watch (
- forum_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- notify_status tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- KEY forum_id (forum_id),
- KEY user_id (user_id),
- KEY notify_stat (notify_status)
-);
-
-
-# Table: 'phpbb_groups'
-CREATE TABLE phpbb_groups (
- group_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- group_type tinyint(4) DEFAULT '1' NOT NULL,
- group_founder_manage tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- group_skip_auth tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- group_name blob NOT NULL,
- group_desc blob NOT NULL,
- group_desc_bitfield varbinary(255) DEFAULT '' NOT NULL,
- group_desc_options int(11) UNSIGNED DEFAULT '7' NOT NULL,
- group_desc_uid varbinary(8) DEFAULT '' NOT NULL,
- group_display tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- group_avatar varbinary(255) DEFAULT '' NOT NULL,
- group_avatar_type tinyint(2) DEFAULT '0' NOT NULL,
- group_avatar_width smallint(4) UNSIGNED DEFAULT '0' NOT NULL,
- group_avatar_height smallint(4) UNSIGNED DEFAULT '0' NOT NULL,
- group_rank mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- group_colour varbinary(6) DEFAULT '' NOT NULL,
- group_sig_chars mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- group_receive_pm tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- group_message_limit mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- group_max_recipients mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- group_legend tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- PRIMARY KEY (group_id),
- KEY group_legend_name (group_legend, group_name(255))
-);
-
-
-# Table: 'phpbb_icons'
-CREATE TABLE phpbb_icons (
- icons_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- icons_url varbinary(255) DEFAULT '' NOT NULL,
- icons_width tinyint(4) DEFAULT '0' NOT NULL,
- icons_height tinyint(4) DEFAULT '0' NOT NULL,
- icons_order mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- display_on_posting tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- PRIMARY KEY (icons_id),
- KEY display_on_posting (display_on_posting)
-);
-
-
-# Table: 'phpbb_lang'
-CREATE TABLE phpbb_lang (
- lang_id tinyint(4) NOT NULL auto_increment,
- lang_iso varbinary(30) DEFAULT '' NOT NULL,
- lang_dir varbinary(30) DEFAULT '' NOT NULL,
- lang_english_name blob NOT NULL,
- lang_local_name blob NOT NULL,
- lang_author blob NOT NULL,
- PRIMARY KEY (lang_id),
- KEY lang_iso (lang_iso)
-);
-
-
-# Table: 'phpbb_log'
-CREATE TABLE phpbb_log (
- log_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- log_type tinyint(4) DEFAULT '0' NOT NULL,
- user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- forum_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- topic_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- reportee_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- log_ip varbinary(40) DEFAULT '' NOT NULL,
- log_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
- log_operation blob NOT NULL,
- log_data mediumblob NOT NULL,
- PRIMARY KEY (log_id),
- KEY log_type (log_type),
- KEY forum_id (forum_id),
- KEY topic_id (topic_id),
- KEY reportee_id (reportee_id),
- KEY user_id (user_id)
-);
-
-
-# Table: 'phpbb_login_attempts'
-CREATE TABLE phpbb_login_attempts (
- attempt_ip varbinary(40) DEFAULT '' NOT NULL,
- attempt_browser varbinary(150) DEFAULT '' NOT NULL,
- attempt_forwarded_for varbinary(255) DEFAULT '' NOT NULL,
- attempt_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
- user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- username blob NOT NULL,
- username_clean blob NOT NULL,
- KEY att_ip (attempt_ip, attempt_time),
- KEY att_for (attempt_forwarded_for, attempt_time),
- KEY att_time (attempt_time),
- KEY user_id (user_id)
-);
-
-
-# Table: 'phpbb_moderator_cache'
-CREATE TABLE phpbb_moderator_cache (
- forum_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- username blob NOT NULL,
- group_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- group_name blob NOT NULL,
- display_on_index tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- KEY disp_idx (display_on_index),
- KEY forum_id (forum_id)
-);
-
-
-# Table: 'phpbb_modules'
-CREATE TABLE phpbb_modules (
- module_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- module_enabled tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- module_display tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- module_basename varbinary(255) DEFAULT '' NOT NULL,
- module_class varbinary(10) DEFAULT '' NOT NULL,
- parent_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- left_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- right_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- module_langname varbinary(255) DEFAULT '' NOT NULL,
- module_mode varbinary(255) DEFAULT '' NOT NULL,
- module_auth varbinary(255) DEFAULT '' NOT NULL,
- PRIMARY KEY (module_id),
- KEY left_right_id (left_id, right_id),
- KEY module_enabled (module_enabled),
- KEY class_left_id (module_class, left_id)
-);
-
-
-# Table: 'phpbb_poll_options'
-CREATE TABLE phpbb_poll_options (
- poll_option_id tinyint(4) DEFAULT '0' NOT NULL,
- topic_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- poll_option_text blob NOT NULL,
- poll_option_total mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- KEY poll_opt_id (poll_option_id),
- KEY topic_id (topic_id)
-);
-
-
-# Table: 'phpbb_poll_votes'
-CREATE TABLE phpbb_poll_votes (
- topic_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- poll_option_id tinyint(4) DEFAULT '0' NOT NULL,
- vote_user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- vote_user_ip varbinary(40) DEFAULT '' NOT NULL,
- KEY topic_id (topic_id),
- KEY vote_user_id (vote_user_id),
- KEY vote_user_ip (vote_user_ip)
-);
-
-
-# Table: 'phpbb_posts'
-CREATE TABLE phpbb_posts (
- post_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- topic_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- forum_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- poster_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- icon_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- poster_ip varbinary(40) DEFAULT '' NOT NULL,
- post_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
- post_approved tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- post_reported tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- enable_bbcode tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- enable_smilies tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- enable_magic_url tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- enable_sig tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- post_username blob NOT NULL,
- post_subject blob NOT NULL,
- post_text mediumblob NOT NULL,
- post_checksum varbinary(32) DEFAULT '' NOT NULL,
- post_attachment tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- bbcode_bitfield varbinary(255) DEFAULT '' NOT NULL,
- bbcode_uid varbinary(8) DEFAULT '' NOT NULL,
- post_postcount tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- post_edit_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
- post_edit_reason blob NOT NULL,
- post_edit_user mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- post_edit_count smallint(4) UNSIGNED DEFAULT '0' NOT NULL,
- post_edit_locked tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- PRIMARY KEY (post_id),
- KEY forum_id (forum_id),
- KEY topic_id (topic_id),
- KEY poster_ip (poster_ip),
- KEY poster_id (poster_id),
- KEY post_approved (post_approved),
- KEY post_username (post_username(255)),
- KEY tid_post_time (topic_id, post_time)
-);
-
-
-# Table: 'phpbb_privmsgs'
-CREATE TABLE phpbb_privmsgs (
- msg_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- root_level mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- author_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- icon_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- author_ip varbinary(40) DEFAULT '' NOT NULL,
- message_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
- enable_bbcode tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- enable_smilies tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- enable_magic_url tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- enable_sig tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- message_subject blob NOT NULL,
- message_text mediumblob NOT NULL,
- message_edit_reason blob NOT NULL,
- message_edit_user mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- message_attachment tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- bbcode_bitfield varbinary(255) DEFAULT '' NOT NULL,
- bbcode_uid varbinary(8) DEFAULT '' NOT NULL,
- message_edit_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
- message_edit_count smallint(4) UNSIGNED DEFAULT '0' NOT NULL,
- to_address blob NOT NULL,
- bcc_address blob NOT NULL,
- message_reported tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- PRIMARY KEY (msg_id),
- KEY author_ip (author_ip),
- KEY message_time (message_time),
- KEY author_id (author_id),
- KEY root_level (root_level)
-);
-
-
-# Table: 'phpbb_privmsgs_folder'
-CREATE TABLE phpbb_privmsgs_folder (
- folder_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- folder_name blob NOT NULL,
- pm_count mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- PRIMARY KEY (folder_id),
- KEY user_id (user_id)
-);
-
-
-# Table: 'phpbb_privmsgs_rules'
-CREATE TABLE phpbb_privmsgs_rules (
- rule_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- rule_check mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- rule_connection mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- rule_string blob NOT NULL,
- rule_user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- rule_group_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- rule_action mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- rule_folder_id int(11) DEFAULT '0' NOT NULL,
- PRIMARY KEY (rule_id),
- KEY user_id (user_id)
-);
-
-
-# Table: 'phpbb_privmsgs_to'
-CREATE TABLE phpbb_privmsgs_to (
- msg_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- author_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- pm_deleted tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- pm_new tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- pm_unread tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- pm_replied tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- pm_marked tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- pm_forwarded tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- folder_id int(11) DEFAULT '0' NOT NULL,
- KEY msg_id (msg_id),
- KEY author_id (author_id),
- KEY usr_flder_id (user_id, folder_id)
-);
-
-
-# Table: 'phpbb_profile_fields'
-CREATE TABLE phpbb_profile_fields (
- field_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- field_name blob NOT NULL,
- field_type tinyint(4) DEFAULT '0' NOT NULL,
- field_ident varbinary(20) DEFAULT '' NOT NULL,
- field_length varbinary(20) DEFAULT '' NOT NULL,
- field_minlen varbinary(255) DEFAULT '' NOT NULL,
- field_maxlen varbinary(255) DEFAULT '' NOT NULL,
- field_novalue blob NOT NULL,
- field_default_value blob NOT NULL,
- field_validation varbinary(60) DEFAULT '' NOT NULL,
- field_required tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- field_show_novalue tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- field_show_on_reg tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- field_show_on_vt tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- field_show_profile tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- field_hide tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- field_no_view tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- field_active tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- field_order mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- PRIMARY KEY (field_id),
- KEY fld_type (field_type),
- KEY fld_ordr (field_order)
-);
-
-
-# Table: 'phpbb_profile_fields_data'
-CREATE TABLE phpbb_profile_fields_data (
- user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- PRIMARY KEY (user_id)
-);
-
-
-# Table: 'phpbb_profile_fields_lang'
-CREATE TABLE phpbb_profile_fields_lang (
- field_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- lang_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- option_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- field_type tinyint(4) DEFAULT '0' NOT NULL,
- lang_value blob NOT NULL,
- PRIMARY KEY (field_id, lang_id, option_id)
-);
-
-
-# Table: 'phpbb_profile_lang'
-CREATE TABLE phpbb_profile_lang (
- field_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- lang_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- lang_name blob NOT NULL,
- lang_explain blob NOT NULL,
- lang_default_value blob NOT NULL,
- PRIMARY KEY (field_id, lang_id)
-);
-
-
-# Table: 'phpbb_ranks'
-CREATE TABLE phpbb_ranks (
- rank_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- rank_title blob NOT NULL,
- rank_min mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- rank_special tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- rank_image varbinary(255) DEFAULT '' NOT NULL,
- PRIMARY KEY (rank_id)
-);
-
-
-# Table: 'phpbb_reports'
-CREATE TABLE phpbb_reports (
- report_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- reason_id smallint(4) UNSIGNED DEFAULT '0' NOT NULL,
- post_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- pm_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- user_notify tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- report_closed tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- report_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
- report_text mediumblob NOT NULL,
- PRIMARY KEY (report_id),
- KEY post_id (post_id),
- KEY pm_id (pm_id)
-);
-
-
-# Table: 'phpbb_reports_reasons'
-CREATE TABLE phpbb_reports_reasons (
- reason_id smallint(4) UNSIGNED NOT NULL auto_increment,
- reason_title blob NOT NULL,
- reason_description mediumblob NOT NULL,
- reason_order smallint(4) UNSIGNED DEFAULT '0' NOT NULL,
- PRIMARY KEY (reason_id)
-);
-
-
-# Table: 'phpbb_search_results'
-CREATE TABLE phpbb_search_results (
- search_key varbinary(32) DEFAULT '' NOT NULL,
- search_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
- search_keywords mediumblob NOT NULL,
- search_authors mediumblob NOT NULL,
- PRIMARY KEY (search_key)
-);
-
-
-# Table: 'phpbb_search_wordlist'
-CREATE TABLE phpbb_search_wordlist (
- word_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- word_text blob NOT NULL,
- word_common tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- word_count mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- PRIMARY KEY (word_id),
- UNIQUE wrd_txt (word_text(255)),
- KEY wrd_cnt (word_count)
-);
-
-
-# Table: 'phpbb_search_wordmatch'
-CREATE TABLE phpbb_search_wordmatch (
- post_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- word_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- title_match tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- UNIQUE unq_mtch (word_id, post_id, title_match),
- KEY word_id (word_id),
- KEY post_id (post_id)
-);
-
-
-# Table: 'phpbb_sessions'
-CREATE TABLE phpbb_sessions (
- session_id binary(32) DEFAULT '' NOT NULL,
- session_user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- session_forum_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- session_last_visit int(11) UNSIGNED DEFAULT '0' NOT NULL,
- session_start int(11) UNSIGNED DEFAULT '0' NOT NULL,
- session_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
- session_ip varbinary(40) DEFAULT '' NOT NULL,
- session_browser varbinary(150) DEFAULT '' NOT NULL,
- session_forwarded_for varbinary(255) DEFAULT '' NOT NULL,
- session_page blob NOT NULL,
- session_viewonline tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- session_autologin tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- session_admin tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- PRIMARY KEY (session_id),
- KEY session_time (session_time),
- KEY session_user_id (session_user_id),
- KEY session_fid (session_forum_id)
-);
-
-
-# Table: 'phpbb_sessions_keys'
-CREATE TABLE phpbb_sessions_keys (
- key_id binary(32) DEFAULT '' NOT NULL,
- user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- last_ip varbinary(40) DEFAULT '' NOT NULL,
- last_login int(11) UNSIGNED DEFAULT '0' NOT NULL,
- PRIMARY KEY (key_id, user_id),
- KEY last_login (last_login)
-);
-
-
-# Table: 'phpbb_sitelist'
-CREATE TABLE phpbb_sitelist (
- site_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- site_ip varbinary(40) DEFAULT '' NOT NULL,
- site_hostname varbinary(255) DEFAULT '' NOT NULL,
- ip_exclude tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- PRIMARY KEY (site_id)
-);
-
-
-# Table: 'phpbb_smilies'
-CREATE TABLE phpbb_smilies (
- smiley_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- code varbinary(150) DEFAULT '' NOT NULL,
- emotion varbinary(150) DEFAULT '' NOT NULL,
- smiley_url varbinary(50) DEFAULT '' NOT NULL,
- smiley_width smallint(4) UNSIGNED DEFAULT '0' NOT NULL,
- smiley_height smallint(4) UNSIGNED DEFAULT '0' NOT NULL,
- smiley_order mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- display_on_posting tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- PRIMARY KEY (smiley_id),
- KEY display_on_post (display_on_posting)
-);
-
-
-# Table: 'phpbb_styles'
-CREATE TABLE phpbb_styles (
- style_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- style_name blob NOT NULL,
- style_copyright blob NOT NULL,
- style_active tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- template_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- theme_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- imageset_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- PRIMARY KEY (style_id),
- UNIQUE style_name (style_name(255)),
- KEY template_id (template_id),
- KEY theme_id (theme_id),
- KEY imageset_id (imageset_id)
-);
-
-
-# Table: 'phpbb_styles_template'
-CREATE TABLE phpbb_styles_template (
- template_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- template_name blob NOT NULL,
- template_copyright blob NOT NULL,
- template_path varbinary(100) DEFAULT '' NOT NULL,
- bbcode_bitfield varbinary(255) DEFAULT 'kNg=' NOT NULL,
- template_storedb tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- template_inherits_id int(4) UNSIGNED DEFAULT '0' NOT NULL,
- template_inherit_path varbinary(255) DEFAULT '' NOT NULL,
- PRIMARY KEY (template_id),
- UNIQUE tmplte_nm (template_name(255))
-);
-
-
-# Table: 'phpbb_styles_template_data'
-CREATE TABLE phpbb_styles_template_data (
- template_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- template_filename varbinary(100) DEFAULT '' NOT NULL,
- template_included blob NOT NULL,
- template_mtime int(11) UNSIGNED DEFAULT '0' NOT NULL,
- template_data mediumblob NOT NULL,
- KEY tid (template_id),
- KEY tfn (template_filename)
-);
-
-
-# Table: 'phpbb_styles_theme'
-CREATE TABLE phpbb_styles_theme (
- theme_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- theme_name blob NOT NULL,
- theme_copyright blob NOT NULL,
- theme_path varbinary(100) DEFAULT '' NOT NULL,
- theme_storedb tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- theme_mtime int(11) UNSIGNED DEFAULT '0' NOT NULL,
- theme_data mediumblob NOT NULL,
- PRIMARY KEY (theme_id),
- UNIQUE theme_name (theme_name(255))
-);
-
-
-# Table: 'phpbb_styles_imageset'
-CREATE TABLE phpbb_styles_imageset (
- imageset_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- imageset_name blob NOT NULL,
- imageset_copyright blob NOT NULL,
- imageset_path varbinary(100) DEFAULT '' NOT NULL,
- PRIMARY KEY (imageset_id),
- UNIQUE imgset_nm (imageset_name(255))
-);
-
-
-# Table: 'phpbb_styles_imageset_data'
-CREATE TABLE phpbb_styles_imageset_data (
- image_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- image_name varbinary(200) DEFAULT '' NOT NULL,
- image_filename varbinary(200) DEFAULT '' NOT NULL,
- image_lang varbinary(30) DEFAULT '' NOT NULL,
- image_height smallint(4) UNSIGNED DEFAULT '0' NOT NULL,
- image_width smallint(4) UNSIGNED DEFAULT '0' NOT NULL,
- imageset_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- PRIMARY KEY (image_id),
- KEY i_d (imageset_id)
-);
-
-
-# Table: 'phpbb_topics'
-CREATE TABLE phpbb_topics (
- topic_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- forum_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- icon_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- topic_attachment tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- topic_approved tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- topic_reported tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- topic_title blob NOT NULL,
- topic_poster mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- topic_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
- topic_time_limit int(11) UNSIGNED DEFAULT '0' NOT NULL,
- topic_views mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- topic_replies mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- topic_replies_real mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- topic_status tinyint(3) DEFAULT '0' NOT NULL,
- topic_type tinyint(3) DEFAULT '0' NOT NULL,
- topic_first_post_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- topic_first_poster_name blob NOT NULL,
- topic_first_poster_colour varbinary(6) DEFAULT '' NOT NULL,
- topic_last_post_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- topic_last_poster_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- topic_last_poster_name blob NOT NULL,
- topic_last_poster_colour varbinary(6) DEFAULT '' NOT NULL,
- topic_last_post_subject blob NOT NULL,
- topic_last_post_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
- topic_last_view_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
- topic_moved_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- topic_bumped tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- topic_bumper mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- poll_title blob NOT NULL,
- poll_start int(11) UNSIGNED DEFAULT '0' NOT NULL,
- poll_length int(11) UNSIGNED DEFAULT '0' NOT NULL,
- poll_max_options tinyint(4) DEFAULT '1' NOT NULL,
- poll_last_vote int(11) UNSIGNED DEFAULT '0' NOT NULL,
- poll_vote_change tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- PRIMARY KEY (topic_id),
- KEY forum_id (forum_id),
- KEY forum_id_type (forum_id, topic_type),
- KEY last_post_time (topic_last_post_time),
- KEY topic_approved (topic_approved),
- KEY forum_appr_last (forum_id, topic_approved, topic_last_post_id),
- KEY fid_time_moved (forum_id, topic_last_post_time, topic_moved_id)
-);
-
-
-# Table: 'phpbb_topics_track'
-CREATE TABLE phpbb_topics_track (
- user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- topic_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- forum_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- mark_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
- PRIMARY KEY (user_id, topic_id),
- KEY topic_id (topic_id),
- KEY forum_id (forum_id)
-);
-
-
-# Table: 'phpbb_topics_posted'
-CREATE TABLE phpbb_topics_posted (
- user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- topic_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- topic_posted tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- PRIMARY KEY (user_id, topic_id)
-);
-
-
-# Table: 'phpbb_topics_watch'
-CREATE TABLE phpbb_topics_watch (
- topic_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- notify_status tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- KEY topic_id (topic_id),
- KEY user_id (user_id),
- KEY notify_stat (notify_status)
-);
-
-
-# Table: 'phpbb_user_group'
-CREATE TABLE phpbb_user_group (
- group_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- group_leader tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- user_pending tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- KEY group_id (group_id),
- KEY user_id (user_id),
- KEY group_leader (group_leader)
-);
-
-
-# Table: 'phpbb_users'
-CREATE TABLE phpbb_users (
- user_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- user_type tinyint(2) DEFAULT '0' NOT NULL,
- group_id mediumint(8) UNSIGNED DEFAULT '3' NOT NULL,
- user_permissions mediumblob NOT NULL,
- user_perm_from mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- user_ip varbinary(40) DEFAULT '' NOT NULL,
- user_regdate int(11) UNSIGNED DEFAULT '0' NOT NULL,
- username blob NOT NULL,
- username_clean blob NOT NULL,
- user_password varbinary(120) DEFAULT '' NOT NULL,
- user_passchg int(11) UNSIGNED DEFAULT '0' NOT NULL,
- user_pass_convert tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- user_email blob NOT NULL,
- user_email_hash bigint(20) DEFAULT '0' NOT NULL,
- user_birthday varbinary(10) DEFAULT '' NOT NULL,
- user_lastvisit int(11) UNSIGNED DEFAULT '0' NOT NULL,
- user_lastmark int(11) UNSIGNED DEFAULT '0' NOT NULL,
- user_lastpost_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
- user_lastpage blob NOT NULL,
- user_last_confirm_key varbinary(10) DEFAULT '' NOT NULL,
- user_last_search int(11) UNSIGNED DEFAULT '0' NOT NULL,
- user_warnings tinyint(4) DEFAULT '0' NOT NULL,
- user_last_warning int(11) UNSIGNED DEFAULT '0' NOT NULL,
- user_login_attempts tinyint(4) DEFAULT '0' NOT NULL,
- user_inactive_reason tinyint(2) DEFAULT '0' NOT NULL,
- user_inactive_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
- user_posts mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- user_lang varbinary(30) DEFAULT '' NOT NULL,
- user_timezone decimal(5,2) DEFAULT '0' NOT NULL,
- user_dst tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- user_dateformat varbinary(90) DEFAULT 'd M Y H:i' NOT NULL,
- user_style mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- user_rank mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- user_colour varbinary(6) DEFAULT '' NOT NULL,
- user_new_privmsg int(4) DEFAULT '0' NOT NULL,
- user_unread_privmsg int(4) DEFAULT '0' NOT NULL,
- user_last_privmsg int(11) UNSIGNED DEFAULT '0' NOT NULL,
- user_message_rules tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- user_full_folder int(11) DEFAULT '-3' NOT NULL,
- user_emailtime int(11) UNSIGNED DEFAULT '0' NOT NULL,
- user_topic_show_days smallint(4) UNSIGNED DEFAULT '0' NOT NULL,
- user_topic_sortby_type varbinary(1) DEFAULT 't' NOT NULL,
- user_topic_sortby_dir varbinary(1) DEFAULT 'd' NOT NULL,
- user_post_show_days smallint(4) UNSIGNED DEFAULT '0' NOT NULL,
- user_post_sortby_type varbinary(1) DEFAULT 't' NOT NULL,
- user_post_sortby_dir varbinary(1) DEFAULT 'a' NOT NULL,
- user_notify tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- user_notify_pm tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- user_notify_type tinyint(4) DEFAULT '0' NOT NULL,
- user_allow_pm tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- user_allow_viewonline tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- user_allow_viewemail tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- user_allow_massemail tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- user_options int(11) UNSIGNED DEFAULT '230271' NOT NULL,
- user_avatar varbinary(255) DEFAULT '' NOT NULL,
- user_avatar_type tinyint(2) DEFAULT '0' NOT NULL,
- user_avatar_width smallint(4) UNSIGNED DEFAULT '0' NOT NULL,
- user_avatar_height smallint(4) UNSIGNED DEFAULT '0' NOT NULL,
- user_sig mediumblob NOT NULL,
- user_sig_bbcode_uid varbinary(8) DEFAULT '' NOT NULL,
- user_sig_bbcode_bitfield varbinary(255) DEFAULT '' NOT NULL,
- user_from blob NOT NULL,
- user_icq varbinary(15) DEFAULT '' NOT NULL,
- user_aim blob NOT NULL,
- user_yim blob NOT NULL,
- user_msnm blob NOT NULL,
- user_jabber blob NOT NULL,
- user_website blob NOT NULL,
- user_occ blob NOT NULL,
- user_interests blob NOT NULL,
- user_actkey varbinary(32) DEFAULT '' NOT NULL,
- user_newpasswd varbinary(120) DEFAULT '' NOT NULL,
- user_form_salt varbinary(96) DEFAULT '' NOT NULL,
- user_new tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- user_reminded tinyint(4) DEFAULT '0' NOT NULL,
- user_reminded_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
- PRIMARY KEY (user_id),
- KEY user_birthday (user_birthday),
- KEY user_email_hash (user_email_hash),
- KEY user_type (user_type),
- UNIQUE username_clean (username_clean(255))
-);
-
-
-# Table: 'phpbb_warnings'
-CREATE TABLE phpbb_warnings (
- warning_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- post_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- log_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- warning_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
- PRIMARY KEY (warning_id)
-);
-
-
-# Table: 'phpbb_words'
-CREATE TABLE phpbb_words (
- word_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- word blob NOT NULL,
- replacement blob NOT NULL,
- PRIMARY KEY (word_id)
-);
-
-
-# Table: 'phpbb_zebra'
-CREATE TABLE phpbb_zebra (
- user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- zebra_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- friend tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- foe tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- PRIMARY KEY (user_id, zebra_id)
-);
-
-
diff --git a/phpBB/install/schemas/mysql_41_schema.sql b/phpBB/install/schemas/mysql_41_schema.sql
deleted file mode 100644
index 15d34894d8..0000000000
--- a/phpBB/install/schemas/mysql_41_schema.sql
+++ /dev/null
@@ -1,1034 +0,0 @@
-# DO NOT EDIT THIS FILE, IT IS GENERATED
-#
-# To change the contents of this file, edit
-# phpBB/develop/create_schema_files.php and
-# run it.
-# Table: 'phpbb_attachments'
-CREATE TABLE phpbb_attachments (
- attach_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- post_msg_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- topic_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- in_message tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- poster_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- is_orphan tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- physical_filename varchar(255) DEFAULT '' NOT NULL,
- real_filename varchar(255) DEFAULT '' NOT NULL,
- download_count mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- attach_comment text NOT NULL,
- extension varchar(100) DEFAULT '' NOT NULL,
- mimetype varchar(100) DEFAULT '' NOT NULL,
- filesize int(20) UNSIGNED DEFAULT '0' NOT NULL,
- filetime int(11) UNSIGNED DEFAULT '0' NOT NULL,
- thumbnail tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- PRIMARY KEY (attach_id),
- KEY filetime (filetime),
- KEY post_msg_id (post_msg_id),
- KEY topic_id (topic_id),
- KEY poster_id (poster_id),
- KEY is_orphan (is_orphan)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
-# Table: 'phpbb_acl_groups'
-CREATE TABLE phpbb_acl_groups (
- group_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- forum_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- auth_option_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- auth_role_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- auth_setting tinyint(2) DEFAULT '0' NOT NULL,
- KEY group_id (group_id),
- KEY auth_opt_id (auth_option_id),
- KEY auth_role_id (auth_role_id)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
-# Table: 'phpbb_acl_options'
-CREATE TABLE phpbb_acl_options (
- auth_option_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- auth_option varchar(50) DEFAULT '' NOT NULL,
- is_global tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- is_local tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- founder_only tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- PRIMARY KEY (auth_option_id),
- UNIQUE auth_option (auth_option)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
-# Table: 'phpbb_acl_roles'
-CREATE TABLE phpbb_acl_roles (
- role_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- role_name varchar(255) DEFAULT '' NOT NULL,
- role_description text NOT NULL,
- role_type varchar(10) DEFAULT '' NOT NULL,
- role_order smallint(4) UNSIGNED DEFAULT '0' NOT NULL,
- PRIMARY KEY (role_id),
- KEY role_type (role_type),
- KEY role_order (role_order)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
-# Table: 'phpbb_acl_roles_data'
-CREATE TABLE phpbb_acl_roles_data (
- role_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- auth_option_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- auth_setting tinyint(2) DEFAULT '0' NOT NULL,
- PRIMARY KEY (role_id, auth_option_id),
- KEY ath_op_id (auth_option_id)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
-# Table: 'phpbb_acl_users'
-CREATE TABLE phpbb_acl_users (
- user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- forum_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- auth_option_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- auth_role_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- auth_setting tinyint(2) DEFAULT '0' NOT NULL,
- KEY user_id (user_id),
- KEY auth_option_id (auth_option_id),
- KEY auth_role_id (auth_role_id)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
-# Table: 'phpbb_banlist'
-CREATE TABLE phpbb_banlist (
- ban_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- ban_userid mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- ban_ip varchar(40) DEFAULT '' NOT NULL,
- ban_email varchar(100) DEFAULT '' NOT NULL,
- ban_start int(11) UNSIGNED DEFAULT '0' NOT NULL,
- ban_end int(11) UNSIGNED DEFAULT '0' NOT NULL,
- ban_exclude tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- ban_reason varchar(255) DEFAULT '' NOT NULL,
- ban_give_reason varchar(255) DEFAULT '' NOT NULL,
- PRIMARY KEY (ban_id),
- KEY ban_end (ban_end),
- KEY ban_user (ban_userid, ban_exclude),
- KEY ban_email (ban_email, ban_exclude),
- KEY ban_ip (ban_ip, ban_exclude)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
-# Table: 'phpbb_bbcodes'
-CREATE TABLE phpbb_bbcodes (
- bbcode_id smallint(4) UNSIGNED DEFAULT '0' NOT NULL,
- bbcode_tag varchar(16) DEFAULT '' NOT NULL,
- bbcode_helpline varchar(255) DEFAULT '' NOT NULL,
- display_on_posting tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- bbcode_match text NOT NULL,
- bbcode_tpl mediumtext NOT NULL,
- first_pass_match mediumtext NOT NULL,
- first_pass_replace mediumtext NOT NULL,
- second_pass_match mediumtext NOT NULL,
- second_pass_replace mediumtext NOT NULL,
- PRIMARY KEY (bbcode_id),
- KEY display_on_post (display_on_posting)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
-# Table: 'phpbb_bookmarks'
-CREATE TABLE phpbb_bookmarks (
- topic_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- PRIMARY KEY (topic_id, user_id)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
-# Table: 'phpbb_bots'
-CREATE TABLE phpbb_bots (
- bot_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- bot_active tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- bot_name varchar(255) DEFAULT '' NOT NULL,
- user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- bot_agent varchar(255) DEFAULT '' NOT NULL,
- bot_ip varchar(255) DEFAULT '' NOT NULL,
- PRIMARY KEY (bot_id),
- KEY bot_active (bot_active)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
-# Table: 'phpbb_config'
-CREATE TABLE phpbb_config (
- config_name varchar(255) DEFAULT '' NOT NULL,
- config_value varchar(255) DEFAULT '' NOT NULL,
- is_dynamic tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- PRIMARY KEY (config_name),
- KEY is_dynamic (is_dynamic)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
-# Table: 'phpbb_confirm'
-CREATE TABLE phpbb_confirm (
- confirm_id char(32) DEFAULT '' NOT NULL,
- session_id char(32) DEFAULT '' NOT NULL,
- confirm_type tinyint(3) DEFAULT '0' NOT NULL,
- code varchar(8) DEFAULT '' NOT NULL,
- seed int(10) UNSIGNED DEFAULT '0' NOT NULL,
- attempts mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- PRIMARY KEY (session_id, confirm_id),
- KEY confirm_type (confirm_type)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
-# Table: 'phpbb_disallow'
-CREATE TABLE phpbb_disallow (
- disallow_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- disallow_username varchar(255) DEFAULT '' NOT NULL,
- PRIMARY KEY (disallow_id)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
-# Table: 'phpbb_drafts'
-CREATE TABLE phpbb_drafts (
- draft_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- topic_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- forum_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- save_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
- draft_subject varchar(255) DEFAULT '' NOT NULL,
- draft_message mediumtext NOT NULL,
- PRIMARY KEY (draft_id),
- KEY save_time (save_time)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
-# Table: 'phpbb_extensions'
-CREATE TABLE phpbb_extensions (
- extension_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- group_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- extension varchar(100) DEFAULT '' NOT NULL,
- PRIMARY KEY (extension_id)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
-# Table: 'phpbb_extension_groups'
-CREATE TABLE phpbb_extension_groups (
- group_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- group_name varchar(255) DEFAULT '' NOT NULL,
- cat_id tinyint(2) DEFAULT '0' NOT NULL,
- allow_group tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- download_mode tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- upload_icon varchar(255) DEFAULT '' NOT NULL,
- max_filesize int(20) UNSIGNED DEFAULT '0' NOT NULL,
- allowed_forums text NOT NULL,
- allow_in_pm tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- PRIMARY KEY (group_id)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
-# Table: 'phpbb_forums'
-CREATE TABLE phpbb_forums (
- forum_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- parent_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- left_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- right_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- forum_parents mediumtext NOT NULL,
- forum_name varchar(255) DEFAULT '' NOT NULL,
- forum_desc text NOT NULL,
- forum_desc_bitfield varchar(255) DEFAULT '' NOT NULL,
- forum_desc_options int(11) UNSIGNED DEFAULT '7' NOT NULL,
- forum_desc_uid varchar(8) DEFAULT '' NOT NULL,
- forum_link varchar(255) DEFAULT '' NOT NULL,
- forum_password varchar(40) DEFAULT '' NOT NULL,
- forum_style mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- forum_image varchar(255) DEFAULT '' NOT NULL,
- forum_rules text NOT NULL,
- forum_rules_link varchar(255) DEFAULT '' NOT NULL,
- forum_rules_bitfield varchar(255) DEFAULT '' NOT NULL,
- forum_rules_options int(11) UNSIGNED DEFAULT '7' NOT NULL,
- forum_rules_uid varchar(8) DEFAULT '' NOT NULL,
- forum_topics_per_page tinyint(4) DEFAULT '0' NOT NULL,
- forum_type tinyint(4) DEFAULT '0' NOT NULL,
- forum_status tinyint(4) DEFAULT '0' NOT NULL,
- forum_posts mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- forum_topics mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- forum_topics_real mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- forum_last_post_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- forum_last_poster_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- forum_last_post_subject varchar(255) DEFAULT '' NOT NULL,
- forum_last_post_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
- forum_last_poster_name varchar(255) DEFAULT '' NOT NULL,
- forum_last_poster_colour varchar(6) DEFAULT '' NOT NULL,
- forum_flags tinyint(4) DEFAULT '32' NOT NULL,
- forum_options int(20) UNSIGNED DEFAULT '0' NOT NULL,
- display_subforum_list tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- display_on_index tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- enable_indexing tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- enable_icons tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- enable_prune tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- prune_next int(11) UNSIGNED DEFAULT '0' NOT NULL,
- prune_days mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- prune_viewed mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- prune_freq mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- PRIMARY KEY (forum_id),
- KEY left_right_id (left_id, right_id),
- KEY forum_lastpost_id (forum_last_post_id)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
-# Table: 'phpbb_forums_access'
-CREATE TABLE phpbb_forums_access (
- forum_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- session_id char(32) DEFAULT '' NOT NULL,
- PRIMARY KEY (forum_id, user_id, session_id)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
-# Table: 'phpbb_forums_track'
-CREATE TABLE phpbb_forums_track (
- user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- forum_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- mark_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
- PRIMARY KEY (user_id, forum_id)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
-# Table: 'phpbb_forums_watch'
-CREATE TABLE phpbb_forums_watch (
- forum_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- notify_status tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- KEY forum_id (forum_id),
- KEY user_id (user_id),
- KEY notify_stat (notify_status)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
-# Table: 'phpbb_groups'
-CREATE TABLE phpbb_groups (
- group_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- group_type tinyint(4) DEFAULT '1' NOT NULL,
- group_founder_manage tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- group_skip_auth tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- group_name varchar(255) DEFAULT '' NOT NULL,
- group_desc text NOT NULL,
- group_desc_bitfield varchar(255) DEFAULT '' NOT NULL,
- group_desc_options int(11) UNSIGNED DEFAULT '7' NOT NULL,
- group_desc_uid varchar(8) DEFAULT '' NOT NULL,
- group_display tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- group_avatar varchar(255) DEFAULT '' NOT NULL,
- group_avatar_type tinyint(2) DEFAULT '0' NOT NULL,
- group_avatar_width smallint(4) UNSIGNED DEFAULT '0' NOT NULL,
- group_avatar_height smallint(4) UNSIGNED DEFAULT '0' NOT NULL,
- group_rank mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- group_colour varchar(6) DEFAULT '' NOT NULL,
- group_sig_chars mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- group_receive_pm tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- group_message_limit mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- group_max_recipients mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- group_legend tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- PRIMARY KEY (group_id),
- KEY group_legend_name (group_legend, group_name)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
-# Table: 'phpbb_icons'
-CREATE TABLE phpbb_icons (
- icons_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- icons_url varchar(255) DEFAULT '' NOT NULL,
- icons_width tinyint(4) DEFAULT '0' NOT NULL,
- icons_height tinyint(4) DEFAULT '0' NOT NULL,
- icons_order mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- display_on_posting tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- PRIMARY KEY (icons_id),
- KEY display_on_posting (display_on_posting)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
-# Table: 'phpbb_lang'
-CREATE TABLE phpbb_lang (
- lang_id tinyint(4) NOT NULL auto_increment,
- lang_iso varchar(30) DEFAULT '' NOT NULL,
- lang_dir varchar(30) DEFAULT '' NOT NULL,
- lang_english_name varchar(100) DEFAULT '' NOT NULL,
- lang_local_name varchar(255) DEFAULT '' NOT NULL,
- lang_author varchar(255) DEFAULT '' NOT NULL,
- PRIMARY KEY (lang_id),
- KEY lang_iso (lang_iso)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
-# Table: 'phpbb_log'
-CREATE TABLE phpbb_log (
- log_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- log_type tinyint(4) DEFAULT '0' NOT NULL,
- user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- forum_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- topic_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- reportee_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- log_ip varchar(40) DEFAULT '' NOT NULL,
- log_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
- log_operation text NOT NULL,
- log_data mediumtext NOT NULL,
- PRIMARY KEY (log_id),
- KEY log_type (log_type),
- KEY forum_id (forum_id),
- KEY topic_id (topic_id),
- KEY reportee_id (reportee_id),
- KEY user_id (user_id)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
-# Table: 'phpbb_login_attempts'
-CREATE TABLE phpbb_login_attempts (
- attempt_ip varchar(40) DEFAULT '' NOT NULL,
- attempt_browser varchar(150) DEFAULT '' NOT NULL,
- attempt_forwarded_for varchar(255) DEFAULT '' NOT NULL,
- attempt_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
- user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- username varchar(255) DEFAULT '0' NOT NULL,
- username_clean varchar(255) DEFAULT '0' NOT NULL,
- KEY att_ip (attempt_ip, attempt_time),
- KEY att_for (attempt_forwarded_for, attempt_time),
- KEY att_time (attempt_time),
- KEY user_id (user_id)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
-# Table: 'phpbb_moderator_cache'
-CREATE TABLE phpbb_moderator_cache (
- forum_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- username varchar(255) DEFAULT '' NOT NULL,
- group_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- group_name varchar(255) DEFAULT '' NOT NULL,
- display_on_index tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- KEY disp_idx (display_on_index),
- KEY forum_id (forum_id)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
-# Table: 'phpbb_modules'
-CREATE TABLE phpbb_modules (
- module_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- module_enabled tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- module_display tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- module_basename varchar(255) DEFAULT '' NOT NULL,
- module_class varchar(10) DEFAULT '' NOT NULL,
- parent_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- left_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- right_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- module_langname varchar(255) DEFAULT '' NOT NULL,
- module_mode varchar(255) DEFAULT '' NOT NULL,
- module_auth varchar(255) DEFAULT '' NOT NULL,
- PRIMARY KEY (module_id),
- KEY left_right_id (left_id, right_id),
- KEY module_enabled (module_enabled),
- KEY class_left_id (module_class, left_id)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
-# Table: 'phpbb_poll_options'
-CREATE TABLE phpbb_poll_options (
- poll_option_id tinyint(4) DEFAULT '0' NOT NULL,
- topic_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- poll_option_text text NOT NULL,
- poll_option_total mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- KEY poll_opt_id (poll_option_id),
- KEY topic_id (topic_id)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
-# Table: 'phpbb_poll_votes'
-CREATE TABLE phpbb_poll_votes (
- topic_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- poll_option_id tinyint(4) DEFAULT '0' NOT NULL,
- vote_user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- vote_user_ip varchar(40) DEFAULT '' NOT NULL,
- KEY topic_id (topic_id),
- KEY vote_user_id (vote_user_id),
- KEY vote_user_ip (vote_user_ip)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
-# Table: 'phpbb_posts'
-CREATE TABLE phpbb_posts (
- post_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- topic_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- forum_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- poster_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- icon_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- poster_ip varchar(40) DEFAULT '' NOT NULL,
- post_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
- post_approved tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- post_reported tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- enable_bbcode tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- enable_smilies tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- enable_magic_url tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- enable_sig tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- post_username varchar(255) DEFAULT '' NOT NULL,
- post_subject varchar(255) DEFAULT '' NOT NULL COLLATE utf8_unicode_ci,
- post_text mediumtext NOT NULL,
- post_checksum varchar(32) DEFAULT '' NOT NULL,
- post_attachment tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- bbcode_bitfield varchar(255) DEFAULT '' NOT NULL,
- bbcode_uid varchar(8) DEFAULT '' NOT NULL,
- post_postcount tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- post_edit_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
- post_edit_reason varchar(255) DEFAULT '' NOT NULL,
- post_edit_user mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- post_edit_count smallint(4) UNSIGNED DEFAULT '0' NOT NULL,
- post_edit_locked tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- PRIMARY KEY (post_id),
- KEY forum_id (forum_id),
- KEY topic_id (topic_id),
- KEY poster_ip (poster_ip),
- KEY poster_id (poster_id),
- KEY post_approved (post_approved),
- KEY post_username (post_username),
- KEY tid_post_time (topic_id, post_time)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
-# Table: 'phpbb_privmsgs'
-CREATE TABLE phpbb_privmsgs (
- msg_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- root_level mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- author_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- icon_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- author_ip varchar(40) DEFAULT '' NOT NULL,
- message_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
- enable_bbcode tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- enable_smilies tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- enable_magic_url tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- enable_sig tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- message_subject varchar(255) DEFAULT '' NOT NULL,
- message_text mediumtext NOT NULL,
- message_edit_reason varchar(255) DEFAULT '' NOT NULL,
- message_edit_user mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- message_attachment tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- bbcode_bitfield varchar(255) DEFAULT '' NOT NULL,
- bbcode_uid varchar(8) DEFAULT '' NOT NULL,
- message_edit_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
- message_edit_count smallint(4) UNSIGNED DEFAULT '0' NOT NULL,
- to_address text NOT NULL,
- bcc_address text NOT NULL,
- message_reported tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- PRIMARY KEY (msg_id),
- KEY author_ip (author_ip),
- KEY message_time (message_time),
- KEY author_id (author_id),
- KEY root_level (root_level)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
-# Table: 'phpbb_privmsgs_folder'
-CREATE TABLE phpbb_privmsgs_folder (
- folder_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- folder_name varchar(255) DEFAULT '' NOT NULL,
- pm_count mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- PRIMARY KEY (folder_id),
- KEY user_id (user_id)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
-# Table: 'phpbb_privmsgs_rules'
-CREATE TABLE phpbb_privmsgs_rules (
- rule_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- rule_check mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- rule_connection mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- rule_string varchar(255) DEFAULT '' NOT NULL,
- rule_user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- rule_group_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- rule_action mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- rule_folder_id int(11) DEFAULT '0' NOT NULL,
- PRIMARY KEY (rule_id),
- KEY user_id (user_id)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
-# Table: 'phpbb_privmsgs_to'
-CREATE TABLE phpbb_privmsgs_to (
- msg_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- author_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- pm_deleted tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- pm_new tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- pm_unread tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- pm_replied tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- pm_marked tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- pm_forwarded tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- folder_id int(11) DEFAULT '0' NOT NULL,
- KEY msg_id (msg_id),
- KEY author_id (author_id),
- KEY usr_flder_id (user_id, folder_id)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
-# Table: 'phpbb_profile_fields'
-CREATE TABLE phpbb_profile_fields (
- field_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- field_name varchar(255) DEFAULT '' NOT NULL,
- field_type tinyint(4) DEFAULT '0' NOT NULL,
- field_ident varchar(20) DEFAULT '' NOT NULL,
- field_length varchar(20) DEFAULT '' NOT NULL,
- field_minlen varchar(255) DEFAULT '' NOT NULL,
- field_maxlen varchar(255) DEFAULT '' NOT NULL,
- field_novalue varchar(255) DEFAULT '' NOT NULL,
- field_default_value varchar(255) DEFAULT '' NOT NULL,
- field_validation varchar(20) DEFAULT '' NOT NULL,
- field_required tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- field_show_novalue tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- field_show_on_reg tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- field_show_on_vt tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- field_show_profile tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- field_hide tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- field_no_view tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- field_active tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- field_order mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- PRIMARY KEY (field_id),
- KEY fld_type (field_type),
- KEY fld_ordr (field_order)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
-# Table: 'phpbb_profile_fields_data'
-CREATE TABLE phpbb_profile_fields_data (
- user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- PRIMARY KEY (user_id)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
-# Table: 'phpbb_profile_fields_lang'
-CREATE TABLE phpbb_profile_fields_lang (
- field_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- lang_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- option_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- field_type tinyint(4) DEFAULT '0' NOT NULL,
- lang_value varchar(255) DEFAULT '' NOT NULL,
- PRIMARY KEY (field_id, lang_id, option_id)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
-# Table: 'phpbb_profile_lang'
-CREATE TABLE phpbb_profile_lang (
- field_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- lang_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- lang_name varchar(255) DEFAULT '' NOT NULL,
- lang_explain text NOT NULL,
- lang_default_value varchar(255) DEFAULT '' NOT NULL,
- PRIMARY KEY (field_id, lang_id)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
-# Table: 'phpbb_ranks'
-CREATE TABLE phpbb_ranks (
- rank_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- rank_title varchar(255) DEFAULT '' NOT NULL,
- rank_min mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- rank_special tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- rank_image varchar(255) DEFAULT '' NOT NULL,
- PRIMARY KEY (rank_id)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
-# Table: 'phpbb_reports'
-CREATE TABLE phpbb_reports (
- report_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- reason_id smallint(4) UNSIGNED DEFAULT '0' NOT NULL,
- post_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- pm_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- user_notify tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- report_closed tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- report_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
- report_text mediumtext NOT NULL,
- PRIMARY KEY (report_id),
- KEY post_id (post_id),
- KEY pm_id (pm_id)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
-# Table: 'phpbb_reports_reasons'
-CREATE TABLE phpbb_reports_reasons (
- reason_id smallint(4) UNSIGNED NOT NULL auto_increment,
- reason_title varchar(255) DEFAULT '' NOT NULL,
- reason_description mediumtext NOT NULL,
- reason_order smallint(4) UNSIGNED DEFAULT '0' NOT NULL,
- PRIMARY KEY (reason_id)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
-# Table: 'phpbb_search_results'
-CREATE TABLE phpbb_search_results (
- search_key varchar(32) DEFAULT '' NOT NULL,
- search_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
- search_keywords mediumtext NOT NULL,
- search_authors mediumtext NOT NULL,
- PRIMARY KEY (search_key)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
-# Table: 'phpbb_search_wordlist'
-CREATE TABLE phpbb_search_wordlist (
- word_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- word_text varchar(255) DEFAULT '' NOT NULL,
- word_common tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- word_count mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- PRIMARY KEY (word_id),
- UNIQUE wrd_txt (word_text),
- KEY wrd_cnt (word_count)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
-# Table: 'phpbb_search_wordmatch'
-CREATE TABLE phpbb_search_wordmatch (
- post_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- word_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- title_match tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- UNIQUE unq_mtch (word_id, post_id, title_match),
- KEY word_id (word_id),
- KEY post_id (post_id)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
-# Table: 'phpbb_sessions'
-CREATE TABLE phpbb_sessions (
- session_id char(32) DEFAULT '' NOT NULL,
- session_user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- session_forum_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- session_last_visit int(11) UNSIGNED DEFAULT '0' NOT NULL,
- session_start int(11) UNSIGNED DEFAULT '0' NOT NULL,
- session_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
- session_ip varchar(40) DEFAULT '' NOT NULL,
- session_browser varchar(150) DEFAULT '' NOT NULL,
- session_forwarded_for varchar(255) DEFAULT '' NOT NULL,
- session_page varchar(255) DEFAULT '' NOT NULL,
- session_viewonline tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- session_autologin tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- session_admin tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- PRIMARY KEY (session_id),
- KEY session_time (session_time),
- KEY session_user_id (session_user_id),
- KEY session_fid (session_forum_id)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
-# Table: 'phpbb_sessions_keys'
-CREATE TABLE phpbb_sessions_keys (
- key_id char(32) DEFAULT '' NOT NULL,
- user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- last_ip varchar(40) DEFAULT '' NOT NULL,
- last_login int(11) UNSIGNED DEFAULT '0' NOT NULL,
- PRIMARY KEY (key_id, user_id),
- KEY last_login (last_login)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
-# Table: 'phpbb_sitelist'
-CREATE TABLE phpbb_sitelist (
- site_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- site_ip varchar(40) DEFAULT '' NOT NULL,
- site_hostname varchar(255) DEFAULT '' NOT NULL,
- ip_exclude tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- PRIMARY KEY (site_id)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
-# Table: 'phpbb_smilies'
-CREATE TABLE phpbb_smilies (
- smiley_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- code varchar(50) DEFAULT '' NOT NULL,
- emotion varchar(50) DEFAULT '' NOT NULL,
- smiley_url varchar(50) DEFAULT '' NOT NULL,
- smiley_width smallint(4) UNSIGNED DEFAULT '0' NOT NULL,
- smiley_height smallint(4) UNSIGNED DEFAULT '0' NOT NULL,
- smiley_order mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- display_on_posting tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- PRIMARY KEY (smiley_id),
- KEY display_on_post (display_on_posting)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
-# Table: 'phpbb_styles'
-CREATE TABLE phpbb_styles (
- style_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- style_name varchar(255) DEFAULT '' NOT NULL,
- style_copyright varchar(255) DEFAULT '' NOT NULL,
- style_active tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- template_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- theme_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- imageset_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- PRIMARY KEY (style_id),
- UNIQUE style_name (style_name),
- KEY template_id (template_id),
- KEY theme_id (theme_id),
- KEY imageset_id (imageset_id)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
-# Table: 'phpbb_styles_template'
-CREATE TABLE phpbb_styles_template (
- template_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- template_name varchar(255) DEFAULT '' NOT NULL,
- template_copyright varchar(255) DEFAULT '' NOT NULL,
- template_path varchar(100) DEFAULT '' NOT NULL,
- bbcode_bitfield varchar(255) DEFAULT 'kNg=' NOT NULL,
- template_storedb tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- template_inherits_id int(4) UNSIGNED DEFAULT '0' NOT NULL,
- template_inherit_path varchar(255) DEFAULT '' NOT NULL,
- PRIMARY KEY (template_id),
- UNIQUE tmplte_nm (template_name)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
-# Table: 'phpbb_styles_template_data'
-CREATE TABLE phpbb_styles_template_data (
- template_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- template_filename varchar(100) DEFAULT '' NOT NULL,
- template_included text NOT NULL,
- template_mtime int(11) UNSIGNED DEFAULT '0' NOT NULL,
- template_data mediumtext NOT NULL,
- KEY tid (template_id),
- KEY tfn (template_filename)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
-# Table: 'phpbb_styles_theme'
-CREATE TABLE phpbb_styles_theme (
- theme_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- theme_name varchar(255) DEFAULT '' NOT NULL,
- theme_copyright varchar(255) DEFAULT '' NOT NULL,
- theme_path varchar(100) DEFAULT '' NOT NULL,
- theme_storedb tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- theme_mtime int(11) UNSIGNED DEFAULT '0' NOT NULL,
- theme_data mediumtext NOT NULL,
- PRIMARY KEY (theme_id),
- UNIQUE theme_name (theme_name)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
-# Table: 'phpbb_styles_imageset'
-CREATE TABLE phpbb_styles_imageset (
- imageset_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- imageset_name varchar(255) DEFAULT '' NOT NULL,
- imageset_copyright varchar(255) DEFAULT '' NOT NULL,
- imageset_path varchar(100) DEFAULT '' NOT NULL,
- PRIMARY KEY (imageset_id),
- UNIQUE imgset_nm (imageset_name)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
-# Table: 'phpbb_styles_imageset_data'
-CREATE TABLE phpbb_styles_imageset_data (
- image_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- image_name varchar(200) DEFAULT '' NOT NULL,
- image_filename varchar(200) DEFAULT '' NOT NULL,
- image_lang varchar(30) DEFAULT '' NOT NULL,
- image_height smallint(4) UNSIGNED DEFAULT '0' NOT NULL,
- image_width smallint(4) UNSIGNED DEFAULT '0' NOT NULL,
- imageset_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- PRIMARY KEY (image_id),
- KEY i_d (imageset_id)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
-# Table: 'phpbb_topics'
-CREATE TABLE phpbb_topics (
- topic_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- forum_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- icon_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- topic_attachment tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- topic_approved tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- topic_reported tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- topic_title varchar(255) DEFAULT '' NOT NULL COLLATE utf8_unicode_ci,
- topic_poster mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- topic_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
- topic_time_limit int(11) UNSIGNED DEFAULT '0' NOT NULL,
- topic_views mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- topic_replies mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- topic_replies_real mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- topic_status tinyint(3) DEFAULT '0' NOT NULL,
- topic_type tinyint(3) DEFAULT '0' NOT NULL,
- topic_first_post_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- topic_first_poster_name varchar(255) DEFAULT '' NOT NULL,
- topic_first_poster_colour varchar(6) DEFAULT '' NOT NULL,
- topic_last_post_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- topic_last_poster_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- topic_last_poster_name varchar(255) DEFAULT '' NOT NULL,
- topic_last_poster_colour varchar(6) DEFAULT '' NOT NULL,
- topic_last_post_subject varchar(255) DEFAULT '' NOT NULL,
- topic_last_post_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
- topic_last_view_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
- topic_moved_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- topic_bumped tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- topic_bumper mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- poll_title varchar(255) DEFAULT '' NOT NULL,
- poll_start int(11) UNSIGNED DEFAULT '0' NOT NULL,
- poll_length int(11) UNSIGNED DEFAULT '0' NOT NULL,
- poll_max_options tinyint(4) DEFAULT '1' NOT NULL,
- poll_last_vote int(11) UNSIGNED DEFAULT '0' NOT NULL,
- poll_vote_change tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- PRIMARY KEY (topic_id),
- KEY forum_id (forum_id),
- KEY forum_id_type (forum_id, topic_type),
- KEY last_post_time (topic_last_post_time),
- KEY topic_approved (topic_approved),
- KEY forum_appr_last (forum_id, topic_approved, topic_last_post_id),
- KEY fid_time_moved (forum_id, topic_last_post_time, topic_moved_id)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
-# Table: 'phpbb_topics_track'
-CREATE TABLE phpbb_topics_track (
- user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- topic_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- forum_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- mark_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
- PRIMARY KEY (user_id, topic_id),
- KEY topic_id (topic_id),
- KEY forum_id (forum_id)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
-# Table: 'phpbb_topics_posted'
-CREATE TABLE phpbb_topics_posted (
- user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- topic_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- topic_posted tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- PRIMARY KEY (user_id, topic_id)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
-# Table: 'phpbb_topics_watch'
-CREATE TABLE phpbb_topics_watch (
- topic_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- notify_status tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- KEY topic_id (topic_id),
- KEY user_id (user_id),
- KEY notify_stat (notify_status)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
-# Table: 'phpbb_user_group'
-CREATE TABLE phpbb_user_group (
- group_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- group_leader tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- user_pending tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- KEY group_id (group_id),
- KEY user_id (user_id),
- KEY group_leader (group_leader)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
-# Table: 'phpbb_users'
-CREATE TABLE phpbb_users (
- user_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- user_type tinyint(2) DEFAULT '0' NOT NULL,
- group_id mediumint(8) UNSIGNED DEFAULT '3' NOT NULL,
- user_permissions mediumtext NOT NULL,
- user_perm_from mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- user_ip varchar(40) DEFAULT '' NOT NULL,
- user_regdate int(11) UNSIGNED DEFAULT '0' NOT NULL,
- username varchar(255) DEFAULT '' NOT NULL,
- username_clean varchar(255) DEFAULT '' NOT NULL,
- user_password varchar(40) DEFAULT '' NOT NULL,
- user_passchg int(11) UNSIGNED DEFAULT '0' NOT NULL,
- user_pass_convert tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- user_email varchar(100) DEFAULT '' NOT NULL,
- user_email_hash bigint(20) DEFAULT '0' NOT NULL,
- user_birthday varchar(10) DEFAULT '' NOT NULL,
- user_lastvisit int(11) UNSIGNED DEFAULT '0' NOT NULL,
- user_lastmark int(11) UNSIGNED DEFAULT '0' NOT NULL,
- user_lastpost_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
- user_lastpage varchar(200) DEFAULT '' NOT NULL,
- user_last_confirm_key varchar(10) DEFAULT '' NOT NULL,
- user_last_search int(11) UNSIGNED DEFAULT '0' NOT NULL,
- user_warnings tinyint(4) DEFAULT '0' NOT NULL,
- user_last_warning int(11) UNSIGNED DEFAULT '0' NOT NULL,
- user_login_attempts tinyint(4) DEFAULT '0' NOT NULL,
- user_inactive_reason tinyint(2) DEFAULT '0' NOT NULL,
- user_inactive_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
- user_posts mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- user_lang varchar(30) DEFAULT '' NOT NULL,
- user_timezone decimal(5,2) DEFAULT '0' NOT NULL,
- user_dst tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- user_dateformat varchar(30) DEFAULT 'd M Y H:i' NOT NULL,
- user_style mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- user_rank mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- user_colour varchar(6) DEFAULT '' NOT NULL,
- user_new_privmsg int(4) DEFAULT '0' NOT NULL,
- user_unread_privmsg int(4) DEFAULT '0' NOT NULL,
- user_last_privmsg int(11) UNSIGNED DEFAULT '0' NOT NULL,
- user_message_rules tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- user_full_folder int(11) DEFAULT '-3' NOT NULL,
- user_emailtime int(11) UNSIGNED DEFAULT '0' NOT NULL,
- user_topic_show_days smallint(4) UNSIGNED DEFAULT '0' NOT NULL,
- user_topic_sortby_type varchar(1) DEFAULT 't' NOT NULL,
- user_topic_sortby_dir varchar(1) DEFAULT 'd' NOT NULL,
- user_post_show_days smallint(4) UNSIGNED DEFAULT '0' NOT NULL,
- user_post_sortby_type varchar(1) DEFAULT 't' NOT NULL,
- user_post_sortby_dir varchar(1) DEFAULT 'a' NOT NULL,
- user_notify tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- user_notify_pm tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- user_notify_type tinyint(4) DEFAULT '0' NOT NULL,
- user_allow_pm tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- user_allow_viewonline tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- user_allow_viewemail tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- user_allow_massemail tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- user_options int(11) UNSIGNED DEFAULT '230271' NOT NULL,
- user_avatar varchar(255) DEFAULT '' NOT NULL,
- user_avatar_type tinyint(2) DEFAULT '0' NOT NULL,
- user_avatar_width smallint(4) UNSIGNED DEFAULT '0' NOT NULL,
- user_avatar_height smallint(4) UNSIGNED DEFAULT '0' NOT NULL,
- user_sig mediumtext NOT NULL,
- user_sig_bbcode_uid varchar(8) DEFAULT '' NOT NULL,
- user_sig_bbcode_bitfield varchar(255) DEFAULT '' NOT NULL,
- user_from varchar(100) DEFAULT '' NOT NULL,
- user_icq varchar(15) DEFAULT '' NOT NULL,
- user_aim varchar(255) DEFAULT '' NOT NULL,
- user_yim varchar(255) DEFAULT '' NOT NULL,
- user_msnm varchar(255) DEFAULT '' NOT NULL,
- user_jabber varchar(255) DEFAULT '' NOT NULL,
- user_website varchar(200) DEFAULT '' NOT NULL,
- user_occ text NOT NULL,
- user_interests text NOT NULL,
- user_actkey varchar(32) DEFAULT '' NOT NULL,
- user_newpasswd varchar(40) DEFAULT '' NOT NULL,
- user_form_salt varchar(32) DEFAULT '' NOT NULL,
- user_new tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- user_reminded tinyint(4) DEFAULT '0' NOT NULL,
- user_reminded_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
- PRIMARY KEY (user_id),
- KEY user_birthday (user_birthday),
- KEY user_email_hash (user_email_hash),
- KEY user_type (user_type),
- UNIQUE username_clean (username_clean)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
-# Table: 'phpbb_warnings'
-CREATE TABLE phpbb_warnings (
- warning_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- post_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- log_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- warning_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
- PRIMARY KEY (warning_id)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
-# Table: 'phpbb_words'
-CREATE TABLE phpbb_words (
- word_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- word varchar(255) DEFAULT '' NOT NULL,
- replacement varchar(255) DEFAULT '' NOT NULL,
- PRIMARY KEY (word_id)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
-# Table: 'phpbb_zebra'
-CREATE TABLE phpbb_zebra (
- user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- zebra_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- friend tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- foe tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- PRIMARY KEY (user_id, zebra_id)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
diff --git a/phpBB/install/schemas/oracle_schema.sql b/phpBB/install/schemas/oracle_schema.sql
index af7b2b60ec..2473d31aab 100644
--- a/phpBB/install/schemas/oracle_schema.sql
+++ b/phpBB/install/schemas/oracle_schema.sql
@@ -1,12 +1,4 @@
/*
- * DO NOT EDIT THIS FILE, IT IS GENERATED
- *
- * To change the contents of this file, edit
- * phpBB/develop/create_schema_files.php and
- * run it.
- */
-
-/*
This first section is optional, however its probably the best method
of running phpBB on Oracle. If you already have a tablespace and user created
for phpBB you can leave this section commented out!
@@ -43,1882 +35,3 @@ DISCONNECT;
CONNECT phpbb/phpbb_password;
*/
-/*
- Table: 'phpbb_attachments'
-*/
-CREATE TABLE phpbb_attachments (
- attach_id number(8) NOT NULL,
- post_msg_id number(8) DEFAULT '0' NOT NULL,
- topic_id number(8) DEFAULT '0' NOT NULL,
- in_message number(1) DEFAULT '0' NOT NULL,
- poster_id number(8) DEFAULT '0' NOT NULL,
- is_orphan number(1) DEFAULT '1' NOT NULL,
- physical_filename varchar2(255) DEFAULT '' ,
- real_filename varchar2(255) DEFAULT '' ,
- download_count number(8) DEFAULT '0' NOT NULL,
- attach_comment clob DEFAULT '' ,
- extension varchar2(100) DEFAULT '' ,
- mimetype varchar2(100) DEFAULT '' ,
- filesize number(20) DEFAULT '0' NOT NULL,
- filetime number(11) DEFAULT '0' NOT NULL,
- thumbnail number(1) DEFAULT '0' NOT NULL,
- CONSTRAINT pk_phpbb_attachments PRIMARY KEY (attach_id)
-)
-/
-
-CREATE INDEX phpbb_attachments_filetime ON phpbb_attachments (filetime)
-/
-CREATE INDEX phpbb_attachments_post_msg_id ON phpbb_attachments (post_msg_id)
-/
-CREATE INDEX phpbb_attachments_topic_id ON phpbb_attachments (topic_id)
-/
-CREATE INDEX phpbb_attachments_poster_id ON phpbb_attachments (poster_id)
-/
-CREATE INDEX phpbb_attachments_is_orphan ON phpbb_attachments (is_orphan)
-/
-
-CREATE SEQUENCE phpbb_attachments_seq
-/
-
-CREATE OR REPLACE TRIGGER t_phpbb_attachments
-BEFORE INSERT ON phpbb_attachments
-FOR EACH ROW WHEN (
- new.attach_id IS NULL OR new.attach_id = 0
-)
-BEGIN
- SELECT phpbb_attachments_seq.nextval
- INTO :new.attach_id
- FROM dual;
-END;
-/
-
-
-/*
- Table: 'phpbb_acl_groups'
-*/
-CREATE TABLE phpbb_acl_groups (
- group_id number(8) DEFAULT '0' NOT NULL,
- forum_id number(8) DEFAULT '0' NOT NULL,
- auth_option_id number(8) DEFAULT '0' NOT NULL,
- auth_role_id number(8) DEFAULT '0' NOT NULL,
- auth_setting number(2) DEFAULT '0' NOT NULL
-)
-/
-
-CREATE INDEX phpbb_acl_groups_group_id ON phpbb_acl_groups (group_id)
-/
-CREATE INDEX phpbb_acl_groups_auth_opt_id ON phpbb_acl_groups (auth_option_id)
-/
-CREATE INDEX phpbb_acl_groups_auth_role_id ON phpbb_acl_groups (auth_role_id)
-/
-
-/*
- Table: 'phpbb_acl_options'
-*/
-CREATE TABLE phpbb_acl_options (
- auth_option_id number(8) NOT NULL,
- auth_option varchar2(50) DEFAULT '' ,
- is_global number(1) DEFAULT '0' NOT NULL,
- is_local number(1) DEFAULT '0' NOT NULL,
- founder_only number(1) DEFAULT '0' NOT NULL,
- CONSTRAINT pk_phpbb_acl_options PRIMARY KEY (auth_option_id),
- CONSTRAINT u_phpbb_auth_option UNIQUE (auth_option)
-)
-/
-
-
-CREATE SEQUENCE phpbb_acl_options_seq
-/
-
-CREATE OR REPLACE TRIGGER t_phpbb_acl_options
-BEFORE INSERT ON phpbb_acl_options
-FOR EACH ROW WHEN (
- new.auth_option_id IS NULL OR new.auth_option_id = 0
-)
-BEGIN
- SELECT phpbb_acl_options_seq.nextval
- INTO :new.auth_option_id
- FROM dual;
-END;
-/
-
-
-/*
- Table: 'phpbb_acl_roles'
-*/
-CREATE TABLE phpbb_acl_roles (
- role_id number(8) NOT NULL,
- role_name varchar2(765) DEFAULT '' ,
- role_description clob DEFAULT '' ,
- role_type varchar2(10) DEFAULT '' ,
- role_order number(4) DEFAULT '0' NOT NULL,
- CONSTRAINT pk_phpbb_acl_roles PRIMARY KEY (role_id)
-)
-/
-
-CREATE INDEX phpbb_acl_roles_role_type ON phpbb_acl_roles (role_type)
-/
-CREATE INDEX phpbb_acl_roles_role_order ON phpbb_acl_roles (role_order)
-/
-
-CREATE SEQUENCE phpbb_acl_roles_seq
-/
-
-CREATE OR REPLACE TRIGGER t_phpbb_acl_roles
-BEFORE INSERT ON phpbb_acl_roles
-FOR EACH ROW WHEN (
- new.role_id IS NULL OR new.role_id = 0
-)
-BEGIN
- SELECT phpbb_acl_roles_seq.nextval
- INTO :new.role_id
- FROM dual;
-END;
-/
-
-
-/*
- Table: 'phpbb_acl_roles_data'
-*/
-CREATE TABLE phpbb_acl_roles_data (
- role_id number(8) DEFAULT '0' NOT NULL,
- auth_option_id number(8) DEFAULT '0' NOT NULL,
- auth_setting number(2) DEFAULT '0' NOT NULL,
- CONSTRAINT pk_phpbb_acl_roles_data PRIMARY KEY (role_id, auth_option_id)
-)
-/
-
-CREATE INDEX phpbb_acl_roles_data_ath_op_id ON phpbb_acl_roles_data (auth_option_id)
-/
-
-/*
- Table: 'phpbb_acl_users'
-*/
-CREATE TABLE phpbb_acl_users (
- user_id number(8) DEFAULT '0' NOT NULL,
- forum_id number(8) DEFAULT '0' NOT NULL,
- auth_option_id number(8) DEFAULT '0' NOT NULL,
- auth_role_id number(8) DEFAULT '0' NOT NULL,
- auth_setting number(2) DEFAULT '0' NOT NULL
-)
-/
-
-CREATE INDEX phpbb_acl_users_user_id ON phpbb_acl_users (user_id)
-/
-CREATE INDEX phpbb_acl_users_auth_option_id ON phpbb_acl_users (auth_option_id)
-/
-CREATE INDEX phpbb_acl_users_auth_role_id ON phpbb_acl_users (auth_role_id)
-/
-
-/*
- Table: 'phpbb_banlist'
-*/
-CREATE TABLE phpbb_banlist (
- ban_id number(8) NOT NULL,
- ban_userid number(8) DEFAULT '0' NOT NULL,
- ban_ip varchar2(40) DEFAULT '' ,
- ban_email varchar2(300) DEFAULT '' ,
- ban_start number(11) DEFAULT '0' NOT NULL,
- ban_end number(11) DEFAULT '0' NOT NULL,
- ban_exclude number(1) DEFAULT '0' NOT NULL,
- ban_reason varchar2(765) DEFAULT '' ,
- ban_give_reason varchar2(765) DEFAULT '' ,
- CONSTRAINT pk_phpbb_banlist PRIMARY KEY (ban_id)
-)
-/
-
-CREATE INDEX phpbb_banlist_ban_end ON phpbb_banlist (ban_end)
-/
-CREATE INDEX phpbb_banlist_ban_user ON phpbb_banlist (ban_userid, ban_exclude)
-/
-CREATE INDEX phpbb_banlist_ban_email ON phpbb_banlist (ban_email, ban_exclude)
-/
-CREATE INDEX phpbb_banlist_ban_ip ON phpbb_banlist (ban_ip, ban_exclude)
-/
-
-CREATE SEQUENCE phpbb_banlist_seq
-/
-
-CREATE OR REPLACE TRIGGER t_phpbb_banlist
-BEFORE INSERT ON phpbb_banlist
-FOR EACH ROW WHEN (
- new.ban_id IS NULL OR new.ban_id = 0
-)
-BEGIN
- SELECT phpbb_banlist_seq.nextval
- INTO :new.ban_id
- FROM dual;
-END;
-/
-
-
-/*
- Table: 'phpbb_bbcodes'
-*/
-CREATE TABLE phpbb_bbcodes (
- bbcode_id number(4) DEFAULT '0' NOT NULL,
- bbcode_tag varchar2(16) DEFAULT '' ,
- bbcode_helpline varchar2(765) DEFAULT '' ,
- display_on_posting number(1) DEFAULT '0' NOT NULL,
- bbcode_match clob DEFAULT '' ,
- bbcode_tpl clob DEFAULT '' ,
- first_pass_match clob DEFAULT '' ,
- first_pass_replace clob DEFAULT '' ,
- second_pass_match clob DEFAULT '' ,
- second_pass_replace clob DEFAULT '' ,
- CONSTRAINT pk_phpbb_bbcodes PRIMARY KEY (bbcode_id)
-)
-/
-
-CREATE INDEX phpbb_bbcodes_display_on_post ON phpbb_bbcodes (display_on_posting)
-/
-
-/*
- Table: 'phpbb_bookmarks'
-*/
-CREATE TABLE phpbb_bookmarks (
- topic_id number(8) DEFAULT '0' NOT NULL,
- user_id number(8) DEFAULT '0' NOT NULL,
- CONSTRAINT pk_phpbb_bookmarks PRIMARY KEY (topic_id, user_id)
-)
-/
-
-
-/*
- Table: 'phpbb_bots'
-*/
-CREATE TABLE phpbb_bots (
- bot_id number(8) NOT NULL,
- bot_active number(1) DEFAULT '1' NOT NULL,
- bot_name varchar2(765) DEFAULT '' ,
- user_id number(8) DEFAULT '0' NOT NULL,
- bot_agent varchar2(255) DEFAULT '' ,
- bot_ip varchar2(255) DEFAULT '' ,
- CONSTRAINT pk_phpbb_bots PRIMARY KEY (bot_id)
-)
-/
-
-CREATE INDEX phpbb_bots_bot_active ON phpbb_bots (bot_active)
-/
-
-CREATE SEQUENCE phpbb_bots_seq
-/
-
-CREATE OR REPLACE TRIGGER t_phpbb_bots
-BEFORE INSERT ON phpbb_bots
-FOR EACH ROW WHEN (
- new.bot_id IS NULL OR new.bot_id = 0
-)
-BEGIN
- SELECT phpbb_bots_seq.nextval
- INTO :new.bot_id
- FROM dual;
-END;
-/
-
-
-/*
- Table: 'phpbb_config'
-*/
-CREATE TABLE phpbb_config (
- config_name varchar2(255) DEFAULT '' ,
- config_value varchar2(765) DEFAULT '' ,
- is_dynamic number(1) DEFAULT '0' NOT NULL,
- CONSTRAINT pk_phpbb_config PRIMARY KEY (config_name)
-)
-/
-
-CREATE INDEX phpbb_config_is_dynamic ON phpbb_config (is_dynamic)
-/
-
-/*
- Table: 'phpbb_confirm'
-*/
-CREATE TABLE phpbb_confirm (
- confirm_id char(32) DEFAULT '' ,
- session_id char(32) DEFAULT '' ,
- confirm_type number(3) DEFAULT '0' NOT NULL,
- code varchar2(8) DEFAULT '' ,
- seed number(10) DEFAULT '0' NOT NULL,
- attempts number(8) DEFAULT '0' NOT NULL,
- CONSTRAINT pk_phpbb_confirm PRIMARY KEY (session_id, confirm_id)
-)
-/
-
-CREATE INDEX phpbb_confirm_confirm_type ON phpbb_confirm (confirm_type)
-/
-
-/*
- Table: 'phpbb_disallow'
-*/
-CREATE TABLE phpbb_disallow (
- disallow_id number(8) NOT NULL,
- disallow_username varchar2(765) DEFAULT '' ,
- CONSTRAINT pk_phpbb_disallow PRIMARY KEY (disallow_id)
-)
-/
-
-
-CREATE SEQUENCE phpbb_disallow_seq
-/
-
-CREATE OR REPLACE TRIGGER t_phpbb_disallow
-BEFORE INSERT ON phpbb_disallow
-FOR EACH ROW WHEN (
- new.disallow_id IS NULL OR new.disallow_id = 0
-)
-BEGIN
- SELECT phpbb_disallow_seq.nextval
- INTO :new.disallow_id
- FROM dual;
-END;
-/
-
-
-/*
- Table: 'phpbb_drafts'
-*/
-CREATE TABLE phpbb_drafts (
- draft_id number(8) NOT NULL,
- user_id number(8) DEFAULT '0' NOT NULL,
- topic_id number(8) DEFAULT '0' NOT NULL,
- forum_id number(8) DEFAULT '0' NOT NULL,
- save_time number(11) DEFAULT '0' NOT NULL,
- draft_subject varchar2(765) DEFAULT '' ,
- draft_message clob DEFAULT '' ,
- CONSTRAINT pk_phpbb_drafts PRIMARY KEY (draft_id)
-)
-/
-
-CREATE INDEX phpbb_drafts_save_time ON phpbb_drafts (save_time)
-/
-
-CREATE SEQUENCE phpbb_drafts_seq
-/
-
-CREATE OR REPLACE TRIGGER t_phpbb_drafts
-BEFORE INSERT ON phpbb_drafts
-FOR EACH ROW WHEN (
- new.draft_id IS NULL OR new.draft_id = 0
-)
-BEGIN
- SELECT phpbb_drafts_seq.nextval
- INTO :new.draft_id
- FROM dual;
-END;
-/
-
-
-/*
- Table: 'phpbb_extensions'
-*/
-CREATE TABLE phpbb_extensions (
- extension_id number(8) NOT NULL,
- group_id number(8) DEFAULT '0' NOT NULL,
- extension varchar2(100) DEFAULT '' ,
- CONSTRAINT pk_phpbb_extensions PRIMARY KEY (extension_id)
-)
-/
-
-
-CREATE SEQUENCE phpbb_extensions_seq
-/
-
-CREATE OR REPLACE TRIGGER t_phpbb_extensions
-BEFORE INSERT ON phpbb_extensions
-FOR EACH ROW WHEN (
- new.extension_id IS NULL OR new.extension_id = 0
-)
-BEGIN
- SELECT phpbb_extensions_seq.nextval
- INTO :new.extension_id
- FROM dual;
-END;
-/
-
-
-/*
- Table: 'phpbb_extension_groups'
-*/
-CREATE TABLE phpbb_extension_groups (
- group_id number(8) NOT NULL,
- group_name varchar2(765) DEFAULT '' ,
- cat_id number(2) DEFAULT '0' NOT NULL,
- allow_group number(1) DEFAULT '0' NOT NULL,
- download_mode number(1) DEFAULT '1' NOT NULL,
- upload_icon varchar2(255) DEFAULT '' ,
- max_filesize number(20) DEFAULT '0' NOT NULL,
- allowed_forums clob DEFAULT '' ,
- allow_in_pm number(1) DEFAULT '0' NOT NULL,
- CONSTRAINT pk_phpbb_extension_groups PRIMARY KEY (group_id)
-)
-/
-
-
-CREATE SEQUENCE phpbb_extension_groups_seq
-/
-
-CREATE OR REPLACE TRIGGER t_phpbb_extension_groups
-BEFORE INSERT ON phpbb_extension_groups
-FOR EACH ROW WHEN (
- new.group_id IS NULL OR new.group_id = 0
-)
-BEGIN
- SELECT phpbb_extension_groups_seq.nextval
- INTO :new.group_id
- FROM dual;
-END;
-/
-
-
-/*
- Table: 'phpbb_forums'
-*/
-CREATE TABLE phpbb_forums (
- forum_id number(8) NOT NULL,
- parent_id number(8) DEFAULT '0' NOT NULL,
- left_id number(8) DEFAULT '0' NOT NULL,
- right_id number(8) DEFAULT '0' NOT NULL,
- forum_parents clob DEFAULT '' ,
- forum_name varchar2(765) DEFAULT '' ,
- forum_desc clob DEFAULT '' ,
- forum_desc_bitfield varchar2(255) DEFAULT '' ,
- forum_desc_options number(11) DEFAULT '7' NOT NULL,
- forum_desc_uid varchar2(8) DEFAULT '' ,
- forum_link varchar2(765) DEFAULT '' ,
- forum_password varchar2(120) DEFAULT '' ,
- forum_style number(8) DEFAULT '0' NOT NULL,
- forum_image varchar2(255) DEFAULT '' ,
- forum_rules clob DEFAULT '' ,
- forum_rules_link varchar2(765) DEFAULT '' ,
- forum_rules_bitfield varchar2(255) DEFAULT '' ,
- forum_rules_options number(11) DEFAULT '7' NOT NULL,
- forum_rules_uid varchar2(8) DEFAULT '' ,
- forum_topics_per_page number(4) DEFAULT '0' NOT NULL,
- forum_type number(4) DEFAULT '0' NOT NULL,
- forum_status number(4) DEFAULT '0' NOT NULL,
- forum_posts number(8) DEFAULT '0' NOT NULL,
- forum_topics number(8) DEFAULT '0' NOT NULL,
- forum_topics_real number(8) DEFAULT '0' NOT NULL,
- forum_last_post_id number(8) DEFAULT '0' NOT NULL,
- forum_last_poster_id number(8) DEFAULT '0' NOT NULL,
- forum_last_post_subject varchar2(765) DEFAULT '' ,
- forum_last_post_time number(11) DEFAULT '0' NOT NULL,
- forum_last_poster_name varchar2(765) DEFAULT '' ,
- forum_last_poster_colour varchar2(6) DEFAULT '' ,
- forum_flags number(4) DEFAULT '32' NOT NULL,
- forum_options number(20) DEFAULT '0' NOT NULL,
- display_subforum_list number(1) DEFAULT '1' NOT NULL,
- display_on_index number(1) DEFAULT '1' NOT NULL,
- enable_indexing number(1) DEFAULT '1' NOT NULL,
- enable_icons number(1) DEFAULT '1' NOT NULL,
- enable_prune number(1) DEFAULT '0' NOT NULL,
- prune_next number(11) DEFAULT '0' NOT NULL,
- prune_days number(8) DEFAULT '0' NOT NULL,
- prune_viewed number(8) DEFAULT '0' NOT NULL,
- prune_freq number(8) DEFAULT '0' NOT NULL,
- CONSTRAINT pk_phpbb_forums PRIMARY KEY (forum_id)
-)
-/
-
-CREATE INDEX phpbb_forums_left_right_id ON phpbb_forums (left_id, right_id)
-/
-CREATE INDEX phpbb_forums_forum_lastpost_id ON phpbb_forums (forum_last_post_id)
-/
-
-CREATE SEQUENCE phpbb_forums_seq
-/
-
-CREATE OR REPLACE TRIGGER t_phpbb_forums
-BEFORE INSERT ON phpbb_forums
-FOR EACH ROW WHEN (
- new.forum_id IS NULL OR new.forum_id = 0
-)
-BEGIN
- SELECT phpbb_forums_seq.nextval
- INTO :new.forum_id
- FROM dual;
-END;
-/
-
-
-/*
- Table: 'phpbb_forums_access'
-*/
-CREATE TABLE phpbb_forums_access (
- forum_id number(8) DEFAULT '0' NOT NULL,
- user_id number(8) DEFAULT '0' NOT NULL,
- session_id char(32) DEFAULT '' ,
- CONSTRAINT pk_phpbb_forums_access PRIMARY KEY (forum_id, user_id, session_id)
-)
-/
-
-
-/*
- Table: 'phpbb_forums_track'
-*/
-CREATE TABLE phpbb_forums_track (
- user_id number(8) DEFAULT '0' NOT NULL,
- forum_id number(8) DEFAULT '0' NOT NULL,
- mark_time number(11) DEFAULT '0' NOT NULL,
- CONSTRAINT pk_phpbb_forums_track PRIMARY KEY (user_id, forum_id)
-)
-/
-
-
-/*
- Table: 'phpbb_forums_watch'
-*/
-CREATE TABLE phpbb_forums_watch (
- forum_id number(8) DEFAULT '0' NOT NULL,
- user_id number(8) DEFAULT '0' NOT NULL,
- notify_status number(1) DEFAULT '0' NOT NULL
-)
-/
-
-CREATE INDEX phpbb_forums_watch_forum_id ON phpbb_forums_watch (forum_id)
-/
-CREATE INDEX phpbb_forums_watch_user_id ON phpbb_forums_watch (user_id)
-/
-CREATE INDEX phpbb_forums_watch_notify_stat ON phpbb_forums_watch (notify_status)
-/
-
-/*
- Table: 'phpbb_groups'
-*/
-CREATE TABLE phpbb_groups (
- group_id number(8) NOT NULL,
- group_type number(4) DEFAULT '1' NOT NULL,
- group_founder_manage number(1) DEFAULT '0' NOT NULL,
- group_skip_auth number(1) DEFAULT '0' NOT NULL,
- group_name varchar2(255) DEFAULT '' ,
- group_desc clob DEFAULT '' ,
- group_desc_bitfield varchar2(255) DEFAULT '' ,
- group_desc_options number(11) DEFAULT '7' NOT NULL,
- group_desc_uid varchar2(8) DEFAULT '' ,
- group_display number(1) DEFAULT '0' NOT NULL,
- group_avatar varchar2(255) DEFAULT '' ,
- group_avatar_type number(2) DEFAULT '0' NOT NULL,
- group_avatar_width number(4) DEFAULT '0' NOT NULL,
- group_avatar_height number(4) DEFAULT '0' NOT NULL,
- group_rank number(8) DEFAULT '0' NOT NULL,
- group_colour varchar2(6) DEFAULT '' ,
- group_sig_chars number(8) DEFAULT '0' NOT NULL,
- group_receive_pm number(1) DEFAULT '0' NOT NULL,
- group_message_limit number(8) DEFAULT '0' NOT NULL,
- group_max_recipients number(8) DEFAULT '0' NOT NULL,
- group_legend number(1) DEFAULT '1' NOT NULL,
- CONSTRAINT pk_phpbb_groups PRIMARY KEY (group_id)
-)
-/
-
-CREATE INDEX phpbb_groups_group_legend_name ON phpbb_groups (group_legend, group_name)
-/
-
-CREATE SEQUENCE phpbb_groups_seq
-/
-
-CREATE OR REPLACE TRIGGER t_phpbb_groups
-BEFORE INSERT ON phpbb_groups
-FOR EACH ROW WHEN (
- new.group_id IS NULL OR new.group_id = 0
-)
-BEGIN
- SELECT phpbb_groups_seq.nextval
- INTO :new.group_id
- FROM dual;
-END;
-/
-
-
-/*
- Table: 'phpbb_icons'
-*/
-CREATE TABLE phpbb_icons (
- icons_id number(8) NOT NULL,
- icons_url varchar2(255) DEFAULT '' ,
- icons_width number(4) DEFAULT '0' NOT NULL,
- icons_height number(4) DEFAULT '0' NOT NULL,
- icons_order number(8) DEFAULT '0' NOT NULL,
- display_on_posting number(1) DEFAULT '1' NOT NULL,
- CONSTRAINT pk_phpbb_icons PRIMARY KEY (icons_id)
-)
-/
-
-CREATE INDEX phpbb_icons_display_on_posting ON phpbb_icons (display_on_posting)
-/
-
-CREATE SEQUENCE phpbb_icons_seq
-/
-
-CREATE OR REPLACE TRIGGER t_phpbb_icons
-BEFORE INSERT ON phpbb_icons
-FOR EACH ROW WHEN (
- new.icons_id IS NULL OR new.icons_id = 0
-)
-BEGIN
- SELECT phpbb_icons_seq.nextval
- INTO :new.icons_id
- FROM dual;
-END;
-/
-
-
-/*
- Table: 'phpbb_lang'
-*/
-CREATE TABLE phpbb_lang (
- lang_id number(4) NOT NULL,
- lang_iso varchar2(30) DEFAULT '' ,
- lang_dir varchar2(30) DEFAULT '' ,
- lang_english_name varchar2(300) DEFAULT '' ,
- lang_local_name varchar2(765) DEFAULT '' ,
- lang_author varchar2(765) DEFAULT '' ,
- CONSTRAINT pk_phpbb_lang PRIMARY KEY (lang_id)
-)
-/
-
-CREATE INDEX phpbb_lang_lang_iso ON phpbb_lang (lang_iso)
-/
-
-CREATE SEQUENCE phpbb_lang_seq
-/
-
-CREATE OR REPLACE TRIGGER t_phpbb_lang
-BEFORE INSERT ON phpbb_lang
-FOR EACH ROW WHEN (
- new.lang_id IS NULL OR new.lang_id = 0
-)
-BEGIN
- SELECT phpbb_lang_seq.nextval
- INTO :new.lang_id
- FROM dual;
-END;
-/
-
-
-/*
- Table: 'phpbb_log'
-*/
-CREATE TABLE phpbb_log (
- log_id number(8) NOT NULL,
- log_type number(4) DEFAULT '0' NOT NULL,
- user_id number(8) DEFAULT '0' NOT NULL,
- forum_id number(8) DEFAULT '0' NOT NULL,
- topic_id number(8) DEFAULT '0' NOT NULL,
- reportee_id number(8) DEFAULT '0' NOT NULL,
- log_ip varchar2(40) DEFAULT '' ,
- log_time number(11) DEFAULT '0' NOT NULL,
- log_operation clob DEFAULT '' ,
- log_data clob DEFAULT '' ,
- CONSTRAINT pk_phpbb_log PRIMARY KEY (log_id)
-)
-/
-
-CREATE INDEX phpbb_log_log_type ON phpbb_log (log_type)
-/
-CREATE INDEX phpbb_log_forum_id ON phpbb_log (forum_id)
-/
-CREATE INDEX phpbb_log_topic_id ON phpbb_log (topic_id)
-/
-CREATE INDEX phpbb_log_reportee_id ON phpbb_log (reportee_id)
-/
-CREATE INDEX phpbb_log_user_id ON phpbb_log (user_id)
-/
-
-CREATE SEQUENCE phpbb_log_seq
-/
-
-CREATE OR REPLACE TRIGGER t_phpbb_log
-BEFORE INSERT ON phpbb_log
-FOR EACH ROW WHEN (
- new.log_id IS NULL OR new.log_id = 0
-)
-BEGIN
- SELECT phpbb_log_seq.nextval
- INTO :new.log_id
- FROM dual;
-END;
-/
-
-
-/*
- Table: 'phpbb_login_attempts'
-*/
-CREATE TABLE phpbb_login_attempts (
- attempt_ip varchar2(40) DEFAULT '' ,
- attempt_browser varchar2(150) DEFAULT '' ,
- attempt_forwarded_for varchar2(255) DEFAULT '' ,
- attempt_time number(11) DEFAULT '0' NOT NULL,
- user_id number(8) DEFAULT '0' NOT NULL,
- username varchar2(765) DEFAULT '0' NOT NULL,
- username_clean varchar2(255) DEFAULT '0' NOT NULL
-)
-/
-
-CREATE INDEX phpbb_login_attempts_att_ip ON phpbb_login_attempts (attempt_ip, attempt_time)
-/
-CREATE INDEX phpbb_login_attempts_att_for ON phpbb_login_attempts (attempt_forwarded_for, attempt_time)
-/
-CREATE INDEX phpbb_login_attempts_att_time ON phpbb_login_attempts (attempt_time)
-/
-CREATE INDEX phpbb_login_attempts_user_id ON phpbb_login_attempts (user_id)
-/
-
-/*
- Table: 'phpbb_moderator_cache'
-*/
-CREATE TABLE phpbb_moderator_cache (
- forum_id number(8) DEFAULT '0' NOT NULL,
- user_id number(8) DEFAULT '0' NOT NULL,
- username varchar2(765) DEFAULT '' ,
- group_id number(8) DEFAULT '0' NOT NULL,
- group_name varchar2(765) DEFAULT '' ,
- display_on_index number(1) DEFAULT '1' NOT NULL
-)
-/
-
-CREATE INDEX phpbb_moderator_cache_disp_idx ON phpbb_moderator_cache (display_on_index)
-/
-CREATE INDEX phpbb_moderator_cache_forum_id ON phpbb_moderator_cache (forum_id)
-/
-
-/*
- Table: 'phpbb_modules'
-*/
-CREATE TABLE phpbb_modules (
- module_id number(8) NOT NULL,
- module_enabled number(1) DEFAULT '1' NOT NULL,
- module_display number(1) DEFAULT '1' NOT NULL,
- module_basename varchar2(255) DEFAULT '' ,
- module_class varchar2(10) DEFAULT '' ,
- parent_id number(8) DEFAULT '0' NOT NULL,
- left_id number(8) DEFAULT '0' NOT NULL,
- right_id number(8) DEFAULT '0' NOT NULL,
- module_langname varchar2(255) DEFAULT '' ,
- module_mode varchar2(255) DEFAULT '' ,
- module_auth varchar2(255) DEFAULT '' ,
- CONSTRAINT pk_phpbb_modules PRIMARY KEY (module_id)
-)
-/
-
-CREATE INDEX phpbb_modules_left_right_id ON phpbb_modules (left_id, right_id)
-/
-CREATE INDEX phpbb_modules_module_enabled ON phpbb_modules (module_enabled)
-/
-CREATE INDEX phpbb_modules_class_left_id ON phpbb_modules (module_class, left_id)
-/
-
-CREATE SEQUENCE phpbb_modules_seq
-/
-
-CREATE OR REPLACE TRIGGER t_phpbb_modules
-BEFORE INSERT ON phpbb_modules
-FOR EACH ROW WHEN (
- new.module_id IS NULL OR new.module_id = 0
-)
-BEGIN
- SELECT phpbb_modules_seq.nextval
- INTO :new.module_id
- FROM dual;
-END;
-/
-
-
-/*
- Table: 'phpbb_poll_options'
-*/
-CREATE TABLE phpbb_poll_options (
- poll_option_id number(4) DEFAULT '0' NOT NULL,
- topic_id number(8) DEFAULT '0' NOT NULL,
- poll_option_text clob DEFAULT '' ,
- poll_option_total number(8) DEFAULT '0' NOT NULL
-)
-/
-
-CREATE INDEX phpbb_poll_options_poll_opt_id ON phpbb_poll_options (poll_option_id)
-/
-CREATE INDEX phpbb_poll_options_topic_id ON phpbb_poll_options (topic_id)
-/
-
-/*
- Table: 'phpbb_poll_votes'
-*/
-CREATE TABLE phpbb_poll_votes (
- topic_id number(8) DEFAULT '0' NOT NULL,
- poll_option_id number(4) DEFAULT '0' NOT NULL,
- vote_user_id number(8) DEFAULT '0' NOT NULL,
- vote_user_ip varchar2(40) DEFAULT ''
-)
-/
-
-CREATE INDEX phpbb_poll_votes_topic_id ON phpbb_poll_votes (topic_id)
-/
-CREATE INDEX phpbb_poll_votes_vote_user_id ON phpbb_poll_votes (vote_user_id)
-/
-CREATE INDEX phpbb_poll_votes_vote_user_ip ON phpbb_poll_votes (vote_user_ip)
-/
-
-/*
- Table: 'phpbb_posts'
-*/
-CREATE TABLE phpbb_posts (
- post_id number(8) NOT NULL,
- topic_id number(8) DEFAULT '0' NOT NULL,
- forum_id number(8) DEFAULT '0' NOT NULL,
- poster_id number(8) DEFAULT '0' NOT NULL,
- icon_id number(8) DEFAULT '0' NOT NULL,
- poster_ip varchar2(40) DEFAULT '' ,
- post_time number(11) DEFAULT '0' NOT NULL,
- post_approved number(1) DEFAULT '1' NOT NULL,
- post_reported number(1) DEFAULT '0' NOT NULL,
- enable_bbcode number(1) DEFAULT '1' NOT NULL,
- enable_smilies number(1) DEFAULT '1' NOT NULL,
- enable_magic_url number(1) DEFAULT '1' NOT NULL,
- enable_sig number(1) DEFAULT '1' NOT NULL,
- post_username varchar2(765) DEFAULT '' ,
- post_subject varchar2(765) DEFAULT '' ,
- post_text clob DEFAULT '' ,
- post_checksum varchar2(32) DEFAULT '' ,
- post_attachment number(1) DEFAULT '0' NOT NULL,
- bbcode_bitfield varchar2(255) DEFAULT '' ,
- bbcode_uid varchar2(8) DEFAULT '' ,
- post_postcount number(1) DEFAULT '1' NOT NULL,
- post_edit_time number(11) DEFAULT '0' NOT NULL,
- post_edit_reason varchar2(765) DEFAULT '' ,
- post_edit_user number(8) DEFAULT '0' NOT NULL,
- post_edit_count number(4) DEFAULT '0' NOT NULL,
- post_edit_locked number(1) DEFAULT '0' NOT NULL,
- CONSTRAINT pk_phpbb_posts PRIMARY KEY (post_id)
-)
-/
-
-CREATE INDEX phpbb_posts_forum_id ON phpbb_posts (forum_id)
-/
-CREATE INDEX phpbb_posts_topic_id ON phpbb_posts (topic_id)
-/
-CREATE INDEX phpbb_posts_poster_ip ON phpbb_posts (poster_ip)
-/
-CREATE INDEX phpbb_posts_poster_id ON phpbb_posts (poster_id)
-/
-CREATE INDEX phpbb_posts_post_approved ON phpbb_posts (post_approved)
-/
-CREATE INDEX phpbb_posts_post_username ON phpbb_posts (post_username)
-/
-CREATE INDEX phpbb_posts_tid_post_time ON phpbb_posts (topic_id, post_time)
-/
-
-CREATE SEQUENCE phpbb_posts_seq
-/
-
-CREATE OR REPLACE TRIGGER t_phpbb_posts
-BEFORE INSERT ON phpbb_posts
-FOR EACH ROW WHEN (
- new.post_id IS NULL OR new.post_id = 0
-)
-BEGIN
- SELECT phpbb_posts_seq.nextval
- INTO :new.post_id
- FROM dual;
-END;
-/
-
-
-/*
- Table: 'phpbb_privmsgs'
-*/
-CREATE TABLE phpbb_privmsgs (
- msg_id number(8) NOT NULL,
- root_level number(8) DEFAULT '0' NOT NULL,
- author_id number(8) DEFAULT '0' NOT NULL,
- icon_id number(8) DEFAULT '0' NOT NULL,
- author_ip varchar2(40) DEFAULT '' ,
- message_time number(11) DEFAULT '0' NOT NULL,
- enable_bbcode number(1) DEFAULT '1' NOT NULL,
- enable_smilies number(1) DEFAULT '1' NOT NULL,
- enable_magic_url number(1) DEFAULT '1' NOT NULL,
- enable_sig number(1) DEFAULT '1' NOT NULL,
- message_subject varchar2(765) DEFAULT '' ,
- message_text clob DEFAULT '' ,
- message_edit_reason varchar2(765) DEFAULT '' ,
- message_edit_user number(8) DEFAULT '0' NOT NULL,
- message_attachment number(1) DEFAULT '0' NOT NULL,
- bbcode_bitfield varchar2(255) DEFAULT '' ,
- bbcode_uid varchar2(8) DEFAULT '' ,
- message_edit_time number(11) DEFAULT '0' NOT NULL,
- message_edit_count number(4) DEFAULT '0' NOT NULL,
- to_address clob DEFAULT '' ,
- bcc_address clob DEFAULT '' ,
- message_reported number(1) DEFAULT '0' NOT NULL,
- CONSTRAINT pk_phpbb_privmsgs PRIMARY KEY (msg_id)
-)
-/
-
-CREATE INDEX phpbb_privmsgs_author_ip ON phpbb_privmsgs (author_ip)
-/
-CREATE INDEX phpbb_privmsgs_message_time ON phpbb_privmsgs (message_time)
-/
-CREATE INDEX phpbb_privmsgs_author_id ON phpbb_privmsgs (author_id)
-/
-CREATE INDEX phpbb_privmsgs_root_level ON phpbb_privmsgs (root_level)
-/
-
-CREATE SEQUENCE phpbb_privmsgs_seq
-/
-
-CREATE OR REPLACE TRIGGER t_phpbb_privmsgs
-BEFORE INSERT ON phpbb_privmsgs
-FOR EACH ROW WHEN (
- new.msg_id IS NULL OR new.msg_id = 0
-)
-BEGIN
- SELECT phpbb_privmsgs_seq.nextval
- INTO :new.msg_id
- FROM dual;
-END;
-/
-
-
-/*
- Table: 'phpbb_privmsgs_folder'
-*/
-CREATE TABLE phpbb_privmsgs_folder (
- folder_id number(8) NOT NULL,
- user_id number(8) DEFAULT '0' NOT NULL,
- folder_name varchar2(765) DEFAULT '' ,
- pm_count number(8) DEFAULT '0' NOT NULL,
- CONSTRAINT pk_phpbb_privmsgs_folder PRIMARY KEY (folder_id)
-)
-/
-
-CREATE INDEX phpbb_privmsgs_folder_user_id ON phpbb_privmsgs_folder (user_id)
-/
-
-CREATE SEQUENCE phpbb_privmsgs_folder_seq
-/
-
-CREATE OR REPLACE TRIGGER t_phpbb_privmsgs_folder
-BEFORE INSERT ON phpbb_privmsgs_folder
-FOR EACH ROW WHEN (
- new.folder_id IS NULL OR new.folder_id = 0
-)
-BEGIN
- SELECT phpbb_privmsgs_folder_seq.nextval
- INTO :new.folder_id
- FROM dual;
-END;
-/
-
-
-/*
- Table: 'phpbb_privmsgs_rules'
-*/
-CREATE TABLE phpbb_privmsgs_rules (
- rule_id number(8) NOT NULL,
- user_id number(8) DEFAULT '0' NOT NULL,
- rule_check number(8) DEFAULT '0' NOT NULL,
- rule_connection number(8) DEFAULT '0' NOT NULL,
- rule_string varchar2(765) DEFAULT '' ,
- rule_user_id number(8) DEFAULT '0' NOT NULL,
- rule_group_id number(8) DEFAULT '0' NOT NULL,
- rule_action number(8) DEFAULT '0' NOT NULL,
- rule_folder_id number(11) DEFAULT '0' NOT NULL,
- CONSTRAINT pk_phpbb_privmsgs_rules PRIMARY KEY (rule_id)
-)
-/
-
-CREATE INDEX phpbb_privmsgs_rules_user_id ON phpbb_privmsgs_rules (user_id)
-/
-
-CREATE SEQUENCE phpbb_privmsgs_rules_seq
-/
-
-CREATE OR REPLACE TRIGGER t_phpbb_privmsgs_rules
-BEFORE INSERT ON phpbb_privmsgs_rules
-FOR EACH ROW WHEN (
- new.rule_id IS NULL OR new.rule_id = 0
-)
-BEGIN
- SELECT phpbb_privmsgs_rules_seq.nextval
- INTO :new.rule_id
- FROM dual;
-END;
-/
-
-
-/*
- Table: 'phpbb_privmsgs_to'
-*/
-CREATE TABLE phpbb_privmsgs_to (
- msg_id number(8) DEFAULT '0' NOT NULL,
- user_id number(8) DEFAULT '0' NOT NULL,
- author_id number(8) DEFAULT '0' NOT NULL,
- pm_deleted number(1) DEFAULT '0' NOT NULL,
- pm_new number(1) DEFAULT '1' NOT NULL,
- pm_unread number(1) DEFAULT '1' NOT NULL,
- pm_replied number(1) DEFAULT '0' NOT NULL,
- pm_marked number(1) DEFAULT '0' NOT NULL,
- pm_forwarded number(1) DEFAULT '0' NOT NULL,
- folder_id number(11) DEFAULT '0' NOT NULL
-)
-/
-
-CREATE INDEX phpbb_privmsgs_to_msg_id ON phpbb_privmsgs_to (msg_id)
-/
-CREATE INDEX phpbb_privmsgs_to_author_id ON phpbb_privmsgs_to (author_id)
-/
-CREATE INDEX phpbb_privmsgs_to_usr_flder_id ON phpbb_privmsgs_to (user_id, folder_id)
-/
-
-/*
- Table: 'phpbb_profile_fields'
-*/
-CREATE TABLE phpbb_profile_fields (
- field_id number(8) NOT NULL,
- field_name varchar2(765) DEFAULT '' ,
- field_type number(4) DEFAULT '0' NOT NULL,
- field_ident varchar2(20) DEFAULT '' ,
- field_length varchar2(20) DEFAULT '' ,
- field_minlen varchar2(255) DEFAULT '' ,
- field_maxlen varchar2(255) DEFAULT '' ,
- field_novalue varchar2(765) DEFAULT '' ,
- field_default_value varchar2(765) DEFAULT '' ,
- field_validation varchar2(60) DEFAULT '' ,
- field_required number(1) DEFAULT '0' NOT NULL,
- field_show_novalue number(1) DEFAULT '0' NOT NULL,
- field_show_on_reg number(1) DEFAULT '0' NOT NULL,
- field_show_on_vt number(1) DEFAULT '0' NOT NULL,
- field_show_profile number(1) DEFAULT '0' NOT NULL,
- field_hide number(1) DEFAULT '0' NOT NULL,
- field_no_view number(1) DEFAULT '0' NOT NULL,
- field_active number(1) DEFAULT '0' NOT NULL,
- field_order number(8) DEFAULT '0' NOT NULL,
- CONSTRAINT pk_phpbb_profile_fields PRIMARY KEY (field_id)
-)
-/
-
-CREATE INDEX phpbb_profile_fields_fld_type ON phpbb_profile_fields (field_type)
-/
-CREATE INDEX phpbb_profile_fields_fld_ordr ON phpbb_profile_fields (field_order)
-/
-
-CREATE SEQUENCE phpbb_profile_fields_seq
-/
-
-CREATE OR REPLACE TRIGGER t_phpbb_profile_fields
-BEFORE INSERT ON phpbb_profile_fields
-FOR EACH ROW WHEN (
- new.field_id IS NULL OR new.field_id = 0
-)
-BEGIN
- SELECT phpbb_profile_fields_seq.nextval
- INTO :new.field_id
- FROM dual;
-END;
-/
-
-
-/*
- Table: 'phpbb_profile_fields_data'
-*/
-CREATE TABLE phpbb_profile_fields_data (
- user_id number(8) DEFAULT '0' NOT NULL,
- CONSTRAINT pk_phpbb_profile_fields_data PRIMARY KEY (user_id)
-)
-/
-
-
-/*
- Table: 'phpbb_profile_fields_lang'
-*/
-CREATE TABLE phpbb_profile_fields_lang (
- field_id number(8) DEFAULT '0' NOT NULL,
- lang_id number(8) DEFAULT '0' NOT NULL,
- option_id number(8) DEFAULT '0' NOT NULL,
- field_type number(4) DEFAULT '0' NOT NULL,
- lang_value varchar2(765) DEFAULT '' ,
- CONSTRAINT pk_phpbb_profile_fields_lang PRIMARY KEY (field_id, lang_id, option_id)
-)
-/
-
-
-/*
- Table: 'phpbb_profile_lang'
-*/
-CREATE TABLE phpbb_profile_lang (
- field_id number(8) DEFAULT '0' NOT NULL,
- lang_id number(8) DEFAULT '0' NOT NULL,
- lang_name varchar2(765) DEFAULT '' ,
- lang_explain clob DEFAULT '' ,
- lang_default_value varchar2(765) DEFAULT '' ,
- CONSTRAINT pk_phpbb_profile_lang PRIMARY KEY (field_id, lang_id)
-)
-/
-
-
-/*
- Table: 'phpbb_ranks'
-*/
-CREATE TABLE phpbb_ranks (
- rank_id number(8) NOT NULL,
- rank_title varchar2(765) DEFAULT '' ,
- rank_min number(8) DEFAULT '0' NOT NULL,
- rank_special number(1) DEFAULT '0' NOT NULL,
- rank_image varchar2(255) DEFAULT '' ,
- CONSTRAINT pk_phpbb_ranks PRIMARY KEY (rank_id)
-)
-/
-
-
-CREATE SEQUENCE phpbb_ranks_seq
-/
-
-CREATE OR REPLACE TRIGGER t_phpbb_ranks
-BEFORE INSERT ON phpbb_ranks
-FOR EACH ROW WHEN (
- new.rank_id IS NULL OR new.rank_id = 0
-)
-BEGIN
- SELECT phpbb_ranks_seq.nextval
- INTO :new.rank_id
- FROM dual;
-END;
-/
-
-
-/*
- Table: 'phpbb_reports'
-*/
-CREATE TABLE phpbb_reports (
- report_id number(8) NOT NULL,
- reason_id number(4) DEFAULT '0' NOT NULL,
- post_id number(8) DEFAULT '0' NOT NULL,
- pm_id number(8) DEFAULT '0' NOT NULL,
- user_id number(8) DEFAULT '0' NOT NULL,
- user_notify number(1) DEFAULT '0' NOT NULL,
- report_closed number(1) DEFAULT '0' NOT NULL,
- report_time number(11) DEFAULT '0' NOT NULL,
- report_text clob DEFAULT '' ,
- CONSTRAINT pk_phpbb_reports PRIMARY KEY (report_id)
-)
-/
-
-CREATE INDEX phpbb_reports_post_id ON phpbb_reports (post_id)
-/
-CREATE INDEX phpbb_reports_pm_id ON phpbb_reports (pm_id)
-/
-
-CREATE SEQUENCE phpbb_reports_seq
-/
-
-CREATE OR REPLACE TRIGGER t_phpbb_reports
-BEFORE INSERT ON phpbb_reports
-FOR EACH ROW WHEN (
- new.report_id IS NULL OR new.report_id = 0
-)
-BEGIN
- SELECT phpbb_reports_seq.nextval
- INTO :new.report_id
- FROM dual;
-END;
-/
-
-
-/*
- Table: 'phpbb_reports_reasons'
-*/
-CREATE TABLE phpbb_reports_reasons (
- reason_id number(4) NOT NULL,
- reason_title varchar2(765) DEFAULT '' ,
- reason_description clob DEFAULT '' ,
- reason_order number(4) DEFAULT '0' NOT NULL,
- CONSTRAINT pk_phpbb_reports_reasons PRIMARY KEY (reason_id)
-)
-/
-
-
-CREATE SEQUENCE phpbb_reports_reasons_seq
-/
-
-CREATE OR REPLACE TRIGGER t_phpbb_reports_reasons
-BEFORE INSERT ON phpbb_reports_reasons
-FOR EACH ROW WHEN (
- new.reason_id IS NULL OR new.reason_id = 0
-)
-BEGIN
- SELECT phpbb_reports_reasons_seq.nextval
- INTO :new.reason_id
- FROM dual;
-END;
-/
-
-
-/*
- Table: 'phpbb_search_results'
-*/
-CREATE TABLE phpbb_search_results (
- search_key varchar2(32) DEFAULT '' ,
- search_time number(11) DEFAULT '0' NOT NULL,
- search_keywords clob DEFAULT '' ,
- search_authors clob DEFAULT '' ,
- CONSTRAINT pk_phpbb_search_results PRIMARY KEY (search_key)
-)
-/
-
-
-/*
- Table: 'phpbb_search_wordlist'
-*/
-CREATE TABLE phpbb_search_wordlist (
- word_id number(8) NOT NULL,
- word_text varchar2(765) DEFAULT '' ,
- word_common number(1) DEFAULT '0' NOT NULL,
- word_count number(8) DEFAULT '0' NOT NULL,
- CONSTRAINT pk_phpbb_search_wordlist PRIMARY KEY (word_id),
- CONSTRAINT u_phpbb_wrd_txt UNIQUE (word_text)
-)
-/
-
-CREATE INDEX phpbb_search_wordlist_wrd_cnt ON phpbb_search_wordlist (word_count)
-/
-
-CREATE SEQUENCE phpbb_search_wordlist_seq
-/
-
-CREATE OR REPLACE TRIGGER t_phpbb_search_wordlist
-BEFORE INSERT ON phpbb_search_wordlist
-FOR EACH ROW WHEN (
- new.word_id IS NULL OR new.word_id = 0
-)
-BEGIN
- SELECT phpbb_search_wordlist_seq.nextval
- INTO :new.word_id
- FROM dual;
-END;
-/
-
-
-/*
- Table: 'phpbb_search_wordmatch'
-*/
-CREATE TABLE phpbb_search_wordmatch (
- post_id number(8) DEFAULT '0' NOT NULL,
- word_id number(8) DEFAULT '0' NOT NULL,
- title_match number(1) DEFAULT '0' NOT NULL,
- CONSTRAINT u_phpbb_unq_mtch UNIQUE (word_id, post_id, title_match)
-)
-/
-
-CREATE INDEX phpbb_search_wordmatch_word_id ON phpbb_search_wordmatch (word_id)
-/
-CREATE INDEX phpbb_search_wordmatch_post_id ON phpbb_search_wordmatch (post_id)
-/
-
-/*
- Table: 'phpbb_sessions'
-*/
-CREATE TABLE phpbb_sessions (
- session_id char(32) DEFAULT '' ,
- session_user_id number(8) DEFAULT '0' NOT NULL,
- session_forum_id number(8) DEFAULT '0' NOT NULL,
- session_last_visit number(11) DEFAULT '0' NOT NULL,
- session_start number(11) DEFAULT '0' NOT NULL,
- session_time number(11) DEFAULT '0' NOT NULL,
- session_ip varchar2(40) DEFAULT '' ,
- session_browser varchar2(150) DEFAULT '' ,
- session_forwarded_for varchar2(255) DEFAULT '' ,
- session_page varchar2(765) DEFAULT '' ,
- session_viewonline number(1) DEFAULT '1' NOT NULL,
- session_autologin number(1) DEFAULT '0' NOT NULL,
- session_admin number(1) DEFAULT '0' NOT NULL,
- CONSTRAINT pk_phpbb_sessions PRIMARY KEY (session_id)
-)
-/
-
-CREATE INDEX phpbb_sessions_session_time ON phpbb_sessions (session_time)
-/
-CREATE INDEX phpbb_sessions_session_user_id ON phpbb_sessions (session_user_id)
-/
-CREATE INDEX phpbb_sessions_session_fid ON phpbb_sessions (session_forum_id)
-/
-
-/*
- Table: 'phpbb_sessions_keys'
-*/
-CREATE TABLE phpbb_sessions_keys (
- key_id char(32) DEFAULT '' ,
- user_id number(8) DEFAULT '0' NOT NULL,
- last_ip varchar2(40) DEFAULT '' ,
- last_login number(11) DEFAULT '0' NOT NULL,
- CONSTRAINT pk_phpbb_sessions_keys PRIMARY KEY (key_id, user_id)
-)
-/
-
-CREATE INDEX phpbb_sessions_keys_last_login ON phpbb_sessions_keys (last_login)
-/
-
-/*
- Table: 'phpbb_sitelist'
-*/
-CREATE TABLE phpbb_sitelist (
- site_id number(8) NOT NULL,
- site_ip varchar2(40) DEFAULT '' ,
- site_hostname varchar2(255) DEFAULT '' ,
- ip_exclude number(1) DEFAULT '0' NOT NULL,
- CONSTRAINT pk_phpbb_sitelist PRIMARY KEY (site_id)
-)
-/
-
-
-CREATE SEQUENCE phpbb_sitelist_seq
-/
-
-CREATE OR REPLACE TRIGGER t_phpbb_sitelist
-BEFORE INSERT ON phpbb_sitelist
-FOR EACH ROW WHEN (
- new.site_id IS NULL OR new.site_id = 0
-)
-BEGIN
- SELECT phpbb_sitelist_seq.nextval
- INTO :new.site_id
- FROM dual;
-END;
-/
-
-
-/*
- Table: 'phpbb_smilies'
-*/
-CREATE TABLE phpbb_smilies (
- smiley_id number(8) NOT NULL,
- code varchar2(150) DEFAULT '' ,
- emotion varchar2(150) DEFAULT '' ,
- smiley_url varchar2(50) DEFAULT '' ,
- smiley_width number(4) DEFAULT '0' NOT NULL,
- smiley_height number(4) DEFAULT '0' NOT NULL,
- smiley_order number(8) DEFAULT '0' NOT NULL,
- display_on_posting number(1) DEFAULT '1' NOT NULL,
- CONSTRAINT pk_phpbb_smilies PRIMARY KEY (smiley_id)
-)
-/
-
-CREATE INDEX phpbb_smilies_display_on_post ON phpbb_smilies (display_on_posting)
-/
-
-CREATE SEQUENCE phpbb_smilies_seq
-/
-
-CREATE OR REPLACE TRIGGER t_phpbb_smilies
-BEFORE INSERT ON phpbb_smilies
-FOR EACH ROW WHEN (
- new.smiley_id IS NULL OR new.smiley_id = 0
-)
-BEGIN
- SELECT phpbb_smilies_seq.nextval
- INTO :new.smiley_id
- FROM dual;
-END;
-/
-
-
-/*
- Table: 'phpbb_styles'
-*/
-CREATE TABLE phpbb_styles (
- style_id number(8) NOT NULL,
- style_name varchar2(765) DEFAULT '' ,
- style_copyright varchar2(765) DEFAULT '' ,
- style_active number(1) DEFAULT '1' NOT NULL,
- template_id number(8) DEFAULT '0' NOT NULL,
- theme_id number(8) DEFAULT '0' NOT NULL,
- imageset_id number(8) DEFAULT '0' NOT NULL,
- CONSTRAINT pk_phpbb_styles PRIMARY KEY (style_id),
- CONSTRAINT u_phpbb_style_name UNIQUE (style_name)
-)
-/
-
-CREATE INDEX phpbb_styles_template_id ON phpbb_styles (template_id)
-/
-CREATE INDEX phpbb_styles_theme_id ON phpbb_styles (theme_id)
-/
-CREATE INDEX phpbb_styles_imageset_id ON phpbb_styles (imageset_id)
-/
-
-CREATE SEQUENCE phpbb_styles_seq
-/
-
-CREATE OR REPLACE TRIGGER t_phpbb_styles
-BEFORE INSERT ON phpbb_styles
-FOR EACH ROW WHEN (
- new.style_id IS NULL OR new.style_id = 0
-)
-BEGIN
- SELECT phpbb_styles_seq.nextval
- INTO :new.style_id
- FROM dual;
-END;
-/
-
-
-/*
- Table: 'phpbb_styles_template'
-*/
-CREATE TABLE phpbb_styles_template (
- template_id number(8) NOT NULL,
- template_name varchar2(765) DEFAULT '' ,
- template_copyright varchar2(765) DEFAULT '' ,
- template_path varchar2(100) DEFAULT '' ,
- bbcode_bitfield varchar2(255) DEFAULT 'kNg=' NOT NULL,
- template_storedb number(1) DEFAULT '0' NOT NULL,
- template_inherits_id number(4) DEFAULT '0' NOT NULL,
- template_inherit_path varchar2(255) DEFAULT '' ,
- CONSTRAINT pk_phpbb_styles_template PRIMARY KEY (template_id),
- CONSTRAINT u_phpbb_tmplte_nm UNIQUE (template_name)
-)
-/
-
-
-CREATE SEQUENCE phpbb_styles_template_seq
-/
-
-CREATE OR REPLACE TRIGGER t_phpbb_styles_template
-BEFORE INSERT ON phpbb_styles_template
-FOR EACH ROW WHEN (
- new.template_id IS NULL OR new.template_id = 0
-)
-BEGIN
- SELECT phpbb_styles_template_seq.nextval
- INTO :new.template_id
- FROM dual;
-END;
-/
-
-
-/*
- Table: 'phpbb_styles_template_data'
-*/
-CREATE TABLE phpbb_styles_template_data (
- template_id number(8) DEFAULT '0' NOT NULL,
- template_filename varchar2(100) DEFAULT '' ,
- template_included clob DEFAULT '' ,
- template_mtime number(11) DEFAULT '0' NOT NULL,
- template_data clob DEFAULT ''
-)
-/
-
-CREATE INDEX phpbb_styles_template_data_tid ON phpbb_styles_template_data (template_id)
-/
-CREATE INDEX phpbb_styles_template_data_tfn ON phpbb_styles_template_data (template_filename)
-/
-
-/*
- Table: 'phpbb_styles_theme'
-*/
-CREATE TABLE phpbb_styles_theme (
- theme_id number(8) NOT NULL,
- theme_name varchar2(765) DEFAULT '' ,
- theme_copyright varchar2(765) DEFAULT '' ,
- theme_path varchar2(100) DEFAULT '' ,
- theme_storedb number(1) DEFAULT '0' NOT NULL,
- theme_mtime number(11) DEFAULT '0' NOT NULL,
- theme_data clob DEFAULT '' ,
- CONSTRAINT pk_phpbb_styles_theme PRIMARY KEY (theme_id),
- CONSTRAINT u_phpbb_theme_name UNIQUE (theme_name)
-)
-/
-
-
-CREATE SEQUENCE phpbb_styles_theme_seq
-/
-
-CREATE OR REPLACE TRIGGER t_phpbb_styles_theme
-BEFORE INSERT ON phpbb_styles_theme
-FOR EACH ROW WHEN (
- new.theme_id IS NULL OR new.theme_id = 0
-)
-BEGIN
- SELECT phpbb_styles_theme_seq.nextval
- INTO :new.theme_id
- FROM dual;
-END;
-/
-
-
-/*
- Table: 'phpbb_styles_imageset'
-*/
-CREATE TABLE phpbb_styles_imageset (
- imageset_id number(8) NOT NULL,
- imageset_name varchar2(765) DEFAULT '' ,
- imageset_copyright varchar2(765) DEFAULT '' ,
- imageset_path varchar2(100) DEFAULT '' ,
- CONSTRAINT pk_phpbb_styles_imageset PRIMARY KEY (imageset_id),
- CONSTRAINT u_phpbb_imgset_nm UNIQUE (imageset_name)
-)
-/
-
-
-CREATE SEQUENCE phpbb_styles_imageset_seq
-/
-
-CREATE OR REPLACE TRIGGER t_phpbb_styles_imageset
-BEFORE INSERT ON phpbb_styles_imageset
-FOR EACH ROW WHEN (
- new.imageset_id IS NULL OR new.imageset_id = 0
-)
-BEGIN
- SELECT phpbb_styles_imageset_seq.nextval
- INTO :new.imageset_id
- FROM dual;
-END;
-/
-
-
-/*
- Table: 'phpbb_styles_imageset_data'
-*/
-CREATE TABLE phpbb_styles_imageset_data (
- image_id number(8) NOT NULL,
- image_name varchar2(200) DEFAULT '' ,
- image_filename varchar2(200) DEFAULT '' ,
- image_lang varchar2(30) DEFAULT '' ,
- image_height number(4) DEFAULT '0' NOT NULL,
- image_width number(4) DEFAULT '0' NOT NULL,
- imageset_id number(8) DEFAULT '0' NOT NULL,
- CONSTRAINT pk_phpbb_styles_imageset_data PRIMARY KEY (image_id)
-)
-/
-
-CREATE INDEX phpbb_styles_imageset_data_i_d ON phpbb_styles_imageset_data (imageset_id)
-/
-
-CREATE SEQUENCE phpbb_styles_imageset_data_seq
-/
-
-CREATE OR REPLACE TRIGGER t_phpbb_styles_imageset_data
-BEFORE INSERT ON phpbb_styles_imageset_data
-FOR EACH ROW WHEN (
- new.image_id IS NULL OR new.image_id = 0
-)
-BEGIN
- SELECT phpbb_styles_imageset_data_seq.nextval
- INTO :new.image_id
- FROM dual;
-END;
-/
-
-
-/*
- Table: 'phpbb_topics'
-*/
-CREATE TABLE phpbb_topics (
- topic_id number(8) NOT NULL,
- forum_id number(8) DEFAULT '0' NOT NULL,
- icon_id number(8) DEFAULT '0' NOT NULL,
- topic_attachment number(1) DEFAULT '0' NOT NULL,
- topic_approved number(1) DEFAULT '1' NOT NULL,
- topic_reported number(1) DEFAULT '0' NOT NULL,
- topic_title varchar2(765) DEFAULT '' ,
- topic_poster number(8) DEFAULT '0' NOT NULL,
- topic_time number(11) DEFAULT '0' NOT NULL,
- topic_time_limit number(11) DEFAULT '0' NOT NULL,
- topic_views number(8) DEFAULT '0' NOT NULL,
- topic_replies number(8) DEFAULT '0' NOT NULL,
- topic_replies_real number(8) DEFAULT '0' NOT NULL,
- topic_status number(3) DEFAULT '0' NOT NULL,
- topic_type number(3) DEFAULT '0' NOT NULL,
- topic_first_post_id number(8) DEFAULT '0' NOT NULL,
- topic_first_poster_name varchar2(765) DEFAULT '' ,
- topic_first_poster_colour varchar2(6) DEFAULT '' ,
- topic_last_post_id number(8) DEFAULT '0' NOT NULL,
- topic_last_poster_id number(8) DEFAULT '0' NOT NULL,
- topic_last_poster_name varchar2(765) DEFAULT '' ,
- topic_last_poster_colour varchar2(6) DEFAULT '' ,
- topic_last_post_subject varchar2(765) DEFAULT '' ,
- topic_last_post_time number(11) DEFAULT '0' NOT NULL,
- topic_last_view_time number(11) DEFAULT '0' NOT NULL,
- topic_moved_id number(8) DEFAULT '0' NOT NULL,
- topic_bumped number(1) DEFAULT '0' NOT NULL,
- topic_bumper number(8) DEFAULT '0' NOT NULL,
- poll_title varchar2(765) DEFAULT '' ,
- poll_start number(11) DEFAULT '0' NOT NULL,
- poll_length number(11) DEFAULT '0' NOT NULL,
- poll_max_options number(4) DEFAULT '1' NOT NULL,
- poll_last_vote number(11) DEFAULT '0' NOT NULL,
- poll_vote_change number(1) DEFAULT '0' NOT NULL,
- CONSTRAINT pk_phpbb_topics PRIMARY KEY (topic_id)
-)
-/
-
-CREATE INDEX phpbb_topics_forum_id ON phpbb_topics (forum_id)
-/
-CREATE INDEX phpbb_topics_forum_id_type ON phpbb_topics (forum_id, topic_type)
-/
-CREATE INDEX phpbb_topics_last_post_time ON phpbb_topics (topic_last_post_time)
-/
-CREATE INDEX phpbb_topics_topic_approved ON phpbb_topics (topic_approved)
-/
-CREATE INDEX phpbb_topics_forum_appr_last ON phpbb_topics (forum_id, topic_approved, topic_last_post_id)
-/
-CREATE INDEX phpbb_topics_fid_time_moved ON phpbb_topics (forum_id, topic_last_post_time, topic_moved_id)
-/
-
-CREATE SEQUENCE phpbb_topics_seq
-/
-
-CREATE OR REPLACE TRIGGER t_phpbb_topics
-BEFORE INSERT ON phpbb_topics
-FOR EACH ROW WHEN (
- new.topic_id IS NULL OR new.topic_id = 0
-)
-BEGIN
- SELECT phpbb_topics_seq.nextval
- INTO :new.topic_id
- FROM dual;
-END;
-/
-
-
-/*
- Table: 'phpbb_topics_track'
-*/
-CREATE TABLE phpbb_topics_track (
- user_id number(8) DEFAULT '0' NOT NULL,
- topic_id number(8) DEFAULT '0' NOT NULL,
- forum_id number(8) DEFAULT '0' NOT NULL,
- mark_time number(11) DEFAULT '0' NOT NULL,
- CONSTRAINT pk_phpbb_topics_track PRIMARY KEY (user_id, topic_id)
-)
-/
-
-CREATE INDEX phpbb_topics_track_topic_id ON phpbb_topics_track (topic_id)
-/
-CREATE INDEX phpbb_topics_track_forum_id ON phpbb_topics_track (forum_id)
-/
-
-/*
- Table: 'phpbb_topics_posted'
-*/
-CREATE TABLE phpbb_topics_posted (
- user_id number(8) DEFAULT '0' NOT NULL,
- topic_id number(8) DEFAULT '0' NOT NULL,
- topic_posted number(1) DEFAULT '0' NOT NULL,
- CONSTRAINT pk_phpbb_topics_posted PRIMARY KEY (user_id, topic_id)
-)
-/
-
-
-/*
- Table: 'phpbb_topics_watch'
-*/
-CREATE TABLE phpbb_topics_watch (
- topic_id number(8) DEFAULT '0' NOT NULL,
- user_id number(8) DEFAULT '0' NOT NULL,
- notify_status number(1) DEFAULT '0' NOT NULL
-)
-/
-
-CREATE INDEX phpbb_topics_watch_topic_id ON phpbb_topics_watch (topic_id)
-/
-CREATE INDEX phpbb_topics_watch_user_id ON phpbb_topics_watch (user_id)
-/
-CREATE INDEX phpbb_topics_watch_notify_stat ON phpbb_topics_watch (notify_status)
-/
-
-/*
- Table: 'phpbb_user_group'
-*/
-CREATE TABLE phpbb_user_group (
- group_id number(8) DEFAULT '0' NOT NULL,
- user_id number(8) DEFAULT '0' NOT NULL,
- group_leader number(1) DEFAULT '0' NOT NULL,
- user_pending number(1) DEFAULT '1' NOT NULL
-)
-/
-
-CREATE INDEX phpbb_user_group_group_id ON phpbb_user_group (group_id)
-/
-CREATE INDEX phpbb_user_group_user_id ON phpbb_user_group (user_id)
-/
-CREATE INDEX phpbb_user_group_group_leader ON phpbb_user_group (group_leader)
-/
-
-/*
- Table: 'phpbb_users'
-*/
-CREATE TABLE phpbb_users (
- user_id number(8) NOT NULL,
- user_type number(2) DEFAULT '0' NOT NULL,
- group_id number(8) DEFAULT '3' NOT NULL,
- user_permissions clob DEFAULT '' ,
- user_perm_from number(8) DEFAULT '0' NOT NULL,
- user_ip varchar2(40) DEFAULT '' ,
- user_regdate number(11) DEFAULT '0' NOT NULL,
- username varchar2(255) DEFAULT '' ,
- username_clean varchar2(255) DEFAULT '' ,
- user_password varchar2(120) DEFAULT '' ,
- user_passchg number(11) DEFAULT '0' NOT NULL,
- user_pass_convert number(1) DEFAULT '0' NOT NULL,
- user_email varchar2(300) DEFAULT '' ,
- user_email_hash number(20) DEFAULT '0' NOT NULL,
- user_birthday varchar2(10) DEFAULT '' ,
- user_lastvisit number(11) DEFAULT '0' NOT NULL,
- user_lastmark number(11) DEFAULT '0' NOT NULL,
- user_lastpost_time number(11) DEFAULT '0' NOT NULL,
- user_lastpage varchar2(600) DEFAULT '' ,
- user_last_confirm_key varchar2(10) DEFAULT '' ,
- user_last_search number(11) DEFAULT '0' NOT NULL,
- user_warnings number(4) DEFAULT '0' NOT NULL,
- user_last_warning number(11) DEFAULT '0' NOT NULL,
- user_login_attempts number(4) DEFAULT '0' NOT NULL,
- user_inactive_reason number(2) DEFAULT '0' NOT NULL,
- user_inactive_time number(11) DEFAULT '0' NOT NULL,
- user_posts number(8) DEFAULT '0' NOT NULL,
- user_lang varchar2(30) DEFAULT '' ,
- user_timezone number(5, 2) DEFAULT '0' NOT NULL,
- user_dst number(1) DEFAULT '0' NOT NULL,
- user_dateformat varchar2(90) DEFAULT 'd M Y H:i' NOT NULL,
- user_style number(8) DEFAULT '0' NOT NULL,
- user_rank number(8) DEFAULT '0' NOT NULL,
- user_colour varchar2(6) DEFAULT '' ,
- user_new_privmsg number(4) DEFAULT '0' NOT NULL,
- user_unread_privmsg number(4) DEFAULT '0' NOT NULL,
- user_last_privmsg number(11) DEFAULT '0' NOT NULL,
- user_message_rules number(1) DEFAULT '0' NOT NULL,
- user_full_folder number(11) DEFAULT '-3' NOT NULL,
- user_emailtime number(11) DEFAULT '0' NOT NULL,
- user_topic_show_days number(4) DEFAULT '0' NOT NULL,
- user_topic_sortby_type varchar2(1) DEFAULT 't' NOT NULL,
- user_topic_sortby_dir varchar2(1) DEFAULT 'd' NOT NULL,
- user_post_show_days number(4) DEFAULT '0' NOT NULL,
- user_post_sortby_type varchar2(1) DEFAULT 't' NOT NULL,
- user_post_sortby_dir varchar2(1) DEFAULT 'a' NOT NULL,
- user_notify number(1) DEFAULT '0' NOT NULL,
- user_notify_pm number(1) DEFAULT '1' NOT NULL,
- user_notify_type number(4) DEFAULT '0' NOT NULL,
- user_allow_pm number(1) DEFAULT '1' NOT NULL,
- user_allow_viewonline number(1) DEFAULT '1' NOT NULL,
- user_allow_viewemail number(1) DEFAULT '1' NOT NULL,
- user_allow_massemail number(1) DEFAULT '1' NOT NULL,
- user_options number(11) DEFAULT '230271' NOT NULL,
- user_avatar varchar2(255) DEFAULT '' ,
- user_avatar_type number(2) DEFAULT '0' NOT NULL,
- user_avatar_width number(4) DEFAULT '0' NOT NULL,
- user_avatar_height number(4) DEFAULT '0' NOT NULL,
- user_sig clob DEFAULT '' ,
- user_sig_bbcode_uid varchar2(8) DEFAULT '' ,
- user_sig_bbcode_bitfield varchar2(255) DEFAULT '' ,
- user_from varchar2(300) DEFAULT '' ,
- user_icq varchar2(15) DEFAULT '' ,
- user_aim varchar2(765) DEFAULT '' ,
- user_yim varchar2(765) DEFAULT '' ,
- user_msnm varchar2(765) DEFAULT '' ,
- user_jabber varchar2(765) DEFAULT '' ,
- user_website varchar2(600) DEFAULT '' ,
- user_occ clob DEFAULT '' ,
- user_interests clob DEFAULT '' ,
- user_actkey varchar2(32) DEFAULT '' ,
- user_newpasswd varchar2(120) DEFAULT '' ,
- user_form_salt varchar2(96) DEFAULT '' ,
- user_new number(1) DEFAULT '1' NOT NULL,
- user_reminded number(4) DEFAULT '0' NOT NULL,
- user_reminded_time number(11) DEFAULT '0' NOT NULL,
- CONSTRAINT pk_phpbb_users PRIMARY KEY (user_id),
- CONSTRAINT u_phpbb_username_clean UNIQUE (username_clean)
-)
-/
-
-CREATE INDEX phpbb_users_user_birthday ON phpbb_users (user_birthday)
-/
-CREATE INDEX phpbb_users_user_email_hash ON phpbb_users (user_email_hash)
-/
-CREATE INDEX phpbb_users_user_type ON phpbb_users (user_type)
-/
-
-CREATE SEQUENCE phpbb_users_seq
-/
-
-CREATE OR REPLACE TRIGGER t_phpbb_users
-BEFORE INSERT ON phpbb_users
-FOR EACH ROW WHEN (
- new.user_id IS NULL OR new.user_id = 0
-)
-BEGIN
- SELECT phpbb_users_seq.nextval
- INTO :new.user_id
- FROM dual;
-END;
-/
-
-
-/*
- Table: 'phpbb_warnings'
-*/
-CREATE TABLE phpbb_warnings (
- warning_id number(8) NOT NULL,
- user_id number(8) DEFAULT '0' NOT NULL,
- post_id number(8) DEFAULT '0' NOT NULL,
- log_id number(8) DEFAULT '0' NOT NULL,
- warning_time number(11) DEFAULT '0' NOT NULL,
- CONSTRAINT pk_phpbb_warnings PRIMARY KEY (warning_id)
-)
-/
-
-
-CREATE SEQUENCE phpbb_warnings_seq
-/
-
-CREATE OR REPLACE TRIGGER t_phpbb_warnings
-BEFORE INSERT ON phpbb_warnings
-FOR EACH ROW WHEN (
- new.warning_id IS NULL OR new.warning_id = 0
-)
-BEGIN
- SELECT phpbb_warnings_seq.nextval
- INTO :new.warning_id
- FROM dual;
-END;
-/
-
-
-/*
- Table: 'phpbb_words'
-*/
-CREATE TABLE phpbb_words (
- word_id number(8) NOT NULL,
- word varchar2(765) DEFAULT '' ,
- replacement varchar2(765) DEFAULT '' ,
- CONSTRAINT pk_phpbb_words PRIMARY KEY (word_id)
-)
-/
-
-
-CREATE SEQUENCE phpbb_words_seq
-/
-
-CREATE OR REPLACE TRIGGER t_phpbb_words
-BEFORE INSERT ON phpbb_words
-FOR EACH ROW WHEN (
- new.word_id IS NULL OR new.word_id = 0
-)
-BEGIN
- SELECT phpbb_words_seq.nextval
- INTO :new.word_id
- FROM dual;
-END;
-/
-
-
-/*
- Table: 'phpbb_zebra'
-*/
-CREATE TABLE phpbb_zebra (
- user_id number(8) DEFAULT '0' NOT NULL,
- zebra_id number(8) DEFAULT '0' NOT NULL,
- friend number(1) DEFAULT '0' NOT NULL,
- foe number(1) DEFAULT '0' NOT NULL,
- CONSTRAINT pk_phpbb_zebra PRIMARY KEY (user_id, zebra_id)
-)
-/
-
-
diff --git a/phpBB/install/schemas/postgres_schema.sql b/phpBB/install/schemas/postgres_schema.sql
index 0a05a7cd75..65caba8d1c 100644
--- a/phpBB/install/schemas/postgres_schema.sql
+++ b/phpBB/install/schemas/postgres_schema.sql
@@ -1,10 +1,3 @@
-/*
- * DO NOT EDIT THIS FILE, IT IS GENERATED
- *
- * To change the contents of this file, edit
- * phpBB/develop/create_schema_files.php and
- * run it.
- */
BEGIN;
@@ -83,1230 +76,5 @@ CREATE OPERATOR =(
MERGES,
SORT1= <);
-/*
- Table: 'phpbb_attachments'
-*/
-CREATE SEQUENCE phpbb_attachments_seq;
-
-CREATE TABLE phpbb_attachments (
- attach_id INT4 DEFAULT nextval('phpbb_attachments_seq'),
- post_msg_id INT4 DEFAULT '0' NOT NULL CHECK (post_msg_id >= 0),
- topic_id INT4 DEFAULT '0' NOT NULL CHECK (topic_id >= 0),
- in_message INT2 DEFAULT '0' NOT NULL CHECK (in_message >= 0),
- poster_id INT4 DEFAULT '0' NOT NULL CHECK (poster_id >= 0),
- is_orphan INT2 DEFAULT '1' NOT NULL CHECK (is_orphan >= 0),
- physical_filename varchar(255) DEFAULT '' NOT NULL,
- real_filename varchar(255) DEFAULT '' NOT NULL,
- download_count INT4 DEFAULT '0' NOT NULL CHECK (download_count >= 0),
- attach_comment varchar(4000) DEFAULT '' NOT NULL,
- extension varchar(100) DEFAULT '' NOT NULL,
- mimetype varchar(100) DEFAULT '' NOT NULL,
- filesize INT4 DEFAULT '0' NOT NULL CHECK (filesize >= 0),
- filetime INT4 DEFAULT '0' NOT NULL CHECK (filetime >= 0),
- thumbnail INT2 DEFAULT '0' NOT NULL CHECK (thumbnail >= 0),
- PRIMARY KEY (attach_id)
-);
-
-CREATE INDEX phpbb_attachments_filetime ON phpbb_attachments (filetime);
-CREATE INDEX phpbb_attachments_post_msg_id ON phpbb_attachments (post_msg_id);
-CREATE INDEX phpbb_attachments_topic_id ON phpbb_attachments (topic_id);
-CREATE INDEX phpbb_attachments_poster_id ON phpbb_attachments (poster_id);
-CREATE INDEX phpbb_attachments_is_orphan ON phpbb_attachments (is_orphan);
-
-/*
- Table: 'phpbb_acl_groups'
-*/
-CREATE TABLE phpbb_acl_groups (
- group_id INT4 DEFAULT '0' NOT NULL CHECK (group_id >= 0),
- forum_id INT4 DEFAULT '0' NOT NULL CHECK (forum_id >= 0),
- auth_option_id INT4 DEFAULT '0' NOT NULL CHECK (auth_option_id >= 0),
- auth_role_id INT4 DEFAULT '0' NOT NULL CHECK (auth_role_id >= 0),
- auth_setting INT2 DEFAULT '0' NOT NULL
-);
-
-CREATE INDEX phpbb_acl_groups_group_id ON phpbb_acl_groups (group_id);
-CREATE INDEX phpbb_acl_groups_auth_opt_id ON phpbb_acl_groups (auth_option_id);
-CREATE INDEX phpbb_acl_groups_auth_role_id ON phpbb_acl_groups (auth_role_id);
-
-/*
- Table: 'phpbb_acl_options'
-*/
-CREATE SEQUENCE phpbb_acl_options_seq;
-
-CREATE TABLE phpbb_acl_options (
- auth_option_id INT4 DEFAULT nextval('phpbb_acl_options_seq'),
- auth_option varchar(50) DEFAULT '' NOT NULL,
- is_global INT2 DEFAULT '0' NOT NULL CHECK (is_global >= 0),
- is_local INT2 DEFAULT '0' NOT NULL CHECK (is_local >= 0),
- founder_only INT2 DEFAULT '0' NOT NULL CHECK (founder_only >= 0),
- PRIMARY KEY (auth_option_id)
-);
-
-CREATE UNIQUE INDEX phpbb_acl_options_auth_option ON phpbb_acl_options (auth_option);
-
-/*
- Table: 'phpbb_acl_roles'
-*/
-CREATE SEQUENCE phpbb_acl_roles_seq;
-
-CREATE TABLE phpbb_acl_roles (
- role_id INT4 DEFAULT nextval('phpbb_acl_roles_seq'),
- role_name varchar(255) DEFAULT '' NOT NULL,
- role_description varchar(4000) DEFAULT '' NOT NULL,
- role_type varchar(10) DEFAULT '' NOT NULL,
- role_order INT2 DEFAULT '0' NOT NULL CHECK (role_order >= 0),
- PRIMARY KEY (role_id)
-);
-
-CREATE INDEX phpbb_acl_roles_role_type ON phpbb_acl_roles (role_type);
-CREATE INDEX phpbb_acl_roles_role_order ON phpbb_acl_roles (role_order);
-
-/*
- Table: 'phpbb_acl_roles_data'
-*/
-CREATE TABLE phpbb_acl_roles_data (
- role_id INT4 DEFAULT '0' NOT NULL CHECK (role_id >= 0),
- auth_option_id INT4 DEFAULT '0' NOT NULL CHECK (auth_option_id >= 0),
- auth_setting INT2 DEFAULT '0' NOT NULL,
- PRIMARY KEY (role_id, auth_option_id)
-);
-
-CREATE INDEX phpbb_acl_roles_data_ath_op_id ON phpbb_acl_roles_data (auth_option_id);
-
-/*
- Table: 'phpbb_acl_users'
-*/
-CREATE TABLE phpbb_acl_users (
- user_id INT4 DEFAULT '0' NOT NULL CHECK (user_id >= 0),
- forum_id INT4 DEFAULT '0' NOT NULL CHECK (forum_id >= 0),
- auth_option_id INT4 DEFAULT '0' NOT NULL CHECK (auth_option_id >= 0),
- auth_role_id INT4 DEFAULT '0' NOT NULL CHECK (auth_role_id >= 0),
- auth_setting INT2 DEFAULT '0' NOT NULL
-);
-
-CREATE INDEX phpbb_acl_users_user_id ON phpbb_acl_users (user_id);
-CREATE INDEX phpbb_acl_users_auth_option_id ON phpbb_acl_users (auth_option_id);
-CREATE INDEX phpbb_acl_users_auth_role_id ON phpbb_acl_users (auth_role_id);
-
-/*
- Table: 'phpbb_banlist'
-*/
-CREATE SEQUENCE phpbb_banlist_seq;
-
-CREATE TABLE phpbb_banlist (
- ban_id INT4 DEFAULT nextval('phpbb_banlist_seq'),
- ban_userid INT4 DEFAULT '0' NOT NULL CHECK (ban_userid >= 0),
- ban_ip varchar(40) DEFAULT '' NOT NULL,
- ban_email varchar(100) DEFAULT '' NOT NULL,
- ban_start INT4 DEFAULT '0' NOT NULL CHECK (ban_start >= 0),
- ban_end INT4 DEFAULT '0' NOT NULL CHECK (ban_end >= 0),
- ban_exclude INT2 DEFAULT '0' NOT NULL CHECK (ban_exclude >= 0),
- ban_reason varchar(255) DEFAULT '' NOT NULL,
- ban_give_reason varchar(255) DEFAULT '' NOT NULL,
- PRIMARY KEY (ban_id)
-);
-
-CREATE INDEX phpbb_banlist_ban_end ON phpbb_banlist (ban_end);
-CREATE INDEX phpbb_banlist_ban_user ON phpbb_banlist (ban_userid, ban_exclude);
-CREATE INDEX phpbb_banlist_ban_email ON phpbb_banlist (ban_email, ban_exclude);
-CREATE INDEX phpbb_banlist_ban_ip ON phpbb_banlist (ban_ip, ban_exclude);
-
-/*
- Table: 'phpbb_bbcodes'
-*/
-CREATE TABLE phpbb_bbcodes (
- bbcode_id INT2 DEFAULT '0' NOT NULL CHECK (bbcode_id >= 0),
- bbcode_tag varchar(16) DEFAULT '' NOT NULL,
- bbcode_helpline varchar(255) DEFAULT '' NOT NULL,
- display_on_posting INT2 DEFAULT '0' NOT NULL CHECK (display_on_posting >= 0),
- bbcode_match varchar(4000) DEFAULT '' NOT NULL,
- bbcode_tpl TEXT DEFAULT '' NOT NULL,
- first_pass_match TEXT DEFAULT '' NOT NULL,
- first_pass_replace TEXT DEFAULT '' NOT NULL,
- second_pass_match TEXT DEFAULT '' NOT NULL,
- second_pass_replace TEXT DEFAULT '' NOT NULL,
- PRIMARY KEY (bbcode_id)
-);
-
-CREATE INDEX phpbb_bbcodes_display_on_post ON phpbb_bbcodes (display_on_posting);
-
-/*
- Table: 'phpbb_bookmarks'
-*/
-CREATE TABLE phpbb_bookmarks (
- topic_id INT4 DEFAULT '0' NOT NULL CHECK (topic_id >= 0),
- user_id INT4 DEFAULT '0' NOT NULL CHECK (user_id >= 0),
- PRIMARY KEY (topic_id, user_id)
-);
-
-
-/*
- Table: 'phpbb_bots'
-*/
-CREATE SEQUENCE phpbb_bots_seq;
-
-CREATE TABLE phpbb_bots (
- bot_id INT4 DEFAULT nextval('phpbb_bots_seq'),
- bot_active INT2 DEFAULT '1' NOT NULL CHECK (bot_active >= 0),
- bot_name varchar(255) DEFAULT '' NOT NULL,
- user_id INT4 DEFAULT '0' NOT NULL CHECK (user_id >= 0),
- bot_agent varchar(255) DEFAULT '' NOT NULL,
- bot_ip varchar(255) DEFAULT '' NOT NULL,
- PRIMARY KEY (bot_id)
-);
-
-CREATE INDEX phpbb_bots_bot_active ON phpbb_bots (bot_active);
-
-/*
- Table: 'phpbb_config'
-*/
-CREATE TABLE phpbb_config (
- config_name varchar(255) DEFAULT '' NOT NULL,
- config_value varchar(255) DEFAULT '' NOT NULL,
- is_dynamic INT2 DEFAULT '0' NOT NULL CHECK (is_dynamic >= 0),
- PRIMARY KEY (config_name)
-);
-
-CREATE INDEX phpbb_config_is_dynamic ON phpbb_config (is_dynamic);
-
-/*
- Table: 'phpbb_confirm'
-*/
-CREATE TABLE phpbb_confirm (
- confirm_id char(32) DEFAULT '' NOT NULL,
- session_id char(32) DEFAULT '' NOT NULL,
- confirm_type INT2 DEFAULT '0' NOT NULL,
- code varchar(8) DEFAULT '' NOT NULL,
- seed INT4 DEFAULT '0' NOT NULL CHECK (seed >= 0),
- attempts INT4 DEFAULT '0' NOT NULL CHECK (attempts >= 0),
- PRIMARY KEY (session_id, confirm_id)
-);
-
-CREATE INDEX phpbb_confirm_confirm_type ON phpbb_confirm (confirm_type);
-
-/*
- Table: 'phpbb_disallow'
-*/
-CREATE SEQUENCE phpbb_disallow_seq;
-
-CREATE TABLE phpbb_disallow (
- disallow_id INT4 DEFAULT nextval('phpbb_disallow_seq'),
- disallow_username varchar(255) DEFAULT '' NOT NULL,
- PRIMARY KEY (disallow_id)
-);
-
-
-/*
- Table: 'phpbb_drafts'
-*/
-CREATE SEQUENCE phpbb_drafts_seq;
-
-CREATE TABLE phpbb_drafts (
- draft_id INT4 DEFAULT nextval('phpbb_drafts_seq'),
- user_id INT4 DEFAULT '0' NOT NULL CHECK (user_id >= 0),
- topic_id INT4 DEFAULT '0' NOT NULL CHECK (topic_id >= 0),
- forum_id INT4 DEFAULT '0' NOT NULL CHECK (forum_id >= 0),
- save_time INT4 DEFAULT '0' NOT NULL CHECK (save_time >= 0),
- draft_subject varchar(255) DEFAULT '' NOT NULL,
- draft_message TEXT DEFAULT '' NOT NULL,
- PRIMARY KEY (draft_id)
-);
-
-CREATE INDEX phpbb_drafts_save_time ON phpbb_drafts (save_time);
-
-/*
- Table: 'phpbb_extensions'
-*/
-CREATE SEQUENCE phpbb_extensions_seq;
-
-CREATE TABLE phpbb_extensions (
- extension_id INT4 DEFAULT nextval('phpbb_extensions_seq'),
- group_id INT4 DEFAULT '0' NOT NULL CHECK (group_id >= 0),
- extension varchar(100) DEFAULT '' NOT NULL,
- PRIMARY KEY (extension_id)
-);
-
-
-/*
- Table: 'phpbb_extension_groups'
-*/
-CREATE SEQUENCE phpbb_extension_groups_seq;
-
-CREATE TABLE phpbb_extension_groups (
- group_id INT4 DEFAULT nextval('phpbb_extension_groups_seq'),
- group_name varchar(255) DEFAULT '' NOT NULL,
- cat_id INT2 DEFAULT '0' NOT NULL,
- allow_group INT2 DEFAULT '0' NOT NULL CHECK (allow_group >= 0),
- download_mode INT2 DEFAULT '1' NOT NULL CHECK (download_mode >= 0),
- upload_icon varchar(255) DEFAULT '' NOT NULL,
- max_filesize INT4 DEFAULT '0' NOT NULL CHECK (max_filesize >= 0),
- allowed_forums varchar(8000) DEFAULT '' NOT NULL,
- allow_in_pm INT2 DEFAULT '0' NOT NULL CHECK (allow_in_pm >= 0),
- PRIMARY KEY (group_id)
-);
-
-
-/*
- Table: 'phpbb_forums'
-*/
-CREATE SEQUENCE phpbb_forums_seq;
-
-CREATE TABLE phpbb_forums (
- forum_id INT4 DEFAULT nextval('phpbb_forums_seq'),
- parent_id INT4 DEFAULT '0' NOT NULL CHECK (parent_id >= 0),
- left_id INT4 DEFAULT '0' NOT NULL CHECK (left_id >= 0),
- right_id INT4 DEFAULT '0' NOT NULL CHECK (right_id >= 0),
- forum_parents TEXT DEFAULT '' NOT NULL,
- forum_name varchar(255) DEFAULT '' NOT NULL,
- forum_desc varchar(4000) DEFAULT '' NOT NULL,
- forum_desc_bitfield varchar(255) DEFAULT '' NOT NULL,
- forum_desc_options INT4 DEFAULT '7' NOT NULL CHECK (forum_desc_options >= 0),
- forum_desc_uid varchar(8) DEFAULT '' NOT NULL,
- forum_link varchar(255) DEFAULT '' NOT NULL,
- forum_password varchar(40) DEFAULT '' NOT NULL,
- forum_style INT4 DEFAULT '0' NOT NULL CHECK (forum_style >= 0),
- forum_image varchar(255) DEFAULT '' NOT NULL,
- forum_rules varchar(4000) DEFAULT '' NOT NULL,
- forum_rules_link varchar(255) DEFAULT '' NOT NULL,
- forum_rules_bitfield varchar(255) DEFAULT '' NOT NULL,
- forum_rules_options INT4 DEFAULT '7' NOT NULL CHECK (forum_rules_options >= 0),
- forum_rules_uid varchar(8) DEFAULT '' NOT NULL,
- forum_topics_per_page INT2 DEFAULT '0' NOT NULL,
- forum_type INT2 DEFAULT '0' NOT NULL,
- forum_status INT2 DEFAULT '0' NOT NULL,
- forum_posts INT4 DEFAULT '0' NOT NULL CHECK (forum_posts >= 0),
- forum_topics INT4 DEFAULT '0' NOT NULL CHECK (forum_topics >= 0),
- forum_topics_real INT4 DEFAULT '0' NOT NULL CHECK (forum_topics_real >= 0),
- forum_last_post_id INT4 DEFAULT '0' NOT NULL CHECK (forum_last_post_id >= 0),
- forum_last_poster_id INT4 DEFAULT '0' NOT NULL CHECK (forum_last_poster_id >= 0),
- forum_last_post_subject varchar(255) DEFAULT '' NOT NULL,
- forum_last_post_time INT4 DEFAULT '0' NOT NULL CHECK (forum_last_post_time >= 0),
- forum_last_poster_name varchar(255) DEFAULT '' NOT NULL,
- forum_last_poster_colour varchar(6) DEFAULT '' NOT NULL,
- forum_flags INT2 DEFAULT '32' NOT NULL,
- forum_options INT4 DEFAULT '0' NOT NULL CHECK (forum_options >= 0),
- display_subforum_list INT2 DEFAULT '1' NOT NULL CHECK (display_subforum_list >= 0),
- display_on_index INT2 DEFAULT '1' NOT NULL CHECK (display_on_index >= 0),
- enable_indexing INT2 DEFAULT '1' NOT NULL CHECK (enable_indexing >= 0),
- enable_icons INT2 DEFAULT '1' NOT NULL CHECK (enable_icons >= 0),
- enable_prune INT2 DEFAULT '0' NOT NULL CHECK (enable_prune >= 0),
- prune_next INT4 DEFAULT '0' NOT NULL CHECK (prune_next >= 0),
- prune_days INT4 DEFAULT '0' NOT NULL CHECK (prune_days >= 0),
- prune_viewed INT4 DEFAULT '0' NOT NULL CHECK (prune_viewed >= 0),
- prune_freq INT4 DEFAULT '0' NOT NULL CHECK (prune_freq >= 0),
- PRIMARY KEY (forum_id)
-);
-
-CREATE INDEX phpbb_forums_left_right_id ON phpbb_forums (left_id, right_id);
-CREATE INDEX phpbb_forums_forum_lastpost_id ON phpbb_forums (forum_last_post_id);
-
-/*
- Table: 'phpbb_forums_access'
-*/
-CREATE TABLE phpbb_forums_access (
- forum_id INT4 DEFAULT '0' NOT NULL CHECK (forum_id >= 0),
- user_id INT4 DEFAULT '0' NOT NULL CHECK (user_id >= 0),
- session_id char(32) DEFAULT '' NOT NULL,
- PRIMARY KEY (forum_id, user_id, session_id)
-);
-
-
-/*
- Table: 'phpbb_forums_track'
-*/
-CREATE TABLE phpbb_forums_track (
- user_id INT4 DEFAULT '0' NOT NULL CHECK (user_id >= 0),
- forum_id INT4 DEFAULT '0' NOT NULL CHECK (forum_id >= 0),
- mark_time INT4 DEFAULT '0' NOT NULL CHECK (mark_time >= 0),
- PRIMARY KEY (user_id, forum_id)
-);
-
-
-/*
- Table: 'phpbb_forums_watch'
-*/
-CREATE TABLE phpbb_forums_watch (
- forum_id INT4 DEFAULT '0' NOT NULL CHECK (forum_id >= 0),
- user_id INT4 DEFAULT '0' NOT NULL CHECK (user_id >= 0),
- notify_status INT2 DEFAULT '0' NOT NULL CHECK (notify_status >= 0)
-);
-
-CREATE INDEX phpbb_forums_watch_forum_id ON phpbb_forums_watch (forum_id);
-CREATE INDEX phpbb_forums_watch_user_id ON phpbb_forums_watch (user_id);
-CREATE INDEX phpbb_forums_watch_notify_stat ON phpbb_forums_watch (notify_status);
-
-/*
- Table: 'phpbb_groups'
-*/
-CREATE SEQUENCE phpbb_groups_seq;
-
-CREATE TABLE phpbb_groups (
- group_id INT4 DEFAULT nextval('phpbb_groups_seq'),
- group_type INT2 DEFAULT '1' NOT NULL,
- group_founder_manage INT2 DEFAULT '0' NOT NULL CHECK (group_founder_manage >= 0),
- group_skip_auth INT2 DEFAULT '0' NOT NULL CHECK (group_skip_auth >= 0),
- group_name varchar_ci DEFAULT '' NOT NULL,
- group_desc varchar(4000) DEFAULT '' NOT NULL,
- group_desc_bitfield varchar(255) DEFAULT '' NOT NULL,
- group_desc_options INT4 DEFAULT '7' NOT NULL CHECK (group_desc_options >= 0),
- group_desc_uid varchar(8) DEFAULT '' NOT NULL,
- group_display INT2 DEFAULT '0' NOT NULL CHECK (group_display >= 0),
- group_avatar varchar(255) DEFAULT '' NOT NULL,
- group_avatar_type INT2 DEFAULT '0' NOT NULL,
- group_avatar_width INT2 DEFAULT '0' NOT NULL CHECK (group_avatar_width >= 0),
- group_avatar_height INT2 DEFAULT '0' NOT NULL CHECK (group_avatar_height >= 0),
- group_rank INT4 DEFAULT '0' NOT NULL CHECK (group_rank >= 0),
- group_colour varchar(6) DEFAULT '' NOT NULL,
- group_sig_chars INT4 DEFAULT '0' NOT NULL CHECK (group_sig_chars >= 0),
- group_receive_pm INT2 DEFAULT '0' NOT NULL CHECK (group_receive_pm >= 0),
- group_message_limit INT4 DEFAULT '0' NOT NULL CHECK (group_message_limit >= 0),
- group_max_recipients INT4 DEFAULT '0' NOT NULL CHECK (group_max_recipients >= 0),
- group_legend INT2 DEFAULT '1' NOT NULL CHECK (group_legend >= 0),
- PRIMARY KEY (group_id)
-);
-
-CREATE INDEX phpbb_groups_group_legend_name ON phpbb_groups (group_legend, group_name);
-
-/*
- Table: 'phpbb_icons'
-*/
-CREATE SEQUENCE phpbb_icons_seq;
-
-CREATE TABLE phpbb_icons (
- icons_id INT4 DEFAULT nextval('phpbb_icons_seq'),
- icons_url varchar(255) DEFAULT '' NOT NULL,
- icons_width INT2 DEFAULT '0' NOT NULL,
- icons_height INT2 DEFAULT '0' NOT NULL,
- icons_order INT4 DEFAULT '0' NOT NULL CHECK (icons_order >= 0),
- display_on_posting INT2 DEFAULT '1' NOT NULL CHECK (display_on_posting >= 0),
- PRIMARY KEY (icons_id)
-);
-
-CREATE INDEX phpbb_icons_display_on_posting ON phpbb_icons (display_on_posting);
-
-/*
- Table: 'phpbb_lang'
-*/
-CREATE SEQUENCE phpbb_lang_seq;
-
-CREATE TABLE phpbb_lang (
- lang_id INT2 DEFAULT nextval('phpbb_lang_seq'),
- lang_iso varchar(30) DEFAULT '' NOT NULL,
- lang_dir varchar(30) DEFAULT '' NOT NULL,
- lang_english_name varchar(100) DEFAULT '' NOT NULL,
- lang_local_name varchar(255) DEFAULT '' NOT NULL,
- lang_author varchar(255) DEFAULT '' NOT NULL,
- PRIMARY KEY (lang_id)
-);
-
-CREATE INDEX phpbb_lang_lang_iso ON phpbb_lang (lang_iso);
-
-/*
- Table: 'phpbb_log'
-*/
-CREATE SEQUENCE phpbb_log_seq;
-
-CREATE TABLE phpbb_log (
- log_id INT4 DEFAULT nextval('phpbb_log_seq'),
- log_type INT2 DEFAULT '0' NOT NULL,
- user_id INT4 DEFAULT '0' NOT NULL CHECK (user_id >= 0),
- forum_id INT4 DEFAULT '0' NOT NULL CHECK (forum_id >= 0),
- topic_id INT4 DEFAULT '0' NOT NULL CHECK (topic_id >= 0),
- reportee_id INT4 DEFAULT '0' NOT NULL CHECK (reportee_id >= 0),
- log_ip varchar(40) DEFAULT '' NOT NULL,
- log_time INT4 DEFAULT '0' NOT NULL CHECK (log_time >= 0),
- log_operation varchar(4000) DEFAULT '' NOT NULL,
- log_data TEXT DEFAULT '' NOT NULL,
- PRIMARY KEY (log_id)
-);
-
-CREATE INDEX phpbb_log_log_type ON phpbb_log (log_type);
-CREATE INDEX phpbb_log_forum_id ON phpbb_log (forum_id);
-CREATE INDEX phpbb_log_topic_id ON phpbb_log (topic_id);
-CREATE INDEX phpbb_log_reportee_id ON phpbb_log (reportee_id);
-CREATE INDEX phpbb_log_user_id ON phpbb_log (user_id);
-
-/*
- Table: 'phpbb_login_attempts'
-*/
-CREATE TABLE phpbb_login_attempts (
- attempt_ip varchar(40) DEFAULT '' NOT NULL,
- attempt_browser varchar(150) DEFAULT '' NOT NULL,
- attempt_forwarded_for varchar(255) DEFAULT '' NOT NULL,
- attempt_time INT4 DEFAULT '0' NOT NULL CHECK (attempt_time >= 0),
- user_id INT4 DEFAULT '0' NOT NULL CHECK (user_id >= 0),
- username varchar(255) DEFAULT '0' NOT NULL,
- username_clean varchar_ci DEFAULT '0' NOT NULL
-);
-
-CREATE INDEX phpbb_login_attempts_att_ip ON phpbb_login_attempts (attempt_ip, attempt_time);
-CREATE INDEX phpbb_login_attempts_att_for ON phpbb_login_attempts (attempt_forwarded_for, attempt_time);
-CREATE INDEX phpbb_login_attempts_att_time ON phpbb_login_attempts (attempt_time);
-CREATE INDEX phpbb_login_attempts_user_id ON phpbb_login_attempts (user_id);
-
-/*
- Table: 'phpbb_moderator_cache'
-*/
-CREATE TABLE phpbb_moderator_cache (
- forum_id INT4 DEFAULT '0' NOT NULL CHECK (forum_id >= 0),
- user_id INT4 DEFAULT '0' NOT NULL CHECK (user_id >= 0),
- username varchar(255) DEFAULT '' NOT NULL,
- group_id INT4 DEFAULT '0' NOT NULL CHECK (group_id >= 0),
- group_name varchar(255) DEFAULT '' NOT NULL,
- display_on_index INT2 DEFAULT '1' NOT NULL CHECK (display_on_index >= 0)
-);
-
-CREATE INDEX phpbb_moderator_cache_disp_idx ON phpbb_moderator_cache (display_on_index);
-CREATE INDEX phpbb_moderator_cache_forum_id ON phpbb_moderator_cache (forum_id);
-
-/*
- Table: 'phpbb_modules'
-*/
-CREATE SEQUENCE phpbb_modules_seq;
-
-CREATE TABLE phpbb_modules (
- module_id INT4 DEFAULT nextval('phpbb_modules_seq'),
- module_enabled INT2 DEFAULT '1' NOT NULL CHECK (module_enabled >= 0),
- module_display INT2 DEFAULT '1' NOT NULL CHECK (module_display >= 0),
- module_basename varchar(255) DEFAULT '' NOT NULL,
- module_class varchar(10) DEFAULT '' NOT NULL,
- parent_id INT4 DEFAULT '0' NOT NULL CHECK (parent_id >= 0),
- left_id INT4 DEFAULT '0' NOT NULL CHECK (left_id >= 0),
- right_id INT4 DEFAULT '0' NOT NULL CHECK (right_id >= 0),
- module_langname varchar(255) DEFAULT '' NOT NULL,
- module_mode varchar(255) DEFAULT '' NOT NULL,
- module_auth varchar(255) DEFAULT '' NOT NULL,
- PRIMARY KEY (module_id)
-);
-
-CREATE INDEX phpbb_modules_left_right_id ON phpbb_modules (left_id, right_id);
-CREATE INDEX phpbb_modules_module_enabled ON phpbb_modules (module_enabled);
-CREATE INDEX phpbb_modules_class_left_id ON phpbb_modules (module_class, left_id);
-
-/*
- Table: 'phpbb_poll_options'
-*/
-CREATE TABLE phpbb_poll_options (
- poll_option_id INT2 DEFAULT '0' NOT NULL,
- topic_id INT4 DEFAULT '0' NOT NULL CHECK (topic_id >= 0),
- poll_option_text varchar(4000) DEFAULT '' NOT NULL,
- poll_option_total INT4 DEFAULT '0' NOT NULL CHECK (poll_option_total >= 0)
-);
-
-CREATE INDEX phpbb_poll_options_poll_opt_id ON phpbb_poll_options (poll_option_id);
-CREATE INDEX phpbb_poll_options_topic_id ON phpbb_poll_options (topic_id);
-
-/*
- Table: 'phpbb_poll_votes'
-*/
-CREATE TABLE phpbb_poll_votes (
- topic_id INT4 DEFAULT '0' NOT NULL CHECK (topic_id >= 0),
- poll_option_id INT2 DEFAULT '0' NOT NULL,
- vote_user_id INT4 DEFAULT '0' NOT NULL CHECK (vote_user_id >= 0),
- vote_user_ip varchar(40) DEFAULT '' NOT NULL
-);
-
-CREATE INDEX phpbb_poll_votes_topic_id ON phpbb_poll_votes (topic_id);
-CREATE INDEX phpbb_poll_votes_vote_user_id ON phpbb_poll_votes (vote_user_id);
-CREATE INDEX phpbb_poll_votes_vote_user_ip ON phpbb_poll_votes (vote_user_ip);
-
-/*
- Table: 'phpbb_posts'
-*/
-CREATE SEQUENCE phpbb_posts_seq;
-
-CREATE TABLE phpbb_posts (
- post_id INT4 DEFAULT nextval('phpbb_posts_seq'),
- topic_id INT4 DEFAULT '0' NOT NULL CHECK (topic_id >= 0),
- forum_id INT4 DEFAULT '0' NOT NULL CHECK (forum_id >= 0),
- poster_id INT4 DEFAULT '0' NOT NULL CHECK (poster_id >= 0),
- icon_id INT4 DEFAULT '0' NOT NULL CHECK (icon_id >= 0),
- poster_ip varchar(40) DEFAULT '' NOT NULL,
- post_time INT4 DEFAULT '0' NOT NULL CHECK (post_time >= 0),
- post_approved INT2 DEFAULT '1' NOT NULL CHECK (post_approved >= 0),
- post_reported INT2 DEFAULT '0' NOT NULL CHECK (post_reported >= 0),
- enable_bbcode INT2 DEFAULT '1' NOT NULL CHECK (enable_bbcode >= 0),
- enable_smilies INT2 DEFAULT '1' NOT NULL CHECK (enable_smilies >= 0),
- enable_magic_url INT2 DEFAULT '1' NOT NULL CHECK (enable_magic_url >= 0),
- enable_sig INT2 DEFAULT '1' NOT NULL CHECK (enable_sig >= 0),
- post_username varchar(255) DEFAULT '' NOT NULL,
- post_subject varchar(255) DEFAULT '' NOT NULL,
- post_text TEXT DEFAULT '' NOT NULL,
- post_checksum varchar(32) DEFAULT '' NOT NULL,
- post_attachment INT2 DEFAULT '0' NOT NULL CHECK (post_attachment >= 0),
- bbcode_bitfield varchar(255) DEFAULT '' NOT NULL,
- bbcode_uid varchar(8) DEFAULT '' NOT NULL,
- post_postcount INT2 DEFAULT '1' NOT NULL CHECK (post_postcount >= 0),
- post_edit_time INT4 DEFAULT '0' NOT NULL CHECK (post_edit_time >= 0),
- post_edit_reason varchar(255) DEFAULT '' NOT NULL,
- post_edit_user INT4 DEFAULT '0' NOT NULL CHECK (post_edit_user >= 0),
- post_edit_count INT2 DEFAULT '0' NOT NULL CHECK (post_edit_count >= 0),
- post_edit_locked INT2 DEFAULT '0' NOT NULL CHECK (post_edit_locked >= 0),
- PRIMARY KEY (post_id)
-);
-
-CREATE INDEX phpbb_posts_forum_id ON phpbb_posts (forum_id);
-CREATE INDEX phpbb_posts_topic_id ON phpbb_posts (topic_id);
-CREATE INDEX phpbb_posts_poster_ip ON phpbb_posts (poster_ip);
-CREATE INDEX phpbb_posts_poster_id ON phpbb_posts (poster_id);
-CREATE INDEX phpbb_posts_post_approved ON phpbb_posts (post_approved);
-CREATE INDEX phpbb_posts_post_username ON phpbb_posts (post_username);
-CREATE INDEX phpbb_posts_tid_post_time ON phpbb_posts (topic_id, post_time);
-
-/*
- Table: 'phpbb_privmsgs'
-*/
-CREATE SEQUENCE phpbb_privmsgs_seq;
-
-CREATE TABLE phpbb_privmsgs (
- msg_id INT4 DEFAULT nextval('phpbb_privmsgs_seq'),
- root_level INT4 DEFAULT '0' NOT NULL CHECK (root_level >= 0),
- author_id INT4 DEFAULT '0' NOT NULL CHECK (author_id >= 0),
- icon_id INT4 DEFAULT '0' NOT NULL CHECK (icon_id >= 0),
- author_ip varchar(40) DEFAULT '' NOT NULL,
- message_time INT4 DEFAULT '0' NOT NULL CHECK (message_time >= 0),
- enable_bbcode INT2 DEFAULT '1' NOT NULL CHECK (enable_bbcode >= 0),
- enable_smilies INT2 DEFAULT '1' NOT NULL CHECK (enable_smilies >= 0),
- enable_magic_url INT2 DEFAULT '1' NOT NULL CHECK (enable_magic_url >= 0),
- enable_sig INT2 DEFAULT '1' NOT NULL CHECK (enable_sig >= 0),
- message_subject varchar(255) DEFAULT '' NOT NULL,
- message_text TEXT DEFAULT '' NOT NULL,
- message_edit_reason varchar(255) DEFAULT '' NOT NULL,
- message_edit_user INT4 DEFAULT '0' NOT NULL CHECK (message_edit_user >= 0),
- message_attachment INT2 DEFAULT '0' NOT NULL CHECK (message_attachment >= 0),
- bbcode_bitfield varchar(255) DEFAULT '' NOT NULL,
- bbcode_uid varchar(8) DEFAULT '' NOT NULL,
- message_edit_time INT4 DEFAULT '0' NOT NULL CHECK (message_edit_time >= 0),
- message_edit_count INT2 DEFAULT '0' NOT NULL CHECK (message_edit_count >= 0),
- to_address varchar(4000) DEFAULT '' NOT NULL,
- bcc_address varchar(4000) DEFAULT '' NOT NULL,
- message_reported INT2 DEFAULT '0' NOT NULL CHECK (message_reported >= 0),
- PRIMARY KEY (msg_id)
-);
-
-CREATE INDEX phpbb_privmsgs_author_ip ON phpbb_privmsgs (author_ip);
-CREATE INDEX phpbb_privmsgs_message_time ON phpbb_privmsgs (message_time);
-CREATE INDEX phpbb_privmsgs_author_id ON phpbb_privmsgs (author_id);
-CREATE INDEX phpbb_privmsgs_root_level ON phpbb_privmsgs (root_level);
-
-/*
- Table: 'phpbb_privmsgs_folder'
-*/
-CREATE SEQUENCE phpbb_privmsgs_folder_seq;
-
-CREATE TABLE phpbb_privmsgs_folder (
- folder_id INT4 DEFAULT nextval('phpbb_privmsgs_folder_seq'),
- user_id INT4 DEFAULT '0' NOT NULL CHECK (user_id >= 0),
- folder_name varchar(255) DEFAULT '' NOT NULL,
- pm_count INT4 DEFAULT '0' NOT NULL CHECK (pm_count >= 0),
- PRIMARY KEY (folder_id)
-);
-
-CREATE INDEX phpbb_privmsgs_folder_user_id ON phpbb_privmsgs_folder (user_id);
-
-/*
- Table: 'phpbb_privmsgs_rules'
-*/
-CREATE SEQUENCE phpbb_privmsgs_rules_seq;
-
-CREATE TABLE phpbb_privmsgs_rules (
- rule_id INT4 DEFAULT nextval('phpbb_privmsgs_rules_seq'),
- user_id INT4 DEFAULT '0' NOT NULL CHECK (user_id >= 0),
- rule_check INT4 DEFAULT '0' NOT NULL CHECK (rule_check >= 0),
- rule_connection INT4 DEFAULT '0' NOT NULL CHECK (rule_connection >= 0),
- rule_string varchar(255) DEFAULT '' NOT NULL,
- rule_user_id INT4 DEFAULT '0' NOT NULL CHECK (rule_user_id >= 0),
- rule_group_id INT4 DEFAULT '0' NOT NULL CHECK (rule_group_id >= 0),
- rule_action INT4 DEFAULT '0' NOT NULL CHECK (rule_action >= 0),
- rule_folder_id INT4 DEFAULT '0' NOT NULL,
- PRIMARY KEY (rule_id)
-);
-
-CREATE INDEX phpbb_privmsgs_rules_user_id ON phpbb_privmsgs_rules (user_id);
-
-/*
- Table: 'phpbb_privmsgs_to'
-*/
-CREATE TABLE phpbb_privmsgs_to (
- msg_id INT4 DEFAULT '0' NOT NULL CHECK (msg_id >= 0),
- user_id INT4 DEFAULT '0' NOT NULL CHECK (user_id >= 0),
- author_id INT4 DEFAULT '0' NOT NULL CHECK (author_id >= 0),
- pm_deleted INT2 DEFAULT '0' NOT NULL CHECK (pm_deleted >= 0),
- pm_new INT2 DEFAULT '1' NOT NULL CHECK (pm_new >= 0),
- pm_unread INT2 DEFAULT '1' NOT NULL CHECK (pm_unread >= 0),
- pm_replied INT2 DEFAULT '0' NOT NULL CHECK (pm_replied >= 0),
- pm_marked INT2 DEFAULT '0' NOT NULL CHECK (pm_marked >= 0),
- pm_forwarded INT2 DEFAULT '0' NOT NULL CHECK (pm_forwarded >= 0),
- folder_id INT4 DEFAULT '0' NOT NULL
-);
-
-CREATE INDEX phpbb_privmsgs_to_msg_id ON phpbb_privmsgs_to (msg_id);
-CREATE INDEX phpbb_privmsgs_to_author_id ON phpbb_privmsgs_to (author_id);
-CREATE INDEX phpbb_privmsgs_to_usr_flder_id ON phpbb_privmsgs_to (user_id, folder_id);
-
-/*
- Table: 'phpbb_profile_fields'
-*/
-CREATE SEQUENCE phpbb_profile_fields_seq;
-
-CREATE TABLE phpbb_profile_fields (
- field_id INT4 DEFAULT nextval('phpbb_profile_fields_seq'),
- field_name varchar(255) DEFAULT '' NOT NULL,
- field_type INT2 DEFAULT '0' NOT NULL,
- field_ident varchar(20) DEFAULT '' NOT NULL,
- field_length varchar(20) DEFAULT '' NOT NULL,
- field_minlen varchar(255) DEFAULT '' NOT NULL,
- field_maxlen varchar(255) DEFAULT '' NOT NULL,
- field_novalue varchar(255) DEFAULT '' NOT NULL,
- field_default_value varchar(255) DEFAULT '' NOT NULL,
- field_validation varchar(20) DEFAULT '' NOT NULL,
- field_required INT2 DEFAULT '0' NOT NULL CHECK (field_required >= 0),
- field_show_novalue INT2 DEFAULT '0' NOT NULL CHECK (field_show_novalue >= 0),
- field_show_on_reg INT2 DEFAULT '0' NOT NULL CHECK (field_show_on_reg >= 0),
- field_show_on_vt INT2 DEFAULT '0' NOT NULL CHECK (field_show_on_vt >= 0),
- field_show_profile INT2 DEFAULT '0' NOT NULL CHECK (field_show_profile >= 0),
- field_hide INT2 DEFAULT '0' NOT NULL CHECK (field_hide >= 0),
- field_no_view INT2 DEFAULT '0' NOT NULL CHECK (field_no_view >= 0),
- field_active INT2 DEFAULT '0' NOT NULL CHECK (field_active >= 0),
- field_order INT4 DEFAULT '0' NOT NULL CHECK (field_order >= 0),
- PRIMARY KEY (field_id)
-);
-
-CREATE INDEX phpbb_profile_fields_fld_type ON phpbb_profile_fields (field_type);
-CREATE INDEX phpbb_profile_fields_fld_ordr ON phpbb_profile_fields (field_order);
-
-/*
- Table: 'phpbb_profile_fields_data'
-*/
-CREATE TABLE phpbb_profile_fields_data (
- user_id INT4 DEFAULT '0' NOT NULL CHECK (user_id >= 0),
- PRIMARY KEY (user_id)
-);
-
-
-/*
- Table: 'phpbb_profile_fields_lang'
-*/
-CREATE TABLE phpbb_profile_fields_lang (
- field_id INT4 DEFAULT '0' NOT NULL CHECK (field_id >= 0),
- lang_id INT4 DEFAULT '0' NOT NULL CHECK (lang_id >= 0),
- option_id INT4 DEFAULT '0' NOT NULL CHECK (option_id >= 0),
- field_type INT2 DEFAULT '0' NOT NULL,
- lang_value varchar(255) DEFAULT '' NOT NULL,
- PRIMARY KEY (field_id, lang_id, option_id)
-);
-
-
-/*
- Table: 'phpbb_profile_lang'
-*/
-CREATE TABLE phpbb_profile_lang (
- field_id INT4 DEFAULT '0' NOT NULL CHECK (field_id >= 0),
- lang_id INT4 DEFAULT '0' NOT NULL CHECK (lang_id >= 0),
- lang_name varchar(255) DEFAULT '' NOT NULL,
- lang_explain varchar(4000) DEFAULT '' NOT NULL,
- lang_default_value varchar(255) DEFAULT '' NOT NULL,
- PRIMARY KEY (field_id, lang_id)
-);
-
-
-/*
- Table: 'phpbb_ranks'
-*/
-CREATE SEQUENCE phpbb_ranks_seq;
-
-CREATE TABLE phpbb_ranks (
- rank_id INT4 DEFAULT nextval('phpbb_ranks_seq'),
- rank_title varchar(255) DEFAULT '' NOT NULL,
- rank_min INT4 DEFAULT '0' NOT NULL CHECK (rank_min >= 0),
- rank_special INT2 DEFAULT '0' NOT NULL CHECK (rank_special >= 0),
- rank_image varchar(255) DEFAULT '' NOT NULL,
- PRIMARY KEY (rank_id)
-);
-
-
-/*
- Table: 'phpbb_reports'
-*/
-CREATE SEQUENCE phpbb_reports_seq;
-
-CREATE TABLE phpbb_reports (
- report_id INT4 DEFAULT nextval('phpbb_reports_seq'),
- reason_id INT2 DEFAULT '0' NOT NULL CHECK (reason_id >= 0),
- post_id INT4 DEFAULT '0' NOT NULL CHECK (post_id >= 0),
- pm_id INT4 DEFAULT '0' NOT NULL CHECK (pm_id >= 0),
- user_id INT4 DEFAULT '0' NOT NULL CHECK (user_id >= 0),
- user_notify INT2 DEFAULT '0' NOT NULL CHECK (user_notify >= 0),
- report_closed INT2 DEFAULT '0' NOT NULL CHECK (report_closed >= 0),
- report_time INT4 DEFAULT '0' NOT NULL CHECK (report_time >= 0),
- report_text TEXT DEFAULT '' NOT NULL,
- PRIMARY KEY (report_id)
-);
-
-CREATE INDEX phpbb_reports_post_id ON phpbb_reports (post_id);
-CREATE INDEX phpbb_reports_pm_id ON phpbb_reports (pm_id);
-
-/*
- Table: 'phpbb_reports_reasons'
-*/
-CREATE SEQUENCE phpbb_reports_reasons_seq;
-
-CREATE TABLE phpbb_reports_reasons (
- reason_id INT2 DEFAULT nextval('phpbb_reports_reasons_seq'),
- reason_title varchar(255) DEFAULT '' NOT NULL,
- reason_description TEXT DEFAULT '' NOT NULL,
- reason_order INT2 DEFAULT '0' NOT NULL CHECK (reason_order >= 0),
- PRIMARY KEY (reason_id)
-);
-
-
-/*
- Table: 'phpbb_search_results'
-*/
-CREATE TABLE phpbb_search_results (
- search_key varchar(32) DEFAULT '' NOT NULL,
- search_time INT4 DEFAULT '0' NOT NULL CHECK (search_time >= 0),
- search_keywords TEXT DEFAULT '' NOT NULL,
- search_authors TEXT DEFAULT '' NOT NULL,
- PRIMARY KEY (search_key)
-);
-
-
-/*
- Table: 'phpbb_search_wordlist'
-*/
-CREATE SEQUENCE phpbb_search_wordlist_seq;
-
-CREATE TABLE phpbb_search_wordlist (
- word_id INT4 DEFAULT nextval('phpbb_search_wordlist_seq'),
- word_text varchar(255) DEFAULT '' NOT NULL,
- word_common INT2 DEFAULT '0' NOT NULL CHECK (word_common >= 0),
- word_count INT4 DEFAULT '0' NOT NULL CHECK (word_count >= 0),
- PRIMARY KEY (word_id)
-);
-
-CREATE UNIQUE INDEX phpbb_search_wordlist_wrd_txt ON phpbb_search_wordlist (word_text);
-CREATE INDEX phpbb_search_wordlist_wrd_cnt ON phpbb_search_wordlist (word_count);
-
-/*
- Table: 'phpbb_search_wordmatch'
-*/
-CREATE TABLE phpbb_search_wordmatch (
- post_id INT4 DEFAULT '0' NOT NULL CHECK (post_id >= 0),
- word_id INT4 DEFAULT '0' NOT NULL CHECK (word_id >= 0),
- title_match INT2 DEFAULT '0' NOT NULL CHECK (title_match >= 0)
-);
-
-CREATE UNIQUE INDEX phpbb_search_wordmatch_unq_mtch ON phpbb_search_wordmatch (word_id, post_id, title_match);
-CREATE INDEX phpbb_search_wordmatch_word_id ON phpbb_search_wordmatch (word_id);
-CREATE INDEX phpbb_search_wordmatch_post_id ON phpbb_search_wordmatch (post_id);
-
-/*
- Table: 'phpbb_sessions'
-*/
-CREATE TABLE phpbb_sessions (
- session_id char(32) DEFAULT '' NOT NULL,
- session_user_id INT4 DEFAULT '0' NOT NULL CHECK (session_user_id >= 0),
- session_forum_id INT4 DEFAULT '0' NOT NULL CHECK (session_forum_id >= 0),
- session_last_visit INT4 DEFAULT '0' NOT NULL CHECK (session_last_visit >= 0),
- session_start INT4 DEFAULT '0' NOT NULL CHECK (session_start >= 0),
- session_time INT4 DEFAULT '0' NOT NULL CHECK (session_time >= 0),
- session_ip varchar(40) DEFAULT '' NOT NULL,
- session_browser varchar(150) DEFAULT '' NOT NULL,
- session_forwarded_for varchar(255) DEFAULT '' NOT NULL,
- session_page varchar(255) DEFAULT '' NOT NULL,
- session_viewonline INT2 DEFAULT '1' NOT NULL CHECK (session_viewonline >= 0),
- session_autologin INT2 DEFAULT '0' NOT NULL CHECK (session_autologin >= 0),
- session_admin INT2 DEFAULT '0' NOT NULL CHECK (session_admin >= 0),
- PRIMARY KEY (session_id)
-);
-
-CREATE INDEX phpbb_sessions_session_time ON phpbb_sessions (session_time);
-CREATE INDEX phpbb_sessions_session_user_id ON phpbb_sessions (session_user_id);
-CREATE INDEX phpbb_sessions_session_fid ON phpbb_sessions (session_forum_id);
-
-/*
- Table: 'phpbb_sessions_keys'
-*/
-CREATE TABLE phpbb_sessions_keys (
- key_id char(32) DEFAULT '' NOT NULL,
- user_id INT4 DEFAULT '0' NOT NULL CHECK (user_id >= 0),
- last_ip varchar(40) DEFAULT '' NOT NULL,
- last_login INT4 DEFAULT '0' NOT NULL CHECK (last_login >= 0),
- PRIMARY KEY (key_id, user_id)
-);
-
-CREATE INDEX phpbb_sessions_keys_last_login ON phpbb_sessions_keys (last_login);
-
-/*
- Table: 'phpbb_sitelist'
-*/
-CREATE SEQUENCE phpbb_sitelist_seq;
-
-CREATE TABLE phpbb_sitelist (
- site_id INT4 DEFAULT nextval('phpbb_sitelist_seq'),
- site_ip varchar(40) DEFAULT '' NOT NULL,
- site_hostname varchar(255) DEFAULT '' NOT NULL,
- ip_exclude INT2 DEFAULT '0' NOT NULL CHECK (ip_exclude >= 0),
- PRIMARY KEY (site_id)
-);
-
-
-/*
- Table: 'phpbb_smilies'
-*/
-CREATE SEQUENCE phpbb_smilies_seq;
-
-CREATE TABLE phpbb_smilies (
- smiley_id INT4 DEFAULT nextval('phpbb_smilies_seq'),
- code varchar(50) DEFAULT '' NOT NULL,
- emotion varchar(50) DEFAULT '' NOT NULL,
- smiley_url varchar(50) DEFAULT '' NOT NULL,
- smiley_width INT2 DEFAULT '0' NOT NULL CHECK (smiley_width >= 0),
- smiley_height INT2 DEFAULT '0' NOT NULL CHECK (smiley_height >= 0),
- smiley_order INT4 DEFAULT '0' NOT NULL CHECK (smiley_order >= 0),
- display_on_posting INT2 DEFAULT '1' NOT NULL CHECK (display_on_posting >= 0),
- PRIMARY KEY (smiley_id)
-);
-
-CREATE INDEX phpbb_smilies_display_on_post ON phpbb_smilies (display_on_posting);
-
-/*
- Table: 'phpbb_styles'
-*/
-CREATE SEQUENCE phpbb_styles_seq;
-
-CREATE TABLE phpbb_styles (
- style_id INT4 DEFAULT nextval('phpbb_styles_seq'),
- style_name varchar(255) DEFAULT '' NOT NULL,
- style_copyright varchar(255) DEFAULT '' NOT NULL,
- style_active INT2 DEFAULT '1' NOT NULL CHECK (style_active >= 0),
- template_id INT4 DEFAULT '0' NOT NULL CHECK (template_id >= 0),
- theme_id INT4 DEFAULT '0' NOT NULL CHECK (theme_id >= 0),
- imageset_id INT4 DEFAULT '0' NOT NULL CHECK (imageset_id >= 0),
- PRIMARY KEY (style_id)
-);
-
-CREATE UNIQUE INDEX phpbb_styles_style_name ON phpbb_styles (style_name);
-CREATE INDEX phpbb_styles_template_id ON phpbb_styles (template_id);
-CREATE INDEX phpbb_styles_theme_id ON phpbb_styles (theme_id);
-CREATE INDEX phpbb_styles_imageset_id ON phpbb_styles (imageset_id);
-
-/*
- Table: 'phpbb_styles_template'
-*/
-CREATE SEQUENCE phpbb_styles_template_seq;
-
-CREATE TABLE phpbb_styles_template (
- template_id INT4 DEFAULT nextval('phpbb_styles_template_seq'),
- template_name varchar(255) DEFAULT '' NOT NULL,
- template_copyright varchar(255) DEFAULT '' NOT NULL,
- template_path varchar(100) DEFAULT '' NOT NULL,
- bbcode_bitfield varchar(255) DEFAULT 'kNg=' NOT NULL,
- template_storedb INT2 DEFAULT '0' NOT NULL CHECK (template_storedb >= 0),
- template_inherits_id INT4 DEFAULT '0' NOT NULL CHECK (template_inherits_id >= 0),
- template_inherit_path varchar(255) DEFAULT '' NOT NULL,
- PRIMARY KEY (template_id)
-);
-
-CREATE UNIQUE INDEX phpbb_styles_template_tmplte_nm ON phpbb_styles_template (template_name);
-
-/*
- Table: 'phpbb_styles_template_data'
-*/
-CREATE TABLE phpbb_styles_template_data (
- template_id INT4 DEFAULT '0' NOT NULL CHECK (template_id >= 0),
- template_filename varchar(100) DEFAULT '' NOT NULL,
- template_included varchar(8000) DEFAULT '' NOT NULL,
- template_mtime INT4 DEFAULT '0' NOT NULL CHECK (template_mtime >= 0),
- template_data TEXT DEFAULT '' NOT NULL
-);
-
-CREATE INDEX phpbb_styles_template_data_tid ON phpbb_styles_template_data (template_id);
-CREATE INDEX phpbb_styles_template_data_tfn ON phpbb_styles_template_data (template_filename);
-
-/*
- Table: 'phpbb_styles_theme'
-*/
-CREATE SEQUENCE phpbb_styles_theme_seq;
-
-CREATE TABLE phpbb_styles_theme (
- theme_id INT4 DEFAULT nextval('phpbb_styles_theme_seq'),
- theme_name varchar(255) DEFAULT '' NOT NULL,
- theme_copyright varchar(255) DEFAULT '' NOT NULL,
- theme_path varchar(100) DEFAULT '' NOT NULL,
- theme_storedb INT2 DEFAULT '0' NOT NULL CHECK (theme_storedb >= 0),
- theme_mtime INT4 DEFAULT '0' NOT NULL CHECK (theme_mtime >= 0),
- theme_data TEXT DEFAULT '' NOT NULL,
- PRIMARY KEY (theme_id)
-);
-
-CREATE UNIQUE INDEX phpbb_styles_theme_theme_name ON phpbb_styles_theme (theme_name);
-
-/*
- Table: 'phpbb_styles_imageset'
-*/
-CREATE SEQUENCE phpbb_styles_imageset_seq;
-
-CREATE TABLE phpbb_styles_imageset (
- imageset_id INT4 DEFAULT nextval('phpbb_styles_imageset_seq'),
- imageset_name varchar(255) DEFAULT '' NOT NULL,
- imageset_copyright varchar(255) DEFAULT '' NOT NULL,
- imageset_path varchar(100) DEFAULT '' NOT NULL,
- PRIMARY KEY (imageset_id)
-);
-
-CREATE UNIQUE INDEX phpbb_styles_imageset_imgset_nm ON phpbb_styles_imageset (imageset_name);
-
-/*
- Table: 'phpbb_styles_imageset_data'
-*/
-CREATE SEQUENCE phpbb_styles_imageset_data_seq;
-
-CREATE TABLE phpbb_styles_imageset_data (
- image_id INT4 DEFAULT nextval('phpbb_styles_imageset_data_seq'),
- image_name varchar(200) DEFAULT '' NOT NULL,
- image_filename varchar(200) DEFAULT '' NOT NULL,
- image_lang varchar(30) DEFAULT '' NOT NULL,
- image_height INT2 DEFAULT '0' NOT NULL CHECK (image_height >= 0),
- image_width INT2 DEFAULT '0' NOT NULL CHECK (image_width >= 0),
- imageset_id INT4 DEFAULT '0' NOT NULL CHECK (imageset_id >= 0),
- PRIMARY KEY (image_id)
-);
-
-CREATE INDEX phpbb_styles_imageset_data_i_d ON phpbb_styles_imageset_data (imageset_id);
-
-/*
- Table: 'phpbb_topics'
-*/
-CREATE SEQUENCE phpbb_topics_seq;
-
-CREATE TABLE phpbb_topics (
- topic_id INT4 DEFAULT nextval('phpbb_topics_seq'),
- forum_id INT4 DEFAULT '0' NOT NULL CHECK (forum_id >= 0),
- icon_id INT4 DEFAULT '0' NOT NULL CHECK (icon_id >= 0),
- topic_attachment INT2 DEFAULT '0' NOT NULL CHECK (topic_attachment >= 0),
- topic_approved INT2 DEFAULT '1' NOT NULL CHECK (topic_approved >= 0),
- topic_reported INT2 DEFAULT '0' NOT NULL CHECK (topic_reported >= 0),
- topic_title varchar(255) DEFAULT '' NOT NULL,
- topic_poster INT4 DEFAULT '0' NOT NULL CHECK (topic_poster >= 0),
- topic_time INT4 DEFAULT '0' NOT NULL CHECK (topic_time >= 0),
- topic_time_limit INT4 DEFAULT '0' NOT NULL CHECK (topic_time_limit >= 0),
- topic_views INT4 DEFAULT '0' NOT NULL CHECK (topic_views >= 0),
- topic_replies INT4 DEFAULT '0' NOT NULL CHECK (topic_replies >= 0),
- topic_replies_real INT4 DEFAULT '0' NOT NULL CHECK (topic_replies_real >= 0),
- topic_status INT2 DEFAULT '0' NOT NULL,
- topic_type INT2 DEFAULT '0' NOT NULL,
- topic_first_post_id INT4 DEFAULT '0' NOT NULL CHECK (topic_first_post_id >= 0),
- topic_first_poster_name varchar(255) DEFAULT '' NOT NULL,
- topic_first_poster_colour varchar(6) DEFAULT '' NOT NULL,
- topic_last_post_id INT4 DEFAULT '0' NOT NULL CHECK (topic_last_post_id >= 0),
- topic_last_poster_id INT4 DEFAULT '0' NOT NULL CHECK (topic_last_poster_id >= 0),
- topic_last_poster_name varchar(255) DEFAULT '' NOT NULL,
- topic_last_poster_colour varchar(6) DEFAULT '' NOT NULL,
- topic_last_post_subject varchar(255) DEFAULT '' NOT NULL,
- topic_last_post_time INT4 DEFAULT '0' NOT NULL CHECK (topic_last_post_time >= 0),
- topic_last_view_time INT4 DEFAULT '0' NOT NULL CHECK (topic_last_view_time >= 0),
- topic_moved_id INT4 DEFAULT '0' NOT NULL CHECK (topic_moved_id >= 0),
- topic_bumped INT2 DEFAULT '0' NOT NULL CHECK (topic_bumped >= 0),
- topic_bumper INT4 DEFAULT '0' NOT NULL CHECK (topic_bumper >= 0),
- poll_title varchar(255) DEFAULT '' NOT NULL,
- poll_start INT4 DEFAULT '0' NOT NULL CHECK (poll_start >= 0),
- poll_length INT4 DEFAULT '0' NOT NULL CHECK (poll_length >= 0),
- poll_max_options INT2 DEFAULT '1' NOT NULL,
- poll_last_vote INT4 DEFAULT '0' NOT NULL CHECK (poll_last_vote >= 0),
- poll_vote_change INT2 DEFAULT '0' NOT NULL CHECK (poll_vote_change >= 0),
- PRIMARY KEY (topic_id)
-);
-
-CREATE INDEX phpbb_topics_forum_id ON phpbb_topics (forum_id);
-CREATE INDEX phpbb_topics_forum_id_type ON phpbb_topics (forum_id, topic_type);
-CREATE INDEX phpbb_topics_last_post_time ON phpbb_topics (topic_last_post_time);
-CREATE INDEX phpbb_topics_topic_approved ON phpbb_topics (topic_approved);
-CREATE INDEX phpbb_topics_forum_appr_last ON phpbb_topics (forum_id, topic_approved, topic_last_post_id);
-CREATE INDEX phpbb_topics_fid_time_moved ON phpbb_topics (forum_id, topic_last_post_time, topic_moved_id);
-
-/*
- Table: 'phpbb_topics_track'
-*/
-CREATE TABLE phpbb_topics_track (
- user_id INT4 DEFAULT '0' NOT NULL CHECK (user_id >= 0),
- topic_id INT4 DEFAULT '0' NOT NULL CHECK (topic_id >= 0),
- forum_id INT4 DEFAULT '0' NOT NULL CHECK (forum_id >= 0),
- mark_time INT4 DEFAULT '0' NOT NULL CHECK (mark_time >= 0),
- PRIMARY KEY (user_id, topic_id)
-);
-
-CREATE INDEX phpbb_topics_track_topic_id ON phpbb_topics_track (topic_id);
-CREATE INDEX phpbb_topics_track_forum_id ON phpbb_topics_track (forum_id);
-
-/*
- Table: 'phpbb_topics_posted'
-*/
-CREATE TABLE phpbb_topics_posted (
- user_id INT4 DEFAULT '0' NOT NULL CHECK (user_id >= 0),
- topic_id INT4 DEFAULT '0' NOT NULL CHECK (topic_id >= 0),
- topic_posted INT2 DEFAULT '0' NOT NULL CHECK (topic_posted >= 0),
- PRIMARY KEY (user_id, topic_id)
-);
-
-
-/*
- Table: 'phpbb_topics_watch'
-*/
-CREATE TABLE phpbb_topics_watch (
- topic_id INT4 DEFAULT '0' NOT NULL CHECK (topic_id >= 0),
- user_id INT4 DEFAULT '0' NOT NULL CHECK (user_id >= 0),
- notify_status INT2 DEFAULT '0' NOT NULL CHECK (notify_status >= 0)
-);
-
-CREATE INDEX phpbb_topics_watch_topic_id ON phpbb_topics_watch (topic_id);
-CREATE INDEX phpbb_topics_watch_user_id ON phpbb_topics_watch (user_id);
-CREATE INDEX phpbb_topics_watch_notify_stat ON phpbb_topics_watch (notify_status);
-
-/*
- Table: 'phpbb_user_group'
-*/
-CREATE TABLE phpbb_user_group (
- group_id INT4 DEFAULT '0' NOT NULL CHECK (group_id >= 0),
- user_id INT4 DEFAULT '0' NOT NULL CHECK (user_id >= 0),
- group_leader INT2 DEFAULT '0' NOT NULL CHECK (group_leader >= 0),
- user_pending INT2 DEFAULT '1' NOT NULL CHECK (user_pending >= 0)
-);
-
-CREATE INDEX phpbb_user_group_group_id ON phpbb_user_group (group_id);
-CREATE INDEX phpbb_user_group_user_id ON phpbb_user_group (user_id);
-CREATE INDEX phpbb_user_group_group_leader ON phpbb_user_group (group_leader);
-
-/*
- Table: 'phpbb_users'
-*/
-CREATE SEQUENCE phpbb_users_seq;
-
-CREATE TABLE phpbb_users (
- user_id INT4 DEFAULT nextval('phpbb_users_seq'),
- user_type INT2 DEFAULT '0' NOT NULL,
- group_id INT4 DEFAULT '3' NOT NULL CHECK (group_id >= 0),
- user_permissions TEXT DEFAULT '' NOT NULL,
- user_perm_from INT4 DEFAULT '0' NOT NULL CHECK (user_perm_from >= 0),
- user_ip varchar(40) DEFAULT '' NOT NULL,
- user_regdate INT4 DEFAULT '0' NOT NULL CHECK (user_regdate >= 0),
- username varchar_ci DEFAULT '' NOT NULL,
- username_clean varchar_ci DEFAULT '' NOT NULL,
- user_password varchar(40) DEFAULT '' NOT NULL,
- user_passchg INT4 DEFAULT '0' NOT NULL CHECK (user_passchg >= 0),
- user_pass_convert INT2 DEFAULT '0' NOT NULL CHECK (user_pass_convert >= 0),
- user_email varchar(100) DEFAULT '' NOT NULL,
- user_email_hash INT8 DEFAULT '0' NOT NULL,
- user_birthday varchar(10) DEFAULT '' NOT NULL,
- user_lastvisit INT4 DEFAULT '0' NOT NULL CHECK (user_lastvisit >= 0),
- user_lastmark INT4 DEFAULT '0' NOT NULL CHECK (user_lastmark >= 0),
- user_lastpost_time INT4 DEFAULT '0' NOT NULL CHECK (user_lastpost_time >= 0),
- user_lastpage varchar(200) DEFAULT '' NOT NULL,
- user_last_confirm_key varchar(10) DEFAULT '' NOT NULL,
- user_last_search INT4 DEFAULT '0' NOT NULL CHECK (user_last_search >= 0),
- user_warnings INT2 DEFAULT '0' NOT NULL,
- user_last_warning INT4 DEFAULT '0' NOT NULL CHECK (user_last_warning >= 0),
- user_login_attempts INT2 DEFAULT '0' NOT NULL,
- user_inactive_reason INT2 DEFAULT '0' NOT NULL,
- user_inactive_time INT4 DEFAULT '0' NOT NULL CHECK (user_inactive_time >= 0),
- user_posts INT4 DEFAULT '0' NOT NULL CHECK (user_posts >= 0),
- user_lang varchar(30) DEFAULT '' NOT NULL,
- user_timezone decimal(5,2) DEFAULT '0' NOT NULL,
- user_dst INT2 DEFAULT '0' NOT NULL CHECK (user_dst >= 0),
- user_dateformat varchar(30) DEFAULT 'd M Y H:i' NOT NULL,
- user_style INT4 DEFAULT '0' NOT NULL CHECK (user_style >= 0),
- user_rank INT4 DEFAULT '0' NOT NULL CHECK (user_rank >= 0),
- user_colour varchar(6) DEFAULT '' NOT NULL,
- user_new_privmsg INT4 DEFAULT '0' NOT NULL,
- user_unread_privmsg INT4 DEFAULT '0' NOT NULL,
- user_last_privmsg INT4 DEFAULT '0' NOT NULL CHECK (user_last_privmsg >= 0),
- user_message_rules INT2 DEFAULT '0' NOT NULL CHECK (user_message_rules >= 0),
- user_full_folder INT4 DEFAULT '-3' NOT NULL,
- user_emailtime INT4 DEFAULT '0' NOT NULL CHECK (user_emailtime >= 0),
- user_topic_show_days INT2 DEFAULT '0' NOT NULL CHECK (user_topic_show_days >= 0),
- user_topic_sortby_type varchar(1) DEFAULT 't' NOT NULL,
- user_topic_sortby_dir varchar(1) DEFAULT 'd' NOT NULL,
- user_post_show_days INT2 DEFAULT '0' NOT NULL CHECK (user_post_show_days >= 0),
- user_post_sortby_type varchar(1) DEFAULT 't' NOT NULL,
- user_post_sortby_dir varchar(1) DEFAULT 'a' NOT NULL,
- user_notify INT2 DEFAULT '0' NOT NULL CHECK (user_notify >= 0),
- user_notify_pm INT2 DEFAULT '1' NOT NULL CHECK (user_notify_pm >= 0),
- user_notify_type INT2 DEFAULT '0' NOT NULL,
- user_allow_pm INT2 DEFAULT '1' NOT NULL CHECK (user_allow_pm >= 0),
- user_allow_viewonline INT2 DEFAULT '1' NOT NULL CHECK (user_allow_viewonline >= 0),
- user_allow_viewemail INT2 DEFAULT '1' NOT NULL CHECK (user_allow_viewemail >= 0),
- user_allow_massemail INT2 DEFAULT '1' NOT NULL CHECK (user_allow_massemail >= 0),
- user_options INT4 DEFAULT '230271' NOT NULL CHECK (user_options >= 0),
- user_avatar varchar(255) DEFAULT '' NOT NULL,
- user_avatar_type INT2 DEFAULT '0' NOT NULL,
- user_avatar_width INT2 DEFAULT '0' NOT NULL CHECK (user_avatar_width >= 0),
- user_avatar_height INT2 DEFAULT '0' NOT NULL CHECK (user_avatar_height >= 0),
- user_sig TEXT DEFAULT '' NOT NULL,
- user_sig_bbcode_uid varchar(8) DEFAULT '' NOT NULL,
- user_sig_bbcode_bitfield varchar(255) DEFAULT '' NOT NULL,
- user_from varchar(100) DEFAULT '' NOT NULL,
- user_icq varchar(15) DEFAULT '' NOT NULL,
- user_aim varchar(255) DEFAULT '' NOT NULL,
- user_yim varchar(255) DEFAULT '' NOT NULL,
- user_msnm varchar(255) DEFAULT '' NOT NULL,
- user_jabber varchar(255) DEFAULT '' NOT NULL,
- user_website varchar(200) DEFAULT '' NOT NULL,
- user_occ varchar(4000) DEFAULT '' NOT NULL,
- user_interests varchar(4000) DEFAULT '' NOT NULL,
- user_actkey varchar(32) DEFAULT '' NOT NULL,
- user_newpasswd varchar(40) DEFAULT '' NOT NULL,
- user_form_salt varchar(32) DEFAULT '' NOT NULL,
- user_new INT2 DEFAULT '1' NOT NULL CHECK (user_new >= 0),
- user_reminded INT2 DEFAULT '0' NOT NULL,
- user_reminded_time INT4 DEFAULT '0' NOT NULL CHECK (user_reminded_time >= 0),
- PRIMARY KEY (user_id)
-);
-
-CREATE INDEX phpbb_users_user_birthday ON phpbb_users (user_birthday);
-CREATE INDEX phpbb_users_user_email_hash ON phpbb_users (user_email_hash);
-CREATE INDEX phpbb_users_user_type ON phpbb_users (user_type);
-CREATE UNIQUE INDEX phpbb_users_username_clean ON phpbb_users (username_clean);
-
-/*
- Table: 'phpbb_warnings'
-*/
-CREATE SEQUENCE phpbb_warnings_seq;
-
-CREATE TABLE phpbb_warnings (
- warning_id INT4 DEFAULT nextval('phpbb_warnings_seq'),
- user_id INT4 DEFAULT '0' NOT NULL CHECK (user_id >= 0),
- post_id INT4 DEFAULT '0' NOT NULL CHECK (post_id >= 0),
- log_id INT4 DEFAULT '0' NOT NULL CHECK (log_id >= 0),
- warning_time INT4 DEFAULT '0' NOT NULL CHECK (warning_time >= 0),
- PRIMARY KEY (warning_id)
-);
-
-
-/*
- Table: 'phpbb_words'
-*/
-CREATE SEQUENCE phpbb_words_seq;
-
-CREATE TABLE phpbb_words (
- word_id INT4 DEFAULT nextval('phpbb_words_seq'),
- word varchar(255) DEFAULT '' NOT NULL,
- replacement varchar(255) DEFAULT '' NOT NULL,
- PRIMARY KEY (word_id)
-);
-
-
-/*
- Table: 'phpbb_zebra'
-*/
-CREATE TABLE phpbb_zebra (
- user_id INT4 DEFAULT '0' NOT NULL CHECK (user_id >= 0),
- zebra_id INT4 DEFAULT '0' NOT NULL CHECK (zebra_id >= 0),
- friend INT2 DEFAULT '0' NOT NULL CHECK (friend >= 0),
- foe INT2 DEFAULT '0' NOT NULL CHECK (foe >= 0),
- PRIMARY KEY (user_id, zebra_id)
-);
-
-
+COMMIT;
-COMMIT; \ No newline at end of file
diff --git a/phpBB/install/schemas/schema_data.sql b/phpBB/install/schemas/schema_data.sql
index 4534c19a7f..1a62ea6f84 100644
--- a/phpBB/install/schemas/schema_data.sql
+++ b/phpBB/install/schemas/schema_data.sql
@@ -9,6 +9,7 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('active_sessions',
INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_attachments', '1');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_autologin', '1');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_avatar', '1');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_avatar_gravatar', '0');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_avatar_local', '0');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_avatar_remote', '0');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_avatar_upload', '1');
@@ -16,8 +17,11 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_avatar_remot
INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_bbcode', '1');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_birthdays', '1');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_bookmarks', '1');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_cdn', '0');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_emailreuse', '0');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_password_reset', '1');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_forum_notify', '1');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_live_searches', '1');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_mass_pm', '1');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_name_chars', 'USERNAME_CHARS_ANY');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_namechange', '0');
@@ -37,6 +41,7 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_sig_pm', '1'
INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_sig_smilies', '1');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_smilies', '1');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_topic_notify', '1');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('assets_version', '1');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('attachment_quota', '52428800');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('auth_bbcode_pm', '1');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('auth_flash_pm', '0');
@@ -52,19 +57,20 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('avatar_min_width',
INSERT INTO phpbb_config (config_name, config_value) VALUES ('avatar_path', 'images/avatars/upload');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('avatar_salt', 'phpbb_avatar');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('board_contact', 'contact@yourdomain.tld');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('board_contact_name', '');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('board_disable', '0');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('board_disable_msg', '');
-INSERT INTO phpbb_config (config_name, config_value) VALUES ('board_dst', '0');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('board_email', 'address@yourdomain.tld');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('board_email_form', '0');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('board_email_sig', '{L_CONFIG_BOARD_EMAIL_SIG}');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('board_hide_emails', '1');
-INSERT INTO phpbb_config (config_name, config_value) VALUES ('board_timezone', '0');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('board_index_text', '');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('board_timezone', 'UTC');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('browser_check', '1');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('bump_interval', '10');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('bump_type', 'd');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('cache_gc', '7200');
-INSERT INTO phpbb_config (config_name, config_value) VALUES ('captcha_plugin', 'phpbb_captcha_nogd');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('captcha_plugin', 'core.captcha.plugins.nogd');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('captcha_gd', '0');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('captcha_gd_foreground_noise', '0');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('captcha_gd_x_grid', '25');
@@ -76,6 +82,7 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('confirm_refresh',
INSERT INTO phpbb_config (config_name, config_value) VALUES ('check_attachment_content', '1');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('check_dnsbl', '0');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('chg_passforce', '0');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('contact_admin_form_enable', '1');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('cookie_domain', '');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('cookie_name', 'phpbb3');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('cookie_path', '/');
@@ -88,8 +95,10 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('dbms_version', '')
INSERT INTO phpbb_config (config_name, config_value) VALUES ('default_dateformat', 'D M d, Y g:i a');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('default_style', '1');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('display_last_edited', '1');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('display_last_subject', '1');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('display_order', '0');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('edit_time', '0');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('extension_force_unstable', '0');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('delete_time', '0');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('email_check_mx', '1');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('email_enable', '1');
@@ -97,6 +106,7 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('email_function_nam
INSERT INTO phpbb_config (config_name, config_value) VALUES ('email_max_chunk_size', '50');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('email_package_size', '20');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('enable_confirm', '1');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('enable_mod_rewrite', '0');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('enable_pm_icons', '1');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('enable_post_confirm', '1');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('feed_enable', '1');
@@ -124,6 +134,11 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('fulltext_native_co
INSERT INTO phpbb_config (config_name, config_value) VALUES ('fulltext_native_load_upd', '1');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('fulltext_native_max_chars', '14');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('fulltext_native_min_chars', '3');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('fulltext_postgres_max_word_len', '254');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('fulltext_postgres_min_word_len', '4');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('fulltext_postgres_ts_name', 'simple');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('fulltext_sphinx_indexer_mem_limit', '512');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('fulltext_sphinx_stopwords', '0');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('gzip_compress', '0');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('hot_threshold', '25');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('icons_path', 'images/icons');
@@ -155,17 +170,21 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('ldap_server', '');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('ldap_uid', '');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('ldap_user', '');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('ldap_user_filter', '');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('legend_sort_groupname', '0');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('limit_load', '0');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('limit_search_load', '0');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_anon_lastread', '0');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_birthdays', '1');
-INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_cpf_memberlist', '0');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_cpf_memberlist', '1');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_cpf_pm', '1');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_cpf_viewprofile', '1');
-INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_cpf_viewtopic', '0');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_cpf_viewtopic', '1');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_db_lastread', '1');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_db_track', '1');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_jquery_url', '//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_jumpbox', '1');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_moderators', '1');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_notifications', '1');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_online', '1');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_online_guests', '1');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_online_time', '5');
@@ -207,6 +226,7 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('new_member_post_li
INSERT INTO phpbb_config (config_name, config_value) VALUES ('new_member_group_default', '0');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('override_user_style', '0');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('pass_complex', 'PASS_TYPE_ANY');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('plupload_salt', 'phpbb_plupload');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('pm_edit_time', '0');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('pm_max_boxes', '4');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('pm_max_msgs', '50');
@@ -215,6 +235,8 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('posts_per_page', '
INSERT INTO phpbb_config (config_name, config_value) VALUES ('print_pm', '1');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('queue_interval', '60');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('ranks_path', 'images/ranks');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('read_notification_expire_days', '30');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('read_notification_gc', '86400');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('require_activation', '0');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('referer_validation', '1');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('script_path', '');
@@ -222,7 +244,7 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('search_block_size'
INSERT INTO phpbb_config (config_name, config_value) VALUES ('search_gc', '7200');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('search_interval', '0');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('search_anonymous_interval', '0');
-INSERT INTO phpbb_config (config_name, config_value) VALUES ('search_type', 'fulltext_native');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('search_type', '\phpbb\search\fulltext_native');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('search_store_results', '1800');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('secure_allow_deny', '1');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('secure_allow_empty_referer', '1');
@@ -233,6 +255,8 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('server_protocol',
INSERT INTO phpbb_config (config_name, config_value) VALUES ('session_gc', '3600');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('session_length', '3600');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('site_desc', '{L_CONFIG_SITE_DESC}');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('site_home_url', '');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('site_home_text', '');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('sitename', '{L_CONFIG_SITENAME}');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('smilies_path', 'images/smilies');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('smilies_per_page', '50');
@@ -242,11 +266,14 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('smtp_host', '');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('smtp_password', '');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('smtp_port', '25');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('smtp_username', '');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('teampage_memberships', '1');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('teampage_forums', '1');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('topics_per_page', '25');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('tpl_allow_php', '0');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('upload_icons_path', 'images/upload_icons');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('upload_path', 'files');
-INSERT INTO phpbb_config (config_name, config_value) VALUES ('version', '3.0.14');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('use_system_cron', '0');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('version', '3.1.11');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('warnings_expire_days', '90');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('warnings_gc', '14400');
@@ -261,8 +288,10 @@ INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('num_fi
INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('num_posts', '1', 1);
INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('num_topics', '1', 1);
INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('num_users', '1', 1);
+INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('plupload_last_gc', '0', 1);
INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('rand_seed', '0', 1);
INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('rand_seed_last_update', '0', 1);
+INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('read_notification_last_gc', '0', 1);
INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('record_online_date', '0', 1);
INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('record_online_users', '0', 1);
INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('search_indexing_state', '', 1);
@@ -271,6 +300,12 @@ INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('sessio
INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('upload_dir_size', '0', 1);
INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('warnings_last_gc', '0', 1);
+# Config text
+INSERT INTO phpbb_config_text (config_name, config_value) VALUES ('contact_admin_info', '');
+INSERT INTO phpbb_config_text (config_name, config_value) VALUES ('contact_admin_info_uid', '');
+INSERT INTO phpbb_config_text (config_name, config_value) VALUES ('contact_admin_info_bitfield', '');
+INSERT INTO phpbb_config_text (config_name, config_value) VALUES ('contact_admin_info_flags', '7');
+
# -- Forum related auth options
INSERT INTO phpbb_acl_options (auth_option, is_local) VALUES ('f_', 1);
INSERT INTO phpbb_acl_options (auth_option, is_local) VALUES ('f_announce', 1);
@@ -302,6 +337,7 @@ INSERT INTO phpbb_acl_options (auth_option, is_local) VALUES ('f_subscribe', 1);
INSERT INTO phpbb_acl_options (auth_option, is_local) VALUES ('f_user_lock', 1);
INSERT INTO phpbb_acl_options (auth_option, is_local) VALUES ('f_vote', 1);
INSERT INTO phpbb_acl_options (auth_option, is_local) VALUES ('f_votechg', 1);
+INSERT INTO phpbb_acl_options (auth_option, is_local) VALUES ('f_softdelete', 1);
# -- Moderator related auth options
INSERT INTO phpbb_acl_options (auth_option, is_local, is_global) VALUES ('m_', 1, 1);
@@ -315,9 +351,11 @@ INSERT INTO phpbb_acl_options (auth_option, is_local, is_global) VALUES ('m_merg
INSERT INTO phpbb_acl_options (auth_option, is_local, is_global) VALUES ('m_move', 1, 1);
INSERT INTO phpbb_acl_options (auth_option, is_local, is_global) VALUES ('m_report', 1, 1);
INSERT INTO phpbb_acl_options (auth_option, is_local, is_global) VALUES ('m_split', 1, 1);
+INSERT INTO phpbb_acl_options (auth_option, is_local, is_global) VALUES ('m_softdelete', 1, 1);
# -- Global moderator auth option (not a local option)
INSERT INTO phpbb_acl_options (auth_option, is_local, is_global) VALUES ('m_ban', 0, 1);
+INSERT INTO phpbb_acl_options (auth_option, is_local, is_global) VALUES ('m_pm_report', 0, 1);
INSERT INTO phpbb_acl_options (auth_option, is_local, is_global) VALUES ('m_warn', 0, 1);
# -- Admin related auth options
@@ -333,6 +371,7 @@ INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('a_board', 1);
INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('a_bots', 1);
INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('a_clearlogs', 1);
INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('a_email', 1);
+INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('a_extensions', 1);
INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('a_fauth', 1);
INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('a_forum', 1);
INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('a_forumadd', 1);
@@ -372,6 +411,7 @@ INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_chgemail', 1);
INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_chggrp', 1);
INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_chgname', 1);
INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_chgpasswd', 1);
+INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_chgprofileinfo', 1);
INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_download', 1);
INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_hideonline', 1);
INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_ignoreflood', 1);
@@ -430,107 +470,32 @@ INSERT INTO phpbb_acl_roles (role_name, role_description, role_type, role_order)
INSERT INTO phpbb_acl_roles (role_name, role_description, role_type, role_order) VALUES ('ROLE_FORUM_NEW_MEMBER', 'ROLE_DESCRIPTION_FORUM_NEW_MEMBER', 'f_', 10);
# -- phpbb_styles
-INSERT INTO phpbb_styles (style_name, style_copyright, style_active, template_id, theme_id, imageset_id) VALUES ('prosilver', '&copy; phpBB Group', 1, 1, 1, 1);
-
-# -- phpbb_styles_imageset
-INSERT INTO phpbb_styles_imageset (imageset_name, imageset_copyright, imageset_path) VALUES ('prosilver', '&copy; phpBB Group', 'prosilver');
-
-# -- phpbb_styles_imageset_data
-INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('site_logo', 'site_logo.gif', '', 52, 139, 1);
-INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('forum_link', 'forum_link.gif', '', 27, 27, 1);
-INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('forum_read', 'forum_read.gif', '', 27, 27, 1);
-INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('forum_read_locked', 'forum_read_locked.gif', '', 27, 27, 1);
-INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('forum_read_subforum', 'forum_read_subforum.gif', '', 27, 27, 1);
-INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('forum_unread', 'forum_unread.gif', '', 27, 27, 1);
-INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('forum_unread_locked', 'forum_unread_locked.gif', '', 27, 27, 1);
-INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('forum_unread_subforum', 'forum_unread_subforum.gif', '', 27, 27, 1);
-INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('topic_moved', 'topic_moved.gif', '', 27, 27, 1);
-INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('topic_read', 'topic_read.gif', '', 27, 27, 1);
-INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('topic_read_mine', 'topic_read_mine.gif', '', 27, 27, 1);
-INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('topic_read_hot', 'topic_read_hot.gif', '', 27, 27, 1);
-INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('topic_read_hot_mine', 'topic_read_hot_mine.gif', '', 27, 27, 1);
-INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('topic_read_locked', 'topic_read_locked.gif', '', 27, 27, 1);
-INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('topic_read_locked_mine', 'topic_read_locked_mine.gif', '', 27, 27, 1);
-INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('topic_unread', 'topic_unread.gif', '', 27, 27, 1);
-INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('topic_unread_mine', 'topic_unread_mine.gif', '', 27, 27, 1);
-INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('topic_unread_hot', 'topic_unread_hot.gif', '', 27, 27, 1);
-INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('topic_unread_hot_mine', 'topic_unread_hot_mine.gif', '', 27, 27, 1);
-INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('topic_unread_locked', 'topic_unread_locked.gif', '', 27, 27, 1);
-INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('topic_unread_locked_mine', 'topic_unread_locked_mine.gif', '', 27, 27, 1);
-INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('sticky_read', 'sticky_read.gif', '', 27, 27, 1);
-INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('sticky_read_mine', 'sticky_read_mine.gif', '', 27, 27, 1);
-INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('sticky_read_locked', 'sticky_read_locked.gif', '', 27, 27, 1);
-INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('sticky_read_locked_mine', 'sticky_read_locked_mine.gif', '', 27, 27, 1);
-INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('sticky_unread', 'sticky_unread.gif', '', 27, 27, 1);
-INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('sticky_unread_mine', 'sticky_unread_mine.gif', '', 27, 27, 1);
-INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('sticky_unread_locked', 'sticky_unread_locked.gif', '', 27, 27, 1);
-INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('sticky_unread_locked_mine', 'sticky_unread_locked_mine.gif', '', 27, 27, 1);
-INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('announce_read', 'announce_read.gif', '', 27, 27, 1);
-INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('announce_read_mine', 'announce_read_mine.gif', '', 27, 27, 1);
-INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('announce_read_locked', 'announce_read_locked.gif', '', 27, 27, 1);
-INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('announce_read_locked_mine', 'announce_read_locked_mine.gif', '', 27, 27, 1);
-INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('announce_unread', 'announce_unread.gif', '', 27, 27, 1);
-INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('announce_unread_mine', 'announce_unread_mine.gif', '', 27, 27, 1);
-INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('announce_unread_locked', 'announce_unread_locked.gif', '', 27, 27, 1);
-INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('announce_unread_locked_mine', 'announce_unread_locked_mine.gif', '', 27, 27, 1);
-INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('global_read', 'announce_read.gif', '', 27, 27, 1);
-INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('global_read_mine', 'announce_read_mine.gif', '', 27, 27, 1);
-INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('global_read_locked', 'announce_read_locked.gif', '', 27, 27, 1);
-INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('global_read_locked_mine', 'announce_read_locked_mine.gif', '', 27, 27, 1);
-INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('global_unread', 'announce_unread.gif', '', 27, 27, 1);
-INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('global_unread_mine', 'announce_unread_mine.gif', '', 27, 27, 1);
-INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('global_unread_locked', 'announce_unread_locked.gif', '', 27, 27, 1);
-INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('global_unread_locked_mine', 'announce_unread_locked_mine.gif', '', 27, 27, 1);
-INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('pm_read', 'topic_read.gif', '', 27, 27, 1);
-INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('pm_unread', 'topic_unread.gif', '', 27, 27, 1);
-INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('icon_back_top', 'icon_back_top.gif', '', 11, 11, 1);
-INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('icon_contact_aim', 'icon_contact_aim.gif', '', 20, 20, 1);
-INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('icon_contact_email', 'icon_contact_email.gif', '', 20, 20, 1);
-INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('icon_contact_icq', 'icon_contact_icq.gif', '', 20, 20, 1);
-INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('icon_contact_jabber', 'icon_contact_jabber.gif', '', 20, 20, 1);
-INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('icon_contact_msnm', 'icon_contact_msnm.gif', '', 20, 20, 1);
-INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('icon_contact_www', 'icon_contact_www.gif', '', 20, 20, 1);
-INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('icon_contact_yahoo', 'icon_contact_yahoo.gif', '', 20, 20, 1);
-INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('icon_post_delete', 'icon_post_delete.gif', '', 20, 20, 1);
-INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('icon_post_info', 'icon_post_info.gif', '', 20, 20, 1);
-INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('icon_post_report', 'icon_post_report.gif', '', 20, 20, 1);
-INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('icon_post_target', 'icon_post_target.gif', '', 9, 11, 1);
-INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('icon_post_target_unread', 'icon_post_target_unread.gif', '', 9, 11, 1);
-INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('icon_topic_attach', 'icon_topic_attach.gif', '', 10, 7, 1);
-INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('icon_topic_latest', 'icon_topic_latest.gif', '', 9, 11, 1);
-INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('icon_topic_newest', 'icon_topic_newest.gif', '', 9, 11, 1);
-INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('icon_topic_reported', 'icon_topic_reported.gif', '', 14, 16, 1);
-INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('icon_topic_unapproved', 'icon_topic_unapproved.gif', '', 14, 16, 1);
-INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('icon_user_warn', 'icon_user_warn.gif', '', 20, 20, 1);
-INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('subforum_read', 'subforum_read.gif', '', 9, 11, 1);
-INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('subforum_unread', 'subforum_unread.gif', '', 9, 11, 1);
-
-# -- phpbb_styles_template
-INSERT INTO phpbb_styles_template (template_name, template_copyright, template_path, bbcode_bitfield, template_storedb) VALUES ('prosilver', '&copy; phpBB Group', 'prosilver', 'lNg=', 0);
-
-# -- phpbb_styles_theme
-INSERT INTO phpbb_styles_theme (theme_name, theme_copyright, theme_path, theme_storedb, theme_data) VALUES ('prosilver', '&copy; phpBB Group', 'prosilver', 1, '');
+INSERT INTO phpbb_styles (style_name, style_copyright, style_active, style_path, bbcode_bitfield, style_parent_id, style_parent_tree) VALUES ('prosilver', '&copy; phpBB Limited', 1, 'prosilver', 'kNg=', 0, '');
# -- Forums
-INSERT INTO phpbb_forums (forum_name, forum_desc, left_id, right_id, parent_id, forum_type, forum_posts, forum_topics, forum_topics_real, forum_last_post_id, forum_last_poster_id, forum_last_poster_name, forum_last_poster_colour, forum_last_post_time, forum_link, forum_password, forum_image, forum_rules, forum_rules_link, forum_rules_uid, forum_desc_uid, prune_days, prune_viewed, forum_parents) VALUES ('{L_FORUMS_FIRST_CATEGORY}', '', 1, 4, 0, 0, 1, 1, 1, 1, 2, 'Admin', 'AA0000', 972086460, '', '', '', '', '', '', '', 0, 0, '');
+INSERT INTO phpbb_forums (forum_name, forum_desc, left_id, right_id, parent_id, forum_type, forum_posts_approved, forum_posts_unapproved, forum_posts_softdeleted, forum_topics_approved, forum_topics_unapproved, forum_topics_softdeleted, forum_last_post_id, forum_last_poster_id, forum_last_poster_name, forum_last_poster_colour, forum_last_post_time, forum_link, forum_password, forum_image, forum_rules, forum_rules_link, forum_rules_uid, forum_desc_uid, prune_days, prune_viewed, forum_parents) VALUES ('{L_FORUMS_FIRST_CATEGORY}', '', 1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 'Admin', 'AA0000', 972086460, '', '', '', '', '', '', '', 0, 0, '');
-INSERT INTO phpbb_forums (forum_name, forum_desc, left_id, right_id, parent_id, forum_type, forum_posts, forum_topics, forum_topics_real, forum_last_post_id, forum_last_poster_id, forum_last_poster_name, forum_last_poster_colour, forum_last_post_subject, forum_last_post_time, forum_link, forum_password, forum_image, forum_rules, forum_rules_link, forum_rules_uid, forum_desc_uid, prune_days, prune_viewed, forum_parents, forum_flags) VALUES ('{L_FORUMS_TEST_FORUM_TITLE}', '{L_FORUMS_TEST_FORUM_DESC}', 2, 3, 1, 1, 1, 1, 1, 1, 2, 'Admin', 'AA0000', '{L_TOPICS_TOPIC_TITLE}', 972086460, '', '', '', '', '', '', '', 0, 0, '', 48);
+INSERT INTO phpbb_forums (forum_name, forum_desc, left_id, right_id, parent_id, forum_type, forum_posts_approved, forum_posts_unapproved, forum_posts_softdeleted, forum_topics_approved, forum_topics_unapproved, forum_topics_softdeleted, forum_last_post_id, forum_last_poster_id, forum_last_poster_name, forum_last_poster_colour, forum_last_post_subject, forum_last_post_time, forum_link, forum_password, forum_image, forum_rules, forum_rules_link, forum_rules_uid, forum_desc_uid, prune_days, prune_viewed, forum_parents, forum_flags) VALUES ('{L_FORUMS_TEST_FORUM_TITLE}', '{L_FORUMS_TEST_FORUM_DESC}', 2, 3, 1, 1, 1, 0, 0, 1, 0, 0, 1, 2, 'Admin', 'AA0000', '{L_TOPICS_TOPIC_TITLE}', 972086460, '', '', '', '', '', '', '', 0, 0, '', 48);
# -- Users / Anonymous user
-INSERT INTO phpbb_users (user_type, group_id, username, username_clean, user_regdate, user_password, user_email, user_lang, user_style, user_rank, user_colour, user_posts, user_permissions, user_ip, user_birthday, user_lastpage, user_last_confirm_key, user_post_sortby_type, user_post_sortby_dir, user_topic_sortby_type, user_topic_sortby_dir, user_avatar, user_sig, user_sig_bbcode_uid, user_from, user_icq, user_aim, user_yim, user_msnm, user_jabber, user_website, user_occ, user_interests, user_actkey, user_newpasswd, user_allow_massemail) VALUES (2, 1, 'Anonymous', 'anonymous', 0, '', '', 'en', 1, 0, '', 0, '', '', '', '', '', 't', 'a', 't', 'd', '', '', '', '', '', '', '', '', '', '', '', '', '', '', 0);
+INSERT INTO phpbb_users (user_type, group_id, username, username_clean, user_regdate, user_password, user_email, user_lang, user_style, user_rank, user_colour, user_posts, user_permissions, user_ip, user_birthday, user_lastpage, user_last_confirm_key, user_post_sortby_type, user_post_sortby_dir, user_topic_sortby_type, user_topic_sortby_dir, user_avatar, user_sig, user_sig_bbcode_uid, user_jabber, user_actkey, user_newpasswd, user_allow_massemail) VALUES (2, 1, 'Anonymous', 'anonymous', 0, '', '', 'en', 1, 0, '', 0, '', '', '', '', '', 't', 'a', 't', 'd', '', '', '', '', '', '', 0);
# -- username: Admin password: admin (change this or remove it once everything is working!)
-INSERT INTO phpbb_users (user_type, group_id, username, username_clean, user_regdate, user_password, user_email, user_lang, user_style, user_rank, user_colour, user_posts, user_permissions, user_ip, user_birthday, user_lastpage, user_last_confirm_key, user_post_sortby_type, user_post_sortby_dir, user_topic_sortby_type, user_topic_sortby_dir, user_avatar, user_sig, user_sig_bbcode_uid, user_from, user_icq, user_aim, user_yim, user_msnm, user_jabber, user_website, user_occ, user_interests, user_actkey, user_newpasswd) VALUES (3, 5, 'Admin', 'admin', 0, '21232f297a57a5a743894a0e4a801fc3', 'admin@yourdomain.com', 'en', 1, 1, 'AA0000', 1, '', '', '', '', '', 't', 'a', 't', 'd', '', '', '', '', '', '', '', '', '', '', '', '', '', '');
+INSERT INTO phpbb_users (user_type, group_id, username, username_clean, user_regdate, user_password, user_email, user_lang, user_style, user_rank, user_colour, user_posts, user_permissions, user_ip, user_birthday, user_lastpage, user_last_confirm_key, user_post_sortby_type, user_post_sortby_dir, user_topic_sortby_type, user_topic_sortby_dir, user_avatar, user_sig, user_sig_bbcode_uid, user_jabber, user_actkey, user_newpasswd) VALUES (3, 5, 'Admin', 'admin', 0, '21232f297a57a5a743894a0e4a801fc3', 'admin@yourdomain.com', 'en', 1, 1, 'AA0000', 1, '', '', '', '', '', 't', 'a', 't', 'd', '', '', '', '', '', '');
# -- Groups
INSERT INTO phpbb_groups (group_name, group_type, group_founder_manage, group_colour, group_legend, group_avatar, group_desc, group_desc_uid, group_max_recipients) VALUES ('GUESTS', 3, 0, '', 0, '', '', '', 5);
INSERT INTO phpbb_groups (group_name, group_type, group_founder_manage, group_colour, group_legend, group_avatar, group_desc, group_desc_uid, group_max_recipients) VALUES ('REGISTERED', 3, 0, '', 0, '', '', '', 5);
INSERT INTO phpbb_groups (group_name, group_type, group_founder_manage, group_colour, group_legend, group_avatar, group_desc, group_desc_uid, group_max_recipients) VALUES ('REGISTERED_COPPA', 3, 0, '', 0, '', '', '', 5);
-INSERT INTO phpbb_groups (group_name, group_type, group_founder_manage, group_colour, group_legend, group_avatar, group_desc, group_desc_uid, group_max_recipients) VALUES ('GLOBAL_MODERATORS', 3, 0, '00AA00', 1, '', '', '', 0);
+INSERT INTO phpbb_groups (group_name, group_type, group_founder_manage, group_colour, group_legend, group_avatar, group_desc, group_desc_uid, group_max_recipients) VALUES ('GLOBAL_MODERATORS', 3, 0, '00AA00', 2, '', '', '', 0);
INSERT INTO phpbb_groups (group_name, group_type, group_founder_manage, group_colour, group_legend, group_avatar, group_desc, group_desc_uid, group_max_recipients) VALUES ('ADMINISTRATORS', 3, 1, 'AA0000', 1, '', '', '', 0);
INSERT INTO phpbb_groups (group_name, group_type, group_founder_manage, group_colour, group_legend, group_avatar, group_desc, group_desc_uid, group_max_recipients) VALUES ('BOTS', 3, 0, '9E8DA7', 0, '', '', '', 5);
INSERT INTO phpbb_groups (group_name, group_type, group_founder_manage, group_colour, group_legend, group_avatar, group_desc, group_desc_uid, group_max_recipients) VALUES ('NEWLY_REGISTERED', 3, 0, '', 0, '', '', '', 5);
+# -- Teampage
+INSERT INTO phpbb_teampage (group_id, teampage_name, teampage_position, teampage_parent) VALUES (5, '', 1, 0);
+INSERT INTO phpbb_teampage (group_id, teampage_name, teampage_position, teampage_parent) VALUES (4, '', 2, 0);
+
# -- User -> Group
INSERT INTO phpbb_user_group (group_id, user_id, user_pending, group_leader) VALUES (1, 1, 0, 0);
INSERT INTO phpbb_user_group (group_id, user_id, user_pending, group_leader) VALUES (2, 2, 0, 0);
@@ -578,7 +543,7 @@ INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT
INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 11, auth_option_id, 1 FROM phpbb_acl_options WHERE auth_option LIKE 'm_%' AND auth_option NOT IN ('m_ban', 'm_chgposter');
# Simple Moderator (m_)
-INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 12, auth_option_id, 1 FROM phpbb_acl_options WHERE auth_option LIKE 'm_%' AND auth_option IN ('m_', 'm_delete', 'm_edit', 'm_info', 'm_report');
+INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 12, auth_option_id, 1 FROM phpbb_acl_options WHERE auth_option LIKE 'm_%' AND auth_option IN ('m_', 'm_delete', 'm_softdelete', 'm_edit', 'm_info', 'm_report', 'm_pm_report');
# Queue Moderator (m_)
INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 13, auth_option_id, 1 FROM phpbb_acl_options WHERE auth_option LIKE 'm_%' AND auth_option IN ('m_', 'm_approve', 'm_edit');
@@ -612,7 +577,7 @@ INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT
INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 22, auth_option_id, 1 FROM phpbb_acl_options WHERE auth_option LIKE 'f_%' AND auth_option NOT IN ('f_announce', 'f_attach', 'f_bump', 'f_delete', 'f_flash', 'f_icons', 'f_ignoreflood', 'f_sticky', 'f_user_lock', 'f_votechg');
# New Member (u_)
-INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 23, auth_option_id, 0 FROM phpbb_acl_options WHERE auth_option LIKE 'u_%' AND auth_option IN ('u_sendpm', 'u_masspm', 'u_masspm_group');
+INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 23, auth_option_id, 0 FROM phpbb_acl_options WHERE auth_option LIKE 'u_%' AND auth_option IN ('u_sendpm', 'u_masspm', 'u_masspm_group', 'u_chgprofileinfo');
# New Member (f_)
INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 24, auth_option_id, 0 FROM phpbb_acl_options WHERE auth_option LIKE 'f_%' AND auth_option IN ('f_noapprove');
@@ -676,10 +641,10 @@ INSERT INTO phpbb_acl_groups (group_id, forum_id, auth_option_id, auth_role_id,
# -- Demo Topic
-INSERT INTO phpbb_topics (topic_title, topic_poster, topic_time, topic_views, topic_replies, topic_replies_real, forum_id, topic_status, topic_type, topic_first_post_id, topic_first_poster_name, topic_first_poster_colour, topic_last_post_id, topic_last_poster_id, topic_last_poster_name, topic_last_poster_colour, topic_last_post_subject, topic_last_post_time, topic_last_view_time, poll_title) VALUES ('{L_TOPICS_TOPIC_TITLE}', 2, 972086460, 0, 0, 0, 2, 0, 0, 1, 'Admin', 'AA0000', 1, 2, 'Admin', 'AA0000', '{L_TOPICS_TOPIC_TITLE}', 972086460, 972086460, '');
+INSERT INTO phpbb_topics (topic_title, topic_poster, topic_time, topic_views, topic_posts_approved, topic_posts_unapproved, topic_posts_softdeleted, forum_id, topic_status, topic_type, topic_first_post_id, topic_first_poster_name, topic_first_poster_colour, topic_last_post_id, topic_last_poster_id, topic_last_poster_name, topic_last_poster_colour, topic_last_post_subject, topic_last_post_time, topic_last_view_time, poll_title, topic_visibility) VALUES ('{L_TOPICS_TOPIC_TITLE}', 2, 972086460, 0, 1, 0, 0, 2, 0, 0, 1, 'Admin', 'AA0000', 1, 2, 'Admin', 'AA0000', '{L_TOPICS_TOPIC_TITLE}', 972086460, 972086460, '', 1);
# -- Demo Post
-INSERT INTO phpbb_posts (topic_id, forum_id, poster_id, icon_id, post_time, post_username, poster_ip, post_subject, post_text, post_checksum, bbcode_uid) VALUES (1, 2, 2, 0, 972086460, '', '127.0.0.1', '{L_TOPICS_TOPIC_TITLE}', '{L_DEFAULT_INSTALL_POST}', '5dd683b17f641daf84c040bfefc58ce9', '');
+INSERT INTO phpbb_posts (topic_id, forum_id, poster_id, icon_id, post_time, post_username, poster_ip, post_subject, post_text, post_checksum, bbcode_uid, post_visibility) VALUES (1, 2, 2, 0, 972086460, '', '127.0.0.1', '{L_TOPICS_TOPIC_TITLE}', '{L_DEFAULT_INSTALL_POST}', '5dd683b17f641daf84c040bfefc58ce9', '', 1);
# -- Admin posted to the demo topic
INSERT INTO phpbb_topics_posted (user_id, topic_id, topic_posted) VALUES (2, 1, 1);
@@ -833,4 +798,25 @@ INSERT INTO phpbb_extensions (group_id, extension) VALUES (9, 'mp3');
INSERT INTO phpbb_extensions (group_id, extension) VALUES (9, 'ogg');
INSERT INTO phpbb_extensions (group_id, extension) VALUES (9, 'ogm');
+# Add default profile fields
+INSERT INTO phpbb_profile_fields (field_name, field_type, field_ident, field_length, field_minlen, field_maxlen, field_novalue, field_default_value, field_validation, field_required, field_show_novalue, field_show_on_reg, field_show_on_pm, field_show_on_vt, field_show_on_ml, field_show_profile, field_hide, field_no_view, field_active, field_order, field_is_contact, field_contact_desc, field_contact_url) VALUES ('phpbb_location', 'profilefields.type.string', 'phpbb_location', '20', '2', '100', '', '', '.*', 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 0, '', '');
+INSERT INTO phpbb_profile_fields (field_name, field_type, field_ident, field_length, field_minlen, field_maxlen, field_novalue, field_default_value, field_validation, field_required, field_show_novalue, field_show_on_reg, field_show_on_pm, field_show_on_vt, field_show_on_ml, field_show_profile, field_hide, field_no_view, field_active, field_order, field_is_contact, field_contact_desc, field_contact_url) VALUES ('phpbb_website', 'profilefields.type.url', 'phpbb_website', '40', '12', '255', '', '', '', 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 2, 1, 'VISIT_WEBSITE', '%s');
+INSERT INTO phpbb_profile_fields (field_name, field_type, field_ident, field_length, field_minlen, field_maxlen, field_novalue, field_default_value, field_validation, field_required, field_show_novalue, field_show_on_reg, field_show_on_pm, field_show_on_vt, field_show_on_ml, field_show_profile, field_hide, field_no_view, field_active, field_order, field_is_contact, field_contact_desc, field_contact_url) VALUES ('phpbb_interests', 'profilefields.type.text', 'phpbb_interests', '3|30', '2', '500', '', '', '.*', 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 3, 0, '', '');
+INSERT INTO phpbb_profile_fields (field_name, field_type, field_ident, field_length, field_minlen, field_maxlen, field_novalue, field_default_value, field_validation, field_required, field_show_novalue, field_show_on_reg, field_show_on_pm, field_show_on_vt, field_show_on_ml, field_show_profile, field_hide, field_no_view, field_active, field_order, field_is_contact, field_contact_desc, field_contact_url) VALUES ('phpbb_occupation', 'profilefields.type.text', 'phpbb_occupation', '3|30', '2', '500', '', '', '.*', 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 4, 0, '', '');
+INSERT INTO phpbb_profile_fields (field_name, field_type, field_ident, field_length, field_minlen, field_maxlen, field_novalue, field_default_value, field_validation, field_required, field_show_novalue, field_show_on_reg, field_show_on_pm, field_show_on_vt, field_show_on_ml, field_show_profile, field_hide, field_no_view, field_active, field_order, field_is_contact, field_contact_desc, field_contact_url) VALUES ('phpbb_aol', 'profilefields.type.string', 'phpbb_aol', '40', '5', '255', '', '', '.*', 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 5, 1, '', '');
+INSERT INTO phpbb_profile_fields (field_name, field_type, field_ident, field_length, field_minlen, field_maxlen, field_novalue, field_default_value, field_validation, field_required, field_show_novalue, field_show_on_reg, field_show_on_pm, field_show_on_vt, field_show_on_ml, field_show_profile, field_hide, field_no_view, field_active, field_order, field_is_contact, field_contact_desc, field_contact_url) VALUES ('phpbb_icq', 'profilefields.type.string', 'phpbb_icq', '20', '3', '15', '', '', '[0-9]+', 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 6, 1, 'SEND_ICQ_MESSAGE', 'https://www.icq.com/people/%s/');
+INSERT INTO phpbb_profile_fields (field_name, field_type, field_ident, field_length, field_minlen, field_maxlen, field_novalue, field_default_value, field_validation, field_required, field_show_novalue, field_show_on_reg, field_show_on_pm, field_show_on_vt, field_show_on_ml, field_show_profile, field_hide, field_no_view, field_active, field_order, field_is_contact, field_contact_desc, field_contact_url) VALUES ('phpbb_wlm', 'profilefields.type.string', 'phpbb_wlm', '40', '5', '255', '', '', '.*', 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 7, 1, '', '');
+INSERT INTO phpbb_profile_fields (field_name, field_type, field_ident, field_length, field_minlen, field_maxlen, field_novalue, field_default_value, field_validation, field_required, field_show_novalue, field_show_on_reg, field_show_on_pm, field_show_on_vt, field_show_on_ml, field_show_profile, field_hide, field_no_view, field_active, field_order, field_is_contact, field_contact_desc, field_contact_url) VALUES ('phpbb_yahoo', 'profilefields.type.string', 'phpbb_yahoo', '40', '5', '255', '', '', '.*', 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 8, 1, 'SEND_YIM_MESSAGE', 'ymsgr:sendim?%s');
+INSERT INTO phpbb_profile_fields (field_name, field_type, field_ident, field_length, field_minlen, field_maxlen, field_novalue, field_default_value, field_validation, field_required, field_show_novalue, field_show_on_reg, field_show_on_pm, field_show_on_vt, field_show_on_ml, field_show_profile, field_hide, field_no_view, field_active, field_order, field_is_contact, field_contact_desc, field_contact_url) VALUES ('phpbb_facebook', 'profilefields.type.string', 'phpbb_facebook', '20', '5', '50', '', '', '[\w.]+', 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 9, 1, 'VIEW_FACEBOOK_PROFILE', 'http://facebook.com/%s/');
+INSERT INTO phpbb_profile_fields (field_name, field_type, field_ident, field_length, field_minlen, field_maxlen, field_novalue, field_default_value, field_validation, field_required, field_show_novalue, field_show_on_reg, field_show_on_pm, field_show_on_vt, field_show_on_ml, field_show_profile, field_hide, field_no_view, field_active, field_order, field_is_contact, field_contact_desc, field_contact_url) VALUES ('phpbb_twitter', 'profilefields.type.string', 'phpbb_twitter', '20', '1', '15', '', '', '[\w_]+', 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 10, 1, 'VIEW_TWITTER_PROFILE', 'http://twitter.com/%s');
+INSERT INTO phpbb_profile_fields (field_name, field_type, field_ident, field_length, field_minlen, field_maxlen, field_novalue, field_default_value, field_validation, field_required, field_show_novalue, field_show_on_reg, field_show_on_pm, field_show_on_vt, field_show_on_ml, field_show_profile, field_hide, field_no_view, field_active, field_order, field_is_contact, field_contact_desc, field_contact_url) VALUES ('phpbb_skype', 'profilefields.type.string', 'phpbb_skype', '20', '6', '32', '', '', '[a-zA-Z][\w\.,\-_]+', 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 11, 1, 'VIEW_SKYPE_PROFILE', 'skype:%s?userinfo');
+INSERT INTO phpbb_profile_fields (field_name, field_type, field_ident, field_length, field_minlen, field_maxlen, field_novalue, field_default_value, field_validation, field_required, field_show_novalue, field_show_on_reg, field_show_on_pm, field_show_on_vt, field_show_on_ml, field_show_profile, field_hide, field_no_view, field_active, field_order, field_is_contact, field_contact_desc, field_contact_url) VALUES ('phpbb_youtube', 'profilefields.type.string', 'phpbb_youtube', '20', '3', '60', '', '', '[a-zA-Z][\w\.,\-_]+', 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 12, 1, 'VIEW_YOUTUBE_CHANNEL', 'http://youtube.com/user/%s');
+INSERT INTO phpbb_profile_fields (field_name, field_type, field_ident, field_length, field_minlen, field_maxlen, field_novalue, field_default_value, field_validation, field_required, field_show_novalue, field_show_on_reg, field_show_on_pm, field_show_on_vt, field_show_on_ml, field_show_profile, field_hide, field_no_view, field_active, field_order, field_is_contact, field_contact_desc, field_contact_url) VALUES ('phpbb_googleplus', 'profilefields.type.googleplus', 'phpbb_googleplus', '20', '3', '255', '', '', '[\w]+', 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 13, 1, 'VIEW_GOOGLEPLUS_PROFILE', 'http://plus.google.com/%s');
+
+# User Notification Options (for first user)
+INSERT INTO phpbb_user_notifications (item_type, item_id, user_id, method) VALUES('notification.type.post', 0, 2, '');
+INSERT INTO phpbb_user_notifications (item_type, item_id, user_id, method) VALUES('notification.type.post', 0, 2, 'notification.method.email');
+INSERT INTO phpbb_user_notifications (item_type, item_id, user_id, method) VALUES('notification.type.topic', 0, 2, '');
+INSERT INTO phpbb_user_notifications (item_type, item_id, user_id, method) VALUES('notification.type.topic', 0, 2, 'notification.method.email');
+
# POSTGRES COMMIT #
diff --git a/phpBB/install/schemas/sqlite_schema.sql b/phpBB/install/schemas/sqlite_schema.sql
deleted file mode 100644
index be7faa4688..0000000000
--- a/phpBB/install/schemas/sqlite_schema.sql
+++ /dev/null
@@ -1,1003 +0,0 @@
-# DO NOT EDIT THIS FILE, IT IS GENERATED
-#
-# To change the contents of this file, edit
-# phpBB/develop/create_schema_files.php and
-# run it.
-BEGIN TRANSACTION;
-
-# Table: 'phpbb_attachments'
-CREATE TABLE phpbb_attachments (
- attach_id INTEGER PRIMARY KEY NOT NULL ,
- post_msg_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- topic_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- in_message INTEGER UNSIGNED NOT NULL DEFAULT '0',
- poster_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- is_orphan INTEGER UNSIGNED NOT NULL DEFAULT '1',
- physical_filename varchar(255) NOT NULL DEFAULT '',
- real_filename varchar(255) NOT NULL DEFAULT '',
- download_count INTEGER UNSIGNED NOT NULL DEFAULT '0',
- attach_comment text(65535) NOT NULL DEFAULT '',
- extension varchar(100) NOT NULL DEFAULT '',
- mimetype varchar(100) NOT NULL DEFAULT '',
- filesize INTEGER UNSIGNED NOT NULL DEFAULT '0',
- filetime INTEGER UNSIGNED NOT NULL DEFAULT '0',
- thumbnail INTEGER UNSIGNED NOT NULL DEFAULT '0'
-);
-
-CREATE INDEX phpbb_attachments_filetime ON phpbb_attachments (filetime);
-CREATE INDEX phpbb_attachments_post_msg_id ON phpbb_attachments (post_msg_id);
-CREATE INDEX phpbb_attachments_topic_id ON phpbb_attachments (topic_id);
-CREATE INDEX phpbb_attachments_poster_id ON phpbb_attachments (poster_id);
-CREATE INDEX phpbb_attachments_is_orphan ON phpbb_attachments (is_orphan);
-
-# Table: 'phpbb_acl_groups'
-CREATE TABLE phpbb_acl_groups (
- group_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- forum_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- auth_option_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- auth_role_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- auth_setting tinyint(2) NOT NULL DEFAULT '0'
-);
-
-CREATE INDEX phpbb_acl_groups_group_id ON phpbb_acl_groups (group_id);
-CREATE INDEX phpbb_acl_groups_auth_opt_id ON phpbb_acl_groups (auth_option_id);
-CREATE INDEX phpbb_acl_groups_auth_role_id ON phpbb_acl_groups (auth_role_id);
-
-# Table: 'phpbb_acl_options'
-CREATE TABLE phpbb_acl_options (
- auth_option_id INTEGER PRIMARY KEY NOT NULL ,
- auth_option varchar(50) NOT NULL DEFAULT '',
- is_global INTEGER UNSIGNED NOT NULL DEFAULT '0',
- is_local INTEGER UNSIGNED NOT NULL DEFAULT '0',
- founder_only INTEGER UNSIGNED NOT NULL DEFAULT '0'
-);
-
-CREATE UNIQUE INDEX phpbb_acl_options_auth_option ON phpbb_acl_options (auth_option);
-
-# Table: 'phpbb_acl_roles'
-CREATE TABLE phpbb_acl_roles (
- role_id INTEGER PRIMARY KEY NOT NULL ,
- role_name varchar(255) NOT NULL DEFAULT '',
- role_description text(65535) NOT NULL DEFAULT '',
- role_type varchar(10) NOT NULL DEFAULT '',
- role_order INTEGER UNSIGNED NOT NULL DEFAULT '0'
-);
-
-CREATE INDEX phpbb_acl_roles_role_type ON phpbb_acl_roles (role_type);
-CREATE INDEX phpbb_acl_roles_role_order ON phpbb_acl_roles (role_order);
-
-# Table: 'phpbb_acl_roles_data'
-CREATE TABLE phpbb_acl_roles_data (
- role_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- auth_option_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- auth_setting tinyint(2) NOT NULL DEFAULT '0',
- PRIMARY KEY (role_id, auth_option_id)
-);
-
-CREATE INDEX phpbb_acl_roles_data_ath_op_id ON phpbb_acl_roles_data (auth_option_id);
-
-# Table: 'phpbb_acl_users'
-CREATE TABLE phpbb_acl_users (
- user_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- forum_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- auth_option_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- auth_role_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- auth_setting tinyint(2) NOT NULL DEFAULT '0'
-);
-
-CREATE INDEX phpbb_acl_users_user_id ON phpbb_acl_users (user_id);
-CREATE INDEX phpbb_acl_users_auth_option_id ON phpbb_acl_users (auth_option_id);
-CREATE INDEX phpbb_acl_users_auth_role_id ON phpbb_acl_users (auth_role_id);
-
-# Table: 'phpbb_banlist'
-CREATE TABLE phpbb_banlist (
- ban_id INTEGER PRIMARY KEY NOT NULL ,
- ban_userid INTEGER UNSIGNED NOT NULL DEFAULT '0',
- ban_ip varchar(40) NOT NULL DEFAULT '',
- ban_email varchar(100) NOT NULL DEFAULT '',
- ban_start INTEGER UNSIGNED NOT NULL DEFAULT '0',
- ban_end INTEGER UNSIGNED NOT NULL DEFAULT '0',
- ban_exclude INTEGER UNSIGNED NOT NULL DEFAULT '0',
- ban_reason varchar(255) NOT NULL DEFAULT '',
- ban_give_reason varchar(255) NOT NULL DEFAULT ''
-);
-
-CREATE INDEX phpbb_banlist_ban_end ON phpbb_banlist (ban_end);
-CREATE INDEX phpbb_banlist_ban_user ON phpbb_banlist (ban_userid, ban_exclude);
-CREATE INDEX phpbb_banlist_ban_email ON phpbb_banlist (ban_email, ban_exclude);
-CREATE INDEX phpbb_banlist_ban_ip ON phpbb_banlist (ban_ip, ban_exclude);
-
-# Table: 'phpbb_bbcodes'
-CREATE TABLE phpbb_bbcodes (
- bbcode_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- bbcode_tag varchar(16) NOT NULL DEFAULT '',
- bbcode_helpline varchar(255) NOT NULL DEFAULT '',
- display_on_posting INTEGER UNSIGNED NOT NULL DEFAULT '0',
- bbcode_match text(65535) NOT NULL DEFAULT '',
- bbcode_tpl mediumtext(16777215) NOT NULL DEFAULT '',
- first_pass_match mediumtext(16777215) NOT NULL DEFAULT '',
- first_pass_replace mediumtext(16777215) NOT NULL DEFAULT '',
- second_pass_match mediumtext(16777215) NOT NULL DEFAULT '',
- second_pass_replace mediumtext(16777215) NOT NULL DEFAULT '',
- PRIMARY KEY (bbcode_id)
-);
-
-CREATE INDEX phpbb_bbcodes_display_on_post ON phpbb_bbcodes (display_on_posting);
-
-# Table: 'phpbb_bookmarks'
-CREATE TABLE phpbb_bookmarks (
- topic_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- user_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- PRIMARY KEY (topic_id, user_id)
-);
-
-
-# Table: 'phpbb_bots'
-CREATE TABLE phpbb_bots (
- bot_id INTEGER PRIMARY KEY NOT NULL ,
- bot_active INTEGER UNSIGNED NOT NULL DEFAULT '1',
- bot_name text(65535) NOT NULL DEFAULT '',
- user_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- bot_agent varchar(255) NOT NULL DEFAULT '',
- bot_ip varchar(255) NOT NULL DEFAULT ''
-);
-
-CREATE INDEX phpbb_bots_bot_active ON phpbb_bots (bot_active);
-
-# Table: 'phpbb_config'
-CREATE TABLE phpbb_config (
- config_name varchar(255) NOT NULL DEFAULT '',
- config_value varchar(255) NOT NULL DEFAULT '',
- is_dynamic INTEGER UNSIGNED NOT NULL DEFAULT '0',
- PRIMARY KEY (config_name)
-);
-
-CREATE INDEX phpbb_config_is_dynamic ON phpbb_config (is_dynamic);
-
-# Table: 'phpbb_confirm'
-CREATE TABLE phpbb_confirm (
- confirm_id char(32) NOT NULL DEFAULT '',
- session_id char(32) NOT NULL DEFAULT '',
- confirm_type tinyint(3) NOT NULL DEFAULT '0',
- code varchar(8) NOT NULL DEFAULT '',
- seed INTEGER UNSIGNED NOT NULL DEFAULT '0',
- attempts INTEGER UNSIGNED NOT NULL DEFAULT '0',
- PRIMARY KEY (session_id, confirm_id)
-);
-
-CREATE INDEX phpbb_confirm_confirm_type ON phpbb_confirm (confirm_type);
-
-# Table: 'phpbb_disallow'
-CREATE TABLE phpbb_disallow (
- disallow_id INTEGER PRIMARY KEY NOT NULL ,
- disallow_username varchar(255) NOT NULL DEFAULT ''
-);
-
-
-# Table: 'phpbb_drafts'
-CREATE TABLE phpbb_drafts (
- draft_id INTEGER PRIMARY KEY NOT NULL ,
- user_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- topic_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- forum_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- save_time INTEGER UNSIGNED NOT NULL DEFAULT '0',
- draft_subject text(65535) NOT NULL DEFAULT '',
- draft_message mediumtext(16777215) NOT NULL DEFAULT ''
-);
-
-CREATE INDEX phpbb_drafts_save_time ON phpbb_drafts (save_time);
-
-# Table: 'phpbb_extensions'
-CREATE TABLE phpbb_extensions (
- extension_id INTEGER PRIMARY KEY NOT NULL ,
- group_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- extension varchar(100) NOT NULL DEFAULT ''
-);
-
-
-# Table: 'phpbb_extension_groups'
-CREATE TABLE phpbb_extension_groups (
- group_id INTEGER PRIMARY KEY NOT NULL ,
- group_name varchar(255) NOT NULL DEFAULT '',
- cat_id tinyint(2) NOT NULL DEFAULT '0',
- allow_group INTEGER UNSIGNED NOT NULL DEFAULT '0',
- download_mode INTEGER UNSIGNED NOT NULL DEFAULT '1',
- upload_icon varchar(255) NOT NULL DEFAULT '',
- max_filesize INTEGER UNSIGNED NOT NULL DEFAULT '0',
- allowed_forums text(65535) NOT NULL DEFAULT '',
- allow_in_pm INTEGER UNSIGNED NOT NULL DEFAULT '0'
-);
-
-
-# Table: 'phpbb_forums'
-CREATE TABLE phpbb_forums (
- forum_id INTEGER PRIMARY KEY NOT NULL ,
- parent_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- left_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- right_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- forum_parents mediumtext(16777215) NOT NULL DEFAULT '',
- forum_name text(65535) NOT NULL DEFAULT '',
- forum_desc text(65535) NOT NULL DEFAULT '',
- forum_desc_bitfield varchar(255) NOT NULL DEFAULT '',
- forum_desc_options INTEGER UNSIGNED NOT NULL DEFAULT '7',
- forum_desc_uid varchar(8) NOT NULL DEFAULT '',
- forum_link varchar(255) NOT NULL DEFAULT '',
- forum_password varchar(40) NOT NULL DEFAULT '',
- forum_style INTEGER UNSIGNED NOT NULL DEFAULT '0',
- forum_image varchar(255) NOT NULL DEFAULT '',
- forum_rules text(65535) NOT NULL DEFAULT '',
- forum_rules_link varchar(255) NOT NULL DEFAULT '',
- forum_rules_bitfield varchar(255) NOT NULL DEFAULT '',
- forum_rules_options INTEGER UNSIGNED NOT NULL DEFAULT '7',
- forum_rules_uid varchar(8) NOT NULL DEFAULT '',
- forum_topics_per_page tinyint(4) NOT NULL DEFAULT '0',
- forum_type tinyint(4) NOT NULL DEFAULT '0',
- forum_status tinyint(4) NOT NULL DEFAULT '0',
- forum_posts INTEGER UNSIGNED NOT NULL DEFAULT '0',
- forum_topics INTEGER UNSIGNED NOT NULL DEFAULT '0',
- forum_topics_real INTEGER UNSIGNED NOT NULL DEFAULT '0',
- forum_last_post_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- forum_last_poster_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- forum_last_post_subject text(65535) NOT NULL DEFAULT '',
- forum_last_post_time INTEGER UNSIGNED NOT NULL DEFAULT '0',
- forum_last_poster_name varchar(255) NOT NULL DEFAULT '',
- forum_last_poster_colour varchar(6) NOT NULL DEFAULT '',
- forum_flags tinyint(4) NOT NULL DEFAULT '32',
- forum_options INTEGER UNSIGNED NOT NULL DEFAULT '0',
- display_subforum_list INTEGER UNSIGNED NOT NULL DEFAULT '1',
- display_on_index INTEGER UNSIGNED NOT NULL DEFAULT '1',
- enable_indexing INTEGER UNSIGNED NOT NULL DEFAULT '1',
- enable_icons INTEGER UNSIGNED NOT NULL DEFAULT '1',
- enable_prune INTEGER UNSIGNED NOT NULL DEFAULT '0',
- prune_next INTEGER UNSIGNED NOT NULL DEFAULT '0',
- prune_days INTEGER UNSIGNED NOT NULL DEFAULT '0',
- prune_viewed INTEGER UNSIGNED NOT NULL DEFAULT '0',
- prune_freq INTEGER UNSIGNED NOT NULL DEFAULT '0'
-);
-
-CREATE INDEX phpbb_forums_left_right_id ON phpbb_forums (left_id, right_id);
-CREATE INDEX phpbb_forums_forum_lastpost_id ON phpbb_forums (forum_last_post_id);
-
-# Table: 'phpbb_forums_access'
-CREATE TABLE phpbb_forums_access (
- forum_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- user_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- session_id char(32) NOT NULL DEFAULT '',
- PRIMARY KEY (forum_id, user_id, session_id)
-);
-
-
-# Table: 'phpbb_forums_track'
-CREATE TABLE phpbb_forums_track (
- user_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- forum_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- mark_time INTEGER UNSIGNED NOT NULL DEFAULT '0',
- PRIMARY KEY (user_id, forum_id)
-);
-
-
-# Table: 'phpbb_forums_watch'
-CREATE TABLE phpbb_forums_watch (
- forum_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- user_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- notify_status INTEGER UNSIGNED NOT NULL DEFAULT '0'
-);
-
-CREATE INDEX phpbb_forums_watch_forum_id ON phpbb_forums_watch (forum_id);
-CREATE INDEX phpbb_forums_watch_user_id ON phpbb_forums_watch (user_id);
-CREATE INDEX phpbb_forums_watch_notify_stat ON phpbb_forums_watch (notify_status);
-
-# Table: 'phpbb_groups'
-CREATE TABLE phpbb_groups (
- group_id INTEGER PRIMARY KEY NOT NULL ,
- group_type tinyint(4) NOT NULL DEFAULT '1',
- group_founder_manage INTEGER UNSIGNED NOT NULL DEFAULT '0',
- group_skip_auth INTEGER UNSIGNED NOT NULL DEFAULT '0',
- group_name varchar(255) NOT NULL DEFAULT '',
- group_desc text(65535) NOT NULL DEFAULT '',
- group_desc_bitfield varchar(255) NOT NULL DEFAULT '',
- group_desc_options INTEGER UNSIGNED NOT NULL DEFAULT '7',
- group_desc_uid varchar(8) NOT NULL DEFAULT '',
- group_display INTEGER UNSIGNED NOT NULL DEFAULT '0',
- group_avatar varchar(255) NOT NULL DEFAULT '',
- group_avatar_type tinyint(2) NOT NULL DEFAULT '0',
- group_avatar_width INTEGER UNSIGNED NOT NULL DEFAULT '0',
- group_avatar_height INTEGER UNSIGNED NOT NULL DEFAULT '0',
- group_rank INTEGER UNSIGNED NOT NULL DEFAULT '0',
- group_colour varchar(6) NOT NULL DEFAULT '',
- group_sig_chars INTEGER UNSIGNED NOT NULL DEFAULT '0',
- group_receive_pm INTEGER UNSIGNED NOT NULL DEFAULT '0',
- group_message_limit INTEGER UNSIGNED NOT NULL DEFAULT '0',
- group_max_recipients INTEGER UNSIGNED NOT NULL DEFAULT '0',
- group_legend INTEGER UNSIGNED NOT NULL DEFAULT '1'
-);
-
-CREATE INDEX phpbb_groups_group_legend_name ON phpbb_groups (group_legend, group_name);
-
-# Table: 'phpbb_icons'
-CREATE TABLE phpbb_icons (
- icons_id INTEGER PRIMARY KEY NOT NULL ,
- icons_url varchar(255) NOT NULL DEFAULT '',
- icons_width tinyint(4) NOT NULL DEFAULT '0',
- icons_height tinyint(4) NOT NULL DEFAULT '0',
- icons_order INTEGER UNSIGNED NOT NULL DEFAULT '0',
- display_on_posting INTEGER UNSIGNED NOT NULL DEFAULT '1'
-);
-
-CREATE INDEX phpbb_icons_display_on_posting ON phpbb_icons (display_on_posting);
-
-# Table: 'phpbb_lang'
-CREATE TABLE phpbb_lang (
- lang_id INTEGER PRIMARY KEY NOT NULL ,
- lang_iso varchar(30) NOT NULL DEFAULT '',
- lang_dir varchar(30) NOT NULL DEFAULT '',
- lang_english_name varchar(100) NOT NULL DEFAULT '',
- lang_local_name varchar(255) NOT NULL DEFAULT '',
- lang_author varchar(255) NOT NULL DEFAULT ''
-);
-
-CREATE INDEX phpbb_lang_lang_iso ON phpbb_lang (lang_iso);
-
-# Table: 'phpbb_log'
-CREATE TABLE phpbb_log (
- log_id INTEGER PRIMARY KEY NOT NULL ,
- log_type tinyint(4) NOT NULL DEFAULT '0',
- user_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- forum_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- topic_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- reportee_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- log_ip varchar(40) NOT NULL DEFAULT '',
- log_time INTEGER UNSIGNED NOT NULL DEFAULT '0',
- log_operation text(65535) NOT NULL DEFAULT '',
- log_data mediumtext(16777215) NOT NULL DEFAULT ''
-);
-
-CREATE INDEX phpbb_log_log_type ON phpbb_log (log_type);
-CREATE INDEX phpbb_log_forum_id ON phpbb_log (forum_id);
-CREATE INDEX phpbb_log_topic_id ON phpbb_log (topic_id);
-CREATE INDEX phpbb_log_reportee_id ON phpbb_log (reportee_id);
-CREATE INDEX phpbb_log_user_id ON phpbb_log (user_id);
-
-# Table: 'phpbb_login_attempts'
-CREATE TABLE phpbb_login_attempts (
- attempt_ip varchar(40) NOT NULL DEFAULT '',
- attempt_browser varchar(150) NOT NULL DEFAULT '',
- attempt_forwarded_for varchar(255) NOT NULL DEFAULT '',
- attempt_time INTEGER UNSIGNED NOT NULL DEFAULT '0',
- user_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- username varchar(255) NOT NULL DEFAULT '0',
- username_clean varchar(255) NOT NULL DEFAULT '0'
-);
-
-CREATE INDEX phpbb_login_attempts_att_ip ON phpbb_login_attempts (attempt_ip, attempt_time);
-CREATE INDEX phpbb_login_attempts_att_for ON phpbb_login_attempts (attempt_forwarded_for, attempt_time);
-CREATE INDEX phpbb_login_attempts_att_time ON phpbb_login_attempts (attempt_time);
-CREATE INDEX phpbb_login_attempts_user_id ON phpbb_login_attempts (user_id);
-
-# Table: 'phpbb_moderator_cache'
-CREATE TABLE phpbb_moderator_cache (
- forum_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- user_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- username varchar(255) NOT NULL DEFAULT '',
- group_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- group_name varchar(255) NOT NULL DEFAULT '',
- display_on_index INTEGER UNSIGNED NOT NULL DEFAULT '1'
-);
-
-CREATE INDEX phpbb_moderator_cache_disp_idx ON phpbb_moderator_cache (display_on_index);
-CREATE INDEX phpbb_moderator_cache_forum_id ON phpbb_moderator_cache (forum_id);
-
-# Table: 'phpbb_modules'
-CREATE TABLE phpbb_modules (
- module_id INTEGER PRIMARY KEY NOT NULL ,
- module_enabled INTEGER UNSIGNED NOT NULL DEFAULT '1',
- module_display INTEGER UNSIGNED NOT NULL DEFAULT '1',
- module_basename varchar(255) NOT NULL DEFAULT '',
- module_class varchar(10) NOT NULL DEFAULT '',
- parent_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- left_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- right_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- module_langname varchar(255) NOT NULL DEFAULT '',
- module_mode varchar(255) NOT NULL DEFAULT '',
- module_auth varchar(255) NOT NULL DEFAULT ''
-);
-
-CREATE INDEX phpbb_modules_left_right_id ON phpbb_modules (left_id, right_id);
-CREATE INDEX phpbb_modules_module_enabled ON phpbb_modules (module_enabled);
-CREATE INDEX phpbb_modules_class_left_id ON phpbb_modules (module_class, left_id);
-
-# Table: 'phpbb_poll_options'
-CREATE TABLE phpbb_poll_options (
- poll_option_id tinyint(4) NOT NULL DEFAULT '0',
- topic_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- poll_option_text text(65535) NOT NULL DEFAULT '',
- poll_option_total INTEGER UNSIGNED NOT NULL DEFAULT '0'
-);
-
-CREATE INDEX phpbb_poll_options_poll_opt_id ON phpbb_poll_options (poll_option_id);
-CREATE INDEX phpbb_poll_options_topic_id ON phpbb_poll_options (topic_id);
-
-# Table: 'phpbb_poll_votes'
-CREATE TABLE phpbb_poll_votes (
- topic_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- poll_option_id tinyint(4) NOT NULL DEFAULT '0',
- vote_user_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- vote_user_ip varchar(40) NOT NULL DEFAULT ''
-);
-
-CREATE INDEX phpbb_poll_votes_topic_id ON phpbb_poll_votes (topic_id);
-CREATE INDEX phpbb_poll_votes_vote_user_id ON phpbb_poll_votes (vote_user_id);
-CREATE INDEX phpbb_poll_votes_vote_user_ip ON phpbb_poll_votes (vote_user_ip);
-
-# Table: 'phpbb_posts'
-CREATE TABLE phpbb_posts (
- post_id INTEGER PRIMARY KEY NOT NULL ,
- topic_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- forum_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- poster_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- icon_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- poster_ip varchar(40) NOT NULL DEFAULT '',
- post_time INTEGER UNSIGNED NOT NULL DEFAULT '0',
- post_approved INTEGER UNSIGNED NOT NULL DEFAULT '1',
- post_reported INTEGER UNSIGNED NOT NULL DEFAULT '0',
- enable_bbcode INTEGER UNSIGNED NOT NULL DEFAULT '1',
- enable_smilies INTEGER UNSIGNED NOT NULL DEFAULT '1',
- enable_magic_url INTEGER UNSIGNED NOT NULL DEFAULT '1',
- enable_sig INTEGER UNSIGNED NOT NULL DEFAULT '1',
- post_username varchar(255) NOT NULL DEFAULT '',
- post_subject text(65535) NOT NULL DEFAULT '',
- post_text mediumtext(16777215) NOT NULL DEFAULT '',
- post_checksum varchar(32) NOT NULL DEFAULT '',
- post_attachment INTEGER UNSIGNED NOT NULL DEFAULT '0',
- bbcode_bitfield varchar(255) NOT NULL DEFAULT '',
- bbcode_uid varchar(8) NOT NULL DEFAULT '',
- post_postcount INTEGER UNSIGNED NOT NULL DEFAULT '1',
- post_edit_time INTEGER UNSIGNED NOT NULL DEFAULT '0',
- post_edit_reason text(65535) NOT NULL DEFAULT '',
- post_edit_user INTEGER UNSIGNED NOT NULL DEFAULT '0',
- post_edit_count INTEGER UNSIGNED NOT NULL DEFAULT '0',
- post_edit_locked INTEGER UNSIGNED NOT NULL DEFAULT '0'
-);
-
-CREATE INDEX phpbb_posts_forum_id ON phpbb_posts (forum_id);
-CREATE INDEX phpbb_posts_topic_id ON phpbb_posts (topic_id);
-CREATE INDEX phpbb_posts_poster_ip ON phpbb_posts (poster_ip);
-CREATE INDEX phpbb_posts_poster_id ON phpbb_posts (poster_id);
-CREATE INDEX phpbb_posts_post_approved ON phpbb_posts (post_approved);
-CREATE INDEX phpbb_posts_post_username ON phpbb_posts (post_username);
-CREATE INDEX phpbb_posts_tid_post_time ON phpbb_posts (topic_id, post_time);
-
-# Table: 'phpbb_privmsgs'
-CREATE TABLE phpbb_privmsgs (
- msg_id INTEGER PRIMARY KEY NOT NULL ,
- root_level INTEGER UNSIGNED NOT NULL DEFAULT '0',
- author_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- icon_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- author_ip varchar(40) NOT NULL DEFAULT '',
- message_time INTEGER UNSIGNED NOT NULL DEFAULT '0',
- enable_bbcode INTEGER UNSIGNED NOT NULL DEFAULT '1',
- enable_smilies INTEGER UNSIGNED NOT NULL DEFAULT '1',
- enable_magic_url INTEGER UNSIGNED NOT NULL DEFAULT '1',
- enable_sig INTEGER UNSIGNED NOT NULL DEFAULT '1',
- message_subject text(65535) NOT NULL DEFAULT '',
- message_text mediumtext(16777215) NOT NULL DEFAULT '',
- message_edit_reason text(65535) NOT NULL DEFAULT '',
- message_edit_user INTEGER UNSIGNED NOT NULL DEFAULT '0',
- message_attachment INTEGER UNSIGNED NOT NULL DEFAULT '0',
- bbcode_bitfield varchar(255) NOT NULL DEFAULT '',
- bbcode_uid varchar(8) NOT NULL DEFAULT '',
- message_edit_time INTEGER UNSIGNED NOT NULL DEFAULT '0',
- message_edit_count INTEGER UNSIGNED NOT NULL DEFAULT '0',
- to_address text(65535) NOT NULL DEFAULT '',
- bcc_address text(65535) NOT NULL DEFAULT '',
- message_reported INTEGER UNSIGNED NOT NULL DEFAULT '0'
-);
-
-CREATE INDEX phpbb_privmsgs_author_ip ON phpbb_privmsgs (author_ip);
-CREATE INDEX phpbb_privmsgs_message_time ON phpbb_privmsgs (message_time);
-CREATE INDEX phpbb_privmsgs_author_id ON phpbb_privmsgs (author_id);
-CREATE INDEX phpbb_privmsgs_root_level ON phpbb_privmsgs (root_level);
-
-# Table: 'phpbb_privmsgs_folder'
-CREATE TABLE phpbb_privmsgs_folder (
- folder_id INTEGER PRIMARY KEY NOT NULL ,
- user_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- folder_name varchar(255) NOT NULL DEFAULT '',
- pm_count INTEGER UNSIGNED NOT NULL DEFAULT '0'
-);
-
-CREATE INDEX phpbb_privmsgs_folder_user_id ON phpbb_privmsgs_folder (user_id);
-
-# Table: 'phpbb_privmsgs_rules'
-CREATE TABLE phpbb_privmsgs_rules (
- rule_id INTEGER PRIMARY KEY NOT NULL ,
- user_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- rule_check INTEGER UNSIGNED NOT NULL DEFAULT '0',
- rule_connection INTEGER UNSIGNED NOT NULL DEFAULT '0',
- rule_string varchar(255) NOT NULL DEFAULT '',
- rule_user_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- rule_group_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- rule_action INTEGER UNSIGNED NOT NULL DEFAULT '0',
- rule_folder_id int(11) NOT NULL DEFAULT '0'
-);
-
-CREATE INDEX phpbb_privmsgs_rules_user_id ON phpbb_privmsgs_rules (user_id);
-
-# Table: 'phpbb_privmsgs_to'
-CREATE TABLE phpbb_privmsgs_to (
- msg_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- user_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- author_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- pm_deleted INTEGER UNSIGNED NOT NULL DEFAULT '0',
- pm_new INTEGER UNSIGNED NOT NULL DEFAULT '1',
- pm_unread INTEGER UNSIGNED NOT NULL DEFAULT '1',
- pm_replied INTEGER UNSIGNED NOT NULL DEFAULT '0',
- pm_marked INTEGER UNSIGNED NOT NULL DEFAULT '0',
- pm_forwarded INTEGER UNSIGNED NOT NULL DEFAULT '0',
- folder_id int(11) NOT NULL DEFAULT '0'
-);
-
-CREATE INDEX phpbb_privmsgs_to_msg_id ON phpbb_privmsgs_to (msg_id);
-CREATE INDEX phpbb_privmsgs_to_author_id ON phpbb_privmsgs_to (author_id);
-CREATE INDEX phpbb_privmsgs_to_usr_flder_id ON phpbb_privmsgs_to (user_id, folder_id);
-
-# Table: 'phpbb_profile_fields'
-CREATE TABLE phpbb_profile_fields (
- field_id INTEGER PRIMARY KEY NOT NULL ,
- field_name varchar(255) NOT NULL DEFAULT '',
- field_type tinyint(4) NOT NULL DEFAULT '0',
- field_ident varchar(20) NOT NULL DEFAULT '',
- field_length varchar(20) NOT NULL DEFAULT '',
- field_minlen varchar(255) NOT NULL DEFAULT '',
- field_maxlen varchar(255) NOT NULL DEFAULT '',
- field_novalue varchar(255) NOT NULL DEFAULT '',
- field_default_value varchar(255) NOT NULL DEFAULT '',
- field_validation varchar(20) NOT NULL DEFAULT '',
- field_required INTEGER UNSIGNED NOT NULL DEFAULT '0',
- field_show_novalue INTEGER UNSIGNED NOT NULL DEFAULT '0',
- field_show_on_reg INTEGER UNSIGNED NOT NULL DEFAULT '0',
- field_show_on_vt INTEGER UNSIGNED NOT NULL DEFAULT '0',
- field_show_profile INTEGER UNSIGNED NOT NULL DEFAULT '0',
- field_hide INTEGER UNSIGNED NOT NULL DEFAULT '0',
- field_no_view INTEGER UNSIGNED NOT NULL DEFAULT '0',
- field_active INTEGER UNSIGNED NOT NULL DEFAULT '0',
- field_order INTEGER UNSIGNED NOT NULL DEFAULT '0'
-);
-
-CREATE INDEX phpbb_profile_fields_fld_type ON phpbb_profile_fields (field_type);
-CREATE INDEX phpbb_profile_fields_fld_ordr ON phpbb_profile_fields (field_order);
-
-# Table: 'phpbb_profile_fields_data'
-CREATE TABLE phpbb_profile_fields_data (
- user_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- PRIMARY KEY (user_id)
-);
-
-
-# Table: 'phpbb_profile_fields_lang'
-CREATE TABLE phpbb_profile_fields_lang (
- field_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- lang_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- option_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- field_type tinyint(4) NOT NULL DEFAULT '0',
- lang_value varchar(255) NOT NULL DEFAULT '',
- PRIMARY KEY (field_id, lang_id, option_id)
-);
-
-
-# Table: 'phpbb_profile_lang'
-CREATE TABLE phpbb_profile_lang (
- field_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- lang_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- lang_name varchar(255) NOT NULL DEFAULT '',
- lang_explain text(65535) NOT NULL DEFAULT '',
- lang_default_value varchar(255) NOT NULL DEFAULT '',
- PRIMARY KEY (field_id, lang_id)
-);
-
-
-# Table: 'phpbb_ranks'
-CREATE TABLE phpbb_ranks (
- rank_id INTEGER PRIMARY KEY NOT NULL ,
- rank_title varchar(255) NOT NULL DEFAULT '',
- rank_min INTEGER UNSIGNED NOT NULL DEFAULT '0',
- rank_special INTEGER UNSIGNED NOT NULL DEFAULT '0',
- rank_image varchar(255) NOT NULL DEFAULT ''
-);
-
-
-# Table: 'phpbb_reports'
-CREATE TABLE phpbb_reports (
- report_id INTEGER PRIMARY KEY NOT NULL ,
- reason_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- post_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- pm_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- user_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- user_notify INTEGER UNSIGNED NOT NULL DEFAULT '0',
- report_closed INTEGER UNSIGNED NOT NULL DEFAULT '0',
- report_time INTEGER UNSIGNED NOT NULL DEFAULT '0',
- report_text mediumtext(16777215) NOT NULL DEFAULT ''
-);
-
-CREATE INDEX phpbb_reports_post_id ON phpbb_reports (post_id);
-CREATE INDEX phpbb_reports_pm_id ON phpbb_reports (pm_id);
-
-# Table: 'phpbb_reports_reasons'
-CREATE TABLE phpbb_reports_reasons (
- reason_id INTEGER PRIMARY KEY NOT NULL ,
- reason_title varchar(255) NOT NULL DEFAULT '',
- reason_description mediumtext(16777215) NOT NULL DEFAULT '',
- reason_order INTEGER UNSIGNED NOT NULL DEFAULT '0'
-);
-
-
-# Table: 'phpbb_search_results'
-CREATE TABLE phpbb_search_results (
- search_key varchar(32) NOT NULL DEFAULT '',
- search_time INTEGER UNSIGNED NOT NULL DEFAULT '0',
- search_keywords mediumtext(16777215) NOT NULL DEFAULT '',
- search_authors mediumtext(16777215) NOT NULL DEFAULT '',
- PRIMARY KEY (search_key)
-);
-
-
-# Table: 'phpbb_search_wordlist'
-CREATE TABLE phpbb_search_wordlist (
- word_id INTEGER PRIMARY KEY NOT NULL ,
- word_text varchar(255) NOT NULL DEFAULT '',
- word_common INTEGER UNSIGNED NOT NULL DEFAULT '0',
- word_count INTEGER UNSIGNED NOT NULL DEFAULT '0'
-);
-
-CREATE UNIQUE INDEX phpbb_search_wordlist_wrd_txt ON phpbb_search_wordlist (word_text);
-CREATE INDEX phpbb_search_wordlist_wrd_cnt ON phpbb_search_wordlist (word_count);
-
-# Table: 'phpbb_search_wordmatch'
-CREATE TABLE phpbb_search_wordmatch (
- post_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- word_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- title_match INTEGER UNSIGNED NOT NULL DEFAULT '0'
-);
-
-CREATE UNIQUE INDEX phpbb_search_wordmatch_unq_mtch ON phpbb_search_wordmatch (word_id, post_id, title_match);
-CREATE INDEX phpbb_search_wordmatch_word_id ON phpbb_search_wordmatch (word_id);
-CREATE INDEX phpbb_search_wordmatch_post_id ON phpbb_search_wordmatch (post_id);
-
-# Table: 'phpbb_sessions'
-CREATE TABLE phpbb_sessions (
- session_id char(32) NOT NULL DEFAULT '',
- session_user_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- session_forum_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- session_last_visit INTEGER UNSIGNED NOT NULL DEFAULT '0',
- session_start INTEGER UNSIGNED NOT NULL DEFAULT '0',
- session_time INTEGER UNSIGNED NOT NULL DEFAULT '0',
- session_ip varchar(40) NOT NULL DEFAULT '',
- session_browser varchar(150) NOT NULL DEFAULT '',
- session_forwarded_for varchar(255) NOT NULL DEFAULT '',
- session_page varchar(255) NOT NULL DEFAULT '',
- session_viewonline INTEGER UNSIGNED NOT NULL DEFAULT '1',
- session_autologin INTEGER UNSIGNED NOT NULL DEFAULT '0',
- session_admin INTEGER UNSIGNED NOT NULL DEFAULT '0',
- PRIMARY KEY (session_id)
-);
-
-CREATE INDEX phpbb_sessions_session_time ON phpbb_sessions (session_time);
-CREATE INDEX phpbb_sessions_session_user_id ON phpbb_sessions (session_user_id);
-CREATE INDEX phpbb_sessions_session_fid ON phpbb_sessions (session_forum_id);
-
-# Table: 'phpbb_sessions_keys'
-CREATE TABLE phpbb_sessions_keys (
- key_id char(32) NOT NULL DEFAULT '',
- user_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- last_ip varchar(40) NOT NULL DEFAULT '',
- last_login INTEGER UNSIGNED NOT NULL DEFAULT '0',
- PRIMARY KEY (key_id, user_id)
-);
-
-CREATE INDEX phpbb_sessions_keys_last_login ON phpbb_sessions_keys (last_login);
-
-# Table: 'phpbb_sitelist'
-CREATE TABLE phpbb_sitelist (
- site_id INTEGER PRIMARY KEY NOT NULL ,
- site_ip varchar(40) NOT NULL DEFAULT '',
- site_hostname varchar(255) NOT NULL DEFAULT '',
- ip_exclude INTEGER UNSIGNED NOT NULL DEFAULT '0'
-);
-
-
-# Table: 'phpbb_smilies'
-CREATE TABLE phpbb_smilies (
- smiley_id INTEGER PRIMARY KEY NOT NULL ,
- code varchar(50) NOT NULL DEFAULT '',
- emotion varchar(50) NOT NULL DEFAULT '',
- smiley_url varchar(50) NOT NULL DEFAULT '',
- smiley_width INTEGER UNSIGNED NOT NULL DEFAULT '0',
- smiley_height INTEGER UNSIGNED NOT NULL DEFAULT '0',
- smiley_order INTEGER UNSIGNED NOT NULL DEFAULT '0',
- display_on_posting INTEGER UNSIGNED NOT NULL DEFAULT '1'
-);
-
-CREATE INDEX phpbb_smilies_display_on_post ON phpbb_smilies (display_on_posting);
-
-# Table: 'phpbb_styles'
-CREATE TABLE phpbb_styles (
- style_id INTEGER PRIMARY KEY NOT NULL ,
- style_name varchar(255) NOT NULL DEFAULT '',
- style_copyright varchar(255) NOT NULL DEFAULT '',
- style_active INTEGER UNSIGNED NOT NULL DEFAULT '1',
- template_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- theme_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- imageset_id INTEGER UNSIGNED NOT NULL DEFAULT '0'
-);
-
-CREATE UNIQUE INDEX phpbb_styles_style_name ON phpbb_styles (style_name);
-CREATE INDEX phpbb_styles_template_id ON phpbb_styles (template_id);
-CREATE INDEX phpbb_styles_theme_id ON phpbb_styles (theme_id);
-CREATE INDEX phpbb_styles_imageset_id ON phpbb_styles (imageset_id);
-
-# Table: 'phpbb_styles_template'
-CREATE TABLE phpbb_styles_template (
- template_id INTEGER PRIMARY KEY NOT NULL ,
- template_name varchar(255) NOT NULL DEFAULT '',
- template_copyright varchar(255) NOT NULL DEFAULT '',
- template_path varchar(100) NOT NULL DEFAULT '',
- bbcode_bitfield varchar(255) NOT NULL DEFAULT 'kNg=',
- template_storedb INTEGER UNSIGNED NOT NULL DEFAULT '0',
- template_inherits_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- template_inherit_path varchar(255) NOT NULL DEFAULT ''
-);
-
-CREATE UNIQUE INDEX phpbb_styles_template_tmplte_nm ON phpbb_styles_template (template_name);
-
-# Table: 'phpbb_styles_template_data'
-CREATE TABLE phpbb_styles_template_data (
- template_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- template_filename varchar(100) NOT NULL DEFAULT '',
- template_included text(65535) NOT NULL DEFAULT '',
- template_mtime INTEGER UNSIGNED NOT NULL DEFAULT '0',
- template_data mediumtext(16777215) NOT NULL DEFAULT ''
-);
-
-CREATE INDEX phpbb_styles_template_data_tid ON phpbb_styles_template_data (template_id);
-CREATE INDEX phpbb_styles_template_data_tfn ON phpbb_styles_template_data (template_filename);
-
-# Table: 'phpbb_styles_theme'
-CREATE TABLE phpbb_styles_theme (
- theme_id INTEGER PRIMARY KEY NOT NULL ,
- theme_name varchar(255) NOT NULL DEFAULT '',
- theme_copyright varchar(255) NOT NULL DEFAULT '',
- theme_path varchar(100) NOT NULL DEFAULT '',
- theme_storedb INTEGER UNSIGNED NOT NULL DEFAULT '0',
- theme_mtime INTEGER UNSIGNED NOT NULL DEFAULT '0',
- theme_data mediumtext(16777215) NOT NULL DEFAULT ''
-);
-
-CREATE UNIQUE INDEX phpbb_styles_theme_theme_name ON phpbb_styles_theme (theme_name);
-
-# Table: 'phpbb_styles_imageset'
-CREATE TABLE phpbb_styles_imageset (
- imageset_id INTEGER PRIMARY KEY NOT NULL ,
- imageset_name varchar(255) NOT NULL DEFAULT '',
- imageset_copyright varchar(255) NOT NULL DEFAULT '',
- imageset_path varchar(100) NOT NULL DEFAULT ''
-);
-
-CREATE UNIQUE INDEX phpbb_styles_imageset_imgset_nm ON phpbb_styles_imageset (imageset_name);
-
-# Table: 'phpbb_styles_imageset_data'
-CREATE TABLE phpbb_styles_imageset_data (
- image_id INTEGER PRIMARY KEY NOT NULL ,
- image_name varchar(200) NOT NULL DEFAULT '',
- image_filename varchar(200) NOT NULL DEFAULT '',
- image_lang varchar(30) NOT NULL DEFAULT '',
- image_height INTEGER UNSIGNED NOT NULL DEFAULT '0',
- image_width INTEGER UNSIGNED NOT NULL DEFAULT '0',
- imageset_id INTEGER UNSIGNED NOT NULL DEFAULT '0'
-);
-
-CREATE INDEX phpbb_styles_imageset_data_i_d ON phpbb_styles_imageset_data (imageset_id);
-
-# Table: 'phpbb_topics'
-CREATE TABLE phpbb_topics (
- topic_id INTEGER PRIMARY KEY NOT NULL ,
- forum_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- icon_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- topic_attachment INTEGER UNSIGNED NOT NULL DEFAULT '0',
- topic_approved INTEGER UNSIGNED NOT NULL DEFAULT '1',
- topic_reported INTEGER UNSIGNED NOT NULL DEFAULT '0',
- topic_title text(65535) NOT NULL DEFAULT '',
- topic_poster INTEGER UNSIGNED NOT NULL DEFAULT '0',
- topic_time INTEGER UNSIGNED NOT NULL DEFAULT '0',
- topic_time_limit INTEGER UNSIGNED NOT NULL DEFAULT '0',
- topic_views INTEGER UNSIGNED NOT NULL DEFAULT '0',
- topic_replies INTEGER UNSIGNED NOT NULL DEFAULT '0',
- topic_replies_real INTEGER UNSIGNED NOT NULL DEFAULT '0',
- topic_status tinyint(3) NOT NULL DEFAULT '0',
- topic_type tinyint(3) NOT NULL DEFAULT '0',
- topic_first_post_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- topic_first_poster_name varchar(255) NOT NULL DEFAULT '',
- topic_first_poster_colour varchar(6) NOT NULL DEFAULT '',
- topic_last_post_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- topic_last_poster_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- topic_last_poster_name varchar(255) NOT NULL DEFAULT '',
- topic_last_poster_colour varchar(6) NOT NULL DEFAULT '',
- topic_last_post_subject text(65535) NOT NULL DEFAULT '',
- topic_last_post_time INTEGER UNSIGNED NOT NULL DEFAULT '0',
- topic_last_view_time INTEGER UNSIGNED NOT NULL DEFAULT '0',
- topic_moved_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- topic_bumped INTEGER UNSIGNED NOT NULL DEFAULT '0',
- topic_bumper INTEGER UNSIGNED NOT NULL DEFAULT '0',
- poll_title text(65535) NOT NULL DEFAULT '',
- poll_start INTEGER UNSIGNED NOT NULL DEFAULT '0',
- poll_length INTEGER UNSIGNED NOT NULL DEFAULT '0',
- poll_max_options tinyint(4) NOT NULL DEFAULT '1',
- poll_last_vote INTEGER UNSIGNED NOT NULL DEFAULT '0',
- poll_vote_change INTEGER UNSIGNED NOT NULL DEFAULT '0'
-);
-
-CREATE INDEX phpbb_topics_forum_id ON phpbb_topics (forum_id);
-CREATE INDEX phpbb_topics_forum_id_type ON phpbb_topics (forum_id, topic_type);
-CREATE INDEX phpbb_topics_last_post_time ON phpbb_topics (topic_last_post_time);
-CREATE INDEX phpbb_topics_topic_approved ON phpbb_topics (topic_approved);
-CREATE INDEX phpbb_topics_forum_appr_last ON phpbb_topics (forum_id, topic_approved, topic_last_post_id);
-CREATE INDEX phpbb_topics_fid_time_moved ON phpbb_topics (forum_id, topic_last_post_time, topic_moved_id);
-
-# Table: 'phpbb_topics_track'
-CREATE TABLE phpbb_topics_track (
- user_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- topic_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- forum_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- mark_time INTEGER UNSIGNED NOT NULL DEFAULT '0',
- PRIMARY KEY (user_id, topic_id)
-);
-
-CREATE INDEX phpbb_topics_track_topic_id ON phpbb_topics_track (topic_id);
-CREATE INDEX phpbb_topics_track_forum_id ON phpbb_topics_track (forum_id);
-
-# Table: 'phpbb_topics_posted'
-CREATE TABLE phpbb_topics_posted (
- user_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- topic_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- topic_posted INTEGER UNSIGNED NOT NULL DEFAULT '0',
- PRIMARY KEY (user_id, topic_id)
-);
-
-
-# Table: 'phpbb_topics_watch'
-CREATE TABLE phpbb_topics_watch (
- topic_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- user_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- notify_status INTEGER UNSIGNED NOT NULL DEFAULT '0'
-);
-
-CREATE INDEX phpbb_topics_watch_topic_id ON phpbb_topics_watch (topic_id);
-CREATE INDEX phpbb_topics_watch_user_id ON phpbb_topics_watch (user_id);
-CREATE INDEX phpbb_topics_watch_notify_stat ON phpbb_topics_watch (notify_status);
-
-# Table: 'phpbb_user_group'
-CREATE TABLE phpbb_user_group (
- group_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- user_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- group_leader INTEGER UNSIGNED NOT NULL DEFAULT '0',
- user_pending INTEGER UNSIGNED NOT NULL DEFAULT '1'
-);
-
-CREATE INDEX phpbb_user_group_group_id ON phpbb_user_group (group_id);
-CREATE INDEX phpbb_user_group_user_id ON phpbb_user_group (user_id);
-CREATE INDEX phpbb_user_group_group_leader ON phpbb_user_group (group_leader);
-
-# Table: 'phpbb_users'
-CREATE TABLE phpbb_users (
- user_id INTEGER PRIMARY KEY NOT NULL ,
- user_type tinyint(2) NOT NULL DEFAULT '0',
- group_id INTEGER UNSIGNED NOT NULL DEFAULT '3',
- user_permissions mediumtext(16777215) NOT NULL DEFAULT '',
- user_perm_from INTEGER UNSIGNED NOT NULL DEFAULT '0',
- user_ip varchar(40) NOT NULL DEFAULT '',
- user_regdate INTEGER UNSIGNED NOT NULL DEFAULT '0',
- username varchar(255) NOT NULL DEFAULT '',
- username_clean varchar(255) NOT NULL DEFAULT '',
- user_password varchar(40) NOT NULL DEFAULT '',
- user_passchg INTEGER UNSIGNED NOT NULL DEFAULT '0',
- user_pass_convert INTEGER UNSIGNED NOT NULL DEFAULT '0',
- user_email varchar(100) NOT NULL DEFAULT '',
- user_email_hash bigint(20) NOT NULL DEFAULT '0',
- user_birthday varchar(10) NOT NULL DEFAULT '',
- user_lastvisit INTEGER UNSIGNED NOT NULL DEFAULT '0',
- user_lastmark INTEGER UNSIGNED NOT NULL DEFAULT '0',
- user_lastpost_time INTEGER UNSIGNED NOT NULL DEFAULT '0',
- user_lastpage varchar(200) NOT NULL DEFAULT '',
- user_last_confirm_key varchar(10) NOT NULL DEFAULT '',
- user_last_search INTEGER UNSIGNED NOT NULL DEFAULT '0',
- user_warnings tinyint(4) NOT NULL DEFAULT '0',
- user_last_warning INTEGER UNSIGNED NOT NULL DEFAULT '0',
- user_login_attempts tinyint(4) NOT NULL DEFAULT '0',
- user_inactive_reason tinyint(2) NOT NULL DEFAULT '0',
- user_inactive_time INTEGER UNSIGNED NOT NULL DEFAULT '0',
- user_posts INTEGER UNSIGNED NOT NULL DEFAULT '0',
- user_lang varchar(30) NOT NULL DEFAULT '',
- user_timezone decimal(5,2) NOT NULL DEFAULT '0',
- user_dst INTEGER UNSIGNED NOT NULL DEFAULT '0',
- user_dateformat varchar(30) NOT NULL DEFAULT 'd M Y H:i',
- user_style INTEGER UNSIGNED NOT NULL DEFAULT '0',
- user_rank INTEGER UNSIGNED NOT NULL DEFAULT '0',
- user_colour varchar(6) NOT NULL DEFAULT '',
- user_new_privmsg int(4) NOT NULL DEFAULT '0',
- user_unread_privmsg int(4) NOT NULL DEFAULT '0',
- user_last_privmsg INTEGER UNSIGNED NOT NULL DEFAULT '0',
- user_message_rules INTEGER UNSIGNED NOT NULL DEFAULT '0',
- user_full_folder int(11) NOT NULL DEFAULT '-3',
- user_emailtime INTEGER UNSIGNED NOT NULL DEFAULT '0',
- user_topic_show_days INTEGER UNSIGNED NOT NULL DEFAULT '0',
- user_topic_sortby_type varchar(1) NOT NULL DEFAULT 't',
- user_topic_sortby_dir varchar(1) NOT NULL DEFAULT 'd',
- user_post_show_days INTEGER UNSIGNED NOT NULL DEFAULT '0',
- user_post_sortby_type varchar(1) NOT NULL DEFAULT 't',
- user_post_sortby_dir varchar(1) NOT NULL DEFAULT 'a',
- user_notify INTEGER UNSIGNED NOT NULL DEFAULT '0',
- user_notify_pm INTEGER UNSIGNED NOT NULL DEFAULT '1',
- user_notify_type tinyint(4) NOT NULL DEFAULT '0',
- user_allow_pm INTEGER UNSIGNED NOT NULL DEFAULT '1',
- user_allow_viewonline INTEGER UNSIGNED NOT NULL DEFAULT '1',
- user_allow_viewemail INTEGER UNSIGNED NOT NULL DEFAULT '1',
- user_allow_massemail INTEGER UNSIGNED NOT NULL DEFAULT '1',
- user_options INTEGER UNSIGNED NOT NULL DEFAULT '230271',
- user_avatar varchar(255) NOT NULL DEFAULT '',
- user_avatar_type tinyint(2) NOT NULL DEFAULT '0',
- user_avatar_width INTEGER UNSIGNED NOT NULL DEFAULT '0',
- user_avatar_height INTEGER UNSIGNED NOT NULL DEFAULT '0',
- user_sig mediumtext(16777215) NOT NULL DEFAULT '',
- user_sig_bbcode_uid varchar(8) NOT NULL DEFAULT '',
- user_sig_bbcode_bitfield varchar(255) NOT NULL DEFAULT '',
- user_from varchar(100) NOT NULL DEFAULT '',
- user_icq varchar(15) NOT NULL DEFAULT '',
- user_aim varchar(255) NOT NULL DEFAULT '',
- user_yim varchar(255) NOT NULL DEFAULT '',
- user_msnm varchar(255) NOT NULL DEFAULT '',
- user_jabber varchar(255) NOT NULL DEFAULT '',
- user_website varchar(200) NOT NULL DEFAULT '',
- user_occ text(65535) NOT NULL DEFAULT '',
- user_interests text(65535) NOT NULL DEFAULT '',
- user_actkey varchar(32) NOT NULL DEFAULT '',
- user_newpasswd varchar(40) NOT NULL DEFAULT '',
- user_form_salt varchar(32) NOT NULL DEFAULT '',
- user_new INTEGER UNSIGNED NOT NULL DEFAULT '1',
- user_reminded tinyint(4) NOT NULL DEFAULT '0',
- user_reminded_time INTEGER UNSIGNED NOT NULL DEFAULT '0'
-);
-
-CREATE INDEX phpbb_users_user_birthday ON phpbb_users (user_birthday);
-CREATE INDEX phpbb_users_user_email_hash ON phpbb_users (user_email_hash);
-CREATE INDEX phpbb_users_user_type ON phpbb_users (user_type);
-CREATE UNIQUE INDEX phpbb_users_username_clean ON phpbb_users (username_clean);
-
-# Table: 'phpbb_warnings'
-CREATE TABLE phpbb_warnings (
- warning_id INTEGER PRIMARY KEY NOT NULL ,
- user_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- post_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- log_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- warning_time INTEGER UNSIGNED NOT NULL DEFAULT '0'
-);
-
-
-# Table: 'phpbb_words'
-CREATE TABLE phpbb_words (
- word_id INTEGER PRIMARY KEY NOT NULL ,
- word varchar(255) NOT NULL DEFAULT '',
- replacement varchar(255) NOT NULL DEFAULT ''
-);
-
-
-# Table: 'phpbb_zebra'
-CREATE TABLE phpbb_zebra (
- user_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- zebra_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- friend INTEGER UNSIGNED NOT NULL DEFAULT '0',
- foe INTEGER UNSIGNED NOT NULL DEFAULT '0',
- PRIMARY KEY (user_id, zebra_id)
-);
-
-
-
-COMMIT; \ No newline at end of file
diff --git a/phpBB/language/en/acp/attachments.php b/phpBB/language/en/acp/attachments.php
index 6aeb3c2188..750f2f8d61 100644
--- a/phpBB/language/en/acp/attachments.php
+++ b/phpBB/language/en/acp/attachments.php
@@ -1,12 +1,13 @@
<?php
/**
*
-* acp_attachments [English]
+* This file is part of the phpBB Forum Software package.
*
-* @package language
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -62,6 +63,7 @@ $lang = array_merge($lang, array(
'ATTACH_MAX_PM_FILESIZE_EXPLAIN' => 'Maximum size of each file, with 0 being unlimited, attached to a private message.',
'ATTACH_ORPHAN_URL' => 'Orphan attachments',
'ATTACH_POST_ID' => 'Post ID',
+ 'ATTACH_POST_TYPE' => 'Post type',
'ATTACH_QUOTA' => 'Total attachment quota',
'ATTACH_QUOTA_EXPLAIN' => 'Maximum drive space available for attachments for the whole board, with 0 being unlimited.',
'ATTACH_TO_POST' => 'Attach file to post',
@@ -107,12 +109,15 @@ $lang = array_merge($lang, array(
'EXT_GROUP_REAL_MEDIA' => 'Real Media',
'EXT_GROUP_WINDOWS_MEDIA' => 'Windows Media',
+ 'FILES_GONE' => 'Some of the attachments you selected for deletion do not exist. They may have been already deleted. Attachments that did exist were deleted.',
+ 'FILES_STATS_WRONG' => 'Your file statistics are likely inaccurate and need to be resynchronised. Actual values: number of attachments = %1$d, total size of attachments = %2$s.<br />Click %3$shere%4$s to resynchronise them.',
+
'GO_TO_EXTENSIONS' => 'Go to extension management screen',
'GROUP_NAME' => 'Group name',
'IMAGE_LINK_SIZE' => 'Image link dimensions',
'IMAGE_LINK_SIZE_EXPLAIN' => 'Display image attachment as an inline text link if image is larger than this. To disable this behaviour, set the values to 0px by 0px.',
- 'IMAGICK_PATH' => 'Imagemagick path',
+ 'IMAGICK_PATH' => 'ImageMagick path',
'IMAGICK_PATH_EXPLAIN' => 'Full path to the imagemagick convert application, e.g. <samp>/usr/bin/</samp>.',
'MAX_ATTACHMENTS' => 'Maximum number of attachments per post',
@@ -120,7 +125,7 @@ $lang = array_merge($lang, array(
'MAX_EXTGROUP_FILESIZE' => 'Maximum file size',
'MAX_IMAGE_SIZE' => 'Maximum image dimensions',
'MAX_IMAGE_SIZE_EXPLAIN' => 'Maximum size of image attachments. Set both values to 0px by 0px to disable dimension checking.',
- 'MAX_THUMB_WIDTH' => 'Maximum thumbnail width in pixel',
+ 'MAX_THUMB_WIDTH' => 'Maximum thumbnail width/height in pixel',
'MAX_THUMB_WIDTH_EXPLAIN' => 'A generated thumbnail will not exceed the width set here.',
'MIN_THUMB_FILESIZE' => 'Minimum thumbnail file size',
'MIN_THUMB_FILESIZE_EXPLAIN' => 'Do not create a thumbnail for images smaller than this.',
@@ -130,6 +135,7 @@ $lang = array_merge($lang, array(
'NOT_ALLOWED_IN_PM' => 'Only allowed in posts',
'NOT_ALLOWED_IN_PM_POST' => 'Not allowed',
'NOT_ASSIGNED' => 'Not assigned',
+ 'NO_ATTACHMENTS' => 'No attachments found for this period.',
'NO_EXT_GROUP' => 'None',
'NO_EXT_GROUP_NAME' => 'No group name entered',
'NO_EXT_GROUP_SPECIFIED' => 'No extension group specified.',
@@ -143,10 +149,11 @@ $lang = array_merge($lang, array(
'ORDER_ALLOW_DENY' => 'Allow',
'ORDER_DENY_ALLOW' => 'Deny',
- 'REMOVE_ALLOWED_IPS' => 'Remove or un-exclude <em>allowed</em> IPs/hostnames',
- 'REMOVE_DISALLOWED_IPS' => 'Remove or un-exclude <em>disallowed</em> IPs/hostnames',
+ 'REMOVE_ALLOWED_IPS' => 'Remove or un-exclude <em>allowed</em> IPs/hostnames',
+ 'REMOVE_DISALLOWED_IPS' => 'Remove or un-exclude <em>disallowed</em> IPs/hostnames',
+ 'RESYNC_FILES_STATS_CONFIRM' => 'Are you sure you wish to resynchronise file statistics?',
- 'SEARCH_IMAGICK' => 'Search for Imagemagick',
+ 'SEARCH_IMAGICK' => 'Search for ImageMagick',
'SECURE_ALLOW_DENY' => 'Allow/Deny list',
'SECURE_ALLOW_DENY_EXPLAIN' => 'Change the default behaviour when secure downloads are enabled of the Allow/Deny list to that of a <strong>whitelist</strong> (Allow) or a <strong>blacklist</strong> (Deny).',
'SECURE_DOWNLOADS' => 'Enable secure downloads',
@@ -170,5 +177,3 @@ $lang = array_merge($lang, array(
'UPLOAD_ICON' => 'Upload icon',
'UPLOAD_NOT_DIR' => 'The upload location you specified does not appear to be a directory.',
));
-
-?> \ No newline at end of file
diff --git a/phpBB/language/en/acp/ban.php b/phpBB/language/en/acp/ban.php
index bc547b6d8f..93d5cf9a8b 100644
--- a/phpBB/language/en/acp/ban.php
+++ b/phpBB/language/en/acp/ban.php
@@ -1,12 +1,13 @@
<?php
/**
*
-* acp_ban [English]
+* This file is part of the phpBB Forum Software package.
*
-* @package language
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -41,7 +42,7 @@ $lang = array_merge($lang, array(
'30_MINS' => '30 minutes',
'6_HOURS' => '6 hours',
- 'ACP_BAN_EXPLAIN' => 'Here you can control the banning of users by name, IP or e-mail address. These methods prevent a user reaching any part of the board. You can give a short (maximum 3000 characters) reason for the ban if you wish. This will be displayed in the admin log. The duration of a ban can also be specified. If you want the ban to end on a specific date rather than after a set time period select <span style="text-decoration: underline;">Until -&gt;</span> for the ban length and enter a date in <kbd>YYYY-MM-DD</kbd> format.',
+ 'ACP_BAN_EXPLAIN' => 'Here you can control the banning of users by name, IP or email address. These methods prevent a user reaching any part of the board. You can give a short (maximum 3000 characters) reason for the ban if you wish. This will be displayed in the admin log. The duration of a ban can also be specified. If you want the ban to end on a specific date rather than after a set time period select <span style="text-decoration: underline;">Until -&gt;</span> for the ban length and enter a date in <kbd>YYYY-MM-DD</kbd> format.',
'BAN_EXCLUDE' => 'Exclude from banning',
'BAN_LENGTH' => 'Length of ban',
@@ -51,12 +52,12 @@ $lang = array_merge($lang, array(
'BANNED_UNTIL_DATE' => 'until %s', // Example: "until Mon 13.Jul.2009, 14:44"
'BANNED_UNTIL_DURATION' => '%1$s (until %2$s)', // Example: "7 days (until Tue 14.Jul.2009, 14:44)"
- 'EMAIL_BAN' => 'Ban one or more e-mail addresses',
- 'EMAIL_BAN_EXCLUDE_EXPLAIN' => 'Enable this to exclude the entered e-mail address from all current bans.',
- 'EMAIL_BAN_EXPLAIN' => 'To specify more than one e-mail address enter each on a new line. To match partial addresses use * as the wildcard, e.g. <samp>*@hotmail.com</samp>, <samp>*@*.domain.tld</samp>, etc.',
- 'EMAIL_NO_BANNED' => 'No banned e-mail addresses',
- 'EMAIL_UNBAN' => 'Un-ban or un-exclude e-mails',
- 'EMAIL_UNBAN_EXPLAIN' => 'You can unban (or un-exclude) multiple e-mail addresses in one go using the appropriate combination of mouse and keyboard for your computer and browser. Excluded e-mail addresses are emphasised.',
+ 'EMAIL_BAN' => 'Ban one or more email addresses',
+ 'EMAIL_BAN_EXCLUDE_EXPLAIN' => 'Enable this to exclude the entered email address from all current bans.',
+ 'EMAIL_BAN_EXPLAIN' => 'To specify more than one email address enter each on a new line. To match partial addresses use * as the wildcard, e.g. <samp>*@hotmail.com</samp>, <samp>*@*.domain.tld</samp>, etc.',
+ 'EMAIL_NO_BANNED' => 'No banned email addresses',
+ 'EMAIL_UNBAN' => 'Un-ban or un-exclude emails',
+ 'EMAIL_UNBAN_EXPLAIN' => 'You can unban (or un-exclude) multiple email addresses in one go using the appropriate combination of mouse and keyboard for your computer and browser. Excluded email addresses are emphasised.',
'IP_BAN' => 'Ban one or more IPs',
'IP_BAN_EXCLUDE_EXPLAIN' => 'Enable this to exclude the entered IP from all current bans.',
@@ -81,5 +82,3 @@ $lang = array_merge($lang, array(
'USER_UNBAN' => 'Un-ban or un-exclude users by username',
'USER_UNBAN_EXPLAIN' => 'You can unban (or un-exclude) multiple users in one go using the appropriate combination of mouse and keyboard for your computer and browser. Excluded users are emphasised.',
));
-
-?> \ No newline at end of file
diff --git a/phpBB/language/en/acp/board.php b/phpBB/language/en/acp/board.php
index e109ea6d3a..8bb5327028 100644
--- a/phpBB/language/en/acp/board.php
+++ b/phpBB/language/en/acp/board.php
@@ -1,12 +1,13 @@
<?php
/**
*
-* acp_board [English]
+* This file is part of the phpBB Forum Software package.
*
-* @package language
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -38,18 +39,29 @@ if (empty($lang) || !is_array($lang))
// Board Settings
$lang = array_merge($lang, array(
'ACP_BOARD_SETTINGS_EXPLAIN' => 'Here you can determine the basic operation of your board, give it a fitting name and description, and among other settings adjust the default values for timezone and language.',
+ 'BOARD_INDEX_TEXT' => 'Board index text',
+ 'BOARD_INDEX_TEXT_EXPLAIN' => 'This text is displayed as the board index in the board’s breadcrumbs. If not specified, it will default to “Board index”.',
+ 'BOARD_STYLE' => 'Board style',
'CUSTOM_DATEFORMAT' => 'Custom…',
'DEFAULT_DATE_FORMAT' => 'Date format',
'DEFAULT_DATE_FORMAT_EXPLAIN' => 'The date format is the same as the PHP <code>date</code> function.',
'DEFAULT_LANGUAGE' => 'Default language',
'DEFAULT_STYLE' => 'Default style',
+ 'DEFAULT_STYLE_EXPLAIN' => 'The default style for new users.',
'DISABLE_BOARD' => 'Disable board',
'DISABLE_BOARD_EXPLAIN' => 'This will make the board unavailable to users who are neither administrators nor moderators. You can also enter a short (255 character) message to display if you wish.',
+ 'DISPLAY_LAST_SUBJECT' => 'Display subject of last added post on forum list',
+ 'DISPLAY_LAST_SUBJECT_EXPLAIN' => 'The subject of the last added post will be displayed in the forum list with a hyperlink to the post. Subjects from password protected forums and forums in which user doesn’t have read access are not shown.',
+ 'GUEST_STYLE' => 'Guest style',
+ 'GUEST_STYLE_EXPLAIN' => 'The board style for guests.',
'OVERRIDE_STYLE' => 'Override user style',
- 'OVERRIDE_STYLE_EXPLAIN' => 'Replaces user’s style with the default.',
+ 'OVERRIDE_STYLE_EXPLAIN' => 'Replaces user’s (and guest’s) style with the style as defined under "Default style".',
'SITE_DESC' => 'Site description',
+ 'SITE_HOME_TEXT' => 'Main website text',
+ 'SITE_HOME_TEXT_EXPLAIN' => 'This text will be displayed as a link to your website homepage in the board’s breadcrumbs. If not specified, it will default to “Home”.',
+ 'SITE_HOME_URL' => 'Main website URL',
+ 'SITE_HOME_URL_EXPLAIN' => 'If specified, a link to this URL will be prepended to your board’s breadcrumbs and the board logo will link to this URL instead of the forum index. An absolute URL is required, e.g. <samp>http://www.phpbb.com</samp>.',
'SITE_NAME' => 'Site name',
- 'SYSTEM_DST' => 'Enable Summer Time/<abbr title="Daylight Saving Time">DST</abbr>',
'SYSTEM_TIMEZONE' => 'Guest timezone',
'SYSTEM_TIMEZONE_EXPLAIN' => 'Timezone to use for displaying times to users who are not logged in (guests, bots). Logged in users set their timezone during registration and can change it in their user control panel.',
'WARNINGS_EXPIRE' => 'Warning duration',
@@ -95,6 +107,7 @@ $lang = array_merge($lang, array(
'ALLOW_AVATARS' => 'Enable avatars',
'ALLOW_AVATARS_EXPLAIN' => 'Allow general usage of avatars;<br />If you disable avatars in general or avatars of a certain mode, the disabled avatars will no longer be shown on the board, but users will still be able to download their own avatars in the User Control Panel.',
+ 'ALLOW_GRAVATAR' => 'Enable gravatar avatars',
'ALLOW_LOCAL' => 'Enable gallery avatars',
'ALLOW_REMOTE' => 'Enable remote avatars',
'ALLOW_REMOTE_EXPLAIN' => 'Avatars linked to from another website.',
@@ -102,9 +115,9 @@ $lang = array_merge($lang, array(
'ALLOW_REMOTE_UPLOAD_EXPLAIN' => 'Allow uploading of avatars from another website.',
'ALLOW_UPLOAD' => 'Enable avatar uploading',
'AVATAR_GALLERY_PATH' => 'Avatar gallery path',
- 'AVATAR_GALLERY_PATH_EXPLAIN' => 'Path under your phpBB root directory for pre-loaded images, e.g. <samp>images/avatars/gallery</samp>.',
+ 'AVATAR_GALLERY_PATH_EXPLAIN' => 'Path under your phpBB root directory for pre-loaded images, e.g. <samp>images/avatars/gallery</samp>.<br />Double dots like <samp>../</samp> will be stripped from the path for security reasons.',
'AVATAR_STORAGE_PATH' => 'Avatar storage path',
- 'AVATAR_STORAGE_PATH_EXPLAIN' => 'Path under your phpBB root directory, e.g. <samp>images/avatars/upload</samp>.<br />Avatar uploading <strong>will not be available</strong> if this path is not writable.',
+ 'AVATAR_STORAGE_PATH_EXPLAIN' => 'Path under your phpBB root directory, e.g. <samp>images/avatars/upload</samp>.<br />Avatar uploading <strong>will not be available</strong> if this path is not writable.<br />Double dots like <samp>../</samp> will be stripped from the path for security reasons.',
'MAX_AVATAR_SIZE' => 'Maximum avatar dimensions',
'MAX_AVATAR_SIZE_EXPLAIN' => 'Width x Height in pixels.',
'MAX_FILESIZE' => 'Maximum avatar file size',
@@ -208,7 +221,8 @@ $lang = array_merge($lang, array(
'ACP_REGISTER_SETTINGS_EXPLAIN' => 'Here you are able to define registration and profile related settings.',
'ACC_ACTIVATION' => 'Account activation',
- 'ACC_ACTIVATION_EXPLAIN' => 'This determines whether users have immediate access to the board or if confirmation is required. You can also completely disable new registrations. “Board-wide e-mail” must be enabled in order to use user or admin activation.',
+ 'ACC_ACTIVATION_EXPLAIN' => 'This determines whether users have immediate access to the board or if confirmation is required. You can also completely disable new registrations. <em>“Board-wide email” must be enabled in order to use user or admin activation.</em>',
+ 'ACC_ACTIVATION_WARNING' => 'Please note that the currently selected activation method requires emails to be enabled, otherwise registration will be disabled. We recommend to either select a different activation method or reenable emails.',
'NEW_MEMBER_POST_LIMIT' => 'New member post limit',
'NEW_MEMBER_POST_LIMIT_EXPLAIN' => 'New members are within the <em>Newly Registered Users</em> group until they reach this number of posts. You can use this group to keep them from using the PM system or to review their posts. <strong>A value of 0 disables this feature.</strong>',
'NEW_MEMBER_GROUP_DEFAULT' => 'Set Newly Registered Users group to default',
@@ -217,10 +231,10 @@ $lang = array_merge($lang, array(
'ACC_ADMIN' => 'By admin',
'ACC_DISABLE' => 'Disable registration',
'ACC_NONE' => 'No activation (immediate access)',
- 'ACC_USER' => 'By user (e-mail verification)',
+ 'ACC_USER' => 'By user (email verification)',
// 'ACC_USER_ADMIN' => 'User + Admin',
- 'ALLOW_EMAIL_REUSE' => 'Allow e-mail address re-use',
- 'ALLOW_EMAIL_REUSE_EXPLAIN' => 'Different users can register with the same e-mail address.',
+ 'ALLOW_EMAIL_REUSE' => 'Allow email address re-use',
+ 'ALLOW_EMAIL_REUSE_EXPLAIN' => 'Different users can register with the same email address.',
'COPPA' => 'COPPA',
'COPPA_FAX' => 'COPPA fax number',
'COPPA_MAIL' => 'COPPA mailing address',
@@ -289,6 +303,7 @@ $lang = array_merge($lang, array(
// Visual Confirmation Settings
$lang = array_merge($lang, array(
'ACP_VC_SETTINGS_EXPLAIN' => 'Here you can select and configure plugins, which are designed to block automated form submissions by spambots. These plugins typically work by challenging the user with a <em>CAPTCHA</em>, a test which is designed to be difficult for computers to solve.',
+ 'ACP_VC_EXT_GET_MORE' => 'For additional (and possibly better) anti-spam plugins, visit the <a href="https://www.phpbb.com/go/anti-spam-ext"><strong>phpBB.com Extensions Database</strong></a>. For more information on preventing spam on your board, visit the <a href="https://www.phpbb.com/go/anti-spam"><strong>phpBB.com Knowledge Base</strong></a>.',
'AVAILABLE_CAPTCHAS' => 'Available plugins',
'CAPTCHA_UNAVAILABLE' => 'The plugin cannot be selected as its requirements are not met.',
'CAPTCHA_GD' => 'GD image',
@@ -330,11 +345,14 @@ $lang = array_merge($lang, array(
// Cookie Settings
$lang = array_merge($lang, array(
- 'ACP_COOKIE_SETTINGS_EXPLAIN' => 'These details define the data used to send cookies to your users browsers. In most cases the default values for the cookie settings should be sufficient. If you do need to change any do so with care, incorrect settings can prevent users logging in.',
+ 'ACP_COOKIE_SETTINGS_EXPLAIN' => 'These details define the data used to send cookies to your users browsers. In most cases the default values for the cookie settings should be sufficient. If you do need to change any do so with care, incorrect settings can prevent users logging in. If you have problems with users staying logging in to your board, visit the <b><a href="https://www.phpbb.com/support/go/cookie-settings/">phpBB.com Knowledge Base - Fixing incorrect cookie settings</a></b>.',
'COOKIE_DOMAIN' => 'Cookie domain',
+ 'COOKIE_DOMAIN_EXPLAIN' => 'In most cases the cookie domain is optional. Leave it blank if you are unsure.<br /><br /> In the case where you have a board integrated with other software or have multiple domains, then to determine the cookie domain you need to do the following. If you have something like <i>example.com</i> and <i>forums.example.com</i>, or perhaps <i>forums.example.com</i> and <i>blog.example.com</i>. Remove the subdomains until you find the common domain, <i>example.com</i>. Now add a dot in front of the common domain and you would enter .example.com (note the dot at the beginning).',
'COOKIE_NAME' => 'Cookie name',
+ 'COOKIE_NAME_EXPLAIN' => 'This can be anything what you want, make it original. Whenever the cookie settings are changed the name of the cookie should be changed.',
'COOKIE_PATH' => 'Cookie path',
+ 'COOKIE_PATH_EXPLAIN' => 'Note that this is always a slash, it does not matter what your board URL is.',
'COOKIE_SECURE' => 'Cookie secure',
'COOKIE_SECURE_EXPLAIN' => 'If your server is running via SSL set this to enabled else leave as disabled. Having this enabled and not running via SSL will result in server errors during redirects.',
'ONLINE_LENGTH' => 'View online time span',
@@ -343,20 +361,40 @@ $lang = array_merge($lang, array(
'SESSION_LENGTH_EXPLAIN' => 'Sessions will expire after this time, in seconds.',
));
+// Contact Settings
+$lang = array_merge($lang, array(
+ 'ACP_CONTACT_SETTINGS_EXPLAIN' => 'Here you can enable and disable the contact page and also add a text that is displayed on the page.',
+
+ 'CONTACT_US_ENABLE' => 'Enable contact page',
+ 'CONTACT_US_ENABLE_EXPLAIN' => 'This page allows users to send emails to board administrators',
+
+ 'CONTACT_US_INFO' => 'Contact information',
+ 'CONTACT_US_INFO_EXPLAIN' => 'The message is displayed on the contact page',
+ 'CONTACT_US_INFO_PREVIEW' => 'Contact page information - Preview',
+ 'CONTACT_US_INFO_UPDATED' => 'Contact page information has been updated.',
+));
+
// Load Settings
$lang = array_merge($lang, array(
'ACP_LOAD_SETTINGS_EXPLAIN' => 'Here you can enable and disable certain board functions to reduce the amount of processing required. On most servers there is no need to disable any functions. However on certain systems or in shared hosting environments it may be beneficial to disable capabilities you do not really need. You can also specify limits for system load and active sessions beyond which the board will go offline.',
+ 'ALLOW_CDN' => 'Allow usage of third party content delivery networks',
+ 'ALLOW_CDN_EXPLAIN' => 'If this setting is enabled, some files will be served from external third party servers instead of your server. This reduces the network bandwidth required by your server, but may present a privacy issue for some board administrators. In a default phpBB installation, this includes loading “jQuery” and the font “Open Sans” from Google’s content delivery network.',
+ 'ALLOW_LIVE_SEARCHES' => 'Allow live searches',
+ 'ALLOW_LIVE_SEARCHES_EXPLAIN' => 'If this setting is enabled, users are provided with keyword suggestions as they type in certain fields throughout the board.',
'CUSTOM_PROFILE_FIELDS' => 'Custom profile fields',
'LIMIT_LOAD' => 'Limit system load',
'LIMIT_LOAD_EXPLAIN' => 'If the system’s 1-minute load average exceeds this value the board will automatically go offline. A value of 1.0 equals ~100% utilisation of one processor. This only functions on UNIX based servers and where this information is accessible. The value here resets itself to 0 if phpBB was unable to get the load limit.',
'LIMIT_SESSIONS' => 'Limit sessions',
'LIMIT_SESSIONS_EXPLAIN' => 'If the number of sessions exceeds this value within a one minute period the board will go offline. Set to 0 for unlimited sessions.',
'LOAD_CPF_MEMBERLIST' => 'Allow styles to display custom profile fields in memberlist',
+ 'LOAD_CPF_PM' => 'Display custom profile fields in private messages',
'LOAD_CPF_VIEWPROFILE' => 'Display custom profile fields in user profiles',
'LOAD_CPF_VIEWTOPIC' => 'Display custom profile fields on topic pages',
'LOAD_USER_ACTIVITY' => 'Show user’s activity',
'LOAD_USER_ACTIVITY_EXPLAIN' => 'Displays active topic/forum in user profiles and user control panel. It is recommended to disable this on boards with more than one million posts.',
+ 'READ_NOTIFICATION_EXPIRE_DAYS' => 'Read Notification Expiration',
+ 'READ_NOTIFICATION_EXPIRE_DAYS_EXPLAIN' => 'Number of days that will elapse before a read notification will automatically be deleted. Set this value to 0 to make notifications permanent.',
'RECOMPILE_STYLES' => 'Recompile stale style components',
'RECOMPILE_STYLES_EXPLAIN' => 'Check for updated style components on filesystem and recompile.',
'YES_ANON_READ_MARKING' => 'Enable topic marking for guests',
@@ -380,18 +418,25 @@ $lang = array_merge($lang, array(
// Auth settings
$lang = array_merge($lang, array(
- 'ACP_AUTH_SETTINGS_EXPLAIN' => 'phpBB supports authentication plug-ins, or modules. These allow you determine how users are authenticated when they log into the board. By default three plug-ins are provided; DB, LDAP and Apache. Not all methods require additional information so only fill out fields if they are relevant to the selected method.',
+ 'ACP_AUTH_SETTINGS_EXPLAIN' => 'phpBB supports authentication plug-ins, or modules. These allow you determine how users are authenticated when they log into the board. By default four plug-ins are provided: DB, LDAP, Apache, and OAuth. Not all methods require additional information so only fill out fields if they are relevant to the selected method.',
'AUTH_METHOD' => 'Select an authentication method',
+ 'AUTH_PROVIDER_OAUTH_ERROR_ELEMENT_MISSING' => 'Both the key and secret of each enabled OAuth service provider must be provided. Only one was provided for an OAuth service provider.',
+ 'AUTH_PROVIDER_OAUTH_EXPLAIN' => 'Each OAuth provider requires a unique secret and key in order to authenticate with the external server. These should be supplied by the OAuth service when you register your website with them and should be entered exactly as provided to you.<br />Any service that does not have both a key and a secret entered here will not be available for use by the forum users. Also note, that user can still register and login using the DB authentication plug-in.',
+ 'AUTH_PROVIDER_OAUTH_KEY' => 'Key',
+ 'AUTH_PROVIDER_OAUTH_TITLE' => 'OAuth',
+ 'AUTH_PROVIDER_OAUTH_SECRET' => 'Secret',
+
'APACHE_SETUP_BEFORE_USE' => 'You have to setup apache authentication before you switch phpBB to this authentication method. Keep in mind that the username you use for apache authentication has to be the same as your phpBB username. Apache authentication can only be used with mod_php (not with a CGI version) and safe_mode disabled.',
+ 'LDAP' => 'LDAP',
'LDAP_DN' => 'LDAP base <var>dn</var>',
'LDAP_DN_EXPLAIN' => 'This is the Distinguished Name, locating the user information, e.g. <samp>o=My Company,c=US</samp>.',
- 'LDAP_EMAIL' => 'LDAP e-mail attribute',
- 'LDAP_EMAIL_EXPLAIN' => 'Set this to the name of your user entry e-mail attribute (if one exists) in order to automatically set the e-mail address for new users. Leaving this empty results in empty e-mail address for users who log in for the first time.',
+ 'LDAP_EMAIL' => 'LDAP email attribute',
+ 'LDAP_EMAIL_EXPLAIN' => 'Set this to the name of your user entry email attribute (if one exists) in order to automatically set the email address for new users. Leaving this empty results in empty email address for users who log in for the first time.',
'LDAP_INCORRECT_USER_PASSWORD' => 'Binding to LDAP server failed with specified user/password.',
- 'LDAP_NO_EMAIL' => 'The specified e-mail attribute does not exist.',
+ 'LDAP_NO_EMAIL' => 'The specified email attribute does not exist.',
'LDAP_NO_IDENTITY' => 'Could not find a login identity for %s.',
'LDAP_PASSWORD' => 'LDAP password',
'LDAP_PASSWORD_EXPLAIN' => 'Leave blank to use anonymous binding, otherwise fill in the password for the above user. Required for Active Directory Servers.<br /><em><strong>Warning:</strong> This password will be stored as plain text in the database, visible to everybody who can access your database or who can view this configuration page.</em>',
@@ -409,7 +454,7 @@ $lang = array_merge($lang, array(
// Server Settings
$lang = array_merge($lang, array(
- 'ACP_SERVER_SETTINGS_EXPLAIN' => 'Here you define server and domain dependant settings. Please ensure the data you enter is accurate, errors will result in e-mails containing incorrect information. When entering the domain name remember it does include http:// or other protocol term. Only alter the port number if you know your server uses a different value, port 80 is correct in most cases.',
+ 'ACP_SERVER_SETTINGS_EXPLAIN' => 'Here you define server and domain dependent settings. Please ensure the data you enter is accurate, errors will result in emails containing incorrect information. When entering the domain name remember it does include http:// or other protocol term. Only alter the port number if you know your server uses a different value, port 80 is correct in most cases.',
'ENABLE_GZIP' => 'Enable GZip compression',
'ENABLE_GZIP_EXPLAIN' => 'Generated content will be compressed prior to sending it to the user. This can reduce network traffic but will also increase CPU usage on both server and client side. Requires zlib PHP extension to be loaded.',
@@ -417,6 +462,10 @@ $lang = array_merge($lang, array(
'FORCE_SERVER_VARS_EXPLAIN' => 'If set to yes the server settings defined here will be used in favour of the automatically determined values.',
'ICONS_PATH' => 'Post icons storage path',
'ICONS_PATH_EXPLAIN' => 'Path under your phpBB root directory, e.g. <samp>images/icons</samp>.',
+ 'MOD_REWRITE_ENABLE' => 'Enable URL Rewriting',
+ 'MOD_REWRITE_ENABLE_EXPLAIN' => 'When enabled, URLs containing ’app.php’ will be rewritten to remove the filename (i.e. app.php/foo will become /foo). <strong>Apache server’s mod_rewrite module is required for this functionality to work; if this option is enabled without mod_rewrite support, URLs on your board may be broken.</strong>',
+ 'MOD_REWRITE_DISABLED' => 'The <strong>mod_rewrite</strong> module on your Apache web server is disabled. Enable the module or contact your web hosting provider if you wish to enable this feature.',
+ 'MOD_REWRITE_INFORMATION_UNAVAILABLE' => 'We are unable to determine whether or not this server supports URL rewriting. This setting may be enabled but if URL rewriting is not available, paths generated by this board (such as for use in links) may be broken. Contact your web hosting provider if you are unsure whether or not you can safely enable this feature.',
'PATH_SETTINGS' => 'Path settings',
'RANKS_PATH' => 'Rank image storage path',
'RANKS_PATH_EXPLAIN' => 'Path under your phpBB root directory, e.g. <samp>images/ranks</samp>.',
@@ -433,6 +482,8 @@ $lang = array_merge($lang, array(
'SMILIES_PATH_EXPLAIN' => 'Path under your phpBB root directory, e.g. <samp>images/smilies</samp>.',
'UPLOAD_ICONS_PATH' => 'Extension group icons storage path',
'UPLOAD_ICONS_PATH_EXPLAIN' => 'Path under your phpBB root directory, e.g. <samp>images/upload_icons</samp>.',
+ 'USE_SYSTEM_CRON' => 'Run periodic tasks from system cron',
+ 'USE_SYSTEM_CRON_EXPLAIN' => 'When off, phpBB will arrange for periodic tasks to be run automatically. When on, phpBB will not schedule any periodic tasks by itself; a system administrator must arrange for <code>bin/phpbbcli.php cron:run</code> to be run by the system cron facility at regular intervals (e.g. every 5 minutes).',
));
// Security Settings
@@ -440,18 +491,20 @@ $lang = array_merge($lang, array(
'ACP_SECURITY_SETTINGS_EXPLAIN' => 'Here you are able to define session and login related settings.',
'ALL' => 'All',
- 'ALLOW_AUTOLOGIN' => 'Allow persistent logins',
- 'ALLOW_AUTOLOGIN_EXPLAIN' => 'Determines whether users can autologin when they visit the board.',
- 'AUTOLOGIN_LENGTH' => 'Persistent login key expiration length (in days)',
- 'AUTOLOGIN_LENGTH_EXPLAIN' => 'Number of days after which persistent login keys are removed or zero to disable.',
+ 'ALLOW_AUTOLOGIN' => 'Allow "Remember Me" logins',
+ 'ALLOW_AUTOLOGIN_EXPLAIN' => 'Determines whether users are given "Remember Me" option when they visit the board.',
+ 'ALLOW_PASSWORD_RESET' => 'Allow password reset ("Forgot Password")',
+ 'ALLOW_PASSWORD_RESET_EXPLAIN' => 'Determines whether or not users are able to use the "I forgot my password" link on the login page to recover their account. If you use an external authentication mechanism you may wish to disable this feature.',
+ 'AUTOLOGIN_LENGTH' => '"Remember Me" login key expiration length (in days)',
+ 'AUTOLOGIN_LENGTH_EXPLAIN' => 'Number of days after which "Remember Me" login keys are removed or zero to disable.',
'BROWSER_VALID' => 'Validate browser',
'BROWSER_VALID_EXPLAIN' => 'Enables browser validation for each session improving security.',
'CHECK_DNSBL' => 'Check IP against DNS Blackhole List',
'CHECK_DNSBL_EXPLAIN' => 'If enabled the user’s IP address is checked against the following DNSBL services on registration and posting: <a href="http://spamcop.net">spamcop.net</a> and <a href="http://www.spamhaus.org">www.spamhaus.org</a>. This lookup may take a while, depending on the server’s configuration. If slowdowns are experienced or too many false positives reported it is recommended to disable this check.',
'CLASS_B' => 'A.B',
'CLASS_C' => 'A.B.C',
- 'EMAIL_CHECK_MX' => 'Check e-mail domain for valid MX record',
- 'EMAIL_CHECK_MX_EXPLAIN' => 'If enabled, the e-mail domain provided on registration and profile changes is checked for a valid MX record.',
+ 'EMAIL_CHECK_MX' => 'Check email domain for valid MX record',
+ 'EMAIL_CHECK_MX_EXPLAIN' => 'If enabled, the email domain provided on registration and profile changes is checked for a valid MX record.',
'FORCE_PASS_CHANGE' => 'Force password change',
'FORCE_PASS_CHANGE_EXPLAIN' => 'Require user to change their password after a set number of days. Setting this value to 0 disables this behaviour.',
'FORM_TIME_MAX' => 'Maximum time to submit forms',
@@ -480,32 +533,36 @@ $lang = array_merge($lang, array(
'PASS_TYPE_SYMBOL' => 'Must contain symbols',
'REF_HOST' => 'Only validate host',
'REF_PATH' => 'Also validate path',
- 'REFERER_VALID' => 'Validate Referer',
- 'REFERER_VALID_EXPLAIN' => 'If enabled, the referer of POST requests will be checked against the host/script path settings. This may cause issues with boards using several domains and or external logins.',
+ 'REFERRER_VALID' => 'Validate Referrer',
+ 'REFERRER_VALID_EXPLAIN' => 'If enabled, the referrer of POST requests will be checked against the host/script path settings. This may cause issues with boards using several domains and or external logins.',
'TPL_ALLOW_PHP' => 'Allow php in templates',
'TPL_ALLOW_PHP_EXPLAIN' => 'If this option is enabled, <code>PHP</code> and <code>INCLUDEPHP</code> statements will be recognised and parsed in templates.',
));
// Email Settings
$lang = array_merge($lang, array(
- 'ACP_EMAIL_SETTINGS_EXPLAIN' => 'This information is used when the board sends e-mails to your users. Please ensure the e-mail address you specify is valid, any bounced or undeliverable messages will likely be sent to that address. If your host does not provide a native (PHP based) e-mail service you can instead send messages directly using SMTP. This requires the address of an appropriate server (ask your provider if necessary). If the server requires authentication (and only if it does) enter the necessary username, password and authentication method.',
-
- 'ADMIN_EMAIL' => 'Return e-mail address',
- 'ADMIN_EMAIL_EXPLAIN' => 'This will be used as the return address on all e-mails, the technical contact e-mail address. It will always be used as the <samp>Return-Path</samp> and <samp>Sender</samp> address in e-mails.',
- 'BOARD_EMAIL_FORM' => 'Users send e-mail via board',
- 'BOARD_EMAIL_FORM_EXPLAIN' => 'Instead of showing the users e-mail address users are able to send e-mails via the board.',
- 'BOARD_HIDE_EMAILS' => 'Hide e-mail addresses',
- 'BOARD_HIDE_EMAILS_EXPLAIN' => 'This function keeps e-mail addresses completely private.',
- 'CONTACT_EMAIL' => 'Contact e-mail address',
- 'CONTACT_EMAIL_EXPLAIN' => 'This address will be used whenever a specific contact point is needed, e.g. spam, error output, etc. It will always be used as the <samp>From</samp> and <samp>Reply-To</samp> address in e-mails.',
- 'EMAIL_FUNCTION_NAME' => 'E-mail function name',
- 'EMAIL_FUNCTION_NAME_EXPLAIN' => 'The e-mail function used to send mails through PHP.',
- 'EMAIL_PACKAGE_SIZE' => 'E-mail package size',
- 'EMAIL_PACKAGE_SIZE_EXPLAIN' => 'This is the number of maximum e-mails sent out in one package. This setting is applied to the internal message queue; set this value to 0 if you have problems with non-delivered notification e-mails.',
- 'EMAIL_SIG' => 'E-mail signature',
- 'EMAIL_SIG_EXPLAIN' => 'This text will be attached to all e-mails the board sends.',
- 'ENABLE_EMAIL' => 'Enable board-wide e-mails',
- 'ENABLE_EMAIL_EXPLAIN' => 'If this is set to disabled no e-mails will be sent by the board at all. <em>Note the user and admin account activation settings require this setting to be enabled. If currently using “user” or “admin” activation in the activation settings, disabling this setting will require no activation of new accounts.</em>',
+ 'ACP_EMAIL_SETTINGS_EXPLAIN' => 'This information is used when the board sends emails to your users. Please ensure the email address you specify is valid, any bounced or undeliverable messages will likely be sent to that address. If your host does not provide a native (PHP based) email service you can instead send messages directly using SMTP. This requires the address of an appropriate server (ask your provider if necessary). If the server requires authentication (and only if it does) enter the necessary username, password and authentication method.',
+
+ 'ADMIN_EMAIL' => 'Return email address',
+ 'ADMIN_EMAIL_EXPLAIN' => 'This will be used as the return address on all emails, the technical contact email address. It will always be used as the <samp>Return-Path</samp> and <samp>Sender</samp> address in emails.',
+ 'BOARD_EMAIL_FORM' => 'Users send email via board',
+ 'BOARD_EMAIL_FORM_EXPLAIN' => 'Instead of showing the users email address users are able to send emails via the board.',
+ 'BOARD_HIDE_EMAILS' => 'Hide email addresses',
+ 'BOARD_HIDE_EMAILS_EXPLAIN' => 'This function keeps email addresses completely private.',
+ 'CONTACT_EMAIL' => 'Contact email address',
+ 'CONTACT_EMAIL_EXPLAIN' => 'This address will be used whenever a specific contact point is needed, e.g. spam, error output, etc. It will always be used as the <samp>From</samp> and <samp>Reply-To</samp> address in emails.',
+ 'CONTACT_EMAIL_NAME' => 'Contact name',
+ 'CONTACT_EMAIL_NAME_EXPLAIN' => 'This is the contact name that e-mail recipients will see. If you don’t want to have a contact name, leave this field empty.',
+ 'EMAIL_FUNCTION_NAME' => 'Email function name',
+ 'EMAIL_FUNCTION_NAME_EXPLAIN' => 'The email function used to send mails through PHP.',
+ 'EMAIL_PACKAGE_SIZE' => 'Email package size',
+ 'EMAIL_PACKAGE_SIZE_EXPLAIN' => 'This is the number of maximum emails sent out in one package. This setting is applied to the internal message queue; set this value to 0 if you have problems with non-delivered notification emails.',
+ 'EMAIL_SIG' => 'Email signature',
+ 'EMAIL_SIG_EXPLAIN' => 'This text will be attached to all emails the board sends.',
+ 'ENABLE_EMAIL' => 'Enable board-wide emails',
+ 'ENABLE_EMAIL_EXPLAIN' => 'If this is set to disabled no emails will be sent by the board at all. <em>Note the user and admin account activation settings require this setting to be enabled. If currently using “user” or “admin” activation in the activation settings, disabling this setting will disable registration.</em>',
+ 'SMTP_ALLOW_SELF_SIGNED' => 'Allow self-signed SSL certificates',
+ 'SMTP_ALLOW_SELF_SIGNED_EXPLAIN'=> 'Allow connections to SMTP server with self-signed SSL certificate.<em><strong>Warning:</strong> Allowing self-signed SSL certificates may cause security implications.</em>',
'SMTP_AUTH_METHOD' => 'Authentication method for SMTP',
'SMTP_AUTH_METHOD_EXPLAIN' => 'Only used if a username/password is set, ask your provider if you are unsure which method to use.',
'SMTP_CRAM_MD5' => 'CRAM-MD5',
@@ -518,33 +575,43 @@ $lang = array_merge($lang, array(
'SMTP_PORT' => 'SMTP server port',
'SMTP_PORT_EXPLAIN' => 'Only change this if you know your SMTP server is on a different port.',
'SMTP_SERVER' => 'SMTP server address',
+ 'SMTP_SERVER_EXPLAIN' => 'Note that you have to provide the protocol that your server uses. If you are using SSL, this has to be "ssl://your.mailserver.com"',
'SMTP_SETTINGS' => 'SMTP settings',
'SMTP_USERNAME' => 'SMTP username',
'SMTP_USERNAME_EXPLAIN' => 'Only enter a username if your SMTP server requires it.',
- 'USE_SMTP' => 'Use SMTP server for e-mail',
- 'USE_SMTP_EXPLAIN' => 'Select “Yes” if you want or have to send e-mail via a named server instead of the local mail function.',
+ 'SMTP_VERIFY_PEER' => 'Verify SSL certificate',
+ 'SMTP_VERIFY_PEER_EXPLAIN' => 'Require verification of SSL certificate used by SMTP server.<em><strong>Warning:</strong> Connecting peers with unverified SSL certificates may cause security implications.</em>',
+ 'SMTP_VERIFY_PEER_NAME' => 'Verify SMTP peer name',
+ 'SMTP_VERIFY_PEER_NAME_EXPLAIN' => 'Require verification of peer name for SMTP servers using SSL / TLS connections.<em><strong>Warning:</strong> Connecting to unverified peers may cause security implications.</em>',
+
+ 'USE_SMTP' => 'Use SMTP server for email',
+ 'USE_SMTP_EXPLAIN' => 'Select “Yes” if you want or have to send email via a named server instead of the local mail function.',
));
// Jabber settings
$lang = array_merge($lang, array(
'ACP_JABBER_SETTINGS_EXPLAIN' => 'Here you can enable and control the use of Jabber for instant messaging and board notifications. Jabber is an open source protocol and therefore available for use by anyone. Some Jabber servers include gateways or transports which allow you to contact users on other networks. Not all servers offer all transports and changes in protocols can prevent transports from operating. Please be sure to enter already registered account details - phpBB will use the details you enter here as is.',
- 'JAB_ENABLE' => 'Enable Jabber',
- 'JAB_ENABLE_EXPLAIN' => 'Enables use of Jabber messaging and notifications.',
- 'JAB_GTALK_NOTE' => 'Please note that GTalk will not work because the <samp>dns_get_record</samp> function could not be found. This function is not available in PHP4, and is not implemented on Windows platforms. It currently does not work on BSD-based systems, including Mac OS.',
- 'JAB_PACKAGE_SIZE' => 'Jabber package size',
- 'JAB_PACKAGE_SIZE_EXPLAIN' => 'This is the number of messages sent in one package. If set to 0 the message is sent immediately and will not be queued for later sending.',
- 'JAB_PASSWORD' => 'Jabber password',
- 'JAB_PASSWORD_EXPLAIN' => '<em><strong>Warning:</strong> This password will be stored as plain text in the database, visible to everybody who can access your database or who can view this configuration page.</em>',
- 'JAB_PORT' => 'Jabber port',
- 'JAB_PORT_EXPLAIN' => 'Leave blank unless you know it is not port 5222.',
- 'JAB_SERVER' => 'Jabber server',
- 'JAB_SERVER_EXPLAIN' => 'See %sjabber.org%s for a list of servers.',
- 'JAB_SETTINGS_CHANGED' => 'Jabber settings changed successfully.',
- 'JAB_USE_SSL' => 'Use SSL to connect',
- 'JAB_USE_SSL_EXPLAIN' => 'If enabled a secure connection is tried to be established. The Jabber port will be modified to 5223 if port 5222 is specified.',
- 'JAB_USERNAME' => 'Jabber username or JID',
- 'JAB_USERNAME_EXPLAIN' => 'Specify a registered username or a valid JID. The username will not be checked for validity. If you only specify a username, then your JID will be the username and the server you specified above. Else, specify a valid JID, for example user@jabber.org.',
+ 'JAB_ALLOW_SELF_SIGNED' => 'Allow self-signed SSL certificates',
+ 'JAB_ALLOW_SELF_SIGNED_EXPLAIN' => 'Allow connections to Jabber server with self-signed SSL certificate.<em><strong>Warning:</strong> Allowing self-signed SSL certificates may cause security implications.</em>',
+ 'JAB_ENABLE' => 'Enable Jabber',
+ 'JAB_ENABLE_EXPLAIN' => 'Enables use of Jabber messaging and notifications.',
+ 'JAB_GTALK_NOTE' => 'Please note that GTalk will not work because the <samp>dns_get_record</samp> function could not be found. This function is not available in PHP4, and is not implemented on Windows platforms. It currently does not work on BSD-based systems, including Mac OS.',
+ 'JAB_PACKAGE_SIZE' => 'Jabber package size',
+ 'JAB_PACKAGE_SIZE_EXPLAIN' => 'This is the number of messages sent in one package. If set to 0 the message is sent immediately and will not be queued for later sending.',
+ 'JAB_PASSWORD' => 'Jabber password',
+ 'JAB_PASSWORD_EXPLAIN' => '<em><strong>Warning:</strong> This password will be stored as plain text in the database, visible to everybody who can access your database or who can view this configuration page.</em>',
+ 'JAB_PORT' => 'Jabber port',
+ 'JAB_PORT_EXPLAIN' => 'Leave blank unless you know it is not port 5222.',
+ 'JAB_SERVER' => 'Jabber server',
+ 'JAB_SERVER_EXPLAIN' => 'See %sjabber.org%s for a list of servers.',
+ 'JAB_SETTINGS_CHANGED' => 'Jabber settings changed successfully.',
+ 'JAB_USE_SSL' => 'Use SSL to connect',
+ 'JAB_USE_SSL_EXPLAIN' => 'If enabled a secure connection is tried to be established. The Jabber port will be modified to 5223 if port 5222 is specified.',
+ 'JAB_USERNAME' => 'Jabber username or JID',
+ 'JAB_USERNAME_EXPLAIN' => 'Specify a registered username or a valid JID. The username will not be checked for validity. If you only specify a username, then your JID will be the username and the server you specified above. Else, specify a valid JID, for example user@jabber.org.',
+ 'JAB_VERIFY_PEER' => 'Verify SSL certificate',
+ 'JAB_VERIFY_PEER_EXPLAIN' => 'Require verification of SSL certificate used by Jabber server.<em><strong>Warning:</strong> Connecting peers with unverified SSL certificates may cause security implications.</em>',
+ 'JAB_VERIFY_PEER_NAME' => 'Verify Jabber peer name',
+ 'JAB_VERIFY_PEER_NAME_EXPLAIN' => 'Require verification of peer name for Jabber servers using SSL / TLS connections.<em><strong>Warning:</strong> Connecting to unverified peers may cause security implications.</em>',
));
-
-?> \ No newline at end of file
diff --git a/phpBB/language/en/acp/bots.php b/phpBB/language/en/acp/bots.php
index 3b63f2ea2e..142922800c 100644
--- a/phpBB/language/en/acp/bots.php
+++ b/phpBB/language/en/acp/bots.php
@@ -1,12 +1,13 @@
<?php
/**
*
-* acp_bots [English]
+* This file is part of the phpBB Forum Software package.
*
-* @package language
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -69,5 +70,3 @@ $lang = array_merge($lang, array(
'NO_BOT' => 'Found no bot with the specified ID.',
'NO_BOT_GROUP' => 'Unable to find special bot group.',
));
-
-?> \ No newline at end of file
diff --git a/phpBB/language/en/acp/common.php b/phpBB/language/en/acp/common.php
index f2ab15335d..f5591e7b1e 100644
--- a/phpBB/language/en/acp/common.php
+++ b/phpBB/language/en/acp/common.php
@@ -1,12 +1,13 @@
<?php
/**
*
-* acp_common [English]
+* This file is part of the phpBB Forum Software package.
*
-* @package language
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -48,7 +49,7 @@ $lang = array_merge($lang, array(
'ACP_BACKUP' => 'Backup',
'ACP_BAN' => 'Banning',
- 'ACP_BAN_EMAILS' => 'Ban e-mails',
+ 'ACP_BAN_EMAILS' => 'Ban emails',
'ACP_BAN_IPS' => 'Ban IPs',
'ACP_BAN_USERNAMES' => 'Ban users',
'ACP_BBCODES' => 'BBCodes',
@@ -60,8 +61,9 @@ $lang = array_merge($lang, array(
'ACP_CAPTCHA' => 'CAPTCHA',
+ 'ACP_CAT_CUSTOMISE' => 'Customise',
'ACP_CAT_DATABASE' => 'Database',
- 'ACP_CAT_DOT_MODS' => '.MODs',
+ 'ACP_CAT_DOT_MODS' => 'Extensions',
'ACP_CAT_FORUMS' => 'Forums',
'ACP_CAT_GENERAL' => 'General',
'ACP_CAT_MAINTENANCE' => 'Maintenance',
@@ -73,6 +75,8 @@ $lang = array_merge($lang, array(
'ACP_CAT_USERS' => 'Users',
'ACP_CLIENT_COMMUNICATION' => 'Client communication',
'ACP_COOKIE_SETTINGS' => 'Cookie settings',
+ 'ACP_CONTACT' => 'Contact page',
+ 'ACP_CONTACT_SETTINGS' => 'Contact page settings',
'ACP_CRITICAL_LOGS' => 'Error log',
'ACP_CUSTOM_PROFILE_FIELDS' => 'Custom profile fields',
@@ -80,8 +84,10 @@ $lang = array_merge($lang, array(
'ACP_DISALLOW' => 'Disallow',
'ACP_DISALLOW_USERNAMES' => 'Disallow usernames',
- 'ACP_EMAIL_SETTINGS' => 'E-mail settings',
- 'ACP_EXTENSION_GROUPS' => 'Manage extension groups',
+ 'ACP_EMAIL_SETTINGS' => 'Email settings',
+ 'ACP_EXTENSION_GROUPS' => 'Manage attachment extension groups',
+ 'ACP_EXTENSION_MANAGEMENT' => 'Extension management',
+ 'ACP_EXTENSIONS' => 'Manage extensions',
'ACP_FORUM_BASED_PERMISSIONS' => 'Forum based permissions',
'ACP_FORUM_LOGS' => 'Forum logs',
@@ -100,10 +106,10 @@ $lang = array_merge($lang, array(
'ACP_GROUPS_MANAGE' => 'Manage groups',
'ACP_GROUPS_MANAGEMENT' => 'Group management',
'ACP_GROUPS_PERMISSIONS' => 'Group permissions',
+ 'ACP_GROUPS_POSITION' => 'Manage group positions',
'ACP_ICONS' => 'Topic icons',
'ACP_ICONS_SMILIES' => 'Topic icons/smilies',
- 'ACP_IMAGESETS' => 'Imagesets',
'ACP_INACTIVE_USERS' => 'Inactive users',
'ACP_INDEX' => 'ACP index',
@@ -115,12 +121,16 @@ $lang = array_merge($lang, array(
'ACP_LOGGING' => 'Logging',
'ACP_MAIN' => 'ACP index',
- 'ACP_MANAGE_EXTENSIONS' => 'Manage extensions',
+
+ 'ACP_MANAGE_ATTACHMENTS' => 'Manage attachments',
+ 'ACP_MANAGE_ATTACHMENTS_EXPLAIN' => 'Here you can list and delete files attached to posts and private messages.',
+
+ 'ACP_MANAGE_EXTENSIONS' => 'Manage attachment extensions',
'ACP_MANAGE_FORUMS' => 'Manage forums',
'ACP_MANAGE_RANKS' => 'Manage ranks',
'ACP_MANAGE_REASONS' => 'Manage report/denial reasons',
'ACP_MANAGE_USERS' => 'Manage users',
- 'ACP_MASS_EMAIL' => 'Mass e-mail',
+ 'ACP_MASS_EMAIL' => 'Mass email',
'ACP_MESSAGES' => 'Messages',
'ACP_MESSAGE_SETTINGS' => 'Private message settings',
'ACP_MODULE_MANAGEMENT' => 'Module management',
@@ -162,9 +172,10 @@ $lang = array_merge($lang, array(
'ACP_SERVER_SETTINGS' => 'Server settings',
'ACP_SIGNATURE_SETTINGS' => 'Signature settings',
'ACP_SMILIES' => 'Smilies',
- 'ACP_STYLE_COMPONENTS' => 'Style components',
'ACP_STYLE_MANAGEMENT' => 'Style management',
'ACP_STYLES' => 'Styles',
+ 'ACP_STYLES_CACHE' => 'Purge Cache',
+ 'ACP_STYLES_INSTALL' => 'Install Styles',
'ACP_SUBMIT_CHANGES' => 'Submit changes',
@@ -216,6 +227,10 @@ $lang = array_merge($lang, array(
'COLOUR_SWATCH' => 'Web-safe colour swatch',
'CONFIG_UPDATED' => 'Configuration updated successfully.',
+ 'CRON_LOCK_ERROR' => 'Could not obtain cron lock.',
+ 'CRON_NO_SUCH_TASK' => 'Could not find cron task “%s”.',
+ 'CRON_NO_TASK' => 'No cron tasks need to be run right now.',
+ 'CRON_NO_TASKS' => 'No cron tasks could be found.',
'DEACTIVATE' => 'Deactivate',
'DIRECTORY_DOES_NOT_EXIST' => 'The entered path “%s” does not exist.',
@@ -226,6 +241,7 @@ $lang = array_merge($lang, array(
'DOWNLOAD_AS' => 'Download as',
'DOWNLOAD_STORE' => 'Download or store file',
'DOWNLOAD_STORE_EXPLAIN' => 'You may directly download the file or save it in your <samp>store/</samp> folder.',
+ 'DOWNLOADS' => 'Downloads',
'EDIT' => 'Edit',
'ENABLE' => 'Enable',
@@ -240,6 +256,8 @@ $lang = array_merge($lang, array(
'IP' => 'User IP',
'IP_HOSTNAME' => 'IP addresses or hostnames',
+ 'LOAD_NOTIFICATIONS' => 'Display Notifications',
+ 'LOAD_NOTIFICATIONS_EXPLAIN' => 'Display the notifications list on every page (typically in the header).',
'LOGGED_IN_AS' => 'You are logged in as:',
'LOGIN_ADMIN' => 'To administer the board you must be an authenticated user.',
'LOGIN_ADMIN_CONFIRM' => 'To administer the board you must re-authenticate yourself.',
@@ -256,7 +274,8 @@ $lang = array_merge($lang, array(
'NOTIFY' => 'Notification',
'NO_ADMIN' => 'You are not authorised to administer this board.',
- 'NO_EMAILS_DEFINED' => 'No valid e-mail addresses found.',
+ 'NO_EMAILS_DEFINED' => 'No valid email addresses found.',
+ 'NO_FILES_TO_DELETE' => 'Attachments you selected for deletion do not exist.',
'NO_PASSWORD_SUPPLIED' => 'You need to enter your password to access the Administration Control Panel.',
'OFF' => 'Off',
@@ -271,8 +290,8 @@ $lang = array_merge($lang, array(
'REMIND' => 'Remind',
'RESYNC' => 'Resynchronise',
- 'RETURN_TO' => 'Return to…',
+ 'RUNNING_TASK' => 'Running task: %s.',
'SELECT_ANONYMOUS' => 'Select anonymous user',
'SELECT_OPTION' => 'Select option',
@@ -283,6 +302,10 @@ $lang = array_merge($lang, array(
'SHOW_ALL_OPERATIONS' => 'Show all operations',
+ 'TASKS_NOT_READY' => 'Not ready tasks:',
+ 'TASKS_READY' => 'Ready tasks:',
+ 'TOTAL_SIZE' => 'Total size',
+
'UCP' => 'User Control Panel',
'USERNAMES_EXPLAIN' => 'Place each username on a separate line.',
'USER_CONTROL_PANEL' => 'User Control Panel',
@@ -300,7 +323,7 @@ $lang = array_merge($lang, array(
// Logs
$lang = array_merge($lang, array(
'ACP_ADMIN_LOGS_EXPLAIN' => 'This lists all the actions carried out by board administrators. You can sort by username, date, IP or action. If you have appropriate permissions you can also clear individual operations or the log as a whole.',
- 'ACP_CRITICAL_LOGS_EXPLAIN' => 'This lists the actions carried out by the board itself. This log provides you with information you are able to use for solving specific problems, for example non-delivery of e-mails. You can sort by username, date, IP or action. If you have appropriate permissions you can also clear individual operations or the log as a whole.',
+ 'ACP_CRITICAL_LOGS_EXPLAIN' => 'This lists the actions carried out by the board itself. This log provides you with information you are able to use for solving specific problems, for example non-delivery of emails. You can sort by username, date, IP or action. If you have appropriate permissions you can also clear individual operations or the log as a whole.',
'ACP_MOD_LOGS_EXPLAIN' => 'This lists all actions done on forums, topics and posts as well as actions carried out on users by moderators, including banning. You can sort by username, date, IP or action. If you have appropriate permissions you can also clear individual operations or the log as a whole.',
'ACP_USERS_LOGS_EXPLAIN' => 'This lists all actions carried out by users or on users (reports, warnings and user notes).',
'ALL_ENTRIES' => 'All entries',
@@ -342,6 +365,7 @@ $lang = array_merge($lang, array(
'GZIP_COMPRESSION' => 'GZip compression',
+ 'NO_SEARCH_INDEX' => 'The selected search backend does not have a search index.<br />Please create the index for “%1$s” in the %2$ssearch index%3$s section.',
'NOT_AVAILABLE' => 'Not available',
'NUMBER_FILES' => 'Number of attachments',
'NUMBER_POSTS' => 'Number of posts',
@@ -349,46 +373,58 @@ $lang = array_merge($lang, array(
'NUMBER_USERS' => 'Number of users',
'NUMBER_ORPHAN' => 'Orphan attachments',
- 'PHP_VERSION_OLD' => 'The version of PHP on this server will no longer be supported by future versions of phpBB. %sDetails%s',
+ 'PHP_VERSION_OLD' => 'The version of PHP on this server (%1$s) will no longer be supported by future versions of phpBB. The minimum required version will be PHP %2$s. %3$sDetails%4$s',
'POSTS_PER_DAY' => 'Posts per day',
'PURGE_CACHE' => 'Purge the cache',
'PURGE_CACHE_CONFIRM' => 'Are you sure you wish to purge the cache?',
'PURGE_CACHE_EXPLAIN' => 'Purge all cache related items, this includes any cached template files or queries.',
+ 'PURGE_CACHE_SUCCESS' => 'Cache successfully purged.',
'PURGE_SESSIONS' => 'Purge all sessions',
'PURGE_SESSIONS_CONFIRM' => 'Are you sure you wish to purge all sessions? This will log out all users.',
'PURGE_SESSIONS_EXPLAIN' => 'Purge all sessions. This will log out all users by truncating the session table.',
+ 'PURGE_SESSIONS_SUCCESS' => 'Sessions successfully purged.',
'RESET_DATE' => 'Reset board’s start date',
'RESET_DATE_CONFIRM' => 'Are you sure you wish to reset the board’s start date?',
+ 'RESET_DATE_SUCCESS' => 'Board’s start date reset',
'RESET_ONLINE' => 'Reset most users ever online',
'RESET_ONLINE_CONFIRM' => 'Are you sure you wish to reset the most users ever online counter?',
+ 'RESET_ONLINE_SUCCESS' => 'Most users ever online reset',
'RESYNC_POSTCOUNTS' => 'Resynchronise post counts',
'RESYNC_POSTCOUNTS_EXPLAIN' => 'Only existing posts will be taken into consideration. Pruned posts will not be counted.',
'RESYNC_POSTCOUNTS_CONFIRM' => 'Are you sure you wish to resynchronise post counts?',
+ 'RESYNC_POSTCOUNTS_SUCCESS' => 'Resynchronised post counts',
'RESYNC_POST_MARKING' => 'Resynchronise dotted topics',
'RESYNC_POST_MARKING_CONFIRM' => 'Are you sure you wish to resynchronise dotted topics?',
'RESYNC_POST_MARKING_EXPLAIN' => 'First unmarks all topics and then correctly marks topics that have seen any activity during the past six months.',
+ 'RESYNC_POST_MARKING_SUCCESS' => 'Resynchronised dotted topics',
'RESYNC_STATS' => 'Resynchronise statistics',
'RESYNC_STATS_CONFIRM' => 'Are you sure you wish to resynchronise statistics?',
'RESYNC_STATS_EXPLAIN' => 'Recalculates the total number of posts, topics, users and files.',
+ 'RESYNC_STATS_SUCCESS' => 'Resynchronised statistics',
'RUN' => 'Run now',
'STATISTIC' => 'Statistic',
'STATISTIC_RESYNC_OPTIONS' => 'Resynchronise or reset statistics',
+ 'TIMEZONE_INVALID' => 'The timezone you selected is invalid.',
+ 'TIMEZONE_SELECTED' => '(currently selected)',
'TOPICS_PER_DAY' => 'Topics per day',
'UPLOAD_DIR_SIZE' => 'Size of posted attachments',
'USERS_PER_DAY' => 'Users per day',
- 'VALUE' => 'Value',
- 'VERSIONCHECK_FAIL' => 'Failed to obtain latest version information.',
- 'VERSIONCHECK_FORCE_UPDATE' => 'Re-Check version',
- 'VIEW_ADMIN_LOG' => 'View administrator log',
- 'VIEW_INACTIVE_USERS' => 'View inactive users',
+ 'VALUE' => 'Value',
+ 'VERSIONCHECK_FAIL' => 'Failed to obtain latest version information.',
+ 'VERSIONCHECK_FORCE_UPDATE' => 'Re-Check version',
+ 'VERSIONCHECK_INVALID_ENTRY' => 'Latest version information contains an unsupported entry.',
+ 'VERSIONCHECK_INVALID_URL' => 'Latest version information contains invalid URL.',
+ 'VERSIONCHECK_INVALID_VERSION' => 'Latest version information contains an invalid version.',
+ 'VIEW_ADMIN_LOG' => 'View administrator log',
+ 'VIEW_INACTIVE_USERS' => 'View inactive users',
'WELCOME_PHPBB' => 'Welcome to phpBB',
'WRITABLE_CONFIG' => 'Your config file (config.php) is currently world-writable. We strongly encourage you to change the permissions to 640 or at least to 644 (for example: <a href="http://en.wikipedia.org/wiki/Chmod" rel="external">chmod</a> 640 config.php).',
@@ -404,8 +440,8 @@ $lang = array_merge($lang, array(
'INACTIVE_REASON_REMIND' => 'Forced user account reactivation',
'INACTIVE_REASON_UNKNOWN' => 'Unknown',
'INACTIVE_USERS' => 'Inactive users',
- 'INACTIVE_USERS_EXPLAIN' => 'This is a list of users who have registered but whose accounts are inactive. You can activate, delete or remind (by sending an e-mail) these users if you wish.',
- 'INACTIVE_USERS_EXPLAIN_INDEX' => 'This is a list of the last 10 registered users who have inactive accounts. Accounts are inactive either because account activation was enabled in user registration settings and these users’ accounts have not yet been activated, or because these accounts have been deactivated. A full list is available by following the link below from where you can activate, delete or remind (by sending an e-mail) these users if you wish.',
+ 'INACTIVE_USERS_EXPLAIN' => 'This is a list of users who have registered but whose accounts are inactive. You can activate, delete or remind (by sending an email) these users if you wish.',
+ 'INACTIVE_USERS_EXPLAIN_INDEX' => 'This is a list of the last 10 registered users who have inactive accounts. Accounts are inactive either because account activation was enabled in user registration settings and these users’ accounts have not yet been activated, or because these accounts have been deactivated. A full list is available by following the link below from where you can activate, delete or remind (by sending an email) these users if you wish.',
'NO_INACTIVE_USERS' => 'No inactive users',
@@ -475,13 +511,13 @@ $lang = array_merge($lang, array(
'LOG_BAN_EXCLUDE_USER' => '<strong>Excluded user from ban</strong> for reason “<em>%1$s</em>”<br />» %2$s',
'LOG_BAN_EXCLUDE_IP' => '<strong>Excluded IP from ban</strong> for reason “<em>%1$s</em>”<br />» %2$s',
- 'LOG_BAN_EXCLUDE_EMAIL' => '<strong>Excluded e-mail from ban</strong> for reason “<em>%1$s</em>”<br />» %2$s',
+ 'LOG_BAN_EXCLUDE_EMAIL' => '<strong>Excluded email from ban</strong> for reason “<em>%1$s</em>”<br />» %2$s',
'LOG_BAN_USER' => '<strong>Banned user</strong> for reason “<em>%1$s</em>”<br />» %2$s',
'LOG_BAN_IP' => '<strong>Banned IP</strong> for reason “<em>%1$s</em>”<br />» %2$s',
- 'LOG_BAN_EMAIL' => '<strong>Banned e-mail</strong> for reason “<em>%1$s</em>”<br />» %2$s',
+ 'LOG_BAN_EMAIL' => '<strong>Banned email</strong> for reason “<em>%1$s</em>”<br />» %2$s',
'LOG_UNBAN_USER' => '<strong>Unbanned user</strong><br />» %s',
'LOG_UNBAN_IP' => '<strong>Unbanned IP</strong><br />» %s',
- 'LOG_UNBAN_EMAIL' => '<strong>Unbanned e-mail</strong><br />» %s',
+ 'LOG_UNBAN_EMAIL' => '<strong>Unbanned email</strong><br />» %s',
'LOG_BBCODE_ADD' => '<strong>Added new BBCode</strong><br />» %s',
'LOG_BBCODE_EDIT' => '<strong>Edited BBCode</strong><br />» %s',
@@ -501,7 +537,7 @@ $lang = array_merge($lang, array(
'LOG_CONFIG_AUTH' => '<strong>Altered authentication settings</strong>',
'LOG_CONFIG_AVATAR' => '<strong>Altered avatar settings</strong>',
'LOG_CONFIG_COOKIE' => '<strong>Altered cookie settings</strong>',
- 'LOG_CONFIG_EMAIL' => '<strong>Altered e-mail settings</strong>',
+ 'LOG_CONFIG_EMAIL' => '<strong>Altered email settings</strong>',
'LOG_CONFIG_FEATURES' => '<strong>Altered board features</strong>',
'LOG_CONFIG_LOAD' => '<strong>Altered load settings</strong>',
'LOG_CONFIG_MESSAGE' => '<strong>Altered private message settings</strong>',
@@ -517,26 +553,32 @@ $lang = array_merge($lang, array(
'LOG_APPROVE_TOPIC' => '<strong>Approved topic</strong><br />» %s',
'LOG_BUMP_TOPIC' => '<strong>User bumped topic</strong><br />» %s',
- 'LOG_DELETE_POST' => '<strong>Deleted post “%1$s” written by</strong><br />» %2$s',
+ 'LOG_DELETE_POST' => '<strong>Deleted post “%1$s” written by “%2$s” for the following reason</strong><br />» %3$s',
'LOG_DELETE_SHADOW_TOPIC' => '<strong>Deleted shadow topic</strong><br />» %s',
- 'LOG_DELETE_TOPIC' => '<strong>Deleted topic “%1$s” written by</strong><br />» %2$s',
+ 'LOG_DELETE_TOPIC' => '<strong>Deleted topic “%1$s” written by “%2$s” for the following reason</strong><br />» %3$s',
'LOG_FORK' => '<strong>Copied topic</strong><br />» from %s',
'LOG_LOCK' => '<strong>Locked topic</strong><br />» %s',
'LOG_LOCK_POST' => '<strong>Locked post</strong><br />» %s',
'LOG_MERGE' => '<strong>Merged posts</strong> into topic<br />» %s',
'LOG_MOVE' => '<strong>Moved topic</strong><br />» from %1$s to %2$s',
+ 'LOG_MOVED_TOPIC' => '<strong>Moved topic</strong><br />» %s',
'LOG_PM_REPORT_CLOSED' => '<strong>Closed PM report</strong><br />» %s',
'LOG_PM_REPORT_DELETED' => '<strong>Deleted PM report</strong><br />» %s',
'LOG_POST_APPROVED' => '<strong>Approved post</strong><br />» %s',
- 'LOG_POST_DISAPPROVED' => '<strong>Disapproved post “%1$s” with the following reason</strong><br />» %2$s',
- 'LOG_POST_EDITED' => '<strong>Edited post “%1$s” written by</strong><br />» %2$s',
+ 'LOG_POST_DISAPPROVED' => '<strong>Disapproved post “%1$s” written by “%3$s” for the following reason</strong><br />» %2$s',
+ 'LOG_POST_EDITED' => '<strong>Edited post “%1$s” written by “%2$s” for the following reason</strong><br />» %3$s',
+ 'LOG_POST_RESTORED' => '<strong>Restored post</strong><br />» %s',
'LOG_REPORT_CLOSED' => '<strong>Closed report</strong><br />» %s',
'LOG_REPORT_DELETED' => '<strong>Deleted report</strong><br />» %s',
+ 'LOG_RESTORE_TOPIC' => '<strong>Restored topic “%1$s” written by</strong><br />» %2$s',
+ 'LOG_SOFTDELETE_POST' => '<strong>Soft deleted post “%1$s” written by “%2$s” for the following reason</strong><br />» %3$s',
+ 'LOG_SOFTDELETE_TOPIC' => '<strong>Soft deleted topic “%1$s” written by “%2$s” for the following reason</strong><br />» %3$s',
'LOG_SPLIT_DESTINATION' => '<strong>Moved split posts</strong><br />» to %s',
'LOG_SPLIT_SOURCE' => '<strong>Split posts</strong><br />» from %s',
'LOG_TOPIC_APPROVED' => '<strong>Approved topic</strong><br />» %s',
- 'LOG_TOPIC_DISAPPROVED' => '<strong>Disapproved topic “%1$s” with the following reason</strong><br />%2$s',
+ 'LOG_TOPIC_RESTORED' => '<strong>Restored topic</strong><br />» %s',
+ 'LOG_TOPIC_DISAPPROVED' => '<strong>Disapproved topic “%1$s” written by “%3$s” for the following reason</strong><br />» %2$s',
'LOG_TOPIC_RESYNC' => '<strong>Resynchronised topic counters</strong><br />» %s',
'LOG_TOPIC_TYPE_CHANGED' => '<strong>Changed topic type</strong><br />» %s',
'LOG_UNLOCK' => '<strong>Unlocked topic</strong><br />» %s',
@@ -554,7 +596,8 @@ $lang = array_merge($lang, array(
'LOG_DOWNLOAD_REMOVE_IP' => '<strong>Removed IP/hostname from download list</strong><br />» %s',
'LOG_ERROR_JABBER' => '<strong>Jabber error</strong><br />» %s',
- 'LOG_ERROR_EMAIL' => '<strong>E-mail error</strong><br />» %s',
+ 'LOG_ERROR_EMAIL' => '<strong>Email error</strong><br />» %s',
+ 'LOG_ERROR_CAPTCHA' => '<strong>CAPTCHA error</strong><br />» %s',
'LOG_FORUM_ADD' => '<strong>Created new forum</strong><br />» %s',
'LOG_FORUM_COPIED_PERMISSIONS' => '<strong>Copied forum permissions</strong> from %1$s<br />» %2$s',
@@ -588,19 +631,9 @@ $lang = array_merge($lang, array(
'LOG_IMAGE_GENERATION_ERROR' => '<strong>Error while creating image</strong><br />» Error in %1$s on line %2$s: %3$s',
- 'LOG_IMAGESET_ADD_DB' => '<strong>Added new imageset to database</strong><br />» %s',
- 'LOG_IMAGESET_ADD_FS' => '<strong>Add new imageset on filesystem</strong><br />» %s',
- 'LOG_IMAGESET_DELETE' => '<strong>Deleted imageset</strong><br />» %s',
- 'LOG_IMAGESET_EDIT_DETAILS' => '<strong>Edited imageset details</strong><br />» %s',
- 'LOG_IMAGESET_EDIT' => '<strong>Edited imageset</strong><br />» %s',
- 'LOG_IMAGESET_EXPORT' => '<strong>Exported imageset</strong><br />» %s',
- 'LOG_IMAGESET_LANG_MISSING' => '<strong>Imageset misses “%2$s” localisation</strong><br />» %1$s',
- 'LOG_IMAGESET_LANG_REFRESHED' => '<strong>Refreshed “%2$s” localisation of imageset</strong><br />» %1$s',
- 'LOG_IMAGESET_REFRESHED' => '<strong>Refreshed imageset</strong><br />» %s',
-
'LOG_INACTIVE_ACTIVATE' => '<strong>Activated inactive users</strong><br />» %s',
'LOG_INACTIVE_DELETE' => '<strong>Deleted inactive users</strong><br />» %s',
- 'LOG_INACTIVE_REMIND' => '<strong>Sent reminder e-mails to inactive users</strong><br />» %s',
+ 'LOG_INACTIVE_REMIND' => '<strong>Sent reminder emails to inactive users</strong><br />» %s',
'LOG_INSTALL_CONVERTED' => '<strong>Converted from %1$s to phpBB %2$s</strong>',
'LOG_INSTALL_INSTALLED' => '<strong>Installed phpBB %s</strong>',
@@ -617,7 +650,7 @@ $lang = array_merge($lang, array(
'LOG_LANGUAGE_FILE_REPLACED' => '<strong>Replaced language file</strong><br />» %s',
'LOG_LANGUAGE_FILE_SUBMITTED' => '<strong>Submitted language file and placed in store folder</strong><br />» %s',
- 'LOG_MASS_EMAIL' => '<strong>Sent mass e-mail</strong><br />» %s',
+ 'LOG_MASS_EMAIL' => '<strong>Sent mass email</strong><br />» %s',
'LOG_MCP_CHANGE_POSTER' => '<strong>Changed poster in topic “%1$s”</strong><br />» from %2$s to %3$s',
@@ -642,6 +675,8 @@ $lang = array_merge($lang, array(
'LOG_U_ROLE_EDIT' => '<strong>User role edited</strong><br />» %s',
'LOG_U_ROLE_REMOVED' => '<strong>User role removed</strong><br />» %s',
+ 'LOG_PLUPLOAD_TIDY_FAILED' => '<strong>Unable to open %1$s for tidying, check permissions.</strong><br />Exception: %2$s<br />Trace: %3$s',
+
'LOG_PROFILE_FIELD_ACTIVATE' => '<strong>Profile field activated</strong><br />» %s',
'LOG_PROFILE_FIELD_CREATE' => '<strong>Profile field added</strong><br />» %s',
'LOG_PROFILE_FIELD_DEACTIVATE' => '<strong>Profile field deactivated</strong><br />» %s',
@@ -650,6 +685,7 @@ $lang = array_merge($lang, array(
'LOG_PRUNE' => '<strong>Pruned forums</strong><br />» %s',
'LOG_AUTO_PRUNE' => '<strong>Auto-pruned forums</strong><br />» %s',
+ 'LOG_PRUNE_SHADOW' => '<strong>Auto-pruned shadow topics</strong><br />» %s',
'LOG_PRUNE_USER_DEAC' => '<strong>Users deactivated</strong><br />» %s',
'LOG_PRUNE_USER_DEL_DEL' => '<strong>Users pruned and posts deleted</strong><br />» %s',
'LOG_PRUNE_USER_DEL_ANON' => '<strong>Users pruned and posts retained</strong><br />» %s',
@@ -657,7 +693,6 @@ $lang = array_merge($lang, array(
'LOG_PURGE_CACHE' => '<strong>Purged cache</strong>',
'LOG_PURGE_SESSIONS' => '<strong>Purged sessions</strong>',
-
'LOG_RANK_ADDED' => '<strong>Added new rank</strong><br />» %s',
'LOG_RANK_REMOVED' => '<strong>Removed rank</strong><br />» %s',
'LOG_RANK_UPDATED' => '<strong>Updated rank</strong><br />» %s',
@@ -666,36 +701,44 @@ $lang = array_merge($lang, array(
'LOG_REASON_REMOVED' => '<strong>Removed report/denial reason</strong><br />» %s',
'LOG_REASON_UPDATED' => '<strong>Updated report/denial reason</strong><br />» %s',
- 'LOG_REFERER_INVALID' => '<strong>Referer validation failed</strong><br />»Referer was “<em>%1$s</em>”. The request was rejected and the session killed.',
+ 'LOG_REFERER_INVALID' => '<strong>Referrer validation failed</strong><br />»Referrer was “<em>%1$s</em>”. The request was rejected and the session killed.',
'LOG_RESET_DATE' => '<strong>Board start date reset</strong>',
'LOG_RESET_ONLINE' => '<strong>Most users online reset</strong>',
+ 'LOG_RESYNC_FILES_STATS' => '<strong>File statistics resynchronised</strong>',
'LOG_RESYNC_POSTCOUNTS' => '<strong>User post counts resynchronised</strong>',
'LOG_RESYNC_POST_MARKING' => '<strong>Dotted topics resynchronised</strong>',
'LOG_RESYNC_STATS' => '<strong>Post, topic and user statistics resynchronised</strong>',
'LOG_SEARCH_INDEX_CREATED' => '<strong>Created search index for</strong><br />» %s',
'LOG_SEARCH_INDEX_REMOVED' => '<strong>Removed search index for</strong><br />» %s',
+ 'LOG_SPHINX_ERROR' => '<strong>Sphinx Error</strong><br />» %s',
'LOG_STYLE_ADD' => '<strong>Added new style</strong><br />» %s',
'LOG_STYLE_DELETE' => '<strong>Deleted style</strong><br />» %s',
'LOG_STYLE_EDIT_DETAILS' => '<strong>Edited style</strong><br />» %s',
'LOG_STYLE_EXPORT' => '<strong>Exported style</strong><br />» %s',
+ // @deprecated 3.1
'LOG_TEMPLATE_ADD_DB' => '<strong>Added new template set to database</strong><br />» %s',
+ // @deprecated 3.1
'LOG_TEMPLATE_ADD_FS' => '<strong>Add new template set on filesystem</strong><br />» %s',
'LOG_TEMPLATE_CACHE_CLEARED' => '<strong>Deleted cached versions of template files in template set <em>%1$s</em></strong><br />» %2$s',
'LOG_TEMPLATE_DELETE' => '<strong>Deleted template set</strong><br />» %s',
'LOG_TEMPLATE_EDIT' => '<strong>Edited template set <em>%1$s</em></strong><br />» %2$s',
'LOG_TEMPLATE_EDIT_DETAILS' => '<strong>Edited template details</strong><br />» %s',
'LOG_TEMPLATE_EXPORT' => '<strong>Exported template set</strong><br />» %s',
+ // @deprecated 3.1
'LOG_TEMPLATE_REFRESHED' => '<strong>Refreshed template set</strong><br />» %s',
+ // @deprecated 3.1
'LOG_THEME_ADD_DB' => '<strong>Added new theme to database</strong><br />» %s',
+ // @deprecated 3.1
'LOG_THEME_ADD_FS' => '<strong>Add new theme on filesystem</strong><br />» %s',
'LOG_THEME_DELETE' => '<strong>Theme deleted</strong><br />» %s',
'LOG_THEME_EDIT_DETAILS' => '<strong>Edited theme details</strong><br />» %s',
'LOG_THEME_EDIT' => '<strong>Edited theme <em>%1$s</em></strong>',
'LOG_THEME_EDIT_FILE' => '<strong>Edited theme <em>%1$s</em></strong><br />» Modified file <em>%2$s</em>',
'LOG_THEME_EXPORT' => '<strong>Exported theme</strong><br />» %s',
+ // @deprecated 3.1
'LOG_THEME_REFRESHED' => '<strong>Refreshed theme</strong><br />» %s',
'LOG_UPDATE_DATABASE' => '<strong>Updated Database from version %1$s to version %2$s</strong>',
@@ -704,7 +747,7 @@ $lang = array_merge($lang, array(
'LOG_USER_ACTIVE' => '<strong>User activated</strong><br />» %s',
'LOG_USER_BAN_USER' => '<strong>Banned User via user management</strong> for reason “<em>%1$s</em>”<br />» %2$s',
'LOG_USER_BAN_IP' => '<strong>Banned IP via user management</strong> for reason “<em>%1$s</em>”<br />» %2$s',
- 'LOG_USER_BAN_EMAIL' => '<strong>Banned e-mail via user management</strong> for reason “<em>%1$s</em>”<br />» %2$s',
+ 'LOG_USER_BAN_EMAIL' => '<strong>Banned email via user management</strong> for reason “<em>%1$s</em>”<br />» %2$s',
'LOG_USER_DELETED' => '<strong>Deleted user</strong><br />» %s',
'LOG_USER_DEL_ATTACH' => '<strong>Removed all attachments made by the user</strong><br />» %s',
'LOG_USER_DEL_AVATAR' => '<strong>Removed user avatar</strong><br />» %s',
@@ -717,7 +760,7 @@ $lang = array_merge($lang, array(
'LOG_USER_REACTIVATE' => '<strong>Forced user account reactivation</strong><br />» %s',
'LOG_USER_REMOVED_NR' => '<strong>Removed newly registered flag from user</strong><br />» %s',
- 'LOG_USER_UPDATE_EMAIL' => '<strong>User “%1$s” changed e-mail</strong><br />» from “%2$s” to “%3$s”',
+ 'LOG_USER_UPDATE_EMAIL' => '<strong>User “%1$s” changed email</strong><br />» from “%2$s” to “%3$s”',
'LOG_USER_UPDATE_NAME' => '<strong>Changed username</strong><br />» from “%1$s” to “%2$s”',
'LOG_USER_USER_UPDATE' => '<strong>Updated user details</strong><br />» %s',
@@ -741,12 +784,17 @@ $lang = array_merge($lang, array(
'LOG_USER_GROUP_RESIGN' => '<strong>User resigned membership from group</strong><br />» %s',
'LOG_WARNING_DELETED' => '<strong>Deleted user warning</strong><br />» %s',
- 'LOG_WARNINGS_DELETED' => '<strong>Deleted %2$s user warnings</strong><br />» %1$s', // Example: '<strong>Deleted 2 user warnings</strong><br />» username'
+ 'LOG_WARNINGS_DELETED' => array(
+ 1 => '<strong>Deleted user warning</strong><br />» %1$s',
+ 2 => '<strong>Deleted %2$d user warnings</strong><br />» %1$s', // Example: '<strong>Deleted 2 user warnings</strong><br />» username'
+ ),
'LOG_WARNINGS_DELETED_ALL' => '<strong>Deleted all user warnings</strong><br />» %s',
'LOG_WORD_ADD' => '<strong>Added word censor</strong><br />» %s',
'LOG_WORD_DELETE' => '<strong>Deleted word censor</strong><br />» %s',
'LOG_WORD_EDIT' => '<strong>Edited word censor</strong><br />» %s',
-));
-?> \ No newline at end of file
+ 'LOG_EXT_ENABLE' => '<strong>Extension enabled</strong><br />» %s',
+ 'LOG_EXT_DISABLE' => '<strong>Extension disabled</strong><br />» %s',
+ 'LOG_EXT_PURGE' => '<strong>Extension’s data deleted</strong><br />» %s',
+));
diff --git a/phpBB/language/en/acp/database.php b/phpBB/language/en/acp/database.php
index 9c8ecbf13a..ab85701eaa 100644
--- a/phpBB/language/en/acp/database.php
+++ b/phpBB/language/en/acp/database.php
@@ -1,12 +1,13 @@
<?php
/**
*
-* acp_database [English]
+* This file is part of the phpBB Forum Software package.
*
-* @package language
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -73,5 +74,3 @@ $lang = array_merge($lang, array(
'TABLE_SELECT' => 'Table select',
'TABLE_SELECT_ERROR'=> 'You must select at least one table.',
));
-
-?> \ No newline at end of file
diff --git a/phpBB/language/en/acp/email.php b/phpBB/language/en/acp/email.php
index 6db09a77c9..0d47e37d09 100644
--- a/phpBB/language/en/acp/email.php
+++ b/phpBB/language/en/acp/email.php
@@ -1,12 +1,13 @@
<?php
/**
*
-* acp_email [English]
+* This file is part of the phpBB Forum Software package.
*
-* @package language
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -37,12 +38,12 @@ if (empty($lang) || !is_array($lang))
// Email settings
$lang = array_merge($lang, array(
- 'ACP_MASS_EMAIL_EXPLAIN' => 'Here you can e-mail a message to either all of your users or all users of a specific group <strong>having the option to receive mass e-mails enabled</strong>. To achieve this an e-mail will be sent out to the administrative e-mail address supplied, with a blind carbon copy sent to all recipients. The default setting is to only include 20 recipients in such an e-mail, for more recipients more e-mails will be sent. If you are emailing a large group of people please be patient after submitting and do not stop the page halfway through. It is normal for a mass emailing to take a long time, you will be notified when the script has completed.',
+ 'ACP_MASS_EMAIL_EXPLAIN' => 'Here you can email a message to either all of your users or all users of a specific group <strong>having the option to receive mass emails enabled</strong>. To achieve this an email will be sent out to the administrative email address supplied, with a blind carbon copy sent to all recipients. The default setting is to only include 20 recipients in such an email, for more recipients more emails will be sent. If you are emailing a large group of people please be patient after submitting and do not stop the page halfway through. It is normal for a mass emailing to take a long time, you will be notified when the script has completed.',
'ALL_USERS' => 'All users',
'COMPOSE' => 'Compose',
- 'EMAIL_SEND_ERROR' => 'There were one or more errors while sending the e-mail. Please check the %sError log%s for detailed error messages.',
+ 'EMAIL_SEND_ERROR' => 'There were one or more errors while sending the email. Please check the %sError log%s for detailed error messages.',
'EMAIL_SENT' => 'This message has been sent.',
'EMAIL_SENT_QUEUE' => 'This message has been queued for sending.',
@@ -54,7 +55,7 @@ $lang = array_merge($lang, array(
'SEND_TO_USERS_EXPLAIN' => 'Entering names here will override any group selected above. Enter each username on a new line.',
'MAIL_BANNED' => 'Mail banned users',
- 'MAIL_BANNED_EXPLAIN' => 'When sending a mass e-mail to a group you can select here whether banned users will also receive the e-mail.',
+ 'MAIL_BANNED_EXPLAIN' => 'When sending a mass email to a group you can select here whether banned users will also receive the email.',
'MAIL_HIGH_PRIORITY' => 'High',
'MAIL_LOW_PRIORITY' => 'Low',
'MAIL_NORMAL_PRIORITY' => 'Normal',
@@ -65,5 +66,3 @@ $lang = array_merge($lang, array(
'NO_EMAIL_MESSAGE' => 'You must enter a message.',
'NO_EMAIL_SUBJECT' => 'You must specify a subject for your message.',
));
-
-?> \ No newline at end of file
diff --git a/phpBB/language/en/acp/extensions.php b/phpBB/language/en/acp/extensions.php
new file mode 100644
index 0000000000..e5d6789764
--- /dev/null
+++ b/phpBB/language/en/acp/extensions.php
@@ -0,0 +1,132 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+if (!defined('IN_PHPBB'))
+{
+ exit;
+}
+
+/**
+* DO NOT CHANGE
+*/
+if (empty($lang) || !is_array($lang))
+{
+ $lang = array();
+}
+
+// DEVELOPERS PLEASE NOTE
+//
+// Placeholders can now contain order information, e.g. instead of
+// 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows
+// translators to re-order the output of data while ensuring it remains correct
+//
+// You do not need this where single placeholders are used, e.g. 'Message %d' is fine
+// equally where a string contains only two placeholders which are used to wrap text
+// in a url you again do not need to specify an order e.g., 'Click %sHERE%s' is fine
+
+$lang = array_merge($lang, array(
+ 'EXTENSION' => 'Extension',
+ 'EXTENSIONS' => 'Extensions',
+ 'EXTENSIONS_ADMIN' => 'Extensions Manager',
+ 'EXTENSIONS_EXPLAIN' => 'The Extensions Manager is a tool in your phpBB Board which allows you to manage all of your extensions statuses and view information about them.',
+ 'EXTENSION_INVALID_LIST' => 'The “%s” extension is not valid.<br />%s<br /><br />',
+ 'EXTENSION_NOT_AVAILABLE' => 'The selected extension is not available for this board, please verify your phpBB and PHP versions are allowed (see the details page).',
+ 'EXTENSION_DIR_INVALID' => 'The selected extension has an invalid directory structure and cannot be enabled.',
+ 'EXTENSION_NOT_ENABLEABLE' => 'The selected extension cannot be enabled, please verify the extension’s requirements.',
+
+ 'DETAILS' => 'Details',
+
+ 'EXTENSIONS_DISABLED' => 'Disabled Extensions',
+ 'EXTENSIONS_ENABLED' => 'Enabled Extensions',
+
+ 'EXTENSION_DELETE_DATA' => 'Delete data',
+ 'EXTENSION_DISABLE' => 'Disable',
+ 'EXTENSION_ENABLE' => 'Enable',
+
+ 'EXTENSION_DELETE_DATA_EXPLAIN' => 'Deleting an extension’s data removes all of its data and settings. The extension files are retained so it can be enabled again.',
+ 'EXTENSION_DISABLE_EXPLAIN' => 'Disabling an extension retains its files, data and settings but removes any functionality added by the extension.',
+ 'EXTENSION_ENABLE_EXPLAIN' => 'Enabling an extension allows you to use it on your board.',
+
+ 'EXTENSION_DELETE_DATA_IN_PROGRESS' => 'The extension’s data is currently being deleted. Please do not leave or refresh this page until it is completed.',
+ 'EXTENSION_DISABLE_IN_PROGRESS' => 'The extension is currently being disabled. Please do not leave or refresh this page until it is completed.',
+ 'EXTENSION_ENABLE_IN_PROGRESS' => 'The extension is currently being enabled. Please do not leave or refresh this page until it is completed.',
+
+ 'EXTENSION_DELETE_DATA_SUCCESS' => 'The extension’s data was deleted successfully',
+ 'EXTENSION_DISABLE_SUCCESS' => 'The extension was disabled successfully',
+ 'EXTENSION_ENABLE_SUCCESS' => 'The extension was enabled successfully',
+
+ 'EXTENSION_NAME' => 'Extension Name',
+ 'EXTENSION_ACTIONS' => 'Actions',
+ 'EXTENSION_OPTIONS' => 'Options',
+ 'EXTENSION_INSTALL_HEADLINE'=> 'Installing an extension',
+ 'EXTENSION_INSTALL_EXPLAIN' => '<ol>
+ <li>Download an extension from phpBB’s extensions database</li>
+ <li>Unzip the extension and upload it to the <samp>ext/</samp> directory of your phpBB board</li>
+ <li>Enable the extension, here in the Extensions manager</li>
+ </ol>',
+ 'EXTENSION_UPDATE_HEADLINE' => 'Updating an extension',
+ 'EXTENSION_UPDATE_EXPLAIN' => '<ol>
+ <li>Disable the extension</li>
+ <li>Delete the extension’s files from the filesystem</li>
+ <li>Upload the new files</li>
+ <li>Enable the extension</li>
+ </ol>',
+ 'EXTENSION_REMOVE_HEADLINE' => 'Completely removing an extension from your board',
+ 'EXTENSION_REMOVE_EXPLAIN' => '<ol>
+ <li>Disable the extension</li>
+ <li>Delete the extension’s data</li>
+ <li>Delete the extension’s files from the filesystem</li>
+ </ol>',
+
+ 'EXTENSION_DELETE_DATA_CONFIRM' => 'Are you sure that you wish to delete the data associated with “%s”?<br /><br />This removes all of its data and settings and cannot be undone!',
+ 'EXTENSION_DISABLE_CONFIRM' => 'Are you sure that you wish to disable the “%s” extension?',
+ 'EXTENSION_ENABLE_CONFIRM' => 'Are you sure that you wish to enable the “%s” extension?',
+ 'EXTENSION_FORCE_UNSTABLE_CONFIRM' => 'Are you sure that you wish to force the use of unstable version?',
+
+ 'RETURN_TO_EXTENSION_LIST' => 'Return to the extension list',
+
+ 'EXT_DETAILS' => 'Extension Details',
+ 'DISPLAY_NAME' => 'Display Name',
+ 'CLEAN_NAME' => 'Clean Name',
+ 'TYPE' => 'Type',
+ 'DESCRIPTION' => 'Description',
+ 'VERSION' => 'Version',
+ 'HOMEPAGE' => 'Homepage',
+ 'PATH' => 'File Path',
+ 'TIME' => 'Release Time',
+ 'LICENSE' => 'Licence',
+
+ 'REQUIREMENTS' => 'Requirements',
+ 'PHPBB_VERSION' => 'phpBB Version',
+ 'PHP_VERSION' => 'PHP Version',
+ 'AUTHOR_INFORMATION' => 'Author Information',
+ 'AUTHOR_NAME' => 'Name',
+ 'AUTHOR_EMAIL' => 'Email',
+ 'AUTHOR_HOMEPAGE' => 'Homepage',
+ 'AUTHOR_ROLE' => 'Role',
+
+ 'NOT_UP_TO_DATE' => '%s is not up to date',
+ 'UP_TO_DATE' => '%s is up to date',
+ 'ANNOUNCEMENT_TOPIC' => 'Release Announcement',
+ 'DOWNLOAD_LATEST' => 'Download Version',
+ 'NO_VERSIONCHECK' => 'No version check information given.',
+
+ 'VERSIONCHECK_FORCE_UPDATE_ALL' => 'Re-Check all versions',
+ 'FORCE_UNSTABLE' => 'Always check for unstable versions',
+ 'EXTENSIONS_VERSION_CHECK_SETTINGS' => 'Version check settings',
+
+ 'BROWSE_EXTENSIONS_DATABASE' => 'Browse extensions database',
+
+ 'META_FIELD_NOT_SET' => 'Required meta field %s has not been set.',
+ 'META_FIELD_INVALID' => 'Meta field %s is invalid.',
+));
diff --git a/phpBB/language/en/acp/forums.php b/phpBB/language/en/acp/forums.php
index b99a0724be..541d05c255 100644
--- a/phpBB/language/en/acp/forums.php
+++ b/phpBB/language/en/acp/forums.php
@@ -1,12 +1,13 @@
<?php
/**
*
-* acp_forums [English]
+* This file is part of the phpBB Forum Software package.
*
-* @package language
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -43,6 +44,10 @@ $lang = array_merge($lang, array(
'AUTO_PRUNE_FREQ_EXPLAIN' => 'Time in days between pruning events.',
'AUTO_PRUNE_VIEWED' => 'Auto-prune post viewed age',
'AUTO_PRUNE_VIEWED_EXPLAIN' => 'Number of days since topic was viewed after which topic is removed.',
+ 'AUTO_PRUNE_SHADOW_FREQ' => 'Auto-prune shadow topics frequency',
+ 'AUTO_PRUNE_SHADOW_DAYS' => 'Auto-prune shadow topics age',
+ 'AUTO_PRUNE_SHADOW_DAYS_EXPLAIN' => 'Number of days after which shadow topic is removed.',
+ 'AUTO_PRUNE_SHADOW_FREQ_EXPLAIN' => 'Time in days between pruning events.',
'CONTINUE' => 'Continue',
'COPY_PERMISSIONS' => 'Copy permissions from',
@@ -102,6 +107,8 @@ $lang = array_merge($lang, array(
'FORUM_PASSWORD_OLD' => 'The forum password is using an old hashing method and should be changed.',
'FORUM_PASSWORD_MISMATCH' => 'The passwords you entered did not match.',
'FORUM_PRUNE_SETTINGS' => 'Forum prune settings',
+ 'FORUM_PRUNE_SHADOW' => 'Enable auto-pruning of shadow topics',
+ 'FORUM_PRUNE_SHADOW_EXPLAIN' => 'Prunes the forum of shadow topics, set the frequency/age parameters below.',
'FORUM_RESYNCED' => 'Forum “%s” successfully resynced',
'FORUM_RULES_EXPLAIN' => 'Forum rules are displayed at any page within the given forum.',
'FORUM_RULES_LINK' => 'Link to forum rules',
@@ -156,5 +163,3 @@ $lang = array_merge($lang, array(
'UNLOCKED' => 'Unlocked',
));
-
-?> \ No newline at end of file
diff --git a/phpBB/language/en/acp/groups.php b/phpBB/language/en/acp/groups.php
index 3444b98303..a7700ed681 100644
--- a/phpBB/language/en/acp/groups.php
+++ b/phpBB/language/en/acp/groups.php
@@ -1,12 +1,13 @@
<?php
/**
*
-* acp_groups [English]
+* This file is part of the phpBB Forum Software package.
*
-* @package language
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -37,6 +38,7 @@ if (empty($lang) || !is_array($lang))
$lang = array_merge($lang, array(
'ACP_GROUPS_MANAGE_EXPLAIN' => 'From this panel you can administer all your usergroups. You can delete, create and edit existing groups. Furthermore, you may choose group leaders, toggle open/hidden/closed group status and set the group name and description.',
+ 'ADD_GROUP_CATEGORY' => 'Add category',
'ADD_USERS' => 'Add users',
'ADD_USERS_EXPLAIN' => 'Here you can add new users to the group. You may select whether this group becomes the new default for the selected users. Additionally you can define them as group leaders. Please enter each username on a separate line.',
@@ -51,11 +53,14 @@ $lang = array_merge($lang, array(
'GROUP_APPROVED' => 'Approved members',
'GROUP_AVATAR' => 'Group avatar',
'GROUP_AVATAR_EXPLAIN' => 'This image will be displayed in the Group Control Panel.',
+ 'GROUP_CATEGORY_NAME' => 'Category name',
'GROUP_CLOSED' => 'Closed',
'GROUP_COLOR' => 'Group colour',
'GROUP_COLOR_EXPLAIN' => 'Defines the colour members’ usernames will appear in, leave blank for user default.',
- 'GROUP_CONFIRM_ADD_USER' => 'Are you sure that you want to add the user %1$s to the group?',
- 'GROUP_CONFIRM_ADD_USERS' => 'Are you sure that you want to add the users %1$s to the group?',
+ 'GROUP_CONFIRM_ADD_USERS' => array(
+ 1 => 'Are you sure that you want to add the user %2$s to the group?',
+ 2 => 'Are you sure that you want to add the users %2$s to the group?',
+ ),
'GROUP_CREATED' => 'Group has been created successfully.',
'GROUP_DEFAULT' => 'Make group default for member',
'GROUP_DEFS_UPDATED' => 'Default group set for all selected members.',
@@ -97,6 +102,8 @@ $lang = array_merge($lang, array(
'GROUP_SETTINGS_SAVE' => 'Group wide settings',
'GROUP_SKIP_AUTH' => 'Exempt group leader from permissions',
'GROUP_SKIP_AUTH_EXPLAIN' => 'If enabled group leader no longer inherit permissions from the group.',
+ 'GROUP_SPECIAL' => 'Pre-defined',
+ 'GROUP_TEAMPAGE' => 'Display group on teampage',
'GROUP_TYPE' => 'Group type',
'GROUP_TYPE_EXPLAIN' => 'This determines which users can join or view this group.',
'GROUP_UPDATED' => 'Group preferences updated successfully.',
@@ -105,19 +112,37 @@ $lang = array_merge($lang, array(
'GROUP_USERS_EXIST' => 'The selected users are already members.',
'GROUP_USERS_REMOVE' => 'Users removed from group and new defaults set successfully.',
+ 'LEGEND_EXPLAIN' => 'These are the groups which are displayed in the group legend:',
+ 'LEGEND_SETTINGS' => 'Legend settings',
+ 'LEGEND_SORT_GROUPNAME' => 'Sort legend by group name',
+ 'LEGEND_SORT_GROUPNAME_EXPLAIN' => 'The order below is ignored when this option is enabled.',
+
+ 'MANAGE_LEGEND' => 'Manage group legend',
+ 'MANAGE_TEAMPAGE' => 'Manage teampage',
'MAKE_DEFAULT_FOR_ALL' => 'Make default group for every member',
'MEMBERS' => 'Members',
'NO_GROUP' => 'No group specified.',
+ 'NO_GROUPS_ADDED' => 'No groups added yet.',
'NO_GROUPS_CREATED' => 'No groups created yet.',
'NO_PERMISSIONS' => 'Do not copy permissions',
'NO_USERS' => 'You haven’t entered any users.',
'NO_USERS_ADDED' => 'No users were added to the group.',
'NO_VALID_USERS' => 'You haven’t entered any users eligible for that action.',
+ 'SELECT_GROUP' => 'Select a group',
'SPECIAL_GROUPS' => 'Pre-defined groups',
'SPECIAL_GROUPS_EXPLAIN' => 'Pre-defined groups are special groups, they cannot be deleted or directly modified. However you can still add users and alter basic settings.',
+ 'TEAMPAGE' => 'Teampage',
+ 'TEAMPAGE_DISP_ALL' => 'All memberships',
+ 'TEAMPAGE_DISP_DEFAULT' => 'User’s default group only',
+ 'TEAMPAGE_DISP_FIRST' => 'First membership only',
+ 'TEAMPAGE_EXPLAIN' => 'These are the groups which are displayed on the teampage:',
+ 'TEAMPAGE_FORUMS' => 'Display moderated forums',
+ 'TEAMPAGE_FORUMS_EXPLAIN' => 'If set to yes, moderators will have a list with all of the forums where they have moderator permissions displayed in their row. This can be very database intensive for big boards.',
+ 'TEAMPAGE_MEMBERSHIPS' => 'Display user memberships',
+ 'TEAMPAGE_SETTINGS' => 'Teampage settings',
'TOTAL_MEMBERS' => 'Members',
'USERS_APPROVED' => 'Users approved successfully.',
@@ -128,5 +153,3 @@ $lang = array_merge($lang, array(
'USER_GROUP_DEFAULT_EXPLAIN' => 'Saying yes here will set this group as the default group for the added users.',
'USER_GROUP_LEADER' => 'Set as group leader',
));
-
-?> \ No newline at end of file
diff --git a/phpBB/language/en/acp/language.php b/phpBB/language/en/acp/language.php
index dde4e3d722..d14491ae75 100644
--- a/phpBB/language/en/acp/language.php
+++ b/phpBB/language/en/acp/language.php
@@ -1,12 +1,13 @@
<?php
/**
*
-* acp_language [English]
+* This file is part of the phpBB Forum Software package.
*
-* @package language
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -39,26 +40,15 @@ $lang = array_merge($lang, array(
'ACP_FILES' => 'Admin language files',
'ACP_LANGUAGE_PACKS_EXPLAIN' => 'Here you are able to install/remove language packs. The default language pack is marked with an asterisk (*).',
- 'EMAIL_FILES' => 'E-mail templates',
-
- 'FILE_CONTENTS' => 'File contents',
- 'FILE_FROM_STORAGE' => 'File from storage folder',
+ 'DELETE_LANGUAGE_CONFIRM' => 'Are you sure you wish to delete “%s”?',
- 'HELP_FILES' => 'Help files',
-
- 'INSTALLED_LANGUAGE_PACKS' => 'Installed language packs',
- 'INVALID_LANGUAGE_PACK' => 'The selected language pack seems to be not valid. Please verify the language pack and upload it again if necessary.',
- 'INVALID_UPLOAD_METHOD' => 'The selected upload method is not valid, please choose a different method.',
+ 'INSTALLED_LANGUAGE_PACKS' => 'Installed language packs',
'LANGUAGE_DETAILS_UPDATED' => 'Language details successfully updated.',
- 'LANGUAGE_ENTRIES' => 'Language entries',
- 'LANGUAGE_ENTRIES_EXPLAIN' => 'Here you are able to change existing language pack entries or not already translated ones.<br /><strong>Note:</strong> Once you changed a language file, the changes will be stored within a separate folder for you to download. The changes will not be seen by your users until you replace the original language files at your webspace (by uploading them).',
- 'LANGUAGE_FILES' => 'Language files',
- 'LANGUAGE_KEY' => 'Language key',
'LANGUAGE_PACK_ALREADY_INSTALLED' => 'This language pack is already installed.',
- 'LANGUAGE_PACK_DELETED' => 'The language pack <strong>%s</strong> has been removed successfully. All users using this language have been reset to the boards default language.',
+ 'LANGUAGE_PACK_DELETED' => 'The language pack “%s” has been removed successfully. All users using this language have been reset to the board’s default language.',
'LANGUAGE_PACK_DETAILS' => 'Language pack details',
- 'LANGUAGE_PACK_INSTALLED' => 'The language pack <strong>%s</strong> has been successfully installed.',
+ 'LANGUAGE_PACK_INSTALLED' => 'The language pack “%s” has been successfully installed.',
'LANGUAGE_PACK_CPF_UPDATE' => 'The custom profile fields’ language strings were copied from the default language. Please change them if necessary.',
'LANGUAGE_PACK_ISO' => 'ISO',
'LANGUAGE_PACK_LOCALNAME' => 'Local name',
@@ -71,33 +61,18 @@ $lang = array_merge($lang, array(
'LANG_ISO_CODE' => 'ISO code',
'LANG_LOCAL_NAME' => 'Local name',
- 'MISSING_LANGUAGE_FILE' => 'Missing language file: <strong style="color:red">%s</strong>',
+ 'MISSING_LANG_FILES' => 'Missing language files',
'MISSING_LANG_VARIABLES' => 'Missing language variables',
- 'MODS_FILES' => 'MODs language files',
'NO_FILE_SELECTED' => 'You haven’t specified a language file.',
'NO_LANG_ID' => 'You haven’t specified a language pack.',
- 'NO_REMOVE_DEFAULT_LANG' => 'You are not able to remove the default language pack.<br />If you want to remove this language pack, change your boards default language first.',
+ 'NO_REMOVE_DEFAULT_LANG' => 'You are not able to remove the default language pack.<br />If you want to remove this language pack, change your board’s default language first.',
'NO_UNINSTALLED_LANGUAGE_PACKS' => 'No uninstalled language packs',
- 'REMOVE_FROM_STORAGE_FOLDER' => 'Remove from storage folder',
-
- 'SELECT_DOWNLOAD_FORMAT' => 'Select download format',
- 'SUBMIT_AND_DOWNLOAD' => 'Submit and download file',
- 'SUBMIT_AND_UPLOAD' => 'Submit and upload file',
-
- 'THOSE_MISSING_LANG_FILES' => 'The following language files are missing from the %s language folder',
- 'THOSE_MISSING_LANG_VARIABLES' => 'The following language variables are missing from the <strong>%s</strong> language pack',
+ 'THOSE_MISSING_LANG_FILES' => 'The following language files are missing from the “%s” language folder',
+ 'THOSE_MISSING_LANG_VARIABLES' => 'The following language variables are missing from the “%s” language pack',
'UNINSTALLED_LANGUAGE_PACKS' => 'Uninstalled language packs',
- 'UNABLE_TO_WRITE_FILE' => 'The file could not be written to %s.',
- 'UPLOAD_COMPLETED' => 'The upload was completed successfully.',
- 'UPLOAD_FAILED' => 'The upload failed for unknown reasons. You may need to replace the relevant file manually.',
- 'UPLOAD_METHOD' => 'Upload method',
- 'UPLOAD_SETTINGS' => 'Upload settings',
-
- 'WRONG_LANGUAGE_FILE' => 'Selected language file is invalid.',
+ 'BROWSE_LANGUAGE_PACKS_DATABASE' => 'Browse language packs database',
));
-
-?> \ No newline at end of file
diff --git a/phpBB/language/en/acp/modules.php b/phpBB/language/en/acp/modules.php
index 875b24a94b..1213641366 100644
--- a/phpBB/language/en/acp/modules.php
+++ b/phpBB/language/en/acp/modules.php
@@ -1,12 +1,13 @@
<?php
/**
*
-* acp_modules [English]
+* This file is part of the phpBB Forum Software package.
*
-* @package language
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -80,5 +81,3 @@ $lang = array_merge($lang, array(
'SELECT_MODULE' => 'Select a module',
));
-
-?> \ No newline at end of file
diff --git a/phpBB/language/en/acp/permissions.php b/phpBB/language/en/acp/permissions.php
index 6f0e7144e8..1ade2d6eb8 100644
--- a/phpBB/language/en/acp/permissions.php
+++ b/phpBB/language/en/acp/permissions.php
@@ -1,12 +1,13 @@
<?php
/**
*
-* acp_permissions [English]
+* This file is part of the phpBB Forum Software package.
*
-* @package language
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -53,12 +54,12 @@ $lang = array_merge($lang, array(
<br />
- <p>For further information on setting up and managing permissions on your phpBB3 board, please see <a href="https://www.phpbb.com/support/documentation/3.0/quickstart/quick_permissions.html">Chapter 1.5 of our Quick Start Guide</a>.</p>
+ <p>For further information on setting up and managing permissions on your phpBB3 board, please see the section on <a href="https://www.phpbb.com/support/docs/en/3.1/ug/quickstart/permissions/">Setting permissions of our Quick Start Guide</a>.</p>
',
'ACL_NEVER' => 'Never',
'ACL_SET' => 'Setting permissions',
- 'ACL_SET_EXPLAIN' => 'Permissions are based on a simple <samp>YES</samp>/<samp>NO</samp> system. Setting an option to <samp>NEVER</samp> for a user or usergroup overrides any other value assigned to it. If you do not wish to assign a value for an option for this user or group select <samp>NO</samp>. If values are assigned for this option elsewhere they will be used in preference, else <samp>NEVER</samp> is assumed. All objects marked (with the checkbox in front of them) will copy the permission set you defined.',
+ 'ACL_SET_EXPLAIN' => 'Permissions are based on a simple <strong>YES</strong>/<strong>NO</strong> system. Setting an option to <strong>NEVER</strong> for a user or usergroup overrides any other value assigned to it. If you do not wish to assign a value for an option for this user or group select <strong>NO</strong>. If values are assigned for this option elsewhere they will be used in preference, else <strong>NEVER</strong> is assumed. All objects marked (with the checkbox in front of them) will copy the permission set you defined.',
'ACL_SETTING' => 'Setting',
'ACL_TYPE_A_' => 'Administrative permissions',
@@ -101,10 +102,10 @@ $lang = array_merge($lang, array(
'ADD_USERS' => 'Add users',
'ADVANCED_PERMISSIONS' => 'Advanced Permissions',
'ALL_GROUPS' => 'Select all groups',
- 'ALL_NEVER' => 'All <samp>NEVER</samp>',
- 'ALL_NO' => 'All <samp>NO</samp>',
+ 'ALL_NEVER' => 'All <strong>NEVER</strong>',
+ 'ALL_NO' => 'All <strong>NO</strong>',
'ALL_USERS' => 'Select all users',
- 'ALL_YES' => 'All <samp>YES</samp>',
+ 'ALL_YES' => 'All <strong>YES</strong>',
'APPLY_ALL_PERMISSIONS' => 'Apply all permissions',
'APPLY_PERMISSIONS' => 'Apply permissions',
'APPLY_PERMISSIONS_EXPLAIN' => 'The permissions and role defined for this item will only be applied to this item and all checked items.',
@@ -138,7 +139,7 @@ $lang = array_merge($lang, array(
'NO_AUTH_SETTING_FOUND' => 'Permission settings not defined.',
'NO_ROLE_ASSIGNED' => 'No role assigned…',
- 'NO_ROLE_ASSIGNED_EXPLAIN' => 'Setting to this role does not change permissions on the right. If you want to unset/remove all permissions you should use the “All <samp>NO</samp>” link.',
+ 'NO_ROLE_ASSIGNED_EXPLAIN' => 'Setting to this role does not change permissions on the right. If you want to unset/remove all permissions you should use the “All <strong>NO</strong>” link.',
'NO_ROLE_AVAILABLE' => 'No role available',
'NO_ROLE_NAME_SPECIFIED' => 'Please give the role a name.',
'NO_ROLE_SELECTED' => 'Role could not be found.',
@@ -183,7 +184,6 @@ $lang = array_merge($lang, array(
'ROLE_USER_STANDARD' => 'Standard Features',
'ROLE_USER_NEW_MEMBER' => 'Newly Registered User Features',
-
'ROLE_DESCRIPTION_ADMIN_FORUM' => 'Can access the forum management and forum permission settings.',
'ROLE_DESCRIPTION_ADMIN_FULL' => 'Has access to all administrative functions of this board.<br />Not recommended.',
'ROLE_DESCRIPTION_ADMIN_STANDARD' => 'Has access to most administrative features but is not allowed to use server or system related tools.',
@@ -197,17 +197,17 @@ $lang = array_merge($lang, array(
'ROLE_DESCRIPTION_FORUM_POLLS' => 'Like Standard Access but can also create polls.',
'ROLE_DESCRIPTION_FORUM_READONLY' => 'Can read the forum, but cannot create new topics or reply to posts.',
'ROLE_DESCRIPTION_FORUM_STANDARD' => 'Can use most forum features including attachments and deleting own topics, but cannot lock own topics, and cannot create polls.',
- 'ROLE_DESCRIPTION_FORUM_NEW_MEMBER' => 'A role for members of the special newly registered users group; contains <samp>NEVER</samp> permissions to lock features for new users.',
+ 'ROLE_DESCRIPTION_FORUM_NEW_MEMBER' => 'A role for members of the special newly registered users group; contains <strong>NEVER</strong> permissions to lock features for new users.',
'ROLE_DESCRIPTION_MOD_FULL' => 'Can use all moderating features, including banning.',
'ROLE_DESCRIPTION_MOD_QUEUE' => 'Can use the Moderation Queue to validate and edit posts, but nothing else.',
'ROLE_DESCRIPTION_MOD_SIMPLE' => 'Can only use basic topic actions. Cannot send warnings or use moderation queue.',
'ROLE_DESCRIPTION_MOD_STANDARD' => 'Can use most moderating tools, but cannot ban users or change the post author.',
'ROLE_DESCRIPTION_USER_FULL' => 'Can use all available forum features for users, including changing the user name or ignoring the flood limit.<br />Not recommended.',
- 'ROLE_DESCRIPTION_USER_LIMITED' => 'Can access some of the user features. Attachments, e-mails, or instant messages are not allowed.',
+ 'ROLE_DESCRIPTION_USER_LIMITED' => 'Can access some of the user features. Attachments, emails, or instant messages are not allowed.',
'ROLE_DESCRIPTION_USER_NOAVATAR' => 'Has a limited feature set and is not allowed to use the Avatar feature.',
'ROLE_DESCRIPTION_USER_NOPM' => 'Has a limited feature set, and is not allowed to use Private Messages.',
'ROLE_DESCRIPTION_USER_STANDARD' => 'Can access most but not all user features. Cannot change user name or ignore the flood limit, for instance.',
- 'ROLE_DESCRIPTION_USER_NEW_MEMBER' => 'A role for members of the special newly registered users group; contains <samp>NEVER</samp> permissions to lock features for new users.',
+ 'ROLE_DESCRIPTION_USER_NEW_MEMBER' => 'A role for members of the special newly registered users group; contains <strong>NEVER</strong> permissions to lock features for new users.',
'ROLE_DESCRIPTION_EXPLAIN' => 'You are able to enter a short explanation of what the role is doing or for what it is meant for. The text you enter here will be displayed within the permissions screens too.',
'ROLE_DESCRIPTION_LONG' => 'The role description is too long, please limit it to 4000 characters.',
@@ -228,48 +228,48 @@ $lang = array_merge($lang, array(
'SET_USERS_PERMISSIONS' => 'Set user permissions',
'SET_USERS_FORUM_PERMISSIONS' => 'Set user forum permissions',
- 'TRACE_DEFAULT' => 'By default every permission is <samp>NO</samp> (unset). So the permission can be overwritten by other settings.',
+ 'TRACE_DEFAULT' => 'By default every permission is <strong>NO</strong> (unset). So the permission can be overwritten by other settings.',
'TRACE_FOR' => 'Trace for',
'TRACE_GLOBAL_SETTING' => '%s (global)',
- 'TRACE_GROUP_NEVER_TOTAL_NEVER' => 'This group’s permission is set to <samp>NEVER</samp> like the total result so the old result is kept.',
- 'TRACE_GROUP_NEVER_TOTAL_NEVER_LOCAL' => 'This group’s permission for this forum is set to <samp>NEVER</samp> like the total result so the old result is kept.',
- 'TRACE_GROUP_NEVER_TOTAL_NO' => 'This group’s permission is set to <samp>NEVER</samp> which becomes the new total value because it wasn’t set yet (set to <samp>NO</samp>).',
- 'TRACE_GROUP_NEVER_TOTAL_NO_LOCAL' => 'This group’s permission for this forum is set to <samp>NEVER</samp> which becomes the new total value because it wasn’t set yet (set to <samp>NO</samp>).',
- 'TRACE_GROUP_NEVER_TOTAL_YES' => 'This group’s permission is set to <samp>NEVER</samp> which overwrites the total <samp>YES</samp> to a <samp>NEVER</samp> for this user.',
- 'TRACE_GROUP_NEVER_TOTAL_YES_LOCAL' => 'This group’s permission for this forum is set to <samp>NEVER</samp> which overwrites the total <samp>YES</samp> to a <samp>NEVER</samp> for this user.',
- 'TRACE_GROUP_NO' => 'The permission is <samp>NO</samp> for this group so the old total value is kept.',
- 'TRACE_GROUP_NO_LOCAL' => 'The permission is <samp>NO</samp> for this group within this forum so the old total value is kept.',
- 'TRACE_GROUP_YES_TOTAL_NEVER' => 'This group’s permission is set to <samp>YES</samp> but the total <samp>NEVER</samp> cannot be overwritten.',
- 'TRACE_GROUP_YES_TOTAL_NEVER_LOCAL' => 'This group’s permission for this forum is set to <samp>YES</samp> but the total <samp>NEVER</samp> cannot be overwritten.',
- 'TRACE_GROUP_YES_TOTAL_NO' => 'This group’s permission is set to <samp>YES</samp> which becomes the new total value because it wasn’t set yet (set to <samp>NO</samp>).',
- 'TRACE_GROUP_YES_TOTAL_NO_LOCAL' => 'This group’s permission for this forum is set to <samp>YES</samp> which becomes the new total value because it wasn’t set yet (set to <samp>NO</samp>).',
- 'TRACE_GROUP_YES_TOTAL_YES' => 'This group’s permission is set to <samp>YES</samp> and the total permission is already set to <samp>YES</samp>, so the total result is kept.',
- 'TRACE_GROUP_YES_TOTAL_YES_LOCAL' => 'This group’s permission for this forum is set to <samp>YES</samp> and the total permission is already set to <samp>YES</samp>, so the total result is kept.',
+ 'TRACE_GROUP_NEVER_TOTAL_NEVER' => 'This group’s permission is set to <strong>NEVER</strong> like the total result so the old result is kept.',
+ 'TRACE_GROUP_NEVER_TOTAL_NEVER_LOCAL' => 'This group’s permission for this forum is set to <strong>NEVER</strong> like the total result so the old result is kept.',
+ 'TRACE_GROUP_NEVER_TOTAL_NO' => 'This group’s permission is set to <strong>NEVER</strong> which becomes the new total value because it wasn’t set yet (set to <strong>NO</strong>).',
+ 'TRACE_GROUP_NEVER_TOTAL_NO_LOCAL' => 'This group’s permission for this forum is set to <strong>NEVER</strong> which becomes the new total value because it wasn’t set yet (set to <strong>NO</strong>).',
+ 'TRACE_GROUP_NEVER_TOTAL_YES' => 'This group’s permission is set to <strong>NEVER</strong> which overwrites the total <strong>YES</strong> to a <strong>NEVER</strong> for this user.',
+ 'TRACE_GROUP_NEVER_TOTAL_YES_LOCAL' => 'This group’s permission for this forum is set to <strong>NEVER</strong> which overwrites the total <strong>YES</strong> to a <strong>NEVER</strong> for this user.',
+ 'TRACE_GROUP_NO' => 'The permission is <strong>NO</strong> for this group so the old total value is kept.',
+ 'TRACE_GROUP_NO_LOCAL' => 'The permission is <strong>NO</strong> for this group within this forum so the old total value is kept.',
+ 'TRACE_GROUP_YES_TOTAL_NEVER' => 'This group’s permission is set to <strong>YES</strong> but the total <strong>NEVER</strong> cannot be overwritten.',
+ 'TRACE_GROUP_YES_TOTAL_NEVER_LOCAL' => 'This group’s permission for this forum is set to <strong>YES</strong> but the total <strong>NEVER</strong> cannot be overwritten.',
+ 'TRACE_GROUP_YES_TOTAL_NO' => 'This group’s permission is set to <strong>YES</strong> which becomes the new total value because it wasn’t set yet (set to <strong>NO</strong>).',
+ 'TRACE_GROUP_YES_TOTAL_NO_LOCAL' => 'This group’s permission for this forum is set to <strong>YES</strong> which becomes the new total value because it wasn’t set yet (set to <strong>NO</strong>).',
+ 'TRACE_GROUP_YES_TOTAL_YES' => 'This group’s permission is set to <strong>YES</strong> and the total permission is already set to <strong>YES</strong>, so the total result is kept.',
+ 'TRACE_GROUP_YES_TOTAL_YES_LOCAL' => 'This group’s permission for this forum is set to <strong>YES</strong> and the total permission is already set to <strong>YES</strong>, so the total result is kept.',
'TRACE_PERMISSION' => 'Trace permission - %s',
'TRACE_RESULT' => 'Trace result',
'TRACE_SETTING' => 'Trace setting',
- 'TRACE_USER_GLOBAL_YES_TOTAL_YES' => 'The forum independent user permission evaluates to <samp>YES</samp> but the total permission is already set to <samp>YES</samp>, so the total result is kept. %sTrace global permission%s',
- 'TRACE_USER_GLOBAL_YES_TOTAL_NEVER' => 'The forum independent user permission evaluates to <samp>YES</samp> which overwrites the current local result <samp>NEVER</samp>. %sTrace global permission%s',
- 'TRACE_USER_GLOBAL_NEVER_TOTAL_KEPT' => 'The forum independent user permission evaluates to <samp>NEVER</samp> which doesn’t influence the local permission. %sTrace global permission%s',
-
- 'TRACE_USER_FOUNDER' => 'The user is a founder, therefore admin permissions are always set to <samp>YES</samp>.',
- 'TRACE_USER_KEPT' => 'The user’s permission is <samp>NO</samp> so the old total value is kept.',
- 'TRACE_USER_KEPT_LOCAL' => 'The user’s permission for this forum is <samp>NO</samp> so the old total value is kept.',
- 'TRACE_USER_NEVER_TOTAL_NEVER' => 'The user’s permission is set to <samp>NEVER</samp> and the total value is set to <samp>NEVER</samp>, so nothing is changed.',
- 'TRACE_USER_NEVER_TOTAL_NEVER_LOCAL' => 'The user’s permission for this forum is set to <samp>NEVER</samp> and the total value is set to <samp>NEVER</samp>, so nothing is changed.',
- 'TRACE_USER_NEVER_TOTAL_NO' => 'The user’s permission is set to <samp>NEVER</samp> which becomes the total value because it was set to NO.',
- 'TRACE_USER_NEVER_TOTAL_NO_LOCAL' => 'The user’s permission for this forum is set to <samp>NEVER</samp> which becomes the total value because it was set to NO.',
- 'TRACE_USER_NEVER_TOTAL_YES' => 'The user’s permission is set to <samp>NEVER</samp> and overwrites the previous <samp>YES</samp>.',
- 'TRACE_USER_NEVER_TOTAL_YES_LOCAL' => 'The user’s permission for this forum is set to <samp>NEVER</samp> and overwrites the previous <samp>YES</samp>.',
- 'TRACE_USER_NO_TOTAL_NO' => 'The user’s permission is <samp>NO</samp> and the total value was set to NO so it defaults to <samp>NEVER</samp>.',
- 'TRACE_USER_NO_TOTAL_NO_LOCAL' => 'The user’s permission for this forum is <samp>NO</samp> and the total value was set to NO so it defaults to <samp>NEVER</samp>.',
- 'TRACE_USER_YES_TOTAL_NEVER' => 'The user’s permission is set to <samp>YES</samp> but the total <samp>NEVER</samp> cannot be overwritten.',
- 'TRACE_USER_YES_TOTAL_NEVER_LOCAL' => 'The user’s permission for this forum is set to <samp>YES</samp> but the total <samp>NEVER</samp> cannot be overwritten.',
- 'TRACE_USER_YES_TOTAL_NO' => 'The user’s permission is set to <samp>YES</samp> which becomes the total value because it was set to <samp>NO</samp>.',
- 'TRACE_USER_YES_TOTAL_NO_LOCAL' => 'The user’s permission for this forum is set to <samp>YES</samp> which becomes the total value because it was set to <samp>NO</samp>.',
- 'TRACE_USER_YES_TOTAL_YES' => 'The user’s permission is set to <samp>YES</samp> and the total value is set to <samp>YES</samp>, so nothing is changed.',
- 'TRACE_USER_YES_TOTAL_YES_LOCAL' => 'The user’s permission for this forum is set to <samp>YES</samp> and the total value is set to <samp>YES</samp>, so nothing is changed.',
+ 'TRACE_USER_GLOBAL_YES_TOTAL_YES' => 'The forum independent user permission evaluates to <strong>YES</strong> but the total permission is already set to <strong>YES</strong>, so the total result is kept. %sTrace global permission%s',
+ 'TRACE_USER_GLOBAL_YES_TOTAL_NEVER' => 'The forum independent user permission evaluates to <strong>YES</strong> which overwrites the current local result <strong>NEVER</strong>. %sTrace global permission%s',
+ 'TRACE_USER_GLOBAL_NEVER_TOTAL_KEPT' => 'The forum independent user permission evaluates to <strong>NEVER</strong> which doesn’t influence the local permission. %sTrace global permission%s',
+
+ 'TRACE_USER_FOUNDER' => 'The user is a founder, therefore admin permissions are always set to <strong>YES</strong>.',
+ 'TRACE_USER_KEPT' => 'The user’s permission is <strong>NO</strong> so the old total value is kept.',
+ 'TRACE_USER_KEPT_LOCAL' => 'The user’s permission for this forum is <strong>NO</strong> so the old total value is kept.',
+ 'TRACE_USER_NEVER_TOTAL_NEVER' => 'The user’s permission is set to <strong>NEVER</strong> and the total value is set to <strong>NEVER</strong>, so nothing is changed.',
+ 'TRACE_USER_NEVER_TOTAL_NEVER_LOCAL' => 'The user’s permission for this forum is set to <strong>NEVER</strong> and the total value is set to <strong>NEVER</strong>, so nothing is changed.',
+ 'TRACE_USER_NEVER_TOTAL_NO' => 'The user’s permission is set to <strong>NEVER</strong> which becomes the total value because it was set to NO.',
+ 'TRACE_USER_NEVER_TOTAL_NO_LOCAL' => 'The user’s permission for this forum is set to <strong>NEVER</strong> which becomes the total value because it was set to NO.',
+ 'TRACE_USER_NEVER_TOTAL_YES' => 'The user’s permission is set to <strong>NEVER</strong> and overwrites the previous <strong>YES</strong>.',
+ 'TRACE_USER_NEVER_TOTAL_YES_LOCAL' => 'The user’s permission for this forum is set to <strong>NEVER</strong> and overwrites the previous <strong>YES</strong>.',
+ 'TRACE_USER_NO_TOTAL_NO' => 'The user’s permission is <strong>NO</strong> and the total value was set to NO so it defaults to <strong>NEVER</strong>.',
+ 'TRACE_USER_NO_TOTAL_NO_LOCAL' => 'The user’s permission for this forum is <strong>NO</strong> and the total value was set to NO so it defaults to <strong>NEVER</strong>.',
+ 'TRACE_USER_YES_TOTAL_NEVER' => 'The user’s permission is set to <strong>YES</strong> but the total <strong>NEVER</strong> cannot be overwritten.',
+ 'TRACE_USER_YES_TOTAL_NEVER_LOCAL' => 'The user’s permission for this forum is set to <strong>YES</strong> but the total <strong>NEVER</strong> cannot be overwritten.',
+ 'TRACE_USER_YES_TOTAL_NO' => 'The user’s permission is set to <strong>YES</strong> which becomes the total value because it was set to <strong>NO</strong>.',
+ 'TRACE_USER_YES_TOTAL_NO_LOCAL' => 'The user’s permission for this forum is set to <strong>YES</strong> which becomes the total value because it was set to <strong>NO</strong>.',
+ 'TRACE_USER_YES_TOTAL_YES' => 'The user’s permission is set to <strong>YES</strong> and the total value is set to <strong>YES</strong>, so nothing is changed.',
+ 'TRACE_USER_YES_TOTAL_YES_LOCAL' => 'The user’s permission for this forum is set to <strong>YES</strong> and the total value is set to <strong>YES</strong>, so nothing is changed.',
'TRACE_WHO' => 'Who',
'TRACE_TOTAL' => 'Total',
@@ -285,5 +285,3 @@ $lang = array_merge($lang, array(
'WRONG_PERMISSION_TYPE' => 'Wrong permission type selected.',
'WRONG_PERMISSION_SETTING_FORMAT' => 'The permission settings are in a wrong format, phpBB is not able to process them correctly.',
));
-
-?> \ No newline at end of file
diff --git a/phpBB/language/en/acp/permissions_phpbb.php b/phpBB/language/en/acp/permissions_phpbb.php
index 945a675861..2e80e61adc 100644
--- a/phpBB/language/en/acp/permissions_phpbb.php
+++ b/phpBB/language/en/acp/permissions_phpbb.php
@@ -1,11 +1,14 @@
<?php
/**
-* acp_permissions_phpbb (phpBB Permission Set) [English]
*
-* @package language
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
*/
/**
@@ -34,208 +37,176 @@ if (empty($lang) || !is_array($lang))
// in a url you again do not need to specify an order e.g., 'Click %sHERE%s' is fine
/**
-* MODDERS PLEASE NOTE
-*
-* You are able to put your permission sets into a separate file too by
-* prefixing the new file with permissions_ and putting it into the acp
-* language folder.
-*
-* An example of how the file could look like:
-*
-* <code>
+* EXTENSION-DEVELOPERS PLEASE NOTE
*
-* if (empty($lang) || !is_array($lang))
-* {
-* $lang = array();
-* }
-*
-* // Adding new category
-* $lang['permission_cat']['bugs'] = 'Bugs';
-*
-* // Adding new permission set
-* $lang['permission_type']['bug_'] = 'Bug Permissions';
-*
-* // Adding the permissions
-* $lang = array_merge($lang, array(
-* 'acl_bug_view' => array('lang' => 'Can view bug reports', 'cat' => 'bugs'),
-* 'acl_bug_post' => array('lang' => 'Can post bugs', 'cat' => 'post'), // Using a phpBB category here
-* ));
-*
-* </code>
+* You are able to put your permission sets into your extension.
+* The permissions logic should be added via the 'core.permissions' event.
+* You can easily add new permission categories, types and permissions, by
+* simply merging them into the respective arrays.
+* The respective language strings should be added into a language file, that
+* start with 'permissions_', so they are automatically loaded within the ACP.
*/
-// Define categories and permission types
$lang = array_merge($lang, array(
- 'permission_cat' => array(
- 'actions' => 'Actions',
- 'content' => 'Content',
- 'forums' => 'Forums',
- 'misc' => 'Misc',
- 'permissions' => 'Permissions',
- 'pm' => 'Private messages',
- 'polls' => 'Polls',
- 'post' => 'Post',
- 'post_actions' => 'Post actions',
- 'posting' => 'Posting',
- 'profile' => 'Profile',
- 'settings' => 'Settings',
- 'topic_actions' => 'Topic actions',
- 'user_group' => 'Users &amp; Groups',
- ),
-
- // With defining 'global' here we are able to specify what is printed out if the permission is within the global scope.
- 'permission_type' => array(
- 'u_' => 'User permissions',
- 'a_' => 'Admin permissions',
- 'm_' => 'Moderator permissions',
- 'f_' => 'Forum permissions',
- 'global' => array(
- 'm_' => 'Global moderator permissions',
- ),
- ),
+ 'ACL_CAT_ACTIONS' => 'Actions',
+ 'ACL_CAT_CONTENT' => 'Content',
+ 'ACL_CAT_FORUMS' => 'Forums',
+ 'ACL_CAT_MISC' => 'Misc',
+ 'ACL_CAT_PERMISSIONS' => 'Permissions',
+ 'ACL_CAT_PM' => 'Private messages',
+ 'ACL_CAT_POLLS' => 'Polls',
+ 'ACL_CAT_POST' => 'Post',
+ 'ACL_CAT_POST_ACTIONS' => 'Post actions',
+ 'ACL_CAT_POSTING' => 'Posting',
+ 'ACL_CAT_PROFILE' => 'Profile',
+ 'ACL_CAT_SETTINGS' => 'Settings',
+ 'ACL_CAT_TOPIC_ACTIONS' => 'Topic actions',
+ 'ACL_CAT_USER_GROUP' => 'Users &amp; Groups',
));
// User Permissions
$lang = array_merge($lang, array(
- 'acl_u_viewprofile' => array('lang' => 'Can view profiles, memberlist and online list', 'cat' => 'profile'),
- 'acl_u_chgname' => array('lang' => 'Can change username', 'cat' => 'profile'),
- 'acl_u_chgpasswd' => array('lang' => 'Can change password', 'cat' => 'profile'),
- 'acl_u_chgemail' => array('lang' => 'Can change e-mail address', 'cat' => 'profile'),
- 'acl_u_chgavatar' => array('lang' => 'Can change avatar', 'cat' => 'profile'),
- 'acl_u_chggrp' => array('lang' => 'Can change default usergroup', 'cat' => 'profile'),
-
- 'acl_u_attach' => array('lang' => 'Can attach files', 'cat' => 'post'),
- 'acl_u_download' => array('lang' => 'Can download files', 'cat' => 'post'),
- 'acl_u_savedrafts' => array('lang' => 'Can save drafts', 'cat' => 'post'),
- 'acl_u_chgcensors' => array('lang' => 'Can disable word censors', 'cat' => 'post'),
- 'acl_u_sig' => array('lang' => 'Can use signature', 'cat' => 'post'),
-
- 'acl_u_sendpm' => array('lang' => 'Can send private messages', 'cat' => 'pm'),
- 'acl_u_masspm' => array('lang' => 'Can send messages to multiple users', 'cat' => 'pm'),
- 'acl_u_masspm_group'=> array('lang' => 'Can send messages to groups', 'cat' => 'pm'),
- 'acl_u_readpm' => array('lang' => 'Can read private messages', 'cat' => 'pm'),
- 'acl_u_pm_edit' => array('lang' => 'Can edit own private messages', 'cat' => 'pm'),
- 'acl_u_pm_delete' => array('lang' => 'Can remove private messages from own folder', 'cat' => 'pm'),
- 'acl_u_pm_forward' => array('lang' => 'Can forward private messages', 'cat' => 'pm'),
- 'acl_u_pm_emailpm' => array('lang' => 'Can e-mail private messages', 'cat' => 'pm'),
- 'acl_u_pm_printpm' => array('lang' => 'Can print private messages', 'cat' => 'pm'),
- 'acl_u_pm_attach' => array('lang' => 'Can attach files in private messages', 'cat' => 'pm'),
- 'acl_u_pm_download' => array('lang' => 'Can download files in private messages', 'cat' => 'pm'),
- 'acl_u_pm_bbcode' => array('lang' => 'Can use BBCode in private messages', 'cat' => 'pm'),
- 'acl_u_pm_smilies' => array('lang' => 'Can use smilies in private messages', 'cat' => 'pm'),
- 'acl_u_pm_img' => array('lang' => 'Can use [img] BBCode tag in private messages', 'cat' => 'pm'),
- 'acl_u_pm_flash' => array('lang' => 'Can use [flash] BBCode tag in private messages', 'cat' => 'pm'),
-
- 'acl_u_sendemail' => array('lang' => 'Can send e-mails', 'cat' => 'misc'),
- 'acl_u_sendim' => array('lang' => 'Can send instant messages', 'cat' => 'misc'),
- 'acl_u_ignoreflood' => array('lang' => 'Can ignore flood limit', 'cat' => 'misc'),
- 'acl_u_hideonline' => array('lang' => 'Can hide online status', 'cat' => 'misc'),
- 'acl_u_viewonline' => array('lang' => 'Can view hidden online users', 'cat' => 'misc'),
- 'acl_u_search' => array('lang' => 'Can search board', 'cat' => 'misc'),
+ 'ACL_U_VIEWPROFILE' => 'Can view profiles, memberlist and online list',
+ 'ACL_U_CHGNAME' => 'Can change username',
+ 'ACL_U_CHGPASSWD' => 'Can change password',
+ 'ACL_U_CHGEMAIL' => 'Can change email address',
+ 'ACL_U_CHGAVATAR' => 'Can change avatar',
+ 'ACL_U_CHGGRP' => 'Can change default usergroup',
+ 'ACL_U_CHGPROFILEINFO' => 'Can change profile field information',
+
+ 'ACL_U_ATTACH' => 'Can attach files',
+ 'ACL_U_DOWNLOAD' => 'Can download files',
+ 'ACL_U_SAVEDRAFTS' => 'Can save drafts',
+ 'ACL_U_CHGCENSORS' => 'Can disable word censors',
+ 'ACL_U_SIG' => 'Can use signature',
+
+ 'ACL_U_SENDPM' => 'Can send private messages',
+ 'ACL_U_MASSPM' => 'Can send messages to multiple users',
+ 'ACL_U_MASSPM_GROUP'=> 'Can send messages to groups',
+ 'ACL_U_READPM' => 'Can read private messages',
+ 'ACL_U_PM_EDIT' => 'Can edit own private messages',
+ 'ACL_U_PM_DELETE' => 'Can remove private messages from own folder',
+ 'ACL_U_PM_FORWARD' => 'Can forward private messages',
+ 'ACL_U_PM_EMAILPM' => 'Can email private messages',
+ 'ACL_U_PM_PRINTPM' => 'Can print private messages',
+ 'ACL_U_PM_ATTACH' => 'Can attach files in private messages',
+ 'ACL_U_PM_DOWNLOAD' => 'Can download files in private messages',
+ 'ACL_U_PM_BBCODE' => 'Can use BBCode in private messages',
+ 'ACL_U_PM_SMILIES' => 'Can use smilies in private messages',
+ 'ACL_U_PM_IMG' => 'Can use [img] BBCode tag in private messages',
+ 'ACL_U_PM_FLASH' => 'Can use [flash] BBCode tag in private messages',
+
+ 'ACL_U_SENDEMAIL' => 'Can send emails',
+ 'ACL_U_SENDIM' => 'Can send instant messages',
+ 'ACL_U_IGNOREFLOOD' => 'Can ignore flood limit',
+ 'ACL_U_HIDEONLINE' => 'Can hide online status',
+ 'ACL_U_VIEWONLINE' => 'Can view hidden online users',
+ 'ACL_U_SEARCH' => 'Can search board',
));
// Forum Permissions
$lang = array_merge($lang, array(
- 'acl_f_list' => array('lang' => 'Can see forum', 'cat' => 'post'),
- 'acl_f_read' => array('lang' => 'Can read forum', 'cat' => 'post'),
- 'acl_f_post' => array('lang' => 'Can start new topics', 'cat' => 'post'),
- 'acl_f_reply' => array('lang' => 'Can reply to topics', 'cat' => 'post'),
- 'acl_f_icons' => array('lang' => 'Can use topic/post icons', 'cat' => 'post'),
- 'acl_f_announce' => array('lang' => 'Can post announcements', 'cat' => 'post'),
- 'acl_f_sticky' => array('lang' => 'Can post stickies', 'cat' => 'post'),
-
- 'acl_f_poll' => array('lang' => 'Can create polls', 'cat' => 'polls'),
- 'acl_f_vote' => array('lang' => 'Can vote in polls', 'cat' => 'polls'),
- 'acl_f_votechg' => array('lang' => 'Can change existing vote', 'cat' => 'polls'),
-
- 'acl_f_attach' => array('lang' => 'Can attach files', 'cat' => 'content'),
- 'acl_f_download' => array('lang' => 'Can download files', 'cat' => 'content'),
- 'acl_f_sigs' => array('lang' => 'Can use signatures', 'cat' => 'content'),
- 'acl_f_bbcode' => array('lang' => 'Can use BBCode', 'cat' => 'content'),
- 'acl_f_smilies' => array('lang' => 'Can use smilies', 'cat' => 'content'),
- 'acl_f_img' => array('lang' => 'Can use [img] BBCode tag', 'cat' => 'content'),
- 'acl_f_flash' => array('lang' => 'Can use [flash] BBCode tag', 'cat' => 'content'),
-
- 'acl_f_edit' => array('lang' => 'Can edit own posts', 'cat' => 'actions'),
- 'acl_f_delete' => array('lang' => 'Can delete own posts', 'cat' => 'actions'),
- 'acl_f_user_lock' => array('lang' => 'Can lock own topics', 'cat' => 'actions'),
- 'acl_f_bump' => array('lang' => 'Can bump topics', 'cat' => 'actions'),
- 'acl_f_report' => array('lang' => 'Can report posts', 'cat' => 'actions'),
- 'acl_f_subscribe' => array('lang' => 'Can subscribe forum', 'cat' => 'actions'),
- 'acl_f_print' => array('lang' => 'Can print topics', 'cat' => 'actions'),
- 'acl_f_email' => array('lang' => 'Can e-mail topics', 'cat' => 'actions'),
-
- 'acl_f_search' => array('lang' => 'Can search the forum', 'cat' => 'misc'),
- 'acl_f_ignoreflood' => array('lang' => 'Can ignore flood limit', 'cat' => 'misc'),
- 'acl_f_postcount' => array('lang' => 'Increment post counter<br /><em>Please note that this setting only affects new posts.</em>', 'cat' => 'misc'),
- 'acl_f_noapprove' => array('lang' => 'Can post without approval', 'cat' => 'misc'),
+ 'ACL_F_LIST' => 'Can see forum',
+ 'ACL_F_READ' => 'Can read forum',
+ 'ACL_F_SEARCH' => 'Can search the forum',
+ 'ACL_F_SUBSCRIBE' => 'Can subscribe forum',
+ 'ACL_F_PRINT' => 'Can print topics',
+ 'ACL_F_EMAIL' => 'Can email topics',
+ 'ACL_F_BUMP' => 'Can bump topics',
+ 'ACL_F_USER_LOCK' => 'Can lock own topics',
+ 'ACL_F_DOWNLOAD' => 'Can download files',
+ 'ACL_F_REPORT' => 'Can report posts',
+
+ 'ACL_F_POST' => 'Can start new topics',
+ 'ACL_F_STICKY' => 'Can post stickies',
+ 'ACL_F_ANNOUNCE' => 'Can post announcements',
+ 'ACL_F_REPLY' => 'Can reply to topics',
+ 'ACL_F_EDIT' => 'Can edit own posts',
+ 'ACL_F_DELETE' => 'Can permanently delete own posts',
+ 'ACL_F_SOFTDELETE' => 'Can soft delete own posts<br /><em>Moderators, who have the approve posts permission, can restore soft deleted posts.</em>',
+ 'ACL_F_IGNOREFLOOD' => 'Can ignore flood limit',
+ 'ACL_F_POSTCOUNT' => 'Increment post counter<br /><em>Please note that this setting only affects new posts.</em>',
+ 'ACL_F_NOAPPROVE' => 'Can post without approval',
+
+ 'ACL_F_ATTACH' => 'Can attach files',
+ 'ACL_F_ICONS' => 'Can use topic/post icons',
+ 'ACL_F_BBCODE' => 'Can use BBCode',
+ 'ACL_F_FLASH' => 'Can use [flash] BBCode tag',
+ 'ACL_F_IMG' => 'Can use [img] BBCode tag',
+ 'ACL_F_SIGS' => 'Can use signatures',
+ 'ACL_F_SMILIES' => 'Can use smilies',
+
+ 'ACL_F_POLL' => 'Can create polls',
+ 'ACL_F_VOTE' => 'Can vote in polls',
+ 'ACL_F_VOTECHG' => 'Can change existing vote',
));
// Moderator Permissions
$lang = array_merge($lang, array(
- 'acl_m_edit' => array('lang' => 'Can edit posts', 'cat' => 'post_actions'),
- 'acl_m_delete' => array('lang' => 'Can delete posts', 'cat' => 'post_actions'),
- 'acl_m_approve' => array('lang' => 'Can approve posts', 'cat' => 'post_actions'),
- 'acl_m_report' => array('lang' => 'Can close and delete reports', 'cat' => 'post_actions'),
- 'acl_m_chgposter' => array('lang' => 'Can change post author', 'cat' => 'post_actions'),
-
- 'acl_m_move' => array('lang' => 'Can move topics', 'cat' => 'topic_actions'),
- 'acl_m_lock' => array('lang' => 'Can lock topics', 'cat' => 'topic_actions'),
- 'acl_m_split' => array('lang' => 'Can split topics', 'cat' => 'topic_actions'),
- 'acl_m_merge' => array('lang' => 'Can merge topics', 'cat' => 'topic_actions'),
-
- 'acl_m_info' => array('lang' => 'Can view post details', 'cat' => 'misc'),
- 'acl_m_warn' => array('lang' => 'Can issue warnings<br /><em>This setting is only assigned globally. It is not forum based.</em>', 'cat' => 'misc'), // This moderator setting is only global (and not local)
- 'acl_m_ban' => array('lang' => 'Can manage bans<br /><em>This setting is only assigned globally. It is not forum based.</em>', 'cat' => 'misc'), // This moderator setting is only global (and not local)
+ 'ACL_M_EDIT' => 'Can edit posts',
+ 'ACL_M_DELETE' => 'Can permanently delete posts',
+ 'ACL_M_SOFTDELETE' => 'Can soft delete posts<br /><em>Moderators, who have the approve posts permission, can restore soft deleted posts.</em>',
+ 'ACL_M_APPROVE' => 'Can approve and restore posts',
+ 'ACL_M_REPORT' => 'Can close and delete reports',
+ 'ACL_M_CHGPOSTER' => 'Can change post author',
+
+ 'ACL_M_MOVE' => 'Can move topics',
+ 'ACL_M_LOCK' => 'Can lock topics',
+ 'ACL_M_SPLIT' => 'Can split topics',
+ 'ACL_M_MERGE' => 'Can merge topics',
+
+ 'ACL_M_INFO' => 'Can view post details',
+ 'ACL_M_WARN' => 'Can issue warnings<br /><em>This setting is only assigned globally. It is not forum based.</em>', // This moderator setting is only global (and not local)
+ 'ACL_M_PM_REPORT' => 'Can close and delete reports of private messages<br /><em>This setting is only assigned globally. It is not forum based.</em>', // This moderator setting is only global (and not local)
+ 'ACL_M_BAN' => 'Can manage bans<br /><em>This setting is only assigned globally. It is not forum based.</em>', // This moderator setting is only global (and not local)
));
// Admin Permissions
$lang = array_merge($lang, array(
- 'acl_a_board' => array('lang' => 'Can alter board settings/check for updates', 'cat' => 'settings'),
- 'acl_a_server' => array('lang' => 'Can alter server/communication settings', 'cat' => 'settings'),
- 'acl_a_jabber' => array('lang' => 'Can alter Jabber settings', 'cat' => 'settings'),
- 'acl_a_phpinfo' => array('lang' => 'Can view php settings', 'cat' => 'settings'),
-
- 'acl_a_forum' => array('lang' => 'Can manage forums', 'cat' => 'forums'),
- 'acl_a_forumadd' => array('lang' => 'Can add new forums', 'cat' => 'forums'),
- 'acl_a_forumdel' => array('lang' => 'Can delete forums', 'cat' => 'forums'),
- 'acl_a_prune' => array('lang' => 'Can prune forums', 'cat' => 'forums'),
-
- 'acl_a_icons' => array('lang' => 'Can alter topic/post icons and smilies', 'cat' => 'posting'),
- 'acl_a_words' => array('lang' => 'Can alter word censors', 'cat' => 'posting'),
- 'acl_a_bbcode' => array('lang' => 'Can define BBCode tags', 'cat' => 'posting'),
- 'acl_a_attach' => array('lang' => 'Can alter attachment related settings', 'cat' => 'posting'),
-
- 'acl_a_user' => array('lang' => 'Can manage users<br /><em>This also includes seeing the users browser agent within the viewonline list.</em>', 'cat' => 'user_group'),
- 'acl_a_userdel' => array('lang' => 'Can delete/prune users', 'cat' => 'user_group'),
- 'acl_a_group' => array('lang' => 'Can manage groups', 'cat' => 'user_group'),
- 'acl_a_groupadd' => array('lang' => 'Can add new groups', 'cat' => 'user_group'),
- 'acl_a_groupdel' => array('lang' => 'Can delete groups', 'cat' => 'user_group'),
- 'acl_a_ranks' => array('lang' => 'Can manage ranks', 'cat' => 'user_group'),
- 'acl_a_profile' => array('lang' => 'Can manage custom profile fields', 'cat' => 'user_group'),
- 'acl_a_names' => array('lang' => 'Can manage disallowed names', 'cat' => 'user_group'),
- 'acl_a_ban' => array('lang' => 'Can manage bans', 'cat' => 'user_group'),
-
- 'acl_a_viewauth' => array('lang' => 'Can view permission masks', 'cat' => 'permissions'),
- 'acl_a_authgroups' => array('lang' => 'Can alter permissions for individual groups', 'cat' => 'permissions'),
- 'acl_a_authusers' => array('lang' => 'Can alter permissions for individual users', 'cat' => 'permissions'),
- 'acl_a_fauth' => array('lang' => 'Can alter forum permission class', 'cat' => 'permissions'),
- 'acl_a_mauth' => array('lang' => 'Can alter moderator permission class', 'cat' => 'permissions'),
- 'acl_a_aauth' => array('lang' => 'Can alter admin permission class', 'cat' => 'permissions'),
- 'acl_a_uauth' => array('lang' => 'Can alter user permission class', 'cat' => 'permissions'),
- 'acl_a_roles' => array('lang' => 'Can manage roles', 'cat' => 'permissions'),
- 'acl_a_switchperm' => array('lang' => 'Can use others permissions', 'cat' => 'permissions'),
-
- 'acl_a_styles' => array('lang' => 'Can manage styles', 'cat' => 'misc'),
- 'acl_a_viewlogs' => array('lang' => 'Can view logs', 'cat' => 'misc'),
- 'acl_a_clearlogs' => array('lang' => 'Can clear logs', 'cat' => 'misc'),
- 'acl_a_modules' => array('lang' => 'Can manage modules', 'cat' => 'misc'),
- 'acl_a_language' => array('lang' => 'Can manage language packs', 'cat' => 'misc'),
- 'acl_a_email' => array('lang' => 'Can send mass e-mail', 'cat' => 'misc'),
- 'acl_a_bots' => array('lang' => 'Can manage bots', 'cat' => 'misc'),
- 'acl_a_reasons' => array('lang' => 'Can manage report/denial reasons', 'cat' => 'misc'),
- 'acl_a_backup' => array('lang' => 'Can backup/restore database', 'cat' => 'misc'),
- 'acl_a_search' => array('lang' => 'Can manage search backends and settings', 'cat' => 'misc'),
+ 'ACL_A_BOARD' => 'Can alter board settings/check for updates',
+ 'ACL_A_SERVER' => 'Can alter server/communication settings',
+ 'ACL_A_JABBER' => 'Can alter Jabber settings',
+ 'ACL_A_PHPINFO' => 'Can view php settings',
+
+ 'ACL_A_FORUM' => 'Can manage forums',
+ 'ACL_A_FORUMADD' => 'Can add new forums',
+ 'ACL_A_FORUMDEL' => 'Can delete forums',
+ 'ACL_A_PRUNE' => 'Can prune forums',
+
+ 'ACL_A_ICONS' => 'Can alter topic/post icons and smilies',
+ 'ACL_A_WORDS' => 'Can alter word censors',
+ 'ACL_A_BBCODE' => 'Can define BBCode tags',
+ 'ACL_A_ATTACH' => 'Can alter attachment related settings',
+
+ 'ACL_A_USER' => 'Can manage users<br /><em>This also includes seeing the users browser agent within the viewonline list.</em>',
+ 'ACL_A_USERDEL' => 'Can delete/prune users',
+ 'ACL_A_GROUP' => 'Can manage groups',
+ 'ACL_A_GROUPADD' => 'Can add new groups',
+ 'ACL_A_GROUPDEL' => 'Can delete groups',
+ 'ACL_A_RANKS' => 'Can manage ranks',
+ 'ACL_A_PROFILE' => 'Can manage custom profile fields',
+ 'ACL_A_NAMES' => 'Can manage disallowed names',
+ 'ACL_A_BAN' => 'Can manage bans',
+
+ 'ACL_A_VIEWAUTH' => 'Can view permission masks',
+ 'ACL_A_AUTHGROUPS' => 'Can alter permissions for individual groups',
+ 'ACL_A_AUTHUSERS' => 'Can alter permissions for individual users',
+ 'ACL_A_FAUTH' => 'Can alter forum permission class',
+ 'ACL_A_MAUTH' => 'Can alter moderator permission class',
+ 'ACL_A_AAUTH' => 'Can alter admin permission class',
+ 'ACL_A_UAUTH' => 'Can alter user permission class',
+ 'ACL_A_ROLES' => 'Can manage roles',
+ 'ACL_A_SWITCHPERM' => 'Can use others permissions',
+
+ 'ACL_A_STYLES' => 'Can manage styles',
+ 'ACL_A_EXTENSIONS' => 'Can manage extensions',
+ 'ACL_A_VIEWLOGS' => 'Can view logs',
+ 'ACL_A_CLEARLOGS' => 'Can clear logs',
+ 'ACL_A_MODULES' => 'Can manage modules',
+ 'ACL_A_LANGUAGE' => 'Can manage language packs',
+ 'ACL_A_EMAIL' => 'Can send mass email',
+ 'ACL_A_BOTS' => 'Can manage bots',
+ 'ACL_A_REASONS' => 'Can manage report/denial reasons',
+ 'ACL_A_BACKUP' => 'Can backup/restore database',
+ 'ACL_A_SEARCH' => 'Can manage search backends and settings',
));
-
-?> \ No newline at end of file
diff --git a/phpBB/language/en/acp/posting.php b/phpBB/language/en/acp/posting.php
index 9232be661b..119ad2d7e9 100644
--- a/phpBB/language/en/acp/posting.php
+++ b/phpBB/language/en/acp/posting.php
@@ -1,12 +1,13 @@
<?php
/**
*
-* acp_posting [English]
+* This file is part of the phpBB Forum Software package.
*
-* @package language
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -46,6 +47,7 @@ $lang = array_merge($lang, array(
'BBCODE_ADDED' => 'BBCode added successfully.',
'BBCODE_EDITED' => 'BBCode edited successfully.',
+ 'BBCODE_DELETED' => 'The BBCode has been removed successfully.',
'BBCODE_NOT_EXIST' => 'The BBCode you selected does not exist.',
'BBCODE_HELPLINE' => 'Help line',
'BBCODE_HELPLINE_EXPLAIN' => 'This field contains the mouse over text of the BBCode.',
@@ -81,12 +83,12 @@ $lang = array_merge($lang, array(
'INTTEXT' => 'Unicode letter characters, numbers, spaces, commas, dots, minus, plus, hyphen, underscore and whitespaces.',
'IDENTIFIER' => 'Characters from the latin alphabet (A-Z), numbers, hyphen and underscore',
'NUMBER' => 'Any series of digits',
- 'EMAIL' => 'A valid e-mail address',
+ 'EMAIL' => 'A valid email address',
'URL' => 'A valid URL using any protocol (http, ftp, etc… cannot be used for javascript exploits). If none is given, “http://” is prefixed to the string.',
'LOCAL_URL' => 'A local URL. The URL must be relative to the topic page and cannot contain a server name or protocol, as links are prefixed with “%s”',
'RELATIVE_URL' => 'A relative URL. You can use this to match parts of a URL, but be careful: a full URL is a valid relative URL. When you want to use relative URLs of your board, use the LOCAL_URL token.',
- 'COLOR' => 'A HTML colour, can be either in the numeric form <samp>#FF1234</samp> or a <a href="http://www.w3.org/TR/CSS21/syndata.html#value-def-color">CSS colour keyword</a> such as <samp>fuchsia</samp> or <samp>InactiveBorder</samp>'
- )
+ 'COLOR' => 'A HTML colour, can be either in the numeric form <samp>#FF1234</samp> or a <a href="http://www.w3.org/TR/CSS21/syndata.html#value-def-color">CSS colour keyword</a> such as <samp>fuchsia</samp> or <samp>InactiveBorder</samp>',
+ ),
));
// Smilies and topic icons
@@ -109,8 +111,6 @@ $lang = array_merge($lang, array(
'DISPLAY_POSTING' => 'On posting page',
'DISPLAY_POSTING_NO' => 'Not on posting page',
-
-
'EDIT_ICONS' => 'Edit icons',
'EDIT_SMILIES' => 'Edit smilies',
'EMOTION' => 'Emotion',
@@ -122,15 +122,19 @@ $lang = array_merge($lang, array(
'FIRST' => 'First',
'ICONS_ADD' => 'Add a new icon',
- 'ICONS_NONE_ADDED' => 'No icons were added.',
- 'ICONS_ONE_ADDED' => 'The icon has been added successfully.',
- 'ICONS_ADDED' => 'The icons have been added successfully.',
+ 'ICONS_ADDED' => array(
+ 0 => 'No icons were added.',
+ 1 => 'The icon has been added successfully.',
+ 2 => 'The icons have been added successfully.',
+ ),
'ICONS_CONFIG' => 'Icon configuration',
'ICONS_DELETED' => 'The icon has been removed successfully.',
'ICONS_EDIT' => 'Edit icon',
- 'ICONS_ONE_EDITED' => 'The icon has been updated successfully.',
- 'ICONS_NONE_EDITED' => 'No icons were updated.',
- 'ICONS_EDITED' => 'The icons have been updated successfully.',
+ 'ICONS_EDITED' => array(
+ 0 => 'No icons were updated.',
+ 1 => 'The icon has been updated successfully.',
+ 2 => 'The icons have been updated successfully.',
+ ),
'ICONS_HEIGHT' => 'Icon height',
'ICONS_IMAGE' => 'Icon image',
'ICONS_IMPORTED' => 'The icons pack has been installed successfully.',
@@ -162,9 +166,11 @@ $lang = array_merge($lang, array(
'SELECT_PACKAGE' => 'Select a package file',
'SMILIES_ADD' => 'Add a new smiley',
- 'SMILIES_NONE_ADDED' => 'No smilies were added.',
- 'SMILIES_ONE_ADDED' => 'The smiley has been added successfully.',
- 'SMILIES_ADDED' => 'The smilies have been added successfully.',
+ 'SMILIES_ADDED' => array(
+ 0 => 'No smilies were added.',
+ 1 => 'The smiley has been added successfully.',
+ 2 => 'The smilies have been added successfully.',
+ ),
'SMILIES_CODE' => 'Smiley code',
'SMILIES_CONFIG' => 'Smiley configuration',
'SMILIES_DELETED' => 'The smiley has been removed successfully.',
@@ -172,9 +178,11 @@ $lang = array_merge($lang, array(
'SMILIE_NO_CODE' => 'The smiley “%s” was ignored, as there was no code entered.',
'SMILIE_NO_EMOTION' => 'The smiley “%s” was ignored, as there was no emotion entered.',
'SMILIE_NO_FILE' => 'The smiley “%s” was ignored, as the file is missing.',
- 'SMILIES_NONE_EDITED' => 'No smilies were updated.',
- 'SMILIES_ONE_EDITED' => 'The smiley has been updated successfully.',
- 'SMILIES_EDITED' => 'The smilies have been updated successfully.',
+ 'SMILIES_EDITED' => array(
+ 0 => 'No smilies were updated.',
+ 1 => 'The smiley has been updated successfully.',
+ 2 => 'The smilies have been updated successfully.',
+ ),
'SMILIES_EMOTION' => 'Emotion',
'SMILIES_HEIGHT' => 'Smiley height',
'SMILIES_IMAGE' => 'Smiley image',
@@ -186,7 +194,10 @@ $lang = array_merge($lang, array(
'SMILIES_URL' => 'Smiley image file',
'SMILIES_WIDTH' => 'Smiley width',
- 'TOO_MANY_SMILIES' => 'Limit of %d smilies reached.',
+ 'TOO_MANY_SMILIES' => array(
+ 1 => 'Limit of %d smiley reached.',
+ 2 => 'Limit of %d smilies reached.',
+ ),
'WRONG_PAK_TYPE' => 'The specified package does not contain the appropriate data.',
));
@@ -278,5 +289,3 @@ $lang = array_merge($lang, array(
'USED_IN_REPORTS' => 'Used in reports',
));
-
-?> \ No newline at end of file
diff --git a/phpBB/language/en/acp/profile.php b/phpBB/language/en/acp/profile.php
index e193d9303c..d365aeb183 100644
--- a/phpBB/language/en/acp/profile.php
+++ b/phpBB/language/en/acp/profile.php
@@ -1,12 +1,13 @@
<?php
/**
*
-* acp_profile [English]
+* This file is part of the phpBB Forum Software package.
*
-* @package language
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -38,8 +39,11 @@ if (empty($lang) || !is_array($lang))
// Custom profile fields
$lang = array_merge($lang, array(
'ADDED_PROFILE_FIELD' => 'Successfully added custom profile field.',
+ 'ALPHA_DOTS' => 'Alphanumeric and dots (periods)',
'ALPHA_ONLY' => 'Alphanumeric only',
'ALPHA_SPACERS' => 'Alphanumeric and spacers',
+ 'ALPHA_UNDERSCORE' => 'Alphanumeric and underscores',
+ 'ALPHA_PUNCTUATION' => 'Alphanumeric with comma, dots, underscore and dashes beginning with a letter',
'ALWAYS_TODAY' => 'Always the current date',
'BOOL_ENTRIES_EXPLAIN' => 'Enter your options now',
@@ -66,6 +70,10 @@ $lang = array_merge($lang, array(
'DISPLAY_AT_PROFILE_EXPLAIN' => 'The user is able to change this profile field within the user control panel.',
'DISPLAY_AT_REGISTER' => 'Display on registration screen',
'DISPLAY_AT_REGISTER_EXPLAIN' => 'If this option is enabled, the field will be displayed on registration.',
+ 'DISPLAY_ON_MEMBERLIST' => 'Display on memberlist screen',
+ 'DISPLAY_ON_MEMBERLIST_EXPLAIN' => 'If this option is enabled, the field will be displayed in the user rows on the memberlist screen.',
+ 'DISPLAY_ON_PM' => 'Display on view private message screen',
+ 'DISPLAY_ON_PM_EXPLAIN' => 'If this option is enabled, the field will be displayed in the mini-profile on the private message screen.',
'DISPLAY_ON_VT' => 'Display on viewtopic screen',
'DISPLAY_ON_VT_EXPLAIN' => 'If this option is enabled, the field will be displayed in the mini-profile on the topic screen.',
'DISPLAY_PROFILE_FIELD' => 'Publicly display profile field',
@@ -79,20 +87,26 @@ $lang = array_merge($lang, array(
'EVERYTHING_OK' => 'Everything OK',
'FIELD_BOOL' => 'Boolean (Yes/No)',
+ 'FIELD_CONTACT_DESC' => 'Contact description',
+ 'FIELD_CONTACT_URL' => 'Contact link',
'FIELD_DATE' => 'Date',
'FIELD_DESCRIPTION' => 'Field description',
'FIELD_DESCRIPTION_EXPLAIN' => 'The explanation for this field presented to the user.',
'FIELD_DROPDOWN' => 'Dropdown box',
+ 'FIELD_GOOGLEPLUS' => 'Google+',
'FIELD_IDENT' => 'Field identification',
'FIELD_IDENT_ALREADY_EXIST' => 'The chosen field identification already exist. Please choose another name.',
'FIELD_IDENT_EXPLAIN' => 'The field identification is a name to identify the profile field within the database and the templates.',
'FIELD_INT' => 'Numbers',
+ 'FIELD_IS_CONTACT' => 'Display field as a contact field',
+ 'FIELD_IS_CONTACT_EXPLAIN' => 'Contact fields are displayed within the contact section of the user profile and are displayed differently in the mini profile next to posts and private messages. You can use <samp>%s</samp> as a placeholder variable which will be replaced by a value provided by the user.',
'FIELD_LENGTH' => 'Length of input box',
'FIELD_NOT_FOUND' => 'Profile field not found.',
'FIELD_STRING' => 'Single text field',
'FIELD_TEXT' => 'Textarea',
'FIELD_TYPE' => 'Field type',
'FIELD_TYPE_EXPLAIN' => 'You are not able to change the field type later.',
+ 'FIELD_URL' => 'URL (Link)',
'FIELD_VALIDATION' => 'Field validation',
'FIRST_OPTION' => 'First option',
@@ -105,6 +119,12 @@ $lang = array_merge($lang, array(
'LANG_SPECIFIC_OPTIONS' => 'Language specific options [<strong>%s</strong>]',
+ 'LETTER_NUM_DOTS' => 'Any letters, numbers and dots (periods)',
+ 'LETTER_NUM_ONLY' => 'Any letters and numbers',
+ 'LETTER_NUM_PUNCTUATION' => 'Any letters, numbers, comma, dots, underscores and dashes beginning with any letter',
+ 'LETTER_NUM_SPACERS' => 'Any letters, numbers and spacers',
+ 'LETTER_NUM_UNDERSCORE' => 'Any letters, numbers and underscores',
+
'MAX_FIELD_CHARS' => 'Maximum number of characters',
'MAX_FIELD_NUMBER' => 'Highest allowed number',
'MIN_FIELD_CHARS' => 'Minimum number of characters',
@@ -154,5 +174,3 @@ $lang = array_merge($lang, array(
'VISIBILITY_OPTION' => 'Visibility options',
));
-
-?> \ No newline at end of file
diff --git a/phpBB/language/en/acp/prune.php b/phpBB/language/en/acp/prune.php
index 8a06225102..130d1dbf84 100644
--- a/phpBB/language/en/acp/prune.php
+++ b/phpBB/language/en/acp/prune.php
@@ -1,12 +1,13 @@
<?php
/**
*
-* acp_prune [English]
+* This file is part of the phpBB Forum Software package.
*
-* @package language
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -37,7 +38,9 @@ if (empty($lang) || !is_array($lang))
// User pruning
$lang = array_merge($lang, array(
- 'ACP_PRUNE_USERS_EXPLAIN' => 'This section allows you to delete or deactivate users on your board. Accounts can be filtered in a variety of ways; by post count, most recent activity, etc. Criteria may be combined to narrow down which accounts are affected. For example, you can prune users with fewer than 10 posts, who were also inactive after 2002-01-01. Alternatively, you may skip the criteria selection completely by entering a list of users (each on a separate line) into the text field. Take care with this facility! Once a user is deleted, there is no way to reverse the action.',
+ 'ACP_PRUNE_USERS_EXPLAIN' => 'This section allows you to delete or deactivate users on your board. Accounts can be filtered in a variety of ways; by post count, most recent activity, etc. Criteria may be combined to narrow down which accounts are affected. For example, you can prune users with fewer than 10 posts, who were also inactive after 2002-01-01. Use * as a wildcard for text fields. Alternatively, you may skip the criteria selection completely by entering a list of users (each on a separate line) into the text field. Take care with this facility! Once a user is deleted, there is no way to reverse the action.',
+
+ 'CRITERIA' => 'Criteria',
'DEACTIVATE_DELETE' => 'Deactivate or delete',
'DEACTIVATE_DELETE_EXPLAIN' => 'Choose whether to deactivate users or delete them entirely. Please note that deleted users cannot be restored!',
@@ -45,15 +48,18 @@ $lang = array_merge($lang, array(
'DELETE_USER_POSTS' => 'Delete pruned user posts',
'DELETE_USER_POSTS_EXPLAIN' => 'Removes posts made by deleted users, has no effect if users are deactivated.',
- 'JOINED_EXPLAIN' => 'Enter a date in <kbd>YYYY-MM-DD</kbd> format.',
+ 'JOINED_EXPLAIN' => 'Enter a date in <kbd>YYYY-MM-DD</kbd> format. You may use both fields to specify an interval, or leave one blank for an open date range.',
'LAST_ACTIVE_EXPLAIN' => 'Enter a date in <kbd>YYYY-MM-DD</kbd> format. Enter <kbd>0000-00-00</kbd> to prune users who never logged in, <em>Before</em> and <em>After</em> conditions will be ignored.',
+ 'POSTS_ON_QUEUE' => 'Posts Awaiting Approval',
+ 'PRUNE_USERS_GROUP_EXPLAIN' => 'Limit to users within the selected group.',
+ 'PRUNE_USERS_GROUP_NONE' => 'All groups',
'PRUNE_USERS_LIST' => 'Users to be pruned',
- 'PRUNE_USERS_LIST_DELETE' => 'With the selected critera for pruning users the following accounts will be removed.',
- 'PRUNE_USERS_LIST_DEACTIVATE' => 'With the selected critera for pruning users the following accounts will be deactivated.',
+ 'PRUNE_USERS_LIST_DELETE' => 'With the selected critera for pruning users the following accounts will be removed. You can remove individual users from the deletion list by unchecking the box next to their username.',
+ 'PRUNE_USERS_LIST_DEACTIVATE' => 'With the selected critera for pruning users the following accounts will be deactivated. You can remove individual users from the deactivation list by unchecking the box next to their username.',
- 'SELECT_USERS_EXPLAIN' => 'Enter specific usernames here, they will be used in preference to the criteria above. Founders cannot be pruned.',
+ 'SELECT_USERS_EXPLAIN' => 'Enter specific usernames here. They will be used in preference to the criteria above. Founders cannot be pruned.',
'USER_DEACTIVATE_SUCCESS' => 'The selected users have been deactivated successfully.',
'USER_DELETE_SUCCESS' => 'The selected users have been deleted successfully.',
@@ -87,5 +93,3 @@ $lang = array_merge($lang, array(
'TOPICS_PRUNED' => 'Topics pruned',
));
-
-?> \ No newline at end of file
diff --git a/phpBB/language/en/acp/search.php b/phpBB/language/en/acp/search.php
index 79ac75c833..c52b71c121 100644
--- a/phpBB/language/en/acp/search.php
+++ b/phpBB/language/en/acp/search.php
@@ -1,12 +1,13 @@
<?php
/**
*
-* acp_search [English]
+* This file is part of the phpBB Forum Software package.
*
-* @package language
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -52,16 +53,39 @@ $lang = array_merge($lang, array(
'DELETING_INDEX_IN_PROGRESS' => 'Deleting the index in progress',
'DELETING_INDEX_IN_PROGRESS_EXPLAIN' => 'The search backend is currently cleaning its index. This can take a few minutes.',
- 'FULLTEXT_MYSQL_INCOMPATIBLE_VERSION' => 'The MySQL fulltext backend can only be used with MySQL4 and above.',
- 'FULLTEXT_MYSQL_NOT_SUPPORTED' => 'MySQL fulltext indexes can only be used with MyISAM or InnoDB tables. MySQL 5.6.4 or later is required for fulltext indexes on InnoDB tables.',
+ 'FULLTEXT_MYSQL_INCOMPATIBLE_DATABASE' => 'The MySQL fulltext backend can only be used with MySQL4 and above.',
+ 'FULLTEXT_MYSQL_NOT_SUPPORTED' => 'MySQL fulltext indexes can only be used with MyISAM or InnoDB tables. MySQL 5.6.8 or later is required for fulltext indexes on InnoDB tables.',
'FULLTEXT_MYSQL_TOTAL_POSTS' => 'Total number of indexed posts',
- 'FULLTEXT_MYSQL_MBSTRING' => 'Support for non-latin UTF-8 characters using mbstring:',
- 'FULLTEXT_MYSQL_PCRE' => 'Support for non-latin UTF-8 characters using PCRE:',
- 'FULLTEXT_MYSQL_MBSTRING_EXPLAIN' => 'If PCRE does not have unicode character properties, the search backend will try to use mbstring’s regular expression engine.',
- 'FULLTEXT_MYSQL_PCRE_EXPLAIN' => 'This search backend requires PCRE unicode character properties, only available in PHP 4.4, 5.1 and above, if you want to search for non-latin characters.',
'FULLTEXT_MYSQL_MIN_SEARCH_CHARS_EXPLAIN' => 'Words with at least this many characters will be indexed for searching. You or your host can only change this setting by changing the mysql configuration.',
'FULLTEXT_MYSQL_MAX_SEARCH_CHARS_EXPLAIN' => 'Words with no more than this many characters will be indexed for searching. You or your host can only change this setting by changing the mysql configuration.',
+ 'FULLTEXT_POSTGRES_INCOMPATIBLE_DATABASE' => 'The PostgreSQL fulltext backend can only be used with PostgreSQL.',
+ 'FULLTEXT_POSTGRES_TOTAL_POSTS' => 'Total number of indexed posts',
+ 'FULLTEXT_POSTGRES_VERSION_CHECK' => 'PostgreSQL version',
+ 'FULLTEXT_POSTGRES_TS_NAME' => 'Text search Configuration Profile:',
+ 'FULLTEXT_POSTGRES_MIN_WORD_LEN' => 'Minimum word length for keywords',
+ 'FULLTEXT_POSTGRES_MAX_WORD_LEN' => 'Maximum word length for keywords',
+ 'FULLTEXT_POSTGRES_VERSION_CHECK_EXPLAIN' => 'This search backend requires PostgreSQL version 8.3 and above.',
+ 'FULLTEXT_POSTGRES_TS_NAME_EXPLAIN' => 'The Text search configuration profile used to determine the parser and dictionary.',
+ 'FULLTEXT_POSTGRES_MIN_WORD_LEN_EXPLAIN' => 'Words with at least this many characters will be included in the query to the database.',
+ 'FULLTEXT_POSTGRES_MAX_WORD_LEN_EXPLAIN' => 'Words with no more than this many characters will be included in the query to the database.',
+
+ 'FULLTEXT_SPHINX_CONFIGURE' => 'Configure the following settings to generate sphinx config file',
+ 'FULLTEXT_SPHINX_DATA_PATH' => 'Path to data directory',
+ 'FULLTEXT_SPHINX_DATA_PATH_EXPLAIN' => 'It will be used to store the indexes and log files. You should create this directory outside the web accessible directories. (should have a trailing slash)',
+ 'FULLTEXT_SPHINX_DELTA_POSTS' => 'Number of posts in frequently updated delta index',
+ 'FULLTEXT_SPHINX_HOST' => 'Sphinx search daemon host',
+ 'FULLTEXT_SPHINX_HOST_EXPLAIN' => 'Host on which the sphinx search daemon (searchd) listens. Leave empty to use the default localhost',
+ 'FULLTEXT_SPHINX_INDEXER_MEM_LIMIT' => 'Indexer memory limit',
+ 'FULLTEXT_SPHINX_INDEXER_MEM_LIMIT_EXPLAIN' => 'This number should at all times be lower than the RAM available on your machine. If you experience periodic performance problems this might be due to the indexer consuming too many resources. It might help to lower the amount of memory available to the indexer.',
+ 'FULLTEXT_SPHINX_MAIN_POSTS' => 'Number of posts in main index',
+ 'FULLTEXT_SPHINX_PORT' => 'Sphinx search daemon port',
+ 'FULLTEXT_SPHINX_PORT_EXPLAIN' => 'Port on which the sphinx search daemon (searchd) listens. Leave empty to use the default Sphinx API port 9312',
+ 'FULLTEXT_SPHINX_WRONG_DATABASE' => 'The sphinx search for phpBB supports MySQL and PostgreSQL only.',
+ 'FULLTEXT_SPHINX_CONFIG_FILE' => 'Sphinx config file',
+ 'FULLTEXT_SPHINX_CONFIG_FILE_EXPLAIN' => 'The generated content of the sphinx config file. This data needs to be pasted into the sphinx.conf which is used by sphinx search daemon. Replace the [dbuser] and [dbpassword] placeholders with your database credentials.',
+ 'FULLTEXT_SPHINX_NO_CONFIG_DATA' => 'The sphinx data directory path is not defined. Please define the path and submit to generate the config file.',
+
'GENERAL_SEARCH_SETTINGS' => 'General search settings',
'GO_TO_SEARCH_INDEX' => 'Go to search index page',
@@ -85,8 +109,15 @@ $lang = array_merge($lang, array(
'SEARCH_GUEST_INTERVAL' => 'Guest search flood interval',
'SEARCH_GUEST_INTERVAL_EXPLAIN' => 'Number of seconds guests must wait between searches. If one guest searches all others have to wait until the time interval passed.',
- 'SEARCH_INDEX_CREATE_REDIRECT' => 'All posts up to post id %1$d have now been indexed, of which %2$d posts were within this step.<br />The current rate of indexing is approximately %3$.1f posts per second.<br />Indexing in progress…',
- 'SEARCH_INDEX_DELETE_REDIRECT' => 'All posts up to post id %1$d have been removed from the search index.<br />Deleting in progress…',
+ 'SEARCH_INDEX_CREATE_REDIRECT' => array(
+ 2 => 'All posts up to post id %2$d have now been indexed, of which %1$d posts were within this step.<br />',
+ ),
+ 'SEARCH_INDEX_CREATE_REDIRECT_RATE' => array(
+ 2 => 'The current rate of indexing is approximately %1$.1f posts per second.<br />Indexing in progress…',
+ ),
+ 'SEARCH_INDEX_DELETE_REDIRECT' => array(
+ 2 => 'All posts up to post id %2$d have been removed from the search index.<br />Deleting in progress…',
+ ),
'SEARCH_INDEX_CREATED' => 'Successfully indexed all posts in the board database.',
'SEARCH_INDEX_REMOVED' => 'Successfully deleted the search index for this backend.',
'SEARCH_INTERVAL' => 'User search flood interval',
@@ -105,5 +136,3 @@ $lang = array_merge($lang, array(
'YES_SEARCH_UPDATE' => 'Enable fulltext updating',
'YES_SEARCH_UPDATE_EXPLAIN' => 'Updating of fulltext indexes when posting, overridden if search is disabled.',
));
-
-?> \ No newline at end of file
diff --git a/phpBB/language/en/acp/styles.php b/phpBB/language/en/acp/styles.php
index 3194a2ebd6..9293d67ecc 100644
--- a/phpBB/language/en/acp/styles.php
+++ b/phpBB/language/en/acp/styles.php
@@ -1,12 +1,13 @@
<?php
/**
*
-* acp_styles [English]
+* This file is part of the phpBB Forum Software package.
*
-* @package language
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -36,404 +37,53 @@ if (empty($lang) || !is_array($lang))
// in a url you again do not need to specify an order e.g., 'Click %sHERE%s' is fine
$lang = array_merge($lang, array(
- 'ACP_IMAGESETS_EXPLAIN' => 'Imagesets comprise all the button, forum, folder, etc. and other non-style specific images used by the board. Here you can edit, export or delete existing imagesets and import or activate new sets.',
- 'ACP_STYLES_EXPLAIN' => 'Here you can manage the available styles on your board. A style consists of a template, theme and imageset. You may alter existing styles, delete, deactivate, reactivate, create or import new ones. You can also see what a style will look like using the preview function. The current default style is noted by the presence of an asterisk (*). Also listed is the total user count for each style, note that overriding user styles will not be reflected here.',
- 'ACP_TEMPLATES_EXPLAIN' => 'A template set comprises all the markup used to generate the layout of your board. Here you can edit existing template sets, delete, export, import and preview sets. You can also modify the templating code used to generate BBCode.',
- 'ACP_THEMES_EXPLAIN' => 'From here you can create, install, edit, delete and export themes. A theme is the combination of colours and images that are applied to your templates to define the basic look of your board. The range of options open to you depends on the configuration of your server and phpBB installation, see the manual for further details. Please note that when creating new themes the use of an existing theme as a basis is optional.',
- 'ADD_IMAGESET' => 'Create imageset',
- 'ADD_IMAGESET_EXPLAIN' => 'Here you can create a new imageset. Depending on your server configuration and file permissions you may have additional options here. For example you may be able to base this imageset on an existing one. You may also be able to upload or import (from the store directory) a imageset archive. If you upload or import an archive the imageset name can be optionally taken from the archive name (to do this leave the imageset name blank).',
- 'ADD_STYLE' => 'Create style',
- 'ADD_STYLE_EXPLAIN' => 'Here you can create a new style. Depending on your server configuration and file permissions you may have additional options. For example you may be able to base this style on an existing one. You may also be able to upload or import (from the store directory) a style archive. If you upload or import an archive the style name will be determined automatically.',
- 'ADD_TEMPLATE' => 'Create template',
- 'ADD_TEMPLATE_EXPLAIN' => 'Here you can add a new template. Depending on your server configuration and file permissions you may have additional options here. For example you may be able to base this template set on an existing one. You may also be able to upload or import (from the store directory) a template archive. If you upload or import an archive the template name can be optionally taken from the archive name (to do this leave the template name blank).',
- 'ADD_THEME' => 'Create theme',
- 'ADD_THEME_EXPLAIN' => 'Here you can add a new theme. Depending on your server configuration and file permissions you may have additional options here. For example you may be able to base this theme on an existing one. You may also be able to upload or import (from the store directory) a theme archive. If you upload or import an archive the theme name can be optionally taken from the archive name (to do this leave the theme name blank).',
- 'ARCHIVE_FORMAT' => 'Archive file type',
- 'AUTOMATIC_EXPLAIN' => 'Leave blank to attempt automatic detection.',
-
- 'BACKGROUND' => 'Background',
- 'BACKGROUND_COLOUR' => 'Background colour',
- 'BACKGROUND_IMAGE' => 'Background image',
- 'BACKGROUND_REPEAT' => 'Background repeat',
- 'BOLD' => 'Bold',
+ 'ACP_STYLES_EXPLAIN' => 'Here you can manage the available styles on your board. You may alter existing styles, delete, deactivate, reactivate, install new ones. You can also see what a style will look like using the preview function. Also listed is the total user count for each style, note that overriding user styles will not be reflected here.',
- 'CACHE' => 'Cache',
- 'CACHE_CACHED' => 'Cached',
- 'CACHE_FILENAME' => 'Template file',
- 'CACHE_FILESIZE' => 'File size',
- 'CACHE_MODIFIED' => 'Modified',
- 'CONFIRM_IMAGESET_REFRESH' => 'Are you sure you wish to refresh all imageset data? The settings from the imageset configuration file will overwrite all modifications to the imageset which have been carried out with the imageset editor.',
- 'CONFIRM_TEMPLATE_CLEAR_CACHE' => 'Are you sure you wish to clear all cached versions of your template files?',
- 'CONFIRM_TEMPLATE_REFRESH' => 'Are you sure you wish to refresh all template data in the database with the contents of the template files on the filesystem? This will overwrite all modifications which have been carried out with the template editor while the template was stored in the database.',
- 'CONFIRM_THEME_REFRESH' => 'Are you sure you wish to refresh the theme data stored in the database with the contents of the theme on the filesystem? This will overwrite all modifications which have been carried out with the theme editor while the theme was stored in the database.',
+ 'CANNOT_BE_INSTALLED' => 'Cannot be installed',
+ 'CONFIRM_UNINSTALL_STYLES' => 'Are you sure you wish to uninstall selected styles?',
'COPYRIGHT' => 'Copyright',
- 'CREATE_IMAGESET' => 'Create new imageset',
- 'CREATE_STYLE' => 'Create new style',
- 'CREATE_TEMPLATE' => 'Create new template set',
- 'CREATE_THEME' => 'Create new theme',
- 'CURRENT_IMAGE' => 'Current image',
'DEACTIVATE_DEFAULT' => 'You cannot deactivate the default style.',
'DELETE_FROM_FS' => 'Delete from filesystem',
- 'DELETE_IMAGESET' => 'Delete imageset',
- 'DELETE_IMAGESET_EXPLAIN' => 'Here you can remove the selected imageset from the database. Please note that there is no undo capability. It is recommended that you first export your set for possible future use.',
- 'DELETE_STYLE' => 'Delete style',
- 'DELETE_STYLE_EXPLAIN' => 'Here you can remove the selected style. Take care in deleting styles, there is no undo capability.',
- 'DELETE_TEMPLATE' => 'Delete template',
- 'DELETE_TEMPLATE_EXPLAIN' => 'Here you can remove the selected template set from the database. Please note that there is no undo capability. It is recommended that you first export your set for possible future use.',
- 'DELETE_THEME' => 'Delete theme',
- 'DELETE_THEME_EXPLAIN' => 'Here you can remove the selected theme from the database. Please note that there is no undo capability. It is recommended that you first export your theme for possible future use.',
+ 'DELETE_STYLE_FILES_FAILED' => 'Error deleting files for style "%s".',
+ 'DELETE_STYLE_FILES_SUCCESS' => 'Files for style "%s" have been deleted.',
'DETAILS' => 'Details',
- 'DIMENSIONS_EXPLAIN' => 'Selecting yes here will include width/height parameters.',
-
-
- 'EDIT_DETAILS_IMAGESET' => 'Edit imageset details',
- 'EDIT_DETAILS_IMAGESET_EXPLAIN' => 'Here you can edit certain imageset details such as its name.',
- 'EDIT_DETAILS_STYLE' => 'Edit style',
- 'EDIT_DETAILS_STYLE_EXPLAIN' => 'Using the form below you can modify this existing style. You may alter the combination of template, theme and imageset which define the style itself. You may also make the style the default one.',
- 'EDIT_DETAILS_TEMPLATE' => 'Edit template details',
- 'EDIT_DETAILS_TEMPLATE_EXPLAIN' => 'Here you can edit certain template details such as its name. You may also have the option to switch storage of the stylesheet from the filesystem to the database and vice versa. This option depends on your PHP configuration and whether your template set can be written to by the web server.',
- 'EDIT_DETAILS_THEME' => 'Edit theme details',
- 'EDIT_DETAILS_THEME_EXPLAIN' => 'Here you can edit certain theme details such as its name. You may also have the option to switch storage of the stylesheet from the filesystem to the database and vice versa. This option depends on your PHP configuration and whether your stylesheet can be written to by the web server.',
- 'EDIT_IMAGESET' => 'Edit imageset',
- 'EDIT_IMAGESET_EXPLAIN' => 'Here you can edit the individual images which define the imageset. You can also specify dimensions for the image. Dimensions are optional, specifying them can overcome certain rendering issues with some browsers. By not specifying them you reduce the size of the database record a little.',
- 'EDIT_TEMPLATE' => 'Edit template',
- 'EDIT_TEMPLATE_EXPLAIN' => 'Here you can edit your template set directly. Please remember that these edits are permanent and cannot be undone once submitted. If PHP can write to the template files in your styles directory any changes here will be written directly to those files. If PHP cannot write to those files they will be copied into the database and all changes will only be reflected there. Please take care when editing your template set, remember to close all replacement variable terms {XXXX} and conditional statements.',
- 'EDIT_TEMPLATE_STORED_DB' => 'The template file was unwritable so the template set is now stored in the database containing the modified file.',
- 'EDIT_THEME' => 'Edit theme',
- 'EDIT_THEME_EXPLAIN' => 'Here you can edit the selected theme, changing colours, images, etc.',
- 'EDIT_THEME_STORED_DB' => 'The stylesheet file was unwritable so the stylesheet is now stored in the database containing your modification.',
- 'EDIT_THEME_STORE_PARSED' => 'The theme requires that its stylesheet is parsed. This is only possible if it’s stored in the database.',
- 'EDITOR_DISABLED' => 'The template editor is disabled.',
- 'EXPORT' => 'Export',
-
- 'FOREGROUND' => 'Foreground',
- 'FONT_COLOUR' => 'Font colour',
- 'FONT_FACE' => 'Font face',
- 'FONT_FACE_EXPLAIN' => 'You can specify multiple fonts separated by commas. If a user doesn’t have the first font installed the first other working font will be chosen.',
- 'FONT_SIZE' => 'Font size',
-
- 'GLOBAL_IMAGES' => 'Global',
-
- 'HIDE_CSS' => 'Hide raw CSS',
-
- 'IMAGE_WIDTH' => 'Image width',
- 'IMAGE_HEIGHT' => 'Image height',
- 'IMAGE' => 'Image',
- 'IMAGE_NAME' => 'Image name',
- 'IMAGE_PARAMETER' => 'Parameter',
- 'IMAGE_VALUE' => 'Value',
- 'IMAGESET_ADDED' => 'New imageset added on filesystem.',
- 'IMAGESET_ADDED_DB' => 'New imageset added to database.',
- 'IMAGESET_DELETED' => 'Imageset deleted successfully.',
- 'IMAGESET_DELETED_FS' => 'Imageset removed from database but some files may remain on the filesystem.',
- 'IMAGESET_DETAILS_UPDATED' => 'Imageset details successfully updated.',
- 'IMAGESET_ERR_ARCHIVE' => 'Please select an archive method.',
- 'IMAGESET_ERR_COPY_LONG' => 'The copyright can be no longer than 60 characters.',
- 'IMAGESET_ERR_NAME_CHARS' => 'The imageset name can only contain alphanumeric characters, -, +, _ and space.',
- 'IMAGESET_ERR_NAME_EXIST' => 'A imageset with that name already exists.',
- 'IMAGESET_ERR_NAME_LONG' => 'The imageset name can be no longer than 30 characters.',
- 'IMAGESET_ERR_NOT_IMAGESET' => 'The archive you specified does not contain a valid imageset.',
- 'IMAGESET_ERR_STYLE_NAME' => 'You must supply a name for this imageset.',
- 'IMAGESET_EXPORT' => 'Export imageset',
- 'IMAGESET_EXPORT_EXPLAIN' => 'Here you can export an imageset in the form of an archive. This archive will contain all the data necessary to install the set of images on another board. You may select whether to download the file directly or to place it in your store folder for download later or via FTP.',
- 'IMAGESET_EXPORTED' => 'Imageset exported successfully and stored in %s.',
- 'IMAGESET_NAME' => 'Imageset name',
- 'IMAGESET_REFRESHED' => 'Imageset refreshed successfully.',
- 'IMAGESET_UPDATED' => 'Imageset updated successfully.',
- 'ITALIC' => 'Italic',
-
- 'IMG_CAT_BUTTONS' => 'Localised buttons',
- 'IMG_CAT_CUSTOM' => 'Custom images',
- 'IMG_CAT_FOLDERS' => 'Topic icons',
- 'IMG_CAT_FORUMS' => 'Forum icons',
- 'IMG_CAT_ICONS' => 'General icons',
- 'IMG_CAT_LOGOS' => 'Logos',
- 'IMG_CAT_POLLS' => 'Polling images',
- 'IMG_CAT_UI' => 'General user interface elements',
- 'IMG_CAT_USER' => 'Additional images',
-
- 'IMG_SITE_LOGO' => 'Main logo',
- 'IMG_UPLOAD_BAR' => 'Upload progress bar',
- 'IMG_POLL_LEFT' => 'Poll left end',
- 'IMG_POLL_CENTER' => 'Poll centre',
- 'IMG_POLL_RIGHT' => 'Poll right end',
- 'IMG_ICON_FRIEND' => 'Add as friend',
- 'IMG_ICON_FOE' => 'Add as foe',
-
- 'IMG_FORUM_LINK' => 'Forum link',
- 'IMG_FORUM_READ' => 'Forum',
- 'IMG_FORUM_READ_LOCKED' => 'Forum locked',
- 'IMG_FORUM_READ_SUBFORUM' => 'Subforum',
- 'IMG_FORUM_UNREAD' => 'Forum unread posts',
- 'IMG_FORUM_UNREAD_LOCKED' => 'Forum unread posts locked',
- 'IMG_FORUM_UNREAD_SUBFORUM' => 'Subforum unread posts',
- 'IMG_SUBFORUM_READ' => 'Legend subforum',
- 'IMG_SUBFORUM_UNREAD' => 'Legend subforum unread posts',
-
- 'IMG_TOPIC_MOVED' => 'Topic moved',
-
- 'IMG_TOPIC_READ' => 'Topic',
- 'IMG_TOPIC_READ_MINE' => 'Topic posted to',
- 'IMG_TOPIC_READ_HOT' => 'Topic popular',
- 'IMG_TOPIC_READ_HOT_MINE' => 'Topic popular posted to',
- 'IMG_TOPIC_READ_LOCKED' => 'Topic locked',
- 'IMG_TOPIC_READ_LOCKED_MINE' => 'Topic locked posted to',
-
- 'IMG_TOPIC_UNREAD' => 'Topic unread posts',
- 'IMG_TOPIC_UNREAD_MINE' => 'Topic posted to unread',
- 'IMG_TOPIC_UNREAD_HOT' => 'Topic popular unread posts',
- 'IMG_TOPIC_UNREAD_HOT_MINE' => 'Topic popular posted to unread',
- 'IMG_TOPIC_UNREAD_LOCKED' => 'Topic locked unread',
- 'IMG_TOPIC_UNREAD_LOCKED_MINE' => 'Topic locked posted to unread',
-
- 'IMG_STICKY_READ' => 'Sticky topic',
- 'IMG_STICKY_READ_MINE' => 'Sticky topic posted to',
- 'IMG_STICKY_READ_LOCKED' => 'Sticky topic locked',
- 'IMG_STICKY_READ_LOCKED_MINE' => 'Sticky topic locked posted to',
- 'IMG_STICKY_UNREAD' => 'Sticky topic unread posts',
- 'IMG_STICKY_UNREAD_MINE' => 'Sticky topic posted to unread',
- 'IMG_STICKY_UNREAD_LOCKED' => 'Sticky topic locked unread posts',
- 'IMG_STICKY_UNREAD_LOCKED_MINE' => 'Sticky topic locked posted to unread',
-
- 'IMG_ANNOUNCE_READ' => 'Announcement',
- 'IMG_ANNOUNCE_READ_MINE' => 'Announcement posted to',
- 'IMG_ANNOUNCE_READ_LOCKED' => 'Announcement locked',
- 'IMG_ANNOUNCE_READ_LOCKED_MINE' => 'Announcement locked posted to',
- 'IMG_ANNOUNCE_UNREAD' => 'Announcement unread posts',
- 'IMG_ANNOUNCE_UNREAD_MINE' => 'Announcement posted to unread',
- 'IMG_ANNOUNCE_UNREAD_LOCKED' => 'Announcement locked unread posts',
- 'IMG_ANNOUNCE_UNREAD_LOCKED_MINE' => 'Announcement locked posted to unread',
- 'IMG_GLOBAL_READ' => 'Global',
- 'IMG_GLOBAL_READ_MINE' => 'Global posted to',
- 'IMG_GLOBAL_READ_LOCKED' => 'Global locked',
- 'IMG_GLOBAL_READ_LOCKED_MINE' => 'Global locked posted to',
- 'IMG_GLOBAL_UNREAD' => 'Global unread posts',
- 'IMG_GLOBAL_UNREAD_MINE' => 'Global posted to unread',
- 'IMG_GLOBAL_UNREAD_LOCKED' => 'Global locked unread posts',
- 'IMG_GLOBAL_UNREAD_LOCKED_MINE' => 'Global locked posted to unread',
-
- 'IMG_PM_READ' => 'Read private message',
- 'IMG_PM_UNREAD' => 'Unread private message',
-
- 'IMG_ICON_BACK_TOP' => 'Top',
-
- 'IMG_ICON_CONTACT_AIM' => 'AIM',
- 'IMG_ICON_CONTACT_EMAIL' => 'Send e-mail',
- 'IMG_ICON_CONTACT_ICQ' => 'ICQ',
- 'IMG_ICON_CONTACT_JABBER' => 'Jabber',
- 'IMG_ICON_CONTACT_MSNM' => 'MSNM',
- 'IMG_ICON_CONTACT_PM' => 'Send message',
- 'IMG_ICON_CONTACT_YAHOO' => 'YIM',
- 'IMG_ICON_CONTACT_WWW' => 'Website',
-
- 'IMG_ICON_POST_DELETE' => 'Delete post',
- 'IMG_ICON_POST_EDIT' => 'Edit post',
- 'IMG_ICON_POST_INFO' => 'Show post details',
- 'IMG_ICON_POST_QUOTE' => 'Quote post',
- 'IMG_ICON_POST_REPORT' => 'Report post',
- 'IMG_ICON_POST_TARGET' => 'Minipost',
- 'IMG_ICON_POST_TARGET_UNREAD' => 'New minipost',
-
-
- 'IMG_ICON_TOPIC_ATTACH' => 'Attachment',
- 'IMG_ICON_TOPIC_LATEST' => 'Last post',
- 'IMG_ICON_TOPIC_NEWEST' => 'Last unread post',
- 'IMG_ICON_TOPIC_REPORTED' => 'Post reported',
- 'IMG_ICON_TOPIC_UNAPPROVED' => 'Post unapproved',
-
- 'IMG_ICON_USER_ONLINE' => 'User online',
- 'IMG_ICON_USER_OFFLINE' => 'User offline',
- 'IMG_ICON_USER_PROFILE' => 'Show profile',
- 'IMG_ICON_USER_SEARCH' => 'Search posts',
- 'IMG_ICON_USER_WARN' => 'Warn user',
-
- 'IMG_BUTTON_PM_FORWARD' => 'Forward private message',
- 'IMG_BUTTON_PM_NEW' => 'New private message',
- 'IMG_BUTTON_PM_REPLY' => 'Reply private message',
- 'IMG_BUTTON_TOPIC_LOCKED' => 'Topic locked',
- 'IMG_BUTTON_TOPIC_NEW' => 'New topic',
- 'IMG_BUTTON_TOPIC_REPLY' => 'Reply topic',
-
- 'IMG_USER_ICON1' => 'User defined image 1',
- 'IMG_USER_ICON2' => 'User defined image 2',
- 'IMG_USER_ICON3' => 'User defined image 3',
- 'IMG_USER_ICON4' => 'User defined image 4',
- 'IMG_USER_ICON5' => 'User defined image 5',
- 'IMG_USER_ICON6' => 'User defined image 6',
- 'IMG_USER_ICON7' => 'User defined image 7',
- 'IMG_USER_ICON8' => 'User defined image 8',
- 'IMG_USER_ICON9' => 'User defined image 9',
- 'IMG_USER_ICON10' => 'User defined image 10',
-
- 'INACTIVE_STYLES' => 'Inactive styles',
- 'INCLUDE_DIMENSIONS' => 'Include dimensions',
- 'INCLUDE_IMAGESET' => 'Include imageset',
- 'INCLUDE_TEMPLATE' => 'Include template',
- 'INCLUDE_THEME' => 'Include theme',
'INHERITING_FROM' => 'Inherits from',
- 'INSTALL_IMAGESET' => 'Install imageset',
- 'INSTALL_IMAGESET_EXPLAIN' => 'Here you can install your selected imageset. You can edit certain details if you wish or use the installation defaults.',
'INSTALL_STYLE' => 'Install style',
- 'INSTALL_STYLE_EXPLAIN' => 'Here you can install a new style and if appropriate the corresponding style elements. If you already have the relevant style elements installed they will not be overwritten. Some styles require existing style elements to already be installed. If you try installing such a style and do not have the required elements you will be notified.',
- 'INSTALL_TEMPLATE' => 'Install Template',
- 'INSTALL_TEMPLATE_EXPLAIN' => 'Here you can install a new template set. Depending on your server configuration you may have a number of options here.',
- 'INSTALL_THEME' => 'Install theme',
- 'INSTALL_THEME_EXPLAIN' => 'Here you can install your selected theme. You can edit certain details if you wish or use the installation defaults.',
- 'INSTALLED_IMAGESET' => 'Installed imagesets',
- 'INSTALLED_STYLE' => 'Installed styles',
- 'INSTALLED_TEMPLATE' => 'Installed templates',
- 'INSTALLED_THEME' => 'Installed themes',
-
- 'KEEP_IMAGESET' => 'Keep “%s” imageset',
- 'KEEP_TEMPLATE' => 'Keep “%s” template',
- 'KEEP_THEME' => 'Keep “%s” theme',
-
- 'LINE_SPACING' => 'Line spacing',
- 'LOCALISED_IMAGES' => 'Localised',
- 'LOCATION_DISABLED_EXPLAIN' => 'This setting is inherited and cannot be changed.',
+ 'INSTALL_STYLES' => 'Install styles',
+ 'INSTALL_STYLES_EXPLAIN' => 'Here you can install new styles.<br />If you cannot find a specific style in list below, check to make sure style is already installed. If it is not installed, check if it was uploaded correctly.',
+ 'INVALID_STYLE_ID' => 'Invalid style ID.',
- 'NO_CLASS' => 'Cannot find class in stylesheet.',
- 'NO_IMAGESET' => 'Cannot find imageset on filesystem.',
- 'NO_IMAGE' => 'No image',
- 'NO_IMAGE_ERROR' => 'Cannot find image on filesystem.',
- 'NO_STYLE' => 'Cannot find style on filesystem.',
- 'NO_TEMPLATE' => 'Cannot find template on filesystem.',
- 'NO_THEME' => 'Cannot find theme on filesystem.',
- 'NO_UNINSTALLED_IMAGESET' => 'No uninstalled imagesets detected.',
+ 'NO_MATCHING_STYLES_FOUND' => 'No styles match your query.',
'NO_UNINSTALLED_STYLE' => 'No uninstalled styles detected.',
- 'NO_UNINSTALLED_TEMPLATE' => 'No uninstalled templates detected.',
- 'NO_UNINSTALLED_THEME' => 'No uninstalled themes detected.',
- 'NO_UNIT' => 'None',
- 'ONLY_IMAGESET' => 'This is the only remaining imageset, you cannot delete it.',
- 'ONLY_STYLE' => 'This is the only remaining style, you cannot delete it.',
- 'ONLY_TEMPLATE' => 'This is the only remaining template set, you cannot delete it.',
- 'ONLY_THEME' => 'This is the only remaining theme, you cannot delete it.',
- 'OPTIONAL_BASIS' => 'Optional basis',
+ 'PURGED_CACHE' => 'Cache was purged.',
- 'REFRESH' => 'Refresh',
- 'REPEAT_NO' => 'None',
- 'REPEAT_X' => 'Only horizontally',
- 'REPEAT_Y' => 'Only vertically',
- 'REPEAT_ALL' => 'Both directions',
- 'REPLACE_IMAGESET' => 'Replace imageset with',
- 'REPLACE_IMAGESET_EXPLAIN' => 'This imageset will replace the one you are deleting in any styles that use it.',
- 'REPLACE_STYLE' => 'Replace style with',
- 'REPLACE_STYLE_EXPLAIN' => 'This style will replace the one being deleted for members that use it.',
- 'REPLACE_TEMPLATE' => 'Replace template with',
- 'REPLACE_TEMPLATE_EXPLAIN' => 'This template set will replace the one you are deleting in any styles that use it.',
- 'REPLACE_THEME' => 'Replace theme with',
- 'REPLACE_THEME_EXPLAIN' => 'This theme will replace the one you are deleting in any styles that use it.',
- 'REPLACE_WITH_OPTION' => 'Replace with “%s”',
- 'REQUIRES_IMAGESET' => 'This style requires the %s imageset to be installed.',
- 'REQUIRES_TEMPLATE' => 'This style requires the %s template set to be installed.',
- 'REQUIRES_THEME' => 'This style requires the %s theme to be installed.',
+ 'REQUIRES_STYLE' => 'This style requires the style "%s" to be installed.',
- 'SELECT_IMAGE' => 'Select image',
- 'SELECT_TEMPLATE' => 'Select template file',
- 'SELECT_THEME' => 'Select theme file',
- 'SELECTED_IMAGE' => 'Selected image',
- 'SELECTED_IMAGESET' => 'Selected imageset',
- 'SELECTED_TEMPLATE' => 'Selected template',
- 'SELECTED_TEMPLATE_FILE' => 'Selected template file',
- 'SELECTED_THEME' => 'Selected theme',
- 'SELECTED_THEME_FILE' => 'Selected theme file',
- 'STORE_DATABASE' => 'Database',
- 'STORE_FILESYSTEM' => 'Filesystem',
'STYLE_ACTIVATE' => 'Activate',
'STYLE_ACTIVE' => 'Active',
- 'STYLE_ADDED' => 'Style added successfully.',
'STYLE_DEACTIVATE' => 'Deactivate',
'STYLE_DEFAULT' => 'Make default style',
- 'STYLE_DELETED' => 'Style deleted successfully.',
- 'STYLE_DETAILS_UPDATED' => 'Style edited successfully.',
- 'STYLE_ERR_ARCHIVE' => 'Please select an archive method.',
- 'STYLE_ERR_COPY_LONG' => 'The copyright can be no longer than 60 characters.',
- 'STYLE_ERR_MORE_ELEMENTS' => 'You must select at least one style element.',
- 'STYLE_ERR_NAME_CHARS' => 'The style name can only contain alphanumeric characters, -, +, _ and space.',
+ 'STYLE_DEFAULT_CHANGE_INACTIVE' => 'You must activate style before making it default style.',
+ 'STYLE_ERR_INVALID_PARENT' => 'Invalid parent style.',
'STYLE_ERR_NAME_EXIST' => 'A style with that name already exists.',
- 'STYLE_ERR_NAME_LONG' => 'The style name can be no longer than 30 characters.',
- 'STYLE_ERR_NO_IDS' => 'You must select a template, theme and imageset for this style.',
- 'STYLE_ERR_NOT_STYLE' => 'The imported or uploaded file did not contain a valid style archive.',
'STYLE_ERR_STYLE_NAME' => 'You must supply a name for this style.',
- 'STYLE_EXPORT' => 'Export style',
- 'STYLE_EXPORT_EXPLAIN' => 'Here you can export a style in the form of an archive. A style does not need to contain all elements but it must contain at least one. For example if you have created a new theme and imageset for a commonly used template you could simply export the theme and imageset and omit the template. You may select whether to download the file directly or to place it in your store folder for download later or via FTP.',
- 'STYLE_EXPORTED' => 'Style exported successfully and stored in %s.',
- 'STYLE_IMAGESET' => 'Imageset',
+ 'STYLE_INSTALLED' => 'Style "%s" has been installed.',
+ 'STYLE_INSTALLED_RETURN_INSTALLED_STYLES' => 'Return to installed styles list',
+ 'STYLE_INSTALLED_RETURN_UNINSTALLED_STYLES' => 'Install more styles',
'STYLE_NAME' => 'Style name',
- 'STYLE_TEMPLATE' => 'Template',
- 'STYLE_THEME' => 'Theme',
+ 'STYLE_NAME_RESERVED' => 'Style "%s" can not be installed, because the name is reserved.',
+ 'STYLE_NOT_INSTALLED' => 'Style "%s" was not installed.',
+ 'STYLE_PATH' => 'Style path',
+ 'STYLE_UNINSTALL' => 'Uninstall',
+ 'STYLE_UNINSTALL_DEPENDENT' => 'Style "%s" cannot be uninstalled because it has one or more child styles.',
+ 'STYLE_UNINSTALLED' => 'Style "%s" uninstalled successfully.',
'STYLE_USED_BY' => 'Used by (including robots)',
+ 'STYLE_VERSION' => 'Style version',
- 'TEMPLATE_ADDED' => 'Template set added and stored on filesystem.',
- 'TEMPLATE_ADDED_DB' => 'Template set added and stored in database.',
- 'TEMPLATE_CACHE' => 'Template cache',
- 'TEMPLATE_CACHE_EXPLAIN' => 'By default phpBB caches the compiled version of its templates. This decreases the load on the server each time a page is viewed and thus may reduce the page generation time. Here you can view the cache status of each file and delete individual files or the entire cache.',
- 'TEMPLATE_CACHE_CLEARED' => 'Template cache cleared successfully.',
- 'TEMPLATE_CACHE_EMPTY' => 'There are no cached templates.',
- 'TEMPLATE_DELETED' => 'Template set deleted successfully.',
- 'TEMPLATE_DELETE_DEPENDENT' => 'The template set cannot be deleted as there are one or more other template sets inheriting from it:',
- 'TEMPLATE_DELETED_FS' => 'Template set removed from database but some files may remain on the filesystem.',
- 'TEMPLATE_DETAILS_UPDATED' => 'Template details successfully updated.',
- 'TEMPLATE_EDITOR' => 'Raw HTML template editor',
- 'TEMPLATE_EDITOR_HEIGHT' => 'Template editor height',
- 'TEMPLATE_ERR_ARCHIVE' => 'Please select an archive method.',
- 'TEMPLATE_ERR_CACHE_READ' => 'The cache directory used to store cached versions of template files could not be opened.',
- 'TEMPLATE_ERR_COPY_LONG' => 'The copyright can be no longer than 60 characters.',
- 'TEMPLATE_ERR_NAME_CHARS' => 'The template name can only contain alphanumeric characters, -, +, _ and space.',
- 'TEMPLATE_ERR_NAME_EXIST' => 'A template set with that name already exists.',
- 'TEMPLATE_ERR_NAME_LONG' => 'The template name can be no longer than 30 characters.',
- 'TEMPLATE_ERR_NOT_TEMPLATE' => 'The archive you specified does not contain a valid template set.',
- 'TEMPLATE_ERR_REQUIRED_OR_INCOMPLETE' => 'The new template set requires the template %s to be installed and not inheriting itself.',
- 'TEMPLATE_ERR_STYLE_NAME' => 'You must supply a name for this template.',
- 'TEMPLATE_EXPORT' => 'Export templates',
- 'TEMPLATE_EXPORT_EXPLAIN' => 'Here you can export a template set in the form of an archive. This archive will contain all the files necessary to install the templates on another board. You may select whether to download the file directly or to place it in your store folder for download later or via FTP.',
- 'TEMPLATE_EXPORTED' => 'Templates exported successfully and stored in %s.',
- 'TEMPLATE_FILE' => 'Template file',
- 'TEMPLATE_FILE_UPDATED' => 'Template file updated successfully.',
- 'TEMPLATE_INHERITS' => 'This template sets inherits from %s and thus cannot have a different storage setting than its super template.',
- 'TEMPLATE_LOCATION' => 'Store templates in',
- 'TEMPLATE_LOCATION_EXPLAIN' => 'Images are always stored on the filesystem.',
- 'TEMPLATE_NAME' => 'Template name',
- 'TEMPLATE_FILE_NOT_WRITABLE'=> 'Unable to write to template file %s. Please check the permissions for the directory and the files.',
- 'TEMPLATE_REFRESHED' => 'Template refreshed successfully.',
-
- 'THEME_ADDED' => 'New theme added on filesystem.',
- 'THEME_ADDED_DB' => 'New theme added to database.',
- 'THEME_CLASS_ADDED' => 'Custom class added successfully.',
- 'THEME_DELETED' => 'Theme deleted successfully.',
- 'THEME_DELETED_FS' => 'Theme removed from database but files remain on the filesystem.',
- 'THEME_DETAILS_UPDATED' => 'Theme details successfully updated.',
- 'THEME_EDITOR' => 'Theme editor',
- 'THEME_EDITOR_HEIGHT' => 'Theme editor height',
- 'THEME_ERR_ARCHIVE' => 'Please select an archive method.',
- 'THEME_ERR_CLASS_CHARS' => 'Only alphanumeric characters plus ., :, -, _ and # are valid in class names.',
- 'THEME_ERR_COPY_LONG' => 'The copyright can be no longer than 60 characters.',
- 'THEME_ERR_NAME_CHARS' => 'The theme name can only contain alphanumeric characters, -, +, _ and space.',
- 'THEME_ERR_NAME_EXIST' => 'A theme with that name already exists.',
- 'THEME_ERR_NAME_LONG' => 'The theme name can be no longer than 30 characters.',
- 'THEME_ERR_NOT_THEME' => 'The archive you specified does not contain a valid theme.',
- 'THEME_ERR_REFRESH_FS' => 'This theme is stored on the filesystem so there is no need to refresh it.',
- 'THEME_ERR_STYLE_NAME' => 'You must supply a name for this theme.',
- 'THEME_FILE' => 'Theme file',
- 'THEME_EXPORT' => 'Export Theme',
- 'THEME_EXPORT_EXPLAIN' => 'Here you can export a theme in the form of an archive. This archive will contain all the data necessary to install the theme on another board. You may select whether to download the file directly or to place it in your store folder for download later or via FTP.',
- 'THEME_EXPORTED' => 'Theme exported successfully and stored in %s.',
- 'THEME_LOCATION' => 'Store stylesheet in',
- 'THEME_LOCATION_EXPLAIN' => 'Images are always stored on the filesystem.',
- 'THEME_NAME' => 'Theme name',
- 'THEME_REFRESHED' => 'Theme refreshed successfully.',
- 'THEME_UPDATED' => 'Theme updated successfully.',
-
- 'UNDERLINE' => 'Underline',
- 'UNINSTALLED_IMAGESET' => 'Uninstalled imagesets',
- 'UNINSTALLED_STYLE' => 'Uninstalled styles',
- 'UNINSTALLED_TEMPLATE' => 'Uninstalled templates',
- 'UNINSTALLED_THEME' => 'Uninstalled themes',
- 'UNSET' => 'Undefined',
+ 'UNINSTALL_DEFAULT' => 'You cannot uninstall the default style.',
+ 'BROWSE_STYLES_DATABASE' => 'Browse styles database',
));
-
-?> \ No newline at end of file
diff --git a/phpBB/language/en/acp/users.php b/phpBB/language/en/acp/users.php
index 25e5ff8269..980e73a685 100644
--- a/phpBB/language/en/acp/users.php
+++ b/phpBB/language/en/acp/users.php
@@ -1,12 +1,13 @@
<?php
/**
*
-* acp_users [English]
+* This file is part of the phpBB Forum Software package.
*
-* @package language
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -56,7 +57,7 @@ $lang = array_merge($lang, array(
'CANNOT_REMOVE_YOURSELF' => 'You are not allowed to remove your own user account.',
'CANNOT_SET_FOUNDER_IGNORED' => 'You are not able to promote ignored users to be founders.',
'CANNOT_SET_FOUNDER_INACTIVE' => 'You need to activate users before you promote them to founders, only activated users are able to be promoted.',
- 'CONFIRM_EMAIL_EXPLAIN' => 'You only need to specify this if you are changing the users e-mail address.',
+ 'CONFIRM_EMAIL_EXPLAIN' => 'You only need to specify this if you are changing the users email address.',
'DELETE_POSTS' => 'Delete posts',
'DELETE_USER' => 'Delete user',
@@ -95,8 +96,8 @@ $lang = array_merge($lang, array(
'USER_ADMIN_ACTIVATE' => 'Activate account',
'USER_ADMIN_ACTIVATED' => 'User activated successfully.',
'USER_ADMIN_AVATAR_REMOVED' => 'Successfully removed avatar from user account.',
- 'USER_ADMIN_BAN_EMAIL' => 'Ban by e-mail',
- 'USER_ADMIN_BAN_EMAIL_REASON' => 'E-mail address banned via user management',
+ 'USER_ADMIN_BAN_EMAIL' => 'Ban by email',
+ 'USER_ADMIN_BAN_EMAIL_REASON' => 'Email address banned via user management',
'USER_ADMIN_BAN_IP' => 'Ban by IP',
'USER_ADMIN_BAN_IP_REASON' => 'IP banned via user management',
'USER_ADMIN_BAN_NAME_REASON' => 'Username banned via user management',
@@ -140,5 +141,3 @@ $lang = array_merge($lang, array(
'USER_WARNING_LOG_DELETED' => 'No information available. Possibly the log entry has been deleted.',
'USER_TOOLS' => 'Basic tools',
));
-
-?> \ No newline at end of file
diff --git a/phpBB/language/en/app.php b/phpBB/language/en/app.php
new file mode 100644
index 0000000000..39c4065ebd
--- /dev/null
+++ b/phpBB/language/en/app.php
@@ -0,0 +1,48 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+/**
+* DO NOT CHANGE
+*/
+if (!defined('IN_PHPBB'))
+{
+ exit;
+}
+
+if (empty($lang) || !is_array($lang))
+{
+ $lang = array();
+}
+
+// DEVELOPERS PLEASE NOTE
+//
+// All language files should use UTF-8 as their encoding and the files must not contain a BOM.
+//
+// Placeholders can now contain order information, e.g. instead of
+// 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows
+// translators to re-order the output of data while ensuring it remains correct
+//
+// You do not need this where single placeholders are used, e.g. 'Message %d' is fine
+// equally where a string contains only two placeholders which are used to wrap text
+// in a url you again do not need to specify an order e.g., 'Click %sHERE%s' is fine
+//
+// Some characters you may want to copy&paste:
+// ’ » “ ” …
+//
+
+$lang = array_merge($lang, array(
+ 'CONTROLLER_ARGUMENT_VALUE_MISSING' => 'Missing value for argument #%1$s: <strong>%3$s</strong> in class <strong>%2$s</strong>',
+ 'CONTROLLER_NOT_SPECIFIED' => 'No controller has been specified.',
+ 'CONTROLLER_METHOD_NOT_SPECIFIED' => 'No method was specified for the controller.',
+ 'CONTROLLER_SERVICE_UNDEFINED' => 'The service for controller “<strong>%s</strong>” is not defined in ./config/services.yml.',
+));
diff --git a/phpBB/language/en/captcha_qa.php b/phpBB/language/en/captcha_qa.php
index 42c8df2d6d..28011eb636 100644
--- a/phpBB/language/en/captcha_qa.php
+++ b/phpBB/language/en/captcha_qa.php
@@ -1,12 +1,13 @@
<?php
/**
*
-* captcha_qa [English]
+* This file is part of the phpBB Forum Software package.
*
-* @package language
-* @version $Id$
-* @copyright (c) 2009 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -39,6 +40,7 @@ $lang = array_merge($lang, array(
'CAPTCHA_QA' => 'Q&amp;A',
'CONFIRM_QUESTION_EXPLAIN' => 'This question is a means of preventing automated form submissions by spambots.',
'CONFIRM_QUESTION_WRONG' => 'You have provided an invalid answer to the question.',
+ 'CONFIRM_QUESTION_MISSING' => 'Questions for the captcha could not be retrieved. Please contact a board administrator.',
'QUESTION_ANSWERS' => 'Answers',
'ANSWERS_EXPLAIN' => 'Please enter valid answers to the question, one per line.',
@@ -59,7 +61,4 @@ $lang = array_merge($lang, array(
'QA_ERROR_MSG' => 'Please fill in all fields and enter at least one answer.',
'QA_LAST_QUESTION' => 'You cannot delete all questions while the plugin is active.',
-
));
-
-?> \ No newline at end of file
diff --git a/phpBB/language/en/captcha_recaptcha.php b/phpBB/language/en/captcha_recaptcha.php
index 9b2fb2049d..df2ad4e51b 100644
--- a/phpBB/language/en/captcha_recaptcha.php
+++ b/phpBB/language/en/captcha_recaptcha.php
@@ -1,12 +1,13 @@
<?php
/**
*
-* recaptcha [English]
+* This file is part of the phpBB Forum Software package.
*
-* @package language
-* @version $Id$
-* @copyright (c) 2009 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -46,7 +47,6 @@ $lang = array_merge($lang, array(
'RECAPTCHA_PRIVATE' => 'Private reCaptcha key',
'RECAPTCHA_PRIVATE_EXPLAIN' => 'Your private reCaptcha key. Keys can be obtained on <a href="http://www.google.com/recaptcha">www.google.com/recaptcha</a>.',
- 'RECAPTCHA_EXPLAIN' => 'In an effort to prevent automatic submissions, we require that you enter both of the words displayed into the text field underneath.',
+ 'RECAPTCHA_EXPLAIN' => 'In an effort to prevent automatic submissions, we require that you type the text displayed into the field underneath.',
+ 'RECAPTCHA_SOCKET_ERROR' => 'There was a problem connecting to the RECAPTCHA service: could not open socket. Try again later.',
));
-
-?> \ No newline at end of file
diff --git a/phpBB/language/en/cli.php b/phpBB/language/en/cli.php
new file mode 100644
index 0000000000..4e27be48cc
--- /dev/null
+++ b/phpBB/language/en/cli.php
@@ -0,0 +1,90 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+if (!defined('IN_PHPBB'))
+{
+ exit;
+}
+
+/**
+* DO NOT CHANGE
+*/
+if (empty($lang) || !is_array($lang))
+{
+ $lang = array();
+}
+
+// DEVELOPERS PLEASE NOTE
+//
+// Placeholders can now contain order information, e.g. instead of
+// 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows
+// translators to re-order the output of data while ensuring it remains correct
+//
+// You do not need this where single placeholders are used, e.g. 'Message %d' is fine
+// equally where a string contains only two placeholders which are used to wrap text
+// in a url you again do not need to specify an order e.g., 'Click %sHERE%s' is fine
+
+$lang = array_merge($lang, array(
+ 'CLI_CONFIG_CANNOT_CACHED' => 'Set this option if the configuration option changes too frequently to be efficiently cached.',
+ 'CLI_CONFIG_CURRENT' => 'Current configuration value, use 0 and 1 to specify boolean values',
+ 'CLI_CONFIG_DELETE_SUCCESS' => 'Successfully deleted config %s.',
+ 'CLI_CONFIG_NEW' => 'New configuration value, use 0 and 1 to specify boolean values',
+ 'CLI_CONFIG_NOT_EXISTS' => 'Config %s does not exist',
+ 'CLI_CONFIG_OPTION_NAME' => 'The configuration option’s name',
+ 'CLI_CONFIG_PRINT_WITHOUT_NEWLINE' => 'Set this option if the value should be printed without a new line at the end.',
+ 'CLI_CONFIG_INCREMENT_BY' => 'Amount to increment by',
+ 'CLI_CONFIG_INCREMENT_SUCCESS' => 'Successfully incremented config %s',
+ 'CLI_CONFIG_SET_FAILURE' => 'Could not set config %s',
+ 'CLI_CONFIG_SET_SUCCESS' => 'Successfully set config %s',
+
+ 'CLI_DESCRIPTION_CRON_LIST' => 'Prints a list of ready and unready cron jobs.',
+ 'CLI_DESCRIPTION_CRON_RUN' => 'Runs all ready cron tasks.',
+ 'CLI_DESCRIPTION_CRON_RUN_ARGUMENT_1' => 'Name of the task to be run',
+ 'CLI_DESCRIPTION_DB_MIGRATE' => 'Updates the database by applying migrations.',
+ 'CLI_DESCRIPTION_DELETE_CONFIG' => 'Deletes a configuration option',
+ 'CLI_DESCRIPTION_DISABLE_EXTENSION' => 'Disables the specified extension.',
+ 'CLI_DESCRIPTION_ENABLE_EXTENSION' => 'Enables the specified extension.',
+ 'CLI_DESCRIPTION_FIND_MIGRATIONS' => 'Finds migrations that are not depended upon.',
+ 'CLI_DESCRIPTION_FIX_LEFT_RIGHT_IDS' => 'Repairs the tree structure of the forums and modules.',
+ 'CLI_DESCRIPTION_GET_CONFIG' => 'Gets a configuration option’s value',
+ 'CLI_DESCRIPTION_INCREMENT_CONFIG' => 'Increments a configuration option’s integer value',
+ 'CLI_DESCRIPTION_LIST_EXTENSIONS' => 'Lists all extensions in the database and on the filesystem.',
+ 'CLI_DESCRIPTION_OPTION_SAFE_MODE' => 'Run in Safe Mode (without extensions).',
+ 'CLI_DESCRIPTION_OPTION_SHELL' => 'Launch the shell.',
+ 'CLI_DESCRIPTION_PURGE_EXTENSION' => 'Purges the specified extension.',
+ 'CLI_DESCRIPTION_RECALCULATE_EMAIL_HASH' => 'Recalculates the user_email_hash column of the users table.',
+ 'CLI_DESCRIPTION_SET_ATOMIC_CONFIG' => 'Sets a configuration option’s value only if the old matches the current value',
+ 'CLI_DESCRIPTION_SET_CONFIG' => 'Sets a configuration option’s value',
+ 'CLI_DESCRIPTION_UPDATE_HASH_BCRYPT' => 'Updates outdated password hashes to be hashed with bcrypt.',
+
+ 'CLI_EXTENSION_DISABLE_FAILURE' => 'Could not disable extension %s',
+ 'CLI_EXTENSION_DISABLE_SUCCESS' => 'Successfully disabled extension %s',
+ 'CLI_EXTENSION_ENABLE_FAILURE' => 'Could not enable extension %s',
+ 'CLI_EXTENSION_ENABLE_SUCCESS' => 'Successfully enabled extension %s',
+ 'CLI_EXTENSION_NAME' => 'Name of the extension',
+ 'CLI_EXTENSION_PURGE_FAILURE' => 'Could not purge extension %s',
+ 'CLI_EXTENSION_PURGE_SUCCESS' => 'Successfully purged extension %s',
+ 'CLI_EXTENSION_NOT_FOUND' => 'No extensions were found.',
+ 'CLI_EXTENSIONS_AVAILABLE' => 'Available',
+ 'CLI_EXTENSIONS_DISABLED' => 'Disabled',
+ 'CLI_EXTENSIONS_ENABLED' => 'Enabled',
+
+ 'CLI_FIXUP_FIX_LEFT_RIGHT_IDS_SUCCESS' => 'Successfully repaired the tree structure of the forums and modules.',
+ 'CLI_FIXUP_RECALCULATE_EMAIL_HASH_SUCCESS' => 'Successfully recalculated all email hashes.',
+ 'CLI_FIXUP_UPDATE_HASH_BCRYPT_SUCCESS' => 'Successfully updated outdated password hashes to bcrypt.'
+));
+
+// Additional help for commands.
+$lang = array_merge($lang, array(
+ 'CLI_HELP_CRON_RUN' => $lang['CLI_DESCRIPTION_CRON_RUN'] . ' Optionally you can specify a cron task name to run only the specified cron task.',
+));
diff --git a/phpBB/language/en/common.php b/phpBB/language/en/common.php
index 2d3710e15c..b4b328e90d 100644
--- a/phpBB/language/en/common.php
+++ b/phpBB/language/en/common.php
@@ -1,12 +1,13 @@
<?php
/**
*
-* common [English]
+* This file is part of the phpBB Forum Software package.
*
-* @package language
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -43,8 +44,14 @@ $lang = array_merge($lang, array(
'TRANSLATION_INFO' => '',
'DIRECTION' => 'ltr',
'DATE_FORMAT' => '|d M Y|', // 01 Jan 2007 (with Relative days enabled)
+ 'DATETIME_FORMAT' => '|d M Y, H:i|', // 01 Jan 2007, 13:37 (with Relative days enabled)
'USER_LANG' => 'en-gb',
+ // You can define different rules for the determination of plural forms here.
+ // See http://wiki.phpbb.com/Plural_Rules for more information
+ // or ask the translation manager for help.
+ 'PLURAL_RULE' => 1,
+
'1_DAY' => '1 day',
'1_MONTH' => '1 month',
'1_YEAR' => '1 year',
@@ -57,18 +64,24 @@ $lang = array_merge($lang, array(
'ACCOUNT_DEACTIVATED' => 'Your account has been manually deactivated and is only able to be reactivated by an administrator.',
'ACCOUNT_NOT_ACTIVATED' => 'Your account has not been activated yet.',
'ACP' => 'Administration Control Panel',
+ 'ACP_SHORT' => 'ACP',
'ACTIVE' => 'active',
'ACTIVE_ERROR' => 'The specified username is currently inactive. If you have problems activating your account, please contact a board administrator.',
'ADMINISTRATOR' => 'Administrator',
'ADMINISTRATORS' => 'Administrators',
'AGE' => 'Age',
'AIM' => 'AIM',
+ 'AJAX_ERROR_TITLE' => 'AJAX error',
+ 'AJAX_ERROR_TEXT' => 'Something went wrong when processing your request.',
+ 'AJAX_ERROR_TEXT_ABORT' => 'User aborted request.',
+ 'AJAX_ERROR_TEXT_TIMEOUT' => 'Your request timed out; please try again.',
+ 'AJAX_ERROR_TEXT_PARSERERROR' => 'Something went wrong with the request and the server returned an invalid reply.',
'ALLOWED' => 'Allowed',
'ALL_FILES' => 'All files',
'ALL_FORUMS' => 'All forums',
'ALL_MESSAGES' => 'All messages',
'ALL_POSTS' => 'All posts',
- 'ALL_TIMES' => 'All times are %1$s %2$s',
+ 'ALL_TIMES' => 'All times are <abbr title="%2$s">%1$s</abbr>',
'ALL_TOPICS' => 'All Topics',
'AND' => 'And',
'ARE_WATCHING_FORUM' => 'You have subscribed to be notified of new posts in this forum.',
@@ -78,6 +91,14 @@ $lang = array_merge($lang, array(
'ATTACHED_IMAGE_NOT_IMAGE' => 'The image file you tried to attach is invalid.',
'AUTHOR' => 'Author',
'AUTH_NO_PROFILE_CREATED' => 'The creation of a user profile was unsuccessful.',
+ 'AUTH_PROVIDER_OAUTH_ERROR_INVALID_ENTRY' => 'Invalid database entry.',
+ 'AUTH_PROVIDER_OAUTH_ERROR_INVALID_SERVICE_TYPE' => 'Invalid service type provided to OAuth service handler.',
+ 'AUTH_PROVIDER_OAUTH_ERROR_SERVICE_NOT_CREATED' => 'OAuth service not created',
+ 'AUTH_PROVIDER_OAUTH_SERVICE_BITLY' => 'Bitly',
+ 'AUTH_PROVIDER_OAUTH_SERVICE_FACEBOOK' => 'Facebook',
+ 'AUTH_PROVIDER_OAUTH_SERVICE_GOOGLE' => 'Google',
+ 'AUTH_PROVIDER_OAUTH_TOKEN_ERROR_NOT_STORED' => 'OAuth token not stored.',
+ 'AUTH_PROVIDER_OAUTH_TOKEN_ERROR_INCORRECTLY_STORED' => 'OAuth token incorrectly stored.',
'AVATAR_DISALLOWED_CONTENT' => 'The upload was rejected because the uploaded file was identified as a possible attack vector.',
'AVATAR_DISALLOWED_EXTENSION' => 'This file cannot be displayed because the extension <strong>%s</strong> is not allowed.',
'AVATAR_EMPTY_REMOTE_DATA' => 'The specified avatar could not be uploaded because the remote data appears to be invalid or corrupted.',
@@ -92,11 +113,11 @@ $lang = array_merge($lang, array(
'AVATAR_URL_INVALID' => 'The URL you specified is invalid.',
'AVATAR_URL_NOT_FOUND' => 'The file specified could not be found.',
'AVATAR_WRONG_FILESIZE' => 'The avatar’s filesize must be between 0 and %1$d %2$s.',
- 'AVATAR_WRONG_SIZE' => 'The submitted avatar is %5$d pixels wide and %6$d pixels high. Avatars must be at least %1$d pixels wide and %2$d pixels high, but no larger than %3$d pixels wide and %4$d pixels high.',
+ 'AVATAR_WRONG_SIZE' => 'The submitted avatar is %5$s wide and %6$s high. Avatars must be at least %1$s wide and %2$s high, but no larger than %3$s wide and %4$s high.',
'BACK_TO_TOP' => 'Top',
'BACK_TO_PREV' => 'Back to previous page',
- 'BAN_TRIGGERED_BY_EMAIL'=> 'A ban has been issued on your e-mail address.',
+ 'BAN_TRIGGERED_BY_EMAIL'=> 'A ban has been issued on your email address.',
'BAN_TRIGGERED_BY_IP' => 'A ban has been issued on your IP address.',
'BAN_TRIGGERED_BY_USER' => 'A ban has been issued on your username.',
'BBCODE_GUIDE' => 'BBCode guide',
@@ -109,28 +130,50 @@ $lang = array_merge($lang, array(
'BOARD_DISABLED' => 'This board is currently disabled.',
'BOARD_UNAVAILABLE' => 'Sorry but the board is temporarily unavailable, please try again in a few minutes.',
'BROWSING_FORUM' => 'Users browsing this forum: %1$s',
- 'BROWSING_FORUM_GUEST' => 'Users browsing this forum: %1$s and %2$d guest',
- 'BROWSING_FORUM_GUESTS' => 'Users browsing this forum: %1$s and %2$d guests',
+ 'BROWSING_FORUM_GUESTS' => array(
+ 1 => 'Users browsing this forum: %2$s and %1$d guest',
+ 2 => 'Users browsing this forum: %2$s and %1$d guests',
+ ),
+ 'BUTTON_EDIT' => 'Edit',
+ 'BUTTON_FORUM_LOCKED' => 'Locked',
+ 'BUTTON_NEW_TOPIC' => 'New Topic',
+ 'BUTTON_PM' => 'PM',
+ 'BUTTON_PM_FORWARD' => 'Forward',
+ 'BUTTON_PM_NEW' => 'New PM',
+ 'BUTTON_PM_REPLY' => 'Send Reply',
+ 'BUTTON_PM_REPLY_ALL' => 'Reply All',
+ 'BUTTON_POST_REPLY' => 'Post Reply',
+ 'BUTTON_QUOTE' => 'Quote',
+ 'BUTTON_TOPIC_LOCKED' => 'Locked',
'BYTES' => 'Bytes',
+ 'BYTES_SHORT' => 'B',
'CANCEL' => 'Cancel',
'CHANGE' => 'Change',
'CHANGE_FONT_SIZE' => 'Change font size',
'CHANGING_PREFERENCES' => 'Changing board preferences',
'CHANGING_PROFILE' => 'Changing profile settings',
- 'CLICK_VIEW_PRIVMSG' => '%sGo to your inbox%s',
+ 'CHARACTERS' => array(
+ 1 => '%d character',
+ 2 => '%d characters',
+ ),
'COLLAPSE_VIEW' => 'Collapse view',
'CLOSE_WINDOW' => 'Close window',
'COLOUR_SWATCH' => 'Colour swatch',
- 'COMMA_SEPARATOR' => ', ', // Used in pagination of ACP & prosilver, use localised comma if appropriate, eg: Ideographic or Arabic
+ 'COLON' => ':',
+ 'COMMA_SEPARATOR' => ', ', // Comma used to join lists into a single string, use localised comma if appropriate, eg: Ideographic or Arabic
'CONFIRM' => 'Confirm',
'CONFIRM_CODE' => 'Confirmation code',
'CONFIRM_CODE_EXPLAIN' => 'Enter the code exactly as it appears. All letters are case insensitive.',
'CONFIRM_CODE_WRONG' => 'The confirmation code you entered was incorrect.',
'CONFIRM_OPERATION' => 'Are you sure you wish to carry out this operation?',
+ 'CONFIRM_AVATAR_DELETE' => 'Are you sure you wish to delete this avatar?',
'CONGRATULATIONS' => 'Congratulations to',
'CONNECTION_FAILED' => 'Connection failed.',
'CONNECTION_SUCCESS' => 'Connection was successful!',
+ 'CONTACT' => 'Contact',
+ 'CONTACT_USER' => 'Contact %s',
+ 'CONTACT_US' => 'Contact us',
'COOKIES_DELETED' => 'All board cookies successfully deleted.',
'CURRENT_TIME' => 'It is currently %s',
@@ -151,18 +194,18 @@ $lang = array_merge($lang, array(
'DISPLAY_TOPICS' => 'Display topics from previous',
'DOWNLOADED' => 'Downloaded',
'DOWNLOADING_FILE' => 'Downloading file',
- 'DOWNLOAD_COUNT' => 'Downloaded %d time',
- 'DOWNLOAD_COUNTS' => 'Downloaded %d times',
- 'DOWNLOAD_COUNT_NONE' => 'Not downloaded yet',
- 'VIEWED_COUNT' => 'Viewed %d time',
- 'VIEWED_COUNTS' => 'Viewed %d times',
- 'VIEWED_COUNT_NONE' => 'Not viewed yet',
+ 'DOWNLOAD_COUNTS' => array(
+ 0 => 'Not downloaded yet',
+ 1 => 'Downloaded %d time',
+ 2 => 'Downloaded %d times',
+ ),
'EDIT_POST' => 'Edit post',
- 'EMAIL' => 'E-mail', // Short form for EMAIL_ADDRESS
- 'EMAIL_ADDRESS' => 'E-mail address',
- 'EMAIL_INVALID_EMAIL' => 'The e-mail address you entered is invalid.',
- 'EMAIL_SMTP_ERROR_RESPONSE' => 'Ran into problems sending e-mail at <strong>Line %1$s</strong>. Response: %2$s.',
+ 'ELLIPSIS' => '…',
+ 'EMAIL' => 'Email', // Short form for EMAIL_ADDRESS
+ 'EMAIL_ADDRESS' => 'Email address',
+ 'EMAIL_INVALID_EMAIL' => 'The email address you entered is invalid.',
+ 'EMAIL_SMTP_ERROR_RESPONSE' => 'Ran into problems sending email at <strong>Line %1$s</strong>. Response: %2$s.',
'EMPTY_SUBJECT' => 'You must specify a subject when posting a new topic.',
'EMPTY_MESSAGE_SUBJECT' => 'You must specify a subject when composing a new message.',
'ENABLED' => 'Enabled',
@@ -176,17 +219,23 @@ $lang = array_merge($lang, array(
'ERR_UNWATCHING' => 'An error occurred while trying to unsubscribe.',
'ERR_WATCHING' => 'An error occurred while trying to subscribe.',
'ERR_WRONG_PATH_TO_PHPBB' => 'The phpBB path specified appears to be invalid.',
+ 'ERROR' => 'Error',
'EXPAND_VIEW' => 'Expand view',
'EXTENSION' => 'Extension',
+ 'EXTENSION_DISABLED' => 'The extension <strong>%s</strong> is not enabled.',
'EXTENSION_DISABLED_AFTER_POSTING' => 'The extension <strong>%s</strong> has been deactivated and can no longer be displayed.',
+ 'EXTENSION_DOES_NOT_EXIST' => 'The extension <strong>%s</strong> does not exist.',
+ 'FACEBOOK' => 'Facebook',
'FAQ' => 'FAQ',
'FAQ_EXPLAIN' => 'Frequently Asked Questions',
'FILENAME' => 'Filename',
'FILESIZE' => 'File size',
'FILEDATE' => 'File date',
'FILE_COMMENT' => 'File comment',
- 'FILE_NOT_FOUND' => 'The requested file could not be found.',
+ 'FILE_CONTENT_ERR' => 'Could not read the contents of file: %s',
+ 'FILE_JSON_DECODE_ERR' => 'Failed to decode json file: %s',
+ 'FILE_NOT_FOUND' => 'The requested file could not be found: %s',
'FIND_USERNAME' => 'Find a member',
'FOLDER' => 'Folder',
'FORGOT_PASS' => 'I forgot my password',
@@ -235,6 +284,9 @@ $lang = array_merge($lang, array(
'GB' => 'GB',
'GIB' => 'GiB',
'GO' => 'Go',
+ 'GOOGLEPLUS' => 'Google+',
+ 'GOTO_FIRST_POST' => 'Go to first post',
+ 'GOTO_LAST_POST' => 'Go to last post',
'GOTO_PAGE' => 'Go to page',
'GROUP' => 'Group',
'GROUPS' => 'Groups',
@@ -242,12 +294,14 @@ $lang = array_merge($lang, array(
'GROUP_ERR_USERNAME' => 'No group name specified.',
'GROUP_ERR_USER_LONG' => 'Group names cannot exceed 60 characters. The specified group name is too long.',
'GUEST' => 'Guest',
- 'GUEST_USERS_ONLINE' => 'There are %d guest users online',
- 'GUEST_USERS_TOTAL' => '%d guests',
- 'GUEST_USERS_ZERO_ONLINE' => 'There are 0 guest users online',
- 'GUEST_USERS_ZERO_TOTAL' => '0 guests',
- 'GUEST_USER_ONLINE' => 'There is %d guest user online',
- 'GUEST_USER_TOTAL' => '%d guest',
+ 'GUEST_USERS_ONLINE' => array(
+ 1 => 'There is %d guest user online',
+ 2 => 'There are %d guest users online',
+ ),
+ 'GUEST_USERS_TOTAL' => array(
+ 1 => '%d guest',
+ 2 => '%d guests',
+ ),
'G_ADMINISTRATORS' => 'Administrators',
'G_BOTS' => 'Bots',
'G_GUESTS' => 'Guests',
@@ -256,32 +310,34 @@ $lang = array_merge($lang, array(
'G_GLOBAL_MODERATORS' => 'Global moderators',
'G_NEWLY_REGISTERED' => 'Newly registered users',
- 'HIDDEN_USERS_ONLINE' => '%d hidden users online',
- 'HIDDEN_USERS_TOTAL' => '%d hidden',
- 'HIDDEN_USERS_TOTAL_AND' => '%d hidden and ',
- 'HIDDEN_USERS_ZERO_ONLINE' => '0 hidden users online',
- 'HIDDEN_USERS_ZERO_TOTAL' => '0 hidden',
- 'HIDDEN_USERS_ZERO_TOTAL_AND' => '0 hidden and ',
- 'HIDDEN_USER_ONLINE' => '%d hidden user online',
- 'HIDDEN_USER_TOTAL' => '%d hidden',
- 'HIDDEN_USER_TOTAL_AND' => '%d hidden and ',
+ 'HIDDEN_USERS_ONLINE' => array(
+ 1 => '%d hidden user',
+ 2 => '%d hidden users',
+ ),
+ 'HIDDEN_USERS_TOTAL' => array(
+ 1 => '%d hidden',
+ 2 => '%d hidden',
+ ),
'HIDE_GUESTS' => 'Hide guests',
'HIDE_ME' => 'Hide my online status this session',
'HOURS' => 'Hours',
'HOME' => 'Home',
'ICQ' => 'ICQ',
- 'ICQ_STATUS' => 'ICQ status',
'IF' => 'If',
'IMAGE' => 'Image',
'IMAGE_FILETYPE_INVALID' => 'Image file type %d for mimetype %s not supported.',
'IMAGE_FILETYPE_MISMATCH' => 'Image file type mismatch: expected extension %1$s but extension %2$s given.',
'IN' => 'in',
+ 'INACTIVE' => 'Inactive',
'INDEX' => 'Index page',
'INFORMATION' => 'Information',
+ 'INSECURE_REDIRECT' => 'Tried to redirect to potentially insecure url.',
'INTERESTS' => 'Interests',
'INVALID_DIGEST_CHALLENGE' => 'Invalid digest challenge.',
- 'INVALID_EMAIL_LOG' => '<strong>%s</strong> possibly an invalid e-mail address?',
+ 'INVALID_EMAIL_LOG' => '<strong>%s</strong> possibly an invalid email address?',
+ 'INVALID_FEED_ATTACHMENTS' => 'The selected feed tried fetching attachments with invalid constraints.',
+ 'INVALID_PLURAL_RULE' => 'The chosen plural rule is invalid. Valid values are integers between 0 and 15.',
'IP' => 'IP',
'IP_BLACKLISTED' => 'Your IP %1$s has been blocked because it is blacklisted. For details please see <a href="%2$s">%2$s</a>.',
@@ -289,7 +345,8 @@ $lang = array_merge($lang, array(
'JOINED' => 'Joined',
'JUMP_PAGE' => 'Enter the page number you wish to go to',
'JUMP_TO' => 'Jump to',
- 'JUMP_TO_PAGE' => 'Click to jump to page…',
+ 'JUMP_TO_PAGE' => 'Jump to page',
+ 'JUMP_TO_PAGE_CLICK' => 'Click to jump to page…',
'KB' => 'KB',
'KIB' => 'KiB',
@@ -301,6 +358,8 @@ $lang = array_merge($lang, array(
'LDAP_NO_SERVER_CONNECTION' => 'Could not connect to LDAP server.',
'LDAP_SEARCH_FAILED' => 'An error occurred while searching the LDAP directory.',
'LEGEND' => 'Legend',
+ 'LIVE_SEARCHES_NOT_ALLOWED' => 'Live searches are not allowed.',
+ 'LOADING' => 'Loading',
'LOCATION' => 'Location',
'LOCK_POST' => 'Lock post',
'LOCK_POST_EXPLAIN' => 'Prevent editing',
@@ -311,6 +370,7 @@ $lang = array_merge($lang, array(
'LOGIN_CONFIRM_EXPLAIN' => 'To prevent brute forcing accounts the board requires you to enter a confirmation code after a maximum amount of failed logins. The code is displayed in the image you should see below. If you are visually impaired or cannot otherwise read this code please contact the %sBoard Administrator%s.', // unused
'LOGIN_ERROR_ATTEMPTS' => 'You exceeded the maximum allowed number of login attempts. In addition to your username and password you now also have to solve the CAPTCHA below.',
'LOGIN_ERROR_EXTERNAL_AUTH_APACHE' => 'You have not been authenticated by Apache.',
+ 'LOGIN_ERROR_OAUTH_SERVICE_DOES_NOT_EXIST' => 'A non-existant OAuth service has been requested.',
'LOGIN_ERROR_PASSWORD' => 'You have specified an incorrect password. Please check your password and try again. If you continue to have problems please contact the %sBoard Administrator%s.',
'LOGIN_ERROR_PASSWORD_CONVERT' => 'It was not possible to convert your password when updating this bulletin board’s software. Please %srequest a new password%s. If you continue to have problems please contact the %sBoard Administrator%s.',
'LOGIN_ERROR_USERNAME' => 'You have specified an incorrect username. Please check your username and try again. If you continue to have problems please contact the %sBoard Administrator%s.',
@@ -319,17 +379,22 @@ $lang = array_merge($lang, array(
'LOGIN_VIEWFORUM' => 'The board requires you to be registered and logged in to view this forum.',
'LOGIN_EXPLAIN_EDIT' => 'In order to edit posts in this forum you have to be registered and logged in.',
'LOGIN_EXPLAIN_VIEWONLINE' => 'In order to view the online list you have to be registered and logged in.',
+ 'LOGIN_REQUIRED' => 'You need to login to perform this action.',
'LOGOUT' => 'Logout',
'LOGOUT_USER' => 'Logout [ %s ]',
- 'LOG_ME_IN' => 'Log me on automatically each visit',
+ 'LOG_ME_IN' => 'Remember me',
+ 'MAIN' => 'Main',
'MARK' => 'Mark',
'MARK_ALL' => 'Mark all',
+ 'MARK_ALL_READ' => 'Mark all read',
'MARK_FORUMS_READ' => 'Mark forums read',
+ 'MARK_READ' => 'Mark read',
'MARK_SUBFORUMS_READ' => 'Mark subforums read',
'MB' => 'MB',
'MIB' => 'MiB',
'MCP' => 'Moderator Control Panel',
+ 'MCP_SHORT' => 'MCP',
'MEMBERLIST' => 'Members',
'MEMBERLIST_EXPLAIN' => 'View complete list of members',
'MERGE' => 'Merge',
@@ -337,6 +402,10 @@ $lang = array_merge($lang, array(
'MERGE_TOPIC' => 'Merge topic',
'MESSAGE' => 'Message',
'MESSAGES' => 'Messages',
+ 'MESSAGES_COUNT' => array(
+ 1 => '%d message',
+ 2 => '%d messages',
+ ),
'MESSAGE_BODY' => 'Message body',
'MINUTES' => 'Minutes',
'MODERATE' => 'Moderate',
@@ -347,24 +416,65 @@ $lang = array_merge($lang, array(
'MODULE_FILE_INCORRECT_CLASS' => 'Module file %s does not contain correct class [%s]',
'MONTH' => 'Month',
'MOVE' => 'Move',
- 'MSNM' => 'MSNM/WLM',
'NA' => 'N/A',
'NEWEST_USER' => 'Our newest member <strong>%s</strong>',
'NEW_MESSAGE' => 'New message',
'NEW_MESSAGES' => 'New messages',
- 'NEW_PM' => '<strong>%d</strong> new message',
- 'NEW_PMS' => '<strong>%d</strong> new messages',
'NEW_POST' => 'New post', // Not used anymore
'NEW_POSTS' => 'New posts', // Not used anymore
'NEXT' => 'Next', // Used in pagination
'NEXT_STEP' => 'Next',
'NEVER' => 'Never',
'NO' => 'No',
+ 'NO_NOTIFICATIONS' => 'You have no notifications',
'NOT_ALLOWED_MANAGE_GROUP' => 'You are not allowed to manage this group.',
'NOT_AUTHORISED' => 'You are not authorised to access this area.',
'NOT_WATCHING_FORUM' => 'You are no longer subscribed to updates on this forum.',
'NOT_WATCHING_TOPIC' => 'You are no longer subscribed to this topic.',
+ 'NOTIFICATIONS' => 'Notifications',
+ // This applies for NOTIFICATION_BOOKMARK and NOTIFICATION_POST.
+ // %1$s will return a list of users that's concatenated using "," and "and" - see STRING_LIST
+ // Once the user count reaches 5 users or more, the list is trimmed using NOTIFICATION_X_OTHERS
+ // Once the user count reaches 20 users or more, the list is trimmed using NOTIFICATION_MANY_OTHERS
+ // Examples:
+ // A replied...
+ // A and B replied...
+ // A, B and C replied...
+ // A, B, C and 2 others replied...
+ // A, B, C and others replied...
+ 'NOTIFICATION_BOOKMARK' => array(
+ 1 => '<strong>Reply</strong> from %1$s in bookmarked topic:',
+ ),
+ 'NOTIFICATION_FORUM' => '<em>Forum:</em> %1$s',
+ 'NOTIFICATION_GROUP_REQUEST' => '<strong>Group request</strong> from %1$s to join the group %2$s.',
+ 'NOTIFICATION_GROUP_REQUEST_APPROVED' => '<strong>Group request approved</strong> to join the group %1$s.',
+ 'NOTIFICATION_PM' => '<strong>Private Message</strong> from %1$s:',
+ 'NOTIFICATION_POST' => array(
+ 1 => '<strong>Reply</strong> from %1$s in topic:',
+ ),
+ 'NOTIFICATION_POST_APPROVED' => '<strong>Post approved</strong>:',
+ 'NOTIFICATION_POST_DISAPPROVED' => '<strong>Post disapproved</strong>:',
+ 'NOTIFICATION_POST_IN_QUEUE' => '<strong>Post approval</strong> request by %1$s:',
+ 'NOTIFICATION_QUOTE' => array(
+ 1 => '<strong>Quoted</strong> by %1$s in:',
+ ),
+ 'NOTIFICATION_REFERENCE' => '"%1$s"',
+ 'NOTIFICATION_REASON' => '<em>Reason:</em> %1$s.',
+ 'NOTIFICATION_REPORT_PM' => '<strong>Private Message reported</strong> by %1$s:',
+ 'NOTIFICATION_REPORT_POST' => '<strong>Post reported</strong> by %1$s:',
+ 'NOTIFICATION_REPORT_CLOSED' => '<strong>Report closed</strong> by %1$s for:',
+ 'NOTIFICATION_TOPIC' => '<strong>New topic</strong> by %1$s:',
+ 'NOTIFICATION_TOPIC_APPROVED' => '<strong>Topic approved</strong>:',
+ 'NOTIFICATION_TOPIC_DISAPPROVED' => '<strong>Topic disapproved</strong>:',
+ 'NOTIFICATION_TOPIC_IN_QUEUE' => '<strong>Topic approval</strong> request by %1$s:',
+ 'NOTIFICATION_TYPE_NOT_EXIST' => 'The notification type "%s" is missing from the file system.',
+ 'NOTIFICATION_ADMIN_ACTIVATE_USER' => '<strong>Activation required</strong> for deactivated or newly registered user: “%1$s”',
+ // Used in conjuction with NOTIFICATION_BOOKMARK and NOTIFICATION_POST.
+ 'NOTIFICATION_MANY_OTHERS' => 'others',
+ 'NOTIFICATION_X_OTHERS' => array(
+ 2 => '%d others',
+ ),
'NOTIFY_ADMIN' => 'Please notify the board administrator or webmaster.',
'NOTIFY_ADMIN_EMAIL' => 'Please notify the board administrator or webmaster: <a href="mailto:%1$s">%1$s</a>',
'NO_ACCESS_ATTACHMENT' => 'You are not allowed to access this file.',
@@ -373,11 +483,12 @@ $lang = array_merge($lang, array(
'NO_AUTH_ADMIN' => 'Access to the Administration Control Panel is not allowed as you do not have administrative permissions.',
'NO_AUTH_ADMIN_USER_DIFFER' => 'You are not able to re-authenticate as a different user.',
'NO_AUTH_OPERATION' => 'You do not have the necessary permissions to complete this operation.',
+ 'NO_AVATARS' => 'No avatars currently available',
'NO_CONNECT_TO_SMTP_HOST' => 'Could not connect to smtp host : %1$s : %2$s',
'NO_BIRTHDAYS' => 'No birthdays today',
- 'NO_EMAIL_MESSAGE' => 'E-mail message was blank.',
+ 'NO_EMAIL_MESSAGE' => 'Email message was blank.',
'NO_EMAIL_RESPONSE_CODE' => 'Could not get mail server response codes.',
- 'NO_EMAIL_SUBJECT' => 'No e-mail subject specified.',
+ 'NO_EMAIL_SUBJECT' => 'No email subject specified.',
'NO_FORUM' => 'The forum you selected does not exist.',
'NO_FORUMS' => 'This board has no forums.',
'NO_GROUP' => 'The requested usergroup does not exist.',
@@ -388,7 +499,6 @@ $lang = array_merge($lang, array(
'NO_MODE' => 'No mode specified.',
'NO_MODERATORS' => 'There are no moderators.',
'NO_NEW_MESSAGES' => 'No new messages',
- 'NO_NEW_PM' => '<strong>0</strong> new messages',
'NO_NEW_POSTS' => 'No new posts', // Not used anymore
'NO_ONLINE_USERS' => 'No registered users',
'NO_POSTS' => 'No posts',
@@ -403,7 +513,6 @@ $lang = array_merge($lang, array(
'NO_TOPIC_FORUM' => 'The topic or forum no longer exists.',
'NO_TOPICS' => 'There are no topics or posts in this forum.',
'NO_TOPICS_TIME_FRAME' => 'No topics exist inside this forum for the selected time frame.',
- 'NO_UNREAD_PM' => '<strong>0</strong> unread messages',
'NO_UNREAD_POSTS' => 'No unread posts',
'NO_UPLOAD_FORM_FOUND' => 'Upload initiated but no valid file upload form found.',
'NO_USER' => 'The requested user does not exist.',
@@ -411,6 +520,10 @@ $lang = array_merge($lang, array(
'NO_USER_SPECIFIED' => 'No username was specified.',
// Nullar/Singular/Plural language entry. The key numbers define the number range in which a certain grammatical expression is valid.
+ 'NUM_ATTACHMENTS' => array(
+ 1 => '%d attachment',
+ 2 => '%d attachments',
+ ),
'NUM_POSTS_IN_QUEUE' => array(
0 => 'No posts in queue', // 0
1 => '1 post in queue', // 1
@@ -421,15 +534,28 @@ $lang = array_merge($lang, array(
'OFFLINE' => 'Offline',
'ONLINE' => 'Online',
'ONLINE_BUDDIES' => 'Online friends',
- 'ONLINE_USERS_TOTAL' => 'In total there are <strong>%d</strong> users online :: ',
- 'ONLINE_USERS_ZERO_TOTAL' => 'In total there are <strong>0</strong> users online :: ',
- 'ONLINE_USER_TOTAL' => 'In total there is <strong>%d</strong> user online :: ',
+ // "... :: x registered and y hidden"
+ 'ONLINE_USERS_TOTAL' => array(
+ 1 => 'In total there is <strong>%1$d</strong> user online :: %2$s and %3$s',
+ 2 => 'In total there are <strong>%1$d</strong> users online :: %2$s and %3$s',
+ ),
+ // "... :: x registered, y hidden and z guests"
+ 'ONLINE_USERS_TOTAL_GUESTS' => array(
+ 1 => 'In total there is <strong>%1$d</strong> user online :: %2$s, %3$s and %4$s',
+ 2 => 'In total there are <strong>%1$d</strong> users online :: %2$s, %3$s and %4$s',
+ ),
'OPTIONS' => 'Options',
'PAGE_OF' => 'Page <strong>%1$d</strong> of <strong>%2$d</strong>',
+ 'PAGE_TITLE_NUMBER' => 'Page %s',
'PASSWORD' => 'Password',
'PIXEL' => 'px',
+ 'PIXELS' => array(
+ 1 => '%d pixel',
+ 2 => '%d pixels',
+ ),
'PLAY_QUICKTIME_FILE' => 'Play Quicktime file',
+ 'PLEASE_WAIT' => 'Please wait.',
'PM' => 'PM',
'PM_REPORTED' => 'Click to view report',
'POSTING_MESSAGE' => 'Posting message in %s',
@@ -442,9 +568,15 @@ $lang = array_merge($lang, array(
'POSTED_ON_DATE' => 'on',
'POSTS' => 'Posts',
'POSTS_UNAPPROVED' => 'At least one post in this topic has not been approved.',
+ 'POSTS_UNAPPROVED_FORUM'=> 'At least one post in this forum has not been approved.',
'POST_BY_AUTHOR' => 'by',
- 'POST_BY_FOE' => 'This post was made by <strong>%1$s</strong> who is currently on your ignore list. %2$sDisplay this post%3$s.',
+ 'POST_BY_FOE' => '<strong>%1$s</strong>, who is currently on your ignore list, made this post.',
+ 'POST_DISPLAY' => '%1$sDisplay this post%2$s.',
'POST_DAY' => '%.2f posts per day',
+ 'POST_DELETED_ACTION' => 'Deleted post:',
+ 'POST_DELETED' => 'This post has been deleted.',
+ 'POST_DELETED_BY' => '<strong>%2$s</strong> deleted the post by <strong>%1$s</strong> on %3$s.',
+ 'POST_DELETED_BY_REASON'=> '<strong>%2$s</strong> deleted the post by <strong>%1$s</strong> on %3$s for the following reason: %4$s',
'POST_DETAILS' => 'Post details',
'POST_NEW_TOPIC' => 'Post new topic',
'POST_PCT' => '%.2f%% of all posts',
@@ -455,7 +587,8 @@ $lang = array_merge($lang, array(
'POST_SUBJECT' => 'Post subject',
'POST_TIME' => 'Post time',
'POST_TOPIC' => 'Post a new topic',
- 'POST_UNAPPROVED' => 'This post is waiting for approval',
+ 'POST_UNAPPROVED_ACTION' => 'Post awaiting approval:',
+ 'POST_UNAPPROVED' => 'This post has not been approved.',
'POWERED_BY' => 'Powered by %s',
'PREVIEW' => 'Preview',
'PREVIOUS' => 'Previous', // Used in pagination
@@ -466,6 +599,8 @@ $lang = array_merge($lang, array(
'PRIVATE_MESSAGING' => 'Private messaging',
'PROFILE' => 'User Control Panel',
+ 'QUICK_LINKS' => 'Quick links',
+
'RANK' => 'Rank',
'READING_FORUM' => 'Viewing topics in %s',
'READING_GLOBAL_ANNOUNCE' => 'Reading global announcement',
@@ -478,15 +613,15 @@ $lang = array_merge($lang, array(
'REDIRECTS' => 'Total redirects',
'REGISTER' => 'Register',
'REGISTERED_USERS' => 'Registered users:',
- 'REG_USERS_ONLINE' => 'There are %d registered users and ',
- 'REG_USERS_TOTAL' => '%d registered, ',
- 'REG_USERS_TOTAL_AND' => '%d registered and ',
- 'REG_USERS_ZERO_ONLINE' => 'There are 0 registered users and ',
- 'REG_USERS_ZERO_TOTAL' => '0 registered, ',
- 'REG_USERS_ZERO_TOTAL_AND' => '0 registered and ',
- 'REG_USER_ONLINE' => 'There is %d registered user and ',
- 'REG_USER_TOTAL' => '%d registered, ',
- 'REG_USER_TOTAL_AND' => '%d registered and ',
+ // "... and 2 hidden users online"
+ 'REG_USERS_ONLINE' => array(
+ 1 => 'There is %1$d registered user and %2$s online',
+ 2 => 'There are %1$d registered users and %2$s online',
+ ),
+ 'REG_USERS_TOTAL' => array(
+ 1 => '%d registered',
+ 2 => '%d registered',
+ ),
'REMOVE' => 'Remove',
'REMOVE_INSTALL' => 'Please delete, move or rename the install directory before you use your board. If this directory is still present, only the Administration Control Panel (ACP) will be accessible.',
'REPLIES' => 'Replies',
@@ -496,14 +631,15 @@ $lang = array_merge($lang, array(
'REPORT_BY' => 'Report by',
'REPORT_POST' => 'Report this post',
'REPORTING_POST' => 'Reporting post',
- 'RESEND_ACTIVATION' => 'Resend activation e-mail',
+ 'RESEND_ACTIVATION' => 'Resend activation email',
'RESET' => 'Reset',
'RESTORE_PERMISSIONS' => 'Restore permissions',
'RETURN_INDEX' => '%sReturn to the index page%s',
'RETURN_FORUM' => '%sReturn to the forum last visited%s',
'RETURN_PAGE' => '%sReturn to the previous page%s',
'RETURN_TOPIC' => '%sReturn to the topic last visited%s',
- 'RETURN_TO' => 'Return to',
+ 'RETURN_TO' => 'Return to “%s”',
+ 'RETURN_TO_INDEX' => 'Return to Board Index',
'FEED' => 'Feed',
'FEED_NEWS' => 'News',
'FEED_TOPICS_ACTIVE' => 'Active Topics',
@@ -531,27 +667,29 @@ $lang = array_merge($lang, array(
'SEARCH_ADV_EXPLAIN' => 'View the advanced search options',
'SEARCH_KEYWORDS' => 'Search for keywords',
'SEARCHING_FORUMS' => 'Searching forums',
- 'SEARCH_ACTIVE_TOPICS' => 'View active topics',
+ 'SEARCH_ACTIVE_TOPICS' => 'Active topics',
'SEARCH_FOR' => 'Search for',
'SEARCH_FORUM' => 'Search this forum…',
- 'SEARCH_NEW' => 'View new posts',
+ 'SEARCH_NEW' => 'New posts',
'SEARCH_POSTS_BY' => 'Search posts by',
- 'SEARCH_SELF' => 'View your posts',
+ 'SEARCH_SELF' => 'Your posts',
'SEARCH_TOPIC' => 'Search this topic…',
- 'SEARCH_UNANSWERED' => 'View unanswered posts',
- 'SEARCH_UNREAD' => 'View unread posts',
+ 'SEARCH_UNANSWERED' => 'Unanswered topics',
+ 'SEARCH_UNREAD' => 'Unread posts',
'SEARCH_USER_POSTS' => 'Search user’s posts',
'SECONDS' => 'Seconds',
+ 'SEE_ALL' => 'See All',
'SELECT' => 'Select',
'SELECT_ALL_CODE' => 'Select all',
'SELECT_DESTINATION_FORUM' => 'Please select a destination forum',
'SELECT_FORUM' => 'Select a forum',
- 'SEND_EMAIL' => 'E-mail', // Used for submit buttons
- 'SEND_EMAIL_USER' => 'E-mail', // Used as: {L_SEND_EMAIL_USER} {USERNAME} -> E-mail UserX
+ 'SEND_EMAIL' => 'Send email', // Used for submit buttons
+ 'SEND_EMAIL_USER' => 'Send email to %s',
'SEND_PRIVATE_MESSAGE' => 'Send private message',
'SETTINGS' => 'Settings',
'SIGNATURE' => 'Signature',
'SKIP' => 'Skip to content',
+ 'SKYPE' => 'Skype',
'SMTP_NO_AUTH_SUPPORT' => 'SMTP server does not support authentication.',
'SORRY_AUTH_READ' => 'You are not authorised to read this forum.',
'SORRY_AUTH_VIEW_ATTACH' => 'You are not authorised to download this attachment.',
@@ -569,6 +707,8 @@ $lang = array_merge($lang, array(
'START_WATCHING_TOPIC' => 'Subscribe topic',
'STOP_WATCHING_FORUM' => 'Unsubscribe forum',
'STOP_WATCHING_TOPIC' => 'Unsubscribe topic',
+ 'STRING_LIST_MULTI' => '%1$s, and %2$s',
+ 'STRING_LIST_SIMPLE' => '%1$s and %2$s',
'SUBFORUM' => 'Subforum',
'SUBFORUMS' => 'Subforums',
'SUBJECT' => 'Subject',
@@ -580,52 +720,35 @@ $lang = array_merge($lang, array(
'THE_TEAM' => 'The team',
'TIB' => 'TiB',
'TIME' => 'Time',
-
+ 'TIMEOUT_PROCESSING_REQ' => 'Request timed out.',
+
'TOO_LARGE' => 'The value you entered is too large.',
'TOO_LARGE_MAX_RECIPIENTS' => 'The value of <strong>Maximum number of allowed recipients per private message</strong> setting you entered is too large.',
'TOO_LONG' => 'The value you entered is too long.',
- 'TOO_LONG_AIM' => 'The screenname you entered is too long.',
'TOO_LONG_CONFIRM_CODE' => 'The confirm code you entered is too long.',
'TOO_LONG_DATEFORMAT' => 'The date format you entered is too long.',
- 'TOO_LONG_ICQ' => 'The ICQ number you entered is too long.',
- 'TOO_LONG_INTERESTS' => 'The interests you entered is too long.',
'TOO_LONG_JABBER' => 'The Jabber account name you entered is too long.',
- 'TOO_LONG_LOCATION' => 'The location you entered is too long.',
- 'TOO_LONG_MSN' => 'The MSNM/WLM name you entered is too long.',
'TOO_LONG_NEW_PASSWORD' => 'The password you entered is too long.',
- 'TOO_LONG_OCCUPATION' => 'The occupation you entered is too long.',
'TOO_LONG_PASSWORD_CONFIRM' => 'The password confirmation you entered is too long.',
'TOO_LONG_USER_PASSWORD' => 'The password you entered is too long.',
'TOO_LONG_USERNAME' => 'The username you entered is too long.',
- 'TOO_LONG_EMAIL' => 'The e-mail address you entered is too long.',
- 'TOO_LONG_EMAIL_CONFIRM' => 'The e-mail address confirmation you entered is too long.',
- 'TOO_LONG_WEBSITE' => 'The website address you entered is too long.',
- 'TOO_LONG_YIM' => 'The Yahoo! Messenger name you entered is too long.',
+ 'TOO_LONG_EMAIL' => 'The email address you entered is too long.',
'TOO_MANY_VOTE_OPTIONS' => 'You have tried to vote for too many options.',
'TOO_SHORT' => 'The value you entered is too short.',
- 'TOO_SHORT_AIM' => 'The screenname you entered is too short.',
'TOO_SHORT_CONFIRM_CODE' => 'The confirm code you entered is too short.',
'TOO_SHORT_DATEFORMAT' => 'The date format you entered is too short.',
- 'TOO_SHORT_ICQ' => 'The ICQ number you entered is too short.',
- 'TOO_SHORT_INTERESTS' => 'The interests you entered is too short.',
'TOO_SHORT_JABBER' => 'The Jabber account name you entered is too short.',
- 'TOO_SHORT_LOCATION' => 'The location you entered is too short.',
- 'TOO_SHORT_MSN' => 'The MSNM/WLM name you entered is too short.',
'TOO_SHORT_NEW_PASSWORD' => 'The password you entered is too short.',
- 'TOO_SHORT_OCCUPATION' => 'The occupation you entered is too short.',
'TOO_SHORT_PASSWORD_CONFIRM' => 'The password confirmation you entered is too short.',
'TOO_SHORT_USER_PASSWORD' => 'The password you entered is too short.',
'TOO_SHORT_USERNAME' => 'The username you entered is too short.',
- 'TOO_SHORT_EMAIL' => 'The e-mail address you entered is too short.',
- 'TOO_SHORT_EMAIL_CONFIRM' => 'The e-mail address confirmation you entered is too short.',
- 'TOO_SHORT_WEBSITE' => 'The website address you entered is too short.',
- 'TOO_SHORT_YIM' => 'The Yahoo! Messenger name you entered is too short.',
-
+ 'TOO_SHORT_EMAIL' => 'The email address you entered is too short.',
+ 'TOO_SHORT_EMAIL_CONFIRM' => 'The email address confirmation you entered is too short.',
'TOO_SMALL' => 'The value you entered is too small.',
'TOO_SMALL_MAX_RECIPIENTS' => 'The value of <strong>Maximum number of allowed recipients per private message</strong> setting you entered is too small.',
@@ -638,30 +761,37 @@ $lang = array_merge($lang, array(
'TOPIC_MOVED' => 'Moved topic',
'TOPIC_REVIEW' => 'Topic review',
'TOPIC_TITLE' => 'Topic title',
- 'TOPIC_UNAPPROVED' => 'This topic has not been approved',
+ 'TOPIC_UNAPPROVED' => 'This topic has not been approved.',
+ 'TOPIC_DELETED' => 'This topic has been deleted.',
'TOTAL_ATTACHMENTS' => 'Attachment(s)',
- 'TOTAL_LOG' => '1 log',
- 'TOTAL_LOGS' => '%d logs',
- 'TOTAL_NO_PM' => '0 private messages in total',
- 'TOTAL_PM' => '1 private message in total',
- 'TOTAL_PMS' => '%d private messages in total',
+ 'TOTAL_LOGS' => array(
+ 1 => '%d log',
+ 2 => '%d logs',
+ ),
+ 'TOTAL_PMS' => array(
+ 1 => '%d private message in total',
+ 2 => '%d private messages in total',
+ ),
+ 'TOPIC_POLL' => 'This topic has a poll.',
'TOTAL_POSTS' => 'Total posts',
- 'TOTAL_POSTS_OTHER' => 'Total posts <strong>%d</strong>',
- 'TOTAL_POSTS_ZERO' => 'Total posts <strong>0</strong>',
+ 'TOTAL_POSTS_COUNT' => array(
+ 2 => 'Total posts <strong>%d</strong>',
+ ),
'TOPIC_REPORTED' => 'This topic has been reported',
- 'TOTAL_TOPICS_OTHER'=> 'Total topics <strong>%d</strong>',
- 'TOTAL_TOPICS_ZERO' => 'Total topics <strong>0</strong>',
- 'TOTAL_USERS_OTHER' => 'Total members <strong>%d</strong>',
- 'TOTAL_USERS_ZERO' => 'Total members <strong>0</strong>',
+ 'TOTAL_TOPICS' => array(
+ 2 => 'Total topics <strong>%d</strong>',
+ ),
+ 'TOTAL_USERS' => array(
+ 2 => 'Total members <strong>%d</strong>',
+ ),
'TRACKED_PHP_ERROR' => 'Tracked PHP errors: %s',
+ 'TWITTER' => 'Twitter',
'UNABLE_GET_IMAGE_SIZE' => 'It was not possible to determine the dimensions of the image. Please verify that the URL you entered is correct.',
'UNABLE_TO_DELIVER_FILE'=> 'Unable to deliver file.',
'UNKNOWN_BROWSER' => 'Unknown browser',
'UNMARK_ALL' => 'Unmark all',
'UNREAD_MESSAGES' => 'Unread messages',
- 'UNREAD_PM' => '<strong>%d</strong> unread message',
- 'UNREAD_PMS' => '<strong>%d</strong> unread messages',
'UNREAD_POST' => 'Unread post',
'UNREAD_POSTS' => 'Unread posts',
'UNWATCH_FORUM_CONFIRM' => 'Are you sure you wish to unsubscribe from this forum?',
@@ -679,15 +809,23 @@ $lang = array_merge($lang, array(
'USERNAMES' => 'Usernames',
'USER_AVATAR' => 'User avatar',
'USER_CANNOT_READ' => 'You cannot read posts in this forum.',
- 'USER_POST' => '%d Post',
- 'USER_POSTS' => '%d Posts',
+ 'USER_POSTS' => array(
+ 1 => '%d Post',
+ 2 => '%d Posts',
+ ),
'USERS' => 'Users',
'USE_PERMISSIONS' => 'Test out user’s permissions',
- 'USER_NEW_PERMISSION_DISALLOWED' => 'We are sorry, but you are not authorised to use this feature. You may have just registered here and may need to participate more to be able to use this feature.',
+ 'USER_NEW_PERMISSION_DISALLOWED' => 'We are sorry, but you are not authorised to use this feature. You may have just registered here and may need to participate more in discussions to be able to use this feature.',
'VARIANT_DATE_SEPARATOR' => ' / ', // Used in date format dropdown, eg: "Today, 13:37 / 01 Jan 2007, 13:37" ... to join a relative date with calendar date
'VIEWED' => 'Viewed',
+ 'VIEWED_COUNTS' => array(
+ 0 => 'Not viewed yet',
+ 1 => 'Viewed %d time',
+ 2 => 'Viewed %d times',
+ ),
+ 'VIEWING_CONTACT_ADMIN' => 'Viewing contact page',
'VIEWING_FAQ' => 'Viewing FAQ',
'VIEWING_MEMBERS' => 'Viewing member details',
'VIEWING_ONLINE' => 'Viewing who is online',
@@ -702,8 +840,10 @@ $lang = array_merge($lang, array(
'VIEW_LATEST_POST' => 'View the latest post',
'VIEW_NEWEST_POST' => 'View first unread post',
'VIEW_NOTES' => 'View user notes',
- 'VIEW_ONLINE_TIME' => 'based on users active over the past %d minute',
- 'VIEW_ONLINE_TIMES' => 'based on users active over the past %d minutes',
+ 'VIEW_ONLINE_TIMES' => array(
+ 1 => 'based on users active over the past %d minute',
+ 2 => 'based on users active over the past %d minutes',
+ ),
'VIEW_TOPIC' => 'View topic',
'VIEW_TOPIC_ANNOUNCEMENT' => 'Announcement: ',
'VIEW_TOPIC_GLOBAL' => 'Global Announcement: ',
@@ -724,23 +864,24 @@ $lang = array_merge($lang, array(
'WEBSITE' => 'Website',
'WHOIS' => 'Whois',
'WHO_IS_ONLINE' => 'Who is online',
+ 'WLM' => 'WLM',
'WRONG_PASSWORD' => 'You entered an incorrect password.',
'WRONG_DATA_COLOUR' => 'The colour value you entered is invalid.',
- 'WRONG_DATA_ICQ' => 'The number you entered is not a valid ICQ number.',
'WRONG_DATA_JABBER' => 'The name you entered is not a valid Jabber account name.',
'WRONG_DATA_LANG' => 'The language you specified is not valid.',
- 'WRONG_DATA_WEBSITE' => 'The website address has to be a valid URL, including the protocol. For example http://www.example.com/.',
+ 'WRONG_DATA_POST_SD' => 'The post sort direction you specified is not valid.',
+ 'WRONG_DATA_POST_SK' => 'The post sort option you specified is not valid.',
+ 'WRONG_DATA_TOPIC_SD' => 'The topic sort direction you specified is not valid.',
+ 'WRONG_DATA_TOPIC_SK' => 'The topic sort option you specified is not valid.',
'WROTE' => 'wrote',
+ 'YAHOO' => 'Yahoo Messenger',
+ 'YOUTUBE' => 'YouTube',
'YEAR' => 'Year',
'YEAR_MONTH_DAY' => '(YYYY-MM-DD)',
'YES' => 'Yes',
- 'YIM' => 'YIM',
'YOU_LAST_VISIT' => 'Last visit was: %s',
- 'YOU_NEW_PM' => 'A new private message is waiting for you in your Inbox.',
- 'YOU_NEW_PMS' => 'New private messages are waiting for you in your Inbox.',
- 'YOU_NO_NEW_PM' => 'No new private messages are waiting for you.',
'datetime' => array(
'TODAY' => 'Today',
@@ -750,7 +891,6 @@ $lang = array_merge($lang, array(
0 => 'less than a minute ago',
1 => '%d minute ago',
2 => '%d minutes ago',
- 60 => '1 hour ago',
),
'Sunday' => 'Sunday',
@@ -796,91 +936,467 @@ $lang = array_merge($lang, array(
'Dec' => 'Dec',
),
- 'tz' => array(
- '-12' => 'UTC - 12 hours',
- '-11' => 'UTC - 11 hours',
- '-10' => 'UTC - 10 hours',
- '-9.5' => 'UTC - 9:30 hours',
- '-9' => 'UTC - 9 hours',
- '-8' => 'UTC - 8 hours',
- '-7' => 'UTC - 7 hours',
- '-6' => 'UTC - 6 hours',
- '-5' => 'UTC - 5 hours',
- '-4.5' => 'UTC - 4:30 hours',
- '-4' => 'UTC - 4 hours',
- '-3.5' => 'UTC - 3:30 hours',
- '-3' => 'UTC - 3 hours',
- '-2' => 'UTC - 2 hours',
- '-1' => 'UTC - 1 hour',
- '0' => 'UTC',
- '1' => 'UTC + 1 hour',
- '2' => 'UTC + 2 hours',
- '3' => 'UTC + 3 hours',
- '3.5' => 'UTC + 3:30 hours',
- '4' => 'UTC + 4 hours',
- '4.5' => 'UTC + 4:30 hours',
- '5' => 'UTC + 5 hours',
- '5.5' => 'UTC + 5:30 hours',
- '5.75' => 'UTC + 5:45 hours',
- '6' => 'UTC + 6 hours',
- '6.5' => 'UTC + 6:30 hours',
- '7' => 'UTC + 7 hours',
- '8' => 'UTC + 8 hours',
- '8.75' => 'UTC + 8:45 hours',
- '9' => 'UTC + 9 hours',
- '9.5' => 'UTC + 9:30 hours',
- '10' => 'UTC + 10 hours',
- '10.5' => 'UTC + 10:30 hours',
- '11' => 'UTC + 11 hours',
- '11.5' => 'UTC + 11:30 hours',
- '12' => 'UTC + 12 hours',
- '12.75' => 'UTC + 12:45 hours',
- '13' => 'UTC + 13 hours',
- '14' => 'UTC + 14 hours',
- 'dst' => '[ <abbr title="Daylight Saving Time">DST</abbr> ]',
- ),
+ // Timezones can be translated. We use this for the Etc/GMT timezones here,
+ // because they are named invers to their offset.
+ 'timezones' => array(
+ 'UTC' => 'UTC',
+ 'UTC_OFFSET' => 'UTC%1$s',
+ 'UTC_OFFSET_CURRENT' => 'UTC%1$s - %2$s',
+
+ 'Etc/GMT-12' => 'UTC+12',
+ 'Etc/GMT-11' => 'UTC+11',
+ 'Etc/GMT-10' => 'UTC+10',
+ 'Etc/GMT-9' => 'UTC+9',
+ 'Etc/GMT-8' => 'UTC+8',
+ 'Etc/GMT-7' => 'UTC+7',
+ 'Etc/GMT-6' => 'UTC+6',
+ 'Etc/GMT-5' => 'UTC+5',
+ 'Etc/GMT-4' => 'UTC+4',
+ 'Etc/GMT-3' => 'UTC+3',
+ 'Etc/GMT-2' => 'UTC+2',
+ 'Etc/GMT-1' => 'UTC+1',
+ 'Etc/GMT+1' => 'UTC-1',
+ 'Etc/GMT+2' => 'UTC-2',
+ 'Etc/GMT+3' => 'UTC-3',
+ 'Etc/GMT+4' => 'UTC-4',
+ 'Etc/GMT+5' => 'UTC-5',
+ 'Etc/GMT+6' => 'UTC-6',
+ 'Etc/GMT+7' => 'UTC-7',
+ 'Etc/GMT+8' => 'UTC-8',
+ 'Etc/GMT+9' => 'UTC-9',
+ 'Etc/GMT+10' => 'UTC-10',
+ 'Etc/GMT+11' => 'UTC-11',
+ 'Etc/GMT+12' => 'UTC-12',
+
+ 'Africa/Abidjan' => 'Africa/Abidjan',
+ 'Africa/Accra' => 'Africa/Accra',
+ 'Africa/Addis_Ababa' => 'Africa/Addis Ababa',
+ 'Africa/Algiers' => 'Africa/Algiers',
+ 'Africa/Asmara' => 'Africa/Asmara',
+ 'Africa/Bamako' => 'Africa/Bamako',
+ 'Africa/Bangui' => 'Africa/Bangui',
+ 'Africa/Banjul' => 'Africa/Banjul',
+ 'Africa/Bissau' => 'Africa/Bissau',
+ 'Africa/Blantyre' => 'Africa/Blantyre',
+ 'Africa/Brazzaville' => 'Africa/Brazzaville',
+ 'Africa/Bujumbura' => 'Africa/Bujumbura',
+ 'Africa/Cairo' => 'Africa/Cairo',
+ 'Africa/Casablanca' => 'Africa/Casablanca',
+ 'Africa/Ceuta' => 'Africa/Ceuta',
+ 'Africa/Conakry' => 'Africa/Conakry',
+ 'Africa/Dakar' => 'Africa/Dakar',
+ 'Africa/Dar_es_Salaam' => 'Africa/Dar es Salaam',
+ 'Africa/Djibouti' => 'Africa/Djibouti',
+ 'Africa/Douala' => 'Africa/Douala',
+ 'Africa/El_Aaiun' => 'Africa/El Aaiun',
+ 'Africa/Freetown' => 'Africa/Freetown',
+ 'Africa/Gaborone' => 'Africa/Gaborone',
+ 'Africa/Harare' => 'Africa/Harare',
+ 'Africa/Johannesburg' => 'Africa/Johannesburg',
+ 'Africa/Juba' => 'Africa/Juba',
+ 'Africa/Kampala' => 'Africa/Kampala',
+ 'Africa/Khartoum' => 'Africa/Khartoum',
+ 'Africa/Kigali' => 'Africa/Kigali',
+ 'Africa/Kinshasa' => 'Africa/Kinshasa',
+ 'Africa/Lagos' => 'Africa/Lagos',
+ 'Africa/Libreville' => 'Africa/Libreville',
+ 'Africa/Lome' => 'Africa/Lome',
+ 'Africa/Luanda' => 'Africa/Luanda',
+ 'Africa/Lubumbashi' => 'Africa/Lubumbashi',
+ 'Africa/Lusaka' => 'Africa/Lusaka',
+ 'Africa/Malabo' => 'Africa/Malabo',
+ 'Africa/Maputo' => 'Africa/Maputo',
+ 'Africa/Maseru' => 'Africa/Maseru',
+ 'Africa/Mbabane' => 'Africa/Mbabane',
+ 'Africa/Mogadishu' => 'Africa/Mogadishu',
+ 'Africa/Monrovia' => 'Africa/Monrovia',
+ 'Africa/Nairobi' => 'Africa/Nairobi',
+ 'Africa/Ndjamena' => 'Africa/Ndjamena',
+ 'Africa/Niamey' => 'Africa/Niamey',
+ 'Africa/Nouakchott' => 'Africa/Nouakchott',
+ 'Africa/Ouagadougou' => 'Africa/Ouagadougou',
+ 'Africa/Porto-Novo' => 'Africa/Porto-Novo',
+ 'Africa/Sao_Tome' => 'Africa/Sao Tome',
+ 'Africa/Tripoli' => 'Africa/Tripoli',
+ 'Africa/Tunis' => 'Africa/Tunis',
+ 'Africa/Windhoek' => 'Africa/Windhoek',
- 'tz_zones' => array(
- '-12' => '[UTC - 12] Baker Island Time',
- '-11' => '[UTC - 11] Niue Time, Samoa Standard Time',
- '-10' => '[UTC - 10] Hawaii-Aleutian Standard Time, Cook Island Time',
- '-9.5' => '[UTC - 9:30] Marquesas Islands Time',
- '-9' => '[UTC - 9] Alaska Standard Time, Gambier Island Time',
- '-8' => '[UTC - 8] Pacific Standard Time',
- '-7' => '[UTC - 7] Mountain Standard Time',
- '-6' => '[UTC - 6] Central Standard Time',
- '-5' => '[UTC - 5] Eastern Standard Time',
- '-4.5' => '[UTC - 4:30] Venezuelan Standard Time',
- '-4' => '[UTC - 4] Atlantic Standard Time',
- '-3.5' => '[UTC - 3:30] Newfoundland Standard Time',
- '-3' => '[UTC - 3] Amazon Standard Time, Central Greenland Time',
- '-2' => '[UTC - 2] Fernando de Noronha Time, South Georgia &amp; the South Sandwich Islands Time',
- '-1' => '[UTC - 1] Azores Standard Time, Cape Verde Time, Eastern Greenland Time',
- '0' => '[UTC] Western European Time, Greenwich Mean Time',
- '1' => '[UTC + 1] Central European Time, West African Time',
- '2' => '[UTC + 2] Eastern European Time, Central African Time',
- '3' => '[UTC + 3] Moscow Standard Time, Eastern African Time',
- '3.5' => '[UTC + 3:30] Iran Standard Time',
- '4' => '[UTC + 4] Gulf Standard Time, Samara Standard Time',
- '4.5' => '[UTC + 4:30] Afghanistan Time',
- '5' => '[UTC + 5] Pakistan Standard Time, Yekaterinburg Standard Time',
- '5.5' => '[UTC + 5:30] Indian Standard Time, Sri Lanka Time',
- '5.75' => '[UTC + 5:45] Nepal Time',
- '6' => '[UTC + 6] Bangladesh Time, Bhutan Time, Novosibirsk Standard Time',
- '6.5' => '[UTC + 6:30] Cocos Islands Time, Myanmar Time',
- '7' => '[UTC + 7] Indochina Time, Krasnoyarsk Standard Time',
- '8' => '[UTC + 8] Chinese Standard Time, Australian Western Standard Time, Irkutsk Standard Time',
- '8.75' => '[UTC + 8:45] Southeastern Western Australia Standard Time',
- '9' => '[UTC + 9] Japan Standard Time, Korea Standard Time, Chita Standard Time',
- '9.5' => '[UTC + 9:30] Australian Central Standard Time',
- '10' => '[UTC + 10] Australian Eastern Standard Time, Vladivostok Standard Time',
- '10.5' => '[UTC + 10:30] Lord Howe Standard Time',
- '11' => '[UTC + 11] Solomon Island Time, Magadan Standard Time',
- '11.5' => '[UTC + 11:30] Norfolk Island Time',
- '12' => '[UTC + 12] New Zealand Time, Fiji Time, Kamchatka Standard Time',
- '12.75' => '[UTC + 12:45] Chatham Islands Time',
- '13' => '[UTC + 13] Tonga Time, Phoenix Islands Time',
- '14' => '[UTC + 14] Line Island Time',
+ 'America/Adak' => 'America/Adak',
+ 'America/Anchorage' => 'America/Anchorage',
+ 'America/Anguilla' => 'America/Anguilla',
+ 'America/Antigua' => 'America/Antigua',
+ 'America/Araguaina' => 'America/Araguaina',
+
+ 'America/Argentina/Buenos_Aires' => 'America/Argentina/Buenos Aires',
+ 'America/Argentina/Catamarca' => 'America/Argentina/Catamarca',
+ 'America/Argentina/Cordoba' => 'America/Argentina/Cordoba',
+ 'America/Argentina/Jujuy' => 'America/Argentina/Jujuy',
+ 'America/Argentina/La_Rioja' => 'America/Argentina/La Rioja',
+ 'America/Argentina/Mendoza' => 'America/Argentina/Mendoza',
+ 'America/Argentina/Rio_Gallegos' => 'America/Argentina/Rio Gallegos',
+ 'America/Argentina/Salta' => 'America/Argentina/Salta',
+ 'America/Argentina/San_Juan' => 'America/Argentina/San Juan',
+ 'America/Argentina/San_Luis' => 'America/Argentina/San Luis',
+ 'America/Argentina/Tucuman' => 'America/Argentina/Tucuman',
+ 'America/Argentina/Ushuaia' => 'America/Argentina/Ushuaia',
+
+ 'America/Aruba' => 'America/Aruba',
+ 'America/Asuncion' => 'America/Asuncion',
+ 'America/Atikokan' => 'America/Atikokan',
+ 'America/Bahia' => 'America/Bahia',
+ 'America/Bahia_Banderas' => 'America/Bahia Banderas',
+ 'America/Barbados' => 'America/Barbados',
+ 'America/Belem' => 'America/Belem',
+ 'America/Belize' => 'America/Belize',
+ 'America/Blanc-Sablon' => 'America/Blanc-Sablon',
+ 'America/Boa_Vista' => 'America/Boa Vista',
+ 'America/Bogota' => 'America/Bogota',
+ 'America/Boise' => 'America/Boise',
+ 'America/Cambridge_Bay' => 'America/Cambridge Bay',
+ 'America/Campo_Grande' => 'America/Campo Grande',
+ 'America/Cancun' => 'America/Cancun',
+ 'America/Caracas' => 'America/Caracas',
+ 'America/Cayenne' => 'America/Cayenne',
+ 'America/Cayman' => 'America/Cayman',
+ 'America/Chicago' => 'America/Chicago',
+ 'America/Chihuahua' => 'America/Chihuahua',
+ 'America/Costa_Rica' => 'America/Costa Rica',
+ 'America/Creston' => 'America/Creston',
+ 'America/Cuiaba' => 'America/Cuiaba',
+ 'America/Curacao' => 'America/Curacao',
+ 'America/Danmarkshavn' => 'America/Danmarkshavn',
+ 'America/Dawson' => 'America/Dawson',
+ 'America/Dawson_Creek' => 'America/Dawson Creek',
+ 'America/Denver' => 'America/Denver',
+ 'America/Detroit' => 'America/Detroit',
+ 'America/Dominica' => 'America/Dominica',
+ 'America/Edmonton' => 'America/Edmonton',
+ 'America/Eirunepe' => 'America/Eirunepe',
+ 'America/El_Salvador' => 'America/El Salvador',
+ 'America/Fortaleza' => 'America/Fortaleza',
+ 'America/Glace_Bay' => 'America/Glace Bay',
+ 'America/Godthab' => 'America/Godthab',
+ 'America/Goose_Bay' => 'America/Goose Bay',
+ 'America/Grand_Turk' => 'America/Grand Turk',
+ 'America/Grenada' => 'America/Grenada',
+ 'America/Guadeloupe' => 'America/Guadeloupe',
+ 'America/Guatemala' => 'America/Guatemala',
+ 'America/Guayaquil' => 'America/Guayaquil',
+ 'America/Guyana' => 'America/Guyana',
+ 'America/Halifax' => 'America/Halifax',
+ 'America/Havana' => 'America/Havana',
+ 'America/Hermosillo' => 'America/Hermosillo',
+ 'America/Indiana/Indianapolis' => 'America/Indiana/Indianapolis',
+ 'America/Indiana/Knox' => 'America/Indiana/Knox',
+ 'America/Indiana/Marengo' => 'America/Indiana/Marengo',
+ 'America/Indiana/Petersburg' => 'America/Indiana/Petersburg',
+ 'America/Indiana/Tell_City' => 'America/Indiana/Tell City',
+ 'America/Indiana/Vevay' => 'America/Indiana/Vevay',
+ 'America/Indiana/Vincennes' => 'America/Indiana/Vincennes',
+ 'America/Indiana/Winamac' => 'America/Indiana/Winamac',
+ 'America/Inuvik' => 'America/Inuvik',
+ 'America/Iqaluit' => 'America/Iqaluit',
+ 'America/Jamaica' => 'America/Jamaica',
+ 'America/Juneau' => 'America/Juneau',
+ 'America/Kentucky/Louisville' => 'America/Kentucky/Louisville',
+ 'America/Kentucky/Monticello' => 'America/Kentucky/Monticello',
+ 'America/Kralendijk' => 'America/Kralendijk',
+ 'America/La_Paz' => 'America/La Paz',
+ 'America/Lima' => 'America/Lima',
+ 'America/Los_Angeles' => 'America/Los Angeles',
+ 'America/Lower_Princes' => 'America/Lower Princes',
+ 'America/Maceio' => 'America/Maceio',
+ 'America/Managua' => 'America/Managua',
+ 'America/Manaus' => 'America/Manaus',
+ 'America/Marigot' => 'America/Marigot',
+ 'America/Martinique' => 'America/Martinique',
+ 'America/Matamoros' => 'America/Matamoros',
+ 'America/Mazatlan' => 'America/Mazatlan',
+ 'America/Menominee' => 'America/Menominee',
+ 'America/Merida' => 'America/Merida',
+ 'America/Metlakatla' => 'America/Metlakatla',
+ 'America/Mexico_City' => 'America/Mexico City',
+ 'America/Miquelon' => 'America/Miquelon',
+ 'America/Moncton' => 'America/Moncton',
+ 'America/Monterrey' => 'America/Monterrey',
+ 'America/Montevideo' => 'America/Montevideo',
+ 'America/Montreal' => 'America/Montreal',
+ 'America/Montserrat' => 'America/Montserrat',
+ 'America/Nassau' => 'America/Nassau',
+ 'America/New_York' => 'America/New York',
+ 'America/Nipigon' => 'America/Nipigon',
+ 'America/Nome' => 'America/Nome',
+ 'America/Noronha' => 'America/Noronha',
+ 'America/North_Dakota/Beulah' => 'America/North Dakota/Beulah',
+ 'America/North_Dakota/Center' => 'America/North Dakota/Center',
+ 'America/North_Dakota/New_Salem' => 'America/North Dakota/New Salem',
+ 'America/Ojinaga' => 'America/Ojinaga',
+ 'America/Panama' => 'America/Panama',
+ 'America/Pangnirtung' => 'America/Pangnirtung',
+ 'America/Paramaribo' => 'America/Paramaribo',
+ 'America/Phoenix' => 'America/Phoenix',
+ 'America/Port-au-Prince' => 'America/Port-au-Prince',
+ 'America/Port_of_Spain' => 'America/Port of Spain',
+ 'America/Porto_Velho' => 'America/Porto Velho',
+ 'America/Puerto_Rico' => 'America/Puerto Rico',
+ 'America/Rainy_River' => 'America/Rainy River',
+ 'America/Rankin_Inlet' => 'America/Rankin Inlet',
+ 'America/Recife' => 'America/Recife',
+ 'America/Regina' => 'America/Regina',
+ 'America/Resolute' => 'America/Resolute',
+ 'America/Rio_Branco' => 'America/Rio Branco',
+ 'America/Santa_Isabel' => 'America/Santa Isabel',
+ 'America/Santarem' => 'America/Santarem',
+ 'America/Santiago' => 'America/Santiago',
+ 'America/Santo_Domingo' => 'America/Santo Domingo',
+ 'America/Sao_Paulo' => 'America/Sao Paulo',
+ 'America/Scoresbysund' => 'America/Scoresbysund',
+ 'America/Shiprock' => 'America/Shiprock',
+ 'America/Sitka' => 'America/Sitka',
+ 'America/St_Barthelemy' => 'America/St. Barthelemy',
+ 'America/St_Johns' => 'America/St. Johns',
+ 'America/St_Kitts' => 'America/St. Kitts',
+ 'America/St_Lucia' => 'America/St. Lucia',
+ 'America/St_Thomas' => 'America/St. Thomas',
+ 'America/St_Vincent' => 'America/St. Vincent',
+ 'America/Swift_Current' => 'America/Swift Current',
+ 'America/Tegucigalpa' => 'America/Tegucigalpa',
+ 'America/Thule' => 'America/Thule',
+ 'America/Thunder_Bay' => 'America/Thunder Bay',
+ 'America/Tijuana' => 'America/Tijuana',
+ 'America/Toronto' => 'America/Toronto',
+ 'America/Tortola' => 'America/Tortola',
+ 'America/Vancouver' => 'America/Vancouver',
+ 'America/Whitehorse' => 'America/Whitehorse',
+ 'America/Winnipeg' => 'America/Winnipeg',
+ 'America/Yakutat' => 'America/Yakutat',
+ 'America/Yellowknife' => 'America/Yellowknife',
+
+ 'Antarctica/Casey' => 'Antarctica/Casey',
+ 'Antarctica/Davis' => 'Antarctica/Davis',
+ 'Antarctica/DumontDUrville' => 'Antarctica/DumontDUrville',
+ 'Antarctica/Macquarie' => 'Antarctica/Macquarie',
+ 'Antarctica/Mawson' => 'Antarctica/Mawson',
+ 'Antarctica/McMurdo' => 'Antarctica/McMurdo',
+ 'Antarctica/Palmer' => 'Antarctica/Palmer',
+ 'Antarctica/Rothera' => 'Antarctica/Rothera',
+ 'Antarctica/South_Pole' => 'Antarctica/South Pole',
+ 'Antarctica/Syowa' => 'Antarctica/Syowa',
+ 'Antarctica/Vostok' => 'Antarctica/Vostok',
+
+ 'Arctic/Longyearbyen' => 'Arctic/Longyearbyen',
+
+ 'Asia/Aden' => 'Asia/Aden',
+ 'Asia/Almaty' => 'Asia/Almaty',
+ 'Asia/Amman' => 'Asia/Amman',
+ 'Asia/Anadyr' => 'Asia/Anadyr',
+ 'Asia/Aqtau' => 'Asia/Aqtau',
+ 'Asia/Aqtobe' => 'Asia/Aqtobe',
+ 'Asia/Ashgabat' => 'Asia/Ashgabat',
+ 'Asia/Baghdad' => 'Asia/Baghdad',
+ 'Asia/Bahrain' => 'Asia/Bahrain',
+ 'Asia/Baku' => 'Asia/Baku',
+ 'Asia/Bangkok' => 'Asia/Bangkok',
+ 'Asia/Beirut' => 'Asia/Beirut',
+ 'Asia/Bishkek' => 'Asia/Bishkek',
+ 'Asia/Brunei' => 'Asia/Brunei',
+ 'Asia/Choibalsan' => 'Asia/Choibalsan',
+ 'Asia/Chongqing' => 'Asia/Chongqing',
+ 'Asia/Colombo' => 'Asia/Colombo',
+ 'Asia/Damascus' => 'Asia/Damascus',
+ 'Asia/Dhaka' => 'Asia/Dhaka',
+ 'Asia/Dili' => 'Asia/Dili',
+ 'Asia/Dubai' => 'Asia/Dubai',
+ 'Asia/Dushanbe' => 'Asia/Dushanbe',
+ 'Asia/Gaza' => 'Asia/Gaza',
+ 'Asia/Harbin' => 'Asia/Harbin',
+ 'Asia/Hebron' => 'Asia/Hebron',
+ 'Asia/Ho_Chi_Minh' => 'Asia/Ho Chi Minh',
+ 'Asia/Hong_Kong' => 'Asia/Hong Kong',
+ 'Asia/Hovd' => 'Asia/Hovd',
+ 'Asia/Irkutsk' => 'Asia/Irkutsk',
+ 'Asia/Jakarta' => 'Asia/Jakarta',
+ 'Asia/Jayapura' => 'Asia/Jayapura',
+ 'Asia/Jerusalem' => 'Asia/Jerusalem',
+ 'Asia/Kabul' => 'Asia/Kabul',
+ 'Asia/Kamchatka' => 'Asia/Kamchatka',
+ 'Asia/Karachi' => 'Asia/Karachi',
+ 'Asia/Kashgar' => 'Asia/Kashgar',
+ 'Asia/Kathmandu' => 'Asia/Kathmandu',
+ 'Asia/Khandyga' => 'Asia/Khandyga',
+ 'Asia/Kolkata' => 'Asia/Kolkata',
+ 'Asia/Krasnoyarsk' => 'Asia/Krasnoyarsk',
+ 'Asia/Kuala_Lumpur' => 'Asia/Kuala Lumpur',
+ 'Asia/Kuching' => 'Asia/Kuching',
+ 'Asia/Kuwait' => 'Asia/Kuwait',
+ 'Asia/Macau' => 'Asia/Macau',
+ 'Asia/Magadan' => 'Asia/Magadan',
+ 'Asia/Makassar' => 'Asia/Makassar',
+ 'Asia/Manila' => 'Asia/Manila',
+ 'Asia/Muscat' => 'Asia/Muscat',
+ 'Asia/Nicosia' => 'Asia/Nicosia',
+ 'Asia/Novokuznetsk' => 'Asia/Novokuznetsk',
+ 'Asia/Novosibirsk' => 'Asia/Novosibirsk',
+ 'Asia/Omsk' => 'Asia/Omsk',
+ 'Asia/Oral' => 'Asia/Oral',
+ 'Asia/Phnom_Penh' => 'Asia/Phnom Penh',
+ 'Asia/Pontianak' => 'Asia/Pontianak',
+ 'Asia/Pyongyang' => 'Asia/Pyongyang',
+ 'Asia/Qatar' => 'Asia/Qatar',
+ 'Asia/Qyzylorda' => 'Asia/Qyzylorda',
+ 'Asia/Rangoon' => 'Asia/Rangoon',
+ 'Asia/Riyadh' => 'Asia/Riyadh',
+ 'Asia/Sakhalin' => 'Asia/Sakhalin',
+ 'Asia/Samarkand' => 'Asia/Samarkand',
+ 'Asia/Seoul' => 'Asia/Seoul',
+ 'Asia/Shanghai' => 'Asia/Shanghai',
+ 'Asia/Singapore' => 'Asia/Singapore',
+ 'Asia/Taipei' => 'Asia/Taipei',
+ 'Asia/Tashkent' => 'Asia/Tashkent',
+ 'Asia/Tbilisi' => 'Asia/Tbilisi',
+ 'Asia/Tehran' => 'Asia/Tehran',
+ 'Asia/Thimphu' => 'Asia/Thimphu',
+ 'Asia/Tokyo' => 'Asia/Tokyo',
+ 'Asia/Ulaanbaatar' => 'Asia/Ulaanbaatar',
+ 'Asia/Urumqi' => 'Asia/Urumqi',
+ 'Asia/Ust-Nera' => 'Asia/Ust-Nera',
+ 'Asia/Vientiane' => 'Asia/Vientiane',
+ 'Asia/Vladivostok' => 'Asia/Vladivostok',
+ 'Asia/Yakutsk' => 'Asia/Yakutsk',
+ 'Asia/Yekaterinburg' => 'Asia/Yekaterinburg',
+ 'Asia/Yerevan' => 'Asia/Yerevan',
+
+ 'Atlantic/Azores' => 'Atlantic/Azores',
+ 'Atlantic/Bermuda' => 'Atlantic/Bermuda',
+ 'Atlantic/Canary' => 'Atlantic/Canary',
+ 'Atlantic/Cape_Verde' => 'Atlantic/Cape Verde',
+ 'Atlantic/Faroe' => 'Atlantic/Faroe',
+ 'Atlantic/Madeira' => 'Atlantic/Madeira',
+ 'Atlantic/Reykjavik' => 'Atlantic/Reykjavik',
+ 'Atlantic/South_Georgia' => 'Atlantic/South Georgia',
+ 'Atlantic/St_Helena' => 'Atlantic/St. Helena',
+ 'Atlantic/Stanley' => 'Atlantic/Stanley',
+
+ 'Australia/Adelaide' => 'Australia/Adelaide',
+ 'Australia/Brisbane' => 'Australia/Brisbane',
+ 'Australia/Broken_Hill' => 'Australia/Broken Hill',
+ 'Australia/Currie' => 'Australia/Currie',
+ 'Australia/Darwin' => 'Australia/Darwin',
+ 'Australia/Eucla' => 'Australia/Eucla',
+ 'Australia/Hobart' => 'Australia/Hobart',
+ 'Australia/Lindeman' => 'Australia/Lindeman',
+ 'Australia/Lord_Howe' => 'Australia/Lord Howe',
+ 'Australia/Melbourne' => 'Australia/Melbourne',
+ 'Australia/Perth' => 'Australia/Perth',
+ 'Australia/Sydney' => 'Australia/Sydney',
+
+ 'Europe/Amsterdam' => 'Europe/Amsterdam',
+ 'Europe/Andorra' => 'Europe/Andorra',
+ 'Europe/Athens' => 'Europe/Athens',
+ 'Europe/Belgrade' => 'Europe/Belgrade',
+ 'Europe/Berlin' => 'Europe/Berlin',
+ 'Europe/Bratislava' => 'Europe/Bratislava',
+ 'Europe/Brussels' => 'Europe/Brussels',
+ 'Europe/Bucharest' => 'Europe/Bucharest',
+ 'Europe/Budapest' => 'Europe/Budapest',
+ 'Europe/Busingen' => 'Europe/Busingen',
+ 'Europe/Chisinau' => 'Europe/Chisinau',
+ 'Europe/Copenhagen' => 'Europe/Copenhagen',
+ 'Europe/Dublin' => 'Europe/Dublin',
+ 'Europe/Gibraltar' => 'Europe/Gibraltar',
+ 'Europe/Guernsey' => 'Europe/Guernsey',
+ 'Europe/Helsinki' => 'Europe/Helsinki',
+ 'Europe/Isle_of_Man' => 'Europe/Isle of Man',
+ 'Europe/Istanbul' => 'Europe/Istanbul',
+ 'Europe/Jersey' => 'Europe/Jersey',
+ 'Europe/Kaliningrad' => 'Europe/Kaliningrad',
+ 'Europe/Kiev' => 'Europe/Kiev',
+ 'Europe/Lisbon' => 'Europe/Lisbon',
+ 'Europe/Ljubljana' => 'Europe/Ljubljana',
+ 'Europe/London' => 'Europe/London',
+ 'Europe/Luxembourg' => 'Europe/Luxembourg',
+ 'Europe/Madrid' => 'Europe/Madrid',
+ 'Europe/Malta' => 'Europe/Malta',
+ 'Europe/Mariehamn' => 'Europe/Mariehamn',
+ 'Europe/Minsk' => 'Europe/Minsk',
+ 'Europe/Monaco' => 'Europe/Monaco',
+ 'Europe/Moscow' => 'Europe/Moscow',
+ 'Europe/Oslo' => 'Europe/Oslo',
+ 'Europe/Paris' => 'Europe/Paris',
+ 'Europe/Podgorica' => 'Europe/Podgorica',
+ 'Europe/Prague' => 'Europe/Prague',
+ 'Europe/Riga' => 'Europe/Riga',
+ 'Europe/Rome' => 'Europe/Rome',
+ 'Europe/Samara' => 'Europe/Samara',
+ 'Europe/San_Marino' => 'Europe/San Marino',
+ 'Europe/Sarajevo' => 'Europe/Sarajevo',
+ 'Europe/Simferopol' => 'Europe/Simferopol',
+ 'Europe/Skopje' => 'Europe/Skopje',
+ 'Europe/Sofia' => 'Europe/Sofia',
+ 'Europe/Stockholm' => 'Europe/Stockholm',
+ 'Europe/Tallinn' => 'Europe/Tallinn',
+ 'Europe/Tirane' => 'Europe/Tirane',
+ 'Europe/Uzhgorod' => 'Europe/Uzhgorod',
+ 'Europe/Vaduz' => 'Europe/Vaduz',
+ 'Europe/Vatican' => 'Europe/Vatican',
+ 'Europe/Vienna' => 'Europe/Vienna',
+ 'Europe/Vilnius' => 'Europe/Vilnius',
+ 'Europe/Volgograd' => 'Europe/Volgograd',
+ 'Europe/Warsaw' => 'Europe/Warsaw',
+ 'Europe/Zagreb' => 'Europe/Zagreb',
+ 'Europe/Zaporozhye' => 'Europe/Zaporozhye',
+ 'Europe/Zurich' => 'Europe/Zurich',
+
+ 'Indian/Antananarivo' => 'Indian/Antananarivo',
+ 'Indian/Chagos' => 'Indian/Chagos',
+ 'Indian/Christmas' => 'Indian/Christmas',
+ 'Indian/Cocos' => 'Indian/Cocos',
+ 'Indian/Comoro' => 'Indian/Comoro',
+ 'Indian/Kerguelen' => 'Indian/Kerguelen',
+ 'Indian/Mahe' => 'Indian/Mahe',
+ 'Indian/Maldives' => 'Indian/Maldives',
+ 'Indian/Mauritius' => 'Indian/Mauritius',
+ 'Indian/Mayotte' => 'Indian/Mayotte',
+ 'Indian/Reunion' => 'Indian/Reunion',
+
+ 'Pacific/Apia' => 'Pacific/Apia',
+ 'Pacific/Auckland' => 'Pacific/Auckland',
+ 'Pacific/Chatham' => 'Pacific/Chatham',
+ 'Pacific/Chuuk' => 'Pacific/Chuuk',
+ 'Pacific/Easter' => 'Pacific/Easter',
+ 'Pacific/Efate' => 'Pacific/Efate',
+ 'Pacific/Enderbury' => 'Pacific/Enderbury',
+ 'Pacific/Fakaofo' => 'Pacific/Fakaofo',
+ 'Pacific/Fiji' => 'Pacific/Fiji',
+ 'Pacific/Funafuti' => 'Pacific/Funafuti',
+ 'Pacific/Galapagos' => 'Pacific/Galapagos',
+ 'Pacific/Gambier' => 'Pacific/Gambier',
+ 'Pacific/Guadalcanal' => 'Pacific/Guadalcanal',
+ 'Pacific/Guam' => 'Pacific/Guam',
+ 'Pacific/Honolulu' => 'Pacific/Honolulu',
+ 'Pacific/Johnston' => 'Pacific/Johnston',
+ 'Pacific/Kiritimati' => 'Pacific/Kiritimati',
+ 'Pacific/Kosrae' => 'Pacific/Kosrae',
+ 'Pacific/Kwajalein' => 'Pacific/Kwajalein',
+ 'Pacific/Majuro' => 'Pacific/Majuro',
+ 'Pacific/Marquesas' => 'Pacific/Marquesas',
+ 'Pacific/Midway' => 'Pacific/Midway',
+ 'Pacific/Nauru' => 'Pacific/Nauru',
+ 'Pacific/Niue' => 'Pacific/Niue',
+ 'Pacific/Norfolk' => 'Pacific/Norfolk',
+ 'Pacific/Noumea' => 'Pacific/Noumea',
+ 'Pacific/Pago_Pago' => 'Pacific/Pago Pago',
+ 'Pacific/Palau' => 'Pacific/Palau',
+ 'Pacific/Pitcairn' => 'Pacific/Pitcairn',
+ 'Pacific/Pohnpei' => 'Pacific/Pohnpei',
+ 'Pacific/Port_Moresby' => 'Pacific/Port Moresby',
+ 'Pacific/Rarotonga' => 'Pacific/Rarotonga',
+ 'Pacific/Saipan' => 'Pacific/Saipan',
+ 'Pacific/Tahiti' => 'Pacific/Tahiti',
+ 'Pacific/Tarawa' => 'Pacific/Tarawa',
+ 'Pacific/Tongatapu' => 'Pacific/Tongatapu',
+ 'Pacific/Wake' => 'Pacific/Wake',
+ 'Pacific/Wallis' => 'Pacific/Wallis',
),
// The value is only an example and will get replaced by the current time on view
@@ -891,7 +1407,7 @@ $lang = array_merge($lang, array(
'D M d, Y g:i a' => 'Mon Jan 01, 2007 1:37 pm',
'F jS, Y, g:i a' => 'January 1st, 2007, 1:37 pm',
'|d M Y|, H:i' => 'Today, 13:37 / 01 Jan 2007, 13:37',
- '|F jS, Y|, g:i a' => 'Today, 1:37 pm / January 1st, 2007, 1:37 pm'
+ '|F jS, Y|, g:i a' => 'Today, 1:37 pm / January 1st, 2007, 1:37 pm',
),
// The default dateformat which will be used on new installs in this language
@@ -899,5 +1415,3 @@ $lang = array_merge($lang, array(
'default_dateformat' => 'D M d, Y g:i a', // Mon Jan 01, 2007 1:37 pm
));
-
-?> \ No newline at end of file
diff --git a/phpBB/language/en/email/admin_activate.txt b/phpBB/language/en/email/admin_activate.txt
index 8b11f1b450..a53ab1269e 100644
--- a/phpBB/language/en/email/admin_activate.txt
+++ b/phpBB/language/en/email/admin_activate.txt
@@ -10,5 +10,4 @@ Use this link to view the user's profile:
Use this link to activate the account:
{U_ACTIVATE}
-
-{EMAIL_SIG} \ No newline at end of file
+{EMAIL_SIG}
diff --git a/phpBB/language/en/email/admin_send_email.txt b/phpBB/language/en/email/admin_send_email.txt
index 6687404527..7345a040fd 100644
--- a/phpBB/language/en/email/admin_send_email.txt
+++ b/phpBB/language/en/email/admin_send_email.txt
@@ -1,14 +1,13 @@
-The following is an e-mail sent to you by an administrator of "{SITENAME}". If this message is spam, contains abusive or other comments you find offensive please contact the webmaster of the board at the following address:
+The following is an email sent to you by an administrator of "{SITENAME}". If this message is spam, contains abusive or other comments you find offensive please contact the webmaster of the board at the following address:
{CONTACT_EMAIL}
-Include this full e-mail (particularly the headers).
+Include this full email (particularly the headers).
Message sent to you follows:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
{MESSAGE}
-
{EMAIL_SIG}
diff --git a/phpBB/language/en/email/admin_welcome_activated.txt b/phpBB/language/en/email/admin_welcome_activated.txt
index cfdb69bdcb..2e136ac530 100644
--- a/phpBB/language/en/email/admin_welcome_activated.txt
+++ b/phpBB/language/en/email/admin_welcome_activated.txt
@@ -6,4 +6,4 @@ Your account on "{SITENAME}" has been activated by an administrator, you may log
Your password has been securely stored in our database and cannot be retrieved. In the event that it is forgotten, you will be able to reset it using the email address associated with your account.
-{EMAIL_SIG} \ No newline at end of file
+{EMAIL_SIG}
diff --git a/phpBB/language/en/email/admin_welcome_inactive.txt b/phpBB/language/en/email/admin_welcome_inactive.txt
index 30b3aae852..f9a57b9fe3 100644
--- a/phpBB/language/en/email/admin_welcome_inactive.txt
+++ b/phpBB/language/en/email/admin_welcome_inactive.txt
@@ -2,7 +2,7 @@ Subject: Welcome to "{SITENAME}"
{WELCOME_MSG}
-Please keep this e-mail for your records. Your account information is as follows:
+Please keep this email for your records. Your account information is as follows:
----------------------------
Username: {USERNAME}
@@ -16,4 +16,4 @@ Your password has been securely stored in our database and cannot be retrieved.
Thank you for registering.
-{EMAIL_SIG} \ No newline at end of file
+{EMAIL_SIG}
diff --git a/phpBB/language/en/email/bookmark.txt b/phpBB/language/en/email/bookmark.txt
new file mode 100644
index 0000000000..95f17b5693
--- /dev/null
+++ b/phpBB/language/en/email/bookmark.txt
@@ -0,0 +1,20 @@
+Subject: Topic reply notification - "{TOPIC_TITLE}"
+
+Hello {USERNAME},
+
+You are receiving this notification because a topic you bookmarked, "{TOPIC_TITLE}" at "{SITENAME}", has received a reply since your last visit. You can use the following link to view the replies made, no more notifications will be sent until you visit the topic.
+
+If you want to view the newest post made since your last visit, click the following link:
+{U_NEWEST_POST}
+
+If you want to view the topic, click the following link:
+{U_TOPIC}
+
+If you want to view the forum, click the following link:
+{U_FORUM}
+
+If you no longer wish to receive updates about replies to bookmarks, please update your notification settings here:
+
+{U_NOTIFICATION_SETTINGS}
+
+{EMAIL_SIG}
diff --git a/phpBB/language/en/email/contact_admin.txt b/phpBB/language/en/email/contact_admin.txt
new file mode 100644
index 0000000000..c895c4d687
--- /dev/null
+++ b/phpBB/language/en/email/contact_admin.txt
@@ -0,0 +1,23 @@
+
+Hello {TO_USERNAME},
+
+The following is an e-mail sent to you through the administration contact page on "{SITENAME}".
+
+<!-- IF S_IS_REGISTERED -->
+The message has been sent from an account on the site.
+Username: {FROM_USERNAME}
+E-mail address: {FROM_EMAIL_ADDRESS}
+IP Address: {FROM_IP_ADDRESS}
+Profile: {U_FROM_PROFILE}
+<!-- ELSE -->
+The message was sent from a guest who specified the following contact information:
+Name: {FROM_USERNAME}
+E-mail address: {FROM_EMAIL_ADDRESS}
+IP Address: {FROM_IP_ADDRESS}
+<!-- ENDIF -->
+
+
+Message sent to you follows
+~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+{MESSAGE}
diff --git a/phpBB/language/en/email/coppa_resend_inactive.txt b/phpBB/language/en/email/coppa_resend_inactive.txt
index c3e4af576d..915534a13e 100644
--- a/phpBB/language/en/email/coppa_resend_inactive.txt
+++ b/phpBB/language/en/email/coppa_resend_inactive.txt
@@ -16,7 +16,7 @@ OR mail it to:
Permission to participate at "{SITENAME}" - {U_BOARD}
Username: {USERNAME}
-E-mail: {EMAIL_ADDRESS}
+Email: {EMAIL_ADDRESS}
I HAVE REVIEWED THE INFORMATION PROVIDED BY MY CHILD AND HEREBY GRANT PERMISSION TO "{SITENAME}" TO STORE THIS INFORMATION.
I UNDERSTAND THIS INFORMATION CAN BE CHANGED AT ANY TIME BY ENTERING A PASSWORD.
diff --git a/phpBB/language/en/email/coppa_welcome_inactive.txt b/phpBB/language/en/email/coppa_welcome_inactive.txt
index c3e4af576d..915534a13e 100644
--- a/phpBB/language/en/email/coppa_welcome_inactive.txt
+++ b/phpBB/language/en/email/coppa_welcome_inactive.txt
@@ -16,7 +16,7 @@ OR mail it to:
Permission to participate at "{SITENAME}" - {U_BOARD}
Username: {USERNAME}
-E-mail: {EMAIL_ADDRESS}
+Email: {EMAIL_ADDRESS}
I HAVE REVIEWED THE INFORMATION PROVIDED BY MY CHILD AND HEREBY GRANT PERMISSION TO "{SITENAME}" TO STORE THIS INFORMATION.
I UNDERSTAND THIS INFORMATION CAN BE CHANGED AT ANY TIME BY ENTERING A PASSWORD.
diff --git a/phpBB/language/en/email/email_notify.txt b/phpBB/language/en/email/email_notify.txt
index 0d0ac7fc28..43c9098a4f 100644
--- a/phpBB/language/en/email/email_notify.txt
+++ b/phpBB/language/en/email/email_notify.txt
@@ -1,8 +1,8 @@
-Subject: "{SITENAME}" - E-mail a friend
+Subject: "{SITENAME}" - Email a friend
Hello {TO_USERNAME},
-This e-mail was sent from "{SITENAME}" by {FROM_USERNAME} who thought you may be interested in the following topic:
+This email was sent from "{SITENAME}" by {FROM_USERNAME} who thought you may be interested in the following topic:
{TOPIC_NAME}
@@ -10,8 +10,8 @@ You can find it at:
{U_TOPIC}
-A message from {FROM_USERNAME} may also be included below. Please note that this message has not been seen or approved by the board administrators. If you wish to complain about having received this e-mail please contact the board administrator at {BOARD_CONTACT}. Please quote the message headers when contacting this address.
+A message from {FROM_USERNAME} may also be included below. Please note that this message has not been seen or approved by the board administrators. If you wish to complain about having received this email please contact the board administrator at {BOARD_CONTACT}. Please quote the message headers when contacting this address.
----------
-{MESSAGE} \ No newline at end of file
+{MESSAGE}
diff --git a/phpBB/language/en/email/forum_notify.txt b/phpBB/language/en/email/forum_notify.txt
index a05be5fd96..ccae82c862 100644
--- a/phpBB/language/en/email/forum_notify.txt
+++ b/phpBB/language/en/email/forum_notify.txt
@@ -2,7 +2,7 @@ Subject: Forum post notification - "{FORUM_NAME}"
Hello {USERNAME},
-You are receiving this notification because you are watching the forum "{FORUM_NAME}" at "{SITENAME}". This forum has received a new reply to the topic "{TOPIC_TITLE}"<!-- IF AUTHOR_NAME !== '' --> by {AUTHOR_NAME}<!-- ENDIF --> since your last visit. You can use the following link to view the last unread reply, no more notifications will be sent until you visit the topic.
+You are receiving this notification because you are watching the forum "{FORUM_NAME}" at "{SITENAME}". This forum has received a new reply to the topic "{TOPIC_TITLE}"<!-- IF AUTHOR_NAME != '' --> by {AUTHOR_NAME}<!-- ENDIF --> since your last visit. You can use the following link to view the last unread reply, no more notifications will be sent until you visit the topic.
{U_NEWEST_POST}
diff --git a/phpBB/language/en/email/group_approved.txt b/phpBB/language/en/email/group_approved.txt
deleted file mode 100644
index 24afefcd07..0000000000
--- a/phpBB/language/en/email/group_approved.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-Subject: Your request has been approved
-
-Congratulations,
-
-Your request to join the "{GROUP_NAME}" group on "{SITENAME}" has been approved.
-Click on the following link to see your group membership.
-
-{U_GROUP}
-
-{EMAIL_SIG}
diff --git a/phpBB/language/en/email/installed.txt b/phpBB/language/en/email/installed.txt
index 60e52e37c4..93444581f2 100644
--- a/phpBB/language/en/email/installed.txt
+++ b/phpBB/language/en/email/installed.txt
@@ -4,7 +4,7 @@ Congratulations,
You have successfully installed phpBB on your server.
-This e-mail contains important information regarding your installation and should be kept for reference. Your password has been securely stored in our database and cannot be retrieved. In the event that it is forgotten, you will be able to reset it using the email address associated with your account.
+This email contains important information regarding your installation and should be kept for reference. Your password has been securely stored in our database and cannot be retrieved. In the event that it is forgotten, you will be able to reset it using the email address associated with your account.
----------------------------
Username: {USERNAME}
@@ -16,4 +16,4 @@ Useful information regarding the phpBB software can be found in the docs folder
In order to keep your board safe and secure, we highly recommended keeping current with software releases. For your convenience, a mailing list is available at the page referenced above.
-{EMAIL_SIG} \ No newline at end of file
+{EMAIL_SIG}
diff --git a/phpBB/language/en/email/newtopic_notify.txt b/phpBB/language/en/email/newtopic_notify.txt
index dcc1fff343..b9416d8e40 100644
--- a/phpBB/language/en/email/newtopic_notify.txt
+++ b/phpBB/language/en/email/newtopic_notify.txt
@@ -2,7 +2,7 @@ Subject: New topic notification - "{FORUM_NAME}"
Hello {USERNAME},
-You are receiving this notification because you are watching the forum "{FORUM_NAME}" at "{SITENAME}". This forum has received a new topic<!-- IF AUTHOR_NAME !== '' --> by {AUTHOR_NAME}<!-- ENDIF --> since your last visit, "{TOPIC_TITLE}". You can use the following link to view the forum, no more notifications will be sent until you visit the forum.
+You are receiving this notification because you are watching the forum "{FORUM_NAME}" at "{SITENAME}". This forum has received a new topic<!-- IF AUTHOR_NAME != '' --> by {AUTHOR_NAME}<!-- ENDIF --> since your last visit, "{TOPIC_TITLE}". You can use the following link to view the forum, no more notifications will be sent until you visit the forum.
{U_FORUM}
@@ -10,4 +10,4 @@ If you no longer wish to watch this forum you can either click the "Unsubscribe
{U_STOP_WATCHING_FORUM}
-{EMAIL_SIG} \ No newline at end of file
+{EMAIL_SIG}
diff --git a/phpBB/language/en/email/pm_report_closed.txt b/phpBB/language/en/email/pm_report_closed.txt
index 1b9f4a6658..0202b9d374 100644
--- a/phpBB/language/en/email/pm_report_closed.txt
+++ b/phpBB/language/en/email/pm_report_closed.txt
@@ -4,5 +4,4 @@ Hello {USERNAME},
You are receiving this notification because the report you filed regarding the private message "{PM_SUBJECT}" at "{SITENAME}" has been tended to by a moderator or administrator. The report is now closed. If you have further questions, please contact {CLOSER_NAME} by private message.
-
-{EMAIL_SIG} \ No newline at end of file
+{EMAIL_SIG}
diff --git a/phpBB/language/en/email/pm_report_deleted.txt b/phpBB/language/en/email/pm_report_deleted.txt
index a868837841..991ed59f31 100644
--- a/phpBB/language/en/email/pm_report_deleted.txt
+++ b/phpBB/language/en/email/pm_report_deleted.txt
@@ -4,5 +4,4 @@ Hello {USERNAME},
You are receiving this notification because the report you filed regarding the private message "{PM_SUBJECT}" at "{SITENAME}" was deleted by a moderator or administrator.
-
-{EMAIL_SIG} \ No newline at end of file
+{EMAIL_SIG}
diff --git a/phpBB/language/en/email/post_approved.txt b/phpBB/language/en/email/post_approved.txt
index e715b54026..854d785f5f 100644
--- a/phpBB/language/en/email/post_approved.txt
+++ b/phpBB/language/en/email/post_approved.txt
@@ -10,5 +10,4 @@ If you want to view the post, click the following link:
If you want to view the topic, click the following link:
{U_VIEW_TOPIC}
-
-{EMAIL_SIG} \ No newline at end of file
+{EMAIL_SIG}
diff --git a/phpBB/language/en/email/post_disapproved.txt b/phpBB/language/en/email/post_disapproved.txt
index 3bc64bb611..9b2ee643ff 100644
--- a/phpBB/language/en/email/post_disapproved.txt
+++ b/phpBB/language/en/email/post_disapproved.txt
@@ -8,5 +8,4 @@ The following reason was given for the disapproval:
{REASON}
-
-{EMAIL_SIG} \ No newline at end of file
+{EMAIL_SIG}
diff --git a/phpBB/language/en/email/post_in_queue.txt b/phpBB/language/en/email/post_in_queue.txt
new file mode 100644
index 0000000000..941f070d37
--- /dev/null
+++ b/phpBB/language/en/email/post_in_queue.txt
@@ -0,0 +1,13 @@
+Subject: Post moderation notification - "{TOPIC_TITLE}"
+
+Hello {USERNAME},
+
+You are receiving this notification because the post "{POST_SUBJECT}" at "{SITENAME}" needs approval.
+
+If you want to view the post, click the following link:
+{U_VIEW_POST}
+
+If you want to view the topic, click the following link:
+{U_TOPIC}
+
+{EMAIL_SIG}
diff --git a/phpBB/language/en/email/privmsg_notify.txt b/phpBB/language/en/email/privmsg_notify.txt
index d3a86cc73c..41fdbb782c 100644
--- a/phpBB/language/en/email/privmsg_notify.txt
+++ b/phpBB/language/en/email/privmsg_notify.txt
@@ -12,4 +12,4 @@ You can view your new message by clicking on the following link:
You have requested that you be notified on this event, remember that you can always choose not to be notified of new messages by changing the appropriate setting in your profile.
-{EMAIL_SIG} \ No newline at end of file
+{EMAIL_SIG}
diff --git a/phpBB/language/en/email/profile_send_email.txt b/phpBB/language/en/email/profile_send_email.txt
index 9fb19e7eb1..3e63777c9f 100644
--- a/phpBB/language/en/email/profile_send_email.txt
+++ b/phpBB/language/en/email/profile_send_email.txt
@@ -1,11 +1,11 @@
Hello {TO_USERNAME},
-The following is an e-mail sent to you by {FROM_USERNAME} via your account on "{SITENAME}". If this message is spam, contains abusive or other comments you find offensive please contact the webmaster of the board at the following address:
+The following is an email sent to you by {FROM_USERNAME} via your account on "{SITENAME}". If this message is spam, contains abusive or other comments you find offensive please contact the webmaster of the board at the following address:
{BOARD_CONTACT}
-Include this full e-mail (particularly the headers). Please note that the reply address to this e-mail has been set to that of {FROM_USERNAME}.
+Include this full email (particularly the headers). Please note that the reply address to this email has been set to that of {FROM_USERNAME}.
Message sent to you follows
~~~~~~~~~~~~~~~~~~~~~~~~~~~
diff --git a/phpBB/language/en/email/quote.txt b/phpBB/language/en/email/quote.txt
new file mode 100644
index 0000000000..2b9525801f
--- /dev/null
+++ b/phpBB/language/en/email/quote.txt
@@ -0,0 +1,20 @@
+Subject: Topic reply notification - "{TOPIC_TITLE}"
+
+Hello {USERNAME},
+
+You are receiving this notification because "{AUTHOR_NAME}" quoted you in the topic "{TOPIC_TITLE}" at "{SITENAME}". You can use the following link to view the reply made.
+
+If you want to view the quoted post, click the following link:
+{U_VIEW_POST}
+
+If you want to view the topic, click the following link:
+{U_TOPIC}
+
+If you want to view the forum, click the following link:
+{U_FORUM}
+
+If you no longer wish to receive updates about replies quoting you, please update your notification settings here:
+
+{U_NOTIFICATION_SETTINGS}
+
+{EMAIL_SIG}
diff --git a/phpBB/language/en/email/report_closed.txt b/phpBB/language/en/email/report_closed.txt
index eb7ef22b5e..f248018f9a 100644
--- a/phpBB/language/en/email/report_closed.txt
+++ b/phpBB/language/en/email/report_closed.txt
@@ -4,5 +4,4 @@ Hello {USERNAME},
You are receiving this notification because the report you filed on the post "{POST_SUBJECT}" in "{TOPIC_TITLE}" at "{SITENAME}" was handled by a moderator or by an administrator. The report was afterwards closed. If you have further questions contact {CLOSER_NAME} with a personal message.
-
-{EMAIL_SIG} \ No newline at end of file
+{EMAIL_SIG}
diff --git a/phpBB/language/en/email/report_deleted.txt b/phpBB/language/en/email/report_deleted.txt
index 4292ca2239..9a30ea2ddd 100644
--- a/phpBB/language/en/email/report_deleted.txt
+++ b/phpBB/language/en/email/report_deleted.txt
@@ -4,5 +4,4 @@ Hello {USERNAME},
You are receiving this notification because the report you filed on the post "{POST_SUBJECT}" in "{TOPIC_TITLE}" at "{SITENAME}" was deleted by a moderator or by an administrator.
-
-{EMAIL_SIG} \ No newline at end of file
+{EMAIL_SIG}
diff --git a/phpBB/language/en/email/report_pm.txt b/phpBB/language/en/email/report_pm.txt
new file mode 100644
index 0000000000..a101a014ff
--- /dev/null
+++ b/phpBB/language/en/email/report_pm.txt
@@ -0,0 +1,10 @@
+Subject: Private Message report - "{TOPIC_TITLE}"
+
+Hello {USERNAME},
+
+You are receiving this notification because a Private Message titled "{SUBJECT}" by "{AUTHOR_NAME}" at "{SITENAME}" was reported.
+
+If you want to view the report, click the following link:
+{U_VIEW_REPORT}
+
+{EMAIL_SIG}
diff --git a/phpBB/language/en/email/report_post.txt b/phpBB/language/en/email/report_post.txt
new file mode 100644
index 0000000000..8eb24ec6af
--- /dev/null
+++ b/phpBB/language/en/email/report_post.txt
@@ -0,0 +1,13 @@
+Subject: Post report - "{TOPIC_TITLE}"
+
+Hello {USERNAME},
+
+You are receiving this notification because the post "{POST_SUBJECT}" at "{SITENAME}" was reported.
+
+If you want to view the report, click the following link:
+{U_VIEW_REPORT}
+
+If you want to view the post, click the following link:
+{U_VIEW_POST}
+
+{EMAIL_SIG}
diff --git a/phpBB/language/en/email/short/bookmark.txt b/phpBB/language/en/email/short/bookmark.txt
new file mode 100644
index 0000000000..95f17b5693
--- /dev/null
+++ b/phpBB/language/en/email/short/bookmark.txt
@@ -0,0 +1,20 @@
+Subject: Topic reply notification - "{TOPIC_TITLE}"
+
+Hello {USERNAME},
+
+You are receiving this notification because a topic you bookmarked, "{TOPIC_TITLE}" at "{SITENAME}", has received a reply since your last visit. You can use the following link to view the replies made, no more notifications will be sent until you visit the topic.
+
+If you want to view the newest post made since your last visit, click the following link:
+{U_NEWEST_POST}
+
+If you want to view the topic, click the following link:
+{U_TOPIC}
+
+If you want to view the forum, click the following link:
+{U_FORUM}
+
+If you no longer wish to receive updates about replies to bookmarks, please update your notification settings here:
+
+{U_NOTIFICATION_SETTINGS}
+
+{EMAIL_SIG}
diff --git a/phpBB/language/en/email/short/newtopic_notify.txt b/phpBB/language/en/email/short/newtopic_notify.txt
new file mode 100644
index 0000000000..b9416d8e40
--- /dev/null
+++ b/phpBB/language/en/email/short/newtopic_notify.txt
@@ -0,0 +1,13 @@
+Subject: New topic notification - "{FORUM_NAME}"
+
+Hello {USERNAME},
+
+You are receiving this notification because you are watching the forum "{FORUM_NAME}" at "{SITENAME}". This forum has received a new topic<!-- IF AUTHOR_NAME != '' --> by {AUTHOR_NAME}<!-- ENDIF --> since your last visit, "{TOPIC_TITLE}". You can use the following link to view the forum, no more notifications will be sent until you visit the forum.
+
+{U_FORUM}
+
+If you no longer wish to watch this forum you can either click the "Unsubscribe forum" link found in the forum above, or by clicking the following link:
+
+{U_STOP_WATCHING_FORUM}
+
+{EMAIL_SIG}
diff --git a/phpBB/language/en/email/short/post_approved.txt b/phpBB/language/en/email/short/post_approved.txt
new file mode 100644
index 0000000000..854d785f5f
--- /dev/null
+++ b/phpBB/language/en/email/short/post_approved.txt
@@ -0,0 +1,13 @@
+Subject: Post approved - "{POST_SUBJECT}"
+
+Hello {USERNAME},
+
+You are receiving this notification because your post "{POST_SUBJECT}" at "{SITENAME}" was approved by a moderator or administrator.
+
+If you want to view the post, click the following link:
+{U_VIEW_POST}
+
+If you want to view the topic, click the following link:
+{U_VIEW_TOPIC}
+
+{EMAIL_SIG}
diff --git a/phpBB/language/en/email/short/post_disapproved.txt b/phpBB/language/en/email/short/post_disapproved.txt
new file mode 100644
index 0000000000..9b2ee643ff
--- /dev/null
+++ b/phpBB/language/en/email/short/post_disapproved.txt
@@ -0,0 +1,11 @@
+Subject: Post disapproved - "{POST_SUBJECT}"
+
+Hello {USERNAME},
+
+You are receiving this notification because your post "{POST_SUBJECT}" at "{SITENAME}" was disapproved by a moderator or administrator.
+
+The following reason was given for the disapproval:
+
+{REASON}
+
+{EMAIL_SIG}
diff --git a/phpBB/language/en/email/short/post_in_queue.txt b/phpBB/language/en/email/short/post_in_queue.txt
new file mode 100644
index 0000000000..941f070d37
--- /dev/null
+++ b/phpBB/language/en/email/short/post_in_queue.txt
@@ -0,0 +1,13 @@
+Subject: Post moderation notification - "{TOPIC_TITLE}"
+
+Hello {USERNAME},
+
+You are receiving this notification because the post "{POST_SUBJECT}" at "{SITENAME}" needs approval.
+
+If you want to view the post, click the following link:
+{U_VIEW_POST}
+
+If you want to view the topic, click the following link:
+{U_TOPIC}
+
+{EMAIL_SIG}
diff --git a/phpBB/language/en/email/short/privmsg_notify.txt b/phpBB/language/en/email/short/privmsg_notify.txt
new file mode 100644
index 0000000000..41fdbb782c
--- /dev/null
+++ b/phpBB/language/en/email/short/privmsg_notify.txt
@@ -0,0 +1,15 @@
+Subject: New private message has arrived
+
+Hello {USERNAME},
+
+You have received a new private message from "{AUTHOR_NAME}" to your account on "{SITENAME}" with the following subject:
+
+{SUBJECT}
+
+You can view your new message by clicking on the following link:
+
+{U_VIEW_MESSAGE}
+
+You have requested that you be notified on this event, remember that you can always choose not to be notified of new messages by changing the appropriate setting in your profile.
+
+{EMAIL_SIG}
diff --git a/phpBB/language/en/email/short/quote.txt b/phpBB/language/en/email/short/quote.txt
new file mode 100644
index 0000000000..2b9525801f
--- /dev/null
+++ b/phpBB/language/en/email/short/quote.txt
@@ -0,0 +1,20 @@
+Subject: Topic reply notification - "{TOPIC_TITLE}"
+
+Hello {USERNAME},
+
+You are receiving this notification because "{AUTHOR_NAME}" quoted you in the topic "{TOPIC_TITLE}" at "{SITENAME}". You can use the following link to view the reply made.
+
+If you want to view the quoted post, click the following link:
+{U_VIEW_POST}
+
+If you want to view the topic, click the following link:
+{U_TOPIC}
+
+If you want to view the forum, click the following link:
+{U_FORUM}
+
+If you no longer wish to receive updates about replies quoting you, please update your notification settings here:
+
+{U_NOTIFICATION_SETTINGS}
+
+{EMAIL_SIG}
diff --git a/phpBB/language/en/email/short/report_pm.txt b/phpBB/language/en/email/short/report_pm.txt
new file mode 100644
index 0000000000..a101a014ff
--- /dev/null
+++ b/phpBB/language/en/email/short/report_pm.txt
@@ -0,0 +1,10 @@
+Subject: Private Message report - "{TOPIC_TITLE}"
+
+Hello {USERNAME},
+
+You are receiving this notification because a Private Message titled "{SUBJECT}" by "{AUTHOR_NAME}" at "{SITENAME}" was reported.
+
+If you want to view the report, click the following link:
+{U_VIEW_REPORT}
+
+{EMAIL_SIG}
diff --git a/phpBB/language/en/email/short/report_post.txt b/phpBB/language/en/email/short/report_post.txt
new file mode 100644
index 0000000000..8eb24ec6af
--- /dev/null
+++ b/phpBB/language/en/email/short/report_post.txt
@@ -0,0 +1,13 @@
+Subject: Post report - "{TOPIC_TITLE}"
+
+Hello {USERNAME},
+
+You are receiving this notification because the post "{POST_SUBJECT}" at "{SITENAME}" was reported.
+
+If you want to view the report, click the following link:
+{U_VIEW_REPORT}
+
+If you want to view the post, click the following link:
+{U_VIEW_POST}
+
+{EMAIL_SIG}
diff --git a/phpBB/language/en/email/short/topic_approved.txt b/phpBB/language/en/email/short/topic_approved.txt
new file mode 100644
index 0000000000..60c7ef4c09
--- /dev/null
+++ b/phpBB/language/en/email/short/topic_approved.txt
@@ -0,0 +1,10 @@
+Subject: Topic approved - "{TOPIC_TITLE}"
+
+Hello {USERNAME},
+
+You are receiving this notification because your topic "{TOPIC_TITLE}" at "{SITENAME}" was approved by a moderator or administrator.
+
+If you want to view the topic, click the following link:
+{U_VIEW_TOPIC}
+
+{EMAIL_SIG}
diff --git a/phpBB/language/en/email/short/topic_disapproved.txt b/phpBB/language/en/email/short/topic_disapproved.txt
new file mode 100644
index 0000000000..9c821e2bba
--- /dev/null
+++ b/phpBB/language/en/email/short/topic_disapproved.txt
@@ -0,0 +1,11 @@
+Subject: Topic disapproved - "{TOPIC_TITLE}"
+
+Hello {USERNAME},
+
+You are receiving this notification because your topic "{TOPIC_TITLE}" at "{SITENAME}" was disapproved by a moderator or administrator.
+
+The following reason was given for the disapproval:
+
+{REASON}
+
+{EMAIL_SIG}
diff --git a/phpBB/language/en/email/short/topic_in_queue.txt b/phpBB/language/en/email/short/topic_in_queue.txt
new file mode 100644
index 0000000000..706dddf64f
--- /dev/null
+++ b/phpBB/language/en/email/short/topic_in_queue.txt
@@ -0,0 +1,13 @@
+Subject: Topic moderation notification - "{TOPIC_TITLE}"
+
+Hello {USERNAME},
+
+You are receiving this notification because the topic "{TOPIC_TITLE}" at "{SITENAME}" needs approval.
+
+If you want to view the topic, click the following link:
+{U_VIEW_TOPIC}
+
+If you want to view the forum, click the following link:
+{U_FORUM}
+
+{EMAIL_SIG}
diff --git a/phpBB/language/en/email/short/topic_notify.txt b/phpBB/language/en/email/short/topic_notify.txt
new file mode 100644
index 0000000000..b1ed65727c
--- /dev/null
+++ b/phpBB/language/en/email/short/topic_notify.txt
@@ -0,0 +1,20 @@
+Subject: Topic reply notification - "{TOPIC_TITLE}"
+
+Hello {USERNAME},
+
+You are receiving this notification because you are watching the topic "{TOPIC_TITLE}" at "{SITENAME}". This topic has received a reply<!-- IF AUTHOR_NAME != '' --> by {AUTHOR_NAME}<!-- ENDIF --> since your last visit. You can use the following link to view the replies made, no more notifications will be sent until you visit the topic.
+
+If you want to view the newest post made since your last visit, click the following link:
+{U_NEWEST_POST}
+
+If you want to view the topic, click the following link:
+{U_TOPIC}
+
+If you want to view the forum, click the following link:
+{U_FORUM}
+
+If you no longer wish to watch this topic you can either click the "Unsubscribe topic" link found at the bottom of the topic above, or by clicking the following link:
+
+{U_STOP_WATCHING_TOPIC}
+
+{EMAIL_SIG}
diff --git a/phpBB/language/en/email/topic_approved.txt b/phpBB/language/en/email/topic_approved.txt
index ffda378d30..60c7ef4c09 100644
--- a/phpBB/language/en/email/topic_approved.txt
+++ b/phpBB/language/en/email/topic_approved.txt
@@ -7,5 +7,4 @@ You are receiving this notification because your topic "{TOPIC_TITLE}" at "{SITE
If you want to view the topic, click the following link:
{U_VIEW_TOPIC}
-
-{EMAIL_SIG} \ No newline at end of file
+{EMAIL_SIG}
diff --git a/phpBB/language/en/email/topic_disapproved.txt b/phpBB/language/en/email/topic_disapproved.txt
index 49ef58bf39..9c821e2bba 100644
--- a/phpBB/language/en/email/topic_disapproved.txt
+++ b/phpBB/language/en/email/topic_disapproved.txt
@@ -8,5 +8,4 @@ The following reason was given for the disapproval:
{REASON}
-
-{EMAIL_SIG} \ No newline at end of file
+{EMAIL_SIG}
diff --git a/phpBB/language/en/email/topic_in_queue.txt b/phpBB/language/en/email/topic_in_queue.txt
new file mode 100644
index 0000000000..706dddf64f
--- /dev/null
+++ b/phpBB/language/en/email/topic_in_queue.txt
@@ -0,0 +1,13 @@
+Subject: Topic moderation notification - "{TOPIC_TITLE}"
+
+Hello {USERNAME},
+
+You are receiving this notification because the topic "{TOPIC_TITLE}" at "{SITENAME}" needs approval.
+
+If you want to view the topic, click the following link:
+{U_VIEW_TOPIC}
+
+If you want to view the forum, click the following link:
+{U_FORUM}
+
+{EMAIL_SIG}
diff --git a/phpBB/language/en/email/topic_notify.txt b/phpBB/language/en/email/topic_notify.txt
index f52ce9395d..20b86ee729 100644
--- a/phpBB/language/en/email/topic_notify.txt
+++ b/phpBB/language/en/email/topic_notify.txt
@@ -2,7 +2,7 @@ Subject: Topic reply notification - "{TOPIC_TITLE}"
Hello {USERNAME},
-You are receiving this notification because you are watching the topic "{TOPIC_TITLE}" at "{SITENAME}". This topic has received a reply<!-- IF AUTHOR_NAME !== '' --> by {AUTHOR_NAME}<!-- ENDIF --> since your last visit. No more notifications will be sent until you visit the topic.
+You are receiving this notification because you are watching the topic "{TOPIC_TITLE}" at "{SITENAME}". This topic has received a reply<!-- IF AUTHOR_NAME != '' --> by {AUTHOR_NAME}<!-- ENDIF --> since your last visit. No more notifications will be sent until you visit the topic.
If you want to view the newest post made since your last visit, click the following link:
{U_NEWEST_POST}
@@ -16,4 +16,4 @@ If you want to view the forum, click the following link:
If you no longer wish to watch this topic you can either click the "Unsubscribe topic" link found at the bottom of the topic above, or by clicking the following link:
{U_STOP_WATCHING_TOPIC}
-{EMAIL_SIG} \ No newline at end of file
+{EMAIL_SIG}
diff --git a/phpBB/language/en/email/user_activate.txt b/phpBB/language/en/email/user_activate.txt
index 7d7960c4c5..b949b68651 100644
--- a/phpBB/language/en/email/user_activate.txt
+++ b/phpBB/language/en/email/user_activate.txt
@@ -6,4 +6,4 @@ Your account on "{SITENAME}" has been deactivated, most likely due to changes ma
{U_ACTIVATE}
-{EMAIL_SIG} \ No newline at end of file
+{EMAIL_SIG}
diff --git a/phpBB/language/en/email/user_activate_inactive.txt b/phpBB/language/en/email/user_activate_inactive.txt
index a90773d48c..7743420698 100644
--- a/phpBB/language/en/email/user_activate_inactive.txt
+++ b/phpBB/language/en/email/user_activate_inactive.txt
@@ -4,4 +4,4 @@ Hello {USERNAME},
Your account on "{SITENAME}" has been deactivated, most likely due to changes made to your profile. The administrator of the board will need to activate it before you can log in. You will receive another notification when this has occurred.
-{EMAIL_SIG} \ No newline at end of file
+{EMAIL_SIG}
diff --git a/phpBB/language/en/email/user_activate_passwd.txt b/phpBB/language/en/email/user_activate_passwd.txt
index 695be115f8..965d5a552c 100644
--- a/phpBB/language/en/email/user_activate_passwd.txt
+++ b/phpBB/language/en/email/user_activate_passwd.txt
@@ -14,4 +14,4 @@ Password: {PASSWORD}
You can of course change this password yourself via the profile page. If you have any difficulties please contact the board administrator.
-{EMAIL_SIG} \ No newline at end of file
+{EMAIL_SIG}
diff --git a/phpBB/language/en/email/user_reactivate_account.txt b/phpBB/language/en/email/user_reactivate_account.txt
index 4ef7dd899a..7564b0a8e4 100644
--- a/phpBB/language/en/email/user_reactivate_account.txt
+++ b/phpBB/language/en/email/user_reactivate_account.txt
@@ -3,7 +3,7 @@ Subject: Reactivate your account on "{SITENAME}"
A board administrator requested that your account be reactivated. Your account is currently inactive.
Please follow the steps listed here to reactivate your account.
-Please keep this e-mail for your records. Your account information is as follows:
+Please keep this email for your records. Your account information is as follows:
----------------------------
Username: {USERNAME}
@@ -15,5 +15,4 @@ Please visit the following link to reactivate your account:
{U_ACTIVATE}
-
-{EMAIL_SIG} \ No newline at end of file
+{EMAIL_SIG}
diff --git a/phpBB/language/en/email/user_remind_inactive.txt b/phpBB/language/en/email/user_remind_inactive.txt
index 1ba28329f6..1f136b56f2 100644
--- a/phpBB/language/en/email/user_remind_inactive.txt
+++ b/phpBB/language/en/email/user_remind_inactive.txt
@@ -8,4 +8,4 @@ This notification is a reminder that your account at "{SITENAME}", created on {R
Thank you for registering at "{SITENAME}", we look forward to your participation.
-{EMAIL_SIG} \ No newline at end of file
+{EMAIL_SIG}
diff --git a/phpBB/language/en/email/user_resend_inactive.txt b/phpBB/language/en/email/user_resend_inactive.txt
index 4638d6df63..d975a07b13 100644
--- a/phpBB/language/en/email/user_resend_inactive.txt
+++ b/phpBB/language/en/email/user_resend_inactive.txt
@@ -2,7 +2,7 @@ Subject: Welcome to "{SITENAME}"
{WELCOME_MSG}
-Please keep this e-mail for your records. Your account information is as follows:
+Please keep this email for your records. Your account information is as follows:
----------------------------
Username: {USERNAME}
@@ -14,7 +14,6 @@ Please visit the following link in order to activate your account:
{U_ACTIVATE}
-
Thank you for registering.
-{EMAIL_SIG} \ No newline at end of file
+{EMAIL_SIG}
diff --git a/phpBB/language/en/email/user_welcome.txt b/phpBB/language/en/email/user_welcome.txt
index 2648769dfd..f299b7b23e 100644
--- a/phpBB/language/en/email/user_welcome.txt
+++ b/phpBB/language/en/email/user_welcome.txt
@@ -2,7 +2,7 @@ Subject: Welcome to "{SITENAME}"
{WELCOME_MSG}
-Please keep this e-mail for your records. Your account information is as follows:
+Please keep this email for your records. Your account information is as follows:
----------------------------
Username: {USERNAME}
@@ -14,4 +14,4 @@ Your password has been securely stored in our database and cannot be retrieved.
Thank you for registering.
-{EMAIL_SIG} \ No newline at end of file
+{EMAIL_SIG}
diff --git a/phpBB/language/en/email/user_welcome_inactive.txt b/phpBB/language/en/email/user_welcome_inactive.txt
index 1b72b1c5a8..b4300d0032 100644
--- a/phpBB/language/en/email/user_welcome_inactive.txt
+++ b/phpBB/language/en/email/user_welcome_inactive.txt
@@ -2,7 +2,7 @@ Subject: Welcome to "{SITENAME}"
{WELCOME_MSG}
-Please keep this e-mail for your records. Your account information is as follows:
+Please keep this email for your records. Your account information is as follows:
----------------------------
Username: {USERNAME}
@@ -18,4 +18,4 @@ Your password has been securely stored in our database and cannot be retrieved.
Thank you for registering.
-{EMAIL_SIG} \ No newline at end of file
+{EMAIL_SIG}
diff --git a/phpBB/language/en/groups.php b/phpBB/language/en/groups.php
index 9f72d4070f..6d25fea247 100644
--- a/phpBB/language/en/groups.php
+++ b/phpBB/language/en/groups.php
@@ -1,12 +1,13 @@
<?php
/**
*
-* groups [English]
+* This file is part of the phpBB Forum Software package.
*
-* @package language
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -82,7 +83,7 @@ $lang = array_merge($lang, array(
'NOT_LEADER_OF_GROUP' => 'The requested operation cannot be taken because you are not a leader of the selected group.',
'NOT_MEMBER_OF_GROUP' => 'The requested operation cannot be taken because you are not a member of the selected group or your membership has not been approved yet.',
'NOT_RESIGN_FROM_DEFAULT_GROUP' => 'You are not allowed to resign from your default group.',
-
+
'PRIMARY_GROUP' => 'Primary group',
'REMOVE_SELECTED' => 'Remove selected',
@@ -92,5 +93,3 @@ $lang = array_merge($lang, array(
'USER_GROUP_DEMOTE_CONFIRM' => 'Are you sure you want to demote as group leader from the selected group?',
'USER_GROUP_DEMOTED' => 'Successfully demoted your leadership.',
));
-
-?> \ No newline at end of file
diff --git a/phpBB/language/en/help_bbcode.php b/phpBB/language/en/help_bbcode.php
index df5f950e3e..800ce3dfb7 100644
--- a/phpBB/language/en/help_bbcode.php
+++ b/phpBB/language/en/help_bbcode.php
@@ -1,12 +1,13 @@
<?php
/**
*
-* help_bbcode [English]
+* This file is part of the phpBB Forum Software package.
*
-* @package language
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -72,11 +73,11 @@ $help = array(
),
array(
0 => 'Creating an Unordered list',
- 1 => '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 <strong>[list][/list]</strong> and define each item within the list using <strong>[*]</strong>. For example to list your favourite colours you could use:<br /><br /><strong>[list]</strong><br /><strong>[*]</strong>Red<br /><strong>[*]</strong>Blue<br /><strong>[*]</strong>Yellow<br /><strong>[/list]</strong><br /><br />This would generate the following list:<ul><li>Red</li><li>Blue</li><li>Yellow</li></ul>'
+ 1 => '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 <strong>[list][/list]</strong> and define each item within the list using <strong>[*]</strong>. For example to list your favourite colours you could use:<br /><br /><strong>[list]</strong><br /><strong>[*]</strong>Red<br /><strong>[*]</strong>Blue<br /><strong>[*]</strong>Yellow<br /><strong>[/list]</strong><br /><br />This would generate the following list:<ul><li>Red</li><li>Blue</li><li>Yellow</li></ul><br />Alternatively you can specify the list’s bullet style using <strong>[list=disc][/list]</strong>, <strong>[list=circle][/list]</strong>, or <strong>[list=square][/list]</strong>.'
),
array(
0 => 'Creating an Ordered list',
- 1 => '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 <strong>[list=1][/list]</strong> to create a numbered list or alternatively <strong>[list=a][/list]</strong> for an alphabetical list. As with the unordered list, items are specified using <strong>[*]</strong>. For example:<br /><br /><strong>[list=1]</strong><br /><strong>[*]</strong>Go to the shops<br /><strong>[*]</strong>Buy a new computer<br /><strong>[*]</strong>Swear at computer when it crashes<br /><strong>[/list]</strong><br /><br />will generate the following:<ol style="list-style-type: decimal;"><li>Go to the shops</li><li>Buy a new computer</li><li>Swear at computer when it crashes</li></ol>Whereas for an alphabetical list you would use:<br /><br /><strong>[list=a]</strong><br /><strong>[*]</strong>The first possible answer<br /><strong>[*]</strong>The second possible answer<br /><strong>[*]</strong>The third possible answer<br /><strong>[/list]</strong><br /><br />giving<ol style="list-style-type: lower-alpha"><li>The first possible answer</li><li>The second possible answer</li><li>The third possible answer</li></ol>'
+ 1 => '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 <strong>[list=1][/list]</strong> to create a numbered list or alternatively <strong>[list=a][/list]</strong> for an alphabetical list. As with the unordered list, items are specified using <strong>[*]</strong>. For example:<br /><br /><strong>[list=1]</strong><br /><strong>[*]</strong>Go to the shops<br /><strong>[*]</strong>Buy a new computer<br /><strong>[*]</strong>Swear at computer when it crashes<br /><strong>[/list]</strong><br /><br />will generate the following:<ol style="list-style-type: decimal;"><li>Go to the shops</li><li>Buy a new computer</li><li>Swear at computer when it crashes</li></ol>Whereas for an alphabetical list you would use:<br /><br /><strong>[list=a]</strong><br /><strong>[*]</strong>The first possible answer<br /><strong>[*]</strong>The second possible answer<br /><strong>[*]</strong>The third possible answer<br /><strong>[/list]</strong><br /><br />giving<ol style="list-style-type: lower-alpha"><li>The first possible answer</li><li>The second possible answer</li><li>The third possible answer</li></ol><br /><strong>[list=A]</strong><br /><strong>[*]</strong>The first possible answer<br /><strong>[*]</strong>The second possible answer<br /><strong>[*]</strong>The third possible answer<br /><strong>[/list]</strong><br /><br />giving<ol style="list-style-type: upper-alpha"><li>The first possible answer</li><li>The second possible answer</li><li>The third possible answer</li></ol><br /><strong>[list=i]</strong><br /><strong>[*]</strong>The first possible answer<br /><strong>[*]</strong>The second possible answer<br /><strong>[*]</strong>The third possible answer<br /><strong>[/list]</strong><br /><br />giving<ol style="list-style-type: lower-roman"><li>The first possible answer</li><li>The second possible answer</li><li>The third possible answer</li></ol><br /><strong>[list=I]</strong><br /><strong>[*]</strong>The first possible answer<br /><strong>[*]</strong>The second possible answer<br /><strong>[*]</strong>The third possible answer<br /><strong>[/list]</strong><br /><br />giving<ol style="list-style-type: upper-roman"><li>The first possible answer</li><li>The second possible answer</li><li>The third possible answer</li></ol>'
),
// This block will switch the FAQ-Questions to the second template column
array(
@@ -89,7 +90,7 @@ $help = array(
),
array(
0 => 'Linking to another site',
- 1 => 'phpBB BBCode supports a number of ways of creating URIs (Uniform Resource Indicators) better known as URLs.<ul><li>The first of these uses the <strong>[url=][/url]</strong> 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:<br /><br /><strong>[url=http://www.phpbb.com/]</strong>Visit phpBB!<strong>[/url]</strong><br /><br />This would generate the following link, <a href="http://www.phpbb.com/">Visit phpBB!</a> Please notice that the link opens in the same window or a new window depending on the users browser preferences.</li><li>If you want the URL itself displayed as the link you can do this by simply using:<br /><br /><strong>[url]</strong>http://www.phpbb.com/<strong>[/url]</strong><br /><br />This would generate the following link, <a href="http://www.phpbb.com/">http://www.phpbb.com/</a></li><li>Additionally, phpBB features something called <i>Magic Links</i>, 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 <a href="http://www.phpbb.com/">www.phpbb.com</a> being output when you view the message.</li><li>The same thing applies equally to e-mail addresses, you can either specify an address explicitly for example:<br /><br /><strong>[email]</strong>no.one@domain.adr<strong>[/email]</strong><br /><br />which will output <a href="mailto:no.one@domain.adr">no.one@domain.adr</a> or you can just type no.one@domain.adr into your message and it will be automatically converted when you view.</li></ul>As with all the BBCode tags you can wrap URLs around any of the other tags such as <strong>[img][/img]</strong> (see next entry), <strong>[b][/b]</strong>, etc. As with the formatting tags it is up to you to ensure the correct open and close order is following, for example:<br /><br /><strong>[url=http://www.google.com/][img]</strong>http://www.google.com/intl/en_ALL/images/logo.gif<strong>[/url][/img]</strong><br /><br />is <span style="text-decoration: underline">not</span> correct which may lead to your post being deleted so take care.'
+ 1 => 'phpBB BBCode supports a number of ways of creating URIs (Uniform Resource Indicators) better known as URLs.<ul><li>The first of these uses the <strong>[url=][/url]</strong> 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:<br /><br /><strong>[url=https://www.phpbb.com/]</strong>Visit phpBB!<strong>[/url]</strong><br /><br />This would generate the following link, <a href="https://www.phpbb.com/">Visit phpBB!</a> Please notice that the link opens in the same window or a new window depending on the users browser preferences.</li><li>If you want the URL itself displayed as the link you can do this by simply using:<br /><br /><strong>[url]</strong>https://www.phpbb.com/<strong>[/url]</strong><br /><br />This would generate the following link, <a href="https://www.phpbb.com/">https://www.phpbb.com/</a></li><li>Additionally, phpBB features something called <i>Magic Links</i>, 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 <a href="http://www.phpbb.com/">www.phpbb.com</a> being output when you view the message.</li><li>The same thing applies equally to email addresses, you can either specify an address explicitly for example:<br /><br /><strong>[email]</strong>no.one@domain.adr<strong>[/email]</strong><br /><br />which will output <a href="mailto:no.one@domain.adr">no.one@domain.adr</a> or you can just type no.one@domain.adr into your message and it will be automatically converted when you view.</li></ul>As with all the BBCode tags you can wrap URLs around any of the other tags such as <strong>[img][/img]</strong> (see next entry), <strong>[b][/b]</strong>, etc. As with the formatting tags it is up to you to ensure the correct open and close order is following, for example:<br /><br /><strong>[url=https://www.phpbb.com/][img]</strong>https://www.phpbb.com/theme/images/logos/blue/160x52.png<strong>[/url][/img]</strong><br /><br />is <span style="text-decoration: underline">not</span> correct which may lead to your post being deleted so take care.'
),
array(
0 => '--',
@@ -97,7 +98,7 @@ $help = array(
),
array(
0 => 'Adding an image to a post',
- 1 => '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 <strong>[img][/img]</strong> tags. For example:<br /><br /><strong>[img]</strong>http://www.google.com/intl/en_ALL/images/logo.gif<strong>[/img]</strong><br /><br />As noted in the URL section above you can wrap an image in a <strong>[url][/url]</strong> tag if you wish, e.g.<br /><br /><strong>[url=http://www.google.com/][img]</strong>http://www.google.com/intl/en_ALL/images/logo.gif<strong>[/img][/url]</strong><br /><br />would generate:<br /><br /><a href="http://www.google.com/"><img src="http://www.google.com/intl/en_ALL/images/logo.gif" alt="" /></a>'
+ 1 => '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 <strong>[img][/img]</strong> tags. For example:<br /><br /><strong>[img]</strong>https://www.phpbb.com/theme/images/logos/blue/160x52.png<strong>[/img]</strong><br /><br />As noted in the URL section above you can wrap an image in a <strong>[url][/url]</strong> tag if you wish, e.g.<br /><br /><strong>[url=https://www.phpbb.com/][img]</strong>https://www.phpbb.com/theme/images/logos/blue/160x52.png<strong>[/img][/url]</strong><br /><br />would generate:<br /><br /><a href="https://www.phpbb.com/"><img src="https://www.phpbb.com/theme/images/logos/blue/160x52.png" alt="" /></a>'
),
array(
0 => 'Adding attachments into a post',
@@ -110,7 +111,5 @@ $help = array(
array(
0 => 'Can I add my own tags?',
1 => 'If you are an administrator on this board and have the proper permissions, you can add further BBCodes through the Custom BBCodes section.'
- )
+ ),
);
-
-?> \ No newline at end of file
diff --git a/phpBB/language/en/help_faq.php b/phpBB/language/en/help_faq.php
index b68336e0f7..8f08ac1cd3 100644
--- a/phpBB/language/en/help_faq.php
+++ b/phpBB/language/en/help_faq.php
@@ -1,12 +1,13 @@
<?php
/**
*
-* help_faq [English]
+* This file is part of the phpBB Forum Software package.
*
-* @package language
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -35,44 +36,40 @@ $help = array(
1 => 'Login and Registration Issues'
),
array(
- 0 => 'Why can’t I login?',
- 1 => 'There are several reasons why this could occur. First, ensure your username and password are correct. If they are, contact the board owner 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.'
- ),
- array(
- 0 => 'Why do I need to register at all?',
+ 0 => 'Why do I need to register?',
1 => '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.'
),
array(
- 0 => 'Why do I get logged off automatically?',
- 1 => 'If you do not check the <em>Log me in automatically</em> 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 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 the board administrator has disabled this feature.'
+ 0 => 'What is COPPA?',
+ 1 => '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?”.',
),
array(
- 0 => 'How do I prevent my username appearing in the online user listings?',
- 1 => 'Within your User Control Panel, under “Board preferences”, you will find the option <em>Hide your online status</em>. Enable this option with <samp>Yes</samp> and you will only appear to the administrators, moderators and yourself. You will be counted as a hidden user.'
+ 0 => 'Why can’t I register?',
+ 1 => '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.',
),
array(
- 0 => 'I’ve lost my password!',
- 1 => 'Don’t panic! While your password cannot be retrieved, it can easily be reset. Visit the login page and click <em>I’ve forgotten my password</em>. Follow the instructions and you should be able to log in again shortly.'
+ 0 => 'I registered but cannot login!',
+ 1 => '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.'
),
array(
- 0 => 'I registered but cannot login!',
- 1 => '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 e-mail, follow the instructions. If you did not receive an e-mail, you may have provided an incorrect e-mail address or the e-mail may have been picked up by a spam filer. If you are sure the e-mail address you provided is correct, try contacting an administrator.'
+ 0 => 'Why can’t I login?',
+ 1 => '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.',
),
array(
0 => 'I registered in the past but cannot login any more?!',
1 => '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.'
),
array(
- 0 => 'What is COPPA?',
- 1 => 'COPPA, or the Child Online Privacy and 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 the phpBB Group cannot provide legal advice and is not a point of contact for legal concerns of any kind, except as outlined below.',
+ 0 => 'I’ve lost my password!',
+ 1 => 'Don’t panic! While your password cannot be retrieved, it can easily be reset. Visit the login page and click <em>I forgot my password</em>. Follow the instructions and you should be able to log in again shortly.<br />However, if you are not able to reset your password, contact a board administrator.',
),
array(
- 0 => 'Why can’t I register?',
- 1 => 'It is possible the website owner has banned your IP address or disallowed the username you are attempting to register. The website owner could have also disabled registration to prevent new visitors from signing up. Contact a board administrator for assistance.',
+ 0 => 'Why do I get logged off automatically?',
+ 1 => 'If you do not check the <em>Remember me</em> 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 <em>Remember me</em> 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.',
),
array(
0 => 'What does the “Delete all board cookies” do?',
- 1 => '“Delete all board cookies” deletes the cookies created by phpBB which keep you authenticated and logged into the board. It also provides functions such as read tracking if they have been enabled by the board owner. If you are having login or logout problems, deleting board cookies may help.',
+ 1 => '“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.',
),
array(
0 => '--',
@@ -80,7 +77,11 @@ $help = array(
),
array(
0 => 'How do I change my settings?',
- 1 => '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 at the top of board pages. This system will allow you to change all your settings and preferences.'
+ 1 => '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.',
+ ),
+ array(
+ 0 => 'How do I prevent my username appearing in the online user listings?',
+ 1 => 'Within your User Control Panel, under “Board preferences”, you will find the option <em>Hide your online status</em>. Enable this option and you will only appear to the administrators, moderators and yourself. You will be counted as a hidden user.'
),
array(
0 => 'The times are not correct!',
@@ -88,31 +89,35 @@ $help = array(
),
array(
0 => 'I changed the timezone and the time is still wrong!',
- 1 => 'If you are sure you have set the timezone and Summer Time/DST 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.'
+ 1 => '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.'
),
array(
0 => 'My language is not in the list!',
- 1 => 'Either the administrator has not installed your language or nobody has translated this board into your language. Try asking the 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 (see link at the bottom of board pages).'
+ 1 => '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 <a href="https://www.phpbb.com/">phpBB</a>&reg; website.',
+ ),
+ array(
+ 0 => 'What are the images next to my username?',
+ 1 => '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.',
),
array(
- 0 => 'How do I show an image along with my username?',
- 1 => '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 a larger image, is known as an avatar and is generally unique or personal to each user. 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 and ask them for their reasons.'
+ 0 => 'How do I display an avatar?',
+ 1 => '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.',
),
array(
0 => 'What is my rank and how do I change it?',
1 => '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.'
),
array(
- 0 => 'When I click the e-mail link for a user it asks me to login?',
- 1 => 'Only registered users can send e-mail to other users via the built-in e-mail form, and only if the administrator has enabled this feature. This is to prevent malicious use of the e-mail system by anonymous users.'
+ 0 => 'When I click the email link for a user it asks me to login?',
+ 1 => '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.'
),
array(
0 => '--',
1 => 'Posting Issues'
),
array(
- 0 => 'How do I post a topic in a forum?',
- 1 => 'To post a new topic in a forum, click the relevant button on either the forum or topic screens. 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 vote in polls, etc.'
+ 0 => 'How do I create a new topic or post a reply?',
+ 1 => '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.',
),
array(
0 => 'How do I edit or delete a post?',
@@ -120,7 +125,7 @@ $help = array(
),
array(
0 => 'How do I add a signature to my post?',
- 1 => 'To add a signature to a post you must first create one via your User Control Panel. Once created, you can check the <em>Attach a signature</em> 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 your profile. 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.'
+ 1 => 'To add a signature to a post you must first create one via your User Control Panel. Once created, you can check the <em>Attach a signature</em> 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.'
),
array(
0 => 'How do I create a poll?',
@@ -144,7 +149,7 @@ $help = array(
),
array(
0 => 'Why did I receive a warning?',
- 1 => '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 Group 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.'
+ 1 => '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.'
),
array(
0 => 'How can I report posts to a moderator?',
@@ -152,7 +157,7 @@ $help = array(
),
array(
0 => 'What is the “Save” button for in topic posting?',
- 1 => 'This allows you to save passages to be completed and submitted at a later date. To reload a saved passage, visit the User Control Panel.'
+ 1 => '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.'
),
array(
0 => 'Why does my post need to be approved?',
@@ -253,11 +258,11 @@ $help = array(
),
array(
0 => 'I keep getting unwanted private messages!',
- 1 => 'You can block a user from sending you private messages by using message rules within your User Control Panel. If you are receiving abusive private messages from a particular user, inform a board administrator; they have the power to prevent a user from sending private messages.'
+ 1 => '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.'
),
array(
- 0 => 'I have received a spamming or abusive e-mail from someone on this board!',
- 1 => 'We are sorry to hear that. The e-mail form feature of this board includes safeguards to try and track users who send such posts, so e-mail the board administrator with a full copy of the e-mail you received. It is very important that this includes the headers that contain the details of the user that sent the e-mail. The board administrator can then take action.'
+ 0 => 'I have received a spamming or abusive email from someone on this board!',
+ 1 => '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.'
),
array(
0 => '--',
@@ -281,7 +286,7 @@ $help = array(
),
array(
0 => 'Why does my search return no results?',
- 1 => 'Your search was probably too vague and included many common terms which are not indexed by phpBB3. Be more specific and use the options available within Advanced search.'
+ 1 => '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.',
),
array(
0 => 'Why does my search return a blank page!?',
@@ -293,19 +298,23 @@ $help = array(
),
array(
0 => 'How can I find my own posts and topics?',
- 1 => 'Your own posts can be retrieved either by clicking the “Search user’s posts” within the User Control Panel or via your own profile page. To search for your topics, use the Advanced search page and fill in the various options appropriately.'
+ 1 => '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.',
),
array(
0 => '--',
- 1 => 'Topic Subscriptions and Bookmarks'
+ 1 => 'Subscriptions and Bookmarks',
),
array(
0 => 'What is the difference between bookmarking and subscribing?',
- 1 => 'Bookmarking in phpBB3 is much like bookmarking in your web browser. You aren’t alerted when there’s an update, but you can come back to the topic later. Subscribing, however, will notify you when there is an update to the topic or forum on the board via your preferred method or methods.'
+ 1 => '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”.',
),
array(
- 0 => 'How do I subscribe to specific forums or topics?',
- 1 => 'To subscribe to a specific forum, click the “Subscribe forum” link upon entering the forum. To subscribe to a topic, reply to the topic with the subscribe checkbox checked or click the “Subscribe topic” link within the topic itself.'
+ 0 => 'How do I bookmark or subscribe to specific topics?',
+ 1 => '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.<br />Replying to a topic with the “Notify me when a reply is posted” option checked will also subscribe you to the topic.',
+ ),
+ array(
+ 0 => 'How do I subscribe to specific forums?',
+ 1 => 'To subscribe to a specific forum, click the “Subscribe forum” link, at the bottom of page, upon entering the forum.',
),
array(
0 => 'How do I remove my subscriptions?',
@@ -325,20 +334,22 @@ $help = array(
),
array(
0 => '--',
- 1 => 'phpBB 3 Issues'
+ 1 => 'phpBB Issues',
),
array(
0 => 'Who wrote this bulletin board?',
- 1 => 'This software (in its unmodified form) is produced, released and is copyright <a href="https://www.phpbb.com/">phpBB Group</a>. It is made available under the GNU General Public License and may be freely distributed. See the link for more details.'
+ 1 => 'This software (in its unmodified form) is produced, released and is copyright <a href="https://www.phpbb.com/">phpBB Limited</a>. It is made available under the GNU General Public License, version 2 (GPL-2.0) and may be freely distributed. See <a href="https://www.phpbb.com/about/">About phpBB</a> for more details.',
),
array(
0 => 'Why isn’t X feature available?',
- 1 => 'This software was written by and licensed through phpBB Group. If you believe a feature needs to be added please visit the <a href="https://www.phpbb.com/ideas/">phpBB Ideas Centre</a>, where you can upvote existing ideas or suggest new features.'
+ 1 => 'This software was written by and licensed through phpBB Limited. If you believe a feature needs to be added please visit the <a href="https://www.phpbb.com/ideas/">phpBB Ideas Centre</a>, where you can upvote existing ideas or suggest new features.'
),
array(
0 => 'Who do I contact about abusive and/or legal matters related to this board?',
- 1 => '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 <a href="http://www.google.com/search?q=whois">whois lookup</a>) 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 Group has <strong>absolutely no jurisdiction</strong> and cannot in any way be held liable over how, where or by whom this board is used. Do not contact the phpBB Group in relation to any legal (cease and desist, liable, defamatory comment, etc.) matter <strong>not directly related</strong> to the phpBB.com website or the discrete software of phpBB itself. If you do e-mail phpBB Group <strong>about any third party</strong> use of this software then you should expect a terse response or no response at all.'
- )
+ 1 => '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 <a href="http://www.google.com/search?q=whois">whois lookup</a>) 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 <strong>absolutely no jurisdiction</strong> 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 <strong>not directly related</strong> to the phpBB.com website or the discrete software of phpBB itself. If you do email phpBB Limited <strong>about any third party</strong> use of this software then you should expect a terse response or no response at all.'
+ ),
+ array(
+ 0 => 'How do I contact a board administrator?',
+ 1 => 'All users of the board can use the “Contact us” form, if the option was enabled by the board administrator.<br />Members of the board can also use the “The team” link.',
+ ),
);
-
-?> \ No newline at end of file
diff --git a/phpBB/language/en/install.php b/phpBB/language/en/install.php
index 5055ac6a20..0460c0613e 100644
--- a/phpBB/language/en/install.php
+++ b/phpBB/language/en/install.php
@@ -1,12 +1,13 @@
<?php
/**
*
-* install [English]
+* This file is part of the phpBB Forum Software package.
*
-* @package language
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -43,7 +44,7 @@ $lang = array_merge($lang, array(
'ADMIN_TEST' => 'Check administrator settings',
'ADMIN_USERNAME' => 'Administrator username',
'ADMIN_USERNAME_EXPLAIN' => 'Please enter a username between 3 and 20 characters in length.',
- 'APP_MAGICK' => 'Imagemagick support [ Attachments ]',
+ 'APP_MAGICK' => 'ImageMagick support [ Attachments ]',
'AUTHOR_NOTES' => 'Author notes<br />» %s',
'AVAILABLE' => 'Available',
'AVAILABLE_CONVERTORS' => 'Available convertors',
@@ -73,14 +74,13 @@ $lang = array_merge($lang, array(
'CONFIG_FILE_WRITTEN' => 'The configuration file has been written. You may now proceed to the next step of the installation.',
'CONFIG_PHPBB_EMPTY' => 'The phpBB3 config variable for “%s” is empty.',
'CONFIG_RETRY' => 'Retry',
- 'CONTACT_EMAIL_CONFIRM' => 'Confirm contact e-mail',
'CONTINUE_CONVERT' => 'Continue conversion',
'CONTINUE_CONVERT_BODY' => 'A previous conversion attempt has been determined. You are now able to choose between starting a new conversion or continuing the conversion.',
'CONTINUE_LAST' => 'Continue last statements',
'CONTINUE_OLD_CONVERSION' => 'Continue previously started conversion',
'CONVERT' => 'Convert',
'CONVERT_COMPLETE' => 'Conversion completed',
- 'CONVERT_COMPLETE_EXPLAIN' => 'You have now successfully converted your board to phpBB 3.0. You can now login and <a href="../">access your board</a>. Please ensure that the settings were transferred correctly before enabling your board by deleting the install directory. Remember that help on using phpBB is available online via the <a href="https://www.phpbb.com/support/documentation/3.0/">Documentation</a> and the <a href="https://www.phpbb.com/community/viewforum.php?f=46">support forums</a>.',
+ 'CONVERT_COMPLETE_EXPLAIN' => 'You have now successfully converted your board to phpBB 3.1. You can now login and <a href="../">access your board</a>. Please ensure that the settings were transferred correctly before enabling your board by deleting the install directory. Remember that help on using phpBB is available online via the <a href="https://www.phpbb.com/support/docs/en/3.1/ug/">Documentation</a> and the <a href="https://www.phpbb.com/community/viewforum.php?f=466">support forums</a>.',
'CONVERT_INTRO' => 'Welcome to the phpBB Unified Convertor Framework',
'CONVERT_INTRO_BODY' => 'From here, you are able to import data from other (installed) board systems. The list below shows all the conversion modules currently available. If there is no convertor shown in this list for the board software you wish to convert from, please check our website where further conversion modules may be available for download.',
'CONVERT_NEW_CONVERSION' => 'New conversion',
@@ -142,7 +142,6 @@ $lang = array_merge($lang, array(
'DEV_NO_TEST_FILE' => 'No value has been specified for the test_file variable in the convertor. If you are a user of this convertor, you should not be seeing this error, please report this message to the convertor author. If you are a convertor author, you must specify the name of a file which exists in the source board to allow the path to it to be verified.',
'DIRECTORIES_AND_FILES' => 'Directory and file setup',
'DISABLE_KEYS' => 'Disabling keys',
- 'DLL_FIREBIRD' => 'Firebird',
'DLL_FTP' => 'Remote FTP support [ Installation ]',
'DLL_GD' => 'GD graphics support [ Visual Confirmation ]',
'DLL_MBSTRING' => 'Multi-byte character support',
@@ -153,11 +152,12 @@ $lang = array_merge($lang, array(
'DLL_MYSQLI' => 'MySQL with MySQLi Extension',
'DLL_ORACLE' => 'Oracle',
'DLL_POSTGRES' => 'PostgreSQL',
- 'DLL_SQLITE' => 'SQLite',
+ 'DLL_SQLITE' => 'SQLite 2',
+ 'DLL_SQLITE3' => 'SQLite 3',
'DLL_XML' => 'XML support [ Jabber ]',
'DLL_ZLIB' => 'zlib compression support [ gz, .tar.gz, .zip ]',
'DL_CONFIG' => 'Download config',
- 'DL_CONFIG_EXPLAIN' => 'You may download the complete config.php to your own PC. You will then need to upload the file manually, replacing any existing config.php in your phpBB 3.0 root directory. Please remember to upload the file in ASCII format (see your FTP application documentation if you are unsure how to achieve this). When you have uploaded the config.php please click “Done” to move to the next stage.',
+ 'DL_CONFIG_EXPLAIN' => 'You may download the complete config.php to your own PC. You will then need to upload the file manually, replacing any existing config.php in your phpBB 3.1 root directory. Please remember to upload the file in ASCII format (see your FTP application documentation if you are unsure how to achieve this). When you have uploaded the config.php please click “Done” to move to the next stage.',
'DL_DOWNLOAD' => 'Download',
'DONE' => 'Done',
@@ -170,8 +170,6 @@ $lang = array_merge($lang, array(
'FILLING_TABLE' => 'Filling table <strong>%s</strong>',
'FILLING_TABLES' => 'Filling tables',
- 'FIREBIRD_DBMS_UPDATE_REQUIRED' => 'phpBB no longer supports Firebird/Interbase prior to Version 2.1. Please update your Firebird installation to at least 2.1.0 before proceeding with the update.',
-
'FINAL_STEP' => 'Process final step',
'FORUM_ADDRESS' => 'Board address',
'FORUM_ADDRESS_EXPLAIN' => 'This is the URL of your former board, for example <samp>http://www.example.com/phpBB2/</samp>. If an address is entered here and not left empty every instance of this address will be replaced by your new board address within messages, private messages and signatures.',
@@ -194,7 +192,7 @@ $lang = array_merge($lang, array(
<h2>Convert an existing board to phpBB3</h2>
<p>The phpBB Unified Convertor Framework supports the conversion of phpBB 2.0.x and other board systems to phpBB3. If you have an existing board that you wish to convert, please <a href="%2$s">proceed to the convertor</a>.</p>
<h2>Go live with your phpBB3!</h2>
- <p>Clicking the button below will take you to a form for submitting statistical data to phpBB in your Administration Control Panel (ACP). We would appreciate it if you could help us by sending that information. Afterwards you should take some time to examine the options available to you. Remember that help is available online via the <a href="https://www.phpbb.com/support/documentation/3.0/">Documentation</a>, <a href="%3$s">README</a> and the <a href="https://www.phpbb.com/community/viewforum.php?f=46">Support Forums</a>.</p><p><strong>Please delete, move or rename the install directory before using your board. While this directory exists, only the Administration Control Panel (ACP) will be accessible.</strong>',
+ <p>Clicking the button below will take you to a form for submitting statistical data to phpBB in your Administration Control Panel (ACP). We would appreciate it if you could help us by sending that information. Afterwards you should take some time to examine the options available to you. Remember that help is available online via the <a href="https://www.phpbb.com/support/docs/en/3.1/ug/">Documentation</a>, <a href="%3$s">README</a> and the <a href="https://www.phpbb.com/community/viewforum.php?f=466">Support Forums</a>.</p><p><strong>Please delete, move or rename the install directory before using your board. While this directory exists, only the Administration Control Panel (ACP) will be accessible.</strong>',
'INSTALL_INTRO' => 'Welcome to Installation',
'INSTALL_INTRO_BODY' => 'With this option, it is possible to install phpBB3 onto your server.</p><p>In order to proceed, you will need your database settings. If you do not know your database settings, please contact your host and ask for them. You will not be able to continue without them. You need:</p>
@@ -212,9 +210,9 @@ $lang = array_merge($lang, array(
<p>phpBB3 supports the following databases:</p>
<ul>
<li>MySQL 3.23 or above (MySQLi supported)</li>
- <li>PostgreSQL 7.3+</li>
+ <li>PostgreSQL 8.3+</li>
<li>SQLite 2.8.2+</li>
- <li>Firebird 2.1+</li>
+ <li>SQLite 3.6.15+</li>
<li>MS SQL Server 2000 or above (directly or via ODBC)</li>
<li>MS SQL Server 2005 or above (native)</li>
<li>Oracle</li>
@@ -237,13 +235,12 @@ $lang = array_merge($lang, array(
'INST_ERR_DB_NO_ERROR' => 'No error message given.',
'INST_ERR_DB_NO_MYSQLI' => 'The version of MySQL installed on this machine is incompatible with the “MySQL with MySQLi Extension” option you have selected. Please try the “MySQL” option instead.',
'INST_ERR_DB_NO_SQLITE' => 'The version of the SQLite extension you have installed is too old, it must be upgraded to at least 2.8.2.',
+ 'INST_ERR_DB_NO_SQLITE3' => 'The version of the SQLite extension you have installed is too old, it must be upgraded to at least 3.6.15.',
'INST_ERR_DB_NO_ORACLE' => 'The version of Oracle installed on this machine requires you to set the <var>NLS_CHARACTERSET</var> parameter to <var>UTF8</var>. Either upgrade your installation to 9.2+ or change the parameter.',
- 'INST_ERR_DB_NO_FIREBIRD' => 'The version of Firebird installed on this machine is older than 2.1, please upgrade to a newer version.',
- 'INST_ERR_DB_NO_FIREBIRD_PS'=> 'The database you selected for Firebird has a page size less than 8192, it must be at least 8192.',
'INST_ERR_DB_NO_POSTGRES' => 'The database you have selected was not created in <var>UNICODE</var> or <var>UTF8</var> encoding. Try installing with a database in <var>UNICODE</var> or <var>UTF8</var> encoding.',
'INST_ERR_DB_NO_NAME' => 'No database name specified.',
- 'INST_ERR_EMAIL_INVALID' => 'The e-mail address you entered is invalid.',
- 'INST_ERR_EMAIL_MISMATCH' => 'The e-mails you entered did not match.',
+ 'INST_ERR_EMAIL_INVALID' => 'The email address you entered is invalid.',
+ 'INST_ERR_EMAIL_MISMATCH' => 'The emails you entered did not match.',
'INST_ERR_FATAL' => 'Fatal installation error',
'INST_ERR_FATAL_DB' => 'A fatal and unrecoverable database error has occurred. This may be because the specified user does not have appropriate permissions to <code>CREATE TABLES</code> or <code>INSERT</code> data, etc. Further information may be given below. Please contact your hosting provider in the first instance or the support forums of phpBB for further assistance.',
'INST_ERR_FTP_PATH' => 'Could not change to the given directory, please check the path.',
@@ -277,7 +274,7 @@ $lang = array_merge($lang, array(
'MAKE_FOLDER_WRITABLE' => 'Please make sure that this folder exists and is writable by the webserver then try again:<br />»<strong>%s</strong>.',
'MAKE_FOLDERS_WRITABLE' => 'Please make sure that these folders exist and are writable by the webserver then try again:<br />»<strong>%s</strong>.',
- 'MYSQL_SCHEMA_UPDATE_REQUIRED' => 'Your MySQL database schema for phpBB is outdated. phpBB detected a schema for MySQL 3.x/4.x, but the server runs on MySQL %2$s.<br /><strong>Before you proceed the update, you need to upgrade the schema.</strong><br /><br />Please refer to the <a href="https://www.phpbb.com/kb/article/doesnt-have-a-default-value-errors/">Knowledge Base article about upgrading the MySQL schema</a>. If you encounter problems, please use <a href="https://www.phpbb.com/community/viewforum.php?f=46">our support forums</a>.',
+ 'MYSQL_SCHEMA_UPDATE_REQUIRED' => 'Your MySQL database schema for phpBB is outdated. phpBB detected a schema for MySQL 3.x/4.x, but the server runs on MySQL %2$s.<br /><strong>Before you proceed the update, you need to upgrade the schema.</strong><br /><br />Please refer to the <a href="https://www.phpbb.com/kb/article/doesnt-have-a-default-value-errors/">Knowledge Base article about upgrading the MySQL schema</a>. If you encounter problems, please use <a href="https://www.phpbb.com/community/viewforum.php?f=466">our support forums</a>.',
'NAMING_CONFLICT' => 'Naming conflict: %s and %s are both aliases<br /><br />%s',
'NEXT_STEP' => 'Proceed to next step',
@@ -285,7 +282,7 @@ $lang = array_merge($lang, array(
'NOT_UNDERSTAND' => 'Could not understand %s #%d, table %s (“%s”)',
'NO_CONVERTORS' => 'No convertors are available for use.',
'NO_CONVERT_SPECIFIED' => 'No convertor specified.',
- 'NO_LOCATION' => 'Cannot determine location. If you know Imagemagick is installed, you may specify the location later within your administration control panel',
+ 'NO_LOCATION' => 'Cannot determine location. If you know ImageMagick is installed, you may specify the location later within your administration control panel',
'NO_TABLES_FOUND' => 'No tables found.',
'OVERVIEW_BODY' => 'Welcome to phpBB3!<br /><br />phpBB® is the most widely used open source bulletin board solution in the world. phpBB3 is the latest installment in a package line started in 2000. Like its predecessors, phpBB3 is feature-rich, user-friendly, and fully supported by the phpBB Team. phpBB3 greatly improves on what made phpBB2 popular, and adds commonly requested features that were not present in previous versions. We hope it exceeds your expectations.<br /><br />This installation system will guide you through installing phpBB3, updating to the latest version of phpBB3 from past releases, as well as converting to phpBB3 from a different discussion board system (including phpBB2). For more information, we encourage you to read <a href="../docs/INSTALL.html">the installation guide</a>.<br /><br />To read the phpBB3 license or learn about obtaining support and our stance on it, please select the respective options from the side menu. To continue, please select the appropriate tab above.',
@@ -294,6 +291,8 @@ $lang = array_merge($lang, array(
'PCRE_UTF_SUPPORT_EXPLAIN' => 'phpBB will <strong>not</strong> run if your PHP installation is not compiled with UTF-8 support in the PCRE extension.',
'PHP_GETIMAGESIZE_SUPPORT' => 'PHP function getimagesize() is available',
'PHP_GETIMAGESIZE_SUPPORT_EXPLAIN' => '<strong>Required</strong> - In order for phpBB to function correctly, the getimagesize function needs to be available.',
+ 'PHP_JSON_SUPPORT' => 'PHP JSON support',
+ 'PHP_JSON_SUPPORT_EXPLAIN' => '<strong>Required</strong> - In order for phpBB to function correctly, the PHP JSON extension needs to be available.',
'PHP_OPTIONAL_MODULE' => 'Optional modules',
'PHP_OPTIONAL_MODULE_EXPLAIN' => '<strong>Optional</strong> - These modules or applications are optional. However, if they are available they will enable extra features.',
'PHP_SUPPORTED_DB' => 'Supported databases',
@@ -302,10 +301,10 @@ $lang = array_merge($lang, array(
'PHP_REGISTER_GLOBALS_EXPLAIN' => 'phpBB will still run if this setting is enabled, but if possible, it is recommended that register_globals is disabled on your PHP install for security reasons.',
'PHP_SAFE_MODE' => 'Safe mode',
'PHP_SETTINGS' => 'PHP version and settings',
- 'PHP_SETTINGS_EXPLAIN' => '<strong>Required</strong> - You must be running at least version 4.3.3 of PHP in order to install phpBB. If <var>safe mode</var> is displayed below your PHP installation is running in that mode. This will impose limitations on remote administration and similar features.',
+ 'PHP_SETTINGS_EXPLAIN' => '<strong>Required</strong> - You must be running at least version 5.3.3 of PHP (PHP 7 is not supported) in order to install phpBB. If <var>safe mode</var> is displayed below your PHP installation is running in that mode. This will impose limitations on remote administration and similar features.',
'PHP_URL_FOPEN_SUPPORT' => 'PHP setting <var>allow_url_fopen</var> is enabled',
'PHP_URL_FOPEN_SUPPORT_EXPLAIN' => '<strong>Optional</strong> - This setting is optional, however certain phpBB functions like off-site avatars will not work properly without it.',
- 'PHP_VERSION_REQD' => 'PHP version >= 4.3.3',
+ 'PHP_VERSION_REQD' => 'PHP version: >= 5.3.3, < 7.0.0-dev',
'POST_ID' => 'Post ID',
'PREFIX_FOUND' => 'A scan of your tables has shown a valid installation using <strong>%s</strong> as table prefix.',
'PREPROCESS_STEP' => 'Executing pre-processing functions/queries',
@@ -325,6 +324,7 @@ $lang = array_merge($lang, array(
'SERVER_CONFIG' => 'Server configuration',
'SEARCH_INDEX_UNCONVERTED' => 'Search index was not converted',
'SEARCH_INDEX_UNCONVERTED_EXPLAIN' => 'Your old search index was not converted. Searching will always yield an empty result. To create a new search index go to the Administration Control Panel, select Maintenance and then choose Search index from the submenu.',
+ 'SELECT_FORUM_GA' => 'In phpBB 3.1 the global announcements are linked to forums. Select a forum for your current global announcements (can be moved later):',
'SOFTWARE' => 'Board software',
'SPECIFY_OPTIONS' => 'Specify conversion options',
'STAGE_ADMINISTRATOR' => 'Administrator details',
@@ -332,7 +332,7 @@ $lang = array_merge($lang, array(
'STAGE_ADVANCED_EXPLAIN' => 'The settings on this page are only necessary to set if you know that you require something different from the default. If you are unsure, just proceed to the next page, as these settings can be altered from the Administration Control Panel later.',
'STAGE_CONFIG_FILE' => 'Configuration file',
'STAGE_CREATE_TABLE' => 'Create database tables',
- 'STAGE_CREATE_TABLE_EXPLAIN' => 'The database tables used by phpBB 3.0 have been created and populated with some initial data. Proceed to the next screen to finish installing phpBB.',
+ 'STAGE_CREATE_TABLE_EXPLAIN' => 'The database tables used by phpBB 3.1 have been created and populated with some initial data. Proceed to the next screen to finish installing phpBB.',
'STAGE_DATABASE' => 'Database settings',
'STAGE_FINAL' => 'Final stage',
'STAGE_INTRO' => 'Introduction',
@@ -345,7 +345,7 @@ $lang = array_merge($lang, array(
'SUB_LICENSE' => 'License',
'SUB_SUPPORT' => 'Support',
'SUCCESSFUL_CONNECT' => 'Successful connection',
- 'SUPPORT_BODY' => 'Full support will be provided for the current stable release of phpBB3, free of charge. This includes:</p><ul><li>installation</li><li>configuration</li><li>technical questions</li><li>problems relating to potential bugs in the software</li><li>updating from Release Candidate (RC) versions to the latest stable version</li><li>converting from phpBB 2.0.x to phpBB3</li><li>converting from other discussion board software to phpBB3 (please see the <a href="https://www.phpbb.com/community/viewforum.php?f=65">Convertors Forum</a>)</li></ul><p>We encourage users still running beta versions of phpBB3 to replace their installation with a fresh copy of the latest version.</p><h2>MODs / Styles</h2><p>For issues relating to MODs, please post in the appropriate <a href="https://www.phpbb.com/community/viewforum.php?f=81">Modifications Forum</a>.<br />For issues relating to styles, templates and imagesets, please post in the appropriate <a href="https://www.phpbb.com/community/viewforum.php?f=80">Styles Forum</a>.<br /><br />If your question relates to a specific package, please post directly in the topic dedicated to the package.</p><h2>Obtaining Support</h2><p><a href="https://www.phpbb.com/community/viewtopic.php?f=14&amp;t=571070">The phpBB Welcome Package</a><br /><a href="https://www.phpbb.com/support/">Support Section</a><br /><a href="https://www.phpbb.com/support/documentation/3.0/quickstart/">Quick Start Guide</a><br /><br />To ensure you stay up to date with the latest news and releases, why not <a href="https://www.phpbb.com/support/">subscribe to our mailing list</a>?<br /><br />',
+ 'SUPPORT_BODY' => 'Full support will be provided for the current stable release of phpBB3, free of charge. This includes:</p><ul><li>installation</li><li>configuration</li><li>technical questions</li><li>problems relating to potential bugs in the software</li><li>updating from Release Candidate (RC) versions to the latest stable version</li><li>converting from phpBB 2.0.x to phpBB3</li><li>converting from other discussion board software to phpBB3 (please see the <a href="https://www.phpbb.com/community/viewforum.php?f=486">Convertors Forum</a>)</li></ul><p>We encourage users still running beta versions of phpBB3 to replace their installation with a fresh copy of the latest version.</p><h2>Extensions / Styles</h2><p>For issues relating to Extensions, please post in the appropriate <a href="https://www.phpbb.com/community/viewforum.php?f=451">Extensions Forum</a>.<br />For issues relating to styles, templates and themes, please post in the appropriate <a href="https://www.phpbb.com/community/viewforum.php?f=471">Styles Forum</a>.<br /><br />If your question relates to a specific package, please post directly in the topic dedicated to the package.</p><h2>Obtaining Support</h2><p><a href="https://www.phpbb.com/community/viewtopic.php?f=14&amp;t=571070">The phpBB Welcome Package</a><br /><a href="https://www.phpbb.com/support/">Support Section</a><br /><a href="https://www.phpbb.com/support/docs/en/3.1/ug/quickstart/">Quick Start Guide</a><br /><br />To ensure you stay up to date with the latest news and releases, why not <a href="https://www.phpbb.com/support/">subscribe to our mailing list</a>?<br /><br />',
'SYNC_FORUMS' => 'Starting to synchronise forums',
'SYNC_POST_COUNT' => 'Synchronising post_counts',
'SYNC_POST_COUNT_ID' => 'Synchronising post_counts from <var>entry</var> %1$s to %2$s.',
@@ -373,7 +373,7 @@ $lang = array_merge($lang, array(
// Updater
$lang = array_merge($lang, array(
- 'ALL_FILES_UP_TO_DATE' => 'All files are up to date with the latest phpBB version. You should now <a href="../ucp.php?mode=login">login to your board</a> and check if everything is working fine. Do not forget to delete, rename or move your install directory! Please send us updated information about your server and board configurations from the <a href="../ucp.php?mode=login&amp;redirect=adm/index.php%3Fi=send_statistics%26mode=send_statistics">Send statistics</a> module in your ACP.',
+ 'ALL_FILES_UP_TO_DATE' => 'All files are up to date with the latest phpBB version.',
'ARCHIVE_FILE' => 'Source file within archive',
'BACK' => 'Back',
@@ -396,7 +396,11 @@ $lang = array_merge($lang, array(
'CURRENT_VERSION' => 'Current version',
'DATABASE_TYPE' => 'Database type',
+ 'DATABASE_UPDATE_COMPLETE' => 'Database updater has completed!',
+ 'DATABASE_UPDATE_CONTINUE' => 'Continue database update',
'DATABASE_UPDATE_INFO_OLD' => 'The database update file within the install directory is outdated. Please make sure you uploaded the correct version of the file.',
+ 'DATABASE_UPDATE_NOT_COMPLETED' => 'The database update has not yet completed.',
+ 'DATABASE_VERSION' => 'Database version',
'DELETE_USER_REMOVE' => 'Delete user and remove posts',
'DELETE_USER_RETAIN' => 'Delete user but keep posts',
'DESTINATION' => 'Destination file',
@@ -415,14 +419,17 @@ $lang = array_merge($lang, array(
'DOWNLOAD_UPDATE_METHOD' => 'Download modified files archive',
'DOWNLOAD_UPDATE_METHOD_EXPLAIN' => 'Once downloaded you should unpack the archive. You will find the modified files you need to upload to your phpBB root directory within it. Please upload the files to their respective locations then. After you have uploaded all files, please check the files again with the other button below.',
- 'ERROR' => 'Error',
'EDIT_USERNAME' => 'Edit username',
+ 'ERROR' => 'Error',
+ 'EVERYTHING_UP_TO_DATE' => 'Everything is up to date with the latest phpBB version. You should now <a href="%1$s">login to your board</a> and check if everything is working fine. Do not forget to delete, rename or move your install directory! Please send us updated information about your server and board configurations from the <a href="%2$s">Send statistics</a> module in your ACP.',
'FILE_ALREADY_UP_TO_DATE' => 'File is already up to date.',
'FILE_DIFF_NOT_ALLOWED' => 'File not allowed to be diffed.',
'FILE_USED' => 'Information used from', // Single file
'FILES_CONFLICT' => 'Conflict files',
'FILES_CONFLICT_EXPLAIN' => 'The following files are modified and do not represent the original files from the old version. phpBB determined that these files create conflicts if they are tried to be merged. Please investigate the conflicts and try to manually resolve them or continue the update choosing the preferred merging method. If you resolve the conflicts manually check the files again after you modified them. You are also able to choose between the preferred merge method for every file. The first one will result in a file where the conflicting lines from your old file will be lost, the other one will result in losing the changes from the newer file.',
+ 'FILES_DELETED' => 'Deleted files',
+ 'FILES_DELETED_EXPLAIN' => 'The following files do not exist in the new version. These files have to be deleted from your installation.',
'FILES_MODIFIED' => 'Modified files',
'FILES_MODIFIED_EXPLAIN' => 'The following files are modified and do not represent the original files from the old version. The updated file will be a merge between your modifications and the new file.',
'FILES_NEW' => 'New files',
@@ -433,6 +440,7 @@ $lang = array_merge($lang, array(
'FILES_NOT_MODIFIED_EXPLAIN' => 'The following files are not modified and represent the original phpBB files from the version you want to update from.',
'FILES_UP_TO_DATE' => 'Already updated files',
'FILES_UP_TO_DATE_EXPLAIN' => 'The following files are already up to date and do not need to be updated.',
+ 'FILES_VERSION' => 'Files Version',
'FTP_SETTINGS' => 'FTP settings',
'FTP_UPDATE_METHOD' => 'FTP upload',
@@ -480,11 +488,13 @@ $lang = array_merge($lang, array(
'OLD_UPDATE_FILES' => 'Update files are out of date. The update files found are for updating from phpBB %1$s to phpBB %2$s but the latest version of phpBB is %3$s.',
'PACKAGE_UPDATES_TO' => 'Current package updates to version',
+ 'PACKAGE_VERSION' => 'Package version installed',
'PERFORM_DATABASE_UPDATE' => 'Perform database update',
'PERFORM_DATABASE_UPDATE_EXPLAIN' => 'Below you will find a button to the database update script. The database update can take a while, so please do not stop the execution if it seems to hang. After the database update has been performed just follow the instructions to continue the update process.',
'PREVIOUS_VERSION' => 'Previous version',
'PROGRESS' => 'Progress',
+ 'RELEASE_ANNOUNCEMENT' => 'Announcement',
'RESULT' => 'Result',
'RUN_DATABASE_SCRIPT' => 'Update my database now',
@@ -492,6 +502,7 @@ $lang = array_merge($lang, array(
'SELECT_DOWNLOAD_FORMAT' => 'Select download archive format',
'SELECT_FTP_SETTINGS' => 'Select FTP settings',
'SHOW_DIFF_CONFLICT' => 'Show differences/conflicts',
+ 'SHOW_DIFF_DELETED' => 'Show file contents',
'SHOW_DIFF_FINAL' => 'Show resulting file',
'SHOW_DIFF_MODIFIED' => 'Show merged differences',
'SHOW_DIFF_NEW' => 'Show file contents',
@@ -505,6 +516,7 @@ $lang = array_merge($lang, array(
'STAGE_UPDATE_FILES' => 'Update files',
'STAGE_VERSION_CHECK' => 'Version check',
'STATUS_CONFLICT' => 'Modified file producing conflicts',
+ 'STATUS_DELETED' => 'Deleted file',
'STATUS_MODIFIED' => 'Modified file',
'STATUS_NEW' => 'New file',
'STATUS_NEW_CONFLICT' => 'Conflicting new file',
@@ -521,13 +533,19 @@ $lang = array_merge($lang, array(
'UPDATE_DATABASE_SCHEMA' => 'Updating database schema',
'UPDATE_FILES' => 'Update files',
'UPDATE_FILES_NOTICE' => 'Please make sure you have updated your board files too, this file is only updating your database.',
+ 'UPDATE_INCOMPLETE' => 'Your phpBB installation has not been correctly updated.',
+ 'UPDATE_INCOMPLETE_MORE' => 'Please read the information below in order to fix this error.',
+ 'UPDATE_INCOMPLETE_EXPLAIN' => '<h1>Incomplete update</h1>
+
+ <p>We noticed that the last update of your phpBB installation hasn’t been completed. Visit the <a href="%1$s" title="%1$s">database_update script</a> and run it. If it is missing, please <a href="https://www.phpbb.com/downloads/" title="phpBB downloads">download your package version</a>, upload the "install" folder to your phpBB root directory (where your config.php file is) and <a href="%1$s" title="%1$s">run the database update script</a>.</p>',
+
'UPDATE_INSTALLATION' => 'Update phpBB installation',
'UPDATE_INSTALLATION_EXPLAIN' => 'With this option, it is possible to update your phpBB installation to the latest version.<br />During the process all of your files will be checked for their integrity. You are able to review all differences and files before the update.<br /><br />The file update itself can be done in two different ways.</p><h2>Manual Update</h2><p>With this update you only download your personal set of changed files to make sure you do not lose your file modifications you may have done. After you downloaded this package you need to manually upload the files to their correct position under your phpBB root directory. Once done, you are able to do the file check stage again to see if you moved the files to their correct location.</p><h2>Automatic Update with FTP</h2><p>This method is similar to the first one but without the need to download the changed files and uploading them on your own. This will be done for you. In order to use this method you need to know your FTP login details since you will be asked for them. Once finished you will be redirected to the file check again to make sure everything got updated correctly.<br /><br />',
'UPDATE_INSTRUCTIONS' => '
<h1>Release announcement</h1>
- <p>Please read <a href="%1$s" title="%1$s"><strong>the release announcement for the latest version</strong></a> before you continue your update process, it may contain useful information. It also contains full download links as well as the change log.</p>
+ <p>Please read the release announcement for the latest version before you continue your update process, it may contain useful information. It also contains full download links as well as the change log.</p>
<br />
@@ -538,21 +556,15 @@ $lang = array_merge($lang, array(
<ul style="margin-left: 20px; font-size: 1.1em;">
<li>Go to the <a href="https://www.phpbb.com/downloads/" title="https://www.phpbb.com/downloads/">phpBB.com downloads page</a> and download the "Automatic Update Package" archive.<br /><br /></li>
<li>Unpack the archive.<br /><br /></li>
- <li>Upload the complete uncompressed install folder to your phpBB root directory (where your config.php file is).<br /><br /></li>
+ <li>Upload the complete uncompressed "install" and "vendor" folders to your phpBB root directory (where your config.php file is).<br /><br /></li>
</ul>
<p>Once uploaded your board will be offline for normal users due to the install directory you uploaded now present.<br /><br />
- <strong><a href="%2$s" title="%2$s">Now start the update process by pointing your browser to the install folder</a>.</strong><br />
+ <strong><a href="%1$s" title="%1$s">Now start the update process by pointing your browser to the install folder</a>.</strong><br />
<br />
You will then be guided through the update process. You will be notified once the update is complete.
</p>
',
- 'UPDATE_INSTRUCTIONS_INCOMPLETE' => '
-
- <h1>Incomplete update detected</h1>
-
- <p>phpBB detected an incomplete automatic update. Please make sure you followed every step within the automatic update tool. Below you will find the link again, or go directly to your install directory.</p>
- ',
'UPDATE_METHOD' => 'Update method',
'UPDATE_METHOD_EXPLAIN' => 'You are now able to choose your preferred update method. Using the FTP upload will present you with a form you need to enter your FTP account details into. With this method the files will be automatically moved to the new location and backups of the old files being created by appending .bak to the filename. If you choose to download the modified files you are able to unpack and upload them to their correct location manually later.',
'UPDATE_REQUIRES_FILE' => 'The updater requires that the following file is present: %s',
@@ -566,6 +578,7 @@ $lang = array_merge($lang, array(
'UPLOAD_METHOD' => 'Upload method',
'UPDATE_DB_SUCCESS' => 'Database update was successful.',
+ 'UPDATE_FILE_SUCCESS' => 'File update was successful.',
'USER_ACTIVE' => 'Active user',
'USER_INACTIVE' => 'Inactive user',
@@ -627,5 +640,3 @@ $lang = array_merge($lang, array(
'TOPICS_TOPIC_TITLE' => 'Welcome to phpBB3',
));
-
-?> \ No newline at end of file
diff --git a/phpBB/language/en/iso.txt b/phpBB/language/en/iso.txt
index c421dd4316..2e45cc56d0 100644
--- a/phpBB/language/en/iso.txt
+++ b/phpBB/language/en/iso.txt
@@ -1,3 +1,3 @@
British English
British English
-phpBB Group \ No newline at end of file
+phpBB Limited \ No newline at end of file
diff --git a/phpBB/language/en/mcp.php b/phpBB/language/en/mcp.php
index d0bcec0d9c..a961068657 100644
--- a/phpBB/language/en/mcp.php
+++ b/phpBB/language/en/mcp.php
@@ -1,12 +1,13 @@
<?php
/**
*
-* mcp [English]
+* This file is part of the phpBB Forum Software package.
*
-* @package language
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -53,6 +54,10 @@ $lang = array_merge($lang, array(
'APPROVE_POST_CONFIRM' => 'Are you sure you want to approve this post?',
'APPROVE_POSTS' => 'Approve posts',
'APPROVE_POSTS_CONFIRM' => 'Are you sure you want to approve the selected posts?',
+ 'APPROVE_TOPIC' => 'Approve topic',
+ 'APPROVE_TOPIC_CONFIRM' => 'Are you sure you want to approve this topic?',
+ 'APPROVE_TOPICS' => 'Approve topics',
+ 'APPROVE_TOPICS_CONFIRM'=> 'Are you sure you want to approve the selected topics?',
'CANNOT_MOVE_SAME_FORUM'=> 'You cannot move a topic to the forum it’s already in.',
'CANNOT_WARN_ANONYMOUS' => 'You cannot warn unregistered guest users.',
@@ -73,16 +78,12 @@ $lang = array_merge($lang, array(
'DELETE_PM_REPORTS' => 'Delete PM reports',
'DELETE_PM_REPORTS_CONFIRM' => 'Are you sure you want to delete the selected PM reports?',
'DELETE_POSTS' => 'Delete posts',
- 'DELETE_POSTS_CONFIRM' => 'Are you sure you want to delete these posts?',
- 'DELETE_POST_CONFIRM' => 'Are you sure you want to delete this post?',
'DELETE_REPORT' => 'Delete report',
'DELETE_REPORT_CONFIRM' => 'Are you sure you want to delete the selected report?',
'DELETE_REPORTS' => 'Delete reports',
'DELETE_REPORTS_CONFIRM' => 'Are you sure you want to delete the selected reports?',
'DELETE_SHADOW_TOPIC' => 'Delete shadow topic',
'DELETE_TOPICS' => 'Delete selected topics',
- 'DELETE_TOPICS_CONFIRM' => 'Are you sure you want to delete these topics?',
- 'DELETE_TOPIC_CONFIRM' => 'Are you sure you want to delete this topic?',
'DISAPPROVE' => 'Disapprove',
'DISAPPROVE_REASON' => 'Reason for disapproval',
'DISAPPROVE_POST' => 'Disapprove post',
@@ -120,8 +121,10 @@ $lang = array_merge($lang, array(
'LATEST_WARNING_TIME' => 'Latest warning issued',
'LATEST_WARNINGS' => 'Latest 5 warnings',
'LEAVE_SHADOW' => 'Leave shadow topic in place',
- 'LIST_REPORT' => '1 report',
- 'LIST_REPORTS' => '%d reports',
+ 'LIST_REPORTS' => array(
+ 1 => '%d report',
+ 2 => '%d reports',
+ ),
'LOCK' => 'Lock',
'LOCK_POST_POST' => 'Lock post',
'LOCK_POST_POST_CONFIRM' => 'Are you sure you want to prevent editing this post?',
@@ -143,7 +146,7 @@ $lang = array_merge($lang, array(
'MCP_ADD' => 'Add a warning',
'MCP_BAN' => 'Banning',
- 'MCP_BAN_EMAILS' => 'Ban e-mails',
+ 'MCP_BAN_EMAILS' => 'Ban emails',
'MCP_BAN_IPS' => 'Ban IPs',
'MCP_BAN_USERNAMES' => 'Ban Usernames',
@@ -200,6 +203,10 @@ $lang = array_merge($lang, array(
'MCP_QUEUE_UNAPPROVED_POSTS_EXPLAIN' => 'This is a list of all posts which require approving before they will be visible to users.',
'MCP_QUEUE_UNAPPROVED_TOPICS' => 'Topics awaiting approval',
'MCP_QUEUE_UNAPPROVED_TOPICS_EXPLAIN' => 'This is a list of all topics which require approving before they will be visible to users.',
+ 'MCP_QUEUE_DELETED_POSTS' => 'Deleted posts',
+ 'MCP_QUEUE_DELETED_POSTS_EXPLAIN' => 'This is a list of all soft deleted posts. You can restore or permanently delete the posts from this screen.',
+ 'MCP_QUEUE_DELETED_TOPICS' => 'Deleted topics',
+ 'MCP_QUEUE_DELETED_TOPICS_EXPLAIN' => 'This is a list of all soft deleted topics. You can restore or permanently delete the topics from this screen.',
'MCP_VIEW_USER' => 'View warnings for a specific user',
@@ -230,32 +237,39 @@ $lang = array_merge($lang, array(
'NOT_MODERATOR' => 'You are not a moderator of this forum.',
'NO_DESTINATION_FORUM' => 'Please select a forum for destination.',
'NO_DESTINATION_FORUM_FOUND' => 'There is no destination forum available.',
- 'NO_ENTRIES' => 'No log entries for this period.',
+ 'NO_ENTRIES' => 'No log entries.',
'NO_FEEDBACK' => 'No feedback exists for this user.',
'NO_FINAL_TOPIC_SELECTED' => 'You have to select a destination topic for merging posts.',
'NO_MATCHES_FOUND' => 'No matches found.',
'NO_POST' => 'You have to select a post in order to warn the user for a post.',
'NO_POST_REPORT' => 'This post was not reported.',
'NO_POST_SELECTED' => 'You must select at least one post to perform this action.',
+ 'NO_POSTS_DELETED' => 'There are no deleted posts.',
+ 'NO_POSTS_QUEUE' => 'There are no posts waiting for approval.',
'NO_REASON_DISAPPROVAL' => 'Please give an appropriate reason for disapproval.',
'NO_REPORT' => 'No report found',
'NO_REPORTS' => 'No reports found',
'NO_REPORT_SELECTED' => 'You must select at least one report to perform this action.',
'NO_TOPIC_ICON' => 'None',
'NO_TOPIC_SELECTED' => 'You must select at least one topic to perform this action.',
+ 'NO_TOPICS_DELETED' => 'There are no deleted topics.',
'NO_TOPICS_QUEUE' => 'There are no topics waiting for approval.',
'ONLY_TOPIC' => 'Only topic “%s”',
'OTHER_USERS' => 'Other users posting from this IP',
+ 'QUICKMOD_ACTION_NOT_ALLOWED' => "%s not allowed as quickmod",
+
'PM_REPORT_CLOSED_SUCCESS' => 'The selected PM report has been closed successfully.',
'PM_REPORT_DELETED_SUCCESS' => 'The selected PM report has been deleted successfully.',
'PM_REPORTED_SUCCESS' => 'This private message has been successfully reported.',
- 'PM_REPORT_TOTAL' => 'In total there is <strong>1</strong> PM report to review.',
'PM_REPORTS_CLOSED_SUCCESS' => 'The selected PM reports have been closed successfully.',
'PM_REPORTS_DELETED_SUCCESS'=> 'The selected PM reports have been deleted successfully.',
- 'PM_REPORTS_TOTAL' => 'In total there are <strong>%d</strong> PM reports to review.',
- 'PM_REPORTS_ZERO_TOTAL' => 'There are no PM reports to review.',
+ 'PM_REPORTS_TOTAL' => array(
+ 0 => 'There are no PM reports to review.',
+ 1 => 'In total there is <strong>1</strong> PM report to review.',
+ 2 => 'In total there are <strong>%d</strong> PM reports to review.',
+ ),
'PM_REPORT_DETAILS' => 'Private message report details',
'POSTER' => 'Poster',
'POSTS_APPROVED_SUCCESS' => 'The selected posts have been approved.',
@@ -263,15 +277,17 @@ $lang = array_merge($lang, array(
'POSTS_DISAPPROVED_SUCCESS' => 'The selected posts have been disapproved.',
'POSTS_LOCKED_SUCCESS' => 'The selected posts have been locked successfully.',
'POSTS_MERGED_SUCCESS' => 'The selected posts have been merged.',
- 'POSTS_UNLOCKED_SUCCESS' => 'The selected posts have been unlocked successfully.',
'POSTS_PER_PAGE' => 'Posts per page',
'POSTS_PER_PAGE_EXPLAIN' => '(Set to 0 to view all posts.)',
+ 'POSTS_RESTORED_SUCCESS' => 'The selected posts have been restored successfully.',
+ 'POSTS_UNLOCKED_SUCCESS' => 'The selected posts have been unlocked successfully.',
'POST_APPROVED_SUCCESS' => 'The selected post has been approved.',
'POST_DELETED_SUCCESS' => 'The selected post has been successfully removed from the database.',
'POST_DISAPPROVED_SUCCESS' => 'The selected post has been disapproved.',
'POST_LOCKED_SUCCESS' => 'Post locked successfully.',
'POST_NOT_EXIST' => 'The post you requested does not exist.',
'POST_REPORTED_SUCCESS' => 'This post has been successfully reported.',
+ 'POST_RESTORED_SUCCESS' => 'This post has been restored successfully.',
'POST_UNLOCKED_SUCCESS' => 'Post unlocked successfully.',
'READ_USERNOTES' => 'User notes',
@@ -282,8 +298,11 @@ $lang = array_merge($lang, array(
'REPORTED_ON_DATE' => 'on',
'REPORTS_CLOSED_SUCCESS' => 'The selected reports have been closed successfully.',
'REPORTS_DELETED_SUCCESS' => 'The selected reports have been deleted successfully.',
- 'REPORTS_TOTAL' => 'In total there are <strong>%d</strong> reports to review.',
- 'REPORTS_ZERO_TOTAL' => 'There are no reports to review.',
+ 'REPORTS_TOTAL' => array(
+ 0 => 'There are no reports to review.',
+ 1 => 'In total there is <strong>1</strong> report to review.',
+ 2 => 'In total there are <strong>%d</strong> reports to review.',
+ ),
'REPORT_CLOSED' => 'This report has already been closed.',
'REPORT_CLOSED_SUCCESS' => 'The selected report has been closed successfully.',
'REPORT_DELETED_SUCCESS' => 'The selected report has been deleted successfully.',
@@ -295,7 +314,15 @@ $lang = array_merge($lang, array(
'REPORT_POST_EXPLAIN' => 'Use this form to report the selected post to the forum moderators and board administrators. Reporting should generally be used only if the post breaks forum rules.',
'REPORT_REASON' => 'Report reason',
'REPORT_TIME' => 'Report time',
- 'REPORT_TOTAL' => 'In total there is <strong>1</strong> report to review.',
+ 'RESTORE' => 'Restore',
+ 'RESTORE_POST' => 'Restore post',
+ 'RESTORE_POST_CONFIRM' => 'Are you sure you want to restore this post?',
+ 'RESTORE_POSTS' => 'Restore posts',
+ 'RESTORE_POSTS_CONFIRM' => 'Are you sure you want to restore the selected posts?',
+ 'RESTORE_TOPIC' => 'Restore topic',
+ 'RESTORE_TOPIC_CONFIRM' => 'Are you sure you want to restore this topic?',
+ 'RESTORE_TOPICS' => 'Restore topics',
+ 'RESTORE_TOPICS_CONFIRM' => 'Are you sure you want to restore the selected topics?',
'RESYNC' => 'Resync',
'RETURN_MESSAGE' => '%sReturn to the message%s',
'RETURN_NEW_FORUM' => '%sGo to the new forum%s',
@@ -336,6 +363,7 @@ $lang = array_merge($lang, array(
'TOPICS_FORKED_SUCCESS' => 'The selected topics have been copied successfully.',
'TOPICS_LOCKED_SUCCESS' => 'The selected topics have been locked.',
'TOPICS_MOVED_SUCCESS' => 'The selected topics have been moved successfully.',
+ 'TOPICS_RESTORED_SUCCESS' => 'The selected topics have been restored successfully.',
'TOPICS_RESYNC_SUCCESS' => 'The selected topics have been resynchronised.',
'TOPICS_TYPE_CHANGED' => 'Topic types changed successfully.',
'TOPICS_UNLOCKED_SUCCESS' => 'The selected topics have been unlocked.',
@@ -346,6 +374,7 @@ $lang = array_merge($lang, array(
'TOPIC_LOCKED_SUCCESS' => 'The selected topic has been locked.',
'TOPIC_MOVED_SUCCESS' => 'The selected topic has been moved successfully.',
'TOPIC_NOT_EXIST' => 'The topic you selected does not exist.',
+ 'TOPIC_RESTORED_SUCCESS' => 'The selected topic has been restored successfully.',
'TOPIC_RESYNC_SUCCESS' => 'The selected topic has been resynchronised.',
'TOPIC_SPLIT_SUCCESS' => 'The selected topic has been split successfully.',
'TOPIC_TIME' => 'Topic time',
@@ -353,9 +382,11 @@ $lang = array_merge($lang, array(
'TOPIC_UNLOCKED_SUCCESS' => 'The selected topic has been unlocked.',
'TOTAL_WARNINGS' => 'Total Warnings',
- 'UNAPPROVED_POSTS_TOTAL' => 'In total there are <strong>%d</strong> posts waiting for approval.',
- 'UNAPPROVED_POSTS_ZERO_TOTAL' => 'There are no posts waiting for approval.',
- 'UNAPPROVED_POST_TOTAL' => 'In total there is <strong>1</strong> post waiting for approval.',
+ 'UNAPPROVED_POSTS_TOTAL' => array(
+ 0 => 'There are no posts waiting for approval.',
+ 1 => 'In total there is <strong>1</strong> post waiting for approval.',
+ 2 => 'In total there are <strong>%d</strong> posts waiting for approval.',
+ ),
'UNLOCK' => 'Unlock',
'UNLOCK_POST' => 'Unlock post',
'UNLOCK_POST_EXPLAIN' => 'Allow editing',
@@ -381,7 +412,7 @@ $lang = array_merge($lang, array(
'WARNING_PM_BODY' => 'The following is a warning which has been issued to you by an administrator or moderator of this site.[quote]%s[/quote]',
'WARNING_PM_SUBJECT' => 'Board warning issued',
'WARNING_POST_DEFAULT' => 'This is a warning regarding the following post made by you: %s .',
- 'WARNINGS_ZERO_TOTAL' => 'No warnings exist.',
+ 'NO_WARNINGS' => 'No warnings exist.',
'YOU_SELECTED_TOPIC' => 'You selected topic number %d: %s.',
@@ -397,8 +428,6 @@ $lang = array_merge($lang, array(
'SPAM' => 'The reported message has the only purpose to advertise for a website or another product.',
'OFF_TOPIC' => 'The reported message is off topic.',
'OTHER' => 'The reported message does not fit into any other category, please use the further information field.',
- )
+ ),
),
));
-
-?> \ No newline at end of file
diff --git a/phpBB/language/en/memberlist.php b/phpBB/language/en/memberlist.php
index f59efd3b95..c7b2bf55d1 100644
--- a/phpBB/language/en/memberlist.php
+++ b/phpBB/language/en/memberlist.php
@@ -1,12 +1,13 @@
<?php
/**
*
-* memberlist [English]
+* This file is part of the phpBB Forum Software package.
*
-* @package language
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -47,41 +48,39 @@ $lang = array_merge($lang, array(
'BEFORE' => 'Before',
- 'CC_EMAIL' => 'Send a copy of this e-mail to yourself.',
- 'CONTACT_USER' => 'Contact',
+ 'CC_SENDER' => 'Send a copy of this email to yourself.',
+ 'CONTACT_ADMIN' => 'Contact a Board Administrator',
'DEST_LANG' => 'Language',
'DEST_LANG_EXPLAIN' => 'Select an appropriate language (if available) for the recipient of this message.',
- 'EMAIL_BODY_EXPLAIN' => 'This message will be sent as plain text, do not include any HTML or BBCode. The return address for this message will be set to your e-mail address.',
- 'EMAIL_DISABLED' => 'Sorry but all e-mail related functions have been disabled.',
- 'EMAIL_SENT' => 'The e-mail has been sent.',
- 'EMAIL_TOPIC_EXPLAIN' => 'This message will be sent as plain text, do not include any HTML or BBCode. Please note that the topic information is already included in the message. The return address for this message will be set to your e-mail address.',
- 'EMPTY_ADDRESS_EMAIL' => 'You must provide a valid e-mail address for the recipient.',
+ 'EDIT_PROFILE' => 'Edit profile',
+
+ 'EMAIL_BODY_EXPLAIN' => 'This message will be sent as plain text, do not include any HTML or BBCode. The return address for this message will be set to your email address.',
+ 'EMAIL_DISABLED' => 'Sorry but all email related functions have been disabled.',
+ 'EMAIL_SENT' => 'The email has been sent.',
+ 'EMAIL_TOPIC_EXPLAIN' => 'This message will be sent as plain text, do not include any HTML or BBCode. Please note that the topic information is already included in the message. The return address for this message will be set to your email address.',
+ 'EMPTY_ADDRESS_EMAIL' => 'You must provide a valid email address for the recipient.',
'EMPTY_MESSAGE_EMAIL' => 'You must enter a message to be emailed.',
'EMPTY_MESSAGE_IM' => 'You must enter a message to be send.',
'EMPTY_NAME_EMAIL' => 'You must enter the real name of the recipient.',
- 'EMPTY_SUBJECT_EMAIL' => 'You must specify a subject for the e-mail.',
+ 'EMPTY_SENDER_EMAIL' => 'You must provide a valid email address.',
+ 'EMPTY_SENDER_NAME' => 'You must provide a name.',
+ 'EMPTY_SUBJECT_EMAIL' => 'You must specify a subject for the email.',
'EQUAL_TO' => 'Equal to',
'FIND_USERNAME_EXPLAIN' => 'Use this form to search for specific members. You do not need to fill out all fields. To match partial data use * as a wildcard. When entering dates use the format <kbd>YYYY-MM-DD</kbd>, e.g. <samp>2004-02-29</samp>. Use the mark checkboxes to select one or more usernames (several usernames may be accepted depending on the form itself) and click the Select Marked button to return to the previous form.',
- 'FLOOD_EMAIL_LIMIT' => 'You cannot send another e-mail at this time. Please try again later.',
+ 'FLOOD_EMAIL_LIMIT' => 'You cannot send another email at this time. Please try again later.',
'GROUP_LEADER' => 'Group leader',
'HIDE_MEMBER_SEARCH' => 'Hide member search',
'IM_ADD_CONTACT' => 'Add Contact',
- 'IM_AIM' => 'Please note that you need AOL Instant Messenger installed to use this.',
- 'IM_AIM_EXPRESS' => 'AIM Express',
'IM_DOWNLOAD_APP' => 'Download application',
- 'IM_ICQ' => 'Please note that users may have selected to not receive unsolicited instant messages.',
'IM_JABBER' => 'Please note that users may have selected to not receive unsolicited instant messages.',
'IM_JABBER_SUBJECT' => 'This is an automated message please do not reply! Message from user %1$s at %2$s.',
'IM_MESSAGE' => 'Your message',
- 'IM_MSNM' => 'Please note that you need Windows Messenger installed to use this.',
- 'IM_MSNM_BROWSER' => 'Your browser does not support this.',
- 'IM_MSNM_CONNECT' => 'MSNM is not connected.\nYou have to connect to MSNM to continue.',
'IM_NAME' => 'Your Name',
'IM_NO_DATA' => 'There is no suitable contact information for this user.',
'IM_NO_JABBER' => 'Sorry, direct messaging of Jabber users is not supported on this board. You will need a Jabber client installed on your system to contact the recipient above.',
@@ -93,16 +92,21 @@ $lang = array_merge($lang, array(
'LAST_ACTIVE' => 'Last active',
'LESS_THAN' => 'Less than',
- 'LIST_USER' => '1 user',
- 'LIST_USERS' => '%d users',
- 'LOGIN_EXPLAIN_LEADERS' => 'The board requires you to be registered and logged in to view the team listing.',
+ 'LIST_USERS' => array(
+ 1 => '%d user',
+ 2 => '%d users',
+ ),
+ 'LOGIN_EXPLAIN_TEAM' => 'The board requires you to be registered and logged in to view the team listing.',
'LOGIN_EXPLAIN_MEMBERLIST' => 'The board requires you to be registered and logged in to access the memberlist.',
'LOGIN_EXPLAIN_SEARCHUSER' => 'The board requires you to be registered and logged in to search users.',
'LOGIN_EXPLAIN_VIEWPROFILE' => 'The board requires you to be registered and logged in to view profiles.',
+ 'MANAGE_GROUP' => 'Manage Group',
'MORE_THAN' => 'More than',
- 'NO_EMAIL' => 'You are not permitted to send e-mail to this user.',
+ 'NO_CONTACT_FORM' => 'The board administrator contact form has been disabled.',
+ 'NO_CONTACT_PAGE' => 'The board administrator contact page has been disabled.',
+ 'NO_EMAIL' => 'You are not permitted to send email to this user.',
'NO_VIEW_USERS' => 'You are not authorised to view the member list or profiles.',
'ORDER' => 'Order',
@@ -117,14 +121,14 @@ $lang = array_merge($lang, array(
'SELECT_MARKED' => 'Select marked',
'SELECT_SORT_METHOD' => 'Select sort method',
- 'SEND_AIM_MESSAGE' => 'Send AIM message',
+ 'SENDER_EMAIL_ADDRESS' => 'Your email address',
+ 'SENDER_NAME' => 'Your name',
'SEND_ICQ_MESSAGE' => 'Send ICQ message',
'SEND_IM' => 'Instant messaging',
'SEND_JABBER_MESSAGE' => 'Send Jabber message',
'SEND_MESSAGE' => 'Message',
- 'SEND_MSNM_MESSAGE' => 'Send MSNM/WLM message',
'SEND_YIM_MESSAGE' => 'Send YIM message',
- 'SORT_EMAIL' => 'E-mail',
+ 'SORT_EMAIL' => 'Email',
'SORT_LAST_ACTIVE' => 'Last active',
'SORT_POST_COUNT' => 'Post count',
@@ -135,15 +139,16 @@ $lang = array_merge($lang, array(
'USER_LAST_REMINDED' => array(
0 => 'No reminder sent at this time',
1 => '%1$d reminder sent<br />» %2$s',
+ 2 => '%1$d reminder sent<br />» %2$s',
),
'USER_ONLINE' => 'Online',
'USER_PRESENCE' => 'Board presence',
'USERS_PER_PAGE' => 'Users per page',
'VIEWING_PROFILE' => 'Viewing profile - %s',
- 'VISITED' => 'Last visited',
-
- 'WWW' => 'Website',
+ 'VIEW_FACEBOOK_PROFILE' => 'View Facebook Profile',
+ 'VIEW_SKYPE_PROFILE' => 'View Skype Profile',
+ 'VIEW_TWITTER_PROFILE' => 'View Twitter Profile',
+ 'VIEW_YOUTUBE_CHANNEL' => 'View YouTube Channel',
+ 'VIEW_GOOGLEPLUS_PROFILE' => 'View Google+ Profile',
));
-
-?> \ No newline at end of file
diff --git a/phpBB/language/en/migrator.php b/phpBB/language/en/migrator.php
new file mode 100644
index 0000000000..b3b5995cc0
--- /dev/null
+++ b/phpBB/language/en/migrator.php
@@ -0,0 +1,73 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+/**
+* DO NOT CHANGE
+*/
+if (!defined('IN_PHPBB'))
+{
+ exit;
+}
+
+if (empty($lang) || !is_array($lang))
+{
+ $lang = array();
+}
+
+// DEVELOPERS PLEASE NOTE
+//
+// All language files should use UTF-8 as their encoding and the files must not contain a BOM.
+//
+// Placeholders can now contain order information, e.g. instead of
+// 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows
+// translators to re-order the output of data while ensuring it remains correct
+//
+// You do not need this where single placeholders are used, e.g. 'Message %d' is fine
+// equally where a string contains only two placeholders which are used to wrap text
+// in a url you again do not need to specify an order e.g., 'Click %sHERE%s' is fine
+
+$lang = array_merge($lang, array(
+ 'CONFIG_NOT_EXIST' => 'The config setting "%s" unexpectedly does not exist.',
+
+ 'GROUP_NOT_EXIST' => 'The group "%s" unexpectedly does not exist.',
+
+ 'MIGRATION_APPLY_DEPENDENCIES' => 'Apply dependencies of %s.',
+ 'MIGRATION_DATA_DONE' => 'Installed Data: %1$s; Time: %2$.2f seconds',
+ 'MIGRATION_DATA_IN_PROGRESS' => 'Installing Data: %1$s; Time: %2$.2f seconds',
+ 'MIGRATION_DATA_RUNNING' => 'Installing Data: %s.',
+ 'MIGRATION_EFFECTIVELY_INSTALLED' => 'Migration already effectively installed (skipped): %s',
+ 'MIGRATION_EXCEPTION_ERROR' => 'Something went wrong during the request and an exception was thrown. The changes made before the error occurred were reversed to the best of our abilities, but you should check the board for errors.',
+ 'MIGRATION_NOT_FULFILLABLE' => 'The migration "%1$s" is not fulfillable, missing migration "%2$s".',
+ 'MIGRATION_NOT_VALID' => '%s is not a valid migration.',
+ 'MIGRATION_SCHEMA_DONE' => 'Installed Schema: %1$s; Time: %2$.2f seconds',
+ 'MIGRATION_SCHEMA_IN_PROGRESS' => 'Installing Schema: %1$s; Time: %2$.2f seconds',
+ 'MIGRATION_SCHEMA_RUNNING' => 'Installing Schema: %s.',
+
+ 'MIGRATION_INVALID_DATA_MISSING_CONDITION' => 'A migration is invalid. An if statement helper is missing a condition.',
+ 'MIGRATION_INVALID_DATA_MISSING_STEP' => 'A migration is invalid. An if statement helper is missing a valid call to a migration step.',
+ 'MIGRATION_INVALID_DATA_CUSTOM_NOT_CALLABLE' => 'A migration is invalid. A custom callable function could not be called.',
+ 'MIGRATION_INVALID_DATA_UNKNOWN_TYPE' => 'A migration is invalid. An unknown migration tool type was encountered.',
+ 'MIGRATION_INVALID_DATA_UNDEFINED_TOOL' => 'A migration is invalid. An undefined migration tool was encountered.',
+ 'MIGRATION_INVALID_DATA_UNDEFINED_METHOD' => 'A migration is invalid. An undefined migration tool method was encountered.',
+
+ 'MODULE_ERROR' => 'An error occurred while creating a module: %s',
+ 'MODULE_EXISTS' => 'A module already exists: %s',
+ 'MODULE_EXIST_MULTIPLE' => 'Several modules with the given parent module langname already exist: %s. Try using before/after keys to clarify the module placement.',
+ 'MODULE_INFO_FILE_NOT_EXIST' => 'A required module info file is missing: %2$s',
+ 'MODULE_NOT_EXIST' => 'A required module does not exist: %s',
+
+ 'PARENT_MODULE_FIND_ERROR' => 'Unable to determine the parent module identifier: %s',
+ 'PERMISSION_NOT_EXIST' => 'The permission setting "%s" unexpectedly does not exist.',
+
+ 'ROLE_NOT_EXIST' => 'The permission role "%s" unexpectedly does not exist.',
+));
diff --git a/phpBB/language/en/plupload.php b/phpBB/language/en/plupload.php
new file mode 100644
index 0000000000..15c3955a1a
--- /dev/null
+++ b/phpBB/language/en/plupload.php
@@ -0,0 +1,79 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @copyright (c) 2010-2013 Moxiecode Systems AB
+* @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();
+}
+
+// DEVELOPERS PLEASE NOTE
+//
+// All language files should use UTF-8 as their encoding and the files must not contain a BOM.
+//
+// Placeholders can now contain order information, e.g. instead of
+// 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows
+// translators to re-order the output of data while ensuring it remains correct
+//
+// You do not need this where single placeholders are used, e.g. 'Message %d' is fine
+// equally where a string contains only two placeholders which are used to wrap text
+// in a url you again do not need to specify an order e.g., 'Click %sHERE%s' is fine
+
+$lang = array_merge($lang, array(
+ 'PLUPLOAD_ADD_FILES' => 'Add files',
+ 'PLUPLOAD_ADD_FILES_TO_QUEUE' => 'Add files to the upload queue and click the start button.',
+ 'PLUPLOAD_ALREADY_QUEUED' => '%s already present in the queue.',
+ 'PLUPLOAD_CLOSE' => 'Close',
+ 'PLUPLOAD_DRAG' => 'Drag files here.',
+ 'PLUPLOAD_DUPLICATE_ERROR' => 'Duplicate file error.',
+ 'PLUPLOAD_DRAG_TEXTAREA' => 'You may also attach files by dragging and dropping them in the message box.',
+ 'PLUPLOAD_ERR_INPUT' => 'Failed to open input stream.',
+ 'PLUPLOAD_ERR_MOVE_UPLOADED' => 'Failed to move uploaded file.',
+ 'PLUPLOAD_ERR_OUTPUT' => 'Failed to open output stream.',
+ 'PLUPLOAD_ERR_FILE_TOO_LARGE' => 'File too large:',
+ 'PLUPLOAD_ERR_FILE_COUNT' => 'File count error.',
+ 'PLUPLOAD_ERR_FILE_INVALID_EXT' => 'Invalid file extension:',
+ 'PLUPLOAD_ERR_RUNTIME_MEMORY' => 'Runtime ran out of available memory.',
+ 'PLUPLOAD_ERR_UPLOAD_URL' => 'Upload URL might be wrong or does not exist.',
+ 'PLUPLOAD_EXTENSION_ERROR' => 'File extension error.',
+ 'PLUPLOAD_FILE' => 'File: %s',
+ 'PLUPLOAD_FILE_DETAILS' => 'File: %s, size: %d, max file size: %d',
+ 'PLUPLOAD_FILENAME' => 'Filename',
+ 'PLUPLOAD_FILES_QUEUED' => '%d files queued',
+ 'PLUPLOAD_GENERIC_ERROR' => 'Generic error.',
+ 'PLUPLOAD_HTTP_ERROR' => 'HTTP error.',
+ 'PLUPLOAD_IMAGE_FORMAT' => 'Image format either wrong or not supported.',
+ 'PLUPLOAD_INIT_ERROR' => 'Init error.',
+ 'PLUPLOAD_IO_ERROR' => 'IO error.',
+ 'PLUPLOAD_NOT_APPLICABLE' => 'N/A',
+ 'PLUPLOAD_SECURITY_ERROR' => 'Security error.',
+ 'PLUPLOAD_SELECT_FILES' => 'Select files',
+ 'PLUPLOAD_SIZE' => 'Size',
+ 'PLUPLOAD_SIZE_ERROR' => 'File size error.',
+ 'PLUPLOAD_STATUS' => 'Status',
+ 'PLUPLOAD_START_UPLOAD' => 'Start upload',
+ 'PLUPLOAD_START_CURRENT_UPLOAD' => 'Start uploading queue',
+ 'PLUPLOAD_STOP_UPLOAD' => 'Stop upload',
+ 'PLUPLOAD_STOP_CURRENT_UPLOAD' => 'Stop current upload',
+ // Note: This string is formatted independently by plupload and so does not
+ // use the same formatting rules as normal phpBB translation strings
+ 'PLUPLOAD_UPLOADED' => 'Uploaded %d/%d files',
+));
diff --git a/phpBB/language/en/posting.php b/phpBB/language/en/posting.php
index 5316011f4e..ef52f59753 100644
--- a/phpBB/language/en/posting.php
+++ b/phpBB/language/en/posting.php
@@ -1,12 +1,13 @@
<?php
/**
*
-* posting [English]
+* This file is part of the phpBB Forum Software package.
*
-* @package language
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -54,12 +55,12 @@ $lang = array_merge($lang, array(
'BBCODE_IS_OFF' => '%sBBCode%s is <em>OFF</em>',
'BBCODE_IS_ON' => '%sBBCode%s is <em>ON</em>',
'BBCODE_I_HELP' => 'Italic text: [i]text[/i]',
- 'BBCODE_L_HELP' => 'List: [list][*]text[/list]',
+ 'BBCODE_L_HELP' => 'List: [list][*]text[/list]',
'BBCODE_LISTITEM_HELP' => 'List item: [*]text',
'BBCODE_O_HELP' => 'Ordered list: e.g. [list=1][*]First point[/list] or [list=a][*]Point a[/list]',
'BBCODE_P_HELP' => 'Insert image: [img]http://image_url[/img]',
'BBCODE_Q_HELP' => 'Quote text: [quote]text[/quote]',
- 'BBCODE_S_HELP' => 'Font colour: [color=red]text[/color] Tip: you can also use color=#FF0000',
+ 'BBCODE_S_HELP' => 'Font colour: [color=red]text[/color] or [color=#FF0000]text[/color]',
'BBCODE_U_HELP' => 'Underline text: [u]text[/u]',
'BBCODE_W_HELP' => 'Insert URL: [url]http://url[/url] or [url=http://url]URL text[/url]',
'BBCODE_Y_HELP' => 'List: Add list element',
@@ -71,6 +72,14 @@ $lang = array_merge($lang, array(
'CANNOT_POST_ANNOUNCE' => 'Sorry but you cannot post announcements.',
'CANNOT_POST_STICKY' => 'Sorry but you cannot post sticky topics.',
'CHANGE_TOPIC_TO' => 'Change topic type to',
+ 'CHARS_POST_CONTAINS' => array(
+ 1 => 'Your message contains %1$d character.',
+ 2 => 'Your message contains %1$d characters.',
+ ),
+ 'CHARS_SIG_CONTAINS' => array(
+ 1 => 'Your signature contains %1$d character.',
+ 2 => 'Your signature contains %1$d characters.',
+ ),
'CLOSE_TAGS' => 'Close tags',
'CURRENT_TOPIC' => 'Current topic',
@@ -78,8 +87,26 @@ $lang = array_merge($lang, array(
'DELETE_MESSAGE' => 'Delete message',
'DELETE_MESSAGE_CONFIRM' => 'Are you sure you want to delete this message?',
'DELETE_OWN_POSTS' => 'Sorry but you can only delete your own posts.',
+ 'DELETE_PERMANENTLY' => 'Delete permanently',
'DELETE_POST_CONFIRM' => 'Are you sure you want to delete this post?',
- 'DELETE_POST_WARN' => 'Once deleted the post cannot be recovered',
+ 'DELETE_POST_PERMANENTLY_CONFIRM' => 'Are you sure you want to <strong>permanently</strong> delete this post?',
+ 'DELETE_POST_PERMANENTLY' => array(
+ 1 => 'Permanently delete this post so it can not be recovered',
+ 2 => 'Permanently delete %1$d posts so they can not be recovered',
+ ),
+ 'DELETE_POSTS_CONFIRM' => 'Are you sure you want to delete these posts?',
+ 'DELETE_POSTS_PERMANENTLY_CONFIRM' => 'Are you sure you want to <strong>permanently</strong> delete these posts?',
+ 'DELETE_REASON' => 'Reason for deletion',
+ 'DELETE_REASON_EXPLAIN' => 'The specified reason for deletion will be visible to moderators.',
+ 'DELETE_POST_WARN' => 'Delete this post',
+ 'DELETE_TOPIC_CONFIRM' => 'Are you sure you want to delete this topic?',
+ 'DELETE_TOPIC_PERMANENTLY' => array(
+ 1 => 'Permanently delete this topic so it can not be recovered',
+ 2 => 'Permanently delete %1$d topics so they can not be recovered',
+ ),
+ 'DELETE_TOPIC_PERMANENTLY_CONFIRM' => 'Are you sure you want to <strong>permanently</strong> delete this topic?',
+ 'DELETE_TOPICS_CONFIRM' => 'Are you sure you want to delete these topics?',
+ 'DELETE_TOPICS_PERMANENTLY_CONFIRM' => 'Are you sure you want to <strong>permanently</strong> delete these topics?',
'DISABLE_BBCODE' => 'Disable BBCode',
'DISABLE_MAGIC_URL' => 'Do not automatically parse URLs',
'DISABLE_SMILIES' => 'Disable smilies',
@@ -122,13 +149,29 @@ $lang = array_merge($lang, array(
'LOGIN_EXPLAIN_QUOTE' => 'You need to login in order to quote posts within this forum.',
'LOGIN_EXPLAIN_REPLY' => 'You need to login in order to reply to topics within this forum.',
- 'MAX_FONT_SIZE_EXCEEDED' => 'You may only use fonts up to size %1$d.',
- 'MAX_FLASH_HEIGHT_EXCEEDED' => 'Your flash files may only be up to %1$d pixels high.',
- 'MAX_FLASH_WIDTH_EXCEEDED' => 'Your flash files may only be up to %1$d pixels wide.',
- 'MAX_IMG_HEIGHT_EXCEEDED' => 'Your images may only be up to %1$d pixels high.',
- 'MAX_IMG_WIDTH_EXCEEDED' => 'Your images may only be up to %1$d pixels wide.',
+ 'MAX_FONT_SIZE_EXCEEDED' => 'You may only use fonts up to size %d.',
+ 'MAX_FLASH_HEIGHT_EXCEEDED' => array(
+ 1 => 'Your flash files may only be up to %d pixel high.',
+ 2 => 'Your flash files may only be up to %d pixels high.',
+ ),
+ 'MAX_FLASH_WIDTH_EXCEEDED' => array(
+ 1 => 'Your flash files may only be up to %d pixel wide.',
+ 2 => 'Your flash files may only be up to %d pixels wide.',
+ ),
+ 'MAX_IMG_HEIGHT_EXCEEDED' => array(
+ 1 => 'Your images may only be up to %1$d pixel high.',
+ 2 => 'Your images may only be up to %1$d pixels high.',
+ ),
+ 'MAX_IMG_WIDTH_EXCEEDED' => array(
+ 1 => 'Your images may only be up to %d pixel wide.',
+ 2 => 'Your images may only be up to %d pixels wide.',
+ ),
- 'MESSAGE_BODY_EXPLAIN' => 'Enter your message here, it may contain no more than <strong>%d</strong> characters.',
+ 'MESSAGE_BODY_EXPLAIN' => array(
+ 0 => '', // zero means no limit, so we don't view a message here.
+ 1 => 'Enter your message here, it may contain no more than <strong>%d</strong> character.',
+ 2 => 'Enter your message here, it may contain no more than <strong>%d</strong> characters.',
+ ),
'MESSAGE_DELETED' => 'This message has been deleted successfully.',
'MORE_SMILIES' => 'View more smilies',
@@ -146,12 +189,18 @@ $lang = array_merge($lang, array(
'PLACE_INLINE' => 'Place inline',
'POLL_DELETE' => 'Delete poll',
'POLL_FOR' => 'Run poll for',
- 'POLL_FOR_EXPLAIN' => 'Enter 0 or leave blank for a never ending poll.',
+ 'POLL_FOR_EXPLAIN' => 'Enter 0 for a never ending poll.',
'POLL_MAX_OPTIONS' => 'Options per user',
'POLL_MAX_OPTIONS_EXPLAIN' => 'This is the number of options each user may select when voting.',
'POLL_OPTIONS' => 'Poll options',
- 'POLL_OPTIONS_EXPLAIN' => 'Place each option on a new line. You may enter up to <strong>%d</strong> options.',
- 'POLL_OPTIONS_EDIT_EXPLAIN' => 'Place each option on a new line. You may enter up to <strong>%d</strong> options. If you remove or add options all previous votes will be reset.',
+ 'POLL_OPTIONS_EXPLAIN' => array(
+ 1 => 'Place each option on a new line. You may enter <strong>%d</strong> option.',
+ 2 => 'Place each option on a new line. You may enter up to <strong>%d</strong> options.',
+ ),
+ 'POLL_OPTIONS_EDIT_EXPLAIN' => array(
+ 1 => 'Place each option on a new line. You may enter <strong>%d</strong> option. If you remove or add options all previous votes will be reset.',
+ 2 => 'Place each option on a new line. You may enter up to <strong>%d</strong> options. If you remove or add options all previous votes will be reset.',
+ ),
'POLL_QUESTION' => 'Poll question',
'POLL_TITLE_TOO_LONG' => 'The poll title must contain fewer than 100 characters.',
'POLL_TITLE_COMP_TOO_LONG' => 'The parsed size of your poll title is too large, consider removing BBCodes or smilies.',
@@ -161,9 +210,9 @@ $lang = array_merge($lang, array(
'POST_APPROVAL_NOTIFY' => 'You will be notified when your post has been approved.',
'POST_CONFIRMATION' => 'Confirmation of post',
'POST_CONFIRM_EXPLAIN' => 'To prevent automated posts the board requires you to enter a confirmation code. The code is displayed in the image you should see below. If you are visually impaired or cannot otherwise read this code please contact the %sBoard Administrator%s.',
- 'POST_DELETED' => 'This message has been deleted successfully.',
- 'POST_EDITED' => 'This message has been edited successfully.',
- 'POST_EDITED_MOD' => 'This message has been edited successfully, but it will need to be approved by a moderator before it is publicly viewable.',
+ 'POST_DELETED' => 'This post has been deleted successfully.',
+ 'POST_EDITED' => 'This post has been edited successfully.',
+ 'POST_EDITED_MOD' => 'This post has been edited successfully, but it will need to be approved by a moderator before it is publicly viewable.',
'POST_GLOBAL' => 'Global',
'POST_ICON' => 'Post icon',
'POST_NORMAL' => 'Normal',
@@ -176,7 +225,11 @@ $lang = array_merge($lang, array(
'POST_TOPIC_AS' => 'Post topic as',
'PROGRESS_BAR' => 'Progress bar',
- 'QUOTE_DEPTH_EXCEEDED' => 'You may embed only %1$d quotes within each other.',
+ 'QUOTE_DEPTH_EXCEEDED' => array(
+ 1 => 'You may embed only %d quote within each other.',
+ 2 => 'You may embed only %d quotes within each other.',
+ ),
+ 'QUOTE_NO_NESTING' => 'You may not embed quotes within each other.',
'REMOTE_UPLOAD_TIMEOUT' => 'The specified file could not be uploaded because the request timed out.',
'SAVE' => 'Save',
@@ -188,16 +241,20 @@ $lang = array_merge($lang, array(
'SMILIES_ARE_ON' => 'Smilies are <em>ON</em>',
'STICKY_ANNOUNCE_TIME_LIMIT'=> 'Sticky/Announcement time limit',
'STICK_TOPIC_FOR' => 'Stick topic for',
- 'STICK_TOPIC_FOR_EXPLAIN' => 'Enter 0 or leave blank for a never ending Sticky/Announcement. Please note that this number is relative to the date of the post.',
+ 'STICK_TOPIC_FOR_EXPLAIN' => 'Enter 0 for a never ending Sticky/Announcement. Please note that this number is relative to the date of the post.',
'STYLES_TIP' => 'Tip: Styles can be applied quickly to selected text.',
'TOO_FEW_CHARS' => 'Your message contains too few characters.',
- 'TOO_FEW_CHARS_LIMIT' => 'Your message contains %1$d characters. The minimum number of characters you need to enter is %2$d.',
+ 'TOO_FEW_CHARS_LIMIT' => array(
+ 1 => 'You need to enter at least %1$d character.',
+ 2 => 'You need to enter at least %1$d characters.',
+ ),
'TOO_FEW_POLL_OPTIONS' => 'You must enter at least two poll options.',
'TOO_MANY_ATTACHMENTS' => 'Cannot add another attachment, %d is the maximum.',
'TOO_MANY_CHARS' => 'Your message contains too many characters.',
- 'TOO_MANY_CHARS_POST' => 'Your message contains %1$d characters. The maximum number of allowed characters is %2$d.',
- 'TOO_MANY_CHARS_SIG' => 'Your signature contains %1$d characters. The maximum number of allowed characters is %2$d.',
+ 'TOO_MANY_CHARS_LIMIT' => array(
+ 2 => 'The maximum number of allowed characters is %1$d.',
+ ),
'TOO_MANY_POLL_OPTIONS' => 'You have tried to enter too many poll options.',
'TOO_MANY_SMILIES' => 'Your message contains too many smilies. The maximum number of smilies allowed is %d.',
'TOO_MANY_URLS' => 'Your message contains too many URLs. The maximum number of URLs allowed is %d.',
@@ -206,6 +263,8 @@ $lang = array_merge($lang, array(
'UNAUTHORISED_BBCODE' => 'You cannot use certain BBCodes: %s.',
'UNGLOBALISE_EXPLAIN' => 'To switch this topic back from being global to a normal topic, you need to select the forum you wish this topic to be displayed.',
+ 'UNSUPPORTED_CHARACTERS_MESSAGE' => 'Your message contains the following unsupported characters:<br />%s',
+ 'UNSUPPORTED_CHARACTERS_SUBJECT' => 'Your subject contains the following unsupported characters:<br />%s',
'UPDATE_COMMENT' => 'Update comment',
'URL_INVALID' => 'The URL you specified is invalid.',
'URL_NOT_FOUND' => 'The file specified could not be found.',
@@ -221,7 +280,5 @@ $lang = array_merge($lang, array(
'VIEW_PRIVATE_MESSAGE' => '%sView your submitted private message%s',
'WRONG_FILESIZE' => 'The file is too big, maximum allowed size is %1$d %2$s.',
- 'WRONG_SIZE' => 'The image must be at least %1$d pixels wide, %2$d pixels high and at most %3$d pixels wide and %4$d pixels high. The submitted image is %5$d pixels wide and %6$d pixels high.',
+ 'WRONG_SIZE' => 'The image must be at least %1$s wide, %2$s high and at most %3$s wide and %4$s high. The submitted image is %5$s wide and %6$s high.',
));
-
-?> \ No newline at end of file
diff --git a/phpBB/language/en/search.php b/phpBB/language/en/search.php
index 97bc1f9bac..13e5bf7a97 100644
--- a/phpBB/language/en/search.php
+++ b/phpBB/language/en/search.php
@@ -1,12 +1,13 @@
<?php
/**
*
-* search [English]
+* This file is part of the phpBB Forum Software package.
*
-* @package language
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -41,9 +42,14 @@ $lang = array_merge($lang, array(
'DISPLAY_RESULTS' => 'Display results as',
- 'FOUND_SEARCH_MATCH' => 'Search found %d match',
- 'FOUND_SEARCH_MATCHES' => 'Search found %d matches',
- 'FOUND_MORE_SEARCH_MATCHES' => 'Search found more than %d matches',
+ 'FOUND_SEARCH_MATCHES' => array(
+ 1 => 'Search found %d match',
+ 2 => 'Search found %d matches',
+ ),
+ 'FOUND_MORE_SEARCH_MATCHES' => array(
+ 1 => 'Search found more than %d match',
+ 2 => 'Search found more than %d matches',
+ ),
'GLOBAL' => 'Global announcement',
@@ -56,24 +62,32 @@ $lang = array_merge($lang, array(
'LOGIN_EXPLAIN_UNREADSEARCH'=> 'The board requires you to be registered and logged in to view your unread posts.',
'LOGIN_EXPLAIN_NEWPOSTS' => 'The board requires you to be registered and logged in to view new posts since your last visit.',
- 'MAX_NUM_SEARCH_KEYWORDS_REFINE' => 'You specified too many words to search for. Please do not enter more than %1$d words.',
+ 'MAX_NUM_SEARCH_KEYWORDS_REFINE' => array(
+ 1 => 'You specified too many words to search for. Please do not enter more than %1$d word.',
+ 2 => 'You specified too many words to search for. Please do not enter more than %1$d words.',
+ ),
- 'NO_KEYWORDS' => 'You must specify at least one word to search for. Each word must consist of at least %d characters and must not contain more than %d characters excluding wildcards.',
+ 'NO_KEYWORDS' => 'You must specify at least one word to search for. Each word must consist of at least %s and must not contain more than %s excluding wildcards.',
'NO_RECENT_SEARCHES' => 'No searches have been carried out recently.',
'NO_SEARCH' => 'Sorry but you are not permitted to use the search system.',
'NO_SEARCH_RESULTS' => 'No suitable matches were found.',
- 'NO_SEARCH_TIME' => 'Sorry but you cannot use search at this time. Please try again in a few minutes.',
+ 'NO_SEARCH_LOAD' => 'Sorry but you cannot use search at this time. The server has high load. Please try again later.',
+ 'NO_SEARCH_TIME' => array(
+ 1 => 'Sorry but you cannot use search at this time. Please try again in %d second.',
+ 2 => 'Sorry but you cannot use search at this time. Please try again in %d seconds.',
+ ),
'NO_SEARCH_UNREADS' => 'Sorry but searching for unread posts has been disabled on this board.',
'WORD_IN_NO_POST' => 'No posts were found because the word <strong>%s</strong> is not contained in any post.',
'WORDS_IN_NO_POST' => 'No posts were found because the words <strong>%s</strong> are not contained in any post.',
'POST_CHARACTERS' => 'characters of posts',
+ 'PHRASE_SEARCH_DISABLED' => 'Searching by exact phrase is not supported on this board.',
'RECENT_SEARCHES' => 'Recent searches',
'RESULT_DAYS' => 'Limit results to previous',
'RESULT_SORT' => 'Sort results by',
'RETURN_FIRST' => 'Return first',
- 'RETURN_TO_SEARCH_ADV' => 'Return to advanced search',
+ 'GO_TO_SEARCH_ADV' => 'Go to advanced search',
'SEARCHED_FOR' => 'Search term used',
'SEARCHED_TOPIC' => 'Searched topic',
@@ -100,8 +114,11 @@ $lang = array_merge($lang, array(
'SORT_FORUM' => 'Forum',
'SORT_POST_SUBJECT' => 'Post subject',
'SORT_TIME' => 'Post time',
+ 'SPHINX_SEARCH_FAILED' => 'Search failed: %s',
+ 'SPHINX_SEARCH_FAILED_LOG' => 'Sorry, search could not be performed. More information about this failure has been logged in the error log.',
- 'TOO_FEW_AUTHOR_CHARS' => 'You must specify at least %d characters of the authors name.',
+ 'TOO_FEW_AUTHOR_CHARS' => array(
+ 1 => 'You must specify at least %d character of the authors name.',
+ 2 => 'You must specify at least %d characters of the authors name.',
+ ),
));
-
-?> \ No newline at end of file
diff --git a/phpBB/language/en/search_ignore_words.php b/phpBB/language/en/search_ignore_words.php
deleted file mode 100644
index 2dfdc0df13..0000000000
--- a/phpBB/language/en/search_ignore_words.php
+++ /dev/null
@@ -1,272 +0,0 @@
-<?php
-/**
-*
-* search_ignore_words [English]
-*
-* @package language
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
-*
-*/
-
-if (!defined('IN_PHPBB'))
-{
- exit;
-}
-
-$words = array(
- 'a',
- 'about',
- 'after',
- 'ago',
- 'all',
- 'almost',
- 'along',
- 'alot',
- 'also',
- 'am',
- 'an',
- 'and',
- 'answer',
- 'any',
- 'anybody',
- 'anybodys',
- 'anywhere',
- 'are',
- 'arent',
- 'around',
- 'as',
- 'ask',
- 'askd',
- 'at',
- 'bad',
- 'be',
- 'because',
- 'been',
- 'before',
- 'being',
- 'best',
- 'better',
- 'between',
- 'big',
- 'btw',
- 'but',
- 'by',
- 'can',
- 'cant',
- 'come',
- 'could',
- 'couldnt',
- 'day',
- 'days',
- 'days',
- 'did',
- 'didnt',
- 'do',
- 'does',
- 'doesnt',
- 'dont',
- 'down',
- 'each',
- 'etc',
- 'either',
- 'else',
- 'even',
- 'ever',
- 'every',
- 'everybody',
- 'everybodys',
- 'everyone',
- 'far',
- 'find',
- 'for',
- 'found',
- 'from',
- 'get',
- 'go',
- 'going',
- 'gone',
- 'good',
- 'got',
- 'gotten',
- 'had',
- 'has',
- 'have',
- 'havent',
- 'having',
- 'her',
- 'here',
- 'hers',
- 'him',
- 'his',
- 'home',
- 'how',
- 'hows',
- 'href',
- 'I',
- 'Ive',
- 'if',
- 'in',
- 'ini',
- 'into',
- 'is',
- 'isnt',
- 'it',
- 'its',
- 'its',
- 'just',
- 'know',
- 'large',
- 'less',
- 'like',
- 'liked',
- 'little',
- 'looking',
- 'look',
- 'looked',
- 'looking',
- 'lot',
- 'maybe',
- 'many',
- 'me',
- 'more',
- 'most',
- 'much',
- 'must',
- 'mustnt',
- 'my',
- 'near',
- 'need',
- 'never',
- 'new',
- 'news',
- 'no',
- 'none',
- 'not',
- 'nothing',
- 'now',
- 'of',
- 'off',
- 'often',
- 'old',
- 'on',
- 'once',
- 'only',
- 'oops',
- 'or',
- 'other',
- 'our',
- 'ours',
- 'out',
- 'over',
- 'page',
- 'please',
- 'put',
- 'question',
- 'questions',
- 'questioned',
- 'quote',
- 'rather',
- 'really',
- 'recent',
- 'said',
- 'saw',
- 'say',
- 'says',
- 'she',
- 'see',
- 'sees',
- 'should',
- 'sites',
- 'small',
- 'so',
- 'some',
- 'something',
- 'sometime',
- 'somewhere',
- 'soon',
- 'take',
- 'than',
- 'true',
- 'thank',
- 'that',
- 'thatd',
- 'thats',
- 'the',
- 'their',
- 'theirs',
- 'theres',
- 'theirs',
- 'them',
- 'then',
- 'there',
- 'these',
- 'they',
- 'theyll',
- 'theyd',
- 'theyre',
- 'this',
- 'those',
- 'though',
- 'through',
- 'thus',
- 'time',
- 'times',
- 'to',
- 'too',
- 'under',
- 'until',
- 'untrue',
- 'up',
- 'upon',
- 'use',
- 'users',
- 'version',
- 'very',
- 'via',
- 'want',
- 'was',
- 'way',
- 'we',
- 'well',
- 'went',
- 'were',
- 'werent',
- 'what',
- 'when',
- 'where',
- 'which',
- 'who',
- 'whom',
- 'whose',
- 'why',
- 'wide',
- 'will',
- 'with',
- 'within',
- 'without',
- 'wont',
- 'world',
- 'worse',
- 'worst',
- 'would',
- 'wrote',
- 'www',
- 'yes',
- 'yet',
- 'you',
- 'youd',
- 'youll',
- 'your',
- 'youre',
- 'yours',
- 'AFAIK',
- 'IIRC',
- 'LOL',
- 'ROTF',
- 'ROTFLMAO',
- 'YMMV',
-);
-
-?> \ No newline at end of file
diff --git a/phpBB/language/en/search_synonyms.php b/phpBB/language/en/search_synonyms.php
deleted file mode 100644
index e544456226..0000000000
--- a/phpBB/language/en/search_synonyms.php
+++ /dev/null
@@ -1,191 +0,0 @@
-<?php
-/**
-*
-* search_synonyms [English]
-*
-* @package language
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
-*
-*/
-
-if (!defined('IN_PHPBB'))
-{
- exit;
-}
-
-$synonyms = array(
- 'abcense' => 'absence',
- 'abridgement' => 'abridgment',
- 'accomodate' => 'accommodate',
- 'acknowledgment' => 'acknowledgement',
- 'airplane' => 'aeroplane',
- 'allright' => 'alright ',
- 'andy' => 'andrew',
- 'anemia' => 'anaemia',
- 'anemic' => 'anaemic',
- 'anesthesia' => 'anaesthesia',
- 'apologize' => 'apologise',
- 'archean' => 'archaean',
- 'archeology' => 'archaeology',
- 'archeozoic' => 'archaeozoic',
- 'armor' => 'armour',
- 'artic' => 'arctic',
- 'attachment' => 'attachement',
- 'attendence' => 'attendance',
-
- 'barbecue' => 'barbeque',
- 'behavior' => 'behaviour',
- 'biassed' => 'biased',
- 'biol' => 'biology',
- 'buletin' => 'bulletin',
-
- 'calender' => 'calendar',
- 'canceled' => 'cancelled',
- 'car' => 'automobile',
- 'catalog' => 'catalogue',
- 'cenozoic' => 'caenozoic',
- 'center' => 'centre',
- 'check' => 'cheque',
- 'color' => 'colour',
- 'comission' => 'commission',
- 'comittee' => 'committee',
- 'commitee' => 'committee',
- 'conceed' => 'concede',
- 'creating' => 'createing',
- 'curiculum' => 'curriculum',
-
- 'defense' => 'defence',
- 'develope' => 'develop',
- 'discription' => 'description',
- 'dulness' => 'dullness',
-
- 'encyclopedia' => 'encyclopaedia',
- 'enroll' => 'enrol',
- 'esthetic' => 'aesthetic',
- 'etiology' => 'aetiology',
- 'exhorbitant' => 'exorbitant',
- 'exhuberant' => 'exuberant',
- 'existance' => 'existence',
-
- 'favorite' => 'favourite',
- 'fetus' => 'foetus',
- 'ficticious' => 'fictitious',
- 'flavor' => 'flavour',
- 'flourescent' => 'fluorescent',
- 'foriegn' => 'foreign',
- 'fourty' => 'forty',
-
- 'gage' => 'gauge',
- 'geneology' => 'genealogy',
- 'grammer' => 'grammar',
- 'gray' => 'grey',
- 'guerilla' => 'guerrilla',
- 'gynecology' => 'gynaecology',
-
- 'harbor' => 'harbour',
- 'heighth' => 'height',
- 'hemaglobin' => 'haemaglobin',
- 'hematin' => 'haematin',
- 'hematite' => 'haematite',
- 'hematology' => 'haematology',
- 'honor' => 'honour',
-
- 'innoculate' => 'inoculate',
- 'installment' => 'instalment',
- 'irrelevent' => 'irrelevant',
- 'irrevelant' => 'irrelevant',
-
- 'jeweler' => 'jeweller',
- 'judgment' => 'judgement',
-
- 'labeled' => 'labelled',
- 'labor' => 'labour',
- 'laborer' => 'labourer',
- 'laborers' => 'labourers',
- 'laboring' => 'labouring',
- 'licence' => 'license',
- 'liesure' => 'leisure',
- 'liquify' => 'liquefy',
-
- 'maintainance' => 'maintenance',
- 'maintenence' => 'maintenance',
- 'medieval' => 'mediaeval',
- 'meter' => 'metre',
- 'milage' => 'mileage',
- 'millipede' => 'millepede',
- 'miscelaneous' => 'miscellaneous',
- 'morgage' => 'mortgage',
-
- 'noticable' => 'noticeable',
-
- 'occurence' => 'occurrence',
- 'offense' => 'offence',
- 'ommision' => 'omission',
- 'ommission' => 'omission',
- 'optimize' => 'optimise',
- 'organize' => 'organise',
-
- 'pajamas' => 'pyjamas',
- 'paleography' => 'palaeography',
- 'paleolithic' => 'palaeolithic',
- 'paleontological' => 'palaeontological',
- 'paleontologist' => 'palaeontologist',
- 'paleontology' => 'palaeontology',
- 'paleozoic' => 'palaeozoic',
- 'pamplet' => 'pamphlet',
- 'paralell' => 'parallel',
- 'parl' => 'parliament',
- 'parlt' => 'parliament',
- 'pediatric' => 'paediatric',
- 'pediatrician' => 'paediatrician',
- 'pediatrics' => 'paediatrics',
- 'pedodontia' => 'paedodontia',
- 'pedodontics' => 'paedodontics',
- 'personel' => 'personnel',
- 'practise' => 'practice',
- 'program' => 'programme',
- 'psych' => 'psychology',
-
- 'questionaire' => 'questionnaire',
-
- 'rarify' => 'rarefy',
- 'reccomend' => 'recommend',
- 'recieve' => 'receive',
- 'resistence' => 'resistance',
- 'restaraunt' => 'restaurant',
-
- 'savior' => 'saviour',
- 'sep' => 'september',
- 'seperate' => 'separate',
- 'sept' => 'september',
- 'sieze' => 'seize',
- 'summarize' => 'summarise',
- 'summerize' => 'summarise',
- 'superceed' => 'supercede',
- 'superintendant' => 'superintendent',
- 'supersede' => 'supercede',
- 'suprise' => 'surprise',
- 'surprize' => 'surprise',
- 'synchronise' => 'synchronize',
-
- 'temperary' => 'temporary',
- 'theater' => 'theatre',
- 'threshhold' => 'threshold',
- 'transfered' => 'transferred',
- 'truely' => 'truly',
- 'truley' => 'truly',
-
- 'useable' => 'usable',
-
- 'valor' => 'valour',
- 'vigor' => 'vigour',
- 'vol' => 'volume',
-
- 'whack' => 'wack',
- 'withold' => 'withhold',
-
- 'yeild' => 'yield',
-);
-?> \ No newline at end of file
diff --git a/phpBB/language/en/ucp.php b/phpBB/language/en/ucp.php
index 641cf6a70a..93ee07b1cf 100644
--- a/phpBB/language/en/ucp.php
+++ b/phpBB/language/en/ucp.php
@@ -1,12 +1,13 @@
<?php
/**
*
-* ucp [English]
+* This file is part of the phpBB Forum Software package.
*
-* @package language
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -39,20 +40,20 @@ if (empty($lang) || !is_array($lang))
$lang = array_merge($lang, array(
'TERMS_OF_USE_CONTENT' => 'By accessing “%1$s” (hereinafter “we”, “us”, “our”, “%1$s”, “%2$s”), you agree to be legally bound by the following terms. If you do not agree to be legally bound by all of the following terms then please do not access and/or use “%1$s”. We may change these at any time and we’ll do our utmost in informing you, though it would be prudent to review this regularly yourself as your continued usage of “%1$s” after changes mean you agree to be legally bound by these terms as they are updated and/or amended.<br />
<br />
- Our forums are powered by phpBB (hereinafter “they”, “them”, “their”, “phpBB software”, “www.phpbb.com”, “phpBB Group”, “phpBB Teams”) which is a bulletin board solution released under the “<a href="http://opensource.org/licenses/gpl-license.php">General Public License</a>” (hereinafter “GPL”) and can be downloaded from <a href="https://www.phpbb.com/">www.phpbb.com</a>. The phpBB software only facilitates internet based discussions, the phpBB Group are not responsible for what we allow and/or disallow as permissible content and/or conduct. For further information about phpBB, please see: <a href="https://www.phpbb.com/">https://www.phpbb.com/</a>.<br />
+ Our forums are powered by phpBB (hereinafter “they”, “them”, “their”, “phpBB software”, “www.phpbb.com”, “phpBB Limited”, “phpBB Teams”) which is a bulletin board solution released under the “<a href="http://opensource.org/licenses/gpl-2.0.php">GNU General Public License v2</a>” (hereinafter “GPL”) and can be downloaded from <a href="https://www.phpbb.com/">www.phpbb.com</a>. The phpBB software only facilitates internet based discussions; phpBB Limited is not responsible for what we allow and/or disallow as permissible content and/or conduct. For further information about phpBB, please see: <a href="https://www.phpbb.com/">https://www.phpbb.com/</a>.<br />
<br />
You agree not to post any abusive, obscene, vulgar, slanderous, hateful, threatening, sexually-orientated or any other material that may violate any laws be it of your country, the country where “%1$s” is hosted or International Law. Doing so may lead to you being immediately and permanently banned, with notification of your Internet Service Provider if deemed required by us. The IP address of all posts are recorded to aid in enforcing these conditions. You agree that “%1$s” have the right to remove, edit, move or close any topic at any time should we see fit. As a user you agree to any information you have entered to being stored in a database. While this information will not be disclosed to any third party without your consent, neither “%1$s” nor phpBB shall be held responsible for any hacking attempt that may lead to the data being compromised.
',
- 'PRIVACY_POLICY' => 'This policy explains in detail how “%1$s” along with its affiliated companies (hereinafter “we”, “us”, “our”, “%1$s”, “%2$s”) and phpBB (hereinafter “they”, “them”, “their”, “phpBB software”, “www.phpbb.com”, “phpBB Group”, “phpBB Teams”) use any information collected during any session of usage by you (hereinafter “your information”).<br />
+ 'PRIVACY_POLICY' => 'This policy explains in detail how “%1$s” along with its affiliated companies (hereinafter “we”, “us”, “our”, “%1$s”, “%2$s”) and phpBB (hereinafter “they”, “them”, “their”, “phpBB software”, “www.phpbb.com”, “phpBB Limited”, “phpBB Teams”) use any information collected during any session of usage by you (hereinafter “your information”).<br />
<br />
Your information is collected via two ways. Firstly, by browsing “%1$s” will cause the phpBB software to create a number of cookies, which are small text files that are downloaded on to your computer’s web browser temporary files. The first two cookies just contain a user identifier (hereinafter “user-id”) and an anonymous session identifier (hereinafter “session-id”), automatically assigned to you by the phpBB software. A third cookie will be created once you have browsed topics within “%1$s” and is used to store which topics have been read, thereby improving your user experience.<br />
<br />
We may also create cookies external to the phpBB software whilst browsing “%1$s”, though these are outside the scope of this document which is intended to only cover the pages created by the phpBB software. The second way in which we collect your information is by what you submit to us. This can be, and is not limited to: posting as an anonymous user (hereinafter “anonymous posts”), registering on “%1$s” (hereinafter “your account”) and posts submitted by you after registration and whilst logged in (hereinafter “your posts”).<br />
<br />
- Your account will at a bare minimum contain a uniquely identifiable name (hereinafter “your user name”), a personal password used for logging into your account (hereinafter “your password”) and a personal, valid e-mail address (hereinafter “your e-mail”). Your information for your account at “%1$s” is protected by data-protection laws applicable in the country that hosts us. Any information beyond your user name, your password, and your e-mail address required by “%1$s” during the registration process is either mandatory or optional, at the discretion of “%1$s”. In all cases, you have the option of what information in your account is publicly displayed. Furthermore, within your account, you have the option to opt-in or opt-out of automatically generated e-mails from the phpBB software.<br />
+ Your account will at a bare minimum contain a uniquely identifiable name (hereinafter “your user name”), a personal password used for logging into your account (hereinafter “your password”) and a personal, valid email address (hereinafter “your email”). Your information for your account at “%1$s” is protected by data-protection laws applicable in the country that hosts us. Any information beyond your user name, your password, and your email address required by “%1$s” during the registration process is either mandatory or optional, at the discretion of “%1$s”. In all cases, you have the option of what information in your account is publicly displayed. Furthermore, within your account, you have the option to opt-in or opt-out of automatically generated emails from the phpBB software.<br />
<br />
- Your password is ciphered (a one-way hash) so that it is secure. However, it is recommended that you do not reuse the same password across a number of different websites. Your password is the means of accessing your account at “%1$s”, so please guard it carefully and under no circumstance will anyone affiliated with “%1$s”, phpBB or another 3rd party, legitimately ask you for your password. Should you forget your password for your account, you can use the “I forgot my password” feature provided by the phpBB software. This process will ask you to submit your user name and your e-mail, then the phpBB software will generate a new password to reclaim your account.<br />
+ Your password is ciphered (a one-way hash) so that it is secure. However, it is recommended that you do not reuse the same password across a number of different websites. Your password is the means of accessing your account at “%1$s”, so please guard it carefully and under no circumstance will anyone affiliated with “%1$s”, phpBB or another 3rd party, legitimately ask you for your password. Should you forget your password for your account, you can use the “I forgot my password” feature provided by the phpBB software. This process will ask you to submit your user name and your email, then the phpBB software will generate a new password to reclaim your account.<br />
',
));
@@ -62,13 +63,13 @@ $lang = array_merge($lang, array(
'ACCOUNT_ACTIVE_ADMIN' => 'The account has now been activated.',
'ACCOUNT_ACTIVE_PROFILE' => 'Your account has now been successfully reactivated.',
'ACCOUNT_ADDED' => 'Thank you for registering, your account has been created. You may now login with your username and password.',
- 'ACCOUNT_COPPA' => 'Your account has been created but has to be approved, please check your e-mail for details.',
- 'ACCOUNT_EMAIL_CHANGED' => 'Your account has been updated. However, this board requires account reactivation on e-mail changes. An activation key has been sent to the new e-mail address you provided. Please check your e-mail for further information.',
- 'ACCOUNT_EMAIL_CHANGED_ADMIN' => 'Your account has been updated. However, this board requires account reactivation by the administrators on e-mail changes. An e-mail has been sent to them and you will be informed when your account has been reactivated.',
- 'ACCOUNT_INACTIVE' => 'Your account has been created. However, this board requires account activation, an activation key has been sent to the e-mail address you provided. Please check your e-mail for further information.',
- 'ACCOUNT_INACTIVE_ADMIN' => 'Your account has been created. However, this board requires account activation by the administrator group. An e-mail has been sent to them and you will be informed when your account has been activated.',
- 'ACTIVATION_EMAIL_SENT' => 'The activation e-mail has been sent to your e-mail address.',
- 'ACTIVATION_EMAIL_SENT_ADMIN' => 'The activation e-mail has been sent to the administrators e-mail addresses.',
+ 'ACCOUNT_COPPA' => 'Your account has been created but has to be approved, please check your email for details.',
+ 'ACCOUNT_EMAIL_CHANGED' => 'Your account has been updated. However, this board requires account reactivation on email changes. An activation key has been sent to the new email address you provided. Please check your email for further information.',
+ 'ACCOUNT_EMAIL_CHANGED_ADMIN' => 'Your account has been updated. However, this board requires account reactivation by the administrators on email changes. An email has been sent to them and you will be informed when your account has been reactivated.',
+ 'ACCOUNT_INACTIVE' => 'Your account has been created. However, this board requires account activation. An activation key has been sent to the email address you provided. Please check your email for further information and also be sure to check your junk mail box. It may take a while to get the email depending on your email provider.',
+ 'ACCOUNT_INACTIVE_ADMIN' => 'Your account has been created. However, this board requires account activation by the administrator group. An email has been sent to them and you will be informed when your account has been activated.',
+ 'ACTIVATION_EMAIL_SENT' => 'The activation email has been sent to your email address.',
+ 'ACTIVATION_EMAIL_SENT_ADMIN' => 'The activation email has been sent to the administrators email addresses.',
'ADD' => 'Add',
'ADD_BCC' => 'Add [BCC]',
'ADD_FOES' => 'Add new foes',
@@ -80,7 +81,7 @@ $lang = array_merge($lang, array(
'ADD_RULE' => 'Add rule',
'ADD_TO' => 'Add [To]',
'ADD_USERS_UCP_EXPLAIN' => 'Here you can add new users to the group. You may select whether this group becomes the new default for the selected users. Please enter each username on a separate line.',
- 'ADMIN_EMAIL' => 'Administrators can e-mail me information',
+ 'ADMIN_EMAIL' => 'Administrators can email me information',
'AGREE' => 'I agree to these terms',
'ALLOW_PM' => 'Allow users to send you private messages',
'ALLOW_PM_EXPLAIN' => 'Note that administrators and moderators will always be able to send you messages.',
@@ -88,13 +89,25 @@ $lang = array_merge($lang, array(
'ATTACHMENTS_EXPLAIN' => 'This is a list of attachments you have made in posts to this board.',
'ATTACHMENTS_DELETED' => 'Attachments successfully deleted.',
'ATTACHMENT_DELETED' => 'Attachment successfully deleted.',
+ 'AUTOLOGIN_SESSION_KEYS_DELETED'=> 'The selected "Remember Me" login keys were successfully deleted.',
'AVATAR_CATEGORY' => 'Category',
- 'AVATAR_EXPLAIN' => 'Maximum dimensions; width: %1$d pixels, height: %2$d pixels, file size: %3$.2f KiB.',
+ 'AVATAR_DRIVER_GRAVATAR_TITLE' => 'Gravatar',
+ 'AVATAR_DRIVER_GRAVATAR_EXPLAIN'=> 'Gravatar is a service that allows you to maintain the same avatar across multiple websites. Visit <a href="http://www.gravatar.com/">Gravatar</a> for more information.',
+ 'AVATAR_DRIVER_LOCAL_TITLE' => 'Gallery avatar',
+ 'AVATAR_DRIVER_LOCAL_EXPLAIN' => 'You can choose your avatar from a locally available set of avatars.',
+ 'AVATAR_DRIVER_REMOTE_TITLE' => 'Remote avatar',
+ 'AVATAR_DRIVER_REMOTE_EXPLAIN' => 'Link to avatar images from another website.',
+ 'AVATAR_DRIVER_UPLOAD_TITLE' => 'Upload avatar',
+ 'AVATAR_DRIVER_UPLOAD_EXPLAIN' => 'Upload your own custom avatar.',
+ 'AVATAR_EXPLAIN' => 'Maximum dimensions; width: %1$s, height: %2$s, file size: %3$.2f KiB.',
+ 'AVATAR_EXPLAIN_NO_FILESIZE' => 'Maximum dimensions; width: %1$s, height: %2$s.',
'AVATAR_FEATURES_DISABLED' => 'The avatar functionality is currently disabled.',
'AVATAR_GALLERY' => 'Local gallery',
'AVATAR_GENERAL_UPLOAD_ERROR' => 'Could not upload avatar to %s.',
'AVATAR_NOT_ALLOWED' => 'Your avatar cannot be displayed because avatars have been disallowed.',
'AVATAR_PAGE' => 'Page',
+ 'AVATAR_SELECT' => 'Select your avatar',
+ 'AVATAR_TYPE' => 'Avatar type',
'AVATAR_TYPE_NOT_ALLOWED' => 'Your current avatar cannot be displayed because its type has been disallowed.',
'BACK_TO_DRAFTS' => 'Back to saved drafts',
@@ -103,7 +116,6 @@ $lang = array_merge($lang, array(
'BIRTHDAY_EXPLAIN' => 'Setting a year will list your age when it is your birthday.',
'BOARD_DATE_FORMAT' => 'My date format',
'BOARD_DATE_FORMAT_EXPLAIN' => 'The syntax used is identical to the PHP <a href="http://www.php.net/date">date()</a> function.',
- 'BOARD_DST' => 'Summer Time/<abbr title="Daylight Saving Time">DST</abbr> is in effect',
'BOARD_LANGUAGE' => 'My language',
'BOARD_STYLE' => 'My board style',
'BOARD_TIMEZONE' => 'My timezone',
@@ -123,8 +135,6 @@ $lang = array_merge($lang, array(
'CLICK_RETURN_FOLDER' => '%1$sReturn to your “%3$s” folder%2$s',
'CONFIRMATION' => 'Confirmation of registration',
'CONFIRM_CHANGES' => 'Confirm changes',
- 'CONFIRM_EMAIL' => 'Confirm e-mail address',
- 'CONFIRM_EMAIL_EXPLAIN' => 'You only need to specify this if you are changing your e-mail address.',
'CONFIRM_EXPLAIN' => 'To prevent automated registrations the board requires you to enter a confirmation code. The code is displayed in the image you should see below. If you are visually impaired or cannot otherwise read this code please contact the %sBoard Administrator%s.',
'VC_REFRESH' => 'Refresh confirmation code',
'VC_REFRESH_EXPLAIN' => 'If you cannot read the code you can request a new one by clicking the button.',
@@ -168,16 +178,16 @@ $lang = array_merge($lang, array(
'DEMOTE_SELECTED' => 'Demote selected',
'DISABLE_CENSORS' => 'Enable word censoring',
'DISPLAY_GALLERY' => 'Display gallery',
- 'DOMAIN_NO_MX_RECORD_EMAIL' => 'The entered e-mail domain has no valid MX record.',
+ 'DOMAIN_NO_MX_RECORD_EMAIL' => 'The entered email domain has no valid MX record.',
'DOWNLOADS' => 'Downloads',
'DRAFTS_DELETED' => 'All selected drafts were successfully deleted.',
'DRAFTS_EXPLAIN' => 'Here you can view, edit and delete your saved drafts.',
'DRAFT_UPDATED' => 'Draft successfully updated.',
'EDIT_DRAFT_EXPLAIN' => 'Here you are able to edit your draft. Drafts do not contain attachment and poll information.',
- 'EMAIL_BANNED_EMAIL' => 'The e-mail address you entered is not allowed to be used.',
- 'EMAIL_REMIND' => 'This must be the e-mail address associated with your account. If you have not changed this via your user control panel then it is the e-mail address you registered your account with.',
- 'EMAIL_TAKEN_EMAIL' => 'The entered e-mail address is already in use.',
+ 'EMAIL_BANNED_EMAIL' => 'The email address you entered is not allowed to be used.',
+ 'EMAIL_REMIND' => 'This must be the email address associated with your account. If you have not changed this via your user control panel then it is the email address you registered your account with.',
+ 'EMAIL_TAKEN_EMAIL' => 'The entered email address is already in use.',
'EMPTY_DRAFT' => 'You must enter a message to submit your changes.',
'EMPTY_DRAFT_TITLE' => 'You must enter a draft title.',
'EXPORT_AS_XML' => 'Export as XML',
@@ -188,27 +198,49 @@ $lang = array_merge($lang, array(
'EXPORT_FOLDER' => 'Export this view',
'FIELD_REQUIRED' => 'The field “%s” must be completed.',
- 'FIELD_TOO_SHORT' => 'The field “%1$s” is too short, a minimum of %2$d characters is required.',
- 'FIELD_TOO_LONG' => 'The field “%1$s” is too long, a maximum of %2$d characters is allowed.',
- 'FIELD_TOO_SMALL' => 'The value of “%1$s” is too small, a minimum value of %2$d is required.',
- 'FIELD_TOO_LARGE' => 'The value of “%1$s” is too large, a maximum value of %2$d is allowed.',
+ 'FIELD_TOO_SHORT' => array(
+ 1 => 'The field “%2$s” is too short, a minimum of %1$d character is required.',
+ 2 => 'The field “%2$s” is too short, a minimum of %1$d characters is required.',
+ ),
+ 'FIELD_TOO_LONG' => array(
+ 1 => 'The field “%2$s” is too long, a maximum of %1$d character is allowed.',
+ 2 => 'The field “%2$s” is too long, a maximum of %1$d characters is allowed.',
+ ),
+ 'FIELD_TOO_SMALL' => 'The value of “%2$s” is too small, a minimum value of %1$d is required.',
+ 'FIELD_TOO_LARGE' => 'The value of “%2$s” is too large, a maximum value of %1$d is allowed.',
+ 'FIELD_INVALID_CHARS_INVALID' => 'The field “%s” has invalid characters.',
'FIELD_INVALID_CHARS_NUMBERS_ONLY' => 'The field “%s” has invalid characters, only numbers are allowed.',
+ 'FIELD_INVALID_CHARS_ALPHA_DOTS' => 'The field “%s” has invalid characters, only alphanumeric or . characters are allowed.',
'FIELD_INVALID_CHARS_ALPHA_ONLY' => 'The field “%s” has invalid characters, only alphanumeric characters are allowed.',
- 'FIELD_INVALID_CHARS_SPACERS_ONLY' => 'The field “%s” has invalid characters, only alphanumeric, space or -+_[] characters are allowed.',
+ 'FIELD_INVALID_CHARS_ALPHA_PUNCTUATION' => 'The field “%s” has invalid characters, only alphanumeric or _,-. characters are allowed and the first character must be alphabetic.',
+ 'FIELD_INVALID_CHARS_ALPHA_SPACERS' => 'The field “%s” has invalid characters, only alphanumeric, space or -+_[] characters are allowed.',
+ 'FIELD_INVALID_CHARS_ALPHA_UNDERSCORE' => 'The field “%s” has invalid characters, only alphanumeric or _ characters are allowed.',
+ 'FIELD_INVALID_CHARS_LETTER_NUM_DOTS' => 'The field “%s” has invalid characters, only letter, number or . characters are allowed.',
+ 'FIELD_INVALID_CHARS_LETTER_NUM_ONLY' => 'The field “%s” has invalid characters, only letter and number characters are allowed.',
+ 'FIELD_INVALID_CHARS_LETTER_NUM_PUNCTUATION' => 'The field “%s” has invalid characters, only letter, number or _,-. characters are allowed and the first character must be alphabetic.',
+ 'FIELD_INVALID_CHARS_LETTER_NUM_SPACERS' => 'The field “%s” has invalid characters, only letter, number, space or -+_[] characters are allowed.',
+ 'FIELD_INVALID_CHARS_LETTER_NUM_UNDERSCORE' => 'The field “%s” has invalid characters, only letter, number or _ characters are allowed.',
'FIELD_INVALID_DATE' => 'The field “%s” has an invalid date.',
+ 'FIELD_INVALID_URL' => 'The field “%s” has an invalid url.',
'FIELD_INVALID_VALUE' => 'The field “%s” has an invalid value.',
'FOE_MESSAGE' => 'Message from foe',
'FOES_EXPLAIN' => 'Foes are users which will be ignored by default. Posts by these users will not be fully visible. Personal messages from foes are still permitted. Please note that you cannot ignore moderators or administrators.',
'FOES_UPDATED' => 'Your foes list has been updated successfully.',
'FOLDER_ADDED' => 'Folder successfully added.',
- 'FOLDER_MESSAGE_STATUS' => '%1$d from %2$d messages stored',
+ 'FOLDER_MESSAGE_STATUS' => array(
+ 1 => '%2$d out of %1$s stored',
+ 2 => '%2$d out of %1$s stored',
+ ),
'FOLDER_NAME_EMPTY' => 'You must enter a name for this folder.',
'FOLDER_NAME_EXIST' => 'Folder <strong>%s</strong> already exists.',
'FOLDER_OPTIONS' => 'Folder options',
'FOLDER_RENAMED' => 'Folder successfully renamed.',
'FOLDER_REMOVED' => 'Folder successfully removed.',
- 'FOLDER_STATUS_MSG' => 'Folder is %1$d%% full (%2$d from %3$d messages stored)',
+ 'FOLDER_STATUS_MSG' => array(
+ 1 => 'Folder is %3$d%% full (%2$d out of %1$s stored)',
+ 2 => 'Folder is %3$d%% full (%2$d out of %1$s stored)',
+ ),
'FORWARD_PM' => 'Forward PM',
'FORCE_PASSWORD_EXPLAIN' => 'Before you may continue browsing the board you are required to change your password.',
'FRIEND_MESSAGE' => 'Message from friend',
@@ -226,6 +258,11 @@ $lang = array_merge($lang, array(
'GLOBAL_ANNOUNCEMENT' => 'Global announcement',
+ 'GRAVATAR_AVATAR_EMAIL' => 'Gravatar email',
+ 'GRAVATAR_AVATAR_EMAIL_EXPLAIN' => 'Enter the email address you used for registering your account on <a href="http://www.gravatar.com/">Gravatar</a>.',
+ 'GRAVATAR_AVATAR_SIZE' => 'Avatar dimensions',
+ 'GRAVATAR_AVATAR_SIZE_EXPLAIN' => 'Specify the width and height of the avatar, leave blank to attempt automatic verification.',
+
'HIDE_ONLINE' => 'Hide my online status',
'HIDE_ONLINE_EXPLAIN' => 'Changing this setting won’t become effective until your next visit to the board.',
'HOLD_NEW_MESSAGES' => 'Do not accept new messages (New messages will be held back until enough space is available)',
@@ -246,6 +283,12 @@ $lang = array_merge($lang, array(
'LINK_REMOTE_SIZE' => 'Avatar dimensions',
'LINK_REMOTE_SIZE_EXPLAIN' => 'Specify the width and height of the avatar, leave blank to attempt automatic verification.',
'LOGIN_EXPLAIN_UCP' => 'Please login in order to access the User Control Panel.',
+ 'LOGIN_LINK' => 'Link or register your account on an external service with your board account',
+ 'LOGIN_LINK_EXPLAIN' => 'You have attempted to login with an external service that is not yet connected to an account on this board. You must now either link this account to an existing account or create a new account.',
+ 'LOGIN_LINK_MISSING_DATA' => 'Data that is necessary to link your account with an external service is not available. Please restart the login process.',
+ 'LOGIN_LINK_NO_DATA_PROVIDED' => 'No data has been provided to this page to link an external account to a forum account. Please contact the board administrator if you continue to experience problems.',
+ 'LOGIN_KEY' => 'Login Key',
+ 'LOGIN_TIME' => 'Login Time',
'LOGIN_REDIRECT' => 'You have been successfully logged in.',
'LOGOUT_FAILED' => 'You were not logged out, as the request did not match your session. Please contact the board administrator if you continue to experience problems.',
'LOGOUT_REDIRECT' => 'You have been successfully logged out.',
@@ -266,19 +309,42 @@ $lang = array_merge($lang, array(
'MOVE_DELETED_MESSAGES_TO' => 'Move messages from removed folder to',
'MOVE_DOWN' => 'Move down',
'MOVE_MARKED_TO_FOLDER' => 'Move marked to %s',
- 'MOVE_PM_ERROR' => 'An error occurred while moving the messages to the new folder, only %1$d from %2$d messages were moved.',
+ 'MOVE_PM_ERROR' => array(
+ 1 => 'An error occurred while moving the messages to the new folder, only %2$d out of %1$s was moved.',
+ 2 => 'An error occurred while moving the messages to the new folder, only %2$d out of %1$s were moved.',
+ ),
'MOVE_TO_FOLDER' => 'Move to folder',
'MOVE_UP' => 'Move up',
- 'NEW_EMAIL_CONFIRM_EMPTY' => 'You did not enter a confirm e-mail address.',
- 'NEW_EMAIL_ERROR' => 'The e-mail addresses you entered do not match.',
'NEW_FOLDER_NAME' => 'New folder name',
'NEW_PASSWORD' => 'New password',
'NEW_PASSWORD_CONFIRM_EMPTY' => 'You did not enter a confirm password.',
'NEW_PASSWORD_ERROR' => 'The passwords you entered do not match.',
+
+ 'NOTIFICATIONS_MARK_ALL_READ' => 'Mark all notifications read',
+ 'NOTIFICATIONS_MARK_ALL_READ_CONFIRM' => 'Are you sure you want to mark all notifications read?',
+ 'NOTIFICATIONS_MARK_ALL_READ_SUCCESS' => 'All notifications have been marked read.',
+ 'NOTIFICATION_GROUP_MISCELLANEOUS' => 'Miscellaneous Notifications',
+ 'NOTIFICATION_GROUP_MODERATION' => 'Moderation Notifications',
+ 'NOTIFICATION_GROUP_ADMINISTRATION' => 'Administration Notifications',
+ 'NOTIFICATION_GROUP_POSTING' => 'Posting Notifications',
+ 'NOTIFICATION_METHOD_EMAIL' => 'Email',
+ 'NOTIFICATION_METHOD_JABBER' => 'Jabber',
+ 'NOTIFICATION_TYPE' => 'Notification type',
+ 'NOTIFICATION_TYPE_BOOKMARK' => 'Someone replies to a topic you have bookmarked',
+ 'NOTIFICATION_TYPE_GROUP_REQUEST' => 'Someone requests to join a group you lead',
+ 'NOTIFICATION_TYPE_IN_MODERATION_QUEUE' => 'A post or topic needs approval',
+ 'NOTIFICATION_TYPE_MODERATION_QUEUE' => 'Your topics/posts are approved or disapproved by a moderator',
+ 'NOTIFICATION_TYPE_PM' => 'Someone sends you a private message',
+ 'NOTIFICATION_TYPE_POST' => 'Someone replies to a topic to which you are subscribed',
+ 'NOTIFICATION_TYPE_QUOTE' => 'Someone quotes you in a post',
+ 'NOTIFICATION_TYPE_REPORT' => 'Someone reports a post',
+ 'NOTIFICATION_TYPE_TOPIC' => 'Someone creates a topic in a forum to which you are subscribed',
+ 'NOTIFICATION_TYPE_ADMIN_ACTIVATE_USER' => 'User requiring activation',
+
'NOTIFY_METHOD' => 'Notification method',
'NOTIFY_METHOD_BOTH' => 'Both',
- 'NOTIFY_METHOD_EMAIL' => 'E-mail only',
+ 'NOTIFY_METHOD_EMAIL' => 'Email only',
'NOTIFY_METHOD_EXPLAIN' => 'Method for sending messages sent via this board.',
'NOTIFY_METHOD_IM' => 'Jabber only',
'NOTIFY_ON_PM' => 'Notify me on new private messages',
@@ -293,10 +359,13 @@ $lang = array_merge($lang, array(
'NOT_ADDED_FOES_SELF' => 'You cannot add yourself to the foes list.',
'NOT_AGREE' => 'I do not agree to these terms',
'NOT_ENOUGH_SPACE_FOLDER' => 'The destination folder “%s” seems to be full. The requested action has not been taken.',
- 'NOT_MOVED_MESSAGE' => 'You have 1 private message currently on hold because of full folder.',
- 'NOT_MOVED_MESSAGES' => 'You have %d private messages currently on hold because of full folder.',
+ 'NOT_MOVED_MESSAGES' => array(
+ 1 => 'You have %d private message currently on hold because of full folder.',
+ 2 => 'You have %d private messages currently on hold because of full folder.',
+ ),
'NO_ACTION_MODE' => 'No message action specified.',
'NO_AUTHOR' => 'No author defined for this message',
+ 'NO_AVATAR' => 'No avatar selected',
'NO_AVATAR_CATEGORY' => 'None',
'NO_AUTH_DELETE_MESSAGE' => 'You are not authorised to delete private messages.',
@@ -304,6 +373,7 @@ $lang = array_merge($lang, array(
'NO_AUTH_FORWARD_MESSAGE' => 'You are not authorised to forward private messages.',
'NO_AUTH_GROUP_MESSAGE' => 'You are not authorised to send private messages to groups.',
'NO_AUTH_PASSWORD_REMINDER' => 'You are not authorised to request a new password.',
+ 'NO_AUTH_PROFILEINFO' => 'You are not authorised to change your profile information.',
'NO_AUTH_READ_HOLD_MESSAGE' => 'You are not authorised to read private messages that are on hold.',
'NO_AUTH_READ_MESSAGE' => 'You are not authorised to read private messages.',
'NO_AUTH_READ_REMOVED_MESSAGE' => 'You are not able to read this message because it was removed by the author.',
@@ -314,7 +384,7 @@ $lang = array_merge($lang, array(
'NO_BOOKMARKS' => 'You have no bookmarks.',
'NO_BOOKMARKS_SELECTED' => 'You have selected no bookmarks.',
'NO_EDIT_READ_MESSAGE' => 'Private message cannot be edited because it has already been read.',
- 'NO_EMAIL_USER' => 'The e-mail/username information submitted could not be found.',
+ 'NO_EMAIL_USER' => 'The email/username information submitted could not be found.',
'NO_FOES' => 'No foes currently defined',
'NO_FRIENDS' => 'No friends currently defined',
'NO_FRIENDS_OFFLINE' => 'No friends offline',
@@ -334,13 +404,13 @@ $lang = array_merge($lang, array(
'NO_WATCHED_SELECTED' => 'You have not selected any subscribed topics or forums.',
'NO_WATCHED_TOPICS' => 'You are not subscribed to any topics.',
- 'PASS_TYPE_ALPHA_EXPLAIN' => 'Password must be between %1$d and %2$d characters long, must contain letters in mixed case and must contain numbers.',
- 'PASS_TYPE_ANY_EXPLAIN' => 'Must be between %1$d and %2$d characters.',
- 'PASS_TYPE_CASE_EXPLAIN' => 'Password must be between %1$d and %2$d characters long and must contain letters in mixed case.',
- 'PASS_TYPE_SYMBOL_EXPLAIN' => 'Password must be between %1$d and %2$d characters long, must contain letters in mixed case, must contain numbers and must contain symbols.',
+ 'PASS_TYPE_ALPHA_EXPLAIN' => 'Password must be between %1$s and %2$s long, must contain letters in mixed case and must contain numbers.',
+ 'PASS_TYPE_ANY_EXPLAIN' => 'Must be between %1$s and %2$s.',
+ 'PASS_TYPE_CASE_EXPLAIN' => 'Password must be between %1$s and %2$s long and must contain letters in mixed case.',
+ 'PASS_TYPE_SYMBOL_EXPLAIN' => 'Password must be between %1$s and %2$s long, must contain letters in mixed case, must contain numbers and must contain symbols.',
'PASSWORD' => 'Password',
'PASSWORD_ACTIVATED' => 'Your new password has been activated.',
- 'PASSWORD_UPDATED' => 'A new password was sent to your registered e-mail address.',
+ 'PASSWORD_UPDATED' => 'A new password was sent to your registered email address.',
'PERMISSIONS_RESTORED' => 'Successfully restored original permissions.',
'PERMISSIONS_TRANSFERRED' => 'Successfully transferred permissions from <strong>%s</strong>, you are now able to browse the board with this user’s permissions.<br />Please note that admin permissions were not transferred. You are able to revert to your permission set at any time.',
'PM_DISABLED' => 'Private messaging has been disabled on this board.',
@@ -348,13 +418,16 @@ $lang = array_merge($lang, array(
'PM_FROM_REMOVED_AUTHOR' => 'This message was sent by a user no longer registered.',
'PM_ICON' => 'PM icon',
'PM_INBOX' => 'Inbox',
+ 'PM_MARK_ALL_READ' => 'Mark all messages read',
+ 'PM_MARK_ALL_READ_SUCCESS' => 'All private messages in this folder have been marked read',
'PM_NO_USERS' => 'The requested users to be added do not exist.',
'PM_OUTBOX' => 'Outbox',
'PM_SENTBOX' => 'Sent messages',
'PM_SUBJECT' => 'Message subject',
'PM_TO' => 'Send to',
+ 'PM_TOOLS' => 'Message tools',
+ 'PM_USERS_REMOVED_NO_PERMISSION' => 'Some users couldn’t be added as they do not have permission to read private messages.',
'PM_USERS_REMOVED_NO_PM' => 'Some users couldn’t be added as they have disabled private message receipt.',
- 'POPUP_ON_PM' => 'Pop up window on new private message',
'POST_EDIT_PM' => 'Edit message',
'POST_FORWARD_PM' => 'Forward message',
'POST_NEW_PM' => 'Compose message',
@@ -366,6 +439,8 @@ $lang = array_merge($lang, array(
'PREFERENCES_UPDATED' => 'Your preferences have been updated.',
'PROFILE_INFO_NOTICE' => 'Please note that this information may be viewable to other members. Be careful when including any personal details. Any fields marked with a * must be completed.',
'PROFILE_UPDATED' => 'Your profile has been updated.',
+ 'PROFILE_AUTOLOGIN_KEYS' => 'The "Remember Me" login keys automatically log you in when you visit the board. If you logout, the remember me login key is deleted only on the computer you are using to logout. Here you can see remember login keys created on other computers you used to access this site.',
+ 'PROFILE_NO_AUTOLOGIN_KEYS' => 'There are no saved "Remember Me" login keys.',
'RECIPIENT' => 'Recipient',
'RECIPIENTS' => 'Recipients',
@@ -390,17 +465,21 @@ $lang = array_merge($lang, array(
'RULE_DELETED' => 'Rule successfully removed.',
'RULE_LIMIT_REACHED' => 'You cannot add more PM rules. You have reached the maximum number of rules.',
'RULE_NOT_DEFINED' => 'Rule not correctly specified.',
- 'RULE_REMOVED_MESSAGE' => 'One private message had been removed due to private message filters.',
- 'RULE_REMOVED_MESSAGES' => '%d private messages were removed due to private message filters.',
+ 'RULE_REMOVED_MESSAGES' => array(
+ 1 => '%d private message was removed due to private message filters.',
+ 2 => '%d private messages were removed due to private message filters.',
+ ),
'SAME_PASSWORD_ERROR' => 'The new password you entered is the same as your current password.',
'SEARCH_YOUR_POSTS' => 'Show your posts',
'SEND_PASSWORD' => 'Send password',
'SENT_AT' => 'Sent', // Used before dates in private messages
- 'SHOW_EMAIL' => 'Users can contact me by e-mail',
+ 'SHOW_EMAIL' => 'Users can contact me by email',
'SIGNATURE_EXPLAIN' => 'This is a block of text that can be added to posts you make. There is a %d character limit.',
'SIGNATURE_PREVIEW' => 'Your signature will appear like this in posts',
'SIGNATURE_TOO_LONG' => 'Your signature is too long.',
+ 'SELECT_CURRENT_TIME' => 'Select current time',
+ 'SELECT_TIMEZONE' => 'Select timezone',
'SORT' => 'Sort',
'SORT_COMMENT' => 'File comment',
'SORT_DOWNLOADS' => 'Downloads',
@@ -410,20 +489,33 @@ $lang = array_merge($lang, array(
'SORT_SIZE' => 'File size',
'TIMEZONE' => 'Timezone',
- 'TO' => 'To',
+ 'TIMEZONE_DATE_SUGGESTION' => 'Suggestion: %s',
+ 'TIMEZONE_INVALID' => 'The timezone you selected is invalid.',
+ 'TO' => 'Recipient',
+ 'TO_MASS' => 'Recipients',
+ 'TO_ADD' => 'Add recipient',
+ 'TO_ADD_MASS' => 'Add recipients',
+ 'TO_ADD_GROUPS' => 'Add groups',
'TOO_MANY_RECIPIENTS' => 'You tried to send a private message to too many recipients.',
'TOO_MANY_REGISTERS' => 'You have exceeded the maximum number of registration attempts for this session. Please try again later.',
'UCP' => 'User Control Panel',
'UCP_ACTIVATE' => 'Activate account',
- 'UCP_ADMIN_ACTIVATE' => 'Please note that you will need to enter a valid e-mail address before your account is activated. The administrator will review your account and if approved you will receive an e-mail at the address you specified.',
- 'UCP_AIM' => 'AOL Instant Messenger',
+ 'UCP_ADMIN_ACTIVATE' => 'Please note that you will need to enter a valid email address before your account is activated. The administrator will review your account and if approved you will receive an email at the address you specified.',
'UCP_ATTACHMENTS' => 'Attachments',
+ 'UCP_AUTH_LINK' => 'External accounts',
+ 'UCP_AUTH_LINK_ASK' => 'You currently have no account associated with this external service. Click the button below to link your board account to an account with this external service.',
+ 'UCP_AUTH_LINK_ID' => 'Unique identifier',
+ 'UCP_AUTH_LINK_LINK' => 'Link',
+ 'UCP_AUTH_LINK_MANAGE' => 'Manage external account associations',
+ 'UCP_AUTH_LINK_NOT_SUPPORTED' => 'Linking board accounts to external services is not supported by this board’s current authentication method.',
+ 'UCP_AUTH_LINK_TITLE' => 'Manage your external account associations',
+ 'UCP_AUTH_LINK_UNLINK' => 'Unlink',
'UCP_COPPA_BEFORE' => 'Before %s',
'UCP_COPPA_ON_AFTER' => 'On or after %s',
- 'UCP_EMAIL_ACTIVATE' => 'Please note that you will need to enter a valid e-mail address before your account is activated. You will receive an e-mail at the address you provide that contains an account activation link.',
- 'UCP_ICQ' => 'ICQ number',
+ 'UCP_EMAIL_ACTIVATE' => 'Please note that you will need to enter a valid email address before your account is activated. You will receive an email at the address you provide that contains an account activation link.',
'UCP_JABBER' => 'Jabber address',
+ 'UCP_LOGIN_LINK' => 'Set up an external account association',
'UCP_MAIN' => 'Overview',
'UCP_MAIN_ATTACHMENTS' => 'Manage attachments',
@@ -432,9 +524,13 @@ $lang = array_merge($lang, array(
'UCP_MAIN_FRONT' => 'Front page',
'UCP_MAIN_SUBSCRIBED' => 'Manage subscriptions',
- 'UCP_MSNM' => 'WL/MSN Messenger',
'UCP_NO_ATTACHMENTS' => 'You have posted no files.',
+ 'UCP_NOTIFICATION_LIST' => 'Manage notifications',
+ 'UCP_NOTIFICATION_LIST_EXPLAIN' => 'Here you may view all past notifications.',
+ 'UCP_NOTIFICATION_OPTIONS' => 'Edit notification options',
+ 'UCP_NOTIFICATION_OPTIONS_EXPLAIN' => 'Here you can set your preferred notification methods for the board.',
+
'UCP_PREFS' => 'Board preferences',
'UCP_PREFS_PERSONAL' => 'Edit global settings',
'UCP_PREFS_POST' => 'Edit posting defaults',
@@ -444,8 +540,6 @@ $lang = array_merge($lang, array(
'UCP_PM_COMPOSE' => 'Compose message',
'UCP_PM_DRAFTS' => 'Manage PM drafts',
'UCP_PM_OPTIONS' => 'Rules, folders &amp; settings',
- 'UCP_PM_POPUP' => 'Private messages',
- 'UCP_PM_POPUP_TITLE' => 'Private message popup',
'UCP_PM_UNREAD' => 'Unread messages',
'UCP_PM_VIEW' => 'View messages',
@@ -454,16 +548,17 @@ $lang = array_merge($lang, array(
'UCP_PROFILE_PROFILE_INFO' => 'Edit profile',
'UCP_PROFILE_REG_DETAILS' => 'Edit account settings',
'UCP_PROFILE_SIGNATURE' => 'Edit signature',
+ 'UCP_PROFILE_AUTOLOGIN_KEYS'=> 'Manage “Remember Me” login keys',
'UCP_USERGROUPS' => 'Usergroups',
'UCP_USERGROUPS_MEMBER' => 'Edit memberships',
'UCP_USERGROUPS_MANAGE' => 'Manage groups',
+ 'UCP_PASSWORD_RESET_DISABLED' => 'The password reset functionality has been disabled. If you need help accessing your account, please contact the %sBoard Administrator%s',
'UCP_REGISTER_DISABLE' => 'Creating a new account is currently not possible.',
'UCP_REMIND' => 'Send password',
- 'UCP_RESEND' => 'Send activation e-mail',
+ 'UCP_RESEND' => 'Send activation email',
'UCP_WELCOME' => 'Welcome to the User Control Panel. From here you can monitor, view and update your profile, preferences, subscribed forums and topics. You can also send messages to other users (if permitted). Please ensure you read any announcements before continuing.',
- 'UCP_YIM' => 'Yahoo Messenger',
'UCP_ZEBRA' => 'Friends &amp; Foes',
'UCP_ZEBRA_FOES' => 'Manage foes',
'UCP_ZEBRA_FRIENDS' => 'Manage friends',
@@ -473,12 +568,12 @@ $lang = array_merge($lang, array(
'UPLOAD_AVATAR_FILE' => 'Upload from your machine',
'UPLOAD_AVATAR_URL' => 'Upload from a URL',
'UPLOAD_AVATAR_URL_EXPLAIN' => 'Enter the URL of the location containing the image. The image will be copied to this site.',
- 'USERNAME_ALPHA_ONLY_EXPLAIN' => 'Username must be between %1$d and %2$d chars long and use only alphanumeric characters.',
- 'USERNAME_ALPHA_SPACERS_EXPLAIN'=> 'Username must be between %1$d and %2$d chars long and use alphanumeric, space or -+_[] characters.',
- 'USERNAME_ASCII_EXPLAIN' => 'Username must be between %1$d and %2$d chars long and use only ASCII characters, so no special symbols.',
- 'USERNAME_LETTER_NUM_EXPLAIN' => 'Username must be between %1$d and %2$d chars long and use only letter or number characters.',
- 'USERNAME_LETTER_NUM_SPACERS_EXPLAIN'=> 'Username must be between %1$d and %2$d chars long and use letter, number, space or -+_[] characters.',
- 'USERNAME_CHARS_ANY_EXPLAIN' => 'Length must be between %1$d and %2$d characters.',
+ 'USERNAME_ALPHA_ONLY_EXPLAIN' => 'Username must be between %1$s and %2$s long and use only alphanumeric characters.',
+ 'USERNAME_ALPHA_SPACERS_EXPLAIN'=> 'Username must be between %1$s and %2$s long and use alphanumeric, space or -+_[] characters.',
+ 'USERNAME_ASCII_EXPLAIN' => 'Username must be between %1$s and %2$s long and use only ASCII characters, so no special symbols.',
+ 'USERNAME_LETTER_NUM_EXPLAIN' => 'Username must be between %1$s and %2$s long and use only letter or number characters.',
+ 'USERNAME_LETTER_NUM_SPACERS_EXPLAIN'=> 'Username must be between %1$s and %2$s long and use letter, number, space or -+_[] characters.',
+ 'USERNAME_CHARS_ANY_EXPLAIN' => 'Length must be between %1$s and %2$s.',
'USERNAME_TAKEN_USERNAME' => 'The username you entered is already in use, please select an alternative.',
'USERNAME_DISALLOWED_USERNAME' => 'The username you entered has been disallowed or contains a disallowed word. Please choose a different name.',
'USER_NOT_FOUND_OR_INACTIVE' => 'The usernames you specified could either not be found or are not activated users.',
@@ -491,10 +586,13 @@ $lang = array_merge($lang, array(
'VIEW_NEXT_PM' => 'Next PM',
'VIEW_PM' => 'View message',
'VIEW_PM_INFO' => 'Message details',
- 'VIEW_PM_MESSAGE' => '1 message',
- 'VIEW_PM_MESSAGES' => '%d messages',
+ 'VIEW_PM_MESSAGES' => array(
+ 1 => '%d message',
+ 2 => '%d messages',
+ ),
'VIEW_PREVIOUS_HISTORY' => 'Previous PM in history',
'VIEW_PREVIOUS_PM' => 'Previous PM',
+ 'VIEW_PROFILE' => 'View profile',
'VIEW_SIGS' => 'Display signatures',
'VIEW_SMILIES' => 'Display smilies as images',
'VIEW_TOPICS_DAYS' => 'Display topics from previous days',
@@ -520,14 +618,14 @@ $lang = array_merge($lang, array(
'PLACE_INTO_FOLDER' => 'Place into folder',
'MARK_AS_READ' => 'Mark as read',
'MARK_AS_IMPORTANT' => 'Mark message',
- 'DELETE_MESSAGE' => 'Delete message'
+ 'DELETE_MESSAGE' => 'Delete message',
),
'PM_CHECK' => array(
'SUBJECT' => 'Subject',
'SENDER' => 'Sender',
'MESSAGE' => 'Message',
'STATUS' => 'Message status',
- 'TO' => 'Sent To'
+ 'TO' => 'Sent To',
),
'PM_RULE' => array(
'IS_LIKE' => 'is like',
@@ -543,10 +641,9 @@ $lang = array_merge($lang, array(
'ANSWERED' => 'answered',
'FORWARDED' => 'forwarded',
'TO_GROUP' => 'to my default usergroup',
- 'TO_ME' => 'to me'
+ 'TO_ME' => 'to me',
),
-
'GROUPS_EXPLAIN' => 'Usergroups enable board admins to better administer users. By default you will be placed in a specific group, this is your default group. This group defines how you may appear to other users, for example your username colouration, avatar, rank, etc. Depending on whether the administrator allows it you may be allowed to change your default group. You may also be placed in or allowed to join other groups. Some groups may give you additional permissions to view content or increase your capabilities in other areas.',
'GROUP_LEADER' => 'Leaderships',
'GROUP_MEMBER' => 'Memberships',
@@ -559,5 +656,3 @@ $lang = array_merge($lang, array(
'NO_PENDING' => 'No pending memberships',
'NO_NONMEMBER' => 'No non-member groups',
));
-
-?> \ No newline at end of file
diff --git a/phpBB/language/en/viewforum.php b/phpBB/language/en/viewforum.php
index d2fae20c62..9946a3eda4 100644
--- a/phpBB/language/en/viewforum.php
+++ b/phpBB/language/en/viewforum.php
@@ -1,12 +1,13 @@
<?php
/**
*
-* viewforum [English]
+* This file is part of the phpBB Forum Software package.
*
-* @package language
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -64,8 +65,8 @@ $lang = array_merge($lang, array(
'UNREAD_POSTS_LOCKED' => 'Unread posts [ Locked ]',
'VIEW_FORUM' => 'View forum',
- 'VIEW_FORUM_TOPIC' => '1 topic',
- 'VIEW_FORUM_TOPICS' => '%d topics',
+ 'VIEW_FORUM_TOPICS' => array(
+ 1 => '%d topic',
+ 2 => '%d topics',
+ ),
));
-
-?> \ No newline at end of file
diff --git a/phpBB/language/en/viewtopic.php b/phpBB/language/en/viewtopic.php
index 3e1874f1ab..5890eecdb6 100644
--- a/phpBB/language/en/viewtopic.php
+++ b/phpBB/language/en/viewtopic.php
@@ -1,12 +1,13 @@
<?php
/**
*
-* viewtopic [English]
+* This file is part of the phpBB Forum Software package.
*
-* @package language
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -36,6 +37,7 @@ if (empty($lang) || !is_array($lang))
// in a url you again do not need to specify an order e.g., 'Click %sHERE%s' is fine
$lang = array_merge($lang, array(
+ 'APPROVE' => 'Approve',
'ATTACHMENT' => 'Attachment',
'ATTACHMENT_FUNCTIONALITY_DISABLED' => 'The attachments feature has been disabled.',
@@ -48,20 +50,23 @@ $lang = array_merge($lang, array(
'BUMP_TOPIC' => 'Bump topic',
'CODE' => 'Code',
- 'COLLAPSE_QR' => 'Hide Quick Reply',
'DELETE_TOPIC' => 'Delete topic',
+ 'DELETED_INFORMATION' => 'Deleted by %1$s on %2$s',
+ 'DISAPPROVE' => 'Disapprove',
'DOWNLOAD_NOTICE' => 'You do not have the required permissions to view the files attached to this post.',
- 'EDITED_TIMES_TOTAL' => 'Last edited by %1$s on %2$s, edited %3$d times in total.',
- 'EDITED_TIME_TOTAL' => 'Last edited by %1$s on %2$s, edited %3$d time in total.',
- 'EMAIL_TOPIC' => 'E-mail friend',
+ 'EDITED_TIMES_TOTAL' => array(
+ 1 => 'Last edited by %2$s on %3$s, edited %1$d time in total.',
+ 2 => 'Last edited by %2$s on %3$s, edited %1$d times in total.',
+ ),
+ 'EMAIL_TOPIC' => 'Email topic',
'ERROR_NO_ATTACHMENT' => 'The selected attachment does not exist anymore.',
'FILE_NOT_FOUND_404' => 'The file <strong>%s</strong> does not exist.',
'FORK_TOPIC' => 'Copy topic',
- 'FULL_EDITOR' => 'Full Editor',
-
+ 'FULL_EDITOR' => 'Full Editor &amp; Preview',
+
'LINKAGE_FORBIDDEN' => 'You are not authorised to view, download or link from/to this site.',
'LOGIN_NOTIFY_TOPIC' => 'You have been notified about this topic, please login to view it.',
'LOGIN_VIEWTOPIC' => 'The board requires you to be registered and logged in to view this topic.',
@@ -70,8 +75,10 @@ $lang = array_merge($lang, array(
'MAKE_GLOBAL' => 'Change to “Global”',
'MAKE_NORMAL' => 'Change to “Standard Topic”',
'MAKE_STICKY' => 'Change to “Sticky”',
- 'MAX_OPTIONS_SELECT' => 'You may select up to <strong>%d</strong> options',
- 'MAX_OPTION_SELECT' => 'You may select <strong>1</strong> option',
+ 'MAX_OPTIONS_SELECT' => array(
+ 1 => 'You may select <strong>%d</strong> option',
+ 2 => 'You may select up to <strong>%d</strong> options',
+ ),
'MISSING_INLINE_ATTACHMENT' => 'The attachment <strong>%s</strong> is no longer available',
'MOVE_TOPIC' => 'Move topic',
@@ -85,6 +92,7 @@ $lang = array_merge($lang, array(
'POLL_ENDED_AT' => 'Poll ended at %s',
'POLL_RUN_TILL' => 'Poll runs till %s',
'POLL_VOTED_OPTION' => 'You voted for this option',
+ 'POST_DELETED_RESTORE' => 'This post has been deleted. It can be restored.',
'PRINT_TOPIC' => 'Print view',
'QUICK_MOD' => 'Quick-mod tools',
@@ -92,11 +100,13 @@ $lang = array_merge($lang, array(
'QUOTE' => 'Quote',
'REPLY_TO_TOPIC' => 'Reply to topic',
+ 'RESTORE' => 'Restore',
+ 'RESTORE_TOPIC' => 'Restore topic',
'RETURN_POST' => '%sReturn to the post%s',
- 'SHOW_QR' => 'Quick Reply',
'SUBMIT_VOTE' => 'Submit vote',
+ 'TOPIC_TOOLS' => 'Topic tools',
'TOTAL_VOTES' => 'Total votes',
'UNLOCK_TOPIC' => 'Unlock topic',
@@ -105,13 +115,12 @@ $lang = array_merge($lang, array(
'VIEW_NEXT_TOPIC' => 'Next topic',
'VIEW_PREVIOUS_TOPIC' => 'Previous topic',
'VIEW_RESULTS' => 'View results',
- 'VIEW_TOPIC_POST' => '1 post',
- 'VIEW_TOPIC_POSTS' => '%d posts',
+ 'VIEW_TOPIC_POSTS' => array(
+ 1 => '%d post',
+ 2 => '%d posts',
+ ),
'VIEW_UNREAD_POST' => 'First unread post',
- 'VISIT_WEBSITE' => 'WWW',
'VOTE_SUBMITTED' => 'Your vote has been cast.',
'VOTE_CONVERTED' => 'Changing votes is not supported for converted polls.',
));
-
-?> \ No newline at end of file
diff --git a/phpBB/mcp.php b/phpBB/mcp.php
index e209a9095f..f9d46db528 100644
--- a/phpBB/mcp.php
+++ b/phpBB/mcp.php
@@ -1,14 +1,16 @@
<?php
/**
*
-* @package mcp
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
-
/**
* @ignore
*/
@@ -17,6 +19,7 @@ $phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);
include($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
+include($phpbb_root_path . 'includes/functions_mcp.' . $phpEx);
require($phpbb_root_path . 'includes/functions_module.' . $phpEx);
// Start session management
@@ -32,15 +35,8 @@ $template->assign_var('S_IN_MCP', true);
// Basic parameter data
$id = request_var('i', '');
-if (isset($_REQUEST['mode']) && is_array($_REQUEST['mode']))
-{
- $mode = request_var('mode', array(''));
- list($mode, ) = each($mode);
-}
-else
-{
- $mode = request_var('mode', '');
-}
+$mode = request_var('mode', array(''));
+$mode = sizeof($mode) ? array_shift($mode) : request_var('mode', '');
// Only Moderators can go beyond this point
if (!$user->data['is_registered'])
@@ -58,7 +54,7 @@ $action = request_var('action', '');
$action_ary = request_var('action', array('' => 0));
$forum_action = request_var('forum_action', '');
-if ($forum_action !== '' && !empty($_POST['sort']))
+if ($forum_action !== '' && $request->variable('sort', false, false, \phpbb\request\request_interface::POST))
{
$action = $forum_action;
}
@@ -93,7 +89,7 @@ if ($post_id)
$db->sql_freeresult($result);
$topic_id = (int) $row['topic_id'];
- $forum_id = (int) ($row['forum_id']) ? $row['forum_id'] : $forum_id;
+ $forum_id = (int) $row['forum_id'];
}
else if ($topic_id)
{
@@ -122,7 +118,7 @@ if (!$auth->acl_getf_global('m_'))
$allow_user = false;
if ($quickmod && isset($user_quickmod_actions[$action]) && $user->data['is_registered'] && $auth->acl_gets($user_quickmod_actions[$action], $forum_id))
{
- $topic_info = get_topic_data(array($topic_id));
+ $topic_info = phpbb_get_topic_data(array($topic_id));
if ($topic_info[$topic_id]['topic_poster'] == $user->data['user_id'])
{
$allow_user = true;
@@ -141,6 +137,28 @@ if ($forum_id && !$auth->acl_get('f_read', $forum_id))
trigger_error('NOT_AUTHORISED');
}
+/**
+* Allow applying additional permissions to MCP access besides f_read
+*
+* @event core.mcp_global_f_read_auth_after
+* @var string action The action the user tried to execute
+* @var int forum_id The forum the user tried to access
+* @var string mode The MCP module the user is trying to access
+* @var p_master module Module system class
+* @var bool quickmod True if the user is accessing using quickmod tools
+* @var int topic_id The topic the user tried to access
+* @since 3.1.3-RC1
+*/
+$vars = array(
+ 'action',
+ 'forum_id',
+ 'mode',
+ 'module',
+ 'quickmod',
+ 'topic_id',
+);
+extract($phpbb_dispatcher->trigger_event('core.mcp_global_f_read_auth_after', compact($vars)));
+
if ($forum_id)
{
$module->acl_forum_id = $forum_id;
@@ -167,6 +185,7 @@ if ($quickmod)
case 'move':
case 'delete_post':
case 'delete_topic':
+ case 'restore_topic':
$module->load('mcp', 'main', 'quickmod');
return;
break;
@@ -175,7 +194,7 @@ if ($quickmod)
// Reset start parameter if we jumped from the quickmod dropdown
if (request_var('start', 0))
{
- $_REQUEST['start'] = 0;
+ $request->overwrite('start', 0);
}
$module->set_active('logs', 'topic_logs');
@@ -191,7 +210,27 @@ if ($quickmod)
break;
default:
- trigger_error("$action not allowed as quickmod", E_USER_ERROR);
+ // If needed, the flag can be set to true within event listener
+ // to indicate that the action was handled properly
+ // and to pass by the trigger_error() call below
+ $is_valid_action = false;
+
+ /**
+ * This event allows you to add custom quickmod options
+ *
+ * @event core.modify_quickmod_options
+ * @var object module Instance of module system class
+ * @var string action Quickmod option
+ * @var bool is_valid_action Flag indicating if the action was handled properly
+ * @since 3.1.0-a4
+ */
+ $vars = array('module', 'action', 'is_valid_action');
+ extract($phpbb_dispatcher->trigger_event('core.modify_quickmod_options', compact($vars)));
+
+ if (!$is_valid_action)
+ {
+ trigger_error($user->lang('QUICKMOD_ACTION_NOT_ALLOWED', $action), E_USER_ERROR);
+ }
break;
}
}
@@ -208,7 +247,7 @@ if (!$post_id)
$module->set_display('warn', 'warn_post', false);
}
-if ($mode == '' || $mode == 'unapproved_topics' || $mode == 'unapproved_posts')
+if ($mode == '' || $mode == 'unapproved_topics' || $mode == 'unapproved_posts' || $mode == 'deleted_topics' || $mode == 'deleted_posts')
{
$module->set_display('queue', 'approve_details', false);
}
@@ -241,6 +280,32 @@ if (!$user_id && $username == '')
$module->set_display('warn', 'warn_user', false);
}
+/**
+* This event allows you to set display option for custom MCP modules
+*
+* @event core.modify_mcp_modules_display_option
+* @var p_master module Module system class
+* @var string mode MCP mode
+* @var int user_id User id
+* @var int forum_id Forum id
+* @var int topic_id Topic id
+* @var int post_id Post id
+* @var string username User name
+* @var int id Parent module id
+* @since 3.1.0-b2
+*/
+$vars = array(
+ 'module',
+ 'mode',
+ 'user_id',
+ 'forum_id',
+ 'topic_id',
+ 'post_id',
+ 'username',
+ 'id',
+);
+extract($phpbb_dispatcher->trigger_event('core.modify_mcp_modules_display_option', compact($vars)));
+
// Load and execute the relevant module
$module->load_active();
@@ -256,661 +321,4 @@ $template->assign_vars(array(
));
// Generate the page, do not display/query online list
-$module->display($module->get_page_title(), false);
-
-/**
-* Functions used to generate additional URL paramters
-*/
-function _module__url($mode, &$module_row)
-{
- return extra_url();
-}
-
-function _module_notes_url($mode, &$module_row)
-{
- if ($mode == 'front')
- {
- return '';
- }
-
- global $user_id;
- return ($user_id) ? "&amp;u=$user_id" : '';
-}
-
-function _module_warn_url($mode, &$module_row)
-{
- if ($mode == 'front' || $mode == 'list')
- {
- global $forum_id;
-
- return ($forum_id) ? "&amp;f=$forum_id" : '';
- }
-
- if ($mode == 'warn_post')
- {
- global $forum_id, $post_id;
-
- $url_extra = ($forum_id) ? "&amp;f=$forum_id" : '';
- $url_extra .= ($post_id) ? "&amp;p=$post_id" : '';
-
- return $url_extra;
- }
- else
- {
- global $user_id;
-
- return ($user_id) ? "&amp;u=$user_id" : '';
- }
-}
-
-function _module_main_url($mode, &$module_row)
-{
- return extra_url();
-}
-
-function _module_logs_url($mode, &$module_row)
-{
- return extra_url();
-}
-
-function _module_ban_url($mode, &$module_row)
-{
- return extra_url();
-}
-
-function _module_queue_url($mode, &$module_row)
-{
- return extra_url();
-}
-
-function _module_reports_url($mode, &$module_row)
-{
- return extra_url();
-}
-
-function extra_url()
-{
- global $forum_id, $topic_id, $post_id, $report_id, $user_id;
-
- $url_extra = '';
- $url_extra .= ($forum_id) ? "&amp;f=$forum_id" : '';
- $url_extra .= ($topic_id) ? "&amp;t=$topic_id" : '';
- $url_extra .= ($post_id) ? "&amp;p=$post_id" : '';
- $url_extra .= ($user_id) ? "&amp;u=$user_id" : '';
- $url_extra .= ($report_id) ? "&amp;r=$report_id" : '';
-
- return $url_extra;
-}
-
-/**
-* Get simple topic data
-*/
-function get_topic_data($topic_ids, $acl_list = false, $read_tracking = false)
-{
- global $auth, $db, $config, $user;
- static $rowset = array();
-
- $topics = array();
-
- if (!sizeof($topic_ids))
- {
- return array();
- }
-
- // cache might not contain read tracking info, so we can't use it if read
- // tracking information is requested
- if (!$read_tracking)
- {
- $cache_topic_ids = array_intersect($topic_ids, array_keys($rowset));
- $topic_ids = array_diff($topic_ids, array_keys($rowset));
- }
- else
- {
- $cache_topic_ids = array();
- }
-
- if (sizeof($topic_ids))
- {
- $sql_array = array(
- 'SELECT' => 't.*, f.*',
-
- 'FROM' => array(
- TOPICS_TABLE => 't',
- ),
-
- 'LEFT_JOIN' => array(
- array(
- 'FROM' => array(FORUMS_TABLE => 'f'),
- 'ON' => 'f.forum_id = t.forum_id'
- )
- ),
-
- 'WHERE' => $db->sql_in_set('t.topic_id', $topic_ids)
- );
-
- if ($read_tracking && $config['load_db_lastread'])
- {
- $sql_array['SELECT'] .= ', tt.mark_time, ft.mark_time as forum_mark_time';
-
- $sql_array['LEFT_JOIN'][] = array(
- 'FROM' => array(TOPICS_TRACK_TABLE => 'tt'),
- 'ON' => 'tt.user_id = ' . $user->data['user_id'] . ' AND t.topic_id = tt.topic_id'
- );
-
- $sql_array['LEFT_JOIN'][] = array(
- 'FROM' => array(FORUMS_TRACK_TABLE => 'ft'),
- 'ON' => 'ft.user_id = ' . $user->data['user_id'] . ' AND t.forum_id = ft.forum_id'
- );
- }
-
- $sql = $db->sql_build_query('SELECT', $sql_array);
- $result = $db->sql_query($sql);
-
- while ($row = $db->sql_fetchrow($result))
- {
- if (!$row['forum_id'])
- {
- // Global Announcement?
- $row['forum_id'] = request_var('f', 0);
- }
-
- $rowset[$row['topic_id']] = $row;
-
- if ($acl_list && !$auth->acl_gets($acl_list, $row['forum_id']))
- {
- continue;
- }
-
- $topics[$row['topic_id']] = $row;
- }
- $db->sql_freeresult($result);
- }
-
- foreach ($cache_topic_ids as $id)
- {
- if (!$acl_list || $auth->acl_gets($acl_list, $rowset[$id]['forum_id']))
- {
- $topics[$id] = $rowset[$id];
- }
- }
-
- return $topics;
-}
-
-/**
-* Get simple post data
-*/
-function get_post_data($post_ids, $acl_list = false, $read_tracking = false)
-{
- global $db, $auth, $config, $user;
-
- $rowset = array();
-
- if (!sizeof($post_ids))
- {
- return array();
- }
-
- $sql_array = array(
- 'SELECT' => 'p.*, u.*, t.*, f.*',
-
- 'FROM' => array(
- USERS_TABLE => 'u',
- POSTS_TABLE => 'p',
- TOPICS_TABLE => 't',
- ),
-
- 'LEFT_JOIN' => array(
- array(
- 'FROM' => array(FORUMS_TABLE => 'f'),
- 'ON' => 'f.forum_id = t.forum_id'
- )
- ),
-
- 'WHERE' => $db->sql_in_set('p.post_id', $post_ids) . '
- AND u.user_id = p.poster_id
- AND t.topic_id = p.topic_id',
- );
-
- if ($read_tracking && $config['load_db_lastread'])
- {
- $sql_array['SELECT'] .= ', tt.mark_time, ft.mark_time as forum_mark_time';
-
- $sql_array['LEFT_JOIN'][] = array(
- 'FROM' => array(TOPICS_TRACK_TABLE => 'tt'),
- 'ON' => 'tt.user_id = ' . $user->data['user_id'] . ' AND t.topic_id = tt.topic_id'
- );
-
- $sql_array['LEFT_JOIN'][] = array(
- 'FROM' => array(FORUMS_TRACK_TABLE => 'ft'),
- 'ON' => 'ft.user_id = ' . $user->data['user_id'] . ' AND t.forum_id = ft.forum_id'
- );
- }
-
- $sql = $db->sql_build_query('SELECT', $sql_array);
- $result = $db->sql_query($sql);
- unset($sql_array);
-
- while ($row = $db->sql_fetchrow($result))
- {
- if (!$row['forum_id'])
- {
- // Global Announcement?
- $row['forum_id'] = request_var('f', 0);
- }
-
- if ($acl_list && !$auth->acl_gets($acl_list, $row['forum_id']))
- {
- continue;
- }
-
- if (!$row['post_approved'] && !$auth->acl_get('m_approve', $row['forum_id']))
- {
- // Moderators without the permission to approve post should at least not see them. ;)
- continue;
- }
-
- $rowset[$row['post_id']] = $row;
- }
- $db->sql_freeresult($result);
-
- return $rowset;
-}
-
-/**
-* Get simple forum data
-*/
-function get_forum_data($forum_id, $acl_list = 'f_list', $read_tracking = false)
-{
- global $auth, $db, $user, $config;
-
- $rowset = array();
-
- if (!is_array($forum_id))
- {
- $forum_id = array($forum_id);
- }
-
- if (!sizeof($forum_id))
- {
- return array();
- }
-
- if ($read_tracking && $config['load_db_lastread'])
- {
- $read_tracking_join = ' LEFT JOIN ' . FORUMS_TRACK_TABLE . ' ft ON (ft.user_id = ' . $user->data['user_id'] . '
- AND ft.forum_id = f.forum_id)';
- $read_tracking_select = ', ft.mark_time';
- }
- else
- {
- $read_tracking_join = $read_tracking_select = '';
- }
-
- $sql = "SELECT f.* $read_tracking_select
- FROM " . FORUMS_TABLE . " f$read_tracking_join
- WHERE " . $db->sql_in_set('f.forum_id', $forum_id);
- $result = $db->sql_query($sql);
-
- while ($row = $db->sql_fetchrow($result))
- {
- if ($acl_list && !$auth->acl_gets($acl_list, $row['forum_id']))
- {
- continue;
- }
-
- if ($auth->acl_get('m_approve', $row['forum_id']))
- {
- $row['forum_topics'] = $row['forum_topics_real'];
- }
-
- $rowset[$row['forum_id']] = $row;
- }
- $db->sql_freeresult($result);
-
- return $rowset;
-}
-
-/**
-* Get simple pm data
-*/
-function get_pm_data($pm_ids)
-{
- global $db, $auth, $config, $user;
-
- $rowset = array();
-
- if (!sizeof($pm_ids))
- {
- return array();
- }
-
- $sql_array = array(
- 'SELECT' => 'p.*, u.*',
-
- 'FROM' => array(
- USERS_TABLE => 'u',
- PRIVMSGS_TABLE => 'p',
- ),
-
- 'WHERE' => $db->sql_in_set('p.msg_id', $pm_ids) . '
- AND u.user_id = p.author_id',
- );
-
- $sql = $db->sql_build_query('SELECT', $sql_array);
- $result = $db->sql_query($sql);
- unset($sql_array);
-
- while ($row = $db->sql_fetchrow($result))
- {
- $rowset[$row['msg_id']] = $row;
- }
- $db->sql_freeresult($result);
-
- return $rowset;
-}
-
-/**
-* sorting in mcp
-*
-* @param string $where_sql should either be WHERE (default if ommited) or end with AND or OR
-*
-* $mode reports and reports_closed: the $where parameters uses aliases p for posts table and r for report table
-* $mode unapproved_posts: the $where parameters uses aliases p for posts table and t for topic table
-*/
-function mcp_sorting($mode, &$sort_days, &$sort_key, &$sort_dir, &$sort_by_sql, &$sort_order_sql, &$total, $forum_id = 0, $topic_id = 0, $where_sql = 'WHERE')
-{
- global $db, $user, $auth, $template;
-
- $sort_days = request_var('st', 0);
- $min_time = ($sort_days) ? time() - ($sort_days * 86400) : 0;
-
- switch ($mode)
- {
- case 'viewforum':
- $type = 'topics';
- $default_key = 't';
- $default_dir = 'd';
-
- $sql = 'SELECT COUNT(topic_id) AS total
- FROM ' . TOPICS_TABLE . "
- $where_sql forum_id = $forum_id
- AND topic_type NOT IN (" . POST_ANNOUNCE . ', ' . POST_GLOBAL . ")
- AND topic_last_post_time >= $min_time";
-
- if (!$auth->acl_get('m_approve', $forum_id))
- {
- $sql .= 'AND topic_approved = 1';
- }
- break;
-
- case 'viewtopic':
- $type = 'posts';
- $default_key = 't';
- $default_dir = 'a';
-
- $sql = 'SELECT COUNT(post_id) AS total
- FROM ' . POSTS_TABLE . "
- $where_sql topic_id = $topic_id
- AND post_time >= $min_time";
-
- if (!$auth->acl_get('m_approve', $forum_id))
- {
- $sql .= 'AND post_approved = 1';
- }
- break;
-
- case 'unapproved_posts':
- $type = 'posts';
- $default_key = 't';
- $default_dir = 'd';
- $where_sql .= ($topic_id) ? ' p.topic_id = ' . $topic_id . ' AND' : '';
-
- $sql = 'SELECT COUNT(p.post_id) AS total
- FROM ' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . " t
- $where_sql " . $db->sql_in_set('p.forum_id', ($forum_id) ? array($forum_id) : array_intersect(get_forum_list('f_read'), get_forum_list('m_approve'))) . '
- AND p.post_approved = 0
- AND t.topic_id = p.topic_id
- AND t.topic_first_post_id <> p.post_id';
-
- if ($min_time)
- {
- $sql .= ' AND post_time >= ' . $min_time;
- }
- break;
-
- case 'unapproved_topics':
- $type = 'topics';
- $default_key = 't';
- $default_dir = 'd';
-
- $sql = 'SELECT COUNT(topic_id) AS total
- FROM ' . TOPICS_TABLE . "
- $where_sql " . $db->sql_in_set('forum_id', ($forum_id) ? array($forum_id) : array_intersect(get_forum_list('f_read'), get_forum_list('m_approve'))) . '
- AND topic_approved = 0';
-
- if ($min_time)
- {
- $sql .= ' AND topic_time >= ' . $min_time;
- }
- break;
-
- case 'pm_reports':
- case 'pm_reports_closed':
- case 'reports':
- case 'reports_closed':
- $pm = (strpos($mode, 'pm_') === 0) ? true : false;
-
- $type = ($pm) ? 'pm_reports' : 'reports';
- $default_key = 't';
- $default_dir = 'd';
- $limit_time_sql = ($min_time) ? "AND r.report_time >= $min_time" : '';
-
- if ($topic_id)
- {
- $where_sql .= ' p.topic_id = ' . $topic_id . ' AND ';
- }
- else if ($forum_id)
- {
- $where_sql .= ' p.forum_id = ' . $forum_id . ' AND ';
- }
- else if (!$pm)
- {
- $where_sql .= ' ' . $db->sql_in_set('p.forum_id', get_forum_list(array('!f_read', '!m_report')), true, true) . ' AND ';
- }
-
- if ($mode == 'reports' || $mode == 'pm_reports')
- {
- $where_sql .= ' r.report_closed = 0 AND ';
- }
- else
- {
- $where_sql .= ' r.report_closed = 1 AND ';
- }
-
- if ($pm)
- {
- $sql = 'SELECT COUNT(r.report_id) AS total
- FROM ' . REPORTS_TABLE . ' r, ' . PRIVMSGS_TABLE . " p
- $where_sql r.post_id = 0
- AND p.msg_id = r.pm_id
- $limit_time_sql";
- }
- else
- {
- $sql = 'SELECT COUNT(r.report_id) AS total
- FROM ' . REPORTS_TABLE . ' r, ' . POSTS_TABLE . " p
- $where_sql r.pm_id = 0
- AND p.post_id = r.post_id
- $limit_time_sql";
- }
- break;
-
- case 'viewlogs':
- $type = 'logs';
- $default_key = 't';
- $default_dir = 'd';
-
- $sql = 'SELECT COUNT(log_id) AS total
- FROM ' . LOG_TABLE . "
- $where_sql " . $db->sql_in_set('forum_id', ($forum_id) ? array($forum_id) : array_intersect(get_forum_list('f_read'), get_forum_list('m_'))) . '
- AND log_time >= ' . $min_time . '
- AND log_type = ' . LOG_MOD;
- break;
- }
-
- $sort_key = request_var('sk', $default_key);
- $sort_dir = request_var('sd', $default_dir);
- $sort_dir_text = array('a' => $user->lang['ASCENDING'], 'd' => $user->lang['DESCENDING']);
-
- switch ($type)
- {
- case 'topics':
- $limit_days = array(0 => $user->lang['ALL_TOPICS'], 1 => $user->lang['1_DAY'], 7 => $user->lang['7_DAYS'], 14 => $user->lang['2_WEEKS'], 30 => $user->lang['1_MONTH'], 90 => $user->lang['3_MONTHS'], 180 => $user->lang['6_MONTHS'], 365 => $user->lang['1_YEAR']);
- $sort_by_text = array('a' => $user->lang['AUTHOR'], 't' => $user->lang['POST_TIME'], 'tt' => $user->lang['TOPIC_TIME'], 'r' => $user->lang['REPLIES'], 's' => $user->lang['SUBJECT'], 'v' => $user->lang['VIEWS']);
-
- $sort_by_sql = array('a' => 't.topic_first_poster_name', 't' => 't.topic_last_post_time', 'tt' => 't.topic_time', 'r' => (($auth->acl_get('m_approve', $forum_id)) ? 't.topic_replies_real' : 't.topic_replies'), 's' => 't.topic_title', 'v' => 't.topic_views');
- $limit_time_sql = ($min_time) ? "AND t.topic_last_post_time >= $min_time" : '';
- break;
-
- case 'posts':
- $limit_days = array(0 => $user->lang['ALL_POSTS'], 1 => $user->lang['1_DAY'], 7 => $user->lang['7_DAYS'], 14 => $user->lang['2_WEEKS'], 30 => $user->lang['1_MONTH'], 90 => $user->lang['3_MONTHS'], 180 => $user->lang['6_MONTHS'], 365 => $user->lang['1_YEAR']);
- $sort_by_text = array('a' => $user->lang['AUTHOR'], 't' => $user->lang['POST_TIME'], 's' => $user->lang['SUBJECT']);
- $sort_by_sql = array('a' => 'u.username_clean', 't' => 'p.post_time', 's' => 'p.post_subject');
- $limit_time_sql = ($min_time) ? "AND p.post_time >= $min_time" : '';
- break;
-
- case 'reports':
- $limit_days = array(0 => $user->lang['ALL_REPORTS'], 1 => $user->lang['1_DAY'], 7 => $user->lang['7_DAYS'], 14 => $user->lang['2_WEEKS'], 30 => $user->lang['1_MONTH'], 90 => $user->lang['3_MONTHS'], 180 => $user->lang['6_MONTHS'], 365 => $user->lang['1_YEAR']);
- $sort_by_text = array('a' => $user->lang['AUTHOR'], 'r' => $user->lang['REPORTER'], 'p' => $user->lang['POST_TIME'], 't' => $user->lang['REPORT_TIME'], 's' => $user->lang['SUBJECT']);
- $sort_by_sql = array('a' => 'u.username_clean', 'r' => 'ru.username', 'p' => 'p.post_time', 't' => 'r.report_time', 's' => 'p.post_subject');
- break;
-
- case 'pm_reports':
- $limit_days = array(0 => $user->lang['ALL_REPORTS'], 1 => $user->lang['1_DAY'], 7 => $user->lang['7_DAYS'], 14 => $user->lang['2_WEEKS'], 30 => $user->lang['1_MONTH'], 90 => $user->lang['3_MONTHS'], 180 => $user->lang['6_MONTHS'], 365 => $user->lang['1_YEAR']);
- $sort_by_text = array('a' => $user->lang['AUTHOR'], 'r' => $user->lang['REPORTER'], 'p' => $user->lang['POST_TIME'], 't' => $user->lang['REPORT_TIME'], 's' => $user->lang['SUBJECT']);
- $sort_by_sql = array('a' => 'u.username_clean', 'r' => 'ru.username', 'p' => 'p.message_time', 't' => 'r.report_time', 's' => 'p.message_subject');
- break;
-
- case 'logs':
- $limit_days = array(0 => $user->lang['ALL_ENTRIES'], 1 => $user->lang['1_DAY'], 7 => $user->lang['7_DAYS'], 14 => $user->lang['2_WEEKS'], 30 => $user->lang['1_MONTH'], 90 => $user->lang['3_MONTHS'], 180 => $user->lang['6_MONTHS'], 365 => $user->lang['1_YEAR']);
- $sort_by_text = array('u' => $user->lang['SORT_USERNAME'], 't' => $user->lang['SORT_DATE'], 'i' => $user->lang['SORT_IP'], 'o' => $user->lang['SORT_ACTION']);
-
- $sort_by_sql = array('u' => 'u.username_clean', 't' => 'l.log_time', 'i' => 'l.log_ip', 'o' => 'l.log_operation');
- $limit_time_sql = ($min_time) ? "AND l.log_time >= $min_time" : '';
- break;
- }
-
- if (!isset($sort_by_sql[$sort_key]))
- {
- $sort_key = $default_key;
- }
-
- $sort_order_sql = $sort_by_sql[$sort_key] . ' ' . (($sort_dir == 'd') ? 'DESC' : 'ASC');
-
- $s_limit_days = $s_sort_key = $s_sort_dir = $sort_url = '';
- gen_sort_selects($limit_days, $sort_by_text, $sort_days, $sort_key, $sort_dir, $s_limit_days, $s_sort_key, $s_sort_dir, $sort_url);
-
- $template->assign_vars(array(
- 'S_SELECT_SORT_DIR' => $s_sort_dir,
- 'S_SELECT_SORT_KEY' => $s_sort_key,
- 'S_SELECT_SORT_DAYS' => $s_limit_days)
- );
-
- if (($sort_days && $mode != 'viewlogs') || in_array($mode, array('reports', 'unapproved_topics', 'unapproved_posts')) || $where_sql != 'WHERE')
- {
- $result = $db->sql_query($sql);
- $total = (int) $db->sql_fetchfield('total');
- $db->sql_freeresult($result);
- }
- else
- {
- $total = -1;
- }
-}
-
-/**
-* Validate ids
-*
-* @param array &$ids The relevant ids to check
-* @param string $table The table to find the ids in
-* @param string $sql_id The ids relevant column name
-* @param array $acl_list A list of permissions the user need to have
-* @param mixed $singe_forum Limit to one forum id (int) or the first forum found (true)
-*
-* @return mixed False if no ids were able to be retrieved, true if at least one id left.
-* Additionally, this value can be the forum_id assigned if $single_forum was set.
-* Therefore checking the result for with !== false is the best method.
-*/
-function check_ids(&$ids, $table, $sql_id, $acl_list = false, $single_forum = false)
-{
- global $db, $auth;
-
- if (!is_array($ids) || empty($ids))
- {
- return false;
- }
-
- $sql = "SELECT $sql_id, forum_id FROM $table
- WHERE " . $db->sql_in_set($sql_id, $ids);
- $result = $db->sql_query($sql);
-
- $ids = array();
- $forum_id = false;
-
- while ($row = $db->sql_fetchrow($result))
- {
- if ($acl_list && $row['forum_id'] && !$auth->acl_gets($acl_list, $row['forum_id']))
- {
- continue;
- }
-
- if ($acl_list && !$row['forum_id'] && !$auth->acl_getf_global($acl_list))
- {
- continue;
- }
-
- // Limit forum? If not, just assign the id.
- if ($single_forum === false)
- {
- $ids[] = $row[$sql_id];
- continue;
- }
-
- // Limit forum to a specific forum id?
- // This can get really tricky, because we do not want to create a failure on global topics. :)
- if ($row['forum_id'])
- {
- if ($single_forum !== true && $row['forum_id'] == (int) $single_forum)
- {
- $forum_id = (int) $single_forum;
- }
- else if ($forum_id === false)
- {
- $forum_id = $row['forum_id'];
- }
-
- if ($row['forum_id'] == $forum_id)
- {
- $ids[] = $row[$sql_id];
- }
- }
- else
- {
- // Always add a global topic
- $ids[] = $row[$sql_id];
- }
- }
- $db->sql_freeresult($result);
-
- if (!sizeof($ids))
- {
- return false;
- }
-
- // If forum id is false and ids populated we may have only global announcements selected (returning 0 because of (int) $forum_id)
-
- return ($single_forum === false) ? true : (int) $forum_id;
-}
-
-?>
+$module->display($module->get_page_title());
diff --git a/phpBB/memberlist.php b/phpBB/memberlist.php
index 7e510a3368..b1982958d5 100644
--- a/phpBB/memberlist.php
+++ b/phpBB/memberlist.php
@@ -1,10 +1,13 @@
<?php
/**
*
-* @package phpBB3
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -17,21 +20,38 @@ $phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
+$mode = request_var('mode', '');
+
+if ($mode === 'contactadmin')
+{
+ define('SKIP_CHECK_BAN', true);
+ define('SKIP_CHECK_DISABLED', true);
+}
+
// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup(array('memberlist', 'groups'));
+// Setting a variable to let the style designer know where he is...
+$template->assign_var('S_IN_MEMBERLIST', true);
+
// Grab data
-$mode = request_var('mode', '');
$action = request_var('action', '');
$user_id = request_var('u', ANONYMOUS);
$username = request_var('un', '', true);
$group_id = request_var('g', 0);
$topic_id = request_var('t', 0);
+// Redirect when old mode is used
+if ($mode == 'leaders')
+{
+ send_status_line(301, 'Moved Permanently');
+ redirect(append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=team'));
+}
+
// Check our mode...
-if (!in_array($mode, array('', 'group', 'viewprofile', 'email', 'contact', 'searchuser', 'leaders')))
+if (!in_array($mode, array('', 'group', 'viewprofile', 'email', 'contact', 'contactadmin', 'searchuser', 'team', 'livesearch')))
{
trigger_error('NO_MODE');
}
@@ -39,8 +59,16 @@ if (!in_array($mode, array('', 'group', 'viewprofile', 'email', 'contact', 'sear
switch ($mode)
{
case 'email':
+ case 'contactadmin':
break;
+ case 'livesearch':
+ if (!$config['allow_live_searches'])
+ {
+ trigger_error('LIVE_SEARCHES_NOT_ALLOWED');
+ }
+ // No break
+
default:
// Can this user view profiles/memberlist?
if (!$auth->acl_gets('u_viewprofile', 'a_user', 'a_useradd', 'a_userdel'))
@@ -62,199 +90,275 @@ $default_key = 'c';
$sort_key = request_var('sk', $default_key);
$sort_dir = request_var('sd', 'a');
+$user_types = array(USER_NORMAL, USER_FOUNDER);
+if ($auth->acl_get('a_user'))
+{
+ $user_types[] = USER_INACTIVE;
+}
+
// What do you want to do today? ... oops, I think that line is taken ...
switch ($mode)
{
- case 'leaders':
+ case 'team':
// Display a listing of board admins, moderators
- include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
-
- $page_title = $user->lang['THE_TEAM'];
- $template_html = 'memberlist_leaders.html';
-
- $user_ary = $auth->acl_get_list(false, array('a_', 'm_'), false);
-
- $admin_id_ary = $global_mod_id_ary = $mod_id_ary = $forum_id_ary = array();
- foreach ($user_ary as $forum_id => $forum_ary)
+ if (!function_exists('user_get_id_name'))
{
- foreach ($forum_ary as $auth_option => $id_ary)
- {
- if (!$forum_id)
- {
- if ($auth_option == 'a_')
- {
- $admin_id_ary = array_merge($admin_id_ary, $id_ary);
- }
- else
- {
- $global_mod_id_ary = array_merge($global_mod_id_ary, $id_ary);
- }
- continue;
- }
- else
- {
- $mod_id_ary = array_merge($mod_id_ary, $id_ary);
- }
-
- if ($forum_id)
- {
- foreach ($id_ary as $id)
- {
- $forum_id_ary[$id][] = $forum_id;
- }
- }
- }
+ include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
}
- $admin_id_ary = array_unique($admin_id_ary);
- $global_mod_id_ary = array_unique($global_mod_id_ary);
-
- $mod_id_ary = array_merge($mod_id_ary, $global_mod_id_ary);
- $mod_id_ary = array_unique($mod_id_ary);
+ $page_title = $user->lang['THE_TEAM'];
+ $template_html = 'memberlist_team.html';
- // Admin group id...
- $sql = 'SELECT group_id
- FROM ' . GROUPS_TABLE . "
- WHERE group_name = 'ADMINISTRATORS'";
- $result = $db->sql_query($sql);
- $admin_group_id = (int) $db->sql_fetchfield('group_id');
+ $sql = 'SELECT *
+ FROM ' . TEAMPAGE_TABLE . '
+ ORDER BY teampage_position ASC';
+ $result = $db->sql_query($sql, 3600);
+ $teampage_data = $db->sql_fetchrowset($result);
$db->sql_freeresult($result);
- // Get group memberships for the admin id ary...
- $admin_memberships = group_memberships($admin_group_id, $admin_id_ary);
+ $sql_ary = array(
+ 'SELECT' => 'g.group_id, g.group_name, g.group_colour, g.group_type, ug.user_id as ug_user_id, t.teampage_id',
- $admin_user_ids = array();
+ 'FROM' => array(GROUPS_TABLE => 'g'),
- if (!empty($admin_memberships))
- {
- // ok, we only need the user ids...
- foreach ($admin_memberships as $row)
- {
- $admin_user_ids[$row['user_id']] = true;
- }
- }
- unset($admin_memberships);
+ 'LEFT_JOIN' => array(
+ array(
+ 'FROM' => array(TEAMPAGE_TABLE => 't'),
+ 'ON' => 't.group_id = g.group_id',
+ ),
+ array(
+ 'FROM' => array(USER_GROUP_TABLE => 'ug'),
+ 'ON' => 'ug.group_id = g.group_id AND ug.user_pending = 0 AND ug.user_id = ' . (int) $user->data['user_id'],
+ ),
+ ),
+ );
- $sql = 'SELECT forum_id, forum_name
- FROM ' . FORUMS_TABLE;
- $result = $db->sql_query($sql);
+ $result = $db->sql_query($db->sql_build_query('SELECT', $sql_ary));
- $forums = array();
+ $group_ids = $groups_ary = array();
while ($row = $db->sql_fetchrow($result))
{
- $forums[$row['forum_id']] = $row['forum_name'];
+ if ($row['group_type'] == GROUP_HIDDEN && !$auth->acl_gets('a_group', 'a_groupadd', 'a_groupdel') && $row['ug_user_id'] != $user->data['user_id'])
+ {
+ $row['group_name'] = $user->lang['GROUP_UNDISCLOSED'];
+ $row['u_group'] = '';
+ }
+ else
+ {
+ $row['group_name'] = ($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name'];
+ $row['u_group'] = append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&amp;g=' . $row['group_id']);
+ }
+
+ if ($row['teampage_id'])
+ {
+ // Only put groups into the array we want to display.
+ // We are fetching all groups, to ensure we got all data for default groups.
+ $group_ids[] = (int) $row['group_id'];
+ }
+ $groups_ary[(int) $row['group_id']] = $row;
}
$db->sql_freeresult($result);
- $sql = $db->sql_build_query('SELECT', array(
- 'SELECT' => 'u.user_id, u.group_id as default_group, u.username, u.username_clean, u.user_colour, u.user_rank, u.user_posts, u.user_allow_pm, g.group_id, g.group_name, g.group_colour, g.group_type, ug.user_id as ug_user_id',
+ $sql_ary = array(
+ 'SELECT' => 'u.user_id, u.group_id as default_group, u.username, u.username_clean, u.user_colour, u.user_type, u.user_rank, u.user_posts, u.user_allow_pm, g.group_id',
'FROM' => array(
- USERS_TABLE => 'u',
- GROUPS_TABLE => 'g'
+ USER_GROUP_TABLE => 'ug',
),
'LEFT_JOIN' => array(
array(
- 'FROM' => array(USER_GROUP_TABLE => 'ug'),
- 'ON' => 'ug.group_id = g.group_id AND ug.user_pending = 0 AND ug.user_id = ' . $user->data['user_id']
- )
+ 'FROM' => array(USERS_TABLE => 'u'),
+ 'ON' => 'ug.user_id = u.user_id AND ug.user_pending = 0',
+ ),
+ array(
+ 'FROM' => array(GROUPS_TABLE => 'g'),
+ 'ON' => 'ug.group_id = g.group_id',
+ ),
),
- 'WHERE' => $db->sql_in_set('u.user_id', array_unique(array_merge($admin_id_ary, $mod_id_ary)), false, true) . '
- AND u.group_id = g.group_id',
+ 'WHERE' => $db->sql_in_set('g.group_id', $group_ids, false, true),
- 'ORDER_BY' => 'g.group_name ASC, u.username_clean ASC'
- ));
- $result = $db->sql_query($sql);
+ 'ORDER_BY' => 'u.username_clean ASC',
+ );
+ /**
+ * Modify the query used to get the users for the team page
+ *
+ * @event core.memberlist_team_modify_query
+ * @var array sql_ary Array containing the query
+ * @var array group_ids Array of group ids
+ * @var array teampage_data The teampage data
+ * @since 3.1.3-RC1
+ */
+ $vars = array(
+ 'sql_ary',
+ 'group_ids',
+ 'teampage_data',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.memberlist_team_modify_query', compact($vars)));
+
+ $result = $db->sql_query($db->sql_build_query('SELECT', $sql_ary));
+
+ $user_ary = $user_ids = $group_users = array();
while ($row = $db->sql_fetchrow($result))
{
- $which_row = (in_array($row['user_id'], $admin_id_ary)) ? 'admin' : 'mod';
+ $row['forums'] = '';
+ $row['forums_ary'] = array();
+ $user_ary[(int) $row['user_id']] = $row;
+ $user_ids[] = (int) $row['user_id'];
+ $group_users[(int) $row['group_id']][] = (int) $row['user_id'];
+ }
+ $db->sql_freeresult($result);
- // We sort out admins not within the 'Administrators' group.
- // Else, we will list those as admin only having the permission to view logs for example.
- if ($which_row == 'admin' && empty($admin_user_ids[$row['user_id']]))
- {
- // Remove from admin_id_ary, because the user may be a mod instead
- unset($admin_id_ary[array_search($row['user_id'], $admin_id_ary)]);
+ $user_ids = array_unique($user_ids);
- if (!in_array($row['user_id'], $mod_id_ary) && !in_array($row['user_id'], $global_mod_id_ary))
- {
- continue;
- }
- else
+ if (!empty($user_ids) && $config['teampage_forums'])
+ {
+ $template->assign_var('S_DISPLAY_MODERATOR_FORUMS', true);
+ // Get all moderators
+ $perm_ary = $auth->acl_get_list($user_ids, array('m_'), false);
+
+ foreach ($perm_ary as $forum_id => $forum_ary)
+ {
+ foreach ($forum_ary as $auth_option => $id_ary)
{
- $which_row = 'mod';
+ foreach ($id_ary as $id)
+ {
+ if (!$forum_id)
+ {
+ $user_ary[$id]['forums'] = $user->lang['ALL_FORUMS'];
+ }
+ else
+ {
+ $user_ary[$id]['forums_ary'][] = $forum_id;
+ }
+ }
}
}
- $s_forum_select = '';
- $undisclosed_forum = false;
+ $sql = 'SELECT forum_id, forum_name
+ FROM ' . FORUMS_TABLE;
+ $result = $db->sql_query($sql);
- if (isset($forum_id_ary[$row['user_id']]) && !in_array($row['user_id'], $global_mod_id_ary))
+ $forums = array();
+ while ($row = $db->sql_fetchrow($result))
+ {
+ $forums[$row['forum_id']] = $row['forum_name'];
+ }
+ $db->sql_freeresult($result);
+
+ foreach ($user_ary as $user_id => $user_data)
{
- if ($which_row == 'mod' && sizeof(array_diff(array_keys($forums), $forum_id_ary[$row['user_id']])))
+ if (!$user_data['forums'])
{
- foreach ($forum_id_ary[$row['user_id']] as $forum_id)
+ foreach ($user_data['forums_ary'] as $forum_id)
{
+ $user_ary[$user_id]['forums_options'] = true;
if (isset($forums[$forum_id]))
{
if ($auth->acl_get('f_list', $forum_id))
{
- $s_forum_select .= '<option value="">' . $forums[$forum_id] . '</option>';
- }
- else
- {
- $undisclosed_forum = true;
+ $user_ary[$user_id]['forums'] .= '<option value="">' . $forums[$forum_id] . '</option>';
}
}
}
}
}
+ }
- // If the mod is only moderating non-viewable forums we skip the user. There is no gain in displaying the person then...
- if (!$s_forum_select && $undisclosed_forum)
+ $parent_team = 0;
+ foreach ($teampage_data as $team_data)
+ {
+ // If this team entry has no group, it's a category
+ if (!$team_data['group_id'])
{
-// $s_forum_select = '<option value="">' . $user->lang['FORUM_UNDISCLOSED'] . '</option>';
+ $template->assign_block_vars('group', array(
+ 'GROUP_NAME' => $team_data['teampage_name'],
+ ));
+
+ $parent_team = (int) $team_data['teampage_id'];
continue;
}
- // The person is moderating several "public" forums, therefore the person should be listed, but not giving the real group name if hidden.
- if ($row['group_type'] == GROUP_HIDDEN && !$auth->acl_gets('a_group', 'a_groupadd', 'a_groupdel') && $row['ug_user_id'] != $user->data['user_id'])
+ $group_data = $groups_ary[(int) $team_data['group_id']];
+ $group_id = (int) $team_data['group_id'];
+
+ if (!$team_data['teampage_parent'])
{
- $group_name = $user->lang['GROUP_UNDISCLOSED'];
- $u_group = '';
+ // If the group does not have a parent category, we display the groupname as category
+ $template->assign_block_vars('group', array(
+ 'GROUP_NAME' => $group_data['group_name'],
+ 'GROUP_COLOR' => $group_data['group_colour'],
+ 'U_GROUP' => $group_data['u_group'],
+ ));
}
- else
+
+ // Display group members.
+ if (!empty($group_users[$group_id]))
{
- $group_name = ($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name'];
- $u_group = append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&amp;g=' . $row['group_id']);
- }
+ foreach ($group_users[$group_id] as $user_id)
+ {
+ if (isset($user_ary[$user_id]))
+ {
+ $row = $user_ary[$user_id];
+ if ($config['teampage_memberships'] == 1 && ($group_id != $groups_ary[$row['default_group']]['group_id']) && $groups_ary[$row['default_group']]['teampage_id'])
+ {
+ // Display users in their primary group, instead of the first group, when it is displayed on the teampage.
+ continue;
+ }
- $rank_title = $rank_img = '';
- get_user_rank($row['user_rank'], (($row['user_id'] == ANONYMOUS) ? false : $row['user_posts']), $rank_title, $rank_img, $rank_img_src);
+ $user_rank_data = phpbb_get_user_rank($row, (($row['user_id'] == ANONYMOUS) ? false : $row['user_posts']));
- $template->assign_block_vars($which_row, array(
- 'USER_ID' => $row['user_id'],
- 'FORUMS' => $s_forum_select,
- 'RANK_TITLE' => $rank_title,
- 'GROUP_NAME' => $group_name,
- 'GROUP_COLOR' => $row['group_colour'],
+ $template_vars = array(
+ 'USER_ID' => $row['user_id'],
+ 'FORUMS' => $row['forums'],
+ 'FORUM_OPTIONS' => (isset($row['forums_options'])) ? true : false,
+ 'RANK_TITLE' => $user_rank_data['title'],
- 'RANK_IMG' => $rank_img,
- 'RANK_IMG_SRC' => $rank_img_src,
+ 'GROUP_NAME' => $groups_ary[$row['default_group']]['group_name'],
+ 'GROUP_COLOR' => $groups_ary[$row['default_group']]['group_colour'],
+ 'U_GROUP' => $groups_ary[$row['default_group']]['u_group'],
- 'U_GROUP' => $u_group,
- 'U_PM' => ($config['allow_privmsg'] && $auth->acl_get('u_sendpm') && ($row['user_allow_pm'] || $auth->acl_gets('a_', 'm_') || $auth->acl_getf_global('m_'))) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&amp;mode=compose&amp;u=' . $row['user_id']) : '',
+ 'RANK_IMG' => $user_rank_data['img'],
+ 'RANK_IMG_SRC' => $user_rank_data['img_src'],
- 'USERNAME_FULL' => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']),
- 'USERNAME' => get_username_string('username', $row['user_id'], $row['username'], $row['user_colour']),
- 'USER_COLOR' => get_username_string('colour', $row['user_id'], $row['username'], $row['user_colour']),
- 'U_VIEW_PROFILE' => get_username_string('profile', $row['user_id'], $row['username'], $row['user_colour']),
- ));
+ 'S_INACTIVE' => $row['user_type'] == USER_INACTIVE,
+
+ 'U_PM' => ($config['allow_privmsg'] && $auth->acl_get('u_sendpm') && ($row['user_allow_pm'] || $auth->acl_gets('a_', 'm_') || $auth->acl_getf_global('m_'))) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&amp;mode=compose&amp;u=' . $row['user_id']) : '',
+
+ 'USERNAME_FULL' => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']),
+ 'USERNAME' => get_username_string('username', $row['user_id'], $row['username'], $row['user_colour']),
+ 'USER_COLOR' => get_username_string('colour', $row['user_id'], $row['username'], $row['user_colour']),
+ 'U_VIEW_PROFILE' => get_username_string('profile', $row['user_id'], $row['username'], $row['user_colour']),
+ );
+
+ /**
+ * Modify the template vars for displaying the user in the groups on the teampage
+ *
+ * @event core.memberlist_team_modify_template_vars
+ * @var array template_vars Array containing the query
+ * @var array row Array containing the action user row
+ * @var array groups_ary Array of groups with all users that should be displayed
+ * @since 3.1.3-RC1
+ */
+ $vars = array(
+ 'template_vars',
+ 'row',
+ 'groups_ary',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.memberlist_team_modify_template_vars', compact($vars)));
+
+ $template->assign_block_vars('group.user', $template_vars);
+
+ if ($config['teampage_memberships'] != 2)
+ {
+ unset($user_ary[$user_id]);
+ }
+ }
+ }
+ }
}
- $db->sql_freeresult($result);
$template->assign_vars(array(
'PM_IMG' => $user->img('icon_contact_pm', $user->lang['SEND_PRIVATE_MESSAGE']))
@@ -274,20 +378,6 @@ switch ($mode)
$presence_img = '';
switch ($action)
{
- case 'aim':
- $lang = 'AIM';
- $sql_field = 'user_aim';
- $s_select = 'S_SEND_AIM';
- $s_action = '';
- break;
-
- case 'msnm':
- $lang = 'MSNM';
- $sql_field = 'user_msnm';
- $s_select = 'S_SEND_MSNM';
- $s_action = '';
- break;
-
case 'jabber':
$lang = 'JABBER';
$sql_field = 'user_jabber';
@@ -345,10 +435,10 @@ switch ($mode)
$messenger->subject(htmlspecialchars_decode($subject));
$messenger->replyto($user->data['user_email']);
- $messenger->im($row['user_jabber'], $row['username']);
+ $messenger->set_addresses($row);
$messenger->assign_vars(array(
- 'BOARD_CONTACT' => $config['board_contact'],
+ 'BOARD_CONTACT' => phpbb_get_board_contact($config, $phpEx),
'FROM_USERNAME' => htmlspecialchars_decode($user->data['username']),
'TO_USERNAME' => htmlspecialchars_decode($row['username']),
'MESSAGE' => htmlspecialchars_decode($message))
@@ -371,9 +461,6 @@ switch ($mode)
'IM_CONTACT' => $row[$sql_field],
'A_IM_CONTACT' => addslashes($row[$sql_field]),
- 'U_AIM_CONTACT' => ($action == 'aim') ? 'aim:addbuddy?screenname=' . urlencode($row[$sql_field]) : '',
- 'U_AIM_MESSAGE' => ($action == 'aim') ? 'aim:goim?screenname=' . urlencode($row[$sql_field]) . '&amp;message=' . urlencode($config['sitename']) : '',
-
'USERNAME' => $row['username'],
'CONTACT_NAME' => $row[$sql_field],
'SITENAME' => $config['sitename'],
@@ -530,21 +617,10 @@ switch ($mode)
if ($member['user_sig'])
{
- $member['user_sig'] = censor_text($member['user_sig']);
-
- if ($member['user_sig_bbcode_bitfield'])
- {
- include_once($phpbb_root_path . 'includes/bbcode.' . $phpEx);
- $bbcode = new bbcode();
- $bbcode->bbcode_second_pass($member['user_sig'], $member['user_sig_bbcode_uid'], $member['user_sig_bbcode_bitfield']);
- }
-
- $member['user_sig'] = bbcode_nl2br($member['user_sig']);
- $member['user_sig'] = smiley_text($member['user_sig']);
+ $parse_flags = ($member['user_sig_bbcode_bitfield'] ? OPTION_FLAG_BBCODE : 0) | OPTION_FLAG_SMILIES;
+ $member['user_sig'] = generate_text_for_display($member['user_sig'], $member['user_sig_bbcode_uid'], $member['user_sig_bbcode_bitfield'], $parse_flags, true);
}
- $poster_avatar = get_user_avatar($member['user_avatar'], $member['user_avatar_type'], $member['user_avatar_width'], $member['user_avatar_height']);
-
// We need to check if the modules 'zebra' ('friends' & 'foes' mode), 'notes' ('user_notes' mode) and 'warn' ('warn_user' mode) are accessible to decide if we can display appropriate links
$zebra_enabled = $friends_enabled = $foes_enabled = $user_notes_enabled = $warn_user_enabled = false;
@@ -560,34 +636,63 @@ switch ($mode)
$module->list_modules('ucp');
$module->list_modules('mcp');
- $user_notes_enabled = ($module->loaded('notes', 'user_notes')) ? true : false;
- $warn_user_enabled = ($module->loaded('warn', 'warn_user')) ? true : false;
- $zebra_enabled = ($module->loaded('zebra')) ? true : false;
- $friends_enabled = ($module->loaded('zebra', 'friends')) ? true : false;
- $foes_enabled = ($module->loaded('zebra', 'foes')) ? true : false;
+ $user_notes_enabled = ($module->loaded('mcp_notes', 'user_notes')) ? true : false;
+ $warn_user_enabled = ($module->loaded('mcp_warn', 'warn_user')) ? true : false;
+ $zebra_enabled = ($module->loaded('ucp_zebra')) ? true : false;
+ $friends_enabled = ($module->loaded('ucp_zebra', 'friends')) ? true : false;
+ $foes_enabled = ($module->loaded('ucp_zebra', 'foes')) ? true : false;
unset($module);
}
- $template->assign_vars(show_profile($member, $user_notes_enabled, $warn_user_enabled));
-
// Custom Profile Fields
$profile_fields = array();
if ($config['load_cpf_viewprofile'])
{
- include_once($phpbb_root_path . 'includes/functions_profile_fields.' . $phpEx);
- $cp = new custom_profile();
- $profile_fields = $cp->generate_profile_fields_template('grab', $user_id);
- $profile_fields = (isset($profile_fields[$user_id])) ? $cp->generate_profile_fields_template('show', false, $profile_fields[$user_id]) : array();
+ $cp = $phpbb_container->get('profilefields.manager');
+ $profile_fields = $cp->grab_profile_fields_data($user_id);
+ $profile_fields = (isset($profile_fields[$user_id])) ? $cp->generate_profile_fields_template_data($profile_fields[$user_id]) : array();
}
+ /**
+ * Modify user data before we display the profile
+ *
+ * @event core.memberlist_view_profile
+ * @var array member Array with user's data
+ * @var bool user_notes_enabled Is the mcp user notes module enabled?
+ * @var bool warn_user_enabled Is the mcp warnings module enabled?
+ * @var bool zebra_enabled Is the ucp zebra module enabled?
+ * @var bool friends_enabled Is the ucp friends module enabled?
+ * @var bool foes_enabled Is the ucp foes module enabled?
+ * @var bool friend Is the user friend?
+ * @var bool foe Is the user foe?
+ * @var array profile_fields Array with user's profile field data
+ * @since 3.1.0-a1
+ * @changed 3.1.0-b2 Added friend and foe status
+ * @changed 3.1.0-b3 Added profile fields data
+ */
+ $vars = array(
+ 'member',
+ 'user_notes_enabled',
+ 'warn_user_enabled',
+ 'zebra_enabled',
+ 'friends_enabled',
+ 'foes_enabled',
+ 'friend',
+ 'foe',
+ 'profile_fields',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.memberlist_view_profile', compact($vars)));
+
+ $template->assign_vars(phpbb_show_profile($member, $user_notes_enabled, $warn_user_enabled));
+
// If the user has m_approve permission or a_user permission, then list then display unapproved posts
if ($auth->acl_getf_global('m_approve') || $auth->acl_get('a_user'))
{
$sql = 'SELECT COUNT(post_id) as posts_in_queue
FROM ' . POSTS_TABLE . '
WHERE poster_id = ' . $user_id . '
- AND post_approved = 0';
+ AND ' . $db->sql_in_set('post_visibility', array(ITEM_UNAPPROVED, ITEM_REAPPROVE));
$result = $db->sql_query($sql);
$member['posts_in_queue'] = (int) $db->sql_fetchfield('posts_in_queue');
$db->sql_freeresult($result);
@@ -600,22 +705,15 @@ switch ($mode)
$template->assign_vars(array(
'L_POSTS_IN_QUEUE' => $user->lang('NUM_POSTS_IN_QUEUE', $member['posts_in_queue']),
- 'POSTS_DAY' => sprintf($user->lang['POST_DAY'], $posts_per_day),
- 'POSTS_PCT' => sprintf($user->lang['POST_PCT'], $percentage),
+ 'POSTS_DAY' => $user->lang('POST_DAY', $posts_per_day),
+ 'POSTS_PCT' => $user->lang('POST_PCT', $percentage),
- 'OCCUPATION' => (!empty($member['user_occ'])) ? censor_text($member['user_occ']) : '',
- 'INTERESTS' => (!empty($member['user_interests'])) ? censor_text($member['user_interests']) : '',
'SIGNATURE' => $member['user_sig'],
'POSTS_IN_QUEUE'=> $member['posts_in_queue'],
- 'AVATAR_IMG' => $poster_avatar,
'PM_IMG' => $user->img('icon_contact_pm', $user->lang['SEND_PRIVATE_MESSAGE']),
+ 'L_SEND_EMAIL_USER' => $user->lang('SEND_EMAIL_USER', $member['username']),
'EMAIL_IMG' => $user->img('icon_contact_email', $user->lang['EMAIL']),
- 'WWW_IMG' => $user->img('icon_contact_www', $user->lang['WWW']),
- 'ICQ_IMG' => $user->img('icon_contact_icq', $user->lang['ICQ']),
- 'AIM_IMG' => $user->img('icon_contact_aim', $user->lang['AIM']),
- 'MSN_IMG' => $user->img('icon_contact_msnm', $user->lang['MSNM']),
- 'YIM_IMG' => $user->img('icon_contact_yahoo', $user->lang['YIM']),
'JABBER_IMG' => $user->img('icon_contact_jabber', $user->lang['JABBER']),
'SEARCH_IMG' => $user->img('icon_user_search', $user->lang['SEARCH']),
@@ -623,11 +721,12 @@ switch ($mode)
'S_GROUP_OPTIONS' => $group_options,
'S_CUSTOM_FIELDS' => (isset($profile_fields['row']) && sizeof($profile_fields['row'])) ? true : false,
- 'U_USER_ADMIN' => ($auth->acl_get('a_user')) ? append_sid("{$phpbb_root_path}adm/index.$phpEx", 'i=users&amp;mode=overview&amp;u=' . $user_id, true, $user->session_id) : '',
+ 'U_USER_ADMIN' => ($auth->acl_get('a_user')) ? append_sid("{$phpbb_admin_path}index.$phpEx", 'i=users&amp;mode=overview&amp;u=' . $user_id, true, $user->session_id) : '',
'U_USER_BAN' => ($auth->acl_get('m_ban') && $user_id != $user->data['user_id']) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=ban&amp;mode=user&amp;u=' . $user_id, true, $user->session_id) : '',
'U_MCP_QUEUE' => ($auth->acl_getf_global('m_approve')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue', true, $user->session_id) : '',
'U_SWITCH_PERMISSIONS' => ($auth->acl_get('a_switchperm') && $user->data['user_id'] != $user_id) ? append_sid("{$phpbb_root_path}ucp.$phpEx", "mode=switch_perm&amp;u={$user_id}&amp;hash=" . generate_link_hash('switchperm')) : '',
+ 'U_EDIT_SELF' => ($user_id == $user->data['user_id'] && $auth->acl_get('u_chgprofileinfo')) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=ucp_profile&amp;mode=profile_info') : '',
'S_USER_NOTES' => ($user_notes_enabled) ? true : false,
'S_WARN_USER' => ($warn_user_enabled) ? true : false,
@@ -636,6 +735,8 @@ switch ($mode)
'U_ADD_FOE' => (!$friend && !$foe && $foes_enabled) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=zebra&amp;mode=foes&amp;add=' . urlencode(htmlspecialchars_decode($member['username']))) : '',
'U_REMOVE_FRIEND' => ($friend && $friends_enabled) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=zebra&amp;remove=1&amp;usernames[]=' . $user_id) : '',
'U_REMOVE_FOE' => ($foe && $foes_enabled) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=zebra&amp;remove=1&amp;mode=foes&amp;usernames[]=' . $user_id) : '',
+
+ 'U_CANONICAL' => generate_board_url() . '/' . append_sid("memberlist.$phpEx", 'mode=viewprofile&amp;u=' . $user_id, true, ''),
));
if (!empty($profile_fields['row']))
@@ -689,265 +790,79 @@ switch ($mode)
break;
+ case 'contactadmin':
case 'email':
-
- // Send an email
- $page_title = $user->lang['SEND_EMAIL'];
- $template_html = 'memberlist_email.html';
-
- add_form_key('memberlist_email');
-
- if (!$config['email_enable'])
- {
- trigger_error('EMAIL_DISABLED');
- }
-
- if (!$auth->acl_get('u_sendemail'))
+ if (!class_exists('messenger'))
{
- trigger_error('NO_EMAIL');
+ include($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);
}
- // Are we trying to abuse the facility?
- if (time() - $user->data['user_emailtime'] < $config['flood_interval'])
- {
- trigger_error('FLOOD_EMAIL_LIMIT');
- }
+ $user_id = request_var('u', 0);
+ $topic_id = request_var('t', 0);
- // Determine action...
- $user_id = request_var('u', 0);
- $topic_id = request_var('t', 0);
-
- // Send email to user...
if ($user_id)
{
- if ($user_id == ANONYMOUS || !$config['board_email_form'])
- {
- trigger_error('NO_EMAIL');
- }
-
- // Get the appropriate username, etc.
- $sql = 'SELECT username, user_email, user_allow_viewemail, user_lang, user_jabber, user_notify_type
- FROM ' . USERS_TABLE . "
- WHERE user_id = $user_id
- AND user_type IN (" . USER_NORMAL . ', ' . USER_FOUNDER . ')';
- $result = $db->sql_query($sql);
- $row = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
-
- if (!$row)
- {
- trigger_error('NO_USER');
- }
-
- // Can we send email to this user?
- if (!$row['user_allow_viewemail'] && !$auth->acl_get('a_user'))
- {
- trigger_error('NO_EMAIL');
- }
+ $form_name = 'user';
}
else if ($topic_id)
{
- // Send topic heads-up to email address
- $sql = 'SELECT forum_id, topic_title
- FROM ' . TOPICS_TABLE . "
- WHERE topic_id = $topic_id";
- $result = $db->sql_query($sql);
- $row = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
-
- if (!$row)
- {
- trigger_error('NO_TOPIC');
- }
-
- if ($row['forum_id'])
- {
- if (!$auth->acl_get('f_read', $row['forum_id']))
- {
- trigger_error('SORRY_AUTH_READ');
- }
-
- if (!$auth->acl_get('f_email', $row['forum_id']))
- {
- trigger_error('NO_EMAIL');
- }
- }
- else
- {
- // If global announcement, we need to check if the user is able to at least read and email in one forum...
- if (!$auth->acl_getf_global('f_read'))
- {
- trigger_error('SORRY_AUTH_READ');
- }
-
- if (!$auth->acl_getf_global('f_email'))
- {
- trigger_error('NO_EMAIL');
- }
- }
+ $form_name = 'topic';
+ }
+ else if ($mode === 'contactadmin')
+ {
+ $form_name = 'admin';
}
else
{
trigger_error('NO_EMAIL');
}
+ $form = $phpbb_container->get('message.form.' . $form_name);
- $error = array();
-
- $name = utf8_normalize_nfc(request_var('name', '', true));
- $email = request_var('email', '');
- $email_lang = request_var('lang', $config['default_lang']);
- $subject = utf8_normalize_nfc(request_var('subject', '', true));
- $message = utf8_normalize_nfc(request_var('message', '', true));
- $cc = (isset($_POST['cc_email'])) ? true : false;
- $submit = (isset($_POST['submit'])) ? true : false;
-
- if ($submit)
+ $form->bind($request);
+ $error = $form->check_allow();
+ if ($error)
{
- if (!check_form_key('memberlist_email'))
- {
- $error[] = 'FORM_INVALID';
- }
- if ($user_id)
- {
- if (!$subject)
- {
- $error[] = $user->lang['EMPTY_SUBJECT_EMAIL'];
- }
-
- if (!$message)
- {
- $error[] = $user->lang['EMPTY_MESSAGE_EMAIL'];
- }
-
- $name = $row['username'];
- $email_lang = $row['user_lang'];
- $email = $row['user_email'];
- }
- else
- {
- if (!$email || !preg_match('/^' . get_preg_expression('email') . '$/i', $email))
- {
- $error[] = $user->lang['EMPTY_ADDRESS_EMAIL'];
- }
-
- if (!$name)
- {
- $error[] = $user->lang['EMPTY_NAME_EMAIL'];
- }
- }
-
- if (!sizeof($error))
- {
- $sql = 'UPDATE ' . USERS_TABLE . '
- SET user_emailtime = ' . time() . '
- WHERE user_id = ' . $user->data['user_id'];
- $result = $db->sql_query($sql);
-
- include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);
- $messenger = new messenger(false);
- $email_tpl = ($user_id) ? 'profile_send_email' : 'email_notify';
-
- $mail_to_users = array();
-
- $mail_to_users[] = array(
- 'email_lang' => $email_lang,
- 'email' => $email,
- 'name' => $name,
- 'username' => ($user_id) ? $row['username'] : '',
- 'to_name' => $name,
- 'user_jabber' => ($user_id) ? $row['user_jabber'] : '',
- 'user_notify_type' => ($user_id) ? $row['user_notify_type'] : NOTIFY_EMAIL,
- 'topic_title' => (!$user_id) ? $row['topic_title'] : '',
- 'forum_id' => (!$user_id) ? $row['forum_id'] : 0,
- );
-
- // Ok, now the same email if CC specified, but without exposing the users email address
- if ($cc)
- {
- $mail_to_users[] = array(
- 'email_lang' => $user->data['user_lang'],
- 'email' => $user->data['user_email'],
- 'name' => $user->data['username'],
- 'username' => $user->data['username'],
- 'to_name' => $name,
- 'user_jabber' => $user->data['user_jabber'],
- 'user_notify_type' => ($user_id) ? $user->data['user_notify_type'] : NOTIFY_EMAIL,
- 'topic_title' => (!$user_id) ? $row['topic_title'] : '',
- 'forum_id' => (!$user_id) ? $row['forum_id'] : 0,
- );
- }
-
- foreach ($mail_to_users as $row)
- {
- $messenger->template($email_tpl, $row['email_lang']);
- $messenger->replyto($user->data['user_email']);
- $messenger->to($row['email'], $row['name']);
-
- if ($user_id)
- {
- $messenger->subject(htmlspecialchars_decode($subject));
- $messenger->im($row['user_jabber'], $row['username']);
- $notify_type = $row['user_notify_type'];
- }
- else
- {
- $notify_type = NOTIFY_EMAIL;
- }
+ trigger_error($error);
+ }
- $messenger->anti_abuse_headers($config, $user);
+ if ($request->is_set_post('submit'))
+ {
+ $messenger = new messenger(false);
+ $form->submit($messenger);
+ }
- $messenger->assign_vars(array(
- 'BOARD_CONTACT' => $config['board_contact'],
- 'TO_USERNAME' => htmlspecialchars_decode($row['to_name']),
- 'FROM_USERNAME' => htmlspecialchars_decode($user->data['username']),
- 'MESSAGE' => htmlspecialchars_decode($message))
- );
+ $page_title = $form->get_page_title();
+ $template_html = $form->get_template_file();
+ $form->render($template);
- if ($topic_id)
- {
- $messenger->assign_vars(array(
- 'TOPIC_NAME' => htmlspecialchars_decode($row['topic_title']),
- 'U_TOPIC' => generate_board_url() . "/viewtopic.$phpEx?f=" . $row['forum_id'] . "&t=$topic_id")
- );
- }
+ break;
- $messenger->send($notify_type);
- }
+ case 'livesearch':
- meta_refresh(3, append_sid("{$phpbb_root_path}index.$phpEx"));
- $message = ($user_id) ? sprintf($user->lang['RETURN_INDEX'], '<a href="' . append_sid("{$phpbb_root_path}index.$phpEx") . '">', '</a>') : sprintf($user->lang['RETURN_TOPIC'], '<a href="' . append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f={$row['forum_id']}&amp;t=$topic_id") . '">', '</a>');
- trigger_error($user->lang['EMAIL_SENT'] . '<br /><br />' . $message);
- }
- }
+ $username_chars = $request->variable('username', '', true);
- if ($user_id)
- {
- $template->assign_vars(array(
- 'S_SEND_USER' => true,
- 'USERNAME' => $row['username'],
+ $sql = 'SELECT username, user_id, user_colour
+ FROM ' . USERS_TABLE . '
+ WHERE ' . $db->sql_in_set('user_type', $user_types) . '
+ AND username_clean ' . $db->sql_like_expression(utf8_clean_string($username_chars) . $db->get_any_char());
+ $result = $db->sql_query_limit($sql, 10);
+ $user_list = array();
- 'L_EMAIL_BODY_EXPLAIN' => $user->lang['EMAIL_BODY_EXPLAIN'],
- 'S_POST_ACTION' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=email&amp;u=' . $user_id))
- );
- }
- else
+ while ($row = $db->sql_fetchrow($result))
{
- $template->assign_vars(array(
- 'EMAIL' => $email,
- 'NAME' => $name,
- 'S_LANG_OPTIONS' => language_select($email_lang),
-
- 'L_EMAIL_BODY_EXPLAIN' => $user->lang['EMAIL_TOPIC_EXPLAIN'],
- 'S_POST_ACTION' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=email&amp;t=' . $topic_id))
+ $user_list[] = array(
+ 'user_id' => (int) $row['user_id'],
+ 'result' => $row['username'],
+ 'username_full' => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']),
+ 'display' => get_username_string('no_profile', $row['user_id'], $row['username'], $row['user_colour']),
);
}
-
- $template->assign_vars(array(
- 'ERROR_MESSAGE' => (sizeof($error)) ? implode('<br />', $error) : '',
- 'SUBJECT' => $subject,
- 'MESSAGE' => $message,
- )
- );
+ $db->sql_freeresult($result);
+ $json_response = new \phpbb\json_response();
+ $json_response->send(array(
+ 'keyword' => $username_chars,
+ 'results' => $user_list,
+ ));
break;
@@ -956,10 +871,17 @@ switch ($mode)
// The basic memberlist
$page_title = $user->lang['MEMBERLIST'];
$template_html = 'memberlist_body.html';
+ $pagination = $phpbb_container->get('pagination');
// Sorting
- $sort_key_text = array('a' => $user->lang['SORT_USERNAME'], 'b' => $user->lang['SORT_LOCATION'], 'c' => $user->lang['SORT_JOINED'], 'd' => $user->lang['SORT_POST_COUNT'], 'f' => $user->lang['WEBSITE'], 'g' => $user->lang['ICQ'], 'h' => $user->lang['AIM'], 'i' => $user->lang['MSNM'], 'j' => $user->lang['YIM'], 'k' => $user->lang['JABBER']);
- $sort_key_sql = array('a' => 'u.username_clean', 'b' => 'u.user_from', 'c' => 'u.user_regdate', 'd' => 'u.user_posts', 'f' => 'u.user_website', 'g' => 'u.user_icq', 'h' => 'u.user_aim', 'i' => 'u.user_msnm', 'j' => 'u.user_yim', 'k' => 'u.user_jabber');
+ $sort_key_text = array('a' => $user->lang['SORT_USERNAME'], 'c' => $user->lang['SORT_JOINED'], 'd' => $user->lang['SORT_POST_COUNT']);
+ $sort_key_sql = array('a' => 'u.username_clean', 'c' => 'u.user_regdate', 'd' => 'u.user_posts');
+
+ if ($config['jab_enable'])
+ {
+ $sort_key_text['k'] = $user->lang['JABBER'];
+ $sort_key_sql['k'] = 'u.user_jabber';
+ }
if ($auth->acl_get('a_user'))
{
@@ -1002,19 +924,15 @@ switch ($mode)
$select_single = request_var('select_single', false);
// Search URL parameters, if any of these are in the URL we do a search
- $search_params = array('username', 'email', 'icq', 'aim', 'yahoo', 'msn', 'jabber', 'search_group_id', 'joined_select', 'active_select', 'count_select', 'joined', 'active', 'count', 'ip');
+ $search_params = array('username', 'email', 'jabber', 'search_group_id', 'joined_select', 'active_select', 'count_select', 'joined', 'active', 'count', 'ip');
// We validate form and field here, only id/class allowed
$form = (!preg_match('/^[a-z0-9_-]+$/i', $form)) ? '' : $form;
$field = (!preg_match('/^[a-z0-9_-]+$/i', $field)) ? '' : $field;
- if (($mode == 'searchuser' || sizeof(array_intersect(array_keys($_GET), $search_params)) > 0) && ($config['load_search'] || $auth->acl_get('a_')))
+ if ((($mode == '' || $mode == 'searchuser') || sizeof(array_intersect($request->variable_names(\phpbb\request\request_interface::GET), $search_params)) > 0) && ($config['load_search'] || $auth->acl_get('a_')))
{
$username = request_var('username', '', true);
$email = strtolower(request_var('email', ''));
- $icq = request_var('icq', '');
- $aim = request_var('aim', '');
- $yahoo = request_var('yahoo', '');
- $msn = request_var('msn', '');
$jabber = request_var('jabber', '');
$search_group_id = request_var('search_group_id', 0);
@@ -1053,25 +971,16 @@ switch ($mode)
$s_find_active_time .= '<option value="' . $key . '"' . $selected . '>' . $value . '</option>';
}
- $sql_where .= ($username) ? ' AND u.username_clean ' . $db->sql_like_expression(str_replace('*', $db->any_char, utf8_clean_string($username))) : '';
- $sql_where .= ($auth->acl_get('a_user') && $email) ? ' AND u.user_email ' . $db->sql_like_expression(str_replace('*', $db->any_char, $email)) . ' ' : '';
- $sql_where .= ($icq) ? ' AND u.user_icq ' . $db->sql_like_expression(str_replace('*', $db->any_char, $icq)) . ' ' : '';
- $sql_where .= ($aim) ? ' AND u.user_aim ' . $db->sql_like_expression(str_replace('*', $db->any_char, $aim)) . ' ' : '';
- $sql_where .= ($yahoo) ? ' AND u.user_yim ' . $db->sql_like_expression(str_replace('*', $db->any_char, $yahoo)) . ' ' : '';
- $sql_where .= ($msn) ? ' AND u.user_msnm ' . $db->sql_like_expression(str_replace('*', $db->any_char, $msn)) . ' ' : '';
- $sql_where .= ($jabber) ? ' AND u.user_jabber ' . $db->sql_like_expression(str_replace('*', $db->any_char, $jabber)) . ' ' : '';
+ $sql_where .= ($username) ? ' AND u.username_clean ' . $db->sql_like_expression(str_replace('*', $db->get_any_char(), utf8_clean_string($username))) : '';
+ $sql_where .= ($auth->acl_get('a_user') && $email) ? ' AND u.user_email ' . $db->sql_like_expression(str_replace('*', $db->get_any_char(), $email)) . ' ' : '';
+ $sql_where .= ($jabber) ? ' AND u.user_jabber ' . $db->sql_like_expression(str_replace('*', $db->get_any_char(), $jabber)) . ' ' : '';
$sql_where .= (is_numeric($count) && isset($find_key_match[$count_select])) ? ' AND u.user_posts ' . $find_key_match[$count_select] . ' ' . (int) $count . ' ' : '';
if (isset($find_key_match[$joined_select]) && sizeof($joined) == 3)
{
- // Before PHP 5.1 an error value -1 can be returned instead of false.
- // Theoretically gmmktime() can also legitimately return -1 as an actual timestamp.
- // But since we do not pass the $second parameter to gmmktime(),
- // an actual unix timestamp -1 cannot be returned in this case.
- // Thus we can check whether it is -1 and treat -1 as an error.
$joined_time = gmmktime(0, 0, 0, (int) $joined[1], (int) $joined[2], (int) $joined[0]);
- if ($joined_time !== false && $joined_time !== -1)
+ if ($joined_time !== false)
{
$sql_where .= " AND u.user_regdate " . $find_key_match[$joined_select] . ' ' . $joined_time;
}
@@ -1081,7 +990,7 @@ switch ($mode)
{
$active_time = gmmktime(0, 0, 0, (int) $active[1], (int) $active[2], (int) $active[0]);
- if ($active_time !== false && $active_time !== -1)
+ if ($active_time !== false)
{
$sql_where .= " AND u.user_lastvisit " . $find_key_match[$active_select] . ' ' . $active_time;
}
@@ -1126,7 +1035,24 @@ switch ($mode)
$sql = 'SELECT DISTINCT poster_id
FROM ' . POSTS_TABLE . '
WHERE poster_ip ' . ((strpos($ips, '%') !== false) ? 'LIKE' : 'IN') . " ($ips)
- AND forum_id IN (0, " . implode(', ', $ip_forums) . ')';
+ AND " . $db->sql_in_set('forum_id', $ip_forums);
+
+ /**
+ * Modify sql query for members search by ip address / hostname
+ *
+ * @event core.memberlist_modify_ip_search_sql_query
+ * @var string ipdomain The host name
+ * @var string ips IP address list for the given host name
+ * @var string sql The SQL query for searching members by IP address
+ * @since 3.1.7-RC1
+ */
+ $vars = array(
+ 'ipdomain',
+ 'ips',
+ 'sql',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.memberlist_modify_ip_search_sql_query', compact($vars)));
+
$result = $db->sql_query($sql);
if ($row = $db->sql_fetchrow($result))
@@ -1158,12 +1084,12 @@ switch ($mode)
{
for ($i = 97; $i < 123; $i++)
{
- $sql_where .= ' AND u.username_clean NOT ' . $db->sql_like_expression(chr($i) . $db->any_char);
+ $sql_where .= ' AND u.username_clean NOT ' . $db->sql_like_expression(chr($i) . $db->get_any_char());
}
}
else if ($first_char)
{
- $sql_where .= ' AND u.username_clean ' . $db->sql_like_expression(substr($first_char, 0, 1) . $db->any_char);
+ $sql_where .= ' AND u.username_clean ' . $db->sql_like_expression(substr($first_char, 0, 1) . $db->get_any_char());
}
// Are we looking at a usergroup? If so, fetch additional info
@@ -1171,7 +1097,7 @@ switch ($mode)
if ($mode == 'group')
{
// We JOIN here to save a query for determining membership for hidden groups. ;)
- $sql = 'SELECT g.*, ug.user_id
+ $sql = 'SELECT g.*, ug.user_id, ug.group_leader
FROM ' . GROUPS_TABLE . ' g
LEFT JOIN ' . USER_GROUP_TABLE . ' ug ON (ug.user_pending = 0 AND ug.user_id = ' . $user->data['user_id'] . " AND ug.group_id = $group_id)
WHERE g.group_id = $group_id";
@@ -1213,19 +1139,40 @@ switch ($mode)
break;
}
- // Misusing the avatar function for displaying group avatars...
- $avatar_img = get_user_avatar($group_row['group_avatar'], $group_row['group_avatar_type'], $group_row['group_avatar_width'], $group_row['group_avatar_height'], 'GROUP_AVATAR');
+ $avatar_img = phpbb_get_group_avatar($group_row);
// ... same for group rank
- $rank_title = $rank_img = $rank_img_src = '';
+ $user_rank_data = array(
+ 'title' => null,
+ 'img' => null,
+ 'img_src' => null,
+ );
if ($group_row['group_rank'])
{
- get_user_rank($group_row['group_rank'], false, $rank_title, $rank_img, $rank_img_src);
+ $user_rank_data = phpbb_get_user_rank($group_row, false);
+
+ if ($user_rank_data['img'])
+ {
+ $user_rank_data['img'] .= '<br />';
+ }
+ }
+ // include modules for manage groups link display or not
+ // need to ensure the module is active
+ $can_manage_group = false;
+ if ($user->data['is_registered'] && $group_row['group_leader'])
+ {
+ if (!class_exists('p_master'))
+ {
+ include($phpbb_root_path . 'includes/functions_module.' . $phpEx);
+ }
+ $module = new p_master;
+ $module->list_modules('ucp');
- if ($rank_img)
+ if ($module->is_active('ucp_groups', 'manage'))
{
- $rank_img .= '<br />';
+ $can_manage_group = true;
}
+ unset($module);
}
$template->assign_vars(array(
@@ -1233,13 +1180,14 @@ switch ($mode)
'GROUP_NAME' => ($group_row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $group_row['group_name']] : $group_row['group_name'],
'GROUP_COLOR' => $group_row['group_colour'],
'GROUP_TYPE' => $user->lang['GROUP_IS_' . $group_row['l_group_type']],
- 'GROUP_RANK' => $rank_title,
+ 'GROUP_RANK' => $user_rank_data['title'],
'AVATAR_IMG' => $avatar_img,
- 'RANK_IMG' => $rank_img,
- 'RANK_IMG_SRC' => $rank_img_src,
+ 'RANK_IMG' => $user_rank_data['img'],
+ 'RANK_IMG_SRC' => $user_rank_data['img_src'],
- 'U_PM' => ($auth->acl_get('u_sendpm') && $auth->acl_get('u_masspm_group') && $group_row['group_receive_pm'] && $config['allow_privmsg'] && $config['allow_mass_pm']) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&amp;mode=compose&amp;g=' . $group_id) : '',)
+ 'U_PM' => ($auth->acl_get('u_sendpm') && $auth->acl_get('u_masspm_group') && $group_row['group_receive_pm'] && $config['allow_privmsg'] && $config['allow_mass_pm']) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&amp;mode=compose&amp;g=' . $group_id) : '',
+ 'U_MANAGE' => ($can_manage_group) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=ucp_groups&amp;mode=manage') : false,)
);
$sql_select = ', ug.group_leader';
@@ -1264,21 +1212,40 @@ switch ($mode)
$order_by .= ', u.user_posts DESC';
}
+ /**
+ * Modify sql query data for members search
+ *
+ * @event core.memberlist_modify_sql_query_data
+ * @var string order_by SQL ORDER BY clause condition
+ * @var string sort_dir The sorting direction
+ * @var string sort_key The sorting key
+ * @var array sort_key_sql Arraty with the sorting conditions data
+ * @var string sql_from SQL FROM clause condition
+ * @var string sql_select SQL SELECT fields list
+ * @var string sql_where SQL WHERE clause condition
+ * @var string sql_where_data SQL WHERE clause additional conditions data
+ * @since 3.1.7-RC1
+ */
+ $vars = array(
+ 'order_by',
+ 'sort_dir',
+ 'sort_key',
+ 'sort_key_sql',
+ 'sql_from',
+ 'sql_select',
+ 'sql_where',
+ 'sql_where_data',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.memberlist_modify_sql_query_data', compact($vars)));
+
// Count the users ...
- if ($sql_where)
- {
- $sql = 'SELECT COUNT(u.user_id) AS total_users
- FROM ' . USERS_TABLE . " u$sql_from
- WHERE u.user_type IN (" . USER_NORMAL . ', ' . USER_FOUNDER . ")
- $sql_where";
- $result = $db->sql_query($sql);
- $total_users = (int) $db->sql_fetchfield('total_users');
- $db->sql_freeresult($result);
- }
- else
- {
- $total_users = $config['num_users'];
- }
+ $sql = 'SELECT COUNT(u.user_id) AS total_users
+ FROM ' . USERS_TABLE . " u$sql_from
+ WHERE " . $db->sql_in_set('u.user_type', $user_types) . "
+ $sql_where";
+ $result = $db->sql_query($sql);
+ $total_users = (int) $db->sql_fetchfield('total_users');
+ $db->sql_freeresult($result);
// Build a relevant pagination_url
$params = $sort_params = array();
@@ -1293,10 +1260,6 @@ switch ($mode)
'select_single' => array('select_single', $select_single),
'username' => array('username', '', true),
'email' => array('email', ''),
- 'icq' => array('icq', ''),
- 'aim' => array('aim', ''),
- 'yahoo' => array('yahoo', ''),
- 'msn' => array('msn', ''),
'jabber' => array('jabber', ''),
'search_group_id' => array('search_group_id', 0),
'joined_select' => array('joined_select', 'lt'),
@@ -1318,7 +1281,8 @@ switch ($mode)
}
$param = call_user_func_array('request_var', $call);
- $param = urlencode($key) . '=' . ((is_string($param)) ? urlencode($param) : $param);
+ // Encode strings, convert everything else to int in order to prevent empty parameters.
+ $param = urlencode($key) . '=' . ((is_string($param)) ? urlencode($param) : (int) $param);
$params[] = $param;
if ($key != 'first_char')
@@ -1367,7 +1331,7 @@ switch ($mode)
}
// Some search user specific data
- if ($mode == 'searchuser' && ($config['load_search'] || $auth->acl_get('a_')))
+ if (($mode == '' || $mode == 'searchuser') && ($config['load_search'] || $auth->acl_get('a_')))
{
$group_selected = request_var('search_group_id', 0);
$s_group_select = '<option value="0"' . ((!$group_selected) ? ' selected="selected"' : '') . '>&nbsp;</option>';
@@ -1425,10 +1389,6 @@ switch ($mode)
$template->assign_vars(array(
'USERNAME' => $username,
'EMAIL' => $email,
- 'ICQ' => $icq,
- 'AIM' => $aim,
- 'YAHOO' => $yahoo,
- 'MSNM' => $msn,
'JABBER' => $jabber,
'JOINED' => implode('-', $joined),
'ACTIVE' => implode('-', $active),
@@ -1437,8 +1397,9 @@ switch ($mode)
'S_IP_SEARCH_ALLOWED' => ($auth->acl_getf_global('m_info')) ? true : false,
'S_EMAIL_SEARCH_ALLOWED'=> ($auth->acl_get('a_user')) ? true : false,
+ 'S_JABBER_ENABLED' => $config['jab_enable'],
'S_IN_SEARCH_POPUP' => ($form && $field) ? true : false,
- 'S_SEARCH_USER' => true,
+ 'S_SEARCH_USER' => ($mode == 'searchuser' || ($mode == '' && $submit)),
'S_FORM_NAME' => $form,
'S_FIELD_NAME' => $field,
'S_SELECT_SINGLE' => $select_single,
@@ -1451,11 +1412,13 @@ switch ($mode)
);
}
+ $start = $pagination->validate_start($start, $config['topics_per_page'], $total_users);
+
// Get us some users :D
$sql = "SELECT u.user_id
FROM " . USERS_TABLE . " u
$sql_from
- WHERE u.user_type IN (" . USER_NORMAL . ', ' . USER_FOUNDER . ")
+ WHERE " . $db->sql_in_set('u.user_type', $user_types) . "
$sql_where
ORDER BY $order_by";
$result = $db->sql_query_limit($sql, $config['topics_per_page'], $start);
@@ -1466,6 +1429,19 @@ switch ($mode)
$user_list[] = (int) $row['user_id'];
}
$db->sql_freeresult($result);
+
+ // Load custom profile fields
+ if ($config['load_cpf_memberlist'])
+ {
+ $cp = $phpbb_container->get('profilefields.manager');
+
+ $cp_row = $cp->generate_profile_fields_template_headlines('field_show_on_ml');
+ foreach ($cp_row as $profile_field)
+ {
+ $template->assign_block_vars('custom_fields', $profile_field);
+ }
+ }
+
$leaders_set = false;
// So, did we get any users?
if (sizeof($user_list))
@@ -1516,41 +1492,65 @@ switch ($mode)
// Load custom profile fields
if ($config['load_cpf_memberlist'])
{
- include_once($phpbb_root_path . 'includes/functions_profile_fields.' . $phpEx);
- $cp = new custom_profile();
-
// Grab all profile fields from users in id cache for later use - similar to the poster cache
- $profile_fields_cache = $cp->generate_profile_fields_template('grab', $user_list);
+ $profile_fields_cache = $cp->grab_profile_fields_data($user_list);
+
+ // Filter the fields we don't want to show
+ foreach ($profile_fields_cache as $user_id => $user_profile_fields)
+ {
+ foreach ($user_profile_fields as $field_ident => $profile_field)
+ {
+ if (!$profile_field['data']['field_show_on_ml'])
+ {
+ unset($profile_fields_cache[$user_id][$field_ident]);
+ }
+ }
+ }
}
// If we sort by last active date we need to adjust the id cache due to user_lastvisit not being the last active date...
if ($sort_key == 'l')
{
// uasort($id_cache, create_function('$first, $second', "return (\$first['last_visit'] == \$second['last_visit']) ? 0 : ((\$first['last_visit'] < \$second['last_visit']) ? $lesser_than : ($lesser_than * -1));"));
- usort($user_list, '_sort_last_active');
+ usort($user_list, 'phpbb_sort_last_active');
}
+ // do we need to display contact fields as such
+ $use_contact_fields = false;
+
+ /**
+ * Modify list of users before member row is created
+ *
+ * @event core.memberlist_memberrow_before
+ * @var array user_list Array containing list of users
+ * @var bool use_contact_fields Should we display contact fields as such?
+ * @since 3.1.7-RC1
+ */
+ $vars = array('user_list', 'use_contact_fields');
+ extract($phpbb_dispatcher->trigger_event('core.memberlist_memberrow_before', compact($vars)));
+
for ($i = 0, $end = sizeof($user_list); $i < $end; ++$i)
{
$user_id = $user_list[$i];
- $row =& $id_cache[$user_id];
+ $row = $id_cache[$user_id];
$is_leader = (isset($row['group_leader']) && $row['group_leader']) ? true : false;
$leaders_set = ($leaders_set || $is_leader);
$cp_row = array();
if ($config['load_cpf_memberlist'])
{
- $cp_row = (isset($profile_fields_cache[$user_id])) ? $cp->generate_profile_fields_template('show', false, $profile_fields_cache[$user_id]) : array();
+ $cp_row = (isset($profile_fields_cache[$user_id])) ? $cp->generate_profile_fields_template_data($profile_fields_cache[$user_id], $use_contact_fields) : array();
}
- $memberrow = array_merge(show_profile($row), array(
+ $memberrow = array_merge(phpbb_show_profile($row, false, false, false), array(
'ROW_NUMBER' => $i + ($start + 1),
'S_CUSTOM_PROFILE' => (isset($cp_row['row']) && sizeof($cp_row['row'])) ? true : false,
'S_GROUP_LEADER' => $is_leader,
+ 'S_INACTIVE' => $row['user_type'] == USER_INACTIVE,
- 'U_VIEW_PROFILE' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&amp;u=' . $user_id))
- );
+ 'U_VIEW_PROFILE' => get_username_string('profile', $user_id, $row['username']),
+ ));
if (isset($cp_row['row']) && sizeof($cp_row['row']))
{
@@ -1571,39 +1571,28 @@ switch ($mode)
}
}
+ $pagination->generate_template_pagination($pagination_url, 'pagination', 'start', $total_users, $config['topics_per_page'], $start);
+
// Generate page
$template->assign_vars(array(
- 'PAGINATION' => generate_pagination($pagination_url, $total_users, $config['topics_per_page'], $start),
- 'PAGE_NUMBER' => on_page($total_users, $config['topics_per_page'], $start),
- 'TOTAL_USERS' => ($total_users == 1) ? $user->lang['LIST_USER'] : sprintf($user->lang['LIST_USERS'], $total_users),
+ 'TOTAL_USERS' => $user->lang('LIST_USERS', (int) $total_users),
'PROFILE_IMG' => $user->img('icon_user_profile', $user->lang['PROFILE']),
'PM_IMG' => $user->img('icon_contact_pm', $user->lang['SEND_PRIVATE_MESSAGE']),
'EMAIL_IMG' => $user->img('icon_contact_email', $user->lang['EMAIL']),
- 'WWW_IMG' => $user->img('icon_contact_www', $user->lang['WWW']),
- 'ICQ_IMG' => $user->img('icon_contact_icq', $user->lang['ICQ']),
- 'AIM_IMG' => $user->img('icon_contact_aim', $user->lang['AIM']),
- 'MSN_IMG' => $user->img('icon_contact_msnm', $user->lang['MSNM']),
- 'YIM_IMG' => $user->img('icon_contact_yahoo', $user->lang['YIM']),
'JABBER_IMG' => $user->img('icon_contact_jabber', $user->lang['JABBER']),
'SEARCH_IMG' => $user->img('icon_user_search', $user->lang['SEARCH']),
'U_FIND_MEMBER' => ($config['load_search'] || $auth->acl_get('a_')) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser' . (($start) ? "&amp;start=$start" : '') . (!empty($params) ? '&amp;' . implode('&amp;', $params) : '')) : '',
- 'U_HIDE_FIND_MEMBER' => ($mode == 'searchuser') ? $u_hide_find_member : '',
+ 'U_HIDE_FIND_MEMBER' => ($mode == 'searchuser' || ($mode == '' && $submit)) ? $u_hide_find_member : '',
+ 'U_LIVE_SEARCH' => ($config['allow_live_searches']) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=livesearch') : false,
'U_SORT_USERNAME' => $sort_url . '&amp;sk=a&amp;sd=' . (($sort_key == 'a' && $sort_dir == 'a') ? 'd' : 'a'),
- 'U_SORT_FROM' => $sort_url . '&amp;sk=b&amp;sd=' . (($sort_key == 'b' && $sort_dir == 'a') ? 'd' : 'a'),
- 'U_SORT_JOINED' => $sort_url . '&amp;sk=c&amp;sd=' . (($sort_key == 'c' && $sort_dir == 'a') ? 'd' : 'a'),
- 'U_SORT_POSTS' => $sort_url . '&amp;sk=d&amp;sd=' . (($sort_key == 'd' && $sort_dir == 'a') ? 'd' : 'a'),
- 'U_SORT_EMAIL' => $sort_url . '&amp;sk=e&amp;sd=' . (($sort_key == 'e' && $sort_dir == 'a') ? 'd' : 'a'),
- 'U_SORT_WEBSITE' => $sort_url . '&amp;sk=f&amp;sd=' . (($sort_key == 'f' && $sort_dir == 'a') ? 'd' : 'a'),
- 'U_SORT_LOCATION' => $sort_url . '&amp;sk=b&amp;sd=' . (($sort_key == 'b' && $sort_dir == 'a') ? 'd' : 'a'),
- 'U_SORT_ICQ' => $sort_url . '&amp;sk=g&amp;sd=' . (($sort_key == 'g' && $sort_dir == 'a') ? 'd' : 'a'),
- 'U_SORT_AIM' => $sort_url . '&amp;sk=h&amp;sd=' . (($sort_key == 'h' && $sort_dir == 'a') ? 'd' : 'a'),
- 'U_SORT_MSN' => $sort_url . '&amp;sk=i&amp;sd=' . (($sort_key == 'i' && $sort_dir == 'a') ? 'd' : 'a'),
- 'U_SORT_YIM' => $sort_url . '&amp;sk=j&amp;sd=' . (($sort_key == 'j' && $sort_dir == 'a') ? 'd' : 'a'),
- 'U_SORT_ACTIVE' => ($auth->acl_get('u_viewonline')) ? $sort_url . '&amp;sk=l&amp;sd=' . (($sort_key == 'l' && $sort_dir == 'a') ? 'd' : 'a') : '',
- 'U_SORT_RANK' => $sort_url . '&amp;sk=m&amp;sd=' . (($sort_key == 'm' && $sort_dir == 'a') ? 'd' : 'a'),
- 'U_LIST_CHAR' => $sort_url . '&amp;sk=a&amp;sd=' . (($sort_key == 'l' && $sort_dir == 'a') ? 'd' : 'a'),
+ 'U_SORT_JOINED' => $sort_url . '&amp;sk=c&amp;sd=' . (($sort_key == 'c' && $sort_dir == 'd') ? 'a' : 'd'),
+ 'U_SORT_POSTS' => $sort_url . '&amp;sk=d&amp;sd=' . (($sort_key == 'd' && $sort_dir == 'd') ? 'a' : 'd'),
+ 'U_SORT_EMAIL' => $sort_url . '&amp;sk=e&amp;sd=' . (($sort_key == 'e' && $sort_dir == 'd') ? 'a' : 'd'),
+ 'U_SORT_ACTIVE' => ($auth->acl_get('u_viewonline')) ? $sort_url . '&amp;sk=l&amp;sd=' . (($sort_key == 'l' && $sort_dir == 'd') ? 'a' : 'd') : '',
+ 'U_SORT_RANK' => $sort_url . '&amp;sk=m&amp;sd=' . (($sort_key == 'm' && $sort_dir == 'd') ? 'a' : 'd'),
+ 'U_LIST_CHAR' => $sort_url . '&amp;sk=a&amp;sd=' . (($sort_key == 'l' && $sort_dir == 'd') ? 'a' : 'd'),
'S_SHOW_GROUP' => ($mode == 'group') ? true : false,
'S_VIEWONLINE' => $auth->acl_get('u_viewonline'),
@@ -1615,7 +1604,7 @@ switch ($mode)
}
// Output the page
-page_header($page_title, false);
+page_header($page_title);
$template->set_filenames(array(
'body' => $template_html)
@@ -1623,141 +1612,3 @@ $template->set_filenames(array(
make_jumpbox(append_sid("{$phpbb_root_path}viewforum.$phpEx"));
page_footer();
-
-/**
-* Prepare profile data
-*/
-function show_profile($data, $user_notes_enabled = false, $warn_user_enabled = false)
-{
- global $config, $auth, $template, $user, $phpEx, $phpbb_root_path;
-
- $username = $data['username'];
- $user_id = $data['user_id'];
-
- $rank_title = $rank_img = $rank_img_src = '';
- get_user_rank($data['user_rank'], (($user_id == ANONYMOUS) ? false : $data['user_posts']), $rank_title, $rank_img, $rank_img_src);
-
- if ((!empty($data['user_allow_viewemail']) && $auth->acl_get('u_sendemail')) || $auth->acl_get('a_user'))
- {
- $email = ($config['board_email_form'] && $config['email_enable']) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=email&amp;u=' . $user_id) : (($config['board_hide_emails'] && !$auth->acl_get('a_user')) ? '' : 'mailto:' . $data['user_email']);
- }
- else
- {
- $email = '';
- }
-
- if ($config['load_onlinetrack'])
- {
- $update_time = $config['load_online_time'] * 60;
- $online = (time() - $update_time < $data['session_time'] && ((isset($data['session_viewonline']) && $data['session_viewonline']) || $auth->acl_get('u_viewonline'))) ? true : false;
- }
- else
- {
- $online = false;
- }
-
- if ($data['user_allow_viewonline'] || $auth->acl_get('u_viewonline'))
- {
- $last_visit = (!empty($data['session_time'])) ? $data['session_time'] : $data['user_lastvisit'];
- }
- else
- {
- $last_visit = '';
- }
-
- $age = '';
-
- if ($config['allow_birthdays'] && $data['user_birthday'])
- {
- list($bday_day, $bday_month, $bday_year) = array_map('intval', explode('-', $data['user_birthday']));
-
- if ($bday_year)
- {
- $now = phpbb_gmgetdate(time() + $user->timezone + $user->dst);
-
- $diff = $now['mon'] - $bday_month;
- if ($diff == 0)
- {
- $diff = ($now['mday'] - $bday_day < 0) ? 1 : 0;
- }
- else
- {
- $diff = ($diff < 0) ? 1 : 0;
- }
-
- $age = max(0, (int) ($now['year'] - $bday_year - $diff));
- }
- }
-
- // Dump it out to the template
- return array(
- 'AGE' => $age,
- 'RANK_TITLE' => $rank_title,
- 'JOINED' => $user->format_date($data['user_regdate']),
- 'VISITED' => (empty($last_visit)) ? ' - ' : $user->format_date($last_visit),
- 'POSTS' => ($data['user_posts']) ? $data['user_posts'] : 0,
- 'WARNINGS' => isset($data['user_warnings']) ? $data['user_warnings'] : 0,
-
- 'USERNAME_FULL' => get_username_string('full', $user_id, $username, $data['user_colour']),
- 'USERNAME' => get_username_string('username', $user_id, $username, $data['user_colour']),
- 'USER_COLOR' => get_username_string('colour', $user_id, $username, $data['user_colour']),
- 'U_VIEW_PROFILE' => get_username_string('profile', $user_id, $username, $data['user_colour']),
-
- 'A_USERNAME' => addslashes(get_username_string('username', $user_id, $username, $data['user_colour'])),
-
- 'AVATAR_IMG' => get_user_avatar($data['user_avatar'], $data['user_avatar_type'], $data['user_avatar_width'], $data['user_avatar_height']),
- 'ONLINE_IMG' => (!$config['load_onlinetrack']) ? '' : (($online) ? $user->img('icon_user_online', 'ONLINE') : $user->img('icon_user_offline', 'OFFLINE')),
- 'S_ONLINE' => ($config['load_onlinetrack'] && $online) ? true : false,
- 'RANK_IMG' => $rank_img,
- 'RANK_IMG_SRC' => $rank_img_src,
- 'ICQ_STATUS_IMG' => (!empty($data['user_icq'])) ? '<img src="http://web.icq.com/whitepages/online?icq=' . $data['user_icq'] . '&amp;img=5" width="18" height="18" />' : '',
- 'S_JABBER_ENABLED' => ($config['jab_enable']) ? true : false,
-
- 'S_WARNINGS' => ($auth->acl_getf_global('m_') || $auth->acl_get('m_warn')) ? true : false,
-
- 'U_SEARCH_USER' => ($auth->acl_get('u_search')) ? append_sid("{$phpbb_root_path}search.$phpEx", "author_id=$user_id&amp;sr=posts") : '',
- 'U_NOTES' => ($user_notes_enabled && $auth->acl_getf_global('m_')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&amp;mode=user_notes&amp;u=' . $user_id, true, $user->session_id) : '',
- 'U_WARN' => ($warn_user_enabled && $auth->acl_get('m_warn')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=warn&amp;mode=warn_user&amp;u=' . $user_id, true, $user->session_id) : '',
- 'U_PM' => ($config['allow_privmsg'] && $auth->acl_get('u_sendpm') && ($data['user_allow_pm'] || $auth->acl_gets('a_', 'm_') || $auth->acl_getf_global('m_'))) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&amp;mode=compose&amp;u=' . $user_id) : '',
- 'U_EMAIL' => $email,
- 'U_WWW' => (!empty($data['user_website'])) ? $data['user_website'] : '',
- 'U_SHORT_WWW' => (!empty($data['user_website'])) ? ((strlen($data['user_website']) > 55) ? substr($data['user_website'], 0, 39) . ' ... ' . substr($data['user_website'], -10) : $data['user_website']) : '',
- 'U_ICQ' => ($data['user_icq']) ? 'http://www.icq.com/people/' . urlencode($data['user_icq']) . '/' : '',
- 'U_AIM' => ($data['user_aim'] && $auth->acl_get('u_sendim')) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=contact&amp;action=aim&amp;u=' . $user_id) : '',
- 'U_YIM' => ($data['user_yim']) ? 'http://edit.yahoo.com/config/send_webmesg?.target=' . urlencode($data['user_yim']) . '&amp;.src=pg' : '',
- 'U_MSN' => ($data['user_msnm'] && $auth->acl_get('u_sendim')) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=contact&amp;action=msnm&amp;u=' . $user_id) : '',
- 'U_JABBER' => ($data['user_jabber'] && $auth->acl_get('u_sendim')) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=contact&amp;action=jabber&amp;u=' . $user_id) : '',
- 'LOCATION' => ($data['user_from']) ? $data['user_from'] : '',
-
- 'USER_ICQ' => $data['user_icq'],
- 'USER_AIM' => $data['user_aim'],
- 'USER_YIM' => $data['user_yim'],
- 'USER_MSN' => $data['user_msnm'],
- 'USER_JABBER' => $data['user_jabber'],
- 'USER_JABBER_IMG' => ($data['user_jabber']) ? $user->img('icon_contact_jabber', $data['user_jabber']) : '',
-
- 'L_VIEWING_PROFILE' => sprintf($user->lang['VIEWING_PROFILE'], $username),
- );
-}
-
-function _sort_last_active($first, $second)
-{
- global $id_cache, $sort_dir;
-
- $lesser_than = ($sort_dir === 'd') ? -1 : 1;
-
- if (isset($id_cache[$first]['group_leader']) && $id_cache[$first]['group_leader'] && (!isset($id_cache[$second]['group_leader']) || !$id_cache[$second]['group_leader']))
- {
- return -1;
- }
- else if (isset($id_cache[$second]['group_leader']) && (!isset($id_cache[$first]['group_leader']) || !$id_cache[$first]['group_leader']) && $id_cache[$second]['group_leader'])
- {
- return 1;
- }
- else
- {
- return $lesser_than * (int) ($id_cache[$first]['last_visit'] - $id_cache[$second]['last_visit']);
- }
-}
-
-?> \ No newline at end of file
diff --git a/phpBB/phpbb/auth/auth.php b/phpBB/phpbb/auth/auth.php
new file mode 100644
index 0000000000..37d4352c10
--- /dev/null
+++ b/phpBB/phpbb/auth/auth.php
@@ -0,0 +1,1121 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\auth;
+
+/**
+* Permission/Auth class
+*/
+class auth
+{
+ var $acl = array();
+ var $cache = array();
+ var $acl_options = array();
+ var $acl_forum_ids = false;
+
+ /**
+ * Init permissions
+ */
+ function acl(&$userdata)
+ {
+ global $db, $cache;
+
+ $this->acl = $this->cache = $this->acl_options = array();
+ $this->acl_forum_ids = false;
+
+ if (($this->acl_options = $cache->get('_acl_options')) === false)
+ {
+ $sql = 'SELECT auth_option_id, auth_option, is_global, is_local
+ FROM ' . ACL_OPTIONS_TABLE . '
+ ORDER BY auth_option_id';
+ $result = $db->sql_query($sql);
+
+ $global = $local = 0;
+ $this->acl_options = array();
+ while ($row = $db->sql_fetchrow($result))
+ {
+ if ($row['is_global'])
+ {
+ $this->acl_options['global'][$row['auth_option']] = $global++;
+ }
+
+ if ($row['is_local'])
+ {
+ $this->acl_options['local'][$row['auth_option']] = $local++;
+ }
+
+ $this->acl_options['id'][$row['auth_option']] = (int) $row['auth_option_id'];
+ $this->acl_options['option'][(int) $row['auth_option_id']] = $row['auth_option'];
+ }
+ $db->sql_freeresult($result);
+
+ $cache->put('_acl_options', $this->acl_options);
+ }
+
+ if (!trim($userdata['user_permissions']))
+ {
+ $this->acl_cache($userdata);
+ }
+
+ // Fill ACL array
+ $this->_fill_acl($userdata['user_permissions']);
+
+ // Verify bitstring length with options provided...
+ $renew = false;
+ $global_length = sizeof($this->acl_options['global']);
+ $local_length = sizeof($this->acl_options['local']);
+
+ // Specify comparing length (bitstring is padded to 31 bits)
+ $global_length = ($global_length % 31) ? ($global_length - ($global_length % 31) + 31) : $global_length;
+ $local_length = ($local_length % 31) ? ($local_length - ($local_length % 31) + 31) : $local_length;
+
+ // You thought we are finished now? Noooo... now compare them.
+ foreach ($this->acl as $forum_id => $bitstring)
+ {
+ if (($forum_id && strlen($bitstring) != $local_length) || (!$forum_id && strlen($bitstring) != $global_length))
+ {
+ $renew = true;
+ break;
+ }
+ }
+
+ // If a bitstring within the list does not match the options, we have a user with incorrect permissions set and need to renew them
+ if ($renew)
+ {
+ $this->acl_cache($userdata);
+ $this->_fill_acl($userdata['user_permissions']);
+ }
+
+ return;
+ }
+
+ /**
+ * Retrieves data wanted by acl function from the database for the
+ * specified user.
+ *
+ * @param int $user_id User ID
+ * @return array User attributes
+ */
+ public function obtain_user_data($user_id)
+ {
+ global $db;
+
+ $sql = 'SELECT user_id, username, user_permissions, user_type
+ FROM ' . USERS_TABLE . '
+ WHERE user_id = ' . $user_id;
+ $result = $db->sql_query($sql);
+ $user_data = $db->sql_fetchrow($result);
+ $db->sql_freeresult($result);
+ return $user_data;
+ }
+
+ /**
+ * Fill ACL array with relevant bitstrings from user_permissions column
+ * @access private
+ */
+ function _fill_acl($user_permissions)
+ {
+ $seq_cache = array();
+ $this->acl = array();
+ $user_permissions = explode("\n", $user_permissions);
+
+ foreach ($user_permissions as $f => $seq)
+ {
+ if ($seq)
+ {
+ $i = 0;
+
+ if (!isset($this->acl[$f]))
+ {
+ $this->acl[$f] = '';
+ }
+
+ while ($subseq = substr($seq, $i, 6))
+ {
+ if (isset($seq_cache[$subseq]))
+ {
+ $converted = $seq_cache[$subseq];
+ }
+ else
+ {
+ $converted = $seq_cache[$subseq] = str_pad(base_convert($subseq, 36, 2), 31, 0, STR_PAD_LEFT);
+ }
+
+ // We put the original bitstring into the acl array
+ $this->acl[$f] .= $converted;
+ $i += 6;
+ }
+ }
+ }
+ }
+
+ /**
+ * Look up an option
+ * if the option is prefixed with !, then the result becomes negated
+ *
+ * If a forum id is specified the local option will be combined with a global option if one exist.
+ * If a forum id is not specified, only the global option will be checked.
+ */
+ function acl_get($opt, $f = 0)
+ {
+ $negate = false;
+
+ if (strpos($opt, '!') === 0)
+ {
+ $negate = true;
+ $opt = substr($opt, 1);
+ }
+
+ if (!isset($this->cache[$f][$opt]))
+ {
+ // We combine the global/local option with an OR because some options are global and local.
+ // If the user has the global permission the local one is true too and vice versa
+ $this->cache[$f][$opt] = false;
+
+ // Is this option a global permission setting?
+ if (isset($this->acl_options['global'][$opt]))
+ {
+ if (isset($this->acl[0]))
+ {
+ $this->cache[$f][$opt] = $this->acl[0][$this->acl_options['global'][$opt]];
+ }
+ }
+
+ // Is this option a local permission setting?
+ // But if we check for a global option only, we won't combine the options...
+ if ($f != 0 && isset($this->acl_options['local'][$opt]))
+ {
+ if (isset($this->acl[$f]) && isset($this->acl[$f][$this->acl_options['local'][$opt]]))
+ {
+ $this->cache[$f][$opt] |= $this->acl[$f][$this->acl_options['local'][$opt]];
+ }
+ }
+ }
+
+ // Founder always has all global options set to true...
+ return ($negate) ? !$this->cache[$f][$opt] : $this->cache[$f][$opt];
+ }
+
+ /**
+ * Get forums with the specified permission setting
+ *
+ * @param string $opt The permission name to lookup. If prefixed with !, the result is negated.
+ * @param bool $clean set to true if only values needs to be returned which are set/unset
+ *
+ * @return array Contains the forum ids with the specified permission set to true.
+ This is a nested array: array => forum_id => permission => true
+ */
+ function acl_getf($opt, $clean = false)
+ {
+ $acl_f = array();
+ $negate = false;
+
+ if (strpos($opt, '!') === 0)
+ {
+ $negate = true;
+ $opt = substr($opt, 1);
+ }
+
+ // If we retrieve a list of forums not having permissions in, we need to get every forum_id
+ if ($negate)
+ {
+ if ($this->acl_forum_ids === false)
+ {
+ global $db;
+
+ $sql = 'SELECT forum_id
+ FROM ' . FORUMS_TABLE;
+
+ if (sizeof($this->acl))
+ {
+ $sql .= ' WHERE ' . $db->sql_in_set('forum_id', array_keys($this->acl), true);
+ }
+ $result = $db->sql_query($sql);
+
+ $this->acl_forum_ids = array();
+ while ($row = $db->sql_fetchrow($result))
+ {
+ $this->acl_forum_ids[] = $row['forum_id'];
+ }
+ $db->sql_freeresult($result);
+ }
+ }
+
+ if (isset($this->acl_options['local'][$opt]))
+ {
+ foreach ($this->acl as $f => $bitstring)
+ {
+ // Skip global settings
+ if (!$f)
+ {
+ continue;
+ }
+
+ $allowed = (!isset($this->cache[$f][$opt])) ? $this->acl_get($opt, $f) : $this->cache[$f][$opt];
+
+ if (!$clean)
+ {
+ $acl_f[$f][$opt] = ($negate) ? !$allowed : $allowed;
+ }
+ else
+ {
+ if (($negate && !$allowed) || (!$negate && $allowed))
+ {
+ $acl_f[$f][$opt] = 1;
+ }
+ }
+ }
+ }
+
+ // If we get forum_ids not having this permission, we need to fill the remaining parts
+ if ($negate && sizeof($this->acl_forum_ids))
+ {
+ foreach ($this->acl_forum_ids as $f)
+ {
+ $acl_f[$f][$opt] = 1;
+ }
+ }
+
+ return $acl_f;
+ }
+
+ /**
+ * Get local permission state for any forum.
+ *
+ * Returns true if user has the permission in one or more forums, false if in no forum.
+ * If global option is checked it returns the global state (same as acl_get($opt))
+ * Local option has precedence...
+ */
+ function acl_getf_global($opt)
+ {
+ if (is_array($opt))
+ {
+ // evaluates to true as soon as acl_getf_global is true for one option
+ foreach ($opt as $check_option)
+ {
+ if ($this->acl_getf_global($check_option))
+ {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ if (isset($this->acl_options['local'][$opt]))
+ {
+ foreach ($this->acl as $f => $bitstring)
+ {
+ // Skip global settings
+ if (!$f)
+ {
+ continue;
+ }
+
+ // as soon as the user has any permission we're done so return true
+ if ((!isset($this->cache[$f][$opt])) ? $this->acl_get($opt, $f) : $this->cache[$f][$opt])
+ {
+ return true;
+ }
+ }
+ }
+ else if (isset($this->acl_options['global'][$opt]))
+ {
+ return $this->acl_get($opt);
+ }
+
+ return false;
+ }
+
+ /**
+ * Get permission settings (more than one)
+ */
+ function acl_gets()
+ {
+ $args = func_get_args();
+ $f = array_pop($args);
+
+ if (!is_numeric($f))
+ {
+ $args[] = $f;
+ $f = 0;
+ }
+
+ // alternate syntax: acl_gets(array('m_', 'a_'), $forum_id)
+ if (is_array($args[0]))
+ {
+ $args = $args[0];
+ }
+
+ $acl = 0;
+ foreach ($args as $opt)
+ {
+ $acl |= $this->acl_get($opt, $f);
+ }
+
+ return $acl;
+ }
+
+ /**
+ * Get permission listing based on user_id/options/forum_ids
+ *
+ * Be careful when using this function with permissions a_, m_, u_ and f_ !
+ * It may not work correctly. When a user group grants an a_* permission,
+ * e.g. a_foo, but the user's a_foo permission is set to "Never", then
+ * the user does not in fact have the a_ permission.
+ * But the user will still be listed as having the a_ permission.
+ *
+ * For more information see: http://tracker.phpbb.com/browse/PHPBB3-10252
+ */
+ function acl_get_list($user_id = false, $opts = false, $forum_id = false)
+ {
+ if ($user_id !== false && !is_array($user_id) && $opts === false && $forum_id === false)
+ {
+ $hold_ary = array($user_id => $this->acl_raw_data_single_user($user_id));
+ }
+ else
+ {
+ $hold_ary = $this->acl_raw_data($user_id, $opts, $forum_id);
+ }
+
+ $auth_ary = array();
+ foreach ($hold_ary as $user_id => $forum_ary)
+ {
+ foreach ($forum_ary as $forum_id => $auth_option_ary)
+ {
+ foreach ($auth_option_ary as $auth_option => $auth_setting)
+ {
+ if ($auth_setting)
+ {
+ $auth_ary[$forum_id][$auth_option][] = $user_id;
+ }
+ }
+ }
+ }
+
+ return $auth_ary;
+ }
+
+ /**
+ * Cache data to user_permissions row
+ */
+ function acl_cache(&$userdata)
+ {
+ global $db;
+
+ // Empty user_permissions
+ $userdata['user_permissions'] = '';
+
+ $hold_ary = $this->acl_raw_data_single_user($userdata['user_id']);
+
+ // Key 0 in $hold_ary are global options, all others are forum_ids
+
+ // If this user is founder we're going to force fill the admin options ...
+ if ($userdata['user_type'] == USER_FOUNDER)
+ {
+ foreach ($this->acl_options['global'] as $opt => $id)
+ {
+ if (strpos($opt, 'a_') === 0)
+ {
+ $hold_ary[0][$this->acl_options['id'][$opt]] = ACL_YES;
+ }
+ }
+ }
+
+ $hold_str = $this->build_bitstring($hold_ary);
+
+ if ($hold_str)
+ {
+ $userdata['user_permissions'] = $hold_str;
+
+ $sql = 'UPDATE ' . USERS_TABLE . "
+ SET user_permissions = '" . $db->sql_escape($userdata['user_permissions']) . "',
+ user_perm_from = 0
+ WHERE user_id = " . $userdata['user_id'];
+ $db->sql_query($sql);
+ }
+
+ return;
+ }
+
+ /**
+ * Build bitstring from permission set
+ */
+ function build_bitstring(&$hold_ary)
+ {
+ $hold_str = '';
+
+ if (sizeof($hold_ary))
+ {
+ ksort($hold_ary);
+
+ $last_f = 0;
+
+ foreach ($hold_ary as $f => $auth_ary)
+ {
+ $ary_key = (!$f) ? 'global' : 'local';
+
+ $bitstring = array();
+ foreach ($this->acl_options[$ary_key] as $opt => $id)
+ {
+ if (isset($auth_ary[$this->acl_options['id'][$opt]]))
+ {
+ $bitstring[$id] = $auth_ary[$this->acl_options['id'][$opt]];
+
+ $option_key = substr($opt, 0, strpos($opt, '_') + 1);
+
+ // If one option is allowed, the global permission for this option has to be allowed too
+ // example: if the user has the a_ permission this means he has one or more a_* permissions
+ if ($auth_ary[$this->acl_options['id'][$opt]] == ACL_YES && (!isset($bitstring[$this->acl_options[$ary_key][$option_key]]) || $bitstring[$this->acl_options[$ary_key][$option_key]] == ACL_NEVER))
+ {
+ $bitstring[$this->acl_options[$ary_key][$option_key]] = ACL_YES;
+ }
+ }
+ else
+ {
+ $bitstring[$id] = ACL_NEVER;
+ }
+ }
+
+ // Now this bitstring defines the permission setting for the current forum $f (or global setting)
+ $bitstring = implode('', $bitstring);
+
+ // The line number indicates the id, therefore we have to add empty lines for those ids not present
+ $hold_str .= str_repeat("\n", $f - $last_f);
+
+ // Convert bitstring for storage - we do not use binary/bytes because PHP's string functions are not fully binary safe
+ for ($i = 0, $bit_length = strlen($bitstring); $i < $bit_length; $i += 31)
+ {
+ $hold_str .= str_pad(base_convert(str_pad(substr($bitstring, $i, 31), 31, 0, STR_PAD_RIGHT), 2, 36), 6, 0, STR_PAD_LEFT);
+ }
+
+ $last_f = $f;
+ }
+ unset($bitstring);
+
+ $hold_str = rtrim($hold_str);
+ }
+
+ return $hold_str;
+ }
+
+ /**
+ * Clear one or all users cached permission settings
+ */
+ function acl_clear_prefetch($user_id = false)
+ {
+ global $db, $cache, $phpbb_dispatcher;
+
+ // Rebuild options cache
+ $cache->destroy('_role_cache');
+
+ $sql = 'SELECT *
+ FROM ' . ACL_ROLES_DATA_TABLE . '
+ ORDER BY role_id ASC';
+ $result = $db->sql_query($sql);
+
+ $this->role_cache = array();
+ while ($row = $db->sql_fetchrow($result))
+ {
+ $this->role_cache[$row['role_id']][$row['auth_option_id']] = (int) $row['auth_setting'];
+ }
+ $db->sql_freeresult($result);
+
+ foreach ($this->role_cache as $role_id => $role_options)
+ {
+ $this->role_cache[$role_id] = serialize($role_options);
+ }
+
+ $cache->put('_role_cache', $this->role_cache);
+
+ // Now empty user permissions
+ $where_sql = '';
+
+ if ($user_id !== false)
+ {
+ $user_id = (!is_array($user_id)) ? $user_id = array((int) $user_id) : array_map('intval', $user_id);
+ $where_sql = ' WHERE ' . $db->sql_in_set('user_id', $user_id);
+ }
+
+ $sql = 'UPDATE ' . USERS_TABLE . "
+ SET user_permissions = '',
+ user_perm_from = 0
+ $where_sql";
+ $db->sql_query($sql);
+
+ /**
+ * Event is triggered after user(s) permission settings cache has been cleared
+ *
+ * @event core.acl_clear_prefetch_after
+ * @var mixed user_id User ID(s)
+ * @since 3.1.11-RC1
+ */
+ $vars = array('user_id');
+ extract($phpbb_dispatcher->trigger_event('core.acl_clear_prefetch_after', compact($vars)));
+
+ return;
+ }
+
+ /**
+ * Get assigned roles
+ */
+ function acl_role_data($user_type, $role_type, $ug_id = false, $forum_id = false)
+ {
+ global $db;
+
+ $roles = array();
+
+ $sql_id = ($user_type == 'user') ? 'user_id' : 'group_id';
+
+ $sql_ug = ($ug_id !== false) ? ((!is_array($ug_id)) ? "AND a.$sql_id = $ug_id" : 'AND ' . $db->sql_in_set("a.$sql_id", $ug_id)) : '';
+ $sql_forum = ($forum_id !== false) ? ((!is_array($forum_id)) ? "AND a.forum_id = $forum_id" : 'AND ' . $db->sql_in_set('a.forum_id', $forum_id)) : '';
+
+ // Grab assigned roles...
+ $sql = 'SELECT a.auth_role_id, a.' . $sql_id . ', a.forum_id
+ FROM ' . (($user_type == 'user') ? ACL_USERS_TABLE : ACL_GROUPS_TABLE) . ' a, ' . ACL_ROLES_TABLE . " r
+ WHERE a.auth_role_id = r.role_id
+ AND r.role_type = '" . $db->sql_escape($role_type) . "'
+ $sql_ug
+ $sql_forum
+ ORDER BY r.role_order ASC";
+ $result = $db->sql_query($sql);
+
+ while ($row = $db->sql_fetchrow($result))
+ {
+ $roles[$row[$sql_id]][$row['forum_id']] = $row['auth_role_id'];
+ }
+ $db->sql_freeresult($result);
+
+ return $roles;
+ }
+
+ /**
+ * Get raw acl data based on user/option/forum
+ */
+ function acl_raw_data($user_id = false, $opts = false, $forum_id = false)
+ {
+ global $db;
+
+ $sql_user = ($user_id !== false) ? ((!is_array($user_id)) ? 'user_id = ' . (int) $user_id : $db->sql_in_set('user_id', array_map('intval', $user_id))) : '';
+ $sql_forum = ($forum_id !== false) ? ((!is_array($forum_id)) ? 'AND a.forum_id = ' . (int) $forum_id : 'AND ' . $db->sql_in_set('a.forum_id', array_map('intval', $forum_id))) : '';
+
+ $sql_opts = $sql_opts_select = $sql_opts_from = '';
+ $hold_ary = array();
+
+ if ($opts !== false)
+ {
+ $sql_opts_select = ', ao.auth_option';
+ $sql_opts_from = ', ' . ACL_OPTIONS_TABLE . ' ao';
+ $this->build_auth_option_statement('ao.auth_option', $opts, $sql_opts);
+ }
+
+ $sql_ary = array();
+
+ // Grab non-role settings - user-specific
+ $sql_ary[] = 'SELECT a.user_id, a.forum_id, a.auth_setting, a.auth_option_id' . $sql_opts_select . '
+ FROM ' . ACL_USERS_TABLE . ' a' . $sql_opts_from . '
+ WHERE a.auth_role_id = 0 ' .
+ (($sql_opts_from) ? 'AND a.auth_option_id = ao.auth_option_id ' : '') .
+ (($sql_user) ? 'AND a.' . $sql_user : '') . "
+ $sql_forum
+ $sql_opts";
+
+ // Now the role settings - user-specific
+ $sql_ary[] = 'SELECT a.user_id, a.forum_id, r.auth_option_id, r.auth_setting, r.auth_option_id' . $sql_opts_select . '
+ FROM ' . ACL_USERS_TABLE . ' a, ' . ACL_ROLES_DATA_TABLE . ' r' . $sql_opts_from . '
+ WHERE a.auth_role_id = r.role_id ' .
+ (($sql_opts_from) ? 'AND r.auth_option_id = ao.auth_option_id ' : '') .
+ (($sql_user) ? 'AND a.' . $sql_user : '') . "
+ $sql_forum
+ $sql_opts";
+
+ foreach ($sql_ary as $sql)
+ {
+ $result = $db->sql_query($sql);
+
+ while ($row = $db->sql_fetchrow($result))
+ {
+ $option = ($sql_opts_select) ? $row['auth_option'] : $this->acl_options['option'][$row['auth_option_id']];
+ $hold_ary[$row['user_id']][$row['forum_id']][$option] = $row['auth_setting'];
+ }
+ $db->sql_freeresult($result);
+ }
+
+ $sql_ary = array();
+
+ // Now grab group settings - non-role specific...
+ $sql_ary[] = 'SELECT ug.user_id, a.forum_id, a.auth_setting, a.auth_option_id' . $sql_opts_select . '
+ FROM ' . ACL_GROUPS_TABLE . ' a, ' . USER_GROUP_TABLE . ' ug, ' . GROUPS_TABLE . ' g' . $sql_opts_from . '
+ WHERE a.auth_role_id = 0 ' .
+ (($sql_opts_from) ? 'AND a.auth_option_id = ao.auth_option_id ' : '') . '
+ AND a.group_id = ug.group_id
+ AND g.group_id = ug.group_id
+ AND ug.user_pending = 0
+ AND NOT (ug.group_leader = 1 AND g.group_skip_auth = 1)
+ ' . (($sql_user) ? 'AND ug.' . $sql_user : '') . "
+ $sql_forum
+ $sql_opts";
+
+ // Now grab group settings - role specific...
+ $sql_ary[] = 'SELECT ug.user_id, a.forum_id, r.auth_setting, r.auth_option_id' . $sql_opts_select . '
+ FROM ' . ACL_GROUPS_TABLE . ' a, ' . USER_GROUP_TABLE . ' ug, ' . GROUPS_TABLE . ' g, ' . ACL_ROLES_DATA_TABLE . ' r' . $sql_opts_from . '
+ WHERE a.auth_role_id = r.role_id ' .
+ (($sql_opts_from) ? 'AND r.auth_option_id = ao.auth_option_id ' : '') . '
+ AND a.group_id = ug.group_id
+ AND g.group_id = ug.group_id
+ AND ug.user_pending = 0
+ AND NOT (ug.group_leader = 1 AND g.group_skip_auth = 1)
+ ' . (($sql_user) ? 'AND ug.' . $sql_user : '') . "
+ $sql_forum
+ $sql_opts";
+
+ foreach ($sql_ary as $sql)
+ {
+ $result = $db->sql_query($sql);
+
+ while ($row = $db->sql_fetchrow($result))
+ {
+ $option = ($sql_opts_select) ? $row['auth_option'] : $this->acl_options['option'][$row['auth_option_id']];
+
+ if (!isset($hold_ary[$row['user_id']][$row['forum_id']][$option]) || (isset($hold_ary[$row['user_id']][$row['forum_id']][$option]) && $hold_ary[$row['user_id']][$row['forum_id']][$option] != ACL_NEVER))
+ {
+ $hold_ary[$row['user_id']][$row['forum_id']][$option] = $row['auth_setting'];
+
+ // If we detect ACL_NEVER, we will unset the flag option (within building the bitstring it is correctly set again)
+ if ($row['auth_setting'] == ACL_NEVER)
+ {
+ $flag = substr($option, 0, strpos($option, '_') + 1);
+
+ if (isset($hold_ary[$row['user_id']][$row['forum_id']][$flag]) && $hold_ary[$row['user_id']][$row['forum_id']][$flag] == ACL_YES)
+ {
+ unset($hold_ary[$row['user_id']][$row['forum_id']][$flag]);
+
+/* if (in_array(ACL_YES, $hold_ary[$row['user_id']][$row['forum_id']]))
+ {
+ $hold_ary[$row['user_id']][$row['forum_id']][$flag] = ACL_YES;
+ }
+*/
+ }
+ }
+ }
+ }
+ $db->sql_freeresult($result);
+ }
+
+ return $hold_ary;
+ }
+
+ /**
+ * Get raw user based permission settings
+ */
+ function acl_user_raw_data($user_id = false, $opts = false, $forum_id = false)
+ {
+ global $db;
+
+ $sql_user = ($user_id !== false) ? ((!is_array($user_id)) ? 'user_id = ' . (int) $user_id : $db->sql_in_set('user_id', array_map('intval', $user_id))) : '';
+ $sql_forum = ($forum_id !== false) ? ((!is_array($forum_id)) ? 'AND a.forum_id = ' . (int) $forum_id : 'AND ' . $db->sql_in_set('a.forum_id', array_map('intval', $forum_id))) : '';
+
+ $sql_opts = '';
+ $hold_ary = $sql_ary = array();
+
+ if ($opts !== false)
+ {
+ $this->build_auth_option_statement('ao.auth_option', $opts, $sql_opts);
+ }
+
+ // Grab user settings - non-role specific...
+ $sql_ary[] = 'SELECT a.user_id, a.forum_id, a.auth_setting, a.auth_option_id, ao.auth_option
+ FROM ' . ACL_USERS_TABLE . ' a, ' . ACL_OPTIONS_TABLE . ' ao
+ WHERE a.auth_role_id = 0
+ AND a.auth_option_id = ao.auth_option_id ' .
+ (($sql_user) ? 'AND a.' . $sql_user : '') . "
+ $sql_forum
+ $sql_opts
+ ORDER BY a.forum_id, ao.auth_option";
+
+ // Now the role settings - user-specific
+ $sql_ary[] = 'SELECT a.user_id, a.forum_id, r.auth_option_id, r.auth_setting, r.auth_option_id, ao.auth_option
+ FROM ' . ACL_USERS_TABLE . ' a, ' . ACL_ROLES_DATA_TABLE . ' r, ' . ACL_OPTIONS_TABLE . ' ao
+ WHERE a.auth_role_id = r.role_id
+ AND r.auth_option_id = ao.auth_option_id ' .
+ (($sql_user) ? 'AND a.' . $sql_user : '') . "
+ $sql_forum
+ $sql_opts
+ ORDER BY a.forum_id, ao.auth_option";
+
+ foreach ($sql_ary as $sql)
+ {
+ $result = $db->sql_query($sql);
+
+ while ($row = $db->sql_fetchrow($result))
+ {
+ $hold_ary[$row['user_id']][$row['forum_id']][$row['auth_option']] = $row['auth_setting'];
+ }
+ $db->sql_freeresult($result);
+ }
+
+ return $hold_ary;
+ }
+
+ /**
+ * Get raw group based permission settings
+ */
+ function acl_group_raw_data($group_id = false, $opts = false, $forum_id = false)
+ {
+ global $db;
+
+ $sql_group = ($group_id !== false) ? ((!is_array($group_id)) ? 'group_id = ' . (int) $group_id : $db->sql_in_set('group_id', array_map('intval', $group_id))) : '';
+ $sql_forum = ($forum_id !== false) ? ((!is_array($forum_id)) ? 'AND a.forum_id = ' . (int) $forum_id : 'AND ' . $db->sql_in_set('a.forum_id', array_map('intval', $forum_id))) : '';
+
+ $sql_opts = '';
+ $hold_ary = $sql_ary = array();
+
+ if ($opts !== false)
+ {
+ $this->build_auth_option_statement('ao.auth_option', $opts, $sql_opts);
+ }
+
+ // Grab group settings - non-role specific...
+ $sql_ary[] = 'SELECT a.group_id, a.forum_id, a.auth_setting, a.auth_option_id, ao.auth_option
+ FROM ' . ACL_GROUPS_TABLE . ' a, ' . ACL_OPTIONS_TABLE . ' ao
+ WHERE a.auth_role_id = 0
+ AND a.auth_option_id = ao.auth_option_id ' .
+ (($sql_group) ? 'AND a.' . $sql_group : '') . "
+ $sql_forum
+ $sql_opts
+ ORDER BY a.forum_id, ao.auth_option";
+
+ // Now grab group settings - role specific...
+ $sql_ary[] = 'SELECT a.group_id, a.forum_id, r.auth_setting, r.auth_option_id, ao.auth_option
+ FROM ' . ACL_GROUPS_TABLE . ' a, ' . ACL_ROLES_DATA_TABLE . ' r, ' . ACL_OPTIONS_TABLE . ' ao
+ WHERE a.auth_role_id = r.role_id
+ AND r.auth_option_id = ao.auth_option_id ' .
+ (($sql_group) ? 'AND a.' . $sql_group : '') . "
+ $sql_forum
+ $sql_opts
+ ORDER BY a.forum_id, ao.auth_option";
+
+ foreach ($sql_ary as $sql)
+ {
+ $result = $db->sql_query($sql);
+
+ while ($row = $db->sql_fetchrow($result))
+ {
+ $hold_ary[$row['group_id']][$row['forum_id']][$row['auth_option']] = $row['auth_setting'];
+ }
+ $db->sql_freeresult($result);
+ }
+
+ return $hold_ary;
+ }
+
+ /**
+ * Get raw acl data based on user for caching user_permissions
+ * This function returns the same data as acl_raw_data(), but without the user id as the first key within the array.
+ */
+ function acl_raw_data_single_user($user_id)
+ {
+ global $db, $cache;
+
+ // Check if the role-cache is there
+ if (($this->role_cache = $cache->get('_role_cache')) === false)
+ {
+ $this->role_cache = array();
+
+ // We pre-fetch roles
+ $sql = 'SELECT *
+ FROM ' . ACL_ROLES_DATA_TABLE . '
+ ORDER BY role_id ASC';
+ $result = $db->sql_query($sql);
+
+ while ($row = $db->sql_fetchrow($result))
+ {
+ $this->role_cache[$row['role_id']][$row['auth_option_id']] = (int) $row['auth_setting'];
+ }
+ $db->sql_freeresult($result);
+
+ foreach ($this->role_cache as $role_id => $role_options)
+ {
+ $this->role_cache[$role_id] = serialize($role_options);
+ }
+
+ $cache->put('_role_cache', $this->role_cache);
+ }
+
+ $hold_ary = array();
+
+ // Grab user-specific permission settings
+ $sql = 'SELECT forum_id, auth_option_id, auth_role_id, auth_setting
+ FROM ' . ACL_USERS_TABLE . '
+ WHERE user_id = ' . $user_id;
+ $result = $db->sql_query($sql);
+
+ while ($row = $db->sql_fetchrow($result))
+ {
+ // If a role is assigned, assign all options included within this role. Else, only set this one option.
+ if ($row['auth_role_id'])
+ {
+ $hold_ary[$row['forum_id']] = (empty($hold_ary[$row['forum_id']])) ? unserialize($this->role_cache[$row['auth_role_id']]) : $hold_ary[$row['forum_id']] + unserialize($this->role_cache[$row['auth_role_id']]);
+ }
+ else
+ {
+ $hold_ary[$row['forum_id']][$row['auth_option_id']] = $row['auth_setting'];
+ }
+ }
+ $db->sql_freeresult($result);
+
+ // Now grab group-specific permission settings
+ $sql = 'SELECT a.forum_id, a.auth_option_id, a.auth_role_id, a.auth_setting
+ FROM ' . ACL_GROUPS_TABLE . ' a, ' . USER_GROUP_TABLE . ' ug, ' . GROUPS_TABLE . ' g
+ WHERE a.group_id = ug.group_id
+ AND g.group_id = ug.group_id
+ AND ug.user_pending = 0
+ AND NOT (ug.group_leader = 1 AND g.group_skip_auth = 1)
+ AND ug.user_id = ' . $user_id;
+ $result = $db->sql_query($sql);
+
+ while ($row = $db->sql_fetchrow($result))
+ {
+ if (!$row['auth_role_id'])
+ {
+ $this->_set_group_hold_ary($hold_ary[$row['forum_id']], $row['auth_option_id'], $row['auth_setting']);
+ }
+ else if (!empty($this->role_cache[$row['auth_role_id']]))
+ {
+ foreach (unserialize($this->role_cache[$row['auth_role_id']]) as $option_id => $setting)
+ {
+ $this->_set_group_hold_ary($hold_ary[$row['forum_id']], $option_id, $setting);
+ }
+ }
+ }
+ $db->sql_freeresult($result);
+
+ return $hold_ary;
+ }
+
+ /**
+ * Private function snippet for setting a specific piece of the hold_ary
+ */
+ function _set_group_hold_ary(&$hold_ary, $option_id, $setting)
+ {
+ if (!isset($hold_ary[$option_id]) || (isset($hold_ary[$option_id]) && $hold_ary[$option_id] != ACL_NEVER))
+ {
+ $hold_ary[$option_id] = $setting;
+
+ // If we detect ACL_NEVER, we will unset the flag option (within building the bitstring it is correctly set again)
+ if ($setting == ACL_NEVER)
+ {
+ $flag = substr($this->acl_options['option'][$option_id], 0, strpos($this->acl_options['option'][$option_id], '_') + 1);
+ $flag = (int) $this->acl_options['id'][$flag];
+
+ if (isset($hold_ary[$flag]) && $hold_ary[$flag] == ACL_YES)
+ {
+ unset($hold_ary[$flag]);
+
+/* This is uncommented, because i suspect this being slightly wrong due to mixed permission classes being possible
+ if (in_array(ACL_YES, $hold_ary))
+ {
+ $hold_ary[$flag] = ACL_YES;
+ }*/
+ }
+ }
+ }
+ }
+
+ /**
+ * Authentication plug-ins is largely down to Sergey Kanareykin, our thanks to him.
+ */
+ function login($username, $password, $autologin = false, $viewonline = 1, $admin = 0)
+ {
+ global $db, $user, $phpbb_root_path, $phpEx, $phpbb_container;
+ global $phpbb_dispatcher;
+
+ $provider_collection = $phpbb_container->get('auth.provider_collection');
+
+ $provider = $provider_collection->get_provider();
+ if ($provider)
+ {
+ $login = $provider->login($username, $password);
+
+ // If the auth module wants us to create an empty profile do so and then treat the status as LOGIN_SUCCESS
+ if ($login['status'] == LOGIN_SUCCESS_CREATE_PROFILE)
+ {
+ // we are going to use the user_add function so include functions_user.php if it wasn't defined yet
+ if (!function_exists('user_add'))
+ {
+ include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
+ }
+
+ user_add($login['user_row'], (isset($login['cp_data'])) ? $login['cp_data'] : false);
+
+ $sql = 'SELECT user_id, username, user_password, user_passchg, user_email, user_type
+ FROM ' . USERS_TABLE . "
+ WHERE username_clean = '" . $db->sql_escape(utf8_clean_string($username)) . "'";
+ $result = $db->sql_query($sql);
+ $row = $db->sql_fetchrow($result);
+ $db->sql_freeresult($result);
+
+ if (!$row)
+ {
+ return array(
+ 'status' => LOGIN_ERROR_EXTERNAL_AUTH,
+ 'error_msg' => 'AUTH_NO_PROFILE_CREATED',
+ 'user_row' => array('user_id' => ANONYMOUS),
+ );
+ }
+
+ $login = array(
+ 'status' => LOGIN_SUCCESS,
+ 'error_msg' => false,
+ 'user_row' => $row,
+ );
+ }
+
+ // If the auth provider wants us to link an empty account do so and redirect
+ if ($login['status'] == LOGIN_SUCCESS_LINK_PROFILE)
+ {
+ // If this status exists a fourth field is in the $login array called 'redirect_data'
+ // This data is passed along as GET data to the next page allow the account to be linked
+
+ $params = array('mode' => 'login_link');
+ $url = append_sid($phpbb_root_path . 'ucp.' . $phpEx, array_merge($params, $login['redirect_data']));
+
+ redirect($url);
+ }
+
+ /**
+ * Event is triggered after checking for valid username and password, and before the actual session creation.
+ *
+ * @event core.auth_login_session_create_before
+ * @var array login Variable containing login array
+ * @var bool admin Boolean variable whether user is logging into the ACP
+ * @var string username Username of user to log in
+ * @var bool autologin Boolean variable signaling whether login is triggered via auto login
+ * @since 3.1.7-RC1
+ */
+ $vars = array(
+ 'login',
+ 'admin',
+ 'username',
+ 'autologin',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.auth_login_session_create_before', compact($vars)));
+
+ // If login succeeded, we will log the user in... else we pass the login array through...
+ if ($login['status'] == LOGIN_SUCCESS)
+ {
+ $old_session_id = $user->session_id;
+
+ if ($admin)
+ {
+ global $SID, $_SID;
+
+ $cookie_expire = time() - 31536000;
+ $user->set_cookie('u', '', $cookie_expire);
+ $user->set_cookie('sid', '', $cookie_expire);
+ unset($cookie_expire);
+
+ $SID = '?sid=';
+ $user->session_id = $_SID = '';
+ }
+
+ $result = $user->session_create($login['user_row']['user_id'], $admin, $autologin, $viewonline);
+
+ // Successful session creation
+ if ($result === true)
+ {
+ // If admin re-authentication we remove the old session entry because a new one has been created...
+ if ($admin)
+ {
+ // the login array is used because the user ids do not differ for re-authentication
+ $sql = 'DELETE FROM ' . SESSIONS_TABLE . "
+ WHERE session_id = '" . $db->sql_escape($old_session_id) . "'
+ AND session_user_id = {$login['user_row']['user_id']}";
+ $db->sql_query($sql);
+ }
+
+ return array(
+ 'status' => LOGIN_SUCCESS,
+ 'error_msg' => false,
+ 'user_row' => $login['user_row'],
+ );
+ }
+
+ return array(
+ 'status' => LOGIN_BREAK,
+ 'error_msg' => $result,
+ 'user_row' => $login['user_row'],
+ );
+ }
+
+ return $login;
+ }
+
+ trigger_error('Authentication method not found', E_USER_ERROR);
+ }
+
+ /**
+ * Fill auth_option statement for later querying based on the supplied options
+ */
+ function build_auth_option_statement($key, $auth_options, &$sql_opts)
+ {
+ global $db;
+
+ if (!is_array($auth_options))
+ {
+ if (strpos($auth_options, '%') !== false)
+ {
+ $sql_opts = "AND $key " . $db->sql_like_expression(str_replace('%', $db->get_any_char(), $auth_options));
+ }
+ else
+ {
+ $sql_opts = "AND $key = '" . $db->sql_escape($auth_options) . "'";
+ }
+ }
+ else
+ {
+ $is_like_expression = false;
+
+ foreach ($auth_options as $option)
+ {
+ if (strpos($option, '%') !== false)
+ {
+ $is_like_expression = true;
+ }
+ }
+
+ if (!$is_like_expression)
+ {
+ $sql_opts = 'AND ' . $db->sql_in_set($key, $auth_options);
+ }
+ else
+ {
+ $sql = array();
+
+ foreach ($auth_options as $option)
+ {
+ if (strpos($option, '%') !== false)
+ {
+ $sql[] = $key . ' ' . $db->sql_like_expression(str_replace('%', $db->get_any_char(), $option));
+ }
+ else
+ {
+ $sql[] = $key . " = '" . $db->sql_escape($option) . "'";
+ }
+ }
+
+ $sql_opts = 'AND (' . implode(' OR ', $sql) . ')';
+ }
+ }
+ }
+}
diff --git a/phpBB/includes/db/index.htm b/phpBB/phpbb/auth/index.htm
index ee1f723a7d..ee1f723a7d 100644
--- a/phpBB/includes/db/index.htm
+++ b/phpBB/phpbb/auth/index.htm
diff --git a/phpBB/phpbb/auth/provider/apache.php b/phpBB/phpbb/auth/provider/apache.php
new file mode 100644
index 0000000000..aa5bf64335
--- /dev/null
+++ b/phpBB/phpbb/auth/provider/apache.php
@@ -0,0 +1,264 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\auth\provider;
+
+/**
+* Apache authentication provider for phpBB3
+*/
+class apache extends \phpbb\auth\provider\base
+{
+ /**
+ * phpBB passwords manager
+ *
+ * @var \phpbb\passwords\manager
+ */
+ protected $passwords_manager;
+
+ /**
+ * Apache Authentication Constructor
+ *
+ * @param \phpbb\db\driver\driver_interface $db Database object
+ * @param \phpbb\config\config $config Config object
+ * @param \phpbb\passwords\manager $passwords_manager Passwords Manager object
+ * @param \phpbb\request\request $request Request object
+ * @param \phpbb\user $user User object
+ * @param string $phpbb_root_path Relative path to phpBB root
+ * @param string $php_ext PHP file extension
+ */
+ public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\config\config $config, \phpbb\passwords\manager $passwords_manager, \phpbb\request\request $request, \phpbb\user $user, $phpbb_root_path, $php_ext)
+ {
+ $this->db = $db;
+ $this->config = $config;
+ $this->passwords_manager = $passwords_manager;
+ $this->request = $request;
+ $this->user = $user;
+ $this->phpbb_root_path = $phpbb_root_path;
+ $this->php_ext = $php_ext;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function init()
+ {
+ if (!$this->request->is_set('PHP_AUTH_USER', \phpbb\request\request_interface::SERVER) || $this->user->data['username'] !== htmlspecialchars_decode($this->request->server('PHP_AUTH_USER')))
+ {
+ return $this->user->lang['APACHE_SETUP_BEFORE_USE'];
+ }
+ return false;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function login($username, $password)
+ {
+ // do not allow empty password
+ if (!$password)
+ {
+ return array(
+ 'status' => LOGIN_ERROR_PASSWORD,
+ 'error_msg' => 'NO_PASSWORD_SUPPLIED',
+ 'user_row' => array('user_id' => ANONYMOUS),
+ );
+ }
+
+ if (!$username)
+ {
+ return array(
+ 'status' => LOGIN_ERROR_USERNAME,
+ 'error_msg' => 'LOGIN_ERROR_USERNAME',
+ 'user_row' => array('user_id' => ANONYMOUS),
+ );
+ }
+
+ if (!$this->request->is_set('PHP_AUTH_USER', \phpbb\request\request_interface::SERVER))
+ {
+ return array(
+ 'status' => LOGIN_ERROR_EXTERNAL_AUTH,
+ 'error_msg' => 'LOGIN_ERROR_EXTERNAL_AUTH_APACHE',
+ 'user_row' => array('user_id' => ANONYMOUS),
+ );
+ }
+
+ $php_auth_user = htmlspecialchars_decode($this->request->server('PHP_AUTH_USER'));
+ $php_auth_pw = htmlspecialchars_decode($this->request->server('PHP_AUTH_PW'));
+
+ if (!empty($php_auth_user) && !empty($php_auth_pw))
+ {
+ if ($php_auth_user !== $username)
+ {
+ return array(
+ 'status' => LOGIN_ERROR_USERNAME,
+ 'error_msg' => 'LOGIN_ERROR_USERNAME',
+ 'user_row' => array('user_id' => ANONYMOUS),
+ );
+ }
+
+ $sql = 'SELECT user_id, username, user_password, user_passchg, user_email, user_type
+ FROM ' . USERS_TABLE . "
+ WHERE username = '" . $this->db->sql_escape($php_auth_user) . "'";
+ $result = $this->db->sql_query($sql);
+ $row = $this->db->sql_fetchrow($result);
+ $this->db->sql_freeresult($result);
+
+ if ($row)
+ {
+ // User inactive...
+ if ($row['user_type'] == USER_INACTIVE || $row['user_type'] == USER_IGNORE)
+ {
+ return array(
+ 'status' => LOGIN_ERROR_ACTIVE,
+ 'error_msg' => 'ACTIVE_ERROR',
+ 'user_row' => $row,
+ );
+ }
+
+ // Successful login...
+ return array(
+ 'status' => LOGIN_SUCCESS,
+ 'error_msg' => false,
+ 'user_row' => $row,
+ );
+ }
+
+ // this is the user's first login so create an empty profile
+ return array(
+ 'status' => LOGIN_SUCCESS_CREATE_PROFILE,
+ 'error_msg' => false,
+ 'user_row' => $this->user_row($php_auth_user, $php_auth_pw),
+ );
+ }
+
+ // Not logged into apache
+ return array(
+ 'status' => LOGIN_ERROR_EXTERNAL_AUTH,
+ 'error_msg' => 'LOGIN_ERROR_EXTERNAL_AUTH_APACHE',
+ 'user_row' => array('user_id' => ANONYMOUS),
+ );
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function autologin()
+ {
+ if (!$this->request->is_set('PHP_AUTH_USER', \phpbb\request\request_interface::SERVER))
+ {
+ return array();
+ }
+
+ $php_auth_user = htmlspecialchars_decode($this->request->server('PHP_AUTH_USER'));
+ $php_auth_pw = htmlspecialchars_decode($this->request->server('PHP_AUTH_PW'));
+
+ if (!empty($php_auth_user) && !empty($php_auth_pw))
+ {
+ set_var($php_auth_user, $php_auth_user, 'string', true);
+ set_var($php_auth_pw, $php_auth_pw, 'string', true);
+
+ $sql = 'SELECT *
+ FROM ' . USERS_TABLE . "
+ WHERE username = '" . $this->db->sql_escape($php_auth_user) . "'";
+ $result = $this->db->sql_query($sql);
+ $row = $this->db->sql_fetchrow($result);
+ $this->db->sql_freeresult($result);
+
+ if ($row)
+ {
+ return ($row['user_type'] == USER_INACTIVE || $row['user_type'] == USER_IGNORE) ? array() : $row;
+ }
+
+ if (!function_exists('user_add'))
+ {
+ include($this->phpbb_root_path . 'includes/functions_user.' . $this->php_ext);
+ }
+
+ // create the user if he does not exist yet
+ user_add($this->user_row($php_auth_user, $php_auth_pw));
+
+ $sql = 'SELECT *
+ FROM ' . USERS_TABLE . "
+ WHERE username_clean = '" . $this->db->sql_escape(utf8_clean_string($php_auth_user)) . "'";
+ $result = $this->db->sql_query($sql);
+ $row = $this->db->sql_fetchrow($result);
+ $this->db->sql_freeresult($result);
+
+ if ($row)
+ {
+ return $row;
+ }
+ }
+
+ return array();
+ }
+
+ /**
+ * This function generates an array which can be passed to the user_add
+ * function in order to create a user
+ *
+ * @param string $username The username of the new user.
+ * @param string $password The password of the new user.
+ * @return array Contains data that can be passed directly to
+ * the user_add function.
+ */
+ private function user_row($username, $password)
+ {
+ // first retrieve default group id
+ $sql = 'SELECT group_id
+ FROM ' . GROUPS_TABLE . "
+ WHERE group_name = '" . $this->db->sql_escape('REGISTERED') . "'
+ AND group_type = " . GROUP_SPECIAL;
+ $result = $this->db->sql_query($sql);
+ $row = $this->db->sql_fetchrow($result);
+ $this->db->sql_freeresult($result);
+
+ if (!$row)
+ {
+ trigger_error('NO_GROUP');
+ }
+
+ // generate user account data
+ return array(
+ 'username' => $username,
+ 'user_password' => $this->passwords_manager->hash($password),
+ 'user_email' => '',
+ 'group_id' => (int) $row['group_id'],
+ 'user_type' => USER_NORMAL,
+ 'user_ip' => $this->user->ip,
+ 'user_new' => ($this->config['new_member_post_limit']) ? 1 : 0,
+ );
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function validate_session($user)
+ {
+ // Check if PHP_AUTH_USER is set and handle this case
+ if ($this->request->is_set('PHP_AUTH_USER', \phpbb\request\request_interface::SERVER))
+ {
+ $php_auth_user = $this->request->server('PHP_AUTH_USER');
+
+ return ($php_auth_user === $user['username']) ? true : false;
+ }
+
+ // PHP_AUTH_USER is not set. A valid session is now determined by the user type (anonymous/bot or not)
+ if ($user['user_type'] == USER_IGNORE)
+ {
+ return true;
+ }
+
+ return false;
+ }
+}
diff --git a/phpBB/phpbb/auth/provider/base.php b/phpBB/phpbb/auth/provider/base.php
new file mode 100644
index 0000000000..dea27ccc25
--- /dev/null
+++ b/phpBB/phpbb/auth/provider/base.php
@@ -0,0 +1,108 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\auth\provider;
+
+/**
+* Base authentication provider class that all other providers should implement
+*/
+abstract class base implements \phpbb\auth\provider\provider_interface
+{
+ /**
+ * {@inheritdoc}
+ */
+ public function init()
+ {
+ return;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function autologin()
+ {
+ return;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function acp()
+ {
+ return;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_acp_template($new_config)
+ {
+ return;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_login_data()
+ {
+ return;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_auth_link_data($user_id = 0)
+ {
+ return;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function logout($data, $new_session)
+ {
+ return;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function validate_session($user)
+ {
+ return;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function login_link_has_necessary_data($login_link_data)
+ {
+ return;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function link_account(array $link_data)
+ {
+ return;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function unlink_account(array $link_data)
+ {
+ return;
+ }
+}
diff --git a/phpBB/phpbb/auth/provider/db.php b/phpBB/phpbb/auth/provider/db.php
new file mode 100644
index 0000000000..d8c5fb72de
--- /dev/null
+++ b/phpBB/phpbb/auth/provider/db.php
@@ -0,0 +1,239 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\auth\provider;
+
+/**
+ * Database authentication provider for phpBB3
+ * This is for authentication via the integrated user table
+ */
+class db extends \phpbb\auth\provider\base
+{
+ /**
+ * phpBB passwords manager
+ *
+ * @var \phpbb\passwords\manager
+ */
+ protected $passwords_manager;
+
+ /**
+ * DI container
+ *
+ * @var \Symfony\Component\DependencyInjection\ContainerInterface
+ */
+ protected $phpbb_container;
+
+ /**
+ * Database Authentication Constructor
+ *
+ * @param \phpbb\db\driver\driver_interface $db
+ * @param \phpbb\config\config $config
+ * @param \phpbb\passwords\manager $passwords_manager
+ * @param \phpbb\request\request $request
+ * @param \phpbb\user $user
+ * @param \Symfony\Component\DependencyInjection\ContainerInterface $phpbb_container DI container
+ * @param string $phpbb_root_path
+ * @param string $php_ext
+ */
+ public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\config\config $config, \phpbb\passwords\manager $passwords_manager, \phpbb\request\request $request, \phpbb\user $user, \Symfony\Component\DependencyInjection\ContainerInterface $phpbb_container, $phpbb_root_path, $php_ext)
+ {
+ $this->db = $db;
+ $this->config = $config;
+ $this->passwords_manager = $passwords_manager;
+ $this->request = $request;
+ $this->user = $user;
+ $this->phpbb_root_path = $phpbb_root_path;
+ $this->php_ext = $php_ext;
+ $this->phpbb_container = $phpbb_container;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function login($username, $password)
+ {
+ // Auth plugins get the password untrimmed.
+ // For compatibility we trim() here.
+ $password = trim($password);
+
+ // do not allow empty password
+ if (!$password)
+ {
+ return array(
+ 'status' => LOGIN_ERROR_PASSWORD,
+ 'error_msg' => 'NO_PASSWORD_SUPPLIED',
+ 'user_row' => array('user_id' => ANONYMOUS),
+ );
+ }
+
+ if (!$username)
+ {
+ return array(
+ 'status' => LOGIN_ERROR_USERNAME,
+ 'error_msg' => 'LOGIN_ERROR_USERNAME',
+ 'user_row' => array('user_id' => ANONYMOUS),
+ );
+ }
+
+ $username_clean = utf8_clean_string($username);
+
+ $sql = 'SELECT *
+ FROM ' . USERS_TABLE . "
+ WHERE username_clean = '" . $this->db->sql_escape($username_clean) . "'";
+ $result = $this->db->sql_query($sql);
+ $row = $this->db->sql_fetchrow($result);
+ $this->db->sql_freeresult($result);
+
+ if (($this->user->ip && !$this->config['ip_login_limit_use_forwarded']) ||
+ ($this->user->forwarded_for && $this->config['ip_login_limit_use_forwarded']))
+ {
+ $sql = 'SELECT COUNT(*) AS attempts
+ FROM ' . LOGIN_ATTEMPT_TABLE . '
+ WHERE attempt_time > ' . (time() - (int) $this->config['ip_login_limit_time']);
+ if ($this->config['ip_login_limit_use_forwarded'])
+ {
+ $sql .= " AND attempt_forwarded_for = '" . $this->db->sql_escape($this->user->forwarded_for) . "'";
+ }
+ else
+ {
+ $sql .= " AND attempt_ip = '" . $this->db->sql_escape($this->user->ip) . "' ";
+ }
+
+ $result = $this->db->sql_query($sql);
+ $attempts = (int) $this->db->sql_fetchfield('attempts');
+ $this->db->sql_freeresult($result);
+
+ $attempt_data = array(
+ 'attempt_ip' => $this->user->ip,
+ 'attempt_browser' => trim(substr($this->user->browser, 0, 149)),
+ 'attempt_forwarded_for' => $this->user->forwarded_for,
+ 'attempt_time' => time(),
+ 'user_id' => ($row) ? (int) $row['user_id'] : 0,
+ 'username' => $username,
+ 'username_clean' => $username_clean,
+ );
+ $sql = 'INSERT INTO ' . LOGIN_ATTEMPT_TABLE . $this->db->sql_build_array('INSERT', $attempt_data);
+ $this->db->sql_query($sql);
+ }
+ else
+ {
+ $attempts = 0;
+ }
+
+ if (!$row)
+ {
+ if ($this->config['ip_login_limit_max'] && $attempts >= $this->config['ip_login_limit_max'])
+ {
+ return array(
+ 'status' => LOGIN_ERROR_ATTEMPTS,
+ 'error_msg' => 'LOGIN_ERROR_ATTEMPTS',
+ 'user_row' => array('user_id' => ANONYMOUS),
+ );
+ }
+
+ return array(
+ 'status' => LOGIN_ERROR_USERNAME,
+ 'error_msg' => 'LOGIN_ERROR_USERNAME',
+ 'user_row' => array('user_id' => ANONYMOUS),
+ );
+ }
+
+ $show_captcha = ($this->config['max_login_attempts'] && $row['user_login_attempts'] >= $this->config['max_login_attempts']) ||
+ ($this->config['ip_login_limit_max'] && $attempts >= $this->config['ip_login_limit_max']);
+
+ // If there are too many login attempts, we need to check for a confirm image
+ // Every auth module is able to define what to do by itself...
+ if ($show_captcha)
+ {
+ $captcha_factory = $this->phpbb_container->get('captcha.factory');
+ $captcha = $captcha_factory->get_instance($this->config['captcha_plugin']);
+ $captcha->init(CONFIRM_LOGIN);
+ $vc_response = $captcha->validate($row);
+ if ($vc_response)
+ {
+ return array(
+ 'status' => LOGIN_ERROR_ATTEMPTS,
+ 'error_msg' => 'LOGIN_ERROR_ATTEMPTS',
+ 'user_row' => $row,
+ );
+ }
+ else
+ {
+ $captcha->reset();
+ }
+
+ }
+
+ // Check password ...
+ if ($this->passwords_manager->check($password, $row['user_password'], $row))
+ {
+ // Check for old password hash...
+ if ($this->passwords_manager->convert_flag || strlen($row['user_password']) == 32)
+ {
+ $hash = $this->passwords_manager->hash($password);
+
+ // Update the password in the users table to the new format
+ $sql = 'UPDATE ' . USERS_TABLE . "
+ SET user_password = '" . $this->db->sql_escape($hash) . "'
+ WHERE user_id = {$row['user_id']}";
+ $this->db->sql_query($sql);
+
+ $row['user_password'] = $hash;
+ }
+
+ $sql = 'DELETE FROM ' . LOGIN_ATTEMPT_TABLE . '
+ WHERE user_id = ' . $row['user_id'];
+ $this->db->sql_query($sql);
+
+ if ($row['user_login_attempts'] != 0)
+ {
+ // Successful, reset login attempts (the user passed all stages)
+ $sql = 'UPDATE ' . USERS_TABLE . '
+ SET user_login_attempts = 0
+ WHERE user_id = ' . $row['user_id'];
+ $this->db->sql_query($sql);
+ }
+
+ // User inactive...
+ if ($row['user_type'] == USER_INACTIVE || $row['user_type'] == USER_IGNORE)
+ {
+ return array(
+ 'status' => LOGIN_ERROR_ACTIVE,
+ 'error_msg' => 'ACTIVE_ERROR',
+ 'user_row' => $row,
+ );
+ }
+
+ // Successful login... set user_login_attempts to zero...
+ return array(
+ 'status' => LOGIN_SUCCESS,
+ 'error_msg' => false,
+ 'user_row' => $row,
+ );
+ }
+
+ // Password incorrect - increase login attempts
+ $sql = 'UPDATE ' . USERS_TABLE . '
+ SET user_login_attempts = user_login_attempts + 1
+ WHERE user_id = ' . (int) $row['user_id'] . '
+ AND user_login_attempts < ' . LOGIN_ATTEMPTS_MAX;
+ $this->db->sql_query($sql);
+
+ // Give status about wrong password...
+ return array(
+ 'status' => ($show_captcha) ? LOGIN_ERROR_ATTEMPTS : LOGIN_ERROR_PASSWORD,
+ 'error_msg' => 'LOGIN_ERROR_PASSWORD',
+ 'user_row' => $row,
+ );
+ }
+}
diff --git a/phpBB/includes/search/index.htm b/phpBB/phpbb/auth/provider/index.htm
index ee1f723a7d..ee1f723a7d 100644
--- a/phpBB/includes/search/index.htm
+++ b/phpBB/phpbb/auth/provider/index.htm
diff --git a/phpBB/phpbb/auth/provider/ldap.php b/phpBB/phpbb/auth/provider/ldap.php
new file mode 100644
index 0000000000..c48b771ab0
--- /dev/null
+++ b/phpBB/phpbb/auth/provider/ldap.php
@@ -0,0 +1,348 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\auth\provider;
+
+/**
+ * Database authentication provider for phpBB3
+ * This is for authentication via the integrated user table
+ */
+class ldap extends \phpbb\auth\provider\base
+{
+ /**
+ * phpBB passwords manager
+ *
+ * @var \phpbb\passwords\manager
+ */
+ protected $passwords_manager;
+
+ /**
+ * LDAP Authentication Constructor
+ *
+ * @param \phpbb\db\driver\driver_interface $db Database object
+ * @param \phpbb\config\config $config Config object
+ * @param \phpbb\passwords\manager $passwords_manager Passwords manager object
+ * @param \phpbb\user $user User object
+ */
+ public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\config\config $config, \phpbb\passwords\manager $passwords_manager, \phpbb\user $user)
+ {
+ $this->db = $db;
+ $this->config = $config;
+ $this->passwords_manager = $passwords_manager;
+ $this->user = $user;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function init()
+ {
+ if (!@extension_loaded('ldap'))
+ {
+ return $this->user->lang['LDAP_NO_LDAP_EXTENSION'];
+ }
+
+ $this->config['ldap_port'] = (int) $this->config['ldap_port'];
+ if ($this->config['ldap_port'])
+ {
+ $ldap = @ldap_connect($this->config['ldap_server'], $this->config['ldap_port']);
+ }
+ else
+ {
+ $ldap = @ldap_connect($this->config['ldap_server']);
+ }
+
+ if (!$ldap)
+ {
+ return $this->user->lang['LDAP_NO_SERVER_CONNECTION'];
+ }
+
+ @ldap_set_option($ldap, LDAP_OPT_PROTOCOL_VERSION, 3);
+ @ldap_set_option($ldap, LDAP_OPT_REFERRALS, 0);
+
+ if ($this->config['ldap_user'] || $this->config['ldap_password'])
+ {
+ if (!@ldap_bind($ldap, htmlspecialchars_decode($this->config['ldap_user']), htmlspecialchars_decode($this->config['ldap_password'])))
+ {
+ return $this->user->lang['LDAP_INCORRECT_USER_PASSWORD'];
+ }
+ }
+
+ // ldap_connect only checks whether the specified server is valid, so the connection might still fail
+ $search = @ldap_search(
+ $ldap,
+ htmlspecialchars_decode($this->config['ldap_base_dn']),
+ $this->ldap_user_filter($this->user->data['username']),
+ (empty($this->config['ldap_email'])) ?
+ array(htmlspecialchars_decode($this->config['ldap_uid'])) :
+ array(htmlspecialchars_decode($this->config['ldap_uid']), htmlspecialchars_decode($this->config['ldap_email'])),
+ 0,
+ 1
+ );
+
+ if ($search === false)
+ {
+ return $this->user->lang['LDAP_SEARCH_FAILED'];
+ }
+
+ $result = @ldap_get_entries($ldap, $search);
+
+ @ldap_close($ldap);
+
+ if (!is_array($result) || sizeof($result) < 2)
+ {
+ return sprintf($this->user->lang['LDAP_NO_IDENTITY'], $this->user->data['username']);
+ }
+
+ if (!empty($this->config['ldap_email']) && !isset($result[0][htmlspecialchars_decode($this->config['ldap_email'])]))
+ {
+ return $this->user->lang['LDAP_NO_EMAIL'];
+ }
+
+ return false;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function login($username, $password)
+ {
+ // do not allow empty password
+ if (!$password)
+ {
+ return array(
+ 'status' => LOGIN_ERROR_PASSWORD,
+ 'error_msg' => 'NO_PASSWORD_SUPPLIED',
+ 'user_row' => array('user_id' => ANONYMOUS),
+ );
+ }
+
+ if (!$username)
+ {
+ return array(
+ 'status' => LOGIN_ERROR_USERNAME,
+ 'error_msg' => 'LOGIN_ERROR_USERNAME',
+ 'user_row' => array('user_id' => ANONYMOUS),
+ );
+ }
+
+ if (!@extension_loaded('ldap'))
+ {
+ return array(
+ 'status' => LOGIN_ERROR_EXTERNAL_AUTH,
+ 'error_msg' => 'LDAP_NO_LDAP_EXTENSION',
+ 'user_row' => array('user_id' => ANONYMOUS),
+ );
+ }
+
+ $this->config['ldap_port'] = (int) $this->config['ldap_port'];
+ if ($this->config['ldap_port'])
+ {
+ $ldap = @ldap_connect($this->config['ldap_server'], $this->config['ldap_port']);
+ }
+ else
+ {
+ $ldap = @ldap_connect($this->config['ldap_server']);
+ }
+
+ if (!$ldap)
+ {
+ return array(
+ 'status' => LOGIN_ERROR_EXTERNAL_AUTH,
+ 'error_msg' => 'LDAP_NO_SERVER_CONNECTION',
+ 'user_row' => array('user_id' => ANONYMOUS),
+ );
+ }
+
+ @ldap_set_option($ldap, LDAP_OPT_PROTOCOL_VERSION, 3);
+ @ldap_set_option($ldap, LDAP_OPT_REFERRALS, 0);
+
+ if ($this->config['ldap_user'] || $this->config['ldap_password'])
+ {
+ if (!@ldap_bind($ldap, htmlspecialchars_decode($this->config['ldap_user']), htmlspecialchars_decode($this->config['ldap_password'])))
+ {
+ return array(
+ 'status' => LOGIN_ERROR_EXTERNAL_AUTH,
+ 'error_msg' => 'LDAP_NO_SERVER_CONNECTION',
+ 'user_row' => array('user_id' => ANONYMOUS),
+ );
+ }
+ }
+
+ $search = @ldap_search(
+ $ldap,
+ htmlspecialchars_decode($this->config['ldap_base_dn']),
+ $this->ldap_user_filter($username),
+ (empty($this->config['ldap_email'])) ?
+ array(htmlspecialchars_decode($this->config['ldap_uid'])) :
+ array(htmlspecialchars_decode($this->config['ldap_uid']), htmlspecialchars_decode($this->config['ldap_email'])),
+ 0,
+ 1
+ );
+
+ $ldap_result = @ldap_get_entries($ldap, $search);
+
+ if (is_array($ldap_result) && sizeof($ldap_result) > 1)
+ {
+ if (@ldap_bind($ldap, $ldap_result[0]['dn'], htmlspecialchars_decode($password)))
+ {
+ @ldap_close($ldap);
+
+ $sql ='SELECT user_id, username, user_password, user_passchg, user_email, user_type
+ FROM ' . USERS_TABLE . "
+ WHERE username_clean = '" . $this->db->sql_escape(utf8_clean_string($username)) . "'";
+ $result = $this->db->sql_query($sql);
+ $row = $this->db->sql_fetchrow($result);
+ $this->db->sql_freeresult($result);
+
+ if ($row)
+ {
+ unset($ldap_result);
+
+ // User inactive...
+ if ($row['user_type'] == USER_INACTIVE || $row['user_type'] == USER_IGNORE)
+ {
+ return array(
+ 'status' => LOGIN_ERROR_ACTIVE,
+ 'error_msg' => 'ACTIVE_ERROR',
+ 'user_row' => $row,
+ );
+ }
+
+ // Successful login... set user_login_attempts to zero...
+ return array(
+ 'status' => LOGIN_SUCCESS,
+ 'error_msg' => false,
+ 'user_row' => $row,
+ );
+ }
+ else
+ {
+ // retrieve default group id
+ $sql = 'SELECT group_id
+ FROM ' . GROUPS_TABLE . "
+ WHERE group_name = '" . $this->db->sql_escape('REGISTERED') . "'
+ AND group_type = " . GROUP_SPECIAL;
+ $result = $this->db->sql_query($sql);
+ $row = $this->db->sql_fetchrow($result);
+ $this->db->sql_freeresult($result);
+
+ if (!$row)
+ {
+ trigger_error('NO_GROUP');
+ }
+
+ // generate user account data
+ $ldap_user_row = array(
+ 'username' => $username,
+ 'user_password' => $this->passwords_manager->hash($password),
+ 'user_email' => (!empty($this->config['ldap_email'])) ? utf8_htmlspecialchars($ldap_result[0][htmlspecialchars_decode($this->config['ldap_email'])][0]) : '',
+ 'group_id' => (int) $row['group_id'],
+ 'user_type' => USER_NORMAL,
+ 'user_ip' => $this->user->ip,
+ 'user_new' => ($this->config['new_member_post_limit']) ? 1 : 0,
+ );
+
+ unset($ldap_result);
+
+ // this is the user's first login so create an empty profile
+ return array(
+ 'status' => LOGIN_SUCCESS_CREATE_PROFILE,
+ 'error_msg' => false,
+ 'user_row' => $ldap_user_row,
+ );
+ }
+ }
+ else
+ {
+ unset($ldap_result);
+ @ldap_close($ldap);
+
+ // Give status about wrong password...
+ return array(
+ 'status' => LOGIN_ERROR_PASSWORD,
+ 'error_msg' => 'LOGIN_ERROR_PASSWORD',
+ 'user_row' => array('user_id' => ANONYMOUS),
+ );
+ }
+ }
+
+ @ldap_close($ldap);
+
+ return array(
+ 'status' => LOGIN_ERROR_USERNAME,
+ 'error_msg' => 'LOGIN_ERROR_USERNAME',
+ 'user_row' => array('user_id' => ANONYMOUS),
+ );
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function acp()
+ {
+ // These are fields required in the config table
+ return array(
+ 'ldap_server', 'ldap_port', 'ldap_base_dn', 'ldap_uid', 'ldap_user_filter', 'ldap_email', 'ldap_user', 'ldap_password',
+ );
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_acp_template($new_config)
+ {
+ return array(
+ 'TEMPLATE_FILE' => 'auth_provider_ldap.html',
+ 'TEMPLATE_VARS' => array(
+ 'AUTH_LDAP_BASE_DN' => $new_config['ldap_base_dn'],
+ 'AUTH_LDAP_EMAIL' => $new_config['ldap_email'],
+ 'AUTH_LDAP_PASSORD' => $new_config['ldap_password'] !== '' ? '********' : '',
+ 'AUTH_LDAP_PORT' => $new_config['ldap_port'],
+ 'AUTH_LDAP_SERVER' => $new_config['ldap_server'],
+ 'AUTH_LDAP_UID' => $new_config['ldap_uid'],
+ 'AUTH_LDAP_USER' => $new_config['ldap_user'],
+ 'AUTH_LDAP_USER_FILTER' => $new_config['ldap_user_filter'],
+ ),
+ );
+ }
+
+ /**
+ * Generates a filter string for ldap_search to find a user
+ *
+ * @param $username string Username identifying the searched user
+ *
+ * @return string A filter string for ldap_search
+ */
+ private function ldap_user_filter($username)
+ {
+ $filter = '(' . $this->config['ldap_uid'] . '=' . $this->ldap_escape(htmlspecialchars_decode($username)) . ')';
+ if ($this->config['ldap_user_filter'])
+ {
+ $_filter = ($this->config['ldap_user_filter'][0] == '(' && substr($this->config['ldap_user_filter'], -1) == ')') ? $this->config['ldap_user_filter'] : "({$this->config['ldap_user_filter']})";
+ $filter = "(&{$filter}{$_filter})";
+ }
+ return $filter;
+ }
+
+ /**
+ * Escapes an LDAP AttributeValue
+ *
+ * @param string $string The string to be escaped
+ * @return string The escaped string
+ */
+ private function ldap_escape($string)
+ {
+ return str_replace(array('*', '\\', '(', ')'), array('\\*', '\\\\', '\\(', '\\)'), $string);
+ }
+}
diff --git a/phpBB/phpbb/auth/provider/oauth/oauth.php b/phpBB/phpbb/auth/provider/oauth/oauth.php
new file mode 100644
index 0000000000..bd2a414033
--- /dev/null
+++ b/phpBB/phpbb/auth/provider/oauth/oauth.php
@@ -0,0 +1,672 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\auth\provider\oauth;
+
+use OAuth\Common\Consumer\Credentials;
+
+/**
+* OAuth authentication provider for phpBB3
+*/
+class oauth extends \phpbb\auth\provider\base
+{
+ /**
+ * Database driver
+ *
+ * @var \phpbb\db\driver\driver_interface
+ */
+ protected $db;
+
+ /**
+ * phpBB config
+ *
+ * @var \phpbb\config\config
+ */
+ protected $config;
+
+ /**
+ * phpBB passwords manager
+ *
+ * @var \phpbb\passwords\manager
+ */
+ protected $passwords_manager;
+
+ /**
+ * phpBB request object
+ *
+ * @var \phpbb\request\request_interface
+ */
+ protected $request;
+
+ /**
+ * phpBB user
+ *
+ * @var \phpbb\user
+ */
+ protected $user;
+
+ /**
+ * OAuth token table
+ *
+ * @var string
+ */
+ protected $auth_provider_oauth_token_storage_table;
+
+ /**
+ * OAuth account association table
+ *
+ * @var string
+ */
+ protected $auth_provider_oauth_token_account_assoc;
+
+ /**
+ * All OAuth service providers
+ *
+ * @var \phpbb\di\service_collection Contains \phpbb\auth\provider\oauth\service_interface
+ */
+ protected $service_providers;
+
+ /**
+ * Users table
+ *
+ * @var string
+ */
+ protected $users_table;
+
+ /**
+ * Cached current uri object
+ *
+ * @var \OAuth\Common\Http\Uri\UriInterface|null
+ */
+ protected $current_uri;
+
+ /**
+ * DI container
+ *
+ * @var \Symfony\Component\DependencyInjection\ContainerInterface
+ */
+ protected $phpbb_container;
+
+ /**
+ * phpBB event dispatcher
+ *
+ * @var \phpbb\event\dispatcher_interface
+ */
+ protected $dispatcher;
+
+ /**
+ * phpBB root path
+ *
+ * @var string
+ */
+ protected $phpbb_root_path;
+
+ /**
+ * PHP file extension
+ *
+ * @var string
+ */
+ protected $php_ext;
+
+ /**
+ * OAuth Authentication Constructor
+ *
+ * @param \phpbb\db\driver\driver_interface $db
+ * @param \phpbb\config\config $config
+ * @param \phpbb\passwords\manager $passwords_manager
+ * @param \phpbb\request\request_interface $request
+ * @param \phpbb\user $user
+ * @param string $auth_provider_oauth_token_storage_table
+ * @param string $auth_provider_oauth_token_account_assoc
+ * @param \phpbb\di\service_collection $service_providers Contains \phpbb\auth\provider\oauth\service_interface
+ * @param string $users_table
+ * @param \Symfony\Component\DependencyInjection\ContainerInterface $phpbb_container DI container
+ * @param \phpbb\event\dispatcher_interface $dispatcher phpBB event dispatcher
+ * @param string $phpbb_root_path
+ * @param string $php_ext
+ */
+ public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\config\config $config, \phpbb\passwords\manager $passwords_manager, \phpbb\request\request_interface $request, \phpbb\user $user, $auth_provider_oauth_token_storage_table, $auth_provider_oauth_token_account_assoc, \phpbb\di\service_collection $service_providers, $users_table, \Symfony\Component\DependencyInjection\ContainerInterface $phpbb_container, \phpbb\event\dispatcher_interface $dispatcher, $phpbb_root_path, $php_ext)
+ {
+ $this->db = $db;
+ $this->config = $config;
+ $this->passwords_manager = $passwords_manager;
+ $this->request = $request;
+ $this->user = $user;
+ $this->auth_provider_oauth_token_storage_table = $auth_provider_oauth_token_storage_table;
+ $this->auth_provider_oauth_token_account_assoc = $auth_provider_oauth_token_account_assoc;
+ $this->service_providers = $service_providers;
+ $this->users_table = $users_table;
+ $this->phpbb_container = $phpbb_container;
+ $this->dispatcher = $dispatcher;
+ $this->phpbb_root_path = $phpbb_root_path;
+ $this->php_ext = $php_ext;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function init()
+ {
+ // This does not test whether or not the key and secret provided are valid.
+ foreach ($this->service_providers as $service_provider)
+ {
+ $credentials = $service_provider->get_service_credentials();
+
+ if (($credentials['key'] && !$credentials['secret']) || (!$credentials['key'] && $credentials['secret']))
+ {
+ return $this->user->lang['AUTH_PROVIDER_OAUTH_ERROR_ELEMENT_MISSING'];
+ }
+ }
+ return false;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function login($username, $password)
+ {
+ // Temporary workaround for only having one authentication provider available
+ if (!$this->request->is_set('oauth_service'))
+ {
+ $provider = new \phpbb\auth\provider\db($this->db, $this->config, $this->passwords_manager, $this->request, $this->user, $this->phpbb_container, $this->phpbb_root_path, $this->php_ext);
+ return $provider->login($username, $password);
+ }
+
+ // Requst the name of the OAuth service
+ $service_name_original = $this->request->variable('oauth_service', '', false);
+ $service_name = 'auth.provider.oauth.service.' . strtolower($service_name_original);
+ if ($service_name_original === '' || !array_key_exists($service_name, $this->service_providers))
+ {
+ return array(
+ 'status' => LOGIN_ERROR_EXTERNAL_AUTH,
+ 'error_msg' => 'LOGIN_ERROR_OAUTH_SERVICE_DOES_NOT_EXIST',
+ 'user_row' => array('user_id' => ANONYMOUS),
+ );
+ }
+
+ // Get the service credentials for the given service
+ $service_credentials = $this->service_providers[$service_name]->get_service_credentials();
+
+ $storage = new \phpbb\auth\provider\oauth\token_storage($this->db, $this->user, $this->auth_provider_oauth_token_storage_table);
+ $query = 'mode=login&login=external&oauth_service=' . $service_name_original;
+ $service = $this->get_service($service_name_original, $storage, $service_credentials, $query, $this->service_providers[$service_name]->get_auth_scope());
+
+ if ($this->request->is_set('code', \phpbb\request\request_interface::GET))
+ {
+ $this->service_providers[$service_name]->set_external_service_provider($service);
+ $unique_id = $this->service_providers[$service_name]->perform_auth_login();
+
+ // Check to see if this provider is already assosciated with an account
+ $data = array(
+ 'provider' => $service_name_original,
+ 'oauth_provider_id' => $unique_id
+ );
+ $sql = 'SELECT user_id FROM ' . $this->auth_provider_oauth_token_account_assoc . '
+ WHERE ' . $this->db->sql_build_array('SELECT', $data);
+ $result = $this->db->sql_query($sql);
+ $row = $this->db->sql_fetchrow($result);
+ $this->db->sql_freeresult($result);
+
+ if (!$row)
+ {
+ // The user does not yet exist, ask to link or create profile
+ return array(
+ 'status' => LOGIN_SUCCESS_LINK_PROFILE,
+ 'error_msg' => 'LOGIN_OAUTH_ACCOUNT_NOT_LINKED',
+ 'user_row' => array(),
+ 'redirect_data' => array(
+ 'auth_provider' => 'oauth',
+ 'login_link_oauth_service' => $service_name_original,
+ ),
+ );
+ }
+
+ // Retrieve the user's account
+ $sql = 'SELECT user_id, username, user_password, user_passchg, user_email, user_type, user_login_attempts
+ FROM ' . $this->users_table . '
+ WHERE user_id = ' . (int) $row['user_id'];
+ $result = $this->db->sql_query($sql);
+ $row = $this->db->sql_fetchrow($result);
+ $this->db->sql_freeresult($result);
+
+ if (!$row)
+ {
+ throw new \Exception('AUTH_PROVIDER_OAUTH_ERROR_INVALID_ENTRY');
+ }
+
+ // Update token storage to store the user_id
+ $storage->set_user_id($row['user_id']);
+
+ /**
+ * Event is triggered after user is successfuly logged in via OAuth.
+ *
+ * @event core.auth_oauth_login_after
+ * @var array row User row
+ * @since 3.1.11-RC1
+ */
+ $vars = array(
+ 'row',
+ );
+ extract($this->dispatcher->trigger_event('core.auth_oauth_login_after', compact($vars)));
+
+ // The user is now authenticated and can be logged in
+ return array(
+ 'status' => LOGIN_SUCCESS,
+ 'error_msg' => false,
+ 'user_row' => $row,
+ );
+ }
+ else
+ {
+ $url = $service->getAuthorizationUri();
+ header('Location: ' . $url);
+ }
+ }
+
+ /**
+ * Returns the cached current_uri object or creates and caches it if it is
+ * not already created. In each case the query string is updated based on
+ * the $query parameter.
+ *
+ * @param string $service_name The name of the service
+ * @param string $query The query string of the current_uri
+ * used in redirects
+ * @return \OAuth\Common\Http\Uri\UriInterface
+ */
+ protected function get_current_uri($service_name, $query)
+ {
+ if ($this->current_uri)
+ {
+ $this->current_uri->setQuery($query);
+ return $this->current_uri;
+ }
+
+ $uri_factory = new \OAuth\Common\Http\Uri\UriFactory();
+ $super_globals = $this->request->get_super_global(\phpbb\request\request_interface::SERVER);
+ if (!empty($super_globals['HTTP_X_FORWARDED_PROTO']) && $super_globals['HTTP_X_FORWARDED_PROTO'] === 'https')
+ {
+ $super_globals['HTTPS'] = 'on';
+ $super_globals['SERVER_PORT'] = 443;
+ }
+ $current_uri = $uri_factory->createFromSuperGlobalArray($super_globals);
+ $current_uri->setQuery($query);
+
+ $this->current_uri = $current_uri;
+ return $current_uri;
+ }
+
+ /**
+ * Returns a new service object
+ *
+ * @param string $service_name The name of the service
+ * @param \phpbb\auth\provider\oauth\token_storage $storage
+ * @param array $service_credentials {@see \phpbb\auth\provider\oauth\oauth::get_service_credentials}
+ * @param string $query The query string of the
+ * current_uri used in redirection
+ * @param array $scopes The scope of the request against
+ * the api.
+ * @return \OAuth\Common\Service\ServiceInterface
+ * @throws \Exception
+ */
+ protected function get_service($service_name, \phpbb\auth\provider\oauth\token_storage $storage, array $service_credentials, $query, array $scopes = array())
+ {
+ $current_uri = $this->get_current_uri($service_name, $query);
+
+ // Setup the credentials for the requests
+ $credentials = new Credentials(
+ $service_credentials['key'],
+ $service_credentials['secret'],
+ $current_uri->getAbsoluteUri()
+ );
+
+ $service_factory = new \OAuth\ServiceFactory();
+ $service = $service_factory->createService($service_name, $credentials, $storage, $scopes);
+
+ if (!$service)
+ {
+ throw new \Exception('AUTH_PROVIDER_OAUTH_ERROR_SERVICE_NOT_CREATED');
+ }
+
+ return $service;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_login_data()
+ {
+ $login_data = array(
+ 'TEMPLATE_FILE' => 'login_body_oauth.html',
+ 'BLOCK_VAR_NAME' => 'oauth',
+ 'BLOCK_VARS' => array(),
+ );
+
+ foreach ($this->service_providers as $service_name => $service_provider)
+ {
+ // Only include data if the credentials are set
+ $credentials = $service_provider->get_service_credentials();
+ if ($credentials['key'] && $credentials['secret'])
+ {
+ $actual_name = str_replace('auth.provider.oauth.service.', '', $service_name);
+ $redirect_url = build_url(false) . '&login=external&oauth_service=' . $actual_name;
+ $login_data['BLOCK_VARS'][$service_name] = array(
+ 'REDIRECT_URL' => redirect($redirect_url, true),
+ 'SERVICE_NAME' => $this->user->lang['AUTH_PROVIDER_OAUTH_SERVICE_' . strtoupper($actual_name)],
+ );
+ }
+ }
+
+ return $login_data;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function acp()
+ {
+ $ret = array();
+
+ foreach ($this->service_providers as $service_name => $service_provider)
+ {
+ $actual_name = str_replace('auth.provider.oauth.service.', '', $service_name);
+ $ret[] = 'auth_oauth_' . $actual_name . '_key';
+ $ret[] = 'auth_oauth_' . $actual_name . '_secret';
+ }
+
+ return $ret;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_acp_template($new_config)
+ {
+ $ret = array(
+ 'BLOCK_VAR_NAME' => 'oauth_services',
+ 'BLOCK_VARS' => array(),
+ 'TEMPLATE_FILE' => 'auth_provider_oauth.html',
+ 'TEMPLATE_VARS' => array(),
+ );
+
+ foreach ($this->service_providers as $service_name => $service_provider)
+ {
+ $actual_name = str_replace('auth.provider.oauth.service.', '', $service_name);
+ $ret['BLOCK_VARS'][$actual_name] = array(
+ 'ACTUAL_NAME' => $this->user->lang['AUTH_PROVIDER_OAUTH_SERVICE_' . strtoupper($actual_name)],
+ 'KEY' => $new_config['auth_oauth_' . $actual_name . '_key'],
+ 'NAME' => $actual_name,
+ 'SECRET' => $new_config['auth_oauth_' . $actual_name . '_secret'],
+ );
+ }
+
+ return $ret;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function login_link_has_necessary_data($login_link_data)
+ {
+ if (empty($login_link_data))
+ {
+ return 'LOGIN_LINK_NO_DATA_PROVIDED';
+ }
+
+ if (!array_key_exists('oauth_service', $login_link_data) || !$login_link_data['oauth_service'] ||
+ !array_key_exists('link_method', $login_link_data) || !$login_link_data['link_method'])
+ {
+ return 'LOGIN_LINK_MISSING_DATA';
+ }
+
+ return null;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function link_account(array $link_data)
+ {
+ // Check for a valid link method (auth_link or login_link)
+ if (!array_key_exists('link_method', $link_data) ||
+ !in_array($link_data['link_method'], array(
+ 'auth_link',
+ 'login_link',
+ )))
+ {
+ return 'LOGIN_LINK_MISSING_DATA';
+ }
+
+ // We must have an oauth_service listed, check for it two ways
+ if (!array_key_exists('oauth_service', $link_data) || !$link_data['oauth_service'])
+ {
+ $link_data['oauth_service'] = $this->request->variable('oauth_service', '');
+
+ if (!$link_data['oauth_service'])
+ {
+ return 'LOGIN_LINK_MISSING_DATA';
+ }
+ }
+
+ $service_name = 'auth.provider.oauth.service.' . strtolower($link_data['oauth_service']);
+ if (!array_key_exists($service_name, $this->service_providers))
+ {
+ return 'LOGIN_ERROR_OAUTH_SERVICE_DOES_NOT_EXIST';
+ }
+
+ switch ($link_data['link_method'])
+ {
+ case 'auth_link':
+ return $this->link_account_auth_link($link_data, $service_name);
+ case 'login_link':
+ return $this->link_account_login_link($link_data, $service_name);
+ }
+ }
+
+ /**
+ * Performs the account linking for login_link
+ *
+ * @param array $link_data The same variable given to {@see \phpbb\auth\provider\provider_interface::link_account}
+ * @param string $service_name The name of the service being used in
+ * linking.
+ * @return string|null Returns a language constant (string) if an error is
+ * encountered, or null on success.
+ */
+ protected function link_account_login_link(array $link_data, $service_name)
+ {
+ $storage = new \phpbb\auth\provider\oauth\token_storage($this->db, $this->user, $this->auth_provider_oauth_token_storage_table);
+
+ // Check for an access token, they should have one
+ if (!$storage->has_access_token_by_session($service_name))
+ {
+ return 'LOGIN_LINK_ERROR_OAUTH_NO_ACCESS_TOKEN';
+ }
+
+ // Prepare the query string
+ $query = 'mode=login_link&login_link_oauth_service=' . strtolower($link_data['oauth_service']);
+
+ // Prepare for an authentication request
+ $service_credentials = $this->service_providers[$service_name]->get_service_credentials();
+ $scopes = $this->service_providers[$service_name]->get_auth_scope();
+ $service = $this->get_service(strtolower($link_data['oauth_service']), $storage, $service_credentials, $query, $scopes);
+ $this->service_providers[$service_name]->set_external_service_provider($service);
+
+ // The user has already authenticated successfully, request to authenticate again
+ $unique_id = $this->service_providers[$service_name]->perform_token_auth();
+
+ // Insert into table, they will be able to log in after this
+ $data = array(
+ 'user_id' => $link_data['user_id'],
+ 'provider' => strtolower($link_data['oauth_service']),
+ 'oauth_provider_id' => $unique_id,
+ );
+
+ $this->link_account_perform_link($data);
+ // Update token storage to store the user_id
+ $storage->set_user_id($link_data['user_id']);
+ }
+
+ /**
+ * Performs the account linking for auth_link
+ *
+ * @param array $link_data The same variable given to {@see \phpbb\auth\provider\provider_interface::link_account}
+ * @param string $service_name The name of the service being used in
+ * linking.
+ * @return string|null Returns a language constant (string) if an error is
+ * encountered, or null on success.
+ */
+ protected function link_account_auth_link(array $link_data, $service_name)
+ {
+ $storage = new \phpbb\auth\provider\oauth\token_storage($this->db, $this->user, $this->auth_provider_oauth_token_storage_table);
+ $query = 'i=ucp_auth_link&mode=auth_link&link=1&oauth_service=' . strtolower($link_data['oauth_service']);
+ $service_credentials = $this->service_providers[$service_name]->get_service_credentials();
+ $scopes = $this->service_providers[$service_name]->get_auth_scope();
+ $service = $this->get_service(strtolower($link_data['oauth_service']), $storage, $service_credentials, $query, $scopes);
+
+ if ($this->request->is_set('code', \phpbb\request\request_interface::GET))
+ {
+ $this->service_providers[$service_name]->set_external_service_provider($service);
+ $unique_id = $this->service_providers[$service_name]->perform_auth_login();
+
+ // Insert into table, they will be able to log in after this
+ $data = array(
+ 'user_id' => $this->user->data['user_id'],
+ 'provider' => strtolower($link_data['oauth_service']),
+ 'oauth_provider_id' => $unique_id,
+ );
+
+ $this->link_account_perform_link($data);
+ }
+ else
+ {
+ $url = $service->getAuthorizationUri();
+ header('Location: ' . $url);
+ }
+ }
+
+ /**
+ * Performs the query that inserts an account link
+ *
+ * @param array $data This array is passed to db->sql_build_array
+ */
+ protected function link_account_perform_link(array $data)
+ {
+ $sql = 'INSERT INTO ' . $this->auth_provider_oauth_token_account_assoc . '
+ ' . $this->db->sql_build_array('INSERT', $data);
+ $this->db->sql_query($sql);
+
+ /**
+ * Event is triggered after user links account.
+ *
+ * @event core.auth_oauth_link_after
+ * @var array data User row
+ * @since 3.1.11-RC1
+ */
+ $vars = array(
+ 'data',
+ );
+ extract($this->dispatcher->trigger_event('core.auth_oauth_link_after', compact($vars)));
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function logout($data, $new_session)
+ {
+ // Clear all tokens belonging to the user
+ $storage = new \phpbb\auth\provider\oauth\token_storage($this->db, $this->user, $this->auth_provider_oauth_token_storage_table);
+ $storage->clearAllTokens();
+
+ return;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_auth_link_data($user_id = 0)
+ {
+ $block_vars = array();
+
+ // Get all external accounts tied to the current user
+ $data = array(
+ 'user_id' => ($user_id <= 0) ? (int) $this->user->data['user_id'] : (int) $user_id,
+ );
+ $sql = 'SELECT oauth_provider_id, provider FROM ' . $this->auth_provider_oauth_token_account_assoc . '
+ WHERE ' . $this->db->sql_build_array('SELECT', $data);
+ $result = $this->db->sql_query($sql);
+ $rows = $this->db->sql_fetchrowset($result);
+ $this->db->sql_freeresult($result);
+
+ $oauth_user_ids = array();
+
+ if ($rows !== false && sizeof($rows))
+ {
+ foreach ($rows as $row)
+ {
+ $oauth_user_ids[$row['provider']] = $row['oauth_provider_id'];
+ }
+ }
+ unset($rows);
+
+ foreach ($this->service_providers as $service_name => $service_provider)
+ {
+ // Only include data if the credentials are set
+ $credentials = $service_provider->get_service_credentials();
+ if ($credentials['key'] && $credentials['secret'])
+ {
+ $actual_name = str_replace('auth.provider.oauth.service.', '', $service_name);
+
+ $block_vars[$service_name] = array(
+ 'HIDDEN_FIELDS' => array(
+ 'link' => (!isset($oauth_user_ids[$actual_name])),
+ 'oauth_service' => $actual_name,
+ ),
+
+ 'SERVICE_NAME' => $this->user->lang['AUTH_PROVIDER_OAUTH_SERVICE_' . strtoupper($actual_name)],
+ 'UNIQUE_ID' => (isset($oauth_user_ids[$actual_name])) ? $oauth_user_ids[$actual_name] : null,
+ );
+ }
+ }
+
+ return array(
+ 'BLOCK_VAR_NAME' => 'oauth',
+ 'BLOCK_VARS' => $block_vars,
+
+ 'TEMPLATE_FILE' => 'ucp_auth_link_oauth.html',
+ );
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function unlink_account(array $link_data)
+ {
+ if (!array_key_exists('oauth_service', $link_data) || !$link_data['oauth_service'])
+ {
+ return 'LOGIN_LINK_MISSING_DATA';
+ }
+
+ // Remove user specified in $link_data if possible
+ $user_id = isset($link_data['user_id']) ? $link_data['user_id'] : $this->user->data['user_id'];
+
+ // Remove the link
+ $sql = 'DELETE FROM ' . $this->auth_provider_oauth_token_account_assoc . "
+ WHERE provider = '" . $this->db->sql_escape($link_data['oauth_service']) . "'
+ AND user_id = " . (int) $user_id;
+ $this->db->sql_query($sql);
+
+ // Clear all tokens belonging to the user on this servce
+ $service_name = 'auth.provider.oauth.service.' . strtolower($link_data['oauth_service']);
+ $storage = new \phpbb\auth\provider\oauth\token_storage($this->db, $this->user, $this->auth_provider_oauth_token_storage_table);
+ $storage->clearToken($service_name);
+ }
+}
diff --git a/phpBB/phpbb/auth/provider/oauth/service/base.php b/phpBB/phpbb/auth/provider/oauth/service/base.php
new file mode 100644
index 0000000000..6adf64aa30
--- /dev/null
+++ b/phpBB/phpbb/auth/provider/oauth/service/base.php
@@ -0,0 +1,51 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\auth\provider\oauth\service;
+
+/**
+* Base OAuth abstract class that all OAuth services should implement
+*/
+abstract class base implements \phpbb\auth\provider\oauth\service\service_interface
+{
+ /**
+ * External OAuth service provider
+ *
+ * @var \OAuth\Common\Service\ServiceInterface
+ */
+ protected $service_provider;
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_external_service_provider()
+ {
+ return $this->service_provider;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_auth_scope()
+ {
+ return array();
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function set_external_service_provider(\OAuth\Common\Service\ServiceInterface $service_provider)
+ {
+ $this->service_provider = $service_provider;
+ }
+}
diff --git a/phpBB/phpbb/auth/provider/oauth/service/bitly.php b/phpBB/phpbb/auth/provider/oauth/service/bitly.php
new file mode 100644
index 0000000000..25e731a02c
--- /dev/null
+++ b/phpBB/phpbb/auth/provider/oauth/service/bitly.php
@@ -0,0 +1,94 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\auth\provider\oauth\service;
+
+/**
+* Bitly OAuth service
+*/
+class bitly extends \phpbb\auth\provider\oauth\service\base
+{
+ /**
+ * phpBB config
+ *
+ * @var \phpbb\config\config
+ */
+ protected $config;
+
+ /**
+ * phpBB request
+ *
+ * @var \phpbb\request\request_interface
+ */
+ protected $request;
+
+ /**
+ * Constructor
+ *
+ * @param \phpbb\config\config $config
+ * @param \phpbb\request\request_interface $request
+ */
+ public function __construct(\phpbb\config\config $config, \phpbb\request\request_interface $request)
+ {
+ $this->config = $config;
+ $this->request = $request;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_service_credentials()
+ {
+ return array(
+ 'key' => $this->config['auth_oauth_bitly_key'],
+ 'secret' => $this->config['auth_oauth_bitly_secret'],
+ );
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function perform_auth_login()
+ {
+ if (!($this->service_provider instanceof \OAuth\OAuth2\Service\Bitly))
+ {
+ throw new \phpbb\auth\provider\oauth\service\exception('AUTH_PROVIDER_OAUTH_ERROR_INVALID_SERVICE_TYPE');
+ }
+
+ // This was a callback request from bitly, get the token
+ $this->service_provider->requestAccessToken($this->request->variable('code', ''));
+
+ // Send a request with it
+ $result = json_decode($this->service_provider->request('user/info'), true);
+
+ // Return the unique identifier returned from bitly
+ return $result['data']['login'];
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function perform_token_auth()
+ {
+ if (!($this->service_provider instanceof \OAuth\OAuth2\Service\Bitly))
+ {
+ throw new \phpbb\auth\provider\oauth\service\exception('AUTH_PROVIDER_OAUTH_ERROR_INVALID_SERVICE_TYPE');
+ }
+
+ // Send a request with it
+ $result = json_decode($this->service_provider->request('user/info'), true);
+
+ // Return the unique identifier returned from bitly
+ return $result['data']['login'];
+ }
+}
diff --git a/phpBB/phpbb/auth/provider/oauth/service/exception.php b/phpBB/phpbb/auth/provider/oauth/service/exception.php
new file mode 100644
index 0000000000..d3e95bef0d
--- /dev/null
+++ b/phpBB/phpbb/auth/provider/oauth/service/exception.php
@@ -0,0 +1,21 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\auth\provider\oauth\service;
+
+/**
+* OAuth service exception class
+*/
+class exception extends \RuntimeException
+{
+}
diff --git a/phpBB/phpbb/auth/provider/oauth/service/facebook.php b/phpBB/phpbb/auth/provider/oauth/service/facebook.php
new file mode 100644
index 0000000000..bb98835e07
--- /dev/null
+++ b/phpBB/phpbb/auth/provider/oauth/service/facebook.php
@@ -0,0 +1,94 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\auth\provider\oauth\service;
+
+/**
+* Facebook OAuth service
+*/
+class facebook extends base
+{
+ /**
+ * phpBB config
+ *
+ * @var \phpbb\config\config
+ */
+ protected $config;
+
+ /**
+ * phpBB request
+ *
+ * @var \phpbb\request\request_interface
+ */
+ protected $request;
+
+ /**
+ * Constructor
+ *
+ * @param \phpbb\config\config $config
+ * @param \phpbb\request\request_interface $request
+ */
+ public function __construct(\phpbb\config\config $config, \phpbb\request\request_interface $request)
+ {
+ $this->config = $config;
+ $this->request = $request;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_service_credentials()
+ {
+ return array(
+ 'key' => $this->config['auth_oauth_facebook_key'],
+ 'secret' => $this->config['auth_oauth_facebook_secret'],
+ );
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function perform_auth_login()
+ {
+ if (!($this->service_provider instanceof \OAuth\OAuth2\Service\Facebook))
+ {
+ throw new exception('AUTH_PROVIDER_OAUTH_ERROR_INVALID_SERVICE_TYPE');
+ }
+
+ // This was a callback request, get the token
+ $this->service_provider->requestAccessToken($this->request->variable('code', ''));
+
+ // Send a request with it
+ $result = json_decode($this->service_provider->request('/me'), true);
+
+ // Return the unique identifier
+ return $result['id'];
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function perform_token_auth()
+ {
+ if (!($this->service_provider instanceof \OAuth\OAuth2\Service\Facebook))
+ {
+ throw new exception('AUTH_PROVIDER_OAUTH_ERROR_INVALID_SERVICE_TYPE');
+ }
+
+ // Send a request with it
+ $result = json_decode($this->service_provider->request('/me'), true);
+
+ // Return the unique identifier
+ return $result['id'];
+ }
+}
diff --git a/phpBB/phpbb/auth/provider/oauth/service/google.php b/phpBB/phpbb/auth/provider/oauth/service/google.php
new file mode 100644
index 0000000000..cb9f83a94f
--- /dev/null
+++ b/phpBB/phpbb/auth/provider/oauth/service/google.php
@@ -0,0 +1,105 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\auth\provider\oauth\service;
+
+/**
+* Google OAuth service
+*/
+class google extends base
+{
+ /**
+ * phpBB config
+ *
+ * @var \phpbb\config\config
+ */
+ protected $config;
+
+ /**
+ * phpBB request
+ *
+ * @var \phpbb\request\request_interface
+ */
+ protected $request;
+
+ /**
+ * Constructor
+ *
+ * @param \phpbb\config\config $config
+ * @param \phpbb\request\request_interface $request
+ */
+ public function __construct(\phpbb\config\config $config, \phpbb\request\request_interface $request)
+ {
+ $this->config = $config;
+ $this->request = $request;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_auth_scope()
+ {
+ return array(
+ 'userinfo_email',
+ 'userinfo_profile',
+ );
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_service_credentials()
+ {
+ return array(
+ 'key' => $this->config['auth_oauth_google_key'],
+ 'secret' => $this->config['auth_oauth_google_secret'],
+ );
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function perform_auth_login()
+ {
+ if (!($this->service_provider instanceof \OAuth\OAuth2\Service\Google))
+ {
+ throw new exception('AUTH_PROVIDER_OAUTH_ERROR_INVALID_SERVICE_TYPE');
+ }
+
+ // This was a callback request, get the token
+ $this->service_provider->requestAccessToken($this->request->variable('code', ''));
+
+ // Send a request with it
+ $result = json_decode($this->service_provider->request('https://www.googleapis.com/oauth2/v1/userinfo'), true);
+
+ // Return the unique identifier
+ return $result['id'];
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function perform_token_auth()
+ {
+ if (!($this->service_provider instanceof \OAuth\OAuth2\Service\Google))
+ {
+ throw new exception('AUTH_PROVIDER_OAUTH_ERROR_INVALID_SERVICE_TYPE');
+ }
+
+ // Send a request with it
+ $result = json_decode($this->service_provider->request('https://www.googleapis.com/oauth2/v1/userinfo'), true);
+
+ // Return the unique identifier
+ return $result['id'];
+ }
+}
diff --git a/phpBB/phpbb/auth/provider/oauth/service/service_interface.php b/phpBB/phpbb/auth/provider/oauth/service/service_interface.php
new file mode 100644
index 0000000000..e84eb247b6
--- /dev/null
+++ b/phpBB/phpbb/auth/provider/oauth/service/service_interface.php
@@ -0,0 +1,73 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\auth\provider\oauth\service;
+
+/**
+* OAuth service interface
+*/
+interface service_interface
+{
+ /**
+ * Returns an array of the scopes necessary for auth
+ *
+ * @return array An array of the required scopes
+ */
+ public function get_auth_scope();
+
+ /**
+ * Returns the external library service provider once it has been set
+ *
+ * @param \OAuth\Common\Service\ServiceInterface|null
+ */
+ public function get_external_service_provider();
+
+ /**
+ * Returns an array containing the service credentials belonging to requested
+ * service.
+ *
+ * @return array An array containing the 'key' and the 'secret' of the
+ * service in the form:
+ * array(
+ * 'key' => string
+ * 'secret' => string
+ * )
+ */
+ public function get_service_credentials();
+
+ /**
+ * Returns the results of the authentication in json format
+ *
+ * @throws \phpbb\auth\provider\oauth\service\exception
+ * @return string The unique identifier returned by the service provider
+ * that is used to authenticate the user with phpBB.
+ */
+ public function perform_auth_login();
+
+ /**
+ * Returns the results of the authentication in json format
+ * Use this function when the user already has an access token
+ *
+ * @throws \phpbb\auth\provider\oauth\service\exception
+ * @return string The unique identifier returned by the service provider
+ * that is used to authenticate the user with phpBB.
+ */
+ public function perform_token_auth();
+
+ /**
+ * Sets the external library service provider
+ *
+ * @param \OAuth\Common\Service\ServiceInterface $service_provider
+ */
+ public function set_external_service_provider(\OAuth\Common\Service\ServiceInterface $service_provider);
+}
diff --git a/phpBB/phpbb/auth/provider/oauth/token_storage.php b/phpBB/phpbb/auth/provider/oauth/token_storage.php
new file mode 100644
index 0000000000..9b6afae255
--- /dev/null
+++ b/phpBB/phpbb/auth/provider/oauth/token_storage.php
@@ -0,0 +1,364 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\auth\provider\oauth;
+
+use OAuth\OAuth1\Token\StdOAuth1Token;
+use OAuth\Common\Token\TokenInterface;
+use OAuth\Common\Storage\TokenStorageInterface;
+use OAuth\Common\Storage\Exception\TokenNotFoundException;
+
+/**
+* OAuth storage wrapper for phpbb's cache
+*/
+class token_storage implements TokenStorageInterface
+{
+ /**
+ * Cache driver.
+ *
+ * @var \phpbb\db\driver\driver_interface
+ */
+ protected $db;
+
+ /**
+ * phpBB user
+ *
+ * @var \phpbb\user
+ */
+ protected $user;
+
+ /**
+ * OAuth token table
+ *
+ * @var string
+ */
+ protected $auth_provider_oauth_table;
+
+ /**
+ * @var object|TokenInterface
+ */
+ protected $cachedToken;
+
+ /**
+ * Creates token storage for phpBB.
+ *
+ * @param \phpbb\db\driver\driver_interface $db
+ * @param \phpbb\user $user
+ * @param string $auth_provider_oauth_table
+ */
+ public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\user $user, $auth_provider_oauth_table)
+ {
+ $this->db = $db;
+ $this->user = $user;
+ $this->auth_provider_oauth_table = $auth_provider_oauth_table;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function retrieveAccessToken($service)
+ {
+ $service = $this->get_service_name_for_db($service);
+
+ if ($this->cachedToken instanceof TokenInterface)
+ {
+ return $this->cachedToken;
+ }
+
+ $data = array(
+ 'user_id' => (int) $this->user->data['user_id'],
+ 'provider' => $service,
+ );
+
+ if ((int) $this->user->data['user_id'] === ANONYMOUS)
+ {
+ $data['session_id'] = $this->user->data['session_id'];
+ }
+
+ return $this->_retrieve_access_token($data);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function storeAccessToken($service, TokenInterface $token)
+ {
+ $service = $this->get_service_name_for_db($service);
+
+ $this->cachedToken = $token;
+
+ $data = array(
+ 'user_id' => (int) $this->user->data['user_id'],
+ 'provider' => $service,
+ 'oauth_token' => $this->json_encode_token($token),
+ 'session_id' => $this->user->data['session_id'],
+ );
+
+ $sql = 'INSERT INTO ' . $this->auth_provider_oauth_table . '
+ ' . $this->db->sql_build_array('INSERT', $data);
+ $this->db->sql_query($sql);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function hasAccessToken($service)
+ {
+ $service = $this->get_service_name_for_db($service);
+
+ if ($this->cachedToken)
+ {
+ return true;
+ }
+
+ $data = array(
+ 'user_id' => (int) $this->user->data['user_id'],
+ 'provider' => $service,
+ );
+
+ if ((int) $this->user->data['user_id'] === ANONYMOUS)
+ {
+ $data['session_id'] = $this->user->data['session_id'];
+ }
+
+ return $this->_has_acess_token($data);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function clearToken($service)
+ {
+ $service = $this->get_service_name_for_db($service);
+
+ $this->cachedToken = null;
+
+ $sql = 'DELETE FROM ' . $this->auth_provider_oauth_table . '
+ WHERE user_id = ' . (int) $this->user->data['user_id'] . "
+ AND provider = '" . $this->db->sql_escape($service) . "'";
+
+ if ((int) $this->user->data['user_id'] === ANONYMOUS)
+ {
+ $sql .= " AND session_id = '" . $this->db->sql_escape($this->user->data['session_id']) . "'";
+ }
+
+ $this->db->sql_query($sql);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function clearAllTokens()
+ {
+ $this->cachedToken = null;
+
+ $sql = 'DELETE FROM ' . $this->auth_provider_oauth_table . '
+ WHERE user_id = ' . (int) $this->user->data['user_id'];
+
+ if ((int) $this->user->data['user_id'] === ANONYMOUS)
+ {
+ $sql .= " AND session_id = '" . $this->db->sql_escape($this->user->data['session_id']) . "'";
+ }
+
+ $this->db->sql_query($sql);
+ }
+
+ /**
+ * Updates the user_id field in the database assosciated with the token
+ *
+ * @param int $user_id
+ */
+ public function set_user_id($user_id)
+ {
+ if (!$this->cachedToken)
+ {
+ return;
+ }
+
+ $sql = 'UPDATE ' . $this->auth_provider_oauth_table . '
+ SET ' . $this->db->sql_build_array('UPDATE', array(
+ 'user_id' => (int) $user_id
+ )) . '
+ WHERE user_id = ' . (int) $this->user->data['user_id'] . "
+ AND session_id = '" . $this->db->sql_escape($this->user->data['session_id']) . "'";
+ $this->db->sql_query($sql);
+ }
+
+ /**
+ * Checks to see if an access token exists solely by the session_id of the user
+ *
+ * @param string $service The name of the OAuth service
+ * @return bool true if they have token, false if they don't
+ */
+ public function has_access_token_by_session($service)
+ {
+ $service = $this->get_service_name_for_db($service);
+
+ if ($this->cachedToken)
+ {
+ return true;
+ }
+
+ $data = array(
+ 'session_id' => $this->user->data['session_id'],
+ 'provider' => $service,
+ );
+
+ return $this->_has_acess_token($data);
+ }
+
+ /**
+ * A helper function that performs the query for has access token functions
+ *
+ * @param array $data
+ * @return bool
+ */
+ protected function _has_acess_token($data)
+ {
+ return (bool) $this->get_access_token_row($data);
+ }
+
+ public function retrieve_access_token_by_session($service)
+ {
+ $service = $this->get_service_name_for_db($service);
+
+ if ($this->cachedToken instanceof TokenInterface)
+ {
+ return $this->cachedToken;
+ }
+
+ $data = array(
+ 'session_id' => $this->user->data['session_id'],
+ 'provider' => $service,
+ );
+
+ return $this->_retrieve_access_token($data);
+ }
+
+ /**
+ * A helper function that performs the query for retrieve access token functions
+ * Also checks if the token is a valid token
+ *
+ * @param array $data
+ * @return mixed
+ * @throws \OAuth\Common\Storage\Exception\TokenNotFoundException
+ */
+ protected function _retrieve_access_token($data)
+ {
+ $row = $this->get_access_token_row($data);
+
+ if (!$row)
+ {
+ throw new TokenNotFoundException('AUTH_PROVIDER_OAUTH_TOKEN_ERROR_NOT_STORED');
+ }
+
+ $token = $this->json_decode_token($row['oauth_token']);
+
+ // Ensure that the token was serialized/unserialized correctly
+ if (!($token instanceof TokenInterface))
+ {
+ $this->clearToken($data['provider']);
+ throw new TokenNotFoundException('AUTH_PROVIDER_OAUTH_TOKEN_ERROR_INCORRECTLY_STORED');
+ }
+
+ $this->cachedToken = $token;
+ return $token;
+ }
+
+ /**
+ * A helper function that performs the query for retrieving an access token
+ *
+ * @param array $data
+ * @return mixed
+ */
+ protected function get_access_token_row($data)
+ {
+ $sql = 'SELECT oauth_token FROM ' . $this->auth_provider_oauth_table . '
+ WHERE ' . $this->db->sql_build_array('SELECT', $data);
+ $result = $this->db->sql_query($sql);
+ $row = $this->db->sql_fetchrow($result);
+ $this->db->sql_freeresult($result);
+
+ return $row;
+ }
+
+ public function json_encode_token(TokenInterface $token)
+ {
+ $members = array(
+ 'accessToken' => $token->getAccessToken(),
+ 'endOfLife' => $token->getEndOfLife(),
+ 'extraParams' => $token->getExtraParams(),
+ 'refreshToken' => $token->getRefreshToken(),
+
+ 'token_class' => get_class($token),
+ );
+
+ // Handle additional data needed for OAuth1 tokens
+ if ($token instanceof StdOAuth1Token)
+ {
+ $members['requestToken'] = $token->getRequestToken();
+ $members['requestTokenSecret'] = $token->getRequestTokenSecret();
+ $members['accessTokenSecret'] = $token->getAccessTokenSecret();
+ }
+
+ return json_encode($members);
+ }
+
+ public function json_decode_token($json)
+ {
+ $token_data = json_decode($json, true);
+
+ if ($token_data === null)
+ {
+ throw new TokenNotFoundException('AUTH_PROVIDER_OAUTH_TOKEN_ERROR_INCORRECTLY_STORED');
+ }
+
+ $token_class = $token_data['token_class'];
+ $access_token = $token_data['accessToken'];
+ $refresh_token = $token_data['refreshToken'];
+ $endOfLife = $token_data['endOfLife'];
+ $extra_params = $token_data['extraParams'];
+
+ // Create the token
+ $token = new $token_class($access_token, $refresh_token, TokenInterface::EOL_NEVER_EXPIRES, $extra_params);
+ $token->setEndOfLife($endOfLife);
+
+ // Handle OAuth 1.0 specific elements
+ if ($token instanceof StdOAuth1Token)
+ {
+ $token->setRequestToken($token_data['requestToken']);
+ $token->setRequestTokenSecret($token_data['requestTokenSecret']);
+ $token->setAccessTokenSecret($token_data['accessTokenSecret']);
+ }
+
+ return $token;
+ }
+
+ /**
+ * Returns the name of the service as it must be stored in the database.
+ *
+ * @param string $service The name of the OAuth service
+ * @return string The name of the OAuth service as it needs to be stored
+ * in the database.
+ */
+ protected function get_service_name_for_db($service)
+ {
+ // Enforce the naming convention for oauth services
+ if (strpos($service, 'auth.provider.oauth.service.') !== 0)
+ {
+ $service = 'auth.provider.oauth.service.' . strtolower($service);
+ }
+
+ return $service;
+ }
+}
diff --git a/phpBB/phpbb/auth/provider/provider_interface.php b/phpBB/phpbb/auth/provider/provider_interface.php
new file mode 100644
index 0000000000..35e0f559a1
--- /dev/null
+++ b/phpBB/phpbb/auth/provider/provider_interface.php
@@ -0,0 +1,197 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\auth\provider;
+
+/**
+* The interface authentication provider classes have to implement.
+*/
+interface provider_interface
+{
+ /**
+ * Checks whether the user is currently identified to the authentication
+ * provider.
+ * Called in acp_board while setting authentication plugins.
+ * Changing to an authentication provider will not be permitted in acp_board
+ * if there is an error.
+ *
+ * @return boolean|string False if the user is identified, otherwise an
+ * error message, or null if not implemented.
+ */
+ public function init();
+
+ /**
+ * Performs login.
+ *
+ * @param string $username The name of the user being authenticated.
+ * @param string $password The password of the user.
+ * @return array An associative array of the format:
+ * array(
+ * 'status' => status constant
+ * 'error_msg' => string
+ * 'user_row' => array
+ * )
+ * A fourth key of the array may be present:
+ * 'redirect_data' This key is only used when 'status' is
+ * equal to LOGIN_SUCCESS_LINK_PROFILE and its value is an
+ * associative array that is turned into GET variables on
+ * the redirect url.
+ */
+ public function login($username, $password);
+
+ /**
+ * Autologin function
+ *
+ * @return array|null containing the user row, empty if no auto login
+ * should take place, or null if not impletmented.
+ */
+ public function autologin();
+
+ /**
+ * This function is used to output any required fields in the authentication
+ * admin panel. It also defines any required configuration table fields.
+ *
+ * @return array|null Returns null if not implemented or an array of the
+ * configuration fields of the provider.
+ */
+ public function acp();
+
+ /**
+ * This function updates the template with variables related to the acp
+ * options with whatever configuraton values are passed to it as an array.
+ * It then returns the name of the acp file related to this authentication
+ * provider.
+ * @param array $new_config Contains the new configuration values that
+ * have been set in acp_board.
+ * @return array|null Returns null if not implemented or an array with
+ * the template file name and an array of the vars
+ * that the template needs that must conform to the
+ * following example:
+ * array(
+ * 'TEMPLATE_FILE' => string,
+ * 'TEMPLATE_VARS' => array(...),
+ * )
+ * An optional third element may be added to this
+ * array: 'BLOCK_VAR_NAME'. If this is present,
+ * then its value should be a string that is used
+ * to designate the name of the loop used in the
+ * ACP template file. When this is present, an
+ * additional key named 'BLOCK_VARS' is required.
+ * This must be an array containing at least one
+ * array of variables that will be assigned during
+ * the loop in the template. An example of this is
+ * presented below:
+ * array(
+ * 'BLOCK_VAR_NAME' => string,
+ * 'BLOCK_VARS' => array(
+ * 'KEY IS UNIMPORTANT' => array(...),
+ * ),
+ * 'TEMPLATE_FILE' => string,
+ * 'TEMPLATE_VARS' => array(...),
+ * )
+ */
+ public function get_acp_template($new_config);
+
+ /**
+ * Returns an array of data necessary to build custom elements on the login
+ * form.
+ *
+ * @return array|null If this function is not implemented on an auth
+ * provider then it returns null. If it is implemented
+ * it will return an array of up to four elements of
+ * which only 'TEMPLATE_FILE'. If 'BLOCK_VAR_NAME' is
+ * present then 'BLOCK_VARS' must also be present in
+ * the array. The fourth element 'VARS' is also
+ * optional. The array, with all four elements present
+ * looks like the following:
+ * array(
+ * 'TEMPLATE_FILE' => string,
+ * 'BLOCK_VAR_NAME' => string,
+ * 'BLOCK_VARS' => array(...),
+ * 'VARS' => array(...),
+ * )
+ */
+ public function get_login_data();
+
+ /**
+ * Performs additional actions during logout.
+ *
+ * @param array $data An array corresponding to
+ * \phpbb\session::data
+ * @param boolean $new_session True for a new session, false for no new
+ * session.
+ */
+ public function logout($data, $new_session);
+
+ /**
+ * The session validation function checks whether the user is still logged
+ * into phpBB.
+ *
+ * @param array $user
+ * @return boolean true if the given user is authenticated, false if the
+ * session should be closed, or null if not implemented.
+ */
+ public function validate_session($user);
+
+ /**
+ * Checks to see if $login_link_data contains all information except for the
+ * user_id of an account needed to successfully link an external account to
+ * a forum account.
+ *
+ * @param array $login_link_data Any data needed to link a phpBB account to
+ * an external account.
+ * @return string|null Returns a string with a language constant if there
+ * is data missing or null if there is no error.
+ */
+ public function login_link_has_necessary_data($login_link_data);
+
+ /**
+ * Links an external account to a phpBB account.
+ *
+ * @param array $link_data Any data needed to link a phpBB account to
+ * an external account.
+ */
+ public function link_account(array $link_data);
+
+ /**
+ * Returns an array of data necessary to build the ucp_auth_link page
+ *
+ * @param int $user_id User ID for whom the data should be retrieved.
+ * defaults to 0, which is not a valid ID. The method
+ * should fall back to the current user's ID in this
+ * case.
+ * @return array|null If this function is not implemented on an auth
+ * provider then it returns null. If it is implemented
+ * it will return an array of up to four elements of
+ * which only 'TEMPLATE_FILE'. If 'BLOCK_VAR_NAME' is
+ * present then 'BLOCK_VARS' must also be present in
+ * the array. The fourth element 'VARS' is also
+ * optional. The array, with all four elements present
+ * looks like the following:
+ * array(
+ * 'TEMPLATE_FILE' => string,
+ * 'BLOCK_VAR_NAME' => string,
+ * 'BLOCK_VARS' => array(...),
+ * 'VARS' => array(...),
+ * )
+ */
+ public function get_auth_link_data($user_id = 0);
+
+ /**
+ * Unlinks an external account from a phpBB account.
+ *
+ * @param array $link_data Any data needed to unlink a phpBB account
+ * from a phpbb account.
+ */
+ public function unlink_account(array $link_data);
+}
diff --git a/phpBB/phpbb/auth/provider_collection.php b/phpBB/phpbb/auth/provider_collection.php
new file mode 100644
index 0000000000..8e7e9e2cc1
--- /dev/null
+++ b/phpBB/phpbb/auth/provider_collection.php
@@ -0,0 +1,67 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\auth;
+
+use Symfony\Component\DependencyInjection\ContainerInterface;
+
+/**
+* Collection of auth providers to be configured at container compile time.
+*/
+class provider_collection extends \phpbb\di\service_collection
+{
+ /** @var \phpbb\config\config phpBB Config */
+ protected $config;
+
+ /**
+ * Constructor
+ *
+ * @param ContainerInterface $container Container object
+ * @param \phpbb\config\config $config phpBB config
+ */
+ public function __construct(ContainerInterface $container, \phpbb\config\config $config)
+ {
+ $this->container = $container;
+ $this->config = $config;
+ }
+
+ /**
+ * Get an auth provider.
+ *
+ * @param string $provider_name The name of the auth provider
+ * @return object Default auth provider selected in config if it
+ * does exist. Otherwise the standard db auth
+ * provider.
+ * @throws \RuntimeException If neither the auth provider that
+ * is specified by the phpBB config nor the db
+ * auth provider exist. The db auth provider
+ * should always exist in a phpBB installation.
+ */
+ public function get_provider($provider_name = '')
+ {
+ $provider_name = ($provider_name !== '') ? $provider_name : basename(trim($this->config['auth_method']));
+ if ($this->offsetExists('auth.provider.' . $provider_name))
+ {
+ return $this->offsetGet('auth.provider.' . $provider_name);
+ }
+ // Revert to db auth provider if selected method does not exist
+ else if ($this->offsetExists('auth.provider.db'))
+ {
+ return $this->offsetGet('auth.provider.db');
+ }
+ else
+ {
+ throw new \RuntimeException(sprintf('The authentication provider for the authentication method "%1$s" does not exist. It was not possible to recover from this by reverting to the database authentication provider.', $this->config['auth_method']));
+ }
+ }
+}
diff --git a/phpBB/phpbb/avatar/driver/driver.php b/phpBB/phpbb/avatar/driver/driver.php
new file mode 100644
index 0000000000..ad186635f2
--- /dev/null
+++ b/phpBB/phpbb/avatar/driver/driver.php
@@ -0,0 +1,147 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\avatar\driver;
+
+/**
+* Base class for avatar drivers
+*/
+abstract class driver implements \phpbb\avatar\driver\driver_interface
+{
+ /**
+ * Avatar driver name
+ * @var string
+ */
+ protected $name;
+
+ /**
+ * Current board configuration
+ * @var \phpbb\config\config
+ */
+ protected $config;
+
+ /**
+ * Current $phpbb_root_path
+ * @var string
+ */
+ protected $phpbb_root_path;
+
+ /**
+ * Current $php_ext
+ * @var string
+ */
+ protected $php_ext;
+
+ /**
+ * Path Helper
+ * @var \phpbb\path_helper
+ */
+ protected $path_helper;
+
+ /**
+ * Cache driver
+ * @var \phpbb\cache\driver\driver_interface
+ */
+ protected $cache;
+
+ /**
+ * Array of allowed avatar image extensions
+ * Array is used for setting the allowed extensions in the fileupload class
+ * and as a base for a regex of allowed extensions, which will be formed by
+ * imploding the array with a "|".
+ *
+ * @var array
+ */
+ protected $allowed_extensions = array(
+ 'gif',
+ 'jpg',
+ 'jpeg',
+ 'png',
+ );
+
+ /**
+ * Construct a driver object
+ *
+ * @param \phpbb\config\config $config phpBB configuration
+ * @param string $phpbb_root_path Path to the phpBB root
+ * @param string $php_ext PHP file extension
+ * @param \phpbb\path_helper $path_helper phpBB path helper
+ * @param \phpbb\cache\driver\driver_interface $cache Cache driver
+ */
+ public function __construct(\phpbb\config\config $config, $phpbb_root_path, $php_ext, \phpbb\path_helper $path_helper, \phpbb\cache\driver\driver_interface $cache = null)
+ {
+ $this->config = $config;
+ $this->phpbb_root_path = $phpbb_root_path;
+ $this->php_ext = $php_ext;
+ $this->path_helper = $path_helper;
+ $this->cache = $cache;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_custom_html($user, $row, $alt = '')
+ {
+ return '';
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function prepare_form_acp($user)
+ {
+ return array();
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function delete($row)
+ {
+ return true;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_name()
+ {
+ return $this->name;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_config_name()
+ {
+ return preg_replace('#^phpbb\\\\avatar\\\\driver\\\\#', '', get_class($this));
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_acp_template_name()
+ {
+ return 'acp_avatar_options_' . $this->get_config_name() . '.html';
+ }
+
+ /**
+ * Sets the name of the driver.
+ *
+ * @param string $name Driver name
+ */
+ public function set_name($name)
+ {
+ $this->name = $name;
+ }
+}
diff --git a/phpBB/phpbb/avatar/driver/driver_interface.php b/phpBB/phpbb/avatar/driver/driver_interface.php
new file mode 100644
index 0000000000..7d6c2cff8a
--- /dev/null
+++ b/phpBB/phpbb/avatar/driver/driver_interface.php
@@ -0,0 +1,127 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\avatar\driver;
+
+/**
+* Interface for avatar drivers
+*/
+interface driver_interface
+{
+ /**
+ * Returns the name of the driver.
+ *
+ * @return string Name of driver.
+ */
+ public function get_name();
+
+ /**
+ * Returns the config name of the driver. To be used in accessing the CONFIG variables.
+ *
+ * @return string Config name of driver.
+ */
+ public function get_config_name();
+
+ /**
+ * Get the avatar url and dimensions
+ *
+ * @param array $row User data or group data that has been cleaned with
+ * \phpbb\avatar\manager::clean_row
+ * @return array Avatar data, must have keys src, width and height, e.g.
+ * ['src' => '', 'width' => 0, 'height' => 0]
+ */
+ public function get_data($row);
+
+ /**
+ * Returns custom html if it is needed for displaying this avatar
+ *
+ * @param \phpbb\user $user phpBB user object
+ * @param array $row User data or group data that has been cleaned with
+ * \phpbb\avatar\manager::clean_row
+ * @param string $alt Alternate text for avatar image
+ *
+ * @return string HTML
+ */
+ public function get_custom_html($user, $row, $alt = '');
+
+ /**
+ * Prepare form for changing the settings of this avatar
+ *
+ * @param \phpbb\request\request $request Request object
+ * @param \phpbb\template\template $template Template object
+ * @param \phpbb\user $user User object
+ * @param array $row User data or group data that has been cleaned with
+ * \phpbb\avatar\manager::clean_row
+ * @param array &$error Reference to an error array that is filled by this
+ * function. Key values can either be a string with a language key or
+ * an array that will be passed to vsprintf() with the language key in
+ * the first array key.
+ *
+ * @return bool True if form has been successfully prepared
+ */
+ public function prepare_form($request, $template, $user, $row, &$error);
+
+ /**
+ * Prepare form for changing the acp settings of this avatar
+ *
+ * @param \phpbb\user $user phpBB user object
+ *
+ * @return array Array of configuration options as consumed by acp_board.
+ * The setting for enabling/disabling the avatar will be handled by
+ * the avatar manager.
+ */
+ public function prepare_form_acp($user);
+
+ /**
+ * Process form data
+ *
+ * @param \phpbb\request\request $request Request object
+ * @param \phpbb\template\template $template Template object
+ * @param \phpbb\user $user User object
+ * @param array $row User data or group data that has been cleaned with
+ * \phpbb\avatar\manager::clean_row
+ * @param array &$error Reference to an error array that is filled by this
+ * function. Key values can either be a string with a language key or
+ * an array that will be passed to vsprintf() with the language key in
+ * the first array key.
+ *
+ * @return array Array containing the avatar data as follows:
+ * ['avatar'], ['avatar_width'], ['avatar_height']
+ */
+ public function process_form($request, $template, $user, $row, &$error);
+
+ /**
+ * Delete avatar
+ *
+ * @param array $row User data or group data that has been cleaned with
+ * \phpbb\avatar\manager::clean_row
+ *
+ * @return bool True if avatar has been deleted or there is no need to delete,
+ * i.e. when the avatar is not hosted locally.
+ */
+ public function delete($row);
+
+ /**
+ * Get the avatar driver's template name
+ *
+ * @return string Avatar driver's template name
+ */
+ public function get_template_name();
+
+ /**
+ * Get the avatar driver's template name (ACP)
+ *
+ * @return string Avatar driver's template name
+ */
+ public function get_acp_template_name();
+}
diff --git a/phpBB/phpbb/avatar/driver/gravatar.php b/phpBB/phpbb/avatar/driver/gravatar.php
new file mode 100644
index 0000000000..7a43b55852
--- /dev/null
+++ b/phpBB/phpbb/avatar/driver/gravatar.php
@@ -0,0 +1,198 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\avatar\driver;
+
+/**
+* Handles avatars hosted at gravatar.com
+*/
+class gravatar extends \phpbb\avatar\driver\driver
+{
+ /**
+ * The URL for the gravatar service
+ */
+ const GRAVATAR_URL = '//secure.gravatar.com/avatar/';
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_data($row)
+ {
+ return array(
+ 'src' => $row['avatar'],
+ 'width' => $row['avatar_width'],
+ 'height' => $row['avatar_height'],
+ );
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_custom_html($user, $row, $alt = '')
+ {
+ return '<img src="' . $this->get_gravatar_url($row) . '" ' .
+ ($row['avatar_width'] ? ('width="' . $row['avatar_width'] . '" ') : '') .
+ ($row['avatar_height'] ? ('height="' . $row['avatar_height'] . '" ') : '') .
+ 'alt="' . ((!empty($user->lang[$alt])) ? $user->lang[$alt] : $alt) . '" />';
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function prepare_form($request, $template, $user, $row, &$error)
+ {
+ $template->assign_vars(array(
+ 'AVATAR_GRAVATAR_WIDTH' => (($row['avatar_type'] == $this->get_name() || $row['avatar_type'] == 'gravatar') && $row['avatar_width']) ? $row['avatar_width'] : $request->variable('avatar_gravatar_width', ''),
+ 'AVATAR_GRAVATAR_HEIGHT' => (($row['avatar_type'] == $this->get_name() || $row['avatar_type'] == 'gravatar') && $row['avatar_height']) ? $row['avatar_height'] : $request->variable('avatar_gravatar_width', ''),
+ 'AVATAR_GRAVATAR_EMAIL' => (($row['avatar_type'] == $this->get_name() || $row['avatar_type'] == 'gravatar') && $row['avatar']) ? $row['avatar'] : '',
+ ));
+
+ return true;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function process_form($request, $template, $user, $row, &$error)
+ {
+ $row['avatar'] = $request->variable('avatar_gravatar_email', '');
+ $row['avatar_width'] = $request->variable('avatar_gravatar_width', 0);
+ $row['avatar_height'] = $request->variable('avatar_gravatar_height', 0);
+
+ if (empty($row['avatar']))
+ {
+ return false;
+ }
+
+ if (!function_exists('validate_data'))
+ {
+ require($this->phpbb_root_path . 'includes/functions_user.' . $this->php_ext);
+ }
+
+ $validate_array = validate_data(
+ array(
+ 'email' => $row['avatar'],
+ ),
+ array(
+ 'email' => array(
+ array('string', false, 6, 60),
+ array('email'),
+ ),
+ )
+ );
+
+ $error = array_merge($error, $validate_array);
+
+ if (!empty($error))
+ {
+ return false;
+ }
+
+ // Make sure getimagesize works...
+ if (function_exists('getimagesize') && ($row['avatar_width'] <= 0 || $row['avatar_height'] <= 0))
+ {
+ /**
+ * default to the minimum of the maximum allowed avatar size if the size
+ * is not or only partially entered
+ */
+ $row['avatar_width'] = $row['avatar_height'] = min($this->config['avatar_max_width'], $this->config['avatar_max_height']);
+ $url = $this->get_gravatar_url($row);
+
+ if (($row['avatar_width'] <= 0 || $row['avatar_height'] <= 0) && (($image_data = getimagesize($url)) === false))
+ {
+ $error[] = 'UNABLE_GET_IMAGE_SIZE';
+ return false;
+ }
+
+ if (!empty($image_data) && ($image_data[0] <= 0 || $image_data[1] <= 0))
+ {
+ $error[] = 'AVATAR_NO_SIZE';
+ return false;
+ }
+
+ $row['avatar_width'] = ($row['avatar_width'] && $row['avatar_height']) ? $row['avatar_width'] : $image_data[0];
+ $row['avatar_height'] = ($row['avatar_width'] && $row['avatar_height']) ? $row['avatar_height'] : $image_data[1];
+ }
+
+ if ($row['avatar_width'] <= 0 || $row['avatar_height'] <= 0)
+ {
+ $error[] = 'AVATAR_NO_SIZE';
+ return false;
+ }
+
+ if ($this->config['avatar_max_width'] || $this->config['avatar_max_height'])
+ {
+ if ($row['avatar_width'] > $this->config['avatar_max_width'] || $row['avatar_height'] > $this->config['avatar_max_height'])
+ {
+ $error[] = array('AVATAR_WRONG_SIZE', $this->config['avatar_min_width'], $this->config['avatar_min_height'], $this->config['avatar_max_width'], $this->config['avatar_max_height'], $row['avatar_width'], $row['avatar_height']);
+ return false;
+ }
+ }
+
+ if ($this->config['avatar_min_width'] || $this->config['avatar_min_height'])
+ {
+ if ($row['avatar_width'] < $this->config['avatar_min_width'] || $row['avatar_height'] < $this->config['avatar_min_height'])
+ {
+ $error[] = array('AVATAR_WRONG_SIZE', $this->config['avatar_min_width'], $this->config['avatar_min_height'], $this->config['avatar_max_width'], $this->config['avatar_max_height'], $row['avatar_width'], $row['avatar_height']);
+ return false;
+ }
+ }
+
+ return array(
+ 'avatar' => $row['avatar'],
+ 'avatar_width' => $row['avatar_width'],
+ 'avatar_height' => $row['avatar_height'],
+ );
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_template_name()
+ {
+ return 'ucp_avatar_options_gravatar.html';
+ }
+
+ /**
+ * Build gravatar URL for output on page
+ *
+ * @param array $row User data or group data that has been cleaned with
+ * \phpbb\avatar\manager::clean_row
+ * @return string Gravatar URL
+ */
+ protected function get_gravatar_url($row)
+ {
+ global $phpbb_dispatcher;
+
+ $url = self::GRAVATAR_URL;
+ $url .= md5(strtolower(trim($row['avatar'])));
+
+ if ($row['avatar_width'] || $row['avatar_height'])
+ {
+ $url .= '?s=' . max($row['avatar_width'], $row['avatar_height']);
+ }
+
+ /**
+ * Modify gravatar url
+ *
+ * @event core.get_gravatar_url_after
+ * @var string row User data or group data
+ * @var string url Gravatar URL
+ * @since 3.1.7-RC1
+ */
+ $vars = array('row', 'url');
+ extract($phpbb_dispatcher->trigger_event('core.get_gravatar_url_after', compact($vars)));
+
+ return $url;
+ }
+}
diff --git a/phpBB/phpbb/avatar/driver/local.php b/phpBB/phpbb/avatar/driver/local.php
new file mode 100644
index 0000000000..75c384f31e
--- /dev/null
+++ b/phpBB/phpbb/avatar/driver/local.php
@@ -0,0 +1,205 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\avatar\driver;
+
+/**
+* Handles avatars selected from the board gallery
+*/
+class local extends \phpbb\avatar\driver\driver
+{
+ /**
+ * {@inheritdoc}
+ */
+ public function get_data($row)
+ {
+ $root_path = (defined('PHPBB_USE_BOARD_URL_PATH') && PHPBB_USE_BOARD_URL_PATH) ? generate_board_url() . '/' : $this->path_helper->get_web_root_path();
+
+ return array(
+ 'src' => $root_path . $this->config['avatar_gallery_path'] . '/' . $row['avatar'],
+ 'width' => $row['avatar_width'],
+ 'height' => $row['avatar_height'],
+ );
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function prepare_form($request, $template, $user, $row, &$error)
+ {
+ $avatar_list = $this->get_avatar_list($user);
+ $category = $request->variable('avatar_local_cat', key($avatar_list));
+
+ foreach ($avatar_list as $cat => $null)
+ {
+ if (!empty($avatar_list[$cat]))
+ {
+ $template->assign_block_vars('avatar_local_cats', array(
+ 'NAME' => $cat,
+ 'SELECTED' => ($cat == $category),
+ ));
+ }
+
+ if ($cat != $category)
+ {
+ unset($avatar_list[$cat]);
+ }
+ }
+
+ if (!empty($avatar_list[$category]))
+ {
+ $template->assign_vars(array(
+ 'AVATAR_LOCAL_SHOW' => true,
+ ));
+
+ $table_cols = isset($row['avatar_gallery_cols']) ? $row['avatar_gallery_cols'] : 4;
+ $row_count = $col_count = $avatar_pos = 0;
+ $avatar_count = sizeof($avatar_list[$category]);
+
+ reset($avatar_list[$category]);
+
+ while ($avatar_pos < $avatar_count)
+ {
+ $img = current($avatar_list[$category]);
+ next($avatar_list[$category]);
+
+ if ($col_count == 0)
+ {
+ ++$row_count;
+ $template->assign_block_vars('avatar_local_row', array(
+ ));
+ }
+
+ $template->assign_block_vars('avatar_local_row.avatar_local_col', array(
+ 'AVATAR_IMAGE' => $this->phpbb_root_path . $this->config['avatar_gallery_path'] . '/' . $img['file'],
+ 'AVATAR_NAME' => $img['name'],
+ 'AVATAR_FILE' => $img['filename'],
+ 'CHECKED' => $img['file'] === $row['avatar'],
+ ));
+
+ $template->assign_block_vars('avatar_local_row.avatar_local_option', array(
+ 'AVATAR_FILE' => $img['filename'],
+ 'S_OPTIONS_AVATAR' => $img['filename'],
+ 'CHECKED' => $img['file'] === $row['avatar'],
+ ));
+
+ $col_count = ($col_count + 1) % $table_cols;
+
+ ++$avatar_pos;
+ }
+ }
+
+ return true;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function prepare_form_acp($user)
+ {
+ return array(
+ 'avatar_gallery_path' => array('lang' => 'AVATAR_GALLERY_PATH', 'validate' => 'rpath', 'type' => 'text:20:255', 'explain' => true),
+ );
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function process_form($request, $template, $user, $row, &$error)
+ {
+ $avatar_list = $this->get_avatar_list($user);
+ $category = $request->variable('avatar_local_cat', '');
+
+ $file = $request->variable('avatar_local_file', '');
+
+ if (empty($category) || empty($file))
+ {
+ return false;
+ }
+
+ if (!isset($avatar_list[$category][urldecode($file)]))
+ {
+ $error[] = 'AVATAR_URL_NOT_FOUND';
+ return false;
+ }
+
+ return array(
+ 'avatar' => ($category != $user->lang['NO_AVATAR_CATEGORY']) ? $category . '/' . $file : $file,
+ 'avatar_width' => $avatar_list[$category][urldecode($file)]['width'],
+ 'avatar_height' => $avatar_list[$category][urldecode($file)]['height'],
+ );
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_template_name()
+ {
+ return 'ucp_avatar_options_local.html';
+ }
+
+ /**
+ * Get a list of avatars that are locally available
+ * Results get cached for 24 hours (86400 seconds)
+ *
+ * @param \phpbb\user $user User object
+ *
+ * @return array Array containing the locally available avatars
+ */
+ protected function get_avatar_list($user)
+ {
+ $avatar_list = ($this->cache == null) ? false : $this->cache->get('_avatar_local_list');
+
+ if ($avatar_list === false)
+ {
+ $avatar_list = array();
+ $path = $this->phpbb_root_path . $this->config['avatar_gallery_path'];
+
+ $iterator = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($path, \FilesystemIterator::SKIP_DOTS | \FilesystemIterator::UNIX_PATHS), \RecursiveIteratorIterator::SELF_FIRST);
+ foreach ($iterator as $file_info)
+ {
+ $file_path = $file_info->getPath();
+ $image = $file_info->getFilename();
+
+ // Match all images in the gallery folder
+ if (preg_match('#^[^&\'"<>]+\.(?:' . implode('|', $this->allowed_extensions) . ')$#i', $image) && is_file($file_path . '/' . $image))
+ {
+ if (function_exists('getimagesize'))
+ {
+ $dims = getimagesize($file_path . '/' . $image);
+ }
+ else
+ {
+ $dims = array(0, 0);
+ }
+ $cat = ($path == $file_path) ? $user->lang['NO_AVATAR_CATEGORY'] : str_replace("$path/", '', $file_path);
+ $avatar_list[$cat][$image] = array(
+ 'file' => ($cat != $user->lang['NO_AVATAR_CATEGORY']) ? str_replace('%2F', '/', rawurlencode($cat)) . '/' . rawurlencode($image) : rawurlencode($image),
+ 'filename' => rawurlencode($image),
+ 'name' => ucfirst(str_replace('_', ' ', preg_replace('#^(.*)\..*$#', '\1', $image))),
+ 'width' => $dims[0],
+ 'height' => $dims[1],
+ );
+ }
+ }
+ ksort($avatar_list);
+
+ if ($this->cache != null)
+ {
+ $this->cache->put('_avatar_local_list', $avatar_list, 86400);
+ }
+ }
+
+ return $avatar_list;
+ }
+}
diff --git a/phpBB/phpbb/avatar/driver/remote.php b/phpBB/phpbb/avatar/driver/remote.php
new file mode 100644
index 0000000000..2811cc2389
--- /dev/null
+++ b/phpBB/phpbb/avatar/driver/remote.php
@@ -0,0 +1,224 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\avatar\driver;
+
+/**
+* Handles avatars hosted remotely
+*/
+class remote extends \phpbb\avatar\driver\driver
+{
+ /**
+ * {@inheritdoc}
+ */
+ public function get_data($row)
+ {
+ return array(
+ 'src' => $row['avatar'],
+ 'width' => $row['avatar_width'],
+ 'height' => $row['avatar_height'],
+ );
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function prepare_form($request, $template, $user, $row, &$error)
+ {
+ $template->assign_vars(array(
+ 'AVATAR_REMOTE_WIDTH' => ((in_array($row['avatar_type'], array(AVATAR_REMOTE, $this->get_name(), 'remote'))) && $row['avatar_width']) ? $row['avatar_width'] : $request->variable('avatar_remote_width', ''),
+ 'AVATAR_REMOTE_HEIGHT' => ((in_array($row['avatar_type'], array(AVATAR_REMOTE, $this->get_name(), 'remote'))) && $row['avatar_height']) ? $row['avatar_height'] : $request->variable('avatar_remote_width', ''),
+ 'AVATAR_REMOTE_URL' => ((in_array($row['avatar_type'], array(AVATAR_REMOTE, $this->get_name(), 'remote'))) && $row['avatar']) ? $row['avatar'] : '',
+ ));
+
+ return true;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function process_form($request, $template, $user, $row, &$error)
+ {
+ $url = $request->variable('avatar_remote_url', '');
+ $width = $request->variable('avatar_remote_width', 0);
+ $height = $request->variable('avatar_remote_height', 0);
+
+ if (empty($url))
+ {
+ return false;
+ }
+
+ if (!preg_match('#^(http|https|ftp)://#i', $url))
+ {
+ $url = 'http://' . $url;
+ }
+
+ if (!function_exists('validate_data'))
+ {
+ require($this->phpbb_root_path . 'includes/functions_user.' . $this->php_ext);
+ }
+
+ $validate_array = validate_data(
+ array(
+ 'url' => $url,
+ ),
+ array(
+ 'url' => array('string', true, 5, 255),
+ )
+ );
+
+ $error = array_merge($error, $validate_array);
+
+ if (!empty($error))
+ {
+ return false;
+ }
+
+ // Check if this url looks alright
+ // Do not allow specifying the port (see RFC 3986) or IP addresses
+ if (!preg_match('#^(http|https|ftp)://(?:(.*?\.)*?[a-z0-9\-]+?\.[a-z]{2,4}|(?:\d{1,3}\.){3,5}\d{1,3}):?([0-9]*?).*?\.('. implode('|', $this->allowed_extensions) . ')$#i', $url) ||
+ preg_match('@^(http|https|ftp)://[^/:?#]+:[0-9]+[/:?#]@i', $url) ||
+ preg_match('#^(http|https|ftp)://(?:(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.){3}(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])#i', $url) ||
+ preg_match('#^(http|https|ftp)://(?:(?:(?:[\dA-F]{1,4}:){6}(?:[\dA-F]{1,4}:[\dA-F]{1,4}|(?:(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.){3}(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])))|(?:::(?:[\dA-F]{1,4}:){0,5}(?:[\dA-F]{1,4}(?::[\dA-F]{1,4})?|(?:(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.){3}(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])))|(?:(?:[\dA-F]{1,4}:):(?:[\dA-F]{1,4}:){4}(?:[\dA-F]{1,4}:[\dA-F]{1,4}|(?:(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.){3}(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])))|(?:(?:[\dA-F]{1,4}:){1,2}:(?:[\dA-F]{1,4}:){3}(?:[\dA-F]{1,4}:[\dA-F]{1,4}|(?:(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.){3}(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])))|(?:(?:[\dA-F]{1,4}:){1,3}:(?:[\dA-F]{1,4}:){2}(?:[\dA-F]{1,4}:[\dA-F]{1,4}|(?:(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.){3}(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])))|(?:(?:[\dA-F]{1,4}:){1,4}:(?:[\dA-F]{1,4}:)(?:[\dA-F]{1,4}:[\dA-F]{1,4}|(?:(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.){3}(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])))|(?:(?:[\dA-F]{1,4}:){1,5}:(?:[\dA-F]{1,4}:[\dA-F]{1,4}|(?:(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.){3}(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])))|(?:(?:[\dA-F]{1,4}:){1,6}:[\dA-F]{1,4})|(?:(?:[\dA-F]{1,4}:){1,7}:)|(?:::))#i', $url))
+ {
+ $error[] = 'AVATAR_URL_INVALID';
+ return false;
+ }
+
+ // Make sure getimagesize works...
+ if (function_exists('getimagesize'))
+ {
+ if (($width <= 0 || $height <= 0) && (($image_data = @getimagesize($url)) === false))
+ {
+ $error[] = 'UNABLE_GET_IMAGE_SIZE';
+ return false;
+ }
+
+ if (!empty($image_data) && ($image_data[0] <= 0 || $image_data[1] <= 0))
+ {
+ $error[] = 'AVATAR_NO_SIZE';
+ return false;
+ }
+
+ $width = ($width && $height) ? $width : $image_data[0];
+ $height = ($width && $height) ? $height : $image_data[1];
+ }
+
+ if ($width <= 0 || $height <= 0)
+ {
+ $error[] = 'AVATAR_NO_SIZE';
+ return false;
+ }
+
+ if (!class_exists('fileupload'))
+ {
+ include($this->phpbb_root_path . 'includes/functions_upload.' . $this->php_ext);
+ }
+
+ $types = \fileupload::image_types();
+ $extension = strtolower(\filespec::get_extension($url));
+
+ // Check if this is actually an image
+ if ($file_stream = @fopen($url, 'r'))
+ {
+ // Timeout after 1 second
+ stream_set_timeout($file_stream, 1);
+ // read some data to ensure headers are present
+ fread($file_stream, 1024);
+ $meta = stream_get_meta_data($file_stream);
+
+ if (isset($meta['wrapper_data']['headers']) && is_array($meta['wrapper_data']['headers']))
+ {
+ $headers = $meta['wrapper_data']['headers'];
+ }
+ else if (isset($meta['wrapper_data']) && is_array($meta['wrapper_data']))
+ {
+ $headers = $meta['wrapper_data'];
+ }
+ else
+ {
+ $headers = array();
+ }
+
+ foreach ($headers as $header)
+ {
+ $header = preg_split('/ /', $header, 2);
+ if (strtr(strtolower(trim($header[0], ':')), '_', '-') === 'content-type')
+ {
+ if (strpos($header[1], 'image/') !== 0)
+ {
+ $error[] = 'AVATAR_URL_INVALID';
+ fclose($file_stream);
+ return false;
+ }
+ else
+ {
+ fclose($file_stream);
+ break;
+ }
+ }
+ }
+ }
+ else
+ {
+ $error[] = 'AVATAR_URL_INVALID';
+ return false;
+ }
+
+ if (!empty($image_data) && (!isset($types[$image_data[2]]) || !in_array($extension, $types[$image_data[2]])))
+ {
+ if (!isset($types[$image_data[2]]))
+ {
+ $error[] = 'UNABLE_GET_IMAGE_SIZE';
+ }
+ else
+ {
+ $error[] = array('IMAGE_FILETYPE_MISMATCH', $types[$image_data[2]][0], $extension);
+ }
+
+ return false;
+ }
+
+ if ($this->config['avatar_max_width'] || $this->config['avatar_max_height'])
+ {
+ if ($width > $this->config['avatar_max_width'] || $height > $this->config['avatar_max_height'])
+ {
+ $error[] = array('AVATAR_WRONG_SIZE', $this->config['avatar_min_width'], $this->config['avatar_min_height'], $this->config['avatar_max_width'], $this->config['avatar_max_height'], $width, $height);
+ return false;
+ }
+ }
+
+ if ($this->config['avatar_min_width'] || $this->config['avatar_min_height'])
+ {
+ if ($width < $this->config['avatar_min_width'] || $height < $this->config['avatar_min_height'])
+ {
+ $error[] = array('AVATAR_WRONG_SIZE', $this->config['avatar_min_width'], $this->config['avatar_min_height'], $this->config['avatar_max_width'], $this->config['avatar_max_height'], $width, $height);
+ return false;
+ }
+ }
+
+ return array(
+ 'avatar' => $url,
+ 'avatar_width' => $width,
+ 'avatar_height' => $height,
+ );
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_template_name()
+ {
+ return 'ucp_avatar_options_remote.html';
+ }
+}
diff --git a/phpBB/phpbb/avatar/driver/upload.php b/phpBB/phpbb/avatar/driver/upload.php
new file mode 100644
index 0000000000..0dae5607f6
--- /dev/null
+++ b/phpBB/phpbb/avatar/driver/upload.php
@@ -0,0 +1,307 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\avatar\driver;
+
+/**
+* Handles avatars uploaded to the board
+*/
+class upload extends \phpbb\avatar\driver\driver
+{
+ /**
+ * @var \phpbb\mimetype\guesser
+ */
+ protected $mimetype_guesser;
+
+ /**
+ * @var \phpbb\event\dispatcher_interface
+ */
+ protected $dispatcher;
+
+ /**
+ * Construct a driver object
+ *
+ * @param \phpbb\config\config $config phpBB configuration
+ * @param string $phpbb_root_path Path to the phpBB root
+ * @param string $php_ext PHP file extension
+ * @param \phpbb_path_helper $path_helper phpBB path helper
+ * @param \phpbb\mimetype\guesser $mimetype_guesser Mimetype guesser
+ * @param \phpbb\event\dispatcher_interface $dispatcher phpBB Event dispatcher object
+ * @param \phpbb\cache\driver\driver_interface $cache Cache driver
+ */
+ public function __construct(\phpbb\config\config $config, $phpbb_root_path, $php_ext, \phpbb\path_helper $path_helper, \phpbb\mimetype\guesser $mimetype_guesser, \phpbb\event\dispatcher_interface $dispatcher, \phpbb\cache\driver\driver_interface $cache = null)
+ {
+ $this->config = $config;
+ $this->phpbb_root_path = $phpbb_root_path;
+ $this->php_ext = $php_ext;
+ $this->path_helper = $path_helper;
+ $this->mimetype_guesser = $mimetype_guesser;
+ $this->dispatcher = $dispatcher;
+ $this->cache = $cache;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_data($row)
+ {
+ $root_path = (defined('PHPBB_USE_BOARD_URL_PATH') && PHPBB_USE_BOARD_URL_PATH) ? generate_board_url() . '/' : $this->path_helper->get_web_root_path();
+
+ return array(
+ 'src' => $root_path . 'download/file.' . $this->php_ext . '?avatar=' . $row['avatar'],
+ 'width' => $row['avatar_width'],
+ 'height' => $row['avatar_height'],
+ );
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function prepare_form($request, $template, $user, $row, &$error)
+ {
+ if (!$this->can_upload())
+ {
+ return false;
+ }
+
+ $template->assign_vars(array(
+ 'S_UPLOAD_AVATAR_URL' => ($this->config['allow_avatar_remote_upload']) ? true : false,
+ 'AVATAR_UPLOAD_SIZE' => $this->config['avatar_filesize'],
+ ));
+
+ return true;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function process_form($request, $template, $user, $row, &$error)
+ {
+ if (!$this->can_upload())
+ {
+ return false;
+ }
+
+ if (!class_exists('fileupload'))
+ {
+ include($this->phpbb_root_path . 'includes/functions_upload.' . $this->php_ext);
+ }
+
+ $upload = new \fileupload('AVATAR_', $this->allowed_extensions, $this->config['avatar_filesize'], $this->config['avatar_min_width'], $this->config['avatar_min_height'], $this->config['avatar_max_width'], $this->config['avatar_max_height'], (isset($this->config['mime_triggers']) ? explode('|', $this->config['mime_triggers']) : false));
+
+ $url = $request->variable('avatar_upload_url', '');
+ $upload_file = $request->file('avatar_upload_file');
+
+ if (!empty($upload_file['name']))
+ {
+ $file = $upload->form_upload('avatar_upload_file', $this->mimetype_guesser);
+ }
+ else if (!empty($this->config['allow_avatar_remote_upload']) && !empty($url))
+ {
+ if (!preg_match('#^(http|https|ftp)://#i', $url))
+ {
+ $url = 'http://' . $url;
+ }
+
+ if (!function_exists('validate_data'))
+ {
+ require($this->phpbb_root_path . 'includes/functions_user.' . $this->php_ext);
+ }
+
+ $validate_array = validate_data(
+ array(
+ 'url' => $url,
+ ),
+ array(
+ 'url' => array('string', true, 5, 255),
+ )
+ );
+
+ $error = array_merge($error, $validate_array);
+
+ if (!empty($error))
+ {
+ return false;
+ }
+
+ // Do not allow specifying the port (see RFC 3986) or IP addresses
+ // remote_upload() will do its own check for allowed filetypes
+ if (preg_match('@^(http|https|ftp)://[^/:?#]+:[0-9]+[/:?#]@i', $url) ||
+ preg_match('#^(http|https|ftp)://(?:(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.){3}(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])#i', $url) ||
+ preg_match('#^(http|https|ftp)://(?:(?:(?:[\dA-F]{1,4}:){6}(?:[\dA-F]{1,4}:[\dA-F]{1,4}|(?:(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.){3}(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])))|(?:::(?:[\dA-F]{1,4}:){0,5}(?:[\dA-F]{1,4}(?::[\dA-F]{1,4})?|(?:(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.){3}(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])))|(?:(?:[\dA-F]{1,4}:):(?:[\dA-F]{1,4}:){4}(?:[\dA-F]{1,4}:[\dA-F]{1,4}|(?:(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.){3}(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])))|(?:(?:[\dA-F]{1,4}:){1,2}:(?:[\dA-F]{1,4}:){3}(?:[\dA-F]{1,4}:[\dA-F]{1,4}|(?:(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.){3}(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])))|(?:(?:[\dA-F]{1,4}:){1,3}:(?:[\dA-F]{1,4}:){2}(?:[\dA-F]{1,4}:[\dA-F]{1,4}|(?:(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.){3}(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])))|(?:(?:[\dA-F]{1,4}:){1,4}:(?:[\dA-F]{1,4}:)(?:[\dA-F]{1,4}:[\dA-F]{1,4}|(?:(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.){3}(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])))|(?:(?:[\dA-F]{1,4}:){1,5}:(?:[\dA-F]{1,4}:[\dA-F]{1,4}|(?:(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.){3}(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])))|(?:(?:[\dA-F]{1,4}:){1,6}:[\dA-F]{1,4})|(?:(?:[\dA-F]{1,4}:){1,7}:)|(?:::))#i', $url))
+ {
+ $error[] = 'AVATAR_URL_INVALID';
+ return false;
+ }
+
+ $file = $upload->remote_upload($url, $this->mimetype_guesser);
+ }
+ else
+ {
+ return false;
+ }
+
+ $prefix = $this->config['avatar_salt'] . '_';
+ $file->clean_filename('avatar', $prefix, $row['id']);
+
+ // If there was an error during upload, then abort operation
+ if (sizeof($file->error))
+ {
+ $file->remove();
+ $error = $file->error;
+ return false;
+ }
+
+ // Calculate new destination
+ $destination = $this->config['avatar_path'];
+
+ // Adjust destination path (no trailing slash)
+ if (substr($destination, -1, 1) == '/' || substr($destination, -1, 1) == '\\')
+ {
+ $destination = substr($destination, 0, -1);
+ }
+
+ $destination = str_replace(array('../', '..\\', './', '.\\'), '', $destination);
+ if ($destination && ($destination[0] == '/' || $destination[0] == "\\"))
+ {
+ $destination = '';
+ }
+
+ $filedata = array(
+ 'filename' => $file->get('filename'),
+ 'filesize' => $file->get('filesize'),
+ 'mimetype' => $file->get('mimetype'),
+ 'extension' => $file->get('extension'),
+ 'physical_filename' => $file->get('realname'),
+ 'real_filename' => $file->get('uploadname'),
+ );
+
+ /**
+ * Before moving new file in place (and eventually overwriting the existing avatar with the newly uploaded avatar)
+ *
+ * @event core.avatar_driver_upload_move_file_before
+ * @var array filedata Array containing uploaded file data
+ * @var string destination Destination directory where the file is going to be moved
+ * @var string prefix Prefix for the avatar filename
+ * @var array row Array with avatar row data
+ * @var array error Array of errors, if filled in by this event file will not be moved
+ * @since 3.1.6-RC1
+ * @changed 3.1.9-RC1 Added filedata
+ */
+ $vars = array(
+ 'filedata',
+ 'destination',
+ 'prefix',
+ 'row',
+ 'error',
+ );
+ extract($this->dispatcher->trigger_event('core.avatar_driver_upload_move_file_before', compact($vars)));
+
+ unset($filedata);
+
+ if (!sizeof($error))
+ {
+ // Move file and overwrite any existing image
+ $file->move_file($destination, true);
+ }
+
+ // If there was an error during move, then clean up leftovers
+ $error = array_merge($error, $file->error);
+ if (sizeof($error))
+ {
+ $file->remove();
+ return false;
+ }
+
+ // Delete current avatar if not overwritten
+ $ext = substr(strrchr($row['avatar'], '.'), 1);
+ if ($ext && $ext !== $file->get('extension'))
+ {
+ $this->delete($row);
+ }
+
+ return array(
+ 'avatar' => $row['id'] . '_' . time() . '.' . $file->get('extension'),
+ 'avatar_width' => $file->get('width'),
+ 'avatar_height' => $file->get('height'),
+ );
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function prepare_form_acp($user)
+ {
+ return array(
+ 'allow_avatar_remote_upload'=> array('lang' => 'ALLOW_REMOTE_UPLOAD', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
+ 'avatar_filesize' => array('lang' => 'MAX_FILESIZE', 'validate' => 'int:0', 'type' => 'number:0', 'explain' => true, 'append' => ' ' . $user->lang['BYTES']),
+ 'avatar_path' => array('lang' => 'AVATAR_STORAGE_PATH', 'validate' => 'rpath', 'type' => 'text:20:255', 'explain' => true),
+ );
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function delete($row)
+ {
+
+ $error = array();
+ $destination = $this->config['avatar_path'];
+ $prefix = $this->config['avatar_salt'] . '_';
+ $ext = substr(strrchr($row['avatar'], '.'), 1);
+ $filename = $this->phpbb_root_path . $destination . '/' . $prefix . $row['id'] . '.' . $ext;
+
+ /**
+ * Before deleting an existing avatar
+ *
+ * @event core.avatar_driver_upload_delete_before
+ * @var string destination Destination directory where the file is going to be deleted
+ * @var string prefix Prefix for the avatar filename
+ * @var array row Array with avatar row data
+ * @var array error Array of errors, if filled in by this event file will not be deleted
+ * @since 3.1.6-RC1
+ */
+ $vars = array(
+ 'destination',
+ 'prefix',
+ 'row',
+ 'error',
+ );
+ extract($this->dispatcher->trigger_event('core.avatar_driver_upload_delete_before', compact($vars)));
+
+ if (!sizeof($error) && file_exists($filename))
+ {
+ @unlink($filename);
+ }
+
+ return true;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_template_name()
+ {
+ return 'ucp_avatar_options_upload.html';
+ }
+
+ /**
+ * Check if user is able to upload an avatar
+ *
+ * @return bool True if user can upload, false if not
+ */
+ protected function can_upload()
+ {
+ return (file_exists($this->phpbb_root_path . $this->config['avatar_path']) && phpbb_is_writable($this->phpbb_root_path . $this->config['avatar_path']) && (@ini_get('file_uploads') || strtolower(@ini_get('file_uploads')) == 'on'));
+ }
+}
diff --git a/phpBB/phpbb/avatar/manager.php b/phpBB/phpbb/avatar/manager.php
new file mode 100644
index 0000000000..26eb17c265
--- /dev/null
+++ b/phpBB/phpbb/avatar/manager.php
@@ -0,0 +1,354 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\avatar;
+
+class manager
+{
+ /**
+ * phpBB configuration
+ * @var \phpbb\config\config
+ */
+ protected $config;
+
+ /**
+ * Array that contains a list of enabled drivers
+ * @var array
+ */
+ static protected $enabled_drivers = false;
+
+ /**
+ * Array that contains all available avatar drivers which are passed via the
+ * service container
+ * @var array
+ */
+ protected $avatar_drivers;
+
+ /**
+ * Default avatar data row
+ * @var array
+ */
+ static protected $default_row = array(
+ 'avatar' => '',
+ 'avatar_type' => '',
+ 'avatar_width' => 0,
+ 'avatar_height' => 0,
+ );
+
+ /**
+ * Construct an avatar manager object
+ *
+ * @param \phpbb\config\config $config phpBB configuration
+ * @param array $avatar_drivers Avatar drivers passed via the service container
+ */
+ public function __construct(\phpbb\config\config $config, $avatar_drivers)
+ {
+ $this->config = $config;
+ $this->register_avatar_drivers($avatar_drivers);
+ }
+
+ /**
+ * Register avatar drivers
+ *
+ * @param array $avatar_drivers Service collection of avatar drivers
+ */
+ protected function register_avatar_drivers($avatar_drivers)
+ {
+ if (!empty($avatar_drivers))
+ {
+ foreach ($avatar_drivers as $driver)
+ {
+ $this->avatar_drivers[$driver->get_name()] = $driver;
+ }
+ }
+ }
+
+ /**
+ * Get the driver object specified by the avatar type
+ *
+ * @param string $avatar_type Avatar type; by default an avatar's service container name
+ * @param bool $load_enabled Load only enabled avatars
+ *
+ * @return object Avatar driver object
+ */
+ public function get_driver($avatar_type, $load_enabled = true)
+ {
+ if (self::$enabled_drivers === false)
+ {
+ $this->load_enabled_drivers();
+ }
+
+ $avatar_drivers = ($load_enabled) ? self::$enabled_drivers : $this->get_all_drivers();
+
+ // Legacy stuff...
+ switch ($avatar_type)
+ {
+ case AVATAR_GALLERY:
+ $avatar_type = 'avatar.driver.local';
+ break;
+ case AVATAR_UPLOAD:
+ $avatar_type = 'avatar.driver.upload';
+ break;
+ case AVATAR_REMOTE:
+ $avatar_type = 'avatar.driver.remote';
+ break;
+ }
+
+ if (!isset($avatar_drivers[$avatar_type]))
+ {
+ return null;
+ }
+
+ /*
+ * There is no need to handle invalid avatar types as the following code
+ * will cause a ServiceNotFoundException if the type does not exist
+ */
+ $driver = $this->avatar_drivers[$avatar_type];
+
+ return $driver;
+ }
+
+ /**
+ * Load the list of enabled drivers
+ * This is executed once and fills self::$enabled_drivers
+ */
+ protected function load_enabled_drivers()
+ {
+ if (!empty($this->avatar_drivers))
+ {
+ self::$enabled_drivers = array();
+ foreach ($this->avatar_drivers as $driver)
+ {
+ if ($this->is_enabled($driver))
+ {
+ self::$enabled_drivers[$driver->get_name()] = $driver->get_name();
+ }
+ }
+ asort(self::$enabled_drivers);
+ }
+ }
+
+ /**
+ * Get a list of all avatar drivers
+ *
+ * As this function will only be called in the ACP avatar settings page, it
+ * doesn't make much sense to cache the list of all avatar drivers like the
+ * list of the enabled drivers.
+ *
+ * @return array Array containing a list of all avatar drivers
+ */
+ public function get_all_drivers()
+ {
+ $drivers = array();
+
+ if (!empty($this->avatar_drivers))
+ {
+ foreach ($this->avatar_drivers as $driver)
+ {
+ $drivers[$driver->get_name()] = $driver->get_name();
+ }
+ asort($drivers);
+ }
+
+ return $drivers;
+ }
+
+ /**
+ * Get a list of enabled avatar drivers
+ *
+ * @return array Array containing a list of the enabled avatar drivers
+ */
+ public function get_enabled_drivers()
+ {
+ if (self::$enabled_drivers === false)
+ {
+ $this->load_enabled_drivers();
+ }
+
+ return self::$enabled_drivers;
+ }
+
+ /**
+ * Strip out user_, group_, or other prefixes from array keys
+ *
+ * @param array $row User data or group data
+ * @param string $prefix Prefix of data keys (e.g. user), should not include the trailing underscore
+ *
+ * @return array User or group data with keys that have been
+ * stripped from the preceding "user_" or "group_"
+ * Also the group id is prefixed with g, when the prefix group is removed.
+ */
+ static public function clean_row($row, $prefix = '')
+ {
+ // Upon creation of a user/group $row might be empty
+ if (empty($row))
+ {
+ return self::$default_row;
+ }
+
+ $output = array();
+ foreach ($row as $key => $value)
+ {
+ $key = preg_replace("#^(?:{$prefix}_)#", '', $key);
+ $output[$key] = $value;
+ }
+
+ if ($prefix === 'group' && isset($output['id']))
+ {
+ $output['id'] = 'g' . $output['id'];
+ }
+
+ return $output;
+ }
+
+ /**
+ * Clean driver names that are returned from template files
+ * Underscores are replaced with dots
+ *
+ * @param string $name Driver name
+ *
+ * @return string Cleaned driver name
+ */
+ static public function clean_driver_name($name)
+ {
+ return str_replace(array('\\', '_'), '.', $name);
+ }
+
+ /**
+ * Prepare driver names for use in template files
+ * Dots are replaced with underscores
+ *
+ * @param string $name Clean driver name
+ *
+ * @return string Prepared driver name
+ */
+ static public function prepare_driver_name($name)
+ {
+ return str_replace('.', '_', $name);
+ }
+
+ /**
+ * Check if avatar is enabled
+ *
+ * @param object $driver Avatar driver object
+ *
+ * @return bool True if avatar is enabled, false if it's disabled
+ */
+ public function is_enabled($driver)
+ {
+ $config_name = $driver->get_config_name();
+
+ return $this->config["allow_avatar_{$config_name}"];
+ }
+
+ /**
+ * Get the settings array for enabling/disabling an avatar driver
+ *
+ * @param object $driver Avatar driver object
+ *
+ * @return array Array of configuration options as consumed by acp_board
+ */
+ public function get_avatar_settings($driver)
+ {
+ $config_name = $driver->get_config_name();
+
+ return array(
+ 'allow_avatar_' . $config_name => array('lang' => 'ALLOW_' . strtoupper(str_replace('\\', '_', $config_name)), 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
+ );
+ }
+
+ /**
+ * Replace "error" strings with their real, localized form
+ *
+ * @param \phpbb\user phpBB User object
+ * @param array $error Array containing error strings
+ * Key values can either be a string with a language key or an array
+ * that will be passed to vsprintf() with the language key in the
+ * first array key.
+ *
+ * @return array Array containing the localized error strings
+ */
+ public function localize_errors(\phpbb\user $user, $error)
+ {
+ foreach ($error as $key => $lang)
+ {
+ if (is_array($lang))
+ {
+ $lang_key = array_shift($lang);
+ $error[$key] = vsprintf($user->lang($lang_key), $lang);
+ }
+ else
+ {
+ $error[$key] = $user->lang("$lang");
+ }
+ }
+
+ return $error;
+ }
+
+ /**
+ * Handle deleting avatars
+ *
+ * @param \phpbb\db\driver\driver_interface $db phpBB dbal
+ * @param \phpbb\user $user phpBB user object
+ * @param array $avatar_data Cleaned user data containing the user's
+ * avatar data
+ * @param string $table Database table from which the avatar should be deleted
+ * @param string $prefix Prefix of user data columns in database
+ * @return null
+ */
+ public function handle_avatar_delete(\phpbb\db\driver\driver_interface $db, \phpbb\user $user, $avatar_data, $table, $prefix)
+ {
+ if ($driver = $this->get_driver($avatar_data['avatar_type']))
+ {
+ $driver->delete($avatar_data);
+ }
+
+ $result = $this->prefix_avatar_columns($prefix, self::$default_row);
+
+ $sql = 'UPDATE ' . $table . '
+ SET ' . $db->sql_build_array('UPDATE', $result) . '
+ WHERE ' . $prefix . 'id = ' . (int) $avatar_data['id'];
+ $db->sql_query($sql);
+
+ // Make sure we also delete this avatar from the users
+ if ($prefix === 'group_')
+ {
+ $result = $this->prefix_avatar_columns('user_', self::$default_row);
+
+ $sql = 'UPDATE ' . USERS_TABLE . '
+ SET ' . $db->sql_build_array('UPDATE', $result) . "
+ WHERE user_avatar = '" . $db->sql_escape($avatar_data['avatar']) . "'";
+ $db->sql_query($sql);
+ }
+ }
+
+ /**
+ * Prefix avatar columns
+ *
+ * @param string $prefix Column prefix
+ * @param array $data Column data
+ *
+ * @return array Column data with prefixed column names
+ */
+ public function prefix_avatar_columns($prefix, $data)
+ {
+ foreach ($data as $key => $value)
+ {
+ $data[$prefix . $key] = $value;
+ unset($data[$key]);
+ }
+
+ return $data;
+ }
+}
diff --git a/phpBB/phpbb/cache/driver/apc.php b/phpBB/phpbb/cache/driver/apc.php
new file mode 100644
index 0000000000..521d5d41ea
--- /dev/null
+++ b/phpBB/phpbb/cache/driver/apc.php
@@ -0,0 +1,70 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\cache\driver;
+
+/**
+* ACM for APC
+*/
+class apc extends \phpbb\cache\driver\memory
+{
+ var $extension = 'apc';
+
+ /**
+ * {@inheritDoc}
+ */
+ function purge()
+ {
+ apc_clear_cache('user');
+
+ parent::purge();
+ }
+
+ /**
+ * Fetch an item from the cache
+ *
+ * @access protected
+ * @param string $var Cache key
+ * @return mixed Cached data
+ */
+ function _read($var)
+ {
+ return apc_fetch($this->key_prefix . $var);
+ }
+
+ /**
+ * Store data in the cache
+ *
+ * @access protected
+ * @param string $var Cache key
+ * @param mixed $data Data to store
+ * @param int $ttl Time-to-live of cached data
+ * @return bool True if the operation succeeded
+ */
+ function _write($var, $data, $ttl = 2592000)
+ {
+ return apc_store($this->key_prefix . $var, $data, $ttl);
+ }
+
+ /**
+ * Remove an item from the cache
+ *
+ * @access protected
+ * @param string $var Cache key
+ * @return bool True if the operation succeeded
+ */
+ function _delete($var)
+ {
+ return apc_delete($this->key_prefix . $var);
+ }
+}
diff --git a/phpBB/phpbb/cache/driver/base.php b/phpBB/phpbb/cache/driver/base.php
new file mode 100644
index 0000000000..53c50eeda3
--- /dev/null
+++ b/phpBB/phpbb/cache/driver/base.php
@@ -0,0 +1,236 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\cache\driver;
+
+abstract class base implements \phpbb\cache\driver\driver_interface
+{
+ var $vars = array();
+ var $is_modified = false;
+
+ var $sql_rowset = array();
+ var $sql_row_pointer = array();
+ var $cache_dir = '';
+
+ /**
+ * {@inheritDoc}
+ */
+ function purge()
+ {
+ // Purge all phpbb cache files
+ try
+ {
+ $iterator = new \DirectoryIterator($this->cache_dir);
+ }
+ catch (\Exception $e)
+ {
+ return;
+ }
+
+ foreach ($iterator as $fileInfo)
+ {
+ if ($fileInfo->isDot())
+ {
+ continue;
+ }
+ $filename = $fileInfo->getFilename();
+ if ($fileInfo->isDir())
+ {
+ $this->remove_dir($fileInfo->getPathname());
+ }
+ else if (strpos($filename, 'container_') === 0 ||
+ strpos($filename, 'url_matcher') === 0 ||
+ strpos($filename, 'sql_') === 0 ||
+ strpos($filename, 'data_') === 0)
+ {
+ $this->remove_file($fileInfo->getPathname());
+ }
+ }
+
+ unset($this->vars);
+ unset($this->sql_rowset);
+ unset($this->sql_row_pointer);
+
+ if (function_exists('opcache_reset'))
+ {
+ @opcache_reset();
+ }
+
+ $this->vars = array();
+ $this->sql_rowset = array();
+ $this->sql_row_pointer = array();
+
+ $this->is_modified = false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function unload()
+ {
+ $this->save();
+ unset($this->vars);
+ unset($this->sql_rowset);
+ unset($this->sql_row_pointer);
+
+ $this->vars = array();
+ $this->sql_rowset = array();
+ $this->sql_row_pointer = array();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_load($query)
+ {
+ // Remove extra spaces and tabs
+ $query = preg_replace('/[\n\r\s\t]+/', ' ', $query);
+
+ if (($rowset = $this->_read('sql_' . md5($query))) === false)
+ {
+ return false;
+ }
+
+ $query_id = sizeof($this->sql_rowset);
+ $this->sql_rowset[$query_id] = $rowset;
+ $this->sql_row_pointer[$query_id] = 0;
+
+ return $query_id;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_exists($query_id)
+ {
+ return isset($this->sql_rowset[$query_id]);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_fetchrow($query_id)
+ {
+ if ($this->sql_row_pointer[$query_id] < sizeof($this->sql_rowset[$query_id]))
+ {
+ return $this->sql_rowset[$query_id][$this->sql_row_pointer[$query_id]++];
+ }
+
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_fetchfield($query_id, $field)
+ {
+ if ($this->sql_row_pointer[$query_id] < sizeof($this->sql_rowset[$query_id]))
+ {
+ return (isset($this->sql_rowset[$query_id][$this->sql_row_pointer[$query_id]][$field])) ? $this->sql_rowset[$query_id][$this->sql_row_pointer[$query_id]++][$field] : false;
+ }
+
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_rowseek($rownum, $query_id)
+ {
+ if ($rownum >= sizeof($this->sql_rowset[$query_id]))
+ {
+ return false;
+ }
+
+ $this->sql_row_pointer[$query_id] = $rownum;
+ return true;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_freeresult($query_id)
+ {
+ if (!isset($this->sql_rowset[$query_id]))
+ {
+ return false;
+ }
+
+ unset($this->sql_rowset[$query_id]);
+ unset($this->sql_row_pointer[$query_id]);
+
+ return true;
+ }
+
+ /**
+ * Removes/unlinks file
+ *
+ * @param string $filename Filename to remove
+ * @param bool $check Check file permissions
+ * @return bool True if the file was successfully removed, otherwise false
+ */
+ function remove_file($filename, $check = false)
+ {
+ if (!function_exists('phpbb_is_writable'))
+ {
+ global $phpbb_root_path, $phpEx;
+ include($phpbb_root_path . 'includes/functions.' . $phpEx);
+ }
+
+ if ($check && !phpbb_is_writable($this->cache_dir))
+ {
+ // E_USER_ERROR - not using language entry - intended.
+ trigger_error('Unable to remove files within ' . $this->cache_dir . '. Please check directory permissions.', E_USER_ERROR);
+ }
+
+ return @unlink($filename);
+ }
+
+ /**
+ * Remove directory
+ *
+ * @param string $dir Directory to remove
+ *
+ * @return null
+ */
+ protected function remove_dir($dir)
+ {
+ try
+ {
+ $iterator = new \DirectoryIterator($dir);
+ }
+ catch (\Exception $e)
+ {
+ return;
+ }
+
+ foreach ($iterator as $fileInfo)
+ {
+ if ($fileInfo->isDot())
+ {
+ continue;
+ }
+
+ if ($fileInfo->isDir())
+ {
+ $this->remove_dir($fileInfo->getPathname());
+ }
+ else
+ {
+ $this->remove_file($fileInfo->getPathname());
+ }
+ }
+
+ @rmdir($dir);
+ }
+}
diff --git a/phpBB/phpbb/cache/driver/driver_interface.php b/phpBB/phpbb/cache/driver/driver_interface.php
new file mode 100644
index 0000000000..9ac9ca0c59
--- /dev/null
+++ b/phpBB/phpbb/cache/driver/driver_interface.php
@@ -0,0 +1,167 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\cache\driver;
+
+/**
+* An interface that all cache drivers must implement
+*/
+interface driver_interface
+{
+ /**
+ * Load global cache
+ *
+ * @return mixed False if an error was encountered, otherwise the data type of the cached data
+ */
+ public function load();
+
+ /**
+ * Unload cache object
+ *
+ * @return null
+ */
+ public function unload();
+
+ /**
+ * Save modified objects
+ *
+ * @return null
+ */
+ public function save();
+
+ /**
+ * Tidy cache
+ *
+ * @return null
+ */
+ public function tidy();
+
+ /**
+ * Get saved cache object
+ *
+ * @param string $var_name Cache key
+ * @return mixed False if an error was encountered, otherwise the saved cached object
+ */
+ public function get($var_name);
+
+ /**
+ * Put data into cache
+ *
+ * @param string $var_name Cache key
+ * @param mixed $var Cached data to store
+ * @param int $ttl Time-to-live of cached data
+ * @return null
+ */
+ public function put($var_name, $var, $ttl = 0);
+
+ /**
+ * Purge cache data
+ *
+ * @return null
+ */
+ public function purge();
+
+ /**
+ * Destroy cache data
+ *
+ * @param string $var_name Cache key
+ * @param string $table Table name
+ * @return null
+ */
+ public function destroy($var_name, $table = '');
+
+ /**
+ * Check if a given cache entry exists
+ *
+ * @param string $var_name Cache key
+ *
+ * @return bool True if cache file exists and has not expired.
+ * False otherwise.
+ */
+ public function _exists($var_name);
+
+ /**
+ * Load result of an SQL query from cache.
+ *
+ * @param string $query SQL query
+ *
+ * @return int|bool Query ID (integer) if cache contains a rowset
+ * for the specified query.
+ * False otherwise.
+ */
+ public function sql_load($query);
+
+ /**
+ * Save result of an SQL query in cache.
+ *
+ * In persistent cache stores, this function stores the query
+ * result to persistent storage. In other words, there is no need
+ * to call save() afterwards.
+ *
+ * @param \phpbb\db\driver\driver_interface $db Database connection
+ * @param string $query SQL query, should be used for generating storage key
+ * @param mixed $query_result The result from \dbal::sql_query, to be passed to
+ * \dbal::sql_fetchrow to get all rows and store them
+ * in cache.
+ * @param int $ttl Time to live, after this timeout the query should
+ * expire from the cache.
+ * @return int|mixed If storing in cache succeeded, an integer $query_id
+ * representing the query should be returned. Otherwise
+ * the original $query_result should be returned.
+ */
+ public function sql_save(\phpbb\db\driver\driver_interface $db, $query, $query_result, $ttl);
+
+ /**
+ * Check if result for a given SQL query exists in cache.
+ *
+ * @param int $query_id
+ * @return bool
+ */
+ public function sql_exists($query_id);
+
+ /**
+ * Fetch row from cache (database)
+ *
+ * @param int $query_id
+ * @return array|bool The query result if found in the cache, otherwise
+ * false.
+ */
+ public function sql_fetchrow($query_id);
+
+ /**
+ * Fetch a field from the current row of a cached database result (database)
+ *
+ * @param int $query_id
+ * @param string $field The name of the column.
+ * @return string|bool The field of the query result if found in the cache,
+ * otherwise false.
+ */
+ public function sql_fetchfield($query_id, $field);
+
+ /**
+ * Seek a specific row in an a cached database result (database)
+ *
+ * @param int $rownum Row to seek to.
+ * @param int $query_id
+ * @return bool
+ */
+ public function sql_rowseek($rownum, $query_id);
+
+ /**
+ * Free memory used for a cached database result (database)
+ *
+ * @param int $query_id
+ * @return bool
+ */
+ public function sql_freeresult($query_id);
+}
diff --git a/phpBB/phpbb/cache/driver/eaccelerator.php b/phpBB/phpbb/cache/driver/eaccelerator.php
new file mode 100644
index 0000000000..1697758acc
--- /dev/null
+++ b/phpBB/phpbb/cache/driver/eaccelerator.php
@@ -0,0 +1,105 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\cache\driver;
+
+/**
+* ACM for eAccelerator
+* @todo Missing locks from destroy() talk with David
+*/
+class eaccelerator extends \phpbb\cache\driver\memory
+{
+ var $extension = 'eaccelerator';
+ var $function = 'eaccelerator_get';
+
+ var $serialize_header = '#phpbb-serialized#';
+
+ /**
+ * {@inheritDoc}
+ */
+ function purge()
+ {
+ foreach (eaccelerator_list_keys() as $var)
+ {
+ // @todo Check why the substr()
+ // @todo Only unset vars matching $this->key_prefix
+ eaccelerator_rm(substr($var['name'], 1));
+ }
+
+ parent::purge();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function tidy()
+ {
+ eaccelerator_gc();
+
+ set_config('cache_last_gc', time(), true);
+ }
+
+ /**
+ * Fetch an item from the cache
+ *
+ * @access protected
+ * @param string $var Cache key
+ * @return mixed Cached data
+ */
+ function _read($var)
+ {
+ $result = eaccelerator_get($this->key_prefix . $var);
+
+ if ($result === null)
+ {
+ return false;
+ }
+
+ // Handle serialized objects
+ if (is_string($result) && strpos($result, $this->serialize_header . 'O:') === 0)
+ {
+ $result = unserialize(substr($result, strlen($this->serialize_header)));
+ }
+
+ return $result;
+ }
+
+ /**
+ * Store data in the cache
+ *
+ * @access protected
+ * @param string $var Cache key
+ * @param mixed $data Data to store
+ * @param int $ttl Time-to-live of cached data
+ * @return bool True if the operation succeeded
+ */
+ function _write($var, $data, $ttl = 2592000)
+ {
+ // Serialize objects and make them easy to detect
+ $data = (is_object($data)) ? $this->serialize_header . serialize($data) : $data;
+
+ return eaccelerator_put($this->key_prefix . $var, $data, $ttl);
+ }
+
+ /**
+ * Remove an item from the cache
+ *
+ * @access protected
+ * @param string $var Cache key
+ * @return bool True if the operation succeeded
+ */
+ function _delete($var)
+ {
+ return eaccelerator_rm($this->key_prefix . $var);
+ }
+}
diff --git a/phpBB/phpbb/cache/driver/file.php b/phpBB/phpbb/cache/driver/file.php
new file mode 100644
index 0000000000..1e9ee960dc
--- /dev/null
+++ b/phpBB/phpbb/cache/driver/file.php
@@ -0,0 +1,606 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\cache\driver;
+
+/**
+* ACM File Based Caching
+*/
+class file extends \phpbb\cache\driver\base
+{
+ var $var_expires = array();
+
+ /**
+ * Set cache path
+ *
+ * @param string $cache_dir Define the path to the cache directory (default: $phpbb_root_path . 'cache/')
+ */
+ function __construct($cache_dir = null)
+ {
+ global $phpbb_root_path;
+ $this->cache_dir = !is_null($cache_dir) ? $cache_dir : $phpbb_root_path . 'cache/';
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function load()
+ {
+ return $this->_read('data_global');
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function unload()
+ {
+ parent::unload();
+ unset($this->var_expires);
+ $this->var_expires = array();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function save()
+ {
+ if (!$this->is_modified)
+ {
+ return;
+ }
+
+ global $phpEx;
+
+ if (!$this->_write('data_global'))
+ {
+ if (!function_exists('phpbb_is_writable'))
+ {
+ global $phpbb_root_path;
+ include($phpbb_root_path . 'includes/functions.' . $phpEx);
+ }
+
+ // Now, this occurred how often? ... phew, just tell the user then...
+ if (!phpbb_is_writable($this->cache_dir))
+ {
+ // We need to use die() here, because else we may encounter an infinite loop (the message handler calls $cache->unload())
+ die('Fatal: ' . $this->cache_dir . ' is NOT writable.');
+ exit;
+ }
+
+ die('Fatal: Not able to open ' . $this->cache_dir . 'data_global.' . $phpEx);
+ exit;
+ }
+
+ $this->is_modified = false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function tidy()
+ {
+ global $phpEx;
+
+ $dir = @opendir($this->cache_dir);
+
+ if (!$dir)
+ {
+ return;
+ }
+
+ $time = time();
+
+ while (($entry = readdir($dir)) !== false)
+ {
+ if (!preg_match('/^(sql_|data_(?!global))/', $entry))
+ {
+ continue;
+ }
+
+ if (!($handle = @fopen($this->cache_dir . $entry, 'rb')))
+ {
+ continue;
+ }
+
+ // Skip the PHP header
+ fgets($handle);
+
+ // Skip expiration
+ $expires = (int) fgets($handle);
+
+ fclose($handle);
+
+ if ($time >= $expires)
+ {
+ $this->remove_file($this->cache_dir . $entry);
+ }
+ }
+ closedir($dir);
+
+ if (file_exists($this->cache_dir . 'data_global.' . $phpEx))
+ {
+ if (!sizeof($this->vars))
+ {
+ $this->load();
+ }
+
+ foreach ($this->var_expires as $var_name => $expires)
+ {
+ if ($time >= $expires)
+ {
+ $this->destroy($var_name);
+ }
+ }
+ }
+
+ set_config('cache_last_gc', time(), true);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function get($var_name)
+ {
+ if ($var_name[0] == '_')
+ {
+ if (!$this->_exists($var_name))
+ {
+ return false;
+ }
+
+ return $this->_read('data' . $var_name);
+ }
+ else
+ {
+ return ($this->_exists($var_name)) ? $this->vars[$var_name] : false;
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function put($var_name, $var, $ttl = 31536000)
+ {
+ if ($var_name[0] == '_')
+ {
+ $this->_write('data' . $var_name, $var, time() + $ttl);
+ }
+ else
+ {
+ $this->vars[$var_name] = $var;
+ $this->var_expires[$var_name] = time() + $ttl;
+ $this->is_modified = true;
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function purge()
+ {
+ parent::purge();
+ $this->var_expires = array();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function destroy($var_name, $table = '')
+ {
+ global $phpEx;
+
+ if ($var_name == 'sql' && !empty($table))
+ {
+ if (!is_array($table))
+ {
+ $table = array($table);
+ }
+
+ $dir = @opendir($this->cache_dir);
+
+ if (!$dir)
+ {
+ return;
+ }
+
+ while (($entry = readdir($dir)) !== false)
+ {
+ if (strpos($entry, 'sql_') !== 0)
+ {
+ continue;
+ }
+
+ if (!($handle = @fopen($this->cache_dir . $entry, 'rb')))
+ {
+ continue;
+ }
+
+ // Skip the PHP header
+ fgets($handle);
+
+ // Skip expiration
+ fgets($handle);
+
+ // Grab the query, remove the LF
+ $query = substr(fgets($handle), 0, -1);
+
+ fclose($handle);
+
+ foreach ($table as $check_table)
+ {
+ // Better catch partial table names than no table names. ;)
+ if (strpos($query, $check_table) !== false)
+ {
+ $this->remove_file($this->cache_dir . $entry);
+ break;
+ }
+ }
+ }
+ closedir($dir);
+
+ return;
+ }
+
+ if (!$this->_exists($var_name))
+ {
+ return;
+ }
+
+ if ($var_name[0] == '_')
+ {
+ $this->remove_file($this->cache_dir . 'data' . $var_name . ".$phpEx", true);
+ }
+ else if (isset($this->vars[$var_name]))
+ {
+ $this->is_modified = true;
+ unset($this->vars[$var_name]);
+ unset($this->var_expires[$var_name]);
+
+ // We save here to let the following cache hits succeed
+ $this->save();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function _exists($var_name)
+ {
+ if ($var_name[0] == '_')
+ {
+ global $phpEx;
+ $var_name = $this->clean_varname($var_name);
+ return file_exists($this->cache_dir . 'data' . $var_name . ".$phpEx");
+ }
+ else
+ {
+ if (!sizeof($this->vars))
+ {
+ $this->load();
+ }
+
+ if (!isset($this->var_expires[$var_name]))
+ {
+ return false;
+ }
+
+ return (time() > $this->var_expires[$var_name]) ? false : isset($this->vars[$var_name]);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_save(\phpbb\db\driver\driver_interface $db, $query, $query_result, $ttl)
+ {
+ // Remove extra spaces and tabs
+ $query = preg_replace('/[\n\r\s\t]+/', ' ', $query);
+
+ $query_id = sizeof($this->sql_rowset);
+ $this->sql_rowset[$query_id] = array();
+ $this->sql_row_pointer[$query_id] = 0;
+
+ while ($row = $db->sql_fetchrow($query_result))
+ {
+ $this->sql_rowset[$query_id][] = $row;
+ }
+ $db->sql_freeresult($query_result);
+
+ if ($this->_write('sql_' . md5($query), $this->sql_rowset[$query_id], $ttl + time(), $query))
+ {
+ return $query_id;
+ }
+
+ return $query_result;
+ }
+
+ /**
+ * Read cached data from a specified file
+ *
+ * @access private
+ * @param string $filename Filename to write
+ * @return mixed False if an error was encountered, otherwise the data type of the cached data
+ */
+ function _read($filename)
+ {
+ global $phpEx;
+
+ $filename = $this->clean_varname($filename);
+ $file = "{$this->cache_dir}$filename.$phpEx";
+
+ $type = substr($filename, 0, strpos($filename, '_'));
+
+ if (!file_exists($file))
+ {
+ return false;
+ }
+
+ if (!($handle = @fopen($file, 'rb')))
+ {
+ return false;
+ }
+
+ // Skip the PHP header
+ fgets($handle);
+
+ if ($filename == 'data_global')
+ {
+ $this->vars = $this->var_expires = array();
+
+ $time = time();
+
+ while (($expires = (int) fgets($handle)) && !feof($handle))
+ {
+ // Number of bytes of data
+ $bytes = substr(fgets($handle), 0, -1);
+
+ if (!is_numeric($bytes) || ($bytes = (int) $bytes) === 0)
+ {
+ // We cannot process the file without a valid number of bytes
+ // so we discard it
+ fclose($handle);
+
+ $this->vars = $this->var_expires = array();
+ $this->is_modified = false;
+
+ $this->remove_file($file);
+
+ return false;
+ }
+
+ if ($time >= $expires)
+ {
+ fseek($handle, $bytes, SEEK_CUR);
+
+ continue;
+ }
+
+ $var_name = substr(fgets($handle), 0, -1);
+
+ // Read the length of bytes that consists of data.
+ $data = fread($handle, $bytes - strlen($var_name));
+ $data = @unserialize($data);
+
+ // Don't use the data if it was invalid
+ if ($data !== false)
+ {
+ $this->vars[$var_name] = $data;
+ $this->var_expires[$var_name] = $expires;
+ }
+
+ // Absorb the LF
+ fgets($handle);
+ }
+
+ fclose($handle);
+
+ $this->is_modified = false;
+
+ return true;
+ }
+ else
+ {
+ $data = false;
+ $line = 0;
+
+ while (($buffer = fgets($handle)) && !feof($handle))
+ {
+ $buffer = substr($buffer, 0, -1); // Remove the LF
+
+ // $buffer is only used to read integers
+ // if it is non numeric we have an invalid
+ // cache file, which we will now remove.
+ if (!is_numeric($buffer))
+ {
+ break;
+ }
+
+ if ($line == 0)
+ {
+ $expires = (int) $buffer;
+
+ if (time() >= $expires)
+ {
+ break;
+ }
+
+ if ($type == 'sql')
+ {
+ // Skip the query
+ fgets($handle);
+ }
+ }
+ else if ($line == 1)
+ {
+ $bytes = (int) $buffer;
+
+ // Never should have 0 bytes
+ if (!$bytes)
+ {
+ break;
+ }
+
+ // Grab the serialized data
+ $data = fread($handle, $bytes);
+
+ // Read 1 byte, to trigger EOF
+ fread($handle, 1);
+
+ if (!feof($handle))
+ {
+ // Somebody tampered with our data
+ $data = false;
+ }
+ break;
+ }
+ else
+ {
+ // Something went wrong
+ break;
+ }
+ $line++;
+ }
+ fclose($handle);
+
+ // unserialize if we got some data
+ $data = ($data !== false) ? @unserialize($data) : $data;
+
+ if ($data === false)
+ {
+ $this->remove_file($file);
+ return false;
+ }
+
+ return $data;
+ }
+ }
+
+ /**
+ * Write cache data to a specified file
+ *
+ * 'data_global' is a special case and the generated format is different for this file:
+ * <code>
+ * <?php exit; ?>
+ * (expiration)
+ * (length of var and serialised data)
+ * (var)
+ * (serialised data)
+ * ... (repeat)
+ * </code>
+ *
+ * The other files have a similar format:
+ * <code>
+ * <?php exit; ?>
+ * (expiration)
+ * (query) [SQL files only]
+ * (length of serialised data)
+ * (serialised data)
+ * </code>
+ *
+ * @access private
+ * @param string $filename Filename to write
+ * @param mixed $data Data to store
+ * @param int $expires Timestamp when the data expires
+ * @param string $query Query when caching SQL queries
+ * @return bool True if the file was successfully created, otherwise false
+ */
+ function _write($filename, $data = null, $expires = 0, $query = '')
+ {
+ global $phpEx;
+
+ $filename = $this->clean_varname($filename);
+ $file = "{$this->cache_dir}$filename.$phpEx";
+
+ $lock = new \phpbb\lock\flock($file);
+ $lock->acquire();
+
+ if ($handle = @fopen($file, 'wb'))
+ {
+ // File header
+ fwrite($handle, '<' . '?php exit; ?' . '>');
+
+ if ($filename == 'data_global')
+ {
+ // Global data is a different format
+ foreach ($this->vars as $var => $data)
+ {
+ if (strpos($var, "\r") !== false || strpos($var, "\n") !== false)
+ {
+ // CR/LF would cause fgets() to read the cache file incorrectly
+ // do not cache test entries, they probably won't be read back
+ // the cache keys should really be alphanumeric with a few symbols.
+ continue;
+ }
+ $data = serialize($data);
+
+ // Write out the expiration time
+ fwrite($handle, "\n" . $this->var_expires[$var] . "\n");
+
+ // Length of the remaining data for this var (ignoring two LF's)
+ fwrite($handle, strlen($data . $var) . "\n");
+ fwrite($handle, $var . "\n");
+ fwrite($handle, $data);
+ }
+ }
+ else
+ {
+ fwrite($handle, "\n" . $expires . "\n");
+
+ if (strpos($filename, 'sql_') === 0)
+ {
+ fwrite($handle, $query . "\n");
+ }
+ $data = serialize($data);
+
+ fwrite($handle, strlen($data) . "\n");
+ fwrite($handle, $data);
+ }
+
+ fclose($handle);
+
+ if (function_exists('opcache_invalidate'))
+ {
+ @opcache_invalidate($file);
+ }
+
+ if (!function_exists('phpbb_chmod'))
+ {
+ global $phpbb_root_path;
+ include($phpbb_root_path . 'includes/functions.' . $phpEx);
+ }
+
+ phpbb_chmod($file, CHMOD_READ | CHMOD_WRITE);
+
+ $return_value = true;
+ }
+ else
+ {
+ $return_value = false;
+ }
+
+ $lock->release();
+
+ return $return_value;
+ }
+
+ /**
+ * Replace slashes in the file name
+ *
+ * @param string $varname name of a cache variable
+ * @return string $varname name that is safe to use as a filename
+ */
+ protected function clean_varname($varname)
+ {
+ return str_replace(array('/', '\\'), '-', $varname);
+ }
+}
diff --git a/phpBB/phpbb/cache/driver/memcache.php b/phpBB/phpbb/cache/driver/memcache.php
new file mode 100644
index 0000000000..57f138f574
--- /dev/null
+++ b/phpBB/phpbb/cache/driver/memcache.php
@@ -0,0 +1,122 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\cache\driver;
+
+if (!defined('PHPBB_ACM_MEMCACHE_PORT'))
+{
+ define('PHPBB_ACM_MEMCACHE_PORT', 11211);
+}
+
+if (!defined('PHPBB_ACM_MEMCACHE_COMPRESS'))
+{
+ define('PHPBB_ACM_MEMCACHE_COMPRESS', false);
+}
+
+if (!defined('PHPBB_ACM_MEMCACHE_HOST'))
+{
+ define('PHPBB_ACM_MEMCACHE_HOST', 'localhost');
+}
+
+if (!defined('PHPBB_ACM_MEMCACHE'))
+{
+ //can define multiple servers with host1/port1,host2/port2 format
+ define('PHPBB_ACM_MEMCACHE', PHPBB_ACM_MEMCACHE_HOST . '/' . PHPBB_ACM_MEMCACHE_PORT);
+}
+
+/**
+* ACM for Memcached
+*/
+class memcache extends \phpbb\cache\driver\memory
+{
+ var $extension = 'memcache';
+
+ var $memcache;
+ var $flags = 0;
+
+ function __construct()
+ {
+ // Call the parent constructor
+ parent::__construct();
+
+ $this->memcache = new \Memcache;
+ foreach (explode(',', PHPBB_ACM_MEMCACHE) as $u)
+ {
+ preg_match('#(.*)/(\d+)#', $u, $parts);
+ $this->memcache->addServer(trim($parts[1]), (int) trim($parts[2]));
+ }
+ $this->flags = (PHPBB_ACM_MEMCACHE_COMPRESS) ? MEMCACHE_COMPRESSED : 0;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function unload()
+ {
+ parent::unload();
+
+ $this->memcache->close();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function purge()
+ {
+ $this->memcache->flush();
+
+ parent::purge();
+ }
+
+ /**
+ * Fetch an item from the cache
+ *
+ * @access protected
+ * @param string $var Cache key
+ * @return mixed Cached data
+ */
+ function _read($var)
+ {
+ return $this->memcache->get($this->key_prefix . $var);
+ }
+
+ /**
+ * Store data in the cache
+ *
+ * @access protected
+ * @param string $var Cache key
+ * @param mixed $data Data to store
+ * @param int $ttl Time-to-live of cached data
+ * @return bool True if the operation succeeded
+ */
+ function _write($var, $data, $ttl = 2592000)
+ {
+ if (!$this->memcache->replace($this->key_prefix . $var, $data, $this->flags, $ttl))
+ {
+ return $this->memcache->set($this->key_prefix . $var, $data, $this->flags, $ttl);
+ }
+ return true;
+ }
+
+ /**
+ * Remove an item from the cache
+ *
+ * @access protected
+ * @param string $var Cache key
+ * @return bool True if the operation succeeded
+ */
+ function _delete($var)
+ {
+ return $this->memcache->delete($this->key_prefix . $var);
+ }
+}
diff --git a/phpBB/phpbb/cache/driver/memcached.php b/phpBB/phpbb/cache/driver/memcached.php
new file mode 100644
index 0000000000..a7da22d7e8
--- /dev/null
+++ b/phpBB/phpbb/cache/driver/memcached.php
@@ -0,0 +1,134 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\cache\driver;
+
+if (!defined('PHPBB_ACM_MEMCACHED_PORT'))
+{
+ define('PHPBB_ACM_MEMCACHED_PORT', 11211);
+}
+
+if (!defined('PHPBB_ACM_MEMCACHED_COMPRESS'))
+{
+ define('PHPBB_ACM_MEMCACHED_COMPRESS', true);
+}
+
+if (!defined('PHPBB_ACM_MEMCACHED_HOST'))
+{
+ define('PHPBB_ACM_MEMCACHED_HOST', 'localhost');
+}
+
+if (!defined('PHPBB_ACM_MEMCACHED'))
+{
+ //can define multiple servers with host1/port1,host2/port2 format
+ define('PHPBB_ACM_MEMCACHED', PHPBB_ACM_MEMCACHED_HOST . '/' . PHPBB_ACM_MEMCACHED_PORT);
+}
+
+/**
+* ACM for Memcached
+*/
+class memcached extends \phpbb\cache\driver\memory
+{
+ /** @var string Extension to use */
+ protected $extension = 'memcached';
+
+ /** @var \Memcached Memcached class */
+ protected $memcached;
+
+ /** @var int Flags */
+ protected $flags = 0;
+
+ /**
+ * Memcached constructor
+ */
+ public function __construct()
+ {
+ // Call the parent constructor
+ parent::__construct();
+
+ $this->memcached = new \Memcached();
+ $this->memcached->setOption(\Memcached::OPT_BINARY_PROTOCOL, true);
+ // Memcached defaults to using compression, disable if we don't want
+ // to use it
+ if (!PHPBB_ACM_MEMCACHED_COMPRESS)
+ {
+ $this->memcached->setOption(\Memcached::OPT_COMPRESSION, false);
+ }
+
+ foreach (explode(',', PHPBB_ACM_MEMCACHE) as $u)
+ {
+ preg_match('#(.*)/(\d+)#', $u, $parts);
+ $this->memcache->addServer(trim($parts[1]), (int) trim($parts[2]));
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function unload()
+ {
+ parent::unload();
+
+ unset($this->memcached);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function purge()
+ {
+ $this->memcached->flush();
+
+ parent::purge();
+ }
+
+ /**
+ * Fetch an item from the cache
+ *
+ * @param string $var Cache key
+ *
+ * @return mixed Cached data
+ */
+ protected function _read($var)
+ {
+ return $this->memcached->get($this->key_prefix . $var);
+ }
+
+ /**
+ * Store data in the cache
+ *
+ * @param string $var Cache key
+ * @param mixed $data Data to store
+ * @param int $ttl Time-to-live of cached data
+ * @return bool True if the operation succeeded
+ */
+ protected function _write($var, $data, $ttl = 2592000)
+ {
+ if (!$this->memcached->replace($this->key_prefix . $var, $data, $ttl))
+ {
+ return $this->memcached->set($this->key_prefix . $var, $data, $ttl);
+ }
+ return true;
+ }
+
+ /**
+ * Remove an item from the cache
+ *
+ * @param string $var Cache key
+ * @return bool True if the operation succeeded
+ */
+ protected function _delete($var)
+ {
+ return $this->memcached->delete($this->key_prefix . $var);
+ }
+}
diff --git a/phpBB/phpbb/cache/driver/memory.php b/phpBB/phpbb/cache/driver/memory.php
new file mode 100644
index 0000000000..0b0e323e3d
--- /dev/null
+++ b/phpBB/phpbb/cache/driver/memory.php
@@ -0,0 +1,281 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\cache\driver;
+
+/**
+* ACM Abstract Memory Class
+*/
+abstract class memory extends \phpbb\cache\driver\base
+{
+ var $key_prefix;
+
+ /**
+ * Set cache path
+ */
+ function __construct()
+ {
+ global $phpbb_root_path, $dbname, $table_prefix;
+
+ $this->cache_dir = $phpbb_root_path . 'cache/';
+ $this->key_prefix = substr(md5($dbname . $table_prefix), 0, 8) . '_';
+
+ if (!isset($this->extension) || !extension_loaded($this->extension))
+ {
+ global $acm_type;
+
+ trigger_error("Could not find required extension [{$this->extension}] for the ACM module $acm_type.", E_USER_ERROR);
+ }
+
+ if (isset($this->function) && !function_exists($this->function))
+ {
+ global $acm_type;
+
+ trigger_error("The required function [{$this->function}] is not available for the ACM module $acm_type.", E_USER_ERROR);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function load()
+ {
+ // grab the global cache
+ $this->vars = $this->_read('global');
+
+ if ($this->vars !== false)
+ {
+ return true;
+ }
+
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function save()
+ {
+ if (!$this->is_modified)
+ {
+ return;
+ }
+
+ $this->_write('global', $this->vars, 2592000);
+
+ $this->is_modified = false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function tidy()
+ {
+ // cache has auto GC, no need to have any code here :)
+
+ set_config('cache_last_gc', time(), true);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function get($var_name)
+ {
+ if ($var_name[0] == '_')
+ {
+ if (!$this->_exists($var_name))
+ {
+ return false;
+ }
+
+ return $this->_read($var_name);
+ }
+ else
+ {
+ return ($this->_exists($var_name)) ? $this->vars[$var_name] : false;
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function put($var_name, $var, $ttl = 2592000)
+ {
+ if ($var_name[0] == '_')
+ {
+ $this->_write($var_name, $var, $ttl);
+ }
+ else
+ {
+ $this->vars[$var_name] = $var;
+ $this->is_modified = true;
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function destroy($var_name, $table = '')
+ {
+ if ($var_name == 'sql' && !empty($table))
+ {
+ if (!is_array($table))
+ {
+ $table = array($table);
+ }
+
+ foreach ($table as $table_name)
+ {
+ // gives us the md5s that we want
+ $temp = $this->_read('sql_' . $table_name);
+
+ if ($temp === false)
+ {
+ continue;
+ }
+
+ // delete each query ref
+ foreach ($temp as $md5_id => $void)
+ {
+ $this->_delete('sql_' . $md5_id);
+ }
+
+ // delete the table ref
+ $this->_delete('sql_' . $table_name);
+ }
+
+ return;
+ }
+
+ if (!$this->_exists($var_name))
+ {
+ return;
+ }
+
+ if ($var_name[0] == '_')
+ {
+ $this->_delete($var_name);
+ }
+ else if (isset($this->vars[$var_name]))
+ {
+ $this->is_modified = true;
+ unset($this->vars[$var_name]);
+
+ // We save here to let the following cache hits succeed
+ $this->save();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function _exists($var_name)
+ {
+ if ($var_name[0] == '_')
+ {
+ return $this->_isset($var_name);
+ }
+ else
+ {
+ if (!sizeof($this->vars))
+ {
+ $this->load();
+ }
+
+ return isset($this->vars[$var_name]);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_save(\phpbb\db\driver\driver_interface $db, $query, $query_result, $ttl)
+ {
+ // Remove extra spaces and tabs
+ $query = preg_replace('/[\n\r\s\t]+/', ' ', $query);
+ $hash = md5($query);
+
+ // determine which tables this query belongs to
+ // Some queries use backticks, namely the get_database_size() query
+ // don't check for conformity, the SQL would error and not reach here.
+ if (!preg_match_all('/(?:FROM \\(?(`?\\w+`?(?: \\w+)?(?:, ?`?\\w+`?(?: \\w+)?)*)\\)?)|(?:JOIN (`?\\w+`?(?: \\w+)?))/', $query, $regs, PREG_SET_ORDER))
+ {
+ // Bail out if the match fails.
+ return $query_result;
+ }
+
+ $tables = array();
+ foreach ($regs as $match)
+ {
+ if ($match[0][0] == 'F')
+ {
+ $tables = array_merge($tables, array_map('trim', explode(',', $match[1])));
+ }
+ else
+ {
+ $tables[] = $match[2];
+ }
+ }
+
+ foreach ($tables as $table_name)
+ {
+ // Remove backticks
+ $table_name = ($table_name[0] == '`') ? substr($table_name, 1, -1) : $table_name;
+
+ if (($pos = strpos($table_name, ' ')) !== false)
+ {
+ $table_name = substr($table_name, 0, $pos);
+ }
+
+ $temp = $this->_read('sql_' . $table_name);
+
+ if ($temp === false)
+ {
+ $temp = array();
+ }
+
+ $temp[$hash] = true;
+
+ // This must never expire
+ $this->_write('sql_' . $table_name, $temp, 0);
+ }
+
+ // store them in the right place
+ $query_id = sizeof($this->sql_rowset);
+ $this->sql_rowset[$query_id] = array();
+ $this->sql_row_pointer[$query_id] = 0;
+
+ while ($row = $db->sql_fetchrow($query_result))
+ {
+ $this->sql_rowset[$query_id][] = $row;
+ }
+ $db->sql_freeresult($query_result);
+
+ $this->_write('sql_' . $hash, $this->sql_rowset[$query_id], $ttl);
+
+ return $query_id;
+ }
+
+ /**
+ * Check if a cache var exists
+ *
+ * @access protected
+ * @param string $var Cache key
+ * @return bool True if it exists, otherwise false
+ */
+ function _isset($var)
+ {
+ // Most caches don't need to check
+ return true;
+ }
+}
diff --git a/phpBB/phpbb/cache/driver/null.php b/phpBB/phpbb/cache/driver/null.php
new file mode 100644
index 0000000000..a45cf97862
--- /dev/null
+++ b/phpBB/phpbb/cache/driver/null.php
@@ -0,0 +1,151 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\cache\driver;
+
+/**
+* ACM Null Caching
+*/
+class null extends \phpbb\cache\driver\base
+{
+ /**
+ * Set cache path
+ */
+ function __construct()
+ {
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function load()
+ {
+ return true;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function unload()
+ {
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function save()
+ {
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function tidy()
+ {
+ // This cache always has a tidy room.
+ set_config('cache_last_gc', time(), true);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function get($var_name)
+ {
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function put($var_name, $var, $ttl = 0)
+ {
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function purge()
+ {
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function destroy($var_name, $table = '')
+ {
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function _exists($var_name)
+ {
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_load($query)
+ {
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_save(\phpbb\db\driver\driver_interface $db, $query, $query_result, $ttl)
+ {
+ return $query_result;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_exists($query_id)
+ {
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_fetchrow($query_id)
+ {
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_fetchfield($query_id, $field)
+ {
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_rowseek($rownum, $query_id)
+ {
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_freeresult($query_id)
+ {
+ return false;
+ }
+}
diff --git a/phpBB/phpbb/cache/driver/redis.php b/phpBB/phpbb/cache/driver/redis.php
new file mode 100644
index 0000000000..eda774491c
--- /dev/null
+++ b/phpBB/phpbb/cache/driver/redis.php
@@ -0,0 +1,158 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\cache\driver;
+
+if (!defined('PHPBB_ACM_REDIS_PORT'))
+{
+ define('PHPBB_ACM_REDIS_PORT', 6379);
+}
+
+if (!defined('PHPBB_ACM_REDIS_HOST'))
+{
+ define('PHPBB_ACM_REDIS_HOST', 'localhost');
+}
+
+/**
+* ACM for Redis
+*
+* Compatible with the php extension phpredis available
+* at https://github.com/nicolasff/phpredis
+*
+*/
+class redis extends \phpbb\cache\driver\memory
+{
+ var $extension = 'redis';
+
+ var $redis;
+
+ /**
+ * Creates a redis cache driver.
+ *
+ * The following global constants affect operation:
+ *
+ * PHPBB_ACM_REDIS_HOST
+ * PHPBB_ACM_REDIS_PORT
+ * PHPBB_ACM_REDIS_PASSWORD
+ * PHPBB_ACM_REDIS_DB
+ *
+ * There are no publicly documented constructor parameters.
+ */
+ function __construct()
+ {
+ // Call the parent constructor
+ parent::__construct();
+
+ $this->redis = new \Redis();
+
+ $args = func_get_args();
+ if (!empty($args))
+ {
+ $ok = call_user_func_array(array($this->redis, 'connect'), $args);
+ }
+ else
+ {
+ $ok = $this->redis->connect(PHPBB_ACM_REDIS_HOST, PHPBB_ACM_REDIS_PORT);
+ }
+
+ if (!$ok)
+ {
+ trigger_error('Could not connect to redis server');
+ }
+
+ if (defined('PHPBB_ACM_REDIS_PASSWORD'))
+ {
+ if (!$this->redis->auth(PHPBB_ACM_REDIS_PASSWORD))
+ {
+ global $acm_type;
+
+ trigger_error("Incorrect password for the ACM module $acm_type.", E_USER_ERROR);
+ }
+ }
+
+ $this->redis->setOption(\Redis::OPT_SERIALIZER, \Redis::SERIALIZER_PHP);
+ $this->redis->setOption(\Redis::OPT_PREFIX, $this->key_prefix);
+
+ if (defined('PHPBB_ACM_REDIS_DB'))
+ {
+ if (!$this->redis->select(PHPBB_ACM_REDIS_DB))
+ {
+ global $acm_type;
+
+ trigger_error("Incorrect database for the ACM module $acm_type.", E_USER_ERROR);
+ }
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function unload()
+ {
+ parent::unload();
+
+ $this->redis->close();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function purge()
+ {
+ $this->redis->flushDB();
+
+ parent::purge();
+ }
+
+ /**
+ * Fetch an item from the cache
+ *
+ * @access protected
+ * @param string $var Cache key
+ * @return mixed Cached data
+ */
+ function _read($var)
+ {
+ return $this->redis->get($var);
+ }
+
+ /**
+ * Store data in the cache
+ *
+ * @access protected
+ * @param string $var Cache key
+ * @param mixed $data Data to store
+ * @param int $ttl Time-to-live of cached data
+ * @return bool True if the operation succeeded
+ */
+ function _write($var, $data, $ttl = 2592000)
+ {
+ return $this->redis->setex($var, $ttl, $data);
+ }
+
+ /**
+ * Remove an item from the cache
+ *
+ * @access protected
+ * @param string $var Cache key
+ * @return bool True if the operation succeeded
+ */
+ function _delete($var)
+ {
+ if ($this->redis->delete($var) > 0)
+ {
+ return true;
+ }
+ return false;
+ }
+}
diff --git a/phpBB/phpbb/cache/driver/wincache.php b/phpBB/phpbb/cache/driver/wincache.php
new file mode 100644
index 0000000000..632b534362
--- /dev/null
+++ b/phpBB/phpbb/cache/driver/wincache.php
@@ -0,0 +1,73 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\cache\driver;
+
+/**
+* ACM for WinCache
+*/
+class wincache extends \phpbb\cache\driver\memory
+{
+ var $extension = 'wincache';
+
+ /**
+ * {@inheritDoc}
+ */
+ function purge()
+ {
+ wincache_ucache_clear();
+
+ parent::purge();
+ }
+
+ /**
+ * Fetch an item from the cache
+ *
+ * @access protected
+ * @param string $var Cache key
+ * @return mixed Cached data
+ */
+ function _read($var)
+ {
+ $success = false;
+ $result = wincache_ucache_get($this->key_prefix . $var, $success);
+
+ return ($success) ? $result : false;
+ }
+
+ /**
+ * Store data in the cache
+ *
+ * @access protected
+ * @param string $var Cache key
+ * @param mixed $data Data to store
+ * @param int $ttl Time-to-live of cached data
+ * @return bool True if the operation succeeded
+ */
+ function _write($var, $data, $ttl = 2592000)
+ {
+ return wincache_ucache_set($this->key_prefix . $var, $data, $ttl);
+ }
+
+ /**
+ * Remove an item from the cache
+ *
+ * @access protected
+ * @param string $var Cache key
+ * @return bool True if the operation succeeded
+ */
+ function _delete($var)
+ {
+ return wincache_ucache_delete($this->key_prefix . $var);
+ }
+}
diff --git a/phpBB/phpbb/cache/driver/xcache.php b/phpBB/phpbb/cache/driver/xcache.php
new file mode 100644
index 0000000000..0c845a6a8d
--- /dev/null
+++ b/phpBB/phpbb/cache/driver/xcache.php
@@ -0,0 +1,107 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\cache\driver;
+
+/**
+* ACM for XCache
+*
+* To use this module you need ini_get() enabled and the following INI settings configured as follows:
+* - xcache.var_size > 0
+* - xcache.admin.enable_auth = off (or xcache.admin.user and xcache.admin.password set)
+*
+*/
+class xcache extends \phpbb\cache\driver\memory
+{
+ var $extension = 'XCache';
+
+ function __construct()
+ {
+ parent::__construct();
+
+ if (!function_exists('ini_get') || (int) ini_get('xcache.var_size') <= 0)
+ {
+ trigger_error('Increase xcache.var_size setting above 0 or enable ini_get() to use this ACM module.', E_USER_ERROR);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function purge()
+ {
+ // Run before for XCache, if admin functions are disabled it will terminate execution
+ parent::purge();
+
+ // If the admin authentication is enabled but not set up, this will cause a nasty error.
+ // Not much we can do about it though.
+ $n = xcache_count(XC_TYPE_VAR);
+
+ for ($i = 0; $i < $n; $i++)
+ {
+ xcache_clear_cache(XC_TYPE_VAR, $i);
+ }
+ }
+
+ /**
+ * Fetch an item from the cache
+ *
+ * @access protected
+ * @param string $var Cache key
+ * @return mixed Cached data
+ */
+ function _read($var)
+ {
+ $result = xcache_get($this->key_prefix . $var);
+
+ return ($result !== null) ? $result : false;
+ }
+
+ /**
+ * Store data in the cache
+ *
+ * @access protected
+ * @param string $var Cache key
+ * @param mixed $data Data to store
+ * @param int $ttl Time-to-live of cached data
+ * @return bool True if the operation succeeded
+ */
+ function _write($var, $data, $ttl = 2592000)
+ {
+ return xcache_set($this->key_prefix . $var, $data, $ttl);
+ }
+
+ /**
+ * Remove an item from the cache
+ *
+ * @access protected
+ * @param string $var Cache key
+ * @return bool True if the operation succeeded
+ */
+ function _delete($var)
+ {
+ return xcache_unset($this->key_prefix . $var);
+ }
+
+ /**
+ * Check if a cache var exists
+ *
+ * @access protected
+ * @param string $var Cache key
+ * @return bool True if it exists, otherwise false
+ */
+ function _isset($var)
+ {
+ return xcache_isset($this->key_prefix . $var);
+ }
+}
diff --git a/phpBB/phpbb/cache/service.php b/phpBB/phpbb/cache/service.php
new file mode 100644
index 0000000000..56727c2ad5
--- /dev/null
+++ b/phpBB/phpbb/cache/service.php
@@ -0,0 +1,390 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\cache;
+
+/**
+* Class for grabbing/handling cached entries
+*/
+class service
+{
+ /**
+ * Cache driver.
+ *
+ * @var \phpbb\cache\driver\driver_interface
+ */
+ protected $driver;
+
+ /**
+ * The config.
+ *
+ * @var \phpbb\config\config
+ */
+ protected $config;
+
+ /**
+ * Database connection.
+ *
+ * @var \phpbb\db\driver\driver_interface
+ */
+ protected $db;
+
+ /**
+ * Root path.
+ *
+ * @var string
+ */
+ protected $phpbb_root_path;
+
+ /**
+ * PHP file extension.
+ *
+ * @var string
+ */
+ protected $php_ext;
+
+ /**
+ * Creates a cache service around a cache driver
+ *
+ * @param \phpbb\cache\driver\driver_interface $driver The cache driver
+ * @param \phpbb\config\config $config The config
+ * @param \phpbb\db\driver\driver_interface $db Database connection
+ * @param string $phpbb_root_path Root path
+ * @param string $php_ext PHP file extension
+ */
+ public function __construct(\phpbb\cache\driver\driver_interface $driver, \phpbb\config\config $config, \phpbb\db\driver\driver_interface $db, $phpbb_root_path, $php_ext)
+ {
+ $this->set_driver($driver);
+ $this->config = $config;
+ $this->db = $db;
+ $this->phpbb_root_path = $phpbb_root_path;
+ $this->php_ext = $php_ext;
+ }
+
+ /**
+ * Returns the cache driver used by this cache service.
+ *
+ * @return \phpbb\cache\driver\driver_interface The cache driver
+ */
+ public function get_driver()
+ {
+ return $this->driver;
+ }
+
+ /**
+ * Replaces the cache driver used by this cache service.
+ *
+ * @param \phpbb\cache\driver\driver_interface $driver The cache driver
+ */
+ public function set_driver(\phpbb\cache\driver\driver_interface $driver)
+ {
+ $this->driver = $driver;
+ }
+
+ public function __call($method, $arguments)
+ {
+ return call_user_func_array(array($this->driver, $method), $arguments);
+ }
+
+ /**
+ * Obtain list of naughty words and build preg style replacement arrays for use by the
+ * calling script
+ */
+ function obtain_word_list()
+ {
+ if (($censors = $this->driver->get('_word_censors')) === false)
+ {
+ $sql = 'SELECT word, replacement
+ FROM ' . WORDS_TABLE;
+ $result = $this->db->sql_query($sql);
+
+ $censors = array();
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $censors['match'][] = get_censor_preg_expression($row['word']);
+ $censors['replace'][] = $row['replacement'];
+ }
+ $this->db->sql_freeresult($result);
+
+ $this->driver->put('_word_censors', $censors);
+ }
+
+ return $censors;
+ }
+
+ /**
+ * Obtain currently listed icons
+ */
+ function obtain_icons()
+ {
+ if (($icons = $this->driver->get('_icons')) === false)
+ {
+ // Topic icons
+ $sql = 'SELECT *
+ FROM ' . ICONS_TABLE . '
+ ORDER BY icons_order';
+ $result = $this->db->sql_query($sql);
+
+ $icons = array();
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $icons[$row['icons_id']]['img'] = $row['icons_url'];
+ $icons[$row['icons_id']]['width'] = (int) $row['icons_width'];
+ $icons[$row['icons_id']]['height'] = (int) $row['icons_height'];
+ $icons[$row['icons_id']]['display'] = (bool) $row['display_on_posting'];
+ }
+ $this->db->sql_freeresult($result);
+
+ $this->driver->put('_icons', $icons);
+ }
+
+ return $icons;
+ }
+
+ /**
+ * Obtain ranks
+ */
+ function obtain_ranks()
+ {
+ if (($ranks = $this->driver->get('_ranks')) === false)
+ {
+ $sql = 'SELECT *
+ FROM ' . RANKS_TABLE . '
+ ORDER BY rank_min DESC';
+ $result = $this->db->sql_query($sql);
+
+ $ranks = array();
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ if ($row['rank_special'])
+ {
+ unset($row['rank_min']);
+ $ranks['special'][$row['rank_id']] = $row;
+ }
+ else
+ {
+ $ranks['normal'][$row['rank_id']] = $row;
+ }
+ }
+ $this->db->sql_freeresult($result);
+
+ $this->driver->put('_ranks', $ranks);
+ }
+
+ return $ranks;
+ }
+
+ /**
+ * Obtain allowed extensions
+ *
+ * @param mixed $forum_id If false then check for private messaging, if int then check for forum id. If true, then only return extension informations.
+ *
+ * @return array allowed extensions array.
+ */
+ function obtain_attach_extensions($forum_id)
+ {
+ if (($extensions = $this->driver->get('_extensions')) === false)
+ {
+ $extensions = array(
+ '_allowed_post' => array(),
+ '_allowed_pm' => array(),
+ );
+
+ // The rule is to only allow those extensions defined. ;)
+ $sql = 'SELECT e.extension, g.*
+ FROM ' . EXTENSIONS_TABLE . ' e, ' . EXTENSION_GROUPS_TABLE . ' g
+ WHERE e.group_id = g.group_id
+ AND (g.allow_group = 1 OR g.allow_in_pm = 1)';
+ $result = $this->db->sql_query($sql);
+
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $extension = strtolower(trim($row['extension']));
+
+ $extensions[$extension] = array(
+ 'display_cat' => (int) $row['cat_id'],
+ 'download_mode' => (int) $row['download_mode'],
+ 'upload_icon' => trim($row['upload_icon']),
+ 'max_filesize' => (int) $row['max_filesize'],
+ 'allow_group' => $row['allow_group'],
+ 'allow_in_pm' => $row['allow_in_pm'],
+ 'group_name' => $row['group_name'],
+ );
+
+ $allowed_forums = ($row['allowed_forums']) ? unserialize(trim($row['allowed_forums'])) : array();
+
+ // Store allowed extensions forum wise
+ if ($row['allow_group'])
+ {
+ $extensions['_allowed_post'][$extension] = (!sizeof($allowed_forums)) ? 0 : $allowed_forums;
+ }
+
+ if ($row['allow_in_pm'])
+ {
+ $extensions['_allowed_pm'][$extension] = 0;
+ }
+ }
+ $this->db->sql_freeresult($result);
+
+ $this->driver->put('_extensions', $extensions);
+ }
+
+ // Forum post
+ if ($forum_id === false)
+ {
+ // We are checking for private messages, therefore we only need to get the pm extensions...
+ $return = array('_allowed_' => array());
+
+ foreach ($extensions['_allowed_pm'] as $extension => $check)
+ {
+ $return['_allowed_'][$extension] = 0;
+ $return[$extension] = $extensions[$extension];
+ }
+
+ $extensions = $return;
+ }
+ else if ($forum_id === true)
+ {
+ return $extensions;
+ }
+ else
+ {
+ $forum_id = (int) $forum_id;
+ $return = array('_allowed_' => array());
+
+ foreach ($extensions['_allowed_post'] as $extension => $check)
+ {
+ // Check for allowed forums
+ if (is_array($check))
+ {
+ $allowed = (!in_array($forum_id, $check)) ? false : true;
+ }
+ else
+ {
+ $allowed = true;
+ }
+
+ if ($allowed)
+ {
+ $return['_allowed_'][$extension] = 0;
+ $return[$extension] = $extensions[$extension];
+ }
+ }
+
+ $extensions = $return;
+ }
+
+ if (!isset($extensions['_allowed_']))
+ {
+ $extensions['_allowed_'] = array();
+ }
+
+ return $extensions;
+ }
+
+ /**
+ * Obtain active bots
+ */
+ function obtain_bots()
+ {
+ if (($bots = $this->driver->get('_bots')) === false)
+ {
+ switch ($this->db->get_sql_layer())
+ {
+ case 'mssql':
+ case 'mssql_odbc':
+ case 'mssqlnative':
+ $sql = 'SELECT user_id, bot_agent, bot_ip
+ FROM ' . BOTS_TABLE . '
+ WHERE bot_active = 1
+ ORDER BY LEN(bot_agent) DESC';
+ break;
+
+ // LENGTH supported by MySQL, IBM DB2 and Oracle for sure...
+ default:
+ $sql = 'SELECT user_id, bot_agent, bot_ip
+ FROM ' . BOTS_TABLE . '
+ WHERE bot_active = 1
+ ORDER BY LENGTH(bot_agent) DESC';
+ break;
+ }
+ $result = $this->db->sql_query($sql);
+
+ $bots = array();
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $bots[] = $row;
+ }
+ $this->db->sql_freeresult($result);
+
+ $this->driver->put('_bots', $bots);
+ }
+
+ return $bots;
+ }
+
+ /**
+ * Obtain cfg file data
+ */
+ function obtain_cfg_items($style)
+ {
+ $parsed_array = $this->driver->get('_cfg_' . $style['style_path']);
+
+ if ($parsed_array === false)
+ {
+ $parsed_array = array();
+ }
+
+ $filename = $this->phpbb_root_path . 'styles/' . $style['style_path'] . '/style.cfg';
+
+ if (!file_exists($filename))
+ {
+ return $parsed_array;
+ }
+
+ if (!isset($parsed_array['filetime']) || (($this->config['load_tplcompile'] && @filemtime($filename) > $parsed_array['filetime'])))
+ {
+ // Re-parse cfg file
+ $parsed_array = parse_cfg_file($filename);
+ $parsed_array['filetime'] = @filemtime($filename);
+
+ $this->driver->put('_cfg_' . $style['style_path'], $parsed_array);
+ }
+
+ return $parsed_array;
+ }
+
+ /**
+ * Obtain disallowed usernames
+ */
+ function obtain_disallowed_usernames()
+ {
+ if (($usernames = $this->driver->get('_disallowed_usernames')) === false)
+ {
+ $sql = 'SELECT disallow_username
+ FROM ' . DISALLOW_TABLE;
+ $result = $this->db->sql_query($sql);
+
+ $usernames = array();
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $usernames[] = str_replace('%', '.*?', preg_quote(utf8_clean_string($row['disallow_username']), '#'));
+ }
+ $this->db->sql_freeresult($result);
+
+ $this->driver->put('_disallowed_usernames', $usernames);
+ }
+
+ return $usernames;
+ }
+}
diff --git a/phpBB/phpbb/captcha/char_cube3d.php b/phpBB/phpbb/captcha/char_cube3d.php
new file mode 100644
index 0000000000..a712b16dce
--- /dev/null
+++ b/phpBB/phpbb/captcha/char_cube3d.php
@@ -0,0 +1,277 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\captcha;
+
+class char_cube3d
+{
+ var $bitmap;
+ var $bitmap_width;
+ var $bitmap_height;
+
+ var $basis_matrix = array(array(1, 0, 0), array(0, 1, 0), array(0, 0, 1));
+ var $abs_x = array(1, 0);
+ var $abs_y = array(0, 1);
+ var $x = 0;
+ var $y = 1;
+ var $z = 2;
+ var $letter = '';
+
+ /**
+ */
+ function __construct(&$bitmaps, $letter)
+ {
+ $this->bitmap = $bitmaps['data'][$letter];
+ $this->bitmap_width = $bitmaps['width'];
+ $this->bitmap_height = $bitmaps['height'];
+
+ $this->basis_matrix[0][0] = mt_rand(-600, 600);
+ $this->basis_matrix[0][1] = mt_rand(-600, 600);
+ $this->basis_matrix[0][2] = (mt_rand(0, 1) * 2000) - 1000;
+ $this->basis_matrix[1][0] = mt_rand(-1000, 1000);
+ $this->basis_matrix[1][1] = mt_rand(-1000, 1000);
+ $this->basis_matrix[1][2] = mt_rand(-1000, 1000);
+
+ $this->normalize($this->basis_matrix[0]);
+ $this->normalize($this->basis_matrix[1]);
+ $this->basis_matrix[2] = $this->cross_product($this->basis_matrix[0], $this->basis_matrix[1]);
+ $this->normalize($this->basis_matrix[2]);
+
+ // $this->basis_matrix[1] might not be (probably isn't) orthogonal to $basis_matrix[0]
+ $this->basis_matrix[1] = $this->cross_product($this->basis_matrix[0], $this->basis_matrix[2]);
+ $this->normalize($this->basis_matrix[1]);
+
+ // Make sure our cube is facing into the canvas (assuming +z == in)
+ for ($i = 0; $i < 3; ++$i)
+ {
+ if ($this->basis_matrix[$i][2] < 0)
+ {
+ $this->basis_matrix[$i][0] *= -1;
+ $this->basis_matrix[$i][1] *= -1;
+ $this->basis_matrix[$i][2] *= -1;
+ }
+ }
+
+ // Force our "z" basis vector to be the one with greatest absolute z value
+ $this->x = 0;
+ $this->y = 1;
+ $this->z = 2;
+
+ // Swap "y" with "z"
+ if ($this->basis_matrix[1][2] > $this->basis_matrix[2][2])
+ {
+ $this->z = 1;
+ $this->y = 2;
+ }
+
+ // Swap "x" with "z"
+ if ($this->basis_matrix[0][2] > $this->basis_matrix[$this->z][2])
+ {
+ $this->x = $this->z;
+ $this->z = 0;
+ }
+
+ // Still need to determine which of $x,$y are which.
+ // wrong orientation if y's y-component is less than it's x-component
+ // likewise if x's x-component is less than it's y-component
+ // if they disagree, go with the one with the greater weight difference.
+ // rotate if positive
+ $weight = (abs($this->basis_matrix[$this->x][1]) - abs($this->basis_matrix[$this->x][0])) + (abs($this->basis_matrix[$this->y][0]) - abs($this->basis_matrix[$this->y][1]));
+
+ // Swap "x" with "y"
+ if ($weight > 0)
+ {
+ list($this->x, $this->y) = array($this->y, $this->x);
+ }
+
+ $this->abs_x = array($this->basis_matrix[$this->x][0], $this->basis_matrix[$this->x][1]);
+ $this->abs_y = array($this->basis_matrix[$this->y][0], $this->basis_matrix[$this->y][1]);
+
+ if ($this->abs_x[0] < 0)
+ {
+ $this->abs_x[0] *= -1;
+ $this->abs_x[1] *= -1;
+ }
+
+ if ($this->abs_y[1] > 0)
+ {
+ $this->abs_y[0] *= -1;
+ $this->abs_y[1] *= -1;
+ }
+
+ $this->letter = $letter;
+ }
+
+ /**
+ * Draw a character
+ */
+ function drawchar($scale, $xoff, $yoff, $img, $background, $colours)
+ {
+ $width = $this->bitmap_width;
+ $height = $this->bitmap_height;
+ $bitmap = $this->bitmap;
+
+ $colour1 = $colours[array_rand($colours)];
+ $colour2 = $colours[array_rand($colours)];
+
+ $swapx = ($this->basis_matrix[$this->x][0] > 0);
+ $swapy = ($this->basis_matrix[$this->y][1] < 0);
+
+ for ($y = 0; $y < $height; ++$y)
+ {
+ for ($x = 0; $x < $width; ++$x)
+ {
+ $xp = ($swapx) ? ($width - $x - 1) : $x;
+ $yp = ($swapy) ? ($height - $y - 1) : $y;
+
+ if ($bitmap[$height - $yp - 1][$xp])
+ {
+ $dx = $this->scale($this->abs_x, ($xp - ($swapx ? ($width / 2) : ($width / 2) - 1)) * $scale);
+ $dy = $this->scale($this->abs_y, ($yp - ($swapy ? ($height / 2) : ($height / 2) - 1)) * $scale);
+ $xo = $xoff + $dx[0] + $dy[0];
+ $yo = $yoff + $dx[1] + $dy[1];
+
+ $origin = array(0, 0, 0);
+ $xvec = $this->scale($this->basis_matrix[$this->x], $scale);
+ $yvec = $this->scale($this->basis_matrix[$this->y], $scale);
+ $face_corner = $this->sum2($xvec, $yvec);
+
+ $zvec = $this->scale($this->basis_matrix[$this->z], $scale);
+ $x_corner = $this->sum2($xvec, $zvec);
+ $y_corner = $this->sum2($yvec, $zvec);
+
+ imagefilledpolygon($img, $this->gen_poly($xo, $yo, $origin, $xvec, $x_corner,$zvec), 4, $colour1);
+ imagefilledpolygon($img, $this->gen_poly($xo, $yo, $origin, $yvec, $y_corner,$zvec), 4, $colour2);
+
+ $face = $this->gen_poly($xo, $yo, $origin, $xvec, $face_corner, $yvec);
+
+ imagefilledpolygon($img, $face, 4, $background);
+ imagepolygon($img, $face, 4, $colour1);
+ }
+ }
+ }
+ }
+
+ /*
+ * return a roughly acceptable range of sizes for rendering with this texttype
+ */
+ function range()
+ {
+ return array(3, 4);
+ }
+
+ /**
+ * Vector length
+ */
+ function vectorlen($vector)
+ {
+ return sqrt(pow($vector[0], 2) + pow($vector[1], 2) + pow($vector[2], 2));
+ }
+
+ /**
+ * Normalize
+ */
+ function normalize(&$vector, $length = 1)
+ {
+ $length = (( $length < 1) ? 1 : $length);
+ $length /= $this->vectorlen($vector);
+ $vector[0] *= $length;
+ $vector[1] *= $length;
+ $vector[2] *= $length;
+ }
+
+ /**
+ */
+ function cross_product($vector1, $vector2)
+ {
+ $retval = array(0, 0, 0);
+ $retval[0] = (($vector1[1] * $vector2[2]) - ($vector1[2] * $vector2[1]));
+ $retval[1] = -(($vector1[0] * $vector2[2]) - ($vector1[2] * $vector2[0]));
+ $retval[2] = (($vector1[0] * $vector2[1]) - ($vector1[1] * $vector2[0]));
+
+ return $retval;
+ }
+
+ /**
+ */
+ function sum($vector1, $vector2)
+ {
+ return array($vector1[0] + $vector2[0], $vector1[1] + $vector2[1], $vector1[2] + $vector2[2]);
+ }
+
+ /**
+ */
+ function sum2($vector1, $vector2)
+ {
+ return array($vector1[0] + $vector2[0], $vector1[1] + $vector2[1]);
+ }
+
+ /**
+ */
+ function scale($vector, $length)
+ {
+ if (sizeof($vector) == 2)
+ {
+ return array($vector[0] * $length, $vector[1] * $length);
+ }
+
+ return array($vector[0] * $length, $vector[1] * $length, $vector[2] * $length);
+ }
+
+ /**
+ */
+ function gen_poly($xoff, $yoff, &$vec1, &$vec2, &$vec3, &$vec4)
+ {
+ $poly = array();
+ $poly[0] = $xoff + $vec1[0];
+ $poly[1] = $yoff + $vec1[1];
+ $poly[2] = $xoff + $vec2[0];
+ $poly[3] = $yoff + $vec2[1];
+ $poly[4] = $xoff + $vec3[0];
+ $poly[5] = $yoff + $vec3[1];
+ $poly[6] = $xoff + $vec4[0];
+ $poly[7] = $yoff + $vec4[1];
+
+ return $poly;
+ }
+
+ /**
+ * dimensions
+ */
+ function dimensions($size)
+ {
+ $xn = $this->scale($this->basis_matrix[$this->x], -($this->bitmap_width / 2) * $size);
+ $xp = $this->scale($this->basis_matrix[$this->x], ($this->bitmap_width / 2) * $size);
+ $yn = $this->scale($this->basis_matrix[$this->y], -($this->bitmap_height / 2) * $size);
+ $yp = $this->scale($this->basis_matrix[$this->y], ($this->bitmap_height / 2) * $size);
+
+ $p = array();
+ $p[0] = $this->sum2($xn, $yn);
+ $p[1] = $this->sum2($xp, $yn);
+ $p[2] = $this->sum2($xp, $yp);
+ $p[3] = $this->sum2($xn, $yp);
+
+ $min_x = $max_x = $p[0][0];
+ $min_y = $max_y = $p[0][1];
+
+ for ($i = 1; $i < 4; ++$i)
+ {
+ $min_x = ($min_x > $p[$i][0]) ? $p[$i][0] : $min_x;
+ $min_y = ($min_y > $p[$i][1]) ? $p[$i][1] : $min_y;
+ $max_x = ($max_x < $p[$i][0]) ? $p[$i][0] : $max_x;
+ $max_y = ($max_y < $p[$i][1]) ? $p[$i][1] : $max_y;
+ }
+
+ return array($min_x, $min_y, $max_x, $max_y);
+ }
+}
diff --git a/phpBB/phpbb/captcha/colour_manager.php b/phpBB/phpbb/captcha/colour_manager.php
new file mode 100644
index 0000000000..6ca3c3fd2c
--- /dev/null
+++ b/phpBB/phpbb/captcha/colour_manager.php
@@ -0,0 +1,527 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\captcha;
+
+class colour_manager
+{
+ var $img;
+ var $mode;
+ var $colours;
+ var $named_colours;
+
+ /**
+ * Create the colour manager, link it to the image resource
+ */
+ function __construct($img, $background = false, $mode = 'ahsv')
+ {
+ $this->img = $img;
+ $this->mode = $mode;
+ $this->colours = array();
+ $this->named_colours = array();
+
+ if ($background !== false)
+ {
+ $bg = $this->allocate_named('background', $background);
+ imagefill($this->img, 0, 0, $bg);
+ }
+ }
+
+ /**
+ * Lookup a named colour resource
+ */
+ function get_resource($named_colour)
+ {
+ if (isset($this->named_colours[$named_colour]))
+ {
+ return $this->named_colours[$named_colour];
+ }
+
+ if (isset($this->named_rgb[$named_colour]))
+ {
+ return $this->allocate_named($named_colour, $this->named_rgb[$named_colour], 'rgb');
+ }
+
+ return false;
+ }
+
+ /**
+ * Assign a name to a colour resource
+ */
+ function name_colour($name, $resource)
+ {
+ $this->named_colours[$name] = $resource;
+ }
+
+ /**
+ * names and allocates a colour resource
+ */
+ function allocate_named($name, $colour, $mode = false)
+ {
+ $resource = $this->allocate($colour, $mode);
+
+ if ($resource !== false)
+ {
+ $this->name_colour($name, $resource);
+ }
+ return $resource;
+ }
+
+ /**
+ * allocates a specified colour into the image
+ */
+ function allocate($colour, $mode = false)
+ {
+ if ($mode === false)
+ {
+ $mode = $this->mode;
+ }
+
+ if (!is_array($colour))
+ {
+ if (isset($this->named_rgb[$colour]))
+ {
+ return $this->allocate_named($colour, $this->named_rgb[$colour], 'rgb');
+ }
+
+ if (!is_int($colour))
+ {
+ return false;
+ }
+
+ $mode = 'rgb';
+ $colour = array(255 & ($colour >> 16), 255 & ($colour >> 8), 255 & $colour);
+ }
+
+ if (isset($colour['mode']))
+ {
+ $mode = $colour['mode'];
+ unset($colour['mode']);
+ }
+
+ if (isset($colour['random']))
+ {
+ unset($colour['random']);
+ // everything else is params
+ return $this->random_colour($colour, $mode);
+ }
+
+ $rgb = $this->model_convert($colour, $mode, 'rgb');
+ $store = ($this->mode == 'rgb') ? $rgb : $this->model_convert($colour, $mode, $this->mode);
+ $resource = imagecolorallocate($this->img, $rgb[0], $rgb[1], $rgb[2]);
+ $this->colours[$resource] = $store;
+
+ return $resource;
+ }
+
+ /**
+ * randomly generates a colour, with optional params
+ */
+ function random_colour($params = array(), $mode = false)
+ {
+ if ($mode === false)
+ {
+ $mode = $this->mode;
+ }
+
+ switch ($mode)
+ {
+ case 'rgb':
+ // @TODO random rgb generation. do we intend to do this, or is it just too tedious?
+ break;
+
+ case 'ahsv':
+ case 'hsv':
+ default:
+
+ $default_params = array(
+ 'hue_bias' => false, // degree / 'r'/'g'/'b'/'c'/'m'/'y' /'o'
+ 'hue_range' => false, // if hue bias, then difference range +/- from bias
+ 'min_saturation' => 30, // 0 - 100
+ 'max_saturation' => 80, // 0 - 100
+ 'min_value' => 30, // 0 - 100
+ 'max_value' => 80, // 0 - 100
+ );
+
+ $alt = ($mode == 'ahsv') ? true : false;
+ $params = array_merge($default_params, $params);
+
+ $min_hue = 0;
+ $max_hue = 359;
+ $min_saturation = max(0, $params['min_saturation']);
+ $max_saturation = min(100, $params['max_saturation']);
+ $min_value = max(0, $params['min_value']);
+ $max_value = min(100, $params['max_value']);
+
+ if ($params['hue_bias'] !== false)
+ {
+ if (is_numeric($params['hue_bias']))
+ {
+ $h = intval($params['hue_bias']) % 360;
+ }
+ else
+ {
+ switch ($params['hue_bias'])
+ {
+ case 'o':
+ $h = $alt ? 60 : 30;
+ break;
+
+ case 'y':
+ $h = $alt ? 120 : 60;
+ break;
+
+ case 'g':
+ $h = $alt ? 180 : 120;
+ break;
+
+ case 'c':
+ $h = $alt ? 210 : 180;
+ break;
+
+ case 'b':
+ $h = 240;
+ break;
+
+ case 'm':
+ $h = 300;
+ break;
+
+ case 'r':
+ default:
+ $h = 0;
+ break;
+ }
+ }
+
+ $min_hue = $h + 360;
+ $max_hue = $h + 360;
+
+ if ($params['hue_range'])
+ {
+ $min_hue -= min(180, $params['hue_range']);
+ $max_hue += min(180, $params['hue_range']);
+ }
+ }
+
+ $h = mt_rand($min_hue, $max_hue);
+ $s = mt_rand($min_saturation, $max_saturation);
+ $v = mt_rand($min_value, $max_value);
+
+ return $this->allocate(array($h, $s, $v), $mode);
+
+ break;
+ }
+ }
+
+ /**
+ */
+ function colour_scheme($resource, $include_original = true)
+ {
+ $mode = 'hsv';
+
+ if (($pre = $this->get_resource($resource)) !== false)
+ {
+ $resource = $pre;
+ }
+
+ $colour = $this->model_convert($this->colours[$resource], $this->mode, $mode);
+ $results = ($include_original) ? array($resource) : array();
+ $colour2 = $colour3 = $colour4 = $colour;
+ $colour2[0] += 150;
+ $colour3[0] += 180;
+ $colour4[0] += 210;
+
+ $results[] = $this->allocate($colour2, $mode);
+ $results[] = $this->allocate($colour3, $mode);
+ $results[] = $this->allocate($colour4, $mode);
+
+ return $results;
+ }
+
+ /**
+ */
+ function mono_range($resource, $count = 5, $include_original = true)
+ {
+ if (is_array($resource))
+ {
+ $results = array();
+ for ($i = 0, $size = sizeof($resource); $i < $size; ++$i)
+ {
+ $results = array_merge($results, $this->mono_range($resource[$i], $count, $include_original));
+ }
+ return $results;
+ }
+
+ $mode = (in_array($this->mode, array('hsv', 'ahsv'), true) ? $this->mode : 'ahsv');
+ if (($pre = $this->get_resource($resource)) !== false)
+ {
+ $resource = $pre;
+ }
+
+ $colour = $this->model_convert($this->colours[$resource], $this->mode, $mode);
+
+ $results = array();
+ if ($include_original)
+ {
+ $results[] = $resource;
+ $count--;
+ }
+
+ // This is a hard problem. I chicken out and try to maintain readability at the cost of less randomness.
+
+ while ($count > 0)
+ {
+ $colour[1] = ($colour[1] + mt_rand(40,60)) % 99;
+ $colour[2] = ($colour[2] + mt_rand(40,60));
+ $results[] = $this->allocate($colour, $mode);
+ $count--;
+ }
+ return $results;
+ }
+
+ /**
+ * Convert from one colour model to another
+ */
+ function model_convert($colour, $from_model, $to_model)
+ {
+ if ($from_model == $to_model)
+ {
+ return $colour;
+ }
+
+ switch ($to_model)
+ {
+ case 'hsv':
+
+ switch ($from_model)
+ {
+ case 'ahsv':
+ return $this->ah2h($colour);
+ break;
+
+ case 'rgb':
+ return $this->rgb2hsv($colour);
+ break;
+ }
+ break;
+
+ case 'ahsv':
+
+ switch ($from_model)
+ {
+ case 'hsv':
+ return $this->h2ah($colour);
+ break;
+
+ case 'rgb':
+ return $this->h2ah($this->rgb2hsv($colour));
+ break;
+ }
+ break;
+
+ case 'rgb':
+ switch ($from_model)
+ {
+ case 'hsv':
+ return $this->hsv2rgb($colour);
+ break;
+
+ case 'ahsv':
+ return $this->hsv2rgb($this->ah2h($colour));
+ break;
+ }
+ break;
+ }
+ return false;
+ }
+
+ /**
+ * Slightly altered from wikipedia's algorithm
+ */
+ function hsv2rgb($hsv)
+ {
+ $this->normalize_hue($hsv[0]);
+
+ $h = $hsv[0];
+ $s = min(1, max(0, $hsv[1] / 100));
+ $v = min(1, max(0, $hsv[2] / 100));
+
+ // calculate hue sector
+ $hi = floor($hsv[0] / 60);
+
+ // calculate opposite colour
+ $p = $v * (1 - $s);
+
+ // calculate distance between hex vertices
+ $f = ($h / 60) - $hi;
+
+ // coming in or going out?
+ if (!($hi & 1))
+ {
+ $f = 1 - $f;
+ }
+
+ // calculate adjacent colour
+ $q = $v * (1 - ($f * $s));
+
+ switch ($hi)
+ {
+ case 0:
+ $rgb = array($v, $q, $p);
+ break;
+
+ case 1:
+ $rgb = array($q, $v, $p);
+ break;
+
+ case 2:
+ $rgb = array($p, $v, $q);
+ break;
+
+ case 3:
+ $rgb = array($p, $q, $v);
+ break;
+
+ case 4:
+ $rgb = array($q, $p, $v);
+ break;
+
+ case 5:
+ $rgb = array($v, $p, $q);
+ break;
+
+ default:
+ return array(0, 0, 0);
+ break;
+ }
+
+ return array(255 * $rgb[0], 255 * $rgb[1], 255 * $rgb[2]);
+ }
+
+ /**
+ * (more than) Slightly altered from wikipedia's algorithm
+ */
+ function rgb2hsv($rgb)
+ {
+ $r = min(255, max(0, $rgb[0]));
+ $g = min(255, max(0, $rgb[1]));
+ $b = min(255, max(0, $rgb[2]));
+ $max = max($r, $g, $b);
+ $min = min($r, $g, $b);
+
+ $v = $max / 255;
+ $s = (!$max) ? 0 : 1 - ($min / $max);
+
+ // if max - min is 0, we want hue to be 0 anyway.
+ $h = $max - $min;
+
+ if ($h)
+ {
+ switch ($max)
+ {
+ case $g:
+ $h = 120 + (60 * ($b - $r) / $h);
+ break;
+
+ case $b:
+ $h = 240 + (60 * ($r - $g) / $h);
+ break;
+
+ case $r:
+ $h = 360 + (60 * ($g - $b) / $h);
+ break;
+ }
+ }
+ $this->normalize_hue($h);
+
+ return array($h, $s * 100, $v * 100);
+ }
+
+ /**
+ */
+ function normalize_hue(&$hue)
+ {
+ $hue %= 360;
+
+ if ($hue < 0)
+ {
+ $hue += 360;
+ }
+ }
+
+ /**
+ * Alternate hue to hue
+ */
+ function ah2h($ahue)
+ {
+ if (is_array($ahue))
+ {
+ $ahue[0] = $this->ah2h($ahue[0]);
+ return $ahue;
+ }
+ $this->normalize_hue($ahue);
+
+ // blue through red is already ok
+ if ($ahue >= 240)
+ {
+ return $ahue;
+ }
+
+ // ahue green is at 180
+ if ($ahue >= 180)
+ {
+ // return (240 - (2 * (240 - $ahue)));
+ return (2 * $ahue) - 240; // equivalent
+ }
+
+ // ahue yellow is at 120 (RYB rather than RGB)
+ if ($ahue >= 120)
+ {
+ return $ahue - 60;
+ }
+
+ return $ahue / 2;
+ }
+
+ /**
+ * hue to Alternate hue
+ */
+ function h2ah($hue)
+ {
+ if (is_array($hue))
+ {
+ $hue[0] = $this->h2ah($hue[0]);
+ return $hue;
+ }
+ $this->normalize_hue($hue);
+
+ // blue through red is already ok
+ if ($hue >= 240)
+ {
+ return $hue;
+ }
+ else if ($hue <= 60)
+ {
+ return $hue * 2;
+ }
+ else if ($hue <= 120)
+ {
+ return $hue + 60;
+ }
+ else
+ {
+ return ($hue + 240) / 2;
+ }
+ }
+}
diff --git a/phpBB/phpbb/captcha/factory.php b/phpBB/phpbb/captcha/factory.php
new file mode 100644
index 0000000000..dd44aca8bb
--- /dev/null
+++ b/phpBB/phpbb/captcha/factory.php
@@ -0,0 +1,88 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\captcha;
+
+class factory
+{
+ /**
+ * @var \Symfony\Component\DependencyInjection\ContainerInterface
+ */
+ private $container;
+
+ /**
+ * @var \phpbb\di\service_collection
+ */
+ private $plugins;
+
+ /**
+ * Constructor
+ *
+ * @param \Symfony\Component\DependencyInjection\ContainerInterface $container
+ * @param \phpbb\di\service_collection $plugins
+ */
+ public function __construct(\Symfony\Component\DependencyInjection\ContainerInterface $container, \phpbb\di\service_collection $plugins)
+ {
+ $this->container = $container;
+ $this->plugins = $plugins;
+ }
+
+ /**
+ * Return a new instance of a given plugin
+ *
+ * @param $name
+ * @return object
+ */
+ public function get_instance($name)
+ {
+ return $this->container->get($name);
+ }
+
+ /**
+ * Call the garbage collector
+ *
+ * @param string $name The name to the captcha service.
+ */
+ function garbage_collect($name)
+ {
+ $captcha = $this->get_instance($name);
+ $captcha->garbage_collect(0);
+ }
+
+ /**
+ * Return a list of all registered CAPTCHA plugins
+ *
+ * @returns array
+ */
+ function get_captcha_types()
+ {
+ $captchas = array(
+ 'available' => array(),
+ 'unavailable' => array(),
+ );
+
+ foreach ($this->plugins as $plugin => $plugin_instance)
+ {
+ if ($plugin_instance->is_available())
+ {
+ $captchas['available'][$plugin] = $plugin_instance->get_name();
+ }
+ else
+ {
+ $captchas['unavailable'][$plugin] = $plugin_instance->get_name();
+ }
+ }
+
+ return $captchas;
+ }
+}
diff --git a/phpBB/phpbb/captcha/gd.php b/phpBB/phpbb/captcha/gd.php
new file mode 100644
index 0000000000..652df28f8a
--- /dev/null
+++ b/phpBB/phpbb/captcha/gd.php
@@ -0,0 +1,1847 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\captcha;
+
+class gd
+{
+ var $width = 360;
+ var $height = 96;
+
+ /**
+ * Create the image containing $code with a seed of $seed
+ */
+ function execute($code, $seed)
+ {
+ global $config;
+
+ mt_srand($seed);
+
+ // Create image
+ $img = imagecreatetruecolor($this->width, $this->height);
+
+ // Generate colours
+ $colour = new colour_manager($img, array(
+ 'random' => true,
+ 'min_value' => 60,
+ ), 'hsv');
+
+ $scheme = $colour->colour_scheme('background', false);
+ $scheme = $colour->mono_range($scheme, 10, false);
+ shuffle($scheme);
+
+ $bg_colours = array_splice($scheme, mt_rand(6, 12));
+
+ // Generate code characters
+ $characters = $sizes = $bounding_boxes = $noise = array();
+ $width_avail = $this->width - 15;
+ $code_len = strlen($code);
+ $captcha_bitmaps = $this->captcha_bitmaps();
+
+ for ($i = 0; $i < $code_len; ++$i)
+ {
+ $characters[$i] = new char_cube3d($captcha_bitmaps, $code[$i]);
+
+ list($min, $max) = $characters[$i]->range();
+ $sizes[$i] = mt_rand($min, $max);
+
+ $box = $characters[$i]->dimensions($sizes[$i]);
+ $width_avail -= ($box[2] - $box[0]);
+ $bounding_boxes[$i] = $box;
+ }
+
+ // Redistribute leftover x-space
+ $offset = array();
+ for ($i = 0; $i < $code_len; ++$i)
+ {
+ $denom = ($code_len - $i);
+ $denom = max(1.3, $denom);
+ $offset[$i] = phpbb_mt_rand(0, (int) round((1.5 * $width_avail) / $denom));
+ $width_avail -= $offset[$i];
+ }
+
+ if ($config['captcha_gd_x_grid'])
+ {
+ $grid = (int) $config['captcha_gd_x_grid'];
+ for ($y = 0; $y < $this->height; $y += mt_rand($grid - 2, $grid + 2))
+ {
+ $current_colour = $scheme[array_rand($scheme)];
+ imageline($img, mt_rand(0,4), mt_rand($y - 3, $y), mt_rand($this->width - 5, $this->width), mt_rand($y - 3, $y), $current_colour);
+ }
+ }
+
+ if ($config['captcha_gd_y_grid'])
+ {
+ $grid = (int) $config['captcha_gd_y_grid'];
+ for ($x = 0; $x < $this->width; $x += mt_rand($grid - 2, $grid + 2))
+ {
+ $current_colour = $scheme[array_rand($scheme)];
+ imagedashedline($img, mt_rand($x -3, $x + 3), mt_rand(0, 4), mt_rand($x -3, $x + 3), mt_rand($this->height - 5, $this->height), $current_colour);
+ }
+ }
+
+ if ($config['captcha_gd_wave'] && ($config['captcha_gd_y_grid'] || $config['captcha_gd_y_grid']))
+ {
+ $this->wave($img);
+ }
+
+ if ($config['captcha_gd_3d_noise'])
+ {
+ $xoffset = mt_rand(0,9);
+ $noise_bitmaps = $this->captcha_noise_bg_bitmaps();
+ for ($i = 0; $i < $code_len; ++$i)
+ {
+ $noise[$i] = new char_cube3d($noise_bitmaps, mt_rand(1, sizeof($noise_bitmaps['data'])));
+
+ list($min, $max) = $noise[$i]->range();
+ //$box = $noise[$i]->dimensions($sizes[$i]);
+ }
+ $xoffset = 0;
+ for ($i = 0; $i < $code_len; ++$i)
+ {
+ $dimm = $bounding_boxes[$i];
+ $xoffset += ($offset[$i] - $dimm[0]);
+ $yoffset = mt_rand(-$dimm[1], $this->height - $dimm[3]);
+
+ $noise[$i]->drawchar($sizes[$i], $xoffset, $yoffset, $img, $colour->get_resource('background'), $scheme);
+ $xoffset += $dimm[2];
+ }
+ }
+
+ $xoffset = 5;
+ for ($i = 0; $i < $code_len; ++$i)
+ {
+ $dimm = $bounding_boxes[$i];
+ $xoffset += ($offset[$i] - $dimm[0]);
+ $yoffset = mt_rand(-$dimm[1], $this->height - $dimm[3]);
+
+ $characters[$i]->drawchar($sizes[$i], $xoffset, $yoffset, $img, $colour->get_resource('background'), $scheme);
+ $xoffset += $dimm[2];
+ }
+
+ if ($config['captcha_gd_wave'])
+ {
+ $this->wave($img);
+ }
+
+ if ($config['captcha_gd_foreground_noise'])
+ {
+ $this->noise_line($img, 0, 0, $this->width, $this->height, $colour->get_resource('background'), $scheme, $bg_colours);
+ }
+
+ // Send image
+ header('Content-Type: image/png');
+ header('Cache-control: no-cache, no-store');
+ imagepng($img);
+ imagedestroy($img);
+ }
+
+ /**
+ * Sinus
+ */
+ function wave($img)
+ {
+ global $config;
+
+ $period_x = mt_rand(12,18);
+ $period_y = mt_rand(7,14);
+ $amp_x = mt_rand(5,10);
+ $amp_y = mt_rand(2,4);
+ $socket = mt_rand(0,100);
+
+ $dampen_x = mt_rand($this->width/5, $this->width/2);
+ $dampen_y = mt_rand($this->height/5, $this->height/2);
+ $direction_x = (mt_rand (0, 1));
+ $direction_y = (mt_rand (0, 1));
+
+ for ($i = 0; $i < $this->width; $i++)
+ {
+ $dir = ($direction_x) ? $i : ($this->width - $i);
+ imagecopy($img, $img, $i-1, sin($socket+ $i/($period_x + $dir/$dampen_x)) * $amp_x, $i, 0, 1, $this->height);
+ }
+ $socket = mt_rand(0,100);
+ for ($i = 0; $i < $this->height; $i++)
+ {
+ $dir = ($direction_y) ? $i : ($this->height - $i);
+ imagecopy($img, $img ,sin($socket + $i/($period_y + ($dir)/$dampen_y)) * $amp_y, $i-1, 0, $i, $this->width, 1);
+ }
+ return $img;
+ }
+
+ /**
+ * Noise line
+ */
+ function noise_line($img, $min_x, $min_y, $max_x, $max_y, $bg, $font, $non_font)
+ {
+ imagesetthickness($img, 2);
+
+ $x1 = $min_x;
+ $x2 = $max_x;
+ $y1 = $min_y;
+ $y2 = $min_y;
+
+ do
+ {
+ $line = array_merge(
+ array_fill(0, mt_rand(30, 60), $non_font[array_rand($non_font)]),
+ array_fill(0, mt_rand(30, 60), $bg)
+ );
+
+ imagesetstyle($img, $line);
+ imageline($img, $x1, $y1, $x2, $y2, IMG_COLOR_STYLED);
+
+ $y1 += mt_rand(12, 35);
+ $y2 += mt_rand(12, 35);
+ }
+ while ($y1 < $max_y && $y2 < $max_y);
+
+ $x1 = $min_x;
+ $x2 = $min_x;
+ $y1 = $min_y;
+ $y2 = $max_y;
+
+ do
+ {
+ $line = array_merge(
+ array_fill(0, mt_rand(30, 60), $non_font[array_rand($non_font)]),
+ array_fill(0, mt_rand(30, 60), $bg)
+ );
+
+ imagesetstyle($img, $line);
+ imageline($img, $x1, $y1, $x2, $y2, IMG_COLOR_STYLED);
+
+ $x1 += mt_rand(20, 35);
+ $x2 += mt_rand(20, 35);
+ }
+ while ($x1 < $max_x && $x2 < $max_x);
+ imagesetthickness($img, 1);
+ }
+
+ function captcha_noise_bg_bitmaps()
+ {
+ return array(
+ 'width' => 15,
+ 'height' => 5,
+ 'data' => array(
+
+ 1 => array(
+ array(1,0,0,0,1,0,0,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,1,0,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,1,0,0,0,0,0,0,1,0,0),
+ array(1,0,0,0,0,0,1,0,0,0,0,1,0,0,0),
+ ),
+ 2 => array(
+ array(1,1,mt_rand(0,1),1,0,1,1,1,1,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,1,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0,1,1,0,1,1,1),
+ ),
+ 3 => array(
+ array(1,0,0,0,0,0,0,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,0,0,0,0,0,1,0),
+ array(0,0,0,0,1,0,0,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,0,0,0,0,0,1,0),
+ array(1,0,0,0,0,0,0,0,0,0,0,0,0,0,1),
+ ),
+ 4 => array(
+ array(1,0,1,0,1,0,0,1,1,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,1,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0),
+ array(1,0,1,0,0,0,0,0,0,0,0,0,0,0,0),
+ ),
+ 5 => array(
+ array(1,1,1,1,0,0,0,1,1,1,0,0,1,0,1),
+ array(0,0,0,0,0,0,0,1,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0),
+ array(1,0,1,0,0,0,0,0,0,0,0,0,0,0,0),
+ ),
+ 6 => array(
+ array(mt_rand(0,1),mt_rand(0,1),mt_rand(0,1),mt_rand(0,1),mt_rand(0,1),0,mt_rand(0,1),mt_rand(0,1),mt_rand(0,1),mt_rand(0,1),mt_rand(0,1),0,mt_rand(0,1),mt_rand(0,1),mt_rand(0,1)),
+ array(0,0,0,0,0,0,0,mt_rand(0,1),0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0),
+ array(mt_rand(0,1),0,mt_rand(0,1),0,0,0,0,0,0,0,0,0,0,0,0),
+ ),
+ 7 => array(
+ array(0,0,0,0,0,0,0,0,0,0,1,1,0,1,1),
+ array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0),
+ array(0,0,1,1,0,0,0,1,0,0,0,0,0,0,0),
+ array(0,1,0,0,0,1,0,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0,0,0,0,0,0,0),
+ ),
+ ));
+ }
+
+ /**
+ * Return bitmaps
+ */
+ function captcha_bitmaps()
+ {
+ global $config;
+
+ $chars = array(
+ 'A' => array(
+ array(
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,1,0,1,0,0,0),
+ array(0,0,0,1,0,1,0,0,0),
+ array(0,0,0,1,0,1,0,0,0),
+ array(0,0,1,0,0,0,1,0,0),
+ array(0,0,1,0,0,0,1,0,0),
+ array(0,0,1,0,0,0,1,0,0),
+ array(0,1,0,0,0,0,0,1,0),
+ array(0,1,0,0,0,0,0,1,0),
+ array(0,1,1,1,1,1,1,1,0),
+ array(0,1,0,0,0,0,0,1,0),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ ),
+ array(
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,1,0,1,0,0,0),
+ array(0,0,1,1,0,1,1,0,0),
+ array(0,0,1,0,0,0,1,0,0),
+ array(0,1,0,0,0,0,0,1,0),
+ array(0,1,0,0,0,0,0,1,0),
+ array(0,1,1,1,1,1,1,1,0),
+ array(0,1,0,0,0,0,0,1,0),
+ array(0,1,0,0,0,0,0,1,0),
+ array(0,1,0,0,0,0,0,1,0),
+ array(0,1,0,0,0,0,0,1,0),
+ array(0,1,0,0,0,0,0,1,0),
+ array(1,1,1,0,0,0,1,1,1),
+ ),
+ array(
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,1,1,1,1,1,0,0),
+ array(0,1,1,0,0,0,1,1,0),
+ array(1,1,0,0,0,0,0,1,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(0,0,0,0,0,0,0,1,1),
+ array(0,0,0,0,0,1,1,1,1),
+ array(0,0,0,1,1,1,0,0,1),
+ array(0,1,1,1,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,1,0,0,0,0,1,1,1),
+ array(0,1,1,1,1,1,1,0,1),
+ ),
+ ),
+ 'B' => array(
+ array(
+ array(1,1,1,1,1,1,1,0,0),
+ array(1,0,0,0,0,0,0,1,0),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,1,0),
+ array(1,1,1,1,1,1,1,0,0),
+ array(1,0,0,0,0,0,0,1,0),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,1,0),
+ array(1,1,1,1,1,1,1,0,0),
+ ),
+ array(
+ array(1,1,1,1,1,1,1,0,0),
+ array(0,1,0,0,0,0,0,1,0),
+ array(0,1,0,0,0,0,0,0,1),
+ array(0,1,0,0,0,0,0,0,1),
+ array(0,1,0,0,0,0,0,0,1),
+ array(0,1,0,0,0,0,0,0,1),
+ array(0,1,0,0,0,0,0,1,0),
+ array(0,1,1,1,1,1,1,0,0),
+ array(0,1,0,0,0,0,0,1,0),
+ array(0,1,0,0,0,0,0,0,1),
+ array(0,1,0,0,0,0,0,0,1),
+ array(0,1,0,0,0,0,0,0,1),
+ array(0,1,0,0,0,0,0,0,1),
+ array(0,1,0,0,0,0,0,1,0),
+ array(1,1,1,1,1,1,1,0,0),
+ ),
+ array(
+ array(0,1,0,0,0,0,0,0,0),
+ array(0,1,0,0,0,0,0,0,0),
+ array(0,1,0,0,0,0,0,0,0),
+ array(0,1,0,0,0,0,0,0,0),
+ array(0,1,0,0,0,0,0,0,0),
+ array(0,1,0,0,0,0,0,0,0),
+ array(0,1,0,0,0,0,0,0,0),
+ array(0,1,1,1,1,1,1,0,0),
+ array(0,1,0,0,0,0,0,1,0),
+ array(0,1,0,0,0,0,0,0,1),
+ array(0,1,0,0,0,0,0,0,1),
+ array(0,1,0,0,0,0,0,0,1),
+ array(0,1,0,0,0,0,0,0,1),
+ array(0,1,0,0,0,0,0,1,0),
+ array(0,1,1,1,1,1,1,0,0),
+ ),
+ ),
+ 'C' => array(
+ array(
+ array(0,0,1,1,1,1,1,0,0),
+ array(0,1,0,0,0,0,0,1,0),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(0,1,0,0,0,0,0,1,0),
+ array(0,0,1,1,1,1,1,0,0),
+ ),
+ array(
+ array(0,0,1,1,1,1,1,0,1),
+ array(0,1,0,0,0,0,0,1,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(0,1,0,0,0,0,0,1,1),
+ array(0,0,1,1,1,1,1,0,1),
+ ),
+ ),
+ 'D' => array(
+ array(
+ array(1,1,1,1,1,1,1,0,0),
+ array(1,0,0,0,0,0,0,1,0),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,1,0),
+ array(1,1,1,1,1,1,1,0,0),
+ ),
+ array(
+ array(1,1,1,1,1,1,1,0,0),
+ array(0,1,0,0,0,0,0,1,0),
+ array(0,1,0,0,0,0,0,0,1),
+ array(0,1,0,0,0,0,0,0,1),
+ array(0,1,0,0,0,0,0,0,1),
+ array(0,1,0,0,0,0,0,0,1),
+ array(0,1,0,0,0,0,0,0,1),
+ array(0,1,0,0,0,0,0,0,1),
+ array(0,1,0,0,0,0,0,0,1),
+ array(0,1,0,0,0,0,0,0,1),
+ array(0,1,0,0,0,0,0,0,1),
+ array(0,1,0,0,0,0,0,0,1),
+ array(0,1,0,0,0,0,0,0,1),
+ array(0,1,0,0,0,0,0,1,0),
+ array(1,1,1,1,1,1,1,0,0),
+ ),
+ array(
+ array(0,0,0,0,0,0,0,0,1),
+ array(0,0,0,0,0,0,0,0,1),
+ array(0,0,0,0,0,0,0,0,1),
+ array(0,0,0,0,0,0,0,0,1),
+ array(0,0,0,0,0,0,0,0,1),
+ array(0,0,0,0,0,0,0,0,1),
+ array(0,0,0,0,0,0,0,0,1),
+ array(0,0,1,1,1,1,1,0,1),
+ array(0,1,1,0,0,0,1,1,1),
+ array(0,1,0,0,0,0,0,0,1),
+ array(0,1,0,0,0,0,0,0,1),
+ array(0,1,0,0,0,0,0,0,1),
+ array(0,1,0,0,0,0,0,0,1),
+ array(0,1,1,0,0,0,1,1,1),
+ array(0,0,1,1,1,1,1,0,1),
+ ),
+ ),
+ 'E' => array(
+ array(
+ array(1,1,1,1,1,1,1,1,1),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,1,1,1,1,1,1,1,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,1,1,1,1,1,1,1,1),
+ ),
+ array(
+ array(1,1,1,1,1,1,1,1,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,1,1,1,1,1,1,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,1,1,1,1,1,1,1,1),
+ ),
+ array(
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,1,1,1,1,1,0,0),
+ array(0,1,1,0,0,0,1,1,0),
+ array(1,1,0,0,0,0,0,1,1),
+ array(1,1,1,1,1,1,1,1,1),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,1,0,0,0,0,0,1,1),
+ array(0,1,1,1,1,1,1,1,0),
+ ),
+ ),
+ 'F' => array(
+ array(
+ array(1,1,1,1,1,1,1,1,1),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,1,1,1,1,1,1,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ ),
+ array(
+ array(0,1,1,1,1,1,1,1,1),
+ array(0,1,0,0,0,0,0,0,1),
+ array(0,1,0,0,0,0,0,0,0),
+ array(0,1,0,0,0,0,0,0,0),
+ array(0,1,0,0,0,0,0,0,0),
+ array(0,1,0,0,0,0,0,0,0),
+ array(0,1,0,0,0,0,0,0,0),
+ array(0,1,1,1,1,1,1,0,0),
+ array(0,1,0,0,0,0,0,0,0),
+ array(0,1,0,0,0,0,0,0,0),
+ array(0,1,0,0,0,0,0,0,0),
+ array(0,1,0,0,0,0,0,0,0),
+ array(0,1,0,0,0,0,0,0,0),
+ array(0,1,0,0,0,0,0,0,0),
+ array(1,1,1,0,0,0,0,0,0),
+ ),
+ array(
+ array(0,0,0,1,1,0,0,0,0),
+ array(0,0,1,1,0,0,0,0,0),
+ array(0,1,1,0,0,0,0,0,0),
+ array(0,1,0,0,0,0,0,0,0),
+ array(0,1,0,0,0,0,0,0,0),
+ array(1,1,1,1,0,0,0,0,0),
+ array(0,1,0,0,0,0,0,0,0),
+ array(0,1,0,0,0,0,0,0,0),
+ array(0,1,0,0,0,0,0,0,0),
+ array(0,1,0,0,0,0,0,0,0),
+ array(0,1,0,0,0,0,0,0,0),
+ array(0,1,0,0,0,0,0,0,0),
+ array(0,1,0,0,0,0,0,0,0),
+ array(0,1,0,0,0,0,0,0,0),
+ array(0,1,0,0,0,0,0,0,0),
+ ),
+ ),
+ 'G' => array(
+ array(
+ array(0,0,1,1,1,1,1,0,0),
+ array(0,1,0,0,0,0,0,1,0),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,1,1,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(0,1,0,0,0,0,0,1,0),
+ array(0,0,1,1,1,1,1,0,0),
+ ),
+ array(
+ array(0,0,1,1,1,1,1,0,1),
+ array(0,1,0,0,0,0,0,1,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,1,1,1,1,1),
+ array(1,0,0,0,1,0,0,0,1),
+ array(1,0,0,0,1,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(0,1,0,0,0,0,0,1,1),
+ array(0,0,1,1,1,1,1,0,1),
+ ),
+ array(
+ array(0,0,1,1,1,1,1,0,1),
+ array(0,1,1,0,0,0,0,1,1),
+ array(1,1,0,0,0,0,0,1,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,1,1,0,0,0,0,0,1),
+ array(0,0,1,1,1,1,1,1,1),
+ array(0,0,0,0,0,0,0,0,1),
+ array(0,0,0,0,0,0,0,0,1),
+ array(0,0,0,0,0,0,0,0,1),
+ array(0,0,0,0,0,0,0,0,1),
+ array(0,0,0,0,0,0,0,1,1),
+ array(1,1,1,1,1,1,1,1,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ ),
+ ),
+ 'H' => array(
+ array(
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,1,1,1,1,1,1,1,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ ),
+ array(
+ array(1,1,1,0,0,0,1,1,1),
+ array(0,1,0,0,0,0,0,1,0),
+ array(0,1,0,0,0,0,0,1,0),
+ array(0,1,0,0,0,0,0,1,0),
+ array(0,1,0,0,0,0,0,1,0),
+ array(0,1,0,0,0,0,0,1,0),
+ array(0,1,0,0,0,0,0,1,0),
+ array(0,1,1,1,1,1,1,1,0),
+ array(0,1,0,0,0,0,0,1,0),
+ array(0,1,0,0,0,0,0,1,0),
+ array(0,1,0,0,0,0,0,1,0),
+ array(0,1,0,0,0,0,0,1,0),
+ array(0,1,0,0,0,0,0,1,0),
+ array(0,1,0,0,0,0,0,1,0),
+ array(1,1,1,0,0,0,1,1,1),
+ ),
+ array(
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,1,1,1,0,0,0),
+ array(1,1,1,1,0,1,1,0,0),
+ array(1,0,0,0,0,0,1,0,0),
+ array(1,0,0,0,0,0,1,0,0),
+ array(1,0,0,0,0,0,1,0,0),
+ array(1,0,0,0,0,0,1,0,0),
+ array(1,0,0,0,0,0,1,0,0),
+ array(1,0,0,0,0,0,1,0,0),
+ ),
+ ),
+ 'I' => array(
+ array(
+ array(1,1,1,1,1,1,1,1,1),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(1,1,1,1,1,1,1,1,1),
+ ),
+ array(
+ array(0,0,0,1,1,1,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,1,1,1,0,0,0),
+ ),
+ array(
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,1,1,1,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,1,1,1,0,0,0),
+ ),
+ ),
+ 'J' => array(
+ array(
+ array(1,1,1,1,1,1,1,1,1),
+ array(0,0,0,0,0,1,0,0,0),
+ array(0,0,0,0,0,1,0,0,0),
+ array(0,0,0,0,0,1,0,0,0),
+ array(0,0,0,0,0,1,0,0,0),
+ array(0,0,0,0,0,1,0,0,0),
+ array(0,0,0,0,0,1,0,0,0),
+ array(0,0,0,0,0,1,0,0,0),
+ array(0,0,0,0,0,1,0,0,0),
+ array(0,0,0,0,0,1,0,0,0),
+ array(0,0,0,0,0,1,0,0,0),
+ array(1,0,0,0,0,1,0,0,0),
+ array(1,0,0,0,0,1,0,0,0),
+ array(0,1,0,0,1,0,0,0,0),
+ array(0,0,1,1,0,0,0,0,0),
+ ),
+ array(
+ array(1,1,1,1,1,1,1,1,1),
+ array(0,0,0,0,0,1,0,0,0),
+ array(0,0,0,0,0,1,0,0,0),
+ array(0,0,0,0,0,1,0,0,0),
+ array(0,0,0,0,0,1,0,0,0),
+ array(0,0,0,0,0,1,0,0,0),
+ array(0,0,0,0,0,1,0,0,0),
+ array(0,0,0,0,0,1,0,0,0),
+ array(0,0,0,0,0,1,0,0,0),
+ array(0,0,0,0,0,1,0,0,0),
+ array(0,0,0,0,0,1,0,0,0),
+ array(1,0,0,0,0,1,0,0,0),
+ array(1,0,0,0,0,1,0,0,0),
+ array(1,1,0,0,1,0,0,0,0),
+ array(1,0,1,1,0,0,0,0,0),
+ ),
+ array(
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,1,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,1,0,0,0),
+ array(0,0,0,0,0,1,0,0,0),
+ array(0,0,0,0,0,1,0,0,0),
+ array(0,0,0,0,0,1,0,0,0),
+ array(0,0,0,0,0,1,0,0,0),
+ array(1,0,0,0,0,1,0,0,0),
+ array(1,0,0,0,0,1,0,0,0),
+ array(0,1,0,0,1,0,0,0,0),
+ array(0,0,1,1,0,0,0,0,0),
+ ),
+ ),
+ 'K' => array(
+ array( // New 'K', supplied by NeoThermic
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,1,0),
+ array(1,0,0,0,0,0,1,0,0),
+ array(1,0,0,0,0,1,0,0,0),
+ array(1,0,0,0,1,0,0,0,0),
+ array(1,0,0,1,0,0,0,0,0),
+ array(1,0,1,0,0,0,0,0,0),
+ array(1,1,0,0,0,0,0,0,0),
+ array(1,0,1,0,0,0,0,0,0),
+ array(1,0,0,1,0,0,0,0,0),
+ array(1,0,0,0,1,0,0,0,0),
+ array(1,0,0,0,0,1,0,0,0),
+ array(1,0,0,0,0,0,1,0,0),
+ array(1,0,0,0,0,0,0,1,0),
+ array(1,0,0,0,0,0,0,0,1),
+ ),
+ array(
+ array(0,1,0,0,0,0,0,0,1),
+ array(0,1,0,0,0,0,0,1,0),
+ array(0,1,0,0,0,0,1,0,0),
+ array(0,1,0,0,0,1,0,0,0),
+ array(0,1,0,0,1,0,0,0,0),
+ array(0,1,0,1,0,0,0,0,0),
+ array(0,1,1,0,0,0,0,0,0),
+ array(0,1,0,0,0,0,0,0,0),
+ array(0,1,1,0,0,0,0,0,0),
+ array(0,1,0,1,0,0,0,0,0),
+ array(0,1,0,0,1,0,0,0,0),
+ array(0,1,0,0,0,1,0,0,0),
+ array(0,1,0,0,0,0,1,0,0),
+ array(0,1,0,0,0,0,0,1,0),
+ array(1,1,1,0,0,0,1,1,1),
+ ),
+ array(
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,1,0,0,0,0,0,0,0),
+ array(0,1,0,0,0,0,0,0,0),
+ array(0,1,0,0,0,1,0,0,0),
+ array(0,1,0,0,1,0,0,0,0),
+ array(0,1,0,1,0,0,0,0,0),
+ array(0,1,1,0,0,0,0,0,0),
+ array(0,1,0,0,0,0,0,0,0),
+ array(0,1,1,0,0,0,0,0,0),
+ array(0,1,0,1,0,0,0,0,0),
+ array(0,1,0,0,1,0,0,0,0),
+ array(0,1,0,0,0,1,0,0,0),
+ array(0,1,0,0,0,0,1,0,0),
+ array(0,1,0,0,0,0,0,1,0),
+ array(0,1,0,0,0,0,0,1,0),
+ ),
+ ),
+ 'L' => array(
+ array(
+ array(0,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,1,1,1,1,1,1,1,1),
+ ),
+ array(
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,1,0,0,0,0,0,0,0),
+ array(0,1,0,0,0,0,0,0,0),
+ array(0,1,0,0,0,0,0,0,0),
+ array(0,1,0,0,0,0,0,0,0),
+ array(0,1,0,0,0,0,0,0,0),
+ array(0,1,0,0,0,0,0,0,0),
+ array(0,1,0,0,0,0,0,0,0),
+ array(0,1,0,0,0,0,0,0,0),
+ array(0,1,0,0,0,0,0,0,0),
+ array(0,1,0,0,0,0,0,0,0),
+ array(0,1,0,0,0,0,0,0,0),
+ array(0,1,0,0,0,0,0,0,0),
+ array(0,1,0,0,0,0,0,0,1),
+ array(1,1,1,1,1,1,1,1,1),
+ ),
+ array(
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,1,0,0,0,0,0,0,0),
+ array(0,1,0,0,0,0,0,0,0),
+ array(0,1,0,0,0,0,0,0,0),
+ array(0,1,0,0,0,0,0,0,0),
+ array(0,1,0,0,0,0,0,0,0),
+ array(0,1,0,0,0,0,0,0,0),
+ array(0,1,0,0,0,0,0,0,0),
+ array(0,1,0,0,0,0,0,0,0),
+ array(0,1,0,0,0,0,0,0,0),
+ array(0,1,0,0,0,0,0,0,0),
+ array(0,1,0,0,0,0,0,0,0),
+ array(0,1,0,0,0,0,0,0,0),
+ array(0,1,1,0,0,0,0,0,0),
+ array(0,0,1,1,1,0,0,0,0),
+ ),
+ ),
+ 'M' => array(
+ array(
+ array(1,1,0,0,0,0,0,1,1),
+ array(1,1,0,0,0,0,0,1,1),
+ array(1,0,1,0,0,0,1,0,1),
+ array(1,0,1,0,0,0,1,0,1),
+ array(1,0,1,0,0,0,1,0,1),
+ array(1,0,0,1,0,1,0,0,1),
+ array(1,0,0,1,0,1,0,0,1),
+ array(1,0,0,1,0,1,0,0,1),
+ array(1,0,0,0,1,0,0,0,1),
+ array(1,0,0,0,1,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ ),
+ array(
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,1,0,0,0,0,0,1,0),
+ array(0,1,1,0,0,0,1,1,0),
+ array(0,1,1,0,0,0,1,1,0),
+ array(0,1,1,0,0,0,1,1,0),
+ array(0,1,0,1,0,1,0,1,0),
+ array(0,1,0,1,0,1,0,1,0),
+ array(0,1,0,1,0,1,0,1,0),
+ array(0,1,0,0,1,0,0,1,0),
+ array(0,1,0,0,1,0,0,1,0),
+ array(0,1,0,0,0,0,0,1,0),
+ array(0,1,0,0,0,0,0,1,0),
+ array(0,1,0,0,0,0,0,1,0),
+ array(0,1,0,0,0,0,0,1,0),
+ array(1,1,1,0,0,0,1,1,1),
+ ),
+ array(
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,1,1,1,0,1,1,1,0),
+ array(1,1,0,1,1,1,0,1,1),
+ array(1,0,0,0,1,0,0,0,1),
+ array(1,0,0,0,1,0,0,0,1),
+ array(1,0,0,0,1,0,0,0,1),
+ array(1,0,0,0,1,0,0,0,1),
+ array(1,0,0,0,1,0,0,0,1),
+ array(1,0,0,0,1,0,0,0,1),
+ array(1,0,0,0,1,0,0,0,1),
+ ),
+ ),
+ 'N' => array(
+ array(
+ array(1,1,0,0,0,0,0,0,1),
+ array(1,1,0,0,0,0,0,0,1),
+ array(1,0,1,0,0,0,0,0,1),
+ array(1,0,1,0,0,0,0,0,1),
+ array(1,0,0,1,0,0,0,0,1),
+ array(1,0,0,1,0,0,0,0,1),
+ array(1,0,0,0,1,0,0,0,1),
+ array(1,0,0,0,1,0,0,0,1),
+ array(1,0,0,0,1,0,0,0,1),
+ array(1,0,0,0,0,1,0,0,1),
+ array(1,0,0,0,0,1,0,0,1),
+ array(1,0,0,0,0,0,1,0,1),
+ array(1,0,0,0,0,0,1,0,1),
+ array(1,0,0,0,0,0,0,1,1),
+ array(1,0,0,0,0,0,0,1,1),
+ ),
+ array(
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,1,0,0,0,0,0,1,0),
+ array(0,1,1,0,0,0,0,1,0),
+ array(0,1,1,0,0,0,0,1,0),
+ array(0,1,1,0,0,0,0,1,0),
+ array(0,1,0,1,0,0,0,1,0),
+ array(0,1,0,1,0,0,0,1,0),
+ array(0,1,0,1,0,0,0,1,0),
+ array(0,1,0,0,1,0,0,1,0),
+ array(0,1,0,0,1,1,0,1,0),
+ array(0,1,0,0,0,1,0,1,0),
+ array(0,1,0,0,0,1,1,1,0),
+ array(0,1,0,0,0,0,1,1,0),
+ array(0,1,0,0,0,0,0,1,0),
+ array(1,1,1,0,0,0,1,1,1),
+ ),
+ array(
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(1,0,1,1,1,1,0,0,0),
+ array(1,1,1,0,0,1,1,0,0),
+ array(1,0,0,0,0,0,1,0,0),
+ array(1,0,0,0,0,0,1,0,0),
+ array(1,0,0,0,0,0,1,0,0),
+ array(1,0,0,0,0,0,1,0,0),
+ array(1,0,0,0,0,0,1,0,0),
+ array(1,0,0,0,0,0,1,0,0),
+ ),
+ ),
+ 'O' => array(
+ array(
+ array(0,0,1,1,1,1,1,0,0),
+ array(0,1,0,0,0,0,0,1,0),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(0,1,0,0,0,0,0,1,0),
+ array(0,0,1,1,1,1,1,0,0),
+ ),
+ array(
+ array(0,0,1,1,1,1,1,0,0),
+ array(0,1,0,0,0,0,0,1,0),
+ array(1,1,0,0,0,0,0,1,1),
+ array(1,1,0,0,0,0,0,1,1),
+ array(1,1,0,0,0,0,0,1,1),
+ array(1,1,0,0,0,0,0,1,1),
+ array(1,1,0,0,0,0,0,1,1),
+ array(1,1,0,0,0,0,0,1,1),
+ array(1,1,0,0,0,0,0,1,1),
+ array(1,1,0,0,0,0,0,1,1),
+ array(1,1,0,0,0,0,0,1,1),
+ array(1,1,0,0,0,0,0,1,1),
+ array(1,1,0,0,0,0,0,1,1),
+ array(0,1,0,0,0,0,0,1,0),
+ array(0,0,1,1,1,1,1,0,0),
+ ),
+ array(
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,1,1,1,1,1,0,0,0),
+ array(1,1,1,0,0,1,1,0,0),
+ array(1,0,0,0,0,0,1,0,0),
+ array(1,0,0,0,0,0,1,0,0),
+ array(1,0,0,0,0,0,1,0,0),
+ array(1,0,0,0,0,0,1,0,0),
+ array(1,1,0,0,0,1,1,0,0),
+ array(0,1,1,1,1,1,0,0,0),
+ ),
+ ),
+ 'P' => array(
+ array(
+ array(1,1,1,1,1,1,1,0,0),
+ array(1,0,0,0,0,0,0,1,0),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,1,0),
+ array(1,1,1,1,1,1,1,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ ),
+ array(
+ array(1,1,1,1,1,1,1,0,0),
+ array(0,1,0,0,0,0,0,1,0),
+ array(0,1,0,0,0,0,0,0,1),
+ array(0,1,0,0,0,0,0,0,1),
+ array(0,1,0,0,0,0,0,0,1),
+ array(0,1,0,0,0,0,0,0,1),
+ array(0,1,0,0,0,0,0,1,0),
+ array(1,1,1,1,1,1,1,0,0),
+ array(0,1,0,0,0,0,0,0,0),
+ array(0,1,0,0,0,0,0,0,0),
+ array(0,1,0,0,0,0,0,0,0),
+ array(0,1,0,0,0,0,0,0,0),
+ array(0,1,0,0,0,0,0,0,0),
+ array(0,1,0,0,0,0,0,0,0),
+ array(1,1,1,0,0,0,0,0,0),
+ ),
+ array(
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,1,1,0,0,0,0,0),
+ array(1,1,0,1,1,0,0,0,0),
+ array(1,0,0,0,1,0,0,0,0),
+ array(1,0,0,0,1,0,0,0,0),
+ array(1,0,0,1,1,0,0,0,0),
+ array(1,1,1,1,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ ),
+ ),
+ 'Q' => array(
+ array(
+ array(0,0,1,1,1,1,1,0,0),
+ array(0,1,0,0,0,0,0,1,0),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,1,0,0,1),
+ array(1,0,0,0,0,0,1,0,1),
+ array(0,1,0,0,0,0,0,1,0),
+ array(0,0,1,1,1,1,1,0,1),
+ ),
+ array(
+ array(0,0,1,1,1,1,1,0,0),
+ array(0,1,0,0,0,0,0,1,0),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,1,0,0,0,1),
+ array(1,1,0,0,1,1,0,1,1),
+ array(0,1,1,1,1,1,1,1,0),
+ array(0,0,0,0,0,0,1,1,0),
+ array(0,0,0,0,0,0,0,1,1),
+ array(0,0,0,0,0,0,0,0,1),
+ ),
+ array(
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,1,1,1,1),
+ array(0,0,0,0,1,1,0,0,1),
+ array(0,0,0,0,1,0,0,0,1),
+ array(0,0,0,0,1,0,0,0,1),
+ array(0,0,0,0,1,1,0,1,1),
+ array(0,0,0,0,0,1,1,0,1),
+ array(0,0,0,0,0,0,0,0,1),
+ array(0,0,0,0,0,0,0,0,1),
+ array(0,0,0,0,0,0,0,0,1),
+ array(0,0,0,0,0,0,0,0,1),
+ array(0,0,0,0,0,0,0,0,1),
+ array(0,0,0,0,0,0,0,0,1),
+ ),
+ ),
+ 'R' => array(
+ array(
+ array(1,1,1,1,1,1,1,0,0),
+ array(1,0,0,0,0,0,0,1,0),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,1,0),
+ array(1,1,1,1,1,1,1,0,0),
+ array(1,1,1,0,0,0,0,0,0),
+ array(1,0,0,1,0,0,0,0,0),
+ array(1,0,0,0,1,0,0,0,0),
+ array(1,0,0,0,0,1,0,0,0),
+ array(1,0,0,0,0,0,1,0,0),
+ array(1,0,0,0,0,0,0,1,0),
+ array(1,0,0,0,0,0,0,0,1),
+ ),
+ array(
+ array(1,1,1,1,1,1,1,0,0),
+ array(0,1,0,0,0,0,0,1,0),
+ array(0,1,0,0,0,0,0,0,1),
+ array(0,1,0,0,0,0,0,0,1),
+ array(0,1,0,0,0,0,0,0,1),
+ array(0,1,0,0,0,0,0,0,1),
+ array(0,1,0,0,0,0,0,1,0),
+ array(1,1,1,1,1,1,1,0,0),
+ array(0,1,1,0,0,0,0,0,0),
+ array(0,1,1,1,0,0,0,0,0),
+ array(0,1,0,1,1,0,0,0,0),
+ array(0,1,0,0,1,1,0,0,0),
+ array(0,1,0,0,0,1,1,0,0),
+ array(0,1,0,0,0,0,1,1,0),
+ array(1,1,1,0,0,0,1,1,1),
+ ),
+ array(
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,1,1,1,1,0,0,0,0),
+ array(1,1,0,0,1,1,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ ),
+ ),
+ 'S' => array(
+ array(
+ array(0,0,1,1,1,1,1,0,0),
+ array(0,1,0,0,0,0,0,1,0),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(0,1,0,0,0,0,0,0,0),
+ array(0,0,1,1,1,1,1,0,0),
+ array(0,0,0,0,0,0,0,1,0),
+ array(0,0,0,0,0,0,0,0,1),
+ array(0,0,0,0,0,0,0,0,1),
+ array(0,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(0,1,0,0,0,0,0,1,0),
+ array(0,0,1,1,1,1,1,0,0),
+ ),
+ array(
+ array(0,0,1,1,1,1,1,0,1),
+ array(0,1,0,0,0,0,0,1,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(0,1,0,0,0,0,0,0,0),
+ array(0,0,1,1,1,1,1,0,0),
+ array(0,0,0,0,0,0,0,1,0),
+ array(0,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,1,0,0,0,0,0,1,0),
+ array(1,0,1,1,1,1,1,0,0),
+ ),
+ array(
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,1,1,1,1,0,0,0,0),
+ array(1,0,0,0,0,1,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,1,0,0,0,0,0,0,0),
+ array(0,1,1,1,1,0,0,0,0),
+ array(0,0,0,0,0,1,0,0,0),
+ array(1,0,0,0,1,1,0,0,0),
+ array(0,1,1,1,1,0,0,0,0),
+ ),
+ ),
+ 'T' => array(
+ array(
+ array(1,1,1,1,1,1,1,1,1),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ ),
+ array(
+ array(1,1,1,1,1,1,1,1,1),
+ array(1,0,0,0,1,0,0,0,1),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,1,1,1,0,0,0),
+ ),
+ array(
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,1,1,1,1,1,1,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,1,0,0,0),
+ array(0,0,0,0,0,1,1,1,0),
+ ),
+ ),
+ 'U' => array(
+ array(
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(0,1,0,0,0,0,0,1,0),
+ array(0,0,1,1,1,1,1,0,0),
+ ),
+ array(
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,1,1,0,0,0,1,1,1),
+ array(0,1,0,0,0,0,0,1,0),
+ array(0,1,0,0,0,0,0,1,0),
+ array(0,1,0,0,0,0,0,1,0),
+ array(0,1,0,0,0,0,0,1,0),
+ array(0,1,0,0,0,0,0,1,0),
+ array(0,1,0,0,0,0,0,1,0),
+ array(0,1,0,0,0,0,0,1,0),
+ array(0,1,0,0,0,0,0,1,0),
+ array(0,1,0,0,0,0,0,1,0),
+ array(0,1,0,0,0,0,0,1,0),
+ array(0,1,0,0,0,0,0,1,0),
+ array(0,1,1,0,0,0,1,1,0),
+ array(0,0,1,1,1,1,1,0,0),
+ ),
+ array(
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,1,0,0,0,0,0,1),
+ array(0,0,1,0,0,0,0,0,1),
+ array(0,0,1,0,0,0,0,0,1),
+ array(0,0,1,0,0,0,0,0,1),
+ array(0,0,1,0,0,0,0,0,1),
+ array(0,0,1,0,0,0,0,1,1),
+ array(0,0,1,1,0,0,1,1,1),
+ array(0,0,0,1,1,1,1,0,1),
+ ),
+ ),
+ 'V' => array(
+ array(
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(0,1,0,0,0,0,0,1,0),
+ array(0,1,0,0,0,0,0,1,0),
+ array(0,1,0,0,0,0,0,1,0),
+ array(0,0,1,0,0,0,1,0,0),
+ array(0,0,1,0,0,0,1,0,0),
+ array(0,0,1,0,0,0,1,0,0),
+ array(0,0,1,0,0,0,1,0,0),
+ array(0,0,0,1,0,1,0,0,0),
+ array(0,0,0,1,0,1,0,0,0),
+ array(0,0,0,1,0,1,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ ),
+ array(
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(1,1,1,0,0,0,1,1,1),
+ array(0,1,0,0,0,0,0,1,0),
+ array(0,1,0,0,0,0,0,1,0),
+ array(0,0,1,0,0,0,1,0,0),
+ array(0,0,1,0,0,0,1,0,0),
+ array(0,0,1,0,0,0,1,0,0),
+ array(0,0,1,0,0,0,1,0,0),
+ array(0,0,0,1,0,1,0,0,0),
+ array(0,0,0,1,0,1,0,0,0),
+ array(0,0,0,1,0,1,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ ),
+ array(
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,1,0,0,0,1,0,0),
+ array(0,0,1,0,0,0,1,0,0),
+ array(0,0,1,0,0,0,1,0,0),
+ array(0,0,1,0,0,0,1,0,0),
+ array(0,0,0,1,0,1,0,0,0),
+ array(0,0,0,1,0,1,0,0,0),
+ array(0,0,0,1,0,1,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ ),
+ ),
+ 'W' => array(
+ array(
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,1,0,0,0,1),
+ array(1,0,0,0,1,0,0,0,1),
+ array(1,0,0,1,0,1,0,0,1),
+ array(1,0,0,1,0,1,0,0,1),
+ array(1,0,0,1,0,1,0,0,1),
+ array(1,0,1,0,0,0,1,0,1),
+ array(1,0,1,0,0,0,1,0,1),
+ array(1,0,1,0,0,0,1,0,1),
+ array(1,1,0,0,0,0,0,1,1),
+ array(1,1,0,0,0,0,0,1,1),
+ ),
+ array(
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(1,1,1,0,0,0,1,1,1),
+ array(0,1,0,0,0,0,0,1,0),
+ array(0,1,0,0,0,0,0,1,0),
+ array(0,1,0,0,0,0,0,1,0),
+ array(0,1,0,0,0,0,0,1,0),
+ array(0,1,0,0,1,0,0,1,0),
+ array(0,1,0,0,1,0,0,1,0),
+ array(0,1,0,1,1,1,0,1,0),
+ array(0,1,0,1,0,1,0,1,0),
+ array(0,1,1,1,0,1,1,1,0),
+ array(0,1,1,0,0,0,1,1,0),
+ array(0,1,0,0,0,0,0,1,0),
+ array(0,0,0,0,0,0,0,0,0),
+ ),
+ array(
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,1,0,0,0,0,0,1,0),
+ array(0,1,0,0,1,0,0,1,0),
+ array(0,1,0,0,1,0,0,1,0),
+ array(0,1,0,1,1,1,0,1,0),
+ array(0,1,0,1,0,1,0,1,0),
+ array(0,1,1,1,0,1,1,1,0),
+ array(0,1,1,0,0,0,1,1,0),
+ array(0,1,0,0,0,0,0,1,0),
+ array(0,0,0,0,0,0,0,0,0),
+ ),
+ ),
+ 'X' => array(
+ array(
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(0,1,0,0,0,0,0,1,0),
+ array(0,1,0,0,0,0,0,1,0),
+ array(0,0,1,0,0,0,1,0,0),
+ array(0,0,0,1,0,1,0,0,0),
+ array(0,0,0,1,0,1,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,1,0,1,0,0,0),
+ array(0,0,0,1,0,1,0,0,0),
+ array(0,0,1,0,0,0,1,0,0),
+ array(0,1,0,0,0,0,1,0,0),
+ array(0,1,0,0,0,0,0,1,0),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ ),
+ array(
+ array(0,0,0,0,0,0,0,0,0),
+ array(1,1,1,0,0,0,1,1,1),
+ array(0,1,0,0,0,0,0,1,0),
+ array(0,1,0,0,0,0,0,1,0),
+ array(0,0,1,0,0,0,1,0,0),
+ array(0,0,0,1,0,1,0,0,0),
+ array(0,0,0,1,0,1,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,1,0,1,0,0,0),
+ array(0,0,0,1,0,1,0,0,0),
+ array(0,0,1,0,0,0,1,0,0),
+ array(0,1,0,0,0,0,1,0,0),
+ array(0,1,0,0,0,0,0,1,0),
+ array(1,1,1,0,0,0,1,1,1),
+ array(0,0,0,0,0,0,0,0,0),
+ ),
+ array(
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,1,0,0,0,0,0,1,0),
+ array(0,1,1,0,0,0,1,1,0),
+ array(0,0,1,1,0,1,1,0,0),
+ array(0,0,0,1,1,1,0,0,0),
+ array(0,0,0,1,1,1,0,0,0),
+ array(0,0,1,1,0,1,1,0,0),
+ array(0,1,1,0,0,0,1,1,0),
+ array(0,0,0,0,0,0,0,0,0),
+ ),
+ ),
+ 'Y' => array(
+ array(
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(0,1,0,0,0,0,0,1,0),
+ array(0,1,0,0,0,0,0,1,0),
+ array(0,0,1,0,0,0,1,0,0),
+ array(0,0,1,0,0,0,1,0,0),
+ array(0,0,0,1,0,1,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ ),
+ array(
+ array(0,0,0,0,0,0,0,0,0),
+ array(1,1,1,0,0,0,1,1,1),
+ array(0,1,0,0,0,0,0,1,0),
+ array(0,1,0,0,0,0,0,1,0),
+ array(0,0,1,0,0,0,1,0,0),
+ array(0,0,1,0,0,0,1,0,0),
+ array(0,0,0,1,0,1,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,1,1,1,0,0,0),
+ ),
+ array(
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,1,0,0,0,0,1),
+ array(0,0,0,1,1,0,0,0,1),
+ array(0,0,0,0,1,0,0,1,1),
+ array(0,0,0,0,1,1,0,1,0),
+ array(0,0,0,0,0,1,1,1,0),
+ array(0,0,0,0,0,0,1,0,0),
+ array(0,0,0,0,0,1,1,0,0),
+ array(0,0,0,0,0,1,0,0,0),
+ array(0,0,0,0,1,1,0,0,0),
+ array(0,0,1,1,1,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ ),
+ ),
+ 'Z' => array(
+ array(
+ array(1,1,1,1,1,1,1,1,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(0,0,0,0,0,0,0,0,1),
+ array(0,0,0,0,0,0,0,1,0),
+ array(0,0,0,0,0,0,1,0,0),
+ array(0,0,0,0,0,1,0,0,0),
+ array(0,0,0,0,0,1,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,1,0,0,0,0,0),
+ array(0,0,0,1,0,0,0,0,0),
+ array(0,0,1,0,0,0,0,0,0),
+ array(0,1,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,1,1,1,1,1,1,1,1),
+ ),
+ array(
+ array(1,1,1,1,1,1,1,1,1),
+ array(0,0,0,0,0,0,0,0,1),
+ array(0,0,0,0,0,0,0,0,1),
+ array(0,0,0,0,0,0,0,1,0),
+ array(0,0,0,0,0,0,1,0,0),
+ array(0,0,0,0,0,1,0,0,0),
+ array(0,0,0,0,0,1,0,0,0),
+ array(0,0,1,1,1,1,1,0,0),
+ array(0,0,0,1,0,0,0,0,0),
+ array(0,0,0,1,0,0,0,0,0),
+ array(0,0,1,0,0,0,0,0,0),
+ array(0,1,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,1,1,1,1,1,1,1,1),
+ ),
+ array(
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,1,1,1,1,1,1,1,0),
+ array(0,0,0,0,0,1,1,0,0),
+ array(0,0,0,0,1,1,0,0,0),
+ array(0,0,0,1,1,0,0,0,0),
+ array(0,0,1,1,0,0,0,0,0),
+ array(0,0,1,0,0,0,0,0,0),
+ array(0,1,1,1,1,1,1,1,0),
+ ),
+ ),
+ );
+ return array(
+ 'width' => 9,
+ 'height' => 15,
+ 'data' => array(
+
+ 'A' => $chars['A'][mt_rand(0, min(sizeof($chars['A']), $config['captcha_gd_fonts']) -1)],
+ 'B' => $chars['B'][mt_rand(0, min(sizeof($chars['B']), $config['captcha_gd_fonts']) -1)],
+ 'C' => $chars['C'][mt_rand(0, min(sizeof($chars['C']), $config['captcha_gd_fonts']) -1)],
+ 'D' => $chars['D'][mt_rand(0, min(sizeof($chars['D']), $config['captcha_gd_fonts']) -1)],
+ 'E' => $chars['E'][mt_rand(0, min(sizeof($chars['E']), $config['captcha_gd_fonts']) -1)],
+ 'F' => $chars['F'][mt_rand(0, min(sizeof($chars['F']), $config['captcha_gd_fonts']) -1)],
+ 'G' => $chars['G'][mt_rand(0, min(sizeof($chars['G']), $config['captcha_gd_fonts']) -1)],
+ 'H' => $chars['H'][mt_rand(0, min(sizeof($chars['H']), $config['captcha_gd_fonts']) -1)],
+ 'I' => $chars['I'][mt_rand(0, min(sizeof($chars['I']), $config['captcha_gd_fonts']) -1)],
+ 'J' => $chars['J'][mt_rand(0, min(sizeof($chars['J']), $config['captcha_gd_fonts']) -1)],
+ 'K' => $chars['K'][mt_rand(0, min(sizeof($chars['K']), $config['captcha_gd_fonts']) -1)],
+ 'L' => $chars['L'][mt_rand(0, min(sizeof($chars['L']), $config['captcha_gd_fonts']) -1)],
+ 'M' => $chars['M'][mt_rand(0, min(sizeof($chars['M']), $config['captcha_gd_fonts']) -1)],
+ 'N' => $chars['N'][mt_rand(0, min(sizeof($chars['N']), $config['captcha_gd_fonts']) -1)],
+ 'O' => $chars['O'][mt_rand(0, min(sizeof($chars['O']), $config['captcha_gd_fonts']) -1)],
+ 'P' => $chars['P'][mt_rand(0, min(sizeof($chars['P']), $config['captcha_gd_fonts']) -1)],
+ 'Q' => $chars['Q'][mt_rand(0, min(sizeof($chars['Q']), $config['captcha_gd_fonts']) -1)],
+ 'R' => $chars['R'][mt_rand(0, min(sizeof($chars['R']), $config['captcha_gd_fonts']) -1)],
+ 'S' => $chars['S'][mt_rand(0, min(sizeof($chars['S']), $config['captcha_gd_fonts']) -1)],
+ 'T' => $chars['T'][mt_rand(0, min(sizeof($chars['T']), $config['captcha_gd_fonts']) -1)],
+ 'U' => $chars['U'][mt_rand(0, min(sizeof($chars['U']), $config['captcha_gd_fonts']) -1)],
+ 'V' => $chars['V'][mt_rand(0, min(sizeof($chars['V']), $config['captcha_gd_fonts']) -1)],
+ 'W' => $chars['W'][mt_rand(0, min(sizeof($chars['W']), $config['captcha_gd_fonts']) -1)],
+ 'X' => $chars['X'][mt_rand(0, min(sizeof($chars['X']), $config['captcha_gd_fonts']) -1)],
+ 'Y' => $chars['Y'][mt_rand(0, min(sizeof($chars['Y']), $config['captcha_gd_fonts']) -1)],
+ 'Z' => $chars['Z'][mt_rand(0, min(sizeof($chars['Z']), $config['captcha_gd_fonts']) -1)],
+
+ '1' => array(
+ array(0,0,0,1,1,0,0,0,0),
+ array(0,0,1,0,1,0,0,0,0),
+ array(0,1,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,1,1,1,1,1,1,1,0),
+ ),
+ '2' => array( // New '2' supplied by Anon
+ array(0,0,0,1,1,1,0,0,0),
+ array(0,0,1,0,0,0,1,0,0),
+ array(0,1,0,0,0,0,1,1,0),
+ array(0,0,0,0,0,0,0,0,1),
+ array(0,0,0,0,0,0,0,0,1),
+ array(0,0,0,0,0,0,0,1,1),
+ array(0,0,0,0,0,0,0,1,0),
+ array(0,0,0,0,0,0,1,0,0),
+ array(0,0,0,0,0,1,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,1,0,0,0,0,0),
+ array(0,0,1,0,0,0,0,0,0),
+ array(0,1,0,0,0,0,0,0,0),
+ array(1,1,1,1,1,1,1,1,1),
+ array(0,0,0,0,0,0,0,0,0),
+ ),
+ '3' => array(
+ array(0,0,1,1,1,1,1,0,0),
+ array(0,1,0,0,0,0,0,1,0),
+ array(1,0,0,0,0,0,0,0,1),
+ array(0,0,0,0,0,0,0,0,1),
+ array(0,0,0,0,0,0,0,0,1),
+ array(0,0,0,0,0,0,0,0,1),
+ array(0,0,0,0,0,0,0,1,0),
+ array(0,0,0,0,0,1,1,0,0),
+ array(0,0,0,0,0,0,0,1,0),
+ array(0,0,0,0,0,0,0,0,1),
+ array(0,0,0,0,0,0,0,0,1),
+ array(0,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(0,1,0,0,0,0,0,1,0),
+ array(0,0,1,1,1,1,1,0,0),
+ ),
+ '4' => array(
+ array(0,0,0,0,0,0,1,1,0),
+ array(0,0,0,0,0,1,0,1,0),
+ array(0,0,0,0,1,0,0,1,0),
+ array(0,0,0,1,0,0,0,1,0),
+ array(0,0,1,0,0,0,0,1,0),
+ array(0,1,0,0,0,0,0,1,0),
+ array(1,0,0,0,0,0,0,1,0),
+ array(1,0,0,0,0,0,0,1,0),
+ array(1,1,1,1,1,1,1,1,1),
+ array(0,0,0,0,0,0,0,1,0),
+ array(0,0,0,0,0,0,0,1,0),
+ array(0,0,0,0,0,0,0,1,0),
+ array(0,0,0,0,0,0,0,1,0),
+ array(0,0,0,0,0,0,0,1,0),
+ array(0,0,0,0,0,0,0,1,0),
+ ),
+ '5' => array(
+ array(1,1,1,1,1,1,1,1,1),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(0,1,0,0,0,0,0,0,0),
+ array(0,0,1,1,1,1,1,0,0),
+ array(0,0,0,0,0,0,0,1,0),
+ array(0,0,0,0,0,0,0,0,1),
+ array(0,0,0,0,0,0,0,0,1),
+ array(0,0,0,0,0,0,0,0,1),
+ array(0,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(0,1,0,0,0,0,0,1,0),
+ array(0,0,1,1,1,1,1,0,0),
+ ),
+ '6' => array(
+ array(0,0,1,1,1,1,1,0,0),
+ array(0,1,0,0,0,0,0,1,0),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,1,1,1,1,0,0),
+ array(1,0,1,0,0,0,0,1,0),
+ array(1,1,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(0,1,0,0,0,0,0,1,0),
+ array(0,0,1,1,1,1,1,0,0),
+ ),
+ '7' => array(
+ array(1,1,1,1,1,1,1,1,1),
+ array(0,0,0,0,0,0,0,0,1),
+ array(0,0,0,0,0,0,0,1,0),
+ array(0,0,0,0,0,0,0,1,0),
+ array(0,0,0,0,0,0,1,0,0),
+ array(0,0,0,0,0,1,0,0,0),
+ array(0,0,0,0,0,1,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,1,0,0,0,0,0),
+ array(0,0,0,1,0,0,0,0,0),
+ array(0,0,1,0,0,0,0,0,0),
+ array(0,1,0,0,0,0,0,0,0),
+ array(0,1,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ ),
+ '8' => array(
+ array(0,0,1,1,1,1,1,0,0),
+ array(0,1,0,0,0,0,0,1,0),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(0,1,0,0,0,0,0,1,0),
+ array(0,0,1,1,1,1,1,0,0),
+ array(0,1,0,0,0,0,0,1,0),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(0,1,0,0,0,0,0,1,0),
+ array(0,0,1,1,1,1,1,0,0),
+ ),
+ '9' => array(
+ array(0,0,1,1,1,1,1,0,0),
+ array(0,1,0,0,0,0,0,1,0),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,1,1),
+ array(0,1,0,0,0,0,1,0,1),
+ array(0,0,1,1,1,1,0,0,1),
+ array(0,0,0,0,0,0,0,0,1),
+ array(0,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(0,1,0,0,0,0,0,1,0),
+ array(0,0,1,1,1,1,1,0,0),
+ ),
+ )
+ );
+ }
+}
diff --git a/phpBB/phpbb/captcha/gd_wave.php b/phpBB/phpbb/captcha/gd_wave.php
new file mode 100644
index 0000000000..d48fc753a5
--- /dev/null
+++ b/phpBB/phpbb/captcha/gd_wave.php
@@ -0,0 +1,845 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\captcha;
+
+/**
+* Wave3D CAPTCHA
+*/
+class gd_wave
+{
+ var $width = 360;
+ var $height = 96;
+
+ function execute($code, $seed)
+ {
+ global $starttime;
+
+ // seed the random generator
+ mt_srand($seed);
+
+ // set height and width
+ $img_x = $this->width;
+ $img_y = $this->height;
+
+ // Generate image
+ $img = imagecreatetruecolor($img_x, $img_y);
+ $x_grid = mt_rand(6, 10);
+ $y_grid = mt_rand(6, 10);
+
+ // Ok, so lets cut to the chase. We could accurately represent this in 3d and
+ // do all the appropriate linear transforms. my questions is... why bother?
+ // The computational overhead is unnecessary when you consider the simple fact:
+ // we're not here to accurately represent a model, but to just show off some random-ish
+ // polygons
+
+ // Conceive of 3 spaces.
+ // 1) planar-space (discrete "pixel" grid)
+ // 2) 3-space. (planar-space with z/height aspect)
+ // 3) image space (pixels on the screen)
+ // resolution of the planar-space we're embedding the text code in
+ $plane_x = 100;
+ $plane_y = 30;
+
+ $subdivision_factor = 3;
+
+ // $box is the 4 points in img_space that correspond to the corners of the plane in 3-space
+ $box = array(
+ 'upper_left' => array(
+ 'x' => mt_rand(5, 15),
+ 'y' => mt_rand(10, 15)
+ ),
+ 'upper_right' => array(
+ 'x' => mt_rand($img_x - 35, $img_x - 19),
+ 'y' => mt_rand(10, 17)
+ ),
+ 'lower_left' => array(
+ 'x' => mt_rand($img_x - 45, $img_x - 5),
+ 'y' => mt_rand($img_y - 15, $img_y - 0),
+ ),
+ );
+
+ $box['lower_right'] = array(
+ 'x' => $box['lower_left']['x'] + $box['upper_left']['x'] - $box['upper_right']['x'],
+ 'y' => $box['lower_left']['y'] + $box['upper_left']['y'] - $box['upper_right']['y'],
+ );
+
+ // TODO
+ $background = imagecolorallocate($img, mt_rand(155, 255), mt_rand(155, 255), mt_rand(155, 255));
+ imagefill($img, 0, 0, $background);
+ $black = imagecolorallocate($img, 0, 0, 0);
+
+ $random = array();
+ $fontcolors = array();
+
+ for ($i = 0; $i < 15; ++$i)
+ {
+ $random[$i] = imagecolorallocate($img, mt_rand(120, 255), mt_rand(120, 255), mt_rand(120, 255));
+ }
+
+ $fontcolors[0] = imagecolorallocate($img, mt_rand(0, 120), mt_rand(0, 120), mt_rand(0, 120));
+
+ $colors = array();
+
+ $minr = mt_rand(20, 30);
+ $ming = mt_rand(20, 30);
+ $minb = mt_rand(20, 30);
+
+ $maxr = mt_rand(150, 230);
+ $maxg = mt_rand(150, 230);
+ $maxb = mt_rand(150, 230);
+
+ for ($i = -30; $i <= 30; ++$i)
+ {
+ $coeff1 = ($i + 12) / 45;
+ $coeff2 = 1 - $coeff1;
+ $colors[$i] = imagecolorallocate($img, ($coeff2 * $maxr) + ($coeff1 * $minr), ($coeff2 * $maxg) + ($coeff1 * $ming), ($coeff2 * $maxb) + ($coeff1 * $minb));
+ }
+
+ // $img_buffer is the last row of 3-space positions (converted to img-space), cached
+ // (using this means we don't need to recalculate all 4 positions for each new polygon,
+ // merely the newest point that we're adding, which is then cached.
+ $img_buffer = array(array(), array());
+
+ // In image-space, the x- and y-offset necessary to move one unit in the x-direction in planar-space
+ $dxx = ($box['upper_right']['x'] - $box['upper_left']['x']) / ($subdivision_factor * $plane_x);
+ $dxy = ($box['upper_right']['y'] - $box['upper_left']['y']) / ($subdivision_factor * $plane_x);
+
+ // In image-space, the x- and y-offset necessary to move one unit in the y-direction in planar-space
+ $dyx = ($box['lower_right']['x'] - $box['upper_left']['x']) / ($subdivision_factor * $plane_y);
+ $dyy = ($box['lower_right']['y'] - $box['upper_left']['y']) / ($subdivision_factor * $plane_y);
+
+ // Initial captcha-letter offset in planar-space
+ $plane_offset_x = mt_rand(3, 8);
+ $plane_offset_y = mt_rand( 12, 15);
+
+ // character map
+ $map = $this->captcha_bitmaps();
+
+ // matrix
+ $plane = array();
+
+ // for each character, we'll silkscreen it into our boolean pixel plane
+ for ($c = 0, $code_num = strlen($code); $c < $code_num; ++$c)
+ {
+ $letter = $code[$c];
+
+ for ($x = $map['width'] - 1; $x >= 0; --$x)
+ {
+ for ($y = $map['height'] - 1; $y >= 0; --$y)
+ {
+ if ($map['data'][$letter][$y][$x])
+ {
+ $plane[$y + $plane_offset_y + (($c & 1) ? 1 : -1)][$x + $plane_offset_x] = true;
+ }
+ }
+ }
+ $plane_offset_x += 11;
+ }
+
+ // calculate our first buffer, we can't actually draw polys with these yet
+ // img_pos_prev == screen x,y location to our immediate left.
+ // img_pos_cur == current screen x,y location
+ // we calculate screen position of our
+ // current cell based on the difference from the previous cell
+ // rather than recalculating from absolute coordinates
+ // What we cache into the $img_buffer contains the raised text coordinates.
+ $img_pos_prev = $img_buffer[0][0] = array($box['upper_left']['x'], $box['upper_left']['y']);
+ $cur_height = $prev_height = $this->wave_height(0, 0, $subdivision_factor);
+ $full_x = $plane_x * $subdivision_factor;
+ $full_y = $plane_y * $subdivision_factor;
+
+ for ($x = 1; $x <= $full_x; ++$x)
+ {
+ $cur_height = $this->wave_height($x, 0, $subdivision_factor);
+ $offset = $cur_height - $prev_height;
+ $img_pos_cur = array($img_pos_prev[0] + $dxx, $img_pos_prev[1] + $dxy + $offset);
+
+ $img_buffer[0][$x] = $img_pos_cur;
+ $img_pos_prev = $img_pos_cur;
+ $prev_height = $cur_height;
+ }
+
+ for ($y = 1; $y <= $full_y; ++$y)
+ {
+ // swap buffers
+ $buffer_cur = $y & 1;
+ $buffer_prev = 1 - $buffer_cur;
+
+ $prev_height = $this->wave_height(0, $y, $subdivision_factor);
+ $offset = $prev_height - $this->wave_height(0, $y - 1, $subdivision_factor);
+ $img_pos_cur = array($img_buffer[$buffer_prev][0][0] + $dyx, min($img_buffer[$buffer_prev][0][1] + $dyy + $offset, $img_y - 1));
+
+ // make sure we don't try to write off the page
+ $img_pos_prev = $img_pos_cur;
+
+ $img_buffer[$buffer_cur][0] = $img_pos_cur;
+
+ for ($x = 1; $x <= $full_x; ++$x)
+ {
+ $cur_height = $this->wave_height($x, $y, $subdivision_factor) + $this->grid_height($x, $y, $x_grid, $y_grid, 1);
+
+ // height is a z-factor, not a y-factor
+ $offset = $cur_height - $prev_height;
+ $img_pos_cur = array($img_pos_prev[0] + $dxx, $img_pos_prev[1] + $dxy + $offset);
+
+ // height is float, index it to an int, get closest color
+ $color = $colors[intval($cur_height)];
+ $img_pos_prev = $img_pos_cur;
+ $prev_height = $cur_height;
+
+ $y_index_old = intval(($y - 1) / $subdivision_factor);
+ $y_index_new = intval($y / $subdivision_factor);
+ $x_index_old = intval(($x - 1) / $subdivision_factor);
+ $x_index_new = intval($x / $subdivision_factor);
+
+ if (!empty($plane[$y_index_new][$x_index_new]))
+ {
+ $img_pos_cur[1] += $this->wave_height($x, $y, $subdivision_factor, 1) - 30 - $cur_height;
+ $color = $colors[20];
+ }
+ $img_pos_cur[1] = min($img_pos_cur[1], $img_y - 1);
+ $img_buffer[$buffer_cur][$x] = $img_pos_cur;
+
+ // Smooth the edges as much as possible by having not more than one low<->high traingle per square
+ // Otherwise, just
+ $diag_down = (empty($plane[$y_index_old][$x_index_old]) == empty($plane[$y_index_new][$x_index_new]));
+ $diag_up = (empty($plane[$y_index_old][$x_index_new]) == empty($plane[$y_index_new][$x_index_old]));
+
+ // natural switching
+ $mode = ($x + $y) & 1;
+
+ // override if it requires it
+ if ($diag_down != $diag_up)
+ {
+ $mode = $diag_up;
+ }
+
+ if ($mode)
+ {
+ // +-/ /
+ // 1 |/ 2 /|
+ // / /-+
+ $poly1 = array_merge($img_buffer[$buffer_cur][$x - 1], $img_buffer[$buffer_prev][$x - 1], $img_buffer[$buffer_prev][$x]);
+ $poly2 = array_merge($img_buffer[$buffer_cur][$x - 1], $img_buffer[$buffer_cur][$x], $img_buffer[$buffer_prev][$x]);
+ }
+ else
+ {
+ // \ \-+
+ // 1 |\ 2 \|
+ // +-\ \
+ $poly1 = array_merge($img_buffer[$buffer_cur][$x - 1], $img_buffer[$buffer_prev][$x - 1], $img_buffer[$buffer_cur][$x]);
+ $poly2 = array_merge($img_buffer[$buffer_prev][$x - 1], $img_buffer[$buffer_prev][$x], $img_buffer[$buffer_cur][$x]);
+ }
+
+ imagefilledpolygon($img, $poly1, 3, $color);
+ imagefilledpolygon($img, $poly2, 3, $color);
+ }
+ }
+
+ // Output image
+ header('Content-Type: image/png');
+ header('Cache-control: no-cache, no-store');
+ //$mtime = explode(' ', microtime());
+ //$totaltime = $mtime[0] + $mtime[1] - $starttime;
+
+ //echo $totaltime . "<br />\n";
+ //echo memory_get_usage() - $tmp;
+ imagepng($img);
+ imagedestroy($img);
+ }
+
+ function wave_height($x, $y, $factor = 1, $tweak = 0.7)
+ {
+ // stretch the wave. TODO: pretty it up
+ $x = $x/5 + 180;
+ $y = $y/4;
+ return ((sin($x / (3 * $factor)) + sin($y / (3 * $factor))) * 10 * $tweak);
+ }
+
+ function grid_height($x, $y, $x_grid, $y_grid, $factor = 1)
+ {
+ return ((!($x % ($x_grid * $factor)) || !($y % ($y_grid * $factor))) ? 3 : 0);
+ }
+
+ function captcha_bitmaps()
+ {
+ return array(
+ 'width' => 9,
+ 'height' => 13,
+ 'data' => array(
+ 'A' => array(
+ array(0,0,1,1,1,1,0,0,0),
+ array(0,1,0,0,0,0,1,0,0),
+ array(1,0,0,0,0,0,0,1,0),
+ array(1,0,0,0,0,0,0,1,0),
+ array(1,0,0,0,0,0,0,1,0),
+ array(1,0,0,0,0,0,0,1,0),
+ array(1,0,0,0,0,0,0,1,0),
+ array(1,1,1,1,1,1,1,1,0),
+ array(1,0,0,0,0,0,0,1,0),
+ array(1,0,0,0,0,0,0,1,0),
+ array(1,0,0,0,0,0,0,1,0),
+ array(1,0,0,0,0,0,0,1,0),
+ array(1,0,0,0,0,0,0,1,0),
+ array(0,0,0,0,0,0,0,0,0),
+ ),
+ 'B' => array(
+ array(1,1,1,1,1,1,0,0,0),
+ array(1,0,0,0,0,0,1,0,0),
+ array(1,0,0,0,0,0,0,1,0),
+ array(1,0,0,0,0,0,0,1,0),
+ array(1,0,0,0,0,0,0,1,0),
+ array(1,0,0,0,0,0,1,0,0),
+ array(1,1,1,1,1,1,0,0,0),
+ array(1,0,0,0,0,0,1,0,0),
+ array(1,0,0,0,0,0,0,1,0),
+ array(1,0,0,0,0,0,0,1,0),
+ array(1,0,0,0,0,0,0,1,0),
+ array(1,0,0,0,0,0,1,0,0),
+ array(1,1,1,1,1,1,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ ),
+ 'C' => array(
+ array(0,0,1,1,1,1,1,0,0),
+ array(0,1,0,0,0,0,0,1,0),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,1),
+ array(0,1,0,0,0,0,0,1,0),
+ array(0,0,1,1,1,1,1,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ ),
+ 'D' => array(
+ array(1,1,1,1,1,1,1,0,0),
+ array(1,0,0,0,0,0,0,1,0),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,1,0),
+ array(1,1,1,1,1,1,1,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ ),
+ 'E' => array(
+ array(0,0,1,1,1,1,1,1,1),
+ array(0,1,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,1,1,1,1,1,1,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(0,1,0,0,0,0,0,0,0),
+ array(0,0,1,1,1,1,1,1,1),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ ),
+ 'F' => array(
+ array(0,0,1,1,1,1,1,1,0),
+ array(0,1,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,1,1,1,1,1,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ ),
+ 'G' => array(
+ array(0,0,1,1,1,1,1,0,0),
+ array(0,1,0,0,0,0,0,1,0),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,1,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(0,1,0,0,0,0,0,1,0),
+ array(0,0,1,1,1,1,1,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ ),
+ 'H' => array(
+ array(1,0,0,0,0,0,1,0,0),
+ array(1,0,0,0,0,0,1,0,0),
+ array(1,0,0,0,0,0,1,0,0),
+ array(1,0,0,0,0,0,1,0,0),
+ array(1,0,0,0,0,0,1,0,0),
+ array(1,1,1,1,1,1,1,0,0),
+ array(1,0,0,0,0,0,1,0,0),
+ array(1,0,0,0,0,0,1,0,0),
+ array(1,0,0,0,0,0,1,0,0),
+ array(1,0,0,0,0,0,1,0,0),
+ array(1,0,0,0,0,0,1,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ ),
+ 'I' => array(
+ array(0,1,1,1,1,1,1,1,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,1,1,1,1,1,1,1,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ ),
+ 'J' => array(
+ array(0,0,0,0,0,0,1,1,1),
+ array(0,0,0,0,0,0,0,0,1),
+ array(0,0,0,0,0,0,0,0,1),
+ array(0,0,0,0,0,0,0,0,1),
+ array(0,0,0,0,0,0,0,0,1),
+ array(0,0,0,0,0,0,0,0,1),
+ array(0,0,0,0,0,0,0,0,1),
+ array(0,1,0,0,0,0,0,0,1),
+ array(0,1,0,0,0,0,0,0,1),
+ array(0,0,1,0,0,0,0,1,0),
+ array(0,0,0,1,1,1,1,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ ),
+ 'K' => array(
+ array(1,0,0,0,0,0,1,0,0),
+ array(1,0,0,0,0,1,0,0,0),
+ array(1,0,0,0,1,0,0,0,0),
+ array(1,0,0,1,0,0,0,0,0),
+ array(1,0,1,0,0,0,0,0,0),
+ array(1,1,0,0,0,0,0,0,0),
+ array(1,0,1,0,0,0,0,0,0),
+ array(1,0,0,1,0,0,0,0,0),
+ array(1,0,0,0,1,0,0,0,0),
+ array(1,0,0,0,0,1,0,0,0),
+ array(1,0,0,0,0,0,1,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ ),
+ 'L' => array(
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(0,1,0,0,0,0,0,0,0),
+ array(0,0,1,1,1,1,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ ),
+ 'M' => array(
+ array(0,1,0,0,0,0,0,1,0),
+ array(0,1,1,0,0,0,1,1,0),
+ array(0,1,0,1,0,1,0,1,0),
+ array(0,1,0,0,1,0,0,1,0),
+ array(0,1,0,0,0,0,0,1,0),
+ array(0,1,0,0,0,0,0,1,0),
+ array(0,1,0,0,0,0,0,1,0),
+ array(0,1,0,0,0,0,0,1,0),
+ array(0,1,0,0,0,0,0,1,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ ),
+ 'N' => array(
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,1,0,0,0,0,0,0,1),
+ array(1,0,1,0,0,0,0,0,1),
+ array(1,0,0,1,0,0,0,0,1),
+ array(1,0,0,0,1,0,0,0,1),
+ array(1,0,0,0,0,1,0,0,1),
+ array(1,0,0,0,0,0,1,0,1),
+ array(1,0,0,0,0,0,0,1,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ ),
+ 'O' => array(
+ array(0,0,0,1,1,1,0,0,0),
+ array(0,0,1,0,0,0,1,0,0),
+ array(0,1,0,0,0,0,0,1,0),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(0,1,0,0,0,0,0,1,0),
+ array(0,0,1,0,0,0,1,0,0),
+ array(0,0,0,1,1,1,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ ),
+ 'P' => array(
+ array(1,1,1,1,1,1,0,0,0),
+ array(1,0,0,0,0,0,1,0,0),
+ array(1,0,0,0,0,0,0,1,0),
+ array(1,0,0,0,0,0,0,1,0),
+ array(1,0,0,0,0,0,0,1,0),
+ array(1,0,0,0,0,0,0,1,0),
+ array(1,0,0,0,0,0,1,0,0),
+ array(1,1,1,1,1,1,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ ),
+ 'Q' => array(
+ array(0,0,1,1,1,1,0,0,0),
+ array(0,1,0,0,0,0,1,0,0),
+ array(1,0,0,0,0,0,0,1,0),
+ array(1,0,0,0,0,0,0,1,0),
+ array(1,0,0,0,0,0,0,1,0),
+ array(1,0,0,0,0,0,0,1,0),
+ array(1,0,0,0,1,0,0,1,0),
+ array(1,0,0,0,0,1,0,1,0),
+ array(0,1,0,0,0,0,1,0,0),
+ array(0,0,1,1,1,1,0,1,0),
+ array(0,0,0,0,0,0,0,0,1),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ ),
+ 'R' => array(
+ array(1,1,1,1,1,1,0,0,0),
+ array(1,0,0,0,0,0,1,0,0),
+ array(1,0,0,0,0,0,0,1,0),
+ array(1,0,0,0,0,0,0,1,0),
+ array(1,0,0,0,0,0,0,1,0),
+ array(1,0,0,0,0,0,1,0,0),
+ array(1,1,1,1,1,1,0,0,0),
+ array(1,0,1,0,0,0,0,0,0),
+ array(1,0,0,1,0,0,0,0,0),
+ array(1,0,0,0,1,0,0,0,0),
+ array(1,0,0,0,0,1,0,0,0),
+ array(1,0,0,0,0,0,1,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ ),
+ 'S' => array(
+ array(0,0,1,1,1,1,1,1,1),
+ array(0,1,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(0,1,0,0,0,0,0,0,0),
+ array(0,0,1,1,1,1,1,0,0),
+ array(0,0,0,0,0,0,0,1,0),
+ array(0,0,0,0,0,0,0,0,1),
+ array(0,0,0,0,0,0,0,0,1),
+ array(0,0,0,0,0,0,0,1,0),
+ array(1,1,1,1,1,1,1,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ ),
+ 'T' => array(
+ array(1,1,1,1,1,1,1,1,1),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ ),
+ 'U' => array(
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(0,1,0,0,0,0,0,1,0),
+ array(0,0,1,1,1,1,1,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ ),
+ 'V' => array(
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(0,1,0,0,0,0,0,1,0),
+ array(0,0,1,0,0,0,1,0,0),
+ array(0,0,0,1,0,1,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ ),
+ 'W' => array(
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,1,0,0,0,1),
+ array(1,0,0,1,0,1,0,0,1),
+ array(1,0,1,0,0,0,1,0,1),
+ array(1,1,0,0,0,0,0,1,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ ),
+ 'X' => array(
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(0,1,0,0,0,0,0,1,0),
+ array(0,0,1,0,0,0,1,0,0),
+ array(0,0,0,1,0,1,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,1,0,1,0,0,0),
+ array(0,0,1,0,0,0,1,0,0),
+ array(0,1,0,0,0,0,0,1,0),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ ),
+ 'Y' => array(
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(0,1,0,0,0,0,0,1,0),
+ array(0,0,1,0,0,0,1,0,0),
+ array(0,0,0,1,0,1,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ ),
+ 'Z' => array(
+ array(1,1,1,1,1,1,1,1,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(0,0,0,0,0,0,0,1,0),
+ array(0,0,0,0,0,0,1,0,0),
+ array(0,0,0,0,0,1,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,1,0,0,0,0,0),
+ array(0,0,1,0,0,0,0,0,0),
+ array(0,1,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,1,1,1,1,1,1,1,1),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ ),
+ '1' => array(
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,1,1,0,0,0,0),
+ array(0,0,1,0,1,0,0,0,0),
+ array(0,1,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,1,1,1,1,1,1,1,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ ),
+ '2' => array(
+ array(0,0,0,1,1,1,0,0,0),
+ array(0,0,1,0,0,0,1,0,0),
+ array(0,1,0,0,0,0,0,1,0),
+ array(0,0,0,0,0,0,0,0,1),
+ array(0,0,0,0,0,0,0,0,1),
+ array(0,0,0,0,0,0,0,0,1),
+ array(0,0,0,0,0,0,0,1,0),
+ array(0,0,0,0,0,0,1,0,0),
+ array(0,0,0,0,0,1,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,1,0,0,0,0,0),
+ array(0,0,1,0,0,0,0,0,0),
+ array(0,1,1,1,1,1,1,1,1),
+ array(0,0,0,0,0,0,0,0,0),
+ ),
+ '3' => array(
+ array(0,0,0,1,1,1,1,0,0),
+ array(0,0,1,0,0,0,0,1,0),
+ array(0,1,0,0,0,0,0,0,1),
+ array(0,0,0,0,0,0,0,0,1),
+ array(0,0,0,0,0,0,0,0,1),
+ array(0,0,0,0,0,0,0,1,0),
+ array(0,0,0,0,0,1,1,0,0),
+ array(0,0,0,0,0,0,0,1,0),
+ array(0,0,0,0,0,0,0,0,1),
+ array(0,0,0,0,0,0,0,0,1),
+ array(0,1,0,0,0,0,0,0,1),
+ array(0,0,1,0,0,0,0,1,0),
+ array(0,0,0,1,1,1,1,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ ),
+ '4' => array(
+ array(0,0,0,0,0,0,0,1,0),
+ array(0,0,0,0,0,0,1,1,0),
+ array(0,0,0,0,0,1,0,1,0),
+ array(0,0,0,0,1,0,0,1,0),
+ array(0,0,0,1,0,0,0,1,0),
+ array(0,0,1,0,0,0,0,1,0),
+ array(0,1,1,1,1,1,1,1,1),
+ array(0,0,0,0,0,0,0,1,0),
+ array(0,0,0,0,0,0,0,1,0),
+ array(0,0,0,0,0,0,0,1,0),
+ array(0,0,0,0,0,0,0,1,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ ),
+ '5' => array(
+ array(1,1,1,1,1,1,1,1,1),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(0,1,0,0,0,0,0,0,0),
+ array(0,0,1,1,1,1,1,0,0),
+ array(0,0,0,0,0,0,0,1,0),
+ array(0,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(0,1,0,0,0,0,0,1,0),
+ array(0,0,1,1,1,1,1,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ ),
+ '6' => array(
+ array(0,0,1,1,1,1,1,0,0),
+ array(0,1,0,0,0,0,0,1,0),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,0,0,0,0,0,0),
+ array(1,0,0,1,1,1,1,0,0),
+ array(1,0,1,0,0,0,0,1,0),
+ array(1,1,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(0,1,0,0,0,0,0,1,0),
+ array(0,0,1,1,1,1,1,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ ),
+ '7' => array(
+ array(1,1,1,1,1,1,1,1,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(0,0,0,0,0,0,0,1,0),
+ array(0,0,0,0,0,0,1,0,0),
+ array(0,0,0,0,0,1,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,1,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ ),
+ '8' => array(
+ array(0,0,1,1,1,1,1,0,0),
+ array(0,1,0,0,0,0,0,1,0),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(0,1,0,0,0,0,0,1,0),
+ array(0,0,1,1,1,1,1,0,0),
+ array(0,1,0,0,0,0,0,1,0),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(1,0,0,0,0,0,0,0,1),
+ array(0,1,0,0,0,0,0,1,0),
+ array(0,0,1,1,1,1,1,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ ),
+ '9' => array(
+ array(0,0,0,1,1,1,1,0,0),
+ array(0,0,1,0,0,0,0,1,0),
+ array(0,1,0,0,0,0,0,0,1),
+ array(0,1,0,0,0,0,0,0,1),
+ array(0,1,0,0,0,0,0,0,1),
+ array(0,1,0,0,0,0,0,1,1),
+ array(0,0,1,1,1,1,1,0,1),
+ array(0,0,0,0,0,0,0,0,1),
+ array(0,0,0,0,0,0,0,0,1),
+ array(0,1,0,0,0,0,0,0,1),
+ array(0,0,1,0,0,0,0,1,0),
+ array(0,0,0,1,1,1,1,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ array(0,0,0,0,0,0,0,0,0),
+ ),
+ )
+ );
+ }
+}
diff --git a/phpBB/phpbb/captcha/non_gd.php b/phpBB/phpbb/captcha/non_gd.php
new file mode 100644
index 0000000000..3818672f17
--- /dev/null
+++ b/phpBB/phpbb/captcha/non_gd.php
@@ -0,0 +1,386 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\captcha;
+
+/**
+* Main non-gd captcha class
+* @ignore
+*/
+class non_gd
+{
+ var $filtered_pngs;
+ var $width = 320;
+ var $height = 50;
+
+ /**
+ * Define filtered pngs on init
+ */
+ function __construct()
+ {
+ // If we can we will generate a single filtered png, we avoid nastiness via emulation of some Zlib stuff
+ $this->define_filtered_pngs();
+ }
+
+ /**
+ * Create the image containing $code with a seed of $seed
+ */
+ function execute($code, $seed)
+ {
+ $img_height = $this->height - 10;
+ $img_width = 0;
+
+ mt_srand($seed);
+
+ $char_widths = $hold_chars = array();
+ $code_len = strlen($code);
+
+ for ($i = 0; $i < $code_len; $i++)
+ {
+ $char = $code[$i];
+
+ $width = mt_rand(0, 4);
+ $raw_width = $this->filtered_pngs[$char]['width'];
+ $char_widths[$i] = $width;
+ $img_width += $raw_width - $width;
+
+ // Split the char into chunks of $raw_width + 1 length
+ if (empty($hold_chars[$char]))
+ {
+ $hold_chars[$char] = str_split(base64_decode($this->filtered_pngs[$char]['data']), $raw_width + 1);
+ }
+ }
+
+ $offset_x = mt_rand(0, $this->width - $img_width);
+ $offset_y = mt_rand(0, $this->height - $img_height);
+
+ $image = '';
+ for ($i = 0; $i < $this->height; $i++)
+ {
+ $image .= chr(0);
+
+ if ($i > $offset_y && $i < $offset_y + $img_height)
+ {
+ for ($j = 0; $j < $offset_x; $j++)
+ {
+ $image .= chr(mt_rand(140, 255));
+ }
+
+ for ($j = 0; $j < $code_len; $j++)
+ {
+ $image .= $this->randomise(substr($hold_chars[$code{$j}][$i - $offset_y - 1], 1), $char_widths[$j]);
+ }
+
+ for ($j = $offset_x + $img_width; $j < $this->width; $j++)
+ {
+ $image .= chr(mt_rand(140, 255));
+ }
+ }
+ else
+ {
+ for ($j = 0; $j < $this->width; $j++)
+ {
+ $image .= chr(mt_rand(140, 255));
+ }
+ }
+ }
+ unset($hold_chars);
+
+ $image = $this->create_png($image, $this->width, $this->height);
+
+ // Output image
+ header('Content-Type: image/png');
+ header('Cache-control: no-cache, no-store');
+ echo $image;
+ exit;
+ }
+
+ /**
+ * This is designed to randomise the pixels of the image data within
+ * certain limits so as to keep it readable. It also varies the image
+ * width a little
+ */
+ function randomise($scanline, $width)
+ {
+ $new_line = '';
+
+ $end = strlen($scanline) - ceil($width/2);
+ for ($i = (int) floor($width / 2); $i < $end; $i++)
+ {
+ $pixel = ord($scanline{$i});
+
+ if ($pixel < 190)
+ {
+ $new_line .= chr(mt_rand(0, 205));
+ }
+ else if ($pixel > 190)
+ {
+ $new_line .= chr(mt_rand(145, 255));
+ }
+ else
+ {
+ $new_line .= $scanline{$i};
+ }
+ }
+
+ return $new_line;
+ }
+
+ /**
+ * This creates a chunk of the given type, with the given data
+ * of the given length adding the relevant crc
+ */
+ function png_chunk($length, $type, $data)
+ {
+ $raw = $type . $data;
+
+ return pack('N', $length) . $raw . pack('N', crc32($raw));
+ }
+
+ /**
+ * Creates greyscale 8bit png - The PNG spec can be found at
+ * http://www.libpng.org/pub/png/spec/PNG-Contents.html we use
+ * png because it's a fully recognised open standard and supported
+ * by practically all modern browsers and OSs
+ */
+ function create_png($raw_image, $width, $height)
+ {
+ // SIG
+ $image = pack('C8', 137, 80, 78, 71, 13, 10, 26, 10);
+
+ // IHDR
+ $raw = pack('N2', $width, $height);
+ $raw .= pack('C5', 8, 0, 0, 0, 0);
+ $image .= $this->png_chunk(13, 'IHDR', $raw);
+
+ // IDAT
+ if (@extension_loaded('zlib'))
+ {
+ $raw_image = gzcompress($raw_image);
+ $length = strlen($raw_image);
+ }
+ else
+ {
+ // The total length of this image, uncompressed, is just a calculation of pixels
+ $length = ($width + 1) * $height;
+
+ // Adler-32 hash generation
+ // Note: The hash is _backwards_ so we must reverse it
+
+ if (@extension_loaded('hash'))
+ {
+ $adler_hash = strrev(hash('adler32', $raw_image, true));
+ }
+ else if (@extension_loaded('mhash'))
+ {
+ $adler_hash = strrev(mhash(MHASH_ADLER32, $raw_image));
+ }
+ else
+ {
+ // Optimized Adler-32 loop ported from the GNU Classpath project
+ $temp_length = $length;
+ $s1 = 1;
+ $s2 = $index = 0;
+
+ while ($temp_length > 0)
+ {
+ // We can defer the modulo operation:
+ // s1 maximally grows from 65521 to 65521 + 255 * 3800
+ // s2 maximally grows by 3800 * median(s1) = 2090079800 < 2^31
+ $substract_value = ($temp_length < 3800) ? $temp_length : 3800;
+ $temp_length -= $substract_value;
+
+ while (--$substract_value >= 0)
+ {
+ $s1 += ord($raw_image[$index]);
+ $s2 += $s1;
+
+ $index++;
+ }
+
+ $s1 %= 65521;
+ $s2 %= 65521;
+ }
+ $adler_hash = pack('N', ($s2 << 16) | $s1);
+ }
+
+ // This is the same thing as gzcompress($raw_image, 0) but does not need zlib
+ $raw_image = pack('C3v2', 0x78, 0x01, 0x01, $length, ~$length) . $raw_image . $adler_hash;
+
+ // The Zlib header + Adler hash make us add on 11
+ $length += 11;
+ }
+
+ // IDAT
+ $image .= $this->png_chunk($length, 'IDAT', $raw_image);
+
+ // IEND
+ $image .= $this->png_chunk(0, 'IEND', '');
+
+ return $image;
+ }
+
+ /**
+ * png image data
+ * Each 'data' element is base64_encoded uncompressed IDAT
+ */
+ function define_filtered_pngs()
+ {
+ $this->filtered_pngs = array(
+ '0' => array(
+ 'data' => 'AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A///////////////////olFAkBAAAGDyA4P///M31/////////////wD////////////////0dAgAAAAAAAAAAAAEcPipFGHn////////////AP//////////////6DAAAAAAAAAAAAAAAAAALSEAN+T///////////8A//////////////xAAAAAAAAAAAAAAAAAAAAAACPA/////////////wD/////////////oAAAAAAAAAAAAAAAAAAAAAAAev//////////////AP////////////8oAAAAAAAAPNj/zDAAAAAAAABD//////////////8A////////////1AAAAAAAABjw////5BAAAAAAAADo/////////////wD///////////+QAAAAAAAAbP//////QgAAAAAAAKj/////////////AP///////////1wAAAAAAACs/////8AXAAAAAAAAcP////////////8A////////////OAAAAAAAAND////dNwAAAAAAAABI/////////////wD///////////8gAAAAAAAA4P//7koACwAAAAAAACT/////////////AP///////////wgAAAAAAAD///VqAwaPAAAAAAAAEP////////////8A////////////AAAAAAAAAP/8kQYDavUAAAAAAAAA/////////////wD///////////8AAAAAAAAA/6kNAEru/wAAAAAAAAD/////////////AP///////////wAAAAAAAADAIwA33f//AAAAAAAAAP////////////8A////////////FAAAAAAAADYAI8D///8AAAAAAAAQ/////////////wD///////////8kAAAAAAAAAA2p////5AAAAAAAACD/////////////AP///////////0gAAAAAAAAFkfz////UAAAAAAAAQP////////////8A////////////cAAAAAAAAET1/////7AAAAAAAABo/////////////wD///////////+oAAAAAAAAXfX/////sAAAAAAAAGj/////////////AAAAALgAAAAAAAAwAAAAAAAAAAAAAAD////////////oAAAAAAAACOT////oEAAAAAAAAOD/////////////AP////////////8+AAAAAAAAKMz/zDQAAAAAAAA0//////////////8A////////////7jgAAAAAAAAAAAAAAAAAAAAAAKT//////////////wD///////////VqAwIAAAAAAAAAAAAAAAAAAAA8////////////////AP//////////rQcDaVEAAAAAAAAAAAAAAAAAKOj///////////////8A///////////nblnu/IAIAAAAAAAAAAAAAFzw/////////////////wD////////////79////+iITCAAAAAgSITg////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////w==',
+ 'width' => 40
+ ),
+ '1' => array(
+ 'data' => 'AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////8BAAAAAAAP//////////////////AP////////////////////////9sAAAAAAAA//////////////////8A////////////////////////pAAAAAAAAAD//////////////////wD//////////////////////6wEAAAAAAAAAP//////////////////AP////////////////////h4AAAAAAAAAAAA//////////////////8A//////////////////ygJAAAAAAAAAAAAAD//////////////////wD//////////////9x8HAAAAAAAAAAAAAAAAP//////////////////AP//////////////AAAAAAAAAAAAAAAAAAAA//////////////////8A//////////////8AAAAAAAAAAAAAAAAAAAD//////////////////wD//////////////wAAAAAAAAR4AAAAAAAAAP//////////////////AP//////////////AAAAAAA4zP8AAAAAAAAA//////////////////8A//////////////8AAAA4sP///wAAAAAAAAD//////////////////wD//////////////yR80P//////AAAAAAAAAP//////////////////AP////////////////////////8AAAAAAAAA//////////////////8A/////////////////////////wAAAAAAAAD//////////////////wD/////////////////////////AAAAAAAAAP//////////////////AP////////////////////////8AAAAAAAAA//////////////////8A/////////////////////////wAAAAAAAAD//////////////////wD/////////////////////////AAAAAAAAAP//////////////////AP////////////////////////8AAAAAAAAA//////////////////8A/////////////////////////wAAAAAAAAD//////////////////wD/////////////////////////AAAAAAAAAP//////////////////AP////////////////////////8AAAAAAAAA//////////////////8A/////////////////////////wAAAAAAAAD//////////////////wD/////////////////////////AAAAAAAAAP//////////////////AP////////////////////////8AAAAAAAAA//////////////////8A/////////////////////////wAAAAAAAAD//////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8=',
+ 'width' => 40
+ ),
+ '2' => array(
+ 'data' => 'AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP/////////////////okFAkCAAABCBIfNT///////////////////8A///////////////8hAgAAAAAAAAAAAAAAFTo/////////////////wD//////////////1QAAAAAAAAAAAAAAAAAACjo////////////////AP////////////+MAAAAAAAAAAAAAAAAAAAAADj///////////////8A////////////9BAAAAAAAAAAAAAAAAAAAAAAALD//////////////wD///////////+gAAAAAAAAAHjs+KwMAAAAAAAAVP//////////////AP///////////1gAAAAAAABM/////6QAAAAAAAAU//////////////8A////////////KAAAAAAAALj/////+AAAAAAAAAD//////////////wD///////////+MfGBMOCAI8P/////wAAAAAAAACP//////////////AP///////////////////////////5wAAAAAAAAw//////////////8A///////////////////////////oFAAAAAAAAHz//////////////wD/////////////////////////6CgAAAAAAAAE3P//////////////AP///////////////////////9ggAAAAAAAAAHT///////////////8A//////////////////////+0DAAAAAAAAAA8+P///////////////wD/////////////////////gAAAAAAAAAAAKOj/////////////////AP//////////////////9FAAAAAAAAAAADzw//////////////////8A/////////////////+g4AAAAAAAAAABk/P///////////////////wD////////////////oKAAAAAAAAAAMqP//////////////////////AP//////////////6CgAAAAAAAAAMNz///////////////////////8A//////////////g4AAAAAAAAAFT0/////////////////////////wD/////////////bAAAAAAAAABU/P//////////////////////////AP///////////8wAAAAAAAAAAAAAAAAAAAAAAAAA//////////////8A////////////SAAAAAAAAAAAAAAAAAAAAAAAAAD//////////////wD//////////9wAAAAAAAAAAAAAAAAAAAAAAAAAAP//////////////AP//////////hAAAAAAAAAAAAAAAAAAAAAAAAAAA//////////////8A//////////9AAAAAAAAAAAAAAAAAAAAAAAAAAAD//////////////wD//////////xAAAAAAAAAAAAAAAAAAAAAAAAAAAP//////////////AP////////////////////////////////////////////////////8=',
+ 'width' => 40
+ ),
+ '3' => array(
+ 'data' => 'AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD////////////////8sGg0FAAAACA4cLz8////////////////////AP//////////////rBgAAAAAAAAAAAAAACTA//////////////////8A/////////////3QAAAAAAAAAAAAAAAAAAASs/////////////////wD///////////+YAAAAAAAAAAAAAAAAAAAAAAjc////////////////AP//////////6AwAAAAAAAAAAAAAAAAAAAAAAGT///////////////8A//////////94AAAAAAAABJDw/8g4AAAAAAAAHP///////////////wD//////////yAAAAAAAACE/////9gAAAAAAAAA////////////////AP///////////NSwiGQ4FOT//////AAAAAAAABD///////////////8A//////////////////////////+YAAAAAAAAVP///////////////wD//////////////////////P/ggAQAAAAAAATM////////////////AP////////////////////9gAAAAAAAAAAAElP////////////////8A/////////////////////0AAAAAAAAAAHLj//////////////////wD/////////////////////OAAAAAAAAAAwkPj/////////////////AP////////////////////8gAAAAAAAAAAAAINj///////////////8A/////////////////////xAAAAAAAAAAAAAAIPD//////////////wD/////////////////////uOz/4HgEAAAAAAAAhP//////////////AP///////////////////////////3wAAAAAAAAw//////////////8A////////////////////////////6AAAAAAAAAj//////////////wD/////////////////////////////AAAAAAAAAP//////////////AP//////////tJh8YEQoDNz//////+AAAAAAAAAY//////////////8A//////////88AAAAAAAAaP//////dAAAAAAAAEz//////////////wD//////////6QAAAAAAAAAdOD/5HQAAAAAAAAApP//////////////AP///////////CgAAAAAAAAAAAAAAAAAAAAAACD4//////////////8A////////////yAQAAAAAAAAAAAAAAAAAAAAEuP///////////////wD/////////////rAQAAAAAAAAAAAAAAAAABJD/////////////////AP//////////////zDQAAAAAAAAAAAAAACTA//////////////////8A/////////////////8BwOCAAAAAUNGi0/P///////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8=',
+ 'width' => 40
+ ),
+ '4' => array(
+ 'data' => 'AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP//////////////////////////nAAAAAAAAAD///////////////8A/////////////////////////8AEAAAAAAAAAP///////////////wD////////////////////////gGAAAAAAAAAAA////////////////AP//////////////////////9DAAAAAAAAAAAAD///////////////8A//////////////////////9UAAAAAAAAAAAAAP///////////////wD/////////////////////hAAAAAAAAAAAAAAA////////////////AP///////////////////7QAAAAAAAAAAAAAAAD///////////////8A///////////////////UDAAAAAAUAAAAAAAAAP///////////////wD/////////////////7CQAAAAABMAAAAAAAAAA////////////////AP////////////////xEAAAAAACU/wAAAAAAAAD///////////////8A////////////////cAAAAAAAZP//AAAAAAAAAP///////////////wD//////////////6AAAAAAADz8//8AAAAAAAAA////////////////AP/////////////IBAAAAAAc6P///wAAAAAAAAD///////////////8A////////////5BgAAAAADMz/////AAAAAAAAAP///////////////wD///////////g0AAAAAACk//////8AAAAAAAAA////////////////AP//////////XAAAAAAAfP///////wAAAAAAAAD///////////////8A//////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///////////wD//////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////////AP//////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///////////8A//////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///////////wD//////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////////AP//////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///////////8A////////////////////////////AAAAAAAAAP///////////////wD///////////////////////////8AAAAAAAAA////////////////AP///////////////////////////wAAAAAAAAD///////////////8A////////////////////////////AAAAAAAAAP///////////////wD///////////////////////////8AAAAAAAAA////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8=',
+ 'width' => 40
+ ),
+ '5' => array(
+ 'data' => 'AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP//////////////8AAAAAAAAAAAAAAAAAAAAAAA//////////////8A///////////////MAAAAAAAAAAAAAAAAAAAAAAD//////////////wD//////////////6wAAAAAAAAAAAAAAAAAAAAAAP//////////////AP//////////////iAAAAAAAAAAAAAAAAAAAAAAA//////////////8A//////////////9kAAAAAAAAAAAAAAAAAAAAAAD//////////////wD//////////////0QAAAAAAAAAAAAAAAAAAAAAAP//////////////AP//////////////IAAAAAAAYP////////////////////////////8A//////////////wAAAAAAAB8/////////////////////////////wD/////////////3AAAAAAAAIj/////////////////////////////AP////////////+4AAAAAAAAoLRYHAAEKGTE//////////////////8A/////////////5QAAAAAAAAQAAAAAAAAAABY9P///////////////wD/////////////dAAAAAAAAAAAAAAAAAAAAAA89P//////////////AP////////////9QAAAAAAAAAAAAAAAAAAAAAABg//////////////8A/////////////zAAAAAAAAAAAAAAAAAAAAAAAADQ/////////////wD/////////////IAAAAAAAAGjY/+h4BAAAAAAAAGz/////////////AP//////////////9NS0lHSc//////90AAAAAAAALP////////////8A/////////////////////////////9QAAAAAAAAE/////////////wD//////////////////////////////wAAAAAAAAD/////////////AP/////////////////////////////8AAAAAAAAEP////////////8A////////////pIRwWEAgDOD//////8wAAAAAAAA8/////////////wD///////////9EAAAAAAAAaP//////ZAAAAAAAAHz/////////////AP///////////6QAAAAAAAAAaOD/4GQAAAAAAAAE4P////////////8A/////////////CQAAAAAAAAAAAAAAAAAAAAAAGD//////////////wD/////////////yAQAAAAAAAAAAAAAAAAAAAAc7P//////////////AP//////////////rAwAAAAAAAAAAAAAAAAAGNj///////////////8A////////////////0EAAAAAAAAAAAAAAAFTo/////////////////wD//////////////////8h4QCAAAAAcQHzU////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8=',
+ 'width' => 40
+ ),
+ '6' => array(
+ 'data' => 'AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD///////////////////+0ZCwMAAAUNGjI////////////////////AP/////////////////EMAAAAAAAAAAAAABM6P////////////////8A////////////////lAQAAAAAAAAAAAAAAAAo6P///////////////wD//////////////6wAAAAAAAAAAAAAAAAAAABI////////////////AP/////////////oEAAAAAAAAAAAAAAAAAAAAACw//////////////8A/////////////3AAAAAAAAAoxP/YPAAAAAAAAEj//////////////wD////////////4EAAAAAAACOD////YDCBAVGiAoP//////////////AP///////////7gAAAAAAABY//////////////////////////////8A////////////eAAAAAAAAJT//////////////////////////////wD///////////9MAAAAAAAAvP/IXBgABCx03P//////////////////AP///////////ygAAAAAAADcdAAAAAAAAAAEiP////////////////8A////////////FAAAAAAAAFAAAAAAAAAAAAAAcP///////////////wD///////////8AAAAAAAAAAAAAAAAAAAAAAAAAlP//////////////AP///////////wAAAAAAAAAAAAAAAAAAAAAAAAAQ8P////////////8A////////////AAAAAAAAAABAyP/kZAAAAAAAAACQ/////////////wD///////////8MAAAAAAAALPj/////WAAAAAAAAET/////////////AP///////////yQAAAAAAACY///////MAAAAAAAAFP////////////8A////////////SAAAAAAAAMD///////wAAAAAAAAA/////////////wD///////////9wAAAAAAAAvP///////wAAAAAAAAD/////////////AP///////////7QAAAAAAACI///////UAAAAAAAAJP////////////8A////////////+AwAAAAAACDw/////2wAAAAAAABY/////////////wD/////////////cAAAAAAAADC8/Ox4AAAAAAAAAKj/////////////AP/////////////oEAAAAAAAAAAAAAAAAAAAAAAk/P////////////8A//////////////+oAAAAAAAAAAAAAAAAAAAABLj//////////////wD///////////////+QAAAAAAAAAAAAAAAAAACQ////////////////AP////////////////+0JAAAAAAAAAAAAAAkuP////////////////8A///////////////////8sGg0FAAADCxgqPz//////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8=',
+ 'width' => 40
+ ),
+ '7' => array(
+ 'data' => 'AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD///////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////AP///////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAP////////////8A////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////wD///////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////AP///////////wAAAAAAAAAAAAAAAAAAAAAAAAAABP////////////8A////////////AAAAAAAAAAAAAAAAAAAAAAAAAAy4/////////////wD//////////////////////////+QUAAAAAAAEuP//////////////AP/////////////////////////8QAAAAAAAAKT///////////////8A/////////////////////////4wAAAAAAAB0/////////////////wD////////////////////////cCAAAAAAANPz/////////////////AP///////////////////////0QAAAAAAATY//////////////////8A//////////////////////+0AAAAAAAAeP///////////////////wD//////////////////////CQAAAAAABTw////////////////////AP////////////////////+gAAAAAAAAkP////////////////////8A/////////////////////ywAAAAAABDw/////////////////////wD///////////////////+4AAAAAAAAbP//////////////////////AP///////////////////1wAAAAAAADQ//////////////////////8A///////////////////4DAAAAAAAMP///////////////////////wD//////////////////7QAAAAAAAB8////////////////////////AP//////////////////aAAAAAAAAMj///////////////////////8A//////////////////8oAAAAAAAM/P///////////////////////wD/////////////////8AAAAAAAAET/////////////////////////AP////////////////+0AAAAAAAAcP////////////////////////8A/////////////////4wAAAAAAACY/////////////////////////wD/////////////////WAAAAAAAAMD/////////////////////////AP////////////////80AAAAAAAA4P////////////////////////8A/////////////////xAAAAAAAAD4/////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8=',
+ 'width' => 40
+ ),
+ '8' => array(
+ 'data' => 'AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD////////////////////IdDQUAAAEIEiA1P//////////////////AP/////////////////gRAAAAAAAAAAAAAAAROD///////////////8A////////////////0BgAAAAAAAAAAAAAAAAAEMj//////////////wD///////////////AcAAAAAAAAAAAAAAAAAAAAHPD/////////////AP//////////////hAAAAAAAAAAAAAAAAAAAAAAAhP////////////8A//////////////8sAAAAAAAAKMz/zCgAAAAAAAAs/////////////wD//////////////wAAAAAAAADM////zAAAAAAAAAD/////////////AP//////////////BAAAAAAAAP//////AAAAAAAABP////////////8A//////////////8sAAAAAAAAzP///9QAAAAAAAAw/////////////wD//////////////3wAAAAAAAAoyP/YNAAAAAAAAIT/////////////AP//////////////7BgAAAAAAAAAAAAAAAAAAAAc8P////////////8A////////////////xBgAAAAAAAAAAAAAAAAAGNj//////////////wD/////////////////tAQAAAAAAAAAAAAAAACo////////////////AP///////////////HAAAAAAAAAAAAAAAAAAAAB8//////////////8A//////////////9gAAAAAAAAAAAAAAAAAAAAAAB8/////////////wD/////////////wAAAAAAAAABk4P/UWAAAAAAAAATQ////////////AP////////////9UAAAAAAAAaP//////XAAAAAAAAGT///////////8A/////////////xgAAAAAAADg///////cAAAAAAAAJP///////////wD/////////////AAAAAAAAAP////////8AAAAAAAAA////////////AP////////////8AAAAAAAAA4P//////3AAAAAAAAAT///////////8A/////////////ygAAAAAAABg//////9cAAAAAAAALP///////////wD/////////////ZAAAAAAAAABY1P/cXAAAAAAAAABw////////////AP/////////////QAAAAAAAAAAAAAAAAAAAAAAAABNz///////////8A//////////////9gAAAAAAAAAAAAAAAAAAAAAAB0/////////////wD///////////////Q8AAAAAAAAAAAAAAAAAAAAUPz/////////////AP////////////////x4CAAAAAAAAAAAAAAAEIT8//////////////8A///////////////////smFQwGAAAABg0ZKT0/////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8=',
+ 'width' => 40
+ ),
+ '9' => array(
+ 'data' => 'AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD///////////////////ysYCwMAAAUNGiw/P//////////////////AP////////////////+4JAAAAAAAAAAAAAAkuP////////////////8A////////////////lAQAAAAAAAAAAAAAAAAAkP///////////////wD//////////////8AEAAAAAAAAAAAAAAAAAAAAqP//////////////AP/////////////8JAAAAAAAAAAAAAAAAAAAAAAQ7P////////////8A/////////////6wAAAAAAAAAfOz8vCwAAAAAAABw/////////////wD/////////////WAAAAAAAAHD/////7BgAAAAAAAz4////////////AP////////////8kAAAAAAAA1P//////hAAAAAAAALT///////////8A/////////////wAAAAAAAAD///////+4AAAAAAAAcP///////////wD/////////////AAAAAAAAAPz//////8AAAAAAAABI////////////AP////////////8UAAAAAAAAzP//////lAAAAAAAACT///////////8A/////////////0QAAAAAAABY//////gsAAAAAAAADP///////////wD/////////////kAAAAAAAAABw5P/IPAAAAAAAAAAA////////////AP/////////////wEAAAAAAAAAAAAAAAAAAAAAAAAAD///////////8A//////////////+UAAAAAAAAAAAAAAAAAAAAAAAAAP///////////wD///////////////9wAAAAAAAAAAAAAFAAAAAAAAAU////////////AP////////////////+IBAAAAAAAAABw3AAAAAAAACj///////////8A///////////////////cdCwEABhcxP+8AAAAAAAATP///////////wD//////////////////////////////5AAAAAAAAB4////////////AP//////////////////////////////UAAAAAAAALj///////////8A//////////////+kgGxUQCAM2P///+AIAAAAAAAQ+P///////////wD//////////////0gAAAAAAAA42P/EKAAAAAAAAHD/////////////AP//////////////sAAAAAAAAAAAAAAAAAAAAAAQ6P////////////8A////////////////TAAAAAAAAAAAAAAAAAAAAKz//////////////wD////////////////oKAAAAAAAAAAAAAAAAASU////////////////AP/////////////////sUAAAAAAAAAAAAAAwxP////////////////8A////////////////////yHA0FAAADCxktP///////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8=',
+ 'width' => 40
+ ),
+ 'A' => array(
+ 'data' => 'AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD//////////////////+QAAAAAAAAAAAAAAOT/////////////////AP//////////////////kAAAAAAAAAAAAAAAkP////////////////8A//////////////////88AAAAAAAAAAAAAAA8/////////////////wD/////////////////5AAAAAAAAAAAAAAAAADk////////////////AP////////////////+QAAAAAAAAAAAAAAAAAJD///////////////8A/////////////////zwAAAAAAAAAAAAAAAAAPP///////////////wD////////////////kAAAAAAAAAAgAAAAAAAAA5P//////////////AP///////////////5AAAAAAAAAAgAAAAAAAAACQ//////////////8A////////////////PAAAAAAAAAz8HAAAAAAAADz//////////////wD//////////////+QAAAAAAAAAWP9kAAAAAAAAANz/////////////AP//////////////kAAAAAAAAACk/7wAAAAAAAAAhP////////////8A//////////////88AAAAAAAABOz//BQAAAAAAAAw/////////////wD/////////////4AAAAAAAAAA8////ZAAAAAAAAADc////////////AP////////////+EAAAAAAAAAIj///+8AAAAAAAAAIT///////////8A/////////////zAAAAAAAAAA2P////wQAAAAAAAAMP///////////wD////////////cAAAAAAAAACT//////1wAAAAAAAAA3P//////////AP///////////4QAAAAAAAAAAAAAAAAAAAAAAAAAAACE//////////8A////////////MAAAAAAAAAAAAAAAAAAAAAAAAAAAADD//////////wD//////////9wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAANz/////////AP//////////hAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAhP////////8A//////////8wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAw/////////wD/////////3AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADc////////AP////////+EAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIT///////8A/////////zAAAAAAAAAAhP///////////2QAAAAAAAAAMP///////wD////////cAAAAAAAAAADM////////////vAAAAAAAAAAA3P//////AP///////4QAAAAAAAAAHP/////////////4DAAAAAAAAACE//////8A////////MAAAAAAAAABk//////////////9cAAAAAAAAADD//////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8=',
+ 'width' => 40
+ ),
+ 'B' => array(
+ 'data' => 'AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A//////////8AAAAAAAAAAAAAAAAAAAAAEDh83P///////////////wD//////////wAAAAAAAAAAAAAAAAAAAAAAAAAEhP//////////////AP//////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAeP////////////8A//////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAxP///////////wD//////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAABY////////////AP//////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAABT///////////8A//////////8AAAAAAAAAAP/////4zEwAAAAAAAAAAP///////////wD//////////wAAAAAAAAAA////////7AAAAAAAAAAQ////////////AP//////////AAAAAAAAAAD////////sAAAAAAAAAEj///////////8A//////////8AAAAAAAAAAP/////4zEQAAAAAAAAAtP///////////wD//////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAFz/////////////AP//////////AAAAAAAAAAAAAAAAAAAAAAAAAAiA/P////////////8A//////////8AAAAAAAAAAAAAAAAAAAAAAAAIjPj//////////////wD//////////wAAAAAAAAAAAAAAAAAAAAAAAAAAGKz/////////////AP//////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAJT///////////8A//////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAABNz//////////wD//////////wAAAAAAAAAA///////sqCAAAAAAAAAAbP//////////AP//////////AAAAAAAAAAD/////////yAAAAAAAAAAs//////////8A//////////8AAAAAAAAAAP//////////AAAAAAAAAAT//////////wD//////////wAAAAAAAAAA/////////7wAAAAAAAAAAP//////////AP//////////AAAAAAAAAAD//////+ikGAAAAAAAAAAY//////////8A//////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFT//////////wD//////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAsP//////////AP//////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAADj///////////8A//////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAc6P///////////wD//////////wAAAAAAAAAAAAAAAAAAAAAAAAAATOj/////////////AP//////////AAAAAAAAAAAAAAAAAAAEIEBkkNj///////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8=',
+ 'width' => 40
+ ),
+ 'C' => array(
+ 'data' => 'AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP//////////////////5JRULBAAAAgkTIDQ//////////////////8A////////////////1FAAAAAAAAAAAAAAAABAyP///////////////wD//////////////4gEAAAAAAAAAAAAAAAAAAAElP//////////////AP////////////9wAAAAAAAAAAAAAAAAAAAAAAAAlP////////////8A////////////kAAAAAAAAAAAAAAAAAAAAAAAAAAEyP///////////wD//////////9wIAAAAAAAAAAAAAAAAAAAAAAAAAAAw////////////AP//////////WAAAAAAAAAAAWMz/8JwQAAAAAAAAAACw//////////8A/////////+wEAAAAAAAAAID//////9QMAAAAAAAAAET//////////wD/////////nAAAAAAAAAAo/P///////3wAAAAABDBspP//////////AP////////9gAAAAAAAAAIz/////////3BxQjMT0//////////////8A/////////zQAAAAAAAAAzP///////////////////////////////wD/////////GAAAAAAAAADo////////////////////////////////AP////////8AAAAAAAAAAP////////////////////////////////8A/////////wAAAAAAAAAA/////////////////////////////////wD/////////AAAAAAAAAAD/////////////////////////////////AP////////8cAAAAAAAAAOj///////////////////////////////8A/////////zgAAAAAAAAA0P/////////kIGio7P///////////////wD/////////bAAAAAAAAACg/////////5wAAAAAMHS49P//////////AP////////+oAAAAAAAAAEz/////////PAAAAAAAAAAc//////////8A//////////QIAAAAAAAAALz//////6QAAAAAAAAAAGT//////////wD//////////3AAAAAAAAAADIzo/+SEBAAAAAAAAAAAyP//////////AP//////////7BAAAAAAAAAAAAAAAAAAAAAAAAAAAED///////////8A////////////rAAAAAAAAAAAAAAAAAAAAAAAAAAE0P///////////wD/////////////fAAAAAAAAAAAAAAAAAAAAAAAAJz/////////////AP//////////////iAQAAAAAAAAAAAAAAAAAAASY//////////////8A////////////////yEAAAAAAAAAAAAAAAAA8yP///////////////wD//////////////////9yIUCwQAAAAIEB4yP//////////////////AP////////////////////////////////////////////////////8=',
+ 'width' => 40
+ ),
+ 'D' => array(
+ 'data' => 'AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD///////////8AAAAAAAAAAAAAAAAADChQkOT/////////////////AP///////////wAAAAAAAAAAAAAAAAAAAAAABGjw//////////////8A////////////AAAAAAAAAAAAAAAAAAAAAAAAACDY/////////////wD///////////8AAAAAAAAAAAAAAAAAAAAAAAAAABjk////////////AP///////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAED///////////8A////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAKj//////////wD///////////8AAAAAAAAAAP///+isSAAAAAAAAAAANP//////////AP///////////wAAAAAAAAAA////////hAAAAAAAAAAA2P////////8A////////////AAAAAAAAAAD/////////MAAAAAAAAACQ/////////wD///////////8AAAAAAAAAAP////////+MAAAAAAAAAFj/////////AP///////////wAAAAAAAAAA/////////8gAAAAAAAAAMP////////8A////////////AAAAAAAAAAD/////////5AAAAAAAAAAY/////////wD///////////8AAAAAAAAAAP//////////AAAAAAAAAAD/////////AP///////////wAAAAAAAAAA//////////8AAAAAAAAAAP////////8A////////////AAAAAAAAAAD//////////wAAAAAAAAAA/////////wD///////////8AAAAAAAAAAP/////////wAAAAAAAAABD/////////AP///////////wAAAAAAAAAA/////////9QAAAAAAAAAJP////////8A////////////AAAAAAAAAAD/////////qAAAAAAAAABI/////////wD///////////8AAAAAAAAAAP////////9QAAAAAAAAAHj/////////AP///////////wAAAAAAAAAA////////uAAAAAAAAAAAvP////////8A////////////AAAAAAAAAAD////w0HwEAAAAAAAAACT8/////////wD///////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAoP//////////AP///////////wAAAAAAAAAAAAAAAAAAAAAAAAAAADz8//////////8A////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAY6P///////////wD///////////8AAAAAAAAAAAAAAAAAAAAAAAAAKNz/////////////AP///////////wAAAAAAAAAAAAAAAAAAAAAACHT0//////////////8A////////////AAAAAAAAAAAAAAAAABg4bKj0/////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8=',
+ 'width' => 40
+ ),
+ 'E' => array(
+ 'data' => 'AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP//////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////////////8A//////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////wD//////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////AP//////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////////////8A//////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////wD//////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////AP//////////AAAAAAAAAAD///////////////////////////////8A//////////8AAAAAAAAAAP///////////////////////////////wD//////////wAAAAAAAAAA////////////////////////////////AP//////////AAAAAAAAAAD///////////////////////////////8A//////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAD//////////////wD//////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAP//////////////AP//////////AAAAAAAAAAAAAAAAAAAAAAAAAAAA//////////////8A//////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAD//////////////wD//////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAP//////////////AP//////////AAAAAAAAAAAAAAAAAAAAAAAAAAAA//////////////8A//////////8AAAAAAAAAAP///////////////////////////////wD//////////wAAAAAAAAAA////////////////////////////////AP//////////AAAAAAAAAAD///////////////////////////////8A//////////8AAAAAAAAAAP///////////////////////////////wD//////////wAAAAAAAAAA////////////////////////////////AP//////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////////////8A//////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////wD//////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////AP//////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////////////8A//////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////wD//////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////AP////////////////////////////////////////////////////8=',
+ 'width' => 40
+ ),
+ 'F' => array(
+ 'data' => 'AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////wAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////wD/////////////AAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////AP////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAP////////////8A/////////////wAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////wD/////////////AAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////AP////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAP////////////8A/////////////wAAAAAAAAAA/////////////////////////////wD/////////////AAAAAAAAAAD/////////////////////////////AP////////////8AAAAAAAAAAP////////////////////////////8A/////////////wAAAAAAAAAA/////////////////////////////wD/////////////AAAAAAAAAAAAAAAAAAAAAAAA////////////////AP////////////8AAAAAAAAAAAAAAAAAAAAAAAD///////////////8A/////////////wAAAAAAAAAAAAAAAAAAAAAAAP///////////////wD/////////////AAAAAAAAAAAAAAAAAAAAAAAA////////////////AP////////////8AAAAAAAAAAAAAAAAAAAAAAAD///////////////8A/////////////wAAAAAAAAAAAAAAAAAAAAAAAP///////////////wD/////////////AAAAAAAAAAD/////////////////////////////AP////////////8AAAAAAAAAAP////////////////////////////8A/////////////wAAAAAAAAAA/////////////////////////////wD/////////////AAAAAAAAAAD/////////////////////////////AP////////////8AAAAAAAAAAP////////////////////////////8A/////////////wAAAAAAAAAA/////////////////////////////wD/////////////AAAAAAAAAAD/////////////////////////////AP////////////8AAAAAAAAAAP////////////////////////////8A/////////////wAAAAAAAAAA/////////////////////////////wD/////////////AAAAAAAAAAD/////////////////////////////AP////////////8AAAAAAAAAAP////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8=',
+ 'width' => 40
+ ),
+ 'G' => array(
+ 'data' => 'AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD//////////////////MB8TCgQAAAACCA4YJzs////////////////AP///////////////JQcAAAAAAAAAAAAAAAAAAhw8P////////////8A/////////////9gwAAAAAAAAAAAAAAAAAAAAAAAk2P///////////wD////////////EDAAAAAAAAAAAAAAAAAAAAAAAAAAc7P//////////AP//////////2AwAAAAAAAAAAAAAAAAAAAAAAAAAAABY//////////8A//////////wwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADQ/////////wD/////////kAAAAAAAAAAAEHzQ/P/gmCAAAAAAAAAAAFz/////////AP////////wcAAAAAAAAACjg////////8CwAAAAAAAAgWP////////8A////////vAAAAAAAAAAI2P//////////yBRAcJjI8P///////////wD///////94AAAAAAAAAGD/////////////////////////////////AP///////0AAAAAAAAAAsP////////////////////////////////8A////////IAAAAAAAAADc/////////////////////////////////wD///////8AAAAAAAAAAP///////wAAAAAAAAAAAAAAAAD/////////AP///////wAAAAAAAAAA////////AAAAAAAAAAAAAAAAAP////////8A////////AAAAAAAAAAD///////8AAAAAAAAAAAAAAAAA/////////wD///////8gAAAAAAAAAOD//////wAAAAAAAAAAAAAAAAD/////////AP///////0AAAAAAAAAAtP//////AAAAAAAAAAAAAAAAAP////////8A////////cAAAAAAAAABw//////8AAAAAAAAAAAAAAAAA/////////wD///////+8AAAAAAAAABDs////////////AAAAAAAAAAD/////////AP////////wYAAAAAAAAADz0//////////AAAAAAAAAAAP////////8A/////////5AAAAAAAAAAACCY4P//3KhcCAAAAAAAAAAA/////////wD/////////+CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////////AP//////////xAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIP////////8A////////////rAQAAAAAAAAAAAAAAAAAAAAAAAAAAGTw/////////wD/////////////vBQAAAAAAAAAAAAAAAAAAAAAADjI////////////AP//////////////8HAQAAAAAAAAAAAAAAAAAEiw//////////////8A//////////////////iwcEAgBAAABCA4aKDk/////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8=',
+ 'width' => 40
+ ),
+ 'H' => array(
+ 'data' => 'AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////8AAAAAAAAAAP///////////wAAAAAAAAAA//////////8A/////////wAAAAAAAAAA////////////AAAAAAAAAAD//////////wD/////////AAAAAAAAAAD///////////8AAAAAAAAAAP//////////AP////////8AAAAAAAAAAP///////////wAAAAAAAAAA//////////8A/////////wAAAAAAAAAA////////////AAAAAAAAAAD//////////wD/////////AAAAAAAAAAD///////////8AAAAAAAAAAP//////////AP////////8AAAAAAAAAAP///////////wAAAAAAAAAA//////////8A/////////wAAAAAAAAAA////////////AAAAAAAAAAD//////////wD/////////AAAAAAAAAAD///////////8AAAAAAAAAAP//////////AP////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//////////8A/////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//////////wD/////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP//////////AP////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//////////8A/////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//////////wD/////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP//////////AP////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//////////8A/////////wAAAAAAAAAA////////////AAAAAAAAAAD//////////wD/////////AAAAAAAAAAD///////////8AAAAAAAAAAP//////////AP////////8AAAAAAAAAAP///////////wAAAAAAAAAA//////////8A/////////wAAAAAAAAAA////////////AAAAAAAAAAD//////////wD/////////AAAAAAAAAAD///////////8AAAAAAAAAAP//////////AP////////8AAAAAAAAAAP///////////wAAAAAAAAAA//////////8A/////////wAAAAAAAAAA////////////AAAAAAAAAAD//////////wD/////////AAAAAAAAAAD///////////8AAAAAAAAAAP//////////AP////////8AAAAAAAAAAP///////////wAAAAAAAAAA//////////8A/////////wAAAAAAAAAA////////////AAAAAAAAAAD//////////wD/////////AAAAAAAAAAD///////////8AAAAAAAAAAP//////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8=',
+ 'width' => 40
+ ),
+ 'I' => array(
+ 'data' => 'AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////AAAAAAAAAAAAAAAAAAAAAAAA////////////////AP////////////8AAAAAAAAAAAAAAAAAAAAAAAD///////////////8A/////////////wAAAAAAAAAAAAAAAAAAAAAAAP///////////////wD/////////////AAAAAAAAAAAAAAAAAAAAAAAA////////////////AP////////////8AAAAAAAAAAAAAAAAAAAAAAAD///////////////8A/////////////wAAAAAAAAAAAAAAAAAAAAAAAP///////////////wD/////////////AAAAAAAAAAAAAAAAAAAAAAAA////////////////AP///////////////////wAAAAAAAAAA//////////////////////8A////////////////////AAAAAAAAAAD//////////////////////wD///////////////////8AAAAAAAAAAP//////////////////////AP///////////////////wAAAAAAAAAA//////////////////////8A////////////////////AAAAAAAAAAD//////////////////////wD///////////////////8AAAAAAAAAAP//////////////////////AP///////////////////wAAAAAAAAAA//////////////////////8A////////////////////AAAAAAAAAAD//////////////////////wD///////////////////8AAAAAAAAAAP//////////////////////AP///////////////////wAAAAAAAAAA//////////////////////8A////////////////////AAAAAAAAAAD//////////////////////wD///////////////////8AAAAAAAAAAP//////////////////////AP///////////////////wAAAAAAAAAA//////////////////////8A////////////////////AAAAAAAAAAD//////////////////////wD///////////////////8AAAAAAAAAAP//////////////////////AP////////////8AAAAAAAAAAAAAAAAAAAAAAAD///////////////8A/////////////wAAAAAAAAAAAAAAAAAAAAAAAP///////////////wD/////////////AAAAAAAAAAAAAAAAAAAAAAAA////////////////AP////////////8AAAAAAAAAAAAAAAAAAAAAAAD///////////////8A/////////////wAAAAAAAAAAAAAAAAAAAAAAAP///////////////wD/////////////AAAAAAAAAAAAAAAAAAAAAAAA////////////////AP////////////8AAAAAAAAAAAAAAAAAAAAAAAD///////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8=',
+ 'width' => 40
+ ),
+ 'J' => array(
+ 'data' => 'AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP///////////////////////////wAAAAAAAAAA//////////////8A////////////////////////////AAAAAAAAAAD//////////////wD///////////////////////////8AAAAAAAAAAP//////////////AP///////////////////////////wAAAAAAAAAA//////////////8A////////////////////////////AAAAAAAAAAD//////////////wD///////////////////////////8AAAAAAAAAAP//////////////AP///////////////////////////wAAAAAAAAAA//////////////8A////////////////////////////AAAAAAAAAAD//////////////wD///////////////////////////8AAAAAAAAAAP//////////////AP///////////////////////////wAAAAAAAAAA//////////////8A////////////////////////////AAAAAAAAAAD//////////////wD///////////////////////////8AAAAAAAAAAP//////////////AP///////////////////////////wAAAAAAAAAA//////////////8A////////////////////////////AAAAAAAAAAD//////////////wD///////////////////////////8AAAAAAAAAAP//////////////AP///////////////////////////wAAAAAAAAAA//////////////8A////////////////////////////AAAAAAAAAAj//////////////wD//////////+zMrIxwUDAQ//////wAAAAAAAAAIP//////////////AP//////////DAAAAAAAAADo////2AAAAAAAAAA0//////////////8A//////////8wAAAAAAAAAKj///+YAAAAAAAAAFj//////////////wD//////////2gAAAAAAAAAIND/yBgAAAAAAAAAkP//////////////AP//////////vAAAAAAAAAAAAAAAAAAAAAAAAADc//////////////8A////////////MAAAAAAAAAAAAAAAAAAAAAAAUP///////////////wD////////////EBAAAAAAAAAAAAAAAAAAAABjk////////////////AP////////////+sBAAAAAAAAAAAAAAAAAAY2P////////////////8A///////////////EMAAAAAAAAAAAAAAAVOj//////////////////wD/////////////////vHBAIAAAABg8fNT/////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8=',
+ 'width' => 40
+ ),
+ 'K' => array(
+ 'data' => 'AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD///////8AAAAAAAAAAP//////////wAQAAAAAAAAAAABw////////AP///////wAAAAAAAAAA/////////9AMAAAAAAAAAAAAcP////////8A////////AAAAAAAAAAD////////cGAAAAAAAAAAAAHD//////////wD///////8AAAAAAAAAAP//////6CgAAAAAAAAAAABs////////////AP///////wAAAAAAAAAA//////Q0AAAAAAAAAAAAVPz///////////8A////////AAAAAAAAAAD////8RAAAAAAAAAAAAFT8/////////////wD///////8AAAAAAAAAAP///1gAAAAAAAAAAABU/P//////////////AP///////wAAAAAAAAAA//9wAAAAAAAAAAAASPz///////////////8A////////AAAAAAAAAAD/jAAAAAAAAAAAADz0/////////////////wD///////8AAAAAAAAAAKQAAAAAAAAAAAA89P//////////////////AP///////wAAAAAAAAAABAAAAAAAAAAAFPT///////////////////8A////////AAAAAAAAAAAAAAAAAAAAAAAApP///////////////////wD///////8AAAAAAAAAAAAAAAAAAAAAAAAU8P//////////////////AP///////wAAAAAAAAAAAAAAAAAAAAAAAABk//////////////////8A////////AAAAAAAAAAAAAAAAAAAAAAAAAADE/////////////////wD///////8AAAAAAAAAAAAAAAAoEAAAAAAAACz8////////////////AP///////wAAAAAAAAAAAAAAGNiAAAAAAAAAAIj///////////////8A////////AAAAAAAAAAAAABjY//gYAAAAAAAACOD//////////////wD///////8AAAAAAAAAAAAY2P///5wAAAAAAAAASP//////////////AP///////wAAAAAAAAAAGNj//////CgAAAAAAAAAqP////////////8A////////AAAAAAAAAADI////////sAAAAAAAAAAc8P///////////wD///////8AAAAAAAAAAP//////////QAAAAAAAAABs////////////AP///////wAAAAAAAAAA///////////IAAAAAAAAAATI//////////8A////////AAAAAAAAAAD///////////9YAAAAAAAAADD8/////////wD///////8AAAAAAAAAAP///////////9wEAAAAAAAAAJD/////////AP///////wAAAAAAAAAA/////////////3AAAAAAAAAADOT///////8A////////AAAAAAAAAAD/////////////7BAAAAAAAAAAUP///////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8=',
+ 'width' => 40
+ ),
+ 'L' => array(
+ 'data' => 'AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////8AAAAAAAAAAP////////////////////////////8A/////////////wAAAAAAAAAA/////////////////////////////wD/////////////AAAAAAAAAAD/////////////////////////////AP////////////8AAAAAAAAAAP////////////////////////////8A/////////////wAAAAAAAAAA/////////////////////////////wD/////////////AAAAAAAAAAD/////////////////////////////AP////////////8AAAAAAAAAAP////////////////////////////8A/////////////wAAAAAAAAAA/////////////////////////////wD/////////////AAAAAAAAAAD/////////////////////////////AP////////////8AAAAAAAAAAP////////////////////////////8A/////////////wAAAAAAAAAA/////////////////////////////wD/////////////AAAAAAAAAAD/////////////////////////////AP////////////8AAAAAAAAAAP////////////////////////////8A/////////////wAAAAAAAAAA/////////////////////////////wD/////////////AAAAAAAAAAD/////////////////////////////AP////////////8AAAAAAAAAAP////////////////////////////8A/////////////wAAAAAAAAAA/////////////////////////////wD/////////////AAAAAAAAAAD/////////////////////////////AP////////////8AAAAAAAAAAP////////////////////////////8A/////////////wAAAAAAAAAA/////////////////////////////wD/////////////AAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////AP////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAP////////////8A/////////////wAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////wD/////////////AAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////AP////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAP////////////8A/////////////wAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////wD/////////////AAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8=',
+ 'width' => 40
+ ),
+ 'M' => array(
+ 'data' => 'AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A//////8AAAAAAAAAAAAAAHz//////3wAAAAAAAAAAAAAAP///////wD//////wAAAAAAAAAAAAAATP//////UAAAAAAAAAAAAAAA////////AP//////AAAAAAAAAAAAAAAc//////8cAAAAAAAAAAAAAAD///////8A//////8AAAAAAAAAAAAAAADw////8AAAAAAAAAAAAAAAAP///////wD//////wAAAAAAAAAAAAAAALz////AAAAAAAAAAAAAAAAA////////AP//////AAAAAAAAAAAAAAAAkP///5AAAAAAAAAAAAAAAAD///////8A//////8AAAAAAAAAAAAAAABc////ZAAAAAAAAAAAAAAAAP///////wD//////wAAAAAAAAAoAAAAADD///8wAAAAACQAAAAAAAAA////////AP//////AAAAAAAAAFwAAAAABPz//AgAAAAAXAAAAAAAAAD///////8A//////8AAAAAAAAAkAAAAAAA0P/UAAAAAACQAAAAAAAAAP///////wD//////wAAAAAAAADMAAAAAACg/6gAAAAAAMQAAAAAAAAA////////AP//////AAAAAAAAAPgEAAAAAHD/dAAAAAAE+AAAAAAAAAD///////8A//////8AAAAAAAAA/zQAAAAAQP9IAAAAADD/AAAAAAAAAP///////wD//////wAAAAAAAAD/bAAAAAAQ/xQAAAAAaP8AAAAAAAAA////////AP//////AAAAAAAAAP+gAAAAAADQAAAAAACc/wAAAAAAAAD///////8A//////8AAAAAAAAA/9QAAAAAAGgAAAAAAND/AAAAAAAAAP///////wD//////wAAAAAAAAD//wwAAAAAFAAAAAAM/P8AAAAAAAAA////////AP//////AAAAAAAAAP//RAAAAAAAAAAAADz//wAAAAAAAAD///////8A//////8AAAAAAAAA//94AAAAAAAAAAAAcP//AAAAAAAAAP///////wD//////wAAAAAAAAD//7AAAAAAAAAAAACo//8AAAAAAAAA////////AP//////AAAAAAAAAP//5AAAAAAAAAAAANz//wAAAAAAAAD///////8A//////8AAAAAAAAA////HAAAAAAAAAAQ////AAAAAAAAAP///////wD//////wAAAAAAAAD///9QAAAAAAAAAEz///8AAAAAAAAA////////AP//////AAAAAAAAAP///4gAAAAAAAAAfP///wAAAAAAAAD///////8A//////8AAAAAAAAA////vAAAAAAAAACw////AAAAAAAAAP///////wD//////wAAAAAAAAD////wAAAAAAAAAOz///8AAAAAAAAA////////AP//////AAAAAAAAAP////8sAAAAAAAc/////wAAAAAAAAD///////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8=',
+ 'width' => 40
+ ),
+ 'N' => array(
+ 'data' => 'AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////AAAAAAAAALD/////////////AAAAAAAAAP//////////AP////////8AAAAAAAAAFOj///////////8AAAAAAAAA//////////8A/////////wAAAAAAAAAASP///////////wAAAAAAAAD//////////wD/////////AAAAAAAAAAAAkP//////////AAAAAAAAAP//////////AP////////8AAAAAAAAAAAAI1P////////8AAAAAAAAA//////////8A/////////wAAAAAAAAAAAAAw+P///////wAAAAAAAAD//////////wD/////////AAAAAAAAAAAAAABw////////AAAAAAAAAP//////////AP////////8AAAAAAAAAAAAAAAC8//////8AAAAAAAAA//////////8A/////////wAAAAAAAAAAAAAAABzs/////wAAAAAAAAD//////////wD/////////AAAAAAAAAAAAAAAAAFD/////AAAAAAAAAP//////////AP////////8AAAAAAAAAAAAAAAAAAJz///8AAAAAAAAA//////////8A/////////wAAAAAAAAAUAAAAAAAADNz//wAAAAAAAAD//////////wD/////////AAAAAAAAALQAAAAAAAAANPz/AAAAAAAAAP//////////AP////////8AAAAAAAAA/2wAAAAAAAAAfP8AAAAAAAAA//////////8A/////////wAAAAAAAAD/+CwAAAAAAAAExAAAAAAAAAD//////////wD/////////AAAAAAAAAP//0AQAAAAAAAAgAAAAAAAAAP//////////AP////////8AAAAAAAAA////jAAAAAAAAAAAAAAAAAAA//////////8A/////////wAAAAAAAAD/////RAAAAAAAAAAAAAAAAAD//////////wD/////////AAAAAAAAAP/////kFAAAAAAAAAAAAAAAAP//////////AP////////8AAAAAAAAA//////+sAAAAAAAAAAAAAAAA//////////8A/////////wAAAAAAAAD///////9kAAAAAAAAAAAAAAD//////////wD/////////AAAAAAAAAP////////QkAAAAAAAAAAAAAP//////////AP////////8AAAAAAAAA/////////8wEAAAAAAAAAAAA//////////8A/////////wAAAAAAAAD//////////4QAAAAAAAAAAAD//////////wD/////////AAAAAAAAAP///////////DwAAAAAAAAAAP//////////AP////////8AAAAAAAAA////////////4BAAAAAAAAAA//////////8A/////////wAAAAAAAAD/////////////qAAAAAAAAAD//////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8=',
+ 'width' => 40
+ ),
+ 'O' => array(
+ 'data' => 'AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A///////////////////0qGw4HAAAABw4aKT0/////////////////wD////////////////wcAwAAAAAAAAAAAAAAAho6P//////////////AP//////////////uBQAAAAAAAAAAAAAAAAAAAAMoP////////////8A/////////////6AEAAAAAAAAAAAAAAAAAAAAAAAAkP///////////wD///////////+4BAAAAAAAAAAAAAAAAAAAAAAAAAAAoP//////////AP//////////8BQAAAAAAAAAAAAAAAAAAAAAAAAAAAAM5P////////8A//////////9wAAAAAAAAAAAsrPD/7KQsAAAAAAAAAABg/////////wD/////////+BAAAAAAAAAAUPj///////hQAAAAAAAAAAjs////////AP////////+sAAAAAAAAABDw//////////AYAAAAAAAAAKD///////8A/////////2wAAAAAAAAAdP///////////3wAAAAAAAAAYP///////wD/////////OAAAAAAAAAC4////////////xAAAAAAAAAAw////////AP////////8cAAAAAAAAAOD////////////oAAAAAAAAABT///////8A/////////wAAAAAAAAAA//////////////8AAAAAAAAAAP///////wD/////////AAAAAAAAAAD//////////////wAAAAAAAAAA////////AP////////8AAAAAAAAAAP/////////////8AAAAAAAAAAD///////8A/////////xwAAAAAAAAA5P///////////+AAAAAAAAAAHP///////wD/////////NAAAAAAAAAC8////////////uAAAAAAAAAA4////////AP////////9oAAAAAAAAAHj///////////98AAAAAAAAAGT///////8A/////////6gAAAAAAAAAGPD/////////+BgAAAAAAAAApP///////wD/////////9AwAAAAAAAAAUPz///////xcAAAAAAAAAAjs////////AP//////////cAAAAAAAAAAALKjs//CwOAAAAAAAAAAAYP////////8A///////////wFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAzk/////////wD///////////+4BAAAAAAAAAAAAAAAAAAAAAAAAAAAoP//////////AP////////////+QAAAAAAAAAAAAAAAAAAAAAAAAAJD///////////8A//////////////+sEAAAAAAAAAAAAAAAAAAAAAyg/////////////wD////////////////oZAgAAAAAAAAAAAAAAARg4P//////////////AP//////////////////9KhsOCAAAAAUMFyc7P////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8=',
+ 'width' => 40
+ ),
+ 'P' => array(
+ 'data' => 'AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP///////////wAAAAAAAAAAAAAAAAAACCxguP////////////////8A////////////AAAAAAAAAAAAAAAAAAAAAAAAOOD//////////////wD///////////8AAAAAAAAAAAAAAAAAAAAAAAAAGOD/////////////AP///////////wAAAAAAAAAAAAAAAAAAAAAAAAAARP////////////8A////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAxP///////////wD///////////8AAAAAAAAAAAAAAAAAAAAAAAAAAABo////////////AP///////////wAAAAAAAAAA////6JwMAAAAAAAAADD///////////8A////////////AAAAAAAAAAD//////6AAAAAAAAAADP///////////wD///////////8AAAAAAAAAAP//////9AAAAAAAAAAA////////////AP///////////wAAAAAAAAAA///////0AAAAAAAAAAD///////////8A////////////AAAAAAAAAAD//////5gAAAAAAAAAHP///////////wD///////////8AAAAAAAAAAP///9iICAAAAAAAAABI////////////AP///////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAJD///////////8A////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAI6P///////////wD///////////8AAAAAAAAAAAAAAAAAAAAAAAAAAIT/////////////AP///////////wAAAAAAAAAAAAAAAAAAAAAAAABU/P////////////8A////////////AAAAAAAAAAAAAAAAAAAAAAAIhPz//////////////wD///////////8AAAAAAAAAAAAAAAAABCRMkOz/////////////////AP///////////wAAAAAAAAAA//////////////////////////////8A////////////AAAAAAAAAAD//////////////////////////////wD///////////8AAAAAAAAAAP//////////////////////////////AP///////////wAAAAAAAAAA//////////////////////////////8A////////////AAAAAAAAAAD//////////////////////////////wD///////////8AAAAAAAAAAP//////////////////////////////AP///////////wAAAAAAAAAA//////////////////////////////8A////////////AAAAAAAAAAD//////////////////////////////wD///////////8AAAAAAAAAAP//////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8=',
+ 'width' => 40
+ ),
+ 'Q' => array(
+ 'data' => 'AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////SoaDQcAAAAHDhoqPT///////////////////8A//////////////BwDAAAAAAAAAAAAAAACHDo/////////////////wD///////////+4FAAAAAAAAAAAAAAAAAAAABCo////////////////AP//////////nAQAAAAAAAAAAAAAAAAAAAAAAACQ//////////////8A/////////7gEAAAAAAAAAAAAAAAAAAAAAAAAAACg/////////////wD////////wFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAzo////////////AP///////3AAAAAAAAAAACyo8P/sqCwAAAAAAAAAAGT///////////8A///////4EAAAAAAAAABM+P///////FQAAAAAAAAACPT//////////wD//////7AAAAAAAAAAFPD/////////9BgAAAAAAAAApP//////////AP//////bAAAAAAAAAB4////////////fAAAAAAAAABk//////////8A//////84AAAAAAAAALz///////////+8AAAAAAAAADT//////////wD//////xwAAAAAAAAA6P///////////+QAAAAAAAAAHP//////////AP//////AAAAAAAAAAD//////////////wAAAAAAAAAA//////////8A//////8AAAAAAAAAAP//////////////AAAAAAAAAAD//////////wD//////wAAAAAAAAAA/P////////////8AAAAAAAAAAP//////////AP//////GAAAAAAAAADg////////////4AAAAAAAAAAc//////////8A//////84AAAAAAAAALT////MJHTo//+8AAAAAAAAADT//////////wD//////2wAAAAAAAAAdP///2AAABCg/3wAAAAAAAAAZP//////////AP//////rAAAAAAAAAAY9P/sCAAAAABMGAAAAAAAAACk//////////8A///////4EAAAAAAAAABU/P+0OAAAAAAAAAAAAAAACPT//////////wD///////94AAAAAAAAAAA4sPD/gAAAAAAAAAAAAABk////////////AP////////AcAAAAAAAAAAAAAAAAAAAAAAAAAAAADOT///////////8A/////////7wEAAAAAAAAAAAAAAAAAAAAAAAAAACQ/////////////wD//////////6wEAAAAAAAAAAAAAAAAAAAAAAAAABSs////////////AP///////////7gUAAAAAAAAAAAAAAAAAAAAAAAAAABAwP////////8A//////////////BwDAAAAAAAAAAAAAAABAgAAAAAAAA8/////////wD////////////////0qGg0GAAAABgwXJjkxBgAAAAAALD/////////AP//////////////////////////////////5DQAAAAk/P////////8A////////////////////////////////////+GwAAJD//////////wD//////////////////////////////////////8A49P//////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8=',
+ 'width' => 40
+ ),
+ 'R' => array(
+ 'data' => 'AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////wAAAAAAAAAAAAAAAAAAAAQgOGSk+P///////////////wD/////////AAAAAAAAAAAAAAAAAAAAAAAAAAAcuP//////////////AP////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAEsP////////////8A/////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQ6P///////////wD/////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB8////////////AP////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAADD///////////8A/////////wAAAAAAAAAA///////svDgAAAAAAAAACP///////////wD/////////AAAAAAAAAAD/////////7AAAAAAAAAAA////////////AP////////8AAAAAAAAAAP/////////cAAAAAAAAABD///////////8A/////////wAAAAAAAAAA//////DQoCQAAAAAAAAAQP///////////wD/////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAACU////////////AP////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAIPj///////////8A/////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAzU/////////////wD/////////AAAAAAAAAAAAAAAAAAAAAAAAAAA02P//////////////AP////////8AAAAAAAAAAAAAAAAAAAAAAAxctPz///////////////8A/////////wAAAAAAAAAAAAAAAAAAAAAAAEDY/////////////////wD/////////AAAAAAAAAAD/9LAsAAAAAAAAAAzc////////////////AP////////8AAAAAAAAAAP///+wkAAAAAAAAADD8//////////////8A/////////wAAAAAAAAAA/////8QAAAAAAAAAAJD//////////////wD/////////AAAAAAAAAAD//////1QAAAAAAAAAFPD/////////////AP////////8AAAAAAAAAAP//////3AQAAAAAAAAAgP////////////8A/////////wAAAAAAAAAA////////aAAAAAAAAAAM6P///////////wD/////////AAAAAAAAAAD////////oCAAAAAAAAABs////////////AP////////8AAAAAAAAAAP////////+AAAAAAAAAAATc//////////8A/////////wAAAAAAAAAA//////////AUAAAAAAAAAFj//////////wD/////////AAAAAAAAAAD//////////5AAAAAAAAAAAND/////////AP////////8AAAAAAAAAAP//////////+CQAAAAAAAAAQP////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8=',
+ 'width' => 40
+ ),
+ 'S' => array(
+ 'data' => 'AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP/////////////////8vHBEIAgAAAQgQHC8/P////////////////8A////////////////pCQAAAAAAAAAAAAAAAAcoP///////////////wD//////////////FwAAAAAAAAAAAAAAAAAAAAAXP//////////////AP////////////9oAAAAAAAAAAAAAAAAAAAAAAAAhP////////////8A////////////zAAAAAAAAAAAAAAAAAAAAAAAAAAI6P///////////wD///////////9cAAAAAAAAAAAAAAAAAAAAAAAAAACA////////////AP///////////xgAAAAAAAAAUOD/8KwkAAAAAAAAADj///////////8A////////////AAAAAAAAAAD0/////8wABCAgICxASP///////////wD///////////8MAAAAAAAAAMz/////////////////////////////AP///////////0AAAAAAAAAACFiQxPT///////////////////////8A////////////oAAAAAAAAAAAAAAAADBwtPT//////////////////wD////////////8QAAAAAAAAAAAAAAAAAAACFTA////////////////AP/////////////oOAAAAAAAAAAAAAAAAAAAAABM6P////////////8A///////////////4fAgAAAAAAAAAAAAAAAAAAAAY2P///////////wD/////////////////7IwwAAAAAAAAAAAAAAAAAAAo+P//////////AP/////////////////////koGw0BAAAAAAAAAAAAACU//////////8A///////////////////////////4uFgAAAAAAAAAADz//////////wD//////////2BgSEA0IBwA6P///////5QAAAAAAAAADP//////////AP//////////JAAAAAAAAACc/////////AAAAAAAAAAA//////////8A//////////9YAAAAAAAAACDo///////AAAAAAAAAABT//////////wD//////////6QAAAAAAAAAACCk7P/snBQAAAAAAAAAUP//////////AP//////////+BAAAAAAAAAAAAAAAAAAAAAAAAAAAACs//////////8A////////////kAAAAAAAAAAAAAAAAAAAAAAAAAAAOP///////////wD////////////8RAAAAAAAAAAAAAAAAAAAAAAAABjc////////////AP/////////////0PAAAAAAAAAAAAAAAAAAAAAAg2P////////////8A///////////////8hBQAAAAAAAAAAAAAAAAMdPT//////////////wD/////////////////+LRwSCAMAAAAHDhoqPT/////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8=',
+ 'width' => 40
+ ),
+ 'T' => array(
+ 'data' => 'AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////////AP////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///////////8A/////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///////////wD/////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////////AP////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///////////8A/////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///////////wD///////////////////8AAAAAAAAAAP//////////////////////AP///////////////////wAAAAAAAAAA//////////////////////8A////////////////////AAAAAAAAAAD//////////////////////wD///////////////////8AAAAAAAAAAP//////////////////////AP///////////////////wAAAAAAAAAA//////////////////////8A////////////////////AAAAAAAAAAD//////////////////////wD///////////////////8AAAAAAAAAAP//////////////////////AP///////////////////wAAAAAAAAAA//////////////////////8A////////////////////AAAAAAAAAAD//////////////////////wD///////////////////8AAAAAAAAAAP//////////////////////AP///////////////////wAAAAAAAAAA//////////////////////8A////////////////////AAAAAAAAAAD//////////////////////wD///////////////////8AAAAAAAAAAP//////////////////////AP///////////////////wAAAAAAAAAA//////////////////////8A////////////////////AAAAAAAAAAD//////////////////////wD///////////////////8AAAAAAAAAAP//////////////////////AP///////////////////wAAAAAAAAAA//////////////////////8A////////////////////AAAAAAAAAAD//////////////////////wD///////////////////8AAAAAAAAAAP//////////////////////AP///////////////////wAAAAAAAAAA//////////////////////8A////////////////////AAAAAAAAAAD//////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8=',
+ 'width' => 40
+ ),
+ 'U' => array(
+ 'data' => 'AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////8AAAAAAAAAAP///////////wAAAAAAAAAA//////////8A/////////wAAAAAAAAAA////////////AAAAAAAAAAD//////////wD/////////AAAAAAAAAAD///////////8AAAAAAAAAAP//////////AP////////8AAAAAAAAAAP///////////wAAAAAAAAAA//////////8A/////////wAAAAAAAAAA////////////AAAAAAAAAAD//////////wD/////////AAAAAAAAAAD///////////8AAAAAAAAAAP//////////AP////////8AAAAAAAAAAP///////////wAAAAAAAAAA//////////8A/////////wAAAAAAAAAA////////////AAAAAAAAAAD//////////wD/////////AAAAAAAAAAD///////////8AAAAAAAAAAP//////////AP////////8AAAAAAAAAAP///////////wAAAAAAAAAA//////////8A/////////wAAAAAAAAAA////////////AAAAAAAAAAD//////////wD/////////AAAAAAAAAAD///////////8AAAAAAAAAAP//////////AP////////8AAAAAAAAAAP///////////wAAAAAAAAAA//////////8A/////////wAAAAAAAAAA////////////AAAAAAAAAAD//////////wD/////////AAAAAAAAAAD///////////8AAAAAAAAAAP//////////AP////////8AAAAAAAAAAP///////////wAAAAAAAAAA//////////8A/////////wAAAAAAAAAA////////////AAAAAAAAAAD//////////wD/////////JAAAAAAAAADk/////////+gAAAAAAAAAHP//////////AP////////9MAAAAAAAAAJz/////////nAAAAAAAAABE//////////8A/////////4gAAAAAAAAAHOj//////+ggAAAAAAAAAHz//////////wD/////////0AAAAAAAAAAAIJzs/+ykIAAAAAAAAAAA0P//////////AP//////////QAAAAAAAAAAAAAAAAAAAAAAAAAAAAED///////////8A///////////IBAAAAAAAAAAAAAAAAAAAAAAAAAAE0P///////////wD///////////+YAAAAAAAAAAAAAAAAAAAAAAAAAJj/////////////AP////////////+UBAAAAAAAAAAAAAAAAAAAAASU//////////////8A///////////////IPAAAAAAAAAAAAAAAAAAwyP///////////////wD/////////////////0IxYOCAIAAAEIEiAyP//////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8=',
+ 'width' => 40
+ ),
+ 'V' => array(
+ 'data' => 'AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD//////zAAAAAAAAAAYP//////////////ZAAAAAAAAAAw////////AP//////kAAAAAAAAAAU/P////////////8UAAAAAAAAAJD///////8A///////oBAAAAAAAAADE////////////xAAAAAAAAAAE7P///////wD///////9MAAAAAAAAAHD///////////94AAAAAAAAAEz/////////AP///////6gAAAAAAAAAJP///////////yQAAAAAAAAArP////////8A////////+BAAAAAAAAAA1P/////////YAAAAAAAAABT4/////////wD/////////aAAAAAAAAACE/////////4QAAAAAAAAAbP//////////AP/////////EAAAAAAAAADT/////////OAAAAAAAAADM//////////8A//////////8kAAAAAAAAAOT//////+QAAAAAAAAAKP///////////wD//////////4QAAAAAAAAAmP//////nAAAAAAAAACI////////////AP//////////5AAAAAAAAABE//////9EAAAAAAAABOT///////////8A////////////QAAAAAAAAAT0////9AgAAAAAAABI/////////////wD///////////+gAAAAAAAAAKT///+kAAAAAAAAAKj/////////////AP////////////QIAAAAAAAAXP///1wAAAAAAAAM+P////////////8A/////////////1wAAAAAAAAM+P/8DAAAAAAAAGT//////////////wD/////////////vAAAAAAAAAC8/7wAAAAAAAAAxP//////////////AP//////////////HAAAAAAAAGj/aAAAAAAAACT///////////////8A//////////////94AAAAAAAAHP8cAAAAAAAAhP///////////////wD//////////////9gAAAAAAAAAkAAAAAAAAADk////////////////AP///////////////zgAAAAAAAAQAAAAAAAAQP////////////////8A////////////////lAAAAAAAAAAAAAAAAACg/////////////////wD////////////////sCAAAAAAAAAAAAAAADPT/////////////////AP////////////////9QAAAAAAAAAAAAAABg//////////////////8A/////////////////7AAAAAAAAAAAAAAAMD//////////////////wD//////////////////BQAAAAAAAAAAAAc////////////////////AP//////////////////cAAAAAAAAAAAAHz///////////////////8A///////////////////MAAAAAAAAAAAA3P///////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8=',
+ 'width' => 40
+ ),
+ 'W' => array(
+ 'data' => 'AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A//8cAAAAAAAAALz/////4AAAAAAAAAAA6P////+8AAAAAAAAABz//wD//1QAAAAAAAAAjP////+gAAAAAAAAAACo/////4wAAAAAAAAAUP//AP//jAAAAAAAAABU/////2AAAAAAAAAAAGj/////VAAAAAAAAACM//8A///EAAAAAAAAACT/////IAAAAAAAAAAAKP////8kAAAAAAAAAMT//wD///gEAAAAAAAAAPD//+AAAAAAAAAAAAAA6P//8AAAAAAAAAAE9P//AP///zAAAAAAAAAAvP//oAAAAAAAAAAAAACo//+8AAAAAAAAADD///8A////bAAAAAAAAACM//9gAAAAAAAAAAAAAGT//4wAAAAAAAAAaP///wD///+kAAAAAAAAAFT//yAAAAAAAAAAAAAAIP//VAAAAAAAAACc////AP///9gAAAAAAAAAJP/gAAAAAAAAAAAAAAAA4P8kAAAAAAAAANT///8A/////xAAAAAAAAAA8KAAAAAAAAAAAAAAAACg8AAAAAAAAAAQ/////wD/////TAAAAAAAAAC8YAAAAAAAAAAAAAAAAGC8AAAAAAAAAET/////AP////+AAAAAAAAAAIwgAAAAAAAAAAAAAAAAIIwAAAAAAAAAfP////8A/////7gAAAAAAAAANAAAAAAAACwwAAAAAAAANAAAAAAAAACw/////wD/////8AAAAAAAAAAAAAAAAAAAdHgAAAAAAAAAAAAAAAAAAOz/////AP//////KAAAAAAAAAAAAAAAAAC4vAAAAAAAAAAAAAAAAAAg//////8A//////9gAAAAAAAAAAAAAAAACPj4CAAAAAAAAAAAAAAAAFj//////wD//////5QAAAAAAAAAAAAAAABE//9IAAAAAAAAAAAAAAAAkP//////AP//////0AAAAAAAAAAAAAAAAIj//4wAAAAAAAAAAAAAAADI//////8A///////8DAAAAAAAAAAAAAAAzP//1AAAAAAAAAAAAAAABPj//////wD///////88AAAAAAAAAAAAABT/////GAAAAAAAAAAAAAA0////////AP///////3QAAAAAAAAAAAAAWP////9gAAAAAAAAAAAAAHD///////8A////////sAAAAAAAAAAAAACg/////6QAAAAAAAAAAAAApP///////wD////////kAAAAAAAAAAAAAOT/////6AAAAAAAAAAAAADc////////AP////////8cAAAAAAAAAAAo////////MAAAAAAAAAAAEP////////8A/////////1QAAAAAAAAAAHD///////94AAAAAAAAAABM/////////wD/////////jAAAAAAAAAAAtP///////7wAAAAAAAAAAID/////////AP/////////EAAAAAAAAAAT0////////+AgAAAAAAAAAuP////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8=',
+ 'width' => 40
+ ),
+ 'X' => array(
+ 'data' => 'AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD///////9UAAAAAAAAAKz///////////+sAAAAAAAAAFD/////////AP///////+QQAAAAAAAAFOT/////////8BwAAAAAAAAM5P////////8A/////////5gAAAAAAAAATP////////9kAAAAAAAAAJD//////////wD//////////0AAAAAAAAAAoP//////wAAAAAAAAAA0/P//////////AP//////////2AgAAAAAAAAQ4P////gkAAAAAAAABMz///////////8A////////////iAAAAAAAAABA////dAAAAAAAAABw/////////////wD////////////8MAAAAAAAAACU/9AEAAAAAAAAHPD/////////////AP/////////////IBAAAAAAAAAzYMAAAAAAAAACs//////////////8A//////////////90AAAAAAAAABAAAAAAAAAATP///////////////wD///////////////QgAAAAAAAAAAAAAAAAAAzg////////////////AP///////////////7wAAAAAAAAAAAAAAAAAjP////////////////8A/////////////////2AAAAAAAAAAAAAAADD8/////////////////wD/////////////////7BQAAAAAAAAAAAAEyP//////////////////AP/////////////////gDAAAAAAAAAAAAAjY//////////////////8A/////////////////0AAAAAAAAAAAAAAADj8/////////////////wD///////////////+UAAAAAAAAAAAAAAAAAJD/////////////////AP//////////////4AwAAAAAAAAAAAAAAAAADOD///////////////8A//////////////9AAAAAAAAAAAAAAAAAAAAAQP///////////////wD/////////////nAAAAAAAAAAAWAAAAAAAAAAAlP//////////////AP///////////+QQAAAAAAAAAGD/YAAAAAAAAAAM4P////////////8A////////////TAAAAAAAAAAs9P/0LAAAAAAAAABM/////////////wD//////////6AAAAAAAAAADNT////UDAAAAAAAAACg////////////AP/////////kEAAAAAAAAACg//////+gAAAAAAAAABDk//////////8A/////////0wAAAAAAAAAYP////////9gAAAAAAAAAEz//////////wD///////+oAAAAAAAAACz0//////////QsAAAAAAAAAKT/////////AP//////7BQAAAAAAAAM1P///////////9QMAAAAAAAAFOz///////8A//////9UAAAAAAAAAKD//////////////6AAAAAAAAAAVP///////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8=',
+ 'width' => 40
+ ),
+ 'Y' => array(
+ 'data' => 'AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP///////1QAAAAAAAAAAGj//////////2gAAAAAAAAAAFT///////8A////////5BAAAAAAAAAAAMT////////EAAAAAAAAAAAQ5P///////wD/////////mAAAAAAAAAAAKPj/////+CgAAAAAAAAAAJj/////////AP//////////PAAAAAAAAAAAgP////+AAAAAAAAAAAA8//////////8A///////////YCAAAAAAAAAAE2P//2AQAAAAAAAAACNj//////////wD///////////+AAAAAAAAAAAA4//84AAAAAAAAAACA////////////AP////////////woAAAAAAAAAACUlAAAAAAAAAAAKPz///////////8A/////////////8gAAAAAAAAAABAQAAAAAAAAAADI/////////////wD//////////////2wAAAAAAAAAAAAAAAAAAAAAbP//////////////AP//////////////8BwAAAAAAAAAAAAAAAAAABzw//////////////8A////////////////tAAAAAAAAAAAAAAAAAAAtP///////////////wD/////////////////VAAAAAAAAAAAAAAAAFT/////////////////AP/////////////////oEAAAAAAAAAAAAAAQ6P////////////////8A//////////////////+cAAAAAAAAAAAAAJz//////////////////wD///////////////////9AAAAAAAAAAABA////////////////////AP///////////////////9gAAAAAAAAAANj///////////////////8A/////////////////////wAAAAAAAAAA/////////////////////wD/////////////////////AAAAAAAAAAD/////////////////////AP////////////////////8AAAAAAAAAAP////////////////////8A/////////////////////wAAAAAAAAAA/////////////////////wD/////////////////////AAAAAAAAAAD/////////////////////AP////////////////////8AAAAAAAAAAP////////////////////8A/////////////////////wAAAAAAAAAA/////////////////////wD/////////////////////AAAAAAAAAAD/////////////////////AP////////////////////8AAAAAAAAAAP////////////////////8A/////////////////////wAAAAAAAAAA/////////////////////wD/////////////////////AAAAAAAAAAD/////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8=',
+ 'width' => 40
+ ),
+ 'Z' => array(
+ 'data' => 'AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A//////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAD//////////////wD//////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAP//////////////AP//////////AAAAAAAAAAAAAAAAAAAAAAAAAAAA//////////////8A//////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAD//////////////wD//////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAP//////////////AP//////////AAAAAAAAAAAAAAAAAAAAAAAAAAAQ//////////////8A/////////////////////////1AAAAAAAAAABLz//////////////wD///////////////////////98AAAAAAAAAACY////////////////AP//////////////////////pAAAAAAAAAAAaP////////////////8A/////////////////////8QIAAAAAAAAAET8/////////////////wD////////////////////gGAAAAAAAAAAo9P//////////////////AP//////////////////9CwAAAAAAAAAFNz///////////////////8A//////////////////xMAAAAAAAAAATA/////////////////////wD/////////////////eAAAAAAAAAAAnP//////////////////////AP///////////////5wAAAAAAAAAAHT///////////////////////8A///////////////ABAAAAAAAAABM/P///////////////////////wD/////////////3BQAAAAAAAAALPT/////////////////////////AP////////////QoAAAAAAAAABjg//////////////////////////8A///////////8SAAAAAAAAAAExP///////////////////////////wD//////////2wAAAAAAAAAAKD/////////////////////////////AP////////+YAAAAAAAAAAB8//////////////////////////////8A/////////wQAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////wD/////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////AP////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////////////8A/////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////wD/////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////AP////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8A/////////////////////////////////////////////////////wD/////////////////////////////////////////////////////AP////////////////////////////////////////////////////8=',
+ 'width' => 40
+ ),
+ );
+ }
+}
diff --git a/phpBB/phpbb/captcha/plugins/captcha_abstract.php b/phpBB/phpbb/captcha/plugins/captcha_abstract.php
new file mode 100644
index 0000000000..24ed7f939d
--- /dev/null
+++ b/phpBB/phpbb/captcha/plugins/captcha_abstract.php
@@ -0,0 +1,390 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\captcha\plugins;
+
+/**
+* This class holds the code shared by the two default 3.0.x CAPTCHAs.
+*/
+abstract class captcha_abstract
+{
+ var $confirm_id;
+ var $confirm_code;
+ var $code;
+ var $seed;
+ var $attempts = 0;
+ var $type;
+ var $solved = 0;
+ var $captcha_vars = false;
+
+ /**
+ * @var string name of the service.
+ */
+ protected $service_name;
+
+ function init($type)
+ {
+ global $config, $db, $user;
+
+ // read input
+ $this->confirm_id = request_var('confirm_id', '');
+ $this->confirm_code = request_var('confirm_code', '');
+ $refresh = request_var('refresh_vc', false) && $config['confirm_refresh'];
+
+ $this->type = (int) $type;
+
+ if (!strlen($this->confirm_id) || !$this->load_code())
+ {
+ // we have no confirm ID, better get ready to display something
+ $this->generate_code();
+ }
+ else if ($refresh)
+ {
+ $this->regenerate_code();
+ }
+ }
+
+ function execute_demo()
+ {
+ global $user;
+
+ $this->code = gen_rand_string_friendly(mt_rand(CAPTCHA_MIN_CHARS, CAPTCHA_MAX_CHARS));
+ $this->seed = hexdec(substr(unique_id(), 4, 10));
+
+ // compute $seed % 0x7fffffff
+ $this->seed -= 0x7fffffff * floor($this->seed / 0x7fffffff);
+
+ $generator = $this->get_generator_class();
+ $captcha = new $generator();
+ define('IMAGE_OUTPUT', 1);
+ $captcha->execute($this->code, $this->seed);
+ }
+
+ function execute()
+ {
+ if (empty($this->code))
+ {
+ if (!$this->load_code())
+ {
+ // invalid request, bail out
+ return false;
+ }
+ }
+ $generator = $this->get_generator_class();
+ $captcha = new $generator();
+ define('IMAGE_OUTPUT', 1);
+ $captcha->execute($this->code, $this->seed);
+ }
+
+ function get_template()
+ {
+ global $config, $user, $template, $phpEx, $phpbb_root_path;
+
+ if ($this->is_solved())
+ {
+ return false;
+ }
+ else
+ {
+ $link = append_sid($phpbb_root_path . 'ucp.' . $phpEx, 'mode=confirm&amp;confirm_id=' . $this->confirm_id . '&amp;type=' . $this->type);
+ $contact_link = phpbb_get_board_contact_link($config, $phpbb_root_path, $phpEx);
+ $explain = $user->lang(($this->type != CONFIRM_POST) ? 'CONFIRM_EXPLAIN' : 'POST_CONFIRM_EXPLAIN', '<a href="' . $contact_link . '">', '</a>');
+
+ $template->assign_vars(array(
+ 'CONFIRM_IMAGE_LINK' => $link,
+ 'CONFIRM_IMAGE' => '<img src="' . $link . '" />',
+ 'CONFIRM_IMG' => '<img src="' . $link . '" />',
+ 'CONFIRM_ID' => $this->confirm_id,
+ 'S_CONFIRM_CODE' => true,
+ 'S_TYPE' => $this->type,
+ 'S_CONFIRM_REFRESH' => ($config['enable_confirm'] && $config['confirm_refresh'] && $this->type == CONFIRM_REG) ? true : false,
+ 'L_CONFIRM_EXPLAIN' => $explain,
+ ));
+
+ return 'captcha_default.html';
+ }
+ }
+
+ function get_demo_template($id)
+ {
+ global $config, $user, $template, $phpbb_admin_path, $phpEx;
+
+ $variables = '';
+
+ if (is_array($this->captcha_vars))
+ {
+ foreach ($this->captcha_vars as $captcha_var => $template_var)
+ {
+ $variables .= '&amp;' . rawurlencode($captcha_var) . '=' . request_var($captcha_var, (int) $config[$captcha_var]);
+ }
+ }
+
+ // acp_captcha has a delivery function; let's use it
+ $template->assign_vars(array(
+ 'CONFIRM_IMAGE' => append_sid($phpbb_admin_path . 'index.' . $phpEx, 'captcha_demo=1&amp;mode=visual&amp;i=' . $id . '&amp;select_captcha=' . $this->get_service_name()) . $variables,
+ 'CONFIRM_ID' => $this->confirm_id,
+ ));
+
+ return 'captcha_default_acp_demo.html';
+ }
+
+ function get_hidden_fields()
+ {
+ $hidden_fields = array();
+
+ // this is required for posting.php - otherwise we would forget about the captcha being already solved
+ if ($this->solved)
+ {
+ $hidden_fields['confirm_code'] = $this->confirm_code;
+ }
+ $hidden_fields['confirm_id'] = $this->confirm_id;
+ return $hidden_fields;
+ }
+
+ function garbage_collect($type)
+ {
+ global $db, $config;
+
+ $sql = 'SELECT DISTINCT c.session_id
+ FROM ' . CONFIRM_TABLE . ' c
+ LEFT JOIN ' . SESSIONS_TABLE . ' s ON (c.session_id = s.session_id)
+ WHERE s.session_id IS NULL' .
+ ((empty($type)) ? '' : ' AND c.confirm_type = ' . (int) $type);
+ $result = $db->sql_query($sql);
+
+ if ($row = $db->sql_fetchrow($result))
+ {
+ $sql_in = array();
+ do
+ {
+ $sql_in[] = (string) $row['session_id'];
+ }
+ while ($row = $db->sql_fetchrow($result));
+
+ if (sizeof($sql_in))
+ {
+ $sql = 'DELETE FROM ' . CONFIRM_TABLE . '
+ WHERE ' . $db->sql_in_set('session_id', $sql_in);
+ $db->sql_query($sql);
+ }
+ }
+ $db->sql_freeresult($result);
+ }
+
+ function uninstall()
+ {
+ $this->garbage_collect(0);
+ }
+
+ function install()
+ {
+ return;
+ }
+
+ function validate()
+ {
+ global $config, $db, $user;
+
+ if (empty($user->lang))
+ {
+ $user->setup();
+ }
+
+ $error = '';
+ if (!$this->confirm_id)
+ {
+ $error = $user->lang['CONFIRM_CODE_WRONG'];
+ }
+ else
+ {
+ if ($this->check_code())
+ {
+ $this->solved = true;
+ }
+ else
+ {
+ $error = $user->lang['CONFIRM_CODE_WRONG'];
+ }
+ }
+
+ if (strlen($error))
+ {
+ // okay, incorrect answer. Let's ask a new question.
+ $this->new_attempt();
+ return $error;
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ /**
+ * The old way to generate code, suitable for GD and non-GD. Resets the internal state.
+ */
+ function generate_code()
+ {
+ global $db, $user;
+
+ $this->code = gen_rand_string_friendly(mt_rand(CAPTCHA_MIN_CHARS, CAPTCHA_MAX_CHARS));
+ $this->confirm_id = md5(unique_id($user->ip));
+ $this->seed = hexdec(substr(unique_id(), 4, 10));
+ $this->solved = 0;
+ // compute $seed % 0x7fffffff
+ $this->seed -= 0x7fffffff * floor($this->seed / 0x7fffffff);
+
+ $sql = 'INSERT INTO ' . CONFIRM_TABLE . ' ' . $db->sql_build_array('INSERT', array(
+ 'confirm_id' => (string) $this->confirm_id,
+ 'session_id' => (string) $user->session_id,
+ 'confirm_type' => (int) $this->type,
+ 'code' => (string) $this->code,
+ 'seed' => (int) $this->seed)
+ );
+ $db->sql_query($sql);
+ }
+
+ /**
+ * New Question, if desired.
+ */
+ function regenerate_code()
+ {
+ global $db, $user;
+
+ $this->code = gen_rand_string_friendly(mt_rand(CAPTCHA_MIN_CHARS, CAPTCHA_MAX_CHARS));
+ $this->seed = hexdec(substr(unique_id(), 4, 10));
+ $this->solved = 0;
+ // compute $seed % 0x7fffffff
+ $this->seed -= 0x7fffffff * floor($this->seed / 0x7fffffff);
+
+ $sql = 'UPDATE ' . CONFIRM_TABLE . ' SET ' . $db->sql_build_array('UPDATE', array(
+ 'code' => (string) $this->code,
+ 'seed' => (int) $this->seed)) . '
+ WHERE
+ confirm_id = \'' . $db->sql_escape($this->confirm_id) . '\'
+ AND session_id = \'' . $db->sql_escape($user->session_id) . '\'';
+ $db->sql_query($sql);
+ }
+
+ /**
+ * New Question, if desired.
+ */
+ function new_attempt()
+ {
+ global $db, $user;
+
+ $this->code = gen_rand_string_friendly(mt_rand(CAPTCHA_MIN_CHARS, CAPTCHA_MAX_CHARS));
+ $this->seed = hexdec(substr(unique_id(), 4, 10));
+ $this->solved = 0;
+ // compute $seed % 0x7fffffff
+ $this->seed -= 0x7fffffff * floor($this->seed / 0x7fffffff);
+
+ $sql = 'UPDATE ' . CONFIRM_TABLE . ' SET ' . $db->sql_build_array('UPDATE', array(
+ 'code' => (string) $this->code,
+ 'seed' => (int) $this->seed)) . '
+ , attempts = attempts + 1
+ WHERE
+ confirm_id = \'' . $db->sql_escape($this->confirm_id) . '\'
+ AND session_id = \'' . $db->sql_escape($user->session_id) . '\'';
+ $db->sql_query($sql);
+ }
+
+ /**
+ * Look up everything we need for painting&checking.
+ */
+ function load_code()
+ {
+ global $db, $user;
+
+ $sql = 'SELECT code, seed, attempts
+ FROM ' . CONFIRM_TABLE . "
+ WHERE confirm_id = '" . $db->sql_escape($this->confirm_id) . "'
+ AND session_id = '" . $db->sql_escape($user->session_id) . "'
+ AND confirm_type = " . $this->type;
+ $result = $db->sql_query($sql);
+ $row = $db->sql_fetchrow($result);
+ $db->sql_freeresult($result);
+
+ if ($row)
+ {
+ $this->code = $row['code'];
+ $this->seed = $row['seed'];
+ $this->attempts = $row['attempts'];
+ return true;
+ }
+
+ return false;
+ }
+
+ function check_code()
+ {
+ return (strcasecmp($this->code, $this->confirm_code) === 0);
+ }
+
+ function get_attempt_count()
+ {
+ return $this->attempts;
+ }
+
+ function reset()
+ {
+ global $db, $user;
+
+ $sql = 'DELETE FROM ' . CONFIRM_TABLE . "
+ WHERE session_id = '" . $db->sql_escape($user->session_id) . "'
+ AND confirm_type = " . (int) $this->type;
+ $db->sql_query($sql);
+
+ // we leave the class usable by generating a new question
+ $this->generate_code();
+ }
+
+ function is_solved()
+ {
+ if (request_var('confirm_code', false) && $this->solved === 0)
+ {
+ $this->validate();
+ }
+ return (bool) $this->solved;
+ }
+
+ /**
+ * API function
+ */
+ function has_config()
+ {
+ return false;
+ }
+
+ /**
+ * @return string the name of the service corresponding to the plugin
+ */
+ function get_service_name()
+ {
+ return $this->service_name;
+ }
+
+ /**
+ * Set the name of the plugin
+ *
+ * @param string $name
+ */
+ public function set_name($name)
+ {
+ $this->service_name = $name;
+ }
+
+ /**
+ * @return string the name of the class used to generate the captcha
+ */
+ abstract function get_generator_class();
+}
diff --git a/phpBB/phpbb/captcha/plugins/gd.php b/phpBB/phpbb/captcha/plugins/gd.php
new file mode 100644
index 0000000000..f6200b5b2f
--- /dev/null
+++ b/phpBB/phpbb/captcha/plugins/gd.php
@@ -0,0 +1,130 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\captcha\plugins;
+
+class gd extends captcha_abstract
+{
+ var $captcha_vars = array(
+ 'captcha_gd_x_grid' => 'CAPTCHA_GD_X_GRID',
+ 'captcha_gd_y_grid' => 'CAPTCHA_GD_Y_GRID',
+ 'captcha_gd_foreground_noise' => 'CAPTCHA_GD_FOREGROUND_NOISE',
+// 'captcha_gd' => 'CAPTCHA_GD_PREVIEWED',
+ 'captcha_gd_wave' => 'CAPTCHA_GD_WAVE',
+ 'captcha_gd_3d_noise' => 'CAPTCHA_GD_3D_NOISE',
+ 'captcha_gd_fonts' => 'CAPTCHA_GD_FONTS',
+ );
+
+ public function is_available()
+ {
+ return @extension_loaded('gd');
+ }
+
+ /**
+ * @return string the name of the class used to generate the captcha
+ */
+ function get_generator_class()
+ {
+ return '\\phpbb\\captcha\\gd';
+ }
+
+ /**
+ * API function
+ */
+ function has_config()
+ {
+ return true;
+ }
+
+ public function get_name()
+ {
+ return 'CAPTCHA_GD';
+ }
+
+ function acp_page($id, &$module)
+ {
+ global $db, $user, $auth, $template;
+ global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
+
+ $user->add_lang('acp/board');
+
+ $config_vars = array(
+ 'enable_confirm' => 'REG_ENABLE',
+ 'enable_post_confirm' => 'POST_ENABLE',
+ 'confirm_refresh' => 'CONFIRM_REFRESH',
+ 'captcha_gd' => 'CAPTCHA_GD',
+ );
+
+ $module->tpl_name = 'captcha_gd_acp';
+ $module->page_title = 'ACP_VC_SETTINGS';
+ $form_key = 'acp_captcha';
+ add_form_key($form_key);
+
+ $submit = request_var('submit', '');
+
+ if ($submit && check_form_key($form_key))
+ {
+ $captcha_vars = array_keys($this->captcha_vars);
+ foreach ($captcha_vars as $captcha_var)
+ {
+ $value = request_var($captcha_var, 0);
+ if ($value >= 0)
+ {
+ set_config($captcha_var, $value);
+ }
+ }
+
+ add_log('admin', 'LOG_CONFIG_VISUAL');
+ trigger_error($user->lang['CONFIG_UPDATED'] . adm_back_link($module->u_action));
+ }
+ else if ($submit)
+ {
+ trigger_error($user->lang['FORM_INVALID'] . adm_back_link($module->u_action));
+ }
+ else
+ {
+ foreach ($this->captcha_vars as $captcha_var => $template_var)
+ {
+ $var = (isset($_REQUEST[$captcha_var])) ? request_var($captcha_var, 0) : $config[$captcha_var];
+ $template->assign_var($template_var, $var);
+ }
+
+ $template->assign_vars(array(
+ 'CAPTCHA_PREVIEW' => $this->get_demo_template($id),
+ 'CAPTCHA_NAME' => $this->get_service_name(),
+ 'U_ACTION' => $module->u_action,
+ ));
+ }
+ }
+
+ function execute_demo()
+ {
+ global $config;
+
+ $config_old = $config;
+
+ $config = new \phpbb\config\config(array());
+ foreach ($config_old as $key => $value)
+ {
+ $config->set($key, $value);
+ }
+
+ foreach ($this->captcha_vars as $captcha_var => $template_var)
+ {
+ $config->set($captcha_var, request_var($captcha_var, (int) $config[$captcha_var]));
+ }
+ parent::execute_demo();
+ $config = $config_old;
+ }
+
+}
diff --git a/phpBB/phpbb/captcha/plugins/gd_wave.php b/phpBB/phpbb/captcha/plugins/gd_wave.php
new file mode 100644
index 0000000000..e1d44df778
--- /dev/null
+++ b/phpBB/phpbb/captcha/plugins/gd_wave.php
@@ -0,0 +1,42 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\captcha\plugins;
+
+class gd_wave extends captcha_abstract
+{
+ public function is_available()
+ {
+ return @extension_loaded('gd');
+ }
+
+ public function get_name()
+ {
+ return 'CAPTCHA_GD_3D';
+ }
+
+ /**
+ * @return string the name of the class used to generate the captcha
+ */
+ function get_generator_class()
+ {
+ return '\\phpbb\\captcha\\gd_wave';
+ }
+
+ function acp_page($id, &$module)
+ {
+ global $config, $db, $template, $user;
+
+ trigger_error($user->lang['CAPTCHA_NO_OPTIONS'] . adm_back_link($module->u_action));
+ }
+}
diff --git a/phpBB/phpbb/captcha/plugins/nogd.php b/phpBB/phpbb/captcha/plugins/nogd.php
new file mode 100644
index 0000000000..6845e5935c
--- /dev/null
+++ b/phpBB/phpbb/captcha/plugins/nogd.php
@@ -0,0 +1,42 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\captcha\plugins;
+
+class nogd extends captcha_abstract
+{
+ public function is_available()
+ {
+ return true;
+ }
+
+ public function get_name()
+ {
+ return 'CAPTCHA_NO_GD';
+ }
+
+ /**
+ * @return string the name of the class used to generate the captcha
+ */
+ function get_generator_class()
+ {
+ return '\\phpbb\\captcha\\non_gd';
+ }
+
+ function acp_page($id, &$module)
+ {
+ global $user;
+
+ trigger_error($user->lang['CAPTCHA_NO_OPTIONS'] . adm_back_link($module->u_action));
+ }
+}
diff --git a/phpBB/phpbb/captcha/plugins/qa.php b/phpBB/phpbb/captcha/plugins/qa.php
new file mode 100644
index 0000000000..a9d133d8f2
--- /dev/null
+++ b/phpBB/phpbb/captcha/plugins/qa.php
@@ -0,0 +1,1039 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\captcha\plugins;
+
+/**
+* And now to something completely different. Let's make a captcha without extending the abstract class.
+* QA CAPTCHA sample implementation
+*/
+class qa
+{
+ var $confirm_id;
+ var $answer;
+ var $question_ids;
+ var $question_text;
+ var $question_lang;
+ var $question_strict;
+ var $attempts = 0;
+ var $type;
+ // dirty trick: 0 is false, but can still encode that the captcha is not yet validated
+ var $solved = 0;
+
+ protected $table_captcha_questions;
+ protected $table_captcha_answers;
+ protected $table_qa_confirm;
+
+ /**
+ * @var string name of the service.
+ */
+ protected $service_name;
+
+ /**
+ * Constructor
+ *
+ * @param string $table_captcha_questions
+ * @param string $table_captcha_answers
+ * @param string $table_qa_confirm
+ */
+ function __construct($table_captcha_questions, $table_captcha_answers, $table_qa_confirm)
+ {
+ $this->table_captcha_questions = $table_captcha_questions;
+ $this->table_captcha_answers = $table_captcha_answers;
+ $this->table_qa_confirm = $table_qa_confirm;
+ }
+
+ /**
+ * @param int $type as per the CAPTCHA API docs, the type
+ */
+ function init($type)
+ {
+ global $config, $db, $user;
+
+ // load our language file
+ $user->add_lang('captcha_qa');
+
+ // read input
+ $this->confirm_id = request_var('qa_confirm_id', '');
+ $this->answer = utf8_normalize_nfc(request_var('qa_answer', '', true));
+
+ $this->type = (int) $type;
+ $this->question_lang = $user->lang_name;
+
+ // we need all defined questions - shouldn't be too many, so we can just grab them
+ // try the user's lang first
+ $sql = 'SELECT question_id
+ FROM ' . $this->table_captcha_questions . "
+ WHERE lang_iso = '" . $db->sql_escape($user->lang_name) . "'";
+ $result = $db->sql_query($sql, 3600);
+
+ while ($row = $db->sql_fetchrow($result))
+ {
+ $this->question_ids[$row['question_id']] = $row['question_id'];
+ }
+ $db->sql_freeresult($result);
+
+ // fallback to the board default lang
+ if (!sizeof($this->question_ids))
+ {
+ $this->question_lang = $config['default_lang'];
+
+ $sql = 'SELECT question_id
+ FROM ' . $this->table_captcha_questions . "
+ WHERE lang_iso = '" . $db->sql_escape($config['default_lang']) . "'";
+ $result = $db->sql_query($sql, 7200);
+
+ while ($row = $db->sql_fetchrow($result))
+ {
+ $this->question_ids[$row['question_id']] = $row['question_id'];
+ }
+ $db->sql_freeresult($result);
+ }
+
+ // final fallback to any language
+ if (!sizeof($this->question_ids))
+ {
+ $this->question_lang = '';
+
+ $sql = 'SELECT q.question_id, q.lang_iso
+ FROM ' . $this->table_captcha_questions . ' q, ' . $this->table_captcha_answers . ' a
+ WHERE q.question_id = a.question_id
+ GROUP BY lang_iso';
+ $result = $db->sql_query($sql, 7200);
+
+ while ($row = $db->sql_fetchrow($result))
+ {
+ if (empty($this->question_lang))
+ {
+ $this->question_lang = $row['lang_iso'];
+ }
+ $this->question_ids[$row['question_id']] = $row['question_id'];
+ }
+ $db->sql_freeresult($result);
+ }
+
+ // okay, if there is a confirm_id, we try to load that confirm's state. If not, we try to find one
+ if (!$this->load_answer() && (!$this->load_confirm_id() || !$this->load_answer()))
+ {
+ // we have no valid confirm ID, better get ready to ask something
+ $this->select_question();
+ }
+ }
+
+ /**
+ * See if the captcha has created its tables.
+ */
+ public function is_installed()
+ {
+ global $db;
+
+ $db_tool = new \phpbb\db\tools($db);
+
+ return $db_tool->sql_table_exists($this->table_captcha_questions);
+ }
+
+ /**
+ * API function - for the captcha to be available, it must have installed itself and there has to be at least one question in the board's default lang
+ */
+ public function is_available()
+ {
+ global $config, $db, $user;
+
+ // load language file for pretty display in the ACP dropdown
+ $user->add_lang('captcha_qa');
+
+ if (!$this->is_installed())
+ {
+ return false;
+ }
+
+ $sql = 'SELECT COUNT(question_id) AS question_count
+ FROM ' . $this->table_captcha_questions . "
+ WHERE lang_iso = '" . $db->sql_escape($config['default_lang']) . "'";
+ $result = $db->sql_query($sql);
+ $row = $db->sql_fetchrow($result);
+ $db->sql_freeresult($result);
+
+ return ((bool) $row['question_count']);
+ }
+
+ /**
+ * API function
+ */
+ function has_config()
+ {
+ return true;
+ }
+
+ /**
+ * API function
+ */
+ static public function get_name()
+ {
+ return 'CAPTCHA_QA';
+ }
+
+ /**
+ * @return string the name of the service corresponding to the plugin
+ */
+ function get_service_name()
+ {
+ return $this->service_name;
+ }
+
+ /**
+ * Set the name of the plugin
+ *
+ * @param string $name
+ */
+ public function set_name($name)
+ {
+ $this->service_name = $name;
+ }
+
+ /**
+ * API function - not needed as we don't display an image
+ */
+ function execute_demo()
+ {
+ }
+
+ /**
+ * API function - not needed as we don't display an image
+ */
+ function execute()
+ {
+ }
+
+ /**
+ * API function - send the question to the template
+ */
+ function get_template()
+ {
+ global $phpbb_log, $template, $user;
+
+ if ($this->is_solved())
+ {
+ return false;
+ }
+ else if (empty($this->question_text) || !count($this->question_ids))
+ {
+ /** @var \phpbb\log\log_interface $phpbb_log */
+ $phpbb_log->add('critical', $user->data['user_id'], $user->ip, 'LOG_ERROR_CAPTCHA', time(), array($user->lang('CONFIRM_QUESTION_MISSING')));
+ return false;
+ }
+ else
+ {
+ $template->assign_vars(array(
+ 'QA_CONFIRM_QUESTION' => $this->question_text,
+ 'QA_CONFIRM_ID' => $this->confirm_id,
+ 'S_CONFIRM_CODE' => true,
+ 'S_TYPE' => $this->type,
+ ));
+
+ return 'captcha_qa.html';
+ }
+ }
+
+ /**
+ * API function - we just display a mockup so that the captcha doesn't need to be installed
+ */
+ function get_demo_template()
+ {
+ global $config, $db, $template;
+
+ if ($this->is_available())
+ {
+ $sql = 'SELECT question_text
+ FROM ' . $this->table_captcha_questions . "
+ WHERE lang_iso = '" . $db->sql_escape($config['default_lang']) . "'";
+ $result = $db->sql_query_limit($sql, 1);
+ if ($row = $db->sql_fetchrow($result))
+ {
+ $template->assign_vars(array(
+ 'QA_CONFIRM_QUESTION' => $row['question_text'],
+ ));
+ }
+ $db->sql_freeresult($result);
+ }
+ return 'captcha_qa_acp_demo.html';
+ }
+
+ /**
+ * API function
+ */
+ function get_hidden_fields()
+ {
+ $hidden_fields = array();
+
+ // this is required - otherwise we would forget about the captcha being already solved
+ if ($this->solved)
+ {
+ $hidden_fields['qa_answer'] = $this->answer;
+ }
+ $hidden_fields['qa_confirm_id'] = $this->confirm_id;
+
+ return $hidden_fields;
+ }
+
+ /**
+ * API function
+ */
+ function garbage_collect($type = 0)
+ {
+ global $db;
+
+ $sql = 'SELECT c.confirm_id
+ FROM ' . $this->table_qa_confirm . ' c
+ LEFT JOIN ' . SESSIONS_TABLE . ' s
+ ON (c.session_id = s.session_id)
+ WHERE s.session_id IS NULL' .
+ ((empty($type)) ? '' : ' AND c.confirm_type = ' . (int) $type);
+ $result = $db->sql_query($sql);
+
+ if ($row = $db->sql_fetchrow($result))
+ {
+ $sql_in = array();
+
+ do
+ {
+ $sql_in[] = (string) $row['confirm_id'];
+ }
+ while ($row = $db->sql_fetchrow($result));
+
+ if (sizeof($sql_in))
+ {
+ $sql = 'DELETE FROM ' . $this->table_qa_confirm . '
+ WHERE ' . $db->sql_in_set('confirm_id', $sql_in);
+ $db->sql_query($sql);
+ }
+ }
+ $db->sql_freeresult($result);
+ }
+
+ /**
+ * API function - we don't drop the tables here, as that would cause the loss of all entered questions.
+ */
+ function uninstall()
+ {
+ $this->garbage_collect(0);
+ }
+
+ /**
+ * API function - set up shop
+ */
+ function install()
+ {
+ global $db;
+
+ $db_tool = new \phpbb\db\tools($db);
+
+ $schemas = array(
+ $this->table_captcha_questions => array (
+ 'COLUMNS' => array(
+ 'question_id' => array('UINT', null, 'auto_increment'),
+ 'strict' => array('BOOL', 0),
+ 'lang_id' => array('UINT', 0),
+ 'lang_iso' => array('VCHAR:30', ''),
+ 'question_text' => array('TEXT_UNI', ''),
+ ),
+ 'PRIMARY_KEY' => 'question_id',
+ 'KEYS' => array(
+ 'lang' => array('INDEX', 'lang_iso'),
+ ),
+ ),
+ $this->table_captcha_answers => array (
+ 'COLUMNS' => array(
+ 'question_id' => array('UINT', 0),
+ 'answer_text' => array('STEXT_UNI', ''),
+ ),
+ 'KEYS' => array(
+ 'qid' => array('INDEX', 'question_id'),
+ ),
+ ),
+ $this->table_qa_confirm => array (
+ 'COLUMNS' => array(
+ 'session_id' => array('CHAR:32', ''),
+ 'confirm_id' => array('CHAR:32', ''),
+ 'lang_iso' => array('VCHAR:30', ''),
+ 'question_id' => array('UINT', 0),
+ 'attempts' => array('UINT', 0),
+ 'confirm_type' => array('USINT', 0),
+ ),
+ 'KEYS' => array(
+ 'session_id' => array('INDEX', 'session_id'),
+ 'lookup' => array('INDEX', array('confirm_id', 'session_id', 'lang_iso')),
+ ),
+ 'PRIMARY_KEY' => 'confirm_id',
+ ),
+ );
+
+ foreach ($schemas as $table => $schema)
+ {
+ if (!$db_tool->sql_table_exists($table))
+ {
+ $db_tool->sql_create_table($table, $schema);
+ }
+ }
+ }
+
+ /**
+ * API function - see what has to be done to validate
+ */
+ function validate()
+ {
+ global $phpbb_log, $user;
+
+ $error = '';
+
+ if (!sizeof($this->question_ids))
+ {
+ /** @var \phpbb\log\log_interface $phpbb_log */
+ $phpbb_log->add('critical', $user->data['user_id'], $user->ip, 'LOG_ERROR_CAPTCHA', time(), array($user->lang('CONFIRM_QUESTION_MISSING')));
+ return $user->lang('CONFIRM_QUESTION_MISSING');
+ }
+
+ if (!$this->confirm_id)
+ {
+ $error = $user->lang['CONFIRM_QUESTION_WRONG'];
+ }
+ else
+ {
+ if ($this->check_answer())
+ {
+ $this->solved = true;
+ }
+ else
+ {
+ $error = $user->lang['CONFIRM_QUESTION_WRONG'];
+ }
+ }
+
+ if (strlen($error))
+ {
+ // okay, incorrect answer. Let's ask a new question.
+ $this->new_attempt();
+ $this->solved = false;
+
+ return $error;
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ /**
+ * Select a question
+ */
+ function select_question()
+ {
+ global $db, $user;
+
+ if (!sizeof($this->question_ids))
+ {
+ return;
+ }
+ $this->confirm_id = md5(unique_id($user->ip));
+ $this->question = (int) array_rand($this->question_ids);
+
+ $sql = 'INSERT INTO ' . $this->table_qa_confirm . ' ' . $db->sql_build_array('INSERT', array(
+ 'confirm_id' => (string) $this->confirm_id,
+ 'session_id' => (string) $user->session_id,
+ 'lang_iso' => (string) $this->question_lang,
+ 'confirm_type' => (int) $this->type,
+ 'question_id' => (int) $this->question,
+ ));
+ $db->sql_query($sql);
+
+ $this->load_answer();
+ }
+
+ /**
+ * New Question, if desired.
+ */
+ function reselect_question()
+ {
+ global $db, $user;
+
+ if (!sizeof($this->question_ids))
+ {
+ return;
+ }
+
+ $this->question = (int) array_rand($this->question_ids);
+ $this->solved = 0;
+
+ $sql = 'UPDATE ' . $this->table_qa_confirm . '
+ SET question_id = ' . (int) $this->question . "
+ WHERE confirm_id = '" . $db->sql_escape($this->confirm_id) . "'
+ AND session_id = '" . $db->sql_escape($user->session_id) . "'";
+ $db->sql_query($sql);
+
+ $this->load_answer();
+ }
+
+ /**
+ * Wrong answer, so we increase the attempts and use a different question.
+ */
+ function new_attempt()
+ {
+ global $db, $user;
+
+ // yah, I would prefer a stronger rand, but this should work
+ $this->question = (int) array_rand($this->question_ids);
+ $this->solved = 0;
+
+ $sql = 'UPDATE ' . $this->table_qa_confirm . '
+ SET question_id = ' . (int) $this->question . ",
+ attempts = attempts + 1
+ WHERE confirm_id = '" . $db->sql_escape($this->confirm_id) . "'
+ AND session_id = '" . $db->sql_escape($user->session_id) . "'";
+ $db->sql_query($sql);
+
+ $this->load_answer();
+ }
+
+
+ /**
+ * See if there is already an entry for the current session.
+ */
+ function load_confirm_id()
+ {
+ global $db, $user;
+
+ $sql = 'SELECT confirm_id
+ FROM ' . $this->table_qa_confirm . "
+ WHERE
+ session_id = '" . $db->sql_escape($user->session_id) . "'
+ AND lang_iso = '" . $db->sql_escape($this->question_lang) . "'
+ AND confirm_type = " . $this->type;
+ $result = $db->sql_query_limit($sql, 1);
+ $row = $db->sql_fetchrow($result);
+ $db->sql_freeresult($result);
+
+ if ($row)
+ {
+ $this->confirm_id = $row['confirm_id'];
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Look up everything we need and populate the instance variables.
+ */
+ function load_answer()
+ {
+ global $db, $user;
+
+ if (!strlen($this->confirm_id) || !sizeof($this->question_ids))
+ {
+ return false;
+ }
+
+ $sql = 'SELECT con.question_id, attempts, question_text, strict
+ FROM ' . $this->table_qa_confirm . ' con, ' . $this->table_captcha_questions . " qes
+ WHERE con.question_id = qes.question_id
+ AND confirm_id = '" . $db->sql_escape($this->confirm_id) . "'
+ AND session_id = '" . $db->sql_escape($user->session_id) . "'
+ AND qes.lang_iso = '" . $db->sql_escape($this->question_lang) . "'
+ AND confirm_type = " . $this->type;
+ $result = $db->sql_query($sql);
+ $row = $db->sql_fetchrow($result);
+ $db->sql_freeresult($result);
+
+ if ($row)
+ {
+ $this->question = $row['question_id'];
+
+ $this->attempts = $row['attempts'];
+ $this->question_strict = $row['strict'];
+ $this->question_text = $row['question_text'];
+
+ return true;
+ }
+
+ return false;
+ }
+
+ /**
+ * The actual validation
+ */
+ function check_answer()
+ {
+ global $db;
+
+ $answer = ($this->question_strict) ? utf8_normalize_nfc(request_var('qa_answer', '', true)) : utf8_clean_string(utf8_normalize_nfc(request_var('qa_answer', '', true)));
+
+ $sql = 'SELECT answer_text
+ FROM ' . $this->table_captcha_answers . '
+ WHERE question_id = ' . (int) $this->question;
+ $result = $db->sql_query($sql);
+
+ while ($row = $db->sql_fetchrow($result))
+ {
+ $solution = ($this->question_strict) ? $row['answer_text'] : utf8_clean_string($row['answer_text']);
+
+ if ($solution === $answer)
+ {
+ $this->solved = true;
+
+ break;
+ }
+ }
+ $db->sql_freeresult($result);
+
+ return $this->solved;
+ }
+
+ /**
+ * API function
+ */
+ function get_attempt_count()
+ {
+ return $this->attempts;
+ }
+
+ /**
+ * API function
+ */
+ function reset()
+ {
+ global $db, $user;
+
+ $sql = 'DELETE FROM ' . $this->table_qa_confirm . "
+ WHERE session_id = '" . $db->sql_escape($user->session_id) . "'
+ AND confirm_type = " . (int) $this->type;
+ $db->sql_query($sql);
+
+ // we leave the class usable by generating a new question
+ $this->select_question();
+ }
+
+ /**
+ * API function
+ */
+ function is_solved()
+ {
+ if (request_var('qa_answer', false) && $this->solved === 0)
+ {
+ $this->validate();
+ }
+
+ return (bool) $this->solved;
+ }
+
+ /**
+ * API function - The ACP backend, this marks the end of the easy methods
+ */
+ function acp_page($id, &$module)
+ {
+ global $user, $template;
+ global $config;
+
+ $user->add_lang('acp/board');
+ $user->add_lang('captcha_qa');
+
+ if (!self::is_installed())
+ {
+ $this->install();
+ }
+
+ $module->tpl_name = 'captcha_qa_acp';
+ $module->page_title = 'ACP_VC_SETTINGS';
+ $form_key = 'acp_captcha';
+ add_form_key($form_key);
+
+ $submit = request_var('submit', false);
+ $question_id = request_var('question_id', 0);
+ $action = request_var('action', '');
+
+ // we have two pages, so users might want to navigate from one to the other
+ $list_url = $module->u_action . "&amp;configure=1&amp;select_captcha=" . $this->get_service_name();
+
+ $template->assign_vars(array(
+ 'U_ACTION' => $module->u_action,
+ 'QUESTION_ID' => $question_id ,
+ 'CLASS' => $this->get_service_name(),
+ ));
+
+ // show the list?
+ if (!$question_id && $action != 'add')
+ {
+ $this->acp_question_list($module);
+ }
+ else if ($question_id && $action == 'delete')
+ {
+ if ($this->get_service_name() !== $config['captcha_plugin'] || !$this->acp_is_last($question_id))
+ {
+ if (confirm_box(true))
+ {
+ $this->acp_delete_question($question_id);
+
+ trigger_error($user->lang['QUESTION_DELETED'] . adm_back_link($list_url));
+ }
+ else
+ {
+ confirm_box(false, $user->lang['CONFIRM_OPERATION'], build_hidden_fields(array(
+ 'question_id' => $question_id,
+ 'action' => $action,
+ 'configure' => 1,
+ 'select_captcha' => $this->get_service_name(),
+ ))
+ );
+ }
+ }
+ else
+ {
+ trigger_error($user->lang['QA_LAST_QUESTION'] . adm_back_link($list_url), E_USER_WARNING);
+ }
+ }
+ else
+ {
+ // okay, show the editor
+ $question_input = $this->acp_get_question_input();
+ $langs = $this->get_languages();
+
+ foreach ($langs as $lang => $entry)
+ {
+ $template->assign_block_vars('langs', array(
+ 'ISO' => $lang,
+ 'NAME' => $entry['name'],
+ ));
+ }
+
+ $template->assign_vars(array(
+ 'U_LIST' => $list_url,
+ ));
+
+ if ($question_id)
+ {
+ if ($question = $this->acp_get_question_data($question_id))
+ {
+ $template->assign_vars(array(
+ 'QUESTION_TEXT' => ($question_input['question_text']) ? $question_input['question_text'] : $question['question_text'],
+ 'LANG_ISO' => ($question_input['lang_iso']) ? $question_input['lang_iso'] : $question['lang_iso'],
+ 'STRICT' => (isset($_REQUEST['strict'])) ? $question_input['strict'] : $question['strict'],
+ 'ANSWERS' => implode("\n", $question['answers']),
+ ));
+ }
+ else
+ {
+ trigger_error($user->lang['FORM_INVALID'] . adm_back_link($list_url));
+ }
+ }
+ else
+ {
+ $template->assign_vars(array(
+ 'QUESTION_TEXT' => $question_input['question_text'],
+ 'LANG_ISO' => $question_input['lang_iso'],
+ 'STRICT' => $question_input['strict'],
+ 'ANSWERS' => (is_array($question_input['answers'])) ? implode("\n", $question_input['answers']) : '',
+ ));
+ }
+
+ if ($submit && check_form_key($form_key))
+ {
+ if (!$this->validate_input($question_input))
+ {
+ $template->assign_vars(array(
+ 'S_ERROR' => true,
+ ));
+ }
+ else
+ {
+ if ($question_id)
+ {
+ $this->acp_update_question($question_input, $question_id);
+ }
+ else
+ {
+ $this->acp_add_question($question_input);
+ }
+
+ add_log('admin', 'LOG_CONFIG_VISUAL');
+ trigger_error($user->lang['CONFIG_UPDATED'] . adm_back_link($list_url));
+ }
+ }
+ else if ($submit)
+ {
+ trigger_error($user->lang['FORM_INVALID'] . adm_back_link($list_url), E_USER_WARNING);
+ }
+ }
+ }
+
+ /**
+ * This handles the list overview
+ */
+ function acp_question_list(&$module)
+ {
+ global $db, $template;
+
+ $sql = 'SELECT *
+ FROM ' . $this->table_captcha_questions;
+ $result = $db->sql_query($sql);
+
+ $template->assign_vars(array(
+ 'S_LIST' => true,
+ ));
+
+ while ($row = $db->sql_fetchrow($result))
+ {
+ $url = $module->u_action . "&amp;question_id={$row['question_id']}&amp;configure=1&amp;select_captcha=" . $this->get_service_name() . '&amp;';
+
+ $template->assign_block_vars('questions', array(
+ 'QUESTION_TEXT' => $row['question_text'],
+ 'QUESTION_ID' => $row['question_id'],
+ 'QUESTION_LANG' => $row['lang_iso'],
+ 'U_DELETE' => "{$url}action=delete",
+ 'U_EDIT' => "{$url}action=edit",
+ ));
+ }
+ $db->sql_freeresult($result);
+ }
+
+ /**
+ * Grab a question and bring it into a format the editor understands
+ */
+ function acp_get_question_data($question_id)
+ {
+ global $db;
+
+ if ($question_id)
+ {
+ $sql = 'SELECT *
+ FROM ' . $this->table_captcha_questions . '
+ WHERE question_id = ' . $question_id;
+ $result = $db->sql_query($sql);
+ $question = $db->sql_fetchrow($result);
+ $db->sql_freeresult($result);
+
+ if (!$question)
+ {
+ return false;
+ }
+
+ $question['answers'] = array();
+
+ $sql = 'SELECT *
+ FROM ' . $this->table_captcha_answers . '
+ WHERE question_id = ' . $question_id;
+ $result = $db->sql_query($sql);
+
+ while ($row = $db->sql_fetchrow($result))
+ {
+ $question['answers'][] = $row['answer_text'];
+ }
+ $db->sql_freeresult($result);
+
+ return $question;
+ }
+
+ return false;
+ }
+
+ /**
+ * Grab a question from input and bring it into a format the editor understands
+ */
+ function acp_get_question_input()
+ {
+ $answers = utf8_normalize_nfc(request_var('answers', '', true));
+
+ // Convert answers into array and filter if answers are set
+ if (strlen($answers))
+ {
+ $answers = array_filter(array_map('trim', explode("\n", $answers)), function ($value) {
+ return $value !== '';
+ });
+ }
+
+ $question = array(
+ 'question_text' => request_var('question_text', '', true),
+ 'strict' => request_var('strict', false),
+ 'lang_iso' => request_var('lang_iso', ''),
+ 'answers' => $answers,
+ );
+ return $question;
+ }
+
+ /**
+ * Update a question.
+ * param mixed $data : an array as created from acp_get_question_input or acp_get_question_data
+ */
+ function acp_update_question($data, $question_id)
+ {
+ global $db, $cache;
+
+ // easier to delete all answers than to figure out which to update
+ $sql = 'DELETE FROM ' . $this->table_captcha_answers . " WHERE question_id = $question_id";
+ $db->sql_query($sql);
+
+ $langs = $this->get_languages();
+ $question_ary = $data;
+ $question_ary['lang_id'] = $langs[$question_ary['lang_iso']]['id'];
+ unset($question_ary['answers']);
+
+ $sql = 'UPDATE ' . $this->table_captcha_questions . '
+ SET ' . $db->sql_build_array('UPDATE', $question_ary) . "
+ WHERE question_id = $question_id";
+ $db->sql_query($sql);
+
+ $this->acp_insert_answers($data, $question_id);
+
+ $cache->destroy('sql', $this->table_captcha_questions);
+ }
+
+ /**
+ * Insert a question.
+ * param mixed $data : an array as created from acp_get_question_input or acp_get_question_data
+ */
+ function acp_add_question($data)
+ {
+ global $db, $cache;
+
+ $langs = $this->get_languages();
+ $question_ary = $data;
+
+ $question_ary['lang_id'] = $langs[$data['lang_iso']]['id'];
+ unset($question_ary['answers']);
+
+ $sql = 'INSERT INTO ' . $this->table_captcha_questions . ' ' . $db->sql_build_array('INSERT', $question_ary);
+ $db->sql_query($sql);
+
+ $question_id = $db->sql_nextid();
+
+ $this->acp_insert_answers($data, $question_id);
+
+ $cache->destroy('sql', $this->table_captcha_questions);
+ }
+
+ /**
+ * Insert the answers.
+ * param mixed $data : an array as created from acp_get_question_input or acp_get_question_data
+ */
+ function acp_insert_answers($data, $question_id)
+ {
+ global $db, $cache;
+
+ foreach ($data['answers'] as $answer)
+ {
+ $answer_ary = array(
+ 'question_id' => $question_id,
+ 'answer_text' => $answer,
+ );
+
+ $sql = 'INSERT INTO ' . $this->table_captcha_answers . ' ' . $db->sql_build_array('INSERT', $answer_ary);
+ $db->sql_query($sql);
+ }
+
+ $cache->destroy('sql', $this->table_captcha_answers);
+ }
+
+ /**
+ * Delete a question.
+ */
+ function acp_delete_question($question_id)
+ {
+ global $db, $cache;
+
+ $tables = array($this->table_captcha_questions, $this->table_captcha_answers);
+
+ foreach ($tables as $table)
+ {
+ $sql = "DELETE FROM $table
+ WHERE question_id = $question_id";
+ $db->sql_query($sql);
+ }
+
+ $cache->destroy('sql', $tables);
+ }
+
+ /**
+ * Check if the entered data can be inserted/used
+ * param mixed $data : an array as created from acp_get_question_input or acp_get_question_data
+ */
+ function validate_input($question_data)
+ {
+ $langs = $this->get_languages();
+
+ if (!isset($question_data['lang_iso']) ||
+ !isset($question_data['question_text']) ||
+ !isset($question_data['strict']) ||
+ !isset($question_data['answers']))
+ {
+ return false;
+ }
+
+ if (!isset($langs[$question_data['lang_iso']]) ||
+ !strlen($question_data['question_text']) ||
+ !sizeof($question_data['answers']) ||
+ !is_array($question_data['answers']))
+ {
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * List the installed language packs
+ */
+ function get_languages()
+ {
+ global $db;
+
+ $sql = 'SELECT *
+ FROM ' . LANG_TABLE;
+ $result = $db->sql_query($sql);
+
+ $langs = array();
+ while ($row = $db->sql_fetchrow($result))
+ {
+ $langs[$row['lang_iso']] = array(
+ 'name' => $row['lang_local_name'],
+ 'id' => (int) $row['lang_id'],
+ );
+ }
+ $db->sql_freeresult($result);
+
+ return $langs;
+ }
+
+
+
+ /**
+ * See if there is a question other than the one we have
+ */
+ function acp_is_last($question_id)
+ {
+ global $config, $db;
+
+ if ($question_id)
+ {
+ $sql = 'SELECT question_id
+ FROM ' . $this->table_captcha_questions . "
+ WHERE lang_iso = '" . $db->sql_escape($config['default_lang']) . "'
+ AND question_id <> " . (int) $question_id;
+ $result = $db->sql_query_limit($sql, 1);
+ $question = $db->sql_fetchrow($result);
+ $db->sql_freeresult($result);
+
+ if (!$question)
+ {
+ return true;
+ }
+ return false;
+ }
+ }
+}
diff --git a/phpBB/phpbb/captcha/plugins/recaptcha.php b/phpBB/phpbb/captcha/plugins/recaptcha.php
new file mode 100644
index 0000000000..584f3afec1
--- /dev/null
+++ b/phpBB/phpbb/captcha/plugins/recaptcha.php
@@ -0,0 +1,332 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\captcha\plugins;
+
+class recaptcha extends captcha_abstract
+{
+ var $recaptcha_server = 'http://www.google.com/recaptcha/api';
+ var $recaptcha_server_secure = 'https://www.google.com/recaptcha/api'; // class constants :(
+
+ // We are opening a socket to port 80 of this host and send
+ // the POST request asking for verification to the path specified here.
+ var $recaptcha_verify_server = 'www.google.com';
+ var $recaptcha_verify_path = '/recaptcha/api/verify';
+
+ var $challenge;
+ var $response;
+
+ /**
+ * Constructor
+ */
+ public function __construct()
+ {
+ global $request;
+ $this->recaptcha_server = $request->is_secure() ? $this->recaptcha_server_secure : $this->recaptcha_server;
+ }
+
+ function init($type)
+ {
+ global $config, $db, $user;
+
+ $user->add_lang('captcha_recaptcha');
+ parent::init($type);
+ $this->challenge = request_var('recaptcha_challenge_field', '');
+ $this->response = request_var('recaptcha_response_field', '');
+ }
+
+ public function is_available()
+ {
+ global $config, $user;
+ $user->add_lang('captcha_recaptcha');
+ return (isset($config['recaptcha_pubkey']) && !empty($config['recaptcha_pubkey']));
+ }
+
+ /**
+ * API function
+ */
+ function has_config()
+ {
+ return true;
+ }
+
+ static public function get_name()
+ {
+ return 'CAPTCHA_RECAPTCHA';
+ }
+
+ /**
+ * This function is implemented because required by the upper class, but is never used for reCaptcha.
+ */
+ function get_generator_class()
+ {
+ throw new \Exception('No generator class given.');
+ }
+
+ function acp_page($id, &$module)
+ {
+ global $config, $db, $template, $user;
+
+ $captcha_vars = array(
+ 'recaptcha_pubkey' => 'RECAPTCHA_PUBKEY',
+ 'recaptcha_privkey' => 'RECAPTCHA_PRIVKEY',
+ );
+
+ $module->tpl_name = 'captcha_recaptcha_acp';
+ $module->page_title = 'ACP_VC_SETTINGS';
+ $form_key = 'acp_captcha';
+ add_form_key($form_key);
+
+ $submit = request_var('submit', '');
+
+ if ($submit && check_form_key($form_key))
+ {
+ $captcha_vars = array_keys($captcha_vars);
+ foreach ($captcha_vars as $captcha_var)
+ {
+ $value = request_var($captcha_var, '');
+ if ($value)
+ {
+ set_config($captcha_var, $value);
+ }
+ }
+
+ add_log('admin', 'LOG_CONFIG_VISUAL');
+ trigger_error($user->lang['CONFIG_UPDATED'] . adm_back_link($module->u_action));
+ }
+ else if ($submit)
+ {
+ trigger_error($user->lang['FORM_INVALID'] . adm_back_link($module->u_action));
+ }
+ else
+ {
+ foreach ($captcha_vars as $captcha_var => $template_var)
+ {
+ $var = (isset($_REQUEST[$captcha_var])) ? request_var($captcha_var, '') : ((isset($config[$captcha_var])) ? $config[$captcha_var] : '');
+ $template->assign_var($template_var, $var);
+ }
+
+ $template->assign_vars(array(
+ 'CAPTCHA_PREVIEW' => $this->get_demo_template($id),
+ 'CAPTCHA_NAME' => $this->get_service_name(),
+ 'U_ACTION' => $module->u_action,
+ ));
+
+ }
+ }
+
+ // not needed
+ function execute_demo()
+ {
+ }
+
+ // not needed
+ function execute()
+ {
+ }
+
+ function get_template()
+ {
+ global $config, $user, $template, $phpbb_root_path, $phpEx;
+
+ if ($this->is_solved())
+ {
+ return false;
+ }
+ else
+ {
+ $contact_link = phpbb_get_board_contact_link($config, $phpbb_root_path, $phpEx);
+ $explain = $user->lang(($this->type != CONFIRM_POST) ? 'CONFIRM_EXPLAIN' : 'POST_CONFIRM_EXPLAIN', '<a href="' . $contact_link . '">', '</a>');
+
+ $template->assign_vars(array(
+ 'RECAPTCHA_SERVER' => $this->recaptcha_server,
+ 'RECAPTCHA_PUBKEY' => isset($config['recaptcha_pubkey']) ? $config['recaptcha_pubkey'] : '',
+ 'RECAPTCHA_ERRORGET' => '',
+ 'S_RECAPTCHA_AVAILABLE' => self::is_available(),
+ 'S_CONFIRM_CODE' => true,
+ 'S_TYPE' => $this->type,
+ 'L_CONFIRM_EXPLAIN' => $explain,
+ ));
+
+ return 'captcha_recaptcha.html';
+ }
+ }
+
+ function get_demo_template($id)
+ {
+ return $this->get_template();
+ }
+
+ function get_hidden_fields()
+ {
+ $hidden_fields = array();
+
+ // this is required for posting.php - otherwise we would forget about the captcha being already solved
+ if ($this->solved)
+ {
+ $hidden_fields['confirm_code'] = $this->code;
+ }
+ $hidden_fields['confirm_id'] = $this->confirm_id;
+ return $hidden_fields;
+ }
+
+ function uninstall()
+ {
+ $this->garbage_collect(0);
+ }
+
+ function install()
+ {
+ return;
+ }
+
+ function validate()
+ {
+ if (!parent::validate())
+ {
+ return false;
+ }
+ else
+ {
+ return $this->recaptcha_check_answer();
+ }
+ }
+
+// Code from here on is based on recaptchalib.php
+/*
+ * This is a PHP library that handles calling reCAPTCHA.
+ * - Documentation and latest version
+ * http://recaptcha.net/plugins/php/
+ * - Get a reCAPTCHA API Key
+ * http://recaptcha.net/api/getkey
+ * - Discussion group
+ * http://groups.google.com/group/recaptcha
+ *
+ * Copyright (c) 2007 reCAPTCHA -- http://recaptcha.net
+ * AUTHORS:
+ * Mike Crawford
+ * Ben Maurer
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+ /**
+ * Submits an HTTP POST to a reCAPTCHA server
+ * @param string $host
+ * @param string $path
+ * @param array $data
+ * @param int port
+ * @return array response
+ */
+ function _recaptcha_http_post($host, $path, $data, $port = 80)
+ {
+ $req = $this->_recaptcha_qsencode ($data);
+
+ $http_request = "POST $path HTTP/1.0\r\n";
+ $http_request .= "Host: $host\r\n";
+ $http_request .= "Content-Type: application/x-www-form-urlencoded;\r\n";
+ $http_request .= "Content-Length: " . strlen($req) . "\r\n";
+ $http_request .= "User-Agent: reCAPTCHA/PHP/phpBB\r\n";
+ $http_request .= "\r\n";
+ $http_request .= $req;
+
+ $response = '';
+ if (false == ($fs = @fsockopen($host, $port, $errno, $errstr, 10)))
+ {
+ trigger_error('RECAPTCHA_SOCKET_ERROR', E_USER_ERROR);
+ }
+
+ fwrite($fs, $http_request);
+
+ while (!feof($fs))
+ {
+ // One TCP-IP packet
+ $response .= fgets($fs, 1160);
+ }
+ fclose($fs);
+ $response = explode("\r\n\r\n", $response, 2);
+
+ return $response;
+ }
+
+ /**
+ * Calls an HTTP POST function to verify if the user's guess was correct
+ * @param array $extra_params an array of extra variables to post to the server
+ * @return ReCaptchaResponse
+ */
+ function recaptcha_check_answer($extra_params = array())
+ {
+ global $config, $user;
+
+ //discard spam submissions
+ if ($this->challenge == null || strlen($this->challenge) == 0 || $this->response == null || strlen($this->response) == 0)
+ {
+ return $user->lang['RECAPTCHA_INCORRECT'];
+ }
+
+ $response = $this->_recaptcha_http_post($this->recaptcha_verify_server, $this->recaptcha_verify_path,
+ array(
+ 'privatekey' => $config['recaptcha_privkey'],
+ 'remoteip' => $user->ip,
+ 'challenge' => $this->challenge,
+ 'response' => $this->response
+ ) + $extra_params
+ );
+
+ $answers = explode("\n", $response[1]);
+
+ if (trim($answers[0]) === 'true')
+ {
+ $this->solved = true;
+ return false;
+ }
+ else
+ {
+ return $user->lang['RECAPTCHA_INCORRECT'];
+ }
+ }
+
+ /**
+ * Encodes the given data into a query string format
+ * @param $data - array of string elements to be encoded
+ * @return string - encoded request
+ */
+ function _recaptcha_qsencode($data)
+ {
+ $req = '';
+ foreach ($data as $key => $value)
+ {
+ $req .= $key . '=' . urlencode(stripslashes($value)) . '&';
+ }
+
+ // Cut the last '&'
+ $req = substr($req, 0, strlen($req) - 1);
+ return $req;
+ }
+}
diff --git a/phpBB/phpbb/class_loader.php b/phpBB/phpbb/class_loader.php
new file mode 100644
index 0000000000..cfdcc2af0b
--- /dev/null
+++ b/phpBB/phpbb/class_loader.php
@@ -0,0 +1,164 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb;
+
+/**
+* The class loader resolves class names to file system paths and loads them if
+* necessary.
+*
+* Classes have to be of the form phpbb_(dir_)*(classpart_)*, so directory names
+* must never contain underscores. Example: phpbb_dir_subdir_class_name is a
+* valid class name, while phpbb_dir_sub_dir_class_name is not.
+*
+* If every part of the class name is a directory, the last directory name is
+* also used as the filename, e.g. phpbb_dir would resolve to dir/dir.php.
+*/
+class class_loader
+{
+ private $namespace;
+ private $path;
+ private $php_ext;
+ private $cache;
+
+ /**
+ * A map of looked up class names to paths relative to $this->path.
+ * This map is stored in cache and looked up if the cache is available.
+ *
+ * @var array
+ */
+ private $cached_paths = array();
+
+ /**
+ * Creates a new \phpbb\class_loader, which loads files with the given
+ * file extension from the given path.
+ *
+ * @param string $namespace Required namespace for files to be loaded
+ * @param string $path Directory to load files from
+ * @param string $php_ext The file extension for PHP files
+ * @param \phpbb\cache\driver\driver_interface $cache An implementation of the phpBB cache interface.
+ */
+ public function __construct($namespace, $path, $php_ext = 'php', \phpbb\cache\driver\driver_interface $cache = null)
+ {
+ if ($namespace[0] !== '\\')
+ {
+ $namespace = '\\' . $namespace;
+ }
+
+ $this->namespace = $namespace;
+ $this->path = $path;
+ $this->php_ext = $php_ext;
+
+ $this->set_cache($cache);
+ }
+
+ /**
+ * Provide the class loader with a cache to store paths. If set to null, the
+ * the class loader will resolve paths by checking for the existance of every
+ * directory in the class name every time.
+ *
+ * @param \phpbb\cache\driver\driver_interface $cache An implementation of the phpBB cache interface.
+ */
+ public function set_cache(\phpbb\cache\driver\driver_interface $cache = null)
+ {
+ if ($cache)
+ {
+ $this->cached_paths = $cache->get('class_loader_' . str_replace('\\', '__', $this->namespace));
+
+ if ($this->cached_paths === false)
+ {
+ $this->cached_paths = array();
+ }
+ }
+
+ $this->cache = $cache;
+ }
+
+ /**
+ * Registers the class loader as an autoloader using SPL.
+ */
+ public function register()
+ {
+ spl_autoload_register(array($this, 'load_class'));
+ }
+
+ /**
+ * Removes the class loader from the SPL autoloader stack.
+ */
+ public function unregister()
+ {
+ spl_autoload_unregister(array($this, 'load_class'));
+ }
+
+ /**
+ * Resolves a phpBB class name to a relative path which can be included.
+ *
+ * @param string $class The class name to resolve, must be in the
+ * namespace the loader was constructed with.
+ * Has to begin with \
+ * @return string|bool A relative path to the file containing the
+ * class or false if looking it up failed.
+ */
+ public function resolve_path($class)
+ {
+ if (isset($this->cached_paths[$class]))
+ {
+ return $this->path . $this->cached_paths[$class] . '.' . $this->php_ext;
+ }
+
+ if (!preg_match('/^' . preg_quote($this->namespace, '/') . '[a-zA-Z0-9_\\\\]+$/', $class))
+ {
+ return false;
+ }
+
+ $relative_path = str_replace('\\', '/', substr($class, strlen($this->namespace)));
+
+ if (!file_exists($this->path . $relative_path . '.' . $this->php_ext))
+ {
+ return false;
+ }
+
+ if ($this->cache)
+ {
+ $this->cached_paths[$class] = $relative_path;
+ $this->cache->put('class_loader_' . str_replace('\\', '__', $this->namespace), $this->cached_paths);
+ }
+
+ return $this->path . $relative_path . '.' . $this->php_ext;
+ }
+
+ /**
+ * Resolves a class name to a path and then includes it.
+ *
+ * @param string $class The class name which is being loaded.
+ */
+ public function load_class($class)
+ {
+ // In general $class is not supposed to contain a leading backslash,
+ // but sometimes it does. See tickets PHP-50731 and HHVM-1840.
+ if ($class[0] !== '\\')
+ {
+ $class = '\\' . $class;
+ }
+
+ if (substr($class, 0, strlen($this->namespace)) === $this->namespace)
+ {
+ $path = $this->resolve_path($class);
+
+ if ($path)
+ {
+ require $path;
+ }
+ }
+ }
+}
diff --git a/phpBB/phpbb/composer.json b/phpBB/phpbb/composer.json
new file mode 100644
index 0000000000..6b3888ef64
--- /dev/null
+++ b/phpBB/phpbb/composer.json
@@ -0,0 +1,32 @@
+{
+ "name": "phpbb/phpbb-core",
+ "description": "Collection of core phpBB libraries",
+ "type": "library",
+ "keywords": ["phpbb", "forum"],
+ "homepage": "https://www.phpbb.com",
+ "license": "GPL-2.0",
+ "authors": [
+ {
+ "name": "phpBB Limited",
+ "email": "operations@phpbb.com",
+ "homepage": "https://www.phpbb.com/go/authors"
+ }
+ ],
+ "support": {
+ "issues": "https://tracker.phpbb.com",
+ "forum": "https://www.phpbb.com/community/",
+ "wiki": "https://wiki.phpbb.com",
+ "irc": "irc://irc.freenode.org/phpbb"
+ },
+ "autoload": {
+ "classmap": [""]
+ },
+ "require": {
+ "php": ">=5.3.3"
+ },
+ "extra": {
+ "branch-alias": {
+ "dev-master": "3.1.x-dev"
+ }
+ }
+}
diff --git a/phpBB/phpbb/config/config.php b/phpBB/phpbb/config/config.php
new file mode 100644
index 0000000000..aaad333006
--- /dev/null
+++ b/phpBB/phpbb/config/config.php
@@ -0,0 +1,167 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\config;
+
+/**
+* Configuration container class
+*/
+class config implements \ArrayAccess, \IteratorAggregate, \Countable
+{
+ /**
+ * The configuration data
+ * @var array(string => string)
+ */
+ protected $config;
+
+ /**
+ * Creates a configuration container with a default set of values
+ *
+ * @param array(string => string) $config The configuration data.
+ */
+ public function __construct(array $config)
+ {
+ $this->config = $config;
+ }
+
+ /**
+ * Retrieves an ArrayIterator over the configuration values.
+ *
+ * @return \ArrayIterator An iterator over all config data
+ */
+ public function getIterator()
+ {
+ return new \ArrayIterator($this->config);
+ }
+
+ /**
+ * Checks if the specified config value exists.
+ *
+ * @param string $key The configuration option's name.
+ * @return bool Whether the configuration option exists.
+ */
+ public function offsetExists($key)
+ {
+ return isset($this->config[$key]);
+ }
+
+ /**
+ * Retrieves a configuration value.
+ *
+ * @param string $key The configuration option's name.
+ * @return string The configuration value
+ */
+ public function offsetGet($key)
+ {
+ return (isset($this->config[$key])) ? $this->config[$key] : '';
+ }
+
+ /**
+ * Temporarily overwrites the value of a configuration variable.
+ *
+ * The configuration change will not persist. It will be lost
+ * after the request.
+ *
+ * @param string $key The configuration option's name.
+ * @param string $value The temporary value.
+ */
+ public function offsetSet($key, $value)
+ {
+ $this->config[$key] = $value;
+ }
+
+ /**
+ * Called when deleting a configuration value directly, triggers an error.
+ *
+ * @param string $key The configuration option's name.
+ */
+ public function offsetUnset($key)
+ {
+ trigger_error('Config values have to be deleted explicitly with the \phpbb\config\config::delete($key) method.', E_USER_ERROR);
+ }
+
+ /**
+ * Retrieves the number of configuration options currently set.
+ *
+ * @return int Number of config options
+ */
+ public function count()
+ {
+ return count($this->config);
+ }
+
+ /**
+ * Removes a configuration option
+ *
+ * @param String $key The configuration option's name
+ * @param bool $use_cache Whether this variable should be cached or if it
+ * changes too frequently to be efficiently cached
+ * @return null
+ */
+ public function delete($key, $use_cache = true)
+ {
+ unset($this->config[$key]);
+ }
+
+ /**
+ * Sets a configuration option's value
+ *
+ * @param string $key The configuration option's name
+ * @param string $value New configuration value
+ * @param bool $use_cache Whether this variable should be cached or if it
+ * changes too frequently to be efficiently cached.
+ */
+ public function set($key, $value, $use_cache = true)
+ {
+ $this->config[$key] = $value;
+ }
+
+ /**
+ * Sets a configuration option's value only if the old_value matches the
+ * current configuration value or the configuration value does not exist yet.
+ *
+ * @param string $key The configuration option's name
+ * @param string $old_value Current configuration value
+ * @param string $new_value New configuration value
+ * @param bool $use_cache Whether this variable should be cached or if it
+ * changes too frequently to be efficiently cached.
+ * @return bool True if the value was changed, false otherwise.
+ */
+ public function set_atomic($key, $old_value, $new_value, $use_cache = true)
+ {
+ if (!isset($this->config[$key]) || $this->config[$key] == $old_value)
+ {
+ $this->config[$key] = $new_value;
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Increments an integer configuration value.
+ *
+ * @param string $key The configuration option's name
+ * @param int $increment Amount to increment by
+ * @param bool $use_cache Whether this variable should be cached or if it
+ * changes too frequently to be efficiently cached.
+ */
+ function increment($key, $increment, $use_cache = true)
+ {
+ if (!isset($this->config[$key]))
+ {
+ $this->config[$key] = 0;
+ }
+
+ $this->config[$key] += $increment;
+ }
+}
diff --git a/phpBB/phpbb/config/db.php b/phpBB/phpbb/config/db.php
new file mode 100644
index 0000000000..26489bdd34
--- /dev/null
+++ b/phpBB/phpbb/config/db.php
@@ -0,0 +1,204 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\config;
+
+/**
+* Configuration container class
+*/
+class db extends \phpbb\config\config
+{
+ /**
+ * Cache instance
+ * @var \phpbb\cache\driver\driver_interface
+ */
+ protected $cache;
+
+ /**
+ * Database connection
+ * @var \phpbb\db\driver\driver_interface
+ */
+ protected $db;
+
+ /**
+ * Name of the database table used for configuration.
+ * @var string
+ */
+ protected $table;
+
+ /**
+ * Creates a configuration container with a default set of values
+ *
+ * @param \phpbb\db\driver\driver_interface $db Database connection
+ * @param \phpbb\cache\driver\driver_interface $cache Cache instance
+ * @param string $table Configuration table name
+ */
+ public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\cache\driver\driver_interface $cache, $table)
+ {
+ $this->db = $db;
+ $this->cache = $cache;
+ $this->table = $table;
+
+ if (($config = $cache->get('config')) !== false)
+ {
+ $sql = 'SELECT config_name, config_value
+ FROM ' . $this->table . '
+ WHERE is_dynamic = 1';
+ $result = $this->db->sql_query($sql);
+
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $config[$row['config_name']] = $row['config_value'];
+ }
+ $this->db->sql_freeresult($result);
+ }
+ else
+ {
+ $config = $cached_config = array();
+
+ $sql = 'SELECT config_name, config_value, is_dynamic
+ FROM ' . $this->table;
+ $result = $this->db->sql_query($sql);
+
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ if (!$row['is_dynamic'])
+ {
+ $cached_config[$row['config_name']] = $row['config_value'];
+ }
+
+ $config[$row['config_name']] = $row['config_value'];
+ }
+ $this->db->sql_freeresult($result);
+
+ $cache->put('config', $cached_config);
+ }
+
+ parent::__construct($config);
+ }
+
+ /**
+ * Removes a configuration option
+ *
+ * @param String $key The configuration option's name
+ * @param bool $use_cache Whether this variable should be cached or if it
+ * changes too frequently to be efficiently cached
+ * @return null
+ */
+ public function delete($key, $use_cache = true)
+ {
+ $sql = 'DELETE FROM ' . $this->table . "
+ WHERE config_name = '" . $this->db->sql_escape($key) . "'";
+ $this->db->sql_query($sql);
+
+ unset($this->config[$key]);
+
+ if ($use_cache)
+ {
+ $this->cache->destroy('config');
+ }
+ }
+
+ /**
+ * Sets a configuration option's value
+ *
+ * @param string $key The configuration option's name
+ * @param string $value New configuration value
+ * @param bool $use_cache Whether this variable should be cached or if it
+ * changes too frequently to be efficiently cached.
+ */
+ public function set($key, $value, $use_cache = true)
+ {
+ $this->set_atomic($key, false, $value, $use_cache);
+ }
+
+ /**
+ * Sets a configuration option's value only if the old_value matches the
+ * current configuration value or the configuration value does not exist yet.
+ *
+ * @param string $key The configuration option's name
+ * @param mixed $old_value Current configuration value or false to ignore
+ * the old value
+ * @param string $new_value New configuration value
+ * @param bool $use_cache Whether this variable should be cached or if it
+ * changes too frequently to be efficiently cached
+ * @return bool True if the value was changed, false otherwise
+ */
+ public function set_atomic($key, $old_value, $new_value, $use_cache = true)
+ {
+ $sql = 'UPDATE ' . $this->table . "
+ SET config_value = '" . $this->db->sql_escape($new_value) . "'
+ WHERE config_name = '" . $this->db->sql_escape($key) . "'";
+
+ if ($old_value !== false)
+ {
+ $sql .= " AND config_value = '" . $this->db->sql_escape($old_value) . "'";
+ }
+
+ $this->db->sql_query($sql);
+
+ if (!$this->db->sql_affectedrows() && isset($this->config[$key]))
+ {
+ return false;
+ }
+
+ if (!isset($this->config[$key]))
+ {
+ $sql = 'INSERT INTO ' . $this->table . ' ' . $this->db->sql_build_array('INSERT', array(
+ 'config_name' => $key,
+ 'config_value' => $new_value,
+ 'is_dynamic' => ($use_cache) ? 0 : 1));
+ $this->db->sql_query($sql);
+ }
+
+ if ($use_cache)
+ {
+ $this->cache->destroy('config');
+ }
+
+ $this->config[$key] = $new_value;
+ return true;
+ }
+
+ /**
+ * Increments an integer config value directly in the database.
+ *
+ * Using this method instead of setting the new value directly avoids race
+ * conditions and unlike set_atomic it cannot fail.
+ *
+ * @param string $key The configuration option's name
+ * @param int $increment Amount to increment by
+ * @param bool $use_cache Whether this variable should be cached or if it
+ * changes too frequently to be efficiently cached.
+ */
+ function increment($key, $increment, $use_cache = true)
+ {
+ if (!isset($this->config[$key]))
+ {
+ $this->set($key, '0', $use_cache);
+ }
+
+ $sql_update = $this->db->cast_expr_to_string($this->db->cast_expr_to_bigint('config_value') . ' + ' . (int) $increment);
+
+ $this->db->sql_query('UPDATE ' . $this->table . '
+ SET config_value = ' . $sql_update . "
+ WHERE config_name = '" . $this->db->sql_escape($key) . "'");
+
+ if ($use_cache)
+ {
+ $this->cache->destroy('config');
+ }
+
+ $this->config[$key] += $increment;
+ }
+}
diff --git a/phpBB/phpbb/config/db_text.php b/phpBB/phpbb/config/db_text.php
new file mode 100644
index 0000000000..818f6bdcc9
--- /dev/null
+++ b/phpBB/phpbb/config/db_text.php
@@ -0,0 +1,159 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\config;
+
+/**
+* Manages configuration options with an arbitrary length value stored in a TEXT
+* column. In constrast to class \phpbb\config\db, values are never cached and
+* prefetched, but every get operation sends a query to the database.
+*/
+class db_text
+{
+ /**
+ * Database connection
+ * @var \phpbb\db\driver\driver_interface
+ */
+ protected $db;
+
+ /**
+ * Name of the database table used.
+ * @var string
+ */
+ protected $table;
+
+ /**
+ * @param \phpbb\db\driver\driver_interface $db Database connection
+ * @param string $table Table name
+ */
+ public function __construct(\phpbb\db\driver\driver_interface $db, $table)
+ {
+ $this->db = $db;
+ $this->table = $this->db->sql_escape($table);
+ }
+
+ /**
+ * Sets the configuration option with the name $key to $value.
+ *
+ * @param string $key The configuration option's name
+ * @param string $value New configuration value
+ *
+ * @return null
+ */
+ public function set($key, $value)
+ {
+ $this->set_array(array($key => $value));
+ }
+
+ /**
+ * Gets the configuration value for the name $key.
+ *
+ * @param string $key The configuration option's name
+ *
+ * @return string|null String result on success
+ * null if there is no such option
+ */
+ public function get($key)
+ {
+ $map = $this->get_array(array($key));
+
+ return isset($map[$key]) ? $map[$key] : null;
+ }
+
+ /**
+ * Removes the configuration option with the name $key.
+ *
+ * @param string $key The configuration option's name
+ *
+ * @return null
+ */
+ public function delete($key)
+ {
+ $this->delete_array(array($key));
+ }
+
+ /**
+ * Mass set configuration options: Receives an associative array,
+ * treats array keys as configuration option names and associated
+ * array values as their configuration option values.
+ *
+ * @param array $map Map from configuration names to values
+ *
+ * @return null
+ */
+ public function set_array(array $map)
+ {
+ $this->db->sql_transaction('begin');
+
+ foreach ($map as $key => $value)
+ {
+ $sql = 'UPDATE ' . $this->table . "
+ SET config_value = '" . $this->db->sql_escape($value) . "'
+ WHERE config_name = '" . $this->db->sql_escape($key) . "'";
+ $this->db->sql_query($sql);
+
+ if (!$this->db->sql_affectedrows())
+ {
+ $sql = 'INSERT INTO ' . $this->table . ' ' . $this->db->sql_build_array('INSERT', array(
+ 'config_name' => (string) $key,
+ 'config_value' => (string) $value,
+ ));
+ $this->db->sql_query($sql);
+ }
+ }
+
+ $this->db->sql_transaction('commit');
+ }
+
+ /**
+ * Mass get configuration options: Receives a set of configuration
+ * option names and returns the result as a key => value map where
+ * array keys are configuration option names and array values are
+ * associated config option values.
+ *
+ * @param array $keys Set of configuration option names
+ *
+ * @return array Map from configuration names to values
+ */
+ public function get_array(array $keys)
+ {
+ $sql = 'SELECT *
+ FROM ' . $this->table . '
+ WHERE ' . $this->db->sql_in_set('config_name', $keys, false, true);
+ $result = $this->db->sql_query($sql);
+
+ $map = array();
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $map[$row['config_name']] = $row['config_value'];
+ }
+ $this->db->sql_freeresult($result);
+
+ return $map;
+ }
+
+ /**
+ * Mass delete configuration options.
+ *
+ * @param array $keys Set of configuration option names
+ *
+ * @return null
+ */
+ public function delete_array(array $keys)
+ {
+ $sql = 'DELETE
+ FROM ' . $this->table . '
+ WHERE ' . $this->db->sql_in_set('config_name', $keys, false, true);
+ $this->db->sql_query($sql);
+ }
+}
diff --git a/phpBB/phpbb/config_php_file.php b/phpBB/phpbb/config_php_file.php
new file mode 100644
index 0000000000..7445e7df22
--- /dev/null
+++ b/phpBB/phpbb/config_php_file.php
@@ -0,0 +1,160 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb;
+
+class config_php_file
+{
+ /** @var string phpBB Root Path */
+ protected $phpbb_root_path;
+
+ /** @var string php file extension */
+ protected $php_ext;
+
+ /**
+ * Indicates whether the php config file has been loaded.
+ *
+ * @var bool
+ */
+ protected $config_loaded = false;
+
+ /**
+ * The content of the php config file
+ *
+ * @var array
+ */
+ protected $config_data = array();
+
+ /**
+ * The path to the config file. (Default: $phpbb_root_path . 'config.' . $php_ext)
+ *
+ * @var string
+ */
+ protected $config_file;
+
+ private $defined_vars;
+
+ /**
+ * Constructor
+ *
+ * @param string $phpbb_root_path phpBB Root Path
+ * @param string $php_ext php file extension
+ */
+ function __construct($phpbb_root_path, $php_ext)
+ {
+ $this->phpbb_root_path = $phpbb_root_path;
+ $this->php_ext = $php_ext;
+ $this->config_file = $this->phpbb_root_path . 'config.' . $this->php_ext;
+ }
+
+ /**
+ * Set the path to the config file.
+ *
+ * @param string $config_file
+ */
+ public function set_config_file($config_file)
+ {
+ $this->config_file = $config_file;
+ $this->config_loaded = false;
+ }
+
+ /**
+ * Returns an associative array containing the variables defined by the config file.
+ *
+ * @return array Return the content of the config file or an empty array if the file does not exists.
+ */
+ public function get_all()
+ {
+ $this->load_config_file();
+
+ return $this->config_data;
+ }
+
+ /**
+ * Return the value of a variable defined into the config.php file or null if the variable does not exist.
+ *
+ * @param string $variable The name of the variable
+ * @return mixed Value of the variable or null if the variable is not defined.
+ */
+ public function get($variable)
+ {
+ $this->load_config_file();
+
+ return isset($this->config_data[$variable]) ? $this->config_data[$variable] : null;
+ }
+
+ /**
+ * Load the config file and store the information.
+ *
+ * @return null
+ */
+ protected function load_config_file()
+ {
+ if (!$this->config_loaded && file_exists($this->config_file))
+ {
+ $this->defined_vars = get_defined_vars();
+
+ require($this->config_file);
+ $this->config_data = array_diff_key(get_defined_vars(), $this->defined_vars);
+
+ $this->config_loaded = true;
+ }
+ }
+
+ /**
+ * Convert either 3.0 dbms or 3.1 db driver class name to 3.1 db driver class name.
+ *
+ * If $dbms is a valid 3.1 db driver class name, returns it unchanged.
+ * Otherwise prepends phpbb\db\driver\ to the dbms to convert a 3.0 dbms
+ * to 3.1 db driver class name.
+ *
+ * @param string $dbms dbms parameter
+ * @return string driver class
+ * @throws \RuntimeException
+ */
+ public function convert_30_dbms_to_31($dbms)
+ {
+ // Note: this check is done first because mysqli extension
+ // supplies a mysqli class, and class_exists($dbms) would return
+ // true for mysqli class.
+ // However, per the docblock any valid 3.1 driver name should be
+ // recognized by this function, and have priority over 3.0 dbms.
+ if (strpos($dbms, 'phpbb\db\driver') === false && class_exists('phpbb\db\driver\\' . $dbms))
+ {
+ return 'phpbb\db\driver\\' . $dbms;
+ }
+
+ if (class_exists($dbms))
+ {
+ // Additionally we could check that $dbms extends phpbb\db\driver\driver.
+ // http://php.net/manual/en/class.reflectionclass.php
+ // Beware of possible performance issues:
+ // http://stackoverflow.com/questions/294582/php-5-reflection-api-performance
+ // We could check for interface implementation in all paths or
+ // only when we do not prepend phpbb\db\driver\.
+
+ /*
+ $reflection = new \ReflectionClass($dbms);
+
+ if ($reflection->isSubclassOf('phpbb\db\driver\driver'))
+ {
+ return $dbms;
+ }
+ */
+
+ return $dbms;
+ }
+
+ throw new \RuntimeException("You have specified an invalid dbms driver: $dbms");
+ }
+}
diff --git a/phpBB/phpbb/console/application.php b/phpBB/phpbb/console/application.php
new file mode 100644
index 0000000000..bc4897af18
--- /dev/null
+++ b/phpBB/phpbb/console/application.php
@@ -0,0 +1,120 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\console;
+
+use Symfony\Component\Console\Shell;
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Input\InputOption;
+use Symfony\Component\Console\Output\OutputInterface;
+
+class application extends \Symfony\Component\Console\Application
+{
+ /**
+ * @var bool Indicates whether or not we are in a shell
+ */
+ protected $in_shell = false;
+
+ /**
+ * @var \phpbb\user User object
+ */
+ protected $user;
+
+ /**
+ * @param string $name The name of the application
+ * @param string $version The version of the application
+ * @param \phpbb\user $user The user which runs the application (used for translation)
+ */
+ public function __construct($name, $version, \phpbb\user $user)
+ {
+ $this->user = $user;
+
+ parent::__construct($name, $version);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function getDefaultInputDefinition()
+ {
+ $input_definition = parent::getDefaultInputDefinition();
+
+ $input_definition->addOption(new InputOption(
+ 'safe-mode',
+ null,
+ InputOption::VALUE_NONE,
+ $this->user->lang('CLI_DESCRIPTION_OPTION_SAFE_MODE')
+ ));
+
+ return $input_definition;
+ }
+
+ /**
+ * Gets the help message.
+ *
+ * It's a hack of the default help message to display the --shell
+ * option only for the application and not for all the commands.
+ *
+ * @return string A help message.
+ */
+ public function getHelp()
+ {
+ // If we are already in a shell
+ // we do not want to have the --shell option available
+ if ($this->in_shell)
+ {
+ return parent::getHelp();
+ }
+
+ $this->getDefinition()->addOption(new InputOption(
+ '--shell',
+ '-s',
+ InputOption::VALUE_NONE,
+ $this->user->lang('CLI_DESCRIPTION_OPTION_SHELL')
+ ));
+
+ return parent::getHelp();
+ }
+
+ /**
+ * Register a set of commands from the container
+ *
+ * @param \phpbb\di\service_collection $command_collection The console service collection
+ */
+ public function register_container_commands(\phpbb\di\service_collection $command_collection)
+ {
+ foreach ($command_collection as $service_command)
+ {
+ $this->add($service_command);
+ }
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function doRun(InputInterface $input, OutputInterface $output)
+ {
+ // Run a shell if the --shell (or -s) option is set and if no command name is specified
+ // Also, we do not want to have the --shell option available if we are already in a shell
+ if (!$this->in_shell && $this->getCommandName($input) === null && $input->hasParameterOption(array('--shell', '-s')))
+ {
+ $shell = new Shell($this);
+ $this->in_shell = true;
+ $shell->run();
+
+ return 0;
+ }
+
+ return parent::doRun($input, $output);
+ }
+}
diff --git a/phpBB/phpbb/console/command/cache/purge.php b/phpBB/phpbb/console/command/cache/purge.php
new file mode 100644
index 0000000000..d0c2ef6f72
--- /dev/null
+++ b/phpBB/phpbb/console/command/cache/purge.php
@@ -0,0 +1,89 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+namespace phpbb\console\command\cache;
+
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Output\OutputInterface;
+
+class purge extends \phpbb\console\command\command
+{
+ /** @var \phpbb\cache\driver\driver_interface */
+ protected $cache;
+
+ /** @var \phpbb\db\driver\driver_interface */
+ protected $db;
+
+ /** @var \phpbb\auth\auth */
+ protected $auth;
+
+ /** @var \phpbb\log\log_interface */
+ protected $log;
+
+ /** @var \phpbb\config\config */
+ protected $config;
+
+ /**
+ * Constructor
+ *
+ * @param \phpbb\user $user User instance
+ * @param \phpbb\cache\driver\driver_interface $cache Cache instance
+ * @param \phpbb\db\driver\driver_interface $db Database connection
+ * @param \phpbb\auth\auth $auth Auth instance
+ * @param \phpbb\log\log $log Logger instance
+ * @param \phpbb\config\config $config Config instance
+ */
+ public function __construct(\phpbb\user $user, \phpbb\cache\driver\driver_interface $cache, \phpbb\db\driver\driver_interface $db, \phpbb\auth\auth $auth, \phpbb\log\log_interface $log, \phpbb\config\config $config)
+ {
+ $this->cache = $cache;
+ $this->db = $db;
+ $this->auth = $auth;
+ $this->log = $log;
+ $this->config = $config;
+ parent::__construct($user);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function configure()
+ {
+ $this
+ ->setName('cache:purge')
+ ->setDescription($this->user->lang('PURGE_CACHE'))
+ ;
+ }
+
+ /**
+ * Executes the command cache:purge.
+ *
+ * Purge the cache (including permissions) and increment the asset_version number
+ *
+ * @param InputInterface $input An InputInterface instance
+ * @param OutputInterface $output An OutputInterface instance
+ *
+ * @return null
+ */
+ protected function execute(InputInterface $input, OutputInterface $output)
+ {
+ $this->config->increment('assets_version', 1);
+ $this->cache->purge();
+
+ // Clear permissions
+ $this->auth->acl_clear_prefetch();
+ phpbb_cache_moderators($this->db, $this->cache, $this->auth);
+
+ $this->log->add('admin', ANONYMOUS, '', 'LOG_PURGE_CACHE', time(), array());
+
+ $output->writeln($this->user->lang('PURGE_CACHE_SUCCESS'));
+ }
+}
diff --git a/phpBB/phpbb/console/command/command.php b/phpBB/phpbb/console/command/command.php
new file mode 100644
index 0000000000..638c989da2
--- /dev/null
+++ b/phpBB/phpbb/console/command/command.php
@@ -0,0 +1,31 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\console\command;
+
+abstract class command extends \Symfony\Component\Console\Command\Command
+{
+ /** @var \phpbb\user */
+ protected $user;
+
+ /**
+ * Constructor
+ *
+ * @param \phpbb\user $user User instance (mostly for translation)
+ */
+ public function __construct(\phpbb\user $user)
+ {
+ $this->user = $user;
+ parent::__construct();
+ }
+}
diff --git a/phpBB/phpbb/console/command/config/command.php b/phpBB/phpbb/console/command/config/command.php
new file mode 100644
index 0000000000..f0ad5d4d19
--- /dev/null
+++ b/phpBB/phpbb/console/command/config/command.php
@@ -0,0 +1,26 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+namespace phpbb\console\command\config;
+
+abstract class command extends \phpbb\console\command\command
+{
+ /** @var \phpbb\config\config */
+ protected $config;
+
+ function __construct(\phpbb\user $user, \phpbb\config\config $config)
+ {
+ $this->config = $config;
+
+ parent::__construct($user);
+ }
+}
diff --git a/phpBB/phpbb/console/command/config/delete.php b/phpBB/phpbb/console/command/config/delete.php
new file mode 100644
index 0000000000..efd276d7e3
--- /dev/null
+++ b/phpBB/phpbb/console/command/config/delete.php
@@ -0,0 +1,63 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+namespace phpbb\console\command\config;
+
+use Symfony\Component\Console\Input\InputArgument;
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Output\OutputInterface;
+
+class delete extends command
+{
+ /**
+ * {@inheritdoc}
+ */
+ protected function configure()
+ {
+ $this
+ ->setName('config:delete')
+ ->setDescription($this->user->lang('CLI_DESCRIPTION_DELETE_CONFIG'))
+ ->addArgument(
+ 'key',
+ InputArgument::REQUIRED,
+ $this->user->lang('CLI_CONFIG_OPTION_NAME')
+ )
+ ;
+ }
+
+ /**
+ * Executes the command config:delete.
+ *
+ * Removes a configuration option
+ *
+ * @param InputInterface $input An InputInterface instance
+ * @param OutputInterface $output An OutputInterface instance
+ *
+ * @return null
+ * @see \phpbb\config\config::delete()
+ */
+ protected function execute(InputInterface $input, OutputInterface $output)
+ {
+ $key = $input->getArgument('key');
+
+ if (isset($this->config[$key]))
+ {
+ $this->config->delete($key);
+
+ $output->writeln('<info>' . $this->user->lang('CLI_CONFIG_DELETE_SUCCESS', $key) . '</info>');
+ }
+ else
+ {
+ $output->writeln('<error>' . $this->user->lang('CLI_CONFIG_NOT_EXISTS', $key) . '</error>');
+ }
+ }
+}
diff --git a/phpBB/phpbb/console/command/config/get.php b/phpBB/phpbb/console/command/config/get.php
new file mode 100644
index 0000000000..9c03b49a3d
--- /dev/null
+++ b/phpBB/phpbb/console/command/config/get.php
@@ -0,0 +1,72 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+namespace phpbb\console\command\config;
+
+use Symfony\Component\Console\Input\InputArgument;
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Input\InputOption;
+use Symfony\Component\Console\Output\OutputInterface;
+
+class get extends command
+{
+ /**
+ * {@inheritdoc}
+ */
+ protected function configure()
+ {
+ $this
+ ->setName('config:get')
+ ->setDescription($this->user->lang('CLI_DESCRIPTION_GET_CONFIG'))
+ ->addArgument(
+ 'key',
+ InputArgument::REQUIRED,
+ $this->user->lang('CLI_CONFIG_OPTION_NAME')
+ )
+ ->addOption(
+ 'no-newline',
+ null,
+ InputOption::VALUE_NONE,
+ $this->user->lang('CLI_CONFIG_PRINT_WITHOUT_NEWLINE')
+ )
+ ;
+ }
+
+ /**
+ * Executes the command config:get.
+ *
+ * Retrieves a configuration value.
+ *
+ * @param InputInterface $input An InputInterface instance
+ * @param OutputInterface $output An OutputInterface instance
+ *
+ * @return null
+ * @see \phpbb\config\config::offsetGet()
+ */
+ protected function execute(InputInterface $input, OutputInterface $output)
+ {
+ $key = $input->getArgument('key');
+
+ if (isset($this->config[$key]) && $input->getOption('no-newline'))
+ {
+ $output->write($this->config[$key]);
+ }
+ else if (isset($this->config[$key]))
+ {
+ $output->writeln($this->config[$key]);
+ }
+ else
+ {
+ $output->writeln('<error>' . $this->user->lang('CLI_CONFIG_NOT_EXISTS', $key) . '</error>');
+ }
+ }
+}
diff --git a/phpBB/phpbb/console/command/config/increment.php b/phpBB/phpbb/console/command/config/increment.php
new file mode 100644
index 0000000000..b4d7438b66
--- /dev/null
+++ b/phpBB/phpbb/console/command/config/increment.php
@@ -0,0 +1,70 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+namespace phpbb\console\command\config;
+
+use Symfony\Component\Console\Input\InputArgument;
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Input\InputOption;
+use Symfony\Component\Console\Output\OutputInterface;
+
+class increment extends command
+{
+ /**
+ * {@inheritdoc}
+ */
+ protected function configure()
+ {
+ $this
+ ->setName('config:increment')
+ ->setDescription($this->user->lang('CLI_DESCRIPTION_INCREMENT_CONFIG'))
+ ->addArgument(
+ 'key',
+ InputArgument::REQUIRED,
+ $this->user->lang('CLI_CONFIG_OPTION_NAME')
+ )
+ ->addArgument(
+ 'increment',
+ InputArgument::REQUIRED,
+ $this->user->lang('CLI_CONFIG_INCREMENT_BY')
+ )
+ ->addOption(
+ 'dynamic',
+ 'd',
+ InputOption::VALUE_NONE,
+ $this->user->lang('CLI_CONFIG_CANNOT_CACHED')
+ )
+ ;
+ }
+
+ /**
+ * Executes the command config:increment.
+ *
+ * Increments an integer configuration value.
+ *
+ * @param InputInterface $input An InputInterface instance
+ * @param OutputInterface $output An OutputInterface instance
+ *
+ * @return null
+ * @see \phpbb\config\config::increment()
+ */
+ protected function execute(InputInterface $input, OutputInterface $output)
+ {
+ $key = $input->getArgument('key');
+ $increment = $input->getArgument('increment');
+ $use_cache = !$input->getOption('dynamic');
+
+ $this->config->increment($key, $increment, $use_cache);
+
+ $output->writeln('<info>' . $this->user->lang('CLI_CONFIG_INCREMENT_SUCCESS', $key) . '</info>');
+ }
+}
diff --git a/phpBB/phpbb/console/command/config/set.php b/phpBB/phpbb/console/command/config/set.php
new file mode 100644
index 0000000000..695de31013
--- /dev/null
+++ b/phpBB/phpbb/console/command/config/set.php
@@ -0,0 +1,70 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+namespace phpbb\console\command\config;
+
+use Symfony\Component\Console\Input\InputArgument;
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Input\InputOption;
+use Symfony\Component\Console\Output\OutputInterface;
+
+class set extends command
+{
+ /**
+ * {@inheritdoc}
+ */
+ protected function configure()
+ {
+ $this
+ ->setName('config:set')
+ ->setDescription($this->user->lang('CLI_DESCRIPTION_SET_CONFIG'))
+ ->addArgument(
+ 'key',
+ InputArgument::REQUIRED,
+ $this->user->lang('CLI_CONFIG_OPTION_NAME')
+ )
+ ->addArgument(
+ 'value',
+ InputArgument::REQUIRED,
+ $this->user->lang('CLI_CONFIG_NEW')
+ )
+ ->addOption(
+ 'dynamic',
+ 'd',
+ InputOption::VALUE_NONE,
+ $this->user->lang('CLI_CONFIG_CANNOT_CACHED')
+ )
+ ;
+ }
+
+ /**
+ * Executes the command config:set.
+ *
+ * Sets a configuration option's value.
+ *
+ * @param InputInterface $input An InputInterface instance
+ * @param OutputInterface $output An OutputInterface instance
+ *
+ * @return null
+ * @see \phpbb\config\config::set()
+ */
+ protected function execute(InputInterface $input, OutputInterface $output)
+ {
+ $key = $input->getArgument('key');
+ $value = $input->getArgument('value');
+ $use_cache = !$input->getOption('dynamic');
+
+ $this->config->set($key, $value, $use_cache);
+
+ $output->writeln('<info>' . $this->user->lang('CLI_CONFIG_SET_SUCCESS', $key) . '</info>');
+ }
+}
diff --git a/phpBB/phpbb/console/command/config/set_atomic.php b/phpBB/phpbb/console/command/config/set_atomic.php
new file mode 100644
index 0000000000..e8c69a0885
--- /dev/null
+++ b/phpBB/phpbb/console/command/config/set_atomic.php
@@ -0,0 +1,84 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+namespace phpbb\console\command\config;
+
+use Symfony\Component\Console\Input\InputArgument;
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Input\InputOption;
+use Symfony\Component\Console\Output\OutputInterface;
+
+class set_atomic extends command
+{
+ /**
+ * {@inheritdoc}
+ */
+ protected function configure()
+ {
+ $this
+ ->setName('config:set-atomic')
+ ->setDescription($this->user->lang('CLI_DESCRIPTION_SET_ATOMIC_CONFIG'))
+ ->addArgument(
+ 'key',
+ InputArgument::REQUIRED,
+ $this->user->lang('CLI_CONFIG_OPTION_NAME')
+ )
+ ->addArgument(
+ 'old',
+ InputArgument::REQUIRED,
+ $this->user->lang('CLI_CONFIG_CURRENT')
+ )
+ ->addArgument(
+ 'new',
+ InputArgument::REQUIRED,
+ $this->user->lang('CLI_CONFIG_NEW')
+ )
+ ->addOption(
+ 'dynamic',
+ 'd',
+ InputOption::VALUE_NONE,
+ $this->user->lang('CLI_CONFIG_CANNOT_CACHED')
+ )
+ ;
+ }
+
+ /**
+ * Executes the command config:set-atomic.
+ *
+ * Sets a configuration option's value only if the old_value matches the
+ * current configuration value or the configuration value does not exist yet.
+ *
+ * @param InputInterface $input An InputInterface instance
+ * @param OutputInterface $output An OutputInterface instance
+ *
+ * @return bool True if the value was changed, false otherwise.
+ * @see \phpbb\config\config::set_atomic()
+ */
+ protected function execute(InputInterface $input, OutputInterface $output)
+ {
+ $key = $input->getArgument('key');
+ $old_value = $input->getArgument('old');
+ $new_value = $input->getArgument('new');
+ $use_cache = !$input->getOption('dynamic');
+
+ if ($this->config->set_atomic($key, $old_value, $new_value, $use_cache))
+ {
+ $output->writeln('<info>' . $this->user->lang('CLI_CONFIG_SET_SUCCESS', $key) . '</info>');
+ return 0;
+ }
+ else
+ {
+ $output->writeln('<error>' . $this->user->lang('CLI_CONFIG_SET_FAILURE', $key) . '</error>');
+ return 1;
+ }
+ }
+}
diff --git a/phpBB/phpbb/console/command/cron/cron_list.php b/phpBB/phpbb/console/command/cron/cron_list.php
new file mode 100644
index 0000000000..c515fd9e80
--- /dev/null
+++ b/phpBB/phpbb/console/command/cron/cron_list.php
@@ -0,0 +1,111 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+namespace phpbb\console\command\cron;
+
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Output\OutputInterface;
+
+class cron_list extends \phpbb\console\command\command
+{
+ /** @var \phpbb\cron\manager */
+ protected $cron_manager;
+
+ /**
+ * Constructor
+ *
+ * @param \phpbb\user $user User instance
+ * @param \phpbb\cron\manager $cron_manager Cron manager
+ */
+ public function __construct(\phpbb\user $user, \phpbb\cron\manager $cron_manager)
+ {
+ $this->cron_manager = $cron_manager;
+ parent::__construct($user);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function configure()
+ {
+ $this
+ ->setName('cron:list')
+ ->setDescription($this->user->lang('CLI_DESCRIPTION_CRON_LIST'))
+ ;
+ }
+
+ /**
+ * Executes the command cron:list.
+ *
+ * Prints a list of ready and unready cron jobs.
+ *
+ * @param InputInterface $input An InputInterface instance
+ * @param OutputInterface $output An OutputInterface instance
+ *
+ * @return null
+ */
+ protected function execute(InputInterface $input, OutputInterface $output)
+ {
+ $tasks = $this->cron_manager->get_tasks();
+
+ if (empty($tasks))
+ {
+ $output->writeln($this->user->lang('CRON_NO_TASKS'));
+ return;
+ }
+
+ $ready_tasks = array();
+ $not_ready_tasks = array();
+ foreach ($tasks as $task)
+ {
+ if ($task->is_ready())
+ {
+ $ready_tasks[] = $task;
+ }
+ else
+ {
+ $not_ready_tasks[] = $task;
+ }
+ }
+
+ if (!empty($ready_tasks))
+ {
+ $output->writeln('<info>' . $this->user->lang('TASKS_READY') . '</info>');
+ $this->print_tasks_names($ready_tasks, $output);
+ }
+
+ if (!empty($ready_tasks) && !empty($not_ready_tasks))
+ {
+ $output->writeln('');
+ }
+
+ if (!empty($not_ready_tasks))
+ {
+ $output->writeln('<info>' . $this->user->lang('TASKS_NOT_READY') . '</info>');
+ $this->print_tasks_names($not_ready_tasks, $output);
+ }
+ }
+
+ /**
+ * Print a list of cron jobs
+ *
+ * @param array $tasks A list of task to display
+ * @param OutputInterface $output An OutputInterface instance
+ */
+ protected function print_tasks_names(array $tasks, OutputInterface $output)
+ {
+ foreach ($tasks as $task)
+ {
+ $output->writeln($task->get_name());
+ }
+ }
+}
diff --git a/phpBB/phpbb/console/command/cron/run.php b/phpBB/phpbb/console/command/cron/run.php
new file mode 100644
index 0000000000..a9648fcd41
--- /dev/null
+++ b/phpBB/phpbb/console/command/cron/run.php
@@ -0,0 +1,172 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\console\command\cron;
+
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Input\InputArgument;
+use Symfony\Component\Console\Output\OutputInterface;
+
+class run extends \phpbb\console\command\command
+{
+ /** @var \phpbb\cron\manager */
+ protected $cron_manager;
+
+ /** @var \phpbb\lock\db */
+ protected $lock_db;
+
+ /**
+ * Construct method
+ *
+ * @param \phpbb\user $user The user object (used to get language information)
+ * @param \phpbb\cron\manager $cron_manager The cron manager containing
+ * the cron tasks to be executed.
+ * @param \phpbb\lock\db $lock_db The lock for accessing database.
+ */
+ public function __construct(\phpbb\user $user, \phpbb\cron\manager $cron_manager, \phpbb\lock\db $lock_db)
+ {
+ $this->cron_manager = $cron_manager;
+ $this->lock_db = $lock_db;
+ parent::__construct($user);
+ }
+
+ /**
+ * Sets the command name and description
+ *
+ * @return null
+ */
+ protected function configure()
+ {
+ $this
+ ->setName('cron:run')
+ ->setDescription($this->user->lang('CLI_DESCRIPTION_CRON_RUN'))
+ ->setHelp($this->user->lang('CLI_HELP_CRON_RUN'))
+ ->addArgument('name', InputArgument::OPTIONAL, $this->user->lang('CLI_DESCRIPTION_CRON_RUN_ARGUMENT_1'))
+ ;
+ }
+
+ /**
+ * Executes the command cron:run.
+ *
+ * Tries to acquire the cron lock, then if no argument has been given runs all ready cron tasks.
+ * If the cron lock can not be obtained, an error message is printed
+ * and the exit status is set to 1.
+ * If the verbose option is specified, each start of a task is printed.
+ * Otherwise there is no output.
+ * If an argument is given to the command, only the task whose name matches the
+ * argument will be started. If verbose option is specified,
+ * an info message containing the name of the task is printed.
+ * If no task matches the argument given, an error message is printed
+ * and the exit status is set to 2.
+ *
+ * @param InputInterface $input The input stream used to get the argument and verboe option.
+ * @param OutputInterface $output The output stream, used for printing verbose-mode and error information.
+ *
+ * @return int 0 if all is ok, 1 if a lock error occured and 2 if no task matching the argument was found.
+ */
+ protected function execute(InputInterface $input, OutputInterface $output)
+ {
+ if ($this->lock_db->acquire())
+ {
+ $task_name = $input->getArgument('name');
+ if ($task_name)
+ {
+ $exit_status = $this->run_one($input, $output, $task_name);
+ }
+ else
+ {
+ $exit_status = $this->run_all($input, $output);
+ }
+
+ $this->lock_db->release();
+ return $exit_status;
+ }
+ else
+ {
+ $output->writeln('<error>' . $this->user->lang('CRON_LOCK_ERROR') . '</error>');
+ return 1;
+ }
+ }
+
+ /**
+ * Executes all ready cron tasks.
+ *
+ * If verbose mode is set, an info message will be printed if there is no task to
+ * be run, or else for each starting task.
+ *
+ * @see execute
+ * @param InputInterface $input The input stream used to get the argument and verbose option.
+ * @param OutputInterface $output The output stream, used for printing verbose-mode and error information.
+ * @return int 0
+ */
+ protected function run_all(InputInterface $input, OutputInterface $output)
+ {
+ $run_tasks = $this->cron_manager->find_all_ready_tasks();
+
+ if ($run_tasks)
+ {
+ foreach ($run_tasks as $task)
+ {
+ if ($input->getOption('verbose'))
+ {
+ $output->writeln('<info>' . $this->user->lang('RUNNING_TASK', $task->get_name()) . '</info>');
+ }
+
+ $task->run();
+ }
+ }
+ else
+ {
+ if ($input->getOption('verbose'))
+ {
+ $output->writeln('<info>' . $this->user->lang('CRON_NO_TASK') . '</info>');
+ }
+ }
+
+ return 0;
+ }
+
+ /**
+ * Executes a given cron task, if it is ready.
+ *
+ * If there is a task whose name matches $task_name, it is run and 0 is returned.
+ * and if verbose mode is set, print an info message with the name of the task.
+ * If there is no task matching $task_name, the function prints an error message
+ * and returns with status 2.
+ *
+ * @see execute
+ * @param string $task_name The name of the task that should be run.
+ * @param InputInterface $input The input stream used to get the argument and verbose option.
+ * @param OutputInterface $output The output stream, used for printing verbose-mode and error information.
+ * @return int 0 if all is well, 2 if no task matches $task_name.
+ */
+ protected function run_one(InputInterface $input, OutputInterface $output, $task_name)
+ {
+ $task = $this->cron_manager->find_task($task_name);
+ if ($task)
+ {
+ if ($input->getOption('verbose'))
+ {
+ $output->writeln('<info>' . $this->user->lang('RUNNING_TASK', $task_name) . '</info>');
+ }
+
+ $task->run();
+ return 0;
+ }
+ else
+ {
+ $output->writeln('<error>' . $this->user->lang('CRON_NO_SUCH_TASK', $task_name) . '</error>');
+ return 2;
+ }
+ }
+}
diff --git a/phpBB/phpbb/console/command/db/console_migrator_output_handler.php b/phpBB/phpbb/console/command/db/console_migrator_output_handler.php
new file mode 100644
index 0000000000..b9741a3838
--- /dev/null
+++ b/phpBB/phpbb/console/command/db/console_migrator_output_handler.php
@@ -0,0 +1,69 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\console\command\db;
+
+use phpbb\user;
+use phpbb\db\migrator_output_handler_interface;
+use Symfony\Component\Console\Output\OutputInterface;
+
+class console_migrator_output_handler implements migrator_output_handler_interface
+{
+ /**
+ * User object.
+ *
+ * @var user
+ */
+ private $user;
+
+ /**
+ * Console output object.
+ *
+ * @var OutputInterface
+ */
+ private $output;
+
+ /**
+ * Constructor
+ *
+ * @param user $user User object
+ * @param OutputInterface $output Console output object
+ */
+ public function __construct(user $user, OutputInterface $output)
+ {
+ $this->user = $user;
+ $this->output = $output;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function write($message, $verbosity)
+ {
+ if ($verbosity <= $this->output->getVerbosity())
+ {
+ $translated_message = call_user_func_array(array($this->user, 'lang'), $message);
+
+ if ($verbosity === migrator_output_handler_interface::VERBOSITY_NORMAL)
+ {
+ $translated_message = '<info>' . $translated_message . '</info>';
+ }
+ else if ($verbosity === migrator_output_handler_interface::VERBOSITY_VERBOSE)
+ {
+ $translated_message = '<comment>' . $translated_message . '</comment>';
+ }
+
+ $this->output->writeln($translated_message);
+ }
+ }
+}
diff --git a/phpBB/phpbb/console/command/db/migrate.php b/phpBB/phpbb/console/command/db/migrate.php
new file mode 100644
index 0000000000..87c2a057d1
--- /dev/null
+++ b/phpBB/phpbb/console/command/db/migrate.php
@@ -0,0 +1,107 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+namespace phpbb\console\command\db;
+
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Output\OutputInterface;
+
+class migrate extends \phpbb\console\command\command
+{
+ /** @var \phpbb\db\migrator */
+ protected $migrator;
+
+ /** @var \phpbb\extension\manager */
+ protected $extension_manager;
+
+ /** @var \phpbb\config\config */
+ protected $config;
+
+ /** @var \phpbb\cache\service */
+ protected $cache;
+
+ /** @var \phpbb\log\log */
+ protected $log;
+
+ /** @var string phpBB root path */
+ protected $phpbb_root_path;
+
+ function __construct(\phpbb\user $user, \phpbb\db\migrator $migrator, \phpbb\extension\manager $extension_manager, \phpbb\config\config $config, \phpbb\cache\service $cache, \phpbb\log\log $log, $phpbb_root_path)
+ {
+ $this->migrator = $migrator;
+ $this->extension_manager = $extension_manager;
+ $this->config = $config;
+ $this->cache = $cache;
+ $this->log = $log;
+ $this->phpbb_root_path = $phpbb_root_path;
+ parent::__construct($user);
+ $this->user->add_lang(array('common', 'install', 'migrator'));
+ }
+
+ protected function configure()
+ {
+ $this
+ ->setName('db:migrate')
+ ->setDescription($this->user->lang('CLI_DESCRIPTION_DB_MIGRATE'))
+ ;
+ }
+
+ protected function execute(InputInterface $input, OutputInterface $output)
+ {
+ $this->migrator->set_output_handler(new \phpbb\db\log_wrapper_migrator_output_handler($this->user, new console_migrator_output_handler($this->user, $output), $this->phpbb_root_path . 'store/migrations_' . time() . '.log'));
+
+ $this->migrator->create_migrations_table();
+
+ $this->cache->purge();
+
+ $this->load_migrations();
+ $orig_version = $this->config['version'];
+ while (!$this->migrator->finished())
+ {
+ try
+ {
+ $this->migrator->update();
+ }
+ catch (\phpbb\db\migration\exception $e)
+ {
+ $output->writeln('<error>' . $e->getLocalisedMessage($this->user) . '</error>');
+ $this->finalise_update();
+ return 1;
+ }
+ }
+
+ if ($orig_version != $this->config['version'])
+ {
+ $this->log->add('admin', ANONYMOUS, '', 'LOG_UPDATE_DATABASE', time(), array($orig_version, $this->config['version']));
+ }
+
+ $this->finalise_update();
+ $output->writeln($this->user->lang['DATABASE_UPDATE_COMPLETE']);
+ }
+
+ protected function load_migrations()
+ {
+ $migrations = $this->extension_manager
+ ->get_finder()
+ ->core_path('phpbb/db/migration/data/')
+ ->extension_directory('/migrations')
+ ->get_classes();
+
+ $this->migrator->set_migrations($migrations);
+ }
+
+ protected function finalise_update()
+ {
+ $this->cache->purge();
+ $this->config->increment('assets_version', 1);
+ }
+}
diff --git a/phpBB/phpbb/console/command/dev/migration_tips.php b/phpBB/phpbb/console/command/dev/migration_tips.php
new file mode 100644
index 0000000000..f9047bdac8
--- /dev/null
+++ b/phpBB/phpbb/console/command/dev/migration_tips.php
@@ -0,0 +1,64 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+namespace phpbb\console\command\dev;
+
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Output\OutputInterface;
+
+class migration_tips extends \phpbb\console\command\command
+{
+ /** @var \phpbb\extension\manager */
+ protected $extension_manager;
+
+ function __construct(\phpbb\user $user, \phpbb\extension\manager $extension_manager)
+ {
+ $this->extension_manager = $extension_manager;
+ parent::__construct($user);
+ }
+
+ protected function configure()
+ {
+ $this
+ ->setName('dev:migration-tips')
+ ->setDescription($this->user->lang('CLI_DESCRIPTION_FIND_MIGRATIONS'))
+ ;
+ }
+
+ protected function execute(InputInterface $input, OutputInterface $output)
+ {
+ $migrations = $this->extension_manager->get_finder()
+ ->set_extensions(array())
+ ->core_path('phpbb/db/migration/data/')
+ ->get_classes();
+ $tips = $migrations;
+
+ foreach ($migrations as $migration_class)
+ {
+ foreach ($migration_class::depends_on() as $dependency)
+ {
+ $tips_key = array_search($dependency, $tips);
+ if ($tips_key !== false)
+ {
+ unset($tips[$tips_key]);
+ }
+ }
+ }
+
+ $output->writeln("\t\tarray(");
+ foreach ($tips as $migration)
+ {
+ $output->writeln("\t\t\t'{$migration}',");
+ }
+ $output->writeln("\t\t);");
+ }
+}
diff --git a/phpBB/phpbb/console/command/extension/command.php b/phpBB/phpbb/console/command/extension/command.php
new file mode 100644
index 0000000000..364d954082
--- /dev/null
+++ b/phpBB/phpbb/console/command/extension/command.php
@@ -0,0 +1,30 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+namespace phpbb\console\command\extension;
+
+abstract class command extends \phpbb\console\command\command
+{
+ /** @var \phpbb\extension\manager */
+ protected $manager;
+
+ /** @var \phpbb\log\log */
+ protected $log;
+
+ public function __construct(\phpbb\user $user, \phpbb\extension\manager $manager, \phpbb\log\log $log)
+ {
+ $this->manager = $manager;
+ $this->log = $log;
+
+ parent::__construct($user);
+ }
+}
diff --git a/phpBB/phpbb/console/command/extension/disable.php b/phpBB/phpbb/console/command/extension/disable.php
new file mode 100644
index 0000000000..1eee16cbd9
--- /dev/null
+++ b/phpBB/phpbb/console/command/extension/disable.php
@@ -0,0 +1,52 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+namespace phpbb\console\command\extension;
+
+use Symfony\Component\Console\Input\InputArgument;
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Output\OutputInterface;
+
+class disable extends command
+{
+ protected function configure()
+ {
+ $this
+ ->setName('extension:disable')
+ ->setDescription($this->user->lang('CLI_DESCRIPTION_DISABLE_EXTENSION'))
+ ->addArgument(
+ 'extension-name',
+ InputArgument::REQUIRED,
+ $this->user->lang('CLI_EXTENSION_NAME')
+ )
+ ;
+ }
+
+ protected function execute(InputInterface $input, OutputInterface $output)
+ {
+ $name = $input->getArgument('extension-name');
+ $this->manager->disable($name);
+ $this->manager->load_extensions();
+
+ if ($this->manager->is_enabled($name))
+ {
+ $output->writeln('<error>' . $this->user->lang('CLI_EXTENSION_DISABLE_FAILURE', $name) . '</error>');
+ return 1;
+ }
+ else
+ {
+ $this->log->add('admin', ANONYMOUS, '', 'LOG_EXT_DISABLE', time(), array($name));
+ $output->writeln('<info>' . $this->user->lang('CLI_EXTENSION_DISABLE_SUCCESS', $name) . '</info>');
+ return 0;
+ }
+ }
+}
diff --git a/phpBB/phpbb/console/command/extension/enable.php b/phpBB/phpbb/console/command/extension/enable.php
new file mode 100644
index 0000000000..59ff11e9b7
--- /dev/null
+++ b/phpBB/phpbb/console/command/extension/enable.php
@@ -0,0 +1,52 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+namespace phpbb\console\command\extension;
+
+use Symfony\Component\Console\Input\InputArgument;
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Output\OutputInterface;
+
+class enable extends command
+{
+ protected function configure()
+ {
+ $this
+ ->setName('extension:enable')
+ ->setDescription($this->user->lang('CLI_DESCRIPTION_ENABLE_EXTENSION'))
+ ->addArgument(
+ 'extension-name',
+ InputArgument::REQUIRED,
+ $this->user->lang('CLI_EXTENSION_NAME')
+ )
+ ;
+ }
+
+ protected function execute(InputInterface $input, OutputInterface $output)
+ {
+ $name = $input->getArgument('extension-name');
+ $this->manager->enable($name);
+ $this->manager->load_extensions();
+
+ if ($this->manager->is_enabled($name))
+ {
+ $this->log->add('admin', ANONYMOUS, '', 'LOG_EXT_ENABLE', time(), array($name));
+ $output->writeln('<info>' . $this->user->lang('CLI_EXTENSION_ENABLE_SUCCESS', $name) . '</info>');
+ return 0;
+ }
+ else
+ {
+ $output->writeln('<error>' . $this->user->lang('CLI_EXTENSION_ENABLE_FAILURE', $name) . '</error>');
+ return 1;
+ }
+ }
+}
diff --git a/phpBB/phpbb/console/command/extension/purge.php b/phpBB/phpbb/console/command/extension/purge.php
new file mode 100644
index 0000000000..517e9a74c9
--- /dev/null
+++ b/phpBB/phpbb/console/command/extension/purge.php
@@ -0,0 +1,52 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+namespace phpbb\console\command\extension;
+
+use Symfony\Component\Console\Input\InputArgument;
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Output\OutputInterface;
+
+class purge extends command
+{
+ protected function configure()
+ {
+ $this
+ ->setName('extension:purge')
+ ->setDescription($this->user->lang('CLI_DESCRIPTION_PURGE_EXTENSION'))
+ ->addArgument(
+ 'extension-name',
+ InputArgument::REQUIRED,
+ $this->user->lang('CLI_EXTENSION_NAME')
+ )
+ ;
+ }
+
+ protected function execute(InputInterface $input, OutputInterface $output)
+ {
+ $name = $input->getArgument('extension-name');
+ $this->manager->purge($name);
+ $this->manager->load_extensions();
+
+ if ($this->manager->is_enabled($name))
+ {
+ $output->writeln('<error>' . $this->user->lang('CLI_EXTENSION_PURGE_FAILURE', $name) . '</error>');
+ return 1;
+ }
+ else
+ {
+ $this->log->add('admin', ANONYMOUS, '', 'LOG_EXT_PURGE', time(), array($name));
+ $output->writeln('<info>' . $this->user->lang('CLI_EXTENSION_PURGE_SUCCESS', $name) . '</info>');
+ return 0;
+ }
+ }
+}
diff --git a/phpBB/phpbb/console/command/extension/show.php b/phpBB/phpbb/console/command/extension/show.php
new file mode 100644
index 0000000000..f9322034d7
--- /dev/null
+++ b/phpBB/phpbb/console/command/extension/show.php
@@ -0,0 +1,62 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+namespace phpbb\console\command\extension;
+
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Output\OutputInterface;
+
+class show extends command
+{
+ protected function configure()
+ {
+ $this
+ ->setName('extension:show')
+ ->setDescription($this->user->lang('CLI_DESCRIPTION_LIST_EXTENSIONS'))
+ ;
+ }
+
+ protected function execute(InputInterface $input, OutputInterface $output)
+ {
+ $this->manager->load_extensions();
+ $all = array_keys($this->manager->all_available());
+
+ if (empty($all))
+ {
+ $output->writeln('<comment>' . $this->user->lang('CLI_EXTENSION_NOT_FOUND') . '</comment>');
+ return 3;
+ }
+
+ $enabled = array_keys($this->manager->all_enabled());
+ $this->print_extension_list($output, $this->user->lang('CLI_EXTENSIONS_ENABLED') . $this->user->lang('COLON'), $enabled);
+
+ $output->writeln('');
+
+ $disabled = array_keys($this->manager->all_disabled());
+ $this->print_extension_list($output, $this->user->lang('CLI_EXTENSIONS_DISABLED') . $this->user->lang('COLON'), $disabled);
+
+ $output->writeln('');
+
+ $purged = array_diff($all, $enabled, $disabled);
+ $this->print_extension_list($output, $this->user->lang('CLI_EXTENSIONS_AVAILABLE') . $this->user->lang('COLON'), $purged);
+ }
+
+ protected function print_extension_list(OutputInterface $output, $type, array $extensions)
+ {
+ $output->writeln("<info>$type</info>");
+
+ foreach ($extensions as $extension)
+ {
+ $output->writeln(" - $extension");
+ }
+ }
+}
diff --git a/phpBB/phpbb/console/command/fixup/fix_left_right_ids.php b/phpBB/phpbb/console/command/fixup/fix_left_right_ids.php
new file mode 100644
index 0000000000..f55e1761bc
--- /dev/null
+++ b/phpBB/phpbb/console/command/fixup/fix_left_right_ids.php
@@ -0,0 +1,134 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\console\command\fixup;
+
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Output\OutputInterface;
+
+class fix_left_right_ids extends \phpbb\console\command\command
+{
+ /** @var \phpbb\user */
+ protected $user;
+
+ /** @var \phpbb\db\driver\driver_interface */
+ protected $db;
+
+ /** @var \phpbb\cache\driver\driver_interface */
+ protected $cache;
+
+ /**
+ * Constructor
+ *
+ * @param \phpbb\user $user User instance
+ * @param \phpbb\db\driver\driver_interface $db Database connection
+ * @param \phpbb\cache\driver\driver_interface $cache Cache instance
+ */
+ public function __construct(\phpbb\user $user, \phpbb\db\driver\driver_interface $db, \phpbb\cache\driver\driver_interface $cache)
+ {
+ $this->user = $user;
+ $this->db = $db;
+ $this->cache = $cache;
+
+ parent::__construct($user);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function configure()
+ {
+ $this
+ ->setName('fixup:fix-left-right-ids')
+ ->setDescription($this->user->lang('CLI_DESCRIPTION_FIX_LEFT_RIGHT_IDS'))
+ ;
+ }
+
+ /**
+ * Executes the command fixup:fix-left-right-ids.
+ *
+ * Repairs the tree structure of the forums and modules.
+ * The code is mainly borrowed from Support toolkit for phpBB Olympus
+ *
+ * @param InputInterface $input An InputInterface instance
+ * @param OutputInterface $output An OutputInterface instance
+ *
+ * @return void
+ */
+ protected function execute(InputInterface $input, OutputInterface $output)
+ {
+ // Fix Left/Right IDs for the modules table
+ $result = $this->db->sql_query('SELECT DISTINCT(module_class) FROM ' . MODULES_TABLE);
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $i = 1;
+ $where = array("module_class = '" . $this->db->sql_escape($row['module_class']) . "'");
+ $this->fix_ids_tree($i, 'module_id', MODULES_TABLE, 0, $where);
+ }
+ $this->db->sql_freeresult($result);
+
+ // Fix the Left/Right IDs for the forums table
+ $i = 1;
+ $this->fix_ids_tree($i, 'forum_id', FORUMS_TABLE);
+
+ $this->cache->purge();
+
+ $output->writeln('<info>' . $this->user->lang('CLI_FIXUP_FIX_LEFT_RIGHT_IDS_SUCCESS') . '</info>');
+ }
+
+ /**
+ * Item's tree structure rebuild helper
+ * The item is either forum or ACP/MCP/UCP module
+ *
+ * @param int $i Item id offset index
+ * @param string $field The key field to fix, forum_id|module_id
+ * @param string $table The table name to perform, FORUMS_TABLE|MODULES_TABLE
+ * @param int $parent_id Parent item id
+ * @param array $where Additional WHERE clause condition
+ *
+ * @return bool True on rebuild success, false otherwise
+ */
+ protected function fix_ids_tree(&$i, $field, $table, $parent_id = 0, $where = array())
+ {
+ $changes_made = false;
+ $sql = 'SELECT * FROM ' . $table . '
+ WHERE parent_id = ' . (int) $parent_id .
+ ((!empty($where)) ? ' AND ' . implode(' AND ', $where) : '') . '
+ ORDER BY left_id ASC';
+ $result = $this->db->sql_query($sql);
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ // Update the left_id for the item
+ if ($row['left_id'] != $i)
+ {
+ $this->db->sql_query('UPDATE ' . $table . ' SET ' . $this->db->sql_build_array('UPDATE', array('left_id' => $i)) . " WHERE $field = " . (int) $row[$field]);
+ $changes_made = true;
+ }
+ $i++;
+
+ // Go through children and update their left/right IDs
+ $changes_made = (($this->fix_ids_tree($i, $field, $table, $row[$field], $where)) || $changes_made) ? true : false;
+
+ // Update the right_id for the item
+ if ($row['right_id'] != $i)
+ {
+ $this->db->sql_query('UPDATE ' . $table . ' SET ' . $this->db->sql_build_array('UPDATE', array('right_id' => $i)) . " WHERE $field = " . (int) $row[$field]);
+ $changes_made = true;
+ }
+ $i++;
+ }
+ $this->db->sql_freeresult($result);
+
+ return $changes_made;
+ }
+}
diff --git a/phpBB/phpbb/console/command/fixup/recalculate_email_hash.php b/phpBB/phpbb/console/command/fixup/recalculate_email_hash.php
new file mode 100644
index 0000000000..ec4e1b0ee7
--- /dev/null
+++ b/phpBB/phpbb/console/command/fixup/recalculate_email_hash.php
@@ -0,0 +1,75 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+namespace phpbb\console\command\fixup;
+
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Output\OutputInterface;
+
+class recalculate_email_hash extends \phpbb\console\command\command
+{
+ /** @var \phpbb\db\driver\driver_interface */
+ protected $db;
+
+ function __construct(\phpbb\user $user, \phpbb\db\driver\driver_interface $db)
+ {
+ $this->db = $db;
+
+ parent::__construct($user);
+ }
+
+ protected function configure()
+ {
+ $this
+ ->setName('fixup:recalculate-email-hash')
+ ->setDescription($this->user->lang('CLI_DESCRIPTION_RECALCULATE_EMAIL_HASH'))
+ ;
+ }
+
+ protected function execute(InputInterface $input, OutputInterface $output)
+ {
+ $sql = 'SELECT user_id, user_email, user_email_hash
+ FROM ' . USERS_TABLE . '
+ WHERE user_type <> ' . USER_IGNORE . "
+ AND user_email <> ''";
+ $result = $this->db->sql_query($sql);
+
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $user_email_hash = phpbb_email_hash($row['user_email']);
+ if ($user_email_hash !== $row['user_email_hash'])
+ {
+ $sql_ary = array(
+ 'user_email_hash' => $user_email_hash,
+ );
+
+ $sql = 'UPDATE ' . USERS_TABLE . '
+ SET ' . $this->db->sql_build_array('UPDATE', $sql_ary) . '
+ WHERE user_id = ' . (int) $row['user_id'];
+ $this->db->sql_query($sql);
+
+ if ($output->getVerbosity() >= OutputInterface::VERBOSITY_DEBUG)
+ {
+ $output->writeln(sprintf(
+ 'user_id %d, email %s => %s',
+ $row['user_id'],
+ $row['user_email'],
+ $user_email_hash
+ ));
+ }
+ }
+ }
+ $this->db->sql_freeresult($result);
+
+ $output->writeln('<info>' . $this->user->lang('CLI_FIXUP_RECALCULATE_EMAIL_HASH_SUCCESS') . '</info>');
+ }
+}
diff --git a/phpBB/phpbb/console/command/fixup/update_hashes.php b/phpBB/phpbb/console/command/fixup/update_hashes.php
new file mode 100644
index 0000000000..4bcc3b5d19
--- /dev/null
+++ b/phpBB/phpbb/console/command/fixup/update_hashes.php
@@ -0,0 +1,117 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+namespace phpbb\console\command\fixup;
+
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Output\OutputInterface;
+use Symfony\Component\Console\Helper\ProgressBar;
+
+class update_hashes extends \phpbb\console\command\command
+{
+ /** @var \phpbb\config\config */
+ protected $config;
+
+ /** @var \phpbb\db\driver\driver_interface */
+ protected $db;
+
+ /** @var \phpbb\passwords\manager */
+ protected $passwords_manager;
+
+ /** @var string Default hashing type */
+ protected $default_type;
+
+ /**
+ * Update_hashes constructor
+ *
+ * @param \phpbb\config\config $config
+ * @param \phpbb\user $user
+ * @param \phpbb\db\driver\driver_interface $db
+ * @param \phpbb\passwords\manager $passwords_manager
+ * @param array $hashing_algorithms Hashing driver
+ * service collection
+ * @param array $defaults Default password types
+ */
+ public function __construct(\phpbb\config\config $config, \phpbb\user $user,
+ \phpbb\db\driver\driver_interface $db, \phpbb\passwords\manager $passwords_manager,
+ $hashing_algorithms, $defaults)
+ {
+ $this->config = $config;
+ $this->db = $db;
+
+ $this->passwords_manager = $passwords_manager;
+
+ foreach ($defaults as $type)
+ {
+ if ($hashing_algorithms[$type]->is_supported())
+ {
+ $this->default_type = $type;
+ break;
+ }
+ }
+
+ parent::__construct($user);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function configure()
+ {
+ $this
+ ->setName('fixup:update-hashes')
+ ->setDescription($this->user->lang('CLI_DESCRIPTION_UPDATE_HASH_BCRYPT'))
+ ;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function execute(InputInterface $input, OutputInterface $output)
+ {
+ // Get count to be able to display progress
+ $sql = 'SELECT COUNT(user_id) AS count
+ FROM ' . USERS_TABLE . '
+ WHERE user_password ' . $this->db->sql_like_expression('$H$' . $this->db->get_any_char()) . '
+ OR user_password ' . $this->db->sql_like_expression('$CP$' . $this->db->get_any_char());
+ $result = $this->db->sql_query($sql);
+ $total_update_passwords = $this->db->sql_fetchfield('count');
+ $this->db->sql_freeresult($result);
+
+ // Create progress bar
+ $progress_bar = new ProgressBar($output, $total_update_passwords);
+ $progress_bar->start();
+
+ $sql = 'SELECT user_id, user_password
+ FROM ' . USERS_TABLE . '
+ WHERE user_password ' . $this->db->sql_like_expression('$H$' . $this->db->get_any_char()) . '
+ OR user_password ' . $this->db->sql_like_expression('$CP$' . $this->db->get_any_char());
+ $result = $this->db->sql_query($sql);
+
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $new_hash = $this->passwords_manager->hash($row['user_password'], array($this->default_type));
+
+ $sql = 'UPDATE ' . USERS_TABLE . '
+ SET user_password = "' . $this->db->sql_escape($new_hash) . '"
+ WHERE user_id = ' . (int) $row['user_id'];
+ $this->db->sql_query($sql);
+ $progress_bar->advance();
+ }
+
+ $this->config->set('update_hashes_last_cron', time());
+
+ $progress_bar->finish();
+
+ $output->writeln('<info>' . $this->user->lang('CLI_FIXUP_UPDATE_HASH_BCRYPT_SUCCESS') . '</info>');
+ }
+}
diff --git a/phpBB/phpbb/content_visibility.php b/phpBB/phpbb/content_visibility.php
new file mode 100644
index 0000000000..bf7dc2c703
--- /dev/null
+++ b/phpBB/phpbb/content_visibility.php
@@ -0,0 +1,863 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb;
+
+/**
+* phpbb_visibility
+* Handle fetching and setting the visibility for topics and posts
+*/
+class content_visibility
+{
+ /**
+ * Database object
+ * @var \phpbb\db\driver\driver_interface
+ */
+ protected $db;
+
+ /**
+ * User object
+ * @var \phpbb\user
+ */
+ protected $user;
+
+ /**
+ * Auth object
+ * @var \phpbb\auth\auth
+ */
+ protected $auth;
+
+ /**
+ * config object
+ * @var \phpbb\config\config
+ */
+ protected $config;
+
+ /**
+ * Event dispatcher object
+ * @var \phpbb\event\dispatcher_interface
+ */
+ protected $phpbb_dispatcher;
+
+ /**
+ * phpBB root path
+ * @var string
+ */
+ protected $phpbb_root_path;
+
+ /**
+ * PHP Extension
+ * @var string
+ */
+ protected $php_ext;
+
+ /**
+ * Constructor
+ *
+ * @param \phpbb\auth\auth $auth Auth object
+ * @param \phpbb\config\config $config Config object
+ * @param \phpbb\event\dispatcher_interface $phpbb_dispatcher Event dispatcher object
+ * @param \phpbb\db\driver\driver_interface $db Database object
+ * @param \phpbb\user $user User object
+ * @param string $phpbb_root_path Root path
+ * @param string $php_ext PHP Extension
+ * @param string $forums_table Forums table name
+ * @param string $posts_table Posts table name
+ * @param string $topics_table Topics table name
+ * @param string $users_table Users table name
+ */
+ public function __construct(\phpbb\auth\auth $auth, \phpbb\config\config $config, \phpbb\event\dispatcher_interface $phpbb_dispatcher, \phpbb\db\driver\driver_interface $db, \phpbb\user $user, $phpbb_root_path, $php_ext, $forums_table, $posts_table, $topics_table, $users_table)
+ {
+ $this->auth = $auth;
+ $this->config = $config;
+ $this->phpbb_dispatcher = $phpbb_dispatcher;
+ $this->db = $db;
+ $this->user = $user;
+ $this->phpbb_root_path = $phpbb_root_path;
+ $this->php_ext = $php_ext;
+ $this->forums_table = $forums_table;
+ $this->posts_table = $posts_table;
+ $this->topics_table = $topics_table;
+ $this->users_table = $users_table;
+ }
+
+ /**
+ * Can the current logged-in user soft-delete posts?
+ *
+ * @param $forum_id int Forum ID whose permissions to check
+ * @param $poster_id int Poster ID of the post in question
+ * @param $post_locked bool Is the post locked?
+ * @return bool
+ */
+ public function can_soft_delete($forum_id, $poster_id, $post_locked)
+ {
+ if ($this->auth->acl_get('m_softdelete', $forum_id))
+ {
+ return true;
+ }
+ else if ($this->auth->acl_get('f_softdelete', $forum_id) && $poster_id == $this->user->data['user_id'] && !$post_locked)
+ {
+ return true;
+ }
+
+ return false;
+ }
+
+ /**
+ * Get the topics post count or the forums post/topic count based on permissions
+ *
+ * @param $mode string One of topic_posts, forum_posts or forum_topics
+ * @param $data array Array with the topic/forum data to calculate from
+ * @param $forum_id int The forum id is used for permission checks
+ * @return int Number of posts/topics the user can see in the topic/forum
+ */
+ public function get_count($mode, $data, $forum_id)
+ {
+ if (!$this->auth->acl_get('m_approve', $forum_id))
+ {
+ return (int) $data[$mode . '_approved'];
+ }
+
+ return (int) $data[$mode . '_approved'] + (int) $data[$mode . '_unapproved'] + (int) $data[$mode . '_softdeleted'];
+ }
+
+ /**
+ * Create topic/post visibility SQL for a given forum ID
+ *
+ * Note: Read permissions are not checked.
+ *
+ * @param $mode string Either "topic" or "post"
+ * @param $forum_id int The forum id is used for permission checks
+ * @param $table_alias string Table alias to prefix in SQL queries
+ * @return string The appropriate combination SQL logic for topic/post_visibility
+ */
+ public function get_visibility_sql($mode, $forum_id, $table_alias = '')
+ {
+ $where_sql = '';
+
+ $get_visibility_sql_overwrite = false;
+
+ /**
+ * Allow changing the result of calling get_visibility_sql
+ *
+ * @event core.phpbb_content_visibility_get_visibility_sql_before
+ * @var string where_sql Extra visibility conditions. It must end with either an SQL "AND" or an "OR"
+ * @var string mode Either "topic" or "post" depending on the query this is being used in
+ * @var array forum_id The forum id in which the search is made.
+ * @var string table_alias Table alias to prefix in SQL queries
+ * @var mixed get_visibility_sql_overwrite If a string, forces the function to return get_forums_visibility_sql_overwrite after executing the event
+ * If false, get_visibility_sql continues normally
+ * It must be either boolean or string
+ * @since 3.1.4-RC1
+ */
+ $vars = array(
+ 'where_sql',
+ 'mode',
+ 'forum_id',
+ 'table_alias',
+ 'get_visibility_sql_overwrite',
+ );
+ extract($this->phpbb_dispatcher->trigger_event('core.phpbb_content_visibility_get_visibility_sql_before', compact($vars)));
+
+ if ($get_visibility_sql_overwrite !== false)
+ {
+ return $get_visibility_sql_overwrite;
+ }
+
+ if ($this->auth->acl_get('m_approve', $forum_id))
+ {
+ return $where_sql . '1 = 1';
+ }
+
+ return $where_sql . $table_alias . $mode . '_visibility = ' . ITEM_APPROVED;
+ }
+
+ /**
+ * Create topic/post visibility SQL for a set of forums
+ *
+ * Note: Read permissions are not checked. Forums without read permissions
+ * should not be in $forum_ids
+ *
+ * @param $mode string Either "topic" or "post"
+ * @param $forum_ids array Array of forum ids which the posts/topics are limited to
+ * @param $table_alias string Table alias to prefix in SQL queries
+ * @return string The appropriate combination SQL logic for topic/post_visibility
+ */
+ public function get_forums_visibility_sql($mode, $forum_ids = array(), $table_alias = '')
+ {
+ $where_sql = '(';
+
+ $approve_forums = array_intersect($forum_ids, array_keys($this->auth->acl_getf('m_approve', true)));
+
+ $get_forums_visibility_sql_overwrite = false;
+ /**
+ * Allow changing the result of calling get_forums_visibility_sql
+ *
+ * @event core.phpbb_content_visibility_get_forums_visibility_before
+ * @var string where_sql The action the user tried to execute
+ * @var string mode Either "topic" or "post" depending on the query this is being used in
+ * @var array forum_ids Array of forum ids which the posts/topics are limited to
+ * @var string table_alias Table alias to prefix in SQL queries
+ * @var array approve_forums Array of forums where the user has m_approve permissions
+ * @var mixed get_forums_visibility_sql_overwrite If a string, forces the function to return get_forums_visibility_sql_overwrite after executing the event
+ * If false, get_forums_visibility_sql continues normally
+ * It must be either boolean or string
+ * @since 3.1.3-RC1
+ */
+ $vars = array(
+ 'where_sql',
+ 'mode',
+ 'forum_ids',
+ 'table_alias',
+ 'approve_forums',
+ 'get_forums_visibility_sql_overwrite',
+ );
+ extract($this->phpbb_dispatcher->trigger_event('core.phpbb_content_visibility_get_forums_visibility_before', compact($vars)));
+
+ if ($get_forums_visibility_sql_overwrite !== false)
+ {
+ return $get_forums_visibility_sql_overwrite;
+ }
+
+ if (sizeof($approve_forums))
+ {
+ // Remove moderator forums from the rest
+ $forum_ids = array_diff($forum_ids, $approve_forums);
+
+ if (!sizeof($forum_ids))
+ {
+ // The user can see all posts/topics in all specified forums
+ return $where_sql . $this->db->sql_in_set($table_alias . 'forum_id', $approve_forums) . ')';
+ }
+ else
+ {
+ // Moderator can view all posts/topics in some forums
+ $where_sql .= $this->db->sql_in_set($table_alias . 'forum_id', $approve_forums) . ' OR ';
+ }
+ }
+ else
+ {
+ // The user is just a normal user
+ return $where_sql . $table_alias . $mode . '_visibility = ' . ITEM_APPROVED . '
+ AND ' . $this->db->sql_in_set($table_alias . 'forum_id', $forum_ids, false, true) . ')';
+ }
+
+ $where_sql .= '(' . $table_alias . $mode . '_visibility = ' . ITEM_APPROVED . '
+ AND ' . $this->db->sql_in_set($table_alias . 'forum_id', $forum_ids) . '))';
+
+ return $where_sql;
+ }
+
+ /**
+ * Create topic/post visibility SQL for all forums on the board
+ *
+ * Note: Read permissions are not checked. Forums without read permissions
+ * should be in $exclude_forum_ids
+ *
+ * @param $mode string Either "topic" or "post"
+ * @param $exclude_forum_ids array Array of forum ids which are excluded
+ * @param $table_alias string Table alias to prefix in SQL queries
+ * @return string The appropriate combination SQL logic for topic/post_visibility
+ */
+ public function get_global_visibility_sql($mode, $exclude_forum_ids = array(), $table_alias = '')
+ {
+ $where_sqls = array();
+
+ $approve_forums = array_diff(array_keys($this->auth->acl_getf('m_approve', true)), $exclude_forum_ids);
+
+ $visibility_sql_overwrite = null;
+
+ /**
+ * Allow changing the result of calling get_global_visibility_sql
+ *
+ * @event core.phpbb_content_visibility_get_global_visibility_before
+ * @var array where_sqls The action the user tried to execute
+ * @var string mode Either "topic" or "post" depending on the query this is being used in
+ * @var array exclude_forum_ids Array of forum ids the current user doesn't have access to
+ * @var string table_alias Table alias to prefix in SQL queries
+ * @var array approve_forums Array of forums where the user has m_approve permissions
+ * @var string visibility_sql_overwrite Forces the function to return an implosion of where_sqls (joined by "OR")
+ * @since 3.1.3-RC1
+ */
+ $vars = array(
+ 'where_sqls',
+ 'mode',
+ 'exclude_forum_ids',
+ 'table_alias',
+ 'approve_forums',
+ 'visibility_sql_overwrite',
+ );
+ extract($this->phpbb_dispatcher->trigger_event('core.phpbb_content_visibility_get_global_visibility_before', compact($vars)));
+
+ if ($visibility_sql_overwrite)
+ {
+ return $visibility_sql_overwrite;
+ }
+
+ if (sizeof($exclude_forum_ids))
+ {
+ $where_sqls[] = '(' . $this->db->sql_in_set($table_alias . 'forum_id', $exclude_forum_ids, true) . '
+ AND ' . $table_alias . $mode . '_visibility = ' . ITEM_APPROVED . ')';
+ }
+ else
+ {
+ $where_sqls[] = $table_alias . $mode . '_visibility = ' . ITEM_APPROVED;
+ }
+
+ if (sizeof($approve_forums))
+ {
+ $where_sqls[] = $this->db->sql_in_set($table_alias . 'forum_id', $approve_forums);
+ return '(' . implode(' OR ', $where_sqls) . ')';
+ }
+
+ // There is only one element, so we just return that one
+ return $where_sqls[0];
+ }
+
+ /**
+ * Change visibility status of one post or all posts of a topic
+ *
+ * @param $visibility int Element of {ITEM_APPROVED, ITEM_DELETED, ITEM_REAPPROVE}
+ * @param $post_id mixed Post ID or array of post IDs to act on,
+ * if it is empty, all posts of topic_id will be modified
+ * @param $topic_id int Topic where $post_id is found
+ * @param $forum_id int Forum where $topic_id is found
+ * @param $user_id int User performing the action
+ * @param $time int Timestamp when the action is performed
+ * @param $reason string Reason why the visibility was changed.
+ * @param $is_starter bool Is this the first post of the topic changed?
+ * @param $is_latest bool Is this the last post of the topic changed?
+ * @param $limit_visibility mixed Limit updating per topic_id to a certain visibility
+ * @param $limit_delete_time mixed Limit updating per topic_id to a certain deletion time
+ * @return array Changed post data, empty array if an error occurred.
+ */
+ public function set_post_visibility($visibility, $post_id, $topic_id, $forum_id, $user_id, $time, $reason, $is_starter, $is_latest, $limit_visibility = false, $limit_delete_time = false)
+ {
+ if (!in_array($visibility, array(ITEM_APPROVED, ITEM_DELETED, ITEM_REAPPROVE)))
+ {
+ return array();
+ }
+
+ if ($post_id)
+ {
+ if (is_array($post_id))
+ {
+ $where_sql = $this->db->sql_in_set('post_id', array_map('intval', $post_id));
+ }
+ else
+ {
+ $where_sql = 'post_id = ' . (int) $post_id;
+ }
+ $where_sql .= ' AND topic_id = ' . (int) $topic_id;
+ }
+ else
+ {
+ $where_sql = 'topic_id = ' . (int) $topic_id;
+
+ // Limit the posts to a certain visibility and deletion time
+ // This allows us to only restore posts, that were approved
+ // when the topic got soft deleted. So previous soft deleted
+ // and unapproved posts are still soft deleted/unapproved
+ if ($limit_visibility !== false)
+ {
+ $where_sql .= ' AND post_visibility = ' . (int) $limit_visibility;
+ }
+
+ if ($limit_delete_time !== false)
+ {
+ $where_sql .= ' AND post_delete_time = ' . (int) $limit_delete_time;
+ }
+ }
+
+ $sql = 'SELECT poster_id, post_id, post_postcount, post_visibility
+ FROM ' . $this->posts_table . '
+ WHERE ' . $where_sql;
+ $result = $this->db->sql_query($sql);
+
+ $post_ids = $poster_postcounts = $postcounts = $postcount_visibility = array();
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $post_ids[] = (int) $row['post_id'];
+
+ if ($row['post_visibility'] != $visibility)
+ {
+ if ($row['post_postcount'] && !isset($poster_postcounts[(int) $row['poster_id']]))
+ {
+ $poster_postcounts[(int) $row['poster_id']] = 1;
+ }
+ else if ($row['post_postcount'])
+ {
+ $poster_postcounts[(int) $row['poster_id']]++;
+ }
+
+ if (!isset($postcount_visibility[$row['post_visibility']]))
+ {
+ $postcount_visibility[$row['post_visibility']] = 1;
+ }
+ else
+ {
+ $postcount_visibility[$row['post_visibility']]++;
+ }
+ }
+ }
+ $this->db->sql_freeresult($result);
+
+ if (empty($post_ids))
+ {
+ return array();
+ }
+
+ if (!function_exists('truncate_string'))
+ {
+ include($this->phpbb_root_path . 'includes/functions_content.' . $this->php_ext);
+ }
+
+ $data = array(
+ 'post_visibility' => (int) $visibility,
+ 'post_delete_user' => (int) $user_id,
+ 'post_delete_time' => ((int) $time) ?: time(),
+ 'post_delete_reason' => truncate_string($reason, 255, 255, false),
+ );
+ /**
+ * Perform actions right before the query to change post visibility
+ *
+ * @event core.set_post_visibility_before_sql
+ * @var int visibility Element of {ITEM_APPROVED, ITEM_DELETED, ITEM_REAPPROVE}
+ * @var array post_id Array containing all post IDs to be modified. If blank, all posts within the topic are modified.
+ * @var int topic_id Topic of the post IDs to be modified.
+ * @var int forum_id Forum ID that the topic_id resides in.
+ * @var int user_id User ID doing this action.
+ * @var int timestamp Timestamp of this action.
+ * @var string reason Reason specified by the user for this change.
+ * @var bool is_starter Are we changing the topic's starter?
+ * @var bool is_latest Are we changing the topic's latest post?
+ * @var array data The data array for this action.
+ * @since 3.1.10-RC1
+ */
+ $vars = array(
+ 'visibility',
+ 'post_id',
+ 'topic_id',
+ 'forum_id',
+ 'user_id',
+ 'timestamp',
+ 'reason',
+ 'is_starter',
+ 'is_latest',
+ 'data',
+ );
+ extract($this->phpbb_dispatcher->trigger_event('core.set_post_visibility_before_sql', compact($vars)));
+ $sql = 'UPDATE ' . $this->posts_table . '
+ SET ' . $this->db->sql_build_array('UPDATE', $data) . '
+ WHERE ' . $this->db->sql_in_set('post_id', $post_ids);
+ $this->db->sql_query($sql);
+
+ // Group the authors by post count, to reduce the number of queries
+ foreach ($poster_postcounts as $poster_id => $num_posts)
+ {
+ $postcounts[$num_posts][] = $poster_id;
+ }
+
+ // Update users postcounts
+ foreach ($postcounts as $num_posts => $poster_ids)
+ {
+ if (in_array($visibility, array(ITEM_REAPPROVE, ITEM_DELETED)))
+ {
+ $sql = 'UPDATE ' . $this->users_table . '
+ SET user_posts = 0
+ WHERE ' . $this->db->sql_in_set('user_id', $poster_ids) . '
+ AND user_posts < ' . $num_posts;
+ $this->db->sql_query($sql);
+
+ $sql = 'UPDATE ' . $this->users_table . '
+ SET user_posts = user_posts - ' . $num_posts . '
+ WHERE ' . $this->db->sql_in_set('user_id', $poster_ids) . '
+ AND user_posts >= ' . $num_posts;
+ $this->db->sql_query($sql);
+ }
+ else
+ {
+ $sql = 'UPDATE ' . $this->users_table . '
+ SET user_posts = user_posts + ' . $num_posts . '
+ WHERE ' . $this->db->sql_in_set('user_id', $poster_ids);
+ $this->db->sql_query($sql);
+ }
+ }
+
+ $update_topic_postcount = true;
+
+ // Sync the first/last topic information if needed
+ if (!$is_starter && $is_latest)
+ {
+ if (!function_exists('update_post_information'))
+ {
+ include($this->phpbb_root_path . 'includes/functions_posting.' . $this->php_ext);
+ }
+
+ // update_post_information can only update the last post info ...
+ if ($topic_id)
+ {
+ update_post_information('topic', $topic_id, false);
+ }
+ if ($forum_id)
+ {
+ update_post_information('forum', $forum_id, false);
+ }
+ }
+ else if ($is_starter && $topic_id)
+ {
+ if (!function_exists('sync'))
+ {
+ include($this->phpbb_root_path . 'includes/functions_admin.' . $this->php_ext);
+ }
+
+ // ... so we need to use sync, if the first post is changed.
+ // The forum is resynced recursive by sync() itself.
+ sync('topic', 'topic_id', $topic_id, true);
+
+ // sync recalculates the topic replies and forum posts by itself, so we don't do that.
+ $update_topic_postcount = false;
+ }
+
+ $topic_update_array = array();
+ // Update the topic's reply count and the forum's post count
+ if ($update_topic_postcount)
+ {
+ $field_alias = array(
+ ITEM_APPROVED => 'posts_approved',
+ ITEM_UNAPPROVED => 'posts_unapproved',
+ ITEM_DELETED => 'posts_softdeleted',
+ ITEM_REAPPROVE => 'posts_unapproved',
+ );
+ $cur_posts = array_fill_keys($field_alias, 0);
+
+ foreach ($postcount_visibility as $post_visibility => $visibility_posts)
+ {
+ $cur_posts[$field_alias[(int) $post_visibility]] += $visibility_posts;
+ }
+
+ $sql_ary = array();
+ $recipient_field = $field_alias[$visibility];
+
+ foreach ($cur_posts as $field => $count)
+ {
+ // Decrease the count for the old statuses.
+ if ($count && $field != $recipient_field)
+ {
+ $sql_ary[$field] = " - $count";
+ }
+ }
+ // Add up the count from all statuses excluding the recipient status.
+ $count_increase = array_sum(array_diff($cur_posts, array($recipient_field)));
+
+ if ($count_increase)
+ {
+ $sql_ary[$recipient_field] = " + $count_increase";
+ }
+
+ if (sizeof($sql_ary))
+ {
+ $forum_sql = array();
+
+ foreach ($sql_ary as $field => $value_change)
+ {
+ $topic_update_array[] = 'topic_' . $field . ' = topic_' . $field . $value_change;
+ $forum_sql[] = 'forum_' . $field . ' = forum_' . $field . $value_change;
+ }
+
+ $sql = 'UPDATE ' . $this->forums_table . '
+ SET ' . implode(', ', $forum_sql) . '
+ WHERE forum_id = ' . (int) $forum_id;
+ $this->db->sql_query($sql);
+ }
+ }
+
+ if ($post_id)
+ {
+ $sql = 'SELECT 1 AS has_attachments
+ FROM ' . POSTS_TABLE . '
+ WHERE topic_id = ' . (int) $topic_id . '
+ AND post_attachment = 1
+ AND post_visibility = ' . ITEM_APPROVED . '
+ AND ' . $this->db->sql_in_set('post_id', $post_id, true);
+ $result = $this->db->sql_query_limit($sql, 1);
+
+ $has_attachment = (bool) $this->db->sql_fetchfield('has_attachments');
+ $this->db->sql_freeresult($result);
+
+ if ($has_attachment && $visibility == ITEM_APPROVED)
+ {
+ $topic_update_array[] = 'topic_attachment = 1';
+ }
+ else if (!$has_attachment && $visibility != ITEM_APPROVED)
+ {
+ $topic_update_array[] = 'topic_attachment = 0';
+ }
+ }
+
+ if (!empty($topic_update_array))
+ {
+ // Update the number for replies and posts, and update the attachments flag
+ $sql = 'UPDATE ' . $this->topics_table . '
+ SET ' . implode(', ', $topic_update_array) . '
+ WHERE topic_id = ' . (int) $topic_id;
+ $this->db->sql_query($sql);
+ }
+ /**
+ * Perform actions after all steps to changing post visibility
+ *
+ * @event core.set_post_visibility_after
+ * @var int visibility Element of {ITEM_APPROVED, ITEM_DELETED, ITEM_REAPPROVE}
+ * @var array post_id Array containing all post IDs to be modified. If blank, all posts within the topic are modified.
+ * @var int topic_id Topic of the post IDs to be modified.
+ * @var int forum_id Forum ID that the topic_id resides in.
+ * @var int user_id User ID doing this action.
+ * @var int timestamp Timestamp of this action.
+ * @var string reason Reason specified by the user for this change.
+ * @var bool is_starter Are we changing the topic's starter?
+ * @var bool is_latest Are we changing the topic's latest post?
+ * @var array data The data array for this action.
+ * @since 3.1.10-RC1
+ */
+ $vars = array(
+ 'visibility',
+ 'post_id',
+ 'topic_id',
+ 'forum_id',
+ 'user_id',
+ 'timestamp',
+ 'reason',
+ 'is_starter',
+ 'is_latest',
+ 'data',
+ );
+ extract($this->phpbb_dispatcher->trigger_event('core.set_post_visibility_after', compact($vars)));
+ return $data;
+ }
+
+ /**
+ * Set topic visibility
+ *
+ * Allows approving (which is akin to undeleting/restore) or soft deleting an entire topic.
+ * Calls set_post_visibility as needed.
+ *
+ * Note: By default, when a soft deleted topic is restored. Only posts that
+ * were approved at the time of soft deleting, are being restored.
+ * Same applies to soft deleting. Only approved posts will be marked
+ * as soft deleted.
+ * If you want to update all posts, use the force option.
+ *
+ * @param $visibility int Element of {ITEM_APPROVED, ITEM_DELETED, ITEM_REAPPROVE}
+ * @param $topic_id mixed Topic ID to act on
+ * @param $forum_id int Forum where $topic_id is found
+ * @param $user_id int User performing the action
+ * @param $time int Timestamp when the action is performed
+ * @param $reason string Reason why the visibilty was changed.
+ * @param $force_update_all bool Force to update all posts within the topic
+ * @return array Changed topic data, empty array if an error occured.
+ */
+ public function set_topic_visibility($visibility, $topic_id, $forum_id, $user_id, $time, $reason, $force_update_all = false)
+ {
+ if (!in_array($visibility, array(ITEM_APPROVED, ITEM_DELETED, ITEM_REAPPROVE)))
+ {
+ return array();
+ }
+
+ if (!$force_update_all)
+ {
+ $sql = 'SELECT topic_visibility, topic_delete_time
+ FROM ' . $this->topics_table . '
+ WHERE topic_id = ' . (int) $topic_id;
+ $result = $this->db->sql_query($sql);
+ $original_topic_data = $this->db->sql_fetchrow($result);
+ $this->db->sql_freeresult($result);
+
+ if (!$original_topic_data)
+ {
+ // The topic does not exist...
+ return array();
+ }
+ }
+
+ if (!function_exists('truncate_string'))
+ {
+ include($this->phpbb_root_path . 'includes/functions_content.' . $this->php_ext);
+ }
+
+ // Note, we do not set a reason for the posts, just for the topic
+ $data = array(
+ 'topic_visibility' => (int) $visibility,
+ 'topic_delete_user' => (int) $user_id,
+ 'topic_delete_time' => ((int) $time) ?: time(),
+ 'topic_delete_reason' => truncate_string($reason, 255, 255, false),
+ );
+ /**
+ * Perform actions right before the query to change topic visibility
+ *
+ * @event core.set_topic_visibility_before_sql
+ * @var int visibility Element of {ITEM_APPROVED, ITEM_DELETED, ITEM_REAPPROVE}
+ * @var int topic_id Topic of the post IDs to be modified.
+ * @var int forum_id Forum ID that the topic_id resides in.
+ * @var int user_id User ID doing this action.
+ * @var int timestamp Timestamp of this action.
+ * @var string reason Reason specified by the user for this change.
+ * @var bool force_update_all Force an update on all posts within the topic, regardless of their current approval state.
+ * @var array data The data array for this action.
+ * @since 3.1.10-RC1
+ */
+ $vars = array(
+ 'visibility',
+ 'topic_id',
+ 'forum_id',
+ 'user_id',
+ 'timestamp',
+ 'reason',
+ 'force_update_all',
+ 'data',
+ );
+ extract($this->phpbb_dispatcher->trigger_event('core.set_topic_visibility_before_sql', compact($vars)));
+ $sql = 'UPDATE ' . $this->topics_table . '
+ SET ' . $this->db->sql_build_array('UPDATE', $data) . '
+ WHERE topic_id = ' . (int) $topic_id;
+ $this->db->sql_query($sql);
+
+ if (!$this->db->sql_affectedrows())
+ {
+ return array();
+ }
+
+ if (!$force_update_all && $original_topic_data['topic_delete_time'] && $original_topic_data['topic_visibility'] == ITEM_DELETED && $visibility == ITEM_APPROVED)
+ {
+ // If we're restoring a topic we only restore posts, that were soft deleted through the topic soft deletion.
+ $this->set_post_visibility($visibility, false, $topic_id, $forum_id, $user_id, $time, '', true, true, $original_topic_data['topic_visibility'], $original_topic_data['topic_delete_time']);
+ }
+ else if (!$force_update_all && $original_topic_data['topic_visibility'] == ITEM_APPROVED && $visibility == ITEM_DELETED)
+ {
+ // If we're soft deleting a topic we only mark approved posts as soft deleted.
+ $this->set_post_visibility($visibility, false, $topic_id, $forum_id, $user_id, $time, '', true, true, $original_topic_data['topic_visibility']);
+ }
+ else
+ {
+ $this->set_post_visibility($visibility, false, $topic_id, $forum_id, $user_id, $time, '', true, true);
+ }
+ /**
+ * Perform actions after all steps to changing topic visibility
+ *
+ * @event core.set_topic_visibility_after
+ * @var int visibility Element of {ITEM_APPROVED, ITEM_DELETED, ITEM_REAPPROVE}
+ * @var int topic_id Topic of the post IDs to be modified.
+ * @var int forum_id Forum ID that the topic_id resides in.
+ * @var int user_id User ID doing this action.
+ * @var int timestamp Timestamp of this action.
+ * @var string reason Reason specified by the user for this change.
+ * @var bool force_update_all Force an update on all posts within the topic, regardless of their current approval state.
+ * @var array data The data array for this action.
+ * @since 3.1.10-RC1
+ */
+ $vars = array(
+ 'visibility',
+ 'topic_id',
+ 'forum_id',
+ 'user_id',
+ 'timestamp',
+ 'reason',
+ 'force_update_all',
+ 'data',
+ );
+ extract($this->phpbb_dispatcher->trigger_event('core.set_topic_visibility_after', compact($vars)));
+ return $data;
+ }
+
+ /**
+ * Add post to topic and forum statistics
+ *
+ * @param $data array Contains information from the topics table about given topic
+ * @param &$sql_data array Populated with the SQL changes, may be empty at call time
+ * @return null
+ */
+ public function add_post_to_statistic($data, &$sql_data)
+ {
+ $sql_data[$this->topics_table] = (($sql_data[$this->topics_table]) ? $sql_data[$this->topics_table] . ', ' : '') . 'topic_posts_approved = topic_posts_approved + 1';
+
+ $sql_data[$this->forums_table] = (($sql_data[$this->forums_table]) ? $sql_data[$this->forums_table] . ', ' : '') . 'forum_posts_approved = forum_posts_approved + 1';
+
+ if ($data['post_postcount'])
+ {
+ $sql_data[$this->users_table] = (($sql_data[$this->users_table]) ? $sql_data[$this->users_table] . ', ' : '') . 'user_posts = user_posts + 1';
+ }
+
+ $this->config->increment('num_posts', 1, false);
+ }
+
+ /**
+ * Remove post from topic and forum statistics
+ *
+ * @param $data array Contains information from the topics table about given topic
+ * @param &$sql_data array Populated with the SQL changes, may be empty at call time
+ * @return null
+ */
+ public function remove_post_from_statistic($data, &$sql_data)
+ {
+ if ($data['post_visibility'] == ITEM_APPROVED)
+ {
+ $sql_data[$this->topics_table] = ((!empty($sql_data[$this->topics_table])) ? $sql_data[$this->topics_table] . ', ' : '') . 'topic_posts_approved = topic_posts_approved - 1';
+ $sql_data[$this->forums_table] = ((!empty($sql_data[$this->forums_table])) ? $sql_data[$this->forums_table] . ', ' : '') . 'forum_posts_approved = forum_posts_approved - 1';
+
+ if ($data['post_postcount'])
+ {
+ $sql_data[$this->users_table] = ((!empty($sql_data[$this->users_table])) ? $sql_data[$this->users_table] . ', ' : '') . 'user_posts = user_posts - 1';
+ }
+
+ $this->config->increment('num_posts', -1, false);
+ }
+ else if ($data['post_visibility'] == ITEM_UNAPPROVED || $data['post_visibility'] == ITEM_REAPPROVE)
+ {
+ $sql_data[FORUMS_TABLE] = (($sql_data[FORUMS_TABLE]) ? $sql_data[FORUMS_TABLE] . ', ' : '') . 'forum_posts_unapproved = forum_posts_unapproved - 1';
+ $sql_data[TOPICS_TABLE] = (($sql_data[TOPICS_TABLE]) ? $sql_data[TOPICS_TABLE] . ', ' : '') . 'topic_posts_unapproved = topic_posts_unapproved - 1';
+ }
+ else if ($data['post_visibility'] == ITEM_DELETED)
+ {
+ $sql_data[FORUMS_TABLE] = (($sql_data[FORUMS_TABLE]) ? $sql_data[FORUMS_TABLE] . ', ' : '') . 'forum_posts_softdeleted = forum_posts_softdeleted - 1';
+ $sql_data[TOPICS_TABLE] = (($sql_data[TOPICS_TABLE]) ? $sql_data[TOPICS_TABLE] . ', ' : '') . 'topic_posts_softdeleted = topic_posts_softdeleted - 1';
+ }
+ }
+
+ /**
+ * Remove topic from forum statistics
+ *
+ * @param $data array Post and topic data
+ * @param &$sql_data array Populated with the SQL changes, may be empty at call time
+ * @return null
+ */
+ public function remove_topic_from_statistic($data, &$sql_data)
+ {
+ if ($data['topic_visibility'] == ITEM_APPROVED)
+ {
+ $sql_data[FORUMS_TABLE] .= 'forum_posts_approved = forum_posts_approved - 1, forum_topics_approved = forum_topics_approved - 1';
+
+ if ($data['post_postcount'])
+ {
+ $sql_data[$this->users_table] = ((!empty($sql_data[$this->users_table])) ? $sql_data[$this->users_table] . ', ' : '') . 'user_posts = user_posts - 1';
+ }
+ }
+ else if ($data['topic_visibility'] == ITEM_UNAPPROVED || $data['post_visibility'] == ITEM_REAPPROVE)
+ {
+ $sql_data[FORUMS_TABLE] .= 'forum_posts_unapproved = forum_posts_unapproved - 1, forum_topics_unapproved = forum_topics_unapproved - 1';
+ }
+ else if ($data['topic_visibility'] == ITEM_DELETED)
+ {
+ $sql_data[FORUMS_TABLE] .= 'forum_posts_softdeleted = forum_posts_softdeleted - 1, forum_topics_softdeleted = forum_topics_softdeleted - 1';
+ }
+
+ }
+}
diff --git a/phpBB/phpbb/controller/exception.php b/phpBB/phpbb/controller/exception.php
new file mode 100644
index 0000000000..437558b06a
--- /dev/null
+++ b/phpBB/phpbb/controller/exception.php
@@ -0,0 +1,21 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\controller;
+
+/**
+* Controller exception class
+*/
+class exception extends \RuntimeException
+{
+}
diff --git a/phpBB/phpbb/controller/helper.php b/phpBB/phpbb/controller/helper.php
new file mode 100644
index 0000000000..ce6bfba981
--- /dev/null
+++ b/phpBB/phpbb/controller/helper.php
@@ -0,0 +1,267 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\controller;
+
+use Symfony\Component\HttpFoundation\JsonResponse;
+use Symfony\Component\HttpFoundation\Response;
+use Symfony\Component\Routing\Generator\UrlGenerator;
+use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
+use Symfony\Component\Routing\RequestContext;
+
+/**
+* Controller helper class, contains methods that do things for controllers
+*/
+class helper
+{
+ /**
+ * Template object
+ * @var \phpbb\template\template
+ */
+ protected $template;
+
+ /**
+ * User object
+ * @var \phpbb\user
+ */
+ protected $user;
+
+ /**
+ * config object
+ * @var \phpbb\config\config
+ */
+ protected $config;
+
+ /* @var \phpbb\symfony_request */
+ protected $symfony_request;
+
+ /* @var \phpbb\request\request_interface */
+ protected $request;
+
+ /**
+ * @var \phpbb\filesystem The filesystem object
+ */
+ protected $filesystem;
+
+ /**
+ * phpBB root path
+ * @var string
+ */
+ protected $phpbb_root_path;
+
+ /**
+ * PHP file extension
+ * @var string
+ */
+ protected $php_ext;
+
+ /**
+ * Constructor
+ *
+ * @param \phpbb\template\template $template Template object
+ * @param \phpbb\user $user User object
+ * @param \phpbb\config\config $config Config object
+ *
+ * @param \phpbb\controller\provider $provider Path provider
+ * @param \phpbb\extension\manager $manager Extension manager object
+ * @param \phpbb\symfony_request $symfony_request Symfony Request object
+ * @param \phpbb\request\request_interface $request phpBB request object
+ * @param \phpbb\filesystem $filesystem The filesystem object
+ * @param string $phpbb_root_path phpBB root path
+ * @param string $php_ext PHP file extension
+ */
+ public function __construct(\phpbb\template\template $template, \phpbb\user $user, \phpbb\config\config $config, \phpbb\controller\provider $provider, \phpbb\extension\manager $manager, \phpbb\symfony_request $symfony_request, \phpbb\request\request_interface $request, \phpbb\filesystem $filesystem, $phpbb_root_path, $php_ext)
+ {
+ $this->template = $template;
+ $this->user = $user;
+ $this->config = $config;
+ $this->symfony_request = $symfony_request;
+ $this->request = $request;
+ $this->filesystem = $filesystem;
+ $this->phpbb_root_path = $phpbb_root_path;
+ $this->php_ext = $php_ext;
+ $provider->find_routing_files($manager->get_finder());
+ $this->route_collection = $provider->find($phpbb_root_path)->get_routes();
+ }
+
+ /**
+ * Automate setting up the page and creating the response object.
+ *
+ * @param string $template_file The template handle to render
+ * @param string $page_title The title of the page to output
+ * @param int $status_code The status code to be sent to the page header
+ * @param bool $display_online_list Do we display online users list
+ * @param int $item_id Restrict online users to item id
+ * @param string $item Restrict online users to a certain session item, e.g. forum for session_forum_id
+ * @param bool $send_headers Whether headers should be sent by page_header(). Defaults to false for controllers.
+ *
+ * @return Response object containing rendered page
+ */
+ public function render($template_file, $page_title = '', $status_code = 200, $display_online_list = false, $item_id = 0, $item = 'forum', $send_headers = false)
+ {
+ page_header($page_title, $display_online_list, $item_id, $item, $send_headers);
+
+ $this->template->set_filenames(array(
+ 'body' => $template_file,
+ ));
+
+ page_footer(true, false, false);
+
+ $headers = !empty($this->user->data['is_bot']) ? array('X-PHPBB-IS-BOT' => 'yes') : array();
+
+ return new Response($this->template->assign_display('body'), $status_code, $headers);
+ }
+
+ /**
+ * Generate a URL to a route
+ *
+ * @param string $route Name of the route to travel
+ * @param array $params String or array of additional url parameters
+ * @param bool $is_amp Is url using &amp; (true) or & (false)
+ * @param string|bool $session_id Possibility to use a custom session id instead of the global one
+ * @param bool|string $reference_type The type of reference to be generated (one of the constants)
+ * @return string The URL already passed through append_sid()
+ */
+ public function route($route, array $params = array(), $is_amp = true, $session_id = false, $reference_type = UrlGeneratorInterface::ABSOLUTE_PATH)
+ {
+ $anchor = '';
+ if (isset($params['#']))
+ {
+ $anchor = '#' . $params['#'];
+ unset($params['#']);
+ }
+
+ $context = new RequestContext();
+ $context->fromRequest($this->symfony_request);
+
+ if ($this->config['force_server_vars'])
+ {
+ $context->setHost($this->config['server_name']);
+ $context->setScheme(substr($this->config['server_protocol'], 0, -3));
+ $context->setHttpPort($this->config['server_port']);
+ $context->setHttpsPort($this->config['server_port']);
+ $context->setBaseUrl(rtrim($this->config['script_path'], '/'));
+ }
+
+ $script_name = $this->symfony_request->getScriptName();
+ $page_name = substr($script_name, -1, 1) == '/' ? '' : utf8_basename($script_name);
+
+ $base_url = $context->getBaseUrl();
+
+ // Append page name if base URL does not contain it
+ if (!empty($page_name) && strpos($base_url, '/' . $page_name) === false)
+ {
+ $base_url .= '/' . $page_name;
+ }
+
+ // If enable_mod_rewrite is false we need to replace the current front-end by app.php, otherwise we need to remove it.
+ $base_url = str_replace('/' . $page_name, empty($this->config['enable_mod_rewrite']) ? '/app.' . $this->php_ext : '', $base_url);
+
+ // We need to update the base url to move to the directory of the app.php file if the current script is not app.php
+ if ($page_name !== 'app.php' && !$this->config['force_server_vars'])
+ {
+ if (empty($this->config['enable_mod_rewrite']))
+ {
+ $base_url = str_replace('/app.' . $this->php_ext, '/' . $this->phpbb_root_path . 'app.' . $this->php_ext, $base_url);
+ }
+ else
+ {
+ $base_url .= preg_replace(get_preg_expression('path_remove_dot_trailing_slash'), '$2', $this->phpbb_root_path);
+ }
+ }
+
+ $base_url = $this->request->escape($this->filesystem->clean_path($base_url), true);
+
+ $context->setBaseUrl($base_url);
+
+ $url_generator = new UrlGenerator($this->route_collection, $context);
+ $route_url = $url_generator->generate($route, $params, $reference_type);
+
+ if ($is_amp)
+ {
+ $route_url = str_replace(array('&amp;', '&'), array('&', '&amp;'), $route_url);
+ }
+
+ if ($reference_type === UrlGeneratorInterface::RELATIVE_PATH && empty($this->config['enable_mod_rewrite']))
+ {
+ $route_url = 'app.' . $this->php_ext . '/' . $route_url;
+ }
+
+ return append_sid($route_url . $anchor, false, $is_amp, $session_id, true);
+ }
+
+ /**
+ * Output an error, effectively the same thing as trigger_error
+ *
+ * @param string $message The error message
+ * @param int $code The error code (e.g. 404, 500, 503, etc.)
+ * @return Response A Response instance
+ *
+ * @deprecated 3.1.3 (To be removed: 3.3.0) Use exceptions instead.
+ */
+ public function error($message, $code = 500)
+ {
+ return $this->message($message, array(), 'INFORMATION', $code);
+ }
+
+ /**
+ * Output a message
+ *
+ * In case of an error, please throw an exception instead
+ *
+ * @param string $message The message to display (must be a language variable)
+ * @param array $parameters The parameters to use with the language var
+ * @param string $title Title for the message (must be a language variable)
+ * @param int $code The HTTP status code (e.g. 404, 500, 503, etc.)
+ * @return Response A Response instance
+ */
+ public function message($message, array $parameters = array(), $title = 'INFORMATION', $code = 200)
+ {
+ array_unshift($parameters, $message);
+ $message_text = call_user_func_array(array($this->user, 'lang'), $parameters);
+ $message_title = $this->user->lang($title);
+
+ if ($this->request->is_ajax())
+ {
+ global $refresh_data;
+
+ return new JsonResponse(
+ array(
+ 'MESSAGE_TITLE' => $message_title,
+ 'MESSAGE_TEXT' => $message_text,
+ 'S_USER_WARNING' => false,
+ 'S_USER_NOTICE' => false,
+ 'REFRESH_DATA' => (!empty($refresh_data)) ? $refresh_data : null
+ ),
+ $code
+ );
+ }
+
+ $this->template->assign_vars(array(
+ 'MESSAGE_TEXT' => $message_text,
+ 'MESSAGE_TITLE' => $message_title,
+ ));
+
+ return $this->render('message_body.html', $message_title, $code);
+ }
+
+ /**
+ * Return the current url
+ *
+ * @return string
+ */
+ public function get_current_url()
+ {
+ return generate_board_url(true) . $this->request->escape($this->symfony_request->getRequestUri(), true);
+ }
+}
diff --git a/phpBB/phpbb/controller/provider.php b/phpBB/phpbb/controller/provider.php
new file mode 100644
index 0000000000..7e26848290
--- /dev/null
+++ b/phpBB/phpbb/controller/provider.php
@@ -0,0 +1,92 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\controller;
+
+use Symfony\Component\Routing\RouteCollection;
+use Symfony\Component\Routing\Loader\YamlFileLoader;
+use Symfony\Component\Config\FileLocator;
+
+/**
+* Controller interface
+*/
+class provider
+{
+ /**
+ * YAML file(s) containing route information
+ * @var array
+ */
+ protected $routing_files;
+
+ /**
+ * Collection of the routes in phpBB and all found extensions
+ * @var RouteCollection
+ */
+ protected $routes;
+
+ /**
+ * Construct method
+ *
+ * @param array $routing_files Array of strings containing paths
+ * to YAML files holding route information
+ */
+ public function __construct($routing_files = array())
+ {
+ $this->routing_files = $routing_files;
+ }
+
+ /**
+ * Find the list of routing files
+ *
+ * @param \phpbb\finder $finder
+ * @return null
+ */
+ public function find_routing_files(\phpbb\finder $finder)
+ {
+ // We hardcode the path to the core config directory
+ // because the finder cannot find it
+ $this->routing_files = array_merge($this->routing_files, array('config/routing.yml'), array_keys($finder
+ ->directory('/config')
+ ->suffix('routing.yml')
+ ->find()
+ ));
+ }
+
+ /**
+ * Find a list of controllers
+ *
+ * @param string $base_path Base path to prepend to file paths
+ * @return provider
+ */
+ public function find($base_path = '')
+ {
+ $this->routes = new RouteCollection;
+ foreach ($this->routing_files as $file_path)
+ {
+ $loader = new YamlFileLoader(new FileLocator(phpbb_realpath($base_path)));
+ $this->routes->addCollection($loader->load($file_path));
+ }
+
+ return $this;
+ }
+
+ /**
+ * Get the list of routes
+ *
+ * @return RouteCollection Get the route collection
+ */
+ public function get_routes()
+ {
+ return $this->routes;
+ }
+}
diff --git a/phpBB/phpbb/controller/resolver.php b/phpBB/phpbb/controller/resolver.php
new file mode 100644
index 0000000000..948a6a218c
--- /dev/null
+++ b/phpBB/phpbb/controller/resolver.php
@@ -0,0 +1,175 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\controller;
+
+use Symfony\Component\HttpKernel\Controller\ControllerResolverInterface;
+use Symfony\Component\DependencyInjection\ContainerInterface;
+use Symfony\Component\HttpFoundation\Request;
+
+/**
+* Controller manager class
+*/
+class resolver implements ControllerResolverInterface
+{
+ /**
+ * User object
+ * @var \phpbb\user
+ */
+ protected $user;
+
+ /**
+ * ContainerInterface object
+ * @var ContainerInterface
+ */
+ protected $container;
+
+ /**
+ * phpbb\template\template object
+ * @var \phpbb\template\template
+ */
+ protected $template;
+
+ /**
+ * Request type cast helper object
+ * @var \phpbb\request\type_cast_helper
+ */
+ protected $type_cast_helper;
+
+ /**
+ * phpBB root path
+ * @var string
+ */
+ protected $phpbb_root_path;
+
+ /**
+ * Construct method
+ *
+ * @param \phpbb\user $user User Object
+ * @param ContainerInterface $container ContainerInterface object
+ * @param string $phpbb_root_path Relative path to phpBB root
+ * @param \phpbb\template\template $template
+ */
+ public function __construct(\phpbb\user $user, ContainerInterface $container, $phpbb_root_path, \phpbb\template\template $template = null)
+ {
+ $this->user = $user;
+ $this->container = $container;
+ $this->template = $template;
+ $this->type_cast_helper = new \phpbb\request\type_cast_helper();
+ $this->phpbb_root_path = $phpbb_root_path;
+ }
+
+ /**
+ * Load a controller callable
+ *
+ * @param \Symfony\Component\HttpFoundation\Request $request Symfony Request object
+ * @return bool|Callable Callable or false
+ * @throws \phpbb\controller\exception
+ */
+ public function getController(Request $request)
+ {
+ $controller = $request->attributes->get('_controller');
+
+ if (!$controller)
+ {
+ throw new \phpbb\controller\exception($this->user->lang['CONTROLLER_NOT_SPECIFIED']);
+ }
+
+ // Require a method name along with the service name
+ if (stripos($controller, ':') === false)
+ {
+ throw new \phpbb\controller\exception($this->user->lang['CONTROLLER_METHOD_NOT_SPECIFIED']);
+ }
+
+ list($service, $method) = explode(':', $controller);
+
+ if (!$this->container->has($service))
+ {
+ throw new \phpbb\controller\exception($this->user->lang('CONTROLLER_SERVICE_UNDEFINED', $service));
+ }
+
+ $controller_object = $this->container->get($service);
+
+ /*
+ * If this is an extension controller, we'll try to automatically set
+ * the style paths for the extension (the ext author can change them
+ * if necessary).
+ */
+ $controller_dir = explode('\\', get_class($controller_object));
+
+ // 0 vendor, 1 extension name, ...
+ if (!is_null($this->template) && isset($controller_dir[1]))
+ {
+ $controller_style_dir = 'ext/' . $controller_dir[0] . '/' . $controller_dir[1] . '/styles';
+
+ if (is_dir($this->phpbb_root_path . $controller_style_dir))
+ {
+ $this->template->set_style(array($controller_style_dir, 'styles'));
+ }
+ }
+
+ return array($controller_object, $method);
+ }
+
+ /**
+ * Dependencies should be specified in the service definition and can be
+ * then accessed in __construct(). Arguments are sent through the URL path
+ * and should match the parameters of the method you are using as your
+ * controller.
+ *
+ * @param \Symfony\Component\HttpFoundation\Request $request Symfony Request object
+ * @param mixed $controller A callable (controller class, method)
+ * @return array An array of arguments to pass to the controller
+ * @throws \phpbb\controller\exception
+ */
+ public function getArguments(Request $request, $controller)
+ {
+ // At this point, $controller contains the object and method name
+ list($object, $method) = $controller;
+ $mirror = new \ReflectionMethod($object, $method);
+
+ $arguments = array();
+ $parameters = $mirror->getParameters();
+ $attributes = $request->attributes->all();
+ foreach ($parameters as $param)
+ {
+ if (array_key_exists($param->name, $attributes))
+ {
+ if (is_string($attributes[$param->name]))
+ {
+ $value = $attributes[$param->name];
+ $this->type_cast_helper->set_var($value, $attributes[$param->name], 'string', true, false);
+ $arguments[] = $value;
+ }
+ else
+ {
+ $arguments[] = $attributes[$param->name];
+ }
+ }
+ else if ($param->getClass() && $param->getClass()->isInstance($request))
+ {
+ $arguments[] = $request;
+ }
+ else if ($param->isDefaultValueAvailable())
+ {
+ $arguments[] = $param->getDefaultValue();
+ }
+ else
+ {
+ throw new \phpbb\controller\exception($this->user->lang('CONTROLLER_ARGUMENT_VALUE_MISSING', $param->getPosition() + 1, get_class($object) . ':' . $method, $param->name));
+ }
+ }
+
+ return $arguments;
+ }
+}
diff --git a/phpBB/phpbb/cron/manager.php b/phpBB/phpbb/cron/manager.php
new file mode 100644
index 0000000000..9bd30a0a5b
--- /dev/null
+++ b/phpBB/phpbb/cron/manager.php
@@ -0,0 +1,147 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\cron;
+
+/**
+* Cron manager class.
+*
+* Finds installed cron tasks, stores task objects, provides task selection.
+*/
+class manager
+{
+ /**
+ * Set of \phpbb\cron\task\wrapper objects.
+ * Array holding all tasks that have been found.
+ *
+ * @var array
+ */
+ protected $tasks = array();
+
+ protected $phpbb_root_path;
+ protected $php_ext;
+
+ /**
+ * Constructor. Loads all available tasks.
+ *
+ * @param array|\Traversable $tasks Provides an iterable set of task names
+ * @param string $phpbb_root_path Relative path to phpBB root
+ * @param string $php_ext PHP file extension
+ */
+ public function __construct($tasks, $phpbb_root_path, $php_ext)
+ {
+ $this->phpbb_root_path = $phpbb_root_path;
+ $this->php_ext = $php_ext;
+
+ $this->load_tasks($tasks);
+ }
+
+ /**
+ * Loads tasks given by name, wraps them
+ * and puts them into $this->tasks.
+ *
+ * @param array|\Traversable $tasks Array of instances of \phpbb\cron\task\task
+ *
+ * @return null
+ */
+ public function load_tasks($tasks)
+ {
+ foreach ($tasks as $task)
+ {
+ $this->tasks[] = $this->wrap_task($task);
+ }
+ }
+
+ /**
+ * Finds a task that is ready to run.
+ *
+ * If several tasks are ready, any one of them could be returned.
+ *
+ * If no tasks are ready, null is returned.
+ *
+ * @return \phpbb\cron\task\wrapper|null
+ */
+ public function find_one_ready_task()
+ {
+ shuffle($this->tasks);
+ foreach ($this->tasks as $task)
+ {
+ if ($task->is_ready())
+ {
+ return $task;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Finds all tasks that are ready to run.
+ *
+ * @return array List of tasks which are ready to run (wrapped in \phpbb\cron\task\wrapper).
+ */
+ public function find_all_ready_tasks()
+ {
+ $tasks = array();
+ foreach ($this->tasks as $task)
+ {
+ if ($task->is_ready())
+ {
+ $tasks[] = $task;
+ }
+ }
+ return $tasks;
+ }
+
+ /**
+ * Finds a task by name.
+ *
+ * If there is no task with the specified name, null is returned.
+ *
+ * Web runner uses this method to resolve names to tasks.
+ *
+ * @param string $name Name of the task to look up.
+ * @return \phpbb\cron\task\wrapper A wrapped task corresponding to the given name, or null.
+ */
+ public function find_task($name)
+ {
+ foreach ($this->tasks as $task)
+ {
+ if ($task->get_name() == $name)
+ {
+ return $task;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Find all tasks and return them.
+ *
+ * @return array List of all tasks.
+ */
+ public function get_tasks()
+ {
+ return $this->tasks;
+ }
+
+ /**
+ * Wraps a task inside an instance of \phpbb\cron\task\wrapper.
+ *
+ * @param \phpbb\cron\task\task $task The task.
+ * @return \phpbb\cron\task\wrapper The wrapped task.
+ */
+ public function wrap_task(\phpbb\cron\task\task $task)
+ {
+ return new \phpbb\cron\task\wrapper($task, $this->phpbb_root_path, $this->php_ext);
+ }
+}
diff --git a/phpBB/phpbb/cron/task/base.php b/phpBB/phpbb/cron/task/base.php
new file mode 100644
index 0000000000..57c9912d31
--- /dev/null
+++ b/phpBB/phpbb/cron/task/base.php
@@ -0,0 +1,72 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\cron\task;
+
+/**
+* Cron task base class. Provides sensible defaults for cron tasks
+* and partially implements cron task interface, making writing cron tasks easier.
+*
+* At a minimum, subclasses must override the run() method.
+*
+* Cron tasks need not inherit from this base class. If desired,
+* they may implement cron task interface directly.
+*/
+abstract class base implements \phpbb\cron\task\task
+{
+ private $name;
+
+ /**
+ * Returns the name of the task.
+ *
+ * @return string Name of wrapped task.
+ */
+ public function get_name()
+ {
+ return $this->name;
+ }
+
+ /**
+ * Sets the name of the task.
+ *
+ * @param string $name The task name
+ */
+ public function set_name($name)
+ {
+ $this->name = $name;
+ }
+
+ /**
+ * Returns whether this cron task can run, given current board configuration.
+ *
+ * For example, a cron task that prunes forums can only run when
+ * forum pruning is enabled.
+ *
+ * @return bool
+ */
+ public function is_runnable()
+ {
+ return true;
+ }
+
+ /**
+ * Returns whether this cron task should run now, because enough time
+ * has passed since it was last run.
+ *
+ * @return bool
+ */
+ public function should_run()
+ {
+ return true;
+ }
+}
diff --git a/phpBB/phpbb/cron/task/core/prune_all_forums.php b/phpBB/phpbb/cron/task/core/prune_all_forums.php
new file mode 100644
index 0000000000..b47939ccbe
--- /dev/null
+++ b/phpBB/phpbb/cron/task/core/prune_all_forums.php
@@ -0,0 +1,89 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\cron\task\core;
+
+/**
+* Prune all forums cron task.
+*
+* It is intended to be invoked from system cron.
+* This task will find all forums for which pruning is enabled, and will
+* prune all forums as necessary.
+*/
+class prune_all_forums extends \phpbb\cron\task\base
+{
+ protected $phpbb_root_path;
+ protected $php_ext;
+ protected $config;
+ protected $db;
+
+ /**
+ * Constructor.
+ *
+ * @param string $phpbb_root_path The root path
+ * @param string $php_ext The PHP file extension
+ * @param \phpbb\config\config $config The config
+ * @param \phpbb\db\driver\driver_interface $db The db connection
+ */
+ public function __construct($phpbb_root_path, $php_ext, \phpbb\config\config $config, \phpbb\db\driver\driver_interface $db)
+ {
+ $this->phpbb_root_path = $phpbb_root_path;
+ $this->php_ext = $php_ext;
+ $this->config = $config;
+ $this->db = $db;
+ }
+
+ /**
+ * Runs this cron task.
+ *
+ * @return null
+ */
+ public function run()
+ {
+ if (!function_exists('auto_prune'))
+ {
+ include($this->phpbb_root_path . 'includes/functions_admin.' . $this->php_ext);
+ }
+
+ $sql = 'SELECT forum_id, prune_next, enable_prune, prune_days, prune_viewed, forum_flags, prune_freq
+ FROM ' . FORUMS_TABLE . "
+ WHERE enable_prune = 1
+ AND prune_next < " . time();
+ $result = $this->db->sql_query($sql);
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ if ($row['prune_days'])
+ {
+ auto_prune($row['forum_id'], 'posted', $row['forum_flags'], $row['prune_days'], $row['prune_freq']);
+ }
+
+ if ($row['prune_viewed'])
+ {
+ auto_prune($row['forum_id'], 'viewed', $row['forum_flags'], $row['prune_viewed'], $row['prune_freq']);
+ }
+ }
+ $this->db->sql_freeresult($result);
+ }
+
+ /**
+ * Returns whether this cron task can run, given current board configuration.
+ *
+ * This cron task will only run when system cron is utilised.
+ *
+ * @return bool
+ */
+ public function is_runnable()
+ {
+ return (bool) $this->config['use_system_cron'];
+ }
+}
diff --git a/phpBB/phpbb/cron/task/core/prune_forum.php b/phpBB/phpbb/cron/task/core/prune_forum.php
new file mode 100644
index 0000000000..ba68565197
--- /dev/null
+++ b/phpBB/phpbb/cron/task/core/prune_forum.php
@@ -0,0 +1,159 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\cron\task\core;
+
+/**
+* Prune one forum cron task.
+*
+* It is intended to be used when cron is invoked via web.
+* This task can decide whether it should be run using data obtained by viewforum
+* code, without making additional database queries.
+*/
+class prune_forum extends \phpbb\cron\task\base implements \phpbb\cron\task\parametrized
+{
+ protected $phpbb_root_path;
+ protected $php_ext;
+ protected $config;
+ protected $db;
+
+ /**
+ * If $forum_data is given, it is assumed to contain necessary information
+ * about a single forum that is to be pruned.
+ *
+ * If $forum_data is not given, forum id will be retrieved via request_var
+ * and a database query will be performed to load the necessary information
+ * about the forum.
+ */
+ protected $forum_data;
+
+ /**
+ * Constructor.
+ *
+ * @param string $phpbb_root_path The root path
+ * @param string $php_ext PHP file extension
+ * @param \phpbb\config\config $config The config
+ * @param \phpbb\db\driver\driver_interface $db The db connection
+ */
+ public function __construct($phpbb_root_path, $php_ext, \phpbb\config\config $config, \phpbb\db\driver\driver_interface $db)
+ {
+ $this->phpbb_root_path = $phpbb_root_path;
+ $this->php_ext = $php_ext;
+ $this->config = $config;
+ $this->db = $db;
+ }
+
+ /**
+ * Manually set forum data.
+ *
+ * @param array $forum_data Information about a forum to be pruned.
+ */
+ public function set_forum_data($forum_data)
+ {
+ $this->forum_data = $forum_data;
+ }
+
+ /**
+ * Runs this cron task.
+ *
+ * @return null
+ */
+ public function run()
+ {
+ if (!function_exists('auto_prune'))
+ {
+ include($this->phpbb_root_path . 'includes/functions_admin.' . $this->php_ext);
+ }
+
+ if ($this->forum_data['prune_days'])
+ {
+ auto_prune($this->forum_data['forum_id'], 'posted', $this->forum_data['forum_flags'], $this->forum_data['prune_days'], $this->forum_data['prune_freq']);
+ }
+
+ if ($this->forum_data['prune_viewed'])
+ {
+ auto_prune($this->forum_data['forum_id'], 'viewed', $this->forum_data['forum_flags'], $this->forum_data['prune_viewed'], $this->forum_data['prune_freq']);
+ }
+ }
+
+ /**
+ * Returns whether this cron task can run, given current board configuration.
+ *
+ * This cron task will not run when system cron is utilised, as in
+ * such cases prune_all_forums task would run instead.
+ *
+ * Additionally, this task must be given the forum data, either via
+ * the constructor or parse_parameters method.
+ *
+ * @return bool
+ */
+ public function is_runnable()
+ {
+ return !$this->config['use_system_cron'] && $this->forum_data;
+ }
+
+ /**
+ * Returns whether this cron task should run now, because enough time
+ * has passed since it was last run.
+ *
+ * Forum pruning interval is specified in the forum data.
+ *
+ * @return bool
+ */
+ public function should_run()
+ {
+ return $this->forum_data['enable_prune'] && $this->forum_data['prune_next'] < time();
+ }
+
+ /**
+ * Returns parameters of this cron task as an array.
+ * The array has one key, f, whose value is id of the forum to be pruned.
+ *
+ * @return array
+ */
+ public function get_parameters()
+ {
+ return array('f' => $this->forum_data['forum_id']);
+ }
+
+ /**
+ * Parses parameters found in $request, which is an instance of
+ * \phpbb\request\request_interface.
+ *
+ * It is expected to have a key f whose value is id of the forum to be pruned.
+ *
+ * @param \phpbb\request\request_interface $request Request object.
+ *
+ * @return null
+ */
+ public function parse_parameters(\phpbb\request\request_interface $request)
+ {
+ $this->forum_data = null;
+ if ($request->is_set('f'))
+ {
+ $forum_id = $request->variable('f', 0);
+
+ $sql = 'SELECT forum_id, prune_next, enable_prune, prune_days, prune_viewed, forum_flags, prune_freq
+ FROM ' . FORUMS_TABLE . "
+ WHERE forum_id = $forum_id";
+ $result = $this->db->sql_query($sql);
+ $row = $this->db->sql_fetchrow($result);
+ $this->db->sql_freeresult($result);
+
+ if ($row)
+ {
+ $this->forum_data = $row;
+ }
+ }
+ }
+}
diff --git a/phpBB/phpbb/cron/task/core/prune_notifications.php b/phpBB/phpbb/cron/task/core/prune_notifications.php
new file mode 100644
index 0000000000..ffa7e17970
--- /dev/null
+++ b/phpBB/phpbb/cron/task/core/prune_notifications.php
@@ -0,0 +1,61 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\cron\task\core;
+
+/**
+* Prune notifications cron task.
+*/
+class prune_notifications extends \phpbb\cron\task\base
+{
+ protected $config;
+ protected $notification_manager;
+
+ /**
+ * Constructor.
+ *
+ * @param \phpbb\config\config $config The config
+ * @param \phpbb\notification\manager $notification_manager Notification manager
+ */
+ public function __construct(\phpbb\config\config $config, \phpbb\notification\manager $notification_manager)
+ {
+ $this->config = $config;
+ $this->notification_manager = $notification_manager;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function run()
+ {
+ // time minus expire days in seconds
+ $timestamp = time() - ($this->config['read_notification_expire_days'] * 60 * 60 * 24);
+ $this->notification_manager->prune_notifications($timestamp);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function is_runnable()
+ {
+ return (bool) $this->config['read_notification_expire_days'];
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function should_run()
+ {
+ return $this->config['read_notification_last_gc'] < time() - $this->config['read_notification_gc'];
+ }
+}
diff --git a/phpBB/phpbb/cron/task/core/prune_shadow_topics.php b/phpBB/phpbb/cron/task/core/prune_shadow_topics.php
new file mode 100644
index 0000000000..97a4b0ea86
--- /dev/null
+++ b/phpBB/phpbb/cron/task/core/prune_shadow_topics.php
@@ -0,0 +1,200 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\cron\task\core;
+
+/**
+* Prune one forum of its shadow topics cron task.
+*
+* It is intended to be used when cron is invoked via web.
+* This task can decide whether it should be run using data obtained by viewforum
+* code, without making additional database queries.
+*/
+class prune_shadow_topics extends \phpbb\cron\task\base implements \phpbb\cron\task\parametrized
+{
+ protected $phpbb_root_path;
+ protected $php_ext;
+ protected $config;
+ protected $db;
+ protected $log;
+ protected $user;
+
+ /**
+ * If $forum_data is given, it is assumed to contain necessary information
+ * about a single forum that is to be pruned.
+ *
+ * If $forum_data is not given, forum id will be retrieved via request_var
+ * and a database query will be performed to load the necessary information
+ * about the forum.
+ */
+ protected $forum_data;
+
+ /**
+ * Constructor.
+ *
+ * @param string $phpbb_root_path The root path
+ * @param string $php_ext PHP file extension
+ * @param \phpbb\config\config $config The config
+ * @param \phpbb\db\driver\driver_interface $db The db connection
+ * @param \phpbb\log\log $log The phpBB log system
+ * @param \phpbb\user $user The phpBB user object
+ */
+ public function __construct($phpbb_root_path, $php_ext, \phpbb\config\config $config, \phpbb\db\driver\driver_interface $db, \phpbb\log\log $log, \phpbb\user $user)
+ {
+ $this->phpbb_root_path = $phpbb_root_path;
+ $this->php_ext = $php_ext;
+ $this->config = $config;
+ $this->db = $db;
+ $this->log = $log;
+ $this->user = $user;
+ }
+
+ /**
+ * Manually set forum data.
+ *
+ * @param array $forum_data Information about a forum to be pruned.
+ */
+ public function set_forum_data($forum_data)
+ {
+ $this->forum_data = $forum_data;
+ }
+
+ /**
+ * Runs this cron task.
+ *
+ * @return null
+ */
+ public function run()
+ {
+ if (!function_exists('auto_prune'))
+ {
+ include($this->phpbb_root_path . 'includes/functions_admin.' . $this->php_ext);
+ }
+
+ if ($this->forum_data['prune_shadow_days'])
+ {
+ $this->auto_prune_shadow_topics($this->forum_data['forum_id'], 'shadow', $this->forum_data['forum_flags'], $this->forum_data['prune_shadow_days'], $this->forum_data['prune_shadow_freq']);
+ }
+ }
+
+ /**
+ * Returns whether this cron task can run, given current board configuration.
+ *
+ * This cron task will not run when system cron is utilised, as in
+ * such cases prune_all_forums task would run instead.
+ *
+ * Additionally, this task must be given the forum data, either via
+ * the constructor or parse_parameters method.
+ *
+ * @return bool
+ */
+ public function is_runnable()
+ {
+ return !$this->config['use_system_cron'] && $this->forum_data;
+ }
+
+ /**
+ * Returns whether this cron task should run now, because enough time
+ * has passed since it was last run.
+ *
+ * Forum pruning interval is specified in the forum data.
+ *
+ * @return bool
+ */
+ public function should_run()
+ {
+ return $this->forum_data['enable_shadow_prune'] && $this->forum_data['prune_shadow_next'] < time();
+ }
+
+ /**
+ * Returns parameters of this cron task as an array.
+ * The array has one key, f, whose value is id of the forum to be pruned.
+ *
+ * @return array
+ */
+ public function get_parameters()
+ {
+ return array('f' => $this->forum_data['forum_id']);
+ }
+
+ /**
+ * Parses parameters found in $request, which is an instance of
+ * \phpbb\request\request_interface.
+ *
+ * It is expected to have a key f whose value is id of the forum to be pruned.
+ *
+ * @param \phpbb\request\request_interface $request Request object.
+ *
+ * @return null
+ */
+ public function parse_parameters(\phpbb\request\request_interface $request)
+ {
+ $this->forum_data = null;
+ if ($request->is_set('f'))
+ {
+ $forum_id = $request->variable('f', 0);
+
+ $sql = 'SELECT forum_id, prune_shadow_next, enable_shadow_prune, prune_shadow_days, forum_flags, prune_shadow_freq
+ FROM ' . FORUMS_TABLE . "
+ WHERE forum_id = $forum_id";
+ $result = $this->db->sql_query($sql);
+ $row = $this->db->sql_fetchrow($result);
+ $this->db->sql_freeresult($result);
+
+ if ($row)
+ {
+ $this->forum_data = $row;
+ }
+ }
+ }
+
+ /**
+ * Automatically prune shadow topics
+ * Based on fuunction auto_prune()
+ * @param int $forum_id Forum ID of forum that should be pruned
+ * @param string $prune_mode Prune mode
+ * @param int $prune_flags Prune flags
+ * @param int $prune_days Prune date in days
+ * @param int $prune_freq Prune frequency
+ * @return null
+ */
+ protected function auto_prune_shadow_topics($forum_id, $prune_mode, $prune_flags, $prune_days, $prune_freq)
+ {
+ $sql = 'SELECT forum_name
+ FROM ' . FORUMS_TABLE . "
+ WHERE forum_id = $forum_id";
+ $result = $this->db->sql_query($sql, 3600);
+ $row = $this->db->sql_fetchrow($result);
+ $this->db->sql_freeresult($result);
+
+ if ($row)
+ {
+ $prune_date = time() - ($prune_days * 86400);
+ $next_prune = time() + ($prune_freq * 86400);
+
+ prune($forum_id, $prune_mode, $prune_date, $prune_flags, true);
+
+ $sql = 'UPDATE ' . FORUMS_TABLE . "
+ SET prune_shadow_next = $next_prune
+ WHERE forum_id = $forum_id";
+ $this->db->sql_query($sql);
+
+ $user_id = (empty($this->user->data)) ? ANONYMOUS : $this->user->data['user_id'];
+ $user_ip = (empty($this->user->ip)) ? '' : $this->user->ip;
+
+ $this->log->add('admin', $user_id, $user_ip, 'LOG_PRUNE_SHADOW', false, array($row['forum_name']));
+ }
+
+ return;
+ }
+}
diff --git a/phpBB/phpbb/cron/task/core/queue.php b/phpBB/phpbb/cron/task/core/queue.php
new file mode 100644
index 0000000000..a9345a44df
--- /dev/null
+++ b/phpBB/phpbb/cron/task/core/queue.php
@@ -0,0 +1,78 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\cron\task\core;
+
+/**
+* Queue cron task. Sends email and jabber messages queued by other scripts.
+*/
+class queue extends \phpbb\cron\task\base
+{
+ protected $phpbb_root_path;
+ protected $php_ext;
+ protected $config;
+
+ /**
+ * Constructor.
+ *
+ * @param string $phpbb_root_path The root path
+ * @param string $php_ext PHP file extension
+ * @param \phpbb\config\config $config The config
+ */
+ public function __construct($phpbb_root_path, $php_ext, \phpbb\config\config $config)
+ {
+ $this->phpbb_root_path = $phpbb_root_path;
+ $this->php_ext = $php_ext;
+ $this->config = $config;
+ }
+
+ /**
+ * Runs this cron task.
+ *
+ * @return null
+ */
+ public function run()
+ {
+ if (!class_exists('queue'))
+ {
+ include($this->phpbb_root_path . 'includes/functions_messenger.' . $this->php_ext);
+ }
+ $queue = new \queue();
+ $queue->process();
+ }
+
+ /**
+ * Returns whether this cron task can run, given current board configuration.
+ *
+ * Queue task is only run if the email queue (file) exists.
+ *
+ * @return bool
+ */
+ public function is_runnable()
+ {
+ return file_exists($this->phpbb_root_path . 'cache/queue.' . $this->php_ext);
+ }
+
+ /**
+ * Returns whether this cron task should run now, because enough time
+ * has passed since it was last run.
+ *
+ * The interval between queue runs is specified in board configuration.
+ *
+ * @return bool
+ */
+ public function should_run()
+ {
+ return $this->config['last_queue_run'] < time() - $this->config['queue_interval'];
+ }
+}
diff --git a/phpBB/phpbb/cron/task/core/tidy_cache.php b/phpBB/phpbb/cron/task/core/tidy_cache.php
new file mode 100644
index 0000000000..506a245f0f
--- /dev/null
+++ b/phpBB/phpbb/cron/task/core/tidy_cache.php
@@ -0,0 +1,72 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\cron\task\core;
+
+/**
+* Tidy cache cron task.
+*/
+class tidy_cache extends \phpbb\cron\task\base
+{
+ protected $config;
+ protected $cache;
+
+ /**
+ * Constructor.
+ *
+ * @param \phpbb\config\config $config The config
+ * @param \phpbb\cache\driver\driver_interface $cache The cache driver
+ */
+ public function __construct(\phpbb\config\config $config, \phpbb\cache\driver\driver_interface $cache)
+ {
+ $this->config = $config;
+ $this->cache = $cache;
+ }
+
+ /**
+ * Runs this cron task.
+ *
+ * @return null
+ */
+ public function run()
+ {
+ $this->cache->tidy();
+ }
+
+ /**
+ * Returns whether this cron task can run, given current board configuration.
+ *
+ * Tidy cache cron task runs if the cache implementation in use
+ * supports tidying.
+ *
+ * @return bool
+ */
+ public function is_runnable()
+ {
+ return true;
+ }
+
+ /**
+ * Returns whether this cron task should run now, because enough time
+ * has passed since it was last run.
+ *
+ * The interval between cache tidying is specified in board
+ * configuration.
+ *
+ * @return bool
+ */
+ public function should_run()
+ {
+ return $this->config['cache_last_gc'] < time() - $this->config['cache_gc'];
+ }
+}
diff --git a/phpBB/phpbb/cron/task/core/tidy_database.php b/phpBB/phpbb/cron/task/core/tidy_database.php
new file mode 100644
index 0000000000..949bba8012
--- /dev/null
+++ b/phpBB/phpbb/cron/task/core/tidy_database.php
@@ -0,0 +1,66 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\cron\task\core;
+
+/**
+* Tidy database cron task.
+*/
+class tidy_database extends \phpbb\cron\task\base
+{
+ protected $phpbb_root_path;
+ protected $php_ext;
+ protected $config;
+
+ /**
+ * Constructor.
+ *
+ * @param string $phpbb_root_path The root path
+ * @param string $php_ext The PHP file extension
+ * @param \phpbb\config\config $config The config
+ */
+ public function __construct($phpbb_root_path, $php_ext, \phpbb\config\config $config)
+ {
+ $this->phpbb_root_path = $phpbb_root_path;
+ $this->php_ext = $php_ext;
+ $this->config = $config;
+ }
+
+ /**
+ * Runs this cron task.
+ *
+ * @return null
+ */
+ public function run()
+ {
+ if (!function_exists('tidy_database'))
+ {
+ include($this->phpbb_root_path . 'includes/functions_admin.' . $this->php_ext);
+ }
+ tidy_database();
+ }
+
+ /**
+ * Returns whether this cron task should run now, because enough time
+ * has passed since it was last run.
+ *
+ * The interval between database tidying is specified in board
+ * configuration.
+ *
+ * @return bool
+ */
+ public function should_run()
+ {
+ return $this->config['database_last_gc'] < time() - $this->config['database_gc'];
+ }
+}
diff --git a/phpBB/phpbb/cron/task/core/tidy_plupload.php b/phpBB/phpbb/cron/task/core/tidy_plupload.php
new file mode 100644
index 0000000000..b6aeecf4b4
--- /dev/null
+++ b/phpBB/phpbb/cron/task/core/tidy_plupload.php
@@ -0,0 +1,118 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\cron\task\core;
+
+/**
+* Cron task for cleaning plupload's temporary upload directory.
+*/
+class tidy_plupload extends \phpbb\cron\task\base
+{
+ /**
+ * How old a file must be (in seconds) before it is deleted.
+ * @var int
+ */
+ protected $max_file_age = 86400;
+
+ /**
+ * How often we run the cron (in seconds).
+ * @var int
+ */
+ protected $cron_frequency = 86400;
+
+ /**
+ * phpBB root path
+ * @var string
+ */
+ protected $phpbb_root_path;
+
+ /**
+ * Config object
+ * @var \phpbb\config\config
+ */
+ protected $config;
+
+ /**
+ * Directory where plupload stores temporary files.
+ * @var string
+ */
+ protected $plupload_upload_path;
+
+ /**
+ * Constructor.
+ *
+ * @param string $phpbb_root_path The root path
+ * @param \phpbb\config\config $config The config
+ */
+ public function __construct($phpbb_root_path, \phpbb\config\config $config)
+ {
+ $this->phpbb_root_path = $phpbb_root_path;
+ $this->config = $config;
+
+ $this->plupload_upload_path = $this->phpbb_root_path . $this->config['upload_path'] . '/plupload';
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function run()
+ {
+ // Remove old temporary file (perhaps failed uploads?)
+ $last_valid_timestamp = time() - $this->max_file_age;
+ try
+ {
+ $iterator = new \DirectoryIterator($this->plupload_upload_path);
+ foreach ($iterator as $file)
+ {
+ if (strpos($file->getBasename(), $this->config['plupload_salt']) !== 0)
+ {
+ // Skip over any non-plupload files.
+ continue;
+ }
+
+ if ($file->getMTime() < $last_valid_timestamp)
+ {
+ @unlink($file->getPathname());
+ }
+ }
+ }
+ catch (\UnexpectedValueException $e)
+ {
+ add_log(
+ 'critical',
+ 'LOG_PLUPLOAD_TIDY_FAILED',
+ $this->plupload_upload_path,
+ $e->getMessage(),
+ $e->getTraceAsString()
+ );
+ }
+
+ $this->config->set('plupload_last_gc', time(), true);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function is_runnable()
+ {
+ return !empty($this->config['plupload_salt']) && is_dir($this->plupload_upload_path);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function should_run()
+ {
+ return $this->config['plupload_last_gc'] < time() - $this->cron_frequency;
+ }
+}
diff --git a/phpBB/phpbb/cron/task/core/tidy_search.php b/phpBB/phpbb/cron/task/core/tidy_search.php
new file mode 100644
index 0000000000..eb3970254f
--- /dev/null
+++ b/phpBB/phpbb/cron/task/core/tidy_search.php
@@ -0,0 +1,133 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\cron\task\core;
+
+/**
+* Tidy search cron task.
+*
+* Will only run when the currently selected search backend supports tidying.
+*/
+class tidy_search extends \phpbb\cron\task\base
+{
+ /**
+ * phpBB root path
+ * @var string
+ */
+ protected $phpbb_root_path;
+
+ /**
+ * PHP file extension
+ * @var string
+ */
+ protected $php_ext;
+
+ /**
+ * Auth object
+ * @var \phpbb\auth\auth
+ */
+ protected $auth;
+
+ /**
+ * Config object
+ * @var \phpbb\config\config
+ */
+ protected $config;
+
+ /**
+ * Database object
+ * @var \phpbb\db\driver\driver_interface
+ */
+ protected $db;
+
+ /**
+ * User object
+ * @var \phpbb\user
+ */
+ protected $user;
+
+ /**
+ * Event dispatcher object
+ * @var \phpbb\event\dispatcher_interface
+ */
+ protected $phpbb_dispatcher;
+
+ /**
+ * Constructor.
+ *
+ * @param string $phpbb_root_path The phpBB root path
+ * @param string $php_ext The PHP file extension
+ * @param \phpbb\auth\auth $auth The auth object
+ * @param \phpbb\config\config $config The config object
+ * @param \phpbb\db\driver\driver_interface $db The database object
+ * @param \phpbb\user $user The user object
+ * @param \phpbb\event\dispatcher_interface $phpbb_dispatcher The event dispatcher object
+ */
+ public function __construct($phpbb_root_path, $php_ext, \phpbb\auth\auth $auth, \phpbb\config\config $config, \phpbb\db\driver\driver_interface $db, \phpbb\user $user, \phpbb\event\dispatcher_interface $phpbb_dispatcher)
+ {
+ $this->phpbb_root_path = $phpbb_root_path;
+ $this->php_ext = $php_ext;
+ $this->auth = $auth;
+ $this->config = $config;
+ $this->db = $db;
+ $this->user = $user;
+ $this->phpbb_dispatcher = $phpbb_dispatcher;
+ }
+
+ /**
+ * Runs this cron task.
+ *
+ * @return null
+ */
+ public function run()
+ {
+ $search_type = $this->config['search_type'];
+
+ // We do some additional checks in the module to ensure it can actually be utilised
+ $error = false;
+ $search = new $search_type($error, $this->phpbb_root_path, $this->php_ext, $this->auth, $this->config, $this->db, $this->user, $this->phpbb_dispatcher);
+
+ if (!$error)
+ {
+ $search->tidy();
+ }
+ }
+
+ /**
+ * Returns whether this cron task can run, given current board configuration.
+ *
+ * Search cron task is runnable in all normal use. It may not be
+ * runnable if the search backend implementation selected in board
+ * configuration does not exist.
+ *
+ * @return bool
+ */
+ public function is_runnable()
+ {
+ return class_exists($this->config['search_type']);
+ }
+
+ /**
+ * Returns whether this cron task should run now, because enough time
+ * has passed since it was last run.
+ *
+ * The interval between search tidying is specified in board
+ * configuration.
+ *
+ * @return bool
+ */
+ public function should_run()
+ {
+ return $this->config['search_last_gc'] < time() - $this->config['search_gc'];
+ }
+}
diff --git a/phpBB/phpbb/cron/task/core/tidy_sessions.php b/phpBB/phpbb/cron/task/core/tidy_sessions.php
new file mode 100644
index 0000000000..5e6dabdabf
--- /dev/null
+++ b/phpBB/phpbb/cron/task/core/tidy_sessions.php
@@ -0,0 +1,59 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\cron\task\core;
+
+/**
+* Tidy sessions cron task.
+*/
+class tidy_sessions extends \phpbb\cron\task\base
+{
+ protected $config;
+ protected $user;
+
+ /**
+ * Constructor.
+ *
+ * @param \phpbb\config\config $config The config
+ * @param \phpbb\user $user The user
+ */
+ public function __construct(\phpbb\config\config $config, \phpbb\user $user)
+ {
+ $this->config = $config;
+ $this->user = $user;
+ }
+
+ /**
+ * Runs this cron task.
+ *
+ * @return null
+ */
+ public function run()
+ {
+ $this->user->session_gc();
+ }
+
+ /**
+ * Returns whether this cron task should run now, because enough time
+ * has passed since it was last run.
+ *
+ * The interval between session tidying is specified in board
+ * configuration.
+ *
+ * @return bool
+ */
+ public function should_run()
+ {
+ return $this->config['session_last_gc'] < time() - $this->config['session_gc'];
+ }
+}
diff --git a/phpBB/phpbb/cron/task/core/tidy_warnings.php b/phpBB/phpbb/cron/task/core/tidy_warnings.php
new file mode 100644
index 0000000000..7b67eae6ef
--- /dev/null
+++ b/phpBB/phpbb/cron/task/core/tidy_warnings.php
@@ -0,0 +1,80 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\cron\task\core;
+
+/**
+* Tidy warnings cron task.
+*
+* Will only run when warnings are configured to expire.
+*/
+class tidy_warnings extends \phpbb\cron\task\base
+{
+ protected $phpbb_root_path;
+ protected $php_ext;
+ protected $config;
+
+ /**
+ * Constructor.
+ *
+ * @param string $phpbb_root_path The root path
+ * @param string $php_ext PHP file extension
+ * @param \phpbb\config\config $config The config
+ */
+ public function __construct($phpbb_root_path, $php_ext, \phpbb\config\config $config)
+ {
+ $this->phpbb_root_path = $phpbb_root_path;
+ $this->php_ext = $php_ext;
+ $this->config = $config;
+ }
+
+ /**
+ * Runs this cron task.
+ *
+ * @return null
+ */
+ public function run()
+ {
+ if (!function_exists('tidy_warnings'))
+ {
+ include($this->phpbb_root_path . 'includes/functions_admin.' . $this->php_ext);
+ }
+ tidy_warnings();
+ }
+
+ /**
+ * Returns whether this cron task can run, given current board configuration.
+ *
+ * If warnings are set to never expire, this cron task will not run.
+ *
+ * @return bool
+ */
+ public function is_runnable()
+ {
+ return (bool) $this->config['warnings_expire_days'];
+ }
+
+ /**
+ * Returns whether this cron task should run now, because enough time
+ * has passed since it was last run.
+ *
+ * The interval between warnings tidying is specified in board
+ * configuration.
+ *
+ * @return bool
+ */
+ public function should_run()
+ {
+ return $this->config['warnings_last_gc'] < time() - $this->config['warnings_gc'];
+ }
+}
diff --git a/phpBB/phpbb/cron/task/core/update_hashes.php b/phpBB/phpbb/cron/task/core/update_hashes.php
new file mode 100644
index 0000000000..a4fe477d99
--- /dev/null
+++ b/phpBB/phpbb/cron/task/core/update_hashes.php
@@ -0,0 +1,130 @@
+<?php
+/**
+ *
+ * This file is part of the phpBB Forum Software package.
+ *
+ * @copyright (c) phpBB Limited <https://www.phpbb.com>
+ * @license GNU General Public License, version 2 (GPL-2.0)
+ *
+ * For full copyright and license information, please see
+ * the docs/CREDITS.txt file.
+ *
+ */
+
+namespace phpbb\cron\task\core;
+
+/**
+ * Update old hashes to the current default hashing algorithm
+ *
+ * It is intended to gradually update all "old" style hashes to the
+ * current default hashing algorithm.
+ */
+class update_hashes extends \phpbb\cron\task\base
+{
+ /** @var \phpbb\config\config */
+ protected $config;
+
+ /** @var \phpbb\db\driver\driver_interface */
+ protected $db;
+
+ /** @var \phpbb\lock\db */
+ protected $update_lock;
+
+ /** @var \phpbb\passwords\manager */
+ protected $passwords_manager;
+
+ /** @var string Default hashing type */
+ protected $default_type;
+
+ /**
+ * Constructor.
+ *
+ * @param \phpbb\config\config $config
+ * @param \phpbb\db\driver\driver_interface $db
+ * @param \phpbb\lock\db $update_lock
+ * @param \phpbb\passwords\manager $passwords_manager
+ * @param array $hashing_algorithms Hashing driver
+ * service collection
+ * @param array $defaults Default password types
+ */
+ public function __construct(\phpbb\config\config $config, \phpbb\db\driver\driver_interface $db, \phpbb\lock\db $update_lock, \phpbb\passwords\manager $passwords_manager, $hashing_algorithms, $defaults)
+ {
+ $this->config = $config;
+ $this->db = $db;
+ $this->passwords_manager = $passwords_manager;
+ $this->update_lock = $update_lock;
+
+ foreach ($defaults as $type)
+ {
+ if ($hashing_algorithms[$type]->is_supported())
+ {
+ $this->default_type = $type;
+ break;
+ }
+ }
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function is_runnable()
+ {
+ return !$this->config['use_system_cron'];
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function should_run()
+ {
+ if (!empty($this->config['update_hashes_lock']))
+ {
+ $last_run = explode(' ', $this->config['update_hashes_lock']);
+ if ($last_run[0] + 60 >= time())
+ {
+ return false;
+ }
+ }
+
+ return $this->config['enable_update_hashes'] && $this->config['update_hashes_last_cron'] < (time() - 60);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function run()
+ {
+ if ($this->update_lock->acquire())
+ {
+ $sql = 'SELECT user_id, user_password
+ FROM ' . USERS_TABLE . '
+ WHERE user_password ' . $this->db->sql_like_expression('$H$' . $this->db->get_any_char()) . '
+ OR user_password ' . $this->db->sql_like_expression('$CP$' . $this->db->get_any_char());
+ $result = $this->db->sql_query_limit($sql, 20);
+
+ $affected_rows = 0;
+
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $new_hash = $this->passwords_manager->hash($row['user_password'], array($this->default_type));
+
+ // Increase number so we know that users were selected from the database
+ $affected_rows++;
+
+ $sql = 'UPDATE ' . USERS_TABLE . '
+ SET user_password = "' . $this->db->sql_escape($new_hash) . '"
+ WHERE user_id = ' . (int) $row['user_id'];
+ $this->db->sql_query($sql);
+ }
+
+ $this->config->set('update_hashes_last_cron', time());
+ $this->update_lock->release();
+
+ // Stop cron for good once all hashes are converted
+ if ($affected_rows === 0)
+ {
+ $this->config->set('enable_update_hashes', '0');
+ }
+ }
+ }
+}
diff --git a/phpBB/phpbb/cron/task/parametrized.php b/phpBB/phpbb/cron/task/parametrized.php
new file mode 100644
index 0000000000..7e190b9b86
--- /dev/null
+++ b/phpBB/phpbb/cron/task/parametrized.php
@@ -0,0 +1,48 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\cron\task;
+
+/**
+* Parametrized cron task interface.
+*
+* Parametrized cron tasks are somewhat of a cross between regular cron tasks and
+* delayed jobs. Whereas regular cron tasks perform some action globally,
+* parametrized cron tasks perform actions on a particular object (or objects).
+* Parametrized cron tasks do not make sense and are not usable without
+* specifying these objects.
+*/
+interface parametrized extends \phpbb\cron\task\task
+{
+ /**
+ * Returns parameters of this cron task as an array.
+ *
+ * The array must map string keys to string values.
+ *
+ * @return array
+ */
+ public function get_parameters();
+
+ /**
+ * Parses parameters found in $request, which is an instance of
+ * \phpbb\request\request_interface.
+ *
+ * $request contains user input and must not be trusted.
+ * Cron task must validate all data before using it.
+ *
+ * @param \phpbb\request\request_interface $request Request object.
+ *
+ * @return null
+ */
+ public function parse_parameters(\phpbb\request\request_interface $request);
+}
diff --git a/phpBB/phpbb/cron/task/task.php b/phpBB/phpbb/cron/task/task.php
new file mode 100644
index 0000000000..6d5a383d2d
--- /dev/null
+++ b/phpBB/phpbb/cron/task/task.php
@@ -0,0 +1,52 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\cron\task;
+
+/**
+* Cron task interface
+*/
+interface task
+{
+ /**
+ * Returns the name of the task.
+ *
+ * @return string Name of wrapped task.
+ */
+ public function get_name();
+
+ /**
+ * Runs this cron task.
+ *
+ * @return null
+ */
+ public function run();
+
+ /**
+ * Returns whether this cron task can run, given current board configuration.
+ *
+ * For example, a cron task that prunes forums can only run when
+ * forum pruning is enabled.
+ *
+ * @return bool
+ */
+ public function is_runnable();
+
+ /**
+ * Returns whether this cron task should run now, because enough time
+ * has passed since it was last run.
+ *
+ * @return bool
+ */
+ public function should_run();
+}
diff --git a/phpBB/phpbb/cron/task/wrapper.php b/phpBB/phpbb/cron/task/wrapper.php
new file mode 100644
index 0000000000..8a4a8b1f0c
--- /dev/null
+++ b/phpBB/phpbb/cron/task/wrapper.php
@@ -0,0 +1,106 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\cron\task;
+
+/**
+* Cron task wrapper class.
+* Enhances cron tasks with convenience methods that work identically for all tasks.
+*/
+class wrapper
+{
+ protected $task;
+ protected $phpbb_root_path;
+ protected $php_ext;
+
+ /**
+ * Constructor.
+ *
+ * Wraps a task $task, which must implement cron_task interface.
+ *
+ * @param \phpbb\cron\task\task $task The cron task to wrap.
+ * @param string $phpbb_root_path Relative path to phpBB root
+ * @param string $php_ext PHP file extension
+ */
+ public function __construct(\phpbb\cron\task\task $task, $phpbb_root_path, $php_ext)
+ {
+ $this->task = $task;
+ $this->phpbb_root_path = $phpbb_root_path;
+ $this->php_ext = $php_ext;
+ }
+
+ /**
+ * Returns whether the wrapped task is parametrised.
+ *
+ * Parametrized tasks accept parameters during initialization and must
+ * normally be scheduled with parameters.
+ *
+ * @return bool Whether or not this task is parametrized.
+ */
+ public function is_parametrized()
+ {
+ return $this->task instanceof \phpbb\cron\task\parametrized;
+ }
+
+ /**
+ * Returns whether the wrapped task is ready to run.
+ *
+ * A task is ready to run when it is runnable according to current configuration
+ * and enough time has passed since it was last run.
+ *
+ * @return bool Whether the wrapped task is ready to run.
+ */
+ public function is_ready()
+ {
+ return $this->task->is_runnable() && $this->task->should_run();
+ }
+
+ /**
+ * Returns a url through which this task may be invoked via web.
+ *
+ * When system cron is not in use, running a cron task is accomplished
+ * by outputting an image with the url returned by this function as
+ * source.
+ *
+ * @return string URL through which this task may be invoked.
+ */
+ public function get_url()
+ {
+ $name = $this->get_name();
+ if ($this->is_parametrized())
+ {
+ $params = $this->task->get_parameters();
+ $extra = '';
+ foreach ($params as $key => $value)
+ {
+ $extra .= '&amp;' . $key . '=' . urlencode($value);
+ }
+ }
+ else
+ {
+ $extra = '';
+ }
+ $url = append_sid($this->phpbb_root_path . 'cron.' . $this->php_ext, 'cron_type=' . $name . $extra);
+ return $url;
+ }
+
+ /**
+ * Forwards all other method calls to the wrapped task implementation.
+ *
+ * @return mixed
+ */
+ public function __call($name, $args)
+ {
+ return call_user_func_array(array($this->task, $name), $args);
+ }
+}
diff --git a/phpBB/phpbb/datetime.php b/phpBB/phpbb/datetime.php
new file mode 100644
index 0000000000..63cdba90fd
--- /dev/null
+++ b/phpBB/phpbb/datetime.php
@@ -0,0 +1,168 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb;
+
+/**
+* phpBB custom extensions to the PHP DateTime class
+* This handles the relative formats phpBB employs
+*/
+class datetime extends \DateTime
+{
+ /**
+ * String used to wrap the date segment which should be replaced by today/tomorrow/yesterday
+ */
+ const RELATIVE_WRAPPER = '|';
+
+ /**
+ * @var user User who is the context for this DateTime instance
+ */
+ protected $user;
+
+ /**
+ * @var array Date formats are preprocessed by phpBB, to save constant recalculation they are cached.
+ */
+ static protected $format_cache = array();
+
+ /**
+ * Constructs a new instance of \phpbb\datetime, expanded to include an argument to inject
+ * the user context and modify the timezone to the users selected timezone if one is not set.
+ *
+ * @param user $user object for context.
+ * @param string $time String in a format accepted by strtotime().
+ * @param \DateTimeZone $timezone Time zone of the time.
+ */
+ public function __construct($user, $time = 'now', \DateTimeZone $timezone = null)
+ {
+ $this->user = $user;
+ $timezone = $timezone ?: $this->user->timezone;
+
+ parent::__construct($time, $timezone);
+ }
+
+ /**
+ * Formats the current date time into the specified format
+ *
+ * @param string $format Optional format to use for output, defaults to users chosen format
+ * @param boolean $force_absolute Force output of a non relative date
+ * @return string Formatted date time
+ */
+ public function format($format = '', $force_absolute = false)
+ {
+ $format = $format ? $format : $this->user->date_format;
+ $format = self::format_cache($format, $this->user);
+ $relative = ($format['is_short'] && !$force_absolute);
+ $now = new self($this->user, 'now', $this->user->timezone);
+
+ $timestamp = $this->getTimestamp();
+ $now_ts = $now->getTimeStamp();
+
+ $delta = $now_ts - $timestamp;
+
+ if ($relative)
+ {
+ /*
+ * Check the delta is less than or equal to 1 hour
+ * and the delta not more than a minute in the past
+ * and the delta is either greater than -5 seconds or timestamp
+ * and current time are of the same minute (they must be in the same hour already)
+ * finally check that relative dates are supported by the language pack
+ */
+ if ($delta <= 3600 && $delta > -60 &&
+ ($delta >= -5 || (($now_ts / 60) % 60) == (($timestamp / 60) % 60))
+ && isset($this->user->lang['datetime']['AGO']))
+ {
+ return $this->user->lang(array('datetime', 'AGO'), max(0, (int) floor($delta / 60)));
+ }
+ else
+ {
+ $midnight = clone $now;
+ $midnight->setTime(0, 0, 0);
+
+ $midnight = $midnight->getTimestamp();
+
+ if ($timestamp <= $midnight + 2 * 86400)
+ {
+ $day = false;
+
+ if ($timestamp > $midnight + 86400)
+ {
+ $day = 'TOMORROW';
+ }
+ else if ($timestamp > $midnight)
+ {
+ $day = 'TODAY';
+ }
+ else if ($timestamp > $midnight - 86400)
+ {
+ $day = 'YESTERDAY';
+ }
+
+ if ($day !== false)
+ {
+ // Format using the short formatting and finally swap out the relative token placeholder with the correct value
+ return str_replace(self::RELATIVE_WRAPPER . self::RELATIVE_WRAPPER, $this->user->lang['datetime'][$day], strtr(parent::format($format['format_short']), $format['lang']));
+ }
+ }
+ }
+ }
+
+ return strtr(parent::format($format['format_long']), $format['lang']);
+ }
+
+ /**
+ * Magic method to convert DateTime object to string
+ *
+ * @return string Formatted date time, according to the users default settings.
+ */
+ public function __toString()
+ {
+ return $this->format();
+ }
+
+ /**
+ * Pre-processes the specified date format
+ *
+ * @param string $format Output format
+ * @param user $user User object to use for localisation
+ * @return array Processed date format
+ */
+ static protected function format_cache($format, $user)
+ {
+ $lang = $user->lang_name;
+
+ if (!isset(self::$format_cache[$lang]))
+ {
+ self::$format_cache[$lang] = array();
+ }
+
+ if (!isset(self::$format_cache[$lang][$format]))
+ {
+ // Is the user requesting a friendly date format (i.e. 'Today 12:42')?
+ self::$format_cache[$lang][$format] = array(
+ 'is_short' => strpos($format, self::RELATIVE_WRAPPER) !== false,
+ 'format_short' => substr($format, 0, strpos($format, self::RELATIVE_WRAPPER)) . self::RELATIVE_WRAPPER . self::RELATIVE_WRAPPER . substr(strrchr($format, self::RELATIVE_WRAPPER), 1),
+ 'format_long' => str_replace(self::RELATIVE_WRAPPER, '', $format),
+ 'lang' => array_filter($user->lang['datetime'], 'is_string'),
+ );
+
+ // Short representation of month in format? Some languages use different terms for the long and short format of May
+ if ((strpos($format, '\M') === false && strpos($format, 'M') !== false) || (strpos($format, '\r') === false && strpos($format, 'r') !== false))
+ {
+ self::$format_cache[$lang][$format]['lang']['May'] = $user->lang['datetime']['May_short'];
+ }
+ }
+
+ return self::$format_cache[$lang][$format];
+ }
+}
diff --git a/phpBB/phpbb/db/driver/driver.php b/phpBB/phpbb/db/driver/driver.php
new file mode 100644
index 0000000000..01dd66cd6e
--- /dev/null
+++ b/phpBB/phpbb/db/driver/driver.php
@@ -0,0 +1,1078 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\driver;
+
+/**
+* Database Abstraction Layer
+*/
+abstract class driver implements driver_interface
+{
+ var $db_connect_id;
+ var $query_result;
+ var $return_on_error = false;
+ var $transaction = false;
+ var $sql_time = 0;
+ var $num_queries = array();
+ var $open_queries = array();
+
+ var $curtime = 0;
+ var $query_hold = '';
+ var $html_hold = '';
+ var $sql_report = '';
+
+ var $persistency = false;
+ var $user = '';
+ var $server = '';
+ var $dbname = '';
+
+ // Set to true if error triggered
+ var $sql_error_triggered = false;
+
+ // Holding the last sql query on sql error
+ var $sql_error_sql = '';
+ // Holding the error information - only populated if sql_error_triggered is set
+ var $sql_error_returned = array();
+
+ // Holding transaction count
+ var $transactions = 0;
+
+ // Supports multi inserts?
+ var $multi_insert = false;
+
+ /**
+ * Current sql layer
+ */
+ var $sql_layer = '';
+
+ /**
+ * Wildcards for matching any (%) or exactly one (_) character within LIKE expressions
+ */
+ var $any_char;
+ var $one_char;
+
+ /**
+ * Exact version of the DBAL, directly queried
+ */
+ var $sql_server_version = false;
+
+ /**
+ * Constructor
+ */
+ function __construct()
+ {
+ $this->num_queries = array(
+ 'cached' => 0,
+ 'normal' => 0,
+ 'total' => 0,
+ );
+
+ // Fill default sql layer based on the class being called.
+ // This can be changed by the specified layer itself later if needed.
+ $this->sql_layer = substr(get_class($this), strlen('phpbb\db\driver\\'));
+
+ // Do not change this please! This variable is used to easy the use of it - and is hardcoded.
+ $this->any_char = chr(0) . '%';
+ $this->one_char = chr(0) . '_';
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_sql_layer()
+ {
+ return $this->sql_layer;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_db_name()
+ {
+ return $this->dbname;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_any_char()
+ {
+ return $this->any_char;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_one_char()
+ {
+ return $this->one_char;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_db_connect_id()
+ {
+ return $this->db_connect_id;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_sql_error_triggered()
+ {
+ return $this->sql_error_triggered;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_sql_error_sql()
+ {
+ return $this->sql_error_sql;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_transaction()
+ {
+ return $this->transaction;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_sql_time()
+ {
+ return $this->sql_time;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_sql_error_returned()
+ {
+ return $this->sql_error_returned;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_multi_insert()
+ {
+ return $this->multi_insert;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function set_multi_insert($multi_insert)
+ {
+ $this->multi_insert = $multi_insert;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_return_on_error($fail = false)
+ {
+ $this->sql_error_triggered = false;
+ $this->sql_error_sql = '';
+
+ $this->return_on_error = $fail;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_num_queries($cached = false)
+ {
+ return ($cached) ? $this->num_queries['cached'] : $this->num_queries['normal'];
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_add_num_queries($cached = false)
+ {
+ $this->num_queries['cached'] += ($cached !== false) ? 1 : 0;
+ $this->num_queries['normal'] += ($cached !== false) ? 0 : 1;
+ $this->num_queries['total'] += 1;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_close()
+ {
+ if (!$this->db_connect_id)
+ {
+ return false;
+ }
+
+ if ($this->transaction)
+ {
+ do
+ {
+ $this->sql_transaction('commit');
+ }
+ while ($this->transaction);
+ }
+
+ foreach ($this->open_queries as $query_id)
+ {
+ $this->sql_freeresult($query_id);
+ }
+
+ // Connection closed correctly. Set db_connect_id to false to prevent errors
+ if ($result = $this->_sql_close())
+ {
+ $this->db_connect_id = false;
+ }
+
+ return $result;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_query_limit($query, $total, $offset = 0, $cache_ttl = 0)
+ {
+ if (empty($query))
+ {
+ return false;
+ }
+
+ // Never use a negative total or offset
+ $total = ($total < 0) ? 0 : $total;
+ $offset = ($offset < 0) ? 0 : $offset;
+
+ return $this->_sql_query_limit($query, $total, $offset, $cache_ttl);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_fetchrowset($query_id = false)
+ {
+ if ($query_id === false)
+ {
+ $query_id = $this->query_result;
+ }
+
+ if ($query_id !== false)
+ {
+ $result = array();
+ while ($row = $this->sql_fetchrow($query_id))
+ {
+ $result[] = $row;
+ }
+
+ return $result;
+ }
+
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_rowseek($rownum, &$query_id)
+ {
+ global $cache;
+
+ if ($query_id === false)
+ {
+ $query_id = $this->query_result;
+ }
+
+ if ($cache && $cache->sql_exists($query_id))
+ {
+ return $cache->sql_rowseek($rownum, $query_id);
+ }
+
+ if ($query_id === false)
+ {
+ return false;
+ }
+
+ $this->sql_freeresult($query_id);
+ $query_id = $this->sql_query($this->last_query_text);
+
+ if ($query_id === false)
+ {
+ return false;
+ }
+
+ // We do not fetch the row for rownum == 0 because then the next resultset would be the second row
+ for ($i = 0; $i < $rownum; $i++)
+ {
+ if (!$this->sql_fetchrow($query_id))
+ {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_fetchfield($field, $rownum = false, $query_id = false)
+ {
+ global $cache;
+
+ if ($query_id === false)
+ {
+ $query_id = $this->query_result;
+ }
+
+ if ($query_id !== false)
+ {
+ if ($rownum !== false)
+ {
+ $this->sql_rowseek($rownum, $query_id);
+ }
+
+ if ($cache && !is_object($query_id) && $cache->sql_exists($query_id))
+ {
+ return $cache->sql_fetchfield($query_id, $field);
+ }
+
+ $row = $this->sql_fetchrow($query_id);
+ return (isset($row[$field])) ? $row[$field] : false;
+ }
+
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_like_expression($expression)
+ {
+ $expression = utf8_str_replace(array('_', '%'), array("\_", "\%"), $expression);
+ $expression = utf8_str_replace(array(chr(0) . "\_", chr(0) . "\%"), array('_', '%'), $expression);
+
+ return $this->_sql_like_expression('LIKE \'' . $this->sql_escape($expression) . '\'');
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_not_like_expression($expression)
+ {
+ $expression = utf8_str_replace(array('_', '%'), array("\_", "\%"), $expression);
+ $expression = utf8_str_replace(array(chr(0) . "\_", chr(0) . "\%"), array('_', '%'), $expression);
+
+ return $this->_sql_not_like_expression('NOT LIKE \'' . $this->sql_escape($expression) . '\'');
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function sql_case($condition, $action_true, $action_false = false)
+ {
+ $sql_case = 'CASE WHEN ' . $condition;
+ $sql_case .= ' THEN ' . $action_true;
+ $sql_case .= ($action_false !== false) ? ' ELSE ' . $action_false : '';
+ $sql_case .= ' END';
+ return $sql_case;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function sql_concatenate($expr1, $expr2)
+ {
+ return $expr1 . ' || ' . $expr2;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_buffer_nested_transactions()
+ {
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_transaction($status = 'begin')
+ {
+ switch ($status)
+ {
+ case 'begin':
+ // If we are within a transaction we will not open another one, but enclose the current one to not loose data (preventing auto commit)
+ if ($this->transaction)
+ {
+ $this->transactions++;
+ return true;
+ }
+
+ $result = $this->_sql_transaction('begin');
+
+ if (!$result)
+ {
+ $this->sql_error();
+ }
+
+ $this->transaction = true;
+ break;
+
+ case 'commit':
+ // If there was a previously opened transaction we do not commit yet...
+ // but count back the number of inner transactions
+ if ($this->transaction && $this->transactions)
+ {
+ $this->transactions--;
+ return true;
+ }
+
+ // Check if there is a transaction (no transaction can happen if
+ // there was an error, with a combined rollback and error returning enabled)
+ // This implies we have transaction always set for autocommit db's
+ if (!$this->transaction)
+ {
+ return false;
+ }
+
+ $result = $this->_sql_transaction('commit');
+
+ if (!$result)
+ {
+ $this->sql_error();
+ }
+
+ $this->transaction = false;
+ $this->transactions = 0;
+ break;
+
+ case 'rollback':
+ $result = $this->_sql_transaction('rollback');
+ $this->transaction = false;
+ $this->transactions = 0;
+ break;
+
+ default:
+ $result = $this->_sql_transaction($status);
+ break;
+ }
+
+ return $result;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_build_array($query, $assoc_ary = false)
+ {
+ if (!is_array($assoc_ary))
+ {
+ return false;
+ }
+
+ $fields = $values = array();
+
+ if ($query == 'INSERT' || $query == 'INSERT_SELECT')
+ {
+ foreach ($assoc_ary as $key => $var)
+ {
+ $fields[] = $key;
+
+ if (is_array($var) && is_string($var[0]))
+ {
+ // This is used for INSERT_SELECT(s)
+ $values[] = $var[0];
+ }
+ else
+ {
+ $values[] = $this->_sql_validate_value($var);
+ }
+ }
+
+ $query = ($query == 'INSERT') ? ' (' . implode(', ', $fields) . ') VALUES (' . implode(', ', $values) . ')' : ' (' . implode(', ', $fields) . ') SELECT ' . implode(', ', $values) . ' ';
+ }
+ else if ($query == 'MULTI_INSERT')
+ {
+ trigger_error('The MULTI_INSERT query value is no longer supported. Please use sql_multi_insert() instead.', E_USER_ERROR);
+ }
+ else if ($query == 'UPDATE' || $query == 'SELECT' || $query == 'DELETE')
+ {
+ $values = array();
+ foreach ($assoc_ary as $key => $var)
+ {
+ $values[] = "$key = " . $this->_sql_validate_value($var);
+ }
+ $query = implode(($query == 'UPDATE') ? ', ' : ' AND ', $values);
+ }
+
+ return $query;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_in_set($field, $array, $negate = false, $allow_empty_set = false)
+ {
+ if (!sizeof($array))
+ {
+ if (!$allow_empty_set)
+ {
+ // Print the backtrace to help identifying the location of the problematic code
+ $this->sql_error('No values specified for SQL IN comparison');
+ }
+ else
+ {
+ // NOT IN () actually means everything so use a tautology
+ if ($negate)
+ {
+ return '1=1';
+ }
+ // IN () actually means nothing so use a contradiction
+ else
+ {
+ return '1=0';
+ }
+ }
+ }
+
+ if (!is_array($array))
+ {
+ $array = array($array);
+ }
+
+ if (sizeof($array) == 1)
+ {
+ @reset($array);
+ $var = current($array);
+
+ return $field . ($negate ? ' <> ' : ' = ') . $this->_sql_validate_value($var);
+ }
+ else
+ {
+ return $field . ($negate ? ' NOT IN ' : ' IN ') . '(' . implode(', ', array_map(array($this, '_sql_validate_value'), $array)) . ')';
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_bit_and($column_name, $bit, $compare = '')
+ {
+ if (method_exists($this, '_sql_bit_and'))
+ {
+ return $this->_sql_bit_and($column_name, $bit, $compare);
+ }
+
+ return $column_name . ' & ' . (1 << $bit) . (($compare) ? ' ' . $compare : '');
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_bit_or($column_name, $bit, $compare = '')
+ {
+ if (method_exists($this, '_sql_bit_or'))
+ {
+ return $this->_sql_bit_or($column_name, $bit, $compare);
+ }
+
+ return $column_name . ' | ' . (1 << $bit) . (($compare) ? ' ' . $compare : '');
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function cast_expr_to_bigint($expression)
+ {
+ return $expression;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function cast_expr_to_string($expression)
+ {
+ return $expression;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_lower_text($column_name)
+ {
+ return "LOWER($column_name)";
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_multi_insert($table, $sql_ary)
+ {
+ if (!sizeof($sql_ary))
+ {
+ return false;
+ }
+
+ if ($this->multi_insert)
+ {
+ $ary = array();
+ foreach ($sql_ary as $id => $_sql_ary)
+ {
+ // If by accident the sql array is only one-dimensional we build a normal insert statement
+ if (!is_array($_sql_ary))
+ {
+ return $this->sql_query('INSERT INTO ' . $table . ' ' . $this->sql_build_array('INSERT', $sql_ary));
+ }
+
+ $values = array();
+ foreach ($_sql_ary as $key => $var)
+ {
+ $values[] = $this->_sql_validate_value($var);
+ }
+ $ary[] = '(' . implode(', ', $values) . ')';
+ }
+
+ return $this->sql_query('INSERT INTO ' . $table . ' ' . ' (' . implode(', ', array_keys($sql_ary[0])) . ') VALUES ' . implode(', ', $ary));
+ }
+ else
+ {
+ foreach ($sql_ary as $ary)
+ {
+ if (!is_array($ary))
+ {
+ return false;
+ }
+
+ $result = $this->sql_query('INSERT INTO ' . $table . ' ' . $this->sql_build_array('INSERT', $ary));
+
+ if (!$result)
+ {
+ return false;
+ }
+ }
+ }
+
+ return true;
+ }
+
+ /**
+ * Function for validating values
+ * @access private
+ */
+ function _sql_validate_value($var)
+ {
+ if (is_null($var))
+ {
+ return 'NULL';
+ }
+ else if (is_string($var))
+ {
+ return "'" . $this->sql_escape($var) . "'";
+ }
+ else
+ {
+ return (is_bool($var)) ? intval($var) : $var;
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_build_query($query, $array)
+ {
+ $sql = '';
+ switch ($query)
+ {
+ case 'SELECT':
+ case 'SELECT_DISTINCT';
+
+ $sql = str_replace('_', ' ', $query) . ' ' . $array['SELECT'] . ' FROM ';
+
+ // Build table array. We also build an alias array for later checks.
+ $table_array = $aliases = array();
+ $used_multi_alias = false;
+
+ foreach ($array['FROM'] as $table_name => $alias)
+ {
+ if (is_array($alias))
+ {
+ $used_multi_alias = true;
+
+ foreach ($alias as $multi_alias)
+ {
+ $table_array[] = $table_name . ' ' . $multi_alias;
+ $aliases[] = $multi_alias;
+ }
+ }
+ else
+ {
+ $table_array[] = $table_name . ' ' . $alias;
+ $aliases[] = $alias;
+ }
+ }
+
+ // We run the following code to determine if we need to re-order the table array. ;)
+ // The reason for this is that for multi-aliased tables (two equal tables) in the FROM statement the last table need to match the first comparison.
+ // DBMS who rely on this: Oracle, PostgreSQL and MSSQL. For all other DBMS it makes absolutely no difference in which order the table is.
+ if (!empty($array['LEFT_JOIN']) && sizeof($array['FROM']) > 1 && $used_multi_alias !== false)
+ {
+ // Take first LEFT JOIN
+ $join = current($array['LEFT_JOIN']);
+
+ // Determine the table used there (even if there are more than one used, we only want to have one
+ preg_match('/(' . implode('|', $aliases) . ')\.[^\s]+/U', str_replace(array('(', ')', 'AND', 'OR', ' '), '', $join['ON']), $matches);
+
+ // If there is a first join match, we need to make sure the table order is correct
+ if (!empty($matches[1]))
+ {
+ $first_join_match = trim($matches[1]);
+ $table_array = $last = array();
+
+ foreach ($array['FROM'] as $table_name => $alias)
+ {
+ if (is_array($alias))
+ {
+ foreach ($alias as $multi_alias)
+ {
+ ($multi_alias === $first_join_match) ? $last[] = $table_name . ' ' . $multi_alias : $table_array[] = $table_name . ' ' . $multi_alias;
+ }
+ }
+ else
+ {
+ ($alias === $first_join_match) ? $last[] = $table_name . ' ' . $alias : $table_array[] = $table_name . ' ' . $alias;
+ }
+ }
+
+ $table_array = array_merge($table_array, $last);
+ }
+ }
+
+ $sql .= $this->_sql_custom_build('FROM', implode(' CROSS JOIN ', $table_array));
+
+ if (!empty($array['LEFT_JOIN']))
+ {
+ foreach ($array['LEFT_JOIN'] as $join)
+ {
+ $sql .= ' LEFT JOIN ' . key($join['FROM']) . ' ' . current($join['FROM']) . ' ON (' . $join['ON'] . ')';
+ }
+ }
+
+ if (!empty($array['WHERE']))
+ {
+ $sql .= ' WHERE ' . $this->_sql_custom_build('WHERE', $array['WHERE']);
+ }
+
+ if (!empty($array['GROUP_BY']))
+ {
+ $sql .= ' GROUP BY ' . $array['GROUP_BY'];
+ }
+
+ if (!empty($array['ORDER_BY']))
+ {
+ $sql .= ' ORDER BY ' . $array['ORDER_BY'];
+ }
+
+ break;
+ }
+
+ return $sql;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_error($sql = '')
+ {
+ global $auth, $user, $config;
+
+ // Set var to retrieve errored status
+ $this->sql_error_triggered = true;
+ $this->sql_error_sql = $sql;
+
+ $this->sql_error_returned = $this->_sql_error();
+
+ if (!$this->return_on_error)
+ {
+ $message = 'SQL ERROR [ ' . $this->sql_layer . ' ]<br /><br />' . $this->sql_error_returned['message'] . ' [' . $this->sql_error_returned['code'] . ']';
+
+ // Show complete SQL error and path to administrators only
+ // Additionally show complete error on installation or if extended debug mode is enabled
+ // The DEBUG constant is for development only!
+ if ((isset($auth) && $auth->acl_get('a_')) || defined('IN_INSTALL') || defined('DEBUG'))
+ {
+ $message .= ($sql) ? '<br /><br />SQL<br /><br />' . htmlspecialchars($sql) : '';
+ }
+ else
+ {
+ // If error occurs in initiating the session we need to use a pre-defined language string
+ // This could happen if the connection could not be established for example (then we are not able to grab the default language)
+ if (!isset($user->lang['SQL_ERROR_OCCURRED']))
+ {
+ $message .= '<br /><br />An sql error occurred while fetching this page. Please contact an administrator if this problem persists.';
+ }
+ else
+ {
+ if (!empty($config['board_contact']))
+ {
+ $message .= '<br /><br />' . sprintf($user->lang['SQL_ERROR_OCCURRED'], '<a href="mailto:' . htmlspecialchars($config['board_contact']) . '">', '</a>');
+ }
+ else
+ {
+ $message .= '<br /><br />' . sprintf($user->lang['SQL_ERROR_OCCURRED'], '', '');
+ }
+ }
+ }
+
+ if ($this->transaction)
+ {
+ $this->sql_transaction('rollback');
+ }
+
+ if (strlen($message) > 1024)
+ {
+ // We need to define $msg_long_text here to circumvent text stripping.
+ global $msg_long_text;
+ $msg_long_text = $message;
+
+ trigger_error(false, E_USER_ERROR);
+ }
+
+ trigger_error($message, E_USER_ERROR);
+ }
+
+ if ($this->transaction)
+ {
+ $this->sql_transaction('rollback');
+ }
+
+ return $this->sql_error_returned;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_report($mode, $query = '')
+ {
+ global $cache, $starttime, $phpbb_root_path, $phpbb_path_helper, $user;
+ global $request;
+
+ if (is_object($request) && !$request->variable('explain', false))
+ {
+ return false;
+ }
+
+ if (!$query && $this->query_hold != '')
+ {
+ $query = $this->query_hold;
+ }
+
+ switch ($mode)
+ {
+ case 'display':
+ if (!empty($cache))
+ {
+ $cache->unload();
+ }
+ $this->sql_close();
+
+ $mtime = explode(' ', microtime());
+ $totaltime = $mtime[0] + $mtime[1] - $starttime;
+
+ echo '<!DOCTYPE html>
+ <html dir="ltr">
+ <head>
+ <meta charset="utf-8">
+ <meta http-equiv="X-UA-Compatible" content="IE=edge">
+ <title>SQL Report</title>
+ <link href="' . htmlspecialchars($phpbb_path_helper->update_web_root_path($phpbb_root_path) . $phpbb_path_helper->get_adm_relative_path()) . 'style/admin.css" rel="stylesheet" type="text/css" media="screen" />
+ </head>
+ <body id="errorpage">
+ <div id="wrap">
+ <div id="page-header">
+ <a href="' . build_url('explain') . '">Return to previous page</a>
+ </div>
+ <div id="page-body">
+ <div id="acp">
+ <div class="panel">
+ <span class="corners-top"><span></span></span>
+ <div id="content">
+ <h1>SQL Report</h1>
+ <br />
+ <p><b>Page generated in ' . round($totaltime, 4) . " seconds with {$this->num_queries['normal']} queries" . (($this->num_queries['cached']) ? " + {$this->num_queries['cached']} " . (($this->num_queries['cached'] == 1) ? 'query' : 'queries') . ' returning data from cache' : '') . '</b></p>
+
+ <p>Time spent on ' . $this->sql_layer . ' queries: <b>' . round($this->sql_time, 5) . 's</b> | Time spent on PHP: <b>' . round($totaltime - $this->sql_time, 5) . 's</b></p>
+
+ <br /><br />
+ ' . $this->sql_report . '
+ </div>
+ <span class="corners-bottom"><span></span></span>
+ </div>
+ </div>
+ </div>
+ <div id="page-footer">
+ Powered by <a href="https://www.phpbb.com/">phpBB</a>&reg; Forum Software &copy; phpBB Limited
+ </div>
+ </div>
+ </body>
+ </html>';
+
+ exit_handler();
+
+ break;
+
+ case 'stop':
+ $endtime = explode(' ', microtime());
+ $endtime = $endtime[0] + $endtime[1];
+
+ $this->sql_report .= '
+
+ <table cellspacing="1">
+ <thead>
+ <tr>
+ <th>Query #' . $this->num_queries['total'] . '</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td class="row3"><textarea style="font-family:\'Courier New\',monospace;width:99%" rows="5" cols="10">' . preg_replace('/\t(AND|OR)(\W)/', "\$1\$2", htmlspecialchars(preg_replace('/[\s]*[\n\r\t]+[\n\r\s\t]*/', "\n", $query))) . '</textarea></td>
+ </tr>
+ </tbody>
+ </table>
+
+ ' . $this->html_hold . '
+
+ <p style="text-align: center;">
+ ';
+
+ if ($this->query_result)
+ {
+ if (preg_match('/^(UPDATE|DELETE|REPLACE)/', $query))
+ {
+ $this->sql_report .= 'Affected rows: <b>' . $this->sql_affectedrows() . '</b> | ';
+ }
+ $this->sql_report .= 'Before: ' . sprintf('%.5f', $this->curtime - $starttime) . 's | After: ' . sprintf('%.5f', $endtime - $starttime) . 's | Elapsed: <b>' . sprintf('%.5f', $endtime - $this->curtime) . 's</b>';
+ }
+ else
+ {
+ $error = $this->sql_error();
+ $this->sql_report .= '<b style="color: red">FAILED</b> - ' . $this->sql_layer . ' Error ' . $error['code'] . ': ' . htmlspecialchars($error['message']);
+ }
+
+ $this->sql_report .= '</p><br /><br />';
+
+ $this->sql_time += $endtime - $this->curtime;
+ break;
+
+ case 'start':
+ $this->query_hold = $query;
+ $this->html_hold = '';
+
+ $this->_sql_report($mode, $query);
+
+ $this->curtime = explode(' ', microtime());
+ $this->curtime = $this->curtime[0] + $this->curtime[1];
+
+ break;
+
+ case 'add_select_row':
+
+ $html_table = func_get_arg(2);
+ $row = func_get_arg(3);
+
+ if (!$html_table && sizeof($row))
+ {
+ $html_table = true;
+ $this->html_hold .= '<table cellspacing="1"><tr>';
+
+ foreach (array_keys($row) as $val)
+ {
+ $this->html_hold .= '<th>' . (($val) ? ucwords(str_replace('_', ' ', $val)) : '&nbsp;') . '</th>';
+ }
+ $this->html_hold .= '</tr>';
+ }
+ $this->html_hold .= '<tr>';
+
+ $class = 'row1';
+ foreach (array_values($row) as $val)
+ {
+ $class = ($class == 'row1') ? 'row2' : 'row1';
+ $this->html_hold .= '<td class="' . $class . '">' . (($val) ? $val : '&nbsp;') . '</td>';
+ }
+ $this->html_hold .= '</tr>';
+
+ return $html_table;
+
+ break;
+
+ case 'fromcache':
+
+ $this->_sql_report($mode, $query);
+
+ break;
+
+ case 'record_fromcache':
+
+ $endtime = func_get_arg(2);
+ $splittime = func_get_arg(3);
+
+ $time_cache = $endtime - $this->curtime;
+ $time_db = $splittime - $endtime;
+ $color = ($time_db > $time_cache) ? 'green' : 'red';
+
+ $this->sql_report .= '<table cellspacing="1"><thead><tr><th>Query results obtained from the cache</th></tr></thead><tbody><tr>';
+ $this->sql_report .= '<td class="row3"><textarea style="font-family:\'Courier New\',monospace;width:99%" rows="5" cols="10">' . preg_replace('/\t(AND|OR)(\W)/', "\$1\$2", htmlspecialchars(preg_replace('/[\s]*[\n\r\t]+[\n\r\s\t]*/', "\n", $query))) . '</textarea></td></tr></tbody></table>';
+ $this->sql_report .= '<p style="text-align: center;">';
+ $this->sql_report .= 'Before: ' . sprintf('%.5f', $this->curtime - $starttime) . 's | After: ' . sprintf('%.5f', $endtime - $starttime) . 's | Elapsed [cache]: <b style="color: ' . $color . '">' . sprintf('%.5f', ($time_cache)) . 's</b> | Elapsed [db]: <b>' . sprintf('%.5f', $time_db) . 's</b></p><br /><br />';
+
+ // Pad the start time to not interfere with page timing
+ $starttime += $time_db;
+
+ break;
+
+ default:
+
+ $this->_sql_report($mode, $query);
+
+ break;
+ }
+
+ return true;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function get_estimated_row_count($table_name)
+ {
+ return $this->get_row_count($table_name);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function get_row_count($table_name)
+ {
+ $sql = 'SELECT COUNT(*) AS rows_total
+ FROM ' . $this->sql_escape($table_name);
+ $result = $this->sql_query($sql);
+ $rows_total = $this->sql_fetchfield('rows_total');
+ $this->sql_freeresult($result);
+
+ return $rows_total;
+ }
+}
diff --git a/phpBB/phpbb/db/driver/driver_interface.php b/phpBB/phpbb/db/driver/driver_interface.php
new file mode 100644
index 0000000000..8b487c5d42
--- /dev/null
+++ b/phpBB/phpbb/db/driver/driver_interface.php
@@ -0,0 +1,453 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\driver;
+
+interface driver_interface
+{
+ /**
+ * Gets the name of the sql layer.
+ *
+ * @return string
+ */
+ public function get_sql_layer();
+
+ /**
+ * Gets the name of the database.
+ *
+ * @return string
+ */
+ public function get_db_name();
+
+ /**
+ * Wildcards for matching any (%) character within LIKE expressions
+ *
+ * @return string
+ */
+ public function get_any_char();
+
+ /**
+ * Wildcards for matching exactly one (_) character within LIKE expressions
+ *
+ * @return string
+ */
+ public function get_one_char();
+
+ /**
+ * Gets the time spent into the queries
+ *
+ * @return int
+ */
+ public function get_sql_time();
+
+ /**
+ * Gets the connect ID.
+ *
+ * @return mixed
+ */
+ public function get_db_connect_id();
+
+ /**
+ * Indicates if an error was triggered.
+ *
+ * @return bool
+ */
+ public function get_sql_error_triggered();
+
+ /**
+ * Gets the last faulty query
+ *
+ * @return string
+ */
+ public function get_sql_error_sql();
+
+ /**
+ * Indicates if we are in a transaction.
+ *
+ * @return bool
+ */
+ public function get_transaction();
+
+ /**
+ * Gets the returned error.
+ *
+ * @return array
+ */
+ public function get_sql_error_returned();
+
+ /**
+ * Indicates if multiple insertion can be used
+ *
+ * @return bool
+ */
+ public function get_multi_insert();
+
+ /**
+ * Set if multiple insertion can be used
+ *
+ * @param bool $multi_insert
+ */
+ public function set_multi_insert($multi_insert);
+
+ /**
+ * Gets the exact number of rows in a specified table.
+ *
+ * @param string $table_name Table name
+ * @return string Exact number of rows in $table_name.
+ */
+ public function get_row_count($table_name);
+
+ /**
+ * Gets the estimated number of rows in a specified table.
+ *
+ * @param string $table_name Table name
+ * @return string Number of rows in $table_name.
+ * Prefixed with ~ if estimated (otherwise exact).
+ */
+ public function get_estimated_row_count($table_name);
+
+ /**
+ * Run LOWER() on DB column of type text (i.e. neither varchar nor char).
+ *
+ * @param string $column_name The column name to use
+ * @return string A SQL statement like "LOWER($column_name)"
+ */
+ public function sql_lower_text($column_name);
+
+ /**
+ * Display sql error page
+ *
+ * @param string $sql The SQL query causing the error
+ * @return mixed Returns the full error message, if $this->return_on_error
+ * is set, null otherwise
+ */
+ public function sql_error($sql = '');
+
+ /**
+ * Returns whether results of a query need to be buffered to run a
+ * transaction while iterating over them.
+ *
+ * @return bool Whether buffering is required.
+ */
+ public function sql_buffer_nested_transactions();
+
+ /**
+ * Run binary OR operator on DB column.
+ *
+ * @param string $column_name The column name to use
+ * @param int $bit The value to use for the OR operator,
+ * will be converted to (1 << $bit). Is used by options,
+ * using the number schema... 0, 1, 2...29
+ * @param string $compare Any custom SQL code after the check (e.g. "= 0")
+ * @return string A SQL statement like "$column | (1 << $bit) {$compare}"
+ */
+ public function sql_bit_or($column_name, $bit, $compare = '');
+
+ /**
+ * Version information about used database
+ *
+ * @param bool $raw Only return the fetched sql_server_version
+ * @param bool $use_cache Is it safe to retrieve the value from the cache
+ * @return string sql server version
+ */
+ public function sql_server_info($raw = false, $use_cache = true);
+
+ /**
+ * Return on error or display error message
+ *
+ * @param bool $fail Should we return on errors, or stop
+ * @return null
+ */
+ public function sql_return_on_error($fail = false);
+
+ /**
+ * Build sql statement from an array
+ *
+ * @param string $query Should be on of the following strings:
+ * INSERT, INSERT_SELECT, UPDATE, SELECT, DELETE
+ * @param array $assoc_ary Array with "column => value" pairs
+ * @return string A SQL statement like "c1 = 'a' AND c2 = 'b'"
+ */
+ public function sql_build_array($query, $assoc_ary = array());
+
+ /**
+ * Fetch all rows
+ *
+ * @param mixed $query_id Already executed query to get the rows from,
+ * if false, the last query will be used.
+ * @return mixed Nested array if the query had rows, false otherwise
+ */
+ public function sql_fetchrowset($query_id = false);
+
+ /**
+ * SQL Transaction
+ *
+ * @param string $status Should be one of the following strings:
+ * begin, commit, rollback
+ * @return mixed Buffered, seekable result handle, false on error
+ */
+ public function sql_transaction($status = 'begin');
+
+ /**
+ * Build a concatenated expression
+ *
+ * @param string $expr1 Base SQL expression where we append the second one
+ * @param string $expr2 SQL expression that is appended to the first expression
+ * @return string Concatenated string
+ */
+ public function sql_concatenate($expr1, $expr2);
+
+ /**
+ * Build a case expression
+ *
+ * Note: The two statements action_true and action_false must have the same
+ * data type (int, vchar, ...) in the database!
+ *
+ * @param string $condition The condition which must be true,
+ * to use action_true rather then action_else
+ * @param string $action_true SQL expression that is used, if the condition is true
+ * @param mixed $action_false SQL expression that is used, if the condition is false
+ * @return string CASE expression including the condition and statements
+ */
+ public function sql_case($condition, $action_true, $action_false = false);
+
+ /**
+ * Build sql statement from array for select and select distinct statements
+ *
+ * Possible query values: SELECT, SELECT_DISTINCT
+ *
+ * @param string $query Should be one of: SELECT, SELECT_DISTINCT
+ * @param array $array Array with the query data:
+ * SELECT A comma imploded list of columns to select
+ * FROM Array with "table => alias" pairs,
+ * (alias can also be an array)
+ * Optional: LEFT_JOIN Array of join entries:
+ * FROM Table that should be joined
+ * ON Condition for the join
+ * Optional: WHERE Where SQL statement
+ * Optional: GROUP_BY Group by SQL statement
+ * Optional: ORDER_BY Order by SQL statement
+ * @return string A SQL statement ready for execution
+ */
+ public function sql_build_query($query, $array);
+
+ /**
+ * Fetch field
+ * if rownum is false, the current row is used, else it is pointing to the row (zero-based)
+ *
+ * @param string $field Name of the column
+ * @param mixed $rownum Row number, if false the current row will be used
+ * and the row curser will point to the next row
+ * Note: $rownum is 0 based
+ * @param mixed $query_id Already executed query to get the rows from,
+ * if false, the last query will be used.
+ * @return mixed String value of the field in the selected row,
+ * false, if the row does not exist
+ */
+ public function sql_fetchfield($field, $rownum = false, $query_id = false);
+
+ /**
+ * Fetch current row
+ *
+ * @param mixed $query_id Already executed query to get the rows from,
+ * if false, the last query will be used.
+ * @return mixed Array with the current row,
+ * false, if the row does not exist
+ */
+ public function sql_fetchrow($query_id = false);
+
+ /**
+ * Returns SQL string to cast a string expression to an int.
+ *
+ * @param string $expression An expression evaluating to string
+ * @return string Expression returning an int
+ */
+ public function cast_expr_to_bigint($expression);
+
+ /**
+ * Get last inserted id after insert statement
+ *
+ * @return string Autoincrement value of the last inserted row
+ */
+ public function sql_nextid();
+
+ /**
+ * Add to query count
+ *
+ * @param bool $cached Is this query cached?
+ * @return null
+ */
+ public function sql_add_num_queries($cached = false);
+
+ /**
+ * Build LIMIT query
+ *
+ * @param string $query The SQL query to execute
+ * @param int $total The number of rows to select
+ * @param int $offset
+ * @param int $cache_ttl Either 0 to avoid caching or
+ * the time in seconds which the result shall be kept in cache
+ * @return mixed Buffered, seekable result handle, false on error
+ */
+ public function sql_query_limit($query, $total, $offset = 0, $cache_ttl = 0);
+
+ /**
+ * Base query method
+ *
+ * @param string $query The SQL query to execute
+ * @param int $cache_ttl Either 0 to avoid caching or
+ * the time in seconds which the result shall be kept in cache
+ * @return mixed Buffered, seekable result handle, false on error
+ */
+ public function sql_query($query = '', $cache_ttl = 0);
+
+ /**
+ * Returns SQL string to cast an integer expression to a string.
+ *
+ * @param string $expression An expression evaluating to int
+ * @return string Expression returning a string
+ */
+ public function cast_expr_to_string($expression);
+
+ /**
+ * Connect to server
+ *
+ * @param string $sqlserver Address of the database server
+ * @param string $sqluser User name of the SQL user
+ * @param string $sqlpassword Password of the SQL user
+ * @param string $database Name of the database
+ * @param mixed $port Port of the database server
+ * @param bool $persistency
+ * @param bool $new_link Should a new connection be established
+ * @return mixed Connection ID on success, string error message otherwise
+ */
+ public function sql_connect($sqlserver, $sqluser, $sqlpassword, $database, $port = false, $persistency = false, $new_link = false);
+
+ /**
+ * Run binary AND operator on DB column.
+ * Results in sql statement: "{$column_name} & (1 << {$bit}) {$compare}"
+ *
+ * @param string $column_name The column name to use
+ * @param int $bit The value to use for the AND operator,
+ * will be converted to (1 << $bit). Is used by
+ * options, using the number schema: 0, 1, 2...29
+ * @param string $compare Any custom SQL code after the check (for example "= 0")
+ * @return string A SQL statement like: "{$column} & (1 << {$bit}) {$compare}"
+ */
+ public function sql_bit_and($column_name, $bit, $compare = '');
+
+ /**
+ * Free sql result
+ *
+ * @param mixed $query_id Already executed query result,
+ * if false, the last query will be used.
+ * @return null
+ */
+ public function sql_freeresult($query_id = false);
+
+ /**
+ * Return number of sql queries and cached sql queries used
+ *
+ * @param bool $cached Should we return the number of cached or normal queries?
+ * @return int Number of queries that have been executed
+ */
+ public function sql_num_queries($cached = false);
+
+ /**
+ * Run more than one insert statement.
+ *
+ * @param string $table Table name to run the statements on
+ * @param array $sql_ary Multi-dimensional array holding the statement data
+ * @return bool false if no statements were executed.
+ */
+ public function sql_multi_insert($table, $sql_ary);
+
+ /**
+ * Return number of affected rows
+ *
+ * @return mixed Number of the affected rows by the last query
+ * false if no query has been run before
+ */
+ public function sql_affectedrows();
+
+ /**
+ * DBAL garbage collection, close SQL connection
+ *
+ * @return mixed False if no connection was opened before,
+ * Server response otherwise
+ */
+ public function sql_close();
+
+ /**
+ * Seek to given row number
+ *
+ * @param mixed $rownum Row number the curser should point to
+ * Note: $rownum is 0 based
+ * @param mixed $query_id ID of the query to set the row cursor on
+ * if false, the last query will be used.
+ * $query_id will then be set correctly
+ * @return bool False if something went wrong
+ */
+ public function sql_rowseek($rownum, &$query_id);
+
+ /**
+ * Escape string used in sql query
+ *
+ * @param string $msg String to be escaped
+ * @return string Escaped version of $msg
+ */
+ public function sql_escape($msg);
+
+ /**
+ * Correctly adjust LIKE expression for special characters
+ * Some DBMS are handling them in a different way
+ *
+ * @param string $expression The expression to use. Every wildcard is
+ * escaped, except $this->any_char and $this->one_char
+ * @return string A SQL statement like: "LIKE 'bertie_%'"
+ */
+ public function sql_like_expression($expression);
+
+ /**
+ * Correctly adjust NOT LIKE expression for special characters
+ * Some DBMS are handling them in a different way
+ *
+ * @param string $expression The expression to use. Every wildcard is
+ * escaped, except $this->any_char and $this->one_char
+ * @return string A SQL statement like: "NOT LIKE 'bertie_%'"
+ */
+ public function sql_not_like_expression($expression);
+
+ /**
+ * Explain queries
+ *
+ * @param string $mode Available modes: display, start, stop,
+ * add_select_row, fromcache, record_fromcache
+ * @param string $query The Query that should be explained
+ * @return mixed Either a full HTML page, boolean or null
+ */
+ public function sql_report($mode, $query = '');
+
+ /**
+ * Build IN or NOT IN sql comparison string, uses <> or = on single element
+ * arrays to improve comparison speed
+ *
+ * @param string $field Name of the sql column that shall be compared
+ * @param array $array Array of values that are (not) allowed
+ * @param bool $negate true for NOT IN (), false for IN ()
+ * @param bool $allow_empty_set If true, allow $array to be empty,
+ * this function will return 1=1 or 1=0 then.
+ * @return string A SQL statement like: "IN (1, 2, 3, 4)" or "= 1"
+ */
+ public function sql_in_set($field, $array, $negate = false, $allow_empty_set = false);
+}
diff --git a/phpBB/phpbb/db/driver/factory.php b/phpBB/phpbb/db/driver/factory.php
new file mode 100644
index 0000000000..fb3a826254
--- /dev/null
+++ b/phpBB/phpbb/db/driver/factory.php
@@ -0,0 +1,443 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\driver;
+
+use \Symfony\Component\DependencyInjection\ContainerInterface;
+
+/**
+* Database Abstraction Layer
+*/
+class factory implements driver_interface
+{
+ /**
+ * @var driver_interface
+ */
+ protected $driver = null;
+
+ /**
+ * @var ContainerInterface
+ */
+ protected $container;
+
+ /**
+ * Constructor.
+ *
+ * @param ContainerInterface $container A ContainerInterface instance
+ */
+ public function __construct(ContainerInterface $container)
+ {
+ $this->container = $container;
+ }
+
+ /**
+ * Return the current driver (and retrieved it from the container if necessary)
+ *
+ * @return driver_interface
+ */
+ protected function get_driver()
+ {
+ if ($this->driver === null)
+ {
+ $this->driver = $this->container->get('dbal.conn.driver');
+ }
+
+ return $this->driver;
+ }
+
+ /**
+ * Set the current driver
+ *
+ * @param driver_interface $driver
+ */
+ public function set_driver(driver_interface $driver)
+ {
+ $this->driver = $driver;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_sql_layer()
+ {
+ return $this->get_driver()->get_sql_layer();
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_db_name()
+ {
+ return $this->get_driver()->get_db_name();
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_any_char()
+ {
+ return $this->get_driver()->get_any_char();
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_one_char()
+ {
+ return $this->get_driver()->get_one_char();
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_db_connect_id()
+ {
+ return $this->get_driver()->get_db_connect_id();
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_sql_error_triggered()
+ {
+ return $this->get_driver()->get_sql_error_triggered();
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_sql_error_sql()
+ {
+ return $this->get_driver()->get_sql_error_sql();
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_transaction()
+ {
+ return $this->get_driver()->get_transaction();
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_sql_time()
+ {
+ return $this->get_driver()->get_sql_time();
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_sql_error_returned()
+ {
+ return $this->get_driver()->get_sql_error_returned();
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_multi_insert()
+ {
+ return $this->get_driver()->get_multi_insert();
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function set_multi_insert($multi_insert)
+ {
+ $this->get_driver()->set_multi_insert($multi_insert);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_row_count($table_name)
+ {
+ return $this->get_driver()->get_row_count($table_name);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_estimated_row_count($table_name)
+ {
+ return $this->get_driver()->get_estimated_row_count($table_name);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function sql_lower_text($column_name)
+ {
+ return $this->get_driver()->sql_lower_text($column_name);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function sql_error($sql = '')
+ {
+ return $this->get_driver()->sql_error($sql);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function sql_buffer_nested_transactions()
+ {
+ return $this->get_driver()->sql_buffer_nested_transactions();
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function sql_bit_or($column_name, $bit, $compare = '')
+ {
+ return $this->get_driver()->sql_bit_or($column_name, $bit, $compare);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function sql_server_info($raw = false, $use_cache = true)
+ {
+ return $this->get_driver()->sql_server_info($raw, $use_cache);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function sql_return_on_error($fail = false)
+ {
+ return $this->get_driver()->sql_return_on_error($fail);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function sql_build_array($query, $assoc_ary = array())
+ {
+ return $this->get_driver()->sql_build_array($query, $assoc_ary);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function sql_fetchrowset($query_id = false)
+ {
+ return $this->get_driver()->sql_fetchrowset($query_id);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function sql_transaction($status = 'begin')
+ {
+ return $this->get_driver()->sql_transaction($status);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function sql_concatenate($expr1, $expr2)
+ {
+ return $this->get_driver()->sql_concatenate($expr1, $expr2);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function sql_case($condition, $action_true, $action_false = false)
+ {
+ return $this->get_driver()->sql_case($condition, $action_true, $action_false);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function sql_build_query($query, $array)
+ {
+ return $this->get_driver()->sql_build_query($query, $array);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function sql_fetchfield($field, $rownum = false, $query_id = false)
+ {
+ return $this->get_driver()->sql_fetchfield($field, $rownum, $query_id);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function sql_fetchrow($query_id = false)
+ {
+ return $this->get_driver()->sql_fetchrow($query_id);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function cast_expr_to_bigint($expression)
+ {
+ return $this->get_driver()->cast_expr_to_bigint($expression);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function sql_nextid()
+ {
+ return $this->get_driver()->sql_nextid();
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function sql_add_num_queries($cached = false)
+ {
+ return $this->get_driver()->sql_add_num_queries($cached);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function sql_query_limit($query, $total, $offset = 0, $cache_ttl = 0)
+ {
+ return $this->get_driver()->sql_query_limit($query, $total, $offset, $cache_ttl);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function sql_query($query = '', $cache_ttl = 0)
+ {
+ return $this->get_driver()->sql_query($query, $cache_ttl);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function cast_expr_to_string($expression)
+ {
+ return $this->get_driver()->cast_expr_to_string($expression);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function sql_connect($sqlserver, $sqluser, $sqlpassword, $database, $port = false, $persistency = false, $new_link = false)
+ {
+ throw new \Exception('Disabled method.');
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function sql_bit_and($column_name, $bit, $compare = '')
+ {
+ return $this->get_driver()->sql_bit_and($column_name, $bit, $compare);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function sql_freeresult($query_id = false)
+ {
+ return $this->get_driver()->sql_freeresult($query_id);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function sql_num_queries($cached = false)
+ {
+ return $this->get_driver()->sql_num_queries($cached);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function sql_multi_insert($table, $sql_ary)
+ {
+ return $this->get_driver()->sql_multi_insert($table, $sql_ary);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function sql_affectedrows()
+ {
+ return $this->get_driver()->sql_affectedrows();
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function sql_close()
+ {
+ return $this->get_driver()->sql_close();
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function sql_rowseek($rownum, &$query_id)
+ {
+ return $this->get_driver()->sql_rowseek($rownum, $query_id);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function sql_escape($msg)
+ {
+ return $this->get_driver()->sql_escape($msg);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function sql_like_expression($expression)
+ {
+ return $this->get_driver()->sql_like_expression($expression);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function sql_not_like_expression($expression)
+ {
+ return $this->get_driver()->sql_not_like_expression($expression);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function sql_report($mode, $query = '')
+ {
+ return $this->get_driver()->sql_report($mode, $query);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function sql_in_set($field, $array, $negate = false, $allow_empty_set = false)
+ {
+ return $this->get_driver()->sql_in_set($field, $array, $negate, $allow_empty_set);
+ }
+}
diff --git a/phpBB/phpbb/db/driver/mssql.php b/phpBB/phpbb/db/driver/mssql.php
new file mode 100644
index 0000000000..f9ea884ce2
--- /dev/null
+++ b/phpBB/phpbb/db/driver/mssql.php
@@ -0,0 +1,476 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\driver;
+
+/**
+* MSSQL Database Abstraction Layer
+* Minimum Requirement is MSSQL 2000+
+*/
+class mssql extends \phpbb\db\driver\driver
+{
+ var $connect_error = '';
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_connect($sqlserver, $sqluser, $sqlpassword, $database, $port = false, $persistency = false, $new_link = false)
+ {
+ if (!function_exists('mssql_connect'))
+ {
+ $this->connect_error = 'mssql_connect function does not exist, is mssql extension installed?';
+ return $this->sql_error('');
+ }
+
+ $this->persistency = $persistency;
+ $this->user = $sqluser;
+ $this->dbname = $database;
+
+ $port_delimiter = (defined('PHP_OS') && substr(PHP_OS, 0, 3) === 'WIN') ? ',' : ':';
+ $this->server = $sqlserver . (($port) ? $port_delimiter . $port : '');
+
+ @ini_set('mssql.charset', 'UTF-8');
+ @ini_set('mssql.textlimit', 2147483647);
+ @ini_set('mssql.textsize', 2147483647);
+
+ $this->db_connect_id = ($this->persistency) ? @mssql_pconnect($this->server, $this->user, $sqlpassword, $new_link) : @mssql_connect($this->server, $this->user, $sqlpassword, $new_link);
+
+ if ($this->db_connect_id && $this->dbname != '')
+ {
+ if (!@mssql_select_db($this->dbname, $this->db_connect_id))
+ {
+ @mssql_close($this->db_connect_id);
+ return false;
+ }
+ }
+
+ return ($this->db_connect_id) ? $this->db_connect_id : $this->sql_error('');
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_server_info($raw = false, $use_cache = true)
+ {
+ global $cache;
+
+ if (!$use_cache || empty($cache) || ($this->sql_server_version = $cache->get('mssql_version')) === false)
+ {
+ $result_id = @mssql_query("SELECT SERVERPROPERTY('productversion'), SERVERPROPERTY('productlevel'), SERVERPROPERTY('edition')", $this->db_connect_id);
+
+ $row = false;
+ if ($result_id)
+ {
+ $row = @mssql_fetch_assoc($result_id);
+ @mssql_free_result($result_id);
+ }
+
+ $this->sql_server_version = ($row) ? trim(implode(' ', $row)) : 0;
+
+ if (!empty($cache) && $use_cache)
+ {
+ $cache->put('mssql_version', $this->sql_server_version);
+ }
+ }
+
+ if ($raw)
+ {
+ return $this->sql_server_version;
+ }
+
+ return ($this->sql_server_version) ? 'MSSQL<br />' . $this->sql_server_version : 'MSSQL';
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function sql_concatenate($expr1, $expr2)
+ {
+ return $expr1 . ' + ' . $expr2;
+ }
+
+ /**
+ * SQL Transaction
+ * @access private
+ */
+ function _sql_transaction($status = 'begin')
+ {
+ switch ($status)
+ {
+ case 'begin':
+ return @mssql_query('BEGIN TRANSACTION', $this->db_connect_id);
+ break;
+
+ case 'commit':
+ return @mssql_query('COMMIT TRANSACTION', $this->db_connect_id);
+ break;
+
+ case 'rollback':
+ return @mssql_query('ROLLBACK TRANSACTION', $this->db_connect_id);
+ break;
+ }
+
+ return true;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_query($query = '', $cache_ttl = 0)
+ {
+ if ($query != '')
+ {
+ global $cache;
+
+ // EXPLAIN only in extra debug mode
+ if (defined('DEBUG'))
+ {
+ $this->sql_report('start', $query);
+ }
+ else if (defined('PHPBB_DISPLAY_LOAD_TIME'))
+ {
+ $this->curtime = microtime(true);
+ }
+
+ $this->query_result = ($cache && $cache_ttl) ? $cache->sql_load($query) : false;
+ $this->sql_add_num_queries($this->query_result);
+
+ if ($this->query_result === false)
+ {
+ if (($this->query_result = @mssql_query($query, $this->db_connect_id)) === false)
+ {
+ $this->sql_error($query);
+ }
+
+ if (defined('DEBUG'))
+ {
+ $this->sql_report('stop', $query);
+ }
+ else if (defined('PHPBB_DISPLAY_LOAD_TIME'))
+ {
+ $this->sql_time += microtime(true) - $this->curtime;
+ }
+
+ if ($cache && $cache_ttl)
+ {
+ $this->open_queries[(int) $this->query_result] = $this->query_result;
+ $this->query_result = $cache->sql_save($this, $query, $this->query_result, $cache_ttl);
+ }
+ else if (strpos($query, 'SELECT') === 0 && $this->query_result)
+ {
+ $this->open_queries[(int) $this->query_result] = $this->query_result;
+ }
+ }
+ else if (defined('DEBUG'))
+ {
+ $this->sql_report('fromcache', $query);
+ }
+ }
+ else
+ {
+ return false;
+ }
+
+ return $this->query_result;
+ }
+
+ /**
+ * Build LIMIT query
+ */
+ function _sql_query_limit($query, $total, $offset = 0, $cache_ttl = 0)
+ {
+ $this->query_result = false;
+
+ // Since TOP is only returning a set number of rows we won't need it if total is set to 0 (return all rows)
+ if ($total)
+ {
+ // We need to grab the total number of rows + the offset number of rows to get the correct result
+ if (strpos($query, 'SELECT DISTINCT') === 0)
+ {
+ $query = 'SELECT DISTINCT TOP ' . ($total + $offset) . ' ' . substr($query, 15);
+ }
+ else
+ {
+ $query = 'SELECT TOP ' . ($total + $offset) . ' ' . substr($query, 6);
+ }
+ }
+
+ $result = $this->sql_query($query, $cache_ttl);
+
+ // Seek by $offset rows
+ if ($offset)
+ {
+ $this->sql_rowseek($offset, $result);
+ }
+
+ return $result;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_affectedrows()
+ {
+ return ($this->db_connect_id) ? @mssql_rows_affected($this->db_connect_id) : false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_fetchrow($query_id = false)
+ {
+ global $cache;
+
+ if ($query_id === false)
+ {
+ $query_id = $this->query_result;
+ }
+
+ if ($cache && $cache->sql_exists($query_id))
+ {
+ return $cache->sql_fetchrow($query_id);
+ }
+
+ if ($query_id === false)
+ {
+ return false;
+ }
+
+ $row = @mssql_fetch_assoc($query_id);
+
+ // I hope i am able to remove this later... hopefully only a PHP or MSSQL bug
+ if ($row)
+ {
+ foreach ($row as $key => $value)
+ {
+ $row[$key] = ($value === ' ' || $value === null) ? '' : $value;
+ }
+ }
+
+ return $row;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_rowseek($rownum, &$query_id)
+ {
+ global $cache;
+
+ if ($query_id === false)
+ {
+ $query_id = $this->query_result;
+ }
+
+ if ($cache && $cache->sql_exists($query_id))
+ {
+ return $cache->sql_rowseek($rownum, $query_id);
+ }
+
+ return ($query_id !== false) ? @mssql_data_seek($query_id, $rownum) : false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_nextid()
+ {
+ $result_id = @mssql_query('SELECT SCOPE_IDENTITY()', $this->db_connect_id);
+ if ($result_id)
+ {
+ if ($row = @mssql_fetch_assoc($result_id))
+ {
+ @mssql_free_result($result_id);
+ return $row['computed'];
+ }
+ @mssql_free_result($result_id);
+ }
+
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_freeresult($query_id = false)
+ {
+ global $cache;
+
+ if ($query_id === false)
+ {
+ $query_id = $this->query_result;
+ }
+
+ if ($cache && !is_object($query_id) && $cache->sql_exists($query_id))
+ {
+ return $cache->sql_freeresult($query_id);
+ }
+
+ if (isset($this->open_queries[(int) $query_id]))
+ {
+ unset($this->open_queries[(int) $query_id]);
+ return @mssql_free_result($query_id);
+ }
+
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_escape($msg)
+ {
+ return str_replace(array("'", "\0"), array("''", ''), $msg);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_lower_text($column_name)
+ {
+ return "LOWER(SUBSTRING($column_name, 1, DATALENGTH($column_name)))";
+ }
+
+ /**
+ * Build LIKE expression
+ * @access private
+ */
+ function _sql_like_expression($expression)
+ {
+ return $expression . " ESCAPE '\\'";
+ }
+
+ /**
+ * Build NOT LIKE expression
+ * @access private
+ */
+ function _sql_not_like_expression($expression)
+ {
+ return $expression . " ESCAPE '\\'";
+ }
+
+ /**
+ * return sql error array
+ * @access private
+ */
+ function _sql_error()
+ {
+ if (function_exists('mssql_get_last_message'))
+ {
+ $error = array(
+ 'message' => @mssql_get_last_message(),
+ 'code' => '',
+ );
+
+ // Get error code number
+ $result_id = @mssql_query('SELECT @@ERROR as code', $this->db_connect_id);
+ if ($result_id)
+ {
+ $row = @mssql_fetch_assoc($result_id);
+ $error['code'] = $row['code'];
+ @mssql_free_result($result_id);
+ }
+
+ // Get full error message if possible
+ $sql = 'SELECT CAST(description as varchar(255)) as message
+ FROM master.dbo.sysmessages
+ WHERE error = ' . $error['code'];
+ $result_id = @mssql_query($sql);
+
+ if ($result_id)
+ {
+ $row = @mssql_fetch_assoc($result_id);
+ if (!empty($row['message']))
+ {
+ $error['message'] .= '<br />' . $row['message'];
+ }
+ @mssql_free_result($result_id);
+ }
+ }
+ else
+ {
+ $error = array(
+ 'message' => $this->connect_error,
+ 'code' => '',
+ );
+ }
+
+ return $error;
+ }
+
+ /**
+ * Build db-specific query data
+ * @access private
+ */
+ function _sql_custom_build($stage, $data)
+ {
+ return $data;
+ }
+
+ /**
+ * Close sql connection
+ * @access private
+ */
+ function _sql_close()
+ {
+ return @mssql_close($this->db_connect_id);
+ }
+
+ /**
+ * Build db-specific report
+ * @access private
+ */
+ function _sql_report($mode, $query = '')
+ {
+ switch ($mode)
+ {
+ case 'start':
+ $html_table = false;
+ @mssql_query('SET SHOWPLAN_TEXT ON;', $this->db_connect_id);
+ if ($result = @mssql_query($query, $this->db_connect_id))
+ {
+ @mssql_next_result($result);
+ while ($row = @mssql_fetch_row($result))
+ {
+ $html_table = $this->sql_report('add_select_row', $query, $html_table, $row);
+ }
+ }
+ @mssql_query('SET SHOWPLAN_TEXT OFF;', $this->db_connect_id);
+ @mssql_free_result($result);
+
+ if ($html_table)
+ {
+ $this->html_hold .= '</table>';
+ }
+ break;
+
+ case 'fromcache':
+ $endtime = explode(' ', microtime());
+ $endtime = $endtime[0] + $endtime[1];
+
+ $result = @mssql_query($query, $this->db_connect_id);
+ while ($void = @mssql_fetch_assoc($result))
+ {
+ // Take the time spent on parsing rows into account
+ }
+ @mssql_free_result($result);
+
+ $splittime = explode(' ', microtime());
+ $splittime = $splittime[0] + $splittime[1];
+
+ $this->sql_report('record_fromcache', $query, $endtime, $splittime);
+
+ break;
+ }
+ }
+}
diff --git a/phpBB/phpbb/db/driver/mssql_base.php b/phpBB/phpbb/db/driver/mssql_base.php
new file mode 100644
index 0000000000..514df9eaca
--- /dev/null
+++ b/phpBB/phpbb/db/driver/mssql_base.php
@@ -0,0 +1,71 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\driver;
+
+/**
+* MSSQL Database Base Abstraction Layer
+ */
+abstract class mssql_base extends \phpbb\db\driver\driver
+{
+ /**
+ * {@inheritDoc}
+ */
+ public function sql_concatenate($expr1, $expr2)
+ {
+ return $expr1 . ' + ' . $expr2;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_escape($msg)
+ {
+ return str_replace(array("'", "\0"), array("''", ''), $msg);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_lower_text($column_name)
+ {
+ return "LOWER(SUBSTRING($column_name, 1, DATALENGTH($column_name)))";
+ }
+
+ /**
+ * Build LIKE expression
+ * @access private
+ */
+ function _sql_like_expression($expression)
+ {
+ return $expression . " ESCAPE '\\'";
+ }
+
+ /**
+ * Build NOT LIKE expression
+ * @access private
+ */
+ function _sql_not_like_expression($expression)
+ {
+ return $expression . " ESCAPE '\\'";
+ }
+
+ /**
+ * Build db-specific query data
+ * @access private
+ */
+ function _sql_custom_build($stage, $data)
+ {
+ return $data;
+ }
+}
diff --git a/phpBB/phpbb/db/driver/mssql_odbc.php b/phpBB/phpbb/db/driver/mssql_odbc.php
new file mode 100644
index 0000000000..8e5d4c7a4c
--- /dev/null
+++ b/phpBB/phpbb/db/driver/mssql_odbc.php
@@ -0,0 +1,377 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\driver;
+
+/**
+* Unified ODBC functions
+* Unified ODBC functions support any database having ODBC driver, for example Adabas D, IBM DB2, iODBC, Solid, Sybase SQL Anywhere...
+* Here we only support MSSQL Server 2000+ because of the provided schema
+*
+* @note number of bytes returned for returning data depends on odbc.defaultlrl php.ini setting.
+* If it is limited to 4K for example only 4K of data is returned max, resulting in incomplete theme data for example.
+* @note odbc.defaultbinmode may affect UTF8 characters
+*/
+class mssql_odbc extends \phpbb\db\driver\mssql_base
+{
+ var $last_query_text = '';
+ var $connect_error = '';
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_connect($sqlserver, $sqluser, $sqlpassword, $database, $port = false, $persistency = false, $new_link = false)
+ {
+ $this->persistency = $persistency;
+ $this->user = $sqluser;
+ $this->dbname = $database;
+
+ $port_delimiter = (defined('PHP_OS') && substr(PHP_OS, 0, 3) === 'WIN') ? ',' : ':';
+ $this->server = $sqlserver . (($port) ? $port_delimiter . $port : '');
+
+ $max_size = @ini_get('odbc.defaultlrl');
+ if (!empty($max_size))
+ {
+ $unit = strtolower(substr($max_size, -1, 1));
+ $max_size = (int) $max_size;
+
+ if ($unit == 'k')
+ {
+ $max_size = floor($max_size / 1024);
+ }
+ else if ($unit == 'g')
+ {
+ $max_size *= 1024;
+ }
+ else if (is_numeric($unit))
+ {
+ $max_size = floor((int) ($max_size . $unit) / 1048576);
+ }
+ $max_size = max(8, $max_size) . 'M';
+
+ @ini_set('odbc.defaultlrl', $max_size);
+ }
+
+ if ($this->persistency)
+ {
+ if (!function_exists('odbc_pconnect'))
+ {
+ $this->connect_error = 'odbc_pconnect function does not exist, is odbc extension installed?';
+ return $this->sql_error('');
+ }
+ $this->db_connect_id = @odbc_pconnect($this->server, $this->user, $sqlpassword);
+ }
+ else
+ {
+ if (!function_exists('odbc_connect'))
+ {
+ $this->connect_error = 'odbc_connect function does not exist, is odbc extension installed?';
+ return $this->sql_error('');
+ }
+ $this->db_connect_id = @odbc_connect($this->server, $this->user, $sqlpassword);
+ }
+
+ return ($this->db_connect_id) ? $this->db_connect_id : $this->sql_error('');
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_server_info($raw = false, $use_cache = true)
+ {
+ global $cache;
+
+ if (!$use_cache || empty($cache) || ($this->sql_server_version = $cache->get('mssqlodbc_version')) === false)
+ {
+ $result_id = @odbc_exec($this->db_connect_id, "SELECT SERVERPROPERTY('productversion'), SERVERPROPERTY('productlevel'), SERVERPROPERTY('edition')");
+
+ $row = false;
+ if ($result_id)
+ {
+ $row = @odbc_fetch_array($result_id);
+ @odbc_free_result($result_id);
+ }
+
+ $this->sql_server_version = ($row) ? trim(implode(' ', $row)) : 0;
+
+ if (!empty($cache) && $use_cache)
+ {
+ $cache->put('mssqlodbc_version', $this->sql_server_version);
+ }
+ }
+
+ if ($raw)
+ {
+ return $this->sql_server_version;
+ }
+
+ return ($this->sql_server_version) ? 'MSSQL (ODBC)<br />' . $this->sql_server_version : 'MSSQL (ODBC)';
+ }
+
+ /**
+ * SQL Transaction
+ * @access private
+ */
+ function _sql_transaction($status = 'begin')
+ {
+ switch ($status)
+ {
+ case 'begin':
+ return @odbc_exec($this->db_connect_id, 'BEGIN TRANSACTION');
+ break;
+
+ case 'commit':
+ return @odbc_exec($this->db_connect_id, 'COMMIT TRANSACTION');
+ break;
+
+ case 'rollback':
+ return @odbc_exec($this->db_connect_id, 'ROLLBACK TRANSACTION');
+ break;
+ }
+
+ return true;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_query($query = '', $cache_ttl = 0)
+ {
+ if ($query != '')
+ {
+ global $cache;
+
+ // EXPLAIN only in extra debug mode
+ if (defined('DEBUG'))
+ {
+ $this->sql_report('start', $query);
+ }
+ else if (defined('PHPBB_DISPLAY_LOAD_TIME'))
+ {
+ $this->curtime = microtime(true);
+ }
+
+ $this->last_query_text = $query;
+ $this->query_result = ($cache && $cache_ttl) ? $cache->sql_load($query) : false;
+ $this->sql_add_num_queries($this->query_result);
+
+ if ($this->query_result === false)
+ {
+ if (($this->query_result = @odbc_exec($this->db_connect_id, $query)) === false)
+ {
+ $this->sql_error($query);
+ }
+
+ if (defined('DEBUG'))
+ {
+ $this->sql_report('stop', $query);
+ }
+ else if (defined('PHPBB_DISPLAY_LOAD_TIME'))
+ {
+ $this->sql_time += microtime(true) - $this->curtime;
+ }
+
+ if ($cache && $cache_ttl)
+ {
+ $this->open_queries[(int) $this->query_result] = $this->query_result;
+ $this->query_result = $cache->sql_save($this, $query, $this->query_result, $cache_ttl);
+ }
+ else if (strpos($query, 'SELECT') === 0 && $this->query_result)
+ {
+ $this->open_queries[(int) $this->query_result] = $this->query_result;
+ }
+ }
+ else if (defined('DEBUG'))
+ {
+ $this->sql_report('fromcache', $query);
+ }
+ }
+ else
+ {
+ return false;
+ }
+
+ return $this->query_result;
+ }
+
+ /**
+ * Build LIMIT query
+ */
+ function _sql_query_limit($query, $total, $offset = 0, $cache_ttl = 0)
+ {
+ $this->query_result = false;
+
+ // Since TOP is only returning a set number of rows we won't need it if total is set to 0 (return all rows)
+ if ($total)
+ {
+ // We need to grab the total number of rows + the offset number of rows to get the correct result
+ if (strpos($query, 'SELECT DISTINCT') === 0)
+ {
+ $query = 'SELECT DISTINCT TOP ' . ($total + $offset) . ' ' . substr($query, 15);
+ }
+ else
+ {
+ $query = 'SELECT TOP ' . ($total + $offset) . ' ' . substr($query, 6);
+ }
+ }
+
+ $result = $this->sql_query($query, $cache_ttl);
+
+ // Seek by $offset rows
+ if ($offset)
+ {
+ $this->sql_rowseek($offset, $result);
+ }
+
+ return $result;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_affectedrows()
+ {
+ return ($this->db_connect_id) ? @odbc_num_rows($this->query_result) : false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_fetchrow($query_id = false)
+ {
+ global $cache;
+
+ if ($query_id === false)
+ {
+ $query_id = $this->query_result;
+ }
+
+ if ($cache && $cache->sql_exists($query_id))
+ {
+ return $cache->sql_fetchrow($query_id);
+ }
+
+ return ($query_id !== false) ? @odbc_fetch_array($query_id) : false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_nextid()
+ {
+ $result_id = @odbc_exec($this->db_connect_id, 'SELECT @@IDENTITY');
+
+ if ($result_id)
+ {
+ if (@odbc_fetch_array($result_id))
+ {
+ $id = @odbc_result($result_id, 1);
+ @odbc_free_result($result_id);
+ return $id;
+ }
+ @odbc_free_result($result_id);
+ }
+
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_freeresult($query_id = false)
+ {
+ global $cache;
+
+ if ($query_id === false)
+ {
+ $query_id = $this->query_result;
+ }
+
+ if ($cache && !is_object($query_id) && $cache->sql_exists($query_id))
+ {
+ return $cache->sql_freeresult($query_id);
+ }
+
+ if (isset($this->open_queries[(int) $query_id]))
+ {
+ unset($this->open_queries[(int) $query_id]);
+ return @odbc_free_result($query_id);
+ }
+
+ return false;
+ }
+
+ /**
+ * return sql error array
+ * @access private
+ */
+ function _sql_error()
+ {
+ if (function_exists('odbc_errormsg'))
+ {
+ $error = array(
+ 'message' => @odbc_errormsg(),
+ 'code' => @odbc_error(),
+ );
+ }
+ else
+ {
+ $error = array(
+ 'message' => $this->connect_error,
+ 'code' => '',
+ );
+ }
+
+ return $error;
+ }
+
+ /**
+ * Close sql connection
+ * @access private
+ */
+ function _sql_close()
+ {
+ return @odbc_close($this->db_connect_id);
+ }
+
+ /**
+ * Build db-specific report
+ * @access private
+ */
+ function _sql_report($mode, $query = '')
+ {
+ switch ($mode)
+ {
+ case 'start':
+ break;
+
+ case 'fromcache':
+ $endtime = explode(' ', microtime());
+ $endtime = $endtime[0] + $endtime[1];
+
+ $result = @odbc_exec($this->db_connect_id, $query);
+ while ($void = @odbc_fetch_array($result))
+ {
+ // Take the time spent on parsing rows into account
+ }
+ @odbc_free_result($result);
+
+ $splittime = explode(' ', microtime());
+ $splittime = $splittime[0] + $splittime[1];
+
+ $this->sql_report('record_fromcache', $query, $endtime, $splittime);
+
+ break;
+ }
+ }
+}
diff --git a/phpBB/phpbb/db/driver/mssqlnative.php b/phpBB/phpbb/db/driver/mssqlnative.php
new file mode 100644
index 0000000000..46a9b3a477
--- /dev/null
+++ b/phpBB/phpbb/db/driver/mssqlnative.php
@@ -0,0 +1,442 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+/**
+* This is the MS SQL Server Native database abstraction layer.
+* PHP mssql native driver required.
+* @author Chris Pucci
+*
+*/
+
+namespace phpbb\db\driver;
+
+class mssqlnative extends \phpbb\db\driver\mssql_base
+{
+ var $m_insert_id = null;
+ var $last_query_text = '';
+ var $query_options = array();
+ var $connect_error = '';
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_connect($sqlserver, $sqluser, $sqlpassword, $database, $port = false, $persistency = false, $new_link = false)
+ {
+ // Test for driver support, to avoid suppressed fatal error
+ if (!function_exists('sqlsrv_connect'))
+ {
+ $this->connect_error = 'Native MS SQL Server driver for PHP is missing or needs to be updated. Version 1.1 or later is required to install phpBB3. You can download the driver from: http://www.microsoft.com/sqlserver/2005/en/us/PHP-Driver.aspx';
+ return $this->sql_error('');
+ }
+
+ //set up connection variables
+ $this->persistency = $persistency;
+ $this->user = $sqluser;
+ $this->dbname = $database;
+ $port_delimiter = (defined('PHP_OS') && substr(PHP_OS, 0, 3) === 'WIN') ? ',' : ':';
+ $this->server = $sqlserver . (($port) ? $port_delimiter . $port : '');
+
+ //connect to database
+ $this->db_connect_id = sqlsrv_connect($this->server, array(
+ 'Database' => $this->dbname,
+ 'UID' => $this->user,
+ 'PWD' => $sqlpassword
+ ));
+
+ return ($this->db_connect_id) ? $this->db_connect_id : $this->sql_error('');
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_server_info($raw = false, $use_cache = true)
+ {
+ global $cache;
+
+ if (!$use_cache || empty($cache) || ($this->sql_server_version = $cache->get('mssql_version')) === false)
+ {
+ $arr_server_info = sqlsrv_server_info($this->db_connect_id);
+ $this->sql_server_version = $arr_server_info['SQLServerVersion'];
+
+ if (!empty($cache) && $use_cache)
+ {
+ $cache->put('mssql_version', $this->sql_server_version);
+ }
+ }
+
+ if ($raw)
+ {
+ return $this->sql_server_version;
+ }
+
+ return ($this->sql_server_version) ? 'MSSQL<br />' . $this->sql_server_version : 'MSSQL';
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_buffer_nested_transactions()
+ {
+ return true;
+ }
+
+ /**
+ * SQL Transaction
+ * @access private
+ */
+ function _sql_transaction($status = 'begin')
+ {
+ switch ($status)
+ {
+ case 'begin':
+ return sqlsrv_begin_transaction($this->db_connect_id);
+ break;
+
+ case 'commit':
+ return sqlsrv_commit($this->db_connect_id);
+ break;
+
+ case 'rollback':
+ return sqlsrv_rollback($this->db_connect_id);
+ break;
+ }
+ return true;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_query($query = '', $cache_ttl = 0)
+ {
+ if ($query != '')
+ {
+ global $cache;
+
+ // EXPLAIN only in extra debug mode
+ if (defined('DEBUG'))
+ {
+ $this->sql_report('start', $query);
+ }
+ else if (defined('PHPBB_DISPLAY_LOAD_TIME'))
+ {
+ $this->curtime = microtime(true);
+ }
+
+ $this->last_query_text = $query;
+ $this->query_result = ($cache && $cache_ttl) ? $cache->sql_load($query) : false;
+ $this->sql_add_num_queries($this->query_result);
+
+ if ($this->query_result === false)
+ {
+ if (($this->query_result = @sqlsrv_query($this->db_connect_id, $query, array(), $this->query_options)) === false)
+ {
+ $this->sql_error($query);
+ }
+ // reset options for next query
+ $this->query_options = array();
+
+ if (defined('DEBUG'))
+ {
+ $this->sql_report('stop', $query);
+ }
+ else if (defined('PHPBB_DISPLAY_LOAD_TIME'))
+ {
+ $this->sql_time += microtime(true) - $this->curtime;
+ }
+
+ if ($cache && $cache_ttl)
+ {
+ $this->open_queries[(int) $this->query_result] = $this->query_result;
+ $this->query_result = $cache->sql_save($this, $query, $this->query_result, $cache_ttl);
+ }
+ else if (strpos($query, 'SELECT') === 0 && $this->query_result)
+ {
+ $this->open_queries[(int) $this->query_result] = $this->query_result;
+ }
+ }
+ else if (defined('DEBUG'))
+ {
+ $this->sql_report('fromcache', $query);
+ }
+ }
+ else
+ {
+ return false;
+ }
+ return $this->query_result;
+ }
+
+ /**
+ * Build LIMIT query
+ */
+ function _sql_query_limit($query, $total, $offset = 0, $cache_ttl = 0)
+ {
+ $this->query_result = false;
+
+ // total == 0 means all results - not zero results
+ if ($offset == 0 && $total !== 0)
+ {
+ if (strpos($query, "SELECT") === false)
+ {
+ $query = "TOP {$total} " . $query;
+ }
+ else
+ {
+ $query = preg_replace('/SELECT(\s*DISTINCT)?/Dsi', 'SELECT$1 TOP '.$total, $query);
+ }
+ }
+ else if ($offset > 0)
+ {
+ $query = preg_replace('/SELECT(\s*DISTINCT)?/Dsi', 'SELECT$1 TOP(10000000) ', $query);
+ $query = 'SELECT *
+ FROM (SELECT sub2.*, ROW_NUMBER() OVER(ORDER BY sub2.line2) AS line3
+ FROM (SELECT 1 AS line2, sub1.* FROM (' . $query . ') AS sub1) as sub2) AS sub3';
+
+ if ($total > 0)
+ {
+ $query .= ' WHERE line3 BETWEEN ' . ($offset+1) . ' AND ' . ($offset + $total);
+ }
+ else
+ {
+ $query .= ' WHERE line3 > ' . $offset;
+ }
+ }
+
+ $result = $this->sql_query($query, $cache_ttl);
+
+ return $result;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_affectedrows()
+ {
+ return ($this->db_connect_id) ? @sqlsrv_rows_affected($this->query_result) : false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_fetchrow($query_id = false)
+ {
+ global $cache;
+
+ if ($query_id === false)
+ {
+ $query_id = $this->query_result;
+ }
+
+ if ($cache && $cache->sql_exists($query_id))
+ {
+ return $cache->sql_fetchrow($query_id);
+ }
+
+ if ($query_id === false)
+ {
+ return false;
+ }
+
+ $row = @sqlsrv_fetch_array($query_id, SQLSRV_FETCH_ASSOC);
+
+ if ($row)
+ {
+ foreach ($row as $key => $value)
+ {
+ $row[$key] = ($value === ' ' || $value === null) ? '' : $value;
+ }
+
+ // remove helper values from LIMIT queries
+ if (isset($row['line2']))
+ {
+ unset($row['line2'], $row['line3']);
+ }
+ }
+ return (sizeof($row)) ? $row : false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_nextid()
+ {
+ $result_id = @sqlsrv_query($this->db_connect_id, 'SELECT @@IDENTITY');
+
+ if ($result_id !== false)
+ {
+ $row = @sqlsrv_fetch_array($result_id);
+ $id = $row[0];
+ @sqlsrv_free_stmt($result_id);
+ return $id;
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_freeresult($query_id = false)
+ {
+ global $cache;
+
+ if ($query_id === false)
+ {
+ $query_id = $this->query_result;
+ }
+
+ if ($cache && !is_object($query_id) && $cache->sql_exists($query_id))
+ {
+ return $cache->sql_freeresult($query_id);
+ }
+
+ if (isset($this->open_queries[(int) $query_id]))
+ {
+ unset($this->open_queries[(int) $query_id]);
+ return @sqlsrv_free_stmt($query_id);
+ }
+
+ return false;
+ }
+
+ /**
+ * return sql error array
+ * @access private
+ */
+ function _sql_error()
+ {
+ if (function_exists('sqlsrv_errors'))
+ {
+ $errors = @sqlsrv_errors(SQLSRV_ERR_ERRORS);
+ $error_message = '';
+ $code = 0;
+
+ if ($errors != null)
+ {
+ foreach ($errors as $error)
+ {
+ $error_message .= "SQLSTATE: " . $error['SQLSTATE'] . "\n";
+ $error_message .= "code: " . $error['code'] . "\n";
+ $code = $error['code'];
+ $error_message .= "message: " . $error['message'] . "\n";
+ }
+ $this->last_error_result = $error_message;
+ $error = $this->last_error_result;
+ }
+ else
+ {
+ $error = (isset($this->last_error_result) && $this->last_error_result) ? $this->last_error_result : array();
+ }
+
+ $error = array(
+ 'message' => $error,
+ 'code' => $code,
+ );
+ }
+ else
+ {
+ $error = array(
+ 'message' => $this->connect_error,
+ 'code' => '',
+ );
+ }
+
+ return $error;
+ }
+
+ /**
+ * Close sql connection
+ * @access private
+ */
+ function _sql_close()
+ {
+ return @sqlsrv_close($this->db_connect_id);
+ }
+
+ /**
+ * Build db-specific report
+ * @access private
+ */
+ function _sql_report($mode, $query = '')
+ {
+ switch ($mode)
+ {
+ case 'start':
+ $html_table = false;
+ @sqlsrv_query($this->db_connect_id, 'SET SHOWPLAN_TEXT ON;');
+ if ($result = @sqlsrv_query($this->db_connect_id, $query))
+ {
+ @sqlsrv_next_result($result);
+ while ($row = @sqlsrv_fetch_array($result))
+ {
+ $html_table = $this->sql_report('add_select_row', $query, $html_table, $row);
+ }
+ }
+ @sqlsrv_query($this->db_connect_id, 'SET SHOWPLAN_TEXT OFF;');
+ @sqlsrv_free_stmt($result);
+
+ if ($html_table)
+ {
+ $this->html_hold .= '</table>';
+ }
+ break;
+
+ case 'fromcache':
+ $endtime = explode(' ', microtime());
+ $endtime = $endtime[0] + $endtime[1];
+
+ $result = @sqlsrv_query($this->db_connect_id, $query);
+ while ($void = @sqlsrv_fetch_array($result))
+ {
+ // Take the time spent on parsing rows into account
+ }
+ @sqlsrv_free_stmt($result);
+
+ $splittime = explode(' ', microtime());
+ $splittime = $splittime[0] + $splittime[1];
+
+ $this->sql_report('record_fromcache', $query, $endtime, $splittime);
+
+ break;
+ }
+ }
+
+ /**
+ * Utility method used to retrieve number of rows
+ * Emulates mysql_num_rows
+ * Used in acp_database.php -> write_data_mssqlnative()
+ * Requires a static or keyset cursor to be definde via
+ * mssqlnative_set_query_options()
+ */
+ function mssqlnative_num_rows($res)
+ {
+ if ($res !== false)
+ {
+ return sqlsrv_num_rows($res);
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ /**
+ * Allows setting mssqlnative specific query options passed to sqlsrv_query as 4th parameter.
+ */
+ function mssqlnative_set_query_options($options)
+ {
+ $this->query_options = $options;
+ }
+}
diff --git a/phpBB/phpbb/db/driver/mysql.php b/phpBB/phpbb/db/driver/mysql.php
new file mode 100644
index 0000000000..e93c7239e8
--- /dev/null
+++ b/phpBB/phpbb/db/driver/mysql.php
@@ -0,0 +1,485 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\driver;
+
+/**
+* MySQL4 Database Abstraction Layer
+* Compatible with:
+* MySQL 3.23+
+* MySQL 4.0+
+* MySQL 4.1+
+* MySQL 5.0+
+*/
+class mysql extends \phpbb\db\driver\mysql_base
+{
+ var $multi_insert = true;
+ var $connect_error = '';
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_connect($sqlserver, $sqluser, $sqlpassword, $database, $port = false, $persistency = false, $new_link = false)
+ {
+ $this->persistency = $persistency;
+ $this->user = $sqluser;
+ $this->server = $sqlserver . (($port) ? ':' . $port : '');
+ $this->dbname = $database;
+
+ $this->sql_layer = 'mysql4';
+
+ if ($this->persistency)
+ {
+ if (!function_exists('mysql_pconnect'))
+ {
+ $this->connect_error = 'mysql_pconnect function does not exist, is mysql extension installed?';
+ return $this->sql_error('');
+ }
+ $this->db_connect_id = @mysql_pconnect($this->server, $this->user, $sqlpassword);
+ }
+ else
+ {
+ if (!function_exists('mysql_connect'))
+ {
+ $this->connect_error = 'mysql_connect function does not exist, is mysql extension installed?';
+ return $this->sql_error('');
+ }
+ $this->db_connect_id = @mysql_connect($this->server, $this->user, $sqlpassword, $new_link);
+ }
+
+ if ($this->db_connect_id && $this->dbname != '')
+ {
+ if (@mysql_select_db($this->dbname, $this->db_connect_id))
+ {
+ // Determine what version we are using and if it natively supports UNICODE
+ if (version_compare($this->sql_server_info(true), '4.1.0', '>='))
+ {
+ @mysql_query("SET NAMES 'utf8'", $this->db_connect_id);
+
+ // enforce strict mode on databases that support it
+ if (version_compare($this->sql_server_info(true), '5.0.2', '>='))
+ {
+ $result = @mysql_query('SELECT @@session.sql_mode AS sql_mode', $this->db_connect_id);
+ $row = @mysql_fetch_assoc($result);
+ @mysql_free_result($result);
+ $modes = array_map('trim', explode(',', $row['sql_mode']));
+
+ // TRADITIONAL includes STRICT_ALL_TABLES and STRICT_TRANS_TABLES
+ if (!in_array('TRADITIONAL', $modes))
+ {
+ if (!in_array('STRICT_ALL_TABLES', $modes))
+ {
+ $modes[] = 'STRICT_ALL_TABLES';
+ }
+
+ if (!in_array('STRICT_TRANS_TABLES', $modes))
+ {
+ $modes[] = 'STRICT_TRANS_TABLES';
+ }
+ }
+
+ $mode = implode(',', $modes);
+ @mysql_query("SET SESSION sql_mode='{$mode}'", $this->db_connect_id);
+ }
+ }
+ else if (version_compare($this->sql_server_info(true), '4.0.0', '<'))
+ {
+ $this->sql_layer = 'mysql';
+ }
+
+ return $this->db_connect_id;
+ }
+ }
+
+ return $this->sql_error('');
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_server_info($raw = false, $use_cache = true)
+ {
+ global $cache;
+
+ if (!$use_cache || empty($cache) || ($this->sql_server_version = $cache->get('mysql_version')) === false)
+ {
+ $result = @mysql_query('SELECT VERSION() AS version', $this->db_connect_id);
+ $row = @mysql_fetch_assoc($result);
+ @mysql_free_result($result);
+
+ $this->sql_server_version = $row['version'];
+
+ if (!empty($cache) && $use_cache)
+ {
+ $cache->put('mysql_version', $this->sql_server_version);
+ }
+ }
+
+ return ($raw) ? $this->sql_server_version : 'MySQL ' . $this->sql_server_version;
+ }
+
+ /**
+ * SQL Transaction
+ * @access private
+ */
+ function _sql_transaction($status = 'begin')
+ {
+ switch ($status)
+ {
+ case 'begin':
+ return @mysql_query('BEGIN', $this->db_connect_id);
+ break;
+
+ case 'commit':
+ return @mysql_query('COMMIT', $this->db_connect_id);
+ break;
+
+ case 'rollback':
+ return @mysql_query('ROLLBACK', $this->db_connect_id);
+ break;
+ }
+
+ return true;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_query($query = '', $cache_ttl = 0)
+ {
+ if ($query != '')
+ {
+ global $cache;
+
+ // EXPLAIN only in extra debug mode
+ if (defined('DEBUG'))
+ {
+ $this->sql_report('start', $query);
+ }
+ else if (defined('PHPBB_DISPLAY_LOAD_TIME'))
+ {
+ $this->curtime = microtime(true);
+ }
+
+ $this->query_result = ($cache && $cache_ttl) ? $cache->sql_load($query) : false;
+ $this->sql_add_num_queries($this->query_result);
+
+ if ($this->query_result === false)
+ {
+ if (($this->query_result = @mysql_query($query, $this->db_connect_id)) === false)
+ {
+ $this->sql_error($query);
+ }
+
+ if (defined('DEBUG'))
+ {
+ $this->sql_report('stop', $query);
+ }
+ else if (defined('PHPBB_DISPLAY_LOAD_TIME'))
+ {
+ $this->sql_time += microtime(true) - $this->curtime;
+ }
+
+ if ($cache && $cache_ttl)
+ {
+ $this->open_queries[(int) $this->query_result] = $this->query_result;
+ $this->query_result = $cache->sql_save($this, $query, $this->query_result, $cache_ttl);
+ }
+ else if (strpos($query, 'SELECT') === 0 && $this->query_result)
+ {
+ $this->open_queries[(int) $this->query_result] = $this->query_result;
+ }
+ }
+ else if (defined('DEBUG'))
+ {
+ $this->sql_report('fromcache', $query);
+ }
+ }
+ else
+ {
+ return false;
+ }
+
+ return $this->query_result;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_affectedrows()
+ {
+ if ($this->db_connect_id)
+ {
+ // We always want the number of matched rows
+ // instead of changed rows, when running an update.
+ // So when mysql_info() returns the number of matched rows
+ // we return that one instead of mysql_affected_rows()
+ $mysql_info = @mysql_info($this->db_connect_id);
+ if ($mysql_info !== false)
+ {
+ $match = array();
+ preg_match('#^Rows matched: (\d)+ Changed: (\d)+ Warnings: (\d)+$#', $mysql_info, $match);
+ if (isset($match[1]))
+ {
+ return $match[1];
+ }
+ }
+
+ return @mysql_affected_rows($this->db_connect_id);
+ }
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_fetchrow($query_id = false)
+ {
+ global $cache;
+
+ if ($query_id === false)
+ {
+ $query_id = $this->query_result;
+ }
+
+ if ($cache && $cache->sql_exists($query_id))
+ {
+ return $cache->sql_fetchrow($query_id);
+ }
+
+ return ($query_id !== false) ? @mysql_fetch_assoc($query_id) : false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_rowseek($rownum, &$query_id)
+ {
+ global $cache;
+
+ if ($query_id === false)
+ {
+ $query_id = $this->query_result;
+ }
+
+ if ($cache && $cache->sql_exists($query_id))
+ {
+ return $cache->sql_rowseek($rownum, $query_id);
+ }
+
+ return ($query_id !== false) ? @mysql_data_seek($query_id, $rownum) : false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_nextid()
+ {
+ return ($this->db_connect_id) ? @mysql_insert_id($this->db_connect_id) : false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_freeresult($query_id = false)
+ {
+ global $cache;
+
+ if ($query_id === false)
+ {
+ $query_id = $this->query_result;
+ }
+
+ if ($cache && !is_object($query_id) && $cache->sql_exists($query_id))
+ {
+ return $cache->sql_freeresult($query_id);
+ }
+
+ if (isset($this->open_queries[(int) $query_id]))
+ {
+ unset($this->open_queries[(int) $query_id]);
+ return @mysql_free_result($query_id);
+ }
+
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_escape($msg)
+ {
+ if (!$this->db_connect_id)
+ {
+ return @mysql_real_escape_string($msg);
+ }
+
+ return @mysql_real_escape_string($msg, $this->db_connect_id);
+ }
+
+ /**
+ * return sql error array
+ * @access private
+ */
+ function _sql_error()
+ {
+ if ($this->db_connect_id)
+ {
+ $error = array(
+ 'message' => @mysql_error($this->db_connect_id),
+ 'code' => @mysql_errno($this->db_connect_id),
+ );
+ }
+ else if (function_exists('mysql_error'))
+ {
+ $error = array(
+ 'message' => @mysql_error(),
+ 'code' => @mysql_errno(),
+ );
+ }
+ else
+ {
+ $error = array(
+ 'message' => $this->connect_error,
+ 'code' => '',
+ );
+ }
+
+ return $error;
+ }
+
+ /**
+ * Close sql connection
+ * @access private
+ */
+ function _sql_close()
+ {
+ return @mysql_close($this->db_connect_id);
+ }
+
+ /**
+ * Build db-specific report
+ * @access private
+ */
+ function _sql_report($mode, $query = '')
+ {
+ static $test_prof;
+
+ // current detection method, might just switch to see the existance of INFORMATION_SCHEMA.PROFILING
+ if ($test_prof === null)
+ {
+ $test_prof = false;
+ if (version_compare($this->sql_server_info(true), '5.0.37', '>=') && version_compare($this->sql_server_info(true), '5.1', '<'))
+ {
+ $test_prof = true;
+ }
+ }
+
+ switch ($mode)
+ {
+ case 'start':
+
+ $explain_query = $query;
+ if (preg_match('/UPDATE ([a-z0-9_]+).*?WHERE(.*)/s', $query, $m))
+ {
+ $explain_query = 'SELECT * FROM ' . $m[1] . ' WHERE ' . $m[2];
+ }
+ else if (preg_match('/DELETE FROM ([a-z0-9_]+).*?WHERE(.*)/s', $query, $m))
+ {
+ $explain_query = 'SELECT * FROM ' . $m[1] . ' WHERE ' . $m[2];
+ }
+
+ if (preg_match('/^SELECT/', $explain_query))
+ {
+ $html_table = false;
+
+ // begin profiling
+ if ($test_prof)
+ {
+ @mysql_query('SET profiling = 1;', $this->db_connect_id);
+ }
+
+ if ($result = @mysql_query("EXPLAIN $explain_query", $this->db_connect_id))
+ {
+ while ($row = @mysql_fetch_assoc($result))
+ {
+ $html_table = $this->sql_report('add_select_row', $query, $html_table, $row);
+ }
+ }
+ @mysql_free_result($result);
+
+ if ($html_table)
+ {
+ $this->html_hold .= '</table>';
+ }
+
+ if ($test_prof)
+ {
+ $html_table = false;
+
+ // get the last profile
+ if ($result = @mysql_query('SHOW PROFILE ALL;', $this->db_connect_id))
+ {
+ $this->html_hold .= '<br />';
+ while ($row = @mysql_fetch_assoc($result))
+ {
+ // make <unknown> HTML safe
+ if (!empty($row['Source_function']))
+ {
+ $row['Source_function'] = str_replace(array('<', '>'), array('&lt;', '&gt;'), $row['Source_function']);
+ }
+
+ // remove unsupported features
+ foreach ($row as $key => $val)
+ {
+ if ($val === null)
+ {
+ unset($row[$key]);
+ }
+ }
+ $html_table = $this->sql_report('add_select_row', $query, $html_table, $row);
+ }
+ }
+ @mysql_free_result($result);
+
+ if ($html_table)
+ {
+ $this->html_hold .= '</table>';
+ }
+
+ @mysql_query('SET profiling = 0;', $this->db_connect_id);
+ }
+ }
+
+ break;
+
+ case 'fromcache':
+ $endtime = explode(' ', microtime());
+ $endtime = $endtime[0] + $endtime[1];
+
+ $result = @mysql_query($query, $this->db_connect_id);
+ while ($void = @mysql_fetch_assoc($result))
+ {
+ // Take the time spent on parsing rows into account
+ }
+ @mysql_free_result($result);
+
+ $splittime = explode(' ', microtime());
+ $splittime = $splittime[0] + $splittime[1];
+
+ $this->sql_report('record_fromcache', $query, $endtime, $splittime);
+
+ break;
+ }
+ }
+}
diff --git a/phpBB/phpbb/db/driver/mysql_base.php b/phpBB/phpbb/db/driver/mysql_base.php
new file mode 100644
index 0000000000..5e0b359134
--- /dev/null
+++ b/phpBB/phpbb/db/driver/mysql_base.php
@@ -0,0 +1,138 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\driver;
+
+/**
+* Abstract MySQL Database Base Abstraction Layer
+*/
+abstract class mysql_base extends \phpbb\db\driver\driver
+{
+ /**
+ * {@inheritDoc}
+ */
+ public function sql_concatenate($expr1, $expr2)
+ {
+ return 'CONCAT(' . $expr1 . ', ' . $expr2 . ')';
+ }
+
+ /**
+ * Build LIMIT query
+ */
+ function _sql_query_limit($query, $total, $offset = 0, $cache_ttl = 0)
+ {
+ $this->query_result = false;
+
+ // if $total is set to 0 we do not want to limit the number of rows
+ if ($total == 0)
+ {
+ // MySQL 4.1+ no longer supports -1 in limit queries
+ $total = '18446744073709551615';
+ }
+
+ $query .= "\n LIMIT " . ((!empty($offset)) ? $offset . ', ' . $total : $total);
+
+ return $this->sql_query($query, $cache_ttl);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function get_estimated_row_count($table_name)
+ {
+ $table_status = $this->get_table_status($table_name);
+
+ if (isset($table_status['Engine']))
+ {
+ if ($table_status['Engine'] === 'MyISAM')
+ {
+ return $table_status['Rows'];
+ }
+ else if ($table_status['Engine'] === 'InnoDB' && $table_status['Rows'] > 100000)
+ {
+ return '~' . $table_status['Rows'];
+ }
+ }
+
+ return parent::get_row_count($table_name);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function get_row_count($table_name)
+ {
+ $table_status = $this->get_table_status($table_name);
+
+ if (isset($table_status['Engine']) && $table_status['Engine'] === 'MyISAM')
+ {
+ return $table_status['Rows'];
+ }
+
+ return parent::get_row_count($table_name);
+ }
+
+ /**
+ * Gets some information about the specified table.
+ *
+ * @param string $table_name Table name
+ *
+ * @return array
+ *
+ * @access protected
+ */
+ function get_table_status($table_name)
+ {
+ $sql = "SHOW TABLE STATUS
+ LIKE '" . $this->sql_escape($table_name) . "'";
+ $result = $this->sql_query($sql);
+ $table_status = $this->sql_fetchrow($result);
+ $this->sql_freeresult($result);
+
+ return $table_status;
+ }
+
+ /**
+ * Build LIKE expression
+ * @access private
+ */
+ function _sql_like_expression($expression)
+ {
+ return $expression;
+ }
+
+ /**
+ * Build NOT LIKE expression
+ * @access private
+ */
+ function _sql_not_like_expression($expression)
+ {
+ return $expression;
+ }
+
+ /**
+ * Build db-specific query data
+ * @access private
+ */
+ function _sql_custom_build($stage, $data)
+ {
+ switch ($stage)
+ {
+ case 'FROM':
+ $data = '(' . $data . ')';
+ break;
+ }
+
+ return $data;
+ }
+}
diff --git a/phpBB/phpbb/db/driver/mysqli.php b/phpBB/phpbb/db/driver/mysqli.php
new file mode 100644
index 0000000000..c0ddfbf76c
--- /dev/null
+++ b/phpBB/phpbb/db/driver/mysqli.php
@@ -0,0 +1,475 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\driver;
+
+/**
+* MySQLi Database Abstraction Layer
+* mysqli-extension has to be compiled with:
+* MySQL 4.1+ or MySQL 5.0+
+*/
+class mysqli extends \phpbb\db\driver\mysql_base
+{
+ var $multi_insert = true;
+ var $connect_error = '';
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_connect($sqlserver, $sqluser, $sqlpassword, $database, $port = false, $persistency = false, $new_link = false)
+ {
+ if (!function_exists('mysqli_connect'))
+ {
+ $this->connect_error = 'mysqli_connect function does not exist, is mysqli extension installed?';
+ return $this->sql_error('');
+ }
+
+ $this->persistency = $persistency;
+ $this->user = $sqluser;
+
+ // If persistent connection, set dbhost to localhost when empty and prepend it with 'p:' prefix
+ $this->server = ($this->persistency) ? 'p:' . (($sqlserver) ? $sqlserver : 'localhost') : $sqlserver;
+
+ $this->dbname = $database;
+ $port = (!$port) ? null : $port;
+
+ // If port is set and it is not numeric, most likely mysqli socket is set.
+ // Try to map it to the $socket parameter.
+ $socket = null;
+ if ($port)
+ {
+ if (is_numeric($port))
+ {
+ $port = (int) $port;
+ }
+ else
+ {
+ $socket = $port;
+ $port = null;
+ }
+ }
+
+ $this->db_connect_id = mysqli_init();
+
+ if (!@mysqli_real_connect($this->db_connect_id, $this->server, $this->user, $sqlpassword, $this->dbname, $port, $socket, MYSQLI_CLIENT_FOUND_ROWS))
+ {
+ $this->db_connect_id = '';
+ }
+
+ if ($this->db_connect_id && $this->dbname != '')
+ {
+ @mysqli_query($this->db_connect_id, "SET NAMES 'utf8'");
+
+ // enforce strict mode on databases that support it
+ if (version_compare($this->sql_server_info(true), '5.0.2', '>='))
+ {
+ $result = @mysqli_query($this->db_connect_id, 'SELECT @@session.sql_mode AS sql_mode');
+ if ($result !== null)
+ {
+ $row = @mysqli_fetch_assoc($result);
+
+ $modes = array_map('trim', explode(',', $row['sql_mode']));
+ }
+ else
+ {
+ $modes = array();
+ }
+ @mysqli_free_result($result);
+
+ // TRADITIONAL includes STRICT_ALL_TABLES and STRICT_TRANS_TABLES
+ if (!in_array('TRADITIONAL', $modes))
+ {
+ if (!in_array('STRICT_ALL_TABLES', $modes))
+ {
+ $modes[] = 'STRICT_ALL_TABLES';
+ }
+
+ if (!in_array('STRICT_TRANS_TABLES', $modes))
+ {
+ $modes[] = 'STRICT_TRANS_TABLES';
+ }
+ }
+
+ $mode = implode(',', $modes);
+ @mysqli_query($this->db_connect_id, "SET SESSION sql_mode='{$mode}'");
+ }
+ return $this->db_connect_id;
+ }
+
+ return $this->sql_error('');
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_server_info($raw = false, $use_cache = true)
+ {
+ global $cache;
+
+ if (!$use_cache || empty($cache) || ($this->sql_server_version = $cache->get('mysqli_version')) === false)
+ {
+ $result = @mysqli_query($this->db_connect_id, 'SELECT VERSION() AS version');
+ if ($result !== null)
+ {
+ $row = @mysqli_fetch_assoc($result);
+
+ $this->sql_server_version = $row['version'];
+
+ if (!empty($cache) && $use_cache)
+ {
+ $cache->put('mysqli_version', $this->sql_server_version);
+ }
+ }
+ @mysqli_free_result($result);
+ }
+
+ return ($raw) ? $this->sql_server_version : 'MySQL(i) ' . $this->sql_server_version;
+ }
+
+ /**
+ * SQL Transaction
+ * @access private
+ */
+ function _sql_transaction($status = 'begin')
+ {
+ switch ($status)
+ {
+ case 'begin':
+ return @mysqli_autocommit($this->db_connect_id, false);
+ break;
+
+ case 'commit':
+ $result = @mysqli_commit($this->db_connect_id);
+ @mysqli_autocommit($this->db_connect_id, true);
+ return $result;
+ break;
+
+ case 'rollback':
+ $result = @mysqli_rollback($this->db_connect_id);
+ @mysqli_autocommit($this->db_connect_id, true);
+ return $result;
+ break;
+ }
+
+ return true;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_query($query = '', $cache_ttl = 0)
+ {
+ if ($query != '')
+ {
+ global $cache;
+
+ // EXPLAIN only in extra debug mode
+ if (defined('DEBUG'))
+ {
+ $this->sql_report('start', $query);
+ }
+ else if (defined('PHPBB_DISPLAY_LOAD_TIME'))
+ {
+ $this->curtime = microtime(true);
+ }
+
+ $this->query_result = ($cache && $cache_ttl) ? $cache->sql_load($query) : false;
+ $this->sql_add_num_queries($this->query_result);
+
+ if ($this->query_result === false)
+ {
+ if (($this->query_result = @mysqli_query($this->db_connect_id, $query)) === false)
+ {
+ $this->sql_error($query);
+ }
+
+ if (defined('DEBUG'))
+ {
+ $this->sql_report('stop', $query);
+ }
+ else if (defined('PHPBB_DISPLAY_LOAD_TIME'))
+ {
+ $this->sql_time += microtime(true) - $this->curtime;
+ }
+
+ if ($cache && $cache_ttl)
+ {
+ $this->query_result = $cache->sql_save($this, $query, $this->query_result, $cache_ttl);
+ }
+ }
+ else if (defined('DEBUG'))
+ {
+ $this->sql_report('fromcache', $query);
+ }
+ }
+ else
+ {
+ return false;
+ }
+
+ return $this->query_result;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_affectedrows()
+ {
+ return ($this->db_connect_id) ? @mysqli_affected_rows($this->db_connect_id) : false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_fetchrow($query_id = false)
+ {
+ global $cache;
+
+ if ($query_id === false)
+ {
+ $query_id = $this->query_result;
+ }
+
+ if ($cache && !is_object($query_id) && $cache->sql_exists($query_id))
+ {
+ return $cache->sql_fetchrow($query_id);
+ }
+
+ if ($query_id !== false && $query_id !== null)
+ {
+ $result = @mysqli_fetch_assoc($query_id);
+ return $result !== null ? $result : false;
+ }
+
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_rowseek($rownum, &$query_id)
+ {
+ global $cache;
+
+ if ($query_id === false)
+ {
+ $query_id = $this->query_result;
+ }
+
+ if ($cache && !is_object($query_id) && $cache->sql_exists($query_id))
+ {
+ return $cache->sql_rowseek($rownum, $query_id);
+ }
+
+ return ($query_id !== false) ? @mysqli_data_seek($query_id, $rownum) : false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_nextid()
+ {
+ return ($this->db_connect_id) ? @mysqli_insert_id($this->db_connect_id) : false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_freeresult($query_id = false)
+ {
+ global $cache;
+
+ if ($query_id === false)
+ {
+ $query_id = $this->query_result;
+ }
+
+ if ($cache && !is_object($query_id) && $cache->sql_exists($query_id))
+ {
+ return $cache->sql_freeresult($query_id);
+ }
+
+ return @mysqli_free_result($query_id);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_escape($msg)
+ {
+ return @mysqli_real_escape_string($this->db_connect_id, $msg);
+ }
+
+ /**
+ * return sql error array
+ * @access private
+ */
+ function _sql_error()
+ {
+ if ($this->db_connect_id)
+ {
+ $error = array(
+ 'message' => @mysqli_error($this->db_connect_id),
+ 'code' => @mysqli_errno($this->db_connect_id)
+ );
+ }
+ else if (function_exists('mysqli_connect_error'))
+ {
+ $error = array(
+ 'message' => @mysqli_connect_error(),
+ 'code' => @mysqli_connect_errno(),
+ );
+ }
+ else
+ {
+ $error = array(
+ 'message' => $this->connect_error,
+ 'code' => '',
+ );
+ }
+
+ return $error;
+ }
+
+ /**
+ * Close sql connection
+ * @access private
+ */
+ function _sql_close()
+ {
+ return @mysqli_close($this->db_connect_id);
+ }
+
+ /**
+ * Build db-specific report
+ * @access private
+ */
+ function _sql_report($mode, $query = '')
+ {
+ static $test_prof;
+
+ // current detection method, might just switch to see the existance of INFORMATION_SCHEMA.PROFILING
+ if ($test_prof === null)
+ {
+ $test_prof = false;
+ if (strpos(mysqli_get_server_info($this->db_connect_id), 'community') !== false)
+ {
+ $ver = mysqli_get_server_version($this->db_connect_id);
+ if ($ver >= 50037 && $ver < 50100)
+ {
+ $test_prof = true;
+ }
+ }
+ }
+
+ switch ($mode)
+ {
+ case 'start':
+
+ $explain_query = $query;
+ if (preg_match('/UPDATE ([a-z0-9_]+).*?WHERE(.*)/s', $query, $m))
+ {
+ $explain_query = 'SELECT * FROM ' . $m[1] . ' WHERE ' . $m[2];
+ }
+ else if (preg_match('/DELETE FROM ([a-z0-9_]+).*?WHERE(.*)/s', $query, $m))
+ {
+ $explain_query = 'SELECT * FROM ' . $m[1] . ' WHERE ' . $m[2];
+ }
+
+ if (preg_match('/^SELECT/', $explain_query))
+ {
+ $html_table = false;
+
+ // begin profiling
+ if ($test_prof)
+ {
+ @mysqli_query($this->db_connect_id, 'SET profiling = 1;');
+ }
+
+ if ($result = @mysqli_query($this->db_connect_id, "EXPLAIN $explain_query"))
+ {
+ while ($row = @mysqli_fetch_assoc($result))
+ {
+ $html_table = $this->sql_report('add_select_row', $query, $html_table, $row);
+ }
+ }
+ @mysqli_free_result($result);
+
+ if ($html_table)
+ {
+ $this->html_hold .= '</table>';
+ }
+
+ if ($test_prof)
+ {
+ $html_table = false;
+
+ // get the last profile
+ if ($result = @mysqli_query($this->db_connect_id, 'SHOW PROFILE ALL;'))
+ {
+ $this->html_hold .= '<br />';
+ while ($row = @mysqli_fetch_assoc($result))
+ {
+ // make <unknown> HTML safe
+ if (!empty($row['Source_function']))
+ {
+ $row['Source_function'] = str_replace(array('<', '>'), array('&lt;', '&gt;'), $row['Source_function']);
+ }
+
+ // remove unsupported features
+ foreach ($row as $key => $val)
+ {
+ if ($val === null)
+ {
+ unset($row[$key]);
+ }
+ }
+ $html_table = $this->sql_report('add_select_row', $query, $html_table, $row);
+ }
+ }
+ @mysqli_free_result($result);
+
+ if ($html_table)
+ {
+ $this->html_hold .= '</table>';
+ }
+
+ @mysqli_query($this->db_connect_id, 'SET profiling = 0;');
+ }
+ }
+
+ break;
+
+ case 'fromcache':
+ $endtime = explode(' ', microtime());
+ $endtime = $endtime[0] + $endtime[1];
+
+ $result = @mysqli_query($this->db_connect_id, $query);
+ if ($result !== null)
+ {
+ while ($void = @mysqli_fetch_assoc($result))
+ {
+ // Take the time spent on parsing rows into account
+ }
+ }
+ @mysqli_free_result($result);
+
+ $splittime = explode(' ', microtime());
+ $splittime = $splittime[0] + $splittime[1];
+
+ $this->sql_report('record_fromcache', $query, $endtime, $splittime);
+
+ break;
+ }
+ }
+}
diff --git a/phpBB/phpbb/db/driver/oracle.php b/phpBB/phpbb/db/driver/oracle.php
new file mode 100644
index 0000000000..6dcab5dd7d
--- /dev/null
+++ b/phpBB/phpbb/db/driver/oracle.php
@@ -0,0 +1,807 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\driver;
+
+/**
+* Oracle Database Abstraction Layer
+*/
+class oracle extends \phpbb\db\driver\driver
+{
+ var $last_query_text = '';
+ var $connect_error = '';
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_connect($sqlserver, $sqluser, $sqlpassword, $database, $port = false, $persistency = false, $new_link = false)
+ {
+ $this->persistency = $persistency;
+ $this->user = $sqluser;
+ $this->server = $sqlserver . (($port) ? ':' . $port : '');
+ $this->dbname = $database;
+
+ $connect = $database;
+
+ // support for "easy connect naming"
+ if ($sqlserver !== '' && $sqlserver !== '/')
+ {
+ if (substr($sqlserver, -1, 1) == '/')
+ {
+ $sqlserver == substr($sqlserver, 0, -1);
+ }
+ $connect = $sqlserver . (($port) ? ':' . $port : '') . '/' . $database;
+ }
+
+ if ($new_link)
+ {
+ if (!function_exists('ocinlogon'))
+ {
+ $this->connect_error = 'ocinlogon function does not exist, is oci extension installed?';
+ return $this->sql_error('');
+ }
+ $this->db_connect_id = @ocinlogon($this->user, $sqlpassword, $connect, 'UTF8');
+ }
+ else if ($this->persistency)
+ {
+ if (!function_exists('ociplogon'))
+ {
+ $this->connect_error = 'ociplogon function does not exist, is oci extension installed?';
+ return $this->sql_error('');
+ }
+ $this->db_connect_id = @ociplogon($this->user, $sqlpassword, $connect, 'UTF8');
+ }
+ else
+ {
+ if (!function_exists('ocilogon'))
+ {
+ $this->connect_error = 'ocilogon function does not exist, is oci extension installed?';
+ return $this->sql_error('');
+ }
+ $this->db_connect_id = @ocilogon($this->user, $sqlpassword, $connect, 'UTF8');
+ }
+
+ return ($this->db_connect_id) ? $this->db_connect_id : $this->sql_error('');
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_server_info($raw = false, $use_cache = true)
+ {
+ /**
+ * force $use_cache false. I didn't research why the caching code below is commented out
+ * but I assume its because the Oracle extension provides a direct method to access it
+ * without a query.
+ */
+
+ $use_cache = false;
+/*
+ global $cache;
+
+ if (empty($cache) || ($this->sql_server_version = $cache->get('oracle_version')) === false)
+ {
+ $result = @ociparse($this->db_connect_id, 'SELECT * FROM v$version WHERE banner LIKE \'Oracle%\'');
+ @ociexecute($result, OCI_DEFAULT);
+ @ocicommit($this->db_connect_id);
+
+ $row = array();
+ @ocifetchinto($result, $row, OCI_ASSOC + OCI_RETURN_NULLS);
+ @ocifreestatement($result);
+ $this->sql_server_version = trim($row['BANNER']);
+
+ $cache->put('oracle_version', $this->sql_server_version);
+ }
+*/
+ $this->sql_server_version = @ociserverversion($this->db_connect_id);
+
+ return $this->sql_server_version;
+ }
+
+ /**
+ * SQL Transaction
+ * @access private
+ */
+ function _sql_transaction($status = 'begin')
+ {
+ switch ($status)
+ {
+ case 'begin':
+ return true;
+ break;
+
+ case 'commit':
+ return @ocicommit($this->db_connect_id);
+ break;
+
+ case 'rollback':
+ return @ocirollback($this->db_connect_id);
+ break;
+ }
+
+ return true;
+ }
+
+ /**
+ * Oracle specific code to handle the fact that it does not compare columns properly
+ * @access private
+ */
+ function _rewrite_col_compare($args)
+ {
+ if (sizeof($args) == 4)
+ {
+ if ($args[2] == '=')
+ {
+ return '(' . $args[0] . ' OR (' . $args[1] . ' is NULL AND ' . $args[3] . ' is NULL))';
+ }
+ else if ($args[2] == '<>')
+ {
+ // really just a fancy way of saying foo <> bar or (foo is NULL XOR bar is NULL) but SQL has no XOR :P
+ return '(' . $args[0] . ' OR ((' . $args[1] . ' is NULL AND ' . $args[3] . ' is NOT NULL) OR (' . $args[1] . ' is NOT NULL AND ' . $args[3] . ' is NULL)))';
+ }
+ }
+ else
+ {
+ return $this->_rewrite_where($args[0]);
+ }
+ }
+
+ /**
+ * Oracle specific code to handle it's lack of sanity
+ * @access private
+ */
+ function _rewrite_where($where_clause)
+ {
+ preg_match_all('/\s*(AND|OR)?\s*([\w_.()]++)\s*(?:(=|<[=>]?|>=?|LIKE)\s*((?>\'(?>[^\']++|\'\')*+\'|[\d-.()]+))|((NOT )?IN\s*\((?>\'(?>[^\']++|\'\')*+\',? ?|[\d-.]+,? ?)*+\)))/', $where_clause, $result, PREG_SET_ORDER);
+ $out = '';
+ foreach ($result as $val)
+ {
+ if (!isset($val[5]))
+ {
+ if ($val[4] !== "''")
+ {
+ $out .= $val[0];
+ }
+ else
+ {
+ $out .= ' ' . $val[1] . ' ' . $val[2];
+ if ($val[3] == '=')
+ {
+ $out .= ' is NULL';
+ }
+ else if ($val[3] == '<>')
+ {
+ $out .= ' is NOT NULL';
+ }
+ }
+ }
+ else
+ {
+ $in_clause = array();
+ $sub_exp = substr($val[5], strpos($val[5], '(') + 1, -1);
+ $extra = false;
+ preg_match_all('/\'(?>[^\']++|\'\')*+\'|[\d-.]++/', $sub_exp, $sub_vals, PREG_PATTERN_ORDER);
+ $i = 0;
+ foreach ($sub_vals[0] as $sub_val)
+ {
+ // two things:
+ // 1) This determines if an empty string was in the IN clausing, making us turn it into a NULL comparison
+ // 2) This fixes the 1000 list limit that Oracle has (ORA-01795)
+ if ($sub_val !== "''")
+ {
+ $in_clause[(int) $i++/1000][] = $sub_val;
+ }
+ else
+ {
+ $extra = true;
+ }
+ }
+ if (!$extra && $i < 1000)
+ {
+ $out .= $val[0];
+ }
+ else
+ {
+ $out .= ' ' . $val[1] . '(';
+ $in_array = array();
+
+ // constuct each IN() clause
+ foreach ($in_clause as $in_values)
+ {
+ $in_array[] = $val[2] . ' ' . (isset($val[6]) ? $val[6] : '') . 'IN(' . implode(', ', $in_values) . ')';
+ }
+
+ // Join the IN() clauses against a few ORs (IN is just a nicer OR anyway)
+ $out .= implode(' OR ', $in_array);
+
+ // handle the empty string case
+ if ($extra)
+ {
+ $out .= ' OR ' . $val[2] . ' is ' . (isset($val[6]) ? $val[6] : '') . 'NULL';
+ }
+ $out .= ')';
+
+ unset($in_array, $in_clause);
+ }
+ }
+ }
+
+ return $out;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_query($query = '', $cache_ttl = 0)
+ {
+ if ($query != '')
+ {
+ global $cache;
+
+ // EXPLAIN only in extra debug mode
+ if (defined('DEBUG'))
+ {
+ $this->sql_report('start', $query);
+ }
+ else if (defined('PHPBB_DISPLAY_LOAD_TIME'))
+ {
+ $this->curtime = microtime(true);
+ }
+
+ $this->last_query_text = $query;
+ $this->query_result = ($cache && $cache_ttl) ? $cache->sql_load($query) : false;
+ $this->sql_add_num_queries($this->query_result);
+
+ if ($this->query_result === false)
+ {
+ $in_transaction = false;
+ if (!$this->transaction)
+ {
+ $this->sql_transaction('begin');
+ }
+ else
+ {
+ $in_transaction = true;
+ }
+
+ $array = array();
+
+ // We overcome Oracle's 4000 char limit by binding vars
+ if (strlen($query) > 4000)
+ {
+ if (preg_match('/^(INSERT INTO[^(]++)\\(([^()]+)\\) VALUES[^(]++\\((.*?)\\)$/sU', $query, $regs))
+ {
+ if (strlen($regs[3]) > 4000)
+ {
+ $cols = explode(', ', $regs[2]);
+
+ preg_match_all('/\'(?:[^\']++|\'\')*+\'|[\d-.]+/', $regs[3], $vals, PREG_PATTERN_ORDER);
+
+/* The code inside this comment block breaks clob handling, but does allow the
+ database restore script to work. If you want to allow no posts longer than 4KB
+ and/or need the db restore script, uncomment this.
+
+
+ if (sizeof($cols) !== sizeof($vals))
+ {
+ // Try to replace some common data we know is from our restore script or from other sources
+ $regs[3] = str_replace("'||chr(47)||'", '/', $regs[3]);
+ $_vals = explode(', ', $regs[3]);
+
+ $vals = array();
+ $is_in_val = false;
+ $i = 0;
+ $string = '';
+
+ foreach ($_vals as $value)
+ {
+ if (strpos($value, "'") === false && !$is_in_val)
+ {
+ $vals[$i++] = $value;
+ continue;
+ }
+
+ if (substr($value, -1) === "'")
+ {
+ $vals[$i] = $string . (($is_in_val) ? ', ' : '') . $value;
+ $string = '';
+ $is_in_val = false;
+
+ if ($vals[$i][0] !== "'")
+ {
+ $vals[$i] = "''" . $vals[$i];
+ }
+ $i++;
+ continue;
+ }
+ else
+ {
+ $string .= (($is_in_val) ? ', ' : '') . $value;
+ $is_in_val = true;
+ }
+ }
+
+ if ($string)
+ {
+ // New value if cols != value
+ $vals[(sizeof($cols) !== sizeof($vals)) ? $i : $i - 1] .= $string;
+ }
+
+ $vals = array(0 => $vals);
+ }
+*/
+
+ $inserts = $vals[0];
+ unset($vals);
+
+ foreach ($inserts as $key => $value)
+ {
+ if (!empty($value) && $value[0] === "'" && strlen($value) > 4002) // check to see if this thing is greater than the max + 'x2
+ {
+ $inserts[$key] = ':' . strtoupper($cols[$key]);
+ $array[$inserts[$key]] = str_replace("''", "'", substr($value, 1, -1));
+ }
+ }
+
+ $query = $regs[1] . '(' . $regs[2] . ') VALUES (' . implode(', ', $inserts) . ')';
+ }
+ }
+ else if (preg_match_all('/^(UPDATE [\\w_]++\\s+SET )([\\w_]++\\s*=\\s*(?:\'(?:[^\']++|\'\')*+\'|[\d-.]+)(?:,\\s*[\\w_]++\\s*=\\s*(?:\'(?:[^\']++|\'\')*+\'|[\d-.]+))*+)\\s+(WHERE.*)$/s', $query, $data, PREG_SET_ORDER))
+ {
+ if (strlen($data[0][2]) > 4000)
+ {
+ $update = $data[0][1];
+ $where = $data[0][3];
+ preg_match_all('/([\\w_]++)\\s*=\\s*(\'(?:[^\']++|\'\')*+\'|[\d-.]++)/', $data[0][2], $temp, PREG_SET_ORDER);
+ unset($data);
+
+ $cols = array();
+ foreach ($temp as $value)
+ {
+ if (!empty($value[2]) && $value[2][0] === "'" && strlen($value[2]) > 4002) // check to see if this thing is greater than the max + 'x2
+ {
+ $cols[] = $value[1] . '=:' . strtoupper($value[1]);
+ $array[$value[1]] = str_replace("''", "'", substr($value[2], 1, -1));
+ }
+ else
+ {
+ $cols[] = $value[1] . '=' . $value[2];
+ }
+ }
+
+ $query = $update . implode(', ', $cols) . ' ' . $where;
+ unset($cols);
+ }
+ }
+ }
+
+ switch (substr($query, 0, 6))
+ {
+ case 'DELETE':
+ if (preg_match('/^(DELETE FROM [\w_]++ WHERE)((?:\s*(?:AND|OR)?\s*[\w_]+\s*(?:(?:=|<>)\s*(?>\'(?>[^\']++|\'\')*+\'|[\d-.]+)|(?:NOT )?IN\s*\((?>\'(?>[^\']++|\'\')*+\',? ?|[\d-.]+,? ?)*+\)))*+)$/', $query, $regs))
+ {
+ $query = $regs[1] . $this->_rewrite_where($regs[2]);
+ unset($regs);
+ }
+ break;
+
+ case 'UPDATE':
+ if (preg_match('/^(UPDATE [\\w_]++\\s+SET [\\w_]+\s*=\s*(?:\'(?:[^\']++|\'\')*+\'|[\d-.]++|:\w++)(?:, [\\w_]+\s*=\s*(?:\'(?:[^\']++|\'\')*+\'|[\d-.]++|:\w++))*+\\s+WHERE)(.*)$/s', $query, $regs))
+ {
+ $query = $regs[1] . $this->_rewrite_where($regs[2]);
+ unset($regs);
+ }
+ break;
+
+ case 'SELECT':
+ $query = preg_replace_callback('/([\w_.]++)\s*(?:(=|<>)\s*(?>\'(?>[^\']++|\'\')*+\'|[\d-.]++|([\w_.]++))|(?:NOT )?IN\s*\((?>\'(?>[^\']++|\'\')*+\',? ?|[\d-.]++,? ?)*+\))/', array($this, '_rewrite_col_compare'), $query);
+ break;
+ }
+
+ $this->query_result = @ociparse($this->db_connect_id, $query);
+
+ foreach ($array as $key => $value)
+ {
+ @ocibindbyname($this->query_result, $key, $array[$key], -1);
+ }
+
+ $success = @ociexecute($this->query_result, OCI_DEFAULT);
+
+ if (!$success)
+ {
+ $this->sql_error($query);
+ $this->query_result = false;
+ }
+ else
+ {
+ if (!$in_transaction)
+ {
+ $this->sql_transaction('commit');
+ }
+ }
+
+ if (defined('DEBUG'))
+ {
+ $this->sql_report('stop', $query);
+ }
+ else if (defined('PHPBB_DISPLAY_LOAD_TIME'))
+ {
+ $this->sql_time += microtime(true) - $this->curtime;
+ }
+
+ if ($cache && $cache_ttl)
+ {
+ $this->open_queries[(int) $this->query_result] = $this->query_result;
+ $this->query_result = $cache->sql_save($this, $query, $this->query_result, $cache_ttl);
+ }
+ else if (strpos($query, 'SELECT') === 0 && $this->query_result)
+ {
+ $this->open_queries[(int) $this->query_result] = $this->query_result;
+ }
+ }
+ else if (defined('DEBUG'))
+ {
+ $this->sql_report('fromcache', $query);
+ }
+ }
+ else
+ {
+ return false;
+ }
+
+ return $this->query_result;
+ }
+
+ /**
+ * Build LIMIT query
+ */
+ function _sql_query_limit($query, $total, $offset = 0, $cache_ttl = 0)
+ {
+ $this->query_result = false;
+
+ $query = 'SELECT * FROM (SELECT /*+ FIRST_ROWS */ rownum AS xrownum, a.* FROM (' . $query . ') a WHERE rownum <= ' . ($offset + $total) . ') WHERE xrownum >= ' . $offset;
+
+ return $this->sql_query($query, $cache_ttl);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_affectedrows()
+ {
+ return ($this->query_result) ? @ocirowcount($this->query_result) : false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_fetchrow($query_id = false)
+ {
+ global $cache;
+
+ if ($query_id === false)
+ {
+ $query_id = $this->query_result;
+ }
+
+ if ($cache && $cache->sql_exists($query_id))
+ {
+ return $cache->sql_fetchrow($query_id);
+ }
+
+ if ($query_id !== false)
+ {
+ $row = array();
+ $result = @ocifetchinto($query_id, $row, OCI_ASSOC + OCI_RETURN_NULLS);
+
+ if (!$result || !$row)
+ {
+ return false;
+ }
+
+ $result_row = array();
+ foreach ($row as $key => $value)
+ {
+ // Oracle treats empty strings as null
+ if (is_null($value))
+ {
+ $value = '';
+ }
+
+ // OCI->CLOB?
+ if (is_object($value))
+ {
+ $value = $value->load();
+ }
+
+ $result_row[strtolower($key)] = $value;
+ }
+
+ return $result_row;
+ }
+
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_rowseek($rownum, &$query_id)
+ {
+ global $cache;
+
+ if ($query_id === false)
+ {
+ $query_id = $this->query_result;
+ }
+
+ if ($cache && $cache->sql_exists($query_id))
+ {
+ return $cache->sql_rowseek($rownum, $query_id);
+ }
+
+ if ($query_id === false)
+ {
+ return false;
+ }
+
+ // Reset internal pointer
+ @ociexecute($query_id, OCI_DEFAULT);
+
+ // We do not fetch the row for rownum == 0 because then the next resultset would be the second row
+ for ($i = 0; $i < $rownum; $i++)
+ {
+ if (!$this->sql_fetchrow($query_id))
+ {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_nextid()
+ {
+ $query_id = $this->query_result;
+
+ if ($query_id !== false && $this->last_query_text != '')
+ {
+ if (preg_match('#^INSERT[\t\n ]+INTO[\t\n ]+([a-z0-9\_\-]+)#is', $this->last_query_text, $tablename))
+ {
+ $query = 'SELECT ' . $tablename[1] . '_seq.currval FROM DUAL';
+ $stmt = @ociparse($this->db_connect_id, $query);
+ @ociexecute($stmt, OCI_DEFAULT);
+
+ $temp_result = @ocifetchinto($stmt, $temp_array, OCI_ASSOC + OCI_RETURN_NULLS);
+ @ocifreestatement($stmt);
+
+ if ($temp_result)
+ {
+ return $temp_array['CURRVAL'];
+ }
+ else
+ {
+ return false;
+ }
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_freeresult($query_id = false)
+ {
+ global $cache;
+
+ if ($query_id === false)
+ {
+ $query_id = $this->query_result;
+ }
+
+ if ($cache && !is_object($query_id) && $cache->sql_exists($query_id))
+ {
+ return $cache->sql_freeresult($query_id);
+ }
+
+ if (isset($this->open_queries[(int) $query_id]))
+ {
+ unset($this->open_queries[(int) $query_id]);
+ return @ocifreestatement($query_id);
+ }
+
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_escape($msg)
+ {
+ return str_replace(array("'", "\0"), array("''", ''), $msg);
+ }
+
+ /**
+ * Build LIKE expression
+ * @access private
+ */
+ function _sql_like_expression($expression)
+ {
+ return $expression . " ESCAPE '\\'";
+ }
+
+ /**
+ * Build NOT LIKE expression
+ * @access private
+ */
+ function _sql_not_like_expression($expression)
+ {
+ return $expression . " ESCAPE '\\'";
+ }
+
+ function _sql_custom_build($stage, $data)
+ {
+ return $data;
+ }
+
+ function _sql_bit_and($column_name, $bit, $compare = '')
+ {
+ return 'BITAND(' . $column_name . ', ' . (1 << $bit) . ')' . (($compare) ? ' ' . $compare : '');
+ }
+
+ function _sql_bit_or($column_name, $bit, $compare = '')
+ {
+ return 'BITOR(' . $column_name . ', ' . (1 << $bit) . ')' . (($compare) ? ' ' . $compare : '');
+ }
+
+ /**
+ * return sql error array
+ * @access private
+ */
+ function _sql_error()
+ {
+ if (function_exists('ocierror'))
+ {
+ $error = @ocierror();
+ $error = (!$error) ? @ocierror($this->query_result) : $error;
+ $error = (!$error) ? @ocierror($this->db_connect_id) : $error;
+
+ if ($error)
+ {
+ $this->last_error_result = $error;
+ }
+ else
+ {
+ $error = (isset($this->last_error_result) && $this->last_error_result) ? $this->last_error_result : array();
+ }
+ }
+ else
+ {
+ $error = array(
+ 'message' => $this->connect_error,
+ 'code' => '',
+ );
+ }
+
+ return $error;
+ }
+
+ /**
+ * Close sql connection
+ * @access private
+ */
+ function _sql_close()
+ {
+ return @ocilogoff($this->db_connect_id);
+ }
+
+ /**
+ * Build db-specific report
+ * @access private
+ */
+ function _sql_report($mode, $query = '')
+ {
+ switch ($mode)
+ {
+ case 'start':
+
+ $html_table = false;
+
+ // Grab a plan table, any will do
+ $sql = "SELECT table_name
+ FROM USER_TABLES
+ WHERE table_name LIKE '%PLAN_TABLE%'";
+ $stmt = ociparse($this->db_connect_id, $sql);
+ ociexecute($stmt);
+ $result = array();
+
+ if (ocifetchinto($stmt, $result, OCI_ASSOC + OCI_RETURN_NULLS))
+ {
+ $table = $result['TABLE_NAME'];
+
+ // This is the statement_id that will allow us to track the plan
+ $statement_id = substr(md5($query), 0, 30);
+
+ // Remove any stale plans
+ $stmt2 = ociparse($this->db_connect_id, "DELETE FROM $table WHERE statement_id='$statement_id'");
+ ociexecute($stmt2);
+ ocifreestatement($stmt2);
+
+ // Explain the plan
+ $sql = "EXPLAIN PLAN
+ SET STATEMENT_ID = '$statement_id'
+ FOR $query";
+ $stmt2 = ociparse($this->db_connect_id, $sql);
+ ociexecute($stmt2);
+ ocifreestatement($stmt2);
+
+ // Get the data from the plan
+ $sql = "SELECT operation, options, object_name, object_type, cardinality, cost
+ FROM plan_table
+ START WITH id = 0 AND statement_id = '$statement_id'
+ CONNECT BY PRIOR id = parent_id
+ AND statement_id = '$statement_id'";
+ $stmt2 = ociparse($this->db_connect_id, $sql);
+ ociexecute($stmt2);
+
+ $row = array();
+ while (ocifetchinto($stmt2, $row, OCI_ASSOC + OCI_RETURN_NULLS))
+ {
+ $html_table = $this->sql_report('add_select_row', $query, $html_table, $row);
+ }
+
+ ocifreestatement($stmt2);
+
+ // Remove the plan we just made, we delete them on request anyway
+ $stmt2 = ociparse($this->db_connect_id, "DELETE FROM $table WHERE statement_id='$statement_id'");
+ ociexecute($stmt2);
+ ocifreestatement($stmt2);
+ }
+
+ ocifreestatement($stmt);
+
+ if ($html_table)
+ {
+ $this->html_hold .= '</table>';
+ }
+
+ break;
+
+ case 'fromcache':
+ $endtime = explode(' ', microtime());
+ $endtime = $endtime[0] + $endtime[1];
+
+ $result = @ociparse($this->db_connect_id, $query);
+ $success = @ociexecute($result, OCI_DEFAULT);
+ $row = array();
+
+ while (@ocifetchinto($result, $row, OCI_ASSOC + OCI_RETURN_NULLS))
+ {
+ // Take the time spent on parsing rows into account
+ }
+ @ocifreestatement($result);
+
+ $splittime = explode(' ', microtime());
+ $splittime = $splittime[0] + $splittime[1];
+
+ $this->sql_report('record_fromcache', $query, $endtime, $splittime);
+
+ break;
+ }
+ }
+}
diff --git a/phpBB/phpbb/db/driver/postgres.php b/phpBB/phpbb/db/driver/postgres.php
new file mode 100644
index 0000000000..a3b9aa4c6b
--- /dev/null
+++ b/phpBB/phpbb/db/driver/postgres.php
@@ -0,0 +1,490 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\driver;
+
+/**
+* PostgreSQL Database Abstraction Layer
+* Minimum Requirement is Version 8.3+
+*/
+class postgres extends \phpbb\db\driver\driver
+{
+ var $multi_insert = true;
+ var $last_query_text = '';
+ var $connect_error = '';
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_connect($sqlserver, $sqluser, $sqlpassword, $database, $port = false, $persistency = false, $new_link = false)
+ {
+ $connect_string = '';
+
+ if ($sqluser)
+ {
+ $connect_string .= "user=$sqluser ";
+ }
+
+ if ($sqlpassword)
+ {
+ $connect_string .= "password=$sqlpassword ";
+ }
+
+ if ($sqlserver)
+ {
+ // $sqlserver can carry a port separated by : for compatibility reasons
+ // If $sqlserver has more than one : it's probably an IPv6 address.
+ // In this case we only allow passing a port via the $port variable.
+ if (substr_count($sqlserver, ':') === 1)
+ {
+ list($sqlserver, $port) = explode(':', $sqlserver);
+ }
+
+ if ($sqlserver !== 'localhost')
+ {
+ $connect_string .= "host=$sqlserver ";
+ }
+
+ if ($port)
+ {
+ $connect_string .= "port=$port ";
+ }
+ }
+
+ $schema = '';
+
+ if ($database)
+ {
+ $this->dbname = $database;
+ if (strpos($database, '.') !== false)
+ {
+ list($database, $schema) = explode('.', $database);
+ }
+ $connect_string .= "dbname=$database";
+ }
+
+ $this->persistency = $persistency;
+
+ if ($this->persistency)
+ {
+ if (!function_exists('pg_pconnect'))
+ {
+ $this->connect_error = 'pg_pconnect function does not exist, is pgsql extension installed?';
+ return $this->sql_error('');
+ }
+ $collector = new \phpbb\error_collector;
+ $collector->install();
+ $this->db_connect_id = (!$new_link) ? @pg_pconnect($connect_string) : @pg_pconnect($connect_string, PGSQL_CONNECT_FORCE_NEW);
+ }
+ else
+ {
+ if (!function_exists('pg_connect'))
+ {
+ $this->connect_error = 'pg_connect function does not exist, is pgsql extension installed?';
+ return $this->sql_error('');
+ }
+ $collector = new \phpbb\error_collector;
+ $collector->install();
+ $this->db_connect_id = (!$new_link) ? @pg_connect($connect_string) : @pg_connect($connect_string, PGSQL_CONNECT_FORCE_NEW);
+ }
+
+ $collector->uninstall();
+
+ if ($this->db_connect_id)
+ {
+ if ($schema !== '')
+ {
+ @pg_query($this->db_connect_id, 'SET search_path TO ' . $schema);
+ }
+ return $this->db_connect_id;
+ }
+
+ $this->connect_error = $collector->format_errors();
+ return $this->sql_error('');
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_server_info($raw = false, $use_cache = true)
+ {
+ global $cache;
+
+ if (!$use_cache || empty($cache) || ($this->sql_server_version = $cache->get('pgsql_version')) === false)
+ {
+ $query_id = @pg_query($this->db_connect_id, 'SELECT VERSION() AS version');
+ $row = @pg_fetch_assoc($query_id, null);
+ @pg_free_result($query_id);
+
+ $this->sql_server_version = (!empty($row['version'])) ? trim(substr($row['version'], 10)) : 0;
+
+ if (!empty($cache) && $use_cache)
+ {
+ $cache->put('pgsql_version', $this->sql_server_version);
+ }
+ }
+
+ return ($raw) ? $this->sql_server_version : 'PostgreSQL ' . $this->sql_server_version;
+ }
+
+ /**
+ * SQL Transaction
+ * @access private
+ */
+ function _sql_transaction($status = 'begin')
+ {
+ switch ($status)
+ {
+ case 'begin':
+ return @pg_query($this->db_connect_id, 'BEGIN');
+ break;
+
+ case 'commit':
+ return @pg_query($this->db_connect_id, 'COMMIT');
+ break;
+
+ case 'rollback':
+ return @pg_query($this->db_connect_id, 'ROLLBACK');
+ break;
+ }
+
+ return true;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_query($query = '', $cache_ttl = 0)
+ {
+ if ($query != '')
+ {
+ global $cache;
+
+ // EXPLAIN only in extra debug mode
+ if (defined('DEBUG'))
+ {
+ $this->sql_report('start', $query);
+ }
+ else if (defined('PHPBB_DISPLAY_LOAD_TIME'))
+ {
+ $this->curtime = microtime(true);
+ }
+
+ $this->last_query_text = $query;
+ $this->query_result = ($cache && $cache_ttl) ? $cache->sql_load($query) : false;
+ $this->sql_add_num_queries($this->query_result);
+
+ if ($this->query_result === false)
+ {
+ if (($this->query_result = @pg_query($this->db_connect_id, $query)) === false)
+ {
+ $this->sql_error($query);
+ }
+
+ if (defined('DEBUG'))
+ {
+ $this->sql_report('stop', $query);
+ }
+ else if (defined('PHPBB_DISPLAY_LOAD_TIME'))
+ {
+ $this->sql_time += microtime(true) - $this->curtime;
+ }
+
+ if ($cache && $cache_ttl)
+ {
+ $this->open_queries[(int) $this->query_result] = $this->query_result;
+ $this->query_result = $cache->sql_save($this, $query, $this->query_result, $cache_ttl);
+ }
+ else if (strpos($query, 'SELECT') === 0 && $this->query_result)
+ {
+ $this->open_queries[(int) $this->query_result] = $this->query_result;
+ }
+ }
+ else if (defined('DEBUG'))
+ {
+ $this->sql_report('fromcache', $query);
+ }
+ }
+ else
+ {
+ return false;
+ }
+
+ return $this->query_result;
+ }
+
+ /**
+ * Build db-specific query data
+ * @access private
+ */
+ function _sql_custom_build($stage, $data)
+ {
+ return $data;
+ }
+
+ /**
+ * Build LIMIT query
+ */
+ function _sql_query_limit($query, $total, $offset = 0, $cache_ttl = 0)
+ {
+ $this->query_result = false;
+
+ // if $total is set to 0 we do not want to limit the number of rows
+ if ($total == 0)
+ {
+ $total = 'ALL';
+ }
+
+ $query .= "\n LIMIT $total OFFSET $offset";
+
+ return $this->sql_query($query, $cache_ttl);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_affectedrows()
+ {
+ return ($this->query_result) ? @pg_affected_rows($this->query_result) : false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_fetchrow($query_id = false)
+ {
+ global $cache;
+
+ if ($query_id === false)
+ {
+ $query_id = $this->query_result;
+ }
+
+ if ($cache && $cache->sql_exists($query_id))
+ {
+ return $cache->sql_fetchrow($query_id);
+ }
+
+ return ($query_id !== false) ? @pg_fetch_assoc($query_id, null) : false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_rowseek($rownum, &$query_id)
+ {
+ global $cache;
+
+ if ($query_id === false)
+ {
+ $query_id = $this->query_result;
+ }
+
+ if ($cache && $cache->sql_exists($query_id))
+ {
+ return $cache->sql_rowseek($rownum, $query_id);
+ }
+
+ return ($query_id !== false) ? @pg_result_seek($query_id, $rownum) : false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_nextid()
+ {
+ $query_id = $this->query_result;
+
+ if ($query_id !== false && $this->last_query_text != '')
+ {
+ if (preg_match("/^INSERT[\t\n ]+INTO[\t\n ]+([a-z0-9\_\-]+)/is", $this->last_query_text, $tablename))
+ {
+ $query = "SELECT currval('" . $tablename[1] . "_seq') AS last_value";
+ $temp_q_id = @pg_query($this->db_connect_id, $query);
+
+ if (!$temp_q_id)
+ {
+ return false;
+ }
+
+ $temp_result = @pg_fetch_assoc($temp_q_id, null);
+ @pg_free_result($query_id);
+
+ return ($temp_result) ? $temp_result['last_value'] : false;
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_freeresult($query_id = false)
+ {
+ global $cache;
+
+ if ($query_id === false)
+ {
+ $query_id = $this->query_result;
+ }
+
+ if ($cache && !is_object($query_id) && $cache->sql_exists($query_id))
+ {
+ return $cache->sql_freeresult($query_id);
+ }
+
+ if (isset($this->open_queries[(int) $query_id]))
+ {
+ unset($this->open_queries[(int) $query_id]);
+ return @pg_free_result($query_id);
+ }
+
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_escape($msg)
+ {
+ return @pg_escape_string($msg);
+ }
+
+ /**
+ * Build LIKE expression
+ * @access private
+ */
+ function _sql_like_expression($expression)
+ {
+ return $expression;
+ }
+
+ /**
+ * Build NOT LIKE expression
+ * @access private
+ */
+ function _sql_not_like_expression($expression)
+ {
+ return $expression;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function cast_expr_to_bigint($expression)
+ {
+ return 'CAST(' . $expression . ' as DECIMAL(255, 0))';
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function cast_expr_to_string($expression)
+ {
+ return 'CAST(' . $expression . ' as VARCHAR(255))';
+ }
+
+ /**
+ * return sql error array
+ * @access private
+ */
+ function _sql_error()
+ {
+ // pg_last_error only works when there is an established connection.
+ // Connection errors have to be tracked by us manually.
+ if ($this->db_connect_id)
+ {
+ $message = @pg_last_error($this->db_connect_id);
+ }
+ else
+ {
+ $message = $this->connect_error;
+ }
+
+ return array(
+ 'message' => $message,
+ 'code' => ''
+ );
+ }
+
+ /**
+ * Close sql connection
+ * @access private
+ */
+ function _sql_close()
+ {
+ return @pg_close($this->db_connect_id);
+ }
+
+ /**
+ * Build db-specific report
+ * @access private
+ */
+ function _sql_report($mode, $query = '')
+ {
+ switch ($mode)
+ {
+ case 'start':
+
+ $explain_query = $query;
+ if (preg_match('/UPDATE ([a-z0-9_]+).*?WHERE(.*)/s', $query, $m))
+ {
+ $explain_query = 'SELECT * FROM ' . $m[1] . ' WHERE ' . $m[2];
+ }
+ else if (preg_match('/DELETE FROM ([a-z0-9_]+).*?WHERE(.*)/s', $query, $m))
+ {
+ $explain_query = 'SELECT * FROM ' . $m[1] . ' WHERE ' . $m[2];
+ }
+
+ if (preg_match('/^SELECT/', $explain_query))
+ {
+ $html_table = false;
+
+ if ($result = @pg_query($this->db_connect_id, "EXPLAIN $explain_query"))
+ {
+ while ($row = @pg_fetch_assoc($result, null))
+ {
+ $html_table = $this->sql_report('add_select_row', $query, $html_table, $row);
+ }
+ }
+ @pg_free_result($result);
+
+ if ($html_table)
+ {
+ $this->html_hold .= '</table>';
+ }
+ }
+
+ break;
+
+ case 'fromcache':
+ $endtime = explode(' ', microtime());
+ $endtime = $endtime[0] + $endtime[1];
+
+ $result = @pg_query($this->db_connect_id, $query);
+ while ($void = @pg_fetch_assoc($result, null))
+ {
+ // Take the time spent on parsing rows into account
+ }
+ @pg_free_result($result);
+
+ $splittime = explode(' ', microtime());
+ $splittime = $splittime[0] + $splittime[1];
+
+ $this->sql_report('record_fromcache', $query, $endtime, $splittime);
+
+ break;
+ }
+ }
+}
diff --git a/phpBB/phpbb/db/driver/sqlite.php b/phpBB/phpbb/db/driver/sqlite.php
new file mode 100644
index 0000000000..d5da0e2438
--- /dev/null
+++ b/phpBB/phpbb/db/driver/sqlite.php
@@ -0,0 +1,378 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\driver;
+
+/**
+* Sqlite Database Abstraction Layer
+* Minimum Requirement: 2.8.2+
+*/
+class sqlite extends \phpbb\db\driver\driver
+{
+ var $connect_error = '';
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_connect($sqlserver, $sqluser, $sqlpassword, $database, $port = false, $persistency = false, $new_link = false)
+ {
+ $this->persistency = $persistency;
+ $this->user = $sqluser;
+ $this->server = $sqlserver . (($port) ? ':' . $port : '');
+ $this->dbname = $database;
+
+ $error = '';
+ if ($this->persistency)
+ {
+ if (!function_exists('sqlite_popen'))
+ {
+ $this->connect_error = 'sqlite_popen function does not exist, is sqlite extension installed?';
+ return $this->sql_error('');
+ }
+ $this->db_connect_id = @sqlite_popen($this->server, 0666, $error);
+ }
+ else
+ {
+ if (!function_exists('sqlite_open'))
+ {
+ $this->connect_error = 'sqlite_open function does not exist, is sqlite extension installed?';
+ return $this->sql_error('');
+ }
+ $this->db_connect_id = @sqlite_open($this->server, 0666, $error);
+ }
+
+ if ($this->db_connect_id)
+ {
+ @sqlite_query('PRAGMA short_column_names = 1', $this->db_connect_id);
+// @sqlite_query('PRAGMA encoding = "UTF-8"', $this->db_connect_id);
+ }
+
+ return ($this->db_connect_id) ? true : array('message' => $error);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_server_info($raw = false, $use_cache = true)
+ {
+ global $cache;
+
+ if (!$use_cache || empty($cache) || ($this->sql_server_version = $cache->get('sqlite_version')) === false)
+ {
+ $result = @sqlite_query('SELECT sqlite_version() AS version', $this->db_connect_id);
+ $row = @sqlite_fetch_array($result, SQLITE_ASSOC);
+
+ $this->sql_server_version = (!empty($row['version'])) ? $row['version'] : 0;
+
+ if (!empty($cache) && $use_cache)
+ {
+ $cache->put('sqlite_version', $this->sql_server_version);
+ }
+ }
+
+ return ($raw) ? $this->sql_server_version : 'SQLite ' . $this->sql_server_version;
+ }
+
+ /**
+ * SQL Transaction
+ * @access private
+ */
+ function _sql_transaction($status = 'begin')
+ {
+ switch ($status)
+ {
+ case 'begin':
+ return @sqlite_query('BEGIN', $this->db_connect_id);
+ break;
+
+ case 'commit':
+ return @sqlite_query('COMMIT', $this->db_connect_id);
+ break;
+
+ case 'rollback':
+ return @sqlite_query('ROLLBACK', $this->db_connect_id);
+ break;
+ }
+
+ return true;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_query($query = '', $cache_ttl = 0)
+ {
+ if ($query != '')
+ {
+ global $cache;
+
+ // EXPLAIN only in extra debug mode
+ if (defined('DEBUG'))
+ {
+ $this->sql_report('start', $query);
+ }
+ else if (defined('PHPBB_DISPLAY_LOAD_TIME'))
+ {
+ $this->curtime = microtime(true);
+ }
+
+ $this->query_result = ($cache && $cache_ttl) ? $cache->sql_load($query) : false;
+ $this->sql_add_num_queries($this->query_result);
+
+ if ($this->query_result === false)
+ {
+ if (($this->query_result = @sqlite_query($query, $this->db_connect_id)) === false)
+ {
+ $this->sql_error($query);
+ }
+
+ if (defined('DEBUG'))
+ {
+ $this->sql_report('stop', $query);
+ }
+ else if (defined('PHPBB_DISPLAY_LOAD_TIME'))
+ {
+ $this->sql_time += microtime(true) - $this->curtime;
+ }
+
+ if ($cache && $cache_ttl)
+ {
+ $this->open_queries[(int) $this->query_result] = $this->query_result;
+ $this->query_result = $cache->sql_save($this, $query, $this->query_result, $cache_ttl);
+ }
+ else if (strpos($query, 'SELECT') === 0 && $this->query_result)
+ {
+ $this->open_queries[(int) $this->query_result] = $this->query_result;
+ }
+ }
+ else if (defined('DEBUG'))
+ {
+ $this->sql_report('fromcache', $query);
+ }
+ }
+ else
+ {
+ return false;
+ }
+
+ return $this->query_result;
+ }
+
+ /**
+ * Build LIMIT query
+ */
+ function _sql_query_limit($query, $total, $offset = 0, $cache_ttl = 0)
+ {
+ $this->query_result = false;
+
+ // if $total is set to 0 we do not want to limit the number of rows
+ if ($total == 0)
+ {
+ $total = -1;
+ }
+
+ $query .= "\n LIMIT " . ((!empty($offset)) ? $offset . ', ' . $total : $total);
+
+ return $this->sql_query($query, $cache_ttl);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_affectedrows()
+ {
+ return ($this->db_connect_id) ? @sqlite_changes($this->db_connect_id) : false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_fetchrow($query_id = false)
+ {
+ global $cache;
+
+ if ($query_id === false)
+ {
+ $query_id = $this->query_result;
+ }
+
+ if ($cache && $cache->sql_exists($query_id))
+ {
+ return $cache->sql_fetchrow($query_id);
+ }
+
+ return ($query_id !== false) ? @sqlite_fetch_array($query_id, SQLITE_ASSOC) : false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_rowseek($rownum, &$query_id)
+ {
+ global $cache;
+
+ if ($query_id === false)
+ {
+ $query_id = $this->query_result;
+ }
+
+ if ($cache && $cache->sql_exists($query_id))
+ {
+ return $cache->sql_rowseek($rownum, $query_id);
+ }
+
+ return ($query_id !== false) ? @sqlite_seek($query_id, $rownum) : false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_nextid()
+ {
+ return ($this->db_connect_id) ? @sqlite_last_insert_rowid($this->db_connect_id) : false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_freeresult($query_id = false)
+ {
+ global $cache;
+
+ if ($query_id === false)
+ {
+ $query_id = $this->query_result;
+ }
+
+ if ($cache && !is_object($query_id) && $cache->sql_exists($query_id))
+ {
+ return $cache->sql_freeresult($query_id);
+ }
+
+ return true;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_escape($msg)
+ {
+ return @sqlite_escape_string($msg);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * For SQLite an underscore is a not-known character... this may change with SQLite3
+ */
+ function sql_like_expression($expression)
+ {
+ // Unlike LIKE, GLOB is unfortunately case sensitive.
+ // We only catch * and ? here, not the character map possible on file globbing.
+ $expression = str_replace(array(chr(0) . '_', chr(0) . '%'), array(chr(0) . '?', chr(0) . '*'), $expression);
+
+ $expression = str_replace(array('?', '*'), array("\?", "\*"), $expression);
+ $expression = str_replace(array(chr(0) . "\?", chr(0) . "\*"), array('?', '*'), $expression);
+
+ return 'GLOB \'' . $this->sql_escape($expression) . '\'';
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * For SQLite an underscore is a not-known character...
+ */
+ function sql_not_like_expression($expression)
+ {
+ // Unlike NOT LIKE, NOT GLOB is unfortunately case sensitive.
+ // We only catch * and ? here, not the character map possible on file globbing.
+ $expression = str_replace(array(chr(0) . '_', chr(0) . '%'), array(chr(0) . '?', chr(0) . '*'), $expression);
+
+ $expression = str_replace(array('?', '*'), array("\?", "\*"), $expression);
+ $expression = str_replace(array(chr(0) . "\?", chr(0) . "\*"), array('?', '*'), $expression);
+
+ return 'NOT GLOB \'' . $this->sql_escape($expression) . '\'';
+ }
+
+ /**
+ * return sql error array
+ * @access private
+ */
+ function _sql_error()
+ {
+ if (function_exists('sqlite_error_string'))
+ {
+ $error = array(
+ 'message' => @sqlite_error_string(@sqlite_last_error($this->db_connect_id)),
+ 'code' => @sqlite_last_error($this->db_connect_id),
+ );
+ }
+ else
+ {
+ $error = array(
+ 'message' => $this->connect_error,
+ 'code' => '',
+ );
+ }
+
+ return $error;
+ }
+
+ /**
+ * Build db-specific query data
+ * @access private
+ */
+ function _sql_custom_build($stage, $data)
+ {
+ return $data;
+ }
+
+ /**
+ * Close sql connection
+ * @access private
+ */
+ function _sql_close()
+ {
+ return @sqlite_close($this->db_connect_id);
+ }
+
+ /**
+ * Build db-specific report
+ * @access private
+ */
+ function _sql_report($mode, $query = '')
+ {
+ switch ($mode)
+ {
+ case 'start':
+ break;
+
+ case 'fromcache':
+ $endtime = explode(' ', microtime());
+ $endtime = $endtime[0] + $endtime[1];
+
+ $result = @sqlite_query($query, $this->db_connect_id);
+ while ($void = @sqlite_fetch_array($result, SQLITE_ASSOC))
+ {
+ // Take the time spent on parsing rows into account
+ }
+
+ $splittime = explode(' ', microtime());
+ $splittime = $splittime[0] + $splittime[1];
+
+ $this->sql_report('record_fromcache', $query, $endtime, $splittime);
+
+ break;
+ }
+ }
+}
diff --git a/phpBB/phpbb/db/driver/sqlite3.php b/phpBB/phpbb/db/driver/sqlite3.php
new file mode 100644
index 0000000000..cc3352af34
--- /dev/null
+++ b/phpBB/phpbb/db/driver/sqlite3.php
@@ -0,0 +1,405 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\driver;
+
+/**
+* SQLite3 Database Abstraction Layer
+* Minimum Requirement: 3.6.15+
+*/
+class sqlite3 extends \phpbb\db\driver\driver
+{
+ /**
+ * @var string Stores errors during connection setup in case the driver is not available
+ */
+ protected $connect_error = '';
+
+ /**
+ * @var \SQLite3 The SQLite3 database object to operate against
+ */
+ protected $dbo = null;
+
+ /**
+ * {@inheritDoc}
+ */
+ public function sql_connect($sqlserver, $sqluser, $sqlpassword, $database, $port = false, $persistency = false, $new_link = false)
+ {
+ $this->persistency = false;
+ $this->user = $sqluser;
+ $this->server = $sqlserver . (($port) ? ':' . $port : '');
+ $this->dbname = $database;
+
+ if (!class_exists('SQLite3', false))
+ {
+ $this->connect_error = 'SQLite3 not found, is the extension installed?';
+ return $this->sql_error('');
+ }
+
+ try
+ {
+ $this->dbo = new \SQLite3($this->server, SQLITE3_OPEN_READWRITE | SQLITE3_OPEN_CREATE);
+ $this->dbo->busyTimeout(60000);
+ $this->db_connect_id = true;
+ }
+ catch (\Exception $e)
+ {
+ $this->connect_error = $e->getMessage();
+ return array('message' => $this->connect_error);
+ }
+
+ return true;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function sql_server_info($raw = false, $use_cache = true)
+ {
+ global $cache;
+
+ if (!$use_cache || empty($cache) || ($this->sql_server_version = $cache->get('sqlite_version')) === false)
+ {
+ $version = \SQLite3::version();
+
+ $this->sql_server_version = $version['versionString'];
+
+ if (!empty($cache) && $use_cache)
+ {
+ $cache->put('sqlite_version', $this->sql_server_version);
+ }
+ }
+
+ return ($raw) ? $this->sql_server_version : 'SQLite ' . $this->sql_server_version;
+ }
+
+ /**
+ * SQL Transaction
+ *
+ * @param string $status Should be one of the following strings:
+ * begin, commit, rollback
+ * @return bool Success/failure of the transaction query
+ */
+ protected function _sql_transaction($status = 'begin')
+ {
+ switch ($status)
+ {
+ case 'begin':
+ return $this->dbo->exec('BEGIN IMMEDIATE');
+ break;
+
+ case 'commit':
+ return $this->dbo->exec('COMMIT');
+ break;
+
+ case 'rollback':
+ return $this->dbo->exec('ROLLBACK');
+ break;
+ }
+
+ return true;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function sql_query($query = '', $cache_ttl = 0)
+ {
+ if ($query != '')
+ {
+ global $cache;
+
+ // EXPLAIN only in extra debug mode
+ if (defined('DEBUG'))
+ {
+ $this->sql_report('start', $query);
+ }
+ else if (defined('PHPBB_DISPLAY_LOAD_TIME'))
+ {
+ $this->curtime = microtime(true);
+ }
+
+ $this->last_query_text = $query;
+ $this->query_result = ($cache && $cache_ttl) ? $cache->sql_load($query) : false;
+ $this->sql_add_num_queries($this->query_result);
+
+ if ($this->query_result === false)
+ {
+ if (($this->query_result = @$this->dbo->query($query)) === false)
+ {
+ $this->sql_error($query);
+ }
+
+ if (defined('DEBUG'))
+ {
+ $this->sql_report('stop', $query);
+ }
+ else if (defined('PHPBB_DISPLAY_LOAD_TIME'))
+ {
+ $this->sql_time += microtime(true) - $this->curtime;
+ }
+
+ if ($cache && $cache_ttl)
+ {
+ $this->query_result = $cache->sql_save($this, $query, $this->query_result, $cache_ttl);
+ }
+ }
+ else if (defined('DEBUG'))
+ {
+ $this->sql_report('fromcache', $query);
+ }
+ }
+ else
+ {
+ return false;
+ }
+
+ return $this->query_result;
+ }
+
+ /**
+ * Build LIMIT query
+ *
+ * @param string $query The SQL query to execute
+ * @param int $total The number of rows to select
+ * @param int $offset
+ * @param int $cache_ttl Either 0 to avoid caching or
+ * the time in seconds which the result shall be kept in cache
+ * @return mixed Buffered, seekable result handle, false on error
+ */
+ protected function _sql_query_limit($query, $total, $offset = 0, $cache_ttl = 0)
+ {
+ $this->query_result = false;
+
+ // if $total is set to 0 we do not want to limit the number of rows
+ if ($total == 0)
+ {
+ $total = -1;
+ }
+
+ $query .= "\n LIMIT " . ((!empty($offset)) ? $offset . ', ' . $total : $total);
+
+ return $this->sql_query($query, $cache_ttl);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function sql_affectedrows()
+ {
+ return ($this->db_connect_id) ? $this->dbo->changes() : false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function sql_fetchrow($query_id = false)
+ {
+ global $cache;
+
+ if ($query_id === false)
+ {
+ $query_id = $this->query_result;
+ }
+
+ if ($cache && !is_object($query_id) && $cache->sql_exists($query_id))
+ {
+ return $cache->sql_fetchrow($query_id);
+ }
+
+ return is_object($query_id) ? $query_id->fetchArray(SQLITE3_ASSOC) : false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function sql_nextid()
+ {
+ return ($this->db_connect_id) ? $this->dbo->lastInsertRowID() : false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function sql_freeresult($query_id = false)
+ {
+ global $cache;
+
+ if ($query_id === false)
+ {
+ $query_id = $this->query_result;
+ }
+
+ if ($cache && !is_object($query_id) && $cache->sql_exists($query_id))
+ {
+ return $cache->sql_freeresult($query_id);
+ }
+
+ if ($query_id)
+ {
+ return @$query_id->finalize();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function sql_escape($msg)
+ {
+ return \SQLite3::escapeString($msg);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * For SQLite an underscore is an unknown character.
+ */
+ public function sql_like_expression($expression)
+ {
+ // Unlike LIKE, GLOB is unfortunately case sensitive.
+ // We only catch * and ? here, not the character map possible on file globbing.
+ $expression = str_replace(array(chr(0) . '_', chr(0) . '%'), array(chr(0) . '?', chr(0) . '*'), $expression);
+
+ $expression = str_replace(array('?', '*'), array("\?", "\*"), $expression);
+ $expression = str_replace(array(chr(0) . "\?", chr(0) . "\*"), array('?', '*'), $expression);
+
+ return 'GLOB \'' . $this->sql_escape($expression) . '\'';
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * For SQLite an underscore is an unknown character.
+ */
+ public function sql_not_like_expression($expression)
+ {
+ // Unlike NOT LIKE, NOT GLOB is unfortunately case sensitive
+ // We only catch * and ? here, not the character map possible on file globbing.
+ $expression = str_replace(array(chr(0) . '_', chr(0) . '%'), array(chr(0) . '?', chr(0) . '*'), $expression);
+
+ $expression = str_replace(array('?', '*'), array("\?", "\*"), $expression);
+ $expression = str_replace(array(chr(0) . "\?", chr(0) . "\*"), array('?', '*'), $expression);
+
+ return 'NOT GLOB \'' . $this->sql_escape($expression) . '\'';
+ }
+
+ /**
+ * return sql error array
+ *
+ * @return array
+ */
+ protected function _sql_error()
+ {
+ if (class_exists('SQLite3', false) && isset($this->dbo))
+ {
+ $error = array(
+ 'message' => $this->dbo->lastErrorMsg(),
+ 'code' => $this->dbo->lastErrorCode(),
+ );
+ }
+ else
+ {
+ $error = array(
+ 'message' => $this->connect_error,
+ 'code' => '',
+ );
+ }
+
+ return $error;
+ }
+
+ /**
+ * Build db-specific query data
+ *
+ * @param string $stage Available stages: FROM, WHERE
+ * @param mixed $data A string containing the CROSS JOIN query or an array of WHERE clauses
+ *
+ * @return string The db-specific query fragment
+ */
+ protected function _sql_custom_build($stage, $data)
+ {
+ return $data;
+ }
+
+ /**
+ * Close sql connection
+ *
+ * @return bool False if failure
+ */
+ protected function _sql_close()
+ {
+ return $this->dbo->close();
+ }
+
+ /**
+ * Build db-specific report
+ *
+ * @param string $mode Available modes: display, start, stop,
+ * add_select_row, fromcache, record_fromcache
+ * @param string $query The Query that should be explained
+ * @return mixed Either a full HTML page, boolean or null
+ */
+ protected function _sql_report($mode, $query = '')
+ {
+ switch ($mode)
+ {
+ case 'start':
+
+ $explain_query = $query;
+ if (preg_match('/UPDATE ([a-z0-9_]+).*?WHERE(.*)/s', $query, $m))
+ {
+ $explain_query = 'SELECT * FROM ' . $m[1] . ' WHERE ' . $m[2];
+ }
+ else if (preg_match('/DELETE FROM ([a-z0-9_]+).*?WHERE(.*)/s', $query, $m))
+ {
+ $explain_query = 'SELECT * FROM ' . $m[1] . ' WHERE ' . $m[2];
+ }
+
+ if (preg_match('/^SELECT/', $explain_query))
+ {
+ $html_table = false;
+
+ if ($result = $this->dbo->query("EXPLAIN QUERY PLAN $explain_query"))
+ {
+ while ($row = $result->fetchArray(SQLITE3_ASSOC))
+ {
+ $html_table = $this->sql_report('add_select_row', $query, $html_table, $row);
+ }
+ }
+
+ if ($html_table)
+ {
+ $this->html_hold .= '</table>';
+ }
+ }
+
+ break;
+
+ case 'fromcache':
+ $endtime = explode(' ', microtime());
+ $endtime = $endtime[0] + $endtime[1];
+
+ $result = $this->dbo->query($query);
+ while ($void = $result->fetchArray(SQLITE3_ASSOC))
+ {
+ // Take the time spent on parsing rows into account
+ }
+
+ $splittime = explode(' ', microtime());
+ $splittime = $splittime[0] + $splittime[1];
+
+ $this->sql_report('record_fromcache', $query, $endtime, $splittime);
+
+ break;
+ }
+ }
+}
diff --git a/phpBB/phpbb/db/html_migrator_output_handler.php b/phpBB/phpbb/db/html_migrator_output_handler.php
new file mode 100644
index 0000000000..e37c667463
--- /dev/null
+++ b/phpBB/phpbb/db/html_migrator_output_handler.php
@@ -0,0 +1,48 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db;
+
+use phpbb\user;
+
+class html_migrator_output_handler implements migrator_output_handler_interface
+{
+ /**
+ * User object.
+ *
+ * @var user
+ */
+ private $user;
+
+ /**
+ * Constructor
+ *
+ * @param user $user User object
+ */
+ public function __construct(user $user)
+ {
+ $this->user = $user;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function write($message, $verbosity)
+ {
+ if ($verbosity <= migrator_output_handler_interface::VERBOSITY_VERBOSE)
+ {
+ $final_message = call_user_func_array(array($this->user, 'lang'), $message);
+ echo $final_message . "<br />\n";
+ }
+ }
+}
diff --git a/phpBB/phpbb/db/log_wrapper_migrator_output_handler.php b/phpBB/phpbb/db/log_wrapper_migrator_output_handler.php
new file mode 100644
index 0000000000..94c293dc45
--- /dev/null
+++ b/phpBB/phpbb/db/log_wrapper_migrator_output_handler.php
@@ -0,0 +1,95 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db;
+
+use phpbb\user;
+
+class log_wrapper_migrator_output_handler implements migrator_output_handler_interface
+{
+ /**
+ * User object.
+ *
+ * @var user
+ */
+ protected $user;
+
+ /**
+ * A migrator output handler
+ *
+ * @var migrator_output_handler_interface
+ */
+ protected $migrator;
+
+ /**
+ * Log file handle
+ * @var resource
+ */
+ protected $file_handle = false;
+
+ /**
+ * Constructor
+ *
+ * @param user $user User object
+ * @param migrator_output_handler_interface $migrator Migrator output handler
+ * @param string $log_file File to log to
+ */
+ public function __construct(user $user, migrator_output_handler_interface $migrator, $log_file)
+ {
+ $this->user = $user;
+ $this->migrator = $migrator;
+ $this->file_open($log_file);
+ }
+
+ /**
+ * Open file for logging
+ *
+ * @param string $file File to open
+ */
+ protected function file_open($file)
+ {
+ if (phpbb_is_writable(dirname($file)))
+ {
+ $this->file_handle = fopen($file, 'w');
+ }
+ else
+ {
+ throw new \RuntimeException('Unable to write to migrator log file');
+ }
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function write($message, $verbosity)
+ {
+ $this->migrator->write($message, $verbosity);
+
+ if ($this->file_handle !== false)
+ {
+ $translated_message = call_user_func_array(array($this->user, 'lang'), $message) . "\n";
+
+ if ($verbosity <= migrator_output_handler_interface::VERBOSITY_NORMAL)
+ {
+ $translated_message = '[INFO] ' . $translated_message;
+ }
+ else
+ {
+ $translated_message = '[DEBUG] ' . $translated_message;
+ }
+
+ fwrite($this->file_handle, $translated_message);
+ fflush($this->file_handle);
+ }
+ }
+}
diff --git a/phpBB/phpbb/db/migration/container_aware_migration.php b/phpBB/phpbb/db/migration/container_aware_migration.php
new file mode 100644
index 0000000000..3b4b49b04b
--- /dev/null
+++ b/phpBB/phpbb/db/migration/container_aware_migration.php
@@ -0,0 +1,36 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration;
+
+use Symfony\Component\DependencyInjection\ContainerAwareInterface;
+use Symfony\Component\DependencyInjection\ContainerInterface;
+
+/**
+* Abstract base class for container aware database migrations.
+*/
+abstract class container_aware_migration extends migration implements ContainerAwareInterface
+{
+ /**
+ * @var ContainerInterface
+ */
+ protected $container;
+
+ /**
+ * {@inheritdoc}
+ */
+ public function setContainer(ContainerInterface $container = null)
+ {
+ $this->container = $container;
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v30x/.htaccess b/phpBB/phpbb/db/migration/data/v30x/.htaccess
new file mode 100644
index 0000000000..44242b5418
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v30x/.htaccess
@@ -0,0 +1,33 @@
+# With Apache 2.4 the "Order, Deny" syntax has been deprecated and moved from
+# module mod_authz_host to a new module called mod_access_compat (which may be
+# disabled) and a new "Require" syntax has been introduced to mod_authz_host.
+# We could just conditionally provide both versions, but unfortunately Apache
+# does not explicitly tell us its version if the module mod_version is not
+# available. In this case, we check for the availability of module
+# mod_authz_core (which should be on 2.4 or higher only) as a best guess.
+<IfModule mod_version.c>
+ <IfVersion < 2.4>
+ <Files "*">
+ Order Allow,Deny
+ Deny from All
+ </Files>
+ </IfVersion>
+ <IfVersion >= 2.4>
+ <Files "*">
+ Require all denied
+ </Files>
+ </IfVersion>
+</IfModule>
+<IfModule !mod_version.c>
+ <IfModule !mod_authz_core.c>
+ <Files "*">
+ Order Allow,Deny
+ Deny from All
+ </Files>
+ </IfModule>
+ <IfModule mod_authz_core.c>
+ <Files "*">
+ Require all denied
+ </Files>
+ </IfModule>
+</IfModule>
diff --git a/phpBB/phpbb/db/migration/data/v30x/local_url_bbcode.php b/phpBB/phpbb/db/migration/data/v30x/local_url_bbcode.php
new file mode 100644
index 0000000000..648ae9ce96
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v30x/local_url_bbcode.php
@@ -0,0 +1,70 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v30x;
+
+class local_url_bbcode extends \phpbb\db\migration\migration
+{
+ static public function depends_on()
+ {
+ return array('\phpbb\db\migration\data\v30x\release_3_0_12_rc1');
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('custom', array(array($this, 'update_local_url_bbcode'))),
+ );
+ }
+
+ /**
+ * Update BBCodes that currently use the LOCAL_URL tag
+ *
+ * To fix http://tracker.phpbb.com/browse/PHPBB3-8319 we changed
+ * the second_pass_replace value, so that needs updating for existing ones
+ */
+ public function update_local_url_bbcode()
+ {
+ $sql = 'SELECT *
+ FROM ' . BBCODES_TABLE . '
+ WHERE bbcode_match ' . $this->db->sql_like_expression($this->db->get_any_char() . 'LOCAL_URL' . $this->db->get_any_char());
+ $result = $this->db->sql_query($sql);
+
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ if (!class_exists('acp_bbcodes'))
+ {
+ if (function_exists('phpbb_require_updated'))
+ {
+ phpbb_require_updated('includes/acp/acp_bbcodes.' . $this->php_ext);
+ }
+ else
+ {
+ require($this->phpbb_root_path . 'includes/acp/acp_bbcodes.' . $this->php_ext);
+ }
+ }
+
+ $bbcode_match = $row['bbcode_match'];
+ $bbcode_tpl = $row['bbcode_tpl'];
+
+ $acp_bbcodes = new \acp_bbcodes();
+ $sql_ary = $acp_bbcodes->build_regexp($bbcode_match, $bbcode_tpl);
+
+ $sql = 'UPDATE ' . BBCODES_TABLE . '
+ SET ' . $this->db->sql_build_array('UPDATE', $sql_ary) . '
+ WHERE bbcode_id = ' . (int) $row['bbcode_id'];
+ $this->sql_query($sql);
+ }
+ $this->db->sql_freeresult($result);
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_0.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_0.php
new file mode 100644
index 0000000000..26937d6d80
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_0.php
@@ -0,0 +1,1181 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v30x;
+
+class release_3_0_0 extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.0.0', '>=');
+ }
+
+ public function update_schema()
+ {
+ return array(
+ 'add_tables' => array(
+ $this->table_prefix . 'attachments' => array(
+ 'COLUMNS' => array(
+ 'attach_id' => array('UINT', NULL, 'auto_increment'),
+ 'post_msg_id' => array('UINT', 0),
+ 'topic_id' => array('UINT', 0),
+ 'in_message' => array('BOOL', 0),
+ 'poster_id' => array('UINT', 0),
+ 'is_orphan' => array('BOOL', 1),
+ 'physical_filename' => array('VCHAR', ''),
+ 'real_filename' => array('VCHAR', ''),
+ 'download_count' => array('UINT', 0),
+ 'attach_comment' => array('TEXT_UNI', ''),
+ 'extension' => array('VCHAR:100', ''),
+ 'mimetype' => array('VCHAR:100', ''),
+ 'filesize' => array('UINT:20', 0),
+ 'filetime' => array('TIMESTAMP', 0),
+ 'thumbnail' => array('BOOL', 0),
+ ),
+ 'PRIMARY_KEY' => 'attach_id',
+ 'KEYS' => array(
+ 'filetime' => array('INDEX', 'filetime'),
+ 'post_msg_id' => array('INDEX', 'post_msg_id'),
+ 'topic_id' => array('INDEX', 'topic_id'),
+ 'poster_id' => array('INDEX', 'poster_id'),
+ 'is_orphan' => array('INDEX', 'is_orphan'),
+ ),
+ ),
+
+ $this->table_prefix . 'acl_groups' => array(
+ 'COLUMNS' => array(
+ 'group_id' => array('UINT', 0),
+ 'forum_id' => array('UINT', 0),
+ 'auth_option_id' => array('UINT', 0),
+ 'auth_role_id' => array('UINT', 0),
+ 'auth_setting' => array('TINT:2', 0),
+ ),
+ 'KEYS' => array(
+ 'group_id' => array('INDEX', 'group_id'),
+ 'auth_opt_id' => array('INDEX', 'auth_option_id'),
+ 'auth_role_id' => array('INDEX', 'auth_role_id'),
+ ),
+ ),
+
+ $this->table_prefix . 'acl_options' => array(
+ 'COLUMNS' => array(
+ 'auth_option_id' => array('UINT', NULL, 'auto_increment'),
+ 'auth_option' => array('VCHAR:50', ''),
+ 'is_global' => array('BOOL', 0),
+ 'is_local' => array('BOOL', 0),
+ 'founder_only' => array('BOOL', 0),
+ ),
+ 'PRIMARY_KEY' => 'auth_option_id',
+ 'KEYS' => array(
+ 'auth_option' => array('INDEX', 'auth_option'),
+ ),
+ ),
+
+ $this->table_prefix . 'acl_roles' => array(
+ 'COLUMNS' => array(
+ 'role_id' => array('UINT', NULL, 'auto_increment'),
+ 'role_name' => array('VCHAR_UNI', ''),
+ 'role_description' => array('TEXT_UNI', ''),
+ 'role_type' => array('VCHAR:10', ''),
+ 'role_order' => array('USINT', 0),
+ ),
+ 'PRIMARY_KEY' => 'role_id',
+ 'KEYS' => array(
+ 'role_type' => array('INDEX', 'role_type'),
+ 'role_order' => array('INDEX', 'role_order'),
+ ),
+ ),
+
+ $this->table_prefix . 'acl_roles_data' => array(
+ 'COLUMNS' => array(
+ 'role_id' => array('UINT', 0),
+ 'auth_option_id' => array('UINT', 0),
+ 'auth_setting' => array('TINT:2', 0),
+ ),
+ 'PRIMARY_KEY' => array('role_id', 'auth_option_id'),
+ 'KEYS' => array(
+ 'ath_op_id' => array('INDEX', 'auth_option_id'),
+ ),
+ ),
+
+ $this->table_prefix . 'acl_users' => array(
+ 'COLUMNS' => array(
+ 'user_id' => array('UINT', 0),
+ 'forum_id' => array('UINT', 0),
+ 'auth_option_id' => array('UINT', 0),
+ 'auth_role_id' => array('UINT', 0),
+ 'auth_setting' => array('TINT:2', 0),
+ ),
+ 'KEYS' => array(
+ 'user_id' => array('INDEX', 'user_id'),
+ 'auth_option_id' => array('INDEX', 'auth_option_id'),
+ 'auth_role_id' => array('INDEX', 'auth_role_id'),
+ ),
+ ),
+
+ $this->table_prefix . 'banlist' => array(
+ 'COLUMNS' => array(
+ 'ban_id' => array('UINT', NULL, 'auto_increment'),
+ 'ban_userid' => array('UINT', 0),
+ 'ban_ip' => array('VCHAR:40', ''),
+ 'ban_email' => array('VCHAR_UNI:100', ''),
+ 'ban_start' => array('TIMESTAMP', 0),
+ 'ban_end' => array('TIMESTAMP', 0),
+ 'ban_exclude' => array('BOOL', 0),
+ 'ban_reason' => array('VCHAR_UNI', ''),
+ 'ban_give_reason' => array('VCHAR_UNI', ''),
+ ),
+ 'PRIMARY_KEY' => 'ban_id',
+ 'KEYS' => array(
+ 'ban_end' => array('INDEX', 'ban_end'),
+ 'ban_user' => array('INDEX', array('ban_userid', 'ban_exclude')),
+ 'ban_email' => array('INDEX', array('ban_email', 'ban_exclude')),
+ 'ban_ip' => array('INDEX', array('ban_ip', 'ban_exclude')),
+ ),
+ ),
+
+ $this->table_prefix . 'bbcodes' => array(
+ 'COLUMNS' => array(
+ 'bbcode_id' => array('TINT:3', 0),
+ 'bbcode_tag' => array('VCHAR:16', ''),
+ 'bbcode_helpline' => array('VCHAR_UNI', ''),
+ 'display_on_posting' => array('BOOL', 0),
+ 'bbcode_match' => array('TEXT_UNI', ''),
+ 'bbcode_tpl' => array('MTEXT_UNI', ''),
+ 'first_pass_match' => array('MTEXT_UNI', ''),
+ 'first_pass_replace' => array('MTEXT_UNI', ''),
+ 'second_pass_match' => array('MTEXT_UNI', ''),
+ 'second_pass_replace' => array('MTEXT_UNI', ''),
+ ),
+ 'PRIMARY_KEY' => 'bbcode_id',
+ 'KEYS' => array(
+ 'display_on_post' => array('INDEX', 'display_on_posting'),
+ ),
+ ),
+
+ $this->table_prefix . 'bookmarks' => array(
+ 'COLUMNS' => array(
+ 'topic_id' => array('UINT', 0),
+ 'user_id' => array('UINT', 0),
+ ),
+ 'PRIMARY_KEY' => array('topic_id', 'user_id'),
+ ),
+
+ $this->table_prefix . 'bots' => array(
+ 'COLUMNS' => array(
+ 'bot_id' => array('UINT', NULL, 'auto_increment'),
+ 'bot_active' => array('BOOL', 1),
+ 'bot_name' => array('STEXT_UNI', ''),
+ 'user_id' => array('UINT', 0),
+ 'bot_agent' => array('VCHAR', ''),
+ 'bot_ip' => array('VCHAR', ''),
+ ),
+ 'PRIMARY_KEY' => 'bot_id',
+ 'KEYS' => array(
+ 'bot_active' => array('INDEX', 'bot_active'),
+ ),
+ ),
+
+ $this->table_prefix . 'config' => array(
+ 'COLUMNS' => array(
+ 'config_name' => array('VCHAR', ''),
+ 'config_value' => array('VCHAR_UNI', ''),
+ 'is_dynamic' => array('BOOL', 0),
+ ),
+ 'PRIMARY_KEY' => 'config_name',
+ 'KEYS' => array(
+ 'is_dynamic' => array('INDEX', 'is_dynamic'),
+ ),
+ ),
+
+ $this->table_prefix . 'confirm' => array(
+ 'COLUMNS' => array(
+ 'confirm_id' => array('CHAR:32', ''),
+ 'session_id' => array('CHAR:32', ''),
+ 'confirm_type' => array('TINT:3', 0),
+ 'code' => array('VCHAR:8', ''),
+ 'seed' => array('UINT:10', 0),
+ ),
+ 'PRIMARY_KEY' => array('session_id', 'confirm_id'),
+ 'KEYS' => array(
+ 'confirm_type' => array('INDEX', 'confirm_type'),
+ ),
+ ),
+
+ $this->table_prefix . 'disallow' => array(
+ 'COLUMNS' => array(
+ 'disallow_id' => array('UINT', NULL, 'auto_increment'),
+ 'disallow_username' => array('VCHAR_UNI:255', ''),
+ ),
+ 'PRIMARY_KEY' => 'disallow_id',
+ ),
+
+ $this->table_prefix . 'drafts' => array(
+ 'COLUMNS' => array(
+ 'draft_id' => array('UINT', NULL, 'auto_increment'),
+ 'user_id' => array('UINT', 0),
+ 'topic_id' => array('UINT', 0),
+ 'forum_id' => array('UINT', 0),
+ 'save_time' => array('TIMESTAMP', 0),
+ 'draft_subject' => array('XSTEXT_UNI', ''),
+ 'draft_message' => array('MTEXT_UNI', ''),
+ ),
+ 'PRIMARY_KEY' => 'draft_id',
+ 'KEYS' => array(
+ 'save_time' => array('INDEX', 'save_time'),
+ ),
+ ),
+
+ $this->table_prefix . 'extensions' => array(
+ 'COLUMNS' => array(
+ 'extension_id' => array('UINT', NULL, 'auto_increment'),
+ 'group_id' => array('UINT', 0),
+ 'extension' => array('VCHAR:100', ''),
+ ),
+ 'PRIMARY_KEY' => 'extension_id',
+ ),
+
+ $this->table_prefix . 'extension_groups' => array(
+ 'COLUMNS' => array(
+ 'group_id' => array('UINT', NULL, 'auto_increment'),
+ 'group_name' => array('VCHAR_UNI', ''),
+ 'cat_id' => array('TINT:2', 0),
+ 'allow_group' => array('BOOL', 0),
+ 'download_mode' => array('BOOL', 1),
+ 'upload_icon' => array('VCHAR', ''),
+ 'max_filesize' => array('UINT:20', 0),
+ 'allowed_forums' => array('TEXT', ''),
+ 'allow_in_pm' => array('BOOL', 0),
+ ),
+ 'PRIMARY_KEY' => 'group_id',
+ ),
+
+ $this->table_prefix . 'forums' => array(
+ 'COLUMNS' => array(
+ 'forum_id' => array('UINT', NULL, 'auto_increment'),
+ 'parent_id' => array('UINT', 0),
+ 'left_id' => array('UINT', 0),
+ 'right_id' => array('UINT', 0),
+ 'forum_parents' => array('MTEXT', ''),
+ 'forum_name' => array('STEXT_UNI', ''),
+ 'forum_desc' => array('TEXT_UNI', ''),
+ 'forum_desc_bitfield' => array('VCHAR:255', ''),
+ 'forum_desc_options' => array('UINT:11', 7),
+ 'forum_desc_uid' => array('VCHAR:8', ''),
+ 'forum_link' => array('VCHAR_UNI', ''),
+ 'forum_password' => array('VCHAR_UNI:40', ''),
+ 'forum_style' => array('USINT', 0),
+ 'forum_image' => array('VCHAR', ''),
+ 'forum_rules' => array('TEXT_UNI', ''),
+ 'forum_rules_link' => array('VCHAR_UNI', ''),
+ 'forum_rules_bitfield' => array('VCHAR:255', ''),
+ 'forum_rules_options' => array('UINT:11', 7),
+ 'forum_rules_uid' => array('VCHAR:8', ''),
+ 'forum_topics_per_page' => array('TINT:4', 0),
+ 'forum_type' => array('TINT:4', 0),
+ 'forum_status' => array('TINT:4', 0),
+ 'forum_posts' => array('UINT', 0),
+ 'forum_topics' => array('UINT', 0),
+ 'forum_topics_real' => array('UINT', 0),
+ 'forum_last_post_id' => array('UINT', 0),
+ 'forum_last_poster_id' => array('UINT', 0),
+ 'forum_last_post_subject' => array('XSTEXT_UNI', ''),
+ 'forum_last_post_time' => array('TIMESTAMP', 0),
+ 'forum_last_poster_name'=> array('VCHAR_UNI', ''),
+ 'forum_last_poster_colour'=> array('VCHAR:6', ''),
+ 'forum_flags' => array('TINT:4', 32),
+ 'display_on_index' => array('BOOL', 1),
+ 'enable_indexing' => array('BOOL', 1),
+ 'enable_icons' => array('BOOL', 1),
+ 'enable_prune' => array('BOOL', 0),
+ 'prune_next' => array('TIMESTAMP', 0),
+ 'prune_days' => array('UINT', 0),
+ 'prune_viewed' => array('UINT', 0),
+ 'prune_freq' => array('UINT', 0),
+ ),
+ 'PRIMARY_KEY' => 'forum_id',
+ 'KEYS' => array(
+ 'left_right_id' => array('INDEX', array('left_id', 'right_id')),
+ 'forum_lastpost_id' => array('INDEX', 'forum_last_post_id'),
+ ),
+ ),
+
+ $this->table_prefix . 'forums_access' => array(
+ 'COLUMNS' => array(
+ 'forum_id' => array('UINT', 0),
+ 'user_id' => array('UINT', 0),
+ 'session_id' => array('CHAR:32', ''),
+ ),
+ 'PRIMARY_KEY' => array('forum_id', 'user_id', 'session_id'),
+ ),
+
+ $this->table_prefix . 'forums_track' => array(
+ 'COLUMNS' => array(
+ 'user_id' => array('UINT', 0),
+ 'forum_id' => array('UINT', 0),
+ 'mark_time' => array('TIMESTAMP', 0),
+ ),
+ 'PRIMARY_KEY' => array('user_id', 'forum_id'),
+ ),
+
+ $this->table_prefix . 'forums_watch' => array(
+ 'COLUMNS' => array(
+ 'forum_id' => array('UINT', 0),
+ 'user_id' => array('UINT', 0),
+ 'notify_status' => array('BOOL', 0),
+ ),
+ 'KEYS' => array(
+ 'forum_id' => array('INDEX', 'forum_id'),
+ 'user_id' => array('INDEX', 'user_id'),
+ 'notify_stat' => array('INDEX', 'notify_status'),
+ ),
+ ),
+
+ $this->table_prefix . 'groups' => array(
+ 'COLUMNS' => array(
+ 'group_id' => array('UINT', NULL, 'auto_increment'),
+ 'group_type' => array('TINT:4', 1),
+ 'group_founder_manage' => array('BOOL', 0),
+ 'group_name' => array('VCHAR_CI', ''),
+ 'group_desc' => array('TEXT_UNI', ''),
+ 'group_desc_bitfield' => array('VCHAR:255', ''),
+ 'group_desc_options' => array('UINT:11', 7),
+ 'group_desc_uid' => array('VCHAR:8', ''),
+ 'group_display' => array('BOOL', 0),
+ 'group_avatar' => array('VCHAR', ''),
+ 'group_avatar_type' => array('TINT:2', 0),
+ 'group_avatar_width' => array('USINT', 0),
+ 'group_avatar_height' => array('USINT', 0),
+ 'group_rank' => array('UINT', 0),
+ 'group_colour' => array('VCHAR:6', ''),
+ 'group_sig_chars' => array('UINT', 0),
+ 'group_receive_pm' => array('BOOL', 0),
+ 'group_message_limit' => array('UINT', 0),
+ 'group_legend' => array('BOOL', 1),
+ ),
+ 'PRIMARY_KEY' => 'group_id',
+ 'KEYS' => array(
+ 'group_legend' => array('INDEX', 'group_legend'),
+ ),
+ ),
+
+ $this->table_prefix . 'icons' => array(
+ 'COLUMNS' => array(
+ 'icons_id' => array('UINT', NULL, 'auto_increment'),
+ 'icons_url' => array('VCHAR', ''),
+ 'icons_width' => array('TINT:4', 0),
+ 'icons_height' => array('TINT:4', 0),
+ 'icons_order' => array('UINT', 0),
+ 'display_on_posting' => array('BOOL', 1),
+ ),
+ 'PRIMARY_KEY' => 'icons_id',
+ 'KEYS' => array(
+ 'display_on_posting' => array('INDEX', 'display_on_posting'),
+ ),
+ ),
+
+ $this->table_prefix . 'lang' => array(
+ 'COLUMNS' => array(
+ 'lang_id' => array('TINT:4', NULL, 'auto_increment'),
+ 'lang_iso' => array('VCHAR:30', ''),
+ 'lang_dir' => array('VCHAR:30', ''),
+ 'lang_english_name' => array('VCHAR_UNI:100', ''),
+ 'lang_local_name' => array('VCHAR_UNI:255', ''),
+ 'lang_author' => array('VCHAR_UNI:255', ''),
+ ),
+ 'PRIMARY_KEY' => 'lang_id',
+ 'KEYS' => array(
+ 'lang_iso' => array('INDEX', 'lang_iso'),
+ ),
+ ),
+
+ $this->table_prefix . 'log' => array(
+ 'COLUMNS' => array(
+ 'log_id' => array('UINT', NULL, 'auto_increment'),
+ 'log_type' => array('TINT:4', 0),
+ 'user_id' => array('UINT', 0),
+ 'forum_id' => array('UINT', 0),
+ 'topic_id' => array('UINT', 0),
+ 'reportee_id' => array('UINT', 0),
+ 'log_ip' => array('VCHAR:40', ''),
+ 'log_time' => array('TIMESTAMP', 0),
+ 'log_operation' => array('TEXT_UNI', ''),
+ 'log_data' => array('MTEXT_UNI', ''),
+ ),
+ 'PRIMARY_KEY' => 'log_id',
+ 'KEYS' => array(
+ 'log_type' => array('INDEX', 'log_type'),
+ 'forum_id' => array('INDEX', 'forum_id'),
+ 'topic_id' => array('INDEX', 'topic_id'),
+ 'reportee_id' => array('INDEX', 'reportee_id'),
+ 'user_id' => array('INDEX', 'user_id'),
+ ),
+ ),
+
+ $this->table_prefix . 'moderator_cache' => array(
+ 'COLUMNS' => array(
+ 'forum_id' => array('UINT', 0),
+ 'user_id' => array('UINT', 0),
+ 'username' => array('VCHAR_UNI:255', ''),
+ 'group_id' => array('UINT', 0),
+ 'group_name' => array('VCHAR_UNI', ''),
+ 'display_on_index' => array('BOOL', 1),
+ ),
+ 'KEYS' => array(
+ 'disp_idx' => array('INDEX', 'display_on_index'),
+ 'forum_id' => array('INDEX', 'forum_id'),
+ ),
+ ),
+
+ $this->table_prefix . 'modules' => array(
+ 'COLUMNS' => array(
+ 'module_id' => array('UINT', NULL, 'auto_increment'),
+ 'module_enabled' => array('BOOL', 1),
+ 'module_display' => array('BOOL', 1),
+ 'module_basename' => array('VCHAR', ''),
+ 'module_class' => array('VCHAR:10', ''),
+ 'parent_id' => array('UINT', 0),
+ 'left_id' => array('UINT', 0),
+ 'right_id' => array('UINT', 0),
+ 'module_langname' => array('VCHAR', ''),
+ 'module_mode' => array('VCHAR', ''),
+ 'module_auth' => array('VCHAR', ''),
+ ),
+ 'PRIMARY_KEY' => 'module_id',
+ 'KEYS' => array(
+ 'left_right_id' => array('INDEX', array('left_id', 'right_id')),
+ 'module_enabled' => array('INDEX', 'module_enabled'),
+ 'class_left_id' => array('INDEX', array('module_class', 'left_id')),
+ ),
+ ),
+
+ $this->table_prefix . 'poll_options' => array(
+ 'COLUMNS' => array(
+ 'poll_option_id' => array('TINT:4', 0),
+ 'topic_id' => array('UINT', 0),
+ 'poll_option_text' => array('TEXT_UNI', ''),
+ 'poll_option_total' => array('UINT', 0),
+ ),
+ 'KEYS' => array(
+ 'poll_opt_id' => array('INDEX', 'poll_option_id'),
+ 'topic_id' => array('INDEX', 'topic_id'),
+ ),
+ ),
+
+ $this->table_prefix . 'poll_votes' => array(
+ 'COLUMNS' => array(
+ 'topic_id' => array('UINT', 0),
+ 'poll_option_id' => array('TINT:4', 0),
+ 'vote_user_id' => array('UINT', 0),
+ 'vote_user_ip' => array('VCHAR:40', ''),
+ ),
+ 'KEYS' => array(
+ 'topic_id' => array('INDEX', 'topic_id'),
+ 'vote_user_id' => array('INDEX', 'vote_user_id'),
+ 'vote_user_ip' => array('INDEX', 'vote_user_ip'),
+ ),
+ ),
+
+ $this->table_prefix . 'posts' => array(
+ 'COLUMNS' => array(
+ 'post_id' => array('UINT', NULL, 'auto_increment'),
+ 'topic_id' => array('UINT', 0),
+ 'forum_id' => array('UINT', 0),
+ 'poster_id' => array('UINT', 0),
+ 'icon_id' => array('UINT', 0),
+ 'poster_ip' => array('VCHAR:40', ''),
+ 'post_time' => array('TIMESTAMP', 0),
+ 'post_approved' => array('BOOL', 1),
+ 'post_reported' => array('BOOL', 0),
+ 'enable_bbcode' => array('BOOL', 1),
+ 'enable_smilies' => array('BOOL', 1),
+ 'enable_magic_url' => array('BOOL', 1),
+ 'enable_sig' => array('BOOL', 1),
+ 'post_username' => array('VCHAR_UNI:255', ''),
+ 'post_subject' => array('XSTEXT_UNI', '', 'true_sort'),
+ 'post_text' => array('MTEXT_UNI', ''),
+ 'post_checksum' => array('VCHAR:32', ''),
+ 'post_attachment' => array('BOOL', 0),
+ 'bbcode_bitfield' => array('VCHAR:255', ''),
+ 'bbcode_uid' => array('VCHAR:8', ''),
+ 'post_postcount' => array('BOOL', 1),
+ 'post_edit_time' => array('TIMESTAMP', 0),
+ 'post_edit_reason' => array('STEXT_UNI', ''),
+ 'post_edit_user' => array('UINT', 0),
+ 'post_edit_count' => array('USINT', 0),
+ 'post_edit_locked' => array('BOOL', 0),
+ ),
+ 'PRIMARY_KEY' => 'post_id',
+ 'KEYS' => array(
+ 'forum_id' => array('INDEX', 'forum_id'),
+ 'topic_id' => array('INDEX', 'topic_id'),
+ 'poster_ip' => array('INDEX', 'poster_ip'),
+ 'poster_id' => array('INDEX', 'poster_id'),
+ 'post_approved' => array('INDEX', 'post_approved'),
+ 'tid_post_time' => array('INDEX', array('topic_id', 'post_time')),
+ ),
+ ),
+
+ $this->table_prefix . 'privmsgs' => array(
+ 'COLUMNS' => array(
+ 'msg_id' => array('UINT', NULL, 'auto_increment'),
+ 'root_level' => array('UINT', 0),
+ 'author_id' => array('UINT', 0),
+ 'icon_id' => array('UINT', 0),
+ 'author_ip' => array('VCHAR:40', ''),
+ 'message_time' => array('TIMESTAMP', 0),
+ 'enable_bbcode' => array('BOOL', 1),
+ 'enable_smilies' => array('BOOL', 1),
+ 'enable_magic_url' => array('BOOL', 1),
+ 'enable_sig' => array('BOOL', 1),
+ 'message_subject' => array('XSTEXT_UNI', ''),
+ 'message_text' => array('MTEXT_UNI', ''),
+ 'message_edit_reason' => array('STEXT_UNI', ''),
+ 'message_edit_user' => array('UINT', 0),
+ 'message_attachment' => array('BOOL', 0),
+ 'bbcode_bitfield' => array('VCHAR:255', ''),
+ 'bbcode_uid' => array('VCHAR:8', ''),
+ 'message_edit_time' => array('TIMESTAMP', 0),
+ 'message_edit_count' => array('USINT', 0),
+ 'to_address' => array('TEXT_UNI', ''),
+ 'bcc_address' => array('TEXT_UNI', ''),
+ ),
+ 'PRIMARY_KEY' => 'msg_id',
+ 'KEYS' => array(
+ 'author_ip' => array('INDEX', 'author_ip'),
+ 'message_time' => array('INDEX', 'message_time'),
+ 'author_id' => array('INDEX', 'author_id'),
+ 'root_level' => array('INDEX', 'root_level'),
+ ),
+ ),
+
+ $this->table_prefix . 'privmsgs_folder' => array(
+ 'COLUMNS' => array(
+ 'folder_id' => array('UINT', NULL, 'auto_increment'),
+ 'user_id' => array('UINT', 0),
+ 'folder_name' => array('VCHAR_UNI', ''),
+ 'pm_count' => array('UINT', 0),
+ ),
+ 'PRIMARY_KEY' => 'folder_id',
+ 'KEYS' => array(
+ 'user_id' => array('INDEX', 'user_id'),
+ ),
+ ),
+
+ $this->table_prefix . 'privmsgs_rules' => array(
+ 'COLUMNS' => array(
+ 'rule_id' => array('UINT', NULL, 'auto_increment'),
+ 'user_id' => array('UINT', 0),
+ 'rule_check' => array('UINT', 0),
+ 'rule_connection' => array('UINT', 0),
+ 'rule_string' => array('VCHAR_UNI', ''),
+ 'rule_user_id' => array('UINT', 0),
+ 'rule_group_id' => array('UINT', 0),
+ 'rule_action' => array('UINT', 0),
+ 'rule_folder_id' => array('INT:11', 0),
+ ),
+ 'PRIMARY_KEY' => 'rule_id',
+ 'KEYS' => array(
+ 'user_id' => array('INDEX', 'user_id'),
+ ),
+ ),
+
+ $this->table_prefix . 'privmsgs_to' => array(
+ 'COLUMNS' => array(
+ 'msg_id' => array('UINT', 0),
+ 'user_id' => array('UINT', 0),
+ 'author_id' => array('UINT', 0),
+ 'pm_deleted' => array('BOOL', 0),
+ 'pm_new' => array('BOOL', 1),
+ 'pm_unread' => array('BOOL', 1),
+ 'pm_replied' => array('BOOL', 0),
+ 'pm_marked' => array('BOOL', 0),
+ 'pm_forwarded' => array('BOOL', 0),
+ 'folder_id' => array('INT:11', 0),
+ ),
+ 'KEYS' => array(
+ 'msg_id' => array('INDEX', 'msg_id'),
+ 'author_id' => array('INDEX', 'author_id'),
+ 'usr_flder_id' => array('INDEX', array('user_id', 'folder_id')),
+ ),
+ ),
+
+ $this->table_prefix . 'profile_fields' => array(
+ 'COLUMNS' => array(
+ 'field_id' => array('UINT', NULL, 'auto_increment'),
+ 'field_name' => array('VCHAR_UNI', ''),
+ 'field_type' => array('TINT:4', 0),
+ 'field_ident' => array('VCHAR:20', ''),
+ 'field_length' => array('VCHAR:20', ''),
+ 'field_minlen' => array('VCHAR', ''),
+ 'field_maxlen' => array('VCHAR', ''),
+ 'field_novalue' => array('VCHAR_UNI', ''),
+ 'field_default_value' => array('VCHAR_UNI', ''),
+ 'field_validation' => array('VCHAR_UNI:20', ''),
+ 'field_required' => array('BOOL', 0),
+ 'field_show_on_reg' => array('BOOL', 0),
+ 'field_hide' => array('BOOL', 0),
+ 'field_no_view' => array('BOOL', 0),
+ 'field_active' => array('BOOL', 0),
+ 'field_order' => array('UINT', 0),
+ ),
+ 'PRIMARY_KEY' => 'field_id',
+ 'KEYS' => array(
+ 'fld_type' => array('INDEX', 'field_type'),
+ 'fld_ordr' => array('INDEX', 'field_order'),
+ ),
+ ),
+
+ $this->table_prefix . 'profile_fields_data' => array(
+ 'COLUMNS' => array(
+ 'user_id' => array('UINT', 0),
+ ),
+ 'PRIMARY_KEY' => 'user_id',
+ ),
+
+ $this->table_prefix . 'profile_fields_lang' => array(
+ 'COLUMNS' => array(
+ 'field_id' => array('UINT', 0),
+ 'lang_id' => array('UINT', 0),
+ 'option_id' => array('UINT', 0),
+ 'field_type' => array('TINT:4', 0),
+ 'lang_value' => array('VCHAR_UNI', ''),
+ ),
+ 'PRIMARY_KEY' => array('field_id', 'lang_id', 'option_id'),
+ ),
+
+ $this->table_prefix . 'profile_lang' => array(
+ 'COLUMNS' => array(
+ 'field_id' => array('UINT', 0),
+ 'lang_id' => array('UINT', 0),
+ 'lang_name' => array('VCHAR_UNI', ''),
+ 'lang_explain' => array('TEXT_UNI', ''),
+ 'lang_default_value' => array('VCHAR_UNI', ''),
+ ),
+ 'PRIMARY_KEY' => array('field_id', 'lang_id'),
+ ),
+
+ $this->table_prefix . 'ranks' => array(
+ 'COLUMNS' => array(
+ 'rank_id' => array('UINT', NULL, 'auto_increment'),
+ 'rank_title' => array('VCHAR_UNI', ''),
+ 'rank_min' => array('UINT', 0),
+ 'rank_special' => array('BOOL', 0),
+ 'rank_image' => array('VCHAR', ''),
+ ),
+ 'PRIMARY_KEY' => 'rank_id',
+ ),
+
+ $this->table_prefix . 'reports' => array(
+ 'COLUMNS' => array(
+ 'report_id' => array('UINT', NULL, 'auto_increment'),
+ 'reason_id' => array('USINT', 0),
+ 'post_id' => array('UINT', 0),
+ 'user_id' => array('UINT', 0),
+ 'user_notify' => array('BOOL', 0),
+ 'report_closed' => array('BOOL', 0),
+ 'report_time' => array('TIMESTAMP', 0),
+ 'report_text' => array('MTEXT_UNI', ''),
+ ),
+ 'PRIMARY_KEY' => 'report_id',
+ ),
+
+ $this->table_prefix . 'reports_reasons' => array(
+ 'COLUMNS' => array(
+ 'reason_id' => array('USINT', NULL, 'auto_increment'),
+ 'reason_title' => array('VCHAR_UNI', ''),
+ 'reason_description' => array('MTEXT_UNI', ''),
+ 'reason_order' => array('USINT', 0),
+ ),
+ 'PRIMARY_KEY' => 'reason_id',
+ ),
+
+ $this->table_prefix . 'search_results' => array(
+ 'COLUMNS' => array(
+ 'search_key' => array('VCHAR:32', ''),
+ 'search_time' => array('TIMESTAMP', 0),
+ 'search_keywords' => array('MTEXT_UNI', ''),
+ 'search_authors' => array('MTEXT', ''),
+ ),
+ 'PRIMARY_KEY' => 'search_key',
+ ),
+
+ $this->table_prefix . 'search_wordlist' => array(
+ 'COLUMNS' => array(
+ 'word_id' => array('UINT', NULL, 'auto_increment'),
+ 'word_text' => array('VCHAR_UNI', ''),
+ 'word_common' => array('BOOL', 0),
+ 'word_count' => array('UINT', 0),
+ ),
+ 'PRIMARY_KEY' => 'word_id',
+ 'KEYS' => array(
+ 'wrd_txt' => array('UNIQUE', 'word_text'),
+ 'wrd_cnt' => array('INDEX', 'word_count'),
+ ),
+ ),
+
+ $this->table_prefix . 'search_wordmatch' => array(
+ 'COLUMNS' => array(
+ 'post_id' => array('UINT', 0),
+ 'word_id' => array('UINT', 0),
+ 'title_match' => array('BOOL', 0),
+ ),
+ 'KEYS' => array(
+ 'unq_mtch' => array('UNIQUE', array('word_id', 'post_id', 'title_match')),
+ 'word_id' => array('INDEX', 'word_id'),
+ 'post_id' => array('INDEX', 'post_id'),
+ ),
+ ),
+
+ $this->table_prefix . 'sessions' => array(
+ 'COLUMNS' => array(
+ 'session_id' => array('CHAR:32', ''),
+ 'session_user_id' => array('UINT', 0),
+ 'session_last_visit' => array('TIMESTAMP', 0),
+ 'session_start' => array('TIMESTAMP', 0),
+ 'session_time' => array('TIMESTAMP', 0),
+ 'session_ip' => array('VCHAR:40', ''),
+ 'session_browser' => array('VCHAR:150', ''),
+ 'session_forwarded_for' => array('VCHAR:255', ''),
+ 'session_page' => array('VCHAR_UNI', ''),
+ 'session_viewonline' => array('BOOL', 1),
+ 'session_autologin' => array('BOOL', 0),
+ 'session_admin' => array('BOOL', 0),
+ ),
+ 'PRIMARY_KEY' => 'session_id',
+ 'KEYS' => array(
+ 'session_time' => array('INDEX', 'session_time'),
+ 'session_user_id' => array('INDEX', 'session_user_id'),
+ ),
+ ),
+
+ $this->table_prefix . 'sessions_keys' => array(
+ 'COLUMNS' => array(
+ 'key_id' => array('CHAR:32', ''),
+ 'user_id' => array('UINT', 0),
+ 'last_ip' => array('VCHAR:40', ''),
+ 'last_login' => array('TIMESTAMP', 0),
+ ),
+ 'PRIMARY_KEY' => array('key_id', 'user_id'),
+ 'KEYS' => array(
+ 'last_login' => array('INDEX', 'last_login'),
+ ),
+ ),
+
+ $this->table_prefix . 'sitelist' => array(
+ 'COLUMNS' => array(
+ 'site_id' => array('UINT', NULL, 'auto_increment'),
+ 'site_ip' => array('VCHAR:40', ''),
+ 'site_hostname' => array('VCHAR', ''),
+ 'ip_exclude' => array('BOOL', 0),
+ ),
+ 'PRIMARY_KEY' => 'site_id',
+ ),
+
+ $this->table_prefix . 'smilies' => array(
+ 'COLUMNS' => array(
+ 'smiley_id' => array('UINT', NULL, 'auto_increment'),
+// We may want to set 'code' to VCHAR:50 or check if unicode support is possible... at the moment only ASCII characters are allowed.
+ 'code' => array('VCHAR_UNI:50', ''),
+ 'emotion' => array('VCHAR_UNI:50', ''),
+ 'smiley_url' => array('VCHAR:50', ''),
+ 'smiley_width' => array('USINT', 0),
+ 'smiley_height' => array('USINT', 0),
+ 'smiley_order' => array('UINT', 0),
+ 'display_on_posting'=> array('BOOL', 1),
+ ),
+ 'PRIMARY_KEY' => 'smiley_id',
+ 'KEYS' => array(
+ 'display_on_post' => array('INDEX', 'display_on_posting'),
+ ),
+ ),
+
+ $this->table_prefix . 'styles' => array(
+ 'COLUMNS' => array(
+ 'style_id' => array('USINT', NULL, 'auto_increment'),
+ 'style_name' => array('VCHAR_UNI:255', ''),
+ 'style_copyright' => array('VCHAR_UNI', ''),
+ 'style_active' => array('BOOL', 1),
+ 'template_id' => array('USINT', 0),
+ 'theme_id' => array('USINT', 0),
+ 'imageset_id' => array('USINT', 0),
+ ),
+ 'PRIMARY_KEY' => 'style_id',
+ 'KEYS' => array(
+ 'style_name' => array('UNIQUE', 'style_name'),
+ 'template_id' => array('INDEX', 'template_id'),
+ 'theme_id' => array('INDEX', 'theme_id'),
+ 'imageset_id' => array('INDEX', 'imageset_id'),
+ ),
+ ),
+
+ $this->table_prefix . 'styles_template' => array(
+ 'COLUMNS' => array(
+ 'template_id' => array('USINT', NULL, 'auto_increment'),
+ 'template_name' => array('VCHAR_UNI:255', ''),
+ 'template_copyright' => array('VCHAR_UNI', ''),
+ 'template_path' => array('VCHAR:100', ''),
+ 'bbcode_bitfield' => array('VCHAR:255', 'kNg='),
+ 'template_storedb' => array('BOOL', 0),
+ ),
+ 'PRIMARY_KEY' => 'template_id',
+ 'KEYS' => array(
+ 'tmplte_nm' => array('UNIQUE', 'template_name'),
+ ),
+ ),
+
+ $this->table_prefix . 'styles_template_data' => array(
+ 'COLUMNS' => array(
+ 'template_id' => array('USINT', 0),
+ 'template_filename' => array('VCHAR:100', ''),
+ 'template_included' => array('TEXT', ''),
+ 'template_mtime' => array('TIMESTAMP', 0),
+ 'template_data' => array('MTEXT_UNI', ''),
+ ),
+ 'KEYS' => array(
+ 'tid' => array('INDEX', 'template_id'),
+ 'tfn' => array('INDEX', 'template_filename'),
+ ),
+ ),
+
+ $this->table_prefix . 'styles_theme' => array(
+ 'COLUMNS' => array(
+ 'theme_id' => array('USINT', NULL, 'auto_increment'),
+ 'theme_name' => array('VCHAR_UNI:255', ''),
+ 'theme_copyright' => array('VCHAR_UNI', ''),
+ 'theme_path' => array('VCHAR:100', ''),
+ 'theme_storedb' => array('BOOL', 0),
+ 'theme_mtime' => array('TIMESTAMP', 0),
+ 'theme_data' => array('MTEXT_UNI', ''),
+ ),
+ 'PRIMARY_KEY' => 'theme_id',
+ 'KEYS' => array(
+ 'theme_name' => array('UNIQUE', 'theme_name'),
+ ),
+ ),
+
+ $this->table_prefix . 'styles_imageset' => array(
+ 'COLUMNS' => array(
+ 'imageset_id' => array('USINT', NULL, 'auto_increment'),
+ 'imageset_name' => array('VCHAR_UNI:255', ''),
+ 'imageset_copyright' => array('VCHAR_UNI', ''),
+ 'imageset_path' => array('VCHAR:100', ''),
+ ),
+ 'PRIMARY_KEY' => 'imageset_id',
+ 'KEYS' => array(
+ 'imgset_nm' => array('UNIQUE', 'imageset_name'),
+ ),
+ ),
+
+ $this->table_prefix . 'styles_imageset_data' => array(
+ 'COLUMNS' => array(
+ 'image_id' => array('USINT', NULL, 'auto_increment'),
+ 'image_name' => array('VCHAR:200', ''),
+ 'image_filename' => array('VCHAR:200', ''),
+ 'image_lang' => array('VCHAR:30', ''),
+ 'image_height' => array('USINT', 0),
+ 'image_width' => array('USINT', 0),
+ 'imageset_id' => array('USINT', 0),
+ ),
+ 'PRIMARY_KEY' => 'image_id',
+ 'KEYS' => array(
+ 'i_d' => array('INDEX', 'imageset_id'),
+ ),
+ ),
+
+ $this->table_prefix . 'topics' => array(
+ 'COLUMNS' => array(
+ 'topic_id' => array('UINT', NULL, 'auto_increment'),
+ 'forum_id' => array('UINT', 0),
+ 'icon_id' => array('UINT', 0),
+ 'topic_attachment' => array('BOOL', 0),
+ 'topic_approved' => array('BOOL', 1),
+ 'topic_reported' => array('BOOL', 0),
+ 'topic_title' => array('XSTEXT_UNI', '', 'true_sort'),
+ 'topic_poster' => array('UINT', 0),
+ 'topic_time' => array('TIMESTAMP', 0),
+ 'topic_time_limit' => array('TIMESTAMP', 0),
+ 'topic_views' => array('UINT', 0),
+ 'topic_replies' => array('UINT', 0),
+ 'topic_replies_real' => array('UINT', 0),
+ 'topic_status' => array('TINT:3', 0),
+ 'topic_type' => array('TINT:3', 0),
+ 'topic_first_post_id' => array('UINT', 0),
+ 'topic_first_poster_name' => array('VCHAR_UNI', ''),
+ 'topic_first_poster_colour' => array('VCHAR:6', ''),
+ 'topic_last_post_id' => array('UINT', 0),
+ 'topic_last_poster_id' => array('UINT', 0),
+ 'topic_last_poster_name' => array('VCHAR_UNI', ''),
+ 'topic_last_poster_colour' => array('VCHAR:6', ''),
+ 'topic_last_post_subject' => array('XSTEXT_UNI', ''),
+ 'topic_last_post_time' => array('TIMESTAMP', 0),
+ 'topic_last_view_time' => array('TIMESTAMP', 0),
+ 'topic_moved_id' => array('UINT', 0),
+ 'topic_bumped' => array('BOOL', 0),
+ 'topic_bumper' => array('UINT', 0),
+ 'poll_title' => array('STEXT_UNI', ''),
+ 'poll_start' => array('TIMESTAMP', 0),
+ 'poll_length' => array('TIMESTAMP', 0),
+ 'poll_max_options' => array('TINT:4', 1),
+ 'poll_last_vote' => array('TIMESTAMP', 0),
+ 'poll_vote_change' => array('BOOL', 0),
+ ),
+ 'PRIMARY_KEY' => 'topic_id',
+ 'KEYS' => array(
+ 'forum_id' => array('INDEX', 'forum_id'),
+ 'forum_id_type' => array('INDEX', array('forum_id', 'topic_type')),
+ 'last_post_time' => array('INDEX', 'topic_last_post_time'),
+ 'topic_approved' => array('INDEX', 'topic_approved'),
+ 'forum_appr_last' => array('INDEX', array('forum_id', 'topic_approved', 'topic_last_post_id')),
+ 'fid_time_moved' => array('INDEX', array('forum_id', 'topic_last_post_time', 'topic_moved_id')),
+ ),
+ ),
+
+ $this->table_prefix . 'topics_track' => array(
+ 'COLUMNS' => array(
+ 'user_id' => array('UINT', 0),
+ 'topic_id' => array('UINT', 0),
+ 'forum_id' => array('UINT', 0),
+ 'mark_time' => array('TIMESTAMP', 0),
+ ),
+ 'PRIMARY_KEY' => array('user_id', 'topic_id'),
+ 'KEYS' => array(
+ 'forum_id' => array('INDEX', 'forum_id'),
+ ),
+ ),
+
+ $this->table_prefix . 'topics_posted' => array(
+ 'COLUMNS' => array(
+ 'user_id' => array('UINT', 0),
+ 'topic_id' => array('UINT', 0),
+ 'topic_posted' => array('BOOL', 0),
+ ),
+ 'PRIMARY_KEY' => array('user_id', 'topic_id'),
+ ),
+
+ $this->table_prefix . 'topics_watch' => array(
+ 'COLUMNS' => array(
+ 'topic_id' => array('UINT', 0),
+ 'user_id' => array('UINT', 0),
+ 'notify_status' => array('BOOL', 0),
+ ),
+ 'KEYS' => array(
+ 'topic_id' => array('INDEX', 'topic_id'),
+ 'user_id' => array('INDEX', 'user_id'),
+ 'notify_stat' => array('INDEX', 'notify_status'),
+ ),
+ ),
+
+ $this->table_prefix . 'user_group' => array(
+ 'COLUMNS' => array(
+ 'group_id' => array('UINT', 0),
+ 'user_id' => array('UINT', 0),
+ 'group_leader' => array('BOOL', 0),
+ 'user_pending' => array('BOOL', 1),
+ ),
+ 'KEYS' => array(
+ 'group_id' => array('INDEX', 'group_id'),
+ 'user_id' => array('INDEX', 'user_id'),
+ 'group_leader' => array('INDEX', 'group_leader'),
+ ),
+ ),
+
+ $this->table_prefix . 'users' => array(
+ 'COLUMNS' => array(
+ 'user_id' => array('UINT', NULL, 'auto_increment'),
+ 'user_type' => array('TINT:2', 0),
+ 'group_id' => array('UINT', 3),
+ 'user_permissions' => array('MTEXT', ''),
+ 'user_perm_from' => array('UINT', 0),
+ 'user_ip' => array('VCHAR:40', ''),
+ 'user_regdate' => array('TIMESTAMP', 0),
+ 'username' => array('VCHAR_CI', ''),
+ 'username_clean' => array('VCHAR_CI', ''),
+ 'user_password' => array('VCHAR_UNI:40', ''),
+ 'user_passchg' => array('TIMESTAMP', 0),
+ 'user_pass_convert' => array('BOOL', 0),
+ 'user_email' => array('VCHAR_UNI:100', ''),
+ 'user_email_hash' => array('BINT', 0),
+ 'user_birthday' => array('VCHAR:10', ''),
+ 'user_lastvisit' => array('TIMESTAMP', 0),
+ 'user_lastmark' => array('TIMESTAMP', 0),
+ 'user_lastpost_time' => array('TIMESTAMP', 0),
+ 'user_lastpage' => array('VCHAR_UNI:200', ''),
+ 'user_last_confirm_key' => array('VCHAR:10', ''),
+ 'user_last_search' => array('TIMESTAMP', 0),
+ 'user_warnings' => array('TINT:4', 0),
+ 'user_last_warning' => array('TIMESTAMP', 0),
+ 'user_login_attempts' => array('TINT:4', 0),
+ 'user_inactive_reason' => array('TINT:2', 0),
+ 'user_inactive_time' => array('TIMESTAMP', 0),
+ 'user_posts' => array('UINT', 0),
+ 'user_lang' => array('VCHAR:30', ''),
+ 'user_timezone' => array('DECIMAL', 0),
+ 'user_dst' => array('BOOL', 0),
+ 'user_dateformat' => array('VCHAR_UNI:30', 'd M Y H:i'),
+ 'user_style' => array('USINT', 0),
+ 'user_rank' => array('UINT', 0),
+ 'user_colour' => array('VCHAR:6', ''),
+ 'user_new_privmsg' => array('INT:4', 0),
+ 'user_unread_privmsg' => array('INT:4', 0),
+ 'user_last_privmsg' => array('TIMESTAMP', 0),
+ 'user_message_rules' => array('BOOL', 0),
+ 'user_full_folder' => array('INT:11', -3),
+ 'user_emailtime' => array('TIMESTAMP', 0),
+ 'user_topic_show_days' => array('USINT', 0),
+ 'user_topic_sortby_type' => array('VCHAR:1', 't'),
+ 'user_topic_sortby_dir' => array('VCHAR:1', 'd'),
+ 'user_post_show_days' => array('USINT', 0),
+ 'user_post_sortby_type' => array('VCHAR:1', 't'),
+ 'user_post_sortby_dir' => array('VCHAR:1', 'a'),
+ 'user_notify' => array('BOOL', 0),
+ 'user_notify_pm' => array('BOOL', 1),
+ 'user_notify_type' => array('TINT:4', 0),
+ 'user_allow_pm' => array('BOOL', 1),
+ 'user_allow_viewonline' => array('BOOL', 1),
+ 'user_allow_viewemail' => array('BOOL', 1),
+ 'user_allow_massemail' => array('BOOL', 1),
+ 'user_options' => array('UINT:11', 895),
+ 'user_avatar' => array('VCHAR', ''),
+ 'user_avatar_type' => array('TINT:2', 0),
+ 'user_avatar_width' => array('USINT', 0),
+ 'user_avatar_height' => array('USINT', 0),
+ 'user_sig' => array('MTEXT_UNI', ''),
+ 'user_sig_bbcode_uid' => array('VCHAR:8', ''),
+ 'user_sig_bbcode_bitfield' => array('VCHAR:255', ''),
+ 'user_from' => array('VCHAR_UNI:100', ''),
+ 'user_icq' => array('VCHAR:15', ''),
+ 'user_aim' => array('VCHAR_UNI', ''),
+ 'user_yim' => array('VCHAR_UNI', ''),
+ 'user_msnm' => array('VCHAR_UNI', ''),
+ 'user_jabber' => array('VCHAR_UNI', ''),
+ 'user_website' => array('VCHAR_UNI:200', ''),
+ 'user_occ' => array('TEXT_UNI', ''),
+ 'user_interests' => array('TEXT_UNI', ''),
+ 'user_actkey' => array('VCHAR:32', ''),
+ 'user_newpasswd' => array('VCHAR_UNI:40', ''),
+ 'user_form_salt' => array('VCHAR_UNI:32', ''),
+
+ ),
+ 'PRIMARY_KEY' => 'user_id',
+ 'KEYS' => array(
+ 'user_birthday' => array('INDEX', 'user_birthday'),
+ 'user_email_hash' => array('INDEX', 'user_email_hash'),
+ 'user_type' => array('INDEX', 'user_type'),
+ 'username_clean' => array('UNIQUE', 'username_clean'),
+ ),
+ ),
+
+ $this->table_prefix . 'warnings' => array(
+ 'COLUMNS' => array(
+ 'warning_id' => array('UINT', NULL, 'auto_increment'),
+ 'user_id' => array('UINT', 0),
+ 'post_id' => array('UINT', 0),
+ 'log_id' => array('UINT', 0),
+ 'warning_time' => array('TIMESTAMP', 0),
+ ),
+ 'PRIMARY_KEY' => 'warning_id',
+ ),
+
+ $this->table_prefix . 'words' => array(
+ 'COLUMNS' => array(
+ 'word_id' => array('UINT', NULL, 'auto_increment'),
+ 'word' => array('VCHAR_UNI', ''),
+ 'replacement' => array('VCHAR_UNI', ''),
+ ),
+ 'PRIMARY_KEY' => 'word_id',
+ ),
+
+ $this->table_prefix . 'zebra' => array(
+ 'COLUMNS' => array(
+ 'user_id' => array('UINT', 0),
+ 'zebra_id' => array('UINT', 0),
+ 'friend' => array('BOOL', 0),
+ 'foe' => array('BOOL', 0),
+ ),
+ 'PRIMARY_KEY' => array('user_id', 'zebra_id'),
+ ),
+ ),
+ );
+ }
+
+ public function revert_schema()
+ {
+ return array(
+ 'drop_tables' => array(
+ $this->table_prefix . 'attachments',
+ $this->table_prefix . 'acl_groups',
+ $this->table_prefix . 'acl_options',
+ $this->table_prefix . 'acl_roles',
+ $this->table_prefix . 'acl_roles_data',
+ $this->table_prefix . 'acl_users',
+ $this->table_prefix . 'banlist',
+ $this->table_prefix . 'bbcodes',
+ $this->table_prefix . 'bookmarks',
+ $this->table_prefix . 'bots',
+ $this->table_prefix . 'config',
+ $this->table_prefix . 'confirm',
+ $this->table_prefix . 'disallow',
+ $this->table_prefix . 'drafts',
+ $this->table_prefix . 'extensions',
+ $this->table_prefix . 'extension_groups',
+ $this->table_prefix . 'forums',
+ $this->table_prefix . 'forums_access',
+ $this->table_prefix . 'forums_track',
+ $this->table_prefix . 'forums_watch',
+ $this->table_prefix . 'groups',
+ $this->table_prefix . 'icons',
+ $this->table_prefix . 'lang',
+ $this->table_prefix . 'log',
+ $this->table_prefix . 'moderator_cache',
+ $this->table_prefix . 'modules',
+ $this->table_prefix . 'poll_options',
+ $this->table_prefix . 'poll_votes',
+ $this->table_prefix . 'posts',
+ $this->table_prefix . 'privmsgs',
+ $this->table_prefix . 'privmsgs_folder',
+ $this->table_prefix . 'privmsgs_rules',
+ $this->table_prefix . 'privmsgs_to',
+ $this->table_prefix . 'profile_fields',
+ $this->table_prefix . 'profile_fields_data',
+ $this->table_prefix . 'profile_fields_lang',
+ $this->table_prefix . 'profile_lang',
+ $this->table_prefix . 'ranks',
+ $this->table_prefix . 'reports',
+ $this->table_prefix . 'reports_reasons',
+ $this->table_prefix . 'search_results',
+ $this->table_prefix . 'search_wordlist',
+ $this->table_prefix . 'search_wordmatch',
+ $this->table_prefix . 'sessions',
+ $this->table_prefix . 'sessions_keys',
+ $this->table_prefix . 'sitelist',
+ $this->table_prefix . 'smilies',
+ $this->table_prefix . 'styles',
+ $this->table_prefix . 'styles_template',
+ $this->table_prefix . 'styles_template_data',
+ $this->table_prefix . 'styles_theme',
+ $this->table_prefix . 'styles_imageset',
+ $this->table_prefix . 'styles_imageset_data',
+ $this->table_prefix . 'topics',
+ $this->table_prefix . 'topics_track',
+ $this->table_prefix . 'topics_posted',
+ $this->table_prefix . 'topics_watch',
+ $this->table_prefix . 'user_group',
+ $this->table_prefix . 'users',
+ $this->table_prefix . 'warnings',
+ $this->table_prefix . 'words',
+ $this->table_prefix . 'zebra',
+ ),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_1.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_1.php
new file mode 100644
index 0000000000..f5c7e56a81
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_1.php
@@ -0,0 +1,34 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v30x;
+
+class release_3_0_1 extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.0.1', '>=');
+ }
+
+ static public function depends_on()
+ {
+ return array('\phpbb\db\migration\data\v30x\release_3_0_1_rc1');
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('config.update', array('version', '3.0.1')),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_10.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_10.php
new file mode 100644
index 0000000000..0d3a1ca80b
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_10.php
@@ -0,0 +1,34 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v30x;
+
+class release_3_0_10 extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.0.10', '>=');
+ }
+
+ static public function depends_on()
+ {
+ return array('\phpbb\db\migration\data\v30x\release_3_0_10_rc3');
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('config.update', array('version', '3.0.10')),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_10_rc1.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_10_rc1.php
new file mode 100644
index 0000000000..293c46cb06
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_10_rc1.php
@@ -0,0 +1,36 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v30x;
+
+class release_3_0_10_rc1 extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.0.10-RC1', '>=');
+ }
+
+ static public function depends_on()
+ {
+ return array('\phpbb\db\migration\data\v30x\release_3_0_9');
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('config.add', array('email_max_chunk_size', 50)),
+
+ array('config.update', array('version', '3.0.10-RC1')),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_10_rc2.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_10_rc2.php
new file mode 100644
index 0000000000..f2889120e6
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_10_rc2.php
@@ -0,0 +1,34 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v30x;
+
+class release_3_0_10_rc2 extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.0.10-RC2', '>=');
+ }
+
+ static public function depends_on()
+ {
+ return array('\phpbb\db\migration\data\v30x\release_3_0_10_rc1');
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('config.update', array('version', '3.0.10-RC2')),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_10_rc3.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_10_rc3.php
new file mode 100644
index 0000000000..9d6697ab7f
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_10_rc3.php
@@ -0,0 +1,34 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v30x;
+
+class release_3_0_10_rc3 extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.0.10-RC3', '>=');
+ }
+
+ static public function depends_on()
+ {
+ return array('\phpbb\db\migration\data\v30x\release_3_0_10_rc2');
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('config.update', array('version', '3.0.10-RC3')),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_11.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_11.php
new file mode 100644
index 0000000000..e77b54a1b5
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_11.php
@@ -0,0 +1,34 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v30x;
+
+class release_3_0_11 extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.0.11', '>=');
+ }
+
+ static public function depends_on()
+ {
+ return array('\phpbb\db\migration\data\v30x\release_3_0_11_rc2');
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('config.update', array('version', '3.0.11')),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_11_rc1.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_11_rc1.php
new file mode 100644
index 0000000000..ed2dabf51c
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_11_rc1.php
@@ -0,0 +1,101 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v30x;
+
+class release_3_0_11_rc1 extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.0.11-RC1', '>=');
+ }
+
+ static public function depends_on()
+ {
+ return array('\phpbb\db\migration\data\v30x\release_3_0_10');
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('custom', array(array(&$this, 'cleanup_deactivated_styles'))),
+ array('custom', array(array(&$this, 'delete_orphan_private_messages'))),
+
+ array('config.update', array('version', '3.0.11-RC1')),
+ );
+ }
+
+ public function cleanup_deactivated_styles()
+ {
+ // Updates users having current style a deactivated one
+ $sql = 'SELECT style_id
+ FROM ' . STYLES_TABLE . '
+ WHERE style_active = 0';
+ $result = $this->sql_query($sql);
+
+ $deactivated_style_ids = array();
+ while ($style_id = $this->db->sql_fetchfield('style_id', false, $result))
+ {
+ $deactivated_style_ids[] = (int) $style_id;
+ }
+ $this->db->sql_freeresult($result);
+
+ if (!empty($deactivated_style_ids))
+ {
+ $sql = 'UPDATE ' . USERS_TABLE . '
+ SET user_style = ' . (int) $this->config['default_style'] .'
+ WHERE ' . $this->db->sql_in_set('user_style', $deactivated_style_ids);
+ $this->sql_query($sql);
+ }
+ }
+
+ public function delete_orphan_private_messages()
+ {
+ // Delete orphan private messages
+ $batch_size = 500;
+
+ $sql_array = array(
+ 'SELECT' => 'p.msg_id',
+ 'FROM' => array(
+ PRIVMSGS_TABLE => 'p',
+ ),
+ 'LEFT_JOIN' => array(
+ array(
+ 'FROM' => array(PRIVMSGS_TO_TABLE => 't'),
+ 'ON' => 'p.msg_id = t.msg_id',
+ ),
+ ),
+ 'WHERE' => 't.user_id IS NULL',
+ );
+ $sql = $this->db->sql_build_query('SELECT', $sql_array);
+
+ $result = $this->db->sql_query_limit($sql, $batch_size);
+
+ $delete_pms = array();
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $delete_pms[] = (int) $row['msg_id'];
+ }
+ $this->db->sql_freeresult($result);
+
+ if (!empty($delete_pms))
+ {
+ $sql = 'DELETE FROM ' . PRIVMSGS_TABLE . '
+ WHERE ' . $this->db->sql_in_set('msg_id', $delete_pms);
+ $this->sql_query($sql);
+
+ // Return false to have the Migrator call this function again
+ return false;
+ }
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_11_rc2.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_11_rc2.php
new file mode 100644
index 0000000000..45d88708bd
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_11_rc2.php
@@ -0,0 +1,56 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v30x;
+
+class release_3_0_11_rc2 extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.0.11-RC2', '>=');
+ }
+
+ static public function depends_on()
+ {
+ return array('\phpbb\db\migration\data\v30x\release_3_0_11_rc1');
+ }
+
+ public function update_schema()
+ {
+ return array(
+ 'add_columns' => array(
+ $this->table_prefix . 'profile_fields' => array(
+ 'field_show_novalue' => array('BOOL', 0),
+ ),
+ ),
+ );
+ }
+
+ public function revert_schema()
+ {
+ return array(
+ 'drop_columns' => array(
+ $this->table_prefix . 'profile_fields' => array(
+ 'field_show_novalue',
+ ),
+ ),
+ );
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('config.update', array('version', '3.0.11-RC2')),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_12.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_12.php
new file mode 100644
index 0000000000..c489c0c0e8
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_12.php
@@ -0,0 +1,37 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v30x;
+
+class release_3_0_12 extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.0.12', '>=') && phpbb_version_compare($this->config['version'], '3.1.0-dev', '<');
+ }
+
+ static public function depends_on()
+ {
+ return array('\phpbb\db\migration\data\v30x\release_3_0_12_rc3');
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('if', array(
+ phpbb_version_compare($this->config['version'], '3.0.12', '<'),
+ array('config.update', array('version', '3.0.12')),
+ )),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_12_rc1.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_12_rc1.php
new file mode 100644
index 0000000000..f9f6d9f7f7
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_12_rc1.php
@@ -0,0 +1,72 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v30x;
+
+/** @todo DROP LOGIN_ATTEMPT_TABLE.attempt_id in 3.0.12-RC1 **/
+
+class release_3_0_12_rc1 extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.0.12-RC1', '>=');
+ }
+
+ static public function depends_on()
+ {
+ return array('\phpbb\db\migration\data\v30x\release_3_0_11');
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('custom', array(array(&$this, 'update_module_auth'))),
+ array('custom', array(array(&$this, 'disable_bots_from_receiving_pms'))),
+
+ array('config.update', array('version', '3.0.12-RC1')),
+ );
+ }
+
+ public function disable_bots_from_receiving_pms()
+ {
+ // Disable receiving pms for bots
+ $sql = 'SELECT user_id
+ FROM ' . BOTS_TABLE;
+ $result = $this->db->sql_query($sql);
+
+ $bot_user_ids = array();
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $bot_user_ids[] = (int) $row['user_id'];
+ }
+ $this->db->sql_freeresult($result);
+
+ if (!empty($bot_user_ids))
+ {
+ $sql = 'UPDATE ' . USERS_TABLE . '
+ SET user_allow_pm = 0
+ WHERE ' . $this->db->sql_in_set('user_id', $bot_user_ids);
+ $this->sql_query($sql);
+ }
+ }
+
+ public function update_module_auth()
+ {
+ $sql = 'UPDATE ' . MODULES_TABLE . '
+ SET module_auth = \'acl_u_sig\'
+ WHERE module_class = \'ucp\'
+ AND module_basename = \'profile\'
+ AND module_mode = \'signature\'';
+ $this->sql_query($sql);
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_12_rc2.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_12_rc2.php
new file mode 100644
index 0000000000..8fac273073
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_12_rc2.php
@@ -0,0 +1,37 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v30x;
+
+class release_3_0_12_rc2 extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.0.12-RC2', '>=') && phpbb_version_compare($this->config['version'], '3.1.0-dev', '<');
+ }
+
+ static public function depends_on()
+ {
+ return array('\phpbb\db\migration\data\v30x\release_3_0_12_rc1');
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('if', array(
+ phpbb_version_compare($this->config['version'], '3.0.12-RC2', '<'),
+ array('config.update', array('version', '3.0.12-RC2')),
+ )),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_12_rc3.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_12_rc3.php
new file mode 100644
index 0000000000..fb1b8014a4
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_12_rc3.php
@@ -0,0 +1,37 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v30x;
+
+class release_3_0_12_rc3 extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.0.12-RC3', '>=') && phpbb_version_compare($this->config['version'], '3.1.0-dev', '<');
+ }
+
+ static public function depends_on()
+ {
+ return array('\phpbb\db\migration\data\v30x\release_3_0_12_rc2');
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('if', array(
+ phpbb_version_compare($this->config['version'], '3.0.12-RC3', '<'),
+ array('config.update', array('version', '3.0.12-RC3')),
+ )),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_13.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_13.php
new file mode 100644
index 0000000000..310fcc70fc
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_13.php
@@ -0,0 +1,37 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v30x;
+
+class release_3_0_13 extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.0.13', '>=') && phpbb_version_compare($this->config['version'], '3.1.0-dev', '<');
+ }
+
+ static public function depends_on()
+ {
+ return array('\phpbb\db\migration\data\v30x\release_3_0_13_rc1');
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('if', array(
+ phpbb_version_compare($this->config['version'], '3.0.13', '<'),
+ array('config.update', array('version', '3.0.13')),
+ )),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_13_pl1.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_13_pl1.php
new file mode 100644
index 0000000000..b12a96a7fb
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_13_pl1.php
@@ -0,0 +1,37 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v30x;
+
+class release_3_0_13_pl1 extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.0.13-PL1', '>=') && phpbb_version_compare($this->config['version'], '3.1.0-dev', '<');
+ }
+
+ static public function depends_on()
+ {
+ return array('\phpbb\db\migration\data\v30x\release_3_0_13');
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('if', array(
+ phpbb_version_compare($this->config['version'], '3.0.13-PL1', '<'),
+ array('config.update', array('version', '3.0.13-PL1')),
+ )),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_13_rc1.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_13_rc1.php
new file mode 100644
index 0000000000..9ea68fa862
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_13_rc1.php
@@ -0,0 +1,37 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v30x;
+
+class release_3_0_13_rc1 extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.0.13-RC1', '>=') && phpbb_version_compare($this->config['version'], '3.1.0-dev', '<');
+ }
+
+ static public function depends_on()
+ {
+ return array('\phpbb\db\migration\data\v30x\release_3_0_12');
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('if', array(
+ phpbb_version_compare($this->config['version'], '3.0.13-RC1', '<'),
+ array('config.update', array('version', '3.0.13-RC1')),
+ )),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_14.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_14.php
new file mode 100644
index 0000000000..51475f5a05
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_14.php
@@ -0,0 +1,37 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v30x;
+
+class release_3_0_14 extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.0.14', '>=') && phpbb_version_compare($this->config['version'], '3.1.0-dev', '<');
+ }
+
+ static public function depends_on()
+ {
+ return array('\phpbb\db\migration\data\v30x\release_3_0_14_rc1');
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('if', array(
+ phpbb_version_compare($this->config['version'], '3.0.14', '<'),
+ array('config.update', array('version', '3.0.14')),
+ )),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_14_rc1.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_14_rc1.php
new file mode 100644
index 0000000000..421ef06dd3
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_14_rc1.php
@@ -0,0 +1,37 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v30x;
+
+class release_3_0_14_rc1 extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.0.14-RC1', '>=') && phpbb_version_compare($this->config['version'], '3.1.0-dev', '<');
+ }
+
+ static public function depends_on()
+ {
+ return array('\phpbb\db\migration\data\v30x\release_3_0_13');
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('if', array(
+ phpbb_version_compare($this->config['version'], '3.0.14-RC1', '<'),
+ array('config.update', array('version', '3.0.14-RC1')),
+ )),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_1_rc1.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_1_rc1.php
new file mode 100644
index 0000000000..d1ae0b9cbc
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_1_rc1.php
@@ -0,0 +1,119 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v30x;
+
+class release_3_0_1_rc1 extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.0.1-RC1', '>=');
+ }
+
+ static public function depends_on()
+ {
+ return array('\phpbb\db\migration\data\v30x\release_3_0_0');
+ }
+
+ public function update_schema()
+ {
+ return array(
+ 'add_columns' => array(
+ $this->table_prefix . 'forums' => array(
+ 'display_subforum_list' => array('BOOL', 1),
+ ),
+ $this->table_prefix . 'sessions' => array(
+ 'session_forum_id' => array('UINT', 0),
+ ),
+ ),
+ 'drop_keys' => array(
+ $this->table_prefix . 'groups' => array(
+ 'group_legend',
+ ),
+ ),
+ 'add_index' => array(
+ $this->table_prefix . 'sessions' => array(
+ 'session_forum_id' => array('session_forum_id'),
+ ),
+ $this->table_prefix . 'groups' => array(
+ 'group_legend_name' => array('group_legend', 'group_name'),
+ ),
+ ),
+ );
+ }
+
+ public function revert_schema()
+ {
+ return array(
+ 'drop_columns' => array(
+ $this->table_prefix . 'forums' => array(
+ 'display_subforum_list',
+ ),
+ $this->table_prefix . 'sessions' => array(
+ 'session_forum_id',
+ ),
+ ),
+ 'add_index' => array(
+ $this->table_prefix . 'groups' => array(
+ 'group_legend' => array('group_legend'),
+ ),
+ ),
+ 'drop_keys' => array(
+ $this->table_prefix . 'sessions' => array(
+ 'session_forum_id',
+ ),
+ $this->table_prefix . 'groups' => array(
+ 'group_legend_name',
+ ),
+ ),
+ );
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('custom', array(array(&$this, 'fix_unset_last_view_time'))),
+ array('custom', array(array(&$this, 'reset_smiley_size'))),
+
+ array('config.update', array('version', '3.0.1-RC1')),
+ );
+ }
+
+ public function fix_unset_last_view_time()
+ {
+ $sql = 'UPDATE ' . $this->table_prefix . "topics
+ SET topic_last_view_time = topic_last_post_time
+ WHERE topic_last_view_time = 0";
+ $this->sql_query($sql);
+ }
+
+ public function reset_smiley_size()
+ {
+ // Update smiley sizes
+ $smileys = array('icon_e_surprised.gif', 'icon_eek.gif', 'icon_cool.gif', 'icon_lol.gif', 'icon_mad.gif', 'icon_razz.gif', 'icon_redface.gif', 'icon_cry.gif', 'icon_evil.gif', 'icon_twisted.gif', 'icon_rolleyes.gif', 'icon_exclaim.gif', 'icon_question.gif', 'icon_idea.gif', 'icon_arrow.gif', 'icon_neutral.gif', 'icon_mrgreen.gif', 'icon_e_ugeek.gif');
+
+ foreach ($smileys as $smiley)
+ {
+ if (file_exists($this->phpbb_root_path . 'images/smilies/' . $smiley))
+ {
+ list($width, $height) = getimagesize($this->phpbb_root_path . 'images/smilies/' . $smiley);
+
+ $sql = 'UPDATE ' . SMILIES_TABLE . '
+ SET smiley_width = ' . $width . ', smiley_height = ' . $height . "
+ WHERE smiley_url = '" . $this->db->sql_escape($smiley) . "'";
+
+ $this->sql_query($sql);
+ }
+ }
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_2.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_2.php
new file mode 100644
index 0000000000..c08f01dbeb
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_2.php
@@ -0,0 +1,34 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v30x;
+
+class release_3_0_2 extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.0.2', '>=');
+ }
+
+ static public function depends_on()
+ {
+ return array('\phpbb\db\migration\data\v30x\release_3_0_2_rc2');
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('config.update', array('version', '3.0.2')),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_2_rc1.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_2_rc1.php
new file mode 100644
index 0000000000..2e7f141a9b
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_2_rc1.php
@@ -0,0 +1,38 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v30x;
+
+class release_3_0_2_rc1 extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.0.2-RC1', '>=');
+ }
+
+ static public function depends_on()
+ {
+ return array('\phpbb\db\migration\data\v30x\release_3_0_1');
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('config.add', array('referer_validation', '1')),
+ array('config.add', array('check_attachment_content', '1')),
+ array('config.add', array('mime_triggers', 'body|head|html|img|plaintext|a href|pre|script|table|title')),
+
+ array('config.update', array('version', '3.0.2-RC1')),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_2_rc2.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_2_rc2.php
new file mode 100644
index 0000000000..bde5febc59
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_2_rc2.php
@@ -0,0 +1,86 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v30x;
+
+class release_3_0_2_rc2 extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.0.2-RC2', '>=');
+ }
+
+ static public function depends_on()
+ {
+ return array('\phpbb\db\migration\data\v30x\release_3_0_2_rc1');
+ }
+
+ public function update_schema()
+ {
+ return array(
+ 'change_columns' => array(
+ $this->table_prefix . 'drafts' => array(
+ 'draft_subject' => array('STEXT_UNI', ''),
+ ),
+ $this->table_prefix . 'forums' => array(
+ 'forum_last_post_subject' => array('STEXT_UNI', ''),
+ ),
+ $this->table_prefix . 'posts' => array(
+ 'post_subject' => array('STEXT_UNI', '', 'true_sort'),
+ ),
+ $this->table_prefix . 'privmsgs' => array(
+ 'message_subject' => array('STEXT_UNI', ''),
+ ),
+ $this->table_prefix . 'topics' => array(
+ 'topic_title' => array('STEXT_UNI', '', 'true_sort'),
+ 'topic_last_post_subject' => array('STEXT_UNI', ''),
+ ),
+ ),
+ 'drop_keys' => array(
+ $this->table_prefix . 'sessions' => array(
+ 'session_forum_id',
+ ),
+ ),
+ 'add_index' => array(
+ $this->table_prefix . 'sessions' => array(
+ 'session_fid' => array('session_forum_id'),
+ ),
+ ),
+ );
+ }
+
+ public function revert_schema()
+ {
+ return array(
+ 'add_index' => array(
+ $this->table_prefix . 'sessions' => array(
+ 'session_forum_id' => array(
+ 'session_forum_id',
+ ),
+ ),
+ ),
+ 'drop_keys' => array(
+ $this->table_prefix . 'sessions' => array(
+ 'session_fid',
+ ),
+ ),
+ );
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('config.update', array('version', '3.0.2-RC2')),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_3.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_3.php
new file mode 100644
index 0000000000..c277da224c
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_3.php
@@ -0,0 +1,34 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v30x;
+
+class release_3_0_3 extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.0.3', '>=');
+ }
+
+ static public function depends_on()
+ {
+ return array('\phpbb\db\migration\data\v30x\release_3_0_3_rc1');
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('config.update', array('version', '3.0.3')),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_3_rc1.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_3_rc1.php
new file mode 100644
index 0000000000..530eaf47e6
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_3_rc1.php
@@ -0,0 +1,89 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v30x;
+
+class release_3_0_3_rc1 extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.0.3-RC1', '>=');
+ }
+
+ static public function depends_on()
+ {
+ return array('\phpbb\db\migration\data\v30x\release_3_0_2');
+ }
+
+ public function update_schema()
+ {
+ return array(
+ 'add_columns' => array(
+ $this->table_prefix . 'styles_template' => array(
+ 'template_inherits_id' => array('UINT:4', 0),
+ 'template_inherit_path' => array('VCHAR', ''),
+ ),
+ $this->table_prefix . 'groups' => array(
+ 'group_max_recipients' => array('UINT', 0),
+ ),
+ ),
+ );
+ }
+
+ public function revert_schema()
+ {
+ return array(
+ 'drop_columns' => array(
+ $this->table_prefix . 'styles_template' => array(
+ 'template_inherits_id',
+ 'template_inherit_path',
+ ),
+ $this->table_prefix . 'groups' => array(
+ 'group_max_recipients',
+ ),
+ ),
+ );
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('config.add', array('enable_queue_trigger', '0')),
+ array('config.add', array('queue_trigger_posts', '3')),
+ array('config.add', array('pm_max_recipients', '0')),
+ array('custom', array(array(&$this, 'set_group_default_max_recipients'))),
+ array('config.add', array('dbms_version', $this->db->sql_server_info(true))),
+ array('permission.add', array('u_masspm_group', true, 'u_masspm')),
+ array('custom', array(array(&$this, 'correct_acp_email_permissions'))),
+
+ array('config.update', array('version', '3.0.3-RC1')),
+ );
+ }
+
+ public function correct_acp_email_permissions()
+ {
+ $sql = 'UPDATE ' . $this->table_prefix . 'modules
+ SET module_auth = \'acl_a_email && cfg_email_enable\'
+ WHERE module_class = \'acp\'
+ AND module_basename = \'email\'';
+ $this->sql_query($sql);
+ }
+
+ public function set_group_default_max_recipients()
+ {
+ // Set maximum number of recipients for the registered users, bots, guests group
+ $sql = 'UPDATE ' . GROUPS_TABLE . ' SET group_max_recipients = 5
+ WHERE ' . $this->db->sql_in_set('group_name', array('GUESTS', 'REGISTERED', 'REGISTERED_COPPA', 'BOTS'));
+ $this->sql_query($sql);
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_4.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_4.php
new file mode 100644
index 0000000000..9b08da0125
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_4.php
@@ -0,0 +1,55 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v30x;
+
+class release_3_0_4 extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.0.4', '>=');
+ }
+
+ static public function depends_on()
+ {
+ return array('\phpbb\db\migration\data\v30x\release_3_0_4_rc1');
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('custom', array(array(&$this, 'rename_log_delete_topic'))),
+
+ array('config.update', array('version', '3.0.4')),
+ );
+ }
+
+ public function rename_log_delete_topic()
+ {
+ if ($this->db->get_sql_layer() == 'oracle')
+ {
+ // log_operation is CLOB - but we can change this later
+ $sql = 'UPDATE ' . $this->table_prefix . "log
+ SET log_operation = 'LOG_DELETE_TOPIC'
+ WHERE log_operation LIKE 'LOG_TOPIC_DELETED'";
+ $this->sql_query($sql);
+ }
+ else
+ {
+ $sql = 'UPDATE ' . $this->table_prefix . "log
+ SET log_operation = 'LOG_DELETE_TOPIC'
+ WHERE log_operation = 'LOG_TOPIC_DELETED'";
+ $this->sql_query($sql);
+ }
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_4_rc1.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_4_rc1.php
new file mode 100644
index 0000000000..10343438b3
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_4_rc1.php
@@ -0,0 +1,129 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v30x;
+
+class release_3_0_4_rc1 extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.0.4-RC1', '>=');
+ }
+
+ static public function depends_on()
+ {
+ return array('\phpbb\db\migration\data\v30x\release_3_0_3');
+ }
+
+ public function update_schema()
+ {
+ return array(
+ 'add_columns' => array(
+ $this->table_prefix . 'profile_fields' => array(
+ 'field_show_profile' => array('BOOL', 0),
+ ),
+ ),
+ 'change_columns' => array(
+ $this->table_prefix . 'styles' => array(
+ 'style_id' => array('UINT', NULL, 'auto_increment'),
+ 'template_id' => array('UINT', 0),
+ 'theme_id' => array('UINT', 0),
+ 'imageset_id' => array('UINT', 0),
+ ),
+ $this->table_prefix . 'styles_imageset' => array(
+ 'imageset_id' => array('UINT', NULL, 'auto_increment'),
+ ),
+ $this->table_prefix . 'styles_imageset_data' => array(
+ 'image_id' => array('UINT', NULL, 'auto_increment'),
+ 'imageset_id' => array('UINT', 0),
+ ),
+ $this->table_prefix . 'styles_theme' => array(
+ 'theme_id' => array('UINT', NULL, 'auto_increment'),
+ ),
+ $this->table_prefix . 'styles_template' => array(
+ 'template_id' => array('UINT', NULL, 'auto_increment'),
+ ),
+ $this->table_prefix . 'styles_template_data' => array(
+ 'template_id' => array('UINT', 0),
+ ),
+ $this->table_prefix . 'forums' => array(
+ 'forum_style' => array('UINT', 0),
+ ),
+ $this->table_prefix . 'users' => array(
+ 'user_style' => array('UINT', 0),
+ ),
+ ),
+ );
+ }
+
+ public function revert_schema()
+ {
+ return array(
+ 'drop_columns' => array(
+ $this->table_prefix . 'profile_fields' => array(
+ 'field_show_profile',
+ ),
+ ),
+ );
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('custom', array(array(&$this, 'update_custom_profile_fields'))),
+
+ array('config.update', array('version', '3.0.4-RC1')),
+ );
+ }
+
+ public function update_custom_profile_fields()
+ {
+ // Update the Custom Profile Fields based on previous settings to the new \format
+ $sql = 'SELECT field_id, field_required, field_show_on_reg, field_hide
+ FROM ' . PROFILE_FIELDS_TABLE;
+ $result = $this->db->sql_query($sql);
+
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $sql_ary = array(
+ 'field_required' => 0,
+ 'field_show_on_reg' => 0,
+ 'field_hide' => 0,
+ 'field_show_profile'=> 0,
+ );
+
+ if ($row['field_required'])
+ {
+ $sql_ary['field_required'] = $sql_ary['field_show_on_reg'] = $sql_ary['field_show_profile'] = 1;
+ }
+ else if ($row['field_show_on_reg'])
+ {
+ $sql_ary['field_show_on_reg'] = $sql_ary['field_show_profile'] = 1;
+ }
+ else if ($row['field_hide'])
+ {
+ // Only administrators and moderators can see this CPF, if the view is enabled, they can see it, otherwise just admins in the acp_users module
+ $sql_ary['field_hide'] = 1;
+ }
+ else
+ {
+ // equivelant to "none", which is the "Display in user control panel" option
+ $sql_ary['field_show_profile'] = 1;
+ }
+
+ $this->sql_query('UPDATE ' . $this->table_prefix . 'profile_fields SET ' . $this->db->sql_build_array('UPDATE', $sql_ary) . ' WHERE field_id = ' . $row['field_id'], $errored, $error_ary);
+ }
+
+ $this->db->sql_freeresult($result);
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_5.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_5.php
new file mode 100644
index 0000000000..09c2bfea50
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_5.php
@@ -0,0 +1,34 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v30x;
+
+class release_3_0_5 extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.0.5', '>=');
+ }
+
+ static public function depends_on()
+ {
+ return array('\phpbb\db\migration\data\v30x\release_3_0_5_rc1part2');
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('config.update', array('version', '3.0.5')),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_5_rc1.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_5_rc1.php
new file mode 100644
index 0000000000..003ccf8f18
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_5_rc1.php
@@ -0,0 +1,133 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v30x;
+
+use phpbb\db\migration\container_aware_migration;
+
+class release_3_0_5_rc1 extends container_aware_migration
+{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.0.5-RC1', '>=');
+ }
+
+ static public function depends_on()
+ {
+ return array('\phpbb\db\migration\data\v30x\release_3_0_4');
+ }
+
+ public function update_schema()
+ {
+ return array(
+ 'change_columns' => array(
+ $this->table_prefix . 'forums' => array(
+ 'forum_style' => array('UINT', 0),
+ ),
+ ),
+ );
+ }
+
+ public function update_data()
+ {
+ $search_indexing_state = $this->config['search_indexing_state'];
+
+ return array(
+ array('config.add', array('captcha_gd_wave', 0)),
+ array('config.add', array('captcha_gd_3d_noise', 1)),
+ array('config.add', array('captcha_gd_fonts', 1)),
+ array('config.add', array('confirm_refresh', 1)),
+ array('config.add', array('max_num_search_keywords', 10)),
+ array('config.remove', array('search_indexing_state')),
+ array('config.add', array('search_indexing_state', $search_indexing_state, true)),
+ array('custom', array(array(&$this, 'hash_old_passwords'))),
+ array('custom', array(array(&$this, 'update_ichiro_bot'))),
+ );
+ }
+
+ public function hash_old_passwords()
+ {
+ $passwords_manager = $this->container->get('passwords.manager');
+ $sql = 'SELECT user_id, user_password
+ FROM ' . $this->table_prefix . 'users
+ WHERE user_pass_convert = 1';
+ $result = $this->db->sql_query($sql);
+
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ if (strlen($row['user_password']) == 32)
+ {
+ $sql_ary = array(
+ 'user_password' => '$CP$' . $passwords_manager->hash($row['user_password'], 'passwords.driver.salted_md5'),
+ );
+
+ $this->sql_query('UPDATE ' . $this->table_prefix . 'users SET ' . $this->db->sql_build_array('UPDATE', $sql_ary) . ' WHERE user_id = ' . $row['user_id']);
+ }
+ }
+ $this->db->sql_freeresult($result);
+ }
+
+ public function update_ichiro_bot()
+ {
+ // Adjust bot entry
+ $sql = 'UPDATE ' . $this->table_prefix . "bots
+ SET bot_agent = 'ichiro/'
+ WHERE bot_agent = 'ichiro/2'";
+ $this->sql_query($sql);
+ }
+
+ public function remove_duplicate_auth_options()
+ {
+ // Before we are able to add a unique key to auth_option, we need to remove duplicate entries
+ $sql = 'SELECT auth_option
+ FROM ' . $this->table_prefix . 'acl_options
+ GROUP BY auth_option
+ HAVING COUNT(*) >= 2';
+ $result = $this->db->sql_query($sql);
+
+ $auth_options = array();
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $auth_options[] = $row['auth_option'];
+ }
+ $this->db->sql_freeresult($result);
+
+ // Remove specific auth options
+ if (!empty($auth_options))
+ {
+ foreach ($auth_options as $option)
+ {
+ // Select auth_option_ids... the largest id will be preserved
+ $sql = 'SELECT auth_option_id
+ FROM ' . ACL_OPTIONS_TABLE . "
+ WHERE auth_option = '" . $this->db->sql_escape($option) . "'
+ ORDER BY auth_option_id DESC";
+ // sql_query_limit not possible here, due to bug in postgresql layer
+ $result = $this->db->sql_query($sql);
+
+ // Skip first row, this is our original auth option we want to preserve
+ $row = $this->db->sql_fetchrow($result);
+
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ // Ok, remove this auth option...
+ $this->sql_query('DELETE FROM ' . ACL_OPTIONS_TABLE . ' WHERE auth_option_id = ' . $row['auth_option_id']);
+ $this->sql_query('DELETE FROM ' . ACL_ROLES_DATA_TABLE . ' WHERE auth_option_id = ' . $row['auth_option_id']);
+ $this->sql_query('DELETE FROM ' . ACL_GROUPS_TABLE . ' WHERE auth_option_id = ' . $row['auth_option_id']);
+ $this->sql_query('DELETE FROM ' . ACL_USERS_TABLE . ' WHERE auth_option_id = ' . $row['auth_option_id']);
+ }
+ $this->db->sql_freeresult($result);
+ }
+ }
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_5_rc1part2.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_5_rc1part2.php
new file mode 100644
index 0000000000..a9041ef354
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_5_rc1part2.php
@@ -0,0 +1,48 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v30x;
+
+class release_3_0_5_rc1part2 extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.0.5-RC1', '>=');
+ }
+
+ static public function depends_on()
+ {
+ return array('\phpbb\db\migration\data\v30x\release_3_0_5_rc1');
+ }
+
+ public function update_schema()
+ {
+ return array(
+ 'drop_keys' => array(
+ $this->table_prefix . 'acl_options' => array('auth_option'),
+ ),
+ 'add_unique_index' => array(
+ $this->table_prefix . 'acl_options' => array(
+ 'auth_option' => array('auth_option'),
+ ),
+ ),
+ );
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('config.update', array('version', '3.0.5-RC1')),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_6.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_6.php
new file mode 100644
index 0000000000..74c338a9c5
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_6.php
@@ -0,0 +1,34 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v30x;
+
+class release_3_0_6 extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.0.6', '>=');
+ }
+
+ static public function depends_on()
+ {
+ return array('\phpbb\db\migration\data\v30x\release_3_0_6_rc4');
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('config.update', array('version', '3.0.6')),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_6_rc1.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_6_rc1.php
new file mode 100644
index 0000000000..faef68121d
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_6_rc1.php
@@ -0,0 +1,330 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v30x;
+
+class release_3_0_6_rc1 extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.0.6-RC1', '>=');
+ }
+
+ static public function depends_on()
+ {
+ return array('\phpbb\db\migration\data\v30x\release_3_0_5');
+ }
+
+ public function update_schema()
+ {
+ return array(
+ 'add_columns' => array(
+ $this->table_prefix . 'confirm' => array(
+ 'attempts' => array('UINT', 0),
+ ),
+ $this->table_prefix . 'users' => array(
+ 'user_new' => array('BOOL', 1),
+ 'user_reminded' => array('TINT:4', 0),
+ 'user_reminded_time' => array('TIMESTAMP', 0),
+ ),
+ $this->table_prefix . 'groups' => array(
+ 'group_skip_auth' => array('BOOL', 0, 'after' => 'group_founder_manage'),
+ ),
+ $this->table_prefix . 'privmsgs' => array(
+ 'message_reported' => array('BOOL', 0),
+ ),
+ $this->table_prefix . 'reports' => array(
+ 'pm_id' => array('UINT', 0),
+ ),
+ $this->table_prefix . 'profile_fields' => array(
+ 'field_show_on_vt' => array('BOOL', 0),
+ ),
+ $this->table_prefix . 'forums' => array(
+ 'forum_options' => array('UINT:20', 0),
+ ),
+ ),
+ 'change_columns' => array(
+ $this->table_prefix . 'users' => array(
+ 'user_options' => array('UINT:11', 230271),
+ ),
+ ),
+ 'add_index' => array(
+ $this->table_prefix . 'reports' => array(
+ 'post_id' => array('post_id'),
+ 'pm_id' => array('pm_id'),
+ ),
+ $this->table_prefix . 'posts' => array(
+ 'post_username' => array('post_username:255'),
+ ),
+ ),
+ );
+ }
+
+ public function revert_schema()
+ {
+ return array(
+ 'drop_columns' => array(
+ $this->table_prefix . 'confirm' => array(
+ 'attempts',
+ ),
+ $this->table_prefix . 'users' => array(
+ 'user_new',
+ 'user_reminded',
+ 'user_reminded_time',
+ ),
+ $this->table_prefix . 'groups' => array(
+ 'group_skip_auth',
+ ),
+ $this->table_prefix . 'privmsgs' => array(
+ 'message_reported',
+ ),
+ $this->table_prefix . 'reports' => array(
+ 'pm_id',
+ ),
+ $this->table_prefix . 'profile_fields' => array(
+ 'field_show_on_vt',
+ ),
+ $this->table_prefix . 'forums' => array(
+ 'forum_options',
+ ),
+ ),
+ 'drop_keys' => array(
+ $this->table_prefix . 'reports' => array(
+ 'post_id',
+ 'pm_id',
+ ),
+ $this->table_prefix . 'posts' => array(
+ 'post_username',
+ ),
+ ),
+ );
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('config.add', array('captcha_plugin', 'phpbb_captcha_nogd')),
+ array('if', array(
+ ($this->config['captcha_gd']),
+ array('config.update', array('captcha_plugin', 'phpbb_captcha_gd')),
+ )),
+
+ array('config.add', array('feed_enable', 0)),
+ array('config.add', array('feed_limit', 10)),
+ array('config.add', array('feed_overall_forums', 1)),
+ array('config.add', array('feed_overall_forums_limit', 15)),
+ array('config.add', array('feed_overall_topics', 0)),
+ array('config.add', array('feed_overall_topics_limit', 15)),
+ array('config.add', array('feed_forum', 1)),
+ array('config.add', array('feed_topic', 1)),
+ array('config.add', array('feed_item_statistics', 1)),
+
+ array('config.add', array('smilies_per_page', 50)),
+ array('config.add', array('allow_pm_report', 1)),
+ array('config.add', array('min_post_chars', 1)),
+ array('config.add', array('allow_quick_reply', 1)),
+ array('config.add', array('new_member_post_limit', 0)),
+ array('config.add', array('new_member_group_default', 0)),
+ array('config.add', array('delete_time', $this->config['edit_time'])),
+
+ array('config.add', array('allow_avatar', 0)),
+ array('if', array(
+ ($this->config['allow_avatar_upload'] || $this->config['allow_avatar_local'] || $this->config['allow_avatar_remote']),
+ array('config.update', array('allow_avatar', 1)),
+ )),
+ array('config.add', array('allow_avatar_remote_upload', 0)),
+ array('if', array(
+ ($this->config['allow_avatar_remote'] && $this->config['allow_avatar_upload']),
+ array('config.update', array('allow_avatar_remote_upload', 1)),
+ )),
+
+ array('module.add', array(
+ 'acp',
+ 'ACP_BOARD_CONFIGURATION',
+ array(
+ 'module_basename' => 'acp_board',
+ 'modes' => array('feed'),
+ ),
+ )),
+ array('module.add', array(
+ 'acp',
+ 'ACP_CAT_USERS',
+ array(
+ 'module_basename' => 'acp_users',
+ 'modes' => array('warnings'),
+ ),
+ )),
+ array('module.add', array(
+ 'acp',
+ 'ACP_SERVER_CONFIGURATION',
+ array(
+ 'module_basename' => 'acp_send_statistics',
+ 'modes' => array('send_statistics'),
+ ),
+ )),
+ array('module.add', array(
+ 'acp',
+ 'ACP_FORUM_BASED_PERMISSIONS',
+ array(
+ 'module_basename' => 'acp_permissions',
+ 'modes' => array('setting_forum_copy'),
+ ),
+ )),
+ array('module.add', array(
+ 'mcp',
+ 'MCP_REPORTS',
+ array(
+ 'module_basename' => 'mcp_pm_reports',
+ 'modes' => array('pm_reports','pm_reports_closed','pm_report_details'),
+ ),
+ )),
+ array('custom', array(array(&$this, 'add_newly_registered_group'))),
+ array('custom', array(array(&$this, 'set_user_options_default'))),
+
+ array('config.update', array('version', '3.0.6-RC1')),
+ );
+ }
+
+ public function set_user_options_default()
+ {
+ // 229376 is the added value to enable all three signature options
+ $sql = 'UPDATE ' . USERS_TABLE . ' SET user_options = user_options + 229376';
+ $this->sql_query($sql);
+ }
+
+ public function add_newly_registered_group()
+ {
+ // Add newly_registered group... but check if it already exists (we always supported running the updater on any schema)
+ $sql = 'SELECT group_id
+ FROM ' . GROUPS_TABLE . "
+ WHERE group_name = 'NEWLY_REGISTERED'";
+ $result = $this->db->sql_query($sql);
+ $group_id = (int) $this->db->sql_fetchfield('group_id');
+ $this->db->sql_freeresult($result);
+
+ if (!$group_id)
+ {
+ $sql = 'INSERT INTO ' . GROUPS_TABLE . " (group_name, group_type, group_founder_manage, group_colour, group_legend, group_avatar, group_desc, group_desc_uid, group_max_recipients) VALUES ('NEWLY_REGISTERED', 3, 0, '', 0, '', '', '', 5)";
+ $this->sql_query($sql);
+
+ $group_id = $this->db->sql_nextid();
+ }
+
+ // Insert new user role... at the end of the chain
+ $sql = 'SELECT role_id
+ FROM ' . ACL_ROLES_TABLE . "
+ WHERE role_name = 'ROLE_USER_NEW_MEMBER'
+ AND role_type = 'u_'";
+ $result = $this->db->sql_query($sql);
+ $u_role = (int) $this->db->sql_fetchfield('role_id');
+ $this->db->sql_freeresult($result);
+
+ if (!$u_role)
+ {
+ $sql = 'SELECT MAX(role_order) as max_order_id
+ FROM ' . ACL_ROLES_TABLE . "
+ WHERE role_type = 'u_'";
+ $result = $this->db->sql_query($sql);
+ $next_order_id = (int) $this->db->sql_fetchfield('max_order_id');
+ $this->db->sql_freeresult($result);
+
+ $next_order_id++;
+
+ $sql = 'INSERT INTO ' . ACL_ROLES_TABLE . " (role_name, role_description, role_type, role_order) VALUES ('ROLE_USER_NEW_MEMBER', 'ROLE_DESCRIPTION_USER_NEW_MEMBER', 'u_', $next_order_id)";
+ $this->sql_query($sql);
+ $u_role = $this->db->sql_nextid();
+
+ // Now add the correct data to the roles...
+ // The standard role says that new users are not able to send a PM, Mass PM, are not able to PM groups
+ $sql = 'INSERT INTO ' . ACL_ROLES_DATA_TABLE . " (role_id, auth_option_id, auth_setting) SELECT $u_role, auth_option_id, 0 FROM " . ACL_OPTIONS_TABLE . " WHERE auth_option LIKE 'u_%' AND auth_option IN ('u_sendpm', 'u_masspm', 'u_masspm_group')";
+ $this->sql_query($sql);
+
+ // Add user role to group
+ $sql = 'INSERT INTO ' . ACL_GROUPS_TABLE . " (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES ($group_id, 0, 0, $u_role, 0)";
+ $this->sql_query($sql);
+ }
+
+ // Insert new forum role
+ $sql = 'SELECT role_id
+ FROM ' . ACL_ROLES_TABLE . "
+ WHERE role_name = 'ROLE_FORUM_NEW_MEMBER'
+ AND role_type = 'f_'";
+ $result = $this->db->sql_query($sql);
+ $f_role = (int) $this->db->sql_fetchfield('role_id');
+ $this->db->sql_freeresult($result);
+
+ if (!$f_role)
+ {
+ $sql = 'SELECT MAX(role_order) as max_order_id
+ FROM ' . ACL_ROLES_TABLE . "
+ WHERE role_type = 'f_'";
+ $result = $this->db->sql_query($sql);
+ $next_order_id = (int) $this->db->sql_fetchfield('max_order_id');
+ $this->db->sql_freeresult($result);
+
+ $next_order_id++;
+
+ $sql = 'INSERT INTO ' . ACL_ROLES_TABLE . " (role_name, role_description, role_type, role_order) VALUES ('ROLE_FORUM_NEW_MEMBER', 'ROLE_DESCRIPTION_FORUM_NEW_MEMBER', 'f_', $next_order_id)";
+ $this->sql_query($sql);
+ $f_role = $this->db->sql_nextid();
+
+ $sql = 'INSERT INTO ' . ACL_ROLES_DATA_TABLE . " (role_id, auth_option_id, auth_setting) SELECT $f_role, auth_option_id, 0 FROM " . ACL_OPTIONS_TABLE . " WHERE auth_option LIKE 'f_%' AND auth_option IN ('f_noapprove')";
+ $this->sql_query($sql);
+ }
+
+ // Set every members user_new column to 0 (old users) only if there is no one yet (this makes sure we do not execute this more than once)
+ $sql = 'SELECT 1
+ FROM ' . USERS_TABLE . '
+ WHERE user_new = 0';
+ $result = $this->db->sql_query_limit($sql, 1);
+ $row = $this->db->sql_fetchrow($result);
+ $this->db->sql_freeresult($result);
+
+ if (!$row)
+ {
+ $sql = 'UPDATE ' . USERS_TABLE . ' SET user_new = 0';
+ $this->sql_query($sql);
+ }
+
+ // To mimick the old "feature" we will assign the forum role to every forum, regardless of the setting (this makes sure there are no "this does not work!!!! YUO!!!" posts...
+ // Check if the role is already assigned...
+ $sql = 'SELECT forum_id
+ FROM ' . ACL_GROUPS_TABLE . '
+ WHERE group_id = ' . $group_id . '
+ AND auth_role_id = ' . $f_role;
+ $result = $this->db->sql_query($sql);
+ $is_options = (int) $this->db->sql_fetchfield('forum_id');
+ $this->db->sql_freeresult($result);
+
+ // Not assigned at all... :/
+ if (!$is_options)
+ {
+ // Get postable forums
+ $sql = 'SELECT forum_id
+ FROM ' . FORUMS_TABLE . '
+ WHERE forum_type != ' . FORUM_LINK;
+ $result = $this->db->sql_query($sql);
+
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $this->sql_query('INSERT INTO ' . ACL_GROUPS_TABLE . ' (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES (' . $group_id . ', ' . (int) $row['forum_id'] . ', 0, ' . $f_role . ', 0)');
+ }
+ $this->db->sql_freeresult($result);
+ }
+
+ // Clear permissions...
+ include_once($this->phpbb_root_path . 'includes/acp/auth.' . $this->php_ext);
+ $auth_admin = new \auth_admin();
+ $auth_admin->acl_clear_prefetch();
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_6_rc2.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_6_rc2.php
new file mode 100644
index 0000000000..c52b71d8fa
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_6_rc2.php
@@ -0,0 +1,34 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v30x;
+
+class release_3_0_6_rc2 extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.0.6-RC2', '>=');
+ }
+
+ static public function depends_on()
+ {
+ return array('\phpbb\db\migration\data\v30x\release_3_0_6_rc1');
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('config.update', array('version', '3.0.6-RC2')),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_6_rc3.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_6_rc3.php
new file mode 100644
index 0000000000..2db3341b0a
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_6_rc3.php
@@ -0,0 +1,46 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v30x;
+
+class release_3_0_6_rc3 extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.0.6-RC3', '>=');
+ }
+
+ static public function depends_on()
+ {
+ return array('\phpbb\db\migration\data\v30x\release_3_0_6_rc2');
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('custom', array(array(&$this, 'update_cp_fields'))),
+
+ array('config.update', array('version', '3.0.6-RC3')),
+ );
+ }
+
+ public function update_cp_fields()
+ {
+ // Update the Custom Profile Fields based on previous settings to the new \format
+ $sql = 'UPDATE ' . PROFILE_FIELDS_TABLE . '
+ SET field_show_on_vt = 1
+ WHERE field_hide = 0
+ AND (field_required = 1 OR field_show_on_reg = 1 OR field_show_profile = 1)';
+ $this->sql_query($sql);
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_6_rc4.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_6_rc4.php
new file mode 100644
index 0000000000..5734db25e6
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_6_rc4.php
@@ -0,0 +1,34 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v30x;
+
+class release_3_0_6_rc4 extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.0.6-RC4', '>=');
+ }
+
+ static public function depends_on()
+ {
+ return array('\phpbb\db\migration\data\v30x\release_3_0_6_rc3');
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('config.update', array('version', '3.0.6-RC4')),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_7.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_7.php
new file mode 100644
index 0000000000..d1d602819d
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_7.php
@@ -0,0 +1,34 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v30x;
+
+class release_3_0_7 extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.0.7', '>=');
+ }
+
+ static public function depends_on()
+ {
+ return array('\phpbb\db\migration\data\v30x\release_3_0_7_rc2');
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('config.update', array('version', '3.0.7')),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_7_pl1.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_7_pl1.php
new file mode 100644
index 0000000000..784e810f14
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_7_pl1.php
@@ -0,0 +1,34 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v30x;
+
+class release_3_0_7_pl1 extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.0.7-pl1', '>=');
+ }
+
+ static public function depends_on()
+ {
+ return array('\phpbb\db\migration\data\v30x\release_3_0_7');
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('config.update', array('version', '3.0.7-pl1')),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_7_rc1.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_7_rc1.php
new file mode 100644
index 0000000000..1843c3f262
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_7_rc1.php
@@ -0,0 +1,82 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v30x;
+
+class release_3_0_7_rc1 extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.0.7-RC1', '>=');
+ }
+
+ static public function depends_on()
+ {
+ return array('\phpbb\db\migration\data\v30x\release_3_0_6');
+ }
+
+ public function update_schema()
+ {
+ return array(
+ 'drop_keys' => array(
+ $this->table_prefix . 'log' => array(
+ 'log_time',
+ ),
+ ),
+ 'add_index' => array(
+ $this->table_prefix . 'topics_track' => array(
+ 'topic_id' => array('topic_id'),
+ ),
+ ),
+ );
+ }
+
+ public function revert_schema()
+ {
+ return array(
+ 'add_index' => array(
+ $this->table_prefix . 'log' => array(
+ 'log_time' => array('log_time'),
+ ),
+ ),
+ 'drop_keys' => array(
+ $this->table_prefix . 'topics_track' => array(
+ 'topic_id',
+ ),
+ ),
+ );
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('config.add', array('feed_overall', 1)),
+ array('config.add', array('feed_http_auth', 0)),
+ array('config.add', array('feed_limit_post', $this->config['feed_limit'])),
+ array('config.add', array('feed_limit_topic', $this->config['feed_overall_topics_limit'])),
+ array('config.add', array('feed_topics_new', $this->config['feed_overall_topics'])),
+ array('config.add', array('feed_topics_active', $this->config['feed_overall_topics'])),
+ array('custom', array(array(&$this, 'delete_text_templates'))),
+
+ array('config.update', array('version', '3.0.7-RC1')),
+ );
+ }
+
+ public function delete_text_templates()
+ {
+ // Delete all text-templates from the template_data
+ $sql = 'DELETE FROM ' . STYLES_TEMPLATE_DATA_TABLE . '
+ WHERE template_filename ' . $this->db->sql_like_expression($this->db->get_any_char() . '.txt');
+ $this->sql_query($sql);
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_7_rc2.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_7_rc2.php
new file mode 100644
index 0000000000..e497a38765
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_7_rc2.php
@@ -0,0 +1,79 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v30x;
+
+class release_3_0_7_rc2 extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.0.7-RC2', '>=');
+ }
+
+ static public function depends_on()
+ {
+ return array('\phpbb\db\migration\data\v30x\release_3_0_7_rc1');
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('custom', array(array(&$this, 'update_email_hash'))),
+
+ array('config.update', array('version', '3.0.7-RC2')),
+ );
+ }
+
+ public function update_email_hash($start = 0)
+ {
+ $limit = 1000;
+
+ $sql = 'SELECT user_id, user_email, user_email_hash
+ FROM ' . USERS_TABLE . '
+ WHERE user_type <> ' . USER_IGNORE . "
+ AND user_email <> ''";
+ $result = $this->db->sql_query_limit($sql, $limit, $start);
+
+ $i = 0;
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $i++;
+
+ // Snapshot of the phpbb_email_hash() function
+ // We cannot call it directly because the auto updater updates the DB first. :/
+ $user_email_hash = sprintf('%u', crc32(strtolower($row['user_email']))) . strlen($row['user_email']);
+
+ if ($user_email_hash != $row['user_email_hash'])
+ {
+ $sql_ary = array(
+ 'user_email_hash' => $user_email_hash,
+ );
+
+ $sql = 'UPDATE ' . USERS_TABLE . '
+ SET ' . $this->db->sql_build_array('UPDATE', $sql_ary) . '
+ WHERE user_id = ' . (int) $row['user_id'];
+ $this->sql_query($sql);
+ }
+ }
+ $this->db->sql_freeresult($result);
+
+ if ($i < $limit)
+ {
+ // Completed
+ return;
+ }
+
+ // Return the next start, will be sent to $start when this function is called again
+ return $start + $limit;
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_8.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_8.php
new file mode 100644
index 0000000000..04b5bd4a13
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_8.php
@@ -0,0 +1,34 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v30x;
+
+class release_3_0_8 extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.0.8', '>=');
+ }
+
+ static public function depends_on()
+ {
+ return array('\phpbb\db\migration\data\v30x\release_3_0_8_rc1');
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('config.update', array('version', '3.0.8')),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_8_rc1.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_8_rc1.php
new file mode 100644
index 0000000000..22fd51543b
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_8_rc1.php
@@ -0,0 +1,162 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v30x;
+
+class release_3_0_8_rc1 extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.0.8-RC1', '>=');
+ }
+
+ static public function depends_on()
+ {
+ return array('\phpbb\db\migration\data\v30x\release_3_0_7_pl1');
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('custom', array(array(&$this, 'update_file_extension_group_names'))),
+ array('custom', array(array(&$this, 'update_module_auth'))),
+ array('custom', array(array(&$this, 'delete_orphan_shadow_topics'))),
+ array('module.add', array(
+ 'acp',
+ 'ACP_MESSAGES',
+ array(
+ 'module_basename' => 'acp_board',
+ 'modes' => array('post'),
+ ),
+ )),
+ array('config.add', array('load_unreads_search', 1)),
+ array('config.update_if_equals', array(600, 'queue_interval', 60)),
+ array('config.update_if_equals', array(50, 'email_package_size', 20)),
+
+ array('config.update', array('version', '3.0.8-RC1')),
+ );
+ }
+
+ public function update_file_extension_group_names()
+ {
+ // Update file extension group names to use language strings.
+ $sql = 'SELECT lang_dir
+ FROM ' . LANG_TABLE;
+ $result = $this->db->sql_query($sql);
+
+ $extension_groups_updated = array();
+ while ($lang_dir = $this->db->sql_fetchfield('lang_dir'))
+ {
+ $lang_dir = basename($lang_dir);
+
+ // The language strings we need are either in language/.../acp/attachments.php
+ // in the update package if we're updating to 3.0.8-RC1 or later,
+ // or they are in language/.../install.php when we're updating from 3.0.7-PL1 or earlier.
+ // On an already updated board, they can also already be in language/.../acp/attachments.php
+ // in the board root.
+ $lang_files = array(
+ "{$this->phpbb_root_path}install/update/new/language/$lang_dir/acp/attachments.{$this->php_ext}",
+ "{$this->phpbb_root_path}language/$lang_dir/install.{$this->php_ext}",
+ "{$this->phpbb_root_path}language/$lang_dir/acp/attachments.{$this->php_ext}",
+ );
+
+ foreach ($lang_files as $lang_file)
+ {
+ if (!file_exists($lang_file))
+ {
+ continue;
+ }
+
+ $lang = array();
+ include($lang_file);
+
+ foreach($lang as $lang_key => $lang_val)
+ {
+ if (isset($extension_groups_updated[$lang_key]) || strpos($lang_key, 'EXT_GROUP_') !== 0)
+ {
+ continue;
+ }
+
+ $sql_ary = array(
+ 'group_name' => substr($lang_key, 10), // Strip off 'EXT_GROUP_'
+ );
+
+ $sql = 'UPDATE ' . EXTENSION_GROUPS_TABLE . '
+ SET ' . $this->db->sql_build_array('UPDATE', $sql_ary) . "
+ WHERE group_name = '" . $this->db->sql_escape($lang_val) . "'";
+ $this->sql_query($sql);
+
+ $extension_groups_updated[$lang_key] = true;
+ }
+ }
+ }
+ $this->db->sql_freeresult($result);
+ }
+
+ public function update_module_auth()
+ {
+ $sql = 'UPDATE ' . MODULES_TABLE . '
+ SET module_auth = \'cfg_allow_avatar && (cfg_allow_avatar_local || cfg_allow_avatar_remote || cfg_allow_avatar_upload || cfg_allow_avatar_remote_upload)\'
+ WHERE module_class = \'ucp\'
+ AND module_basename = \'profile\'
+ AND module_mode = \'avatar\'';
+ $this->sql_query($sql);
+ }
+
+ public function delete_orphan_shadow_topics()
+ {
+ // Delete shadow topics pointing to not existing topics
+ $batch_size = 500;
+
+ // Set of affected forums we have to resync
+ $sync_forum_ids = array();
+
+ $sql_array = array(
+ 'SELECT' => 't1.topic_id, t1.forum_id',
+ 'FROM' => array(
+ TOPICS_TABLE => 't1',
+ ),
+ 'LEFT_JOIN' => array(
+ array(
+ 'FROM' => array(TOPICS_TABLE => 't2'),
+ 'ON' => 't1.topic_moved_id = t2.topic_id',
+ ),
+ ),
+ 'WHERE' => 't1.topic_moved_id <> 0
+ AND t2.topic_id IS NULL',
+ );
+ $sql = $this->db->sql_build_query('SELECT', $sql_array);
+ $result = $this->db->sql_query_limit($sql, $batch_size);
+
+ $topic_ids = array();
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $topic_ids[] = (int) $row['topic_id'];
+
+ $sync_forum_ids[(int) $row['forum_id']] = (int) $row['forum_id'];
+ }
+ $this->db->sql_freeresult($result);
+
+ if (!empty($topic_ids))
+ {
+ $sql = 'DELETE FROM ' . TOPICS_TABLE . '
+ WHERE ' . $this->db->sql_in_set('topic_id', $topic_ids);
+ $this->db->sql_query($sql);
+
+ // Sync the forums we have deleted shadow topics from.
+ sync('forum', 'forum_id', $sync_forum_ids, true, true);
+
+ return false;
+ }
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_9.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_9.php
new file mode 100644
index 0000000000..e69134c538
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_9.php
@@ -0,0 +1,34 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v30x;
+
+class release_3_0_9 extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.0.9', '>=');
+ }
+
+ static public function depends_on()
+ {
+ return array('\phpbb\db\migration\data\v30x\release_3_0_9_rc4');
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('config.update', array('version', '3.0.9')),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_9_rc1.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_9_rc1.php
new file mode 100644
index 0000000000..06e46d522f
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_9_rc1.php
@@ -0,0 +1,130 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v30x;
+
+class release_3_0_9_rc1 extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.0.9-RC1', '>=');
+ }
+
+ static public function depends_on()
+ {
+ return array('\phpbb\db\migration\data\v30x\release_3_0_8');
+ }
+
+ public function update_schema()
+ {
+ return array(
+ 'add_tables' => array(
+ $this->table_prefix . 'login_attempts' => array(
+ 'COLUMNS' => array(
+ // this column was removed from the database updater
+ // after 3.0.9-RC3 was released. It might still exist
+ // in 3.0.9-RCX installations and has to be dropped as
+ // soon as the db_tools class is capable of properly
+ // removing a primary key.
+ // 'attempt_id' => array('UINT', NULL, 'auto_increment'),
+ 'attempt_ip' => array('VCHAR:40', ''),
+ 'attempt_browser' => array('VCHAR:150', ''),
+ 'attempt_forwarded_for' => array('VCHAR:255', ''),
+ 'attempt_time' => array('TIMESTAMP', 0),
+ 'user_id' => array('UINT', 0),
+ 'username' => array('VCHAR_UNI:255', 0),
+ 'username_clean' => array('VCHAR_CI', 0),
+ ),
+ //'PRIMARY_KEY' => 'attempt_id',
+ 'KEYS' => array(
+ 'att_ip' => array('INDEX', array('attempt_ip', 'attempt_time')),
+ 'att_for' => array('INDEX', array('attempt_forwarded_for', 'attempt_time')),
+ 'att_time' => array('INDEX', array('attempt_time')),
+ 'user_id' => array('INDEX', 'user_id'),
+ ),
+ ),
+ ),
+ 'change_columns' => array(
+ $this->table_prefix . 'bbcodes' => array(
+ 'bbcode_id' => array('USINT', 0),
+ ),
+ ),
+ );
+ }
+
+ public function revert_schema()
+ {
+ return array(
+ 'drop_tables' => array(
+ $this->table_prefix . 'login_attempts',
+ ),
+ );
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('config.add', array('ip_login_limit_max', 50)),
+ array('config.add', array('ip_login_limit_time', 21600)),
+ array('config.add', array('ip_login_limit_use_forwarded', 0)),
+ array('custom', array(array(&$this, 'update_file_extension_group_names'))),
+ array('custom', array(array(&$this, 'fix_firebird_qa_captcha'))),
+
+ array('config.update', array('version', '3.0.9-RC1')),
+ );
+ }
+
+ public function update_file_extension_group_names()
+ {
+ // Update file extension group names to use language strings, again.
+ $sql = 'SELECT group_id, group_name
+ FROM ' . EXTENSION_GROUPS_TABLE . '
+ WHERE group_name ' . $this->db->sql_like_expression('EXT_GROUP_' . $this->db->get_any_char());
+ $result = $this->db->sql_query($sql);
+
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $sql_ary = array(
+ 'group_name' => substr($row['group_name'], 10), // Strip off 'EXT_GROUP_'
+ );
+
+ $sql = 'UPDATE ' . EXTENSION_GROUPS_TABLE . '
+ SET ' . $this->db->sql_build_array('UPDATE', $sql_ary) . '
+ WHERE group_id = ' . $row['group_id'];
+ $this->sql_query($sql);
+ }
+ $this->db->sql_freeresult($result);
+ }
+
+ public function fix_firebird_qa_captcha()
+ {
+ // Recover from potentially broken Q&A CAPTCHA table on firebird
+ // Q&A CAPTCHA was uninstallable, so it's safe to remove these
+ // without data loss
+ if ($this->db_tools->sql_layer == 'firebird')
+ {
+ $tables = array(
+ $this->table_prefix . 'captcha_questions',
+ $this->table_prefix . 'captcha_answers',
+ $this->table_prefix . 'qa_confirm',
+ );
+ foreach ($tables as $table)
+ {
+ if ($this->db_tools->sql_table_exists($table))
+ {
+ $this->db_tools->sql_table_drop($table);
+ }
+ }
+ }
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_9_rc2.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_9_rc2.php
new file mode 100644
index 0000000000..46fd51e7fe
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_9_rc2.php
@@ -0,0 +1,34 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v30x;
+
+class release_3_0_9_rc2 extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.0.9-RC2', '>=');
+ }
+
+ static public function depends_on()
+ {
+ return array('\phpbb\db\migration\data\v30x\release_3_0_9_rc1');
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('config.update', array('version', '3.0.9-RC2')),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_9_rc3.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_9_rc3.php
new file mode 100644
index 0000000000..1696060735
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_9_rc3.php
@@ -0,0 +1,34 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v30x;
+
+class release_3_0_9_rc3 extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.0.9-RC3', '>=');
+ }
+
+ static public function depends_on()
+ {
+ return array('\phpbb\db\migration\data\v30x\release_3_0_9_rc2');
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('config.update', array('version', '3.0.9-RC3')),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_9_rc4.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_9_rc4.php
new file mode 100644
index 0000000000..fdc92b52f9
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_9_rc4.php
@@ -0,0 +1,34 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v30x;
+
+class release_3_0_9_rc4 extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.0.9-RC4', '>=');
+ }
+
+ static public function depends_on()
+ {
+ return array('\phpbb\db\migration\data\v30x\release_3_0_9_rc3');
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('config.update', array('version', '3.0.9-RC4')),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v310/.htaccess b/phpBB/phpbb/db/migration/data/v310/.htaccess
new file mode 100644
index 0000000000..44242b5418
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/.htaccess
@@ -0,0 +1,33 @@
+# With Apache 2.4 the "Order, Deny" syntax has been deprecated and moved from
+# module mod_authz_host to a new module called mod_access_compat (which may be
+# disabled) and a new "Require" syntax has been introduced to mod_authz_host.
+# We could just conditionally provide both versions, but unfortunately Apache
+# does not explicitly tell us its version if the module mod_version is not
+# available. In this case, we check for the availability of module
+# mod_authz_core (which should be on 2.4 or higher only) as a best guess.
+<IfModule mod_version.c>
+ <IfVersion < 2.4>
+ <Files "*">
+ Order Allow,Deny
+ Deny from All
+ </Files>
+ </IfVersion>
+ <IfVersion >= 2.4>
+ <Files "*">
+ Require all denied
+ </Files>
+ </IfVersion>
+</IfModule>
+<IfModule !mod_version.c>
+ <IfModule !mod_authz_core.c>
+ <Files "*">
+ Order Allow,Deny
+ Deny from All
+ </Files>
+ </IfModule>
+ <IfModule mod_authz_core.c>
+ <Files "*">
+ Require all denied
+ </Files>
+ </IfModule>
+</IfModule>
diff --git a/phpBB/phpbb/db/migration/data/v310/acp_prune_users_module.php b/phpBB/phpbb/db/migration/data/v310/acp_prune_users_module.php
new file mode 100644
index 0000000000..0ca4f2f19c
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/acp_prune_users_module.php
@@ -0,0 +1,81 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v310;
+
+class acp_prune_users_module extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ $sql = 'SELECT module_id
+ FROM ' . MODULES_TABLE . "
+ WHERE module_class = 'acp'
+ AND module_langname = 'ACP_CAT_USERS'";
+ $result = $this->db->sql_query($sql);
+ $acp_cat_users_id = (int) $this->db->sql_fetchfield('module_id');
+ $this->db->sql_freeresult($result);
+
+ $sql = 'SELECT parent_id
+ FROM ' . MODULES_TABLE . "
+ WHERE module_class = 'acp'
+ AND module_basename = 'acp_prune'
+ AND module_mode = 'users'";
+ $result = $this->db->sql_query($sql);
+ $acp_prune_users_parent = (int) $this->db->sql_fetchfield('parent_id');
+ $this->db->sql_freeresult($result);
+
+ // Skip migration if "Users" category has been deleted
+ // or the module has already been moved to that category
+ return !$acp_cat_users_id || $acp_cat_users_id === $acp_prune_users_parent;
+ }
+
+ static public function depends_on()
+ {
+ return array('\phpbb\db\migration\data\v310\beta1');
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('custom', array(array($this, 'move_prune_users_module'))),
+ );
+ }
+
+ public function move_prune_users_module()
+ {
+ $sql = 'SELECT module_id
+ FROM ' . MODULES_TABLE . "
+ WHERE module_class = 'acp'
+ AND module_basename = 'acp_prune'
+ AND module_mode = 'users'";
+ $result = $this->db->sql_query($sql);
+ $acp_prune_users_id = (int) $this->db->sql_fetchfield('module_id');
+ $this->db->sql_freeresult($result);
+
+ $sql = 'SELECT module_id
+ FROM ' . MODULES_TABLE . "
+ WHERE module_class = 'acp'
+ AND module_langname = 'ACP_CAT_USERS'";
+ $result = $this->db->sql_query($sql);
+ $acp_cat_users_id = (int) $this->db->sql_fetchfield('module_id');
+ $this->db->sql_freeresult($result);
+
+ if (!class_exists('\acp_modules'))
+ {
+ include($this->phpbb_root_path . 'includes/acp/acp_modules.' . $this->php_ext);
+ }
+ $module_manager = new \acp_modules();
+ $module_manager->module_class = 'acp';
+ $module_manager->move_module($acp_prune_users_id, $acp_cat_users_id);
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v310/acp_style_components_module.php b/phpBB/phpbb/db/migration/data/v310/acp_style_components_module.php
new file mode 100644
index 0000000000..4bd29f87d7
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/acp_style_components_module.php
@@ -0,0 +1,46 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v310;
+
+class acp_style_components_module extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ $sql = 'SELECT module_id
+ FROM ' . MODULES_TABLE . "
+ WHERE module_class = 'acp'
+ AND module_langname = 'ACP_STYLE_COMPONENTS'";
+ $result = $this->db->sql_query($sql);
+ $module_id = $this->db->sql_fetchfield('module_id');
+ $this->db->sql_freeresult($result);
+
+ return $module_id == false;
+ }
+
+ static public function depends_on()
+ {
+ return array('\phpbb\db\migration\data\v310\dev');
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('module.remove', array(
+ 'acp',
+ false,
+ 'ACP_STYLE_COMPONENTS',
+ )),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v310/allow_cdn.php b/phpBB/phpbb/db/migration/data/v310/allow_cdn.php
new file mode 100644
index 0000000000..286d20e20b
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/allow_cdn.php
@@ -0,0 +1,37 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v310;
+
+class allow_cdn extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return isset($this->config['allow_cdn']);
+ }
+
+ static public function depends_on()
+ {
+ return array(
+ '\phpbb\db\migration\data\v310\jquery_update',
+ );
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('config.add', array('allow_cdn', (int) $this->config['load_jquery_cdn'])),
+ array('config.remove', array('load_jquery_cdn')),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v310/alpha1.php b/phpBB/phpbb/db/migration/data/v310/alpha1.php
new file mode 100644
index 0000000000..4a48d2830a
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/alpha1.php
@@ -0,0 +1,53 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v310;
+
+class alpha1 extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.1.0-a1', '>=');
+ }
+
+ static public function depends_on()
+ {
+ return array(
+ '\phpbb\db\migration\data\v30x\local_url_bbcode',
+ '\phpbb\db\migration\data\v30x\release_3_0_12',
+ '\phpbb\db\migration\data\v310\acp_style_components_module',
+ '\phpbb\db\migration\data\v310\allow_cdn',
+ '\phpbb\db\migration\data\v310\auth_provider_oauth',
+ '\phpbb\db\migration\data\v310\avatars',
+ '\phpbb\db\migration\data\v310\boardindex',
+ '\phpbb\db\migration\data\v310\config_db_text',
+ '\phpbb\db\migration\data\v310\forgot_password',
+ '\phpbb\db\migration\data\v310\mod_rewrite',
+ '\phpbb\db\migration\data\v310\mysql_fulltext_drop',
+ '\phpbb\db\migration\data\v310\namespaces',
+ '\phpbb\db\migration\data\v310\notifications_cron',
+ '\phpbb\db\migration\data\v310\notification_options_reconvert',
+ '\phpbb\db\migration\data\v310\plupload',
+ '\phpbb\db\migration\data\v310\signature_module_auth',
+ '\phpbb\db\migration\data\v310\softdelete_mcp_modules',
+ '\phpbb\db\migration\data\v310\teampage',
+ );
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('config.update', array('version', '3.1.0-a1')),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v310/alpha2.php b/phpBB/phpbb/db/migration/data/v310/alpha2.php
new file mode 100644
index 0000000000..bfbcc4f6f5
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/alpha2.php
@@ -0,0 +1,37 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v310;
+
+class alpha2 extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.1.0-a2', '>=');
+ }
+
+ static public function depends_on()
+ {
+ return array(
+ '\phpbb\db\migration\data\v310\alpha1',
+ '\phpbb\db\migration\data\v310\notifications_cron_p2',
+ );
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('config.update', array('version', '3.1.0-a2')),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v310/alpha3.php b/phpBB/phpbb/db/migration/data/v310/alpha3.php
new file mode 100644
index 0000000000..bb0f904fd4
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/alpha3.php
@@ -0,0 +1,39 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v310;
+
+class alpha3 extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.1.0-a3', '>=');
+ }
+
+ static public function depends_on()
+ {
+ return array(
+ '\phpbb\db\migration\data\v310\alpha2',
+ '\phpbb\db\migration\data\v310\avatar_types',
+ '\phpbb\db\migration\data\v310\passwords',
+ '\phpbb\db\migration\data\v310\profilefield_types',
+ );
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('config.update', array('version', '3.1.0-a3')),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v310/auth_provider_oauth.php b/phpBB/phpbb/db/migration/data/v310/auth_provider_oauth.php
new file mode 100644
index 0000000000..2d51bd53e4
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/auth_provider_oauth.php
@@ -0,0 +1,77 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v310;
+
+class auth_provider_oauth extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return $this->db_tools->sql_table_exists($this->table_prefix . 'auth_provider_oauth');
+ }
+
+ public function update_schema()
+ {
+ return array(
+ 'add_tables' => array(
+ $this->table_prefix . 'oauth_tokens' => array(
+ 'COLUMNS' => array(
+ 'user_id' => array('UINT', 0), // phpbb_users.user_id
+ 'session_id' => array('CHAR:32', ''), // phpbb_sessions.session_id used only when user_id not set
+ 'provider' => array('VCHAR', ''), // Name of the OAuth provider
+ 'oauth_token' => array('MTEXT', ''), // Serialized token
+ ),
+ 'KEYS' => array(
+ 'user_id' => array('INDEX', 'user_id'),
+ 'provider' => array('INDEX', 'provider'),
+ ),
+ ),
+ $this->table_prefix . 'oauth_accounts' => array(
+ 'COLUMNS' => array(
+ 'user_id' => array('UINT', 0),
+ 'provider' => array('VCHAR', ''),
+ 'oauth_provider_id' => array('TEXT_UNI', ''),
+ ),
+ 'PRIMARY_KEY' => array(
+ 'user_id',
+ 'provider',
+ ),
+ ),
+ ),
+ );
+ }
+
+ public function revert_schema()
+ {
+ return array(
+ 'drop_tables' => array(
+ $this->table_prefix . 'oauth_tokens',
+ $this->table_prefix . 'oauth_accounts',
+ ),
+ );
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('module.add', array(
+ 'ucp',
+ 'UCP_PROFILE',
+ array(
+ 'module_basename' => 'ucp_auth_link',
+ 'modes' => array('auth_link'),
+ ),
+ )),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v310/auth_provider_oauth2.php b/phpBB/phpbb/db/migration/data/v310/auth_provider_oauth2.php
new file mode 100644
index 0000000000..e9e726ae20
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/auth_provider_oauth2.php
@@ -0,0 +1,44 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v310;
+
+class auth_provider_oauth2 extends \phpbb\db\migration\migration
+{
+ static public function depends_on()
+ {
+ return array(
+ '\phpbb\db\migration\data\v310\auth_provider_oauth',
+ );
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('custom', array(
+ array($this, 'update_auth_link_module_auth'),
+ )),
+ );
+ }
+
+ public function update_auth_link_module_auth()
+ {
+ $sql = 'UPDATE ' . MODULES_TABLE . "
+ SET module_auth = 'authmethod_oauth'
+ WHERE module_class = 'ucp'
+ AND module_basename = 'ucp_auth_link'
+ AND module_mode = 'auth_link'
+ AND module_auth = ''";
+ $this->db->sql_query($sql);
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v310/avatar_types.php b/phpBB/phpbb/db/migration/data/v310/avatar_types.php
new file mode 100644
index 0000000000..117e93239d
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/avatar_types.php
@@ -0,0 +1,64 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v310;
+
+class avatar_types extends \phpbb\db\migration\migration
+{
+ /**
+ * @var avatar type map
+ */
+ protected $avatar_type_map = array(
+ AVATAR_UPLOAD => 'avatar.driver.upload',
+ AVATAR_REMOTE => 'avatar.driver.remote',
+ AVATAR_GALLERY => 'avatar.driver.local',
+ );
+
+ static public function depends_on()
+ {
+ return array(
+ '\phpbb\db\migration\data\v310\dev',
+ '\phpbb\db\migration\data\v310\avatars',
+ );
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('custom', array(array($this, 'update_user_avatar_type'))),
+ array('custom', array(array($this, 'update_group_avatar_type'))),
+ );
+ }
+
+ public function update_user_avatar_type()
+ {
+ foreach ($this->avatar_type_map as $old => $new)
+ {
+ $sql = 'UPDATE ' . $this->table_prefix . "users
+ SET user_avatar_type = '$new'
+ WHERE user_avatar_type = '$old'";
+ $this->db->sql_query($sql);
+ }
+ }
+
+ public function update_group_avatar_type()
+ {
+ foreach ($this->avatar_type_map as $old => $new)
+ {
+ $sql = 'UPDATE ' . $this->table_prefix . "groups
+ SET group_avatar_type = '$new'
+ WHERE group_avatar_type = '$old'";
+ $this->db->sql_query($sql);
+ }
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v310/avatars.php b/phpBB/phpbb/db/migration/data/v310/avatars.php
new file mode 100644
index 0000000000..9b03a8fa94
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/avatars.php
@@ -0,0 +1,95 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v310;
+
+class avatars extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ // Get current avatar type of guest user
+ $sql = 'SELECT user_avatar_type
+ FROM ' . $this->table_prefix . 'users
+ WHERE user_id = ' . ANONYMOUS;
+ $result = $this->db->sql_query($sql);
+ $backup_type = $this->db->sql_fetchfield('user_avatar_type');
+ $this->db->sql_freeresult($result);
+
+ // Try to set avatar type to string
+ $sql = 'UPDATE ' . $this->table_prefix . "users
+ SET user_avatar_type = 'avatar.driver.upload'
+ WHERE user_id = " . ANONYMOUS;
+ $this->db->sql_return_on_error(true);
+ $effectively_installed = $this->db->sql_query($sql);
+ $this->db->sql_return_on_error();
+
+ // Restore avatar type of guest user to previous state
+ $sql = 'UPDATE ' . $this->table_prefix . "users
+ SET user_avatar_type = '{$backup_type}'
+ WHERE user_id = " . ANONYMOUS;
+ $this->db->sql_query($sql);
+
+ return $effectively_installed !== false;
+ }
+
+ static public function depends_on()
+ {
+ return array('\phpbb\db\migration\data\v30x\release_3_0_11');
+ }
+
+ public function update_schema()
+ {
+ return array(
+ 'change_columns' => array(
+ $this->table_prefix . 'users' => array(
+ 'user_avatar_type' => array('VCHAR:255', ''),
+ ),
+ $this->table_prefix . 'groups' => array(
+ 'group_avatar_type' => array('VCHAR:255', ''),
+ ),
+ ),
+ );
+ }
+
+ public function revert_schema()
+ {
+ return array(
+ 'change_columns' => array(
+ $this->table_prefix . 'users' => array(
+ 'user_avatar_type' => array('TINT:2', ''),
+ ),
+ $this->table_prefix . 'groups' => array(
+ 'group_avatar_type' => array('TINT:2', ''),
+ ),
+ ),
+ );
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('config.add', array('allow_avatar_gravatar', 0)),
+ array('custom', array(array($this, 'update_module_auth'))),
+ );
+ }
+
+ public function update_module_auth()
+ {
+ $sql = 'UPDATE ' . $this->table_prefix . "modules
+ SET module_auth = 'cfg_allow_avatar'
+ WHERE module_class = 'ucp'
+ AND module_basename = 'ucp_profile'
+ AND module_mode = 'avatar'";
+ $this->db->sql_query($sql);
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v310/beta1.php b/phpBB/phpbb/db/migration/data/v310/beta1.php
new file mode 100644
index 0000000000..9feba5235d
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/beta1.php
@@ -0,0 +1,42 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v310;
+
+class beta1 extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.1.0-b1', '>=');
+ }
+
+ static public function depends_on()
+ {
+ return array(
+ '\phpbb\db\migration\data\v310\alpha3',
+ '\phpbb\db\migration\data\v310\passwords_p2',
+ '\phpbb\db\migration\data\v310\postgres_fulltext_drop',
+ '\phpbb\db\migration\data\v310\profilefield_change_load_settings',
+ '\phpbb\db\migration\data\v310\profilefield_location',
+ '\phpbb\db\migration\data\v310\soft_delete_mod_convert2',
+ '\phpbb\db\migration\data\v310\ucp_popuppm_module',
+ );
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('config.update', array('version', '3.1.0-b1')),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v310/beta2.php b/phpBB/phpbb/db/migration/data/v310/beta2.php
new file mode 100644
index 0000000000..d5e31ce4cb
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/beta2.php
@@ -0,0 +1,38 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v310;
+
+class beta2 extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.1.0-b2', '>=');
+ }
+
+ static public function depends_on()
+ {
+ return array(
+ '\phpbb\db\migration\data\v310\beta1',
+ '\phpbb\db\migration\data\v310\acp_prune_users_module',
+ '\phpbb\db\migration\data\v310\profilefield_location_cleanup',
+ );
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('config.update', array('version', '3.1.0-b2')),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v310/beta3.php b/phpBB/phpbb/db/migration/data/v310/beta3.php
new file mode 100644
index 0000000000..78c61e8e90
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/beta3.php
@@ -0,0 +1,41 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v310;
+
+class beta3 extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.1.0-b3', '>=');
+ }
+
+ static public function depends_on()
+ {
+ return array(
+ '\phpbb\db\migration\data\v310\beta2',
+ '\phpbb\db\migration\data\v310\auth_provider_oauth2',
+ '\phpbb\db\migration\data\v310\board_contact_name',
+ '\phpbb\db\migration\data\v310\jquery_update2',
+ '\phpbb\db\migration\data\v310\live_searches_config',
+ '\phpbb\db\migration\data\v310\prune_shadow_topics',
+ );
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('config.update', array('version', '3.1.0-b3')),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v310/beta4.php b/phpBB/phpbb/db/migration/data/v310/beta4.php
new file mode 100644
index 0000000000..e634785c38
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/beta4.php
@@ -0,0 +1,38 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v310;
+
+class beta4 extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.1.0-b4', '>=');
+ }
+
+ static public function depends_on()
+ {
+ return array(
+ '\phpbb\db\migration\data\v310\beta3',
+ '\phpbb\db\migration\data\v310\extensions_version_check_force_unstable',
+ '\phpbb\db\migration\data\v310\reset_missing_captcha_plugin',
+ );
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('config.update', array('version', '3.1.0-b4')),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v310/board_contact_name.php b/phpBB/phpbb/db/migration/data/v310/board_contact_name.php
new file mode 100644
index 0000000000..6f5188720b
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/board_contact_name.php
@@ -0,0 +1,34 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v310;
+
+class board_contact_name extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return isset($this->config['board_contact_name']);
+ }
+
+ static public function depends_on()
+ {
+ return array('\phpbb\db\migration\data\v310\beta2');
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('config.add', array('board_contact_name', '')),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v310/boardindex.php b/phpBB/phpbb/db/migration/data/v310/boardindex.php
new file mode 100644
index 0000000000..77a8558f21
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/boardindex.php
@@ -0,0 +1,29 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v310;
+
+class boardindex extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return isset($this->config['board_index_text']);
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('config.add', array('board_index_text', '')),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v310/bot_update.php b/phpBB/phpbb/db/migration/data/v310/bot_update.php
new file mode 100644
index 0000000000..39b16c68f8
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/bot_update.php
@@ -0,0 +1,150 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v310;
+
+class bot_update extends \phpbb\db\migration\migration
+{
+ static public function depends_on()
+ {
+ return array('\phpbb\db\migration\data\v310\rc6');
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('custom', array(array(&$this, 'update_bing_bot'))),
+ array('custom', array(array(&$this, 'update_bots'))),
+ );
+ }
+
+ public function update_bing_bot()
+ {
+ $bot_name = 'Bing [Bot]';
+ $bot_name_clean = utf8_clean_string($bot_name);
+
+ $sql = 'SELECT user_id
+ FROM ' . USERS_TABLE . "
+ WHERE username_clean = '" . $this->db->sql_escape($bot_name_clean) . "'";
+ $result = $this->db->sql_query($sql);
+ $bing_already_added = (bool) $this->db->sql_fetchfield('user_id');
+ $this->db->sql_freeresult($result);
+
+ if (!$bing_already_added)
+ {
+ $bot_agent = 'bingbot/';
+ $bot_ip = '';
+ $sql = 'SELECT group_id, group_colour
+ FROM ' . GROUPS_TABLE . "
+ WHERE group_name = 'BOTS'";
+ $result = $this->db->sql_query($sql);
+ $group_row = $this->db->sql_fetchrow($result);
+ $this->db->sql_freeresult($result);
+
+ if (!$group_row)
+ {
+ // default fallback, should never get here
+ $group_row['group_id'] = 6;
+ $group_row['group_colour'] = '9E8DA7';
+ }
+
+ if (!function_exists('user_add'))
+ {
+ include($this->phpbb_root_path . 'includes/functions_user.' . $this->php_ext);
+ }
+
+ $user_row = array(
+ 'user_type' => USER_IGNORE,
+ 'group_id' => $group_row['group_id'],
+ 'username' => $bot_name,
+ 'user_regdate' => time(),
+ 'user_password' => '',
+ 'user_colour' => $group_row['group_colour'],
+ 'user_email' => '',
+ 'user_lang' => $this->config['default_lang'],
+ 'user_style' => $this->config['default_style'],
+ 'user_timezone' => 0,
+ 'user_dateformat' => $this->config['default_dateformat'],
+ 'user_allow_massemail' => 0,
+ );
+
+ $user_id = user_add($user_row);
+
+ $sql = 'INSERT INTO ' . BOTS_TABLE . ' ' . $this->db->sql_build_array('INSERT', array(
+ 'bot_active' => 1,
+ 'bot_name' => (string) $bot_name,
+ 'user_id' => (int) $user_id,
+ 'bot_agent' => (string) $bot_agent,
+ 'bot_ip' => (string) $bot_ip,
+ ));
+
+ $this->sql_query($sql);
+ }
+ }
+
+ public function update_bots()
+ {
+ // Update bots
+ if (!function_exists('user_delete'))
+ {
+ include($this->phpbb_root_path . 'includes/functions_user.' . $this->php_ext);
+ }
+
+ $bots_updates = array(
+ // Bot Deletions
+ 'NG-Search [Bot]' => false,
+ 'Nutch/CVS [Bot]' => false,
+ 'OmniExplorer [Bot]' => false,
+ 'Seekport [Bot]' => false,
+ 'Synoo [Bot]' => false,
+ 'WiseNut [Bot]' => false,
+
+ // Bot Updates
+ // Bot name to bot user agent map
+ 'Baidu [Spider]' => 'Baiduspider',
+ 'Exabot [Bot]' => 'Exabot',
+ 'Voyager [Bot]' => 'voyager/',
+ 'W3C [Validator]' => 'W3C_Validator',
+ );
+
+ foreach ($bots_updates as $bot_name => $bot_agent)
+ {
+ $sql = 'SELECT user_id
+ FROM ' . USERS_TABLE . '
+ WHERE user_type = ' . USER_IGNORE . "
+ AND username_clean = '" . $this->db->sql_escape(utf8_clean_string($bot_name)) . "'";
+ $result = $this->db->sql_query($sql);
+ $bot_user_id = (int) $this->db->sql_fetchfield('user_id');
+ $this->db->sql_freeresult($result);
+
+ if ($bot_user_id)
+ {
+ if ($bot_agent === false)
+ {
+ $sql = 'DELETE FROM ' . BOTS_TABLE . "
+ WHERE user_id = $bot_user_id";
+ $this->sql_query($sql);
+
+ user_delete('retain', $bot_user_id);
+ }
+ else
+ {
+ $sql = 'UPDATE ' . BOTS_TABLE . "
+ SET bot_agent = '" . $this->db->sql_escape($bot_agent) . "'
+ WHERE user_id = $bot_user_id";
+ $this->sql_query($sql);
+ }
+ }
+ }
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v310/captcha_plugins.php b/phpBB/phpbb/db/migration/data/v310/captcha_plugins.php
new file mode 100644
index 0000000000..328c08f1ec
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/captcha_plugins.php
@@ -0,0 +1,48 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v310;
+
+class captcha_plugins extends \phpbb\db\migration\migration
+{
+ static public function depends_on()
+ {
+ return array(
+ '\phpbb\db\migration\data\v310\rc2',
+ );
+ }
+
+ public function update_data()
+ {
+ $captcha_plugin = $this->config['captcha_plugin'];
+ if (strpos($captcha_plugin, 'phpbb_captcha_') === 0)
+ {
+ $captcha_plugin = substr($captcha_plugin, strlen('phpbb_captcha_'));
+ }
+ else if (strpos($captcha_plugin, 'phpbb_') === 0)
+ {
+ $captcha_plugin = substr($captcha_plugin, strlen('phpbb_'));
+ }
+
+ return array(
+ array('if', array(
+ (is_file($this->phpbb_root_path . 'phpbb/captcha/plugins/' . $captcha_plugin . '.' . $this->php_ext)),
+ array('config.update', array('captcha_plugin', 'core.captcha.plugins.' . $captcha_plugin)),
+ )),
+ array('if', array(
+ (!is_file($this->phpbb_root_path . 'phpbb/captcha/plugins/' . $captcha_plugin . '.' . $this->php_ext)),
+ array('config.update', array('captcha_plugin', 'core.captcha.plugins.nogd')),
+ )),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v310/config_db_text.php b/phpBB/phpbb/db/migration/data/v310/config_db_text.php
new file mode 100644
index 0000000000..438883c438
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/config_db_text.php
@@ -0,0 +1,51 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v310;
+
+class config_db_text extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return $this->db_tools->sql_table_exists($this->table_prefix . 'config_text');
+ }
+
+ static public function depends_on()
+ {
+ return array('\phpbb\db\migration\data\v30x\release_3_0_11');
+ }
+
+ public function update_schema()
+ {
+ return array(
+ 'add_tables' => array(
+ $this->table_prefix . 'config_text' => array(
+ 'COLUMNS' => array(
+ 'config_name' => array('VCHAR', ''),
+ 'config_value' => array('MTEXT', ''),
+ ),
+ 'PRIMARY_KEY' => 'config_name',
+ ),
+ ),
+ );
+ }
+
+ public function revert_schema()
+ {
+ return array(
+ 'drop_tables' => array(
+ $this->table_prefix . 'config_text',
+ ),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v310/contact_admin_acp_module.php b/phpBB/phpbb/db/migration/data/v310/contact_admin_acp_module.php
new file mode 100644
index 0000000000..20bd547ac3
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/contact_admin_acp_module.php
@@ -0,0 +1,31 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v310;
+
+class contact_admin_acp_module extends \phpbb\db\migration\migration
+{
+ public function update_data()
+ {
+ return array(
+ array('module.add', array(
+ 'acp',
+ 'ACP_BOARD_CONFIGURATION',
+ array(
+ 'module_basename' => 'acp_contact',
+ 'modes' => array('contact'),
+ ),
+ )),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v310/contact_admin_form.php b/phpBB/phpbb/db/migration/data/v310/contact_admin_form.php
new file mode 100644
index 0000000000..5736369f1a
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/contact_admin_form.php
@@ -0,0 +1,46 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v310;
+
+class contact_admin_form extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return isset($this->config['contact_admin_form_enable']);
+ }
+
+ static public function depends_on()
+ {
+ return array('\phpbb\db\migration\data\v310\config_db_text');
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('config.add', array('contact_admin_form_enable', 1)),
+ array('custom', array(array($this, 'contact_admin_info'))),
+ );
+ }
+
+ public function contact_admin_info()
+ {
+ $text_config = new \phpbb\config\db_text($this->db, $this->table_prefix . 'config_text');
+ $text_config->set_array(array(
+ 'contact_admin_info' => '',
+ 'contact_admin_info_uid' => '',
+ 'contact_admin_info_bitfield' => '',
+ 'contact_admin_info_flags' => OPTION_FLAG_BBCODE + OPTION_FLAG_SMILIES + OPTION_FLAG_LINKS,
+ ));
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v310/dev.php b/phpBB/phpbb/db/migration/data/v310/dev.php
new file mode 100644
index 0000000000..f037191c2a
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/dev.php
@@ -0,0 +1,415 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v310;
+
+class dev extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return version_compare($this->config['version'], '3.1.0-dev', '>=');
+ }
+
+ static public function depends_on()
+ {
+ return array(
+ '\phpbb\db\migration\data\v310\extensions',
+ '\phpbb\db\migration\data\v310\style_update_p2',
+ '\phpbb\db\migration\data\v310\timezone_p2',
+ '\phpbb\db\migration\data\v310\reported_posts_display',
+ '\phpbb\db\migration\data\v310\migrations_table',
+ );
+ }
+
+ public function update_schema()
+ {
+ return array(
+ 'add_columns' => array(
+ $this->table_prefix . 'groups' => array(
+ 'group_teampage' => array('UINT', 0, 'after' => 'group_legend'),
+ ),
+ $this->table_prefix . 'profile_fields' => array(
+ 'field_show_on_pm' => array('BOOL', 0),
+ ),
+ $this->table_prefix . 'styles' => array(
+ 'style_path' => array('VCHAR:100', ''),
+ 'bbcode_bitfield' => array('VCHAR:255', 'kNg='),
+ 'style_parent_id' => array('UINT:4', 0),
+ 'style_parent_tree' => array('TEXT', ''),
+ ),
+ $this->table_prefix . 'reports' => array(
+ 'reported_post_text' => array('MTEXT_UNI', ''),
+ 'reported_post_uid' => array('VCHAR:8', ''),
+ 'reported_post_bitfield' => array('VCHAR:255', ''),
+ ),
+ ),
+ 'change_columns' => array(
+ $this->table_prefix . 'groups' => array(
+ 'group_legend' => array('UINT', 0),
+ ),
+ ),
+ );
+ }
+
+ public function revert_schema()
+ {
+ return array(
+ 'drop_columns' => array(
+ $this->table_prefix . 'groups' => array(
+ 'group_teampage',
+ ),
+ $this->table_prefix . 'profile_fields' => array(
+ 'field_show_on_pm',
+ ),
+ $this->table_prefix . 'styles' => array(
+ 'style_path',
+ 'bbcode_bitfield',
+ 'style_parent_id',
+ 'style_parent_tree',
+ ),
+ $this->table_prefix . 'reports' => array(
+ 'reported_post_text',
+ 'reported_post_uid',
+ 'reported_post_bitfield',
+ ),
+ ),
+ );
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('if', array(
+ (strpos('phpbb_search_', $this->config['search_type']) !== 0),
+ array('config.update', array('search_type', 'phpbb_search_' . $this->config['search_type'])),
+ )),
+
+ array('config.add', array('fulltext_postgres_ts_name', 'simple')),
+ array('config.add', array('fulltext_postgres_min_word_len', 4)),
+ array('config.add', array('fulltext_postgres_max_word_len', 254)),
+ array('config.add', array('fulltext_sphinx_stopwords', 0)),
+ array('config.add', array('fulltext_sphinx_indexer_mem_limit', 512)),
+
+ array('config.add', array('load_jquery_cdn', 0)),
+ array('config.add', array('load_jquery_url', '//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js')),
+
+ array('config.add', array('use_system_cron', 0)),
+
+ array('config.add', array('legend_sort_groupname', 0)),
+ array('config.add', array('teampage_forums', 1)),
+ array('config.add', array('teampage_memberships', 1)),
+
+ array('config.add', array('load_cpf_pm', 0)),
+
+ array('config.add', array('display_last_subject', 1)),
+
+ array('config.add', array('assets_version', 1)),
+
+ array('config.add', array('site_home_url', '')),
+ array('config.add', array('site_home_text', '')),
+
+ array('permission.add', array('u_chgprofileinfo', true, 'u_sig')),
+
+ array('module.add', array(
+ 'acp',
+ 'ACP_GROUPS',
+ array(
+ 'module_basename' => 'acp_groups',
+ 'modes' => array('position'),
+ ),
+ )),
+ array('module.add', array(
+ 'acp',
+ 'ACP_ATTACHMENTS',
+ array(
+ 'module_basename' => 'acp_attachments',
+ 'modes' => array('manage'),
+ ),
+ )),
+ array('module.add', array(
+ 'acp',
+ 'ACP_STYLE_MANAGEMENT',
+ array(
+ 'module_basename' => 'acp_styles',
+ 'modes' => array('install', 'cache'),
+ ),
+ )),
+ array('module.add', array(
+ 'ucp',
+ 'UCP_PROFILE',
+ array(
+ 'module_basename' => 'ucp_profile',
+ 'modes' => array('autologin_keys'),
+ ),
+ )),
+ // Module will be renamed later
+ array('module.add', array(
+ 'acp',
+ 'ACP_CAT_STYLES',
+ 'ACP_LANGUAGE'
+ )),
+
+ array('module.remove', array(
+ 'acp',
+ false,
+ 'ACP_TEMPLATES',
+ )),
+ array('module.remove', array(
+ 'acp',
+ false,
+ 'ACP_THEMES',
+ )),
+ array('module.remove', array(
+ 'acp',
+ false,
+ 'ACP_IMAGESETS',
+ )),
+
+ array('custom', array(array($this, 'rename_module_basenames'))),
+ array('custom', array(array($this, 'rename_styles_module'))),
+ array('custom', array(array($this, 'add_group_teampage'))),
+ array('custom', array(array($this, 'update_group_legend'))),
+ array('custom', array(array($this, 'localise_global_announcements'))),
+ array('custom', array(array($this, 'update_ucp_pm_basename'))),
+ array('custom', array(array($this, 'update_ucp_profile_auth'))),
+ array('custom', array(array($this, 'move_customise_modules'))),
+
+ array('config.update', array('version', '3.1.0-dev')),
+ );
+ }
+
+ public function move_customise_modules()
+ {
+ // Move language management to new location in the Customise tab
+ // First get language module id
+ $sql = 'SELECT module_id FROM ' . MODULES_TABLE . "
+ WHERE module_basename = 'acp_language'";
+ $result = $this->db->sql_query($sql);
+ $language_module_id = $this->db->sql_fetchfield('module_id');
+ $this->db->sql_freeresult($result);
+ // Next get language management module id of the one just created
+ $sql = 'SELECT module_id FROM ' . MODULES_TABLE . "
+ WHERE module_langname = 'ACP_LANGUAGE'";
+ $result = $this->db->sql_query($sql);
+ $language_management_module_id = $this->db->sql_fetchfield('module_id');
+ $this->db->sql_freeresult($result);
+
+ if (!class_exists('acp_modules'))
+ {
+ include($this->phpbb_root_path . 'includes/acp/acp_modules.' . $this->php_ext);
+ }
+ // acp_modules calls adm_back_link, which is undefined at this point
+ if (!function_exists('adm_back_link'))
+ {
+ include($this->phpbb_root_path . 'includes/functions_acp.' . $this->php_ext);
+ }
+ $module_manager = new \acp_modules();
+ $module_manager->module_class = 'acp';
+ $module_manager->move_module($language_module_id, $language_management_module_id);
+ }
+
+ public function update_ucp_pm_basename()
+ {
+ $sql = 'SELECT module_id, module_basename
+ FROM ' . MODULES_TABLE . "
+ WHERE module_basename <> 'ucp_pm' AND
+ module_langname='UCP_PM'";
+ $result = $this->db->sql_query_limit($sql, 1);
+
+ if ($row = $this->db->sql_fetchrow($result))
+ {
+ // This update is still not applied. Applying it
+
+ $sql = 'UPDATE ' . MODULES_TABLE . "
+ SET module_basename = 'ucp_pm'
+ WHERE module_id = " . (int) $row['module_id'];
+
+ $this->sql_query($sql);
+ }
+ $this->db->sql_freeresult($result);
+ }
+
+ public function update_ucp_profile_auth()
+ {
+ // Update the auth setting for the module
+ $sql = 'UPDATE ' . MODULES_TABLE . "
+ SET module_auth = 'acl_u_chgprofileinfo'
+ WHERE module_class = 'ucp'
+ AND module_basename = 'ucp_profile'
+ AND module_mode = 'profile_info'";
+ $this->sql_query($sql);
+ }
+
+ public function rename_styles_module()
+ {
+ // Rename styles module to Customise
+ $sql = 'UPDATE ' . MODULES_TABLE . "
+ SET module_langname = 'ACP_CAT_CUSTOMISE'
+ WHERE module_langname = 'ACP_CAT_STYLES'";
+ $this->sql_query($sql);
+ }
+
+ public function rename_module_basenames()
+ {
+ // rename all module basenames to full classname
+ $sql = 'SELECT module_id, module_basename, module_class
+ FROM ' . MODULES_TABLE;
+ $result = $this->db->sql_query($sql);
+
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $module_id = (int) $row['module_id'];
+ unset($row['module_id']);
+
+ if (!empty($row['module_basename']) && !empty($row['module_class']))
+ {
+ // all the class names start with class name or with phpbb_ for auto loading
+ if (strpos($row['module_basename'], $row['module_class'] . '_') !== 0 &&
+ strpos($row['module_basename'], 'phpbb_') !== 0)
+ {
+ $row['module_basename'] = $row['module_class'] . '_' . $row['module_basename'];
+
+ $sql_update = $this->db->sql_build_array('UPDATE', $row);
+
+ $sql = 'UPDATE ' . MODULES_TABLE . '
+ SET ' . $sql_update . '
+ WHERE module_id = ' . $module_id;
+ $this->sql_query($sql);
+ }
+ }
+ }
+
+ $this->db->sql_freeresult($result);
+ }
+
+ public function add_group_teampage()
+ {
+ $sql = 'UPDATE ' . GROUPS_TABLE . '
+ SET group_teampage = 1
+ WHERE group_type = ' . GROUP_SPECIAL . "
+ AND group_name = 'ADMINISTRATORS'";
+ $this->sql_query($sql);
+
+ $sql = 'UPDATE ' . GROUPS_TABLE . '
+ SET group_teampage = 2
+ WHERE group_type = ' . GROUP_SPECIAL . "
+ AND group_name = 'GLOBAL_MODERATORS'";
+ $this->sql_query($sql);
+ }
+
+ public function update_group_legend()
+ {
+ $sql = 'SELECT group_id
+ FROM ' . GROUPS_TABLE . '
+ WHERE group_legend = 1
+ ORDER BY group_name ASC';
+ $result = $this->db->sql_query($sql);
+
+ $next_legend = 1;
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $sql = 'UPDATE ' . GROUPS_TABLE . '
+ SET group_legend = ' . $next_legend . '
+ WHERE group_id = ' . (int) $row['group_id'];
+ $this->sql_query($sql);
+
+ $next_legend++;
+ }
+ $this->db->sql_freeresult($result);
+ }
+
+ public function localise_global_announcements()
+ {
+ // Localise Global Announcements
+ $sql = 'SELECT topic_id, topic_approved, (topic_replies + 1) AS topic_posts, topic_last_post_id, topic_last_post_subject, topic_last_post_time, topic_last_poster_id, topic_last_poster_name, topic_last_poster_colour
+ FROM ' . TOPICS_TABLE . '
+ WHERE forum_id = 0
+ AND topic_type = ' . POST_GLOBAL;
+ $result = $this->db->sql_query($sql);
+
+ $global_announcements = $update_lastpost_data = array();
+ $update_lastpost_data['forum_last_post_time'] = 0;
+ $update_forum_data = array(
+ 'forum_posts' => 0,
+ 'forum_topics' => 0,
+ 'forum_topics_real' => 0,
+ );
+
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $global_announcements[] = (int) $row['topic_id'];
+
+ $update_forum_data['forum_posts'] += (int) $row['topic_posts'];
+ $update_forum_data['forum_topics_real']++;
+ if ($row['topic_approved'])
+ {
+ $update_forum_data['forum_topics']++;
+ }
+
+ if ($update_lastpost_data['forum_last_post_time'] < $row['topic_last_post_time'])
+ {
+ $update_lastpost_data = array(
+ 'forum_last_post_id' => (int) $row['topic_last_post_id'],
+ 'forum_last_post_subject' => $row['topic_last_post_subject'],
+ 'forum_last_post_time' => (int) $row['topic_last_post_time'],
+ 'forum_last_poster_id' => (int) $row['topic_last_poster_id'],
+ 'forum_last_poster_name' => $row['topic_last_poster_name'],
+ 'forum_last_poster_colour' => $row['topic_last_poster_colour'],
+ );
+ }
+ }
+ $this->db->sql_freeresult($result);
+
+ if (!empty($global_announcements))
+ {
+ // Update the post/topic-count for the forum and the last-post if needed
+ $sql = 'SELECT forum_id
+ FROM ' . FORUMS_TABLE . '
+ WHERE forum_type = ' . FORUM_POST;
+ $result = $this->db->sql_query_limit($sql, 1);
+ $ga_forum_id = $this->db->sql_fetchfield('forum_id');
+ $this->db->sql_freeresult($result);
+
+ $sql = 'SELECT forum_last_post_time
+ FROM ' . FORUMS_TABLE . '
+ WHERE forum_id = ' . $ga_forum_id;
+ $result = $this->db->sql_query($sql);
+ $lastpost = (int) $this->db->sql_fetchfield('forum_last_post_time');
+ $this->db->sql_freeresult($result);
+
+ $sql_update = 'forum_posts = forum_posts + ' . $update_forum_data['forum_posts'] . ', ';
+ $sql_update .= 'forum_topics_real = forum_topics_real + ' . $update_forum_data['forum_topics_real'] . ', ';
+ $sql_update .= 'forum_topics = forum_topics + ' . $update_forum_data['forum_topics'];
+ if ($lastpost < $update_lastpost_data['forum_last_post_time'])
+ {
+ $sql_update .= ', ' . $this->db->sql_build_array('UPDATE', $update_lastpost_data);
+ }
+
+ $sql = 'UPDATE ' . FORUMS_TABLE . '
+ SET ' . $sql_update . '
+ WHERE forum_id = ' . $ga_forum_id;
+ $this->sql_query($sql);
+
+ // Update some forum_ids
+ $table_ary = array(TOPICS_TABLE, POSTS_TABLE, LOG_TABLE, DRAFTS_TABLE, TOPICS_TRACK_TABLE);
+ foreach ($table_ary as $table)
+ {
+ $sql = "UPDATE $table
+ SET forum_id = $ga_forum_id
+ WHERE " . $this->db->sql_in_set('topic_id', $global_announcements);
+ $this->sql_query($sql);
+ }
+ unset($table_ary);
+ }
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v310/extensions.php b/phpBB/phpbb/db/migration/data/v310/extensions.php
new file mode 100644
index 0000000000..3171435482
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/extensions.php
@@ -0,0 +1,75 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v310;
+
+class extensions extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return $this->db_tools->sql_table_exists($this->table_prefix . 'ext');
+ }
+
+ static public function depends_on()
+ {
+ return array('\phpbb\db\migration\data\v30x\release_3_0_11');
+ }
+
+ public function update_schema()
+ {
+ return array(
+ 'add_tables' => array(
+ $this->table_prefix . 'ext' => array(
+ 'COLUMNS' => array(
+ 'ext_name' => array('VCHAR', ''),
+ 'ext_active' => array('BOOL', 0),
+ 'ext_state' => array('TEXT', ''),
+ ),
+ 'KEYS' => array(
+ 'ext_name' => array('UNIQUE', 'ext_name'),
+ ),
+ ),
+ ),
+ );
+ }
+
+ public function revert_schema()
+ {
+ return array(
+ 'drop_tables' => array(
+ $this->table_prefix . 'ext',
+ ),
+ );
+ }
+
+ public function update_data()
+ {
+ return array(
+ // Module will be renamed later
+ array('module.add', array(
+ 'acp',
+ 'ACP_CAT_STYLES',
+ 'ACP_EXTENSION_MANAGEMENT'
+ )),
+ array('module.add', array(
+ 'acp',
+ 'ACP_EXTENSION_MANAGEMENT',
+ array(
+ 'module_basename' => 'acp_extensions',
+ 'modes' => array('main'),
+ ),
+ )),
+ array('permission.add', array('a_extensions', true, 'a_styles')),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v310/extensions_version_check_force_unstable.php b/phpBB/phpbb/db/migration/data/v310/extensions_version_check_force_unstable.php
new file mode 100644
index 0000000000..1d6276f484
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/extensions_version_check_force_unstable.php
@@ -0,0 +1,29 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v310;
+
+class extensions_version_check_force_unstable extends \phpbb\db\migration\migration
+{
+ static public function depends_on()
+ {
+ return array('\phpbb\db\migration\data\v310\dev');
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('config.add', array('extension_force_unstable', false)),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v310/forgot_password.php b/phpBB/phpbb/db/migration/data/v310/forgot_password.php
new file mode 100644
index 0000000000..362457cf23
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/forgot_password.php
@@ -0,0 +1,34 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v310;
+
+class forgot_password extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return isset($this->config['allow_password_reset']);
+ }
+
+ static public function depends_on()
+ {
+ return array('\phpbb\db\migration\data\v30x\release_3_0_11');
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('config.add', array('allow_password_reset', 1)),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v310/gold.php b/phpBB/phpbb/db/migration/data/v310/gold.php
new file mode 100644
index 0000000000..188851f87d
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/gold.php
@@ -0,0 +1,37 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v310;
+
+class gold extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.1.0', '>=');
+ }
+
+ static public function depends_on()
+ {
+ return array(
+ '\phpbb\db\migration\data\v310\rc6',
+ '\phpbb\db\migration\data\v310\bot_update',
+ );
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('config.update', array('version', '3.1.0')),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v310/jquery_update.php b/phpBB/phpbb/db/migration/data/v310/jquery_update.php
new file mode 100644
index 0000000000..8011331e80
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/jquery_update.php
@@ -0,0 +1,37 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v310;
+
+class jquery_update extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return $this->config['load_jquery_url'] !== '//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js';
+ }
+
+ static public function depends_on()
+ {
+ return array(
+ '\phpbb\db\migration\data\v310\dev',
+ );
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('config.update', array('load_jquery_url', '//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js')),
+ );
+ }
+
+}
diff --git a/phpBB/phpbb/db/migration/data/v310/jquery_update2.php b/phpBB/phpbb/db/migration/data/v310/jquery_update2.php
new file mode 100644
index 0000000000..4061be5940
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/jquery_update2.php
@@ -0,0 +1,37 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v310;
+
+class jquery_update2 extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return $this->config['load_jquery_url'] !== '//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js';
+ }
+
+ static public function depends_on()
+ {
+ return array(
+ '\phpbb\db\migration\data\v310\jquery_update',
+ );
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('config.update', array('load_jquery_url', '//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js')),
+ );
+ }
+
+}
diff --git a/phpBB/phpbb/db/migration/data/v310/live_searches_config.php b/phpBB/phpbb/db/migration/data/v310/live_searches_config.php
new file mode 100644
index 0000000000..3d87e04ac2
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/live_searches_config.php
@@ -0,0 +1,29 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v310;
+
+class live_searches_config extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return isset($this->config['allow_live_searches']);
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('config.add', array('allow_live_searches', '1')),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v310/migrations_table.php b/phpBB/phpbb/db/migration/data/v310/migrations_table.php
new file mode 100644
index 0000000000..48508b05c2
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/migrations_table.php
@@ -0,0 +1,51 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v310;
+
+class migrations_table extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return $this->db_tools->sql_table_exists($this->table_prefix . 'migrations');
+ }
+
+ public function update_schema()
+ {
+ return array(
+ 'add_tables' => array(
+ $this->table_prefix . 'migrations' => array(
+ 'COLUMNS' => array(
+ 'migration_name' => array('VCHAR', ''),
+ 'migration_depends_on' => array('TEXT', ''),
+ 'migration_schema_done' => array('BOOL', 0),
+ 'migration_data_done' => array('BOOL', 0),
+ 'migration_data_state' => array('TEXT', ''),
+ 'migration_start_time' => array('TIMESTAMP', 0),
+ 'migration_end_time' => array('TIMESTAMP', 0),
+ ),
+ 'PRIMARY_KEY' => 'migration_name',
+ ),
+ ),
+ );
+ }
+
+ public function revert_schema()
+ {
+ return array(
+ 'drop_tables' => array(
+ $this->table_prefix . 'migrations',
+ ),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v310/mod_rewrite.php b/phpBB/phpbb/db/migration/data/v310/mod_rewrite.php
new file mode 100644
index 0000000000..85e479db59
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/mod_rewrite.php
@@ -0,0 +1,31 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v310;
+
+class mod_rewrite extends \phpbb\db\migration\migration
+{
+ static public function depends_on()
+ {
+ return array(
+ '\phpbb\db\migration\data\v310\dev',
+ );
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('config.add', array('enable_mod_rewrite', '0')),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v310/mysql_fulltext_drop.php b/phpBB/phpbb/db/migration/data/v310/mysql_fulltext_drop.php
new file mode 100644
index 0000000000..e04a705c91
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/mysql_fulltext_drop.php
@@ -0,0 +1,80 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v310;
+
+class mysql_fulltext_drop extends \phpbb\db\migration\migration
+{
+ protected $indexes;
+
+ public function effectively_installed()
+ {
+ // This migration is irrelevant for all non-MySQL DBMSes.
+ if (strpos($this->db->get_sql_layer(), 'mysql') === false)
+ {
+ return true;
+ }
+
+ $this->find_indexes_to_drop();
+ return empty($this->indexes);
+ }
+
+ static public function depends_on()
+ {
+ return array(
+ '\phpbb\db\migration\data\v310\dev',
+ );
+ }
+
+ public function update_schema()
+ {
+ if (empty($this->indexes))
+ {
+ return array();
+ }
+
+ /*
+ * Drop FULLTEXT indexes related to MySQL fulltext search.
+ * Doing so is equivalent to dropping the search index from the ACP.
+ * Possibly time-consuming recreation of the search index (i.e.
+ * FULLTEXT indexes) is left as a task to the admin to not
+ * unnecessarily stall the upgrade process. The new search index will
+ * then require about 40% less table space (also see PHPBB3-11621).
+ */
+ return array(
+ 'drop_keys' => array(
+ $this->table_prefix . 'posts' => $this->indexes,
+ ),
+ );
+ }
+
+ public function find_indexes_to_drop()
+ {
+ if ($this->indexes !== null)
+ {
+ return $this->indexes;
+ }
+
+ $this->indexes = array();
+ $potential_keys = array('post_subject', 'post_text', 'post_content');
+ foreach ($potential_keys as $key)
+ {
+ if ($this->db_tools->sql_index_exists($this->table_prefix . 'posts', $key))
+ {
+ $this->indexes[] = $key;
+ }
+ }
+
+ return $this->indexes;
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v310/namespaces.php b/phpBB/phpbb/db/migration/data/v310/namespaces.php
new file mode 100644
index 0000000000..2a4935395e
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/namespaces.php
@@ -0,0 +1,34 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v310;
+
+class namespaces extends \phpbb\db\migration\migration
+{
+ static public function depends_on()
+ {
+ return array(
+ '\phpbb\db\migration\data\v310\dev',
+ );
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('if', array(
+ (preg_match('#^phpbb_search_#', $this->config['search_type'])),
+ array('config.update', array('search_type', str_replace('phpbb_search_', '\\phpbb\\search\\', $this->config['search_type']))),
+ )),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v310/notification_options_reconvert.php b/phpBB/phpbb/db/migration/data/v310/notification_options_reconvert.php
new file mode 100644
index 0000000000..d43d432dd9
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/notification_options_reconvert.php
@@ -0,0 +1,142 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v310;
+
+class notification_options_reconvert extends \phpbb\db\migration\migration
+{
+ static public function depends_on()
+ {
+ return array('\phpbb\db\migration\data\v310\notifications_schema_fix');
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('custom', array(array($this, 'purge_notifications'))),
+ array('custom', array(array($this, 'convert_notifications'))),
+ );
+ }
+
+ public function purge_notifications()
+ {
+ $sql = 'DELETE FROM ' . $this->table_prefix . 'user_notifications';
+ $this->sql_query($sql);
+ }
+
+ public function convert_notifications($start)
+ {
+ $insert_buffer = new \phpbb\db\sql_insert_buffer($this->db, $this->table_prefix . 'user_notifications');
+
+ return $this->perform_conversion($insert_buffer, $start);
+ }
+
+ /**
+ * Perform the conversion (separate for testability)
+ *
+ * @param \phpbb\db\sql_insert_buffer $insert_buffer
+ * @param int $start Start of staggering step
+ * @return mixed int start of the next step, null if the end was reached
+ */
+ public function perform_conversion(\phpbb\db\sql_insert_buffer $insert_buffer, $start)
+ {
+ $limit = 250;
+ $converted_users = 0;
+ $start = $start ?: 0;
+
+ $sql = 'SELECT user_id, user_notify_type, user_notify_pm
+ FROM ' . $this->table_prefix . 'users
+ ORDER BY user_id';
+ $result = $this->db->sql_query_limit($sql, $limit, $start);
+
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $converted_users++;
+ $notification_methods = array();
+
+ // In-board notification
+ $notification_methods[] = '';
+
+ if ($row['user_notify_type'] == NOTIFY_EMAIL || $row['user_notify_type'] == NOTIFY_BOTH)
+ {
+ $notification_methods[] = 'email';
+ }
+
+ if ($row['user_notify_type'] == NOTIFY_IM || $row['user_notify_type'] == NOTIFY_BOTH)
+ {
+ $notification_methods[] = 'jabber';
+ }
+
+ // Notifications for posts
+ foreach (array('post', 'topic') as $item_type)
+ {
+ $this->add_method_rows(
+ $insert_buffer,
+ $item_type,
+ 0,
+ $row['user_id'],
+ $notification_methods
+ );
+ }
+
+ if ($row['user_notify_pm'])
+ {
+ // Notifications for private messages
+ // User either gets all methods or no method
+ $this->add_method_rows(
+ $insert_buffer,
+ 'pm',
+ 0,
+ $row['user_id'],
+ $notification_methods
+ );
+ }
+ }
+ $this->db->sql_freeresult($result);
+
+ $insert_buffer->flush();
+
+ if ($converted_users < $limit)
+ {
+ // No more users left, we are done...
+ return;
+ }
+
+ return $start + $limit;
+ }
+
+ /**
+ * Insert method rows to DB
+ *
+ * @param \phpbb\db\sql_insert_buffer $insert_buffer
+ * @param string $item_type
+ * @param int $item_id
+ * @param int $user_id
+ * @param string $methods
+ */
+ protected function add_method_rows(\phpbb\db\sql_insert_buffer $insert_buffer, $item_type, $item_id, $user_id, array $methods)
+ {
+ $row_base = array(
+ 'item_type' => $item_type,
+ 'item_id' => (int) $item_id,
+ 'user_id' => (int) $user_id,
+ 'notify' => 1
+ );
+
+ foreach ($methods as $method)
+ {
+ $row_base['method'] = $method;
+ $insert_buffer->insert($row_base);
+ }
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v310/notifications.php b/phpBB/phpbb/db/migration/data/v310/notifications.php
new file mode 100644
index 0000000000..f4d012b5ac
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/notifications.php
@@ -0,0 +1,102 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v310;
+
+class notifications extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return $this->db_tools->sql_table_exists($this->table_prefix . 'notifications');
+ }
+
+ static public function depends_on()
+ {
+ return array('\phpbb\db\migration\data\v310\dev');
+ }
+
+ public function update_schema()
+ {
+ return array(
+ 'add_tables' => array(
+ $this->table_prefix . 'notification_types' => array(
+ 'COLUMNS' => array(
+ 'notification_type' => array('VCHAR:255', ''),
+ 'notification_type_enabled' => array('BOOL', 1),
+ ),
+ 'PRIMARY_KEY' => array('notification_type', 'notification_type_enabled'),
+ ),
+ $this->table_prefix . 'notifications' => array(
+ 'COLUMNS' => array(
+ 'notification_id' => array('UINT', null, 'auto_increment'),
+ 'item_type' => array('VCHAR:255', ''),
+ 'item_id' => array('UINT', 0),
+ 'item_parent_id' => array('UINT', 0),
+ 'user_id' => array('UINT', 0),
+ 'notification_read' => array('BOOL', 0),
+ 'notification_time' => array('TIMESTAMP', 1),
+ 'notification_data' => array('TEXT_UNI', ''),
+ ),
+ 'PRIMARY_KEY' => 'notification_id',
+ 'KEYS' => array(
+ 'item_ident' => array('INDEX', array('item_type', 'item_id')),
+ 'user' => array('INDEX', array('user_id', 'notification_read')),
+ ),
+ ),
+ $this->table_prefix . 'user_notifications' => array(
+ 'COLUMNS' => array(
+ 'item_type' => array('VCHAR:255', ''),
+ 'item_id' => array('UINT', 0),
+ 'user_id' => array('UINT', 0),
+ 'method' => array('VCHAR:255', ''),
+ 'notify' => array('BOOL', 1),
+ ),
+ ),
+ ),
+ );
+ }
+
+ public function revert_schema()
+ {
+ return array(
+ 'drop_tables' => array(
+ $this->table_prefix . 'notification_types',
+ $this->table_prefix . 'notifications',
+ $this->table_prefix . 'user_notifications',
+ ),
+ );
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('module.add', array(
+ 'ucp',
+ 'UCP_MAIN',
+ array(
+ 'module_basename' => 'ucp_notifications',
+ 'modes' => array('notification_list'),
+ ),
+ )),
+ array('module.add', array(
+ 'ucp',
+ 'UCP_PREFS',
+ array(
+ 'module_basename' => 'ucp_notifications',
+ 'modes' => array('notification_options'),
+ ),
+ )),
+ array('config.add', array('load_notifications', 1)),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v310/notifications_cron.php b/phpBB/phpbb/db/migration/data/v310/notifications_cron.php
new file mode 100644
index 0000000000..ba600f7bf5
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/notifications_cron.php
@@ -0,0 +1,31 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v310;
+
+class notifications_cron extends \phpbb\db\migration\migration
+{
+ static public function depends_on()
+ {
+ return array('\phpbb\db\migration\data\v310\notifications');
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('config.add', array('read_notification_expire_days', 30)),
+ array('config.add', array('read_notification_last_gc', 0)), // last run
+ array('config.add', array('read_notification_gc', (60 * 60 * 24))), // seconds between run; 1 day
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v310/notifications_cron_p2.php b/phpBB/phpbb/db/migration/data/v310/notifications_cron_p2.php
new file mode 100644
index 0000000000..263584b343
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/notifications_cron_p2.php
@@ -0,0 +1,31 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v310;
+
+class notifications_cron_p2 extends \phpbb\db\migration\migration
+{
+ static public function depends_on()
+ {
+ return array('\phpbb\db\migration\data\v310\notifications_cron');
+ }
+
+ public function update_data()
+ {
+ return array(
+ // Make read_notification_last_gc dynamic.
+ array('config.remove', array('read_notification_last_gc')),
+ array('config.add', array('read_notification_last_gc', 0, 1)),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v310/notifications_schema_fix.php b/phpBB/phpbb/db/migration/data/v310/notifications_schema_fix.php
new file mode 100644
index 0000000000..21a39a7c91
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/notifications_schema_fix.php
@@ -0,0 +1,98 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v310;
+
+class notifications_schema_fix extends \phpbb\db\migration\migration
+{
+ static public function depends_on()
+ {
+ return array('\phpbb\db\migration\data\v310\notifications');
+ }
+
+ public function update_schema()
+ {
+ return array(
+ 'drop_tables' => array(
+ $this->table_prefix . 'notification_types',
+ $this->table_prefix . 'notifications',
+ ),
+ 'add_tables' => array(
+ $this->table_prefix . 'notification_types' => array(
+ 'COLUMNS' => array(
+ 'notification_type_id' => array('USINT', null, 'auto_increment'),
+ 'notification_type_name' => array('VCHAR:255', ''),
+ 'notification_type_enabled' => array('BOOL', 1),
+ ),
+ 'PRIMARY_KEY' => array('notification_type_id'),
+ 'KEYS' => array(
+ 'type' => array('UNIQUE', array('notification_type_name')),
+ ),
+ ),
+ $this->table_prefix . 'notifications' => array(
+ 'COLUMNS' => array(
+ 'notification_id' => array('UINT:10', null, 'auto_increment'),
+ 'notification_type_id' => array('USINT', 0),
+ 'item_id' => array('UINT', 0),
+ 'item_parent_id' => array('UINT', 0),
+ 'user_id' => array('UINT', 0),
+ 'notification_read' => array('BOOL', 0),
+ 'notification_time' => array('TIMESTAMP', 1),
+ 'notification_data' => array('TEXT_UNI', ''),
+ ),
+ 'PRIMARY_KEY' => 'notification_id',
+ 'KEYS' => array(
+ 'item_ident' => array('INDEX', array('notification_type_id', 'item_id')),
+ 'user' => array('INDEX', array('user_id', 'notification_read')),
+ ),
+ ),
+ ),
+ );
+ }
+
+ public function revert_schema()
+ {
+ return array(
+ 'drop_tables' => array(
+ $this->table_prefix . 'notification_types',
+ $this->table_prefix . 'notifications',
+ ),
+ 'add_tables' => array(
+ $this->table_prefix . 'notification_types' => array(
+ 'COLUMNS' => array(
+ 'notification_type' => array('VCHAR:255', ''),
+ 'notification_type_enabled' => array('BOOL', 1),
+ ),
+ 'PRIMARY_KEY' => array('notification_type', 'notification_type_enabled'),
+ ),
+ $this->table_prefix . 'notifications' => array(
+ 'COLUMNS' => array(
+ 'notification_id' => array('UINT', null, 'auto_increment'),
+ 'item_type' => array('VCHAR:255', ''),
+ 'item_id' => array('UINT', 0),
+ 'item_parent_id' => array('UINT', 0),
+ 'user_id' => array('UINT', 0),
+ 'notification_read' => array('BOOL', 0),
+ 'notification_time' => array('TIMESTAMP', 1),
+ 'notification_data' => array('TEXT_UNI', ''),
+ ),
+ 'PRIMARY_KEY' => 'notification_id',
+ 'KEYS' => array(
+ 'item_ident' => array('INDEX', array('item_type', 'item_id')),
+ 'user' => array('INDEX', array('user_id', 'notification_read')),
+ ),
+ ),
+ ),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v310/notifications_use_full_name.php b/phpBB/phpbb/db/migration/data/v310/notifications_use_full_name.php
new file mode 100644
index 0000000000..112c1e85e8
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/notifications_use_full_name.php
@@ -0,0 +1,184 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v310;
+
+class notifications_use_full_name extends \phpbb\db\migration\migration
+{
+ protected $notification_types = array(
+ 'admin_activate_user',
+ 'approve_post',
+ 'approve_topic',
+ 'bookmark',
+ 'disapprove_post',
+ 'disapprove_topic',
+ 'group_request',
+ 'group_request_approved',
+ 'pm',
+ 'post',
+ 'post_in_queue',
+ 'quote',
+ 'report_pm',
+ 'report_pm_closed',
+ 'report_post',
+ 'report_post_closed',
+ 'topic',
+ 'topic_in_queue');
+
+ protected $notification_methods = array(
+ 'email',
+ 'jabber',
+ );
+
+ static public function depends_on()
+ {
+ return array('\phpbb\db\migration\data\v310\rc3');
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('custom', array(array($this, 'update_notifications_name'))),
+ array('custom', array(array($this, 'update_notifications_method_name'))),
+ );
+ }
+
+ public function revert_data()
+ {
+ return array(
+ array('custom', array(array($this, 'revert_notifications_name'))),
+ array('custom', array(array($this, 'revert_notifications_method_name'))),
+ );
+ }
+
+ public function update_notifications_method_name()
+ {
+ foreach ($this->notification_methods as $notification_method)
+ {
+ $sql = 'UPDATE ' . USER_NOTIFICATIONS_TABLE . "
+ SET method = 'notification.method.{$notification_method}'
+ WHERE method = '{$notification_method}'";
+ $this->db->sql_query($sql);
+ }
+ }
+
+ public function revert_notifications_method_name()
+ {
+ foreach ($this->notification_methods as $notification_method)
+ {
+ $sql = 'UPDATE ' . USER_NOTIFICATIONS_TABLE . "
+ SET method = '{$notification_method}'
+ WHERE method = 'notification.method.{$notification_method}'";
+ $this->db->sql_query($sql);
+ }
+ }
+
+ public function update_notifications_name()
+ {
+ $sql = 'UPDATE ' . NOTIFICATION_TYPES_TABLE . '
+ SET notification_type_enabled = 0
+ WHERE ' . $this->db->sql_in_set('notification_type_name', $this->notification_types, true);
+ $this->db->sql_query($sql);
+
+ foreach ($this->notification_types as $notification_type)
+ {
+ $sql = 'SELECT notification_type_id
+ FROM ' . NOTIFICATION_TYPES_TABLE . "
+ WHERE notification_type_name = 'notification.type.{$notification_type}'";
+ $result = $this->db->sql_query($sql);
+ $new_type_id = (int) $this->db->sql_fetchfield('notification_type_id');
+ $this->db->sql_freeresult($result);
+
+ if ($new_type_id)
+ {
+ // New type name already exists,
+ // so we delete the old type and update the type id of existing entries.
+ $sql = 'SELECT notification_type_id
+ FROM ' . NOTIFICATION_TYPES_TABLE . "
+ WHERE notification_type_name = '{$notification_type}'";
+ $result = $this->db->sql_query($sql);
+ $old_type_id = (int) $this->db->sql_fetchfield('notification_type_id');
+ $this->db->sql_freeresult($result);
+
+ $sql = 'UPDATE ' . NOTIFICATIONS_TABLE . '
+ SET notification_type_id = ' . (int) $new_type_id . '
+ WHERE notification_type_id = ' . (int) $old_type_id;
+ $this->db->sql_query($sql);
+
+ $sql = 'DELETE FROM ' . NOTIFICATION_TYPES_TABLE . "
+ WHERE notification_type_name = '{$notification_type}'";
+ $this->db->sql_query($sql);
+ }
+ else
+ {
+ // Otherwise we just update the name
+ $sql = 'UPDATE ' . NOTIFICATION_TYPES_TABLE . "
+ SET notification_type_name = 'notification.type.{$notification_type}'
+ WHERE notification_type_name = '{$notification_type}'";
+ $this->db->sql_query($sql);
+ }
+
+ $sql = 'UPDATE ' . USER_NOTIFICATIONS_TABLE . "
+ SET item_type = 'notification.type.{$notification_type}'
+ WHERE item_type = '{$notification_type}'";
+ $this->db->sql_query($sql);
+ }
+ }
+
+ public function revert_notifications_name()
+ {
+ foreach ($this->notification_types as $notification_type)
+ {
+ $sql = 'SELECT notification_type_id
+ FROM ' . NOTIFICATION_TYPES_TABLE . "
+ WHERE notification_type_name = '{$notification_type}'";
+ $result = $this->db->sql_query($sql);
+ $new_type_id = (int) $this->db->sql_fetchfield('notification_type_id');
+ $this->db->sql_freeresult($result);
+
+ if ($new_type_id)
+ {
+ // New type name already exists,
+ // so we delete the old type and update the type id of existing entries.
+ $sql = 'SELECT notification_type_id
+ FROM ' . NOTIFICATION_TYPES_TABLE . "
+ WHERE notification_type_name = 'notification.type.{$notification_type}'";
+ $result = $this->db->sql_query($sql);
+ $old_type_id = (int) $this->db->sql_fetchfield('notification_type_id');
+ $this->db->sql_freeresult($result);
+
+ $sql = 'UPDATE ' . NOTIFICATIONS_TABLE . '
+ SET notification_type_id = ' . (int) $new_type_id . '
+ WHERE notification_type_id = ' . (int) $old_type_id;
+ $this->db->sql_query($sql);
+
+ $sql = 'DELETE FROM ' . NOTIFICATION_TYPES_TABLE . "
+ WHERE notification_type_name = 'notification.type.{$notification_type}'";
+ $this->db->sql_query($sql);
+ }
+ else
+ {
+ // Otherwise we just update the name
+ $sql = 'UPDATE ' . NOTIFICATION_TYPES_TABLE . "
+ SET notification_type_name = '{$notification_type}'
+ WHERE notification_type_name = 'notification.type.{$notification_type}'";
+ $this->db->sql_query($sql);
+ }
+
+ $sql = 'UPDATE ' . USER_NOTIFICATIONS_TABLE . "
+ SET item_type = '{$notification_type}'
+ WHERE item_type = 'notification.type.{$notification_type}'";
+ $this->db->sql_query($sql);
+ }
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v310/passwords.php b/phpBB/phpbb/db/migration/data/v310/passwords.php
new file mode 100644
index 0000000000..adee44147f
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/passwords.php
@@ -0,0 +1,50 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v310;
+
+class passwords extends \phpbb\db\migration\migration
+{
+ static public function depends_on()
+ {
+ return array('\phpbb\db\migration\data\v30x\release_3_0_11');
+ }
+
+ public function update_schema()
+ {
+ return array(
+ 'change_columns' => array(
+ $this->table_prefix . 'users' => array(
+ 'user_password' => array('VCHAR:255', ''),
+ ),
+ $this->table_prefix . 'forums' => array(
+ 'forum_password' => array('VCHAR:255', ''),
+ ),
+ ),
+ );
+ }
+
+ public function revert_schema()
+ {
+ return array(
+ 'change_columns' => array(
+ $this->table_prefix . 'users' => array(
+ 'user_password' => array('VCHAR:40', ''),
+ ),
+ $this->table_prefix . 'forums' => array(
+ 'forum_password' => array('VCHAR:40', ''),
+ ),
+ ),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v310/passwords_convert_p1.php b/phpBB/phpbb/db/migration/data/v310/passwords_convert_p1.php
new file mode 100644
index 0000000000..295f2d2a14
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/passwords_convert_p1.php
@@ -0,0 +1,81 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v310;
+
+class passwords_convert_p1 extends \phpbb\db\migration\migration
+{
+ static public function depends_on()
+ {
+ return array('\phpbb\db\migration\data\v310\passwords_p2');
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('custom', array(array($this, 'update_passwords'))),
+ );
+ }
+
+ public function update_passwords($start)
+ {
+ // Nothing to do if user_pass_convert column doesn't exist
+ if (!$this->db_tools->sql_column_exists($this->table_prefix . 'users', 'user_pass_convert'))
+ {
+ return;
+ }
+
+ $start = (int) $start;
+ $limit = 1000;
+ $converted_users = 0;
+
+ $sql = 'SELECT user_password, user_id
+ FROM ' . $this->table_prefix . 'users
+ WHERE user_pass_convert = 1
+ ORDER BY user_id';
+ $result = $this->db->sql_query_limit($sql, $limit, $start);
+
+ $update_users = array();
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $converted_users++;
+
+ $user_id = (int) $row['user_id'];
+ // Only prefix passwords without proper prefix
+ if (!isset($update_users[$user_id]) && !preg_match('#^\$([a-zA-Z0-9\\\]*?)\$#', $row['user_password']))
+ {
+ // Use $CP$ prefix for passwords that need to
+ // be converted and set pass convert to false.
+ $update_users[$user_id] = '$CP$' . $row['user_password'];
+ }
+ }
+ $this->db->sql_freeresult($result);
+
+ foreach ($update_users as $user_id => $user_password)
+ {
+ $sql = 'UPDATE ' . $this->table_prefix . "users
+ SET user_password = '" . $this->db->sql_escape($user_password) . "'
+ WHERE user_id = $user_id";
+ $this->sql_query($sql);
+ }
+
+ if ($converted_users < $limit)
+ {
+ // There are no more users to be converted
+ return;
+ }
+
+ // There are still more users to query, return the next start value
+ return $start + $limit;
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v310/passwords_convert_p2.php b/phpBB/phpbb/db/migration/data/v310/passwords_convert_p2.php
new file mode 100644
index 0000000000..26a99184a6
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/passwords_convert_p2.php
@@ -0,0 +1,49 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v310;
+
+class passwords_convert_p2 extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return !$this->db_tools->sql_column_exists($this->table_prefix . 'users', 'user_pass_convert');
+ }
+
+ static public function depends_on()
+ {
+ return array('\phpbb\db\migration\data\v310\passwords_convert_p1');
+ }
+
+ public function update_schema()
+ {
+ return array(
+ 'drop_columns' => array(
+ $this->table_prefix . 'users' => array(
+ 'user_pass_convert',
+ ),
+ ),
+ );
+ }
+
+ public function revert_schema()
+ {
+ return array(
+ 'add_columns' => array(
+ $this->table_prefix . 'users' => array(
+ 'user_pass_convert' => array('BOOL', 0, 'after' => 'user_passchg'),
+ ),
+ ),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v310/passwords_p2.php b/phpBB/phpbb/db/migration/data/v310/passwords_p2.php
new file mode 100644
index 0000000000..afc7ba2813
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/passwords_p2.php
@@ -0,0 +1,44 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v310;
+
+class passwords_p2 extends \phpbb\db\migration\migration
+{
+ static public function depends_on()
+ {
+ return array('\phpbb\db\migration\data\v310\passwords');
+ }
+
+ public function update_schema()
+ {
+ return array(
+ 'change_columns' => array(
+ $this->table_prefix . 'users' => array(
+ 'user_newpasswd' => array('VCHAR:255', ''),
+ ),
+ ),
+ );
+ }
+
+ public function revert_schema()
+ {
+ return array(
+ 'change_columns' => array(
+ $this->table_prefix . 'users' => array(
+ 'user_newpasswd' => array('VCHAR:40', ''),
+ ),
+ ),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v310/plupload.php b/phpBB/phpbb/db/migration/data/v310/plupload.php
new file mode 100644
index 0000000000..69367f86a9
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/plupload.php
@@ -0,0 +1,36 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v310;
+
+class plupload extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return isset($this->config['plupload_last_gc']) &&
+ isset($this->config['plupload_salt']);
+ }
+
+ static public function depends_on()
+ {
+ return array('\phpbb\db\migration\data\v310\dev');
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('config.add', array('plupload_last_gc', 0)),
+ array('config.add', array('plupload_salt', unique_id())),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v310/postgres_fulltext_drop.php b/phpBB/phpbb/db/migration/data/v310/postgres_fulltext_drop.php
new file mode 100644
index 0000000000..3457c19478
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/postgres_fulltext_drop.php
@@ -0,0 +1,80 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v310;
+
+class postgres_fulltext_drop extends \phpbb\db\migration\migration
+{
+ protected $indexes;
+
+ public function effectively_installed()
+ {
+ // This migration is irrelevant for all non-PostgreSQL DBMSes.
+ if (strpos($this->db->get_sql_layer(), 'postgres') === false)
+ {
+ return true;
+ }
+
+ $this->find_indexes_to_drop();
+ return empty($this->indexes);
+ }
+
+ static public function depends_on()
+ {
+ return array(
+ '\phpbb\db\migration\data\v310\dev',
+ );
+ }
+
+ public function update_schema()
+ {
+ if (empty($this->indexes))
+ {
+ return array();
+ }
+
+ /*
+ * Drop FULLTEXT indexes related to PostgreSQL fulltext search.
+ * Doing so is equivalent to dropping the search index from the ACP.
+ * Possibly time-consuming recreation of the search index (i.e.
+ * FULLTEXT indexes) is left as a task to the admin to not
+ * unnecessarily stall the upgrade process. The new search index will
+ * then require about 40% less table space (also see PHPBB3-11040).
+ */
+ return array(
+ 'drop_keys' => array(
+ $this->table_prefix . 'posts' => $this->indexes,
+ ),
+ );
+ }
+
+ public function find_indexes_to_drop()
+ {
+ if ($this->indexes !== null)
+ {
+ return $this->indexes;
+ }
+
+ $this->indexes = array();
+ $potential_keys = array('post_subject', 'post_text', 'post_content');
+ foreach ($potential_keys as $key)
+ {
+ if ($this->db_tools->sql_index_exists($this->table_prefix . 'posts', $key))
+ {
+ $this->indexes[] = $key;
+ }
+ }
+
+ return $this->indexes;
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v310/profilefield_aol.php b/phpBB/phpbb/db/migration/data/v310/profilefield_aol.php
new file mode 100644
index 0000000000..65d4fe1078
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/profilefield_aol.php
@@ -0,0 +1,55 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v310;
+
+class profilefield_aol extends \phpbb\db\migration\profilefield_base_migration
+{
+ static public function depends_on()
+ {
+ return array(
+ '\phpbb\db\migration\data\v310\profilefield_yahoo_cleanup',
+ );
+ }
+
+ protected $profilefield_name = 'phpbb_aol';
+
+ protected $profilefield_database_type = array('VCHAR', '');
+
+ protected $profilefield_data = array(
+ 'field_name' => 'phpbb_aol',
+ 'field_type' => 'profilefields.type.string',
+ 'field_ident' => 'phpbb_aol',
+ 'field_length' => '40',
+ 'field_minlen' => '5',
+ 'field_maxlen' => '255',
+ 'field_novalue' => '',
+ 'field_default_value' => '',
+ 'field_validation' => '.*',
+ 'field_required' => 0,
+ 'field_show_novalue' => 0,
+ 'field_show_on_reg' => 0,
+ 'field_show_on_pm' => 1,
+ 'field_show_on_vt' => 1,
+ 'field_show_on_ml' => 0,
+ 'field_show_profile' => 1,
+ 'field_hide' => 0,
+ 'field_no_view' => 0,
+ 'field_active' => 1,
+ 'field_is_contact' => 1,
+ 'field_contact_desc' => '',
+ 'field_contact_url' => '',
+ );
+
+ protected $user_column_name = 'user_aim';
+}
diff --git a/phpBB/phpbb/db/migration/data/v310/profilefield_aol_cleanup.php b/phpBB/phpbb/db/migration/data/v310/profilefield_aol_cleanup.php
new file mode 100644
index 0000000000..f884d83d26
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/profilefield_aol_cleanup.php
@@ -0,0 +1,51 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v310;
+
+class profilefield_aol_cleanup extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return !$this->db_tools->sql_column_exists($this->table_prefix . 'users', 'user_aim');
+ }
+
+ static public function depends_on()
+ {
+ return array(
+ '\phpbb\db\migration\data\v310\profilefield_aol',
+ );
+ }
+
+ public function update_schema()
+ {
+ return array(
+ 'drop_columns' => array(
+ $this->table_prefix . 'users' => array(
+ 'user_aim',
+ ),
+ ),
+ );
+ }
+
+ public function revert_schema()
+ {
+ return array(
+ 'add_columns' => array(
+ $this->table_prefix . 'users' => array(
+ 'user_aim' => array('VCHAR_UNI', ''),
+ ),
+ ),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v310/profilefield_change_load_settings.php b/phpBB/phpbb/db/migration/data/v310/profilefield_change_load_settings.php
new file mode 100644
index 0000000000..7cc4fd8daa
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/profilefield_change_load_settings.php
@@ -0,0 +1,34 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v310;
+
+class profilefield_change_load_settings extends \phpbb\db\migration\migration
+{
+ static public function depends_on()
+ {
+ return array(
+ '\phpbb\db\migration\data\v310\profilefield_aol_cleanup',
+ );
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('config.update', array('load_cpf_memberlist', '1')),
+ array('config.update', array('load_cpf_pm', '1')),
+ array('config.update', array('load_cpf_viewprofile', '1')),
+ array('config.update', array('load_cpf_viewtopic', '1')),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v310/profilefield_cleanup.php b/phpBB/phpbb/db/migration/data/v310/profilefield_cleanup.php
new file mode 100644
index 0000000000..c44167dbfe
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/profilefield_cleanup.php
@@ -0,0 +1,55 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v310;
+
+class profilefield_cleanup extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return !$this->db_tools->sql_column_exists($this->table_prefix . 'users', 'user_occ') &&
+ !$this->db_tools->sql_column_exists($this->table_prefix . 'users', 'user_interests');
+ }
+
+ static public function depends_on()
+ {
+ return array(
+ '\phpbb\db\migration\data\v310\profilefield_interests',
+ '\phpbb\db\migration\data\v310\profilefield_occupation',
+ );
+ }
+
+ public function update_schema()
+ {
+ return array(
+ 'drop_columns' => array(
+ $this->table_prefix . 'users' => array(
+ 'user_occ',
+ 'user_interests',
+ ),
+ ),
+ );
+ }
+
+ public function revert_schema()
+ {
+ return array(
+ 'add_columns' => array(
+ $this->table_prefix . 'users' => array(
+ 'user_occ' => array('MTEXT', ''),
+ 'user_interests' => array('MTEXT', ''),
+ ),
+ ),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v310/profilefield_contact_field.php b/phpBB/phpbb/db/migration/data/v310/profilefield_contact_field.php
new file mode 100644
index 0000000000..02cd420c0f
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/profilefield_contact_field.php
@@ -0,0 +1,55 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v310;
+
+class profilefield_contact_field extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return $this->db_tools->sql_column_exists($this->table_prefix . 'profile_fields', 'field_is_contact');
+ }
+
+ static public function depends_on()
+ {
+ return array(
+ '\phpbb\db\migration\data\v310\profilefield_on_memberlist',
+ );
+ }
+
+ public function update_schema()
+ {
+ return array(
+ 'add_columns' => array(
+ $this->table_prefix . 'profile_fields' => array(
+ 'field_is_contact' => array('BOOL', 0),
+ 'field_contact_desc' => array('VCHAR', ''),
+ 'field_contact_url' => array('VCHAR', ''),
+ ),
+ ),
+ );
+ }
+
+ public function revert_schema()
+ {
+ return array(
+ 'drop_columns' => array(
+ $this->table_prefix . 'profile_fields' => array(
+ 'field_is_contact',
+ 'field_contact_desc',
+ 'field_contact_url',
+ ),
+ ),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v310/profilefield_facebook.php b/phpBB/phpbb/db/migration/data/v310/profilefield_facebook.php
new file mode 100644
index 0000000000..7324b893cc
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/profilefield_facebook.php
@@ -0,0 +1,61 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v310;
+
+class profilefield_facebook extends \phpbb\db\migration\profilefield_base_migration
+{
+ static public function depends_on()
+ {
+ return array(
+ '\phpbb\db\migration\data\v310\profilefield_contact_field',
+ '\phpbb\db\migration\data\v310\profilefield_show_novalue',
+ '\phpbb\db\migration\data\v310\profilefield_types',
+ );
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('custom', array(array($this, 'create_custom_field'))),
+ );
+ }
+
+ protected $profilefield_name = 'phpbb_facebook';
+
+ protected $profilefield_database_type = array('VCHAR', '');
+
+ protected $profilefield_data = array(
+ 'field_name' => 'phpbb_facebook',
+ 'field_type' => 'profilefields.type.string',
+ 'field_ident' => 'phpbb_facebook',
+ 'field_length' => '20',
+ 'field_minlen' => '5',
+ 'field_maxlen' => '50',
+ 'field_novalue' => '',
+ 'field_default_value' => '',
+ 'field_validation' => '[\w.]+',
+ 'field_required' => 0,
+ 'field_show_novalue' => 0,
+ 'field_show_on_reg' => 0,
+ 'field_show_on_pm' => 1,
+ 'field_show_on_vt' => 1,
+ 'field_show_profile' => 1,
+ 'field_hide' => 0,
+ 'field_no_view' => 0,
+ 'field_active' => 1,
+ 'field_is_contact' => 1,
+ 'field_contact_desc' => 'VIEW_FACEBOOK_PROFILE',
+ 'field_contact_url' => 'http://facebook.com/%s/',
+ );
+}
diff --git a/phpBB/phpbb/db/migration/data/v310/profilefield_field_validation_length.php b/phpBB/phpbb/db/migration/data/v310/profilefield_field_validation_length.php
new file mode 100644
index 0000000000..c7d8b2dc91
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/profilefield_field_validation_length.php
@@ -0,0 +1,90 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v310;
+
+class profilefield_field_validation_length extends \phpbb\db\migration\migration
+{
+ protected $validation_options_old = array(
+ 'ALPHA_SPACERS' => '[\w_\+\. \-\[\]]+',
+ );
+
+ protected $validation_options_new = array(
+ 'ALPHA_SPACERS' => '[\w\x20_+\-\[\]]+',
+ );
+
+ static public function depends_on()
+ {
+ return array(
+ '\phpbb\db\migration\data\v310\rc3',
+ );
+ }
+
+ public function update_schema()
+ {
+ return array(
+ 'change_columns' => array(
+ $this->table_prefix . 'profile_fields' => array(
+ 'field_validation' => array('VCHAR_UNI:64', ''),
+ ),
+ ),
+ );
+ }
+
+ public function revert_schema()
+ {
+ return array(
+ 'change_columns' => array(
+ $this->table_prefix . 'profile_fields' => array(
+ 'field_validation' => array('VCHAR_UNI:20', ''),
+ ),
+ ),
+ );
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('custom', array(array($this, 'update_profile_fields_validation'))),
+ );
+ }
+
+ public function revert_data()
+ {
+ return array(
+ array('custom', array(array($this, 'revert_profile_fields_validation'))),
+ );
+ }
+
+ public function update_profile_fields_validation()
+ {
+ foreach ($this->validation_options_new as $validation_type => $regex)
+ {
+ $sql = 'UPDATE ' . $this->table_prefix . "profile_fields
+ SET field_validation = '" . $this->db->sql_escape($this->validation_options_new[$validation_type]) . "'
+ WHERE field_validation = '" . $this->db->sql_escape($this->validation_options_old[$validation_type]) . "'";
+ $this->sql_query($sql);
+ }
+ }
+
+ public function revert_profile_fields_validation()
+ {
+ foreach ($this->validation_options_new as $validation_type => $regex)
+ {
+ $sql = 'UPDATE ' . $this->table_prefix . "profile_fields
+ SET field_validation = '" . $this->db->sql_escape($this->validation_options_old[$validation_type]) . "'
+ WHERE field_validation = '" . $this->db->sql_escape($this->validation_options_new[$validation_type]) . "'";
+ $this->sql_query($sql);
+ }
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v310/profilefield_googleplus.php b/phpBB/phpbb/db/migration/data/v310/profilefield_googleplus.php
new file mode 100644
index 0000000000..3b0963fc19
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/profilefield_googleplus.php
@@ -0,0 +1,61 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v310;
+
+class profilefield_googleplus extends \phpbb\db\migration\profilefield_base_migration
+{
+ static public function depends_on()
+ {
+ return array(
+ '\phpbb\db\migration\data\v310\profilefield_contact_field',
+ '\phpbb\db\migration\data\v310\profilefield_show_novalue',
+ '\phpbb\db\migration\data\v310\profilefield_types',
+ );
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('custom', array(array($this, 'create_custom_field'))),
+ );
+ }
+
+ protected $profilefield_name = 'phpbb_googleplus';
+
+ protected $profilefield_database_type = array('VCHAR', '');
+
+ protected $profilefield_data = array(
+ 'field_name' => 'phpbb_googleplus',
+ 'field_type' => 'profilefields.type.googleplus',
+ 'field_ident' => 'phpbb_googleplus',
+ 'field_length' => '20',
+ 'field_minlen' => '3',
+ 'field_maxlen' => '255',
+ 'field_novalue' => '',
+ 'field_default_value' => '',
+ 'field_validation' => '[\w]+',
+ 'field_required' => 0,
+ 'field_show_novalue' => 0,
+ 'field_show_on_reg' => 0,
+ 'field_show_on_pm' => 1,
+ 'field_show_on_vt' => 1,
+ 'field_show_profile' => 1,
+ 'field_hide' => 0,
+ 'field_no_view' => 0,
+ 'field_active' => 1,
+ 'field_is_contact' => 1,
+ 'field_contact_desc' => 'VIEW_GOOGLEPLUS_PROFILE',
+ 'field_contact_url' => 'http://plus.google.com/%s',
+ );
+}
diff --git a/phpBB/phpbb/db/migration/data/v310/profilefield_icq.php b/phpBB/phpbb/db/migration/data/v310/profilefield_icq.php
new file mode 100644
index 0000000000..e61653f3db
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/profilefield_icq.php
@@ -0,0 +1,54 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v310;
+
+class profilefield_icq extends \phpbb\db\migration\profilefield_base_migration
+{
+ static public function depends_on()
+ {
+ return array(
+ '\phpbb\db\migration\data\v310\profilefield_contact_field',
+ );
+ }
+
+ protected $profilefield_name = 'phpbb_icq';
+
+ protected $profilefield_database_type = array('VCHAR', '');
+
+ protected $profilefield_data = array(
+ 'field_name' => 'phpbb_icq',
+ 'field_type' => 'profilefields.type.string',
+ 'field_ident' => 'phpbb_icq',
+ 'field_length' => '20',
+ 'field_minlen' => '3',
+ 'field_maxlen' => '15',
+ 'field_novalue' => '',
+ 'field_default_value' => '',
+ 'field_validation' => '[0-9]+',
+ 'field_required' => 0,
+ 'field_show_novalue' => 0,
+ 'field_show_on_reg' => 0,
+ 'field_show_on_pm' => 1,
+ 'field_show_on_vt' => 1,
+ 'field_show_profile' => 1,
+ 'field_hide' => 0,
+ 'field_no_view' => 0,
+ 'field_active' => 1,
+ 'field_is_contact' => 1,
+ 'field_contact_desc' => 'SEND_ICQ_MESSAGE',
+ 'field_contact_url' => 'https://www.icq.com/people/%s/',
+ );
+
+ protected $user_column_name = 'user_icq';
+}
diff --git a/phpBB/phpbb/db/migration/data/v310/profilefield_icq_cleanup.php b/phpBB/phpbb/db/migration/data/v310/profilefield_icq_cleanup.php
new file mode 100644
index 0000000000..516c690093
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/profilefield_icq_cleanup.php
@@ -0,0 +1,51 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v310;
+
+class profilefield_icq_cleanup extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return !$this->db_tools->sql_column_exists($this->table_prefix . 'users', 'user_icq');
+ }
+
+ static public function depends_on()
+ {
+ return array(
+ '\phpbb\db\migration\data\v310\profilefield_icq',
+ );
+ }
+
+ public function update_schema()
+ {
+ return array(
+ 'drop_columns' => array(
+ $this->table_prefix . 'users' => array(
+ 'user_icq',
+ ),
+ ),
+ );
+ }
+
+ public function revert_schema()
+ {
+ return array(
+ 'add_columns' => array(
+ $this->table_prefix . 'users' => array(
+ 'user_icq' => array('VCHAR:20', ''),
+ ),
+ ),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v310/profilefield_interests.php b/phpBB/phpbb/db/migration/data/v310/profilefield_interests.php
new file mode 100644
index 0000000000..33a5ba15ae
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/profilefield_interests.php
@@ -0,0 +1,52 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v310;
+
+class profilefield_interests extends \phpbb\db\migration\profilefield_base_migration
+{
+ static public function depends_on()
+ {
+ return array(
+ '\phpbb\db\migration\data\v310\profilefield_types',
+ '\phpbb\db\migration\data\v310\profilefield_show_novalue',
+ );
+ }
+
+ protected $profilefield_name = 'phpbb_interests';
+
+ protected $profilefield_database_type = array('MTEXT', '');
+
+ protected $profilefield_data = array(
+ 'field_name' => 'phpbb_interests',
+ 'field_type' => 'profilefields.type.text',
+ 'field_ident' => 'phpbb_interests',
+ 'field_length' => '3|30',
+ 'field_minlen' => '2',
+ 'field_maxlen' => '500',
+ 'field_novalue' => '',
+ 'field_default_value' => '',
+ 'field_validation' => '.*',
+ 'field_required' => 0,
+ 'field_show_novalue' => 0,
+ 'field_show_on_reg' => 0,
+ 'field_show_on_pm' => 0,
+ 'field_show_on_vt' => 0,
+ 'field_show_profile' => 1,
+ 'field_hide' => 0,
+ 'field_no_view' => 0,
+ 'field_active' => 1,
+ );
+
+ protected $user_column_name = 'user_interests';
+}
diff --git a/phpBB/phpbb/db/migration/data/v310/profilefield_location.php b/phpBB/phpbb/db/migration/data/v310/profilefield_location.php
new file mode 100644
index 0000000000..2d27c09e68
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/profilefield_location.php
@@ -0,0 +1,52 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v310;
+
+class profilefield_location extends \phpbb\db\migration\profilefield_base_migration
+{
+ static public function depends_on()
+ {
+ return array(
+ '\phpbb\db\migration\data\v310\profilefield_types',
+ '\phpbb\db\migration\data\v310\profilefield_on_memberlist',
+ );
+ }
+
+ protected $profilefield_name = 'phpbb_location';
+
+ protected $profilefield_database_type = array('VCHAR', '');
+
+ protected $profilefield_data = array(
+ 'field_name' => 'phpbb_location',
+ 'field_type' => 'profilefields.type.string',
+ 'field_ident' => 'phpbb_location',
+ 'field_length' => '20',
+ 'field_minlen' => '2',
+ 'field_maxlen' => '100',
+ 'field_novalue' => '',
+ 'field_default_value' => '',
+ 'field_validation' => '.*',
+ 'field_required' => 0,
+ 'field_show_novalue' => 0,
+ 'field_show_on_reg' => 0,
+ 'field_show_on_pm' => 1,
+ 'field_show_on_vt' => 1,
+ 'field_show_profile' => 1,
+ 'field_hide' => 0,
+ 'field_no_view' => 0,
+ 'field_active' => 1,
+ );
+
+ protected $user_column_name = 'user_from';
+}
diff --git a/phpBB/phpbb/db/migration/data/v310/profilefield_location_cleanup.php b/phpBB/phpbb/db/migration/data/v310/profilefield_location_cleanup.php
new file mode 100644
index 0000000000..b824e3406a
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/profilefield_location_cleanup.php
@@ -0,0 +1,51 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v310;
+
+class profilefield_location_cleanup extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return !$this->db_tools->sql_column_exists($this->table_prefix . 'users', 'user_from');
+ }
+
+ static public function depends_on()
+ {
+ return array(
+ '\phpbb\db\migration\data\v310\profilefield_location',
+ );
+ }
+
+ public function update_schema()
+ {
+ return array(
+ 'drop_columns' => array(
+ $this->table_prefix . 'users' => array(
+ 'user_from',
+ ),
+ ),
+ );
+ }
+
+ public function revert_schema()
+ {
+ return array(
+ 'add_columns' => array(
+ $this->table_prefix . 'users' => array(
+ 'user_from' => array('VCHAR_UNI:100', ''),
+ ),
+ ),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v310/profilefield_occupation.php b/phpBB/phpbb/db/migration/data/v310/profilefield_occupation.php
new file mode 100644
index 0000000000..75df2bcdee
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/profilefield_occupation.php
@@ -0,0 +1,51 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v310;
+
+class profilefield_occupation extends \phpbb\db\migration\profilefield_base_migration
+{
+ static public function depends_on()
+ {
+ return array(
+ '\phpbb\db\migration\data\v310\profilefield_interests',
+ );
+ }
+
+ protected $profilefield_name = 'phpbb_occupation';
+
+ protected $profilefield_database_type = array('MTEXT', '');
+
+ protected $profilefield_data = array(
+ 'field_name' => 'phpbb_occupation',
+ 'field_type' => 'profilefields.type.text',
+ 'field_ident' => 'phpbb_occupation',
+ 'field_length' => '3|30',
+ 'field_minlen' => '2',
+ 'field_maxlen' => '500',
+ 'field_novalue' => '',
+ 'field_default_value' => '',
+ 'field_validation' => '.*',
+ 'field_required' => 0,
+ 'field_show_novalue' => 0,
+ 'field_show_on_reg' => 0,
+ 'field_show_on_pm' => 0,
+ 'field_show_on_vt' => 0,
+ 'field_show_profile' => 1,
+ 'field_hide' => 0,
+ 'field_no_view' => 0,
+ 'field_active' => 1,
+ );
+
+ protected $user_column_name = 'user_occ';
+}
diff --git a/phpBB/phpbb/db/migration/data/v310/profilefield_on_memberlist.php b/phpBB/phpbb/db/migration/data/v310/profilefield_on_memberlist.php
new file mode 100644
index 0000000000..7ce5de0f00
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/profilefield_on_memberlist.php
@@ -0,0 +1,51 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v310;
+
+class profilefield_on_memberlist extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return $this->db_tools->sql_column_exists($this->table_prefix . 'profile_fields', 'field_show_on_ml');
+ }
+
+ static public function depends_on()
+ {
+ return array(
+ '\phpbb\db\migration\data\v310\profilefield_cleanup',
+ );
+ }
+
+ public function update_schema()
+ {
+ return array(
+ 'add_columns' => array(
+ $this->table_prefix . 'profile_fields' => array(
+ 'field_show_on_ml' => array('BOOL', 0),
+ ),
+ ),
+ );
+ }
+
+ public function revert_schema()
+ {
+ return array(
+ 'drop_columns' => array(
+ $this->table_prefix . 'profile_fields' => array(
+ 'field_show_on_ml',
+ ),
+ ),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v310/profilefield_show_novalue.php b/phpBB/phpbb/db/migration/data/v310/profilefield_show_novalue.php
new file mode 100644
index 0000000000..5fc88b6809
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/profilefield_show_novalue.php
@@ -0,0 +1,49 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v310;
+
+class profilefield_show_novalue extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return $this->db_tools->sql_column_exists($this->table_prefix . 'profile_fields', 'field_show_novalue');
+ }
+
+ static public function depends_on()
+ {
+ return array('\phpbb\db\migration\data\v310\profilefield_types');
+ }
+
+ public function update_schema()
+ {
+ return array(
+ 'add_columns' => array(
+ $this->table_prefix . 'profile_fields' => array(
+ 'field_show_novalue' => array('BOOL', 0),
+ ),
+ ),
+ );
+ }
+
+ public function revert_schema()
+ {
+ return array(
+ 'drop_columns' => array(
+ $this->table_prefix . 'profile_fields' => array(
+ 'field_show_novalue',
+ ),
+ ),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v310/profilefield_skype.php b/phpBB/phpbb/db/migration/data/v310/profilefield_skype.php
new file mode 100644
index 0000000000..0dbe9041bb
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/profilefield_skype.php
@@ -0,0 +1,61 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v310;
+
+class profilefield_skype extends \phpbb\db\migration\profilefield_base_migration
+{
+ static public function depends_on()
+ {
+ return array(
+ '\phpbb\db\migration\data\v310\profilefield_contact_field',
+ '\phpbb\db\migration\data\v310\profilefield_show_novalue',
+ '\phpbb\db\migration\data\v310\profilefield_types',
+ );
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('custom', array(array($this, 'create_custom_field'))),
+ );
+ }
+
+ protected $profilefield_name = 'phpbb_skype';
+
+ protected $profilefield_database_type = array('VCHAR', '');
+
+ protected $profilefield_data = array(
+ 'field_name' => 'phpbb_skype',
+ 'field_type' => 'profilefields.type.string',
+ 'field_ident' => 'phpbb_skype',
+ 'field_length' => '20',
+ 'field_minlen' => '6',
+ 'field_maxlen' => '32',
+ 'field_novalue' => '',
+ 'field_default_value' => '',
+ 'field_validation' => '[a-zA-Z][\w\.,\-_]+',
+ 'field_required' => 0,
+ 'field_show_novalue' => 0,
+ 'field_show_on_reg' => 0,
+ 'field_show_on_pm' => 1,
+ 'field_show_on_vt' => 1,
+ 'field_show_profile' => 1,
+ 'field_hide' => 0,
+ 'field_no_view' => 0,
+ 'field_active' => 1,
+ 'field_is_contact' => 1,
+ 'field_contact_desc' => 'VIEW_SKYPE_PROFILE',
+ 'field_contact_url' => 'skype:%s?userinfo',
+ );
+}
diff --git a/phpBB/phpbb/db/migration/data/v310/profilefield_twitter.php b/phpBB/phpbb/db/migration/data/v310/profilefield_twitter.php
new file mode 100644
index 0000000000..850e096439
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/profilefield_twitter.php
@@ -0,0 +1,61 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v310;
+
+class profilefield_twitter extends \phpbb\db\migration\profilefield_base_migration
+{
+ static public function depends_on()
+ {
+ return array(
+ '\phpbb\db\migration\data\v310\profilefield_contact_field',
+ '\phpbb\db\migration\data\v310\profilefield_show_novalue',
+ '\phpbb\db\migration\data\v310\profilefield_types',
+ );
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('custom', array(array($this, 'create_custom_field'))),
+ );
+ }
+
+ protected $profilefield_name = 'phpbb_twitter';
+
+ protected $profilefield_database_type = array('VCHAR', '');
+
+ protected $profilefield_data = array(
+ 'field_name' => 'phpbb_twitter',
+ 'field_type' => 'profilefields.type.string',
+ 'field_ident' => 'phpbb_twitter',
+ 'field_length' => '20',
+ 'field_minlen' => '1',
+ 'field_maxlen' => '15',
+ 'field_novalue' => '',
+ 'field_default_value' => '',
+ 'field_validation' => '[\w_]+',
+ 'field_required' => 0,
+ 'field_show_novalue' => 0,
+ 'field_show_on_reg' => 0,
+ 'field_show_on_pm' => 1,
+ 'field_show_on_vt' => 1,
+ 'field_show_profile' => 1,
+ 'field_hide' => 0,
+ 'field_no_view' => 0,
+ 'field_active' => 1,
+ 'field_is_contact' => 1,
+ 'field_contact_desc' => 'VIEW_TWITTER_PROFILE',
+ 'field_contact_url' => 'http://twitter.com/%s',
+ );
+}
diff --git a/phpBB/phpbb/db/migration/data/v310/profilefield_types.php b/phpBB/phpbb/db/migration/data/v310/profilefield_types.php
new file mode 100644
index 0000000000..5045eb8807
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/profilefield_types.php
@@ -0,0 +1,110 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v310;
+
+class profilefield_types extends \phpbb\db\migration\migration
+{
+
+ static public function depends_on()
+ {
+ return array(
+ '\phpbb\db\migration\data\v310\alpha2',
+ );
+ }
+
+ public function update_schema()
+ {
+ return array(
+ 'change_columns' => array(
+ $this->table_prefix . 'profile_fields' => array(
+ 'field_type' => array('VCHAR:100', ''),
+ ),
+ $this->table_prefix . 'profile_fields_lang' => array(
+ 'field_type' => array('VCHAR:100', ''),
+ ),
+ ),
+ );
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('custom', array(array($this, 'update_profile_fields_type'))),
+ array('custom', array(array($this, 'update_profile_fields_lang_type'))),
+ );
+ }
+
+ public function update_profile_fields_type()
+ {
+ // Update profile field types
+ $sql = 'SELECT field_type
+ FROM ' . $this->table_prefix . 'profile_fields
+ GROUP BY field_type';
+ $result = $this->db->sql_query($sql);
+
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $sql = 'UPDATE ' . $this->table_prefix . "profile_fields
+ SET field_type = '" . $this->db->sql_escape($this->convert_phpbb30_field_type($row['field_type'])) . "'
+ WHERE field_type = '" . $this->db->sql_escape($row['field_type']) . "'";
+ $this->sql_query($sql);
+ }
+ $this->db->sql_freeresult($result);
+ }
+
+ public function update_profile_fields_lang_type()
+ {
+ // Update profile field language types
+ $sql = 'SELECT field_type
+ FROM ' . $this->table_prefix . 'profile_fields_lang
+ GROUP BY field_type';
+ $result = $this->db->sql_query($sql);
+
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $sql = 'UPDATE ' . $this->table_prefix . "profile_fields_lang
+ SET field_type = '" . $this->db->sql_escape($this->convert_phpbb30_field_type($row['field_type'])) . "'
+ WHERE field_type = '" . $this->db->sql_escape($row['field_type']) . "'";
+ $this->sql_query($sql);
+ }
+ $this->db->sql_freeresult($result);
+ }
+
+ /**
+ * Determine the new field type for a given phpBB 3.0 field type
+ *
+ * @param $field_type string Field type in 3.0
+ * @return string Field new type which is used since 3.1
+ */
+ public function convert_phpbb30_field_type($field_type)
+ {
+ switch ($field_type)
+ {
+ case FIELD_INT:
+ return 'profilefields.type.int';
+ case FIELD_STRING:
+ return 'profilefields.type.string';
+ case FIELD_TEXT:
+ return 'profilefields.type.text';
+ case FIELD_BOOL:
+ return 'profilefields.type.bool';
+ case FIELD_DROPDOWN:
+ return 'profilefields.type.dropdown';
+ case FIELD_DATE:
+ return 'profilefields.type.date';
+ default:
+ return $field_type;
+ }
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v310/profilefield_website.php b/phpBB/phpbb/db/migration/data/v310/profilefield_website.php
new file mode 100644
index 0000000000..e1e10f09f4
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/profilefield_website.php
@@ -0,0 +1,56 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v310;
+
+class profilefield_website extends \phpbb\db\migration\profilefield_base_migration
+{
+ static public function depends_on()
+ {
+ return array(
+ '\phpbb\db\migration\data\v310\profilefield_on_memberlist',
+ '\phpbb\db\migration\data\v310\profilefield_icq_cleanup',
+ );
+ }
+
+ protected $profilefield_name = 'phpbb_website';
+
+ protected $profilefield_database_type = array('VCHAR', '');
+
+ protected $profilefield_data = array(
+ 'field_name' => 'phpbb_website',
+ 'field_type' => 'profilefields.type.url',
+ 'field_ident' => 'phpbb_website',
+ 'field_length' => '40',
+ 'field_minlen' => '12',
+ 'field_maxlen' => '255',
+ 'field_novalue' => '',
+ 'field_default_value' => '',
+ 'field_validation' => '',
+ 'field_required' => 0,
+ 'field_show_novalue' => 0,
+ 'field_show_on_reg' => 0,
+ 'field_show_on_pm' => 1,
+ 'field_show_on_vt' => 1,
+ 'field_show_on_ml' => 1,
+ 'field_show_profile' => 1,
+ 'field_hide' => 0,
+ 'field_no_view' => 0,
+ 'field_active' => 1,
+ 'field_is_contact' => 1,
+ 'field_contact_desc' => 'VISIT_WEBSITE',
+ 'field_contact_url' => '%s',
+ );
+
+ protected $user_column_name = 'user_website';
+}
diff --git a/phpBB/phpbb/db/migration/data/v310/profilefield_website_cleanup.php b/phpBB/phpbb/db/migration/data/v310/profilefield_website_cleanup.php
new file mode 100644
index 0000000000..94442f0497
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/profilefield_website_cleanup.php
@@ -0,0 +1,51 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v310;
+
+class profilefield_website_cleanup extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return !$this->db_tools->sql_column_exists($this->table_prefix . 'users', 'user_website');
+ }
+
+ static public function depends_on()
+ {
+ return array(
+ '\phpbb\db\migration\data\v310\profilefield_website',
+ );
+ }
+
+ public function update_schema()
+ {
+ return array(
+ 'drop_columns' => array(
+ $this->table_prefix . 'users' => array(
+ 'user_website',
+ ),
+ ),
+ );
+ }
+
+ public function revert_schema()
+ {
+ return array(
+ 'add_columns' => array(
+ $this->table_prefix . 'users' => array(
+ 'user_website' => array('VCHAR_UNI:200', ''),
+ ),
+ ),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v310/profilefield_wlm.php b/phpBB/phpbb/db/migration/data/v310/profilefield_wlm.php
new file mode 100644
index 0000000000..2cd333fcbd
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/profilefield_wlm.php
@@ -0,0 +1,55 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v310;
+
+class profilefield_wlm extends \phpbb\db\migration\profilefield_base_migration
+{
+ static public function depends_on()
+ {
+ return array(
+ '\phpbb\db\migration\data\v310\profilefield_website_cleanup',
+ );
+ }
+
+ protected $profilefield_name = 'phpbb_wlm';
+
+ protected $profilefield_database_type = array('VCHAR', '');
+
+ protected $profilefield_data = array(
+ 'field_name' => 'phpbb_wlm',
+ 'field_type' => 'profilefields.type.string',
+ 'field_ident' => 'phpbb_wlm',
+ 'field_length' => '40',
+ 'field_minlen' => '5',
+ 'field_maxlen' => '255',
+ 'field_novalue' => '',
+ 'field_default_value' => '',
+ 'field_validation' => '.*',
+ 'field_required' => 0,
+ 'field_show_novalue' => 0,
+ 'field_show_on_reg' => 0,
+ 'field_show_on_pm' => 1,
+ 'field_show_on_vt' => 1,
+ 'field_show_on_ml' => 0,
+ 'field_show_profile' => 1,
+ 'field_hide' => 0,
+ 'field_no_view' => 0,
+ 'field_active' => 1,
+ 'field_is_contact' => 1,
+ 'field_contact_desc' => '',
+ 'field_contact_url' => '',
+ );
+
+ protected $user_column_name = 'user_msnm';
+}
diff --git a/phpBB/phpbb/db/migration/data/v310/profilefield_wlm_cleanup.php b/phpBB/phpbb/db/migration/data/v310/profilefield_wlm_cleanup.php
new file mode 100644
index 0000000000..7ef9e44020
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/profilefield_wlm_cleanup.php
@@ -0,0 +1,51 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v310;
+
+class profilefield_wlm_cleanup extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return !$this->db_tools->sql_column_exists($this->table_prefix . 'users', 'user_msnm');
+ }
+
+ static public function depends_on()
+ {
+ return array(
+ '\phpbb\db\migration\data\v310\profilefield_wlm',
+ );
+ }
+
+ public function update_schema()
+ {
+ return array(
+ 'drop_columns' => array(
+ $this->table_prefix . 'users' => array(
+ 'user_msnm',
+ ),
+ ),
+ );
+ }
+
+ public function revert_schema()
+ {
+ return array(
+ 'add_columns' => array(
+ $this->table_prefix . 'users' => array(
+ 'user_msnm' => array('VCHAR_UNI', ''),
+ ),
+ ),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v310/profilefield_yahoo.php b/phpBB/phpbb/db/migration/data/v310/profilefield_yahoo.php
new file mode 100644
index 0000000000..e269f88420
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/profilefield_yahoo.php
@@ -0,0 +1,55 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v310;
+
+class profilefield_yahoo extends \phpbb\db\migration\profilefield_base_migration
+{
+ static public function depends_on()
+ {
+ return array(
+ '\phpbb\db\migration\data\v310\profilefield_wlm_cleanup',
+ );
+ }
+
+ protected $profilefield_name = 'phpbb_yahoo';
+
+ protected $profilefield_database_type = array('VCHAR', '');
+
+ protected $profilefield_data = array(
+ 'field_name' => 'phpbb_yahoo',
+ 'field_type' => 'profilefields.type.string',
+ 'field_ident' => 'phpbb_yahoo',
+ 'field_length' => '40',
+ 'field_minlen' => '5',
+ 'field_maxlen' => '255',
+ 'field_novalue' => '',
+ 'field_default_value' => '',
+ 'field_validation' => '.*',
+ 'field_required' => 0,
+ 'field_show_novalue' => 0,
+ 'field_show_on_reg' => 0,
+ 'field_show_on_pm' => 1,
+ 'field_show_on_vt' => 1,
+ 'field_show_on_ml' => 0,
+ 'field_show_profile' => 1,
+ 'field_hide' => 0,
+ 'field_no_view' => 0,
+ 'field_active' => 1,
+ 'field_is_contact' => 1,
+ 'field_contact_desc' => 'SEND_YIM_MESSAGE',
+ 'field_contact_url' => 'http://edit.yahoo.com/config/send_webmesg?.target=%s&amp;.src=pg',
+ );
+
+ protected $user_column_name = 'user_yim';
+}
diff --git a/phpBB/phpbb/db/migration/data/v310/profilefield_yahoo_cleanup.php b/phpBB/phpbb/db/migration/data/v310/profilefield_yahoo_cleanup.php
new file mode 100644
index 0000000000..bd724ff7db
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/profilefield_yahoo_cleanup.php
@@ -0,0 +1,51 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v310;
+
+class profilefield_yahoo_cleanup extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return !$this->db_tools->sql_column_exists($this->table_prefix . 'users', 'user_yim');
+ }
+
+ static public function depends_on()
+ {
+ return array(
+ '\phpbb\db\migration\data\v310\profilefield_yahoo',
+ );
+ }
+
+ public function update_schema()
+ {
+ return array(
+ 'drop_columns' => array(
+ $this->table_prefix . 'users' => array(
+ 'user_yim',
+ ),
+ ),
+ );
+ }
+
+ public function revert_schema()
+ {
+ return array(
+ 'add_columns' => array(
+ $this->table_prefix . 'users' => array(
+ 'user_yim' => array('VCHAR_UNI', ''),
+ ),
+ ),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v310/profilefield_youtube.php b/phpBB/phpbb/db/migration/data/v310/profilefield_youtube.php
new file mode 100644
index 0000000000..40a569d2a2
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/profilefield_youtube.php
@@ -0,0 +1,61 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v310;
+
+class profilefield_youtube extends \phpbb\db\migration\profilefield_base_migration
+{
+ static public function depends_on()
+ {
+ return array(
+ '\phpbb\db\migration\data\v310\profilefield_contact_field',
+ '\phpbb\db\migration\data\v310\profilefield_show_novalue',
+ '\phpbb\db\migration\data\v310\profilefield_types',
+ );
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('custom', array(array($this, 'create_custom_field'))),
+ );
+ }
+
+ protected $profilefield_name = 'phpbb_youtube';
+
+ protected $profilefield_database_type = array('VCHAR', '');
+
+ protected $profilefield_data = array(
+ 'field_name' => 'phpbb_youtube',
+ 'field_type' => 'profilefields.type.string',
+ 'field_ident' => 'phpbb_youtube',
+ 'field_length' => '20',
+ 'field_minlen' => '3',
+ 'field_maxlen' => '60',
+ 'field_novalue' => '',
+ 'field_default_value' => '',
+ 'field_validation' => '[a-zA-Z][\w\.,\-_]+',
+ 'field_required' => 0,
+ 'field_show_novalue' => 0,
+ 'field_show_on_reg' => 0,
+ 'field_show_on_pm' => 1,
+ 'field_show_on_vt' => 1,
+ 'field_show_profile' => 1,
+ 'field_hide' => 0,
+ 'field_no_view' => 0,
+ 'field_active' => 1,
+ 'field_is_contact' => 1,
+ 'field_contact_desc' => 'VIEW_YOUTUBE_CHANNEL',
+ 'field_contact_url' => 'http://youtube.com/user/%s',
+ );
+}
diff --git a/phpBB/phpbb/db/migration/data/v310/prune_shadow_topics.php b/phpBB/phpbb/db/migration/data/v310/prune_shadow_topics.php
new file mode 100644
index 0000000000..f6d27d385e
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/prune_shadow_topics.php
@@ -0,0 +1,50 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v310;
+
+class prune_shadow_topics extends \phpbb\db\migration\migration
+{
+ static public function depends_on()
+ {
+ return array('\phpbb\db\migration\data\v310\dev');
+ }
+
+ public function update_schema()
+ {
+ return array(
+ 'add_columns' => array(
+ $this->table_prefix . 'forums' => array(
+ 'enable_shadow_prune' => array('BOOL', 0),
+ 'prune_shadow_days' => array('UINT', 7),
+ 'prune_shadow_freq' => array('UINT', 1),
+ 'prune_shadow_next' => array('INT:11', 0),
+ ),
+ ),
+ );
+ }
+
+ public function revert_schema()
+ {
+ return array(
+ 'drop_columns' => array(
+ $this->table_prefix . 'forums' => array(
+ 'enable_shadow_prune',
+ 'prune_shadow_days',
+ 'prune_shadow_freq',
+ 'prune_shadow_next',
+ ),
+ ),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v310/rc1.php b/phpBB/phpbb/db/migration/data/v310/rc1.php
new file mode 100644
index 0000000000..751208c6ca
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/rc1.php
@@ -0,0 +1,44 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v310;
+
+class rc1 extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.1.0-RC1', '>=');
+ }
+
+ static public function depends_on()
+ {
+ return array(
+ '\phpbb\db\migration\data\v310\beta4',
+ '\phpbb\db\migration\data\v310\contact_admin_acp_module',
+ '\phpbb\db\migration\data\v310\contact_admin_form',
+ '\phpbb\db\migration\data\v310\passwords_convert_p2',
+ '\phpbb\db\migration\data\v310\profilefield_facebook',
+ '\phpbb\db\migration\data\v310\profilefield_googleplus',
+ '\phpbb\db\migration\data\v310\profilefield_skype',
+ '\phpbb\db\migration\data\v310\profilefield_twitter',
+ '\phpbb\db\migration\data\v310\profilefield_youtube',
+ );
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('config.update', array('version', '3.1.0-RC1')),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v310/rc2.php b/phpBB/phpbb/db/migration/data/v310/rc2.php
new file mode 100644
index 0000000000..5cd0393a13
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/rc2.php
@@ -0,0 +1,36 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v310;
+
+class rc2 extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.1.0-RC2', '>=');
+ }
+
+ static public function depends_on()
+ {
+ return array(
+ '\phpbb\db\migration\data\v310\rc1',
+ );
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('config.update', array('version', '3.1.0-RC2')),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v310/rc3.php b/phpBB/phpbb/db/migration/data/v310/rc3.php
new file mode 100644
index 0000000000..9fb483ef6a
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/rc3.php
@@ -0,0 +1,40 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v310;
+
+class rc3 extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.1.0-RC3', '>=');
+ }
+
+ static public function depends_on()
+ {
+ return array(
+ '\phpbb\db\migration\data\v310\rc2',
+ '\phpbb\db\migration\data\v310\captcha_plugins',
+ '\phpbb\db\migration\data\v310\rename_too_long_indexes',
+ '\phpbb\db\migration\data\v310\search_type',
+ '\phpbb\db\migration\data\v310\topic_sort_username',
+ );
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('config.update', array('version', '3.1.0-RC3')),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v310/rc4.php b/phpBB/phpbb/db/migration/data/v310/rc4.php
new file mode 100644
index 0000000000..0d756c762c
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/rc4.php
@@ -0,0 +1,37 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v310;
+
+class rc4 extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.1.0-RC4', '>=');
+ }
+
+ static public function depends_on()
+ {
+ return array(
+ '\phpbb\db\migration\data\v310\rc3',
+ '\phpbb\db\migration\data\v310\notifications_use_full_name',
+ );
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('config.update', array('version', '3.1.0-RC4')),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v310/rc5.php b/phpBB/phpbb/db/migration/data/v310/rc5.php
new file mode 100644
index 0000000000..d92537d877
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/rc5.php
@@ -0,0 +1,38 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v310;
+
+class rc5 extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.1.0-RC5', '>=');
+ }
+
+ static public function depends_on()
+ {
+ return array(
+ '\phpbb\db\migration\data\v310\rc4',
+ '\phpbb\db\migration\data\v310\profilefield_field_validation_length',
+ '\phpbb\db\migration\data\v310\remove_acp_styles_cache',
+ );
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('config.update', array('version', '3.1.0-RC5')),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v310/rc6.php b/phpBB/phpbb/db/migration/data/v310/rc6.php
new file mode 100644
index 0000000000..1df502a1e4
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/rc6.php
@@ -0,0 +1,36 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v310;
+
+class rc6 extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.1.0-RC6', '>=');
+ }
+
+ static public function depends_on()
+ {
+ return array(
+ '\phpbb\db\migration\data\v310\rc5',
+ );
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('config.update', array('version', '3.1.0-RC6')),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v310/remove_acp_styles_cache.php b/phpBB/phpbb/db/migration/data/v310/remove_acp_styles_cache.php
new file mode 100644
index 0000000000..7b84539814
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/remove_acp_styles_cache.php
@@ -0,0 +1,51 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v310;
+
+class remove_acp_styles_cache extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ $sql = 'SELECT module_id
+ FROM ' . MODULES_TABLE . "
+ WHERE module_class = 'acp'
+ AND module_langname = 'ACP_STYLES_CACHE'";
+ $result = $this->db->sql_query($sql);
+ $module_id = $this->db->sql_fetchfield('module_id');
+ $this->db->sql_freeresult($result);
+
+ return !$module_id;
+ }
+
+ static public function depends_on()
+ {
+ return array('\phpbb\db\migration\data\v310\rc4');
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('module.remove', array(
+ 'acp',
+ 'ACP_STYLE_MANAGEMENT',
+ array(
+ 'module_basename' => 'acp_styles',
+ 'module_langname' => 'ACP_STYLES_CACHE',
+ 'module_mode' => 'cache',
+ 'module_auth' => 'acl_a_styles',
+ ),
+ )),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v310/rename_too_long_indexes.php b/phpBB/phpbb/db/migration/data/v310/rename_too_long_indexes.php
new file mode 100644
index 0000000000..8d2a15d8ea
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/rename_too_long_indexes.php
@@ -0,0 +1,38 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v310;
+
+class rename_too_long_indexes extends \phpbb\db\migration\migration
+{
+ static public function depends_on()
+ {
+ return array('\phpbb\db\migration\data\v30x\release_3_0_0');
+ }
+
+ public function update_schema()
+ {
+ return array(
+ 'drop_keys' => array(
+ $this->table_prefix . 'search_wordmatch' => array(
+ 'unq_mtch',
+ ),
+ ),
+ 'add_unique_index' => array(
+ $this->table_prefix . 'search_wordmatch' => array(
+ 'un_mtch' => array('word_id', 'post_id', 'title_match'),
+ ),
+ ),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v310/reported_posts_display.php b/phpBB/phpbb/db/migration/data/v310/reported_posts_display.php
new file mode 100644
index 0000000000..575a65d9dd
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/reported_posts_display.php
@@ -0,0 +1,53 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v310;
+
+class reported_posts_display extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return $this->db_tools->sql_column_exists($this->table_prefix . 'reports', 'reported_post_enable_bbcode');
+ }
+
+ static public function depends_on()
+ {
+ return array('\phpbb\db\migration\data\v30x\release_3_0_11');
+ }
+
+ public function update_schema()
+ {
+ return array(
+ 'add_columns' => array(
+ $this->table_prefix . 'reports' => array(
+ 'reported_post_enable_bbcode' => array('BOOL', 1),
+ 'reported_post_enable_smilies' => array('BOOL', 1),
+ 'reported_post_enable_magic_url' => array('BOOL', 1),
+ ),
+ ),
+ );
+ }
+
+ public function revert_schema()
+ {
+ return array(
+ 'drop_columns' => array(
+ $this->table_prefix . 'reports' => array(
+ 'reported_post_enable_bbcode',
+ 'reported_post_enable_smilies',
+ 'reported_post_enable_magic_url',
+ ),
+ ),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v310/reset_missing_captcha_plugin.php b/phpBB/phpbb/db/migration/data/v310/reset_missing_captcha_plugin.php
new file mode 100644
index 0000000000..8211457dc6
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/reset_missing_captcha_plugin.php
@@ -0,0 +1,38 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v310;
+
+/**
+* Class captcha_plugin
+*
+* Reset the captcha setting to the default plugin if the defined 'captcha_plugin' is missing.
+*/
+class reset_missing_captcha_plugin extends \phpbb\db\migration\migration
+{
+ static public function depends_on()
+ {
+ return array('\phpbb\db\migration\data\v310\dev');
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('if', array(
+ (is_dir($this->phpbb_root_path . 'includes/captcha/plugins/') &&
+ !is_file($this->phpbb_root_path . "includes/captcha/plugins/{$this->config['captcha_plugin']}_plugin." . $this->php_ext)),
+ array('config.update', array('captcha_plugin', 'phpbb_captcha_nogd')),
+ )),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v310/search_type.php b/phpBB/phpbb/db/migration/data/v310/search_type.php
new file mode 100644
index 0000000000..f89456ae19
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/search_type.php
@@ -0,0 +1,34 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v310;
+
+class search_type extends \phpbb\db\migration\migration
+{
+ static public function depends_on()
+ {
+ return array(
+ '\phpbb\db\migration\data\v310\dev',
+ );
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('if', array(
+ (is_file($this->phpbb_root_path . 'phpbb/search/' . $this->config['search_type'] . $this->php_ext)),
+ array('config.update', array('search_type', '\\phpbb\\search\\' . $this->config['search_type'])),
+ )),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v310/signature_module_auth.php b/phpBB/phpbb/db/migration/data/v310/signature_module_auth.php
new file mode 100644
index 0000000000..e50f5e53a0
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/signature_module_auth.php
@@ -0,0 +1,57 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v310;
+
+class signature_module_auth extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ $sql = 'SELECT module_auth
+ FROM ' . MODULES_TABLE . "
+ WHERE module_class = 'ucp'
+ AND module_basename = 'ucp_profile'
+ AND module_mode = 'signature'";
+ $result = $this->db->sql_query($sql);
+ $module_auth = $this->db->sql_fetchfield('module_auth');
+ $this->db->sql_freeresult($result);
+
+ return $module_auth === 'acl_u_sig' || $module_auth === false;
+ }
+
+ static public function depends_on()
+ {
+ return array('\phpbb\db\migration\data\v310\dev');
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('custom', array(
+ array($this, 'update_signature_module_auth'),
+ ),
+ ),
+ );
+ }
+
+ public function update_signature_module_auth()
+ {
+ $sql = 'UPDATE ' . MODULES_TABLE . "
+ SET module_auth = 'acl_u_sig'
+ WHERE module_class = 'ucp'
+ AND module_basename = 'ucp_profile'
+ AND module_mode = 'signature'
+ AND module_auth = ''";
+ $this->db->sql_query($sql);
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v310/soft_delete_mod_convert.php b/phpBB/phpbb/db/migration/data/v310/soft_delete_mod_convert.php
new file mode 100644
index 0000000000..85b90da5fa
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/soft_delete_mod_convert.php
@@ -0,0 +1,127 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v310;
+
+use phpbb\db\migration\container_aware_migration;
+
+/**
+ * Migration to convert the Soft Delete MOD for 3.0
+ *
+ * https://www.phpbb.com/customise/db/mod/soft_delete/
+ */
+class soft_delete_mod_convert extends container_aware_migration
+{
+ static public function depends_on()
+ {
+ return array(
+ '\phpbb\db\migration\data\v310\alpha3',
+ );
+ }
+
+ public function effectively_installed()
+ {
+ return !$this->db_tools->sql_column_exists($this->table_prefix . 'posts', 'post_deleted');
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('permission.remove', array('m_harddelete', true)),
+ array('permission.remove', array('m_harddelete', false)),
+
+ array('custom', array(array($this, 'convert_posts'))),
+ array('custom', array(array($this, 'convert_topics'))),
+ );
+ }
+
+ public function convert_posts($start)
+ {
+ $content_visibility = $this->get_content_visibility();
+
+ $limit = 250;
+ $i = 0;
+
+ $sql = 'SELECT p.*, t.topic_first_post_id, t.topic_last_post_id
+ FROM ' . $this->table_prefix . 'posts p, ' . $this->table_prefix . 'topics t
+ WHERE p.post_deleted > 0
+ AND t.topic_id = p.topic_id';
+ $result = $this->db->sql_query_limit($sql, $limit, $start);
+
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $content_visibility->set_post_visibility(
+ ITEM_DELETED,
+ $row['post_id'],
+ $row['topic_id'],
+ $row['forum_id'],
+ $row['post_deleted'],
+ $row['post_deleted_time'],
+ '',
+ ($row['post_id'] == $row['topic_first_post_id']) ? true : false,
+ ($row['post_id'] == $row['topic_last_post_id']) ? true : false
+ );
+
+ $i++;
+ }
+
+ $this->db->sql_freeresult($result);
+
+ if ($i == $limit)
+ {
+ return $start + $i;
+ }
+ }
+
+ public function convert_topics($start)
+ {
+ $content_visibility = $this->get_content_visibility();
+
+ $limit = 100;
+ $i = 0;
+
+ $sql = 'SELECT *
+ FROM ' . $this->table_prefix . 'topics
+ WHERE topic_deleted > 0';
+ $result = $this->db->sql_query_limit($sql, $limit, $start);
+
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $content_visibility->set_topic_visibility(
+ ITEM_DELETED,
+ $row['topic_id'],
+ $row['forum_id'],
+ $row['topic_deleted'],
+ $row['topic_deleted_time'],
+ ''
+ );
+
+ $i++;
+ }
+
+ $this->db->sql_freeresult($result);
+
+ if ($i == $limit)
+ {
+ return $start + $i;
+ }
+ }
+
+ /**
+ * @return \phpbb\content_visibility
+ */
+ protected function get_content_visibility()
+ {
+ return $this->container->get('content.visibility');
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v310/soft_delete_mod_convert2.php b/phpBB/phpbb/db/migration/data/v310/soft_delete_mod_convert2.php
new file mode 100644
index 0000000000..246a267a8c
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/soft_delete_mod_convert2.php
@@ -0,0 +1,66 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v310;
+
+/**
+ * Migration to convert the Soft Delete MOD for 3.0
+ *
+ * https://www.phpbb.com/customise/db/mod/soft_delete/
+ */
+class soft_delete_mod_convert2 extends \phpbb\db\migration\migration
+{
+ static public function depends_on()
+ {
+ return array(
+ '\phpbb\db\migration\data\v310\soft_delete_mod_convert',
+ );
+ }
+
+ public function effectively_installed()
+ {
+ return !$this->db_tools->sql_column_exists($this->table_prefix . 'posts', 'post_deleted');
+ }
+
+ public function update_schema()
+ {
+ return array(
+ 'drop_columns' => array(
+ $this->table_prefix . 'forums' => array('forum_deleted_topic_count', 'forum_deleted_reply_count'),
+ $this->table_prefix . 'posts' => array('post_deleted', 'post_deleted_time'),
+ $this->table_prefix . 'topics' => array('topic_deleted', 'topic_deleted_time', 'topic_deleted_reply_count'),
+ ),
+ );
+ }
+
+ public function revert_schema()
+ {
+ return array(
+ 'add_columns' => array(
+ $this->table_prefix . 'forums' => array(
+ 'forum_deleted_topic_count' => array('UINT', 0),
+ 'forum_deleted_reply_count' => array('UINT', 0),
+ ),
+ $this->table_prefix . 'posts' => array(
+ 'post_deleted' => array('UINT', 0),
+ 'post_deleted_time' => array('TIMESTAMP', 0),
+ ),
+ $this->table_prefix . 'topics' => array(
+ 'topic_deleted' => array('UINT', 0),
+ 'topic_deleted_time' => array('TIMESTAMP', 0),
+ 'topic_deleted_reply_count' => array('UINT', 0),
+ ),
+ ),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v310/softdelete_mcp_modules.php b/phpBB/phpbb/db/migration/data/v310/softdelete_mcp_modules.php
new file mode 100644
index 0000000000..5e68db5889
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/softdelete_mcp_modules.php
@@ -0,0 +1,61 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v310;
+
+class softdelete_mcp_modules extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ $sql = 'SELECT module_id
+ FROM ' . MODULES_TABLE . "
+ WHERE module_class = 'mcp'
+ AND module_basename = 'mcp_queue'
+ AND module_mode = 'deleted_topics'";
+ $result = $this->db->sql_query($sql);
+ $module_id = $this->db->sql_fetchfield('module_id');
+ $this->db->sql_freeresult($result);
+
+ return $module_id !== false;
+ }
+
+ static public function depends_on()
+ {
+ return array(
+ '\phpbb\db\migration\data\v310\dev',
+ '\phpbb\db\migration\data\v310\softdelete_p2',
+ );
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('module.add', array(
+ 'mcp',
+ 'MCP_QUEUE',
+ array(
+ 'module_basename' => 'mcp_queue',
+ 'modes' => array('deleted_topics'),
+ ),
+ )),
+ array('module.add', array(
+ 'mcp',
+ 'MCP_QUEUE',
+ array(
+ 'module_basename' => 'mcp_queue',
+ 'modes' => array('deleted_posts'),
+ ),
+ )),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v310/softdelete_p1.php b/phpBB/phpbb/db/migration/data/v310/softdelete_p1.php
new file mode 100644
index 0000000000..b1e7486e24
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/softdelete_p1.php
@@ -0,0 +1,211 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v310;
+
+class softdelete_p1 extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return $this->db_tools->sql_column_exists($this->table_prefix . 'posts', 'post_visibility');
+ }
+
+ static public function depends_on()
+ {
+ return array('\phpbb\db\migration\data\v310\dev');
+ }
+
+ public function update_schema()
+ {
+ return array(
+ 'add_columns' => array(
+ $this->table_prefix . 'forums' => array(
+ 'forum_posts_approved' => array('UINT', 0),
+ 'forum_posts_unapproved' => array('UINT', 0),
+ 'forum_posts_softdeleted' => array('UINT', 0),
+ 'forum_topics_approved' => array('UINT', 0),
+ 'forum_topics_unapproved' => array('UINT', 0),
+ 'forum_topics_softdeleted' => array('UINT', 0),
+ ),
+ $this->table_prefix . 'posts' => array(
+ 'post_visibility' => array('TINT:3', 0),
+ 'post_delete_time' => array('TIMESTAMP', 0),
+ 'post_delete_reason' => array('STEXT_UNI', ''),
+ 'post_delete_user' => array('UINT', 0),
+ ),
+ $this->table_prefix . 'topics' => array(
+ 'topic_visibility' => array('TINT:3', 0),
+ 'topic_delete_time' => array('TIMESTAMP', 0),
+ 'topic_delete_reason' => array('STEXT_UNI', ''),
+ 'topic_delete_user' => array('UINT', 0),
+ 'topic_posts_approved' => array('UINT', 0),
+ 'topic_posts_unapproved' => array('UINT', 0),
+ 'topic_posts_softdeleted' => array('UINT', 0),
+ ),
+ ),
+ 'add_index' => array(
+ $this->table_prefix . 'posts' => array(
+ 'post_visibility' => array('post_visibility'),
+ ),
+ $this->table_prefix . 'topics' => array(
+ 'topic_visibility' => array('topic_visibility'),
+ 'forum_vis_last' => array('forum_id', 'topic_visibility', 'topic_last_post_id'),
+ ),
+ ),
+ );
+ }
+
+ public function revert_schema()
+ {
+ return array(
+ 'drop_columns' => array(
+ $this->table_prefix . 'forums' => array(
+ 'forum_posts_approved',
+ 'forum_posts_unapproved',
+ 'forum_posts_softdeleted',
+ 'forum_topics_approved',
+ 'forum_topics_unapproved',
+ 'forum_topics_softdeleted',
+ ),
+ $this->table_prefix . 'posts' => array(
+ 'post_visibility',
+ 'post_delete_time',
+ 'post_delete_reason',
+ 'post_delete_user',
+ ),
+ $this->table_prefix . 'topics' => array(
+ 'topic_visibility',
+ 'topic_delete_time',
+ 'topic_delete_reason',
+ 'topic_delete_user',
+ 'topic_posts_approved',
+ 'topic_posts_unapproved',
+ 'topic_posts_softdeleted',
+ ),
+ ),
+ 'drop_keys' => array(
+ $this->table_prefix . 'posts' => array('post_visibility'),
+ $this->table_prefix . 'topics' => array('topic_visibility', 'forum_vis_last'),
+ ),
+ );
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('custom', array(array($this, 'update_post_visibility'))),
+ array('custom', array(array($this, 'update_topic_visibility'))),
+ array('custom', array(array($this, 'update_topics_post_counts'))),
+ array('custom', array(array($this, 'update_forums_topic_and_post_counts'))),
+
+ array('permission.add', array('f_softdelete', false)),
+ array('permission.add', array('m_softdelete', false)),
+ );
+ }
+
+ public function update_post_visibility()
+ {
+ $sql = 'UPDATE ' . $this->table_prefix . 'posts
+ SET post_visibility = post_approved';
+ $this->sql_query($sql);
+ }
+
+ public function update_topic_visibility()
+ {
+ $sql = 'UPDATE ' . $this->table_prefix . 'topics
+ SET topic_visibility = topic_approved';
+ $this->sql_query($sql);
+ }
+
+ public function update_topics_post_counts()
+ {
+ /*
+ * Using sql_case here to avoid "BIGINT UNSIGNED value is out of range" errors.
+ * As we update all topics in 2 queries, one broken topic would stop the conversion
+ * for all topics and the surpressed error will cause the admin to not even notice it.
+ */
+ $sql = 'UPDATE ' . $this->table_prefix . 'topics
+ SET topic_posts_approved = topic_replies + 1,
+ topic_posts_unapproved = ' . $this->db->sql_case('topic_replies_real > topic_replies', 'topic_replies_real - topic_replies', '0') . '
+ WHERE topic_visibility = ' . ITEM_APPROVED;
+ $this->sql_query($sql);
+
+ $sql = 'UPDATE ' . $this->table_prefix . 'topics
+ SET topic_posts_approved = 0,
+ topic_posts_unapproved = (' . $this->db->sql_case('topic_replies_real > topic_replies', 'topic_replies_real - topic_replies', '0') . ') + 1
+ WHERE topic_visibility = ' . ITEM_UNAPPROVED;
+ $this->sql_query($sql);
+ }
+
+ public function update_forums_topic_and_post_counts($start)
+ {
+ $start = (int) $start;
+ $limit = 10;
+ $converted_forums = 0;
+
+ if (!$start)
+ {
+ // Preserve the forum_posts value for link forums as it represents redirects.
+ $sql = 'UPDATE ' . $this->table_prefix . 'forums
+ SET forum_posts_approved = forum_posts
+ WHERE forum_type = ' . FORUM_LINK;
+ $this->db->sql_query($sql);
+ }
+
+ $sql = 'SELECT forum_id, topic_visibility, COUNT(topic_id) AS sum_topics, SUM(topic_posts_approved) AS sum_posts_approved, SUM(topic_posts_unapproved) AS sum_posts_unapproved
+ FROM ' . $this->table_prefix . 'topics
+ GROUP BY forum_id, topic_visibility
+ ORDER BY forum_id, topic_visibility';
+ $result = $this->db->sql_query_limit($sql, $limit, $start);
+
+ $update_forums = array();
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $converted_forums++;
+
+ $forum_id = (int) $row['forum_id'];
+ if (!isset($update_forums[$forum_id]))
+ {
+ $update_forums[$forum_id] = array(
+ 'forum_posts_approved' => 0,
+ 'forum_posts_unapproved' => 0,
+ 'forum_topics_approved' => 0,
+ 'forum_topics_unapproved' => 0,
+ );
+ }
+
+ $update_forums[$forum_id]['forum_posts_approved'] += (int) $row['sum_posts_approved'];
+ $update_forums[$forum_id]['forum_posts_unapproved'] += (int) $row['sum_posts_unapproved'];
+
+ $update_forums[$forum_id][(($row['topic_visibility'] == ITEM_APPROVED) ? 'forum_topics_approved' : 'forum_topics_unapproved')] += (int) $row['sum_topics'];
+ }
+ $this->db->sql_freeresult($result);
+
+ foreach ($update_forums as $forum_id => $forum_data)
+ {
+ $sql = 'UPDATE ' . FORUMS_TABLE . '
+ SET ' . $this->db->sql_build_array('UPDATE', $forum_data) . '
+ WHERE forum_id = ' . $forum_id;
+ $this->sql_query($sql);
+ }
+
+ if ($converted_forums < $limit)
+ {
+ // There are no more topics, we are done
+ return;
+ }
+
+ // There are still more topics to query, return the next start value
+ return $start + $limit;
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v310/softdelete_p2.php b/phpBB/phpbb/db/migration/data/v310/softdelete_p2.php
new file mode 100644
index 0000000000..849a996c1b
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/softdelete_p2.php
@@ -0,0 +1,78 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v310;
+
+class softdelete_p2 extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return !$this->db_tools->sql_column_exists($this->table_prefix . 'posts', 'post_approved');
+ }
+
+ static public function depends_on()
+ {
+ return array(
+ '\phpbb\db\migration\data\v310\dev',
+ '\phpbb\db\migration\data\v310\softdelete_p1',
+ );
+ }
+
+ public function update_schema()
+ {
+ return array(
+ 'drop_columns' => array(
+ $this->table_prefix . 'forums' => array('forum_posts', 'forum_topics', 'forum_topics_real'),
+ $this->table_prefix . 'posts' => array('post_approved'),
+ $this->table_prefix . 'topics' => array('topic_approved', 'topic_replies', 'topic_replies_real'),
+ ),
+ 'drop_keys' => array(
+ $this->table_prefix . 'posts' => array('post_approved'),
+ $this->table_prefix . 'topics' => array(
+ 'forum_appr_last',
+ 'topic_approved',
+ ),
+ ),
+ );
+ }
+
+ public function revert_schema()
+ {
+ return array(
+ 'add_columns' => array(
+ $this->table_prefix . 'forums' => array(
+ 'forum_posts' => array('UINT', 0),
+ 'forum_topics' => array('UINT', 0),
+ 'forum_topics_real' => array('UINT', 0),
+ ),
+ $this->table_prefix . 'posts' => array(
+ 'post_approved' => array('BOOL', 1),
+ ),
+ $this->table_prefix . 'topics' => array(
+ 'topic_approved' => array('BOOL', 1),
+ 'topic_replies' => array('UINT', 0),
+ 'topic_replies_real' => array('UINT', 0),
+ ),
+ ),
+ 'add_index' => array(
+ $this->table_prefix . 'posts' => array(
+ 'post_approved' => array('post_approved'),
+ ),
+ $this->table_prefix . 'topics' => array(
+ 'forum_appr_last' => array('forum_id', 'topic_approved', 'topic_last_post_id'),
+ 'topic_approved' => array('topic_approved'),
+ ),
+ ),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v310/style_update_p1.php b/phpBB/phpbb/db/migration/data/v310/style_update_p1.php
new file mode 100644
index 0000000000..2c7b7edf2e
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/style_update_p1.php
@@ -0,0 +1,191 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v310;
+
+class style_update_p1 extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return !$this->db_tools->sql_table_exists($this->table_prefix . 'styles_imageset');
+ }
+
+ static public function depends_on()
+ {
+ return array('\phpbb\db\migration\data\v30x\release_3_0_11');
+ }
+
+ public function update_schema()
+ {
+ return array(
+ 'add_columns' => array(
+ $this->table_prefix . 'styles' => array(
+ 'style_path' => array('VCHAR:100', ''),
+ 'bbcode_bitfield' => array('VCHAR:255', 'kNg='),
+ 'style_parent_id' => array('UINT', 0),
+ 'style_parent_tree' => array('TEXT', ''),
+ ),
+ ),
+ );
+ }
+
+ public function revert_schema()
+ {
+ return array(
+ 'drop_columns' => array(
+ $this->table_prefix . 'styles' => array(
+ 'style_path',
+ 'bbcode_bitfield',
+ 'style_parent_id',
+ 'style_parent_tree',
+ ),
+ ),
+ );
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('custom', array(array($this, 'styles_update'))),
+ );
+ }
+
+ public function styles_update()
+ {
+ // Get list of valid 3.1 styles
+ $available_styles = array('prosilver');
+
+ $iterator = new \DirectoryIterator($this->phpbb_root_path . 'styles');
+ $skip_dirs = array('.', '..', 'prosilver');
+ foreach ($iterator as $fileinfo)
+ {
+ if ($fileinfo->isDir() && !in_array($fileinfo->getFilename(), $skip_dirs) && file_exists($fileinfo->getPathname() . '/style.cfg'))
+ {
+ $style_cfg = parse_cfg_file($fileinfo->getPathname() . '/style.cfg');
+ if (isset($style_cfg['phpbb_version']) && version_compare($style_cfg['phpbb_version'], '3.1.0-dev', '>='))
+ {
+ // 3.1 style
+ $available_styles[] = $fileinfo->getFilename();
+ }
+ }
+ }
+
+ // Get all installed styles
+ if ($this->db_tools->sql_table_exists($this->table_prefix . 'styles_imageset'))
+ {
+ $sql = 'SELECT s.style_id, t.template_path, t.template_id, t.bbcode_bitfield, t.template_inherits_id, t.template_inherit_path, c.theme_path, c.theme_id, i.imageset_path
+ FROM ' . STYLES_TABLE . ' s, ' . $this->table_prefix . 'styles_template t, ' . $this->table_prefix . 'styles_theme c, ' . $this->table_prefix . "styles_imageset i
+ WHERE t.template_id = s.template_id
+ AND c.theme_id = s.theme_id
+ AND i.imageset_id = s.imageset_id";
+ }
+ else
+ {
+ $sql = 'SELECT s.style_id, t.template_path, t.template_id, t.bbcode_bitfield, t.template_inherits_id, t.template_inherit_path, c.theme_path, c.theme_id
+ FROM ' . STYLES_TABLE . ' s, ' . $this->table_prefix . 'styles_template t, ' . $this->table_prefix . "styles_theme c
+ WHERE t.template_id = s.template_id
+ AND c.theme_id = s.theme_id";
+ }
+ $result = $this->db->sql_query($sql);
+
+ $styles = array();
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $styles[] = $row;
+ }
+ $this->db->sql_freeresult($result);
+
+ // Decide which styles to keep, all others will be deleted
+ $valid_styles = array();
+ foreach ($styles as $style_row)
+ {
+ if (
+ // Delete styles with parent style (not supported yet)
+ $style_row['template_inherits_id'] == 0 &&
+ // Check if components match
+ $style_row['template_path'] == $style_row['theme_path'] && (!isset($style_row['imageset_path']) || $style_row['template_path'] == $style_row['imageset_path']) &&
+ // Check if components are valid
+ in_array($style_row['template_path'], $available_styles)
+ )
+ {
+ // Valid style. Keep it
+ $sql_ary = array(
+ 'style_path' => $style_row['template_path'],
+ 'bbcode_bitfield' => $style_row['bbcode_bitfield'],
+ 'style_parent_id' => 0,
+ 'style_parent_tree' => '',
+ );
+ $this->sql_query('UPDATE ' . STYLES_TABLE . '
+ SET ' . $this->db->sql_build_array('UPDATE', $sql_ary) . '
+ WHERE style_id = ' . $style_row['style_id']);
+ $valid_styles[] = (int) $style_row['style_id'];
+ }
+ }
+
+ // Remove old entries from styles table
+ if (!sizeof($valid_styles))
+ {
+ // No valid styles: remove everything and add prosilver
+ $this->sql_query('DELETE FROM ' . STYLES_TABLE);
+
+ $sql_ary = array(
+ 'style_name' => 'prosilver',
+ 'style_copyright' => '&copy; phpBB Limited',
+ 'style_active' => 1,
+ 'style_path' => 'prosilver',
+ 'bbcode_bitfield' => 'lNg=',
+ 'style_parent_id' => 0,
+ 'style_parent_tree' => '',
+
+ // Will be removed in the next step
+ 'imageset_id' => 0,
+ 'template_id' => 0,
+ 'theme_id' => 0,
+ );
+
+ $sql = 'INSERT INTO ' . STYLES_TABLE . ' ' . $this->db->sql_build_array('INSERT', $sql_ary);
+ $this->sql_query($sql);
+
+ $sql = 'SELECT style_id
+ FROM ' . STYLES_TABLE . "
+ WHERE style_name = 'prosilver'";
+ $result = $this->sql_query($sql);
+ $default_style = $this->db->sql_fetchfield('style_id');
+ $this->db->sql_freeresult($result);
+
+ $this->config->set('default_style', $default_style);
+
+ $sql = 'UPDATE ' . USERS_TABLE . ' SET user_style = 0';
+ $this->sql_query($sql);
+ }
+ else
+ {
+ // There are valid styles in styles table. Remove styles that are outdated
+ $this->sql_query('DELETE FROM ' . STYLES_TABLE . '
+ WHERE ' . $this->db->sql_in_set('style_id', $valid_styles, true));
+
+ // Change default style
+ if (!in_array($this->config['default_style'], $valid_styles))
+ {
+ $this->sql_query('UPDATE ' . CONFIG_TABLE . "
+ SET config_value = '" . $valid_styles[0] . "'
+ WHERE config_name = 'default_style'");
+ }
+
+ // Reset styles for users
+ $this->sql_query('UPDATE ' . USERS_TABLE . '
+ SET user_style = 0
+ WHERE ' . $this->db->sql_in_set('user_style', $valid_styles, true));
+ }
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v310/style_update_p2.php b/phpBB/phpbb/db/migration/data/v310/style_update_p2.php
new file mode 100644
index 0000000000..52c8ffb2e2
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/style_update_p2.php
@@ -0,0 +1,151 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v310;
+
+class style_update_p2 extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return !$this->db_tools->sql_table_exists($this->table_prefix . 'styles_imageset');
+ }
+
+ static public function depends_on()
+ {
+ return array('\phpbb\db\migration\data\v310\style_update_p1');
+ }
+
+ public function update_schema()
+ {
+ return array(
+ 'drop_keys' => array(
+ $this->table_prefix . 'styles' => array(
+ 'imageset_id',
+ 'template_id',
+ 'theme_id',
+ ),
+ ),
+
+ 'drop_columns' => array(
+ $this->table_prefix . 'styles' => array(
+ 'imageset_id',
+ 'template_id',
+ 'theme_id',
+ ),
+ ),
+
+ 'drop_tables' => array(
+ $this->table_prefix . 'styles_imageset',
+ $this->table_prefix . 'styles_imageset_data',
+ $this->table_prefix . 'styles_template',
+ $this->table_prefix . 'styles_template_data',
+ $this->table_prefix . 'styles_theme',
+ ),
+ );
+ }
+
+ public function revert_schema()
+ {
+ return array(
+ 'add_columns' => array(
+ $this->table_prefix . 'styles' => array(
+ 'imageset_id' => array('UINT', 0),
+ 'template_id' => array('UINT', 0),
+ 'theme_id' => array('UINT', 0),
+ ),
+ ),
+
+ 'add_index' => array(
+ $this->table_prefix . 'styles' => array(
+ 'imageset_id' => array('imageset_id'),
+ 'template_id' => array('template_id'),
+ 'theme_id' => array('theme_id'),
+ ),
+ ),
+
+ 'add_tables' => array(
+ $this->table_prefix . 'styles_imageset' => array(
+ 'COLUMNS' => array(
+ 'imageset_id' => array('UINT', null, 'auto_increment'),
+ 'imageset_name' => array('VCHAR_UNI:255', ''),
+ 'imageset_copyright' => array('VCHAR_UNI', ''),
+ 'imageset_path' => array('VCHAR:100', ''),
+ ),
+ 'PRIMARY_KEY' => 'imageset_id',
+ 'KEYS' => array(
+ 'imgset_nm' => array('UNIQUE', 'imageset_name'),
+ ),
+ ),
+ $this->table_prefix . 'styles_imageset_data' => array(
+ 'COLUMNS' => array(
+ 'image_id' => array('UINT', null, 'auto_increment'),
+ 'image_name' => array('VCHAR:200', ''),
+ 'image_filename' => array('VCHAR:200', ''),
+ 'image_lang' => array('VCHAR:30', ''),
+ 'image_height' => array('USINT', 0),
+ 'image_width' => array('USINT', 0),
+ 'imageset_id' => array('UINT', 0),
+ ),
+ 'PRIMARY_KEY' => 'image_id',
+ 'KEYS' => array(
+ 'i_d' => array('INDEX', 'imageset_id'),
+ ),
+ ),
+ $this->table_prefix . 'styles_template' => array(
+ 'COLUMNS' => array(
+ 'template_id' => array('UINT', null, 'auto_increment'),
+ 'template_name' => array('VCHAR_UNI:255', ''),
+ 'template_copyright' => array('VCHAR_UNI', ''),
+ 'template_path' => array('VCHAR:100', ''),
+ 'bbcode_bitfield' => array('VCHAR:255', 'kNg='),
+ 'template_storedb' => array('BOOL', 0),
+ 'template_inherits_id' => array('UINT:4', 0),
+ 'template_inherit_path' => array('VCHAR', ''),
+ ),
+ 'PRIMARY_KEY' => 'template_id',
+ 'KEYS' => array(
+ 'tmplte_nm' => array('UNIQUE', 'template_name'),
+ ),
+ ),
+ $this->table_prefix . 'styles_template_data' => array(
+ 'COLUMNS' => array(
+ 'template_id' => array('UINT', 0),
+ 'template_filename' => array('VCHAR:100', ''),
+ 'template_included' => array('TEXT', ''),
+ 'template_mtime' => array('TIMESTAMP', 0),
+ 'template_data' => array('MTEXT_UNI', ''),
+ ),
+ 'KEYS' => array(
+ 'tid' => array('INDEX', 'template_id'),
+ 'tfn' => array('INDEX', 'template_filename'),
+ ),
+ ),
+ $this->table_prefix . 'styles_theme' => array(
+ 'COLUMNS' => array(
+ 'theme_id' => array('UINT', null, 'auto_increment'),
+ 'theme_name' => array('VCHAR_UNI:255', ''),
+ 'theme_copyright' => array('VCHAR_UNI', ''),
+ 'theme_path' => array('VCHAR:100', ''),
+ 'theme_storedb' => array('BOOL', 0),
+ 'theme_mtime' => array('TIMESTAMP', 0),
+ 'theme_data' => array('MTEXT_UNI', ''),
+ ),
+ 'PRIMARY_KEY' => 'theme_id',
+ 'KEYS' => array(
+ 'theme_name' => array('UNIQUE', 'theme_name'),
+ ),
+ ),
+ ),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v310/teampage.php b/phpBB/phpbb/db/migration/data/v310/teampage.php
new file mode 100644
index 0000000000..f8edbc3492
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/teampage.php
@@ -0,0 +1,110 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v310;
+
+class teampage extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return $this->db_tools->sql_table_exists($this->table_prefix . 'teampage');
+ }
+
+ static public function depends_on()
+ {
+ return array('\phpbb\db\migration\data\v310\dev');
+ }
+
+ public function update_schema()
+ {
+ return array(
+ 'add_tables' => array(
+ $this->table_prefix . 'teampage' => array(
+ 'COLUMNS' => array(
+ 'teampage_id' => array('UINT', null, 'auto_increment'),
+ 'group_id' => array('UINT', 0),
+ 'teampage_name' => array('VCHAR_UNI:255', ''),
+ 'teampage_position' => array('UINT', 0),
+ 'teampage_parent' => array('UINT', 0),
+ ),
+ 'PRIMARY_KEY' => 'teampage_id',
+ ),
+ ),
+ 'drop_columns' => array(
+ $this->table_prefix . 'groups' => array(
+ 'group_teampage',
+ ),
+ ),
+ );
+ }
+
+ public function revert_schema()
+ {
+ return array(
+ 'drop_tables' => array(
+ $this->table_prefix . 'teampage',
+ ),
+ 'add_columns' => array(
+ $this->table_prefix . 'groups' => array(
+ 'group_teampage' => array('UINT', 0, 'after' => 'group_legend'),
+ ),
+ ),
+ );
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('custom', array(array($this, 'add_groups_teampage'))),
+ );
+ }
+
+ public function add_groups_teampage()
+ {
+ $sql = 'SELECT teampage_id
+ FROM ' . TEAMPAGE_TABLE;
+ $result = $this->db->sql_query_limit($sql, 1);
+ $added_groups_teampage = (bool) $this->db->sql_fetchfield('teampage_id');
+ $this->db->sql_freeresult($result);
+
+ if (!$added_groups_teampage)
+ {
+ $sql = 'SELECT *
+ FROM ' . GROUPS_TABLE . '
+ WHERE group_type = ' . GROUP_SPECIAL . "
+ AND (group_name = 'ADMINISTRATORS'
+ OR group_name = 'GLOBAL_MODERATORS')
+ ORDER BY group_name ASC";
+ $result = $this->db->sql_query($sql);
+
+ $teampage_entries = array();
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $teampage_entries[] = array(
+ 'group_id' => (int) $row['group_id'],
+ 'teampage_name' => '',
+ 'teampage_position' => sizeof($teampage_entries) + 1,
+ 'teampage_parent' => 0,
+ );
+ }
+ $this->db->sql_freeresult($result);
+
+ if (sizeof($teampage_entries))
+ {
+ $this->db->sql_multi_insert(TEAMPAGE_TABLE, $teampage_entries);
+ }
+ unset($teampage_entries);
+ }
+
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v310/timezone.php b/phpBB/phpbb/db/migration/data/v310/timezone.php
new file mode 100644
index 0000000000..1f6b47ad50
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/timezone.php
@@ -0,0 +1,194 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v310;
+
+class timezone extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return !$this->db_tools->sql_column_exists($this->table_prefix . 'users', 'user_dst');
+ }
+
+ static public function depends_on()
+ {
+ return array('\phpbb\db\migration\data\v30x\release_3_0_11');
+ }
+
+ public function update_schema()
+ {
+ return array(
+ 'change_columns' => array(
+ $this->table_prefix . 'users' => array(
+ 'user_timezone' => array('VCHAR:100', ''),
+ ),
+ ),
+ );
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('custom', array(array($this, 'update_timezones'))),
+ );
+ }
+
+ public function update_timezones($start)
+ {
+ $start = (int) $start;
+ $limit = 500;
+ $converted = 0;
+
+ $update_blocks = array();
+
+ $sql = 'SELECT user_id, user_timezone, user_dst
+ FROM ' . $this->table_prefix . 'users
+ ORDER BY user_id ASC';
+ $result = $this->db->sql_query_limit($sql, $limit, $start);
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $converted++;
+
+ // In case this is somehow run twice on a row.
+ // Otherwise it would just end up as UTC on the second run
+ if (is_numeric($row['user_timezone']))
+ {
+ $update_blocks[$row['user_timezone'] . ':' . $row['user_dst']][] = (int) $row['user_id'];
+ }
+ }
+ $this->db->sql_freeresult($result);
+
+ // Update blocks of users who share the same timezone/dst
+ foreach ($update_blocks as $timezone => $user_ids)
+ {
+ $timezone = explode(':', $timezone);
+ $converted_timezone = $this->convert_phpbb30_timezone($timezone[0], $timezone[1]);
+
+ $sql = 'UPDATE ' . $this->table_prefix . "users
+ SET user_timezone = '" . $this->db->sql_escape($converted_timezone) . "'
+ WHERE " . $this->db->sql_in_set('user_id', $user_ids);
+ $this->sql_query($sql);
+ }
+
+ if ($converted == $limit)
+ {
+ // There are still more to convert
+ return $start + $limit;
+ }
+
+ // Update board default timezone
+ $sql = 'UPDATE ' . $this->table_prefix . "config
+ SET config_value = '" . $this->convert_phpbb30_timezone($this->config['board_timezone'], $this->config['board_dst']) . "'
+ WHERE config_name = 'board_timezone'";
+ $this->sql_query($sql);
+ }
+
+ /**
+ * Determine the new timezone for a given phpBB 3.0 timezone and
+ * "Daylight Saving Time" option
+ *
+ * @param $timezone float Users timezone in 3.0
+ * @param $dst int Users daylight saving time
+ * @return string Users new php Timezone which is used since 3.1
+ */
+ public function convert_phpbb30_timezone($timezone, $dst)
+ {
+ $offset = $timezone + $dst;
+
+ switch ($timezone)
+ {
+ case '-12':
+ return 'Etc/GMT+' . abs($offset); //'[UTC - 12] Baker Island Time'
+ case '-11':
+ return 'Etc/GMT+' . abs($offset); //'[UTC - 11] Niue Time, Samoa Standard Time'
+ case '-10':
+ return 'Etc/GMT+' . abs($offset); //'[UTC - 10] Hawaii-Aleutian Standard Time, Cook Island Time'
+ case '-9.5':
+ return 'Pacific/Marquesas'; //'[UTC - 9:30] Marquesas Islands Time'
+ case '-9':
+ return 'Etc/GMT+' . abs($offset); //'[UTC - 9] Alaska Standard Time, Gambier Island Time'
+ case '-8':
+ return 'Etc/GMT+' . abs($offset); //'[UTC - 8] Pacific Standard Time'
+ case '-7':
+ return 'Etc/GMT+' . abs($offset); //'[UTC - 7] Mountain Standard Time'
+ case '-6':
+ return 'Etc/GMT+' . abs($offset); //'[UTC - 6] Central Standard Time'
+ case '-5':
+ return 'Etc/GMT+' . abs($offset); //'[UTC - 5] Eastern Standard Time'
+ case '-4.5':
+ return 'America/Caracas'; //'[UTC - 4:30] Venezuelan Standard Time'
+ case '-4':
+ return 'Etc/GMT+' . abs($offset); //'[UTC - 4] Atlantic Standard Time'
+ case '-3.5':
+ return 'America/St_Johns'; //'[UTC - 3:30] Newfoundland Standard Time'
+ case '-3':
+ return 'Etc/GMT+' . abs($offset); //'[UTC - 3] Amazon Standard Time, Central Greenland Time'
+ case '-2':
+ return 'Etc/GMT+' . abs($offset); //'[UTC - 2] Fernando de Noronha Time, South Georgia &amp; the South Sandwich Islands Time'
+ case '-1':
+ return 'Etc/GMT+' . abs($offset); //'[UTC - 1] Azores Standard Time, Cape Verde Time, Eastern Greenland Time'
+ case '0':
+ return (!$dst) ? 'UTC' : 'Etc/GMT-1'; //'[UTC] Western European Time, Greenwich Mean Time'
+ case '1':
+ return 'Etc/GMT-' . $offset; //'[UTC + 1] Central European Time, West African Time'
+ case '2':
+ return 'Etc/GMT-' . $offset; //'[UTC + 2] Eastern European Time, Central African Time'
+ case '3':
+ return 'Etc/GMT-' . $offset; //'[UTC + 3] Moscow Standard Time, Eastern African Time'
+ case '3.5':
+ return 'Asia/Tehran'; //'[UTC + 3:30] Iran Standard Time'
+ case '4':
+ return 'Etc/GMT-' . $offset; //'[UTC + 4] Gulf Standard Time, Samara Standard Time'
+ case '4.5':
+ return 'Asia/Kabul'; //'[UTC + 4:30] Afghanistan Time'
+ case '5':
+ return 'Etc/GMT-' . $offset; //'[UTC + 5] Pakistan Standard Time, Yekaterinburg Standard Time'
+ case '5.5':
+ return 'Asia/Kolkata'; //'[UTC + 5:30] Indian Standard Time, Sri Lanka Time'
+ case '5.75':
+ return 'Asia/Kathmandu'; //'[UTC + 5:45] Nepal Time'
+ case '6':
+ return 'Etc/GMT-' . $offset; //'[UTC + 6] Bangladesh Time, Bhutan Time, Novosibirsk Standard Time'
+ case '6.5':
+ return 'Indian/Cocos'; //'[UTC + 6:30] Cocos Islands Time, Myanmar Time'
+ case '7':
+ return 'Etc/GMT-' . $offset; //'[UTC + 7] Indochina Time, Krasnoyarsk Standard Time'
+ case '8':
+ return 'Etc/GMT-' . $offset; //'[UTC + 8] Chinese Standard Time, Australian Western Standard Time, Irkutsk Standard Time'
+ case '8.75':
+ return 'Australia/Eucla'; //'[UTC + 8:45] Southeastern Western Australia Standard Time'
+ case '9':
+ return 'Etc/GMT-' . $offset; //'[UTC + 9] Japan Standard Time, Korea Standard Time, Chita Standard Time'
+ case '9.5':
+ return 'Australia/ACT'; //'[UTC + 9:30] Australian Central Standard Time'
+ case '10':
+ return 'Etc/GMT-' . $offset; //'[UTC + 10] Australian Eastern Standard Time, Vladivostok Standard Time'
+ case '10.5':
+ return 'Australia/Lord_Howe'; //'[UTC + 10:30] Lord Howe Standard Time'
+ case '11':
+ return 'Etc/GMT-' . $offset; //'[UTC + 11] Solomon Island Time, Magadan Standard Time'
+ case '11.5':
+ return 'Pacific/Norfolk'; //'[UTC + 11:30] Norfolk Island Time'
+ case '12':
+ return 'Etc/GMT-12'; //'[UTC + 12] New Zealand Time, Fiji Time, Kamchatka Standard Time'
+ case '12.75':
+ return 'Pacific/Chatham'; //'[UTC + 12:45] Chatham Islands Time'
+ case '13':
+ return 'Pacific/Tongatapu'; //'[UTC + 13] Tonga Time, Phoenix Islands Time'
+ case '14':
+ return 'Pacific/Kiritimati'; //'[UTC + 14] Line Island Time'
+ default:
+ return 'UTC';
+ }
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v310/timezone_p2.php b/phpBB/phpbb/db/migration/data/v310/timezone_p2.php
new file mode 100644
index 0000000000..3ac7ab3c51
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/timezone_p2.php
@@ -0,0 +1,49 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v310;
+
+class timezone_p2 extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return !$this->db_tools->sql_column_exists($this->table_prefix . 'users', 'user_dst');
+ }
+
+ static public function depends_on()
+ {
+ return array('\phpbb\db\migration\data\v310\timezone');
+ }
+
+ public function update_schema()
+ {
+ return array(
+ 'drop_columns' => array(
+ $this->table_prefix . 'users' => array(
+ 'user_dst',
+ ),
+ ),
+ );
+ }
+
+ public function revert_schema()
+ {
+ return array(
+ 'add_columns' => array(
+ $this->table_prefix . 'users' => array(
+ 'user_dst' => array('BOOL', 0),
+ ),
+ ),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v310/topic_sort_username.php b/phpBB/phpbb/db/migration/data/v310/topic_sort_username.php
new file mode 100644
index 0000000000..527da20590
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/topic_sort_username.php
@@ -0,0 +1,44 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v310;
+
+class topic_sort_username extends \phpbb\db\migration\migration
+{
+ static public function depends_on()
+ {
+ return array('\phpbb\db\migration\data\v310\dev');
+ }
+
+ public function update_schema()
+ {
+ return array(
+ 'change_columns' => array(
+ $this->table_prefix . 'topics' => array(
+ 'topic_first_poster_name' => array('VCHAR_UNI:255', '', 'true_sort'),
+ ),
+ ),
+ );
+ }
+
+ public function revert_schema()
+ {
+ return array(
+ 'change_columns' => array(
+ $this->table_prefix . 'topics' => array(
+ 'topic_first_poster_name' => array('VCHAR_UNI:255', ''),
+ ),
+ ),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v310/ucp_popuppm_module.php b/phpBB/phpbb/db/migration/data/v310/ucp_popuppm_module.php
new file mode 100644
index 0000000000..8600f6ee27
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/ucp_popuppm_module.php
@@ -0,0 +1,46 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v310;
+
+class ucp_popuppm_module extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ $sql = 'SELECT module_id
+ FROM ' . MODULES_TABLE . "
+ WHERE module_class = 'ucp'
+ AND module_langname = 'UCP_PM_POPUP_TITLE'";
+ $result = $this->db->sql_query($sql);
+ $module_id = $this->db->sql_fetchfield('module_id');
+ $this->db->sql_freeresult($result);
+
+ return $module_id == false;
+ }
+
+ static public function depends_on()
+ {
+ return array('\phpbb\db\migration\data\v310\dev');
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('module.remove', array(
+ 'ucp',
+ 'UCP_PM',
+ 'UCP_PM_POPUP_TITLE',
+ )),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v31x/.htaccess b/phpBB/phpbb/db/migration/data/v31x/.htaccess
new file mode 100644
index 0000000000..44242b5418
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v31x/.htaccess
@@ -0,0 +1,33 @@
+# With Apache 2.4 the "Order, Deny" syntax has been deprecated and moved from
+# module mod_authz_host to a new module called mod_access_compat (which may be
+# disabled) and a new "Require" syntax has been introduced to mod_authz_host.
+# We could just conditionally provide both versions, but unfortunately Apache
+# does not explicitly tell us its version if the module mod_version is not
+# available. In this case, we check for the availability of module
+# mod_authz_core (which should be on 2.4 or higher only) as a best guess.
+<IfModule mod_version.c>
+ <IfVersion < 2.4>
+ <Files "*">
+ Order Allow,Deny
+ Deny from All
+ </Files>
+ </IfVersion>
+ <IfVersion >= 2.4>
+ <Files "*">
+ Require all denied
+ </Files>
+ </IfVersion>
+</IfModule>
+<IfModule !mod_version.c>
+ <IfModule !mod_authz_core.c>
+ <Files "*">
+ Order Allow,Deny
+ Deny from All
+ </Files>
+ </IfModule>
+ <IfModule mod_authz_core.c>
+ <Files "*">
+ Require all denied
+ </Files>
+ </IfModule>
+</IfModule>
diff --git a/phpBB/phpbb/db/migration/data/v31x/add_jabber_ssl_context_config_options.php b/phpBB/phpbb/db/migration/data/v31x/add_jabber_ssl_context_config_options.php
new file mode 100644
index 0000000000..9f416fe069
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v31x/add_jabber_ssl_context_config_options.php
@@ -0,0 +1,32 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v31x;
+
+class add_jabber_ssl_context_config_options extends \phpbb\db\migration\migration
+{
+ static public function depends_on()
+ {
+ return array('\phpbb\db\migration\data\v31x\v3110');
+ }
+
+ public function update_data()
+ {
+ return array(
+ // See http://php.net/manual/en/context.ssl.php
+ array('config.add', array('jab_verify_peer', 1)),
+ array('config.add', array('jab_verify_peer_name', 1)),
+ array('config.add', array('jab_allow_self_signed', 0)),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v31x/add_latest_topics_index.php b/phpBB/phpbb/db/migration/data/v31x/add_latest_topics_index.php
new file mode 100644
index 0000000000..fa2899e348
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v31x/add_latest_topics_index.php
@@ -0,0 +1,51 @@
+<?php
+/**
+ *
+ * This file is part of the phpBB Forum Software package.
+ *
+ * @copyright (c) phpBB Limited <https://www.phpbb.com>
+ * @license GNU General Public License, version 2 (GPL-2.0)
+ *
+ * For full copyright and license information, please see
+ * the docs/CREDITS.txt file.
+ *
+ */
+
+namespace phpbb\db\migration\data\v31x;
+
+class add_latest_topics_index extends \phpbb\db\migration\migration
+{
+ static public function depends_on()
+ {
+ return array(
+ '\phpbb\db\migration\data\v31x\v3110',
+ );
+ }
+
+ public function update_schema()
+ {
+ return array(
+ 'add_index' => array(
+ $this->table_prefix . 'topics' => array(
+ 'latest_topics' => array(
+ 'forum_id',
+ 'topic_last_post_time',
+ 'topic_last_post_id',
+ 'topic_moved_id',
+ ),
+ ),
+ ),
+ );
+ }
+
+ public function revert_schema()
+ {
+ return array(
+ 'drop_keys' => array(
+ $this->table_prefix . 'topics' => array(
+ 'latest_topics',
+ ),
+ ),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v31x/add_log_time_index.php b/phpBB/phpbb/db/migration/data/v31x/add_log_time_index.php
new file mode 100644
index 0000000000..f53eedcd49
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v31x/add_log_time_index.php
@@ -0,0 +1,46 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v31x;
+
+class add_log_time_index extends \phpbb\db\migration\migration
+{
+ static public function depends_on()
+ {
+ return array(
+ '\phpbb\db\migration\data\v31x\v319',
+ );
+ }
+
+ public function update_schema()
+ {
+ return array(
+ 'add_index' => array(
+ $this->table_prefix . 'log' => array(
+ 'log_time' => array('log_time'),
+ ),
+ ),
+ );
+ }
+
+ public function revert_schema()
+ {
+ return array(
+ 'drop_keys' => array(
+ $this->table_prefix . 'log' => array(
+ 'log_time',
+ ),
+ ),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v31x/add_smtp_ssl_context_config_options.php b/phpBB/phpbb/db/migration/data/v31x/add_smtp_ssl_context_config_options.php
new file mode 100644
index 0000000000..92051dc3ca
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v31x/add_smtp_ssl_context_config_options.php
@@ -0,0 +1,32 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v31x;
+
+class add_smtp_ssl_context_config_options extends \phpbb\db\migration\migration
+{
+ static public function depends_on()
+ {
+ return array('\phpbb\db\migration\data\v31x\v3110');
+ }
+
+ public function update_data()
+ {
+ return array(
+ // See http://php.net/manual/en/context.ssl.php
+ array('config.add', array('smtp_verify_peer', 1)),
+ array('config.add', array('smtp_verify_peer_name', 1)),
+ array('config.add', array('smtp_allow_self_signed', 0)),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v31x/increase_size_of_dateformat.php b/phpBB/phpbb/db/migration/data/v31x/increase_size_of_dateformat.php
new file mode 100644
index 0000000000..bdf83f3d62
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v31x/increase_size_of_dateformat.php
@@ -0,0 +1,35 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v31x;
+
+class increase_size_of_dateformat extends \phpbb\db\migration\migration
+{
+ static public function depends_on()
+ {
+ return array(
+ '\phpbb\db\migration\data\v31x\v317',
+ );
+ }
+
+ public function update_schema()
+ {
+ return array(
+ 'change_columns' => array(
+ $this->table_prefix . 'users' => array(
+ 'user_dateformat' => array('VCHAR_UNI:64', 'd M Y H:i'),
+ ),
+ ),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v31x/increase_size_of_emotion.php b/phpBB/phpbb/db/migration/data/v31x/increase_size_of_emotion.php
new file mode 100644
index 0000000000..7e486aca7c
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v31x/increase_size_of_emotion.php
@@ -0,0 +1,46 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v31x;
+
+class increase_size_of_emotion extends \phpbb\db\migration\migration
+{
+ static public function depends_on()
+ {
+ return array(
+ '\phpbb\db\migration\data\v31x\v3110',
+ );
+ }
+
+ public function update_schema()
+ {
+ return array(
+ 'change_columns' => array(
+ $this->table_prefix . 'smilies' => array(
+ 'emotion' => array('VCHAR_UNI', ''),
+ ),
+ ),
+ );
+ }
+
+ public function revert_schema()
+ {
+ return array(
+ 'change_columns' => array(
+ $this->table_prefix . 'smilies' => array(
+ 'emotion' => array('VCHAR_UNI:50', ''),
+ ),
+ ),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v31x/m_pm_report.php b/phpBB/phpbb/db/migration/data/v31x/m_pm_report.php
new file mode 100644
index 0000000000..9b5710c639
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v31x/m_pm_report.php
@@ -0,0 +1,64 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v31x;
+
+class m_pm_report extends \phpbb\db\migration\migration
+{
+ static public function depends_on()
+ {
+ return array('\phpbb\db\migration\data\v31x\v316rc1');
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('permission.add', array('m_pm_report', true, 'm_report')),
+ array('custom', array(
+ array($this, 'update_module_auth'),
+ ),
+ ),
+ );
+ }
+
+ public function revert_data()
+ {
+ return array(
+ array('permission.remove', array('m_pm_report')),
+ array('custom', array(
+ array($this, 'revert_module_auth'),
+ ),
+ ),
+ );
+ }
+
+ public function update_module_auth()
+ {
+ $sql = 'UPDATE ' . MODULES_TABLE . "
+ SET module_auth = 'acl_m_pm_report'
+ WHERE module_class = 'mcp'
+ AND module_basename = 'mcp_pm_reports'
+ AND module_auth = 'aclf_m_report'";
+ $this->db->sql_query($sql);
+ }
+
+ public function revert_module_auth()
+ {
+ $sql = 'UPDATE ' . MODULES_TABLE . "
+ SET module_auth = 'aclf_m_report'
+ WHERE module_class = 'mcp'
+ AND module_basename = 'mcp_pm_reports'
+ AND module_auth = 'acl_m_pm_report'";
+ $this->db->sql_query($sql);
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v31x/m_softdelete_global.php b/phpBB/phpbb/db/migration/data/v31x/m_softdelete_global.php
new file mode 100644
index 0000000000..dd7e20e762
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v31x/m_softdelete_global.php
@@ -0,0 +1,31 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v31x;
+
+class m_softdelete_global extends \phpbb\db\migration\migration
+{
+ static public function depends_on()
+ {
+ return array('\phpbb\db\migration\data\v31x\v311');
+ }
+
+ public function update_data()
+ {
+ return array(
+ // Make m_softdelete global. The add method will take care of updating
+ // it if it already exists.
+ array('permission.add', array('m_softdelete', true)),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v31x/plupload_last_gc_dynamic.php b/phpBB/phpbb/db/migration/data/v31x/plupload_last_gc_dynamic.php
new file mode 100644
index 0000000000..0783d707c5
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v31x/plupload_last_gc_dynamic.php
@@ -0,0 +1,31 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v31x;
+
+class plupload_last_gc_dynamic extends \phpbb\db\migration\migration
+{
+ static public function depends_on()
+ {
+ return array('\phpbb\db\migration\data\v31x\v312');
+ }
+
+ public function update_data()
+ {
+ return array(
+ // Make plupload_last_gc dynamic.
+ array('config.remove', array('plupload_last_gc')),
+ array('config.add', array('plupload_last_gc', 0, 1)),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v31x/profilefield_remove_underscore_from_alpha.php b/phpBB/phpbb/db/migration/data/v31x/profilefield_remove_underscore_from_alpha.php
new file mode 100644
index 0000000000..60491f8de8
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v31x/profilefield_remove_underscore_from_alpha.php
@@ -0,0 +1,47 @@
+<?php
+
+/**
+ *
+ * This file is part of the phpBB Forum Software package.
+ *
+ * @copyright (c) phpBB Limited <https://www.phpbb.com>
+ * @license GNU General Public License, version 2 (GPL-2.0)
+ *
+ * For full copyright and license information, please see
+ * the docs/CREDITS.txt file.
+ *
+ */
+
+namespace phpbb\db\migration\data\v31x;
+
+class profilefield_remove_underscore_from_alpha extends \phpbb\db\migration\migration
+{
+ static public function depends_on()
+ {
+ return array('\phpbb\db\migration\data\v31x\v311');
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('custom', array(array($this, 'remove_underscore_from_alpha_validations'))),
+ );
+ }
+
+ public function remove_underscore_from_alpha_validations()
+ {
+ $this->update_validation_rule('[\w]+', '[a-zA-Z0-9]+');
+ $this->update_validation_rule('[\w_]+', '[\w]+');
+ $this->update_validation_rule('[\w.]+', '[a-zA-Z0-9.]+');
+ $this->update_validation_rule('[\w\x20_+\-\[\]]+', '[\w\x20+\-\[\]]+');
+ $this->update_validation_rule('[a-zA-Z][\w\.,\-_]+', '[a-zA-Z][\w\.,\-]+');
+ }
+
+ public function update_validation_rule($old_validation, $new_validation)
+ {
+ $sql = 'UPDATE ' . PROFILE_FIELDS_TABLE . "
+ SET field_validation = '" . $this->db->sql_escape($new_validation) . "'
+ WHERE field_validation = '" . $this->db->sql_escape($old_validation) . "'";
+ $this->db->sql_query($sql);
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v31x/profilefield_yahoo_update_url.php b/phpBB/phpbb/db/migration/data/v31x/profilefield_yahoo_update_url.php
new file mode 100644
index 0000000000..4df9083bdf
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v31x/profilefield_yahoo_update_url.php
@@ -0,0 +1,38 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v31x;
+
+class profilefield_yahoo_update_url extends \phpbb\db\migration\migration
+{
+ static public function depends_on()
+ {
+ return array('\phpbb\db\migration\data\v31x\v312');
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('custom', array(array($this, 'update_contact_url'))),
+ );
+ }
+
+ public function update_contact_url()
+ {
+ $sql = 'UPDATE ' . $this->table_prefix . "profile_fields
+ SET field_contact_url = 'ymsgr:sendim?%s'
+ WHERE field_name = 'phpbb_yahoo'
+ AND field_contact_url = 'http://edit.yahoo.com/config/send_webmesg?.target=%s&amp;.src=pg'";
+ $this->sql_query($sql);
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v31x/remove_duplicate_migrations.php b/phpBB/phpbb/db/migration/data/v31x/remove_duplicate_migrations.php
new file mode 100644
index 0000000000..417d569a09
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v31x/remove_duplicate_migrations.php
@@ -0,0 +1,77 @@
+<?php
+
+/**
+ *
+ * This file is part of the phpBB Forum Software package.
+ *
+ * @copyright (c) phpBB Limited <https://www.phpbb.com>
+ * @license GNU General Public License, version 2 (GPL-2.0)
+ *
+ * For full copyright and license information, please see
+ * the docs/CREDITS.txt file.
+ *
+ */
+
+namespace phpbb\db\migration\data\v31x;
+
+class remove_duplicate_migrations extends \phpbb\db\migration\migration
+{
+ static public function depends_on()
+ {
+ return array('\phpbb\db\migration\data\v31x\v3110');
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('custom', array(array($this, 'deduplicate_entries'))),
+ );
+ }
+
+ public function deduplicate_entries()
+ {
+ $migration_state = array();
+ $duplicate_migrations = array();
+
+ $sql = "SELECT *
+ FROM " . $this->table_prefix . 'migrations';
+ $result = $this->db->sql_query($sql);
+
+ if (!$this->db->get_sql_error_triggered())
+ {
+ while ($migration = $this->db->sql_fetchrow($result))
+ {
+ $migration_state[$migration['migration_name']] = $migration;
+
+ $migration_state[$migration['migration_name']]['migration_depends_on'] = unserialize($migration['migration_depends_on']);
+ }
+ }
+
+ $this->db->sql_freeresult($result);
+
+ foreach ($migration_state as $name => $migration)
+ {
+ $prepended_name = ($name[0] == '\\' ? '' : '\\') . $name;
+ $prefixless_name = $name[0] == '\\' ? substr($name, 1) : $name;
+
+ if ($prepended_name != $name && isset($migration_state[$prepended_name]) && $migration_state[$prepended_name]['migration_depends_on'] == $migration_state[$name]['migration_depends_on'])
+ {
+ $duplicate_migrations[] = $name;
+ unset($migration_state[$prepended_name]);
+ }
+ else if ($prefixless_name != $name && isset($migration_state[$prefixless_name]) && $migration_state[$prefixless_name]['migration_depends_on'] == $migration_state[$name]['migration_depends_on'])
+ {
+ $duplicate_migrations[] = $prefixless_name;
+ unset($migration_state[$prefixless_name]);
+ }
+ }
+
+ if (count($duplicate_migrations))
+ {
+ $sql = 'DELETE
+ FROM ' . $this->table_prefix . 'migrations
+ WHERE ' . $this->db->sql_in_set('migration_name', $duplicate_migrations);
+ $this->db->sql_query($sql);
+ }
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v31x/style_update.php b/phpBB/phpbb/db/migration/data/v31x/style_update.php
new file mode 100644
index 0000000000..bb030bbe6d
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v31x/style_update.php
@@ -0,0 +1,136 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v31x;
+
+class style_update extends \phpbb\db\migration\migration
+{
+ static public function depends_on()
+ {
+ return array('\phpbb\db\migration\data\v310\gold');
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('custom', array(array($this, 'update_installed_styles'))),
+ );
+ }
+
+ public function update_installed_styles()
+ {
+ // Get all currently available styles
+ $styles = $this->find_style_dirs();
+ $style_paths = $style_ids = array();
+
+ $sql = 'SELECT style_path, style_id
+ FROM ' . $this->table_prefix . 'styles';
+ $result = $this->db->sql_query($sql);
+ while ($styles_row = $this->db->sql_fetchrow())
+ {
+ if (in_array($styles_row['style_path'], $styles))
+ {
+ $style_paths[] = $styles_row['style_path'];
+ $style_ids[] = $styles_row['style_id'];
+ }
+ }
+ $this->db->sql_freeresult($result);
+
+ // Install prosilver if no style is available and prosilver can be installed
+ if (empty($style_paths) && in_array('prosilver', $styles))
+ {
+ // Try to parse config file
+ $cfg = parse_cfg_file($this->phpbb_root_path . 'styles/prosilver/style.cfg');
+
+ // Stop running this if prosilver cfg file can't be read
+ if (empty($cfg))
+ {
+ throw new \RuntimeException('No styles available and could not fall back to prosilver.');
+ }
+
+ $style = array(
+ 'style_name' => 'prosilver',
+ 'style_copyright' => '&copy; phpBB Limited',
+ 'style_active' => 1,
+ 'style_path' => 'prosilver',
+ 'bbcode_bitfield' => 'kNg=',
+ 'style_parent_id' => 0,
+ 'style_parent_tree' => '',
+ );
+
+ // Add to database
+ $this->db->sql_transaction('begin');
+
+ $sql = 'INSERT INTO ' . $this->table_prefix . 'styles
+ ' . $this->db->sql_build_array('INSERT', $style);
+ $this->db->sql_query($sql);
+
+ $style_id = $this->db->sql_nextid();
+ $style_ids[] = $style_id;
+
+ $this->db->sql_transaction('commit');
+
+ // Set prosilver to default style
+ $this->config->set('default_style', $style_id);
+ }
+ else if (empty($styles) && empty($available_styles))
+ {
+ throw new \RuntimeException('No valid styles available');
+ }
+
+ // Make sure default style is available
+ if (!in_array($this->config['default_style'], $style_ids))
+ {
+ $this->config->set('default_style', array_pop($style_ids));
+ }
+
+ // Reset users to default style if their user_style is nonexistent
+ $sql = 'UPDATE ' . $this->table_prefix . "users
+ SET user_style = {$this->config['default_style']}
+ WHERE " . $this->db->sql_in_set('user_style', $style_ids, true, true);
+ $this->db->sql_query($sql);
+ }
+
+ /**
+ * Find all directories that have styles
+ * Copied from acp_styles
+ *
+ * @return array Directory names
+ */
+ protected function find_style_dirs()
+ {
+ $styles = array();
+ $styles_path = $this->phpbb_root_path . 'styles/';
+
+ $dp = @opendir($styles_path);
+ if ($dp)
+ {
+ while (($file = readdir($dp)) !== false)
+ {
+ $dir = $styles_path . $file;
+ if ($file[0] == '.' || !is_dir($dir))
+ {
+ continue;
+ }
+
+ if (file_exists("{$dir}/style.cfg"))
+ {
+ $styles[] = $file;
+ }
+ }
+ closedir($dp);
+ }
+
+ return $styles;
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v31x/update_custom_bbcodes_with_idn.php b/phpBB/phpbb/db/migration/data/v31x/update_custom_bbcodes_with_idn.php
new file mode 100644
index 0000000000..854ed1f568
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v31x/update_custom_bbcodes_with_idn.php
@@ -0,0 +1,70 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v31x;
+
+class update_custom_bbcodes_with_idn extends \phpbb\db\migration\migration
+{
+ static public function depends_on()
+ {
+ return array(
+ '\phpbb\db\migration\data\v31x\v312',
+ );
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('custom', array(array($this, 'update_bbcodes_table'))),
+ );
+ }
+
+ public function update_bbcodes_table()
+ {
+ if (!class_exists('acp_bbcodes'))
+ {
+ include($this->phpbb_root_path . 'includes/acp/acp_bbcodes.' . $this->php_ext);
+ }
+
+ $bbcodes = new \acp_bbcodes();
+
+ $sql = 'SELECT bbcode_id, bbcode_match, bbcode_tpl
+ FROM ' . BBCODES_TABLE;
+ $result = $this->sql_query($sql);
+
+ $sql_ary = array();
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $data = array();
+ if (preg_match('/(URL|LOCAL_URL|RELATIVE_URL)/', $row['bbcode_match']))
+ {
+ $data = $bbcodes->build_regexp($row['bbcode_match'], $row['bbcode_tpl']);
+ $sql_ary[$row['bbcode_id']] = array(
+ 'first_pass_match' => $data['first_pass_match'],
+ 'first_pass_replace' => $data['first_pass_replace'],
+ 'second_pass_match' => $data['second_pass_match'],
+ 'second_pass_replace' => $data['second_pass_replace']
+ );
+ }
+ }
+ $this->db->sql_freeresult($result);
+
+ foreach ($sql_ary as $bbcode_id => $bbcode_data)
+ {
+ $sql = 'UPDATE ' . BBCODES_TABLE . '
+ SET ' . $this->db->sql_build_array('UPDATE', $bbcode_data) . '
+ WHERE bbcode_id = ' . (int) $bbcode_id;
+ $this->sql_query($sql);
+ }
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v31x/update_hashes.php b/phpBB/phpbb/db/migration/data/v31x/update_hashes.php
new file mode 100644
index 0000000000..aa83c3ffbf
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v31x/update_hashes.php
@@ -0,0 +1,33 @@
+<?php
+/**
+ *
+ * This file is part of the phpBB Forum Software package.
+ *
+ * @copyright (c) phpBB Limited <https://www.phpbb.com>
+ * @license GNU General Public License, version 2 (GPL-2.0)
+ *
+ * For full copyright and license information, please see
+ * the docs/CREDITS.txt file.
+ *
+ */
+
+namespace phpbb\db\migration\data\v31x;
+
+class update_hashes extends \phpbb\db\migration\migration
+{
+ static public function depends_on()
+ {
+ return array(
+ '\phpbb\db\migration\data\v31x\v3110',
+ );
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('config.add', array('enable_update_hashes', '1')),
+ array('config.add', array('update_hashes_lock', '')),
+ array('config.add', array('update_hashes_last_cron', '0'))
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v31x/v311.php b/phpBB/phpbb/db/migration/data/v31x/v311.php
new file mode 100644
index 0000000000..b9d6ed3053
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v31x/v311.php
@@ -0,0 +1,37 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v31x;
+
+class v311 extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.1.1', '>=');
+ }
+
+ static public function depends_on()
+ {
+ return array(
+ '\phpbb\db\migration\data\v310\gold',
+ '\phpbb\db\migration\data\v31x\style_update',
+ );
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('config.update', array('version', '3.1.1')),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v31x/v3110.php b/phpBB/phpbb/db/migration/data/v31x/v3110.php
new file mode 100644
index 0000000000..b89b4cc6e6
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v31x/v3110.php
@@ -0,0 +1,36 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v31x;
+
+class v3110 extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.1.10', '>=');
+ }
+
+ static public function depends_on()
+ {
+ return array(
+ '\phpbb\db\migration\data\v31x\v3110rc1',
+ );
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('config.update', array('version', '3.1.10')),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v31x/v3110rc1.php b/phpBB/phpbb/db/migration/data/v31x/v3110rc1.php
new file mode 100644
index 0000000000..da69f2384e
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v31x/v3110rc1.php
@@ -0,0 +1,36 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v31x;
+
+class v3110rc1 extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.1.10-RC1', '>=');
+ }
+
+ static public function depends_on()
+ {
+ return array(
+ '\phpbb\db\migration\data\v31x\v319',
+ );
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('config.update', array('version', '3.1.10-RC1')),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v31x/v3111.php b/phpBB/phpbb/db/migration/data/v31x/v3111.php
new file mode 100644
index 0000000000..f01bbc2bff
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v31x/v3111.php
@@ -0,0 +1,36 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v31x;
+
+class v3111 extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.1.11', '>=');
+ }
+
+ static public function depends_on()
+ {
+ return array(
+ '\phpbb\db\migration\data\v31x\v3111rc1',
+ );
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('config.update', array('version', '3.1.11')),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v31x/v3111rc1.php b/phpBB/phpbb/db/migration/data/v31x/v3111rc1.php
new file mode 100644
index 0000000000..259656283f
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v31x/v3111rc1.php
@@ -0,0 +1,43 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v31x;
+
+class v3111rc1 extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.1.11-RC1', '>=');
+ }
+
+ static public function depends_on()
+ {
+ return array(
+ '\phpbb\db\migration\data\v31x\v3110',
+ '\phpbb\db\migration\data\v31x\add_log_time_index',
+ '\phpbb\db\migration\data\v31x\increase_size_of_emotion',
+ '\phpbb\db\migration\data\v31x\add_jabber_ssl_context_config_options',
+ '\phpbb\db\migration\data\v31x\add_smtp_ssl_context_config_options',
+ '\phpbb\db\migration\data\v31x\update_hashes',
+ '\phpbb\db\migration\data\v31x\remove_duplicate_migrations',
+ '\phpbb\db\migration\data\v31x\add_latest_topics_index',
+ );
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('config.update', array('version', '3.1.11-RC1')),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v31x/v312.php b/phpBB/phpbb/db/migration/data/v31x/v312.php
new file mode 100644
index 0000000000..114c2b959b
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v31x/v312.php
@@ -0,0 +1,36 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v31x;
+
+class v312 extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.1.2', '>=');
+ }
+
+ static public function depends_on()
+ {
+ return array(
+ '\phpbb\db\migration\data\v31x\v312rc1',
+ );
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('config.update', array('version', '3.1.2')),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v31x/v312rc1.php b/phpBB/phpbb/db/migration/data/v31x/v312rc1.php
new file mode 100644
index 0000000000..e2408d432b
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v31x/v312rc1.php
@@ -0,0 +1,37 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v31x;
+
+class v312rc1 extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.1.2-RC1', '>=');
+ }
+
+ static public function depends_on()
+ {
+ return array(
+ '\phpbb\db\migration\data\v31x\v311',
+ '\phpbb\db\migration\data\v31x\m_softdelete_global',
+ );
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('config.update', array('version', '3.1.2-RC1')),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v31x/v313.php b/phpBB/phpbb/db/migration/data/v31x/v313.php
new file mode 100644
index 0000000000..b86788da16
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v31x/v313.php
@@ -0,0 +1,36 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v31x;
+
+class v313 extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.1.3', '>=');
+ }
+
+ static public function depends_on()
+ {
+ return array(
+ '\phpbb\db\migration\data\v31x\v313rc2',
+ );
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('config.update', array('version', '3.1.3')),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v31x/v313rc1.php b/phpBB/phpbb/db/migration/data/v31x/v313rc1.php
new file mode 100644
index 0000000000..b1dcc03364
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v31x/v313rc1.php
@@ -0,0 +1,40 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v31x;
+
+class v313rc1 extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.1.3-RC1', '>=');
+ }
+
+ static public function depends_on()
+ {
+ return array(
+ '\phpbb\db\migration\data\v30x\release_3_0_13_rc1',
+ '\phpbb\db\migration\data\v31x\plupload_last_gc_dynamic',
+ '\phpbb\db\migration\data\v31x\profilefield_remove_underscore_from_alpha',
+ '\phpbb\db\migration\data\v31x\profilefield_yahoo_update_url',
+ '\phpbb\db\migration\data\v31x\update_custom_bbcodes_with_idn',
+ );
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('config.update', array('version', '3.1.3-RC1')),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v31x/v313rc2.php b/phpBB/phpbb/db/migration/data/v31x/v313rc2.php
new file mode 100644
index 0000000000..b701dca5ed
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v31x/v313rc2.php
@@ -0,0 +1,37 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v31x;
+
+class v313rc2 extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.1.3-RC2', '>=');
+ }
+
+ static public function depends_on()
+ {
+ return array(
+ '\phpbb\db\migration\data\v30x\release_3_0_13_pl1',
+ '\phpbb\db\migration\data\v31x\v313rc1',
+ );
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('config.update', array('version', '3.1.3-RC2')),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v31x/v314.php b/phpBB/phpbb/db/migration/data/v31x/v314.php
new file mode 100644
index 0000000000..82dbbf29c9
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v31x/v314.php
@@ -0,0 +1,37 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v31x;
+
+class v314 extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.1.4', '>=');
+ }
+
+ static public function depends_on()
+ {
+ return array(
+ '\phpbb\db\migration\data\v30x\release_3_0_14',
+ '\phpbb\db\migration\data\v31x\v314rc2',
+ );
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('config.update', array('version', '3.1.4')),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v31x/v314rc1.php b/phpBB/phpbb/db/migration/data/v31x/v314rc1.php
new file mode 100644
index 0000000000..e7baf0c2ce
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v31x/v314rc1.php
@@ -0,0 +1,36 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v31x;
+
+class v314rc1 extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.1.4-RC1', '>=');
+ }
+
+ static public function depends_on()
+ {
+ return array(
+ '\phpbb\db\migration\data\v31x\v313',
+ );
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('config.update', array('version', '3.1.4-RC1')),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v31x/v314rc2.php b/phpBB/phpbb/db/migration/data/v31x/v314rc2.php
new file mode 100644
index 0000000000..3fc5bf2ad5
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v31x/v314rc2.php
@@ -0,0 +1,37 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v31x;
+
+class v314rc2 extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.1.4-RC2', '>=');
+ }
+
+ static public function depends_on()
+ {
+ return array(
+ '\phpbb\db\migration\data\v30x\release_3_0_14_rc1',
+ '\phpbb\db\migration\data\v31x\v314rc1',
+ );
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('config.update', array('version', '3.1.4-RC2')),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v31x/v315.php b/phpBB/phpbb/db/migration/data/v31x/v315.php
new file mode 100644
index 0000000000..d5eacf8dd3
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v31x/v315.php
@@ -0,0 +1,36 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v31x;
+
+class v315 extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.1.5', '>=');
+ }
+
+ static public function depends_on()
+ {
+ return array(
+ '\phpbb\db\migration\data\v31x\v315rc1',
+ );
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('config.update', array('version', '3.1.5')),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v31x/v315rc1.php b/phpBB/phpbb/db/migration/data/v31x/v315rc1.php
new file mode 100644
index 0000000000..a58b6a0f2a
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v31x/v315rc1.php
@@ -0,0 +1,36 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v31x;
+
+class v315rc1 extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.1.5-RC1', '>=');
+ }
+
+ static public function depends_on()
+ {
+ return array(
+ '\phpbb\db\migration\data\v31x\v314',
+ );
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('config.update', array('version', '3.1.5-RC1')),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v31x/v316.php b/phpBB/phpbb/db/migration/data/v31x/v316.php
new file mode 100644
index 0000000000..b3e0060ced
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v31x/v316.php
@@ -0,0 +1,36 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v31x;
+
+class v316 extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.1.6', '>=');
+ }
+
+ static public function depends_on()
+ {
+ return array(
+ '\phpbb\db\migration\data\v31x\v316rc1',
+ );
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('config.update', array('version', '3.1.6')),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v31x/v316rc1.php b/phpBB/phpbb/db/migration/data/v31x/v316rc1.php
new file mode 100644
index 0000000000..6badfb68d4
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v31x/v316rc1.php
@@ -0,0 +1,36 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v31x;
+
+class v316rc1 extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.1.6-RC1', '>=');
+ }
+
+ static public function depends_on()
+ {
+ return array(
+ '\phpbb\db\migration\data\v31x\v315',
+ );
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('config.update', array('version', '3.1.6-RC1')),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v31x/v317.php b/phpBB/phpbb/db/migration/data/v31x/v317.php
new file mode 100644
index 0000000000..d95be06ba6
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v31x/v317.php
@@ -0,0 +1,36 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v31x;
+
+class v317 extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.1.7', '>=');
+ }
+
+ static public function depends_on()
+ {
+ return array(
+ '\phpbb\db\migration\data\v31x\v317rc1',
+ );
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('config.update', array('version', '3.1.7')),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v31x/v317pl1.php b/phpBB/phpbb/db/migration/data/v31x/v317pl1.php
new file mode 100644
index 0000000000..1cb39b03f0
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v31x/v317pl1.php
@@ -0,0 +1,36 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v31x;
+
+class v317pl1 extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.1.7-pl1', '>=');
+ }
+
+ static public function depends_on()
+ {
+ return array(
+ '\phpbb\db\migration\data\v31x\v317',
+ );
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('config.update', array('version', '3.1.7-pl1')),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v31x/v317rc1.php b/phpBB/phpbb/db/migration/data/v31x/v317rc1.php
new file mode 100644
index 0000000000..77759daa66
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v31x/v317rc1.php
@@ -0,0 +1,37 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v31x;
+
+class v317rc1 extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.1.7-RC1', '>=');
+ }
+
+ static public function depends_on()
+ {
+ return array(
+ '\phpbb\db\migration\data\v31x\m_pm_report',
+ '\phpbb\db\migration\data\v31x\v316',
+ );
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('config.update', array('version', '3.1.7-RC1')),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v31x/v318.php b/phpBB/phpbb/db/migration/data/v31x/v318.php
new file mode 100644
index 0000000000..7663529d3a
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v31x/v318.php
@@ -0,0 +1,36 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v31x;
+
+class v318 extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.1.8', '>=');
+ }
+
+ static public function depends_on()
+ {
+ return array(
+ '\phpbb\db\migration\data\v31x\v318rc1',
+ );
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('config.update', array('version', '3.1.8')),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v31x/v318rc1.php b/phpBB/phpbb/db/migration/data/v31x/v318rc1.php
new file mode 100644
index 0000000000..2cab5c96d4
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v31x/v318rc1.php
@@ -0,0 +1,37 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v31x;
+
+class v318rc1 extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.1.8-RC1', '>=');
+ }
+
+ static public function depends_on()
+ {
+ return array(
+ '\phpbb\db\migration\data\v31x\increase_size_of_dateformat',
+ '\phpbb\db\migration\data\v31x\v317pl1',
+ );
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('config.update', array('version', '3.1.8-RC1')),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v31x/v319.php b/phpBB/phpbb/db/migration/data/v31x/v319.php
new file mode 100644
index 0000000000..f773814028
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v31x/v319.php
@@ -0,0 +1,36 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v31x;
+
+class v319 extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.1.9', '>=');
+ }
+
+ static public function depends_on()
+ {
+ return array(
+ '\phpbb\db\migration\data\v31x\v319rc1',
+ );
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('config.update', array('version', '3.1.9')),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v31x/v319rc1.php b/phpBB/phpbb/db/migration/data/v31x/v319rc1.php
new file mode 100644
index 0000000000..9805b45572
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v31x/v319rc1.php
@@ -0,0 +1,36 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v31x;
+
+class v319rc1 extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.1.9-RC1', '>=');
+ }
+
+ static public function depends_on()
+ {
+ return array(
+ '\phpbb\db\migration\data\v31x\v318',
+ );
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('config.update', array('version', '3.1.9-RC1')),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/exception.php b/phpBB/phpbb/db/migration/exception.php
new file mode 100644
index 0000000000..7990e85f2d
--- /dev/null
+++ b/phpBB/phpbb/db/migration/exception.php
@@ -0,0 +1,75 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration;
+
+/**
+* The migrator is responsible for applying new migrations in the correct order.
+*/
+class exception extends \Exception
+{
+ /**
+ * Extra parameters sent to exception to aid in debugging
+ * @var array
+ */
+ protected $parameters;
+
+ /**
+ * Throw an exception.
+ *
+ * First argument is the error message.
+ * Additional arguments will be output with the error message.
+ */
+ public function __construct()
+ {
+ $parameters = func_get_args();
+ $message = array_shift($parameters);
+ parent::__construct($message);
+
+ $this->parameters = $parameters;
+ }
+
+ /**
+ * Output the error as a string
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return $this->message . ': ' . var_export($this->parameters, true);
+ }
+
+ /**
+ * Get the parameters
+ *
+ * @return array
+ */
+ public function getParameters()
+ {
+ return $this->parameters;
+ }
+
+ /**
+ * Get localised message (with $user->lang())
+ *
+ * @param \phpbb\user $user
+ * @return string
+ */
+ public function getLocalisedMessage(\phpbb\user $user)
+ {
+ $parameters = $this->getParameters();
+ array_unshift($parameters, $this->getMessage());
+
+ return call_user_func_array(array($user, 'lang'), $parameters);
+ }
+}
diff --git a/phpBB/phpbb/db/migration/helper.php b/phpBB/phpbb/db/migration/helper.php
new file mode 100644
index 0000000000..bce2efff51
--- /dev/null
+++ b/phpBB/phpbb/db/migration/helper.php
@@ -0,0 +1,116 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration;
+
+/**
+* The migrator is responsible for applying new migrations in the correct order.
+*/
+class helper
+{
+ /**
+ * Get the schema steps from an array of schema changes
+ *
+ * This splits up $schema_changes into individual changes so that the
+ * changes can be chunked
+ *
+ * @param array $schema_changes from migration
+ * @return array
+ */
+ public function get_schema_steps($schema_changes)
+ {
+ $steps = array();
+
+ // Nested level of data (only supports 1/2 currently)
+ $nested_level = array(
+ 'drop_tables' => 1,
+ 'add_tables' => 1,
+ 'change_columns' => 2,
+ 'add_columns' => 2,
+ 'drop_keys' => 2,
+ 'drop_columns' => 2,
+ 'add_primary_keys' => 2, // perform_schema_changes only uses one level, but second is in the function
+ 'add_unique_index' => 2,
+ 'add_index' => 2,
+ );
+
+ foreach ($nested_level as $change_type => $data_depth)
+ {
+ if (!empty($schema_changes[$change_type]))
+ {
+ foreach ($schema_changes[$change_type] as $key => $value)
+ {
+ if ($data_depth === 1)
+ {
+ $steps[] = array(
+ 'dbtools.perform_schema_changes', array(array(
+ $change_type => array(
+ (!is_int($key)) ? $key : 0 => $value,
+ ),
+ )),
+ );
+ }
+ else if ($data_depth === 2)
+ {
+ foreach ($value as $key2 => $value2)
+ {
+ $steps[] = array(
+ 'dbtools.perform_schema_changes', array(array(
+ $change_type => array(
+ $key => array(
+ $key2 => $value2,
+ ),
+ ),
+ )),
+ );
+ }
+ }
+ }
+ }
+ }
+
+ return $steps;
+ }
+
+ /**
+ * Reverse the update steps from an array of data changes
+ *
+ * 'If' statements and custom methods will be skipped, for all
+ * other calls the reverse method of the tool class will be called
+ *
+ * @param array $steps Update changes from migration
+ *
+ * @return array
+ */
+ public function reverse_update_data($steps)
+ {
+ $reversed_array = array();
+
+ foreach ($steps as $step)
+ {
+ $parts = explode('.', $step[0]);
+ $parameters = $step[1];
+
+ $class = $parts[0];
+ $method = isset($parts[1]) ? $parts[1] : false;
+
+ if ($class !== 'if' && $class !== 'custom')
+ {
+ array_unshift($parameters, $method);
+ $reversed_array[] = array($class . '.reverse', $parameters);
+ }
+ }
+
+ return array_reverse($reversed_array);
+ }
+}
diff --git a/phpBB/phpbb/db/migration/migration.php b/phpBB/phpbb/db/migration/migration.php
new file mode 100644
index 0000000000..5f120333e1
--- /dev/null
+++ b/phpBB/phpbb/db/migration/migration.php
@@ -0,0 +1,186 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration;
+
+/**
+* Abstract base class for database migrations
+*
+* Each migration consists of a set of schema and data changes to be implemented
+* in a subclass. This class provides various utility methods to simplify editing
+* a phpBB.
+*/
+abstract class migration
+{
+ /** @var \phpbb\config\config */
+ protected $config;
+
+ /** @var \phpbb\db\driver\driver_interface */
+ protected $db;
+
+ /** @var \phpbb\db\tools */
+ protected $db_tools;
+
+ /** @var string */
+ protected $table_prefix;
+
+ /** @var string */
+ protected $phpbb_root_path;
+
+ /** @var string */
+ protected $php_ext;
+
+ /** @var array Errors, if any occurred */
+ protected $errors;
+
+ /** @var array List of queries executed through $this->sql_query() */
+ protected $queries = array();
+
+ /**
+ * Constructor
+ *
+ * @param \phpbb\config\config $config
+ * @param \phpbb\db\driver\driver_interface $db
+ * @param \phpbb\db\tools $db_tools
+ * @param string $phpbb_root_path
+ * @param string $php_ext
+ * @param string $table_prefix
+ */
+ public function __construct(\phpbb\config\config $config, \phpbb\db\driver\driver_interface $db, \phpbb\db\tools $db_tools, $phpbb_root_path, $php_ext, $table_prefix)
+ {
+ $this->config = $config;
+ $this->db = $db;
+ $this->db_tools = $db_tools;
+ $this->table_prefix = $table_prefix;
+
+ $this->phpbb_root_path = $phpbb_root_path;
+ $this->php_ext = $php_ext;
+
+ $this->errors = array();
+ }
+
+ /**
+ * Defines other migrations to be applied first
+ *
+ * @return array An array of migration class names
+ */
+ static public function depends_on()
+ {
+ return array();
+ }
+
+ /**
+ * Allows you to check if the migration is effectively installed (entirely optional)
+ *
+ * This is checked when a migration is installed. If true is returned, the migration will be set as
+ * installed without performing the database changes.
+ * This function is intended to help moving to migrations from a previous database updater, where some
+ * migrations may have been installed already even though they are not yet listed in the migrations table.
+ *
+ * @return bool True if this migration is installed, False if this migration is not installed (checked on install)
+ */
+ public function effectively_installed()
+ {
+ return false;
+ }
+
+ /**
+ * Updates the database schema by providing a set of change instructions
+ *
+ * @return array Array of schema changes (compatible with db_tools->perform_schema_changes())
+ */
+ public function update_schema()
+ {
+ return array();
+ }
+
+ /**
+ * Reverts the database schema by providing a set of change instructions
+ *
+ * @return array Array of schema changes (compatible with db_tools->perform_schema_changes())
+ */
+ public function revert_schema()
+ {
+ return array();
+ }
+
+ /**
+ * Updates data by returning a list of instructions to be executed
+ *
+ * @return array Array of data update instructions
+ */
+ public function update_data()
+ {
+ return array();
+ }
+
+ /**
+ * Reverts data by returning a list of instructions to be executed
+ *
+ * @return array Array of data instructions that will be performed on revert
+ * NOTE: calls to tools (such as config.add) are automatically reverted when
+ * possible, so you should not attempt to revert those, this is mostly for
+ * otherwise unrevertable calls (custom functions for example)
+ */
+ public function revert_data()
+ {
+ return array();
+ }
+
+ /**
+ * Wrapper for running queries to generate user feedback on updates
+ *
+ * @param string $sql SQL query to run on the database
+ * @return mixed Query result from db->sql_query()
+ */
+ protected function sql_query($sql)
+ {
+ $this->queries[] = $sql;
+
+ $this->db->sql_return_on_error(true);
+
+ if ($sql === 'begin')
+ {
+ $result = $this->db->sql_transaction('begin');
+ }
+ else if ($sql === 'commit')
+ {
+ $result = $this->db->sql_transaction('commit');
+ }
+ else
+ {
+ $result = $this->db->sql_query($sql);
+ if ($this->db->get_sql_error_triggered())
+ {
+ $this->errors[] = array(
+ 'sql' => $this->db->get_sql_error_sql(),
+ 'code' => $this->db->get_sql_error_returned(),
+ );
+ }
+ }
+
+ $this->db->sql_return_on_error(false);
+
+ return $result;
+ }
+
+ /**
+ * Get the list of queries run
+ *
+ * @return array
+ */
+ public function get_queries()
+ {
+ return $this->queries;
+ }
+}
diff --git a/phpBB/phpbb/db/migration/profilefield_base_migration.php b/phpBB/phpbb/db/migration/profilefield_base_migration.php
new file mode 100644
index 0000000000..b20ca874be
--- /dev/null
+++ b/phpBB/phpbb/db/migration/profilefield_base_migration.php
@@ -0,0 +1,247 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration;
+
+abstract class profilefield_base_migration extends container_aware_migration
+{
+ protected $profilefield_name;
+
+ protected $profilefield_database_type;
+
+ protected $profilefield_data;
+
+ /**
+ * Language data should be in array -> each language_data in separate key
+ * array(
+ * array(
+ * 'option_id' => value,
+ * 'field_type' => value,
+ * 'lang_value' => value,
+ * ),
+ * array(
+ * 'option_id' => value,
+ * 'field_type' => value,
+ * 'lang_value' => value,
+ * ),
+ * )
+ */
+ protected $profilefield_language_data;
+
+ protected $user_column_name;
+
+ public function effectively_installed()
+ {
+ return $this->db_tools->sql_column_exists($this->table_prefix . 'profile_fields_data', 'pf_' . $this->profilefield_name);
+ }
+
+ public function update_schema()
+ {
+ return array(
+ 'add_columns' => array(
+ $this->table_prefix . 'profile_fields_data' => array(
+ 'pf_' . $this->profilefield_name => $this->profilefield_database_type,
+ ),
+ ),
+ );
+ }
+
+ public function revert_schema()
+ {
+ return array(
+ 'drop_columns' => array(
+ $this->table_prefix . 'profile_fields_data' => array(
+ 'pf_' . $this->profilefield_name,
+ ),
+ ),
+ );
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('custom', array(array($this, 'create_custom_field'))),
+ array('custom', array(array($this, 'convert_user_field_to_custom_field'))),
+ );
+ }
+
+ public function revert_data()
+ {
+ return array(
+ array('custom', array(array($this, 'delete_custom_profile_field_data'))),
+ );
+ }
+
+ public function create_custom_field()
+ {
+ $sql = 'SELECT MAX(field_order) as max_field_order
+ FROM ' . PROFILE_FIELDS_TABLE;
+ $result = $this->db->sql_query($sql);
+ $max_field_order = (int) $this->db->sql_fetchfield('max_field_order');
+ $this->db->sql_freeresult($result);
+
+ $sql_ary = array_merge($this->profilefield_data, array(
+ 'field_order' => $max_field_order + 1,
+ ));
+
+ $sql = 'INSERT INTO ' . PROFILE_FIELDS_TABLE . ' ' . $this->db->sql_build_array('INSERT', $sql_ary);
+ $this->db->sql_query($sql);
+ $field_id = (int) $this->db->sql_nextid();
+
+ $insert_buffer = new \phpbb\db\sql_insert_buffer($this->db, PROFILE_LANG_TABLE);
+
+ $sql = 'SELECT lang_id
+ FROM ' . LANG_TABLE;
+ $result = $this->db->sql_query($sql);
+ $lang_name = (strpos($this->profilefield_name, 'phpbb_') === 0) ? strtoupper(substr($this->profilefield_name, 6)) : strtoupper($this->profilefield_name);
+ while ($lang_id = (int) $this->db->sql_fetchfield('lang_id'))
+ {
+ $insert_buffer->insert(array(
+ 'field_id' => (int) $field_id,
+ 'lang_id' => (int) $lang_id,
+ 'lang_name' => $lang_name,
+ 'lang_explain' => '',
+ 'lang_default_value' => '',
+ ));
+ }
+ $this->db->sql_freeresult($result);
+
+ $insert_buffer->flush();
+ }
+
+ /**
+ * Create Custom profile fields languguage entries
+ */
+ public function create_language_entries()
+ {
+ $field_id = $this->get_custom_profile_field_id();
+
+ $insert_buffer = new \phpbb\db\sql_insert_buffer($this->db, PROFILE_FIELDS_LANG_TABLE);
+
+ $sql = 'SELECT lang_id
+ FROM ' . LANG_TABLE;
+ $result = $this->db->sql_query($sql);
+ while ($lang_id = (int) $this->db->sql_fetchfield('lang_id'))
+ {
+ foreach ($this->profilefield_language_data as $language_data)
+ {
+ $insert_buffer->insert(array_merge(array(
+ 'field_id' => (int) $field_id,
+ 'lang_id' => (int) $lang_id,
+ ), $language_data));
+ }
+ }
+ $this->db->sql_freeresult($result);
+
+ $insert_buffer->flush();
+ }
+
+ /**
+ * Clean database when reverting the migration
+ */
+ public function delete_custom_profile_field_data()
+ {
+ $field_id = $this->get_custom_profile_field_id();
+
+ $sql = 'DELETE FROM ' . PROFILE_FIELDS_TABLE . '
+ WHERE field_id = ' . (int) $field_id;
+ $this->db->sql_query($sql);
+
+ $sql = 'DELETE FROM ' . PROFILE_LANG_TABLE . '
+ WHERE field_id = ' . (int) $field_id;
+ $this->db->sql_query($sql);
+
+ $sql = 'DELETE FROM ' . PROFILE_FIELDS_LANG_TABLE . '
+ WHERE field_id = ' . (int) $field_id;
+ $this->db->sql_query($sql);
+ }
+
+ /**
+ * Get custom profile field id
+ * @return int custom profile filed id
+ */
+ public function get_custom_profile_field_id()
+ {
+ $sql = 'SELECT field_id
+ FROM ' . PROFILE_FIELDS_TABLE . "
+ WHERE field_name = '" . $this->profilefield_name . "'";
+ $result = $this->db->sql_query($sql);
+ $field_id = (int) $this->db->sql_fetchfield('field_id');
+ $this->db->sql_freeresult($result);
+
+ return $field_id;
+ }
+
+ /**
+ * @param int $start Start of staggering step
+ * @return mixed int start of the next step, null if the end was reached
+ */
+ public function convert_user_field_to_custom_field($start)
+ {
+ $insert_buffer = new \phpbb\db\sql_insert_buffer($this->db, $this->table_prefix . 'profile_fields_data');
+ $limit = 250;
+ $converted_users = 0;
+ $start = $start ?: 0;
+
+ $sql = 'SELECT user_id, ' . $this->user_column_name . '
+ FROM ' . $this->table_prefix . 'users
+ WHERE ' . $this->user_column_name . " <> ''
+ ORDER BY user_id";
+ $result = $this->db->sql_query_limit($sql, $limit, $start);
+
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $converted_users++;
+
+ $cp_data = array(
+ 'pf_' . $this->profilefield_name => $row[$this->user_column_name],
+ );
+
+ $sql = 'UPDATE ' . $this->table_prefix . 'profile_fields_data
+ SET ' . $this->db->sql_build_array('UPDATE', $cp_data) . '
+ WHERE user_id = ' . (int) $row['user_id'];
+ $this->db->sql_query($sql);
+
+ if (!$this->db->sql_affectedrows())
+ {
+ $cp_data['user_id'] = (int) $row['user_id'];
+ $cp_data = array_merge($this->get_insert_sql_array(), $cp_data);
+ $insert_buffer->insert($cp_data);
+ }
+ }
+ $this->db->sql_freeresult($result);
+
+ $insert_buffer->flush();
+
+ if ($converted_users < $limit)
+ {
+ // No more users left, we are done...
+ return;
+ }
+
+ return $start + $limit;
+ }
+
+ protected function get_insert_sql_array()
+ {
+ static $profile_row;
+
+ if ($profile_row === null)
+ {
+ $manager = $this->container->get('profilefields.manager');
+ $profile_row = $manager->build_insert_sql_array(array());
+ }
+
+ return $profile_row;
+ }
+}
diff --git a/phpBB/phpbb/db/migration/schema_generator.php b/phpBB/phpbb/db/migration/schema_generator.php
new file mode 100644
index 0000000000..91d8307d91
--- /dev/null
+++ b/phpBB/phpbb/db/migration/schema_generator.php
@@ -0,0 +1,235 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration;
+
+/**
+* The schema generator generates the schema based on the existing migrations
+*/
+class schema_generator
+{
+ /** @var \phpbb\config\config */
+ protected $config;
+
+ /** @var \phpbb\db\driver\driver_interface */
+ protected $db;
+
+ /** @var \phpbb\db\tools */
+ protected $db_tools;
+
+ /** @var array */
+ protected $class_names;
+
+ /** @var string */
+ protected $table_prefix;
+
+ /** @var string */
+ protected $phpbb_root_path;
+
+ /** @var string */
+ protected $php_ext;
+
+ /** @var array */
+ protected $tables;
+
+ /** @var array */
+ protected $dependencies = array();
+
+ /**
+ * Constructor
+ */
+ public function __construct(array $class_names, \phpbb\config\config $config, \phpbb\db\driver\driver_interface $db, \phpbb\db\tools $db_tools, $phpbb_root_path, $php_ext, $table_prefix)
+ {
+ $this->config = $config;
+ $this->db = $db;
+ $this->db_tools = $db_tools;
+ $this->class_names = $class_names;
+ $this->phpbb_root_path = $phpbb_root_path;
+ $this->php_ext = $php_ext;
+ $this->table_prefix = $table_prefix;
+ }
+
+ /**
+ * Loads all migrations and their application state from the database.
+ *
+ * @return array
+ */
+ public function get_schema()
+ {
+ if (!empty($this->tables))
+ {
+ return $this->tables;
+ }
+
+ $migrations = $this->class_names;
+
+ $tree = array();
+ $check_dependencies = true;
+ while (!empty($migrations))
+ {
+ foreach ($migrations as $migration_class)
+ {
+ $open_dependencies = array_diff($migration_class::depends_on(), $tree);
+
+ if (empty($open_dependencies))
+ {
+ $migration = new $migration_class($this->config, $this->db, $this->db_tools, $this->phpbb_root_path, $this->php_ext, $this->table_prefix);
+ $tree[] = $migration_class;
+ $migration_key = array_search($migration_class, $migrations);
+
+ foreach ($migration->update_schema() as $change_type => $data)
+ {
+ if ($change_type === 'add_tables')
+ {
+ foreach ($data as $table => $table_data)
+ {
+ $this->tables[$table] = $table_data;
+ }
+ }
+ else if ($change_type === 'drop_tables')
+ {
+ foreach ($data as $table)
+ {
+ unset($this->tables[$table]);
+ }
+ }
+ else if ($change_type === 'add_columns')
+ {
+ foreach ($data as $table => $add_columns)
+ {
+ foreach ($add_columns as $column => $column_data)
+ {
+ if (isset($column_data['after']))
+ {
+ $columns = $this->tables[$table]['COLUMNS'];
+ $offset = array_search($column_data['after'], array_keys($columns));
+ unset($column_data['after']);
+
+ if ($offset === false)
+ {
+ $this->tables[$table]['COLUMNS'][$column] = array_values($column_data);
+ }
+ else
+ {
+ $this->tables[$table]['COLUMNS'] = array_merge(array_slice($columns, 0, $offset + 1, true), array($column => array_values($column_data)), array_slice($columns, $offset));
+ }
+ }
+ else
+ {
+ $this->tables[$table]['COLUMNS'][$column] = $column_data;
+ }
+ }
+ }
+ }
+ else if ($change_type === 'change_columns')
+ {
+ foreach ($data as $table => $change_columns)
+ {
+ foreach ($change_columns as $column => $column_data)
+ {
+ $this->tables[$table]['COLUMNS'][$column] = $column_data;
+ }
+ }
+ }
+ else if ($change_type === 'drop_columns')
+ {
+ foreach ($data as $table => $drop_columns)
+ {
+ if (is_array($drop_columns))
+ {
+ foreach ($drop_columns as $column)
+ {
+ unset($this->tables[$table]['COLUMNS'][$column]);
+ }
+ }
+ else
+ {
+ unset($this->tables[$table]['COLUMNS'][$drop_columns]);
+ }
+ }
+ }
+ else if ($change_type === 'add_unique_index')
+ {
+ foreach ($data as $table => $add_index)
+ {
+ foreach ($add_index as $key => $index_data)
+ {
+ $this->tables[$table]['KEYS'][$key] = array('UNIQUE', $index_data);
+ }
+ }
+ }
+ else if ($change_type === 'add_index')
+ {
+ foreach ($data as $table => $add_index)
+ {
+ foreach ($add_index as $key => $index_data)
+ {
+ $this->tables[$table]['KEYS'][$key] = array('INDEX', $index_data);
+ }
+ }
+ }
+ else if ($change_type === 'drop_keys')
+ {
+ foreach ($data as $table => $drop_keys)
+ {
+ foreach ($drop_keys as $key)
+ {
+ unset($this->tables[$table]['KEYS'][$key]);
+ }
+ }
+ }
+ else
+ {
+ var_dump($change_type);
+ }
+ }
+ unset($migrations[$migration_key]);
+ }
+ else if ($check_dependencies)
+ {
+ $this->dependencies = array_merge($this->dependencies, $open_dependencies);
+ }
+ }
+
+ // Only run this check after the first run
+ if ($check_dependencies)
+ {
+ $this->check_dependencies();
+ $check_dependencies = false;
+ }
+ }
+
+ ksort($this->tables);
+ return $this->tables;
+ }
+
+ /**
+ * Check if one of the migrations files' dependencies can't be resolved
+ * by the supplied list of migrations
+ *
+ * @throws \UnexpectedValueException If a dependency can't be resolved
+ */
+ protected function check_dependencies()
+ {
+ // Strip duplicate values from array
+ $this->dependencies = array_unique($this->dependencies);
+
+ foreach ($this->dependencies as $dependency)
+ {
+ if (!in_array($dependency, $this->class_names))
+ {
+ throw new \UnexpectedValueException("Unable to resolve the dependency '$dependency'");
+ }
+ }
+ }
+}
diff --git a/phpBB/phpbb/db/migration/tool/config.php b/phpBB/phpbb/db/migration/tool/config.php
new file mode 100644
index 0000000000..33aa8ff026
--- /dev/null
+++ b/phpBB/phpbb/db/migration/tool/config.php
@@ -0,0 +1,165 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\tool;
+
+/**
+* Migration config tool
+*/
+class config implements \phpbb\db\migration\tool\tool_interface
+{
+ /** @var \phpbb\config\config */
+ protected $config;
+
+ /**
+ * Constructor
+ *
+ * @param \phpbb\config\config $config
+ */
+ public function __construct(\phpbb\config\config $config)
+ {
+ $this->config = $config;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_name()
+ {
+ return 'config';
+ }
+
+ /**
+ * Add a config setting.
+ *
+ * @param string $config_name The name of the config setting
+ * you would like to add
+ * @param mixed $config_value The value of the config setting
+ * @param bool $is_dynamic True if it is dynamic (changes very often)
+ * and should not be stored in the cache, false if not.
+ * @return null
+ */
+ public function add($config_name, $config_value, $is_dynamic = false)
+ {
+ if (isset($this->config[$config_name]))
+ {
+ return;
+ }
+
+ $this->config->set($config_name, $config_value, !$is_dynamic);
+ }
+
+ /**
+ * Update an existing config setting.
+ *
+ * @param string $config_name The name of the config setting you would
+ * like to update
+ * @param mixed $config_value The value of the config setting
+ * @return null
+ * @throws \phpbb\db\migration\exception
+ */
+ public function update($config_name, $config_value)
+ {
+ if (!isset($this->config[$config_name]))
+ {
+ throw new \phpbb\db\migration\exception('CONFIG_NOT_EXIST', $config_name);
+ }
+
+ $this->config->set($config_name, $config_value);
+ }
+
+ /**
+ * Update a config setting if the first argument equal to the
+ * current config value
+ *
+ * @param string $compare If equal to the current config value, will be
+ * updated to the new config value, otherwise not
+ * @param string $config_name The name of the config setting you would
+ * like to update
+ * @param mixed $config_value The value of the config setting
+ * @return null
+ * @throws \phpbb\db\migration\exception
+ */
+ public function update_if_equals($compare, $config_name, $config_value)
+ {
+ if (!isset($this->config[$config_name]))
+ {
+ throw new \phpbb\db\migration\exception('CONFIG_NOT_EXIST', $config_name);
+ }
+
+ $this->config->set_atomic($config_name, $compare, $config_value);
+ }
+
+ /**
+ * Remove an existing config setting.
+ *
+ * @param string $config_name The name of the config setting you would
+ * like to remove
+ * @return null
+ */
+ public function remove($config_name)
+ {
+ if (!isset($this->config[$config_name]))
+ {
+ return;
+ }
+
+ $this->config->delete($config_name);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function reverse()
+ {
+ $arguments = func_get_args();
+ $original_call = array_shift($arguments);
+
+ $call = false;
+ switch ($original_call)
+ {
+ case 'add':
+ $call = 'remove';
+ break;
+
+ case 'remove':
+ $call = 'add';
+ if (sizeof($arguments) == 1)
+ {
+ $arguments[] = '';
+ }
+ break;
+
+ case 'update_if_equals':
+ $call = 'update_if_equals';
+
+ // Set to the original value if the current value is what we compared to originally
+ $arguments = array(
+ $arguments[2],
+ $arguments[1],
+ $arguments[0],
+ );
+ break;
+
+ case 'reverse':
+ // Reversing a reverse is just the call itself
+ $call = array_shift($arguments);
+ break;
+ }
+
+ if ($call)
+ {
+ return call_user_func_array(array(&$this, $call), $arguments);
+ }
+ }
+}
diff --git a/phpBB/phpbb/db/migration/tool/config_text.php b/phpBB/phpbb/db/migration/tool/config_text.php
new file mode 100644
index 0000000000..54b45f6f6d
--- /dev/null
+++ b/phpBB/phpbb/db/migration/tool/config_text.php
@@ -0,0 +1,130 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\tool;
+
+/**
+* Migration config_text tool
+*/
+class config_text implements \phpbb\db\migration\tool\tool_interface
+{
+ /** @var \phpbb\config\db_text */
+ protected $config_text;
+
+ /**
+ * Constructor
+ *
+ * @param \phpbb\config\db_text $config_text
+ */
+ public function __construct(\phpbb\config\db_text $config_text)
+ {
+ $this->config_text = $config_text;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_name()
+ {
+ return 'config_text';
+ }
+
+ /**
+ * Add a config_text setting.
+ *
+ * @param string $config_name The name of the config_text setting
+ * you would like to add
+ * @param mixed $config_value The value of the config_text setting
+ * @return null
+ */
+ public function add($config_name, $config_value)
+ {
+ if (!is_null($this->config_text->get($config_name)))
+ {
+ return;
+ }
+
+ $this->config_text->set($config_name, $config_value);
+ }
+
+ /**
+ * Update an existing config_text setting.
+ *
+ * @param string $config_name The name of the config_text setting you would
+ * like to update
+ * @param mixed $config_value The value of the config_text setting
+ * @return null
+ * @throws \phpbb\db\migration\exception
+ */
+ public function update($config_name, $config_value)
+ {
+ if (is_null($this->config_text->get($config_name)))
+ {
+ throw new \phpbb\db\migration\exception('CONFIG_NOT_EXIST', $config_name);
+ }
+
+ $this->config_text->set($config_name, $config_value);
+ }
+
+ /**
+ * Remove an existing config_text setting.
+ *
+ * @param string $config_name The name of the config_text setting you would
+ * like to remove
+ * @return null
+ */
+ public function remove($config_name)
+ {
+ if (is_null($this->config_text->get($config_name)))
+ {
+ return;
+ }
+
+ $this->config_text->delete($config_name);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function reverse()
+ {
+ $arguments = func_get_args();
+ $original_call = array_shift($arguments);
+
+ $call = false;
+ switch ($original_call)
+ {
+ case 'add':
+ $call = 'remove';
+ break;
+
+ case 'remove':
+ $call = 'add';
+ if (sizeof($arguments) == 1)
+ {
+ $arguments[] = '';
+ }
+ break;
+
+ case 'reverse':
+ // Reversing a reverse is just the call itself
+ $call = array_shift($arguments);
+ break;
+ }
+
+ if ($call)
+ {
+ return call_user_func_array(array(&$this, $call), $arguments);
+ }
+ }
+}
diff --git a/phpBB/phpbb/db/migration/tool/module.php b/phpBB/phpbb/db/migration/tool/module.php
new file mode 100644
index 0000000000..7ea7d1dac1
--- /dev/null
+++ b/phpBB/phpbb/db/migration/tool/module.php
@@ -0,0 +1,563 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\tool;
+
+/**
+* Migration module management tool
+*/
+class module implements \phpbb\db\migration\tool\tool_interface
+{
+ /** @var \phpbb\cache\service */
+ protected $cache;
+
+ /** @var \phpbb\db\driver\driver_interface */
+ protected $db;
+
+ /** @var \phpbb\user */
+ protected $user;
+
+ /** @var string */
+ protected $phpbb_root_path;
+
+ /** @var string */
+ protected $php_ext;
+
+ /** @var string */
+ protected $modules_table;
+
+ /** @var array */
+ protected $module_categories = array();
+
+ /**
+ * Constructor
+ *
+ * @param \phpbb\db\driver\driver_interface $db
+ * @param \phpbb\cache\service $cache
+ * @param \phpbb\user $user
+ * @param string $phpbb_root_path
+ * @param string $php_ext
+ * @param string $modules_table
+ */
+ public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\cache\service $cache, \phpbb\user $user, $phpbb_root_path, $php_ext, $modules_table)
+ {
+ $this->db = $db;
+ $this->cache = $cache;
+ $this->user = $user;
+ $this->phpbb_root_path = $phpbb_root_path;
+ $this->php_ext = $php_ext;
+ $this->modules_table = $modules_table;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_name()
+ {
+ return 'module';
+ }
+
+ /**
+ * Module Exists
+ *
+ * Check if a module exists
+ *
+ * @param string $class The module class(acp|mcp|ucp)
+ * @param int|string|bool $parent The parent module_id|module_langname (0 for no parent).
+ * Use false to ignore the parent check and check class wide.
+ * @param int|string $module The module_id|module_langname you would like to
+ * check for to see if it exists
+ * @return bool true/false if module exists
+ */
+ public function exists($class, $parent, $module)
+ {
+ // the main root directory should return true
+ if (!$module)
+ {
+ return true;
+ }
+
+ $parent_sql = '';
+ if ($parent !== false)
+ {
+ $parent = $this->get_parent_module_id($parent, $module, false);
+ if ($parent === false)
+ {
+ return false;
+ }
+
+ $parent_sql = 'AND parent_id = ' . (int) $parent;
+ }
+
+ $sql = 'SELECT module_id
+ FROM ' . $this->modules_table . "
+ WHERE module_class = '" . $this->db->sql_escape($class) . "'
+ $parent_sql
+ AND " . ((is_numeric($module)) ? 'module_id = ' . (int) $module : "module_langname = '" . $this->db->sql_escape($module) . "'");
+ $result = $this->db->sql_query($sql);
+ $module_id = $this->db->sql_fetchfield('module_id');
+ $this->db->sql_freeresult($result);
+
+ if ($module_id)
+ {
+ return true;
+ }
+
+ return false;
+ }
+
+ /**
+ * Module Add
+ *
+ * Add a new module
+ *
+ * @param string $class The module class(acp|mcp|ucp)
+ * @param int|string $parent The parent module_id|module_langname (0 for no parent)
+ * @param array $data an array of the data on the new \module.
+ * This can be setup in two different ways.
+ * 1. The "manual" way. For inserting a category or one at a time.
+ * It will be merged with the base array shown a bit below,
+ * but at the least requires 'module_langname' to be sent, and,
+ * if you want to create a module (instead of just a category) you must
+ * send module_basename and module_mode.
+ * array(
+ * 'module_enabled' => 1,
+ * 'module_display' => 1,
+ * 'module_basename' => '',
+ * 'module_class' => $class,
+ * 'parent_id' => (int) $parent,
+ * 'module_langname' => '',
+ * 'module_mode' => '',
+ * 'module_auth' => '',
+ * )
+ * 2. The "automatic" way. For inserting multiple at a time based on the
+ * specs in the info file for the module(s). For this to work the
+ * modules must be correctly setup in the info file.
+ * An example follows (this would insert the settings, log, and flag
+ * modes from the includes/acp/info/acp_asacp.php file):
+ * array(
+ * 'module_basename' => 'asacp',
+ * 'modes' => array('settings', 'log', 'flag'),
+ * )
+ * Optionally you may not send 'modes' and it will insert all of the
+ * modules in that info file.
+ * path, specify that here
+ * @return null
+ * @throws \phpbb\db\migration\exception
+ */
+ public function add($class, $parent = 0, $data = array())
+ {
+ // allow sending the name as a string in $data to create a category
+ if (!is_array($data))
+ {
+ $data = array('module_langname' => $data);
+ }
+
+ $parent = $data['parent_id'] = $this->get_parent_module_id($parent, $data);
+
+ if (!isset($data['module_langname']))
+ {
+ // The "automatic" way
+ $basename = (isset($data['module_basename'])) ? $data['module_basename'] : '';
+ $module = $this->get_module_info($class, $basename);
+
+ $result = '';
+ foreach ($module['modes'] as $mode => $module_info)
+ {
+ if (!isset($data['modes']) || in_array($mode, $data['modes']))
+ {
+ $new_module = array(
+ 'module_basename' => $basename,
+ 'module_langname' => $module_info['title'],
+ 'module_mode' => $mode,
+ 'module_auth' => $module_info['auth'],
+ 'module_display' => (isset($module_info['display'])) ? $module_info['display'] : true,
+ 'before' => (isset($module_info['before'])) ? $module_info['before'] : false,
+ 'after' => (isset($module_info['after'])) ? $module_info['after'] : false,
+ );
+
+ // Run the "manual" way with the data we've collected.
+ $this->add($class, $parent, $new_module);
+ }
+ }
+
+ return;
+ }
+
+ // The "manual" way
+ if (!$this->exists($class, false, $parent))
+ {
+ throw new \phpbb\db\migration\exception('MODULE_NOT_EXIST', $parent);
+ }
+
+ if ($this->exists($class, $parent, $data['module_langname']))
+ {
+ throw new \phpbb\db\migration\exception('MODULE_EXISTS', $data['module_langname']);
+ }
+
+ if (!class_exists('acp_modules'))
+ {
+ include($this->phpbb_root_path . 'includes/acp/acp_modules.' . $this->php_ext);
+ $this->user->add_lang('acp/modules');
+ }
+ $acp_modules = new \acp_modules();
+
+ $module_data = array(
+ 'module_enabled' => (isset($data['module_enabled'])) ? $data['module_enabled'] : 1,
+ 'module_display' => (isset($data['module_display'])) ? $data['module_display'] : 1,
+ 'module_basename' => (isset($data['module_basename'])) ? $data['module_basename'] : '',
+ 'module_class' => $class,
+ 'parent_id' => (int) $parent,
+ 'module_langname' => (isset($data['module_langname'])) ? $data['module_langname'] : '',
+ 'module_mode' => (isset($data['module_mode'])) ? $data['module_mode'] : '',
+ 'module_auth' => (isset($data['module_auth'])) ? $data['module_auth'] : '',
+ );
+ $result = $acp_modules->update_module_data($module_data, true);
+
+ // update_module_data can either return a string or an empty array...
+ if (is_string($result))
+ {
+ // Error
+ throw new \phpbb\db\migration\exception('MODULE_ERROR', $result);
+ }
+ else
+ {
+ // Success
+ $module_log_name = ((isset($this->user->lang[$data['module_langname']])) ? $this->user->lang[$data['module_langname']] : $data['module_langname']);
+ add_log('admin', 'LOG_MODULE_ADD', $module_log_name);
+
+ // Move the module if requested above/below an existing one
+ if (isset($data['before']) && $data['before'])
+ {
+ $sql = 'SELECT left_id
+ FROM ' . $this->modules_table . "
+ WHERE module_class = '" . $this->db->sql_escape($class) . "'
+ AND parent_id = " . (int) $parent . "
+ AND module_langname = '" . $this->db->sql_escape($data['before']) . "'";
+ $this->db->sql_query($sql);
+ $to_left = (int) $this->db->sql_fetchfield('left_id');
+
+ $sql = 'UPDATE ' . $this->modules_table . "
+ SET left_id = left_id + 2, right_id = right_id + 2
+ WHERE module_class = '" . $this->db->sql_escape($class) . "'
+ AND left_id >= $to_left
+ AND left_id < {$module_data['left_id']}";
+ $this->db->sql_query($sql);
+
+ $sql = 'UPDATE ' . $this->modules_table . "
+ SET left_id = $to_left, right_id = " . ($to_left + 1) . "
+ WHERE module_class = '" . $this->db->sql_escape($class) . "'
+ AND module_id = {$module_data['module_id']}";
+ $this->db->sql_query($sql);
+ }
+ else if (isset($data['after']) && $data['after'])
+ {
+ $sql = 'SELECT right_id
+ FROM ' . $this->modules_table . "
+ WHERE module_class = '" . $this->db->sql_escape($class) . "'
+ AND parent_id = " . (int) $parent . "
+ AND module_langname = '" . $this->db->sql_escape($data['after']) . "'";
+ $this->db->sql_query($sql);
+ $to_right = (int) $this->db->sql_fetchfield('right_id');
+
+ $sql = 'UPDATE ' . $this->modules_table . "
+ SET left_id = left_id + 2, right_id = right_id + 2
+ WHERE module_class = '" . $this->db->sql_escape($class) . "'
+ AND left_id >= $to_right
+ AND left_id < {$module_data['left_id']}";
+ $this->db->sql_query($sql);
+
+ $sql = 'UPDATE ' . $this->modules_table . '
+ SET left_id = ' . ($to_right + 1) . ', right_id = ' . ($to_right + 2) . "
+ WHERE module_class = '" . $this->db->sql_escape($class) . "'
+ AND module_id = {$module_data['module_id']}";
+ $this->db->sql_query($sql);
+ }
+ }
+
+ // Clear the Modules Cache
+ $this->cache->destroy("_modules_$class");
+ }
+
+ /**
+ * Module Remove
+ *
+ * Remove a module
+ *
+ * @param string $class The module class(acp|mcp|ucp)
+ * @param int|string|bool $parent The parent module_id|module_langname(0 for no parent).
+ * Use false to ignore the parent check and check class wide.
+ * @param int|string $module The module id|module_langname
+ * specify that here
+ * @return null
+ * @throws \phpbb\db\migration\exception
+ */
+ public function remove($class, $parent = 0, $module = '')
+ {
+ // Imitation of module_add's "automatic" and "manual" method so the uninstaller works from the same set of instructions for umil_auto
+ if (is_array($module))
+ {
+ if (isset($module['module_langname']))
+ {
+ // Manual Method
+ return $this->remove($class, $parent, $module['module_langname']);
+ }
+
+ // Failed.
+ if (!isset($module['module_basename']))
+ {
+ throw new \phpbb\db\migration\exception('MODULE_NOT_EXIST');
+ }
+
+ // Automatic method
+ $basename = $module['module_basename'];
+ $module_info = $this->get_module_info($class, $basename);
+
+ foreach ($module_info['modes'] as $mode => $info)
+ {
+ if (!isset($module['modes']) || in_array($mode, $module['modes']))
+ {
+ $this->remove($class, $parent, $info['title']);
+ }
+ }
+ }
+ else
+ {
+ if (!$this->exists($class, $parent, $module))
+ {
+ return;
+ }
+
+ $parent_sql = '';
+ if ($parent !== false)
+ {
+ $parent = $this->get_parent_module_id($parent, $module);
+ $parent_sql = 'AND parent_id = ' . (int) $parent;
+ }
+
+ $module_ids = array();
+ if (!is_numeric($module))
+ {
+ $sql = 'SELECT module_id
+ FROM ' . $this->modules_table . "
+ WHERE module_langname = '" . $this->db->sql_escape($module) . "'
+ AND module_class = '" . $this->db->sql_escape($class) . "'
+ $parent_sql";
+ $result = $this->db->sql_query($sql);
+ while ($module_id = $this->db->sql_fetchfield('module_id'))
+ {
+ $module_ids[] = (int) $module_id;
+ }
+ $this->db->sql_freeresult($result);
+ }
+ else
+ {
+ $module_ids[] = (int) $module;
+ }
+
+ if (!class_exists('acp_modules'))
+ {
+ include($this->phpbb_root_path . 'includes/acp/acp_modules.' . $this->php_ext);
+ $this->user->add_lang('acp/modules');
+ }
+ $acp_modules = new \acp_modules();
+ $acp_modules->module_class = $class;
+
+ foreach ($module_ids as $module_id)
+ {
+ $result = $acp_modules->delete_module($module_id);
+ if (!empty($result))
+ {
+ return;
+ }
+ }
+
+ $this->cache->destroy("_modules_$class");
+ }
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function reverse()
+ {
+ $arguments = func_get_args();
+ $original_call = array_shift($arguments);
+
+ $call = false;
+ switch ($original_call)
+ {
+ case 'add':
+ $call = 'remove';
+ break;
+
+ case 'remove':
+ $call = 'add';
+ break;
+
+ case 'reverse':
+ // Reversing a reverse is just the call itself
+ $call = array_shift($arguments);
+ break;
+ }
+
+ if ($call)
+ {
+ return call_user_func_array(array(&$this, $call), $arguments);
+ }
+ }
+
+ /**
+ * Wrapper for \acp_modules::get_module_infos()
+ *
+ * @param string $class Module Class
+ * @param string $basename Module Basename
+ * @return array Module Information
+ * @throws \phpbb\db\migration\exception
+ */
+ protected function get_module_info($class, $basename)
+ {
+ if (!class_exists('acp_modules'))
+ {
+ include($this->phpbb_root_path . 'includes/acp/acp_modules.' . $this->php_ext);
+ $this->user->add_lang('acp/modules');
+ }
+ $acp_modules = new \acp_modules();
+ $module = $acp_modules->get_module_infos($basename, $class, true);
+
+ if (empty($module))
+ {
+ throw new \phpbb\db\migration\exception('MODULE_INFO_FILE_NOT_EXIST', $class, $basename);
+ }
+
+ return array_pop($module);
+ }
+
+ /**
+ * Get the list of installed module categories
+ * key - module_id
+ * value - module_langname
+ *
+ * @return null
+ */
+ protected function get_categories_list()
+ {
+ // Select the top level categories
+ // and 2nd level [sub]categories
+ $sql = 'SELECT m2.module_id, m2.module_langname
+ FROM ' . $this->modules_table . ' m1, ' . $this->modules_table . " m2
+ WHERE m1.parent_id = 0
+ AND (m1.module_id = m2.module_id OR m2.parent_id = m1.module_id)
+ ORDER BY m1.module_id, m2.module_id ASC";
+
+ $result = $this->db->sql_query($sql);
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $this->module_categories[(int) $row['module_id']] = $row['module_langname'];
+ }
+ $this->db->sql_freeresult($result);
+ }
+
+ /**
+ * Get parent module id
+ *
+ * @param string|int $parent_id The parent module_id|module_langname
+ * @param int|string|array $data The module_id, module_langname for existance checking or module data array for adding
+ * @param bool $throw_exception The flag indicating if exception should be thrown on error
+ * @return mixed The int parent module_id or false
+ * @throws \phpbb\db\migration\exception
+ */
+ public function get_parent_module_id($parent_id, $data = '', $throw_exception = true)
+ {
+ // Initialize exception object placeholder
+ $exception = false;
+
+ // Allow '' to be sent as 0
+ $parent_id = $parent_id ?: 0;
+
+ // If automatic adding is in action, convert array back to string to simplify things
+ if (is_array($data) && sizeof($data) == 1)
+ {
+ $data = $data['module_langname'];
+ }
+
+ if (!is_numeric($parent_id))
+ {
+ // Refresh the $module_categories array
+ $this->get_categories_list();
+
+ // Search for the parent module_langname
+ $ids = array_keys($this->module_categories, $parent_id);
+
+ switch (sizeof($ids))
+ {
+ // No parent with the given module_langname exist
+ case 0:
+ $exception = new \phpbb\db\migration\exception('MODULE_NOT_EXIST', $parent_id);
+ break;
+
+ // Return the module id
+ case 1:
+ $parent_id = (int) $ids[0];
+ break;
+
+ // Several modules with the given module_langname were found
+ // Try to determine the parent_id by the neighbour module parent
+ default:
+ if (is_array($data) && (isset($data['before']) || isset($data['after'])))
+ {
+ $neighbour_module_langname = isset($data['before']) ? $data['before'] : $data['after'];
+ $sql = 'SELECT parent_id
+ FROM ' . $this->modules_table . "
+ WHERE module_langname = '" . $this->db->sql_escape($neighbour_module_langname) . "'
+ AND " . $this->db->sql_in_set('parent_id', $ids);
+ $result = $this->db->sql_query($sql);
+ $parent_id = (int) $this->db->sql_fetchfield('parent_id');
+ if (!$parent_id)
+ {
+ $exception = new \phpbb\db\migration\exception('PARENT_MODULE_FIND_ERROR', $data['parent_id']);
+ }
+ }
+ else if (!empty($data) && !is_array($data))
+ {
+ // The module_langname is set, checking for the module existance
+ // As more than 1 parents were found already, there's no way for null parent_id here
+ $sql = 'SELECT m2.module_id as module_parent_id
+ FROM ' . $this->modules_table . ' m1, ' . $this->modules_table . " m2
+ WHERE " . ((is_numeric($data)) ? 'm1.module_id = ' . (int) $data : "m1.module_langname = '" . $this->db->sql_escape($data)) . "'
+ AND m2.module_id = m1.parent_id
+ AND " . $this->db->sql_in_set('m2.module_id', $ids);
+ $result = $this->db->sql_query($sql);
+ $parent_id = (int) $this->db->sql_fetchfield('module_parent_id');
+ }
+ else
+ {
+ //Unable to get the parent module id, throwing an exception
+ $exception = new \phpbb\db\migration\exception('MODULE_EXIST_MULTIPLE', $parent_id);
+ }
+ break;
+ }
+ }
+
+ if ($exception !== false)
+ {
+ if ($throw_exception)
+ {
+ throw $exception;
+ }
+ return false;
+ }
+
+ return $parent_id;
+ }
+}
diff --git a/phpBB/phpbb/db/migration/tool/permission.php b/phpBB/phpbb/db/migration/tool/permission.php
new file mode 100644
index 0000000000..9688420025
--- /dev/null
+++ b/phpBB/phpbb/db/migration/tool/permission.php
@@ -0,0 +1,652 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\tool;
+
+/**
+* Migration permission management tool
+*/
+class permission implements \phpbb\db\migration\tool\tool_interface
+{
+ /** @var \phpbb\auth\auth */
+ protected $auth;
+
+ /** @var \phpbb\cache\service */
+ protected $cache;
+
+ /** @var \phpbb\db\driver\driver_interface */
+ protected $db;
+
+ /** @var string */
+ protected $phpbb_root_path;
+
+ /** @var string */
+ protected $php_ext;
+
+ /**
+ * Constructor
+ *
+ * @param \phpbb\db\driver\driver_interface $db
+ * @param \phpbb\cache\service $cache
+ * @param \phpbb\auth\auth $auth
+ * @param string $phpbb_root_path
+ * @param string $php_ext
+ */
+ public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\cache\service $cache, \phpbb\auth\auth $auth, $phpbb_root_path, $php_ext)
+ {
+ $this->db = $db;
+ $this->cache = $cache;
+ $this->auth = $auth;
+ $this->phpbb_root_path = $phpbb_root_path;
+ $this->php_ext = $php_ext;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_name()
+ {
+ return 'permission';
+ }
+
+ /**
+ * Permission Exists
+ *
+ * Check if a permission (auth) setting exists
+ *
+ * @param string $auth_option The name of the permission (auth) option
+ * @param bool $global True for checking a global permission setting,
+ * False for a local permission setting
+ * @return bool true if it exists, false if not
+ */
+ public function exists($auth_option, $global = true)
+ {
+ if ($global)
+ {
+ $type_sql = ' AND is_global = 1';
+ }
+ else
+ {
+ $type_sql = ' AND is_local = 1';
+ }
+
+ $sql = 'SELECT auth_option_id
+ FROM ' . ACL_OPTIONS_TABLE . "
+ WHERE auth_option = '" . $this->db->sql_escape($auth_option) . "'"
+ . $type_sql;
+ $result = $this->db->sql_query($sql);
+
+ $row = $this->db->sql_fetchrow($result);
+ $this->db->sql_freeresult($result);
+
+ if ($row)
+ {
+ return true;
+ }
+
+ return false;
+ }
+
+ /**
+ * Permission Add
+ *
+ * Add a permission (auth) option
+ *
+ * @param string $auth_option The name of the permission (auth) option
+ * @param bool $global True for checking a global permission setting,
+ * False for a local permission setting
+ * @param int|false $copy_from If set, contains the id of the permission from which to copy the new one.
+ * @return null
+ */
+ public function add($auth_option, $global = true, $copy_from = false)
+ {
+ if ($this->exists($auth_option, $global))
+ {
+ return;
+ }
+
+ // We've added permissions, so set to true to notify the user.
+ $this->permissions_added = true;
+
+ if (!class_exists('auth_admin'))
+ {
+ include($this->phpbb_root_path . 'includes/acp/auth.' . $this->php_ext);
+ }
+ $auth_admin = new \auth_admin();
+
+ // We have to add a check to see if the !$global (if global, local, and if local, global) permission already exists. If it does, acl_add_option currently has a bug which would break the ACL system, so we are having a work-around here.
+ if ($this->exists($auth_option, !$global))
+ {
+ $sql_ary = array(
+ 'is_global' => 1,
+ 'is_local' => 1,
+ );
+ $sql = 'UPDATE ' . ACL_OPTIONS_TABLE . '
+ SET ' . $this->db->sql_build_array('UPDATE', $sql_ary) . "
+ WHERE auth_option = '" . $this->db->sql_escape($auth_option) . "'";
+ $this->db->sql_query($sql);
+ }
+ else
+ {
+ if ($global)
+ {
+ $auth_admin->acl_add_option(array('global' => array($auth_option)));
+ }
+ else
+ {
+ $auth_admin->acl_add_option(array('local' => array($auth_option)));
+ }
+ }
+
+ // The permission has been added, now we can copy it if needed
+ if ($copy_from && isset($auth_admin->acl_options['id'][$copy_from]))
+ {
+ $old_id = $auth_admin->acl_options['id'][$copy_from];
+ $new_id = $auth_admin->acl_options['id'][$auth_option];
+
+ $tables = array(ACL_GROUPS_TABLE, ACL_ROLES_DATA_TABLE, ACL_USERS_TABLE);
+
+ foreach ($tables as $table)
+ {
+ $sql = 'SELECT *
+ FROM ' . $table . '
+ WHERE auth_option_id = ' . $old_id;
+ $result = $this->db->sql_query($sql);
+
+ $sql_ary = array();
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $row['auth_option_id'] = $new_id;
+ $sql_ary[] = $row;
+ }
+ $this->db->sql_freeresult($result);
+
+ if (!empty($sql_ary))
+ {
+ $this->db->sql_multi_insert($table, $sql_ary);
+ }
+ }
+
+ $auth_admin->acl_clear_prefetch();
+ }
+ }
+
+ /**
+ * Permission Remove
+ *
+ * Remove a permission (auth) option
+ *
+ * @param string $auth_option The name of the permission (auth) option
+ * @param bool $global True for checking a global permission setting,
+ * False for a local permission setting
+ * @return null
+ */
+ public function remove($auth_option, $global = true)
+ {
+ if (!$this->exists($auth_option, $global))
+ {
+ return;
+ }
+
+ if ($global)
+ {
+ $type_sql = ' AND is_global = 1';
+ }
+ else
+ {
+ $type_sql = ' AND is_local = 1';
+ }
+ $sql = 'SELECT auth_option_id, is_global, is_local
+ FROM ' . ACL_OPTIONS_TABLE . "
+ WHERE auth_option = '" . $this->db->sql_escape($auth_option) . "'" .
+ $type_sql;
+ $result = $this->db->sql_query($sql);
+ $row = $this->db->sql_fetchrow($result);
+ $this->db->sql_freeresult($result);
+
+ $id = (int) $row['auth_option_id'];
+
+ // If it is a local and global permission, do not remove the row! :P
+ if ($row['is_global'] && $row['is_local'])
+ {
+ $sql = 'UPDATE ' . ACL_OPTIONS_TABLE . '
+ SET ' . (($global) ? 'is_global = 0' : 'is_local = 0') . '
+ WHERE auth_option_id = ' . $id;
+ $this->db->sql_query($sql);
+ }
+ else
+ {
+ // Delete time
+ $tables = array(ACL_GROUPS_TABLE, ACL_ROLES_DATA_TABLE, ACL_USERS_TABLE, ACL_OPTIONS_TABLE);
+ foreach ($tables as $table)
+ {
+ $this->db->sql_query('DELETE FROM ' . $table . '
+ WHERE auth_option_id = ' . $id);
+ }
+ }
+
+ // Purge the auth cache
+ $this->cache->destroy('_acl_options');
+ $this->auth->acl_clear_prefetch();
+ }
+
+ /**
+ * Add a new permission role
+ *
+ * @param string $role_name The new role name
+ * @param string $role_type The type (u_, m_, a_)
+ * @param string $role_description Description of the new role
+ *
+ * @return null
+ */
+ public function role_add($role_name, $role_type, $role_description = '')
+ {
+ $sql = 'SELECT role_id
+ FROM ' . ACL_ROLES_TABLE . "
+ WHERE role_name = '" . $this->db->sql_escape($role_name) . "'";
+ $this->db->sql_query($sql);
+ $role_id = (int) $this->db->sql_fetchfield('role_id');
+
+ if ($role_id)
+ {
+ return;
+ }
+
+ $sql = 'SELECT MAX(role_order) AS max_role_order
+ FROM ' . ACL_ROLES_TABLE . "
+ WHERE role_type = '" . $this->db->sql_escape($role_type) . "'";
+ $this->db->sql_query($sql);
+ $role_order = (int) $this->db->sql_fetchfield('max_role_order');
+ $role_order = (!$role_order) ? 1 : $role_order + 1;
+
+ $sql_ary = array(
+ 'role_name' => $role_name,
+ 'role_description' => $role_description,
+ 'role_type' => $role_type,
+ 'role_order' => $role_order,
+ );
+
+ $sql = 'INSERT INTO ' . ACL_ROLES_TABLE . ' ' . $this->db->sql_build_array('INSERT', $sql_ary);
+ $this->db->sql_query($sql);
+ }
+
+ /**
+ * Update the name on a permission role
+ *
+ * @param string $old_role_name The old role name
+ * @param string $new_role_name The new role name
+ * @return null
+ * @throws \phpbb\db\migration\exception
+ */
+ public function role_update($old_role_name, $new_role_name)
+ {
+ $sql = 'SELECT role_id
+ FROM ' . ACL_ROLES_TABLE . "
+ WHERE role_name = '" . $this->db->sql_escape($old_role_name) . "'";
+ $this->db->sql_query($sql);
+ $role_id = (int) $this->db->sql_fetchfield('role_id');
+
+ if (!$role_id)
+ {
+ throw new \phpbb\db\migration\exception('ROLE_NOT_EXIST', $old_role_name);
+ }
+
+ $sql = 'UPDATE ' . ACL_ROLES_TABLE . "
+ SET role_name = '" . $this->db->sql_escape($new_role_name) . "'
+ WHERE role_name = '" . $this->db->sql_escape($old_role_name) . "'";
+ $this->db->sql_query($sql);
+ }
+
+ /**
+ * Remove a permission role
+ *
+ * @param string $role_name The role name to remove
+ * @return null
+ */
+ public function role_remove($role_name)
+ {
+ $sql = 'SELECT role_id
+ FROM ' . ACL_ROLES_TABLE . "
+ WHERE role_name = '" . $this->db->sql_escape($role_name) . "'";
+ $this->db->sql_query($sql);
+ $role_id = (int) $this->db->sql_fetchfield('role_id');
+
+ if (!$role_id)
+ {
+ return;
+ }
+
+ $sql = 'DELETE FROM ' . ACL_ROLES_DATA_TABLE . '
+ WHERE role_id = ' . $role_id;
+ $this->db->sql_query($sql);
+
+ $sql = 'DELETE FROM ' . ACL_ROLES_TABLE . '
+ WHERE role_id = ' . $role_id;
+ $this->db->sql_query($sql);
+
+ $this->auth->acl_clear_prefetch();
+ }
+
+ /**
+ * Permission Set
+ *
+ * Allows you to set permissions for a certain group/role
+ *
+ * @param string $name The name of the role/group
+ * @param string|array $auth_option The auth_option or array of
+ * auth_options you would like to set
+ * @param string $type The type (role|group)
+ * @param bool $has_permission True if you want to give them permission,
+ * false if you want to deny them permission
+ * @return null
+ * @throws \phpbb\db\migration\exception
+ */
+ public function permission_set($name, $auth_option, $type = 'role', $has_permission = true)
+ {
+ if (!is_array($auth_option))
+ {
+ $auth_option = array($auth_option);
+ }
+
+ $new_auth = array();
+ $sql = 'SELECT auth_option_id
+ FROM ' . ACL_OPTIONS_TABLE . '
+ WHERE ' . $this->db->sql_in_set('auth_option', $auth_option);
+ $result = $this->db->sql_query($sql);
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $new_auth[] = (int) $row['auth_option_id'];
+ }
+ $this->db->sql_freeresult($result);
+
+ if (empty($new_auth))
+ {
+ return;
+ }
+
+ $current_auth = array();
+
+ $type = (string) $type; // Prevent PHP bug.
+
+ switch ($type)
+ {
+ case 'role':
+ $sql = 'SELECT role_id
+ FROM ' . ACL_ROLES_TABLE . "
+ WHERE role_name = '" . $this->db->sql_escape($name) . "'";
+ $this->db->sql_query($sql);
+ $role_id = (int) $this->db->sql_fetchfield('role_id');
+
+ if (!$role_id)
+ {
+ throw new \phpbb\db\migration\exception('ROLE_NOT_EXIST', $name);
+ }
+
+ $sql = 'SELECT auth_option_id, auth_setting
+ FROM ' . ACL_ROLES_DATA_TABLE . '
+ WHERE role_id = ' . $role_id;
+ $result = $this->db->sql_query($sql);
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $current_auth[$row['auth_option_id']] = $row['auth_setting'];
+ }
+ $this->db->sql_freeresult($result);
+ break;
+
+ case 'group':
+ $sql = 'SELECT group_id
+ FROM ' . GROUPS_TABLE . "
+ WHERE group_name = '" . $this->db->sql_escape($name) . "'";
+ $this->db->sql_query($sql);
+ $group_id = (int) $this->db->sql_fetchfield('group_id');
+
+ if (!$group_id)
+ {
+ throw new \phpbb\db\migration\exception('GROUP_NOT_EXIST', $name);
+ }
+
+ // If the group has a role set for them we will add the requested permissions to that role.
+ $sql = 'SELECT auth_role_id
+ FROM ' . ACL_GROUPS_TABLE . '
+ WHERE group_id = ' . $group_id . '
+ AND auth_role_id <> 0
+ AND forum_id = 0';
+ $this->db->sql_query($sql);
+ $role_id = (int) $this->db->sql_fetchfield('auth_role_id');
+ if ($role_id)
+ {
+ $sql = 'SELECT role_name, role_type
+ FROM ' . ACL_ROLES_TABLE . '
+ WHERE role_id = ' . $role_id;
+ $this->db->sql_query($sql);
+ $role_data = $this->db->sql_fetchrow();
+ $role_name = $role_data['role_name'];
+ $role_type = $role_data['role_type'];
+
+ // Filter new auth options to match the role type: a_ | f_ | m_ | u_
+ // Set new auth options to the role only if options matching the role type were found
+ $auth_option = array_filter($auth_option,
+ function ($option) use ($role_type)
+ {
+ return strpos($option, $role_type) === 0;
+ }
+ );
+
+ if (sizeof($auth_option))
+ {
+ return $this->permission_set($role_name, $auth_option, 'role', $has_permission);
+ }
+ }
+
+ $sql = 'SELECT auth_option_id, auth_setting
+ FROM ' . ACL_GROUPS_TABLE . '
+ WHERE group_id = ' . $group_id;
+ $result = $this->db->sql_query($sql);
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $current_auth[$row['auth_option_id']] = $row['auth_setting'];
+ }
+ $this->db->sql_freeresult($result);
+ break;
+ }
+
+ $sql_ary = array();
+ switch ($type)
+ {
+ case 'role':
+ foreach ($new_auth as $auth_option_id)
+ {
+ if (!isset($current_auth[$auth_option_id]))
+ {
+ $sql_ary[] = array(
+ 'role_id' => $role_id,
+ 'auth_option_id' => $auth_option_id,
+ 'auth_setting' => $has_permission,
+ );
+ }
+ }
+
+ $this->db->sql_multi_insert(ACL_ROLES_DATA_TABLE, $sql_ary);
+ break;
+
+ case 'group':
+ foreach ($new_auth as $auth_option_id)
+ {
+ if (!isset($current_auth[$auth_option_id]))
+ {
+ $sql_ary[] = array(
+ 'group_id' => $group_id,
+ 'auth_option_id' => $auth_option_id,
+ 'auth_setting' => $has_permission,
+ );
+ }
+ }
+
+ $this->db->sql_multi_insert(ACL_GROUPS_TABLE, $sql_ary);
+ break;
+ }
+
+ $this->auth->acl_clear_prefetch();
+ }
+
+ /**
+ * Permission Unset
+ *
+ * Allows you to unset (remove) permissions for a certain group/role
+ *
+ * @param string $name The name of the role/group
+ * @param string|array $auth_option The auth_option or array of
+ * auth_options you would like to set
+ * @param string $type The type (role|group)
+ * @return null
+ * @throws \phpbb\db\migration\exception
+ */
+ public function permission_unset($name, $auth_option, $type = 'role')
+ {
+ if (!is_array($auth_option))
+ {
+ $auth_option = array($auth_option);
+ }
+
+ $to_remove = array();
+ $sql = 'SELECT auth_option_id
+ FROM ' . ACL_OPTIONS_TABLE . '
+ WHERE ' . $this->db->sql_in_set('auth_option', $auth_option);
+ $result = $this->db->sql_query($sql);
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $to_remove[] = (int) $row['auth_option_id'];
+ }
+ $this->db->sql_freeresult($result);
+
+ if (empty($to_remove))
+ {
+ return;
+ }
+
+ $type = (string) $type; // Prevent PHP bug.
+
+ switch ($type)
+ {
+ case 'role':
+ $sql = 'SELECT role_id
+ FROM ' . ACL_ROLES_TABLE . "
+ WHERE role_name = '" . $this->db->sql_escape($name) . "'";
+ $this->db->sql_query($sql);
+ $role_id = (int) $this->db->sql_fetchfield('role_id');
+
+ if (!$role_id)
+ {
+ throw new \phpbb\db\migration\exception('ROLE_NOT_EXIST', $name);
+ }
+
+ $sql = 'DELETE FROM ' . ACL_ROLES_DATA_TABLE . '
+ WHERE ' . $this->db->sql_in_set('auth_option_id', $to_remove) . '
+ AND role_id = ' . (int) $role_id;
+ $this->db->sql_query($sql);
+ break;
+
+ case 'group':
+ $sql = 'SELECT group_id
+ FROM ' . GROUPS_TABLE . "
+ WHERE group_name = '" . $this->db->sql_escape($name) . "'";
+ $this->db->sql_query($sql);
+ $group_id = (int) $this->db->sql_fetchfield('group_id');
+
+ if (!$group_id)
+ {
+ throw new \phpbb\db\migration\exception('GROUP_NOT_EXIST', $name);
+ }
+
+ // If the group has a role set for them we will remove the requested permissions from that role.
+ $sql = 'SELECT auth_role_id
+ FROM ' . ACL_GROUPS_TABLE . '
+ WHERE group_id = ' . $group_id . '
+ AND auth_role_id <> 0';
+ $this->db->sql_query($sql);
+ $role_id = (int) $this->db->sql_fetchfield('auth_role_id');
+ if ($role_id)
+ {
+ $sql = 'SELECT role_name
+ FROM ' . ACL_ROLES_TABLE . '
+ WHERE role_id = ' . $role_id;
+ $this->db->sql_query($sql);
+ $role_name = $this->db->sql_fetchfield('role_name');
+
+ return $this->permission_unset($role_name, $auth_option, 'role');
+ }
+
+ $sql = 'DELETE FROM ' . ACL_GROUPS_TABLE . '
+ WHERE ' . $this->db->sql_in_set('auth_option_id', $to_remove);
+ $this->db->sql_query($sql);
+ break;
+ }
+
+ $this->auth->acl_clear_prefetch();
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function reverse()
+ {
+ $arguments = func_get_args();
+ $original_call = array_shift($arguments);
+
+ $call = false;
+ switch ($original_call)
+ {
+ case 'add':
+ $call = 'remove';
+ break;
+
+ case 'remove':
+ $call = 'add';
+ break;
+
+ case 'permission_set':
+ $call = 'permission_unset';
+ break;
+
+ case 'permission_unset':
+ $call = 'permission_set';
+ break;
+
+ case 'role_add':
+ $call = 'role_remove';
+ break;
+
+ case 'role_remove':
+ $call = 'role_add';
+ break;
+
+ case 'role_update':
+ // Set to the original value if the current value is what we compared to originally
+ $arguments = array(
+ $arguments[1],
+ $arguments[0],
+ );
+ break;
+
+ case 'reverse':
+ // Reversing a reverse is just the call itself
+ $call = array_shift($arguments);
+ break;
+ }
+
+ if ($call)
+ {
+ return call_user_func_array(array(&$this, $call), $arguments);
+ }
+ }
+}
diff --git a/phpBB/phpbb/db/migration/tool/tool_interface.php b/phpBB/phpbb/db/migration/tool/tool_interface.php
new file mode 100644
index 0000000000..07cd2435e4
--- /dev/null
+++ b/phpBB/phpbb/db/migration/tool/tool_interface.php
@@ -0,0 +1,37 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\tool;
+
+/**
+* Migration tool interface
+*/
+interface tool_interface
+{
+ /**
+ * Retrieve a short name used for commands in migrations.
+ *
+ * @return string short name
+ */
+ public function get_name();
+
+ /**
+ * Reverse an original install action
+ *
+ * First argument is the original call to the class (e.g. add, remove)
+ * After the first argument, send the original arguments to the function in the original call
+ *
+ * @return null
+ */
+ public function reverse();
+}
diff --git a/phpBB/phpbb/db/migrator.php b/phpBB/phpbb/db/migrator.php
new file mode 100644
index 0000000000..45a333ac94
--- /dev/null
+++ b/phpBB/phpbb/db/migrator.php
@@ -0,0 +1,924 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db;
+
+use Symfony\Component\DependencyInjection\ContainerAwareInterface;
+use Symfony\Component\DependencyInjection\ContainerInterface;
+
+/**
+* The migrator is responsible for applying new migrations in the correct order.
+*/
+class migrator
+{
+ /**
+ * @var ContainerInterface
+ */
+ protected $container;
+
+ /** @var \phpbb\config\config */
+ protected $config;
+
+ /** @var \phpbb\db\driver\driver_interface */
+ protected $db;
+
+ /** @var \phpbb\db\tools */
+ protected $db_tools;
+
+ /** @var \phpbb\db\migration\helper */
+ protected $helper;
+
+ /** @var string */
+ protected $table_prefix;
+
+ /** @var string */
+ protected $phpbb_root_path;
+
+ /** @var string */
+ protected $php_ext;
+
+ /** @var string */
+ protected $migrations_table;
+
+ /**
+ * State of all migrations
+ *
+ * (SELECT * FROM migrations table)
+ *
+ * @var array
+ */
+ protected $migration_state = array();
+
+ /**
+ * Array of all migrations available to be run
+ *
+ * @var array
+ */
+ protected $migrations = array();
+
+ /**
+ * Array of migrations that have been determined to be fulfillable
+ *
+ * @var array
+ */
+ protected $fulfillable_migrations = array();
+
+ /**
+ * 'name,' 'class,' and 'state' of the last migration run
+ *
+ * 'effectively_installed' set and set to true if the migration was effectively_installed
+ *
+ * @var array
+ */
+ protected $last_run_migration = false;
+
+ /**
+ * The output handler. A null handler is configured by default.
+ *
+ * @var migrator_output_handler_interface
+ */
+ protected $output_handler;
+
+ /**
+ * Constructor of the database migrator
+ */
+ public function __construct(ContainerInterface $container, \phpbb\config\config $config, \phpbb\db\driver\driver_interface $db, \phpbb\db\tools $db_tools, $migrations_table, $phpbb_root_path, $php_ext, $table_prefix, $tools, \phpbb\db\migration\helper $helper)
+ {
+ $this->container = $container;
+ $this->config = $config;
+ $this->db = $db;
+ $this->db_tools = $db_tools;
+ $this->helper = $helper;
+
+ $this->migrations_table = $migrations_table;
+
+ $this->phpbb_root_path = $phpbb_root_path;
+ $this->php_ext = $php_ext;
+
+ $this->table_prefix = $table_prefix;
+
+ $this->output_handler = new null_migrator_output_handler();
+
+ foreach ($tools as $tool)
+ {
+ $this->tools[$tool->get_name()] = $tool;
+ }
+
+ $this->tools['dbtools'] = $this->db_tools;
+
+ $this->load_migration_state();
+ }
+
+ /**
+ * Set the output handler.
+ *
+ * @param migrator_output_handler $handler The output handler
+ */
+ public function set_output_handler(migrator_output_handler_interface $handler)
+ {
+ $this->output_handler = $handler;
+ }
+
+ /**
+ * Loads all migrations and their application state from the database.
+ *
+ * @return null
+ */
+ public function load_migration_state()
+ {
+ $this->migration_state = array();
+
+ // prevent errors in case the table does not exist yet
+ $this->db->sql_return_on_error(true);
+
+ $sql = "SELECT *
+ FROM " . $this->migrations_table;
+ $result = $this->db->sql_query($sql);
+
+ if (!$this->db->get_sql_error_triggered())
+ {
+ while ($migration = $this->db->sql_fetchrow($result))
+ {
+ $this->migration_state[$migration['migration_name']] = $migration;
+
+ $this->migration_state[$migration['migration_name']]['migration_depends_on'] = unserialize($migration['migration_depends_on']);
+ $this->migration_state[$migration['migration_name']]['migration_data_state'] = !empty($migration['migration_data_state']) ? unserialize($migration['migration_data_state']) : '';
+ }
+ }
+
+ $this->db->sql_freeresult($result);
+
+ $this->db->sql_return_on_error(false);
+ }
+
+ /**
+ * Get an array with information about the last migration run.
+ *
+ * The array contains 'name', 'class' and 'state'. 'effectively_installed' is set
+ * and set to true if the last migration was effectively_installed.
+ *
+ * @return array
+ */
+ public function get_last_run_migration()
+ {
+ return $this->last_run_migration;
+ }
+
+ /**
+ * Sets the list of available migration class names to the given array.
+ *
+ * @param array $class_names An array of migration class names
+ * @return null
+ */
+ public function set_migrations($class_names)
+ {
+ $this->migrations = $class_names;
+ }
+
+ /**
+ * Runs a single update step from the next migration to be applied.
+ *
+ * The update step can either be a schema or a (partial) data update. To
+ * check if update() needs to be called again use the finished() method.
+ *
+ * @return null
+ */
+ public function update()
+ {
+ $this->container->get('dispatcher')->disable();
+ $this->update_do();
+ $this->container->get('dispatcher')->enable();
+ }
+
+ /**
+ * Get a valid migration name from the migration state array in case the
+ * supplied name is not in the migration state list.
+ *
+ * @param string $name Migration name
+ * @return string Migration name
+ */
+ protected function get_valid_name($name)
+ {
+ // Try falling back to a valid migration name with or without leading backslash
+ if (!isset($this->migration_state[$name]))
+ {
+ $prepended_name = ($name[0] == '\\' ? '' : '\\') . $name;
+ $prefixless_name = $name[0] == '\\' ? substr($name, 1) : $name;
+
+ if (isset($this->migration_state[$prepended_name]))
+ {
+ $name = $prepended_name;
+ }
+ else if (isset($this->migration_state[$prefixless_name]))
+ {
+ $name = $prefixless_name;
+ }
+ }
+
+ return $name;
+ }
+
+ /**
+ * Effectively runs a single update step from the next migration to be applied.
+ *
+ * @return null
+ */
+ protected function update_do()
+ {
+ foreach ($this->migrations as $name)
+ {
+ $name = $this->get_valid_name($name);
+
+ if (!isset($this->migration_state[$name]) ||
+ !$this->migration_state[$name]['migration_schema_done'] ||
+ !$this->migration_state[$name]['migration_data_done'])
+ {
+ if (!$this->try_apply($name))
+ {
+ continue;
+ }
+ else
+ {
+ return;
+ }
+ }
+ else
+ {
+ $this->output_handler->write(array('MIGRATION_EFFECTIVELY_INSTALLED', $name), migrator_output_handler_interface::VERBOSITY_DEBUG);
+ }
+ }
+ }
+
+ /**
+ * Attempts to apply a step of the given migration or one of its dependencies
+ *
+ * @param string $name The class name of the migration
+ * @return bool Whether any update step was successfully run
+ * @throws \phpbb\db\migration\exception
+ */
+ protected function try_apply($name)
+ {
+ if (!class_exists($name))
+ {
+ $this->output_handler->write(array('MIGRATION_NOT_VALID', $name), migrator_output_handler_interface::VERBOSITY_DEBUG);
+ return false;
+ }
+
+ $migration = $this->get_migration($name);
+
+ $state = (isset($this->migration_state[$name])) ?
+ $this->migration_state[$name] :
+ array(
+ 'migration_depends_on' => $migration->depends_on(),
+ 'migration_schema_done' => false,
+ 'migration_data_done' => false,
+ 'migration_data_state' => '',
+ 'migration_start_time' => 0,
+ 'migration_end_time' => 0,
+ );
+
+ if (!empty($state['migration_depends_on']))
+ {
+ $this->output_handler->write(array('MIGRATION_APPLY_DEPENDENCIES', $name), migrator_output_handler_interface::VERBOSITY_DEBUG);
+ }
+
+ foreach ($state['migration_depends_on'] as $depend)
+ {
+ $depend = $this->get_valid_name($depend);
+
+ // Test all possible namings before throwing exception
+ if ($this->unfulfillable($depend) !== false)
+ {
+ throw new \phpbb\db\migration\exception('MIGRATION_NOT_FULFILLABLE', $name, $depend);
+ }
+
+ if (!isset($this->migration_state[$depend]) ||
+ !$this->migration_state[$depend]['migration_schema_done'] ||
+ !$this->migration_state[$depend]['migration_data_done'])
+ {
+ return $this->try_apply($depend);
+ }
+ }
+
+ $this->last_run_migration = array(
+ 'name' => $name,
+ 'class' => $migration,
+ 'state' => $state,
+ 'task' => '',
+ );
+
+ if (!isset($this->migration_state[$name]))
+ {
+ if ($state['migration_start_time'] == 0 && $migration->effectively_installed())
+ {
+ $state = array(
+ 'migration_depends_on' => $migration->depends_on(),
+ 'migration_schema_done' => true,
+ 'migration_data_done' => true,
+ 'migration_data_state' => '',
+ 'migration_start_time' => 0,
+ 'migration_end_time' => 0,
+ );
+
+ $this->last_run_migration['effectively_installed'] = true;
+
+ $this->output_handler->write(array('MIGRATION_EFFECTIVELY_INSTALLED', $name), migrator_output_handler_interface::VERBOSITY_VERBOSE);
+ }
+ else
+ {
+ $state['migration_start_time'] = time();
+ }
+ }
+
+ $this->set_migration_state($name, $state);
+
+ if (!$state['migration_schema_done'])
+ {
+ $verbosity = empty($state['migration_data_state']) ?
+ migrator_output_handler_interface::VERBOSITY_VERBOSE : migrator_output_handler_interface::VERBOSITY_DEBUG;
+ $this->output_handler->write(array('MIGRATION_SCHEMA_RUNNING', $name), $verbosity);
+
+ $this->last_run_migration['task'] = 'process_schema_step';
+
+ $total_time = (is_array($state['migration_data_state']) && isset($state['migration_data_state']['_total_time'])) ?
+ $state['migration_data_state']['_total_time'] : 0.0;
+ $elapsed_time = microtime(true);
+
+ $steps = $this->helper->get_schema_steps($migration->update_schema());
+ $result = $this->process_data_step($steps, $state['migration_data_state']);
+
+ $elapsed_time = microtime(true) - $elapsed_time;
+ $total_time += $elapsed_time;
+
+ if (is_array($result))
+ {
+ $result['_total_time'] = $total_time;
+ }
+
+ $state['migration_data_state'] = ($result === true) ? '' : $result;
+ $state['migration_schema_done'] = ($result === true);
+
+ if ($state['migration_schema_done'])
+ {
+ $this->output_handler->write(array('MIGRATION_SCHEMA_DONE', $name, $total_time), migrator_output_handler_interface::VERBOSITY_NORMAL);
+ }
+ else
+ {
+ $this->output_handler->write(array('MIGRATION_SCHEMA_IN_PROGRESS', $name, $elapsed_time), migrator_output_handler_interface::VERBOSITY_VERY_VERBOSE);
+ }
+ }
+ else if (!$state['migration_data_done'])
+ {
+ try
+ {
+ $verbosity = empty($state['migration_data_state']) ?
+ migrator_output_handler_interface::VERBOSITY_VERBOSE : migrator_output_handler_interface::VERBOSITY_DEBUG;
+ $this->output_handler->write(array('MIGRATION_DATA_RUNNING', $name), $verbosity);
+
+ $this->last_run_migration['task'] = 'process_data_step';
+
+ $total_time = (is_array($state['migration_data_state']) && isset($state['migration_data_state']['_total_time'])) ?
+ $state['migration_data_state']['_total_time'] : 0.0;
+ $elapsed_time = microtime(true);
+
+ $result = $this->process_data_step($migration->update_data(), $state['migration_data_state']);
+
+ $elapsed_time = microtime(true) - $elapsed_time;
+ $total_time += $elapsed_time;
+
+ if (is_array($result))
+ {
+ $result['_total_time'] = $total_time;
+ }
+
+ $state['migration_data_state'] = ($result === true) ? '' : $result;
+ $state['migration_data_done'] = ($result === true);
+ $state['migration_end_time'] = ($result === true) ? time() : 0;
+
+ if ($state['migration_data_done'])
+ {
+ $this->output_handler->write(array('MIGRATION_DATA_DONE', $name, $total_time), migrator_output_handler_interface::VERBOSITY_NORMAL);
+ }
+ else
+ {
+ $this->output_handler->write(array('MIGRATION_DATA_IN_PROGRESS', $name, $elapsed_time), migrator_output_handler_interface::VERBOSITY_VERY_VERBOSE);
+ }
+ }
+ catch (\phpbb\db\migration\exception $e)
+ {
+ // Reset data state and revert the schema changes
+ $state['migration_data_state'] = '';
+ $this->set_migration_state($name, $state);
+
+ $this->revert_do($name);
+
+ throw $e;
+ }
+ }
+
+ $this->set_migration_state($name, $state);
+
+ return true;
+ }
+
+ /**
+ * Runs a single revert step from the last migration installed
+ *
+ * YOU MUST ADD/SET ALL MIGRATIONS THAT COULD BE DEPENDENT ON THE MIGRATION TO REVERT TO BEFORE CALLING THIS METHOD!
+ * The revert step can either be a schema or a (partial) data revert. To
+ * check if revert() needs to be called again use the migration_state() method.
+ *
+ * @param string $migration String migration name to revert (including any that depend on this migration)
+ */
+ public function revert($migration)
+ {
+ $this->container->get('dispatcher')->disable();
+ $this->revert_do($migration);
+ $this->container->get('dispatcher')->enable();
+ }
+
+ /**
+ * Effectively runs a single revert step from the last migration installed
+ *
+ * @param string $migration String migration name to revert (including any that depend on this migration)
+ * @return null
+ */
+ protected function revert_do($migration)
+ {
+ if (!isset($this->migration_state[$migration]))
+ {
+ // Not installed
+ return;
+ }
+
+ foreach ($this->migration_state as $name => $state)
+ {
+ if (!empty($state['migration_depends_on']) && in_array($migration, $state['migration_depends_on']))
+ {
+ $this->revert_do($name);
+ }
+ }
+
+ $this->try_revert($migration);
+ }
+
+ /**
+ * Attempts to revert a step of the given migration or one of its dependencies
+ *
+ * @param string $name The class name of the migration
+ * @return bool Whether any update step was successfully run
+ */
+ protected function try_revert($name)
+ {
+ if (!class_exists($name))
+ {
+ return false;
+ }
+
+ $migration = $this->get_migration($name);
+
+ $state = $this->migration_state[$name];
+
+ $this->last_run_migration = array(
+ 'name' => $name,
+ 'class' => $migration,
+ 'task' => '',
+ );
+
+ if ($state['migration_data_done'])
+ {
+ $steps = array_merge($this->helper->reverse_update_data($migration->update_data()), $migration->revert_data());
+ $result = $this->process_data_step($steps, $state['migration_data_state']);
+
+ $state['migration_data_state'] = ($result === true) ? '' : $result;
+ $state['migration_data_done'] = ($result === true) ? false : true;
+
+ $this->set_migration_state($name, $state);
+ }
+ else if ($state['migration_schema_done'])
+ {
+ $steps = $this->helper->get_schema_steps($migration->revert_schema());
+ $result = $this->process_data_step($steps, $state['migration_data_state']);
+
+ $state['migration_data_state'] = ($result === true) ? '' : $result;
+ $state['migration_schema_done'] = ($result === true) ? false : true;
+
+ if (!$state['migration_schema_done'])
+ {
+ $sql = 'DELETE FROM ' . $this->migrations_table . "
+ WHERE migration_name = '" . $this->db->sql_escape($name) . "'";
+ $this->db->sql_query($sql);
+
+ $this->last_run_migration = false;
+ unset($this->migration_state[$name]);
+ }
+ else
+ {
+ $this->set_migration_state($name, $state);
+ }
+ }
+
+ return true;
+ }
+
+ /**
+ * Process the data step of the migration
+ *
+ * @param array $steps The steps to run
+ * @param bool|string $state Current state of the migration
+ * @param bool $revert true to revert a data step
+ * @return bool|string migration state. True if completed, serialized array if not finished
+ * @throws \phpbb\db\migration\exception
+ */
+ protected function process_data_step($steps, $state, $revert = false)
+ {
+ if (sizeof($steps) === 0)
+ {
+ return true;
+ }
+
+ $state = is_array($state) ? $state : false;
+
+ // reverse order of steps if reverting
+ if ($revert === true)
+ {
+ $steps = array_reverse($steps);
+ }
+
+ $step = $last_result = 0;
+ if ($state)
+ {
+ $step = $state['step'];
+
+ // We send the result from last time to the callable function
+ $last_result = $state['result'];
+ }
+
+ try
+ {
+ // Result will be null or true if everything completed correctly
+ // Stop after each update step, to let the updater control the script runtime
+ $result = $this->run_step($steps[$step], $last_result, $revert);
+ if (($result !== null && $result !== true) || $step + 1 < sizeof($steps))
+ {
+ return array(
+ 'result' => $result,
+ // Move on if the last call finished
+ 'step' => ($result !== null && $result !== true) ? $step : $step + 1,
+ );
+ }
+ }
+ catch (\phpbb\db\migration\exception $e)
+ {
+ // We should try rolling back here
+ foreach ($steps as $reverse_step_identifier => $reverse_step)
+ {
+ // If we've reached the current step we can break because we reversed everything that was run
+ if ($reverse_step_identifier == $step)
+ {
+ break;
+ }
+
+ // Reverse the step that was run
+ $result = $this->run_step($reverse_step, false, !$revert);
+ }
+
+ throw $e;
+ }
+
+ return true;
+ }
+
+ /**
+ * Run a single step
+ *
+ * An exception should be thrown if an error occurs
+ *
+ * @param mixed $step Data step from migration
+ * @param mixed $last_result Result to pass to the callable (only for 'custom' method)
+ * @param bool $reverse False to install, True to attempt uninstallation by reversing the call
+ * @return null
+ */
+ protected function run_step($step, $last_result = 0, $reverse = false)
+ {
+ $callable_and_parameters = $this->get_callable_from_step($step, $last_result, $reverse);
+
+ if ($callable_and_parameters === false)
+ {
+ return;
+ }
+
+ $callable = $callable_and_parameters[0];
+ $parameters = $callable_and_parameters[1];
+
+ return call_user_func_array($callable, $parameters);
+ }
+
+ /**
+ * Get a callable statement from a data step
+ *
+ * @param array $step Data step from migration
+ * @param mixed $last_result Result to pass to the callable (only for 'custom' method)
+ * @param bool $reverse False to install, True to attempt uninstallation by reversing the call
+ * @return array Array with parameters for call_user_func_array(), 0 is the callable, 1 is parameters
+ * @throws \phpbb\db\migration\exception
+ */
+ protected function get_callable_from_step(array $step, $last_result = 0, $reverse = false)
+ {
+ $type = $step[0];
+ $parameters = $step[1];
+
+ $parts = explode('.', $type);
+
+ $class = $parts[0];
+ $method = false;
+
+ if (isset($parts[1]))
+ {
+ $method = $parts[1];
+ }
+
+ switch ($class)
+ {
+ case 'if':
+ if (!isset($parameters[0]))
+ {
+ throw new \phpbb\db\migration\exception('MIGRATION_INVALID_DATA_MISSING_CONDITION', $step);
+ }
+
+ if (!isset($parameters[1]))
+ {
+ throw new \phpbb\db\migration\exception('MIGRATION_INVALID_DATA_MISSING_STEP', $step);
+ }
+
+ if ($reverse)
+ {
+ // We might get unexpected results when trying
+ // to revert this, so just avoid it
+ return false;
+ }
+
+ $condition = $parameters[0];
+
+ if (!$condition)
+ {
+ return false;
+ }
+
+ $step = $parameters[1];
+
+ return $this->get_callable_from_step($step);
+ break;
+
+ case 'custom':
+ if (!is_callable($parameters[0]))
+ {
+ throw new \phpbb\db\migration\exception('MIGRATION_INVALID_DATA_CUSTOM_NOT_CALLABLE', $step);
+ }
+
+ if ($reverse)
+ {
+ return false;
+ }
+ else
+ {
+ return array(
+ $parameters[0],
+ array($last_result),
+ );
+ }
+ break;
+
+ default:
+ if (!$method)
+ {
+ throw new \phpbb\db\migration\exception('MIGRATION_INVALID_DATA_UNKNOWN_TYPE', $step);
+ }
+
+ if (!isset($this->tools[$class]))
+ {
+ throw new \phpbb\db\migration\exception('MIGRATION_INVALID_DATA_UNDEFINED_TOOL', $step);
+ }
+
+ if (!method_exists(get_class($this->tools[$class]), $method))
+ {
+ throw new \phpbb\db\migration\exception('MIGRATION_INVALID_DATA_UNDEFINED_METHOD', $step);
+ }
+
+ // Attempt to reverse operations
+ if ($reverse)
+ {
+ array_unshift($parameters, $method);
+
+ return array(
+ array($this->tools[$class], 'reverse'),
+ $parameters,
+ );
+ }
+
+ return array(
+ array($this->tools[$class], $method),
+ $parameters,
+ );
+ break;
+ }
+ }
+
+ /**
+ * Insert/Update migration row into the database
+ *
+ * @param string $name Name of the migration
+ * @param array $state
+ * @return null
+ */
+ protected function set_migration_state($name, $state)
+ {
+ $migration_row = $state;
+ $migration_row['migration_depends_on'] = serialize($state['migration_depends_on']);
+ $migration_row['migration_data_state'] = !empty($state['migration_data_state']) ? serialize($state['migration_data_state']) : '';
+
+ if (isset($this->migration_state[$name]))
+ {
+ $sql = 'UPDATE ' . $this->migrations_table . '
+ SET ' . $this->db->sql_build_array('UPDATE', $migration_row) . "
+ WHERE migration_name = '" . $this->db->sql_escape($name) . "'";
+ $this->db->sql_query($sql);
+ }
+ else
+ {
+ $migration_row['migration_name'] = $name;
+ $sql = 'INSERT INTO ' . $this->migrations_table . '
+ ' . $this->db->sql_build_array('INSERT', $migration_row);
+ $this->db->sql_query($sql);
+ }
+
+ $this->migration_state[$name] = $state;
+
+ $this->last_run_migration['state'] = $state;
+ }
+
+ /**
+ * Checks if a migration's dependencies can even theoretically be satisfied.
+ *
+ * @param string $name The class name of the migration
+ * @return bool|string False if fulfillable, string of missing migration name if unfulfillable
+ */
+ public function unfulfillable($name)
+ {
+ $name = $this->get_valid_name($name);
+
+ if (isset($this->migration_state[$name]) || isset($this->fulfillable_migrations[$name]))
+ {
+ return false;
+ }
+
+ if (!class_exists($name))
+ {
+ return $name;
+ }
+
+ $migration = $this->get_migration($name);
+ $depends = $migration->depends_on();
+
+ foreach ($depends as $depend)
+ {
+ $depend = $this->get_valid_name($depend);
+ $unfulfillable = $this->unfulfillable($depend);
+ if ($unfulfillable !== false)
+ {
+ return $unfulfillable;
+ }
+ }
+ $this->fulfillable_migrations[$name] = true;
+
+ return false;
+ }
+
+ /**
+ * Checks whether all available, fulfillable migrations have been applied.
+ *
+ * @return bool Whether the migrations have been applied
+ */
+ public function finished()
+ {
+ foreach ($this->migrations as $name)
+ {
+ if (!isset($this->migration_state[$name]))
+ {
+ // skip unfulfillable migrations, but fulfillables mean we
+ // are not finished yet
+ if ($this->unfulfillable($name) !== false)
+ {
+ continue;
+ }
+
+ return false;
+ }
+
+ $migration = $this->migration_state[$name];
+
+ if (!$migration['migration_schema_done'] || !$migration['migration_data_done'])
+ {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ /**
+ * Gets a migration state (whether it is installed and to what extent)
+ *
+ * @param string $migration String migration name to check if it is installed
+ * @return bool|array False if the migration has not at all been installed, array
+ */
+ public function migration_state($migration)
+ {
+ if (!isset($this->migration_state[$migration]))
+ {
+ return false;
+ }
+
+ return $this->migration_state[$migration];
+ }
+
+ /**
+ * Helper to get a migration
+ *
+ * @param string $name Name of the migration
+ * @return \phpbb\db\migration\migration
+ */
+ protected function get_migration($name)
+ {
+ $migration = new $name($this->config, $this->db, $this->db_tools, $this->phpbb_root_path, $this->php_ext, $this->table_prefix);
+
+ if ($migration instanceof ContainerAwareInterface)
+ {
+ $migration->setContainer($this->container);
+ }
+
+ return $migration;
+ }
+
+ /**
+ * This function adds all migrations sent to it to the migrations table
+ *
+ * THIS SHOULD NOT GENERALLY BE USED! THIS IS FOR THE PHPBB INSTALLER.
+ * THIS WILL THROW ERRORS IF MIGRATIONS ALREADY EXIST IN THE TABLE, DO NOT CALL MORE THAN ONCE!
+ *
+ * @param array $migrations Array of migrations (names) to add to the migrations table
+ * @return null
+ */
+ public function populate_migrations($migrations)
+ {
+ foreach ($migrations as $name)
+ {
+ if ($this->migration_state($name) === false)
+ {
+ $state = array(
+ 'migration_depends_on' => $name::depends_on(),
+ 'migration_schema_done' => true,
+ 'migration_data_done' => true,
+ 'migration_data_state' => '',
+ 'migration_start_time' => time(),
+ 'migration_end_time' => time(),
+ );
+ $this->set_migration_state($name, $state);
+ }
+ }
+ }
+
+ /**
+ * Creates the migrations table if it does not exist.
+ * @return null
+ */
+ public function create_migrations_table()
+ {
+ // Make sure migrations have been installed.
+ if (!$this->db_tools->sql_table_exists($this->table_prefix . 'migrations'))
+ {
+ $this->db_tools->sql_create_table($this->table_prefix . 'migrations', array(
+ 'COLUMNS' => array(
+ 'migration_name' => array('VCHAR', ''),
+ 'migration_depends_on' => array('TEXT', ''),
+ 'migration_schema_done' => array('BOOL', 0),
+ 'migration_data_done' => array('BOOL', 0),
+ 'migration_data_state' => array('TEXT', ''),
+ 'migration_start_time' => array('TIMESTAMP', 0),
+ 'migration_end_time' => array('TIMESTAMP', 0),
+ ),
+ 'PRIMARY_KEY' => 'migration_name',
+ ));
+ }
+ }
+}
diff --git a/phpBB/phpbb/db/migrator_output_handler_interface.php b/phpBB/phpbb/db/migrator_output_handler_interface.php
new file mode 100644
index 0000000000..9947b51dcc
--- /dev/null
+++ b/phpBB/phpbb/db/migrator_output_handler_interface.php
@@ -0,0 +1,31 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db;
+
+interface migrator_output_handler_interface
+{
+ const VERBOSITY_QUIET = 16;
+ const VERBOSITY_NORMAL = 32;
+ const VERBOSITY_VERBOSE = 64;
+ const VERBOSITY_VERY_VERBOSE = 128;
+ const VERBOSITY_DEBUG = 256;
+
+ /**
+ * Write output using the configured closure.
+ *
+ * @param string|array $message The message to write or an array containing the language key and all of its parameters.
+ * @param int $verbosity The verbosity of the message.
+ */
+ public function write($message, $verbosity);
+}
diff --git a/phpBB/phpbb/db/null_migrator_output_handler.php b/phpBB/phpbb/db/null_migrator_output_handler.php
new file mode 100644
index 0000000000..0e8cfbb049
--- /dev/null
+++ b/phpBB/phpbb/db/null_migrator_output_handler.php
@@ -0,0 +1,24 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db;
+
+class null_migrator_output_handler implements migrator_output_handler_interface
+{
+ /**
+ * {@inheritdoc}
+ */
+ public function write($message, $verbosity)
+ {
+ }
+}
diff --git a/phpBB/phpbb/db/sql_insert_buffer.php b/phpBB/phpbb/db/sql_insert_buffer.php
new file mode 100644
index 0000000000..18e4814a77
--- /dev/null
+++ b/phpBB/phpbb/db/sql_insert_buffer.php
@@ -0,0 +1,146 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db;
+
+/**
+* Collects rows for insert into a database until the buffer size is reached.
+* Then flushes the buffer to the database and starts over again.
+*
+* Benefits over collecting a (possibly huge) insert array and then using
+* $db->sql_multi_insert() include:
+*
+* - Going over max packet size of the database connection is usually prevented
+* because the data is submitted in batches.
+*
+* - Reaching database connection timeout is usually prevented because
+* submission of batches talks to the database every now and then.
+*
+* - Usage of less PHP memory because data no longer needed is discarded on
+* buffer flush.
+*
+* Attention:
+* Please note that users of this class have to call flush() to flush the
+* remaining rows to the database after their batch insert operation is
+* finished.
+*
+* Usage:
+* <code>
+* $buffer = new \phpbb\db\sql_insert_buffer($db, 'test_table', 1234);
+*
+* while (do_stuff())
+* {
+* $buffer->insert(array(
+* 'column1' => 'value1',
+* 'column2' => 'value2',
+* ));
+* }
+*
+* $buffer->flush();
+* </code>
+*/
+class sql_insert_buffer
+{
+ /** @var \phpbb\db\driver\driver_interface */
+ protected $db;
+
+ /** @var string */
+ protected $table_name;
+
+ /** @var int */
+ protected $max_buffered_rows;
+
+ /** @var array */
+ protected $buffer = array();
+
+ /**
+ * @param \phpbb\db\driver\driver_interface $db
+ * @param string $table_name
+ * @param int $max_buffered_rows
+ */
+ public function __construct(\phpbb\db\driver\driver_interface $db, $table_name, $max_buffered_rows = 500)
+ {
+ $this->db = $db;
+ $this->table_name = $table_name;
+ $this->max_buffered_rows = $max_buffered_rows;
+ }
+
+ /**
+ * Inserts a single row into the buffer if multi insert is supported by the
+ * database (otherwise an insert query is sent immediately). Then flushes
+ * the buffer if the number of rows in the buffer is now greater than or
+ * equal to $max_buffered_rows.
+ *
+ * @param array $row
+ *
+ * @return bool True when some data was flushed to the database.
+ * False otherwise.
+ */
+ public function insert(array $row)
+ {
+ $this->buffer[] = $row;
+
+ // Flush buffer if it is full or when DB does not support multi inserts.
+ // In the later case, the buffer will always only contain one row.
+ if (!$this->db->get_multi_insert() || sizeof($this->buffer) >= $this->max_buffered_rows)
+ {
+ return $this->flush();
+ }
+
+ return false;
+ }
+
+ /**
+ * Inserts a row set, i.e. an array of rows, by calling insert().
+ *
+ * Please note that it is in most cases better to use insert() instead of
+ * first building a huge rowset. Or at least sizeof($rows) should be kept
+ * small.
+ *
+ * @param array $rows
+ *
+ * @return bool True when some data was flushed to the database.
+ * False otherwise.
+ */
+ public function insert_all(array $rows)
+ {
+ // Using bitwise |= because PHP does not have logical ||=
+ $result = 0;
+
+ foreach ($rows as $row)
+ {
+ $result |= (int) $this->insert($row);
+ }
+
+ return (bool) $result;
+ }
+
+ /**
+ * Flushes the buffer content to the DB and clears the buffer.
+ *
+ * @return bool True when some data was flushed to the database.
+ * False otherwise.
+ */
+ public function flush()
+ {
+ if (!empty($this->buffer))
+ {
+ $this->db->sql_multi_insert($this->table_name, $this->buffer);
+ $this->buffer = array();
+
+ return true;
+ }
+
+ return false;
+ }
+}
diff --git a/phpBB/phpbb/db/tools.php b/phpBB/phpbb/db/tools.php
new file mode 100644
index 0000000000..832a0c510c
--- /dev/null
+++ b/phpBB/phpbb/db/tools.php
@@ -0,0 +1,2840 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db;
+
+/**
+* Database Tools for handling cross-db actions such as altering columns, etc.
+* Currently not supported is returning SQL for creating tables.
+*/
+class tools
+{
+ /**
+ * Current sql layer
+ */
+ var $sql_layer = '';
+
+ /**
+ * @var object DB object
+ */
+ var $db = null;
+
+ /**
+ * The Column types for every database we support
+ * @var array
+ */
+ var $dbms_type_map = array();
+
+ /**
+ * Is the used MS SQL Server a SQL Server 2000?
+ * @var bool
+ */
+ protected $is_sql_server_2000;
+
+ /**
+ * Get the column types for every database we support
+ *
+ * @return array
+ */
+ public static function get_dbms_type_map()
+ {
+ return array(
+ 'mysql_41' => array(
+ 'INT:' => 'int(%d)',
+ 'BINT' => 'bigint(20)',
+ 'UINT' => 'mediumint(8) UNSIGNED',
+ 'UINT:' => 'int(%d) UNSIGNED',
+ 'TINT:' => 'tinyint(%d)',
+ 'USINT' => 'smallint(4) UNSIGNED',
+ 'BOOL' => 'tinyint(1) UNSIGNED',
+ 'VCHAR' => 'varchar(255)',
+ 'VCHAR:' => 'varchar(%d)',
+ 'CHAR:' => 'char(%d)',
+ 'XSTEXT' => 'text',
+ 'XSTEXT_UNI'=> 'varchar(100)',
+ 'STEXT' => 'text',
+ 'STEXT_UNI' => 'varchar(255)',
+ 'TEXT' => 'text',
+ 'TEXT_UNI' => 'text',
+ 'MTEXT' => 'mediumtext',
+ 'MTEXT_UNI' => 'mediumtext',
+ 'TIMESTAMP' => 'int(11) UNSIGNED',
+ 'DECIMAL' => 'decimal(5,2)',
+ 'DECIMAL:' => 'decimal(%d,2)',
+ 'PDECIMAL' => 'decimal(6,3)',
+ 'PDECIMAL:' => 'decimal(%d,3)',
+ 'VCHAR_UNI' => 'varchar(255)',
+ 'VCHAR_UNI:'=> 'varchar(%d)',
+ 'VCHAR_CI' => 'varchar(255)',
+ 'VARBINARY' => 'varbinary(255)',
+ ),
+
+ 'mysql_40' => array(
+ 'INT:' => 'int(%d)',
+ 'BINT' => 'bigint(20)',
+ 'UINT' => 'mediumint(8) UNSIGNED',
+ 'UINT:' => 'int(%d) UNSIGNED',
+ 'TINT:' => 'tinyint(%d)',
+ 'USINT' => 'smallint(4) UNSIGNED',
+ 'BOOL' => 'tinyint(1) UNSIGNED',
+ 'VCHAR' => 'varbinary(255)',
+ 'VCHAR:' => 'varbinary(%d)',
+ 'CHAR:' => 'binary(%d)',
+ 'XSTEXT' => 'blob',
+ 'XSTEXT_UNI'=> 'blob',
+ 'STEXT' => 'blob',
+ 'STEXT_UNI' => 'blob',
+ 'TEXT' => 'blob',
+ 'TEXT_UNI' => 'blob',
+ 'MTEXT' => 'mediumblob',
+ 'MTEXT_UNI' => 'mediumblob',
+ 'TIMESTAMP' => 'int(11) UNSIGNED',
+ 'DECIMAL' => 'decimal(5,2)',
+ 'DECIMAL:' => 'decimal(%d,2)',
+ 'PDECIMAL' => 'decimal(6,3)',
+ 'PDECIMAL:' => 'decimal(%d,3)',
+ 'VCHAR_UNI' => 'blob',
+ 'VCHAR_UNI:'=> array('varbinary(%d)', 'limit' => array('mult', 3, 255, 'blob')),
+ 'VCHAR_CI' => 'blob',
+ 'VARBINARY' => 'varbinary(255)',
+ ),
+
+ 'mssql' => array(
+ 'INT:' => '[int]',
+ 'BINT' => '[float]',
+ 'UINT' => '[int]',
+ 'UINT:' => '[int]',
+ 'TINT:' => '[int]',
+ 'USINT' => '[int]',
+ 'BOOL' => '[int]',
+ 'VCHAR' => '[varchar] (255)',
+ 'VCHAR:' => '[varchar] (%d)',
+ 'CHAR:' => '[char] (%d)',
+ 'XSTEXT' => '[varchar] (1000)',
+ 'STEXT' => '[varchar] (3000)',
+ 'TEXT' => '[varchar] (8000)',
+ 'MTEXT' => '[text]',
+ 'XSTEXT_UNI'=> '[varchar] (100)',
+ 'STEXT_UNI' => '[varchar] (255)',
+ 'TEXT_UNI' => '[varchar] (4000)',
+ 'MTEXT_UNI' => '[text]',
+ 'TIMESTAMP' => '[int]',
+ 'DECIMAL' => '[float]',
+ 'DECIMAL:' => '[float]',
+ 'PDECIMAL' => '[float]',
+ 'PDECIMAL:' => '[float]',
+ 'VCHAR_UNI' => '[varchar] (255)',
+ 'VCHAR_UNI:'=> '[varchar] (%d)',
+ 'VCHAR_CI' => '[varchar] (255)',
+ 'VARBINARY' => '[varchar] (255)',
+ ),
+
+ 'mssqlnative' => array(
+ 'INT:' => '[int]',
+ 'BINT' => '[float]',
+ 'UINT' => '[int]',
+ 'UINT:' => '[int]',
+ 'TINT:' => '[int]',
+ 'USINT' => '[int]',
+ 'BOOL' => '[int]',
+ 'VCHAR' => '[varchar] (255)',
+ 'VCHAR:' => '[varchar] (%d)',
+ 'CHAR:' => '[char] (%d)',
+ 'XSTEXT' => '[varchar] (1000)',
+ 'STEXT' => '[varchar] (3000)',
+ 'TEXT' => '[varchar] (8000)',
+ 'MTEXT' => '[text]',
+ 'XSTEXT_UNI'=> '[varchar] (100)',
+ 'STEXT_UNI' => '[varchar] (255)',
+ 'TEXT_UNI' => '[varchar] (4000)',
+ 'MTEXT_UNI' => '[text]',
+ 'TIMESTAMP' => '[int]',
+ 'DECIMAL' => '[float]',
+ 'DECIMAL:' => '[float]',
+ 'PDECIMAL' => '[float]',
+ 'PDECIMAL:' => '[float]',
+ 'VCHAR_UNI' => '[varchar] (255)',
+ 'VCHAR_UNI:'=> '[varchar] (%d)',
+ 'VCHAR_CI' => '[varchar] (255)',
+ 'VARBINARY' => '[varchar] (255)',
+ ),
+
+ 'oracle' => array(
+ 'INT:' => 'number(%d)',
+ 'BINT' => 'number(20)',
+ 'UINT' => 'number(8)',
+ 'UINT:' => 'number(%d)',
+ 'TINT:' => 'number(%d)',
+ 'USINT' => 'number(4)',
+ 'BOOL' => 'number(1)',
+ 'VCHAR' => 'varchar2(255)',
+ 'VCHAR:' => 'varchar2(%d)',
+ 'CHAR:' => 'char(%d)',
+ 'XSTEXT' => 'varchar2(1000)',
+ 'STEXT' => 'varchar2(3000)',
+ 'TEXT' => 'clob',
+ 'MTEXT' => 'clob',
+ 'XSTEXT_UNI'=> 'varchar2(300)',
+ 'STEXT_UNI' => 'varchar2(765)',
+ 'TEXT_UNI' => 'clob',
+ 'MTEXT_UNI' => 'clob',
+ 'TIMESTAMP' => 'number(11)',
+ 'DECIMAL' => 'number(5, 2)',
+ 'DECIMAL:' => 'number(%d, 2)',
+ 'PDECIMAL' => 'number(6, 3)',
+ 'PDECIMAL:' => 'number(%d, 3)',
+ 'VCHAR_UNI' => 'varchar2(765)',
+ 'VCHAR_UNI:'=> array('varchar2(%d)', 'limit' => array('mult', 3, 765, 'clob')),
+ 'VCHAR_CI' => 'varchar2(255)',
+ 'VARBINARY' => 'raw(255)',
+ ),
+
+ 'sqlite' => array(
+ 'INT:' => 'int(%d)',
+ 'BINT' => 'bigint(20)',
+ 'UINT' => 'INTEGER UNSIGNED', //'mediumint(8) UNSIGNED',
+ 'UINT:' => 'INTEGER UNSIGNED', // 'int(%d) UNSIGNED',
+ 'TINT:' => 'tinyint(%d)',
+ 'USINT' => 'INTEGER UNSIGNED', //'mediumint(4) UNSIGNED',
+ 'BOOL' => 'INTEGER UNSIGNED', //'tinyint(1) UNSIGNED',
+ 'VCHAR' => 'varchar(255)',
+ 'VCHAR:' => 'varchar(%d)',
+ 'CHAR:' => 'char(%d)',
+ 'XSTEXT' => 'text(65535)',
+ 'STEXT' => 'text(65535)',
+ 'TEXT' => 'text(65535)',
+ 'MTEXT' => 'mediumtext(16777215)',
+ 'XSTEXT_UNI'=> 'text(65535)',
+ 'STEXT_UNI' => 'text(65535)',
+ 'TEXT_UNI' => 'text(65535)',
+ 'MTEXT_UNI' => 'mediumtext(16777215)',
+ 'TIMESTAMP' => 'INTEGER UNSIGNED', //'int(11) UNSIGNED',
+ 'DECIMAL' => 'decimal(5,2)',
+ 'DECIMAL:' => 'decimal(%d,2)',
+ 'PDECIMAL' => 'decimal(6,3)',
+ 'PDECIMAL:' => 'decimal(%d,3)',
+ 'VCHAR_UNI' => 'varchar(255)',
+ 'VCHAR_UNI:'=> 'varchar(%d)',
+ 'VCHAR_CI' => 'varchar(255)',
+ 'VARBINARY' => 'blob',
+ ),
+
+ 'sqlite3' => array(
+ 'INT:' => 'INT(%d)',
+ 'BINT' => 'BIGINT(20)',
+ 'UINT' => 'INTEGER UNSIGNED',
+ 'UINT:' => 'INTEGER UNSIGNED',
+ 'TINT:' => 'TINYINT(%d)',
+ 'USINT' => 'INTEGER UNSIGNED',
+ 'BOOL' => 'INTEGER UNSIGNED',
+ 'VCHAR' => 'VARCHAR(255)',
+ 'VCHAR:' => 'VARCHAR(%d)',
+ 'CHAR:' => 'CHAR(%d)',
+ 'XSTEXT' => 'TEXT(65535)',
+ 'STEXT' => 'TEXT(65535)',
+ 'TEXT' => 'TEXT(65535)',
+ 'MTEXT' => 'MEDIUMTEXT(16777215)',
+ 'XSTEXT_UNI'=> 'TEXT(65535)',
+ 'STEXT_UNI' => 'TEXT(65535)',
+ 'TEXT_UNI' => 'TEXT(65535)',
+ 'MTEXT_UNI' => 'MEDIUMTEXT(16777215)',
+ 'TIMESTAMP' => 'INTEGER UNSIGNED', //'int(11) UNSIGNED',
+ 'DECIMAL' => 'DECIMAL(5,2)',
+ 'DECIMAL:' => 'DECIMAL(%d,2)',
+ 'PDECIMAL' => 'DECIMAL(6,3)',
+ 'PDECIMAL:' => 'DECIMAL(%d,3)',
+ 'VCHAR_UNI' => 'VARCHAR(255)',
+ 'VCHAR_UNI:'=> 'VARCHAR(%d)',
+ 'VCHAR_CI' => 'VARCHAR(255)',
+ 'VARBINARY' => 'BLOB',
+ ),
+
+ 'postgres' => array(
+ 'INT:' => 'INT4',
+ 'BINT' => 'INT8',
+ 'UINT' => 'INT4', // unsigned
+ 'UINT:' => 'INT4', // unsigned
+ 'USINT' => 'INT2', // unsigned
+ 'BOOL' => 'INT2', // unsigned
+ 'TINT:' => 'INT2',
+ 'VCHAR' => 'varchar(255)',
+ 'VCHAR:' => 'varchar(%d)',
+ 'CHAR:' => 'char(%d)',
+ 'XSTEXT' => 'varchar(1000)',
+ 'STEXT' => 'varchar(3000)',
+ 'TEXT' => 'varchar(8000)',
+ 'MTEXT' => 'TEXT',
+ 'XSTEXT_UNI'=> 'varchar(100)',
+ 'STEXT_UNI' => 'varchar(255)',
+ 'TEXT_UNI' => 'varchar(4000)',
+ 'MTEXT_UNI' => 'TEXT',
+ 'TIMESTAMP' => 'INT4', // unsigned
+ 'DECIMAL' => 'decimal(5,2)',
+ 'DECIMAL:' => 'decimal(%d,2)',
+ 'PDECIMAL' => 'decimal(6,3)',
+ 'PDECIMAL:' => 'decimal(%d,3)',
+ 'VCHAR_UNI' => 'varchar(255)',
+ 'VCHAR_UNI:'=> 'varchar(%d)',
+ 'VCHAR_CI' => 'varchar_ci',
+ 'VARBINARY' => 'bytea',
+ ),
+ );
+ }
+
+ /**
+ * A list of types being unsigned for better reference in some db's
+ * @var array
+ */
+ var $unsigned_types = array('UINT', 'UINT:', 'USINT', 'BOOL', 'TIMESTAMP');
+
+ /**
+ * A list of supported DBMS. We change this class to support more DBMS, the DBMS itself only need to follow some rules.
+ * @var array
+ */
+ var $supported_dbms = array('mssql', 'mssqlnative', 'mysql_40', 'mysql_41', 'oracle', 'postgres', 'sqlite', 'sqlite3');
+
+ /**
+ * This is set to true if user only wants to return the 'to-be-executed' SQL statement(s) (as an array).
+ * This mode has no effect on some methods (inserting of data for example). This is expressed within the methods command.
+ */
+ var $return_statements = false;
+
+ /**
+ * Constructor. Set DB Object and set {@link $return_statements return_statements}.
+ *
+ * @param \phpbb\db\driver\driver_interface $db Database connection
+ * @param bool $return_statements True if only statements should be returned and no SQL being executed
+ */
+ public function __construct(\phpbb\db\driver\driver_interface $db, $return_statements = false)
+ {
+ $this->db = $db;
+ $this->return_statements = $return_statements;
+
+ $this->dbms_type_map = self::get_dbms_type_map();
+
+ // Determine mapping database type
+ switch ($this->db->get_sql_layer())
+ {
+ case 'mysql':
+ $this->sql_layer = 'mysql_40';
+ break;
+
+ case 'mysql4':
+ if (version_compare($this->db->sql_server_info(true), '4.1.3', '>='))
+ {
+ $this->sql_layer = 'mysql_41';
+ }
+ else
+ {
+ $this->sql_layer = 'mysql_40';
+ }
+ break;
+
+ case 'mysqli':
+ $this->sql_layer = 'mysql_41';
+ break;
+
+ case 'mssql':
+ case 'mssql_odbc':
+ $this->sql_layer = 'mssql';
+ break;
+
+ case 'mssqlnative':
+ $this->sql_layer = 'mssqlnative';
+ break;
+
+ default:
+ $this->sql_layer = $this->db->get_sql_layer();
+ break;
+ }
+ }
+
+ /**
+ * Setter for {@link $return_statements return_statements}.
+ *
+ * @param bool $return_statements True if SQL should not be executed but returned as strings
+ * @return null
+ */
+ public function set_return_statements($return_statements)
+ {
+ $this->return_statements = $return_statements;
+ }
+
+ /**
+ * Gets a list of tables in the database.
+ *
+ * @return array Array of table names (all lower case)
+ */
+ function sql_list_tables()
+ {
+ switch ($this->db->get_sql_layer())
+ {
+ case 'mysql':
+ case 'mysql4':
+ case 'mysqli':
+ $sql = 'SHOW TABLES';
+ break;
+
+ case 'sqlite':
+ $sql = 'SELECT name
+ FROM sqlite_master
+ WHERE type = "table"';
+ break;
+
+ case 'sqlite3':
+ $sql = 'SELECT name
+ FROM sqlite_master
+ WHERE type = "table"
+ AND name <> "sqlite_sequence"';
+ break;
+
+ case 'mssql':
+ case 'mssql_odbc':
+ case 'mssqlnative':
+ $sql = "SELECT name
+ FROM sysobjects
+ WHERE type='U'";
+ break;
+
+ case 'postgres':
+ $sql = 'SELECT relname
+ FROM pg_stat_user_tables';
+ break;
+
+ case 'oracle':
+ $sql = 'SELECT table_name
+ FROM USER_TABLES';
+ break;
+ }
+
+ $result = $this->db->sql_query($sql);
+
+ $tables = array();
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $name = current($row);
+ $tables[$name] = $name;
+ }
+ $this->db->sql_freeresult($result);
+
+ return $tables;
+ }
+
+ /**
+ * Check if table exists
+ *
+ *
+ * @param string $table_name The table name to check for
+ * @return bool true if table exists, else false
+ */
+ function sql_table_exists($table_name)
+ {
+ $this->db->sql_return_on_error(true);
+ $result = $this->db->sql_query_limit('SELECT * FROM ' . $table_name, 1);
+ $this->db->sql_return_on_error(false);
+
+ if ($result)
+ {
+ $this->db->sql_freeresult($result);
+ return true;
+ }
+
+ return false;
+ }
+
+ /**
+ * Create SQL Table
+ *
+ * @param string $table_name The table name to create
+ * @param array $table_data Array containing table data.
+ * @return array Statements if $return_statements is true.
+ */
+ function sql_create_table($table_name, $table_data)
+ {
+ // holds the DDL for a column
+ $columns = $statements = array();
+
+ if ($this->sql_table_exists($table_name))
+ {
+ return $this->_sql_run_sql($statements);
+ }
+
+ // Begin transaction
+ $statements[] = 'begin';
+
+ // Determine if we have created a PRIMARY KEY in the earliest
+ $primary_key_gen = false;
+
+ // Determine if the table requires a sequence
+ $create_sequence = false;
+
+ // Begin table sql statement
+ switch ($this->sql_layer)
+ {
+ case 'mssql':
+ case 'mssqlnative':
+ $table_sql = 'CREATE TABLE [' . $table_name . '] (' . "\n";
+ break;
+
+ default:
+ $table_sql = 'CREATE TABLE ' . $table_name . ' (' . "\n";
+ break;
+ }
+
+ if ($this->sql_layer == 'mssql' || $this->sql_layer == 'mssqlnative')
+ {
+ if (!isset($table_data['PRIMARY_KEY']))
+ {
+ $table_data['COLUMNS']['mssqlindex'] = array('UINT', null, 'auto_increment');
+ $table_data['PRIMARY_KEY'] = 'mssqlindex';
+ }
+ }
+
+ // Iterate through the columns to create a table
+ foreach ($table_data['COLUMNS'] as $column_name => $column_data)
+ {
+ // here lies an array, filled with information compiled on the column's data
+ $prepared_column = $this->sql_prepare_column_data($table_name, $column_name, $column_data);
+
+ if (isset($prepared_column['auto_increment']) && $prepared_column['auto_increment'] && strlen($column_name) > 26) // "${column_name}_gen"
+ {
+ trigger_error("Index name '${column_name}_gen' on table '$table_name' is too long. The maximum auto increment column length is 26 characters.", E_USER_ERROR);
+ }
+
+ // here we add the definition of the new column to the list of columns
+ switch ($this->sql_layer)
+ {
+ case 'mssql':
+ case 'mssqlnative':
+ $columns[] = "\t [{$column_name}] " . $prepared_column['column_type_sql_default'];
+ break;
+
+ default:
+ $columns[] = "\t {$column_name} " . $prepared_column['column_type_sql'];
+ break;
+ }
+
+ // see if we have found a primary key set due to a column definition if we have found it, we can stop looking
+ if (!$primary_key_gen)
+ {
+ $primary_key_gen = isset($prepared_column['primary_key_set']) && $prepared_column['primary_key_set'];
+ }
+
+ // create sequence DDL based off of the existance of auto incrementing columns
+ if (!$create_sequence && isset($prepared_column['auto_increment']) && $prepared_column['auto_increment'])
+ {
+ $create_sequence = $column_name;
+ }
+ }
+
+ // this makes up all the columns in the create table statement
+ $table_sql .= implode(",\n", $columns);
+
+ // Close the table for two DBMS and add to the statements
+ switch ($this->sql_layer)
+ {
+ case 'mssql':
+ case 'mssqlnative':
+ $table_sql .= "\n);";
+ $statements[] = $table_sql;
+ break;
+ }
+
+ // we have yet to create a primary key for this table,
+ // this means that we can add the one we really wanted instead
+ if (!$primary_key_gen)
+ {
+ // Write primary key
+ if (isset($table_data['PRIMARY_KEY']))
+ {
+ if (!is_array($table_data['PRIMARY_KEY']))
+ {
+ $table_data['PRIMARY_KEY'] = array($table_data['PRIMARY_KEY']);
+ }
+
+ switch ($this->sql_layer)
+ {
+ case 'mysql_40':
+ case 'mysql_41':
+ case 'postgres':
+ case 'sqlite':
+ case 'sqlite3':
+ $table_sql .= ",\n\t PRIMARY KEY (" . implode(', ', $table_data['PRIMARY_KEY']) . ')';
+ break;
+
+ case 'mssql':
+ case 'mssqlnative':
+ // We need the data here
+ $old_return_statements = $this->return_statements;
+ $this->return_statements = true;
+
+ $primary_key_stmts = $this->sql_create_primary_key($table_name, $table_data['PRIMARY_KEY']);
+ foreach ($primary_key_stmts as $pk_stmt)
+ {
+ $statements[] = $pk_stmt;
+ }
+
+ $this->return_statements = $old_return_statements;
+ break;
+
+ case 'oracle':
+ $table_sql .= ",\n\t CONSTRAINT pk_{$table_name} PRIMARY KEY (" . implode(', ', $table_data['PRIMARY_KEY']) . ')';
+ break;
+ }
+ }
+ }
+
+ // close the table
+ switch ($this->sql_layer)
+ {
+ case 'mysql_41':
+ // make sure the table is in UTF-8 mode
+ $table_sql .= "\n) CHARACTER SET `utf8` COLLATE `utf8_bin`;";
+ $statements[] = $table_sql;
+ break;
+
+ case 'mysql_40':
+ case 'sqlite':
+ case 'sqlite3':
+ $table_sql .= "\n);";
+ $statements[] = $table_sql;
+ break;
+
+ case 'postgres':
+ // do we need to add a sequence for auto incrementing columns?
+ if ($create_sequence)
+ {
+ $statements[] = "CREATE SEQUENCE {$table_name}_seq;";
+ }
+
+ $table_sql .= "\n);";
+ $statements[] = $table_sql;
+ break;
+
+ case 'oracle':
+ $table_sql .= "\n)";
+ $statements[] = $table_sql;
+
+ // do we need to add a sequence and a tigger for auto incrementing columns?
+ if ($create_sequence)
+ {
+ // create the actual sequence
+ $statements[] = "CREATE SEQUENCE {$table_name}_seq";
+
+ // the trigger is the mechanism by which we increment the counter
+ $trigger = "CREATE OR REPLACE TRIGGER t_{$table_name}\n";
+ $trigger .= "BEFORE INSERT ON {$table_name}\n";
+ $trigger .= "FOR EACH ROW WHEN (\n";
+ $trigger .= "\tnew.{$create_sequence} IS NULL OR new.{$create_sequence} = 0\n";
+ $trigger .= ")\n";
+ $trigger .= "BEGIN\n";
+ $trigger .= "\tSELECT {$table_name}_seq.nextval\n";
+ $trigger .= "\tINTO :new.{$create_sequence}\n";
+ $trigger .= "\tFROM dual;\n";
+ $trigger .= "END;";
+
+ $statements[] = $trigger;
+ }
+ break;
+ }
+
+ // Write Keys
+ if (isset($table_data['KEYS']))
+ {
+ foreach ($table_data['KEYS'] as $key_name => $key_data)
+ {
+ if (!is_array($key_data[1]))
+ {
+ $key_data[1] = array($key_data[1]);
+ }
+
+ $old_return_statements = $this->return_statements;
+ $this->return_statements = true;
+
+ $key_stmts = ($key_data[0] == 'UNIQUE') ? $this->sql_create_unique_index($table_name, $key_name, $key_data[1]) : $this->sql_create_index($table_name, $key_name, $key_data[1]);
+
+ foreach ($key_stmts as $key_stmt)
+ {
+ $statements[] = $key_stmt;
+ }
+
+ $this->return_statements = $old_return_statements;
+ }
+ }
+
+ // Commit Transaction
+ $statements[] = 'commit';
+
+ return $this->_sql_run_sql($statements);
+ }
+
+ /**
+ * Handle passed database update array.
+ * Expected structure...
+ * Key being one of the following
+ * drop_tables: Drop tables
+ * add_tables: Add tables
+ * change_columns: Column changes (only type, not name)
+ * add_columns: Add columns to a table
+ * drop_keys: Dropping keys
+ * drop_columns: Removing/Dropping columns
+ * add_primary_keys: adding primary keys
+ * add_unique_index: adding an unique index
+ * add_index: adding an index (can be column:index_size if you need to provide size)
+ *
+ * The values are in this format:
+ * {TABLE NAME} => array(
+ * {COLUMN NAME} => array({COLUMN TYPE}, {DEFAULT VALUE}, {OPTIONAL VARIABLES}),
+ * {KEY/INDEX NAME} => array({COLUMN NAMES}),
+ * )
+ *
+ * For more information have a look at /develop/create_schema_files.php (only available through SVN)
+ */
+ function perform_schema_changes($schema_changes)
+ {
+ if (empty($schema_changes))
+ {
+ return;
+ }
+
+ $statements = array();
+ $sqlite = false;
+
+ // For SQLite we need to perform the schema changes in a much more different way
+ if (($this->db->get_sql_layer() == 'sqlite' || $this->db->get_sql_layer() == 'sqlite3') && $this->return_statements)
+ {
+ $sqlite_data = array();
+ $sqlite = true;
+ }
+
+ // Drop tables?
+ if (!empty($schema_changes['drop_tables']))
+ {
+ foreach ($schema_changes['drop_tables'] as $table)
+ {
+ // only drop table if it exists
+ if ($this->sql_table_exists($table))
+ {
+ $result = $this->sql_table_drop($table);
+ if ($this->return_statements)
+ {
+ $statements = array_merge($statements, $result);
+ }
+ }
+ }
+ }
+
+ // Add tables?
+ if (!empty($schema_changes['add_tables']))
+ {
+ foreach ($schema_changes['add_tables'] as $table => $table_data)
+ {
+ $result = $this->sql_create_table($table, $table_data);
+ if ($this->return_statements)
+ {
+ $statements = array_merge($statements, $result);
+ }
+ }
+ }
+
+ // Change columns?
+ if (!empty($schema_changes['change_columns']))
+ {
+ foreach ($schema_changes['change_columns'] as $table => $columns)
+ {
+ foreach ($columns as $column_name => $column_data)
+ {
+ // If the column exists we change it, else we add it ;)
+ if ($column_exists = $this->sql_column_exists($table, $column_name))
+ {
+ $result = $this->sql_column_change($table, $column_name, $column_data, true);
+ }
+ else
+ {
+ $result = $this->sql_column_add($table, $column_name, $column_data, true);
+ }
+
+ if ($sqlite)
+ {
+ if ($column_exists)
+ {
+ $sqlite_data[$table]['change_columns'][] = $result;
+ }
+ else
+ {
+ $sqlite_data[$table]['add_columns'][] = $result;
+ }
+ }
+ else if ($this->return_statements)
+ {
+ $statements = array_merge($statements, $result);
+ }
+ }
+ }
+ }
+
+ // Add columns?
+ if (!empty($schema_changes['add_columns']))
+ {
+ foreach ($schema_changes['add_columns'] as $table => $columns)
+ {
+ foreach ($columns as $column_name => $column_data)
+ {
+ // Only add the column if it does not exist yet
+ if ($column_exists = $this->sql_column_exists($table, $column_name))
+ {
+ continue;
+ // This is commented out here because it can take tremendous time on updates
+// $result = $this->sql_column_change($table, $column_name, $column_data, true);
+ }
+ else
+ {
+ $result = $this->sql_column_add($table, $column_name, $column_data, true);
+ }
+
+ if ($sqlite)
+ {
+ if ($column_exists)
+ {
+ continue;
+// $sqlite_data[$table]['change_columns'][] = $result;
+ }
+ else
+ {
+ $sqlite_data[$table]['add_columns'][] = $result;
+ }
+ }
+ else if ($this->return_statements)
+ {
+ $statements = array_merge($statements, $result);
+ }
+ }
+ }
+ }
+
+ // Remove keys?
+ if (!empty($schema_changes['drop_keys']))
+ {
+ foreach ($schema_changes['drop_keys'] as $table => $indexes)
+ {
+ foreach ($indexes as $index_name)
+ {
+ if (!$this->sql_index_exists($table, $index_name))
+ {
+ continue;
+ }
+
+ $result = $this->sql_index_drop($table, $index_name);
+
+ if ($this->return_statements)
+ {
+ $statements = array_merge($statements, $result);
+ }
+ }
+ }
+ }
+
+ // Drop columns?
+ if (!empty($schema_changes['drop_columns']))
+ {
+ foreach ($schema_changes['drop_columns'] as $table => $columns)
+ {
+ foreach ($columns as $column)
+ {
+ // Only remove the column if it exists...
+ if ($this->sql_column_exists($table, $column))
+ {
+ $result = $this->sql_column_remove($table, $column, true);
+
+ if ($sqlite)
+ {
+ $sqlite_data[$table]['drop_columns'][] = $result;
+ }
+ else if ($this->return_statements)
+ {
+ $statements = array_merge($statements, $result);
+ }
+ }
+ }
+ }
+ }
+
+ // Add primary keys?
+ if (!empty($schema_changes['add_primary_keys']))
+ {
+ foreach ($schema_changes['add_primary_keys'] as $table => $columns)
+ {
+ $result = $this->sql_create_primary_key($table, $columns, true);
+
+ if ($sqlite)
+ {
+ $sqlite_data[$table]['primary_key'] = $result;
+ }
+ else if ($this->return_statements)
+ {
+ $statements = array_merge($statements, $result);
+ }
+ }
+ }
+
+ // Add unique indexes?
+ if (!empty($schema_changes['add_unique_index']))
+ {
+ foreach ($schema_changes['add_unique_index'] as $table => $index_array)
+ {
+ foreach ($index_array as $index_name => $column)
+ {
+ if ($this->sql_unique_index_exists($table, $index_name))
+ {
+ continue;
+ }
+
+ $result = $this->sql_create_unique_index($table, $index_name, $column);
+
+ if ($this->return_statements)
+ {
+ $statements = array_merge($statements, $result);
+ }
+ }
+ }
+ }
+
+ // Add indexes?
+ if (!empty($schema_changes['add_index']))
+ {
+ foreach ($schema_changes['add_index'] as $table => $index_array)
+ {
+ foreach ($index_array as $index_name => $column)
+ {
+ if ($this->sql_index_exists($table, $index_name))
+ {
+ continue;
+ }
+
+ $result = $this->sql_create_index($table, $index_name, $column);
+
+ if ($this->return_statements)
+ {
+ $statements = array_merge($statements, $result);
+ }
+ }
+ }
+ }
+
+ if ($sqlite)
+ {
+ foreach ($sqlite_data as $table_name => $sql_schema_changes)
+ {
+ // Create temporary table with original data
+ $statements[] = 'begin';
+
+ $sql = "SELECT sql
+ FROM sqlite_master
+ WHERE type = 'table'
+ AND name = '{$table_name}'
+ ORDER BY type DESC, name;";
+ $result = $this->db->sql_query($sql);
+
+ if (!$result)
+ {
+ continue;
+ }
+
+ $row = $this->db->sql_fetchrow($result);
+ $this->db->sql_freeresult($result);
+
+ // Create a backup table and populate it, destroy the existing one
+ $statements[] = preg_replace('#CREATE\s+TABLE\s+"?' . $table_name . '"?#i', 'CREATE TEMPORARY TABLE ' . $table_name . '_temp', $row['sql']);
+ $statements[] = 'INSERT INTO ' . $table_name . '_temp SELECT * FROM ' . $table_name;
+ $statements[] = 'DROP TABLE ' . $table_name;
+
+ // Get the columns...
+ preg_match('#\((.*)\)#s', $row['sql'], $matches);
+
+ $plain_table_cols = trim($matches[1]);
+ $new_table_cols = preg_split('/,(?![\s\w]+\))/m', $plain_table_cols);
+ $column_list = array();
+
+ foreach ($new_table_cols as $declaration)
+ {
+ $entities = preg_split('#\s+#', trim($declaration));
+ if ($entities[0] == 'PRIMARY')
+ {
+ continue;
+ }
+ $column_list[] = $entities[0];
+ }
+
+ // note down the primary key notation because sqlite only supports adding it to the end for the new table
+ $primary_key = false;
+ $_new_cols = array();
+
+ foreach ($new_table_cols as $key => $declaration)
+ {
+ $entities = preg_split('#\s+#', trim($declaration));
+ if ($entities[0] == 'PRIMARY')
+ {
+ $primary_key = $declaration;
+ continue;
+ }
+ $_new_cols[] = $declaration;
+ }
+
+ $new_table_cols = $_new_cols;
+
+ // First of all... change columns
+ if (!empty($sql_schema_changes['change_columns']))
+ {
+ foreach ($sql_schema_changes['change_columns'] as $column_sql)
+ {
+ foreach ($new_table_cols as $key => $declaration)
+ {
+ $entities = preg_split('#\s+#', trim($declaration));
+ if (strpos($column_sql, $entities[0] . ' ') === 0)
+ {
+ $new_table_cols[$key] = $column_sql;
+ }
+ }
+ }
+ }
+
+ if (!empty($sql_schema_changes['add_columns']))
+ {
+ foreach ($sql_schema_changes['add_columns'] as $column_sql)
+ {
+ $new_table_cols[] = $column_sql;
+ }
+ }
+
+ // Now drop them...
+ if (!empty($sql_schema_changes['drop_columns']))
+ {
+ foreach ($sql_schema_changes['drop_columns'] as $column_name)
+ {
+ // Remove from column list...
+ $new_column_list = array();
+ foreach ($column_list as $key => $value)
+ {
+ if ($value === $column_name)
+ {
+ continue;
+ }
+
+ $new_column_list[] = $value;
+ }
+
+ $column_list = $new_column_list;
+
+ // Remove from table...
+ $_new_cols = array();
+ foreach ($new_table_cols as $key => $declaration)
+ {
+ $entities = preg_split('#\s+#', trim($declaration));
+ if (strpos($column_name . ' ', $entities[0] . ' ') === 0)
+ {
+ continue;
+ }
+ $_new_cols[] = $declaration;
+ }
+ $new_table_cols = $_new_cols;
+ }
+ }
+
+ // Primary key...
+ if (!empty($sql_schema_changes['primary_key']))
+ {
+ $new_table_cols[] = 'PRIMARY KEY (' . implode(', ', $sql_schema_changes['primary_key']) . ')';
+ }
+ // Add a new one or the old primary key
+ else if ($primary_key !== false)
+ {
+ $new_table_cols[] = $primary_key;
+ }
+
+ $columns = implode(',', $column_list);
+
+ // create a new table and fill it up. destroy the temp one
+ $statements[] = 'CREATE TABLE ' . $table_name . ' (' . implode(',', $new_table_cols) . ');';
+ $statements[] = 'INSERT INTO ' . $table_name . ' (' . $columns . ') SELECT ' . $columns . ' FROM ' . $table_name . '_temp;';
+ $statements[] = 'DROP TABLE ' . $table_name . '_temp';
+
+ $statements[] = 'commit';
+ }
+ }
+
+ if ($this->return_statements)
+ {
+ return $statements;
+ }
+ }
+
+ /**
+ * Gets a list of columns of a table.
+ *
+ * @param string $table Table name
+ *
+ * @return array Array of column names (all lower case)
+ */
+ function sql_list_columns($table)
+ {
+ $columns = array();
+
+ switch ($this->sql_layer)
+ {
+ case 'mysql_40':
+ case 'mysql_41':
+ $sql = "SHOW COLUMNS FROM $table";
+ break;
+
+ // PostgreSQL has a way of doing this in a much simpler way but would
+ // not allow us to support all versions of PostgreSQL
+ case 'postgres':
+ $sql = "SELECT a.attname
+ FROM pg_class c, pg_attribute a
+ WHERE c.relname = '{$table}'
+ AND a.attnum > 0
+ AND a.attrelid = c.oid";
+ break;
+
+ // same deal with PostgreSQL, we must perform more complex operations than
+ // we technically could
+ case 'mssql':
+ case 'mssqlnative':
+ $sql = "SELECT c.name
+ FROM syscolumns c
+ LEFT JOIN sysobjects o ON c.id = o.id
+ WHERE o.name = '{$table}'";
+ break;
+
+ case 'oracle':
+ $sql = "SELECT column_name
+ FROM user_tab_columns
+ WHERE LOWER(table_name) = '" . strtolower($table) . "'";
+ break;
+
+ case 'sqlite':
+ case 'sqlite3':
+ $sql = "SELECT sql
+ FROM sqlite_master
+ WHERE type = 'table'
+ AND name = '{$table}'";
+
+ $result = $this->db->sql_query($sql);
+
+ if (!$result)
+ {
+ return false;
+ }
+
+ $row = $this->db->sql_fetchrow($result);
+ $this->db->sql_freeresult($result);
+
+ preg_match('#\((.*)\)#s', $row['sql'], $matches);
+
+ $cols = trim($matches[1]);
+ $col_array = preg_split('/,(?![\s\w]+\))/m', $cols);
+
+ foreach ($col_array as $declaration)
+ {
+ $entities = preg_split('#\s+#', trim($declaration));
+ if ($entities[0] == 'PRIMARY')
+ {
+ continue;
+ }
+
+ $column = strtolower($entities[0]);
+ $columns[$column] = $column;
+ }
+
+ return $columns;
+ break;
+ }
+
+ $result = $this->db->sql_query($sql);
+
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $column = strtolower(current($row));
+ $columns[$column] = $column;
+ }
+ $this->db->sql_freeresult($result);
+
+ return $columns;
+ }
+
+ /**
+ * Check whether a specified column exist in a table
+ *
+ * @param string $table Table to check
+ * @param string $column_name Column to check
+ *
+ * @return bool True if column exists, false otherwise
+ */
+ function sql_column_exists($table, $column_name)
+ {
+ $columns = $this->sql_list_columns($table);
+
+ return isset($columns[$column_name]);
+ }
+
+ /**
+ * Check if a specified index exists in table. Does not return PRIMARY KEY and UNIQUE indexes.
+ *
+ * @param string $table_name Table to check the index at
+ * @param string $index_name The index name to check
+ *
+ * @return bool True if index exists, else false
+ */
+ function sql_index_exists($table_name, $index_name)
+ {
+ if ($this->sql_layer == 'mssql' || $this->sql_layer == 'mssqlnative')
+ {
+ $sql = "EXEC sp_statistics '$table_name'";
+ $result = $this->db->sql_query($sql);
+
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ if ($row['TYPE'] == 3)
+ {
+ if (strtolower($row['INDEX_NAME']) == strtolower($index_name))
+ {
+ $this->db->sql_freeresult($result);
+ return true;
+ }
+ }
+ }
+ $this->db->sql_freeresult($result);
+
+ return false;
+ }
+
+ switch ($this->sql_layer)
+ {
+ case 'postgres':
+ $sql = "SELECT ic.relname as index_name
+ FROM pg_class bc, pg_class ic, pg_index i
+ WHERE (bc.oid = i.indrelid)
+ AND (ic.oid = i.indexrelid)
+ AND (bc.relname = '" . $table_name . "')
+ AND (i.indisunique != 't')
+ AND (i.indisprimary != 't')";
+ $col = 'index_name';
+ break;
+
+ case 'mysql_40':
+ case 'mysql_41':
+ $sql = 'SHOW KEYS
+ FROM ' . $table_name;
+ $col = 'Key_name';
+ break;
+
+ case 'oracle':
+ $sql = "SELECT index_name
+ FROM user_indexes
+ WHERE table_name = '" . strtoupper($table_name) . "'
+ AND generated = 'N'
+ AND uniqueness = 'NONUNIQUE'";
+ $col = 'index_name';
+ break;
+
+ case 'sqlite':
+ case 'sqlite3':
+ $sql = "PRAGMA index_list('" . $table_name . "');";
+ $col = 'name';
+ break;
+ }
+
+ $result = $this->db->sql_query($sql);
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ if (($this->sql_layer == 'mysql_40' || $this->sql_layer == 'mysql_41') && !$row['Non_unique'])
+ {
+ continue;
+ }
+
+ // These DBMS prefix index name with the table name
+ switch ($this->sql_layer)
+ {
+ case 'oracle':
+ case 'postgres':
+ case 'sqlite':
+ case 'sqlite3':
+ $row[$col] = substr($row[$col], strlen($table_name) + 1);
+ break;
+ }
+
+ if (strtolower($row[$col]) == strtolower($index_name))
+ {
+ $this->db->sql_freeresult($result);
+ return true;
+ }
+ }
+ $this->db->sql_freeresult($result);
+
+ return false;
+ }
+
+ /**
+ * Check if a specified index exists in table. Does not return PRIMARY KEY indexes.
+ *
+ * @param string $table_name Table to check the index at
+ * @param string $index_name The index name to check
+ *
+ * @return bool True if index exists, else false
+ */
+ function sql_unique_index_exists($table_name, $index_name)
+ {
+ if ($this->sql_layer == 'mssql' || $this->sql_layer == 'mssqlnative')
+ {
+ $sql = "EXEC sp_statistics '$table_name'";
+ $result = $this->db->sql_query($sql);
+
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ // Usually NON_UNIQUE is the column we want to check, but we allow for both
+ if ($row['TYPE'] == 3)
+ {
+ if (strtolower($row['INDEX_NAME']) == strtolower($index_name))
+ {
+ $this->db->sql_freeresult($result);
+ return true;
+ }
+ }
+ }
+ $this->db->sql_freeresult($result);
+ return false;
+ }
+
+ switch ($this->sql_layer)
+ {
+ case 'postgres':
+ $sql = "SELECT ic.relname as index_name, i.indisunique
+ FROM pg_class bc, pg_class ic, pg_index i
+ WHERE (bc.oid = i.indrelid)
+ AND (ic.oid = i.indexrelid)
+ AND (bc.relname = '" . $table_name . "')
+ AND (i.indisprimary != 't')";
+ $col = 'index_name';
+ break;
+
+ case 'mysql_40':
+ case 'mysql_41':
+ $sql = 'SHOW KEYS
+ FROM ' . $table_name;
+ $col = 'Key_name';
+ break;
+
+ case 'oracle':
+ $sql = "SELECT index_name, table_owner
+ FROM user_indexes
+ WHERE table_name = '" . strtoupper($table_name) . "'
+ AND generated = 'N'
+ AND uniqueness = 'UNIQUE'";
+ $col = 'index_name';
+ break;
+
+ case 'sqlite':
+ case 'sqlite3':
+ $sql = "PRAGMA index_list('" . $table_name . "');";
+ $col = 'name';
+ break;
+ }
+
+ $result = $this->db->sql_query($sql);
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ if (($this->sql_layer == 'mysql_40' || $this->sql_layer == 'mysql_41') && ($row['Non_unique'] || $row[$col] == 'PRIMARY'))
+ {
+ continue;
+ }
+
+ if (($this->sql_layer == 'sqlite' || $this->sql_layer == 'sqlite3') && !$row['unique'])
+ {
+ continue;
+ }
+
+ if ($this->sql_layer == 'postgres' && $row['indisunique'] != 't')
+ {
+ continue;
+ }
+
+ // These DBMS prefix index name with the table name
+ switch ($this->sql_layer)
+ {
+ case 'oracle':
+ // Two cases here... prefixed with U_[table_owner] and not prefixed with table_name
+ if (strpos($row[$col], 'U_') === 0)
+ {
+ $row[$col] = substr($row[$col], strlen('U_' . $row['table_owner']) + 1);
+ }
+ else if (strpos($row[$col], strtoupper($table_name)) === 0)
+ {
+ $row[$col] = substr($row[$col], strlen($table_name) + 1);
+ }
+ break;
+
+ case 'postgres':
+ case 'sqlite':
+ case 'sqlite3':
+ $row[$col] = substr($row[$col], strlen($table_name) + 1);
+ break;
+ }
+
+ if (strtolower($row[$col]) == strtolower($index_name))
+ {
+ $this->db->sql_freeresult($result);
+ return true;
+ }
+ }
+ $this->db->sql_freeresult($result);
+
+ return false;
+ }
+
+ /**
+ * Private method for performing sql statements (either execute them or return them)
+ * @access private
+ */
+ function _sql_run_sql($statements)
+ {
+ if ($this->return_statements)
+ {
+ return $statements;
+ }
+
+ // We could add error handling here...
+ foreach ($statements as $sql)
+ {
+ if ($sql === 'begin')
+ {
+ $this->db->sql_transaction('begin');
+ }
+ else if ($sql === 'commit')
+ {
+ $this->db->sql_transaction('commit');
+ }
+ else
+ {
+ $this->db->sql_query($sql);
+ }
+ }
+
+ return true;
+ }
+
+ /**
+ * Function to prepare some column information for better usage
+ * @access private
+ */
+ function sql_prepare_column_data($table_name, $column_name, $column_data)
+ {
+ if (strlen($column_name) > 30)
+ {
+ trigger_error("Column name '$column_name' on table '$table_name' is too long. The maximum is 30 characters.", E_USER_ERROR);
+ }
+
+ // Get type
+ list($column_type, $orig_column_type) = $this->get_column_type($column_data[0]);
+
+ // Adjust default value if db-dependent specified
+ if (is_array($column_data[1]))
+ {
+ $column_data[1] = (isset($column_data[1][$this->sql_layer])) ? $column_data[1][$this->sql_layer] : $column_data[1]['default'];
+ }
+
+ $sql = '';
+
+ $return_array = array();
+
+ switch ($this->sql_layer)
+ {
+ case 'mssql':
+ case 'mssqlnative':
+ $sql .= " {$column_type} ";
+ $sql_default = " {$column_type} ";
+
+ // For adding columns we need the default definition
+ if (!is_null($column_data[1]))
+ {
+ // For hexadecimal values do not use single quotes
+ if (strpos($column_data[1], '0x') === 0)
+ {
+ $return_array['default'] = 'DEFAULT (' . $column_data[1] . ') ';
+ $sql_default .= $return_array['default'];
+ }
+ else
+ {
+ $return_array['default'] = 'DEFAULT (' . ((is_numeric($column_data[1])) ? $column_data[1] : "'{$column_data[1]}'") . ') ';
+ $sql_default .= $return_array['default'];
+ }
+ }
+
+ if (isset($column_data[2]) && $column_data[2] == 'auto_increment')
+ {
+// $sql .= 'IDENTITY (1, 1) ';
+ $sql_default .= 'IDENTITY (1, 1) ';
+ }
+
+ $return_array['textimage'] = $column_type === '[text]';
+
+ if (!is_null($column_data[1]) || (isset($column_data[2]) && $column_data[2] == 'auto_increment'))
+ {
+ $sql .= 'NOT NULL';
+ $sql_default .= 'NOT NULL';
+ }
+ else
+ {
+ $sql .= 'NULL';
+ $sql_default .= 'NULL';
+ }
+
+ $return_array['column_type_sql_default'] = $sql_default;
+
+ break;
+
+ case 'mysql_40':
+ case 'mysql_41':
+ $sql .= " {$column_type} ";
+
+ // For hexadecimal values do not use single quotes
+ if (!is_null($column_data[1]) && substr($column_type, -4) !== 'text' && substr($column_type, -4) !== 'blob')
+ {
+ $sql .= (strpos($column_data[1], '0x') === 0) ? "DEFAULT {$column_data[1]} " : "DEFAULT '{$column_data[1]}' ";
+ }
+
+ if (!is_null($column_data[1]) || (isset($column_data[2]) && $column_data[2] == 'auto_increment'))
+ {
+ $sql .= 'NOT NULL';
+ }
+ else
+ {
+ $sql .= 'NULL';
+ }
+
+ if (isset($column_data[2]))
+ {
+ if ($column_data[2] == 'auto_increment')
+ {
+ $sql .= ' auto_increment';
+ }
+ else if ($this->sql_layer === 'mysql_41' && $column_data[2] == 'true_sort')
+ {
+ $sql .= ' COLLATE utf8_unicode_ci';
+ }
+ }
+
+ if (isset($column_data['after']))
+ {
+ $return_array['after'] = $column_data['after'];
+ }
+
+ break;
+
+ case 'oracle':
+ $sql .= " {$column_type} ";
+ $sql .= (!is_null($column_data[1])) ? "DEFAULT '{$column_data[1]}' " : '';
+
+ // In Oracle empty strings ('') are treated as NULL.
+ // Therefore in oracle we allow NULL's for all DEFAULT '' entries
+ // Oracle does not like setting NOT NULL on a column that is already NOT NULL (this happens only on number fields)
+ if (!preg_match('/number/i', $column_type))
+ {
+ $sql .= ($column_data[1] === '' || $column_data[1] === null) ? '' : 'NOT NULL';
+ }
+
+ $return_array['auto_increment'] = false;
+ if (isset($column_data[2]) && $column_data[2] == 'auto_increment')
+ {
+ $return_array['auto_increment'] = true;
+ }
+
+ break;
+
+ case 'postgres':
+ $return_array['column_type'] = $column_type;
+
+ $sql .= " {$column_type} ";
+
+ $return_array['auto_increment'] = false;
+ if (isset($column_data[2]) && $column_data[2] == 'auto_increment')
+ {
+ $default_val = "nextval('{$table_name}_seq')";
+ $return_array['auto_increment'] = true;
+ }
+ else if (!is_null($column_data[1]))
+ {
+ $default_val = "'" . $column_data[1] . "'";
+ $return_array['null'] = 'NOT NULL';
+ $sql .= 'NOT NULL ';
+ }
+ else
+ {
+ // Integers need to have 0 instead of empty string as default
+ if (strpos($column_type, 'INT') === 0)
+ {
+ $default_val = '0';
+ }
+ else
+ {
+ $default_val = "'" . $column_data[1] . "'";
+ }
+ $return_array['null'] = 'NULL';
+ $sql .= 'NULL ';
+ }
+
+ $return_array['default'] = $default_val;
+
+ $sql .= "DEFAULT {$default_val}";
+
+ // Unsigned? Then add a CHECK contraint
+ if (in_array($orig_column_type, $this->unsigned_types))
+ {
+ $return_array['constraint'] = "CHECK ({$column_name} >= 0)";
+ $sql .= " CHECK ({$column_name} >= 0)";
+ }
+
+ break;
+
+ case 'sqlite':
+ case 'sqlite3':
+ $return_array['primary_key_set'] = false;
+ if (isset($column_data[2]) && $column_data[2] == 'auto_increment')
+ {
+ $sql .= ' INTEGER PRIMARY KEY';
+ $return_array['primary_key_set'] = true;
+
+ if ($this->sql_layer === 'sqlite3')
+ {
+ $sql .= ' AUTOINCREMENT';
+ }
+ }
+ else
+ {
+ $sql .= ' ' . $column_type;
+ }
+
+ if (!is_null($column_data[1]))
+ {
+ $sql .= ' NOT NULL ';
+ $sql .= "DEFAULT '{$column_data[1]}'";
+ }
+
+ break;
+ }
+
+ $return_array['column_type_sql'] = $sql;
+
+ return $return_array;
+ }
+
+ /**
+ * Get the column's database type from the type map
+ *
+ * @param string $column_map_type
+ * @return array column type for this database
+ * and map type without length
+ */
+ function get_column_type($column_map_type)
+ {
+ if (strpos($column_map_type, ':') !== false)
+ {
+ list($orig_column_type, $column_length) = explode(':', $column_map_type);
+ if (!is_array($this->dbms_type_map[$this->sql_layer][$orig_column_type . ':']))
+ {
+ $column_type = sprintf($this->dbms_type_map[$this->sql_layer][$orig_column_type . ':'], $column_length);
+ }
+ else
+ {
+ if (isset($this->dbms_type_map[$this->sql_layer][$orig_column_type . ':']['rule']))
+ {
+ switch ($this->dbms_type_map[$this->sql_layer][$orig_column_type . ':']['rule'][0])
+ {
+ case 'div':
+ $column_length /= $this->dbms_type_map[$this->sql_layer][$orig_column_type . ':']['rule'][1];
+ $column_length = ceil($column_length);
+ $column_type = sprintf($this->dbms_type_map[$this->sql_layer][$orig_column_type . ':'][0], $column_length);
+ break;
+ }
+ }
+
+ if (isset($this->dbms_type_map[$this->sql_layer][$orig_column_type . ':']['limit']))
+ {
+ switch ($this->dbms_type_map[$this->sql_layer][$orig_column_type . ':']['limit'][0])
+ {
+ case 'mult':
+ $column_length *= $this->dbms_type_map[$this->sql_layer][$orig_column_type . ':']['limit'][1];
+ if ($column_length > $this->dbms_type_map[$this->sql_layer][$orig_column_type . ':']['limit'][2])
+ {
+ $column_type = $this->dbms_type_map[$this->sql_layer][$orig_column_type . ':']['limit'][3];
+ }
+ else
+ {
+ $column_type = sprintf($this->dbms_type_map[$this->sql_layer][$orig_column_type . ':'][0], $column_length);
+ }
+ break;
+ }
+ }
+ }
+ $orig_column_type .= ':';
+ }
+ else
+ {
+ $orig_column_type = $column_map_type;
+ $column_type = $this->dbms_type_map[$this->sql_layer][$column_map_type];
+ }
+
+ return array($column_type, $orig_column_type);
+ }
+
+ /**
+ * Add new column
+ */
+ function sql_column_add($table_name, $column_name, $column_data, $inline = false)
+ {
+ $column_data = $this->sql_prepare_column_data($table_name, $column_name, $column_data);
+ $statements = array();
+
+ switch ($this->sql_layer)
+ {
+ case 'mssql':
+ case 'mssqlnative':
+ // Does not support AFTER, only through temporary table
+ $statements[] = 'ALTER TABLE [' . $table_name . '] ADD [' . $column_name . '] ' . $column_data['column_type_sql_default'];
+ break;
+
+ case 'mysql_40':
+ case 'mysql_41':
+ $after = (!empty($column_data['after'])) ? ' AFTER ' . $column_data['after'] : '';
+ $statements[] = 'ALTER TABLE `' . $table_name . '` ADD COLUMN `' . $column_name . '` ' . $column_data['column_type_sql'] . $after;
+ break;
+
+ case 'oracle':
+ // Does not support AFTER, only through temporary table
+ $statements[] = 'ALTER TABLE ' . $table_name . ' ADD ' . $column_name . ' ' . $column_data['column_type_sql'];
+ break;
+
+ case 'postgres':
+ // Does not support AFTER, only through temporary table
+ if (version_compare($this->db->sql_server_info(true), '8.0', '>='))
+ {
+ $statements[] = 'ALTER TABLE ' . $table_name . ' ADD COLUMN "' . $column_name . '" ' . $column_data['column_type_sql'];
+ }
+ else
+ {
+ // old versions cannot add columns with default and null information
+ $statements[] = 'ALTER TABLE ' . $table_name . ' ADD COLUMN "' . $column_name . '" ' . $column_data['column_type'] . ' ' . $column_data['constraint'];
+
+ if (isset($column_data['null']))
+ {
+ if ($column_data['null'] == 'NOT NULL')
+ {
+ $statements[] = 'ALTER TABLE ' . $table_name . ' ALTER COLUMN ' . $column_name . ' SET NOT NULL';
+ }
+ }
+
+ if (isset($column_data['default']))
+ {
+ $statements[] = 'ALTER TABLE ' . $table_name . ' ALTER COLUMN ' . $column_name . ' SET DEFAULT ' . $column_data['default'];
+ }
+ }
+
+ break;
+
+ case 'sqlite':
+ if ($inline && $this->return_statements)
+ {
+ return $column_name . ' ' . $column_data['column_type_sql'];
+ }
+
+ $recreate_queries = $this->sqlite_get_recreate_table_queries($table_name);
+ if (empty($recreate_queries))
+ {
+ break;
+ }
+
+ $statements[] = 'begin';
+
+ $sql_create_table = array_shift($recreate_queries);
+
+ // Create a backup table and populate it, destroy the existing one
+ $statements[] = preg_replace('#CREATE\s+TABLE\s+"?' . $table_name . '"?#i', 'CREATE TEMPORARY TABLE ' . $table_name . '_temp', $sql_create_table);
+ $statements[] = 'INSERT INTO ' . $table_name . '_temp SELECT * FROM ' . $table_name;
+ $statements[] = 'DROP TABLE ' . $table_name;
+
+ preg_match('#\((.*)\)#s', $sql_create_table, $matches);
+
+ $new_table_cols = trim($matches[1]);
+ $old_table_cols = preg_split('/,(?![\s\w]+\))/m', $new_table_cols);
+ $column_list = array();
+
+ foreach ($old_table_cols as $declaration)
+ {
+ $entities = preg_split('#\s+#', trim($declaration));
+ if ($entities[0] == 'PRIMARY')
+ {
+ continue;
+ }
+ $column_list[] = $entities[0];
+ }
+
+ $columns = implode(',', $column_list);
+
+ $new_table_cols = $column_name . ' ' . $column_data['column_type_sql'] . ',' . $new_table_cols;
+
+ // create a new table and fill it up. destroy the temp one
+ $statements[] = 'CREATE TABLE ' . $table_name . ' (' . $new_table_cols . ');';
+ $statements = array_merge($statements, $recreate_queries);
+
+ $statements[] = 'INSERT INTO ' . $table_name . ' (' . $columns . ') SELECT ' . $columns . ' FROM ' . $table_name . '_temp;';
+ $statements[] = 'DROP TABLE ' . $table_name . '_temp';
+
+ $statements[] = 'commit';
+ break;
+
+ case 'sqlite3':
+ if ($inline && $this->return_statements)
+ {
+ return $column_name . ' ' . $column_data['column_type_sql'];
+ }
+
+ $statements[] = 'ALTER TABLE ' . $table_name . ' ADD ' . $column_name . ' ' . $column_data['column_type_sql'];
+ break;
+ }
+
+ return $this->_sql_run_sql($statements);
+ }
+
+ /**
+ * Drop column
+ */
+ function sql_column_remove($table_name, $column_name, $inline = false)
+ {
+ $statements = array();
+
+ switch ($this->sql_layer)
+ {
+ case 'mssql':
+ case 'mssqlnative':
+ // We need the data here
+ $old_return_statements = $this->return_statements;
+ $this->return_statements = true;
+
+ $indexes = $this->get_existing_indexes($table_name, $column_name);
+ $indexes = array_merge($indexes, $this->get_existing_indexes($table_name, $column_name, true));
+
+ // Drop any indexes
+ $recreate_indexes = array();
+ if (!empty($indexes))
+ {
+ foreach ($indexes as $index_name => $index_data)
+ {
+ $result = $this->sql_index_drop($table_name, $index_name);
+ $statements = array_merge($statements, $result);
+ if (sizeof($index_data) > 1)
+ {
+ // Remove this column from the index and recreate it
+ $recreate_indexes[$index_name] = array_diff($index_data, array($column_name));
+ }
+ }
+ }
+
+ // Drop default value constraint
+ $result = $this->mssql_get_drop_default_constraints_queries($table_name, $column_name);
+ $statements = array_merge($statements, $result);
+
+ // Remove the column
+ $statements[] = 'ALTER TABLE [' . $table_name . '] DROP COLUMN [' . $column_name . ']';
+
+ if (!empty($recreate_indexes))
+ {
+ // Recreate indexes after we removed the column
+ foreach ($recreate_indexes as $index_name => $index_data)
+ {
+ $result = $this->sql_create_index($table_name, $index_name, $index_data);
+ $statements = array_merge($statements, $result);
+ }
+ }
+
+ $this->return_statements = $old_return_statements;
+ break;
+
+ case 'mysql_40':
+ case 'mysql_41':
+ $statements[] = 'ALTER TABLE `' . $table_name . '` DROP COLUMN `' . $column_name . '`';
+ break;
+
+ case 'oracle':
+ $statements[] = 'ALTER TABLE ' . $table_name . ' DROP COLUMN ' . $column_name;
+ break;
+
+ case 'postgres':
+ $statements[] = 'ALTER TABLE ' . $table_name . ' DROP COLUMN "' . $column_name . '"';
+ break;
+
+ case 'sqlite':
+ case 'sqlite3':
+
+ if ($inline && $this->return_statements)
+ {
+ return $column_name;
+ }
+
+ $recreate_queries = $this->sqlite_get_recreate_table_queries($table_name, $column_name);
+ if (empty($recreate_queries))
+ {
+ break;
+ }
+
+ $statements[] = 'begin';
+
+ $sql_create_table = array_shift($recreate_queries);
+
+ // Create a backup table and populate it, destroy the existing one
+ $statements[] = preg_replace('#CREATE\s+TABLE\s+"?' . $table_name . '"?#i', 'CREATE TEMPORARY TABLE ' . $table_name . '_temp', $sql_create_table);
+ $statements[] = 'INSERT INTO ' . $table_name . '_temp SELECT * FROM ' . $table_name;
+ $statements[] = 'DROP TABLE ' . $table_name;
+
+ preg_match('#\((.*)\)#s', $sql_create_table, $matches);
+
+ $new_table_cols = trim($matches[1]);
+ $old_table_cols = preg_split('/,(?![\s\w]+\))/m', $new_table_cols);
+ $column_list = array();
+
+ foreach ($old_table_cols as $declaration)
+ {
+ $entities = preg_split('#\s+#', trim($declaration));
+ if ($entities[0] == 'PRIMARY' || $entities[0] === $column_name)
+ {
+ continue;
+ }
+ $column_list[] = $entities[0];
+ }
+
+ $columns = implode(',', $column_list);
+
+ $new_table_cols = trim(preg_replace('/' . $column_name . '\b[^,]+(?:,|$)/m', '', $new_table_cols));
+ if (substr($new_table_cols, -1) === ',')
+ {
+ // Remove the comma from the last entry again
+ $new_table_cols = substr($new_table_cols, 0, -1);
+ }
+
+ // create a new table and fill it up. destroy the temp one
+ $statements[] = 'CREATE TABLE ' . $table_name . ' (' . $new_table_cols . ');';
+ $statements = array_merge($statements, $recreate_queries);
+
+ $statements[] = 'INSERT INTO ' . $table_name . ' (' . $columns . ') SELECT ' . $columns . ' FROM ' . $table_name . '_temp;';
+ $statements[] = 'DROP TABLE ' . $table_name . '_temp';
+
+ $statements[] = 'commit';
+ break;
+ }
+
+ return $this->_sql_run_sql($statements);
+ }
+
+ /**
+ * Drop Index
+ */
+ function sql_index_drop($table_name, $index_name)
+ {
+ $statements = array();
+
+ switch ($this->sql_layer)
+ {
+ case 'mssql':
+ case 'mssqlnative':
+ $statements[] = 'DROP INDEX ' . $table_name . '.' . $index_name;
+ break;
+
+ case 'mysql_40':
+ case 'mysql_41':
+ $statements[] = 'DROP INDEX ' . $index_name . ' ON ' . $table_name;
+ break;
+
+ case 'oracle':
+ case 'postgres':
+ case 'sqlite':
+ case 'sqlite3':
+ $statements[] = 'DROP INDEX ' . $table_name . '_' . $index_name;
+ break;
+ }
+
+ return $this->_sql_run_sql($statements);
+ }
+
+ /**
+ * Drop Table
+ */
+ function sql_table_drop($table_name)
+ {
+ $statements = array();
+
+ if (!$this->sql_table_exists($table_name))
+ {
+ return $this->_sql_run_sql($statements);
+ }
+
+ // the most basic operation, get rid of the table
+ $statements[] = 'DROP TABLE ' . $table_name;
+
+ switch ($this->sql_layer)
+ {
+ case 'oracle':
+ $sql = 'SELECT A.REFERENCED_NAME
+ FROM USER_DEPENDENCIES A, USER_TRIGGERS B
+ WHERE A.REFERENCED_TYPE = \'SEQUENCE\'
+ AND A.NAME = B.TRIGGER_NAME
+ AND B.TABLE_NAME = \'' . strtoupper($table_name) . "'";
+ $result = $this->db->sql_query($sql);
+
+ // any sequences ref'd to this table's triggers?
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $statements[] = "DROP SEQUENCE {$row['referenced_name']}";
+ }
+ $this->db->sql_freeresult($result);
+ break;
+
+ case 'postgres':
+ // PGSQL does not "tightly" bind sequences and tables, we must guess...
+ $sql = "SELECT relname
+ FROM pg_class
+ WHERE relkind = 'S'
+ AND relname = '{$table_name}_seq'";
+ $result = $this->db->sql_query($sql);
+
+ // We don't even care about storing the results. We already know the answer if we get rows back.
+ if ($this->db->sql_fetchrow($result))
+ {
+ $statements[] = "DROP SEQUENCE {$table_name}_seq;\n";
+ }
+ $this->db->sql_freeresult($result);
+ break;
+ }
+
+ return $this->_sql_run_sql($statements);
+ }
+
+ /**
+ * Add primary key
+ */
+ function sql_create_primary_key($table_name, $column, $inline = false)
+ {
+ $statements = array();
+
+ switch ($this->sql_layer)
+ {
+ case 'postgres':
+ case 'mysql_40':
+ case 'mysql_41':
+ $statements[] = 'ALTER TABLE ' . $table_name . ' ADD PRIMARY KEY (' . implode(', ', $column) . ')';
+ break;
+
+ case 'mssql':
+ case 'mssqlnative':
+ $sql = "ALTER TABLE [{$table_name}] WITH NOCHECK ADD ";
+ $sql .= "CONSTRAINT [PK_{$table_name}] PRIMARY KEY CLUSTERED (";
+ $sql .= '[' . implode("],\n\t\t[", $column) . ']';
+ $sql .= ')';
+
+ $statements[] = $sql;
+ break;
+
+ case 'oracle':
+ $statements[] = 'ALTER TABLE ' . $table_name . ' add CONSTRAINT pk_' . $table_name . ' PRIMARY KEY (' . implode(', ', $column) . ')';
+ break;
+
+ case 'sqlite':
+ case 'sqlite3':
+
+ if ($inline && $this->return_statements)
+ {
+ return $column;
+ }
+
+ $recreate_queries = $this->sqlite_get_recreate_table_queries($table_name);
+ if (empty($recreate_queries))
+ {
+ break;
+ }
+
+ $statements[] = 'begin';
+
+ $sql_create_table = array_shift($recreate_queries);
+
+ // Create a backup table and populate it, destroy the existing one
+ $statements[] = preg_replace('#CREATE\s+TABLE\s+"?' . $table_name . '"?#i', 'CREATE TEMPORARY TABLE ' . $table_name . '_temp', $sql_create_table);
+ $statements[] = 'INSERT INTO ' . $table_name . '_temp SELECT * FROM ' . $table_name;
+ $statements[] = 'DROP TABLE ' . $table_name;
+
+ preg_match('#\((.*)\)#s', $sql_create_table, $matches);
+
+ $new_table_cols = trim($matches[1]);
+ $old_table_cols = preg_split('/,(?![\s\w]+\))/m', $new_table_cols);
+ $column_list = array();
+
+ foreach ($old_table_cols as $declaration)
+ {
+ $entities = preg_split('#\s+#', trim($declaration));
+ if ($entities[0] == 'PRIMARY')
+ {
+ continue;
+ }
+ $column_list[] = $entities[0];
+ }
+
+ $columns = implode(',', $column_list);
+
+ // create a new table and fill it up. destroy the temp one
+ $statements[] = 'CREATE TABLE ' . $table_name . ' (' . $new_table_cols . ', PRIMARY KEY (' . implode(', ', $column) . '));';
+ $statements = array_merge($statements, $recreate_queries);
+
+ $statements[] = 'INSERT INTO ' . $table_name . ' (' . $columns . ') SELECT ' . $columns . ' FROM ' . $table_name . '_temp;';
+ $statements[] = 'DROP TABLE ' . $table_name . '_temp';
+
+ $statements[] = 'commit';
+ break;
+ }
+
+ return $this->_sql_run_sql($statements);
+ }
+
+ /**
+ * Add unique index
+ */
+ function sql_create_unique_index($table_name, $index_name, $column)
+ {
+ $statements = array();
+
+ $table_prefix = substr(CONFIG_TABLE, 0, -6); // strlen(config)
+ if (strlen($table_name . '_' . $index_name) - strlen($table_prefix) > 24)
+ {
+ $max_length = strlen($table_prefix) + 24;
+ trigger_error("Index name '{$table_name}_$index_name' on table '$table_name' is too long. The maximum is $max_length characters.", E_USER_ERROR);
+ }
+
+ switch ($this->sql_layer)
+ {
+ case 'postgres':
+ case 'oracle':
+ case 'sqlite':
+ case 'sqlite3':
+ $statements[] = 'CREATE UNIQUE INDEX ' . $table_name . '_' . $index_name . ' ON ' . $table_name . '(' . implode(', ', $column) . ')';
+ break;
+
+ case 'mysql_40':
+ case 'mysql_41':
+ $statements[] = 'ALTER TABLE ' . $table_name . ' ADD UNIQUE INDEX ' . $index_name . '(' . implode(', ', $column) . ')';
+ break;
+
+ case 'mssql':
+ case 'mssqlnative':
+ $statements[] = 'CREATE UNIQUE INDEX [' . $index_name . '] ON [' . $table_name . ']([' . implode('], [', $column) . '])';
+ break;
+ }
+
+ return $this->_sql_run_sql($statements);
+ }
+
+ /**
+ * Add index
+ */
+ function sql_create_index($table_name, $index_name, $column)
+ {
+ $statements = array();
+
+ $table_prefix = substr(CONFIG_TABLE, 0, -6); // strlen(config)
+ if (strlen($table_name . $index_name) - strlen($table_prefix) > 24)
+ {
+ $max_length = strlen($table_prefix) + 24;
+ trigger_error("Index name '{$table_name}_$index_name' on table '$table_name' is too long. The maximum is $max_length characters.", E_USER_ERROR);
+ }
+
+ // remove index length unless MySQL4
+ if ('mysql_40' != $this->sql_layer)
+ {
+ $column = preg_replace('#:.*$#', '', $column);
+ }
+
+ switch ($this->sql_layer)
+ {
+ case 'postgres':
+ case 'oracle':
+ case 'sqlite':
+ case 'sqlite3':
+ $statements[] = 'CREATE INDEX ' . $table_name . '_' . $index_name . ' ON ' . $table_name . '(' . implode(', ', $column) . ')';
+ break;
+
+ case 'mysql_40':
+ // add index size to definition as required by MySQL4
+ foreach ($column as $i => $col)
+ {
+ if (false !== strpos($col, ':'))
+ {
+ list($col, $index_size) = explode(':', $col);
+ $column[$i] = "$col($index_size)";
+ }
+ }
+ // no break
+ case 'mysql_41':
+ $statements[] = 'ALTER TABLE ' . $table_name . ' ADD INDEX ' . $index_name . ' (' . implode(', ', $column) . ')';
+ break;
+
+ case 'mssql':
+ case 'mssqlnative':
+ $statements[] = 'CREATE INDEX [' . $index_name . '] ON [' . $table_name . ']([' . implode('], [', $column) . '])';
+ break;
+ }
+
+ return $this->_sql_run_sql($statements);
+ }
+
+ /**
+ * List all of the indices that belong to a table,
+ * does not count:
+ * * UNIQUE indices
+ * * PRIMARY keys
+ */
+ function sql_list_index($table_name)
+ {
+ $index_array = array();
+
+ if ($this->sql_layer == 'mssql' || $this->sql_layer == 'mssqlnative')
+ {
+ $sql = "EXEC sp_statistics '$table_name'";
+ $result = $this->db->sql_query($sql);
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ if ($row['TYPE'] == 3)
+ {
+ $index_array[] = $row['INDEX_NAME'];
+ }
+ }
+ $this->db->sql_freeresult($result);
+ }
+ else
+ {
+ switch ($this->sql_layer)
+ {
+ case 'postgres':
+ $sql = "SELECT ic.relname as index_name
+ FROM pg_class bc, pg_class ic, pg_index i
+ WHERE (bc.oid = i.indrelid)
+ AND (ic.oid = i.indexrelid)
+ AND (bc.relname = '" . $table_name . "')
+ AND (i.indisunique != 't')
+ AND (i.indisprimary != 't')";
+ $col = 'index_name';
+ break;
+
+ case 'mysql_40':
+ case 'mysql_41':
+ $sql = 'SHOW KEYS
+ FROM ' . $table_name;
+ $col = 'Key_name';
+ break;
+
+ case 'oracle':
+ $sql = "SELECT index_name
+ FROM user_indexes
+ WHERE table_name = '" . strtoupper($table_name) . "'
+ AND generated = 'N'
+ AND uniqueness = 'NONUNIQUE'";
+ $col = 'index_name';
+ break;
+
+ case 'sqlite':
+ case 'sqlite3':
+ $sql = "PRAGMA index_info('" . $table_name . "');";
+ $col = 'name';
+ break;
+ }
+
+ $result = $this->db->sql_query($sql);
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ if (($this->sql_layer == 'mysql_40' || $this->sql_layer == 'mysql_41') && !$row['Non_unique'])
+ {
+ continue;
+ }
+
+ switch ($this->sql_layer)
+ {
+ case 'oracle':
+ case 'postgres':
+ case 'sqlite':
+ case 'sqlite3':
+ $row[$col] = substr($row[$col], strlen($table_name) + 1);
+ break;
+ }
+
+ $index_array[] = $row[$col];
+ }
+ $this->db->sql_freeresult($result);
+ }
+
+ return array_map('strtolower', $index_array);
+ }
+
+ /**
+ * Removes table_name from the index_name if it is at the beginning
+ *
+ * @param $table_name
+ * @param $index_name
+ * @return string
+ */
+ protected function strip_table_name_from_index_name($table_name, $index_name)
+ {
+ return (strpos(strtoupper($index_name), strtoupper($table_name)) === 0) ? substr($index_name, strlen($table_name) + 1) : $index_name;
+ }
+
+ /**
+ * Change column type (not name!)
+ */
+ function sql_column_change($table_name, $column_name, $column_data, $inline = false)
+ {
+ $original_column_data = $column_data;
+ $column_data = $this->sql_prepare_column_data($table_name, $column_name, $column_data);
+ $statements = array();
+
+ switch ($this->sql_layer)
+ {
+ case 'mssql':
+ case 'mssqlnative':
+ // We need the data here
+ $old_return_statements = $this->return_statements;
+ $this->return_statements = true;
+
+ $indexes = $this->get_existing_indexes($table_name, $column_name);
+ $unique_indexes = $this->get_existing_indexes($table_name, $column_name, true);
+
+ // Drop any indexes
+ if (!empty($indexes) || !empty($unique_indexes))
+ {
+ $drop_indexes = array_merge(array_keys($indexes), array_keys($unique_indexes));
+ foreach ($drop_indexes as $index_name)
+ {
+ $result = $this->sql_index_drop($table_name, $index_name);
+ $statements = array_merge($statements, $result);
+ }
+ }
+
+ // Drop default value constraint
+ $result = $this->mssql_get_drop_default_constraints_queries($table_name, $column_name);
+ $statements = array_merge($statements, $result);
+
+ // Change the column
+ $statements[] = 'ALTER TABLE [' . $table_name . '] ALTER COLUMN [' . $column_name . '] ' . $column_data['column_type_sql'];
+
+ if (!empty($column_data['default']))
+ {
+ // Add new default value constraint
+ $statements[] = 'ALTER TABLE [' . $table_name . '] ADD CONSTRAINT [DF_' . $table_name . '_' . $column_name . '_1] ' . $column_data['default'] . ' FOR [' . $column_name . ']';
+ }
+
+ if (!empty($indexes))
+ {
+ // Recreate indexes after we changed the column
+ foreach ($indexes as $index_name => $index_data)
+ {
+ $result = $this->sql_create_index($table_name, $index_name, $index_data);
+ $statements = array_merge($statements, $result);
+ }
+ }
+
+ if (!empty($unique_indexes))
+ {
+ // Recreate unique indexes after we changed the column
+ foreach ($unique_indexes as $index_name => $index_data)
+ {
+ $result = $this->sql_create_unique_index($table_name, $index_name, $index_data);
+ $statements = array_merge($statements, $result);
+ }
+ }
+
+ $this->return_statements = $old_return_statements;
+ break;
+
+ case 'mysql_40':
+ case 'mysql_41':
+ $statements[] = 'ALTER TABLE `' . $table_name . '` CHANGE `' . $column_name . '` `' . $column_name . '` ' . $column_data['column_type_sql'];
+ break;
+
+ case 'oracle':
+ // We need the data here
+ $old_return_statements = $this->return_statements;
+ $this->return_statements = true;
+
+ // Get list of existing indexes
+ $indexes = $this->get_existing_indexes($table_name, $column_name);
+ $unique_indexes = $this->get_existing_indexes($table_name, $column_name, true);
+
+ // Drop any indexes
+ if (!empty($indexes) || !empty($unique_indexes))
+ {
+ $drop_indexes = array_merge(array_keys($indexes), array_keys($unique_indexes));
+ foreach ($drop_indexes as $index_name)
+ {
+ $result = $this->sql_index_drop($table_name, $this->strip_table_name_from_index_name($table_name, $index_name));
+ $statements = array_merge($statements, $result);
+ }
+ }
+
+ $temp_column_name = 'temp_' . substr(md5($column_name), 0, 25);
+ // Add a temporary table with the new type
+ $result = $this->sql_column_add($table_name, $temp_column_name, $original_column_data);
+ $statements = array_merge($statements, $result);
+
+ // Copy the data to the new column
+ $statements[] = 'UPDATE ' . $table_name . ' SET ' . $temp_column_name . ' = ' . $column_name;
+
+ // Drop the original column
+ $result = $this->sql_column_remove($table_name, $column_name);
+ $statements = array_merge($statements, $result);
+
+ // Recreate the original column with the new type
+ $result = $this->sql_column_add($table_name, $column_name, $original_column_data);
+ $statements = array_merge($statements, $result);
+
+ if (!empty($indexes))
+ {
+ // Recreate indexes after we changed the column
+ foreach ($indexes as $index_name => $index_data)
+ {
+ $result = $this->sql_create_index($table_name, $this->strip_table_name_from_index_name($table_name, $index_name), $index_data);
+ $statements = array_merge($statements, $result);
+ }
+ }
+
+ if (!empty($unique_indexes))
+ {
+ // Recreate unique indexes after we changed the column
+ foreach ($unique_indexes as $index_name => $index_data)
+ {
+ $result = $this->sql_create_unique_index($table_name, $this->strip_table_name_from_index_name($table_name, $index_name), $index_data);
+ $statements = array_merge($statements, $result);
+ }
+ }
+
+ // Copy the data to the original column
+ $statements[] = 'UPDATE ' . $table_name . ' SET ' . $column_name . ' = ' . $temp_column_name;
+
+ // Drop the temporary column again
+ $result = $this->sql_column_remove($table_name, $temp_column_name);
+ $statements = array_merge($statements, $result);
+
+ $this->return_statements = $old_return_statements;
+ break;
+
+ case 'postgres':
+ $sql = 'ALTER TABLE ' . $table_name . ' ';
+
+ $sql_array = array();
+ $sql_array[] = 'ALTER COLUMN ' . $column_name . ' TYPE ' . $column_data['column_type'];
+
+ if (isset($column_data['null']))
+ {
+ if ($column_data['null'] == 'NOT NULL')
+ {
+ $sql_array[] = 'ALTER COLUMN ' . $column_name . ' SET NOT NULL';
+ }
+ else if ($column_data['null'] == 'NULL')
+ {
+ $sql_array[] = 'ALTER COLUMN ' . $column_name . ' DROP NOT NULL';
+ }
+ }
+
+ if (isset($column_data['default']))
+ {
+ $sql_array[] = 'ALTER COLUMN ' . $column_name . ' SET DEFAULT ' . $column_data['default'];
+ }
+
+ // we don't want to double up on constraints if we change different number data types
+ if (isset($column_data['constraint']))
+ {
+ $constraint_sql = "SELECT consrc as constraint_data
+ FROM pg_constraint, pg_class bc
+ WHERE conrelid = bc.oid
+ AND bc.relname = '{$table_name}'
+ AND NOT EXISTS (
+ SELECT *
+ FROM pg_constraint as c, pg_inherits as i
+ WHERE i.inhrelid = pg_constraint.conrelid
+ AND c.conname = pg_constraint.conname
+ AND c.consrc = pg_constraint.consrc
+ AND c.conrelid = i.inhparent
+ )";
+
+ $constraint_exists = false;
+
+ $result = $this->db->sql_query($constraint_sql);
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ if (trim($row['constraint_data']) == trim($column_data['constraint']))
+ {
+ $constraint_exists = true;
+ break;
+ }
+ }
+ $this->db->sql_freeresult($result);
+
+ if (!$constraint_exists)
+ {
+ $sql_array[] = 'ADD ' . $column_data['constraint'];
+ }
+ }
+
+ $sql .= implode(', ', $sql_array);
+
+ $statements[] = $sql;
+ break;
+
+ case 'sqlite':
+ case 'sqlite3':
+
+ if ($inline && $this->return_statements)
+ {
+ return $column_name . ' ' . $column_data['column_type_sql'];
+ }
+
+ $recreate_queries = $this->sqlite_get_recreate_table_queries($table_name);
+ if (empty($recreate_queries))
+ {
+ break;
+ }
+
+ $statements[] = 'begin';
+
+ $sql_create_table = array_shift($recreate_queries);
+
+ // Create a temp table and populate it, destroy the existing one
+ $statements[] = preg_replace('#CREATE\s+TABLE\s+"?' . $table_name . '"?#i', 'CREATE TEMPORARY TABLE ' . $table_name . '_temp', $sql_create_table);
+ $statements[] = 'INSERT INTO ' . $table_name . '_temp SELECT * FROM ' . $table_name;
+ $statements[] = 'DROP TABLE ' . $table_name;
+
+ preg_match('#\((.*)\)#s', $sql_create_table, $matches);
+
+ $new_table_cols = trim($matches[1]);
+ $old_table_cols = preg_split('/,(?![\s\w]+\))/m', $new_table_cols);
+ $column_list = array();
+
+ foreach ($old_table_cols as $key => $declaration)
+ {
+ $declaration = trim($declaration);
+
+ // Check for the beginning of the constraint section and stop
+ if (preg_match('/[^\(]*\s*PRIMARY KEY\s+\(/', $declaration) ||
+ preg_match('/[^\(]*\s*UNIQUE\s+\(/', $declaration) ||
+ preg_match('/[^\(]*\s*FOREIGN KEY\s+\(/', $declaration) ||
+ preg_match('/[^\(]*\s*CHECK\s+\(/', $declaration))
+ {
+ break;
+ }
+
+ $entities = preg_split('#\s+#', $declaration);
+ $column_list[] = $entities[0];
+ if ($entities[0] == $column_name)
+ {
+ $old_table_cols[$key] = $column_name . ' ' . $column_data['column_type_sql'];
+ }
+ }
+
+ $columns = implode(',', $column_list);
+
+ // Create a new table and fill it up. destroy the temp one
+ $statements[] = 'CREATE TABLE ' . $table_name . ' (' . implode(',', $old_table_cols) . ');';
+ $statements = array_merge($statements, $recreate_queries);
+
+ $statements[] = 'INSERT INTO ' . $table_name . ' (' . $columns . ') SELECT ' . $columns . ' FROM ' . $table_name . '_temp;';
+ $statements[] = 'DROP TABLE ' . $table_name . '_temp';
+
+ $statements[] = 'commit';
+
+ break;
+ }
+
+ return $this->_sql_run_sql($statements);
+ }
+
+ /**
+ * Get queries to drop the default constraints of a column
+ *
+ * We need to drop the default constraints of a column,
+ * before being able to change their type or deleting them.
+ *
+ * @param string $table_name
+ * @param string $column_name
+ * @return array Array with SQL statements
+ */
+ protected function mssql_get_drop_default_constraints_queries($table_name, $column_name)
+ {
+ $statements = array();
+ if ($this->mssql_is_sql_server_2000())
+ {
+ // http://msdn.microsoft.com/en-us/library/aa175912%28v=sql.80%29.aspx
+ // Deprecated in SQL Server 2005
+ $sql = "SELECT so.name AS def_name
+ FROM sysobjects so
+ JOIN sysconstraints sc ON so.id = sc.constid
+ WHERE object_name(so.parent_obj) = '{$table_name}'
+ AND so.xtype = 'D'
+ AND sc.colid = (SELECT colid FROM syscolumns
+ WHERE id = object_id('{$table_name}')
+ AND name = '{$column_name}')";
+ }
+ else
+ {
+ $sql = "SELECT dobj.name AS def_name
+ FROM sys.columns col
+ LEFT OUTER JOIN sys.objects dobj ON (dobj.object_id = col.default_object_id AND dobj.type = 'D')
+ WHERE col.object_id = object_id('{$table_name}')
+ AND col.name = '{$column_name}'
+ AND dobj.name IS NOT NULL";
+ }
+
+ $result = $this->db->sql_query($sql);
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $statements[] = 'ALTER TABLE [' . $table_name . '] DROP CONSTRAINT [' . $row['def_name'] . ']';
+ }
+ $this->db->sql_freeresult($result);
+
+ return $statements;
+ }
+
+ /**
+ * Get a list with existing indexes for the column
+ *
+ * @param string $table_name
+ * @param string $column_name
+ * @param bool $unique Should we get unique indexes or normal ones
+ * @return array Array with Index name => columns
+ */
+ public function get_existing_indexes($table_name, $column_name, $unique = false)
+ {
+ switch ($this->sql_layer)
+ {
+ case 'mysql_40':
+ case 'mysql_41':
+ case 'postgres':
+ case 'sqlite':
+ case 'sqlite3':
+ // Not supported
+ throw new \Exception('DBMS is not supported');
+ break;
+ }
+
+ $sql = '';
+ $existing_indexes = array();
+
+ switch ($this->sql_layer)
+ {
+ case 'mssql':
+ case 'mssqlnative':
+ if ($this->mssql_is_sql_server_2000())
+ {
+ // http://msdn.microsoft.com/en-us/library/aa175912%28v=sql.80%29.aspx
+ // Deprecated in SQL Server 2005
+ $sql = "SELECT DISTINCT ix.name AS phpbb_index_name
+ FROM sysindexes ix
+ INNER JOIN sysindexkeys ixc
+ ON ixc.id = ix.id
+ AND ixc.indid = ix.indid
+ INNER JOIN syscolumns cols
+ ON cols.colid = ixc.colid
+ AND cols.id = ix.id
+ WHERE ix.id = object_id('{$table_name}')
+ AND cols.name = '{$column_name}'
+ AND INDEXPROPERTY(ix.id, ix.name, 'IsUnique') = " . ($unique ? '1' : '0');
+ }
+ else
+ {
+ $sql = "SELECT DISTINCT ix.name AS phpbb_index_name
+ FROM sys.indexes ix
+ INNER JOIN sys.index_columns ixc
+ ON ixc.object_id = ix.object_id
+ AND ixc.index_id = ix.index_id
+ INNER JOIN sys.columns cols
+ ON cols.column_id = ixc.column_id
+ AND cols.object_id = ix.object_id
+ WHERE ix.object_id = object_id('{$table_name}')
+ AND cols.name = '{$column_name}'
+ AND ix.is_unique = " . ($unique ? '1' : '0');
+ }
+ break;
+
+ case 'oracle':
+ $sql = "SELECT ix.index_name AS phpbb_index_name, ix.uniqueness AS is_unique
+ FROM all_ind_columns ixc, all_indexes ix
+ WHERE ix.index_name = ixc.index_name
+ AND ixc.table_name = '" . strtoupper($table_name) . "'
+ AND ixc.column_name = '" . strtoupper($column_name) . "'";
+ break;
+ }
+
+ $result = $this->db->sql_query($sql);
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ if (!isset($row['is_unique']) || ($unique && $row['is_unique'] == 'UNIQUE') || (!$unique && $row['is_unique'] == 'NONUNIQUE'))
+ {
+ $existing_indexes[$row['phpbb_index_name']] = array();
+ }
+ }
+ $this->db->sql_freeresult($result);
+
+ if (empty($existing_indexes))
+ {
+ return array();
+ }
+
+ switch ($this->sql_layer)
+ {
+ case 'mssql':
+ case 'mssqlnative':
+ if ($this->mssql_is_sql_server_2000())
+ {
+ $sql = "SELECT DISTINCT ix.name AS phpbb_index_name, cols.name AS phpbb_column_name
+ FROM sysindexes ix
+ INNER JOIN sysindexkeys ixc
+ ON ixc.id = ix.id
+ AND ixc.indid = ix.indid
+ INNER JOIN syscolumns cols
+ ON cols.colid = ixc.colid
+ AND cols.id = ix.id
+ WHERE ix.id = object_id('{$table_name}')
+ AND " . $this->db->sql_in_set('ix.name', array_keys($existing_indexes));
+ }
+ else
+ {
+ $sql = "SELECT DISTINCT ix.name AS phpbb_index_name, cols.name AS phpbb_column_name
+ FROM sys.indexes ix
+ INNER JOIN sys.index_columns ixc
+ ON ixc.object_id = ix.object_id
+ AND ixc.index_id = ix.index_id
+ INNER JOIN sys.columns cols
+ ON cols.column_id = ixc.column_id
+ AND cols.object_id = ix.object_id
+ WHERE ix.object_id = object_id('{$table_name}')
+ AND " . $this->db->sql_in_set('ix.name', array_keys($existing_indexes));
+ }
+ break;
+
+ case 'oracle':
+ $sql = "SELECT index_name AS phpbb_index_name, column_name AS phpbb_column_name
+ FROM all_ind_columns
+ WHERE table_name = '" . strtoupper($table_name) . "'
+ AND " . $this->db->sql_in_set('index_name', array_keys($existing_indexes));
+ break;
+ }
+
+ $result = $this->db->sql_query($sql);
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $existing_indexes[$row['phpbb_index_name']][] = $row['phpbb_column_name'];
+ }
+ $this->db->sql_freeresult($result);
+
+ return $existing_indexes;
+ }
+
+ /**
+ * Is the used MS SQL Server a SQL Server 2000?
+ *
+ * @return bool
+ */
+ protected function mssql_is_sql_server_2000()
+ {
+ if ($this->is_sql_server_2000 === null)
+ {
+ $sql = "SELECT CAST(SERVERPROPERTY('productversion') AS VARCHAR(25)) AS mssql_version";
+ $result = $this->db->sql_query($sql);
+ $properties = $this->db->sql_fetchrow($result);
+ $this->db->sql_freeresult($result);
+ $this->is_sql_server_2000 = $properties['mssql_version'][0] == '8';
+ }
+
+ return $this->is_sql_server_2000;
+ }
+
+ /**
+ * Returns the Queries which are required to recreate a table including indexes
+ *
+ * @param string $table_name
+ * @param string $remove_column When we drop a column, we remove the column
+ * from all indexes. If the index has no other
+ * column, we drop it completly.
+ * @return array
+ */
+ protected function sqlite_get_recreate_table_queries($table_name, $remove_column = '')
+ {
+ $queries = array();
+
+ $sql = "SELECT sql
+ FROM sqlite_master
+ WHERE type = 'table'
+ AND name = '{$table_name}'";
+ $result = $this->db->sql_query($sql);
+ $sql_create_table = $this->db->sql_fetchfield('sql');
+ $this->db->sql_freeresult($result);
+
+ if (!$sql_create_table)
+ {
+ return array();
+ }
+ $queries[] = $sql_create_table;
+
+ $sql = "SELECT sql
+ FROM sqlite_master
+ WHERE type = 'index'
+ AND tbl_name = '{$table_name}'";
+ $result = $this->db->sql_query($sql);
+ while ($sql_create_index = $this->db->sql_fetchfield('sql'))
+ {
+ if ($remove_column)
+ {
+ $match = array();
+ preg_match('#(?:[\w ]+)\((.*)\)#', $sql_create_index, $match);
+ if (!isset($match[1]))
+ {
+ continue;
+ }
+
+ // Find and remove $remove_column from the index
+ $columns = explode(', ', $match[1]);
+ $found_column = array_search($remove_column, $columns);
+ if ($found_column !== false)
+ {
+ unset($columns[$found_column]);
+
+ // If the column list is not empty add the index to the list
+ if (!empty($columns))
+ {
+ $queries[] = str_replace($match[1], implode(', ', $columns), $sql_create_index);
+ }
+ }
+ else
+ {
+ $queries[] = $sql_create_index;
+ }
+ }
+ else
+ {
+ $queries[] = $sql_create_index;
+ }
+ }
+ $this->db->sql_freeresult($result);
+
+ return $queries;
+ }
+}
diff --git a/phpBB/phpbb/di/container_builder.php b/phpBB/phpbb/di/container_builder.php
new file mode 100644
index 0000000000..5f3aa685bf
--- /dev/null
+++ b/phpBB/phpbb/di/container_builder.php
@@ -0,0 +1,418 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\di;
+
+use Symfony\Component\DependencyInjection\ContainerBuilder;
+use Symfony\Component\DependencyInjection\Dumper\PhpDumper;
+use Symfony\Component\HttpKernel\DependencyInjection\RegisterListenersPass;
+
+class container_builder
+{
+ /** @var string phpBB Root Path */
+ protected $phpbb_root_path;
+
+ /** @var string php file extension */
+ protected $php_ext;
+
+ /**
+ * The container under construction
+ *
+ * @var ContainerBuilder
+ */
+ protected $container;
+
+ /**
+ * @var \phpbb\db\driver\driver_interface
+ */
+ protected $dbal_connection = null;
+
+ /**
+ * @var array the installed extensions
+ */
+ protected $installed_exts = null;
+
+ /**
+ * Indicates whether the php config file should be injected into the container (default to true).
+ *
+ * @var bool
+ */
+ protected $inject_config = true;
+
+ /**
+ * Indicates whether extensions should be used (default to true).
+ *
+ * @var bool
+ */
+ protected $use_extensions = true;
+
+ /**
+ * Defines a custom path to find the configuration of the container (default to $this->phpbb_root_path . 'config')
+ *
+ * @var string
+ */
+ protected $config_path = null;
+
+ /**
+ * Indicates whether the phpBB compile pass should be used (default to true).
+ *
+ * @var bool
+ */
+ protected $use_custom_pass = true;
+
+ /**
+ * Indicates whether the kernel compile pass should be used (default to true).
+ *
+ * @var bool
+ */
+ protected $use_kernel_pass = true;
+
+ /**
+ * Indicates whether the container should be dumped to the filesystem (default to true).
+ *
+ * If DEBUG_CONTAINER is set this option is ignored and a new container is build.
+ *
+ * @var bool
+ */
+ protected $dump_container = true;
+
+ /**
+ * Indicates if the container should be compiled automatically (default to true).
+ *
+ * @var bool
+ */
+ protected $compile_container = true;
+
+ /**
+ * Custom parameters to inject into the container.
+ *
+ * Default to true:
+ * array(
+ * 'core.root_path', $this->phpbb_root_path,
+ * 'core.php_ext', $this->php_ext,
+ * );
+ *
+ * @var array
+ */
+ protected $custom_parameters = null;
+
+ /**
+ * @var \phpbb\config_php_file
+ */
+ protected $config_php_file;
+
+ /**
+ * Constructor
+ *
+ * @param \phpbb\config_php_file $config_php_file
+ * @param string $phpbb_root_path Path to the phpbb includes directory.
+ * @param string $php_ext php file extension
+ */
+ function __construct(\phpbb\config_php_file $config_php_file, $phpbb_root_path, $php_ext)
+ {
+ $this->config_php_file = $config_php_file;
+ $this->phpbb_root_path = $phpbb_root_path;
+ $this->php_ext = $php_ext;
+ }
+
+ /**
+ * Build and return a new Container respecting the current configuration
+ *
+ * @return \phpbb_cache_container|ContainerBuilder
+ */
+ public function get_container()
+ {
+ $container_filename = $this->get_container_filename();
+ if (!defined('DEBUG_CONTAINER') && $this->dump_container && file_exists($container_filename))
+ {
+ require($container_filename);
+ $this->container = new \phpbb_cache_container();
+ }
+ else
+ {
+ if ($this->config_path === null)
+ {
+ $this->config_path = $this->phpbb_root_path . 'config';
+ }
+ $container_extensions = array(new \phpbb\di\extension\core($this->config_path));
+
+ if ($this->use_extensions)
+ {
+ $installed_exts = $this->get_installed_extensions();
+ $container_extensions[] = new \phpbb\di\extension\ext($installed_exts);
+ }
+
+ if ($this->inject_config)
+ {
+ $container_extensions[] = new \phpbb\di\extension\config($this->config_php_file);
+ }
+
+ $this->container = $this->create_container($container_extensions);
+
+ if ($this->use_custom_pass)
+ {
+ // Symfony Kernel Listeners
+ $this->container->addCompilerPass(new \phpbb\di\pass\collection_pass());
+ $this->container->addCompilerPass(new RegisterListenersPass('dispatcher', 'event.listener_listener', 'event.listener'));
+
+ if ($this->use_kernel_pass)
+ {
+ $this->container->addCompilerPass(new RegisterListenersPass('dispatcher'));
+ }
+ }
+
+ $this->inject_custom_parameters();
+
+ if ($this->compile_container)
+ {
+ $this->container->compile();
+ }
+
+ if ($this->dump_container && !defined('DEBUG_CONTAINER'))
+ {
+ $this->dump_container($container_filename);
+ }
+ }
+
+ $this->container->set('config.php', $this->config_php_file);
+ $this->inject_dbal_driver();
+
+ if ($this->compile_container)
+ {
+ $this->inject_dbal();
+ }
+
+ return $this->container;
+ }
+
+ /**
+ * Set if the extensions should be used.
+ *
+ * @param bool $use_extensions
+ */
+ public function set_use_extensions($use_extensions)
+ {
+ $this->use_extensions = $use_extensions;
+ }
+
+ /**
+ * Set if the phpBB compile pass have to be used.
+ *
+ * @param bool $use_custom_pass
+ */
+ public function set_use_custom_pass($use_custom_pass)
+ {
+ $this->use_custom_pass = $use_custom_pass;
+ }
+
+ /**
+ * Set if the kernel compile pass have to be used.
+ *
+ * @param bool $use_kernel_pass
+ */
+ public function set_use_kernel_pass($use_kernel_pass)
+ {
+ $this->use_kernel_pass = $use_kernel_pass;
+ }
+
+ /**
+ * Set if the php config file should be injecting into the container.
+ *
+ * @param bool $inject_config
+ */
+ public function set_inject_config($inject_config)
+ {
+ $this->inject_config = $inject_config;
+ }
+
+ /**
+ * Set if a dump container should be used.
+ *
+ * If DEBUG_CONTAINER is set this option is ignored and a new container is build.
+ *
+ * @var bool $dump_container
+ */
+ public function set_dump_container($dump_container)
+ {
+ $this->dump_container = $dump_container;
+ }
+
+ /**
+ * Set if the container should be compiled automatically (default to true).
+ *
+ * @var bool $dump_container
+ */
+ public function set_compile_container($compile_container)
+ {
+ $this->compile_container = $compile_container;
+ }
+
+ /**
+ * Set a custom path to find the configuration of the container
+ *
+ * @param string $config_path
+ */
+ public function set_config_path($config_path)
+ {
+ $this->config_path = $config_path;
+ }
+
+ /**
+ * Set custom parameters to inject into the container.
+ *
+ * @param array $custom_parameters
+ */
+ public function set_custom_parameters($custom_parameters)
+ {
+ $this->custom_parameters = $custom_parameters;
+ }
+
+ /**
+ * Dump the container to the disk.
+ *
+ * @param string $container_filename The name of the file.
+ */
+ protected function dump_container($container_filename)
+ {
+ $dumper = new PhpDumper($this->container);
+ $cached_container_dump = $dumper->dump(array(
+ 'class' => 'phpbb_cache_container',
+ 'base_class' => 'Symfony\\Component\\DependencyInjection\\ContainerBuilder',
+ ));
+
+ file_put_contents($container_filename, $cached_container_dump);
+ }
+
+ /**
+ * Inject the connection into the container if one was opened.
+ */
+ protected function inject_dbal()
+ {
+ if ($this->dbal_connection !== null)
+ {
+ $this->container->get('dbal.conn')->set_driver($this->dbal_connection);
+ }
+ }
+
+ /**
+ * Inject the dbal connection driver into container
+ */
+ protected function inject_dbal_driver()
+ {
+ $config_data = $this->config_php_file->get_all();
+ if (!empty($config_data))
+ {
+ $this->container->set('dbal.conn.driver', $this->get_dbal_connection());
+ }
+ }
+
+ /**
+ * Get DB connection.
+ *
+ * @return \phpbb\db\driver\driver_interface
+ */
+ protected function get_dbal_connection()
+ {
+ if ($this->dbal_connection === null)
+ {
+ $dbal_driver_class = $this->config_php_file->convert_30_dbms_to_31($this->config_php_file->get('dbms'));
+ $this->dbal_connection = new $dbal_driver_class();
+ $this->dbal_connection->sql_connect(
+ $this->config_php_file->get('dbhost'),
+ $this->config_php_file->get('dbuser'),
+ $this->config_php_file->get('dbpasswd'),
+ $this->config_php_file->get('dbname'),
+ $this->config_php_file->get('dbport'),
+ false,
+ defined('PHPBB_DB_NEW_LINK') && PHPBB_DB_NEW_LINK
+ );
+ }
+
+ return $this->dbal_connection;
+ }
+
+ /**
+ * Get enabled extensions.
+ *
+ * @return array enabled extensions
+ */
+ protected function get_installed_extensions()
+ {
+ $db = $this->get_dbal_connection();
+ $extension_table = $this->config_php_file->get('table_prefix') . 'ext';
+
+ $sql = 'SELECT *
+ FROM ' . $extension_table . '
+ WHERE ext_active = 1';
+
+ $result = $db->sql_query($sql);
+ $rows = $db->sql_fetchrowset($result);
+ $db->sql_freeresult($result);
+
+ $exts = array();
+ foreach ($rows as $row)
+ {
+ $exts[$row['ext_name']] = $this->phpbb_root_path . 'ext/' . $row['ext_name'] . '/';
+ }
+
+ return $exts;
+ }
+
+ /**
+ * Create the ContainerBuilder object
+ *
+ * @param array $extensions Array of Container extension objects
+ * @return ContainerBuilder object
+ */
+ protected function create_container(array $extensions)
+ {
+ $container = new ContainerBuilder();
+
+ foreach ($extensions as $extension)
+ {
+ $container->registerExtension($extension);
+ $container->loadFromExtension($extension->getAlias());
+ }
+
+ return $container;
+ }
+
+ /**
+ * Inject the customs parameters into the container
+ */
+ protected function inject_custom_parameters()
+ {
+ if ($this->custom_parameters === null)
+ {
+ $this->custom_parameters = array(
+ 'core.root_path' => $this->phpbb_root_path,
+ 'core.php_ext' => $this->php_ext,
+ );
+ }
+
+ foreach ($this->custom_parameters as $key => $value)
+ {
+ $this->container->setParameter($key, $value);
+ }
+ }
+
+ /**
+ * Get the filename under which the dumped container will be stored.
+ *
+ * @return string Path for dumped container
+ */
+ protected function get_container_filename()
+ {
+ return $this->phpbb_root_path . 'cache/container_' . md5($this->phpbb_root_path) . '.' . $this->php_ext;
+ }
+}
diff --git a/phpBB/phpbb/di/extension/config.php b/phpBB/phpbb/di/extension/config.php
new file mode 100644
index 0000000000..8c9de48823
--- /dev/null
+++ b/phpBB/phpbb/di/extension/config.php
@@ -0,0 +1,83 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\di\extension;
+
+use Symfony\Component\DependencyInjection\ContainerBuilder;
+use Symfony\Component\HttpKernel\DependencyInjection\Extension;
+
+/**
+* Container config extension
+*/
+class config extends Extension
+{
+ /** @var array */
+ protected $config_php;
+
+ public function __construct(\phpbb\config_php_file $config_php)
+ {
+ $this->config_php = $config_php;
+ }
+
+ /**
+ * Loads a specific configuration.
+ *
+ * @param array $config An array of configuration values
+ * @param ContainerBuilder $container A ContainerBuilder instance
+ *
+ * @throws \InvalidArgumentException When provided tag is not defined in this extension
+ */
+ public function load(array $config, ContainerBuilder $container)
+ {
+ $parameters = array(
+ 'core.adm_relative_path' => $this->config_php->get('phpbb_adm_relative_path') ? $this->config_php->get('phpbb_adm_relative_path') : 'adm/',
+ 'core.table_prefix' => $this->config_php->get('table_prefix'),
+ 'cache.driver.class' => $this->convert_30_acm_type($this->config_php->get('acm_type')),
+ 'dbal.new_link' => defined('PHPBB_DB_NEW_LINK') && PHPBB_DB_NEW_LINK,
+ );
+ $parameter_bag = $container->getParameterBag();
+
+ foreach ($parameters as $parameter => $value)
+ {
+ $container->setParameter($parameter, $parameter_bag->escapeValue($value));
+ }
+ }
+
+ /**
+ * Returns the recommended alias to use in XML.
+ *
+ * This alias is also the mandatory prefix to use when using YAML.
+ *
+ * @return string The alias
+ */
+ public function getAlias()
+ {
+ return 'config';
+ }
+
+ /**
+ * Convert 3.0 ACM type to 3.1 cache driver class name
+ *
+ * @param string $acm_type ACM type
+ * @return string cache driver class
+ */
+ protected function convert_30_acm_type($acm_type)
+ {
+ if (preg_match('#^[a-z]+$#', $acm_type))
+ {
+ return 'phpbb\\cache\\driver\\' . $acm_type;
+ }
+
+ return $acm_type;
+ }
+}
diff --git a/phpBB/phpbb/di/extension/core.php b/phpBB/phpbb/di/extension/core.php
new file mode 100644
index 0000000000..ca4fa5c082
--- /dev/null
+++ b/phpBB/phpbb/di/extension/core.php
@@ -0,0 +1,67 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\di\extension;
+
+use Symfony\Component\DependencyInjection\ContainerBuilder;
+use Symfony\Component\HttpKernel\DependencyInjection\Extension;
+use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
+use Symfony\Component\Config\FileLocator;
+
+/**
+* Container core extension
+*/
+class core extends Extension
+{
+ /**
+ * Config path
+ * @var string
+ */
+ protected $config_path;
+
+ /**
+ * Constructor
+ *
+ * @param string $config_path Config path
+ */
+ public function __construct($config_path)
+ {
+ $this->config_path = $config_path;
+ }
+
+ /**
+ * Loads a specific configuration.
+ *
+ * @param array $config An array of configuration values
+ * @param ContainerBuilder $container A ContainerBuilder instance
+ *
+ * @throws \InvalidArgumentException When provided tag is not defined in this extension
+ */
+ public function load(array $config, ContainerBuilder $container)
+ {
+ $loader = new YamlFileLoader($container, new FileLocator(phpbb_realpath($this->config_path)));
+ $loader->load('services.yml');
+ }
+
+ /**
+ * Returns the recommended alias to use in XML.
+ *
+ * This alias is also the mandatory prefix to use when using YAML.
+ *
+ * @return string The alias
+ */
+ public function getAlias()
+ {
+ return 'core';
+ }
+}
diff --git a/phpBB/phpbb/di/extension/ext.php b/phpBB/phpbb/di/extension/ext.php
new file mode 100644
index 0000000000..718c992d2e
--- /dev/null
+++ b/phpBB/phpbb/di/extension/ext.php
@@ -0,0 +1,67 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\di\extension;
+
+use Symfony\Component\DependencyInjection\ContainerBuilder;
+use Symfony\Component\HttpKernel\DependencyInjection\Extension;
+use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
+use Symfony\Component\Config\FileLocator;
+
+/**
+* Container ext extension
+*/
+class ext extends Extension
+{
+ protected $paths = array();
+
+ public function __construct($enabled_extensions)
+ {
+ foreach ($enabled_extensions as $ext => $path)
+ {
+ $this->paths[] = $path;
+ }
+ }
+
+ /**
+ * Loads a specific configuration.
+ *
+ * @param array $config An array of configuration values
+ * @param ContainerBuilder $container A ContainerBuilder instance
+ *
+ * @throws \InvalidArgumentException When provided tag is not defined in this extension
+ */
+ public function load(array $config, ContainerBuilder $container)
+ {
+ foreach ($this->paths as $path)
+ {
+ if (file_exists($path . '/config/services.yml'))
+ {
+ $loader = new YamlFileLoader($container, new FileLocator(phpbb_realpath($path . '/config')));
+ $loader->load('services.yml');
+ }
+ }
+ }
+
+ /**
+ * Returns the recommended alias to use in XML.
+ *
+ * This alias is also the mandatory prefix to use when using YAML.
+ *
+ * @return string The alias
+ */
+ public function getAlias()
+ {
+ return 'ext';
+ }
+}
diff --git a/phpBB/phpbb/di/pass/collection_pass.php b/phpBB/phpbb/di/pass/collection_pass.php
new file mode 100644
index 0000000000..a5c054674e
--- /dev/null
+++ b/phpBB/phpbb/di/pass/collection_pass.php
@@ -0,0 +1,44 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\di\pass;
+
+use Symfony\Component\DependencyInjection\ContainerBuilder;
+use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
+
+/**
+* Appends an add method call to the definition of each collection service for
+* the services tagged with the appropriate name defined in the collection's
+* service_collection tag.
+*/
+class collection_pass implements CompilerPassInterface
+{
+ /**
+ * Modify the container before it is passed to the rest of the code
+ *
+ * @param ContainerBuilder $container ContainerBuilder object
+ * @return null
+ */
+ public function process(ContainerBuilder $container)
+ {
+ foreach ($container->findTaggedServiceIds('service_collection') as $id => $data)
+ {
+ $definition = $container->getDefinition($id);
+
+ foreach ($container->findTaggedServiceIds($data[0]['tag']) as $service_id => $service_data)
+ {
+ $definition->addMethodCall('add', array($service_id));
+ }
+ }
+ }
+}
diff --git a/phpBB/phpbb/di/service_collection.php b/phpBB/phpbb/di/service_collection.php
new file mode 100644
index 0000000000..82ca9bf679
--- /dev/null
+++ b/phpBB/phpbb/di/service_collection.php
@@ -0,0 +1,79 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\di;
+
+use Symfony\Component\DependencyInjection\ContainerInterface;
+
+/**
+* Collection of services to be configured at container compile time.
+*/
+class service_collection extends \ArrayObject
+{
+ /**
+ * @var \Symfony\Component\DependencyInjection\ContainerInterface
+ */
+ protected $container;
+
+ /**
+ * Constructor
+ *
+ * @param ContainerInterface $container Container object
+ */
+ public function __construct(ContainerInterface $container)
+ {
+ $this->container = $container;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getIterator()
+ {
+ return new service_collection_iterator($this);
+ }
+
+ // Because of a PHP issue we have to redefine offsetExists
+ // (even with a call to the parent):
+ // https://bugs.php.net/bug.php?id=66834
+ // https://bugs.php.net/bug.php?id=67067
+ // But it triggers a sniffer issue that we have to skip
+ // @codingStandardsIgnoreStart
+ /**
+ * {@inheritdoc}
+ */
+ public function offsetExists($index)
+ {
+ return parent::offsetExists($index);
+ }
+ // @codingStandardsIgnoreEnd
+
+ /**
+ * {@inheritdoc}
+ */
+ public function offsetGet($index)
+ {
+ return $this->container->get($index);
+ }
+
+ /**
+ * Add a service to the collection
+ *
+ * @param string $name The service name
+ * @return null
+ */
+ public function add($name)
+ {
+ $this->offsetSet($name, null);
+ }
+}
diff --git a/phpBB/phpbb/di/service_collection_iterator.php b/phpBB/phpbb/di/service_collection_iterator.php
new file mode 100644
index 0000000000..0d031ab52d
--- /dev/null
+++ b/phpBB/phpbb/di/service_collection_iterator.php
@@ -0,0 +1,46 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\di;
+
+/**
+* Iterator which loads the services when they are requested
+*/
+class service_collection_iterator extends \ArrayIterator
+{
+ /**
+ * @var \phpbb\di\service_collection
+ */
+ protected $collection;
+
+ /**
+ * Construct an ArrayIterator for service_collection
+ *
+ * @param \phpbb\di\service_collection $collection The collection to iterate over
+ * @param int $flags Flags to control the behaviour of the ArrayObject object.
+ * @see ArrayObject::setFlags()
+ */
+ public function __construct(service_collection $collection, $flags = 0)
+ {
+ parent::__construct($collection, $flags);
+ $this->collection = $collection;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function current()
+ {
+ return $this->collection->offsetGet($this->key());
+ }
+}
diff --git a/phpBB/phpbb/error_collector.php b/phpBB/phpbb/error_collector.php
new file mode 100644
index 0000000000..bf8efd1065
--- /dev/null
+++ b/phpBB/phpbb/error_collector.php
@@ -0,0 +1,73 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb;
+
+class error_collector
+{
+ var $errors;
+ var $error_types;
+
+ /**
+ * Constructor.
+ *
+ * The variable $error_types may be set to a mask of PHP error types that
+ * the collector should keep, e.g. `E_ALL`. If unset, the current value of
+ * the error_reporting() function will be used to determine which errors
+ * the collector will keep.
+ *
+ * @see PHPBB3-13306
+ * @param int|null $error_types
+ */
+ function __construct($error_types = null)
+ {
+ $this->errors = array();
+ $this->error_types = $error_types;
+ }
+
+ function install()
+ {
+ set_error_handler(array(&$this, 'error_handler'), ($this->error_types !== null) ? $this->error_types : error_reporting());
+ }
+
+ function uninstall()
+ {
+ restore_error_handler();
+ }
+
+ function error_handler($errno, $msg_text, $errfile, $errline)
+ {
+ $this->errors[] = array($errno, $msg_text, $errfile, $errline);
+ }
+
+ function format_errors()
+ {
+ $text = '';
+ foreach ($this->errors as $error)
+ {
+ if (!empty($text))
+ {
+ $text .= "<br />\n";
+ }
+
+ list($errno, $msg_text, $errfile, $errline) = $error;
+
+ // Prevent leakage of local path to phpBB install
+ $errfile = phpbb_filter_root_path($errfile);
+
+ $text .= "Errno $errno: $msg_text at $errfile line $errline";
+ }
+
+ return $text;
+ }
+}
diff --git a/phpBB/phpbb/event/data.php b/phpBB/phpbb/event/data.php
new file mode 100644
index 0000000000..c7365aee35
--- /dev/null
+++ b/phpBB/phpbb/event/data.php
@@ -0,0 +1,66 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\event;
+
+use Symfony\Component\EventDispatcher\Event;
+
+class data extends Event implements \ArrayAccess
+{
+ private $data;
+
+ public function __construct(array $data = array())
+ {
+ $this->set_data($data);
+ }
+
+ public function set_data(array $data = array())
+ {
+ $this->data = $data;
+ }
+
+ public function get_data()
+ {
+ return $this->data;
+ }
+
+ /**
+ * Returns data filtered to only include specified keys.
+ *
+ * This effectively discards any keys added to data by hooks.
+ */
+ public function get_data_filtered($keys)
+ {
+ return array_intersect_key($this->data, array_flip($keys));
+ }
+
+ public function offsetExists($offset)
+ {
+ return isset($this->data[$offset]);
+ }
+
+ public function offsetGet($offset)
+ {
+ return isset($this->data[$offset]) ? $this->data[$offset] : null;
+ }
+
+ public function offsetSet($offset, $value)
+ {
+ $this->data[$offset] = $value;
+ }
+
+ public function offsetUnset($offset)
+ {
+ unset($this->data[$offset]);
+ }
+}
diff --git a/phpBB/phpbb/event/dispatcher.php b/phpBB/phpbb/event/dispatcher.php
new file mode 100644
index 0000000000..1c4abeb108
--- /dev/null
+++ b/phpBB/phpbb/event/dispatcher.php
@@ -0,0 +1,78 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\event;
+
+use Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher;
+use Symfony\Component\EventDispatcher\Event;
+
+/**
+* Extension of the Symfony2 EventDispatcher
+*
+* It provides an additional `trigger_event` method, which
+* gives some syntactic sugar for dispatching events. Instead
+* of creating the event object, the method will do that for
+* you.
+*
+* Example:
+*
+* $vars = array('page_title');
+* extract($phpbb_dispatcher->trigger_event('core.index', compact($vars)));
+*
+*/
+class dispatcher extends ContainerAwareEventDispatcher implements dispatcher_interface
+{
+ /**
+ * @var bool
+ */
+ protected $disabled = false;
+
+ /**
+ * {@inheritdoc}
+ */
+ public function trigger_event($eventName, $data = array())
+ {
+ $event = new \phpbb\event\data($data);
+ $this->dispatch($eventName, $event);
+ return $event->get_data_filtered(array_keys($data));
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function dispatch($eventName, Event $event = null)
+ {
+ if ($this->disabled)
+ {
+ return $event;
+ }
+
+ return parent::dispatch($eventName, $event);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function disable()
+ {
+ $this->disabled = true;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function enable()
+ {
+ $this->disabled = false;
+ }
+}
diff --git a/phpBB/phpbb/event/dispatcher_interface.php b/phpBB/phpbb/event/dispatcher_interface.php
new file mode 100644
index 0000000000..c66aa98260
--- /dev/null
+++ b/phpBB/phpbb/event/dispatcher_interface.php
@@ -0,0 +1,50 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\event;
+
+/**
+* Extension of the Symfony2 EventDispatcher
+*
+* It provides an additional `trigger_event` method, which
+* gives some syntactic sugar for dispatching events. Instead
+* of creating the event object, the method will do that for
+* you.
+*
+* Example:
+*
+* $vars = array('page_title');
+* extract($phpbb_dispatcher->trigger_event('core.index', compact($vars)));
+*
+*/
+interface dispatcher_interface extends \Symfony\Component\EventDispatcher\EventDispatcherInterface
+{
+ /**
+ * Construct and dispatch an event
+ *
+ * @param string $eventName The event name
+ * @param array $data An array containing the variables sending with the event
+ * @return mixed
+ */
+ public function trigger_event($eventName, $data = array());
+
+ /**
+ * Disable the event dispatcher.
+ */
+ public function disable();
+
+ /**
+ * Enable the event dispatcher.
+ */
+ public function enable();
+}
diff --git a/phpBB/phpbb/event/kernel_exception_subscriber.php b/phpBB/phpbb/event/kernel_exception_subscriber.php
new file mode 100644
index 0000000000..1ee771cfe7
--- /dev/null
+++ b/phpBB/phpbb/event/kernel_exception_subscriber.php
@@ -0,0 +1,123 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\event;
+
+use Symfony\Component\EventDispatcher\EventSubscriberInterface;
+use Symfony\Component\HttpFoundation\JsonResponse;
+use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface;
+use Symfony\Component\HttpKernel\KernelEvents;
+use Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent;
+use Symfony\Component\HttpFoundation\Response;
+
+class kernel_exception_subscriber implements EventSubscriberInterface
+{
+ /**
+ * Template object
+ * @var \phpbb\template\template
+ */
+ protected $template;
+
+ /**
+ * User object
+ * @var \phpbb\user
+ */
+ protected $user;
+
+ /** @var \phpbb\request\type_cast_helper */
+ protected $type_caster;
+
+ /**
+ * Construct method
+ *
+ * @param \phpbb\template\template $template Template object
+ * @param \phpbb\user $user User object
+ */
+ public function __construct(\phpbb\template\template $template, \phpbb\user $user)
+ {
+ $this->template = $template;
+ $this->user = $user;
+ $this->type_caster = new \phpbb\request\type_cast_helper();
+ }
+
+ /**
+ * This listener is run when the KernelEvents::EXCEPTION event is triggered
+ *
+ * @param GetResponseForExceptionEvent $event
+ * @return null
+ */
+ public function on_kernel_exception(GetResponseForExceptionEvent $event)
+ {
+ $exception = $event->getException();
+
+ $message = $exception->getMessage();
+ $this->type_caster->set_var($message, $message, 'string', true, false);
+
+ if ($exception instanceof \phpbb\exception\exception_interface)
+ {
+ $message = call_user_func_array(array($this->user, 'lang'), array_merge(array($message), $exception->get_parameters()));
+ }
+
+ // Show <strong> text in bold
+ $message = preg_replace('#&lt;(/?strong)&gt;#i', '<$1>', $message);
+
+ if (!$event->getRequest()->isXmlHttpRequest())
+ {
+ page_header($this->user->lang('INFORMATION'));
+
+ $this->template->assign_vars(array(
+ 'MESSAGE_TITLE' => $this->user->lang('INFORMATION'),
+ 'MESSAGE_TEXT' => $message,
+ ));
+
+ $this->template->set_filenames(array(
+ 'body' => 'message_body.html',
+ ));
+
+ page_footer(true, false, false);
+
+ $response = new Response($this->template->assign_display('body'), 500);
+ }
+ else
+ {
+ $data = array();
+
+ if (!empty($message))
+ {
+ $data['message'] = $message;
+ }
+
+ if (defined('DEBUG'))
+ {
+ $data['trace'] = $exception->getTrace();
+ }
+
+ $response = new JsonResponse($data, 500);
+ }
+
+ if ($exception instanceof HttpExceptionInterface)
+ {
+ $response->setStatusCode($exception->getStatusCode());
+ $response->headers->add($exception->getHeaders());
+ }
+
+ $event->setResponse($response);
+ }
+
+ public static function getSubscribedEvents()
+ {
+ return array(
+ KernelEvents::EXCEPTION => 'on_kernel_exception',
+ );
+ }
+}
diff --git a/phpBB/phpbb/event/kernel_request_subscriber.php b/phpBB/phpbb/event/kernel_request_subscriber.php
new file mode 100644
index 0000000000..ee9f29a59d
--- /dev/null
+++ b/phpBB/phpbb/event/kernel_request_subscriber.php
@@ -0,0 +1,82 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\event;
+
+use Symfony\Component\EventDispatcher\EventSubscriberInterface;
+use Symfony\Component\HttpKernel\KernelEvents;
+use Symfony\Component\HttpKernel\Event\GetResponseEvent;
+use Symfony\Component\HttpKernel\EventListener\RouterListener;
+use Symfony\Component\Routing\RequestContext;
+
+class kernel_request_subscriber implements EventSubscriberInterface
+{
+ /**
+ * Extension manager object
+ * @var \phpbb\extension\manager
+ */
+ protected $manager;
+
+ /**
+ * PHP file extension
+ * @var string
+ */
+ protected $php_ext;
+
+ /**
+ * Root path
+ * @var string
+ */
+ protected $root_path;
+
+ /**
+ * Construct method
+ *
+ * @param \phpbb\extension\manager $manager Extension manager object
+ * @param string $root_path Root path
+ * @param string $php_ext PHP file extension
+ */
+ public function __construct(\phpbb\extension\manager $manager, $root_path, $php_ext)
+ {
+ $this->root_path = $root_path;
+ $this->php_ext = $php_ext;
+ $this->manager = $manager;
+ }
+
+ /**
+ * This listener is run when the KernelEvents::REQUEST event is triggered
+ *
+ * This is responsible for setting up the routing information
+ *
+ * @param GetResponseEvent $event
+ * @throws \BadMethodCallException
+ * @return null
+ */
+ public function on_kernel_request(GetResponseEvent $event)
+ {
+ $request = $event->getRequest();
+ $context = new RequestContext();
+ $context->fromRequest($request);
+
+ $matcher = phpbb_get_url_matcher($this->manager, $context, $this->root_path, $this->php_ext);
+ $router_listener = new RouterListener($matcher, $context);
+ $router_listener->onKernelRequest($event);
+ }
+
+ public static function getSubscribedEvents()
+ {
+ return array(
+ KernelEvents::REQUEST => 'on_kernel_request',
+ );
+ }
+}
diff --git a/phpBB/phpbb/event/kernel_terminate_subscriber.php b/phpBB/phpbb/event/kernel_terminate_subscriber.php
new file mode 100644
index 0000000000..3a709f73fd
--- /dev/null
+++ b/phpBB/phpbb/event/kernel_terminate_subscriber.php
@@ -0,0 +1,41 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\event;
+
+use Symfony\Component\EventDispatcher\EventSubscriberInterface;
+use Symfony\Component\HttpKernel\KernelEvents;
+use Symfony\Component\HttpKernel\Event\PostResponseEvent;
+
+class kernel_terminate_subscriber implements EventSubscriberInterface
+{
+ /**
+ * This listener is run when the KernelEvents::TERMINATE event is triggered
+ * This comes after a Response has been sent to the server; this is
+ * primarily cleanup stuff.
+ *
+ * @param PostResponseEvent $event
+ * @return null
+ */
+ public function on_kernel_terminate(PostResponseEvent $event)
+ {
+ exit_handler();
+ }
+
+ public static function getSubscribedEvents()
+ {
+ return array(
+ KernelEvents::TERMINATE => array('on_kernel_terminate', ~PHP_INT_MAX),
+ );
+ }
+}
diff --git a/phpBB/phpbb/event/md_exporter.php b/phpBB/phpbb/event/md_exporter.php
new file mode 100644
index 0000000000..02c2a1b9d6
--- /dev/null
+++ b/phpBB/phpbb/event/md_exporter.php
@@ -0,0 +1,565 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\event;
+
+/**
+* Crawls through a markdown file and grabs all events
+*/
+class md_exporter
+{
+ /** @var string Path where we look for files*/
+ protected $path;
+
+ /** @var string phpBB Root Path */
+ protected $root_path;
+
+ /** @var string The minimum version for the events to return */
+ protected $min_version;
+
+ /** @var string The maximum version for the events to return */
+ protected $max_version;
+
+ /** @var string */
+ protected $filter;
+
+ /** @var string */
+ protected $current_event;
+
+ /** @var array */
+ protected $events;
+
+ /**
+ * @param string $phpbb_root_path
+ * @param mixed $extension String 'vendor/ext' to filter, null for phpBB core
+ * @param string $min_version
+ * @param string $max_version
+ */
+ public function __construct($phpbb_root_path, $extension = null, $min_version = null, $max_version = null)
+ {
+ $this->root_path = $phpbb_root_path;
+ $this->path = $this->root_path;
+ if ($extension)
+ {
+ $this->path .= 'ext/' . $extension . '/';
+ }
+
+ $this->events = array();
+ $this->events_by_file = array();
+ $this->filter = $this->current_event = '';
+ $this->min_version = $min_version;
+ $this->max_version = $max_version;
+ }
+
+ /**
+ * Get the list of all events
+ *
+ * @return array Array with events: name => details
+ */
+ public function get_events()
+ {
+ return $this->events;
+ }
+
+ /**
+ * @param string $md_file Relative from phpBB root
+ * @return int Number of events found
+ * @throws \LogicException
+ */
+ public function crawl_phpbb_directory_adm($md_file)
+ {
+ $this->crawl_eventsmd($md_file, 'adm');
+
+ $file_list = $this->get_recursive_file_list($this->path . 'adm/style/');
+ foreach ($file_list as $file)
+ {
+ $file_name = 'adm/style/' . $file;
+ $this->validate_events_from_file($file_name, $this->crawl_file_for_events($file_name));
+ }
+
+ return sizeof($this->events);
+ }
+
+ /**
+ * @param string $md_file Relative from phpBB root
+ * @return int Number of events found
+ * @throws \LogicException
+ */
+ public function crawl_phpbb_directory_styles($md_file)
+ {
+ $this->crawl_eventsmd($md_file, 'styles');
+
+ $styles = array('prosilver', 'subsilver2');
+ foreach ($styles as $style)
+ {
+ $file_list = $this->get_recursive_file_list(
+ $this->path . 'styles/' . $style . '/template/'
+ );
+
+ foreach ($file_list as $file)
+ {
+ $file_name = 'styles/' . $style . '/template/' . $file;
+ $this->validate_events_from_file($file_name, $this->crawl_file_for_events($file_name));
+ }
+ }
+
+ return sizeof($this->events);
+ }
+
+ /**
+ * @param string $md_file Relative from phpBB root
+ * @param string $filter Should be 'styles' or 'adm'
+ * @return int Number of events found
+ * @throws \LogicException
+ */
+ public function crawl_eventsmd($md_file, $filter)
+ {
+ if (!file_exists($this->path . $md_file))
+ {
+ throw new \LogicException("The event docs file '{$md_file}' could not be found");
+ }
+
+ $file_content = file_get_contents($this->path . $md_file);
+ $this->filter = $filter;
+
+ $events = explode("\n\n", $file_content);
+ foreach ($events as $event)
+ {
+ // Last row of the file
+ if (strpos($event, "\n===\n") === false)
+ {
+ continue;
+ }
+
+ list($event_name, $details) = explode("\n===\n", $event, 2);
+ $this->validate_event_name($event_name);
+ $this->current_event = $event_name;
+
+ if (isset($this->events[$this->current_event]))
+ {
+ throw new \LogicException("The event '{$this->current_event}' is defined multiple times");
+ }
+
+ if (($this->filter == 'adm' && strpos($this->current_event, 'acp_') !== 0)
+ || ($this->filter == 'styles' && strpos($this->current_event, 'acp_') === 0))
+ {
+ continue;
+ }
+
+ list($file_details, $details) = explode("\n* Since: ", $details, 2);
+
+ $changed_versions = array();
+ if (strpos($details, "\n* Changed: ") !== false)
+ {
+ list($since, $details) = explode("\n* Changed: ", $details, 2);
+ while (strpos($details, "\n* Changed: ") !== false)
+ {
+ list($changed, $details) = explode("\n* Changed: ", $details, 2);
+ $changed_versions[] = $changed;
+ }
+ list($changed, $description) = explode("\n* Purpose: ", $details, 2);
+ $changed_versions[] = $changed;
+ }
+ else
+ {
+ list($since, $description) = explode("\n* Purpose: ", $details, 2);
+ $changed_versions = array();
+ }
+
+ $files = $this->validate_file_list($file_details);
+ $since = $this->validate_since($since);
+ $changes = array();
+ foreach ($changed_versions as $changed)
+ {
+ list($changed_version, $changed_description) = $this->validate_changed($changed);
+
+ if (isset($changes[$changed_version]))
+ {
+ throw new \LogicException("Duplicate change information found for event '{$this->current_event}'");
+ }
+
+ $changes[$changed_version] = $changed_description;
+ }
+ $description = trim($description, "\n") . "\n";
+
+ if (!$this->version_is_filtered($since))
+ {
+ $is_filtered = false;
+ foreach ($changes as $version => $null)
+ {
+ if ($this->version_is_filtered($version))
+ {
+ $is_filtered = true;
+ break;
+ }
+ }
+
+ if (!$is_filtered)
+ {
+ continue;
+ }
+ }
+
+ $this->events[$event_name] = array(
+ 'event' => $this->current_event,
+ 'files' => $files,
+ 'since' => $since,
+ 'changed' => $changes,
+ 'description' => $description,
+ );
+ }
+
+ return sizeof($this->events);
+ }
+
+ /**
+ * The version to check
+ *
+ * @param string $version
+ * @return bool
+ */
+ protected function version_is_filtered($version)
+ {
+ return (!$this->min_version || phpbb_version_compare($this->min_version, $version, '<='))
+ && (!$this->max_version || phpbb_version_compare($this->max_version, $version, '>='));
+ }
+
+ /**
+ * Format the php events as a wiki table
+ *
+ * @param string $action
+ * @return string Number of events found
+ */
+ public function export_events_for_wiki($action = '')
+ {
+ if ($this->filter === 'adm')
+ {
+ if ($action === 'diff')
+ {
+ $wiki_page = '=== ACP Template Events ===' . "\n";
+ }
+ else
+ {
+ $wiki_page = '= ACP Template Events =' . "\n";
+ }
+ $wiki_page .= '{| class="zebra sortable" cellspacing="0" cellpadding="5"' . "\n";
+ $wiki_page .= '! Identifier !! Placement !! Added in Release !! Explanation' . "\n";
+ }
+ else
+ {
+ if ($action === 'diff')
+ {
+ $wiki_page = '=== Template Events ===' . "\n";
+ }
+ else
+ {
+ $wiki_page = '= Template Events =' . "\n";
+ }
+ $wiki_page .= '{| class="zebra sortable" cellspacing="0" cellpadding="5"' . "\n";
+ $wiki_page .= '! Identifier !! Prosilver Placement (If applicable) !! Subsilver Placement (If applicable) !! Added in Release !! Explanation' . "\n";
+ }
+
+ foreach ($this->events as $event_name => $event)
+ {
+ $wiki_page .= "|- id=\"{$event_name}\"\n";
+ $wiki_page .= "| [[#{$event_name}|{$event_name}]] || ";
+
+ if ($this->filter === 'adm')
+ {
+ $wiki_page .= implode(', ', $event['files']['adm']);
+ }
+ else
+ {
+ $wiki_page .= implode(', ', $event['files']['prosilver']) . ' || ' . implode(', ', $event['files']['subsilver2']);
+ }
+
+ $wiki_page .= " || {$event['since']} || " . str_replace("\n", ' ', $event['description']) . "\n";
+ }
+ $wiki_page .= '|}' . "\n";
+
+ return $wiki_page;
+ }
+
+ /**
+ * Validates a template event name
+ *
+ * @param $event_name
+ * @return null
+ * @throws \LogicException
+ */
+ public function validate_event_name($event_name)
+ {
+ if (!preg_match('#^([a-z][a-z0-9]*(?:_[a-z][a-z0-9]*)+)$#', $event_name))
+ {
+ throw new \LogicException("Invalid event name '{$event_name}'");
+ }
+ }
+
+ /**
+ * Validate "Since" Information
+ *
+ * @param string $since
+ * @return string
+ * @throws \LogicException
+ */
+ public function validate_since($since)
+ {
+ if (!$this->validate_version($since))
+ {
+ throw new \LogicException("Invalid since information found for event '{$this->current_event}'");
+ }
+
+ return $since;
+ }
+
+ /**
+ * Validate "Changed" Information
+ *
+ * @param string $changed
+ * @return string
+ * @throws \LogicException
+ */
+ public function validate_changed($changed)
+ {
+ if (strpos($changed, ' ') !== false)
+ {
+ list($version, $description) = explode(' ', $changed, 2);
+ }
+ else
+ {
+ $version = $changed;
+ $description = '';
+ }
+
+ if (!$this->validate_version($version))
+ {
+ throw new \LogicException("Invalid changed information found for event '{$this->current_event}'");
+ }
+
+ return array($version, $description);
+ }
+
+ /**
+ * Validate "version" Information
+ *
+ * @param string $version
+ * @return bool True if valid, false otherwise
+ */
+ public function validate_version($version)
+ {
+ return preg_match('#^\d+\.\d+\.\d+(?:-(?:a|b|RC|pl)\d+)?$#', $version);
+ }
+
+ /**
+ * Validate the files list
+ *
+ * @param string $file_details
+ * @return array
+ * @throws \LogicException
+ */
+ public function validate_file_list($file_details)
+ {
+ $files_list = array(
+ 'prosilver' => array(),
+ 'subsilver2' => array(),
+ 'adm' => array(),
+ );
+
+ // Multi file list
+ if (strpos($file_details, "* Locations:\n + ") === 0)
+ {
+ $file_details = substr($file_details, strlen("* Locations:\n + "));
+ $files = explode("\n + ", $file_details);
+ foreach ($files as $file)
+ {
+ if (!file_exists($this->path . $file) || substr($file, -5) !== '.html')
+ {
+ throw new \LogicException("Invalid file '{$file}' not found for event '{$this->current_event}'", 1);
+ }
+
+ if (($this->filter !== 'adm') && strpos($file, 'styles/prosilver/template/') === 0)
+ {
+ $files_list['prosilver'][] = substr($file, strlen('styles/prosilver/template/'));
+ }
+ else if (($this->filter !== 'adm') && strpos($file, 'styles/subsilver2/template/') === 0)
+ {
+ $files_list['subsilver2'][] = substr($file, strlen('styles/subsilver2/template/'));
+ }
+ else if (($this->filter === 'adm') && strpos($file, 'adm/style/') === 0)
+ {
+ $files_list['adm'][] = substr($file, strlen('adm/style/'));
+ }
+ else
+ {
+ throw new \LogicException("Invalid file '{$file}' not found for event '{$this->current_event}'", 2);
+ }
+
+ $this->events_by_file[$file][] = $this->current_event;
+ }
+ }
+ else if ($this->filter == 'adm')
+ {
+ $file = substr($file_details, strlen('* Location: '));
+ if (!file_exists($this->path . $file) || substr($file, -5) !== '.html')
+ {
+ throw new \LogicException("Invalid file '{$file}' not found for event '{$this->current_event}'", 1);
+ }
+
+ $files_list['adm'][] = substr($file, strlen('adm/style/'));
+
+ $this->events_by_file[$file][] = $this->current_event;
+ }
+ else
+ {
+ throw new \LogicException("Invalid file list found for event '{$this->current_event}'", 2);
+ }
+
+ return $files_list;
+ }
+
+ /**
+ * Get all template events in a template file
+ *
+ * @param string $file
+ * @return array
+ * @throws \LogicException
+ */
+ public function crawl_file_for_events($file)
+ {
+ if (!file_exists($this->path . $file))
+ {
+ throw new \LogicException("File '{$file}' does not exist", 1);
+ }
+
+ $event_list = array();
+ $file_content = file_get_contents($this->path . $file);
+
+ $events = explode('<!-- EVENT ', $file_content);
+ // Remove the code before the first event
+ array_shift($events);
+ foreach ($events as $event)
+ {
+ $event = explode(' -->', $event, 2);
+ $event_list[] = array_shift($event);
+ }
+
+ return $event_list;
+ }
+
+ /**
+ * Validates whether all events from $file are in the md file and vice-versa
+ *
+ * @param string $file
+ * @param array $events
+ * @return true
+ * @throws \LogicException
+ */
+ public function validate_events_from_file($file, array $events)
+ {
+ if (empty($this->events_by_file[$file]) && empty($events))
+ {
+ return true;
+ }
+ else if (empty($this->events_by_file[$file]))
+ {
+ $event_list = implode("', '", $events);
+ throw new \LogicException("File '{$file}' should not contain events, but contains: "
+ . "'{$event_list}'", 1);
+ }
+ else if (empty($events))
+ {
+ $event_list = implode("', '", $this->events_by_file[$file]);
+ throw new \LogicException("File '{$file}' contains no events, but should contain: "
+ . "'{$event_list}'", 1);
+ }
+
+ $missing_events_from_file = array();
+ foreach ($this->events_by_file[$file] as $event)
+ {
+ if (!in_array($event, $events))
+ {
+ $missing_events_from_file[] = $event;
+ }
+ }
+
+ if (!empty($missing_events_from_file))
+ {
+ $event_list = implode("', '", $missing_events_from_file);
+ throw new \LogicException("File '{$file}' does not contain events: '{$event_list}'", 2);
+ }
+
+ $missing_events_from_md = array();
+ foreach ($events as $event)
+ {
+ if (!in_array($event, $this->events_by_file[$file]))
+ {
+ $missing_events_from_md[] = $event;
+ }
+ }
+
+ if (!empty($missing_events_from_md))
+ {
+ $event_list = implode("', '", $missing_events_from_md);
+ throw new \LogicException("File '{$file}' contains additional events: '{$event_list}'", 3);
+ }
+
+ return true;
+ }
+
+ /**
+ * Returns a list of files in $dir
+ *
+ * Works recursive with any depth
+ *
+ * @param string $dir Directory to go through
+ * @return array List of files (including directories)
+ */
+ public function get_recursive_file_list($dir)
+ {
+ try
+ {
+ $iterator = new \RecursiveIteratorIterator(
+ new \phpbb\recursive_dot_prefix_filter_iterator(
+ new \RecursiveDirectoryIterator(
+ $dir,
+ \FilesystemIterator::SKIP_DOTS
+ )
+ ),
+ \RecursiveIteratorIterator::SELF_FIRST
+ );
+ }
+ catch (\Exception $e)
+ {
+ return array();
+ }
+
+ $files = array();
+ foreach ($iterator as $file_info)
+ {
+ /** @var \RecursiveDirectoryIterator $file_info */
+ if ($file_info->isDir())
+ {
+ continue;
+ }
+
+ $relative_path = $iterator->getInnerIterator()->getSubPathname();
+
+ if (substr($relative_path, -5) == '.html')
+ {
+ $files[] = str_replace(DIRECTORY_SEPARATOR, '/', $relative_path);
+ }
+ }
+
+ return $files;
+ }
+}
diff --git a/phpBB/phpbb/event/php_exporter.php b/phpBB/phpbb/event/php_exporter.php
new file mode 100644
index 0000000000..ae3553c558
--- /dev/null
+++ b/phpBB/phpbb/event/php_exporter.php
@@ -0,0 +1,718 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\event;
+
+/**
+* Class php_exporter
+* Crawls through a list of files and grabs all php-events
+*/
+class php_exporter
+{
+ /** @var string Path where we look for files*/
+ protected $path;
+
+ /** @var string phpBB Root Path */
+ protected $root_path;
+
+ /** @var string The minimum version for the events to return */
+ protected $min_version;
+
+ /** @var string The maximum version for the events to return */
+ protected $max_version;
+
+ /** @var string */
+ protected $current_file;
+
+ /** @var string */
+ protected $current_event;
+
+ /** @var int */
+ protected $current_event_line;
+
+ /** @var array */
+ protected $events;
+
+ /** @var array */
+ protected $file_lines;
+
+ /**
+ * @param string $phpbb_root_path
+ * @param mixed $extension String 'vendor/ext' to filter, null for phpBB core
+ * @param string $min_version
+ * @param string $max_version
+ */
+ public function __construct($phpbb_root_path, $extension = null, $min_version = null, $max_version = null)
+ {
+ $this->root_path = $phpbb_root_path;
+ $this->path = $phpbb_root_path;
+ $this->events = $this->file_lines = array();
+ $this->current_file = $this->current_event = '';
+ $this->current_event_line = 0;
+ $this->min_version = $min_version;
+ $this->max_version = $max_version;
+
+ $this->path = $this->root_path;
+ if ($extension)
+ {
+ $this->path .= 'ext/' . $extension . '/';
+ }
+ }
+
+ /**
+ * Get the list of all events
+ *
+ * @return array Array with events: name => details
+ */
+ public function get_events()
+ {
+ return $this->events;
+ }
+
+ /**
+ * Set current event data
+ *
+ * @param string $name Name of the current event (used for error messages)
+ * @param int $line Line where the current event is placed in
+ * @return null
+ */
+ public function set_current_event($name, $line)
+ {
+ $this->current_event = $name;
+ $this->current_event_line = $line;
+ }
+
+ /**
+ * Set the content of this file
+ *
+ * @param array $content Array with the lines of the file
+ * @return null
+ */
+ public function set_content($content)
+ {
+ $this->file_lines = $content;
+ }
+
+ /**
+ * Crawl the phpBB/ directory for php events
+ * @return int The number of events found
+ */
+ public function crawl_phpbb_directory_php()
+ {
+ $files = $this->get_recursive_file_list();
+ $this->events = array();
+ foreach ($files as $file)
+ {
+ $this->crawl_php_file($file);
+ }
+ ksort($this->events);
+
+ return sizeof($this->events);
+ }
+
+ /**
+ * Returns a list of files in $dir
+ *
+ * @return array List of files (including the path)
+ */
+ public function get_recursive_file_list()
+ {
+ try
+ {
+ $iterator = new \RecursiveIteratorIterator(
+ new \phpbb\event\recursive_event_filter_iterator(
+ new \RecursiveDirectoryIterator(
+ $this->path,
+ \FilesystemIterator::SKIP_DOTS
+ ),
+ $this->path
+ ),
+ \RecursiveIteratorIterator::LEAVES_ONLY
+ );
+ }
+ catch (\Exception $e)
+ {
+ return array();
+ }
+
+ $files = array();
+ foreach ($iterator as $file_info)
+ {
+ /** @var \RecursiveDirectoryIterator $file_info */
+ $relative_path = $iterator->getInnerIterator()->getSubPathname();
+ $files[] = str_replace(DIRECTORY_SEPARATOR, '/', $relative_path);
+ }
+
+ return $files;
+ }
+
+ /**
+ * Format the php events as a wiki table
+ *
+ * @param string $action
+ * @return string
+ */
+ public function export_events_for_wiki($action = '')
+ {
+ if ($action === 'diff')
+ {
+ $wiki_page = '=== PHP Events (Hook Locations) ===' . "\n";
+ }
+ else
+ {
+ $wiki_page = '= PHP Events (Hook Locations) =' . "\n";
+ }
+ $wiki_page .= '{| class="sortable zebra" cellspacing="0" cellpadding="5"' . "\n";
+ $wiki_page .= '! Identifier !! Placement !! Arguments !! Added in Release !! Explanation' . "\n";
+ foreach ($this->events as $event)
+ {
+ $wiki_page .= '|- id="' . $event['event'] . '"' . "\n";
+ $wiki_page .= '| [[#' . $event['event'] . '|' . $event['event'] . ']] || ' . $event['file'] . ' || ' . implode(', ', $event['arguments']) . ' || ' . $event['since'] . ' || ' . $event['description'] . "\n";
+ }
+ $wiki_page .= '|}' . "\n";
+
+ return $wiki_page;
+ }
+
+ /**
+ * @param string $file
+ * @return int Number of events found in this file
+ * @throws \LogicException
+ */
+ public function crawl_php_file($file)
+ {
+ $this->current_file = $file;
+ $this->file_lines = array();
+ $content = file_get_contents($this->path . $this->current_file);
+ $num_events_found = 0;
+
+ if (strpos($content, "dispatcher->trigger_event('") || strpos($content, "dispatcher->dispatch('"))
+ {
+ $this->set_content(explode("\n", $content));
+ for ($i = 0, $num_lines = sizeof($this->file_lines); $i < $num_lines; $i++)
+ {
+ $event_line = false;
+ $found_trigger_event = strpos($this->file_lines[$i], "dispatcher->trigger_event('");
+ $arguments = array();
+ if ($found_trigger_event !== false)
+ {
+ $event_line = $i;
+ $this->set_current_event($this->get_event_name($event_line, false), $event_line);
+
+ // Find variables of the event
+ $arguments = $this->get_vars_from_array();
+ $doc_vars = $this->get_vars_from_docblock();
+ $this->validate_vars_docblock_array($arguments, $doc_vars);
+ }
+ else
+ {
+ $found_dispatch = strpos($this->file_lines[$i], "dispatcher->dispatch('");
+ if ($found_dispatch !== false)
+ {
+ $event_line = $i;
+ $this->set_current_event($this->get_event_name($event_line, true), $event_line);
+ }
+ }
+
+ if ($event_line)
+ {
+ // Validate @event
+ $event_line_num = $this->find_event();
+ $this->validate_event($this->current_event, $this->file_lines[$event_line_num]);
+
+ // Validate @since
+ $since_line_num = $this->find_since();
+ $since = $this->validate_since($this->file_lines[$since_line_num]);
+
+ $changed_line_nums = $this->find_changed('changed');
+ if (empty($changed_line_nums))
+ {
+ $changed_line_nums = $this->find_changed('change');
+ }
+ $changed_versions = array();
+ if (!empty($changed_line_nums))
+ {
+ foreach ($changed_line_nums as $changed_line_num)
+ {
+ $changed_versions[] = $this->validate_changed($this->file_lines[$changed_line_num]);
+ }
+ }
+
+ if (!$this->version_is_filtered($since))
+ {
+ $valid_version = false;
+ foreach ($changed_versions as $changed)
+ {
+ $valid_version = $valid_version || $this->version_is_filtered($changed);
+ }
+
+ if (!$valid_version)
+ {
+ continue;
+ }
+ }
+
+ // Find event description line
+ $description_line_num = $this->find_description();
+ $description = substr(trim($this->file_lines[$description_line_num]), strlen('* '));
+
+ if (isset($this->events[$this->current_event]))
+ {
+ throw new \LogicException("The event '{$this->current_event}' from file "
+ . "'{$this->current_file}:{$event_line_num}' already exists in file "
+ . "'{$this->events[$this->current_event]['file']}'", 10);
+ }
+
+ sort($arguments);
+ $this->events[$this->current_event] = array(
+ 'event' => $this->current_event,
+ 'file' => $this->current_file,
+ 'arguments' => $arguments,
+ 'since' => $since,
+ 'description' => $description,
+ );
+ $num_events_found++;
+ }
+ }
+ }
+
+ return $num_events_found;
+ }
+
+ /**
+ * The version to check
+ *
+ * @param string $version
+ * @return bool
+ */
+ protected function version_is_filtered($version)
+ {
+ return (!$this->min_version || phpbb_version_compare($this->min_version, $version, '<='))
+ && (!$this->max_version || phpbb_version_compare($this->max_version, $version, '>='));
+ }
+
+ /**
+ * Find the name of the event inside the dispatch() line
+ *
+ * @param int $event_line
+ * @param bool $is_dispatch Do we look for dispatch() or trigger_event() ?
+ * @return string Name of the event
+ * @throws \LogicException
+ */
+ public function get_event_name($event_line, $is_dispatch)
+ {
+ $event_text_line = $this->file_lines[$event_line];
+ $event_text_line = ltrim($event_text_line, "\t ");
+
+ if ($is_dispatch)
+ {
+ $regex = '#\$([a-z](?:[a-z0-9_]|->)*)';
+ $regex .= '->dispatch\(';
+ $regex .= '\'' . $this->preg_match_event_name() . '\'';
+ $regex .= '\);#';
+ }
+ else
+ {
+ $regex = '#extract\(\$([a-z](?:[a-z0-9_]|->)*)';
+ $regex .= '->trigger_event\(';
+ $regex .= '\'' . $this->preg_match_event_name() . '\'';
+ $regex .= ', compact\(\$vars\)\)\);#';
+ }
+
+ $match = array();
+ preg_match($regex, $event_text_line, $match);
+ if (!isset($match[2]))
+ {
+ throw new \LogicException("Can not find event name in line '{$event_text_line}' "
+ . "in file '{$this->current_file}:{$event_line}'", 1);
+ }
+
+ return $match[2];
+ }
+
+ /**
+ * Returns a regex match for the event name
+ *
+ * @return string
+ */
+ protected function preg_match_event_name()
+ {
+ return '([a-z][a-z0-9_]*(?:\.[a-z][a-z0-9_]*)+)';
+ }
+
+ /**
+ * Find the $vars array
+ *
+ * @return array List of variables
+ * @throws \LogicException
+ */
+ public function get_vars_from_array()
+ {
+ $line = ltrim($this->file_lines[$this->current_event_line - 1], "\t");
+ if ($line === ');')
+ {
+ $vars_array = $this->get_vars_from_multi_line_array();
+ }
+ else
+ {
+ $vars_array = $this->get_vars_from_single_line_array($line);
+ }
+
+ foreach ($vars_array as $var)
+ {
+ if (!preg_match('#^([a-zA-Z_][a-zA-Z0-9_]*)$#', $var))
+ {
+ throw new \LogicException("Found invalid var '{$var}' in array for event '{$this->current_event}' in file '{$this->current_file}:{$this->current_event_line}'", 3);
+ }
+ }
+
+ sort($vars_array);
+ return $vars_array;
+ }
+
+ /**
+ * Find the variables in single line array
+ *
+ * @param string $line
+ * @param bool $throw_multiline Throw an exception when there are too
+ * many arguments in one line.
+ * @return array List of variables
+ * @throws \LogicException
+ */
+ public function get_vars_from_single_line_array($line, $throw_multiline = true)
+ {
+ $match = array();
+ preg_match('#^\$vars = array\(\'([a-zA-Z0-9_\' ,]+)\'\);$#', $line, $match);
+
+ if (isset($match[1]))
+ {
+ $vars_array = explode("', '", $match[1]);
+ if ($throw_multiline && sizeof($vars_array) > 6)
+ {
+ throw new \LogicException('Should use multiple lines for $vars definition '
+ . "for event '{$this->current_event}' in file '{$this->current_file}:{$this->current_event_line}'", 2);
+ }
+ return $vars_array;
+ }
+ else
+ {
+ throw new \LogicException("Can not find '\$vars = array();'-line for event '{$this->current_event}' in file '{$this->current_file}:{$this->current_event_line}'", 1);
+ }
+ }
+
+ /**
+ * Find the variables in single line array
+ *
+ * @return array List of variables
+ * @throws \LogicException
+ */
+ public function get_vars_from_multi_line_array()
+ {
+ $current_vars_line = 2;
+ $var_lines = array();
+ while (ltrim($this->file_lines[$this->current_event_line - $current_vars_line], "\t") !== '$vars = array(')
+ {
+ $var_lines[] = substr(trim($this->file_lines[$this->current_event_line - $current_vars_line]), 0, -1);
+
+ $current_vars_line++;
+ if ($current_vars_line > $this->current_event_line)
+ {
+ // Reached the start of the file
+ throw new \LogicException("Can not find end of \$vars array for event '{$this->current_event}' in file '{$this->current_file}:{$this->current_event_line}'", 2);
+ }
+ }
+
+ return $this->get_vars_from_single_line_array('$vars = array(' . implode(", ", $var_lines) . ');', false);
+ }
+
+ /**
+ * Find the $vars array
+ *
+ * @return array List of variables
+ * @throws \LogicException
+ */
+ public function get_vars_from_docblock()
+ {
+ $doc_vars = array();
+ $current_doc_line = 1;
+ $found_comment_end = false;
+ while (ltrim($this->file_lines[$this->current_event_line - $current_doc_line], "\t") !== '/**')
+ {
+ if (ltrim($this->file_lines[$this->current_event_line - $current_doc_line], "\t ") === '*/')
+ {
+ $found_comment_end = true;
+ }
+
+ if ($found_comment_end)
+ {
+ $var_line = trim($this->file_lines[$this->current_event_line - $current_doc_line]);
+ $var_line = preg_replace('!\s+!', ' ', $var_line);
+ if (strpos($var_line, '* @var ') === 0)
+ {
+ $doc_line = explode(' ', $var_line, 5);
+ if (sizeof($doc_line) !== 5)
+ {
+ throw new \LogicException("Found invalid line '{$this->file_lines[$this->current_event_line - $current_doc_line]}' "
+ . "for event '{$this->current_event}' in file '{$this->current_file}:{$this->current_event_line}'", 1);
+ }
+ $doc_vars[] = $doc_line[3];
+ }
+ }
+
+ $current_doc_line++;
+ if ($current_doc_line > $this->current_event_line)
+ {
+ // Reached the start of the file
+ throw new \LogicException("Can not find end of docblock for event '{$this->current_event}' in file '{$this->current_file}:{$this->current_event_line}'", 2);
+ }
+ }
+
+ if (empty($doc_vars))
+ {
+ // Reached the start of the file
+ throw new \LogicException("Can not find @var lines for event '{$this->current_event}' in file '{$this->current_file}:{$this->current_event_line}'", 3);
+ }
+
+ foreach ($doc_vars as $var)
+ {
+ if (!preg_match('#^([a-zA-Z_][a-zA-Z0-9_]*)$#', $var))
+ {
+ throw new \LogicException("Found invalid @var '{$var}' in docblock for event "
+ . "'{$this->current_event}' in file '{$this->current_file}:{$this->current_event_line}'", 4);
+ }
+ }
+
+ sort($doc_vars);
+ return $doc_vars;
+ }
+
+ /**
+ * Find the "@since" Information line
+ *
+ * @return int Absolute line number
+ * @throws \LogicException
+ */
+ public function find_since()
+ {
+ return $this->find_tag('since', array('event', 'var'));
+ }
+
+ /**
+ * Find the "@changed" Information lines
+ *
+ * @param string $tag_name Should be 'change', not 'changed'
+ * @return array Absolute line numbers
+ * @throws \LogicException
+ */
+ public function find_changed($tag_name)
+ {
+ $lines = array();
+ $last_line = 0;
+ try
+ {
+ while ($line = $this->find_tag($tag_name, array('since'), $last_line))
+ {
+ $lines[] = $line;
+ $last_line = $line;
+ }
+ }
+ catch (\LogicException $e)
+ {
+ // Not changed? No problem!
+ }
+
+ return $lines;
+ }
+
+ /**
+ * Find the "@event" Information line
+ *
+ * @return int Absolute line number
+ */
+ public function find_event()
+ {
+ return $this->find_tag('event', array());
+ }
+
+ /**
+ * Find a "@*" Information line
+ *
+ * @param string $find_tag Name of the tag we are trying to find
+ * @param array $disallowed_tags List of tags that must not appear between
+ * the tag and the actual event
+ * @param int $skip_to_line Skip lines until this one
+ * @return int Absolute line number
+ * @throws \LogicException
+ */
+ public function find_tag($find_tag, $disallowed_tags, $skip_to_line = 0)
+ {
+ $find_tag_line = $skip_to_line ? $this->current_event_line - $skip_to_line + 1 : 0;
+ $found_comment_end = ($skip_to_line) ? true : false;
+ while (strpos(ltrim($this->file_lines[$this->current_event_line - $find_tag_line], "\t "), '* @' . $find_tag . ' ') !== 0)
+ {
+ if ($found_comment_end && ltrim($this->file_lines[$this->current_event_line - $find_tag_line], "\t") === '/**')
+ {
+ // Reached the start of this doc block
+ throw new \LogicException("Can not find '@{$find_tag}' information for event "
+ . "'{$this->current_event}' in file '{$this->current_file}:{$this->current_event_line}'", 1);
+ }
+
+ foreach ($disallowed_tags as $disallowed_tag)
+ {
+ if ($found_comment_end && strpos(ltrim($this->file_lines[$this->current_event_line - $find_tag_line], "\t "), '* @' . $disallowed_tag) === 0)
+ {
+ // Found @var after the @since
+ throw new \LogicException("Found '@{$disallowed_tag}' information after '@{$find_tag}' for event "
+ . "'{$this->current_event}' in file '{$this->current_file}:{$this->current_event_line}'", 3);
+ }
+ }
+
+ if (ltrim($this->file_lines[$this->current_event_line - $find_tag_line], "\t ") === '*/')
+ {
+ $found_comment_end = true;
+ }
+
+ $find_tag_line++;
+ if ($find_tag_line >= $this->current_event_line)
+ {
+ // Reached the start of the file
+ throw new \LogicException("Can not find '@{$find_tag}' information for event "
+ . "'{$this->current_event}' in file '{$this->current_file}:{$this->current_event_line}'", 2);
+ }
+ }
+
+ return $this->current_event_line - $find_tag_line;
+ }
+
+ /**
+ * Find a "@*" Information line
+ *
+ * @return int Absolute line number
+ * @throws \LogicException
+ */
+ public function find_description()
+ {
+ $find_desc_line = 0;
+ while (ltrim($this->file_lines[$this->current_event_line - $find_desc_line], "\t") !== '/**')
+ {
+ $find_desc_line++;
+ if ($find_desc_line > $this->current_event_line)
+ {
+ // Reached the start of the file
+ throw new \LogicException("Can not find a description for event "
+ . "'{$this->current_event}' in file '{$this->current_file}:{$this->current_event_line}'", 1);
+ }
+ }
+
+ $find_desc_line = $this->current_event_line - $find_desc_line + 1;
+
+ $desc = trim($this->file_lines[$find_desc_line]);
+ if (strpos($desc, '* @') === 0 || $desc[0] !== '*' || substr($desc, 1) == '')
+ {
+ // First line of the doc block is a @-line, empty or only contains "*"
+ throw new \LogicException("Can not find a description for event "
+ . "'{$this->current_event}' in file '{$this->current_file}:{$this->current_event_line}'", 2);
+ }
+
+ return $find_desc_line;
+ }
+
+ /**
+ * Validate "@since" Information
+ *
+ * @param string $line
+ * @return string
+ * @throws \LogicException
+ */
+ public function validate_since($line)
+ {
+ $match = array();
+ preg_match('#^\* @since (\d+\.\d+\.\d+(?:-(?:a|b|RC|pl)\d+)?)$#', ltrim($line, "\t "), $match);
+ if (!isset($match[1]))
+ {
+ throw new \LogicException("Invalid '@since' information for event "
+ . "'{$this->current_event}' in file '{$this->current_file}:{$this->current_event_line}'");
+ }
+
+ return $match[1];
+ }
+
+ /**
+ * Validate "@changed" Information
+ *
+ * @param string $line
+ * @return string
+ * @throws \LogicException
+ */
+ public function validate_changed($line)
+ {
+ $match = array();
+ $line = str_replace("\t", ' ', ltrim($line, "\t "));
+ preg_match('#^\* @changed (\d+\.\d+\.\d+(?:-(?:a|b|RC|pl)\d+)?)( (?:.*))?$#', $line, $match);
+ if (!isset($match[2]))
+ {
+ throw new \LogicException("Invalid '@changed' information for event "
+ . "'{$this->current_event}' in file '{$this->current_file}:{$this->current_event_line}'");
+ }
+
+ return $match[2];
+ }
+
+ /**
+ * Validate "@event" Information
+ *
+ * @param string $event_name
+ * @param string $line
+ * @return string
+ * @throws \LogicException
+ */
+ public function validate_event($event_name, $line)
+ {
+ $event = substr(ltrim($line, "\t "), strlen('* @event '));
+
+ if ($event !== trim($event))
+ {
+ throw new \LogicException("Invalid '@event' information for event "
+ . "'{$this->current_event}' in file '{$this->current_file}:{$this->current_event_line}'", 1);
+ }
+
+ if ($event !== $event_name)
+ {
+ throw new \LogicException("Event name does not match '@event' tag for event "
+ . "'{$this->current_event}' in file '{$this->current_file}:{$this->current_event_line}'", 2);
+ }
+
+ return $event;
+ }
+
+ /**
+ * Validates that two arrays contain the same strings
+ *
+ * @param array $vars_array Variables found in the array line
+ * @param array $vars_docblock Variables found in the doc block
+ * @return null
+ * @throws \LogicException
+ */
+ public function validate_vars_docblock_array($vars_array, $vars_docblock)
+ {
+ $vars_array = array_unique($vars_array);
+ $vars_docblock = array_unique($vars_docblock);
+ $sizeof_vars_array = sizeof($vars_array);
+
+ if ($sizeof_vars_array !== sizeof($vars_docblock) || $sizeof_vars_array !== sizeof(array_intersect($vars_array, $vars_docblock)))
+ {
+ throw new \LogicException("\$vars array does not match the list of '@var' tags for event "
+ . "'{$this->current_event}' in file '{$this->current_file}:{$this->current_event_line}'");
+ }
+ }
+}
diff --git a/phpBB/phpbb/event/recursive_event_filter_iterator.php b/phpBB/phpbb/event/recursive_event_filter_iterator.php
new file mode 100644
index 0000000000..64e2e56f6a
--- /dev/null
+++ b/phpBB/phpbb/event/recursive_event_filter_iterator.php
@@ -0,0 +1,71 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\event;
+
+/**
+* This filter ignores directories and files starting with a dot.
+* It also skips some directories that do not contain events anyway,
+* such as e.g. files/, store/ and vendor/
+*/
+class recursive_event_filter_iterator extends \RecursiveFilterIterator
+{
+ protected $root_path;
+
+ /**
+ * Construct
+ *
+ * @param \RecursiveIterator $iterator
+ * @param string $root_path
+ */
+ public function __construct(\RecursiveIterator $iterator, $root_path)
+ {
+ $this->root_path = str_replace(DIRECTORY_SEPARATOR, '/', $root_path);
+ parent::__construct($iterator);
+ }
+
+ /**
+ * Return the inner iterator's children contained in a recursive_event_filter_iterator
+ *
+ * @return recursive_event_filter_iterator
+ */
+ public function getChildren()
+ {
+ return new self($this->getInnerIterator()->getChildren(), $this->root_path);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function accept()
+ {
+ $relative_path = str_replace(DIRECTORY_SEPARATOR, '/', $this->current());
+ $filename = $this->current()->getFilename();
+
+ return (substr($relative_path, -4) === '.php' || $this->current()->isDir())
+ && $filename[0] !== '.'
+ && strpos($relative_path, $this->root_path . 'cache/') !== 0
+ && strpos($relative_path, $this->root_path . 'develop/') !== 0
+ && strpos($relative_path, $this->root_path . 'docs/') !== 0
+ && strpos($relative_path, $this->root_path . 'ext/') !== 0
+ && strpos($relative_path, $this->root_path . 'files/') !== 0
+ && strpos($relative_path, $this->root_path . 'includes/utf/') !== 0
+ && strpos($relative_path, $this->root_path . 'language/') !== 0
+ && strpos($relative_path, $this->root_path . 'phpbb/db/migration/data/') !== 0
+ && strpos($relative_path, $this->root_path . 'phpbb/event/') !== 0
+ && strpos($relative_path, $this->root_path . 'store/') !== 0
+ && strpos($relative_path, $this->root_path . 'tests/') !== 0
+ && strpos($relative_path, $this->root_path . 'vendor/') !== 0
+ ;
+ }
+}
diff --git a/phpBB/phpbb/exception/exception_interface.php b/phpBB/phpbb/exception/exception_interface.php
new file mode 100644
index 0000000000..e8526a35f5
--- /dev/null
+++ b/phpBB/phpbb/exception/exception_interface.php
@@ -0,0 +1,29 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\exception;
+
+/**
+ * Interface exception_interface
+ *
+ * Define an exception which support a language var as message.
+ */
+interface exception_interface
+{
+ /**
+ * Return the arguments associated with the message if it's a language var.
+ *
+ * @return array
+ */
+ public function get_parameters();
+}
diff --git a/phpBB/phpbb/exception/http_exception.php b/phpBB/phpbb/exception/http_exception.php
new file mode 100644
index 0000000000..0e6ffe4f59
--- /dev/null
+++ b/phpBB/phpbb/exception/http_exception.php
@@ -0,0 +1,70 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\exception;
+
+use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface;
+
+/**
+ * Class http_exception
+ */
+class http_exception extends runtime_exception implements HttpExceptionInterface
+{
+ /**
+ * Http status code.
+ *
+ * @var integer
+ */
+ private $status_code;
+
+ /**
+ * Additional headers to set in the response.
+ *
+ * @var array
+ */
+ private $headers;
+
+ /**
+ * Constructor
+ *
+ * @param integer $status_code The http status code.
+ * @param string $message The Exception message to throw (must be a language variable).
+ * @param array $parameters The parameters to use with the language var.
+ * @param \Exception $previous The previous exception used for the exception chaining.
+ * @param array $headers Additional headers to set in the response.
+ * @param integer $code The Exception code.
+ */
+ public function __construct($status_code, $message = "", array $parameters = array(), \Exception $previous = null, array $headers = array(), $code = 0)
+ {
+ $this->status_code = $status_code;
+ $this->headers = $headers;
+
+ parent::__construct($message, $parameters, $previous, $code);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getStatusCode()
+ {
+ return $this->status_code;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getHeaders()
+ {
+ return $this->headers;
+ }
+}
diff --git a/phpBB/phpbb/exception/runtime_exception.php b/phpBB/phpbb/exception/runtime_exception.php
new file mode 100644
index 0000000000..6568bbf86f
--- /dev/null
+++ b/phpBB/phpbb/exception/runtime_exception.php
@@ -0,0 +1,52 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\exception;
+
+/**
+ * Class runtime_exception
+ *
+ * Define an exception which support a language var as message.
+ */
+class runtime_exception extends \RuntimeException implements exception_interface
+{
+ /**
+ * Parameters to use with the language var.
+ *
+ * @var array
+ */
+ private $parameters;
+
+ /**
+ * Constructor
+ *
+ * @param string $message The Exception message to throw (must be a language variable).
+ * @param array $parameters The parameters to use with the language var.
+ * @param \Exception $previous The previous runtime_exception used for the runtime_exception chaining.
+ * @param integer $code The Exception code.
+ */
+ public function __construct($message = "", array $parameters = array(), \Exception $previous = null, $code = 0)
+ {
+ $this->parameters = $parameters;
+
+ parent::__construct($message, $code, $previous);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_parameters()
+ {
+ return $this->parameters;
+ }
+}
diff --git a/phpBB/phpbb/extension/base.php b/phpBB/phpbb/extension/base.php
new file mode 100644
index 0000000000..5bb530bad4
--- /dev/null
+++ b/phpBB/phpbb/extension/base.php
@@ -0,0 +1,142 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\extension;
+
+use Symfony\Component\DependencyInjection\ContainerInterface;
+
+/**
+* A base class for extensions without custom enable/disable/purge code.
+*/
+class base implements \phpbb\extension\extension_interface
+{
+ /** @var ContainerInterface */
+ protected $container;
+
+ /** @var \phpbb\finder */
+ protected $finder;
+
+ /** @var \phpbb\db\migrator */
+ protected $migrator;
+
+ /** @var string */
+ protected $extension_name;
+
+ /** @var string */
+ protected $extension_path;
+
+ /** @var string[] */
+ private $migrations = false;
+
+ /**
+ * Constructor
+ *
+ * @param ContainerInterface $container Container object
+ * @param \phpbb\finder $extension_finder
+ * @param \phpbb\db\migrator $migrator
+ * @param string $extension_name Name of this extension (from ext.manager)
+ * @param string $extension_path Relative path to this extension
+ */
+ public function __construct(ContainerInterface $container, \phpbb\finder $extension_finder, \phpbb\db\migrator $migrator, $extension_name, $extension_path)
+ {
+ $this->container = $container;
+ $this->extension_finder = $extension_finder;
+ $this->migrator = $migrator;
+
+ $this->extension_name = $extension_name;
+ $this->extension_path = $extension_path;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function is_enableable()
+ {
+ return true;
+ }
+
+ /**
+ * Single enable step that installs any included migrations
+ *
+ * @param mixed $old_state State returned by previous call of this method
+ * @return false Indicates no further steps are required
+ */
+ public function enable_step($old_state)
+ {
+ $migrations = $this->get_migration_file_list();
+
+ $this->migrator->set_migrations($migrations);
+
+ $this->migrator->update();
+
+ return !$this->migrator->finished();
+ }
+
+ /**
+ * Single disable step that does nothing
+ *
+ * @param mixed $old_state State returned by previous call of this method
+ * @return false Indicates no further steps are required
+ */
+ public function disable_step($old_state)
+ {
+ return false;
+ }
+
+ /**
+ * Single purge step that reverts any included and installed migrations
+ *
+ * @param mixed $old_state State returned by previous call of this method
+ * @return false Indicates no further steps are required
+ */
+ public function purge_step($old_state)
+ {
+ $migrations = $this->get_migration_file_list();
+
+ $this->migrator->set_migrations($migrations);
+
+ foreach ($migrations as $migration)
+ {
+ while ($this->migrator->migration_state($migration) !== false)
+ {
+ $this->migrator->revert($migration);
+
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * Get the list of migration files from this extension
+ *
+ * @return array
+ */
+ protected function get_migration_file_list()
+ {
+ if ($this->migrations !== false)
+ {
+ return $this->migrations;
+ }
+
+ // Only have the finder search in this extension path directory
+ $migrations = $this->extension_finder
+ ->extension_directory('/migrations')
+ ->find_from_extension($this->extension_name, $this->extension_path);
+
+ $migrations = $this->extension_finder->get_classes_from_files($migrations);
+
+ return $migrations;
+ }
+}
diff --git a/phpBB/phpbb/extension/exception.php b/phpBB/phpbb/extension/exception.php
new file mode 100644
index 0000000000..3f7d251a4e
--- /dev/null
+++ b/phpBB/phpbb/extension/exception.php
@@ -0,0 +1,25 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\extension;
+
+/**
+ * Exception class for metadata
+ */
+class exception extends \UnexpectedValueException
+{
+ public function __toString()
+ {
+ return $this->getMessage();
+ }
+}
diff --git a/phpBB/phpbb/extension/extension_interface.php b/phpBB/phpbb/extension/extension_interface.php
new file mode 100644
index 0000000000..6a6b6adb8f
--- /dev/null
+++ b/phpBB/phpbb/extension/extension_interface.php
@@ -0,0 +1,70 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\extension;
+
+/**
+* The interface extension meta classes have to implement to run custom code
+* on enable/disable/purge.
+*/
+interface extension_interface
+{
+ /**
+ * Indicate whether or not the extension can be enabled.
+ *
+ * @return bool
+ */
+ public function is_enableable();
+
+ /**
+ * enable_step is executed on enabling an extension until it returns false.
+ *
+ * Calls to this function can be made in subsequent requests, when the
+ * function is invoked through a webserver with a too low max_execution_time.
+ *
+ * @param mixed $old_state The return value of the previous call
+ * of this method, or false on the first call
+ * @return mixed Returns false after last step, otherwise
+ * temporary state which is passed as an
+ * argument to the next step
+ */
+ public function enable_step($old_state);
+
+ /**
+ * Disables the extension.
+ *
+ * Calls to this function can be made in subsequent requests, when the
+ * function is invoked through a webserver with a too low max_execution_time.
+ *
+ * @param mixed $old_state The return value of the previous call
+ * of this method, or false on the first call
+ * @return mixed Returns false after last step, otherwise
+ * temporary state which is passed as an
+ * argument to the next step
+ */
+ public function disable_step($old_state);
+
+ /**
+ * purge_step is executed on purging an extension until it returns false.
+ *
+ * Calls to this function can be made in subsequent requests, when the
+ * function is invoked through a webserver with a too low max_execution_time.
+ *
+ * @param mixed $old_state The return value of the previous call
+ * of this method, or false on the first call
+ * @return mixed Returns false after last step, otherwise
+ * temporary state which is passed as an
+ * argument to the next step
+ */
+ public function purge_step($old_state);
+}
diff --git a/phpBB/phpbb/extension/manager.php b/phpBB/phpbb/extension/manager.php
new file mode 100644
index 0000000000..e7e5f83c23
--- /dev/null
+++ b/phpBB/phpbb/extension/manager.php
@@ -0,0 +1,592 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\extension;
+
+use Symfony\Component\DependencyInjection\ContainerInterface;
+
+/**
+* The extension manager provides means to activate/deactivate extensions.
+*/
+class manager
+{
+ /** @var ContainerInterface */
+ protected $container;
+
+ protected $db;
+ protected $config;
+ protected $cache;
+ protected $user;
+ protected $php_ext;
+ protected $extensions;
+ protected $extension_table;
+ protected $phpbb_root_path;
+ protected $cache_name;
+
+ /**
+ * Creates a manager and loads information from database
+ *
+ * @param ContainerInterface $container A container
+ * @param \phpbb\db\driver\driver_interface $db A database connection
+ * @param \phpbb\config\config $config Config object
+ * @param \phpbb\filesystem $filesystem
+ * @param \phpbb\user $user User object
+ * @param string $extension_table The name of the table holding extensions
+ * @param string $phpbb_root_path Path to the phpbb includes directory.
+ * @param string $php_ext php file extension, defaults to php
+ * @param \phpbb\cache\driver\driver_interface $cache A cache instance or null
+ * @param string $cache_name The name of the cache variable, defaults to _ext
+ */
+ public function __construct(ContainerInterface $container, \phpbb\db\driver\driver_interface $db, \phpbb\config\config $config, \phpbb\filesystem $filesystem, \phpbb\user $user, $extension_table, $phpbb_root_path, $php_ext = 'php', \phpbb\cache\driver\driver_interface $cache = null, $cache_name = '_ext')
+ {
+ $this->cache = $cache;
+ $this->cache_name = $cache_name;
+ $this->config = $config;
+ $this->container = $container;
+ $this->db = $db;
+ $this->extension_table = $extension_table;
+ $this->filesystem = $filesystem;
+ $this->phpbb_root_path = $phpbb_root_path;
+ $this->php_ext = $php_ext;
+ $this->user = $user;
+
+ $this->extensions = ($this->cache) ? $this->cache->get($this->cache_name) : false;
+
+ if ($this->extensions === false)
+ {
+ $this->load_extensions();
+ }
+ }
+
+ /**
+ * Loads all extension information from the database
+ *
+ * @return null
+ */
+ public function load_extensions()
+ {
+ $this->extensions = array();
+
+ // Do not try to load any extensions if the extension table
+ // does not exist or when installing or updating.
+ // Note: database updater invokes this code, and in 3.0
+ // there is no extension table therefore the rest of this function
+ // fails
+ if (defined('IN_INSTALL') || version_compare($this->config['version'], '3.1.0-dev', '<'))
+ {
+ return;
+ }
+
+ $sql = 'SELECT *
+ FROM ' . $this->extension_table;
+
+ $result = $this->db->sql_query($sql);
+ $extensions = $this->db->sql_fetchrowset($result);
+ $this->db->sql_freeresult($result);
+
+ foreach ($extensions as $extension)
+ {
+ $extension['ext_path'] = $this->get_extension_path($extension['ext_name']);
+ $this->extensions[$extension['ext_name']] = $extension;
+ }
+
+ ksort($this->extensions);
+
+ if ($this->cache)
+ {
+ $this->cache->put($this->cache_name, $this->extensions);
+ }
+ }
+
+ /**
+ * Generates the path to an extension
+ *
+ * @param string $name The name of the extension
+ * @param bool $phpbb_relative Whether the path should be relative to phpbb root
+ * @return string Path to an extension
+ */
+ public function get_extension_path($name, $phpbb_relative = false)
+ {
+ $name = str_replace('.', '', $name);
+
+ return (($phpbb_relative) ? $this->phpbb_root_path : '') . 'ext/' . $name . '/';
+ }
+
+ /**
+ * Instantiates the extension meta class for the extension with the given name
+ *
+ * @param string $name The extension name
+ * @return \phpbb\extension\extension_interface Instance of the extension meta class or
+ * \phpbb\extension\base if the class does not exist
+ */
+ public function get_extension($name)
+ {
+ $extension_class_name = str_replace('/', '\\', $name) . '\\ext';
+
+ $migrator = $this->container->get('migrator');
+
+ if (class_exists($extension_class_name))
+ {
+ return new $extension_class_name($this->container, $this->get_finder(), $migrator, $name, $this->get_extension_path($name, true));
+ }
+ else
+ {
+ return new \phpbb\extension\base($this->container, $this->get_finder(), $migrator, $name, $this->get_extension_path($name, true));
+ }
+ }
+
+ /**
+ * Instantiates the metadata manager for the extension with the given name
+ *
+ * @param string $name The extension name
+ * @param \phpbb\template\template $template The template manager or null
+ * @return \phpbb\extension\metadata_manager Instance of the metadata manager
+ */
+ public function create_extension_metadata_manager($name, \phpbb\template\template $template = null)
+ {
+ return new \phpbb\extension\metadata_manager($name, $this->config, $this, $template, $this->user, $this->phpbb_root_path);
+ }
+
+ /**
+ * Runs a step of the extension enabling process.
+ *
+ * Allows the exentension to enable in a long running script that works
+ * in multiple steps across requests. State is kept for the extension
+ * in the extensions table.
+ *
+ * @param string $name The extension's name
+ * @return bool False if enabling is finished, true otherwise
+ */
+ public function enable_step($name)
+ {
+ // ignore extensions that are already enabled
+ if (isset($this->extensions[$name]) && $this->extensions[$name]['ext_active'])
+ {
+ return false;
+ }
+
+ $old_state = (isset($this->extensions[$name]['ext_state'])) ? unserialize($this->extensions[$name]['ext_state']) : false;
+
+ $extension = $this->get_extension($name);
+
+ if (!$extension->is_enableable())
+ {
+ return false;
+ }
+
+ $state = $extension->enable_step($old_state);
+
+ $active = ($state === false);
+
+ $extension_data = array(
+ 'ext_name' => $name,
+ 'ext_active' => $active,
+ 'ext_state' => serialize($state),
+ );
+
+ $this->extensions[$name] = $extension_data;
+ $this->extensions[$name]['ext_path'] = $this->get_extension_path($extension_data['ext_name']);
+ ksort($this->extensions);
+
+ $sql = 'SELECT COUNT(ext_name) as row_count
+ FROM ' . $this->extension_table . "
+ WHERE ext_name = '" . $this->db->sql_escape($name) . "'";
+ $result = $this->db->sql_query($sql);
+ $count = $this->db->sql_fetchfield('row_count');
+ $this->db->sql_freeresult($result);
+
+ if ($count)
+ {
+ $sql = 'UPDATE ' . $this->extension_table . '
+ SET ' . $this->db->sql_build_array('UPDATE', $extension_data) . "
+ WHERE ext_name = '" . $this->db->sql_escape($name) . "'";
+ $this->db->sql_query($sql);
+ }
+ else
+ {
+ $sql = 'INSERT INTO ' . $this->extension_table . '
+ ' . $this->db->sql_build_array('INSERT', $extension_data);
+ $this->db->sql_query($sql);
+ }
+
+ if ($this->cache)
+ {
+ $this->cache->purge();
+ }
+
+ if ($active)
+ {
+ $this->config->increment('assets_version', 1);
+ }
+
+ return !$active;
+ }
+
+ /**
+ * Enables an extension
+ *
+ * This method completely enables an extension. But it could be long running
+ * so never call this in a script that has a max_execution time.
+ *
+ * @param string $name The extension's name
+ * @return null
+ */
+ public function enable($name)
+ {
+ // @codingStandardsIgnoreStart
+ while ($this->enable_step($name));
+ // @codingStandardsIgnoreEnd
+ }
+
+ /**
+ * Disables an extension
+ *
+ * Calls the disable method on the extension's meta class to allow it to
+ * process the event.
+ *
+ * @param string $name The extension's name
+ * @return bool False if disabling is finished, true otherwise
+ */
+ public function disable_step($name)
+ {
+ // ignore extensions that are already disabled
+ if (!isset($this->extensions[$name]) || !$this->extensions[$name]['ext_active'])
+ {
+ return false;
+ }
+
+ $old_state = unserialize($this->extensions[$name]['ext_state']);
+
+ $extension = $this->get_extension($name);
+ $state = $extension->disable_step($old_state);
+
+ // continue until the state is false
+ if ($state !== false)
+ {
+ $extension_data = array(
+ 'ext_state' => serialize($state),
+ );
+ $this->extensions[$name]['ext_state'] = serialize($state);
+
+ $sql = 'UPDATE ' . $this->extension_table . '
+ SET ' . $this->db->sql_build_array('UPDATE', $extension_data) . "
+ WHERE ext_name = '" . $this->db->sql_escape($name) . "'";
+ $this->db->sql_query($sql);
+
+ if ($this->cache)
+ {
+ $this->cache->purge();
+ }
+
+ return true;
+ }
+
+ $extension_data = array(
+ 'ext_active' => false,
+ 'ext_state' => serialize(false),
+ );
+ $this->extensions[$name]['ext_active'] = false;
+ $this->extensions[$name]['ext_state'] = serialize(false);
+
+ $sql = 'UPDATE ' . $this->extension_table . '
+ SET ' . $this->db->sql_build_array('UPDATE', $extension_data) . "
+ WHERE ext_name = '" . $this->db->sql_escape($name) . "'";
+ $this->db->sql_query($sql);
+
+ if ($this->cache)
+ {
+ $this->cache->purge();
+ }
+
+ return false;
+ }
+
+ /**
+ * Disables an extension
+ *
+ * Disables an extension completely at once. This process could run for a
+ * while so never call this in a script that has a max_execution time.
+ *
+ * @param string $name The extension's name
+ * @return null
+ */
+ public function disable($name)
+ {
+ // @codingStandardsIgnoreStart
+ while ($this->disable_step($name));
+ // @codingStandardsIgnoreEnd
+ }
+
+ /**
+ * Purge an extension
+ *
+ * Disables the extension first if active, and then calls purge on the
+ * extension's meta class to delete the extension's database content.
+ *
+ * @param string $name The extension's name
+ * @return bool False if purging is finished, true otherwise
+ */
+ public function purge_step($name)
+ {
+ // ignore extensions that do not exist
+ if (!isset($this->extensions[$name]))
+ {
+ return false;
+ }
+
+ // disable first if necessary
+ if ($this->extensions[$name]['ext_active'])
+ {
+ $this->disable($name);
+ }
+
+ $old_state = unserialize($this->extensions[$name]['ext_state']);
+
+ $extension = $this->get_extension($name);
+ $state = $extension->purge_step($old_state);
+
+ // continue until the state is false
+ if ($state !== false)
+ {
+ $extension_data = array(
+ 'ext_state' => serialize($state),
+ );
+ $this->extensions[$name]['ext_state'] = serialize($state);
+
+ $sql = 'UPDATE ' . $this->extension_table . '
+ SET ' . $this->db->sql_build_array('UPDATE', $extension_data) . "
+ WHERE ext_name = '" . $this->db->sql_escape($name) . "'";
+ $this->db->sql_query($sql);
+
+ if ($this->cache)
+ {
+ $this->cache->purge();
+ }
+
+ return true;
+ }
+
+ unset($this->extensions[$name]);
+
+ $sql = 'DELETE FROM ' . $this->extension_table . "
+ WHERE ext_name = '" . $this->db->sql_escape($name) . "'";
+ $this->db->sql_query($sql);
+
+ if ($this->cache)
+ {
+ $this->cache->purge();
+ }
+
+ return false;
+ }
+
+ /**
+ * Purge an extension
+ *
+ * Purges an extension completely at once. This process could run for a while
+ * so never call this in a script that has a max_execution time.
+ *
+ * @param string $name The extension's name
+ * @return null
+ */
+ public function purge($name)
+ {
+ // @codingStandardsIgnoreStart
+ while ($this->purge_step($name));
+ // @codingStandardsIgnoreEnd
+ }
+
+ /**
+ * Retrieves a list of all available extensions on the filesystem
+ *
+ * @return array An array with extension names as keys and paths to the
+ * extension as values
+ */
+ public function all_available()
+ {
+ $available = array();
+ if (!is_dir($this->phpbb_root_path . 'ext/'))
+ {
+ return $available;
+ }
+
+ $iterator = new \RecursiveIteratorIterator(
+ new \phpbb\recursive_dot_prefix_filter_iterator(
+ new \RecursiveDirectoryIterator($this->phpbb_root_path . 'ext/', \FilesystemIterator::NEW_CURRENT_AND_KEY | \FilesystemIterator::FOLLOW_SYMLINKS)
+ ),
+ \RecursiveIteratorIterator::SELF_FIRST
+ );
+ $iterator->setMaxDepth(2);
+
+ foreach ($iterator as $file_info)
+ {
+ if ($file_info->isFile() && $file_info->getFilename() == 'composer.json')
+ {
+ $ext_name = $iterator->getInnerIterator()->getSubPath();
+ $ext_name = str_replace(DIRECTORY_SEPARATOR, '/', $ext_name);
+ if ($this->is_available($ext_name))
+ {
+ $available[$ext_name] = $this->phpbb_root_path . 'ext/' . $ext_name . '/';
+ }
+ }
+ }
+ ksort($available);
+ return $available;
+ }
+
+ /**
+ * Retrieves all configured extensions.
+ *
+ * All enabled and disabled extensions are considered configured. A purged
+ * extension that is no longer in the database is not configured.
+ *
+ * @return array An array with extension names as keys and and the
+ * database stored extension information as values
+ */
+ public function all_configured()
+ {
+ $configured = array();
+ foreach ($this->extensions as $name => $data)
+ {
+ $data['ext_path'] = $this->phpbb_root_path . $data['ext_path'];
+ $configured[$name] = $data;
+ }
+ return $configured;
+ }
+
+ /**
+ * Retrieves all enabled extensions.
+ *
+ * @return array An array with extension names as keys and and the
+ * database stored extension information as values
+ */
+ public function all_enabled()
+ {
+ $enabled = array();
+ foreach ($this->extensions as $name => $data)
+ {
+ if ($data['ext_active'])
+ {
+ $enabled[$name] = $this->phpbb_root_path . $data['ext_path'];
+ }
+ }
+ return $enabled;
+ }
+
+ /**
+ * Retrieves all disabled extensions.
+ *
+ * @return array An array with extension names as keys and and the
+ * database stored extension information as values
+ */
+ public function all_disabled()
+ {
+ $disabled = array();
+ foreach ($this->extensions as $name => $data)
+ {
+ if (!$data['ext_active'])
+ {
+ $disabled[$name] = $this->phpbb_root_path . $data['ext_path'];
+ }
+ }
+ return $disabled;
+ }
+
+ /**
+ * Check to see if a given extension is available on the filesystem
+ *
+ * @param string $name Extension name to check NOTE: Can be user input
+ * @return bool Depending on whether or not the extension is available
+ */
+ public function is_available($name)
+ {
+ $md_manager = $this->create_extension_metadata_manager($name);
+ try
+ {
+ return $md_manager->get_metadata('all') && $md_manager->validate_enable();
+ }
+ catch (\phpbb\extension\exception $e)
+ {
+ return false;
+ }
+ }
+
+ /**
+ * Check to see if a given extension is enabled
+ *
+ * @param string $name Extension name to check
+ * @return bool Depending on whether or not the extension is enabled
+ */
+ public function is_enabled($name)
+ {
+ return isset($this->extensions[$name]) && $this->extensions[$name]['ext_active'];
+ }
+
+ /**
+ * Check to see if a given extension is disabled
+ *
+ * @param string $name Extension name to check
+ * @return bool Depending on whether or not the extension is disabled
+ */
+ public function is_disabled($name)
+ {
+ return isset($this->extensions[$name]) && !$this->extensions[$name]['ext_active'];
+ }
+
+ /**
+ * Check to see if a given extension is configured
+ *
+ * All enabled and disabled extensions are considered configured. A purged
+ * extension that is no longer in the database is not configured.
+ *
+ * @param string $name Extension name to check
+ * @return bool Depending on whether or not the extension is configured
+ */
+ public function is_configured($name)
+ {
+ return isset($this->extensions[$name]);
+ }
+
+ /**
+ * Check to see if a given extension is purged
+ *
+ * An extension is purged if it is available, not enabled and not disabled.
+ *
+ * @param string $name Extension name to check
+ * @return bool Depending on whether or not the extension is purged
+ */
+ public function is_purged($name)
+ {
+ return $this->is_available($name) && !$this->is_configured($name);
+ }
+
+ /**
+ * Instantiates a \phpbb\finder.
+ *
+ * @param bool $use_all_available Should we load all extensions, or just enabled ones
+ * @return \phpbb\finder An extension finder instance
+ */
+ public function get_finder($use_all_available = false)
+ {
+ $finder = new \phpbb\finder($this->filesystem, $this->phpbb_root_path, $this->cache, $this->php_ext, $this->cache_name . '_finder');
+ if ($use_all_available)
+ {
+ $finder->set_extensions(array_keys($this->all_available()));
+ }
+ else
+ {
+ $finder->set_extensions(array_keys($this->all_enabled()));
+ }
+ return $finder;
+ }
+}
diff --git a/phpBB/phpbb/extension/metadata_manager.php b/phpBB/phpbb/extension/metadata_manager.php
new file mode 100644
index 0000000000..a09f07bed2
--- /dev/null
+++ b/phpBB/phpbb/extension/metadata_manager.php
@@ -0,0 +1,343 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\extension;
+
+/**
+* The extension metadata manager validates and gets meta-data for extensions
+*/
+class metadata_manager
+{
+ /**
+ * phpBB Config instance
+ * @var \phpbb\config\config
+ */
+ protected $config;
+
+ /**
+ * phpBB Extension Manager
+ * @var \phpbb\extension\manager
+ */
+ protected $extension_manager;
+
+ /**
+ * phpBB Template instance
+ * @var \phpbb\template\template
+ */
+ protected $template;
+
+ /**
+ * phpBB User instance
+ * @var \phpbb\user
+ */
+ protected $user;
+
+ /**
+ * phpBB root path
+ * @var string
+ */
+ protected $phpbb_root_path;
+
+ /**
+ * Name (including vendor) of the extension
+ * @var string
+ */
+ protected $ext_name;
+
+ /**
+ * Metadata from the composer.json file
+ * @var array
+ */
+ protected $metadata;
+
+ /**
+ * Link (including root path) to the metadata file
+ * @var string
+ */
+ protected $metadata_file;
+
+ // @codingStandardsIgnoreStart
+ /**
+ * Creates the metadata manager
+ *
+ * @param string $ext_name Name (including vendor) of the extension
+ * @param \phpbb\config\config $config phpBB Config instance
+ * @param \phpbb\extension\manager $extension_manager An instance of the phpBB extension manager
+ * @param \phpbb\template\template $template phpBB Template instance or null
+ * @param \phpbb\user $user User instance
+ * @param string $phpbb_root_path Path to the phpbb includes directory.
+ */
+ public function __construct($ext_name, \phpbb\config\config $config, \phpbb\extension\manager $extension_manager, \phpbb\template\template $template = null, \phpbb\user $user, $phpbb_root_path)
+ {
+ $this->config = $config;
+ $this->extension_manager = $extension_manager;
+ $this->template = $template;
+ $this->user = $user;
+ $this->phpbb_root_path = $phpbb_root_path;
+
+ $this->ext_name = $ext_name;
+ $this->metadata = array();
+ $this->metadata_file = '';
+ }
+ // @codingStandardsIgnoreEnd
+
+ /**
+ * Processes and gets the metadata requested
+ *
+ * @param string $element All for all metadata that it has and is valid, otherwise specify which section you want by its shorthand term.
+ * @return array Contains all of the requested metadata, throws an exception on failure
+ */
+ public function get_metadata($element = 'all')
+ {
+ // Fetch and clean the metadata if not done yet
+ if ($this->metadata_file === '')
+ {
+ $this->fetch_metadata_from_file();
+ }
+
+ switch ($element)
+ {
+ case 'all':
+ default:
+ $this->validate();
+ return $this->metadata;
+ break;
+
+ case 'version':
+ case 'name':
+ $this->validate($element);
+ return $this->metadata[$element];
+ break;
+
+ case 'display-name':
+ return (isset($this->metadata['extra']['display-name'])) ? $this->metadata['extra']['display-name'] : $this->get_metadata('name');
+ break;
+ }
+ }
+
+ /**
+ * Sets the path of the metadata file, gets its contents and cleans loaded file
+ *
+ * @throws \phpbb\extension\exception
+ */
+ private function fetch_metadata_from_file()
+ {
+ $ext_filepath = $this->extension_manager->get_extension_path($this->ext_name);
+ $metadata_filepath = $this->phpbb_root_path . $ext_filepath . 'composer.json';
+
+ $this->metadata_file = $metadata_filepath;
+
+ if (!file_exists($this->metadata_file))
+ {
+ throw new \phpbb\extension\exception($this->user->lang('FILE_NOT_FOUND', $this->metadata_file));
+ }
+
+ if (!($file_contents = file_get_contents($this->metadata_file)))
+ {
+ throw new \phpbb\extension\exception($this->user->lang('FILE_CONTENT_ERR', $this->metadata_file));
+ }
+
+ if (($metadata = json_decode($file_contents, true)) === null)
+ {
+ throw new \phpbb\extension\exception($this->user->lang('FILE_JSON_DECODE_ERR', $this->metadata_file));
+ }
+
+ array_walk_recursive($metadata, array($this, 'sanitize_json'));
+ $this->metadata = $metadata;
+ }
+
+ /**
+ * Sanitize input from JSON array using htmlspecialchars()
+ *
+ * @param mixed $value Value of array row
+ * @param string $key Key of array row
+ */
+ public function sanitize_json(&$value, $key)
+ {
+ $value = htmlspecialchars($value);
+ }
+
+ /**
+ * Validate fields
+ *
+ * @param string $name ("all" for display and enable validation
+ * "display" for name, type, and authors
+ * "name", "type")
+ * @return Bool True if valid, throws an exception if invalid
+ * @throws \phpbb\extension\exception
+ */
+ public function validate($name = 'display')
+ {
+ // Basic fields
+ $fields = array(
+ 'name' => '#^[a-zA-Z0-9_\x7f-\xff]{2,}/[a-zA-Z0-9_\x7f-\xff]{2,}$#',
+ 'type' => '#^phpbb-extension$#',
+ 'license' => '#.+#',
+ 'version' => '#.+#',
+ );
+
+ switch ($name)
+ {
+ case 'all':
+ $this->validate_enable();
+ // no break
+
+ case 'display':
+ foreach ($fields as $field => $data)
+ {
+ $this->validate($field);
+ }
+
+ $this->validate_authors();
+ break;
+
+ default:
+ if (isset($fields[$name]))
+ {
+ if (!isset($this->metadata[$name]))
+ {
+ throw new \phpbb\extension\exception($this->user->lang('META_FIELD_NOT_SET', $name));
+ }
+
+ if (!preg_match($fields[$name], $this->metadata[$name]))
+ {
+ throw new \phpbb\extension\exception($this->user->lang('META_FIELD_INVALID', $name));
+ }
+ }
+ break;
+ }
+
+ return true;
+ }
+
+ /**
+ * Validates the contents of the authors field
+ *
+ * @return boolean True when passes validation, throws exception if invalid
+ * @throws \phpbb\extension\exception
+ */
+ public function validate_authors()
+ {
+ if (empty($this->metadata['authors']))
+ {
+ throw new \phpbb\extension\exception($this->user->lang('META_FIELD_NOT_SET', 'authors'));
+ }
+
+ foreach ($this->metadata['authors'] as $author)
+ {
+ if (!isset($author['name']))
+ {
+ throw new \phpbb\extension\exception($this->user->lang('META_FIELD_NOT_SET', 'author name'));
+ }
+ }
+
+ return true;
+ }
+
+ /**
+ * This array handles the verification that this extension can be enabled on this board
+ *
+ * @return bool True if validation succeeded, throws an exception if invalid
+ * @throws \phpbb\extension\exception
+ */
+ public function validate_enable()
+ {
+ // Check for valid directory & phpBB, PHP versions
+ return $this->validate_dir() && $this->validate_require_phpbb() && $this->validate_require_php();
+ }
+
+ /**
+ * Validates the most basic directory structure to ensure it follows <vendor>/<ext> convention.
+ *
+ * @return boolean True when passes validation, throws an exception if invalid
+ * @throws \phpbb\extension\exception
+ */
+ public function validate_dir()
+ {
+ if (substr_count($this->ext_name, '/') !== 1 || $this->ext_name != $this->get_metadata('name'))
+ {
+ throw new \phpbb\extension\exception($this->user->lang('EXTENSION_DIR_INVALID'));
+ }
+
+ return true;
+ }
+
+
+ /**
+ * Validates the contents of the phpbb requirement field
+ *
+ * @return boolean True when passes validation, throws an exception if invalid
+ * @throws \phpbb\extension\exception
+ */
+ public function validate_require_phpbb()
+ {
+ if (!isset($this->metadata['extra']['soft-require']['phpbb/phpbb']))
+ {
+ throw new \phpbb\extension\exception($this->user->lang('META_FIELD_NOT_SET', 'soft-require'));
+ }
+
+ return true;
+ }
+
+ /**
+ * Validates the contents of the php requirement field
+ *
+ * @return boolean True when passes validation, throws an exception if invalid
+ * @throws \phpbb\extension\exception
+ */
+ public function validate_require_php()
+ {
+ if (!isset($this->metadata['require']['php']))
+ {
+ throw new \phpbb\extension\exception($this->user->lang('META_FIELD_NOT_SET', 'require php'));
+ }
+
+ return true;
+ }
+
+ /**
+ * Outputs the metadata into the template
+ *
+ * @return null
+ */
+ public function output_template_data()
+ {
+ $this->template->assign_vars(array(
+ 'META_NAME' => $this->metadata['name'],
+ 'META_TYPE' => $this->metadata['type'],
+ 'META_DESCRIPTION' => (isset($this->metadata['description'])) ? $this->metadata['description'] : '',
+ 'META_HOMEPAGE' => (isset($this->metadata['homepage'])) ? $this->metadata['homepage'] : '',
+ 'META_VERSION' => (isset($this->metadata['version'])) ? $this->metadata['version'] : '',
+ 'META_TIME' => (isset($this->metadata['time'])) ? $this->metadata['time'] : '',
+ 'META_LICENSE' => $this->metadata['license'],
+
+ 'META_REQUIRE_PHP' => (isset($this->metadata['require']['php'])) ? $this->metadata['require']['php'] : '',
+ 'META_REQUIRE_PHP_FAIL' => (isset($this->metadata['require']['php'])) ? false : true,
+
+ 'META_REQUIRE_PHPBB' => (isset($this->metadata['extra']['soft-require']['phpbb/phpbb'])) ? $this->metadata['extra']['soft-require']['phpbb/phpbb'] : '',
+ 'META_REQUIRE_PHPBB_FAIL' => (isset($this->metadata['extra']['soft-require']['phpbb/phpbb'])) ? false : true,
+
+ 'META_DISPLAY_NAME' => (isset($this->metadata['extra']['display-name'])) ? $this->metadata['extra']['display-name'] : '',
+ ));
+
+ foreach ($this->metadata['authors'] as $author)
+ {
+ $this->template->assign_block_vars('meta_authors', array(
+ 'AUTHOR_NAME' => $author['name'],
+ 'AUTHOR_EMAIL' => (isset($author['email'])) ? $author['email'] : '',
+ 'AUTHOR_HOMEPAGE' => (isset($author['homepage'])) ? $author['homepage'] : '',
+ 'AUTHOR_ROLE' => (isset($author['role'])) ? $author['role'] : '',
+ ));
+ }
+ }
+}
diff --git a/phpBB/phpbb/extension/provider.php b/phpBB/phpbb/extension/provider.php
new file mode 100644
index 0000000000..1c42cf7b5e
--- /dev/null
+++ b/phpBB/phpbb/extension/provider.php
@@ -0,0 +1,72 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\extension;
+
+/**
+* Provides a set of items found in extensions.
+*
+* This abstract class is essentially a wrapper around item-specific
+* finding logic. It handles storing the extension manager via constructor
+* for the finding logic to use to find the items, and provides an
+* iterator interface over the items found by the finding logic.
+*
+* Items could be anything, for example template paths or cron task names.
+* Derived classes completely define what the items are.
+*/
+abstract class provider implements \IteratorAggregate
+{
+ /**
+ * Array holding all found items
+ * @var array|null
+ */
+ protected $items = null;
+
+ /**
+ * An extension manager to search for items in extensions
+ * @var \phpbb\extension\manager
+ */
+ protected $extension_manager;
+
+ /**
+ * Constructor. Loads all available items.
+ *
+ * @param \phpbb\extension\manager $extension_manager phpBB extension manager
+ */
+ public function __construct(\phpbb\extension\manager $extension_manager)
+ {
+ $this->extension_manager = $extension_manager;
+ }
+
+ /**
+ * Finds items using the extension manager.
+ *
+ * @return array List of task names
+ */
+ abstract protected function find();
+
+ /**
+ * Retrieve an iterator over all items
+ *
+ * @return \ArrayIterator An iterator for the array of template paths
+ */
+ public function getIterator()
+ {
+ if ($this->items === null)
+ {
+ $this->items = $this->find();
+ }
+
+ return new \ArrayIterator($this->items);
+ }
+}
diff --git a/phpBB/phpbb/feed/attachments_base.php b/phpBB/phpbb/feed/attachments_base.php
new file mode 100644
index 0000000000..df8f29a626
--- /dev/null
+++ b/phpBB/phpbb/feed/attachments_base.php
@@ -0,0 +1,97 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\feed;
+
+/**
+* Abstract class for feeds displaying attachments
+*/
+abstract class attachments_base extends \phpbb\feed\base
+{
+ /**
+ * Attachments that may be displayed
+ */
+ protected $attachments = array();
+
+ /**
+ * Retrieve the list of attachments that may be displayed
+ *
+ * @param array $post_ids Specify for which post IDs to fetch the attachments (optional)
+ * @param array $topic_ids Specify for which topic IDs to fetch the attachments (optional)
+ */
+ protected function fetch_attachments($post_ids = array(), $topic_ids = array())
+ {
+ $sql_array = array(
+ 'SELECT' => 'a.*',
+ 'FROM' => array(
+ ATTACHMENTS_TABLE => 'a'
+ ),
+ 'WHERE' => 'a.in_message = 0 ',
+ 'ORDER_BY' => 'a.filetime DESC, a.post_msg_id ASC',
+ );
+
+ if (!empty($post_ids))
+ {
+ $sql_array['WHERE'] .= 'AND ' . $this->db->sql_in_set('a.post_msg_id', $post_ids);
+ }
+ else if (!empty($topic_ids))
+ {
+ if (isset($this->topic_id))
+ {
+ $topic_ids[] = $this->topic_id;
+ }
+
+ $sql_array['WHERE'] .= 'AND ' . $this->db->sql_in_set('a.topic_id', $topic_ids);
+ }
+ else if (isset($this->topic_id))
+ {
+ $sql_array['WHERE'] .= 'AND a.topic_id = ' . (int) $this->topic_id;
+ }
+ else if (isset($this->forum_id))
+ {
+ $sql_array['LEFT_JOIN'] = array(
+ array(
+ 'FROM' => array(TOPICS_TABLE => 't'),
+ 'ON' => 'a.topic_id = t.topic_id',
+ )
+ );
+ $sql_array['WHERE'] .= 'AND t.forum_id = ' . (int) $this->forum_id;
+ }
+ else
+ {
+ // Do not allow querying the full attachments table
+ throw new \RuntimeException($this->user->lang('INVALID_FEED_ATTACHMENTS'));
+ }
+
+ $sql = $this->db->sql_build_query('SELECT', $sql_array);
+ $result = $this->db->sql_query($sql);
+
+ // Set attachments in feed items
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $this->attachments[$row['post_msg_id']][] = $row;
+ }
+ $this->db->sql_freeresult($result);
+ }
+
+ /**
+ * Get attachments related to a given post
+ *
+ * @param $post_id int Post id
+ * @return mixed Attachments related to $post_id
+ */
+ public function get_attachments($post_id)
+ {
+ return $this->attachments[$post_id];
+ }
+}
diff --git a/phpBB/phpbb/feed/base.php b/phpBB/phpbb/feed/base.php
new file mode 100644
index 0000000000..eeea0a55df
--- /dev/null
+++ b/phpBB/phpbb/feed/base.php
@@ -0,0 +1,296 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\feed;
+
+/**
+* Base class with some generic functions and settings.
+*/
+abstract class base
+{
+ /**
+ * Feed helper object
+ * @var \phpbb\feed\helper
+ */
+ protected $helper;
+
+ /** @var \phpbb\config\config */
+ protected $config;
+
+ /** @var \phpbb\db\driver\driver_interface */
+ protected $db;
+
+ /** @var \phpbb\cache\driver\driver_interface */
+ protected $cache;
+
+ /** @var \phpbb\user */
+ protected $user;
+
+ /** @var \phpbb\auth\auth */
+ protected $auth;
+
+ /** @var \phpbb\content_visibility */
+ protected $content_visibility;
+
+ /** @var \phpbb\event\dispatcher_interface */
+ protected $phpbb_dispatcher;
+
+ /** @var string */
+ protected $phpEx;
+
+ /**
+ * SQL Query to be executed to get feed items
+ */
+ var $sql = array();
+
+ /**
+ * Keys specified for retrieval of title, content, etc.
+ */
+ var $keys = array();
+
+ /**
+ * Number of items to fetch. Usually overwritten by $config['feed_something']
+ */
+ var $num_items = 15;
+
+ /**
+ * Separator for title elements to separate items (for example forum / topic)
+ */
+ var $separator = "\xE2\x80\xA2"; // &bull;
+
+ /**
+ * Separator for the statistics row (Posted by, post date, replies, etc.)
+ */
+ var $separator_stats = "\xE2\x80\x94"; // &mdash;
+
+ /** @var mixed Query result handle */
+ protected $result;
+
+ /**
+ * Constructor
+ *
+ * @param \phpbb\feed\helper $helper Feed helper
+ * @param \phpbb\config\config $config Config object
+ * @param \phpbb\db\driver\driver_interface $db Database connection
+ * @param \phpbb\cache\driver\driver_interface $cache Cache object
+ * @param \phpbb\user $user User object
+ * @param \phpbb\auth\auth $auth Auth object
+ * @param \phpbb\content_visibility $content_visibility Content visibility object
+ * @param \phpbb\event\dispatcher_interface $phpbb_dispatcher Event dispatcher object
+ * @param string $phpEx php file extension
+ */
+ function __construct(
+ \phpbb\feed\helper $helper,
+ \phpbb\config\config $config,
+ \phpbb\db\driver\driver_interface $db,
+ \phpbb\cache\driver\driver_interface $cache,
+ \phpbb\user $user,
+ \phpbb\auth\auth $auth,
+ \phpbb\content_visibility $content_visibility,
+ \phpbb\event\dispatcher_interface $phpbb_dispatcher,
+ $phpEx
+ )
+ {
+ $this->config = $config;
+ $this->helper = $helper;
+ $this->db = $db;
+ $this->cache = $cache;
+ $this->user = $user;
+ $this->auth = $auth;
+ $this->content_visibility = $content_visibility;
+ $this->phpbb_dispatcher = $phpbb_dispatcher;
+ $this->phpEx = $phpEx;
+
+ $this->set_keys();
+
+ // Allow num_items to be string
+ if (is_string($this->num_items))
+ {
+ $this->num_items = (int) $this->config[$this->num_items];
+
+ // A precaution
+ if (!$this->num_items)
+ {
+ $this->num_items = 10;
+ }
+ }
+ }
+
+ /**
+ * Set keys.
+ */
+ function set_keys()
+ {
+ }
+
+ /**
+ * Open feed
+ */
+ function open()
+ {
+ }
+
+ /**
+ * Close feed
+ */
+ function close()
+ {
+ if (!empty($this->result))
+ {
+ $this->db->sql_freeresult($this->result);
+ }
+ }
+
+ /**
+ * Set key
+ *
+ * @param string $key Key
+ * @param mixed $value Value
+ */
+ function set($key, $value)
+ {
+ $this->keys[$key] = $value;
+ }
+
+ /**
+ * Get key
+ *
+ * @param string $key Key
+ * @return mixed
+ */
+ function get($key)
+ {
+ return (isset($this->keys[$key])) ? $this->keys[$key] : null;
+ }
+
+ function get_readable_forums()
+ {
+ static $forum_ids;
+
+ if (!isset($forum_ids))
+ {
+ $forum_ids = array_keys($this->auth->acl_getf('f_read', true));
+ }
+
+ return $forum_ids;
+ }
+
+ function get_moderator_approve_forums()
+ {
+ static $forum_ids;
+
+ if (!isset($forum_ids))
+ {
+ $forum_ids = array_keys($this->auth->acl_getf('m_approve', true));
+ }
+
+ return $forum_ids;
+ }
+
+ function is_moderator_approve_forum($forum_id)
+ {
+ static $forum_ids;
+
+ if (!isset($forum_ids))
+ {
+ $forum_ids = array_flip($this->get_moderator_approve_forums());
+ }
+
+ return (isset($forum_ids[$forum_id])) ? true : false;
+ }
+
+ function get_excluded_forums()
+ {
+ static $forum_ids;
+
+ // Matches acp/acp_board.php
+ $cache_name = 'feed_excluded_forum_ids';
+
+ if (!isset($forum_ids) && ($forum_ids = $this->cache->get('_' . $cache_name)) === false)
+ {
+ $sql = 'SELECT forum_id
+ FROM ' . FORUMS_TABLE . '
+ WHERE ' . $this->db->sql_bit_and('forum_options', FORUM_OPTION_FEED_EXCLUDE, '<> 0');
+ $result = $this->db->sql_query($sql);
+
+ $forum_ids = array();
+ while ($forum_id = (int) $this->db->sql_fetchfield('forum_id'))
+ {
+ $forum_ids[$forum_id] = $forum_id;
+ }
+ $this->db->sql_freeresult($result);
+
+ $this->cache->put('_' . $cache_name, $forum_ids);
+ }
+
+ return $forum_ids;
+ }
+
+ function is_excluded_forum($forum_id)
+ {
+ $forum_ids = $this->get_excluded_forums();
+
+ return isset($forum_ids[$forum_id]) ? true : false;
+ }
+
+ function get_passworded_forums()
+ {
+ return $this->user->get_passworded_forums();
+ }
+
+ function get_item()
+ {
+ if (!isset($this->result))
+ {
+ if (!$this->get_sql())
+ {
+ return false;
+ }
+
+ $sql_ary = $this->sql;
+
+ /**
+ * Event to modify the feed item sql
+ *
+ * @event core.feed_base_modify_item_sql
+ * @var array sql_ary The SQL array to get the feed item data
+ *
+ * @since 3.1.10-RC1
+ */
+ $vars = array('sql_ary');
+ extract($this->phpbb_dispatcher->trigger_event('core.feed_base_modify_item_sql', compact($vars)));
+ $this->sql = $sql_ary;
+ unset($sql_ary);
+
+ // Query database
+ $sql = $this->db->sql_build_query('SELECT', $this->sql);
+ $this->result = $this->db->sql_query_limit($sql, $this->num_items);
+ }
+
+ return $this->db->sql_fetchrow($this->result);
+ }
+
+ function user_viewprofile($row)
+ {
+ $author_id = (int) $row[$this->get('author_id')];
+
+ if ($author_id == ANONYMOUS)
+ {
+ // Since we cannot link to a profile, we just return GUEST
+ // instead of $row['username']
+ return $this->user->lang['GUEST'];
+ }
+
+ return '<a href="' . $this->helper->append_sid('memberlist.' . $this->phpEx, 'mode=viewprofile&amp;u=' . $author_id) . '">' . $row[$this->get('creator')] . '</a>';
+ }
+}
diff --git a/phpBB/phpbb/feed/factory.php b/phpBB/phpbb/feed/factory.php
new file mode 100644
index 0000000000..f364f06d03
--- /dev/null
+++ b/phpBB/phpbb/feed/factory.php
@@ -0,0 +1,127 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\feed;
+
+use Symfony\Component\DependencyInjection\ContainerInterface;
+
+/**
+* Factory class to return correct object
+*/
+class factory
+{
+ /**
+ * Service container object
+ * @var ContainerInterface
+ */
+ protected $container;
+
+ /** @var \phpbb\config\config */
+ protected $config;
+
+ /** @var \phpbb\db\driver\driver_interface */
+ protected $db;
+
+ /**
+ * Constructor
+ *
+ * @param ContainerInterface $container Container object
+ * @param \phpbb\config\config $config Config object
+ * @param \phpbb\db\driver\driver_interface $db Database connection
+ */
+ public function __construct(ContainerInterface $container, \phpbb\config\config $config, \phpbb\db\driver\driver_interface $db)
+ {
+ $this->container = $container;
+ $this->config = $config;
+ $this->db = $db;
+ }
+
+ /**
+ * Return correct object for specified mode
+ *
+ * @param string $mode The feeds mode.
+ * @param int $forum_id Forum id specified by the script if forum feed provided.
+ * @param int $topic_id Topic id specified by the script if topic feed provided.
+ *
+ * @return object Returns correct feeds object for specified mode.
+ */
+ function get_feed($mode, $forum_id, $topic_id)
+ {
+ switch ($mode)
+ {
+ case 'forums':
+ if (!$this->config['feed_overall_forums'])
+ {
+ return false;
+ }
+
+ return $this->container->get('feed.forums');
+ break;
+
+ case 'topics':
+ case 'topics_new':
+ if (!$this->config['feed_topics_new'])
+ {
+ return false;
+ }
+
+ return $this->container->get('feed.topics');
+ break;
+
+ case 'topics_active':
+ if (!$this->config['feed_topics_active'])
+ {
+ return false;
+ }
+
+ return $this->container->get('feed.topics_active');
+ break;
+
+ case 'news':
+ // Get at least one news forum
+ $sql = 'SELECT forum_id
+ FROM ' . FORUMS_TABLE . '
+ WHERE ' . $this->db->sql_bit_and('forum_options', FORUM_OPTION_FEED_NEWS, '<> 0');
+ $result = $this->db->sql_query_limit($sql, 1, 0, 600);
+ $s_feed_news = (int) $this->db->sql_fetchfield('forum_id');
+ $this->db->sql_freeresult($result);
+
+ if (!$s_feed_news)
+ {
+ return false;
+ }
+
+ return $this->container->get('feed.news');
+ break;
+
+ default:
+ if ($topic_id && $this->config['feed_topic'])
+ {
+ return $this->container->get('feed.topic')
+ ->set_topic_id($topic_id);
+ }
+ else if ($forum_id && $this->config['feed_forum'])
+ {
+ return $this->container->get('feed.forum')
+ ->set_forum_id($forum_id);
+ }
+ else if ($this->config['feed_overall'])
+ {
+ return $this->container->get('feed.overall');
+ }
+
+ return false;
+ break;
+ }
+ }
+}
diff --git a/phpBB/phpbb/feed/forum.php b/phpBB/phpbb/feed/forum.php
new file mode 100644
index 0000000000..6aba12a147
--- /dev/null
+++ b/phpBB/phpbb/feed/forum.php
@@ -0,0 +1,146 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\feed;
+
+/**
+* Forum feed
+*
+* This will give you the last {$this->num_items} posts made
+* within a specific forum.
+*/
+class forum extends \phpbb\feed\post_base
+{
+ var $forum_id = 0;
+ var $forum_data = array();
+
+ /**
+ * Set the Forum ID
+ *
+ * @param int $forum_id Forum ID
+ * @return \phpbb\feed\forum
+ */
+ public function set_forum_id($forum_id)
+ {
+ $this->forum_id = (int) $forum_id;
+
+ return $this;
+ }
+
+ function open()
+ {
+ // Check if forum exists
+ $sql = 'SELECT forum_id, forum_name, forum_password, forum_type, forum_options
+ FROM ' . FORUMS_TABLE . '
+ WHERE forum_id = ' . $this->forum_id;
+ $result = $this->db->sql_query($sql);
+ $this->forum_data = $this->db->sql_fetchrow($result);
+ $this->db->sql_freeresult($result);
+
+ if (empty($this->forum_data))
+ {
+ trigger_error('NO_FORUM');
+ }
+
+ // Forum needs to be postable
+ if ($this->forum_data['forum_type'] != FORUM_POST)
+ {
+ trigger_error('NO_FEED');
+ }
+
+ // Make sure forum is not excluded from feed
+ if (phpbb_optionget(FORUM_OPTION_FEED_EXCLUDE, $this->forum_data['forum_options']))
+ {
+ trigger_error('NO_FEED');
+ }
+
+ // Make sure we can read this forum
+ if (!$this->auth->acl_get('f_read', $this->forum_id))
+ {
+ trigger_error('SORRY_AUTH_READ');
+ }
+
+ // Make sure forum is not passworded or user is authed
+ if ($this->forum_data['forum_password'])
+ {
+ $forum_ids_passworded = $this->get_passworded_forums();
+
+ if (isset($forum_ids_passworded[$this->forum_id]))
+ {
+ trigger_error('SORRY_AUTH_READ');
+ }
+
+ unset($forum_ids_passworded);
+ }
+
+ parent::open();
+ }
+
+ function get_sql()
+ {
+ // Determine topics with recent activity
+ $sql = 'SELECT topic_id, topic_last_post_time
+ FROM ' . TOPICS_TABLE . '
+ WHERE forum_id = ' . $this->forum_id . '
+ AND topic_moved_id = 0
+ AND ' . $this->content_visibility->get_visibility_sql('topic', $this->forum_id) . '
+ ORDER BY topic_last_post_time DESC, topic_last_post_id DESC';
+ $result = $this->db->sql_query_limit($sql, $this->num_items);
+
+ $topic_ids = array();
+ $min_post_time = 0;
+ while ($row = $this->db->sql_fetchrow())
+ {
+ $topic_ids[] = (int) $row['topic_id'];
+
+ $min_post_time = (int) $row['topic_last_post_time'];
+ }
+ $this->db->sql_freeresult($result);
+
+ if (empty($topic_ids))
+ {
+ return false;
+ }
+
+ parent::fetch_attachments(array(), $topic_ids);
+
+ $this->sql = array(
+ 'SELECT' => 'p.post_id, p.topic_id, p.post_time, p.post_edit_time, p.post_visibility, p.post_subject, p.post_text, p.bbcode_bitfield, p.bbcode_uid, p.enable_bbcode, p.enable_smilies, p.enable_magic_url, p.post_attachment, ' .
+ 'u.username, u.user_id',
+ 'FROM' => array(
+ POSTS_TABLE => 'p',
+ USERS_TABLE => 'u',
+ ),
+ 'WHERE' => $this->db->sql_in_set('p.topic_id', $topic_ids) . '
+ AND ' . $this->content_visibility->get_visibility_sql('post', $this->forum_id, 'p.') . '
+ AND p.post_time >= ' . $min_post_time . '
+ AND p.poster_id = u.user_id',
+ 'ORDER_BY' => 'p.post_time DESC, p.post_id DESC',
+ );
+
+ return true;
+ }
+
+ function adjust_item(&$item_row, &$row)
+ {
+ parent::adjust_item($item_row, $row);
+
+ $item_row['title'] = (isset($row['forum_name']) && $row['forum_name'] !== '') ? $row['forum_name'] . ' ' . $this->separator . ' ' . $item_row['title'] : $item_row['title'];
+ $item_row['forum_id'] = $this->forum_id;
+ }
+
+ function get_item()
+ {
+ return ($row = parent::get_item()) ? array_merge($this->forum_data, $row) : $row;
+ }
+}
diff --git a/phpBB/phpbb/feed/forums.php b/phpBB/phpbb/feed/forums.php
new file mode 100644
index 0000000000..ee14a5bc76
--- /dev/null
+++ b/phpBB/phpbb/feed/forums.php
@@ -0,0 +1,68 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\feed;
+
+/**
+* 'All Forums' feed
+*
+* This will give you a list of all postable forums where feeds are enabled
+* including forum description, topic stats and post stats
+*/
+class forums extends \phpbb\feed\base
+{
+ var $num_items = 0;
+
+ function set_keys()
+ {
+ $this->set('title', 'forum_name');
+ $this->set('text', 'forum_desc');
+ $this->set('bitfield', 'forum_desc_bitfield');
+ $this->set('bbcode_uid','forum_desc_uid');
+ $this->set('updated', 'forum_last_post_time');
+ $this->set('options', 'forum_desc_options');
+ }
+
+ function get_sql()
+ {
+ $in_fid_ary = array_diff($this->get_readable_forums(), $this->get_excluded_forums());
+ if (empty($in_fid_ary))
+ {
+ return false;
+ }
+
+ // Build SQL Query
+ $this->sql = array(
+ 'SELECT' => 'f.forum_id, f.left_id, f.forum_name, f.forum_last_post_time,
+ f.forum_desc, f.forum_desc_bitfield, f.forum_desc_uid, f.forum_desc_options,
+ f.forum_topics_approved, f.forum_posts_approved',
+ 'FROM' => array(FORUMS_TABLE => 'f'),
+ 'WHERE' => 'f.forum_type = ' . FORUM_POST . '
+ AND ' . $this->db->sql_in_set('f.forum_id', $in_fid_ary),
+ 'ORDER_BY' => 'f.left_id ASC',
+ );
+
+ return true;
+ }
+
+ function adjust_item(&$item_row, &$row)
+ {
+ $item_row['link'] = $this->helper->append_sid('viewforum.' . $this->phpEx, 'f=' . $row['forum_id']);
+
+ if ($this->config['feed_item_statistics'])
+ {
+ $item_row['statistics'] = $this->user->lang('TOTAL_TOPICS', (int) $row['forum_topics_approved'])
+ . ' ' . $this->separator_stats . ' ' . $this->user->lang('TOTAL_POSTS_COUNT', (int) $row['forum_posts_approved']);
+ }
+ }
+}
diff --git a/phpBB/phpbb/feed/helper.php b/phpBB/phpbb/feed/helper.php
new file mode 100644
index 0000000000..f2030f5ced
--- /dev/null
+++ b/phpBB/phpbb/feed/helper.php
@@ -0,0 +1,179 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\feed;
+
+/**
+* Class with some helpful functions used in feeds
+*/
+class helper
+{
+ /** @var \phpbb\config\config */
+ protected $config;
+
+ /** @var \phpbb\user */
+ protected $user;
+
+ /** @var string */
+ protected $phpbb_root_path;
+
+ /** @var string */
+ protected $phpEx;
+
+ /**
+ * Constructor
+ *
+ * @param \phpbb\config\config $config Config object
+ * @param \phpbb\user $user User object
+ * @param string $phpbb_root_path Root path
+ * @param string $phpEx PHP file extension
+ */
+ public function __construct(\phpbb\config\config $config, \phpbb\user $user, $phpbb_root_path, $phpEx)
+ {
+ $this->config = $config;
+ $this->user = $user;
+ $this->phpbb_root_path = $phpbb_root_path;
+ $this->phpEx = $phpEx;
+ }
+
+ /**
+ * Run links through append_sid(), prepend generate_board_url() and remove session id
+ */
+ public function get_board_url()
+ {
+ static $board_url;
+
+ if (empty($board_url))
+ {
+ $board_url = generate_board_url();
+ }
+
+ return $board_url;
+ }
+
+ /**
+ * Run links through append_sid(), prepend generate_board_url() and remove session id
+ */
+ public function append_sid($url, $params)
+ {
+ return append_sid($this->get_board_url() . '/' . $url, $params, true, '');
+ }
+
+ /**
+ * Generate ISO 8601 date string (RFC 3339)
+ */
+ public function format_date($time)
+ {
+ static $zone_offset;
+ static $offset_string;
+
+ if (empty($offset_string))
+ {
+ $zone_offset = $this->user->create_datetime()->getOffset();
+ $offset_string = phpbb_format_timezone_offset($zone_offset);
+ }
+
+ return gmdate("Y-m-d\TH:i:s", $time + $zone_offset) . $offset_string;
+ }
+
+ /**
+ * Generate text content
+ *
+ * @param string $content is feed text content
+ * @param string $uid is bbcode_uid
+ * @param string $bitfield is bbcode bitfield
+ * @param int $options bbcode flag options
+ * @param int $forum_id is the forum id
+ * @param array $post_attachments is an array containing the attachments and their respective info
+ * @return string the html content to be printed for the feed
+ */
+ public function generate_content($content, $uid, $bitfield, $options, $forum_id, $post_attachments)
+ {
+ if (empty($content))
+ {
+ return '';
+ }
+
+ // Prepare some bbcodes for better parsing
+ $content = preg_replace("#\[quote(=&quot;.*?&quot;)?:$uid\]\s*(.*?)\s*\[/quote:$uid\]#si", "[quote$1:$uid]<br />$2<br />[/quote:$uid]", $content);
+
+ $content = generate_text_for_display($content, $uid, $bitfield, $options);
+
+ // Add newlines
+ $content = str_replace('<br />', '<br />' . "\n", $content);
+
+ // Convert smiley Relative paths to Absolute path, Windows style
+ $content = str_replace($this->phpbb_root_path . $this->config['smilies_path'], $this->get_board_url() . '/' . $this->config['smilies_path'], $content);
+
+ // Remove "Select all" link and mouse events
+ $content = str_replace('<a href="#" onclick="selectCode(this); return false;">' . $this->user->lang['SELECT_ALL_CODE'] . '</a>', '', $content);
+ $content = preg_replace('#(onkeypress|onclick)="(.*?)"#si', '', $content);
+
+ // Firefox does not support CSS for feeds, though
+
+ // Remove font sizes
+ // $content = preg_replace('#<span style="font-size: [0-9]+%; line-height: [0-9]+%;">([^>]+)</span>#iU', '\1', $content);
+
+ // Make text strong :P
+ // $content = preg_replace('#<span style="font-weight: bold?">(.*?)</span>#iU', '<strong>\1</strong>', $content);
+
+ // Italic
+ // $content = preg_replace('#<span style="font-style: italic?">([^<]+)</span>#iU', '<em>\1</em>', $content);
+
+ // Underline
+ // $content = preg_replace('#<span style="text-decoration: underline?">([^<]+)</span>#iU', '<u>\1</u>', $content);
+
+ // Remove embed Windows Media Streams
+ $content = preg_replace( '#<\!--\[if \!IE\]>-->([^[]+)<\!--<!\[endif\]-->#si', '', $content);
+
+ // Do not use &lt; and &gt;, because we want to retain code contained in [code][/code]
+
+ // Remove embed and objects
+ $content = preg_replace( '#<(object|embed)(.*?) (value|src)=(.*?) ([^[]+)(object|embed)>#si',' <a href=$4 target="_blank"><strong>$1</strong></a> ',$content);
+
+ // Remove some specials html tag, because somewhere there are a mod to allow html tags ;)
+ $content = preg_replace( '#<(script|iframe)([^[]+)\1>#siU', ' <strong>$1</strong> ', $content);
+
+ // Parse inline images to display with the feed
+ if (!empty($post_attachments))
+ {
+ $update_count = array();
+ parse_attachments($forum_id, $content, $post_attachments, $update_count);
+ $content .= implode('<br />', $post_attachments);
+
+ // Convert attachments' relative path to absolute path
+ $content = str_replace($this->phpbb_root_path . 'download/file.' . $this->phpEx, $this->get_board_url() . '/download/file.' . $this->phpEx, $content);
+ }
+
+ // Remove Comments from inline attachments [ia]
+ $content = preg_replace('#<dd>(.*?)</dd>#','',$content);
+
+ // Replace some entities with their unicode counterpart
+ $entities = array(
+ '&nbsp;' => "\xC2\xA0",
+ '&bull;' => "\xE2\x80\xA2",
+ '&middot;' => "\xC2\xB7",
+ '&copy;' => "\xC2\xA9",
+ );
+
+ $content = str_replace(array_keys($entities), array_values($entities), $content);
+
+ // Remove CDATA blocks. ;)
+ $content = preg_replace('#\<\!\[CDATA\[(.*?)\]\]\>#s', '', $content);
+
+ // Other control characters
+ $content = preg_replace('#(?:[\x00-\x1F\x7F]+|(?:\xC2[\x80-\x9F])+)#', '', $content);
+
+ return $content;
+ }
+}
diff --git a/phpBB/phpbb/feed/news.php b/phpBB/phpbb/feed/news.php
new file mode 100644
index 0000000000..5d4786518b
--- /dev/null
+++ b/phpBB/phpbb/feed/news.php
@@ -0,0 +1,109 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\feed;
+
+/**
+* News feed
+*
+* This will give you {$this->num_items} first posts
+* of all topics in the selected news forums.
+*/
+class news extends \phpbb\feed\topic_base
+{
+ function get_news_forums()
+ {
+ static $forum_ids;
+
+ // Matches acp/acp_board.php
+ $cache_name = 'feed_news_forum_ids';
+
+ if (!isset($forum_ids) && ($forum_ids = $this->cache->get('_' . $cache_name)) === false)
+ {
+ $sql = 'SELECT forum_id
+ FROM ' . FORUMS_TABLE . '
+ WHERE ' . $this->db->sql_bit_and('forum_options', FORUM_OPTION_FEED_NEWS, '<> 0');
+ $result = $this->db->sql_query($sql);
+
+ $forum_ids = array();
+ while ($forum_id = (int) $this->db->sql_fetchfield('forum_id'))
+ {
+ $forum_ids[$forum_id] = $forum_id;
+ }
+ $this->db->sql_freeresult($result);
+
+ $this->cache->put('_' . $cache_name, $forum_ids);
+ }
+
+ return $forum_ids;
+ }
+
+ function get_sql()
+ {
+ // Determine forum ids
+ $in_fid_ary = array_intersect($this->get_news_forums(), $this->get_readable_forums());
+ if (empty($in_fid_ary))
+ {
+ return false;
+ }
+
+ $in_fid_ary = array_diff($in_fid_ary, $this->get_passworded_forums());
+ if (empty($in_fid_ary))
+ {
+ return false;
+ }
+
+ // We really have to get the post ids first!
+ $sql = 'SELECT topic_first_post_id, topic_time
+ FROM ' . TOPICS_TABLE . '
+ WHERE topic_moved_id = 0
+ AND ' . $this->content_visibility->get_forums_visibility_sql('topic', $in_fid_ary) . '
+ ORDER BY topic_time DESC';
+ $result = $this->db->sql_query_limit($sql, $this->num_items);
+
+ $post_ids = array();
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $post_ids[] = (int) $row['topic_first_post_id'];
+ }
+ $this->db->sql_freeresult($result);
+
+ if (empty($post_ids))
+ {
+ return false;
+ }
+
+ parent::fetch_attachments($post_ids);
+
+ $this->sql = array(
+ 'SELECT' => 'f.forum_id, f.forum_name,
+ t.topic_id, t.topic_title, t.topic_poster, t.topic_first_poster_name, t.topic_posts_approved, t.topic_posts_unapproved, t.topic_posts_softdeleted, t.topic_views, t.topic_time, t.topic_last_post_time,
+ p.post_id, p.post_time, p.post_edit_time, p.post_text, p.bbcode_bitfield, p.bbcode_uid, p.enable_bbcode, p.enable_smilies, p.enable_magic_url, p.post_attachment, t.topic_visibility',
+ 'FROM' => array(
+ TOPICS_TABLE => 't',
+ POSTS_TABLE => 'p',
+ ),
+ 'LEFT_JOIN' => array(
+ array(
+ 'FROM' => array(FORUMS_TABLE => 'f'),
+ 'ON' => 'p.forum_id = f.forum_id',
+ ),
+ ),
+ 'WHERE' => 'p.topic_id = t.topic_id
+ AND ' . $this->db->sql_in_set('p.post_id', $post_ids),
+ 'ORDER_BY' => 'p.post_time DESC, p.post_id DESC',
+ );
+
+ return true;
+ }
+}
diff --git a/phpBB/phpbb/feed/overall.php b/phpBB/phpbb/feed/overall.php
new file mode 100644
index 0000000000..1176a9c182
--- /dev/null
+++ b/phpBB/phpbb/feed/overall.php
@@ -0,0 +1,88 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\feed;
+
+/**
+* Board wide feed (aka overall feed)
+*
+* This will give you the newest {$this->num_items} posts
+* from the whole board.
+*/
+class overall extends \phpbb\feed\post_base
+{
+ function get_sql()
+ {
+ $forum_ids = array_diff($this->get_readable_forums(), $this->get_excluded_forums(), $this->get_passworded_forums());
+ if (empty($forum_ids))
+ {
+ return false;
+ }
+
+ // Determine topics with recent activity
+ $sql = 'SELECT topic_id, topic_last_post_time
+ FROM ' . TOPICS_TABLE . '
+ WHERE topic_moved_id = 0
+ AND ' . $this->content_visibility->get_forums_visibility_sql('topic', $forum_ids) . '
+ ORDER BY topic_last_post_time DESC, topic_last_post_id DESC';
+ $result = $this->db->sql_query_limit($sql, $this->num_items);
+
+ $topic_ids = array();
+ $min_post_time = 0;
+ while ($row = $this->db->sql_fetchrow())
+ {
+ $topic_ids[] = (int) $row['topic_id'];
+
+ $min_post_time = (int) $row['topic_last_post_time'];
+ }
+ $this->db->sql_freeresult($result);
+
+ if (empty($topic_ids))
+ {
+ return false;
+ }
+
+ parent::fetch_attachments(array(), $topic_ids);
+
+ // Get the actual data
+ $this->sql = array(
+ 'SELECT' => 'f.forum_id, f.forum_name, ' .
+ 'p.post_id, p.topic_id, p.post_time, p.post_edit_time, p.post_visibility, p.post_subject, p.post_text, p.bbcode_bitfield, p.bbcode_uid, p.enable_bbcode, p.enable_smilies, p.enable_magic_url, p.post_attachment, ' .
+ 'u.username, u.user_id',
+ 'FROM' => array(
+ USERS_TABLE => 'u',
+ POSTS_TABLE => 'p',
+ ),
+ 'LEFT_JOIN' => array(
+ array(
+ 'FROM' => array(FORUMS_TABLE => 'f'),
+ 'ON' => 'f.forum_id = p.forum_id',
+ ),
+ ),
+ 'WHERE' => $this->db->sql_in_set('p.topic_id', $topic_ids) . '
+ AND ' . $this->content_visibility->get_forums_visibility_sql('post', $forum_ids, 'p.') . '
+ AND p.post_time >= ' . $min_post_time . '
+ AND u.user_id = p.poster_id',
+ 'ORDER_BY' => 'p.post_time DESC, p.post_id DESC',
+ );
+
+ return true;
+ }
+
+ function adjust_item(&$item_row, &$row)
+ {
+ parent::adjust_item($item_row, $row);
+
+ $item_row['title'] = (isset($row['forum_name']) && $row['forum_name'] !== '') ? $row['forum_name'] . ' ' . $this->separator . ' ' . $item_row['title'] : $item_row['title'];
+ }
+}
diff --git a/phpBB/phpbb/feed/post_base.php b/phpBB/phpbb/feed/post_base.php
new file mode 100644
index 0000000000..011775b6af
--- /dev/null
+++ b/phpBB/phpbb/feed/post_base.php
@@ -0,0 +1,55 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\feed;
+
+/**
+* Abstract class for post based feeds
+*/
+abstract class post_base extends \phpbb\feed\attachments_base
+{
+ var $num_items = 'feed_limit_post';
+ var $attachments = array();
+
+ function set_keys()
+ {
+ $this->set('title', 'post_subject');
+ $this->set('title2', 'topic_title');
+
+ $this->set('author_id', 'user_id');
+ $this->set('creator', 'username');
+ $this->set('published', 'post_time');
+ $this->set('updated', 'post_edit_time');
+ $this->set('text', 'post_text');
+
+ $this->set('bitfield', 'bbcode_bitfield');
+ $this->set('bbcode_uid','bbcode_uid');
+
+ $this->set('enable_bbcode', 'enable_bbcode');
+ $this->set('enable_smilies', 'enable_smilies');
+ $this->set('enable_magic_url', 'enable_magic_url');
+ }
+
+ function adjust_item(&$item_row, &$row)
+ {
+ $item_row['link'] = $this->helper->append_sid('viewtopic.' . $this->phpEx, "t={$row['topic_id']}&amp;p={$row['post_id']}#p{$row['post_id']}");
+
+ if ($this->config['feed_item_statistics'])
+ {
+ $item_row['statistics'] = $this->user->lang['POSTED'] . ' ' . $this->user->lang['POST_BY_AUTHOR'] . ' ' . $this->user_viewprofile($row)
+ . ' ' . $this->separator_stats . ' ' . $this->user->format_date($row[$this->get('published')])
+ . (($this->is_moderator_approve_forum($row['forum_id']) && (int) $row['post_visibility'] === ITEM_UNAPPROVED) ? ' ' . $this->separator_stats . ' ' . $this->user->lang['POST_UNAPPROVED'] : '')
+ . (($this->is_moderator_approve_forum($row['forum_id']) && (int) $row['post_visibility'] === ITEM_DELETED) ? ' ' . $this->separator_stats . ' ' . $this->user->lang['POST_DELETED'] : '');
+ }
+ }
+}
diff --git a/phpBB/phpbb/feed/topic.php b/phpBB/phpbb/feed/topic.php
new file mode 100644
index 0000000000..295bf3f795
--- /dev/null
+++ b/phpBB/phpbb/feed/topic.php
@@ -0,0 +1,123 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\feed;
+
+/**
+* Topic feed for a specific topic
+*
+* This will give you the last {$this->num_items} posts made within this topic.
+*/
+class topic extends \phpbb\feed\post_base
+{
+ var $topic_id = 0;
+ var $forum_id = 0;
+ var $topic_data = array();
+
+ /**
+ * Set the Topic ID
+ *
+ * @param int $topic_id Topic ID
+ * @return \phpbb\feed\topic
+ */
+ public function set_topic_id($topic_id)
+ {
+ $this->topic_id = (int) $topic_id;
+
+ return $this;
+ }
+
+ function open()
+ {
+ $sql = 'SELECT f.forum_options, f.forum_password, t.topic_id, t.forum_id, t.topic_visibility, t.topic_title, t.topic_time, t.topic_views, t.topic_posts_approved, t.topic_type
+ FROM ' . TOPICS_TABLE . ' t
+ LEFT JOIN ' . FORUMS_TABLE . ' f
+ ON (f.forum_id = t.forum_id)
+ WHERE t.topic_id = ' . $this->topic_id;
+ $result = $this->db->sql_query($sql);
+ $this->topic_data = $this->db->sql_fetchrow($result);
+ $this->db->sql_freeresult($result);
+
+ if (empty($this->topic_data))
+ {
+ trigger_error('NO_TOPIC');
+ }
+
+ $this->forum_id = (int) $this->topic_data['forum_id'];
+
+ // Make sure topic is either approved or user authed
+ if ($this->topic_data['topic_visibility'] != ITEM_APPROVED && !$this->auth->acl_get('m_approve', $this->forum_id))
+ {
+ trigger_error('SORRY_AUTH_READ');
+ }
+
+ // Make sure forum is not excluded from feed
+ if (phpbb_optionget(FORUM_OPTION_FEED_EXCLUDE, $this->topic_data['forum_options']))
+ {
+ trigger_error('NO_FEED');
+ }
+
+ // Make sure we can read this forum
+ if (!$this->auth->acl_get('f_read', $this->forum_id))
+ {
+ trigger_error('SORRY_AUTH_READ');
+ }
+
+ // Make sure forum is not passworded or user is authed
+ if ($this->topic_data['forum_password'])
+ {
+ $forum_ids_passworded = $this->get_passworded_forums();
+
+ if (isset($forum_ids_passworded[$this->forum_id]))
+ {
+ trigger_error('SORRY_AUTH_READ');
+ }
+
+ unset($forum_ids_passworded);
+ }
+
+ parent::open();
+ }
+
+ function get_sql()
+ {
+ parent::fetch_attachments();
+
+ $this->sql = array(
+ 'SELECT' => 'p.post_id, p.post_time, p.post_edit_time, p.post_visibility, p.post_subject, p.post_text, p.bbcode_bitfield, p.bbcode_uid, p.enable_bbcode, p.enable_smilies, p.enable_magic_url, p.post_attachment, ' .
+ 'u.username, u.user_id',
+ 'FROM' => array(
+ POSTS_TABLE => 'p',
+ USERS_TABLE => 'u',
+ ),
+ 'WHERE' => 'p.topic_id = ' . $this->topic_id . '
+ AND ' . $this->content_visibility->get_visibility_sql('post', $this->forum_id, 'p.') . '
+ AND p.poster_id = u.user_id',
+ 'ORDER_BY' => 'p.post_time DESC, p.post_id DESC',
+ );
+
+ return true;
+ }
+
+ function adjust_item(&$item_row, &$row)
+ {
+ parent::adjust_item($item_row, $row);
+
+ $item_row['forum_id'] = $this->forum_id;
+ }
+
+ function get_item()
+ {
+ return ($row = parent::get_item()) ? array_merge($this->topic_data, $row) : $row;
+ }
+}
diff --git a/phpBB/phpbb/feed/topic_base.php b/phpBB/phpbb/feed/topic_base.php
new file mode 100644
index 0000000000..f9ff368cba
--- /dev/null
+++ b/phpBB/phpbb/feed/topic_base.php
@@ -0,0 +1,70 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\feed;
+
+/**
+* Abstract class for topic based feeds
+*/
+abstract class topic_base extends \phpbb\feed\attachments_base
+{
+ var $num_items = 'feed_limit_topic';
+
+ function set_keys()
+ {
+ $this->set('title', 'topic_title');
+ $this->set('title2', 'forum_name');
+
+ $this->set('author_id', 'topic_poster');
+ $this->set('creator', 'topic_first_poster_name');
+ $this->set('published', 'post_time');
+ $this->set('updated', 'post_edit_time');
+ $this->set('text', 'post_text');
+
+ $this->set('bitfield', 'bbcode_bitfield');
+ $this->set('bbcode_uid','bbcode_uid');
+
+ $this->set('enable_bbcode', 'enable_bbcode');
+ $this->set('enable_smilies', 'enable_smilies');
+ $this->set('enable_magic_url', 'enable_magic_url');
+ }
+
+ function adjust_item(&$item_row, &$row)
+ {
+ $item_row['link'] = $this->helper->append_sid('viewtopic.' . $this->phpEx, 't=' . $row['topic_id'] . '&amp;p=' . $row['post_id'] . '#p' . $row['post_id']);
+
+ if ($this->config['feed_item_statistics'])
+ {
+ $item_row['statistics'] = $this->user->lang['POSTED'] . ' ' . $this->user->lang['POST_BY_AUTHOR'] . ' ' . $this->user_viewprofile($row)
+ . ' ' . $this->separator_stats . ' ' . $this->user->format_date($row[$this->get('published')])
+ . ' ' . $this->separator_stats . ' ' . $this->user->lang['REPLIES'] . ' ' . ($this->content_visibility->get_count('topic_posts', $row, $row['forum_id']) - 1)
+ . ' ' . $this->separator_stats . ' ' . $this->user->lang['VIEWS'] . ' ' . $row['topic_views'];
+
+ if ($this->is_moderator_approve_forum($row['forum_id']))
+ {
+ if ((int) $row['topic_visibility'] === ITEM_DELETED)
+ {
+ $item_row['statistics'] .= ' ' . $this->separator_stats . ' ' . $this->user->lang['TOPIC_DELETED'];
+ }
+ else if ((int) $row['topic_visibility'] === ITEM_UNAPPROVED)
+ {
+ $item_row['statistics'] .= ' ' . $this->separator_stats . ' ' . $this->user->lang['TOPIC_UNAPPROVED'];
+ }
+ else if ($row['topic_posts_unapproved'])
+ {
+ $item_row['statistics'] .= ' ' . $this->separator_stats . ' ' . $this->user->lang['POSTS_UNAPPROVED'];
+ }
+ }
+ }
+ }
+}
diff --git a/phpBB/phpbb/feed/topics.php b/phpBB/phpbb/feed/topics.php
new file mode 100644
index 0000000000..e6416bc064
--- /dev/null
+++ b/phpBB/phpbb/feed/topics.php
@@ -0,0 +1,88 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\feed;
+
+/**
+* New Topics feed
+*
+* This will give you the last {$this->num_items} created topics
+* including the first post.
+*/
+class topics extends \phpbb\feed\topic_base
+{
+ function get_sql()
+ {
+ $forum_ids_read = $this->get_readable_forums();
+ if (empty($forum_ids_read))
+ {
+ return false;
+ }
+
+ $in_fid_ary = array_diff($forum_ids_read, $this->get_excluded_forums(), $this->get_passworded_forums());
+ if (empty($in_fid_ary))
+ {
+ return false;
+ }
+
+ // We really have to get the post ids first!
+ $sql = 'SELECT topic_first_post_id, topic_time
+ FROM ' . TOPICS_TABLE . '
+ WHERE topic_moved_id = 0
+ AND ' . $this->content_visibility->get_forums_visibility_sql('topic', $in_fid_ary) . '
+ ORDER BY topic_time DESC';
+ $result = $this->db->sql_query_limit($sql, $this->num_items);
+
+ $post_ids = array();
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $post_ids[] = (int) $row['topic_first_post_id'];
+ }
+ $this->db->sql_freeresult($result);
+
+ if (empty($post_ids))
+ {
+ return false;
+ }
+
+ parent::fetch_attachments($post_ids);
+
+ $this->sql = array(
+ 'SELECT' => 'f.forum_id, f.forum_name,
+ t.topic_id, t.topic_title, t.topic_poster, t.topic_first_poster_name, t.topic_posts_approved, t.topic_posts_unapproved, t.topic_posts_softdeleted, t.topic_views, t.topic_time, t.topic_last_post_time,
+ p.post_id, p.post_time, p.post_edit_time, p.post_text, p.bbcode_bitfield, p.bbcode_uid, p.enable_bbcode, p.enable_smilies, p.enable_magic_url, p.post_attachment, t.topic_visibility',
+ 'FROM' => array(
+ TOPICS_TABLE => 't',
+ POSTS_TABLE => 'p',
+ ),
+ 'LEFT_JOIN' => array(
+ array(
+ 'FROM' => array(FORUMS_TABLE => 'f'),
+ 'ON' => 'p.forum_id = f.forum_id',
+ ),
+ ),
+ 'WHERE' => 'p.topic_id = t.topic_id
+ AND ' . $this->db->sql_in_set('p.post_id', $post_ids),
+ 'ORDER_BY' => 'p.post_time DESC, p.post_id DESC',
+ );
+
+ return true;
+ }
+
+ function adjust_item(&$item_row, &$row)
+ {
+ parent::adjust_item($item_row, $row);
+
+ $item_row['title'] = (isset($row['forum_name']) && $row['forum_name'] !== '') ? $row['forum_name'] . ' ' . $this->separator . ' ' . $item_row['title'] : $item_row['title'];
+ }
+}
diff --git a/phpBB/phpbb/feed/topics_active.php b/phpBB/phpbb/feed/topics_active.php
new file mode 100644
index 0000000000..3b751f3233
--- /dev/null
+++ b/phpBB/phpbb/feed/topics_active.php
@@ -0,0 +1,133 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\feed;
+
+/**
+* Active Topics feed
+*
+* This will give you the last {$this->num_items} topics
+* with replies made withing the last {$this->sort_days} days
+* including the last post.
+*/
+class topics_active extends \phpbb\feed\topic_base
+{
+ var $sort_days = 7;
+
+ function set_keys()
+ {
+ parent::set_keys();
+
+ $this->set('author_id', 'topic_last_poster_id');
+ $this->set('creator', 'topic_last_poster_name');
+ }
+
+ function get_sql()
+ {
+ $forum_ids_read = $this->get_readable_forums();
+ if (empty($forum_ids_read))
+ {
+ return false;
+ }
+
+ $in_fid_ary = array_intersect($forum_ids_read, $this->get_forum_ids());
+ $in_fid_ary = array_diff($in_fid_ary, $this->get_passworded_forums());
+ if (empty($in_fid_ary))
+ {
+ return false;
+ }
+
+ // Search for topics in last X days
+ $last_post_time_sql = ($this->sort_days) ? ' AND topic_last_post_time > ' . (time() - ($this->sort_days * 24 * 3600)) : '';
+
+ // We really have to get the post ids first!
+ $sql = 'SELECT topic_last_post_id, topic_last_post_time
+ FROM ' . TOPICS_TABLE . '
+ WHERE topic_moved_id = 0
+ AND ' . $this->content_visibility->get_forums_visibility_sql('topic', $in_fid_ary) . '
+ ' . $last_post_time_sql . '
+ ORDER BY topic_last_post_time DESC, topic_last_post_id DESC';
+ $result = $this->db->sql_query_limit($sql, $this->num_items);
+
+ $post_ids = array();
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $post_ids[] = (int) $row['topic_last_post_id'];
+ }
+ $this->db->sql_freeresult($result);
+
+ if (empty($post_ids))
+ {
+ return false;
+ }
+
+ parent::fetch_attachments($post_ids);
+
+ $this->sql = array(
+ 'SELECT' => 'f.forum_id, f.forum_name,
+ t.topic_id, t.topic_title, t.topic_posts_approved, t.topic_posts_unapproved, t.topic_posts_softdeleted, t.topic_views,
+ t.topic_last_poster_id, t.topic_last_poster_name, t.topic_last_post_time,
+ p.post_id, p.post_time, p.post_edit_time, p.post_text, p.bbcode_bitfield, p.bbcode_uid, p.enable_bbcode, p.enable_smilies, p.enable_magic_url, p.post_attachment, t.topic_visibility',
+ 'FROM' => array(
+ TOPICS_TABLE => 't',
+ POSTS_TABLE => 'p',
+ ),
+ 'LEFT_JOIN' => array(
+ array(
+ 'FROM' => array(FORUMS_TABLE => 'f'),
+ 'ON' => 'p.forum_id = f.forum_id',
+ ),
+ ),
+ 'WHERE' => 'p.topic_id = t.topic_id
+ AND ' . $this->db->sql_in_set('p.post_id', $post_ids),
+ 'ORDER_BY' => 'p.post_time DESC, p.post_id DESC',
+ );
+
+ return true;
+ }
+
+ function get_forum_ids()
+ {
+ static $forum_ids;
+
+ $cache_name = 'feed_topic_active_forum_ids';
+
+ if (!isset($forum_ids) && ($forum_ids = $this->cache->get('_' . $cache_name)) === false)
+ {
+ $sql = 'SELECT forum_id
+ FROM ' . FORUMS_TABLE . '
+ WHERE forum_type = ' . FORUM_POST . '
+ AND ' . $this->db->sql_bit_and('forum_options', FORUM_OPTION_FEED_EXCLUDE, '= 0') . '
+ AND ' . $this->db->sql_bit_and('forum_flags', log(FORUM_FLAG_ACTIVE_TOPICS, 2), '<> 0');
+ $result = $this->db->sql_query($sql);
+
+ $forum_ids = array();
+ while ($forum_id = (int) $this->db->sql_fetchfield('forum_id'))
+ {
+ $forum_ids[$forum_id] = $forum_id;
+ }
+ $this->db->sql_freeresult($result);
+
+ $this->cache->put('_' . $cache_name, $forum_ids, 180);
+ }
+
+ return $forum_ids;
+ }
+
+ function adjust_item(&$item_row, &$row)
+ {
+ parent::adjust_item($item_row, $row);
+
+ $item_row['title'] = (isset($row['forum_name']) && $row['forum_name'] !== '') ? $row['forum_name'] . ' ' . $this->separator . ' ' . $item_row['title'] : $item_row['title'];
+ }
+}
diff --git a/phpBB/phpbb/file_downloader.php b/phpBB/phpbb/file_downloader.php
new file mode 100644
index 0000000000..ab9505a14c
--- /dev/null
+++ b/phpBB/phpbb/file_downloader.php
@@ -0,0 +1,120 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb;
+
+class file_downloader
+{
+ /** @var string Error string */
+ protected $error_string = '';
+
+ /** @var int Error number */
+ protected $error_number = 0;
+
+ /**
+ * Retrieve contents from remotely stored file
+ *
+ * @param string $host File host
+ * @param string $directory Directory file is in
+ * @param string $filename Filename of file to retrieve
+ * @param int $port Port to connect to; default: 80
+ * @param int $timeout Connection timeout in seconds; default: 6
+ *
+ * @return mixed File data as string if file can be read and there is no
+ * timeout, false if there were errors or the connection timed out
+ *
+ * @throws \phpbb\exception\runtime_exception If data can't be retrieved and no error
+ * message is returned
+ */
+ public function get($host, $directory, $filename, $port = 80, $timeout = 6)
+ {
+ // Set default values for error variables
+ $this->error_number = 0;
+ $this->error_string = '';
+
+ if ($socket = @fsockopen(($port == 443 ? 'tls://' : '') . $host, $port, $this->error_number, $this->error_string, $timeout))
+ {
+ @fputs($socket, "GET $directory/$filename HTTP/1.0\r\n");
+ @fputs($socket, "HOST: $host\r\n");
+ @fputs($socket, "Connection: close\r\n\r\n");
+
+ $timer_stop = time() + $timeout;
+ stream_set_timeout($socket, $timeout);
+
+ $file_info = '';
+ $get_info = false;
+
+ while (!@feof($socket))
+ {
+ if ($get_info)
+ {
+ $file_info .= @fread($socket, 1024);
+ }
+ else
+ {
+ $line = @fgets($socket, 1024);
+ if ($line == "\r\n")
+ {
+ $get_info = true;
+ }
+ else if (stripos($line, '404 not found') !== false)
+ {
+ throw new \phpbb\exception\runtime_exception('FILE_NOT_FOUND', array($filename));
+ }
+ }
+
+ $stream_meta_data = stream_get_meta_data($socket);
+
+ if (!empty($stream_meta_data['timed_out']) || time() >= $timer_stop)
+ {
+ throw new \phpbb\exception\runtime_exception('FSOCK_TIMEOUT');
+ }
+ }
+ @fclose($socket);
+ }
+ else
+ {
+ if ($this->error_string)
+ {
+ $this->error_string = utf8_convert_message($this->error_string);
+ return false;
+ }
+ else
+ {
+ throw new \phpbb\exception\runtime_exception('FSOCK_DISABLED');
+ }
+ }
+
+ return $file_info;
+ }
+
+ /**
+ * Get error string
+ *
+ * @return string Error string
+ */
+ public function get_error_string()
+ {
+ return $this->error_string;
+ }
+
+ /**
+ * Get error number
+ *
+ * @return int Error number
+ */
+ public function get_error_number()
+ {
+ return $this->error_number;
+ }
+}
diff --git a/phpBB/phpbb/filesystem.php b/phpBB/phpbb/filesystem.php
new file mode 100644
index 0000000000..77517082e5
--- /dev/null
+++ b/phpBB/phpbb/filesystem.php
@@ -0,0 +1,50 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb;
+
+/**
+* A class with various functions that are related to paths, files and the filesystem
+*/
+class filesystem
+{
+ /**
+ * Eliminates useless . and .. components from specified path.
+ *
+ * @param string $path Path to clean
+ * @return string Cleaned path
+ */
+ public function clean_path($path)
+ {
+ $exploded = explode('/', $path);
+ $filtered = array();
+ foreach ($exploded as $part)
+ {
+ if ($part === '.' && !empty($filtered))
+ {
+ continue;
+ }
+
+ if ($part === '..' && !empty($filtered) && $filtered[sizeof($filtered) - 1] !== '.' && $filtered[sizeof($filtered) - 1] !== '..')
+ {
+ array_pop($filtered);
+ }
+ else
+ {
+ $filtered[] = $part;
+ }
+ }
+ $path = implode('/', $filtered);
+ return $path;
+ }
+}
diff --git a/phpBB/phpbb/finder.php b/phpBB/phpbb/finder.php
new file mode 100644
index 0000000000..28f28825ba
--- /dev/null
+++ b/phpBB/phpbb/finder.php
@@ -0,0 +1,547 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb;
+
+/**
+* The finder provides a simple way to locate files in the core and a set of extensions
+*/
+class finder
+{
+ protected $extensions;
+ protected $filesystem;
+ protected $phpbb_root_path;
+ protected $cache;
+ protected $php_ext;
+
+ /**
+ * The cache variable name used to store $this->cached_queries in $this->cache.
+ *
+ * Allows the use of multiple differently configured finders with the same cache.
+ * @var string
+ */
+ protected $cache_name;
+
+ /**
+ * An associative array, containing all search parameters set in methods.
+ * @var array
+ */
+ protected $query;
+
+ /**
+ * A map from md5 hashes of serialized queries to their previously retrieved
+ * results.
+ * @var array
+ */
+ protected $cached_queries;
+
+ /**
+ * Creates a new finder instance with its dependencies
+ *
+ * @param \phpbb\filesystem $filesystem Filesystem instance
+ * @param string $phpbb_root_path Path to the phpbb root directory
+ * @param \phpbb\cache\driver\driver_interface $cache A cache instance or null
+ * @param string $php_ext php file extension
+ * @param string $cache_name The name of the cache variable, defaults to
+ * _ext_finder
+ */
+ public function __construct(\phpbb\filesystem $filesystem, $phpbb_root_path = '', \phpbb\cache\driver\driver_interface $cache = null, $php_ext = 'php', $cache_name = '_ext_finder')
+ {
+ $this->filesystem = $filesystem;
+ $this->phpbb_root_path = $phpbb_root_path;
+ $this->cache = $cache;
+ $this->php_ext = $php_ext;
+ $this->cache_name = $cache_name;
+
+ $this->query = array(
+ 'core_path' => false,
+ 'core_suffix' => false,
+ 'core_prefix' => false,
+ 'core_directory' => false,
+ 'extension_suffix' => false,
+ 'extension_prefix' => false,
+ 'extension_directory' => false,
+ );
+ $this->extensions = array();
+
+ $this->cached_queries = ($this->cache) ? $this->cache->get($this->cache_name) : false;
+ }
+
+ /**
+ * Set the array of extensions
+ *
+ * @param array $extensions A list of extensions that should be searched aswell
+ * @param bool $replace_list Should the list be emptied before adding the extensions
+ * @return \phpbb\finder This object for chaining calls
+ */
+ public function set_extensions(array $extensions, $replace_list = true)
+ {
+ if ($replace_list)
+ {
+ $this->extensions = array();
+ }
+
+ foreach ($extensions as $ext_name)
+ {
+ $this->extensions[$ext_name] = $this->phpbb_root_path . 'ext/' . $ext_name . '/';
+ }
+ return $this;
+ }
+
+ /**
+ * Sets a core path to be searched in addition to extensions
+ *
+ * @param string $core_path The path relative to phpbb_root_path
+ * @return \phpbb\finder This object for chaining calls
+ */
+ public function core_path($core_path)
+ {
+ $this->query['core_path'] = $core_path;
+ return $this;
+ }
+
+ /**
+ * Sets the suffix all files found in extensions and core must match.
+ *
+ * There is no default file extension, so to find PHP files only, you will
+ * have to specify .php as a suffix. However when using get_classes, the .php
+ * file extension is automatically added to suffixes.
+ *
+ * @param string $suffix A filename suffix
+ * @return \phpbb\finder This object for chaining calls
+ */
+ public function suffix($suffix)
+ {
+ $this->core_suffix($suffix);
+ $this->extension_suffix($suffix);
+ return $this;
+ }
+
+ /**
+ * Sets a suffix all files found in extensions must match
+ *
+ * There is no default file extension, so to find PHP files only, you will
+ * have to specify .php as a suffix. However when using get_classes, the .php
+ * file extension is automatically added to suffixes.
+ *
+ * @param string $extension_suffix A filename suffix
+ * @return \phpbb\finder This object for chaining calls
+ */
+ public function extension_suffix($extension_suffix)
+ {
+ $this->query['extension_suffix'] = $extension_suffix;
+ return $this;
+ }
+
+ /**
+ * Sets a suffix all files found in the core path must match
+ *
+ * There is no default file extension, so to find PHP files only, you will
+ * have to specify .php as a suffix. However when using get_classes, the .php
+ * file extension is automatically added to suffixes.
+ *
+ * @param string $core_suffix A filename suffix
+ * @return \phpbb\finder This object for chaining calls
+ */
+ public function core_suffix($core_suffix)
+ {
+ $this->query['core_suffix'] = $core_suffix;
+ return $this;
+ }
+
+ /**
+ * Sets the prefix all files found in extensions and core must match
+ *
+ * @param string $prefix A filename prefix
+ * @return \phpbb\finder This object for chaining calls
+ */
+ public function prefix($prefix)
+ {
+ $this->core_prefix($prefix);
+ $this->extension_prefix($prefix);
+ return $this;
+ }
+
+ /**
+ * Sets a prefix all files found in extensions must match
+ *
+ * @param string $extension_prefix A filename prefix
+ * @return \phpbb\finder This object for chaining calls
+ */
+ public function extension_prefix($extension_prefix)
+ {
+ $this->query['extension_prefix'] = $extension_prefix;
+ return $this;
+ }
+
+ /**
+ * Sets a prefix all files found in the core path must match
+ *
+ * @param string $core_prefix A filename prefix
+ * @return \phpbb\finder This object for chaining calls
+ */
+ public function core_prefix($core_prefix)
+ {
+ $this->query['core_prefix'] = $core_prefix;
+ return $this;
+ }
+
+ /**
+ * Sets a directory all files found in extensions and core must be contained in
+ *
+ * Automatically sets the core_directory if its value does not differ from
+ * the current directory.
+ *
+ * @param string $directory
+ * @return \phpbb\finder This object for chaining calls
+ */
+ public function directory($directory)
+ {
+ $this->core_directory($directory);
+ $this->extension_directory($directory);
+ return $this;
+ }
+
+ /**
+ * Sets a directory all files found in extensions must be contained in
+ *
+ * @param string $extension_directory
+ * @return \phpbb\finder This object for chaining calls
+ */
+ public function extension_directory($extension_directory)
+ {
+ $this->query['extension_directory'] = $this->sanitise_directory($extension_directory);
+ return $this;
+ }
+
+ /**
+ * Sets a directory all files found in the core path must be contained in
+ *
+ * @param string $core_directory
+ * @return \phpbb\finder This object for chaining calls
+ */
+ public function core_directory($core_directory)
+ {
+ $this->query['core_directory'] = $this->sanitise_directory($core_directory);
+ return $this;
+ }
+
+ /**
+ * Removes occurances of /./ and makes sure path ends without trailing slash
+ *
+ * @param string $directory A directory pattern
+ * @return string A cleaned up directory pattern
+ */
+ protected function sanitise_directory($directory)
+ {
+ $directory = $this->filesystem->clean_path($directory);
+ $dir_len = strlen($directory);
+
+ if ($dir_len > 1 && $directory[$dir_len - 1] === '/')
+ {
+ $directory = substr($directory, 0, -1);
+ }
+
+ return $directory;
+ }
+
+ /**
+ * Finds classes matching the configured options if they follow phpBB naming rules.
+ *
+ * The php file extension is automatically added to suffixes.
+ *
+ * Note: If a file is matched but contains a class name not following the
+ * phpBB naming rules an incorrect class name will be returned.
+ *
+ * @param bool $cache Whether the result should be cached
+ * @return array An array of found class names
+ */
+ public function get_classes($cache = true)
+ {
+ $this->query['extension_suffix'] .= '.' . $this->php_ext;
+ $this->query['core_suffix'] .= '.' . $this->php_ext;
+
+ $files = $this->find($cache, false);
+
+ return $this->get_classes_from_files($files);
+ }
+
+ /**
+ * Get class names from a list of files
+ *
+ * @param array $files Array of files (from find())
+ * @return array Array of class names
+ */
+ public function get_classes_from_files($files)
+ {
+ $classes = array();
+ foreach ($files as $file => $ext_name)
+ {
+ $class = substr($file, 0, -strlen('.' . $this->php_ext));
+ if ($ext_name === '/' && preg_match('#^includes/#', $file))
+ {
+ $class = preg_replace('#^includes/#', '', $class);
+ $classes[] = 'phpbb_' . str_replace('/', '_', $class);
+ }
+ else
+ {
+ $class = preg_replace('#^ext/#', '', $class);
+ $classes[] = '\\' . str_replace('/', '\\', $class);
+ }
+ }
+ return $classes;
+ }
+
+ /**
+ * Finds all directories matching the configured options
+ *
+ * @param bool $cache Whether the result should be cached
+ * @param bool $extension_keys Whether the result should have extension name as array key
+ * @return array An array of paths to found directories
+ */
+ public function get_directories($cache = true, $extension_keys = false)
+ {
+ return $this->find_with_root_path($cache, true, $extension_keys);
+ }
+
+ /**
+ * Finds all files matching the configured options.
+ *
+ * @param bool $cache Whether the result should be cached
+ * @return array An array of paths to found files
+ */
+ public function get_files($cache = true)
+ {
+ return $this->find_with_root_path($cache, false);
+ }
+
+ /**
+ * A wrapper around the general find which prepends a root path to results
+ *
+ * @param bool $cache Whether the result should be cached
+ * @param bool $is_dir Directories will be returned when true, only files
+ * otherwise
+ * @param bool $extension_keys If true, result will be associative array
+ * with extension name as key
+ * @return array An array of paths to found items
+ */
+ protected function find_with_root_path($cache = true, $is_dir = false, $extension_keys = false)
+ {
+ $items = $this->find($cache, $is_dir);
+
+ $result = array();
+ foreach ($items as $item => $ext_name)
+ {
+ if ($extension_keys)
+ {
+ $result[$ext_name] = $this->phpbb_root_path . $item;
+ }
+ else
+ {
+ $result[] = $this->phpbb_root_path . $item;
+ }
+ }
+
+ return $result;
+ }
+
+ /**
+ * Finds all file system entries matching the configured options
+ *
+ * @param bool $cache Whether the result should be cached
+ * @param bool $is_dir Directories will be returned when true, only files
+ * otherwise
+ * @return array An array of paths to found items
+ */
+ public function find($cache = true, $is_dir = false)
+ {
+ $extensions = $this->extensions;
+ if ($this->query['core_path'])
+ {
+ $extensions['/'] = $this->phpbb_root_path . $this->query['core_path'];
+ }
+
+ $files = array();
+ $file_list = $this->find_from_paths($extensions, $cache, $is_dir);
+
+ foreach ($file_list as $file)
+ {
+ $files[$file['named_path']] = $file['ext_name'];
+ }
+
+ return $files;
+ }
+
+ /**
+ * Finds all file system entries matching the configured options for one
+ * specific extension
+ *
+ * @param string $extension_name Name of the extension
+ * @param string $extension_path Relative path to the extension root directory
+ * @param bool $cache Whether the result should be cached
+ * @param bool $is_dir Directories will be returned when true, only files
+ * otherwise
+ * @return array An array of paths to found items
+ */
+ public function find_from_extension($extension_name, $extension_path, $cache = true, $is_dir = false)
+ {
+ $extensions = array(
+ $extension_name => $extension_path,
+ );
+
+ $files = array();
+ $file_list = $this->find_from_paths($extensions, $cache, $is_dir);
+
+ foreach ($file_list as $file)
+ {
+ $files[$file['named_path']] = $file['ext_name'];
+ }
+
+ return $files;
+ }
+
+ /**
+ * Finds all file system entries matching the configured options from
+ * an array of paths
+ *
+ * @param array $extensions Array of extensions (name => full relative path)
+ * @param bool $cache Whether the result should be cached
+ * @param bool $is_dir Directories will be returned when true, only files
+ * otherwise
+ * @return array An array of paths to found items
+ */
+ public function find_from_paths($extensions, $cache = true, $is_dir = false)
+ {
+ $this->query['is_dir'] = $is_dir;
+ $query = md5(serialize($this->query) . serialize($extensions));
+
+ if (!defined('DEBUG') && $cache && isset($this->cached_queries[$query]))
+ {
+ return $this->cached_queries[$query];
+ }
+
+ $files = array();
+
+ foreach ($extensions as $name => $path)
+ {
+ $ext_name = $name;
+
+ if (!file_exists($path))
+ {
+ continue;
+ }
+
+ if ($name === '/')
+ {
+ $location = $this->query['core_path'];
+ $name = '';
+ $suffix = $this->query['core_suffix'];
+ $prefix = $this->query['core_prefix'];
+ $directory = $this->query['core_directory'];
+ }
+ else
+ {
+ $location = 'ext/';
+ $name .= '/';
+ $suffix = $this->query['extension_suffix'];
+ $prefix = $this->query['extension_prefix'];
+ $directory = $this->query['extension_directory'];
+ }
+
+ // match only first directory if leading slash is given
+ if ($directory === '/')
+ {
+ $directory_pattern = '^' . preg_quote(DIRECTORY_SEPARATOR, '#');
+ }
+ else if ($directory && $directory[0] === '/')
+ {
+ if (!$is_dir)
+ {
+ $path .= substr($directory, 1);
+ }
+ $directory_pattern = '^' . preg_quote(str_replace('/', DIRECTORY_SEPARATOR, $directory) . DIRECTORY_SEPARATOR, '#');
+ }
+ else
+ {
+ $directory_pattern = preg_quote(DIRECTORY_SEPARATOR . str_replace('/', DIRECTORY_SEPARATOR, $directory) . DIRECTORY_SEPARATOR, '#');
+ }
+ if ($is_dir)
+ {
+ $directory_pattern .= '$';
+ }
+ $directory_pattern = '#' . $directory_pattern . '#';
+
+ if (is_dir($path))
+ {
+ $iterator = new \RecursiveIteratorIterator(
+ new \phpbb\recursive_dot_prefix_filter_iterator(
+ new \RecursiveDirectoryIterator(
+ $path,
+ \FilesystemIterator::SKIP_DOTS
+ )
+ ),
+ \RecursiveIteratorIterator::SELF_FIRST
+ );
+
+ foreach ($iterator as $file_info)
+ {
+ $filename = $file_info->getFilename();
+
+ if ($file_info->isDir() == $is_dir)
+ {
+ if ($is_dir)
+ {
+ $relative_path = $iterator->getInnerIterator()->getSubPath() . DIRECTORY_SEPARATOR . basename($filename) . DIRECTORY_SEPARATOR;
+ if ($relative_path[0] !== DIRECTORY_SEPARATOR)
+ {
+ $relative_path = DIRECTORY_SEPARATOR . $relative_path;
+ }
+ }
+ else
+ {
+ $relative_path = $iterator->getInnerIterator()->getSubPathname();
+ if ($directory && $directory[0] === '/')
+ {
+ $relative_path = str_replace('/', DIRECTORY_SEPARATOR, $directory) . DIRECTORY_SEPARATOR . $relative_path;
+ }
+ else
+ {
+ $relative_path = DIRECTORY_SEPARATOR . $relative_path;
+ }
+ }
+
+ if ((!$suffix || substr($relative_path, -strlen($suffix)) === $suffix) &&
+ (!$prefix || substr($filename, 0, strlen($prefix)) === $prefix) &&
+ (!$directory || preg_match($directory_pattern, $relative_path)))
+ {
+ $files[] = array(
+ 'named_path' => str_replace(DIRECTORY_SEPARATOR, '/', $location . $name . substr($relative_path, 1)),
+ 'ext_name' => $ext_name,
+ 'path' => str_replace(array(DIRECTORY_SEPARATOR, $this->phpbb_root_path), array('/', ''), $file_info->getPath()) . '/',
+ 'filename' => $filename,
+ );
+ }
+ }
+ }
+ }
+ }
+
+ if ($cache && $this->cache)
+ {
+ $this->cached_queries[$query] = $files;
+ $this->cache->put($this->cache_name, $this->cached_queries);
+ }
+
+ return $files;
+ }
+}
diff --git a/phpBB/phpbb/groupposition/exception.php b/phpBB/phpbb/groupposition/exception.php
new file mode 100644
index 0000000000..956c7238f2
--- /dev/null
+++ b/phpBB/phpbb/groupposition/exception.php
@@ -0,0 +1,18 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\groupposition;
+
+class exception extends \Exception
+{
+}
diff --git a/phpBB/phpbb/groupposition/groupposition_interface.php b/phpBB/phpbb/groupposition/groupposition_interface.php
new file mode 100644
index 0000000000..3bd3fcce90
--- /dev/null
+++ b/phpBB/phpbb/groupposition/groupposition_interface.php
@@ -0,0 +1,80 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\groupposition;
+
+/**
+* Interface to manage group positions in various places of phpbb
+*
+* The interface provides simple methods to add, delete and move a group
+*/
+interface groupposition_interface
+{
+ /**
+ * Returns the value for a given group, if the group exists.
+ * @param int $group_id group_id of the group to be selected
+ * @return int position of the group
+ */
+ public function get_group_value($group_id);
+
+ /**
+ * Get number of groups displayed
+ *
+ * @return int value of the last item displayed
+ */
+ public function get_group_count();
+
+ /**
+ * Addes a group by group_id
+ *
+ * @param int $group_id group_id of the group to be added
+ * @return bool True if the group was added successfully
+ */
+ public function add_group($group_id);
+
+ /**
+ * Deletes a group by group_id
+ *
+ * @param int $group_id group_id of the group to be deleted
+ * @param bool $skip_group Skip setting the value for this group, to save the query, when you need to update it anyway.
+ * @return bool True if the group was deleted successfully
+ */
+ public function delete_group($group_id, $skip_group = false);
+
+ /**
+ * Moves a group up by group_id
+ *
+ * @param int $group_id group_id of the group to be moved
+ * @return bool True if the group was moved successfully
+ */
+ public function move_up($group_id);
+
+ /**
+ * Moves a group down by group_id
+ *
+ * @param int $group_id group_id of the group to be moved
+ * @return bool True if the group was moved successfully
+ */
+ public function move_down($group_id);
+
+ /**
+ * Moves a group up/down
+ *
+ * @param int $group_id group_id of the group to be moved
+ * @param int $delta number of steps:
+ * - positive = move up
+ * - negative = move down
+ * @return bool True if the group was moved successfully
+ */
+ public function move($group_id, $delta);
+}
diff --git a/phpBB/phpbb/groupposition/legend.php b/phpBB/phpbb/groupposition/legend.php
new file mode 100644
index 0000000000..efea3389d4
--- /dev/null
+++ b/phpBB/phpbb/groupposition/legend.php
@@ -0,0 +1,243 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\groupposition;
+
+/**
+* Legend group position class
+*
+* group_legend is an ascending list 1, 2, ..., n for groups which are displayed. 1 is the first group, n the last.
+* If the value is 0 (self::GROUP_DISABLED) the group is not displayed.
+*/
+class legend implements \phpbb\groupposition\groupposition_interface
+{
+ /**
+ * Group is not displayed
+ */
+ const GROUP_DISABLED = 0;
+
+ /**
+ * Database object
+ * @var \phpbb\db\driver\driver_interface
+ */
+ protected $db;
+
+ /**
+ * User object
+ * @var \phpbb\user
+ */
+ protected $user;
+
+ /**
+ * Constructor
+ *
+ * @param \phpbb\db\driver\driver_interface $db Database object
+ * @param \phpbb\user $user User object
+ */
+ public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\user $user)
+ {
+ $this->db = $db;
+ $this->user = $user;
+ }
+
+ /**
+ * Returns the group_legend for a given group, if the group exists.
+ *
+ * @param int $group_id group_id of the group to be selected
+ * @return int position of the group
+ * @throws \phpbb\groupposition\exception
+ */
+ public function get_group_value($group_id)
+ {
+ $sql = 'SELECT group_legend
+ FROM ' . GROUPS_TABLE . '
+ WHERE group_id = ' . (int) $group_id;
+ $result = $this->db->sql_query($sql);
+ $current_value = $this->db->sql_fetchfield('group_legend');
+ $this->db->sql_freeresult($result);
+
+ if ($current_value === false)
+ {
+ // Group not found.
+ throw new \phpbb\groupposition\exception('NO_GROUP');
+ }
+
+ return (int) $current_value;
+ }
+
+ /**
+ * Get number of groups, displayed on the legend
+ *
+ * @return int value of the last item displayed
+ */
+ public function get_group_count()
+ {
+ $sql = 'SELECT group_legend
+ FROM ' . GROUPS_TABLE . '
+ ORDER BY group_legend DESC';
+ $result = $this->db->sql_query_limit($sql, 1);
+ $group_count = (int) $this->db->sql_fetchfield('group_legend');
+ $this->db->sql_freeresult($result);
+
+ return $group_count;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function add_group($group_id)
+ {
+ $current_value = $this->get_group_value($group_id);
+
+ if ($current_value == self::GROUP_DISABLED)
+ {
+ // Group is currently not displayed, add it at the end.
+ $next_value = 1 + $this->get_group_count();
+
+ $sql = 'UPDATE ' . GROUPS_TABLE . '
+ SET group_legend = ' . $next_value . '
+ WHERE group_legend = ' . self::GROUP_DISABLED . '
+ AND group_id = ' . (int) $group_id;
+ $this->db->sql_query($sql);
+ return true;
+ }
+
+ return false;
+ }
+
+ /**
+ * Deletes a group by setting the field to self::GROUP_DISABLED and closing the gap in the list.
+ *
+ * @param int $group_id group_id of the group to be deleted
+ * @param bool $skip_group Skip setting the value for this group, to save the query, when you need to update it anyway.
+ * @return bool True if the group was deleted successfully
+ */
+ public function delete_group($group_id, $skip_group = false)
+ {
+ $current_value = $this->get_group_value($group_id);
+
+ if ($current_value != self::GROUP_DISABLED)
+ {
+ $this->db->sql_transaction('begin');
+
+ $sql = 'UPDATE ' . GROUPS_TABLE . '
+ SET group_legend = group_legend - 1
+ WHERE group_legend > ' . $current_value;
+ $this->db->sql_query($sql);
+
+ if (!$skip_group)
+ {
+ $sql = 'UPDATE ' . GROUPS_TABLE . '
+ SET group_legend = ' . self::GROUP_DISABLED . '
+ WHERE group_id = ' . (int) $group_id;
+ $this->db->sql_query($sql);
+ }
+
+ $this->db->sql_transaction('commit');
+
+ return true;
+ }
+
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function move_up($group_id)
+ {
+ return $this->move($group_id, 1);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function move_down($group_id)
+ {
+ return $this->move($group_id, -1);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function move($group_id, $delta)
+ {
+ $delta = (int) $delta;
+ if (!$delta)
+ {
+ return false;
+ }
+
+ $move_up = ($delta > 0) ? true : false;
+ $current_value = $this->get_group_value($group_id);
+
+ if ($current_value != self::GROUP_DISABLED)
+ {
+ $this->db->sql_transaction('begin');
+
+ // First we move all groups between our current value and the target value up/down 1,
+ // so we have a gap for our group to move.
+ $sql = 'UPDATE ' . GROUPS_TABLE . '
+ SET group_legend = group_legend' . (($move_up) ? ' + 1' : ' - 1') . '
+ WHERE group_legend > ' . self::GROUP_DISABLED . '
+ AND group_legend' . (($move_up) ? ' >= ' : ' <= ') . ($current_value - $delta) . '
+ AND group_legend' . (($move_up) ? ' < ' : ' > ') . $current_value;
+ $this->db->sql_query($sql);
+
+ // Because there might be fewer groups above/below the group than we wanted to move,
+ // we use the number of changed groups, to update the group.
+ $delta = (int) $this->db->sql_affectedrows();
+
+ if ($delta)
+ {
+ // And now finally, when we moved some other groups and built a gap,
+ // we can move the desired group to it.
+ $sql = 'UPDATE ' . GROUPS_TABLE . '
+ SET group_legend = group_legend ' . (($move_up) ? ' - ' : ' + ') . $delta . '
+ WHERE group_id = ' . (int) $group_id;
+ $this->db->sql_query($sql);
+
+ $this->db->sql_transaction('commit');
+
+ return true;
+ }
+
+ $this->db->sql_transaction('commit');
+ }
+
+ return false;
+ }
+
+ /**
+ * Get group type language var
+ *
+ * @param int $group_type group_type from the groups-table
+ * @return string name of the language variable for the given group-type.
+ */
+ static public function group_type_language($group_type)
+ {
+ switch ($group_type)
+ {
+ case GROUP_OPEN:
+ return 'GROUP_REQUEST';
+ case GROUP_CLOSED:
+ return 'GROUP_CLOSED';
+ case GROUP_HIDDEN:
+ return 'GROUP_HIDDEN';
+ case GROUP_SPECIAL:
+ return 'GROUP_SPECIAL';
+ case GROUP_FREE:
+ return 'GROUP_OPEN';
+ }
+ }
+}
diff --git a/phpBB/phpbb/groupposition/teampage.php b/phpBB/phpbb/groupposition/teampage.php
new file mode 100644
index 0000000000..2985c51525
--- /dev/null
+++ b/phpBB/phpbb/groupposition/teampage.php
@@ -0,0 +1,597 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\groupposition;
+
+/**
+* Teampage group position class
+*
+* Teampage position is an ascending list 1, 2, ..., n for items which are displayed. 1 is the first item, n the last.
+*/
+class teampage implements \phpbb\groupposition\groupposition_interface
+{
+ /**
+ * Group is not displayed
+ */
+ const GROUP_DISABLED = 0;
+
+ /**
+ * No parent item
+ */
+ const NO_PARENT = 0;
+
+ /**
+ * Database object
+ * @var \phpbb\db\driver\driver_interface
+ */
+ protected $db;
+
+ /**
+ * User object
+ * @var \phpbb\user
+ */
+ protected $user;
+
+ /**
+ * Cache object
+ * @var \phpbb\cache\driver\driver_interface
+ */
+ protected $cache;
+
+ /**
+ * Constructor
+ *
+ * @param \phpbb\db\driver\driver_interface $db Database object
+ * @param \phpbb\user $user User object
+ * @param \phpbb\cache\driver\driver_interface $cache Cache object
+ */
+ public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\user $user, \phpbb\cache\driver\driver_interface $cache)
+ {
+ $this->db = $db;
+ $this->user = $user;
+ $this->cache = $cache;
+ }
+
+ /**
+ * Returns the teampage position for a given group, if the group exists.
+ *
+ * @param int $group_id group_id of the group to be selected
+ * @return int position of the group
+ * @throws \phpbb\groupposition\exception
+ */
+ public function get_group_value($group_id)
+ {
+ // The join is required to ensure that the group itself exists
+ $sql = 'SELECT g.group_id, t.teampage_position
+ FROM ' . GROUPS_TABLE . ' g
+ LEFT JOIN ' . TEAMPAGE_TABLE . ' t
+ ON (t.group_id = g.group_id)
+ WHERE g.group_id = ' . (int) $group_id;
+ $result = $this->db->sql_query($sql);
+ $row = $this->db->sql_fetchrow($result);
+ $this->db->sql_freeresult($result);
+
+ if ($row === false)
+ {
+ // Group not found.
+ throw new \phpbb\groupposition\exception('NO_GROUP');
+ }
+
+ return (int) $row['teampage_position'];
+ }
+
+ /**
+ * Returns the row for a given group, if the group exists.
+ *
+ * @param int $group_id group_id of the group to be selected
+ * @return array Data row of the group
+ * @throws \phpbb\groupposition\exception
+ */
+ public function get_group_values($group_id)
+ {
+ // The join is required to ensure that the group itself exists
+ $sql = 'SELECT *
+ FROM ' . GROUPS_TABLE . ' g
+ LEFT JOIN ' . TEAMPAGE_TABLE . ' t
+ ON (t.group_id = g.group_id)
+ WHERE g.group_id = ' . (int) $group_id;
+ $result = $this->db->sql_query($sql);
+ $row = $this->db->sql_fetchrow($result);
+ $this->db->sql_freeresult($result);
+
+ if ($row === false)
+ {
+ // Group not found.
+ throw new \phpbb\groupposition\exception('NO_GROUP');
+ }
+
+ return $row;
+ }
+
+ /**
+ * Returns the teampage position for a given teampage item, if the item exists.
+ *
+ * @param int $teampage_id Teampage_id of the selected item
+ * @return int Teampage position of the item
+ * @throws \phpbb\groupposition\exception
+ */
+ public function get_teampage_value($teampage_id)
+ {
+ $sql = 'SELECT teampage_position
+ FROM ' . TEAMPAGE_TABLE . '
+ WHERE teampage_id = ' . (int) $teampage_id;
+ $result = $this->db->sql_query($sql);
+ $current_value = $this->db->sql_fetchfield('teampage_position');
+ $this->db->sql_freeresult($result);
+
+ if ($current_value === false)
+ {
+ // Group not found.
+ throw new \phpbb\groupposition\exception('NO_GROUP');
+ }
+
+ return (int) $current_value;
+ }
+
+ /**
+ * Returns the teampage row for a given teampage item, if the item exists.
+ *
+ * @param int $teampage_id Teampage_id of the selected item
+ * @return array Teampage row of the item
+ * @throws \phpbb\groupposition\exception
+ */
+ public function get_teampage_values($teampage_id)
+ {
+ $sql = 'SELECT teampage_position, teampage_parent
+ FROM ' . TEAMPAGE_TABLE . '
+ WHERE teampage_id = ' . (int) $teampage_id;
+ $result = $this->db->sql_query($sql);
+ $row = $this->db->sql_fetchrow($result);
+ $this->db->sql_freeresult($result);
+
+ if ($row === false)
+ {
+ // Group not found.
+ throw new \phpbb\groupposition\exception('NO_GROUP');
+ }
+
+ return $row;
+ }
+
+
+ /**
+ * {@inheritDoc}
+ */
+ public function get_group_count()
+ {
+ $sql = 'SELECT teampage_position
+ FROM ' . TEAMPAGE_TABLE . '
+ ORDER BY teampage_position DESC';
+ $result = $this->db->sql_query_limit($sql, 1);
+ $group_count = (int) $this->db->sql_fetchfield('teampage_position');
+ $this->db->sql_freeresult($result);
+
+ return $group_count;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function add_group($group_id)
+ {
+ return $this->add_group_teampage($group_id, self::NO_PARENT);
+ }
+
+ /**
+ * Adds a group by group_id
+ *
+ * @param int $group_id group_id of the group to be added
+ * @param int $parent_id Teampage ID of the parent item
+ * @return bool True if the group was added successfully
+ */
+ public function add_group_teampage($group_id, $parent_id)
+ {
+ $current_value = $this->get_group_value($group_id);
+
+ if ($current_value == self::GROUP_DISABLED)
+ {
+ if ($parent_id != self::NO_PARENT)
+ {
+ // Check, whether the given parent is a category
+ $sql = 'SELECT teampage_id
+ FROM ' . TEAMPAGE_TABLE . '
+ WHERE group_id = 0
+ AND teampage_id = ' . (int) $parent_id;
+ $result = $this->db->sql_query_limit($sql, 1);
+ $parent_is_category = (bool) $this->db->sql_fetchfield('teampage_id');
+ $this->db->sql_freeresult($result);
+
+ if ($parent_is_category)
+ {
+ // Get value of last child from this parent and add group there
+ $sql = 'SELECT teampage_position
+ FROM ' . TEAMPAGE_TABLE . '
+ WHERE teampage_parent = ' . (int) $parent_id . '
+ OR teampage_id = ' . (int) $parent_id . '
+ ORDER BY teampage_position DESC';
+ $result = $this->db->sql_query_limit($sql, 1);
+ $new_position = (int) $this->db->sql_fetchfield('teampage_position');
+ $this->db->sql_freeresult($result);
+
+ $sql = 'UPDATE ' . TEAMPAGE_TABLE . '
+ SET teampage_position = teampage_position + 1
+ WHERE teampage_position > ' . $new_position;
+ $this->db->sql_query($sql);
+ }
+ }
+ else
+ {
+ // Add group at the end
+ $new_position = $this->get_group_count();
+ }
+
+ $sql_ary = array(
+ 'group_id' => $group_id,
+ 'teampage_position' => $new_position + 1,
+ 'teampage_parent' => $parent_id,
+ );
+
+ $sql = 'INSERT INTO ' . TEAMPAGE_TABLE . ' ' . $this->db->sql_build_array('INSERT', $sql_ary);
+ $this->db->sql_query($sql);
+
+ $this->cache->destroy('sql', TEAMPAGE_TABLE);
+ return true;
+ }
+
+ $this->cache->destroy('sql', TEAMPAGE_TABLE);
+ return false;
+ }
+
+ /**
+ * Adds a new category
+ *
+ * @param string $category_name Name of the category to be added
+ * @return bool True if the category was added successfully
+ */
+ public function add_category_teampage($category_name)
+ {
+ if ($category_name === '')
+ {
+ return false;
+ }
+
+ $num_entries = $this->get_group_count();
+
+ $sql_ary = array(
+ 'group_id' => 0,
+ 'teampage_position' => $num_entries + 1,
+ 'teampage_parent' => 0,
+ 'teampage_name' => truncate_string($category_name, 255, 255),
+ );
+
+ $sql = 'INSERT INTO ' . TEAMPAGE_TABLE . ' ' . $this->db->sql_build_array('INSERT', $sql_ary);
+ $this->db->sql_query($sql);
+
+ $this->cache->destroy('sql', TEAMPAGE_TABLE);
+ return true;
+ }
+
+ /**
+ * Deletes a group from the list and closes the gap in the position list.
+ *
+ * @param int $group_id group_id of the group to be deleted
+ * @param bool $skip_group Skip setting the value for this group, to save the query, when you need to update it anyway.
+ * @return bool True if the group was deleted successfully
+ */
+ public function delete_group($group_id, $skip_group = false)
+ {
+ $current_value = $this->get_group_value($group_id);
+
+ if ($current_value != self::GROUP_DISABLED)
+ {
+ $sql = 'UPDATE ' . TEAMPAGE_TABLE . '
+ SET teampage_position = teampage_position - 1
+ WHERE teampage_position > ' . $current_value;
+ $this->db->sql_query($sql);
+
+ $sql = 'DELETE FROM ' . TEAMPAGE_TABLE . '
+ WHERE group_id = ' . $group_id;
+ $this->db->sql_query($sql);
+
+ $this->cache->destroy('sql', TEAMPAGE_TABLE);
+ return true;
+ }
+
+ $this->cache->destroy('sql', TEAMPAGE_TABLE);
+ return false;
+ }
+
+ /**
+ * Deletes an item from the list and closes the gap in the position list.
+ *
+ * @param int $teampage_id teampage_id of the item to be deleted
+ * @param bool $skip_group Skip setting the group to GROUP_DISABLED, to save the query, when you need to update it anyway.
+ * @return bool True if the item was deleted successfully
+ */
+ public function delete_teampage($teampage_id, $skip_group = false)
+ {
+ $current_value = $this->get_teampage_value($teampage_id);
+
+ if ($current_value != self::GROUP_DISABLED)
+ {
+ $sql = 'DELETE FROM ' . TEAMPAGE_TABLE . '
+ WHERE teampage_id = ' . $teampage_id . '
+ OR teampage_parent = ' . $teampage_id;
+ $this->db->sql_query($sql);
+
+ $delta = (int) $this->db->sql_affectedrows();
+
+ $sql = 'UPDATE ' . TEAMPAGE_TABLE . '
+ SET teampage_position = teampage_position - ' . $delta . '
+ WHERE teampage_position > ' . $current_value;
+ $this->db->sql_query($sql);
+
+ $this->cache->destroy('sql', TEAMPAGE_TABLE);
+ return true;
+ }
+
+ $this->cache->destroy('sql', TEAMPAGE_TABLE);
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function move_up($group_id)
+ {
+ return $this->move($group_id, 1);
+ }
+
+ /**
+ * Moves an item up by teampage_id
+ *
+ * @param int $teampage_id teampage_id of the item to be move
+ * @return bool True if the group was moved successfully
+ */
+ public function move_up_teampage($teampage_id)
+ {
+ return $this->move_teampage($teampage_id, 1);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function move_down($group_id)
+ {
+ return $this->move($group_id, -1);
+ }
+
+ /**
+ * Moves an item down by teampage_id
+ *
+ * @param int $teampage_id teampage_id of the item to be moved
+ * @return bool True if the group was moved successfully
+ */
+ public function move_down_teampage($teampage_id)
+ {
+ return $this->move_teampage($teampage_id, -1);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function move($group_id, $delta)
+ {
+ $delta = (int) $delta;
+ if (!$delta)
+ {
+ return false;
+ }
+
+ $move_up = ($delta > 0) ? true : false;
+ $data = $this->get_group_values($group_id);
+
+ $current_value = (int) $data['teampage_position'];
+ if ($current_value != self::GROUP_DISABLED)
+ {
+ $this->db->sql_transaction('begin');
+
+ if (!$move_up && $data['teampage_parent'] == self::NO_PARENT)
+ {
+ // If we move items down, we need to grab the one sibling more,
+ // so we do not ignore the children of the previous sibling.
+ // We will remove the additional sibling later on.
+ $delta = abs($delta) + 1;
+ }
+
+ $sql = 'SELECT teampage_position
+ FROM ' . TEAMPAGE_TABLE . '
+ WHERE teampage_parent = ' . (int) $data['teampage_parent'] . '
+ AND teampage_position' . (($move_up) ? ' < ' : ' > ') . $current_value . '
+ ORDER BY teampage_position' . (($move_up) ? ' DESC' : ' ASC');
+ $result = $this->db->sql_query_limit($sql, $delta);
+
+ $sibling_count = 0;
+ $sibling_limit = $delta;
+
+ // Reset the delta, as we recalculate the new real delta
+ $delta = 0;
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $sibling_count++;
+ $delta = $current_value - $row['teampage_position'];
+
+ if (!$move_up && $data['teampage_parent'] == self::NO_PARENT && $sibling_count == $sibling_limit)
+ {
+ // Remove the additional sibling we added previously
+ $delta++;
+ }
+ }
+ $this->db->sql_freeresult($result);
+
+ if ($delta)
+ {
+ // First we move all items between our current value and the target value up/down 1,
+ // so we have a gap for our item to move.
+ $sql = 'UPDATE ' . TEAMPAGE_TABLE . '
+ SET teampage_position = teampage_position' . (($move_up) ? ' + 1' : ' - 1') . '
+ WHERE teampage_position' . (($move_up) ? ' >= ' : ' <= ') . ($current_value - $delta) . '
+ AND teampage_position' . (($move_up) ? ' < ' : ' > ') . $current_value;
+ $this->db->sql_query($sql);
+
+ // And now finally, when we moved some other items and built a gap,
+ // we can move the desired item to it.
+ $sql = 'UPDATE ' . TEAMPAGE_TABLE . '
+ SET teampage_position = teampage_position ' . (($move_up) ? ' - ' : ' + ') . abs($delta) . '
+ WHERE group_id = ' . (int) $group_id;
+ $this->db->sql_query($sql);
+
+ $this->db->sql_transaction('commit');
+ $this->cache->destroy('sql', TEAMPAGE_TABLE);
+
+ return true;
+ }
+
+ $this->db->sql_transaction('commit');
+ }
+
+ $this->cache->destroy('sql', TEAMPAGE_TABLE);
+ return false;
+ }
+
+ /**
+ * Moves an item up/down
+ *
+ * @param int $teampage_id teampage_id of the item to be moved
+ * @param int $delta number of steps:
+ * - positive = move up
+ * - negative = move down
+ * @return bool True if the group was moved successfully
+ */
+ public function move_teampage($teampage_id, $delta)
+ {
+ $delta = (int) $delta;
+ if (!$delta)
+ {
+ return false;
+ }
+
+ $move_up = ($delta > 0) ? true : false;
+ $data = $this->get_teampage_values($teampage_id);
+
+ $current_value = (int) $data['teampage_position'];
+ if ($current_value != self::GROUP_DISABLED)
+ {
+ $this->db->sql_transaction('begin');
+
+ if (!$move_up && $data['teampage_parent'] == self::NO_PARENT)
+ {
+ // If we move items down, we need to grab the one sibling more,
+ // so we do not ignore the children of the previous sibling.
+ // We will remove the additional sibling later on.
+ $delta = abs($delta) + 1;
+ }
+
+ $sql = 'SELECT teampage_id, teampage_position
+ FROM ' . TEAMPAGE_TABLE . '
+ WHERE teampage_parent = ' . (int) $data['teampage_parent'] . '
+ AND teampage_position' . (($move_up) ? ' < ' : ' > ') . $current_value . '
+ ORDER BY teampage_position' . (($move_up) ? ' DESC' : ' ASC');
+ $result = $this->db->sql_query_limit($sql, $delta);
+
+ $sibling_count = 0;
+ $sibling_limit = $delta;
+
+ // Reset the delta, as we recalculate the new real delta
+ $delta = 0;
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $sibling_count++;
+ $delta = $current_value - $row['teampage_position'];
+
+ // Remove the additional sibling we added previously
+ // But only, if we included it, this is not be the case
+ // when we reached the end of our list
+ if (!$move_up && $data['teampage_parent'] == self::NO_PARENT && $sibling_count == $sibling_limit)
+ {
+ $delta++;
+ }
+ }
+ $this->db->sql_freeresult($result);
+
+ if ($delta)
+ {
+ $sql = 'SELECT COUNT(teampage_id) as num_items
+ FROM ' . TEAMPAGE_TABLE . '
+ WHERE teampage_id = ' . (int) $teampage_id . '
+ OR teampage_parent = ' . (int) $teampage_id;
+ $result = $this->db->sql_query($sql);
+ $num_items = (int) $this->db->sql_fetchfield('num_items');
+ $this->db->sql_freeresult($result);
+
+ // First we move all items between our current value and the target value up/down 1,
+ // so we have a gap for our item to move.
+ $sql = 'UPDATE ' . TEAMPAGE_TABLE . '
+ SET teampage_position = teampage_position' . (($move_up) ? ' + ' : ' - ') . $num_items . '
+ WHERE teampage_position' . (($move_up) ? ' >= ' : ' <= ') . ($current_value - $delta) . '
+ AND teampage_position' . (($move_up) ? ' < ' : ' > ') . $current_value . '
+ AND NOT (teampage_id = ' . (int) $teampage_id . '
+ OR teampage_parent = ' . (int) $teampage_id . ')';
+ $this->db->sql_query($sql);
+
+ $delta = (!$move_up && $data['teampage_parent'] == self::NO_PARENT) ? (abs($delta) - ($num_items - 1)) : abs($delta);
+
+ // And now finally, when we moved some other items and built a gap,
+ // we can move the desired item to it.
+ $sql = 'UPDATE ' . TEAMPAGE_TABLE . '
+ SET teampage_position = teampage_position ' . (($move_up) ? ' - ' : ' + ') . $delta . '
+ WHERE teampage_id = ' . (int) $teampage_id . '
+ OR teampage_parent = ' . (int) $teampage_id;
+ $this->db->sql_query($sql);
+
+ $this->db->sql_transaction('commit');
+ $this->cache->destroy('sql', TEAMPAGE_TABLE);
+
+ return true;
+ }
+
+ $this->db->sql_transaction('commit');
+ }
+
+ $this->cache->destroy('sql', TEAMPAGE_TABLE);
+ return false;
+ }
+
+ /**
+ * Get group type language var
+ *
+ * @param int $group_type group_type from the groups-table
+ * @return string name of the language variable for the given group-type.
+ */
+ static public function group_type_language($group_type)
+ {
+ switch ($group_type)
+ {
+ case GROUP_OPEN:
+ return 'GROUP_REQUEST';
+ case GROUP_CLOSED:
+ return 'GROUP_CLOSED';
+ case GROUP_HIDDEN:
+ return 'GROUP_HIDDEN';
+ case GROUP_SPECIAL:
+ return 'GROUP_SPECIAL';
+ case GROUP_FREE:
+ return 'GROUP_OPEN';
+ }
+ }
+}
diff --git a/phpBB/phpbb/hook/finder.php b/phpBB/phpbb/hook/finder.php
new file mode 100644
index 0000000000..a3d02d3aa0
--- /dev/null
+++ b/phpBB/phpbb/hook/finder.php
@@ -0,0 +1,80 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\hook;
+
+/**
+* The hook finder locates installed hooks.
+*/
+class finder
+{
+ protected $phpbb_root_path;
+ protected $cache;
+ protected $php_ext;
+
+ /**
+ * Creates a new finder instance.
+ *
+ * @param string $phpbb_root_path Path to the phpbb root directory
+ * @param string $php_ext php file extension
+ * @param \phpbb\cache\driver\driver_interface $cache A cache instance or null
+ */
+ public function __construct($phpbb_root_path, $php_ext, \phpbb\cache\driver\driver_interface $cache = null)
+ {
+ $this->phpbb_root_path = $phpbb_root_path;
+ $this->cache = $cache;
+ $this->php_ext = $php_ext;
+ }
+
+ /**
+ * Finds all hook files.
+ *
+ * @param bool $cache Whether the result should be cached
+ * @return array An array of paths to found hook files
+ */
+ public function find($cache = true)
+ {
+ if (!defined('DEBUG') && $cache && $this->cache)
+ {
+ $hook_files = $this->cache->get('_hooks');
+ if ($hook_files !== false)
+ {
+ return $hook_files;
+ }
+ }
+
+ $hook_files = array();
+
+ // Now search for hooks...
+ $dh = @opendir($this->phpbb_root_path . 'includes/hooks/');
+
+ if ($dh)
+ {
+ while (($file = readdir($dh)) !== false)
+ {
+ if (strpos($file, 'hook_') === 0 && substr($file, -strlen('.' . $this->php_ext)) === '.' . $this->php_ext)
+ {
+ $hook_files[] = substr($file, 0, -(strlen($this->php_ext) + 1));
+ }
+ }
+ closedir($dh);
+ }
+
+ if ($cache && $this->cache)
+ {
+ $this->cache->put('_hooks', $hook_files);
+ }
+
+ return $hook_files;
+ }
+}
diff --git a/phpBB/phpbb/json_response.php b/phpBB/phpbb/json_response.php
new file mode 100644
index 0000000000..5219cd0c32
--- /dev/null
+++ b/phpBB/phpbb/json_response.php
@@ -0,0 +1,38 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb;
+
+/**
+* JSON class
+*/
+class json_response
+{
+ /**
+ * Send the data to the client and exit the script.
+ *
+ * @param array $data Any additional data to send.
+ * @param bool $exit Will exit the script if true.
+ */
+ public function send($data, $exit = true)
+ {
+ header('Content-Type: application/json');
+ echo json_encode($data);
+
+ if ($exit)
+ {
+ garbage_collection();
+ exit_handler();
+ }
+ }
+}
diff --git a/phpBB/phpbb/lock/db.php b/phpBB/phpbb/lock/db.php
new file mode 100644
index 0000000000..85ba9a7aa3
--- /dev/null
+++ b/phpBB/phpbb/lock/db.php
@@ -0,0 +1,146 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\lock;
+
+/**
+* Database locking class
+*/
+class db
+{
+ /**
+ * Name of the config variable this lock uses
+ * @var string
+ */
+ private $config_name;
+
+ /**
+ * Unique identifier for this lock.
+ *
+ * @var string
+ */
+ private $unique_id;
+
+ /**
+ * Stores the state of this lock
+ * @var bool
+ */
+ private $locked;
+
+ /**
+ * The phpBB configuration
+ * @var \phpbb\config\config
+ */
+ private $config;
+
+ /**
+ * A database connection
+ * @var \phpbb\db\driver\driver_interface
+ */
+ private $db;
+
+ /**
+ * Creates a named released instance of the lock.
+ *
+ * You have to call acquire() to actually create the lock.
+ *
+ * @param string $config_name A config variable to be used for locking
+ * @param \phpbb\config\config $config The phpBB configuration
+ * @param \phpbb\db\driver\driver_interface $db A database connection
+ */
+ public function __construct($config_name, \phpbb\config\config $config, \phpbb\db\driver\driver_interface $db)
+ {
+ $this->config_name = $config_name;
+ $this->config = $config;
+ $this->db = $db;
+ }
+
+ /**
+ * Tries to acquire the lock by updating
+ * the configuration variable in the database.
+ *
+ * As a lock may only be held by one process at a time, lock
+ * acquisition may fail if another process is holding the lock
+ * or if another process obtained the lock but never released it.
+ * Locks are forcibly released after a timeout of 1 hour.
+ *
+ * @return bool true if lock was acquired
+ * false otherwise
+ */
+ public function acquire()
+ {
+ if ($this->locked)
+ {
+ return false;
+ }
+
+ if (!isset($this->config[$this->config_name]))
+ {
+ $this->config->set($this->config_name, '0', false);
+ }
+ $lock_value = $this->config[$this->config_name];
+
+ // make sure lock cannot be acquired by multiple processes
+ if ($lock_value)
+ {
+ // if the other process is running more than an hour already we have to assume it
+ // aborted without cleaning the lock
+ $time = explode(' ', $lock_value);
+ $time = $time[0];
+
+ if ($time + 3600 >= time())
+ {
+ return false;
+ }
+ }
+
+ $this->unique_id = time() . ' ' . unique_id();
+
+ // try to update the config value, if it was already modified by another
+ // process we failed to acquire the lock.
+ $this->locked = $this->config->set_atomic($this->config_name, $lock_value, $this->unique_id, false);
+
+ return $this->locked;
+ }
+
+ /**
+ * Does this process own the lock?
+ *
+ * @return bool true if lock is owned
+ * false otherwise
+ */
+ public function owns_lock()
+ {
+ return (bool) $this->locked;
+ }
+
+ /**
+ * Releases the lock.
+ *
+ * The lock must have been previously obtained, that is, acquire() call
+ * was issued and returned true.
+ *
+ * Note: Attempting to release a lock that is already released,
+ * that is, calling release() multiple times, is harmless.
+ *
+ * @return null
+ */
+ public function release()
+ {
+ if ($this->locked)
+ {
+ $this->config->set_atomic($this->config_name, $this->unique_id, '0', false);
+ $this->locked = false;
+ }
+ }
+}
diff --git a/phpBB/phpbb/lock/flock.php b/phpBB/phpbb/lock/flock.php
new file mode 100644
index 0000000000..df88e1490a
--- /dev/null
+++ b/phpBB/phpbb/lock/flock.php
@@ -0,0 +1,141 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\lock;
+
+/**
+* File locking class
+*/
+class flock
+{
+ /**
+ * Path to the file to which access is controlled
+ *
+ * @var string
+ */
+ private $path;
+
+ /**
+ * File pointer for the lock file
+ * @var string
+ */
+ private $lock_fp;
+
+ /**
+ * Constructor.
+ *
+ * You have to call acquire() to actually acquire the lock.
+ *
+ * @param string $path Path to the file to which access is controlled
+ */
+ public function __construct($path)
+ {
+ $this->path = $path;
+ $this->lock_fp = null;
+ }
+
+ /**
+ * Tries to acquire the lock.
+ *
+ * If the lock is already held by another process, this call will block
+ * until the other process releases the lock. If a lock is acquired and
+ * is not released before script finishes but the process continues to
+ * live (apache/fastcgi) then subsequent processes trying to acquire
+ * the same lock will be blocked forever.
+ *
+ * If the lock is already held by the same process via another instance
+ * of this class, this call will block forever.
+ *
+ * If flock function is disabled in php or fails to work, lock
+ * acquisition will fail and false will be returned.
+ *
+ * @return bool true if lock was acquired
+ * false otherwise
+ */
+ public function acquire()
+ {
+ if ($this->lock_fp)
+ {
+ return false;
+ }
+
+ // For systems that can't have two processes opening
+ // one file for writing simultaneously
+ if (file_exists($this->path . '.lock'))
+ {
+ $mode = 'rb';
+ }
+ else
+ {
+ $mode = 'wb';
+ }
+
+ $this->lock_fp = @fopen($this->path . '.lock', $mode);
+
+ if ($mode == 'wb')
+ {
+ if (!$this->lock_fp)
+ {
+ // Two processes may attempt to create lock file at the same time.
+ // Have the losing process try opening the lock file again for reading
+ // on the assumption that the winning process created it
+ $mode = 'rb';
+ $this->lock_fp = @fopen($this->path . '.lock', $mode);
+ }
+ else
+ {
+ // Only need to set mode when the lock file is written
+ @chmod($this->path . '.lock', 0666);
+ }
+ }
+
+ if ($this->lock_fp)
+ {
+ @flock($this->lock_fp, LOCK_EX);
+ }
+
+ return (bool) $this->lock_fp;
+ }
+
+ /**
+ * Does this process own the lock?
+ *
+ * @return bool true if lock is owned
+ * false otherwise
+ */
+ public function owns_lock()
+ {
+ return (bool) $this->lock_fp;
+ }
+
+ /**
+ * Releases the lock.
+ *
+ * The lock must have been previously obtained, that is, acquire() call
+ * was issued and returned true.
+ *
+ * Note: Attempting to release a lock that is already released,
+ * that is, calling release() multiple times, is harmless.
+ *
+ * @return null
+ */
+ public function release()
+ {
+ if ($this->lock_fp)
+ {
+ @flock($this->lock_fp, LOCK_UN);
+ fclose($this->lock_fp);
+ $this->lock_fp = null;
+ }
+ }
+}
diff --git a/phpBB/phpbb/log/log.php b/phpBB/phpbb/log/log.php
new file mode 100644
index 0000000000..8f199cd931
--- /dev/null
+++ b/phpBB/phpbb/log/log.php
@@ -0,0 +1,982 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\log;
+
+/**
+* This class is used to add entries into the log table.
+*/
+class log implements \phpbb\log\log_interface
+{
+ /**
+ * If set, administrative user profile links will be returned and messages
+ * will not be censored.
+ * @var bool
+ */
+ protected $is_in_admin;
+
+ /**
+ * An array with the disabled log types. Logs of such types will not be
+ * added when add_log() is called.
+ * @var array
+ */
+ protected $disabled_types;
+
+ /**
+ * Keeps the total log count of the last call to get_logs()
+ * @var int
+ */
+ protected $entry_count;
+
+ /**
+ * Keeps the offset of the last valid page of the last call to get_logs()
+ * @var int
+ */
+ protected $last_page_offset;
+
+ /**
+ * The table we use to store our logs.
+ * @var string
+ */
+ protected $log_table;
+
+ /**
+ * Database object
+ * @var \phpbb\db\driver\driver
+ */
+ protected $db;
+
+ /**
+ * User object
+ * @var \phpbb\user
+ */
+ protected $user;
+
+ /**
+ * Auth object
+ * @var \phpbb\auth\auth
+ */
+ protected $auth;
+
+ /**
+ * Event dispatcher object
+ * @var \phpbb\event\dispatcher_interface
+ */
+ protected $dispatcher;
+
+ /**
+ * phpBB root path
+ * @var string
+ */
+ protected $phpbb_root_path;
+
+ /**
+ * Admin root path
+ * @var string
+ */
+ protected $phpbb_admin_path;
+
+ /**
+ * PHP Extension
+ * @var string
+ */
+ protected $php_ext;
+
+ /**
+ * Constructor
+ *
+ * @param \phpbb\db\driver\driver_interface $db Database object
+ * @param \phpbb\user $user User object
+ * @param \phpbb\auth\auth $auth Auth object
+ * @param \phpbb\event\dispatcher_interface $phpbb_dispatcher Event dispatcher
+ * @param string $phpbb_root_path Root path
+ * @param string $relative_admin_path Relative admin root path
+ * @param string $php_ext PHP Extension
+ * @param string $log_table Name of the table we use to store our logs
+ */
+ public function __construct($db, $user, $auth, $phpbb_dispatcher, $phpbb_root_path, $relative_admin_path, $php_ext, $log_table)
+ {
+ $this->db = $db;
+ $this->user = $user;
+ $this->auth = $auth;
+ $this->dispatcher = $phpbb_dispatcher;
+ $this->phpbb_root_path = $phpbb_root_path;
+ $this->phpbb_admin_path = $this->phpbb_root_path . $relative_admin_path;
+ $this->php_ext = $php_ext;
+ $this->log_table = $log_table;
+
+ /*
+ * IN_ADMIN is set after the session is created,
+ * so we need to take ADMIN_START into account as well, otherwise
+ * it will not work for the \phpbb\log\log object we create in common.php
+ */
+ $this->set_is_admin((defined('ADMIN_START') && ADMIN_START) || (defined('IN_ADMIN') && IN_ADMIN));
+ $this->enable();
+ }
+
+ /**
+ * Set is_in_admin in order to return administrative user profile links
+ * in get_logs()
+ *
+ * @param bool $is_in_admin Are we called from within the acp?
+ * @return null
+ */
+ public function set_is_admin($is_in_admin)
+ {
+ $this->is_in_admin = (bool) $is_in_admin;
+ }
+
+ /**
+ * Returns the is_in_admin option
+ *
+ * @return bool
+ */
+ public function get_is_admin()
+ {
+ return $this->is_in_admin;
+ }
+
+ /**
+ * Set table name
+ *
+ * @param string $log_table Can overwrite the table to use for the logs
+ * @return null
+ */
+ public function set_log_table($log_table)
+ {
+ $this->log_table = $log_table;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function is_enabled($type = '')
+ {
+ if ($type == '' || $type == 'all')
+ {
+ return !isset($this->disabled_types['all']);
+ }
+ return !isset($this->disabled_types[$type]) && !isset($this->disabled_types['all']);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function disable($type = '')
+ {
+ if (is_array($type))
+ {
+ foreach ($type as $disable_type)
+ {
+ $this->disable($disable_type);
+ }
+ return;
+ }
+
+ // Empty string is an equivalent for all types.
+ if ($type == '')
+ {
+ $type = 'all';
+ }
+ $this->disabled_types[$type] = true;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function enable($type = '')
+ {
+ if (is_array($type))
+ {
+ foreach ($type as $enable_type)
+ {
+ $this->enable($enable_type);
+ }
+ return;
+ }
+
+ if ($type == '' || $type == 'all')
+ {
+ $this->disabled_types = array();
+ return;
+ }
+ unset($this->disabled_types[$type]);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function add($mode, $user_id, $log_ip, $log_operation, $log_time = false, $additional_data = array())
+ {
+ if (!$this->is_enabled($mode))
+ {
+ return false;
+ }
+
+ if ($log_time == false)
+ {
+ $log_time = time();
+ }
+
+ $sql_ary = array(
+ 'user_id' => !empty($user_id) ? $user_id : ANONYMOUS,
+ 'log_ip' => !empty($log_ip) ? $log_ip : '',
+ 'log_time' => $log_time,
+ 'log_operation' => $log_operation,
+ );
+
+ switch ($mode)
+ {
+ case 'admin':
+ $sql_ary += array(
+ 'log_type' => LOG_ADMIN,
+ 'log_data' => (!empty($additional_data)) ? serialize($additional_data) : '',
+ );
+ break;
+
+ case 'mod':
+ $forum_id = isset($additional_data['forum_id']) ? (int) $additional_data['forum_id'] : 0;
+ unset($additional_data['forum_id']);
+ $topic_id = isset($additional_data['topic_id']) ? (int) $additional_data['topic_id'] : 0;
+ unset($additional_data['topic_id']);
+ $sql_ary += array(
+ 'log_type' => LOG_MOD,
+ 'forum_id' => $forum_id,
+ 'topic_id' => $topic_id,
+ 'log_data' => (!empty($additional_data)) ? serialize($additional_data) : '',
+ );
+ break;
+
+ case 'user':
+ $reportee_id = (int) $additional_data['reportee_id'];
+ unset($additional_data['reportee_id']);
+
+ $sql_ary += array(
+ 'log_type' => LOG_USERS,
+ 'reportee_id' => $reportee_id,
+ 'log_data' => (!empty($additional_data)) ? serialize($additional_data) : '',
+ );
+ break;
+
+ case 'critical':
+ $sql_ary += array(
+ 'log_type' => LOG_CRITICAL,
+ 'log_data' => (!empty($additional_data)) ? serialize($additional_data) : '',
+ );
+ break;
+ }
+
+ /**
+ * Allows to modify log data before we add it to the database
+ *
+ * NOTE: if sql_ary does not contain a log_type value, the entry will
+ * not be stored in the database. So ensure to set it, if needed.
+ *
+ * @event core.add_log
+ * @var string mode Mode of the entry we log
+ * @var int user_id ID of the user who triggered the log
+ * @var string log_ip IP of the user who triggered the log
+ * @var string log_operation Language key of the log operation
+ * @var int log_time Timestamp, when the log was added
+ * @var array additional_data Array with additional log data
+ * @var array sql_ary Array with log data we insert into the
+ * database. If sql_ary[log_type] is not set,
+ * we won't add the entry to the database.
+ * @since 3.1.0-a1
+ */
+ $vars = array(
+ 'mode',
+ 'user_id',
+ 'log_ip',
+ 'log_operation',
+ 'log_time',
+ 'additional_data',
+ 'sql_ary',
+ );
+ extract($this->dispatcher->trigger_event('core.add_log', compact($vars)));
+
+ // We didn't find a log_type, so we don't save it in the database.
+ if (!isset($sql_ary['log_type']))
+ {
+ return false;
+ }
+
+ $this->db->sql_query('INSERT INTO ' . $this->log_table . ' ' . $this->db->sql_build_array('INSERT', $sql_ary));
+
+ return $this->db->sql_nextid();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function delete($mode, $conditions = array())
+ {
+ switch ($mode)
+ {
+ case 'admin':
+ $log_type = LOG_ADMIN;
+ break;
+
+ case 'mod':
+ $log_type = LOG_MOD;
+ break;
+
+ case 'user':
+ $log_type = LOG_USERS;
+ break;
+
+ case 'users':
+ $log_type = LOG_USERS;
+ break;
+
+ case 'critical':
+ $log_type = LOG_CRITICAL;
+ break;
+
+ default:
+ $log_type = false;
+ }
+
+ /**
+ * Allows to modify log data before we delete it from the database
+ *
+ * NOTE: if sql_ary does not contain a log_type value, the entry will
+ * not be deleted in the database. So ensure to set it, if needed.
+ *
+ * @event core.delete_log
+ * @var string mode Mode of the entry we log
+ * @var string log_type Type ID of the log (should be different than false)
+ * @var array conditions An array of conditions, 3 different forms are accepted
+ * 1) <key> => <value> transformed into 'AND <key> = <value>' (value should be an integer)
+ * 2) <key> => array(<operator>, <value>) transformed into 'AND <key> <operator> <value>' (values can't be an array)
+ * 3) <key> => array('IN' => array(<values>)) transformed into 'AND <key> IN <values>'
+ * A special field, keywords, can also be defined. In this case only the log entries that have the keywords in log_operation or log_data will be deleted.
+ * @since 3.1.0-b4
+ */
+ $vars = array(
+ 'mode',
+ 'log_type',
+ 'conditions',
+ );
+ extract($this->dispatcher->trigger_event('core.delete_log', compact($vars)));
+
+ if ($log_type === false)
+ {
+ return;
+ }
+
+ $sql_where = 'WHERE log_type = ' . $log_type;
+
+ if (isset($conditions['keywords']))
+ {
+ $sql_where .= $this->generate_sql_keyword($conditions['keywords'], '');
+
+ unset($conditions['keywords']);
+ }
+
+ foreach ($conditions as $field => $field_value)
+ {
+ $sql_where .= ' AND ';
+
+ if (is_array($field_value) && sizeof($field_value) == 2 && !is_array($field_value[1]))
+ {
+ $sql_where .= $field . ' ' . $field_value[0] . ' ' . $field_value[1];
+ }
+ else if (is_array($field_value) && isset($field_value['IN']) && is_array($field_value['IN']))
+ {
+ $sql_where .= $this->db->sql_in_set($field, $field_value['IN']);
+ }
+ else
+ {
+ $sql_where .= $field . ' = ' . $field_value;
+ }
+ }
+
+ $sql = 'DELETE FROM ' . $this->log_table . "
+ $sql_where";
+ $this->db->sql_query($sql);
+
+ $this->add('admin', $this->user->data['user_id'], $this->user->ip, 'LOG_CLEAR_' . strtoupper($mode));
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function get_logs($mode, $count_logs = true, $limit = 0, $offset = 0, $forum_id = 0, $topic_id = 0, $user_id = 0, $log_time = 0, $sort_by = 'l.log_time DESC', $keywords = '')
+ {
+ $this->entry_count = 0;
+ $this->last_page_offset = $offset;
+
+ $topic_id_list = $reportee_id_list = array();
+
+ $profile_url = ($this->get_is_admin() && $this->phpbb_admin_path) ? append_sid("{$this->phpbb_admin_path}index.{$this->php_ext}", 'i=users&amp;mode=overview') : append_sid("{$this->phpbb_root_path}memberlist.{$this->php_ext}", 'mode=viewprofile');
+
+ switch ($mode)
+ {
+ case 'admin':
+ $log_type = LOG_ADMIN;
+ $sql_additional = '';
+ break;
+
+ case 'mod':
+ $log_type = LOG_MOD;
+ $sql_additional = '';
+
+ if ($topic_id)
+ {
+ $sql_additional = 'AND l.topic_id = ' . (int) $topic_id;
+ }
+ else if (is_array($forum_id))
+ {
+ $sql_additional = 'AND ' . $this->db->sql_in_set('l.forum_id', array_map('intval', $forum_id));
+ }
+ else if ($forum_id)
+ {
+ $sql_additional = 'AND l.forum_id = ' . (int) $forum_id;
+ }
+ break;
+
+ case 'user':
+ $log_type = LOG_USERS;
+ $sql_additional = 'AND l.reportee_id = ' . (int) $user_id;
+ break;
+
+ case 'users':
+ $log_type = LOG_USERS;
+ $sql_additional = '';
+ break;
+
+ case 'critical':
+ $log_type = LOG_CRITICAL;
+ $sql_additional = '';
+ break;
+
+ default:
+ $log_type = false;
+ $sql_additional = '';
+ }
+
+ /**
+ * Overwrite log type and limitations before we count and get the logs
+ *
+ * NOTE: if log_type is false, no entries will be returned.
+ *
+ * @event core.get_logs_modify_type
+ * @var string mode Mode of the entries we display
+ * @var bool count_logs Do we count all matching entries?
+ * @var int limit Limit the number of entries
+ * @var int offset Offset when fetching the entries
+ * @var mixed forum_id Limit entries to the forum_id,
+ * can also be an array of forum_ids
+ * @var int topic_id Limit entries to the topic_id
+ * @var int user_id Limit entries to the user_id
+ * @var int log_time Limit maximum age of log entries
+ * @var string sort_by SQL order option
+ * @var string keywords Will only return entries that have the
+ * keywords in log_operation or log_data
+ * @var string profile_url URL to the users profile
+ * @var int log_type Limit logs to a certain type. If log_type
+ * is false, no entries will be returned.
+ * @var string sql_additional Additional conditions for the entries,
+ * e.g.: 'AND l.forum_id = 1'
+ * @since 3.1.0-a1
+ */
+ $vars = array(
+ 'mode',
+ 'count_logs',
+ 'limit',
+ 'offset',
+ 'forum_id',
+ 'topic_id',
+ 'user_id',
+ 'log_time',
+ 'sort_by',
+ 'keywords',
+ 'profile_url',
+ 'log_type',
+ 'sql_additional',
+ );
+ extract($this->dispatcher->trigger_event('core.get_logs_modify_type', compact($vars)));
+
+ if ($log_type === false)
+ {
+ $this->last_page_offset = 0;
+ return array();
+ }
+
+ $sql_keywords = '';
+ if (!empty($keywords))
+ {
+ // Get the SQL condition for our keywords
+ $sql_keywords = $this->generate_sql_keyword($keywords);
+ }
+
+ $get_logs_sql_ary = array(
+ 'SELECT' => 'l.*, u.username, u.username_clean, u.user_colour',
+ 'FROM' => array(
+ $this->log_table => 'l',
+ USERS_TABLE => 'u',
+ ),
+ 'WHERE' => 'l.log_type = ' . (int) $log_type . "
+ AND l.user_id = u.user_id
+ $sql_keywords
+ $sql_additional",
+
+ 'ORDER_BY' => $sort_by,
+ );
+
+ if ($log_time)
+ {
+ $get_logs_sql_ary['WHERE'] = 'l.log_time >= ' . (int) $log_time . '
+ AND ' . $get_logs_sql_ary['WHERE'];
+ }
+
+ /**
+ * Modify the query to obtain the logs data
+ *
+ * @event core.get_logs_main_query_before
+ * @var array get_logs_sql_ary The array in the format of the query builder with the query
+ * to get the log count and the log list
+ * @var string mode Mode of the entries we display
+ * @var bool count_logs Do we count all matching entries?
+ * @var int limit Limit the number of entries
+ * @var int offset Offset when fetching the entries
+ * @var mixed forum_id Limit entries to the forum_id,
+ * can also be an array of forum_ids
+ * @var int topic_id Limit entries to the topic_id
+ * @var int user_id Limit entries to the user_id
+ * @var int log_time Limit maximum age of log entries
+ * @var string sort_by SQL order option
+ * @var string keywords Will only return entries that have the
+ * keywords in log_operation or log_data
+ * @var string profile_url URL to the users profile
+ * @var int log_type Limit logs to a certain type. If log_type
+ * is false, no entries will be returned.
+ * @var string sql_additional Additional conditions for the entries,
+ * e.g.: 'AND l.forum_id = 1'
+ * @since 3.1.5-RC1
+ */
+ $vars = array(
+ 'get_logs_sql_ary',
+ 'mode',
+ 'count_logs',
+ 'limit',
+ 'offset',
+ 'forum_id',
+ 'topic_id',
+ 'user_id',
+ 'log_time',
+ 'sort_by',
+ 'keywords',
+ 'profile_url',
+ 'log_type',
+ 'sql_additional',
+ );
+ extract($this->dispatcher->trigger_event('core.get_logs_main_query_before', compact($vars)));
+
+ if ($count_logs)
+ {
+ $count_logs_sql_ary = $get_logs_sql_ary;
+
+ $count_logs_sql_ary['SELECT'] = 'COUNT(l.log_id) AS total_entries';
+ unset($count_logs_sql_ary['ORDER_BY']);
+
+ $sql = $this->db->sql_build_query('SELECT', $count_logs_sql_ary);
+ $result = $this->db->sql_query($sql);
+ $this->entry_count = (int) $this->db->sql_fetchfield('total_entries');
+ $this->db->sql_freeresult($result);
+
+ if ($this->entry_count == 0)
+ {
+ // Save the queries, because there are no logs to display
+ $this->last_page_offset = 0;
+ return array();
+ }
+
+ // Return the user to the last page that is valid
+ while ($this->last_page_offset >= $this->entry_count)
+ {
+ $this->last_page_offset = max(0, $this->last_page_offset - $limit);
+ }
+ }
+
+ $sql = $this->db->sql_build_query('SELECT', $get_logs_sql_ary);
+ $result = $this->db->sql_query_limit($sql, $limit, $this->last_page_offset);
+
+ $i = 0;
+ $log = array();
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $row['forum_id'] = (int) $row['forum_id'];
+ if ($row['topic_id'])
+ {
+ $topic_id_list[] = (int) $row['topic_id'];
+ }
+
+ if ($row['reportee_id'])
+ {
+ $reportee_id_list[] = (int) $row['reportee_id'];
+ }
+
+ $log_entry_data = array(
+ 'id' => (int) $row['log_id'],
+
+ 'reportee_id' => (int) $row['reportee_id'],
+ 'reportee_username' => '',
+ 'reportee_username_full'=> '',
+
+ 'user_id' => (int) $row['user_id'],
+ 'username' => $row['username'],
+ 'username_full' => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour'], false, $profile_url),
+
+ 'ip' => $row['log_ip'],
+ 'time' => (int) $row['log_time'],
+ 'forum_id' => (int) $row['forum_id'],
+ 'topic_id' => (int) $row['topic_id'],
+
+ 'viewforum' => ($row['forum_id'] && $this->auth->acl_get('f_read', $row['forum_id'])) ? append_sid("{$this->phpbb_root_path}viewforum.{$this->php_ext}", 'f=' . $row['forum_id']) : false,
+ 'action' => (isset($this->user->lang[$row['log_operation']])) ? $row['log_operation'] : '{' . ucfirst(str_replace('_', ' ', $row['log_operation'])) . '}',
+ );
+
+ /**
+ * Modify the entry's data before it is returned
+ *
+ * @event core.get_logs_modify_entry_data
+ * @var array row Entry data from the database
+ * @var array log_entry_data Entry's data which is returned
+ * @since 3.1.0-a1
+ */
+ $vars = array('row', 'log_entry_data');
+ extract($this->dispatcher->trigger_event('core.get_logs_modify_entry_data', compact($vars)));
+
+ $log[$i] = $log_entry_data;
+
+ if (!empty($row['log_data']))
+ {
+ $log_data_ary = unserialize($row['log_data']);
+ $log_data_ary = ($log_data_ary !== false) ? $log_data_ary : array();
+
+ if (isset($this->user->lang[$row['log_operation']]))
+ {
+ // Check if there are more occurrences of % than
+ // arguments, if there are we fill out the arguments
+ // array. It doesn't matter if we add more arguments than
+ // placeholders.
+ $num_args = 0;
+ if (!is_array($this->user->lang[$row['log_operation']]))
+ {
+ $num_args = substr_count($this->user->lang[$row['log_operation']], '%');
+ }
+ else
+ {
+ foreach ($this->user->lang[$row['log_operation']] as $case => $plural_string)
+ {
+ $num_args = max($num_args, substr_count($plural_string, '%'));
+ }
+ }
+
+ if (($num_args - sizeof($log_data_ary)) > 0)
+ {
+ $log_data_ary = array_merge($log_data_ary, array_fill(0, $num_args - sizeof($log_data_ary), ''));
+ }
+
+ $lang_arguments = array_merge(array($log[$i]['action']), $log_data_ary);
+ $log[$i]['action'] = call_user_func_array(array($this->user, 'lang'), $lang_arguments);
+
+ // If within the admin panel we do not censor text out
+ if ($this->get_is_admin())
+ {
+ $log[$i]['action'] = bbcode_nl2br($log[$i]['action']);
+ }
+ else
+ {
+ $log[$i]['action'] = bbcode_nl2br(censor_text($log[$i]['action']));
+ }
+ }
+ else if (!empty($log_data_ary))
+ {
+ $log[$i]['action'] .= '<br />' . implode('', $log_data_ary);
+ }
+
+ /* Apply make_clickable... has to be seen if it is for good. :/
+ // Seems to be not for the moment, reconsider later...
+ $log[$i]['action'] = make_clickable($log[$i]['action']);
+ */
+ }
+ else
+ {
+ $log[$i]['action'] = $this->user->lang($log[$i]['action']);
+ }
+
+ $i++;
+ }
+ $this->db->sql_freeresult($result);
+
+ /**
+ * Get some additional data after we got all log entries
+ *
+ * @event core.get_logs_get_additional_data
+ * @var array log Array with all our log entries
+ * @var array topic_id_list Array of topic ids, for which we
+ * get the permission data
+ * @var array reportee_id_list Array of additional user IDs we
+ * get the username strings for
+ * @since 3.1.0-a1
+ */
+ $vars = array('log', 'topic_id_list', 'reportee_id_list');
+ extract($this->dispatcher->trigger_event('core.get_logs_get_additional_data', compact($vars)));
+
+ if (sizeof($topic_id_list))
+ {
+ $topic_auth = $this->get_topic_auth($topic_id_list);
+
+ foreach ($log as $key => $row)
+ {
+ $log[$key]['viewtopic'] = (isset($topic_auth['f_read'][$row['topic_id']])) ? append_sid("{$this->phpbb_root_path}viewtopic.{$this->php_ext}", 'f=' . $topic_auth['f_read'][$row['topic_id']] . '&amp;t=' . $row['topic_id']) : false;
+ $log[$key]['viewlogs'] = (isset($topic_auth['m_'][$row['topic_id']])) ? append_sid("{$this->phpbb_root_path}mcp.{$this->php_ext}", 'i=logs&amp;mode=topic_logs&amp;t=' . $row['topic_id'], true, $this->user->session_id) : false;
+ }
+ }
+
+ if (sizeof($reportee_id_list))
+ {
+ $reportee_data_list = $this->get_reportee_data($reportee_id_list);
+
+ foreach ($log as $key => $row)
+ {
+ if (!isset($reportee_data_list[$row['reportee_id']]))
+ {
+ continue;
+ }
+
+ $log[$key]['reportee_username'] = $reportee_data_list[$row['reportee_id']]['username'];
+ $log[$key]['reportee_username_full'] = get_username_string('full', $row['reportee_id'], $reportee_data_list[$row['reportee_id']]['username'], $reportee_data_list[$row['reportee_id']]['user_colour'], false, $profile_url);
+ }
+ }
+
+ /**
+ * Allow modifying or execute extra final filter on log entries
+ *
+ * @event core.get_logs_after
+ * @var array log Array with all our log entries
+ * @var array topic_id_list Array of topic ids, for which we
+ * get the permission data
+ * @var array reportee_id_list Array of additional user IDs we
+ * get the username strings for
+ * @var string mode Mode of the entries we display
+ * @var bool count_logs Do we count all matching entries?
+ * @var int limit Limit the number of entries
+ * @var int offset Offset when fetching the entries
+ * @var mixed forum_id Limit entries to the forum_id,
+ * can also be an array of forum_ids
+ * @var int topic_id Limit entries to the topic_id
+ * @var int user_id Limit entries to the user_id
+ * @var int log_time Limit maximum age of log entries
+ * @var string sort_by SQL order option
+ * @var string keywords Will only return entries that have the
+ * keywords in log_operation or log_data
+ * @var string profile_url URL to the users profile
+ * @var int log_type The type of logs it was filtered
+ * @since 3.1.3-RC1
+ */
+ $vars = array(
+ 'log',
+ 'topic_id_list',
+ 'reportee_id_list',
+ 'mode',
+ 'count_logs',
+ 'limit',
+ 'offset',
+ 'forum_id',
+ 'topic_id',
+ 'user_id',
+ 'log_time',
+ 'sort_by',
+ 'keywords',
+ 'profile_url',
+ 'log_type',
+ );
+ extract($this->dispatcher->trigger_event('core.get_logs_after', compact($vars)));
+
+ return $log;
+ }
+
+ /**
+ * Generates a sql condition for the specified keywords
+ *
+ * @param string $keywords The keywords the user specified to search for
+ * @param string $table_alias The alias of the logs' table ('l.' by default)
+ * @param string $statement_operator The operator used to prefix the statement ('AND' by default)
+ *
+ * @return string Returns the SQL condition searching for the keywords
+ */
+ protected function generate_sql_keyword($keywords, $table_alias = 'l.', $statement_operator = 'AND')
+ {
+ // Use no preg_quote for $keywords because this would lead to sole
+ // backslashes being added. We also use an OR connection here for
+ // spaces and the | string. Currently, regex is not supported for
+ // searching (but may come later).
+ $keywords = preg_split('#[\s|]+#u', utf8_strtolower($keywords), 0, PREG_SPLIT_NO_EMPTY);
+ $sql_keywords = '';
+
+ if (!empty($keywords))
+ {
+ $keywords_pattern = array();
+
+ // Build pattern and keywords...
+ for ($i = 0, $num_keywords = sizeof($keywords); $i < $num_keywords; $i++)
+ {
+ $keywords_pattern[] = preg_quote($keywords[$i], '#');
+ $keywords[$i] = $this->db->sql_like_expression($this->db->get_any_char() . $keywords[$i] . $this->db->get_any_char());
+ }
+
+ $keywords_pattern = '#' . implode('|', $keywords_pattern) . '#ui';
+
+ $operations = array();
+ foreach ($this->user->lang as $key => $value)
+ {
+ if (substr($key, 0, 4) == 'LOG_')
+ {
+ if (is_array($value))
+ {
+ foreach ($value as $plural_value)
+ {
+ if (preg_match($keywords_pattern, $plural_value))
+ {
+ $operations[] = $key;
+ break;
+ }
+ }
+ }
+ else if (preg_match($keywords_pattern, $value))
+ {
+ $operations[] = $key;
+ }
+ }
+ }
+
+ $sql_keywords = ' ' . $statement_operator . ' (';
+ if (!empty($operations))
+ {
+ $sql_keywords .= $this->db->sql_in_set($table_alias . 'log_operation', $operations) . ' OR ';
+ }
+ $sql_lower = $this->db->sql_lower_text($table_alias . 'log_data');
+ $sql_keywords .= " $sql_lower " . implode(" OR $sql_lower ", $keywords) . ')';
+ }
+
+ return $sql_keywords;
+ }
+
+ /**
+ * Determine whether the user is allowed to read and/or moderate the forum of the topic
+ *
+ * @param array $topic_ids Array with the topic ids
+ *
+ * @return array Returns an array with two keys 'm_' and 'read_f' which are also an array of topic_id => forum_id sets when the permissions are given. Sample:
+ * array(
+ * 'permission' => array(
+ * topic_id => forum_id
+ * ),
+ * ),
+ */
+ protected function get_topic_auth(array $topic_ids)
+ {
+ $forum_auth = array('f_read' => array(), 'm_' => array());
+ $topic_ids = array_unique($topic_ids);
+
+ $sql_ary = array(
+ 'SELECT' => 'topic_id, forum_id',
+ 'FROM' => array(
+ TOPICS_TABLE => 't',
+ ),
+ 'WHERE' => $this->db->sql_in_set('topic_id', array_map('intval', $topic_ids)),
+ );
+
+ /**
+ * Allow modifying SQL query before topic data is retrieved.
+ *
+ * @event core.phpbb_log_get_topic_auth_sql_before
+ * @var array topic_ids Array with unique topic IDs
+ * @var array sql_ary SQL array
+ * @since 3.1.11-RC1
+ */
+ $vars = array(
+ 'topic_ids',
+ 'sql_ary',
+ );
+ extract($this->dispatcher->trigger_event('core.phpbb_log_get_topic_auth_sql_before', compact($vars)));
+
+ $sql = $this->db->sql_build_query('SELECT', $sql_ary);
+ $result = $this->db->sql_query($sql);
+
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $row['topic_id'] = (int) $row['topic_id'];
+ $row['forum_id'] = (int) $row['forum_id'];
+
+ if ($this->auth->acl_get('f_read', $row['forum_id']))
+ {
+ $forum_auth['f_read'][$row['topic_id']] = $row['forum_id'];
+ }
+
+ if ($this->auth->acl_gets('a_', 'm_', $row['forum_id']))
+ {
+ $forum_auth['m_'][$row['topic_id']] = $row['forum_id'];
+ }
+ }
+ $this->db->sql_freeresult($result);
+
+ return $forum_auth;
+ }
+
+ /**
+ * Get the data for all reportee from the database
+ *
+ * @param array $reportee_ids Array with the user ids of the reportees
+ *
+ * @return array Returns an array with the reportee data
+ */
+ protected function get_reportee_data(array $reportee_ids)
+ {
+ $reportee_ids = array_unique($reportee_ids);
+ $reportee_data_list = array();
+
+ $sql = 'SELECT user_id, username, user_colour
+ FROM ' . USERS_TABLE . '
+ WHERE ' . $this->db->sql_in_set('user_id', $reportee_ids);
+ $result = $this->db->sql_query($sql);
+
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $reportee_data_list[$row['user_id']] = $row;
+ }
+ $this->db->sql_freeresult($result);
+
+ return $reportee_data_list;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function get_log_count()
+ {
+ return ($this->entry_count) ? $this->entry_count : 0;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function get_valid_offset()
+ {
+ return ($this->last_page_offset) ? $this->last_page_offset : 0;
+ }
+}
diff --git a/phpBB/phpbb/log/log_interface.php b/phpBB/phpbb/log/log_interface.php
new file mode 100644
index 0000000000..5932f722aa
--- /dev/null
+++ b/phpBB/phpbb/log/log_interface.php
@@ -0,0 +1,114 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\log;
+
+/**
+* The interface for the log-system.
+*/
+interface log_interface
+{
+ /**
+ * This function returns the state of the log system.
+ *
+ * @param string $type The log type we want to check. Empty to get
+ * global log status.
+ *
+ * @return bool True if log for the type is enabled
+ */
+ public function is_enabled($type = '');
+
+ /**
+ * Disable log
+ *
+ * This function allows disabling the log system or parts of it, for this
+ * page call. When add_log is called and the type is disabled,
+ * the log will not be added to the database.
+ *
+ * @param mixed $type The log type we want to disable. Empty to
+ * disable all logs. Can also be an array of types.
+ *
+ * @return null
+ */
+ public function disable($type = '');
+
+ /**
+ * Enable log
+ *
+ * This function allows re-enabling the log system.
+ *
+ * @param mixed $type The log type we want to enable. Empty to
+ * enable all logs. Can also be an array of types.
+ *
+ * @return null
+ */
+ public function enable($type = '');
+
+ /**
+ * Adds a log entry to the database
+ *
+ * @param string $mode The mode defines which log_type is used and from which log the entry is retrieved
+ * @param int $user_id User ID of the user
+ * @param string $log_ip IP address of the user
+ * @param string $log_operation Name of the operation
+ * @param int $log_time Timestamp when the log entry was added, if empty time() will be used
+ * @param array $additional_data More arguments can be added, depending on the log_type
+ *
+ * @return int|bool Returns the log_id, if the entry was added to the database, false otherwise.
+ */
+ public function add($mode, $user_id, $log_ip, $log_operation, $log_time = false, $additional_data = array());
+
+ /**
+ * Delete entries in the logs
+ *
+ * @param string $mode The mode defines which log_type is used and from which log the entries are deleted
+ * @param array $conditions An array of conditions, 3 different forms are accepted
+ * 1) <key> => <value> transformed into 'AND <key> = <value>' (value should be an integer)
+ * 2) <key> => array(<operator>, <value>) transformed into 'AND <key> <operator> <value>' (values can't be an array)
+ * 3) <key> => array('IN' => array(<values>)) transformed into 'AND <key> IN <values>'
+ * A special field, keywords, can also be defined. In this case only the log entries that have the keywords in log_operation or log_data will be deleted.
+ */
+ public function delete($mode, $conditions = array());
+
+ /**
+ * Grab the logs from the database
+ *
+ * @param string $mode The mode defines which log_type is used and ifrom which log the entry is retrieved
+ * @param bool $count_logs Shall we count all matching log entries?
+ * @param int $limit Limit the number of entries that are returned
+ * @param int $offset Offset when fetching the log entries, f.e. when paginating
+ * @param mixed $forum_id Restrict the log entries to the given forum_id (can also be an array of forum_ids)
+ * @param int $topic_id Restrict the log entries to the given topic_id
+ * @param int $user_id Restrict the log entries to the given user_id
+ * @param int $log_time Only get log entries newer than the given timestamp
+ * @param string $sort_by SQL order option, e.g. 'l.log_time DESC'
+ * @param string $keywords Will only return log entries that have the keywords in log_operation or log_data
+ *
+ * @return array The result array with the logs
+ */
+ public function get_logs($mode, $count_logs = true, $limit = 0, $offset = 0, $forum_id = 0, $topic_id = 0, $user_id = 0, $log_time = 0, $sort_by = 'l.log_time DESC', $keywords = '');
+
+ /**
+ * Get total log count
+ *
+ * @return int Returns the number of matching logs from the last call to get_logs()
+ */
+ public function get_log_count();
+
+ /**
+ * Get offset of the last valid page
+ *
+ * @return int Returns the offset of the last valid page from the last call to get_logs()
+ */
+ public function get_valid_offset();
+}
diff --git a/phpBB/phpbb/log/null.php b/phpBB/phpbb/log/null.php
new file mode 100644
index 0000000000..baa78895ea
--- /dev/null
+++ b/phpBB/phpbb/log/null.php
@@ -0,0 +1,81 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\log;
+
+/**
+* Null logger
+*/
+class null implements log_interface
+{
+ /**
+ * {@inheritdoc}
+ */
+ public function is_enabled($type = '')
+ {
+ return false;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function disable($type = '')
+ {
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function enable($type = '')
+ {
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function add($mode, $user_id, $log_ip, $log_operation, $log_time = false, $additional_data = array())
+ {
+ return false;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function delete($mode, $conditions = array())
+ {
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_logs($mode, $count_logs = true, $limit = 0, $offset = 0, $forum_id = 0, $topic_id = 0, $user_id = 0, $log_time = 0, $sort_by = 'l.log_time DESC', $keywords = '')
+ {
+ return array();
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_log_count()
+ {
+ return 0;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_valid_offset()
+ {
+ return 0;
+ }
+}
diff --git a/phpBB/phpbb/message/admin_form.php b/phpBB/phpbb/message/admin_form.php
new file mode 100644
index 0000000000..96b8d3499e
--- /dev/null
+++ b/phpBB/phpbb/message/admin_form.php
@@ -0,0 +1,192 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\message;
+
+/**
+* Class admin_form
+* Displays a message to the user and allows him to send an email
+*/
+class admin_form extends form
+{
+ /** @var \phpbb\config\db_text */
+ protected $config_text;
+
+ /** @var string */
+ protected $subject;
+ /** @var string */
+ protected $sender_name;
+ /** @var string */
+ protected $sender_address;
+
+ /**
+ * Construct
+ *
+ * @param \phpbb\auth\auth $auth
+ * @param \phpbb\config\config $config
+ * @param \phpbb\config\db_text $config_text
+ * @param \phpbb\db\driver\driver_interface $db
+ * @param \phpbb\user $user
+ * @param string $phpbb_root_path
+ * @param string $phpEx
+ */
+ public function __construct(\phpbb\auth\auth $auth, \phpbb\config\config $config, \phpbb\config\db_text $config_text, \phpbb\db\driver\driver_interface $db, \phpbb\user $user, $phpbb_root_path, $phpEx)
+ {
+ parent::__construct($auth, $config, $db, $user, $phpbb_root_path, $phpEx);
+ $this->config_text = $config_text;
+ }
+
+ /**
+ * {inheritDoc}
+ */
+ public function check_allow()
+ {
+ $error = parent::check_allow();
+ if ($error)
+ {
+ return $error;
+ }
+
+ if (!$this->config['contact_admin_form_enable'])
+ {
+ return 'NO_CONTACT_PAGE';
+ }
+
+ return false;
+ }
+
+ /**
+ * {inheritDoc}
+ */
+ public function bind(\phpbb\request\request_interface $request)
+ {
+ parent::bind($request);
+
+ $this->subject = $request->variable('subject', '', true);
+ $this->sender_address = $request->variable('email', '');
+ $this->sender_name = $request->variable('name', '', true);
+ }
+
+ /**
+ * {inheritDoc}
+ */
+ public function submit(\messenger $messenger)
+ {
+ if (!$this->subject)
+ {
+ $this->errors[] = $this->user->lang['EMPTY_SUBJECT_EMAIL'];
+ }
+ if (!$this->body)
+ {
+ $this->errors[] = $this->user->lang['EMPTY_MESSAGE_EMAIL'];
+ }
+
+ if ($this->user->data['is_registered'])
+ {
+ $this->message->set_sender_from_user($this->user);
+ $this->sender_name = $this->user->data['username'];
+ $this->sender_address = $this->user->data['user_email'];
+ }
+ else
+ {
+ if (!$this->sender_name)
+ {
+ $this->errors[] = $this->user->lang['EMPTY_SENDER_NAME'];
+ }
+
+ if (!function_exists('validate_data'))
+ {
+ require($this->phpbb_root_path . 'includes/functions_user.' . $this->phpEx);
+ }
+
+ $validate_array = validate_data(
+ array(
+ 'email' => $this->sender_address,
+ ),
+ array(
+ 'email' => array(
+ array('string', false, 6, 60),
+ array('email'),
+ ),
+ )
+ );
+
+ foreach ($validate_array as $error)
+ {
+ $this->errors[] = $this->user->lang[$error];
+ }
+
+ $this->message->set_sender($this->user->ip, $this->sender_name, $this->sender_address, $this->user->lang_name);
+ $this->message->set_sender_notify_type(NOTIFY_EMAIL);
+ }
+
+ $this->message->set_template('contact_admin');
+ $this->message->set_subject($this->subject);
+ $this->message->set_body($this->body);
+ $this->message->add_recipient(
+ $this->user->lang['ADMINISTRATOR'],
+ $this->config['board_contact'],
+ $this->config['default_lang'],
+ NOTIFY_EMAIL
+ );
+
+ $this->message->set_template_vars(array(
+ 'FROM_EMAIL_ADDRESS' => $this->sender_address,
+ 'FROM_IP_ADDRESS' => $this->user->ip,
+ 'S_IS_REGISTERED' => $this->user->data['is_registered'],
+
+ 'U_FROM_PROFILE' => generate_board_url() . '/memberlist.' . $this->phpEx . '?mode=viewprofile&u=' . $this->user->data['user_id'],
+ ));
+
+ parent::submit($messenger);
+ }
+
+ /**
+ * {inheritDoc}
+ */
+ public function render(\phpbb\template\template $template)
+ {
+ $l_admin_info = $this->config_text->get('contact_admin_info');
+ if ($l_admin_info)
+ {
+ $contact_admin_data = $this->config_text->get_array(array(
+ 'contact_admin_info',
+ 'contact_admin_info_uid',
+ 'contact_admin_info_bitfield',
+ 'contact_admin_info_flags',
+ ));
+
+ $l_admin_info = generate_text_for_display(
+ $contact_admin_data['contact_admin_info'],
+ $contact_admin_data['contact_admin_info_uid'],
+ $contact_admin_data['contact_admin_info_bitfield'],
+ $contact_admin_data['contact_admin_info_flags']
+ );
+ }
+
+ $template->assign_vars(array(
+ 'S_CONTACT_ADMIN' => true,
+ 'S_CONTACT_FORM' => $this->config['contact_admin_form_enable'],
+ 'S_IS_REGISTERED' => $this->user->data['is_registered'],
+ 'S_POST_ACTION' => append_sid($this->phpbb_root_path . 'memberlist.' . $this->phpEx, 'mode=contactadmin'),
+
+ 'CONTACT_INFO' => $l_admin_info,
+ 'MESSAGE' => $this->body,
+ 'SUBJECT' => $this->subject,
+ 'NAME' => $this->sender_name,
+ 'EMAIL' => $this->sender_address,
+ ));
+
+ parent::render($template);
+ }
+}
diff --git a/phpBB/phpbb/message/form.php b/phpBB/phpbb/message/form.php
new file mode 100644
index 0000000000..21d4de0b4d
--- /dev/null
+++ b/phpBB/phpbb/message/form.php
@@ -0,0 +1,175 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\message;
+
+/**
+* Abstract class form
+*/
+abstract class form
+{
+ /** @var \phpbb\auth\auth */
+ protected $auth;
+ /** @var \phpbb\config\config */
+ protected $config;
+ /** @var \phpbb\db\driver\driver_interface */
+ protected $db;
+ /** @var \phpbb\message\message */
+ protected $message;
+ /** @var \phpbb\user */
+ protected $user;
+
+ /** @var string */
+ protected $phpbb_root_path;
+ /** @var string */
+ protected $phpEx;
+
+ /** @var array */
+ protected $errors = array();
+ /** @var bool */
+ protected $cc_sender;
+ /** @var string */
+ protected $body;
+
+ /**
+ * Construct
+ *
+ * @param \phpbb\auth\auth $auth
+ * @param \phpbb\config\config $config
+ * @param \phpbb\db\driver\driver_interface $db
+ * @param \phpbb\user $user
+ * @param string $phpbb_root_path
+ * @param string $phpEx
+ */
+ public function __construct(\phpbb\auth\auth $auth, \phpbb\config\config $config, \phpbb\db\driver\driver_interface $db, \phpbb\user $user, $phpbb_root_path, $phpEx)
+ {
+ $this->phpbb_root_path = $phpbb_root_path;
+ $this->phpEx = $phpEx;
+ $this->user = $user;
+ $this->auth = $auth;
+ $this->config = $config;
+ $this->db = $db;
+
+ $this->message = new message($config['server_name']);
+ $this->message->set_sender_from_user($this->user);
+ }
+
+ /**
+ * Returns the title for the email form page
+ *
+ * @return string
+ */
+ public function get_page_title()
+ {
+ return $this->user->lang['SEND_EMAIL'];
+ }
+
+ /**
+ * Returns the file name of the form template
+ *
+ * @return string
+ */
+ public function get_template_file()
+ {
+ return 'memberlist_email.html';
+ }
+
+ /**
+ * Checks whether the user is allowed to use the form
+ *
+ * @return false|string Error string if not allowed, false otherwise
+ */
+ public function check_allow()
+ {
+ if (!$this->config['email_enable'])
+ {
+ return 'EMAIL_DISABLED';
+ }
+
+ if (time() - $this->user->data['user_emailtime'] < $this->config['flood_interval'])
+ {
+ return 'FLOOD_EMAIL_LIMIT';
+ }
+
+ return false;
+ }
+
+ /**
+ * Get the return link after the message has been sent
+ *
+ * @return string
+ */
+ public function get_return_message()
+ {
+ return sprintf($this->user->lang['RETURN_INDEX'], '<a href="' . append_sid($this->phpbb_root_path . 'index.' . $this->phpEx) . '">', '</a>');
+ }
+
+ /**
+ * Bind the values of the request to the form
+ *
+ * @param \phpbb\request\request_interface $request
+ * @return null
+ */
+ public function bind(\phpbb\request\request_interface $request)
+ {
+ $this->cc_sender = $request->is_set_post('cc_sender');
+ $this->body = $request->variable('message', '', true);
+ }
+
+ /**
+ * Submit form, generate the email and send it
+ *
+ * @param \messenger $messenger
+ * @return null
+ */
+ public function submit(\messenger $messenger)
+ {
+ if (!check_form_key('memberlist_email'))
+ {
+ $this->errors[] = 'FORM_INVALID';
+ }
+
+ if (!sizeof($this->errors))
+ {
+ $sql = 'UPDATE ' . USERS_TABLE . '
+ SET user_emailtime = ' . time() . '
+ WHERE user_id = ' . $this->user->data['user_id'];
+ $this->db->sql_query($sql);
+
+ if ($this->cc_sender && $this->user->data['is_registered'])
+ {
+ $this->message->cc_sender();
+ }
+
+ $this->message->send($messenger, phpbb_get_board_contact($this->config, $this->phpEx));
+
+ meta_refresh(3, append_sid($this->phpbb_root_path . 'index.' . $this->phpEx));
+ trigger_error($this->user->lang['EMAIL_SENT'] . '<br /><br />' . $this->get_return_message());
+ }
+ }
+
+ /**
+ * Render the template of the form
+ *
+ * @param \phpbb\template\template $template
+ * @return null
+ */
+ public function render(\phpbb\template\template $template)
+ {
+ add_form_key('memberlist_email');
+
+ $template->assign_vars(array(
+ 'ERROR_MESSAGE' => (sizeof($this->errors)) ? implode('<br />', $this->errors) : '',
+ ));
+ }
+}
diff --git a/phpBB/phpbb/message/message.php b/phpBB/phpbb/message/message.php
new file mode 100644
index 0000000000..5fd24b542e
--- /dev/null
+++ b/phpBB/phpbb/message/message.php
@@ -0,0 +1,282 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\message;
+
+/**
+* Class message
+* Holds all information for an email and sends it in the end
+*/
+class message
+{
+ /** @var string */
+ protected $server_name;
+
+ /** @var string */
+ protected $subject = '';
+ /** @var string */
+ protected $body = '';
+ /** @var string */
+ protected $template = '';
+ /** @var array */
+ protected $template_vars = array();
+
+ /** @var string */
+ protected $sender_ip = '';
+ /** @var string */
+ protected $sender_name = '';
+ /** @var string */
+ protected $sender_address = '';
+ /** @var string */
+ protected $sender_lang = '';
+ /** @var string */
+ protected $sender_id = '';
+ /** @var string */
+ protected $sender_username = '';
+ /** @var string */
+ protected $sender_jabber = '';
+ /** @var int */
+ protected $sender_notify_type = NOTIFY_EMAIL;
+
+ /** @var array */
+ protected $recipients;
+
+ /**
+ * Construct
+ *
+ * @param string $server_name Used for AntiAbuse header
+ */
+ public function __construct($server_name)
+ {
+ $this->server_name = $server_name;
+ }
+
+ /**
+ * Set the subject of the email
+ *
+ * @param string $subject
+ * @return null
+ */
+ public function set_subject($subject)
+ {
+ $this->subject = $subject;
+ }
+
+ /**
+ * Set the body of the email text
+ *
+ * @param string $body
+ * @return null
+ */
+ public function set_body($body)
+ {
+ $this->body = $body;
+ }
+
+ /**
+ * Set the name of the email template to use
+ *
+ * @param string $template
+ * @return null
+ */
+ public function set_template($template)
+ {
+ $this->template = $template;
+ }
+
+ /**
+ * Set the array with the "template" data for the email
+ *
+ * @param array $template_vars
+ * @return null
+ */
+ public function set_template_vars($template_vars)
+ {
+ $this->template_vars = $template_vars;
+ }
+
+ /**
+ * Add a recipient from \phpbb\user
+ *
+ * @param array $user
+ * @return null
+ */
+ public function add_recipient_from_user_row(array $user)
+ {
+ $this->add_recipient(
+ $user['username'],
+ $user['user_email'],
+ $user['user_lang'],
+ $user['user_notify_type'],
+ $user['username'],
+ $user['user_jabber']
+ );
+ }
+
+ /**
+ * Add a recipient
+ *
+ * @param string $recipient_name Displayed sender name
+ * @param string $recipient_address Email address
+ * @param string $recipient_lang
+ * @param int $recipient_notify_type Used notification methods (Jabber, Email, ...)
+ * @param string $recipient_username User Name (used for AntiAbuse header)
+ * @param string $recipient_jabber
+ * @return null
+ */
+ public function add_recipient($recipient_name, $recipient_address, $recipient_lang, $recipient_notify_type = NOTIFY_EMAIL, $recipient_username = '', $recipient_jabber = '')
+ {
+ $this->recipients[] = array(
+ 'name' => $recipient_name,
+ 'address' => $recipient_address,
+ 'lang' => $recipient_lang,
+ 'username' => $recipient_username,
+ 'jabber' => $recipient_jabber,
+ 'notify_type' => $recipient_notify_type,
+ 'to_name' => $recipient_name,
+ );
+ }
+
+ /**
+ * Set the senders data from \phpbb\user object
+ *
+ * @param \phpbb\user $user
+ * @return null
+ */
+ public function set_sender_from_user($user)
+ {
+ $this->set_sender(
+ $user->ip,
+ $user->data['username'],
+ $user->data['user_email'],
+ $user->lang_name,
+ $user->data['user_id'],
+ $user->data['username'],
+ $user->data['user_jabber']
+ );
+
+ $this->set_sender_notify_type($user->data['user_notify_type']);
+ }
+
+ /**
+ * Set the senders data
+ *
+ * @param string $sender_ip
+ * @param string $sender_name Displayed sender name
+ * @param string $sender_address Email address
+ * @param string $sender_lang
+ * @param int $sender_id User ID
+ * @param string $sender_username User Name (used for AntiAbuse header)
+ * @param string $sender_jabber
+ * @return null
+ */
+ public function set_sender($sender_ip, $sender_name, $sender_address, $sender_lang = '', $sender_id = 0, $sender_username = '', $sender_jabber = '')
+ {
+ $this->sender_ip = $sender_ip;
+ $this->sender_name = $sender_name;
+ $this->sender_address = $sender_address;
+ $this->sender_lang = $sender_lang;
+ $this->sender_id = $sender_id;
+ $this->sender_username = $sender_username;
+ $this->sender_jabber = $sender_jabber;
+ }
+
+ /**
+ * Which notification type should be used? Jabber, Email, ...?
+ *
+ * @param int $sender_notify_type
+ * @return null
+ */
+ public function set_sender_notify_type($sender_notify_type)
+ {
+ $this->sender_notify_type = $sender_notify_type;
+ }
+
+ /**
+ * Ok, now the same email if CC specified, but without exposing the user's email address
+ *
+ * @return null
+ */
+ public function cc_sender()
+ {
+ if (!sizeof($this->recipients))
+ {
+ trigger_error('No email recipients specified');
+ }
+ if (!$this->sender_address)
+ {
+ trigger_error('No email sender specified');
+ }
+
+ $this->recipients[] = array(
+ 'lang' => $this->sender_lang,
+ 'address' => $this->sender_address,
+ 'name' => $this->sender_name,
+ 'username' => $this->sender_username,
+ 'jabber' => $this->sender_jabber,
+ 'notify_type' => $this->sender_notify_type,
+ 'to_name' => $this->recipients[0]['to_name'],
+ );
+ }
+
+ /**
+ * Send the email
+ *
+ * @param \messenger $messenger
+ * @param string $contact
+ * @return null
+ */
+ public function send(\messenger $messenger, $contact)
+ {
+ if (!sizeof($this->recipients))
+ {
+ return;
+ }
+
+ foreach ($this->recipients as $recipient)
+ {
+ $messenger->template($this->template, $recipient['lang']);
+ $messenger->replyto($this->sender_address);
+ $messenger->to($recipient['address'], $recipient['name']);
+ $messenger->im($recipient['jabber'], $recipient['username']);
+
+ $messenger->headers('X-AntiAbuse: Board servername - ' . $this->server_name);
+ $messenger->headers('X-AntiAbuse: User IP - ' . $this->sender_ip);
+
+ if ($this->sender_id)
+ {
+ $messenger->headers('X-AntiAbuse: User_id - ' . $this->sender_id);
+ }
+ if ($this->sender_username)
+ {
+ $messenger->headers('X-AntiAbuse: Username - ' . $this->sender_username);
+ }
+
+ $messenger->subject(htmlspecialchars_decode($this->subject));
+
+ $messenger->assign_vars(array(
+ 'BOARD_CONTACT' => $contact,
+ 'TO_USERNAME' => htmlspecialchars_decode($recipient['to_name']),
+ 'FROM_USERNAME' => htmlspecialchars_decode($this->sender_name),
+ 'MESSAGE' => htmlspecialchars_decode($this->body))
+ );
+
+ if (sizeof($this->template_vars))
+ {
+ $messenger->assign_vars($this->template_vars);
+ }
+
+ $messenger->send($recipient['notify_type']);
+ }
+ }
+}
diff --git a/phpBB/phpbb/message/topic_form.php b/phpBB/phpbb/message/topic_form.php
new file mode 100644
index 0000000000..174643bb81
--- /dev/null
+++ b/phpBB/phpbb/message/topic_form.php
@@ -0,0 +1,158 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\message;
+
+/**
+* Class topic_form
+* Form used to send topics as notification emails
+*/
+class topic_form extends form
+{
+ /** @var int */
+ protected $topic_id;
+ /** @var array */
+ protected $topic_row;
+ /** @var string */
+ protected $recipient_address;
+ /** @var string */
+ protected $recipient_name;
+ /** @var string */
+ protected $recipient_lang;
+
+ /**
+ * Get the data of the topic
+ *
+ * @param int $topic_id
+ * @return false|array false if the topic does not exist, array otherwise
+ */
+ protected function get_topic_row($topic_id)
+ {
+ $sql = 'SELECT forum_id, topic_title
+ FROM ' . TOPICS_TABLE . '
+ WHERE topic_id = ' . (int) $topic_id;
+ $result = $this->db->sql_query($sql);
+ $row = $this->db->sql_fetchrow($result);
+ $this->db->sql_freeresult($result);
+
+ return $row;
+ }
+
+ /**
+ * {inheritDoc}
+ */
+ public function check_allow()
+ {
+ $error = parent::check_allow();
+ if ($error)
+ {
+ return $error;
+ }
+
+ if (!$this->auth->acl_get('u_sendemail'))
+ {
+ return 'NO_EMAIL';
+ }
+
+ if (!$this->topic_row)
+ {
+ return 'NO_TOPIC';
+ }
+
+ if (!$this->auth->acl_get('f_read', $this->topic_row['forum_id']))
+ {
+ return 'SORRY_AUTH_READ';
+ }
+
+ if (!$this->auth->acl_get('f_email', $this->topic_row['forum_id']))
+ {
+ return 'NO_EMAIL';
+ }
+
+ return false;
+ }
+
+ /**
+ * {inheritDoc}
+ */
+ public function bind(\phpbb\request\request_interface $request)
+ {
+ parent::bind($request);
+
+ $this->topic_id = $request->variable('t', 0);
+ $this->recipient_address = $request->variable('email', '');
+ $this->recipient_name = $request->variable('name', '', true);
+ $this->recipient_lang = $request->variable('lang', $this->config['default_lang']);
+
+ $this->topic_row = $this->get_topic_row($this->topic_id);
+ }
+
+ /**
+ * {inheritDoc}
+ */
+ public function submit(\messenger $messenger)
+ {
+ if (!$this->recipient_address || !preg_match('/^' . get_preg_expression('email') . '$/i', $this->recipient_address))
+ {
+ $this->errors[] = $this->user->lang['EMPTY_ADDRESS_EMAIL'];
+ }
+
+ if (!$this->recipient_name)
+ {
+ $this->errors[] = $this->user->lang['EMPTY_NAME_EMAIL'];
+ }
+
+ $this->message->set_template('email_notify');
+ $this->message->set_template_vars(array(
+ 'TOPIC_NAME' => htmlspecialchars_decode($this->topic_row['topic_title']),
+ 'U_TOPIC' => generate_board_url() . '/viewtopic.' . $this->phpEx . '?f=' . $this->topic_row['forum_id'] . '&t=' . $this->topic_id,
+ ));
+ $this->message->set_body($this->body);
+ $this->message->add_recipient(
+ $this->recipient_name,
+ $this->recipient_address,
+ $this->recipient_lang,
+ NOTIFY_EMAIL
+ );
+ $this->message->set_sender_notify_type(NOTIFY_EMAIL);
+
+ parent::submit($messenger);
+ }
+
+ /**
+ * {inheritDoc}
+ */
+ public function get_return_message()
+ {
+ return sprintf($this->user->lang['RETURN_TOPIC'], '<a href="' . append_sid($this->phpbb_root_path . 'viewtopic.' . $this->phpEx, 'f=' . $this->topic_row['forum_id'] . '&amp;t=' . $this->topic_id) . '">', '</a>');
+ }
+
+ /**
+ * {inheritDoc}
+ */
+ public function render(\phpbb\template\template $template)
+ {
+ parent::render($template);
+
+ $this->user->add_lang('viewtopic');
+ $template->assign_vars(array(
+ 'EMAIL' => $this->recipient_address,
+ 'NAME' => $this->recipient_name,
+ 'S_LANG_OPTIONS' => language_select($this->recipient_lang),
+ 'MESSAGE' => $this->body,
+
+ 'L_EMAIL_BODY_EXPLAIN' => $this->user->lang['EMAIL_TOPIC_EXPLAIN'],
+ 'S_POST_ACTION' => append_sid($this->phpbb_root_path . 'memberlist.' . $this->phpEx, 'mode=email&amp;t=' . $this->topic_id))
+ );
+ }
+}
diff --git a/phpBB/phpbb/message/user_form.php b/phpBB/phpbb/message/user_form.php
new file mode 100644
index 0000000000..007e575407
--- /dev/null
+++ b/phpBB/phpbb/message/user_form.php
@@ -0,0 +1,136 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\message;
+
+/**
+* Class user_form
+* Allows users to send emails to other users
+*/
+class user_form extends form
+{
+ /** @var int */
+ protected $recipient_id;
+ /** @var array */
+ protected $recipient_row;
+ /** @var string */
+ protected $subject;
+
+ /**
+ * Get the data of the recipient
+ *
+ * @param int $user_id
+ * @return false|array false if the user does not exist, array otherwise
+ */
+ protected function get_user_row($user_id)
+ {
+ $sql = 'SELECT user_id, username, user_colour, user_email, user_allow_viewemail, user_lang, user_jabber, user_notify_type
+ FROM ' . USERS_TABLE . '
+ WHERE user_id = ' . (int) $user_id . '
+ AND user_type IN (' . USER_NORMAL . ', ' . USER_FOUNDER . ')';
+ $result = $this->db->sql_query($sql);
+ $row = $this->db->sql_fetchrow($result);
+ $this->db->sql_freeresult($result);
+
+ return $row;
+ }
+
+ /**
+ * {inheritDoc}
+ */
+ public function check_allow()
+ {
+ $error = parent::check_allow();
+ if ($error)
+ {
+ return $error;
+ }
+
+ if (!$this->auth->acl_get('u_sendemail'))
+ {
+ return 'NO_EMAIL';
+ }
+
+ if ($this->recipient_id == ANONYMOUS || !$this->config['board_email_form'])
+ {
+ return 'NO_EMAIL';
+ }
+
+ if (!$this->recipient_row)
+ {
+ return 'NO_USER';
+ }
+
+ // Can we send email to this user?
+ if (!$this->recipient_row['user_allow_viewemail'] && !$this->auth->acl_get('a_user'))
+ {
+ return 'NO_EMAIL';
+ }
+
+ return false;
+ }
+
+ /**
+ * {inheritDoc}
+ */
+ public function bind(\phpbb\request\request_interface $request)
+ {
+ parent::bind($request);
+
+ $this->recipient_id = $request->variable('u', 0);
+ $this->subject = $request->variable('subject', '', true);
+
+ $this->recipient_row = $this->get_user_row($this->recipient_id);
+ }
+
+ /**
+ * {inheritDoc}
+ */
+ public function submit(\messenger $messenger)
+ {
+ if (!$this->subject)
+ {
+ $this->errors[] = $this->user->lang['EMPTY_SUBJECT_EMAIL'];
+ }
+
+ if (!$this->body)
+ {
+ $this->errors[] = $this->user->lang['EMPTY_MESSAGE_EMAIL'];
+ }
+
+ $this->message->set_template('profile_send_email');
+ $this->message->set_subject($this->subject);
+ $this->message->set_body($this->body);
+ $this->message->add_recipient_from_user_row($this->recipient_row);
+
+ parent::submit($messenger);
+ }
+
+ /**
+ * {inheritDoc}
+ */
+ public function render(\phpbb\template\template $template)
+ {
+ parent::render($template);
+
+ $template->assign_vars(array(
+ 'S_SEND_USER' => true,
+ 'S_POST_ACTION' => append_sid($this->phpbb_root_path . 'memberlist.' . $this->phpEx, 'mode=email&amp;u=' . $this->recipient_id),
+
+ 'L_SEND_EMAIL_USER' => $this->user->lang('SEND_EMAIL_USER', $this->recipient_row['username']),
+ 'USERNAME_FULL' => get_username_string('full', $this->recipient_row['user_id'], $this->recipient_row['username'], $this->recipient_row['user_colour']),
+ 'SUBJECT' => $this->subject,
+ 'MESSAGE' => $this->body,
+ ));
+ }
+}
diff --git a/phpBB/phpbb/mimetype/content_guesser.php b/phpBB/phpbb/mimetype/content_guesser.php
new file mode 100644
index 0000000000..f3ad7f5f41
--- /dev/null
+++ b/phpBB/phpbb/mimetype/content_guesser.php
@@ -0,0 +1,33 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\mimetype;
+
+class content_guesser extends guesser_base
+{
+ /**
+ * {@inheritdoc}
+ */
+ public function is_supported()
+ {
+ return function_exists('mime_content_type') && is_callable('mime_content_type');
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function guess($file, $file_name = '')
+ {
+ return mime_content_type($file);
+ }
+}
diff --git a/phpBB/phpbb/mimetype/extension_guesser.php b/phpBB/phpbb/mimetype/extension_guesser.php
new file mode 100644
index 0000000000..9e36c07f91
--- /dev/null
+++ b/phpBB/phpbb/mimetype/extension_guesser.php
@@ -0,0 +1,509 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\mimetype;
+
+class extension_guesser extends guesser_base
+{
+ /**
+ * @var file extension map
+ */
+ protected $extension_map = array(
+ '3dm' => 'x-world/x-3dmf',
+ '3dmf' => 'x-world/x-3dmf',
+ 'a' => 'application/octet-stream',
+ 'aab' => 'application/x-authorware-bin',
+ 'aam' => 'application/x-authorware-map',
+ 'aas' => 'application/x-authorware-seg',
+ 'abc' => 'text/vnd.abc',
+ 'acgi' => 'text/html',
+ 'afl' => 'video/animaflex',
+ 'ai' => 'application/postscript',
+ 'aif' => 'audio/aiff',
+ 'aifc' => 'audio/aiff',
+ 'aiff' => 'audio/aiff',
+ 'aim' => 'application/x-aim',
+ 'aip' => 'text/x-audiosoft-intra',
+ 'ani' => 'application/x-navi-animation',
+ 'aos' => 'application/x-nokia-9000-communicator-add-on-software',
+ 'aps' => 'application/mime',
+ 'arc' => 'application/octet-stream',
+ 'arj' => 'application/arj',
+ 'art' => 'image/x-jg',
+ 'asf' => 'video/x-ms-asf',
+ 'asm' => 'text/x-asm',
+ 'asp' => 'text/asp',
+ 'asx' => 'video/x-ms-asf',
+ 'au' => 'audio/x-au',
+ 'avi' => 'video/avi',
+ 'avs' => 'video/avs-video',
+ 'bcpio' => 'application/x-bcpio',
+ 'bin' => 'application/x-binary',
+ 'bm' => 'image/bmp',
+ 'bmp' => 'image/bmp',
+ 'boo' => 'application/book',
+ 'book' => 'application/book',
+ 'boz' => 'application/x-bzip2',
+ 'bsh' => 'application/x-bsh',
+ 'bz' => 'application/x-bzip',
+ 'bz2' => 'application/x-bzip2',
+ 'c' => 'text/x-c',
+ 'c++' => 'text/x-c',
+ 'cat' => 'application/vnd.ms-pki.seccat',
+ 'cc' => 'text/plain',
+ 'ccad' => 'application/clariscad',
+ 'cco' => 'application/x-cocoa',
+ 'cdf' => 'application/cdf',
+ 'cer' => 'application/x-x509-ca-cert',
+ 'cha' => 'application/x-chat',
+ 'chat' => 'application/x-chat',
+ 'class' => 'application/java',
+ 'com' => 'application/octet-stream',
+ 'conf' => 'text/plain',
+ 'cpio' => 'application/x-cpio',
+ 'cpp' => 'text/x-c',
+ 'cpt' => 'application/x-cpt',
+ 'crl' => 'application/pkix-crl',
+ 'crt' => 'application/x-x509-ca-cert',
+ 'csh' => 'application/x-csh',
+ 'css' => 'text/css',
+ 'cxx' => 'text/plain',
+ 'dcr' => 'application/x-director',
+ 'deepv' => 'application/x-deepv',
+ 'def' => 'text/plain',
+ 'der' => 'application/x-x509-ca-cert',
+ 'dif' => 'video/x-dv',
+ 'dir' => 'application/x-director',
+ 'dl' => 'video/dl',
+ 'doc' => 'application/msword',
+ 'dot' => 'application/msword',
+ 'dp' => 'application/commonground',
+ 'drw' => 'application/drafting',
+ 'dump' => 'application/octet-stream',
+ 'dv' => 'video/x-dv',
+ 'dvi' => 'application/x-dvi',
+ 'dwf' => 'model/vnd.dwf',
+ 'dwg' => 'image/x-dwg',
+ 'dxf' => 'image/x-dwg',
+ 'dxr' => 'application/x-director',
+ 'el' => 'text/x-script.elisp',
+ 'elc' => 'application/x-elc',
+ 'env' => 'application/x-envoy',
+ 'eps' => 'application/postscript',
+ 'es' => 'application/x-esrehber',
+ 'etx' => 'text/x-setext',
+ 'evy' => 'application/x-envoy',
+ 'exe' => 'application/octet-stream',
+ 'f' => 'text/x-fortran',
+ 'f77' => 'text/x-fortran',
+ 'f90' => 'text/x-fortran',
+ 'fdf' => 'application/vnd.fdf',
+ 'fif' => 'image/fif',
+ 'fli' => 'video/x-fli',
+ 'flo' => 'image/florian',
+ 'flx' => 'text/vnd.fmi.flexstor',
+ 'fmf' => 'video/x-atomic3d-feature',
+ 'for' => 'text/x-fortran',
+ 'fpx' => 'image/vnd.fpx',
+ 'frl' => 'application/freeloader',
+ 'funk' => 'audio/make',
+ 'g' => 'text/plain',
+ 'g3' => 'image/g3fax',
+ 'gif' => 'image/gif',
+ 'gl' => 'video/x-gl',
+ 'gsd' => 'audio/x-gsm',
+ 'gsm' => 'audio/x-gsm',
+ 'gsp' => 'application/x-gsp',
+ 'gss' => 'application/x-gss',
+ 'gtar' => 'application/x-gtar',
+ 'gz' => 'application/x-gzip',
+ 'gzip' => 'application/x-gzip',
+ 'h' => 'text/x-h',
+ 'hdf' => 'application/x-hdf',
+ 'help' => 'application/x-helpfile',
+ 'hgl' => 'application/vnd.hp-hpgl',
+ 'hh' => 'text/x-h',
+ 'hlb' => 'text/x-script',
+ 'hlp' => 'application/hlp',
+ 'hpg' => 'application/vnd.hp-hpgl',
+ 'hpgl' => 'application/vnd.hp-hpgl',
+ 'hqx' => 'application/x-binhex40',
+ 'hta' => 'application/hta',
+ 'htc' => 'text/x-component',
+ 'htm' => 'text/html',
+ 'html' => 'text/html',
+ 'htmls' => 'text/html',
+ 'htt' => 'text/webviewhtml',
+ 'htx' => 'text/html',
+ 'ice' => 'x-conference/x-cooltalk',
+ 'ico' => 'image/x-icon',
+ 'idc' => 'text/plain',
+ 'ief' => 'image/ief',
+ 'iefs' => 'image/ief',
+ 'iges' => 'application/iges',
+ 'igs' => 'application/iges',
+ 'ima' => 'application/x-ima',
+ 'imap' => 'application/x-httpd-imap',
+ 'inf' => 'application/inf',
+ 'ins' => 'application/x-internett-signup',
+ 'ip' => 'application/x-ip2',
+ 'isu' => 'video/x-isvideo',
+ 'it' => 'audio/it',
+ 'iv' => 'application/x-inventor',
+ 'ivr' => 'i-world/i-vrml',
+ 'ivy' => 'application/x-livescreen',
+ 'jam' => 'audio/x-jam',
+ 'jav' => 'text/plain',
+ 'jav' => 'text/x-java-source',
+ 'java' => 'text/x-java-source',
+ 'jcm' => 'application/x-java-commerce',
+ 'jfif' => 'image/jpeg',
+ 'jfif-tbnl' => 'image/jpeg',
+ 'jpe' => 'image/jpeg',
+ 'jpeg' => 'image/jpeg',
+ 'jpg' => 'image/jpeg',
+ 'jps' => 'image/x-jps',
+ 'js' => 'application/x-javascript',
+ 'jut' => 'image/jutvision',
+ 'kar' => 'audio/midi',
+ 'ksh' => 'text/x-script.ksh',
+ 'la' => 'audio/x-nspaudio',
+ 'lam' => 'audio/x-liveaudio',
+ 'latex' => 'application/x-latex',
+ 'lha' => 'application/x-lha',
+ 'lhx' => 'application/octet-stream',
+ 'list' => 'text/plain',
+ 'lma' => 'audio/x-nspaudio',
+ 'log' => 'text/plain',
+ 'lsp' => 'text/x-script.lisp',
+ 'lst' => 'text/plain',
+ 'lsx' => 'text/x-la-asf',
+ 'ltx' => 'application/x-latex',
+ 'lzh' => 'application/x-lzh',
+ 'lzx' => 'application/x-lzx',
+ 'm' => 'text/x-m',
+ 'm1v' => 'video/mpeg',
+ 'm2a' => 'audio/mpeg',
+ 'm2v' => 'video/mpeg',
+ 'm3u' => 'audio/x-mpequrl',
+ 'man' => 'application/x-troff-man',
+ 'map' => 'application/x-navimap',
+ 'mar' => 'text/plain',
+ 'mbd' => 'application/mbedlet',
+ 'mc$' => 'application/x-magic-cap-package-1.0',
+ 'mcd' => 'application/x-mathcad',
+ 'mcf' => 'text/mcf',
+ 'mcp' => 'application/netmc',
+ 'me' => 'application/x-troff-me',
+ 'mht' => 'message/rfc822',
+ 'mhtml' => 'message/rfc822',
+ 'mid' => 'audio/x-midi',
+ 'midi' => 'audio/x-midi',
+ 'mif' => 'application/x-mif',
+ 'mime' => 'www/mime',
+ 'mjf' => 'audio/x-vnd.audioexplosion.mjuicemediafile',
+ 'mjpg' => 'video/x-motion-jpeg',
+ 'mm' => 'application/x-meme',
+ 'mme' => 'application/base64',
+ 'mod' => 'audio/x-mod',
+ 'moov' => 'video/quicktime',
+ 'mov' => 'video/quicktime',
+ 'movie' => 'video/x-sgi-movie',
+ 'mp2' => 'audio/x-mpeg',
+ 'mp3' => 'audio/x-mpeg-3',
+ 'mpa' => 'audio/mpeg',
+ 'mpc' => 'application/x-project',
+ 'mpe' => 'video/mpeg',
+ 'mpeg' => 'video/mpeg',
+ 'mpg' => 'video/mpeg',
+ 'mpga' => 'audio/mpeg',
+ 'mpp' => 'application/vnd.ms-project',
+ 'mpt' => 'application/x-project',
+ 'mpv' => 'application/x-project',
+ 'mpx' => 'application/x-project',
+ 'mrc' => 'application/marc',
+ 'ms' => 'application/x-troff-ms',
+ 'mv' => 'video/x-sgi-movie',
+ 'my' => 'audio/make',
+ 'mzz' => 'application/x-vnd.audioexplosion.mzz',
+ 'nap' => 'image/naplps',
+ 'naplps' => 'image/naplps',
+ 'nc' => 'application/x-netcdf',
+ 'ncm' => 'application/vnd.nokia.configuration-message',
+ 'nif' => 'image/x-niff',
+ 'niff' => 'image/x-niff',
+ 'nix' => 'application/x-mix-transfer',
+ 'nsc' => 'application/x-conference',
+ 'nvd' => 'application/x-navidoc',
+ 'o' => 'application/octet-stream',
+ 'oda' => 'application/oda',
+ 'omc' => 'application/x-omc',
+ 'omcd' => 'application/x-omcdatamaker',
+ 'omcr' => 'application/x-omcregerator',
+ 'p' => 'text/x-pascal',
+ 'p10' => 'application/x-pkcs10',
+ 'p12' => 'application/x-pkcs12',
+ 'p7a' => 'application/x-pkcs7-signature',
+ 'p7c' => 'application/x-pkcs7-mime',
+ 'p7m' => 'application/x-pkcs7-mime',
+ 'p7r' => 'application/x-pkcs7-certreqresp',
+ 'p7s' => 'application/pkcs7-signature',
+ 'part' => 'application/pro_eng',
+ 'pas' => 'text/pascal',
+ 'pbm' => 'image/x-portable-bitmap',
+ 'pcl' => 'application/x-pcl',
+ 'pct' => 'image/x-pict',
+ 'pcx' => 'image/x-pcx',
+ 'pdb' => 'chemical/x-pdb',
+ 'pdf' => 'application/pdf',
+ 'pfunk' => 'audio/make.my.funk',
+ 'pgm' => 'image/x-portable-greymap',
+ 'pic' => 'image/pict',
+ 'pict' => 'image/pict',
+ 'pkg' => 'application/x-newton-compatible-pkg',
+ 'pko' => 'application/vnd.ms-pki.pko',
+ 'pl' => 'text/x-script.perl',
+ 'plx' => 'application/x-pixclscript',
+ 'pm' => 'text/x-script.perl-module',
+ 'pm4' => 'application/x-pagemaker',
+ 'pm5' => 'application/x-pagemaker',
+ 'png' => 'image/png',
+ 'pnm' => 'image/x-portable-anymap',
+ 'pot' => 'application/mspowerpoint',
+ 'pov' => 'model/x-pov',
+ 'ppa' => 'application/vnd.ms-powerpoint',
+ 'ppm' => 'image/x-portable-pixmap',
+ 'pps' => 'application/mspowerpoint',
+ 'ppt' => 'application/mspowerpoint',
+ 'ppz' => 'application/mspowerpoint',
+ 'pre' => 'application/x-freelance',
+ 'prt' => 'application/pro_eng',
+ 'ps' => 'application/postscript',
+ 'psd' => 'application/octet-stream',
+ 'pvu' => 'paleovu/x-pv',
+ 'pwz' => 'application/vnd.ms-powerpoint',
+ 'py' => 'text/x-script.phyton',
+ 'pyc' => 'applicaiton/x-bytecode.python',
+ 'qcp' => 'audio/vnd.qcelp',
+ 'qd3' => 'x-world/x-3dmf',
+ 'qd3d' => 'x-world/x-3dmf',
+ 'qif' => 'image/x-quicktime',
+ 'qt' => 'video/quicktime',
+ 'qtc' => 'video/x-qtc',
+ 'qti' => 'image/x-quicktime',
+ 'qtif' => 'image/x-quicktime',
+ 'ra' => 'audio/x-realaudio',
+ 'ram' => 'audio/x-pn-realaudio',
+ 'ras' => 'image/x-cmu-raster',
+ 'rast' => 'image/cmu-raster',
+ 'rexx' => 'text/x-script.rexx',
+ 'rf' => 'image/vnd.rn-realflash',
+ 'rgb' => 'image/x-rgb',
+ 'rm' => 'audio/x-pn-realaudio',
+ 'rmi' => 'audio/mid',
+ 'rmm' => 'audio/x-pn-realaudio',
+ 'rmp' => 'audio/x-pn-realaudio',
+ 'rng' => 'application/vnd.nokia.ringing-tone',
+ 'rnx' => 'application/vnd.rn-realplayer',
+ 'roff' => 'application/x-troff',
+ 'rp' => 'image/vnd.rn-realpix',
+ 'rpm' => 'audio/x-pn-realaudio-plugin',
+ 'rt' => 'text/richtext',
+ 'rtf' => 'text/richtext',
+ 'rtx' => 'text/richtext',
+ 'rv' => 'video/vnd.rn-realvideo',
+ 's' => 'text/x-asm',
+ 's3m' => 'audio/s3m',
+ 'saveme' => 'application/octet-stream',
+ 'sbk' => 'application/x-tbook',
+ 'scm' => 'video/x-scm',
+ 'sdml' => 'text/plain',
+ 'sdp' => 'application/x-sdp',
+ 'sdr' => 'application/sounder',
+ 'sea' => 'application/x-sea',
+ 'set' => 'application/set',
+ 'sgm' => 'text/x-sgml',
+ 'sgml' => 'text/x-sgml',
+ 'sh' => 'text/x-script.sh',
+ 'shar' => 'application/x-shar',
+ 'shtml' => 'text/x-server-parsed-html',
+ 'sid' => 'audio/x-psid',
+ 'sit' => 'application/x-stuffit',
+ 'skd' => 'application/x-koan',
+ 'skm' => 'application/x-koan',
+ 'skp' => 'application/x-koan',
+ 'skt' => 'application/x-koan',
+ 'sl' => 'application/x-seelogo',
+ 'smi' => 'application/smil',
+ 'smil' => 'application/smil',
+ 'snd' => 'audio/x-adpcm',
+ 'sol' => 'application/solids',
+ 'spc' => 'text/x-speech',
+ 'spl' => 'application/futuresplash',
+ 'spr' => 'application/x-sprite',
+ 'sprite' => 'application/x-sprite',
+ 'src' => 'application/x-wais-source',
+ 'ssi' => 'text/x-server-parsed-html',
+ 'ssm' => 'application/streamingmedia',
+ 'sst' => 'application/vnd.ms-pki.certstore',
+ 'step' => 'application/step',
+ 'stl' => 'application/vnd.ms-pki.stl',
+ 'stp' => 'application/step',
+ 'sv4cpio' => 'application/x-sv4cpio',
+ 'sv4crc' => 'application/x-sv4crc',
+ 'svf' => 'image/x-dwg',
+ 'svr' => 'application/x-world',
+ 'swf' => 'application/x-shockwave-flash',
+ 't' => 'application/x-troff',
+ 'talk' => 'text/x-speech',
+ 'tar' => 'application/x-tar',
+ 'tbk' => 'application/x-tbook',
+ 'tcl' => 'text/x-script.tcl',
+ 'tcsh' => 'text/x-script.tcsh',
+ 'tex' => 'application/x-tex',
+ 'texi' => 'application/x-texinfo',
+ 'texinfo' => 'application/x-texinfo',
+ 'text' => 'text/plain',
+ 'tgz' => 'application/x-compressed',
+ 'tif' => 'image/tiff',
+ 'tiff' => 'image/tiff',
+ 'tr' => 'application/x-troff',
+ 'tsi' => 'audio/tsp-audio',
+ 'tsp' => 'audio/tsplayer',
+ 'tsv' => 'text/tab-separated-values',
+ 'turbot' => 'image/florian',
+ 'txt' => 'text/plain',
+ 'uil' => 'text/x-uil',
+ 'uni' => 'text/uri-list',
+ 'unis' => 'text/uri-list',
+ 'unv' => 'application/i-deas',
+ 'uri' => 'text/uri-list',
+ 'uris' => 'text/uri-list',
+ 'ustar' => 'multipart/x-ustar',
+ 'uu' => 'text/x-uuencode',
+ 'uue' => 'text/x-uuencode',
+ 'vcd' => 'application/x-cdlink',
+ 'vcs' => 'text/x-vcalendar',
+ 'vda' => 'application/vda',
+ 'vdo' => 'video/vdo',
+ 'vew' => 'application/groupwise',
+ 'viv' => 'video/vivo',
+ 'vivo' => 'video/vivo',
+ 'vmd' => 'application/vocaltec-media-desc',
+ 'vmf' => 'application/vocaltec-media-file',
+ 'voc' => 'audio/voc',
+ 'vos' => 'video/vosaic',
+ 'vox' => 'audio/voxware',
+ 'vqe' => 'audio/x-twinvq-plugin',
+ 'vqf' => 'audio/x-twinvq',
+ 'vql' => 'audio/x-twinvq-plugin',
+ 'vrml' => 'application/x-vrml',
+ 'vrt' => 'x-world/x-vrt',
+ 'vsd' => 'application/x-visio',
+ 'vst' => 'application/x-visio',
+ 'vsw' => 'application/x-visio',
+ 'w60' => 'application/wordperfect6.0',
+ 'w61' => 'application/wordperfect6.1',
+ 'w6w' => 'application/msword',
+ 'wav' => 'audio/wav',
+ 'wb1' => 'application/x-qpro',
+ 'wbmp' => 'image/vnd.wap.wbmp',
+ 'web' => 'application/vnd.xara',
+ 'wiz' => 'application/msword',
+ 'wk1' => 'application/x-123',
+ 'wmf' => 'windows/metafile',
+ 'wml' => 'text/vnd.wap.wml',
+ 'wmlc' => 'application/vnd.wap.wmlc',
+ 'wmls' => 'text/vnd.wap.wmlscript',
+ 'wmlsc' => 'application/vnd.wap.wmlscriptc',
+ 'word' => 'application/msword',
+ 'wp' => 'application/wordperfect',
+ 'wp5' => 'application/wordperfect',
+ 'wp6' => 'application/wordperfect',
+ 'wpd' => 'application/wordperfect',
+ 'wq1' => 'application/x-lotus',
+ 'wri' => 'application/mswrite',
+ 'wrl' => 'model/vrml',
+ 'wrz' => 'model/vrml',
+ 'wsc' => 'text/scriplet',
+ 'wsrc' => 'application/x-wais-source',
+ 'wtk' => 'application/x-wintalk',
+ 'xbm' => 'image/xbm',
+ 'xdr' => 'video/x-amt-demorun',
+ 'xgz' => 'xgl/drawing',
+ 'xif' => 'image/vnd.xiff',
+ 'xl' => 'application/excel',
+ 'xla' => 'application/excel',
+ 'xlb' => 'application/excel',
+ 'xlc' => 'application/excel',
+ 'xld' => 'application/excel',
+ 'xlk' => 'application/excel',
+ 'xll' => 'application/excel',
+ 'xlm' => 'application/excel',
+ 'xls' => 'application/excel',
+ 'xlt' => 'application/excel',
+ 'xlv' => 'application/excel',
+ 'xlw' => 'application/excel',
+ 'xm' => 'audio/xm',
+ 'xml' => 'text/xml',
+ 'xmz' => 'xgl/movie',
+ 'xpix' => 'application/x-vnd.ls-xpix',
+ 'xpm' => 'image/xpm',
+ 'x-png' => 'image/png',
+ 'xsr' => 'video/x-amt-showrun',
+ 'xwd' => 'image/x-xwindowdump',
+ 'xyz' => 'chemical/x-pdb',
+ 'z' => 'application/x-compressed',
+ 'zip' => 'application/x-zip-compressed',
+ 'zoo' => 'application/octet-stream',
+ 'zsh' => 'text/x-script.zsh',
+ );
+
+ /**
+ * {@inheritdoc}
+ */
+ public function is_supported()
+ {
+ return true;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function guess($file, $file_name = '')
+ {
+ $file_name = (empty($file_name)) ? $file : $file_name;
+ return $this->map_extension_to_type($file_name);
+ }
+
+ /**
+ * Map extension of supplied file_name to mime type
+ *
+ * @param string $file_name Path to file or filename
+ *
+ * @return string|null Mimetype if known or null if not
+ */
+ protected function map_extension_to_type($file_name)
+ {
+ $extension = pathinfo($file_name, PATHINFO_EXTENSION);
+
+ if (isset($this->extension_map[$extension]))
+ {
+ return $this->extension_map[$extension];
+ }
+ else
+ {
+ return null;
+ }
+ }
+}
diff --git a/phpBB/phpbb/mimetype/guesser.php b/phpBB/phpbb/mimetype/guesser.php
new file mode 100644
index 0000000000..8baa77089b
--- /dev/null
+++ b/phpBB/phpbb/mimetype/guesser.php
@@ -0,0 +1,156 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\mimetype;
+
+class guesser
+{
+ /**
+ * @const Default priority for mimetype guessers
+ */
+ const PRIORITY_DEFAULT = 0;
+
+ /**
+ * @var array guessers
+ */
+ protected $guessers;
+
+ /**
+ * Construct a mimetype guesser object
+ *
+ * @param array $mimetype_guessers Mimetype guesser service collection
+ */
+ public function __construct($mimetype_guessers)
+ {
+ $this->register_guessers($mimetype_guessers);
+ }
+
+ /**
+ * Register MimeTypeGuessers and sort them by priority
+ *
+ * @param array $mimetype_guessers Mimetype guesser service collection
+ *
+ * @throws \LogicException If incorrect or not mimetype guessers have
+ * been supplied to class
+ */
+ protected function register_guessers($mimetype_guessers)
+ {
+ foreach ($mimetype_guessers as $guesser)
+ {
+ $is_supported = (method_exists($guesser, 'is_supported')) ? 'is_supported' : '';
+ $is_supported = (method_exists($guesser, 'isSupported')) ? 'isSupported' : $is_supported;
+
+ if (empty($is_supported))
+ {
+ throw new \LogicException('Incorrect mimetype guesser supplied.');
+ }
+
+ if ($guesser->$is_supported())
+ {
+ $this->guessers[] = $guesser;
+ }
+ }
+
+ if (empty($this->guessers))
+ {
+ throw new \LogicException('No mimetype guesser supplied.');
+ }
+
+ // Sort guessers by priority
+ usort($this->guessers, array($this, 'sort_priority'));
+ }
+
+ /**
+ * Sort the priority of supplied guessers
+ * This is a compare function for usort. A guesser with higher priority
+ * should be used first and vice versa. usort() orders the array values
+ * from low to high depending on what the comparison function returns
+ * to it. Return value should be smaller than 0 if value a is smaller
+ * than value b. This has been reversed in the comparision function in
+ * order to sort the guessers from high to low.
+ * Method has been set to public in order to allow proper testing.
+ *
+ * @param object $guesser_a Mimetype guesser a
+ * @param object $guesser_b Mimetype guesser b
+ *
+ * @return int If both guessers have the same priority 0, bigger
+ * than 0 if first guesser has lower priority, and lower
+ * than 0 if first guesser has higher priority
+ */
+ public function sort_priority($guesser_a, $guesser_b)
+ {
+ $priority_a = (int) (method_exists($guesser_a, 'get_priority')) ? $guesser_a->get_priority() : self::PRIORITY_DEFAULT;
+ $priority_b = (int) (method_exists($guesser_b, 'get_priority')) ? $guesser_b->get_priority() : self::PRIORITY_DEFAULT;
+
+ return $priority_b - $priority_a;
+ }
+
+ /**
+ * Guess mimetype of supplied file
+ *
+ * @param string $file Path to file
+ * @param string $file_name The real file name
+ *
+ * @return string Guess for mimetype of file
+ */
+ public function guess($file, $file_name = '')
+ {
+ if (!is_file($file))
+ {
+ return false;
+ }
+
+ if (!is_readable($file))
+ {
+ return false;
+ }
+
+ $mimetype = 'application/octet-stream';
+
+ foreach ($this->guessers as $guesser)
+ {
+ $mimetype_guess = $guesser->guess($file, $file_name);
+
+ $mimetype = $this->choose_mime_type($mimetype, $mimetype_guess);
+ }
+ // Return any mimetype if we got a result or the fallback value
+ return $mimetype;
+ }
+
+ /**
+ * Choose the best mime type based on the current mime type and the guess
+ * If a guesser returns nulls or application/octet-stream, we will keep
+ * the current guess. Guesses with a slash inside them will be favored over
+ * already existing ones. However, any guess that will pass the first check
+ * will always overwrite the default application/octet-stream.
+ *
+ * @param string $mime_type The current mime type
+ * @param string $guess The current mime type guess
+ *
+ * @return string The best mime type based on current mime type and guess
+ */
+ public function choose_mime_type($mime_type, $guess)
+ {
+ if ($guess === null || $guess == 'application/octet-stream')
+ {
+ return $mime_type;
+ }
+
+ if ($mime_type == 'application/octet-stream' || strpos($guess, '/') !== false)
+ {
+ $mime_type = $guess;
+ }
+
+ return $mime_type;
+ }
+}
diff --git a/phpBB/phpbb/mimetype/guesser_base.php b/phpBB/phpbb/mimetype/guesser_base.php
new file mode 100644
index 0000000000..225dfd57dc
--- /dev/null
+++ b/phpBB/phpbb/mimetype/guesser_base.php
@@ -0,0 +1,38 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\mimetype;
+
+abstract class guesser_base implements guesser_interface
+{
+ /**
+ * @var int Guesser Priority
+ */
+ protected $priority;
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_priority()
+ {
+ return $this->priority;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function set_priority($priority)
+ {
+ $this->priority = $priority;
+ }
+}
diff --git a/phpBB/phpbb/mimetype/guesser_interface.php b/phpBB/phpbb/mimetype/guesser_interface.php
new file mode 100644
index 0000000000..a4005287e4
--- /dev/null
+++ b/phpBB/phpbb/mimetype/guesser_interface.php
@@ -0,0 +1,50 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\mimetype;
+
+interface guesser_interface
+{
+ /**
+ * Returns whether this guesser is supported on the current OS
+ *
+ * @return bool True if guesser is supported, false if not
+ */
+ public function is_supported();
+
+ /**
+ * Guess mimetype of supplied file
+ *
+ * @param string $file Path to file
+ * @param string $file_name The real file name
+ *
+ * @return string Guess for mimetype of file
+ */
+ public function guess($file, $file_name = '');
+
+ /**
+ * Get the guesser priority
+ *
+ * @return int Guesser priority
+ */
+ public function get_priority();
+
+ /**
+ * Set the guesser priority
+ *
+ * @param int Guesser priority
+ *
+ * @return void
+ */
+ public function set_priority($priority);
+}
diff --git a/phpBB/phpbb/notification/exception.php b/phpBB/phpbb/notification/exception.php
new file mode 100644
index 0000000000..83c4526df7
--- /dev/null
+++ b/phpBB/phpbb/notification/exception.php
@@ -0,0 +1,26 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\notification;
+
+/**
+* Notifications exception
+*/
+
+class exception extends \Exception
+{
+ public function __toString()
+ {
+ return $this->getMessage();
+ }
+}
diff --git a/phpBB/phpbb/notification/manager.php b/phpBB/phpbb/notification/manager.php
new file mode 100644
index 0000000000..f5663f4b34
--- /dev/null
+++ b/phpBB/phpbb/notification/manager.php
@@ -0,0 +1,990 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\notification;
+
+use Symfony\Component\DependencyInjection\ContainerInterface;
+
+/**
+* Notifications service class
+*/
+class manager
+{
+ /** @var array */
+ protected $notification_types;
+
+ /** @var array */
+ protected $subscription_types;
+
+ /** @var array */
+ protected $notification_methods;
+
+ /** @var ContainerInterface */
+ protected $phpbb_container;
+
+ /** @var \phpbb\user_loader */
+ protected $user_loader;
+
+ /** @var \phpbb\config\config */
+ protected $config;
+
+ /** @var \phpbb\event\dispatcher_interface */
+ protected $phpbb_dispatcher;
+
+ /** @var \phpbb\db\driver\driver_interface */
+ protected $db;
+
+ /** @var \phpbb\cache\service */
+ protected $cache;
+
+ /** @var \phpbb\user */
+ protected $user;
+
+ /** @var string */
+ protected $phpbb_root_path;
+
+ /** @var string */
+ protected $php_ext;
+
+ /** @var string */
+ protected $notification_types_table;
+
+ /** @var string */
+ protected $notifications_table;
+
+ /** @var string */
+ protected $user_notifications_table;
+
+ /**
+ * Notification Constructor
+ *
+ * @param array $notification_types
+ * @param array $notification_methods
+ * @param ContainerInterface $phpbb_container
+ * @param \phpbb\user_loader $user_loader
+ * @param \phpbb\config\config $config
+ * @param \phpbb\event\dispatcher_interface $phpbb_dispatcher
+ * @param \phpbb\db\driver\driver_interface $db
+ * @param \phpbb\cache\service $cache
+ * @param \phpbb\user $user
+ * @param string $phpbb_root_path
+ * @param string $php_ext
+ * @param string $notification_types_table
+ * @param string $notifications_table
+ * @param string $user_notifications_table
+ *
+ * @return \phpbb\notification\manager
+ */
+ public function __construct($notification_types, $notification_methods, ContainerInterface $phpbb_container, \phpbb\user_loader $user_loader, \phpbb\config\config $config, \phpbb\event\dispatcher_interface $phpbb_dispatcher, \phpbb\db\driver\driver_interface $db, \phpbb\cache\service $cache, $user, $phpbb_root_path, $php_ext, $notification_types_table, $notifications_table, $user_notifications_table)
+ {
+ $this->notification_types = $notification_types;
+ $this->notification_methods = $notification_methods;
+ $this->phpbb_container = $phpbb_container;
+
+ $this->user_loader = $user_loader;
+ $this->config = $config;
+ $this->phpbb_dispatcher = $phpbb_dispatcher;
+ $this->db = $db;
+ $this->cache = $cache;
+ $this->user = $user;
+
+ $this->phpbb_root_path = $phpbb_root_path;
+ $this->php_ext = $php_ext;
+
+ $this->notification_types_table = $notification_types_table;
+ $this->notifications_table = $notifications_table;
+ $this->user_notifications_table = $user_notifications_table;
+ }
+
+ /**
+ * Load the user's notifications
+ *
+ * @param array $options Optional options to control what notifications are loaded
+ * notification_id Notification id to load (or array of notification ids)
+ * user_id User id to load notifications for (Default: $user->data['user_id'])
+ * order_by Order by (Default: notification_time)
+ * order_dir Order direction (Default: DESC)
+ * limit Number of notifications to load (Default: 5)
+ * start Notifications offset (Default: 0)
+ * all_unread Load all unread notifications? If set to true, count_unread is set to true (Default: false)
+ * count_unread Count all unread notifications? (Default: false)
+ * count_total Count all notifications? (Default: false)
+ * @return array Array of information based on the request with keys:
+ * 'notifications' array of notification type objects
+ * 'unread_count' number of unread notifications the user has if count_unread is true in the options
+ * 'total_count' number of notifications the user has if count_total is true in the options
+ */
+ public function load_notifications(array $options = array())
+ {
+ // Merge default options
+ $options = array_merge(array(
+ 'notification_id' => false,
+ 'user_id' => $this->user->data['user_id'],
+ 'order_by' => 'notification_time',
+ 'order_dir' => 'DESC',
+ 'limit' => 0,
+ 'start' => 0,
+ 'all_unread' => false,
+ 'count_unread' => false,
+ 'count_total' => false,
+ ), $options);
+
+ // If all_unread, count_unread must be true
+ $options['count_unread'] = ($options['all_unread']) ? true : $options['count_unread'];
+
+ // Anonymous users and bots never receive notifications
+ if ($options['user_id'] == $this->user->data['user_id'] && ($this->user->data['user_id'] == ANONYMOUS || $this->user->data['user_type'] == USER_IGNORE))
+ {
+ return array(
+ 'notifications' => array(),
+ 'unread_count' => 0,
+ 'total_count' => 0,
+ );
+ }
+
+ $notifications = $user_ids = array();
+ $load_special = array();
+ $total_count = $unread_count = 0;
+
+ if ($options['count_unread'])
+ {
+ // Get the total number of unread notifications
+ $sql = 'SELECT COUNT(n.notification_id) AS unread_count
+ FROM ' . $this->notifications_table . ' n, ' . $this->notification_types_table . ' nt
+ WHERE n.user_id = ' . (int) $options['user_id'] . '
+ AND n.notification_read = 0
+ AND nt.notification_type_id = n.notification_type_id
+ AND nt.notification_type_enabled = 1';
+ $result = $this->db->sql_query($sql);
+ $unread_count = (int) $this->db->sql_fetchfield('unread_count');
+ $this->db->sql_freeresult($result);
+ }
+
+ if ($options['count_total'])
+ {
+ // Get the total number of notifications
+ $sql = 'SELECT COUNT(n.notification_id) AS total_count
+ FROM ' . $this->notifications_table . ' n, ' . $this->notification_types_table . ' nt
+ WHERE n.user_id = ' . (int) $options['user_id'] . '
+ AND nt.notification_type_id = n.notification_type_id
+ AND nt.notification_type_enabled = 1';
+ $result = $this->db->sql_query($sql);
+ $total_count = (int) $this->db->sql_fetchfield('total_count');
+ $this->db->sql_freeresult($result);
+ }
+
+ if (!$options['count_total'] || $total_count)
+ {
+ $rowset = array();
+ $selected_unread_count = 0;
+
+ // Get the main notifications
+ $sql = 'SELECT n.*, nt.notification_type_name
+ FROM ' . $this->notifications_table . ' n, ' . $this->notification_types_table . ' nt
+ WHERE n.user_id = ' . (int) $options['user_id'] .
+ (($options['notification_id']) ? ' AND ' . $this->db->sql_in_set('n.notification_id', $options['notification_id']) : '') . '
+ AND nt.notification_type_id = n.notification_type_id
+ AND nt.notification_type_enabled = 1
+ ORDER BY n.' . $this->db->sql_escape($options['order_by']) . ' ' . $this->db->sql_escape($options['order_dir']);
+ $result = $this->db->sql_query_limit($sql, $options['limit'], $options['start']);
+
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $rowset[$row['notification_id']] = $row;
+ $selected_unread_count += (int) !$row['notification_read'];
+ }
+ $this->db->sql_freeresult($result);
+
+ // Get all unread notifications
+ if ($selected_unread_count < $unread_count && $options['all_unread'] && !empty($rowset))
+ {
+ $sql = 'SELECT n.*, nt.notification_type_name
+ FROM ' . $this->notifications_table . ' n, ' . $this->notification_types_table . ' nt
+ WHERE n.user_id = ' . (int) $options['user_id'] . '
+ AND n.notification_read = 0
+ AND ' . $this->db->sql_in_set('n.notification_id', array_keys($rowset), true) . '
+ AND nt.notification_type_id = n.notification_type_id
+ AND nt.notification_type_enabled = 1
+ ORDER BY n.' . $this->db->sql_escape($options['order_by']) . ' ' . $this->db->sql_escape($options['order_dir']);
+ $result = $this->db->sql_query_limit($sql, $options['limit'], $options['start']);
+
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $rowset[$row['notification_id']] = $row;
+ }
+ $this->db->sql_freeresult($result);
+ }
+
+ foreach ($rowset as $row)
+ {
+ $notification = $this->get_item_type_class($row['notification_type_name'], $row);
+
+ // Array of user_ids to query all at once
+ $user_ids = array_merge($user_ids, $notification->users_to_query());
+
+ // Some notification types also require querying additional tables themselves
+ if (!isset($load_special[$row['notification_type_name']]))
+ {
+ $load_special[$row['notification_type_name']] = array();
+ }
+ $load_special[$row['notification_type_name']] = array_merge($load_special[$row['notification_type_name']], $notification->get_load_special());
+
+ $notifications[$row['notification_id']] = $notification;
+ }
+
+ $this->user_loader->load_users($user_ids);
+
+ // Allow each type to load its own special items
+ foreach ($load_special as $item_type => $data)
+ {
+ $item_class = $this->get_item_type_class($item_type);
+
+ $item_class->load_special($data, $notifications);
+ }
+ }
+
+ return array(
+ 'notifications' => $notifications,
+ 'unread_count' => $unread_count,
+ 'total_count' => $total_count,
+ );
+ }
+
+ /**
+ * Mark notifications read
+ *
+ * @param bool|string|array $notification_type_name Type identifier or array of item types (only acceptable if the $data is identical for the specified types). False to mark read for all item types
+ * @param bool|int|array $item_id Item id or array of item ids. False to mark read for all item ids
+ * @param bool|int|array $user_id User id or array of user ids. False to mark read for all user ids
+ * @param bool|int $time Time at which to mark all notifications prior to as read. False to mark all as read. (Default: False)
+ */
+ public function mark_notifications_read($notification_type_name, $item_id, $user_id, $time = false)
+ {
+ $time = ($time !== false) ? $time : time();
+
+ $sql = 'UPDATE ' . $this->notifications_table . "
+ SET notification_read = 1
+ WHERE notification_time <= " . (int) $time .
+ (($notification_type_name !== false) ? ' AND ' . $this->db->sql_in_set('notification_type_id', $this->get_notification_type_ids($notification_type_name)) : '') .
+ (($user_id !== false) ? ' AND ' . $this->db->sql_in_set('user_id', $user_id) : '') .
+ (($item_id !== false) ? ' AND ' . $this->db->sql_in_set('item_id', $item_id) : '');
+ $this->db->sql_query($sql);
+ }
+
+ /**
+ * Mark notifications read from a parent identifier
+ *
+ * @param string|array $notification_type_name Type identifier or array of item types (only acceptable if the $data is identical for the specified types)
+ * @param bool|int|array $item_parent_id Item parent id or array of item parent ids. False to mark read for all item parent ids
+ * @param bool|int|array $user_id User id or array of user ids. False to mark read for all user ids
+ * @param bool|int $time Time at which to mark all notifications prior to as read. False to mark all as read. (Default: False)
+ */
+ public function mark_notifications_read_by_parent($notification_type_name, $item_parent_id, $user_id, $time = false)
+ {
+ $time = ($time !== false) ? $time : time();
+
+ $sql = 'UPDATE ' . $this->notifications_table . "
+ SET notification_read = 1
+ WHERE notification_time <= " . (int) $time .
+ (($notification_type_name !== false) ? ' AND ' . $this->db->sql_in_set('notification_type_id', $this->get_notification_type_ids($notification_type_name)) : '') .
+ (($item_parent_id !== false) ? ' AND ' . $this->db->sql_in_set('item_parent_id', $item_parent_id, false, true) : '') .
+ (($user_id !== false) ? ' AND ' . $this->db->sql_in_set('user_id', $user_id) : '');
+ $this->db->sql_query($sql);
+ }
+
+ /**
+ * Mark notifications read
+ *
+ * @param int|array $notification_id Notification id or array of notification ids.
+ * @param bool|int $time Time at which to mark all notifications prior to as read. False to mark all as read. (Default: False)
+ */
+ public function mark_notifications_read_by_id($notification_id, $time = false)
+ {
+ $time = ($time !== false) ? $time : time();
+
+ $sql = 'UPDATE ' . $this->notifications_table . "
+ SET notification_read = 1
+ WHERE notification_time <= " . (int) $time . '
+ AND ' . $this->db->sql_in_set('notification_id', $notification_id);
+ $this->db->sql_query($sql);
+ }
+
+ /**
+ * Add a notification
+ *
+ * @param string|array $notification_type_name Type identifier or array of item types (only acceptable if the $data is identical for the specified types)
+ * Note: If you send an array of types, any user who could receive multiple notifications from this single item will only receive
+ * a single notification. If they MUST receive multiple notifications, call this function multiple times instead of sending an array
+ * @param array $data Data specific for this type that will be inserted
+ * @param array $options Optional options to control what notifications are loaded
+ * ignore_users array of data to specify which users should not receive certain types of notifications
+ * @return array Information about what users were notified and how they were notified
+ */
+ public function add_notifications($notification_type_name, $data, array $options = array())
+ {
+ $options = array_merge(array(
+ 'ignore_users' => array(),
+ ), $options);
+
+ if (is_array($notification_type_name))
+ {
+ $notified_users = array();
+ $temp_options = $options;
+
+ foreach ($notification_type_name as $type)
+ {
+ $temp_options['ignore_users'] = $options['ignore_users'] + $notified_users;
+ $notified_users += $this->add_notifications($type, $data, $temp_options);
+ }
+
+ return $notified_users;
+ }
+
+ $item_id = $this->get_item_type_class($notification_type_name)->get_item_id($data);
+
+ // find out which users want to receive this type of notification
+ $notify_users = $this->get_item_type_class($notification_type_name)->find_users_for_notification($data, $options);
+
+ /**
+ * Allow filtering the notify_users array for a notification that is about to be sent.
+ * Here, $notify_users is already filtered by f_read and the ignored list included in the options variable
+ *
+ * @event core.notification_manager_add_notifications
+ * @var string notification_type_name The forum id from where the topic belongs
+ * @var array data Data specific for the notification_type_name used will be inserted
+ * @var array notify_users The array of userid that are going to be notified for this notification. Set to array() to cancel.
+ * @var array options The options that were used when this method was called (read only)
+ *
+ * @since 3.1.3-RC1
+ */
+ $vars = array(
+ 'notification_type_name',
+ 'data',
+ 'notify_users',
+ 'options',
+ );
+ extract($this->phpbb_dispatcher->trigger_event('core.notification_manager_add_notifications', compact($vars)));
+
+ $this->add_notifications_for_users($notification_type_name, $data, $notify_users);
+
+ return $notify_users;
+ }
+
+ /**
+ * Add a notification for specific users
+ *
+ * @param string|array $notification_type_name Type identifier or array of item types (only acceptable if the $data is identical for the specified types)
+ * @param array $data Data specific for this type that will be inserted
+ * @param array $notify_users User list to notify
+ */
+ public function add_notifications_for_users($notification_type_name, $data, $notify_users)
+ {
+ if (is_array($notification_type_name))
+ {
+ foreach ($notification_type_name as $type)
+ {
+ $this->add_notifications_for_users($type, $data, $notify_users);
+ }
+
+ return;
+ }
+
+ $notification_type_id = $this->get_notification_type_id($notification_type_name);
+
+ $item_id = $this->get_item_type_class($notification_type_name)->get_item_id($data);
+
+ $user_ids = array();
+ $notification_objects = $notification_methods = array();
+
+ // Never send notifications to the anonymous user!
+ unset($notify_users[ANONYMOUS]);
+
+ // Make sure not to send new notifications to users who've already been notified about this item
+ // This may happen when an item was added, but now new users are able to see the item
+ $sql = 'SELECT n.user_id
+ FROM ' . $this->notifications_table . ' n, ' . $this->notification_types_table . ' nt
+ WHERE n.notification_type_id = ' . (int) $notification_type_id . '
+ AND n.item_id = ' . (int) $item_id . '
+ AND nt.notification_type_id = n.notification_type_id
+ AND nt.notification_type_enabled = 1';
+ $result = $this->db->sql_query($sql);
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ unset($notify_users[$row['user_id']]);
+ }
+ $this->db->sql_freeresult($result);
+
+ if (!sizeof($notify_users))
+ {
+ return;
+ }
+
+ // Allow notifications to perform actions before creating the insert array (such as run a query to cache some data needed for all notifications)
+ $notification = $this->get_item_type_class($notification_type_name);
+ $pre_create_data = $notification->pre_create_insert_array($data, $notify_users);
+ unset($notification);
+
+ $insert_buffer = new \phpbb\db\sql_insert_buffer($this->db, $this->notifications_table);
+
+ // Go through each user so we can insert a row in the DB and then notify them by their desired means
+ foreach ($notify_users as $user => $methods)
+ {
+ $notification = $this->get_item_type_class($notification_type_name);
+
+ $notification->user_id = (int) $user;
+
+ // Insert notification row using buffer.
+ $insert_buffer->insert($notification->create_insert_array($data, $pre_create_data));
+
+ // Users are needed to send notifications
+ $user_ids = array_merge($user_ids, $notification->users_to_query());
+
+ foreach ($methods as $method)
+ {
+ // setup the notification methods and add the notification to the queue
+ if ($method) // blank means we just insert it as a notification, but do not notify them by any other means
+ {
+ if (!isset($notification_methods[$method]))
+ {
+ $notification_methods[$method] = $this->get_method_class($method);
+ }
+
+ $notification_methods[$method]->add_to_queue($notification);
+ }
+ }
+ }
+
+ $insert_buffer->flush();
+
+ // We need to load all of the users to send notifications
+ $this->user_loader->load_users($user_ids);
+
+ // run the queue for each method to send notifications
+ foreach ($notification_methods as $method)
+ {
+ $method->notify();
+ }
+ }
+
+ /**
+ * Update a notification
+ *
+ * @param string|array $notification_type_name Type identifier or array of item types (only acceptable if the $data is identical for the specified types)
+ * @param array $data Data specific for this type that will be updated
+ */
+ public function update_notifications($notification_type_name, $data)
+ {
+ if (is_array($notification_type_name))
+ {
+ foreach ($notification_type_name as $type)
+ {
+ $this->update_notifications($type, $data);
+ }
+
+ return;
+ }
+
+ $notification = $this->get_item_type_class($notification_type_name);
+
+ // Allow the notifications class to over-ride the update_notifications functionality
+ if (method_exists($notification, 'update_notifications'))
+ {
+ // Return False to over-ride the rest of the update
+ if ($notification->update_notifications($data) === false)
+ {
+ return;
+ }
+ }
+
+ $notification_type_id = $this->get_notification_type_id($notification_type_name);
+ $item_id = $notification->get_item_id($data);
+ $update_array = $notification->create_update_array($data);
+
+ $sql = 'UPDATE ' . $this->notifications_table . '
+ SET ' . $this->db->sql_build_array('UPDATE', $update_array) . '
+ WHERE notification_type_id = ' . (int) $notification_type_id . '
+ AND item_id = ' . (int) $item_id;
+ $this->db->sql_query($sql);
+ }
+
+ /**
+ * Delete a notification
+ *
+ * @param string|array $notification_type_name Type identifier or array of item types (only acceptable if the $item_id is identical for the specified types)
+ * @param int|array $item_id Identifier within the type (or array of ids)
+ * @param mixed $parent_id Parent identifier within the type (or array of ids), used in combination with item_id if specified (Default: false; not checked)
+ */
+ public function delete_notifications($notification_type_name, $item_id, $parent_id = false)
+ {
+ if (is_array($notification_type_name))
+ {
+ foreach ($notification_type_name as $type)
+ {
+ $this->delete_notifications($type, $item_id, $parent_id);
+ }
+
+ return;
+ }
+
+ $notification_type_id = $this->get_notification_type_id($notification_type_name);
+
+ $sql = 'DELETE FROM ' . $this->notifications_table . '
+ WHERE notification_type_id = ' . (int) $notification_type_id . '
+ AND ' . $this->db->sql_in_set('item_id', $item_id) .
+ (($parent_id !== false) ? ' AND ' . $this->db->sql_in_set('item_parent_id', $parent_id) : '');
+ $this->db->sql_query($sql);
+ }
+
+ /**
+ * Get all of the subscription types
+ *
+ * @return array Array of item types
+ */
+ public function get_subscription_types()
+ {
+ if ($this->subscription_types === null)
+ {
+ $this->subscription_types = array();
+
+ foreach ($this->notification_types as $type_name => $data)
+ {
+ $type = $this->get_item_type_class($type_name);
+
+ if ($type instanceof \phpbb\notification\type\type_interface && $type->is_available())
+ {
+ $options = array_merge(array(
+ 'id' => $type->get_type(),
+ 'lang' => 'NOTIFICATION_TYPE_' . strtoupper($type->get_type()),
+ 'group' => 'NOTIFICATION_GROUP_MISCELLANEOUS',
+ ), (($type::$notification_option !== false) ? $type::$notification_option : array()));
+
+ $this->subscription_types[$options['group']][$options['id']] = $options;
+ }
+ }
+
+ // Move Miscellaneous to the very last section
+ if (isset($this->subscription_types['NOTIFICATION_GROUP_MISCELLANEOUS']))
+ {
+ $miscellaneous = $this->subscription_types['NOTIFICATION_GROUP_MISCELLANEOUS'];
+ unset($this->subscription_types['NOTIFICATION_GROUP_MISCELLANEOUS']);
+ $this->subscription_types['NOTIFICATION_GROUP_MISCELLANEOUS'] = $miscellaneous;
+ }
+ }
+
+ return $this->subscription_types;
+ }
+
+ /**
+ * Get all of the subscription methods
+ *
+ * @return array Array of methods
+ */
+ public function get_subscription_methods()
+ {
+ $subscription_methods = array();
+
+ foreach ($this->notification_methods as $method_name => $data)
+ {
+ $method = $this->get_method_class($method_name);
+
+ if ($method instanceof \phpbb\notification\method\method_interface && $method->is_available())
+ {
+ $subscription_methods[$method_name] = array(
+ 'id' => $method->get_type(),
+ 'lang' => str_replace('.', '_', strtoupper($method->get_type())),
+ );
+ }
+ }
+
+ return $subscription_methods;
+ }
+
+
+ /**
+ * Get user's notification data
+ *
+ * @param int $user_id The user_id of the user to get the notifications for
+ *
+ * @return array User's notification
+ */
+ protected function get_user_notifications($user_id)
+ {
+ $sql = 'SELECT method, notify, item_type
+ FROM ' . $this->user_notifications_table . '
+ WHERE user_id = ' . (int) $user_id . '
+ AND item_id = 0';
+
+ $result = $this->db->sql_query($sql);
+ $user_notifications = array();
+
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $user_notifications[$row['item_type']][] = $row;
+ }
+
+ $this->db->sql_freeresult($result);
+
+ return $user_notifications;
+ }
+
+ /**
+ * Get global subscriptions (item_id = 0)
+ *
+ * @param bool|int $user_id The user_id to add the subscription for (bool false for current user)
+ *
+ * @return array Subscriptions
+ */
+ public function get_global_subscriptions($user_id = false)
+ {
+ $user_id = ($user_id === false) ? $this->user->data['user_id'] : $user_id;
+
+ $subscriptions = array();
+
+ $user_notifications = $this->get_user_notifications($user_id);
+
+ foreach ($this->get_subscription_types() as $types)
+ {
+ foreach ($types as $id => $type)
+ {
+
+ if (empty($user_notifications[$id]))
+ {
+ // No rows at all, default to ''
+ $subscriptions[$id] = array('');
+ }
+ else
+ {
+ foreach ($user_notifications[$id] as $user_notification)
+ {
+ if (!$user_notification['notify'])
+ {
+ continue;
+ }
+
+ if (!isset($subscriptions[$id]))
+ {
+ $subscriptions[$id] = array();
+ }
+
+ $subscriptions[$id][] = $user_notification['method'];
+ }
+ }
+ }
+ }
+
+ return $subscriptions;
+ }
+
+ /**
+ * Add a subscription
+ *
+ * @param string $item_type Type identifier of the subscription
+ * @param int $item_id The id of the item
+ * @param string $method The method of the notification e.g. '', 'email', or 'jabber'
+ * @param bool|int $user_id The user_id to add the subscription for (bool false for current user)
+ */
+ public function add_subscription($item_type, $item_id = 0, $method = '', $user_id = false)
+ {
+ if ($method !== '')
+ {
+ // Make sure to subscribe them to the base subscription
+ $this->add_subscription($item_type, $item_id, '', $user_id);
+ }
+
+ $user_id = ($user_id === false) ? $this->user->data['user_id'] : $user_id;
+
+ $sql = 'SELECT notify
+ FROM ' . $this->user_notifications_table . "
+ WHERE item_type = '" . $this->db->sql_escape($item_type) . "'
+ AND item_id = " . (int) $item_id . '
+ AND user_id = ' .(int) $user_id . "
+ AND method = '" . $this->db->sql_escape($method) . "'";
+ $this->db->sql_query($sql);
+ $current = $this->db->sql_fetchfield('notify');
+ $this->db->sql_freeresult();
+
+ if ($current === false)
+ {
+ $sql = 'INSERT INTO ' . $this->user_notifications_table . ' ' .
+ $this->db->sql_build_array('INSERT', array(
+ 'item_type' => $item_type,
+ 'item_id' => (int) $item_id,
+ 'user_id' => (int) $user_id,
+ 'method' => $method,
+ 'notify' => 1,
+ ));
+ $this->db->sql_query($sql);
+ }
+ else if (!$current)
+ {
+ $sql = 'UPDATE ' . $this->user_notifications_table . "
+ SET notify = 1
+ WHERE item_type = '" . $this->db->sql_escape($item_type) . "'
+ AND item_id = " . (int) $item_id . '
+ AND user_id = ' .(int) $user_id . "
+ AND method = '" . $this->db->sql_escape($method) . "'";
+ $this->db->sql_query($sql);
+ }
+ }
+
+ /**
+ * Delete a subscription
+ *
+ * @param string $item_type Type identifier of the subscription
+ * @param int $item_id The id of the item
+ * @param string $method The method of the notification e.g. '', 'email', or 'jabber'
+ * @param bool|int $user_id The user_id to add the subscription for (bool false for current user)
+ */
+ public function delete_subscription($item_type, $item_id = 0, $method = '', $user_id = false)
+ {
+ $user_id = ($user_id === false) ? $this->user->data['user_id'] : $user_id;
+
+ // If no method, make sure that no other notification methods for this item are selected before deleting
+ if ($method === '')
+ {
+ $sql = 'SELECT COUNT(*) as num_notifications
+ FROM ' . $this->user_notifications_table . "
+ WHERE item_type = '" . $this->db->sql_escape($item_type) . "'
+ AND item_id = " . (int) $item_id . '
+ AND user_id = ' .(int) $user_id . "
+ AND method <> ''
+ AND notify = 1";
+ $this->db->sql_query($sql);
+ $num_notifications = $this->db->sql_fetchfield('num_notifications');
+ $this->db->sql_freeresult();
+
+ if ($num_notifications)
+ {
+ return;
+ }
+ }
+
+ $sql = 'UPDATE ' . $this->user_notifications_table . "
+ SET notify = 0
+ WHERE item_type = '" . $this->db->sql_escape($item_type) . "'
+ AND item_id = " . (int) $item_id . '
+ AND user_id = ' .(int) $user_id . "
+ AND method = '" . $this->db->sql_escape($method) . "'";
+ $this->db->sql_query($sql);
+
+ if (!$this->db->sql_affectedrows())
+ {
+ $sql = 'INSERT INTO ' . $this->user_notifications_table . ' ' .
+ $this->db->sql_build_array('INSERT', array(
+ 'item_type' => $item_type,
+ 'item_id' => (int) $item_id,
+ 'user_id' => (int) $user_id,
+ 'method' => $method,
+ 'notify' => 0,
+ ));
+ $this->db->sql_query($sql);
+ }
+ }
+
+ /**
+ * Disable all notifications of a certain type
+ *
+ * This should be called when an extension which has notification types
+ * is disabled so that all those notifications are hidden and do not
+ * cause errors
+ *
+ * @param string $notification_type_name Type identifier of the subscription
+ */
+ public function disable_notifications($notification_type_name)
+ {
+ $sql = 'UPDATE ' . $this->notification_types_table . "
+ SET notification_type_enabled = 0
+ WHERE notification_type_name = '" . $this->db->sql_escape($notification_type_name) . "'";
+ $this->db->sql_query($sql);
+ }
+
+ /**
+ * Purge all notifications of a certain type
+ *
+ * This should be called when an extension which has notification types
+ * is purged so that all those notifications are removed
+ *
+ * @param string $notification_type_name Type identifier of the subscription
+ */
+ public function purge_notifications($notification_type_name)
+ {
+ // If a notification is never used, its type will not be added to the database
+ // nor its id cached. If this method is called by an extension during the
+ // purge step, and that extension never used its notifications,
+ // get_notification_type_id() will throw an exception. However,
+ // because no notification type was added to the database,
+ // there is nothing to delete, so we can silently drop the exception.
+ try
+ {
+ $notification_type_id = $this->get_notification_type_id($notification_type_name);
+
+ $sql = 'DELETE FROM ' . $this->notifications_table . '
+ WHERE notification_type_id = ' . (int) $notification_type_id;
+ $this->db->sql_query($sql);
+
+ $sql = 'DELETE FROM ' . $this->notification_types_table . '
+ WHERE notification_type_id = ' . (int) $notification_type_id;
+ $this->db->sql_query($sql);
+
+ $this->cache->destroy('notification_type_ids');
+ }
+ catch (\phpbb\notification\exception $e)
+ {
+ // Continue
+ }
+ }
+
+ /**
+ * Enable all notifications of a certain type
+ *
+ * This should be called when an extension which has notification types
+ * that was disabled is re-enabled so that all those notifications that
+ * were hidden are shown again
+ *
+ * @param string $notification_type_name Type identifier of the subscription
+ */
+ public function enable_notifications($notification_type_name)
+ {
+ $sql = 'UPDATE ' . $this->notification_types_table . "
+ SET notification_type_enabled = 1
+ WHERE notification_type_name = '" . $this->db->sql_escape($notification_type_name) . "'";
+ $this->db->sql_query($sql);
+ }
+
+ /**
+ * Delete all notifications older than a certain time
+ *
+ * @param int $timestamp Unix timestamp to delete all notifications that were created before
+ * @param bool $only_read True (default) to only prune read notifications
+ */
+ public function prune_notifications($timestamp, $only_read = true)
+ {
+ $sql = 'DELETE FROM ' . $this->notifications_table . '
+ WHERE notification_time < ' . (int) $timestamp .
+ (($only_read) ? ' AND notification_read = 1' : '');
+ $this->db->sql_query($sql);
+
+ $this->config->set('read_notification_last_gc', time(), false);
+ }
+
+ /**
+ * Helper to get the notifications item type class and set it up
+ */
+ public function get_item_type_class($notification_type_name, $data = array())
+ {
+ $item = $this->load_object($notification_type_name);
+
+ $item->set_initial_data($data);
+
+ return $item;
+ }
+
+ /**
+ * Helper to get the notifications method class and set it up
+ */
+ public function get_method_class($method_name)
+ {
+ return $this->load_object($method_name);
+ }
+
+ /**
+ * Helper to load objects (notification types/methods)
+ */
+ protected function load_object($object_name)
+ {
+ $object = $this->phpbb_container->get($object_name);
+
+ if (method_exists($object, 'set_notification_manager'))
+ {
+ $object->set_notification_manager($this);
+ }
+
+ return $object;
+ }
+
+ /**
+ * Get the notification type id from the name
+ *
+ * @param string $notification_type_name The name
+ * @return int the notification_type_id
+ * @throws \phpbb\notification\exception
+ */
+ public function get_notification_type_id($notification_type_name)
+ {
+ $notification_type_ids = $this->cache->get('notification_type_ids');
+
+ $this->db->sql_transaction('begin');
+
+ if ($notification_type_ids === false)
+ {
+ $notification_type_ids = array();
+
+ $sql = 'SELECT notification_type_id, notification_type_name
+ FROM ' . $this->notification_types_table;
+ $result = $this->db->sql_query($sql);
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $notification_type_ids[$row['notification_type_name']] = (int) $row['notification_type_id'];
+ }
+ $this->db->sql_freeresult($result);
+
+ $this->cache->put('notification_type_ids', $notification_type_ids);
+ }
+
+ if (!isset($notification_type_ids[$notification_type_name]))
+ {
+ if (!isset($this->notification_types[$notification_type_name]) && !isset($this->notification_types['notification.type.' . $notification_type_name]))
+ {
+ $this->db->sql_transaction('rollback');
+ throw new \phpbb\notification\exception($this->user->lang('NOTIFICATION_TYPE_NOT_EXIST', $notification_type_name));
+ }
+
+ $sql = 'INSERT INTO ' . $this->notification_types_table . ' ' . $this->db->sql_build_array('INSERT', array(
+ 'notification_type_name' => $notification_type_name,
+ 'notification_type_enabled' => 1,
+ ));
+ $this->db->sql_query($sql);
+
+ $notification_type_ids[$notification_type_name] = (int) $this->db->sql_nextid();
+
+ $this->cache->put('notification_type_ids', $notification_type_ids);
+ }
+
+ $this->db->sql_transaction('commit');
+
+ return $notification_type_ids[$notification_type_name];
+ }
+
+ /**
+ * Get notification type ids (as an array)
+ *
+ * @param string|array $notification_type_names Notification type names
+ * @return array Array of integers
+ */
+ public function get_notification_type_ids($notification_type_names)
+ {
+ if (!is_array($notification_type_names))
+ {
+ $notification_type_names = array($notification_type_names);
+ }
+
+ $notification_type_ids = array();
+
+ foreach ($notification_type_names as $name)
+ {
+ $notification_type_ids[$name] = $this->get_notification_type_id($name);
+ }
+
+ return $notification_type_ids;
+ }
+}
diff --git a/phpBB/phpbb/notification/method/base.php b/phpBB/phpbb/notification/method/base.php
new file mode 100644
index 0000000000..6ee1d2984a
--- /dev/null
+++ b/phpBB/phpbb/notification/method/base.php
@@ -0,0 +1,113 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\notification\method;
+
+/**
+* Base notifications method class
+*/
+abstract class base implements \phpbb\notification\method\method_interface
+{
+ /** @var \phpbb\notification\manager */
+ protected $notification_manager;
+
+ /** @var \phpbb\user_loader */
+ protected $user_loader;
+
+ /** @var \phpbb\db\driver\driver_interface */
+ protected $db;
+
+ /** @var \phpbb\cache\driver\driver_interface */
+ protected $cache;
+
+ /** @var \phpbb\template\template */
+ protected $template;
+
+ /** @var \phpbb\extension\manager */
+ protected $extension_manager;
+
+ /** @var \phpbb\user */
+ protected $user;
+
+ /** @var \phpbb\auth\auth */
+ protected $auth;
+
+ /** @var \phpbb\config\config */
+ protected $config;
+
+ /** @var string */
+ protected $phpbb_root_path;
+
+ /** @var string */
+ protected $php_ext;
+
+ /**
+ * Queue of messages to be sent
+ *
+ * @var array
+ */
+ protected $queue = array();
+
+ /**
+ * Notification Method Base Constructor
+ *
+ * @param \phpbb\user_loader $user_loader
+ * @param \phpbb\db\driver\driver_interface $db
+ * @param \phpbb\cache\driver\driver_interface $cache
+ * @param \phpbb\user $user
+ * @param \phpbb\auth\auth $auth
+ * @param \phpbb\config\config $config
+ * @param string $phpbb_root_path
+ * @param string $php_ext
+ * @return \phpbb\notification\method\base
+ */
+ public function __construct(\phpbb\user_loader $user_loader, \phpbb\db\driver\driver_interface $db, \phpbb\cache\driver\driver_interface $cache, $user, \phpbb\auth\auth $auth, \phpbb\config\config $config, $phpbb_root_path, $php_ext)
+ {
+ $this->user_loader = $user_loader;
+ $this->db = $db;
+ $this->cache = $cache;
+ $this->user = $user;
+ $this->auth = $auth;
+ $this->config = $config;
+ $this->phpbb_root_path = $phpbb_root_path;
+ $this->php_ext = $php_ext;
+ }
+
+ /**
+ * Set notification manager (required)
+ *
+ * @param \phpbb\notification\manager $notification_manager
+ */
+ public function set_notification_manager(\phpbb\notification\manager $notification_manager)
+ {
+ $this->notification_manager = $notification_manager;
+ }
+
+ /**
+ * Add a notification to the queue
+ *
+ * @param \phpbb\notification\type\type_interface $notification
+ */
+ public function add_to_queue(\phpbb\notification\type\type_interface $notification)
+ {
+ $this->queue[] = $notification;
+ }
+
+ /**
+ * Empty the queue
+ */
+ protected function empty_queue()
+ {
+ $this->queue = array();
+ }
+}
diff --git a/phpBB/phpbb/notification/method/email.php b/phpBB/phpbb/notification/method/email.php
new file mode 100644
index 0000000000..a4b93bc85c
--- /dev/null
+++ b/phpBB/phpbb/notification/method/email.php
@@ -0,0 +1,49 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\notification\method;
+
+/**
+* Email notification method class
+* This class handles sending emails for notifications
+*/
+
+class email extends \phpbb\notification\method\messenger_base
+{
+ /**
+ * Get notification method name
+ *
+ * @return string
+ */
+ public function get_type()
+ {
+ return 'notification.method.email';
+ }
+
+ /**
+ * Is this method available for the user?
+ * This is checked on the notifications options
+ */
+ public function is_available()
+ {
+ return $this->config['email_enable'] && $this->user->data['user_email'];
+ }
+
+ /**
+ * Parse the queue and notify the users
+ */
+ public function notify()
+ {
+ return $this->notify_using_messenger(NOTIFY_EMAIL);
+ }
+}
diff --git a/phpBB/phpbb/notification/method/jabber.php b/phpBB/phpbb/notification/method/jabber.php
new file mode 100644
index 0000000000..09f186e3ca
--- /dev/null
+++ b/phpBB/phpbb/notification/method/jabber.php
@@ -0,0 +1,66 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\notification\method;
+
+/**
+* Jabber notification method class
+* This class handles sending Jabber messages for notifications
+*/
+
+class jabber extends \phpbb\notification\method\messenger_base
+{
+ /**
+ * Get notification method name
+ *
+ * @return string
+ */
+ public function get_type()
+ {
+ return 'notification.method.jabber';
+ }
+
+ /**
+ * Is this method available for the user?
+ * This is checked on the notifications options
+ */
+ public function is_available()
+ {
+ return ($this->global_available() && $this->user->data['user_jabber']);
+ }
+
+ /**
+ * Is this method available at all?
+ * This is checked before notifications are sent
+ */
+ public function global_available()
+ {
+ return !(
+ empty($this->config['jab_enable']) ||
+ empty($this->config['jab_host']) ||
+ empty($this->config['jab_username']) ||
+ empty($this->config['jab_password']) ||
+ !@extension_loaded('xml')
+ );
+ }
+
+ public function notify()
+ {
+ if (!$this->global_available())
+ {
+ return;
+ }
+
+ return $this->notify_using_messenger(NOTIFY_IM, 'short/');
+ }
+}
diff --git a/phpBB/phpbb/notification/method/messenger_base.php b/phpBB/phpbb/notification/method/messenger_base.php
new file mode 100644
index 0000000000..0bfbfd6b02
--- /dev/null
+++ b/phpBB/phpbb/notification/method/messenger_base.php
@@ -0,0 +1,96 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\notification\method;
+
+/**
+* Abstract notification method handling email and jabber notifications
+* using the phpBB messenger.
+*/
+abstract class messenger_base extends \phpbb\notification\method\base
+{
+ /**
+ * Notify using phpBB messenger
+ *
+ * @param int $notify_method Notify method for messenger (e.g. NOTIFY_IM)
+ * @param string $template_dir_prefix Base directory to prepend to the email template name
+ *
+ * @return null
+ */
+ protected function notify_using_messenger($notify_method, $template_dir_prefix = '')
+ {
+ if (empty($this->queue))
+ {
+ return;
+ }
+
+ // Load all users we want to notify (we need their email address)
+ $user_ids = $users = array();
+ foreach ($this->queue as $notification)
+ {
+ $user_ids[] = $notification->user_id;
+ }
+
+ // We do not send emails to banned users
+ if (!function_exists('phpbb_get_banned_user_ids'))
+ {
+ include($this->phpbb_root_path . 'includes/functions_user.' . $this->php_ext);
+ }
+ $banned_users = phpbb_get_banned_user_ids($user_ids);
+
+ // Load all the users we need
+ $this->user_loader->load_users($user_ids);
+
+ // Load the messenger
+ if (!class_exists('messenger'))
+ {
+ include($this->phpbb_root_path . 'includes/functions_messenger.' . $this->php_ext);
+ }
+ $messenger = new \messenger();
+ $board_url = generate_board_url();
+
+ // Time to go through the queue and send emails
+ foreach ($this->queue as $notification)
+ {
+ if ($notification->get_email_template() === false)
+ {
+ continue;
+ }
+
+ $user = $this->user_loader->get_user($notification->user_id);
+
+ if ($user['user_type'] == USER_IGNORE || ($user['user_type'] == USER_INACTIVE && $user['user_inactive_reason'] == INACTIVE_MANUAL) || in_array($notification->user_id, $banned_users))
+ {
+ continue;
+ }
+
+ $messenger->template($notification->get_email_template(), $user['user_lang'], '', $template_dir_prefix);
+
+ $messenger->set_addresses($user);
+
+ $messenger->assign_vars(array_merge(array(
+ 'USERNAME' => $user['username'],
+
+ 'U_NOTIFICATION_SETTINGS' => generate_board_url() . '/ucp.' . $this->php_ext . '?i=ucp_notifications&mode=notification_options',
+ ), $notification->get_email_template_variables()));
+
+ $messenger->send($notify_method);
+ }
+
+ // Save the queue in the messenger class (has to be called or these emails could be lost?)
+ $messenger->save_queue();
+
+ // We're done, empty the queue
+ $this->empty_queue();
+ }
+}
diff --git a/phpBB/phpbb/notification/method/method_interface.php b/phpBB/phpbb/notification/method/method_interface.php
new file mode 100644
index 0000000000..76b0de179c
--- /dev/null
+++ b/phpBB/phpbb/notification/method/method_interface.php
@@ -0,0 +1,45 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\notification\method;
+
+/**
+* Base notifications method interface
+*/
+interface method_interface
+{
+ /**
+ * Get notification method name
+ *
+ * @return string
+ */
+ public function get_type();
+
+ /**
+ * Is this method available for the user?
+ * This is checked on the notifications options
+ */
+ public function is_available();
+
+ /**
+ * Add a notification to the queue
+ *
+ * @param \phpbb\notification\type\type_interface $notification
+ */
+ public function add_to_queue(\phpbb\notification\type\type_interface $notification);
+
+ /**
+ * Parse the queue and notify the users
+ */
+ public function notify();
+}
diff --git a/phpBB/phpbb/notification/type/admin_activate_user.php b/phpBB/phpbb/notification/type/admin_activate_user.php
new file mode 100644
index 0000000000..7c5c18aa47
--- /dev/null
+++ b/phpBB/phpbb/notification/type/admin_activate_user.php
@@ -0,0 +1,169 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\notification\type;
+
+/**
+* Admin activation notifications class
+* This class handles notifications for users requiring admin activation
+*/
+
+class admin_activate_user extends \phpbb\notification\type\base
+{
+ /**
+ * {@inheritdoc}
+ */
+ public function get_type()
+ {
+ return 'notification.type.admin_activate_user';
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected $language_key = 'NOTIFICATION_ADMIN_ACTIVATE_USER';
+
+ /**
+ * {@inheritdoc}
+ */
+ public static $notification_option = array(
+ 'lang' => 'NOTIFICATION_TYPE_ADMIN_ACTIVATE_USER',
+ 'group' => 'NOTIFICATION_GROUP_ADMINISTRATION',
+ );
+
+ /**
+ * {@inheritdoc}
+ */
+ public function is_available()
+ {
+ return ($this->auth->acl_get('a_user') && $this->config['require_activation'] == USER_ACTIVATION_ADMIN);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public static function get_item_id($user)
+ {
+ return (int) $user['user_id'];
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public static function get_item_parent_id($post)
+ {
+ return 0;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function find_users_for_notification($user, $options = array())
+ {
+ $options = array_merge(array(
+ 'ignore_users' => array(),
+ ), $options);
+
+ // Grab admins that have permission to administer users.
+ $admin_ary = $this->auth->acl_get_list(false, 'a_user', false);
+ $users = (!empty($admin_ary[0]['a_user'])) ? $admin_ary[0]['a_user'] : array();
+
+ // Grab founders
+ $sql = 'SELECT user_id
+ FROM ' . USERS_TABLE . '
+ WHERE user_type = ' . USER_FOUNDER;
+ $result = $this->db->sql_query($sql);
+
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $users[] = (int) $row['user_id'];
+ }
+ $this->db->sql_freeresult($result);
+
+ if (empty($users))
+ {
+ return array();
+ }
+ $users = array_unique($users);
+
+ return $this->check_user_notification_options($users, $options);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_avatar()
+ {
+ return $this->user_loader->get_avatar($this->item_id, false, true);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_title()
+ {
+ $username = $this->user_loader->get_username($this->item_id, 'no_profile');
+
+ return $this->user->lang($this->language_key, $username);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_email_template()
+ {
+ return 'admin_activate';
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_email_template_variables()
+ {
+ $board_url = generate_board_url();
+ $username = $this->user_loader->get_username($this->item_id, 'username');
+
+ return array(
+ 'USERNAME' => htmlspecialchars_decode($username),
+ 'U_USER_DETAILS' => "{$board_url}/memberlist.{$this->php_ext}?mode=viewprofile&u={$this->item_id}",
+ 'U_ACTIVATE' => "{$board_url}/ucp.{$this->php_ext}?mode=activate&u={$this->item_id}&k={$this->get_data('user_actkey')}",
+ );
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_url()
+ {
+ return $this->user_loader->get_username($this->item_id, 'profile');
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function users_to_query()
+ {
+ return array($this->item_id);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function create_insert_array($user, $pre_create_data)
+ {
+ $this->set_data('user_actkey', $user['user_actkey']);
+ $this->notification_time = $user['user_regdate'];
+
+ return parent::create_insert_array($user, $pre_create_data);
+ }
+}
diff --git a/phpBB/phpbb/notification/type/approve_post.php b/phpBB/phpbb/notification/type/approve_post.php
new file mode 100644
index 0000000000..5760c12166
--- /dev/null
+++ b/phpBB/phpbb/notification/type/approve_post.php
@@ -0,0 +1,146 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\notification\type;
+
+/**
+* Post approved notifications class
+* This class handles notifications for posts when they are approved (to their authors)
+*/
+
+class approve_post extends \phpbb\notification\type\post
+{
+ /**
+ * Get notification type name
+ *
+ * @return string
+ */
+ public function get_type()
+ {
+ return 'notification.type.approve_post';
+ }
+
+ /**
+ * Language key used to output the text
+ *
+ * @var string
+ */
+ protected $language_key = 'NOTIFICATION_POST_APPROVED';
+
+ /**
+ * Inherit notification read status from post.
+ *
+ * @var bool
+ */
+ protected $inherit_read_status = false;
+
+ /**
+ * Notification option data (for outputting to the user)
+ *
+ * @var bool|array False if the service should use it's default data
+ * Array of data (including keys 'id', 'lang', and 'group')
+ */
+ public static $notification_option = array(
+ 'id' => 'moderation_queue',
+ 'lang' => 'NOTIFICATION_TYPE_MODERATION_QUEUE',
+ 'group' => 'NOTIFICATION_GROUP_POSTING',
+ );
+
+ /**
+ * Is available
+ */
+ public function is_available()
+ {
+ return !$this->auth->acl_get('m_approve');
+ }
+
+ /**
+ * Find the users who want to receive notifications
+ *
+ * @param array $post Data from submit_post
+ * @param array $options Options for finding users for notification
+ *
+ * @return array
+ */
+ public function find_users_for_notification($post, $options = array())
+ {
+ $options = array_merge(array(
+ 'ignore_users' => array(),
+ ), $options);
+
+ $users = array();
+ $users[$post['poster_id']] = array('');
+
+ return $this->get_authorised_recipients(array_keys($users), $post['forum_id'], array_merge($options, array(
+ 'item_type' => static::$notification_option['id'],
+ )));
+ }
+
+ /**
+ * Pre create insert array function
+ * This allows you to perform certain actions, like run a query
+ * and load data, before create_insert_array() is run. The data
+ * returned from this function will be sent to create_insert_array().
+ *
+ * @param array $post Post data from submit_post
+ * @param array $notify_users Notify users list
+ * Formated from find_users_for_notification()
+ * @return array Whatever you want to send to create_insert_array().
+ */
+ public function pre_create_insert_array($post, $notify_users)
+ {
+ // In the parent class, this is used to check if the post is already
+ // read by a user and marks the notification read if it was marked read.
+ // Returning an empty array in effect, forces it to be marked as unread
+ // (and also saves a query)
+ return array();
+ }
+
+ /**
+ * Function for preparing the data for insertion in an SQL query
+ * (The service handles insertion)
+ *
+ * @param array $post Data from submit_post
+ * @param array $pre_create_data Data from pre_create_insert_array()
+ *
+ * @return array Array of data ready to be inserted into the database
+ */
+ public function create_insert_array($post, $pre_create_data = array())
+ {
+ $this->set_data('post_subject', $post['post_subject']);
+
+ $data = parent::create_insert_array($post, $pre_create_data);
+
+ $this->notification_time = $data['notification_time'] = time();
+
+ return $data;
+ }
+
+ /**
+ * Get email template
+ *
+ * @return string|bool
+ */
+ public function get_email_template()
+ {
+ return 'post_approved';
+ }
+
+ /**
+ * {inheritDoc}
+ */
+ public function get_redirect_url()
+ {
+ return $this->get_url();
+ }
+}
diff --git a/phpBB/phpbb/notification/type/approve_topic.php b/phpBB/phpbb/notification/type/approve_topic.php
new file mode 100644
index 0000000000..26e51bf9cd
--- /dev/null
+++ b/phpBB/phpbb/notification/type/approve_topic.php
@@ -0,0 +1,136 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\notification\type;
+
+/**
+* Topic approved notifications class
+* This class handles notifications for topics when they are approved (for authors)
+*/
+
+class approve_topic extends \phpbb\notification\type\topic
+{
+ /**
+ * Get notification type name
+ *
+ * @return string
+ */
+ public function get_type()
+ {
+ return 'notification.type.approve_topic';
+ }
+
+ /**
+ * Language key used to output the text
+ *
+ * @var string
+ */
+ protected $language_key = 'NOTIFICATION_TOPIC_APPROVED';
+
+ /**
+ * Inherit notification read status from topic.
+ *
+ * @var bool
+ */
+ protected $inherit_read_status = false;
+
+ /**
+ * Notification option data (for outputting to the user)
+ *
+ * @var bool|array False if the service should use it's default data
+ * Array of data (including keys 'id', 'lang', and 'group')
+ */
+ public static $notification_option = array(
+ 'id' => 'moderation_queue',
+ 'lang' => 'NOTIFICATION_TYPE_MODERATION_QUEUE',
+ 'group' => 'NOTIFICATION_GROUP_POSTING',
+ );
+
+ /**
+ * Is available
+ */
+ public function is_available()
+ {
+ return !$this->auth->acl_get('m_approve');
+ }
+
+ /**
+ * Find the users who want to receive notifications
+ *
+ * @param array $post Data from submit_post
+ * @param array $options Options for finding users for notification
+ *
+ * @return array
+ */
+ public function find_users_for_notification($post, $options = array())
+ {
+ $options = array_merge(array(
+ 'ignore_users' => array(),
+ ), $options);
+
+ $users = array();
+ $users[$post['poster_id']] = array('');
+
+ return $this->get_authorised_recipients(array_keys($users), $post['forum_id'], array_merge($options, array(
+ 'item_type' => static::$notification_option['id'],
+ )));
+ }
+
+ /**
+ * Pre create insert array function
+ * This allows you to perform certain actions, like run a query
+ * and load data, before create_insert_array() is run. The data
+ * returned from this function will be sent to create_insert_array().
+ *
+ * @param array $post Post data from submit_post
+ * @param array $notify_users Notify users list
+ * Formated from find_users_for_notification()
+ * @return array Whatever you want to send to create_insert_array().
+ */
+ public function pre_create_insert_array($post, $notify_users)
+ {
+ // In the parent class, this is used to check if the post is already
+ // read by a user and marks the notification read if it was marked read.
+ // Returning an empty array in effect, forces it to be marked as unread
+ // (and also saves a query)
+ return array();
+ }
+
+ /**
+ * Function for preparing the data for insertion in an SQL query
+ * (The service handles insertion)
+ *
+ * @param array $post Data from submit_post
+ * @param array $pre_create_data Data from pre_create_insert_array()
+ *
+ * @return array Array of data ready to be inserted into the database
+ */
+ public function create_insert_array($post, $pre_create_data = array())
+ {
+ $data = parent::create_insert_array($post, $pre_create_data);
+
+ $this->notification_time = $data['notification_time'] = time();
+
+ return $data;
+ }
+
+ /**
+ * Get email template
+ *
+ * @return string|bool
+ */
+ public function get_email_template()
+ {
+ return 'topic_approved';
+ }
+}
diff --git a/phpBB/phpbb/notification/type/base.php b/phpBB/phpbb/notification/type/base.php
new file mode 100644
index 0000000000..4ead06071e
--- /dev/null
+++ b/phpBB/phpbb/notification/type/base.php
@@ -0,0 +1,569 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\notification\type;
+
+/**
+* Base notifications class
+*/
+abstract class base implements \phpbb\notification\type\type_interface
+{
+ /** @var \phpbb\notification\manager */
+ protected $notification_manager;
+
+ /** @var \phpbb\user_loader */
+ protected $user_loader;
+
+ /** @var \phpbb\db\driver\driver_interface */
+ protected $db;
+
+ /** @var \phpbb\cache\driver\driver_interface */
+ protected $cache;
+
+ /** @var \phpbb\template\template */
+ protected $template;
+
+ /** @var \phpbb\user */
+ protected $user;
+
+ /** @var \phpbb\auth\auth */
+ protected $auth;
+
+ /** @var \phpbb\config\config */
+ protected $config;
+
+ /** @var string */
+ protected $phpbb_root_path;
+
+ /** @var string */
+ protected $php_ext;
+
+ /** @var string */
+ protected $notification_types_table;
+
+ /** @var string */
+ protected $notifications_table;
+
+ /** @var string */
+ protected $user_notifications_table;
+
+ /**
+ * Notification option data (for outputting to the user)
+ *
+ * @var bool|array False if the service should use its default data
+ * Array of data (including keys 'id', 'lang', and 'group')
+ */
+ public static $notification_option = false;
+
+ /**
+ * The notification_type_id, set upon creation of the class
+ * This is the notification_type_id from the notification_types table
+ *
+ * @var int
+ */
+ protected $notification_type_id;
+
+ /**
+ * Indentification data
+ * notification_type_id - ID of the item type (auto generated, from notification types table)
+ * item_id - ID of the item (e.g. post_id, msg_id)
+ * item_parent_id - Parent item id (ex: for topic => forum_id, for post => topic_id, etc)
+ * user_id
+ * notification_read
+ * notification_time
+ * notification_data (special serialized field that each notification type can use to store stuff)
+ *
+ * @var array $data Notification row from the database
+ * This must be private, all interaction should use __get(), __set(), get_data(), set_data()
+ */
+ private $data = array();
+
+ /**
+ * Notification Type Base Constructor
+ *
+ * @param \phpbb\user_loader $user_loader
+ * @param \phpbb\db\driver\driver_interface $db
+ * @param \phpbb\cache\driver\driver_interface $cache
+ * @param \phpbb\user $user
+ * @param \phpbb\auth\auth $auth
+ * @param \phpbb\config\config $config
+ * @param string $phpbb_root_path
+ * @param string $php_ext
+ * @param string $notification_types_table
+ * @param string $notifications_table
+ * @param string $user_notifications_table
+ * @return \phpbb\notification\type\base
+ */
+ public function __construct(\phpbb\user_loader $user_loader, \phpbb\db\driver\driver_interface $db, \phpbb\cache\driver\driver_interface $cache, $user, \phpbb\auth\auth $auth, \phpbb\config\config $config, $phpbb_root_path, $php_ext, $notification_types_table, $notifications_table, $user_notifications_table)
+ {
+ $this->user_loader = $user_loader;
+ $this->db = $db;
+ $this->cache = $cache;
+ $this->user = $user;
+ $this->auth = $auth;
+ $this->config = $config;
+
+ $this->phpbb_root_path = $phpbb_root_path;
+ $this->php_ext = $php_ext;
+
+ $this->notification_types_table = $notification_types_table;
+ $this->notifications_table = $notifications_table;
+ $this->user_notifications_table = $user_notifications_table;
+ }
+
+ /**
+ * Set notification manager (required)
+ *
+ * @param \phpbb\notification\manager $notification_manager
+ */
+ public function set_notification_manager(\phpbb\notification\manager $notification_manager)
+ {
+ $this->notification_manager = $notification_manager;
+
+ $this->notification_type_id = $this->notification_manager->get_notification_type_id($this->get_type());
+ }
+
+ /**
+ * Set initial data from the database
+ *
+ * @param array $data Row directly from the database
+ */
+ public function set_initial_data($data = array())
+ {
+ // The row from the database (unless this is a new notification we're going to add)
+ $this->data = $data;
+ $this->data['notification_data'] = (isset($this->data['notification_data'])) ? unserialize($this->data['notification_data']) : array();
+ }
+
+ /**
+ * Magic method to get data from this notification
+ *
+ * @param mixed $name
+ * @return mixed
+ */
+ public function __get($name)
+ {
+ return (!isset($this->data[$name])) ? null : $this->data[$name];
+ }
+
+
+ /**
+ * Magic method to set data on this notification
+ *
+ * @param mixed $name
+ * @param mixed $value
+ *
+ * @return null
+ */
+ public function __set($name, $value)
+ {
+ $this->data[$name] = $value;
+ }
+
+
+ /**
+ * Magic method to get a string of this notification
+ *
+ * Primarily for testing
+ *
+ * @return mixed
+ */
+ public function __toString()
+ {
+ return (!empty($this->data)) ? var_export($this->data, true) : $this->get_type();
+ }
+
+ /**
+ * Get special data (only important for the classes that extend this)
+ *
+ * @param string $name Name of the variable to get
+ * @return mixed
+ */
+ protected function get_data($name)
+ {
+ return ($name === false) ? $this->data['notification_data'] : ((isset($this->data['notification_data'][$name])) ? $this->data['notification_data'][$name] : null);
+ }
+
+ /**
+ * Set special data (only important for the classes that extend this)
+ *
+ * @param string $name Name of the variable to set
+ * @param mixed $value Value to set to the variable
+ * @return mixed
+ */
+ protected function set_data($name, $value)
+ {
+ $this->data['notification_data'][$name] = $value;
+ }
+
+ /**
+ * Function for preparing the data for insertion in an SQL query
+ * (The service handles insertion)
+ *
+ * @param array $type_data Data unique to this notification type
+ * @param array $pre_create_data Data from pre_create_insert_array()
+ * @return array Array of data ready to be inserted into the database
+ */
+ public function create_insert_array($type_data, $pre_create_data = array())
+ {
+ // Defaults
+ $this->data = array_merge(array(
+ 'item_id' => static::get_item_id($type_data),
+ 'notification_type_id' => $this->notification_type_id,
+ 'item_parent_id' => static::get_item_parent_id($type_data),
+
+ 'notification_time' => time(),
+ 'notification_read' => false,
+
+ 'notification_data' => array(),
+ ), $this->data);
+
+ $data = $this->data;
+
+ $data['notification_data'] = serialize($data['notification_data']);
+
+ return $data;
+ }
+
+ /**
+ * Function for preparing the data for update in an SQL query
+ * (The service handles insertion)
+ *
+ * @param array $type_data Data unique to this notification type
+ * @return array Array of data ready to be updated in the database
+ */
+ public function create_update_array($type_data)
+ {
+ $data = $this->create_insert_array($type_data);
+
+ // Unset data unique to each row
+ unset(
+ $data['notification_time'], // Also unsetting time, since it always tries to change the time to current (if you actually need to change the time, over-ride this function)
+ $data['notification_id'],
+ $data['notification_read'],
+ $data['user_id']
+ );
+
+ return $data;
+ }
+
+ /**
+ * Mark this item read
+ *
+ * @param bool $return True to return a string containing the SQL code to update this item, False to execute it (Default: False)
+ * @return string|null If $return is False, nothing will be returned, else the sql code to update this item
+ */
+ public function mark_read($return = false)
+ {
+ return $this->mark(false, $return);
+ }
+
+ /**
+ * Mark this item unread
+ *
+ * @param bool $return True to return a string containing the SQL code to update this item, False to execute it (Default: False)
+ * @return string|null If $return is False, nothing will be returned, else the sql code to update this item
+ */
+ public function mark_unread($return = false)
+ {
+ return $this->mark(true, $return);
+ }
+
+ /**
+ * {inheritDoc}
+ */
+ public function get_redirect_url()
+ {
+ return $this->get_url();
+ }
+
+ /**
+ * Prepare to output the notification to the template
+ *
+ * @return array Template variables
+ */
+ public function prepare_for_display()
+ {
+ $mark_hash = generate_link_hash('mark_notification_read');
+
+ if ($this->get_url())
+ {
+ $u_mark_read = append_sid($this->phpbb_root_path . 'index.' . $this->php_ext, 'mark_notification=' . $this->notification_id . '&amp;hash=' . $mark_hash);
+ }
+ else
+ {
+ $redirect = (($this->user->page['page_dir']) ? $this->user->page['page_dir'] . '/' : '') . $this->user->page['page_name'] . (($this->user->page['query_string']) ? '?' . $this->user->page['query_string'] : '');
+
+ $u_mark_read = append_sid($this->phpbb_root_path . 'index.' . $this->php_ext, 'mark_notification=' . $this->notification_id . '&amp;hash=' . $mark_hash . '&amp;redirect=' . urlencode($redirect));
+ }
+
+ return array(
+ 'NOTIFICATION_ID' => $this->notification_id,
+ 'STYLING' => $this->get_style_class(),
+ 'AVATAR' => $this->get_avatar(),
+ 'FORMATTED_TITLE' => $this->get_title(),
+ 'REFERENCE' => $this->get_reference(),
+ 'FORUM' => $this->get_forum(),
+ 'REASON' => $this->get_reason(),
+ 'URL' => $this->get_url(),
+ 'TIME' => $this->user->format_date($this->notification_time),
+ 'UNREAD' => !$this->notification_read,
+ 'U_MARK_READ' => (!$this->notification_read) ? $u_mark_read : '',
+ );
+ }
+
+ /**
+ * -------------- Fall back functions -------------------
+ */
+
+ /**
+ * URL to unsubscribe to this notification (fall back)
+ *
+ * @param string|bool $method Method name to unsubscribe from (email|jabber|etc), False to unsubscribe from all notifications for this item
+ */
+ public function get_unsubscribe_url($method = false)
+ {
+ return false;
+ }
+
+ /**
+ * Get the CSS style class of the notification (fall back)
+ *
+ * @return string
+ */
+ public function get_style_class()
+ {
+ return '';
+ }
+
+ /**
+ * Get the user's avatar (fall back)
+ *
+ * @return string
+ */
+ public function get_avatar()
+ {
+ return '';
+ }
+
+ /**
+ * Get the reference of the notifcation (fall back)
+ *
+ * @return string
+ */
+ public function get_reference()
+ {
+ return '';
+ }
+
+ /**
+ * Get the forum of the notification reference (fall back)
+ *
+ * @return string
+ */
+ public function get_forum()
+ {
+ return '';
+ }
+
+ /**
+ * Get the reason for the notifcation (fall back)
+ *
+ * @return string
+ */
+ public function get_reason()
+ {
+ return '';
+ }
+
+ /**
+ * Get the special items to load (fall back)
+ *
+ * @return array
+ */
+ public function get_load_special()
+ {
+ return array();
+ }
+
+ /**
+ * Load the special items (fall back)
+ */
+ public function load_special($data, $notifications)
+ {
+ return;
+ }
+
+ /**
+ * Is available (fall back)
+ *
+ * @return bool
+ */
+ public function is_available()
+ {
+ return true;
+ }
+
+ /**
+ * Pre create insert array function (fall back)
+ *
+ * @return array
+ */
+ public function pre_create_insert_array($type_data, $notify_users)
+ {
+ return array();
+ }
+
+ /**
+ * -------------- Helper functions -------------------
+ */
+
+ /**
+ * Find the users who want to receive notifications (helper)
+ *
+ * @param array $user_ids User IDs to check if they want to receive notifications
+ * (Bool False to check all users besides anonymous and bots (USER_IGNORE))
+ *
+ * @return array
+ */
+ protected function check_user_notification_options($user_ids = false, $options = array())
+ {
+ $options = array_merge(array(
+ 'ignore_users' => array(),
+ 'item_type' => $this->get_type(),
+ 'item_id' => 0, // Global by default
+ ), $options);
+
+ if ($user_ids === false)
+ {
+ $user_ids = array();
+
+ $sql = 'SELECT user_id
+ FROM ' . USERS_TABLE . '
+ WHERE user_id <> ' . ANONYMOUS . '
+ AND user_type <> ' . USER_IGNORE;
+ $result = $this->db->sql_query($sql);
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $user_ids[] = $row['user_id'];
+ }
+ $this->db->sql_freeresult($result);
+ }
+
+ if (empty($user_ids))
+ {
+ return array();
+ }
+
+ $rowset = $resulting_user_ids = array();
+
+ $sql = 'SELECT user_id, method, notify
+ FROM ' . $this->user_notifications_table . '
+ WHERE ' . $this->db->sql_in_set('user_id', $user_ids) . "
+ AND item_type = '" . $this->db->sql_escape($options['item_type']) . "'
+ AND item_id = " . (int) $options['item_id'];
+ $result = $this->db->sql_query($sql);
+
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $resulting_user_ids[] = $row['user_id'];
+
+ if (!$row['notify'] || (isset($options['ignore_users'][$row['user_id']]) && in_array($row['method'], $options['ignore_users'][$row['user_id']])))
+ {
+ continue;
+ }
+
+ if (!isset($rowset[$row['user_id']]))
+ {
+ $rowset[$row['user_id']] = array();
+ }
+
+ $rowset[$row['user_id']][] = $row['method'];
+ }
+
+ $this->db->sql_freeresult($result);
+
+ foreach ($user_ids as $user_id)
+ {
+ if (!in_array($user_id, $resulting_user_ids) && !isset($options['ignore_users'][$user_id]))
+ {
+ // No rows at all for this user, default to ''
+ $rowset[$user_id] = array('');
+ }
+ }
+
+ return $rowset;
+ }
+
+ /**
+ * Mark this item read/unread helper
+ *
+ * @param bool $unread Unread (True/False) (Default: False)
+ * @param bool $return True to return a string containing the SQL code to update this item, False to execute it (Default: False)
+ * @return string|null If $return is False, nothing will be returned, else the sql code to update this item
+ */
+ protected function mark($unread = true, $return = false)
+ {
+ $this->notification_read = (bool) !$unread;
+
+ $where = array(
+ 'notification_type_id = ' . (int) $this->notification_type_id,
+ 'item_id = ' . (int) $this->item_id,
+ 'user_id = ' . (int) $this->user_id,
+ );
+ $where = implode(' AND ', $where);
+
+ if ($return)
+ {
+ return $where;
+ }
+
+ $sql = 'UPDATE ' . $this->notifications_table . '
+ SET notification_read = ' . (int) $this->notification_read . '
+ WHERE ' . $where;
+ $this->db->sql_query($sql);
+ }
+
+ /**
+ * Get a list of users that are authorised to receive notifications
+ *
+ * @param array $users Array of users that have subscribed to a notification
+ * @param int $forum_id Forum ID of the forum
+ * @param array $options Array of notification options
+ * @param bool $sort Whether the users array should be sorted. Default: false
+ * @return array Array of users that are authorised recipients
+ */
+ protected function get_authorised_recipients($users, $forum_id, $options, $sort = false)
+ {
+ if (empty($users))
+ {
+ return array();
+ }
+
+ $users = array_unique($users);
+
+ if ($sort)
+ {
+ sort($users);
+ }
+
+ $auth_read = $this->auth->acl_get_list($users, 'f_read', $forum_id);
+
+ if (empty($auth_read))
+ {
+ return array();
+ }
+
+ return $this->check_user_notification_options($auth_read[$forum_id]['f_read'], $options);
+ }
+}
diff --git a/phpBB/phpbb/notification/type/bookmark.php b/phpBB/phpbb/notification/type/bookmark.php
new file mode 100644
index 0000000000..1626add22c
--- /dev/null
+++ b/phpBB/phpbb/notification/type/bookmark.php
@@ -0,0 +1,132 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\notification\type;
+
+/**
+* Bookmark updating notifications class
+* This class handles notifications for replies to a bookmarked topic
+*/
+
+class bookmark extends \phpbb\notification\type\post
+{
+ /**
+ * Get notification type name
+ *
+ * @return string
+ */
+ public function get_type()
+ {
+ return 'notification.type.bookmark';
+ }
+
+ /**
+ * Language key used to output the text
+ *
+ * @var string
+ */
+ protected $language_key = 'NOTIFICATION_BOOKMARK';
+
+ /**
+ * Notification option data (for outputting to the user)
+ *
+ * @var bool|array False if the service should use it's default data
+ * Array of data (including keys 'id', 'lang', and 'group')
+ */
+ public static $notification_option = array(
+ 'lang' => 'NOTIFICATION_TYPE_BOOKMARK',
+ 'group' => 'NOTIFICATION_GROUP_POSTING',
+ );
+
+ /**
+ * Is available
+ */
+ public function is_available()
+ {
+ return $this->config['allow_bookmarks'];
+ }
+
+ /**
+ * Find the users who want to receive notifications
+ *
+ * @param array $post Data from submit_post
+ * @param array $options Options for finding users for notification
+ *
+ * @return array
+ */
+ public function find_users_for_notification($post, $options = array())
+ {
+ $options = array_merge(array(
+ 'ignore_users' => array(),
+ ), $options);
+
+ $users = array();
+
+ $sql = 'SELECT user_id
+ FROM ' . BOOKMARKS_TABLE . '
+ WHERE ' . $this->db->sql_in_set('topic_id', $post['topic_id']) . '
+ AND user_id <> ' . (int) $post['poster_id'];
+ $result = $this->db->sql_query($sql);
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $users[] = (int) $row['user_id'];
+ }
+ $this->db->sql_freeresult($result);
+
+ $notify_users = $this->get_authorised_recipients($users, $post['forum_id'], $options, true);
+
+ if (empty($notify_users))
+ {
+ return array();
+ }
+
+ // Try to find the users who already have been notified about replies and have not read the topic since and just update their notifications
+ $update_notifications = array();
+ $sql = 'SELECT n.*
+ FROM ' . $this->notifications_table . ' n, ' . $this->notification_types_table . ' nt
+ WHERE n.notification_type_id = ' . (int) $this->notification_type_id . '
+ AND n.item_parent_id = ' . (int) static::get_item_parent_id($post) . '
+ AND n.notification_read = 0
+ AND nt.notification_type_id = n.notification_type_id
+ AND nt.notification_type_enabled = 1';
+ $result = $this->db->sql_query($sql);
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ // Do not create a new notification
+ unset($notify_users[$row['user_id']]);
+
+ $notification = $this->notification_manager->get_item_type_class($this->get_type(), $row);
+ $update_responders = $notification->add_responders($post);
+ if (!empty($update_responders))
+ {
+ $sql = 'UPDATE ' . $this->notifications_table . '
+ SET ' . $this->db->sql_build_array('UPDATE', $update_responders) . '
+ WHERE notification_id = ' . $row['notification_id'];
+ $this->db->sql_query($sql);
+ }
+ }
+ $this->db->sql_freeresult($result);
+
+ return $notify_users;
+ }
+
+ /**
+ * Get email template
+ *
+ * @return string|bool
+ */
+ public function get_email_template()
+ {
+ return 'bookmark';
+ }
+}
diff --git a/phpBB/phpbb/notification/type/disapprove_post.php b/phpBB/phpbb/notification/type/disapprove_post.php
new file mode 100644
index 0000000000..6c7bcbcaee
--- /dev/null
+++ b/phpBB/phpbb/notification/type/disapprove_post.php
@@ -0,0 +1,156 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\notification\type;
+
+/**
+* Post disapproved notifications class
+* This class handles notifications for posts when they are disapproved (for authors)
+*/
+
+class disapprove_post extends \phpbb\notification\type\approve_post
+{
+ /**
+ * Get notification type name
+ *
+ * @return string
+ */
+ public function get_type()
+ {
+ return 'notification.type.disapprove_post';
+ }
+
+ /**
+ * Get the CSS style class of the notification
+ *
+ * @return string
+ */
+ public function get_style_class()
+ {
+ return 'notification-disapproved';
+ }
+
+ /**
+ * Language key used to output the text
+ *
+ * @var string
+ */
+ protected $language_key = 'NOTIFICATION_POST_DISAPPROVED';
+
+ /**
+ * Inherit notification read status from post.
+ *
+ * @var bool
+ */
+ protected $inherit_read_status = false;
+
+ /**
+ * Notification option data (for outputting to the user)
+ *
+ * @var bool|array False if the service should use it's default data
+ * Array of data (including keys 'id', 'lang', and 'group')
+ */
+ public static $notification_option = array(
+ 'id' => 'moderation_queue',
+ 'lang' => 'NOTIFICATION_TYPE_MODERATION_QUEUE',
+ 'group' => 'NOTIFICATION_GROUP_POSTING',
+ );
+
+ /**
+ * Get the HTML formatted title of this notification
+ *
+ * @return string
+ */
+ public function get_title()
+ {
+ return $this->user->lang($this->language_key);
+ }
+
+ /**
+ * Get the HTML formatted reference of the notification
+ *
+ * @return string
+ */
+ public function get_reference()
+ {
+ return $this->user->lang(
+ 'NOTIFICATION_REFERENCE',
+ censor_text($this->get_data('topic_title'))
+ );
+ }
+
+ /**
+ * Get the reason for the disapproval notification
+ *
+ * @return string
+ */
+ public function get_reason()
+ {
+ return $this->user->lang(
+ 'NOTIFICATION_REASON',
+ $this->get_data('disapprove_reason')
+ );
+ }
+
+ /**
+ * Get the url to this item
+ *
+ * @return string URL
+ */
+ public function get_url()
+ {
+ return '';
+ }
+
+ /**
+ * Get email template variables
+ *
+ * @return array
+ */
+ public function get_email_template_variables()
+ {
+ return array_merge(parent::get_email_template_variables(), array(
+ 'REASON' => htmlspecialchars_decode($this->get_data('disapprove_reason')),
+ ));
+ }
+
+ /**
+ * Function for preparing the data for insertion in an SQL query
+ * (The service handles insertion)
+ *
+ * @param array $post Data from submit_post
+ * @param array $pre_create_data Data from pre_create_insert_array()
+ *
+ * @return array Array of data ready to be inserted into the database
+ */
+ public function create_insert_array($post, $pre_create_data = array())
+ {
+ $this->set_data('disapprove_reason', $post['disapprove_reason']);
+
+ $data = parent::create_insert_array($post);
+
+ $this->notification_time = $data['notification_time'] = time();
+
+ return $data;
+ }
+
+ /**
+ * Get email template
+ *
+ * @return string|bool
+ */
+ public function get_email_template()
+ {
+ return 'post_disapproved';
+ }
+}
diff --git a/phpBB/phpbb/notification/type/disapprove_topic.php b/phpBB/phpbb/notification/type/disapprove_topic.php
new file mode 100644
index 0000000000..efa5eb7ecd
--- /dev/null
+++ b/phpBB/phpbb/notification/type/disapprove_topic.php
@@ -0,0 +1,156 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\notification\type;
+
+/**
+* Topic disapproved notifications class
+* This class handles notifications for topics when they are disapproved (for authors)
+*/
+
+class disapprove_topic extends \phpbb\notification\type\approve_topic
+{
+ /**
+ * Get notification type name
+ *
+ * @return string
+ */
+ public function get_type()
+ {
+ return 'notification.type.disapprove_topic';
+ }
+
+ /**
+ * Get the CSS style class of the notification
+ *
+ * @return string
+ */
+ public function get_style_class()
+ {
+ return 'notification-disapproved';
+ }
+
+ /**
+ * Language key used to output the text
+ *
+ * @var string
+ */
+ protected $language_key = 'NOTIFICATION_TOPIC_DISAPPROVED';
+
+ /**
+ * Inherit notification read status from topic.
+ *
+ * @var bool
+ */
+ protected $inherit_read_status = false;
+
+ /**
+ * Notification option data (for outputting to the user)
+ *
+ * @var bool|array False if the service should use it's default data
+ * Array of data (including keys 'id', 'lang', and 'group')
+ */
+ public static $notification_option = array(
+ 'id' => 'moderation_queue',
+ 'lang' => 'NOTIFICATION_TYPE_MODERATION_QUEUE',
+ 'group' => 'NOTIFICATION_GROUP_POSTING',
+ );
+
+ /**
+ * Get the HTML formatted title of this notification
+ *
+ * @return string
+ */
+ public function get_title()
+ {
+ return $this->user->lang($this->language_key);
+ }
+
+ /**
+ * Get the HTML formatted reference of the notification
+ *
+ * @return string
+ */
+ public function get_reference()
+ {
+ return $this->user->lang(
+ 'NOTIFICATION_REFERENCE',
+ censor_text($this->get_data('topic_title'))
+ );
+ }
+
+ /**
+ * Get the reason for the disapproval notification
+ *
+ * @return string
+ */
+ public function get_reason()
+ {
+ return $this->user->lang(
+ 'NOTIFICATION_REASON',
+ $this->get_data('disapprove_reason')
+ );
+ }
+
+ /**
+ * Get the url to this item
+ *
+ * @return string URL
+ */
+ public function get_url()
+ {
+ return '';
+ }
+
+ /**
+ * Get email template variables
+ *
+ * @return array
+ */
+ public function get_email_template_variables()
+ {
+ return array_merge(parent::get_email_template_variables(), array(
+ 'REASON' => htmlspecialchars_decode($this->get_data('disapprove_reason')),
+ ));
+ }
+
+ /**
+ * Function for preparing the data for insertion in an SQL query
+ * (The service handles insertion)
+ *
+ * @param array $post Data from submit_post
+ * @param array $pre_create_data Data from pre_create_insert_array()
+ *
+ * @return array Array of data ready to be inserted into the database
+ */
+ public function create_insert_array($post, $pre_create_data = array())
+ {
+ $this->set_data('disapprove_reason', $post['disapprove_reason']);
+
+ $data = parent::create_insert_array($post, $pre_create_data);
+
+ $this->notification_time = $data['notification_time'] = time();
+
+ return $data;
+ }
+
+ /**
+ * Get email template
+ *
+ * @return string|bool
+ */
+ public function get_email_template()
+ {
+ return 'topic_disapproved';
+ }
+}
diff --git a/phpBB/phpbb/notification/type/group_request.php b/phpBB/phpbb/notification/type/group_request.php
new file mode 100644
index 0000000000..96bfc86322
--- /dev/null
+++ b/phpBB/phpbb/notification/type/group_request.php
@@ -0,0 +1,161 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\notification\type;
+
+class group_request extends \phpbb\notification\type\base
+{
+ /**
+ * {@inheritdoc}
+ */
+ public function get_type()
+ {
+ return 'notification.type.group_request';
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public static $notification_option = array(
+ 'lang' => 'NOTIFICATION_TYPE_GROUP_REQUEST',
+ );
+
+ /**
+ * {@inheritdoc}
+ */
+ public function is_available()
+ {
+ // Leader of any groups?
+ $sql = 'SELECT group_id
+ FROM ' . USER_GROUP_TABLE . '
+ WHERE user_id = ' . (int) $this->user->data['user_id'] . '
+ AND group_leader = 1';
+ $result = $this->db->sql_query_limit($sql, 1);
+ $row = $this->db->sql_fetchrow($result);
+ $this->db->sql_freeresult($result);
+
+ return (!empty($row)) ? true : false;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public static function get_item_id($group)
+ {
+ return (int) $group['user_id'];
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public static function get_item_parent_id($group)
+ {
+ // Group id is the parent
+ return (int) $group['group_id'];
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function find_users_for_notification($group, $options = array())
+ {
+ $options = array_merge(array(
+ 'ignore_users' => array(),
+ ), $options);
+
+ $sql = 'SELECT user_id
+ FROM ' . USER_GROUP_TABLE . '
+ WHERE group_leader = 1
+ AND group_id = ' . (int) $group['group_id'];
+ $result = $this->db->sql_query($sql);
+
+ $user_ids = array();
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $user_ids[] = (int) $row['user_id'];
+ }
+ $this->db->sql_freeresult($result);
+
+ $this->user_loader->load_users($user_ids);
+
+ return $this->check_user_notification_options($user_ids, $options);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_avatar()
+ {
+ return $this->user_loader->get_avatar($this->item_id, false, true);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_title()
+ {
+ $username = $this->user_loader->get_username($this->item_id, 'no_profile');
+
+ return $this->user->lang('NOTIFICATION_GROUP_REQUEST', $username, $this->get_data('group_name'));
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_email_template()
+ {
+ return 'group_request';
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_email_template_variables()
+ {
+ $user_data = $this->user_loader->get_user($this->item_id);
+
+ return array(
+ 'GROUP_NAME' => htmlspecialchars_decode($this->get_data('group_name')),
+ 'REQUEST_USERNAME' => htmlspecialchars_decode($user_data['username']),
+
+ 'U_PENDING' => generate_board_url() . "/ucp.{$this->php_ext}?i=groups&mode=manage&action=list&g={$this->item_parent_id}",
+ 'U_GROUP' => generate_board_url() . "/memberlist.{$this->php_ext}?mode=group&g={$this->item_parent_id}",
+ );
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_url()
+ {
+ return append_sid($this->phpbb_root_path . 'ucp.' . $this->php_ext, "i=groups&mode=manage&action=list&g={$this->item_parent_id}");
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function users_to_query()
+ {
+ return array($this->item_id);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function create_insert_array($group, $pre_create_data = array())
+ {
+ $this->set_data('group_name', $group['group_name']);
+
+ return parent::create_insert_array($group, $pre_create_data);
+ }
+}
diff --git a/phpBB/phpbb/notification/type/group_request_approved.php b/phpBB/phpbb/notification/type/group_request_approved.php
new file mode 100644
index 0000000000..d284046ffa
--- /dev/null
+++ b/phpBB/phpbb/notification/type/group_request_approved.php
@@ -0,0 +1,116 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\notification\type;
+
+class group_request_approved extends \phpbb\notification\type\base
+{
+ /**
+ * {@inheritdoc}
+ */
+ public function get_type()
+ {
+ return 'notification.type.group_request_approved';
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function is_available()
+ {
+ return false;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public static function get_item_id($group)
+ {
+ return (int) $group['group_id'];
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public static function get_item_parent_id($group)
+ {
+ return 0;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function find_users_for_notification($group, $options = array())
+ {
+ $users = array();
+
+ $group['user_ids'] = (!is_array($group['user_ids'])) ? array($group['user_ids']) : $group['user_ids'];
+
+ foreach ($group['user_ids'] as $user_id)
+ {
+ $users[$user_id] = array('');
+ }
+
+ return $users;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_title()
+ {
+ return $this->user->lang('NOTIFICATION_GROUP_REQUEST_APPROVED', $this->get_data('group_name'));
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_url()
+ {
+ return append_sid($this->phpbb_root_path . 'memberlist.' . $this->php_ext, "mode=group&g={$this->item_id}");
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function create_insert_array($group, $pre_create_data = array())
+ {
+ $this->set_data('group_name', $group['group_name']);
+
+ return parent::create_insert_array($group, $pre_create_data);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function users_to_query()
+ {
+ return array();
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_email_template()
+ {
+ return false;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_email_template_variables()
+ {
+ return array();
+ }
+}
diff --git a/phpBB/phpbb/notification/type/pm.php b/phpBB/phpbb/notification/type/pm.php
new file mode 100644
index 0000000000..d2f34f95d0
--- /dev/null
+++ b/phpBB/phpbb/notification/type/pm.php
@@ -0,0 +1,195 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\notification\type;
+
+/**
+* Private message notifications class
+* This class handles notifications for private messages
+*/
+
+class pm extends \phpbb\notification\type\base
+{
+ /**
+ * Get notification type name
+ *
+ * @return string
+ */
+ public function get_type()
+ {
+ return 'notification.type.pm';
+ }
+
+ /**
+ * Notification option data (for outputting to the user)
+ *
+ * @var bool|array False if the service should use it's default data
+ * Array of data (including keys 'id', 'lang', and 'group')
+ */
+ public static $notification_option = array(
+ 'lang' => 'NOTIFICATION_TYPE_PM',
+ );
+
+ /**
+ * Is available
+ */
+ public function is_available()
+ {
+ return ($this->config['allow_privmsg'] && $this->auth->acl_get('u_readpm'));
+ }
+
+ /**
+ * Get the id of the
+ *
+ * @param array $pm The data from the private message
+ */
+ public static function get_item_id($pm)
+ {
+ return (int) $pm['msg_id'];
+ }
+
+ /**
+ * Get the id of the parent
+ *
+ * @param array $pm The data from the pm
+ */
+ public static function get_item_parent_id($pm)
+ {
+ // No parent
+ return 0;
+ }
+
+ /**
+ * Find the users who want to receive notifications
+ *
+ * @param array $pm Data from submit_pm
+ * @param array $options Options for finding users for notification
+ *
+ * @return array
+ */
+ public function find_users_for_notification($pm, $options = array())
+ {
+ $options = array_merge(array(
+ 'ignore_users' => array(),
+ ), $options);
+
+ if (!sizeof($pm['recipients']))
+ {
+ return array();
+ }
+
+ unset($pm['recipients'][$pm['from_user_id']]);
+
+ $this->user_loader->load_users(array_keys($pm['recipients']));
+
+ return $this->check_user_notification_options(array_keys($pm['recipients']), $options);
+ }
+
+ /**
+ * Get the user's avatar
+ */
+ public function get_avatar()
+ {
+ return $this->user_loader->get_avatar($this->get_data('from_user_id'), false, true);
+ }
+
+ /**
+ * Get the HTML formatted title of this notification
+ *
+ * @return string
+ */
+ public function get_title()
+ {
+ $username = $this->user_loader->get_username($this->get_data('from_user_id'), 'no_profile');
+
+ return $this->user->lang('NOTIFICATION_PM', $username);
+ }
+
+ /**
+ * Get the HTML formatted reference of the notification
+ *
+ * @return string
+ */
+ public function get_reference()
+ {
+ return $this->user->lang(
+ 'NOTIFICATION_REFERENCE',
+ $this->get_data('message_subject')
+ );
+ }
+
+ /**
+ * Get email template
+ *
+ * @return string|bool
+ */
+ public function get_email_template()
+ {
+ return 'privmsg_notify';
+ }
+
+ /**
+ * Get email template variables
+ *
+ * @return array
+ */
+ public function get_email_template_variables()
+ {
+ $user_data = $this->user_loader->get_user($this->get_data('from_user_id'));
+
+ return array(
+ 'AUTHOR_NAME' => htmlspecialchars_decode($user_data['username']),
+ 'SUBJECT' => htmlspecialchars_decode(censor_text($this->get_data('message_subject'))),
+
+ 'U_VIEW_MESSAGE' => generate_board_url() . '/ucp.' . $this->php_ext . "?i=pm&mode=view&p={$this->item_id}",
+ );
+ }
+
+ /**
+ * Get the url to this item
+ *
+ * @return string URL
+ */
+ public function get_url()
+ {
+ return append_sid($this->phpbb_root_path . 'ucp.' . $this->php_ext, "i=pm&amp;mode=view&amp;p={$this->item_id}");
+ }
+
+ /**
+ * Users needed to query before this notification can be displayed
+ *
+ * @return array Array of user_ids
+ */
+ public function users_to_query()
+ {
+ return array($this->get_data('from_user_id'));
+ }
+
+ /**
+ * Function for preparing the data for insertion in an SQL query
+ * (The service handles insertion)
+ *
+ * @param array $pm Data from submit_post
+ * @param array $pre_create_data Data from pre_create_insert_array()
+ *
+ * @return array Array of data ready to be inserted into the database
+ */
+ public function create_insert_array($pm, $pre_create_data = array())
+ {
+ $this->set_data('from_user_id', $pm['from_user_id']);
+
+ $this->set_data('message_subject', $pm['message_subject']);
+
+ return parent::create_insert_array($pm, $pre_create_data);
+ }
+}
diff --git a/phpBB/phpbb/notification/type/post.php b/phpBB/phpbb/notification/type/post.php
new file mode 100644
index 0000000000..2969da550d
--- /dev/null
+++ b/phpBB/phpbb/notification/type/post.php
@@ -0,0 +1,452 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\notification\type;
+
+/**
+* Post notifications class
+* This class handles notifications for replies to a topic
+*/
+
+class post extends \phpbb\notification\type\base
+{
+ /**
+ * Get notification type name
+ *
+ * @return string
+ */
+ public function get_type()
+ {
+ return 'notification.type.post';
+ }
+
+ /**
+ * Language key used to output the text
+ *
+ * @var string
+ */
+ protected $language_key = 'NOTIFICATION_POST';
+
+ /**
+ * Inherit notification read status from post.
+ *
+ * @var bool
+ */
+ protected $inherit_read_status = true;
+
+ /**
+ * Notification option data (for outputting to the user)
+ *
+ * @var bool|array False if the service should use it's default data
+ * Array of data (including keys 'id', 'lang', and 'group')
+ */
+ public static $notification_option = array(
+ 'lang' => 'NOTIFICATION_TYPE_POST',
+ 'group' => 'NOTIFICATION_GROUP_POSTING',
+ );
+
+ /**
+ * Is available
+ */
+ public function is_available()
+ {
+ return $this->config['allow_topic_notify'];
+ }
+
+ /**
+ * Get the id of the item
+ *
+ * @param array $post The data from the post
+ */
+ public static function get_item_id($post)
+ {
+ return (int) $post['post_id'];
+ }
+
+ /**
+ * Get the id of the parent
+ *
+ * @param array $post The data from the post
+ */
+ public static function get_item_parent_id($post)
+ {
+ return (int) $post['topic_id'];
+ }
+
+ /**
+ * Find the users who want to receive notifications
+ *
+ * @param array $post Data from submit_post
+ * @param array $options Options for finding users for notification
+ *
+ * @return array
+ */
+ public function find_users_for_notification($post, $options = array())
+ {
+ $options = array_merge(array(
+ 'ignore_users' => array(),
+ ), $options);
+
+ $users = array();
+
+ $sql = 'SELECT user_id
+ FROM ' . TOPICS_WATCH_TABLE . '
+ WHERE topic_id = ' . (int) $post['topic_id'] . '
+ AND notify_status = ' . NOTIFY_YES . '
+ AND user_id <> ' . (int) $post['poster_id'];
+ $result = $this->db->sql_query($sql);
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $users[] = (int) $row['user_id'];
+ }
+ $this->db->sql_freeresult($result);
+
+ $sql = 'SELECT user_id
+ FROM ' . FORUMS_WATCH_TABLE . '
+ WHERE forum_id = ' . (int) $post['forum_id'] . '
+ AND notify_status = ' . NOTIFY_YES . '
+ AND user_id <> ' . (int) $post['poster_id'];
+ $result = $this->db->sql_query($sql);
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $users[] = (int) $row['user_id'];
+ }
+ $this->db->sql_freeresult($result);
+
+ $notify_users = $this->get_authorised_recipients($users, $post['forum_id'], $options, true);
+
+ if (empty($notify_users))
+ {
+ return array();
+ }
+
+ // Try to find the users who already have been notified about replies and have not read the topic since and just update their notifications
+ $update_notifications = array();
+ $sql = 'SELECT n.*
+ FROM ' . $this->notifications_table . ' n, ' . $this->notification_types_table . ' nt
+ WHERE n.notification_type_id = ' . (int) $this->notification_type_id . '
+ AND n.item_parent_id = ' . (int) static::get_item_parent_id($post) . '
+ AND n.notification_read = 0
+ AND nt.notification_type_id = n.notification_type_id
+ AND nt.notification_type_enabled = 1';
+ $result = $this->db->sql_query($sql);
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ // Do not create a new notification
+ unset($notify_users[$row['user_id']]);
+
+ $notification = $this->notification_manager->get_item_type_class($this->get_type(), $row);
+ $update_responders = $notification->add_responders($post);
+ if (!empty($update_responders))
+ {
+ $sql = 'UPDATE ' . $this->notifications_table . '
+ SET ' . $this->db->sql_build_array('UPDATE', $update_responders) . '
+ WHERE notification_id = ' . $row['notification_id'];
+ $this->db->sql_query($sql);
+ }
+ }
+ $this->db->sql_freeresult($result);
+
+ return $notify_users;
+ }
+
+ /**
+ * Get the user's avatar
+ */
+ public function get_avatar()
+ {
+ return $this->user_loader->get_avatar($this->get_data('poster_id'), false, true);
+ }
+
+ /**
+ * Get the HTML formatted title of this notification
+ *
+ * @return string
+ */
+ public function get_title()
+ {
+ $responders = $this->get_data('responders');
+ $usernames = array();
+
+ if (!is_array($responders))
+ {
+ $responders = array();
+ }
+
+ $responders = array_merge(array(array(
+ 'poster_id' => $this->get_data('poster_id'),
+ 'username' => $this->get_data('post_username'),
+ )), $responders);
+
+ $responders_cnt = sizeof($responders);
+ $responders = $this->trim_user_ary($responders);
+ $trimmed_responders_cnt = $responders_cnt - sizeof($responders);
+
+ foreach ($responders as $responder)
+ {
+ if ($responder['username'])
+ {
+ $usernames[] = $responder['username'];
+ }
+ else
+ {
+ $usernames[] = $this->user_loader->get_username($responder['poster_id'], 'no_profile');
+ }
+ }
+
+ if ($trimmed_responders_cnt > 20)
+ {
+ $usernames[] = $this->user->lang('NOTIFICATION_MANY_OTHERS');
+ }
+ else if ($trimmed_responders_cnt)
+ {
+ $usernames[] = $this->user->lang('NOTIFICATION_X_OTHERS', $trimmed_responders_cnt);
+ }
+
+ return $this->user->lang(
+ $this->language_key,
+ phpbb_generate_string_list($usernames, $this->user),
+ $responders_cnt
+ );
+ }
+
+ /**
+ * Get the HTML formatted reference of the notification
+ *
+ * @return string
+ */
+ public function get_reference()
+ {
+ return $this->user->lang(
+ 'NOTIFICATION_REFERENCE',
+ censor_text($this->get_data('topic_title'))
+ );
+ }
+
+ /**
+ * Get email template
+ *
+ * @return string|bool
+ */
+ public function get_email_template()
+ {
+ return 'topic_notify';
+ }
+
+ /**
+ * Get email template variables
+ *
+ * @return array
+ */
+ public function get_email_template_variables()
+ {
+ if ($this->get_data('post_username'))
+ {
+ $username = $this->get_data('post_username');
+ }
+ else
+ {
+ $username = $this->user_loader->get_username($this->get_data('poster_id'), 'username');
+ }
+
+ return array(
+ 'AUTHOR_NAME' => htmlspecialchars_decode($username),
+ 'POST_SUBJECT' => htmlspecialchars_decode(censor_text($this->get_data('post_subject'))),
+ 'TOPIC_TITLE' => htmlspecialchars_decode(censor_text($this->get_data('topic_title'))),
+
+ 'U_VIEW_POST' => generate_board_url() . "/viewtopic.{$this->php_ext}?p={$this->item_id}#p{$this->item_id}",
+ 'U_NEWEST_POST' => generate_board_url() . "/viewtopic.{$this->php_ext}?f={$this->get_data('forum_id')}&t={$this->item_parent_id}&e=1&view=unread#unread",
+ 'U_TOPIC' => generate_board_url() . "/viewtopic.{$this->php_ext}?f={$this->get_data('forum_id')}&t={$this->item_parent_id}",
+ 'U_VIEW_TOPIC' => generate_board_url() . "/viewtopic.{$this->php_ext}?f={$this->get_data('forum_id')}&t={$this->item_parent_id}",
+ 'U_FORUM' => generate_board_url() . "/viewforum.{$this->php_ext}?f={$this->get_data('forum_id')}",
+ 'U_STOP_WATCHING_TOPIC' => generate_board_url() . "/viewtopic.{$this->php_ext}?uid={$this->user_id}&f={$this->get_data('forum_id')}&t={$this->item_parent_id}&unwatch=topic",
+ );
+ }
+
+ /**
+ * Get the url to this item
+ *
+ * @return string URL
+ */
+ public function get_url()
+ {
+ return append_sid($this->phpbb_root_path . 'viewtopic.' . $this->php_ext, "p={$this->item_id}#p{$this->item_id}");
+ }
+
+ /**
+ * {inheritDoc}
+ */
+ public function get_redirect_url()
+ {
+ return append_sid($this->phpbb_root_path . 'viewtopic.' . $this->php_ext, "t={$this->item_parent_id}&amp;view=unread#unread");
+ }
+
+ /**
+ * Users needed to query before this notification can be displayed
+ *
+ * @return array Array of user_ids
+ */
+ public function users_to_query()
+ {
+ $responders = $this->get_data('responders');
+ $users = array(
+ $this->get_data('poster_id'),
+ );
+
+ if (is_array($responders))
+ {
+ foreach ($responders as $responder)
+ {
+ $users[] = $responder['poster_id'];
+ }
+ }
+
+ return $this->trim_user_ary($users);
+ }
+
+ /**
+ * Trim the user array passed down to 3 users if the array contains
+ * more than 4 users.
+ *
+ * @param array $users Array of users
+ * @return array Trimmed array of user_ids
+ */
+ public function trim_user_ary($users)
+ {
+ if (sizeof($users) > 4)
+ {
+ array_splice($users, 3);
+ }
+ return $users;
+ }
+
+ /**
+ * Pre create insert array function
+ * This allows you to perform certain actions, like run a query
+ * and load data, before create_insert_array() is run. The data
+ * returned from this function will be sent to create_insert_array().
+ *
+ * @param array $post Post data from submit_post
+ * @param array $notify_users Notify users list
+ * Formated from find_users_for_notification()
+ * @return array Whatever you want to send to create_insert_array().
+ */
+ public function pre_create_insert_array($post, $notify_users)
+ {
+ if (!sizeof($notify_users) || !$this->inherit_read_status)
+ {
+ return array();
+ }
+
+ $tracking_data = array();
+ $sql = 'SELECT user_id, mark_time FROM ' . TOPICS_TRACK_TABLE . '
+ WHERE topic_id = ' . (int) $post['topic_id'] . '
+ AND ' . $this->db->sql_in_set('user_id', array_keys($notify_users));
+ $result = $this->db->sql_query($sql);
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $tracking_data[$row['user_id']] = $row['mark_time'];
+ }
+ $this->db->sql_freeresult($result);
+
+ return $tracking_data;
+ }
+
+ /**
+ * Function for preparing the data for insertion in an SQL query
+ * (The service handles insertion)
+ *
+ * @param array $post Data from submit_post
+ * @param array $pre_create_data Data from pre_create_insert_array()
+ *
+ * @return array Array of data ready to be inserted into the database
+ */
+ public function create_insert_array($post, $pre_create_data = array())
+ {
+ $this->set_data('poster_id', $post['poster_id']);
+
+ $this->set_data('topic_title', $post['topic_title']);
+
+ $this->set_data('post_subject', $post['post_subject']);
+
+ $this->set_data('post_username', (($post['poster_id'] == ANONYMOUS) ? $post['post_username'] : ''));
+
+ $this->set_data('forum_id', $post['forum_id']);
+
+ $this->set_data('forum_name', $post['forum_name']);
+
+ $this->notification_time = $post['post_time'];
+
+ // Topics can be "read" before they are public (while awaiting approval).
+ // Make sure that if the user has read the topic, it's marked as read in the notification
+ if ($this->inherit_read_status && isset($pre_create_data[$this->user_id]) && $pre_create_data[$this->user_id] >= $this->notification_time)
+ {
+ $this->notification_read = true;
+ }
+
+ return parent::create_insert_array($post, $pre_create_data);
+ }
+
+ /**
+ * Add responders to the notification
+ *
+ * @param mixed $post
+ */
+ public function add_responders($post)
+ {
+ // Do not add them as a responder if they were the original poster that created the notification
+ if ($this->get_data('poster_id') == $post['poster_id'])
+ {
+ return array();
+ }
+
+ $responders = $this->get_data('responders');
+
+ $responders = ($responders === null) ? array() : $responders;
+
+ // Do not add more than 25 responders,
+ // we trim the username list to "a, b, c and x others" anyway
+ // so there is no use to add all of them anyway.
+ if (sizeof($responders) > 25)
+ {
+ return array();
+ }
+
+ foreach ($responders as $responder)
+ {
+ // Do not add them as a responder multiple times
+ if ($responder['poster_id'] == $post['poster_id'])
+ {
+ return array();
+ }
+ }
+
+ $responders[] = array(
+ 'poster_id' => $post['poster_id'],
+ 'username' => (($post['poster_id'] == ANONYMOUS) ? $post['post_username'] : ''),
+ );
+
+ $this->set_data('responders', $responders);
+
+ $serialized_data = serialize($this->get_data(false));
+
+ // If the data is longer then 4000 characters, it would cause a SQL error.
+ // We don't add the username to the list if this is the case.
+ if (utf8_strlen($serialized_data) >= 4000)
+ {
+ return array();
+ }
+
+ return array('notification_data' => $serialized_data);
+ }
+}
diff --git a/phpBB/phpbb/notification/type/post_in_queue.php b/phpBB/phpbb/notification/type/post_in_queue.php
new file mode 100644
index 0000000000..5832c99cd2
--- /dev/null
+++ b/phpBB/phpbb/notification/type/post_in_queue.php
@@ -0,0 +1,160 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\notification\type;
+
+/**
+* Post in queue notifications class
+* This class handles notifications for posts that are put in the moderation queue (for moderators)
+*/
+
+class post_in_queue extends \phpbb\notification\type\post
+{
+ /**
+ * Get notification type name
+ *
+ * @return string
+ */
+ public function get_type()
+ {
+ return 'notification.type.post_in_queue';
+ }
+
+ /**
+ * Language key used to output the text
+ *
+ * @var string
+ */
+ protected $language_key = 'NOTIFICATION_POST_IN_QUEUE';
+
+ /**
+ * Notification option data (for outputting to the user)
+ *
+ * @var bool|array False if the service should use it's default data
+ * Array of data (including keys 'id', 'lang', and 'group')
+ */
+ public static $notification_option = array(
+ 'id' => 'notification.type.needs_approval',
+ 'lang' => 'NOTIFICATION_TYPE_IN_MODERATION_QUEUE',
+ 'group' => 'NOTIFICATION_GROUP_MODERATION',
+ );
+
+ /**
+ * Permission to check for (in find_users_for_notification)
+ *
+ * @var string Permission name
+ */
+ protected $permission = 'm_approve';
+
+ /**
+ * Is available
+ */
+ public function is_available()
+ {
+ $has_permission = $this->auth->acl_getf($this->permission, true);
+
+ return (!empty($has_permission));
+ }
+
+ /**
+ * Find the users who want to receive notifications
+ *
+ * @param array $post Data from the post
+ * @param array $options Options for finding users for notification
+ *
+ * @return array
+ */
+ public function find_users_for_notification($post, $options = array())
+ {
+ $options = array_merge(array(
+ 'ignore_users' => array(),
+ ), $options);
+
+ // 0 is for global moderator permissions
+ $auth_approve = $this->auth->acl_get_list(false, $this->permission, array($post['forum_id'], 0));
+
+ if (empty($auth_approve))
+ {
+ return array();
+ }
+
+ $has_permission = array();
+
+ if (isset($auth_approve[$post['forum_id']][$this->permission]))
+ {
+ $has_permission = $auth_approve[$post['forum_id']][$this->permission];
+ }
+
+ if (isset($auth_approve[0][$this->permission]))
+ {
+ $has_permission = array_unique(array_merge($has_permission, $auth_approve[0][$this->permission]));
+ }
+ sort($has_permission);
+
+ $auth_read = $this->auth->acl_get_list($has_permission, 'f_read', $post['forum_id']);
+ if (empty($auth_read))
+ {
+ return array();
+ }
+
+ return $this->check_user_notification_options($auth_read[$post['forum_id']]['f_read'], array_merge($options, array(
+ 'item_type' => static::$notification_option['id'],
+ )));
+ }
+
+ /**
+ * Get the url to this item
+ *
+ * @return string URL
+ */
+ public function get_url()
+ {
+ return append_sid($this->phpbb_root_path . 'mcp.' . $this->php_ext, "i=queue&amp;mode=approve_details&amp;f={$this->get_data('forum_id')}&amp;p={$this->item_id}");
+ }
+
+ /**
+ * {inheritDoc}
+ */
+ public function get_redirect_url()
+ {
+ return parent::get_url();
+ }
+
+ /**
+ * Function for preparing the data for insertion in an SQL query
+ * (The service handles insertion)
+ *
+ * @param array $post Data from submit_post
+ * @param array $pre_create_data Data from pre_create_insert_array()
+ *
+ * @return array Array of data ready to be inserted into the database
+ */
+ public function create_insert_array($post, $pre_create_data = array())
+ {
+ $data = parent::create_insert_array($post, $pre_create_data);
+
+ $this->notification_time = $data['notification_time'] = time();
+
+ return $data;
+ }
+
+ /**
+ * Get email template
+ *
+ * @return string|bool
+ */
+ public function get_email_template()
+ {
+ return 'post_in_queue';
+ }
+}
diff --git a/phpBB/phpbb/notification/type/quote.php b/phpBB/phpbb/notification/type/quote.php
new file mode 100644
index 0000000000..2732cb84e4
--- /dev/null
+++ b/phpBB/phpbb/notification/type/quote.php
@@ -0,0 +1,190 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\notification\type;
+
+/**
+* Post quoting notifications class
+* This class handles notifying users when they have been quoted in a post
+*/
+
+class quote extends \phpbb\notification\type\post
+{
+ /**
+ * Get notification type name
+ *
+ * @return string
+ */
+ public function get_type()
+ {
+ return 'notification.type.quote';
+ }
+
+ /**
+ * regular expression to match to find usernames
+ *
+ * @var string
+ */
+ protected static $regular_expression_match = '#\[quote=&quot;(.+?)&quot;#';
+
+ /**
+ * Language key used to output the text
+ *
+ * @var string
+ */
+ protected $language_key = 'NOTIFICATION_QUOTE';
+
+ /**
+ * Notification option data (for outputting to the user)
+ *
+ * @var bool|array False if the service should use it's default data
+ * Array of data (including keys 'id', 'lang', and 'group')
+ */
+ public static $notification_option = array(
+ 'lang' => 'NOTIFICATION_TYPE_QUOTE',
+ 'group' => 'NOTIFICATION_GROUP_POSTING',
+ );
+
+ /**
+ * Is available
+ */
+ public function is_available()
+ {
+ return true;
+ }
+
+ /**
+ * Find the users who want to receive notifications
+ *
+ * @param array $post Data from submit_post
+ * @param array $options Options for finding users for notification
+ *
+ * @return array
+ */
+ public function find_users_for_notification($post, $options = array())
+ {
+ $options = array_merge(array(
+ 'ignore_users' => array(),
+ ), $options);
+
+ $usernames = false;
+ preg_match_all(static::$regular_expression_match, $post['post_text'], $usernames);
+
+ if (empty($usernames[1]))
+ {
+ return array();
+ }
+
+ $usernames[1] = array_unique($usernames[1]);
+
+ $usernames = array_map('utf8_clean_string', $usernames[1]);
+
+ $users = array();
+
+ $sql = 'SELECT user_id
+ FROM ' . USERS_TABLE . '
+ WHERE ' . $this->db->sql_in_set('username_clean', $usernames) . '
+ AND user_id <> ' . (int) $post['poster_id'];
+ $result = $this->db->sql_query($sql);
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $users[] = (int) $row['user_id'];
+ }
+ $this->db->sql_freeresult($result);
+
+ return $this->get_authorised_recipients($users, $post['forum_id'], $options, true);
+ }
+
+ /**
+ * Update a notification
+ *
+ * @param array $post Data specific for this type that will be updated
+ */
+ public function update_notifications($post)
+ {
+ $old_notifications = array();
+ $sql = 'SELECT n.user_id
+ FROM ' . $this->notifications_table . ' n, ' . $this->notification_types_table . ' nt
+ WHERE n.notification_type_id = ' . (int) $this->notification_type_id . '
+ AND n.item_id = ' . static::get_item_id($post) . '
+ AND nt.notification_type_id = n.notification_type_id
+ AND nt.notification_type_enabled = 1';
+ $result = $this->db->sql_query($sql);
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $old_notifications[] = $row['user_id'];
+ }
+ $this->db->sql_freeresult($result);
+
+ // Find the new users to notify
+ $notifications = $this->find_users_for_notification($post);
+
+ // Find the notifications we must delete
+ $remove_notifications = array_diff($old_notifications, array_keys($notifications));
+
+ // Find the notifications we must add
+ $add_notifications = array();
+ foreach (array_diff(array_keys($notifications), $old_notifications) as $user_id)
+ {
+ $add_notifications[$user_id] = $notifications[$user_id];
+ }
+
+ // Add the necessary notifications
+ $this->notification_manager->add_notifications_for_users($this->get_type(), $post, $add_notifications);
+
+ // Remove the necessary notifications
+ if (!empty($remove_notifications))
+ {
+ $sql = 'DELETE FROM ' . $this->notifications_table . '
+ WHERE notification_type_id = ' . (int) $this->notification_type_id . '
+ AND item_id = ' . static::get_item_id($post) . '
+ AND ' . $this->db->sql_in_set('user_id', $remove_notifications);
+ $this->db->sql_query($sql);
+ }
+
+ // return true to continue with the update code in the notifications service (this will update the rest of the notifications)
+ return true;
+ }
+
+ /**
+ * {inheritDoc}
+ */
+ public function get_redirect_url()
+ {
+ return $this->get_url();
+ }
+
+ /**
+ * Get email template
+ *
+ * @return string|bool
+ */
+ public function get_email_template()
+ {
+ return 'quote';
+ }
+
+ /**
+ * Get email template variables
+ *
+ * @return array
+ */
+ public function get_email_template_variables()
+ {
+ $user_data = $this->user_loader->get_user($this->get_data('poster_id'));
+
+ return array_merge(parent::get_email_template_variables(), array(
+ 'AUTHOR_NAME' => htmlspecialchars_decode($user_data['username']),
+ ));
+ }
+}
diff --git a/phpBB/phpbb/notification/type/report_pm.php b/phpBB/phpbb/notification/type/report_pm.php
new file mode 100644
index 0000000000..fc39623c5c
--- /dev/null
+++ b/phpBB/phpbb/notification/type/report_pm.php
@@ -0,0 +1,259 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\notification\type;
+
+/**
+* Private message reported notifications class
+* This class handles notifications for private messages when they are reported
+*/
+
+class report_pm extends \phpbb\notification\type\pm
+{
+ /**
+ * Get notification type name
+ *
+ * @return string
+ */
+ public function get_type()
+ {
+ return 'notification.type.report_pm';
+ }
+
+ /**
+ * Get the CSS style class of the notification
+ *
+ * @return string
+ */
+ public function get_style_class()
+ {
+ return 'notification-reported';
+ }
+
+ /**
+ * Language key used to output the text
+ *
+ * @var string
+ */
+ protected $language_key = 'NOTIFICATION_REPORT_PM';
+
+ /**
+ * Permission to check for (in find_users_for_notification)
+ *
+ * @var string Permission name
+ */
+ protected $permission = 'm_pm_report';
+
+ /**
+ * Notification option data (for outputting to the user)
+ *
+ * @var bool|array False if the service should use it's default data
+ * Array of data (including keys 'id', 'lang', and 'group')
+ */
+ public static $notification_option = array(
+ 'id' => 'notification.type.report',
+ 'lang' => 'NOTIFICATION_TYPE_REPORT',
+ 'group' => 'NOTIFICATION_GROUP_MODERATION',
+ );
+
+ /**
+ * Get the id of the parent
+ *
+ * @param array $pm The data from the pm
+ */
+ public static function get_item_parent_id($pm)
+ {
+ return (int) $pm['report_id'];
+ }
+
+ /**
+ * Is this type available to the current user (defines whether or not it will be shown in the UCP Edit notification options)
+ *
+ * @return bool True/False whether or not this is available to the user
+ */
+ public function is_available()
+ {
+ $m_approve = $this->auth->acl_getf($this->permission, true);
+
+ return (!empty($m_approve));
+ }
+
+
+ /**
+ * Find the users who want to receive notifications
+ * (copied from post_in_queue)
+ *
+ * @param array $post Data from the post
+ * @param array $options Options for finding users for notification
+ *
+ * @return array
+ */
+ public function find_users_for_notification($post, $options = array())
+ {
+ $options = array_merge(array(
+ 'ignore_users' => array(),
+ ), $options);
+
+ // Global
+ $post['forum_id'] = 0;
+
+ $auth_approve = $this->auth->acl_get_list(false, $this->permission, $post['forum_id']);
+
+ if (empty($auth_approve))
+ {
+ return array();
+ }
+
+ if (($key = array_search($this->user->data['user_id'], $auth_approve[$post['forum_id']][$this->permission])))
+ {
+ unset($auth_approve[$post['forum_id']][$this->permission][$key]);
+ }
+
+ return $this->check_user_notification_options($auth_approve[$post['forum_id']][$this->permission], array_merge($options, array(
+ 'item_type' => static::$notification_option['id'],
+ )));
+ }
+
+ /**
+ * Get email template
+ *
+ * @return string|bool
+ */
+ public function get_email_template()
+ {
+ return 'report_pm';
+ }
+
+ /**
+ * Get email template variables
+ *
+ * @return array
+ */
+ public function get_email_template_variables()
+ {
+ $user_data = $this->user_loader->get_user($this->get_data('reporter_id'));
+
+ return array(
+ 'AUTHOR_NAME' => htmlspecialchars_decode($user_data['username']),
+ 'SUBJECT' => htmlspecialchars_decode(censor_text($this->get_data('message_subject'))),
+
+ 'U_VIEW_REPORT' => generate_board_url() . "mcp.{$this->php_ext}?r={$this->item_parent_id}&amp;i=pm_reports&amp;mode=pm_report_details",
+ );
+ }
+
+ /**
+ * Get the url to this item
+ *
+ * @return string URL
+ */
+ public function get_url()
+ {
+ return append_sid($this->phpbb_root_path . 'mcp.' . $this->php_ext, "r={$this->item_parent_id}&amp;i=pm_reports&amp;mode=pm_report_details");
+ }
+
+ /**
+ * Get the HTML formatted title of this notification
+ *
+ * @return string
+ */
+ public function get_title()
+ {
+ $this->user->add_lang('mcp');
+
+ $username = $this->user_loader->get_username($this->get_data('reporter_id'), 'no_profile');
+
+ return $this->user->lang(
+ $this->language_key,
+ $username
+ );
+ }
+
+ /**
+ * Get the HTML formatted reference of the notification
+ *
+ * @return string
+ */
+ public function get_reference()
+ {
+ return $this->user->lang(
+ 'NOTIFICATION_REFERENCE',
+ censor_text($this->get_data('message_subject'))
+ );
+ }
+
+ /**
+ * Get the reason for the notification
+ *
+ * @return string
+ */
+ public function get_reason()
+ {
+ if ($this->get_data('report_text'))
+ {
+ return $this->user->lang(
+ 'NOTIFICATION_REASON',
+ $this->get_data('report_text')
+ );
+ }
+
+ if (isset($this->user->lang[$this->get_data('reason_title')]))
+ {
+ return $this->user->lang(
+ 'NOTIFICATION_REASON',
+ $this->user->lang[$this->get_data('reason_title')]
+ );
+ }
+
+ return $this->user->lang(
+ 'NOTIFICATION_REASON',
+ $this->get_data('reason_description')
+ );
+ }
+
+ /**
+ * Get the user's avatar
+ */
+ public function get_avatar()
+ {
+ return $this->user_loader->get_avatar($this->get_data('reporter_id'), false, true);
+ }
+
+ /**
+ * Users needed to query before this notification can be displayed
+ *
+ * @return array Array of user_ids
+ */
+ public function users_to_query()
+ {
+ return array($this->get_data('reporter_id'));
+ }
+
+ /**
+ * Function for preparing the data for insertion in an SQL query
+ * (The service handles insertion)
+ *
+ * @param array $post Data from submit_post
+ * @param array $pre_create_data Data from pre_create_insert_array()
+ *
+ * @return array Array of data ready to be inserted into the database
+ */
+ public function create_insert_array($post, $pre_create_data = array())
+ {
+ $this->set_data('reporter_id', $this->user->data['user_id']);
+ $this->set_data('reason_title', strtoupper($post['reason_title']));
+ $this->set_data('reason_description', $post['reason_description']);
+ $this->set_data('report_text', $post['report_text']);
+
+ return parent::create_insert_array($post, $pre_create_data);
+ }
+}
diff --git a/phpBB/phpbb/notification/type/report_pm_closed.php b/phpBB/phpbb/notification/type/report_pm_closed.php
new file mode 100644
index 0000000000..1c99db60c3
--- /dev/null
+++ b/phpBB/phpbb/notification/type/report_pm_closed.php
@@ -0,0 +1,165 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\notification\type;
+
+/**
+* PM report closed notifications class
+* This class handles notifications for when reports are closed on PMs (for the one who reported the PM)
+*/
+
+class report_pm_closed extends \phpbb\notification\type\pm
+{
+ /**
+ * Get notification type name
+ *
+ * @return string
+ */
+ public function get_type()
+ {
+ return 'notification.type.report_pm_closed';
+ }
+
+ /**
+ * Email template to use to send notifications
+ *
+ * @var string
+ */
+ public $email_template = '';
+
+ /**
+ * Language key used to output the text
+ *
+ * @var string
+ */
+ protected $language_key = 'NOTIFICATION_REPORT_CLOSED';
+
+ public function is_available()
+ {
+ return false;
+ }
+
+ /**
+ * Find the users who want to receive notifications
+ *
+ * @param array $pm Data from submit_pm
+ * @param array $options Options for finding users for notification
+ *
+ * @return array
+ */
+ public function find_users_for_notification($pm, $options = array())
+ {
+ if ($pm['reporter'] == $this->user->data['user_id'])
+ {
+ return array();
+ }
+
+ return array($pm['reporter'] => array(''));
+ }
+
+ /**
+ * Get email template
+ *
+ * @return string|bool
+ */
+ public function get_email_template()
+ {
+ return false;
+ }
+
+ /**
+ * Get email template variables
+ *
+ * @return array
+ */
+ public function get_email_template_variables()
+ {
+ return array();
+ }
+
+ /**
+ * Get the url to this item
+ *
+ * @return string URL
+ */
+ public function get_url()
+ {
+ return '';
+ }
+
+ /**
+ * Get the HTML formatted title of this notification
+ *
+ * @return string
+ */
+ public function get_title()
+ {
+ $username = $this->user_loader->get_username($this->get_data('closer_id'), 'no_profile');
+
+ return $this->user->lang(
+ $this->language_key,
+ $username
+ );
+ }
+
+ /**
+ * Get the HTML formatted reference of the notification
+ *
+ * @return string
+ */
+ public function get_reference()
+ {
+ return $this->user->lang(
+ 'NOTIFICATION_REFERENCE',
+ censor_text($this->get_data('message_subject'))
+ );
+ }
+
+ /**
+ * Get the user's avatar
+ */
+ public function get_avatar()
+ {
+ return $this->user_loader->get_avatar($this->get_data('closer_id'), false, true);
+ }
+
+ /**
+ * Users needed to query before this notification can be displayed
+ *
+ * @return array Array of user_ids
+ */
+ public function users_to_query()
+ {
+ return array($this->get_data('closer_id'));
+ }
+
+ /**
+ * Function for preparing the data for insertion in an SQL query
+ * (The service handles insertion)
+ *
+ * @param array $pm PM Data
+ * @param array $pre_create_data Data from pre_create_insert_array()
+ *
+ * @return array Array of data ready to be inserted into the database
+ */
+ public function create_insert_array($pm, $pre_create_data = array())
+ {
+ $this->set_data('closer_id', $pm['closer_id']);
+
+ $data = parent::create_insert_array($pm, $pre_create_data);
+
+ $this->notification_time = $data['notification_time'] = time();
+
+ return $data;
+ }
+}
diff --git a/phpBB/phpbb/notification/type/report_post.php b/phpBB/phpbb/notification/type/report_post.php
new file mode 100644
index 0000000000..aed31e8642
--- /dev/null
+++ b/phpBB/phpbb/notification/type/report_post.php
@@ -0,0 +1,230 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\notification\type;
+
+/**
+* Reported post notifications class
+* This class handles notifications for reported posts
+*/
+class report_post extends \phpbb\notification\type\post_in_queue
+{
+ /**
+ * Get notification type name
+ *
+ * @return string
+ */
+ public function get_type()
+ {
+ return 'notification.type.report_post';
+ }
+
+ /**
+ * Get the CSS style class of the notification
+ *
+ * @return string
+ */
+ public function get_style_class()
+ {
+ return 'notification-reported';
+ }
+
+ /**
+ * Language key used to output the text
+ *
+ * @var string
+ */
+ protected $language_key = 'NOTIFICATION_REPORT_POST';
+
+ /**
+ * Inherit notification read status from post.
+ *
+ * @var bool
+ */
+ protected $inherit_read_status = false;
+
+ /**
+ * Permission to check for (in find_users_for_notification)
+ *
+ * @var string Permission name
+ */
+ protected $permission = 'm_report';
+
+ /**
+ * Notification option data (for outputting to the user)
+ *
+ * @var bool|array False if the service should use it's default data
+ * Array of data (including keys 'id' and 'lang')
+ */
+ public static $notification_option = array(
+ 'id' => 'notification.type.report',
+ 'lang' => 'NOTIFICATION_TYPE_REPORT',
+ 'group' => 'NOTIFICATION_GROUP_MODERATION',
+ );
+
+ /**
+ * Find the users who want to receive notifications
+ *
+ * @param array $post Data from the post
+ * @param array $options Options for finding users for notification
+ *
+ * @return array
+ */
+ public function find_users_for_notification($post, $options = array())
+ {
+ $notify_users = parent::find_users_for_notification($post, $options);
+
+ // never notify reporter
+ unset($notify_users[$this->user->data['user_id']]);
+
+ return $notify_users;
+ }
+
+ /**
+ * Get email template
+ *
+ * @return string|bool
+ */
+ public function get_email_template()
+ {
+ return 'report_post';
+ }
+
+ /**
+ * Get email template variables
+ *
+ * @return array
+ */
+ public function get_email_template_variables()
+ {
+ $board_url = generate_board_url();
+
+ return array(
+ 'POST_SUBJECT' => htmlspecialchars_decode(censor_text($this->get_data('post_subject'))),
+ 'TOPIC_TITLE' => htmlspecialchars_decode(censor_text($this->get_data('topic_title'))),
+
+ 'U_VIEW_REPORT' => "{$board_url}/mcp.{$this->php_ext}?f={$this->get_data('forum_id')}&amp;p={$this->item_id}&amp;i=reports&amp;mode=report_details#reports",
+ 'U_VIEW_POST' => "{$board_url}/viewtopic.{$this->php_ext}?p={$this->item_id}#p{$this->item_id}",
+ 'U_NEWEST_POST' => "{$board_url}/viewtopic.{$this->php_ext}?f={$this->get_data('forum_id')}&t={$this->item_parent_id}&view=unread#unread",
+ 'U_TOPIC' => "{$board_url}/viewtopic.{$this->php_ext}?f={$this->get_data('forum_id')}&t={$this->item_parent_id}",
+ 'U_VIEW_TOPIC' => "{$board_url}/viewtopic.{$this->php_ext}?f={$this->get_data('forum_id')}&t={$this->item_parent_id}",
+ 'U_FORUM' => "{$board_url}/viewforum.{$this->php_ext}?f={$this->get_data('forum_id')}",
+ );
+ }
+
+ /**
+ * Get the url to this item
+ *
+ * @return string URL
+ */
+ public function get_url()
+ {
+ return append_sid($this->phpbb_root_path . 'mcp.' . $this->php_ext, "f={$this->get_data('forum_id')}&amp;p={$this->item_id}&amp;i=reports&amp;mode=report_details#reports");
+ }
+
+ /**
+ * Get the HTML formatted title of this notification
+ *
+ * @return string
+ */
+ public function get_title()
+ {
+ $this->user->add_lang('mcp');
+
+ $username = $this->user_loader->get_username($this->get_data('reporter_id'), 'no_profile');
+
+ return $this->user->lang(
+ $this->language_key,
+ $username
+ );
+ }
+
+ /**
+ * Get the HTML formatted reference of the notification
+ *
+ * @return string
+ */
+ public function get_reference()
+ {
+ return $this->user->lang(
+ 'NOTIFICATION_REFERENCE',
+ censor_text($this->get_data('post_subject'))
+ );
+ }
+
+ /**
+ * Get the reason for the notification
+ *
+ * @return string
+ */
+ public function get_reason()
+ {
+ if ($this->get_data('report_text'))
+ {
+ return $this->user->lang(
+ 'NOTIFICATION_REASON',
+ $this->get_data('report_text')
+ );
+ }
+
+ if (isset($this->user->lang[$this->get_data('reason_title')]))
+ {
+ return $this->user->lang(
+ 'NOTIFICATION_REASON',
+ $this->user->lang[$this->get_data('reason_title')]
+ );
+ }
+
+ return $this->user->lang(
+ 'NOTIFICATION_REASON',
+ $this->get_data('reason_description')
+ );
+ }
+
+ /**
+ * Get the user's avatar
+ */
+ public function get_avatar()
+ {
+ return $this->user_loader->get_avatar($this->get_data('reporter_id'), false, true);
+ }
+
+ /**
+ * Users needed to query before this notification can be displayed
+ *
+ * @return array Array of user_ids
+ */
+ public function users_to_query()
+ {
+ return array($this->get_data('reporter_id'));
+ }
+
+ /**
+ * Function for preparing the data for insertion in an SQL query
+ * (The service handles insertion)
+ *
+ * @param array $post Data from submit_post
+ * @param array $pre_create_data Data from pre_create_insert_array()
+ *
+ * @return array Array of data ready to be inserted into the database
+ */
+ public function create_insert_array($post, $pre_create_data = array())
+ {
+ $this->set_data('reporter_id', $this->user->data['user_id']);
+ $this->set_data('reason_title', strtoupper($post['reason_title']));
+ $this->set_data('reason_description', $post['reason_description']);
+ $this->set_data('report_text', $post['report_text']);
+
+ return parent::create_insert_array($post, $pre_create_data);
+ }
+}
diff --git a/phpBB/phpbb/notification/type/report_post_closed.php b/phpBB/phpbb/notification/type/report_post_closed.php
new file mode 100644
index 0000000000..3f4378628b
--- /dev/null
+++ b/phpBB/phpbb/notification/type/report_post_closed.php
@@ -0,0 +1,172 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\notification\type;
+
+/**
+* Post report closed notifications class
+* This class handles notifications for when reports are closed on posts (for the one who reported the post)
+*/
+
+class report_post_closed extends \phpbb\notification\type\post
+{
+ /**
+ * Get notification type name
+ *
+ * @return string
+ */
+ public function get_type()
+ {
+ return 'notification.type.report_post_closed';
+ }
+
+ /**
+ * Email template to use to send notifications
+ *
+ * @var string
+ */
+ public $email_template = '';
+
+ /**
+ * Language key used to output the text
+ *
+ * @var string
+ */
+ protected $language_key = 'NOTIFICATION_REPORT_CLOSED';
+
+ /**
+ * Inherit notification read status from post.
+ *
+ * @var bool
+ */
+ protected $inherit_read_status = false;
+
+ public function is_available()
+ {
+ return false;
+ }
+
+ /**
+ * Find the users who want to receive notifications
+ *
+ * @param array $post Data from submit_post
+ * @param array $options Options for finding users for notification
+ *
+ * @return array
+ */
+ public function find_users_for_notification($post, $options = array())
+ {
+ if ($post['reporter'] == $this->user->data['user_id'])
+ {
+ return array();
+ }
+
+ return array($post['reporter'] => array(''));
+ }
+
+ /**
+ * Get email template
+ *
+ * @return string|bool
+ */
+ public function get_email_template()
+ {
+ return false;
+ }
+
+ /**
+ * Get email template variables
+ *
+ * @return array
+ */
+ public function get_email_template_variables()
+ {
+ return array();
+ }
+
+ /**
+ * Get the url to this item
+ *
+ * @return string URL
+ */
+ public function get_url()
+ {
+ return '';
+ }
+
+ /**
+ * Get the HTML formatted title of this notification
+ *
+ * @return string
+ */
+ public function get_title()
+ {
+ $username = $this->user_loader->get_username($this->get_data('closer_id'), 'no_profile');
+
+ return $this->user->lang(
+ $this->language_key,
+ $username
+ );
+ }
+
+ /**
+ * Get the HTML formatted reference of the notification
+ *
+ * @return string
+ */
+ public function get_reference()
+ {
+ return $this->user->lang(
+ 'NOTIFICATION_REFERENCE',
+ censor_text($this->get_data('post_subject'))
+ );
+ }
+
+ /**
+ * Get the user's avatar
+ */
+ public function get_avatar()
+ {
+ return $this->user_loader->get_avatar($this->get_data('closer_id'), false, true);
+ }
+
+ /**
+ * Users needed to query before this notification can be displayed
+ *
+ * @return array Array of user_ids
+ */
+ public function users_to_query()
+ {
+ return array($this->get_data('closer_id'));
+ }
+
+ /**
+ * Function for preparing the data for insertion in an SQL query
+ * (The service handles insertion)
+ *
+ * @param array $post Data from submit_post
+ * @param array $pre_create_data Data from pre_create_insert_array()
+ *
+ * @return array Array of data ready to be inserted into the database
+ */
+ public function create_insert_array($post, $pre_create_data = array())
+ {
+ $this->set_data('closer_id', $post['closer_id']);
+
+ $data = parent::create_insert_array($post, $pre_create_data);
+
+ $this->notification_time = $data['notification_time'] = time();
+
+ return $data;
+ }
+}
diff --git a/phpBB/phpbb/notification/type/topic.php b/phpBB/phpbb/notification/type/topic.php
new file mode 100644
index 0000000000..fb08a9eee1
--- /dev/null
+++ b/phpBB/phpbb/notification/type/topic.php
@@ -0,0 +1,295 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\notification\type;
+
+/**
+* Topic notifications class
+* This class handles notifications for new topics
+*/
+
+class topic extends \phpbb\notification\type\base
+{
+ /**
+ * Get notification type name
+ *
+ * @return string
+ */
+ public function get_type()
+ {
+ return 'notification.type.topic';
+ }
+
+ /**
+ * Language key used to output the text
+ *
+ * @var string
+ */
+ protected $language_key = 'NOTIFICATION_TOPIC';
+
+ /**
+ * Inherit notification read status from topic.
+ *
+ * @var bool
+ */
+ protected $inherit_read_status = true;
+
+ /**
+ * Notification option data (for outputting to the user)
+ *
+ * @var bool|array False if the service should use it's default data
+ * Array of data (including keys 'id', 'lang', and 'group')
+ */
+ public static $notification_option = array(
+ 'lang' => 'NOTIFICATION_TYPE_TOPIC',
+ 'group' => 'NOTIFICATION_GROUP_POSTING',
+ );
+
+ /**
+ * Is available
+ */
+ public function is_available()
+ {
+ return $this->config['allow_forum_notify'];
+ }
+
+ /**
+ * Get the id of the item
+ *
+ * @param array $post The data from the post
+ */
+ public static function get_item_id($post)
+ {
+ return (int) $post['topic_id'];
+ }
+
+ /**
+ * Get the id of the parent
+ *
+ * @param array $post The data from the post
+ */
+ public static function get_item_parent_id($post)
+ {
+ return (int) $post['forum_id'];
+ }
+
+ /**
+ * Find the users who want to receive notifications
+ *
+ * @param array $topic Data from the topic
+ * @param array $options Options for finding users for notification
+ *
+ * @return array
+ */
+ public function find_users_for_notification($topic, $options = array())
+ {
+ $options = array_merge(array(
+ 'ignore_users' => array(),
+ ), $options);
+
+ $users = array();
+
+ $sql = 'SELECT user_id
+ FROM ' . FORUMS_WATCH_TABLE . '
+ WHERE forum_id = ' . (int) $topic['forum_id'] . '
+ AND notify_status = ' . NOTIFY_YES . '
+ AND user_id <> ' . (int) $topic['poster_id'];
+ $result = $this->db->sql_query($sql);
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $users[] = (int) $row['user_id'];
+ }
+ $this->db->sql_freeresult($result);
+
+ return $this->get_authorised_recipients($users, $topic['forum_id'], $options);
+ }
+
+ /**
+ * Get the user's avatar
+ */
+ public function get_avatar()
+ {
+ return $this->user_loader->get_avatar($this->get_data('poster_id'), false, true);
+ }
+
+ /**
+ * Get the HTML formatted title of this notification
+ *
+ * @return string
+ */
+ public function get_title()
+ {
+ if ($this->get_data('post_username'))
+ {
+ $username = $this->get_data('post_username');
+ }
+ else
+ {
+ $username = $this->user_loader->get_username($this->get_data('poster_id'), 'no_profile');
+ }
+
+ return $this->user->lang(
+ $this->language_key,
+ $username
+ );
+ }
+
+ /**
+ * Get the HTML formatted reference of the notification
+ *
+ * @return string
+ */
+ public function get_reference()
+ {
+ return $this->user->lang(
+ 'NOTIFICATION_REFERENCE',
+ censor_text($this->get_data('topic_title'))
+ );
+ }
+
+ /**
+ * Get the forum of the notification reference
+ *
+ * @return string
+ */
+ public function get_forum()
+ {
+ return $this->user->lang(
+ 'NOTIFICATION_FORUM',
+ $this->get_data('forum_name')
+ );
+ }
+
+ /**
+ * Get email template
+ *
+ * @return string|bool
+ */
+ public function get_email_template()
+ {
+ return 'newtopic_notify';
+ }
+
+ /**
+ * Get email template variables
+ *
+ * @return array
+ */
+ public function get_email_template_variables()
+ {
+ $board_url = generate_board_url();
+
+ if ($this->get_data('post_username'))
+ {
+ $username = $this->get_data('post_username');
+ }
+ else
+ {
+ $username = $this->user_loader->get_username($this->get_data('poster_id'), 'username');
+ }
+
+ return array(
+ 'AUTHOR_NAME' => htmlspecialchars_decode($username),
+ 'FORUM_NAME' => htmlspecialchars_decode($this->get_data('forum_name')),
+ 'TOPIC_TITLE' => htmlspecialchars_decode(censor_text($this->get_data('topic_title'))),
+
+ 'U_TOPIC' => "{$board_url}/viewtopic.{$this->php_ext}?f={$this->item_parent_id}&t={$this->item_id}",
+ 'U_VIEW_TOPIC' => "{$board_url}/viewtopic.{$this->php_ext}?f={$this->item_parent_id}&t={$this->item_id}",
+ 'U_FORUM' => "{$board_url}/viewforum.{$this->php_ext}?f={$this->item_parent_id}",
+ 'U_STOP_WATCHING_FORUM' => "{$board_url}/viewforum.{$this->php_ext}?uid={$this->user_id}&f={$this->item_parent_id}&unwatch=forum",
+ );
+ }
+
+ /**
+ * Get the url to this item
+ *
+ * @return string URL
+ */
+ public function get_url()
+ {
+ return append_sid($this->phpbb_root_path . 'viewtopic.' . $this->php_ext, "f={$this->item_parent_id}&amp;t={$this->item_id}");
+ }
+
+ /**
+ * Users needed to query before this notification can be displayed
+ *
+ * @return array Array of user_ids
+ */
+ public function users_to_query()
+ {
+ return array($this->get_data('poster_id'));
+ }
+
+ /**
+ * Pre create insert array function
+ * This allows you to perform certain actions, like run a query
+ * and load data, before create_insert_array() is run. The data
+ * returned from this function will be sent to create_insert_array().
+ *
+ * @param array $post Post data from submit_post
+ * @param array $notify_users Notify users list
+ * Formated from find_users_for_notification()
+ * @return array Whatever you want to send to create_insert_array().
+ */
+ public function pre_create_insert_array($post, $notify_users)
+ {
+ if (!sizeof($notify_users) || !$this->inherit_read_status)
+ {
+ return array();
+ }
+
+ $tracking_data = array();
+ $sql = 'SELECT user_id, mark_time FROM ' . TOPICS_TRACK_TABLE . '
+ WHERE topic_id = ' . (int) $post['topic_id'] . '
+ AND ' . $this->db->sql_in_set('user_id', array_keys($notify_users));
+ $result = $this->db->sql_query($sql);
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $tracking_data[$row['user_id']] = $row['mark_time'];
+ }
+ $this->db->sql_freeresult($result);
+
+ return $tracking_data;
+ }
+
+ /**
+ * Function for preparing the data for insertion in an SQL query
+ * (The service handles insertion)
+ *
+ * @param array $post Data from submit_post
+ * @param array $pre_create_data Data from pre_create_insert_array()
+ *
+ * @return array Array of data ready to be inserted into the database
+ */
+ public function create_insert_array($post, $pre_create_data = array())
+ {
+ $this->set_data('poster_id', $post['poster_id']);
+
+ $this->set_data('topic_title', $post['topic_title']);
+
+ $this->set_data('post_username', (($post['poster_id'] == ANONYMOUS) ? $post['post_username'] : ''));
+
+ $this->set_data('forum_name', $post['forum_name']);
+
+ $this->notification_time = $post['post_time'];
+
+ // Topics can be "read" before they are public (while awaiting approval).
+ // Make sure that if the user has read the topic, it's marked as read in the notification
+ if ($this->inherit_read_status && isset($pre_create_data[$this->user_id]) && $pre_create_data[$this->user_id] >= $this->notification_time)
+ {
+ $this->notification_read = true;
+ }
+
+ return parent::create_insert_array($post, $pre_create_data);
+ }
+}
diff --git a/phpBB/phpbb/notification/type/topic_in_queue.php b/phpBB/phpbb/notification/type/topic_in_queue.php
new file mode 100644
index 0000000000..6e57b9ac0c
--- /dev/null
+++ b/phpBB/phpbb/notification/type/topic_in_queue.php
@@ -0,0 +1,152 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\notification\type;
+
+/**
+* Topic in queue notifications class
+* This class handles notifications for topics when they are put in the moderation queue (for moderators)
+*/
+
+class topic_in_queue extends \phpbb\notification\type\topic
+{
+ /**
+ * Get notification type name
+ *
+ * @return string
+ */
+ public function get_type()
+ {
+ return 'notification.type.topic_in_queue';
+ }
+
+ /**
+ * Language key used to output the text
+ *
+ * @var string
+ */
+ protected $language_key = 'NOTIFICATION_TOPIC_IN_QUEUE';
+
+ /**
+ * Notification option data (for outputting to the user)
+ *
+ * @var bool|array False if the service should use it's default data
+ * Array of data (including keys 'id', 'lang', and 'group')
+ */
+ public static $notification_option = array(
+ 'id' => 'notification.type.needs_approval',
+ 'lang' => 'NOTIFICATION_TYPE_IN_MODERATION_QUEUE',
+ 'group' => 'NOTIFICATION_GROUP_MODERATION',
+ );
+
+ /**
+ * Permission to check for (in find_users_for_notification)
+ *
+ * @var string Permission name
+ */
+ protected $permission = 'm_approve';
+
+ /**
+ * Is available
+ */
+ public function is_available()
+ {
+ $has_permission = $this->auth->acl_getf($this->permission, true);
+
+ return (!empty($has_permission));
+ }
+
+ /**
+ * Find the users who want to receive notifications
+ *
+ * @param array $topic Data from the topic
+ * @param array $options Options for finding users for notification
+ *
+ * @return array
+ */
+ public function find_users_for_notification($topic, $options = array())
+ {
+ $options = array_merge(array(
+ 'ignore_users' => array(),
+ ), $options);
+
+ // 0 is for global moderator permissions
+ $auth_approve = $this->auth->acl_get_list(false, 'm_approve', array($topic['forum_id'], 0));
+
+ if (empty($auth_approve))
+ {
+ return array();
+ }
+
+ $has_permission = array();
+
+ if (isset($auth_approve[$topic['forum_id']][$this->permission]))
+ {
+ $has_permission = $auth_approve[$topic['forum_id']][$this->permission];
+ }
+
+ if (isset($auth_approve[0][$this->permission]))
+ {
+ $has_permission = array_unique(array_merge($has_permission, $auth_approve[0][$this->permission]));
+ }
+ sort($has_permission);
+
+ $auth_read = $this->auth->acl_get_list($has_permission, 'f_read', $topic['forum_id']);
+ if (empty($auth_read))
+ {
+ return array();
+ }
+
+ return $this->check_user_notification_options($auth_read[$topic['forum_id']]['f_read'], array_merge($options, array(
+ 'item_type' => static::$notification_option['id'],
+ )));
+ }
+
+ /**
+ * Get the url to this item
+ *
+ * @return string URL
+ */
+ public function get_url()
+ {
+ return append_sid($this->phpbb_root_path . 'mcp.' . $this->php_ext, "i=queue&amp;mode=approve_details&amp;f={$this->item_parent_id}&amp;t={$this->item_id}");
+ }
+
+ /**
+ * Function for preparing the data for insertion in an SQL query
+ * (The service handles insertion)
+ *
+ * @param array $topic Data from submit_post
+ * @param array $pre_create_data Data from pre_create_insert_array()
+ *
+ * @return array Array of data ready to be inserted into the database
+ */
+ public function create_insert_array($topic, $pre_create_data = array())
+ {
+ $data = parent::create_insert_array($topic, $pre_create_data);
+
+ $this->notification_time = $data['notification_time'] = time();
+
+ return $data;
+ }
+
+ /**
+ * Get email template
+ *
+ * @return string|bool
+ */
+ public function get_email_template()
+ {
+ return 'topic_in_queue';
+ }
+}
diff --git a/phpBB/phpbb/notification/type/type_interface.php b/phpBB/phpbb/notification/type/type_interface.php
new file mode 100644
index 0000000000..5c5a110836
--- /dev/null
+++ b/phpBB/phpbb/notification/type/type_interface.php
@@ -0,0 +1,214 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\notification\type;
+
+/**
+* Base notifications interface
+*/
+interface type_interface
+{
+ /**
+ * Get notification type name
+ *
+ * @return string
+ */
+ public function get_type();
+
+ /**
+ * Set initial data from the database
+ *
+ * @param array $data Row directly from the database
+ */
+ public function set_initial_data($data);
+
+ /**
+ * Get the id of the item
+ *
+ * @param array $type_data The type specific data
+ */
+ public static function get_item_id($type_data);
+
+ /**
+ * Get the id of the parent
+ *
+ * @param array $type_data The type specific data
+ */
+ public static function get_item_parent_id($type_data);
+
+ /**
+ * Is this type available to the current user (defines whether or not it will be shown in the UCP Edit notification options)
+ *
+ * @return bool True/False whether or not this is available to the user
+ */
+ public function is_available();
+
+ /**
+ * Find the users who want to receive notifications
+ *
+ * @param array $type_data The type specific data
+ * @param array $options Options for finding users for notification
+ * ignore_users => array of users and user types that should not receive notifications from this type because they've already been notified
+ * e.g.: array(2 => array(''), 3 => array('', 'email'), ...)
+ *
+ * @return array
+ */
+ public function find_users_for_notification($type_data, $options);
+
+ /**
+ * Users needed to query before this notification can be displayed
+ *
+ * @return array Array of user_ids
+ */
+ public function users_to_query();
+
+ /**
+ * Get the special items to load
+ *
+ * @return array Data will be combined sent to load_special() so you can run a single query and get data required for this notification type
+ */
+ public function get_load_special();
+
+ /**
+ * Load the special items
+ *
+ * @param array $data Data from get_load_special()
+ * @param array $notifications Array of notifications (key is notification_id, value is the notification objects)
+ */
+ public function load_special($data, $notifications);
+
+ /**
+ * Get the CSS style class of the notification
+ *
+ * @return string
+ */
+ public function get_style_class();
+
+ /**
+ * Get the HTML formatted title of this notification
+ *
+ * @return string
+ */
+ public function get_title();
+
+ /**
+ * Get the HTML formatted reference of the notification
+ *
+ * @return string
+ */
+ public function get_reference();
+
+ /**
+ * Get the forum of the notification reference
+ *
+ * @return string
+ */
+ public function get_forum();
+
+ /**
+ * Get the url to this item
+ *
+ * @return string URL
+ */
+ public function get_url();
+
+ /**
+ * Get the url to redirect after the item has been marked as read
+ *
+ * @return string URL
+ */
+ public function get_redirect_url();
+
+ /**
+ * URL to unsubscribe to this notification
+ *
+ * @param string|bool $method Method name to unsubscribe from (email|jabber|etc), False to unsubscribe from all notifications for this item
+ */
+ public function get_unsubscribe_url($method);
+
+ /**
+ * Get the user's avatar (the user who caused the notification typically)
+ *
+ * @return string
+ */
+ public function get_avatar();
+
+ /**
+ * Prepare to output the notification to the template
+ */
+ public function prepare_for_display();
+
+ /**
+ * Get email template
+ *
+ * @return string|bool
+ */
+ public function get_email_template();
+
+ /**
+ * Get email template variables
+ *
+ * @return array
+ */
+ public function get_email_template_variables();
+
+ /**
+ * Pre create insert array function
+ * This allows you to perform certain actions, like run a query
+ * and load data, before create_insert_array() is run. The data
+ * returned from this function will be sent to create_insert_array().
+ *
+ * @param array $type_data The type specific data
+ * @param array $notify_users Notify users list
+ * Formated from find_users_for_notification()
+ * @return array Whatever you want to send to create_insert_array().
+ */
+ public function pre_create_insert_array($type_data, $notify_users);
+
+ /**
+ * Function for preparing the data for insertion in an SQL query
+ * (The service handles insertion)
+ *
+ * @param array $type_data The type specific data
+ * @param array $pre_create_data Data from pre_create_insert_array()
+ *
+ * @return array Array of data ready to be inserted into the database
+ */
+ public function create_insert_array($type_data, $pre_create_data);
+
+ /**
+ * Function for preparing the data for update in an SQL query
+ * (The service handles insertion)
+ *
+ * @param array $type_data Data unique to this notification type
+ *
+ * @return array Array of data ready to be updated in the database
+ */
+ public function create_update_array($type_data);
+
+ /**
+ * Mark this item read
+ *
+ * @param bool $return True to return a string containing the SQL code to update this item, False to execute it (Default: False)
+ * @return string
+ */
+ public function mark_read($return);
+
+ /**
+ * Mark this item unread
+ *
+ * @param bool $return True to return a string containing the SQL code to update this item, False to execute it (Default: False)
+ * @return string
+ */
+ public function mark_unread($return);
+}
diff --git a/phpBB/phpbb/pagination.php b/phpBB/phpbb/pagination.php
new file mode 100644
index 0000000000..7a81c25ad2
--- /dev/null
+++ b/phpBB/phpbb/pagination.php
@@ -0,0 +1,357 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb;
+
+class pagination
+{
+ /** @var \phpbb\template\template */
+ protected $template;
+
+ /** @var \phpbb\user */
+ protected $user;
+
+ /** @var \phpbb\controller\helper */
+ protected $helper;
+
+ /** @var \phpbb\event\dispatcher_interface */
+ protected $phpbb_dispatcher;
+
+ /**
+ * Constructor
+ *
+ * @param \phpbb\template\template $template
+ * @param \phpbb\user $user
+ * @param \phpbb\controller\helper $helper
+ * @param \phpbb\event\dispatcher_interface $phpbb_dispatcher
+ */
+ public function __construct(\phpbb\template\template $template, \phpbb\user $user, \phpbb\controller\helper $helper, \phpbb\event\dispatcher_interface $phpbb_dispatcher)
+ {
+ $this->template = $template;
+ $this->user = $user;
+ $this->helper = $helper;
+ $this->phpbb_dispatcher = $phpbb_dispatcher;
+ }
+
+ /**
+ * Generate a pagination link based on the url and the page information
+ *
+ * @param string $base_url is url prepended to all links generated within the function
+ * If you use page numbers inside your controller route, base_url should contains a placeholder (%d)
+ * for the page. Also be sure to specify the pagination path information into the start_name argument
+ * @param string $on_page is the page for which we want to generate the link
+ * @param string $start_name is the name of the parameter containing the first item of the given page (example: start=20)
+ * If you use page numbers inside your controller route, start name should be the string
+ * that should be removed for the first page (example: /page/%d)
+ * @param int $per_page the number of items, posts, etc. to display per page, used to determine the number of pages to produce
+ * @return string URL for the requested page
+ */
+ protected function generate_page_link($base_url, $on_page, $start_name, $per_page)
+ {
+ // A listener can set this variable to the new pagination URL
+ // to override the generate_page_link() function generated value
+ $generate_page_link_override = false;
+
+ /**
+ * Execute code and/or override generate_page_link()
+ *
+ * To override the generate_page_link() function generated value
+ * set $generate_page_link_override to the new URL value
+ *
+ * @event core.pagination_generate_page_link
+ * @var string base_url is url prepended to all links generated within the function
+ * If you use page numbers inside your controller route, base_url should contains a placeholder (%d)
+ * for the page. Also be sure to specify the pagination path information into the start_name argument
+ * @var string on_page is the page for which we want to generate the link
+ * @var string start_name is the name of the parameter containing the first item of the given page (example: start=20)
+ * If you use page numbers inside your controller route, start name should be the string
+ * that should be removed for the first page (example: /page/%d)
+ * @var int per_page the number of items, posts, etc. to display per page, used to determine the number of pages to produce
+ * @var bool|string generate_page_link_override Shall we return custom pagination link (string URL) or not (false)
+ * @since 3.1.0-RC5
+ */
+ $vars = array('base_url', 'on_page', 'start_name', 'per_page', 'generate_page_link_override');
+ extract($this->phpbb_dispatcher->trigger_event('core.pagination_generate_page_link', compact($vars)));
+
+ if ($generate_page_link_override)
+ {
+ return $generate_page_link_override;
+ }
+
+ if (!is_string($base_url))
+ {
+ if (is_array($base_url['routes']))
+ {
+ $route = ($on_page > 1) ? $base_url['routes'][1] : $base_url['routes'][0];
+ }
+ else
+ {
+ $route = $base_url['routes'];
+ }
+ $params = (isset($base_url['params'])) ? $base_url['params'] : array();
+ $is_amp = (isset($base_url['is_amp'])) ? $base_url['is_amp'] : true;
+ $session_id = (isset($base_url['session_id'])) ? $base_url['session_id'] : false;
+
+ if ($on_page > 1 || !is_array($base_url['routes']))
+ {
+ $params[$start_name] = (int) $on_page;
+ }
+
+ return $this->helper->route($route, $params, $is_amp, $session_id);
+ }
+ else
+ {
+ $url_delim = (strpos($base_url, '?') === false) ? '?' : ((strpos($base_url, '?') === strlen($base_url) - 1) ? '' : '&amp;');
+ return ($on_page > 1) ? $base_url . $url_delim . $start_name . '=' . (($on_page - 1) * $per_page) : $base_url;
+ }
+ }
+
+ /**
+ * Generate template rendered pagination
+ * Allows full control of rendering of pagination with the template
+ *
+ * @param string $base_url is url prepended to all links generated within the function
+ * If you use page numbers inside your controller route, base_url should contains a placeholder (%d)
+ * for the page. Also be sure to specify the pagination path information into the start_name argument
+ * @param string $block_var_name is the name assigned to the pagination data block within the template (example: <!-- BEGIN pagination -->)
+ * @param string $start_name is the name of the parameter containing the first item of the given page (example: start=20)
+ * If you use page numbers inside your controller route, start name should be the string
+ * that should be removed for the first page (example: /page/%d)
+ * @param int $num_items the total number of items, posts, etc., used to determine the number of pages to produce
+ * @param int $per_page the number of items, posts, etc. to display per page, used to determine the number of pages to produce
+ * @param int $start the item which should be considered currently active, used to determine the page we're on
+ * @param bool $reverse_count determines whether we weight display of the list towards the start (false) or end (true) of the list
+ * @param bool $ignore_on_page decides whether we enable an active (unlinked) item, used primarily for embedded lists
+ * @return null
+ */
+ public function generate_template_pagination($base_url, $block_var_name, $start_name, $num_items, $per_page, $start = 1, $reverse_count = false, $ignore_on_page = false)
+ {
+ $total_pages = ceil($num_items / $per_page);
+ $on_page = $this->get_on_page($per_page, $start);
+ $u_previous_page = $u_next_page = '';
+
+ if ($total_pages > 1)
+ {
+ if ($reverse_count)
+ {
+ $start_page = ($total_pages > 5) ? $total_pages - 4 : 1;
+ $end_page = $total_pages;
+ }
+ else
+ {
+ // What we're doing here is calculating what the "start" and "end" pages should be. We
+ // do this by assuming pagination is "centered" around the currently active page with
+ // the three previous and three next page links displayed. Anything more than that and
+ // we display the ellipsis, likewise anything less.
+ //
+ // $start_page is the page at which we start creating the list. When we have five or less
+ // pages we start at page 1 since there will be no ellipsis displayed. Anymore than that
+ // and we calculate the start based on the active page. This is the min/max calculation.
+ // First (max) would we end up starting on a page less than 1? Next (min) would we end
+ // up starting so close to the end that we'd not display our minimum number of pages.
+ //
+ // $end_page is the last page in the list to display. Like $start_page we use a min/max to
+ // determine this number. Again at most five pages? Then just display them all. More than
+ // five and we first (min) determine whether we'd end up listing more pages than exist.
+ // We then (max) ensure we're displaying the minimum number of pages.
+ $start_page = ($total_pages > 5) ? min(max(1, $on_page - 2), $total_pages - 4) : 1;
+ $end_page = ($total_pages > 5) ? max(min($total_pages, $on_page + 2), 5) : $total_pages;
+ }
+
+ if ($on_page != 1)
+ {
+ $u_previous_page = $this->generate_page_link($base_url, $on_page - 1, $start_name, $per_page);
+
+ $this->template->assign_block_vars($block_var_name, array(
+ 'PAGE_NUMBER' => '',
+ 'PAGE_URL' => $u_previous_page,
+ 'S_IS_CURRENT' => false,
+ 'S_IS_PREV' => true,
+ 'S_IS_NEXT' => false,
+ 'S_IS_ELLIPSIS' => false,
+ ));
+ }
+
+ // This do...while exists purely to negate the need for start and end assign_block_vars, i.e.
+ // to display the first and last page in the list plus any ellipsis. We use this loop to jump
+ // around a little within the list depending on where we're starting (and ending).
+ $at_page = 1;
+ do
+ {
+ // We decide whether to display the ellipsis during the loop. The ellipsis is always
+ // displayed as either the second or penultimate item in the list. So are we at either
+ // of those points and of course do we even need to display it, i.e. is the list starting
+ // on at least page 3 and ending three pages before the final item.
+ $this->template->assign_block_vars($block_var_name, array(
+ 'PAGE_NUMBER' => $at_page,
+ 'PAGE_URL' => $this->generate_page_link($base_url, $at_page, $start_name, $per_page),
+ 'S_IS_CURRENT' => (!$ignore_on_page && $at_page == $on_page),
+ 'S_IS_NEXT' => false,
+ 'S_IS_PREV' => false,
+ 'S_IS_ELLIPSIS' => ($at_page == 2 && $start_page > 2) || ($at_page == $total_pages - 1 && $end_page < $total_pages - 1),
+ ));
+
+ // We may need to jump around in the list depending on whether we have or need to display
+ // the ellipsis. Are we on page 2 and are we more than one page away from the start
+ // of the list? Yes? Then we jump to the start of the list. Likewise are we at the end of
+ // the list and are there more than two pages left in total? Yes? Then jump to the penultimate
+ // page (so we can display the ellipsis next pass). Else, increment the counter and keep
+ // going
+ if ($at_page == 2 && $at_page < $start_page - 1)
+ {
+ $at_page = $start_page;
+ }
+ else if ($at_page == $end_page && $end_page < $total_pages - 1)
+ {
+ $at_page = $total_pages - 1;
+ }
+ else
+ {
+ $at_page++;
+ }
+ }
+ while ($at_page <= $total_pages);
+
+ if ($on_page != $total_pages)
+ {
+ $u_next_page = $this->generate_page_link($base_url, $on_page + 1, $start_name, $per_page);
+
+ $this->template->assign_block_vars($block_var_name, array(
+ 'PAGE_NUMBER' => '',
+ 'PAGE_URL' => $u_next_page,
+ 'S_IS_CURRENT' => false,
+ 'S_IS_PREV' => false,
+ 'S_IS_NEXT' => true,
+ 'S_IS_ELLIPSIS' => false,
+ ));
+ }
+ }
+
+ // If the block_var_name is a nested block, we will use the last (most
+ // inner) block as a prefix for the template variables. If the last block
+ // name is pagination, the prefix is empty. If the rest of the
+ // block_var_name is not empty, we will modify the last row of that block
+ // and add our pagination items.
+ $tpl_block_name = $tpl_prefix = '';
+ if (strrpos($block_var_name, '.') !== false)
+ {
+ $tpl_block_name = substr($block_var_name, 0, strrpos($block_var_name, '.'));
+ $tpl_prefix = strtoupper(substr($block_var_name, strrpos($block_var_name, '.') + 1));
+ }
+ else
+ {
+ $tpl_prefix = strtoupper($block_var_name);
+ }
+ $tpl_prefix = ($tpl_prefix == 'PAGINATION') ? '' : $tpl_prefix . '_';
+
+ $template_array = array(
+ $tpl_prefix . 'BASE_URL' => is_string($base_url) ? $base_url : '',//@todo: Fix this for routes
+ $tpl_prefix . 'START_NAME' => $start_name,
+ $tpl_prefix . 'PER_PAGE' => $per_page,
+ 'U_' . $tpl_prefix . 'PREVIOUS_PAGE' => ($on_page != 1) ? $u_previous_page : '',
+ 'U_' . $tpl_prefix . 'NEXT_PAGE' => ($on_page != $total_pages) ? $u_next_page : '',
+ $tpl_prefix . 'TOTAL_PAGES' => $total_pages,
+ $tpl_prefix . 'CURRENT_PAGE' => $on_page,
+ $tpl_prefix . 'PAGE_NUMBER' => $this->on_page($num_items, $per_page, $start),
+ );
+
+ if ($tpl_block_name)
+ {
+ $this->template->alter_block_array($tpl_block_name, $template_array, true, 'change');
+ }
+ else
+ {
+ $this->template->assign_vars($template_array);
+ }
+ }
+
+ /**
+ * Get current page number
+ *
+ * @param int $per_page the number of items, posts, etc. per page
+ * @param int $start the item which should be considered currently active, used to determine the page we're on
+ * @return int Current page number
+ */
+ public function get_on_page($per_page, $start)
+ {
+ return floor($start / $per_page) + 1;
+ }
+
+ /**
+ * Return current page
+ *
+ * @param int $num_items the total number of items, posts, topics, etc.
+ * @param int $per_page the number of items, posts, etc. per page
+ * @param int $start the item which should be considered currently active, used to determine the page we're on
+ * @return string Descriptive pagination string (e.g. "page 1 of 10")
+ */
+ public function on_page($num_items, $per_page, $start)
+ {
+ $on_page = $this->get_on_page($per_page, $start);
+ return $this->user->lang('PAGE_OF', $on_page, max(ceil($num_items / $per_page), 1));
+ }
+
+ /**
+ * Get current page number
+ *
+ * @param int $start the item which should be considered currently active, used to determine the page we're on
+ * @param int $per_page the number of items, posts, etc. per page
+ * @param int $num_items the total number of items, posts, topics, etc.
+ * @return int Current page number
+ */
+ public function validate_start($start, $per_page, $num_items)
+ {
+ if ($start < 0 || $start >= $num_items)
+ {
+ return ($start < 0 || $num_items <= 0) ? 0 : floor(($num_items - 1) / $per_page) * $per_page;
+ }
+
+ return $start;
+ }
+
+ /**
+ * Get new start when searching from the end
+ *
+ * If the user is trying to reach late pages, start searching from the end.
+ *
+ * @param int $start the item which should be considered currently active, used to determine the page we're on
+ * @param int $limit the number of items, posts, etc. to display
+ * @param int $num_items the total number of items, posts, topics, etc.
+ * @return int Current page number
+ */
+ public function reverse_start($start, $limit, $num_items)
+ {
+ return max(0, $num_items - $limit - $start);
+ }
+
+ /**
+ * Get new item limit when searching from the end
+ *
+ * If the user is trying to reach late pages, start searching from the end.
+ * In this case the items to display might be lower then the actual per_page setting.
+ *
+ * @param int $start the item which should be considered currently active, used to determine the page we're on
+ * @param int $per_page the number of items, posts, etc. per page
+ * @param int $num_items the total number of items, posts, topics, etc.
+ * @return int Current page number
+ */
+ public function reverse_limit($start, $per_page, $num_items)
+ {
+ if ($start + $per_page > $num_items)
+ {
+ return min($per_page, max(1, $num_items - $start));
+ }
+
+ return $per_page;
+ }
+}
diff --git a/phpBB/phpbb/passwords/driver/base.php b/phpBB/phpbb/passwords/driver/base.php
new file mode 100644
index 0000000000..fd07a61bf4
--- /dev/null
+++ b/phpBB/phpbb/passwords/driver/base.php
@@ -0,0 +1,62 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\passwords\driver;
+
+abstract class base implements driver_interface
+{
+ /** @var \phpbb\config\config */
+ protected $config;
+
+ /** @var \phpbb\passwords\driver\helper */
+ protected $helper;
+
+ /** @var driver name */
+ protected $name;
+
+ /**
+ * Constructor of passwords driver object
+ *
+ * @param \phpbb\config\config $config phpBB config
+ * @param \phpbb\passwords\driver\helper $helper Password driver helper
+ */
+ public function __construct(\phpbb\config\config $config, helper $helper)
+ {
+ $this->config = $config;
+ $this->helper = $helper;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function is_supported()
+ {
+ return true;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function is_legacy()
+ {
+ return false;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_settings_only($hash, $full = false)
+ {
+ return false;
+ }
+}
diff --git a/phpBB/phpbb/passwords/driver/bcrypt.php b/phpBB/phpbb/passwords/driver/bcrypt.php
new file mode 100644
index 0000000000..eab1c3d569
--- /dev/null
+++ b/phpBB/phpbb/passwords/driver/bcrypt.php
@@ -0,0 +1,105 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\passwords\driver;
+
+class bcrypt extends base
+{
+ const PREFIX = '$2a$';
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_prefix()
+ {
+ return self::PREFIX;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function hash($password, $salt = '')
+ {
+ // The 2x and 2y prefixes of bcrypt might not be supported
+ // Revert to 2a if this is the case
+ $prefix = (!$this->is_supported()) ? '$2a$' : $this->get_prefix();
+
+ // Do not support 8-bit characters with $2a$ bcrypt
+ // Also see http://www.php.net/security/crypt_blowfish.php
+ if ($prefix === self::PREFIX)
+ {
+ if (ord($password[strlen($password)-1]) & 128)
+ {
+ return false;
+ }
+ }
+
+ if ($salt == '')
+ {
+ $salt = $prefix . '10$' . $this->get_random_salt();
+ }
+
+ $hash = crypt($password, $salt);
+ if (strlen($hash) < 60)
+ {
+ return false;
+ }
+ return $hash;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function check($password, $hash, $user_row = array())
+ {
+ $salt = substr($hash, 0, 29);
+ if (strlen($salt) != 29)
+ {
+ return false;
+ }
+
+ if ($this->helper->string_compare($hash, $this->hash($password, $salt)))
+ {
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Get a random salt value with a length of 22 characters
+ *
+ * @return string Salt for password hashing
+ */
+ protected function get_random_salt()
+ {
+ return $this->helper->hash_encode64($this->helper->get_random_salt(22), 22);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_settings_only($hash, $full = false)
+ {
+ if ($full)
+ {
+ $pos = stripos($hash, '$', 1) + 1;
+ $length = 22 + (strripos($hash, '$') + 1 - $pos);
+ }
+ else
+ {
+ $pos = strripos($hash, '$') + 1;
+ $length = 22;
+ }
+ return substr($hash, $pos, $length);
+ }
+}
diff --git a/phpBB/phpbb/passwords/driver/bcrypt_2y.php b/phpBB/phpbb/passwords/driver/bcrypt_2y.php
new file mode 100644
index 0000000000..c710e0d04a
--- /dev/null
+++ b/phpBB/phpbb/passwords/driver/bcrypt_2y.php
@@ -0,0 +1,35 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\passwords\driver;
+
+class bcrypt_2y extends bcrypt
+{
+ const PREFIX = '$2y$';
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_prefix()
+ {
+ return self::PREFIX;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function is_supported()
+ {
+ return (version_compare(PHP_VERSION, '5.3.7', '<')) ? false : true;
+ }
+}
diff --git a/phpBB/phpbb/passwords/driver/bcrypt_wcf2.php b/phpBB/phpbb/passwords/driver/bcrypt_wcf2.php
new file mode 100644
index 0000000000..0eee98d7b7
--- /dev/null
+++ b/phpBB/phpbb/passwords/driver/bcrypt_wcf2.php
@@ -0,0 +1,84 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\passwords\driver;
+
+class bcrypt_wcf2 extends base
+{
+ const PREFIX = '$wcf2$';
+
+ /** @var \phpbb\passwords\driver\bcrypt */
+ protected $bcrypt;
+
+ /** @var \phpbb\passwords\driver\helper */
+ protected $helper;
+
+ /**
+ * Constructor of passwords driver object
+ *
+ * @param \phpbb\passwords\driver\bcrypt $bcrypt Salted md5 driver
+ * @param \phpbb\passwords\driver\helper $helper Password driver helper
+ */
+ public function __construct(\phpbb\passwords\driver\bcrypt $bcrypt, helper $helper)
+ {
+ $this->bcrypt = $bcrypt;
+ $this->helper = $helper;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_prefix()
+ {
+ return self::PREFIX;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function is_legacy()
+ {
+ return true;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function hash($password, $user_row = '')
+ {
+ // Do not support hashing
+ return false;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function check($password, $hash, $user_row = array())
+ {
+ if (empty($hash) || strlen($hash) != 60)
+ {
+ return false;
+ }
+ else
+ {
+ $salt = substr($hash, 0, 29);
+
+ if (strlen($salt) != 29)
+ {
+ return false;
+ }
+ // Works for standard WCF 2.x, i.e. WBB4 and similar
+ return $this->helper->string_compare($hash, $this->bcrypt->hash($this->bcrypt->hash($password, $salt), $salt));
+ }
+ }
+}
diff --git a/phpBB/phpbb/passwords/driver/convert_password.php b/phpBB/phpbb/passwords/driver/convert_password.php
new file mode 100644
index 0000000000..eb70434df2
--- /dev/null
+++ b/phpBB/phpbb/passwords/driver/convert_password.php
@@ -0,0 +1,43 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\passwords\driver;
+
+class convert_password extends base
+{
+ const PREFIX = '$CP$';
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_prefix()
+ {
+ return self::PREFIX;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function hash($password, $user_row = '')
+ {
+ return false;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function check($password, $hash, $user_row = array())
+ {
+ return false;
+ }
+}
diff --git a/phpBB/phpbb/passwords/driver/driver_interface.php b/phpBB/phpbb/passwords/driver/driver_interface.php
new file mode 100644
index 0000000000..3974484f13
--- /dev/null
+++ b/phpBB/phpbb/passwords/driver/driver_interface.php
@@ -0,0 +1,69 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\passwords\driver;
+
+interface driver_interface
+{
+ /**
+ * Check if hash type is supported
+ *
+ * @return bool True if supported, false if not
+ */
+ public function is_supported();
+
+ /**
+ * Check if hash type is a legacy hash type
+ *
+ * @return bool True if it's a legacy hash type, false if not
+ */
+ public function is_legacy();
+
+ /**
+ * Returns the hash prefix
+ *
+ * @return string Hash prefix
+ */
+ public function get_prefix();
+
+ /**
+ * Hash the password
+ *
+ * @param string $password The password that should be hashed
+ *
+ * @return bool|string Password hash or false if something went wrong
+ * during hashing
+ */
+ public function hash($password);
+
+ /**
+ * Check the password against the supplied hash
+ *
+ * @param string $password The password to check
+ * @param string $hash The password hash to check against
+ * @param array $user_row User's row in users table
+ *
+ * @return bool True if password is correct, else false
+ */
+ public function check($password, $hash, $user_row = array());
+
+ /**
+ * Get only the settings of the specified hash
+ *
+ * @param string $hash Password hash
+ * @param bool $full Return full settings or only settings
+ * related to the salt
+ * @return string String containing the hash settings
+ */
+ public function get_settings_only($hash, $full = false);
+}
diff --git a/phpBB/phpbb/passwords/driver/helper.php b/phpBB/phpbb/passwords/driver/helper.php
new file mode 100644
index 0000000000..f80c3e3df6
--- /dev/null
+++ b/phpBB/phpbb/passwords/driver/helper.php
@@ -0,0 +1,177 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\passwords\driver;
+
+class helper
+{
+ /**
+ * @var \phpbb\config\config
+ */
+ protected $config;
+
+ /**
+ * base64 alphabet
+ * @var string
+ */
+ public $itoa64 = './0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
+
+ /**
+ * Construct a driver helper object
+ *
+ * @param \phpbb\config\config $config phpBB configuration
+ */
+ public function __construct(\phpbb\config\config $config)
+ {
+ $this->config = $config;
+ }
+
+ /**
+ * Base64 encode hash
+ *
+ * @param string $input Input string
+ * @param int $count Input string length
+ *
+ * @return string base64 encoded string
+ */
+ public function hash_encode64($input, $count)
+ {
+ $output = '';
+ $i = 0;
+
+ do
+ {
+ $value = ord($input[$i++]);
+ $output .= $this->itoa64[$value & 0x3f];
+
+ if ($i < $count)
+ {
+ $value |= ord($input[$i]) << 8;
+ }
+
+ $output .= $this->itoa64[($value >> 6) & 0x3f];
+
+ if ($i++ >= $count)
+ {
+ break;
+ }
+
+ if ($i < $count)
+ {
+ $value |= ord($input[$i]) << 16;
+ }
+
+ $output .= $this->itoa64[($value >> 12) & 0x3f];
+
+ if ($i++ >= $count)
+ {
+ break;
+ }
+
+ $output .= $this->itoa64[($value >> 18) & 0x3f];
+ }
+ while ($i < $count);
+
+ return $output;
+ }
+
+ /**
+ * Return unique id
+ *
+ * @param string $extra Additional entropy
+ *
+ * @return string Unique id
+ */
+ public function unique_id($extra = 'c')
+ {
+ static $dss_seeded = false;
+
+ $val = $this->config['rand_seed'] . microtime();
+ $val = md5($val);
+ $this->config['rand_seed'] = md5($this->config['rand_seed'] . $val . $extra);
+
+ if ($dss_seeded !== true && ($this->config['rand_seed_last_update'] < time() - rand(1,10)))
+ {
+ $this->config->set('rand_seed_last_update', time(), true);
+ $this->config->set('rand_seed', $this->config['rand_seed'], true);
+ $dss_seeded = true;
+ }
+
+ return substr($val, 4, 16);
+ }
+
+ /**
+ * Get random salt with specified length
+ *
+ * @param int $length Salt length
+ * @param string $rand_seed Seed for random data (optional). For tests.
+ *
+ * @return string Random salt with specified length
+ */
+ public function get_random_salt($length, $rand_seed = '/dev/urandom')
+ {
+ $random = '';
+
+ if (($fh = @fopen($rand_seed, 'rb')))
+ {
+ $random = fread($fh, $length);
+ fclose($fh);
+ }
+
+ if (strlen($random) < $length)
+ {
+ $random = '';
+ $random_state = $this->unique_id();
+
+ for ($i = 0; $i < $length; $i += 16)
+ {
+ $random_state = md5($this->unique_id() . $random_state);
+ $random .= pack('H*', md5($random_state));
+ }
+ $random = substr($random, 0, $length);
+ }
+ return $random;
+ }
+
+ /**
+ * Compare two strings byte by byte
+ *
+ * @param string $string_a The first string
+ * @param string $string_b The second string
+ *
+ * @return bool True if strings are the same, false if not
+ */
+ public function string_compare($string_a, $string_b)
+ {
+ // Return if input variables are not strings or if length does not match
+ if (!is_string($string_a) || !is_string($string_b) || strlen($string_a) != strlen($string_b))
+ {
+ return false;
+ }
+
+ // Use hash_equals() if it's available
+ if (function_exists('hash_equals'))
+ {
+ return hash_equals($string_a, $string_b);
+ }
+
+ $difference = 0;
+
+ for ($i = 0; $i < strlen($string_a) && $i < strlen($string_b); $i++)
+ {
+ $difference |= ord($string_a[$i]) ^ ord($string_b[$i]);
+ }
+
+ return $difference === 0;
+ }
+}
diff --git a/phpBB/phpbb/passwords/driver/md5_mybb.php b/phpBB/phpbb/passwords/driver/md5_mybb.php
new file mode 100644
index 0000000000..f631ceae78
--- /dev/null
+++ b/phpBB/phpbb/passwords/driver/md5_mybb.php
@@ -0,0 +1,60 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\passwords\driver;
+
+class md5_mybb extends base
+{
+ const PREFIX = '$md5_mybb$';
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_prefix()
+ {
+ return self::PREFIX;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function is_legacy()
+ {
+ return true;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function hash($password, $user_row = '')
+ {
+ // Do not support hashing
+ return false;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function check($password, $hash, $user_row = array())
+ {
+ if (empty($hash) || strlen($hash) != 32 || !isset($user_row['user_passwd_salt']))
+ {
+ return false;
+ }
+ else
+ {
+ // Works for myBB 1.1.x, 1.2.x, 1.4.x, 1.6.x
+ return $this->helper->string_compare($hash, md5(md5($user_row['user_passwd_salt']) . md5($password)));
+ }
+ }
+}
diff --git a/phpBB/phpbb/passwords/driver/md5_phpbb2.php b/phpBB/phpbb/passwords/driver/md5_phpbb2.php
new file mode 100644
index 0000000000..bd8cc51e5a
--- /dev/null
+++ b/phpBB/phpbb/passwords/driver/md5_phpbb2.php
@@ -0,0 +1,123 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\passwords\driver;
+
+class md5_phpbb2 extends base
+{
+ const PREFIX = '$md5_phpbb2$';
+
+ /** @var \phpbb\request\request phpBB request object */
+ protected $request;
+
+ /** @var \phpbb\passwords\driver\salted_md5 */
+ protected $salted_md5;
+
+ /** @var \phpbb\passwords\driver\helper */
+ protected $helper;
+
+ /** @var string phpBB root path */
+ protected $phpbb_root_path;
+
+ /** @var string php file extension */
+ protected $php_ext;
+
+ /**
+ * Constructor of passwords driver object
+ *
+ * @param \phpbb\request\request $request phpBB request object
+ * @param \phpbb\passwords\driver\salted_md5 $salted_md5 Salted md5 driver
+ * @param \phpbb\passwords\driver\helper $helper Driver helper
+ * @param string $phpbb_root_path phpBB root path
+ * @param string $php_ext PHP file extension
+ */
+ public function __construct($request, salted_md5 $salted_md5, helper $helper, $phpbb_root_path, $php_ext)
+ {
+ $this->request = $request;
+ $this->salted_md5 = $salted_md5;
+ $this->helper = $helper;
+ $this->phpbb_root_path = $phpbb_root_path;
+ $this->php_ext = $php_ext;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_prefix()
+ {
+ return self::PREFIX;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function is_legacy()
+ {
+ return true;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function hash($password, $user_row = '')
+ {
+ // Do not support hashing
+ return false;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function check($password, $hash, $user_row = array())
+ {
+ if (strlen($hash) != 32 && strlen($hash) != 34)
+ {
+ return false;
+ }
+
+ // enable super globals to get literal value
+ // this is needed to prevent unicode normalization
+ $super_globals_disabled = $this->request->super_globals_disabled();
+ if ($super_globals_disabled)
+ {
+ $this->request->enable_super_globals();
+ }
+
+ // in phpBB2 passwords were used exactly as they were sent, with addslashes applied
+ $password_old_format = isset($_REQUEST['password']) ? (string) $_REQUEST['password'] : '';
+ $password_old_format = (!STRIP) ? addslashes($password_old_format) : $password_old_format;
+ $password_new_format = $this->request->variable('password', '', true);
+
+ if ($super_globals_disabled)
+ {
+ $this->request->disable_super_globals();
+ }
+
+ if ($password == $password_new_format)
+ {
+ if (!function_exists('utf8_to_cp1252'))
+ {
+ include($this->phpbb_root_path . 'includes/utf/data/recode_basic.' . $this->php_ext);
+ }
+
+ if ($this->helper->string_compare(md5($password_old_format), $hash) || $this->helper->string_compare(md5(\utf8_to_cp1252($password_old_format)), $hash)
+ || $this->salted_md5->check(md5($password_old_format), $hash) === true
+ || $this->salted_md5->check(md5(\utf8_to_cp1252($password_old_format)), $hash) === true)
+ {
+ return true;
+ }
+ }
+
+ return false;
+ }
+}
diff --git a/phpBB/phpbb/passwords/driver/md5_vb.php b/phpBB/phpbb/passwords/driver/md5_vb.php
new file mode 100644
index 0000000000..280b7114c7
--- /dev/null
+++ b/phpBB/phpbb/passwords/driver/md5_vb.php
@@ -0,0 +1,60 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\passwords\driver;
+
+class md5_vb extends base
+{
+ const PREFIX = '$md5_vb$';
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_prefix()
+ {
+ return self::PREFIX;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function is_legacy()
+ {
+ return true;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function hash($password, $user_row = '')
+ {
+ // Do not support hashing
+ return false;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function check($password, $hash, $user_row = array())
+ {
+ if (empty($hash) || strlen($hash) != 32 || !isset($user_row['user_passwd_salt']))
+ {
+ return false;
+ }
+ else
+ {
+ // Works for vB 3.8.x, 4.x.x, 5.0.x
+ return $this->helper->string_compare($hash, md5(md5($password) . $user_row['user_passwd_salt']));
+ }
+ }
+}
diff --git a/phpBB/phpbb/passwords/driver/phpass.php b/phpBB/phpbb/passwords/driver/phpass.php
new file mode 100644
index 0000000000..bef8355276
--- /dev/null
+++ b/phpBB/phpbb/passwords/driver/phpass.php
@@ -0,0 +1,27 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\passwords\driver;
+
+class phpass extends salted_md5
+{
+ const PREFIX = '$P$';
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_prefix()
+ {
+ return self::PREFIX;
+ }
+}
diff --git a/phpBB/phpbb/passwords/driver/salted_md5.php b/phpBB/phpbb/passwords/driver/salted_md5.php
new file mode 100644
index 0000000000..38d6d9cd2c
--- /dev/null
+++ b/phpBB/phpbb/passwords/driver/salted_md5.php
@@ -0,0 +1,169 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\passwords\driver;
+
+/**
+*
+* @version Version 0.1 / slightly modified for phpBB 3.1.x (using $H$ as hash type identifier)
+*
+* Portable PHP password hashing framework.
+*
+* Written by Solar Designer <solar at openwall.com> in 2004-2006 and placed in
+* the public domain.
+*
+* There's absolutely no warranty.
+*
+* The homepage URL for this framework is:
+*
+* http://www.openwall.com/phpass/
+*
+* Please be sure to update the Version line if you edit this file in any way.
+* It is suggested that you leave the main version number intact, but indicate
+* your project name (after the slash) and add your own revision information.
+*
+* Please do not change the "private" password hashing method implemented in
+* here, thereby making your hashes incompatible. However, if you must, please
+* change the hash type identifier (the "$P$") to something different.
+*
+* Obviously, since this code is in the public domain, the above are not
+* requirements (there can be none), but merely suggestions.
+*
+*/
+
+class salted_md5 extends base
+{
+ const PREFIX = '$H$';
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_prefix()
+ {
+ return self::PREFIX;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function is_legacy()
+ {
+ return true;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function hash($password, $setting = '')
+ {
+ if ($setting)
+ {
+ if (($settings = $this->get_hash_settings($setting)) === false)
+ {
+ // Return md5 of password if settings do not
+ // comply with our standards. This will only
+ // happen if pre-determined settings are
+ // directly passed to the driver. The manager
+ // will not do this. Same as the old hashing
+ // implementation in phpBB 3.0
+ return md5($password);
+ }
+ }
+ else
+ {
+ $settings = $this->get_hash_settings($this->generate_salt());
+ }
+
+ $hash = md5($settings['salt'] . $password, true);
+ do
+ {
+ $hash = md5($hash . $password, true);
+ }
+ while (--$settings['count']);
+
+ $output = $settings['full'];
+ $output .= $this->helper->hash_encode64($hash, 16);
+
+ return $output;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function check($password, $hash, $user_row = array())
+ {
+ if (strlen($hash) !== 34)
+ {
+ return md5($password) === $hash;
+ }
+
+ return $this->helper->string_compare($hash, $this->hash($password, $hash));
+ }
+
+ /**
+ * Generate salt for hashing method
+ *
+ * @return string Salt for hashing method
+ */
+ protected function generate_salt()
+ {
+ $count = 6;
+
+ $random = $this->helper->get_random_salt($count);
+
+ $salt = $this->get_prefix();
+ $salt .= $this->helper->itoa64[min($count + 5, 30)];
+ $salt .= $this->helper->hash_encode64($random, $count);
+
+ return $salt;
+ }
+
+ /**
+ * Get hash settings
+ *
+ * @param string $hash The hash that contains the settings
+ *
+ * @return bool|array Array containing the count_log2, salt, and full
+ * hash settings string or false if supplied hash is empty
+ * or contains incorrect settings
+ */
+ public function get_hash_settings($hash)
+ {
+ if (empty($hash))
+ {
+ return false;
+ }
+
+ $count_log2 = strpos($this->helper->itoa64, $hash[3]);
+ $salt = substr($hash, 4, 8);
+
+ if ($count_log2 < 7 || $count_log2 > 30 || strlen($salt) != 8)
+ {
+ return false;
+ }
+
+ return array(
+ 'count' => 1 << $count_log2,
+ 'salt' => $salt,
+ 'full' => substr($hash, 0, 12),
+ );
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_settings_only($hash, $full = false)
+ {
+ return substr($hash, 3, 9);
+ }
+}
diff --git a/phpBB/phpbb/passwords/driver/sha1.php b/phpBB/phpbb/passwords/driver/sha1.php
new file mode 100644
index 0000000000..1abead42cd
--- /dev/null
+++ b/phpBB/phpbb/passwords/driver/sha1.php
@@ -0,0 +1,52 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\passwords\driver;
+
+class sha1 extends base
+{
+ const PREFIX = '$sha1$';
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_prefix()
+ {
+ return self::PREFIX;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function is_legacy()
+ {
+ return true;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function hash($password, $user_row = '')
+ {
+ // Do not support hashing
+ return false;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function check($password, $hash, $user_row = array())
+ {
+ return (strlen($hash) == 40) ? $this->helper->string_compare($hash, sha1($password)) : false;
+ }
+}
diff --git a/phpBB/phpbb/passwords/driver/sha1_smf.php b/phpBB/phpbb/passwords/driver/sha1_smf.php
new file mode 100644
index 0000000000..b30d87265e
--- /dev/null
+++ b/phpBB/phpbb/passwords/driver/sha1_smf.php
@@ -0,0 +1,51 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\passwords\driver;
+
+class sha1_smf extends base
+{
+ const PREFIX = '$smf$';
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_prefix()
+ {
+ return self::PREFIX;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function is_legacy()
+ {
+ return true;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function hash($password, $user_row = '')
+ {
+ return (isset($user_row['login_name'])) ? sha1(strtolower($user_row['login_name']) . $password) : false;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function check($password, $hash, $user_row = array())
+ {
+ return (strlen($hash) == 40) ? $this->helper->string_compare($hash, $this->hash($password, $user_row)) : false;
+ }
+}
diff --git a/phpBB/phpbb/passwords/driver/sha1_wcf1.php b/phpBB/phpbb/passwords/driver/sha1_wcf1.php
new file mode 100644
index 0000000000..68006486c4
--- /dev/null
+++ b/phpBB/phpbb/passwords/driver/sha1_wcf1.php
@@ -0,0 +1,60 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\passwords\driver;
+
+class sha1_wcf1 extends base
+{
+ const PREFIX = '$wcf1$';
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_prefix()
+ {
+ return self::PREFIX;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function is_legacy()
+ {
+ return true;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function hash($password, $user_row = '')
+ {
+ // Do not support hashing
+ return false;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function check($password, $hash, $user_row = array())
+ {
+ if (empty($hash) || strlen($hash) != 40 || !isset($user_row['user_passwd_salt']))
+ {
+ return false;
+ }
+ else
+ {
+ // Works for standard WCF 1.x, i.e. WBB3 and similar
+ return $this->helper->string_compare($hash, sha1($user_row['user_passwd_salt'] . sha1($user_row['user_passwd_salt'] . sha1($password))));
+ }
+ }
+}
diff --git a/phpBB/phpbb/passwords/driver/sha_xf1.php b/phpBB/phpbb/passwords/driver/sha_xf1.php
new file mode 100644
index 0000000000..9d8f01796e
--- /dev/null
+++ b/phpBB/phpbb/passwords/driver/sha_xf1.php
@@ -0,0 +1,68 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\passwords\driver;
+
+class sha_xf1 extends base
+{
+ const PREFIX = '$xf1$';
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_prefix()
+ {
+ return self::PREFIX;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function is_legacy()
+ {
+ return true;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function hash($password, $user_row = '')
+ {
+ // Do not support hashing
+ return false;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function check($password, $hash, $user_row = array())
+ {
+ if (empty($hash) || (strlen($hash) != 40 && strlen($hash) != 64) || !isset($user_row['user_passwd_salt']))
+ {
+ return false;
+ }
+ else
+ {
+ // Works for xenforo 1.0, 1.1
+ if ($this->helper->string_compare($hash, sha1(sha1($password) . $user_row['user_passwd_salt']))
+ || $this->helper->string_compare($hash, hash('sha256', hash('sha256', $password) . $user_row['user_passwd_salt'])))
+ {
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+ }
+ }
+}
diff --git a/phpBB/phpbb/passwords/helper.php b/phpBB/phpbb/passwords/helper.php
new file mode 100644
index 0000000000..c2a49202cd
--- /dev/null
+++ b/phpBB/phpbb/passwords/helper.php
@@ -0,0 +1,104 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\passwords;
+
+class helper
+{
+ /**
+ * Get hash settings from combined hash
+ *
+ * @param string $hash Password hash of combined hash
+ *
+ * @return array An array containing the hash settings for the hash
+ * types in successive order as described by the combined
+ * password hash or an empty array if hash does not
+ * properly fit the combined hash format
+ */
+ public function get_combined_hash_settings($hash)
+ {
+ $output = array();
+
+ preg_match('#^\$([a-zA-Z0-9\\\]*?)\$#', $hash, $match);
+ $hash_settings = substr($hash, strpos($hash, $match[1]) + strlen($match[1]) + 1);
+ $matches = explode('\\', $match[1]);
+ foreach ($matches as $cur_type)
+ {
+ $dollar_position = strpos($hash_settings, '$');
+ $output[] = substr($hash_settings, 0, ($dollar_position != false) ? $dollar_position : strlen($hash_settings));
+ $hash_settings = substr($hash_settings, $dollar_position + 1);
+ }
+
+ return $output;
+ }
+
+ /**
+ * Combine hash prefixes, settings, and actual hash
+ *
+ * @param array $data Array containing the keys 'prefix' and 'settings'.
+ * It will hold the prefixes and settings
+ * @param string $type Data type of the supplied value
+ * @param string $value Value that should be put into the data array
+ *
+ * @return string|null Return complete combined hash if type is neither
+ * 'prefix' nor 'settings', nothing if it is
+ */
+ public function combine_hash_output(&$data, $type, $value)
+ {
+ if ($type == 'prefix')
+ {
+ $data[$type] .= ($data[$type] !== '$') ? '\\' : '';
+ $data[$type] .= str_replace('$', '', $value);
+ }
+ else if ($type == 'settings')
+ {
+ $data[$type] .= ($data[$type] !== '$') ? '$' : '';
+ $data[$type] .= $value;
+ }
+ else
+ {
+ // Return full hash
+ return $data['prefix'] . $data['settings'] . '$' . $value;
+ }
+ }
+
+ /**
+ * Rebuild hash for hashing functions
+ *
+ * @param string $prefix Hash prefix
+ * @param string $settings Hash settings
+ *
+ * @return string Rebuilt hash for hashing functions
+ */
+ public function rebuild_hash($prefix, $settings)
+ {
+ $rebuilt_hash = $prefix;
+ if (strpos($settings, '\\') !== false)
+ {
+ $settings = str_replace('\\', '$', $settings);
+ }
+ $rebuilt_hash .= $settings;
+ return $rebuilt_hash;
+ }
+
+ /**
+ * Obtain only the actual hash after the prefixes
+ *
+ * @param string $hash The full password hash
+ * @return string Actual hash (incl. settings)
+ */
+ public function obtain_hash_only($hash)
+ {
+ return substr($hash, strripos($hash, '$') + 1);
+ }
+}
diff --git a/phpBB/phpbb/passwords/manager.php b/phpBB/phpbb/passwords/manager.php
new file mode 100644
index 0000000000..aa9147ecf4
--- /dev/null
+++ b/phpBB/phpbb/passwords/manager.php
@@ -0,0 +1,366 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\passwords;
+
+class manager
+{
+ /**
+ * Default hashing method
+ */
+ protected $type = false;
+
+ /**
+ * Hashing algorithm type map
+ * Will be used to map hash prefix to type
+ */
+ protected $type_map = false;
+
+ /**
+ * Service collection of hashing algorithms
+ * Needs to be public for passwords helper
+ */
+ public $algorithms = false;
+
+ /**
+ * Password convert flag. Signals that password should be converted
+ */
+ public $convert_flag = false;
+
+ /**
+ * Passwords helper
+ * @var \phpbb\passwords\helper
+ */
+ protected $helper;
+
+ /**
+ * phpBB configuration
+ * @var \phpbb\config\config
+ */
+ protected $config;
+
+ /**
+ * Construct a passwords object
+ *
+ * @param \phpbb\config\config $config phpBB configuration
+ * @param array $hashing_algorithms Hashing driver
+ * service collection
+ * @param \phpbb\passwords\helper $helper Passwords helper object
+ * @param array $defaults List of default driver types
+ */
+ public function __construct(\phpbb\config\config $config, $hashing_algorithms, helper $helper, $defaults)
+ {
+ $this->config = $config;
+ $this->helper = $helper;
+
+ $this->fill_type_map($hashing_algorithms);
+ $this->register_default_type($defaults);
+ }
+
+ /**
+ * Register default type
+ * Will register the first supported type from the list of default types
+ *
+ * @param array $defaults List of default types in order from first to
+ * use to last to use
+ */
+ protected function register_default_type($defaults)
+ {
+ foreach ($defaults as $type)
+ {
+ if ($this->algorithms[$type]->is_supported())
+ {
+ $this->type = $this->algorithms[$type]->get_prefix();
+ break;
+ }
+ }
+ }
+
+ /**
+ * Fill algorithm type map
+ *
+ * @param \phpbb\di\service_collection $hashing_algorithms
+ */
+ protected function fill_type_map($hashing_algorithms)
+ {
+ foreach ($hashing_algorithms as $algorithm)
+ {
+ if (!isset($this->type_map[$algorithm->get_prefix()]))
+ {
+ $this->type_map[$algorithm->get_prefix()] = $algorithm;
+ }
+ }
+ $this->algorithms = $hashing_algorithms;
+ }
+
+ /**
+ * Get the algorithm specified by a specific prefix
+ *
+ * @param string $prefix Password hash prefix
+ *
+ * @return object|bool The hash type object or false if prefix is not
+ * supported
+ */
+ protected function get_algorithm($prefix)
+ {
+ if (isset($this->type_map[$prefix]))
+ {
+ return $this->type_map[$prefix];
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ /**
+ * Detect the hash type of the supplied hash
+ *
+ * @param string $hash Password hash that should be checked
+ *
+ * @return object|bool The hash type object or false if the specified
+ * type is not supported
+ */
+ public function detect_algorithm($hash)
+ {
+ /*
+ * preg_match() will also show hashing algos like $2a\H$, which
+ * is a combination of bcrypt and phpass. Legacy algorithms
+ * like md5 will not be matched by this and need to be treated
+ * differently.
+ */
+ if (!preg_match('#^\$([a-zA-Z0-9\\\]*?)\$#', $hash, $match))
+ {
+ return false;
+ }
+
+ // Be on the lookout for multiple hashing algorithms
+ // 2 is correct: H\2a > 2, H\P > 2
+ if (strlen($match[1]) > 2)
+ {
+ $hash_types = explode('\\', $match[1]);
+ $return_ary = array();
+ foreach ($hash_types as $type)
+ {
+ // we do not support the same hashing
+ // algorithm more than once
+ if (isset($return_ary[$type]))
+ {
+ return false;
+ }
+
+ $return_ary[$type] = $this->get_algorithm('$' . $type . '$');
+
+ if (empty($return_ary[$type]))
+ {
+ return false;
+ }
+ }
+ return $return_ary;
+ }
+
+ // get_algorithm() will automatically return false if prefix
+ // is not supported
+ return $this->get_algorithm($match[0]);
+ }
+
+ /**
+ * Hash supplied password
+ *
+ * @param string $password Password that should be hashed
+ * @param string $type Hash type. Will default to standard hash type if
+ * none is supplied
+ * @return string|bool Password hash of supplied password or false if
+ * if something went wrong during hashing
+ */
+ public function hash($password, $type = '')
+ {
+ if (strlen($password) > 4096)
+ {
+ // If the password is too huge, we will simply reject it
+ // and not let the server try to hash it.
+ return false;
+ }
+
+ // Try to retrieve algorithm by service name if type doesn't
+ // start with dollar sign
+ if (!is_array($type) && strpos($type, '$') !== 0 && isset($this->algorithms[$type]))
+ {
+ $type = $this->algorithms[$type]->get_prefix();
+ }
+
+ $type = ($type === '') ? $this->type : $type;
+
+ if (is_array($type))
+ {
+ return $this->combined_hash_password($password, $type);
+ }
+
+ if (isset($this->type_map[$type]))
+ {
+ $hashing_algorithm = $this->type_map[$type];
+ }
+ else
+ {
+ return false;
+ }
+
+ return $hashing_algorithm->hash($password);
+ }
+
+ /**
+ * Check supplied password against hash and set convert_flag if password
+ * needs to be converted to different format (preferrably newer one)
+ *
+ * @param string $password Password that should be checked
+ * @param string $hash Stored hash
+ * @param array $user_row User's row in users table
+ * @return string|bool True if password is correct, false if not
+ */
+ public function check($password, $hash, $user_row = array())
+ {
+ if (strlen($password) > 4096)
+ {
+ // If the password is too huge, we will simply reject it
+ // and not let the server try to hash it.
+ return false;
+ }
+
+ // Empty hashes can't be checked
+ if (empty($hash))
+ {
+ return false;
+ }
+
+ // First find out what kind of hash we're dealing with
+ $stored_hash_type = $this->detect_algorithm($hash);
+ if ($stored_hash_type == false)
+ {
+ // Still check MD5 hashes as that is what the installer
+ // will default to for the admin user
+ return $this->get_algorithm('$H$')->check($password, $hash);
+ }
+
+ // Multiple hash passes needed
+ if (is_array($stored_hash_type))
+ {
+ $correct = $this->check_combined_hash($password, $stored_hash_type, $hash);
+ $this->convert_flag = ($correct === true) ? true : false;
+ return $correct;
+ }
+
+ if ($stored_hash_type->get_prefix() !== $this->type)
+ {
+ $this->convert_flag = true;
+ }
+ else
+ {
+ $this->convert_flag = false;
+ }
+
+ // Check all legacy hash types if prefix is $CP$
+ if ($stored_hash_type->get_prefix() === '$CP$')
+ {
+ // Remove $CP$ prefix for proper checking
+ $hash = substr($hash, 4);
+
+ foreach ($this->type_map as $algorithm)
+ {
+ if ($algorithm->is_legacy() && $algorithm->check($password, $hash, $user_row) === true)
+ {
+ return true;
+ }
+ }
+ }
+
+ return $stored_hash_type->check($password, $hash);
+ }
+
+ /**
+ * Create combined hash from already hashed password
+ *
+ * @param string $password_hash Complete current password hash
+ * @param string $type Type of the hashing algorithm the password hash
+ * should be combined with
+ * @return string|bool Combined password hash if combined hashing was
+ * successful, else false
+ */
+ public function combined_hash_password($password_hash, $type)
+ {
+ $data = array(
+ 'prefix' => '$',
+ 'settings' => '$',
+ );
+ $hash_settings = $this->helper->get_combined_hash_settings($password_hash);
+ $hash = $hash_settings[0];
+
+ // Put settings of current hash into data array
+ $stored_hash_type = $this->detect_algorithm($password_hash);
+ $this->helper->combine_hash_output($data, 'prefix', $stored_hash_type->get_prefix());
+ $this->helper->combine_hash_output($data, 'settings', $stored_hash_type->get_settings_only($password_hash));
+
+ // Hash current hash with the defined types
+ foreach ($type as $cur_type)
+ {
+ if (isset($this->algorithms[$cur_type]))
+ {
+ $new_hash_type = $this->algorithms[$cur_type];
+ }
+ else
+ {
+ $new_hash_type = $this->get_algorithm($cur_type);
+ }
+
+ if (!$new_hash_type)
+ {
+ return false;
+ }
+
+ $new_hash = $new_hash_type->hash(str_replace($stored_hash_type->get_settings_only($password_hash), '', $hash));
+ $this->helper->combine_hash_output($data, 'prefix', $new_hash_type->get_prefix());
+ $this->helper->combine_hash_output($data, 'settings', substr(str_replace('$', '\\', $new_hash_type->get_settings_only($new_hash, true)), 0));
+ $hash = str_replace($new_hash_type->get_settings_only($new_hash), '', $this->helper->obtain_hash_only($new_hash));
+ }
+ return $this->helper->combine_hash_output($data, 'hash', $hash);
+ }
+
+ /**
+ * Check combined password hash against the supplied password
+ *
+ * @param string $password Password entered by user
+ * @param array $stored_hash_type An array containing the hash types
+ * as described by stored password hash
+ * @param string $hash Stored password hash
+ *
+ * @return bool True if password is correct, false if not
+ */
+ public function check_combined_hash($password, $stored_hash_type, $hash)
+ {
+ $i = 0;
+ $data = array(
+ 'prefix' => '$',
+ 'settings' => '$',
+ );
+ $hash_settings = $this->helper->get_combined_hash_settings($hash);
+ foreach ($stored_hash_type as $key => $hash_type)
+ {
+ $rebuilt_hash = $this->helper->rebuild_hash($hash_type->get_prefix(), $hash_settings[$i]);
+ $this->helper->combine_hash_output($data, 'prefix', $key);
+ $this->helper->combine_hash_output($data, 'settings', $hash_settings[$i]);
+ $cur_hash = $hash_type->hash($password, $rebuilt_hash);
+ $password = str_replace($rebuilt_hash, '', $cur_hash);
+ $i++;
+ }
+ return ($hash === $this->helper->combine_hash_output($data, 'hash', $password));
+ }
+}
diff --git a/phpBB/phpbb/path_helper.php b/phpBB/phpbb/path_helper.php
new file mode 100644
index 0000000000..5400c1c5a6
--- /dev/null
+++ b/phpBB/phpbb/path_helper.php
@@ -0,0 +1,492 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb;
+
+/**
+* A class with various functions that are related to paths, files and the filesystem
+*/
+class path_helper
+{
+ /** @var \phpbb\symfony_request */
+ protected $symfony_request;
+
+ /** @var \phpbb\filesystem */
+ protected $filesystem;
+
+ /** @var \phpbb\request\request_interface */
+ protected $request;
+
+ /** @var string */
+ protected $phpbb_root_path;
+
+ /** @var string */
+ protected $adm_relative_path;
+
+ /** @var string */
+ protected $php_ext;
+
+ /** @var string */
+ protected $web_root_path;
+
+ /**
+ * Constructor
+ *
+ * @param \phpbb\symfony_request $symfony_request
+ * @param \phpbb\filesystem $filesystem
+ * @param \phpbb\request\request_interface $request
+ * @param string $phpbb_root_path Relative path to phpBB root
+ * @param string $php_ext PHP file extension
+ * @param mixed $adm_relative_path Relative path admin path to adm/ root
+ */
+ public function __construct(\phpbb\symfony_request $symfony_request, \phpbb\filesystem $filesystem, \phpbb\request\request_interface $request, $phpbb_root_path, $php_ext, $adm_relative_path = null)
+ {
+ $this->symfony_request = $symfony_request;
+ $this->filesystem = $filesystem;
+ $this->request = $request;
+ $this->phpbb_root_path = $phpbb_root_path;
+ $this->php_ext = $php_ext;
+ $this->adm_relative_path = $adm_relative_path;
+ }
+
+ /**
+ * Get the phpBB root path
+ *
+ * @return string
+ */
+ public function get_phpbb_root_path()
+ {
+ return $this->phpbb_root_path;
+ }
+
+ /**
+ * Get the adm root path
+ *
+ * @return string
+ */
+ public function get_adm_relative_path()
+ {
+ return $this->adm_relative_path;
+ }
+
+ /**
+ * Get the php extension
+ *
+ * @return string
+ */
+ public function get_php_ext()
+ {
+ return $this->php_ext;
+ }
+
+ /**
+ * Update a web path to the correct relative root path
+ *
+ * This replaces $phpbb_root_path . some_url with
+ * get_web_root_path() . some_url
+ *
+ * @param string $path The path to be updated
+ * @return string
+ */
+ public function update_web_root_path($path)
+ {
+ if (strpos($path, $this->phpbb_root_path) === 0)
+ {
+ $path = substr($path, strlen($this->phpbb_root_path));
+
+ $web_root_path = $this->get_web_root_path();
+ if (substr($web_root_path, -8) === 'app.php/' && substr($path, 0, 7) === 'app.php')
+ {
+ $path = substr($path, 8);
+ }
+
+ return $this->filesystem->clean_path($web_root_path . $path);
+ }
+
+ return $path;
+ }
+
+ /**
+ * Strips away the web root path and prepends the normal root path
+ *
+ * This replaces get_web_root_path() . some_url with
+ * $phpbb_root_path . some_url
+ *
+ * @param string $path The path to be updated
+ * @return string
+ */
+ public function remove_web_root_path($path)
+ {
+ if (strpos($path, $this->get_web_root_path()) === 0)
+ {
+ $path = substr($path, strlen($this->get_web_root_path()));
+
+ return $this->phpbb_root_path . $path;
+ }
+
+ return $path;
+ }
+
+ /**
+ * Get a relative root path from the current URL
+ *
+ * @return string
+ */
+ public function get_web_root_path()
+ {
+ if ($this->symfony_request === null)
+ {
+ return $this->phpbb_root_path;
+ }
+
+ if (null !== $this->web_root_path)
+ {
+ return $this->web_root_path;
+ }
+
+ // We do not need to escape $path_info, $request_uri and $script_name because we can not find their content in the result.
+ // Path info (e.g. /foo/bar)
+ $path_info = $this->filesystem->clean_path($this->symfony_request->getPathInfo());
+
+ // Full request URI (e.g. phpBB/app.php/foo/bar)
+ $request_uri = $this->symfony_request->getRequestUri();
+
+ // Script name URI (e.g. phpBB/app.php)
+ $script_name = $this->symfony_request->getScriptName();
+
+ /*
+ * If the path info is empty but we're using app.php, then we
+ * might be using an empty route like app.php/ which is
+ * supported by symfony's routing
+ */
+ if ($path_info === '/' && preg_match('/app\.' . $this->php_ext . '\/$/', $request_uri))
+ {
+ return $this->web_root_path = $this->filesystem->clean_path('./../' . $this->phpbb_root_path);
+ }
+
+ /*
+ * If the path info is empty (single /), then we're not using
+ * a route like app.php/foo/bar
+ */
+ if ($path_info === '/')
+ {
+ return $this->web_root_path = $this->phpbb_root_path;
+ }
+
+ /*
+ * Check AJAX request:
+ * If the current request is a AJAX we need to fix the paths.
+ * We need to get the root path based on the Referer, so we can use
+ * the generated URLs in the template of the Referer. If we do not
+ * generate the relative path based on the Referer, but based on the
+ * currently requested URL, the generated URLs will not point to the
+ * intended locations:
+ * Referer desired URL desired relative root path
+ * memberlist.php faq.php ./
+ * memberlist.php app.php/foo/bar ./
+ * app.php/foo memberlist.php ../
+ * app.php/foo app.php/fox ../
+ * app.php/foo/bar memberlist.php ../../
+ * ../page.php memberlist.php ./phpBB/
+ * ../sub/page.php memberlist.php ./../phpBB/
+ *
+ * The referer must be specified as a parameter in the query.
+ */
+ if ($this->request->is_ajax() && $this->symfony_request->get('_referer'))
+ {
+ // We need to escape $absolute_board_url because it can be partially concatenated to the result.
+ $absolute_board_url = $this->request->escape($this->symfony_request->getSchemeAndHttpHost() . $this->symfony_request->getBasePath(), true);
+
+ $referer_web_root_path = $this->get_web_root_path_from_ajax_referer(
+ $this->symfony_request->get('_referer'),
+ $absolute_board_url
+ );
+ return $this->web_root_path = $this->phpbb_root_path . $referer_web_root_path;
+ }
+
+ // How many corrections might we need?
+ $corrections = substr_count($path_info, '/');
+
+ /*
+ * If the script name (e.g. phpBB/app.php) does not exists in the
+ * requestUri (e.g. phpBB/app.php/foo/template), then we are rewriting
+ * the URL. So we must reduce the slash count by 1.
+ */
+ if (strpos($request_uri, $script_name) !== 0)
+ {
+ $corrections--;
+ }
+
+ // Prepend ../ to the phpbb_root_path as many times as / exists in path_info
+ $this->web_root_path = $this->filesystem->clean_path(
+ './' . str_repeat('../', $corrections) . $this->phpbb_root_path
+ );
+ return $this->web_root_path;
+ }
+
+ /**
+ * Get the web root path of the referer form an ajax request
+ *
+ * @param string $absolute_referer_url
+ * @param string $absolute_board_url
+ * @return string
+ */
+ public function get_web_root_path_from_ajax_referer($absolute_referer_url, $absolute_board_url)
+ {
+ // If the board URL is in the beginning of the referer, this means
+ // we the referer is in the board URL or a subdirectory of it.
+ // So we just need to count the / (slashes) in the left over part of
+ // the referer and prepend ../ the the current root_path, to get the
+ // web root path of the referer.
+ if (strpos($absolute_referer_url, $absolute_board_url) === 0)
+ {
+ $relative_referer_path = substr($absolute_referer_url, strlen($absolute_board_url));
+ $has_params = strpos($relative_referer_path, '?');
+ if ($has_params !== false)
+ {
+ $relative_referer_path = substr($relative_referer_path, 0, $has_params);
+ }
+ $corrections = substr_count($relative_referer_path, '/');
+ return $this->phpbb_root_path . str_repeat('../', $corrections - 1);
+ }
+
+ // If not, it's a bit more complicated. We go to the parent directory
+ // of the referer until we find the remaining referer in the board URL.
+ // Foreach directory we need to add a ../ to the fixed root_path.
+ // When we finally found it, we need to remove the remaining referer
+ // from the board URL, to get the boards root path.
+ // If the then append these two strings, we get our fixed web root path.
+ $fixed_root_path = '';
+ $referer_dir = $absolute_referer_url;
+ $has_params = strpos($referer_dir, '?');
+ if ($has_params !== false)
+ {
+ $referer_dir = substr($referer_dir, 0, $has_params);
+ }
+
+ // If we do not find a slash at the end of the referer, we come
+ // from a file. So the first dirname() does not need a traversal
+ // path correction.
+ if (substr($referer_dir, -1) !== '/')
+ {
+ $referer_dir = dirname($referer_dir);
+ }
+
+ while (($dir_position = strpos($absolute_board_url, $referer_dir)) !== 0)
+ {
+ $fixed_root_path .= '../';
+ $referer_dir = dirname($referer_dir);
+
+ // Just return phpbb_root_path if we reach the top directory
+ if ($referer_dir === '.')
+ {
+ return $this->phpbb_root_path;
+ }
+ }
+
+ $fixed_root_path .= substr($absolute_board_url, strlen($referer_dir) + 1);
+ // Add trailing slash
+ return $this->phpbb_root_path . $fixed_root_path . '/';
+ }
+
+ /**
+ * Eliminates useless . and .. components from specified URL
+ *
+ * @param string $url URL to clean
+ *
+ * @return string Cleaned URL
+ */
+ public function clean_url($url)
+ {
+ $delimiter_position = strpos($url, '://');
+ // URL should contain :// but it shouldn't start with it.
+ // Do not clean URLs that do not fit these constraints.
+ if (empty($delimiter_position))
+ {
+ return $url;
+ }
+ $scheme = substr($url, 0, $delimiter_position) . '://';
+ // Add length of URL delimiter to position
+ $path = substr($url, $delimiter_position + 3);
+
+ return $scheme . $this->filesystem->clean_path($path);
+ }
+
+ /**
+ * Glue URL parameters together
+ *
+ * @param array $params URL parameters in the form of array(name => value)
+ * @return string Returns the glued string, e.g. name1=value1&amp;name2&amp;name3=value3
+ */
+ public function glue_url_params($params)
+ {
+ $_params = array();
+
+ foreach ($params as $key => $value)
+ {
+ // some parameters do not have value
+ if ($value !== null)
+ {
+ $_params[] = $key . '=' . $value;
+ }
+ else
+ {
+ $_params[] = $key;
+ }
+ }
+ return implode('&amp;', $_params);
+ }
+
+ /**
+ * Get the base and parameters of a URL
+ *
+ * @param string $url URL to break apart
+ * @param bool $is_amp Is the parameter separator &amp;. Defaults to true.
+ * @return array Returns the base and parameters in the form of array('base' => string, 'params' => array(name => value))
+ */
+ public function get_url_parts($url, $is_amp = true)
+ {
+ $separator = ($is_amp) ? '&amp;' : '&';
+ $params = array();
+
+ if (strpos($url, '?') !== false)
+ {
+ $base = substr($url, 0, strpos($url, '?'));
+ $args = substr($url, strlen($base) + 1);
+ $args = ($args) ? explode($separator, $args) : array();
+
+ foreach ($args as $argument)
+ {
+ if (empty($argument))
+ {
+ continue;
+ }
+
+ // some parameters don't have value
+ if (strpos($argument, '=') !== false)
+ {
+ list($key, $value) = explode('=', $argument, 2);
+ }
+ else
+ {
+ $key = $argument;
+ $value = null;
+ }
+
+ if ($key === '')
+ {
+ continue;
+ }
+
+ $params[$key] = $value;
+ }
+ }
+ else
+ {
+ $base = $url;
+ }
+
+ return array(
+ 'base' => $base,
+ 'params' => $params,
+ );
+ }
+
+ /**
+ * Strip parameters from an already built URL.
+ *
+ * @param string $url URL to strip parameters from
+ * @param array|string $strip Parameters to strip.
+ * @param bool $is_amp Is the parameter separator &amp;. Defaults to true.
+ * @return string Returns the new URL.
+ */
+ public function strip_url_params($url, $strip, $is_amp = true)
+ {
+ $url_parts = $this->get_url_parts($url, $is_amp);
+ $params = $url_parts['params'];
+
+ if (!is_array($strip))
+ {
+ $strip = array($strip);
+ }
+
+ if (!empty($params))
+ {
+ // Strip the parameters off
+ foreach ($strip as $param)
+ {
+ unset($params[$param]);
+ }
+ }
+
+ return $url_parts['base'] . (($params) ? '?' . $this->glue_url_params($params) : '');
+ }
+
+ /**
+ * Append parameters to an already built URL.
+ *
+ * @param string $url URL to append parameters to
+ * @param array $new_params Parameters to add in the form of array(name => value)
+ * @param bool $is_amp Is the parameter separator &amp;. Defaults to true.
+ * @return string Returns the new URL.
+ */
+ public function append_url_params($url, $new_params, $is_amp = true)
+ {
+ $url_parts = $this->get_url_parts($url, $is_amp);
+ $params = array_merge($url_parts['params'], $new_params);
+
+ // Move the sid to the end if it's set
+ if (isset($params['sid']))
+ {
+ $sid = $params['sid'];
+ unset($params['sid']);
+ $params['sid'] = $sid;
+ }
+
+ return $url_parts['base'] . (($params) ? '?' . $this->glue_url_params($params) : '');
+ }
+
+ /**
+ * Get a valid page
+ *
+ * @param string $page The page to verify
+ * @param bool $mod_rewrite Whether mod_rewrite is enabled, default: false
+ *
+ * @return string A valid page based on given page and mod_rewrite
+ */
+ public function get_valid_page($page, $mod_rewrite = false)
+ {
+ // We need to be cautious here.
+ // On some situations, the redirect path is an absolute URL, sometimes a relative path
+ // For a relative path, let's prefix it with $phpbb_root_path to point to the correct location,
+ // else we use the URL directly.
+ $url_parts = parse_url($page);
+
+ // URL
+ if ($url_parts === false || empty($url_parts['scheme']) || empty($url_parts['host']))
+ {
+ // Remove 'app.php/' from the page, when rewrite is enabled.
+ // Treat app.php as a reserved file name and remove on mod rewrite
+ // even if it might not be in the phpBB root.
+ if ($mod_rewrite && ($app_position = strpos($page, 'app.' . $this->php_ext . '/')) !== false)
+ {
+ $page = substr($page, 0, $app_position) . substr($page, $app_position + strlen('app.' . $this->php_ext . '/'));
+ }
+
+ // Remove preceding slashes from page name and prepend root path
+ $page = $this->get_phpbb_root_path() . ltrim($page, '/\\');
+ }
+
+ return $page;
+ }
+}
diff --git a/phpBB/phpbb/permissions.php b/phpBB/phpbb/permissions.php
new file mode 100644
index 0000000000..e75476f59b
--- /dev/null
+++ b/phpBB/phpbb/permissions.php
@@ -0,0 +1,362 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb;
+
+class permissions
+{
+ /**
+ * Event dispatcher object
+ * @var \phpbb\event\dispatcher_interface
+ */
+ protected $dispatcher;
+
+ /**
+ * User object
+ * @var \phpbb\user
+ */
+ protected $user;
+
+ /**
+ * Constructor
+ *
+ * @param \phpbb\event\dispatcher_interface $phpbb_dispatcher Event dispatcher
+ * @param \phpbb\user $user User Object
+ */
+ public function __construct(\phpbb\event\dispatcher_interface $phpbb_dispatcher, \phpbb\user $user)
+ {
+ $this->dispatcher = $phpbb_dispatcher;
+ $this->user = $user;
+
+ $categories = $this->categories;
+ $types = $this->types;
+ $permissions = $this->permissions;
+
+ /**
+ * Allows to specify additional permission categories, types and permissions
+ *
+ * @event core.permissions
+ * @var array types Array with permission types (a_, u_, m_, etc.)
+ * @var array categories Array with permission categories (pm, post, settings, misc, etc.)
+ * @var array permissions Array with permissions. Each Permission has the following layout:
+ * '<type><permission>' => array(
+ * 'lang' => 'Language Key with a Short description', // Optional, if not set,
+ * // the permissions identifier '<type><permission>' is used with
+ * // all uppercase.
+ * 'cat' => 'Identifier of the category, the permission should be displayed in',
+ * ),
+ * Example:
+ * 'u_viewprofile' => array(
+ * 'lang' => 'ACL_U_VIEWPROFILE',
+ * 'cat' => 'profile',
+ * ),
+ * @since 3.1.0-a1
+ */
+ $vars = array('types', 'categories', 'permissions');
+ extract($phpbb_dispatcher->trigger_event('core.permissions', compact($vars)));
+
+ $this->categories = $categories;
+ $this->types = $types;
+ $this->permissions = $permissions;
+ }
+
+ /**
+ * Returns an array with all the permission categories (pm, post, settings, misc, etc.)
+ *
+ * @return array Layout: cat-identifier => Language key
+ */
+ public function get_categories()
+ {
+ return $this->categories;
+ }
+
+ /**
+ * Returns the language string of a permission category
+ *
+ * @param string $category Identifier of the category
+ * @return string Language string
+ */
+ public function get_category_lang($category)
+ {
+ return $this->user->lang($this->categories[$category]);
+ }
+
+ /**
+ * Returns an array with all the permission types (a_, u_, m_, etc.)
+ *
+ * @return array Layout: type-identifier => Language key
+ */
+ public function get_types()
+ {
+ return $this->types;
+ }
+
+ /**
+ * Returns the language string of a permission type
+ *
+ * @param string $type Identifier of the type
+ * @param mixed $scope Scope of the type (should be 'global', 'local' or false)
+ * @return string Language string
+ */
+ public function get_type_lang($type, $scope = false)
+ {
+ if ($scope && isset($this->types[$scope][$type]))
+ {
+ $lang_key = $this->types[$scope][$type];
+ }
+ else if (isset($this->types[$type]))
+ {
+ $lang_key = $this->types[$type];
+ }
+ else
+ {
+ $lang_key = 'ACL_TYPE_' . strtoupper(($scope) ? $scope . '_' . $type : $type);
+ }
+
+ return $this->user->lang($lang_key);
+ }
+
+ /**
+ * Returns an array with all the permissions.
+ * Each Permission has the following layout:
+ * '<type><permission>' => array(
+ * 'lang' => 'Language Key with a Short description', // Optional, if not set,
+ * // the permissions identifier '<type><permission>' is used with
+ * // all uppercase.
+ * 'cat' => 'Identifier of the category, the permission should be displayed in',
+ * ),
+ * Example:
+ * 'u_viewprofile' => array(
+ * 'lang' => 'ACL_U_VIEWPROFILE',
+ * 'cat' => 'profile',
+ * ),
+ *
+ * @return array
+ */
+ public function get_permissions()
+ {
+ return $this->permissions;
+ }
+
+ /**
+ * Returns the category of a permission
+ *
+ * @param string $permission Identifier of the permission
+ * @return string Returns the category identifier of the permission
+ */
+ public function get_permission_category($permission)
+ {
+ return (isset($this->permissions[$permission]['cat'])) ? $this->permissions[$permission]['cat'] : 'misc';
+ }
+
+ /**
+ * Checks if a category has been defined
+ *
+ * @param string $category Identifier of the category
+ * @return bool True if the category is defined, false otherwise
+ */
+ public function category_defined($category)
+ {
+ return isset($this->categories[$category]);
+ }
+
+ /**
+ * Checks if a permission has been defined
+ *
+ * @param string $permission Identifier of the permission
+ * @return bool True if the permission is defined, false otherwise
+ */
+ public function permission_defined($permission)
+ {
+ return isset($this->permissions[$permission]);
+ }
+
+ /**
+ * Returns the language string of a permission
+ *
+ * @param string $permission Identifier of the permission
+ * @return string Language string
+ */
+ public function get_permission_lang($permission)
+ {
+ return (isset($this->permissions[$permission]['lang'])) ? $this->user->lang($this->permissions[$permission]['lang']) : $this->user->lang('ACL_' . strtoupper($permission));
+ }
+
+ protected $types = array(
+ 'u_' => 'ACL_TYPE_U_',
+ 'a_' => 'ACL_TYPE_A_',
+ 'm_' => 'ACL_TYPE_M_',
+ 'f_' => 'ACL_TYPE_F_',
+ 'global' => array(
+ 'm_' => 'ACL_TYPE_GLOBAL_M_',
+ ),
+ );
+
+ protected $categories = array(
+ 'actions' => 'ACL_CAT_ACTIONS',
+ 'content' => 'ACL_CAT_CONTENT',
+ 'forums' => 'ACL_CAT_FORUMS',
+ 'misc' => 'ACL_CAT_MISC',
+ 'permissions' => 'ACL_CAT_PERMISSIONS',
+ 'pm' => 'ACL_CAT_PM',
+ 'polls' => 'ACL_CAT_POLLS',
+ 'post' => 'ACL_CAT_POST',
+ 'post_actions' => 'ACL_CAT_POST_ACTIONS',
+ 'posting' => 'ACL_CAT_POSTING',
+ 'profile' => 'ACL_CAT_PROFILE',
+ 'settings' => 'ACL_CAT_SETTINGS',
+ 'topic_actions' => 'ACL_CAT_TOPIC_ACTIONS',
+ 'user_group' => 'ACL_CAT_USER_GROUP',
+ );
+
+ protected $permissions = array(
+ // User Permissions
+ 'u_viewprofile' => array('lang' => 'ACL_U_VIEWPROFILE', 'cat' => 'profile'),
+ 'u_chgname' => array('lang' => 'ACL_U_CHGNAME', 'cat' => 'profile'),
+ 'u_chgpasswd' => array('lang' => 'ACL_U_CHGPASSWD', 'cat' => 'profile'),
+ 'u_chgemail' => array('lang' => 'ACL_U_CHGEMAIL', 'cat' => 'profile'),
+ 'u_chgavatar' => array('lang' => 'ACL_U_CHGAVATAR', 'cat' => 'profile'),
+ 'u_chggrp' => array('lang' => 'ACL_U_CHGGRP', 'cat' => 'profile'),
+ 'u_chgprofileinfo' => array('lang' => 'ACL_U_CHGPROFILEINFO', 'cat' => 'profile'),
+
+ 'u_attach' => array('lang' => 'ACL_U_ATTACH', 'cat' => 'post'),
+ 'u_download' => array('lang' => 'ACL_U_DOWNLOAD', 'cat' => 'post'),
+ 'u_savedrafts' => array('lang' => 'ACL_U_SAVEDRAFTS', 'cat' => 'post'),
+ 'u_chgcensors' => array('lang' => 'ACL_U_CHGCENSORS', 'cat' => 'post'),
+ 'u_sig' => array('lang' => 'ACL_U_SIG', 'cat' => 'post'),
+
+ 'u_sendpm' => array('lang' => 'ACL_U_SENDPM', 'cat' => 'pm'),
+ 'u_masspm' => array('lang' => 'ACL_U_MASSPM', 'cat' => 'pm'),
+ 'u_masspm_group'=> array('lang' => 'ACL_U_MASSPM_GROUP', 'cat' => 'pm'),
+ 'u_readpm' => array('lang' => 'ACL_U_READPM', 'cat' => 'pm'),
+ 'u_pm_edit' => array('lang' => 'ACL_U_PM_EDIT', 'cat' => 'pm'),
+ 'u_pm_delete' => array('lang' => 'ACL_U_PM_DELETE', 'cat' => 'pm'),
+ 'u_pm_forward' => array('lang' => 'ACL_U_PM_FORWARD', 'cat' => 'pm'),
+ 'u_pm_emailpm' => array('lang' => 'ACL_U_PM_EMAILPM', 'cat' => 'pm'),
+ 'u_pm_printpm' => array('lang' => 'ACL_U_PM_PRINTPM', 'cat' => 'pm'),
+ 'u_pm_attach' => array('lang' => 'ACL_U_PM_ATTACH', 'cat' => 'pm'),
+ 'u_pm_download' => array('lang' => 'ACL_U_PM_DOWNLOAD', 'cat' => 'pm'),
+ 'u_pm_bbcode' => array('lang' => 'ACL_U_PM_BBCODE', 'cat' => 'pm'),
+ 'u_pm_smilies' => array('lang' => 'ACL_U_PM_SMILIES', 'cat' => 'pm'),
+ 'u_pm_img' => array('lang' => 'ACL_U_PM_IMG', 'cat' => 'pm'),
+ 'u_pm_flash' => array('lang' => 'ACL_U_PM_FLASH', 'cat' => 'pm'),
+
+ 'u_sendemail' => array('lang' => 'ACL_U_SENDEMAIL', 'cat' => 'misc'),
+ 'u_sendim' => array('lang' => 'ACL_U_SENDIM', 'cat' => 'misc'),
+ 'u_ignoreflood' => array('lang' => 'ACL_U_IGNOREFLOOD', 'cat' => 'misc'),
+ 'u_hideonline' => array('lang' => 'ACL_U_HIDEONLINE', 'cat' => 'misc'),
+ 'u_viewonline' => array('lang' => 'ACL_U_VIEWONLINE', 'cat' => 'misc'),
+ 'u_search' => array('lang' => 'ACL_U_SEARCH', 'cat' => 'misc'),
+
+ // Forum Permissions
+ 'f_list' => array('lang' => 'ACL_F_LIST', 'cat' => 'actions'),
+ 'f_read' => array('lang' => 'ACL_F_READ', 'cat' => 'actions'),
+ 'f_search' => array('lang' => 'ACL_F_SEARCH', 'cat' => 'actions'),
+ 'f_subscribe' => array('lang' => 'ACL_F_SUBSCRIBE', 'cat' => 'actions'),
+ 'f_print' => array('lang' => 'ACL_F_PRINT', 'cat' => 'actions'),
+ 'f_email' => array('lang' => 'ACL_F_EMAIL', 'cat' => 'actions'),
+ 'f_bump' => array('lang' => 'ACL_F_BUMP', 'cat' => 'actions'),
+ 'f_user_lock' => array('lang' => 'ACL_F_USER_LOCK', 'cat' => 'actions'),
+ 'f_download' => array('lang' => 'ACL_F_DOWNLOAD', 'cat' => 'actions'),
+ 'f_report' => array('lang' => 'ACL_F_REPORT', 'cat' => 'actions'),
+
+ 'f_post' => array('lang' => 'ACL_F_POST', 'cat' => 'post'),
+ 'f_sticky' => array('lang' => 'ACL_F_STICKY', 'cat' => 'post'),
+ 'f_announce' => array('lang' => 'ACL_F_ANNOUNCE', 'cat' => 'post'),
+ 'f_reply' => array('lang' => 'ACL_F_REPLY', 'cat' => 'post'),
+ 'f_edit' => array('lang' => 'ACL_F_EDIT', 'cat' => 'post'),
+ 'f_delete' => array('lang' => 'ACL_F_DELETE', 'cat' => 'post'),
+ 'f_softdelete' => array('lang' => 'ACL_F_SOFTDELETE', 'cat' => 'post'),
+ 'f_ignoreflood' => array('lang' => 'ACL_F_IGNOREFLOOD', 'cat' => 'post'),
+ 'f_postcount' => array('lang' => 'ACL_F_POSTCOUNT', 'cat' => 'post'),
+ 'f_noapprove' => array('lang' => 'ACL_F_NOAPPROVE', 'cat' => 'post'),
+
+ 'f_attach' => array('lang' => 'ACL_F_ATTACH', 'cat' => 'content'),
+ 'f_icons' => array('lang' => 'ACL_F_ICONS', 'cat' => 'content'),
+ 'f_bbcode' => array('lang' => 'ACL_F_BBCODE', 'cat' => 'content'),
+ 'f_flash' => array('lang' => 'ACL_F_FLASH', 'cat' => 'content'),
+ 'f_img' => array('lang' => 'ACL_F_IMG', 'cat' => 'content'),
+ 'f_sigs' => array('lang' => 'ACL_F_SIGS', 'cat' => 'content'),
+ 'f_smilies' => array('lang' => 'ACL_F_SMILIES', 'cat' => 'content'),
+
+ 'f_poll' => array('lang' => 'ACL_F_POLL', 'cat' => 'polls'),
+ 'f_vote' => array('lang' => 'ACL_F_VOTE', 'cat' => 'polls'),
+ 'f_votechg' => array('lang' => 'ACL_F_VOTECHG', 'cat' => 'polls'),
+
+ // Moderator Permissions
+ 'm_edit' => array('lang' => 'ACL_M_EDIT', 'cat' => 'post_actions'),
+ 'm_delete' => array('lang' => 'ACL_M_DELETE', 'cat' => 'post_actions'),
+ 'm_approve' => array('lang' => 'ACL_M_APPROVE', 'cat' => 'post_actions'),
+ 'm_report' => array('lang' => 'ACL_M_REPORT', 'cat' => 'post_actions'),
+ 'm_chgposter' => array('lang' => 'ACL_M_CHGPOSTER', 'cat' => 'post_actions'),
+ 'm_info' => array('lang' => 'ACL_M_INFO', 'cat' => 'post_actions'),
+ 'm_softdelete' => array('lang' => 'ACL_M_SOFTDELETE', 'cat' => 'post_actions'),
+
+ 'm_move' => array('lang' => 'ACL_M_MOVE', 'cat' => 'topic_actions'),
+ 'm_lock' => array('lang' => 'ACL_M_LOCK', 'cat' => 'topic_actions'),
+ 'm_split' => array('lang' => 'ACL_M_SPLIT', 'cat' => 'topic_actions'),
+ 'm_merge' => array('lang' => 'ACL_M_MERGE', 'cat' => 'topic_actions'),
+
+ 'm_warn' => array('lang' => 'ACL_M_WARN', 'cat' => 'misc'),
+ 'm_pm_report' => array('lang' => 'ACL_M_PM_REPORT', 'cat' => 'misc'),
+ 'm_ban' => array('lang' => 'ACL_M_BAN', 'cat' => 'misc'),
+
+ // Admin Permissions
+ 'a_board' => array('lang' => 'ACL_A_BOARD', 'cat' => 'settings'),
+ 'a_server' => array('lang' => 'ACL_A_SERVER', 'cat' => 'settings'),
+ 'a_jabber' => array('lang' => 'ACL_A_JABBER', 'cat' => 'settings'),
+ 'a_phpinfo' => array('lang' => 'ACL_A_PHPINFO', 'cat' => 'settings'),
+
+ 'a_forum' => array('lang' => 'ACL_A_FORUM', 'cat' => 'forums'),
+ 'a_forumadd' => array('lang' => 'ACL_A_FORUMADD', 'cat' => 'forums'),
+ 'a_forumdel' => array('lang' => 'ACL_A_FORUMDEL', 'cat' => 'forums'),
+ 'a_prune' => array('lang' => 'ACL_A_PRUNE', 'cat' => 'forums'),
+
+ 'a_icons' => array('lang' => 'ACL_A_ICONS', 'cat' => 'posting'),
+ 'a_words' => array('lang' => 'ACL_A_WORDS', 'cat' => 'posting'),
+ 'a_bbcode' => array('lang' => 'ACL_A_BBCODE', 'cat' => 'posting'),
+ 'a_attach' => array('lang' => 'ACL_A_ATTACH', 'cat' => 'posting'),
+
+ 'a_user' => array('lang' => 'ACL_A_USER', 'cat' => 'user_group'),
+ 'a_userdel' => array('lang' => 'ACL_A_USERDEL', 'cat' => 'user_group'),
+ 'a_group' => array('lang' => 'ACL_A_GROUP', 'cat' => 'user_group'),
+ 'a_groupadd' => array('lang' => 'ACL_A_GROUPADD', 'cat' => 'user_group'),
+ 'a_groupdel' => array('lang' => 'ACL_A_GROUPDEL', 'cat' => 'user_group'),
+ 'a_ranks' => array('lang' => 'ACL_A_RANKS', 'cat' => 'user_group'),
+ 'a_profile' => array('lang' => 'ACL_A_PROFILE', 'cat' => 'user_group'),
+ 'a_names' => array('lang' => 'ACL_A_NAMES', 'cat' => 'user_group'),
+ 'a_ban' => array('lang' => 'ACL_A_BAN', 'cat' => 'user_group'),
+
+ 'a_viewauth' => array('lang' => 'ACL_A_VIEWAUTH', 'cat' => 'permissions'),
+ 'a_authgroups' => array('lang' => 'ACL_A_AUTHGROUPS', 'cat' => 'permissions'),
+ 'a_authusers' => array('lang' => 'ACL_A_AUTHUSERS', 'cat' => 'permissions'),
+ 'a_fauth' => array('lang' => 'ACL_A_FAUTH', 'cat' => 'permissions'),
+ 'a_mauth' => array('lang' => 'ACL_A_MAUTH', 'cat' => 'permissions'),
+ 'a_aauth' => array('lang' => 'ACL_A_AAUTH', 'cat' => 'permissions'),
+ 'a_uauth' => array('lang' => 'ACL_A_UAUTH', 'cat' => 'permissions'),
+ 'a_roles' => array('lang' => 'ACL_A_ROLES', 'cat' => 'permissions'),
+ 'a_switchperm' => array('lang' => 'ACL_A_SWITCHPERM', 'cat' => 'permissions'),
+
+ 'a_styles' => array('lang' => 'ACL_A_STYLES', 'cat' => 'misc'),
+ 'a_extensions' => array('lang' => 'ACL_A_EXTENSIONS', 'cat' => 'misc'),
+ 'a_viewlogs' => array('lang' => 'ACL_A_VIEWLOGS', 'cat' => 'misc'),
+ 'a_clearlogs' => array('lang' => 'ACL_A_CLEARLOGS', 'cat' => 'misc'),
+ 'a_modules' => array('lang' => 'ACL_A_MODULES', 'cat' => 'misc'),
+ 'a_language' => array('lang' => 'ACL_A_LANGUAGE', 'cat' => 'misc'),
+ 'a_email' => array('lang' => 'ACL_A_EMAIL', 'cat' => 'misc'),
+ 'a_bots' => array('lang' => 'ACL_A_BOTS', 'cat' => 'misc'),
+ 'a_reasons' => array('lang' => 'ACL_A_REASONS', 'cat' => 'misc'),
+ 'a_backup' => array('lang' => 'ACL_A_BACKUP', 'cat' => 'misc'),
+ 'a_search' => array('lang' => 'ACL_A_SEARCH', 'cat' => 'misc'),
+ );
+}
diff --git a/phpBB/phpbb/php/ini.php b/phpBB/phpbb/php/ini.php
new file mode 100644
index 0000000000..73a30659a6
--- /dev/null
+++ b/phpBB/phpbb/php/ini.php
@@ -0,0 +1,171 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\php;
+
+/**
+* Wrapper class for ini_get function.
+*
+* Provides easier handling of the different interpretations of ini values.
+*/
+class ini
+{
+ /**
+ * Simple wrapper for ini_get()
+ * See http://php.net/manual/en/function.ini-get.php
+ *
+ * @param string $varname The configuration option name.
+ * @return bool|string False if configuration option does not exist,
+ * the configuration option value (string) otherwise.
+ */
+ public function get($varname)
+ {
+ return ini_get($varname);
+ }
+
+ /**
+ * Gets the configuration option value as a trimmed string.
+ *
+ * @param string $varname The configuration option name.
+ * @return bool|string False if configuration option does not exist,
+ * the configuration option value (string) otherwise.
+ */
+ public function get_string($varname)
+ {
+ $value = $this->get($varname);
+
+ if ($value === false)
+ {
+ return false;
+ }
+
+ return trim($value);
+ }
+
+ /**
+ * Gets configuration option value as a boolean.
+ * Interprets the string value 'off' as false.
+ *
+ * @param string $varname The configuration option name.
+ * @return bool False if configuration option does not exist.
+ * False if configuration option is disabled.
+ * True otherwise.
+ */
+ public function get_bool($varname)
+ {
+ $value = $this->get_string($varname);
+
+ if (empty($value) || strtolower($value) == 'off')
+ {
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * Gets configuration option value as an integer.
+ *
+ * @param string $varname The configuration option name.
+ * @return bool|int False if configuration option does not exist,
+ * false if configuration option value is not numeric,
+ * the configuration option value (integer) otherwise.
+ */
+ public function get_int($varname)
+ {
+ $value = $this->get_string($varname);
+
+ if (!is_numeric($value))
+ {
+ return false;
+ }
+
+ return (int) $value;
+ }
+
+ /**
+ * Gets configuration option value as a float.
+ *
+ * @param string $varname The configuration option name.
+ * @return bool|float False if configuration option does not exist,
+ * false if configuration option value is not numeric,
+ * the configuration option value (float) otherwise.
+ */
+ public function get_float($varname)
+ {
+ $value = $this->get_string($varname);
+
+ if (!is_numeric($value))
+ {
+ return false;
+ }
+
+ return (float) $value;
+ }
+
+ /**
+ * Gets configuration option value in bytes.
+ * Converts strings like '128M' to bytes (integer or float).
+ *
+ * @param string $varname The configuration option name.
+ * @return bool|int|float False if configuration option does not exist,
+ * false if configuration option value is not well-formed,
+ * the configuration option value otherwise.
+ */
+ public function get_bytes($varname)
+ {
+ $value = $this->get_string($varname);
+
+ if ($value === false)
+ {
+ return false;
+ }
+
+ if (is_numeric($value))
+ {
+ // Already in bytes.
+ return phpbb_to_numeric($value);
+ }
+ else if (strlen($value) < 2)
+ {
+ // Single character.
+ return false;
+ }
+ else if (strlen($value) < 3 && $value[0] === '-')
+ {
+ // Two characters but the first one is a minus.
+ return false;
+ }
+
+ $value_lower = strtolower($value);
+ $value_numeric = phpbb_to_numeric($value);
+
+ switch ($value_lower[strlen($value_lower) - 1])
+ {
+ case 'g':
+ $value_numeric *= 1024;
+ case 'm':
+ $value_numeric *= 1024;
+ case 'k':
+ $value_numeric *= 1024;
+ break;
+
+ default:
+ // It's not already in bytes (and thus numeric)
+ // and does not carry a unit.
+ return false;
+ }
+
+ return $value_numeric;
+ }
+}
diff --git a/phpBB/phpbb/plupload/plupload.php b/phpBB/phpbb/plupload/plupload.php
new file mode 100644
index 0000000000..04d681cea6
--- /dev/null
+++ b/phpBB/phpbb/plupload/plupload.php
@@ -0,0 +1,402 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\plupload;
+
+/**
+* This class handles all server-side plupload functions
+*/
+class plupload
+{
+ /**
+ * @var string
+ */
+ protected $phpbb_root_path;
+
+ /**
+ * @var \phpbb\config\config
+ */
+ protected $config;
+
+ /**
+ * @var \phpbb\request\request_interface
+ */
+ protected $request;
+
+ /**
+ * @var \phpbb\user
+ */
+ protected $user;
+
+ /**
+ * @var \phpbb\php\ini
+ */
+ protected $php_ini;
+
+ /**
+ * @var \phpbb\mimetype\guesser
+ */
+ protected $mimetype_guesser;
+
+ /**
+ * Final destination for uploaded files, i.e. the "files" directory.
+ * @var string
+ */
+ protected $upload_directory;
+
+ /**
+ * Temporary upload directory for plupload uploads.
+ * @var string
+ */
+ protected $temporary_directory;
+
+ /**
+ * Constructor.
+ *
+ * @param string $phpbb_root_path
+ * @param \phpbb\config\config $config
+ * @param \phpbb\request\request_interface $request
+ * @param \phpbb\user $user
+ * @param \phpbb\php\ini $php_ini
+ * @param \phpbb\mimetype\guesser $mimetype_guesser
+ */
+ public function __construct($phpbb_root_path, \phpbb\config\config $config, \phpbb\request\request_interface $request, \phpbb\user $user, \phpbb\php\ini $php_ini, \phpbb\mimetype\guesser $mimetype_guesser)
+ {
+ $this->phpbb_root_path = $phpbb_root_path;
+ $this->config = $config;
+ $this->request = $request;
+ $this->user = $user;
+ $this->php_ini = $php_ini;
+ $this->mimetype_guesser = $mimetype_guesser;
+
+ $this->set_default_directories();
+ }
+
+ /**
+ * Plupload allows for chunking so we must check for that and assemble
+ * the whole file first before performing any checks on it.
+ *
+ * @param string $form_name The name of the file element in the upload form
+ *
+ * @return array|null null if there are no chunks to piece together
+ * otherwise array containing the path to the
+ * pieced-together file and its size
+ */
+ public function handle_upload($form_name)
+ {
+ $chunks_expected = $this->request->variable('chunks', 0);
+
+ // If chunking is disabled or we are not using plupload, just return
+ // and handle the file as usual
+ if ($chunks_expected < 2)
+ {
+ return;
+ }
+
+ $file_name = $this->request->variable('name', '');
+ $chunk = $this->request->variable('chunk', 0);
+
+ $this->user->add_lang('plupload');
+ $this->prepare_temporary_directory();
+
+ $file_path = $this->temporary_filepath($file_name);
+ $this->integrate_uploaded_file($form_name, $chunk, $file_path);
+
+ // If we are done with all the chunks, strip the .part suffix and then
+ // handle the resulting file as normal, otherwise die and await the
+ // next chunk.
+ if ($chunk == $chunks_expected - 1)
+ {
+ rename("{$file_path}.part", $file_path);
+
+ // Reset upload directories to defaults once completed
+ $this->set_default_directories();
+
+ // Need to modify some of the $_FILES values to reflect the new file
+ return array(
+ 'tmp_name' => $file_path,
+ 'name' => $this->request->variable('real_filename', '', true),
+ 'size' => filesize($file_path),
+ 'type' => $this->mimetype_guesser->guess($file_path, $file_name),
+ );
+ }
+ else
+ {
+ $json_response = new \phpbb\json_response();
+ $json_response->send(array(
+ 'jsonrpc' => '2.0',
+ 'id' => 'id',
+ 'result' => null,
+ ));
+ }
+ }
+
+ /**
+ * Fill in the plupload configuration options in the template
+ *
+ * @param \phpbb\cache\service $cache
+ * @param \phpbb\template\template $template
+ * @param string $s_action The URL to submit the POST data to
+ * @param int $forum_id The ID of the forum
+ * @param int $max_files Maximum number of files allowed. 0 for unlimited.
+ *
+ * @return null
+ */
+ public function configure(\phpbb\cache\service $cache, \phpbb\template\template $template, $s_action, $forum_id, $max_files)
+ {
+ $filters = $this->generate_filter_string($cache, $forum_id);
+ $chunk_size = $this->get_chunk_size();
+ $resize = $this->generate_resize_string();
+
+ $template->assign_vars(array(
+ 'S_RESIZE' => $resize,
+ 'S_PLUPLOAD' => true,
+ 'FILTERS' => $filters,
+ 'CHUNK_SIZE' => $chunk_size,
+ 'S_PLUPLOAD_URL' => htmlspecialchars_decode($s_action),
+ 'MAX_ATTACHMENTS' => $max_files,
+ 'ATTACH_ORDER' => ($this->config['display_order']) ? 'asc' : 'desc',
+ 'L_TOO_MANY_ATTACHMENTS' => $this->user->lang('TOO_MANY_ATTACHMENTS', $max_files),
+ ));
+
+ $this->user->add_lang('plupload');
+ }
+
+ /**
+ * Checks whether the page request was sent by plupload or not
+ *
+ * @return bool
+ */
+ public function is_active()
+ {
+ return $this->request->header('X-PHPBB-USING-PLUPLOAD', false);
+ }
+
+ /**
+ * Returns whether the current HTTP request is a multipart request.
+ *
+ * @return bool
+ */
+ public function is_multipart()
+ {
+ $content_type = $this->request->server('CONTENT_TYPE');
+
+ return strpos($content_type, 'multipart') === 0;
+ }
+
+ /**
+ * Sends an error message back to the client via JSON response
+ *
+ * @param int $code The error code
+ * @param string $msg The translation string of the message to be sent
+ *
+ * @return null
+ */
+ public function emit_error($code, $msg)
+ {
+ $json_response = new \phpbb\json_response();
+ $json_response->send(array(
+ 'jsonrpc' => '2.0',
+ 'id' => 'id',
+ 'error' => array(
+ 'code' => $code,
+ 'message' => $this->user->lang($msg),
+ ),
+ ));
+ }
+
+ /**
+ * Looks at the list of allowed extensions and generates a string
+ * appropriate for use in configuring plupload with
+ *
+ * @param \phpbb\cache\service $cache
+ * @param string $forum_id The ID of the forum
+ *
+ * @return string
+ */
+ public function generate_filter_string(\phpbb\cache\service $cache, $forum_id)
+ {
+ $attach_extensions = $cache->obtain_attach_extensions($forum_id);
+ unset($attach_extensions['_allowed_']);
+ $groups = array();
+
+ // Re-arrange the extension array to $groups[$group_name][]
+ foreach ($attach_extensions as $extension => $extension_info)
+ {
+ if (!isset($groups[$extension_info['group_name']]))
+ {
+ $groups[$extension_info['group_name']] = array();
+ }
+
+ $groups[$extension_info['group_name']][] = $extension;
+ }
+
+ $filters = array();
+ foreach ($groups as $group => $extensions)
+ {
+ $filters[] = sprintf(
+ "{title: '%s', extensions: '%s'}",
+ addslashes(ucfirst(strtolower($group))),
+ addslashes(implode(',', $extensions))
+ );
+ }
+
+ return implode(',', $filters);
+ }
+
+ /**
+ * Generates a string that is used to tell plupload to automatically resize
+ * files before uploading them.
+ *
+ * @return string
+ */
+ public function generate_resize_string()
+ {
+ $resize = '';
+ if ($this->config['img_max_height'] > 0 && $this->config['img_max_width'] > 0)
+ {
+ $resize = sprintf(
+ 'resize: {width: %d, height: %d, quality: 85},',
+ (int) $this->config['img_max_width'],
+ (int) $this->config['img_max_height']
+ );
+ }
+
+ return $resize;
+ }
+
+ /**
+ * Checks various php.ini values and the maximum file size to determine
+ * the maximum size chunks a file can be split up into for upload
+ *
+ * @return int
+ */
+ public function get_chunk_size()
+ {
+ $max = min(
+ $this->php_ini->get_bytes('upload_max_filesize'),
+ $this->php_ini->get_bytes('post_max_size'),
+ max(1, $this->php_ini->get_bytes('memory_limit')),
+ $this->config['max_filesize']
+ );
+
+ // Use half of the maximum possible to leave plenty of room for other
+ // POST data.
+ return floor($max / 2);
+ }
+
+ protected function temporary_filepath($file_name)
+ {
+ // Must preserve the extension for plupload to work.
+ return sprintf(
+ '%s/%s_%s%s',
+ $this->temporary_directory,
+ $this->config['plupload_salt'],
+ md5($file_name),
+ \filespec::get_extension($file_name)
+ );
+ }
+
+ /**
+ * Checks whether the chunk we are about to deal with was actually uploaded
+ * by PHP and actually exists, if not, it generates an error
+ *
+ * @param string $form_name The name of the file in the form data
+ *
+ * @return null
+ */
+ protected function integrate_uploaded_file($form_name, $chunk, $file_path)
+ {
+ $is_multipart = $this->is_multipart();
+ $upload = $this->request->file($form_name);
+ if ($is_multipart && (!isset($upload['tmp_name']) || !is_uploaded_file($upload['tmp_name'])))
+ {
+ $this->emit_error(103, 'PLUPLOAD_ERR_MOVE_UPLOADED');
+ }
+
+ $tmp_file = $this->temporary_filepath($upload['tmp_name']);
+
+ if (!phpbb_is_writable($this->temporary_directory) || !move_uploaded_file($upload['tmp_name'], $tmp_file))
+ {
+ $this->emit_error(103, 'PLUPLOAD_ERR_MOVE_UPLOADED');
+ }
+
+ $out = fopen("{$file_path}.part", $chunk == 0 ? 'wb' : 'ab');
+ if (!$out)
+ {
+ $this->emit_error(102, 'PLUPLOAD_ERR_OUTPUT');
+ }
+
+ $in = fopen(($is_multipart) ? $tmp_file : 'php://input', 'rb');
+ if (!$in)
+ {
+ $this->emit_error(101, 'PLUPLOAD_ERR_INPUT');
+ }
+
+ while ($buf = fread($in, 4096))
+ {
+ fwrite($out, $buf);
+ }
+
+ fclose($in);
+ fclose($out);
+
+ if ($is_multipart)
+ {
+ unlink($tmp_file);
+ }
+ }
+
+ /**
+ * Creates the temporary directory if it does not already exist.
+ *
+ * @return null
+ */
+ protected function prepare_temporary_directory()
+ {
+ if (!file_exists($this->temporary_directory))
+ {
+ mkdir($this->temporary_directory);
+
+ copy(
+ $this->upload_directory . '/index.htm',
+ $this->temporary_directory . '/index.htm'
+ );
+ }
+ }
+
+ /**
+ * Sets the default directories for uploads
+ *
+ * @return null
+ */
+ protected function set_default_directories()
+ {
+ $this->upload_directory = $this->phpbb_root_path . $this->config['upload_path'];
+ $this->temporary_directory = $this->upload_directory . '/plupload';
+ }
+
+ /**
+ * Sets the upload directories to the specified paths
+ *
+ * @param string $upload_directory Upload directory
+ * @param string $temporary_directory Temporary directory
+ *
+ * @return null
+ */
+ public function set_upload_directories($upload_directory, $temporary_directory)
+ {
+ $this->upload_directory = $upload_directory;
+ $this->temporary_directory = $temporary_directory;
+ }
+}
diff --git a/phpBB/phpbb/profilefields/lang_helper.php b/phpBB/phpbb/profilefields/lang_helper.php
new file mode 100644
index 0000000000..2e353722b2
--- /dev/null
+++ b/phpBB/phpbb/profilefields/lang_helper.php
@@ -0,0 +1,140 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\profilefields;
+
+/**
+* Custom Profile Fields
+*/
+class lang_helper
+{
+ /**
+ * Array with the language option, grouped by field and language
+ * @var array
+ */
+ protected $options_lang = array();
+
+ /**
+ * Database object
+ * @var \phpbb\db\driver\driver_interface
+ */
+ protected $db;
+
+ /**
+ * Table where the language strings are stored
+ * @var string
+ */
+ protected $language_table;
+
+ /**
+ * Construct
+ *
+ * @param \phpbb\db\driver\driver_interface $db Database object
+ * @param string $language_table Table where the language strings are stored
+ */
+ public function __construct($db, $language_table)
+ {
+ $this->db = $db;
+ $this->language_table = $language_table;
+ }
+
+ /**
+ * Loads preview options into language entries for options
+ *
+ * @param int $field_id
+ * @param int $lang_id
+ * @param mixed $preview_options
+ */
+ public function load_preview_options($field_id, $lang_id, $preview_options)
+ {
+ $lang_options = (!is_array($preview_options)) ? explode("\n", $preview_options) : $preview_options;
+
+ foreach ($lang_options as $num => $var)
+ {
+ if (!isset($this->options_lang[$field_id]))
+ {
+ $this->options_lang[$field_id] = array();
+ }
+ if (!isset($this->options_lang[$field_id][$lang_id]))
+ {
+ $this->options_lang[$field_id][$lang_id] = array();
+ }
+ $this->options_lang[$field_id][$lang_id][($num + 1)] = $var;
+ }
+ }
+
+ /**
+ * Fetches language entries for options from DB
+ *
+ * @param int $lang_id
+ */
+ public function load_option_lang($lang_id)
+ {
+ $sql = 'SELECT field_id, option_id, lang_value
+ FROM ' . $this->language_table . '
+ WHERE lang_id = ' . (int) $lang_id . "
+ ORDER BY option_id";
+
+ $result = $this->db->sql_query($sql);
+
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $this->options_lang[$row['field_id']][$lang_id][($row['option_id'] + 1)] = $row['lang_value'];
+ }
+
+ $this->db->sql_freeresult($result);
+ }
+
+ /**
+ * Are language options set for this field?
+ *
+ * @param int $field_id Database ID of the field
+ * @param int $lang_id ID of the language
+ * @param int $field_value Selected value of the field
+ * @return boolean
+ */
+ public function is_set($field_id, $lang_id = null, $field_value = null)
+ {
+ $is_set = isset($this->options_lang[$field_id]);
+
+ if ($is_set && (!is_null($lang_id) || !is_null($field_value)))
+ {
+ $is_set = isset($this->options_lang[$field_id][$lang_id]);
+ }
+
+ if ($is_set && !is_null($field_value))
+ {
+ $is_set = isset($this->options_lang[$field_id][$lang_id][$field_value]);
+ }
+
+ return $is_set;
+ }
+
+ /**
+ * Get the selected language string
+ *
+ * @param int $field_id Database ID of the field
+ * @param int $lang_id ID of the language
+ * @param int $field_value Selected value of the field
+ * @return string
+ */
+ public function get($field_id, $lang_id, $field_value = null)
+ {
+ if (is_null($field_value))
+ {
+ return $this->options_lang[$field_id][$lang_id];
+ }
+
+ return $this->options_lang[$field_id][$lang_id][$field_value];
+ }
+}
diff --git a/phpBB/phpbb/profilefields/manager.php b/phpBB/phpbb/profilefields/manager.php
new file mode 100644
index 0000000000..ea4b24af56
--- /dev/null
+++ b/phpBB/phpbb/profilefields/manager.php
@@ -0,0 +1,502 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\profilefields;
+
+/**
+* Custom Profile Fields
+*/
+class manager
+{
+ /**
+ * Auth object
+ * @var \phpbb\auth\auth
+ */
+ protected $auth;
+
+ /**
+ * Database object
+ * @var \phpbb\db\driver\driver_interface
+ */
+ protected $db;
+
+ /**
+ * Event dispatcher object
+ * @var \phpbb\event\dispatcher_interface
+ */
+ protected $dispatcher;
+
+ /**
+ * Request object
+ * @var \phpbb\request\request
+ */
+ protected $request;
+
+ /**
+ * Template object
+ * @var \phpbb\template\template
+ */
+ protected $template;
+
+ /**
+ * Service Collection object
+ * @var \phpbb\di\service_collection
+ */
+ protected $type_collection;
+
+ /**
+ * User object
+ * @var \phpbb\user
+ */
+ protected $user;
+
+ protected $fields_table;
+
+ protected $fields_language_table;
+
+ protected $fields_data_table;
+
+ protected $profile_cache = array();
+
+ /**
+ * Construct
+ *
+ * @param \phpbb\auth\auth $auth Auth object
+ * @param \phpbb\db\driver\driver_interface $db Database object
+ * @param \phpbb\event\dispatcher_interface $dispatcher Event dispatcher object
+ * @param \phpbb\request\request $request Request object
+ * @param \phpbb\template\template $template Template object
+ * @param \phpbb\di\service_collection $type_collection
+ * @param \phpbb\user $user User object
+ * @param string $fields_table
+ * @param string $fields_language_table
+ * @param string $fields_data_table
+ */
+ public function __construct(\phpbb\auth\auth $auth, \phpbb\db\driver\driver_interface $db, \phpbb\event\dispatcher_interface $dispatcher, \phpbb\request\request $request, \phpbb\template\template $template, \phpbb\di\service_collection $type_collection, \phpbb\user $user, $fields_table, $fields_language_table, $fields_data_table)
+ {
+ $this->auth = $auth;
+ $this->db = $db;
+ $this->dispatcher = $dispatcher;
+ $this->request = $request;
+ $this->template = $template;
+ $this->type_collection = $type_collection;
+ $this->user = $user;
+
+ $this->fields_table = $fields_table;
+ $this->fields_language_table = $fields_language_table;
+ $this->fields_data_table = $fields_data_table;
+ }
+
+ /**
+ * Assign editable fields to template, mode can be profile (for profile change) or register (for registration)
+ * Called by ucp_profile and ucp_register
+ */
+ public function generate_profile_fields($mode, $lang_id)
+ {
+ $sql_where = '';
+ switch ($mode)
+ {
+ case 'register':
+ // If the field is required we show it on the registration page
+ $sql_where .= ' AND f.field_show_on_reg = 1';
+ break;
+
+ case 'profile':
+ // Show hidden fields to moderators/admins
+ if (!$this->auth->acl_gets('a_', 'm_') && !$this->auth->acl_getf_global('m_'))
+ {
+ $sql_where .= ' AND f.field_show_profile = 1';
+ }
+ break;
+
+ default:
+ trigger_error('Wrong profile mode specified', E_USER_ERROR);
+ break;
+ }
+
+ $sql = 'SELECT l.*, f.*
+ FROM ' . $this->fields_language_table . ' l, ' . $this->fields_table . " f
+ WHERE f.field_active = 1
+ $sql_where
+ AND l.lang_id = " . (int) $lang_id . '
+ AND l.field_id = f.field_id
+ ORDER BY f.field_order';
+ $result = $this->db->sql_query($sql);
+
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ // Return templated field
+ $profile_field = $this->type_collection[$row['field_type']];
+ $tpl_snippet = $profile_field->process_field_row('change', $row);
+
+ $this->template->assign_block_vars('profile_fields', array(
+ 'LANG_NAME' => $this->user->lang($row['lang_name']),
+ 'LANG_EXPLAIN' => $this->user->lang($row['lang_explain']),
+ 'FIELD' => $tpl_snippet,
+ 'FIELD_ID' => $profile_field->get_field_ident($row),
+ 'S_REQUIRED' => ($row['field_required']) ? true : false,
+ ));
+ }
+ $this->db->sql_freeresult($result);
+ }
+
+ /**
+ * Build profile cache, used for display
+ */
+ protected function build_cache()
+ {
+ $this->profile_cache = array();
+
+ // Display hidden/no_view fields for admin/moderator
+ $sql = 'SELECT l.*, f.*
+ FROM ' . $this->fields_language_table . ' l, ' . $this->fields_table . ' f
+ WHERE l.lang_id = ' . $this->user->get_iso_lang_id() . '
+ AND f.field_active = 1 ' .
+ ((!$this->auth->acl_gets('a_', 'm_') && !$this->auth->acl_getf_global('m_')) ? ' AND f.field_hide = 0 ' : '') . '
+ AND f.field_no_view = 0
+ AND l.field_id = f.field_id
+ ORDER BY f.field_order';
+ $result = $this->db->sql_query($sql);
+
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $this->profile_cache[$row['field_ident']] = $row;
+ }
+ $this->db->sql_freeresult($result);
+ }
+
+ /**
+ * Submit profile field for validation
+ */
+ public function submit_cp_field($mode, $lang_id, &$cp_data, &$cp_error)
+ {
+ $sql_where = '';
+ switch ($mode)
+ {
+ case 'register':
+ // If the field is required we show it on the registration page
+ $sql_where .= ' AND f.field_show_on_reg = 1';
+ break;
+
+ case 'profile':
+ // Show hidden fields to moderators/admins
+ if (!$this->auth->acl_gets('a_', 'm_') && !$this->auth->acl_getf_global('m_'))
+ {
+ $sql_where .= ' AND f.field_show_profile = 1';
+ }
+ break;
+
+ default:
+ trigger_error('Wrong profile mode specified', E_USER_ERROR);
+ break;
+ }
+
+ $sql = 'SELECT l.*, f.*
+ FROM ' . $this->fields_language_table . ' l, ' . $this->fields_table . ' f
+ WHERE l.lang_id = ' . (int) $lang_id . "
+ AND f.field_active = 1
+ $sql_where
+ AND l.field_id = f.field_id
+ ORDER BY f.field_order";
+ $result = $this->db->sql_query($sql);
+
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $profile_field = $this->type_collection[$row['field_type']];
+ $cp_data['pf_' . $row['field_ident']] = $profile_field->get_profile_field($row);
+ $check_value = $cp_data['pf_' . $row['field_ident']];
+
+ if (($cp_result = $profile_field->validate_profile_field($check_value, $row)) !== false)
+ {
+ // If the result is not false, it's an error message
+ $cp_error[] = $cp_result;
+ }
+ }
+ $this->db->sql_freeresult($result);
+ }
+
+ /**
+ * Update profile field data directly
+ */
+ public function update_profile_field_data($user_id, $cp_data)
+ {
+ if (!sizeof($cp_data))
+ {
+ return;
+ }
+
+ $sql = 'UPDATE ' . $this->fields_data_table . '
+ SET ' . $this->db->sql_build_array('UPDATE', $cp_data) . '
+ WHERE user_id = ' . (int) $user_id;
+ $this->db->sql_query($sql);
+
+ if (!$this->db->sql_affectedrows())
+ {
+ $cp_data = $this->build_insert_sql_array($cp_data);
+ $cp_data['user_id'] = (int) $user_id;
+
+ $sql = 'INSERT INTO ' . $this->fields_data_table . ' ' . $this->db->sql_build_array('INSERT', $cp_data);
+ $this->db->sql_query($sql);
+ }
+ }
+
+ /**
+ * Generate the template arrays in order to display the column names
+ *
+ * @param string $restrict_option Restrict the published fields to a certain profile field option
+ * @return array Returns an array with the template variables type, name and explain for the fields to display
+ */
+ public function generate_profile_fields_template_headlines($restrict_option = '')
+ {
+ if (!sizeof($this->profile_cache))
+ {
+ $this->build_cache();
+ }
+
+ $tpl_fields = array();
+
+ // Go through the fields in correct order
+ foreach ($this->profile_cache as $field_ident => $field_data)
+ {
+ if ($restrict_option && !$field_data[$restrict_option])
+ {
+ continue;
+ }
+
+ $profile_field = $this->type_collection[$field_data['field_type']];
+
+ $tpl_fields[] = array(
+ 'PROFILE_FIELD_IDENT' => $field_ident,
+ 'PROFILE_FIELD_TYPE' => $field_data['field_type'],
+ 'PROFILE_FIELD_NAME' => $profile_field->get_field_name($field_data['lang_name']),
+ 'PROFILE_FIELD_EXPLAIN' => $this->user->lang($field_data['lang_explain']),
+ );
+ }
+
+ $profile_cache = $this->profile_cache;
+
+ /**
+ * Event to modify template headlines of the generated profile fields
+ *
+ * @event core.generate_profile_fields_template_headlines
+ * @var string restrict_option Restrict the published fields to a certain profile field option
+ * @var array tpl_fields Array with template data fields
+ * @var array profile_cache A copy of the profile cache to make additional checks
+ * @since 3.1.6-RC1
+ */
+ $vars = array(
+ 'restrict_option',
+ 'tpl_fields',
+ 'profile_cache',
+ );
+ extract($this->dispatcher->trigger_event('core.generate_profile_fields_template_headlines', compact($vars)));
+ unset($profile_cache);
+
+ return $tpl_fields;
+ }
+
+ /**
+ * Grab the user specific profile fields data
+ *
+ * @param int|array $user_ids Single user id or an array of ids
+ * @return array Users profile fields data
+ */
+ public function grab_profile_fields_data($user_ids = 0)
+ {
+ if (!is_array($user_ids))
+ {
+ $user_ids = array($user_ids);
+ }
+
+ if (!sizeof($this->profile_cache))
+ {
+ $this->build_cache();
+ }
+
+ if (!sizeof($user_ids))
+ {
+ return array();
+ }
+
+ $sql = 'SELECT *
+ FROM ' . $this->fields_data_table . '
+ WHERE ' . $this->db->sql_in_set('user_id', array_map('intval', $user_ids));
+ $result = $this->db->sql_query($sql);
+
+ $field_data = array();
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $field_data[$row['user_id']] = $row;
+ }
+ $this->db->sql_freeresult($result);
+
+ /**
+ * Event to modify profile fields data retrieved from the database
+ *
+ * @event core.grab_profile_fields_data
+ * @var array user_ids Single user id or an array of ids
+ * @var array field_data Array with profile fields data
+ * @since 3.1.0-b3
+ */
+ $vars = array('user_ids', 'field_data');
+ extract($this->dispatcher->trigger_event('core.grab_profile_fields_data', compact($vars)));
+
+ $user_fields = array();
+
+ // Go through the fields in correct order
+ foreach (array_keys($this->profile_cache) as $used_ident)
+ {
+ foreach ($field_data as $user_id => $row)
+ {
+ $user_fields[$user_id][$used_ident]['value'] = $row['pf_' . $used_ident];
+ $user_fields[$user_id][$used_ident]['data'] = $this->profile_cache[$used_ident];
+ }
+
+ foreach ($user_ids as $user_id)
+ {
+ if (!isset($user_fields[$user_id][$used_ident]) && $this->profile_cache[$used_ident]['field_show_novalue'])
+ {
+ $user_fields[$user_id][$used_ident]['value'] = '';
+ $user_fields[$user_id][$used_ident]['data'] = $this->profile_cache[$used_ident];
+ }
+ }
+ }
+
+ return $user_fields;
+ }
+
+ /**
+ * Assign the user's profile fields data to the template
+ *
+ * @param array $profile_row Array with users profile field data
+ * @param bool $use_contact_fields Should we display contact fields as such?
+ * This requires special treatments (links should not be parsed in the values, and more)
+ * @return array
+ */
+ public function generate_profile_fields_template_data($profile_row, $use_contact_fields = true)
+ {
+ // $profile_row == $user_fields[$row['user_id']];
+ $tpl_fields = array();
+ $tpl_fields['row'] = $tpl_fields['blockrow'] = array();
+
+ /**
+ * Event to modify data of the generated profile fields, before the template assignment loop
+ *
+ * @event core.generate_profile_fields_template_data_before
+ * @var array profile_row Array with users profile field data
+ * @var array tpl_fields Array with template data fields
+ * @var bool use_contact_fields Should we display contact fields as such?
+ * @since 3.1.0-b3
+ */
+ $vars = array('profile_row', 'tpl_fields', 'use_contact_fields');
+ extract($this->dispatcher->trigger_event('core.generate_profile_fields_template_data_before', compact($vars)));
+
+ foreach ($profile_row as $ident => $ident_ary)
+ {
+ $profile_field = $this->type_collection[$ident_ary['data']['field_type']];
+ $value = $profile_field->get_profile_value($ident_ary['value'], $ident_ary['data']);
+ $value_raw = $profile_field->get_profile_value_raw($ident_ary['value'], $ident_ary['data']);
+
+ if ($value === null)
+ {
+ continue;
+ }
+
+ $field_desc = $contact_url = '';
+ if ($use_contact_fields && $ident_ary['data']['field_is_contact'])
+ {
+ $value = $profile_field->get_profile_contact_value($ident_ary['value'], $ident_ary['data']);
+ $field_desc = $this->user->lang($ident_ary['data']['field_contact_desc']);
+ if (strpos($field_desc, '%s') !== false)
+ {
+ $field_desc = sprintf($field_desc, $value);
+ }
+ $contact_url = '';
+ if (strpos($ident_ary['data']['field_contact_url'], '%s') !== false)
+ {
+ $contact_url = sprintf($ident_ary['data']['field_contact_url'], $value);
+ }
+ }
+
+ $tpl_fields['row'] += array(
+ 'PROFILE_' . strtoupper($ident) . '_IDENT' => $ident,
+ 'PROFILE_' . strtoupper($ident) . '_VALUE' => $value,
+ 'PROFILE_' . strtoupper($ident) . '_VALUE_RAW' => $value_raw,
+ 'PROFILE_' . strtoupper($ident) . '_CONTACT' => $contact_url,
+ 'PROFILE_' . strtoupper($ident) . '_DESC' => $field_desc,
+ 'PROFILE_' . strtoupper($ident) . '_TYPE' => $ident_ary['data']['field_type'],
+ 'PROFILE_' . strtoupper($ident) . '_NAME' => $this->user->lang($ident_ary['data']['lang_name']),
+ 'PROFILE_' . strtoupper($ident) . '_EXPLAIN' => $this->user->lang($ident_ary['data']['lang_explain']),
+
+ 'S_PROFILE_' . strtoupper($ident) . '_CONTACT' => $ident_ary['data']['field_is_contact'],
+ 'S_PROFILE_' . strtoupper($ident) => true,
+ );
+
+ $tpl_fields['blockrow'][] = array(
+ 'PROFILE_FIELD_IDENT' => $ident,
+ 'PROFILE_FIELD_VALUE' => $value,
+ 'PROFILE_FIELD_VALUE_RAW' => $value_raw,
+ 'PROFILE_FIELD_CONTACT' => $contact_url,
+ 'PROFILE_FIELD_DESC' => $field_desc,
+ 'PROFILE_FIELD_TYPE' => $ident_ary['data']['field_type'],
+ 'PROFILE_FIELD_NAME' => $this->user->lang($ident_ary['data']['lang_name']),
+ 'PROFILE_FIELD_EXPLAIN' => $this->user->lang($ident_ary['data']['lang_explain']),
+
+ 'S_PROFILE_CONTACT' => $ident_ary['data']['field_is_contact'],
+ 'S_PROFILE_' . strtoupper($ident) => true,
+ );
+ }
+
+ /**
+ * Event to modify template data of the generated profile fields
+ *
+ * @event core.generate_profile_fields_template_data
+ * @var array profile_row Array with users profile field data
+ * @var array tpl_fields Array with template data fields
+ * @var bool use_contact_fields Should we display contact fields as such?
+ * @since 3.1.0-b3
+ */
+ $vars = array('profile_row', 'tpl_fields', 'use_contact_fields');
+ extract($this->dispatcher->trigger_event('core.generate_profile_fields_template_data', compact($vars)));
+
+ return $tpl_fields;
+ }
+
+ /**
+ * Build Array for user insertion into custom profile fields table
+ */
+ public function build_insert_sql_array($cp_data)
+ {
+ $sql_not_in = array();
+ foreach ($cp_data as $key => $null)
+ {
+ $sql_not_in[] = (strncmp($key, 'pf_', 3) === 0) ? substr($key, 3) : $key;
+ }
+
+ $sql = 'SELECT f.field_type, f.field_ident, f.field_default_value, l.lang_default_value
+ FROM ' . $this->fields_language_table . ' l, ' . $this->fields_table . ' f
+ WHERE l.lang_id = ' . $this->user->get_iso_lang_id() . '
+ ' . ((sizeof($sql_not_in)) ? ' AND ' . $this->db->sql_in_set('f.field_ident', $sql_not_in, true) : '') . '
+ AND l.field_id = f.field_id';
+ $result = $this->db->sql_query($sql);
+
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $profile_field = $this->type_collection[$row['field_type']];
+ $cp_data['pf_' . $row['field_ident']] = $profile_field->get_default_field_value($row);
+ }
+ $this->db->sql_freeresult($result);
+
+ return $cp_data;
+ }
+}
diff --git a/phpBB/phpbb/profilefields/type/type_base.php b/phpBB/phpbb/profilefields/type/type_base.php
new file mode 100644
index 0000000000..9b4bada26d
--- /dev/null
+++ b/phpBB/phpbb/profilefields/type/type_base.php
@@ -0,0 +1,206 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\profilefields\type;
+
+abstract class type_base implements type_interface
+{
+ /**
+ * Request object
+ * @var \phpbb\request\request
+ */
+ protected $request;
+
+ /**
+ * Template object
+ * @var \phpbb\template\template
+ */
+ protected $template;
+
+ /**
+ * User object
+ * @var \phpbb\user
+ */
+ protected $user;
+
+ /**
+ * Construct
+ *
+ * @param \phpbb\request\request $request Request object
+ * @param \phpbb\template\template $template Template object
+ * @param \phpbb\user $user User object
+ */
+ public function __construct(\phpbb\request\request $request, \phpbb\template\template $template, \phpbb\user $user)
+ {
+ $this->request = $request;
+ $this->template = $template;
+ $this->user = $user;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function get_name()
+ {
+ return $this->user->lang('FIELD_' . strtoupper($this->get_name_short()));
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function get_service_name()
+ {
+ return 'profilefields.type.' . $this->get_name_short();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function get_template_filename()
+ {
+ return 'profilefields/' . $this->get_name_short() . '.html';
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function get_field_ident($field_data)
+ {
+ return 'pf_' . $field_data['field_ident'];
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function get_field_name($field_name)
+ {
+ return isset($this->user->lang[$field_name]) ? $this->user->lang[$field_name] : $field_name;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function get_profile_contact_value($field_value, $field_data)
+ {
+ return $this->get_profile_value($field_value, $field_data);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function get_language_options_input($field_data)
+ {
+ $field_data['l_lang_name'] = $this->request->variable('l_lang_name', array(0 => ''), true);
+ $field_data['l_lang_explain'] = $this->request->variable('l_lang_explain', array(0 => ''), true);
+ $field_data['l_lang_default_value'] = $this->request->variable('l_lang_default_value', array(0 => ''), true);
+ $field_data['l_lang_options'] = $this->request->variable('l_lang_options', array(0 => ''), true);
+
+ return $field_data;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function prepare_options_form(&$exclude_options, &$visibility_options)
+ {
+ return $this->request->variable('lang_options', '', true);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function validate_options_on_submit($error, $field_data)
+ {
+ return $error;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function get_excluded_options($key, $action, $current_value, &$field_data, $step)
+ {
+ if ($step == 3 && ($field_data[$key] || $action != 'edit') && $key == 'l_lang_options' && is_array($field_data[$key]))
+ {
+ foreach ($field_data[$key] as $lang_id => $options)
+ {
+ $field_data[$key][$lang_id] = is_array($options) ? $options : explode("\n", $options);
+ }
+
+ return $current_value;
+ }
+
+ return $current_value;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function prepare_hidden_fields($step, $key, $action, &$field_data)
+ {
+ if (!$this->request->is_set($key))
+ {
+ // Do not set this variable, we will use the default value
+ return null;
+ }
+ else if ($key == 'field_ident' && isset($field_data[$key]))
+ {
+ return $field_data[$key];
+ }
+ else
+ {
+ $default_value = '';
+ $lang_fields = array(
+ 'l_lang_name',
+ 'l_lang_explain',
+ 'l_lang_default_value',
+ 'l_lang_options',
+ );
+
+ if (in_array($key, $lang_fields))
+ {
+ $default_value = array(0 => '');
+ }
+ return $this->request->variable($key, $default_value, true);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function display_options(&$template_vars, &$field_data)
+ {
+ return;
+ }
+
+ /**
+ * Return templated value/field. Possible values for $mode are:
+ * change == user is able to set/enter profile values; preview == just show the value
+ */
+ public function process_field_row($mode, $profile_row)
+ {
+ $preview_options = ($mode == 'preview') ? $profile_row['lang_options'] : false;
+
+ // set template filename
+ $this->template->set_filenames(array(
+ 'cp_body' => $this->get_template_filename(),
+ ));
+
+ // empty previously filled blockvars
+ $this->template->destroy_block_vars($this->get_name_short());
+
+ // Assign template variables
+ $this->generate_field($profile_row, $preview_options);
+
+ return $this->template->assign_display('cp_body');
+ }
+}
diff --git a/phpBB/phpbb/profilefields/type/type_bool.php b/phpBB/phpbb/profilefields/type/type_bool.php
new file mode 100644
index 0000000000..f6f3f17a6c
--- /dev/null
+++ b/phpBB/phpbb/profilefields/type/type_bool.php
@@ -0,0 +1,415 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\profilefields\type;
+
+class type_bool extends type_base
+{
+ /**
+ * Profile fields language helper
+ * @var \phpbb\profilefields\lang_helper
+ */
+ protected $lang_helper;
+
+ /**
+ * Request object
+ * @var \phpbb\request\request
+ */
+ protected $request;
+
+ /**
+ * Template object
+ * @var \phpbb\template\template
+ */
+ protected $template;
+
+ /**
+ * User object
+ * @var \phpbb\user
+ */
+ protected $user;
+
+ /**
+ * Construct
+ *
+ * @param \phpbb\profilefields\lang_helper $lang_helper Profile fields language helper
+ * @param \phpbb\request\request $request Request object
+ * @param \phpbb\template\template $template Template object
+ * @param \phpbb\user $user User object
+ */
+ public function __construct(\phpbb\profilefields\lang_helper $lang_helper, \phpbb\request\request $request, \phpbb\template\template $template, \phpbb\user $user)
+ {
+ $this->lang_helper = $lang_helper;
+ $this->request = $request;
+ $this->template = $template;
+ $this->user = $user;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function get_name_short()
+ {
+ return 'bool';
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function get_options($default_lang_id, $field_data)
+ {
+ $profile_row = array(
+ 'var_name' => 'field_default_value',
+ 'field_id' => 1,
+ 'lang_name' => $field_data['lang_name'],
+ 'lang_explain' => $field_data['lang_explain'],
+ 'lang_id' => $default_lang_id,
+ 'field_default_value' => $field_data['field_default_value'],
+ 'field_ident' => 'field_default_value',
+ 'field_type' => $this->get_service_name(),
+ 'field_length' => $field_data['field_length'],
+ 'lang_options' => $field_data['lang_options'],
+ );
+
+ $options = array(
+ 0 => array('TITLE' => $this->user->lang['FIELD_TYPE'], 'EXPLAIN' => $this->user->lang['BOOL_TYPE_EXPLAIN'], 'FIELD' => '<label><input type="radio" class="radio" name="field_length" value="1"' . (($field_data['field_length'] == 1) ? ' checked="checked"' : '') . ' onchange="document.getElementById(\'add_profile_field\').submit();" /> ' . $this->user->lang['RADIO_BUTTONS'] . '</label><label><input type="radio" class="radio" name="field_length" value="2"' . (($field_data['field_length'] == 2) ? ' checked="checked"' : '') . ' onchange="document.getElementById(\'add_profile_field\').submit();" /> ' . $this->user->lang['CHECKBOX'] . '</label>'),
+ 1 => array('TITLE' => $this->user->lang['DEFAULT_VALUE'], 'FIELD' => $this->process_field_row('preview', $profile_row)),
+ );
+
+ return $options;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function get_default_option_values()
+ {
+ return array(
+ 'field_length' => 1,
+ 'field_minlen' => 0,
+ 'field_maxlen' => 0,
+ 'field_validation' => '',
+ 'field_novalue' => 0,
+ 'field_default_value' => 0,
+ );
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function get_default_field_value($field_data)
+ {
+ return $field_data['field_default_value'];
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function get_profile_field($profile_row)
+ {
+ $var_name = 'pf_' . $profile_row['field_ident'];
+
+ // Checkbox
+ if ($profile_row['field_length'] == 2)
+ {
+ return ($this->request->is_set($var_name)) ? 1 : 0;
+ }
+ else
+ {
+ return $this->request->variable($var_name, (int) $profile_row['field_default_value']);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function validate_profile_field(&$field_value, $field_data)
+ {
+ $field_value = (bool) $field_value;
+
+ if (!$field_value && $field_data['field_required'])
+ {
+ return $this->user->lang('FIELD_REQUIRED', $this->get_field_name($field_data['lang_name']));
+ }
+
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function get_profile_value($field_value, $field_data)
+ {
+ $field_id = $field_data['field_id'];
+ $lang_id = $field_data['lang_id'];
+
+ if (!$this->lang_helper->is_set($field_id, $lang_id))
+ {
+ $this->lang_helper->load_option_lang($lang_id);
+ }
+
+ if (!$field_value && $field_data['field_show_novalue'])
+ {
+ $field_value = $field_data['field_default_value'];
+ }
+
+ if ($field_data['field_length'] == 1)
+ {
+ return ($this->lang_helper->is_set($field_id, $lang_id, (int) $field_value)) ? $this->lang_helper->get($field_id, $lang_id, (int) $field_value) : null;
+ }
+ else if (!$field_value)
+ {
+ return null;
+ }
+ else
+ {
+ return $this->lang_helper->is_set($field_id, $lang_id, $field_value + 1) ? $this->lang_helper->get($field_id, $lang_id, $field_value + 1) : null;
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function get_profile_value_raw($field_value, $field_data)
+ {
+ if ($field_value == $field_data['field_novalue'] && !$field_data['field_show_novalue'])
+ {
+ return null;
+ }
+
+ if (!$field_value && $field_data['field_show_novalue'])
+ {
+ $field_value = $field_data['field_novalue'];
+ }
+
+ return $field_value;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function generate_field($profile_row, $preview_options = false)
+ {
+ $profile_row['field_ident'] = (isset($profile_row['var_name'])) ? $profile_row['var_name'] : 'pf_' . $profile_row['field_ident'];
+ $field_ident = $profile_row['field_ident'];
+ $default_value = $profile_row['field_default_value'];
+
+ // checkbox - set the value to "true" if it has been set to 1
+ if ($profile_row['field_length'] == 2)
+ {
+ $value = ($this->request->is_set($field_ident) && $this->request->variable($field_ident, $default_value) == 1) ? true : ((!isset($this->user->profile_fields[$field_ident]) || $preview_options !== false) ? $default_value : $this->user->profile_fields[$field_ident]);
+ }
+ else
+ {
+ $value = ($this->request->is_set($field_ident)) ? $this->request->variable($field_ident, $default_value) : ((!isset($this->user->profile_fields[$field_ident]) || $preview_options !== false) ? $default_value : $this->user->profile_fields[$field_ident]);
+ }
+
+ $profile_row['field_value'] = (int) $value;
+ $this->template->assign_block_vars('bool', array_change_key_case($profile_row, CASE_UPPER));
+
+ if ($profile_row['field_length'] == 1)
+ {
+ if (!$this->lang_helper->is_set($profile_row['field_id'], $profile_row['lang_id'], 1))
+ {
+ if ($preview_options)
+ {
+ $this->lang_helper->load_preview_options($profile_row['field_id'], $profile_row['lang_id'], $preview_options);
+ }
+ else
+ {
+ $this->lang_helper->load_option_lang($profile_row['lang_id']);
+ }
+ }
+
+ $options = $this->lang_helper->get($profile_row['field_id'], $profile_row['lang_id']);
+ foreach ($options as $option_id => $option_value)
+ {
+ $this->template->assign_block_vars('bool.options', array(
+ 'OPTION_ID' => $option_id,
+ 'CHECKED' => ($value == $option_id) ? ' checked="checked"' : '',
+ 'VALUE' => $option_value,
+ ));
+ }
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function get_field_ident($field_data)
+ {
+ return ($field_data['field_length'] == '1') ? '' : 'pf_' . $field_data['field_ident'];
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function get_database_column_type()
+ {
+ return 'TINT:2';
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function get_language_options($field_data)
+ {
+ $options = array(
+ 'lang_name' => 'string',
+ 'lang_options' => 'two_options',
+ );
+
+ if ($field_data['lang_explain'])
+ {
+ $options['lang_explain'] = 'text';
+ }
+
+ return $options;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function get_language_options_input($field_data)
+ {
+ $field_data['l_lang_name'] = $this->request->variable('l_lang_name', array(0 => ''), true);
+ $field_data['l_lang_explain'] = $this->request->variable('l_lang_explain', array(0 => ''), true);
+ $field_data['l_lang_default_value'] = $this->request->variable('l_lang_default_value', array(0 => ''), true);
+
+ /**
+ * @todo check if this line is correct...
+ $field_data['l_lang_default_value'] = $this->request->variable('l_lang_default_value', array(0 => array('')), true);
+ */
+ $field_data['l_lang_options'] = $this->request->variable('l_lang_options', array(0 => array('')), true);
+
+ return $field_data;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function prepare_options_form(&$exclude_options, &$visibility_options)
+ {
+ $exclude_options[1][] = 'lang_options';
+
+ return $this->request->variable('lang_options', array(''), true);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function validate_options_on_submit($error, $field_data)
+ {
+ if (empty($field_data['lang_options'][0]) || empty($field_data['lang_options'][1]))
+ {
+ $error[] = $this->user->lang['NO_FIELD_ENTRIES'];
+ }
+
+ return $error;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function get_excluded_options($key, $action, $current_value, &$field_data, $step)
+ {
+ if ($step == 2 && $key == 'field_default_value')
+ {
+ // 'field_length' == 1 defines radio buttons. Possible values are 1 or 2 only.
+ // 'field_length' == 2 defines checkbox. Possible values are 0 or 1 only.
+ // If we switch the type on step 2, we have to adjust field value.
+ // 1 is a common value for the checkbox and radio buttons.
+
+ // Adjust unchecked checkbox value.
+ // If we return or save settings from 2nd/3rd page
+ // and the checkbox is unchecked, set the value to 0.
+ if ($this->request->is_set('step') && !$this->request->is_set($key))
+ {
+ return 0;
+ }
+
+ // If we switch to the checkbox type but former radio buttons value was 2,
+ // which is not the case for the checkbox, set it to 0 (unchecked).
+ if ($field_data['field_length'] == 2 && $current_value == 2)
+ {
+ return 0;
+ }
+ // If we switch to the radio buttons but the former checkbox value was 0,
+ // which is not the case for the radio buttons, set it to 0.
+ else if ($field_data['field_length'] == 1 && $current_value == 0)
+ {
+ return 2;
+ }
+ }
+
+ if ($key == 'l_lang_options' && $this->request->is_set($key))
+ {
+ $field_data[$key] = $this->request->variable($key, array(0 => array('')), true);
+
+ return $current_value;
+ }
+
+ return parent::get_excluded_options($key, $action, $current_value, $field_data, $step);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function prepare_hidden_fields($step, $key, $action, &$field_data)
+ {
+ if ($key == 'field_default_value')
+ {
+ $field_length = $this->request->variable('field_length', 0);
+
+ // Do a simple is set check if using checkbox.
+ if ($field_length == 2)
+ {
+ return $this->request->is_set($key);
+ }
+ return $this->request->variable($key, $field_data[$key], true);
+ }
+
+ $default_lang_options = array(
+ 'l_lang_options' => array(0 => array('')),
+ 'lang_options' => array(0 => ''),
+ );
+
+ if (isset($default_lang_options[$key]) && $this->request->is_set($key))
+ {
+ return $this->request->variable($key, $default_lang_options[$key], true);
+ }
+
+ return parent::prepare_hidden_fields($step, $key, $action, $field_data);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function display_options(&$template_vars, &$field_data)
+ {
+ // Initialize these array elements if we are creating a new field
+ if (!sizeof($field_data['lang_options']))
+ {
+ // No options have been defined for a boolean field.
+ $field_data['lang_options'][0] = '';
+ $field_data['lang_options'][1] = '';
+ }
+
+ $template_vars = array_merge($template_vars, array(
+ 'S_BOOL' => true,
+ 'L_LANG_OPTIONS_EXPLAIN' => $this->user->lang['BOOL_ENTRIES_EXPLAIN'],
+ 'FIRST_LANG_OPTION' => $field_data['lang_options'][0],
+ 'SECOND_LANG_OPTION' => $field_data['lang_options'][1],
+ ));
+ }
+}
diff --git a/phpBB/phpbb/profilefields/type/type_date.php b/phpBB/phpbb/profilefields/type/type_date.php
new file mode 100644
index 0000000000..63a0c79a3d
--- /dev/null
+++ b/phpBB/phpbb/profilefields/type/type_date.php
@@ -0,0 +1,374 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\profilefields\type;
+
+class type_date extends type_base
+{
+ /**
+ * Request object
+ * @var \phpbb\request\request
+ */
+ protected $request;
+
+ /**
+ * Template object
+ * @var \phpbb\template\template
+ */
+ protected $template;
+
+ /**
+ * User object
+ * @var \phpbb\user
+ */
+ protected $user;
+
+ /**
+ * Construct
+ *
+ * @param \phpbb\request\request $request Request object
+ * @param \phpbb\template\template $template Template object
+ * @param \phpbb\user $user User object
+ */
+ public function __construct(\phpbb\request\request $request, \phpbb\template\template $template, \phpbb\user $user)
+ {
+ $this->request = $request;
+ $this->template = $template;
+ $this->user = $user;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function get_name_short()
+ {
+ return 'date';
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function get_options($default_lang_id, $field_data)
+ {
+ $profile_row = array(
+ 'var_name' => 'field_default_value',
+ 'lang_name' => $field_data['lang_name'],
+ 'lang_explain' => $field_data['lang_explain'],
+ 'lang_id' => $default_lang_id,
+ 'field_default_value' => $field_data['field_default_value'],
+ 'field_ident' => 'field_default_value',
+ 'field_type' => $this->get_service_name(),
+ 'field_length' => $field_data['field_length'],
+ 'lang_options' => $field_data['lang_options'],
+ );
+
+ $always_now = request_var('always_now', -1);
+ if ($always_now == -1)
+ {
+ $s_checked = ($field_data['field_default_value'] == 'now') ? true : false;
+ }
+ else
+ {
+ $s_checked = ($always_now) ? true : false;
+ }
+
+ $options = array(
+ 0 => array('TITLE' => $this->user->lang['DEFAULT_VALUE'], 'FIELD' => $this->process_field_row('preview', $profile_row)),
+ 1 => array('TITLE' => $this->user->lang['ALWAYS_TODAY'], 'FIELD' => '<label><input type="radio" class="radio" name="always_now" value="1"' . (($s_checked) ? ' checked="checked"' : '') . ' onchange="document.getElementById(\'add_profile_field\').submit();" /> ' . $this->user->lang['YES'] . '</label><label><input type="radio" class="radio" name="always_now" value="0"' . ((!$s_checked) ? ' checked="checked"' : '') . ' onchange="document.getElementById(\'add_profile_field\').submit();" /> ' . $this->user->lang['NO'] . '</label>'),
+ );
+
+ return $options;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function get_default_option_values()
+ {
+ return array(
+ 'field_length' => 10,
+ 'field_minlen' => 10,
+ 'field_maxlen' => 10,
+ 'field_validation' => '',
+ 'field_novalue' => ' 0- 0- 0',
+ 'field_default_value' => ' 0- 0- 0',
+ );
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function get_default_field_value($field_data)
+ {
+ if ($field_data['field_default_value'] == 'now')
+ {
+ $now = getdate();
+ $field_data['field_default_value'] = sprintf('%2d-%2d-%4d', $now['mday'], $now['mon'], $now['year']);
+ }
+
+ return $field_data['field_default_value'];
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function get_profile_field($profile_row)
+ {
+ $var_name = 'pf_' . $profile_row['field_ident'];
+
+ if (!$this->request->is_set($var_name . '_day'))
+ {
+ if ($profile_row['field_default_value'] == 'now')
+ {
+ $now = getdate();
+ $profile_row['field_default_value'] = sprintf('%2d-%2d-%4d', $now['mday'], $now['mon'], $now['year']);
+ }
+ list($day, $month, $year) = explode('-', $profile_row['field_default_value']);
+ }
+ else
+ {
+ $day = $this->request->variable($var_name . '_day', 0);
+ $month = $this->request->variable($var_name . '_month', 0);
+ $year = $this->request->variable($var_name . '_year', 0);
+ }
+
+ return sprintf('%2d-%2d-%4d', $day, $month, $year);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function validate_profile_field(&$field_value, $field_data)
+ {
+ $field_validate = explode('-', $field_value);
+
+ $day = (isset($field_validate[0])) ? (int) $field_validate[0] : 0;
+ $month = (isset($field_validate[1])) ? (int) $field_validate[1] : 0;
+ $year = (isset($field_validate[2])) ? (int) $field_validate[2] : 0;
+
+ if ((!$day || !$month || !$year) && !$field_data['field_required'])
+ {
+ return false;
+ }
+
+ if ((!$day || !$month || !$year) && $field_data['field_required'])
+ {
+ return $this->user->lang('FIELD_REQUIRED', $this->get_field_name($field_data['lang_name']));
+ }
+
+ if ($day < 0 || $day > 31 || $month < 0 || $month > 12 || ($year < 1901 && $year > 0) || $year > gmdate('Y', time()) + 50)
+ {
+ return $this->user->lang('FIELD_INVALID_DATE', $this->get_field_name($field_data['lang_name']));
+ }
+
+ if (checkdate($month, $day, $year) === false)
+ {
+ return $this->user->lang('FIELD_INVALID_DATE', $this->get_field_name($field_data['lang_name']));
+ }
+
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function get_profile_value($field_value, $field_data)
+ {
+ $date = explode('-', $field_value);
+ $day = (isset($date[0])) ? (int) $date[0] : 0;
+ $month = (isset($date[1])) ? (int) $date[1] : 0;
+ $year = (isset($date[2])) ? (int) $date[2] : 0;
+
+ if (!$day && !$month && !$year && !$field_data['field_show_novalue'])
+ {
+ return null;
+ }
+ else if ($day && $month && $year)
+ {
+ // Date should display as the same date for every user regardless of timezone
+ return $this->user->create_datetime()
+ ->setDate($year, $month, $day)
+ ->setTime(0, 0, 0)
+ ->format($this->user->lang['DATE_FORMAT'], true);
+ }
+
+ return $field_value;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function get_profile_value_raw($field_value, $field_data)
+ {
+ if (($field_value === '' || $field_value === null) && !$field_data['field_show_novalue'])
+ {
+ return null;
+ }
+
+ return $field_value;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function generate_field($profile_row, $preview_options = false)
+ {
+ $profile_row['field_ident'] = (isset($profile_row['var_name'])) ? $profile_row['var_name'] : 'pf_' . $profile_row['field_ident'];
+ $field_ident = $profile_row['field_ident'];
+
+ $now = getdate();
+
+ if (!$this->request->is_set($profile_row['field_ident'] . '_day'))
+ {
+ if ($profile_row['field_default_value'] == 'now')
+ {
+ $profile_row['field_default_value'] = sprintf('%2d-%2d-%4d', $now['mday'], $now['mon'], $now['year']);
+ }
+ list($day, $month, $year) = explode('-', ((!isset($this->user->profile_fields[$field_ident]) || $preview_options !== false) ? $profile_row['field_default_value'] : $this->user->profile_fields[$field_ident]));
+ }
+ else
+ {
+ if ($preview_options !== false && $profile_row['field_default_value'] == 'now')
+ {
+ $profile_row['field_default_value'] = sprintf('%2d-%2d-%4d', $now['mday'], $now['mon'], $now['year']);
+ list($day, $month, $year) = explode('-', ((!isset($this->user->profile_fields[$field_ident]) || $preview_options !== false) ? $profile_row['field_default_value'] : $this->user->profile_fields[$field_ident]));
+ }
+ else
+ {
+ $day = $this->request->variable($profile_row['field_ident'] . '_day', 0);
+ $month = $this->request->variable($profile_row['field_ident'] . '_month', 0);
+ $year = $this->request->variable($profile_row['field_ident'] . '_year', 0);
+ }
+ }
+
+ $profile_row['s_day_options'] = '<option value="0"' . ((!$day) ? ' selected="selected"' : '') . '>--</option>';
+ for ($i = 1; $i < 32; $i++)
+ {
+ $profile_row['s_day_options'] .= '<option value="' . $i . '"' . (($i == $day) ? ' selected="selected"' : '') . ">$i</option>";
+ }
+
+ $profile_row['s_month_options'] = '<option value="0"' . ((!$month) ? ' selected="selected"' : '') . '>--</option>';
+ for ($i = 1; $i < 13; $i++)
+ {
+ $profile_row['s_month_options'] .= '<option value="' . $i . '"' . (($i == $month) ? ' selected="selected"' : '') . ">$i</option>";
+ }
+
+ $profile_row['s_year_options'] = '<option value="0"' . ((!$year) ? ' selected="selected"' : '') . '>--</option>';
+ for ($i = 1901; $i <= $now['year'] + 50; $i++)
+ {
+ $profile_row['s_year_options'] .= '<option value="' . $i . '"' . (($i == $year) ? ' selected="selected"' : '') . ">$i</option>";
+ }
+
+ $profile_row['field_value'] = 0;
+ $this->template->assign_block_vars('date', array_change_key_case($profile_row, CASE_UPPER));
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function get_field_ident($field_data)
+ {
+ return '';
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function get_database_column_type()
+ {
+ return 'VCHAR:10';
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function get_language_options($field_data)
+ {
+ $options = array(
+ 'lang_name' => 'string',
+ );
+
+ if ($field_data['lang_explain'])
+ {
+ $options['lang_explain'] = 'text';
+ }
+
+ return $options;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function get_excluded_options($key, $action, $current_value, &$field_data, $step)
+ {
+ if ($step == 2 && $key == 'field_default_value')
+ {
+ $always_now = $this->request->variable('always_now', -1);
+
+ if ($always_now == 1 || ($always_now === -1 && $current_value == 'now'))
+ {
+ $now = getdate();
+
+ $field_data['field_default_value_day'] = $now['mday'];
+ $field_data['field_default_value_month'] = $now['mon'];
+ $field_data['field_default_value_year'] = $now['year'];
+ $current_value = 'now';
+ $this->request->overwrite('field_default_value', $current_value, \phpbb\request\request_interface::POST);
+ }
+ else
+ {
+ if ($this->request->is_set('field_default_value_day'))
+ {
+ $field_data['field_default_value_day'] = $this->request->variable('field_default_value_day', 0);
+ $field_data['field_default_value_month'] = $this->request->variable('field_default_value_month', 0);
+ $field_data['field_default_value_year'] = $this->request->variable('field_default_value_year', 0);
+ $current_value = sprintf('%2d-%2d-%4d', $field_data['field_default_value_day'], $field_data['field_default_value_month'], $field_data['field_default_value_year']);
+ $this->request->overwrite('field_default_value', $current_value, \phpbb\request\request_interface::POST);
+ }
+ else
+ {
+ list($field_data['field_default_value_day'], $field_data['field_default_value_month'], $field_data['field_default_value_year']) = explode('-', $current_value);
+ }
+ }
+
+ return $current_value;
+ }
+
+ return parent::get_excluded_options($key, $action, $current_value, $field_data, $step);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function prepare_hidden_fields($step, $key, $action, &$field_data)
+ {
+ if ($key == 'field_default_value')
+ {
+ $always_now = $this->request->variable('always_now', 0);
+
+ if ($always_now)
+ {
+ return 'now';
+ }
+ else if ($this->request->is_set('field_default_value_day'))
+ {
+ $field_data['field_default_value_day'] = $this->request->variable('field_default_value_day', 0);
+ $field_data['field_default_value_month'] = $this->request->variable('field_default_value_month', 0);
+ $field_data['field_default_value_year'] = $this->request->variable('field_default_value_year', 0);
+ return sprintf('%2d-%2d-%4d', $field_data['field_default_value_day'], $field_data['field_default_value_month'], $field_data['field_default_value_year']);
+ }
+ }
+
+ return parent::prepare_hidden_fields($step, $key, $action, $field_data);
+ }
+}
diff --git a/phpBB/phpbb/profilefields/type/type_dropdown.php b/phpBB/phpbb/profilefields/type/type_dropdown.php
new file mode 100644
index 0000000000..17ae89e1b2
--- /dev/null
+++ b/phpBB/phpbb/profilefields/type/type_dropdown.php
@@ -0,0 +1,325 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\profilefields\type;
+
+class type_dropdown extends type_base
+{
+ /**
+ * Profile fields language helper
+ * @var \phpbb\profilefields\lang_helper
+ */
+ protected $lang_helper;
+
+ /**
+ * Request object
+ * @var \phpbb\request\request
+ */
+ protected $request;
+
+ /**
+ * Template object
+ * @var \phpbb\template\template
+ */
+ protected $template;
+
+ /**
+ * User object
+ * @var \phpbb\user
+ */
+ protected $user;
+
+ /**
+ * Construct
+ *
+ * @param \phpbb\profilefields\lang_helper $lang_helper Profile fields language helper
+ * @param \phpbb\request\request $request Request object
+ * @param \phpbb\template\template $template Template object
+ * @param \phpbb\user $user User object
+ */
+ public function __construct(\phpbb\profilefields\lang_helper $lang_helper, \phpbb\request\request $request, \phpbb\template\template $template, \phpbb\user $user)
+ {
+ $this->lang_helper = $lang_helper;
+ $this->request = $request;
+ $this->template = $template;
+ $this->user = $user;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function get_name_short()
+ {
+ return 'dropdown';
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function get_options($default_lang_id, $field_data)
+ {
+ $profile_row[0] = array(
+ 'var_name' => 'field_default_value',
+ 'field_id' => 1,
+ 'lang_name' => $field_data['lang_name'],
+ 'lang_explain' => $field_data['lang_explain'],
+ 'lang_id' => $default_lang_id,
+ 'field_default_value' => $field_data['field_default_value'],
+ 'field_ident' => 'field_default_value',
+ 'field_type' => $this->get_service_name(),
+ 'lang_options' => $field_data['lang_options'],
+ );
+
+ $profile_row[1] = $profile_row[0];
+ $profile_row[1]['var_name'] = 'field_novalue';
+ $profile_row[1]['field_ident'] = 'field_novalue';
+ $profile_row[1]['field_default_value'] = $field_data['field_novalue'];
+
+ $options = array(
+ 0 => array('TITLE' => $this->user->lang['DEFAULT_VALUE'], 'FIELD' => $this->process_field_row('preview', $profile_row[0])),
+ 1 => array('TITLE' => $this->user->lang['NO_VALUE_OPTION'], 'EXPLAIN' => $this->user->lang['NO_VALUE_OPTION_EXPLAIN'], 'FIELD' => $this->process_field_row('preview', $profile_row[1])),
+ );
+
+ return $options;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function get_default_option_values()
+ {
+ return array(
+ 'field_length' => 0,
+ 'field_minlen' => 0,
+ 'field_maxlen' => 5,
+ 'field_validation' => '',
+ 'field_novalue' => 0,
+ 'field_default_value' => 0,
+ );
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function get_default_field_value($field_data)
+ {
+ return $field_data['field_default_value'];
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function get_profile_field($profile_row)
+ {
+ $var_name = 'pf_' . $profile_row['field_ident'];
+ return $this->request->variable($var_name, (int) $profile_row['field_default_value']);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function validate_profile_field(&$field_value, $field_data)
+ {
+ $field_value = (int) $field_value;
+
+ // retrieve option lang data if necessary
+ if (!$this->lang_helper->is_set($field_data['field_id'], $field_data['lang_id'], 1))
+ {
+ $this->lang_helper->load_option_lang($field_data['lang_id']);
+ }
+
+ if (!$this->lang_helper->is_set($field_data['field_id'], $field_data['lang_id'], $field_value))
+ {
+ return $this->user->lang('FIELD_INVALID_VALUE', $this->get_field_name($field_data['lang_name']));
+ }
+
+ if ($field_value == $field_data['field_novalue'] && $field_data['field_required'])
+ {
+ return $this->user->lang('FIELD_REQUIRED', $this->get_field_name($field_data['lang_name']));
+ }
+
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function get_profile_value($field_value, $field_data)
+ {
+ $field_id = $field_data['field_id'];
+ $lang_id = $field_data['lang_id'];
+ if (!$this->lang_helper->is_set($field_id, $lang_id))
+ {
+ $this->lang_helper->load_option_lang($lang_id);
+ }
+
+ if ($field_value == $field_data['field_novalue'] && !$field_data['field_show_novalue'])
+ {
+ return null;
+ }
+
+ $field_value = (int) $field_value;
+
+ // User not having a value assigned
+ if (!$this->lang_helper->is_set($field_id, $lang_id, $field_value))
+ {
+ if ($field_data['field_show_novalue'])
+ {
+ $field_value = $field_data['field_novalue'];
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ return $this->lang_helper->get($field_id, $lang_id, $field_value);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function get_profile_value_raw($field_value, $field_data)
+ {
+ if ($field_value == $field_data['field_novalue'] && !$field_data['field_show_novalue'])
+ {
+ return null;
+ }
+
+ if (!$field_value && $field_data['field_show_novalue'])
+ {
+ $field_value = $field_data['field_novalue'];
+ }
+
+ return $field_value;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function generate_field($profile_row, $preview_options = false)
+ {
+ $profile_row['field_ident'] = (isset($profile_row['var_name'])) ? $profile_row['var_name'] : 'pf_' . $profile_row['field_ident'];
+ $field_ident = $profile_row['field_ident'];
+ $default_value = $profile_row['field_default_value'];
+
+ $value = ($this->request->is_set($field_ident)) ? $this->request->variable($field_ident, $default_value) : ((!isset($this->user->profile_fields[$field_ident]) || $preview_options !== false) ? $default_value : $this->user->profile_fields[$field_ident]);
+
+ if (!$this->lang_helper->is_set($profile_row['field_id'], $profile_row['lang_id'], 1))
+ {
+ if ($preview_options)
+ {
+ $this->lang_helper->load_preview_options($profile_row['field_id'], $profile_row['lang_id'], $preview_options);
+ }
+ else
+ {
+ $this->lang_helper->load_option_lang($profile_row['lang_id']);
+ }
+ }
+
+ $profile_row['field_value'] = (int) $value;
+ $this->template->assign_block_vars('dropdown', array_change_key_case($profile_row, CASE_UPPER));
+
+ $options = $this->lang_helper->get($profile_row['field_id'], $profile_row['lang_id']);
+ foreach ($options as $option_id => $option_value)
+ {
+ $this->template->assign_block_vars('dropdown.options', array(
+ 'OPTION_ID' => $option_id,
+ 'SELECTED' => ($value == $option_id) ? ' selected="selected"' : '',
+ 'VALUE' => $option_value,
+ ));
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function get_database_column_type()
+ {
+ return 'UINT';
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function get_language_options($field_data)
+ {
+ $options = array(
+ 'lang_name' => 'string',
+ 'lang_options' => 'optionfield',
+ );
+
+ if ($field_data['lang_explain'])
+ {
+ $options['lang_explain'] = 'text';
+ }
+
+ return $options;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function prepare_options_form(&$exclude_options, &$visibility_options)
+ {
+ $exclude_options[1][] = 'lang_options';
+
+ return $this->request->variable('lang_options', '', true);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function validate_options_on_submit($error, $field_data)
+ {
+ if (!sizeof($field_data['lang_options']))
+ {
+ $error[] = $this->user->lang['NO_FIELD_ENTRIES'];
+ }
+
+ return $error;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function get_excluded_options($key, $action, $current_value, &$field_data, $step)
+ {
+ if ($step == 2 && $key == 'field_maxlen')
+ {
+ // Get the number of options if this key is 'field_maxlen'
+ return sizeof(explode("\n", $this->request->variable('lang_options', '', true)));
+ }
+
+ return parent::get_excluded_options($key, $action, $current_value, $field_data, $step);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function display_options(&$template_vars, &$field_data)
+ {
+ // Initialize these array elements if we are creating a new field
+ if (!sizeof($field_data['lang_options']))
+ {
+ // No options have been defined for the dropdown menu
+ $field_data['lang_options'] = array();
+ }
+
+ $template_vars = array_merge($template_vars, array(
+ 'S_DROPDOWN' => true,
+ 'L_LANG_OPTIONS_EXPLAIN' => $this->user->lang['DROPDOWN_ENTRIES_EXPLAIN'],
+ 'LANG_OPTIONS' => implode("\n", $field_data['lang_options']),
+ ));
+ }
+}
diff --git a/phpBB/phpbb/profilefields/type/type_googleplus.php b/phpBB/phpbb/profilefields/type/type_googleplus.php
new file mode 100644
index 0000000000..e6729b1935
--- /dev/null
+++ b/phpBB/phpbb/profilefields/type/type_googleplus.php
@@ -0,0 +1,66 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\profilefields\type;
+
+class type_googleplus extends type_string
+{
+ /**
+ * {@inheritDoc}
+ */
+ public function get_name()
+ {
+ return $this->user->lang('FIELD_GOOGLEPLUS');
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function get_service_name()
+ {
+ return 'profilefields.type.googleplus';
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function get_default_option_values()
+ {
+ return array(
+ 'field_length' => 20,
+ 'field_minlen' => 3,
+ 'field_maxlen' => 255,
+ 'field_validation' => '(?:(?!\.{2,})([^<>=+]))+',
+ 'field_novalue' => '',
+ 'field_default_value' => '',
+ );
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function get_profile_contact_value($field_value, $field_data)
+ {
+ if (!$field_value && !$field_data['field_show_novalue'])
+ {
+ return null;
+ }
+
+ if (!is_numeric($field_value))
+ {
+ $field_value = '+' . $field_value;
+ }
+
+ return $field_value;
+ }
+}
diff --git a/phpBB/phpbb/profilefields/type/type_int.php b/phpBB/phpbb/profilefields/type/type_int.php
new file mode 100644
index 0000000000..9dc0181cb8
--- /dev/null
+++ b/phpBB/phpbb/profilefields/type/type_int.php
@@ -0,0 +1,249 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\profilefields\type;
+
+class type_int extends type_base
+{
+ /**
+ * Request object
+ * @var \phpbb\request\request
+ */
+ protected $request;
+
+ /**
+ * Template object
+ * @var \phpbb\template\template
+ */
+ protected $template;
+
+ /**
+ * User object
+ * @var \phpbb\user
+ */
+ protected $user;
+
+ /**
+ * Construct
+ *
+ * @param \phpbb\request\request $request Request object
+ * @param \phpbb\template\template $template Template object
+ * @param \phpbb\user $user User object
+ */
+ public function __construct(\phpbb\request\request $request, \phpbb\template\template $template, \phpbb\user $user)
+ {
+ $this->request = $request;
+ $this->template = $template;
+ $this->user = $user;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function get_name_short()
+ {
+ return 'int';
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function get_options($default_lang_id, $field_data)
+ {
+ $options = array(
+ 0 => array('TITLE' => $this->user->lang['FIELD_LENGTH'], 'FIELD' => '<input type="number" min="0" max="99999" name="field_length" value="' . $field_data['field_length'] . '" />'),
+ 1 => array('TITLE' => $this->user->lang['MIN_FIELD_NUMBER'], 'FIELD' => '<input type="number" min="0" max="99999" name="field_minlen" value="' . $field_data['field_minlen'] . '" />'),
+ 2 => array('TITLE' => $this->user->lang['MAX_FIELD_NUMBER'], 'FIELD' => '<input type="number" min="0" max="99999" name="field_maxlen" value="' . $field_data['field_maxlen'] . '" />'),
+ 3 => array('TITLE' => $this->user->lang['DEFAULT_VALUE'], 'FIELD' => '<input type="number" name="field_default_value" value="' . $field_data['field_default_value'] . '" />'),
+ );
+
+ return $options;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function get_default_option_values()
+ {
+ return array(
+ 'field_length' => 5,
+ 'field_minlen' => 0,
+ 'field_maxlen' => 100,
+ 'field_validation' => '',
+ 'field_novalue' => 0,
+ 'field_default_value' => 0,
+ );
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function get_default_field_value($field_data)
+ {
+ if ($field_data['field_default_value'] === '')
+ {
+ // We cannot insert an empty string into an integer column.
+ return null;
+ }
+
+ return $field_data['field_default_value'];
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function get_profile_field($profile_row)
+ {
+ $var_name = 'pf_' . $profile_row['field_ident'];
+ if ($this->request->is_set($var_name) && $this->request->variable($var_name, '') === '')
+ {
+ return null;
+ }
+ else
+ {
+ return $this->request->variable($var_name, (int) $profile_row['field_default_value']);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function validate_profile_field(&$field_value, $field_data)
+ {
+ if (trim($field_value) === '' && !$field_data['field_required'])
+ {
+ return false;
+ }
+
+ $field_value = (int) $field_value;
+
+ if ($field_value < $field_data['field_minlen'])
+ {
+ return $this->user->lang('FIELD_TOO_SMALL', (int) $field_data['field_minlen'], $this->get_field_name($field_data['lang_name']));
+ }
+ else if ($field_value > $field_data['field_maxlen'])
+ {
+ return $this->user->lang('FIELD_TOO_LARGE', (int) $field_data['field_maxlen'], $this->get_field_name($field_data['lang_name']));
+ }
+
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function get_profile_value($field_value, $field_data)
+ {
+ if (($field_value === '' || $field_value === null) && !$field_data['field_show_novalue'])
+ {
+ return null;
+ }
+ return (int) $field_value;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function get_profile_value_raw($field_value, $field_data)
+ {
+ if (($field_value === '' || $field_value === null) && !$field_data['field_show_novalue'])
+ {
+ return null;
+ }
+ return (int) $field_value;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function generate_field($profile_row, $preview_options = false)
+ {
+ $profile_row['field_ident'] = (isset($profile_row['var_name'])) ? $profile_row['var_name'] : 'pf_' . $profile_row['field_ident'];
+ $field_ident = $profile_row['field_ident'];
+ $default_value = $profile_row['field_default_value'];
+
+ if ($this->request->is_set($field_ident))
+ {
+ $value = ($this->request->variable($field_ident, '') === '') ? null : $this->request->variable($field_ident, $default_value);
+ }
+ else
+ {
+ if ($preview_options === false && array_key_exists($field_ident, $this->user->profile_fields) && is_null($this->user->profile_fields[$field_ident]))
+ {
+ $value = null;
+ }
+ else if (!isset($this->user->profile_fields[$field_ident]) || $preview_options !== false)
+ {
+ $value = $default_value;
+ }
+ else
+ {
+ $value = $this->user->profile_fields[$field_ident];
+ }
+ }
+
+ $profile_row['field_value'] = (is_null($value) || $value === '') ? '' : (int) $value;
+
+ $this->template->assign_block_vars('int', array_change_key_case($profile_row, CASE_UPPER));
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function get_field_ident($field_data)
+ {
+ return 'pf_' . $field_data['field_ident'];
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function get_database_column_type()
+ {
+ return 'BINT';
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function get_language_options($field_data)
+ {
+ $options = array(
+ 'lang_name' => 'string',
+ );
+
+ if ($field_data['lang_explain'])
+ {
+ $options['lang_explain'] = 'text';
+ }
+
+ return $options;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function get_excluded_options($key, $action, $current_value, &$field_data, $step)
+ {
+ if ($step == 2 && $key == 'field_default_value')
+ {
+ // Permit an empty string
+ if ($action == 'create' && $this->request->variable('field_default_value', '') === '')
+ {
+ return '';
+ }
+ }
+
+ return parent::get_excluded_options($key, $action, $current_value, $field_data, $step);
+ }
+}
diff --git a/phpBB/phpbb/profilefields/type/type_interface.php b/phpBB/phpbb/profilefields/type/type_interface.php
new file mode 100644
index 0000000000..93b9e4b893
--- /dev/null
+++ b/phpBB/phpbb/profilefields/type/type_interface.php
@@ -0,0 +1,226 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\profilefields\type;
+
+interface type_interface
+{
+ /**
+ * Get the translated name of the type
+ *
+ * @return string Translated name of the field type
+ */
+ public function get_name();
+
+ /**
+ * Get the short name of the type, used for error messages and template loops
+ *
+ * @return string lowercase version of the fields type
+ */
+ public function get_name_short();
+
+ /**
+ * Get the name of service representing the type
+ *
+ * @return string lowercase version of the fields type
+ */
+ public function get_service_name();
+
+ /**
+ * Get the name of template file for this type
+ *
+ * @return string Returns the name of the template file
+ */
+ public function get_template_filename();
+
+ /**
+ * Get dropdown options for second step in ACP
+ *
+ * @param string $default_lang_id ID of the default language
+ * @param array $field_data Array with data for this field
+ * @return array with the acp options
+ */
+ public function get_options($default_lang_id, $field_data);
+
+ /**
+ * Get default values for the options of this type
+ *
+ * @return array with values like default field size and more
+ */
+ public function get_default_option_values();
+
+ /**
+ * Get default value for this type
+ *
+ * @param array $field_data Array with data for this field
+ * @return mixed default value for new users when no value is given
+ */
+ public function get_default_field_value($field_data);
+
+ /**
+ * Get profile field value on submit
+ *
+ * @param array $profile_row Array with data for this field
+ * @return mixed Submitted value of the profile field
+ */
+ public function get_profile_field($profile_row);
+
+ /**
+ * Validate entered profile field data
+ *
+ * @param mixed $field_value Field value to validate
+ * @param array $field_data Array with requirements of the field
+ * @return mixed String with the error message
+ */
+ public function validate_profile_field(&$field_value, $field_data);
+
+ /**
+ * Get Profile Value for display
+ *
+ * @param mixed $field_value Field value as stored in the database
+ * @param array $field_data Array with requirements of the field
+ * @return mixed Field value to display
+ */
+ public function get_profile_value($field_value, $field_data);
+
+ /**
+ * Get Profile Value ID for display (the raw, unprocessed user data)
+ *
+ * @param mixed $field_value Field value as stored in the database
+ * @param array $field_data Array with requirements of the field
+ * @return mixed Field value ID to display
+ */
+ public function get_profile_value_raw($field_value, $field_data);
+
+ /**
+ * Get Profile Value for display
+ *
+ * When displaying a contact field, we don't want to have links already parsed and more
+ *
+ * @param mixed $field_value Field value as stored in the database
+ * @param array $field_data Array with requirements of the field
+ * @return mixed Field value to display
+ */
+ public function get_profile_contact_value($field_value, $field_data);
+
+ /**
+ * Generate the input field for display
+ *
+ * @param array $profile_row Array with data for this field
+ * @param mixed $preview_options When previewing we use different data
+ * @return null
+ */
+ public function generate_field($profile_row, $preview_options = false);
+
+ /**
+ * Get the ident of the field
+ *
+ * Some types are multivalue, we can't give them a field_id
+ * as we would not know which to pick.
+ *
+ * @param array $field_data Array with data for this field
+ * @return string ident of the field
+ */
+ public function get_field_ident($field_data);
+
+ /**
+ * Get the localized name of the field
+ *
+ * @param string $field_name Unlocalized name of this field
+ * @return string Localized name of the field
+ */
+ public function get_field_name($field_name);
+
+ /**
+ * Get the column type for the database
+ *
+ * @return string Returns the database column type
+ */
+ public function get_database_column_type();
+
+ /**
+ * Get the options we need to display for the language input fields in the ACP
+ *
+ * @param array $field_data Array with data for this field
+ * @return array Returns the language options we need to generate
+ */
+ public function get_language_options($field_data);
+
+ /**
+ * Get the input for the supplied language options
+ *
+ * @param array $field_data Array with data for this field
+ * @return array Returns the language options we need to generate
+ */
+ public function get_language_options_input($field_data);
+
+ /**
+ * Allows exclusion of options in single steps of the creation process
+ *
+ * @param array $exclude_options Array with options that should be excluded in the steps
+ * @param array $visibility_options Array with options responsible for the fields visibility
+ * @return mixed Returns the provided language options
+ */
+ public function prepare_options_form(&$exclude_options, &$visibility_options);
+
+ /**
+ * Allows exclusion of options in single steps of the creation process
+ *
+ * @param array $error Array with error messages
+ * @param array $field_data Array with data for this field
+ * @return array Array with error messages
+ */
+ public function validate_options_on_submit($error, $field_data);
+
+ /**
+ * Allows manipulating the intended variables if needed
+ *
+ * @param string $key Name of the option
+ * @param string $action Currently performed action (create|edit)
+ * @param mixed $current_value Currently value of the option
+ * @param array $field_data Array with data for this field
+ * @param int $step Step on which the option is excluded
+ * @return mixed Final value of the option
+ */
+ public function get_excluded_options($key, $action, $current_value, &$field_data, $step);
+
+ /**
+ * Allows manipulating the intended variables if needed
+ *
+ * @param int $step Step on which the option is hidden
+ * @param string $key Name of the option
+ * @param string $action Currently performed action (create|edit)
+ * @param array $field_data Array with data for this field
+ * @return mixed Final value of the option
+ */
+ public function prepare_hidden_fields($step, $key, $action, &$field_data);
+
+ /**
+ * Allows assigning of additional template variables
+ *
+ * @param array $template_vars Template variables we are going to assign
+ * @param array $field_data Array with data for this field
+ * @return null
+ */
+ public function display_options(&$template_vars, &$field_data);
+
+ /**
+ * Return templated value/field. Possible values for $mode are:
+ * change == user is able to set/enter profile values; preview == just show the value
+ *
+ * @param string $mode Mode for displaying the field (preview|change)
+ * @param array $profile_row Array with data for this field
+ * @return null
+ */
+ public function process_field_row($mode, $profile_row);
+}
diff --git a/phpBB/phpbb/profilefields/type/type_string.php b/phpBB/phpbb/profilefields/type/type_string.php
new file mode 100644
index 0000000000..8710c8c603
--- /dev/null
+++ b/phpBB/phpbb/profilefields/type/type_string.php
@@ -0,0 +1,159 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\profilefields\type;
+
+class type_string extends type_string_common
+{
+ /**
+ * Request object
+ * @var \phpbb\request\request
+ */
+ protected $request;
+
+ /**
+ * Template object
+ * @var \phpbb\template\template
+ */
+ protected $template;
+
+ /**
+ * User object
+ * @var \phpbb\user
+ */
+ protected $user;
+
+ /**
+ * Construct
+ *
+ * @param \phpbb\request\request $request Request object
+ * @param \phpbb\template\template $template Template object
+ * @param \phpbb\user $user User object
+ */
+ public function __construct(\phpbb\request\request $request, \phpbb\template\template $template, \phpbb\user $user)
+ {
+ $this->request = $request;
+ $this->template = $template;
+ $this->user = $user;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function get_name_short()
+ {
+ return 'string';
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function get_options($default_lang_id, $field_data)
+ {
+ $options = array(
+ 0 => array('TITLE' => $this->user->lang['FIELD_LENGTH'], 'FIELD' => '<input type="number" min="0" max="99999" name="field_length" value="' . $field_data['field_length'] . '" />'),
+ 1 => array('TITLE' => $this->user->lang['MIN_FIELD_CHARS'], 'FIELD' => '<input type="number" min="0" max="99999" name="field_minlen" value="' . $field_data['field_minlen'] . '" />'),
+ 2 => array('TITLE' => $this->user->lang['MAX_FIELD_CHARS'], 'FIELD' => '<input type="number" min="0" max="99999" name="field_maxlen" value="' . $field_data['field_maxlen'] . '" />'),
+ 3 => array('TITLE' => $this->user->lang['FIELD_VALIDATION'], 'FIELD' => '<select name="field_validation">' . $this->validate_options($field_data) . '</select>'),
+ );
+
+ return $options;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function get_default_option_values()
+ {
+ return array(
+ 'field_length' => 10,
+ 'field_minlen' => 0,
+ 'field_maxlen' => 20,
+ 'field_validation' => '.*',
+ 'field_novalue' => '',
+ 'field_default_value' => '',
+ );
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function get_profile_field($profile_row)
+ {
+ $var_name = 'pf_' . $profile_row['field_ident'];
+ return $this->request->variable($var_name, (string) $profile_row['field_default_value'], true);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function validate_profile_field(&$field_value, $field_data)
+ {
+ return $this->validate_string_profile_field('string', $field_value, $field_data);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function generate_field($profile_row, $preview_options = false)
+ {
+ $profile_row['field_ident'] = (isset($profile_row['var_name'])) ? $profile_row['var_name'] : 'pf_' . $profile_row['field_ident'];
+ $field_ident = $profile_row['field_ident'];
+ $default_value = $profile_row['lang_default_value'];
+ $profile_row['field_value'] = ($this->request->is_set($field_ident)) ? $this->request->variable($field_ident, $default_value, true) : ((!isset($this->user->profile_fields[$field_ident]) || $preview_options !== false) ? $default_value : $this->user->profile_fields[$field_ident]);
+
+ $this->template->assign_block_vars($this->get_name_short(), array_change_key_case($profile_row, CASE_UPPER));
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function get_database_column_type()
+ {
+ return 'VCHAR';
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function get_language_options($field_data)
+ {
+ $options = array(
+ 'lang_name' => 'string',
+ );
+
+ if ($field_data['lang_explain'])
+ {
+ $options['lang_explain'] = 'text';
+ }
+
+ if (strlen($field_data['lang_default_value']))
+ {
+ $options['lang_default_value'] = 'string';
+ }
+
+ return $options;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function display_options(&$template_vars, &$field_data)
+ {
+ $template_vars = array_merge($template_vars, array(
+ 'S_STRING' => true,
+ 'L_DEFAULT_VALUE_EXPLAIN' => $this->user->lang['STRING_DEFAULT_VALUE_EXPLAIN'],
+ 'LANG_DEFAULT_VALUE' => $field_data['lang_default_value'],
+ ));
+ }
+}
diff --git a/phpBB/phpbb/profilefields/type/type_string_common.php b/phpBB/phpbb/profilefields/type/type_string_common.php
new file mode 100644
index 0000000000..f5e1992044
--- /dev/null
+++ b/phpBB/phpbb/profilefields/type/type_string_common.php
@@ -0,0 +1,147 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\profilefields\type;
+
+abstract class type_string_common extends type_base
+{
+ protected $validation_options = array(
+ 'CHARS_ANY' => '.*',
+ 'NUMBERS_ONLY' => '[0-9]+',
+ 'ALPHA_ONLY' => '[a-zA-Z0-9]+',
+ 'ALPHA_UNDERSCORE' => '[\w]+',
+ 'ALPHA_DOTS' => '[a-zA-Z0-9.]+',
+ 'ALPHA_SPACERS' => '[\w\x20+\-\[\]]+',
+ 'ALPHA_PUNCTUATION' => '[a-zA-Z][\w\.,\-]+',
+ 'LETTER_NUM_ONLY' => '[\p{Lu}\p{Ll}0-9]+',
+ 'LETTER_NUM_UNDERSCORE' => '[\p{Lu}\p{Ll}0-9_]+',
+ 'LETTER_NUM_DOTS' => '[\p{Lu}\p{Ll}0-9.]+',
+ 'LETTER_NUM_SPACERS' => '[\p{Lu}\p{Ll}0-9\x20_+\-\[\]]+',
+ 'LETTER_NUM_PUNCTUATION' => '[\p{Lu}\p{Ll}][\p{Lu}\p{Ll}0-9.,\-_]+',
+ );
+
+ /**
+ * Return possible validation options
+ */
+ public function validate_options($field_data)
+ {
+ $validate_options = '';
+ foreach ($this->validation_options as $lang => $value)
+ {
+ $selected = ($field_data['field_validation'] == $value) ? ' selected="selected"' : '';
+ $validate_options .= '<option value="' . $value . '"' . $selected . '>' . $this->user->lang[$lang] . '</option>';
+ }
+
+ return $validate_options;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function get_default_field_value($field_data)
+ {
+ return $field_data['lang_default_value'];
+ }
+
+ /**
+ * Validate entered profile field data
+ *
+ * @param string $field_type Field type (string or text)
+ * @param mixed $field_value Field value to validate
+ * @param array $field_data Array with requirements of the field
+ * @return mixed String with key of the error language string, false otherwise
+ */
+ public function validate_string_profile_field($field_type, &$field_value, $field_data)
+ {
+ if (trim($field_value) === '' && !$field_data['field_required'])
+ {
+ return false;
+ }
+ else if (trim($field_value) === '' && $field_data['field_required'])
+ {
+ return $this->user->lang('FIELD_REQUIRED', $this->get_field_name($field_data['lang_name']));
+ }
+
+ if ($field_data['field_minlen'] && utf8_strlen($field_value) < $field_data['field_minlen'])
+ {
+ return $this->user->lang('FIELD_TOO_SHORT', (int) $field_data['field_minlen'], $this->get_field_name($field_data['lang_name']));
+ }
+ else if ($field_data['field_maxlen'] && utf8_strlen(html_entity_decode($field_value)) > $field_data['field_maxlen'])
+ {
+ return $this->user->lang('FIELD_TOO_LONG', (int) $field_data['field_maxlen'], $this->get_field_name($field_data['lang_name']));
+ }
+
+ if (!empty($field_data['field_validation']) && $field_data['field_validation'] != '.*')
+ {
+ $field_validate = ($field_type != 'text') ? $field_value : bbcode_nl2br($field_value);
+ if (!preg_match('#^' . str_replace('\\\\', '\\', $field_data['field_validation']) . '$#iu', $field_validate))
+ {
+ $validation = array_search($field_data['field_validation'], $this->validation_options);
+ if ($validation)
+ {
+ return $this->user->lang('FIELD_INVALID_CHARS_' . $validation, $this->get_field_name($field_data['lang_name']));
+ }
+ return $this->user->lang('FIELD_INVALID_CHARS_INVALID', $this->get_field_name($field_data['lang_name']));
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function get_profile_value($field_value, $field_data)
+ {
+ if (($field_value === null || $field_value === '') && !$field_data['field_show_novalue'])
+ {
+ return null;
+ }
+
+ $field_value = make_clickable($field_value);
+ $field_value = censor_text($field_value);
+ $field_value = bbcode_nl2br($field_value);
+ return $field_value;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function get_profile_value_raw($field_value, $field_data)
+ {
+ if (($field_value === null || $field_value === '') && !$field_data['field_show_novalue'])
+ {
+ return null;
+ }
+
+ return $field_value;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function get_profile_contact_value($field_value, $field_data)
+ {
+ return $this->get_profile_value_raw($field_value, $field_data);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function prepare_options_form(&$exclude_options, &$visibility_options)
+ {
+ $exclude_options[1][] = 'lang_default_value';
+
+ return $this->request->variable('lang_options', '', true);
+ }
+}
diff --git a/phpBB/phpbb/profilefields/type/type_text.php b/phpBB/phpbb/profilefields/type/type_text.php
new file mode 100644
index 0000000000..79ee82351a
--- /dev/null
+++ b/phpBB/phpbb/profilefields/type/type_text.php
@@ -0,0 +1,204 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\profilefields\type;
+
+class type_text extends type_string_common
+{
+ /**
+ * Request object
+ * @var \phpbb\request\request
+ */
+ protected $request;
+
+ /**
+ * Template object
+ * @var \phpbb\template\template
+ */
+ protected $template;
+
+ /**
+ * User object
+ * @var \phpbb\user
+ */
+ protected $user;
+
+ /**
+ * Construct
+ *
+ * @param \phpbb\request\request $request Request object
+ * @param \phpbb\template\template $template Template object
+ * @param \phpbb\user $user User object
+ */
+ public function __construct(\phpbb\request\request $request, \phpbb\template\template $template, \phpbb\user $user)
+ {
+ $this->request = $request;
+ $this->template = $template;
+ $this->user = $user;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function get_name_short()
+ {
+ return 'text';
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function get_options($default_lang_id, $field_data)
+ {
+ $options = array(
+ 0 => array('TITLE' => $this->user->lang['FIELD_LENGTH'], 'FIELD' => '<input type="number" min="0" max="99999" name="rows" value="' . $field_data['rows'] . '" /> ' . $this->user->lang['ROWS'] . '</dd><dd><input type="number" min="0" max="99999" name="columns" value="' . $field_data['columns'] . '" /> ' . $this->user->lang['COLUMNS'] . ' <input type="hidden" name="field_length" value="' . $field_data['field_length'] . '" />'),
+ 1 => array('TITLE' => $this->user->lang['MIN_FIELD_CHARS'], 'FIELD' => '<input type="number" min="0" max="9999999999" name="field_minlen" value="' . $field_data['field_minlen'] . '" />'),
+ 2 => array('TITLE' => $this->user->lang['MAX_FIELD_CHARS'], 'FIELD' => '<input type="number" min="0" max="9999999999" name="field_maxlen" value="' . $field_data['field_maxlen'] . '" />'),
+ 3 => array('TITLE' => $this->user->lang['FIELD_VALIDATION'], 'FIELD' => '<select name="field_validation">' . $this->validate_options($field_data) . '</select>'),
+ );
+
+ return $options;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function get_default_option_values()
+ {
+ return array(
+ 'field_length' => '5|80',
+ 'field_minlen' => 0,
+ 'field_maxlen' => 1000,
+ 'field_validation' => '.*',
+ 'field_novalue' => '',
+ 'field_default_value' => '',
+ );
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function get_profile_field($profile_row)
+ {
+ $var_name = 'pf_' . $profile_row['field_ident'];
+ return $this->request->variable($var_name, (string) $profile_row['field_default_value'], true);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function validate_profile_field(&$field_value, $field_data)
+ {
+ return $this->validate_string_profile_field('text', $field_value, $field_data);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function generate_field($profile_row, $preview_options = false)
+ {
+ $field_length = explode('|', $profile_row['field_length']);
+ $profile_row['field_rows'] = $field_length[0];
+ $profile_row['field_cols'] = $field_length[1];
+ $profile_row['field_ident'] = (isset($profile_row['var_name'])) ? $profile_row['var_name'] : 'pf_' . $profile_row['field_ident'];
+ $field_ident = $profile_row['field_ident'];
+ $default_value = $profile_row['lang_default_value'];
+
+ $profile_row['field_value'] = ($this->request->is_set($field_ident)) ? $this->request->variable($field_ident, $default_value, true) : ((!isset($this->user->profile_fields[$field_ident]) || $preview_options !== false) ? $default_value : $this->user->profile_fields[$field_ident]);
+
+ $this->template->assign_block_vars('text', array_change_key_case($profile_row, CASE_UPPER));
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function get_database_column_type()
+ {
+ return 'MTEXT';
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function get_language_options($field_data)
+ {
+ $options = array(
+ 'lang_name' => 'string',
+ );
+
+ if ($field_data['lang_explain'])
+ {
+ $options['lang_explain'] = 'text';
+ }
+
+ if (strlen($field_data['lang_default_value']))
+ {
+ $options['lang_default_value'] = 'text';
+ }
+
+ return $options;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function get_excluded_options($key, $action, $current_value, &$field_data, $step)
+ {
+ if ($step == 2 && $key == 'field_length')
+ {
+ if ($this->request->is_set('rows'))
+ {
+ $field_data['rows'] = $this->request->variable('rows', 0);
+ $field_data['columns'] = $this->request->variable('columns', 0);
+ $current_value = $field_data['rows'] . '|' . $field_data['columns'];
+ }
+ else
+ {
+ $row_col = explode('|', $current_value);
+ $field_data['rows'] = $row_col[0];
+ $field_data['columns'] = $row_col[1];
+ }
+
+ return $current_value;
+ }
+
+ return parent::get_excluded_options($key, $action, $current_value, $field_data, $step);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function prepare_hidden_fields($step, $key, $action, &$field_data)
+ {
+ if ($key == 'field_length' && $this->request->is_set('rows'))
+ {
+ $field_data['rows'] = $this->request->variable('rows', 0);
+ $field_data['columns'] = $this->request->variable('columns', 0);
+ return $field_data['rows'] . '|' . $field_data['columns'];
+ }
+
+ return parent::prepare_hidden_fields($step, $key, $action, $field_data);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function display_options(&$template_vars, &$field_data)
+ {
+ $template_vars = array_merge($template_vars, array(
+ 'S_TEXT' => true,
+ 'L_DEFAULT_VALUE_EXPLAIN' => $this->user->lang['TEXT_DEFAULT_VALUE_EXPLAIN'],
+ 'LANG_DEFAULT_VALUE' => $field_data['lang_default_value'],
+ ));
+ }
+}
diff --git a/phpBB/phpbb/profilefields/type/type_url.php b/phpBB/phpbb/profilefields/type/type_url.php
new file mode 100644
index 0000000000..375cf5b19a
--- /dev/null
+++ b/phpBB/phpbb/profilefields/type/type_url.php
@@ -0,0 +1,74 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\profilefields\type;
+
+class type_url extends type_string
+{
+ /**
+ * {@inheritDoc}
+ */
+ public function get_name_short()
+ {
+ return 'url';
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function get_options($default_lang_id, $field_data)
+ {
+ $options = array(
+ 0 => array('TITLE' => $this->user->lang['FIELD_LENGTH'], 'FIELD' => '<input type="number" min="0" max="99999" name="field_length" value="' . $field_data['field_length'] . '" />'),
+ 1 => array('TITLE' => $this->user->lang['MIN_FIELD_CHARS'], 'FIELD' => '<input type="number" min="0" max="99999" name="field_minlen" value="' . $field_data['field_minlen'] . '" />'),
+ 2 => array('TITLE' => $this->user->lang['MAX_FIELD_CHARS'], 'FIELD' => '<input type="number" min="0" max="99999" name="field_maxlen" value="' . $field_data['field_maxlen'] . '" />'),
+ );
+
+ return $options;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function get_default_option_values()
+ {
+ return array(
+ 'field_length' => 40,
+ 'field_minlen' => 0,
+ 'field_maxlen' => 200,
+ 'field_validation' => '',
+ 'field_novalue' => '',
+ 'field_default_value' => '',
+ );
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function validate_profile_field(&$field_value, $field_data)
+ {
+ $field_value = trim($field_value);
+
+ if ($field_value === '' && !$field_data['field_required'])
+ {
+ return false;
+ }
+
+ if (!preg_match('#^' . get_preg_expression('url') . '$#iu', $field_value))
+ {
+ return $this->user->lang('FIELD_INVALID_URL', $this->get_field_name($field_data['lang_name']));
+ }
+
+ return false;
+ }
+}
diff --git a/phpBB/phpbb/recursive_dot_prefix_filter_iterator.php b/phpBB/phpbb/recursive_dot_prefix_filter_iterator.php
new file mode 100644
index 0000000000..1446551b8b
--- /dev/null
+++ b/phpBB/phpbb/recursive_dot_prefix_filter_iterator.php
@@ -0,0 +1,30 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb;
+
+/**
+* Class recursive_dot_prefix_filter_iterator
+*
+* This filter ignores directories starting with a dot.
+* When searching for php classes and template files of extensions
+* we don't need to look inside these directories.
+*/
+class recursive_dot_prefix_filter_iterator extends \RecursiveFilterIterator
+{
+ public function accept()
+ {
+ $filename = $this->current()->getFilename();
+ return $filename[0] !== '.' || !$this->current()->isDir();
+ }
+}
diff --git a/phpBB/phpbb/request/deactivated_super_global.php b/phpBB/phpbb/request/deactivated_super_global.php
new file mode 100644
index 0000000000..b6cad59be4
--- /dev/null
+++ b/phpBB/phpbb/request/deactivated_super_global.php
@@ -0,0 +1,116 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\request;
+
+/**
+* Replacement for a superglobal (like $_GET or $_POST) which calls
+* trigger_error on all operations but isset, overloads the [] operator with SPL.
+*/
+class deactivated_super_global implements \ArrayAccess, \Countable, \IteratorAggregate
+{
+ /**
+ * @var string Holds the name of the superglobal this is replacing.
+ */
+ private $name;
+
+ /**
+ * @var \phpbb\request\request_interface::POST|GET|REQUEST|COOKIE Super global constant.
+ */
+ private $super_global;
+
+ /**
+ * @var \phpbb\request\request_interface The request class instance holding the actual request data.
+ */
+ private $request;
+
+ /**
+ * Constructor generates an error message fitting the super global to be used within the other functions.
+ *
+ * @param \phpbb\request\request_interface $request A request class instance holding the real super global data.
+ * @param string $name Name of the super global this is a replacement for - e.g. '_GET'.
+ * @param \phpbb\request\request_interface::POST|GET|REQUEST|COOKIE $super_global The variable's super global constant.
+ */
+ public function __construct(\phpbb\request\request_interface $request, $name, $super_global)
+ {
+ $this->request = $request;
+ $this->name = $name;
+ $this->super_global = $super_global;
+ }
+
+ /**
+ * Calls trigger_error with the file and line number the super global was used in.
+ */
+ private function error()
+ {
+ $file = '';
+ $line = 0;
+
+ $message = 'Illegal use of $' . $this->name . '. You must use the request class or request_var() to access input data. Found in %s on line %d. This error message was generated by deactivated_super_global.';
+
+ $backtrace = debug_backtrace();
+ if (isset($backtrace[1]))
+ {
+ $file = $backtrace[1]['file'];
+ $line = $backtrace[1]['line'];
+ }
+ trigger_error(sprintf($message, $file, $line), E_USER_ERROR);
+ }
+
+ /**
+ * Redirects isset to the correct request class call.
+ *
+ * @param string $offset The key of the super global being accessed.
+ *
+ * @return bool Whether the key on the super global exists.
+ */
+ public function offsetExists($offset)
+ {
+ return $this->request->is_set($offset, $this->super_global);
+ }
+
+ /**#@+
+ * Part of the \ArrayAccess implementation, will always result in a FATAL error.
+ */
+ public function offsetGet($offset)
+ {
+ $this->error();
+ }
+
+ public function offsetSet($offset, $value)
+ {
+ $this->error();
+ }
+
+ public function offsetUnset($offset)
+ {
+ $this->error();
+ }
+ /**#@-*/
+
+ /**
+ * Part of the \Countable implementation, will always result in a FATAL error
+ */
+ public function count()
+ {
+ $this->error();
+ }
+
+ /**
+ * Part of the Traversable/IteratorAggregate implementation, will always result in a FATAL error
+ */
+ public function getIterator()
+ {
+ $this->error();
+ }
+}
diff --git a/phpBB/phpbb/request/request.php b/phpBB/phpbb/request/request.php
new file mode 100644
index 0000000000..00ff9064cb
--- /dev/null
+++ b/phpBB/phpbb/request/request.php
@@ -0,0 +1,438 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\request;
+
+/**
+* All application input is accessed through this class.
+*
+* It provides a method to disable access to input data through super globals.
+* This should force MOD authors to read about data validation.
+*/
+class request implements \phpbb\request\request_interface
+{
+ /**
+ * @var array The names of super global variables that this class should protect if super globals are disabled.
+ */
+ protected $super_globals = array(
+ \phpbb\request\request_interface::POST => '_POST',
+ \phpbb\request\request_interface::GET => '_GET',
+ \phpbb\request\request_interface::REQUEST => '_REQUEST',
+ \phpbb\request\request_interface::COOKIE => '_COOKIE',
+ \phpbb\request\request_interface::SERVER => '_SERVER',
+ \phpbb\request\request_interface::FILES => '_FILES',
+ );
+
+ /**
+ * @var array Stores original contents of $_REQUEST array.
+ */
+ protected $original_request = null;
+
+ /**
+ * @var
+ */
+ protected $super_globals_disabled = false;
+
+ /**
+ * @var array An associative array that has the value of super global constants as keys and holds their data as values.
+ */
+ protected $input;
+
+ /**
+ * @var \phpbb\request\type_cast_helper_interface An instance of a type cast helper providing convenience methods for type conversions.
+ */
+ protected $type_cast_helper;
+
+ /**
+ * Initialises the request class, that means it stores all input data in {@link $input input}
+ * and then calls {@link \phpbb\request\deactivated_super_global \phpbb\request\deactivated_super_global}
+ */
+ public function __construct(\phpbb\request\type_cast_helper_interface $type_cast_helper = null, $disable_super_globals = true)
+ {
+ if ($type_cast_helper)
+ {
+ $this->type_cast_helper = $type_cast_helper;
+ }
+ else
+ {
+ $this->type_cast_helper = new \phpbb\request\type_cast_helper();
+ }
+
+ foreach ($this->super_globals as $const => $super_global)
+ {
+ $this->input[$const] = isset($GLOBALS[$super_global]) ? $GLOBALS[$super_global] : array();
+ }
+
+ // simulate request_order = GP
+ $this->original_request = $this->input[\phpbb\request\request_interface::REQUEST];
+ $this->input[\phpbb\request\request_interface::REQUEST] = $this->input[\phpbb\request\request_interface::POST] + $this->input[\phpbb\request\request_interface::GET];
+
+ if ($disable_super_globals)
+ {
+ $this->disable_super_globals();
+ }
+ }
+
+ /**
+ * Getter for $super_globals_disabled
+ *
+ * @return bool Whether super globals are disabled or not.
+ */
+ public function super_globals_disabled()
+ {
+ return $this->super_globals_disabled;
+ }
+
+ /**
+ * Disables access of super globals specified in $super_globals.
+ * This is achieved by overwriting the super globals with instances of {@link \phpbb\request\deactivated_super_global \phpbb\request\deactivated_super_global}
+ */
+ public function disable_super_globals()
+ {
+ if (!$this->super_globals_disabled)
+ {
+ foreach ($this->super_globals as $const => $super_global)
+ {
+ unset($GLOBALS[$super_global]);
+ $GLOBALS[$super_global] = new \phpbb\request\deactivated_super_global($this, $super_global, $const);
+ }
+
+ $this->super_globals_disabled = true;
+ }
+ }
+
+ /**
+ * Enables access of super globals specified in $super_globals if they were disabled by {@link disable_super_globals disable_super_globals}.
+ * This is achieved by making the super globals point to the data stored within this class in {@link $input input}.
+ */
+ public function enable_super_globals()
+ {
+ if ($this->super_globals_disabled)
+ {
+ foreach ($this->super_globals as $const => $super_global)
+ {
+ $GLOBALS[$super_global] = $this->input[$const];
+ }
+
+ $GLOBALS['_REQUEST'] = $this->original_request;
+
+ $this->super_globals_disabled = false;
+ }
+ }
+
+ /**
+ * This function allows overwriting or setting a value in one of the super global arrays.
+ *
+ * Changes which are performed on the super globals directly will not have any effect on the results of
+ * other methods this class provides. Using this function should be avoided if possible! It will
+ * consume twice the the amount of memory of the value
+ *
+ * @param string $var_name The name of the variable that shall be overwritten
+ * @param mixed $value The value which the variable shall contain.
+ * If this is null the variable will be unset.
+ * @param \phpbb\request\request_interface::POST|GET|REQUEST|COOKIE $super_global
+ * Specifies which super global shall be changed
+ */
+ public function overwrite($var_name, $value, $super_global = \phpbb\request\request_interface::REQUEST)
+ {
+ if (!isset($this->super_globals[$super_global]))
+ {
+ return;
+ }
+
+ $this->type_cast_helper->add_magic_quotes($value);
+
+ // setting to null means unsetting
+ if ($value === null)
+ {
+ unset($this->input[$super_global][$var_name]);
+ if (!$this->super_globals_disabled())
+ {
+ unset($GLOBALS[$this->super_globals[$super_global]][$var_name]);
+ }
+ }
+ else
+ {
+ $this->input[$super_global][$var_name] = $value;
+ if (!$this->super_globals_disabled())
+ {
+ $GLOBALS[$this->super_globals[$super_global]][$var_name] = $value;
+ }
+ }
+ }
+
+ /**
+ * Central type safe input handling function.
+ * All variables in GET or POST requests should be retrieved through this function to maximise security.
+ *
+ * @param string|array $var_name The form variable's name from which data shall be retrieved.
+ * If the value is an array this may be an array of indizes which will give
+ * direct access to a value at any depth. E.g. if the value of "var" is array(1 => "a")
+ * then specifying array("var", 1) as the name will return "a".
+ * @param mixed $default A default value that is returned if the variable was not set.
+ * This function will always return a value of the same type as the default.
+ * @param bool $multibyte If $default is a string this paramater has to be true if the variable may contain any UTF-8 characters
+ * Default is false, causing all bytes outside the ASCII range (0-127) to be replaced with question marks
+ * @param \phpbb\request\request_interface::POST|GET|REQUEST|COOKIE $super_global
+ * Specifies which super global should be used
+ *
+ * @return mixed The value of $_REQUEST[$var_name] run through {@link set_var set_var} to ensure that the type is the
+ * the same as that of $default. If the variable is not set $default is returned.
+ */
+ public function variable($var_name, $default, $multibyte = false, $super_global = \phpbb\request\request_interface::REQUEST)
+ {
+ return $this->_variable($var_name, $default, $multibyte, $super_global, true);
+ }
+
+ /**
+ * Get a variable, but without trimming strings.
+ * Same functionality as variable(), except does not run trim() on strings.
+ * This method should be used when handling passwords.
+ *
+ * @param string|array $var_name The form variable's name from which data shall be retrieved.
+ * If the value is an array this may be an array of indizes which will give
+ * direct access to a value at any depth. E.g. if the value of "var" is array(1 => "a")
+ * then specifying array("var", 1) as the name will return "a".
+ * @param mixed $default A default value that is returned if the variable was not set.
+ * This function will always return a value of the same type as the default.
+ * @param bool $multibyte If $default is a string this paramater has to be true if the variable may contain any UTF-8 characters
+ * Default is false, causing all bytes outside the ASCII range (0-127) to be replaced with question marks
+ * @param \phpbb\request\request_interface::POST|GET|REQUEST|COOKIE $super_global
+ * Specifies which super global should be used
+ *
+ * @return mixed The value of $_REQUEST[$var_name] run through {@link set_var set_var} to ensure that the type is the
+ * the same as that of $default. If the variable is not set $default is returned.
+ */
+ public function untrimmed_variable($var_name, $default, $multibyte = false, $super_global = \phpbb\request\request_interface::REQUEST)
+ {
+ return $this->_variable($var_name, $default, $multibyte, $super_global, false);
+ }
+
+ /**
+ * Shortcut method to retrieve SERVER variables.
+ *
+ * Also fall back to getenv(), some CGI setups may need it (probably not, but
+ * whatever).
+ *
+ * @param string|array $var_name See \phpbb\request\request_interface::variable
+ * @param mixed $Default See \phpbb\request\request_interface::variable
+ *
+ * @return mixed The server variable value.
+ */
+ public function server($var_name, $default = '')
+ {
+ $multibyte = true;
+
+ if ($this->is_set($var_name, \phpbb\request\request_interface::SERVER))
+ {
+ return $this->variable($var_name, $default, $multibyte, \phpbb\request\request_interface::SERVER);
+ }
+ else
+ {
+ $var = getenv($var_name);
+ $this->type_cast_helper->recursive_set_var($var, $default, $multibyte);
+ return $var;
+ }
+ }
+
+ /**
+ * Shortcut method to retrieve the value of client HTTP headers.
+ *
+ * @param string|array $header_name The name of the header to retrieve.
+ * @param mixed $default See \phpbb\request\request_interface::variable
+ *
+ * @return mixed The header value.
+ */
+ public function header($header_name, $default = '')
+ {
+ $var_name = 'HTTP_' . str_replace('-', '_', strtoupper($header_name));
+ return $this->server($var_name, $default);
+ }
+
+ /**
+ * Shortcut method to retrieve $_FILES variables
+ *
+ * @param string $form_name The name of the file input form element
+ *
+ * @return array The uploaded file's information or an empty array if the
+ * variable does not exist in _FILES.
+ */
+ public function file($form_name)
+ {
+ return $this->variable($form_name, array('name' => 'none'), true, \phpbb\request\request_interface::FILES);
+ }
+
+ /**
+ * Checks whether a certain variable was sent via POST.
+ * To make sure that a request was sent using POST you should call this function
+ * on at least one variable.
+ *
+ * @param string $name The name of the form variable which should have a
+ * _p suffix to indicate the check in the code that creates the form too.
+ *
+ * @return bool True if the variable was set in a POST request, false otherwise.
+ */
+ public function is_set_post($name)
+ {
+ return $this->is_set($name, \phpbb\request\request_interface::POST);
+ }
+
+ /**
+ * Checks whether a certain variable is set in one of the super global
+ * arrays.
+ *
+ * @param string $var Name of the variable
+ * @param \phpbb\request\request_interface::POST|GET|REQUEST|COOKIE $super_global
+ * Specifies the super global which shall be checked
+ *
+ * @return bool True if the variable was sent as input
+ */
+ public function is_set($var, $super_global = \phpbb\request\request_interface::REQUEST)
+ {
+ return isset($this->input[$super_global][$var]);
+ }
+
+ /**
+ * Checks whether the current request is an AJAX request (XMLHttpRequest)
+ *
+ * @return bool True if the current request is an ajax request
+ */
+ public function is_ajax()
+ {
+ return $this->header('X-Requested-With') == 'XMLHttpRequest';
+ }
+
+ /**
+ * Checks if the current request is happening over HTTPS.
+ *
+ * @return bool True if the request is secure.
+ */
+ public function is_secure()
+ {
+ $https = $this->server('HTTPS');
+ $https = $this->server('HTTP_X_FORWARDED_PROTO') === 'https' ? 'on' : $https;
+ return !empty($https) && $https !== 'off';
+ }
+
+ /**
+ * Returns all variable names for a given super global
+ *
+ * @param \phpbb\request\request_interface::POST|GET|REQUEST|COOKIE $super_global
+ * The super global from which names shall be taken
+ *
+ * @return array All variable names that are set for the super global.
+ * Pay attention when using these, they are unsanitised!
+ */
+ public function variable_names($super_global = \phpbb\request\request_interface::REQUEST)
+ {
+ if (!isset($this->input[$super_global]))
+ {
+ return array();
+ }
+
+ return array_keys($this->input[$super_global]);
+ }
+
+ /**
+ * Helper function used by variable() and untrimmed_variable().
+ *
+ * @param string|array $var_name The form variable's name from which data shall be retrieved.
+ * If the value is an array this may be an array of indizes which will give
+ * direct access to a value at any depth. E.g. if the value of "var" is array(1 => "a")
+ * then specifying array("var", 1) as the name will return "a".
+ * @param mixed $default A default value that is returned if the variable was not set.
+ * This function will always return a value of the same type as the default.
+ * @param bool $multibyte If $default is a string this paramater has to be true if the variable may contain any UTF-8 characters
+ * Default is false, causing all bytes outside the ASCII range (0-127) to be replaced with question marks
+ * @param \phpbb\request\request_interface::POST|GET|REQUEST|COOKIE $super_global
+ * Specifies which super global should be used
+ * @param bool $trim Indicates whether trim() should be applied to string values.
+ *
+ * @return mixed The value of $_REQUEST[$var_name] run through {@link set_var set_var} to ensure that the type is the
+ * the same as that of $default. If the variable is not set $default is returned.
+ */
+ protected function _variable($var_name, $default, $multibyte = false, $super_global = \phpbb\request\request_interface::REQUEST, $trim = true)
+ {
+ $path = false;
+
+ // deep direct access to multi dimensional arrays
+ if (is_array($var_name))
+ {
+ $path = $var_name;
+ // make sure at least the variable name is specified
+ if (empty($path))
+ {
+ return (is_array($default)) ? array() : $default;
+ }
+ // the variable name is the first element on the path
+ $var_name = array_shift($path);
+ }
+
+ if (!isset($this->input[$super_global][$var_name]))
+ {
+ return (is_array($default)) ? array() : $default;
+ }
+ $var = $this->input[$super_global][$var_name];
+
+ if ($path)
+ {
+ // walk through the array structure and find the element we are looking for
+ foreach ($path as $key)
+ {
+ if (is_array($var) && isset($var[$key]))
+ {
+ $var = $var[$key];
+ }
+ else
+ {
+ return (is_array($default)) ? array() : $default;
+ }
+ }
+ }
+
+ $this->type_cast_helper->recursive_set_var($var, $default, $multibyte, $trim);
+
+ return $var;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_super_global($super_global = \phpbb\request\request_interface::REQUEST)
+ {
+ return $this->input[$super_global];
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function escape($var, $multibyte)
+ {
+ if (is_array($var))
+ {
+ $result = array();
+ foreach ($var as $key => $value)
+ {
+ $this->type_cast_helper->set_var($key, $key, gettype($key), $multibyte);
+ $result[$key] = $this->escape($value, $multibyte);
+ }
+ $var = $result;
+ }
+ else
+ {
+ $this->type_cast_helper->set_var($var, $var, 'string', $multibyte);
+ }
+
+ return $var;
+ }
+}
diff --git a/phpBB/phpbb/request/request_interface.php b/phpBB/phpbb/request/request_interface.php
new file mode 100644
index 0000000000..47b3b3a4ed
--- /dev/null
+++ b/phpBB/phpbb/request/request_interface.php
@@ -0,0 +1,155 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\request;
+
+/**
+* An interface through which all application input can be accessed.
+*/
+interface request_interface
+{
+ /**#@+
+ * Constant identifying the super global with the same name.
+ */
+ const POST = 0;
+ const GET = 1;
+ const REQUEST = 2;
+ const COOKIE = 3;
+ const SERVER = 4;
+ const FILES = 5;
+ /**#@-*/
+
+ /**
+ * This function allows overwriting or setting a value in one of the super global arrays.
+ *
+ * Changes which are performed on the super globals directly will not have any effect on the results of
+ * other methods this class provides. Using this function should be avoided if possible! It will
+ * consume twice the the amount of memory of the value
+ *
+ * @param string $var_name The name of the variable that shall be overwritten
+ * @param mixed $value The value which the variable shall contain.
+ * If this is null the variable will be unset.
+ * @param \phpbb\request\request_interface::POST|GET|REQUEST|COOKIE $super_global
+ * Specifies which super global shall be changed
+ */
+ public function overwrite($var_name, $value, $super_global = \phpbb\request\request_interface::REQUEST);
+
+ /**
+ * Central type safe input handling function.
+ * All variables in GET or POST requests should be retrieved through this function to maximise security.
+ *
+ * @param string|array $var_name The form variable's name from which data shall be retrieved.
+ * If the value is an array this may be an array of indizes which will give
+ * direct access to a value at any depth. E.g. if the value of "var" is array(1 => "a")
+ * then specifying array("var", 1) as the name will return "a".
+ * @param mixed $default A default value that is returned if the variable was not set.
+ * This function will always return a value of the same type as the default.
+ * @param bool $multibyte If $default is a string this paramater has to be true if the variable may contain any UTF-8 characters
+ * Default is false, causing all bytes outside the ASCII range (0-127) to be replaced with question marks
+ * @param \phpbb\request\request_interface::POST|GET|REQUEST|COOKIE $super_global
+ * Specifies which super global should be used
+ *
+ * @return mixed The value of $_REQUEST[$var_name] run through {@link set_var set_var} to ensure that the type is the
+ * the same as that of $default. If the variable is not set $default is returned.
+ */
+ public function variable($var_name, $default, $multibyte = false, $super_global = \phpbb\request\request_interface::REQUEST);
+
+ /**
+ * Shortcut method to retrieve SERVER variables.
+ *
+ * @param string|array $var_name See \phpbb\request\request_interface::variable
+ * @param mixed $default See \phpbb\request\request_interface::variable
+ *
+ * @return mixed The server variable value.
+ */
+ public function server($var_name, $default = '');
+
+ /**
+ * Shortcut method to retrieve the value of client HTTP headers.
+ *
+ * @param string|array $header_name The name of the header to retrieve.
+ * @param mixed $default See \phpbb\request\request_interface::variable
+ *
+ * @return mixed The header value.
+ */
+ public function header($var_name, $default = '');
+
+ /**
+ * Checks whether a certain variable was sent via POST.
+ * To make sure that a request was sent using POST you should call this function
+ * on at least one variable.
+ *
+ * @param string $name The name of the form variable which should have a
+ * _p suffix to indicate the check in the code that creates the form too.
+ *
+ * @return bool True if the variable was set in a POST request, false otherwise.
+ */
+ public function is_set_post($name);
+
+ /**
+ * Checks whether a certain variable is set in one of the super global
+ * arrays.
+ *
+ * @param string $var Name of the variable
+ * @param \phpbb\request\request_interface::POST|GET|REQUEST|COOKIE $super_global
+ * Specifies the super global which shall be checked
+ *
+ * @return bool True if the variable was sent as input
+ */
+ public function is_set($var, $super_global = \phpbb\request\request_interface::REQUEST);
+
+ /**
+ * Checks whether the current request is an AJAX request (XMLHttpRequest)
+ *
+ * @return bool True if the current request is an ajax request
+ */
+ public function is_ajax();
+
+ /**
+ * Checks if the current request is happening over HTTPS.
+ *
+ * @return bool True if the request is secure.
+ */
+ public function is_secure();
+
+ /**
+ * Returns all variable names for a given super global
+ *
+ * @param \phpbb\request\request_interface::POST|GET|REQUEST|COOKIE $super_global
+ * The super global from which names shall be taken
+ *
+ * @return array All variable names that are set for the super global.
+ * Pay attention when using these, they are unsanitised!
+ */
+ public function variable_names($super_global = \phpbb\request\request_interface::REQUEST);
+
+ /**
+ * Returns the original array of the requested super global
+ *
+ * @param \phpbb\request\request_interface::POST|GET|REQUEST|COOKIE $super_global
+ * The super global which will be returned
+ *
+ * @return array The original array of the requested super global.
+ */
+ public function get_super_global($super_global = \phpbb\request\request_interface::REQUEST);
+
+ /**
+ * Escape a string variable.
+ *
+ * @param mixed $value The contents to fill with
+ * @param bool $multibyte Indicates whether string values may contain UTF-8 characters.
+ * Default is false, causing all bytes outside the ASCII range (0-127) to be replaced with question marks.
+ * @return string|array
+ */
+ public function escape($value, $multibyte);
+}
diff --git a/phpBB/phpbb/request/type_cast_helper.php b/phpBB/phpbb/request/type_cast_helper.php
new file mode 100644
index 0000000000..bc654e6182
--- /dev/null
+++ b/phpBB/phpbb/request/type_cast_helper.php
@@ -0,0 +1,190 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\request;
+
+/**
+* A helper class that provides convenience methods for type casting.
+*/
+class type_cast_helper implements \phpbb\request\type_cast_helper_interface
+{
+
+ /**
+ * @var string Whether slashes need to be stripped from input
+ */
+ protected $strip;
+
+ /**
+ * Initialises the type cast helper class.
+ * All it does is find out whether magic quotes are turned on.
+ */
+ public function __construct()
+ {
+ if (version_compare(PHP_VERSION, '5.4.0-dev', '>='))
+ {
+ $this->strip = false;
+ }
+ else
+ {
+ $this->strip = (@get_magic_quotes_gpc()) ? true : false;
+ }
+ }
+
+ /**
+ * Recursively applies addslashes to a variable.
+ *
+ * @param mixed &$var Variable passed by reference to which slashes will be added.
+ */
+ public function addslashes_recursively(&$var)
+ {
+ if (is_string($var))
+ {
+ $var = addslashes($var);
+ }
+ else if (is_array($var))
+ {
+ $var_copy = $var;
+ $var = array();
+ foreach ($var_copy as $key => $value)
+ {
+ if (is_string($key))
+ {
+ $key = addslashes($key);
+ }
+ $var[$key] = $value;
+
+ $this->addslashes_recursively($var[$key]);
+ }
+ }
+ }
+
+ /**
+ * Recursively applies addslashes to a variable if magic quotes are turned on.
+ *
+ * @param mixed &$var Variable passed by reference to which slashes will be added.
+ */
+ public function add_magic_quotes(&$var)
+ {
+ if ($this->strip)
+ {
+ $this->addslashes_recursively($var);
+ }
+ }
+
+ /**
+ * Set variable $result to a particular type.
+ *
+ * @param mixed &$result The variable to fill
+ * @param mixed $var The contents to fill with
+ * @param mixed $type The variable type. Will be used with {@link settype()}
+ * @param bool $multibyte Indicates whether string values may contain UTF-8 characters.
+ * Default is false, causing all bytes outside the ASCII range (0-127) to be replaced with question marks.
+ * @param bool $trim Indicates whether trim() should be applied to string values.
+ * Default is true.
+ */
+ public function set_var(&$result, $var, $type, $multibyte = false, $trim = true)
+ {
+ settype($var, $type);
+ $result = $var;
+
+ if ($type == 'string')
+ {
+ $result = str_replace(array("\r\n", "\r", "\0"), array("\n", "\n", ''), $result);
+
+ if ($trim)
+ {
+ $result = trim($result);
+ }
+
+ $result = htmlspecialchars($result, ENT_COMPAT, 'UTF-8');
+
+ if ($multibyte)
+ {
+ $result = utf8_normalize_nfc($result);
+ }
+
+ if (!empty($result))
+ {
+ // Make sure multibyte characters are wellformed
+ if ($multibyte)
+ {
+ if (!preg_match('/^./u', $result))
+ {
+ $result = '';
+ }
+ }
+ else
+ {
+ // no multibyte, allow only ASCII (0-127)
+ $result = preg_replace('/[\x80-\xFF]/', '?', $result);
+ }
+ }
+
+ $result = ($this->strip) ? stripslashes($result) : $result;
+ }
+ }
+
+ /**
+ * Recursively sets a variable to a given type using {@link set_var set_var}
+ *
+ * @param string $var The value which shall be sanitised (passed by reference).
+ * @param mixed $default Specifies the type $var shall have.
+ * If it is an array and $var is not one, then an empty array is returned.
+ * Otherwise var is cast to the same type, and if $default is an array all
+ * keys and values are cast recursively using this function too.
+ * @param bool $multibyte Indicates whether string keys and values may contain UTF-8 characters.
+ * Default is false, causing all bytes outside the ASCII range (0-127) to
+ * be replaced with question marks.
+ * @param bool $trim Indicates whether trim() should be applied to string values.
+ * Default is true.
+ */
+ public function recursive_set_var(&$var, $default, $multibyte, $trim = true)
+ {
+ if (is_array($var) !== is_array($default))
+ {
+ $var = (is_array($default)) ? array() : $default;
+ return;
+ }
+
+ if (!is_array($default))
+ {
+ $type = gettype($default);
+ $this->set_var($var, $var, $type, $multibyte, $trim);
+ }
+ else
+ {
+ // make sure there is at least one key/value pair to use get the
+ // types from
+ if (empty($default))
+ {
+ $var = array();
+ return;
+ }
+
+ list($default_key, $default_value) = each($default);
+ $value_type = gettype($default_value);
+ $key_type = gettype($default_key);
+
+ $_var = $var;
+ $var = array();
+
+ foreach ($_var as $k => $v)
+ {
+ $this->set_var($k, $k, $key_type, $multibyte);
+
+ $this->recursive_set_var($v, $default_value, $multibyte, $trim);
+ $var[$k] = $v;
+ }
+ }
+ }
+}
diff --git a/phpBB/phpbb/request/type_cast_helper_interface.php b/phpBB/phpbb/request/type_cast_helper_interface.php
new file mode 100644
index 0000000000..2cb28d021f
--- /dev/null
+++ b/phpBB/phpbb/request/type_cast_helper_interface.php
@@ -0,0 +1,59 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\request;
+
+/**
+* An interface for type cast operations.
+*/
+interface type_cast_helper_interface
+{
+ /**
+ * Recursively applies addslashes to a variable.
+ *
+ * @param mixed &$var Variable passed by reference to which slashes will be added.
+ */
+ public function addslashes_recursively(&$var);
+
+ /**
+ * Recursively applies addslashes to a variable if magic quotes are turned on.
+ *
+ * @param mixed &$var Variable passed by reference to which slashes will be added.
+ */
+ public function add_magic_quotes(&$var);
+
+ /**
+ * Set variable $result to a particular type.
+ *
+ * @param mixed &$result The variable to fill
+ * @param mixed $var The contents to fill with
+ * @param mixed $type The variable type. Will be used with {@link settype()}
+ * @param bool $multibyte Indicates whether string values may contain UTF-8 characters.
+ * Default is false, causing all bytes outside the ASCII range (0-127) to be replaced with question marks.
+ */
+ public function set_var(&$result, $var, $type, $multibyte = false);
+
+ /**
+ * Recursively sets a variable to a given type using {@link set_var set_var}.
+ *
+ * @param string $var The value which shall be sanitised (passed by reference).
+ * @param mixed $default Specifies the type $var shall have.
+ * If it is an array and $var is not one, then an empty array is returned.
+ * Otherwise var is cast to the same type, and if $default is an array all
+ * keys and values are cast recursively using this function too.
+ * @param bool $multibyte Indicates whether string keys and values may contain UTF-8 characters.
+ * Default is false, causing all bytes outside the ASCII range (0-127) to
+ * be replaced with question marks.
+ */
+ public function recursive_set_var(&$var, $default, $multibyte);
+}
diff --git a/phpBB/phpbb/search/base.php b/phpBB/phpbb/search/base.php
new file mode 100644
index 0000000000..d9313dddab
--- /dev/null
+++ b/phpBB/phpbb/search/base.php
@@ -0,0 +1,292 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\search;
+
+/**
+* @ignore
+*/
+define('SEARCH_RESULT_NOT_IN_CACHE', 0);
+define('SEARCH_RESULT_IN_CACHE', 1);
+define('SEARCH_RESULT_INCOMPLETE', 2);
+
+/**
+* optional base class for search plugins providing simple caching based on ACM
+* and functions to retrieve ignore_words and synonyms
+*/
+class base
+{
+ var $ignore_words = array();
+ var $match_synonym = array();
+ var $replace_synonym = array();
+
+ function search_backend(&$error)
+ {
+ // This class cannot be used as a search plugin
+ $error = true;
+ }
+
+ /**
+ * Retrieves cached search results
+ *
+ * @param string $search_key an md5 string generated from all the passed search options to identify the results
+ * @param int &$result_count will contain the number of all results for the search (not only for the current page)
+ * @param array &$id_ary is filled with the ids belonging to the requested page that are stored in the cache
+ * @param int &$start indicates the first index of the page
+ * @param int $per_page number of ids each page is supposed to contain
+ * @param string $sort_dir is either a or d representing ASC and DESC
+ *
+ * @return int SEARCH_RESULT_NOT_IN_CACHE or SEARCH_RESULT_IN_CACHE or SEARCH_RESULT_INCOMPLETE
+ */
+ function obtain_ids($search_key, &$result_count, &$id_ary, &$start, $per_page, $sort_dir)
+ {
+ global $cache;
+
+ if (!($stored_ids = $cache->get('_search_results_' . $search_key)))
+ {
+ // no search results cached for this search_key
+ return SEARCH_RESULT_NOT_IN_CACHE;
+ }
+ else
+ {
+ $result_count = $stored_ids[-1];
+ $reverse_ids = ($stored_ids[-2] != $sort_dir) ? true : false;
+ $complete = true;
+
+ // Change start parameter in case out of bounds
+ if ($result_count)
+ {
+ if ($start < 0)
+ {
+ $start = 0;
+ }
+ else if ($start >= $result_count)
+ {
+ $start = floor(($result_count - 1) / $per_page) * $per_page;
+ }
+ }
+
+ // change the start to the actual end of the current request if the sort direction differs
+ // from the dirction in the cache and reverse the ids later
+ if ($reverse_ids)
+ {
+ $start = $result_count - $start - $per_page;
+
+ // the user requested a page past the last index
+ if ($start < 0)
+ {
+ return SEARCH_RESULT_NOT_IN_CACHE;
+ }
+ }
+
+ for ($i = $start, $n = $start + $per_page; ($i < $n) && ($i < $result_count); $i++)
+ {
+ if (!isset($stored_ids[$i]))
+ {
+ $complete = false;
+ }
+ else
+ {
+ $id_ary[] = $stored_ids[$i];
+ }
+ }
+ unset($stored_ids);
+
+ if ($reverse_ids)
+ {
+ $id_ary = array_reverse($id_ary);
+ }
+
+ if (!$complete)
+ {
+ return SEARCH_RESULT_INCOMPLETE;
+ }
+ return SEARCH_RESULT_IN_CACHE;
+ }
+ }
+
+ /**
+ * Caches post/topic ids
+ *
+ * @param string $search_key an md5 string generated from all the passed search options to identify the results
+ * @param string $keywords contains the keywords as entered by the user
+ * @param array $author_ary an array of author ids, if the author should be ignored during the search the array is empty
+ * @param int $result_count contains the number of all results for the search (not only for the current page)
+ * @param array &$id_ary contains a list of post or topic ids that shall be cached, the first element
+ * must have the absolute index $start in the result set.
+ * @param int $start indicates the first index of the page
+ * @param string $sort_dir is either a or d representing ASC and DESC
+ *
+ * @return null
+ */
+ function save_ids($search_key, $keywords, $author_ary, $result_count, &$id_ary, $start, $sort_dir)
+ {
+ global $cache, $config, $db, $user;
+
+ $length = min(sizeof($id_ary), $config['search_block_size']);
+
+ // nothing to cache so exit
+ if (!$length)
+ {
+ return;
+ }
+
+ $store_ids = array_slice($id_ary, 0, $length);
+
+ // create a new resultset if there is none for this search_key yet
+ // or add the ids to the existing resultset
+ if (!($store = $cache->get('_search_results_' . $search_key)))
+ {
+ // add the current keywords to the recent searches in the cache which are listed on the search page
+ if (!empty($keywords) || sizeof($author_ary))
+ {
+ $sql = 'SELECT search_time
+ FROM ' . SEARCH_RESULTS_TABLE . '
+ WHERE search_key = \'' . $db->sql_escape($search_key) . '\'';
+ $result = $db->sql_query($sql);
+
+ if (!$db->sql_fetchrow($result))
+ {
+ $sql_ary = array(
+ 'search_key' => $search_key,
+ 'search_time' => time(),
+ 'search_keywords' => $keywords,
+ 'search_authors' => ' ' . implode(' ', $author_ary) . ' '
+ );
+
+ $sql = 'INSERT INTO ' . SEARCH_RESULTS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary);
+ $db->sql_query($sql);
+ }
+ $db->sql_freeresult($result);
+ }
+
+ $sql = 'UPDATE ' . USERS_TABLE . '
+ SET user_last_search = ' . time() . '
+ WHERE user_id = ' . $user->data['user_id'];
+ $db->sql_query($sql);
+
+ $store = array(-1 => $result_count, -2 => $sort_dir);
+ $id_range = range($start, $start + $length - 1);
+ }
+ else
+ {
+ // we use one set of results for both sort directions so we have to calculate the indizes
+ // for the reversed array and we also have to reverse the ids themselves
+ if ($store[-2] != $sort_dir)
+ {
+ $store_ids = array_reverse($store_ids);
+ $id_range = range($store[-1] - $start - $length, $store[-1] - $start - 1);
+ }
+ else
+ {
+ $id_range = range($start, $start + $length - 1);
+ }
+ }
+
+ $store_ids = array_combine($id_range, $store_ids);
+
+ // append the ids
+ if (is_array($store_ids))
+ {
+ $store += $store_ids;
+
+ // if the cache is too big
+ if (sizeof($store) - 2 > 20 * $config['search_block_size'])
+ {
+ // remove everything in front of two blocks in front of the current start index
+ for ($i = 0, $n = $id_range[0] - 2 * $config['search_block_size']; $i < $n; $i++)
+ {
+ if (isset($store[$i]))
+ {
+ unset($store[$i]);
+ }
+ }
+
+ // remove everything after two blocks after the current stop index
+ end($id_range);
+ for ($i = $store[-1] - 1, $n = current($id_range) + 2 * $config['search_block_size']; $i > $n; $i--)
+ {
+ if (isset($store[$i]))
+ {
+ unset($store[$i]);
+ }
+ }
+ }
+ $cache->put('_search_results_' . $search_key, $store, $config['search_store_results']);
+
+ $sql = 'UPDATE ' . SEARCH_RESULTS_TABLE . '
+ SET search_time = ' . time() . '
+ WHERE search_key = \'' . $db->sql_escape($search_key) . '\'';
+ $db->sql_query($sql);
+ }
+
+ unset($store);
+ unset($store_ids);
+ unset($id_range);
+ }
+
+ /**
+ * Removes old entries from the search results table and removes searches with keywords that contain a word in $words.
+ */
+ function destroy_cache($words, $authors = false)
+ {
+ global $db, $cache, $config;
+
+ // clear all searches that searched for the specified words
+ if (sizeof($words))
+ {
+ $sql_where = '';
+ foreach ($words as $word)
+ {
+ $sql_where .= " OR search_keywords " . $db->sql_like_expression($db->get_any_char() . $word . $db->get_any_char());
+ }
+
+ $sql = 'SELECT search_key
+ FROM ' . SEARCH_RESULTS_TABLE . "
+ WHERE search_keywords LIKE '%*%' $sql_where";
+ $result = $db->sql_query($sql);
+
+ while ($row = $db->sql_fetchrow($result))
+ {
+ $cache->destroy('_search_results_' . $row['search_key']);
+ }
+ $db->sql_freeresult($result);
+ }
+
+ // clear all searches that searched for the specified authors
+ if (is_array($authors) && sizeof($authors))
+ {
+ $sql_where = '';
+ foreach ($authors as $author)
+ {
+ $sql_where .= (($sql_where) ? ' OR ' : '') . 'search_authors ' . $db->sql_like_expression($db->get_any_char() . ' ' . (int) $author . ' ' . $db->get_any_char());
+ }
+
+ $sql = 'SELECT search_key
+ FROM ' . SEARCH_RESULTS_TABLE . "
+ WHERE $sql_where";
+ $result = $db->sql_query($sql);
+
+ while ($row = $db->sql_fetchrow($result))
+ {
+ $cache->destroy('_search_results_' . $row['search_key']);
+ }
+ $db->sql_freeresult($result);
+ }
+
+ $sql = 'DELETE
+ FROM ' . SEARCH_RESULTS_TABLE . '
+ WHERE search_time < ' . (time() - $config['search_store_results']);
+ $db->sql_query($sql);
+ }
+}
diff --git a/phpBB/phpbb/search/fulltext_mysql.php b/phpBB/phpbb/search/fulltext_mysql.php
new file mode 100644
index 0000000000..64a63e83e0
--- /dev/null
+++ b/phpBB/phpbb/search/fulltext_mysql.php
@@ -0,0 +1,1141 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\search;
+
+/**
+* Fulltext search for MySQL
+*/
+class fulltext_mysql extends \phpbb\search\base
+{
+ /**
+ * Associative array holding index stats
+ * @var array
+ */
+ protected $stats = array();
+
+ /**
+ * Holds the words entered by user, obtained by splitting the entered query on whitespace
+ * @var array
+ */
+ protected $split_words = array();
+
+ /**
+ * Config object
+ * @var \phpbb\config\config
+ */
+ protected $config;
+
+ /**
+ * Database connection
+ * @var \phpbb\db\driver\driver_interface
+ */
+ protected $db;
+
+ /**
+ * phpBB event dispatcher object
+ * @var \phpbb\event\dispatcher_interface
+ */
+ protected $phpbb_dispatcher;
+
+ /**
+ * User object
+ * @var \phpbb\user
+ */
+ protected $user;
+
+ /**
+ * Associative array stores the min and max word length to be searched
+ * @var array
+ */
+ protected $word_length = array();
+
+ /**
+ * Contains tidied search query.
+ * Operators are prefixed in search query and common words excluded
+ * @var string
+ */
+ protected $search_query;
+
+ /**
+ * Contains common words.
+ * Common words are words with length less/more than min/max length
+ * @var array
+ */
+ protected $common_words = array();
+
+ /**
+ * Constructor
+ * Creates a new \phpbb\search\fulltext_mysql, which is used as a search backend
+ *
+ * @param string|bool $error Any error that occurs is passed on through this reference variable otherwise false
+ * @param string $phpbb_root_path Relative path to phpBB root
+ * @param string $phpEx PHP file extension
+ * @param \phpbb\auth\auth $auth Auth object
+ * @param \phpbb\config\config $config Config object
+ * @param \phpbb\db\driver\driver_interface Database object
+ * @param \phpbb\user $user User object
+ * @param \phpbb\event\dispatcher_interface $phpbb_dispatcher Event dispatcher object
+ */
+ public function __construct(&$error, $phpbb_root_path, $phpEx, $auth, $config, $db, $user, $phpbb_dispatcher)
+ {
+ $this->config = $config;
+ $this->db = $db;
+ $this->phpbb_dispatcher = $phpbb_dispatcher;
+ $this->user = $user;
+
+ $this->word_length = array('min' => $this->config['fulltext_mysql_min_word_len'], 'max' => $this->config['fulltext_mysql_max_word_len']);
+
+ /**
+ * Load the UTF tools
+ */
+ if (!function_exists('utf8_strlen'))
+ {
+ include($phpbb_root_path . 'includes/utf/utf_tools.' . $phpEx);
+ }
+
+ $error = false;
+ }
+
+ /**
+ * Returns the name of this search backend to be displayed to administrators
+ *
+ * @return string Name
+ */
+ public function get_name()
+ {
+ return 'MySQL Fulltext';
+ }
+
+ /**
+ * Returns the search_query
+ *
+ * @return string search query
+ */
+ public function get_search_query()
+ {
+ return $this->search_query;
+ }
+
+ /**
+ * Returns the common_words array
+ *
+ * @return array common words that are ignored by search backend
+ */
+ public function get_common_words()
+ {
+ return $this->common_words;
+ }
+
+ /**
+ * Returns the word_length array
+ *
+ * @return array min and max word length for searching
+ */
+ public function get_word_length()
+ {
+ return $this->word_length;
+ }
+
+ /**
+ * Checks for correct MySQL version and stores min/max word length in the config
+ *
+ * @return string|bool Language key of the error/incompatiblity occurred
+ */
+ public function init()
+ {
+ if ($this->db->get_sql_layer() != 'mysql4' && $this->db->get_sql_layer() != 'mysqli')
+ {
+ return $this->user->lang['FULLTEXT_MYSQL_INCOMPATIBLE_DATABASE'];
+ }
+
+ $result = $this->db->sql_query('SHOW TABLE STATUS LIKE \'' . POSTS_TABLE . '\'');
+ $info = $this->db->sql_fetchrow($result);
+ $this->db->sql_freeresult($result);
+
+ $engine = '';
+ if (isset($info['Engine']))
+ {
+ $engine = $info['Engine'];
+ }
+ else if (isset($info['Type']))
+ {
+ $engine = $info['Type'];
+ }
+
+ $fulltext_supported =
+ $engine === 'MyISAM' ||
+ // FULLTEXT is supported on InnoDB since MySQL 5.6.4 according to
+ // http://dev.mysql.com/doc/refman/5.6/en/innodb-storage-engine.html
+ // We also require https://bugs.mysql.com/bug.php?id=67004 to be
+ // fixed for proper overall operation. Hence we require 5.6.8.
+ $engine === 'InnoDB' &&
+ phpbb_version_compare($this->db->sql_server_info(true), '5.6.8', '>=');
+
+ if (!$fulltext_supported)
+ {
+ return $this->user->lang['FULLTEXT_MYSQL_NOT_SUPPORTED'];
+ }
+
+ $sql = 'SHOW VARIABLES
+ LIKE \'ft\_%\'';
+ $result = $this->db->sql_query($sql);
+
+ $mysql_info = array();
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $mysql_info[$row['Variable_name']] = $row['Value'];
+ }
+ $this->db->sql_freeresult($result);
+
+ set_config('fulltext_mysql_max_word_len', $mysql_info['ft_max_word_len']);
+ set_config('fulltext_mysql_min_word_len', $mysql_info['ft_min_word_len']);
+
+ return false;
+ }
+
+ /**
+ * Splits keywords entered by a user into an array of words stored in $this->split_words
+ * Stores the tidied search query in $this->search_query
+ *
+ * @param string &$keywords Contains the keyword as entered by the user
+ * @param string $terms is either 'all' or 'any'
+ * @return bool false if no valid keywords were found and otherwise true
+ */
+ public function split_keywords(&$keywords, $terms)
+ {
+ if ($terms == 'all')
+ {
+ $match = array('#\sand\s#iu', '#\sor\s#iu', '#\snot\s#iu', '#(^|\s)\+#', '#(^|\s)-#', '#(^|\s)\|#');
+ $replace = array(' +', ' |', ' -', ' +', ' -', ' |');
+
+ $keywords = preg_replace($match, $replace, $keywords);
+ }
+
+ // Filter out as above
+ $split_keywords = preg_replace("#[\n\r\t]+#", ' ', trim(htmlspecialchars_decode($keywords)));
+
+ // Split words
+ $split_keywords = preg_replace('#([^\p{L}\p{N}\'*"()])#u', '$1$1', str_replace('\'\'', '\' \'', trim($split_keywords)));
+ $matches = array();
+ preg_match_all('#(?:[^\p{L}\p{N}*"()]|^)([+\-|]?(?:[\p{L}\p{N}*"()]+\'?)*[\p{L}\p{N}*"()])(?:[^\p{L}\p{N}*"()]|$)#u', $split_keywords, $matches);
+ $this->split_words = $matches[1];
+
+ // We limit the number of allowed keywords to minimize load on the database
+ if ($this->config['max_num_search_keywords'] && sizeof($this->split_words) > $this->config['max_num_search_keywords'])
+ {
+ trigger_error($this->user->lang('MAX_NUM_SEARCH_KEYWORDS_REFINE', (int) $this->config['max_num_search_keywords'], sizeof($this->split_words)));
+ }
+
+ // to allow phrase search, we need to concatenate quoted words
+ $tmp_split_words = array();
+ $phrase = '';
+ foreach ($this->split_words as $word)
+ {
+ if ($phrase)
+ {
+ $phrase .= ' ' . $word;
+ if (strpos($word, '"') !== false && substr_count($word, '"') % 2 == 1)
+ {
+ $tmp_split_words[] = $phrase;
+ $phrase = '';
+ }
+ }
+ else if (strpos($word, '"') !== false && substr_count($word, '"') % 2 == 1)
+ {
+ $phrase = $word;
+ }
+ else
+ {
+ $tmp_split_words[] = $word;
+ }
+ }
+ if ($phrase)
+ {
+ $tmp_split_words[] = $phrase;
+ }
+
+ $this->split_words = $tmp_split_words;
+
+ unset($tmp_split_words);
+ unset($phrase);
+
+ foreach ($this->split_words as $i => $word)
+ {
+ // Check for not allowed search queries for InnoDB.
+ // We assume similar restrictions for MyISAM, which is usually even
+ // slower but not as restrictive as InnoDB.
+ // InnoDB full-text search does not support the use of a leading
+ // plus sign with wildcard ('+*'), a plus and minus sign
+ // combination ('+-'), or leading a plus and minus sign combination.
+ // InnoDB full-text search only supports leading plus or minus signs.
+ // For example, InnoDB supports '+apple' but does not support 'apple+'.
+ // Specifying a trailing plus or minus sign causes InnoDB to report
+ // a syntax error. InnoDB full-text search does not support the use
+ // of multiple operators on a single search word, as in this example:
+ // '++apple'. Use of multiple operators on a single search word
+ // returns a syntax error to standard out.
+ // Also, ensure that the wildcard character is only used at the
+ // end of the line as it's intended by MySQL.
+ if (preg_match('#^(\+[+-]|\+\*|.+[+-]$|.+\*(?!$))#', $word))
+ {
+ unset($this->split_words[$i]);
+ continue;
+ }
+
+ $clean_word = preg_replace('#^[+\-|"]#', '', $word);
+
+ // check word length
+ $clean_len = utf8_strlen(str_replace('*', '', $clean_word));
+ if (($clean_len < $this->config['fulltext_mysql_min_word_len']) || ($clean_len > $this->config['fulltext_mysql_max_word_len']))
+ {
+ $this->common_words[] = $word;
+ unset($this->split_words[$i]);
+ }
+ }
+
+ if ($terms == 'any')
+ {
+ $this->search_query = '';
+ foreach ($this->split_words as $word)
+ {
+ if ((strpos($word, '+') === 0) || (strpos($word, '-') === 0) || (strpos($word, '|') === 0))
+ {
+ $word = substr($word, 1);
+ }
+ $this->search_query .= $word . ' ';
+ }
+ }
+ else
+ {
+ $this->search_query = '';
+ foreach ($this->split_words as $word)
+ {
+ if ((strpos($word, '+') === 0) || (strpos($word, '-') === 0))
+ {
+ $this->search_query .= $word . ' ';
+ }
+ else if (strpos($word, '|') === 0)
+ {
+ $this->search_query .= substr($word, 1) . ' ';
+ }
+ else
+ {
+ $this->search_query .= '+' . $word . ' ';
+ }
+ }
+ }
+
+ $this->search_query = utf8_htmlspecialchars($this->search_query);
+
+ if ($this->search_query)
+ {
+ $this->split_words = array_values($this->split_words);
+ sort($this->split_words);
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Turns text into an array of words
+ * @param string $text contains post text/subject
+ */
+ public function split_message($text)
+ {
+ // Split words
+ $text = preg_replace('#([^\p{L}\p{N}\'*])#u', '$1$1', str_replace('\'\'', '\' \'', trim($text)));
+ $matches = array();
+ preg_match_all('#(?:[^\p{L}\p{N}*]|^)([+\-|]?(?:[\p{L}\p{N}*]+\'?)*[\p{L}\p{N}*])(?:[^\p{L}\p{N}*]|$)#u', $text, $matches);
+ $text = $matches[1];
+
+ // remove too short or too long words
+ $text = array_values($text);
+ for ($i = 0, $n = sizeof($text); $i < $n; $i++)
+ {
+ $text[$i] = trim($text[$i]);
+ if (utf8_strlen($text[$i]) < $this->config['fulltext_mysql_min_word_len'] || utf8_strlen($text[$i]) > $this->config['fulltext_mysql_max_word_len'])
+ {
+ unset($text[$i]);
+ }
+ }
+
+ return array_values($text);
+ }
+
+ /**
+ * Performs a search on keywords depending on display specific params. You have to run split_keywords() first
+ *
+ * @param string $type contains either posts or topics depending on what should be searched for
+ * @param string $fields contains either titleonly (topic titles should be searched), msgonly (only message bodies should be searched), firstpost (only subject and body of the first post should be searched) or all (all post bodies and subjects should be searched)
+ * @param string $terms is either 'all' (use query as entered, words without prefix should default to "have to be in field") or 'any' (ignore search query parts and just return all posts that contain any of the specified words)
+ * @param array $sort_by_sql contains SQL code for the ORDER BY part of a query
+ * @param string $sort_key is the key of $sort_by_sql for the selected sorting
+ * @param string $sort_dir is either a or d representing ASC and DESC
+ * @param string $sort_days specifies the maximum amount of days a post may be old
+ * @param array $ex_fid_ary specifies an array of forum ids which should not be searched
+ * @param string $post_visibility specifies which types of posts the user can view in which forums
+ * @param int $topic_id is set to 0 or a topic id, if it is not 0 then only posts in this topic should be searched
+ * @param array $author_ary an array of author ids if the author should be ignored during the search the array is empty
+ * @param string $author_name specifies the author match, when ANONYMOUS is also a search-match
+ * @param array &$id_ary passed by reference, to be filled with ids for the page specified by $start and $per_page, should be ordered
+ * @param int $start indicates the first index of the page
+ * @param int $per_page number of ids each page is supposed to contain
+ * @return boolean|int total number of results
+ */
+ public function keyword_search($type, $fields, $terms, $sort_by_sql, $sort_key, $sort_dir, $sort_days, $ex_fid_ary, $post_visibility, $topic_id, $author_ary, $author_name, &$id_ary, &$start, $per_page)
+ {
+ // No keywords? No posts
+ if (!$this->search_query)
+ {
+ return false;
+ }
+
+ // generate a search_key from all the options to identify the results
+ $search_key_array = array(
+ implode(', ', $this->split_words),
+ $type,
+ $fields,
+ $terms,
+ $sort_days,
+ $sort_key,
+ $topic_id,
+ implode(',', $ex_fid_ary),
+ $post_visibility,
+ implode(',', $author_ary)
+ );
+
+ /**
+ * Allow changing the search_key for cached results
+ *
+ * @event core.search_mysql_by_keyword_modify_search_key
+ * @var array search_key_array Array with search parameters to generate the search_key
+ * @var string type Searching type ('posts', 'topics')
+ * @var string fields Searching fields ('titleonly', 'msgonly', 'firstpost', 'all')
+ * @var string terms Searching terms ('all', 'any')
+ * @var int sort_days Time, in days, of the oldest possible post to list
+ * @var string sort_key The sort type used from the possible sort types
+ * @var int topic_id Limit the search to this topic_id only
+ * @var array ex_fid_ary Which forums not to search on
+ * @var string post_visibility Post visibility data
+ * @var array author_ary Array of user_id containing the users to filter the results to
+ * @since 3.1.7-RC1
+ */
+ $vars = array(
+ 'search_key_array',
+ 'type',
+ 'fields',
+ 'terms',
+ 'sort_days',
+ 'sort_key',
+ 'topic_id',
+ 'ex_fid_ary',
+ 'post_visibility',
+ 'author_ary',
+ );
+ extract($this->phpbb_dispatcher->trigger_event('core.search_mysql_by_keyword_modify_search_key', compact($vars)));
+
+ $search_key = md5(implode('#', $search_key_array));
+
+ if ($start < 0)
+ {
+ $start = 0;
+ }
+
+ // try reading the results from cache
+ $result_count = 0;
+ if ($this->obtain_ids($search_key, $result_count, $id_ary, $start, $per_page, $sort_dir) == SEARCH_RESULT_IN_CACHE)
+ {
+ return $result_count;
+ }
+
+ $id_ary = array();
+
+ $join_topic = ($type == 'posts') ? false : true;
+
+ // Build sql strings for sorting
+ $sql_sort = $sort_by_sql[$sort_key] . (($sort_dir == 'a') ? ' ASC' : ' DESC');
+ $sql_sort_table = $sql_sort_join = '';
+
+ switch ($sql_sort[0])
+ {
+ case 'u':
+ $sql_sort_table = USERS_TABLE . ' u, ';
+ $sql_sort_join = ($type == 'posts') ? ' AND u.user_id = p.poster_id ' : ' AND u.user_id = t.topic_poster ';
+ break;
+
+ case 't':
+ $join_topic = true;
+ break;
+
+ case 'f':
+ $sql_sort_table = FORUMS_TABLE . ' f, ';
+ $sql_sort_join = ' AND f.forum_id = p.forum_id ';
+ break;
+ }
+
+ // Build some display specific sql strings
+ switch ($fields)
+ {
+ case 'titleonly':
+ $sql_match = 'p.post_subject';
+ $sql_match_where = ' AND p.post_id = t.topic_first_post_id';
+ $join_topic = true;
+ break;
+
+ case 'msgonly':
+ $sql_match = 'p.post_text';
+ $sql_match_where = '';
+ break;
+
+ case 'firstpost':
+ $sql_match = 'p.post_subject, p.post_text';
+ $sql_match_where = ' AND p.post_id = t.topic_first_post_id';
+ $join_topic = true;
+ break;
+
+ default:
+ $sql_match = 'p.post_subject, p.post_text';
+ $sql_match_where = '';
+ break;
+ }
+
+ $search_query = $this->search_query;
+
+ /**
+ * Allow changing the query used to search for posts using fulltext_mysql
+ *
+ * @event core.search_mysql_keywords_main_query_before
+ * @var string search_query The parsed keywords used for this search
+ * @var int result_count The previous result count for the format of the query.
+ * Set to 0 to force a re-count
+ * @var bool join_topic Weather or not TOPICS_TABLE should be CROSS JOIN'ED
+ * @var array author_ary Array of user_id containing the users to filter the results to
+ * @var string author_name An extra username to search on (!empty(author_ary) must be true, to be relevant)
+ * @var array ex_fid_ary Which forums not to search on
+ * @var int topic_id Limit the search to this topic_id only
+ * @var string sql_sort_table Extra tables to include in the SQL query.
+ * Used in conjunction with sql_sort_join
+ * @var string sql_sort_join SQL conditions to join all the tables used together.
+ * Used in conjunction with sql_sort_table
+ * @var int sort_days Time, in days, of the oldest possible post to list
+ * @var string sql_match Which columns to do the search on.
+ * @var string sql_match_where Extra conditions to use to properly filter the matching process
+ * @var string sort_by_sql The possible predefined sort types
+ * @var string sort_key The sort type used from the possible sort types
+ * @var string sort_dir "a" for ASC or "d" dor DESC for the sort order used
+ * @var string sql_sort The result SQL when processing sort_by_sql + sort_key + sort_dir
+ * @var int start How many posts to skip in the search results (used for pagination)
+ * @since 3.1.5-RC1
+ */
+ $vars = array(
+ 'search_query',
+ 'result_count',
+ 'join_topic',
+ 'author_ary',
+ 'author_name',
+ 'ex_fid_ary',
+ 'topic_id',
+ 'sql_sort_table',
+ 'sql_sort_join',
+ 'sort_days',
+ 'sql_match',
+ 'sql_match_where',
+ 'sort_by_sql',
+ 'sort_key',
+ 'sort_dir',
+ 'sql_sort',
+ 'start',
+ );
+ extract($this->phpbb_dispatcher->trigger_event('core.search_mysql_keywords_main_query_before', compact($vars)));
+
+ $sql_select = (!$result_count) ? 'SQL_CALC_FOUND_ROWS ' : '';
+ $sql_select = ($type == 'posts') ? $sql_select . 'p.post_id' : 'DISTINCT ' . $sql_select . 't.topic_id';
+ $sql_from = ($join_topic) ? TOPICS_TABLE . ' t, ' : '';
+ $field = ($type == 'posts') ? 'post_id' : 'topic_id';
+ if (sizeof($author_ary) && $author_name)
+ {
+ // first one matches post of registered users, second one guests and deleted users
+ $sql_author = ' AND (' . $this->db->sql_in_set('p.poster_id', array_diff($author_ary, array(ANONYMOUS)), false, true) . ' OR p.post_username ' . $author_name . ')';
+ }
+ else if (sizeof($author_ary))
+ {
+ $sql_author = ' AND ' . $this->db->sql_in_set('p.poster_id', $author_ary);
+ }
+ else
+ {
+ $sql_author = '';
+ }
+
+ $sql_where_options = $sql_sort_join;
+ $sql_where_options .= ($topic_id) ? ' AND p.topic_id = ' . $topic_id : '';
+ $sql_where_options .= ($join_topic) ? ' AND t.topic_id = p.topic_id' : '';
+ $sql_where_options .= (sizeof($ex_fid_ary)) ? ' AND ' . $this->db->sql_in_set('p.forum_id', $ex_fid_ary, true) : '';
+ $sql_where_options .= ' AND ' . $post_visibility;
+ $sql_where_options .= $sql_author;
+ $sql_where_options .= ($sort_days) ? ' AND p.post_time >= ' . (time() - ($sort_days * 86400)) : '';
+ $sql_where_options .= $sql_match_where;
+
+ $sql = "SELECT $sql_select
+ FROM $sql_from$sql_sort_table" . POSTS_TABLE . " p
+ WHERE MATCH ($sql_match) AGAINST ('" . $this->db->sql_escape(htmlspecialchars_decode($this->search_query)) . "' IN BOOLEAN MODE)
+ $sql_where_options
+ ORDER BY $sql_sort";
+ $result = $this->db->sql_query_limit($sql, $this->config['search_block_size'], $start);
+
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $id_ary[] = (int) $row[$field];
+ }
+ $this->db->sql_freeresult($result);
+
+ $id_ary = array_unique($id_ary);
+
+ // if the total result count is not cached yet, retrieve it from the db
+ if (!$result_count)
+ {
+ $sql_found_rows = 'SELECT FOUND_ROWS() as result_count';
+ $result = $this->db->sql_query($sql_found_rows);
+ $result_count = (int) $this->db->sql_fetchfield('result_count');
+ $this->db->sql_freeresult($result);
+
+ if (!$result_count)
+ {
+ return false;
+ }
+ }
+
+ if ($start >= $result_count)
+ {
+ $start = floor(($result_count - 1) / $per_page) * $per_page;
+
+ $result = $this->db->sql_query_limit($sql, $this->config['search_block_size'], $start);
+
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $id_ary[] = (int) $row[$field];
+ }
+ $this->db->sql_freeresult($result);
+
+ $id_ary = array_unique($id_ary);
+ }
+
+ // store the ids, from start on then delete anything that isn't on the current page because we only need ids for one page
+ $this->save_ids($search_key, implode(' ', $this->split_words), $author_ary, $result_count, $id_ary, $start, $sort_dir);
+ $id_ary = array_slice($id_ary, 0, (int) $per_page);
+
+ return $result_count;
+ }
+
+ /**
+ * Performs a search on an author's posts without caring about message contents. Depends on display specific params
+ *
+ * @param string $type contains either posts or topics depending on what should be searched for
+ * @param boolean $firstpost_only if true, only topic starting posts will be considered
+ * @param array $sort_by_sql contains SQL code for the ORDER BY part of a query
+ * @param string $sort_key is the key of $sort_by_sql for the selected sorting
+ * @param string $sort_dir is either a or d representing ASC and DESC
+ * @param string $sort_days specifies the maximum amount of days a post may be old
+ * @param array $ex_fid_ary specifies an array of forum ids which should not be searched
+ * @param string $post_visibility specifies which types of posts the user can view in which forums
+ * @param int $topic_id is set to 0 or a topic id, if it is not 0 then only posts in this topic should be searched
+ * @param array $author_ary an array of author ids
+ * @param string $author_name specifies the author match, when ANONYMOUS is also a search-match
+ * @param array &$id_ary passed by reference, to be filled with ids for the page specified by $start and $per_page, should be ordered
+ * @param int $start indicates the first index of the page
+ * @param int $per_page number of ids each page is supposed to contain
+ * @return boolean|int total number of results
+ */
+ public function author_search($type, $firstpost_only, $sort_by_sql, $sort_key, $sort_dir, $sort_days, $ex_fid_ary, $post_visibility, $topic_id, $author_ary, $author_name, &$id_ary, &$start, $per_page)
+ {
+ // No author? No posts
+ if (!sizeof($author_ary))
+ {
+ return 0;
+ }
+
+ // generate a search_key from all the options to identify the results
+ $search_key_array = array(
+ '',
+ $type,
+ ($firstpost_only) ? 'firstpost' : '',
+ '',
+ '',
+ $sort_days,
+ $sort_key,
+ $topic_id,
+ implode(',', $ex_fid_ary),
+ $post_visibility,
+ implode(',', $author_ary),
+ $author_name,
+ );
+
+ /**
+ * Allow changing the search_key for cached results
+ *
+ * @event core.search_mysql_by_author_modify_search_key
+ * @var array search_key_array Array with search parameters to generate the search_key
+ * @var string type Searching type ('posts', 'topics')
+ * @var boolean firstpost_only Flag indicating if only topic starting posts are considered
+ * @var int sort_days Time, in days, of the oldest possible post to list
+ * @var string sort_key The sort type used from the possible sort types
+ * @var int topic_id Limit the search to this topic_id only
+ * @var array ex_fid_ary Which forums not to search on
+ * @var string post_visibility Post visibility data
+ * @var array author_ary Array of user_id containing the users to filter the results to
+ * @var string author_name The username to search on
+ * @since 3.1.7-RC1
+ */
+ $vars = array(
+ 'search_key_array',
+ 'type',
+ 'firstpost_only',
+ 'sort_days',
+ 'sort_key',
+ 'topic_id',
+ 'ex_fid_ary',
+ 'post_visibility',
+ 'author_ary',
+ 'author_name',
+ );
+ extract($this->phpbb_dispatcher->trigger_event('core.search_mysql_by_author_modify_search_key', compact($vars)));
+
+ $search_key = md5(implode('#', $search_key_array));
+
+ if ($start < 0)
+ {
+ $start = 0;
+ }
+
+ // try reading the results from cache
+ $result_count = 0;
+ if ($this->obtain_ids($search_key, $result_count, $id_ary, $start, $per_page, $sort_dir) == SEARCH_RESULT_IN_CACHE)
+ {
+ return $result_count;
+ }
+
+ $id_ary = array();
+
+ // Create some display specific sql strings
+ if ($author_name)
+ {
+ // first one matches post of registered users, second one guests and deleted users
+ $sql_author = '(' . $this->db->sql_in_set('p.poster_id', array_diff($author_ary, array(ANONYMOUS)), false, true) . ' OR p.post_username ' . $author_name . ')';
+ }
+ else
+ {
+ $sql_author = $this->db->sql_in_set('p.poster_id', $author_ary);
+ }
+ $sql_fora = (sizeof($ex_fid_ary)) ? ' AND ' . $this->db->sql_in_set('p.forum_id', $ex_fid_ary, true) : '';
+ $sql_topic_id = ($topic_id) ? ' AND p.topic_id = ' . (int) $topic_id : '';
+ $sql_time = ($sort_days) ? ' AND p.post_time >= ' . (time() - ($sort_days * 86400)) : '';
+ $sql_firstpost = ($firstpost_only) ? ' AND p.post_id = t.topic_first_post_id' : '';
+
+ // Build sql strings for sorting
+ $sql_sort = $sort_by_sql[$sort_key] . (($sort_dir == 'a') ? ' ASC' : ' DESC');
+ $sql_sort_table = $sql_sort_join = '';
+ switch ($sql_sort[0])
+ {
+ case 'u':
+ $sql_sort_table = USERS_TABLE . ' u, ';
+ $sql_sort_join = ($type == 'posts') ? ' AND u.user_id = p.poster_id ' : ' AND u.user_id = t.topic_poster ';
+ break;
+
+ case 't':
+ $sql_sort_table = ($type == 'posts' && !$firstpost_only) ? TOPICS_TABLE . ' t, ' : '';
+ $sql_sort_join = ($type == 'posts' && !$firstpost_only) ? ' AND t.topic_id = p.topic_id ' : '';
+ break;
+
+ case 'f':
+ $sql_sort_table = FORUMS_TABLE . ' f, ';
+ $sql_sort_join = ' AND f.forum_id = p.forum_id ';
+ break;
+ }
+
+ $m_approve_fid_sql = ' AND ' . $post_visibility;
+
+ /**
+ * Allow changing the query used to search for posts by author in fulltext_mysql
+ *
+ * @event core.search_mysql_author_query_before
+ * @var int result_count The previous result count for the format of the query.
+ * Set to 0 to force a re-count
+ * @var string sql_sort_table CROSS JOIN'ed table to allow doing the sort chosen
+ * @var string sql_sort_join Condition to define how to join the CROSS JOIN'ed table specifyed in sql_sort_table
+ * @var string type Either "posts" or "topics" specifying the type of search being made
+ * @var array author_ary Array of user_id containing the users to filter the results to
+ * @var string author_name An extra username to search on
+ * @var string sql_author SQL WHERE condition for the post author ids
+ * @var int topic_id Limit the search to this topic_id only
+ * @var string sql_topic_id SQL of topic_id
+ * @var string sort_by_sql The possible predefined sort types
+ * @var string sort_key The sort type used from the possible sort types
+ * @var string sort_dir "a" for ASC or "d" dor DESC for the sort order used
+ * @var string sql_sort The result SQL when processing sort_by_sql + sort_key + sort_dir
+ * @var string sort_days Time, in days, that the oldest post showing can have
+ * @var string sql_time The SQL to search on the time specifyed by sort_days
+ * @var bool firstpost_only Wether or not to search only on the first post of the topics
+ * @var string sql_firstpost The SQL with the conditions to join the tables when using firstpost_only
+ * @var array ex_fid_ary Forum ids that must not be searched on
+ * @var array sql_fora SQL query for ex_fid_ary
+ * @var string m_approve_fid_sql WHERE clause condition on post_visibility restrictions
+ * @var int start How many posts to skip in the search results (used for pagination)
+ * @since 3.1.5-RC1
+ */
+ $vars = array(
+ 'result_count',
+ 'sql_sort_table',
+ 'sql_sort_join',
+ 'type',
+ 'author_ary',
+ 'author_name',
+ 'sql_author',
+ 'topic_id',
+ 'sql_topic_id',
+ 'sort_by_sql',
+ 'sort_key',
+ 'sort_dir',
+ 'sql_sort',
+ 'sort_days',
+ 'sql_time',
+ 'firstpost_only',
+ 'sql_firstpost',
+ 'ex_fid_ary',
+ 'sql_fora',
+ 'm_approve_fid_sql',
+ 'start',
+ );
+ extract($this->phpbb_dispatcher->trigger_event('core.search_mysql_author_query_before', compact($vars)));
+
+ // If the cache was completely empty count the results
+ $calc_results = ($result_count) ? '' : 'SQL_CALC_FOUND_ROWS ';
+
+ // Build the query for really selecting the post_ids
+ if ($type == 'posts')
+ {
+ $sql = "SELECT {$calc_results}p.post_id
+ FROM " . $sql_sort_table . POSTS_TABLE . ' p' . (($firstpost_only) ? ', ' . TOPICS_TABLE . ' t ' : ' ') . "
+ WHERE $sql_author
+ $sql_topic_id
+ $sql_firstpost
+ $m_approve_fid_sql
+ $sql_fora
+ $sql_sort_join
+ $sql_time
+ ORDER BY $sql_sort";
+ $field = 'post_id';
+ }
+ else
+ {
+ $sql = "SELECT {$calc_results}t.topic_id
+ FROM " . $sql_sort_table . TOPICS_TABLE . ' t, ' . POSTS_TABLE . " p
+ WHERE $sql_author
+ $sql_topic_id
+ $sql_firstpost
+ $m_approve_fid_sql
+ $sql_fora
+ AND t.topic_id = p.topic_id
+ $sql_sort_join
+ $sql_time
+ GROUP BY t.topic_id
+ ORDER BY $sql_sort";
+ $field = 'topic_id';
+ }
+
+ // Only read one block of posts from the db and then cache it
+ $result = $this->db->sql_query_limit($sql, $this->config['search_block_size'], $start);
+
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $id_ary[] = (int) $row[$field];
+ }
+ $this->db->sql_freeresult($result);
+
+ // retrieve the total result count if needed
+ if (!$result_count)
+ {
+ $sql_found_rows = 'SELECT FOUND_ROWS() as result_count';
+ $result = $this->db->sql_query($sql_found_rows);
+ $result_count = (int) $this->db->sql_fetchfield('result_count');
+ $this->db->sql_freeresult($result);
+
+ if (!$result_count)
+ {
+ return false;
+ }
+ }
+
+ if ($start >= $result_count)
+ {
+ $start = floor(($result_count - 1) / $per_page) * $per_page;
+
+ $result = $this->db->sql_query_limit($sql, $this->config['search_block_size'], $start);
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $id_ary[] = (int) $row[$field];
+ }
+ $this->db->sql_freeresult($result);
+
+ $id_ary = array_unique($id_ary);
+ }
+
+ if (sizeof($id_ary))
+ {
+ $this->save_ids($search_key, '', $author_ary, $result_count, $id_ary, $start, $sort_dir);
+ $id_ary = array_slice($id_ary, 0, $per_page);
+
+ return $result_count;
+ }
+ return false;
+ }
+
+ /**
+ * Destroys cached search results, that contained one of the new words in a post so the results won't be outdated
+ *
+ * @param string $mode contains the post mode: edit, post, reply, quote ...
+ * @param int $post_id contains the post id of the post to index
+ * @param string $message contains the post text of the post
+ * @param string $subject contains the subject of the post to index
+ * @param int $poster_id contains the user id of the poster
+ * @param int $forum_id contains the forum id of parent forum of the post
+ */
+ public function index($mode, $post_id, &$message, &$subject, $poster_id, $forum_id)
+ {
+ // Split old and new post/subject to obtain array of words
+ $split_text = $this->split_message($message);
+ $split_title = ($subject) ? $this->split_message($subject) : array();
+
+ $words = array_unique(array_merge($split_text, $split_title));
+
+ unset($split_text);
+ unset($split_title);
+
+ // destroy cached search results containing any of the words removed or added
+ $this->destroy_cache($words, array($poster_id));
+
+ unset($words);
+ }
+
+ /**
+ * Destroy cached results, that might be outdated after deleting a post
+ */
+ public function index_remove($post_ids, $author_ids, $forum_ids)
+ {
+ $this->destroy_cache(array(), array_unique($author_ids));
+ }
+
+ /**
+ * Destroy old cache entries
+ */
+ public function tidy()
+ {
+ // destroy too old cached search results
+ $this->destroy_cache(array());
+
+ set_config('search_last_gc', time(), true);
+ }
+
+ /**
+ * Create fulltext index
+ *
+ * @return string|bool error string is returned incase of errors otherwise false
+ */
+ public function create_index($acp_module, $u_action)
+ {
+ // Make sure we can actually use MySQL with fulltext indexes
+ if ($error = $this->init())
+ {
+ return $error;
+ }
+
+ if (empty($this->stats))
+ {
+ $this->get_stats();
+ }
+
+ $alter_list = array();
+
+ if (!isset($this->stats['post_subject']))
+ {
+ $alter_entry = array();
+ if ($this->db->get_sql_layer() == 'mysqli' || version_compare($this->db->sql_server_info(true), '4.1.3', '>='))
+ {
+ $alter_entry[] = 'MODIFY post_subject varchar(255) COLLATE utf8_unicode_ci DEFAULT \'\' NOT NULL';
+ }
+ else
+ {
+ $alter_entry[] = 'MODIFY post_subject text NOT NULL';
+ }
+ $alter_entry[] = 'ADD FULLTEXT (post_subject)';
+ $alter_list[] = $alter_entry;
+ }
+
+ if (!isset($this->stats['post_content']))
+ {
+ $alter_entry = array();
+ if ($this->db->get_sql_layer() == 'mysqli' || version_compare($this->db->sql_server_info(true), '4.1.3', '>='))
+ {
+ $alter_entry[] = 'MODIFY post_text mediumtext COLLATE utf8_unicode_ci NOT NULL';
+ }
+ else
+ {
+ $alter_entry[] = 'MODIFY post_text mediumtext NOT NULL';
+ }
+
+ $alter_entry[] = 'ADD FULLTEXT post_content (post_text, post_subject)';
+ $alter_list[] = $alter_entry;
+ }
+
+ if (sizeof($alter_list))
+ {
+ foreach ($alter_list as $alter)
+ {
+ $this->db->sql_query('ALTER TABLE ' . POSTS_TABLE . ' ' . implode(', ', $alter));
+ }
+ }
+
+ $this->db->sql_query('TRUNCATE TABLE ' . SEARCH_RESULTS_TABLE);
+
+ return false;
+ }
+
+ /**
+ * Drop fulltext index
+ *
+ * @return string|bool error string is returned incase of errors otherwise false
+ */
+ public function delete_index($acp_module, $u_action)
+ {
+ // Make sure we can actually use MySQL with fulltext indexes
+ if ($error = $this->init())
+ {
+ return $error;
+ }
+
+ if (empty($this->stats))
+ {
+ $this->get_stats();
+ }
+
+ $alter = array();
+
+ if (isset($this->stats['post_subject']))
+ {
+ $alter[] = 'DROP INDEX post_subject';
+ }
+
+ if (isset($this->stats['post_content']))
+ {
+ $alter[] = 'DROP INDEX post_content';
+ }
+
+ if (sizeof($alter))
+ {
+ $this->db->sql_query('ALTER TABLE ' . POSTS_TABLE . ' ' . implode(', ', $alter));
+ }
+
+ $this->db->sql_query('TRUNCATE TABLE ' . SEARCH_RESULTS_TABLE);
+
+ return false;
+ }
+
+ /**
+ * Returns true if both FULLTEXT indexes exist
+ */
+ public function index_created()
+ {
+ if (empty($this->stats))
+ {
+ $this->get_stats();
+ }
+
+ return isset($this->stats['post_subject']) && isset($this->stats['post_content']);
+ }
+
+ /**
+ * Returns an associative array containing information about the indexes
+ */
+ public function index_stats()
+ {
+ if (empty($this->stats))
+ {
+ $this->get_stats();
+ }
+
+ return array(
+ $this->user->lang['FULLTEXT_MYSQL_TOTAL_POSTS'] => ($this->index_created()) ? $this->stats['total_posts'] : 0,
+ );
+ }
+
+ /**
+ * Computes the stats and store them in the $this->stats associative array
+ */
+ protected function get_stats()
+ {
+ if (strpos($this->db->get_sql_layer(), 'mysql') === false)
+ {
+ $this->stats = array();
+ return;
+ }
+
+ $sql = 'SHOW INDEX
+ FROM ' . POSTS_TABLE;
+ $result = $this->db->sql_query($sql);
+
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ // deal with older MySQL versions which didn't use Index_type
+ $index_type = (isset($row['Index_type'])) ? $row['Index_type'] : $row['Comment'];
+
+ if ($index_type == 'FULLTEXT')
+ {
+ if ($row['Key_name'] == 'post_subject')
+ {
+ $this->stats['post_subject'] = $row;
+ }
+ else if ($row['Key_name'] == 'post_content')
+ {
+ $this->stats['post_content'] = $row;
+ }
+ }
+ }
+ $this->db->sql_freeresult($result);
+
+ $this->stats['total_posts'] = empty($this->stats) ? 0 : $this->db->get_estimated_row_count(POSTS_TABLE);
+ }
+
+ /**
+ * Display a note, that UTF-8 support is not available with certain versions of PHP
+ *
+ * @return associative array containing template and config variables
+ */
+ public function acp()
+ {
+ $tpl = '
+ <dl>
+ <dt><label>' . $this->user->lang['MIN_SEARCH_CHARS'] . $this->user->lang['COLON'] . '</label><br /><span>' . $this->user->lang['FULLTEXT_MYSQL_MIN_SEARCH_CHARS_EXPLAIN'] . '</span></dt>
+ <dd>' . $this->config['fulltext_mysql_min_word_len'] . '</dd>
+ </dl>
+ <dl>
+ <dt><label>' . $this->user->lang['MAX_SEARCH_CHARS'] . $this->user->lang['COLON'] . '</label><br /><span>' . $this->user->lang['FULLTEXT_MYSQL_MAX_SEARCH_CHARS_EXPLAIN'] . '</span></dt>
+ <dd>' . $this->config['fulltext_mysql_max_word_len'] . '</dd>
+ </dl>
+ ';
+
+ // These are fields required in the config table
+ return array(
+ 'tpl' => $tpl,
+ 'config' => array()
+ );
+ }
+}
diff --git a/phpBB/phpbb/search/fulltext_native.php b/phpBB/phpbb/search/fulltext_native.php
new file mode 100644
index 0000000000..63b0b24edf
--- /dev/null
+++ b/phpBB/phpbb/search/fulltext_native.php
@@ -0,0 +1,1996 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\search;
+
+/**
+* phpBB's own db driven fulltext search, version 2
+*/
+class fulltext_native extends \phpbb\search\base
+{
+ /**
+ * Associative array holding index stats
+ * @var array
+ */
+ protected $stats = array();
+
+ /**
+ * Associative array stores the min and max word length to be searched
+ * @var array
+ */
+ protected $word_length = array();
+
+ /**
+ * Contains tidied search query.
+ * Operators are prefixed in search query and common words excluded
+ * @var string
+ */
+ protected $search_query;
+
+ /**
+ * Contains common words.
+ * Common words are words with length less/more than min/max length
+ * @var array
+ */
+ protected $common_words = array();
+
+ /**
+ * Post ids of posts containing words that are to be included
+ * @var array
+ */
+ protected $must_contain_ids = array();
+
+ /**
+ * Post ids of posts containing words that should not be included
+ * @var array
+ */
+ protected $must_not_contain_ids = array();
+
+ /**
+ * Post ids of posts containing at least one word that needs to be excluded
+ * @var array
+ */
+ protected $must_exclude_one_ids = array();
+
+ /**
+ * Relative path to board root
+ * @var string
+ */
+ protected $phpbb_root_path;
+
+ /**
+ * PHP Extension
+ * @var string
+ */
+ protected $php_ext;
+
+ /**
+ * Config object
+ * @var \phpbb\config\config
+ */
+ protected $config;
+
+ /**
+ * Database connection
+ * @var \phpbb\db\driver\driver_interface
+ */
+ protected $db;
+
+ /**
+ * phpBB event dispatcher object
+ * @var \phpbb\event\dispatcher_interface
+ */
+ protected $phpbb_dispatcher;
+
+ /**
+ * User object
+ * @var \phpbb\user
+ */
+ protected $user;
+
+ /**
+ * Initialises the fulltext_native search backend with min/max word length and makes sure the UTF-8 normalizer is loaded
+ *
+ * @param boolean|string &$error is passed by reference and should either be set to false on success or an error message on failure
+ * @param \phpbb\event\dispatcher_interface $phpbb_dispatcher Event dispatcher object
+ */
+ public function __construct(&$error, $phpbb_root_path, $phpEx, $auth, $config, $db, $user, $phpbb_dispatcher)
+ {
+ $this->phpbb_root_path = $phpbb_root_path;
+ $this->php_ext = $phpEx;
+ $this->config = $config;
+ $this->db = $db;
+ $this->phpbb_dispatcher = $phpbb_dispatcher;
+ $this->user = $user;
+
+ $this->word_length = array('min' => $this->config['fulltext_native_min_chars'], 'max' => $this->config['fulltext_native_max_chars']);
+
+ /**
+ * Load the UTF tools
+ */
+ if (!class_exists('utf_normalizer'))
+ {
+ include($this->phpbb_root_path . 'includes/utf/utf_normalizer.' . $this->php_ext);
+ }
+ if (!function_exists('utf8_decode_ncr'))
+ {
+ include($this->phpbb_root_path . 'includes/utf/utf_tools.' . $this->php_ext);
+ }
+
+ $error = false;
+ }
+
+ /**
+ * Returns the name of this search backend to be displayed to administrators
+ *
+ * @return string Name
+ */
+ public function get_name()
+ {
+ return 'phpBB Native Fulltext';
+ }
+
+ /**
+ * Returns the search_query
+ *
+ * @return string search query
+ */
+ public function get_search_query()
+ {
+ return $this->search_query;
+ }
+
+ /**
+ * Returns the common_words array
+ *
+ * @return array common words that are ignored by search backend
+ */
+ public function get_common_words()
+ {
+ return $this->common_words;
+ }
+
+ /**
+ * Returns the word_length array
+ *
+ * @return array min and max word length for searching
+ */
+ public function get_word_length()
+ {
+ return $this->word_length;
+ }
+
+ /**
+ * This function fills $this->search_query with the cleaned user search query
+ *
+ * If $terms is 'any' then the words will be extracted from the search query
+ * and combined with | inside brackets. They will afterwards be treated like
+ * an standard search query.
+ *
+ * Then it analyses the query and fills the internal arrays $must_not_contain_ids,
+ * $must_contain_ids and $must_exclude_one_ids which are later used by keyword_search()
+ *
+ * @param string $keywords contains the search query string as entered by the user
+ * @param string $terms is either 'all' (use search query as entered, default words to 'must be contained in post')
+ * or 'any' (find all posts containing at least one of the given words)
+ * @return boolean false if no valid keywords were found and otherwise true
+ */
+ public function split_keywords($keywords, $terms)
+ {
+ $tokens = '+-|()*';
+
+ $keywords = trim($this->cleanup($keywords, $tokens));
+
+ // allow word|word|word without brackets
+ if ((strpos($keywords, ' ') === false) && (strpos($keywords, '|') !== false) && (strpos($keywords, '(') === false))
+ {
+ $keywords = '(' . $keywords . ')';
+ }
+
+ $open_bracket = $space = false;
+ for ($i = 0, $n = strlen($keywords); $i < $n; $i++)
+ {
+ if ($open_bracket !== false)
+ {
+ switch ($keywords[$i])
+ {
+ case ')':
+ if ($open_bracket + 1 == $i)
+ {
+ $keywords[$i - 1] = '|';
+ $keywords[$i] = '|';
+ }
+ $open_bracket = false;
+ break;
+ case '(':
+ $keywords[$i] = '|';
+ break;
+ case '+':
+ case '-':
+ case ' ':
+ $keywords[$i] = '|';
+ break;
+ case '*':
+ if ($i === 0 || ($keywords[$i - 1] !== '*' && strcspn($keywords[$i - 1], $tokens) === 0))
+ {
+ if ($i === $n - 1 || ($keywords[$i + 1] !== '*' && strcspn($keywords[$i + 1], $tokens) === 0))
+ {
+ $keywords = substr($keywords, 0, $i) . substr($keywords, $i + 1);
+ }
+ }
+ break;
+ }
+ }
+ else
+ {
+ switch ($keywords[$i])
+ {
+ case ')':
+ $keywords[$i] = ' ';
+ break;
+ case '(':
+ $open_bracket = $i;
+ $space = false;
+ break;
+ case '|':
+ $keywords[$i] = ' ';
+ break;
+ case '-':
+ case '+':
+ $space = $keywords[$i];
+ break;
+ case ' ':
+ if ($space !== false)
+ {
+ $keywords[$i] = $space;
+ }
+ break;
+ default:
+ $space = false;
+ }
+ }
+ }
+
+ if ($open_bracket)
+ {
+ $keywords .= ')';
+ }
+
+ $match = array(
+ '# +#',
+ '#\|\|+#',
+ '#(\+|\-)(?:\+|\-)+#',
+ '#\(\|#',
+ '#\|\)#',
+ );
+ $replace = array(
+ ' ',
+ '|',
+ '$1',
+ '(',
+ ')',
+ );
+
+ $keywords = preg_replace($match, $replace, $keywords);
+ $num_keywords = sizeof(explode(' ', $keywords));
+
+ // We limit the number of allowed keywords to minimize load on the database
+ if ($this->config['max_num_search_keywords'] && $num_keywords > $this->config['max_num_search_keywords'])
+ {
+ trigger_error($this->user->lang('MAX_NUM_SEARCH_KEYWORDS_REFINE', (int) $this->config['max_num_search_keywords'], $num_keywords));
+ }
+
+ // $keywords input format: each word separated by a space, words in a bracket are not separated
+
+ // the user wants to search for any word, convert the search query
+ if ($terms == 'any')
+ {
+ $words = array();
+
+ preg_match_all('#([^\\s+\\-|()]+)(?:$|[\\s+\\-|()])#u', $keywords, $words);
+ if (sizeof($words[1]))
+ {
+ $keywords = '(' . implode('|', $words[1]) . ')';
+ }
+ }
+
+ // set the search_query which is shown to the user
+ $this->search_query = $keywords;
+
+ $exact_words = array();
+ preg_match_all('#([^\\s+\\-|()]+)(?:$|[\\s+\\-|()])#u', $keywords, $exact_words);
+ $exact_words = $exact_words[1];
+
+ $common_ids = $words = array();
+
+ if (sizeof($exact_words))
+ {
+ $sql = 'SELECT word_id, word_text, word_common
+ FROM ' . SEARCH_WORDLIST_TABLE . '
+ WHERE ' . $this->db->sql_in_set('word_text', $exact_words) . '
+ ORDER BY word_count ASC';
+ $result = $this->db->sql_query($sql);
+
+ // store an array of words and ids, remove common words
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ if ($row['word_common'])
+ {
+ $this->common_words[] = $row['word_text'];
+ $common_ids[$row['word_text']] = (int) $row['word_id'];
+ continue;
+ }
+
+ $words[$row['word_text']] = (int) $row['word_id'];
+ }
+ $this->db->sql_freeresult($result);
+ }
+
+ // Handle +, - without preceeding whitespace character
+ $match = array('#(\S)\+#', '#(\S)-#');
+ $replace = array('$1 +', '$1 +');
+
+ $keywords = preg_replace($match, $replace, $keywords);
+
+ // now analyse the search query, first split it using the spaces
+ $query = explode(' ', $keywords);
+
+ $this->must_contain_ids = array();
+ $this->must_not_contain_ids = array();
+ $this->must_exclude_one_ids = array();
+
+ $mode = '';
+ $ignore_no_id = true;
+
+ foreach ($query as $word)
+ {
+ if (empty($word))
+ {
+ continue;
+ }
+
+ // words which should not be included
+ if ($word[0] == '-')
+ {
+ $word = substr($word, 1);
+
+ // a group of which at least one may not be in the resulting posts
+ if ($word[0] == '(')
+ {
+ $word = array_unique(explode('|', substr($word, 1, -1)));
+ $mode = 'must_exclude_one';
+ }
+ // one word which should not be in the resulting posts
+ else
+ {
+ $mode = 'must_not_contain';
+ }
+ $ignore_no_id = true;
+ }
+ // words which have to be included
+ else
+ {
+ // no prefix is the same as a +prefix
+ if ($word[0] == '+')
+ {
+ $word = substr($word, 1);
+ }
+
+ // a group of words of which at least one word should be in every resulting post
+ if ($word[0] == '(')
+ {
+ $word = array_unique(explode('|', substr($word, 1, -1)));
+ }
+ $ignore_no_id = false;
+ $mode = 'must_contain';
+ }
+
+ if (empty($word))
+ {
+ continue;
+ }
+
+ // if this is an array of words then retrieve an id for each
+ if (is_array($word))
+ {
+ $non_common_words = array();
+ $id_words = array();
+ foreach ($word as $i => $word_part)
+ {
+ if (strpos($word_part, '*') !== false)
+ {
+ $id_words[] = '\'' . $this->db->sql_escape(str_replace('*', '%', $word_part)) . '\'';
+ $non_common_words[] = $word_part;
+ }
+ else if (isset($words[$word_part]))
+ {
+ $id_words[] = $words[$word_part];
+ $non_common_words[] = $word_part;
+ }
+ else
+ {
+ $len = utf8_strlen($word_part);
+ if ($len < $this->word_length['min'] || $len > $this->word_length['max'])
+ {
+ $this->common_words[] = $word_part;
+ }
+ }
+ }
+ if (sizeof($id_words))
+ {
+ sort($id_words);
+ if (sizeof($id_words) > 1)
+ {
+ $this->{$mode . '_ids'}[] = $id_words;
+ }
+ else
+ {
+ $mode = ($mode == 'must_exclude_one') ? 'must_not_contain' : $mode;
+ $this->{$mode . '_ids'}[] = $id_words[0];
+ }
+ }
+ // throw an error if we shall not ignore unexistant words
+ else if (!$ignore_no_id && sizeof($non_common_words))
+ {
+ trigger_error(sprintf($this->user->lang['WORDS_IN_NO_POST'], implode($this->user->lang['COMMA_SEPARATOR'], $non_common_words)));
+ }
+ unset($non_common_words);
+ }
+ // else we only need one id
+ else if (($wildcard = strpos($word, '*') !== false) || isset($words[$word]))
+ {
+ if ($wildcard)
+ {
+ $len = utf8_strlen(str_replace('*', '', $word));
+ if ($len >= $this->word_length['min'] && $len <= $this->word_length['max'])
+ {
+ $this->{$mode . '_ids'}[] = '\'' . $this->db->sql_escape(str_replace('*', '%', $word)) . '\'';
+ }
+ else
+ {
+ $this->common_words[] = $word;
+ }
+ }
+ else
+ {
+ $this->{$mode . '_ids'}[] = $words[$word];
+ }
+ }
+ else
+ {
+ if (!isset($common_ids[$word]))
+ {
+ $len = utf8_strlen($word);
+ if ($len < $this->word_length['min'] || $len > $this->word_length['max'])
+ {
+ $this->common_words[] = $word;
+ }
+ }
+ }
+ }
+
+ // Return true if all words are not common words
+ if (sizeof($exact_words) - sizeof($this->common_words) > 0)
+ {
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Performs a search on keywords depending on display specific params. You have to run split_keywords() first
+ *
+ * @param string $type contains either posts or topics depending on what should be searched for
+ * @param string $fields contains either titleonly (topic titles should be searched), msgonly (only message bodies should be searched), firstpost (only subject and body of the first post should be searched) or all (all post bodies and subjects should be searched)
+ * @param string $terms is either 'all' (use query as entered, words without prefix should default to "have to be in field") or 'any' (ignore search query parts and just return all posts that contain any of the specified words)
+ * @param array $sort_by_sql contains SQL code for the ORDER BY part of a query
+ * @param string $sort_key is the key of $sort_by_sql for the selected sorting
+ * @param string $sort_dir is either a or d representing ASC and DESC
+ * @param string $sort_days specifies the maximum amount of days a post may be old
+ * @param array $ex_fid_ary specifies an array of forum ids which should not be searched
+ * @param string $post_visibility specifies which types of posts the user can view in which forums
+ * @param int $topic_id is set to 0 or a topic id, if it is not 0 then only posts in this topic should be searched
+ * @param array $author_ary an array of author ids if the author should be ignored during the search the array is empty
+ * @param string $author_name specifies the author match, when ANONYMOUS is also a search-match
+ * @param array &$id_ary passed by reference, to be filled with ids for the page specified by $start and $per_page, should be ordered
+ * @param int $start indicates the first index of the page
+ * @param int $per_page number of ids each page is supposed to contain
+ * @return boolean|int total number of results
+ */
+ public function keyword_search($type, $fields, $terms, $sort_by_sql, $sort_key, $sort_dir, $sort_days, $ex_fid_ary, $post_visibility, $topic_id, $author_ary, $author_name, &$id_ary, &$start, $per_page)
+ {
+ // No keywords? No posts.
+ if (empty($this->search_query))
+ {
+ return false;
+ }
+
+ // we can't search for negatives only
+ if (empty($this->must_contain_ids))
+ {
+ return false;
+ }
+
+ $must_contain_ids = $this->must_contain_ids;
+ $must_not_contain_ids = $this->must_not_contain_ids;
+ $must_exclude_one_ids = $this->must_exclude_one_ids;
+
+ sort($must_contain_ids);
+ sort($must_not_contain_ids);
+ sort($must_exclude_one_ids);
+
+ // generate a search_key from all the options to identify the results
+ $search_key_array = array(
+ serialize($must_contain_ids),
+ serialize($must_not_contain_ids),
+ serialize($must_exclude_one_ids),
+ $type,
+ $fields,
+ $terms,
+ $sort_days,
+ $sort_key,
+ $topic_id,
+ implode(',', $ex_fid_ary),
+ $post_visibility,
+ implode(',', $author_ary),
+ $author_name,
+ );
+
+ /**
+ * Allow changing the search_key for cached results
+ *
+ * @event core.search_native_by_keyword_modify_search_key
+ * @var array search_key_array Array with search parameters to generate the search_key
+ * @var array must_contain_ids Array with post ids of posts containing words that are to be included
+ * @var array must_not_contain_ids Array with post ids of posts containing words that should not be included
+ * @var array must_exclude_one_ids Array with post ids of posts containing at least one word that needs to be excluded
+ * @var string type Searching type ('posts', 'topics')
+ * @var string fields Searching fields ('titleonly', 'msgonly', 'firstpost', 'all')
+ * @var string terms Searching terms ('all', 'any')
+ * @var int sort_days Time, in days, of the oldest possible post to list
+ * @var string sort_key The sort type used from the possible sort types
+ * @var int topic_id Limit the search to this topic_id only
+ * @var array ex_fid_ary Which forums not to search on
+ * @var string post_visibility Post visibility data
+ * @var array author_ary Array of user_id containing the users to filter the results to
+ * @since 3.1.7-RC1
+ */
+ $vars = array(
+ 'search_key_array',
+ 'must_contain_ids',
+ 'must_not_contain_ids',
+ 'must_exclude_one_ids',
+ 'type',
+ 'fields',
+ 'terms',
+ 'sort_days',
+ 'sort_key',
+ 'topic_id',
+ 'ex_fid_ary',
+ 'post_visibility',
+ 'author_ary',
+ );
+ extract($this->phpbb_dispatcher->trigger_event('core.search_native_by_keyword_modify_search_key', compact($vars)));
+
+ $search_key = md5(implode('#', $search_key_array));
+
+ // try reading the results from cache
+ $total_results = 0;
+ if ($this->obtain_ids($search_key, $total_results, $id_ary, $start, $per_page, $sort_dir) == SEARCH_RESULT_IN_CACHE)
+ {
+ return $total_results;
+ }
+
+ $id_ary = array();
+
+ $sql_where = array();
+ $group_by = false;
+ $m_num = 0;
+ $w_num = 0;
+
+ $sql_array = array(
+ 'SELECT' => ($type == 'posts') ? 'p.post_id' : 'p.topic_id',
+ 'FROM' => array(
+ SEARCH_WORDMATCH_TABLE => array(),
+ SEARCH_WORDLIST_TABLE => array(),
+ ),
+ 'LEFT_JOIN' => array(array(
+ 'FROM' => array(POSTS_TABLE => 'p'),
+ 'ON' => 'm0.post_id = p.post_id',
+ )),
+ );
+
+ $title_match = '';
+ $left_join_topics = false;
+ $group_by = true;
+ // Build some display specific sql strings
+ switch ($fields)
+ {
+ case 'titleonly':
+ $title_match = 'title_match = 1';
+ $group_by = false;
+ // no break
+ case 'firstpost':
+ $left_join_topics = true;
+ $sql_where[] = 'p.post_id = t.topic_first_post_id';
+ break;
+
+ case 'msgonly':
+ $title_match = 'title_match = 0';
+ $group_by = false;
+ break;
+ }
+
+ if ($type == 'topics')
+ {
+ $left_join_topics = true;
+ $group_by = true;
+ }
+
+ /**
+ * @todo Add a query optimizer (handle stuff like "+(4|3) +4")
+ */
+
+ foreach ($this->must_contain_ids as $subquery)
+ {
+ if (is_array($subquery))
+ {
+ $group_by = true;
+
+ $word_id_sql = array();
+ $word_ids = array();
+ foreach ($subquery as $id)
+ {
+ if (is_string($id))
+ {
+ $sql_array['LEFT_JOIN'][] = array(
+ 'FROM' => array(SEARCH_WORDLIST_TABLE => 'w' . $w_num),
+ 'ON' => "w$w_num.word_text LIKE $id"
+ );
+ $word_ids[] = "w$w_num.word_id";
+
+ $w_num++;
+ }
+ else
+ {
+ $word_ids[] = $id;
+ }
+ }
+
+ $sql_where[] = $this->db->sql_in_set("m$m_num.word_id", $word_ids);
+
+ unset($word_id_sql);
+ unset($word_ids);
+ }
+ else if (is_string($subquery))
+ {
+ $sql_array['FROM'][SEARCH_WORDLIST_TABLE][] = 'w' . $w_num;
+
+ $sql_where[] = "w$w_num.word_text LIKE $subquery";
+ $sql_where[] = "m$m_num.word_id = w$w_num.word_id";
+
+ $group_by = true;
+ $w_num++;
+ }
+ else
+ {
+ $sql_where[] = "m$m_num.word_id = $subquery";
+ }
+
+ $sql_array['FROM'][SEARCH_WORDMATCH_TABLE][] = 'm' . $m_num;
+
+ if ($title_match)
+ {
+ $sql_where[] = "m$m_num.$title_match";
+ }
+
+ if ($m_num != 0)
+ {
+ $sql_where[] = "m$m_num.post_id = m0.post_id";
+ }
+ $m_num++;
+ }
+
+ foreach ($this->must_not_contain_ids as $key => $subquery)
+ {
+ if (is_string($subquery))
+ {
+ $sql_array['LEFT_JOIN'][] = array(
+ 'FROM' => array(SEARCH_WORDLIST_TABLE => 'w' . $w_num),
+ 'ON' => "w$w_num.word_text LIKE $subquery"
+ );
+
+ $this->must_not_contain_ids[$key] = "w$w_num.word_id";
+
+ $group_by = true;
+ $w_num++;
+ }
+ }
+
+ if (sizeof($this->must_not_contain_ids))
+ {
+ $sql_array['LEFT_JOIN'][] = array(
+ 'FROM' => array(SEARCH_WORDMATCH_TABLE => 'm' . $m_num),
+ 'ON' => $this->db->sql_in_set("m$m_num.word_id", $this->must_not_contain_ids) . (($title_match) ? " AND m$m_num.$title_match" : '') . " AND m$m_num.post_id = m0.post_id"
+ );
+
+ $sql_where[] = "m$m_num.word_id IS NULL";
+ $m_num++;
+ }
+
+ foreach ($this->must_exclude_one_ids as $ids)
+ {
+ $is_null_joins = array();
+ foreach ($ids as $id)
+ {
+ if (is_string($id))
+ {
+ $sql_array['LEFT_JOIN'][] = array(
+ 'FROM' => array(SEARCH_WORDLIST_TABLE => 'w' . $w_num),
+ 'ON' => "w$w_num.word_text LIKE $id"
+ );
+ $id = "w$w_num.word_id";
+
+ $group_by = true;
+ $w_num++;
+ }
+
+ $sql_array['LEFT_JOIN'][] = array(
+ 'FROM' => array(SEARCH_WORDMATCH_TABLE => 'm' . $m_num),
+ 'ON' => "m$m_num.word_id = $id AND m$m_num.post_id = m0.post_id" . (($title_match) ? " AND m$m_num.$title_match" : '')
+ );
+ $is_null_joins[] = "m$m_num.word_id IS NULL";
+
+ $m_num++;
+ }
+ $sql_where[] = '(' . implode(' OR ', $is_null_joins) . ')';
+ }
+
+ $sql_where[] = $post_visibility;
+
+ $search_query = $this->search_query;
+ $must_exclude_one_ids = $this->must_exclude_one_ids;
+ $must_not_contain_ids = $this->must_not_contain_ids;
+ $must_contain_ids = $this->must_contain_ids;
+
+ /**
+ * Allow changing the query used for counting for posts using fulltext_native
+ *
+ * @event core.search_native_keywords_count_query_before
+ * @var string search_query The parsed keywords used for this search
+ * @var array must_not_contain_ids Ids that cannot be taken into account for the results
+ * @var array must_exclude_one_ids Ids that cannot be on the results
+ * @var array must_contain_ids Ids that must be on the results
+ * @var int total_results The previous result count for the format of the query
+ * Set to 0 to force a re-count
+ * @var array sql_array The data on how to search in the DB at this point
+ * @var bool left_join_topics Whether or not TOPICS_TABLE should be CROSS JOIN'ED
+ * @var array author_ary Array of user_id containing the users to filter the results to
+ * @var string author_name An extra username to search on (!empty(author_ary) must be true, to be relevant)
+ * @var array ex_fid_ary Which forums not to search on
+ * @var int topic_id Limit the search to this topic_id only
+ * @var string sql_sort_table Extra tables to include in the SQL query.
+ * Used in conjunction with sql_sort_join
+ * @var string sql_sort_join SQL conditions to join all the tables used together.
+ * Used in conjunction with sql_sort_table
+ * @var int sort_days Time, in days, of the oldest possible post to list
+ * @var string sql_where An array of the current WHERE clause conditions
+ * @var string sql_match Which columns to do the search on
+ * @var string sql_match_where Extra conditions to use to properly filter the matching process
+ * @var bool group_by Whether or not the SQL query requires a GROUP BY for the elements in the SELECT clause
+ * @var string sort_by_sql The possible predefined sort types
+ * @var string sort_key The sort type used from the possible sort types
+ * @var string sort_dir "a" for ASC or "d" dor DESC for the sort order used
+ * @var string sql_sort The result SQL when processing sort_by_sql + sort_key + sort_dir
+ * @var int start How many posts to skip in the search results (used for pagination)
+ * @since 3.1.5-RC1
+ */
+ $vars = array(
+ 'search_query',
+ 'must_not_contain_ids',
+ 'must_exclude_one_ids',
+ 'must_contain_ids',
+ 'total_results',
+ 'sql_array',
+ 'left_join_topics',
+ 'author_ary',
+ 'author_name',
+ 'ex_fid_ary',
+ 'topic_id',
+ 'sql_sort_table',
+ 'sql_sort_join',
+ 'sort_days',
+ 'sql_where',
+ 'sql_match',
+ 'sql_match_where',
+ 'group_by',
+ 'sort_by_sql',
+ 'sort_key',
+ 'sort_dir',
+ 'sql_sort',
+ 'start',
+ );
+ extract($this->phpbb_dispatcher->trigger_event('core.search_native_keywords_count_query_before', compact($vars)));
+
+ if ($topic_id)
+ {
+ $sql_where[] = 'p.topic_id = ' . $topic_id;
+ }
+
+ if (sizeof($author_ary))
+ {
+ if ($author_name)
+ {
+ // first one matches post of registered users, second one guests and deleted users
+ $sql_author = '(' . $this->db->sql_in_set('p.poster_id', array_diff($author_ary, array(ANONYMOUS)), false, true) . ' OR p.post_username ' . $author_name . ')';
+ }
+ else
+ {
+ $sql_author = $this->db->sql_in_set('p.poster_id', $author_ary);
+ }
+ $sql_where[] = $sql_author;
+ }
+
+ if (sizeof($ex_fid_ary))
+ {
+ $sql_where[] = $this->db->sql_in_set('p.forum_id', $ex_fid_ary, true);
+ }
+
+ if ($sort_days)
+ {
+ $sql_where[] = 'p.post_time >= ' . (time() - ($sort_days * 86400));
+ }
+
+ $sql_array['WHERE'] = implode(' AND ', $sql_where);
+
+ $is_mysql = false;
+ // if the total result count is not cached yet, retrieve it from the db
+ if (!$total_results)
+ {
+ $sql = '';
+ $sql_array_count = $sql_array;
+
+ if ($left_join_topics)
+ {
+ $sql_array_count['LEFT_JOIN'][] = array(
+ 'FROM' => array(TOPICS_TABLE => 't'),
+ 'ON' => 'p.topic_id = t.topic_id'
+ );
+ }
+
+ switch ($this->db->get_sql_layer())
+ {
+ case 'mysql4':
+ case 'mysqli':
+
+ // 3.x does not support SQL_CALC_FOUND_ROWS
+ // $sql_array['SELECT'] = 'SQL_CALC_FOUND_ROWS ' . $sql_array['SELECT'];
+ $is_mysql = true;
+
+ break;
+
+ case 'sqlite':
+ case 'sqlite3':
+ $sql_array_count['SELECT'] = ($type == 'posts') ? 'DISTINCT p.post_id' : 'DISTINCT p.topic_id';
+ $sql = 'SELECT COUNT(' . (($type == 'posts') ? 'post_id' : 'topic_id') . ') as total_results
+ FROM (' . $this->db->sql_build_query('SELECT', $sql_array_count) . ')';
+
+ // no break
+
+ default:
+ $sql_array_count['SELECT'] = ($type == 'posts') ? 'COUNT(DISTINCT p.post_id) AS total_results' : 'COUNT(DISTINCT p.topic_id) AS total_results';
+ $sql = (!$sql) ? $this->db->sql_build_query('SELECT', $sql_array_count) : $sql;
+
+ $result = $this->db->sql_query($sql);
+ $total_results = (int) $this->db->sql_fetchfield('total_results');
+ $this->db->sql_freeresult($result);
+
+ if (!$total_results)
+ {
+ return false;
+ }
+ break;
+ }
+
+ unset($sql_array_count, $sql);
+ }
+
+ // Build sql strings for sorting
+ $sql_sort = $sort_by_sql[$sort_key] . (($sort_dir == 'a') ? ' ASC' : ' DESC');
+
+ switch ($sql_sort[0])
+ {
+ case 'u':
+ $sql_array['FROM'][USERS_TABLE] = 'u';
+ $sql_where[] = 'u.user_id = p.poster_id ';
+ break;
+
+ case 't':
+ $left_join_topics = true;
+ break;
+
+ case 'f':
+ $sql_array['FROM'][FORUMS_TABLE] = 'f';
+ $sql_where[] = 'f.forum_id = p.forum_id';
+ break;
+ }
+
+ if ($left_join_topics)
+ {
+ $sql_array['LEFT_JOIN'][] = array(
+ 'FROM' => array(TOPICS_TABLE => 't'),
+ 'ON' => 'p.topic_id = t.topic_id'
+ );
+ }
+
+ // if using mysql and the total result count is not calculated yet, get it from the db
+ if (!$total_results && $is_mysql)
+ {
+ // Also count rows for the query as if there was not LIMIT. Add SQL_CALC_FOUND_ROWS to SQL
+ $sql_array['SELECT'] = 'SQL_CALC_FOUND_ROWS ' . $sql_array['SELECT'];
+ }
+
+ $sql_array['WHERE'] = implode(' AND ', $sql_where);
+ $sql_array['GROUP_BY'] = ($group_by) ? (($type == 'posts') ? 'p.post_id' : 'p.topic_id') . ', ' . $sort_by_sql[$sort_key] : '';
+ $sql_array['ORDER_BY'] = $sql_sort;
+
+ unset($sql_where, $sql_sort, $group_by);
+
+ $sql = $this->db->sql_build_query('SELECT', $sql_array);
+ $result = $this->db->sql_query_limit($sql, $this->config['search_block_size'], $start);
+
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $id_ary[] = (int) $row[(($type == 'posts') ? 'post_id' : 'topic_id')];
+ }
+ $this->db->sql_freeresult($result);
+
+ if (!$total_results && $is_mysql)
+ {
+ // Get the number of results as calculated by MySQL
+ $sql_count = 'SELECT FOUND_ROWS() as total_results';
+ $result = $this->db->sql_query($sql_count);
+ $total_results = (int) $this->db->sql_fetchfield('total_results');
+ $this->db->sql_freeresult($result);
+
+ if (!$total_results)
+ {
+ return false;
+ }
+ }
+
+ if ($start >= $total_results)
+ {
+ $start = floor(($total_results - 1) / $per_page) * $per_page;
+
+ $result = $this->db->sql_query_limit($sql, $this->config['search_block_size'], $start);
+
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $id_ary[] = (int) $row[(($type == 'posts') ? 'post_id' : 'topic_id')];
+ }
+ $this->db->sql_freeresult($result);
+
+ }
+
+ // store the ids, from start on then delete anything that isn't on the current page because we only need ids for one page
+ $this->save_ids($search_key, $this->search_query, $author_ary, $total_results, $id_ary, $start, $sort_dir);
+ $id_ary = array_slice($id_ary, 0, (int) $per_page);
+
+ return $total_results;
+ }
+
+ /**
+ * Performs a search on an author's posts without caring about message contents. Depends on display specific params
+ *
+ * @param string $type contains either posts or topics depending on what should be searched for
+ * @param boolean $firstpost_only if true, only topic starting posts will be considered
+ * @param array $sort_by_sql contains SQL code for the ORDER BY part of a query
+ * @param string $sort_key is the key of $sort_by_sql for the selected sorting
+ * @param string $sort_dir is either a or d representing ASC and DESC
+ * @param string $sort_days specifies the maximum amount of days a post may be old
+ * @param array $ex_fid_ary specifies an array of forum ids which should not be searched
+ * @param string $post_visibility specifies which types of posts the user can view in which forums
+ * @param int $topic_id is set to 0 or a topic id, if it is not 0 then only posts in this topic should be searched
+ * @param array $author_ary an array of author ids
+ * @param string $author_name specifies the author match, when ANONYMOUS is also a search-match
+ * @param array &$id_ary passed by reference, to be filled with ids for the page specified by $start and $per_page, should be ordered
+ * @param int $start indicates the first index of the page
+ * @param int $per_page number of ids each page is supposed to contain
+ * @return boolean|int total number of results
+ */
+ public function author_search($type, $firstpost_only, $sort_by_sql, $sort_key, $sort_dir, $sort_days, $ex_fid_ary, $post_visibility, $topic_id, $author_ary, $author_name, &$id_ary, &$start, $per_page)
+ {
+ // No author? No posts
+ if (!sizeof($author_ary))
+ {
+ return 0;
+ }
+
+ // generate a search_key from all the options to identify the results
+ $search_key_array = array(
+ '',
+ $type,
+ ($firstpost_only) ? 'firstpost' : '',
+ '',
+ '',
+ $sort_days,
+ $sort_key,
+ $topic_id,
+ implode(',', $ex_fid_ary),
+ $post_visibility,
+ implode(',', $author_ary),
+ $author_name,
+ );
+
+ /**
+ * Allow changing the search_key for cached results
+ *
+ * @event core.search_native_by_author_modify_search_key
+ * @var array search_key_array Array with search parameters to generate the search_key
+ * @var string type Searching type ('posts', 'topics')
+ * @var boolean firstpost_only Flag indicating if only topic starting posts are considered
+ * @var int sort_days Time, in days, of the oldest possible post to list
+ * @var string sort_key The sort type used from the possible sort types
+ * @var int topic_id Limit the search to this topic_id only
+ * @var array ex_fid_ary Which forums not to search on
+ * @var string post_visibility Post visibility data
+ * @var array author_ary Array of user_id containing the users to filter the results to
+ * @var string author_name The username to search on
+ * @since 3.1.7-RC1
+ */
+ $vars = array(
+ 'search_key_array',
+ 'type',
+ 'firstpost_only',
+ 'sort_days',
+ 'sort_key',
+ 'topic_id',
+ 'ex_fid_ary',
+ 'post_visibility',
+ 'author_ary',
+ 'author_name',
+ );
+ extract($this->phpbb_dispatcher->trigger_event('core.search_native_by_author_modify_search_key', compact($vars)));
+
+ $search_key = md5(implode('#', $search_key_array));
+
+ // try reading the results from cache
+ $total_results = 0;
+ if ($this->obtain_ids($search_key, $total_results, $id_ary, $start, $per_page, $sort_dir) == SEARCH_RESULT_IN_CACHE)
+ {
+ return $total_results;
+ }
+
+ $id_ary = array();
+
+ // Create some display specific sql strings
+ if ($author_name)
+ {
+ // first one matches post of registered users, second one guests and deleted users
+ $sql_author = '(' . $this->db->sql_in_set('p.poster_id', array_diff($author_ary, array(ANONYMOUS)), false, true) . ' OR p.post_username ' . $author_name . ')';
+ }
+ else
+ {
+ $sql_author = $this->db->sql_in_set('p.poster_id', $author_ary);
+ }
+ $sql_fora = (sizeof($ex_fid_ary)) ? ' AND ' . $this->db->sql_in_set('p.forum_id', $ex_fid_ary, true) : '';
+ $sql_time = ($sort_days) ? ' AND p.post_time >= ' . (time() - ($sort_days * 86400)) : '';
+ $sql_topic_id = ($topic_id) ? ' AND p.topic_id = ' . (int) $topic_id : '';
+ $sql_firstpost = ($firstpost_only) ? ' AND p.post_id = t.topic_first_post_id' : '';
+ $post_visibility = ($post_visibility) ? ' AND ' . $post_visibility : '';
+
+ // Build sql strings for sorting
+ $sql_sort = $sort_by_sql[$sort_key] . (($sort_dir == 'a') ? ' ASC' : ' DESC');
+ $sql_sort_table = $sql_sort_join = '';
+ switch ($sql_sort[0])
+ {
+ case 'u':
+ $sql_sort_table = USERS_TABLE . ' u, ';
+ $sql_sort_join = ' AND u.user_id = p.poster_id ';
+ break;
+
+ case 't':
+ $sql_sort_table = ($type == 'posts' && !$firstpost_only) ? TOPICS_TABLE . ' t, ' : '';
+ $sql_sort_join = ($type == 'posts' && !$firstpost_only) ? ' AND t.topic_id = p.topic_id ' : '';
+ break;
+
+ case 'f':
+ $sql_sort_table = FORUMS_TABLE . ' f, ';
+ $sql_sort_join = ' AND f.forum_id = p.forum_id ';
+ break;
+ }
+
+ $select = ($type == 'posts') ? 'p.post_id' : 't.topic_id';
+ $is_mysql = false;
+
+ /**
+ * Allow changing the query used to search for posts by author in fulltext_native
+ *
+ * @event core.search_native_author_count_query_before
+ * @var int total_results The previous result count for the format of the query.
+ * Set to 0 to force a re-count
+ * @var string type The type of search being made
+ * @var string select SQL SELECT clause for what to get
+ * @var string sql_sort_table CROSS JOIN'ed table to allow doing the sort chosen
+ * @var string sql_sort_join Condition to define how to join the CROSS JOIN'ed table specifyed in sql_sort_table
+ * @var array sql_author SQL WHERE condition for the post author ids
+ * @var int topic_id Limit the search to this topic_id only
+ * @var string sort_by_sql The possible predefined sort types
+ * @var string sort_key The sort type used from the possible sort types
+ * @var string sort_dir "a" for ASC or "d" dor DESC for the sort order used
+ * @var string sql_sort The result SQL when processing sort_by_sql + sort_key + sort_dir
+ * @var string sort_days Time, in days, that the oldest post showing can have
+ * @var string sql_time The SQL to search on the time specifyed by sort_days
+ * @var bool firstpost_only Wether or not to search only on the first post of the topics
+ * @var string sql_firstpost The SQL used in the WHERE claused to filter by firstpost.
+ * @var array ex_fid_ary Forum ids that must not be searched on
+ * @var array sql_fora SQL query for ex_fid_ary
+ * @var int start How many posts to skip in the search results (used for pagination)
+ * @since 3.1.5-RC1
+ */
+ $vars = array(
+ 'total_results',
+ 'type',
+ 'select',
+ 'sql_sort_table',
+ 'sql_sort_join',
+ 'sql_author',
+ 'topic_id',
+ 'sort_by_sql',
+ 'sort_key',
+ 'sort_dir',
+ 'sql_sort',
+ 'sort_days',
+ 'sql_time',
+ 'firstpost_only',
+ 'sql_firstpost',
+ 'ex_fid_ary',
+ 'sql_fora',
+ 'start',
+ );
+ extract($this->phpbb_dispatcher->trigger_event('core.search_native_author_count_query_before', compact($vars)));
+
+ // If the cache was completely empty count the results
+ if (!$total_results)
+ {
+ switch ($this->db->get_sql_layer())
+ {
+ case 'mysql4':
+ case 'mysqli':
+// $select = 'SQL_CALC_FOUND_ROWS ' . $select;
+ $is_mysql = true;
+ break;
+
+ default:
+ if ($type == 'posts')
+ {
+ $sql = 'SELECT COUNT(p.post_id) as total_results
+ FROM ' . POSTS_TABLE . ' p' . (($firstpost_only) ? ', ' . TOPICS_TABLE . ' t ' : ' ') . "
+ WHERE $sql_author
+ $sql_topic_id
+ $sql_firstpost
+ $post_visibility
+ $sql_fora
+ $sql_time";
+ }
+ else
+ {
+ if ($this->db->get_sql_layer() == 'sqlite' || $this->db->get_sql_layer() == 'sqlite3')
+ {
+ $sql = 'SELECT COUNT(topic_id) as total_results
+ FROM (SELECT DISTINCT t.topic_id';
+ }
+ else
+ {
+ $sql = 'SELECT COUNT(DISTINCT t.topic_id) as total_results';
+ }
+
+ $sql .= ' FROM ' . TOPICS_TABLE . ' t, ' . POSTS_TABLE . " p
+ WHERE $sql_author
+ $sql_topic_id
+ $sql_firstpost
+ $post_visibility
+ $sql_fora
+ AND t.topic_id = p.topic_id
+ $sql_time" . (($this->db->get_sql_layer() == 'sqlite' || $this->db->get_sql_layer() == 'sqlite3') ? ')' : '');
+ }
+ $result = $this->db->sql_query($sql);
+
+ $total_results = (int) $this->db->sql_fetchfield('total_results');
+ $this->db->sql_freeresult($result);
+
+ if (!$total_results)
+ {
+ return false;
+ }
+ break;
+ }
+ }
+
+ // Build the query for really selecting the post_ids
+ if ($type == 'posts')
+ {
+ $sql = "SELECT $select
+ FROM " . $sql_sort_table . POSTS_TABLE . ' p' . (($firstpost_only) ? ', ' . TOPICS_TABLE . ' t' : '') . "
+ WHERE $sql_author
+ $sql_topic_id
+ $sql_firstpost
+ $post_visibility
+ $sql_fora
+ $sql_sort_join
+ $sql_time
+ ORDER BY $sql_sort";
+ $field = 'post_id';
+ }
+ else
+ {
+ $sql = "SELECT $select
+ FROM " . $sql_sort_table . TOPICS_TABLE . ' t, ' . POSTS_TABLE . " p
+ WHERE $sql_author
+ $sql_topic_id
+ $sql_firstpost
+ $post_visibility
+ $sql_fora
+ AND t.topic_id = p.topic_id
+ $sql_sort_join
+ $sql_time
+ GROUP BY t.topic_id, " . $sort_by_sql[$sort_key] . '
+ ORDER BY ' . $sql_sort;
+ $field = 'topic_id';
+ }
+
+ // Only read one block of posts from the db and then cache it
+ $result = $this->db->sql_query_limit($sql, $this->config['search_block_size'], $start);
+
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $id_ary[] = (int) $row[$field];
+ }
+ $this->db->sql_freeresult($result);
+
+ if (!$total_results && $is_mysql)
+ {
+ // Count rows for the executed queries. Replace $select within $sql with SQL_CALC_FOUND_ROWS, and run it.
+ $sql_calc = str_replace('SELECT ' . $select, 'SELECT SQL_CALC_FOUND_ROWS ' . $select, $sql);
+
+ $result = $this->db->sql_query($sql_calc);
+ $this->db->sql_freeresult($result);
+
+ $sql_count = 'SELECT FOUND_ROWS() as total_results';
+ $result = $this->db->sql_query($sql_count);
+ $total_results = (int) $this->db->sql_fetchfield('total_results');
+ $this->db->sql_freeresult($result);
+
+ if (!$total_results)
+ {
+ return false;
+ }
+ }
+
+ if ($start >= $total_results)
+ {
+ $start = floor(($total_results - 1) / $per_page) * $per_page;
+
+ $result = $this->db->sql_query_limit($sql, $this->config['search_block_size'], $start);
+
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $id_ary[] = (int) $row[$field];
+ }
+ $this->db->sql_freeresult($result);
+ }
+
+ if (sizeof($id_ary))
+ {
+ $this->save_ids($search_key, '', $author_ary, $total_results, $id_ary, $start, $sort_dir);
+ $id_ary = array_slice($id_ary, 0, $per_page);
+
+ return $total_results;
+ }
+ return false;
+ }
+
+ /**
+ * Split a text into words of a given length
+ *
+ * The text is converted to UTF-8, cleaned up, and split. Then, words that
+ * conform to the defined length range are returned in an array.
+ *
+ * NOTE: duplicates are NOT removed from the return array
+ *
+ * @param string $text Text to split, encoded in UTF-8
+ * @return array Array of UTF-8 words
+ */
+ public function split_message($text)
+ {
+ $match = $words = array();
+
+ /**
+ * Taken from the original code
+ */
+ // Do not index code
+ $match[] = '#\[code(?:=.*?)?(\:?[0-9a-z]{5,})\].*?\[\/code(\:?[0-9a-z]{5,})\]#is';
+ // BBcode
+ $match[] = '#\[\/?[a-z0-9\*\+\-]+(?:=.*?)?(?::[a-z])?(\:?[0-9a-z]{5,})\]#';
+
+ $min = $this->word_length['min'];
+ $max = $this->word_length['max'];
+
+ $isset_min = $min - 1;
+
+ /**
+ * Clean up the string, remove HTML tags, remove BBCodes
+ */
+ $word = strtok($this->cleanup(preg_replace($match, ' ', strip_tags($text)), -1), ' ');
+
+ while (strlen($word))
+ {
+ if (strlen($word) > 255 || strlen($word) <= $isset_min)
+ {
+ /**
+ * Words longer than 255 bytes are ignored. This will have to be
+ * changed whenever we change the length of search_wordlist.word_text
+ *
+ * Words shorter than $isset_min bytes are ignored, too
+ */
+ $word = strtok(' ');
+ continue;
+ }
+
+ $len = utf8_strlen($word);
+
+ /**
+ * Test whether the word is too short to be indexed.
+ *
+ * Note that this limit does NOT apply to CJK and Hangul
+ */
+ if ($len < $min)
+ {
+ /**
+ * Note: this could be optimized. If the codepoint is lower than Hangul's range
+ * we know that it will also be lower than CJK ranges
+ */
+ if ((strncmp($word, UTF8_HANGUL_FIRST, 3) < 0 || strncmp($word, UTF8_HANGUL_LAST, 3) > 0)
+ && (strncmp($word, UTF8_CJK_FIRST, 3) < 0 || strncmp($word, UTF8_CJK_LAST, 3) > 0)
+ && (strncmp($word, UTF8_CJK_B_FIRST, 4) < 0 || strncmp($word, UTF8_CJK_B_LAST, 4) > 0))
+ {
+ $word = strtok(' ');
+ continue;
+ }
+ }
+
+ $words[] = $word;
+ $word = strtok(' ');
+ }
+
+ return $words;
+ }
+
+ /**
+ * Updates wordlist and wordmatch tables when a message is posted or changed
+ *
+ * @param string $mode Contains the post mode: edit, post, reply, quote
+ * @param int $post_id The id of the post which is modified/created
+ * @param string &$message New or updated post content
+ * @param string &$subject New or updated post subject
+ * @param int $poster_id Post author's user id
+ * @param int $forum_id The id of the forum in which the post is located
+ */
+ public function index($mode, $post_id, &$message, &$subject, $poster_id, $forum_id)
+ {
+ if (!$this->config['fulltext_native_load_upd'])
+ {
+ /**
+ * The search indexer is disabled, return
+ */
+ return;
+ }
+
+ // Split old and new post/subject to obtain array of 'words'
+ $split_text = $this->split_message($message);
+ $split_title = $this->split_message($subject);
+
+ $cur_words = array('post' => array(), 'title' => array());
+
+ $words = array();
+ if ($mode == 'edit')
+ {
+ $words['add']['post'] = array();
+ $words['add']['title'] = array();
+ $words['del']['post'] = array();
+ $words['del']['title'] = array();
+
+ $sql = 'SELECT w.word_id, w.word_text, m.title_match
+ FROM ' . SEARCH_WORDLIST_TABLE . ' w, ' . SEARCH_WORDMATCH_TABLE . " m
+ WHERE m.post_id = $post_id
+ AND w.word_id = m.word_id";
+ $result = $this->db->sql_query($sql);
+
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $which = ($row['title_match']) ? 'title' : 'post';
+ $cur_words[$which][$row['word_text']] = $row['word_id'];
+ }
+ $this->db->sql_freeresult($result);
+
+ $words['add']['post'] = array_diff($split_text, array_keys($cur_words['post']));
+ $words['add']['title'] = array_diff($split_title, array_keys($cur_words['title']));
+ $words['del']['post'] = array_diff(array_keys($cur_words['post']), $split_text);
+ $words['del']['title'] = array_diff(array_keys($cur_words['title']), $split_title);
+ }
+ else
+ {
+ $words['add']['post'] = $split_text;
+ $words['add']['title'] = $split_title;
+ $words['del']['post'] = array();
+ $words['del']['title'] = array();
+ }
+ unset($split_text);
+ unset($split_title);
+
+ // Get unique words from the above arrays
+ $unique_add_words = array_unique(array_merge($words['add']['post'], $words['add']['title']));
+
+ // We now have unique arrays of all words to be added and removed and
+ // individual arrays of added and removed words for text and title. What
+ // we need to do now is add the new words (if they don't already exist)
+ // and then add (or remove) matches between the words and this post
+ if (sizeof($unique_add_words))
+ {
+ $sql = 'SELECT word_id, word_text
+ FROM ' . SEARCH_WORDLIST_TABLE . '
+ WHERE ' . $this->db->sql_in_set('word_text', $unique_add_words);
+ $result = $this->db->sql_query($sql);
+
+ $word_ids = array();
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $word_ids[$row['word_text']] = $row['word_id'];
+ }
+ $this->db->sql_freeresult($result);
+ $new_words = array_diff($unique_add_words, array_keys($word_ids));
+
+ $this->db->sql_transaction('begin');
+ if (sizeof($new_words))
+ {
+ $sql_ary = array();
+
+ foreach ($new_words as $word)
+ {
+ $sql_ary[] = array('word_text' => (string) $word, 'word_count' => 0);
+ }
+ $this->db->sql_return_on_error(true);
+ $this->db->sql_multi_insert(SEARCH_WORDLIST_TABLE, $sql_ary);
+ $this->db->sql_return_on_error(false);
+ }
+ unset($new_words, $sql_ary);
+ }
+ else
+ {
+ $this->db->sql_transaction('begin');
+ }
+
+ // now update the search match table, remove links to removed words and add links to new words
+ foreach ($words['del'] as $word_in => $word_ary)
+ {
+ $title_match = ($word_in == 'title') ? 1 : 0;
+
+ if (sizeof($word_ary))
+ {
+ $sql_in = array();
+ foreach ($word_ary as $word)
+ {
+ $sql_in[] = $cur_words[$word_in][$word];
+ }
+
+ $sql = 'DELETE FROM ' . SEARCH_WORDMATCH_TABLE . '
+ WHERE ' . $this->db->sql_in_set('word_id', $sql_in) . '
+ AND post_id = ' . intval($post_id) . "
+ AND title_match = $title_match";
+ $this->db->sql_query($sql);
+
+ $sql = 'UPDATE ' . SEARCH_WORDLIST_TABLE . '
+ SET word_count = word_count - 1
+ WHERE ' . $this->db->sql_in_set('word_id', $sql_in) . '
+ AND word_count > 0';
+ $this->db->sql_query($sql);
+
+ unset($sql_in);
+ }
+ }
+
+ $this->db->sql_return_on_error(true);
+ foreach ($words['add'] as $word_in => $word_ary)
+ {
+ $title_match = ($word_in == 'title') ? 1 : 0;
+
+ if (sizeof($word_ary))
+ {
+ $sql = 'INSERT INTO ' . SEARCH_WORDMATCH_TABLE . ' (post_id, word_id, title_match)
+ SELECT ' . (int) $post_id . ', word_id, ' . (int) $title_match . '
+ FROM ' . SEARCH_WORDLIST_TABLE . '
+ WHERE ' . $this->db->sql_in_set('word_text', $word_ary);
+ $this->db->sql_query($sql);
+
+ $sql = 'UPDATE ' . SEARCH_WORDLIST_TABLE . '
+ SET word_count = word_count + 1
+ WHERE ' . $this->db->sql_in_set('word_text', $word_ary);
+ $this->db->sql_query($sql);
+ }
+ }
+ $this->db->sql_return_on_error(false);
+
+ $this->db->sql_transaction('commit');
+
+ // destroy cached search results containing any of the words removed or added
+ $this->destroy_cache(array_unique(array_merge($words['add']['post'], $words['add']['title'], $words['del']['post'], $words['del']['title'])), array($poster_id));
+
+ unset($unique_add_words);
+ unset($words);
+ unset($cur_words);
+ }
+
+ /**
+ * Removes entries from the wordmatch table for the specified post_ids
+ */
+ public function index_remove($post_ids, $author_ids, $forum_ids)
+ {
+ if (sizeof($post_ids))
+ {
+ $sql = 'SELECT w.word_id, w.word_text, m.title_match
+ FROM ' . SEARCH_WORDMATCH_TABLE . ' m, ' . SEARCH_WORDLIST_TABLE . ' w
+ WHERE ' . $this->db->sql_in_set('m.post_id', $post_ids) . '
+ AND w.word_id = m.word_id';
+ $result = $this->db->sql_query($sql);
+
+ $message_word_ids = $title_word_ids = $word_texts = array();
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ if ($row['title_match'])
+ {
+ $title_word_ids[] = $row['word_id'];
+ }
+ else
+ {
+ $message_word_ids[] = $row['word_id'];
+ }
+ $word_texts[] = $row['word_text'];
+ }
+ $this->db->sql_freeresult($result);
+
+ if (sizeof($title_word_ids))
+ {
+ $sql = 'UPDATE ' . SEARCH_WORDLIST_TABLE . '
+ SET word_count = word_count - 1
+ WHERE ' . $this->db->sql_in_set('word_id', $title_word_ids) . '
+ AND word_count > 0';
+ $this->db->sql_query($sql);
+ }
+
+ if (sizeof($message_word_ids))
+ {
+ $sql = 'UPDATE ' . SEARCH_WORDLIST_TABLE . '
+ SET word_count = word_count - 1
+ WHERE ' . $this->db->sql_in_set('word_id', $message_word_ids) . '
+ AND word_count > 0';
+ $this->db->sql_query($sql);
+ }
+
+ unset($title_word_ids);
+ unset($message_word_ids);
+
+ $sql = 'DELETE FROM ' . SEARCH_WORDMATCH_TABLE . '
+ WHERE ' . $this->db->sql_in_set('post_id', $post_ids);
+ $this->db->sql_query($sql);
+ }
+
+ $this->destroy_cache(array_unique($word_texts), array_unique($author_ids));
+ }
+
+ /**
+ * Tidy up indexes: Tag 'common words' and remove
+ * words no longer referenced in the match table
+ */
+ public function tidy()
+ {
+ // Is the fulltext indexer disabled? If yes then we need not
+ // carry on ... it's okay ... I know when I'm not wanted boo hoo
+ if (!$this->config['fulltext_native_load_upd'])
+ {
+ set_config('search_last_gc', time(), true);
+ return;
+ }
+
+ $destroy_cache_words = array();
+
+ // Remove common words
+ if ($this->config['num_posts'] >= 100 && $this->config['fulltext_native_common_thres'])
+ {
+ $common_threshold = ((double) $this->config['fulltext_native_common_thres']) / 100.0;
+ // First, get the IDs of common words
+ $sql = 'SELECT word_id, word_text
+ FROM ' . SEARCH_WORDLIST_TABLE . '
+ WHERE word_count > ' . floor($this->config['num_posts'] * $common_threshold) . '
+ OR word_common = 1';
+ $result = $this->db->sql_query($sql);
+
+ $sql_in = array();
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $sql_in[] = $row['word_id'];
+ $destroy_cache_words[] = $row['word_text'];
+ }
+ $this->db->sql_freeresult($result);
+
+ if (sizeof($sql_in))
+ {
+ // Flag the words
+ $sql = 'UPDATE ' . SEARCH_WORDLIST_TABLE . '
+ SET word_common = 1
+ WHERE ' . $this->db->sql_in_set('word_id', $sql_in);
+ $this->db->sql_query($sql);
+
+ // by setting search_last_gc to the new time here we make sure that if a user reloads because the
+ // following query takes too long, he won't run into it again
+ set_config('search_last_gc', time(), true);
+
+ // Delete the matches
+ $sql = 'DELETE FROM ' . SEARCH_WORDMATCH_TABLE . '
+ WHERE ' . $this->db->sql_in_set('word_id', $sql_in);
+ $this->db->sql_query($sql);
+ }
+ unset($sql_in);
+ }
+
+ if (sizeof($destroy_cache_words))
+ {
+ // destroy cached search results containing any of the words that are now common or were removed
+ $this->destroy_cache(array_unique($destroy_cache_words));
+ }
+
+ set_config('search_last_gc', time(), true);
+ }
+
+ /**
+ * Deletes all words from the index
+ */
+ public function delete_index($acp_module, $u_action)
+ {
+ switch ($this->db->get_sql_layer())
+ {
+ case 'sqlite':
+ case 'sqlite3':
+ $this->db->sql_query('DELETE FROM ' . SEARCH_WORDLIST_TABLE);
+ $this->db->sql_query('DELETE FROM ' . SEARCH_WORDMATCH_TABLE);
+ $this->db->sql_query('DELETE FROM ' . SEARCH_RESULTS_TABLE);
+ break;
+
+ default:
+ $this->db->sql_query('TRUNCATE TABLE ' . SEARCH_WORDLIST_TABLE);
+ $this->db->sql_query('TRUNCATE TABLE ' . SEARCH_WORDMATCH_TABLE);
+ $this->db->sql_query('TRUNCATE TABLE ' . SEARCH_RESULTS_TABLE);
+ break;
+ }
+ }
+
+ /**
+ * Returns true if both FULLTEXT indexes exist
+ */
+ public function index_created()
+ {
+ if (!sizeof($this->stats))
+ {
+ $this->get_stats();
+ }
+
+ return ($this->stats['total_words'] && $this->stats['total_matches']) ? true : false;
+ }
+
+ /**
+ * Returns an associative array containing information about the indexes
+ */
+ public function index_stats()
+ {
+ if (!sizeof($this->stats))
+ {
+ $this->get_stats();
+ }
+
+ return array(
+ $this->user->lang['TOTAL_WORDS'] => $this->stats['total_words'],
+ $this->user->lang['TOTAL_MATCHES'] => $this->stats['total_matches']);
+ }
+
+ protected function get_stats()
+ {
+ $this->stats['total_words'] = $this->db->get_estimated_row_count(SEARCH_WORDLIST_TABLE);
+ $this->stats['total_matches'] = $this->db->get_estimated_row_count(SEARCH_WORDMATCH_TABLE);
+ }
+
+ /**
+ * Clean up a text to remove non-alphanumeric characters
+ *
+ * This method receives a UTF-8 string, normalizes and validates it, replaces all
+ * non-alphanumeric characters with strings then returns the result.
+ *
+ * Any number of "allowed chars" can be passed as a UTF-8 string in NFC.
+ *
+ * @param string $text Text to split, in UTF-8 (not normalized or sanitized)
+ * @param string $allowed_chars String of special chars to allow
+ * @param string $encoding Text encoding
+ * @return string Cleaned up text, only alphanumeric chars are left
+ *
+ * @todo \normalizer::cleanup being able to be used?
+ */
+ protected function cleanup($text, $allowed_chars = null, $encoding = 'utf-8')
+ {
+ static $conv = array(), $conv_loaded = array();
+ $words = $allow = array();
+
+ // Convert the text to UTF-8
+ $encoding = strtolower($encoding);
+ if ($encoding != 'utf-8')
+ {
+ $text = utf8_recode($text, $encoding);
+ }
+
+ $utf_len_mask = array(
+ "\xC0" => 2,
+ "\xD0" => 2,
+ "\xE0" => 3,
+ "\xF0" => 4
+ );
+
+ /**
+ * Replace HTML entities and NCRs
+ */
+ $text = htmlspecialchars_decode(utf8_decode_ncr($text), ENT_QUOTES);
+
+ /**
+ * Load the UTF-8 normalizer
+ *
+ * If we use it more widely, an instance of that class should be held in a
+ * a global variable instead
+ */
+ \utf_normalizer::nfc($text);
+
+ /**
+ * The first thing we do is:
+ *
+ * - convert ASCII-7 letters to lowercase
+ * - remove the ASCII-7 non-alpha characters
+ * - remove the bytes that should not appear in a valid UTF-8 string: 0xC0,
+ * 0xC1 and 0xF5-0xFF
+ *
+ * @todo in theory, the third one is already taken care of during normalization and those chars should have been replaced by Unicode replacement chars
+ */
+ $sb_match = "ISTCPAMELRDOJBNHFGVWUQKYXZ\r\n\t!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~\x00\x01\x02\x03\x04\x05\x06\x07\x08\x0B\x0C\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F\xC0\xC1\xF5\xF6\xF7\xF8\xF9\xFA\xFB\xFC\xFD\xFE\xFF";
+ $sb_replace = 'istcpamelrdojbnhfgvwuqkyxz ';
+
+ /**
+ * This is the list of legal ASCII chars, it is automatically extended
+ * with ASCII chars from $allowed_chars
+ */
+ $legal_ascii = ' eaisntroludcpmghbfvq10xy2j9kw354867z';
+
+ /**
+ * Prepare an array containing the extra chars to allow
+ */
+ if (isset($allowed_chars[0]))
+ {
+ $pos = 0;
+ $len = strlen($allowed_chars);
+ do
+ {
+ $c = $allowed_chars[$pos];
+
+ if ($c < "\x80")
+ {
+ /**
+ * ASCII char
+ */
+ $sb_pos = strpos($sb_match, $c);
+ if (is_int($sb_pos))
+ {
+ /**
+ * Remove the char from $sb_match and its corresponding
+ * replacement in $sb_replace
+ */
+ $sb_match = substr($sb_match, 0, $sb_pos) . substr($sb_match, $sb_pos + 1);
+ $sb_replace = substr($sb_replace, 0, $sb_pos) . substr($sb_replace, $sb_pos + 1);
+ $legal_ascii .= $c;
+ }
+
+ ++$pos;
+ }
+ else
+ {
+ /**
+ * UTF-8 char
+ */
+ $utf_len = $utf_len_mask[$c & "\xF0"];
+ $allow[substr($allowed_chars, $pos, $utf_len)] = 1;
+ $pos += $utf_len;
+ }
+ }
+ while ($pos < $len);
+ }
+
+ $text = strtr($text, $sb_match, $sb_replace);
+ $ret = '';
+
+ $pos = 0;
+ $len = strlen($text);
+
+ do
+ {
+ /**
+ * Do all consecutive ASCII chars at once
+ */
+ if ($spn = strspn($text, $legal_ascii, $pos))
+ {
+ $ret .= substr($text, $pos, $spn);
+ $pos += $spn;
+ }
+
+ if ($pos >= $len)
+ {
+ return $ret;
+ }
+
+ /**
+ * Capture the UTF char
+ */
+ $utf_len = $utf_len_mask[$text[$pos] & "\xF0"];
+ $utf_char = substr($text, $pos, $utf_len);
+ $pos += $utf_len;
+
+ if (($utf_char >= UTF8_HANGUL_FIRST && $utf_char <= UTF8_HANGUL_LAST)
+ || ($utf_char >= UTF8_CJK_FIRST && $utf_char <= UTF8_CJK_LAST)
+ || ($utf_char >= UTF8_CJK_B_FIRST && $utf_char <= UTF8_CJK_B_LAST))
+ {
+ /**
+ * All characters within these ranges are valid
+ *
+ * We separate them with a space in order to index each character
+ * individually
+ */
+ $ret .= ' ' . $utf_char . ' ';
+ continue;
+ }
+
+ if (isset($allow[$utf_char]))
+ {
+ /**
+ * The char is explicitly allowed
+ */
+ $ret .= $utf_char;
+ continue;
+ }
+
+ if (isset($conv[$utf_char]))
+ {
+ /**
+ * The char is mapped to something, maybe to itself actually
+ */
+ $ret .= $conv[$utf_char];
+ continue;
+ }
+
+ /**
+ * The char isn't mapped, but did we load its conversion table?
+ *
+ * The search indexer table is split into blocks. The block number of
+ * each char is equal to its codepoint right-shifted for 11 bits. It
+ * means that out of the 11, 16 or 21 meaningful bits of a 2-, 3- or
+ * 4- byte sequence we only keep the leftmost 0, 5 or 10 bits. Thus,
+ * all UTF chars encoded in 2 bytes are in the same first block.
+ */
+ if (isset($utf_char[2]))
+ {
+ if (isset($utf_char[3]))
+ {
+ /**
+ * 1111 0nnn 10nn nnnn 10nx xxxx 10xx xxxx
+ * 0000 0111 0011 1111 0010 0000
+ */
+ $idx = ((ord($utf_char[0]) & 0x07) << 7) | ((ord($utf_char[1]) & 0x3F) << 1) | ((ord($utf_char[2]) & 0x20) >> 5);
+ }
+ else
+ {
+ /**
+ * 1110 nnnn 10nx xxxx 10xx xxxx
+ * 0000 0111 0010 0000
+ */
+ $idx = ((ord($utf_char[0]) & 0x07) << 1) | ((ord($utf_char[1]) & 0x20) >> 5);
+ }
+ }
+ else
+ {
+ /**
+ * 110x xxxx 10xx xxxx
+ * 0000 0000 0000 0000
+ */
+ $idx = 0;
+ }
+
+ /**
+ * Check if the required conv table has been loaded already
+ */
+ if (!isset($conv_loaded[$idx]))
+ {
+ $conv_loaded[$idx] = 1;
+ $file = $this->phpbb_root_path . 'includes/utf/data/search_indexer_' . $idx . '.' . $this->php_ext;
+
+ if (file_exists($file))
+ {
+ $conv += include($file);
+ }
+ }
+
+ if (isset($conv[$utf_char]))
+ {
+ $ret .= $conv[$utf_char];
+ }
+ else
+ {
+ /**
+ * We add an entry to the conversion table so that we
+ * don't have to convert to codepoint and perform the checks
+ * that are above this block
+ */
+ $conv[$utf_char] = ' ';
+ $ret .= ' ';
+ }
+ }
+ while (1);
+
+ return $ret;
+ }
+
+ /**
+ * Returns a list of options for the ACP to display
+ */
+ public function acp()
+ {
+ /**
+ * if we need any options, copied from fulltext_native for now, will have to be adjusted or removed
+ */
+
+ $tpl = '
+ <dl>
+ <dt><label for="fulltext_native_load_upd">' . $this->user->lang['YES_SEARCH_UPDATE'] . $this->user->lang['COLON'] . '</label><br /><span>' . $this->user->lang['YES_SEARCH_UPDATE_EXPLAIN'] . '</span></dt>
+ <dd><label><input type="radio" id="fulltext_native_load_upd" name="config[fulltext_native_load_upd]" value="1"' . (($this->config['fulltext_native_load_upd']) ? ' checked="checked"' : '') . ' class="radio" /> ' . $this->user->lang['YES'] . '</label><label><input type="radio" name="config[fulltext_native_load_upd]" value="0"' . ((!$this->config['fulltext_native_load_upd']) ? ' checked="checked"' : '') . ' class="radio" /> ' . $this->user->lang['NO'] . '</label></dd>
+ </dl>
+ <dl>
+ <dt><label for="fulltext_native_min_chars">' . $this->user->lang['MIN_SEARCH_CHARS'] . $this->user->lang['COLON'] . '</label><br /><span>' . $this->user->lang['MIN_SEARCH_CHARS_EXPLAIN'] . '</span></dt>
+ <dd><input id="fulltext_native_min_chars" type="number" min="0" max="255" name="config[fulltext_native_min_chars]" value="' . (int) $this->config['fulltext_native_min_chars'] . '" /></dd>
+ </dl>
+ <dl>
+ <dt><label for="fulltext_native_max_chars">' . $this->user->lang['MAX_SEARCH_CHARS'] . $this->user->lang['COLON'] . '</label><br /><span>' . $this->user->lang['MAX_SEARCH_CHARS_EXPLAIN'] . '</span></dt>
+ <dd><input id="fulltext_native_max_chars" type="number" min="0" max="255" name="config[fulltext_native_max_chars]" value="' . (int) $this->config['fulltext_native_max_chars'] . '" /></dd>
+ </dl>
+ <dl>
+ <dt><label for="fulltext_native_common_thres">' . $this->user->lang['COMMON_WORD_THRESHOLD'] . $this->user->lang['COLON'] . '</label><br /><span>' . $this->user->lang['COMMON_WORD_THRESHOLD_EXPLAIN'] . '</span></dt>
+ <dd><input id="fulltext_native_common_thres" type="text" name="config[fulltext_native_common_thres]" value="' . (double) $this->config['fulltext_native_common_thres'] . '" /> %</dd>
+ </dl>
+ ';
+
+ // These are fields required in the config table
+ return array(
+ 'tpl' => $tpl,
+ 'config' => array('fulltext_native_load_upd' => 'bool', 'fulltext_native_min_chars' => 'integer:0:255', 'fulltext_native_max_chars' => 'integer:0:255', 'fulltext_native_common_thres' => 'double:0:100')
+ );
+ }
+}
diff --git a/phpBB/phpbb/search/fulltext_postgres.php b/phpBB/phpbb/search/fulltext_postgres.php
new file mode 100644
index 0000000000..04441e6226
--- /dev/null
+++ b/phpBB/phpbb/search/fulltext_postgres.php
@@ -0,0 +1,1106 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\search;
+
+/**
+* Fulltext search for PostgreSQL
+*/
+class fulltext_postgres extends \phpbb\search\base
+{
+ /**
+ * Associative array holding index stats
+ * @var array
+ */
+ protected $stats = array();
+
+ /**
+ * Holds the words entered by user, obtained by splitting the entered query on whitespace
+ * @var array
+ */
+ protected $split_words = array();
+
+ /**
+ * Stores the tsearch query
+ * @var string
+ */
+ protected $tsearch_query;
+
+ /**
+ * True if phrase search is supported.
+ * PostgreSQL fulltext currently doesn't support it
+ * @var boolean
+ */
+ protected $phrase_search = false;
+
+ /**
+ * Config object
+ * @var \phpbb\config\config
+ */
+ protected $config;
+
+ /**
+ * Database connection
+ * @var \phpbb\db\driver\driver_interface
+ */
+ protected $db;
+
+ /**
+ * phpBB event dispatcher object
+ * @var \phpbb\event\dispatcher_interface
+ */
+ protected $phpbb_dispatcher;
+
+ /**
+ * User object
+ * @var \phpbb\user
+ */
+ protected $user;
+
+ /**
+ * Contains tidied search query.
+ * Operators are prefixed in search query and common words excluded
+ * @var string
+ */
+ protected $search_query;
+
+ /**
+ * Contains common words.
+ * Common words are words with length less/more than min/max length
+ * @var array
+ */
+ protected $common_words = array();
+
+ /**
+ * Associative array stores the min and max word length to be searched
+ * @var array
+ */
+ protected $word_length = array();
+
+ /**
+ * Constructor
+ * Creates a new \phpbb\search\fulltext_postgres, which is used as a search backend
+ *
+ * @param string|bool $error Any error that occurs is passed on through this reference variable otherwise false
+ * @param string $phpbb_root_path Relative path to phpBB root
+ * @param string $phpEx PHP file extension
+ * @param \phpbb\auth\auth $auth Auth object
+ * @param \phpbb\config\config $config Config object
+ * @param \phpbb\db\driver\driver_interface Database object
+ * @param \phpbb\user $user User object
+ * @param \phpbb\event\dispatcher_interface $phpbb_dispatcher Event dispatcher object
+ */
+ public function __construct(&$error, $phpbb_root_path, $phpEx, $auth, $config, $db, $user, $phpbb_dispatcher)
+ {
+ $this->config = $config;
+ $this->db = $db;
+ $this->phpbb_dispatcher = $phpbb_dispatcher;
+ $this->user = $user;
+
+ $this->word_length = array('min' => $this->config['fulltext_postgres_min_word_len'], 'max' => $this->config['fulltext_postgres_max_word_len']);
+
+ /**
+ * Load the UTF tools
+ */
+ if (!function_exists('utf8_strlen'))
+ {
+ include($phpbb_root_path . 'includes/utf/utf_tools.' . $phpEx);
+ }
+
+ $error = false;
+ }
+
+ /**
+ * Returns the name of this search backend to be displayed to administrators
+ *
+ * @return string Name
+ */
+ public function get_name()
+ {
+ return 'PostgreSQL Fulltext';
+ }
+
+ /**
+ * Returns the search_query
+ *
+ * @return string search query
+ */
+ public function get_search_query()
+ {
+ return $this->search_query;
+ }
+
+ /**
+ * Returns the common_words array
+ *
+ * @return array common words that are ignored by search backend
+ */
+ public function get_common_words()
+ {
+ return $this->common_words;
+ }
+
+ /**
+ * Returns the word_length array
+ *
+ * @return array min and max word length for searching
+ */
+ public function get_word_length()
+ {
+ return $this->word_length;
+ }
+
+ /**
+ * Returns if phrase search is supported or not
+ *
+ * @return bool
+ */
+ public function supports_phrase_search()
+ {
+ return $this->phrase_search;
+ }
+
+ /**
+ * Checks for correct PostgreSQL version and stores min/max word length in the config
+ *
+ * @return string|bool Language key of the error/incompatiblity occurred
+ */
+ public function init()
+ {
+ if ($this->db->get_sql_layer() != 'postgres')
+ {
+ return $this->user->lang['FULLTEXT_POSTGRES_INCOMPATIBLE_DATABASE'];
+ }
+
+ return false;
+ }
+
+ /**
+ * Splits keywords entered by a user into an array of words stored in $this->split_words
+ * Stores the tidied search query in $this->search_query
+ *
+ * @param string &$keywords Contains the keyword as entered by the user
+ * @param string $terms is either 'all' or 'any'
+ * @return bool false if no valid keywords were found and otherwise true
+ */
+ public function split_keywords(&$keywords, $terms)
+ {
+ if ($terms == 'all')
+ {
+ $match = array('#\sand\s#iu', '#\sor\s#iu', '#\snot\s#iu', '#(^|\s)\+#', '#(^|\s)-#', '#(^|\s)\|#');
+ $replace = array(' +', ' |', ' -', ' +', ' -', ' |');
+
+ $keywords = preg_replace($match, $replace, $keywords);
+ }
+
+ // Filter out as above
+ $split_keywords = preg_replace("#[\"\n\r\t]+#", ' ', trim(htmlspecialchars_decode($keywords)));
+
+ // Split words
+ $split_keywords = preg_replace('#([^\p{L}\p{N}\'*"()])#u', '$1$1', str_replace('\'\'', '\' \'', trim($split_keywords)));
+ $matches = array();
+ preg_match_all('#(?:[^\p{L}\p{N}*"()]|^)([+\-|]?(?:[\p{L}\p{N}*"()]+\'?)*[\p{L}\p{N}*"()])(?:[^\p{L}\p{N}*"()]|$)#u', $split_keywords, $matches);
+ $this->split_words = $matches[1];
+
+ foreach ($this->split_words as $i => $word)
+ {
+ $clean_word = preg_replace('#^[+\-|"]#', '', $word);
+
+ // check word length
+ $clean_len = utf8_strlen(str_replace('*', '', $clean_word));
+ if (($clean_len < $this->config['fulltext_postgres_min_word_len']) || ($clean_len > $this->config['fulltext_postgres_max_word_len']))
+ {
+ $this->common_words[] = $word;
+ unset($this->split_words[$i]);
+ }
+ }
+
+ if ($terms == 'any')
+ {
+ $this->search_query = '';
+ $this->tsearch_query = '';
+ foreach ($this->split_words as $word)
+ {
+ if ((strpos($word, '+') === 0) || (strpos($word, '-') === 0) || (strpos($word, '|') === 0))
+ {
+ $word = substr($word, 1);
+ }
+ $this->search_query .= $word . ' ';
+ $this->tsearch_query .= '|' . $word . ' ';
+ }
+ }
+ else
+ {
+ $this->search_query = '';
+ $this->tsearch_query = '';
+ foreach ($this->split_words as $word)
+ {
+ if (strpos($word, '+') === 0)
+ {
+ $this->search_query .= $word . ' ';
+ $this->tsearch_query .= '&' . substr($word, 1) . ' ';
+ }
+ else if (strpos($word, '-') === 0)
+ {
+ $this->search_query .= $word . ' ';
+ $this->tsearch_query .= '&!' . substr($word, 1) . ' ';
+ }
+ else if (strpos($word, '|') === 0)
+ {
+ $this->search_query .= $word . ' ';
+ $this->tsearch_query .= '|' . substr($word, 1) . ' ';
+ }
+ else
+ {
+ $this->search_query .= '+' . $word . ' ';
+ $this->tsearch_query .= '&' . $word . ' ';
+ }
+ }
+ }
+
+ $this->tsearch_query = substr($this->tsearch_query, 1);
+ $this->search_query = utf8_htmlspecialchars($this->search_query);
+
+ if ($this->search_query)
+ {
+ $this->split_words = array_values($this->split_words);
+ sort($this->split_words);
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Turns text into an array of words
+ * @param string $text contains post text/subject
+ */
+ public function split_message($text)
+ {
+ // Split words
+ $text = preg_replace('#([^\p{L}\p{N}\'*])#u', '$1$1', str_replace('\'\'', '\' \'', trim($text)));
+ $matches = array();
+ preg_match_all('#(?:[^\p{L}\p{N}*]|^)([+\-|]?(?:[\p{L}\p{N}*]+\'?)*[\p{L}\p{N}*])(?:[^\p{L}\p{N}*]|$)#u', $text, $matches);
+ $text = $matches[1];
+
+ // remove too short or too long words
+ $text = array_values($text);
+ for ($i = 0, $n = sizeof($text); $i < $n; $i++)
+ {
+ $text[$i] = trim($text[$i]);
+ if (utf8_strlen($text[$i]) < $this->config['fulltext_postgres_min_word_len'] || utf8_strlen($text[$i]) > $this->config['fulltext_postgres_max_word_len'])
+ {
+ unset($text[$i]);
+ }
+ }
+
+ return array_values($text);
+ }
+
+ /**
+ * Performs a search on keywords depending on display specific params. You have to run split_keywords() first
+ *
+ * @param string $type contains either posts or topics depending on what should be searched for
+ * @param string $fields contains either titleonly (topic titles should be searched), msgonly (only message bodies should be searched), firstpost (only subject and body of the first post should be searched) or all (all post bodies and subjects should be searched)
+ * @param string $terms is either 'all' (use query as entered, words without prefix should default to "have to be in field") or 'any' (ignore search query parts and just return all posts that contain any of the specified words)
+ * @param array $sort_by_sql contains SQL code for the ORDER BY part of a query
+ * @param string $sort_key is the key of $sort_by_sql for the selected sorting
+ * @param string $sort_dir is either a or d representing ASC and DESC
+ * @param string $sort_days specifies the maximum amount of days a post may be old
+ * @param array $ex_fid_ary specifies an array of forum ids which should not be searched
+ * @param string $post_visibility specifies which types of posts the user can view in which forums
+ * @param int $topic_id is set to 0 or a topic id, if it is not 0 then only posts in this topic should be searched
+ * @param array $author_ary an array of author ids if the author should be ignored during the search the array is empty
+ * @param string $author_name specifies the author match, when ANONYMOUS is also a search-match
+ * @param array &$id_ary passed by reference, to be filled with ids for the page specified by $start and $per_page, should be ordered
+ * @param int $start indicates the first index of the page
+ * @param int $per_page number of ids each page is supposed to contain
+ * @return boolean|int total number of results
+ */
+ public function keyword_search($type, $fields, $terms, $sort_by_sql, $sort_key, $sort_dir, $sort_days, $ex_fid_ary, $post_visibility, $topic_id, $author_ary, $author_name, &$id_ary, &$start, $per_page)
+ {
+ // No keywords? No posts
+ if (!$this->search_query)
+ {
+ return false;
+ }
+
+ // When search query contains queries like -foo
+ if (strpos($this->search_query, '+') === false)
+ {
+ return false;
+ }
+
+ // generate a search_key from all the options to identify the results
+ $search_key_array = array(
+ implode(', ', $this->split_words),
+ $type,
+ $fields,
+ $terms,
+ $sort_days,
+ $sort_key,
+ $topic_id,
+ implode(',', $ex_fid_ary),
+ $post_visibility,
+ implode(',', $author_ary)
+ );
+
+ /**
+ * Allow changing the search_key for cached results
+ *
+ * @event core.search_postgres_by_keyword_modify_search_key
+ * @var array search_key_array Array with search parameters to generate the search_key
+ * @var string type Searching type ('posts', 'topics')
+ * @var string fields Searching fields ('titleonly', 'msgonly', 'firstpost', 'all')
+ * @var string terms Searching terms ('all', 'any')
+ * @var int sort_days Time, in days, of the oldest possible post to list
+ * @var string sort_key The sort type used from the possible sort types
+ * @var int topic_id Limit the search to this topic_id only
+ * @var array ex_fid_ary Which forums not to search on
+ * @var string post_visibility Post visibility data
+ * @var array author_ary Array of user_id containing the users to filter the results to
+ * @since 3.1.7-RC1
+ */
+ $vars = array(
+ 'search_key_array',
+ 'type',
+ 'fields',
+ 'terms',
+ 'sort_days',
+ 'sort_key',
+ 'topic_id',
+ 'ex_fid_ary',
+ 'post_visibility',
+ 'author_ary',
+ );
+ extract($this->phpbb_dispatcher->trigger_event('core.search_postgres_by_keyword_modify_search_key', compact($vars)));
+
+ $search_key = md5(implode('#', $search_key_array));
+
+ if ($start < 0)
+ {
+ $start = 0;
+ }
+
+ // try reading the results from cache
+ $result_count = 0;
+ if ($this->obtain_ids($search_key, $result_count, $id_ary, $start, $per_page, $sort_dir) == SEARCH_RESULT_IN_CACHE)
+ {
+ return $result_count;
+ }
+
+ $id_ary = array();
+
+ $join_topic = ($type == 'posts') ? false : true;
+
+ // Build sql strings for sorting
+ $sql_sort = $sort_by_sql[$sort_key] . (($sort_dir == 'a') ? ' ASC' : ' DESC');
+ $sql_sort_table = $sql_sort_join = '';
+
+ switch ($sql_sort[0])
+ {
+ case 'u':
+ $sql_sort_table = USERS_TABLE . ' u, ';
+ $sql_sort_join = ($type == 'posts') ? ' AND u.user_id = p.poster_id ' : ' AND u.user_id = t.topic_poster ';
+ break;
+
+ case 't':
+ $join_topic = true;
+ break;
+
+ case 'f':
+ $sql_sort_table = FORUMS_TABLE . ' f, ';
+ $sql_sort_join = ' AND f.forum_id = p.forum_id ';
+ break;
+ }
+
+ // Build some display specific sql strings
+ switch ($fields)
+ {
+ case 'titleonly':
+ $sql_match = 'p.post_subject';
+ $sql_match_where = ' AND p.post_id = t.topic_first_post_id';
+ $join_topic = true;
+ break;
+
+ case 'msgonly':
+ $sql_match = 'p.post_text';
+ $sql_match_where = '';
+ break;
+
+ case 'firstpost':
+ $sql_match = 'p.post_subject, p.post_text';
+ $sql_match_where = ' AND p.post_id = t.topic_first_post_id';
+ $join_topic = true;
+ break;
+
+ default:
+ $sql_match = 'p.post_subject, p.post_text';
+ $sql_match_where = '';
+ break;
+ }
+
+ $tsearch_query = $this->tsearch_query;
+
+ /**
+ * Allow changing the query used to search for posts using fulltext_postgres
+ *
+ * @event core.search_postgres_keywords_main_query_before
+ * @var string tsearch_query The parsed keywords used for this search
+ * @var int result_count The previous result count for the format of the query.
+ * Set to 0 to force a re-count
+ * @var bool join_topic Weather or not TOPICS_TABLE should be CROSS JOIN'ED
+ * @var array author_ary Array of user_id containing the users to filter the results to
+ * @var string author_name An extra username to search on (!empty(author_ary) must be true, to be relevant)
+ * @var array ex_fid_ary Which forums not to search on
+ * @var int topic_id Limit the search to this topic_id only
+ * @var string sql_sort_table Extra tables to include in the SQL query.
+ * Used in conjunction with sql_sort_join
+ * @var string sql_sort_join SQL conditions to join all the tables used together.
+ * Used in conjunction with sql_sort_table
+ * @var int sort_days Time, in days, of the oldest possible post to list
+ * @var string sql_match Which columns to do the search on.
+ * @var string sql_match_where Extra conditions to use to properly filter the matching process
+ * @var string sort_by_sql The possible predefined sort types
+ * @var string sort_key The sort type used from the possible sort types
+ * @var string sort_dir "a" for ASC or "d" dor DESC for the sort order used
+ * @var string sql_sort The result SQL when processing sort_by_sql + sort_key + sort_dir
+ * @var int start How many posts to skip in the search results (used for pagination)
+ * @since 3.1.5-RC1
+ */
+ $vars = array(
+ 'tsearch_query',
+ 'result_count',
+ 'join_topic',
+ 'author_ary',
+ 'author_name',
+ 'ex_fid_ary',
+ 'topic_id',
+ 'sql_sort_table',
+ 'sql_sort_join',
+ 'sort_days',
+ 'sql_match',
+ 'sql_match_where',
+ 'sort_by_sql',
+ 'sort_key',
+ 'sort_dir',
+ 'sql_sort',
+ 'start',
+ );
+ extract($this->phpbb_dispatcher->trigger_event('core.search_postgres_keywords_main_query_before', compact($vars)));
+
+ $sql_select = ($type == 'posts') ? 'p.post_id' : 'DISTINCT t.topic_id';
+ $sql_from = ($join_topic) ? TOPICS_TABLE . ' t, ' : '';
+ $field = ($type == 'posts') ? 'post_id' : 'topic_id';
+ $sql_author = (sizeof($author_ary) == 1) ? ' = ' . $author_ary[0] : 'IN (' . implode(', ', $author_ary) . ')';
+
+ if (sizeof($author_ary) && $author_name)
+ {
+ // first one matches post of registered users, second one guests and deleted users
+ $sql_author = '(' . $this->db->sql_in_set('p.poster_id', array_diff($author_ary, array(ANONYMOUS)), false, true) . ' OR p.post_username ' . $author_name . ')';
+ }
+ else if (sizeof($author_ary))
+ {
+ $sql_author = ' AND ' . $this->db->sql_in_set('p.poster_id', $author_ary);
+ }
+ else
+ {
+ $sql_author = '';
+ }
+
+ $sql_where_options = $sql_sort_join;
+ $sql_where_options .= ($topic_id) ? ' AND p.topic_id = ' . $topic_id : '';
+ $sql_where_options .= ($join_topic) ? ' AND t.topic_id = p.topic_id' : '';
+ $sql_where_options .= (sizeof($ex_fid_ary)) ? ' AND ' . $this->db->sql_in_set('p.forum_id', $ex_fid_ary, true) : '';
+ $sql_where_options .= ' AND ' . $post_visibility;
+ $sql_where_options .= $sql_author;
+ $sql_where_options .= ($sort_days) ? ' AND p.post_time >= ' . (time() - ($sort_days * 86400)) : '';
+ $sql_where_options .= $sql_match_where;
+
+ $tmp_sql_match = array();
+ $sql_match = str_replace(',', " || ' ' ||", $sql_match);
+ $tmp_sql_match = "to_tsvector ('" . $this->db->sql_escape($this->config['fulltext_postgres_ts_name']) . "', " . $sql_match . ") @@ to_tsquery ('" . $this->db->sql_escape($this->config['fulltext_postgres_ts_name']) . "', '" . $this->db->sql_escape($this->tsearch_query) . "')";
+
+ $this->db->sql_transaction('begin');
+
+ $sql_from = "FROM $sql_from$sql_sort_table" . POSTS_TABLE . " p";
+ $sql_where = "WHERE (" . $tmp_sql_match . ")
+ $sql_where_options";
+ $sql = "SELECT $sql_select
+ $sql_from
+ $sql_where
+ ORDER BY $sql_sort";
+ $result = $this->db->sql_query_limit($sql, $this->config['search_block_size'], $start);
+
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $id_ary[] = $row[$field];
+ }
+ $this->db->sql_freeresult($result);
+
+ $id_ary = array_unique($id_ary);
+
+ // if the total result count is not cached yet, retrieve it from the db
+ if (!$result_count)
+ {
+ $sql_count = "SELECT COUNT(*) as result_count
+ $sql_from
+ $sql_where";
+ $result = $this->db->sql_query($sql_count);
+ $result_count = (int) $this->db->sql_fetchfield('result_count');
+ $this->db->sql_freeresult($result);
+
+ if (!$result_count)
+ {
+ return false;
+ }
+ }
+
+ $this->db->sql_transaction('commit');
+
+ if ($start >= $result_count)
+ {
+ $start = floor(($result_count - 1) / $per_page) * $per_page;
+
+ $result = $this->db->sql_query_limit($sql, $this->config['search_block_size'], $start);
+
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $id_ary[] = $row[$field];
+ }
+ $this->db->sql_freeresult($result);
+
+ $id_ary = array_unique($id_ary);
+ }
+
+ // store the ids, from start on then delete anything that isn't on the current page because we only need ids for one page
+ $this->save_ids($search_key, implode(' ', $this->split_words), $author_ary, $result_count, $id_ary, $start, $sort_dir);
+ $id_ary = array_slice($id_ary, 0, (int) $per_page);
+
+ return $result_count;
+ }
+
+ /**
+ * Performs a search on an author's posts without caring about message contents. Depends on display specific params
+ *
+ * @param string $type contains either posts or topics depending on what should be searched for
+ * @param boolean $firstpost_only if true, only topic starting posts will be considered
+ * @param array $sort_by_sql contains SQL code for the ORDER BY part of a query
+ * @param string $sort_key is the key of $sort_by_sql for the selected sorting
+ * @param string $sort_dir is either a or d representing ASC and DESC
+ * @param string $sort_days specifies the maximum amount of days a post may be old
+ * @param array $ex_fid_ary specifies an array of forum ids which should not be searched
+ * @param string $post_visibility specifies which types of posts the user can view in which forums
+ * @param int $topic_id is set to 0 or a topic id, if it is not 0 then only posts in this topic should be searched
+ * @param array $author_ary an array of author ids
+ * @param string $author_name specifies the author match, when ANONYMOUS is also a search-match
+ * @param array &$id_ary passed by reference, to be filled with ids for the page specified by $start and $per_page, should be ordered
+ * @param int $start indicates the first index of the page
+ * @param int $per_page number of ids each page is supposed to contain
+ * @return boolean|int total number of results
+ */
+ public function author_search($type, $firstpost_only, $sort_by_sql, $sort_key, $sort_dir, $sort_days, $ex_fid_ary, $post_visibility, $topic_id, $author_ary, $author_name, &$id_ary, &$start, $per_page)
+ {
+ // No author? No posts
+ if (!sizeof($author_ary))
+ {
+ return 0;
+ }
+
+ // generate a search_key from all the options to identify the results
+ $search_key_array = array(
+ '',
+ $type,
+ ($firstpost_only) ? 'firstpost' : '',
+ '',
+ '',
+ $sort_days,
+ $sort_key,
+ $topic_id,
+ implode(',', $ex_fid_ary),
+ $post_visibility,
+ implode(',', $author_ary),
+ $author_name,
+ );
+
+ /**
+ * Allow changing the search_key for cached results
+ *
+ * @event core.search_postgres_by_author_modify_search_key
+ * @var array search_key_array Array with search parameters to generate the search_key
+ * @var string type Searching type ('posts', 'topics')
+ * @var boolean firstpost_only Flag indicating if only topic starting posts are considered
+ * @var int sort_days Time, in days, of the oldest possible post to list
+ * @var string sort_key The sort type used from the possible sort types
+ * @var int topic_id Limit the search to this topic_id only
+ * @var array ex_fid_ary Which forums not to search on
+ * @var string post_visibility Post visibility data
+ * @var array author_ary Array of user_id containing the users to filter the results to
+ * @var string author_name The username to search on
+ * @since 3.1.7-RC1
+ */
+ $vars = array(
+ 'search_key_array',
+ 'type',
+ 'firstpost_only',
+ 'sort_days',
+ 'sort_key',
+ 'topic_id',
+ 'ex_fid_ary',
+ 'post_visibility',
+ 'author_ary',
+ 'author_name',
+ );
+ extract($this->phpbb_dispatcher->trigger_event('core.search_postgres_by_author_modify_search_key', compact($vars)));
+
+ $search_key = md5(implode('#', $search_key_array));
+
+ if ($start < 0)
+ {
+ $start = 0;
+ }
+
+ // try reading the results from cache
+ $result_count = 0;
+ if ($this->obtain_ids($search_key, $result_count, $id_ary, $start, $per_page, $sort_dir) == SEARCH_RESULT_IN_CACHE)
+ {
+ return $result_count;
+ }
+
+ $id_ary = array();
+
+ // Create some display specific sql strings
+ if ($author_name)
+ {
+ // first one matches post of registered users, second one guests and deleted users
+ $sql_author = '(' . $this->db->sql_in_set('p.poster_id', array_diff($author_ary, array(ANONYMOUS)), false, true) . ' OR p.post_username ' . $author_name . ')';
+ }
+ else
+ {
+ $sql_author = $this->db->sql_in_set('p.poster_id', $author_ary);
+ }
+ $sql_fora = (sizeof($ex_fid_ary)) ? ' AND ' . $this->db->sql_in_set('p.forum_id', $ex_fid_ary, true) : '';
+ $sql_topic_id = ($topic_id) ? ' AND p.topic_id = ' . (int) $topic_id : '';
+ $sql_time = ($sort_days) ? ' AND p.post_time >= ' . (time() - ($sort_days * 86400)) : '';
+ $sql_firstpost = ($firstpost_only) ? ' AND p.post_id = t.topic_first_post_id' : '';
+
+ // Build sql strings for sorting
+ $sql_sort = $sort_by_sql[$sort_key] . (($sort_dir == 'a') ? ' ASC' : ' DESC');
+ $sql_sort_table = $sql_sort_join = '';
+ switch ($sql_sort[0])
+ {
+ case 'u':
+ $sql_sort_table = USERS_TABLE . ' u, ';
+ $sql_sort_join = ($type == 'posts') ? ' AND u.user_id = p.poster_id ' : ' AND u.user_id = t.topic_poster ';
+ break;
+
+ case 't':
+ $sql_sort_table = ($type == 'posts' && !$firstpost_only) ? TOPICS_TABLE . ' t, ' : '';
+ $sql_sort_join = ($type == 'posts' && !$firstpost_only) ? ' AND t.topic_id = p.topic_id ' : '';
+ break;
+
+ case 'f':
+ $sql_sort_table = FORUMS_TABLE . ' f, ';
+ $sql_sort_join = ' AND f.forum_id = p.forum_id ';
+ break;
+ }
+
+ $m_approve_fid_sql = ' AND ' . $post_visibility;
+
+ /**
+ * Allow changing the query used to search for posts by author in fulltext_postgres
+ *
+ * @event core.search_postgres_author_count_query_before
+ * @var int result_count The previous result count for the format of the query.
+ * Set to 0 to force a re-count
+ * @var string sql_sort_table CROSS JOIN'ed table to allow doing the sort chosen
+ * @var string sql_sort_join Condition to define how to join the CROSS JOIN'ed table specifyed in sql_sort_table
+ * @var array author_ary Array of user_id containing the users to filter the results to
+ * @var string author_name An extra username to search on
+ * @var string sql_author SQL WHERE condition for the post author ids
+ * @var int topic_id Limit the search to this topic_id only
+ * @var string sql_topic_id SQL of topic_id
+ * @var string sort_by_sql The possible predefined sort types
+ * @var string sort_key The sort type used from the possible sort types
+ * @var string sort_dir "a" for ASC or "d" dor DESC for the sort order used
+ * @var string sql_sort The result SQL when processing sort_by_sql + sort_key + sort_dir
+ * @var string sort_days Time, in days, that the oldest post showing can have
+ * @var string sql_time The SQL to search on the time specifyed by sort_days
+ * @var bool firstpost_only Wether or not to search only on the first post of the topics
+ * @var array ex_fid_ary Forum ids that must not be searched on
+ * @var array sql_fora SQL query for ex_fid_ary
+ * @var string m_approve_fid_sql WHERE clause condition on post_visibility restrictions
+ * @var int start How many posts to skip in the search results (used for pagination)
+ * @since 3.1.5-RC1
+ */
+ $vars = array(
+ 'result_count',
+ 'sql_sort_table',
+ 'sql_sort_join',
+ 'author_ary',
+ 'author_name',
+ 'sql_author',
+ 'topic_id',
+ 'sql_topic_id',
+ 'sort_by_sql',
+ 'sort_key',
+ 'sort_dir',
+ 'sql_sort',
+ 'sort_days',
+ 'sql_time',
+ 'firstpost_only',
+ 'ex_fid_ary',
+ 'sql_fora',
+ 'm_approve_fid_sql',
+ 'start',
+ );
+ extract($this->phpbb_dispatcher->trigger_event('core.search_postgres_author_count_query_before', compact($vars)));
+
+ // Build the query for really selecting the post_ids
+ if ($type == 'posts')
+ {
+ $sql = "SELECT p.post_id
+ FROM " . $sql_sort_table . POSTS_TABLE . ' p' . (($firstpost_only) ? ', ' . TOPICS_TABLE . ' t ' : ' ') . "
+ WHERE $sql_author
+ $sql_topic_id
+ $sql_firstpost
+ $m_approve_fid_sql
+ $sql_fora
+ $sql_sort_join
+ $sql_time
+ ORDER BY $sql_sort";
+ $field = 'post_id';
+ }
+ else
+ {
+ $sql = "SELECT t.topic_id
+ FROM " . $sql_sort_table . TOPICS_TABLE . ' t, ' . POSTS_TABLE . " p
+ WHERE $sql_author
+ $sql_topic_id
+ $sql_firstpost
+ $m_approve_fid_sql
+ $sql_fora
+ AND t.topic_id = p.topic_id
+ $sql_sort_join
+ $sql_time
+ GROUP BY t.topic_id, $sort_by_sql[$sort_key]
+ ORDER BY $sql_sort";
+ $field = 'topic_id';
+ }
+
+ $this->db->sql_transaction('begin');
+
+ // Only read one block of posts from the db and then cache it
+ $result = $this->db->sql_query_limit($sql, $this->config['search_block_size'], $start);
+
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $id_ary[] = $row[$field];
+ }
+ $this->db->sql_freeresult($result);
+
+ // retrieve the total result count if needed
+ if (!$result_count)
+ {
+ if ($type == 'posts')
+ {
+ $sql_count = "SELECT COUNT(*) as result_count
+ FROM " . $sql_sort_table . POSTS_TABLE . ' p' . (($firstpost_only) ? ', ' . TOPICS_TABLE . ' t ' : ' ') . "
+ WHERE $sql_author
+ $sql_topic_id
+ $sql_firstpost
+ $m_approve_fid_sql
+ $sql_fora
+ $sql_sort_join
+ $sql_time";
+ }
+ else
+ {
+ $sql_count = "SELECT COUNT(*) as result_count
+ FROM " . $sql_sort_table . TOPICS_TABLE . ' t, ' . POSTS_TABLE . " p
+ WHERE $sql_author
+ $sql_topic_id
+ $sql_firstpost
+ $m_approve_fid_sql
+ $sql_fora
+ AND t.topic_id = p.topic_id
+ $sql_sort_join
+ $sql_time
+ GROUP BY t.topic_id, $sort_by_sql[$sort_key]";
+ }
+
+ $result = $this->db->sql_query($sql_count);
+ $result_count = (int) $this->db->sql_fetchfield('result_count');
+
+ if (!$result_count)
+ {
+ return false;
+ }
+ }
+
+ $this->db->sql_transaction('commit');
+
+ if ($start >= $result_count)
+ {
+ $start = floor(($result_count - 1) / $per_page) * $per_page;
+
+ $result = $this->db->sql_query_limit($sql, $this->config['search_block_size'], $start);
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $id_ary[] = (int) $row[$field];
+ }
+ $this->db->sql_freeresult($result);
+
+ $id_ary = array_unique($id_ary);
+ }
+
+ if (sizeof($id_ary))
+ {
+ $this->save_ids($search_key, '', $author_ary, $result_count, $id_ary, $start, $sort_dir);
+ $id_ary = array_slice($id_ary, 0, $per_page);
+
+ return $result_count;
+ }
+ return false;
+ }
+
+ /**
+ * Destroys cached search results, that contained one of the new words in a post so the results won't be outdated
+ *
+ * @param string $mode contains the post mode: edit, post, reply, quote ...
+ * @param int $post_id contains the post id of the post to index
+ * @param string $message contains the post text of the post
+ * @param string $subject contains the subject of the post to index
+ * @param int $poster_id contains the user id of the poster
+ * @param int $forum_id contains the forum id of parent forum of the post
+ */
+ public function index($mode, $post_id, &$message, &$subject, $poster_id, $forum_id)
+ {
+ // Split old and new post/subject to obtain array of words
+ $split_text = $this->split_message($message);
+ $split_title = ($subject) ? $this->split_message($subject) : array();
+
+ $words = array_unique(array_merge($split_text, $split_title));
+
+ unset($split_text);
+ unset($split_title);
+
+ // destroy cached search results containing any of the words removed or added
+ $this->destroy_cache($words, array($poster_id));
+
+ unset($words);
+ }
+
+ /**
+ * Destroy cached results, that might be outdated after deleting a post
+ */
+ public function index_remove($post_ids, $author_ids, $forum_ids)
+ {
+ $this->destroy_cache(array(), $author_ids);
+ }
+
+ /**
+ * Destroy old cache entries
+ */
+ public function tidy()
+ {
+ // destroy too old cached search results
+ $this->destroy_cache(array());
+
+ set_config('search_last_gc', time(), true);
+ }
+
+ /**
+ * Create fulltext index
+ *
+ * @return string|bool error string is returned incase of errors otherwise false
+ */
+ public function create_index($acp_module, $u_action)
+ {
+ // Make sure we can actually use PostgreSQL with fulltext indexes
+ if ($error = $this->init())
+ {
+ return $error;
+ }
+
+ if (empty($this->stats))
+ {
+ $this->get_stats();
+ }
+
+ if (!isset($this->stats['post_subject']))
+ {
+ $this->db->sql_query("CREATE INDEX " . POSTS_TABLE . "_" . $this->config['fulltext_postgres_ts_name'] . "_post_subject ON " . POSTS_TABLE . " USING gin (to_tsvector ('" . $this->db->sql_escape($this->config['fulltext_postgres_ts_name']) . "', post_subject))");
+ }
+
+ if (!isset($this->stats['post_content']))
+ {
+ $this->db->sql_query("CREATE INDEX " . POSTS_TABLE . "_" . $this->config['fulltext_postgres_ts_name'] . "_post_content ON " . POSTS_TABLE . " USING gin (to_tsvector ('" . $this->db->sql_escape($this->config['fulltext_postgres_ts_name']) . "', post_text || ' ' || post_subject))");
+ }
+
+ $this->db->sql_query('TRUNCATE TABLE ' . SEARCH_RESULTS_TABLE);
+
+ return false;
+ }
+
+ /**
+ * Drop fulltext index
+ *
+ * @return string|bool error string is returned incase of errors otherwise false
+ */
+ public function delete_index($acp_module, $u_action)
+ {
+ // Make sure we can actually use PostgreSQL with fulltext indexes
+ if ($error = $this->init())
+ {
+ return $error;
+ }
+
+ if (empty($this->stats))
+ {
+ $this->get_stats();
+ }
+
+ if (isset($this->stats['post_subject']))
+ {
+ $this->db->sql_query('DROP INDEX ' . $this->stats['post_subject']['relname']);
+ }
+
+ if (isset($this->stats['post_content']))
+ {
+ $this->db->sql_query('DROP INDEX ' . $this->stats['post_content']['relname']);
+ }
+
+ $this->db->sql_query('TRUNCATE TABLE ' . SEARCH_RESULTS_TABLE);
+
+ return false;
+ }
+
+ /**
+ * Returns true if both FULLTEXT indexes exist
+ */
+ public function index_created()
+ {
+ if (empty($this->stats))
+ {
+ $this->get_stats();
+ }
+
+ return (isset($this->stats['post_subject']) && isset($this->stats['post_content'])) ? true : false;
+ }
+
+ /**
+ * Returns an associative array containing information about the indexes
+ */
+ public function index_stats()
+ {
+ if (empty($this->stats))
+ {
+ $this->get_stats();
+ }
+
+ return array(
+ $this->user->lang['FULLTEXT_POSTGRES_TOTAL_POSTS'] => ($this->index_created()) ? $this->stats['total_posts'] : 0,
+ );
+ }
+
+ /**
+ * Computes the stats and store them in the $this->stats associative array
+ */
+ protected function get_stats()
+ {
+ if ($this->db->get_sql_layer() != 'postgres')
+ {
+ $this->stats = array();
+ return;
+ }
+
+ $sql = "SELECT c2.relname, pg_catalog.pg_get_indexdef(i.indexrelid, 0, true) AS indexdef
+ FROM pg_catalog.pg_class c1, pg_catalog.pg_index i, pg_catalog.pg_class c2
+ WHERE c1.relname = '" . POSTS_TABLE . "'
+ AND pg_catalog.pg_table_is_visible(c1.oid)
+ AND c1.oid = i.indrelid
+ AND i.indexrelid = c2.oid";
+ $result = $this->db->sql_query($sql);
+
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ // deal with older PostgreSQL versions which didn't use Index_type
+ if (strpos($row['indexdef'], 'to_tsvector') !== false)
+ {
+ if ($row['relname'] == POSTS_TABLE . '_' . $this->config['fulltext_postgres_ts_name'] . '_post_subject' || $row['relname'] == POSTS_TABLE . '_post_subject')
+ {
+ $this->stats['post_subject'] = $row;
+ }
+ else if ($row['relname'] == POSTS_TABLE . '_' . $this->config['fulltext_postgres_ts_name'] . '_post_content' || $row['relname'] == POSTS_TABLE . '_post_content')
+ {
+ $this->stats['post_content'] = $row;
+ }
+ }
+ }
+ $this->db->sql_freeresult($result);
+
+ $this->stats['total_posts'] = $this->config['num_posts'];
+ }
+
+ /**
+ * Display various options that can be configured for the backend from the acp
+ *
+ * @return associative array containing template and config variables
+ */
+ public function acp()
+ {
+ $tpl = '
+ <dl>
+ <dt><label>' . $this->user->lang['FULLTEXT_POSTGRES_VERSION_CHECK'] . '</label><br /><span>' . $this->user->lang['FULLTEXT_POSTGRES_VERSION_CHECK_EXPLAIN'] . '</span></dt>
+ <dd>' . (($this->db->get_sql_layer() == 'postgres') ? $this->user->lang['YES'] : $this->user->lang['NO']) . '</dd>
+ </dl>
+ <dl>
+ <dt><label>' . $this->user->lang['FULLTEXT_POSTGRES_TS_NAME'] . '</label><br /><span>' . $this->user->lang['FULLTEXT_POSTGRES_TS_NAME_EXPLAIN'] . '</span></dt>
+ <dd><select name="config[fulltext_postgres_ts_name]">';
+
+ if ($this->db->get_sql_layer() == 'postgres')
+ {
+ $sql = 'SELECT cfgname AS ts_name
+ FROM pg_ts_config';
+ $result = $this->db->sql_query($sql);
+
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $tpl .= '<option value="' . $row['ts_name'] . '"' . ($row['ts_name'] === $this->config['fulltext_postgres_ts_name'] ? ' selected="selected"' : '') . '>' . $row['ts_name'] . '</option>';
+ }
+ $this->db->sql_freeresult($result);
+ }
+ else
+ {
+ $tpl .= '<option value="' . $this->config['fulltext_postgres_ts_name'] . '" selected="selected">' . $this->config['fulltext_postgres_ts_name'] . '</option>';
+ }
+
+ $tpl .= '</select></dd>
+ </dl>
+ <dl>
+ <dt><label for="fulltext_postgres_min_word_len">' . $this->user->lang['FULLTEXT_POSTGRES_MIN_WORD_LEN'] . $this->user->lang['COLON'] . '</label><br /><span>' . $this->user->lang['FULLTEXT_POSTGRES_MIN_WORD_LEN_EXPLAIN'] . '</span></dt>
+ <dd><input id="fulltext_postgres_min_word_len" type="number" min="0" max="255" name="config[fulltext_postgres_min_word_len]" value="' . (int) $this->config['fulltext_postgres_min_word_len'] . '" /></dd>
+ </dl>
+ <dl>
+ <dt><label for="fulltext_postgres_max_word_len">' . $this->user->lang['FULLTEXT_POSTGRES_MAX_WORD_LEN'] . $this->user->lang['COLON'] . '</label><br /><span>' . $this->user->lang['FULLTEXT_POSTGRES_MAX_WORD_LEN_EXPLAIN'] . '</span></dt>
+ <dd><input id="fulltext_postgres_max_word_len" type="number" min="0" max="255" name="config[fulltext_postgres_max_word_len]" value="' . (int) $this->config['fulltext_postgres_max_word_len'] . '" /></dd>
+ </dl>
+ ';
+
+ // These are fields required in the config table
+ return array(
+ 'tpl' => $tpl,
+ 'config' => array('fulltext_postgres_ts_name' => 'string', 'fulltext_postgres_min_word_len' => 'integer:0:255', 'fulltext_postgres_max_word_len' => 'integer:0:255')
+ );
+ }
+}
diff --git a/phpBB/phpbb/search/fulltext_sphinx.php b/phpBB/phpbb/search/fulltext_sphinx.php
new file mode 100644
index 0000000000..0dbc6e33df
--- /dev/null
+++ b/phpBB/phpbb/search/fulltext_sphinx.php
@@ -0,0 +1,973 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\search;
+
+define('SPHINX_MAX_MATCHES', 20000);
+define('SPHINX_CONNECT_RETRIES', 3);
+define('SPHINX_CONNECT_WAIT_TIME', 300);
+
+/**
+* Fulltext search based on the sphinx search deamon
+*/
+class fulltext_sphinx
+{
+ /**
+ * Associative array holding index stats
+ * @var array
+ */
+ protected $stats = array();
+
+ /**
+ * Holds the words entered by user, obtained by splitting the entered query on whitespace
+ * @var array
+ */
+ protected $split_words = array();
+
+ /**
+ * Holds unique sphinx id
+ * @var string
+ */
+ protected $id;
+
+ /**
+ * Stores the names of both main and delta sphinx indexes
+ * separated by a semicolon
+ * @var string
+ */
+ protected $indexes;
+
+ /**
+ * Sphinx searchd client object
+ * @var SphinxClient
+ */
+ protected $sphinx;
+
+ /**
+ * Relative path to board root
+ * @var string
+ */
+ protected $phpbb_root_path;
+
+ /**
+ * PHP Extension
+ * @var string
+ */
+ protected $php_ext;
+
+ /**
+ * Auth object
+ * @var \phpbb\auth\auth
+ */
+ protected $auth;
+
+ /**
+ * Config object
+ * @var \phpbb\config\config
+ */
+ protected $config;
+
+ /**
+ * Database connection
+ * @var \phpbb\db\driver\driver_interface
+ */
+ protected $db;
+
+ /**
+ * Database Tools object
+ * @var \phpbb\db\tools
+ */
+ protected $db_tools;
+
+ /**
+ * Stores the database type if supported by sphinx
+ * @var string
+ */
+ protected $dbtype;
+
+ /**
+ * phpBB event dispatcher object
+ * @var \phpbb\event\dispatcher_interface
+ */
+ protected $phpbb_dispatcher;
+
+ /**
+ * User object
+ * @var \phpbb\user
+ */
+ protected $user;
+
+ /**
+ * Stores the generated content of the sphinx config file
+ * @var string
+ */
+ protected $config_file_data = '';
+
+ /**
+ * Contains tidied search query.
+ * Operators are prefixed in search query and common words excluded
+ * @var string
+ */
+ protected $search_query;
+
+ /**
+ * Constructor
+ * Creates a new \phpbb\search\fulltext_postgres, which is used as a search backend
+ *
+ * @param string|bool $error Any error that occurs is passed on through this reference variable otherwise false
+ * @param string $phpbb_root_path Relative path to phpBB root
+ * @param string $phpEx PHP file extension
+ * @param \phpbb\auth\auth $auth Auth object
+ * @param \phpbb\config\config $config Config object
+ * @param \phpbb\db\driver\driver_interface Database object
+ * @param \phpbb\user $user User object
+ * @param \phpbb\event\dispatcher_interface $phpbb_dispatcher Event dispatcher object
+ */
+ public function __construct(&$error, $phpbb_root_path, $phpEx, $auth, $config, $db, $user, $phpbb_dispatcher)
+ {
+ $this->phpbb_root_path = $phpbb_root_path;
+ $this->php_ext = $phpEx;
+ $this->config = $config;
+ $this->phpbb_dispatcher = $phpbb_dispatcher;
+ $this->user = $user;
+ $this->db = $db;
+ $this->auth = $auth;
+
+ // Initialize \phpbb\db\tools object
+ $this->db_tools = new \phpbb\db\tools($this->db);
+
+ if (!$this->config['fulltext_sphinx_id'])
+ {
+ set_config('fulltext_sphinx_id', unique_id());
+ }
+ $this->id = $this->config['fulltext_sphinx_id'];
+ $this->indexes = 'index_phpbb_' . $this->id . '_delta;index_phpbb_' . $this->id . '_main';
+
+ if (!class_exists('SphinxClient'))
+ {
+ require($this->phpbb_root_path . 'includes/sphinxapi.' . $this->php_ext);
+ }
+
+ // Initialize sphinx client
+ $this->sphinx = new \SphinxClient();
+
+ $this->sphinx->SetServer(($this->config['fulltext_sphinx_host'] ? $this->config['fulltext_sphinx_host'] : 'localhost'), ($this->config['fulltext_sphinx_port'] ? (int) $this->config['fulltext_sphinx_port'] : 9312));
+
+ $error = false;
+ }
+
+ /**
+ * Returns the name of this search backend to be displayed to administrators
+ *
+ * @return string Name
+ */
+ public function get_name()
+ {
+ return 'Sphinx Fulltext';
+ }
+
+ /**
+ * Returns the search_query
+ *
+ * @return string search query
+ */
+ public function get_search_query()
+ {
+ return $this->search_query;
+ }
+
+ /**
+ * Returns false as there is no word_len array
+ *
+ * @return false
+ */
+ public function get_word_length()
+ {
+ return false;
+ }
+
+ /**
+ * Returns an empty array as there are no common_words
+ *
+ * @return array common words that are ignored by search backend
+ */
+ public function get_common_words()
+ {
+ return array();
+ }
+
+ /**
+ * Checks permissions and paths, if everything is correct it generates the config file
+ *
+ * @return string|bool Language key of the error/incompatiblity encountered, or false if successful
+ */
+ public function init()
+ {
+ if ($this->db->get_sql_layer() != 'mysql' && $this->db->get_sql_layer() != 'mysql4' && $this->db->get_sql_layer() != 'mysqli' && $this->db->get_sql_layer() != 'postgres')
+ {
+ return $this->user->lang['FULLTEXT_SPHINX_WRONG_DATABASE'];
+ }
+
+ // Move delta to main index each hour
+ set_config('search_gc', 3600);
+
+ return false;
+ }
+
+ /**
+ * Generates content of sphinx.conf
+ *
+ * @return bool True if sphinx.conf content is correctly generated, false otherwise
+ */
+ protected function config_generate()
+ {
+ // Check if Database is supported by Sphinx
+ if ($this->db->get_sql_layer() =='mysql' || $this->db->get_sql_layer() == 'mysql4' || $this->db->get_sql_layer() == 'mysqli')
+ {
+ $this->dbtype = 'mysql';
+ }
+ else if ($this->db->get_sql_layer() == 'postgres')
+ {
+ $this->dbtype = 'pgsql';
+ }
+ else
+ {
+ $this->config_file_data = $this->user->lang('FULLTEXT_SPHINX_WRONG_DATABASE');
+ return false;
+ }
+
+ // Check if directory paths have been filled
+ if (!$this->config['fulltext_sphinx_data_path'])
+ {
+ $this->config_file_data = $this->user->lang('FULLTEXT_SPHINX_NO_CONFIG_DATA');
+ return false;
+ }
+
+ include($this->phpbb_root_path . 'config.' . $this->php_ext);
+
+ /* Now that we're sure everything was entered correctly,
+ generate a config for the index. We use a config value
+ fulltext_sphinx_id for this, as it should be unique. */
+ $config_object = new \phpbb\search\sphinx\config($this->config_file_data);
+ $config_data = array(
+ 'source source_phpbb_' . $this->id . '_main' => array(
+ array('type', $this->dbtype . ' # mysql or pgsql'),
+ // This config value sql_host needs to be changed incase sphinx and sql are on different servers
+ array('sql_host', $dbhost . ' # SQL server host sphinx connects to'),
+ array('sql_user', '[dbuser]'),
+ array('sql_pass', '[dbpassword]'),
+ array('sql_db', $dbname),
+ array('sql_port', $dbport . ' # optional, default is 3306 for mysql and 5432 for pgsql'),
+ array('sql_query_pre', 'SET NAMES \'utf8\''),
+ array('sql_query_pre', 'UPDATE ' . SPHINX_TABLE . ' SET max_doc_id = (SELECT MAX(post_id) FROM ' . POSTS_TABLE . ') WHERE counter_id = 1'),
+ array('sql_query_range', 'SELECT MIN(post_id), MAX(post_id) FROM ' . POSTS_TABLE . ''),
+ array('sql_range_step', '5000'),
+ array('sql_query', 'SELECT
+ p.post_id AS id,
+ p.forum_id,
+ p.topic_id,
+ p.poster_id,
+ p.post_visibility,
+ CASE WHEN p.post_id = t.topic_first_post_id THEN 1 ELSE 0 END as topic_first_post,
+ p.post_time,
+ p.post_subject,
+ p.post_subject as title,
+ p.post_text as data,
+ t.topic_last_post_time,
+ 0 as deleted
+ FROM ' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . ' t
+ WHERE
+ p.topic_id = t.topic_id
+ AND p.post_id >= $start AND p.post_id <= $end'),
+ array('sql_query_post', ''),
+ array('sql_query_post_index', 'UPDATE ' . SPHINX_TABLE . ' SET max_doc_id = $maxid WHERE counter_id = 1'),
+ array('sql_query_info', 'SELECT * FROM ' . POSTS_TABLE . ' WHERE post_id = $id'),
+ array('sql_attr_uint', 'forum_id'),
+ array('sql_attr_uint', 'topic_id'),
+ array('sql_attr_uint', 'poster_id'),
+ array('sql_attr_uint', 'post_visibility'),
+ array('sql_attr_bool', 'topic_first_post'),
+ array('sql_attr_bool', 'deleted'),
+ array('sql_attr_timestamp', 'post_time'),
+ array('sql_attr_timestamp', 'topic_last_post_time'),
+ array('sql_attr_string', 'post_subject'),
+ ),
+ 'source source_phpbb_' . $this->id . '_delta : source_phpbb_' . $this->id . '_main' => array(
+ array('sql_query_pre', ''),
+ array('sql_query_range', ''),
+ array('sql_range_step', ''),
+ array('sql_query', 'SELECT
+ p.post_id AS id,
+ p.forum_id,
+ p.topic_id,
+ p.poster_id,
+ p.post_visibility,
+ CASE WHEN p.post_id = t.topic_first_post_id THEN 1 ELSE 0 END as topic_first_post,
+ p.post_time,
+ p.post_subject,
+ p.post_subject as title,
+ p.post_text as data,
+ t.topic_last_post_time,
+ 0 as deleted
+ FROM ' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . ' t
+ WHERE
+ p.topic_id = t.topic_id
+ AND p.post_id >= ( SELECT max_doc_id FROM ' . SPHINX_TABLE . ' WHERE counter_id=1 )'),
+ ),
+ 'index index_phpbb_' . $this->id . '_main' => array(
+ array('path', $this->config['fulltext_sphinx_data_path'] . 'index_phpbb_' . $this->id . '_main'),
+ array('source', 'source_phpbb_' . $this->id . '_main'),
+ array('docinfo', 'extern'),
+ array('morphology', 'none'),
+ array('stopwords', ''),
+ array('min_word_len', '2'),
+ array('charset_type', 'utf-8'),
+ array('charset_table', 'U+FF10..U+FF19->0..9, 0..9, U+FF41..U+FF5A->a..z, U+FF21..U+FF3A->a..z, A..Z->a..z, a..z, U+0149, U+017F, U+0138, U+00DF, U+00FF, U+00C0..U+00D6->U+00E0..U+00F6, U+00E0..U+00F6, U+00D8..U+00DE->U+00F8..U+00FE, U+00F8..U+00FE, U+0100->U+0101, U+0101, U+0102->U+0103, U+0103, U+0104->U+0105, U+0105, U+0106->U+0107, U+0107, U+0108->U+0109, U+0109, U+010A->U+010B, U+010B, U+010C->U+010D, U+010D, U+010E->U+010F, U+010F, U+0110->U+0111, U+0111, U+0112->U+0113, U+0113, U+0114->U+0115, U+0115, U+0116->U+0117, U+0117, U+0118->U+0119, U+0119, U+011A->U+011B, U+011B, U+011C->U+011D, U+011D, U+011E->U+011F, U+011F, U+0130->U+0131, U+0131, U+0132->U+0133, U+0133, U+0134->U+0135, U+0135, U+0136->U+0137, U+0137, U+0139->U+013A, U+013A, U+013B->U+013C, U+013C, U+013D->U+013E, U+013E, U+013F->U+0140, U+0140, U+0141->U+0142, U+0142, U+0143->U+0144, U+0144, U+0145->U+0146, U+0146, U+0147->U+0148, U+0148, U+014A->U+014B, U+014B, U+014C->U+014D, U+014D, U+014E->U+014F, U+014F, U+0150->U+0151, U+0151, U+0152->U+0153, U+0153, U+0154->U+0155, U+0155, U+0156->U+0157, U+0157, U+0158->U+0159, U+0159, U+015A->U+015B, U+015B, U+015C->U+015D, U+015D, U+015E->U+015F, U+015F, U+0160->U+0161, U+0161, U+0162->U+0163, U+0163, U+0164->U+0165, U+0165, U+0166->U+0167, U+0167, U+0168->U+0169, U+0169, U+016A->U+016B, U+016B, U+016C->U+016D, U+016D, U+016E->U+016F, U+016F, U+0170->U+0171, U+0171, U+0172->U+0173, U+0173, U+0174->U+0175, U+0175, U+0176->U+0177, U+0177, U+0178->U+00FF, U+00FF, U+0179->U+017A, U+017A, U+017B->U+017C, U+017C, U+017D->U+017E, U+017E, U+0410..U+042F->U+0430..U+044F, U+0430..U+044F, U+4E00..U+9FFF'),
+ array('min_prefix_len', '0'),
+ array('min_infix_len', '0'),
+ ),
+ 'index index_phpbb_' . $this->id . '_delta : index_phpbb_' . $this->id . '_main' => array(
+ array('path', $this->config['fulltext_sphinx_data_path'] . 'index_phpbb_' . $this->id . '_delta'),
+ array('source', 'source_phpbb_' . $this->id . '_delta'),
+ ),
+ 'indexer' => array(
+ array('mem_limit', $this->config['fulltext_sphinx_indexer_mem_limit'] . 'M'),
+ ),
+ 'searchd' => array(
+ array('compat_sphinxql_magics' , '0'),
+ array('listen' , ($this->config['fulltext_sphinx_host'] ? $this->config['fulltext_sphinx_host'] : 'localhost') . ':' . ($this->config['fulltext_sphinx_port'] ? $this->config['fulltext_sphinx_port'] : '9312')),
+ array('log', $this->config['fulltext_sphinx_data_path'] . 'log/searchd.log'),
+ array('query_log', $this->config['fulltext_sphinx_data_path'] . 'log/sphinx-query.log'),
+ array('read_timeout', '5'),
+ array('max_children', '30'),
+ array('pid_file', $this->config['fulltext_sphinx_data_path'] . 'searchd.pid'),
+ array('max_matches', (string) SPHINX_MAX_MATCHES),
+ array('binlog_path', $this->config['fulltext_sphinx_data_path']),
+ ),
+ );
+
+ $non_unique = array('sql_query_pre' => true, 'sql_attr_uint' => true, 'sql_attr_timestamp' => true, 'sql_attr_str2ordinal' => true, 'sql_attr_bool' => true);
+ $delete = array('sql_group_column' => true, 'sql_date_column' => true, 'sql_str2ordinal_column' => true);
+
+ /**
+ * Allow adding/changing the Sphinx configuration data
+ *
+ * @event core.search_sphinx_modify_config_data
+ * @var array config_data Array with the Sphinx configuration data
+ * @var array non_unique Array with the Sphinx non-unique variables to delete
+ * @var array delete Array with the Sphinx variables to delete
+ * @since 3.1.7-RC1
+ */
+ $vars = array(
+ 'config_data',
+ 'non_unique',
+ 'delete',
+ );
+ extract($this->phpbb_dispatcher->trigger_event('core.search_sphinx_modify_config_data', compact($vars)));
+
+ foreach ($config_data as $section_name => $section_data)
+ {
+ $section = $config_object->get_section_by_name($section_name);
+ if (!$section)
+ {
+ $section = $config_object->add_section($section_name);
+ }
+
+ foreach ($delete as $key => $void)
+ {
+ $section->delete_variables_by_name($key);
+ }
+
+ foreach ($non_unique as $key => $void)
+ {
+ $section->delete_variables_by_name($key);
+ }
+
+ foreach ($section_data as $entry)
+ {
+ $key = $entry[0];
+ $value = $entry[1];
+
+ if (!isset($non_unique[$key]))
+ {
+ $variable = $section->get_variable_by_name($key);
+ if (!$variable)
+ {
+ $variable = $section->create_variable($key, $value);
+ }
+ else
+ {
+ $variable->set_value($value);
+ }
+ }
+ else
+ {
+ $variable = $section->create_variable($key, $value);
+ }
+ }
+ }
+ $this->config_file_data = $config_object->get_data();
+
+ return true;
+ }
+
+ /**
+ * Splits keywords entered by a user into an array of words stored in $this->split_words
+ * Stores the tidied search query in $this->search_query
+ *
+ * @param string $keywords Contains the keyword as entered by the user
+ * @param string $terms is either 'all' or 'any'
+ * @return false if no valid keywords were found and otherwise true
+ */
+ public function split_keywords(&$keywords, $terms)
+ {
+ if ($terms == 'all')
+ {
+ $match = array('#\sand\s#i', '#\sor\s#i', '#\snot\s#i', '#\+#', '#-#', '#\|#', '#@#');
+ $replace = array(' & ', ' | ', ' - ', ' +', ' -', ' |', '');
+
+ $replacements = 0;
+ $keywords = preg_replace($match, $replace, $keywords);
+ $this->sphinx->SetMatchMode(SPH_MATCH_EXTENDED);
+ }
+ else
+ {
+ $this->sphinx->SetMatchMode(SPH_MATCH_ANY);
+ }
+
+ // Keep quotes and new lines
+ $keywords = str_replace(array('&quot;', "\n"), array('"', ' '), trim($keywords));
+
+ if (strlen($keywords) > 0)
+ {
+ $this->search_query = str_replace('"', '&quot;', $keywords);
+ return true;
+ }
+
+ return false;
+ }
+
+ /**
+ * Performs a search on keywords depending on display specific params. You have to run split_keywords() first
+ *
+ * @param string $type contains either posts or topics depending on what should be searched for
+ * @param string $fields contains either titleonly (topic titles should be searched), msgonly (only message bodies should be searched), firstpost (only subject and body of the first post should be searched) or all (all post bodies and subjects should be searched)
+ * @param string $terms is either 'all' (use query as entered, words without prefix should default to "have to be in field") or 'any' (ignore search query parts and just return all posts that contain any of the specified words)
+ * @param array $sort_by_sql contains SQL code for the ORDER BY part of a query
+ * @param string $sort_key is the key of $sort_by_sql for the selected sorting
+ * @param string $sort_dir is either a or d representing ASC and DESC
+ * @param string $sort_days specifies the maximum amount of days a post may be old
+ * @param array $ex_fid_ary specifies an array of forum ids which should not be searched
+ * @param string $post_visibility specifies which types of posts the user can view in which forums
+ * @param int $topic_id is set to 0 or a topic id, if it is not 0 then only posts in this topic should be searched
+ * @param array $author_ary an array of author ids if the author should be ignored during the search the array is empty
+ * @param string $author_name specifies the author match, when ANONYMOUS is also a search-match
+ * @param array &$id_ary passed by reference, to be filled with ids for the page specified by $start and $per_page, should be ordered
+ * @param int $start indicates the first index of the page
+ * @param int $per_page number of ids each page is supposed to contain
+ * @return boolean|int total number of results
+ */
+ public function keyword_search($type, $fields, $terms, $sort_by_sql, $sort_key, $sort_dir, $sort_days, $ex_fid_ary, $post_visibility, $topic_id, $author_ary, $author_name, &$id_ary, &$start, $per_page)
+ {
+ // No keywords? No posts.
+ if (!strlen($this->search_query) && !sizeof($author_ary))
+ {
+ return false;
+ }
+
+ $id_ary = array();
+
+ $join_topic = ($type != 'posts');
+
+ // Sorting
+
+ if ($type == 'topics')
+ {
+ switch ($sort_key)
+ {
+ case 'a':
+ $this->sphinx->SetGroupBy('topic_id', SPH_GROUPBY_ATTR, 'poster_id ' . (($sort_dir == 'a') ? 'ASC' : 'DESC'));
+ break;
+
+ case 'f':
+ $this->sphinx->SetGroupBy('topic_id', SPH_GROUPBY_ATTR, 'forum_id ' . (($sort_dir == 'a') ? 'ASC' : 'DESC'));
+ break;
+
+ case 'i':
+
+ case 's':
+ $this->sphinx->SetGroupBy('topic_id', SPH_GROUPBY_ATTR, 'post_subject ' . (($sort_dir == 'a') ? 'ASC' : 'DESC'));
+ break;
+
+ case 't':
+
+ default:
+ $this->sphinx->SetGroupBy('topic_id', SPH_GROUPBY_ATTR, 'topic_last_post_time ' . (($sort_dir == 'a') ? 'ASC' : 'DESC'));
+ break;
+ }
+ }
+ else
+ {
+ switch ($sort_key)
+ {
+ case 'a':
+ $this->sphinx->SetSortMode(($sort_dir == 'a') ? SPH_SORT_ATTR_ASC : SPH_SORT_ATTR_DESC, 'poster_id');
+ break;
+
+ case 'f':
+ $this->sphinx->SetSortMode(($sort_dir == 'a') ? SPH_SORT_ATTR_ASC : SPH_SORT_ATTR_DESC, 'forum_id');
+ break;
+
+ case 'i':
+
+ case 's':
+ $this->sphinx->SetSortMode(($sort_dir == 'a') ? SPH_SORT_ATTR_ASC : SPH_SORT_ATTR_DESC, 'post_subject');
+ break;
+
+ case 't':
+
+ default:
+ $this->sphinx->SetSortMode(($sort_dir == 'a') ? SPH_SORT_ATTR_ASC : SPH_SORT_ATTR_DESC, 'post_time');
+ break;
+ }
+ }
+
+ // Most narrow filters first
+ if ($topic_id)
+ {
+ $this->sphinx->SetFilter('topic_id', array($topic_id));
+ }
+
+ /**
+ * Allow modifying the Sphinx search options
+ *
+ * @event core.search_sphinx_keywords_modify_options
+ * @var string type Searching type ('posts', 'topics')
+ * @var string fields Searching fields ('titleonly', 'msgonly', 'firstpost', 'all')
+ * @var string terms Searching terms ('all', 'any')
+ * @var int sort_days Time, in days, of the oldest possible post to list
+ * @var string sort_key The sort type used from the possible sort types
+ * @var int topic_id Limit the search to this topic_id only
+ * @var array ex_fid_ary Which forums not to search on
+ * @var string post_visibility Post visibility data
+ * @var array author_ary Array of user_id containing the users to filter the results to
+ * @var string author_name The username to search on
+ * @var object sphinx The Sphinx searchd client object
+ * @since 3.1.7-RC1
+ */
+ $sphinx = $this->sphinx;
+ $vars = array(
+ 'type',
+ 'fields',
+ 'terms',
+ 'sort_days',
+ 'sort_key',
+ 'topic_id',
+ 'ex_fid_ary',
+ 'post_visibility',
+ 'author_ary',
+ 'author_name',
+ 'sphinx',
+ );
+ extract($this->phpbb_dispatcher->trigger_event('core.search_sphinx_keywords_modify_options', compact($vars)));
+ $this->sphinx = $sphinx;
+ unset($sphinx);
+
+ $search_query_prefix = '';
+
+ switch ($fields)
+ {
+ case 'titleonly':
+ // Only search the title
+ if ($terms == 'all')
+ {
+ $search_query_prefix = '@title ';
+ }
+ // Weight for the title
+ $this->sphinx->SetFieldWeights(array("title" => 5, "data" => 1));
+ // 1 is first_post, 0 is not first post
+ $this->sphinx->SetFilter('topic_first_post', array(1));
+ break;
+
+ case 'msgonly':
+ // Only search the body
+ if ($terms == 'all')
+ {
+ $search_query_prefix = '@data ';
+ }
+ // Weight for the body
+ $this->sphinx->SetFieldWeights(array("title" => 1, "data" => 5));
+ break;
+
+ case 'firstpost':
+ // More relative weight for the title, also search the body
+ $this->sphinx->SetFieldWeights(array("title" => 5, "data" => 1));
+ // 1 is first_post, 0 is not first post
+ $this->sphinx->SetFilter('topic_first_post', array(1));
+ break;
+
+ default:
+ // More relative weight for the title, also search the body
+ $this->sphinx->SetFieldWeights(array("title" => 5, "data" => 1));
+ break;
+ }
+
+ if (sizeof($author_ary))
+ {
+ $this->sphinx->SetFilter('poster_id', $author_ary);
+ }
+
+ // As this is not simply possible at the moment, we limit the result to approved posts.
+ // This will make it impossible for moderators to search unapproved and softdeleted posts,
+ // but at least it will also cause the same for normal users.
+ $this->sphinx->SetFilter('post_visibility', array(ITEM_APPROVED));
+
+ if (sizeof($ex_fid_ary))
+ {
+ // All forums that a user is allowed to access
+ $fid_ary = array_unique(array_intersect(array_keys($this->auth->acl_getf('f_read', true)), array_keys($this->auth->acl_getf('f_search', true))));
+ // All forums that the user wants to and can search in
+ $search_forums = array_diff($fid_ary, $ex_fid_ary);
+
+ if (sizeof($search_forums))
+ {
+ $this->sphinx->SetFilter('forum_id', $search_forums);
+ }
+ }
+
+ $this->sphinx->SetFilter('deleted', array(0));
+
+ $this->sphinx->SetLimits($start, (int) $per_page, SPHINX_MAX_MATCHES);
+ $result = $this->sphinx->Query($search_query_prefix . str_replace('&quot;', '"', $this->search_query), $this->indexes);
+
+ // Could be connection to localhost:9312 failed (errno=111,
+ // msg=Connection refused) during rotate, retry if so
+ $retries = SPHINX_CONNECT_RETRIES;
+ while (!$result && (strpos($this->sphinx->GetLastError(), "errno=111,") !== false) && $retries--)
+ {
+ usleep(SPHINX_CONNECT_WAIT_TIME);
+ $result = $this->sphinx->Query($search_query_prefix . str_replace('&quot;', '"', $this->search_query), $this->indexes);
+ }
+
+ if ($this->sphinx->GetLastError())
+ {
+ add_log('critical', 'LOG_SPHINX_ERROR', $this->sphinx->GetLastError());
+ if ($this->auth->acl_get('a_'))
+ {
+ trigger_error($this->user->lang('SPHINX_SEARCH_FAILED', $this->sphinx->GetLastError()));
+ }
+ else
+ {
+ trigger_error($this->user->lang('SPHINX_SEARCH_FAILED_LOG'));
+ }
+ }
+
+ $result_count = $result['total_found'];
+
+ if ($result_count && $start >= $result_count)
+ {
+ $start = floor(($result_count - 1) / $per_page) * $per_page;
+
+ $this->sphinx->SetLimits((int) $start, (int) $per_page, SPHINX_MAX_MATCHES);
+ $result = $this->sphinx->Query($search_query_prefix . str_replace('&quot;', '"', $this->search_query), $this->indexes);
+
+ // Could be connection to localhost:9312 failed (errno=111,
+ // msg=Connection refused) during rotate, retry if so
+ $retries = SPHINX_CONNECT_RETRIES;
+ while (!$result && (strpos($this->sphinx->GetLastError(), "errno=111,") !== false) && $retries--)
+ {
+ usleep(SPHINX_CONNECT_WAIT_TIME);
+ $result = $this->sphinx->Query($search_query_prefix . str_replace('&quot;', '"', $this->search_query), $this->indexes);
+ }
+ }
+
+ $id_ary = array();
+ if (isset($result['matches']))
+ {
+ if ($type == 'posts')
+ {
+ $id_ary = array_keys($result['matches']);
+ }
+ else
+ {
+ foreach ($result['matches'] as $key => $value)
+ {
+ $id_ary[] = $value['attrs']['topic_id'];
+ }
+ }
+ }
+ else
+ {
+ return false;
+ }
+
+ $id_ary = array_slice($id_ary, 0, (int) $per_page);
+
+ return $result_count;
+ }
+
+ /**
+ * Performs a search on an author's posts without caring about message contents. Depends on display specific params
+ *
+ * @param string $type contains either posts or topics depending on what should be searched for
+ * @param boolean $firstpost_only if true, only topic starting posts will be considered
+ * @param array $sort_by_sql contains SQL code for the ORDER BY part of a query
+ * @param string $sort_key is the key of $sort_by_sql for the selected sorting
+ * @param string $sort_dir is either a or d representing ASC and DESC
+ * @param string $sort_days specifies the maximum amount of days a post may be old
+ * @param array $ex_fid_ary specifies an array of forum ids which should not be searched
+ * @param string $post_visibility specifies which types of posts the user can view in which forums
+ * @param int $topic_id is set to 0 or a topic id, if it is not 0 then only posts in this topic should be searched
+ * @param array $author_ary an array of author ids
+ * @param string $author_name specifies the author match, when ANONYMOUS is also a search-match
+ * @param array &$id_ary passed by reference, to be filled with ids for the page specified by $start and $per_page, should be ordered
+ * @param int $start indicates the first index of the page
+ * @param int $per_page number of ids each page is supposed to contain
+ * @return boolean|int total number of results
+ */
+ public function author_search($type, $firstpost_only, $sort_by_sql, $sort_key, $sort_dir, $sort_days, $ex_fid_ary, $post_visibility, $topic_id, $author_ary, $author_name, &$id_ary, $start, $per_page)
+ {
+ $this->search_query = '';
+
+ $this->sphinx->SetMatchMode(SPH_MATCH_FULLSCAN);
+ $fields = ($firstpost_only) ? 'firstpost' : 'all';
+ $terms = 'all';
+ return $this->keyword_search($type, $fields, $terms, $sort_by_sql, $sort_key, $sort_dir, $sort_days, $ex_fid_ary, $post_visibility, $topic_id, $author_ary, $author_name, $id_ary, $start, $per_page);
+ }
+
+ /**
+ * Updates wordlist and wordmatch tables when a message is posted or changed
+ *
+ * @param string $mode Contains the post mode: edit, post, reply, quote
+ * @param int $post_id The id of the post which is modified/created
+ * @param string &$message New or updated post content
+ * @param string &$subject New or updated post subject
+ * @param int $poster_id Post author's user id
+ * @param int $forum_id The id of the forum in which the post is located
+ */
+ public function index($mode, $post_id, &$message, &$subject, $poster_id, $forum_id)
+ {
+ if ($mode == 'edit')
+ {
+ $this->sphinx->UpdateAttributes($this->indexes, array('forum_id', 'poster_id'), array((int) $post_id => array((int) $forum_id, (int) $poster_id)));
+ }
+ else if ($mode != 'post' && $post_id)
+ {
+ // Update topic_last_post_time for full topic
+ $sql_array = array(
+ 'SELECT' => 'p1.post_id',
+ 'FROM' => array(
+ POSTS_TABLE => 'p1',
+ ),
+ 'LEFT_JOIN' => array(array(
+ 'FROM' => array(
+ POSTS_TABLE => 'p2'
+ ),
+ 'ON' => 'p1.topic_id = p2.topic_id',
+ )),
+ 'WHERE' => 'p2.post_id = ' . ((int) $post_id),
+ );
+
+ $sql = $this->db->sql_build_query('SELECT', $sql_array);
+ $result = $this->db->sql_query($sql);
+
+ $post_updates = array();
+ $post_time = time();
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $post_updates[(int) $row['post_id']] = array($post_time);
+ }
+ $this->db->sql_freeresult($result);
+
+ if (sizeof($post_updates))
+ {
+ $this->sphinx->UpdateAttributes($this->indexes, array('topic_last_post_time'), $post_updates);
+ }
+ }
+ }
+
+ /**
+ * Delete a post from the index after it was deleted
+ */
+ public function index_remove($post_ids, $author_ids, $forum_ids)
+ {
+ $values = array();
+ foreach ($post_ids as $post_id)
+ {
+ $values[$post_id] = array(1);
+ }
+
+ $this->sphinx->UpdateAttributes($this->indexes, array('deleted'), $values);
+ }
+
+ /**
+ * Nothing needs to be destroyed
+ */
+ public function tidy($create = false)
+ {
+ set_config('search_last_gc', time(), true);
+ }
+
+ /**
+ * Create sphinx table
+ *
+ * @return string|bool error string is returned incase of errors otherwise false
+ */
+ public function create_index($acp_module, $u_action)
+ {
+ if (!$this->index_created())
+ {
+ $table_data = array(
+ 'COLUMNS' => array(
+ 'counter_id' => array('UINT', 0),
+ 'max_doc_id' => array('UINT', 0),
+ ),
+ 'PRIMARY_KEY' => 'counter_id',
+ );
+ $this->db_tools->sql_create_table(SPHINX_TABLE, $table_data);
+
+ $sql = 'TRUNCATE TABLE ' . SPHINX_TABLE;
+ $this->db->sql_query($sql);
+
+ $data = array(
+ 'counter_id' => '1',
+ 'max_doc_id' => '0',
+ );
+ $sql = 'INSERT INTO ' . SPHINX_TABLE . ' ' . $this->db->sql_build_array('INSERT', $data);
+ $this->db->sql_query($sql);
+ }
+
+ return false;
+ }
+
+ /**
+ * Drop sphinx table
+ *
+ * @return string|bool error string is returned incase of errors otherwise false
+ */
+ public function delete_index($acp_module, $u_action)
+ {
+ if (!$this->index_created())
+ {
+ return false;
+ }
+
+ $this->db_tools->sql_table_drop(SPHINX_TABLE);
+
+ return false;
+ }
+
+ /**
+ * Returns true if the sphinx table was created
+ *
+ * @return bool true if sphinx table was created
+ */
+ public function index_created($allow_new_files = true)
+ {
+ $created = false;
+
+ if ($this->db_tools->sql_table_exists(SPHINX_TABLE))
+ {
+ $created = true;
+ }
+
+ return $created;
+ }
+
+ /**
+ * Returns an associative array containing information about the indexes
+ *
+ * @return string|bool Language string of error false otherwise
+ */
+ public function index_stats()
+ {
+ if (empty($this->stats))
+ {
+ $this->get_stats();
+ }
+
+ return array(
+ $this->user->lang['FULLTEXT_SPHINX_MAIN_POSTS'] => ($this->index_created()) ? $this->stats['main_posts'] : 0,
+ $this->user->lang['FULLTEXT_SPHINX_DELTA_POSTS'] => ($this->index_created()) ? $this->stats['total_posts'] - $this->stats['main_posts'] : 0,
+ $this->user->lang['FULLTEXT_MYSQL_TOTAL_POSTS'] => ($this->index_created()) ? $this->stats['total_posts'] : 0,
+ );
+ }
+
+ /**
+ * Collects stats that can be displayed on the index maintenance page
+ */
+ protected function get_stats()
+ {
+ if ($this->index_created())
+ {
+ $sql = 'SELECT COUNT(post_id) as total_posts
+ FROM ' . POSTS_TABLE;
+ $result = $this->db->sql_query($sql);
+ $this->stats['total_posts'] = (int) $this->db->sql_fetchfield('total_posts');
+ $this->db->sql_freeresult($result);
+
+ $sql = 'SELECT COUNT(p.post_id) as main_posts
+ FROM ' . POSTS_TABLE . ' p, ' . SPHINX_TABLE . ' m
+ WHERE p.post_id <= m.max_doc_id
+ AND m.counter_id = 1';
+ $result = $this->db->sql_query($sql);
+ $this->stats['main_posts'] = (int) $this->db->sql_fetchfield('main_posts');
+ $this->db->sql_freeresult($result);
+ }
+ }
+
+ /**
+ * Returns a list of options for the ACP to display
+ *
+ * @return associative array containing template and config variables
+ */
+ public function acp()
+ {
+ $config_vars = array(
+ 'fulltext_sphinx_data_path' => 'string',
+ 'fulltext_sphinx_host' => 'string',
+ 'fulltext_sphinx_port' => 'string',
+ 'fulltext_sphinx_indexer_mem_limit' => 'int',
+ );
+
+ $tpl = '
+ <span class="error">' . $this->user->lang['FULLTEXT_SPHINX_CONFIGURE']. '</span>
+ <dl>
+ <dt><label for="fulltext_sphinx_data_path">' . $this->user->lang['FULLTEXT_SPHINX_DATA_PATH'] . $this->user->lang['COLON'] . '</label><br /><span>' . $this->user->lang['FULLTEXT_SPHINX_DATA_PATH_EXPLAIN'] . '</span></dt>
+ <dd><input id="fulltext_sphinx_data_path" type="text" size="40" maxlength="255" name="config[fulltext_sphinx_data_path]" value="' . $this->config['fulltext_sphinx_data_path'] . '" /></dd>
+ </dl>
+ <dl>
+ <dt><label for="fulltext_sphinx_host">' . $this->user->lang['FULLTEXT_SPHINX_HOST'] . $this->user->lang['COLON'] . '</label><br /><span>' . $this->user->lang['FULLTEXT_SPHINX_HOST_EXPLAIN'] . '</span></dt>
+ <dd><input id="fulltext_sphinx_host" type="text" size="40" maxlength="255" name="config[fulltext_sphinx_host]" value="' . $this->config['fulltext_sphinx_host'] . '" /></dd>
+ </dl>
+ <dl>
+ <dt><label for="fulltext_sphinx_port">' . $this->user->lang['FULLTEXT_SPHINX_PORT'] . $this->user->lang['COLON'] . '</label><br /><span>' . $this->user->lang['FULLTEXT_SPHINX_PORT_EXPLAIN'] . '</span></dt>
+ <dd><input id="fulltext_sphinx_port" type="number" min="0" max="9999999999" name="config[fulltext_sphinx_port]" value="' . $this->config['fulltext_sphinx_port'] . '" /></dd>
+ </dl>
+ <dl>
+ <dt><label for="fulltext_sphinx_indexer_mem_limit">' . $this->user->lang['FULLTEXT_SPHINX_INDEXER_MEM_LIMIT'] . $this->user->lang['COLON'] . '</label><br /><span>' . $this->user->lang['FULLTEXT_SPHINX_INDEXER_MEM_LIMIT_EXPLAIN'] . '</span></dt>
+ <dd><input id="fulltext_sphinx_indexer_mem_limit" type="number" min="0" max="9999999999" name="config[fulltext_sphinx_indexer_mem_limit]" value="' . $this->config['fulltext_sphinx_indexer_mem_limit'] . '" /> ' . $this->user->lang['MIB'] . '</dd>
+ </dl>
+ <dl>
+ <dt><label for="fulltext_sphinx_config_file">' . $this->user->lang['FULLTEXT_SPHINX_CONFIG_FILE'] . $this->user->lang['COLON'] . '</label><br /><span>' . $this->user->lang['FULLTEXT_SPHINX_CONFIG_FILE_EXPLAIN'] . '</span></dt>
+ <dd>' . (($this->config_generate()) ? '<textarea readonly="readonly" rows="6" id="sphinx_config_data">' . htmlspecialchars($this->config_file_data) . '</textarea>' : $this->config_file_data) . '</dd>
+ <dl>
+ ';
+
+ // These are fields required in the config table
+ return array(
+ 'tpl' => $tpl,
+ 'config' => $config_vars
+ );
+ }
+}
diff --git a/phpBB/phpbb/search/index.htm b/phpBB/phpbb/search/index.htm
new file mode 100644
index 0000000000..ee1f723a7d
--- /dev/null
+++ b/phpBB/phpbb/search/index.htm
@@ -0,0 +1,10 @@
+<html>
+<head>
+<title></title>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+</head>
+
+<body bgcolor="#FFFFFF" text="#000000">
+
+</body>
+</html>
diff --git a/phpBB/phpbb/search/sphinx/config.php b/phpBB/phpbb/search/sphinx/config.php
new file mode 100644
index 0000000000..675649b460
--- /dev/null
+++ b/phpBB/phpbb/search/sphinx/config.php
@@ -0,0 +1,284 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\search\sphinx;
+
+/**
+* An object representing the sphinx configuration
+* Can read it from file and write it back out after modification
+*/
+class config
+{
+ private $sections = array();
+
+ /**
+ * Constructor which optionally loads data from a variable
+ *
+ * @param string $config_data Variable containing the sphinx configuration data
+ *
+ * @access public
+ */
+ function __construct($config_data)
+ {
+ if ($config_data != '')
+ {
+ $this->read($config_data);
+ }
+ }
+
+ /**
+ * Get a section object by its name
+ *
+ * @param string $name The name of the section that shall be returned
+ * @return \phpbb\search\sphinx\config_section The section object or null if none was found
+ *
+ * @access public
+ */
+ function get_section_by_name($name)
+ {
+ for ($i = 0, $size = sizeof($this->sections); $i < $size; $i++)
+ {
+ // Make sure this is really a section object and not a comment
+ if (($this->sections[$i] instanceof \phpbb\search\sphinx\config_section) && $this->sections[$i]->get_name() == $name)
+ {
+ return $this->sections[$i];
+ }
+ }
+ }
+
+ /**
+ * Appends a new empty section to the end of the config
+ *
+ * @param string $name The name for the new section
+ * @return \phpbb\search\sphinx\config_section The newly created section object
+ *
+ * @access public
+ */
+ function add_section($name)
+ {
+ $this->sections[] = new \phpbb\search\sphinx\config_section($name, '');
+ return $this->sections[sizeof($this->sections) - 1];
+ }
+
+ /**
+ * Reads the config file data
+ *
+ * @param string $config_data The config file data
+ *
+ * @access private
+ */
+ function read($config_data)
+ {
+ $this->sections = array();
+
+ $section = null;
+ $found_opening_bracket = false;
+ $in_value = false;
+
+ foreach ($config_data as $i => $line)
+ {
+ // If the value of a variable continues to the next line because the line
+ // break was escaped then we don't trim leading space but treat it as a part of the value
+ if ($in_value)
+ {
+ $line = rtrim($line);
+ }
+ else
+ {
+ $line = trim($line);
+ }
+
+ // If we're not inside a section look for one
+ if (!$section)
+ {
+ // Add empty lines and comments as comment objects to the section list
+ // that way they're not deleted when reassembling the file from the sections
+ if (!$line || $line[0] == '#')
+ {
+ $this->sections[] = new \phpbb\search\sphinx\config_comment($config_file[$i]);
+ continue;
+ }
+ else
+ {
+ // Otherwise we scan the line reading the section name until we find
+ // an opening curly bracket or a comment
+ $section_name = '';
+ $section_name_comment = '';
+ $found_opening_bracket = false;
+ for ($j = 0, $length = strlen($line); $j < $length; $j++)
+ {
+ if ($line[$j] == '#')
+ {
+ $section_name_comment = substr($line, $j);
+ break;
+ }
+
+ if ($found_opening_bracket)
+ {
+ continue;
+ }
+
+ if ($line[$j] == '{')
+ {
+ $found_opening_bracket = true;
+ continue;
+ }
+
+ $section_name .= $line[$j];
+ }
+
+ // And then we create the new section object
+ $section_name = trim($section_name);
+ $section = new \phpbb\search\sphinx\config_section($section_name, $section_name_comment);
+ }
+ }
+ else
+ {
+ // If we're looking for variables inside a section
+ $skip_first = false;
+
+ // If we're not in a value continuing over the line feed
+ if (!$in_value)
+ {
+ // Then add empty lines and comments as comment objects to the variable list
+ // of this section so they're not deleted on reassembly
+ if (!$line || $line[0] == '#')
+ {
+ $section->add_variable(new \phpbb\search\sphinx\config_comment($config_file[$i]));
+ continue;
+ }
+
+ // As long as we haven't yet actually found an opening bracket for this section
+ // we treat everything as comments so it's not deleted either
+ if (!$found_opening_bracket)
+ {
+ if ($line[0] == '{')
+ {
+ $skip_first = true;
+ $line = substr($line, 1);
+ $found_opening_bracket = true;
+ }
+ else
+ {
+ $section->add_variable(new \phpbb\search\sphinx\config_comment($config_file[$i]));
+ continue;
+ }
+ }
+ }
+
+ // If we did not find a comment in this line or still add to the previous
+ // line's value ...
+ if ($line || $in_value)
+ {
+ if (!$in_value)
+ {
+ $name = '';
+ $value = '';
+ $comment = '';
+ $found_assignment = false;
+ }
+ $in_value = false;
+ $end_section = false;
+
+ /* ... then we should prase this line char by char:
+ - first there's the variable name
+ - then an equal sign
+ - the variable value
+ - possibly a backslash before the linefeed in this case we need to continue
+ parsing the value in the next line
+ - a # indicating that the rest of the line is a comment
+ - a closing curly bracket indicating the end of this section*/
+ for ($j = 0, $length = strlen($line); $j < $length; $j++)
+ {
+ if ($line[$j] == '#')
+ {
+ $comment = substr($line, $j);
+ break;
+ }
+ else if ($line[$j] == '}')
+ {
+ $comment = substr($line, $j + 1);
+ $end_section = true;
+ break;
+ }
+ else if (!$found_assignment)
+ {
+ if ($line[$j] == '=')
+ {
+ $found_assignment = true;
+ }
+ else
+ {
+ $name .= $line[$j];
+ }
+ }
+ else
+ {
+ if ($line[$j] == '\\' && $j == $length - 1)
+ {
+ $value .= "\n";
+ $in_value = true;
+ // Go to the next line and keep processing the value in there
+ continue 2;
+ }
+ $value .= $line[$j];
+ }
+ }
+
+ // If a name and an equal sign were found then we have append a
+ // new variable object to the section
+ if ($name && $found_assignment)
+ {
+ $section->add_variable(new \phpbb\search\sphinx\config_variable(trim($name), trim($value), ($end_section) ? '' : $comment));
+ continue;
+ }
+
+ /* If we found a closing curly bracket this section has been completed
+ and we can append it to the section list and continue with looking for
+ the next section */
+ if ($end_section)
+ {
+ $section->set_end_comment($comment);
+ $this->sections[] = $section;
+ $section = null;
+ continue;
+ }
+ }
+
+ // If we did not find anything meaningful up to here, then just treat it
+ // as a comment
+ $comment = ($skip_first) ? "\t" . substr(ltrim($config_file[$i]), 1) : $config_file[$i];
+ $section->add_variable(new \phpbb\search\sphinx\config_comment($comment));
+ }
+ }
+
+ }
+
+ /**
+ * Returns the config data
+ *
+ * @return string $data The config data that is generated
+ *
+ * @access public
+ */
+ function get_data()
+ {
+ $data = "";
+ foreach ($this->sections as $section)
+ {
+ $data .= $section->to_string();
+ }
+
+ return $data;
+ }
+}
diff --git a/phpBB/phpbb/search/sphinx/config_comment.php b/phpBB/phpbb/search/sphinx/config_comment.php
new file mode 100644
index 0000000000..b5cd0a3db5
--- /dev/null
+++ b/phpBB/phpbb/search/sphinx/config_comment.php
@@ -0,0 +1,47 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\search\sphinx;
+
+/**
+* \phpbb\search\sphinx\config_comment
+* Represents a comment inside the sphinx configuration
+*/
+class config_comment
+{
+ private $exact_string;
+
+ /**
+ * Create a new comment
+ *
+ * @param string $exact_string The content of the comment including newlines, leading whitespace, etc.
+ *
+ * @access public
+ */
+ function __construct($exact_string)
+ {
+ $this->exact_string = $exact_string;
+ }
+
+ /**
+ * Simply returns the comment as it was created
+ *
+ * @return string The exact string that was specified in the constructor
+ *
+ * @access public
+ */
+ function to_string()
+ {
+ return $this->exact_string;
+ }
+}
diff --git a/phpBB/phpbb/search/sphinx/config_section.php b/phpBB/phpbb/search/sphinx/config_section.php
new file mode 100644
index 0000000000..14ab3a752c
--- /dev/null
+++ b/phpBB/phpbb/search/sphinx/config_section.php
@@ -0,0 +1,160 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\search\sphinx;
+
+/**
+* \phpbb\search\sphinx\config_section
+* Represents a single section inside the sphinx configuration
+*/
+class config_section
+{
+ private $name;
+ private $comment;
+ private $end_comment;
+ private $variables = array();
+
+ /**
+ * Construct a new section
+ *
+ * @param string $name Name of the section
+ * @param string $comment Comment that should be appended after the name in the
+ * textual format.
+ *
+ * @access public
+ */
+ function __construct($name, $comment)
+ {
+ $this->name = $name;
+ $this->comment = $comment;
+ $this->end_comment = '';
+ }
+
+ /**
+ * Add a variable object to the list of variables in this section
+ *
+ * @param \phpbb\search\sphinx\config_variable $variable The variable object
+ *
+ * @access public
+ */
+ function add_variable($variable)
+ {
+ $this->variables[] = $variable;
+ }
+
+ /**
+ * Adds a comment after the closing bracket in the textual representation
+ *
+ * @param string $end_comment
+ *
+ * @access public
+ */
+ function set_end_comment($end_comment)
+ {
+ $this->end_comment = $end_comment;
+ }
+
+ /**
+ * Getter for the name of this section
+ *
+ * @return string Section's name
+ *
+ * @access public
+ */
+ function get_name()
+ {
+ return $this->name;
+ }
+
+ /**
+ * Get a variable object by its name
+ *
+ * @param string $name The name of the variable that shall be returned
+ * @return \phpbb\search\sphinx\config_section The first variable object from this section with the
+ * given name or null if none was found
+ *
+ * @access public
+ */
+ function get_variable_by_name($name)
+ {
+ for ($i = 0, $size = sizeof($this->variables); $i < $size; $i++)
+ {
+ // Make sure this is a variable object and not a comment
+ if (($this->variables[$i] instanceof \phpbb\search\sphinx\config_variable) && $this->variables[$i]->get_name() == $name)
+ {
+ return $this->variables[$i];
+ }
+ }
+ }
+
+ /**
+ * Deletes all variables with the given name
+ *
+ * @param string $name The name of the variable objects that are supposed to be removed
+ *
+ * @access public
+ */
+ function delete_variables_by_name($name)
+ {
+ for ($i = 0, $size = sizeof($this->variables); $i < $size; $i++)
+ {
+ // Make sure this is a variable object and not a comment
+ if (($this->variables[$i] instanceof \phpbb\search\sphinx\config_variable) && $this->variables[$i]->get_name() == $name)
+ {
+ array_splice($this->variables, $i, 1);
+ $i--;
+ }
+ }
+ }
+
+ /**
+ * Create a new variable object and append it to the variable list of this section
+ *
+ * @param string $name The name for the new variable
+ * @param string $value The value for the new variable
+ * @return \phpbb\search\sphinx\config_variable Variable object that was created
+ *
+ * @access public
+ */
+ function create_variable($name, $value)
+ {
+ $this->variables[] = new \phpbb\search\sphinx\config_variable($name, $value, '');
+ return $this->variables[sizeof($this->variables) - 1];
+ }
+
+ /**
+ * Turns this object into a string which can be written to a config file
+ *
+ * @return string Config data in textual form, parsable for sphinx
+ *
+ * @access public
+ */
+ function to_string()
+ {
+ $content = $this->name . ' ' . $this->comment . "\n{\n";
+
+ // Make sure we don't get too many newlines after the opening bracket
+ while (trim($this->variables[0]->to_string()) == '')
+ {
+ array_shift($this->variables);
+ }
+
+ foreach ($this->variables as $variable)
+ {
+ $content .= $variable->to_string();
+ }
+ $content .= '}' . $this->end_comment . "\n";
+
+ return $content;
+ }
+}
diff --git a/phpBB/phpbb/search/sphinx/config_variable.php b/phpBB/phpbb/search/sphinx/config_variable.php
new file mode 100644
index 0000000000..85cee20b62
--- /dev/null
+++ b/phpBB/phpbb/search/sphinx/config_variable.php
@@ -0,0 +1,78 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\search\sphinx;
+
+/**
+* \phpbb\search\sphinx\config_variable
+* Represents a single variable inside the sphinx configuration
+*/
+class config_variable
+{
+ private $name;
+ private $value;
+ private $comment;
+
+ /**
+ * Constructs a new variable object
+ *
+ * @param string $name Name of the variable
+ * @param string $value Value of the variable
+ * @param string $comment Optional comment after the variable in the
+ * config file
+ *
+ * @access public
+ */
+ function __construct($name, $value, $comment)
+ {
+ $this->name = $name;
+ $this->value = $value;
+ $this->comment = $comment;
+ }
+
+ /**
+ * Getter for the variable's name
+ *
+ * @return string The variable object's name
+ *
+ * @access public
+ */
+ function get_name()
+ {
+ return $this->name;
+ }
+
+ /**
+ * Allows changing the variable's value
+ *
+ * @param string $value New value for this variable
+ *
+ * @access public
+ */
+ function set_value($value)
+ {
+ $this->value = $value;
+ }
+
+ /**
+ * Turns this object into a string readable by sphinx
+ *
+ * @return string Config data in textual form
+ *
+ * @access public
+ */
+ function to_string()
+ {
+ return "\t" . $this->name . ' = ' . str_replace("\n", " \\\n", $this->value) . ' ' . $this->comment . "\n";
+ }
+}
diff --git a/phpBB/phpbb/session.php b/phpBB/phpbb/session.php
new file mode 100644
index 0000000000..45e82df591
--- /dev/null
+++ b/phpBB/phpbb/session.php
@@ -0,0 +1,1617 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb;
+
+/**
+* Session class
+*/
+class session
+{
+ var $cookie_data = array();
+ var $page = array();
+ var $data = array();
+ var $browser = '';
+ var $forwarded_for = '';
+ var $host = '';
+ var $session_id = '';
+ var $ip = '';
+ var $load = 0;
+ var $time_now = 0;
+ var $update_session_page = true;
+
+ /**
+ * Extract current session page
+ *
+ * @param string $root_path current root path (phpbb_root_path)
+ * @return array
+ */
+ static function extract_current_page($root_path)
+ {
+ global $request, $symfony_request, $phpbb_filesystem;
+
+ $page_array = array();
+
+ // First of all, get the request uri...
+ $script_name = $request->escape($symfony_request->getScriptName(), true);
+ $args = $request->escape(explode('&', $symfony_request->getQueryString()), true);
+
+ // If we are unable to get the script name we use REQUEST_URI as a failover and note it within the page array for easier support...
+ if (!$script_name)
+ {
+ $script_name = htmlspecialchars_decode($request->server('REQUEST_URI'));
+ $script_name = (($pos = strpos($script_name, '?')) !== false) ? substr($script_name, 0, $pos) : $script_name;
+ $page_array['failover'] = 1;
+ }
+
+ // Replace backslashes and doubled slashes (could happen on some proxy setups)
+ $script_name = str_replace(array('\\', '//'), '/', $script_name);
+
+ // Now, remove the sid and let us get a clean query string...
+ $use_args = array();
+
+ // Since some browser do not encode correctly we need to do this with some "special" characters...
+ // " -> %22, ' => %27, < -> %3C, > -> %3E
+ $find = array('"', "'", '<', '>', '&quot;', '&lt;', '&gt;');
+ $replace = array('%22', '%27', '%3C', '%3E', '%22', '%3C', '%3E');
+
+ foreach ($args as $key => $argument)
+ {
+ if (strpos($argument, 'sid=') === 0)
+ {
+ continue;
+ }
+
+ $use_args[] = str_replace($find, $replace, $argument);
+ }
+ unset($args);
+
+ // The following examples given are for an request uri of {path to the phpbb directory}/adm/index.php?i=10&b=2
+
+ // The current query string
+ $query_string = trim(implode('&', $use_args));
+
+ // basenamed page name (for example: index.php)
+ $page_name = (substr($script_name, -1, 1) == '/') ? '' : basename($script_name);
+ $page_name = urlencode(htmlspecialchars($page_name));
+
+ $symfony_request_path = $phpbb_filesystem->clean_path($symfony_request->getPathInfo());
+ if ($symfony_request_path !== '/')
+ {
+ $page_name .= str_replace('%2F', '/', urlencode($symfony_request_path));
+ }
+
+ // current directory within the phpBB root (for example: adm)
+ $root_dirs = explode('/', str_replace('\\', '/', phpbb_realpath($root_path)));
+ $page_dirs = explode('/', str_replace('\\', '/', phpbb_realpath('./')));
+ $intersection = array_intersect_assoc($root_dirs, $page_dirs);
+
+ $root_dirs = array_diff_assoc($root_dirs, $intersection);
+ $page_dirs = array_diff_assoc($page_dirs, $intersection);
+
+ $page_dir = str_repeat('../', sizeof($root_dirs)) . implode('/', $page_dirs);
+
+ if ($page_dir && substr($page_dir, -1, 1) == '/')
+ {
+ $page_dir = substr($page_dir, 0, -1);
+ }
+
+ // Current page from phpBB root (for example: adm/index.php?i=10&b=2)
+ $page = (($page_dir) ? $page_dir . '/' : '') . $page_name;
+ if ($query_string)
+ {
+ $page .= '?' . $query_string;
+ }
+
+ // The script path from the webroot to the current directory (for example: /phpBB3/adm/) : always prefixed with / and ends in /
+ $script_path = $symfony_request->getBasePath();
+
+ // The script path from the webroot to the phpBB root (for example: /phpBB3/)
+ $script_dirs = explode('/', $script_path);
+ array_splice($script_dirs, -sizeof($page_dirs));
+ $root_script_path = implode('/', $script_dirs) . (sizeof($root_dirs) ? '/' . implode('/', $root_dirs) : '');
+
+ // We are on the base level (phpBB root == webroot), lets adjust the variables a bit...
+ if (!$root_script_path)
+ {
+ $root_script_path = ($page_dir) ? str_replace($page_dir, '', $script_path) : $script_path;
+ }
+
+ $script_path .= (substr($script_path, -1, 1) == '/') ? '' : '/';
+ $root_script_path .= (substr($root_script_path, -1, 1) == '/') ? '' : '/';
+
+ $forum_id = $request->variable('f', 0);
+ // maximum forum id value is maximum value of mediumint unsigned column
+ $forum_id = ($forum_id > 0 && $forum_id < 16777215) ? $forum_id : 0;
+
+ $page_array += array(
+ 'page_name' => $page_name,
+ 'page_dir' => $page_dir,
+
+ 'query_string' => $query_string,
+ 'script_path' => str_replace(' ', '%20', htmlspecialchars($script_path)),
+ 'root_script_path' => str_replace(' ', '%20', htmlspecialchars($root_script_path)),
+
+ 'page' => $page,
+ 'forum' => $forum_id,
+ );
+
+ return $page_array;
+ }
+
+ /**
+ * Get valid hostname/port. HTTP_HOST is used, SERVER_NAME if HTTP_HOST not present.
+ */
+ function extract_current_hostname()
+ {
+ global $config, $request;
+
+ // Get hostname
+ $host = htmlspecialchars_decode($request->header('Host', $request->server('SERVER_NAME')));
+
+ // Should be a string and lowered
+ $host = (string) strtolower($host);
+
+ // If host is equal the cookie domain or the server name (if config is set), then we assume it is valid
+ if ((isset($config['cookie_domain']) && $host === $config['cookie_domain']) || (isset($config['server_name']) && $host === $config['server_name']))
+ {
+ return $host;
+ }
+
+ // Is the host actually a IP? If so, we use the IP... (IPv4)
+ if (long2ip(ip2long($host)) === $host)
+ {
+ return $host;
+ }
+
+ // Now return the hostname (this also removes any port definition). The http:// is prepended to construct a valid URL, hosts never have a scheme assigned
+ $host = @parse_url('http://' . $host);
+ $host = (!empty($host['host'])) ? $host['host'] : '';
+
+ // Remove any portions not removed by parse_url (#)
+ $host = str_replace('#', '', $host);
+
+ // If, by any means, the host is now empty, we will use a "best approach" way to guess one
+ if (empty($host))
+ {
+ if (!empty($config['server_name']))
+ {
+ $host = $config['server_name'];
+ }
+ else if (!empty($config['cookie_domain']))
+ {
+ $host = (strpos($config['cookie_domain'], '.') === 0) ? substr($config['cookie_domain'], 1) : $config['cookie_domain'];
+ }
+ else
+ {
+ // Set to OS hostname or localhost
+ $host = (function_exists('php_uname')) ? php_uname('n') : 'localhost';
+ }
+ }
+
+ // It may be still no valid host, but for sure only a hostname (we may further expand on the cookie domain... if set)
+ return $host;
+ }
+
+ /**
+ * Start session management
+ *
+ * This is where all session activity begins. We gather various pieces of
+ * information from the client and server. We test to see if a session already
+ * exists. If it does, fine and dandy. If it doesn't we'll go on to create a
+ * new one ... pretty logical heh? We also examine the system load (if we're
+ * running on a system which makes such information readily available) and
+ * halt if it's above an admin definable limit.
+ *
+ * @param bool $update_session_page if true the session page gets updated.
+ * This can be set to circumvent certain scripts to update the users last visited page.
+ */
+ function session_begin($update_session_page = true)
+ {
+ global $phpEx, $SID, $_SID, $_EXTRA_URL, $db, $config, $phpbb_root_path;
+ global $request, $phpbb_container, $phpbb_dispatcher;
+
+ // Give us some basic information
+ $this->time_now = time();
+ $this->cookie_data = array('u' => 0, 'k' => '');
+ $this->update_session_page = $update_session_page;
+ $this->browser = $request->header('User-Agent');
+ $this->referer = $request->header('Referer');
+ $this->forwarded_for = $request->header('X-Forwarded-For');
+
+ $this->host = $this->extract_current_hostname();
+ $this->page = $this->extract_current_page($phpbb_root_path);
+
+ // if the forwarded for header shall be checked we have to validate its contents
+ if ($config['forwarded_for_check'])
+ {
+ $this->forwarded_for = preg_replace('# {2,}#', ' ', str_replace(',', ' ', $this->forwarded_for));
+
+ // split the list of IPs
+ $ips = explode(' ', $this->forwarded_for);
+ foreach ($ips as $ip)
+ {
+ // check IPv4 first, the IPv6 is hopefully only going to be used very seldomly
+ if (!empty($ip) && !preg_match(get_preg_expression('ipv4'), $ip) && !preg_match(get_preg_expression('ipv6'), $ip))
+ {
+ // contains invalid data, don't use the forwarded for header
+ $this->forwarded_for = '';
+ break;
+ }
+ }
+ }
+ else
+ {
+ $this->forwarded_for = '';
+ }
+
+ if ($request->is_set($config['cookie_name'] . '_sid', \phpbb\request\request_interface::COOKIE) || $request->is_set($config['cookie_name'] . '_u', \phpbb\request\request_interface::COOKIE))
+ {
+ $this->cookie_data['u'] = request_var($config['cookie_name'] . '_u', 0, false, true);
+ $this->cookie_data['k'] = request_var($config['cookie_name'] . '_k', '', false, true);
+ $this->session_id = request_var($config['cookie_name'] . '_sid', '', false, true);
+
+ $SID = (defined('NEED_SID')) ? '?sid=' . $this->session_id : '?sid=';
+ $_SID = (defined('NEED_SID')) ? $this->session_id : '';
+
+ if (empty($this->session_id))
+ {
+ $this->session_id = $_SID = request_var('sid', '');
+ $SID = '?sid=' . $this->session_id;
+ $this->cookie_data = array('u' => 0, 'k' => '');
+ }
+ }
+ else
+ {
+ $this->session_id = $_SID = request_var('sid', '');
+ $SID = '?sid=' . $this->session_id;
+ }
+
+ $_EXTRA_URL = array();
+
+ // Why no forwarded_for et al? Well, too easily spoofed. With the results of my recent requests
+ // it's pretty clear that in the majority of cases you'll at least be left with a proxy/cache ip.
+ $ip = htmlspecialchars_decode($request->server('REMOTE_ADDR'));
+ $ip = preg_replace('# {2,}#', ' ', str_replace(',', ' ', $ip));
+
+ /**
+ * Event to alter user IP address
+ *
+ * @event core.session_ip_after
+ * @var string ip REMOTE_ADDR
+ * @since 3.1.10-RC1
+ */
+ $vars = array('ip');
+ extract($phpbb_dispatcher->trigger_event('core.session_ip_after', compact($vars)));
+
+ // split the list of IPs
+ $ips = explode(' ', trim($ip));
+
+ // Default IP if REMOTE_ADDR is invalid
+ $this->ip = '127.0.0.1';
+
+ foreach ($ips as $ip)
+ {
+ if (function_exists('phpbb_ip_normalise'))
+ {
+ // Normalise IP address
+ $ip = phpbb_ip_normalise($ip);
+
+ if (empty($ip))
+ {
+ // IP address is invalid.
+ break;
+ }
+
+ // IP address is valid.
+ $this->ip = $ip;
+
+ // Skip legacy code.
+ continue;
+ }
+
+ if (preg_match(get_preg_expression('ipv4'), $ip))
+ {
+ $this->ip = $ip;
+ }
+ else if (preg_match(get_preg_expression('ipv6'), $ip))
+ {
+ // Quick check for IPv4-mapped address in IPv6
+ if (stripos($ip, '::ffff:') === 0)
+ {
+ $ipv4 = substr($ip, 7);
+
+ if (preg_match(get_preg_expression('ipv4'), $ipv4))
+ {
+ $ip = $ipv4;
+ }
+ }
+
+ $this->ip = $ip;
+ }
+ else
+ {
+ // We want to use the last valid address in the chain
+ // Leave foreach loop when address is invalid
+ break;
+ }
+ }
+
+ $this->load = false;
+
+ // Load limit check (if applicable)
+ if ($config['limit_load'] || $config['limit_search_load'])
+ {
+ if ((function_exists('sys_getloadavg') && $load = sys_getloadavg()) || ($load = explode(' ', @file_get_contents('/proc/loadavg'))))
+ {
+ $this->load = array_slice($load, 0, 1);
+ $this->load = floatval($this->load[0]);
+ }
+ else
+ {
+ set_config('limit_load', '0');
+ set_config('limit_search_load', '0');
+ }
+ }
+
+ // if no session id is set, redirect to index.php
+ $session_id = $request->variable('sid', '');
+ if (defined('NEED_SID') && (empty($session_id) || $this->session_id !== $session_id))
+ {
+ send_status_line(401, 'Unauthorized');
+ redirect(append_sid("{$phpbb_root_path}index.$phpEx"));
+ }
+
+ // if session id is set
+ if (!empty($this->session_id))
+ {
+ $sql = 'SELECT u.*, s.*
+ FROM ' . SESSIONS_TABLE . ' s, ' . USERS_TABLE . " u
+ WHERE s.session_id = '" . $db->sql_escape($this->session_id) . "'
+ AND u.user_id = s.session_user_id";
+ $result = $db->sql_query($sql);
+ $this->data = $db->sql_fetchrow($result);
+ $db->sql_freeresult($result);
+
+ // Did the session exist in the DB?
+ if (isset($this->data['user_id']))
+ {
+ // Validate IP length according to admin ... enforces an IP
+ // check on bots if admin requires this
+// $quadcheck = ($config['ip_check_bot'] && $this->data['user_type'] & USER_BOT) ? 4 : $config['ip_check'];
+
+ if (strpos($this->ip, ':') !== false && strpos($this->data['session_ip'], ':') !== false)
+ {
+ $s_ip = short_ipv6($this->data['session_ip'], $config['ip_check']);
+ $u_ip = short_ipv6($this->ip, $config['ip_check']);
+ }
+ else
+ {
+ $s_ip = implode('.', array_slice(explode('.', $this->data['session_ip']), 0, $config['ip_check']));
+ $u_ip = implode('.', array_slice(explode('.', $this->ip), 0, $config['ip_check']));
+ }
+
+ $s_browser = ($config['browser_check']) ? trim(strtolower(substr($this->data['session_browser'], 0, 149))) : '';
+ $u_browser = ($config['browser_check']) ? trim(strtolower(substr($this->browser, 0, 149))) : '';
+
+ $s_forwarded_for = ($config['forwarded_for_check']) ? substr($this->data['session_forwarded_for'], 0, 254) : '';
+ $u_forwarded_for = ($config['forwarded_for_check']) ? substr($this->forwarded_for, 0, 254) : '';
+
+ // referer checks
+ // The @ before $config['referer_validation'] suppresses notices present while running the updater
+ $check_referer_path = (@$config['referer_validation'] == REFERER_VALIDATE_PATH);
+ $referer_valid = true;
+
+ // we assume HEAD and TRACE to be foul play and thus only whitelist GET
+ if (@$config['referer_validation'] && strtolower($request->server('REQUEST_METHOD')) !== 'get')
+ {
+ $referer_valid = $this->validate_referer($check_referer_path);
+ }
+
+ if ($u_ip === $s_ip && $s_browser === $u_browser && $s_forwarded_for === $u_forwarded_for && $referer_valid)
+ {
+ $session_expired = false;
+
+ // Check whether the session is still valid if we have one
+ $provider_collection = $phpbb_container->get('auth.provider_collection');
+ $provider = $provider_collection->get_provider();
+
+ if (!($provider instanceof \phpbb\auth\provider\provider_interface))
+ {
+ throw new \RuntimeException($provider . ' must implement \phpbb\auth\provider\provider_interface');
+ }
+
+ $ret = $provider->validate_session($this->data);
+ if ($ret !== null && !$ret)
+ {
+ $session_expired = true;
+ }
+
+ if (!$session_expired)
+ {
+ // Check the session length timeframe if autologin is not enabled.
+ // Else check the autologin length... and also removing those having autologin enabled but no longer allowed board-wide.
+ if (!$this->data['session_autologin'])
+ {
+ if ($this->data['session_time'] < $this->time_now - ($config['session_length'] + 60))
+ {
+ $session_expired = true;
+ }
+ }
+ else if (!$config['allow_autologin'] || ($config['max_autologin_time'] && $this->data['session_time'] < $this->time_now - (86400 * (int) $config['max_autologin_time']) + 60))
+ {
+ $session_expired = true;
+ }
+ }
+
+ if (!$session_expired)
+ {
+ $this->data['is_registered'] = ($this->data['user_id'] != ANONYMOUS && ($this->data['user_type'] == USER_NORMAL || $this->data['user_type'] == USER_FOUNDER)) ? true : false;
+ $this->data['is_bot'] = (!$this->data['is_registered'] && $this->data['user_id'] != ANONYMOUS) ? true : false;
+ $this->data['user_lang'] = basename($this->data['user_lang']);
+
+ // Is user banned? Are they excluded? Won't return on ban, exists within method
+ $this->check_ban_for_current_session($config);
+
+ return true;
+ }
+ }
+ else
+ {
+ // Added logging temporarly to help debug bugs...
+ if (defined('DEBUG') && $this->data['user_id'] != ANONYMOUS)
+ {
+ if ($referer_valid)
+ {
+ add_log('critical', 'LOG_IP_BROWSER_FORWARDED_CHECK', $u_ip, $s_ip, $u_browser, $s_browser, htmlspecialchars($u_forwarded_for), htmlspecialchars($s_forwarded_for));
+ }
+ else
+ {
+ add_log('critical', 'LOG_REFERER_INVALID', $this->referer);
+ }
+ }
+ }
+ }
+ }
+
+ // If we reach here then no (valid) session exists. So we'll create a new one
+ return $this->session_create();
+ }
+
+ /**
+ * Create a new session
+ *
+ * If upon trying to start a session we discover there is nothing existing we
+ * jump here. Additionally this method is called directly during login to regenerate
+ * the session for the specific user. In this method we carry out a number of tasks;
+ * garbage collection, (search)bot checking, banned user comparison. Basically
+ * though this method will result in a new session for a specific user.
+ */
+ function session_create($user_id = false, $set_admin = false, $persist_login = false, $viewonline = true)
+ {
+ global $SID, $_SID, $db, $config, $cache, $phpbb_root_path, $phpEx, $phpbb_container, $phpbb_dispatcher;
+
+ $this->data = array();
+
+ /* Garbage collection ... remove old sessions updating user information
+ // if necessary. It means (potentially) 11 queries but only infrequently
+ if ($this->time_now > $config['session_last_gc'] + $config['session_gc'])
+ {
+ $this->session_gc();
+ }*/
+
+ // Do we allow autologin on this board? No? Then override anything
+ // that may be requested here
+ if (!$config['allow_autologin'])
+ {
+ $this->cookie_data['k'] = $persist_login = false;
+ }
+
+ /**
+ * Here we do a bot check, oh er saucy! No, not that kind of bot
+ * check. We loop through the list of bots defined by the admin and
+ * see if we have any useragent and/or IP matches. If we do, this is a
+ * bot, act accordingly
+ */
+ $bot = false;
+ $active_bots = $cache->obtain_bots();
+
+ foreach ($active_bots as $row)
+ {
+ if ($row['bot_agent'] && preg_match('#' . str_replace('\*', '.*?', preg_quote($row['bot_agent'], '#')) . '#i', $this->browser))
+ {
+ $bot = $row['user_id'];
+ }
+
+ // If ip is supplied, we will make sure the ip is matching too...
+ if ($row['bot_ip'] && ($bot || !$row['bot_agent']))
+ {
+ // Set bot to false, then we only have to set it to true if it is matching
+ $bot = false;
+
+ foreach (explode(',', $row['bot_ip']) as $bot_ip)
+ {
+ $bot_ip = trim($bot_ip);
+
+ if (!$bot_ip)
+ {
+ continue;
+ }
+
+ if (strpos($this->ip, $bot_ip) === 0)
+ {
+ $bot = (int) $row['user_id'];
+ break;
+ }
+ }
+ }
+
+ if ($bot)
+ {
+ break;
+ }
+ }
+
+ $provider_collection = $phpbb_container->get('auth.provider_collection');
+ $provider = $provider_collection->get_provider();
+ $this->data = $provider->autologin();
+
+ if ($user_id !== false && sizeof($this->data) && $this->data['user_id'] != $user_id)
+ {
+ $this->data = array();
+ }
+
+ if (sizeof($this->data))
+ {
+ $this->cookie_data['k'] = '';
+ $this->cookie_data['u'] = $this->data['user_id'];
+ }
+
+ // If we're presented with an autologin key we'll join against it.
+ // Else if we've been passed a user_id we'll grab data based on that
+ if (isset($this->cookie_data['k']) && $this->cookie_data['k'] && $this->cookie_data['u'] && !sizeof($this->data))
+ {
+ $sql = 'SELECT u.*
+ FROM ' . USERS_TABLE . ' u, ' . SESSIONS_KEYS_TABLE . ' k
+ WHERE u.user_id = ' . (int) $this->cookie_data['u'] . '
+ AND u.user_type IN (' . USER_NORMAL . ', ' . USER_FOUNDER . ")
+ AND k.user_id = u.user_id
+ AND k.key_id = '" . $db->sql_escape(md5($this->cookie_data['k'])) . "'";
+ $result = $db->sql_query($sql);
+ $user_data = $db->sql_fetchrow($result);
+
+ if ($user_id === false || (isset($user_data['user_id']) && $user_id == $user_data['user_id']))
+ {
+ $this->data = $user_data;
+ $bot = false;
+ }
+
+ $db->sql_freeresult($result);
+ }
+
+ if ($user_id !== false && !sizeof($this->data))
+ {
+ $this->cookie_data['k'] = '';
+ $this->cookie_data['u'] = $user_id;
+
+ $sql = 'SELECT *
+ FROM ' . USERS_TABLE . '
+ WHERE user_id = ' . (int) $this->cookie_data['u'] . '
+ AND user_type IN (' . USER_NORMAL . ', ' . USER_FOUNDER . ')';
+ $result = $db->sql_query($sql);
+ $this->data = $db->sql_fetchrow($result);
+ $db->sql_freeresult($result);
+ $bot = false;
+ }
+
+ // Bot user, if they have a SID in the Request URI we need to get rid of it
+ // otherwise they'll index this page with the SID, duplicate content oh my!
+ if ($bot && isset($_GET['sid']))
+ {
+ send_status_line(301, 'Moved Permanently');
+ redirect(build_url(array('sid')));
+ }
+
+ // If no data was returned one or more of the following occurred:
+ // Key didn't match one in the DB
+ // User does not exist
+ // User is inactive
+ // User is bot
+ if (!sizeof($this->data) || !is_array($this->data))
+ {
+ $this->cookie_data['k'] = '';
+ $this->cookie_data['u'] = ($bot) ? $bot : ANONYMOUS;
+
+ if (!$bot)
+ {
+ $sql = 'SELECT *
+ FROM ' . USERS_TABLE . '
+ WHERE user_id = ' . (int) $this->cookie_data['u'];
+ }
+ else
+ {
+ // We give bots always the same session if it is not yet expired.
+ $sql = 'SELECT u.*, s.*
+ FROM ' . USERS_TABLE . ' u
+ LEFT JOIN ' . SESSIONS_TABLE . ' s ON (s.session_user_id = u.user_id)
+ WHERE u.user_id = ' . (int) $bot;
+ }
+
+ $result = $db->sql_query($sql);
+ $this->data = $db->sql_fetchrow($result);
+ $db->sql_freeresult($result);
+ }
+
+ if ($this->data['user_id'] != ANONYMOUS && !$bot)
+ {
+ $this->data['session_last_visit'] = (isset($this->data['session_time']) && $this->data['session_time']) ? $this->data['session_time'] : (($this->data['user_lastvisit']) ? $this->data['user_lastvisit'] : time());
+ }
+ else
+ {
+ $this->data['session_last_visit'] = $this->time_now;
+ }
+
+ // Force user id to be integer...
+ $this->data['user_id'] = (int) $this->data['user_id'];
+
+ // At this stage we should have a filled data array, defined cookie u and k data.
+ // data array should contain recent session info if we're a real user and a recent
+ // session exists in which case session_id will also be set
+
+ // Is user banned? Are they excluded? Won't return on ban, exists within method
+ $this->check_ban_for_current_session($config);
+
+ $this->data['is_registered'] = (!$bot && $this->data['user_id'] != ANONYMOUS && ($this->data['user_type'] == USER_NORMAL || $this->data['user_type'] == USER_FOUNDER)) ? true : false;
+ $this->data['is_bot'] = ($bot) ? true : false;
+
+ // If our friend is a bot, we re-assign a previously assigned session
+ if ($this->data['is_bot'] && $bot == $this->data['user_id'] && $this->data['session_id'])
+ {
+ // Only assign the current session if the ip, browser and forwarded_for match...
+ if (strpos($this->ip, ':') !== false && strpos($this->data['session_ip'], ':') !== false)
+ {
+ $s_ip = short_ipv6($this->data['session_ip'], $config['ip_check']);
+ $u_ip = short_ipv6($this->ip, $config['ip_check']);
+ }
+ else
+ {
+ $s_ip = implode('.', array_slice(explode('.', $this->data['session_ip']), 0, $config['ip_check']));
+ $u_ip = implode('.', array_slice(explode('.', $this->ip), 0, $config['ip_check']));
+ }
+
+ $s_browser = ($config['browser_check']) ? trim(strtolower(substr($this->data['session_browser'], 0, 149))) : '';
+ $u_browser = ($config['browser_check']) ? trim(strtolower(substr($this->browser, 0, 149))) : '';
+
+ $s_forwarded_for = ($config['forwarded_for_check']) ? substr($this->data['session_forwarded_for'], 0, 254) : '';
+ $u_forwarded_for = ($config['forwarded_for_check']) ? substr($this->forwarded_for, 0, 254) : '';
+
+ if ($u_ip === $s_ip && $s_browser === $u_browser && $s_forwarded_for === $u_forwarded_for)
+ {
+ $this->session_id = $this->data['session_id'];
+
+ // Only update session DB a minute or so after last update or if page changes
+ if ($this->time_now - $this->data['session_time'] > 60 || ($this->update_session_page && $this->data['session_page'] != $this->page['page']))
+ {
+ // Update the last visit time
+ $sql = 'UPDATE ' . USERS_TABLE . '
+ SET user_lastvisit = ' . (int) $this->data['session_time'] . '
+ WHERE user_id = ' . (int) $this->data['user_id'];
+ $db->sql_query($sql);
+ }
+
+ $SID = '?sid=';
+ $_SID = '';
+ return true;
+ }
+ else
+ {
+ // If the ip and browser does not match make sure we only have one bot assigned to one session
+ $db->sql_query('DELETE FROM ' . SESSIONS_TABLE . ' WHERE session_user_id = ' . $this->data['user_id']);
+ }
+ }
+
+ $session_autologin = (($this->cookie_data['k'] || $persist_login) && $this->data['is_registered']) ? true : false;
+ $set_admin = ($set_admin && $this->data['is_registered']) ? true : false;
+
+ // Create or update the session
+ $sql_ary = array(
+ 'session_user_id' => (int) $this->data['user_id'],
+ 'session_start' => (int) $this->time_now,
+ 'session_last_visit' => (int) $this->data['session_last_visit'],
+ 'session_time' => (int) $this->time_now,
+ 'session_browser' => (string) trim(substr($this->browser, 0, 149)),
+ 'session_forwarded_for' => (string) $this->forwarded_for,
+ 'session_ip' => (string) $this->ip,
+ 'session_autologin' => ($session_autologin) ? 1 : 0,
+ 'session_admin' => ($set_admin) ? 1 : 0,
+ 'session_viewonline' => ($viewonline) ? 1 : 0,
+ );
+
+ if ($this->update_session_page)
+ {
+ $sql_ary['session_page'] = (string) substr($this->page['page'], 0, 199);
+ $sql_ary['session_forum_id'] = $this->page['forum'];
+ }
+
+ $db->sql_return_on_error(true);
+
+ $sql = 'DELETE
+ FROM ' . SESSIONS_TABLE . '
+ WHERE session_id = \'' . $db->sql_escape($this->session_id) . '\'
+ AND session_user_id = ' . ANONYMOUS;
+
+ if (!defined('IN_ERROR_HANDLER') && (!$this->session_id || !$db->sql_query($sql) || !$db->sql_affectedrows()))
+ {
+ // Limit new sessions in 1 minute period (if required)
+ if (empty($this->data['session_time']) && $config['active_sessions'])
+ {
+// $db->sql_return_on_error(false);
+
+ $sql = 'SELECT COUNT(session_id) AS sessions
+ FROM ' . SESSIONS_TABLE . '
+ WHERE session_time >= ' . ($this->time_now - 60);
+ $result = $db->sql_query($sql);
+ $row = $db->sql_fetchrow($result);
+ $db->sql_freeresult($result);
+
+ if ((int) $row['sessions'] > (int) $config['active_sessions'])
+ {
+ send_status_line(503, 'Service Unavailable');
+ trigger_error('BOARD_UNAVAILABLE');
+ }
+ }
+ }
+
+ // Since we re-create the session id here, the inserted row must be unique. Therefore, we display potential errors.
+ // Commented out because it will not allow forums to update correctly
+// $db->sql_return_on_error(false);
+
+ // Something quite important: session_page always holds the *last* page visited, except for the *first* visit.
+ // We are not able to simply have an empty session_page btw, therefore we need to tell phpBB how to detect this special case.
+ // If the session id is empty, we have a completely new one and will set an "identifier" here. This identifier is able to be checked later.
+ if (empty($this->data['session_id']))
+ {
+ // This is a temporary variable, only set for the very first visit
+ $this->data['session_created'] = true;
+ }
+
+ $this->session_id = $this->data['session_id'] = md5(unique_id());
+
+ $sql_ary['session_id'] = (string) $this->session_id;
+ $sql_ary['session_page'] = (string) substr($this->page['page'], 0, 199);
+ $sql_ary['session_forum_id'] = $this->page['forum'];
+
+ $sql = 'INSERT INTO ' . SESSIONS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary);
+ $db->sql_query($sql);
+
+ $db->sql_return_on_error(false);
+
+ // Regenerate autologin/persistent login key
+ if ($session_autologin)
+ {
+ $this->set_login_key();
+ }
+
+ // refresh data
+ $SID = '?sid=' . $this->session_id;
+ $_SID = $this->session_id;
+ $this->data = array_merge($this->data, $sql_ary);
+
+ if (!$bot)
+ {
+ $cookie_expire = $this->time_now + (($config['max_autologin_time']) ? 86400 * (int) $config['max_autologin_time'] : 31536000);
+
+ $this->set_cookie('u', $this->cookie_data['u'], $cookie_expire);
+ $this->set_cookie('k', $this->cookie_data['k'], $cookie_expire);
+ $this->set_cookie('sid', $this->session_id, $cookie_expire);
+
+ unset($cookie_expire);
+
+ $sql = 'SELECT COUNT(session_id) AS sessions
+ FROM ' . SESSIONS_TABLE . '
+ WHERE session_user_id = ' . (int) $this->data['user_id'] . '
+ AND session_time >= ' . (int) ($this->time_now - (max($config['session_length'], $config['form_token_lifetime'])));
+ $result = $db->sql_query($sql);
+ $row = $db->sql_fetchrow($result);
+ $db->sql_freeresult($result);
+
+ if ((int) $row['sessions'] <= 1 || empty($this->data['user_form_salt']))
+ {
+ $this->data['user_form_salt'] = unique_id();
+ // Update the form key
+ $sql = 'UPDATE ' . USERS_TABLE . '
+ SET user_form_salt = \'' . $db->sql_escape($this->data['user_form_salt']) . '\'
+ WHERE user_id = ' . (int) $this->data['user_id'];
+ $db->sql_query($sql);
+ }
+ }
+ else
+ {
+ $this->data['session_time'] = $this->data['session_last_visit'] = $this->time_now;
+
+ // Update the last visit time
+ $sql = 'UPDATE ' . USERS_TABLE . '
+ SET user_lastvisit = ' . (int) $this->data['session_time'] . '
+ WHERE user_id = ' . (int) $this->data['user_id'];
+ $db->sql_query($sql);
+
+ $SID = '?sid=';
+ $_SID = '';
+ }
+
+ $session_data = $sql_ary;
+ /**
+ * Event to send new session data to extension
+ * Read-only event
+ *
+ * @event core.session_create_after
+ * @var array session_data Associative array of session keys to be updated
+ * @since 3.1.6-RC1
+ */
+ $vars = array('session_data');
+ extract($phpbb_dispatcher->trigger_event('core.session_create_after', compact($vars)));
+ unset($session_data);
+
+ return true;
+ }
+
+ /**
+ * Kills a session
+ *
+ * This method does what it says on the tin. It will delete a pre-existing session.
+ * It resets cookie information (destroying any autologin key within that cookie data)
+ * and update the users information from the relevant session data. It will then
+ * grab guest user information.
+ */
+ function session_kill($new_session = true)
+ {
+ global $SID, $_SID, $db, $config, $phpbb_root_path, $phpEx, $phpbb_container, $phpbb_dispatcher;
+
+ $sql = 'DELETE FROM ' . SESSIONS_TABLE . "
+ WHERE session_id = '" . $db->sql_escape($this->session_id) . "'
+ AND session_user_id = " . (int) $this->data['user_id'];
+ $db->sql_query($sql);
+
+ $user_id = (int) $this->data['user_id'];
+ $session_id = $this->session_id;
+ /**
+ * Event to send session kill information to extension
+ * Read-only event
+ *
+ * @event core.session_kill_after
+ * @var int user_id user_id of the session user.
+ * @var string session_id current user's session_id
+ * @var bool new_session should we create new session for user
+ * @since 3.1.6-RC1
+ */
+ $vars = array('user_id', 'session_id', 'new_session');
+ extract($phpbb_dispatcher->trigger_event('core.session_kill_after', compact($vars)));
+ unset($user_id);
+ unset($session_id);
+
+ // Allow connecting logout with external auth method logout
+ $provider_collection = $phpbb_container->get('auth.provider_collection');
+ $provider = $provider_collection->get_provider();
+ $provider->logout($this->data, $new_session);
+
+ if ($this->data['user_id'] != ANONYMOUS)
+ {
+ // Delete existing session, update last visit info first!
+ if (!isset($this->data['session_time']))
+ {
+ $this->data['session_time'] = time();
+ }
+
+ $sql = 'UPDATE ' . USERS_TABLE . '
+ SET user_lastvisit = ' . (int) $this->data['session_time'] . '
+ WHERE user_id = ' . (int) $this->data['user_id'];
+ $db->sql_query($sql);
+
+ if ($this->cookie_data['k'])
+ {
+ $sql = 'DELETE FROM ' . SESSIONS_KEYS_TABLE . '
+ WHERE user_id = ' . (int) $this->data['user_id'] . "
+ AND key_id = '" . $db->sql_escape(md5($this->cookie_data['k'])) . "'";
+ $db->sql_query($sql);
+ }
+
+ // Reset the data array
+ $this->data = array();
+
+ $sql = 'SELECT *
+ FROM ' . USERS_TABLE . '
+ WHERE user_id = ' . ANONYMOUS;
+ $result = $db->sql_query($sql);
+ $this->data = $db->sql_fetchrow($result);
+ $db->sql_freeresult($result);
+ }
+
+ $cookie_expire = $this->time_now - 31536000;
+ $this->set_cookie('u', '', $cookie_expire);
+ $this->set_cookie('k', '', $cookie_expire);
+ $this->set_cookie('sid', '', $cookie_expire);
+ unset($cookie_expire);
+
+ $SID = '?sid=';
+ $this->session_id = $_SID = '';
+
+ // To make sure a valid session is created we create one for the anonymous user
+ if ($new_session)
+ {
+ $this->session_create(ANONYMOUS);
+ }
+
+ return true;
+ }
+
+ /**
+ * Session garbage collection
+ *
+ * This looks a lot more complex than it really is. Effectively we are
+ * deleting any sessions older than an admin definable limit. Due to the
+ * way in which we maintain session data we have to ensure we update user
+ * data before those sessions are destroyed. In addition this method
+ * removes autologin key information that is older than an admin defined
+ * limit.
+ */
+ function session_gc()
+ {
+ global $db, $config, $phpbb_root_path, $phpEx, $phpbb_container, $phpbb_dispatcher;
+
+ $batch_size = 10;
+
+ if (!$this->time_now)
+ {
+ $this->time_now = time();
+ }
+
+ // Firstly, delete guest sessions
+ $sql = 'DELETE FROM ' . SESSIONS_TABLE . '
+ WHERE session_user_id = ' . ANONYMOUS . '
+ AND session_time < ' . (int) ($this->time_now - $config['session_length']);
+ $db->sql_query($sql);
+
+ // Get expired sessions, only most recent for each user
+ $sql = 'SELECT session_user_id, session_page, MAX(session_time) AS recent_time
+ FROM ' . SESSIONS_TABLE . '
+ WHERE session_time < ' . ($this->time_now - $config['session_length']) . '
+ GROUP BY session_user_id, session_page';
+ $result = $db->sql_query_limit($sql, $batch_size);
+
+ $del_user_id = array();
+ $del_sessions = 0;
+
+ while ($row = $db->sql_fetchrow($result))
+ {
+ $sql = 'UPDATE ' . USERS_TABLE . '
+ SET user_lastvisit = ' . (int) $row['recent_time'] . ", user_lastpage = '" . $db->sql_escape($row['session_page']) . "'
+ WHERE user_id = " . (int) $row['session_user_id'];
+ $db->sql_query($sql);
+
+ $del_user_id[] = (int) $row['session_user_id'];
+ $del_sessions++;
+ }
+ $db->sql_freeresult($result);
+
+ if (sizeof($del_user_id))
+ {
+ // Delete expired sessions
+ $sql = 'DELETE FROM ' . SESSIONS_TABLE . '
+ WHERE ' . $db->sql_in_set('session_user_id', $del_user_id) . '
+ AND session_time < ' . ($this->time_now - $config['session_length']);
+ $db->sql_query($sql);
+ }
+
+ if ($del_sessions < $batch_size)
+ {
+ // Less than 10 users, update gc timer ... else we want gc
+ // called again to delete other sessions
+ set_config('session_last_gc', $this->time_now, true);
+
+ if ($config['max_autologin_time'])
+ {
+ $sql = 'DELETE FROM ' . SESSIONS_KEYS_TABLE . '
+ WHERE last_login < ' . (time() - (86400 * (int) $config['max_autologin_time']));
+ $db->sql_query($sql);
+ }
+
+ // only called from CRON; should be a safe workaround until the infrastructure gets going
+ $captcha_factory = $phpbb_container->get('captcha.factory');
+ $captcha_factory->garbage_collect($config['captcha_plugin']);
+
+ $sql = 'DELETE FROM ' . LOGIN_ATTEMPT_TABLE . '
+ WHERE attempt_time < ' . (time() - (int) $config['ip_login_limit_time']);
+ $db->sql_query($sql);
+ }
+
+ /**
+ * Event to trigger extension on session_gc
+ *
+ * @event core.session_gc_after
+ * @since 3.1.6-RC1
+ */
+ $phpbb_dispatcher->dispatch('core.session_gc_after');
+
+ return;
+ }
+
+ /**
+ * Sets a cookie
+ *
+ * Sets a cookie of the given name with the specified data for the given length of time. If no time is specified, a session cookie will be set.
+ *
+ * @param string $name Name of the cookie, will be automatically prefixed with the phpBB cookie name. track becomes [cookie_name]_track then.
+ * @param string $cookiedata The data to hold within the cookie
+ * @param int $cookietime The expiration time as UNIX timestamp. If 0 is provided, a session cookie is set.
+ * @param bool $httponly Use HttpOnly. Defaults to true. Use false to make cookie accessible by client-side scripts.
+ */
+ function set_cookie($name, $cookiedata, $cookietime, $httponly = true)
+ {
+ global $config;
+
+ $name_data = rawurlencode($config['cookie_name'] . '_' . $name) . '=' . rawurlencode($cookiedata);
+ $expire = gmdate('D, d-M-Y H:i:s \\G\\M\\T', $cookietime);
+ $domain = (!$config['cookie_domain'] || $config['cookie_domain'] == '127.0.0.1' || strpos($config['cookie_domain'], '.') === false) ? '' : '; domain=' . $config['cookie_domain'];
+
+ header('Set-Cookie: ' . $name_data . (($cookietime) ? '; expires=' . $expire : '') . '; path=' . $config['cookie_path'] . $domain . ((!$config['cookie_secure']) ? '' : '; secure') . ';' . (($httponly) ? ' HttpOnly' : ''), false);
+ }
+
+ /**
+ * Check for banned user
+ *
+ * Checks whether the supplied user is banned by id, ip or email. If no parameters
+ * are passed to the method pre-existing session data is used.
+ *
+ * @param int|false $user_id The user id
+ * @param mixed $user_ips Can contain a string with one IP or an array of multiple IPs
+ * @param string|false $user_email The user email
+ * @param bool $return If $return is false this routine does not return on finding a banned user,
+ * it outputs a relevant message and stops execution.
+ */
+ function check_ban($user_id = false, $user_ips = false, $user_email = false, $return = false)
+ {
+ global $config, $db, $phpbb_dispatcher;
+
+ if (defined('IN_CHECK_BAN') || defined('SKIP_CHECK_BAN'))
+ {
+ return;
+ }
+
+ $banned = false;
+ $cache_ttl = 3600;
+ $where_sql = array();
+
+ $sql = 'SELECT ban_ip, ban_userid, ban_email, ban_exclude, ban_give_reason, ban_end
+ FROM ' . BANLIST_TABLE . '
+ WHERE ';
+
+ // Determine which entries to check, only return those
+ if ($user_email === false)
+ {
+ $where_sql[] = "ban_email = ''";
+ }
+
+ if ($user_ips === false)
+ {
+ $where_sql[] = "(ban_ip = '' OR ban_exclude = 1)";
+ }
+
+ if ($user_id === false)
+ {
+ $where_sql[] = '(ban_userid = 0 OR ban_exclude = 1)';
+ }
+ else
+ {
+ $cache_ttl = ($user_id == ANONYMOUS) ? 3600 : 0;
+ $_sql = '(ban_userid = ' . $user_id;
+
+ if ($user_email !== false)
+ {
+ $_sql .= " OR ban_email <> ''";
+ }
+
+ if ($user_ips !== false)
+ {
+ $_sql .= " OR ban_ip <> ''";
+ }
+
+ $_sql .= ')';
+
+ $where_sql[] = $_sql;
+ }
+
+ $sql .= (sizeof($where_sql)) ? implode(' AND ', $where_sql) : '';
+ $result = $db->sql_query($sql, $cache_ttl);
+
+ $ban_triggered_by = 'user';
+ while ($row = $db->sql_fetchrow($result))
+ {
+ if ($row['ban_end'] && $row['ban_end'] < time())
+ {
+ continue;
+ }
+
+ $ip_banned = false;
+ if (!empty($row['ban_ip']))
+ {
+ if (!is_array($user_ips))
+ {
+ $ip_banned = preg_match('#^' . str_replace('\*', '.*?', preg_quote($row['ban_ip'], '#')) . '$#i', $user_ips);
+ }
+ else
+ {
+ foreach ($user_ips as $user_ip)
+ {
+ if (preg_match('#^' . str_replace('\*', '.*?', preg_quote($row['ban_ip'], '#')) . '$#i', $user_ip))
+ {
+ $ip_banned = true;
+ break;
+ }
+ }
+ }
+ }
+
+ if ((!empty($row['ban_userid']) && intval($row['ban_userid']) == $user_id) ||
+ $ip_banned ||
+ (!empty($row['ban_email']) && preg_match('#^' . str_replace('\*', '.*?', preg_quote($row['ban_email'], '#')) . '$#i', $user_email)))
+ {
+ if (!empty($row['ban_exclude']))
+ {
+ $banned = false;
+ break;
+ }
+ else
+ {
+ $banned = true;
+ $ban_row = $row;
+
+ if (!empty($row['ban_userid']) && intval($row['ban_userid']) == $user_id)
+ {
+ $ban_triggered_by = 'user';
+ }
+ else if ($ip_banned)
+ {
+ $ban_triggered_by = 'ip';
+ }
+ else
+ {
+ $ban_triggered_by = 'email';
+ }
+
+ // Don't break. Check if there is an exclude rule for this user
+ }
+ }
+ }
+ $db->sql_freeresult($result);
+
+ /**
+ * Event to set custom ban type
+ *
+ * @event core.session_set_custom_ban
+ * @var bool return If $return is false this routine does not return on finding a banned user, it outputs a relevant message and stops execution
+ * @var bool banned Check if user already banned
+ * @var array|false ban_row Ban data
+ * @var string ban_triggered_by Method that caused ban, can be your custom method
+ * @since 3.1.3-RC1
+ */
+ $ban_row = isset($ban_row) ? $ban_row : false;
+ $vars = array('return', 'banned', 'ban_row', 'ban_triggered_by');
+ extract($phpbb_dispatcher->trigger_event('core.session_set_custom_ban', compact($vars)));
+
+ if ($banned && !$return)
+ {
+ global $template, $phpbb_root_path, $phpEx;
+
+ // If the session is empty we need to create a valid one...
+ if (empty($this->session_id))
+ {
+ // This seems to be no longer needed? - #14971
+// $this->session_create(ANONYMOUS);
+ }
+
+ // Initiate environment ... since it won't be set at this stage
+ $this->setup();
+
+ // Logout the user, banned users are unable to use the normal 'logout' link
+ if ($this->data['user_id'] != ANONYMOUS)
+ {
+ $this->session_kill();
+ }
+
+ // We show a login box here to allow founders accessing the board if banned by IP
+ if (defined('IN_LOGIN') && $this->data['user_id'] == ANONYMOUS)
+ {
+ $this->setup('ucp');
+ $this->data['is_registered'] = $this->data['is_bot'] = false;
+
+ // Set as a precaution to allow login_box() handling this case correctly as well as this function not being executed again.
+ define('IN_CHECK_BAN', 1);
+
+ login_box("index.$phpEx");
+
+ // The false here is needed, else the user is able to circumvent the ban.
+ $this->session_kill(false);
+ }
+
+ // Ok, we catch the case of an empty session id for the anonymous user...
+ // This can happen if the user is logging in, banned by username and the login_box() being called "again".
+ if (empty($this->session_id) && defined('IN_CHECK_BAN'))
+ {
+ $this->session_create(ANONYMOUS);
+ }
+
+ // Determine which message to output
+ $till_date = ($ban_row['ban_end']) ? $this->format_date($ban_row['ban_end']) : '';
+ $message = ($ban_row['ban_end']) ? 'BOARD_BAN_TIME' : 'BOARD_BAN_PERM';
+
+ $contact_link = phpbb_get_board_contact_link($config, $phpbb_root_path, $phpEx);
+ $message = sprintf($this->lang[$message], $till_date, '<a href="' . $contact_link . '">', '</a>');
+ $message .= ($ban_row['ban_give_reason']) ? '<br /><br />' . sprintf($this->lang['BOARD_BAN_REASON'], $ban_row['ban_give_reason']) : '';
+ $message .= '<br /><br /><em>' . $this->lang['BAN_TRIGGERED_BY_' . strtoupper($ban_triggered_by)] . '</em>';
+
+ // A very special case... we are within the cron script which is not supposed to print out the ban message... show blank page
+ if (defined('IN_CRON'))
+ {
+ garbage_collection();
+ exit_handler();
+ exit;
+ }
+
+ // To circumvent session_begin returning a valid value and the check_ban() not called on second page view, we kill the session again
+ $this->session_kill(false);
+
+ trigger_error($message);
+ }
+
+ return ($banned && $ban_row['ban_give_reason']) ? $ban_row['ban_give_reason'] : $banned;
+ }
+
+ /**
+ * Check the current session for bans
+ *
+ * @return true if session user is banned.
+ */
+ protected function check_ban_for_current_session($config)
+ {
+ if (!defined('SKIP_CHECK_BAN') && $this->data['user_type'] != USER_FOUNDER)
+ {
+ if (!$config['forwarded_for_check'])
+ {
+ $this->check_ban($this->data['user_id'], $this->ip);
+ }
+ else
+ {
+ $ips = explode(' ', $this->forwarded_for);
+ $ips[] = $this->ip;
+ $this->check_ban($this->data['user_id'], $ips);
+ }
+ }
+ }
+
+ /**
+ * Check if ip is blacklisted
+ * This should be called only where absolutely necessary
+ *
+ * Only IPv4 (rbldns does not support AAAA records/IPv6 lookups)
+ *
+ * @author satmd (from the php manual)
+ * @param string $mode register/post - spamcop for example is ommitted for posting
+ * @param string|false $ip the IPv4 address to check
+ *
+ * @return false if ip is not blacklisted, else an array([checked server], [lookup])
+ */
+ function check_dnsbl($mode, $ip = false)
+ {
+ if ($ip === false)
+ {
+ $ip = $this->ip;
+ }
+
+ // Neither Spamhaus nor Spamcop supports IPv6 addresses.
+ if (strpos($ip, ':') !== false)
+ {
+ return false;
+ }
+
+ $dnsbl_check = array(
+ 'sbl.spamhaus.org' => 'http://www.spamhaus.org/query/bl?ip=',
+ );
+
+ if ($mode == 'register')
+ {
+ $dnsbl_check['bl.spamcop.net'] = 'http://spamcop.net/bl.shtml?';
+ }
+
+ if ($ip)
+ {
+ $quads = explode('.', $ip);
+ $reverse_ip = $quads[3] . '.' . $quads[2] . '.' . $quads[1] . '.' . $quads[0];
+
+ // Need to be listed on all servers...
+ $listed = true;
+ $info = array();
+
+ foreach ($dnsbl_check as $dnsbl => $lookup)
+ {
+ if (phpbb_checkdnsrr($reverse_ip . '.' . $dnsbl . '.', 'A') === true)
+ {
+ $info = array($dnsbl, $lookup . $ip);
+ }
+ else
+ {
+ $listed = false;
+ }
+ }
+
+ if ($listed)
+ {
+ return $info;
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * Check if URI is blacklisted
+ * This should be called only where absolutly necessary, for example on the submitted website field
+ * This function is not in use at the moment and is only included for testing purposes, it may not work at all!
+ * This means it is untested at the moment and therefore commented out
+ *
+ * @param string $uri URI to check
+ * @return true if uri is on blacklist, else false. Only blacklist is checked (~zero FP), no grey lists
+ function check_uribl($uri)
+ {
+ // Normally parse_url() is not intended to parse uris
+ // We need to get the top-level domain name anyway... change.
+ $uri = parse_url($uri);
+
+ if ($uri === false || empty($uri['host']))
+ {
+ return false;
+ }
+
+ $uri = trim($uri['host']);
+
+ if ($uri)
+ {
+ // One problem here... the return parameter for the "windows" method is different from what
+ // we expect... this may render this check useless...
+ if (phpbb_checkdnsrr($uri . '.multi.uribl.com.', 'A') === true)
+ {
+ return true;
+ }
+ }
+
+ return false;
+ }
+ */
+
+ /**
+ * Set/Update a persistent login key
+ *
+ * This method creates or updates a persistent session key. When a user makes
+ * use of persistent (formerly auto-) logins a key is generated and stored in the
+ * DB. When they revisit with the same key it's automatically updated in both the
+ * DB and cookie. Multiple keys may exist for each user representing different
+ * browsers or locations. As with _any_ non-secure-socket no passphrase login this
+ * remains vulnerable to exploit.
+ */
+ function set_login_key($user_id = false, $key = false, $user_ip = false)
+ {
+ global $config, $db;
+
+ $user_id = ($user_id === false) ? $this->data['user_id'] : $user_id;
+ $user_ip = ($user_ip === false) ? $this->ip : $user_ip;
+ $key = ($key === false) ? (($this->cookie_data['k']) ? $this->cookie_data['k'] : false) : $key;
+
+ $key_id = unique_id(hexdec(substr($this->session_id, 0, 8)));
+
+ $sql_ary = array(
+ 'key_id' => (string) md5($key_id),
+ 'last_ip' => (string) $this->ip,
+ 'last_login' => (int) time()
+ );
+
+ if (!$key)
+ {
+ $sql_ary += array(
+ 'user_id' => (int) $user_id
+ );
+ }
+
+ if ($key)
+ {
+ $sql = 'UPDATE ' . SESSIONS_KEYS_TABLE . '
+ SET ' . $db->sql_build_array('UPDATE', $sql_ary) . '
+ WHERE user_id = ' . (int) $user_id . "
+ AND key_id = '" . $db->sql_escape(md5($key)) . "'";
+ }
+ else
+ {
+ $sql = 'INSERT INTO ' . SESSIONS_KEYS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary);
+ }
+ $db->sql_query($sql);
+
+ $this->cookie_data['k'] = $key_id;
+
+ return false;
+ }
+
+ /**
+ * Reset all login keys for the specified user
+ *
+ * This method removes all current login keys for a specified (or the current)
+ * user. It will be called on password change to render old keys unusable
+ */
+ function reset_login_keys($user_id = false)
+ {
+ global $config, $db;
+
+ $user_id = ($user_id === false) ? (int) $this->data['user_id'] : (int) $user_id;
+
+ $sql = 'DELETE FROM ' . SESSIONS_KEYS_TABLE . '
+ WHERE user_id = ' . (int) $user_id;
+ $db->sql_query($sql);
+
+ // If the user is logged in, update last visit info first before deleting sessions
+ $sql = 'SELECT session_time, session_page
+ FROM ' . SESSIONS_TABLE . '
+ WHERE session_user_id = ' . (int) $user_id . '
+ ORDER BY session_time DESC';
+ $result = $db->sql_query_limit($sql, 1);
+ $row = $db->sql_fetchrow($result);
+ $db->sql_freeresult($result);
+
+ if ($row)
+ {
+ $sql = 'UPDATE ' . USERS_TABLE . '
+ SET user_lastvisit = ' . (int) $row['session_time'] . ", user_lastpage = '" . $db->sql_escape($row['session_page']) . "'
+ WHERE user_id = " . (int) $user_id;
+ $db->sql_query($sql);
+ }
+
+ // Let's also clear any current sessions for the specified user_id
+ // If it's the current user then we'll leave this session intact
+ $sql_where = 'session_user_id = ' . (int) $user_id;
+ $sql_where .= ($user_id === (int) $this->data['user_id']) ? " AND session_id <> '" . $db->sql_escape($this->session_id) . "'" : '';
+
+ $sql = 'DELETE FROM ' . SESSIONS_TABLE . "
+ WHERE $sql_where";
+ $db->sql_query($sql);
+
+ // We're changing the password of the current user and they have a key
+ // Lets regenerate it to be safe
+ if ($user_id === (int) $this->data['user_id'] && $this->cookie_data['k'])
+ {
+ $this->set_login_key($user_id);
+ }
+ }
+
+
+ /**
+ * Check if the request originated from the same page.
+ * @param bool $check_script_path If true, the path will be checked as well
+ */
+ function validate_referer($check_script_path = false)
+ {
+ global $config, $request;
+
+ // no referer - nothing to validate, user's fault for turning it off (we only check on POST; so meta can't be the reason)
+ if (empty($this->referer) || empty($this->host))
+ {
+ return true;
+ }
+
+ $host = htmlspecialchars($this->host);
+ $ref = substr($this->referer, strpos($this->referer, '://') + 3);
+
+ if (!(stripos($ref, $host) === 0) && (!$config['force_server_vars'] || !(stripos($ref, $config['server_name']) === 0)))
+ {
+ return false;
+ }
+ else if ($check_script_path && rtrim($this->page['root_script_path'], '/') !== '')
+ {
+ $ref = substr($ref, strlen($host));
+ $server_port = $request->server('SERVER_PORT', 0);
+
+ if ($server_port !== 80 && $server_port !== 443 && stripos($ref, ":$server_port") === 0)
+ {
+ $ref = substr($ref, strlen(":$server_port"));
+ }
+
+ if (!(stripos(rtrim($ref, '/'), rtrim($this->page['root_script_path'], '/')) === 0))
+ {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+
+ function unset_admin()
+ {
+ global $db;
+ $sql = 'UPDATE ' . SESSIONS_TABLE . '
+ SET session_admin = 0
+ WHERE session_id = \'' . $db->sql_escape($this->session_id) . '\'';
+ $db->sql_query($sql);
+ }
+
+ /**
+ * Update the session data
+ *
+ * @param array $session_data associative array of session keys to be updated
+ * @param string $session_id optional session_id, defaults to current user's session_id
+ */
+ public function update_session($session_data, $session_id = null)
+ {
+ global $db, $phpbb_dispatcher;
+
+ $session_id = ($session_id) ? $session_id : $this->session_id;
+
+ $sql = 'UPDATE ' . SESSIONS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $session_data) . "
+ WHERE session_id = '" . $db->sql_escape($session_id) . "'";
+ $db->sql_query($sql);
+
+ /**
+ * Event to send update session information to extension
+ * Read-only event
+ *
+ * @event core.update_session_after
+ * @var array session_data Associative array of session keys to be updated
+ * @var string session_id current user's session_id
+ * @since 3.1.6-RC1
+ */
+ $vars = array('session_data', 'session_id');
+ extract($phpbb_dispatcher->trigger_event('core.update_session_after', compact($vars)));
+ }
+
+ public function update_session_infos()
+ {
+ global $config, $db, $request;
+
+ // No need to update if it's a new session. Informations are already inserted by session_create()
+ if (isset($this->data['session_created']) && $this->data['session_created'])
+ {
+ return;
+ }
+
+ // Only update session DB a minute or so after last update or if page changes
+ if ($this->time_now - ((isset($this->data['session_time'])) ? $this->data['session_time'] : 0) > 60 || ($this->update_session_page && $this->data['session_page'] != $this->page['page']))
+ {
+ $sql_ary = array('session_time' => $this->time_now);
+
+ // Do not update the session page for ajax requests, so the view online still works as intended
+ if ($this->update_session_page && !$request->is_ajax())
+ {
+ $sql_ary['session_page'] = substr($this->page['page'], 0, 199);
+ $sql_ary['session_forum_id'] = $this->page['forum'];
+ }
+
+ $db->sql_return_on_error(true);
+
+ $this->update_session($sql_ary);
+
+ $db->sql_return_on_error(false);
+
+ $this->data = array_merge($this->data, $sql_ary);
+
+ if ($this->data['user_id'] != ANONYMOUS && isset($config['new_member_post_limit']) && $this->data['user_new'] && $config['new_member_post_limit'] <= $this->data['user_posts'])
+ {
+ $this->leave_newly_registered();
+ }
+ }
+ }
+}
diff --git a/phpBB/phpbb/symfony_request.php b/phpBB/phpbb/symfony_request.php
new file mode 100644
index 0000000000..2931cae3cc
--- /dev/null
+++ b/phpBB/phpbb/symfony_request.php
@@ -0,0 +1,39 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb;
+
+use Symfony\Component\HttpFoundation\Request;
+
+/**
+ * WARNING: The Symfony request does not escape the input and should be used very carefully
+ * prefer the phpbb request as possible
+ */
+class symfony_request extends Request
+{
+ /**
+ * Constructor
+ *
+ * @param \phpbb\request\request_interface $phpbb_request
+ */
+ public function __construct(\phpbb\request\request_interface $phpbb_request)
+ {
+ $get_parameters = $phpbb_request->get_super_global(\phpbb\request\request_interface::GET);
+ $post_parameters = $phpbb_request->get_super_global(\phpbb\request\request_interface::POST);
+ $server_parameters = $phpbb_request->get_super_global(\phpbb\request\request_interface::SERVER);
+ $files_parameters = $phpbb_request->get_super_global(\phpbb\request\request_interface::FILES);
+ $cookie_parameters = $phpbb_request->get_super_global(\phpbb\request\request_interface::COOKIE);
+
+ parent::__construct($get_parameters, $post_parameters, array(), $cookie_parameters, $files_parameters, $server_parameters);
+ }
+}
diff --git a/phpBB/phpbb/template/asset.php b/phpBB/phpbb/template/asset.php
new file mode 100644
index 0000000000..ff9366af4a
--- /dev/null
+++ b/phpBB/phpbb/template/asset.php
@@ -0,0 +1,205 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\template;
+
+class asset
+{
+ protected $components = array();
+
+ /** @var \phpbb\path_helper **/
+ protected $path_helper;
+
+ /**
+ * Constructor
+ *
+ * @param string $url URL
+ * @param \phpbb\path_helper $path_helper Path helper object
+ */
+ public function __construct($url, \phpbb\path_helper $path_helper)
+ {
+ $this->path_helper = $path_helper;
+
+ $this->set_url($url);
+ }
+
+ /**
+ * Set URL
+ *
+ * @param string $url URL
+ */
+ public function set_url($url)
+ {
+ if (version_compare(PHP_VERSION, '5.4.7') < 0 && substr($url, 0, 2) === '//')
+ {
+ // Workaround for PHP 5.4.6 and older bug #62844 - add fake scheme and then remove it
+ $this->components = parse_url('http:' . $url);
+ $this->components['scheme'] = '';
+ return;
+ }
+ $this->components = parse_url($url);
+ }
+
+ /**
+ * Convert URL components into string
+ *
+ * @param array $components URL components
+ * @return string URL
+ */
+ protected function join_url($components)
+ {
+ $path = '';
+ if (isset($components['scheme']))
+ {
+ $path = $components['scheme'] === '' ? '//' : $components['scheme'] . '://';
+ }
+
+ if (isset($components['user']) || isset($components['pass']))
+ {
+ if ($path === '' && !isset($components['port']))
+ {
+ $path = '//';
+ }
+ $path .= $components['user'];
+ if (isset($components['pass']))
+ {
+ $path .= ':' . $components['pass'];
+ }
+ $path .= '@';
+ }
+
+ if (isset($components['host']))
+ {
+ if ($path === '' && !isset($components['port']))
+ {
+ $path = '//';
+ }
+ $path .= $components['host'];
+ if (isset($components['port']))
+ {
+ $path .= ':' . $components['port'];
+ }
+ }
+
+ if (isset($components['path']))
+ {
+ $path .= $components['path'];
+ }
+
+ if (isset($components['query']))
+ {
+ $path .= '?' . $components['query'];
+ }
+
+ if (isset($components['fragment']))
+ {
+ $path .= '#' . $components['fragment'];
+ }
+
+ return $path;
+ }
+
+ /**
+ * Get URL
+ *
+ * @return string URL
+ */
+ public function get_url()
+ {
+ return $this->path_helper->update_web_root_path($this->join_url($this->components));
+ }
+
+ /**
+ * Checks if URL is local and relative
+ *
+ * @return boolean True if URL is local and relative
+ */
+ public function is_relative()
+ {
+ if (empty($this->components) || !isset($this->components['path']))
+ {
+ // Invalid URL
+ return false;
+ }
+ return !isset($this->components['scheme']) && !isset($this->components['host']) && substr($this->components['path'], 0, 1) !== '/';
+ }
+
+ /**
+ * Get path component of current URL
+ *
+ * @return string Path
+ */
+ public function get_path()
+ {
+ return isset($this->components['path']) ? $this->components['path'] : '';
+ }
+
+ /**
+ * Set path component
+ *
+ * @param string $path Path component
+ * @param boolean $urlencode If true, parts of path should be encoded with rawurlencode()
+ */
+ public function set_path($path, $urlencode = false)
+ {
+ // Since 1.7.0 Twig returns the real path of the file. We need it to be relative to the working directory.
+ $real_root_path = realpath($this->path_helper->get_phpbb_root_path()) . DIRECTORY_SEPARATOR;
+
+ // If the asset is under the phpBB root path we need to remove its path and then prepend $phpbb_root_path
+ if (substr($path . DIRECTORY_SEPARATOR, 0, strlen($real_root_path)) === $real_root_path)
+ {
+ $path = $this->path_helper->get_phpbb_root_path() . str_replace('\\', '/', substr($path, strlen($real_root_path)));
+ }
+ else
+ {
+ // Else we make the path relative to the current working directory
+ $real_root_path = realpath('.') . DIRECTORY_SEPARATOR;
+ if ($real_root_path && substr($path . DIRECTORY_SEPARATOR, 0, strlen($real_root_path)) === $real_root_path)
+ {
+ $path = str_replace('\\', '/', substr($path, strlen($real_root_path)));
+ }
+ }
+
+ if ($urlencode)
+ {
+ $paths = explode('/', $path);
+ foreach ($paths as &$dir)
+ {
+ $dir = rawurlencode($dir);
+ }
+ $path = implode('/', $paths);
+ }
+
+ $this->components['path'] = $path;
+ }
+
+ /**
+ * Add assets_version parameter to URL.
+ * Parameter will not be added if assets_version already exists in URL
+ *
+ * @param string $version Version
+ */
+ public function add_assets_version($version)
+ {
+ if (!isset($this->components['query']))
+ {
+ $this->components['query'] = 'assets_version=' . $version;
+ return;
+ }
+ $query = $this->components['query'];
+ if (!preg_match('/(^|[&;])assets_version=/', $query))
+ {
+ $this->components['query'] = $query . '&amp;assets_version=' . $version;
+ }
+ }
+}
diff --git a/phpBB/phpbb/template/base.php b/phpBB/phpbb/template/base.php
new file mode 100644
index 0000000000..41c0a01ba8
--- /dev/null
+++ b/phpBB/phpbb/template/base.php
@@ -0,0 +1,164 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\template;
+
+abstract class base implements template
+{
+ /**
+ * Template context.
+ * Stores template data used during template rendering.
+ *
+ * @var \phpbb\template\context
+ */
+ protected $context;
+
+ /**
+ * Array of filenames assigned to set_filenames
+ *
+ * @var array
+ */
+ protected $filenames = array();
+
+ /**
+ * {@inheritdoc}
+ */
+ public function set_filenames(array $filename_array)
+ {
+ $this->filenames = array_merge($this->filenames, $filename_array);
+
+ return $this;
+ }
+
+ /**
+ * Get a filename from the handle
+ *
+ * @param string $handle
+ * @return string
+ */
+ protected function get_filename_from_handle($handle)
+ {
+ return (isset($this->filenames[$handle])) ? $this->filenames[$handle] : $handle;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function destroy()
+ {
+ $this->context->clear();
+
+ return $this;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function destroy_block_vars($blockname)
+ {
+ $this->context->destroy_block_vars($blockname);
+
+ return $this;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function assign_vars(array $vararray)
+ {
+ foreach ($vararray as $key => $val)
+ {
+ $this->assign_var($key, $val);
+ }
+
+ return $this;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function assign_var($varname, $varval)
+ {
+ $this->context->assign_var($varname, $varval);
+
+ return $this;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function append_var($varname, $varval)
+ {
+ $this->context->append_var($varname, $varval);
+
+ return $this;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function assign_block_vars($blockname, array $vararray)
+ {
+ $this->context->assign_block_vars($blockname, $vararray);
+
+ return $this;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function assign_block_vars_array($blockname, array $block_vars_array)
+ {
+ $this->context->assign_block_vars_array($blockname, $block_vars_array);
+
+ return $this;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function alter_block_array($blockname, array $vararray, $key = false, $mode = 'insert')
+ {
+ return $this->context->alter_block_array($blockname, $vararray, $key, $mode);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function find_key_index($blockname, $key)
+ {
+ return $this->context->find_key_index($blockname, $key);
+ }
+
+ /**
+ * Calls hook if any is defined.
+ *
+ * @param string $handle Template handle being displayed.
+ * @param string $method Method name of the caller.
+ */
+ protected function call_hook($handle, $method)
+ {
+ global $phpbb_hook;
+
+ if (!empty($phpbb_hook) && $phpbb_hook->call_hook(array('template', $method), $handle, $this))
+ {
+ if ($phpbb_hook->hook_return(array('template', $method)))
+ {
+ $result = $phpbb_hook->hook_return_result(array('template', $method));
+ return array($result);
+ }
+ }
+
+ return false;
+ }
+}
diff --git a/phpBB/phpbb/template/context.php b/phpBB/phpbb/template/context.php
new file mode 100644
index 0000000000..5d04a09865
--- /dev/null
+++ b/phpBB/phpbb/template/context.php
@@ -0,0 +1,540 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\template;
+
+/**
+* Stores variables assigned to template.
+*/
+class context
+{
+ /**
+ * variable that holds all the data we'll be substituting into
+ * the compiled templates. Takes form:
+ * --> $this->tpldata[block][iteration#][child][iteration#][child2][iteration#][variablename] == value
+ * if it's a root-level variable, it'll be like this:
+ * --> $this->tpldata[.][0][varname] == value
+ *
+ * @var array
+ */
+ private $tpldata = array('.' => array(0 => array()));
+
+ /**
+ * @var array Reference to template->tpldata['.'][0]
+ */
+ private $rootref;
+
+ /**
+ * @var bool
+ */
+ private $num_rows_is_set;
+
+ public function __construct()
+ {
+ $this->clear();
+ }
+
+ /**
+ * Clears template data set.
+ */
+ public function clear()
+ {
+ $this->tpldata = array('.' => array(0 => array()));
+ $this->rootref = &$this->tpldata['.'][0];
+ $this->num_rows_is_set = false;
+ }
+
+ /**
+ * Assign a single scalar value to a single key.
+ *
+ * Value can be a string, an integer or a boolean.
+ *
+ * @param string $varname Variable name
+ * @param string $varval Value to assign to variable
+ * @return true
+ */
+ public function assign_var($varname, $varval)
+ {
+ $this->rootref[$varname] = $varval;
+
+ return true;
+ }
+
+ /**
+ * Append text to the string value stored in a key.
+ *
+ * Text is appended using the string concatenation operator (.).
+ *
+ * @param string $varname Variable name
+ * @param string $varval Value to append to variable
+ * @return true
+ */
+ public function append_var($varname, $varval)
+ {
+ $this->rootref[$varname] = (isset($this->rootref[$varname]) ? $this->rootref[$varname] : '') . $varval;
+
+ return true;
+ }
+
+ /**
+ * Returns a reference to template data array.
+ *
+ * This function is public so that template renderer may invoke it.
+ * Users should alter template variables via functions in \phpbb\template\template.
+ *
+ * Note: modifying returned array will affect data stored in the context.
+ *
+ * @return array template data
+ */
+ public function &get_data_ref()
+ {
+ // returning a reference directly is not
+ // something php is capable of doing
+ $ref = &$this->tpldata;
+
+ if (!$this->num_rows_is_set)
+ {
+ /*
+ * We do not set S_NUM_ROWS while adding a row, to reduce the complexity
+ * If we would set it on adding, each subsequent adding would cause
+ * n modifications, resulting in a O(n!) complexity, rather then O(n)
+ */
+ foreach ($ref as $loop_name => &$loop_data)
+ {
+ if ($loop_name === '.')
+ {
+ continue;
+ }
+
+ $this->set_num_rows($loop_data);
+ }
+ $this->num_rows_is_set = true;
+ }
+
+ return $ref;
+ }
+
+ /**
+ * Set S_NUM_ROWS for each row in this template block
+ *
+ * @param array $loop_data
+ */
+ protected function set_num_rows(&$loop_data)
+ {
+ $s_num_rows = sizeof($loop_data);
+ foreach ($loop_data as &$mod_block)
+ {
+ foreach ($mod_block as $sub_block_name => &$sub_block)
+ {
+ // If the key name is lowercase and the data is an array,
+ // it could be a template loop. So we set the S_NUM_ROWS there
+ // aswell.
+ if ($sub_block_name === strtolower($sub_block_name) && is_array($sub_block))
+ {
+ $this->set_num_rows($sub_block);
+ }
+ }
+
+ // Check whether we are inside a block before setting the variable
+ if (isset($mod_block['S_BLOCK_NAME']))
+ {
+ $mod_block['S_NUM_ROWS'] = $s_num_rows;
+ }
+ }
+ }
+
+ /**
+ * Returns a reference to template root scope.
+ *
+ * This function is public so that template renderer may invoke it.
+ * Users should not need to invoke this function.
+ *
+ * Note: modifying returned array will affect data stored in the context.
+ *
+ * @return array template data
+ */
+ public function &get_root_ref()
+ {
+ // rootref is already a reference
+ return $this->rootref;
+ }
+
+ /**
+ * Assign key variable pairs from an array to a specified block
+ *
+ * @param string $blockname Name of block to assign $vararray to
+ * @param array $vararray A hash of variable name => value pairs
+ * @return true
+ */
+ public function assign_block_vars($blockname, array $vararray)
+ {
+ $this->num_rows_is_set = false;
+ if (strpos($blockname, '.') !== false)
+ {
+ // Nested block.
+ $blocks = explode('.', $blockname);
+ $blockcount = sizeof($blocks) - 1;
+
+ $str = &$this->tpldata;
+ for ($i = 0; $i < $blockcount; $i++)
+ {
+ $str = &$str[$blocks[$i]];
+ $str = &$str[sizeof($str) - 1];
+ }
+
+ $s_row_count = isset($str[$blocks[$blockcount]]) ? sizeof($str[$blocks[$blockcount]]) : 0;
+ $vararray['S_ROW_COUNT'] = $vararray['S_ROW_NUM'] = $s_row_count;
+
+ // Assign S_FIRST_ROW
+ if (!$s_row_count)
+ {
+ $vararray['S_FIRST_ROW'] = true;
+ }
+
+ // Assign S_BLOCK_NAME
+ $vararray['S_BLOCK_NAME'] = $blocks[$blockcount];
+
+ // Now the tricky part, we always assign S_LAST_ROW and remove the entry before
+ // This is much more clever than going through the complete template data on display (phew)
+ $vararray['S_LAST_ROW'] = true;
+ if ($s_row_count > 0)
+ {
+ unset($str[$blocks[$blockcount]][($s_row_count - 1)]['S_LAST_ROW']);
+ }
+
+ // Now we add the block that we're actually assigning to.
+ // We're adding a new iteration to this block with the given
+ // variable assignments.
+ $str[$blocks[$blockcount]][] = $vararray;
+ }
+ else
+ {
+ // Top-level block.
+ $s_row_count = (isset($this->tpldata[$blockname])) ? sizeof($this->tpldata[$blockname]) : 0;
+ $vararray['S_ROW_COUNT'] = $vararray['S_ROW_NUM'] = $s_row_count;
+
+ // Assign S_FIRST_ROW
+ if (!$s_row_count)
+ {
+ $vararray['S_FIRST_ROW'] = true;
+ }
+
+ // Assign S_BLOCK_NAME
+ $vararray['S_BLOCK_NAME'] = $blockname;
+
+ // We always assign S_LAST_ROW and remove the entry before
+ $vararray['S_LAST_ROW'] = true;
+ if ($s_row_count > 0)
+ {
+ unset($this->tpldata[$blockname][($s_row_count - 1)]['S_LAST_ROW']);
+ }
+
+ // Add a new iteration to this block with the variable assignments we were given.
+ $this->tpldata[$blockname][] = $vararray;
+ }
+
+ return true;
+ }
+
+ /**
+ * Assign key variable pairs from an array to a whole specified block loop
+ *
+ * @param string $blockname Name of block to assign $block_vars_array to
+ * @param array $block_vars_array An array of hashes of variable name => value pairs
+ * @return true
+ */
+ public function assign_block_vars_array($blockname, array $block_vars_array)
+ {
+ foreach ($block_vars_array as $vararray)
+ {
+ $this->assign_block_vars($blockname, $vararray);
+ }
+
+ return true;
+ }
+
+ /**
+ * Find the index for a specified key in the innermost specified block
+ *
+ * @param string $blockname the blockname, for example 'loop'
+ * @param mixed $key Key to search for
+ *
+ * array: KEY => VALUE [the key/value pair to search for within the loop to determine the correct position]
+ *
+ * int: Position [the position to search for]
+ *
+ * If key is false the position is set to 0
+ * If key is true the position is set to the last entry
+ *
+ * @return mixed false if not found, index position otherwise; be sure to test with ===
+ */
+ public function find_key_index($blockname, $key)
+ {
+ // For nested block, $blockcount > 0, for top-level block, $blockcount == 0
+ $blocks = explode('.', $blockname);
+ $blockcount = sizeof($blocks) - 1;
+
+ $block = $this->tpldata;
+ for ($i = 0; $i < $blockcount; $i++)
+ {
+ if (($pos = strpos($blocks[$i], '[')) !== false)
+ {
+ $name = substr($blocks[$i], 0, $pos);
+
+ if (strpos($blocks[$i], '[]') === $pos)
+ {
+ $index = sizeof($block[$name]) - 1;
+ }
+ else
+ {
+ $index = min((int) substr($blocks[$i], $pos + 1, -1), sizeof($block[$name]) - 1);
+ }
+ }
+ else
+ {
+ $name = $blocks[$i];
+ $index = sizeof($block[$name]) - 1;
+ }
+ if (!isset($block[$name]))
+ {
+ return false;
+ }
+ $block = $block[$name];
+ if (!isset($block[$index]))
+ {
+ return false;
+ }
+ $block = $block[$index];
+ }
+
+ if (!isset($block[$blocks[$i]]))
+ {
+ return false;
+ }
+ $block = $block[$blocks[$i]]; // Traverse the last block
+
+ // Change key to zero (change first position) if false and to last position if true
+ if ($key === false || $key === true)
+ {
+ return ($key === false) ? 0 : sizeof($block) - 1;
+ }
+
+ // Get correct position if array given
+ if (is_array($key))
+ {
+ // Search array to get correct position
+ list($search_key, $search_value) = @each($key);
+ foreach ($block as $i => $val_ary)
+ {
+ if ($val_ary[$search_key] === $search_value)
+ {
+ return $i;
+ }
+ }
+ }
+
+ return (is_int($key) && ((0 <= $key) && ($key < sizeof($block)))) ? $key : false;
+ }
+
+ /**
+ * Change already assigned key variable pair (one-dimensional - single loop entry)
+ *
+ * An example of how to use this function:
+ * {@example alter_block_array.php}
+ *
+ * @param string $blockname the blockname, for example 'loop'
+ * @param array $vararray the var array to insert/add or merge
+ * @param mixed $key Key to search for
+ *
+ * array: KEY => VALUE [the key/value pair to search for within the loop to determine the correct position]
+ *
+ * int: Position [the position to change or insert at directly given]
+ *
+ * If key is false the position is set to 0
+ * If key is true the position is set to the last entry
+ *
+ * @param string $mode Mode to execute (valid modes are 'insert' and 'change')
+ *
+ * If insert, the vararray is inserted at the given position (position counting from zero).
+ * If change, the current block gets merged with the vararray (resulting in new key/value pairs be added and existing keys be replaced by the new \value).
+ *
+ * Since counting begins by zero, inserting at the last position will result in this array: array(vararray, last positioned array)
+ * and inserting at position 1 will result in this array: array(first positioned array, vararray, following vars)
+ *
+ * @return bool false on error, true on success
+ */
+ public function alter_block_array($blockname, array $vararray, $key = false, $mode = 'insert')
+ {
+ $this->num_rows_is_set = false;
+
+ // For nested block, $blockcount > 0, for top-level block, $blockcount == 0
+ $blocks = explode('.', $blockname);
+ $blockcount = sizeof($blocks) - 1;
+
+ $block = &$this->tpldata;
+ for ($i = 0; $i < $blockcount; $i++)
+ {
+ if (($pos = strpos($blocks[$i], '[')) !== false)
+ {
+ $name = substr($blocks[$i], 0, $pos);
+
+ if (strpos($blocks[$i], '[]') === $pos)
+ {
+ $index = sizeof($block[$name]) - 1;
+ }
+ else
+ {
+ $index = min((int) substr($blocks[$i], $pos + 1, -1), sizeof($block[$name]) - 1);
+ }
+ }
+ else
+ {
+ $name = $blocks[$i];
+ $index = sizeof($block[$name]) - 1;
+ }
+ $block = &$block[$name];
+ $block = &$block[$index];
+ }
+ $name = $blocks[$i];
+
+ // If last block does not exist and we are inserting, and not searching for key, we create it empty; otherwise, nothing to do
+ if (!isset($block[$name]))
+ {
+ if ($mode != 'insert' || is_array($key))
+ {
+ return false;
+ }
+ $block[$name] = array();
+ }
+
+ $block = &$block[$name]; // Now we can traverse the last block
+
+ // Change key to zero (change first position) if false and to last position if true
+ if ($key === false || $key === true)
+ {
+ $key = ($key === false) ? 0 : sizeof($block);
+ }
+
+ // Get correct position if array given
+ if (is_array($key))
+ {
+ // Search array to get correct position
+ list($search_key, $search_value) = @each($key);
+
+ $key = null;
+ foreach ($block as $i => $val_ary)
+ {
+ if ($val_ary[$search_key] === $search_value)
+ {
+ $key = $i;
+ break;
+ }
+ }
+
+ // key/value pair not found
+ if ($key === null)
+ {
+ return false;
+ }
+ }
+
+ // Insert Block
+ if ($mode == 'insert')
+ {
+ // Make sure we are not exceeding the last iteration
+ if ($key >= sizeof($block))
+ {
+ $key = sizeof($block);
+ unset($block[($key - 1)]['S_LAST_ROW']);
+ $vararray['S_LAST_ROW'] = true;
+ }
+ if ($key <= 0)
+ {
+ $key = 0;
+ unset($block[0]['S_FIRST_ROW']);
+ $vararray['S_FIRST_ROW'] = true;
+ }
+
+ // Assign S_BLOCK_NAME
+ $vararray['S_BLOCK_NAME'] = $name;
+
+ // Re-position template blocks
+ for ($i = sizeof($block); $i > $key; $i--)
+ {
+ $block[$i] = $block[$i-1];
+
+ $block[$i]['S_ROW_COUNT'] = $block[$i]['S_ROW_NUM'] = $i;
+ }
+
+ // Insert vararray at given position
+ $block[$key] = $vararray;
+ $block[$key]['S_ROW_COUNT'] = $block[$key]['S_ROW_NUM'] = $key;
+
+ return true;
+ }
+
+ // Which block to change?
+ if ($mode == 'change')
+ {
+ // If key is out of bounds, do not change anything
+ if ($key > sizeof($block) || $key < 0)
+ {
+ return false;
+ }
+
+ if ($key == sizeof($block))
+ {
+ $key--;
+ }
+
+ $block[$key] = array_merge($block[$key], $vararray);
+
+ return true;
+ }
+
+ return false;
+ }
+
+ /**
+ * Reset/empty complete block
+ *
+ * @param string $blockname Name of block to destroy
+ * @return true
+ */
+ public function destroy_block_vars($blockname)
+ {
+ $this->num_rows_is_set = false;
+ if (strpos($blockname, '.') !== false)
+ {
+ // Nested block.
+ $blocks = explode('.', $blockname);
+ $blockcount = sizeof($blocks) - 1;
+
+ $str = &$this->tpldata;
+ for ($i = 0; $i < $blockcount; $i++)
+ {
+ $str = &$str[$blocks[$i]];
+ $str = &$str[sizeof($str) - 1];
+ }
+
+ unset($str[$blocks[$blockcount]]);
+ }
+ else
+ {
+ // Top-level block.
+ unset($this->tpldata[$blockname]);
+ }
+
+ return true;
+ }
+}
diff --git a/phpBB/phpbb/template/template.php b/phpBB/phpbb/template/template.php
new file mode 100644
index 0000000000..9e3d658ca8
--- /dev/null
+++ b/phpBB/phpbb/template/template.php
@@ -0,0 +1,199 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\template;
+
+interface template
+{
+
+ /**
+ * Clear the cache
+ *
+ * @return \phpbb\template\template
+ */
+ public function clear_cache();
+
+ /**
+ * Sets the template filenames for handles.
+ *
+ * @param array $filename_array Should be a hash of handle => filename pairs.
+ * @return \phpbb\template\template $this
+ */
+ public function set_filenames(array $filename_array);
+
+ /**
+ * Get the style tree of the style preferred by the current user
+ *
+ * @return array Style tree, most specific first
+ */
+ public function get_user_style();
+
+ /**
+ * Set style location based on (current) user's chosen style.
+ *
+ * @param array $style_directories The directories to add style paths for
+ * E.g. array('ext/foo/bar/styles', 'styles')
+ * Default: array('styles') (phpBB's style directory)
+ * @return \phpbb\template\template $this
+ */
+ public function set_style($style_directories = array('styles'));
+
+ /**
+ * Set custom style location (able to use directory outside of phpBB).
+ *
+ * Note: Templates are still compiled to phpBB's cache directory.
+ *
+ * @param string|array $names Array of names or string of name of template(s) in inheritance tree order, used by extensions.
+ * @param string|array or string $paths Array of style paths, relative to current root directory
+ * @return \phpbb\template\template $this
+ */
+ public function set_custom_style($names, $paths);
+
+ /**
+ * Clears all variables and blocks assigned to this template.
+ *
+ * @return \phpbb\template\template $this
+ */
+ public function destroy();
+
+ /**
+ * Reset/empty complete block
+ *
+ * @param string $blockname Name of block to destroy
+ * @return \phpbb\template\template $this
+ */
+ public function destroy_block_vars($blockname);
+
+ /**
+ * Display a template for provided handle.
+ *
+ * The template will be loaded and compiled, if necessary, first.
+ *
+ * This function calls hooks.
+ *
+ * @param string $handle Handle to display
+ * @return \phpbb\template\template $this
+ */
+ public function display($handle);
+
+ /**
+ * Display the handle and assign the output to a template variable
+ * or return the compiled result.
+ *
+ * @param string $handle Handle to operate on
+ * @param string $template_var Template variable to assign compiled handle to
+ * @param bool $return_content If true return compiled handle, otherwise assign to $template_var
+ * @return \phpbb\template\template|string if $return_content is true return string of the compiled handle, otherwise return $this
+ */
+ public function assign_display($handle, $template_var = '', $return_content = true);
+
+ /**
+ * Assign key variable pairs from an array
+ *
+ * @param array $vararray A hash of variable name => value pairs
+ * @return \phpbb\template\template $this
+ */
+ public function assign_vars(array $vararray);
+
+ /**
+ * Assign a single scalar value to a single key.
+ *
+ * Value can be a string, an integer or a boolean.
+ *
+ * @param string $varname Variable name
+ * @param string $varval Value to assign to variable
+ * @return \phpbb\template\template $this
+ */
+ public function assign_var($varname, $varval);
+
+ /**
+ * Append text to the string value stored in a key.
+ *
+ * Text is appended using the string concatenation operator (.).
+ *
+ * @param string $varname Variable name
+ * @param string $varval Value to append to variable
+ * @return \phpbb\template\template $this
+ */
+ public function append_var($varname, $varval);
+
+ /**
+ * Assign key variable pairs from an array to a specified block
+ * @param string $blockname Name of block to assign $vararray to
+ * @param array $vararray A hash of variable name => value pairs
+ * @return \phpbb\template\template $this
+ */
+ public function assign_block_vars($blockname, array $vararray);
+
+ /**
+ * Assign key variable pairs from an array to a whole specified block loop
+ * @param string $blockname Name of block to assign $block_vars_array to
+ * @param array $block_vars_array An array of hashes of variable name => value pairs
+ * @return \phpbb\template\template $this
+ */
+ public function assign_block_vars_array($blockname, array $block_vars_array);
+
+ /**
+ * Change already assigned key variable pair (one-dimensional - single loop entry)
+ *
+ * An example of how to use this function:
+ * {@example alter_block_array.php}
+ *
+ * @param string $blockname the blockname, for example 'loop'
+ * @param array $vararray the var array to insert/add or merge
+ * @param mixed $key Key to search for
+ *
+ * array: KEY => VALUE [the key/value pair to search for within the loop to determine the correct position]
+ *
+ * int: Position [the position to change or insert at directly given]
+ *
+ * If key is false the position is set to 0
+ * If key is true the position is set to the last entry
+ *
+ * @param string $mode Mode to execute (valid modes are 'insert' and 'change')
+ *
+ * If insert, the vararray is inserted at the given position (position counting from zero).
+ * If change, the current block gets merged with the vararray (resulting in new \key/value pairs be added and existing keys be replaced by the new \value).
+ *
+ * Since counting begins by zero, inserting at the last position will result in this array: array(vararray, last positioned array)
+ * and inserting at position 1 will result in this array: array(first positioned array, vararray, following vars)
+ *
+ * @return bool false on error, true on success
+ */
+ public function alter_block_array($blockname, array $vararray, $key = false, $mode = 'insert');
+
+ /**
+ * Find the index for a specified key in the innermost specified block
+ *
+ * @param string $blockname the blockname, for example 'loop'
+ * @param mixed $key Key to search for
+ *
+ * array: KEY => VALUE [the key/value pair to search for within the loop to determine the correct position]
+ *
+ * int: Position [the position to search for]
+ *
+ * If key is false the position is set to 0
+ * If key is true the position is set to the last entry
+ *
+ * @return mixed false if not found, index position otherwise; be sure to test with ===
+ */
+ public function find_key_index($blockname, $key);
+
+ /**
+ * Get path to template for handle (required for BBCode parser)
+ *
+ * @param string $handle Handle to retrieve the source file
+ * @return string
+ */
+ public function get_source_file_for_handle($handle);
+}
diff --git a/phpBB/phpbb/template/twig/definition.php b/phpBB/phpbb/template/twig/definition.php
new file mode 100644
index 0000000000..cb3c953692
--- /dev/null
+++ b/phpBB/phpbb/template/twig/definition.php
@@ -0,0 +1,69 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\template\twig;
+
+/**
+* This class holds all DEFINE variables from the current page load
+*/
+class definition
+{
+ /** @var array **/
+ protected $definitions = array();
+
+ /**
+ * Get a DEFINE'd variable
+ *
+ * @param string $name
+ * @param array $arguments
+ *
+ * @return mixed Null if not found
+ */
+ public function __call($name, $arguments)
+ {
+ return (isset($this->definitions[$name])) ? $this->definitions[$name] : null;
+ }
+
+ /**
+ * DEFINE a variable
+ *
+ * @param string $name
+ * @param mixed $value
+ * @return \phpbb\template\twig\definition
+ */
+ public function set($name, $value)
+ {
+ $this->definitions[$name] = $value;
+
+ return $this;
+ }
+
+ /**
+ * Append to a variable
+ *
+ * @param string $name
+ * @param string $value
+ * @return \phpbb\template\twig\definition
+ */
+ public function append($name, $value)
+ {
+ if (!isset($this->definitions[$name]))
+ {
+ $this->definitions[$name] = '';
+ }
+
+ $this->definitions[$name] .= $value;
+
+ return $this;
+ }
+}
diff --git a/phpBB/phpbb/template/twig/environment.php b/phpBB/phpbb/template/twig/environment.php
new file mode 100644
index 0000000000..476ffd935e
--- /dev/null
+++ b/phpBB/phpbb/template/twig/environment.php
@@ -0,0 +1,205 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\template\twig;
+
+class environment extends \Twig_Environment
+{
+ /** @var \phpbb\config\config */
+ protected $phpbb_config;
+
+ /** @var \phpbb\path_helper */
+ protected $phpbb_path_helper;
+
+ /** @var \phpbb\extension\manager */
+ protected $extension_manager;
+
+ /** @var string */
+ protected $phpbb_root_path;
+
+ /** @var string */
+ protected $web_root_path;
+
+ /** @var array **/
+ protected $namespace_look_up_order = array('__main__');
+
+ /**
+ * Constructor
+ *
+ * @param \phpbb\config\config $phpbb_config The phpBB configuration
+ * @param \phpbb\path_helper $path_helper phpBB path helper
+ * @param \phpbb\extension\manager $extension_manager phpBB extension manager
+ * @param \Twig_LoaderInterface $loader Twig loader interface
+ * @param array $options Array of options to pass to Twig
+ */
+ public function __construct($phpbb_config, \phpbb\path_helper $path_helper, \phpbb\extension\manager $extension_manager = null, \Twig_LoaderInterface $loader = null, $options = array())
+ {
+ $this->phpbb_config = $phpbb_config;
+
+ $this->phpbb_path_helper = $path_helper;
+ $this->extension_manager = $extension_manager;
+
+ $this->phpbb_root_path = $this->phpbb_path_helper->get_phpbb_root_path();
+ $this->web_root_path = $this->phpbb_path_helper->get_web_root_path();
+
+ return parent::__construct($loader, $options);
+ }
+
+ /**
+ * Get the list of enabled phpBB extensions
+ *
+ * Used in EVENT node
+ *
+ * @return array
+ */
+ public function get_phpbb_extensions()
+ {
+ return ($this->extension_manager) ? $this->extension_manager->all_enabled() : array();
+ }
+
+ /**
+ * Get phpBB config
+ *
+ * @return \phpbb\config\config
+ */
+ public function get_phpbb_config()
+ {
+ return $this->phpbb_config;
+ }
+
+ /**
+ * Get the phpBB root path
+ *
+ * @return string
+ */
+ public function get_phpbb_root_path()
+ {
+ return $this->phpbb_root_path;
+ }
+
+ /**
+ * Get the web root path
+ *
+ * @return string
+ */
+ public function get_web_root_path()
+ {
+ return $this->web_root_path;
+ }
+
+ /**
+ * Get the phpbb path helper object
+ *
+ * @return \phpbb\path_helper
+ */
+ public function get_path_helper()
+ {
+ return $this->phpbb_path_helper;
+ }
+
+ /**
+ * Get the namespace look up order
+ *
+ * @return array
+ */
+ public function getNamespaceLookUpOrder()
+ {
+ return $this->namespace_look_up_order;
+ }
+
+ /**
+ * Set the namespace look up order to load templates from
+ *
+ * @param array $namespace
+ * @return \Twig_Environment
+ */
+ public function setNamespaceLookUpOrder($namespace)
+ {
+ $this->namespace_look_up_order = $namespace;
+
+ return $this;
+ }
+
+ /**
+ * Loads a template by name.
+ *
+ * @param string $name The template name
+ * @param integer $index The index if it is an embedded template
+ * @return \Twig_TemplateInterface A template instance representing the given template name
+ * @throws \Twig_Error_Loader
+ */
+ public function loadTemplate($name, $index = null)
+ {
+ if (strpos($name, '@') === false)
+ {
+ foreach ($this->getNamespaceLookUpOrder() as $namespace)
+ {
+ try
+ {
+ if ($namespace === '__main__')
+ {
+ return parent::loadTemplate($name, $index);
+ }
+
+ return parent::loadTemplate('@' . $namespace . '/' . $name, $index);
+ }
+ catch (\Twig_Error_Loader $e)
+ {
+ }
+ }
+
+ // We were unable to load any templates
+ throw $e;
+ }
+ else
+ {
+ return parent::loadTemplate($name, $index);
+ }
+ }
+
+ /**
+ * Finds a template by name.
+ *
+ * @param string $name The template name
+ * @return string
+ * @throws \Twig_Error_Loader
+ */
+ public function findTemplate($name)
+ {
+ if (strpos($name, '@') === false)
+ {
+ foreach ($this->getNamespaceLookUpOrder() as $namespace)
+ {
+ try
+ {
+ if ($namespace === '__main__')
+ {
+ return parent::getLoader()->getCacheKey($name);
+ }
+
+ return parent::getLoader()->getCacheKey('@' . $namespace . '/' . $name);
+ }
+ catch (\Twig_Error_Loader $e)
+ {
+ }
+ }
+
+ // We were unable to load any templates
+ throw $e;
+ }
+ else
+ {
+ return parent::getLoader()->getCacheKey($name);
+ }
+ }
+}
diff --git a/phpBB/phpbb/template/twig/extension.php b/phpBB/phpbb/template/twig/extension.php
new file mode 100644
index 0000000000..d5b14129b5
--- /dev/null
+++ b/phpBB/phpbb/template/twig/extension.php
@@ -0,0 +1,184 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\template\twig;
+
+class extension extends \Twig_Extension
+{
+ /** @var \phpbb\template\context */
+ protected $context;
+
+ /** @var \phpbb\user */
+ protected $user;
+
+ /**
+ * Constructor
+ *
+ * @param \phpbb\template\context $context
+ * @param \phpbb\user $user
+ * @return \phpbb\template\twig\extension
+ */
+ public function __construct(\phpbb\template\context $context, $user)
+ {
+ $this->context = $context;
+ $this->user = $user;
+ }
+
+ /**
+ * Get the name of this extension
+ *
+ * @return string
+ */
+ public function getName()
+ {
+ return 'phpbb';
+ }
+
+ /**
+ * Returns the token parser instance to add to the existing list.
+ *
+ * @return array An array of Twig_TokenParser instances
+ */
+ public function getTokenParsers()
+ {
+ return array(
+ new \phpbb\template\twig\tokenparser\defineparser,
+ new \phpbb\template\twig\tokenparser\includeparser,
+ new \phpbb\template\twig\tokenparser\includejs,
+ new \phpbb\template\twig\tokenparser\includecss,
+ new \phpbb\template\twig\tokenparser\event,
+ new \phpbb\template\twig\tokenparser\includephp,
+ new \phpbb\template\twig\tokenparser\php,
+ );
+ }
+
+ /**
+ * Returns a list of filters to add to the existing list.
+ *
+ * @return array An array of filters
+ */
+ public function getFilters()
+ {
+ return array(
+ new \Twig_SimpleFilter('subset', array($this, 'loop_subset'), array('needs_environment' => true)),
+ new \Twig_SimpleFilter('addslashes', 'addslashes'),
+ );
+ }
+
+ /**
+ * Returns a list of global functions to add to the existing list.
+ *
+ * @return array An array of global functions
+ */
+ public function getFunctions()
+ {
+ return array(
+ new \Twig_SimpleFunction('lang', array($this, 'lang')),
+ );
+ }
+
+ /**
+ * Returns a list of operators to add to the existing list.
+ *
+ * @return array An array of operators
+ */
+ public function getOperators()
+ {
+ return array(
+ array(
+ '!' => array('precedence' => 50, 'class' => 'Twig_Node_Expression_Unary_Not'),
+ ),
+ array(
+ // precedence settings are copied from similar operators in Twig core extension
+ '||' => array('precedence' => 10, 'class' => 'Twig_Node_Expression_Binary_Or', 'associativity' => \Twig_ExpressionParser::OPERATOR_LEFT),
+ '&&' => array('precedence' => 15, 'class' => 'Twig_Node_Expression_Binary_And', 'associativity' => \Twig_ExpressionParser::OPERATOR_LEFT),
+
+ 'eq' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_Equal', 'associativity' => \Twig_ExpressionParser::OPERATOR_LEFT),
+
+ 'ne' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_NotEqual', 'associativity' => \Twig_ExpressionParser::OPERATOR_LEFT),
+ 'neq' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_NotEqual', 'associativity' => \Twig_ExpressionParser::OPERATOR_LEFT),
+ '<>' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_NotEqual', 'associativity' => \Twig_ExpressionParser::OPERATOR_LEFT),
+
+ '===' => array('precedence' => 20, 'class' => '\phpbb\template\twig\node\expression\binary\equalequal', 'associativity' => \Twig_ExpressionParser::OPERATOR_LEFT),
+ '!==' => array('precedence' => 20, 'class' => '\phpbb\template\twig\node\expression\binary\notequalequal', 'associativity' => \Twig_ExpressionParser::OPERATOR_LEFT),
+
+ 'gt' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_Greater', 'associativity' => \Twig_ExpressionParser::OPERATOR_LEFT),
+ 'gte' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_GreaterEqual', 'associativity' => \Twig_ExpressionParser::OPERATOR_LEFT),
+ 'ge' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_GreaterEqual', 'associativity' => \Twig_ExpressionParser::OPERATOR_LEFT),
+ 'lt' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_Less', 'associativity' => \Twig_ExpressionParser::OPERATOR_LEFT),
+ 'lte' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_LessEqual', 'associativity' => \Twig_ExpressionParser::OPERATOR_LEFT),
+ 'le' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_LessEqual', 'associativity' => \Twig_ExpressionParser::OPERATOR_LEFT),
+
+ 'mod' => array('precedence' => 60, 'class' => 'Twig_Node_Expression_Binary_Mod', 'associativity' => \Twig_ExpressionParser::OPERATOR_LEFT),
+ ),
+ );
+ }
+
+ /**
+ * Grabs a subset of a loop
+ *
+ * @param \Twig_Environment $env A Twig_Environment instance
+ * @param mixed $item A variable
+ * @param integer $start Start of the subset
+ * @param integer $end End of the subset
+ * @param Boolean $preserveKeys Whether to preserve key or not (when the input is an array)
+ *
+ * @return mixed The sliced variable
+ */
+ function loop_subset(\Twig_Environment $env, $item, $start, $end = null, $preserveKeys = false)
+ {
+ // We do almost the same thing as Twig's slice (array_slice), except when $end is positive
+ if ($end >= 1)
+ {
+ // When end is > 1, subset will end on the last item in an array with the specified $end
+ // This is different from slice in that it is the number we end on rather than the number
+ // of items to grab (length)
+
+ // Start must always be the actual starting number for this calculation (not negative)
+ $start = ($start < 0) ? sizeof($item) + $start : $start;
+ $end = $end - $start;
+ }
+
+ // We always include the last element (this was the past design)
+ $end = ($end == -1 || $end === null) ? null : $end + 1;
+
+ return twig_slice($env, $item, $start, $end, $preserveKeys);
+ }
+
+ /**
+ * Get output for a language variable (L_FOO, LA_FOO)
+ *
+ * This function checks to see if the language var was outputted to $context
+ * (e.g. in the ACP, L_TITLE)
+ * If not, we return the result of $user->lang()
+ *
+ * @return string
+ */
+ function lang()
+ {
+ $args = func_get_args();
+ $key = $args[0];
+
+ $context_vars = $this->context->get_root_ref();
+
+ if (isset($context_vars['L_' . $key]))
+ {
+ return $context_vars['L_' . $key];
+ }
+
+ // LA_ is transformed into lang(\'$1\')|addslashes, so we should not
+ // need to check for it
+
+ return call_user_func_array(array($this->user, 'lang'), $args);
+ }
+}
diff --git a/phpBB/phpbb/template/twig/lexer.php b/phpBB/phpbb/template/twig/lexer.php
new file mode 100644
index 0000000000..c5dc7273ba
--- /dev/null
+++ b/phpBB/phpbb/template/twig/lexer.php
@@ -0,0 +1,354 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\template\twig;
+
+class lexer extends \Twig_Lexer
+{
+ public function tokenize($code, $filename = null)
+ {
+ // Our phpBB tags
+ // Commented out tokens are handled separately from the main replace
+ $phpbb_tags = array(
+ /*'BEGIN',
+ 'BEGINELSE',
+ 'END',
+ 'IF',
+ 'ELSE',
+ 'ELSEIF',
+ 'ENDIF',
+ 'DEFINE',
+ 'UNDEFINE',*/
+ 'ENDDEFINE',
+ 'INCLUDE',
+ 'INCLUDEPHP',
+ 'INCLUDEJS',
+ 'INCLUDECSS',
+ 'PHP',
+ 'ENDPHP',
+ 'EVENT',
+ );
+
+ // Twig tag masks
+ $twig_tags = array(
+ 'autoescape',
+ 'endautoescape',
+ 'if',
+ 'elseif',
+ 'else',
+ 'endif',
+ 'block',
+ 'endblock',
+ 'use',
+ 'extends',
+ 'embed',
+ 'filter',
+ 'endfilter',
+ 'flush',
+ 'for',
+ 'endfor',
+ 'macro',
+ 'endmacro',
+ 'import',
+ 'from',
+ 'sandbox',
+ 'endsandbox',
+ 'set',
+ 'endset',
+ 'spaceless',
+ 'endspaceless',
+ 'verbatim',
+ 'endverbatim',
+ );
+
+ // Fix tokens that may have inline variables (e.g. <!-- DEFINE $TEST = '{FOO}')
+ $code = $this->strip_surrounding_quotes(array(
+ 'INCLUDE',
+ 'INCLUDEPHP',
+ 'INCLUDEJS',
+ 'INCLUDECSS',
+ ), $code);
+ $code = $this->fix_inline_variable_tokens(array(
+ 'DEFINE \$[a-zA-Z0-9_]+ =',
+ 'INCLUDE',
+ 'INCLUDEPHP',
+ 'INCLUDEJS',
+ 'INCLUDECSS',
+ ), $code);
+ $code = $this->add_surrounding_quotes(array(
+ 'INCLUDE',
+ 'INCLUDEPHP',
+ 'INCLUDEJS',
+ 'INCLUDECSS',
+ ), $code);
+
+ // Fix our BEGIN statements
+ $code = $this->fix_begin_tokens($code);
+
+ // Fix our IF tokens
+ $code = $this->fix_if_tokens($code);
+
+ // Fix our DEFINE tokens
+ $code = $this->fix_define_tokens($code);
+
+ // Replace all of our starting tokens, <!-- TOKEN --> with Twig style, {% TOKEN %}
+ // This also strips outer parenthesis, <!-- IF (blah) --> becomes <!-- IF blah -->
+ $code = preg_replace('#<!-- (' . implode('|', $phpbb_tags) . ')(?: (.*?) ?)?-->#', '{% $1 $2 %}', $code);
+
+ // Replace all of our twig masks with Twig code (e.g. <!-- BLOCK .+ --> with {% block $1 %})
+ $code = $this->replace_twig_tag_masks($code, $twig_tags);
+
+ // Replace all of our language variables, {L_VARNAME}, with Twig style, {{ lang('NAME') }}
+ // Appends any filters after lang()
+ $code = preg_replace('#{L_([a-zA-Z0-9_\.]+)(\|[^}]+?)?}#', '{{ lang(\'$1\')$2 }}', $code);
+
+ // Replace all of our escaped language variables, {LA_VARNAME}, with Twig style, {{ lang('NAME')|addslashes }}
+ // Appends any filters after lang(), but before addslashes
+ $code = preg_replace('#{LA_([a-zA-Z0-9_\.]+)(\|[^}]+?)?}#', '{{ lang(\'$1\')$2|addslashes }}', $code);
+
+ // Replace all of our variables, {VARNAME}, with Twig style, {{ VARNAME }}
+ // Appends any filters
+ $code = preg_replace('#{([a-zA-Z0-9_\.]+)(\|[^}]+?)?}#', '{{ $1$2 }}', $code);
+
+ return parent::tokenize($code, $filename);
+ }
+
+ /**
+ * Strip surrounding quotes
+ *
+ * First step to fix tokens that may have inline variables
+ * E.g. <!-- INCLUDE '{TEST}.html' to <!-- INCLUDE {TEST}.html
+ *
+ * @param array $tokens array of tokens to search for (imploded to a regular expression)
+ * @param string $code
+ * @return string
+ */
+ protected function strip_surrounding_quotes($tokens, $code)
+ {
+ // Remove matching quotes at the beginning/end if a statement;
+ // E.g. 'asdf'"' -> asdf'"
+ // E.g. "asdf'"" -> asdf'"
+ // E.g. 'asdf'" -> 'asdf'"
+ return preg_replace('#<!-- (' . implode('|', $tokens) . ') (([\'"])?(.*?)\1) -->#', '<!-- $1 $2 -->', $code);
+ }
+
+ /**
+ * Fix tokens that may have inline variables
+ *
+ * Second step to fix tokens that may have inline variables
+ * E.g. <!-- INCLUDE '{TEST}.html' to <!-- INCLUDE ' ~ {TEST} ~ '.html
+ *
+ * @param array $tokens array of tokens to search for (imploded to a regular expression)
+ * @param string $code
+ * @return string
+ */
+ protected function fix_inline_variable_tokens($tokens, $code)
+ {
+ $callback = function($matches)
+ {
+ // Replace template variables with start/end to parse variables (' ~ TEST ~ '.html)
+ $matches[2] = preg_replace('#{([a-zA-Z0-9_\.$]+)}#', "'~ \$1 ~'", $matches[2]);
+
+ return "<!-- {$matches[1]} {$matches[2]} -->";
+ };
+
+ return preg_replace_callback('#<!-- (' . implode('|', $tokens) . ') (.+?) -->#', $callback, $code);
+ }
+
+ /**
+ * Add surrounding quotes
+ *
+ * Last step to fix tokens that may have inline variables
+ * E.g. <!-- INCLUDE '{TEST}.html' to <!-- INCLUDE '' ~ {TEST} ~ '.html'
+ *
+ * @param array $tokens array of tokens to search for (imploded to a regular expression)
+ * @param string $code
+ * @return string
+ */
+ protected function add_surrounding_quotes($tokens, $code)
+ {
+ return preg_replace('#<!-- (' . implode('|', $tokens) . ') (.+?) -->#', '<!-- $1 \'$2\' -->', $code);
+ }
+
+ /**
+ * Fix begin tokens (convert our BEGIN to Twig for)
+ *
+ * Not meant to be used outside of this context, public because the anonymous function calls this
+ *
+ * @param string $code
+ * @param array $parent_nodes (used in recursion)
+ * @return string
+ */
+ public function fix_begin_tokens($code, $parent_nodes = array())
+ {
+ // PHP 5.3 cannot use $this in an anonymous function, so use this as a work-around
+ $parent_class = $this;
+ $callback = function ($matches) use ($parent_class, $parent_nodes)
+ {
+ $hard_parents = explode('.', $matches[1]);
+ array_pop($hard_parents); // ends with .
+ if ($hard_parents)
+ {
+ $parent_nodes = array_merge($hard_parents, $parent_nodes);
+ }
+
+ $name = $matches[2];
+ $subset = trim(substr($matches[3], 1, -1)); // Remove parenthesis
+ $body = $matches[4];
+
+ // Replace <!-- BEGINELSE -->
+ $body = str_replace('<!-- BEGINELSE -->', '{% else %}', $body);
+
+ // Is the designer wanting to call another loop in a loop?
+ // <!-- BEGIN loop -->
+ // <!-- BEGIN !loop2 -->
+ // <!-- END !loop2 -->
+ // <!-- END loop -->
+ // 'loop2' is actually on the same nesting level as 'loop' you assign
+ // variables to it with template->assign_block_vars('loop2', array(...))
+ if (strpos($name, '!') === 0)
+ {
+ // Count the number if ! occurrences
+ $count = substr_count($name, '!');
+ for ($i = 0; $i < $count; $i++)
+ {
+ array_pop($parent_nodes);
+ $name = substr($name, 1);
+ }
+ }
+
+ // Remove all parent nodes, e.g. foo, bar from foo.bar.foobar.VAR
+ foreach ($parent_nodes as $node)
+ {
+ $body = preg_replace('#([^a-zA-Z0-9_])' . $node . '\.([a-zA-Z0-9_]+)\.#', '$1$2.', $body);
+ }
+
+ // Add current node to list of parent nodes for child nodes
+ $parent_nodes[] = $name;
+
+ // Recursive...fix any child nodes
+ $body = $parent_class->fix_begin_tokens($body, $parent_nodes);
+
+ // Need the parent variable name
+ array_pop($parent_nodes);
+ $parent = (!empty($parent_nodes)) ? end($parent_nodes) . '.' : '';
+
+ if ($subset !== '')
+ {
+ $subset = '|subset(' . $subset . ')';
+ }
+
+ $parent = ($parent) ?: 'loops.';
+ // Turn into a Twig for loop
+ return "{% for {$name} in {$parent}{$name}{$subset} %}{$body}{% endfor %}";
+ };
+
+ return preg_replace_callback('#<!-- BEGIN ((?:[a-zA-Z0-9_]+\.)*)([!a-zA-Z0-9_]+)(\([0-9,\-]+\))? -->(.+?)<!-- END \1\2 -->#s', $callback, $code);
+ }
+
+ /**
+ * Fix IF statements
+ *
+ * @param string $code
+ * @return string
+ */
+ protected function fix_if_tokens($code)
+ {
+ // Replace ELSE IF with ELSEIF
+ $code = preg_replace('#<!-- ELSE IF (.+?) -->#', '<!-- ELSEIF $1 -->', $code);
+
+ // Replace our "div by" with Twig's divisibleby (Twig does not like test names with spaces)
+ $code = preg_replace('# div by ([0-9]+)#', ' divisibleby($1)', $code);
+
+ $callback = function($matches)
+ {
+ $inner = $matches[2];
+ // Replace $TEST with definition.TEST
+ $inner = preg_replace('#(\s\(*!?)\$([a-zA-Z_0-9]+)#', '$1definition.$2', $inner);
+
+ // Replace .foo with loops.foo|length
+ $inner = preg_replace('#(\s\(*!?)\.([a-zA-Z_0-9]+)([^a-zA-Z_0-9\.])#', '$1loops.$2|length$3', $inner);
+
+ // Replace .foo.bar with foo.bar|length
+ $inner = preg_replace('#(\s\(*!?)\.([a-zA-Z_0-9\.]+)([^a-zA-Z_0-9\.])#', '$1$2|length$3', $inner);
+
+ return "<!-- {$matches[1]}IF{$inner}-->";
+ };
+
+ return preg_replace_callback('#<!-- (ELSE)?IF((.*?) (?:\(*!?[\$|\.]([^\s]+)(.*?))?)-->#', $callback, $code);
+ }
+
+ /**
+ * Fix DEFINE statements and {$VARNAME} variables
+ *
+ * @param string $code
+ * @return string
+ */
+ protected function fix_define_tokens($code)
+ {
+ /**
+ * Changing $VARNAME to definition.varname because set is only local
+ * context (e.g. DEFINE $TEST will only make $TEST available in current
+ * template and any child templates, but not any parent templates).
+ *
+ * DEFINE handles setting it properly to definition in its node, but the
+ * variables reading FROM it need to be altered to definition.VARNAME
+ *
+ * Setting up definition as a class in the array passed to Twig
+ * ($context) makes set definition.TEST available in the global context
+ */
+
+ // Replace <!-- DEFINE $NAME with {% DEFINE definition.NAME
+ $code = preg_replace('#<!-- DEFINE \$(.*?) -->#', '{% DEFINE $1 %}', $code);
+
+ // Changing UNDEFINE NAME to DEFINE NAME = null to save from creating an extra token parser/node
+ $code = preg_replace('#<!-- UNDEFINE \$(.*?)-->#', '{% DEFINE $1= null %}', $code);
+
+ // Replace all of our variables, {$VARNAME}, with Twig style, {{ definition.VARNAME }}
+ $code = preg_replace('#{\$([a-zA-Z0-9_\.]+)}#', '{{ definition.$1 }}', $code);
+
+ // Replace all of our variables, ~ $VARNAME ~, with Twig style, ~ definition.VARNAME ~
+ $code = preg_replace('#~ \$([a-zA-Z0-9_\.]+) ~#', '~ definition.$1 ~', $code);
+
+ return $code;
+ }
+
+ /**
+ * Replace Twig tag masks with Twig tag calls
+ *
+ * E.g. <!-- BLOCK foo --> with {% block foo %}
+ *
+ * @param string $code
+ * @param array $twig_tags All tags we want to create a mask for
+ * @return string
+ */
+ protected function replace_twig_tag_masks($code, $twig_tags)
+ {
+ $callback = function ($matches)
+ {
+ $matches[1] = strtolower($matches[1]);
+
+ return "{% {$matches[1]}{$matches[2]}%}";
+ };
+
+ foreach ($twig_tags as &$tag)
+ {
+ $tag = strtoupper($tag);
+ }
+
+ // twig_tags is an array of the twig tags, which are all lowercase, but we use all uppercase tags
+ $code = preg_replace_callback('#<!-- (' . implode('|', $twig_tags) . ')(.*?)-->#',$callback, $code);
+
+ return $code;
+ }
+}
diff --git a/phpBB/phpbb/template/twig/loader.php b/phpBB/phpbb/template/twig/loader.php
new file mode 100644
index 0000000000..139a413b70
--- /dev/null
+++ b/phpBB/phpbb/template/twig/loader.php
@@ -0,0 +1,148 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\template\twig;
+
+/**
+* Twig Template loader
+*/
+class loader extends \Twig_Loader_Filesystem
+{
+ protected $safe_directories = array();
+
+ /**
+ * Set safe directories
+ *
+ * @param array $directories Array of directories that are safe (empty to clear)
+ * @return \Twig_Loader_Filesystem
+ */
+ public function setSafeDirectories($directories = array())
+ {
+ $this->safe_directories = array();
+
+ if (!empty($directories))
+ {
+ foreach ($directories as $directory)
+ {
+ $this->addSafeDirectory($directory);
+ }
+ }
+
+ return $this;
+ }
+
+ /**
+ * Add safe directory
+ *
+ * @param string $directory Directory that should be added
+ * @return \Twig_Loader_Filesystem
+ */
+ public function addSafeDirectory($directory)
+ {
+ $directory = phpbb_realpath($directory);
+
+ if ($directory !== false)
+ {
+ $this->safe_directories[] = $directory;
+ }
+
+ return $this;
+ }
+
+ /**
+ * Get current safe directories
+ *
+ * @return array
+ */
+ public function getSafeDirectories()
+ {
+ return $this->safe_directories;
+ }
+
+ /**
+ * Override for parent::validateName()
+ *
+ * This is done because we added support for safe directories, and when Twig
+ * findTemplate() is called, validateName() is called first, which would
+ * always throw an exception if the file is outside of the configured
+ * template directories.
+ */
+ protected function validateName($name)
+ {
+ return;
+ }
+
+ /**
+ * Find the template
+ *
+ * Override for Twig_Loader_Filesystem::findTemplate to add support
+ * for loading from safe directories.
+ */
+ protected function findTemplate($name)
+ {
+ $name = (string) $name;
+
+ // normalize name
+ $name = preg_replace('#/{2,}#', '/', strtr($name, '\\', '/'));
+
+ // If this is in the cache we can skip the entire process below
+ // as it should have already been validated
+ if (isset($this->cache[$name]))
+ {
+ return $this->cache[$name];
+ }
+
+ // First, find the template name. The override above of validateName
+ // causes the validateName process to be skipped for this call
+ $file = parent::findTemplate($name);
+
+ try
+ {
+ // Try validating the name (which may throw an exception)
+ parent::validateName($name);
+ }
+ catch (\Twig_Error_Loader $e)
+ {
+ if (strpos($e->getRawMessage(), 'Looks like you try to load a template outside configured directories') === 0)
+ {
+ // Ok, so outside of the configured template directories, we
+ // can now check if we're within a "safe" directory
+
+ // Find the real path of the directory the file is in
+ $directory = phpbb_realpath(dirname($file));
+
+ if ($directory === false)
+ {
+ // Some sort of error finding the actual path, must throw the exception
+ throw $e;
+ }
+
+ foreach ($this->safe_directories as $safe_directory)
+ {
+ if (strpos($directory, $safe_directory) === 0)
+ {
+ // The directory being loaded is below a directory
+ // that is "safe". We're good to load it!
+ return $file;
+ }
+ }
+ }
+
+ // Not within any safe directories
+ throw $e;
+ }
+
+ // No exception from validateName, safe to load.
+ return $file;
+ }
+}
diff --git a/phpBB/phpbb/template/twig/node/definenode.php b/phpBB/phpbb/template/twig/node/definenode.php
new file mode 100644
index 0000000000..ddbd151d20
--- /dev/null
+++ b/phpBB/phpbb/template/twig/node/definenode.php
@@ -0,0 +1,57 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @copyright Portions (c) 2009 Fabien Potencier, Armin Ronacher
+* @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\template\twig\node;
+
+class definenode extends \Twig_Node
+{
+ public function __construct($capture, \Twig_NodeInterface $name, \Twig_NodeInterface $value, $lineno, $tag = null)
+ {
+ parent::__construct(array('name' => $name, 'value' => $value), array('capture' => $capture, 'safe' => false), $lineno, $tag);
+ }
+
+ /**
+ * Compiles the node to PHP.
+ *
+ * @param \Twig_Compiler A Twig_Compiler instance
+ */
+ public function compile(\Twig_Compiler $compiler)
+ {
+ $compiler->addDebugInfo($this);
+
+ if ($this->getAttribute('capture'))
+ {
+ $compiler
+ ->write("ob_start();\n")
+ ->subcompile($this->getNode('value'))
+ ;
+
+ $compiler->write("\$value = ('' === \$value = ob_get_clean()) ? '' : new \Twig_Markup(\$value, \$this->env->getCharset());\n");
+ }
+ else
+ {
+ $compiler
+ ->write("\$value = ")
+ ->subcompile($this->getNode('value'))
+ ->raw(";\n")
+ ;
+ }
+
+ $compiler
+ ->write("\$context['definition']->set('")
+ ->raw($this->getNode('name')->getAttribute('name'))
+ ->raw("', \$value);\n")
+ ;
+ }
+}
diff --git a/phpBB/phpbb/template/twig/node/event.php b/phpBB/phpbb/template/twig/node/event.php
new file mode 100644
index 0000000000..b765bde98d
--- /dev/null
+++ b/phpBB/phpbb/template/twig/node/event.php
@@ -0,0 +1,82 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\template\twig\node;
+
+class event extends \Twig_Node
+{
+ /**
+ * The subdirectory in which all template listener files must be placed
+ * @var string
+ */
+ protected $listener_directory = 'event/';
+
+ /** @var \Twig_Environment */
+ protected $environment;
+
+ public function __construct(\Twig_Node_Expression $expr, \phpbb\template\twig\environment $environment, $lineno, $tag = null)
+ {
+ $this->environment = $environment;
+
+ parent::__construct(array('expr' => $expr), array(), $lineno, $tag);
+ }
+
+ /**
+ * Compiles the node to PHP.
+ *
+ * @param \Twig_Compiler A Twig_Compiler instance
+ */
+ public function compile(\Twig_Compiler $compiler)
+ {
+ $compiler->addDebugInfo($this);
+
+ $location = $this->listener_directory . $this->getNode('expr')->getAttribute('name');
+
+ foreach ($this->environment->get_phpbb_extensions() as $ext_namespace => $ext_path)
+ {
+ $ext_namespace = str_replace('/', '_', $ext_namespace);
+
+ if (defined('DEBUG'))
+ {
+ // If debug mode is enabled, lets check for new/removed EVENT
+ // templates on page load rather than at compile. This is
+ // slower, but makes developing extensions easier (no need to
+ // purge the cache when a new event template file is added)
+ $compiler
+ ->write("if (\$this->env->getLoader()->exists('@{$ext_namespace}/{$location}.html')) {\n")
+ ->indent()
+ ;
+ }
+
+ if (defined('DEBUG') || $this->environment->getLoader()->exists('@' . $ext_namespace . '/' . $location . '.html'))
+ {
+ $compiler
+ ->write("\$previous_look_up_order = \$this->env->getNamespaceLookUpOrder();\n")
+
+ // We set the namespace lookup order to be this extension first, then the main path
+ ->write("\$this->env->setNamespaceLookUpOrder(array('{$ext_namespace}', '__main__'));\n")
+ ->write("\$this->env->loadTemplate('@{$ext_namespace}/{$location}.html')->display(\$context);\n")
+ ->write("\$this->env->setNamespaceLookUpOrder(\$previous_look_up_order);\n")
+ ;
+ }
+
+ if (defined('DEBUG'))
+ {
+ $compiler
+ ->outdent()
+ ->write("}\n\n")
+ ;
+ }
+ }
+ }
+}
diff --git a/phpBB/phpbb/template/twig/node/expression/binary/equalequal.php b/phpBB/phpbb/template/twig/node/expression/binary/equalequal.php
new file mode 100644
index 0000000000..2cd15d59da
--- /dev/null
+++ b/phpBB/phpbb/template/twig/node/expression/binary/equalequal.php
@@ -0,0 +1,22 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\template\twig\node\expression\binary;
+
+class equalequal extends \Twig_Node_Expression_Binary
+{
+ public function operator(\Twig_Compiler $compiler)
+ {
+ return $compiler->raw('===');
+ }
+}
diff --git a/phpBB/phpbb/template/twig/node/expression/binary/notequalequal.php b/phpBB/phpbb/template/twig/node/expression/binary/notequalequal.php
new file mode 100644
index 0000000000..5f2908fb9b
--- /dev/null
+++ b/phpBB/phpbb/template/twig/node/expression/binary/notequalequal.php
@@ -0,0 +1,22 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\template\twig\node\expression\binary;
+
+class notequalequal extends \Twig_Node_Expression_Binary
+{
+ public function operator(\Twig_Compiler $compiler)
+ {
+ return $compiler->raw('!==');
+ }
+}
diff --git a/phpBB/phpbb/template/twig/node/includeasset.php b/phpBB/phpbb/template/twig/node/includeasset.php
new file mode 100644
index 0000000000..15195a226b
--- /dev/null
+++ b/phpBB/phpbb/template/twig/node/includeasset.php
@@ -0,0 +1,81 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\template\twig\node;
+
+abstract class includeasset extends \Twig_Node
+{
+ /** @var \Twig_Environment */
+ protected $environment;
+
+ public function __construct(\Twig_Node_Expression $expr, \phpbb\template\twig\environment $environment, $lineno, $tag = null)
+ {
+ $this->environment = $environment;
+
+ parent::__construct(array('expr' => $expr), array(), $lineno, $tag);
+ }
+ /**
+ * Compiles the node to PHP.
+ *
+ * @param \Twig_Compiler A Twig_Compiler instance
+ */
+ public function compile(\Twig_Compiler $compiler)
+ {
+ $compiler->addDebugInfo($this);
+
+ $config = $this->environment->get_phpbb_config();
+
+ $compiler
+ ->write("\$asset_file = ")
+ ->subcompile($this->getNode('expr'))
+ ->raw(";\n")
+ ->write("\$asset = new \phpbb\\template\\asset(\$asset_file, \$this->getEnvironment()->get_path_helper());\n")
+ ->write("if (substr(\$asset_file, 0, 2) !== './' && \$asset->is_relative()) {\n")
+ ->indent()
+ ->write("\$asset_path = \$asset->get_path();")
+ ->write("\$local_file = \$this->getEnvironment()->get_phpbb_root_path() . \$asset_path;\n")
+ ->write("if (!file_exists(\$local_file)) {\n")
+ ->indent()
+ ->write("\$local_file = \$this->getEnvironment()->findTemplate(\$asset_path);\n")
+ ->write("\$asset->set_path(\$local_file, true);\n")
+ ->outdent()
+ ->write("\$asset->add_assets_version('{$config['assets_version']}');\n")
+ ->write("\$asset_file = \$asset->get_url();\n")
+ ->write("}\n")
+ ->outdent()
+ ->write("}\n")
+ ->write("\$context['definition']->append('{$this->get_definition_name()}', '")
+ ;
+
+ $this->append_asset($compiler);
+
+ $compiler
+ ->raw("\n');\n")
+ ;
+ }
+
+ /**
+ * Get the definition name
+ *
+ * @return string (e.g. 'SCRIPTS')
+ */
+ abstract public function get_definition_name();
+
+ /**
+ * Append the output code for the asset
+ *
+ * @param \Twig_Compiler A Twig_Compiler instance
+ * @return null
+ */
+ abstract protected function append_asset(\Twig_Compiler $compiler);
+}
diff --git a/phpBB/phpbb/template/twig/node/includecss.php b/phpBB/phpbb/template/twig/node/includecss.php
new file mode 100644
index 0000000000..2dac154036
--- /dev/null
+++ b/phpBB/phpbb/template/twig/node/includecss.php
@@ -0,0 +1,37 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\template\twig\node;
+
+class includecss extends \phpbb\template\twig\node\includeasset
+{
+ /**
+ * {@inheritdoc}
+ */
+ public function get_definition_name()
+ {
+ return 'STYLESHEETS';
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function append_asset(\Twig_Compiler $compiler)
+ {
+ $compiler
+ ->raw("<link href=\"' . ")
+ ->raw("\$asset_file . '\"")
+ ->raw(' rel="stylesheet" type="text/css" media="screen" />')
+ ;
+ }
+}
diff --git a/phpBB/phpbb/template/twig/node/includejs.php b/phpBB/phpbb/template/twig/node/includejs.php
new file mode 100644
index 0000000000..0f67f9ff60
--- /dev/null
+++ b/phpBB/phpbb/template/twig/node/includejs.php
@@ -0,0 +1,39 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\template\twig\node;
+
+class includejs extends \phpbb\template\twig\node\includeasset
+{
+ /**
+ * {@inheritdoc}
+ */
+ public function get_definition_name()
+ {
+ return 'SCRIPTS';
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function append_asset(\Twig_Compiler $compiler)
+ {
+ $config = $this->environment->get_phpbb_config();
+
+ $compiler
+ ->raw("<script type=\"text/javascript\" src=\"' . ")
+ ->raw("\$asset_file")
+ ->raw(". '\"></script>\n")
+ ;
+ }
+}
diff --git a/phpBB/phpbb/template/twig/node/includenode.php b/phpBB/phpbb/template/twig/node/includenode.php
new file mode 100644
index 0000000000..c36ac3c324
--- /dev/null
+++ b/phpBB/phpbb/template/twig/node/includenode.php
@@ -0,0 +1,53 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\template\twig\node;
+
+class includenode extends \Twig_Node_Include
+{
+ /**
+ * Compiles the node to PHP.
+ *
+ * @param \Twig_Compiler A Twig_Compiler instance
+ */
+ public function compile(\Twig_Compiler $compiler)
+ {
+ $compiler->addDebugInfo($this);
+
+ $compiler
+ ->write("\$location = ")
+ ->subcompile($this->getNode('expr'))
+ ->raw(";\n")
+ ->write("\$namespace = false;\n")
+ ->write("if (strpos(\$location, '@') === 0) {\n")
+ ->indent()
+ ->write("\$namespace = substr(\$location, 1, strpos(\$location, '/') - 1);\n")
+ ->write("\$previous_look_up_order = \$this->env->getNamespaceLookUpOrder();\n")
+
+ // We set the namespace lookup order to be this namespace first, then the main path
+ ->write("\$this->env->setNamespaceLookUpOrder(array(\$namespace, '__main__'));\n")
+ ->outdent()
+ ->write("}\n")
+ ;
+
+ parent::compile($compiler);
+
+ $compiler
+ ->write("if (\$namespace) {\n")
+ ->indent()
+ ->write("\$this->env->setNamespaceLookUpOrder(\$previous_look_up_order);\n")
+ ->outdent()
+ ->write("}\n")
+ ;
+ }
+}
diff --git a/phpBB/phpbb/template/twig/node/includephp.php b/phpBB/phpbb/template/twig/node/includephp.php
new file mode 100644
index 0000000000..76182c2f84
--- /dev/null
+++ b/phpBB/phpbb/template/twig/node/includephp.php
@@ -0,0 +1,91 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* Sections (c) 2009 Fabien Potencier, Armin Ronacher
+* @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\template\twig\node;
+
+class includephp extends \Twig_Node
+{
+ /** @var \Twig_Environment */
+ protected $environment;
+
+ public function __construct(\Twig_Node_Expression $expr, \phpbb\template\twig\environment $environment, $lineno, $ignoreMissing = false, $tag = null)
+ {
+ $this->environment = $environment;
+
+ parent::__construct(array('expr' => $expr), array('ignore_missing' => (Boolean) $ignoreMissing), $lineno, $tag);
+ }
+
+ /**
+ * Compiles the node to PHP.
+ *
+ * @param \Twig_Compiler A Twig_Compiler instance
+ */
+ public function compile(\Twig_Compiler $compiler)
+ {
+ $compiler->addDebugInfo($this);
+
+ $config = $this->environment->get_phpbb_config();
+
+ if (!$config['tpl_allow_php'])
+ {
+ $compiler
+ ->write("// INCLUDEPHP Disabled\n")
+ ;
+
+ return;
+ }
+
+ if ($this->getAttribute('ignore_missing'))
+ {
+ $compiler
+ ->write("try {\n")
+ ->indent()
+ ;
+ }
+
+ $compiler
+ ->write("\$location = ")
+ ->subcompile($this->getNode('expr'))
+ ->raw(";\n")
+ ->write("if (phpbb_is_absolute(\$location)) {\n")
+ ->indent()
+ // Absolute path specified
+ ->write("require(\$location);\n")
+ ->outdent()
+ ->write("} else if (file_exists(\$this->getEnvironment()->get_phpbb_root_path() . \$location)) {\n")
+ ->indent()
+ // PHP file relative to phpbb_root_path
+ ->write("require(\$this->getEnvironment()->get_phpbb_root_path() . \$location);\n")
+ ->outdent()
+ ->write("} else {\n")
+ ->indent()
+ // Local path (behaves like INCLUDE)
+ ->write("require(\$this->getEnvironment()->getLoader()->getCacheKey(\$location));\n")
+ ->outdent()
+ ->write("}\n")
+ ;
+
+ if ($this->getAttribute('ignore_missing'))
+ {
+ $compiler
+ ->outdent()
+ ->write("} catch (\Twig_Error_Loader \$e) {\n")
+ ->indent()
+ ->write("// ignore missing template\n")
+ ->outdent()
+ ->write("}\n\n")
+ ;
+ }
+ }
+}
diff --git a/phpBB/phpbb/template/twig/node/php.php b/phpBB/phpbb/template/twig/node/php.php
new file mode 100644
index 0000000000..4ee415e446
--- /dev/null
+++ b/phpBB/phpbb/template/twig/node/php.php
@@ -0,0 +1,52 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\template\twig\node;
+
+class php extends \Twig_Node
+{
+ /** @var \Twig_Environment */
+ protected $environment;
+
+ public function __construct(\Twig_Node_Text $text, \phpbb\template\twig\environment $environment, $lineno, $tag = null)
+ {
+ $this->environment = $environment;
+
+ parent::__construct(array('text' => $text), array(), $lineno, $tag);
+ }
+
+ /**
+ * Compiles the node to PHP.
+ *
+ * @param \Twig_Compiler A Twig_Compiler instance
+ */
+ public function compile(\Twig_Compiler $compiler)
+ {
+ $compiler->addDebugInfo($this);
+
+ $config = $this->environment->get_phpbb_config();
+
+ if (!$config['tpl_allow_php'])
+ {
+ $compiler
+ ->write("// PHP Disabled\n")
+ ;
+
+ return;
+ }
+
+ $compiler
+ ->raw($this->getNode('text')->getAttribute('data'))
+ ;
+ }
+}
diff --git a/phpBB/phpbb/template/twig/tokenparser/defineparser.php b/phpBB/phpbb/template/twig/tokenparser/defineparser.php
new file mode 100644
index 0000000000..b755836ccd
--- /dev/null
+++ b/phpBB/phpbb/template/twig/tokenparser/defineparser.php
@@ -0,0 +1,76 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @copyright Portions (c) 2009 Fabien Potencier, Armin Ronacher
+* @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\template\twig\tokenparser;
+
+class defineparser extends \Twig_TokenParser
+{
+ /**
+ * Parses a token and returns a node.
+ *
+ * @param \Twig_Token $token A Twig_Token instance
+ *
+ * @return \Twig_NodeInterface A Twig_NodeInterface instance
+ * @throws \Twig_Error_Syntax
+ * @throws \phpbb\template\twig\node\definenode
+ */
+ public function parse(\Twig_Token $token)
+ {
+ $lineno = $token->getLine();
+ $stream = $this->parser->getStream();
+ $name = $this->parser->getExpressionParser()->parseExpression();
+
+ $capture = false;
+ if ($stream->test(\Twig_Token::OPERATOR_TYPE, '='))
+ {
+ $stream->next();
+ $value = $this->parser->getExpressionParser()->parseExpression();
+
+ if ($value instanceof \Twig_Node_Expression_Name)
+ {
+ // This would happen if someone improperly formed their DEFINE syntax
+ // e.g. <!-- DEFINE $VAR = foo -->
+ throw new \Twig_Error_Syntax('Invalid DEFINE', $token->getLine(), $this->parser->getFilename());
+ }
+
+ $stream->expect(\Twig_Token::BLOCK_END_TYPE);
+ }
+ else
+ {
+ $capture = true;
+
+ $stream->expect(\Twig_Token::BLOCK_END_TYPE);
+
+ $value = $this->parser->subparse(array($this, 'decideBlockEnd'), true);
+ $stream->expect(\Twig_Token::BLOCK_END_TYPE);
+ }
+
+ return new \phpbb\template\twig\node\definenode($capture, $name, $value, $lineno, $this->getTag());
+ }
+
+ public function decideBlockEnd(\Twig_Token $token)
+ {
+ return $token->test('ENDDEFINE');
+ }
+
+ /**
+ * Gets the tag name associated with this token parser.
+ *
+ * @return string The tag name
+ */
+ public function getTag()
+ {
+ return 'DEFINE';
+ }
+}
diff --git a/phpBB/phpbb/template/twig/tokenparser/event.php b/phpBB/phpbb/template/twig/tokenparser/event.php
new file mode 100644
index 0000000000..f73ef4ae25
--- /dev/null
+++ b/phpBB/phpbb/template/twig/tokenparser/event.php
@@ -0,0 +1,44 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\template\twig\tokenparser;
+
+class event extends \Twig_TokenParser
+{
+ /**
+ * Parses a token and returns a node.
+ *
+ * @param \Twig_Token $token A Twig_Token instance
+ *
+ * @return \Twig_NodeInterface A Twig_NodeInterface instance
+ */
+ public function parse(\Twig_Token $token)
+ {
+ $expr = $this->parser->getExpressionParser()->parseExpression();
+
+ $stream = $this->parser->getStream();
+ $stream->expect(\Twig_Token::BLOCK_END_TYPE);
+
+ return new \phpbb\template\twig\node\event($expr, $this->parser->getEnvironment(), $token->getLine(), $this->getTag());
+ }
+
+ /**
+ * Gets the tag name associated with this token parser.
+ *
+ * @return string The tag name
+ */
+ public function getTag()
+ {
+ return 'EVENT';
+ }
+}
diff --git a/phpBB/phpbb/template/twig/tokenparser/includecss.php b/phpBB/phpbb/template/twig/tokenparser/includecss.php
new file mode 100644
index 0000000000..1f30811754
--- /dev/null
+++ b/phpBB/phpbb/template/twig/tokenparser/includecss.php
@@ -0,0 +1,44 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\template\twig\tokenparser;
+
+class includecss extends \Twig_TokenParser
+{
+ /**
+ * Parses a token and returns a node.
+ *
+ * @param \Twig_Token $token A Twig_Token instance
+ *
+ * @return \Twig_NodeInterface A Twig_NodeInterface instance
+ */
+ public function parse(\Twig_Token $token)
+ {
+ $expr = $this->parser->getExpressionParser()->parseExpression();
+
+ $stream = $this->parser->getStream();
+ $stream->expect(\Twig_Token::BLOCK_END_TYPE);
+
+ return new \phpbb\template\twig\node\includecss($expr, $this->parser->getEnvironment(), $token->getLine(), $this->getTag());
+ }
+
+ /**
+ * Gets the tag name associated with this token parser.
+ *
+ * @return string The tag name
+ */
+ public function getTag()
+ {
+ return 'INCLUDECSS';
+ }
+}
diff --git a/phpBB/phpbb/template/twig/tokenparser/includejs.php b/phpBB/phpbb/template/twig/tokenparser/includejs.php
new file mode 100644
index 0000000000..4b67d2c468
--- /dev/null
+++ b/phpBB/phpbb/template/twig/tokenparser/includejs.php
@@ -0,0 +1,44 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\template\twig\tokenparser;
+
+class includejs extends \Twig_TokenParser
+{
+ /**
+ * Parses a token and returns a node.
+ *
+ * @param \Twig_Token $token A Twig_Token instance
+ *
+ * @return \Twig_NodeInterface A Twig_NodeInterface instance
+ */
+ public function parse(\Twig_Token $token)
+ {
+ $expr = $this->parser->getExpressionParser()->parseExpression();
+
+ $stream = $this->parser->getStream();
+ $stream->expect(\Twig_Token::BLOCK_END_TYPE);
+
+ return new \phpbb\template\twig\node\includejs($expr, $this->parser->getEnvironment(), $token->getLine(), $this->getTag());
+ }
+
+ /**
+ * Gets the tag name associated with this token parser.
+ *
+ * @return string The tag name
+ */
+ public function getTag()
+ {
+ return 'INCLUDEJS';
+ }
+}
diff --git a/phpBB/phpbb/template/twig/tokenparser/includeparser.php b/phpBB/phpbb/template/twig/tokenparser/includeparser.php
new file mode 100644
index 0000000000..aa7236aaa6
--- /dev/null
+++ b/phpBB/phpbb/template/twig/tokenparser/includeparser.php
@@ -0,0 +1,44 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @copyright Portions (c) 2009 Fabien Potencier, Armin Ronacher
+* @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\template\twig\tokenparser;
+
+class includeparser extends \Twig_TokenParser_Include
+{
+ /**
+ * Parses a token and returns a node.
+ *
+ * @param \Twig_Token $token A Twig_Token instance
+ *
+ * @return \Twig_NodeInterface A Twig_NodeInterface instance
+ */
+ public function parse(\Twig_Token $token)
+ {
+ $expr = $this->parser->getExpressionParser()->parseExpression();
+
+ list($variables, $only, $ignoreMissing) = $this->parseArguments();
+
+ return new \phpbb\template\twig\node\includenode($expr, $variables, $only, $ignoreMissing, $token->getLine(), $this->getTag());
+ }
+
+ /**
+ * Gets the tag name associated with this token parser.
+ *
+ * @return string The tag name
+ */
+ public function getTag()
+ {
+ return 'INCLUDE';
+ }
+}
diff --git a/phpBB/phpbb/template/twig/tokenparser/includephp.php b/phpBB/phpbb/template/twig/tokenparser/includephp.php
new file mode 100644
index 0000000000..3992636f8c
--- /dev/null
+++ b/phpBB/phpbb/template/twig/tokenparser/includephp.php
@@ -0,0 +1,55 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @copyright Portions (c) 2009 Fabien Potencier, Armin Ronacher
+* @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\template\twig\tokenparser;
+
+class includephp extends \Twig_TokenParser
+{
+ /**
+ * Parses a token and returns a node.
+ *
+ * @param \Twig_Token $token A Twig_Token instance
+ *
+ * @return \Twig_NodeInterface A Twig_NodeInterface instance
+ */
+ public function parse(\Twig_Token $token)
+ {
+ $expr = $this->parser->getExpressionParser()->parseExpression();
+
+ $stream = $this->parser->getStream();
+
+ $ignoreMissing = false;
+ if ($stream->test(\Twig_Token::NAME_TYPE, 'ignore'))
+ {
+ $stream->next();
+ $stream->expect(\Twig_Token::NAME_TYPE, 'missing');
+
+ $ignoreMissing = true;
+ }
+
+ $stream->expect(\Twig_Token::BLOCK_END_TYPE);
+
+ return new \phpbb\template\twig\node\includephp($expr, $this->parser->getEnvironment(), $token->getLine(), $ignoreMissing, $this->getTag());
+ }
+
+ /**
+ * Gets the tag name associated with this token parser.
+ *
+ * @return string The tag name
+ */
+ public function getTag()
+ {
+ return 'INCLUDEPHP';
+ }
+}
diff --git a/phpBB/phpbb/template/twig/tokenparser/php.php b/phpBB/phpbb/template/twig/tokenparser/php.php
new file mode 100644
index 0000000000..f11ce35896
--- /dev/null
+++ b/phpBB/phpbb/template/twig/tokenparser/php.php
@@ -0,0 +1,52 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\template\twig\tokenparser;
+
+class php extends \Twig_TokenParser
+{
+ /**
+ * Parses a token and returns a node.
+ *
+ * @param \Twig_Token $token A Twig_Token instance
+ *
+ * @return \Twig_NodeInterface A Twig_NodeInterface instance
+ */
+ public function parse(\Twig_Token $token)
+ {
+ $stream = $this->parser->getStream();
+
+ $stream->expect(\Twig_Token::BLOCK_END_TYPE);
+
+ $body = $this->parser->subparse(array($this, 'decideEnd'), true);
+
+ $stream->expect(\Twig_Token::BLOCK_END_TYPE);
+
+ return new \phpbb\template\twig\node\php($body, $this->parser->getEnvironment(), $token->getLine(), $this->getTag());
+ }
+
+ public function decideEnd(\Twig_Token $token)
+ {
+ return $token->test('ENDPHP');
+ }
+
+ /**
+ * Gets the tag name associated with this token parser.
+ *
+ * @return string The tag name
+ */
+ public function getTag()
+ {
+ return 'PHP';
+ }
+}
diff --git a/phpBB/phpbb/template/twig/twig.php b/phpBB/phpbb/template/twig/twig.php
new file mode 100644
index 0000000000..d1bbb2b55a
--- /dev/null
+++ b/phpBB/phpbb/template/twig/twig.php
@@ -0,0 +1,389 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\template\twig;
+
+/**
+* Twig Template class.
+*/
+class twig extends \phpbb\template\base
+{
+ /**
+ * Path of the cache directory for the template
+ *
+ * Cannot be changed during runtime.
+ *
+ * @var string
+ */
+ private $cachepath = '';
+
+ /**
+ * phpBB path helper
+ * @var \phpbb\path_helper
+ */
+ protected $path_helper;
+
+ /**
+ * phpBB root path
+ * @var string
+ */
+ protected $phpbb_root_path;
+
+ /**
+ * PHP file extension
+ * @var string
+ */
+ protected $php_ext;
+
+ /**
+ * phpBB config instance
+ * @var \phpbb\config\config
+ */
+ protected $config;
+
+ /**
+ * Current user
+ * @var \phpbb\user
+ */
+ protected $user;
+
+ /**
+ * Extension manager.
+ *
+ * @var \phpbb\extension\manager
+ */
+ protected $extension_manager;
+
+ /**
+ * Twig Environment
+ *
+ * @var \Twig_Environment
+ */
+ protected $twig;
+
+ /**
+ * Constructor.
+ *
+ * @param \phpbb\path_helper $path_helper
+ * @param \phpbb\config\config $config
+ * @param \phpbb\user $user
+ * @param \phpbb\template\context $context template context
+ * @param \phpbb\extension\manager $extension_manager extension manager, if null then template events will not be invoked
+ */
+ public function __construct(\phpbb\path_helper $path_helper, $config, $user, \phpbb\template\context $context, \phpbb\extension\manager $extension_manager = null)
+ {
+ $this->path_helper = $path_helper;
+ $this->phpbb_root_path = $path_helper->get_phpbb_root_path();
+ $this->php_ext = $path_helper->get_php_ext();
+ $this->config = $config;
+ $this->user = $user;
+ $this->context = $context;
+ $this->extension_manager = $extension_manager;
+
+ $this->cachepath = $this->phpbb_root_path . 'cache/twig/';
+
+ // Initiate the loader, __main__ namespace paths will be setup later in set_style_names()
+ $loader = new \phpbb\template\twig\loader('');
+
+ $this->twig = new \phpbb\template\twig\environment(
+ $this->config,
+ $this->path_helper,
+ $this->extension_manager,
+ $loader,
+ array(
+ 'cache' => (defined('IN_INSTALL')) ? false : $this->cachepath,
+ 'debug' => defined('DEBUG'),
+ 'auto_reload' => (bool) $this->config['load_tplcompile'],
+ 'autoescape' => false,
+ )
+ );
+
+ $this->twig->addExtension(
+ new \phpbb\template\twig\extension(
+ $this->context,
+ $this->user
+ )
+ );
+
+ if (defined('DEBUG'))
+ {
+ $this->twig->addExtension(new \Twig_Extension_Debug());
+ }
+
+ $lexer = new \phpbb\template\twig\lexer($this->twig);
+
+ $this->twig->setLexer($lexer);
+
+ // Add admin namespace
+ if ($this->path_helper->get_adm_relative_path() !== null && is_dir($this->phpbb_root_path . $this->path_helper->get_adm_relative_path() . 'style/'))
+ {
+ $this->twig->getLoader()->setPaths($this->phpbb_root_path . $this->path_helper->get_adm_relative_path() . 'style/', 'admin');
+ }
+ }
+
+ /**
+ * Clear the cache
+ *
+ * @return \phpbb\template\template
+ */
+ public function clear_cache()
+ {
+ if (is_dir($this->cachepath))
+ {
+ $this->twig->clearCacheFiles();
+ }
+
+ return $this;
+ }
+
+ /**
+ * Get the style tree of the style preferred by the current user
+ *
+ * @return array Style tree, most specific first
+ */
+ public function get_user_style()
+ {
+ $style_list = array(
+ $this->user->style['style_path'],
+ );
+
+ if ($this->user->style['style_parent_id'])
+ {
+ $style_list = array_merge($style_list, array_reverse(explode('/', $this->user->style['style_parent_tree'])));
+ }
+
+ return $style_list;
+ }
+
+ /**
+ * Set style location based on (current) user's chosen style.
+ *
+ * @param array $style_directories The directories to add style paths for
+ * E.g. array('ext/foo/bar/styles', 'styles')
+ * Default: array('styles') (phpBB's style directory)
+ * @return \phpbb\template\template $this
+ */
+ public function set_style($style_directories = array('styles'))
+ {
+ if ($style_directories !== array('styles') && $this->twig->getLoader()->getPaths('core') === array())
+ {
+ // We should set up the core styles path since not already setup
+ $this->set_style();
+ }
+
+ $names = $this->get_user_style();
+ // Add 'all' folder to $names array
+ // It allows extensions to load a template file from 'all' folder,
+ // if a style doesn't include it.
+ $names[] = 'all';
+
+ $paths = array();
+ foreach ($style_directories as $directory)
+ {
+ foreach ($names as $name)
+ {
+ $path = $this->phpbb_root_path . trim($directory, '/') . "/{$name}/";
+ $template_path = $path . 'template/';
+ $theme_path = $path . 'theme/';
+
+ $is_valid_dir = false;
+ if (is_dir($template_path))
+ {
+ $is_valid_dir = true;
+ $paths[] = $template_path;
+ }
+ if (is_dir($theme_path))
+ {
+ $is_valid_dir = true;
+ $paths[] = $theme_path;
+ }
+
+ if ($is_valid_dir)
+ {
+ // Add the base style directory as a safe directory
+ $this->twig->getLoader()->addSafeDirectory($path);
+ }
+ }
+ }
+
+ // If we're setting up the main phpBB styles directory and the core
+ // namespace isn't setup yet, we will set it up now
+ if ($style_directories === array('styles') && $this->twig->getLoader()->getPaths('core') === array())
+ {
+ // Set up the core style paths namespace
+ $this->twig->getLoader()->setPaths($paths, 'core');
+ }
+
+ $this->set_custom_style($names, $paths);
+
+ return $this;
+ }
+
+ /**
+ * Set custom style location (able to use directory outside of phpBB).
+ *
+ * Note: Templates are still compiled to phpBB's cache directory.
+ *
+ * @param string|array $names Array of names (or detailed names) or string of name of template(s) in inheritance tree order, used by extensions.
+ * E.g. array(
+ * 'name' => 'adm',
+ * 'ext_path' => 'adm/style/',
+ * )
+ * @param string|array of string $paths Array of style paths, relative to current root directory
+ * @return \phpbb\template\template $this
+ */
+ public function set_custom_style($names, $paths)
+ {
+ $paths = (is_string($paths)) ? array($paths) : $paths;
+ $names = (is_string($names)) ? array($names) : $names;
+
+ // Set as __main__ namespace
+ $this->twig->getLoader()->setPaths($paths);
+
+ // Add all namespaces for all extensions
+ if ($this->extension_manager instanceof \phpbb\extension\manager)
+ {
+ $names[] = 'all';
+
+ foreach ($this->extension_manager->all_enabled() as $ext_namespace => $ext_path)
+ {
+ // namespaces cannot contain /
+ $namespace = str_replace('/', '_', $ext_namespace);
+ $paths = array();
+
+ foreach ($names as $template_dir)
+ {
+ if (is_array($template_dir))
+ {
+ if (isset($template_dir['ext_path']))
+ {
+ $ext_style_template_path = $ext_path . $template_dir['ext_path'];
+ $ext_style_path = dirname($ext_style_template_path);
+ $ext_style_theme_path = $ext_style_path . 'theme/';
+ }
+ else
+ {
+ $ext_style_path = $ext_path . 'styles/' . $template_dir['name'] . '/';
+ $ext_style_template_path = $ext_style_path . 'template/';
+ $ext_style_theme_path = $ext_style_path . 'theme/';
+ }
+ }
+ else
+ {
+ $ext_style_path = $ext_path . 'styles/' . $template_dir . '/';
+ $ext_style_template_path = $ext_style_path . 'template/';
+ $ext_style_theme_path = $ext_style_path . 'theme/';
+ }
+
+ $is_valid_dir = false;
+ if (is_dir($ext_style_template_path))
+ {
+ $is_valid_dir = true;
+ $paths[] = $ext_style_template_path;
+ }
+ if (is_dir($ext_style_theme_path))
+ {
+ $is_valid_dir = true;
+ $paths[] = $ext_style_theme_path;
+ }
+
+ if ($is_valid_dir)
+ {
+ // Add the base style directory as a safe directory
+ $this->twig->getLoader()->addSafeDirectory($ext_style_path);
+ }
+ }
+
+ $this->twig->getLoader()->setPaths($paths, $namespace);
+ }
+ }
+
+ return $this;
+ }
+
+ /**
+ * Display a template for provided handle.
+ *
+ * The template will be loaded and compiled, if necessary, first.
+ *
+ * This function calls hooks.
+ *
+ * @param string $handle Handle to display
+ * @return \phpbb\template\template $this
+ */
+ public function display($handle)
+ {
+ $result = $this->call_hook($handle, __FUNCTION__);
+ if ($result !== false)
+ {
+ return $result[0];
+ }
+
+ $this->twig->display($this->get_filename_from_handle($handle), $this->get_template_vars());
+
+ return $this;
+ }
+
+ /**
+ * Display the handle and assign the output to a template variable
+ * or return the compiled result.
+ *
+ * @param string $handle Handle to operate on
+ * @param string $template_var Template variable to assign compiled handle to
+ * @param bool $return_content If true return compiled handle, otherwise assign to $template_var
+ * @return \phpbb\template\template|string if $return_content is true return string of the compiled handle, otherwise return $this
+ */
+ public function assign_display($handle, $template_var = '', $return_content = true)
+ {
+ if ($return_content)
+ {
+ return $this->twig->render($this->get_filename_from_handle($handle), $this->get_template_vars());
+ }
+
+ $this->assign_var($template_var, $this->twig->render($this->get_filename_from_handle($handle), $this->get_template_vars()));
+
+ return $this;
+ }
+
+ /**
+ * Get template vars in a format Twig will use (from the context)
+ *
+ * @return array
+ */
+ protected function get_template_vars()
+ {
+ $context_vars = $this->context->get_data_ref();
+
+ $vars = array_merge(
+ $context_vars['.'][0], // To get normal vars
+ array(
+ 'definition' => new \phpbb\template\twig\definition(),
+ 'user' => $this->user,
+ 'loops' => $context_vars, // To get loops
+ )
+ );
+
+ // cleanup
+ unset($vars['loops']['.']);
+
+ return $vars;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_source_file_for_handle($handle)
+ {
+ return $this->twig->getLoader()->getCacheKey($this->get_filename_from_handle($handle));
+ }
+}
diff --git a/phpBB/phpbb/tree/nestedset.php b/phpBB/phpbb/tree/nestedset.php
new file mode 100644
index 0000000000..8490c7c299
--- /dev/null
+++ b/phpBB/phpbb/tree/nestedset.php
@@ -0,0 +1,877 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\tree;
+
+abstract class nestedset implements \phpbb\tree\tree_interface
+{
+ /** @var \phpbb\db\driver\driver_interface */
+ protected $db;
+
+ /** @var \phpbb\lock\db */
+ protected $lock;
+
+ /** @var string */
+ protected $table_name;
+
+ /**
+ * Prefix for the language keys returned by exceptions
+ * @var string
+ */
+ protected $message_prefix = '';
+
+ /**
+ * Column names in the table
+ * @var string
+ */
+ protected $column_item_id = 'item_id';
+ protected $column_left_id = 'left_id';
+ protected $column_right_id = 'right_id';
+ protected $column_parent_id = 'parent_id';
+ protected $column_item_parents = 'item_parents';
+
+ /**
+ * Additional SQL restrictions
+ * Allows to have multiple nested sets in one table
+ * @var string
+ */
+ protected $sql_where = '';
+
+ /**
+ * List of item properties to be cached in the item_parents column
+ * @var array
+ */
+ protected $item_basic_data = array('*');
+
+ /**
+ * Construct
+ *
+ * @param \phpbb\db\driver\driver_interface $db Database connection
+ * @param \phpbb\lock\db $lock Lock class used to lock the table when moving forums around
+ * @param string $table_name Table name
+ * @param string $message_prefix Prefix for the messages thrown by exceptions
+ * @param string $sql_where Additional SQL restrictions for the queries
+ * @param array $item_basic_data Array with basic item data that is stored in item_parents
+ * @param array $columns Array with column names to overwrite
+ */
+ public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\lock\db $lock, $table_name, $message_prefix = '', $sql_where = '', $item_basic_data = array(), $columns = array())
+ {
+ $this->db = $db;
+ $this->lock = $lock;
+
+ $this->table_name = $table_name;
+ $this->message_prefix = $message_prefix;
+ $this->sql_where = $sql_where;
+ $this->item_basic_data = (!empty($item_basic_data)) ? $item_basic_data : array('*');
+
+ if (!empty($columns))
+ {
+ foreach ($columns as $column => $name)
+ {
+ $column_name = 'column_' . $column;
+ $this->$column_name = $name;
+ }
+ }
+ }
+
+ /**
+ * Returns additional sql where restrictions
+ *
+ * @param string $operator SQL operator that needs to be prepended to sql_where,
+ * if it is not empty.
+ * @param string $column_prefix Prefix that needs to be prepended to column names
+ * @return string Returns additional where statements to narrow down the tree,
+ * prefixed with operator and prepended column_prefix to column names
+ */
+ public function get_sql_where($operator = 'AND', $column_prefix = '')
+ {
+ return (!$this->sql_where) ? '' : $operator . ' ' . sprintf($this->sql_where, $column_prefix);
+ }
+
+ /**
+ * Acquires a lock on the item table
+ *
+ * @return bool True if the lock was acquired, false if it has been acquired previously
+ *
+ * @throws \RuntimeException If the lock could not be acquired
+ */
+ protected function acquire_lock()
+ {
+ if ($this->lock->owns_lock())
+ {
+ return false;
+ }
+
+ if (!$this->lock->acquire())
+ {
+ throw new \RuntimeException($this->message_prefix . 'LOCK_FAILED_ACQUIRE');
+ }
+
+ return true;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function insert(array $additional_data)
+ {
+ $item_data = $this->reset_nestedset_values($additional_data);
+
+ $sql = 'INSERT INTO ' . $this->table_name . ' ' . $this->db->sql_build_array('INSERT', $item_data);
+ $this->db->sql_query($sql);
+
+ $item_data[$this->column_item_id] = (int) $this->db->sql_nextid();
+
+ return array_merge($item_data, $this->add_item_to_nestedset($item_data[$this->column_item_id]));
+ }
+
+ /**
+ * Add an item which already has a database row at the end of the tree
+ *
+ * @param int $item_id The item to be added
+ * @return array Array with updated data, if the item was added successfully
+ * Empty array otherwise
+ */
+ protected function add_item_to_nestedset($item_id)
+ {
+ $sql = 'SELECT MAX(' . $this->column_right_id . ') AS ' . $this->column_right_id . '
+ FROM ' . $this->table_name . '
+ ' . $this->get_sql_where('WHERE');
+ $result = $this->db->sql_query($sql);
+ $current_max_right_id = (int) $this->db->sql_fetchfield($this->column_right_id);
+ $this->db->sql_freeresult($result);
+
+ $update_item_data = array(
+ $this->column_parent_id => 0,
+ $this->column_left_id => $current_max_right_id + 1,
+ $this->column_right_id => $current_max_right_id + 2,
+ $this->column_item_parents => '',
+ );
+
+ $sql = 'UPDATE ' . $this->table_name . '
+ SET ' . $this->db->sql_build_array('UPDATE', $update_item_data) . '
+ WHERE ' . $this->column_item_id . ' = ' . (int) $item_id . '
+ AND ' . $this->column_parent_id . ' = 0
+ AND ' . $this->column_left_id . ' = 0
+ AND ' . $this->column_right_id . ' = 0';
+ $this->db->sql_query($sql);
+
+ return ($this->db->sql_affectedrows() == 1) ? $update_item_data : array();
+ }
+
+ /**
+ * Remove an item from the tree without deleting it from the database
+ *
+ * Also removes all subitems from the tree without deleting them from the database either
+ *
+ * @param int $item_id The item to be deleted
+ * @return array Item ids that have been removed
+ * @throws \OutOfBoundsException
+ */
+ protected function remove_item_from_nestedset($item_id)
+ {
+ $item_id = (int) $item_id;
+ if (!$item_id)
+ {
+ throw new \OutOfBoundsException($this->message_prefix . 'INVALID_ITEM');
+ }
+
+ $items = $this->get_subtree_data($item_id);
+ $item_ids = array_keys($items);
+
+ if (empty($items) || !isset($items[$item_id]))
+ {
+ throw new \OutOfBoundsException($this->message_prefix . 'INVALID_ITEM');
+ }
+
+ $this->remove_subset($item_ids, $items[$item_id]);
+
+ return $item_ids;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function delete($item_id)
+ {
+ $removed_items = $this->remove_item_from_nestedset($item_id);
+
+ $sql = 'DELETE FROM ' . $this->table_name . '
+ WHERE ' . $this->db->sql_in_set($this->column_item_id, $removed_items) . '
+ ' . $this->get_sql_where('AND');
+ $this->db->sql_query($sql);
+
+ return $removed_items;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function move($item_id, $delta)
+ {
+ if ($delta == 0)
+ {
+ return false;
+ }
+
+ $this->acquire_lock();
+
+ $action = ($delta > 0) ? 'move_up' : 'move_down';
+ $delta = abs($delta);
+
+ // Keep $this->get_sql_where() here, to ensure we are in the right tree.
+ $sql = 'SELECT *
+ FROM ' . $this->table_name . '
+ WHERE ' . $this->column_item_id . ' = ' . (int) $item_id . '
+ ' . $this->get_sql_where();
+ $result = $this->db->sql_query_limit($sql, $delta);
+ $item = $this->db->sql_fetchrow($result);
+ $this->db->sql_freeresult($result);
+
+ if (!$item)
+ {
+ $this->lock->release();
+ throw new \OutOfBoundsException($this->message_prefix . 'INVALID_ITEM');
+ }
+
+ /**
+ * Fetch all the siblings between the item's current spot
+ * and where we want to move it to. If there are less than $delta
+ * siblings between the current spot and the target then the
+ * item will move as far as possible
+ */
+ $sql = "SELECT {$this->column_item_id}, {$this->column_parent_id}, {$this->column_left_id}, {$this->column_right_id}, {$this->column_item_parents}
+ FROM " . $this->table_name . '
+ WHERE ' . $this->column_parent_id . ' = ' . (int) $item[$this->column_parent_id] . '
+ ' . $this->get_sql_where() . '
+ AND ';
+
+ if ($action == 'move_up')
+ {
+ $sql .= $this->column_right_id . ' < ' . (int) $item[$this->column_right_id] . ' ORDER BY ' . $this->column_right_id . ' DESC';
+ }
+ else
+ {
+ $sql .= $this->column_left_id . ' > ' . (int) $item[$this->column_left_id] . ' ORDER BY ' . $this->column_left_id . ' ASC';
+ }
+
+ $result = $this->db->sql_query_limit($sql, $delta);
+
+ $target = false;
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $target = $row;
+ }
+ $this->db->sql_freeresult($result);
+
+ if (!$target)
+ {
+ $this->lock->release();
+ // The item is already on top or bottom
+ return false;
+ }
+
+ /**
+ * $left_id and $right_id define the scope of the items that are affected by the move.
+ * $diff_up and $diff_down are the values to substract or add to each item's left_id
+ * and right_id in order to move them up or down.
+ * $move_up_left and $move_up_right define the scope of the items that are moving
+ * up. Other items in the scope of ($left_id, $right_id) are considered to move down.
+ */
+ if ($action == 'move_up')
+ {
+ $left_id = (int) $target[$this->column_left_id];
+ $right_id = (int) $item[$this->column_right_id];
+
+ $diff_up = (int) $item[$this->column_left_id] - (int) $target[$this->column_left_id];
+ $diff_down = (int) $item[$this->column_right_id] + 1 - (int) $item[$this->column_left_id];
+
+ $move_up_left = (int) $item[$this->column_left_id];
+ $move_up_right = (int) $item[$this->column_right_id];
+ }
+ else
+ {
+ $left_id = (int) $item[$this->column_left_id];
+ $right_id = (int) $target[$this->column_right_id];
+
+ $diff_up = (int) $item[$this->column_right_id] + 1 - (int) $item[$this->column_left_id];
+ $diff_down = (int) $target[$this->column_right_id] - (int) $item[$this->column_right_id];
+
+ $move_up_left = (int) $item[$this->column_right_id] + 1;
+ $move_up_right = (int) $target[$this->column_right_id];
+ }
+
+ // Now do the dirty job
+ $sql = 'UPDATE ' . $this->table_name . '
+ SET ' . $this->column_left_id . ' = ' . $this->column_left_id . ' + CASE
+ WHEN ' . $this->column_left_id . " BETWEEN {$move_up_left} AND {$move_up_right} THEN -{$diff_up}
+ ELSE {$diff_down}
+ END,
+ " . $this->column_right_id . ' = ' . $this->column_right_id . ' + CASE
+ WHEN ' . $this->column_right_id . " BETWEEN {$move_up_left} AND {$move_up_right} THEN -{$diff_up}
+ ELSE {$diff_down}
+ END
+ WHERE
+ " . $this->column_left_id . " BETWEEN {$left_id} AND {$right_id}
+ AND " . $this->column_right_id . " BETWEEN {$left_id} AND {$right_id}
+ " . $this->get_sql_where();
+ $this->db->sql_query($sql);
+
+ $this->lock->release();
+
+ return true;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function move_down($item_id)
+ {
+ return $this->move($item_id, -1);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function move_up($item_id)
+ {
+ return $this->move($item_id, 1);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function move_children($current_parent_id, $new_parent_id)
+ {
+ $current_parent_id = (int) $current_parent_id;
+ $new_parent_id = (int) $new_parent_id;
+
+ if ($current_parent_id == $new_parent_id)
+ {
+ return false;
+ }
+
+ if (!$current_parent_id)
+ {
+ throw new \OutOfBoundsException($this->message_prefix . 'INVALID_ITEM');
+ }
+
+ $this->acquire_lock();
+
+ $item_data = $this->get_subtree_data($current_parent_id);
+ if (!isset($item_data[$current_parent_id]))
+ {
+ $this->lock->release();
+ throw new \OutOfBoundsException($this->message_prefix . 'INVALID_ITEM');
+ }
+
+ $current_parent = $item_data[$current_parent_id];
+ unset($item_data[$current_parent_id]);
+ $move_items = array_keys($item_data);
+
+ if (($current_parent[$this->column_right_id] - $current_parent[$this->column_left_id]) <= 1)
+ {
+ $this->lock->release();
+ return false;
+ }
+
+ if (in_array($new_parent_id, $move_items))
+ {
+ $this->lock->release();
+ throw new \OutOfBoundsException($this->message_prefix . 'INVALID_PARENT');
+ }
+
+ $diff = sizeof($move_items) * 2;
+ $sql_exclude_moved_items = $this->db->sql_in_set($this->column_item_id, $move_items, true);
+
+ $this->db->sql_transaction('begin');
+
+ $this->remove_subset($move_items, $current_parent, false, true);
+
+ if ($new_parent_id)
+ {
+ // Retrieve new-parent again, it may have been changed...
+ $sql = 'SELECT *
+ FROM ' . $this->table_name . '
+ WHERE ' . $this->column_item_id . ' = ' . $new_parent_id;
+ $result = $this->db->sql_query($sql);
+ $new_parent = $this->db->sql_fetchrow($result);
+ $this->db->sql_freeresult($result);
+
+ if (!$new_parent)
+ {
+ $this->db->sql_transaction('rollback');
+ $this->lock->release();
+ throw new \OutOfBoundsException($this->message_prefix . 'INVALID_PARENT');
+ }
+
+ $new_right_id = $this->prepare_adding_subset($move_items, $new_parent, true);
+
+ if ($new_right_id > $current_parent[$this->column_right_id])
+ {
+ $diff = ' + ' . ($new_right_id - $current_parent[$this->column_right_id]);
+ }
+ else
+ {
+ $diff = ' - ' . abs($new_right_id - $current_parent[$this->column_right_id]);
+ }
+ }
+ else
+ {
+ $sql = 'SELECT MAX(' . $this->column_right_id . ') AS ' . $this->column_right_id . '
+ FROM ' . $this->table_name . '
+ WHERE ' . $sql_exclude_moved_items . '
+ ' . $this->get_sql_where('AND');
+ $result = $this->db->sql_query($sql);
+ $row = $this->db->sql_fetchrow($result);
+ $this->db->sql_freeresult($result);
+
+ $diff = ' + ' . ($row[$this->column_right_id] - $current_parent[$this->column_left_id]);
+ }
+
+ $sql = 'UPDATE ' . $this->table_name . '
+ SET ' . $this->column_left_id . ' = ' . $this->column_left_id . $diff . ',
+ ' . $this->column_right_id . ' = ' . $this->column_right_id . $diff . ',
+ ' . $this->column_parent_id . ' = ' . $this->db->sql_case($this->column_parent_id . ' = ' . $current_parent_id, $new_parent_id, $this->column_parent_id) . ',
+ ' . $this->column_item_parents . " = ''
+ WHERE " . $this->db->sql_in_set($this->column_item_id, $move_items) . '
+ ' . $this->get_sql_where('AND');
+ $this->db->sql_query($sql);
+
+ $this->db->sql_transaction('commit');
+ $this->lock->release();
+
+ return true;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function change_parent($item_id, $new_parent_id)
+ {
+ $item_id = (int) $item_id;
+ $new_parent_id = (int) $new_parent_id;
+
+ if ($item_id == $new_parent_id)
+ {
+ return false;
+ }
+
+ if (!$item_id)
+ {
+ throw new \OutOfBoundsException($this->message_prefix . 'INVALID_ITEM');
+ }
+
+ $this->acquire_lock();
+
+ $item_data = $this->get_subtree_data($item_id);
+ if (!isset($item_data[$item_id]))
+ {
+ $this->lock->release();
+ throw new \OutOfBoundsException($this->message_prefix . 'INVALID_ITEM');
+ }
+
+ $item = $item_data[$item_id];
+ $move_items = array_keys($item_data);
+
+ if (in_array($new_parent_id, $move_items))
+ {
+ $this->lock->release();
+ throw new \OutOfBoundsException($this->message_prefix . 'INVALID_PARENT');
+ }
+
+ $diff = sizeof($move_items) * 2;
+ $sql_exclude_moved_items = $this->db->sql_in_set($this->column_item_id, $move_items, true);
+
+ $this->db->sql_transaction('begin');
+
+ $this->remove_subset($move_items, $item, false, true);
+
+ if ($new_parent_id)
+ {
+ // Retrieve new-parent again, it may have been changed...
+ $sql = 'SELECT *
+ FROM ' . $this->table_name . '
+ WHERE ' . $this->column_item_id . ' = ' . $new_parent_id;
+ $result = $this->db->sql_query($sql);
+ $new_parent = $this->db->sql_fetchrow($result);
+ $this->db->sql_freeresult($result);
+
+ if (!$new_parent)
+ {
+ $this->db->sql_transaction('rollback');
+ $this->lock->release();
+ throw new \OutOfBoundsException($this->message_prefix . 'INVALID_PARENT');
+ }
+
+ $new_right_id = $this->prepare_adding_subset($move_items, $new_parent, true);
+
+ if ($new_right_id > (int) $item[$this->column_right_id])
+ {
+ $diff = ' + ' . ($new_right_id - (int) $item[$this->column_right_id] - 1);
+ }
+ else
+ {
+ $diff = ' - ' . abs($new_right_id - (int) $item[$this->column_right_id] - 1);
+ }
+ }
+ else
+ {
+ $sql = 'SELECT MAX(' . $this->column_right_id . ') AS ' . $this->column_right_id . '
+ FROM ' . $this->table_name . '
+ WHERE ' . $sql_exclude_moved_items . '
+ ' . $this->get_sql_where('AND');
+ $result = $this->db->sql_query($sql);
+ $row = $this->db->sql_fetchrow($result);
+ $this->db->sql_freeresult($result);
+
+ $diff = ' + ' . ($row[$this->column_right_id] - (int) $item[$this->column_left_id] + 1);
+ }
+
+ $sql = 'UPDATE ' . $this->table_name . '
+ SET ' . $this->column_left_id . ' = ' . $this->column_left_id . $diff . ',
+ ' . $this->column_right_id . ' = ' . $this->column_right_id . $diff . ',
+ ' . $this->column_parent_id . ' = ' . $this->db->sql_case($this->column_item_id . ' = ' . $item_id, $new_parent_id, $this->column_parent_id) . ',
+ ' . $this->column_item_parents . " = ''
+ WHERE " . $this->db->sql_in_set($this->column_item_id, $move_items) . '
+ ' . $this->get_sql_where('AND');
+ $this->db->sql_query($sql);
+
+ $this->db->sql_transaction('commit');
+ $this->lock->release();
+
+ return true;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_path_and_subtree_data($item_id, $order_asc = true, $include_item = true)
+ {
+ $condition = 'i2.' . $this->column_left_id . ' BETWEEN i1.' . $this->column_left_id . ' AND i1.' . $this->column_right_id . '
+ OR i1.' . $this->column_left_id . ' BETWEEN i2.' . $this->column_left_id . ' AND i2.' . $this->column_right_id;
+
+ return $this->get_set_of_nodes_data($item_id, $condition, $order_asc, $include_item);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_path_data($item_id, $order_asc = true, $include_item = true)
+ {
+ $condition = 'i1.' . $this->column_left_id . ' BETWEEN i2.' . $this->column_left_id . ' AND i2.' . $this->column_right_id . '';
+
+ return $this->get_set_of_nodes_data($item_id, $condition, $order_asc, $include_item);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_subtree_data($item_id, $order_asc = true, $include_item = true)
+ {
+ $condition = 'i2.' . $this->column_left_id . ' BETWEEN i1.' . $this->column_left_id . ' AND i1.' . $this->column_right_id . '';
+
+ return $this->get_set_of_nodes_data($item_id, $condition, $order_asc, $include_item);
+ }
+
+ /**
+ * Get items that are related to the given item by the condition
+ *
+ * @param int $item_id Id of the item to retrieve the node set from
+ * @param string $condition Query string restricting the item list
+ * @param bool $order_asc Order the items ascending by their left_id
+ * @param bool $include_item Should the item matching the given item id be included in the list as well
+ * @return array Array of items (containing all columns from the item table)
+ * ID => Item data
+ */
+ protected function get_set_of_nodes_data($item_id, $condition, $order_asc = true, $include_item = true)
+ {
+ $rows = array();
+
+ $sql = 'SELECT i2.*
+ FROM ' . $this->table_name . ' i1
+ LEFT JOIN ' . $this->table_name . " i2
+ ON (($condition) " . $this->get_sql_where('AND', 'i2.') . ')
+ WHERE i1.' . $this->column_item_id . ' = ' . (int) $item_id . '
+ ' . $this->get_sql_where('AND', 'i1.') . '
+ ORDER BY i2.' . $this->column_left_id . ' ' . ($order_asc ? 'ASC' : 'DESC');
+ $result = $this->db->sql_query($sql);
+
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ if (!$include_item && $item_id == $row[$this->column_item_id])
+ {
+ continue;
+ }
+
+ $rows[(int) $row[$this->column_item_id]] = $row;
+ }
+ $this->db->sql_freeresult($result);
+
+ return $rows;
+ }
+
+ /**
+ * Get basic data of all parent items
+ *
+ * Basic data is defined in the $item_basic_data property.
+ * Data is cached in the item_parents column in the item table
+ *
+ * @param array $item The item to get the path from
+ * @return array Array of items (containing basic columns from the item table)
+ * ID => Item data
+ */
+ public function get_path_basic_data(array $item)
+ {
+ $parents = array();
+ if ($item[$this->column_parent_id])
+ {
+ if (!$item[$this->column_item_parents])
+ {
+ $sql = 'SELECT ' . implode(', ', $this->item_basic_data) . '
+ FROM ' . $this->table_name . '
+ WHERE ' . $this->column_left_id . ' < ' . (int) $item[$this->column_left_id] . '
+ AND ' . $this->column_right_id . ' > ' . (int) $item[$this->column_right_id] . '
+ ' . $this->get_sql_where('AND') . '
+ ORDER BY ' . $this->column_left_id . ' ASC';
+ $result = $this->db->sql_query($sql);
+
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $parents[$row[$this->column_item_id]] = $row;
+ }
+ $this->db->sql_freeresult($result);
+
+ $item_parents = serialize($parents);
+
+ $sql = 'UPDATE ' . $this->table_name . '
+ SET ' . $this->column_item_parents . " = '" . $this->db->sql_escape($item_parents) . "'
+ WHERE " . $this->column_parent_id . ' = ' . (int) $item[$this->column_parent_id];
+ $this->db->sql_query($sql);
+ }
+ else
+ {
+ $parents = unserialize($item[$this->column_item_parents]);
+ }
+ }
+
+ return $parents;
+ }
+
+ /**
+ * Get all items from the tree
+ *
+ * @param bool $order_asc Order the items ascending by their left_id
+ * @return array Array of items (containing all columns from the item table)
+ * ID => Item data
+ */
+ public function get_all_tree_data($order_asc = true)
+ {
+ $rows = array();
+
+ $sql = 'SELECT *
+ FROM ' . $this->table_name . ' ' .
+ $this->get_sql_where('WHERE') . '
+ ORDER BY ' . $this->column_left_id . ' ' . ($order_asc ? 'ASC' : 'DESC');
+ $result = $this->db->sql_query($sql);
+
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $rows[(int) $row[$this->column_item_id]] = $row;
+ }
+ $this->db->sql_freeresult($result);
+
+ return $rows;
+ }
+
+ /**
+ * Remove a subset from the nested set
+ *
+ * @param array $subset_items Subset of items to remove
+ * @param array $bounding_item Item containing the right bound of the subset
+ * @param bool $set_subset_zero Should the parent, left and right id of the items be set to 0, or kept unchanged?
+ * In case of removing an item from the tree, we should the values to 0
+ * In case of moving an item, we shouldkeep the original values, in order to allow "+ diff" later
+ * @return null
+ */
+ protected function remove_subset(array $subset_items, array $bounding_item, $set_subset_zero = true)
+ {
+ $acquired_new_lock = $this->acquire_lock();
+
+ $diff = sizeof($subset_items) * 2;
+ $sql_subset_items = $this->db->sql_in_set($this->column_item_id, $subset_items);
+ $sql_not_subset_items = $this->db->sql_in_set($this->column_item_id, $subset_items, true);
+
+ $sql_is_parent = $this->column_left_id . ' <= ' . (int) $bounding_item[$this->column_right_id] . '
+ AND ' . $this->column_right_id . ' >= ' . (int) $bounding_item[$this->column_right_id];
+
+ $sql_is_right = $this->column_left_id . ' > ' . (int) $bounding_item[$this->column_right_id];
+
+ $set_left_id = $this->db->sql_case($sql_is_right, $this->column_left_id . ' - ' . $diff, $this->column_left_id);
+ $set_right_id = $this->db->sql_case($sql_is_parent . ' OR ' . $sql_is_right, $this->column_right_id . ' - ' . $diff, $this->column_right_id);
+
+ if ($set_subset_zero)
+ {
+ $set_left_id = $this->db->sql_case($sql_subset_items, 0, $set_left_id);
+ $set_right_id = $this->db->sql_case($sql_subset_items, 0, $set_right_id);
+ }
+
+ $sql = 'UPDATE ' . $this->table_name . '
+ SET ' . (($set_subset_zero) ? $this->column_parent_id . ' = ' . $this->db->sql_case($sql_subset_items, 0, $this->column_parent_id) . ',' : '') . '
+ ' . $this->column_left_id . ' = ' . $set_left_id . ',
+ ' . $this->column_right_id . ' = ' . $set_right_id . '
+ ' . ((!$set_subset_zero) ? ' WHERE ' . $sql_not_subset_items . ' ' . $this->get_sql_where('AND') : $this->get_sql_where('WHERE'));
+ $this->db->sql_query($sql);
+
+ if ($acquired_new_lock)
+ {
+ $this->lock->release();
+ }
+ }
+
+ /**
+ * Prepare adding a subset to the nested set
+ *
+ * @param array $subset_items Subset of items to add
+ * @param array $new_parent Item containing the right bound of the new parent
+ * @return int New right id of the parent item
+ */
+ protected function prepare_adding_subset(array $subset_items, array $new_parent)
+ {
+ $diff = sizeof($subset_items) * 2;
+ $sql_not_subset_items = $this->db->sql_in_set($this->column_item_id, $subset_items, true);
+
+ $set_left_id = $this->db->sql_case($this->column_left_id . ' > ' . (int) $new_parent[$this->column_right_id], $this->column_left_id . ' + ' . $diff, $this->column_left_id);
+ $set_right_id = $this->db->sql_case($this->column_right_id . ' >= ' . (int) $new_parent[$this->column_right_id], $this->column_right_id . ' + ' . $diff, $this->column_right_id);
+
+ $sql = 'UPDATE ' . $this->table_name . '
+ SET ' . $this->column_left_id . ' = ' . $set_left_id . ',
+ ' . $this->column_right_id . ' = ' . $set_right_id . '
+ WHERE ' . $sql_not_subset_items . '
+ ' . $this->get_sql_where('AND');
+ $this->db->sql_query($sql);
+
+ return $new_parent[$this->column_right_id] + $diff;
+ }
+
+ /**
+ * Resets values required for the nested set system
+ *
+ * @param array $item Original item data
+ * @return array Original item data + nested set defaults
+ */
+ protected function reset_nestedset_values(array $item)
+ {
+ $item_data = array_merge($item, array(
+ $this->column_parent_id => 0,
+ $this->column_left_id => 0,
+ $this->column_right_id => 0,
+ $this->column_item_parents => '',
+ ));
+
+ unset($item_data[$this->column_item_id]);
+
+ return $item_data;
+ }
+
+ /**
+ * Regenerate left/right ids from parent/child relationship
+ *
+ * This method regenerates the left/right ids for the tree based on
+ * the parent/child relations. This function executes three queries per
+ * item, so it should only be called, when the set has one of the following
+ * problems:
+ * - The set has a duplicated value inside the left/right id chain
+ * - The set has a missing value inside the left/right id chain
+ * - The set has items that do not have a left/right id set
+ *
+ * When regenerating the items, the items are sorted by parent id and their
+ * current left id, so the current child/parent relationships are kept
+ * and running the function on a working set will not change the order.
+ *
+ * @param int $new_id First left_id to be used (should start with 1)
+ * @param int $parent_id parent_id of the current set (default = 0)
+ * @param bool $reset_ids Should we reset all left_id/right_id on the first call?
+ * @return int $new_id The next left_id/right_id that should be used
+ */
+ public function regenerate_left_right_ids($new_id, $parent_id = 0, $reset_ids = false)
+ {
+ if ($acquired_new_lock = $this->acquire_lock())
+ {
+ $this->db->sql_transaction('begin');
+
+ if (!$reset_ids)
+ {
+ $sql = 'UPDATE ' . $this->table_name . '
+ SET ' . $this->column_item_parents . " = ''
+ " . $this->get_sql_where('WHERE');
+ $this->db->sql_query($sql);
+ }
+ }
+
+ if ($reset_ids)
+ {
+ $sql = 'UPDATE ' . $this->table_name . '
+ SET ' . $this->db->sql_build_array('UPDATE', array(
+ $this->column_left_id => 0,
+ $this->column_right_id => 0,
+ $this->column_item_parents => '',
+ )) . '
+ ' . $this->get_sql_where('WHERE');
+ $this->db->sql_query($sql);
+ }
+
+ $sql = 'SELECT *
+ FROM ' . $this->table_name . '
+ WHERE ' . $this->column_parent_id . ' = ' . (int) $parent_id . '
+ ' . $this->get_sql_where('AND') . '
+ ORDER BY ' . $this->column_left_id . ', ' . $this->column_item_id . ' ASC';
+ $result = $this->db->sql_query($sql);
+ $rows = $this->db->sql_fetchrowset($result);
+ $this->db->sql_freeresult($result);
+
+ foreach ($rows as $row)
+ {
+ // First we update the left_id for this module
+ if ($row[$this->column_left_id] != $new_id)
+ {
+ $sql = 'UPDATE ' . $this->table_name . '
+ SET ' . $this->db->sql_build_array('UPDATE', array($this->column_left_id => $new_id)) . '
+ WHERE ' . $this->column_item_id . ' = ' . (int) $row[$this->column_item_id];
+ $this->db->sql_query($sql);
+ }
+ $new_id++;
+
+ // Then we go through any children and update their left/right id's
+ $new_id = $this->regenerate_left_right_ids($new_id, $row[$this->column_item_id]);
+
+ // Then we come back and update the right_id for this module
+ if ($row[$this->column_right_id] != $new_id)
+ {
+ $sql = 'UPDATE ' . $this->table_name . '
+ SET ' . $this->db->sql_build_array('UPDATE', array($this->column_right_id => $new_id)) . '
+ WHERE ' . $this->column_item_id . ' = ' . (int) $row[$this->column_item_id];
+ $this->db->sql_query($sql);
+ }
+ $new_id++;
+ }
+
+ if ($acquired_new_lock)
+ {
+ $this->db->sql_transaction('commit');
+ $this->lock->release();
+ }
+
+ return $new_id;
+ }
+}
diff --git a/phpBB/phpbb/tree/nestedset_forum.php b/phpBB/phpbb/tree/nestedset_forum.php
new file mode 100644
index 0000000000..890fc804c0
--- /dev/null
+++ b/phpBB/phpbb/tree/nestedset_forum.php
@@ -0,0 +1,44 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\tree;
+
+class nestedset_forum extends \phpbb\tree\nestedset
+{
+ /**
+ * Construct
+ *
+ * @param \phpbb\db\driver\driver_interface $db Database connection
+ * @param \phpbb\lock\db $lock Lock class used to lock the table when moving forums around
+ * @param string $table_name Table name
+ */
+ public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\lock\db $lock, $table_name)
+ {
+ parent::__construct(
+ $db,
+ $lock,
+ $table_name,
+ 'FORUM_NESTEDSET_',
+ '',
+ array(
+ 'forum_id',
+ 'forum_name',
+ 'forum_type',
+ ),
+ array(
+ 'item_id' => 'forum_id',
+ 'item_parents' => 'forum_parents',
+ )
+ );
+ }
+}
diff --git a/phpBB/phpbb/tree/tree_interface.php b/phpBB/phpbb/tree/tree_interface.php
new file mode 100644
index 0000000000..5df01a89cf
--- /dev/null
+++ b/phpBB/phpbb/tree/tree_interface.php
@@ -0,0 +1,120 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\tree;
+
+interface tree_interface
+{
+ /**
+ * Inserts an item into the database table and into the tree.
+ *
+ * @param array $additional_data The item to be added
+ * @return array Array with item data as set in the database
+ */
+ public function insert(array $additional_data);
+
+ /**
+ * Delete an item from the tree and from the database table
+ *
+ * Also deletes the subtree from the tree and from the database table
+ *
+ * @param int $item_id The item to be deleted
+ * @return array Item ids that have been deleted
+ */
+ public function delete($item_id);
+
+ /**
+ * Move an item by a given delta
+ *
+ * An item is only moved up/down within the same parent. If the delta is
+ * larger then the number of children, the item is moved to the top/bottom
+ * of the list of children within this parent.
+ *
+ * @param int $item_id The item to be moved
+ * @param int $delta Number of steps to move this item, < 0 => down, > 0 => up
+ * @return bool True if the item was moved
+ */
+ public function move($item_id, $delta);
+
+ /**
+ * Move an item down by 1
+ *
+ * @param int $item_id The item to be moved
+ * @return bool True if the item was moved
+ */
+ public function move_down($item_id);
+
+ /**
+ * Move an item up by 1
+ *
+ * @param int $item_id The item to be moved
+ * @return bool True if the item was moved
+ */
+ public function move_up($item_id);
+
+ /**
+ * Moves all children of one item to another item
+ *
+ * If the new parent already has children, the new children are appended
+ * to the list.
+ *
+ * @param int $current_parent_id The current parent item
+ * @param int $new_parent_id The new parent item
+ * @return bool True if any items where moved
+ */
+ public function move_children($current_parent_id, $new_parent_id);
+
+ /**
+ * Change parent item
+ *
+ * Moves the item to the bottom of the new \parent's list of children
+ *
+ * @param int $item_id The item to be moved
+ * @param int $new_parent_id The new parent item
+ * @return bool True if the parent was set successfully
+ */
+ public function change_parent($item_id, $new_parent_id);
+
+ /**
+ * Get all items that are either ancestors or descendants of the item
+ *
+ * @param int $item_id Id of the item to retrieve the ancestors/descendants from
+ * @param bool $order_asc Order the items ascendingly (most outer ancestor first)
+ * @param bool $include_item Should the item matching the given item id be included in the list as well
+ * @return array Array of items (containing all columns from the item table)
+ * ID => Item data
+ */
+ public function get_path_and_subtree_data($item_id, $order_asc, $include_item);
+
+ /**
+ * Get all of the item's ancestors
+ *
+ * @param int $item_id Id of the item to retrieve the ancestors from
+ * @param bool $order_asc Order the items ascendingly (most outer ancestor first)
+ * @param bool $include_item Should the item matching the given item id be included in the list as well
+ * @return array Array of items (containing all columns from the item table)
+ * ID => Item data
+ */
+ public function get_path_data($item_id, $order_asc, $include_item);
+
+ /**
+ * Get all of the item's descendants
+ *
+ * @param int $item_id Id of the item to retrieve the descendants from
+ * @param bool $order_asc Order the items ascendingly
+ * @param bool $include_item Should the item matching the given item id be included in the list as well
+ * @return array Array of items (containing all columns from the item table)
+ * ID => Item data
+ */
+ public function get_subtree_data($item_id, $order_asc, $include_item);
+}
diff --git a/phpBB/phpbb/user.php b/phpBB/phpbb/user.php
new file mode 100644
index 0000000000..faedd79703
--- /dev/null
+++ b/phpBB/phpbb/user.php
@@ -0,0 +1,936 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb;
+
+/**
+* Base user class
+*
+* This is the overarching class which contains (through session extend)
+* all methods utilised for user functionality during a session.
+*/
+class user extends \phpbb\session
+{
+ var $lang = array();
+ var $help = array();
+ var $style = array();
+ var $date_format;
+
+ /**
+ * DateTimeZone object holding the timezone of the user
+ */
+ public $timezone;
+
+ /**
+ * @var string Class name of datetime object
+ */
+ protected $datetime;
+
+ var $lang_name = false;
+ var $lang_id = false;
+ var $lang_path;
+ var $img_lang;
+ var $img_array = array();
+
+ // Able to add new options (up to id 31)
+ var $keyoptions = array('viewimg' => 0, 'viewflash' => 1, 'viewsmilies' => 2, 'viewsigs' => 3, 'viewavatars' => 4, 'viewcensors' => 5, 'attachsig' => 6, 'bbcode' => 8, 'smilies' => 9, 'sig_bbcode' => 15, 'sig_smilies' => 16, 'sig_links' => 17);
+
+ /**
+ * Constructor to set the lang path
+ * @param string $datetime_class Class name of datetime class
+ */
+ function __construct($datetime_class)
+ {
+ global $phpbb_root_path;
+
+ $this->lang_path = $phpbb_root_path . 'language/';
+ $this->datetime = $datetime_class;
+ }
+
+ /**
+ * Function to set custom language path (able to use directory outside of phpBB)
+ *
+ * @param string $lang_path New language path used.
+ * @access public
+ */
+ function set_custom_lang_path($lang_path)
+ {
+ $this->lang_path = $lang_path;
+
+ if (substr($this->lang_path, -1) != '/')
+ {
+ $this->lang_path .= '/';
+ }
+ }
+
+ /**
+ * Setup basic user-specific items (style, language, ...)
+ */
+ function setup($lang_set = false, $style_id = false)
+ {
+ global $db, $request, $template, $config, $auth, $phpEx, $phpbb_root_path, $cache;
+ global $phpbb_dispatcher;
+
+ if ($this->data['user_id'] != ANONYMOUS)
+ {
+ $user_lang_name = (file_exists($this->lang_path . $this->data['user_lang'] . "/common.$phpEx")) ? $this->data['user_lang'] : basename($config['default_lang']);
+ $user_date_format = $this->data['user_dateformat'];
+ $user_timezone = $this->data['user_timezone'];
+ }
+ else
+ {
+ $lang_override = $request->variable('language', '');
+ if ($lang_override)
+ {
+ $this->set_cookie('lang', $lang_override, 0, false);
+ }
+ else
+ {
+ $lang_override = $request->variable($config['cookie_name'] . '_lang', '', true, \phpbb\request\request_interface::COOKIE);
+ }
+ if ($lang_override)
+ {
+ $use_lang = basename($lang_override);
+ $user_lang_name = (file_exists($this->lang_path . $use_lang . "/common.$phpEx")) ? $use_lang : basename($config['default_lang']);
+ $this->data['user_lang'] = $user_lang_name;
+ }
+ else
+ {
+ $user_lang_name = basename($config['default_lang']);
+ }
+ $user_date_format = $config['default_dateformat'];
+ $user_timezone = $config['board_timezone'];
+
+ /**
+ * If a guest user is surfing, we try to guess his/her language first by obtaining the browser language
+ * If re-enabled we need to make sure only those languages installed are checked
+ * Commented out so we do not loose the code.
+
+ if ($request->header('Accept-Language'))
+ {
+ $accept_lang_ary = explode(',', $request->header('Accept-Language'));
+
+ foreach ($accept_lang_ary as $accept_lang)
+ {
+ // Set correct format ... guess full xx_YY form
+ $accept_lang = substr($accept_lang, 0, 2) . '_' . strtoupper(substr($accept_lang, 3, 2));
+ $accept_lang = basename($accept_lang);
+
+ if (file_exists($this->lang_path . $accept_lang . "/common.$phpEx"))
+ {
+ $user_lang_name = $config['default_lang'] = $accept_lang;
+ break;
+ }
+ else
+ {
+ // No match on xx_YY so try xx
+ $accept_lang = substr($accept_lang, 0, 2);
+ $accept_lang = basename($accept_lang);
+
+ if (file_exists($this->lang_path . $accept_lang . "/common.$phpEx"))
+ {
+ $user_lang_name = $config['default_lang'] = $accept_lang;
+ break;
+ }
+ }
+ }
+ }
+ */
+ }
+
+ $user_data = $this->data;
+ $lang_set_ext = array();
+
+ /**
+ * Event to load language files and modify user data on every page
+ *
+ * @event core.user_setup
+ * @var array user_data Array with user's data row
+ * @var string user_lang_name Basename of the user's langauge
+ * @var string user_date_format User's date/time format
+ * @var string user_timezone User's timezone, should be one of
+ * http://www.php.net/manual/en/timezones.php
+ * @var mixed lang_set String or array of language files
+ * @var array lang_set_ext Array containing entries of format
+ * array(
+ * 'ext_name' => (string) [extension name],
+ * 'lang_set' => (string|array) [language files],
+ * )
+ * For performance reasons, only load translations
+ * that are absolutely needed globally using this
+ * event. Use local events otherwise.
+ * @var mixed style_id Style we are going to display
+ * @since 3.1.0-a1
+ */
+ $vars = array(
+ 'user_data',
+ 'user_lang_name',
+ 'user_date_format',
+ 'user_timezone',
+ 'lang_set',
+ 'lang_set_ext',
+ 'style_id',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.user_setup', compact($vars)));
+
+ $this->data = $user_data;
+ $this->lang_name = $user_lang_name;
+ $this->date_format = $user_date_format;
+
+ try
+ {
+ $this->timezone = new \DateTimeZone($user_timezone);
+ }
+ catch (\Exception $e)
+ {
+ // If the timezone the user has selected is invalid, we fall back to UTC.
+ $this->timezone = new \DateTimeZone('UTC');
+ }
+
+ // We include common language file here to not load it every time a custom language file is included
+ $lang = &$this->lang;
+
+ // Do not suppress error if in DEBUG mode
+ $include_result = (defined('DEBUG')) ? (include $this->lang_path . $this->lang_name . "/common.$phpEx") : (@include $this->lang_path . $this->lang_name . "/common.$phpEx");
+
+ if ($include_result === false)
+ {
+ die('Language file ' . $this->lang_path . $this->lang_name . "/common.$phpEx" . " couldn't be opened.");
+ }
+
+ $this->add_lang($lang_set);
+ unset($lang_set);
+
+ foreach ($lang_set_ext as $ext_lang_pair)
+ {
+ $this->add_lang_ext($ext_lang_pair['ext_name'], $ext_lang_pair['lang_set']);
+ }
+ unset($lang_set_ext);
+
+ $style_request = $request->variable('style', 0);
+ if ($style_request && (!$config['override_user_style'] || $auth->acl_get('a_styles')) && !defined('ADMIN_START'))
+ {
+ global $SID, $_EXTRA_URL;
+
+ $style_id = $style_request;
+ $SID .= '&amp;style=' . $style_id;
+ $_EXTRA_URL = array('style=' . $style_id);
+ }
+ else
+ {
+ // Set up style
+ $style_id = ($style_id) ? $style_id : ((!$config['override_user_style']) ? $this->data['user_style'] : $config['default_style']);
+ }
+
+ $sql = 'SELECT *
+ FROM ' . STYLES_TABLE . " s
+ WHERE s.style_id = $style_id";
+ $result = $db->sql_query($sql, 3600);
+ $this->style = $db->sql_fetchrow($result);
+ $db->sql_freeresult($result);
+
+ // Fallback to user's standard style
+ if (!$this->style && $style_id != $this->data['user_style'])
+ {
+ $style_id = $this->data['user_style'];
+
+ $sql = 'SELECT *
+ FROM ' . STYLES_TABLE . " s
+ WHERE s.style_id = $style_id";
+ $result = $db->sql_query($sql, 3600);
+ $this->style = $db->sql_fetchrow($result);
+ $db->sql_freeresult($result);
+ }
+
+ // User has wrong style
+ if (!$this->style && $style_id == $this->data['user_style'])
+ {
+ $style_id = $this->data['user_style'] = $config['default_style'];
+
+ $sql = 'UPDATE ' . USERS_TABLE . "
+ SET user_style = $style_id
+ WHERE user_id = {$this->data['user_id']}";
+ $db->sql_query($sql);
+
+ $sql = 'SELECT *
+ FROM ' . STYLES_TABLE . " s
+ WHERE s.style_id = $style_id";
+ $result = $db->sql_query($sql, 3600);
+ $this->style = $db->sql_fetchrow($result);
+ $db->sql_freeresult($result);
+ }
+
+ if (!$this->style)
+ {
+ trigger_error('NO_STYLE_DATA', E_USER_ERROR);
+ }
+
+ // Now parse the cfg file and cache it
+ $parsed_items = $cache->obtain_cfg_items($this->style);
+
+ $check_for = array(
+ 'pagination_sep' => (string) ', '
+ );
+
+ foreach ($check_for as $key => $default_value)
+ {
+ $this->style[$key] = (isset($parsed_items[$key])) ? $parsed_items[$key] : $default_value;
+ settype($this->style[$key], gettype($default_value));
+
+ if (is_string($default_value))
+ {
+ $this->style[$key] = htmlspecialchars($this->style[$key]);
+ }
+ }
+
+ $template->set_style();
+
+ $this->img_lang = $this->lang_name;
+
+ // Call phpbb_user_session_handler() in case external application want to "bend" some variables or replace classes...
+ // After calling it we continue script execution...
+ phpbb_user_session_handler();
+
+ /**
+ * Execute code at the end of user setup
+ *
+ * @event core.user_setup_after
+ * @since 3.1.6-RC1
+ */
+ $phpbb_dispatcher->dispatch('core.user_setup_after');
+
+ // If this function got called from the error handler we are finished here.
+ if (defined('IN_ERROR_HANDLER'))
+ {
+ return;
+ }
+
+ // Disable board if the install/ directory is still present
+ // For the brave development army we do not care about this, else we need to comment out this everytime we develop locally
+ if (!defined('DEBUG') && !defined('ADMIN_START') && !defined('IN_INSTALL') && !defined('IN_LOGIN') && file_exists($phpbb_root_path . 'install') && !is_file($phpbb_root_path . 'install'))
+ {
+ // Adjust the message slightly according to the permissions
+ if ($auth->acl_gets('a_', 'm_') || $auth->acl_getf_global('m_'))
+ {
+ $message = 'REMOVE_INSTALL';
+ }
+ else
+ {
+ $message = (!empty($config['board_disable_msg'])) ? $config['board_disable_msg'] : 'BOARD_DISABLE';
+ }
+ trigger_error($message);
+ }
+
+ // Is board disabled and user not an admin or moderator?
+ if ($config['board_disable'] && !defined('IN_LOGIN') && !defined('SKIP_CHECK_DISABLED') && !$auth->acl_gets('a_', 'm_') && !$auth->acl_getf_global('m_'))
+ {
+ if ($this->data['is_bot'])
+ {
+ send_status_line(503, 'Service Unavailable');
+ }
+
+ $message = (!empty($config['board_disable_msg'])) ? $config['board_disable_msg'] : 'BOARD_DISABLE';
+ trigger_error($message);
+ }
+
+ // Is load exceeded?
+ if ($config['limit_load'] && $this->load !== false)
+ {
+ if ($this->load > floatval($config['limit_load']) && !defined('IN_LOGIN') && !defined('IN_ADMIN'))
+ {
+ // Set board disabled to true to let the admins/mods get the proper notification
+ $config['board_disable'] = '1';
+
+ if (!$auth->acl_gets('a_', 'm_') && !$auth->acl_getf_global('m_'))
+ {
+ if ($this->data['is_bot'])
+ {
+ send_status_line(503, 'Service Unavailable');
+ }
+ trigger_error('BOARD_UNAVAILABLE');
+ }
+ }
+ }
+
+ if (isset($this->data['session_viewonline']))
+ {
+ // Make sure the user is able to hide his session
+ if (!$this->data['session_viewonline'])
+ {
+ // Reset online status if not allowed to hide the session...
+ if (!$auth->acl_get('u_hideonline'))
+ {
+ $sql = 'UPDATE ' . SESSIONS_TABLE . '
+ SET session_viewonline = 1
+ WHERE session_user_id = ' . $this->data['user_id'];
+ $db->sql_query($sql);
+ $this->data['session_viewonline'] = 1;
+ }
+ }
+ else if (!$this->data['user_allow_viewonline'])
+ {
+ // the user wants to hide and is allowed to -> cloaking device on.
+ if ($auth->acl_get('u_hideonline'))
+ {
+ $sql = 'UPDATE ' . SESSIONS_TABLE . '
+ SET session_viewonline = 0
+ WHERE session_user_id = ' . $this->data['user_id'];
+ $db->sql_query($sql);
+ $this->data['session_viewonline'] = 0;
+ }
+ }
+ }
+
+ // Does the user need to change their password? If so, redirect to the
+ // ucp profile reg_details page ... of course do not redirect if we're already in the ucp
+ if (!defined('IN_ADMIN') && !defined('ADMIN_START') && $config['chg_passforce'] && !empty($this->data['is_registered']) && $auth->acl_get('u_chgpasswd') && $this->data['user_passchg'] < time() - ($config['chg_passforce'] * 86400))
+ {
+ if (strpos($this->page['query_string'], 'mode=reg_details') === false && $this->page['page_name'] != "ucp.$phpEx")
+ {
+ redirect(append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=profile&amp;mode=reg_details'));
+ }
+ }
+
+ return;
+ }
+
+ /**
+ * More advanced language substitution
+ * Function to mimic sprintf() with the possibility of using phpBB's language system to substitute nullar/singular/plural forms.
+ * Params are the language key and the parameters to be substituted.
+ * This function/functionality is inspired by SHS` and Ashe.
+ *
+ * Example call: <samp>$user->lang('NUM_POSTS_IN_QUEUE', 1);</samp>
+ *
+ * If the first parameter is an array, the elements are used as keys and subkeys to get the language entry:
+ * Example: <samp>$user->lang(array('datetime', 'AGO'), 1)</samp> uses $user->lang['datetime']['AGO'] as language entry.
+ */
+ function lang()
+ {
+ $args = func_get_args();
+ $key = $args[0];
+
+ if (is_array($key))
+ {
+ $lang = &$this->lang[array_shift($key)];
+
+ foreach ($key as $_key)
+ {
+ $lang = &$lang[$_key];
+ }
+ }
+ else
+ {
+ $lang = &$this->lang[$key];
+ }
+
+ // Return if language string does not exist
+ if (!isset($lang) || (!is_string($lang) && !is_array($lang)))
+ {
+ return $key;
+ }
+
+ // If the language entry is a string, we simply mimic sprintf() behaviour
+ if (is_string($lang))
+ {
+ if (sizeof($args) == 1)
+ {
+ return $lang;
+ }
+
+ // Replace key with language entry and simply pass along...
+ $args[0] = $lang;
+ return call_user_func_array('sprintf', $args);
+ }
+ else if (sizeof($lang) == 0)
+ {
+ // If the language entry is an empty array, we just return the language key
+ return $args[0];
+ }
+
+ // It is an array... now handle different nullar/singular/plural forms
+ $key_found = false;
+
+ // We now get the first number passed and will select the key based upon this number
+ for ($i = 1, $num_args = sizeof($args); $i < $num_args; $i++)
+ {
+ if (is_int($args[$i]) || is_float($args[$i]))
+ {
+ if ($args[$i] == 0 && isset($lang[0]))
+ {
+ // We allow each translation using plural forms to specify a version for the case of 0 things,
+ // so that "0 users" may be displayed as "No users".
+ $key_found = 0;
+ break;
+ }
+ else
+ {
+ $use_plural_form = $this->get_plural_form($args[$i]);
+ if (isset($lang[$use_plural_form]))
+ {
+ // The key we should use exists, so we use it.
+ $key_found = $use_plural_form;
+ }
+ else
+ {
+ // If the key we need to use does not exist, we fall back to the previous one.
+ $numbers = array_keys($lang);
+
+ foreach ($numbers as $num)
+ {
+ if ($num > $use_plural_form)
+ {
+ break;
+ }
+
+ $key_found = $num;
+ }
+ }
+ break;
+ }
+ }
+ }
+
+ // Ok, let's check if the key was found, else use the last entry (because it is mostly the plural form)
+ if ($key_found === false)
+ {
+ $numbers = array_keys($lang);
+ $key_found = end($numbers);
+ }
+
+ // Use the language string we determined and pass it to sprintf()
+ $args[0] = $lang[$key_found];
+ return call_user_func_array('sprintf', $args);
+ }
+
+ /**
+ * Determine which plural form we should use.
+ * For some languages this is not as simple as for English.
+ *
+ * @param $number int|float The number we want to get the plural case for. Float numbers are floored.
+ * @param $force_rule mixed False to use the plural rule of the language package
+ * or an integer to force a certain plural rule
+ * @return int The plural-case we need to use for the number plural-rule combination
+ */
+ function get_plural_form($number, $force_rule = false)
+ {
+ $number = (int) $number;
+
+ // Default to English system
+ $plural_rule = ($force_rule !== false) ? $force_rule : ((isset($this->lang['PLURAL_RULE'])) ? $this->lang['PLURAL_RULE'] : 1);
+
+ return phpbb_get_plural_form($plural_rule, $number);
+ }
+
+ /**
+ * Add Language Items - use_db and use_help are assigned where needed (only use them to force inclusion)
+ *
+ * @param mixed $lang_set specifies the language entries to include
+ * @param bool $use_db internal variable for recursion, do not use
+ * @param bool $use_help internal variable for recursion, do not use
+ * @param string $ext_name The extension to load language from, or empty for core files
+ *
+ * Examples:
+ * <code>
+ * $lang_set = array('posting', 'help' => 'faq');
+ * $lang_set = array('posting', 'viewtopic', 'help' => array('bbcode', 'faq'))
+ * $lang_set = array(array('posting', 'viewtopic'), 'help' => array('bbcode', 'faq'))
+ * $lang_set = 'posting'
+ * $lang_set = array('help' => 'faq', 'db' => array('help:faq', 'posting'))
+ * </code>
+ */
+ function add_lang($lang_set, $use_db = false, $use_help = false, $ext_name = '')
+ {
+ global $phpEx;
+
+ if (is_array($lang_set))
+ {
+ foreach ($lang_set as $key => $lang_file)
+ {
+ // Please do not delete this line.
+ // We have to force the type here, else [array] language inclusion will not work
+ $key = (string) $key;
+
+ if ($key == 'db')
+ {
+ $this->add_lang($lang_file, true, $use_help, $ext_name);
+ }
+ else if ($key == 'help')
+ {
+ $this->add_lang($lang_file, $use_db, true, $ext_name);
+ }
+ else if (!is_array($lang_file))
+ {
+ $this->set_lang($this->lang, $this->help, $lang_file, $use_db, $use_help, $ext_name);
+ }
+ else
+ {
+ $this->add_lang($lang_file, $use_db, $use_help, $ext_name);
+ }
+ }
+ unset($lang_set);
+ }
+ else if ($lang_set)
+ {
+ $this->set_lang($this->lang, $this->help, $lang_set, $use_db, $use_help, $ext_name);
+ }
+ }
+
+ /**
+ * Add Language Items from an extension - use_db and use_help are assigned where needed (only use them to force inclusion)
+ *
+ * @param string $ext_name The extension to load language from, or empty for core files
+ * @param mixed $lang_set specifies the language entries to include
+ * @param bool $use_db internal variable for recursion, do not use
+ * @param bool $use_help internal variable for recursion, do not use
+ */
+ function add_lang_ext($ext_name, $lang_set, $use_db = false, $use_help = false)
+ {
+ if ($ext_name === '/')
+ {
+ $ext_name = '';
+ }
+
+ $this->add_lang($lang_set, $use_db, $use_help, $ext_name);
+ }
+
+ /**
+ * Set language entry (called by add_lang)
+ * @access private
+ */
+ function set_lang(&$lang, &$help, $lang_file, $use_db = false, $use_help = false, $ext_name = '')
+ {
+ global $phpbb_root_path, $phpEx;
+
+ // Make sure the language name is set (if the user setup did not happen it is not set)
+ if (!$this->lang_name)
+ {
+ global $config;
+ $this->lang_name = basename($config['default_lang']);
+ }
+
+ // $lang == $this->lang
+ // $help == $this->help
+ // - add appropriate variables here, name them as they are used within the language file...
+ if (!$use_db)
+ {
+ if ($use_help && strpos($lang_file, '/') !== false)
+ {
+ $filename = dirname($lang_file) . '/help_' . basename($lang_file);
+ }
+ else
+ {
+ $filename = (($use_help) ? 'help_' : '') . $lang_file;
+ }
+
+ if ($ext_name)
+ {
+ global $phpbb_extension_manager;
+ $ext_path = $phpbb_extension_manager->get_extension_path($ext_name, true);
+
+ $lang_path = $ext_path . 'language/';
+ }
+ else
+ {
+ $lang_path = $this->lang_path;
+ }
+
+ if (strpos($phpbb_root_path . $filename, $lang_path) === 0)
+ {
+ $language_filename = $phpbb_root_path . $filename;
+ }
+ else
+ {
+ $language_filename = $lang_path . $this->lang_name . '/' . $filename . '.' . $phpEx;
+ }
+
+ // If we are in install, try to use the updated version, when available
+ $install_language_filename = str_replace('language/', 'install/update/new/language/', $language_filename);
+ if (defined('IN_INSTALL') && file_exists($install_language_filename))
+ {
+ $language_filename = $install_language_filename;
+ }
+
+ if (!file_exists($language_filename))
+ {
+ global $config;
+
+ if ($this->lang_name == 'en')
+ {
+ // The user's selected language is missing the file, the board default's language is missing the file, and the file doesn't exist in /en.
+ $language_filename = str_replace($lang_path . 'en', $lang_path . $this->data['user_lang'], $language_filename);
+ trigger_error('Language file ' . $language_filename . ' couldn\'t be opened.', E_USER_ERROR);
+ }
+ else if ($this->lang_name == basename($config['default_lang']))
+ {
+ // Fall back to the English Language
+ $reset_lang_name = $this->lang_name;
+ $this->lang_name = 'en';
+ $this->set_lang($lang, $help, $lang_file, $use_db, $use_help, $ext_name);
+ $this->lang_name = $reset_lang_name;
+ }
+ else if ($this->lang_name == $this->data['user_lang'])
+ {
+ // Fall back to the board default language
+ $reset_lang_name = $this->lang_name;
+ $this->lang_name = basename($config['default_lang']);
+ $this->set_lang($lang, $help, $lang_file, $use_db, $use_help, $ext_name);
+ $this->lang_name = $reset_lang_name;
+ }
+
+ return;
+ }
+
+ // Do not suppress error if in DEBUG mode
+ $include_result = (defined('DEBUG')) ? (include $language_filename) : (@include $language_filename);
+
+ if ($include_result === false)
+ {
+ trigger_error('Language file ' . $language_filename . ' couldn\'t be opened.', E_USER_ERROR);
+ }
+ }
+ else if ($use_db)
+ {
+ // Get Database Language Strings
+ // Put them into $lang if nothing is prefixed, put them into $help if help: is prefixed
+ // For example: help:faq, posting
+ }
+ }
+
+ /**
+ * Format user date
+ *
+ * @param int $gmepoch unix timestamp
+ * @param string $format date format in date() notation. | used to indicate relative dates, for example |d m Y|, h:i is translated to Today, h:i.
+ * @param bool $forcedate force non-relative date format.
+ *
+ * @return mixed translated date
+ */
+ function format_date($gmepoch, $format = false, $forcedate = false)
+ {
+ static $utc;
+
+ if (!isset($utc))
+ {
+ $utc = new \DateTimeZone('UTC');
+ }
+
+ $time = new $this->datetime($this, '@' . (int) $gmepoch, $utc);
+ $time->setTimezone($this->timezone);
+
+ return $time->format($format, $forcedate);
+ }
+
+ /**
+ * Create a \phpbb\datetime object in the context of the current user
+ *
+ * @since 3.1
+ * @param string $time String in a format accepted by strtotime().
+ * @param DateTimeZone $timezone Time zone of the time.
+ * @return \phpbb\datetime Date time object linked to the current users locale
+ */
+ public function create_datetime($time = 'now', \DateTimeZone $timezone = null)
+ {
+ $timezone = $timezone ?: $this->timezone;
+ return new $this->datetime($this, $time, $timezone);
+ }
+
+ /**
+ * Get the UNIX timestamp for a datetime in the users timezone, so we can store it in the database.
+ *
+ * @param string $format Format of the entered date/time
+ * @param string $time Date/time with the timezone applied
+ * @param DateTimeZone $timezone Timezone of the date/time, falls back to timezone of current user
+ * @return int Returns the unix timestamp
+ */
+ public function get_timestamp_from_format($format, $time, \DateTimeZone $timezone = null)
+ {
+ $timezone = $timezone ?: $this->timezone;
+ $date = \DateTime::createFromFormat($format, $time, $timezone);
+ return ($date !== false) ? $date->format('U') : false;
+ }
+
+ /**
+ * Get language id currently used by the user
+ */
+ function get_iso_lang_id()
+ {
+ global $config, $db;
+
+ if (!empty($this->lang_id))
+ {
+ return $this->lang_id;
+ }
+
+ if (!$this->lang_name)
+ {
+ $this->lang_name = $config['default_lang'];
+ }
+
+ $sql = 'SELECT lang_id
+ FROM ' . LANG_TABLE . "
+ WHERE lang_iso = '" . $db->sql_escape($this->lang_name) . "'";
+ $result = $db->sql_query($sql);
+ $this->lang_id = (int) $db->sql_fetchfield('lang_id');
+ $db->sql_freeresult($result);
+
+ return $this->lang_id;
+ }
+
+ /**
+ * Get users profile fields
+ */
+ function get_profile_fields($user_id)
+ {
+ global $db;
+
+ if (isset($this->profile_fields))
+ {
+ return;
+ }
+
+ $sql = 'SELECT *
+ FROM ' . PROFILE_FIELDS_DATA_TABLE . "
+ WHERE user_id = $user_id";
+ $result = $db->sql_query_limit($sql, 1);
+ $this->profile_fields = (!($row = $db->sql_fetchrow($result))) ? array() : $row;
+ $db->sql_freeresult($result);
+ }
+
+ /**
+ * Specify/Get image
+ */
+ function img($img, $alt = '')
+ {
+ $title = '';
+
+ if ($alt)
+ {
+ $alt = $this->lang($alt);
+ $title = ' title="' . $alt . '"';
+ }
+ return '<span class="imageset ' . $img . '"' . $title . '>' . $alt . '</span>';
+ }
+
+ /**
+ * Get option bit field from user options.
+ *
+ * @param int $key option key, as defined in $keyoptions property.
+ * @param int $data bit field value to use, or false to use $this->data['user_options']
+ * @return bool true if the option is set in the bit field, false otherwise
+ */
+ function optionget($key, $data = false)
+ {
+ $var = ($data !== false) ? $data : $this->data['user_options'];
+ return phpbb_optionget($this->keyoptions[$key], $var);
+ }
+
+ /**
+ * Set option bit field for user options.
+ *
+ * @param int $key Option key, as defined in $keyoptions property.
+ * @param bool $value True to set the option, false to clear the option.
+ * @param int $data Current bit field value, or false to use $this->data['user_options']
+ * @return int|bool If $data is false, the bit field is modified and
+ * written back to $this->data['user_options'], and
+ * return value is true if the bit field changed and
+ * false otherwise. If $data is not false, the new
+ * bitfield value is returned.
+ */
+ function optionset($key, $value, $data = false)
+ {
+ $var = ($data !== false) ? $data : $this->data['user_options'];
+
+ $new_var = phpbb_optionset($this->keyoptions[$key], $value, $var);
+
+ if ($data === false)
+ {
+ if ($new_var != $var)
+ {
+ $this->data['user_options'] = $new_var;
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+ }
+ else
+ {
+ return $new_var;
+ }
+ }
+
+ /**
+ * Funtion to make the user leave the NEWLY_REGISTERED system group.
+ * @access public
+ */
+ function leave_newly_registered()
+ {
+ global $db;
+
+ if (empty($this->data['user_new']))
+ {
+ return false;
+ }
+
+ if (!function_exists('remove_newly_registered'))
+ {
+ global $phpbb_root_path, $phpEx;
+
+ include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
+ }
+ if ($group = remove_newly_registered($this->data['user_id'], $this->data))
+ {
+ $this->data['group_id'] = $group;
+
+ }
+ $this->data['user_permissions'] = '';
+ $this->data['user_new'] = 0;
+
+ return true;
+ }
+
+ /**
+ * Returns all password protected forum ids the user is currently NOT authenticated for.
+ *
+ * @return array Array of forum ids
+ * @access public
+ */
+ function get_passworded_forums()
+ {
+ global $db;
+
+ $sql = 'SELECT f.forum_id, fa.user_id
+ FROM ' . FORUMS_TABLE . ' f
+ LEFT JOIN ' . FORUMS_ACCESS_TABLE . " fa
+ ON (fa.forum_id = f.forum_id
+ AND fa.session_id = '" . $db->sql_escape($this->session_id) . "')
+ WHERE f.forum_password <> ''";
+ $result = $db->sql_query($sql);
+
+ $forum_ids = array();
+ while ($row = $db->sql_fetchrow($result))
+ {
+ $forum_id = (int) $row['forum_id'];
+
+ if ($row['user_id'] != $this->data['user_id'])
+ {
+ $forum_ids[$forum_id] = $forum_id;
+ }
+ }
+ $db->sql_freeresult($result);
+
+ return $forum_ids;
+ }
+}
diff --git a/phpBB/phpbb/user_loader.php b/phpBB/phpbb/user_loader.php
new file mode 100644
index 0000000000..967d96d73a
--- /dev/null
+++ b/phpBB/phpbb/user_loader.php
@@ -0,0 +1,229 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb;
+
+/**
+* User loader class
+*
+* This handles loading users from the database and
+* storing in them in a temporary cache so we do not
+* have to query the same user multiple times in
+* different services.
+*/
+class user_loader
+{
+ /** @var \phpbb\db\driver\driver_interface */
+ protected $db = null;
+
+ /** @var string */
+ protected $phpbb_root_path = null;
+
+ /** @var string */
+ protected $php_ext = null;
+
+ /** @var string */
+ protected $users_table = null;
+
+ /**
+ * Users loaded from the DB
+ *
+ * @var array Array of user data that we've loaded from the DB
+ */
+ protected $users = array();
+
+ /**
+ * User loader constructor
+ *
+ * @param \phpbb\db\driver\driver_interface $db A database connection
+ * @param string $phpbb_root_path Path to the phpbb includes directory.
+ * @param string $php_ext php file extension
+ * @param string $users_table The name of the database table (phpbb_users)
+ */
+ public function __construct(\phpbb\db\driver\driver_interface $db, $phpbb_root_path, $php_ext, $users_table)
+ {
+ $this->db = $db;
+
+ $this->phpbb_root_path = $phpbb_root_path;
+ $this->php_ext = $php_ext;
+
+ $this->users_table = $users_table;
+ }
+
+ /**
+ * Load user helper
+ *
+ * @param array $user_ids
+ */
+ public function load_users(array $user_ids)
+ {
+ $user_ids[] = ANONYMOUS;
+
+ // Make user_ids unique and convert to integer.
+ $user_ids = array_map('intval', array_unique($user_ids));
+
+ // Do not load users we already have in $this->users
+ $user_ids = array_diff($user_ids, array_keys($this->users));
+
+ if (sizeof($user_ids))
+ {
+ $sql = 'SELECT *
+ FROM ' . $this->users_table . '
+ WHERE ' . $this->db->sql_in_set('user_id', $user_ids);
+ $result = $this->db->sql_query($sql);
+
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $this->users[$row['user_id']] = $row;
+ }
+ $this->db->sql_freeresult($result);
+ }
+ }
+
+ /**
+ * Load a user by username
+ *
+ * Stores the full data in the user cache so they do not need to be loaded again
+ * Returns the user id so you may use get_user() from the returned value
+ *
+ * @param string $username Raw username to load (will be cleaned)
+ * @return int User ID for the username
+ */
+ public function load_user_by_username($username)
+ {
+ $sql = 'SELECT *
+ FROM ' . $this->users_table . "
+ WHERE username_clean = '" . $this->db->sql_escape(utf8_clean_string($username)) . "'";
+ $result = $this->db->sql_query($sql);
+ $row = $this->db->sql_fetchrow($result);
+ $this->db->sql_freeresult($result);
+
+ if ($row)
+ {
+ $this->users[$row['user_id']] = $row;
+
+ return $row['user_id'];
+ }
+
+ return ANONYMOUS;
+ }
+
+ /**
+ * Get a user row from our users cache
+ *
+ * @param int $user_id User ID of the user you want to retreive
+ * @param bool $query Should we query the database if this user has not yet been loaded?
+ * Typically this should be left as false and you should make sure
+ * you load users ahead of time with load_users()
+ * @return array|bool Row from the database of the user or Anonymous if the user wasn't loaded/does not exist
+ * or bool False if the anonymous user was not loaded
+ */
+ public function get_user($user_id, $query = false)
+ {
+ if (isset($this->users[$user_id]))
+ {
+ return $this->users[$user_id];
+ }
+ // Query them if we must (if ANONYMOUS is sent as the user_id and we have not loaded Anonymous yet, we must load Anonymous as a last resort)
+ else if ($query || $user_id == ANONYMOUS)
+ {
+ $this->load_users(array($user_id));
+
+ return $this->get_user($user_id);
+ }
+
+ return $this->get_user(ANONYMOUS);
+ }
+
+ /**
+ * Get username
+ *
+ * @param int $user_id User ID of the user you want to retreive the username for
+ * @param string $mode The mode to load (same as get_username_string). One of the following:
+ * profile (for getting an url to the profile)
+ * username (for obtaining the username)
+ * colour (for obtaining the user colour)
+ * full (for obtaining a html string representing a coloured link to the users profile)
+ * no_profile (the same as full but forcing no profile link)
+ * @param string $guest_username Optional parameter to specify the guest username. It will be used in favor of the GUEST language variable then.
+ * @param string $custom_profile_url Optional parameter to specify a profile url. The user id get appended to this url as &amp;u={user_id}
+ * @param bool $query Should we query the database if this user has not yet been loaded?
+ * Typically this should be left as false and you should make sure
+ * you load users ahead of time with load_users()
+ * @return string
+ */
+ public function get_username($user_id, $mode, $guest_username = false, $custom_profile_url = false, $query = false)
+ {
+ if (!($user = $this->get_user($user_id, $query)))
+ {
+ return '';
+ }
+
+ return get_username_string($mode, $user['user_id'], $user['username'], $user['user_colour'], $guest_username, $custom_profile_url);
+ }
+
+ /**
+ * Get avatar
+ *
+ * @param int $user_id User ID of the user you want to retreive the avatar for
+ * @param bool $query Should we query the database if this user has not yet been loaded?
+ * Typically this should be left as false and you should make sure
+ * you load users ahead of time with load_users()
+ * @param bool @lazy If true, will be lazy loaded (requires JS)
+ * @return string
+ */
+ public function get_avatar($user_id, $query = false, $lazy = false)
+ {
+ if (!($user = $this->get_user($user_id, $query)))
+ {
+ return '';
+ }
+
+ return phpbb_get_avatar(\phpbb\avatar\manager::clean_row($user, 'user'), 'USER_AVATAR', false, $lazy);
+ }
+
+ /**
+ * Get rank
+ *
+ * @param int $user_id User ID of the user you want to retreive the rank for
+ * @param bool $query Should we query the database if this user has not yet been loaded?
+ * Typically this should be left as false and you should make sure
+ * you load users ahead of time with load_users()
+ * @return array Array with keys 'rank_title', 'rank_img', and 'rank_img_src'
+ */
+ public function get_rank($user_id, $query = false)
+ {
+ if (!($user = $this->get_user($user_id, $query)))
+ {
+ return '';
+ }
+
+ if (!function_exists('phpbb_get_user_rank'))
+ {
+ include($this->phpbb_root_path . 'includes/functions_display.' . $this->php_ext);
+ }
+
+ $rank = array(
+ 'rank_title',
+ 'rank_img',
+ 'rank_img_src',
+ );
+
+ $user_rank_data = phpbb_get_user_rank($user, (($user['user_id'] == ANONYMOUS) ? false : $user['user_posts']));
+ $rank['rank_title'] = $user_rank_data['title'];
+ $rank['rank_img'] = $user_rank_data['img'];
+ $rank['rank_img_src'] = $user_rank_data['img_src'];
+
+ return $rank;
+ }
+}
diff --git a/phpBB/phpbb/version_helper.php b/phpBB/phpbb/version_helper.php
new file mode 100644
index 0000000000..7e5edbf522
--- /dev/null
+++ b/phpBB/phpbb/version_helper.php
@@ -0,0 +1,520 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb;
+
+/**
+ * Class to handle version checking and comparison
+ */
+class version_helper
+{
+ /**
+ * @var string Host
+ */
+ protected $host = 'version.phpbb.com';
+
+ /**
+ * @var string Path to file
+ */
+ protected $path = '/phpbb';
+
+ /**
+ * @var string File name
+ */
+ protected $file = 'versions.json';
+
+ /**
+ * @var bool Use SSL or not
+ */
+ protected $use_ssl = false;
+
+ /**
+ * @var string Current version installed
+ */
+ protected $current_version;
+
+ /**
+ * @var null|string Null to not force stability, 'unstable' or 'stable' to
+ * force the corresponding stability
+ */
+ protected $force_stability;
+
+ /** @var \phpbb\cache\service */
+ protected $cache;
+
+ /** @var \phpbb\config\config */
+ protected $config;
+
+ /** @var \phpbb\file_downloader */
+ protected $file_downloader;
+
+ /** @var \phpbb\user */
+ protected $user;
+
+ protected $version_schema = array(
+ 'stable' => array(
+ 'current' => 'version',
+ 'download' => 'url',
+ 'announcement' => 'url',
+ 'eol' => 'url',
+ 'security' => 'bool',
+ ),
+ 'unstable' => array(
+ 'current' => 'version',
+ 'download' => 'url',
+ 'announcement' => 'url',
+ 'eol' => 'url',
+ 'security' => 'bool',
+ ),
+ );
+
+ /**
+ * Constructor
+ *
+ * @param \phpbb\cache\service $cache
+ * @param \phpbb\config\config $config
+ * @param \phpbb\file_downloader $file_downloader
+ * @param \phpbb\user $user
+ */
+ public function __construct(\phpbb\cache\service $cache, \phpbb\config\config $config, \phpbb\file_downloader $file_downloader, \phpbb\user $user)
+ {
+ $this->cache = $cache;
+ $this->config = $config;
+ $this->file_downloader = $file_downloader;
+ $this->user = $user;
+
+ if (defined('PHPBB_QA'))
+ {
+ $this->force_stability = 'unstable';
+ }
+
+ $this->current_version = $this->config['version'];
+ }
+
+ /**
+ * Set location to the file
+ *
+ * @param string $host Host (e.g. version.phpbb.com)
+ * @param string $path Path to file (e.g. /phpbb)
+ * @param string $file File name (Default: versions.json)
+ * @param bool $use_ssl Use SSL or not (Default: false)
+ * @return version_helper
+ */
+ public function set_file_location($host, $path, $file = 'versions.json', $use_ssl = false)
+ {
+ $this->host = $host;
+ $this->path = $path;
+ $this->file = $file;
+ $this->use_ssl = $use_ssl;
+
+ return $this;
+ }
+
+ /**
+ * Set current version
+ *
+ * @param string $version The current version
+ * @return version_helper
+ */
+ public function set_current_version($version)
+ {
+ $this->current_version = $version;
+
+ return $this;
+ }
+
+ /**
+ * Over-ride the stability to force check to include unstable versions
+ *
+ * @param null|string Null to not force stability, 'unstable' or 'stable' to
+ * force the corresponding stability
+ * @return version_helper
+ */
+ public function force_stability($stability)
+ {
+ $this->force_stability = $stability;
+
+ return $this;
+ }
+
+ /**
+ * Wrapper for version_compare() that allows using uppercase A and B
+ * for alpha and beta releases.
+ *
+ * See http://www.php.net/manual/en/function.version-compare.php
+ *
+ * @param string $version1 First version number
+ * @param string $version2 Second version number
+ * @param string $operator Comparison operator (optional)
+ *
+ * @return mixed Boolean (true, false) if comparison operator is specified.
+ * Integer (-1, 0, 1) otherwise.
+ */
+ public function compare($version1, $version2, $operator = null)
+ {
+ return phpbb_version_compare($version1, $version2, $operator);
+ }
+
+ /**
+ * Check whether or not a version is "stable"
+ *
+ * Stable means only numbers OR a pl release
+ *
+ * @param string $version
+ * @return bool Bool true or false
+ */
+ public function is_stable($version)
+ {
+ $matches = false;
+ preg_match('/^[\d\.]+/', $version, $matches);
+
+ if (empty($matches[0]))
+ {
+ return false;
+ }
+
+ return $this->compare($version, $matches[0], '>=');
+ }
+
+ /**
+ * Gets the latest version for the current branch the user is on
+ *
+ * @param bool $force_update Ignores cached data. Defaults to false.
+ * @param bool $force_cache Force the use of the cache. Override $force_update.
+ * @return string
+ * @throws \RuntimeException
+ */
+ public function get_latest_on_current_branch($force_update = false, $force_cache = false)
+ {
+ $versions = $this->get_versions_matching_stability($force_update, $force_cache);
+
+ $self = $this;
+ $current_version = $this->current_version;
+
+ // Filter out any versions less than the current version
+ $versions = array_filter($versions, function($data) use ($self, $current_version) {
+ return $self->compare($data['current'], $current_version, '>=');
+ });
+
+ // Get the lowest version from the previous list.
+ return array_reduce($versions, function($value, $data) use ($self) {
+ if ($value === null || $self->compare($data['current'], $value, '<'))
+ {
+ return $data['current'];
+ }
+
+ return $value;
+ });
+ }
+
+ /**
+ * Gets the latest update for the current branch the user is on
+ * Will suggest versions from newer branches when EoL has been reached
+ * and/or version from newer branch is needed for having all known security
+ * issues fixed.
+ *
+ * @param bool $force_update Ignores cached data. Defaults to false.
+ * @param bool $force_cache Force the use of the cache. Override $force_update.
+ * @return array Version info or empty array if there are no updates
+ * @throws \RuntimeException
+ */
+ public function get_update_on_branch($force_update = false, $force_cache = false)
+ {
+ $versions = $this->get_versions_matching_stability($force_update, $force_cache);
+
+ $self = $this;
+ $current_version = $this->current_version;
+
+ // Filter out any versions less than the current version
+ $versions = array_filter($versions, function($data) use ($self, $current_version) {
+ return $self->compare($data['current'], $current_version, '>=');
+ });
+
+ // Get the lowest version from the previous list.
+ $update_info = array_reduce($versions, function($value, $data) use ($self, $current_version) {
+ if ($value === null && $self->compare($data['current'], $current_version, '>='))
+ {
+ if (!$data['eol'] && (!$data['security'] || $self->compare($data['security'], $data['current'], '<=')))
+ {
+ return ($self->compare($data['current'], $current_version, '>')) ? $data : array();
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ return $value;
+ });
+
+ return $update_info === null ? array() : $update_info;
+ }
+
+ /**
+ * Gets the latest extension update for the current phpBB branch the user is on
+ * Will suggest versions from newer branches when EoL has been reached
+ * and/or version from newer branch is needed for having all known security
+ * issues fixed.
+ *
+ * @param bool $force_update Ignores cached data. Defaults to false.
+ * @param bool $force_cache Force the use of the cache. Override $force_update.
+ * @return array Version info or empty array if there are no updates
+ * @throws \RuntimeException
+ */
+ public function get_ext_update_on_branch($force_update = false, $force_cache = false)
+ {
+ $versions = $this->get_versions_matching_stability($force_update, $force_cache);
+
+ $self = $this;
+ $current_version = $this->current_version;
+
+ // Get current phpBB branch from version, e.g.: 3.2
+ preg_match('/^(\d+\.\d+).*$/', $this->config['version'], $matches);
+ $current_branch = $matches[1];
+
+ // Filter out any versions less than the current version
+ $versions = array_filter($versions, function($data) use ($self, $current_version) {
+ return $self->compare($data['current'], $current_version, '>=');
+ });
+
+ // Filter out any phpbb branches less than the current version
+ $branches = array_filter(array_keys($versions), function($branch) use ($self, $current_branch) {
+ return $self->compare($branch, $current_branch, '>=');
+ });
+ if (!empty($branches))
+ {
+ $versions = array_intersect_key($versions, array_flip($branches));
+ }
+ else
+ {
+ // If branches are empty, it means the current phpBB branch is newer than any branch the
+ // extension was validated against. Reverse sort the versions array so we get the newest
+ // validated release available.
+ krsort($versions);
+ }
+
+ // Get the first available version from the previous list.
+ $update_info = array_reduce($versions, function($value, $data) use ($self, $current_version) {
+ if ($value === null && $self->compare($data['current'], $current_version, '>='))
+ {
+ if (!$data['eol'] && (!$data['security'] || $self->compare($data['security'], $data['current'], '<=')))
+ {
+ return $self->compare($data['current'], $current_version, '>') ? $data : array();
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ return $value;
+ });
+
+ return $update_info === null ? array() : $update_info;
+ }
+
+ /**
+ * Obtains the latest version information
+ *
+ * @param bool $force_update Ignores cached data. Defaults to false.
+ * @param bool $force_cache Force the use of the cache. Override $force_update.
+ * @return array
+ * @throws \RuntimeException
+ */
+ public function get_suggested_updates($force_update = false, $force_cache = false)
+ {
+ $versions = $this->get_versions_matching_stability($force_update, $force_cache);
+
+ $self = $this;
+ $current_version = $this->current_version;
+
+ // Filter out any versions less than or equal to the current version
+ return array_filter($versions, function($data) use ($self, $current_version) {
+ return $self->compare($data['current'], $current_version, '>');
+ });
+ }
+
+ /**
+ * Obtains the latest version information matching the stability of the current install
+ *
+ * @param bool $force_update Ignores cached data. Defaults to false.
+ * @param bool $force_cache Force the use of the cache. Override $force_update.
+ * @return array Version info
+ * @throws \RuntimeException
+ */
+ public function get_versions_matching_stability($force_update = false, $force_cache = false)
+ {
+ $info = $this->get_versions($force_update, $force_cache);
+
+ if ($this->force_stability !== null)
+ {
+ return ($this->force_stability === 'unstable') ? $info['unstable'] : $info['stable'];
+ }
+
+ return ($this->is_stable($this->current_version)) ? $info['stable'] : $info['unstable'];
+ }
+
+ /**
+ * Obtains the latest version information
+ *
+ * @param bool $force_update Ignores cached data. Defaults to false.
+ * @param bool $force_cache Force the use of the cache. Override $force_update.
+ * @return array Version info, includes stable and unstable data
+ * @throws \RuntimeException
+ */
+ public function get_versions($force_update = false, $force_cache = false)
+ {
+ $cache_file = '_versioncheck_' . $this->host . $this->path . $this->file . $this->use_ssl;
+
+ $info = $this->cache->get($cache_file);
+
+ if ($info === false && $force_cache)
+ {
+ throw new \RuntimeException($this->user->lang('VERSIONCHECK_FAIL'));
+ }
+ else if ($info === false || $force_update)
+ {
+ try {
+ $info = $this->file_downloader->get($this->host, $this->path, $this->file, $this->use_ssl ? 443 : 80);
+ }
+ catch (\phpbb\exception\runtime_exception $exception)
+ {
+ $prepare_parameters = array_merge(array($exception->getMessage()), $exception->get_parameters());
+ throw new \RuntimeException(call_user_func_array(array($this->user, 'lang'), $prepare_parameters));
+ }
+ $error_string = $this->file_downloader->get_error_string();
+
+ if (!empty($error_string))
+ {
+ throw new \RuntimeException($error_string);
+ }
+
+ $info = json_decode($info, true);
+
+ // Sanitize any data we retrieve from a server
+ if (!empty($info))
+ {
+ $json_sanitizer = function (&$value, $key) {
+ $type_cast_helper = new \phpbb\request\type_cast_helper();
+ $type_cast_helper->set_var($value, $value, gettype($value), true);
+ };
+ array_walk_recursive($info, $json_sanitizer);
+ }
+
+ if (empty($info['stable']) && empty($info['unstable']))
+ {
+ $this->user->add_lang('acp/common');
+
+ throw new \RuntimeException($this->user->lang('VERSIONCHECK_FAIL'));
+ }
+
+ $info['stable'] = (empty($info['stable'])) ? array() : $info['stable'];
+ $info['unstable'] = (empty($info['unstable'])) ? $info['stable'] : $info['unstable'];
+
+ $info = $this->validate_versions($info);
+
+ $this->cache->put($cache_file, $info, 86400); // 24 hours
+ }
+
+ return $info;
+ }
+
+ /**
+ * Validate versions info input
+ *
+ * @param array $versions_info Decoded json data array. Will be modified
+ * and cleaned by this method
+ *
+ * @return array Versions info array
+ */
+ public function validate_versions($versions_info)
+ {
+ $array_diff = array_diff_key($versions_info, array($this->version_schema));
+
+ // Remove excessive data
+ if (count($array_diff) > 0)
+ {
+ $old_versions_info = $versions_info;
+ $versions_info = array(
+ 'stable' => !empty($old_versions_info['stable']) ? $old_versions_info['stable'] : array(),
+ 'unstable' => !empty($old_versions_info['unstable']) ? $old_versions_info['unstable'] : array(),
+ );
+ unset($old_versions_info);
+ }
+
+ foreach ($versions_info as $stability_type => &$versions_data)
+ {
+ foreach ($versions_data as $branch => &$version_data)
+ {
+ if (!preg_match('/^[0-9a-z\-\.]+$/i', $branch))
+ {
+ unset($versions_data[$branch]);
+ continue;
+ }
+
+ $stability_diff = array_diff_key($version_data, $this->version_schema[$stability_type]);
+
+ if (count($stability_diff) > 0)
+ {
+ $old_version_data = $version_data;
+ $version_data = array();
+ foreach ($this->version_schema[$stability_type] as $key => $value)
+ {
+ if (isset($old_version_data[$key]))
+ {
+ $version_data[$key] = $old_version_data[$key];
+ }
+ }
+ unset($old_version_data);
+ }
+
+ foreach ($version_data as $key => &$value)
+ {
+ if (!isset($this->version_schema[$stability_type][$key]))
+ {
+ unset($version_data[$key]);
+ throw new \RuntimeException($this->user->lang('VERSIONCHECK_INVALID_ENTRY'));
+ }
+
+ switch ($this->version_schema[$stability_type][$key])
+ {
+ case 'bool':
+ $value = (bool) $value;
+ break;
+
+ case 'url':
+ if (!empty($value) && !preg_match('#^' . get_preg_expression('url') . '$#iu', $value) &&
+ !preg_match('#^' . get_preg_expression('www_url') . '$#iu', $value))
+ {
+ throw new \RuntimeException($this->user->lang('VERSIONCHECK_INVALID_URL'));
+ }
+ break;
+
+ case 'version':
+ if (!empty($value) && !preg_match(get_preg_expression('semantic_version'), $value))
+ {
+ throw new \RuntimeException($this->user->lang('VERSIONCHECK_INVALID_VERSION'));
+ }
+ break;
+
+ default:
+ // Shouldn't be possible to trigger this
+ throw new \RuntimeException($this->user->lang('VERSIONCHECK_INVALID_ENTRY'));
+ }
+ }
+ }
+ }
+
+ return $versions_info;
+ }
+}
diff --git a/phpBB/phpbb/viewonline_helper.php b/phpBB/phpbb/viewonline_helper.php
new file mode 100644
index 0000000000..b722f9d911
--- /dev/null
+++ b/phpBB/phpbb/viewonline_helper.php
@@ -0,0 +1,54 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb;
+
+/**
+* Class to handle viewonline related tasks
+*/
+class viewonline_helper
+{
+ /** @var \phpbb\filesystem */
+ protected $filesystem;
+
+ /**
+ * @param \phpbb\filesystem $filesystem
+ */
+ public function __construct(\phpbb\filesystem $filesystem)
+ {
+ $this->filesystem = $filesystem;
+ }
+
+ /**
+ * Get user page
+ *
+ * @param string $session_page User's session page
+ * @return array Match array filled by preg_match()
+ */
+ public function get_user_page($session_page)
+ {
+ $session_page = $this->filesystem->clean_path($session_page);
+ if (strpos($session_page, './') === 0)
+ {
+ $session_page = substr($session_page, 2);
+ }
+
+ preg_match('#^((\.\./)*([a-z0-9/_-]+))#i', $session_page, $on_page);
+ if (empty($on_page))
+ {
+ $on_page[1] = '';
+ }
+
+ return $on_page;
+ }
+}
diff --git a/phpBB/posting.php b/phpBB/posting.php
index 964b0f1f8b..35c1f84fa3 100644
--- a/phpBB/posting.php
+++ b/phpBB/posting.php
@@ -1,10 +1,13 @@
<?php
/**
*
-* @package phpBB3
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -32,19 +35,74 @@ $forum_id = request_var('f', 0);
$draft_id = request_var('d', 0);
$lastclick = request_var('lastclick', 0);
-$submit = (isset($_POST['post'])) ? true : false;
$preview = (isset($_POST['preview'])) ? true : false;
$save = (isset($_POST['save'])) ? true : false;
$load = (isset($_POST['load'])) ? true : false;
-$delete = (isset($_POST['delete'])) ? true : false;
+$confirm = $request->is_set_post('confirm');
$cancel = (isset($_POST['cancel']) && !isset($_POST['save'])) ? true : false;
-$refresh = (isset($_POST['add_file']) || isset($_POST['delete_file']) || isset($_POST['full_editor']) || isset($_POST['cancel_unglobalise']) || $save || $load) ? true : false;
-$mode = ($delete && !$preview && !$refresh && $submit) ? 'delete' : request_var('mode', '');
+$refresh = (isset($_POST['add_file']) || isset($_POST['delete_file']) || isset($_POST['cancel_unglobalise']) || $save || $load || $preview);
+$submit = $request->is_set_post('post') && !$refresh && !$preview;
+$mode = request_var('mode', '');
+
+// If the user is not allowed to delete the post, we try to soft delete it, so we overwrite the mode here.
+if ($mode == 'delete' && (($confirm && !$request->is_set_post('delete_permanent')) || !$auth->acl_gets('f_delete', 'm_delete', $forum_id)))
+{
+ $mode = 'soft_delete';
+}
$error = $post_data = array();
$current_time = time();
+/**
+* This event allows you to alter the above parameters, such as submit and mode
+*
+* Note: $refresh must be true to retain previously submitted form data.
+*
+* Note: The template class will not work properly until $user->setup() is
+* called, and it has not been called yet. Extensions requiring template
+* assignments should use an event that comes later in this file.
+*
+* @event core.modify_posting_parameters
+* @var int post_id ID of the post
+* @var int topic_id ID of the topic
+* @var int forum_id ID of the forum
+* @var int draft_id ID of the draft
+* @var int lastclick Timestamp of when the form was last loaded
+* @var bool submit Whether or not the form has been submitted
+* @var bool preview Whether or not the post is being previewed
+* @var bool save Whether or not a draft is being saved
+* @var bool load Whether or not a draft is being loaded
+* @var bool cancel Whether or not to cancel the form (returns to
+* viewtopic or viewforum depending on if the user
+* is posting a new topic or editing a post)
+* @var bool refresh Whether or not to retain previously submitted data
+* @var string mode What action to take if the form has been submitted
+* post|reply|quote|edit|delete|bump|smilies|popup
+* @var array error Any error strings; a non-empty array aborts
+* form submission.
+* NOTE: Should be actual language strings, NOT
+* language keys.
+* @since 3.1.0-a1
+* @changed 3.1.2-RC1 Removed 'delete' var as it does not exist
+*/
+$vars = array(
+ 'post_id',
+ 'topic_id',
+ 'forum_id',
+ 'draft_id',
+ 'lastclick',
+ 'submit',
+ 'preview',
+ 'save',
+ 'load',
+ 'cancel',
+ 'refresh',
+ 'mode',
+ 'error',
+);
+extract($phpbb_dispatcher->trigger_event('core.modify_posting_parameters', compact($vars)));
+
// Was cancel pressed? If so then redirect to the appropriate page
if ($cancel || ($current_time - $lastclick < 2 && $submit))
{
@@ -58,6 +116,8 @@ if (in_array($mode, array('post', 'reply', 'quote', 'edit', 'delete')) && !$foru
trigger_error('NO_FORUM');
}
+$phpbb_content_visibility = $phpbb_container->get('content.visibility');
+
// We need to know some basic information in all cases before we do anything.
switch ($mode)
{
@@ -87,14 +147,14 @@ switch ($mode)
$sql = 'SELECT f.*, t.*
FROM ' . TOPICS_TABLE . ' t, ' . FORUMS_TABLE . " f
WHERE t.topic_id = $topic_id
- AND (f.forum_id = t.forum_id
- OR f.forum_id = $forum_id)" .
- (($auth->acl_get('m_approve', $forum_id)) ? '' : 'AND t.topic_approved = 1');
+ AND f.forum_id = t.forum_id
+ AND " . $phpbb_content_visibility->get_visibility_sql('topic', $forum_id, 't.');
break;
case 'quote':
case 'edit':
case 'delete':
+ case 'soft_delete':
if (!$post_id)
{
$user->setup('posting');
@@ -116,9 +176,8 @@ switch ($mode)
WHERE p.post_id = $post_id
AND t.topic_id = p.topic_id
AND u.user_id = p.poster_id
- AND (f.forum_id = t.forum_id
- OR f.forum_id = $forum_id)" .
- (($auth->acl_get('m_approve', $forum_id)) ? '' : 'AND p.post_approved = 1');
+ AND f.forum_id = t.forum_id
+ AND " . $phpbb_content_visibility->get_visibility_sql('post', $forum_id, 'p.');
break;
case 'smilies':
@@ -135,7 +194,7 @@ switch ($mode)
}
else
{
- upload_popup();
+ phpbb_upload_popup();
return;
}
break;
@@ -166,14 +225,14 @@ if (!$post_data)
// Not able to reply to unapproved posts/topics
// TODO: add more descriptive language key
-if ($auth->acl_get('m_approve', $forum_id) && ((($mode == 'reply' || $mode == 'bump') && !$post_data['topic_approved']) || ($mode == 'quote' && !$post_data['post_approved'])))
+if ($auth->acl_get('m_approve', $forum_id) && ((($mode == 'reply' || $mode == 'bump') && $post_data['topic_visibility'] != ITEM_APPROVED) || ($mode == 'quote' && $post_data['post_visibility'] != ITEM_APPROVED)))
{
trigger_error(($mode == 'reply' || $mode == 'bump') ? 'TOPIC_UNAPPROVED' : 'POST_UNAPPROVED');
}
if ($mode == 'popup')
{
- upload_popup($post_data['forum_style']);
+ phpbb_upload_popup($post_data['forum_style']);
return;
}
@@ -181,8 +240,7 @@ $user->setup(array('posting', 'mcp', 'viewtopic'), $post_data['forum_style']);
if ($config['enable_post_confirm'] && !$user->data['is_registered'])
{
- include($phpbb_root_path . 'includes/captcha/captcha_factory.' . $phpEx);
- $captcha =& phpbb_captcha_factory::get_instance($config['captcha_plugin']);
+ $captcha = $phpbb_container->get('captcha.factory')->get_instance($config['captcha_plugin']);
$captcha->init(CONFIRM_POST);
}
@@ -214,8 +272,18 @@ if (!$auth->acl_get('f_read', $forum_id))
{
trigger_error('USER_CANNOT_READ');
}
+ $message = $user->lang['LOGIN_EXPLAIN_POST'];
+
+ if ($request->is_ajax())
+ {
+ $json = new phpbb\json_response();
+ $json->send(array(
+ 'title' => $user->lang['INFORMATION'],
+ 'message' => $message,
+ ));
+ }
- login_box('', $user->lang['LOGIN_EXPLAIN_POST']);
+ login_box('', $message);
}
// Permission to do the action asked?
@@ -258,23 +326,88 @@ switch ($mode)
break;
case 'delete':
- if ($user->data['is_registered'] && $auth->acl_gets('f_delete', 'm_delete', $forum_id))
+ if ($user->data['is_registered'] && ($auth->acl_get('m_delete', $forum_id) || ($post_data['poster_id'] == $user->data['user_id'] && $auth->acl_get('f_delete', $forum_id))))
+ {
+ $is_authed = true;
+ }
+
+ // no break;
+
+ case 'soft_delete':
+ if (!$is_authed && $user->data['is_registered'] && $phpbb_content_visibility->can_soft_delete($forum_id, $post_data['poster_id'], $post_data['post_edit_locked']))
{
+ // Fall back to soft_delete if we have no permissions to delete posts but to soft delete them
$is_authed = true;
+ $mode = 'soft_delete';
}
break;
}
+/**
+* This event allows you to do extra auth checks and verify if the user
+* has the required permissions
+*
+* Extensions should only change the error and is_authed variables.
+*
+* @event core.modify_posting_auth
+* @var int post_id ID of the post
+* @var int topic_id ID of the topic
+* @var int forum_id ID of the forum
+* @var int draft_id ID of the draft
+* @var int lastclick Timestamp of when the form was last loaded
+* @var bool submit Whether or not the form has been submitted
+* @var bool preview Whether or not the post is being previewed
+* @var bool save Whether or not a draft is being saved
+* @var bool load Whether or not a draft is being loaded
+* @var bool refresh Whether or not to retain previously submitted data
+* @var string mode What action to take if the form has been submitted
+* post|reply|quote|edit|delete|bump|smilies|popup
+* @var array error Any error strings; a non-empty array aborts
+* form submission.
+* NOTE: Should be actual language strings, NOT
+* language keys.
+* @var bool is_authed Does the user have the required permissions?
+* @var array post_data All post data from database
+* @since 3.1.3-RC1
+* @changed 3.1.10-RC1 Added post_data
+*/
+$vars = array(
+ 'post_id',
+ 'topic_id',
+ 'forum_id',
+ 'draft_id',
+ 'lastclick',
+ 'submit',
+ 'preview',
+ 'save',
+ 'load',
+ 'refresh',
+ 'mode',
+ 'error',
+ 'is_authed',
+ 'post_data',
+);
+extract($phpbb_dispatcher->trigger_event('core.modify_posting_auth', compact($vars)));
-if (!$is_authed)
+if (!$is_authed || !empty($error))
{
- $check_auth = ($mode == 'quote') ? 'reply' : $mode;
+ $check_auth = ($mode == 'quote') ? 'reply' : (($mode == 'soft_delete') ? 'delete' : $mode);
if ($user->data['is_registered'])
{
- trigger_error('USER_CANNOT_' . strtoupper($check_auth));
+ trigger_error(empty($error) ? 'USER_CANNOT_' . strtoupper($check_auth) : implode('<br/>', $error));
}
+ $message = $user->lang['LOGIN_EXPLAIN_' . strtoupper($mode)];
- login_box('', $user->lang['LOGIN_EXPLAIN_' . strtoupper($mode)]);
+ if ($request->is_ajax())
+ {
+ $json = new phpbb\json_response();
+ $json->send(array(
+ 'title' => $user->lang['INFORMATION'],
+ 'message' => $message,
+ ));
+ }
+
+ login_box('', $message);
}
// Is the user able to post within this forum?
@@ -293,26 +426,60 @@ if (($post_data['forum_status'] == ITEM_LOCKED || (isset($post_data['topic_statu
// else it depends on editing times, lock status and if we're the correct user
if ($mode == 'edit' && !$auth->acl_get('m_edit', $forum_id))
{
- if ($user->data['user_id'] != $post_data['poster_id'])
- {
- trigger_error('USER_CANNOT_EDIT');
- }
-
- if (!($post_data['post_time'] > time() - ($config['edit_time'] * 60) || !$config['edit_time']))
- {
- trigger_error('CANNOT_EDIT_TIME');
- }
+ $force_edit_allowed = false;
+
+ $s_cannot_edit = $user->data['user_id'] != $post_data['poster_id'];
+ $s_cannot_edit_time = $config['edit_time'] && $post_data['post_time'] <= time() - ($config['edit_time'] * 60);
+ $s_cannot_edit_locked = $post_data['post_edit_locked'];
+
+ /**
+ * This event allows you to modify the conditions for the "cannot edit post" checks
+ *
+ * @event core.posting_modify_cannot_edit_conditions
+ * @var array post_data Array with post data
+ * @var bool force_edit_allowed Allow the user to edit the post (all permissions and conditions are ignored)
+ * @var bool s_cannot_edit User can not edit the post because it's not his
+ * @var bool s_cannot_edit_locked User can not edit the post because it's locked
+ * @var bool s_cannot_edit_time User can not edit the post because edit_time has passed
+ * @since 3.1.0-b4
+ */
+ $vars = array(
+ 'post_data',
+ 'force_edit_allowed',
+ 's_cannot_edit',
+ 's_cannot_edit_locked',
+ 's_cannot_edit_time',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.posting_modify_cannot_edit_conditions', compact($vars)));
- if ($post_data['post_edit_locked'])
+ if (!$force_edit_allowed)
{
- trigger_error('CANNOT_EDIT_POST_LOCKED');
+ if ($s_cannot_edit)
+ {
+ trigger_error('USER_CANNOT_EDIT');
+ }
+ else if ($s_cannot_edit_time)
+ {
+ trigger_error('CANNOT_EDIT_TIME');
+ }
+ else if ($s_cannot_edit_locked)
+ {
+ trigger_error('CANNOT_EDIT_POST_LOCKED');
+ }
}
}
// Handle delete mode...
-if ($mode == 'delete')
+if ($mode == 'delete' || $mode == 'soft_delete')
{
- handle_post_delete($forum_id, $topic_id, $post_id, $post_data);
+ if ($mode == 'soft_delete' && $post_data['post_visibility'] == ITEM_DELETED)
+ {
+ $user->setup('posting');
+ trigger_error('NO_POST');
+ }
+
+ $delete_reason = $request->variable('delete_reason', '', true);
+ phpbb_handle_post_delete($forum_id, $topic_id, $post_id, $post_data, ($mode == 'soft_delete' && !$request->is_set_post('delete_permanent')), $delete_reason);
return;
}
@@ -320,13 +487,17 @@ if ($mode == 'delete')
if ($mode == 'bump')
{
if ($bump_time = bump_topic_allowed($forum_id, $post_data['topic_bumped'], $post_data['topic_last_post_time'], $post_data['topic_poster'], $post_data['topic_last_poster_id'])
- && check_link_hash(request_var('hash', ''), "topic_{$post_data['topic_id']}"))
+ && check_link_hash(request_var('hash', ''), "topic_{$post_data['topic_id']}"))
{
$meta_url = phpbb_bump_topic($forum_id, $topic_id, $post_data, $current_time);
meta_refresh(3, $meta_url);
+ $message = $user->lang['TOPIC_BUMPED'];
- $message = $user->lang['TOPIC_BUMPED'] . '<br /><br />' . sprintf($user->lang['VIEW_MESSAGE'], '<a href="' . $meta_url . '">', '</a>');
- $message .= '<br /><br />' . sprintf($user->lang['RETURN_FORUM'], '<a href="' . append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_id) . '">', '</a>');
+ if (!$request->is_ajax())
+ {
+ $message .= '<br /><br />' . $user->lang('VIEW_MESSAGE', '<a href="' . $meta_url . '">', '</a>');
+ $message .= '<br /><br />' . $user->lang('RETURN_FORUM', '<a href="' . append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_id) . '">', '</a>');
+ }
trigger_error($message);
}
@@ -391,6 +562,10 @@ if ($mode == 'edit')
$orig_poll_options_size = sizeof($post_data['poll_options']);
$message_parser = new parse_message();
+$plupload = $phpbb_container->get('plupload');
+$mimetype_guesser = $phpbb_container->get('mimetype.guesser');
+$message_parser->set_plupload($plupload);
+$message_parser->set_mimetype_guesser($mimetype_guesser);
if (isset($post_data['post_text']))
{
@@ -417,12 +592,12 @@ $message_parser->get_submitted_attachment_data($post_data['poster_id']);
if ($post_data['post_attachment'] && !$submit && !$refresh && !$preview && $mode == 'edit')
{
// Do not change to SELECT *
- $sql = 'SELECT attach_id, is_orphan, attach_comment, real_filename
+ $sql = 'SELECT attach_id, is_orphan, attach_comment, real_filename, filesize
FROM ' . ATTACHMENTS_TABLE . "
WHERE post_msg_id = $post_id
AND in_message = 0
AND is_orphan = 0
- ORDER BY filetime DESC";
+ ORDER BY attach_id DESC";
$result = $db->sql_query($sql);
$message_parser->attachment_data = array_merge($message_parser->attachment_data, $db->sql_fetchrowset($result));
$db->sql_freeresult($result);
@@ -447,6 +622,11 @@ if ($mode != 'edit')
$post_data['enable_urls'] = true;
}
+if ($mode == 'post')
+{
+ $post_data['topic_status'] = ($request->is_set_post('lock_topic') && $auth->acl_gets('m_lock', 'f_user_lock', $forum_id)) ? ITEM_LOCKED : ITEM_UNLOCKED;
+}
+
$post_data['enable_magic_url'] = $post_data['drafts'] = false;
// User own some drafts?
@@ -636,7 +816,7 @@ if ($submit || $preview || $refresh)
$message_parser->message = utf8_normalize_nfc(request_var('message', '', true));
$post_data['username'] = utf8_normalize_nfc(request_var('username', $post_data['username'], true));
- $post_data['post_edit_reason'] = (!empty($_POST['edit_reason']) && $mode == 'edit' && $auth->acl_get('m_edit', $forum_id)) ? utf8_normalize_nfc(request_var('edit_reason', '', true)) : '';
+ $post_data['post_edit_reason'] = ($request->variable('edit_reason', false, false, \phpbb\request\request_interface::POST) && $mode == 'edit' && $auth->acl_get('m_edit', $forum_id)) ? utf8_normalize_nfc(request_var('edit_reason', '', true)) : '';
$post_data['orig_topic_type'] = $post_data['topic_type'];
$post_data['topic_type'] = request_var('topic_type', (($mode != 'post') ? (int) $post_data['topic_type'] : POST_NORMAL));
@@ -737,6 +917,46 @@ if ($submit || $preview || $refresh)
// Parse Attachments - before checksum is calculated
$message_parser->parse_attachments('fileupload', $mode, $forum_id, $submit, $preview, $refresh);
+ /**
+ * This event allows you to modify message text before parsing
+ *
+ * @event core.posting_modify_message_text
+ * @var array post_data Array with post data
+ * @var string mode What action to take if the form is submitted
+ * post|reply|quote|edit|delete|bump|smilies|popup
+ * @var int post_id ID of the post
+ * @var int topic_id ID of the topic
+ * @var int forum_id ID of the forum
+ * @var bool submit Whether or not the form has been submitted
+ * @var bool preview Whether or not the post is being previewed
+ * @var bool save Whether or not a draft is being saved
+ * @var bool load Whether or not a draft is being loaded
+ * @var bool cancel Whether or not to cancel the form (returns to
+ * viewtopic or viewforum depending on if the user
+ * is posting a new topic or editing a post)
+ * @var bool refresh Whether or not to retain previously submitted data
+ * @var object message_parser The message parser object
+ * @var array error Array of errors
+ * @since 3.1.2-RC1
+ * @changed 3.1.11-RC1 Added error
+ */
+ $vars = array(
+ 'post_data',
+ 'mode',
+ 'post_id',
+ 'topic_id',
+ 'forum_id',
+ 'submit',
+ 'preview',
+ 'save',
+ 'load',
+ 'cancel',
+ 'refresh',
+ 'message_parser',
+ 'error',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.posting_modify_message_text', compact($vars)));
+
// Grab md5 'checksum' of new message
$message_md5 = md5($message_parser->message);
@@ -754,8 +974,13 @@ if ($submit || $preview || $refresh)
// We make sure nobody else made exactly the same change
// we're about to submit by also checking $message_md5 != $post_data['post_checksum']
- if (($edit_post_message_checksum !== '' && $edit_post_message_checksum != $post_data['post_checksum'] && $message_md5 != $post_data['post_checksum'])
- || ($edit_post_subject_checksum !== '' && $edit_post_subject_checksum != $post_data['post_subject_md5'] && md5($post_data['post_subject']) != $post_data['post_subject_md5']))
+ if ($edit_post_message_checksum !== '' &&
+ $edit_post_message_checksum != $post_data['post_checksum'] &&
+ $message_md5 != $post_data['post_checksum']
+ ||
+ $edit_post_subject_checksum !== '' &&
+ $edit_post_subject_checksum != $post_data['post_subject_md5'] &&
+ md5($post_data['post_subject']) != $post_data['post_subject_md5'])
{
if (topic_review($topic_id, $forum_id, 'post_review_edit', $post_id))
{
@@ -787,10 +1012,13 @@ if ($submit || $preview || $refresh)
$message_parser->warn_msg = array();
}
- $message_parser->parse($post_data['enable_bbcode'], ($config['allow_post_links']) ? $post_data['enable_urls'] : false, $post_data['enable_smilies'], $img_status, $flash_status, $quote_status, $config['allow_post_links']);
+ if (!$preview || !empty($message_parser->message))
+ {
+ $message_parser->parse($post_data['enable_bbcode'], ($config['allow_post_links']) ? $post_data['enable_urls'] : false, $post_data['enable_smilies'], $img_status, $flash_status, $quote_status, $config['allow_post_links']);
+ }
// On a refresh we do not care about message parsing errors
- if (sizeof($message_parser->warn_msg) && $refresh)
+ if (sizeof($message_parser->warn_msg) && $refresh && !$preview)
{
$message_parser->warn_msg = array();
}
@@ -800,7 +1028,8 @@ if ($submit || $preview || $refresh)
$message_parser->bbcode_bitfield = $post_data['bbcode_bitfield'];
}
- if ($mode != 'edit' && !$preview && !$refresh && $config['flood_interval'] && !$auth->acl_get('f_ignoreflood', $forum_id))
+ $ignore_flood = $auth->acl_get('u_ignoreflood') ? true : $auth->acl_get('f_ignoreflood', $forum_id);
+ if ($mode != 'edit' && !$preview && !$refresh && $config['flood_interval'] && !$ignore_flood)
{
// Flood check
$last_post_time = 0;
@@ -832,7 +1061,10 @@ if ($submit || $preview || $refresh)
// Validate username
if (($post_data['username'] && !$user->data['is_registered']) || ($mode == 'edit' && $post_data['poster_id'] == ANONYMOUS && $post_data['username'] && $post_data['post_username'] && $post_data['post_username'] != $post_data['username']))
{
- include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
+ if (!function_exists('validate_username'))
+ {
+ include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
+ }
$user->add_lang('ucp');
@@ -844,7 +1076,7 @@ if ($submit || $preview || $refresh)
if (($result = validate_string($post_data['username'], false, $config['min_name_chars'], $config['max_name_chars'])) !== false)
{
$min_max_amount = ($result == 'TOO_SHORT') ? $config['min_name_chars'] : $config['max_name_chars'];
- $error[] = sprintf($user->lang['FIELD_' . $result], $user->lang['USERNAME'], $min_max_amount);
+ $error[] = $user->lang('FIELD_' . $result, $min_max_amount, $user->lang['USERNAME']);
}
}
@@ -868,12 +1100,33 @@ if ($submit || $preview || $refresh)
$error[] = $user->lang['FORM_INVALID'];
}
+ if ($submit && $mode == 'edit' && $post_data['post_visibility'] == ITEM_DELETED && !isset($_POST['soft_delete']) && $auth->acl_get('m_approve', $forum_id))
+ {
+ $is_first_post = ($post_id == $post_data['topic_first_post_id'] || !$post_data['topic_posts_approved']);
+ $is_last_post = ($post_id == $post_data['topic_last_post_id'] || !$post_data['topic_posts_approved']);
+ $updated_post_data = $phpbb_content_visibility->set_post_visibility(ITEM_APPROVED, $post_id, $post_data['topic_id'], $post_data['forum_id'], $user->data['user_id'], time(), '', $is_first_post, $is_last_post);
+
+ if (!empty($updated_post_data))
+ {
+ // Update the post_data, so we don't need to refetch it.
+ $post_data = array_merge($post_data, $updated_post_data);
+ }
+ }
+
// Parse subject
if (!$preview && !$refresh && utf8_clean_string($post_data['post_subject']) === '' && ($mode == 'post' || ($mode == 'edit' && $post_data['topic_first_post_id'] == $post_id)))
{
$error[] = $user->lang['EMPTY_SUBJECT'];
}
+ // Check for out-of-bounds characters that are currently
+ // not supported by utf8_bin in MySQL
+ if (preg_match_all('/[\x{10000}-\x{10FFFF}]/u', $post_data['post_subject'], $matches))
+ {
+ $character_list = implode('<br />', $matches[0]);
+ $error[] = $user->lang('UNSUPPORTED_CHARACTERS_SUBJECT', $character_list);
+ }
+
$post_data['poll_last_vote'] = (isset($post_data['poll_last_vote'])) ? $post_data['poll_last_vote'] : 0;
if ($post_data['poll_option_text'] &&
@@ -963,7 +1216,7 @@ if ($submit || $preview || $refresh)
break;
}
- if (!$auth->acl_get($auth_option, $forum_id))
+ if ($auth_option != '' && !$auth->acl_get($auth_option, $forum_id))
{
// There is a special case where a user edits his post whereby the topic type got changed by an admin/mod.
// Another case would be a mod not having sticky permissions for example but edit permissions.
@@ -993,63 +1246,40 @@ if ($submit || $preview || $refresh)
}
}
+ /**
+ * This event allows you to define errors before the post action is performed
+ *
+ * @event core.posting_modify_submission_errors
+ * @var array post_data Array with post data
+ * @var array poll Array with poll data from post (must be used instead of the post_data equivalent)
+ * @var string mode What action to take if the form is submitted
+ * post|reply|quote|edit|delete|bump|smilies|popup
+ * @var string page_title Title of the mode page
+ * @var int post_id ID of the post
+ * @var int topic_id ID of the topic
+ * @var int forum_id ID of the forum
+ * @var bool submit Whether or not the form has been submitted
+ * @var array error Any error strings; a non-empty array aborts form submission.
+ * NOTE: Should be actual language strings, NOT language keys.
+ * @since 3.1.0-RC5
+ * @changed 3.1.5-RC1 Added poll array to the event
+ */
+ $vars = array(
+ 'post_data',
+ 'poll',
+ 'mode',
+ 'page_title',
+ 'post_id',
+ 'topic_id',
+ 'forum_id',
+ 'submit',
+ 'error',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.posting_modify_submission_errors', compact($vars)));
+
// Store message, sync counters
if (!sizeof($error) && $submit)
{
- // Check if we want to de-globalize the topic... and ask for new forum
- if ($post_data['topic_type'] != POST_GLOBAL)
- {
- $sql = 'SELECT topic_type, forum_id
- FROM ' . TOPICS_TABLE . "
- WHERE topic_id = $topic_id";
- $result = $db->sql_query($sql);
- $row = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
-
- if ($row && !$row['forum_id'] && $row['topic_type'] == POST_GLOBAL)
- {
- $to_forum_id = request_var('to_forum_id', 0);
-
- if ($to_forum_id)
- {
- $sql = 'SELECT forum_type
- FROM ' . FORUMS_TABLE . '
- WHERE forum_id = ' . $to_forum_id;
- $result = $db->sql_query($sql);
- $forum_type = (int) $db->sql_fetchfield('forum_type');
- $db->sql_freeresult($result);
-
- if ($forum_type != FORUM_POST || !$auth->acl_get('f_post', $to_forum_id) || !$auth->acl_get('f_noapprove', $to_forum_id))
- {
- $to_forum_id = 0;
- }
- }
-
- if (!$to_forum_id)
- {
- include_once($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
-
- $template->assign_vars(array(
- 'S_FORUM_SELECT' => make_forum_select(false, false, false, true, true, true),
- 'S_UNGLOBALISE' => true)
- );
-
- $submit = false;
- $refresh = true;
- }
- else
- {
- if (!$auth->acl_get('f_post', $to_forum_id))
- {
- // This will only be triggered if the user tried to trick the forum.
- trigger_error('NOT_AUTHORISED');
- }
-
- $forum_id = $to_forum_id;
- }
- }
- }
-
if ($submit)
{
// Lock/Unlock Topic
@@ -1105,7 +1335,6 @@ if ($submit || $preview || $refresh)
'enable_urls' => (bool) $post_data['enable_urls'],
'enable_indexing' => (bool) $post_data['enable_indexing'],
'message_md5' => (string) $message_md5,
- 'post_time' => (isset($post_data['post_time'])) ? (int) $post_data['post_time'] : $current_time,
'post_checksum' => (isset($post_data['post_checksum'])) ? (string) $post_data['post_checksum'] : '',
'post_edit_reason' => $post_data['post_edit_reason'],
'post_edit_user' => ($mode == 'edit') ? $user->data['user_id'] : ((isset($post_data['post_edit_user'])) ? (int) $post_data['post_edit_user'] : 0),
@@ -1120,15 +1349,17 @@ if ($submit || $preview || $refresh)
'message' => $message_parser->message,
'attachment_data' => $message_parser->attachment_data,
'filename_data' => $message_parser->filename_data,
+ 'topic_status' => $post_data['topic_status'],
- 'topic_approved' => (isset($post_data['topic_approved'])) ? $post_data['topic_approved'] : false,
- 'post_approved' => (isset($post_data['post_approved'])) ? $post_data['post_approved'] : false,
+ 'topic_visibility' => (isset($post_data['topic_visibility'])) ? $post_data['topic_visibility'] : false,
+ 'post_visibility' => (isset($post_data['post_visibility'])) ? $post_data['post_visibility'] : false,
);
if ($mode == 'edit')
{
- $data['topic_replies_real'] = $post_data['topic_replies_real'];
- $data['topic_replies'] = $post_data['topic_replies'];
+ $data['topic_posts_approved'] = $post_data['topic_posts_approved'];
+ $data['topic_posts_unapproved'] = $post_data['topic_posts_unapproved'];
+ $data['topic_posts_softdeleted'] = $post_data['topic_posts_softdeleted'];
}
// Only return the username when it is either a guest posting or we are editing a post and
@@ -1137,14 +1368,94 @@ if ($submit || $preview || $refresh)
// post's poster, not the poster of the current post). See: PHPBB3-11769 for more information.
$post_author_name = ((!$user->data['is_registered'] || $mode == 'edit') && $post_data['username'] !== '') ? $post_data['username'] : '';
+ /**
+ * This event allows you to define errors before the post action is performed
+ *
+ * @event core.posting_modify_submit_post_before
+ * @var array post_data Array with post data
+ * @var array poll Array with poll data
+ * @var array data Array with post data going to be stored in the database
+ * @var string mode What action to take if the form is submitted
+ * post|reply|quote|edit|delete
+ * @var string page_title Title of the mode page
+ * @var int post_id ID of the post
+ * @var int topic_id ID of the topic
+ * @var int forum_id ID of the forum
+ * @var string post_author_name Author name for guest posts
+ * @var bool update_message Boolean if the post message was changed
+ * @var bool update_subject Boolean if the post subject was changed
+ * NOTE: Should be actual language strings, NOT language keys.
+ * @since 3.1.0-RC5
+ * @changed 3.1.6-RC1 remove submit and error from event Submit and Error are checked previously prior to running event
+ */
+ $vars = array(
+ 'post_data',
+ 'poll',
+ 'data',
+ 'mode',
+ 'page_title',
+ 'post_id',
+ 'topic_id',
+ 'forum_id',
+ 'post_author_name',
+ 'update_message',
+ 'update_subject',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.posting_modify_submit_post_before', compact($vars)));
+
// The last parameter tells submit_post if search indexer has to be run
$redirect_url = submit_post($mode, $post_data['post_subject'], $post_author_name, $post_data['topic_type'], $poll, $data, $update_message, ($update_message || $update_subject) ? true : false);
+ /**
+ * This event allows you to define errors after the post action is performed
+ *
+ * @event core.posting_modify_submit_post_after
+ * @var array post_data Array with post data
+ * @var array poll Array with poll data
+ * @var array data Array with post data going to be stored in the database
+ * @var string mode What action to take if the form is submitted
+ * post|reply|quote|edit|delete
+ * @var string page_title Title of the mode page
+ * @var int post_id ID of the post
+ * @var int topic_id ID of the topic
+ * @var int forum_id ID of the forum
+ * @var string post_author_name Author name for guest posts
+ * @var bool update_message Boolean if the post message was changed
+ * @var bool update_subject Boolean if the post subject was changed
+ * @var string redirect_url URL the user is going to be redirected to
+ * NOTE: Should be actual language strings, NOT language keys.
+ * @since 3.1.0-RC5
+ * @changed 3.1.6-RC1 remove submit and error from event Submit and Error are checked previously prior to running event
+ */
+ $vars = array(
+ 'post_data',
+ 'poll',
+ 'data',
+ 'mode',
+ 'page_title',
+ 'post_id',
+ 'topic_id',
+ 'forum_id',
+ 'post_author_name',
+ 'update_message',
+ 'update_subject',
+ 'redirect_url',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.posting_modify_submit_post_after', compact($vars)));
+
if ($config['enable_post_confirm'] && !$user->data['is_registered'] && (isset($captcha) && $captcha->is_solved() === true) && ($mode == 'post' || $mode == 'reply' || $mode == 'quote'))
{
$captcha->reset();
}
+ // Handle delete mode...
+ if ($request->is_set_post('delete') || $request->is_set_post('delete_permanent'))
+ {
+ $delete_reason = $request->variable('delete_reason', '', true);
+ phpbb_handle_post_delete($forum_id, $topic_id, $post_id, $post_data, !$request->is_set_post('delete_permanent'), $delete_reason);
+ return;
+ }
+
// Check the permissions for post approval.
// Moderators must go through post approval like ordinary users.
if ((!$auth->acl_get('f_noapprove', $data['forum_id']) && empty($data['force_approved_state'])) || (isset($data['force_approved_state']) && !$data['force_approved_state']))
@@ -1152,17 +1463,11 @@ if ($submit || $preview || $refresh)
meta_refresh(10, $redirect_url);
$message = ($mode == 'edit') ? $user->lang['POST_EDITED_MOD'] : $user->lang['POST_STORED_MOD'];
$message .= (($user->data['user_id'] == ANONYMOUS) ? '' : ' '. $user->lang['POST_APPROVAL_NOTIFY']);
- }
- else
- {
- meta_refresh(3, $redirect_url);
-
- $message = ($mode == 'edit') ? 'POST_EDITED' : 'POST_STORED';
- $message = $user->lang[$message] . '<br /><br />' . sprintf($user->lang['VIEW_MESSAGE'], '<a href="' . $redirect_url . '">', '</a>');
+ $message .= '<br /><br />' . sprintf($user->lang['RETURN_FORUM'], '<a href="' . append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $data['forum_id']) . '">', '</a>');
+ trigger_error($message);
}
- $message .= '<br /><br />' . sprintf($user->lang['RETURN_FORUM'], '<a href="' . append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $data['forum_id']) . '">', '</a>');
- trigger_error($message);
+ redirect($redirect_url);
}
}
}
@@ -1219,8 +1524,8 @@ if (!sizeof($error) && $preview)
'POLL_QUESTION' => $parse_poll->message,
'L_POLL_LENGTH' => ($post_data['poll_length']) ? sprintf($user->lang['POLL_RUN_TILL'], $user->format_date($poll_end)) : '',
- 'L_MAX_VOTES' => ($post_data['poll_max_options'] == 1) ? $user->lang['MAX_OPTION_SELECT'] : sprintf($user->lang['MAX_OPTIONS_SELECT'], $post_data['poll_max_options']))
- );
+ 'L_MAX_VOTES' => $user->lang('MAX_OPTIONS_SELECT', (int) $post_data['poll_max_options']),
+ ));
$preview_poll_options = array();
foreach ($post_data['poll_options'] as $poll_option)
@@ -1267,17 +1572,30 @@ if (!sizeof($error) && $preview)
'PREVIEW_MESSAGE' => $preview_message,
'PREVIEW_SIGNATURE' => $preview_signature,
- 'S_DISPLAY_PREVIEW' => true)
- );
+ 'S_DISPLAY_PREVIEW' => !empty($preview_message),
+ ));
}
}
+// Remove quotes that would become nested too deep before decoding the text
+$generate_quote = ($mode == 'quote' && !$submit && !$preview && !$refresh);
+if ($generate_quote && $config['max_quote_depth'] > 0)
+{
+ $tmp_bbcode_uid = $message_parser->bbcode_uid;
+ $message_parser->bbcode_uid = $post_data['bbcode_uid'];
+ $message_parser->remove_nested_quotes($config['max_quote_depth'] - 1);
+ $message_parser->bbcode_uid = $tmp_bbcode_uid;
+}
+
// Decode text for message display
$post_data['bbcode_uid'] = ($mode == 'quote' && !$preview && !$refresh && !sizeof($error)) ? $post_data['bbcode_uid'] : $message_parser->bbcode_uid;
$message_parser->decode_message($post_data['bbcode_uid']);
-if ($mode == 'quote' && !$submit && !$preview && !$refresh)
+if ($generate_quote)
{
+ // Remove attachment bbcode tags from the quoted message to avoid mixing with the new post attachments if any
+ $message_parser->message = preg_replace('#\[attachment=([0-9]+)\](.*?)\[\/attachment\]#uis', '\\2', $message_parser->message);
+
if ($config['allow_bbcode'])
{
$message_parser->message = '[quote=&quot;' . $post_data['quote_username'] . '&quot;]' . censor_text(trim($message_parser->message)) . "[/quote]\n";
@@ -1422,16 +1740,17 @@ $form_enctype = (@ini_get('file_uploads') == '0' || strtolower(@ini_get('file_up
add_form_key('posting');
-// Start assigning vars for main posting page ...
-$template->assign_vars(array(
+// Build array of variables for main posting page
+$page_data = array(
'L_POST_A' => $page_title,
'L_ICON' => ($mode == 'reply' || $mode == 'quote' || ($mode == 'edit' && $post_id != $post_data['topic_first_post_id'])) ? $user->lang['POST_ICON'] : $user->lang['TOPIC_ICON'],
- 'L_MESSAGE_BODY_EXPLAIN' => (intval($config['max_post_chars'])) ? sprintf($user->lang['MESSAGE_BODY_EXPLAIN'], intval($config['max_post_chars'])) : '',
+ 'L_MESSAGE_BODY_EXPLAIN' => $user->lang('MESSAGE_BODY_EXPLAIN', (int) $config['max_post_chars']),
+ 'L_DELETE_POST_PERMANENTLY' => $user->lang('DELETE_POST_PERMANENTLY', 1),
'FORUM_NAME' => $post_data['forum_name'],
'FORUM_DESC' => ($post_data['forum_desc']) ? generate_text_for_display($post_data['forum_desc'], $post_data['forum_desc_uid'], $post_data['forum_desc_bitfield'], $post_data['forum_desc_options']) : '',
'TOPIC_TITLE' => censor_text($post_data['topic_title']),
- 'MODERATORS' => (sizeof($moderators)) ? implode(', ', $moderators[$forum_id]) : '',
+ 'MODERATORS' => (sizeof($moderators)) ? implode($user->lang['COMMA_SEPARATOR'], $moderators[$forum_id]) : '',
'USERNAME' => ((!$preview && $mode != 'quote') || $preview) ? $post_data['username'] : '',
'SUBJECT' => $post_data['post_subject'],
'MESSAGE' => $post_data['post_text'],
@@ -1445,7 +1764,8 @@ $template->assign_vars(array(
'POST_DATE' => ($post_data['post_time']) ? $user->format_date($post_data['post_time']) : '',
'ERROR' => (sizeof($error)) ? implode('<br />', $error) : '',
'TOPIC_TIME_LIMIT' => (int) $post_data['topic_time_limit'],
- 'EDIT_REASON' => $post_data['post_edit_reason'],
+ 'EDIT_REASON' => $request->variable('edit_reason', '', true),
+ 'SHOW_PANEL' => $request->variable('show_panel', ''),
'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", "f=$forum_id"),
'U_VIEW_TOPIC' => ($mode != 'post') ? append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&amp;t=$topic_id") : '',
'U_PROGRESS_BAR' => append_sid("{$phpbb_root_path}posting.$phpEx", "f=$forum_id&amp;mode=popup"),
@@ -1466,10 +1786,14 @@ $template->assign_vars(array(
'S_SIGNATURE_CHECKED' => ($sig_checked) ? ' checked="checked"' : '',
'S_NOTIFY_ALLOWED' => (!$user->data['is_registered'] || ($mode == 'edit' && $user->data['user_id'] != $post_data['poster_id']) || !$config['allow_topic_notify'] || !$config['email_enable']) ? false : true,
'S_NOTIFY_CHECKED' => ($notify_checked) ? ' checked="checked"' : '',
- 'S_LOCK_TOPIC_ALLOWED' => (($mode == 'edit' || $mode == 'reply' || $mode == 'quote') && ($auth->acl_get('m_lock', $forum_id) || ($auth->acl_get('f_user_lock', $forum_id) && $user->data['is_registered'] && !empty($post_data['topic_poster']) && $user->data['user_id'] == $post_data['topic_poster'] && $post_data['topic_status'] == ITEM_UNLOCKED))) ? true : false,
+ 'S_LOCK_TOPIC_ALLOWED' => (($mode == 'edit' || $mode == 'reply' || $mode == 'quote' || $mode == 'post') && ($auth->acl_get('m_lock', $forum_id) || ($auth->acl_get('f_user_lock', $forum_id) && $user->data['is_registered'] && !empty($post_data['topic_poster']) && $user->data['user_id'] == $post_data['topic_poster'] && $post_data['topic_status'] == ITEM_UNLOCKED))) ? true : false,
'S_LOCK_TOPIC_CHECKED' => ($lock_topic_checked) ? ' checked="checked"' : '',
'S_LOCK_POST_ALLOWED' => ($mode == 'edit' && $auth->acl_get('m_edit', $forum_id)) ? true : false,
'S_LOCK_POST_CHECKED' => ($lock_post_checked) ? ' checked="checked"' : '',
+ 'S_SOFTDELETE_CHECKED' => ($mode == 'edit' && $post_data['post_visibility'] == ITEM_DELETED) ? ' checked="checked"' : '',
+ 'S_SOFTDELETE_ALLOWED' => ($mode == 'edit' && $phpbb_content_visibility->can_soft_delete($forum_id, $post_data['poster_id'], $lock_post_checked)) ? true : false,
+ 'S_RESTORE_ALLOWED' => $auth->acl_get('m_approve', $forum_id),
+ 'S_IS_DELETED' => ($mode == 'edit' && $post_data['post_visibility'] == ITEM_DELETED) ? true : false,
'S_LINKS_ALLOWED' => $url_status,
'S_MAGIC_URL_CHECKED' => ($urls_checked) ? ' checked="checked"' : '',
'S_TYPE_TOGGLE' => $topic_type_toggle,
@@ -1483,7 +1807,9 @@ $template->assign_vars(array(
'S_BBCODE_QUOTE' => $quote_status,
'S_POST_ACTION' => $s_action,
- 'S_HIDDEN_FIELDS' => $s_hidden_fields)
+ 'S_HIDDEN_FIELDS' => $s_hidden_fields,
+ 'S_ATTACH_DATA' => json_encode($message_parser->attachment_data),
+ 'S_IN_POSTING' => true,
);
// Build custom bbcodes array
@@ -1493,30 +1819,107 @@ display_custom_bbcodes();
if (($mode == 'post' || ($mode == 'edit' && $post_id == $post_data['topic_first_post_id']/* && (!$post_data['poll_last_vote'] || $auth->acl_get('m_edit', $forum_id))*/))
&& $auth->acl_get('f_poll', $forum_id))
{
- $template->assign_vars(array(
+ $page_data = array_merge($page_data, array(
'S_SHOW_POLL_BOX' => true,
'S_POLL_VOTE_CHANGE' => ($auth->acl_get('f_votechg', $forum_id) && $auth->acl_get('f_vote', $forum_id)),
'S_POLL_DELETE' => ($mode == 'edit' && sizeof($post_data['poll_options']) && ((!$post_data['poll_last_vote'] && $post_data['poster_id'] == $user->data['user_id'] && $auth->acl_get('f_delete', $forum_id)) || $auth->acl_get('m_delete', $forum_id))),
'S_POLL_DELETE_CHECKED' => (!empty($poll_delete)) ? true : false,
- 'L_POLL_OPTIONS_EXPLAIN' => sprintf($user->lang['POLL_OPTIONS_' . (($mode == 'edit') ? 'EDIT_' : '') . 'EXPLAIN'], $config['max_poll_options']),
+ 'L_POLL_OPTIONS_EXPLAIN' => $user->lang('POLL_OPTIONS_' . (($mode == 'edit') ? 'EDIT_' : '') . 'EXPLAIN', (int) $config['max_poll_options']),
'VOTE_CHANGE_CHECKED' => (!empty($post_data['poll_vote_change'])) ? ' checked="checked"' : '',
'POLL_TITLE' => (isset($post_data['poll_title'])) ? $post_data['poll_title'] : '',
'POLL_OPTIONS' => (!empty($post_data['poll_options'])) ? implode("\n", $post_data['poll_options']) : '',
'POLL_MAX_OPTIONS' => (isset($post_data['poll_max_options'])) ? (int) $post_data['poll_max_options'] : 1,
- 'POLL_LENGTH' => $post_data['poll_length'])
+ 'POLL_LENGTH' => $post_data['poll_length'],
+ )
);
}
+/**
+* This event allows you to modify template variables for the posting screen
+*
+* @event core.posting_modify_template_vars
+* @var array post_data Array with post data
+* @var array moderators Array with forum moderators
+* @var string mode What action to take if the form is submitted
+* post|reply|quote|edit|delete|bump|smilies|popup
+* @var string page_title Title of the mode page
+* @var bool s_topic_icons Whether or not to show the topic icons
+* @var string form_enctype If attachments are allowed for this form
+* "multipart/form-data" or empty string
+* @var string s_action The URL to submit the POST data to
+* @var string s_hidden_fields Concatenated hidden input tags of posting form
+* @var int post_id ID of the post
+* @var int topic_id ID of the topic
+* @var int forum_id ID of the forum
+* @var int draft_id ID of the draft
+* @var bool submit Whether or not the form has been submitted
+* @var bool preview Whether or not the post is being previewed
+* @var bool save Whether or not a draft is being saved
+* @var bool load Whether or not a draft is being loaded
+* @var bool cancel Whether or not to cancel the form (returns to
+* viewtopic or viewforum depending on if the user
+* is posting a new topic or editing a post)
+* @var array error Any error strings; a non-empty array aborts
+* form submission.
+* NOTE: Should be actual language strings, NOT
+* language keys.
+* @var bool refresh Whether or not to retain previously submitted data
+* @var array page_data Posting page data that should be passed to the
+* posting page via $template->assign_vars()
+* @var object message_parser The message parser object
+* @since 3.1.0-a1
+* @changed 3.1.0-b3 Added vars post_data, moderators, mode, page_title,
+* s_topic_icons, form_enctype, s_action, s_hidden_fields,
+* post_id, topic_id, forum_id, submit, preview, save, load,
+* delete, cancel, refresh, error, page_data, message_parser
+* @changed 3.1.2-RC1 Removed 'delete' var as it does not exist
+* @changed 3.1.5-RC1 Added poll variables to the page_data array
+* @changed 3.1.6-RC1 Added 'draft_id' var
+*/
+$vars = array(
+ 'post_data',
+ 'moderators',
+ 'mode',
+ 'page_title',
+ 's_topic_icons',
+ 'form_enctype',
+ 's_action',
+ 's_hidden_fields',
+ 'post_id',
+ 'topic_id',
+ 'forum_id',
+ 'draft_id',
+ 'submit',
+ 'preview',
+ 'save',
+ 'load',
+ 'cancel',
+ 'refresh',
+ 'error',
+ 'page_data',
+ 'message_parser',
+);
+extract($phpbb_dispatcher->trigger_event('core.posting_modify_template_vars', compact($vars)));
+
+// Start assigning vars for main posting page ...
+$template->assign_vars($page_data);
+
// Show attachment box for adding attachments if true
$allowed = ($auth->acl_get('f_attach', $forum_id) && $auth->acl_get('u_attach') && $config['allow_attachments'] && $form_enctype);
+if ($allowed)
+{
+ $max_files = ($auth->acl_get('a_') || $auth->acl_get('m_', $forum_id)) ? 0 : (int) $config['max_attachments'];
+ $plupload->configure($cache, $template, $s_action, $forum_id, $max_files);
+}
+
// Attachment entry
posting_gen_attachment_entry($attachment_data, $filename_data, $allowed);
// Output page ...
-page_header($page_title, false);
+page_header($page_title);
$template->set_filenames(array(
'body' => 'posting_body.html')
@@ -1534,104 +1937,3 @@ if ($mode == 'reply' || $mode == 'quote')
}
page_footer();
-
-/**
-* Show upload popup (progress bar)
-*/
-function upload_popup($forum_style = 0)
-{
- global $template, $user;
-
- ($forum_style) ? $user->setup('posting', $forum_style) : $user->setup('posting');
-
- page_header($user->lang['PROGRESS_BAR'], false);
-
- $template->set_filenames(array(
- 'popup' => 'posting_progress_bar.html')
- );
-
- $template->assign_vars(array(
- 'PROGRESS_BAR' => $user->img('upload_bar', $user->lang['UPLOAD_IN_PROGRESS']))
- );
-
- $template->display('popup');
-
- garbage_collection();
- exit_handler();
-}
-
-/**
-* Do the various checks required for removing posts as well as removing it
-*/
-function handle_post_delete($forum_id, $topic_id, $post_id, &$post_data)
-{
- global $user, $db, $auth, $config;
- global $phpbb_root_path, $phpEx;
-
- // If moderator removing post or user itself removing post, present a confirmation screen
- if ($auth->acl_get('m_delete', $forum_id) || ($post_data['poster_id'] == $user->data['user_id'] && $user->data['is_registered'] && $auth->acl_get('f_delete', $forum_id) && $post_id == $post_data['topic_last_post_id'] && !$post_data['post_edit_locked'] && ($post_data['post_time'] > time() - ($config['delete_time'] * 60) || !$config['delete_time'])))
- {
- $s_hidden_fields = build_hidden_fields(array(
- 'p' => $post_id,
- 'f' => $forum_id,
- 'mode' => 'delete')
- );
-
- if (confirm_box(true))
- {
- $data = array(
- 'topic_first_post_id' => $post_data['topic_first_post_id'],
- 'topic_last_post_id' => $post_data['topic_last_post_id'],
- 'topic_replies_real' => $post_data['topic_replies_real'],
- 'topic_approved' => $post_data['topic_approved'],
- 'topic_type' => $post_data['topic_type'],
- 'post_approved' => $post_data['post_approved'],
- 'post_reported' => $post_data['post_reported'],
- 'post_time' => $post_data['post_time'],
- 'poster_id' => $post_data['poster_id'],
- 'post_postcount' => $post_data['post_postcount']
- );
-
- $next_post_id = delete_post($forum_id, $topic_id, $post_id, $data);
- $post_username = ($post_data['poster_id'] == ANONYMOUS && !empty($post_data['post_username'])) ? $post_data['post_username'] : $post_data['username'];
-
- if ($next_post_id === false)
- {
- add_log('mod', $forum_id, $topic_id, 'LOG_DELETE_TOPIC', $post_data['topic_title'], $post_username);
-
- $meta_info = append_sid("{$phpbb_root_path}viewforum.$phpEx", "f=$forum_id");
- $message = $user->lang['POST_DELETED'];
- }
- else
- {
- add_log('mod', $forum_id, $topic_id, 'LOG_DELETE_POST', $post_data['post_subject'], $post_username);
-
- $meta_info = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&amp;t=$topic_id&amp;p=$next_post_id") . "#p$next_post_id";
- $message = $user->lang['POST_DELETED'] . '<br /><br />' . sprintf($user->lang['RETURN_TOPIC'], '<a href="' . $meta_info . '">', '</a>');
- }
-
- meta_refresh(3, $meta_info);
- $message .= '<br /><br />' . sprintf($user->lang['RETURN_FORUM'], '<a href="' . append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_id) . '">', '</a>');
- trigger_error($message);
- }
- else
- {
- confirm_box(false, 'DELETE_POST', $s_hidden_fields);
- }
- }
-
- // If we are here the user is not able to delete - present the correct error message
- if ($post_data['poster_id'] != $user->data['user_id'] && $auth->acl_get('f_delete', $forum_id))
- {
- trigger_error('DELETE_OWN_POSTS');
- }
-
- if ($post_data['poster_id'] == $user->data['user_id'] && $auth->acl_get('f_delete', $forum_id) && $post_id != $post_data['topic_last_post_id'])
- {
- trigger_error('CANNOT_DELETE_REPLIED');
- }
-
- trigger_error('USER_CANNOT_DELETE');
-}
-
-?> \ No newline at end of file
diff --git a/phpBB/report.php b/phpBB/report.php
index c909b4fcf3..3ea6bb40c5 100644
--- a/phpBB/report.php
+++ b/phpBB/report.php
@@ -1,10 +1,13 @@
<?php
/**
*
-* @package phpBB3
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -72,8 +75,14 @@ if ($post_id)
trigger_error('POST_NOT_EXIST');
}
- $forum_id = (int) ($report_data['forum_id']) ? $report_data['forum_id'] : $forum_id;
- $topic_id = (int) $report_data['topic_id'];
+ $forum_id = (int) $report_data['forum_id'];
+ $topic_id = (int) $report_data['topic_id'];
+ $reported_post_text = $report_data['post_text'];
+ $reported_post_bitfield = $report_data['bbcode_bitfield'];
+ $reported_post_uid = $report_data['bbcode_uid'];
+ $reported_post_enable_bbcode = $report_data['enable_bbcode'];
+ $reported_post_enable_smilies = $report_data['enable_smilies'];
+ $reported_post_enable_magic_url = $report_data['enable_magic_url'];
$sql = 'SELECT *
FROM ' . FORUMS_TABLE . '
@@ -90,6 +99,24 @@ if ($post_id)
// Check required permissions
$acl_check_ary = array('f_list' => 'POST_NOT_EXIST', 'f_read' => 'USER_CANNOT_READ', 'f_report' => 'USER_CANNOT_REPORT');
+ /**
+ * This event allows you to do extra auth checks and verify if the user
+ * has the required permissions
+ *
+ * @event core.report_post_auth
+ * @var array forum_data All data available from the forums table on this post's forum
+ * @var array report_data All data available from the topics and the posts tables on this post (and its topic)
+ * @var array acl_check_ary An array with the ACL to be tested. The evaluation is made in the same order as the array is sorted
+ * The key is the ACL name and the value is the language key for the error message.
+ * @since 3.1.3-RC1
+ */
+ $vars = array(
+ 'forum_data',
+ 'report_data',
+ 'acl_check_ary',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.report_post_auth', compact($vars)));
+
foreach ($acl_check_ary as $acl => $error)
{
if (!$auth->acl_get($acl, $forum_id))
@@ -131,12 +158,18 @@ else
$message .= '<br /><br />' . sprintf($user->lang['RETURN_PM'], '<a href="' . $redirect_url . '">', '</a>');
trigger_error($message);
}
+
+ $reported_post_text = $report_data['message_text'];
+ $reported_post_bitfield = $report_data['bbcode_bitfield'];
+ $reported_post_uid = $report_data['bbcode_uid'];
+ $reported_post_enable_bbcode = $report_data['enable_bbcode'];
+ $reported_post_enable_smilies = $report_data['enable_smilies'];
+ $reported_post_enable_magic_url = $report_data['enable_magic_url'];
}
if ($config['enable_post_confirm'] && !$user->data['is_registered'])
{
- include($phpbb_root_path . 'includes/captcha/captcha_factory.' . $phpEx);
- $captcha =& phpbb_captcha_factory::get_instance($config['captcha_plugin']);
+ $captcha = $phpbb_container->get('captcha.factory')->get_instance($config['captcha_plugin']);
$captcha->init(CONFIRM_REPORT);
}
@@ -175,20 +208,28 @@ if ($submit && $reason_id)
}
$sql_ary = array(
- 'reason_id' => (int) $reason_id,
- 'post_id' => $post_id,
- 'pm_id' => $pm_id,
- 'user_id' => (int) $user->data['user_id'],
- 'user_notify' => (int) $user_notify,
- 'report_closed' => 0,
- 'report_time' => (int) time(),
- 'report_text' => (string) $report_text
+ 'reason_id' => (int) $reason_id,
+ 'post_id' => $post_id,
+ 'pm_id' => $pm_id,
+ 'user_id' => (int) $user->data['user_id'],
+ 'user_notify' => (int) $user_notify,
+ 'report_closed' => 0,
+ 'report_time' => (int) time(),
+ 'report_text' => (string) $report_text,
+ 'reported_post_text' => $reported_post_text,
+ 'reported_post_uid' => $reported_post_uid,
+ 'reported_post_bitfield' => $reported_post_bitfield,
+ 'reported_post_enable_bbcode' => $reported_post_enable_bbcode,
+ 'reported_post_enable_smilies' => $reported_post_enable_smilies,
+ 'reported_post_enable_magic_url' => $reported_post_enable_magic_url,
);
$sql = 'INSERT INTO ' . REPORTS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary);
$db->sql_query($sql);
$report_id = $db->sql_nextid();
+ $phpbb_notifications = $phpbb_container->get('notification_manager');
+
if ($post_id)
{
$sql = 'UPDATE ' . POSTS_TABLE . '
@@ -207,6 +248,10 @@ if ($submit && $reason_id)
$lang_return = $user->lang['RETURN_TOPIC'];
$lang_success = $user->lang['POST_REPORTED_SUCCESS'];
+
+ $phpbb_notifications->add_notifications('notification.type.report_post', array_merge($report_data, $row, $forum_data, array(
+ 'report_text' => $report_text,
+ )));
}
else
{
@@ -233,6 +278,12 @@ if ($submit && $reason_id)
$lang_return = $user->lang['RETURN_PM'];
$lang_success = $user->lang['PM_REPORTED_SUCCESS'];
+
+ $phpbb_notifications->add_notifications('notification.type.report_pm', array_merge($report_data, $row, array(
+ 'report_text' => $report_text,
+ 'from_user_id' => $report_data['author_id'],
+ 'report_id' => $report_id,
+ )));
}
meta_refresh(3, $redirect_url);
@@ -271,8 +322,9 @@ $template->assign_vars(array(
'S_HIDDEN_FIELDS' => (sizeof($s_hidden_fields)) ? $s_hidden_fields : null,
'S_NOTIFY' => $user_notify,
- 'S_CAN_NOTIFY' => ($user->data['is_registered']) ? true : false)
-);
+ 'S_CAN_NOTIFY' => ($user->data['is_registered']) ? true : false,
+ 'S_IN_REPORT' => true,
+));
generate_forum_nav($forum_data);
@@ -284,5 +336,3 @@ $template->set_filenames(array(
);
page_footer();
-
-?> \ No newline at end of file
diff --git a/phpBB/search.php b/phpBB/search.php
index ea3d60c4f9..27ec8e4dab 100644
--- a/phpBB/search.php
+++ b/phpBB/search.php
@@ -1,10 +1,13 @@
<?php
/**
*
-* @package phpBB3
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -47,15 +50,7 @@ $sort_dir = request_var('sd', 'd');
$return_chars = request_var('ch', ($topic_id) ? -1 : 300);
$search_forum = request_var('fid', array(0));
-// <---Start "U_MARK_FORUMS"--->
-$template->assign_vars(
- array(
- 'U_MARK_FORUMS' => ($user->data['is_registered'] || $config['load_anon_lastread']) ? append_sid("{$phpbb_root_path}index.$phpEx", 'hash=' . generate_link_hash('global') . '&amp;mark=forums') : '')
- );
-// <---End--->
-
-
-// We put login boxes for the case if search_id is egosearch or unreadposts
+// We put login boxes for the case if search_id is newposts, egosearch or unreadposts
// because a guest should be able to log in even if guests search is not permitted
switch ($search_id)
@@ -81,7 +76,7 @@ switch ($search_id)
login_box('', $user->lang['LOGIN_EXPLAIN_UNREADSEARCH']);
}
break;
-
+
// The "new posts" search uses user_lastvisit which is user based, so it should require user to log in.
case 'newposts':
if ($user->data['user_id'] == ANONYMOUS)
@@ -89,7 +84,7 @@ switch ($search_id)
login_box('', $user->lang['LOGIN_EXPLAIN_NEWPOSTS']);
}
break;
-
+
default:
// There's nothing to do here for now ;)
break;
@@ -106,7 +101,7 @@ if (!$auth->acl_get('u_search') || !$auth->acl_getf_global('f_search') || !$conf
if ($user->load && $config['limit_search_load'] && ($user->load > doubleval($config['limit_search_load'])))
{
$template->assign_var('S_NO_SEARCH', true);
- trigger_error('NO_SEARCH_TIME');
+ trigger_error('NO_SEARCH_LOAD');
}
// It is applicable if the configuration setting is non-zero, and the user cannot
@@ -117,7 +112,7 @@ if ($interval && !in_array($search_id, array('unreadposts', 'unanswered', 'activ
if ($user->data['user_last_search'] > time() - $interval)
{
$template->assign_var('S_NO_SEARCH', true);
- trigger_error('NO_SEARCH_TIME');
+ trigger_error($user->lang('NO_SEARCH_TIME', (int) ($user->data['user_last_search'] + $interval - time())));
}
}
@@ -128,6 +123,29 @@ $sort_by_text = array('a' => $user->lang['SORT_AUTHOR'], 't' => $user->lang['SOR
$s_limit_days = $s_sort_key = $s_sort_dir = $u_sort_param = '';
gen_sort_selects($limit_days, $sort_by_text, $sort_days, $sort_key, $sort_dir, $s_limit_days, $s_sort_key, $s_sort_dir, $u_sort_param);
+$phpbb_content_visibility = $phpbb_container->get('content.visibility');
+$pagination = $phpbb_container->get('pagination');
+
+/**
+* This event allows you to alter the above parameters, such as keywords and submit
+*
+* @event core.search_modify_submit_parameters
+* @var string keywords The search keywords
+* @var string author Specifies the author match, when ANONYMOUS is also a search-match
+* @var int author_id ID of the author to search by
+* @var string search_id Predefined search type name
+* @var bool submit Whether or not the form has been submitted
+* @since 3.1.10-RC1
+*/
+$vars = array(
+ 'keywords',
+ 'author',
+ 'author_id',
+ 'search_id',
+ 'submit',
+);
+extract($phpbb_dispatcher->trigger_event('core.search_modify_submit_parameters', compact($vars)));
+
if ($keywords || $author || $author_id || $search_id || $submit)
{
// clear arrays
@@ -144,10 +162,10 @@ if ($keywords || $author || $author_id || $search_id || $submit)
{
if ((strpos($author, '*') !== false) && (utf8_strlen(str_replace(array('*', '%'), '', $author)) < $config['min_search_author_chars']))
{
- trigger_error(sprintf($user->lang['TOO_FEW_AUTHOR_CHARS'], $config['min_search_author_chars']));
+ trigger_error($user->lang('TOO_FEW_AUTHOR_CHARS', (int) $config['min_search_author_chars']));
}
- $sql_where = (strpos($author, '*') !== false) ? ' username_clean ' . $db->sql_like_expression(str_replace('*', $db->any_char, utf8_clean_string($author))) : " username_clean = '" . $db->sql_escape(utf8_clean_string($author)) . "'";
+ $sql_where = (strpos($author, '*') !== false) ? ' username_clean ' . $db->sql_like_expression(str_replace('*', $db->get_any_char(), utf8_clean_string($author))) : " username_clean = '" . $db->sql_escape(utf8_clean_string($author)) . "'";
$sql = 'SELECT user_id
FROM ' . USERS_TABLE . "
@@ -161,7 +179,7 @@ if ($keywords || $author || $author_id || $search_id || $submit)
}
$db->sql_freeresult($result);
- $sql_where = (strpos($author, '*') !== false) ? ' post_username ' . $db->sql_like_expression(str_replace('*', $db->any_char, utf8_clean_string($author))) : " post_username = '" . $db->sql_escape(utf8_clean_string($author)) . "'";
+ $sql_where = (strpos($author, '*') !== false) ? ' post_username ' . $db->sql_like_expression(str_replace('*', $db->get_any_char(), utf8_clean_string($author))) : " post_username = '" . $db->sql_escape(utf8_clean_string($author)) . "'";
$sql = 'SELECT 1 as guest_post
FROM ' . POSTS_TABLE . "
@@ -174,7 +192,7 @@ if ($keywords || $author || $author_id || $search_id || $submit)
if ($found_guest_post)
{
$author_id_ary[] = ANONYMOUS;
- $sql_author_match = (strpos($author, '*') !== false) ? ' ' . $db->sql_like_expression(str_replace('*', $db->any_char, utf8_clean_string($author))) : " = '" . $db->sql_escape(utf8_clean_string($author)) . "'";
+ $sql_author_match = (strpos($author, '*') !== false) ? ' ' . $db->sql_like_expression(str_replace('*', $db->get_any_char(), utf8_clean_string($author))) : " = '" . $db->sql_escape(utf8_clean_string($author)) . "'";
}
if (!sizeof($author_id_ary))
@@ -258,22 +276,9 @@ if ($keywords || $author || $author_id || $search_id || $submit)
}
$db->sql_freeresult($result);
- // find out in which forums the user is allowed to view approved posts
- if ($auth->acl_get('m_approve'))
- {
- $m_approve_fid_ary = array(-1);
- $m_approve_fid_sql = '';
- }
- else if ($auth->acl_getf_global('m_approve'))
- {
- $m_approve_fid_ary = array_diff(array_keys($auth->acl_getf('!m_approve', true)), $ex_fid_ary);
- $m_approve_fid_sql = ' AND (p.post_approved = 1' . ((sizeof($m_approve_fid_ary)) ? ' OR ' . $db->sql_in_set('p.forum_id', $m_approve_fid_ary, true) : '') . ')';
- }
- else
- {
- $m_approve_fid_ary = array();
- $m_approve_fid_sql = ' AND p.post_approved = 1';
- }
+ // find out in which forums the user is allowed to view posts
+ $m_approve_posts_fid_sql = $phpbb_content_visibility->get_global_visibility_sql('post', $ex_fid_ary, 'p.');
+ $m_approve_topics_fid_sql = $phpbb_content_visibility->get_global_visibility_sql('topic', $ex_fid_ary, 't.');
if ($reset_search_forum)
{
@@ -281,18 +286,15 @@ if ($keywords || $author || $author_id || $search_id || $submit)
}
// Select which method we'll use to obtain the post_id or topic_id information
- $search_type = basename($config['search_type']);
+ $search_type = $config['search_type'];
- if (!file_exists($phpbb_root_path . 'includes/search/' . $search_type . '.' . $phpEx))
+ if (!class_exists($search_type))
{
trigger_error('NO_SUCH_SEARCH_MODULE');
}
-
- require("{$phpbb_root_path}includes/search/$search_type.$phpEx");
-
// We do some additional checks in the module to ensure it can actually be utilised
$error = false;
- $search = new $search_type($error);
+ $search = new $search_type($error, $phpbb_root_path, $phpEx, $auth, $config, $db, $user, $phpbb_dispatcher);
if ($error)
{
@@ -303,10 +305,19 @@ if ($keywords || $author || $author_id || $search_id || $submit)
if ($keywords)
{
$correct_query = $search->split_keywords($keywords, $search_terms);
- if (!$correct_query || (empty($search->search_query) && !sizeof($author_id_ary) && !$search_id))
+ $common_words = $search->get_common_words();
+ if (!$correct_query || (!$search->get_search_query() && !sizeof($author_id_ary) && !$search_id))
{
- $ignored = (sizeof($search->common_words)) ? sprintf($user->lang['IGNORED_TERMS_EXPLAIN'], implode(' ', $search->common_words)) . '<br />' : '';
- trigger_error($ignored . sprintf($user->lang['NO_KEYWORDS'], $search->word_length['min'], $search->word_length['max']));
+ $ignored = (sizeof($common_words)) ? sprintf($user->lang['IGNORED_TERMS_EXPLAIN'], implode(' ', $common_words)) . '<br />' : '';
+ $word_length = $search->get_word_length();
+ if ($word_length)
+ {
+ trigger_error($ignored . $user->lang('NO_KEYWORDS', $user->lang('CHARACTERS', (int) $word_length['min']), $user->lang('CHARACTERS', (int) $word_length['max'])));
+ }
+ else
+ {
+ trigger_error($ignored);
+ }
}
}
@@ -320,6 +331,31 @@ if ($keywords || $author || $author_id || $search_id || $submit)
// define some variables needed for retrieving post_id/topic_id information
$sort_by_sql = array('a' => 'u.username_clean', 't' => (($show_results == 'posts') ? 'p.post_time' : 't.topic_last_post_time'), 'f' => 'f.forum_id', 'i' => 't.topic_title', 's' => (($show_results == 'posts') ? 'p.post_subject' : 't.topic_title'));
+ /**
+ * Event to modify the SQL parameters before pre-made searches
+ *
+ * @event core.search_modify_param_before
+ * @var string keywords String of the specified keywords
+ * @var array sort_by_sql Array of SQL sorting instructions
+ * @var array ex_fid_ary Array of excluded forum ids
+ * @var array author_id_ary Array of exclusive author ids
+ * @var string search_id The id of the search request
+ * @var array id_ary Array of post or topic ids for search result
+ * @var string show_results 'posts' or 'topics' type of ids
+ * @since 3.1.3-RC1
+ * @changed 3.1.10-RC1 Added id_ary, show_results
+ */
+ $vars = array(
+ 'keywords',
+ 'sort_by_sql',
+ 'ex_fid_ary',
+ 'author_id_ary',
+ 'search_id',
+ 'id_ary',
+ 'show_results',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.search_modify_param_before', compact($vars)));
+
// pre-made searches
$sql = $field = $l_search_title = '';
if ($search_id)
@@ -344,7 +380,7 @@ if ($keywords || $author || $author_id || $search_id || $submit)
FROM ' . TOPICS_TABLE . " t
WHERE t.topic_moved_id = 0
$last_post_time_sql
- " . str_replace(array('p.', 'post_'), array('t.', 'topic_'), $m_approve_fid_sql) . '
+ AND " . $m_approve_topics_fid_sql . '
' . ((sizeof($ex_fid_ary)) ? ' AND ' . $db->sql_in_set('t.forum_id', $ex_fid_ary, true) : '') . '
ORDER BY t.topic_last_post_time DESC';
$field = 'topic_id';
@@ -379,10 +415,10 @@ if ($keywords || $author || $author_id || $search_id || $submit)
{
$sql = "SELECT p.post_id
FROM $sort_join" . POSTS_TABLE . ' p, ' . TOPICS_TABLE . " t
- WHERE t.topic_replies = 0
+ WHERE t.topic_posts_approved = 1
AND p.topic_id = t.topic_id
$last_post_time
- $m_approve_fid_sql
+ AND $m_approve_posts_fid_sql
" . ((sizeof($ex_fid_ary)) ? ' AND ' . $db->sql_in_set('p.forum_id', $ex_fid_ary, true) : '') . "
$sql_sort";
$field = 'post_id';
@@ -391,11 +427,11 @@ if ($keywords || $author || $author_id || $search_id || $submit)
{
$sql = 'SELECT DISTINCT ' . $sort_by_sql[$sort_key] . ", p.topic_id
FROM $sort_join" . POSTS_TABLE . ' p, ' . TOPICS_TABLE . " t
- WHERE t.topic_replies = 0
+ WHERE t.topic_posts_approved = 1
AND t.topic_moved_id = 0
AND p.topic_id = t.topic_id
$last_post_time
- $m_approve_fid_sql
+ AND $m_approve_topics_fid_sql
" . ((sizeof($ex_fid_ary)) ? ' AND ' . $db->sql_in_set('p.forum_id', $ex_fid_ary, true) : '') . "
$sql_sort";
$field = 'topic_id';
@@ -411,11 +447,13 @@ if ($keywords || $author || $author_id || $search_id || $submit)
$sql_sort = 'ORDER BY ' . $sort_by_sql[$sort_key] . (($sort_dir == 'a') ? ' ASC' : ' DESC');
$sql_where = 'AND t.topic_moved_id = 0
- ' . str_replace(array('p.', 'post_'), array('t.', 'topic_'), $m_approve_fid_sql) . '
+ AND ' . $m_approve_topics_fid_sql . '
' . ((sizeof($ex_fid_ary)) ? 'AND ' . $db->sql_in_set('t.forum_id', $ex_fid_ary, true) : '');
gen_sort_selects($limit_days, $sort_by_text, $sort_days, $sort_key, $sort_dir, $s_limit_days, $s_sort_key, $s_sort_dir, $u_sort_param);
$s_sort_key = $s_sort_dir = $u_sort_param = $s_limit_days = '';
+
+ $template->assign_var('U_MARK_ALL_READ', ($user->data['is_registered'] || $config['load_anon_lastread']) ? append_sid("{$phpbb_root_path}index.$phpEx", 'hash=' . generate_link_hash('global') . '&amp;mark=forums&amp;mark_time=' . time()) : '');
break;
case 'newposts':
@@ -434,9 +472,9 @@ if ($keywords || $author || $author_id || $search_id || $submit)
{
$sql = 'SELECT p.post_id
FROM ' . POSTS_TABLE . ' p
- WHERE p.post_time > ' . $user->data['user_lastvisit'] . "
- $m_approve_fid_sql
- " . ((sizeof($ex_fid_ary)) ? ' AND ' . $db->sql_in_set('p.forum_id', $ex_fid_ary, true) : '') . "
+ WHERE p.post_time > ' . $user->data['user_lastvisit'] . '
+ AND ' . $m_approve_posts_fid_sql . '
+ ' . ((sizeof($ex_fid_ary)) ? ' AND ' . $db->sql_in_set('p.forum_id', $ex_fid_ary, true) : '') . "
$sql_sort";
$field = 'post_id';
}
@@ -446,7 +484,7 @@ if ($keywords || $author || $author_id || $search_id || $submit)
FROM ' . TOPICS_TABLE . ' t
WHERE t.topic_last_post_time > ' . $user->data['user_lastvisit'] . '
AND t.topic_moved_id = 0
- ' . str_replace(array('p.', 'post_'), array('t.', 'topic_'), $m_approve_fid_sql) . '
+ AND ' . $m_approve_topics_fid_sql . '
' . ((sizeof($ex_fid_ary)) ? 'AND ' . $db->sql_in_set('t.forum_id', $ex_fid_ary, true) : '') . "
$sql_sort";
/*
@@ -458,8 +496,7 @@ if ($keywords || $author || $author_id || $search_id || $submit)
WHERE p.post_time > ' . $user->data['user_lastvisit'] . '
AND t.topic_id = p.topic_id
AND t.topic_moved_id = 0
- ' . $m_approve_fid_sql . '
- ' . ((sizeof($ex_fid_ary)) ? 'AND ' . $db->sql_in_set('t.forum_id', $ex_fid_ary, true) : '') . "
+ AND ' . $m_approve_topics_fid_sql . "
GROUP BY t.topic_id
$sql_sort";
*/
@@ -473,6 +510,24 @@ if ($keywords || $author || $author_id || $search_id || $submit)
}
}
+ /**
+ * Event to modify data after pre-made searches
+ *
+ * @event core.search_modify_param_after
+ * @var string l_search_title The title of the search page
+ * @var string search_id Predefined search type name
+ * @var string show_results Display topics or posts
+ * @var string sql SQL query corresponding to the pre-made search id
+ * @since 3.1.7-RC1
+ */
+ $vars = array(
+ 'l_search_title',
+ 'search_id',
+ 'show_results',
+ 'sql',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.search_modify_param_after', compact($vars)));
+
// show_results should not change after this
$per_page = ($show_results == 'posts') ? $config['posts_per_page'] : $config['topics_per_page'];
$total_match_count = 0;
@@ -515,14 +570,7 @@ if ($keywords || $author || $author_id || $search_id || $submit)
}
// Make sure $start is set to the last page if it exceeds the amount
- if ($start < 0)
- {
- $start = 0;
- }
- else if ($start >= $total_match_count)
- {
- $start = floor(($total_match_count - 1) / $per_page) * $per_page;
- }
+ $start = $pagination->validate_start($start, $per_page, $total_match_count);
$id_ary = array_slice($id_ary, $start, $per_page);
}
@@ -535,26 +583,67 @@ if ($keywords || $author || $author_id || $search_id || $submit)
// make sure that some arrays are always in the same order
sort($ex_fid_ary);
- sort($m_approve_fid_ary);
sort($author_id_ary);
- if (!empty($search->search_query))
+ if ($search->get_search_query())
{
- $total_match_count = $search->keyword_search($show_results, $search_fields, $search_terms, $sort_by_sql, $sort_key, $sort_dir, $sort_days, $ex_fid_ary, $m_approve_fid_ary, $topic_id, $author_id_ary, $sql_author_match, $id_ary, $start, $per_page);
+ $total_match_count = $search->keyword_search($show_results, $search_fields, $search_terms, $sort_by_sql, $sort_key, $sort_dir, $sort_days, $ex_fid_ary, $m_approve_posts_fid_sql, $topic_id, $author_id_ary, $sql_author_match, $id_ary, $start, $per_page);
}
else if (sizeof($author_id_ary))
{
$firstpost_only = ($search_fields === 'firstpost' || $search_fields == 'titleonly') ? true : false;
- $total_match_count = $search->author_search($show_results, $firstpost_only, $sort_by_sql, $sort_key, $sort_dir, $sort_days, $ex_fid_ary, $m_approve_fid_ary, $topic_id, $author_id_ary, $sql_author_match, $id_ary, $start, $per_page);
+ $total_match_count = $search->author_search($show_results, $firstpost_only, $sort_by_sql, $sort_key, $sort_dir, $sort_days, $ex_fid_ary, $m_approve_posts_fid_sql, $topic_id, $author_id_ary, $sql_author_match, $id_ary, $start, $per_page);
}
+ /**
+ * Event to search otherwise than by keywords or author
+ *
+ * @event core.search_backend_search_after
+ * @var string show_results 'posts' or 'topics' type of ids
+ * @var string search_fields The data fields to search in
+ * @var string search_terms Is either 'all' (use query as entered, words without prefix should default to "have to be in field") or 'any' (ignore search query parts and just return all posts that contain any of the specified words)
+ * @var array sort_by_sql Array of SQL sorting instructions
+ * @var string sort_key The sort key
+ * @var string sort_dir The sort direction
+ * @var int sort_days Limit the age of results
+ * @var array ex_fid_ary Array of excluded forum ids
+ * @var string m_approve_posts_fid_sql Specifies which types of posts the user can view in which forums
+ * @var int topic_id is set to 0 or a topic id, if it is not 0 then only posts in this topic should be searched
+ * @var array author_id_ary Array of exclusive author ids
+ * @var string sql_author_match Specifies the author match, when ANONYMOUS is also a search-match
+ * @var array id_ary Array of post or topic ids for search result
+ * @var int start The starting id of the results
+ * @var int per_page Number of ids each page is supposed to contain
+ * @var int total_match_count The total number of search matches
+ * @since 3.1.10-RC1
+ */
+ $vars = array(
+ 'show_results',
+ 'search_fields',
+ 'search_terms',
+ 'sort_by_sql',
+ 'sort_key',
+ 'sort_dir',
+ 'sort_days',
+ 'ex_fid_ary',
+ 'm_approve_posts_fid_sql',
+ 'topic_id',
+ 'author_id_ary',
+ 'sql_author_match',
+ 'id_ary',
+ 'start',
+ 'per_page',
+ 'total_match_count',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.search_backend_search_after', compact($vars)));
+
$sql_where = '';
if (sizeof($id_ary))
{
$sql_where .= $db->sql_in_set(($show_results == 'posts') ? 'p.post_id' : 't.topic_id', $id_ary);
$sql_where .= (sizeof($ex_fid_ary)) ? ' AND (' . $db->sql_in_set('f.forum_id', $ex_fid_ary, true) . ' OR f.forum_id IS NULL)' : '';
- $sql_where .= ($show_results == 'posts') ? $m_approve_fid_sql : str_replace(array('p.post_approved', 'p.forum_id'), array('t.topic_approved', 't.forum_id'), $m_approve_fid_sql);
+ $sql_where .= ' AND ' . (($show_results == 'posts') ? $m_approve_posts_fid_sql : $m_approve_topics_fid_sql);
}
if ($show_results == 'posts')
@@ -571,16 +660,6 @@ if ($keywords || $author || $author_id || $search_id || $submit)
// Grab icons
$icons = $cache->obtain_icons();
- // Output header
- if ($found_more_search_matches)
- {
- $l_search_matches = sprintf($user->lang['FOUND_MORE_SEARCH_MATCHES'], $total_match_count);
- }
- else
- {
- $l_search_matches = ($total_match_count == 1) ? sprintf($user->lang['FOUND_SEARCH_MATCH'], $total_match_count) : sprintf($user->lang['FOUND_SEARCH_MATCHES'], $total_match_count);
- }
-
// define some vars for urls
// A single wildcard will make the search results look ugly
$hilit = phpbb_clean_search_string(str_replace(array('+', '-', '|', '(', ')', '&quot;'), ' ', $keywords));
@@ -602,31 +681,29 @@ if ($keywords || $author || $author_id || $search_id || $submit)
$u_search .= ($search_fields != 'all') ? '&amp;sf=' . $search_fields : '';
$u_search .= ($return_chars != 300) ? '&amp;ch=' . $return_chars : '';
- $template->assign_vars(array(
- 'SEARCH_TITLE' => $l_search_title,
- 'SEARCH_MATCHES' => $l_search_matches,
- 'SEARCH_WORDS' => $keywords,
- 'SEARCHED_QUERY' => $search->search_query,
- 'IGNORED_WORDS' => (sizeof($search->common_words)) ? implode(' ', $search->common_words) : '',
- 'PAGINATION' => generate_pagination($u_search, $total_match_count, $per_page, $start),
- 'PAGE_NUMBER' => on_page($total_match_count, $per_page, $start),
- 'TOTAL_MATCHES' => $total_match_count,
- 'SEARCH_IN_RESULTS' => ($search_id) ? false : true,
-
- 'S_SELECT_SORT_DIR' => $s_sort_dir,
- 'S_SELECT_SORT_KEY' => $s_sort_key,
- 'S_SELECT_SORT_DAYS' => $s_limit_days,
- 'S_SEARCH_ACTION' => $u_search,
- 'S_SHOW_TOPICS' => ($show_results == 'posts') ? false : true,
-
- 'GOTO_PAGE_IMG' => $user->img('icon_post_target', 'GOTO_PAGE'),
- 'NEWEST_POST_IMG' => $user->img('icon_topic_newest', 'VIEW_NEWEST_POST'),
- 'REPORTED_IMG' => $user->img('icon_topic_reported', 'TOPIC_REPORTED'),
- 'UNAPPROVED_IMG' => $user->img('icon_topic_unapproved', 'TOPIC_UNAPPROVED'),
- 'LAST_POST_IMG' => $user->img('icon_topic_latest', 'VIEW_LATEST_POST'),
-
- 'U_SEARCH_WORDS' => $u_search,
- ));
+ /**
+ * Event to add or modify search URL parameters
+ *
+ * @event core.search_modify_url_parameters
+ * @var string u_search Search URL parameters string
+ * @var string search_id Predefined search type name
+ * @var string show_results String indicating the show results mode
+ * @var string sql_where The SQL WHERE string used by search to get topic data
+ * @var int total_match_count The total number of search matches
+ * @var array ex_fid_ary Array of excluded forum ids
+ * @since 3.1.7-RC1
+ * @changed 3.1.10-RC1 Added show_results, sql_where, total_match_count
+ * @changed 3.1.11-RC1 Added ex_fid_ary
+ */
+ $vars = array(
+ 'u_search',
+ 'search_id',
+ 'show_results',
+ 'sql_where',
+ 'total_match_count',
+ 'ex_fid_ary',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.search_modify_url_parameters', compact($vars)));
if ($sql_where)
{
@@ -645,12 +722,66 @@ if ($keywords || $author || $author_id || $search_id || $submit)
}
$db->sql_freeresult($result);
- $sql = 'SELECT p.*, f.forum_id, f.forum_name, t.*, u.username, u.username_clean, u.user_sig, u.user_sig_bbcode_uid, u.user_colour
- FROM ' . POSTS_TABLE . ' p
- LEFT JOIN ' . TOPICS_TABLE . ' t ON (p.topic_id = t.topic_id)
- LEFT JOIN ' . FORUMS_TABLE . ' f ON (p.forum_id = f.forum_id)
- LEFT JOIN ' . USERS_TABLE . " u ON (p.poster_id = u.user_id)
- WHERE $sql_where";
+ $sql_array = array(
+ 'SELECT' => 'p.*, f.forum_id, f.forum_name, t.*, u.username, u.username_clean, u.user_sig, u.user_sig_bbcode_uid, u.user_colour',
+ 'FROM' => array(
+ POSTS_TABLE => 'p',
+ ),
+ 'LEFT_JOIN' => array(
+ array(
+ 'FROM' => array(TOPICS_TABLE => 't'),
+ 'ON' => 'p.topic_id = t.topic_id',
+ ),
+ array(
+ 'FROM' => array(FORUMS_TABLE => 'f'),
+ 'ON' => 'p.forum_id = f.forum_id',
+ ),
+ array(
+ 'FROM' => array(USERS_TABLE => 'u'),
+ 'ON' => 'p.poster_id = u.user_id',
+ ),
+ ),
+ 'WHERE' => $sql_where,
+ 'ORDER_BY' => $sort_by_sql[$sort_key] . ' ' . (($sort_dir == 'd') ? 'DESC' : 'ASC'),
+ );
+
+ /**
+ * Event to modify the SQL query before the posts data is retrieved
+ *
+ * @event core.search_get_posts_data
+ * @var array sql_array The SQL array
+ * @var array zebra Array of zebra data for the current user
+ * @var int total_match_count The total number of search matches
+ * @var string keywords String of the specified keywords
+ * @var array sort_by_sql Array of SQL sorting instructions
+ * @var string s_sort_dir The sort direction
+ * @var string s_sort_key The sort key
+ * @var string s_limit_days Limit the age of results
+ * @var array ex_fid_ary Array of excluded forum ids
+ * @var array author_id_ary Array of exclusive author ids
+ * @var string search_fields The data fields to search in
+ * @var int search_id The id of the search request
+ * @var int start The starting id of the results
+ * @since 3.1.0-b3
+ */
+ $vars = array(
+ 'sql_array',
+ 'zebra',
+ 'total_match_count',
+ 'keywords',
+ 'sort_by_sql',
+ 's_sort_dir',
+ 's_sort_key',
+ 's_limit_days',
+ 'ex_fid_ary',
+ 'author_id_ary',
+ 'search_fields',
+ 'search_id',
+ 'start',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.search_get_posts_data', compact($vars)));
+
+ $sql = $db->sql_build_query('SELECT', $sql_array);
}
else
{
@@ -680,15 +811,45 @@ if ($keywords || $author || $author_id || $search_id || $submit)
if ($config['load_anon_lastread'] || ($user->data['is_registered'] && !$config['load_db_lastread']))
{
- $tracking_topics = (isset($_COOKIE[$config['cookie_name'] . '_track'])) ? ((STRIP) ? stripslashes($_COOKIE[$config['cookie_name'] . '_track']) : $_COOKIE[$config['cookie_name'] . '_track']) : '';
+ $tracking_topics = $request->variable($config['cookie_name'] . '_track', '', true, \phpbb\request\request_interface::COOKIE);
$tracking_topics = ($tracking_topics) ? tracking_unserialize($tracking_topics) : array();
}
+ $sql_order_by = $sort_by_sql[$sort_key] . ' ' . (($sort_dir == 'd') ? 'DESC' : 'ASC');
+
+ /**
+ * Event to modify the SQL query before the topic data is retrieved
+ *
+ * @event core.search_get_topic_data
+ * @var string sql_select The SQL SELECT string used by search to get topic data
+ * @var string sql_from The SQL FROM string used by search to get topic data
+ * @var string sql_where The SQL WHERE string used by search to get topic data
+ * @var int total_match_count The total number of search matches
+ * @var array sort_by_sql Array of SQL sorting instructions
+ * @var string sort_dir The sorting direction
+ * @var string sort_key The sorting key
+ * @var string sql_order_by The SQL ORDER BY string used by search to get topic data
+ * @since 3.1.0-a1
+ * @changed 3.1.0-RC5 Added total_match_count
+ * @changed 3.1.7-RC1 Added sort_by_sql, sort_dir, sort_key, sql_order_by
+ */
+ $vars = array(
+ 'sql_select',
+ 'sql_from',
+ 'sql_where',
+ 'total_match_count',
+ 'sort_by_sql',
+ 'sort_dir',
+ 'sort_key',
+ 'sql_order_by',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.search_get_topic_data', compact($vars)));
+
$sql = "SELECT $sql_select
FROM $sql_from
- WHERE $sql_where";
+ WHERE $sql_where
+ ORDER BY $sql_order_by";
}
- $sql .= ' ORDER BY ' . $sort_by_sql[$sort_key] . ' ' . (($sort_dir == 'd') ? 'DESC' : 'ASC');
$result = $db->sql_query($sql);
$result_topic_id = 0;
@@ -747,11 +908,11 @@ if ($keywords || $author || $author_id || $search_id || $submit)
{
if ($user->data['is_registered'] && $config['load_db_lastread'])
{
- $topic_tracking_info[$forum_id] = get_topic_tracking($forum_id, $forum['topic_list'], $forum['rowset'], array($forum_id => $forum['mark_time']), ($forum_id) ? false : $forum['topic_list']);
+ $topic_tracking_info[$forum_id] = get_topic_tracking($forum_id, $forum['topic_list'], $forum['rowset'], array($forum_id => $forum['mark_time']));
}
else if ($config['load_anon_lastread'] || $user->data['is_registered'])
{
- $topic_tracking_info[$forum_id] = get_complete_topic_tracking($forum_id, $forum['topic_list'], ($forum_id) ? false : $forum['topic_list']);
+ $topic_tracking_info[$forum_id] = get_complete_topic_tracking($forum_id, $forum['topic_list']);
if (!$user->data['is_registered'])
{
@@ -763,7 +924,7 @@ if ($keywords || $author || $author_id || $search_id || $submit)
}
else
{
- $bbcode_bitfield = $text_only_message = '';
+ $text_only_message = '';
$attach_list = array();
while ($row = $db->sql_fetchrow($result))
@@ -783,7 +944,6 @@ if ($keywords || $author || $author_id || $search_id || $submit)
if ($return_chars == -1 || utf8_strlen($text_only_message) < ($return_chars + 3))
{
$row['display_text_only'] = false;
- $bbcode_bitfield = $bbcode_bitfield | base64_decode($row['bbcode_bitfield']);
// Does this post have an attachment? If so, add it to the list
if ($row['post_attachment'] && $config['allow_attachments'])
@@ -803,13 +963,6 @@ if ($keywords || $author || $author_id || $search_id || $submit)
unset($text_only_message);
- // Instantiate BBCode if needed
- if ($bbcode_bitfield !== '')
- {
- include_once($phpbb_root_path . 'includes/bbcode.' . $phpEx);
- $bbcode = new bbcode(base64_encode($bbcode_bitfield));
- }
-
// Pull attachment data
if (sizeof($attach_list))
{
@@ -855,45 +1008,43 @@ if ($keywords || $author || $author_id || $search_id || $submit)
$hilit = implode('|', $hilit_array);
}
+ /**
+ * Modify the rowset data
+ *
+ * @event core.search_modify_rowset
+ * @var array attachments Array with posts attachments data
+ * @var string hilit String to highlight
+ * @var array rowset Array with the search results data
+ * @var string show_results String indicating the show results mode
+ * @var array topic_tracking_info Array with the topics tracking data
+ * @var string u_hilit Highlight string to be injected into URL
+ * @var string view Search results view mode
+ * @var array zebra Array with zebra data for the current user
+ * @since 3.1.0-b4
+ * @changed 3.1.0-b5 Added var show_results
+ */
+ $vars = array(
+ 'attachments',
+ 'hilit',
+ 'rowset',
+ 'show_results',
+ 'topic_tracking_info',
+ 'u_hilit',
+ 'view',
+ 'zebra',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.search_modify_rowset', compact($vars)));
+
foreach ($rowset as $row)
{
$forum_id = $row['forum_id'];
$result_topic_id = $row['topic_id'];
$topic_title = censor_text($row['topic_title']);
+ $replies = $phpbb_content_visibility->get_count('topic_posts', $row, $forum_id) - 1;
- // we need to select a forum id for this global topic
- if (!$forum_id)
- {
- if (!isset($g_forum_id))
- {
- // Get a list of forums the user cannot read
- $forum_ary = array_unique(array_keys($auth->acl_getf('!f_read', true)));
-
- // Determine first forum the user is able to read (must not be a category)
- $sql = 'SELECT forum_id
- FROM ' . FORUMS_TABLE . '
- WHERE forum_type = ' . FORUM_POST;
-
- if (sizeof($forum_ary))
- {
- $sql .= ' AND ' . $db->sql_in_set('forum_id', $forum_ary, true);
- }
-
- $result = $db->sql_query_limit($sql, 1);
- $g_forum_id = (int) $db->sql_fetchfield('forum_id');
- }
- $u_forum_id = $g_forum_id;
- }
- else
- {
- $u_forum_id = $forum_id;
- }
-
- $view_topic_url_params = "f=$u_forum_id&amp;t=$result_topic_id" . (($u_hilit) ? "&amp;hilit=$u_hilit" : '');
+ $view_topic_url_params = "f=$forum_id&amp;t=$result_topic_id" . (($u_hilit) ? "&amp;hilit=$u_hilit" : '');
$view_topic_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", $view_topic_url_params);
- $replies = ($auth->acl_get('m_approve', $forum_id)) ? $row['topic_replies_real'] : $row['topic_replies'];
-
if ($show_results == 'topics')
{
if ($config['load_db_track'] && $author_id === $user->data['user_id'])
@@ -906,11 +1057,13 @@ if ($keywords || $author || $author_id || $search_id || $submit)
$unread_topic = (isset($topic_tracking_info[$forum_id][$row['topic_id']]) && $row['topic_last_post_time'] > $topic_tracking_info[$forum_id][$row['topic_id']]) ? true : false;
- $topic_unapproved = (!$row['topic_approved'] && $auth->acl_get('m_approve', $forum_id)) ? true : false;
- $posts_unapproved = ($row['topic_approved'] && $row['topic_replies'] < $row['topic_replies_real'] && $auth->acl_get('m_approve', $forum_id)) ? true : false;
+ $topic_unapproved = (($row['topic_visibility'] == ITEM_UNAPPROVED || $row['topic_visibility'] == ITEM_REAPPROVE) && $auth->acl_get('m_approve', $forum_id)) ? true : false;
+ $posts_unapproved = ($row['topic_visibility'] == ITEM_APPROVED && $row['topic_posts_unapproved'] && $auth->acl_get('m_approve', $forum_id)) ? true : false;
+ $topic_deleted = $row['topic_visibility'] == ITEM_DELETED;
$u_mcp_queue = ($topic_unapproved || $posts_unapproved) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue&amp;mode=' . (($topic_unapproved) ? 'approve_details' : 'unapproved_posts') . "&amp;t=$result_topic_id", true, $user->session_id) : '';
+ $u_mcp_queue = (!$u_mcp_queue && $topic_deleted) ? append_sid("{$phpbb_root_path}mcp.$phpEx", "i=queue&amp;mode=deleted_topics&amp;t=$result_topic_id", true, $user->session_id) : $u_mcp_queue;
- $row['topic_title'] = preg_replace('#(?!<.*)(?<!\w)(' . $hilit . ')(?!\w|[^<>]*(?:</s(?:cript|tyle))?>)#is', '<span class="posthilit">$1</span>', $row['topic_title']);
+ $row['topic_title'] = preg_replace('#(?!<.*)(?<!\w)(' . $hilit . ')(?!\w|[^<>]*(?:</s(?:cript|tyle))?>)#isu', '<span class="posthilit">$1</span>', $row['topic_title']);
$tpl_ary = array(
'TOPIC_AUTHOR' => get_username_string('username', $row['topic_poster'], $row['topic_first_poster_name'], $row['topic_first_poster_colour']),
@@ -924,14 +1077,11 @@ if ($keywords || $author || $author_id || $search_id || $submit)
'LAST_POST_AUTHOR_COLOUR' => get_username_string('colour', $row['topic_last_poster_id'], $row['topic_last_poster_name'], $row['topic_last_poster_colour']),
'LAST_POST_AUTHOR_FULL' => get_username_string('full', $row['topic_last_poster_id'], $row['topic_last_poster_name'], $row['topic_last_poster_colour']),
- 'PAGINATION' => topic_generate_pagination($replies, $view_topic_url),
'TOPIC_TYPE' => $topic_type,
+ 'TOPIC_IMG_STYLE' => $folder_img,
'TOPIC_FOLDER_IMG' => $user->img($folder_img, $folder_alt),
- 'TOPIC_FOLDER_IMG_SRC' => $user->img($folder_img, $folder_alt, false, '', 'src'),
'TOPIC_FOLDER_IMG_ALT' => $user->lang[$folder_alt],
- 'TOPIC_FOLDER_IMG_WIDTH'=> $user->img($folder_img, '', false, '', 'width'),
- 'TOPIC_FOLDER_IMG_HEIGHT' => $user->img($folder_img, '', false, '', 'height'),
'TOPIC_ICON_IMG' => (!empty($icons[$row['icon_id']])) ? $icons[$row['icon_id']]['img'] : '',
'TOPIC_ICON_IMG_WIDTH' => (!empty($icons[$row['icon_id']])) ? $icons[$row['icon_id']]['width'] : '',
@@ -939,7 +1089,6 @@ if ($keywords || $author || $author_id || $search_id || $submit)
'ATTACH_ICON_IMG' => ($auth->acl_get('u_download') && $auth->acl_get('f_download', $forum_id) && $row['topic_attachment']) ? $user->img('icon_topic_attach', $user->lang['TOTAL_ATTACHMENTS']) : '',
'UNAPPROVED_IMG' => ($topic_unapproved || $posts_unapproved) ? $user->img('icon_topic_unapproved', ($topic_unapproved) ? 'TOPIC_UNAPPROVED' : 'POSTS_UNAPPROVED') : '',
- 'S_TOPIC_GLOBAL' => (!$forum_id) ? true : false,
'S_TOPIC_TYPE' => $row['topic_type'],
'S_USER_POSTED' => (!empty($row['topic_posted'])) ? true : false,
'S_UNREAD_TOPIC' => $unread_topic,
@@ -947,6 +1096,8 @@ if ($keywords || $author || $author_id || $search_id || $submit)
'S_TOPIC_REPORTED' => (!empty($row['topic_reported']) && $auth->acl_get('m_report', $forum_id)) ? true : false,
'S_TOPIC_UNAPPROVED' => $topic_unapproved,
'S_POSTS_UNAPPROVED' => $posts_unapproved,
+ 'S_TOPIC_DELETED' => $topic_deleted,
+ 'S_HAS_POLL' => ($row['poll_start']) ? true : false,
'U_LAST_POST' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", $view_topic_url_params . '&amp;p=' . $row['topic_last_post_id']) . '#p' . $row['topic_last_post_id'],
'U_LAST_POST_AUTHOR' => get_username_string('profile', $row['topic_last_poster_id'], $row['topic_last_poster_name'], $row['topic_last_poster_colour']),
@@ -980,14 +1131,8 @@ if ($keywords || $author || $author_id || $search_id || $submit)
}
else
{
- // Second parse bbcode here
- if ($row['bbcode_bitfield'])
- {
- $bbcode->bbcode_second_pass($row['post_text'], $row['bbcode_uid'], $row['bbcode_bitfield']);
- }
-
- $row['post_text'] = bbcode_nl2br($row['post_text']);
- $row['post_text'] = smiley_text($row['post_text']);
+ $parse_flags = ($row['bbcode_bitfield'] ? OPTION_FLAG_BBCODE : 0) | OPTION_FLAG_SMILIES;
+ $row['post_text'] = generate_text_for_display($row['post_text'], $row['bbcode_uid'], $row['bbcode_bitfield'], $parse_flags, false);
if (!empty($attachments[$row['post_id']]))
{
@@ -1001,8 +1146,8 @@ if ($keywords || $author || $author_id || $search_id || $submit)
if ($hilit)
{
// post highlighting
- $row['post_text'] = preg_replace('#(?!<.*)(?<!\w)(' . $hilit . ')(?!\w|[^<>]*(?:</s(?:cript|tyle))?>)#is', '<span class="posthilit">$1</span>', $row['post_text']);
- $row['post_subject'] = preg_replace('#(?!<.*)(?<!\w)(' . $hilit . ')(?!\w|[^<>]*(?:</s(?:cript|tyle))?>)#is', '<span class="posthilit">$1</span>', $row['post_subject']);
+ $row['post_text'] = preg_replace('#(?!<.*)(?<!\w)(' . $hilit . ')(?!\w|[^<>]*(?:</s(?:cript|tyle))?>)#isu', '<span class="posthilit">$1</span>', $row['post_text']);
+ $row['post_subject'] = preg_replace('#(?!<.*)(?<!\w)(' . $hilit . ')(?!\w|[^<>]*(?:</s(?:cript|tyle))?>)#isu', '<span class="posthilit">$1</span>', $row['post_subject']);
}
$tpl_ary = array(
@@ -1017,7 +1162,7 @@ if ($keywords || $author || $author_id || $search_id || $submit)
);
}
- $template->assign_block_vars('searchresults', array_merge($tpl_ary, array(
+ $tpl_ary = array_merge($tpl_ary, array(
'FORUM_ID' => $forum_id,
'TOPIC_ID' => $result_topic_id,
'POST_ID' => ($show_results == 'posts') ? $row['post_id'] : false,
@@ -1029,20 +1174,147 @@ if ($keywords || $author || $author_id || $search_id || $submit)
'U_VIEW_TOPIC' => $view_topic_url,
'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_id),
- 'U_VIEW_POST' => (!empty($row['post_id'])) ? append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&amp;t=" . $row['topic_id'] . '&amp;p=' . $row['post_id'] . (($u_hilit) ? '&amp;hilit=' . $u_hilit : '')) . '#p' . $row['post_id'] : '')
+ 'U_VIEW_POST' => (!empty($row['post_id'])) ? append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&amp;t=" . $row['topic_id'] . '&amp;p=' . $row['post_id'] . (($u_hilit) ? '&amp;hilit=' . $u_hilit : '')) . '#p' . $row['post_id'] : '',
));
+
+ /**
+ * Modify the topic data before it is assigned to the template
+ *
+ * @event core.search_modify_tpl_ary
+ * @var array row Array with topic data
+ * @var array tpl_ary Template block array with topic data
+ * @var string show_results Display topics or posts
+ * @var string topic_title Cleaned topic title
+ * @var int replies The number of topic replies
+ * @var string view_topic_url The URL to the topic
+ * @var string folder_img The folder image of the topic
+ * @var string folder_alt The alt attribute of the topic folder img
+ * @var int topic_type The topic type
+ * @var bool unread_topic Whether the topic has unread posts
+ * @var bool topic_unapproved Whether the topic is unapproved
+ * @var int posts_unapproved The number of unapproved posts
+ * @var bool topic_deleted Whether the topic has been deleted
+ * @var string u_mcp_queue The URL to the corresponding MCP queue page
+ * @var array zebra The zebra data of the current user
+ * @var array attachments All the attachments of the search results
+ * @since 3.1.0-a1
+ * @changed 3.1.0-b3 Added vars show_results, topic_title, replies,
+ * view_topic_url, folder_img, folder_alt, topic_type, unread_topic,
+ * topic_unapproved, posts_unapproved, topic_deleted, u_mcp_queue,
+ * zebra, attachments
+ */
+ $vars = array(
+ 'row',
+ 'tpl_ary',
+ 'show_results',
+ 'topic_title',
+ 'replies',
+ 'view_topic_url',
+ 'folder_img',
+ 'folder_alt',
+ 'topic_type',
+ 'unread_topic',
+ 'topic_unapproved',
+ 'posts_unapproved',
+ 'topic_deleted',
+ 'u_mcp_queue',
+ 'zebra',
+ 'attachments',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.search_modify_tpl_ary', compact($vars)));
+
+ $template->assign_block_vars('searchresults', $tpl_ary);
+
+ if ($show_results == 'topics')
+ {
+ $pagination->generate_template_pagination($view_topic_url, 'searchresults.pagination', 'start', $replies + 1, $config['posts_per_page'], 1, true, true);
+ }
}
if ($topic_id && ($topic_id == $result_topic_id))
{
$template->assign_vars(array(
'SEARCH_TOPIC' => $topic_title,
+ 'L_RETURN_TO_TOPIC' => $user->lang('RETURN_TO', $topic_title),
'U_SEARCH_TOPIC' => $view_topic_url
));
}
}
unset($rowset);
+ // Output header
+ if ($found_more_search_matches)
+ {
+ $l_search_matches = $user->lang('FOUND_MORE_SEARCH_MATCHES', (int) $total_match_count);
+ }
+ else
+ {
+ $l_search_matches = $user->lang('FOUND_SEARCH_MATCHES', (int) $total_match_count);
+ }
+
+ // Check if search backend supports phrase search or not
+ $phrase_search_disabled = '';
+ if (strpos(html_entity_decode($keywords), '"') !== false && method_exists($search, 'supports_phrase_search'))
+ {
+ $phrase_search_disabled = $search->supports_phrase_search() ? false : true;
+ }
+
+ $pagination->generate_template_pagination($u_search, 'pagination', 'start', $total_match_count, $per_page, $start);
+
+ $template->assign_vars(array(
+ 'SEARCH_TITLE' => $l_search_title,
+ 'SEARCH_MATCHES' => $l_search_matches,
+ 'SEARCH_WORDS' => $keywords,
+ 'SEARCHED_QUERY' => $search->get_search_query(),
+ 'IGNORED_WORDS' => (!empty($common_words)) ? implode(' ', $common_words) : '',
+
+ 'PHRASE_SEARCH_DISABLED' => $phrase_search_disabled,
+
+ 'TOTAL_MATCHES' => $total_match_count,
+ 'SEARCH_IN_RESULTS' => ($search_id) ? false : true,
+
+ 'S_SELECT_SORT_DIR' => $s_sort_dir,
+ 'S_SELECT_SORT_KEY' => $s_sort_key,
+ 'S_SELECT_SORT_DAYS' => $s_limit_days,
+ 'S_SEARCH_ACTION' => $u_search,
+ 'S_SHOW_TOPICS' => ($show_results == 'posts') ? false : true,
+
+ 'GOTO_PAGE_IMG' => $user->img('icon_post_target', 'GOTO_PAGE'),
+ 'NEWEST_POST_IMG' => $user->img('icon_topic_newest', 'VIEW_NEWEST_POST'),
+ 'REPORTED_IMG' => $user->img('icon_topic_reported', 'TOPIC_REPORTED'),
+ 'UNAPPROVED_IMG' => $user->img('icon_topic_unapproved', 'TOPIC_UNAPPROVED'),
+ 'DELETED_IMG' => $user->img('icon_topic_deleted', 'TOPIC_DELETED'),
+ 'POLL_IMG' => $user->img('icon_topic_poll', 'TOPIC_POLL'),
+ 'LAST_POST_IMG' => $user->img('icon_topic_latest', 'VIEW_LATEST_POST'),
+
+ 'U_SEARCH_WORDS' => $u_search,
+ ));
+
+ /**
+ * Modify the title and/or load data for the search results page
+ *
+ * @event core.search_results_modify_search_title
+ * @var int author_id ID of the author to search by
+ * @var string l_search_title The title of the search page
+ * @var string search_id Predefined search type name
+ * @var string show_results Search results output mode - topics or posts
+ * @var int start The starting id of the results
+ * @var int total_match_count The count of search results
+ * @var string keywords The search keywords
+ * @since 3.1.0-RC4
+ * @changed 3.1.6-RC1 Added total_match_count and keywords
+ */
+ $vars = array(
+ 'author_id',
+ 'l_search_title',
+ 'search_id',
+ 'show_results',
+ 'start',
+ 'total_match_count',
+ 'keywords',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.search_results_modify_search_title', compact($vars)));
+
page_header(($l_search_title) ? $l_search_title : $user->lang['SEARCH']);
$template->set_filenames(array(
@@ -1054,6 +1326,7 @@ if ($keywords || $author || $author_id || $search_id || $submit)
}
// Search forum
+$rowset = array();
$s_forums = '';
$sql = 'SELECT f.forum_id, f.forum_name, f.parent_id, f.forum_type, f.left_id, f.right_id, f.forum_password, f.enable_indexing, fa.user_id
FROM ' . FORUMS_TABLE . ' f
@@ -1062,11 +1335,27 @@ $sql = 'SELECT f.forum_id, f.forum_name, f.parent_id, f.forum_type, f.left_id, f
ORDER BY f.left_id ASC";
$result = $db->sql_query($sql);
+while ($row = $db->sql_fetchrow($result))
+{
+ $rowset[(int) $row['forum_id']] = $row;
+}
+$db->sql_freeresult($result);
+
$right = $cat_right = $padding_inc = 0;
$padding = $forum_list = $holding = '';
$pad_store = array('0' => '');
-while ($row = $db->sql_fetchrow($result))
+/**
+* Modify the forum select list for advanced search page
+*
+* @event core.search_modify_forum_select_list
+* @var array rowset Array with the forums list data
+* @since 3.1.10-RC1
+*/
+$vars = array('rowset');
+extract($phpbb_dispatcher->trigger_event('core.search_modify_forum_select_list', compact($vars)));
+
+foreach ($rowset as $row)
{
if ($row['forum_type'] == FORUM_CAT && ($row['left_id'] + 1 == $row['right_id']))
{
@@ -1138,8 +1427,8 @@ if ($holding)
$s_forums .= $holding;
}
-$db->sql_freeresult($result);
unset($pad_store);
+unset($rowset);
if (!$s_forums)
{
@@ -1152,7 +1441,7 @@ $s_characters .= '<option value="0">0</option>';
$s_characters .= '<option value="25">25</option>';
$s_characters .= '<option value="50">50</option>';
-for ($i = 100; $i <= 1000 ; $i += 100)
+for ($i = 100; $i <= 1000; $i += 100)
{
$selected = ($i == 300) ? ' selected="selected"' : '';
$s_characters .= '<option value="' . $i . '"' . $selected . '>' . $i . '</option>';
@@ -1189,7 +1478,7 @@ $template->assign_vars(array(
if ($auth->acl_get('a_search'))
{
// Handle large objects differently for Oracle and MSSQL
- switch ($db->sql_layer)
+ switch ($db->get_sql_layer())
{
case 'oracle':
$sql = 'SELECT search_time, search_keywords
@@ -1239,5 +1528,3 @@ $template->set_filenames(array(
make_jumpbox(append_sid("{$phpbb_root_path}viewforum.$phpEx"));
page_footer();
-
-?>
diff --git a/phpBB/style.php b/phpBB/style.php
deleted file mode 100644
index f1b41c6a85..0000000000
--- a/phpBB/style.php
+++ /dev/null
@@ -1,293 +0,0 @@
-<?php
-/**
-*
-* @package phpBB3
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
-*
-*/
-
-/**
-* @ignore
-*/
-define('IN_PHPBB', true);
-$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
-$phpEx = substr(strrchr(__FILE__, '.'), 1);
-
-require($phpbb_root_path . 'includes/startup.' . $phpEx);
-require($phpbb_root_path . 'config.' . $phpEx);
-
-if (!defined('PHPBB_INSTALLED') || empty($dbms) || empty($acm_type))
-{
- exit;
-}
-
-// Load Extensions
-if (!empty($load_extensions) && function_exists('dl'))
-{
- $load_extensions = explode(',', $load_extensions);
-
- foreach ($load_extensions as $extension)
- {
- @dl(trim($extension));
- }
-}
-
-$id = (isset($_GET['id'])) ? intval($_GET['id']) : 0;
-
-// This is a simple script to grab and output the requested CSS data stored in the DB
-// We include a session_id check to try and limit 3rd party linking ... unless they
-// happen to have a current session it will output nothing. We will also cache the
-// resulting CSS data for five minutes ... anything to reduce the load on the SQL
-// server a little
-if ($id)
-{
- // Include files
- require($phpbb_root_path . 'includes/acm/acm_' . $acm_type . '.' . $phpEx);
- require($phpbb_root_path . 'includes/cache.' . $phpEx);
- require($phpbb_root_path . 'includes/db/' . $dbms . '.' . $phpEx);
- require($phpbb_root_path . 'includes/constants.' . $phpEx);
- require($phpbb_root_path . 'includes/functions.' . $phpEx);
-
- $db = new $sql_db();
- $cache = new cache();
-
- // Connect to DB
- if (!@$db->sql_connect($dbhost, $dbuser, $dbpasswd, $dbname, $dbport, false, false))
- {
- exit;
- }
- unset($dbpasswd);
-
- $config = $cache->obtain_config();
- $user = false;
-
- // try to get a session ID from REQUEST array
- $sid = request_var('sid', '');
-
- if (!$sid)
- {
- // if that failed, then look in the cookies
- $sid = request_var($config['cookie_name'] . '_sid', '', false, true);
- }
-
- if (strspn($sid, 'abcdefABCDEF0123456789') !== strlen($sid))
- {
- $sid = '';
- }
-
- if ($sid)
- {
- $sql = 'SELECT u.user_id, u.user_lang
- FROM ' . SESSIONS_TABLE . ' s, ' . USERS_TABLE . " u
- WHERE s.session_id = '" . $db->sql_escape($sid) . "'
- AND s.session_user_id = u.user_id";
- $result = $db->sql_query($sql);
- $user = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
- }
-
- $recompile = $config['load_tplcompile'];
- if (!$user)
- {
- $id = ($id) ? $id : $config['default_style'];
-// Commented out because calls do not always include the SID anymore
-// $recompile = false;
- $user = array('user_id' => ANONYMOUS);
- }
-
- $sql = 'SELECT s.style_id, c.theme_id, c.theme_data, c.theme_path, c.theme_name, c.theme_mtime, i.*, t.template_path
- FROM ' . STYLES_TABLE . ' s, ' . STYLES_TEMPLATE_TABLE . ' t, ' . STYLES_THEME_TABLE . ' c, ' . STYLES_IMAGESET_TABLE . ' i
- WHERE s.style_id = ' . $id . '
- AND t.template_id = s.template_id
- AND c.theme_id = s.theme_id
- AND i.imageset_id = s.imageset_id';
- $result = $db->sql_query($sql, 300);
- $theme = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
-
- if (!$theme)
- {
- exit;
- }
-
- if ($user['user_id'] == ANONYMOUS)
- {
- $user['user_lang'] = $config['default_lang'];
- }
-
- $user_image_lang = (file_exists($phpbb_root_path . 'styles/' . $theme['imageset_path'] . '/imageset/' . $user['user_lang'])) ? $user['user_lang'] : $config['default_lang'];
-
- // Same query in session.php
- $sql = 'SELECT *
- FROM ' . STYLES_IMAGESET_DATA_TABLE . '
- WHERE imageset_id = ' . $theme['imageset_id'] . "
- AND image_filename <> ''
- AND image_lang IN ('" . $db->sql_escape($user_image_lang) . "', '')";
- $result = $db->sql_query($sql, 3600);
-
- $img_array = array();
- while ($row = $db->sql_fetchrow($result))
- {
- $img_array[$row['image_name']] = $row;
- }
- $db->sql_freeresult($result);
-
- // gzip_compression
- if ($config['gzip_compress'])
- {
- // IE6 is not able to compress the style (do not ask us why!)
- $browser = (!empty($_SERVER['HTTP_USER_AGENT'])) ? strtolower(htmlspecialchars((string) $_SERVER['HTTP_USER_AGENT'])) : '';
-
- if ($browser && strpos($browser, 'msie 6.0') === false && @extension_loaded('zlib') && !headers_sent())
- {
- ob_start('ob_gzhandler');
- }
- }
-
- // Expire time of seven days if not recached
- $expire_time = 7*86400;
- $recache = false;
-
- // Re-cache stylesheet data if necessary
- if ($recompile || empty($theme['theme_data']))
- {
- $recache = (empty($theme['theme_data'])) ? true : false;
- $update_time = time();
-
- // We test for stylesheet.css because it is faster and most likely the only file changed on common themes
- if (!$recache && $theme['theme_mtime'] < @filemtime("{$phpbb_root_path}styles/" . $theme['theme_path'] . '/theme/stylesheet.css'))
- {
- $recache = true;
- $update_time = @filemtime("{$phpbb_root_path}styles/" . $theme['theme_path'] . '/theme/stylesheet.css');
- }
- else if (!$recache)
- {
- $last_change = $theme['theme_mtime'];
- $dir = @opendir("{$phpbb_root_path}styles/{$theme['theme_path']}/theme");
-
- if ($dir)
- {
- while (($entry = readdir($dir)) !== false)
- {
- if (substr(strrchr($entry, '.'), 1) == 'css' && $last_change < @filemtime("{$phpbb_root_path}styles/{$theme['theme_path']}/theme/{$entry}"))
- {
- $recache = true;
- break;
- }
- }
- closedir($dir);
- }
- }
- }
-
- if ($recache)
- {
- include_once($phpbb_root_path . 'includes/acp/acp_styles.' . $phpEx);
-
- $theme['theme_data'] = acp_styles::db_theme_data($theme);
- $theme['theme_mtime'] = $update_time;
-
- // Save CSS contents
- $sql_ary = array(
- 'theme_mtime' => $theme['theme_mtime'],
- 'theme_data' => $theme['theme_data']
- );
-
- $sql = 'UPDATE ' . STYLES_THEME_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . "
- WHERE theme_id = {$theme['theme_id']}";
- $db->sql_query($sql);
-
- $cache->destroy('sql', STYLES_THEME_TABLE);
- }
-
- // Only set the expire time if the theme changed data is older than 30 minutes - to cope with changes from the ACP
- if ($recache || $theme['theme_mtime'] > (time() - 1800))
- {
- header('Expires: 0');
- }
- else
- {
- header('Expires: ' . gmdate('D, d M Y H:i:s \G\M\T', time() + $expire_time));
- }
-
- header('Content-type: text/css; charset=UTF-8');
-
- // Parse Theme Data
- $replace = array(
- '{T_THEME_PATH}' => "{$phpbb_root_path}styles/" . rawurlencode($theme['theme_path']) . '/theme',
- '{T_TEMPLATE_PATH}' => "{$phpbb_root_path}styles/" . rawurlencode($theme['template_path']) . '/template',
- '{T_IMAGESET_PATH}' => "{$phpbb_root_path}styles/" . rawurlencode($theme['imageset_path']) . '/imageset',
- '{T_IMAGESET_LANG_PATH}' => "{$phpbb_root_path}styles/" . rawurlencode($theme['imageset_path']) . '/imageset/' . $user_image_lang,
- '{T_STYLESHEET_NAME}' => $theme['theme_name'],
- '{S_USER_LANG}' => $user['user_lang']
- );
-
- $theme['theme_data'] = str_replace(array_keys($replace), array_values($replace), $theme['theme_data']);
-
- $matches = array();
- preg_match_all('#\{IMG_([A-Za-z0-9_]*?)_(WIDTH|HEIGHT|SRC)\}#', $theme['theme_data'], $matches);
-
- $imgs = $find = $replace = array();
- if (isset($matches[0]) && sizeof($matches[0]))
- {
- foreach ($matches[1] as $i => $img)
- {
- $img = strtolower($img);
- $find[] = $matches[0][$i];
-
- if (!isset($img_array[$img]))
- {
- $replace[] = '';
- continue;
- }
-
- if (!isset($imgs[$img]))
- {
- $img_data = &$img_array[$img];
- $imgsrc = ($img_data['image_lang'] ? $img_data['image_lang'] . '/' : '') . $img_data['image_filename'];
- $imgs[$img] = array(
- 'src' => $phpbb_root_path . 'styles/' . rawurlencode($theme['imageset_path']) . '/imageset/' . $imgsrc,
- 'width' => $img_data['image_width'],
- 'height' => $img_data['image_height'],
- );
- }
-
- switch ($matches[2][$i])
- {
- case 'SRC':
- $replace[] = $imgs[$img]['src'];
- break;
-
- case 'WIDTH':
- $replace[] = $imgs[$img]['width'];
- break;
-
- case 'HEIGHT':
- $replace[] = $imgs[$img]['height'];
- break;
-
- default:
- continue;
- }
- }
-
- if (sizeof($find))
- {
- $theme['theme_data'] = str_replace($find, $replace, $theme['theme_data']);
- }
- }
-
- echo $theme['theme_data'];
-
- if (!empty($cache))
- {
- $cache->unload();
- }
- $db->sql_close();
-}
-
-exit;
-
-?> \ No newline at end of file
diff --git a/phpBB/styles/prosilver/imageset/announce_read.gif b/phpBB/styles/prosilver/imageset/announce_read.gif
deleted file mode 100644
index 33e4a5e852..0000000000
--- a/phpBB/styles/prosilver/imageset/announce_read.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/prosilver/imageset/announce_read_mine.gif b/phpBB/styles/prosilver/imageset/announce_read_mine.gif
deleted file mode 100644
index ad928330e6..0000000000
--- a/phpBB/styles/prosilver/imageset/announce_read_mine.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/prosilver/imageset/announce_unread.gif b/phpBB/styles/prosilver/imageset/announce_unread.gif
deleted file mode 100644
index 4a789f70f0..0000000000
--- a/phpBB/styles/prosilver/imageset/announce_unread.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/prosilver/imageset/announce_unread_mine.gif b/phpBB/styles/prosilver/imageset/announce_unread_mine.gif
deleted file mode 100644
index e01e920b59..0000000000
--- a/phpBB/styles/prosilver/imageset/announce_unread_mine.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/prosilver/imageset/en/button_pm_forward.gif b/phpBB/styles/prosilver/imageset/en/button_pm_forward.gif
deleted file mode 100644
index 3384df34be..0000000000
--- a/phpBB/styles/prosilver/imageset/en/button_pm_forward.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/prosilver/imageset/en/button_pm_new.gif b/phpBB/styles/prosilver/imageset/en/button_pm_new.gif
deleted file mode 100644
index cc0381c6b2..0000000000
--- a/phpBB/styles/prosilver/imageset/en/button_pm_new.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/prosilver/imageset/en/button_pm_reply.gif b/phpBB/styles/prosilver/imageset/en/button_pm_reply.gif
deleted file mode 100644
index 3275b06d52..0000000000
--- a/phpBB/styles/prosilver/imageset/en/button_pm_reply.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/prosilver/imageset/en/button_topic_locked.gif b/phpBB/styles/prosilver/imageset/en/button_topic_locked.gif
deleted file mode 100644
index b08918a24f..0000000000
--- a/phpBB/styles/prosilver/imageset/en/button_topic_locked.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/prosilver/imageset/en/button_topic_new.gif b/phpBB/styles/prosilver/imageset/en/button_topic_new.gif
deleted file mode 100644
index 5b7b1e0e60..0000000000
--- a/phpBB/styles/prosilver/imageset/en/button_topic_new.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/prosilver/imageset/en/button_topic_reply.gif b/phpBB/styles/prosilver/imageset/en/button_topic_reply.gif
deleted file mode 100644
index e900c80c70..0000000000
--- a/phpBB/styles/prosilver/imageset/en/button_topic_reply.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/prosilver/imageset/en/icon_contact_pm.gif b/phpBB/styles/prosilver/imageset/en/icon_contact_pm.gif
deleted file mode 100644
index ec190118fe..0000000000
--- a/phpBB/styles/prosilver/imageset/en/icon_contact_pm.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/prosilver/imageset/en/icon_post_edit.gif b/phpBB/styles/prosilver/imageset/en/icon_post_edit.gif
deleted file mode 100644
index 19006f95a7..0000000000
--- a/phpBB/styles/prosilver/imageset/en/icon_post_edit.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/prosilver/imageset/en/icon_post_quote.gif b/phpBB/styles/prosilver/imageset/en/icon_post_quote.gif
deleted file mode 100644
index c3708a1477..0000000000
--- a/phpBB/styles/prosilver/imageset/en/icon_post_quote.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/prosilver/imageset/en/imageset.cfg b/phpBB/styles/prosilver/imageset/en/imageset.cfg
deleted file mode 100644
index a23eb170fb..0000000000
--- a/phpBB/styles/prosilver/imageset/en/imageset.cfg
+++ /dev/null
@@ -1,35 +0,0 @@
-#
-# phpBB Imageset Configuration File
-#
-# @package phpBB3
-# @copyright (c) 2006 phpBB Group
-# @license http://opensource.org/licenses/gpl-license.php GNU Public License
-#
-#
-# At the left is the name, please do not change this
-# At the right the value is entered
-# For on/off options the valid values are on, off, 1, 0, true and false
-#
-# Values get trimmed, if you want to add a space in front or at the end of
-# the value, then enclose the value with single or double quotes.
-# Single and double quotes do not need to be escaped.
-#
-#
-
-# Images
-img_icon_contact_pm = icon_contact_pm.gif*20*28
-
-img_icon_post_edit = icon_post_edit.gif*20*42
-img_icon_post_quote = icon_post_quote.gif*20*54
-
-img_icon_user_online = icon_user_online.gif*58*58
-img_icon_user_offline =
-img_icon_user_search =
-
-img_button_pm_forward = button_pm_forward.gif*25*96
-img_button_pm_new = button_pm_new.gif*25*84
-img_button_pm_reply = button_pm_reply.gif*25*96
-
-img_button_topic_locked = button_topic_locked.gif*25*88
-img_button_topic_new = button_topic_new.gif*25*96
-img_button_topic_reply = button_topic_reply.gif*25*96
diff --git a/phpBB/styles/prosilver/imageset/forum_link.gif b/phpBB/styles/prosilver/imageset/forum_link.gif
deleted file mode 100644
index 01fb1c4e1e..0000000000
--- a/phpBB/styles/prosilver/imageset/forum_link.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/prosilver/imageset/forum_read.gif b/phpBB/styles/prosilver/imageset/forum_read.gif
deleted file mode 100644
index 82ceee0784..0000000000
--- a/phpBB/styles/prosilver/imageset/forum_read.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/prosilver/imageset/forum_read_locked.gif b/phpBB/styles/prosilver/imageset/forum_read_locked.gif
deleted file mode 100644
index 450bf28c3c..0000000000
--- a/phpBB/styles/prosilver/imageset/forum_read_locked.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/prosilver/imageset/forum_read_subforum.gif b/phpBB/styles/prosilver/imageset/forum_read_subforum.gif
deleted file mode 100644
index 5e97bc94ce..0000000000
--- a/phpBB/styles/prosilver/imageset/forum_read_subforum.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/prosilver/imageset/forum_unread.gif b/phpBB/styles/prosilver/imageset/forum_unread.gif
deleted file mode 100644
index 5a305d2470..0000000000
--- a/phpBB/styles/prosilver/imageset/forum_unread.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/prosilver/imageset/forum_unread_subforum.gif b/phpBB/styles/prosilver/imageset/forum_unread_subforum.gif
deleted file mode 100644
index 5ddd1b2cba..0000000000
--- a/phpBB/styles/prosilver/imageset/forum_unread_subforum.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/prosilver/imageset/icon_contact_aim.gif b/phpBB/styles/prosilver/imageset/icon_contact_aim.gif
deleted file mode 100644
index be039fcde2..0000000000
--- a/phpBB/styles/prosilver/imageset/icon_contact_aim.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/prosilver/imageset/icon_contact_email.gif b/phpBB/styles/prosilver/imageset/icon_contact_email.gif
deleted file mode 100644
index caa3683005..0000000000
--- a/phpBB/styles/prosilver/imageset/icon_contact_email.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/prosilver/imageset/icon_contact_icq.gif b/phpBB/styles/prosilver/imageset/icon_contact_icq.gif
deleted file mode 100644
index 48a09373eb..0000000000
--- a/phpBB/styles/prosilver/imageset/icon_contact_icq.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/prosilver/imageset/icon_contact_jabber.gif b/phpBB/styles/prosilver/imageset/icon_contact_jabber.gif
deleted file mode 100644
index e335433e97..0000000000
--- a/phpBB/styles/prosilver/imageset/icon_contact_jabber.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/prosilver/imageset/icon_contact_msnm.gif b/phpBB/styles/prosilver/imageset/icon_contact_msnm.gif
deleted file mode 100644
index b82253599b..0000000000
--- a/phpBB/styles/prosilver/imageset/icon_contact_msnm.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/prosilver/imageset/icon_contact_www.gif b/phpBB/styles/prosilver/imageset/icon_contact_www.gif
deleted file mode 100644
index 83cee9728d..0000000000
--- a/phpBB/styles/prosilver/imageset/icon_contact_www.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/prosilver/imageset/icon_contact_yahoo.gif b/phpBB/styles/prosilver/imageset/icon_contact_yahoo.gif
deleted file mode 100644
index 305f297fdb..0000000000
--- a/phpBB/styles/prosilver/imageset/icon_contact_yahoo.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/prosilver/imageset/icon_offline.gif b/phpBB/styles/prosilver/imageset/icon_offline.gif
deleted file mode 100644
index c5e41a41db..0000000000
--- a/phpBB/styles/prosilver/imageset/icon_offline.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/prosilver/imageset/icon_online.gif b/phpBB/styles/prosilver/imageset/icon_online.gif
deleted file mode 100644
index 18e43cd0c6..0000000000
--- a/phpBB/styles/prosilver/imageset/icon_online.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/prosilver/imageset/icon_post_delete.gif b/phpBB/styles/prosilver/imageset/icon_post_delete.gif
deleted file mode 100644
index f51ffc24a6..0000000000
--- a/phpBB/styles/prosilver/imageset/icon_post_delete.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/prosilver/imageset/icon_post_info.gif b/phpBB/styles/prosilver/imageset/icon_post_info.gif
deleted file mode 100644
index af089d8656..0000000000
--- a/phpBB/styles/prosilver/imageset/icon_post_info.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/prosilver/imageset/icon_post_report.gif b/phpBB/styles/prosilver/imageset/icon_post_report.gif
deleted file mode 100644
index 72c6ae89d0..0000000000
--- a/phpBB/styles/prosilver/imageset/icon_post_report.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/prosilver/imageset/icon_post_target.gif b/phpBB/styles/prosilver/imageset/icon_post_target.gif
deleted file mode 100644
index a29dbffa35..0000000000
--- a/phpBB/styles/prosilver/imageset/icon_post_target.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/prosilver/imageset/icon_post_target_unread.gif b/phpBB/styles/prosilver/imageset/icon_post_target_unread.gif
deleted file mode 100644
index e97eeb2b2e..0000000000
--- a/phpBB/styles/prosilver/imageset/icon_post_target_unread.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/prosilver/imageset/icon_topic_attach.gif b/phpBB/styles/prosilver/imageset/icon_topic_attach.gif
deleted file mode 100644
index 9a70638650..0000000000
--- a/phpBB/styles/prosilver/imageset/icon_topic_attach.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/prosilver/imageset/icon_topic_latest.gif b/phpBB/styles/prosilver/imageset/icon_topic_latest.gif
deleted file mode 100644
index d79d31ac43..0000000000
--- a/phpBB/styles/prosilver/imageset/icon_topic_latest.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/prosilver/imageset/icon_topic_newest.gif b/phpBB/styles/prosilver/imageset/icon_topic_newest.gif
deleted file mode 100644
index 0aa19884b5..0000000000
--- a/phpBB/styles/prosilver/imageset/icon_topic_newest.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/prosilver/imageset/icon_user_warn.gif b/phpBB/styles/prosilver/imageset/icon_user_warn.gif
deleted file mode 100644
index 9c4ad98e5c..0000000000
--- a/phpBB/styles/prosilver/imageset/icon_user_warn.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/prosilver/imageset/imageset.cfg b/phpBB/styles/prosilver/imageset/imageset.cfg
deleted file mode 100644
index be3228647d..0000000000
--- a/phpBB/styles/prosilver/imageset/imageset.cfg
+++ /dev/null
@@ -1,116 +0,0 @@
-#
-# phpBB Imageset Configuration File
-#
-# @package phpBB3
-# @copyright (c) 2006 phpBB Group
-# @license http://opensource.org/licenses/gpl-license.php GNU Public License
-#
-#
-# At the left is the name, please do not change this
-# At the right the value is entered
-# For on/off options the valid values are on, off, 1, 0, true and false
-#
-# Values get trimmed, if you want to add a space in front or at the end of
-# the value, then enclose the value with single or double quotes.
-# Single and double quotes do not need to be escaped.
-#
-#
-
-# General Information about this style
-name = prosilver
-copyright = &copy; phpBB Group, 2007
-version = 3.0.14
-
-# Images
-img_site_logo = site_logo.gif*52*139
-img_poll_left =
-img_poll_center =
-img_poll_right =
-img_icon_friend =
-img_icon_foe =
-
-img_forum_link = forum_link.gif*27*27
-img_forum_read = forum_read.gif*27*27
-img_forum_read_locked = forum_read_locked.gif*27*27
-img_forum_read_subforum = forum_read_subforum.gif*27*27
-img_forum_unread = forum_unread.gif*27*27
-img_forum_unread_locked = forum_unread_locked.gif*27*27
-img_forum_unread_subforum = forum_unread_subforum.gif*27*27
-
-img_topic_moved = topic_moved.gif*27*27
-
-img_topic_read = topic_read.gif*27*27
-img_topic_read_mine = topic_read_mine.gif*27*27
-img_topic_read_hot = topic_read_hot.gif*27*27
-img_topic_read_hot_mine = topic_read_hot_mine.gif*27*27
-img_topic_read_locked = topic_read_locked.gif*27*27
-img_topic_read_locked_mine = topic_read_locked_mine.gif*27*27
-
-img_topic_unread = topic_unread.gif*27*27
-img_topic_unread_mine = topic_unread_mine.gif*27*27
-img_topic_unread_hot = topic_unread_hot.gif*27*27
-img_topic_unread_hot_mine = topic_unread_hot_mine.gif*27*27
-img_topic_unread_locked = topic_unread_locked.gif*27*27
-img_topic_unread_locked_mine = topic_unread_locked_mine.gif*27*27
-
-img_sticky_read = sticky_read.gif*27*27
-img_sticky_read_mine = sticky_read_mine.gif*27*27
-img_sticky_read_locked = sticky_read_locked.gif*27*27
-img_sticky_read_locked_mine = sticky_read_locked_mine.gif*27*27
-img_sticky_unread = sticky_unread.gif*27*27
-img_sticky_unread_mine = sticky_unread_mine.gif*27*27
-img_sticky_unread_locked = sticky_unread_locked.gif*27*27
-img_sticky_unread_locked_mine = sticky_unread_locked_mine.gif*27*27
-
-img_announce_read = announce_read.gif*27*27
-img_announce_read_mine = announce_read_mine.gif*27*27
-img_announce_read_locked = announce_read_locked.gif*27*27
-img_announce_read_locked_mine = announce_read_locked_mine.gif*27*27
-img_announce_unread = announce_unread.gif*27*27
-img_announce_unread_mine = announce_unread_mine.gif*27*27
-img_announce_unread_locked = announce_unread_locked.gif*27*27
-img_announce_unread_locked_mine = announce_unread_locked_mine.gif*27*27
-
-img_global_read = announce_read.gif*27*27
-img_global_read_mine = announce_read_mine.gif*27*27
-img_global_read_locked = announce_read_locked.gif*27*27
-img_global_read_locked_mine = announce_read_locked_mine.gif*27*27
-img_global_unread = announce_unread.gif*27*27
-img_global_unread_mine = announce_unread_mine.gif*27*27
-img_global_unread_locked = announce_unread_locked.gif*27*27
-img_global_unread_locked_mine = announce_unread_locked_mine.gif*27*27
-
-img_subforum_read = subforum_read.gif*9*11
-img_subforum_unread = subforum_unread.gif*9*11
-
-img_pm_read = topic_read.gif*27*27
-img_pm_unread = topic_unread.gif*27*27
-
-img_icon_back_top = icon_back_top.gif*11*11
-
-img_icon_contact_aim = icon_contact_aim.gif*20*20
-img_icon_contact_email = icon_contact_email.gif*20*20
-img_icon_contact_icq = icon_contact_icq.gif*20*20
-img_icon_contact_jabber = icon_contact_jabber.gif*20*20
-img_icon_contact_msnm = icon_contact_msnm.gif*20*20
-
-img_icon_contact_www = icon_contact_www.gif*20*20
-img_icon_contact_yahoo = icon_contact_yahoo.gif*20*20
-
-img_icon_post_delete = icon_post_delete.gif*20*20
-
-img_icon_post_info = icon_post_info.gif*20*20
-
-img_icon_post_report = icon_post_report.gif*20*20
-img_icon_post_target = icon_post_target.gif*9*11
-img_icon_post_target_unread = icon_post_target_unread.gif*9*11
-
-img_icon_topic_attach = icon_topic_attach.gif*10*7
-img_icon_topic_latest = icon_topic_latest.gif*9*11
-img_icon_topic_newest = icon_topic_newest.gif*9*11
-img_icon_topic_reported = icon_topic_reported.gif*14*16
-img_icon_topic_unapproved = icon_topic_unapproved.gif*14*16
-
-img_icon_user_profile =
-
-img_icon_user_warn = icon_user_warn.gif*20*20
diff --git a/phpBB/styles/prosilver/imageset/sticky_read.gif b/phpBB/styles/prosilver/imageset/sticky_read.gif
deleted file mode 100644
index 59e42833db..0000000000
--- a/phpBB/styles/prosilver/imageset/sticky_read.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/prosilver/imageset/sticky_read_mine.gif b/phpBB/styles/prosilver/imageset/sticky_read_mine.gif
deleted file mode 100644
index 49e8b3f01c..0000000000
--- a/phpBB/styles/prosilver/imageset/sticky_read_mine.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/prosilver/imageset/sticky_unread.gif b/phpBB/styles/prosilver/imageset/sticky_unread.gif
deleted file mode 100644
index ae6d5954b1..0000000000
--- a/phpBB/styles/prosilver/imageset/sticky_unread.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/prosilver/imageset/sticky_unread_mine.gif b/phpBB/styles/prosilver/imageset/sticky_unread_mine.gif
deleted file mode 100644
index 2580ca0518..0000000000
--- a/phpBB/styles/prosilver/imageset/sticky_unread_mine.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/prosilver/imageset/topic_moved.gif b/phpBB/styles/prosilver/imageset/topic_moved.gif
deleted file mode 100644
index 3275cd6ef9..0000000000
--- a/phpBB/styles/prosilver/imageset/topic_moved.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/prosilver/imageset/topic_read.gif b/phpBB/styles/prosilver/imageset/topic_read.gif
deleted file mode 100644
index 0347ffc1e9..0000000000
--- a/phpBB/styles/prosilver/imageset/topic_read.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/prosilver/imageset/topic_read_locked.gif b/phpBB/styles/prosilver/imageset/topic_read_locked.gif
deleted file mode 100644
index 83bc8bd02f..0000000000
--- a/phpBB/styles/prosilver/imageset/topic_read_locked.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/prosilver/imageset/topic_read_locked_mine.gif b/phpBB/styles/prosilver/imageset/topic_read_locked_mine.gif
deleted file mode 100644
index 360f9d989a..0000000000
--- a/phpBB/styles/prosilver/imageset/topic_read_locked_mine.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/prosilver/imageset/topic_read_mine.gif b/phpBB/styles/prosilver/imageset/topic_read_mine.gif
deleted file mode 100644
index 4972a4e0a5..0000000000
--- a/phpBB/styles/prosilver/imageset/topic_read_mine.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/prosilver/imageset/topic_unread.gif b/phpBB/styles/prosilver/imageset/topic_unread.gif
deleted file mode 100644
index 542a998258..0000000000
--- a/phpBB/styles/prosilver/imageset/topic_unread.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/prosilver/imageset/topic_unread_locked.gif b/phpBB/styles/prosilver/imageset/topic_unread_locked.gif
deleted file mode 100644
index 4fb8fa9517..0000000000
--- a/phpBB/styles/prosilver/imageset/topic_unread_locked.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/prosilver/imageset/topic_unread_locked_mine.gif b/phpBB/styles/prosilver/imageset/topic_unread_locked_mine.gif
deleted file mode 100644
index 4ee6cfe423..0000000000
--- a/phpBB/styles/prosilver/imageset/topic_unread_locked_mine.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/prosilver/imageset/topic_unread_mine.gif b/phpBB/styles/prosilver/imageset/topic_unread_mine.gif
deleted file mode 100644
index e73da38df7..0000000000
--- a/phpBB/styles/prosilver/imageset/topic_unread_mine.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/prosilver/style.cfg b/phpBB/styles/prosilver/style.cfg
index c44808accc..019db11bc7 100644
--- a/phpBB/styles/prosilver/style.cfg
+++ b/phpBB/styles/prosilver/style.cfg
@@ -1,14 +1,16 @@
#
# phpBB Style Configuration File
#
-# @package phpBB3
-# @copyright (c) 2005 phpBB Group
-# @license http://opensource.org/licenses/gpl-license.php GNU Public License
+# This file is part of the phpBB Forum Software package.
#
+# @copyright (c) phpBB Limited <https://www.phpbb.com>
+# @license GNU General Public License, version 2 (GPL-2.0)
+#
+# For full copyright and license information, please see
+# the docs/CREDITS.txt file.
#
# At the left is the name, please do not change this
# At the right the value is entered
-# For on/off options the valid values are on, off, 1, 0, true and false
#
# Values get trimmed, if you want to add a space in front or at the end of
# the value, then enclose the value with single or double quotes.
@@ -18,5 +20,13 @@
# General Information about this style
name = prosilver
-copyright = © phpBB Group, 2007
-version = 3.0.14
+copyright = © phpBB Limited, 2007
+style_version = 3.1.11
+phpbb_version = 3.1.11
+
+# Defining a different template bitfield
+# template_bitfield = lNg=
+
+# Parent style
+# Set value to empty or to this style's name if this style does not have a parent style
+parent = prosilver
diff --git a/phpBB/styles/prosilver/template/ajax.js b/phpBB/styles/prosilver/template/ajax.js
new file mode 100644
index 0000000000..ec9b53328f
--- /dev/null
+++ b/phpBB/styles/prosilver/template/ajax.js
@@ -0,0 +1,394 @@
+/* global phpbb */
+
+(function($) { // Avoid conflicts with other libraries
+
+'use strict';
+
+// This callback will mark all forum icons read
+phpbb.addAjaxCallback('mark_forums_read', function(res) {
+ var readTitle = res.NO_UNREAD_POSTS;
+ var unreadTitle = res.UNREAD_POSTS;
+ var iconsArray = {
+ forum_unread: 'forum_read',
+ forum_unread_subforum: 'forum_read_subforum',
+ forum_unread_locked: 'forum_read_locked'
+ };
+
+ $('li.row').find('dl[class*="forum_unread"]').each(function() {
+ var $this = $(this);
+
+ $.each(iconsArray, function(unreadClass, readClass) {
+ if ($this.hasClass(unreadClass)) {
+ $this.removeClass(unreadClass).addClass(readClass);
+ }
+ });
+ $this.children('dt[title="' + unreadTitle + '"]').attr('title', readTitle);
+ });
+
+ // Mark subforums read
+ $('a.subforum[class*="unread"]').removeClass('unread').addClass('read');
+
+ // Mark topics read if we are watching a category and showing active topics
+ if ($('#active_topics').length) {
+ phpbb.ajaxCallbacks.mark_topics_read.call(this, res, false);
+ }
+
+ // Update mark forums read links
+ $('[data-ajax="mark_forums_read"]').attr('href', res.U_MARK_FORUMS);
+
+ phpbb.closeDarkenWrapper(3000);
+});
+
+/**
+* This callback will mark all topic icons read
+*
+* @param {bool} [update_topic_links=true] Whether "Mark topics read" links
+* should be updated. Defaults to true.
+*/
+phpbb.addAjaxCallback('mark_topics_read', function(res, updateTopicLinks) {
+ var readTitle = res.NO_UNREAD_POSTS;
+ var unreadTitle = res.UNREAD_POSTS;
+ var iconsArray = {
+ global_unread: 'global_read',
+ announce_unread: 'announce_read',
+ sticky_unread: 'sticky_read',
+ topic_unread: 'topic_read'
+ };
+ var iconsState = ['', '_hot', '_hot_mine', '_locked', '_locked_mine', '_mine'];
+ var unreadClassSelectors;
+ var classMap = {};
+ var classNames = [];
+
+ if (typeof updateTopicLinks === 'undefined') {
+ updateTopicLinks = true;
+ }
+
+ $.each(iconsArray, function(unreadClass, readClass) {
+ $.each(iconsState, function(key, value) {
+ // Only topics can be hot
+ if ((value === '_hot' || value === '_hot_mine') && unreadClass !== 'topic_unread') {
+ return true;
+ }
+ classMap[unreadClass + value] = readClass + value;
+ classNames.push(unreadClass + value);
+ });
+ });
+
+ unreadClassSelectors = '.' + classNames.join(',.');
+
+ $('li.row').find(unreadClassSelectors).each(function() {
+ var $this = $(this);
+ $.each(classMap, function(unreadClass, readClass) {
+ if ($this.hasClass(unreadClass)) {
+ $this.removeClass(unreadClass).addClass(readClass);
+ }
+ });
+ $this.children('dt[title="' + unreadTitle + '"]').attr('title', readTitle);
+ });
+
+ // Remove link to first unread post
+ $('a').has('span.icon_topic_newest').remove();
+
+ // Update mark topics read links
+ if (updateTopicLinks) {
+ $('[data-ajax="mark_topics_read"]').attr('href', res.U_MARK_TOPICS);
+ }
+
+ phpbb.closeDarkenWrapper(3000);
+});
+
+// This callback will mark all notifications read
+phpbb.addAjaxCallback('notification.mark_all_read', function(res) {
+ if (typeof res.success !== 'undefined') {
+ phpbb.markNotifications($('#notification_list li.bg2'), 0);
+ phpbb.closeDarkenWrapper(3000);
+ }
+});
+
+// This callback will mark a notification read
+phpbb.addAjaxCallback('notification.mark_read', function(res) {
+ if (typeof res.success !== 'undefined') {
+ var unreadCount = Number($('#notification_list_button strong').html()) - 1;
+ phpbb.markNotifications($(this).parent('li.bg2'), unreadCount);
+ }
+});
+
+/**
+ * Mark notification popup rows as read.
+ *
+ * @param {jQuery} $popup jQuery object(s) to mark read.
+ * @param {int} unreadCount The new unread notifications count.
+ */
+phpbb.markNotifications = function($popup, unreadCount) {
+ // Remove the unread status.
+ $popup.removeClass('bg2');
+ $popup.find('a.mark_read').remove();
+
+ // Update the notification link to the real URL.
+ $popup.each(function() {
+ var link = $(this).find('a');
+ link.attr('href', link.attr('data-real-url'));
+ });
+
+ // Update the unread count.
+ $('strong', '#notification_list_button').html(unreadCount);
+ // Remove the Mark all read link and hide notification count if there are no unread notifications.
+ if (!unreadCount) {
+ $('#mark_all_notifications').remove();
+ $('#notification_list_button > strong').addClass('hidden');
+ }
+
+ // Update page title
+ var $title = $('title');
+ var originalTitle = $title.text().replace(/(\((\d+)\))/, '');
+ $title.text((unreadCount ? '(' + unreadCount + ')' : '') + originalTitle);
+};
+
+// This callback finds the post from the delete link, and removes it.
+phpbb.addAjaxCallback('post_delete', function() {
+ var $this = $(this),
+ postId;
+
+ if ($this.attr('data-refresh') === undefined) {
+ postId = $this[0].href.split('&p=')[1];
+ var post = $this.parents('#p' + postId).css('pointer-events', 'none');
+ if (post.hasClass('bg1') || post.hasClass('bg2')) {
+ var posts1 = post.nextAll('.bg1');
+ post.nextAll('.bg2').removeClass('bg2').addClass('bg1');
+ posts1.removeClass('bg1').addClass('bg2');
+ }
+ post.fadeOut(function() {
+ $(this).remove();
+ });
+ }
+});
+
+// This callback removes the approve / disapprove div or link.
+phpbb.addAjaxCallback('post_visibility', function(res) {
+ var remove = (res.visible) ? $(this) : $(this).parents('.post');
+ $(remove).css('pointer-events', 'none').fadeOut(function() {
+ $(this).remove();
+ });
+
+ if (res.visible) {
+ // Remove the "Deleted by" message from the post on restoring.
+ remove.parents('.post').find('.post_deleted_msg').css('pointer-events', 'none').fadeOut(function() {
+ $(this).remove();
+ });
+ }
+});
+
+// This removes the parent row of the link or form that fired the callback.
+phpbb.addAjaxCallback('row_delete', function() {
+ $(this).parents('tr').remove();
+});
+
+// This handles friend / foe additions removals.
+phpbb.addAjaxCallback('zebra', function(res) {
+ var zebra;
+
+ if (res.success) {
+ zebra = $('.zebra');
+ zebra.first().html(res.MESSAGE_TEXT);
+ zebra.not(':first').html('&nbsp;').prev().html('&nbsp;');
+ }
+});
+
+/**
+ * This callback updates the poll results after voting.
+ */
+phpbb.addAjaxCallback('vote_poll', function(res) {
+ if (typeof res.success !== 'undefined') {
+ var poll = $('.topic_poll');
+ var panel = poll.find('.panel');
+ var resultsVisible = poll.find('dl:first-child .resultbar').is(':visible');
+ var mostVotes = 0;
+
+ // Set min-height to prevent the page from jumping when the content changes
+ var updatePanelHeight = function (height) {
+ height = (typeof height === 'undefined') ? panel.find('.inner').outerHeight() : height;
+ panel.css('min-height', height);
+ };
+ updatePanelHeight();
+
+ // Remove the View results link
+ if (!resultsVisible) {
+ poll.find('.poll_view_results').hide(500);
+ }
+
+ if (!res.can_vote) {
+ poll.find('.polls, .poll_max_votes, .poll_vote, .poll_option_select').fadeOut(500, function () {
+ poll.find('.resultbar, .poll_option_percent, .poll_total_votes').show();
+ });
+ } else {
+ // If the user can still vote, simply slide down the results
+ poll.find('.resultbar, .poll_option_percent, .poll_total_votes').show(500);
+ }
+
+ // Get the votes count of the highest poll option
+ poll.find('[data-poll-option-id]').each(function() {
+ var option = $(this);
+ var optionId = option.attr('data-poll-option-id');
+ mostVotes = (res.vote_counts[optionId] >= mostVotes) ? res.vote_counts[optionId] : mostVotes;
+ });
+
+ // Update the total votes count
+ poll.find('.poll_total_vote_cnt').html(res.total_votes);
+
+ // Update each option
+ poll.find('[data-poll-option-id]').each(function() {
+ var $this = $(this);
+ var optionId = $this.attr('data-poll-option-id');
+ var voted = (typeof res.user_votes[optionId] !== 'undefined');
+ var mostVoted = (res.vote_counts[optionId] === mostVotes);
+ var percent = (!res.total_votes) ? 0 : Math.round((res.vote_counts[optionId] / res.total_votes) * 100);
+ var percentRel = (mostVotes === 0) ? 0 : Math.round((res.vote_counts[optionId] / mostVotes) * 100);
+ var altText;
+
+ altText = $this.attr('data-alt-text');
+ if (voted) {
+ $this.attr('title', $.trim(altText));
+ } else {
+ $this.attr('title', '');
+ };
+ $this.toggleClass('voted', voted);
+ $this.toggleClass('most-votes', mostVoted);
+
+ // Update the bars
+ var bar = $this.find('.resultbar div');
+ var barTimeLapse = (res.can_vote) ? 500 : 1500;
+ var newBarClass = (percent === 100) ? 'pollbar5' : 'pollbar' + (Math.floor(percent / 20) + 1);
+
+ setTimeout(function () {
+ bar.animate({ width: percentRel + '%' }, 500)
+ .removeClass('pollbar1 pollbar2 pollbar3 pollbar4 pollbar5')
+ .addClass(newBarClass)
+ .html(res.vote_counts[optionId]);
+
+ var percentText = percent ? percent + '%' : res.NO_VOTES;
+ $this.find('.poll_option_percent').html(percentText);
+ }, barTimeLapse);
+ });
+
+ if (!res.can_vote) {
+ poll.find('.polls').delay(400).fadeIn(500);
+ }
+
+ // Display "Your vote has been cast." message. Disappears after 5 seconds.
+ var confirmationDelay = (res.can_vote) ? 300 : 900;
+ poll.find('.vote-submitted').delay(confirmationDelay).slideDown(200, function() {
+ if (resultsVisible) {
+ updatePanelHeight();
+ }
+
+ $(this).delay(5000).fadeOut(500, function() {
+ resizePanel(300);
+ });
+ });
+
+ // Remove the gap resulting from removing options
+ setTimeout(function() {
+ resizePanel(500);
+ }, 1500);
+
+ var resizePanel = function (time) {
+ var panelHeight = panel.height();
+ var innerHeight = panel.find('.inner').outerHeight();
+
+ if (panelHeight !== innerHeight) {
+ panel.css({ minHeight: '', height: panelHeight })
+ .animate({ height: innerHeight }, time, function () {
+ panel.css({ minHeight: innerHeight, height: '' });
+ });
+ }
+ };
+ }
+});
+
+/**
+ * Show poll results when clicking View results link.
+ */
+$('.poll_view_results a').click(function(e) {
+ // Do not follow the link
+ e.preventDefault();
+
+ var $poll = $(this).parents('.topic_poll');
+
+ $poll.find('.resultbar, .poll_option_percent, .poll_total_votes').show(500);
+ $poll.find('.poll_view_results').hide(500);
+});
+
+$('[data-ajax]').each(function() {
+ var $this = $(this);
+ var ajax = $this.attr('data-ajax');
+ var filter = $this.attr('data-filter');
+
+ if (ajax !== 'false') {
+ var fn = (ajax !== 'true') ? ajax : null;
+ filter = (filter !== undefined) ? phpbb.getFunctionByName(filter) : null;
+
+ phpbb.ajaxify({
+ selector: this,
+ refresh: $this.attr('data-refresh') !== undefined,
+ filter: filter,
+ callback: fn
+ });
+ }
+});
+
+
+/**
+ * This simply appends #preview to the action of the
+ * QR action when you click the Full Editor & Preview button
+ */
+$('#qr_full_editor').click(function() {
+ $('#qr_postform').attr('action', function(i, val) {
+ return val + '#preview';
+ });
+});
+
+
+/**
+ * Make the display post links to use JS
+ */
+$('.display_post').click(function(e) {
+ // Do not follow the link
+ e.preventDefault();
+
+ var postId = $(this).attr('data-post-id');
+ $('#post_content' + postId).show();
+ $('#profile' + postId).show();
+ $('#post_hidden' + postId).hide();
+});
+
+/**
+* Toggle the member search panel in memberlist.php.
+*
+* If user returns to search page after viewing results the search panel is automatically displayed.
+* In any case the link will toggle the display status of the search panel and link text will be
+* appropriately changed based on the status of the search panel.
+*/
+$('#member_search').click(function () {
+ var $memberlistSearch = $('#memberlist_search');
+
+ $memberlistSearch.slideToggle('fast');
+ phpbb.ajaxCallbacks.alt_text.call(this);
+
+ // Focus on the username textbox if it's available and displayed
+ if ($memberlistSearch.is(':visible')) {
+ $('#username').focus();
+ }
+ return false;
+});
+
+/**
+* Automatically resize textarea
+*/
+$(function() {
+ var $textarea = $('textarea:not(#message-box textarea, .no-auto-resize)');
+ phpbb.resizeTextArea($textarea, { minHeight: 75, maxHeight: 250 });
+ phpbb.resizeTextArea($('textarea', '#message-box'));
+});
+
+
+})(jQuery); // Avoid conflicts with other libraries
diff --git a/phpBB/styles/prosilver/template/attachment.html b/phpBB/styles/prosilver/template/attachment.html
index 4c0a326f1e..4546f53d6c 100644
--- a/phpBB/styles/prosilver/template/attachment.html
+++ b/phpBB/styles/prosilver/template/attachment.html
@@ -1,20 +1,21 @@
+<!-- EVENT attachment_file_before -->
<!-- BEGIN _file -->
<!-- IF _file.S_DENIED -->
<p>[{_file.DENIED_MESSAGE}]</p>
<!-- ELSE -->
+ <!-- EVENT attachment_file_prepend -->
<!-- IF _file.S_THUMBNAIL -->
<dl class="thumbnail">
- <dt><a href="{_file.U_DOWNLOAD_LINK}"><img src="{_file.THUMB_IMAGE}" alt="{_file.DOWNLOAD_NAME}" title="{_file.DOWNLOAD_NAME} ({_file.FILESIZE} {_file.SIZE_LANG}) {_file.L_DOWNLOAD_COUNT}" /></a></dt>
+ <dt><a href="{_file.U_DOWNLOAD_LINK}"><img src="{_file.THUMB_IMAGE}" class="postimage" alt="{_file.DOWNLOAD_NAME}" title="{_file.DOWNLOAD_NAME} ({_file.FILESIZE} {_file.SIZE_LANG}) {_file.L_DOWNLOAD_COUNT}" /></a></dt>
<!-- IF _file.COMMENT --><dd> {_file.COMMENT}</dd><!-- ENDIF -->
</dl>
<!-- ENDIF -->
-
<!-- IF _file.S_IMAGE -->
<dl class="file">
- <dt class="attach-image"><img src="{_file.U_INLINE_LINK}" alt="{_file.DOWNLOAD_NAME}" onclick="viewableArea(this);" /></dt>
+ <dt class="attach-image"><img src="{_file.U_INLINE_LINK}" class="postimage" alt="{_file.DOWNLOAD_NAME}" onclick="viewableArea(this);" /></dt>
<!-- IF _file.COMMENT --><dd><em>{_file.COMMENT}</em></dd><!-- ENDIF -->
<dd>{_file.DOWNLOAD_NAME} ({_file.FILESIZE} {_file.SIZE_LANG}) {_file.L_DOWNLOAD_COUNT}</dd>
</dl>
@@ -28,8 +29,6 @@
</dl>
<!-- ENDIF -->
-
-
<!-- IF _file.S_WM_FILE -->
<!-- method used here from http://alistapart.com/articles/byebyeembed / autosizing seems to not work always, this will not fix -->
<object width="320" height="285" classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" id="wmstream_{_file.ATTACH_ID}">
@@ -118,5 +117,7 @@
<a href="{_file.U_DOWNLOAD_LINK}">{_file.DOWNLOAD_NAME}</a> [ {_file.FILESIZE} {_file.SIZE_LANG} | {_file.L_DOWNLOAD_COUNT} ]</p>
<!-- ENDIF -->
+ <!-- EVENT attachment_file_append -->
<!-- ENDIF -->
<!-- END _file -->
+<!-- EVENT attachment_file_after -->
diff --git a/phpBB/styles/prosilver/template/bbcode.html b/phpBB/styles/prosilver/template/bbcode.html
index bb90c46ced..49bcd56945 100644
--- a/phpBB/styles/prosilver/template/bbcode.html
+++ b/phpBB/styles/prosilver/template/bbcode.html
@@ -8,33 +8,33 @@
<!-- BEGIN listitem --><li><!-- END listitem -->
<!-- BEGIN listitem_close --></li><!-- END listitem_close -->
-<!-- BEGIN quote_username_open --><blockquote><div><cite>{USERNAME} {L_WROTE}:</cite><!-- END quote_username_open -->
+<!-- BEGIN quote_username_open --><blockquote><div><cite>{USERNAME} {L_WROTE}{L_COLON}</cite><!-- END quote_username_open -->
<!-- BEGIN quote_open --><blockquote class="uncited"><div><!-- END quote_open -->
<!-- BEGIN quote_close --></div></blockquote><!-- END quote_close -->
-<!-- BEGIN code_open --><dl class="codebox"><dt>{L_CODE}: <a href="#" onclick="selectCode(this); return false;">{L_SELECT_ALL_CODE}</a></dt><dd><code><!-- END code_open -->
-<!-- BEGIN code_close --></code></dd></dl><!-- END code_close -->
+<!-- BEGIN code_open --><div class="codebox"><p>{L_CODE}{L_COLON} <a href="#" onclick="selectCode(this); return false;">{L_SELECT_ALL_CODE}</a></p><code><!-- END code_open -->
+<!-- BEGIN code_close --></code></div><!-- END code_close -->
<!-- BEGIN inline_attachment_open --><div class="inline-attachment"><!-- END inline_attachment_open -->
<!-- BEGIN inline_attachment_close --></div><!-- END inline_attachment_close -->
-<!-- BEGIN b_open --><strong><!-- END b_open -->
+<!-- BEGIN b_open --><strong class="text-strong"><!-- END b_open -->
<!-- BEGIN b_close --></strong><!-- END b_close -->
<!-- BEGIN u_open --><span style="text-decoration: underline"><!-- END u_open -->
<!-- BEGIN u_close --></span><!-- END u_close -->
-<!-- BEGIN i_open --><em><!-- END i_open -->
+<!-- BEGIN i_open --><em class="text-italics"><!-- END i_open -->
<!-- BEGIN i_close --></em><!-- END i_close -->
<!-- BEGIN color --><span style="color: {COLOR}">{TEXT}</span><!-- END color -->
<!-- BEGIN size --><span style="font-size: {SIZE}%; line-height: 116%;">{TEXT}</span><!-- END size -->
-<!-- BEGIN img --><img src="{URL}" alt="{L_IMAGE}" /><!-- END img -->
+<!-- BEGIN img --><img src="{URL}" class="postimage" alt="{L_IMAGE}" /><!-- END img -->
<!-- BEGIN url --><a href="{URL}" class="postlink">{DESCRIPTION}</a><!-- END url -->
<!-- BEGIN email --><a href="mailto:{EMAIL}">{DESCRIPTION}</a><!-- END email -->
-<!-- BEGIN flash --><object classid="clsid:D27CDB6E-AE6D-11CF-96B8-444553540000" codebase="http://active.macromedia.com/flash2/cabs/swflash.cab#version=5,0,0,0" width="{WIDTH}" height="{HEIGHT}"><param name="movie" value="{URL}" /><param name="play" value="false" /><param name="loop" value="false" /><param name="quality" value="high" /><param name="allowScriptAccess" value="never" /><param name="allowNetworking" value="internal" /><embed src="{URL}" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" width="{WIDTH}" height="{HEIGHT}" play="false" loop="false" quality="high" allowscriptaccess="never" allownetworking="internal"></embed></object><!-- END flash --> \ No newline at end of file
+<!-- BEGIN flash --><object classid="clsid:D27CDB6E-AE6D-11CF-96B8-444553540000" codebase="http://active.macromedia.com/flash2/cabs/swflash.cab#version=5,0,0,0" width="{WIDTH}" height="{HEIGHT}"><param name="movie" value="{URL}" /><param name="play" value="false" /><param name="loop" value="false" /><param name="quality" value="high" /><param name="allowScriptAccess" value="never" /><param name="allowNetworking" value="internal" /><embed src="{URL}" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" width="{WIDTH}" height="{HEIGHT}" play="false" loop="false" quality="high" allowscriptaccess="never" allownetworking="internal"></embed></object><!-- END flash -->
diff --git a/phpBB/styles/prosilver/template/captcha_default.html b/phpBB/styles/prosilver/template/captcha_default.html
index bccf231251..02899bcafd 100644
--- a/phpBB/styles/prosilver/template/captcha_default.html
+++ b/phpBB/styles/prosilver/template/captcha_default.html
@@ -1,16 +1,16 @@
<!-- IF S_TYPE == 1 -->
-<div class="panel">
- <div class="inner"><span class="corners-top"><span></span></span>
+<div class="panel captcha-panel">
+ <div class="inner">
- <h3>{L_CONFIRMATION}</h3>
+ <h3 class="captcha-title">{L_CONFIRMATION}</h3>
<p>{L_CONFIRM_EXPLAIN}</p>
<fieldset class="fields2">
<!-- ENDIF -->
<dl>
- <dt><label for="confirm_code">{L_CONFIRM_CODE}:</label></dt>
- <dd><img src="{CONFIRM_IMAGE_LINK}" alt="{L_CONFIRM_CODE}" /></dd>
+ <dt><label for="confirm_code">{L_CONFIRM_CODE}{L_COLON}</label></dt>
+ <dd class="captcha captcha-image"><img src="{CONFIRM_IMAGE_LINK}" alt="{L_CONFIRM_CODE}" /></dd>
<dd><input type="text" name="confirm_code" id="confirm_code" size="8" maxlength="8" tabindex="{$CAPTCHA_TAB_INDEX}" class="inputbox narrow" title="{L_CONFIRM_CODE}" />
<!-- IF S_CONFIRM_REFRESH --><input type="submit" name="refresh_vc" id="refresh_vc" class="button2" value="{L_VC_REFRESH}" /><!-- ENDIF -->
<input type="hidden" name="confirm_id" id="confirm_id" value="{CONFIRM_ID}" /></dd>
@@ -19,6 +19,6 @@
<!-- IF S_TYPE == 1 -->
</fieldset>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<!-- ENDIF -->
diff --git a/phpBB/styles/prosilver/template/captcha_qa.html b/phpBB/styles/prosilver/template/captcha_qa.html
index 0b18ada3bb..b8c6678066 100644
--- a/phpBB/styles/prosilver/template/captcha_qa.html
+++ b/phpBB/styles/prosilver/template/captcha_qa.html
@@ -1,14 +1,14 @@
<!-- IF S_TYPE == 1 -->
-<div class="panel">
- <div class="inner"><span class="corners-top"><span></span></span>
+<div class="panel captcha-panel">
+ <div class="inner">
- <h3>{L_CONFIRMATION}</h3>
+ <h3 class="captcha-title">{L_CONFIRMATION}</h3>
<fieldset class="fields2">
<!-- ENDIF -->
<dl>
- <dt><label>{QA_CONFIRM_QUESTION}:</label><br /><span>{L_CONFIRM_QUESTION_EXPLAIN}</span></dt>
- <dd>
+ <dt><label>{QA_CONFIRM_QUESTION}{L_COLON}</label><br /><span>{L_CONFIRM_QUESTION_EXPLAIN}</span></dt>
+ <dd class="captcha">
<input type="text" tabindex="{$CAPTCHA_TAB_INDEX}" name="qa_answer" id="answer" size="45" class="inputbox autowidth" title="{L_ANSWER}" />
<input type="hidden" name="qa_confirm_id" id="qa_confirm_id" value="{QA_CONFIRM_ID}" />
</dd>
@@ -16,6 +16,6 @@
<!-- IF S_TYPE == 1 -->
</fieldset>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<!-- ENDIF -->
diff --git a/phpBB/styles/prosilver/template/captcha_recaptcha.html b/phpBB/styles/prosilver/template/captcha_recaptcha.html
index 51a1615bd5..fee0f7423e 100644
--- a/phpBB/styles/prosilver/template/captcha_recaptcha.html
+++ b/phpBB/styles/prosilver/template/captcha_recaptcha.html
@@ -1,8 +1,8 @@
<!-- IF S_TYPE == 1 -->
-<div class="panel">
- <div class="inner"><span class="corners-top"><span></span></span>
+<div class="panel captcha-panel">
+ <div class="inner">
- <h3>{L_CONFIRMATION}</h3>
+ <h3 class="captcha-title">{L_CONFIRMATION}</h3>
<p>{L_CONFIRM_EXPLAIN}</p>
<fieldset class="fields2">
@@ -10,25 +10,17 @@
<!-- IF S_RECAPTCHA_AVAILABLE -->
<dl>
- <dt><label>{L_CONFIRM_CODE}</label>:<br /><span>{L_RECAPTCHA_EXPLAIN}</span></dt>
- <dd>
- <script type="text/javascript">
- // <![CDATA[
+ <dt><label>{L_CONFIRM_CODE}{L_COLON}</label><br /><span>{L_RECAPTCHA_EXPLAIN}</span></dt>
+ <dd class="captcha">
+ <script>
var RecaptchaOptions = {
lang : '{LA_RECAPTCHA_LANG}',
theme : 'clean',
tabindex : <!-- IF $CAPTCHA_TAB_INDEX -->{$CAPTCHA_TAB_INDEX}<!-- ELSE -->10<!-- ENDIF -->
};
- // ]]>
- </script>
- <script type="text/javascript" src="{RECAPTCHA_SERVER}/challenge?k={RECAPTCHA_PUBKEY}{RECAPTCHA_ERRORGET}"></script>
- <script type="text/javascript">
- // <![CDATA[
- <!-- IF S_CONTENT_DIRECTION eq 'rtl' -->
- document.getElementById('recaptcha_table').style.direction = 'ltr';
- <!-- ENDIF -->
- // ]]>
</script>
+ <script src="{RECAPTCHA_SERVER}/challenge?k={RECAPTCHA_PUBKEY}{RECAPTCHA_ERRORGET}"></script>
+
<noscript>
<div>
<object data="{RECAPTCHA_SERVER}/noscript?k={RECAPTCHA_PUBKEY}{RECAPTCHA_ERRORGET}" type="text/html" height="300" width="500"></object><br />
@@ -37,6 +29,7 @@
</div>
</noscript>
+ <a href="http://www.google.com/intl/{LA_RECAPTCHA_LANG}/policies/" target="_blank" class="recaptcha-responsive" style="display: none"><img alt="" width="71" height="36" src="{RECAPTCHA_SERVER}/img/clean/logo.png"></a>
</dd>
</dl>
<!-- ELSE -->
@@ -45,6 +38,6 @@
<!-- IF S_TYPE == 1 -->
</fieldset>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<!-- ENDIF -->
diff --git a/phpBB/styles/prosilver/template/confirm_body.html b/phpBB/styles/prosilver/template/confirm_body.html
index 5b783915a4..aaea5cfd05 100644
--- a/phpBB/styles/prosilver/template/confirm_body.html
+++ b/phpBB/styles/prosilver/template/confirm_body.html
@@ -1,20 +1,35 @@
+<!-- IF S_AJAX_REQUEST -->
+ <form action="{S_CONFIRM_ACTION}" method="post">
+ <h3>{MESSAGE_TITLE}</h3>
+ <p>{MESSAGE_TEXT}</p>
+
+ <fieldset class="submit-buttons">
+ <input type="button" name="confirm" value="{L_YES}" class="button2" />&nbsp;
+ <input type="button" name="cancel" value="{L_NO}" class="button2" />
+ </fieldset>
+ </form>
+
+<!-- ELSE -->
+
<!-- INCLUDE overall_header.html -->
<form id="confirm" action="{S_CONFIRM_ACTION}" method="post">
<div class="panel">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
- <h2>{MESSAGE_TITLE}</h2>
+ <h2 class="message-title">{MESSAGE_TITLE}</h2>
<p>{MESSAGE_TEXT}</p>
-
+
<fieldset class="submit-buttons">
{S_HIDDEN_FIELDS}
- <input type="submit" name="confirm" value="{L_YES}" class="button2" />&nbsp;
+ <input type="submit" name="confirm" value="{L_YES}" class="button2" />&nbsp;
<input type="submit" name="cancel" value="{L_NO}" class="button2" />
</fieldset>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
</form>
<!-- INCLUDE overall_footer.html -->
+
+<!-- ENDIF -->
diff --git a/phpBB/styles/prosilver/template/confirm_delete_body.html b/phpBB/styles/prosilver/template/confirm_delete_body.html
new file mode 100644
index 0000000000..fbd881a940
--- /dev/null
+++ b/phpBB/styles/prosilver/template/confirm_delete_body.html
@@ -0,0 +1,70 @@
+<!-- IF S_AJAX_REQUEST -->
+ <form action="{S_CONFIRM_ACTION}" method="post">
+ <p>{MESSAGE_TEXT}</p>
+
+ <!-- IF not S_SHADOW_TOPICS -->
+ <!-- IF not S_SOFTDELETED and S_ALLOWED_DELETE and S_ALLOWED_SOFTDELETE -->
+ <label>
+ <strong>{L_DELETE_PERMANENTLY}{L_COLON}</strong>
+ <input id="delete_permanent" name="delete_permanent" type="checkbox" value="1" {S_CHECKED_PERMANENT} />
+ <!-- IF S_TOPIC_MODE -->{DELETE_TOPIC_PERMANENTLY_EXPLAIN}<!-- ELSE -->{DELETE_POST_PERMANENTLY_EXPLAIN}<!-- ENDIF -->
+ </label>
+ <!-- ENDIF -->
+
+ <label for="delete_reason">
+ <strong>{L_DELETE_REASON}{L_COLON}</strong><br /><span>{L_DELETE_REASON_EXPLAIN}</span><br />
+ <input type="text" name="delete_reason" value="" class="inputbox autowidth" maxlength="120" size="45" />
+ </label>
+ <!-- ENDIF -->
+
+ <fieldset class="submit-buttons">
+ <input type="button" name="confirm" value="{L_YES}" class="button1" />&nbsp;
+ <input type="button" name="cancel" value="{L_NO}" class="button2" />
+ </fieldset>
+ </form>
+
+<!-- ELSE -->
+
+<!-- INCLUDE overall_header.html -->
+
+<form id="confirm" action="{S_CONFIRM_ACTION}" method="post">
+<div class="panel">
+ <div class="inner">
+
+ <h2 class="message-title">{MESSAGE_TITLE}</h2>
+
+ <p>{MESSAGE_TEXT}</p>
+
+ <!-- IF not S_SHADOW_TOPICS -->
+ <fieldset class="fields1">
+ <!-- IF not S_SOFTDELETED and S_ALLOWED_DELETE and S_ALLOWED_SOFTDELETE -->
+ <dl>
+ <dt><label for="delete_permanent">{L_DELETE_PERMANENTLY}{L_COLON}</label></dt>
+ <dd>
+ <label for="delete_permanent">
+ <input id="delete_permanent" name="delete_permanent" type="checkbox" value="1" {S_CHECKED_PERMANENT} />
+ <!-- IF S_TOPIC_MODE -->{DELETE_TOPIC_PERMANENTLY_EXPLAIN}<!-- ELSE -->{DELETE_POST_PERMANENTLY_EXPLAIN}<!-- ENDIF -->
+ </label>
+ </dd>
+ </dl>
+ <!-- ENDIF -->
+
+ <dl>
+ <dt><label for="delete_reason">{L_DELETE_REASON}{L_COLON}</label><br /><span>{L_DELETE_REASON_EXPLAIN}</span></dt>
+ <dd><input type="text" name="delete_reason" id="delete_reason" value="" class="inputbox autowidth" maxlength="120" size="45" /></dd>
+ </dl>
+ </fieldset>
+ <!-- ENDIF -->
+
+ <fieldset class="submit-buttons">
+ {S_HIDDEN_FIELDS}
+ <input type="submit" name="confirm" value="{L_YES}" class="button1" />&nbsp;
+ <input type="submit" name="cancel" value="{L_NO}" class="button2" />
+ </fieldset>
+
+ </div>
+</div>
+</form>
+
+<!-- INCLUDE overall_footer.html -->
+<!-- ENDIF -->
diff --git a/phpBB/styles/prosilver/template/custom_profile_fields.html b/phpBB/styles/prosilver/template/custom_profile_fields.html
deleted file mode 100644
index 44c68f532b..0000000000
--- a/phpBB/styles/prosilver/template/custom_profile_fields.html
+++ /dev/null
@@ -1,31 +0,0 @@
-<!-- BEGIN dropdown -->
-<select name="{dropdown.FIELD_IDENT}" id="{dropdown.FIELD_IDENT}">
- <!-- BEGIN options --><option value="{dropdown.options.OPTION_ID}"{dropdown.options.SELECTED}>{dropdown.options.VALUE}</option><!-- END options -->
-</select>
-<!-- END dropdown -->
-
-<!-- BEGIN text -->
-<textarea name="{text.FIELD_IDENT}" id="{text.FIELD_IDENT}" rows="{text.FIELD_ROWS}" cols="{text.FIELD_COLS}" class="inputbox autowidth">{text.FIELD_VALUE}</textarea>
-<!-- END text -->
-
-<!-- BEGIN string -->
-<input type="text" class="inputbox autowidth" name="{string.FIELD_IDENT}" id="{string.FIELD_IDENT}" size="{string.FIELD_LENGTH}" maxlength="{string.FIELD_MAXLEN}" value="{string.FIELD_VALUE}" />
-<!-- END string -->
-
-<!-- BEGIN bool -->
-<!-- IF bool.FIELD_LENGTH eq 1 -->
- <!-- BEGIN options --><label for="{bool.FIELD_IDENT}_{bool.options.OPTION_ID}"><input type="radio" class="radio" name="{bool.FIELD_IDENT}" id="{bool.FIELD_IDENT}_{bool.options.OPTION_ID}" value="{bool.options.OPTION_ID}"{bool.options.CHECKED} /> {bool.options.VALUE}</label> <!-- END options -->
-<!-- ELSE -->
- <input type="checkbox" class="radio" name="{bool.FIELD_IDENT}" id="{bool.FIELD_IDENT}"<!-- IF bool.FIELD_VALUE --> checked="checked"<!-- ENDIF --> />
-<!-- ENDIF -->
-<!-- END bool -->
-
-<!-- BEGIN int -->
-<input type="text" class="inputbox autowidth" name="{int.FIELD_IDENT}" id="{int.FIELD_IDENT}" size="{int.FIELD_LENGTH}" value="{int.FIELD_VALUE}" />
-<!-- END int -->
-
-<!-- BEGIN date -->
-<label for="{date.FIELD_IDENT}_day">{L_DAY}: <select name="{date.FIELD_IDENT}_day" id="{date.FIELD_IDENT}_day">{date.S_DAY_OPTIONS}</select></label>
-<label for="{date.FIELD_IDENT}_month">{L_MONTH}: <select name="{date.FIELD_IDENT}_month" id="{date.FIELD_IDENT}_month">{date.S_MONTH_OPTIONS}</select></label>
-<label for="{date.FIELD_IDENT}_year">{L_YEAR}: <select name="{date.FIELD_IDENT}_year" id="{date.FIELD_IDENT}_year">{date.S_YEAR_OPTIONS}</select></label>
-<!-- END date -->
diff --git a/phpBB/styles/prosilver/template/drafts.html b/phpBB/styles/prosilver/template/drafts.html
index dea3bb414e..ea2849a485 100644
--- a/phpBB/styles/prosilver/template/drafts.html
+++ b/phpBB/styles/prosilver/template/drafts.html
@@ -2,43 +2,48 @@
<!-- IF .draftrow -->
<div class="panel">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
- <h3>{L_LOAD_DRAFT}</h3>
+ <h3 class="draft-title">{L_LOAD_DRAFT}</h3>
<p>{L_LOAD_DRAFT_EXPLAIN}</p>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<div class="<!-- IF not S_PRIVMSGS -->forumbg<!-- ELSE -->panel<!-- ENDIF -->">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
- <ul class="topiclist">
+ <ul class="topiclist two-long-columns">
<li class="header">
<dl>
<dt>{L_LOAD_DRAFT}</dt>
- <dd class="posted">{L_SAVE_DATE}</dd>
+ <dd class="info">{L_SAVE_DATE}</dd>
</dl>
</li>
</ul>
- <ul class="topiclist<!-- IF not S_PRIVMSGS --> topics<!-- ELSE --> cplist<!-- ENDIF -->">
+ <ul class="topiclist two-long-columns<!-- IF not S_PRIVMSGS --> topics<!-- ELSE --> cplist<!-- ENDIF -->">
<!-- BEGIN draftrow -->
<li class="row<!-- IF draftrow.S_ROW_COUNT is even --> bg1<!-- ELSE --> bg2<!-- ENDIF -->">
<dl>
<dt>
- <a href="{draftrow.U_INSERT}" title="{L_LOAD_DRAFT}" class="topictitle">{draftrow.DRAFT_SUBJECT}</a><br />
- <!-- IF not S_PRIVMSGS --><!-- IF draftrow.S_LINK_TOPIC -->{L_TOPIC}: <a href="{draftrow.U_VIEW}">{draftrow.TITLE}</a>
- <!-- ELSEIF draftrow.S_LINK_FORUM -->{L_FORUM}: <a href="{draftrow.U_VIEW}">{draftrow.TITLE}</a>
- <!-- ELSE -->{L_NO_TOPIC_FORUM}<!-- ENDIF --><!-- ENDIF -->
+ <div class="list-inner">
+ <a href="{draftrow.U_INSERT}" title="{L_LOAD_DRAFT}" class="topictitle">{draftrow.DRAFT_SUBJECT}</a><br />
+ <!-- IF not S_PRIVMSGS --><!-- IF draftrow.S_LINK_TOPIC -->{L_TOPIC}{L_COLON} <a href="{draftrow.U_VIEW}">{draftrow.TITLE}</a>
+ <!-- ELSEIF draftrow.S_LINK_FORUM -->{L_FORUM}{L_COLON} <a href="{draftrow.U_VIEW}">{draftrow.TITLE}</a>
+ <!-- ELSE -->{L_NO_TOPIC_FORUM}<!-- ENDIF --><!-- ENDIF -->
+ <div class="responsive-show" style="display: none;">
+ {L_SAVE_DATE}{L_COLON} <strong>{draftrow.DATE}</strong>
+ </div>
+ </div>
</dt>
- <dd class="posted">{draftrow.DATE}</dd>
+ <dd class="info"><span>{draftrow.DATE}</span></dd>
</dl>
</li>
<!-- END draftrow -->
</ul>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<!-- ENDIF -->
diff --git a/phpBB/styles/prosilver/template/editor.js b/phpBB/styles/prosilver/template/editor.js
deleted file mode 100644
index 42be70be92..0000000000
--- a/phpBB/styles/prosilver/template/editor.js
+++ /dev/null
@@ -1,459 +0,0 @@
-/**
-* bbCode control by subBlue design [ www.subBlue.com ]
-* Includes unixsafe colour palette selector by SHS`
-*/
-
-// Startup variables
-var imageTag = false;
-var theSelection = false;
-
-var bbcodeEnabled = true;
-// Check for Browser & Platform for PC & IE specific bits
-// More details from: http://www.mozilla.org/docs/web-developer/sniffer/browser_type.html
-var clientPC = navigator.userAgent.toLowerCase(); // Get client info
-var clientVer = parseInt(navigator.appVersion); // Get browser version
-
-var is_ie = ((clientPC.indexOf('msie') != -1) && (clientPC.indexOf('opera') == -1));
-var is_win = ((clientPC.indexOf('win') != -1) || (clientPC.indexOf('16bit') != -1));
-var baseHeight;
-
-/**
-* Shows the help messages in the helpline window
-*/
-function helpline(help)
-{
- document.forms[form_name].helpbox.value = help_line[help];
-}
-
-/**
-* Fix a bug involving the TextRange object. From
-* http://www.frostjedi.com/terra/scripts/demo/caretBug.html
-*/
-function initInsertions()
-{
- var doc;
-
- if (document.forms[form_name])
- {
- doc = document;
- }
- else
- {
- doc = opener.document;
- }
-
- var textarea = doc.forms[form_name].elements[text_name];
-
- if (is_ie && typeof(baseHeight) != 'number')
- {
- textarea.focus();
- baseHeight = doc.selection.createRange().duplicate().boundingHeight;
-
- if (!document.forms[form_name])
- {
- document.body.focus();
- }
- }
-}
-
-/**
-* bbstyle
-*/
-function bbstyle(bbnumber)
-{
- if (bbnumber != -1)
- {
- bbfontstyle(bbtags[bbnumber], bbtags[bbnumber+1]);
- }
- else
- {
- insert_text('[*]');
- document.forms[form_name].elements[text_name].focus();
- }
-}
-
-/**
-* Apply bbcodes
-*/
-function bbfontstyle(bbopen, bbclose)
-{
- theSelection = false;
-
- var textarea = document.forms[form_name].elements[text_name];
-
- textarea.focus();
-
- if ((clientVer >= 4) && is_ie && is_win)
- {
- // Get text selection
- theSelection = document.selection.createRange().text;
-
- if (theSelection)
- {
- // Add tags around selection
- document.selection.createRange().text = bbopen + theSelection + bbclose;
- document.forms[form_name].elements[text_name].focus();
- theSelection = '';
- return;
- }
- }
- else if (document.forms[form_name].elements[text_name].selectionEnd && (document.forms[form_name].elements[text_name].selectionEnd - document.forms[form_name].elements[text_name].selectionStart > 0))
- {
- mozWrap(document.forms[form_name].elements[text_name], bbopen, bbclose);
- document.forms[form_name].elements[text_name].focus();
- theSelection = '';
- return;
- }
-
- //The new position for the cursor after adding the bbcode
- var caret_pos = getCaretPosition(textarea).start;
- var new_pos = caret_pos + bbopen.length;
-
- // Open tag
- insert_text(bbopen + bbclose);
-
- // Center the cursor when we don't have a selection
- // Gecko and proper browsers
- if (!isNaN(textarea.selectionStart))
- {
- textarea.selectionStart = new_pos;
- textarea.selectionEnd = new_pos;
- }
- // IE
- else if (document.selection)
- {
- var range = textarea.createTextRange();
- range.move("character", new_pos);
- range.select();
- storeCaret(textarea);
- }
-
- textarea.focus();
- return;
-}
-
-/**
-* Insert text at position
-*/
-function insert_text(text, spaces, popup)
-{
- var textarea;
-
- if (!popup)
- {
- textarea = document.forms[form_name].elements[text_name];
- }
- else
- {
- textarea = opener.document.forms[form_name].elements[text_name];
- }
- if (spaces)
- {
- text = ' ' + text + ' ';
- }
-
- // Since IE9, IE also has textarea.selectionStart, but it still needs to be treated the old way.
- // Therefore we simply add a !is_ie here until IE fixes the text-selection completely.
- if (!isNaN(textarea.selectionStart) && !is_ie)
- {
- var sel_start = textarea.selectionStart;
- var sel_end = textarea.selectionEnd;
-
- mozWrap(textarea, text, '');
- textarea.selectionStart = sel_start + text.length;
- textarea.selectionEnd = sel_end + text.length;
- }
- else if (textarea.createTextRange && textarea.caretPos)
- {
- if (baseHeight != textarea.caretPos.boundingHeight)
- {
- textarea.focus();
- storeCaret(textarea);
- }
-
- var caret_pos = textarea.caretPos;
- caret_pos.text = caret_pos.text.charAt(caret_pos.text.length - 1) == ' ' ? caret_pos.text + text + ' ' : caret_pos.text + text;
- }
- else
- {
- textarea.value = textarea.value + text;
- }
- if (!popup)
- {
- textarea.focus();
- }
-}
-
-/**
-* Add inline attachment at position
-*/
-function attach_inline(index, filename)
-{
- insert_text('[attachment=' + index + ']' + filename + '[/attachment]');
- document.forms[form_name].elements[text_name].focus();
-}
-
-/**
-* Add quote text to message
-*/
-function addquote(post_id, username, l_wrote)
-{
- var message_name = 'message_' + post_id;
- var theSelection = '';
- var divarea = false;
-
- if (l_wrote === undefined)
- {
- // Backwards compatibility
- l_wrote = 'wrote';
- }
-
- if (document.all)
- {
- divarea = document.all[message_name];
- }
- else
- {
- divarea = document.getElementById(message_name);
- }
-
- // Get text selection - not only the post content :(
- // IE9 must use the document.selection method but has the *.getSelection so we just force no IE
- if (window.getSelection && !is_ie && !window.opera)
- {
- theSelection = window.getSelection().toString();
- }
- else if (document.getSelection && !is_ie)
- {
- theSelection = document.getSelection();
- }
- else if (document.selection)
- {
- theSelection = document.selection.createRange().text;
- }
-
- if (theSelection == '' || typeof theSelection == 'undefined' || theSelection == null)
- {
- if (divarea.innerHTML)
- {
- theSelection = divarea.innerHTML.replace(/<br>/ig, '\n');
- theSelection = theSelection.replace(/<br\/>/ig, '\n');
- theSelection = theSelection.replace(/&lt\;/ig, '<');
- theSelection = theSelection.replace(/&gt\;/ig, '>');
- theSelection = theSelection.replace(/&amp\;/ig, '&');
- theSelection = theSelection.replace(/&nbsp\;/ig, ' ');
- }
- else if (document.all)
- {
- theSelection = divarea.innerText;
- }
- else if (divarea.textContent)
- {
- theSelection = divarea.textContent;
- }
- else if (divarea.firstChild.nodeValue)
- {
- theSelection = divarea.firstChild.nodeValue;
- }
- }
-
- if (theSelection)
- {
- if (bbcodeEnabled)
- {
- insert_text('[quote="' + username + '"]' + theSelection + '[/quote]');
- }
- else
- {
- insert_text(username + ' ' + l_wrote + ':' + '\n');
- var lines = split_lines(theSelection);
- for (i = 0; i < lines.length; i++)
- {
- insert_text('> ' + lines[i] + '\n');
- }
- }
- }
-
- return;
-}
-
-function split_lines(text)
-{
- var lines = text.split('\n');
- var splitLines = new Array();
- var j = 0;
- for(i = 0; i < lines.length; i++)
- {
- if (lines[i].length <= 80)
- {
- splitLines[j] = lines[i];
- j++;
- }
- else
- {
- var line = lines[i];
- do
- {
- var splitAt = line.indexOf(' ', 80);
-
- if (splitAt == -1)
- {
- splitLines[j] = line;
- j++;
- }
- else
- {
- splitLines[j] = line.substring(0, splitAt);
- line = line.substring(splitAt);
- j++;
- }
- }
- while(splitAt != -1);
- }
- }
- return splitLines;
-}
-/**
-* From http://www.massless.org/mozedit/
-*/
-function mozWrap(txtarea, open, close)
-{
- var selLength = (typeof(txtarea.textLength) == 'undefined') ? txtarea.value.length : txtarea.textLength;
- var selStart = txtarea.selectionStart;
- var selEnd = txtarea.selectionEnd;
- var scrollTop = txtarea.scrollTop;
-
- if (selEnd == 1 || selEnd == 2)
- {
- selEnd = selLength;
- }
-
- var s1 = (txtarea.value).substring(0,selStart);
- var s2 = (txtarea.value).substring(selStart, selEnd);
- var s3 = (txtarea.value).substring(selEnd, selLength);
-
- txtarea.value = s1 + open + s2 + close + s3;
- txtarea.selectionStart = selStart + open.length;
- txtarea.selectionEnd = selEnd + open.length;
- txtarea.focus();
- txtarea.scrollTop = scrollTop;
-
- return;
-}
-
-/**
-* Insert at Caret position. Code from
-* http://www.faqts.com/knowledge_base/view.phtml/aid/1052/fid/130
-*/
-function storeCaret(textEl)
-{
- if (textEl.createTextRange && document.selection)
- {
- textEl.caretPos = document.selection.createRange().duplicate();
- }
-}
-
-/**
-* Color pallette
-*/
-function colorPalette(dir, width, height)
-{
- var r = 0, g = 0, b = 0;
- var numberList = new Array(6);
- var color = '';
-
- numberList[0] = '00';
- numberList[1] = '40';
- numberList[2] = '80';
- numberList[3] = 'BF';
- numberList[4] = 'FF';
-
- document.writeln('<table cellspacing="1" cellpadding="0" border="0">');
-
- for (r = 0; r < 5; r++)
- {
- if (dir == 'h')
- {
- document.writeln('<tr>');
- }
-
- for (g = 0; g < 5; g++)
- {
- if (dir == 'v')
- {
- document.writeln('<tr>');
- }
-
- for (b = 0; b < 5; b++)
- {
- color = String(numberList[r]) + String(numberList[g]) + String(numberList[b]);
- document.write('<td bgcolor="#' + color + '" style="width: ' + width + 'px; height: ' + height + 'px;">');
- document.write('<a href="#" onclick="bbfontstyle(\'[color=#' + color + ']\', \'[/color]\'); return false;"><img src="images/spacer.gif" width="' + width + '" height="' + height + '" alt="#' + color + '" title="#' + color + '" /></a>');
- document.writeln('</td>');
- }
-
- if (dir == 'v')
- {
- document.writeln('</tr>');
- }
- }
-
- if (dir == 'h')
- {
- document.writeln('</tr>');
- }
- }
- document.writeln('</table>');
-}
-
-
-/**
-* Caret Position object
-*/
-function caretPosition()
-{
- var start = null;
- var end = null;
-}
-
-
-/**
-* Get the caret position in an textarea
-*/
-function getCaretPosition(txtarea)
-{
- var caretPos = new caretPosition();
-
- // simple Gecko/Opera way
- if(txtarea.selectionStart || txtarea.selectionStart == 0)
- {
- caretPos.start = txtarea.selectionStart;
- caretPos.end = txtarea.selectionEnd;
- }
- // dirty and slow IE way
- else if(document.selection)
- {
-
- // get current selection
- var range = document.selection.createRange();
-
- // a new selection of the whole textarea
- var range_all = document.body.createTextRange();
- range_all.moveToElementText(txtarea);
-
- // calculate selection start point by moving beginning of range_all to beginning of range
- var sel_start;
- for (sel_start = 0; range_all.compareEndPoints('StartToStart', range) < 0; sel_start++)
- {
- range_all.moveStart('character', 1);
- }
-
- txtarea.sel_start = sel_start;
-
- // we ignore the end value for IE, this is already dirty enough and we don't need it
- caretPos.start = txtarea.sel_start;
- caretPos.end = txtarea.sel_start;
- }
-
- return caretPos;
-}
diff --git a/phpBB/styles/prosilver/template/faq_body.html b/phpBB/styles/prosilver/template/faq_body.html
index 36d677a505..53205d14e9 100644
--- a/phpBB/styles/prosilver/template/faq_body.html
+++ b/phpBB/styles/prosilver/template/faq_body.html
@@ -1,10 +1,10 @@
<!-- INCLUDE overall_header.html -->
-<h2>{L_FAQ_TITLE}</h2>
+<h2 class="faq-title">{L_FAQ_TITLE}</h2>
<div class="panel bg1" id="faqlinks">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div class="column1">
<!-- BEGIN faq_block -->
<!-- IF faq_block.SWITCH_COLUMN or (SWITCH_COLUMN_MANUALLY and faq_block.S_ROW_COUNT == 4) -->
@@ -21,19 +21,15 @@
</dl>
<!-- END faq_block -->
</div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
-
-
-<div class="clear"></div>
-
<!-- BEGIN faq_block -->
<div class="panel <!-- IF faq_block.S_ROW_COUNT is odd -->bg1<!-- ELSE -->bg2<!-- ENDIF -->">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div class="content">
- <h2>{faq_block.BLOCK_TITLE}</h2>
+ <h2 class="faq-title">{faq_block.BLOCK_TITLE}</h2>
<!-- BEGIN faq_row -->
<dl class="faq">
<dt id="f{faq_block.S_ROW_COUNT}r{faq_block.faq_row.S_ROW_COUNT}"><strong>{faq_block.faq_row.FAQ_QUESTION}</strong></dt>
@@ -44,7 +40,7 @@
<!-- END faq_row -->
</div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<!-- END faq_block -->
diff --git a/phpBB/styles/prosilver/template/forum_fn.js b/phpBB/styles/prosilver/template/forum_fn.js
index 6a65caf6f6..d779008f80 100644
--- a/phpBB/styles/prosilver/template/forum_fn.js
+++ b/phpBB/styles/prosilver/template/forum_fn.js
@@ -1,14 +1,26 @@
+/* global phpbb */
+
/**
* phpBB3 forum functions
*/
/**
+* Find a member
+*/
+function find_username(url) {
+ 'use strict';
+
+ popup(url, 760, 570, '_usersearch');
+ return false;
+}
+
+/**
* Window popup
*/
-function popup(url, width, height, name)
-{
- if (!name)
- {
+function popup(url, width, height, name) {
+ 'use strict';
+
+ if (!name) {
name = '_popup';
}
@@ -19,19 +31,19 @@ function popup(url, width, height, name)
/**
* Jump to page
*/
-function jumpto()
-{
- var page = prompt(jump_page, on_page);
-
- if (page !== null && !isNaN(page) && page == Math.floor(page) && page > 0)
- {
- if (base_url.indexOf('?') == -1)
- {
- document.location.href = base_url + '?start=' + ((page - 1) * per_page);
- }
- else
- {
- document.location.href = base_url.replace(/&amp;/g, '&') + '&start=' + ((page - 1) * per_page);
+function pageJump(item) {
+ 'use strict';
+
+ var page = parseInt(item.val(), 10),
+ perPage = item.attr('data-per-page'),
+ baseUrl = item.attr('data-base-url'),
+ startName = item.attr('data-start-name');
+
+ if (page !== null && !isNaN(page) && page === Math.floor(page) && page > 0) {
+ if (baseUrl.indexOf('?') === -1) {
+ document.location.href = baseUrl + '?' + startName + '=' + ((page - 1) * perPage);
+ } else {
+ document.location.href = baseUrl.replace(/&amp;/g, '&') + '&' + startName + '=' + ((page - 1) * perPage);
}
}
}
@@ -40,53 +52,40 @@ function jumpto()
* Mark/unmark checklist
* id = ID of parent container, name = name prefix, state = state [true/false]
*/
-function marklist(id, name, state)
-{
- var parent = document.getElementById(id);
- if (!parent)
- {
- eval('parent = document.' + id);
- }
+function marklist(id, name, state) {
+ 'use strict';
- if (!parent)
- {
- return;
- }
-
- var rb = parent.getElementsByTagName('input');
-
- for (var r = 0; r < rb.length; r++)
- {
- if (rb[r].name.substr(0, name.length) == name)
- {
- rb[r].checked = state;
+ jQuery('#' + id + ' input[type=checkbox][name]').each(function() {
+ var $this = jQuery(this);
+ if ($this.attr('name').substr(0, name.length) === name && !$this.prop('disabled')) {
+ $this.prop('checked', state);
}
- }
+ });
}
/**
* Resize viewable area for attached image or topic review panel (possibly others to come)
* e = element
*/
-function viewableArea(e, itself)
-{
- if (!e) return;
- if (!itself)
- {
+function viewableArea(e, itself) {
+ 'use strict';
+
+ if (!e) {
+ return;
+ }
+
+ if (!itself) {
e = e.parentNode;
}
-
- if (!e.vaHeight)
- {
+
+ if (!e.vaHeight) {
// Store viewable area height before changing style to auto
e.vaHeight = e.offsetHeight;
e.vaMaxHeight = e.style.maxHeight;
e.style.height = 'auto';
e.style.maxHeight = 'none';
e.style.overflow = 'visible';
- }
- else
- {
+ } else {
// Restore viewable area height to the default
e.style.height = e.vaHeight + 'px';
e.style.overflow = 'auto';
@@ -96,147 +95,100 @@ function viewableArea(e, itself)
}
/**
-* Set display of page element
-* s[-1,0,1] = hide,toggle display,show
-* type = string: inline, block, inline-block or other CSS "display" type
-*/
-function dE(n, s, type)
-{
- if (!type)
- {
- type = 'block';
- }
-
- var e = document.getElementById(n);
- if (!s)
- {
- s = (e.style.display == '' || e.style.display == type) ? -1 : 1;
- }
- e.style.display = (s == 1) ? type : 'none';
-}
-
-/**
* Alternate display of subPanels
*/
-function subPanels(p)
-{
- var i, e, t;
+jQuery(function($) {
+ 'use strict';
- if (typeof(p) == 'string')
- {
- show_panel = p;
- }
+ $('.sub-panels').each(function() {
- for (i = 0; i < panels.length; i++)
- {
- e = document.getElementById(panels[i]);
- t = document.getElementById(panels[i] + '-tab');
-
- if (e)
- {
- if (panels[i] == show_panel)
- {
- e.style.display = 'block';
- if (t)
- {
- t.className = 'activetab';
- }
- }
- else
- {
- e.style.display = 'none';
- if (t)
- {
- t.className = '';
- }
- }
+ var $childNodes = $('a[data-subpanel]', this),
+ panels = $childNodes.map(function () {
+ return this.getAttribute('data-subpanel');
+ }),
+ showPanel = this.getAttribute('data-show-panel');
+
+ if (panels.length) {
+ activateSubPanel(showPanel, panels);
+ $childNodes.click(function () {
+ activateSubPanel(this.getAttribute('data-subpanel'), panels);
+ return false;
+ });
}
- }
-}
+ });
+});
/**
-* Call print preview
+* Activate specific subPanel
*/
-function printPage()
-{
- if (is_ie)
- {
- printPreview();
- }
- else
- {
- window.print();
- }
-}
+function activateSubPanel(p, panels) {
+ 'use strict';
-/**
-* Show/hide groups of blocks
-* c = CSS style name
-* e = checkbox element
-* t = toggle dispay state (used to show 'grip-show' image in the profile block when hiding the profiles)
-*/
-function displayBlocks(c, e, t)
-{
- var s = (e.checked == true) ? 1 : -1;
+ var i, showPanel;
- if (t)
- {
- s *= -1;
+ if (typeof p === 'string') {
+ showPanel = p;
}
+ $('input[name="show_panel"]').val(showPanel);
- var divs = document.getElementsByTagName("DIV");
+ if (typeof panels === 'undefined') {
+ panels = jQuery('.sub-panels a[data-subpanel]').map(function() {
+ return this.getAttribute('data-subpanel');
+ });
+ }
- for (var d = 0; d < divs.length; d++)
- {
- if (divs[d].className.indexOf(c) == 0)
- {
- divs[d].style.display = (s == 1) ? 'none' : 'block';
- }
+ for (i = 0; i < panels.length; i++) {
+ jQuery('#' + panels[i]).css('display', panels[i] === showPanel ? 'block' : 'none');
+ jQuery('#' + panels[i] + '-tab').toggleClass('activetab', panels[i] === showPanel);
}
}
-function selectCode(a)
-{
+function selectCode(a) {
+ 'use strict';
+
// Get ID of code block
var e = a.parentNode.parentNode.getElementsByTagName('CODE')[0];
+ var s, r;
// Not IE and IE9+
- if (window.getSelection)
- {
- var s = window.getSelection();
- // Safari
- if (s.setBaseAndExtent)
- {
- s.setBaseAndExtent(e, 0, e, e.innerText.length - 1);
+ if (window.getSelection) {
+ s = window.getSelection();
+ // Safari and Chrome
+ if (s.setBaseAndExtent) {
+ var l = (e.innerText.length > 1) ? e.innerText.length - 1 : 1;
+ try {
+ s.setBaseAndExtent(e, 0, e, l);
+ } catch (error) {
+ r = document.createRange();
+ r.selectNodeContents(e);
+ s.removeAllRanges();
+ s.addRange(r);
+ }
}
// Firefox and Opera
- else
- {
+ else {
// workaround for bug # 42885
- if (window.opera && e.innerHTML.substring(e.innerHTML.length - 4) == '<BR>')
- {
+ if (window.opera && e.innerHTML.substring(e.innerHTML.length - 4) === '<BR>') {
e.innerHTML = e.innerHTML + '&nbsp;';
}
- var r = document.createRange();
+ r = document.createRange();
r.selectNodeContents(e);
s.removeAllRanges();
s.addRange(r);
}
}
// Some older browsers
- else if (document.getSelection)
- {
- var s = document.getSelection();
- var r = document.createRange();
+ else if (document.getSelection) {
+ s = document.getSelection();
+ r = document.createRange();
r.selectNodeContents(e);
s.removeAllRanges();
s.addRange(r);
}
// IE
- else if (document.selection)
- {
- var r = document.body.createTextRange();
+ else if (document.selection) {
+ r = document.body.createTextRange();
r.moveToElementText(e);
r.select();
}
@@ -246,25 +198,24 @@ function selectCode(a)
* Play quicktime file by determining it's width/height
* from the displayed rectangle area
*/
-function play_qt_file(obj)
-{
+function play_qt_file(obj) {
+ 'use strict';
+
var rectangle = obj.GetRectangle();
+ var width, height;
- if (rectangle)
- {
+ if (rectangle) {
rectangle = rectangle.split(',');
- var x1 = parseInt(rectangle[0]);
- var x2 = parseInt(rectangle[2]);
- var y1 = parseInt(rectangle[1]);
- var y2 = parseInt(rectangle[3]);
-
- var width = (x1 < 0) ? (x1 * -1) + x2 : x2 - x1;
- var height = (y1 < 0) ? (y1 * -1) + y2 : y2 - y1;
- }
- else
- {
- var width = 200;
- var height = 0;
+ var x1 = parseInt(rectangle[0], 10);
+ var x2 = parseInt(rectangle[2], 10);
+ var y1 = parseInt(rectangle[1], 10);
+ var y2 = parseInt(rectangle[3], 10);
+
+ width = (x1 < 0) ? (x1 * -1) + x2 : x2 - x1;
+ height = (y1 < 0) ? (y1 * -1) + y2 : y2 - y1;
+ } else {
+ width = 200;
+ height = 0;
}
obj.width = width;
@@ -274,81 +225,32 @@ function play_qt_file(obj)
obj.Play();
}
-/**
-* Check if the nodeName of elem is name
-* @author jQuery
-*/
-function is_node_name(elem, name)
-{
- return elem.nodeName && elem.nodeName.toUpperCase() == name.toUpperCase();
-}
-
-/**
-* Check if elem is in array, return position
-* @author jQuery
-*/
-function is_in_array(elem, array)
-{
- for (var i = 0, length = array.length; i < length; i++)
- // === is correct (IE)
- if (array[i] === elem)
- return i;
-
- return -1;
-}
-
-/**
-* Find Element, type and class in tree
-* Not used, but may come in handy for those not using JQuery
-* @author jQuery.find, Meik Sievertsen
-*/
-function find_in_tree(node, tag, type, class_name)
-{
- var result, element, i = 0, length = node.childNodes.length;
-
- for (element = node.childNodes[0]; i < length; element = node.childNodes[++i])
- {
- if (!element || element.nodeType != 1) continue;
-
- if ((!tag || is_node_name(element, tag)) && (!type || element.type == type) && (!class_name || is_in_array(class_name, (element.className || element).toString().split(/\s+/)) > -1))
- {
- return element;
- }
-
- if (element.childNodes.length)
- result = find_in_tree(element, tag, type, class_name);
-
- if (result) return result;
- }
-}
-
-var in_autocomplete = false;
-var last_key_entered = '';
+var inAutocomplete = false;
+var lastKeyEntered = '';
/**
* Check event key
*/
-function phpbb_check_key(event)
-{
+function phpbbCheckKey(event) {
+ 'use strict';
+
// Keycode is array down or up?
- if (event.keyCode && (event.keyCode == 40 || event.keyCode == 38))
- in_autocomplete = true;
+ if (event.keyCode && (event.keyCode === 40 || event.keyCode === 38)) {
+ inAutocomplete = true;
+ }
// Make sure we are not within an "autocompletion" field
- if (in_autocomplete)
- {
+ if (inAutocomplete) {
// If return pressed and key changed we reset the autocompletion
- if (!last_key_entered || last_key_entered == event.which)
- {
- in_autocompletion = false;
+ if (!lastKeyEntered || lastKeyEntered === event.which) {
+ inAutocomplete = false;
return true;
}
}
// Keycode is not return, then return. ;)
- if (event.which != 13)
- {
- last_key_entered = event.which;
+ if (event.which !== 13) {
+ lastKeyEntered = event.which;
return true;
}
@@ -356,88 +258,711 @@ function phpbb_check_key(event)
}
/**
-* Usually used for onkeypress event, to submit a form on enter
+* Apply onkeypress event for forcing default submit button on ENTER key press
*/
-function submit_default_button(event, selector, class_name)
-{
- // Add which for key events
- if (!event.which && ((event.charCode || event.charCode === 0) ? event.charCode : event.keyCode))
- event.which = event.charCode || event.keyCode;
+jQuery(function($) {
+ 'use strict';
+
+ $('form input[type=text], form input[type=password]').on('keypress', function (e) {
+ var defaultButton = $(this).parents('form').find('input[type=submit].default-submit-action');
+
+ if (!defaultButton || defaultButton.length <= 0) {
+ return true;
+ }
+
+ if (phpbbCheckKey(e)) {
+ return true;
+ }
+
+ if ((e.which && e.which === 13) || (e.keyCode && e.keyCode === 13)) {
+ defaultButton.click();
+ return false;
+ }
- if (phpbb_check_key(event))
return true;
+ });
+});
+
+/**
+* Functions for user search popup
+*/
+function insertUser(formId, value) {
+ 'use strict';
- var current = selector['parentNode'];
+ var $form = jQuery(formId),
+ formName = $form.attr('data-form-name'),
+ fieldName = $form.attr('data-field-name'),
+ item = opener.document.forms[formName][fieldName];
- // Search parent form element
- while (current && (!current.nodeName || current.nodeType != 1 || !is_node_name(current, 'form')) && current != document)
- current = current['parentNode'];
+ if (item.value.length && item.type === 'textarea') {
+ value = item.value + '\n' + value;
+ }
+
+ item.value = value;
+}
- // Find the input submit button with the class name
- //current = find_in_tree(current, 'input', 'submit', class_name);
- var input_tags = current.getElementsByTagName('input');
- current = false;
+function insert_marked_users(formId, users) {
+ 'use strict';
- for (var i = 0, element = input_tags[0]; i < input_tags.length; element = input_tags[++i])
- {
- if (element.type == 'submit' && is_in_array(class_name, (element.className || element).toString().split(/\s+/)) > -1)
- current = element;
+ for (var i = 0; i < users.length; i++) {
+ if (users[i].checked) {
+ insertUser(formId, users[i].value);
+ }
}
- if (!current)
- return true;
+ window.close();
+}
- // Submit form
- current.focus();
- current.click();
- return false;
+function insert_single_user(formId, user) {
+ 'use strict';
+
+ insertUser(formId, user);
+ window.close();
}
/**
-* Apply onkeypress event for forcing default submit button on ENTER key press
-* The jQuery snippet used is based on http://greatwebguy.com/programming/dom/default-html-button-submit-on-enter-with-jquery/
-* The non-jQuery code is a mimick of the jQuery code ;)
+* Parse document block
*/
-function apply_onkeypress_event()
-{
- // jQuery code in case jQuery is used
- if (jquery_present)
- {
- jQuery('form input[type=text], form input[type=password]').on('keypress', function (e)
- {
- var default_button = jQuery(this).parents('form').find('input[type=submit].default-submit-action');
-
- if (!default_button || default_button.length <= 0)
- return true;
-
- if (phpbb_check_key(e))
- return true;
-
- if ((e.which && e.which == 13) || (e.keyCode && e.keyCode == 13))
- {
- default_button.click();
- return false;
+function parseDocument($container) {
+ 'use strict';
+
+ var test = document.createElement('div'),
+ oldBrowser = (typeof test.style.borderRadius === 'undefined'),
+ $body = $('body');
+
+ /**
+ * Reset avatar dimensions when changing URL or EMAIL
+ */
+ $container.find('input[data-reset-on-edit]').on('keyup', function() {
+ $(this.getAttribute('data-reset-on-edit')).val('');
+ });
+
+ /**
+ * Pagination
+ */
+ $container.find('.pagination .page-jump-form :button').click(function() {
+ var $input = $(this).siblings('input.inputbox');
+ pageJump($input);
+ });
+
+ $container.find('.pagination .page-jump-form input.inputbox').on('keypress', function(event) {
+ if (event.which === 13 || event.keyCode === 13) {
+ event.preventDefault();
+ pageJump($(this));
+ }
+ });
+
+ $container.find('.pagination .dropdown-trigger').click(function() {
+ var $dropdownContainer = $(this).parent();
+ // Wait a little bit to make sure the dropdown has activated
+ setTimeout(function() {
+ if ($dropdownContainer.hasClass('dropdown-visible')) {
+ $dropdownContainer.find('input.inputbox').focus();
}
+ }, 100);
+ });
+
+ /**
+ * Adjust HTML code for IE8 and older versions
+ */
+ if (oldBrowser) {
+ // Fix .linklist.bulletin lists
+ $container
+ .find('ul.linklist.bulletin > li')
+ .filter(':first-child, .rightside:last-child')
+ .addClass('no-bulletin');
+ }
- return true;
+ /**
+ * Resize navigation (breadcrumbs) block to keep all links on same line
+ */
+ $container.find('.navlinks').each(function() {
+ var $this = $(this),
+ $left = $this.children().not('.rightside'),
+ $right = $this.children('.rightside');
+
+ if ($left.length !== 1 || !$right.length) {
+ return;
+ }
+
+ function resize() {
+ var width = 0,
+ diff = $left.outerWidth(true) - $left.width(),
+ minWidth = Math.max($this.width() / 3, 240),
+ maxWidth;
+
+ $right.each(function() {
+ var $this = $(this);
+ if ($this.is(':visible')) {
+ width += $this.outerWidth(true);
+ }
+ });
+
+ maxWidth = $this.width() - width - diff;
+ $left.css('max-width', Math.floor(Math.max(maxWidth, minWidth)) + 'px');
+ }
+
+ resize();
+ $(window).resize(resize);
+ });
+
+ /**
+ * Makes breadcrumbs responsive
+ */
+ $container.find('.breadcrumbs:not([data-skip-responsive])').each(function() {
+ var $this = $(this),
+ $links = $this.find('.crumb'),
+ length = $links.length,
+ classes = ['wrapped-max', 'wrapped-wide', 'wrapped-medium', 'wrapped-small', 'wrapped-tiny'],
+ classesLength = classes.length,
+ maxHeight = 0,
+ lastWidth = false,
+ wrapped = false;
+
+ // Set tooltips
+ $this.find('a').each(function() {
+ var $link = $(this);
+ $link.attr('title', $link.text());
});
-
+
+ // Function that checks breadcrumbs
+ function check() {
+ var height = $this.height(),
+ width;
+
+ // Test max-width set in code for .navlinks above
+ width = parseInt($this.css('max-width'), 10);
+ if (!width) {
+ width = $body.width();
+ }
+
+ maxHeight = parseInt($this.css('line-height'), 10);
+ $links.each(function() {
+ if ($(this).height() > 0) {
+ maxHeight = Math.max(maxHeight, $(this).outerHeight(true));
+ }
+ });
+
+ if (height <= maxHeight) {
+ if (!wrapped || lastWidth === false || lastWidth >= width) {
+ return;
+ }
+ }
+ lastWidth = width;
+
+ if (wrapped) {
+ $this.removeClass('wrapped').find('.crumb.wrapped').removeClass('wrapped ' + classes.join(' '));
+ if ($this.height() <= maxHeight) {
+ return;
+ }
+ }
+
+ wrapped = true;
+ $this.addClass('wrapped');
+ if ($this.height() <= maxHeight) {
+ return;
+ }
+
+ for (var i = 0; i < classesLength; i++) {
+ for (var j = length - 1; j >= 0; j--) {
+ $links.eq(j).addClass('wrapped ' + classes[i]);
+ if ($this.height() <= maxHeight) {
+ return;
+ }
+ }
+ }
+ }
+
+ // Run function and set event
+ check();
+ $(window).resize(check);
+ });
+
+ /**
+ * Responsive link lists
+ */
+ var selector = '.linklist:not(.navlinks, [data-skip-responsive]),' +
+ '.postbody .post-buttons:not([data-skip-responsive])';
+ $container.find(selector).each(function() {
+ var $this = $(this),
+ filterSkip = '.breadcrumbs, [data-skip-responsive]',
+ filterLast = '.edit-icon, .quote-icon, [data-last-responsive]',
+ $linksAll = $this.children(),
+ $linksNotSkip = $linksAll.not(filterSkip), // All items that can potentially be hidden
+ $linksFirst = $linksNotSkip.not(filterLast), // The items that will be hidden first
+ $linksLast = $linksNotSkip.filter(filterLast), // The items that will be hidden last
+ persistent = $this.attr('id') === 'nav-main', // Does this list already have a menu (such as quick-links)?
+ html = '<li class="responsive-menu hidden"><a href="javascript:void(0);" class="responsive-menu-link">&nbsp;</a><div class="dropdown hidden"><div class="pointer"><div class="pointer-inner" /></div><ul class="dropdown-contents" /></div></li>',
+ slack = 3; // Vertical slack space (in pixels). Determines how sensitive the script is in determining whether a line-break has occured.
+
+ // Add a hidden drop-down menu to each links list (except those that already have one)
+ if (!persistent) {
+ if ($linksNotSkip.is('.rightside')) {
+ $linksNotSkip.filter('.rightside:first').before(html);
+ $this.children('.responsive-menu').addClass('rightside');
+ } else {
+ $this.append(html);
+ }
+ }
+
+ // Set some object references and initial states
+ var $menu = $this.children('.responsive-menu'),
+ $menuContents = $menu.find('.dropdown-contents'),
+ persistentContent = $menuContents.find('li:not(.separator)').length,
+ lastWidth = false,
+ compact = false,
+ responsive1 = false,
+ responsive2 = false,
+ copied1 = false,
+ copied2 = false,
+ maxHeight = 0;
+
+ // Find the tallest element in the list (we assume that all elements are roughly the same height)
+ $linksAll.each(function() {
+ if (!$(this).height()) {
+ return;
+ }
+ maxHeight = Math.max(maxHeight, $(this).outerHeight(true));
+ });
+ if (maxHeight < 1) {
+ return; // Shouldn't be possible, but just in case, abort
+ } else {
+ maxHeight = maxHeight + slack;
+ }
+
+ function check() {
+ var width = $body.width();
+ // We can't make it any smaller than this, so just skip
+ if (responsive2 && compact && (width <= lastWidth)) {
+ return;
+ }
+ lastWidth = width;
+
+ // Reset responsive and compact layout
+ if (responsive1 || responsive2) {
+ $linksNotSkip.removeClass('hidden');
+ $menuContents.children('.clone').addClass('hidden');
+ responsive1 = responsive2 = false;
+ }
+ if (compact) {
+ $this.removeClass('compact');
+ compact = false;
+ }
+
+ // Unhide the quick-links menu if it has "persistent" content
+ if (persistent && persistentContent) {
+ $menu.removeClass('hidden');
+ } else {
+ $menu.addClass('hidden');
+ }
+
+ // Nothing to resize if block's height is not bigger than tallest element's height
+ if ($this.height() <= maxHeight) {
+ return;
+ }
+
+ // STEP 1: Compact
+ if (!compact) {
+ $this.addClass('compact');
+ compact = true;
+ }
+ if ($this.height() <= maxHeight) {
+ return;
+ }
+
+ // STEP 2: First responsive set - compact
+ if (compact) {
+ $this.removeClass('compact');
+ compact = false;
+ }
+ // Copy the list items to the dropdown
+ if (!copied1) {
+ var $clones1 = $linksFirst.clone();
+ $menuContents.prepend($clones1.addClass('clone clone-first').removeClass('leftside rightside'));
+
+ if ($this.hasClass('post-buttons')) {
+ $('.button', $menuContents).removeClass('button icon-button');
+ $('.responsive-menu-link', $menu).addClass('button icon-button').prepend('<span></span>');
+ }
+ copied1 = true;
+ }
+ if (!responsive1) {
+ $linksFirst.addClass('hidden');
+ responsive1 = true;
+ $menuContents.children('.clone-first').removeClass('hidden');
+ $menu.removeClass('hidden');
+ }
+ if ($this.height() <= maxHeight) {
+ return;
+ }
+
+ // STEP 3: First responsive set + compact
+ if (!compact) {
+ $this.addClass('compact');
+ compact = true;
+ }
+ if ($this.height() <= maxHeight) {
+ return;
+ }
+
+ // STEP 4: Last responsive set - compact
+ if (!$linksLast.length) {
+ return; // No other links to hide, can't do more
+ }
+ if (compact) {
+ $this.removeClass('compact');
+ compact = false;
+ }
+ // Copy the list items to the dropdown
+ if (!copied2) {
+ var $clones2 = $linksLast.clone();
+ $menuContents.prepend($clones2.addClass('clone clone-last').removeClass('leftside rightside'));
+ copied2 = true;
+ }
+ if (!responsive2) {
+ $linksLast.addClass('hidden');
+ responsive2 = true;
+ $menuContents.children('.clone-last').removeClass('hidden');
+ }
+ if ($this.height() <= maxHeight) {
+ return;
+ }
+
+ // STEP 5: Last responsive set + compact
+ if (!compact) {
+ $this.addClass('compact');
+ compact = true;
+ }
+ }
+
+ if (!persistent) {
+ phpbb.registerDropdown($menu.find('a.responsive-menu-link'), $menu.find('.dropdown'), false);
+ }
+
+ // If there are any images in the links list, run the check again after they have loaded
+ $linksAll.find('img').each(function() {
+ $(this).load(function() {
+ check();
+ });
+ });
+
+ check();
+ $(window).resize(check);
+ });
+
+ /**
+ * Do not run functions below for old browsers
+ */
+ if (oldBrowser) {
return;
}
- var input_tags = document.getElementsByTagName('input');
+ /**
+ * Adjust topiclist lists with check boxes
+ */
+ $container.find('ul.topiclist dd.mark').siblings('dt').children('.list-inner').addClass('with-mark');
+
+ /**
+ * Appends contents of all extra columns to first column in
+ * .topiclist lists for mobile devices. Copies contents as is.
+ *
+ * To add that functionality to .topiclist list simply add
+ * responsive-show-all to list of classes
+ */
+ $container.find('.topiclist.responsive-show-all > li > dl').each(function() {
+ var $this = $(this),
+ $block = $this.find('dt .responsive-show:last-child'),
+ first = true;
+
+ // Create block that is visible only on mobile devices
+ if (!$block.length) {
+ $this.find('dt > .list-inner').append('<div class="responsive-show" style="display:none;" />');
+ $block = $this.find('dt .responsive-show:last-child');
+ } else {
+ first = ($.trim($block.text()).length === 0);
+ }
+
+ // Copy contents of each column
+ $this.find('dd').not('.mark').each(function() {
+ var column = $(this),
+ $children = column.children(),
+ html = column.html();
+
+ if ($children.length === 1 && $children.text() === column.text()) {
+ html = $children.html();
+ }
+
+ $block.append((first ? '' : '<br />') + html);
+
+ first = false;
+ });
+ });
+
+ /**
+ * Same as above, but prepends text from header to each
+ * column before contents of that column.
+ *
+ * To add that functionality to .topiclist list simply add
+ * responsive-show-columns to list of classes
+ */
+ $container.find('.topiclist.responsive-show-columns').each(function() {
+ var $list = $(this),
+ headers = [],
+ headersLength = 0;
+
+ // Find all headers, get contents
+ $list.prev('.topiclist').find('li.header dd').not('.mark').each(function() {
+ headers.push($(this).text());
+ headersLength++;
+ });
- for (var i = 0, element = input_tags[0]; i < input_tags.length ; element = input_tags[++i])
- {
- if (element.type == 'text' || element.type == 'password')
- {
- // onkeydown is possible too
- element.onkeypress = function (evt) { submit_default_button((evt || window.event), this, 'default-submit-action'); };
+ if (!headersLength) {
+ return;
}
- }
+
+ // Parse each row
+ $list.find('dl').each(function() {
+ var $this = $(this),
+ $block = $this.find('dt .responsive-show:last-child'),
+ first = true;
+
+ // Create block that is visible only on mobile devices
+ if (!$block.length) {
+ $this.find('dt > .list-inner').append('<div class="responsive-show" style="display:none;" />');
+ $block = $this.find('dt .responsive-show:last-child');
+ } else {
+ first = ($.trim($block.text()).length === 0);
+ }
+
+ // Copy contents of each column
+ $this.find('dd').not('.mark').each(function(i) {
+ var column = $(this),
+ children = column.children(),
+ html = column.html();
+
+ if (children.length === 1 && children.text() === column.text()) {
+ html = children.html();
+ }
+
+ // Prepend contents of matching header before contents of column
+ if (i < headersLength) {
+ html = headers[i] + ': <strong>' + html + '</strong>';
+ }
+
+ $block.append((first ? '' : '<br />') + html);
+
+ first = false;
+ });
+ });
+ });
+
+ /**
+ * Responsive tables
+ */
+ $container.find('table.table1').not('.not-responsive').each(function() {
+ var $this = $(this),
+ $th = $this.find('thead > tr > th'),
+ headers = [],
+ totalHeaders = 0,
+ i, headersLength;
+
+ // Find each header
+ $th.each(function(column) {
+ var cell = $(this),
+ colspan = parseInt(cell.attr('colspan'), 10),
+ dfn = cell.attr('data-dfn'),
+ text = dfn ? dfn : cell.text();
+
+ colspan = isNaN(colspan) || colspan < 1 ? 1 : colspan;
+
+ for (i = 0; i < colspan; i++) {
+ headers.push(text);
+ }
+ totalHeaders++;
+
+ if (dfn && !column) {
+ $this.addClass('show-header');
+ }
+ });
+
+ headersLength = headers.length;
+
+ // Add header text to each cell as <dfn>
+ $this.addClass('responsive');
+
+ if (totalHeaders < 2) {
+ $this.addClass('show-header');
+ return;
+ }
+
+ $this.find('tbody > tr').each(function() {
+ var row = $(this),
+ cells = row.children('td'),
+ column = 0;
+
+ if (cells.length === 1) {
+ row.addClass('big-column');
+ return;
+ }
+
+ cells.each(function() {
+ var cell = $(this),
+ colspan = parseInt(cell.attr('colspan'), 10),
+ text = $.trim(cell.text());
+
+ if (headersLength <= column) {
+ return;
+ }
+
+ if ((text.length && text !== '-') || cell.children().length) {
+ cell.prepend('<dfn style="display: none;">' + headers[column] + '</dfn>');
+ } else {
+ cell.addClass('empty');
+ }
+
+ colspan = isNaN(colspan) || colspan < 1 ? 1 : colspan;
+ column += colspan;
+ });
+ });
+ });
+
+ /**
+ * Hide empty responsive tables
+ */
+ $container.find('table.responsive > tbody').not('.responsive-skip-empty').each(function() {
+ var $items = $(this).children('tr');
+ if (!$items.length) {
+ $(this).parent('table:first').addClass('responsive-hide');
+ }
+ });
+
+ /**
+ * Responsive tabs
+ */
+ $container.find('#tabs, #minitabs').not('[data-skip-responsive]').each(function() {
+ var $this = $(this),
+ $ul = $this.children(),
+ $tabs = $ul.children().not('[data-skip-responsive]'),
+ $links = $tabs.children('a'),
+ $item = $ul.append('<li class="tab responsive-tab" style="display:none;"><a href="javascript:void(0);" class="responsive-tab-link">&nbsp;</a><div class="dropdown tab-dropdown" style="display: none;"><div class="pointer"><div class="pointer-inner" /></div><ul class="dropdown-contents" /></div></li>').find('li.responsive-tab'),
+ $menu = $item.find('.dropdown-contents'),
+ maxHeight = 0,
+ lastWidth = false,
+ responsive = false;
+
+ $links.each(function() {
+ var $this = $(this);
+ maxHeight = Math.max(maxHeight, Math.max($this.outerHeight(true), $this.parent().outerHeight(true)));
+ });
+
+ function check() {
+ var width = $body.width(),
+ height = $this.height();
+
+ if (!arguments.length && (!responsive || width <= lastWidth) && height <= maxHeight) {
+ return;
+ }
+
+ $tabs.show();
+ $item.hide();
+
+ lastWidth = width;
+ height = $this.height();
+ if (height <= maxHeight) {
+ if ($item.hasClass('dropdown-visible')) {
+ phpbb.toggleDropdown.call($item.find('a.responsive-tab-link').get(0));
+ }
+ return;
+ }
+
+ responsive = true;
+ $item.show();
+ $menu.html('');
+
+ var $availableTabs = $tabs.filter(':not(.activetab, .responsive-tab)'),
+ total = $availableTabs.length,
+ i, $tab;
+
+ for (i = total - 1; i >= 0; i--) {
+ $tab = $availableTabs.eq(i);
+ $menu.prepend($tab.clone(true).removeClass('tab'));
+ $tab.hide();
+ if ($this.height() <= maxHeight) {
+ $menu.find('a').click(function() {
+ check(true);
+ });
+ return;
+ }
+ }
+ $menu.find('a').click(function() {
+ check(true);
+ });
+ }
+
+ var $tabLink = $item.find('a.responsive-tab-link');
+ phpbb.registerDropdown($tabLink, $item.find('.dropdown'), {
+ visibleClass: 'activetab'
+ });
+
+ check(true);
+ $(window).resize(check);
+ });
+
+ /**
+ * Hide UCP/MCP navigation if there is only 1 item
+ */
+ $container.find('#navigation').each(function() {
+ var $items = $(this).children('ol, ul').children('li');
+ if ($items.length === 1) {
+ $(this).addClass('responsive-hide');
+ }
+ });
+
+ /**
+ * Replace responsive text
+ */
+ $container.find('[data-responsive-text]').each(function() {
+ var $this = $(this),
+ fullText = $this.text(),
+ responsiveText = $this.attr('data-responsive-text'),
+ responsive = false;
+
+ function check() {
+ if ($(window).width() > 700) {
+ if (!responsive) {
+ return;
+ }
+ $this.text(fullText);
+ responsive = false;
+ return;
+ }
+ if (responsive) {
+ return;
+ }
+ $this.text(responsiveText);
+ responsive = true;
+ }
+
+ check();
+ $(window).resize(check);
+ });
}
/**
-* Detect JQuery existance. We currently do not deliver it, but some styles do, so why not benefit from it. ;)
+* Run onload functions
*/
-var jquery_present = typeof jQuery == 'function';
+jQuery(function($) {
+ 'use strict';
+
+ // Swap .nojs and .hasjs
+ $('#phpbb.nojs').toggleClass('nojs hasjs');
+ $('#phpbb').toggleClass('hastouch', phpbb.isTouch);
+ $('#phpbb.hastouch').removeClass('notouch');
+
+ // Focus forms
+ $('form[data-focus]:first').each(function() {
+ $('#' + this.getAttribute('data-focus')).focus();
+ });
+
+ parseDocument($('body'));
+});
diff --git a/phpBB/styles/prosilver/template/forumlist_body.html b/phpBB/styles/prosilver/template/forumlist_body.html
index 536488243f..a197545b90 100644
--- a/phpBB/styles/prosilver/template/forumlist_body.html
+++ b/phpBB/styles/prosilver/template/forumlist_body.html
@@ -3,68 +3,106 @@
<!-- IF (forumrow.S_IS_CAT and not forumrow.S_FIRST_ROW) or forumrow.S_NO_CAT -->
</ul>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<!-- ENDIF -->
+ <!-- EVENT forumlist_body_category_header_before -->
<!-- IF forumrow.S_IS_CAT or forumrow.S_FIRST_ROW or forumrow.S_NO_CAT -->
<div class="forabg">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<ul class="topiclist">
<li class="header">
+ <!-- EVENT forumlist_body_category_header_row_prepend -->
<dl class="icon">
- <dt><!-- IF forumrow.S_IS_CAT --><a href="{forumrow.U_VIEWFORUM}">{forumrow.FORUM_NAME}</a><!-- ELSE -->{L_FORUM}<!-- ENDIF --></dt>
+ <dt><div class="list-inner"><!-- IF forumrow.S_IS_CAT --><a href="{forumrow.U_VIEWFORUM}">{forumrow.FORUM_NAME}</a><!-- ELSE -->{L_FORUM}<!-- ENDIF --></div></dt>
<dd class="topics">{L_TOPICS}</dd>
<dd class="posts">{L_POSTS}</dd>
<dd class="lastpost"><span>{L_LAST_POST}</span></dd>
</dl>
+ <!-- EVENT forumlist_body_category_header_row_append -->
</li>
</ul>
<ul class="topiclist forums">
<!-- ENDIF -->
+ <!-- EVENT forumlist_body_category_header_after -->
<!-- IF not forumrow.S_IS_CAT -->
+ <!-- EVENT forumlist_body_forum_row_before -->
<li class="row">
- <dl class="icon" style="background-image: url({forumrow.FORUM_FOLDER_IMG_SRC}); background-repeat: no-repeat;">
+ <!-- EVENT forumlist_body_forum_row_prepend -->
+ <dl class="icon {forumrow.FORUM_IMG_STYLE}">
<dt title="{forumrow.FORUM_FOLDER_IMG_ALT}">
- <!-- IF S_ENABLE_FEEDS and forumrow.S_FEED_ENABLED --><!-- <a class="feed-icon-forum" title="{L_FEED} - {forumrow.FORUM_NAME}" href="{U_FEED}?f={forumrow.FORUM_ID}"><img src="{T_THEME_PATH}/images/feed.gif" alt="{L_FEED} - {forumrow.FORUM_NAME}" /></a> --><!-- ENDIF -->
+ <!-- IF forumrow.S_UNREAD_FORUM --><a href="{forumrow.U_VIEWFORUM}" class="icon-link"></a><!-- ENDIF -->
+ <div class="list-inner">
+ <!-- IF S_ENABLE_FEEDS and forumrow.S_FEED_ENABLED --><!-- <a class="feed-icon-forum" title="{L_FEED} - {forumrow.FORUM_NAME}" href="{U_FEED}?f={forumrow.FORUM_ID}"><img src="{T_THEME_PATH}/images/feed.gif" alt="{L_FEED} - {forumrow.FORUM_NAME}" /></a> --><!-- ENDIF -->
- <!-- IF forumrow.FORUM_IMAGE --><span class="forum-image">{forumrow.FORUM_IMAGE}</span><!-- ENDIF -->
- <a href="{forumrow.U_VIEWFORUM}" class="forumtitle">{forumrow.FORUM_NAME}</a><br />
- {forumrow.FORUM_DESC}
- <!-- IF forumrow.MODERATORS -->
- <br /><strong>{forumrow.L_MODERATOR_STR}:</strong> {forumrow.MODERATORS}
- <!-- ENDIF -->
- <!-- IF forumrow.SUBFORUMS and forumrow.S_LIST_SUBFORUMS --><br /><strong>{forumrow.L_SUBFORUM_STR}</strong> {forumrow.SUBFORUMS}<!-- ENDIF -->
+ <!-- IF forumrow.FORUM_IMAGE --><span class="forum-image">{forumrow.FORUM_IMAGE}</span><!-- ENDIF -->
+ <a href="{forumrow.U_VIEWFORUM}" class="forumtitle">{forumrow.FORUM_NAME}</a>
+ <!-- IF forumrow.FORUM_DESC --><br />{forumrow.FORUM_DESC}<!-- ENDIF -->
+ <!-- IF forumrow.MODERATORS -->
+ <br /><strong>{forumrow.L_MODERATOR_STR}{L_COLON}</strong> {forumrow.MODERATORS}
+ <!-- ENDIF -->
+ <!-- IF .forumrow.subforum and forumrow.S_LIST_SUBFORUMS -->
+ <!-- EVENT forumlist_body_subforums_before -->
+ <br /><strong>{forumrow.L_SUBFORUM_STR}{L_COLON}</strong>
+ <!-- BEGIN subforum -->
+ <!-- EVENT forumlist_body_subforum_link_prepend --><a href="{forumrow.subforum.U_SUBFORUM}" class="subforum<!-- IF forumrow.subforum.S_UNREAD --> unread<!-- ELSE --> read<!-- ENDIF -->" title="<!-- IF forumrow.subforum.S_UNREAD -->{L_UNREAD_POSTS}<!-- ELSE -->{L_NO_UNREAD_POSTS}<!-- ENDIF -->">{forumrow.subforum.SUBFORUM_NAME}</a><!-- IF not forumrow.subforum.S_LAST_ROW -->{L_COMMA_SEPARATOR}<!-- ENDIF --><!-- EVENT forumlist_body_subforum_link_append -->
+ <!-- END subforum -->
+ <!-- EVENT forumlist_body_subforums_after -->
+ <!-- ENDIF -->
+
+ <!-- IF not S_IS_BOT -->
+ <div class="responsive-show" style="display: none;">
+ <!-- IF forumrow.CLICKS -->
+ {L_REDIRECTS}{L_COLON} <strong>{forumrow.CLICKS}</strong>
+ <!-- ELSEIF not forumrow.S_IS_LINK and forumrow.TOPICS -->
+ {L_TOPICS}{L_COLON} <strong>{forumrow.TOPICS}</strong>
+ <!-- ENDIF -->
+ </div>
+ <!-- ENDIF -->
+ </div>
</dt>
<!-- IF forumrow.CLICKS -->
- <dd class="redirect"><span>{L_REDIRECTS}: {forumrow.CLICKS}</span></dd>
+ <dd class="redirect"><span>{L_REDIRECTS}{L_COLON} {forumrow.CLICKS}</span></dd>
<!-- ELSEIF not forumrow.S_IS_LINK -->
<dd class="topics">{forumrow.TOPICS} <dfn>{L_TOPICS}</dfn></dd>
<dd class="posts">{forumrow.POSTS} <dfn>{L_POSTS}</dfn></dd>
<dd class="lastpost"><span>
- <!-- IF forumrow.U_UNAPPROVED_TOPICS --><a href="{forumrow.U_UNAPPROVED_TOPICS}">{UNAPPROVED_IMG}</a><!-- ENDIF -->
- <!-- IF forumrow.LAST_POST_TIME --><dfn>{L_LAST_POST}</dfn> {L_POST_BY_AUTHOR} {forumrow.LAST_POSTER_FULL}
+ <!-- IF forumrow.U_UNAPPROVED_TOPICS -->
+ <a href="{forumrow.U_UNAPPROVED_TOPICS}">{UNAPPROVED_IMG}</a>
+ <!-- ELSEIF forumrow.U_UNAPPROVED_POSTS -->
+ <a href="{forumrow.U_UNAPPROVED_POSTS}">{UNAPPROVED_POST_IMG}</a>
+ <!-- ENDIF -->
+ <!-- IF forumrow.LAST_POST_TIME --><dfn>{L_LAST_POST}</dfn>
+ <!-- IF forumrow.S_DISPLAY_SUBJECT -->
+ <!-- EVENT forumlist_body_last_post_title_prepend -->
+ <a href="{forumrow.U_LAST_POST}" title="{forumrow.LAST_POST_SUBJECT}" class="lastsubject">{forumrow.LAST_POST_SUBJECT_TRUNCATED}</a> <br />
+ <!-- ENDIF -->
+ {L_POST_BY_AUTHOR} {forumrow.LAST_POSTER_FULL}
<!-- IF not S_IS_BOT --><a href="{forumrow.U_LAST_POST}">{LAST_POST_IMG}</a> <!-- ENDIF --><br />{forumrow.LAST_POST_TIME}<!-- ELSE -->{L_NO_POSTS}<br />&nbsp;<!-- ENDIF --></span>
</dd>
<!-- ELSE -->
<dd>&nbsp;</dd>
<!-- ENDIF -->
</dl>
+ <!-- EVENT forumlist_body_forum_row_append -->
</li>
+ <!-- EVENT forumlist_body_forum_row_after -->
<!-- ENDIF -->
<!-- IF forumrow.S_LAST_ROW -->
</ul>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
+ <!-- EVENT forumlist_body_last_row_after -->
<!-- ENDIF -->
<!-- BEGINELSE -->
<div class="panel">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<strong>{L_NO_FORUMS}</strong>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<!-- END forumrow -->
diff --git a/phpBB/styles/prosilver/template/index_body.html b/phpBB/styles/prosilver/template/index_body.html
index d4d50a11c0..b292c40eb2 100644
--- a/phpBB/styles/prosilver/template/index_body.html
+++ b/phpBB/styles/prosilver/template/index_body.html
@@ -1,48 +1,79 @@
<!-- INCLUDE overall_header.html -->
-<p class="{S_CONTENT_FLOW_END}<!-- IF S_USER_LOGGED_IN --> rightside<!-- ENDIF -->"><!-- IF S_USER_LOGGED_IN -->{LAST_VISIT_DATE}<!-- ELSE -->{CURRENT_TIME}<!-- ENDIF --></p>
-<!-- IF U_MCP --><p>{CURRENT_TIME} <br />[&nbsp;<a href="{U_MCP}">{L_MCP}</a>&nbsp;]</p><!-- ELSEIF S_USER_LOGGED_IN --><p>{CURRENT_TIME}</p><!-- ENDIF -->
-
-<!-- IF S_DISPLAY_SEARCH or (S_USER_LOGGED_IN and not S_IS_BOT) -->
-<ul class="linklist">
- <!-- IF S_DISPLAY_SEARCH -->
- <li><a href="{U_SEARCH_UNANSWERED}">{L_SEARCH_UNANSWERED}</a><!-- IF S_LOAD_UNREADS --> &bull; <a href="{U_SEARCH_UNREAD}">{L_SEARCH_UNREAD}</a><!-- ENDIF --><!-- IF S_USER_LOGGED_IN --> &bull; <a href="{U_SEARCH_NEW}">{L_SEARCH_NEW}</a><!-- ENDIF --> &bull; <a href="{U_SEARCH_ACTIVE_TOPICS}">{L_SEARCH_ACTIVE_TOPICS}</a></li>
- <!-- ENDIF -->
- <!-- IF not S_IS_BOT and U_MARK_FORUMS --><li class="rightside"><a href="{U_MARK_FORUMS}" accesskey="m">{L_MARK_FORUMS_READ}</a></li><!-- ENDIF -->
-</ul>
+<p class="{S_CONTENT_FLOW_END} responsive-center time<!-- IF S_USER_LOGGED_IN --> rightside<!-- ENDIF -->"><!-- IF S_USER_LOGGED_IN -->{LAST_VISIT_DATE}<!-- ELSE -->{CURRENT_TIME}<!-- ENDIF --></p>
+<!-- IF S_USER_LOGGED_IN --><p class="responsive-center time">{CURRENT_TIME}</p><!-- ENDIF -->
+
+<!-- EVENT index_body_markforums_before -->
+<!-- IF U_MARK_FORUMS -->
+ <div class="action-bar compact">
+ <a href="{U_MARK_FORUMS}" class="mark-read rightside" accesskey="m" data-ajax="mark_forums_read">{L_MARK_FORUMS_READ}</a>
+ </div>
<!-- ENDIF -->
+<!-- EVENT index_body_markforums_after -->
<!-- INCLUDE forumlist_body.html -->
+<!-- EVENT index_body_forumlist_body_after -->
+
<!-- IF not S_USER_LOGGED_IN and not S_IS_BOT -->
<form method="post" action="{S_LOGIN_ACTION}" class="headerspace">
<h3><a href="{U_LOGIN_LOGOUT}">{L_LOGIN_LOGOUT}</a><!-- IF S_REGISTER_ENABLED -->&nbsp; &bull; &nbsp;<a href="{U_REGISTER}">{L_REGISTER}</a><!-- ENDIF --></h3>
<fieldset class="quick-login">
- <label for="username">{L_USERNAME}:</label>&nbsp;<input type="text" name="username" id="username" size="10" class="inputbox" title="{L_USERNAME}" />
- <label for="password">{L_PASSWORD}:</label>&nbsp;<input type="password" name="password" id="password" size="10" class="inputbox" title="{L_PASSWORD}" />
+ <label for="username"><span>{L_USERNAME}{L_COLON}</span> <input type="text" tabindex="1" name="username" id="username" size="10" class="inputbox" title="{L_USERNAME}" /></label>
+ <label for="password"><span>{L_PASSWORD}{L_COLON}</span> <input type="password" tabindex="2" name="password" id="password" size="10" class="inputbox" title="{L_PASSWORD}" autocomplete="off" /></label>
+ <!-- IF U_SEND_PASSWORD -->
+ <a href="{U_SEND_PASSWORD}">{L_FORGOT_PASS}</a>
+ <!-- ENDIF -->
<!-- IF S_AUTOLOGIN_ENABLED -->
- | <label for="autologin">{L_LOG_ME_IN} <input type="checkbox" name="autologin" id="autologin" /></label>
+ <span class="responsive-hide">|</span> <label for="autologin">{L_LOG_ME_IN} <input type="checkbox" tabindex="4" name="autologin" id="autologin" /></label>
<!-- ENDIF -->
- <input type="submit" name="login" value="{L_LOGIN}" class="button2" />
+ <input type="submit" tabindex="5" name="login" value="{L_LOGIN}" class="button2" />
{S_LOGIN_REDIRECT}
</fieldset>
</form>
<!-- ENDIF -->
+<!-- EVENT index_body_stat_blocks_before -->
+
<!-- IF S_DISPLAY_ONLINE_LIST -->
- <!-- IF U_VIEWONLINE --><h3><a href="{U_VIEWONLINE}">{L_WHO_IS_ONLINE}</a></h3><!-- ELSE --><h3>{L_WHO_IS_ONLINE}</h3><!-- ENDIF -->
- <p>{TOTAL_USERS_ONLINE} ({L_ONLINE_EXPLAIN})<br />{RECORD_USERS}<br /> <br />{LOGGED_IN_USER_LIST}
- <!-- IF LEGEND --><br /><em>{L_LEGEND}: {LEGEND}</em><!-- ENDIF --></p>
+ <div class="stat-block online-list">
+ <!-- IF U_VIEWONLINE --><h3><a href="{U_VIEWONLINE}">{L_WHO_IS_ONLINE}</a></h3><!-- ELSE --><h3>{L_WHO_IS_ONLINE}</h3><!-- ENDIF -->
+ <p>
+ <!-- EVENT index_body_block_online_prepend -->
+ {TOTAL_USERS_ONLINE} ({L_ONLINE_EXPLAIN})<br />{RECORD_USERS}<br />
+ <!-- IF U_VIEWONLINE -->
+ <br />{LOGGED_IN_USER_LIST}
+ <!-- IF LEGEND --><br /><em>{L_LEGEND}{L_COLON} {LEGEND}</em><!-- ENDIF -->
+ <!-- ENDIF -->
+ <!-- EVENT index_body_block_online_append -->
+ </p>
+ </div>
<!-- ENDIF -->
-<!-- IF S_DISPLAY_BIRTHDAY_LIST and BIRTHDAY_LIST -->
- <h3>{L_BIRTHDAYS}</h3>
- <p><!-- IF BIRTHDAY_LIST -->{L_CONGRATULATIONS}: <strong>{BIRTHDAY_LIST}</strong><!-- ELSE -->{L_NO_BIRTHDAYS}<!-- ENDIF --></p>
+<!-- EVENT index_body_birthday_block_before -->
+
+<!-- IF S_DISPLAY_BIRTHDAY_LIST -->
+ <div class="stat-block birthday-list">
+ <h3>{L_BIRTHDAYS}</h3>
+ <p>
+ <!-- EVENT index_body_block_birthday_prepend -->
+ <!-- IF .birthdays -->{L_CONGRATULATIONS}{L_COLON} <strong><!-- BEGIN birthdays -->{birthdays.USERNAME}<!-- IF birthdays.AGE !== '' --> ({birthdays.AGE})<!-- ENDIF --><!-- IF not birthdays.S_LAST_ROW -->, <!-- ENDIF --><!-- END birthdays --></strong><!-- ELSE -->{L_NO_BIRTHDAYS}<!-- ENDIF -->
+ <!-- EVENT index_body_block_birthday_append -->
+ </p>
+ </div>
<!-- ENDIF -->
<!-- IF NEWEST_USER -->
- <h3>{L_STATISTICS}</h3>
- <p>{TOTAL_POSTS} &bull; {TOTAL_TOPICS} &bull; {TOTAL_USERS} &bull; {NEWEST_USER}</p>
+ <div class="stat-block statistics">
+ <h3>{L_STATISTICS}</h3>
+ <p>
+ <!-- EVENT index_body_block_stats_prepend -->
+ {TOTAL_POSTS} &bull; {TOTAL_TOPICS} &bull; {TOTAL_USERS} &bull; {NEWEST_USER}
+ <!-- EVENT index_body_block_stats_append -->
+ </p>
+ </div>
<!-- ENDIF -->
-<!-- INCLUDE overall_footer.html --> \ No newline at end of file
+<!-- EVENT index_body_stat_blocks_after -->
+
+<!-- INCLUDE overall_footer.html -->
diff --git a/phpBB/styles/prosilver/template/jumpbox.html b/phpBB/styles/prosilver/template/jumpbox.html
index 1029627561..fcd8ddbc1e 100644
--- a/phpBB/styles/prosilver/template/jumpbox.html
+++ b/phpBB/styles/prosilver/template/jumpbox.html
@@ -1,33 +1,34 @@
-<!-- IF S_VIEWTOPIC -->
- <p></p><p><a href="{U_VIEW_FORUM}" class="left-box {S_CONTENT_FLOW_BEGIN}" accesskey="r">{L_RETURN_TO} {FORUM_NAME}</a></p>
-<!-- ELSEIF S_VIEWFORUM -->
- <p></p><p><a href="{U_INDEX}" class="left-box {S_CONTENT_FLOW_BEGIN}" accesskey="r">{L_RETURN_TO} {L_INDEX}</a></p>
-<!-- ELSEIF SEARCH_TOPIC -->
- <p></p><p><a class="left-box {S_CONTENT_FLOW_BEGIN}" href="{U_SEARCH_TOPIC}" accesskey="r">{L_RETURN_TO}: {SEARCH_TOPIC}</a></p>
-<!-- ELSEIF S_SEARCH_ACTION -->
- <p></p><p><a class="left-box {S_CONTENT_FLOW_BEGIN}" href="{U_SEARCH}" title="{L_SEARCH_ADV}" accesskey="r">{L_RETURN_TO_SEARCH_ADV}</a></p>
-<!-- ENDIF -->
+<div class="action-bar actions-jump">
+ <!-- IF S_VIEWTOPIC -->
+ <p class="jumpbox-return"><a href="{U_VIEW_FORUM}" class="left-box arrow-{S_CONTENT_FLOW_BEGIN}" accesskey="r">{L_RETURN_TO_FORUM}</a></p>
+ <!-- ELSEIF S_VIEWFORUM -->
+ <p class="jumpbox-return"><a href="{U_INDEX}" class="left-box arrow-{S_CONTENT_FLOW_BEGIN}" accesskey="r">{L_RETURN_TO_INDEX}</a></p>
+ <!-- ELSEIF SEARCH_TOPIC -->
+ <p class="jumpbox-return"><a class="left-box arrow-{S_CONTENT_FLOW_BEGIN}" href="{U_SEARCH_TOPIC}" accesskey="r">{L_RETURN_TO_TOPIC}</a></p>
+ <!-- ELSEIF S_SEARCH_ACTION -->
+ <p class="jumpbox-return"><a class="left-box arrow-{S_CONTENT_FLOW_BEGIN}" href="{U_SEARCH}" title="{L_SEARCH_ADV}" accesskey="r">{L_GO_TO_SEARCH_ADV}</a></p>
+ <!-- ENDIF -->
+
+ <!-- IF S_DISPLAY_JUMPBOX -->
-<!-- IF S_DISPLAY_JUMPBOX -->
- <form method="post" id="jumpbox" action="{S_JUMPBOX_ACTION}" onsubmit="if(this.f.value == -1){return false;}">
+ <div class="dropdown-container dropdown-container-{S_CONTENT_FLOW_END}<!-- IF not S_IN_MCP --> dropdown-up<!-- ENDIF --> dropdown-{S_CONTENT_FLOW_BEGIN} dropdown-button-control" id="jumpbox">
+ <span title="<!-- IF S_IN_MCP and S_MERGE_SELECT -->{L_SELECT_TOPICS_FROM}<!-- ELSEIF S_IN_MCP -->{L_MODERATE_FORUM}<!-- ELSE -->{L_JUMP_TO}<!-- ENDIF -->" class="dropdown-trigger button dropdown-select">
+ <!-- IF S_IN_MCP and S_MERGE_SELECT -->{L_SELECT_TOPICS_FROM}<!-- ELSEIF S_IN_MCP -->{L_MODERATE_FORUM}<!-- ELSE -->{L_JUMP_TO}<!-- ENDIF -->
+ </span>
+ <div class="dropdown hidden">
+ <div class="pointer"><div class="pointer-inner"></div></div>
+ <ul class="dropdown-contents">
+ <!-- BEGIN jumpbox_forums -->
+ <!-- IF jumpbox_forums.FORUM_ID neq -1 -->
+ <li><!-- BEGIN level -->&nbsp; &nbsp;<!-- END level --><a href="{jumpbox_forums.LINK}">{jumpbox_forums.FORUM_NAME}</a></li>
+ <!-- ENDIF -->
+ <!-- END jumpbox_forums -->
+ </ul>
+ </div>
+ </div>
- <!-- IF $CUSTOM_FIELDSET_CLASS -->
- <fieldset class="{$CUSTOM_FIELDSET_CLASS}">
<!-- ELSE -->
- <fieldset class="jumpbox">
+ </br></br>
<!-- ENDIF -->
- <label for="f" accesskey="j"><!-- IF S_IN_MCP and S_MERGE_SELECT -->{L_SELECT_TOPICS_FROM}<!-- ELSEIF S_IN_MCP -->{L_MODERATE_FORUM}<!-- ELSE -->{L_JUMP_TO}<!-- ENDIF -->:</label>
- <select name="f" id="f" onchange="if(this.options[this.selectedIndex].value != -1){ document.forms['jumpbox'].submit() }">
- <!-- BEGIN jumpbox_forums -->
- <!-- IF jumpbox_forums.S_FORUM_COUNT == 1 --><option value="-1">------------------</option><!-- ENDIF -->
- <option value="{jumpbox_forums.FORUM_ID}"{jumpbox_forums.SELECTED}><!-- BEGIN level -->&nbsp; &nbsp;<!-- END level -->{jumpbox_forums.FORUM_NAME}</option>
- <!-- END jumpbox_forums -->
- </select>
- <input type="submit" value="{L_GO}" class="button2" />
- </fieldset>
- </form>
-
-<!-- ELSE -->
- <br /><br />
-<!-- ENDIF -->
+</div>
diff --git a/phpBB/styles/prosilver/template/login_body.html b/phpBB/styles/prosilver/template/login_body.html
index 36c2eae349..ef08035717 100644
--- a/phpBB/styles/prosilver/template/login_body.html
+++ b/phpBB/styles/prosilver/template/login_body.html
@@ -1,27 +1,21 @@
<!-- INCLUDE overall_header.html -->
-<script type="text/javascript">
-// <![CDATA[
- onload_functions.push('document.getElementById("<!-- IF S_ADMIN_AUTH -->{PASSWORD_CREDENTIAL}<!-- ELSE -->{USERNAME_CREDENTIAL}<!-- ENDIF -->").focus();');
-// ]]>
-</script>
-
-<form action="{S_LOGIN_ACTION}" method="post" id="login">
+<form action="{S_LOGIN_ACTION}" method="post" id="login" data-focus="<!-- IF S_ADMIN_AUTH -->{PASSWORD_CREDENTIAL}<!-- ELSE -->{USERNAME_CREDENTIAL}<!-- ENDIF -->">
<div class="panel">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div class="content">
- <h2><!-- IF LOGIN_EXPLAIN -->{LOGIN_EXPLAIN}<!-- ELSE -->{L_LOGIN}<!-- ENDIF --></h2>
+ <h2 class="login-title"><!-- IF LOGIN_EXPLAIN -->{LOGIN_EXPLAIN}<!-- ELSE -->{L_LOGIN}<!-- ENDIF --></h2>
<fieldset <!-- IF not S_CONFIRM_CODE -->class="fields1"<!-- ELSE -->class="fields2"<!-- ENDIF -->>
<!-- IF LOGIN_ERROR --><div class="error">{LOGIN_ERROR}</div><!-- ENDIF -->
<dl>
- <dt><label for="{USERNAME_CREDENTIAL}">{L_USERNAME}:</label></dt>
+ <dt><label for="{USERNAME_CREDENTIAL}">{L_USERNAME}{L_COLON}</label></dt>
<dd><input type="text" tabindex="1" name="{USERNAME_CREDENTIAL}" id="{USERNAME_CREDENTIAL}" size="25" value="{USERNAME}" class="inputbox autowidth" /></dd>
</dl>
<dl>
- <dt><label for="{PASSWORD_CREDENTIAL}">{L_PASSWORD}:</label></dt>
- <dd><input type="password" tabindex="2" id="{PASSWORD_CREDENTIAL}" name="{PASSWORD_CREDENTIAL}" size="25" class="inputbox autowidth" /></dd>
+ <dt><label for="{PASSWORD_CREDENTIAL}">{L_PASSWORD}{L_COLON}</label></dt>
+ <dd><input type="password" tabindex="2" id="{PASSWORD_CREDENTIAL}" name="{PASSWORD_CREDENTIAL}" size="25" class="inputbox autowidth" autocomplete="off" /></dd>
<!-- IF S_DISPLAY_FULL_LOGIN and (U_SEND_PASSWORD or U_RESEND_ACTIVATION) -->
<!-- IF U_SEND_PASSWORD --><dd><a href="{U_SEND_PASSWORD}">{L_FORGOT_PASS}</a></dd><!-- ENDIF -->
<!-- IF U_RESEND_ACTIVATION --><dd><a href="{U_RESEND_ACTIVATION}">{L_RESEND_ACTIVATION}</a></dd><!-- ENDIF -->
@@ -45,13 +39,17 @@
</dl>
</fieldset>
</div>
- <span class="corners-bottom"><span></span></span></div>
+
+ <!-- IF not S_ADMIN_AUTH and PROVIDER_TEMPLATE_FILE -->
+ <!-- INCLUDE {PROVIDER_TEMPLATE_FILE} -->
+ <!-- ENDIF -->
+ </div>
</div>
<!-- IF not S_ADMIN_AUTH and S_REGISTER_ENABLED -->
<div class="panel">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div class="content">
<h3>{L_REGISTER}</h3>
@@ -61,10 +59,10 @@
<p><a href="{U_REGISTER}" class="button2">{L_REGISTER}</a></p>
</div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<!-- ENDIF -->
</form>
-<!-- INCLUDE overall_footer.html --> \ No newline at end of file
+<!-- INCLUDE overall_footer.html -->
diff --git a/phpBB/styles/prosilver/template/login_body_oauth.html b/phpBB/styles/prosilver/template/login_body_oauth.html
new file mode 100644
index 0000000000..156485d211
--- /dev/null
+++ b/phpBB/styles/prosilver/template/login_body_oauth.html
@@ -0,0 +1,8 @@
+<div class="content">
+ <!-- BEGIN oauth -->
+ <dl>
+ <dt>&nbsp;</dt>
+ <dd><a href="{oauth.REDIRECT_URL}" class="button2">{oauth.SERVICE_NAME}</a></dd>
+ </dl>
+ <!-- END oauth -->
+</div>
diff --git a/phpBB/styles/prosilver/template/login_forum.html b/phpBB/styles/prosilver/template/login_forum.html
index 81a83b6340..7fa9736a96 100644
--- a/phpBB/styles/prosilver/template/login_forum.html
+++ b/phpBB/styles/prosilver/template/login_forum.html
@@ -1,14 +1,14 @@
<!-- INCLUDE overall_header.html -->
-<!-- IF FORUM_NAME --><h2><a href="{U_VIEW_FORUM}">{FORUM_NAME}</a></h2><!-- ENDIF -->
+<!-- IF FORUM_NAME --><h2 class="forum-title"><a href="{U_VIEW_FORUM}">{FORUM_NAME}</a></h2><!-- ENDIF -->
<form id="login_forum" method="post" action="{S_LOGIN_ACTION}">
{S_FORM_TOKEN}
<div class="panel">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div class="content">
- <h2>{L_LOGIN}</h2>
+ <h2 class="login-title">{L_LOGIN}</h2>
<p>{L_LOGIN_FORUM}</p>
@@ -21,8 +21,8 @@
<!-- ENDIF -->
<dl>
- <dt><label for="password">{L_PASSWORD}:</label></dt>
- <dd><input type="password" tabindex="1" id="password" name="password" size="25" class="inputbox narrow" /></dd>
+ <dt><label for="password">{L_PASSWORD}{L_COLON}</label></dt>
+ <dd><input type="password" tabindex="1" id="password" name="password" size="25" class="inputbox narrow" autocomplete="off" /></dd>
</dl>
{S_LOGIN_REDIRECT}
<dl>
@@ -32,10 +32,10 @@
</fieldset>
</div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
</form>
<!-- INCLUDE jumpbox.html -->
-<!-- INCLUDE overall_footer.html --> \ No newline at end of file
+<!-- INCLUDE overall_footer.html -->
diff --git a/phpBB/styles/prosilver/template/mcp_approve.html b/phpBB/styles/prosilver/template/mcp_approve.html
index 185dd49c1b..14472bcf4f 100644
--- a/phpBB/styles/prosilver/template/mcp_approve.html
+++ b/phpBB/styles/prosilver/template/mcp_approve.html
@@ -1,13 +1,40 @@
+<!-- IF S_AJAX_REQUEST -->
+
+ <h3>{MESSAGE_TITLE}</h3>
+ <p>{MESSAGE_TEXT}</p>
+
+ <!-- IF S_NOTIFY_POSTER -->
+ <label><input type="checkbox" name="notify_poster" checked="checked" /> <!-- IF S_APPROVE -->{L_NOTIFY_POSTER_APPROVAL}<!-- ELSE -->{L_NOTIFY_POSTER_DISAPPROVAL}<!-- ENDIF --></label>
+ <!-- ENDIF -->
+
+ <!-- IF not S_APPROVE and not S_RESTORE and .reason -->
+ <label><strong>{L_DISAPPROVE_REASON}{L_COLON}</strong>
+ <select name="reason_id">
+ <!-- BEGIN reason --><option value="{reason.ID}"<!-- IF reason.S_SELECTED --> selected="selected"<!-- ENDIF -->>{reason.DESCRIPTION}</option><!-- END reason -->
+ </select></label>
+
+ <label><strong>{L_MORE_INFO}{L_COLON}</strong><br /><span>{L_CAN_LEAVE_BLANK}</span>
+ <textarea class="inputbox" name="reason" id="reason" rows="4" cols="40">{REASON}</textarea>
+ </label>
+ <!-- ENDIF -->
+
+ <fieldset class="submit-buttons">
+ <input type="button" name="confirm" value="{YES_VALUE}" class="button1" />&nbsp;
+ <input type="button" name="cancel" value="{L_NO}" class="button2" />
+ </fieldset>
+
+<!-- ELSE -->
+
<!-- INCLUDE overall_header.html -->
<form id="confirm" action="{S_CONFIRM_ACTION}" method="post">
<div class="panel">
{S_FORM_TOKEN}
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div class="content">
- <h2>{MESSAGE_TITLE}</h2>
+ <h2 class="message-title">{MESSAGE_TITLE}</h2>
<!-- IF ADDITIONAL_MSG --><p class="error">{ADDITIONAL_MSG}</p><!-- ENDIF -->
<fieldset>
@@ -18,16 +45,16 @@
</dl>
<!-- ENDIF -->
- <!-- IF not S_APPROVE -->
+ <!-- IF not S_APPROVE and not S_RESTORE and .reason -->
<dl class="fields2 nobg">
- <dt><label>{L_DISAPPROVE_REASON}:</label></dt>
+ <dt><label>{L_DISAPPROVE_REASON}{L_COLON}</label></dt>
<dd><select name="reason_id">
<!-- BEGIN reason --><option value="{reason.ID}"<!-- IF reason.S_SELECTED --> selected="selected"<!-- ENDIF -->>{reason.DESCRIPTION}</option><!-- END reason -->
</select>
</dd>
</dl>
<dl class="fields2 nobg">
- <dt><label for="reason">{L_MORE_INFO}:</label><br /><span>{L_CAN_LEAVE_BLANK}</span></dt>
+ <dt><label for="reason">{L_MORE_INFO}{L_COLON}</label><br /><span>{L_CAN_LEAVE_BLANK}</span></dt>
<dd><textarea class="inputbox" name="reason" id="reason" rows="4" cols="40">{REASON}</textarea></dd>
</dl>
<!-- ENDIF -->
@@ -45,9 +72,10 @@
</div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
</form>
-<!-- INCLUDE overall_footer.html --> \ No newline at end of file
+<!-- INCLUDE overall_footer.html -->
+<!-- ENDIF -->
diff --git a/phpBB/styles/prosilver/template/mcp_ban.html b/phpBB/styles/prosilver/template/mcp_ban.html
index 460c95e2a1..5a7eaa7840 100644
--- a/phpBB/styles/prosilver/template/mcp_ban.html
+++ b/phpBB/styles/prosilver/template/mcp_ban.html
@@ -5,27 +5,34 @@
var ban_length = new Array();
ban_length[-1] = '';
- <!-- BEGIN ban_length -->
- ban_length['{ban_length.BAN_ID}'] = '{ban_length.A_LENGTH}';
- <!-- END ban_length -->
-
var ban_reason = new Array();
ban_reason[-1] = '';
- <!-- BEGIN ban_reason -->
- ban_reason['{ban_reason.BAN_ID}'] = '{ban_reason.A_REASON}';
- <!-- END ban_reason -->
-
var ban_give_reason = new Array();
ban_give_reason[-1] = '';
- <!-- BEGIN ban_give_reason -->
- ban_give_reason['{ban_give_reason.BAN_ID}'] = '{ban_give_reason.A_REASON}';
- <!-- END ban_give_reason -->
+
+ <!-- BEGIN bans -->
+ ban_length['{bans.BAN_ID}'] = '{bans.A_LENGTH}';
+ <!-- IF bans.A_REASON -->
+ ban_reason['{bans.BAN_ID}'] = '{bans.A_REASON}';
+ <!-- ENDIF -->
+ <!-- IF bans.A_GIVE_REASON -->
+ ban_give_reason['{bans.BAN_ID}'] = '{bans.A_GIVE_REASON}';
+ <!-- ENDIF -->
+ <!-- END bans -->
function display_details(option)
{
- document.getElementById('unbangivereason').innerHTML = ban_give_reason[option];
- document.getElementById('unbanreason').innerHTML = ban_reason[option];
document.getElementById('unbanlength').innerHTML = ban_length[option];
+ if (option in ban_reason) {
+ document.getElementById('unbanreason').innerHTML = ban_reason[option];
+ } else {
+ document.getElementById('unbanreason').innerHTML = '';
+ }
+ if (option in ban_give_reason) {
+ document.getElementById('unbangivereason').innerHTML = ban_give_reason[option];
+ } else {
+ document.getElementById('unbangivereason').innerHTML = '';
+ }
}
// ]]>
@@ -36,43 +43,45 @@
<h2>{L_TITLE}</h2>
<div class="panel">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<h3>{L_TITLE}</h3>
<p>{L_EXPLAIN}</p>
<fieldset>
+ <!-- EVENT mcp_ban_fields_before -->
<dl>
- <dt><label for="ban">{L_BAN_CELL}:</label></dt>
+ <dt><label for="ban">{L_BAN_CELL}{L_COLON}</label></dt>
<dd><label for="ban"><textarea name="ban" id="ban" class="inputbox" cols="40" rows="3">{BAN_QUANTIFIER}</textarea></label></dd>
<!-- IF S_USERNAME_BAN --><dd><strong><a href="{U_FIND_USERNAME}" onclick="find_username(this.href); return false;">{L_FIND_USERNAME}</a></strong></dd><!-- ENDIF -->
</dl>
<dl>
- <dt><label for="banlength">{L_BAN_LENGTH}:</label></dt>
+ <dt><label for="banlength">{L_BAN_LENGTH}{L_COLON}</label></dt>
<dd><label for="banlength"><select name="banlength" id="banlength" onchange="if(this.value==-1){document.getElementById('banlengthother').style.display = 'block';}else{document.getElementById('banlengthother').style.display='none';}">{S_BAN_END_OPTIONS}</select></label></dd>
<dd id="banlengthother" style="display: none;"><label><input type="text" name="banlengthother" class="inputbox" /><br /><span>{L_YEAR_MONTH_DAY}</span></label></dd>
</dl>
<dl>
- <dt><label for="banreason">{L_BAN_REASON}:</label></dt>
+ <dt><label for="banreason">{L_BAN_REASON}{L_COLON}</label></dt>
<dd><input name="banreason" id="banreason" type="text" class="inputbox" maxlength="255" /></dd>
</dl>
<dl>
- <dt><label for="bangivereason">{L_BAN_GIVE_REASON}:</label></dt>
+ <dt><label for="bangivereason">{L_BAN_GIVE_REASON}{L_COLON}</label></dt>
<dd><input name="bangivereason" id="bangivereason" type="text" class="inputbox" maxlength="255" /></dd>
</dl>
<hr />
<dl>
- <dt><label for="banexclude0">{L_BAN_EXCLUDE}:</label><br /><span>{L_BAN_EXCLUDE_EXPLAIN}</span></dt>
+ <dt><label for="banexclude0">{L_BAN_EXCLUDE}{L_COLON}</label><br /><span>{L_BAN_EXCLUDE_EXPLAIN}</span></dt>
<dd>
<label for="banexclude1"><input type="radio" name="banexclude" id="banexclude1" value="1" /> {L_YES}</label>
<label for="banexclude0"><input type="radio" name="banexclude" id="banexclude0" value="0" checked="checked" /> {L_NO}</label>
</dd>
</dl>
+ <!-- EVENT mcp_ban_fields_after -->
</fieldset>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<fieldset class="submit-buttons">
@@ -82,32 +91,34 @@
</fieldset>
<div class="panel">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<h3>{L_UNBAN_TITLE}</h3>
<p>{L_UNBAN_EXPLAIN}</p>
<!-- IF S_BANNED_OPTIONS -->
<fieldset>
+ <!-- EVENT mcp_ban_unban_before -->
<dl>
- <dt><label for="unban">{L_BAN_CELL}:</label></dt>
+ <dt><label for="unban">{L_BAN_CELL}{L_COLON}</label></dt>
<dd><select name="unban[]" id="unban" multiple="multiple" size="5" onchange="if (this.selectedIndex != -1) {display_details(this.options[this.selectedIndex].value);}">{BANNED_OPTIONS}</select></dd>
</dl>
<dl>
- <dt>{L_BAN_LENGTH}:</dt>
+ <dt>{L_BAN_LENGTH}{L_COLON}</dt>
<dd><strong id="unbanlength"></strong></dd>
</dl>
<dl>
- <dt>{L_BAN_REASON}:</dt>
+ <dt>{L_BAN_REASON}{L_COLON}</dt>
<dd><strong id="unbanreason"></strong></dd>
</dl>
<dl>
- <dt>{L_BAN_GIVE_REASON}:</dt>
+ <dt>{L_BAN_GIVE_REASON}{L_COLON}</dt>
<dd><strong id="unbangivereason"></strong></dd>
</dl>
+ <!-- EVENT mcp_ban_unban_after -->
</fieldset>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<fieldset class="submit-buttons">
@@ -119,10 +130,10 @@
<p><strong>{L_NO_BAN_CELL}</strong></p>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<!-- ENDIF -->
</form>
-<!-- INCLUDE mcp_footer.html --> \ No newline at end of file
+<!-- INCLUDE mcp_footer.html -->
diff --git a/phpBB/styles/prosilver/template/mcp_footer.html b/phpBB/styles/prosilver/template/mcp_footer.html
index 5a48d95f23..89ce7c34ab 100644
--- a/phpBB/styles/prosilver/template/mcp_footer.html
+++ b/phpBB/styles/prosilver/template/mcp_footer.html
@@ -1,9 +1,8 @@
</div>
- <div class="clear"></div>
</div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
-<!-- INCLUDE overall_footer.html --> \ No newline at end of file
+<!-- INCLUDE overall_footer.html -->
diff --git a/phpBB/styles/prosilver/template/mcp_forum.html b/phpBB/styles/prosilver/template/mcp_forum.html
index 2c98f7c9fa..4c037f56ae 100644
--- a/phpBB/styles/prosilver/template/mcp_forum.html
+++ b/phpBB/styles/prosilver/template/mcp_forum.html
@@ -3,47 +3,82 @@
<!-- DEFINE $CUSTOM_FIELDSET_CLASS = 'forum-selection2' -->
<!-- INCLUDE jumpbox.html -->
-<h2><a href="{U_VIEW_FORUM}">{L_FORUM}: {FORUM_NAME}</a></h2>
+<h2><a href="{U_VIEW_FORUM}">{L_FORUM}{L_COLON} {FORUM_NAME}</a></h2>
<form method="post" id="mcp" action="{S_MCP_ACTION}">
<div class="panel">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
- <!-- IF PAGINATION or TOTAL_TOPICS -->
- <ul class="linklist">
- <li class="rightside pagination">
- <!-- IF TOTAL_TOPICS --> {TOTAL_TOPICS}<!-- ENDIF -->
- <!-- IF PAGE_NUMBER --><!-- IF PAGINATION --> &bull; <a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{PAGE_NUMBER}</a> &bull; <span>{PAGINATION}</span><!-- ELSE --> &bull; {PAGE_NUMBER}<!-- ENDIF --><!-- ENDIF -->
- </li>
- </ul>
- <!-- ENDIF -->
+ <div class="action-bar top">
+ <div class="pagination">
+ {TOTAL_TOPICS}
+ <!-- IF .pagination -->
+ <!-- INCLUDE pagination.html -->
+ <!-- ELSE -->
+ &bull; {PAGE_NUMBER}
+ <!-- ENDIF -->
+ </div>
+ </div>
<!-- IF .topicrow -->
- <ul class="topiclist">
+ <ul class="topiclist<!-- IF S_MERGE_SELECT --> missing-column<!-- ENDIF -->">
<li class="header">
<dl class="icon">
- <dt>{L_TOPICS}</dt>
+ <dt><div class="list-inner">{L_TOPICS}</div></dt>
<dd class="posts">{L_REPLIES}</dd>
<dd class="lastpost"><span>{L_LAST_POST}</span></dd>
<!-- IF not S_MERGE_SELECT --><dd class="mark">{L_MARK}</dd><!-- ENDIF -->
</dl>
</li>
</ul>
- <ul class="topiclist cplist">
+ <ul class="topiclist cplist<!-- IF S_MERGE_SELECT --> missing-column<!-- ENDIF -->">
<!-- BEGIN topicrow -->
<li class="row<!-- IF topicrow.S_ROW_COUNT is odd --> bg1<!-- ELSE --> bg2<!-- ENDIF --><!-- IF topicrow.S_TOPIC_REPORTED --> reported<!-- ENDIF -->">
- <dl class="icon" style="background-image: url({topicrow.TOPIC_FOLDER_IMG_SRC}); background-repeat: no-repeat;">
+ <dl class="icon {topicrow.TOPIC_IMG_STYLE}">
<dt <!-- IF topicrow.TOPIC_ICON_IMG -->style="background-image: url({T_ICONS_PATH}{topicrow.TOPIC_ICON_IMG}); background-repeat: no-repeat;"<!-- ENDIF -->>
+ <!-- IF topicrow.S_UNREAD_TOPIC --><a href="{topicrow.U_NEWEST_POST}" class="icon-link"></a><!-- ENDIF -->
+ <div class="list-inner">
+ <!-- EVENT topiclist_row_prepend -->
<!-- IF topicrow.S_SELECT_TOPIC --><a href="{topicrow.U_SELECT_TOPIC}" class="topictitle">[ {L_SELECT_MERGE} ]</a>&nbsp;&nbsp; <!-- ENDIF -->
+ <!-- EVENT mcp_forum_topic_title_before -->
<a href="{topicrow.U_VIEW_TOPIC}" class="topictitle">{topicrow.TOPIC_TITLE}</a>
+ <!-- EVENT mcp_forum_topic_title_after -->
<!-- IF topicrow.S_TOPIC_UNAPPROVED or topicrow.S_POSTS_UNAPPROVED --><a href="{topicrow.U_MCP_QUEUE}">{topicrow.UNAPPROVED_IMG}</a> <!-- ENDIF -->
+ <!-- IF topicrow.S_TOPIC_DELETED or topicrow.S_POSTS_DELETED --><a href="{topicrow.U_MCP_QUEUE}">{topicrow.DELETED_IMG}</a> <!-- ENDIF -->
<!-- IF topicrow.S_TOPIC_REPORTED --><a href="{topicrow.U_MCP_REPORT}">{REPORTED_IMG}</a><!-- ENDIF -->
<!-- IF topicrow.S_MOVED_TOPIC and S_CAN_DELETE -->&nbsp;<a href="{topicrow.U_DELETE_TOPIC}" class="topictitle">[ {L_DELETE_SHADOW_TOPIC} ]</a><!-- ENDIF -->
<br />
- <!-- IF topicrow.PAGINATION --><strong class="pagination"><span>{topicrow.PAGINATION}</span></strong><!-- ENDIF -->
- <!-- IF topicrow.ATTACH_ICON_IMG -->{topicrow.ATTACH_ICON_IMG} <!-- ENDIF -->{L_POST_BY_AUTHOR} {topicrow.TOPIC_AUTHOR_FULL} &raquo; {topicrow.FIRST_POST_TIME} </dt>
+ <!-- EVENT topiclist_row_topic_title_after -->
+ <div class="responsive-show" style="display: none;">
+ <!-- IF topicrow.ATTACH_ICON_IMG -->{topicrow.ATTACH_ICON_IMG} <!-- ENDIF -->
+ {L_LAST_POST} {L_POST_BY_AUTHOR} {topicrow.LAST_POST_AUTHOR_FULL} &laquo; {topicrow.LAST_POST_TIME}<br />
+ </div>
+ <span class="responsive-show left-box" style="display: none;">{L_REPLIES}{L_COLON} <strong>{topicrow.REPLIES}</strong></span>
+
+ <!-- IF .topicrow.pagination -->
+ <div class="pagination">
+ <ul>
+ <!-- BEGIN pagination -->
+ <!-- IF topicrow.pagination.S_IS_PREV -->
+ <!-- ELSEIF topicrow.pagination.S_IS_CURRENT --><li class="active"><span>{topicrow.pagination.PAGE_NUMBER}</span></li>
+ <!-- ELSEIF topicrow.pagination.S_IS_ELLIPSIS --><li class="ellipsis"><span>{L_ELLIPSIS}</span></li>
+ <!-- ELSEIF topicrow.pagination.S_IS_NEXT -->
+ <!-- ELSE --><li><a href="{topicrow.pagination.PAGE_URL}">{topicrow.pagination.PAGE_NUMBER}</a></li>
+ <!-- ENDIF -->
+ <!-- END pagination -->
+ </ul>
+ </div>
+ <!-- ENDIF -->
+
+ <div class="responsive-hide">
+ <!-- IF topicrow.ATTACH_ICON_IMG -->{topicrow.ATTACH_ICON_IMG} <!-- ENDIF -->
+ {L_POST_BY_AUTHOR} {topicrow.TOPIC_AUTHOR_FULL} &raquo; {topicrow.FIRST_POST_TIME}
+ </div>
+ <!-- EVENT topiclist_row_append -->
+ </div>
+ </dt>
<dd class="posts">{topicrow.REPLIES} <dfn>{L_REPLIES}</dfn></dd>
<dd class="lastpost"><span><dfn>{L_LAST_POST} </dfn>{L_POST_BY_AUTHOR} {topicrow.LAST_POST_AUTHOR_FULL}<br />{topicrow.LAST_POST_TIME}</span>
</dd>
@@ -63,32 +98,35 @@
<!-- ENDIF -->
<fieldset class="display-options">
- <!-- IF NEXT_PAGE --><a href="{NEXT_PAGE}" class="right-box {S_CONTENT_FLOW_END}">{L_NEXT}</a><!-- ENDIF -->
- <!-- IF PREVIOUS_PAGE --><a href="{PREVIOUS_PAGE}" class="left-box {S_CONTENT_FLOW_BEGIN}">{L_PREVIOUS}</a><!-- ENDIF -->
- <label>{L_DISPLAY_TOPICS}: {S_SELECT_SORT_DAYS}</label>
+ <label>{L_DISPLAY_TOPICS}{L_COLON} {S_SELECT_SORT_DAYS}</label>
<label>{L_SORT_BY} {S_SELECT_SORT_KEY}</label>
- <label>{S_SELECT_SORT_DIR} <input type="submit" name="sort" value="{L_GO}" class="button2" /></label>
+ <label>{S_SELECT_SORT_DIR}</label>
+ <input type="submit" name="sort" value="{L_GO}" class="button2" />
</fieldset>
<hr />
- <!-- IF PAGINATION or TOTAL_TOPICS -->
- <ul class="linklist">
- <li class="rightside pagination">
- <!-- IF TOTAL_TOPICS --> {TOTAL_TOPICS}<!-- ENDIF -->
- <!-- IF PAGE_NUMBER --><!-- IF PAGINATION --> &bull; <a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{PAGE_NUMBER}</a> &bull; <span>{PAGINATION}</span><!-- ELSE --> &bull; {PAGE_NUMBER}<!-- ENDIF --><!-- ENDIF -->
- </li>
- </ul>
- <!-- ENDIF -->
+ <div class="action-bar bottom">
+ <div class="pagination">
+ {TOTAL_TOPICS}
+ <!-- IF .pagination -->
+ <!-- INCLUDE pagination.html -->
+ <!-- ELSE -->
+ &bull; {PAGE_NUMBER}
+ <!-- ENDIF -->
+ </div>
+ </div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
+<!-- EVENT mcp_forum_actions_before -->
<fieldset class="display-actions">
<!-- IF not S_MERGE_SELECT -->
<select name="action">
<option value="" selected="selected">{L_SELECT_ACTION}</option>
<!-- IF S_CAN_DELETE --><option value="delete_topic">{L_DELETE}</option><!-- ENDIF -->
+ <!-- IF S_CAN_RESTORE --><option value="restore_topic">{L_RESTORE}</option><!-- ENDIF -->
<!-- IF S_CAN_MERGE --><option value="merge_topics">{L_MERGE}</option><!-- ENDIF -->
<!-- IF S_CAN_MOVE --><option value="move">{L_MOVE}</option><!-- ENDIF -->
<!-- IF S_CAN_FORK --><option value="fork">{L_FORK}</option><!-- ENDIF -->
@@ -100,12 +138,14 @@
<option value="make_announce">{L_MAKE_ANNOUNCE}</option>
<option value="make_global">{L_MAKE_GLOBAL}</option>
<!-- ENDIF -->
+ <!-- EVENT mcp_forum_actions_append -->
</select>
<input class="button2" type="submit" value="{L_SUBMIT}" />
<div><a href="#" onclick="marklist('mcp', 'topic_id_list', true); return false;">{L_MARK_ALL}</a> :: <a href="#" onclick="marklist('mcp', 'topic_id_list', false); return false;">{L_UNMARK_ALL}</a></div>
<!-- ENDIF -->
{S_FORM_TOKEN}
</fieldset>
+<!-- EVENT mcp_forum_actions_after -->
</form>
-<!-- INCLUDE mcp_footer.html --> \ No newline at end of file
+<!-- INCLUDE mcp_footer.html -->
diff --git a/phpBB/styles/prosilver/template/mcp_front.html b/phpBB/styles/prosilver/template/mcp_front.html
index 89ab753f12..8fe7dfdf65 100644
--- a/phpBB/styles/prosilver/template/mcp_front.html
+++ b/phpBB/styles/prosilver/template/mcp_front.html
@@ -2,37 +2,41 @@
<h2>{PAGE_TITLE}</h2>
+<!-- EVENT mcp_front_latest_unapproved_before -->
+
<!-- IF S_SHOW_UNAPPROVED -->
<form id="mcp_queue" method="post" action="{S_MCP_QUEUE_ACTION}">
<div class="panel">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<h3>{L_LATEST_UNAPPROVED}</h3>
- <!-- IF S_HAS_UNAPPROVED_POSTS --><p>{L_UNAPPROVED_TOTAL}</p><!-- ENDIF -->
+ <p>{L_UNAPPROVED_TOTAL}</p>
<!-- IF .unapproved -->
- <ul class="topiclist">
+ <ul class="topiclist missing-column">
<li class="header">
<dl>
- <dt>{L_VIEW_DETAILS}</dt>
+ <dt><div class="list-inner">{L_VIEW_DETAILS}</div></dt>
<dd class="moderation"><span>{L_TOPIC} &amp; {L_FORUM}</span></dd>
</dl>
</li>
</ul>
- <ul class="topiclist cplist">
+ <ul class="topiclist cplist missing-column responsive-show-all">
<!-- BEGIN unapproved -->
<li class="row<!-- IF unapproved.S_ROW_COUNT is odd --> bg1<!-- ELSE --> bg2<!-- ENDIF -->">
<dl>
<dt>
- <a href="{unapproved.U_POST_DETAILS}" class="topictitle">{unapproved.SUBJECT}</a> {unapproved.ATTACH_ICON_IMG}<br />
- {L_POSTED} {L_POST_BY_AUTHOR} {unapproved.AUTHOR_FULL} &raquo; {unapproved.POST_TIME}
+ <div class="list-inner">
+ <a href="{unapproved.U_POST_DETAILS}" class="topictitle">{unapproved.SUBJECT}</a> {unapproved.ATTACH_ICON_IMG}<br />
+ {L_POSTED} {L_POST_BY_AUTHOR} {unapproved.AUTHOR_FULL} &raquo; {unapproved.POST_TIME}
+ </div>
</dt>
<dd class="moderation"><span>
- {L_TOPIC}: <a href="{unapproved.U_TOPIC}">{unapproved.TOPIC_TITLE}</a> [<a href="{unapproved.U_MCP_TOPIC}">{L_MODERATE}</a>]<br />
- {L_FORUM}: <!-- IF unapproved.U_FORUM --><a href="{unapproved.U_FORUM}">{unapproved.FORUM_NAME}</a><!-- ELSE -->{unapproved.FORUM_NAME}<!-- ENDIF --><!-- IF unapproved.U_MCP_FORUM --> [<a href="{unapproved.U_MCP_FORUM}">{L_MODERATE}</a>]<!-- ENDIF --></span>
+ {L_TOPIC}{L_COLON} <a href="{unapproved.U_TOPIC}">{unapproved.TOPIC_TITLE}</a> [<a href="{unapproved.U_MCP_TOPIC}">{L_MODERATE}</a>]<br />
+ {L_FORUM}{L_COLON} <!-- IF unapproved.U_FORUM --><a href="{unapproved.U_FORUM}">{unapproved.FORUM_NAME}</a><!-- ELSE -->{unapproved.FORUM_NAME}<!-- ENDIF --><!-- IF unapproved.U_MCP_FORUM --> [<a href="{unapproved.U_MCP_FORUM}">{L_MODERATE}</a>]<!-- ENDIF --></span>
</dd>
<dd class="mark"><input type="checkbox" name="post_id_list[]" value="{unapproved.POST_ID}" /></dd>
@@ -40,11 +44,9 @@
</li>
<!-- END unapproved -->
</ul>
- <!-- ELSE -->
- <p>{L_UNAPPROVED_POSTS_ZERO_TOTAL}</p>
<!-- ENDIF -->
- <span class="corners-bottom"><span></span></span></div>
+ </div>
{S_FORM_TOKEN}
</div>
@@ -59,72 +61,78 @@
</form>
<!-- ENDIF -->
+<!-- EVENT mcp_front_latest_reported_before -->
+
<!-- IF S_SHOW_REPORTS -->
<div class="panel">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<h3>{L_LATEST_REPORTED}</h3>
- <!-- IF S_HAS_REPORTS --><p>{L_REPORTS_TOTAL}</p><!-- ENDIF -->
+ <p>{L_REPORTS_TOTAL}</p>
<!-- IF .report -->
- <ul class="topiclist">
+ <ul class="topiclist two-long-columns">
<li class="header">
<dl>
- <dt>{L_VIEW_DETAILS}</dt>
+ <dt><div class="list-inner">{L_VIEW_DETAILS}</div></dt>
<dd class="moderation"><span>{L_REPORTER} &amp; {L_FORUM}</span></dd>
</dl>
</li>
</ul>
- <ul class="topiclist cplist">
+ <ul class="topiclist cplist two-long-columns responsive-show-all">
<!-- BEGIN report -->
<li class="row<!-- IF report.S_ROW_COUNT is odd --> bg1<!-- ELSE --> bg2<!-- ENDIF -->">
<dl>
<dt>
- <a href="{report.U_POST_DETAILS}#reports" class="topictitle">{report.SUBJECT}</a> {report.ATTACH_ICON_IMG}<br />
- <span>{L_POSTED} {L_POST_BY_AUTHOR} {report.AUTHOR_FULL} &raquo; {report.POST_TIME}</span>
+ <div class="list-inner">
+ <a href="{report.U_POST_DETAILS}#reports" class="topictitle">{report.SUBJECT}</a> {report.ATTACH_ICON_IMG}<br />
+ <span>{L_POSTED} {L_POST_BY_AUTHOR} {report.AUTHOR_FULL} &raquo; {report.POST_TIME}</span>
+ </div>
</dt>
<dd class="moderation">
<span>{L_REPORTED} {L_POST_BY_AUTHOR} {report.REPORTER_FULL} {L_REPORTED_ON_DATE} {report.REPORT_TIME}<br />
- {L_FORUM}: <a href="{report.U_FORUM}">{report.FORUM_NAME}</a></span>
+ {L_FORUM}{L_COLON} <a href="{report.U_FORUM}">{report.FORUM_NAME}</a></span>
</dd>
</dl>
</li>
<!-- END report -->
</ul>
- <!-- ELSE -->
- <p>{L_REPORTS_ZERO_TOTAL}</p>
<!-- ENDIF -->
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<!-- ENDIF -->
+<!-- EVENT mcp_front_latest_reported_pms_before -->
+
<!-- IF S_SHOW_PM_REPORTS -->
<div class="panel">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<h3>{L_LATEST_REPORTED_PMS}</h3>
- <!-- IF S_HAS_PM_REPORTS --><p>{L_PM_REPORTS_TOTAL}</p><!-- ENDIF -->
+ <p>{L_PM_REPORTS_TOTAL}</p>
<!-- IF .pm_report -->
- <ul class="topiclist">
+ <ul class="topiclist two-long-columns">
<li class="header">
<dl>
- <dt>{L_VIEW_DETAILS}</dt>
+ <dt><div class="list-inner">{L_VIEW_DETAILS}</div></dt>
<dd class="moderation"><span>{L_REPORTER}</span></dd>
</dl>
</li>
</ul>
- <ul class="topiclist cplist">
+ <ul class="topiclist cplist two-long-columns responsive-show-all">
<!-- BEGIN pm_report -->
<li class="row<!-- IF pm_report.S_ROW_COUNT is odd --> bg1<!-- ELSE --> bg2<!-- ENDIF -->">
<dl>
<dt>
- <a href="{pm_report.U_PM_DETAILS}" class="topictitle">{pm_report.PM_SUBJECT}</a> {pm_report.ATTACH_ICON_IMG}<br />
- <span>{L_MESSAGE_BY_AUTHOR} {pm_report.PM_AUTHOR_FULL} &raquo; {pm_report.PM_TIME}</span><br />
- <span>{L_MESSAGE_TO} {pm_report.RECIPIENTS}</span>
+ <div class="list-inner">
+ <a href="{pm_report.U_PM_DETAILS}" class="topictitle">{pm_report.PM_SUBJECT}</a> {pm_report.ATTACH_ICON_IMG}<br />
+ <span>{L_MESSAGE_BY_AUTHOR} {pm_report.PM_AUTHOR_FULL} &raquo; {pm_report.PM_TIME}</span><br />
+ <span>{L_MESSAGE_TO} {pm_report.RECIPIENTS}</span>
+ </div>
</dt>
<dd class="moderation">
<span>{L_REPORTED} {L_POST_BY_AUTHOR} {pm_report.REPORTER_FULL} {L_REPORTED_ON_DATE} {pm_report.REPORT_TIME}</span>
@@ -133,21 +141,21 @@
</li>
<!-- END pm_report -->
</ul>
- <!-- ELSE -->
- <p>{L_PM_REPORTS_ZERO_TOTAL}</p>
<!-- ENDIF -->
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<!-- ENDIF -->
+<!-- EVENT mcp_front_latest_logs_before -->
+
<!-- IF S_SHOW_LOGS -->
<div class="panel">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<h3>{L_LATEST_LOGS}</h3>
- <table class="table1" cellspacing="0">
+ <table class="table1">
<thead>
<tr>
<th class="name">{L_ACTION}</th>
@@ -176,8 +184,10 @@
</tbody>
</table>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<!-- ENDIF -->
-<!-- INCLUDE mcp_footer.html --> \ No newline at end of file
+<!-- EVENT mcp_front_latest_logs_after -->
+
+<!-- INCLUDE mcp_footer.html -->
diff --git a/phpBB/styles/prosilver/template/mcp_header.html b/phpBB/styles/prosilver/template/mcp_header.html
index 13cc7e12cf..69239887e3 100644
--- a/phpBB/styles/prosilver/template/mcp_header.html
+++ b/phpBB/styles/prosilver/template/mcp_header.html
@@ -3,28 +3,26 @@
<h2>{L_MCP}</h2>
<!-- IF U_MCP -->
- <p class="linkmcp">
- [ <a href="{U_MCP}">{L_MCP}</a><!-- IF U_MCP_FORUM --> | <a href="{U_MCP_FORUM}">{L_MODERATE_FORUM}</a><!-- ENDIF -->
- <!-- IF U_MCP_TOPIC --> | <a href="{U_MCP_TOPIC}">{L_MODERATE_TOPIC}</a><!-- ENDIF -->
- <!-- IF U_MCP_POST --> | <a href="{U_MCP_POST}">{L_MODERATE_POST}</a><!-- ENDIF --> ]
+ <p class="linkmcp responsive-center">
+ [<!-- IF U_ACP -->&nbsp;<a href="{U_ACP}" title="{L_ACP}" data-responsive-text="{L_ACP_SHORT}">{L_ACP}</a>&nbsp;|<!-- ENDIF -->&nbsp;<a href="{U_MCP}" title="{L_MCP}" data-responsive-text="{L_MCP_SHORT}">{L_MCP}</a><!-- IF U_MCP_FORUM -->&nbsp;|&nbsp;<a href="{U_MCP_FORUM}">{L_MODERATE_FORUM}</a><!-- ENDIF --><!-- IF U_MCP_TOPIC -->&nbsp;|&nbsp;<a href="{U_MCP_TOPIC}">{L_MODERATE_TOPIC}</a><!-- ENDIF --><!-- IF U_MCP_POST -->&nbsp;|&nbsp;<a href="{U_MCP_POST}">{L_MODERATE_POST}</a><!-- ENDIF -->&nbsp;]
</p>
<!-- ENDIF -->
<div id="tabs">
<ul>
<!-- BEGIN l_block1 -->
- <li<!-- IF l_block1.S_SELECTED --> class="activetab"<!-- ENDIF -->><a href="{l_block1.U_TITLE}"><span>{l_block1.L_TITLE}</span></a></li>
+ <li class="tab<!-- IF l_block1.S_SELECTED --> activetab<!-- ENDIF -->"><a href="{l_block1.U_TITLE}">{l_block1.L_TITLE}</a></li>
<!-- END l_block1 -->
</ul>
</div>
<div class="panel bg3">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div style="width: 100%;">
<div id="cp-menu">
- <div id="navigation">
+ <div id="navigation" role="navigation">
<ul>
<!-- BEGIN l_block1 -->
<!-- IF l_block1.S_SELECTED -->
@@ -41,27 +39,11 @@
</div>
</div>
- <div id="cp-main" class="mcp-main">
+ <div id="cp-main" class="mcp-main panel-container">
<!-- IF MESSAGE -->
<div class="content">
- <h2>{L_MESSAGE}</h2>
+ <h2 class="message-title">{L_MESSAGE}</h2>
<p class="error">{MESSAGE}</p>
<p><!-- BEGIN return_links -->{return_links.MESSAGE_LINK}<br /><br /><!-- END return_links --></p>
</div>
<!-- ENDIF -->
-
- <!-- IF CONFIRM_MESSAGE -->
- <form id="confirm" method="post" action="{S_CONFIRM_ACTION}"{S_FORM_ENCTYPE}>
-
- <div class="content">
- <h2>{L_PLEASE_CONFIRM}</h2>
- <p>{CONFIRM_MESSAGE}</p>
-
- <fieldset class="submit-buttons">
- {S_HIDDEN_FIELDS}<input class="button1" type="submit" name="submit" value="{L_YES}" />&nbsp;
- <input class="button2" type="cancel" value="{L_NO}" />
- </fieldset>
- </div>
-
- </form>
- <!-- ENDIF -->
diff --git a/phpBB/styles/prosilver/template/mcp_logs.html b/phpBB/styles/prosilver/template/mcp_logs.html
index 494f63cb1b..4f74085968 100644
--- a/phpBB/styles/prosilver/template/mcp_logs.html
+++ b/phpBB/styles/prosilver/template/mcp_logs.html
@@ -5,25 +5,27 @@
<form method="post" id="mcp" action="{U_POST_ACTION}">
<div class="panel">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
- <ul class="linklist">
- <li class="leftside">
- {L_SEARCH_KEYWORDS}: <input type="text" class="inputbox autowidth" name="keywords" value="{S_KEYWORDS}" />&nbsp;<input type="submit" class="button2" name="filter" value="{L_SEARCH}" />
- </li>
- <li class="rightside pagination">
- <!-- IF TOTAL -->{TOTAL} <!-- ENDIF -->
- <!-- IF PAGE_NUMBER --><!-- IF PAGINATION --> &bull; <a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{PAGE_NUMBER}</a> &bull; <span>{PAGINATION}</span><!-- ELSE --> &bull; {PAGE_NUMBER}<!-- ENDIF --><!-- ENDIF -->
- </li>
- </ul>
+ <div class="action-bar top">
+ {L_SEARCH_KEYWORDS}{L_COLON} <input type="search" class="inputbox autowidth" name="keywords" value="{S_KEYWORDS}" />&nbsp;<input type="submit" class="button2" name="filter" value="{L_SEARCH}" />
+ <div class="pagination">
+ {TOTAL}
+ <!-- IF .pagination -->
+ <!-- INCLUDE pagination.html -->
+ <!-- ELSE -->
+ &bull; {PAGE_NUMBER}
+ <!-- ENDIF -->
+ </div>
+ </div>
- <table cellspacing="1" class="table1">
+ <table class="table1">
<thead>
<tr>
- <th>{L_USERNAME}</th>
- <th style="text-align: center">{L_IP}</th>
- <th style="text-align: center">{L_TIME}</th>
- <th>{L_ACTION}</th>
+ <th class="name">{L_USERNAME}</th>
+ <th class="center">{L_IP}</th>
+ <th class="center">{L_TIME}</th>
+ <th class="name">{L_ACTION}</th>
<!-- IF S_CLEAR_ALLOWED --><th>{L_MARK}</th><!-- ENDIF -->
</tr>
</thead>
@@ -32,8 +34,8 @@
<!-- BEGIN log -->
<!-- IF log.S_ROW_COUNT is even --><tr class="bg1"><!-- ELSE --><tr class="bg2"><!-- ENDIF -->
<td>{log.USERNAME}</td>
- <td style="text-align: center">{log.IP}</td>
- <td style="text-align: center">{log.DATE}</td>
+ <td class="center">{log.IP}</td>
+ <td class="center">{log.DATE}</td>
<td>{log.ACTION}<br />
{log.DATA}
</td>
@@ -50,9 +52,7 @@
<!-- IF .log -->
<fieldset class="display-options">
- <!-- IF NEXT_PAGE --><a href="{NEXT_PAGE}" class="right-box {S_CONTENT_FLOW_END}">{L_NEXT}</a><!-- ENDIF -->
- <!-- IF PREVIOUS_PAGE --><a href="{PREVIOUS_PAGE}" class="left-box {S_CONTENT_FLOW_BEGIN}">{L_PREVIOUS}</a><!-- ENDIF -->
- <label>{L_DISPLAY_POSTS}: {S_SELECT_SORT_DAYS}</label>
+ <label>{L_DISPLAY_POSTS}{L_COLON} {S_SELECT_SORT_DAYS}</label>
<label>{L_SORT_BY} {S_SELECT_SORT_KEY}</label>
<label>{S_SELECT_SORT_DIR}</label>
<input type="submit" name="sort" value="{L_GO}" class="button2" />
@@ -60,14 +60,19 @@
<hr />
- <ul class="linklist">
- <li class="rightside pagination">
- <!-- IF TOTAL -->{TOTAL} <!-- ENDIF -->
- <!-- IF PAGE_NUMBER --><!-- IF PAGINATION --> &bull; <a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{PAGE_NUMBER}</a> &bull; <span>{PAGINATION}</span><!-- ELSE --> &bull; {PAGE_NUMBER}<!-- ENDIF --><!-- ENDIF -->
- </li>
- </ul>
+ <div class="action-bar bottom">
+ <div class="pagination">
+ {TOTAL}
+ <!-- IF .pagination -->
+ <!-- INCLUDE pagination.html -->
+ <!-- ELSE -->
+ &bull; {PAGE_NUMBER}
+ <!-- ENDIF -->
+ </div>
+ </div>
+
{S_FORM_TOKEN}
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<!-- IF S_CLEAR_ALLOWED -->
@@ -80,11 +85,11 @@
<!-- ENDIF -->
<!-- ELSE -->
{S_FORM_TOKEN}
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<!-- ENDIF -->
</form>
<br />
-<!-- INCLUDE mcp_footer.html --> \ No newline at end of file
+<!-- INCLUDE mcp_footer.html -->
diff --git a/phpBB/styles/prosilver/template/mcp_message.html b/phpBB/styles/prosilver/template/mcp_message.html
index 1fde48b2cc..062103b91c 100644
--- a/phpBB/styles/prosilver/template/mcp_message.html
+++ b/phpBB/styles/prosilver/template/mcp_message.html
@@ -1,8 +1,8 @@
<!-- INCLUDE mcp_header.html -->
<div class="content">
- <h2>{MESSAGE_TITLE}</h2>
+ <h2 class="message-title">{MESSAGE_TITLE}</h2>
<p>{MESSAGE_TEXT}</p>
</div>
-<!-- INCLUDE mcp_footer.html --> \ No newline at end of file
+<!-- INCLUDE mcp_footer.html -->
diff --git a/phpBB/styles/prosilver/template/mcp_move.html b/phpBB/styles/prosilver/template/mcp_move.html
index 804d76b14b..45a9ae83bc 100644
--- a/phpBB/styles/prosilver/template/mcp_move.html
+++ b/phpBB/styles/prosilver/template/mcp_move.html
@@ -1,19 +1,53 @@
+<!-- IF S_AJAX_REQUEST -->
+
+ <h3>{MESSAGE_TITLE}</h3>
+ <p>{MESSAGE_TEXT}</p>
+
+ <!-- IF ADDITIONAL_MSG --><p>{ADDITIONAL_MSG}</p><!-- ENDIF -->
+
+ <label>
+ <strong>{L_SELECT_DESTINATION_FORUM}{L_COLON}</strong>
+ <select name="to_forum_id">{S_FORUM_SELECT}</select>
+ </label>
+
+ <!-- IF S_CAN_LEAVE_SHADOW -->
+ <label for="move_leave_shadow">
+ <input type="checkbox" name="move_leave_shadow" id="move_leave_shadow" />{L_LEAVE_SHADOW}
+ </label>
+ <!-- ENDIF -->
+
+ <!-- IF S_CAN_LOCK_TOPIC -->
+ <label for="move_lock_topics">
+ <input type="checkbox" name="move_lock_topics" id="move_lock_topics" />{L_LOCK_TOPIC}
+ </label>
+ <!-- ENDIF -->
+
+ <fieldset class="submit-buttons">
+ <input type="button" name="confirm" value="{YES_VALUE}" class="button1" />&nbsp;
+ <input type="button" name="cancel" value="{L_NO}" class="button2" />
+ </fieldset>
+
+<!-- ELSE -->
+
<!-- INCLUDE overall_header.html -->
+<!-- EVENT mcp_move_before -->
+
<form id="confirm" action="{S_CONFIRM_ACTION}" method="post">
<div class="panel">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div class="content">
- <h2>{MESSAGE_TITLE}</h2>
+ <h2 class="message-title">{MESSAGE_TITLE}</h2>
<!-- IF ADDITIONAL_MSG --><p>{ADDITIONAL_MSG}</p><!-- ENDIF -->
<fieldset>
<dl class="fields2">
- <dt><label>{L_SELECT_DESTINATION_FORUM}:</label></dt>
+ <dt><label>{L_SELECT_DESTINATION_FORUM}{L_COLON}</label></dt>
<dd><select name="to_forum_id">{S_FORUM_SELECT}</select></dd>
- <!-- IF S_CAN_LEAVE_SHADOW --><dd><label for="move_leave_shadow"><input type="checkbox" name="move_leave_shadow" id="move_leave_shadow" checked="checked" />{L_LEAVE_SHADOW}</label></dd><!-- ENDIF -->
+ <!-- IF S_CAN_LEAVE_SHADOW --><dd><label for="move_leave_shadow"><input type="checkbox" name="move_leave_shadow" id="move_leave_shadow" />{L_LEAVE_SHADOW}</label></dd><!-- ENDIF -->
+ <!-- IF S_CAN_LOCK_TOPIC --><dd><label for="move_lock_topics"><input type="checkbox" name="move_lock_topics" id="move_lock_topics" />{L_LOCK_TOPIC}</label></dd><!-- ENDIF -->
</dl>
<dl class="fields2">
<dt>&nbsp;</dt>
@@ -22,15 +56,16 @@
</fieldset>
<fieldset class="submit-buttons">
- {S_HIDDEN_FIELDS}<input type="submit" name="confirm" value="{YES_VALUE}" class="button1" />&nbsp;
+ {S_HIDDEN_FIELDS}<input type="submit" name="confirm" value="{YES_VALUE}" class="button1" />&nbsp;
<input type="submit" name="cancel" value="{L_NO}" class="button2" />
{S_FORM_TOKEN}
</fieldset>
</div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
</form>
-<!-- INCLUDE overall_footer.html --> \ No newline at end of file
+<!-- INCLUDE overall_footer.html -->
+<!-- ENDIF -->
diff --git a/phpBB/styles/prosilver/template/mcp_notes_front.html b/phpBB/styles/prosilver/template/mcp_notes_front.html
index 045a7619ed..db10284bce 100644
--- a/phpBB/styles/prosilver/template/mcp_notes_front.html
+++ b/phpBB/styles/prosilver/template/mcp_notes_front.html
@@ -5,17 +5,17 @@
<h2>{L_TITLE}</h2>
<div class="panel">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<fieldset>
<dl>
- <dt><label for="username">{L_SELECT_USER}:</label></dt>
+ <dt><label for="username">{L_SELECT_USER}{L_COLON}</label></dt>
<dd><input name="username" id="username" type="text" class="inputbox" /></dd>
<dd><strong><a href="{U_FIND_USERNAME}" onclick="find_username(this.href); return false;">{L_FIND_USERNAME}</a></strong></dd>
</dl>
</fieldset>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<fieldset class="submit-buttons">
@@ -25,4 +25,4 @@
</fieldset>
</form>
-<!-- INCLUDE mcp_footer.html --> \ No newline at end of file
+<!-- INCLUDE mcp_footer.html -->
diff --git a/phpBB/styles/prosilver/template/mcp_notes_user.html b/phpBB/styles/prosilver/template/mcp_notes_user.html
index 7e92445476..3e8d47eb9d 100644
--- a/phpBB/styles/prosilver/template/mcp_notes_user.html
+++ b/phpBB/styles/prosilver/template/mcp_notes_user.html
@@ -5,7 +5,7 @@
<h2>{L_TITLE}</h2>
<div class="panel">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<h3>{USERNAME_FULL}</h3>
@@ -16,20 +16,20 @@
<div class="column2">
<dl class="details">
- <!-- IF RANK_TITLE --><dt>{L_RANK}:</dt><dd>{RANK_TITLE}</dd><!-- ENDIF -->
- <!-- IF RANK_IMG --><dt><!-- IF RANK_TITLE -->&nbsp;<!-- ELSE -->{L_RANK}:<!-- ENDIF --></dt><dd>{RANK_IMG}</dd><!-- ENDIF -->
- <dt>{L_JOINED}:</dt><dd>{JOINED}</dd>
- <dt>{L_TOTAL_POSTS}:</dt><dd>{POSTS}</dd>
- <dt>{L_WARNINGS}: </dt><dd>{WARNINGS}</dd>
+ <!-- IF RANK_TITLE --><dt>{L_RANK}{L_COLON}</dt><dd>{RANK_TITLE}</dd><!-- ENDIF -->
+ <!-- IF RANK_IMG --><dt><!-- IF RANK_TITLE -->&nbsp;<!-- ELSE -->{L_RANK}{L_COLON}<!-- ENDIF --></dt><dd>{RANK_IMG}</dd><!-- ENDIF -->
+ <dt>{L_JOINED}{L_COLON}</dt><dd>{JOINED}</dd>
+ <dt>{L_TOTAL_POSTS}{L_COLON}</dt><dd>{POSTS}</dd>
+ <dt>{L_WARNINGS}{L_COLON} </dt><dd>{WARNINGS}</dd>
</dl>
</div>
</div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<div class="panel">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<h3>{L_ADD_FEEDBACK}</h3>
<p>{L_ADD_FEEDBACK_EXPLAIN}</p>
@@ -38,7 +38,7 @@
<textarea name="usernote" id="usernote" class="inputbox" cols="40" rows="3"></textarea>
</fieldset>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<fieldset class="submit-buttons">
@@ -48,24 +48,26 @@
</fieldset>
<div class="panel">
- <div class="inner"><span class="corners-top"><span></span></span>
-
- <ul class="linklist">
- <li class="leftside">
- {L_SEARCH_KEYWORDS}: <input type="text" class="inputbox autowidth" name="keywords" value="{S_KEYWORDS}" />&nbsp;<input type="submit" class="button2" name="filter" value="{L_SEARCH}" />
- </li>
- <li class="rightside pagination">
- <!-- IF TOTAL_REPORTS -->{TOTAL_REPORTS} <!-- ENDIF -->
- <!-- IF PAGE_NUMBER --><!-- IF PAGINATION --> &bull; <a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{PAGE_NUMBER}</a> &bull; <span>{PAGINATION}</span><!-- ELSE --> &bull; {PAGE_NUMBER}<!-- ENDIF --><!-- ENDIF -->
- </li>
- </ul>
-
- <table cellspacing="1" class="table1">
+ <div class="inner">
+
+ <div class="action-bar top">
+ {L_SEARCH_KEYWORDS}{L_COLON} <input type="search" class="inputbox autowidth" name="keywords" value="{S_KEYWORDS}" />&nbsp;<input type="submit" class="button2" name="filter" value="{L_SEARCH}" />
+ <div class="pagination">
+ {TOTAL_REPORTS}
+ <!-- IF .pagination -->
+ <!-- INCLUDE pagination.html -->
+ <!-- ELSE -->
+ &bull; {PAGE_NUMBER}
+ <!-- ENDIF -->
+ </div>
+ </div>
+
+ <table class="table1">
<thead>
<tr>
- <th>{L_REPORT_BY}</th>
- <th style="text-align: center">{L_IP}</th>
- <th style="text-align: center">{L_TIME}</th>
+ <th class="name reportby">{L_REPORT_BY}</th>
+ <th class="center">{L_IP}</th>
+ <th class="center">{L_TIME}</th>
<th>{L_ACTION_NOTE}</th>
<!-- IF S_CLEAR_ALLOWED --><th>{L_MARK}</th><!-- ENDIF -->
</tr>
@@ -74,40 +76,42 @@
<!-- BEGIN usernotes -->
<!-- IF usernotes.S_ROW_COUNT is even --><tr class="bg1"><!-- ELSE --><tr class="bg2"><!-- ENDIF -->
<td>{usernotes.REPORT_BY}</td>
- <td style="text-align: center">{usernotes.IP}</td>
- <td style="text-align: center">{usernotes.REPORT_AT}</td>
+ <td class="center">{usernotes.IP}</td>
+ <td class="center">{usernotes.REPORT_AT}</td>
<td>{usernotes.ACTION}</td>
- <!-- IF S_CLEAR_ALLOWED --><td style="width: 5%; text-align: center;"><input type="checkbox" name="marknote[]" id="note-{usernotes.ID}" value="{usernotes.ID}" /></td><!-- ENDIF -->
+ <!-- IF S_CLEAR_ALLOWED --><td class="center" style="width: 5%;"><input type="checkbox" name="marknote[]" id="note-{usernotes.ID}" value="{usernotes.ID}" /></td><!-- ENDIF -->
</tr>
<!-- BEGINELSE -->
<tr>
<td class="bg1" colspan="<!-- IF S_CLEAR_ALLOWED -->5<!-- ELSE -->4<!-- ENDIF -->" align="center"><span class="gen">{L_NO_ENTRIES}</span></td>
</tr>
- <!-- END usernames -->
+ <!-- END usernotes -->
</tbody>
</table>
<hr />
<fieldset class="display-options">
- <!-- IF NEXT_PAGE --><a href="{NEXT_PAGE}" class="right-box {S_CONTENT_FLOW_END}">{L_NEXT}</a><!-- ENDIF -->
- <!-- IF PREVIOUS_PAGE --><a href="{PREVIOUS_PAGE}" class="left-box {S_CONTENT_FLOW_BEGIN}">{L_PREVIOUS}</a><!-- ENDIF -->
- <label>{L_DISPLAY_LOG}: {S_SELECT_SORT_DAYS}</label>
+ <label>{L_DISPLAY_LOG}{L_COLON} {S_SELECT_SORT_DAYS}</label>
<label>{L_SORT_BY} {S_SELECT_SORT_KEY}</label><label>{S_SELECT_SORT_DIR}</label>
<input type="submit" name="sort" value="{L_GO}" class="button2" />
</fieldset>
<hr />
- <ul class="linklist">
- <li class="rightside pagination">
- <!-- IF TOTAL_REPORTS -->{TOTAL_REPORTS}<!-- ENDIF -->
- <!-- IF PAGE_NUMBER --><!-- IF PAGINATION --> &bull; <a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{PAGE_NUMBER}</a> &bull; <span>{PAGINATION}</span><!-- ELSE --> &bull; {PAGE_NUMBER}<!-- ENDIF --><!-- ENDIF -->
- </li>
- </ul>
+ <div class="action-bar bottom">
+ <div class="pagination">
+ {TOTAL_REPORTS}
+ <!-- IF .pagination -->
+ <!-- INCLUDE pagination.html -->
+ <!-- ELSE -->
+ &bull; {PAGE_NUMBER}
+ <!-- ENDIF -->
+ </div>
+ </div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<!-- IF S_CLEAR_ALLOWED -->
@@ -122,4 +126,4 @@
<!-- ENDIF -->
</form>
-<!-- INCLUDE mcp_footer.html --> \ No newline at end of file
+<!-- INCLUDE mcp_footer.html -->
diff --git a/phpBB/styles/prosilver/template/mcp_post.html b/phpBB/styles/prosilver/template/mcp_post.html
index 11f63a3ea2..5acdcef859 100644
--- a/phpBB/styles/prosilver/template/mcp_post.html
+++ b/phpBB/styles/prosilver/template/mcp_post.html
@@ -8,13 +8,13 @@
<!-- ENDIF -->
<div id="report" class="panel">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div class="postbody">
- <h3>{L_REPORT_REASON}: {REPORT_REASON_TITLE}</h3>
+ <h3>{L_REPORT_REASON}{L_COLON} {REPORT_REASON_TITLE}</h3>
<p class="author">{L_REPORTED} {L_POST_BY_AUTHOR} {REPORTER_FULL} &laquo; {REPORT_DATE}</p>
<!-- IF S_REPORT_CLOSED -->
- <p class="rules">{L_REPORT_CLOSED}</p>
+ <p class="post-notice reported">{L_REPORT_CLOSED}</p>
<!-- ENDIF -->
<div class="content">
<!-- IF REPORT_TEXT -->
@@ -25,7 +25,7 @@
</div>
</div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<form method="post" id="mcp_report" action="{S_CLOSE_ACTION}">
@@ -45,24 +45,32 @@
<!-- ENDIF -->
<div class="panel">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div class="postbody">
- <!-- IF U_EDIT -->
- <ul class="profile-icons">
- <li class="edit-icon"><a href="{U_EDIT}" title="{L_EDIT_POST}"><span>{L_EDIT_POST}</span></a></li>
- </ul>
- <!-- ENDIF -->
+ <h3><a href="{U_VIEW_POST}">{POST_SUBJECT}</a></h3>
- <span class="right-box" id="expand"><a href="#post_details" onclick="viewableArea(getElementById('post_details'), true); var rev_text = getElementById('expand').getElementsByTagName('a').item(0).firstChild; if (rev_text.data == '{LA_EXPAND_VIEW}'){rev_text.data = '{LA_COLLAPSE_VIEW}'; } else if (rev_text.data == '{LA_COLLAPSE_VIEW}'){rev_text.data = '{LA_EXPAND_VIEW}'}; return false;">{L_EXPAND_VIEW}</a></span>
+ <ul class="post-buttons">
+ <li id="expand">
+ <a href="#post_details" onclick="viewableArea(getElementById('post_details'), true); var rev_text = getElementById('expand').getElementsByTagName('a').item(0).firstChild; if (rev_text.data.trim() == '{LA_EXPAND_VIEW}'){rev_text.data = '{LA_COLLAPSE_VIEW}'; } else if (rev_text.data.trim() == '{LA_COLLAPSE_VIEW}'){rev_text.data = '{LA_EXPAND_VIEW}';} return false;">
+ {L_EXPAND_VIEW}
+ </a>
+ </li>
+ <!-- IF U_EDIT -->
+ <li>
+ <a href="{U_EDIT}" title="{L_EDIT_POST}" class="button icon-button edit-icon">
+ <span>{L_EDIT_POST}</span>
+ </a>
+ </li>
+ <!-- ENDIF -->
+ </ul>
- <h3><a href="{U_VIEW_POST}">{POST_SUBJECT}</a></h3>
<!-- IF S_PM -->
<p class="author">
- <strong>{L_SENT_AT}:</strong> {POST_DATE}
- <br /><strong>{L_PM_FROM}:</strong> {POST_AUTHOR_FULL}
- <!-- IF S_TO_RECIPIENT --><br /><strong>{L_TO}:</strong> <!-- BEGIN to_recipient --><!-- IF to_recipient.NAME_FULL -->{to_recipient.NAME_FULL}<!-- ELSE --><a href="{to_recipient.U_VIEW}" style="color:<!-- IF to_recipient.COLOUR -->{to_recipient.COLOUR}<!-- ELSEIF to_recipient.IS_GROUP -->#0000FF<!-- ENDIF -->;">{to_recipient.NAME}</a><!-- ENDIF -->&nbsp;<!-- END to_recipient --><!-- ENDIF -->
- <!-- IF S_BCC_RECIPIENT --><br /><strong>{L_BCC}:</strong> <!-- BEGIN bcc_recipient --><!-- IF bcc_recipient.NAME_FULL -->{bcc_recipient.NAME_FULL}<!-- ELSE --><a href="{bcc_recipient.U_VIEW}" style="color:<!-- IF bcc_recipient.COLOUR -->{bcc_recipient.COLOUR}<!-- ELSEIF bcc_recipient.IS_GROUP -->#0000FF<!-- ENDIF -->;">{bcc_recipient.NAME}</a><!-- ENDIF -->&nbsp;<!-- END bcc_recipient --><!-- ENDIF -->
+ <strong>{L_SENT_AT}{L_COLON}</strong> {POST_DATE}
+ <br /><strong>{L_PM_FROM}{L_COLON}</strong> {POST_AUTHOR_FULL}
+ <!-- IF S_TO_RECIPIENT --><br /><strong>{L_TO}{L_COLON}</strong> <!-- BEGIN to_recipient --><!-- IF to_recipient.NAME_FULL -->{to_recipient.NAME_FULL}<!-- ELSE --><a href="{to_recipient.U_VIEW}" style="color:<!-- IF to_recipient.COLOUR -->{to_recipient.COLOUR}<!-- ELSEIF to_recipient.IS_GROUP -->#0000FF<!-- ENDIF -->;">{to_recipient.NAME}</a><!-- ENDIF -->&nbsp;<!-- END to_recipient --><!-- ENDIF -->
+ <!-- IF S_BCC_RECIPIENT --><br /><strong>{L_BCC}{L_COLON}</strong> <!-- BEGIN bcc_recipient --><!-- IF bcc_recipient.NAME_FULL -->{bcc_recipient.NAME_FULL}<!-- ELSE --><a href="{bcc_recipient.U_VIEW}" style="color:<!-- IF bcc_recipient.COLOUR -->{bcc_recipient.COLOUR}<!-- ELSEIF bcc_recipient.IS_GROUP -->#0000FF<!-- ENDIF -->;">{bcc_recipient.NAME}</a><!-- ENDIF -->&nbsp;<!-- END bcc_recipient --><!-- ENDIF -->
</p>
<!-- ELSE -->
<p class="author">{MINI_POST_IMG} {L_POSTED} {L_POST_BY_AUTHOR} {POST_AUTHOR_FULL} &raquo; {POST_DATE}</p>
@@ -71,7 +79,7 @@
<!-- IF S_POST_UNAPPROVED -->
<form method="post" id="mcp_approve" action="{U_APPROVE_ACTION}">
- <p class="rules">
+ <p class="post-notice unapproved">
<input class="button2" type="submit" value="{L_DISAPPROVE}" name="action[disapprove]" /> &nbsp;
<input class="button1" type="submit" value="{L_APPROVE}" name="action[approve]" />
<!-- IF not S_FIRST_POST --><input type="hidden" name="mode" value="unapproved_posts" /><!-- ENDIF -->
@@ -79,10 +87,21 @@
{S_FORM_TOKEN}
</p>
</form>
+ <!-- ELSEIF S_POST_DELETED -->
+ <form method="post" id="mcp_approve" action="{U_APPROVE_ACTION}">
+
+ <p class="post-notice deleted">
+ <!-- IF S_CAN_DELETE_POST --><input class="button2" type="submit" value="{L_DELETE}" name="action[delete]" /> &nbsp;<!-- ENDIF -->
+ <input class="button1" type="submit" value="{L_RESTORE}" name="action[restore]" />
+ <!-- IF not S_FIRST_POST --><input type="hidden" name="mode" value="deleted_posts" /><!-- ENDIF -->
+ <input type="hidden" name="post_id_list[]" value="{POST_ID}" />
+ {S_FORM_TOKEN}
+ </p>
+ </form>
<!-- ENDIF -->
<!-- IF S_MESSAGE_REPORTED -->
- <p class="rules">
+ <p class="post-notice reported">
{REPORTED_IMG} <a href="{U_MCP_REPORT}"><strong>{L_MESSAGE_REPORTED}</strong></a>
</p>
<!-- ENDIF -->
@@ -100,13 +119,20 @@
</dl>
<!-- ENDIF -->
+ <!-- IF DELETED_MESSAGE or DELETE_REASON -->
+ <div class="notice">
+ {DELETED_MESSAGE}
+ <!-- IF DELETE_REASON --><br /><strong>{L_REASON}{L_COLON}</strong> <em>{DELETE_REASON}</em><!-- ENDIF -->
+ </div>
+ <!-- ENDIF -->
+
<!-- IF SIGNATURE -->
<div id="sig{POST_ID}" class="signature">{SIGNATURE}</div>
<!-- ENDIF -->
<!-- IF S_MCP_REPORT and S_CAN_VIEWIP -->
<hr />
- <div><!-- IF S_PM -->{L_THIS_PM_IP}<!-- ELSE -->{L_THIS_POST_IP}<!-- ENDIF -->: <!-- IF U_WHOIS -->
+ <div><!-- IF S_PM -->{L_THIS_PM_IP}<!-- ELSE -->{L_THIS_POST_IP}<!-- ENDIF -->{L_COLON} <!-- IF U_WHOIS -->
<a href="{U_WHOIS}"><!-- IF POST_IPADDR -->{POST_IPADDR}<!-- ELSE -->{POST_IP}<!-- ENDIF --></a> (<!-- IF POST_IPADDR -->{POST_IP}<!-- ELSE --><a href="{U_LOOKUP_IP}">{L_LOOKUP_IP}</a><!-- ENDIF -->)
<!-- ELSE -->
<!-- IF POST_IPADDR -->{POST_IPADDR} ({POST_IP})<!-- ELSE -->{POST_IP}<!-- IF U_LOOKUP_IP --> (<a href="{U_LOOKUP_IP}">{L_LOOKUP_IP}</a>)<!-- ENDIF --><!-- ENDIF -->
@@ -115,12 +141,12 @@
</div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
-<!-- IF S_CAN_LOCK_POST or S_CAN_DELETE_POST or S_CAN_CHGPOSTER -->
+<!-- IF S_CAN_LOCK_POST or S_CAN_DELETE_POST or S_CAN_CHGPOSTER or S_MCP_POST_ADDITIONAL_OPTS -->
<div class="panel">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<h3>{L_MOD_OPTIONS}</h3>
<!-- IF S_CAN_CHGPOSTER -->
@@ -128,7 +154,7 @@
<fieldset>
<dl>
- <dt><label>{L_CHANGE_POSTER}:</label></dt>
+ <dt><label>{L_CHANGE_POSTER}{L_COLON}</label></dt>
<!-- IF S_USER_SELECT --><dd><select name="u">{S_USER_SELECT}</select> <input type="submit" class="button2" name="action[chgposter_ip]" value="{L_CONFIRM}" /></dd><!-- ENDIF -->
<dd style="margin-top:3px;">
<input class="inputbox autowidth" type="text" name="username" value="" />
@@ -142,12 +168,14 @@
</form>
<!-- ENDIF -->
+ <!-- EVENT mcp_post_additional_options -->
+
<!-- IF S_CAN_LOCK_POST or S_CAN_DELETE_POST -->
<form method="post" id="mcp" action="{U_MCP_ACTION}">
<fieldset>
<dl>
- <dt><label>{L_MOD_OPTIONS}:</label></dt>
+ <dt><label>{L_MOD_OPTIONS}{L_COLON}</label></dt>
<dd><select name="action">
<!-- IF S_CAN_LOCK_POST --><!-- IF S_POST_LOCKED --><option value="unlock_post">{L_UNLOCK_POST} [{L_UNLOCK_POST_EXPLAIN}]</option><!-- ELSE --><option value="lock_post">{L_LOCK_POST} [{L_LOCK_POST_EXPLAIN}]</option><!-- ENDIF --><!-- ENDIF -->
<!-- IF S_CAN_DELETE_POST --><option value="delete_post">{L_DELETE_POST}</option><!-- ENDIF -->
@@ -159,18 +187,18 @@
</form>
<!-- ENDIF -->
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<!-- ENDIF -->
<!-- IF S_MCP_QUEUE or S_MCP_REPORT or RETURN_TOPIC -->
<div class="panel">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<p><!-- IF S_MCP_QUEUE -->{RETURN_QUEUE} | {RETURN_TOPIC_SIMPLE} | {RETURN_POST}<!-- ELSEIF S_MCP_REPORT -->{RETURN_REPORTS}<!-- IF not S_PM --> | <a href="{U_VIEW_POST}">{L_VIEW_POST}</a> | <a href="{U_VIEW_TOPIC}">{L_VIEW_TOPIC}</a> | <a href="{U_VIEW_FORUM}">{L_VIEW_FORUM}</a><!-- ENDIF --><!-- ELSE -->{RETURN_TOPIC}<!-- ENDIF --></p>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<!-- ENDIF -->
@@ -179,7 +207,7 @@
<!-- IF S_SHOW_USER_NOTES -->
<div class="panel" id="usernotes">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<form method="post" id="mcp_notes" action="{U_POST_ACTION}">
@@ -187,7 +215,7 @@
<h3>{L_FEEDBACK}</h3>
<!-- BEGIN usernotes -->
- <span class="small"><strong>{L_REPORTED_BY}: {usernotes.REPORT_BY} &laquo; {usernotes.REPORT_AT}</strong></span>
+ <span class="small"><strong>{L_REPORTED_BY}{L_COLON} {usernotes.REPORT_BY} &laquo; {usernotes.REPORT_AT}</strong></span>
<!-- IF S_CLEAR_ALLOWED --><div class="right-box"><input type="checkbox" name="marknote[]" value="{usernotes.ID}" /></div><!-- ENDIF -->
<div class="postbody">{usernotes.ACTION}</div>
@@ -216,36 +244,36 @@
</fieldset>
</form>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<!-- ENDIF -->
<!-- IF S_SHOW_REPORTS -->
<div class="panel" id="reports">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<h3>{L_MCP_POST_REPORTS}</h3>
<!-- BEGIN reports -->
- <span class="small"><strong>{L_REPORTED_BY}: <!-- IF reports.U_REPORTER --><a href="{reports.U_REPORTER}">{reports.REPORTER}</a><!-- ELSE -->{reports.REPORTER}<!-- ENDIF --> &laquo; {reports.REPORT_TIME}</strong></span>
- <p><em>{reports.REASON_TITLE}: {reports.REASON_DESC}</em><!-- IF reports.REPORT_TEXT --><br />{reports.REPORT_TEXT}<!-- ENDIF --></p>
+ <span class="small"><strong>{L_REPORTED_BY}{L_COLON} <!-- IF reports.U_REPORTER --><a href="{reports.U_REPORTER}">{reports.REPORTER}</a><!-- ELSE -->{reports.REPORTER}<!-- ENDIF --> &laquo; {reports.REPORT_TIME}</strong></span>
+ <p><em>{reports.REASON_TITLE}{L_COLON} {reports.REASON_DESC}</em><!-- IF reports.REPORT_TEXT --><br />{reports.REPORT_TEXT}<!-- ENDIF --></p>
<!-- END reports -->
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<!-- ENDIF -->
<!-- IF S_CAN_VIEWIP and not S_MCP_REPORT -->
<div class="panel" id="ip">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
- <p>{L_THIS_POST_IP}: <!-- IF U_WHOIS -->
+ <p>{L_THIS_POST_IP}{L_COLON} <!-- IF U_WHOIS -->
<a href="{U_WHOIS}"><!-- IF POST_IPADDR -->{POST_IPADDR}<!-- ELSE -->{POST_IP}<!-- ENDIF --></a> (<!-- IF POST_IPADDR -->{POST_IP}<!-- ELSE --><a href="{U_LOOKUP_IP}">{L_LOOKUP_IP}</a><!-- ENDIF -->)
<!-- ELSE -->
<!-- IF POST_IPADDR -->{POST_IPADDR} ({POST_IP})<!-- ELSE -->{POST_IP}<!-- IF U_LOOKUP_IP --> (<a href="{U_LOOKUP_IP}">{L_LOOKUP_IP}</a>)<!-- ENDIF --><!-- ENDIF -->
<!-- ENDIF --></p>
- <table class="table1" cellspacing="1">
+ <table class="table1">
<thead>
<tr>
<th class="name">{L_OTHER_USERS}</th>
@@ -266,7 +294,15 @@
</tbody>
</table>
- <table class="table1" cellspacing="1">
+ <div class="pagination">
+ <!-- INCLUDE pagination.html -->
+ </div>
+ </div>
+ </div>
+
+ <div class="panel">
+ <div class="inner">
+ <table class="table1">
<thead>
<tr>
<th class="name">{L_IPS_POSTED_FROM}</th>
@@ -287,9 +323,29 @@
</tbody>
</table>
- <p><a href="{U_LOOKUP_ALL}#ip">{L_LOOKUP_ALL}</a></p>
+ <div class="buttons">
+ <p><a href="{U_LOOKUP_ALL}#ip">{L_LOOKUP_ALL}</a></p>
+ </div>
- <span class="corners-bottom"><span></span></span></div>
+ <div class="pagination">
+ <ul>
+ <!-- BEGIN pagination_ips -->
+ <!-- IF pagination_ips.S_IS_PREV -->
+ <li class="previous"><a href="{pagination_ips.PAGE_URL}" rel="prev" role="button">{L_PREVIOUS}</a></li>
+ <!-- ELSEIF pagination_ips.S_IS_CURRENT -->
+ <li class="active"><span>{pagination_ips.PAGE_NUMBER}</span></li>
+ <!-- ELSEIF pagination_ips.S_IS_ELLIPSIS -->
+ <li class="ellipsis" role="separator"><span>{L_ELLIPSIS}</span></li>
+ <!-- ELSEIF pagination_ips.S_IS_NEXT -->
+ <li class="next"><a href="{pagination_ips.PAGE_URL}" rel="next" role="button">{L_NEXT}</a></li>
+ <!-- ELSE -->
+ <li><a href="{pagination_ips.PAGE_URL}" role="button">{pagination_ips.PAGE_NUMBER}</a></li>
+ <!-- ENDIF -->
+ <!-- END pagination_ips -->
+ </ul>
+ </div>
+
+ </div>
</div>
<!-- ENDIF -->
@@ -297,4 +353,4 @@
<!-- IF S_TOPIC_REVIEW --><!-- INCLUDE posting_topic_review.html --><!-- ENDIF -->
-<!-- INCLUDE mcp_footer.html --> \ No newline at end of file
+<!-- INCLUDE mcp_footer.html -->
diff --git a/phpBB/styles/prosilver/template/mcp_queue.html b/phpBB/styles/prosilver/template/mcp_queue.html
index 57fb149257..864b231142 100644
--- a/phpBB/styles/prosilver/template/mcp_queue.html
+++ b/phpBB/styles/prosilver/template/mcp_queue.html
@@ -3,7 +3,7 @@
<form id="mcp" method="post" action="{S_MCP_ACTION}">
<fieldset class="forum-selection">
- <label for="fo">{L_FORUM}: <select name="f" id="fo">{S_FORUM_OPTIONS}</select></label>
+ <label for="fo">{L_FORUM}{L_COLON} <select name="f" id="fo">{S_FORUM_OPTIONS}</select></label>
<input type="submit" name="sort" value="{L_GO}" class="button2" />
{S_FORM_TOKEN}
</fieldset>
@@ -11,27 +11,32 @@
<h2>{L_TITLE}</h2>
<div class="panel">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<p>{L_EXPLAIN}</p>
<!-- IF .postrow -->
- <ul class="linklist">
- <li class="rightside pagination">
- <!-- IF TOTAL --> {TOTAL}<!-- ENDIF -->
- <!-- IF PAGE_NUMBER --><!-- IF PAGINATION --> &bull; <a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{PAGE_NUMBER}</a> &bull; <span>{PAGINATION}</span><!-- ELSE --> &bull; {PAGE_NUMBER}<!-- ENDIF --><!-- ENDIF -->
- </li>
- </ul>
- <ul class="topiclist">
+ <div class="action-bar top">
+ <div class="pagination">
+ {TOTAL}
+ <!-- IF .pagination -->
+ <!-- INCLUDE pagination.html -->
+ <!-- ELSE -->
+ &bull; {PAGE_NUMBER}
+ <!-- ENDIF -->
+ </div>
+ </div>
+
+ <ul class="topiclist missing-column">
<li class="header">
<dl>
- <dt><!-- IF S_TOPICS -->{L_TOPIC}<!-- ELSE -->{L_POST}<!-- ENDIF --></dt>
+ <dt><div class="list-inner"><!-- IF S_TOPICS -->{L_TOPIC}<!-- ELSE -->{L_POST}<!-- ENDIF --></div></dt>
<dd class="moderation"><span><!-- IF not S_TOPICS -->{L_TOPIC} &amp; <!-- ENDIF -->{L_FORUM}</span></dd>
<dd class="mark">{L_MARK}</dd>
</dl>
</li>
</ul>
- <ul class="topiclist cplist">
+ <ul class="topiclist cplist missing-column responsive-show-all">
<!-- BEGIN postrow -->
@@ -42,18 +47,26 @@
<li class="row<!-- IF postrow.S_ROW_COUNT is odd --> bg1<!-- ELSE --> bg2<!-- ENDIF -->">
<dl>
<dt>
- <a href="{postrow.U_VIEW_DETAILS}" class="topictitle">{postrow.POST_SUBJECT}</a> <br />
- <span>{L_POSTED} {L_POST_BY_AUTHOR} {postrow.POST_AUTHOR_FULL} &raquo; {postrow.POST_TIME}</span>
+ <div class="list-inner">
+ <a href="{postrow.U_VIEW_DETAILS}" class="topictitle">{postrow.POST_SUBJECT}</a> {postrow.ATTACH_ICON_IMG}<br />
+ <span>{L_POSTED} {L_POST_BY_AUTHOR} {postrow.POST_AUTHOR_FULL} &raquo; {postrow.POST_TIME}</span>
+ </div>
</dt>
<dd class="moderation">
<span>
- <!-- IF S_TOPICS --><br /><!-- ELSE -->{L_TOPIC}: <a href="{postrow.U_TOPIC}">{postrow.TOPIC_TITLE}</a> <br /><!-- ENDIF -->
- {L_FORUM}: <a href="{postrow.U_VIEWFORUM}">{postrow.FORUM_NAME}</a>
+ <!-- IF S_TOPICS --><br /><!-- ELSE -->{L_TOPIC}{L_COLON} <a href="{postrow.U_TOPIC}">{postrow.TOPIC_TITLE}</a> <br /><!-- ENDIF -->
+ {L_FORUM}{L_COLON} <a href="{postrow.U_VIEWFORUM}">{postrow.FORUM_NAME}</a>
</span>
</dd>
- <dd class="mark"><input type="checkbox" name="post_id_list[]" value="{postrow.POST_ID}" /></dd>
+ <dd class="mark">
+ <!-- IF S_TOPICS -->
+ <input type="checkbox" name="topic_id_list[]" value="{postrow.TOPIC_ID}" />
+ <!-- ELSE -->
+ <input type="checkbox" name="post_id_list[]" value="{postrow.POST_ID}" />
+ <!-- ENDIF -->
+ </dd>
</dl>
</li>
<!-- ENDIF -->
@@ -61,9 +74,7 @@
</ul>
<fieldset class="display-options">
- <!-- IF NEXT_PAGE --><a href="{NEXT_PAGE}" class="right-box {S_CONTENT_FLOW_END}">{L_NEXT}</a><!-- ENDIF -->
- <!-- IF PREVIOUS_PAGE --><a href="{PREVIOUS_PAGE}" class="left-box {S_CONTENT_FLOW_BEGIN}">{L_PREVIOUS}</a><!-- ENDIF -->
- <label>{L_DISPLAY_POSTS}: {S_SELECT_SORT_DAYS}</label>
+ <label>{L_DISPLAY_POSTS}{L_COLON} {S_SELECT_SORT_DAYS}</label>
<label>{L_SORT_BY} {S_SELECT_SORT_KEY}</label><label>{S_SELECT_SORT_DIR}</label>
<!-- IF TOPIC_ID --><label><input type="checkbox" class="radio" name="t" value="{TOPIC_ID}" checked="checked" />&nbsp; <strong>{L_ONLY_TOPIC}</strong></label><!-- ENDIF -->
<input type="submit" name="sort" value="{L_GO}" class="button2" />
@@ -71,26 +82,48 @@
<hr />
- <ul class="linklist">
- <li class="rightside pagination">
- <!-- IF TOTAL -->{TOTAL}<!-- ENDIF -->
- <!-- IF PAGE_NUMBER --><!-- IF PAGINATION --> &bull; <a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{PAGE_NUMBER}</a> &bull; <span>{PAGINATION}</span><!-- ELSE --> &bull; {PAGE_NUMBER}<!-- ENDIF --><!-- ENDIF -->
- </li>
- </ul>
+ <div class="action-bar bottom">
+ <div class="pagination">
+ {TOTAL}
+ <!-- IF .pagination -->
+ <!-- INCLUDE pagination.html -->
+ <!-- ELSE -->
+ &bull; {PAGE_NUMBER}
+ <!-- ENDIF -->
+ </div>
+ </div>
+
<!-- ELSE -->
- <p class="notopics"><strong><!-- IF S_TOPICS -->{L_NO_TOPICS_QUEUE}<!-- ELSE -->{L_UNAPPROVED_POSTS_ZERO_TOTAL}<!-- ENDIF --></strong></p>
+ <p class="notopics"><strong>
+ <!-- IF S_RESTORE -->
+ <!-- IF S_TOPICS -->{L_NO_TOPICS_DELETED}<!-- ELSE -->{L_NO_POSTS_DELETED}<!-- ENDIF -->
+ <!-- ELSE -->
+ <!-- IF S_TOPICS -->{L_NO_TOPICS_QUEUE}<!-- ELSE -->{L_NO_POSTS_QUEUE}<!-- ENDIF -->
+ <!-- ENDIF -->
+ </strong></p>
<!-- ENDIF -->
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<!-- IF .postrow -->
<fieldset class="display-actions">
+ <!-- IF S_RESTORE -->
+ <input class="button2" type="submit" name="action[delete]" value="{L_DELETE}" />&nbsp;
+ <input class="button1" type="submit" name="action[restore]" value="{L_RESTORE}" />
+ <!-- ELSE -->
<input class="button2" type="submit" name="action[disapprove]" value="{L_DISAPPROVE}" />&nbsp;
<input class="button1" type="submit" name="action[approve]" value="{L_APPROVE}" />
- <div><a href="#" onclick="marklist('mcp', 'post_id_list', true); return false;">{L_MARK_ALL}</a> :: <a href="#" onclick="marklist('mcp', 'post_id_list', false); return false;">{L_UNMARK_ALL}</a></div>
+ <!-- ENDIF -->
+ <div>
+ <!-- IF S_TOPICS -->
+ <a href="#" onclick="marklist('mcp', 'topic_id_list', true); return false;">{L_MARK_ALL}</a> :: <a href="#" onclick="marklist('mcp', 'topic_id_list', false); return false;">{L_UNMARK_ALL}</a>
+ <!-- ELSE -->
+ <a href="#" onclick="marklist('mcp', 'post_id_list', true); return false;">{L_MARK_ALL}</a> :: <a href="#" onclick="marklist('mcp', 'post_id_list', false); return false;">{L_UNMARK_ALL}</a>
+ <!-- ENDIF -->
+ </div>
</fieldset>
<!-- ENDIF -->
</form>
-<!-- INCLUDE mcp_footer.html --> \ No newline at end of file
+<!-- INCLUDE mcp_footer.html -->
diff --git a/phpBB/styles/prosilver/template/mcp_reports.html b/phpBB/styles/prosilver/template/mcp_reports.html
index eefb24ee91..24c0479f63 100644
--- a/phpBB/styles/prosilver/template/mcp_reports.html
+++ b/phpBB/styles/prosilver/template/mcp_reports.html
@@ -4,7 +4,7 @@
<!-- IF not S_PM -->
<fieldset class="forum-selection">
- <label for="fo">{L_FORUM}: <select name="f" id="fo">{S_FORUM_OPTIONS}</select></label>
+ <label for="fo">{L_FORUM}{L_COLON} <select name="f" id="fo">{S_FORUM_OPTIONS}</select></label>
<input type="submit" name="sort" value="{L_GO}" class="button2" />
{S_FORM_TOKEN}
</fieldset>
@@ -13,48 +13,64 @@
<h2>{L_TITLE}</h2>
<div class="panel">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<p>{L_EXPLAIN}</p>
<!-- IF .postrow -->
- <ul class="linklist">
- <li class="rightside pagination">
- <!-- IF TOTAL -->{TOTAL_REPORTS}<!-- ENDIF -->
- <!-- IF PAGE_NUMBER --><!-- IF PAGINATION --> &bull; <a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{PAGE_NUMBER}</a> &bull; <span>{PAGINATION}</span><!-- ELSE --> &bull; {PAGE_NUMBER}<!-- ENDIF --><!-- ENDIF -->
- </li>
- </ul>
- <ul class="topiclist">
+ <div class="action-bar top">
+ <div class="pagination">
+ {TOTAL_REPORTS}
+ <!-- IF .pagination -->
+ <!-- INCLUDE pagination.html -->
+ <!-- ELSE -->
+ &bull; {PAGE_NUMBER}
+ <!-- ENDIF -->
+ </div>
+ </div>
+
+ <ul class="topiclist missing-column">
<li class="header">
<dl>
- <dt>{L_VIEW_DETAILS}</dt>
+ <dt><div class="list-inner">{L_VIEW_DETAILS}</div></dt>
<dd class="moderation"><span>{L_REPORTER}<!-- IF not S_PM --> &amp; {L_FORUM}<!-- ENDIF --></span></dd>
<dd class="mark">{L_MARK}</dd>
</dl>
</li>
</ul>
- <ul class="topiclist cplist">
+ <ul class="topiclist cplist missing-column">
<!-- BEGIN postrow -->
<li class="row<!-- IF postrow.S_ROW_COUNT is odd --> bg1<!-- ELSE --> bg2<!-- ENDIF -->">
<dl>
<!-- IF S_PM -->
<dt>
- <a href="{postrow.U_VIEW_DETAILS}" class="topictitle">{postrow.PM_SUBJECT}</a> {postrow.ATTACH_ICON_IMG}<br />
- <span>{L_MESSAGE_BY_AUTHOR} {postrow.PM_AUTHOR_FULL} &raquo; {postrow.PM_TIME}</span><br />
- <span>{L_MESSAGE_TO} {postrow.RECIPIENTS}</span>
+ <div class="list-inner">
+ <a href="{postrow.U_VIEW_DETAILS}" class="topictitle">{postrow.PM_SUBJECT}</a> {postrow.ATTACH_ICON_IMG}<br />
+ <span>{L_MESSAGE_BY_AUTHOR} {postrow.PM_AUTHOR_FULL} &raquo; {postrow.PM_TIME}</span><br />
+ <span>{L_MESSAGE_TO} {postrow.RECIPIENTS}</span>
+ <div class="responsive-show" style="display: none;">
+ {L_REPORTER}{L_COLON} {postrow.REPORTER_FULL} &laquo; {postrow.REPORT_TIME}
+ </div>
+ </div>
</dt>
<dd class="moderation">
<span>{postrow.REPORTER_FULL} &laquo; {postrow.REPORT_TIME}</span>
</dd>
<!-- ELSE -->
<dt>
- <a href="{postrow.U_VIEW_DETAILS}" class="topictitle">{postrow.POST_SUBJECT}</a> {postrow.ATTACH_ICON_IMG}<br />
- <span>{L_POSTED} {L_POST_BY_AUTHOR} {postrow.POST_AUTHOR_FULL} &raquo; {postrow.POST_TIME}</span>
+ <div class="list-inner">
+ <a href="{postrow.U_VIEW_DETAILS}" class="topictitle">{postrow.POST_SUBJECT}</a> {postrow.ATTACH_ICON_IMG}<br />
+ <span>{L_POSTED} {L_POST_BY_AUTHOR} {postrow.POST_AUTHOR_FULL} &raquo; {postrow.POST_TIME}</span>
+ <div class="responsive-show" style="display: none;">
+ {L_REPORTER}{L_COLON} {postrow.REPORTER_FULL} &laquo; {postrow.REPORT_TIME}<br />
+ <!-- IF postrow.U_VIEWFORUM -->{L_FORUM}{L_COLON} <a href="{postrow.U_VIEWFORUM}">{postrow.FORUM_NAME}</a><!-- ELSE -->{postrow.FORUM_NAME}<!-- ENDIF -->
+ </div>
+ </div>
</dt>
<dd class="moderation">
<span>{postrow.REPORTER_FULL} &laquo; {postrow.REPORT_TIME}<br />
- <!-- IF postrow.U_VIEWFORUM -->{L_FORUM}: <a href="{postrow.U_VIEWFORUM}">{postrow.FORUM_NAME}</a><!-- ELSE -->{postrow.FORUM_NAME}<!-- ENDIF --></span>
+ <!-- IF postrow.U_VIEWFORUM -->{L_FORUM}{L_COLON} <a href="{postrow.U_VIEWFORUM}">{postrow.FORUM_NAME}</a><!-- ELSE -->{postrow.FORUM_NAME}<!-- ENDIF --></span>
</dd>
<!-- ENDIF -->
<dd class="mark"><input type="checkbox" name="report_id_list[]" value="{postrow.REPORT_ID}" /></dd>
@@ -64,26 +80,30 @@
</ul>
<fieldset class="display-options">
- <!-- IF NEXT_PAGE --><a href="{NEXT_PAGE}" class="right-box {S_CONTENT_FLOW_END}">{L_NEXT}</a><!-- ENDIF -->
- <!-- IF PREVIOUS_PAGE --><a href="{PREVIOUS_PAGE}" class="left-box {S_CONTENT_FLOW_BEGIN}">{L_PREVIOUS}</a><!-- ENDIF -->
- <label>{L_DISPLAY_POSTS}: {S_SELECT_SORT_DAYS}</label>
+ <label>{L_DISPLAY_POSTS}{L_COLON} {S_SELECT_SORT_DAYS}</label>
<label>{L_SORT_BY} {S_SELECT_SORT_KEY}</label><label>{S_SELECT_SORT_DIR}</label>
<!-- IF TOPIC_ID --><label><input type="checkbox" class="radio" name="t" value="{TOPIC_ID}" checked="checked" />&nbsp; <strong>{L_ONLY_TOPIC}</strong></label><!-- ENDIF -->
<input type="submit" name="sort" value="{L_GO}" class="button2" />
</fieldset>
+
<hr />
- <ul class="linklist">
- <li class="rightside pagination">
- <!-- IF TOTAL -->{TOTAL_REPORTS}<!-- ENDIF -->
- <!-- IF PAGE_NUMBER --><!-- IF PAGINATION --> &bull; <a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{PAGE_NUMBER}</a> &bull; <span>{PAGINATION}</span><!-- ELSE --> &bull; {PAGE_NUMBER}<!-- ENDIF --><!-- ENDIF -->
- </li>
- </ul>
+
+ <div class="action-bar bottom">
+ <div class="pagination">
+ {TOTAL_REPORTS}
+ <!-- IF .pagination -->
+ <!-- INCLUDE pagination.html -->
+ <!-- ELSE -->
+ &bull; {PAGE_NUMBER}
+ <!-- ENDIF -->
+ </div>
+ </div>
<!-- ELSE -->
<p><strong>{L_NO_REPORTS}</strong></p>
<!-- ENDIF -->
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<!-- IF .postrow -->
@@ -95,4 +115,4 @@
<!-- ENDIF -->
</form>
-<!-- INCLUDE mcp_footer.html --> \ No newline at end of file
+<!-- INCLUDE mcp_footer.html -->
diff --git a/phpBB/styles/prosilver/template/mcp_topic.html b/phpBB/styles/prosilver/template/mcp_topic.html
index 13b661ef0a..af4b63265f 100644
--- a/phpBB/styles/prosilver/template/mcp_topic.html
+++ b/phpBB/styles/prosilver/template/mcp_topic.html
@@ -1,38 +1,26 @@
<!-- INCLUDE mcp_header.html -->
<div class="tabs-container">
-<h2><a href="{U_VIEW_TOPIC}">{L_TOPIC}: {TOPIC_TITLE}</a></h2>
-
-<script type="text/javascript">
-// <![CDATA[
-var panels = new Array('display-panel', 'split-panel', 'merge-panel');
+<h2><a href="{U_VIEW_TOPIC}">{L_TOPIC}{L_COLON} {TOPIC_TITLE}</a></h2>
<!-- IF S_MERGE_VIEW -->
- var show_panel = 'merge-panel';
+ <!-- DEFINE $SHOW_PANEL = 'merge-panel' -->
<!-- ELSEIF S_SPLIT_VIEW -->
- var show_panel = 'split-panel';
+ <!-- DEFINE $SHOW_PANEL = 'split-panel' -->
<!-- ELSE -->
- var show_panel = 'display-panel';
+ <!-- DEFINE $SHOW_PANEL = 'display-panel' -->
<!-- ENDIF -->
-onload_functions.push('subPanels()');
-
-// ]]>
-</script>
-
-<div id="minitabs">
+<div id="minitabs" class="sub-panels" data-show-panel="{$SHOW_PANEL}" role="tablist">
<ul>
- <li id="display-panel-tab"<!-- IF not S_MERGE_VIEW --> class="activetab"<!-- ENDIF -->>
- <span class="corners-top"><span></span></span>
- <a href="#minitabs" onclick="subPanels('display-panel'); return false;"><span>{L_DISPLAY_OPTIONS}</span></a>
+ <li id="display-panel-tab" class="tab<!-- IF not S_MERGE_VIEW --> activetab<!-- ENDIF -->">
+ <a href="#minitabs" data-subpanel="display-panel" role="tab" aria-controls="display-panel">{L_DISPLAY_OPTIONS}</a>
</li>
- <li id="split-panel-tab">
- <span class="corners-top"><span></span></span>
- <a href="#minitabs" onclick="subPanels('split-panel'); return false;"><span>{L_SPLIT_TOPIC}</span></a>
+ <li id="split-panel-tab" class="tab">
+ <a href="#minitabs" data-subpanel="split-panel" role="tab" aria-controls="split-panel">{L_SPLIT_TOPIC}</a>
</li>
- <li id="merge-panel-tab"<!-- IF S_MERGE_VIEW --> class="activetab"<!-- ENDIF -->>
- <span class="corners-top"><span></span></span>
- <a href="#minitabs" onclick="subPanels('merge-panel'); return false;"><span>{L_MERGE_POSTS}</span></a>
+ <li id="merge-panel-tab" class="tab<!-- IF S_MERGE_VIEW --> activetab<!-- ENDIF -->">
+ <a href="#minitabs" data-subpanel="merge-panel" role="tab" aria-controls="merge-panel">{L_MERGE_POSTS}</a>
</li>
</ul>
</div>
@@ -41,49 +29,51 @@ onload_functions.push('subPanels()');
<form id="mcp" method="post" action="{S_MCP_ACTION}">
<div class="panel">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
- <fieldset id="display-panel" class="fields2">
+ <fieldset id="display-panel" class="fields2" role="tabpanel">
<dl>
- <dt><label for="posts_per_page">{L_POSTS_PER_PAGE}:</label><br /><span>{L_POSTS_PER_PAGE_EXPLAIN}</span></dt>
- <dd><input class="inputbox autowidth" type="text" name="posts_per_page" id="posts_per_page" size="6" value="{POSTS_PER_PAGE}" /></dd>
+ <dt><label for="posts_per_page">{L_POSTS_PER_PAGE}{L_COLON}</label><br /><span>{L_POSTS_PER_PAGE_EXPLAIN}</span></dt>
+ <dd><input class="inputbox autowidth" type="number" min="0" max="999999" name="posts_per_page" id="posts_per_page" value="{POSTS_PER_PAGE}" /></dd>
</dl>
<dl>
- <dt><label>{L_DISPLAY_POSTS}:</label></dt>
+ <dt><label>{L_DISPLAY_POSTS}{L_COLON}</label></dt>
<dd>{S_SELECT_SORT_DAYS}&nbsp;&nbsp;<label>{L_SORT_BY} {S_SELECT_SORT_KEY}</label><label>{S_SELECT_SORT_DIR}</label> <input type="submit" name="sort" value="{L_GO}" class="button2" /></dd>
</dl>
</fieldset>
<!-- IF S_CAN_SPLIT -->
- <fieldset id="split-panel" class="fields2">
+ <fieldset id="split-panel" class="fields2" role="tabpanel">
<p>{L_SPLIT_TOPIC_EXPLAIN}</p>
<!-- IF S_SHOW_TOPIC_ICONS -->
<dl>
- <dt><label for="icon">{L_TOPIC_ICON}:</label></dt>
+ <dt><label for="icon">{L_TOPIC_ICON}{L_COLON}</label></dt>
<dd><label for="icon"><input type="radio" name="icon" id="icon" value="0" checked="checked" /> {L_NO_TOPIC_ICON}</label>
<!-- BEGIN topic_icon --><label for="icon-{topic_icon.ICON_ID}"><input type="radio" name="icon" id="icon-{topic_icon.ICON_ID}" value="{topic_icon.ICON_ID}" {topic_icon.S_ICON_CHECKED} /><img src="{topic_icon.ICON_IMG}" width="{topic_icon.ICON_WIDTH}" height="{topic_icon.ICON_HEIGHT}" alt="" title="" /></label> <!-- END topic_icon --></dd>
</dl>
<!-- ENDIF -->
+ <!-- EVENT mcp_topic_options_before -->
<dl>
- <dt><label for="subject">{L_SPLIT_SUBJECT}:</label></dt>
- <dd><input type="text" name="subject" id="subject" size="45" maxlength="64" tabindex="2" value="{SPLIT_SUBJECT}" title="{L_SPLIT_SUBJECT}" class="inputbox" /></dd>
+ <dt><label for="subject">{L_SPLIT_SUBJECT}{L_COLON}</label></dt>
+ <dd><input type="text" name="subject" id="subject" size="45" maxlength="124" tabindex="2" value="{SPLIT_SUBJECT}" title="{L_SPLIT_SUBJECT}" class="inputbox" /></dd>
</dl>
+ <!-- EVENT mcp_topic_options_after -->
<dl>
- <dt><label>{L_SPLIT_FORUM}:</label></dt>
+ <dt><label>{L_SPLIT_FORUM}{L_COLON}</label></dt>
<dd><select name="to_forum_id">{S_FORUM_SELECT}</select></dd>
</dl>
</fieldset>
<!-- ENDIF -->
<!-- IF S_CAN_MERGE -->
- <fieldset id="merge-panel" class="fields2">
+ <fieldset id="merge-panel" class="fields2" role="tabpanel">
<p>{L_MERGE_TOPIC_EXPLAIN}</p>
<dl>
- <dt><label for="to_topic_id">{L_MERGE_TOPIC_ID}:</label></dt>
+ <dt><label for="to_topic_id">{L_MERGE_TOPIC_ID}{L_COLON}</label></dt>
<dd>
- <input class="inputbox autowidth" type="text" size="6" name="to_topic_id" id="to_topic_id" value="{TO_TOPIC_ID}" />
+ <input class="inputbox autowidth" type="number" min="0" max="9999999999" name="to_topic_id" id="to_topic_id" value="{TO_TOPIC_ID}" />
<a href="{U_SELECT_TOPIC}" >{L_SELECT_TOPIC}</a>
</dd>
<!-- IF TO_TOPIC_INFO --><dd>{TO_TOPIC_INFO}</dd><!-- ENDIF -->
@@ -91,32 +81,59 @@ onload_functions.push('subPanels()');
</fieldset>
<!-- ENDIF -->
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<div class="panel">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<h3 id="review">
<span class="right-box"><a href="#review" onclick="viewableArea(getElementById('topicreview'), true); var rev_text = getElementById('review').getElementsByTagName('a').item(0).firstChild; if (rev_text.data == '{LA_EXPAND_VIEW}'){rev_text.data = '{LA_COLLAPSE_VIEW}'; } else if (rev_text.data == '{LA_COLLAPSE_VIEW}'){rev_text.data = '{LA_EXPAND_VIEW}'};">{L_EXPAND_VIEW}</a></span>
- {L_TOPIC_REVIEW}: {TOPIC_TITLE}
+ {L_TOPIC_REVIEW}{L_COLON} <!-- EVENT mcp_topic_topic_title_before -->{TOPIC_TITLE}<!-- EVENT mcp_topic_topic_title_after -->
</h3>
<div id="topicreview">
<!-- BEGIN postrow -->
<div class="post <!-- IF postrow.S_ROW_COUNT is odd -->bg1<!-- ELSE -->bg2<!-- ENDIF -->">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div class="postbody" id="pr{postrow.POST_ID}">
- <ul class="profile-icons"><li class="info-icon"><a href="{postrow.U_POST_DETAILS}" title="{L_POST_DETAILS}"><span>{L_POST_DETAILS}</span></a></li><li><label for="post_id_list_select_{postrow.POST_ID}">{L_SELECT}: <input type="checkbox" id="post_id_list_select_{postrow.POST_ID}" name="post_id_list[]" value="{postrow.POST_ID}"<!-- IF postrow.S_CHECKED --> checked="checked"<!-- ENDIF --> /></label></li></ul>
-
+ <ul class="post-buttons">
+ <li>
+ <a href="{postrow.U_POST_DETAILS}" title="{L_POST_DETAILS}" class="button icon-button info-icon">
+ <span>{L_POST_DETAILS}</span>
+ </a>
+ </li>
+ <li>
+ <label for="post_id_list_select_{postrow.POST_ID}">{L_SELECT}{L_COLON}
+ <input type="checkbox" id="post_id_list_select_{postrow.POST_ID}" name="post_id_list[]" value="{postrow.POST_ID}"<!-- IF postrow.S_CHECKED --> checked="checked"<!-- ENDIF --> />
+ </label>
+ </li>
+ </ul>
+
+ <!-- EVENT mcp_topic_postrow_post_subject_before -->
<h3><a href="{postrow.U_POST_DETAILS}">{postrow.POST_SUBJECT}</a></h3>
+ <!-- EVENT mcp_topic_postrow_post_subject_after -->
+
+ <!-- EVENT mcp_topic_postrow_post_details_before -->
<p class="author"><a href="#pr{postrow.POST_ID}">{postrow.MINI_POST_IMG}</a> {L_POSTED} {postrow.POST_DATE} {L_POST_BY_AUTHOR} <strong>{postrow.POST_AUTHOR_FULL}</strong><!-- IF postrow.U_MCP_DETAILS --> [ <a href="{postrow.U_MCP_DETAILS}">{L_POST_DETAILS}</a> ]<!-- ENDIF --></p>
+ <!-- EVENT mcp_topic_postrow_post_details_after -->
- <!-- IF postrow.S_POST_UNAPPROVED or postrow.S_POST_REPORTED -->
- <p class="rules">
- <!-- IF postrow.S_POST_UNAPPROVED -->{UNAPPROVED_IMG} <a href="{postrow.U_MCP_APPROVE}"><strong>{L_POST_UNAPPROVED}</strong></a><br /><!-- ENDIF -->
- <!-- IF postrow.S_POST_REPORTED -->{REPORTED_IMG} <a href="{postrow.U_MCP_REPORT}"><strong>{L_POST_REPORTED}</strong></a><!-- ENDIF -->
+ <!-- IF postrow.S_POST_UNAPPROVED -->
+ <p class="post-notice unapproved">
+ <a href="{postrow.U_MCP_APPROVE}"><strong>{L_POST_UNAPPROVED}</strong></a>
+ </p>
+ <!-- ENDIF -->
+
+ <!-- IF postrow.S_POST_DELETED -->
+ <p class="post-notice deleted">
+ <a href="{postrow.U_MCP_APPROVE}"><strong>{L_POST_DELETED}</strong></a>
+ </p>
+ <!-- ENDIF -->
+
+ <!-- IF postrow.S_POST_REPORTED -->
+ <p class="post-notice reported">
+ <a href="{postrow.U_MCP_REPORT}"><strong>{L_POST_REPORTED}</strong></a>
</p>
<!-- ENDIF -->
@@ -133,23 +150,25 @@ onload_functions.push('subPanels()');
</div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<!-- END postrow -->
</div>
<hr />
- <!-- IF PAGINATION or TOTAL_POSTS -->
- <ul class="linklist">
- <li class="rightside pagination">
- <!-- IF TOTAL_POSTS --> {TOTAL_POSTS}<!-- ENDIF -->
- <!-- IF PAGE_NUMBER --><!-- IF PAGINATION --> &bull; <a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{PAGE_NUMBER}</a> &bull; <span>{PAGINATION}</span><!-- ELSE --> &bull; {PAGE_NUMBER}<!-- ENDIF --><!-- ENDIF -->
- </li>
- </ul>
- <!-- ENDIF -->
+ <div class="action-bar bottom">
+ <div class="pagination">
+ {TOTAL_POSTS}
+ <!-- IF .pagination -->
+ <!-- INCLUDE pagination.html -->
+ <!-- ELSE -->
+ &bull; {PAGE_NUMBER}
+ <!-- ENDIF -->
+ </div>
+ </div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<fieldset class="display-actions">
@@ -158,6 +177,7 @@ onload_functions.push('subPanels()');
<!-- IF S_CAN_APPROVE --><option value="approve">{L_APPROVE_POSTS}</option><!-- ENDIF -->
<!-- IF S_CAN_LOCK --><option value="lock_post">{L_LOCK_POST_POSTS} [ {L_LOCK_POST_EXPLAIN} ]</option><option value="unlock_post">{L_UNLOCK_POST_POSTS}</option><!-- ENDIF -->
<!-- IF S_CAN_DELETE --><option value="delete_post">{L_DELETE_POSTS}</option><!-- ENDIF -->
+ <!-- IF S_CAN_RESTORE --><option value="restore">{L_RESTORE_POSTS}</option><!-- ENDIF -->
<!-- IF S_CAN_MERGE --><option value="merge_posts"<!-- IF S_MERGE_VIEW --> selected="selected"<!-- ENDIF -->>{L_MERGE_POSTS}</option><!-- ENDIF -->
<!-- IF S_CAN_SPLIT --><option value="split_all"<!-- IF S_SPLIT_VIEW --> selected="selected"<!-- ENDIF -->>{L_SPLIT_POSTS}</option><option value="split_beyond">{L_SPLIT_AFTER}</option><!-- ENDIF -->
<!-- IF S_CAN_SYNC --><option value="resync">{L_RESYNC}</option><!-- ENDIF -->
@@ -170,4 +190,4 @@ onload_functions.push('subPanels()');
</form>
-<!-- INCLUDE mcp_footer.html --> \ No newline at end of file
+<!-- INCLUDE mcp_footer.html -->
diff --git a/phpBB/styles/prosilver/template/mcp_viewlogs.html b/phpBB/styles/prosilver/template/mcp_viewlogs.html
deleted file mode 100644
index 264152d3ae..0000000000
--- a/phpBB/styles/prosilver/template/mcp_viewlogs.html
+++ /dev/null
@@ -1,53 +0,0 @@
-<!-- INCLUDE mcp_header.html -->
-
-<form method="post" id="mcp" action="{S_MCP_ACTION}">
-
-<table class="tablebg" width="100%" cellspacing="1" cellpadding="2" border="0">
-<tr>
- <th colspan="<!-- IF S_TOPIC_ID -->4<!-- ELSE -->5<!-- ENDIF -->" height="28" nowrap="nowrap">{L_DISPLAY_OPTIONS}</th>
-</tr>
-<tr>
- <td colspan="<!-- IF S_TOPIC_ID -->4<!-- ELSE -->5<!-- ENDIF -->" class="cat" height="28" align="center"><span class="gensmall">{L_DISPLAY_LOG}:</span> {S_SELECT_SORT_DAYS}&nbsp;<span class="gensmall">{L_SORT_BY}</span> {S_SELECT_SORT_KEY} {S_SELECT_SORT_DIR}&nbsp;<input class="btnlite" type="submit" name="sort" value="{L_GO}" /></span></td>
-</tr>
-<tr>
- <th width="15%" height="28" nowrap="nowrap">{L_USERNAME}</th>
- <th width="12%" nowrap="nowrap">{L_IP}</th>
- <th width="18%" nowrap="nowrap">{L_TIME}</th>
- <th width="45%" nowrap="nowrap">{L_ACTION}</th>
- <!-- IF not S_TOPIC_ID --><th width="8%" nowrap="nowrap"></th><!-- ENDIF -->
-</tr>
-<!-- IF S_TOPIC_ID -->
- <tr>
- <td class="bg3" colspan="5"><span class="gensmall">{L_LOGS_CURRENT_TOPIC} <a href="{U_VIEW_TOPIC}"><strong>{TOPIC_NAME}</strong></a></td>
- </tr>
-<!-- ENDIF -->
-
-<!-- BEGIN log -->
-<tr>
- <td class="bg1" nowrap="nowrap"><span class="gen">{log.USERNAME}</span></td>
- <td class="bg1" align="center" nowrap="nowrap"><span class="gen">{log.IP}</span></td>
- <td class="bg1" align="center" nowrap="nowrap"><span class="gensmall">{log.TIME}</span></td>
- <td class="bg1"><span class="gen">{log.ACTION}</span></td>
- <!-- IF not S_TOPIC_ID -->
- <td class="bg1" align="center" nowrap="nowrap"><span class="gensmall"><!-- IF log.U_VIEW_TOPIC --><a href="{log.U_VIEW_TOPIC}">{L_VIEW_TOPIC}</a><!-- IF log.U_VIEWLOGS --> | <!-- ENDIF --><!-- ENDIF --><!-- IF log.U_VIEWLOGS --><a href="{log.U_VIEWLOGS}">{L_VIEW_TOPIC_LOGS}</a><!-- ENDIF --></span></td>
- <!-- ENDIF -->
-</tr>
-<!-- BEGINELSE -->
- <tr>
- <td class="bg1" colspan="<!-- IF S_TOPIC_ID -->4<!-- ELSE -->5<!-- ENDIF -->" align="center"><span class="gen">{L_NO_ENTRIES}</span></td>
- </tr>
-<!-- END log -->
-<div>
- {S_FORM_TOKEN}
-</div>
-</table>
-</form>
-
-<table width="100%" cellspacing="2" cellpadding="2" border="0" align="center">
-<tr>
- <td class="nav" align="left" valign="middle">{PAGE_NUMBER}</td>
- <td align="right" valign="top" nowrap="nowrap"><!-- IF PAGINATION --><strong><a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{L_GOTO_PAGE}</a> <!-- IF PREVIOUS_PAGE --><a href="{PREVIOUS_PAGE}">{L_PREVIOUS}</a>&nbsp;&nbsp;<!-- ENDIF -->{PAGINATION}<!-- IF NEXT_PAGE -->&nbsp;&nbsp;<a href="{NEXT_PAGE}">{L_NEXT}</a><!-- ENDIF --></strong><!-- ENDIF --></td>
-</tr>
-</table>
-
-<!-- INCLUDE mcp_footer.html --> \ No newline at end of file
diff --git a/phpBB/styles/prosilver/template/mcp_warn_front.html b/phpBB/styles/prosilver/template/mcp_warn_front.html
index fc8fa37fab..668a0d81a8 100644
--- a/phpBB/styles/prosilver/template/mcp_warn_front.html
+++ b/phpBB/styles/prosilver/template/mcp_warn_front.html
@@ -5,19 +5,19 @@
<h2>{L_WARN_USER}</h2>
<div class="panel">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<h3>{L_SELECT_USER}</h3>
<fieldset>
<dl>
- <dt><label for="username">{L_SELECT_USER}:</label></dt>
+ <dt><label for="username">{L_SELECT_USER}{L_COLON}</label></dt>
<dd><input name="username" id="username" type="text" class="inputbox" /></dd>
<dd><strong><a href="{U_FIND_USERNAME}" onclick="find_username(this.href); return false;">{L_FIND_USERNAME}</a></strong></dd>
</dl>
</fieldset>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<fieldset class="submit-buttons">
@@ -28,12 +28,12 @@
</form>
<div class="panel">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<h3>{L_MOST_WARNINGS}</h3>
<!-- IF .highest -->
- <table class="table1" cellspacing="0">
+ <table class="table1">
<thead>
<tr>
<th class="name">{L_USERNAME}</th>
@@ -51,23 +51,23 @@
<td>{highest.WARNING_TIME}</td>
<td><a href="{highest.U_NOTES}">{L_VIEW_NOTES}</a></td>
</tr>
- <!-- END latest -->
+ <!-- END highest -->
</tbody>
</table>
<!-- ELSE -->
- <p><strong>{L_WARNINGS_ZERO_TOTAL}</strong></p>
+ <p><strong>{L_NO_WARNINGS}</strong></p>
<!-- ENDIF -->
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<div class="panel">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<h3>{L_LATEST_WARNINGS}</h3>
<!-- IF .latest -->
- <table class="table1" cellspacing="0">
+ <table class="table1">
<thead>
<tr>
<th class="name">{L_USERNAME}</th>
@@ -88,10 +88,10 @@
</tbody>
</table>
<!-- ELSE -->
- <p><strong>{L_WARNINGS_ZERO_TOTAL}</strong></p>
+ <p><strong>{L_NO_WARNINGS}</strong></p>
<!-- ENDIF -->
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
-<!-- INCLUDE mcp_footer.html --> \ No newline at end of file
+<!-- INCLUDE mcp_footer.html -->
diff --git a/phpBB/styles/prosilver/template/mcp_warn_list.html b/phpBB/styles/prosilver/template/mcp_warn_list.html
index 3da7c4c389..d0e80a1479 100644
--- a/phpBB/styles/prosilver/template/mcp_warn_list.html
+++ b/phpBB/styles/prosilver/template/mcp_warn_list.html
@@ -5,19 +5,23 @@
<h2>{L_WARNED_USERS}</h2>
<div class="panel">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<p>{L_WARNED_USERS_EXPLAIN}</p>
<!-- IF .user -->
- <ul class="linklist">
- <li class="rightside pagination">
- <!-- IF TOTAL_USERS -->{TOTAL_USERS} <!-- ENDIF -->
- <!-- IF PAGE_NUMBER --><!-- IF PAGINATION --> &bull; <a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{PAGE_NUMBER}</a> &bull; <span>{PAGINATION}</span><!-- ELSE --> &bull; {PAGE_NUMBER}<!-- ENDIF --><!-- ENDIF -->
- </li>
- </ul>
-
- <table class="table1" cellspacing="0">
+ <div class="action-bar top">
+ <div class="pagination">
+ {TOTAL_USERS}
+ <!-- IF .pagination -->
+ <!-- INCLUDE pagination.html -->
+ <!-- ELSE -->
+ &bull; {PAGE_NUMBER}
+ <!-- ENDIF -->
+ </div>
+ </div>
+
+ <table class="table1">
<thead>
<tr>
<th class="name">{L_USERNAME}</th>
@@ -40,27 +44,33 @@
</table>
<fieldset class="display-options">
- <label>{L_DISPLAY_POSTS}: {S_SELECT_SORT_DAYS}</label>
+ <label>{L_DISPLAY_POSTS}{L_COLON} {S_SELECT_SORT_DAYS}</label>
<label>{L_SORT_BY} {S_SELECT_SORT_KEY}</label><label>{S_SELECT_SORT_DIR}</label>
<input type="submit" name="sort" value="{L_GO}" class="button2" />
</fieldset>
+
<hr />
- <ul class="linklist">
- <li class="rightside pagination">
- <!-- IF TOTAL_USERS -->{TOTAL_USERS} <!-- ENDIF -->
- <!-- IF PAGE_NUMBER --><!-- IF PAGINATION --> &bull; <a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{PAGE_NUMBER}</a> &bull; <span>{PAGINATION}</span><!-- ELSE --> &bull; {PAGE_NUMBER}<!-- ENDIF --><!-- ENDIF -->
- </li>
- </ul>
+ <div class="action-bar bottom">
+ <div class="pagination">
+ {TOTAL_USERS}
+ <!-- IF .pagination -->
+ <!-- INCLUDE pagination.html -->
+ <!-- ELSE -->
+ &bull; {PAGE_NUMBER}
+ <!-- ENDIF -->
+ </div>
+ </div>
+
<!-- ELSE -->
- <p><strong>{L_WARNINGS_ZERO_TOTAL}</strong></p>
+ <p><strong>{L_NO_WARNINGS}</strong></p>
<!-- ENDIF -->
- <span class="corners-bottom"><span></span></span></div>
+ </div>
{S_FORM_TOKEN}
</div>
</form>
-<!-- INCLUDE mcp_footer.html --> \ No newline at end of file
+<!-- INCLUDE mcp_footer.html -->
diff --git a/phpBB/styles/prosilver/template/mcp_warn_post.html b/phpBB/styles/prosilver/template/mcp_warn_post.html
index d09209f5a4..59c7d0d495 100644
--- a/phpBB/styles/prosilver/template/mcp_warn_post.html
+++ b/phpBB/styles/prosilver/template/mcp_warn_post.html
@@ -5,7 +5,7 @@
<h2>{L_MCP_WARN_POST}</h2>
<div class="panel">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<h3><!-- IF USER_COLOR --><span style="color: #{USER_COLOR}">{USERNAME}</span><!-- ELSE -->{USERNAME}<!-- ENDIF --></h3>
@@ -16,20 +16,20 @@
<div class="column2">
<dl class="details">
- <!-- IF RANK_TITLE --><dt>{L_RANK}:</dt><dd>{RANK_TITLE}</dd><!-- ENDIF -->
- <!-- IF RANK_IMG --><dt><!-- IF RANK_TITLE -->&nbsp;<!-- ELSE -->{L_RANK}:<!-- ENDIF --></dt><dd>{RANK_IMG}</dd><!-- ENDIF -->
- <dt>{L_JOINED}:</dt><dd>{JOINED}</dd>
- <dt>{L_TOTAL_POSTS}:</dt><dd>{POSTS}</dd>
- <dt>{L_WARNINGS}: </dt><dd>{WARNINGS}</dd>
+ <!-- IF RANK_TITLE --><dt>{L_RANK}{L_COLON}</dt><dd>{RANK_TITLE}</dd><!-- ENDIF -->
+ <!-- IF RANK_IMG --><dt><!-- IF RANK_TITLE -->&nbsp;<!-- ELSE -->{L_RANK}{L_COLON}<!-- ENDIF --></dt><dd>{RANK_IMG}</dd><!-- ENDIF -->
+ <dt>{L_JOINED}{L_COLON}</dt><dd>{JOINED}</dd>
+ <dt>{L_TOTAL_POSTS}{L_COLON}</dt><dd>{POSTS}</dd>
+ <dt>{L_WARNINGS}{L_COLON} </dt><dd>{WARNINGS}</dd>
</dl>
</div>
</div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<div class="panel">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<h3>{L_POST_DETAILS}</h3>
@@ -41,11 +41,13 @@
</div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
+<!-- EVENT mcp_warn_post_add_warning_field_before -->
+
<div class="panel">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<h3>{L_ADD_WARNING}</h3>
<p>{L_ADD_WARNING_EXPLAIN}</p>
@@ -61,9 +63,11 @@
<!-- ENDIF -->
</fieldset>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
+<!-- EVENT mcp_warn_post_add_warning_field_after -->
+
<fieldset class="submit-buttons">
<input type="reset" value="{L_RESET}" name="reset" class="button2" />&nbsp;
<input type="submit" name="action[add_warning]" value="{L_SUBMIT}" class="button1" />
@@ -71,4 +75,4 @@
</fieldset>
</form>
-<!-- INCLUDE mcp_footer.html --> \ No newline at end of file
+<!-- INCLUDE mcp_footer.html -->
diff --git a/phpBB/styles/prosilver/template/mcp_warn_user.html b/phpBB/styles/prosilver/template/mcp_warn_user.html
index dfc167399f..1ad6df7ade 100644
--- a/phpBB/styles/prosilver/template/mcp_warn_user.html
+++ b/phpBB/styles/prosilver/template/mcp_warn_user.html
@@ -5,7 +5,7 @@
<h2>{L_WARN_USER}</h2>
<div class="panel">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<h3>{USERNAME_FULL}</h3>
@@ -16,20 +16,22 @@
<div class="column2">
<dl class="details">
- <!-- IF RANK_TITLE --><dt>{L_RANK}:</dt><dd>{RANK_TITLE}</dd><!-- ENDIF -->
- <!-- IF RANK_IMG --><dt><!-- IF RANK_TITLE -->&nbsp;<!-- ELSE -->{L_RANK}:<!-- ENDIF --></dt><dd>{RANK_IMG}</dd><!-- ENDIF -->
- <dt>{L_JOINED}:</dt><dd>{JOINED}</dd>
- <dt>{L_TOTAL_POSTS}:</dt><dd>{POSTS}</dd>
- <dt>{L_WARNINGS}: </dt><dd>{WARNINGS}</dd>
+ <!-- IF RANK_TITLE --><dt>{L_RANK}{L_COLON}</dt><dd>{RANK_TITLE}</dd><!-- ENDIF -->
+ <!-- IF RANK_IMG --><dt><!-- IF RANK_TITLE -->&nbsp;<!-- ELSE -->{L_RANK}{L_COLON}<!-- ENDIF --></dt><dd>{RANK_IMG}</dd><!-- ENDIF -->
+ <dt>{L_JOINED}{L_COLON}</dt><dd>{JOINED}</dd>
+ <dt>{L_TOTAL_POSTS}{L_COLON}</dt><dd>{POSTS}</dd>
+ <dt>{L_WARNINGS}{L_COLON} </dt><dd>{WARNINGS}</dd>
</dl>
</div>
</div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
+<!-- EVENT mcp_warn_user_add_warning_field_before -->
+
<div class="panel">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<h3>{L_ADD_WARNING}</h3>
<p>{L_ADD_WARNING_EXPLAIN}</p>
@@ -45,9 +47,11 @@
<!-- ENDIF -->
</fieldset>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
+<!-- EVENT mcp_warn_user_add_warning_field_after -->
+
<fieldset class="submit-buttons">
<input type="reset" value="{L_RESET}" name="reset" class="button2" />&nbsp;
<input type="submit" name="action[add_warning]" value="{L_SUBMIT}" class="button1" />
@@ -55,4 +59,4 @@
</fieldset>
</form>
-<!-- INCLUDE mcp_footer.html --> \ No newline at end of file
+<!-- INCLUDE mcp_footer.html -->
diff --git a/phpBB/styles/prosilver/template/mcp_whois.html b/phpBB/styles/prosilver/template/mcp_whois.html
index 5872bd0b91..41a825458d 100644
--- a/phpBB/styles/prosilver/template/mcp_whois.html
+++ b/phpBB/styles/prosilver/template/mcp_whois.html
@@ -2,15 +2,15 @@
<h2>{L_WHOIS}</h2>
<div class="panel">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
- <p><a class="{S_CONTENT_FLOW_BEGIN}" href="{U_RETURN_POST}">{L_RETURN_POST}</a></p>
+ <p><a class="arrow-{S_CONTENT_FLOW_BEGIN}" href="{U_RETURN_POST}">{L_RETURN_POST}</a></p>
<div class="postbody"><div class="content">
<pre>{WHOIS}</pre>
</div></div>
- <p><a class="{S_CONTENT_FLOW_BEGIN}" href="{U_RETURN_POST}">{L_RETURN_POST}</a></p>
+ <p><a class="arrow-{S_CONTENT_FLOW_BEGIN}" href="{U_RETURN_POST}">{L_RETURN_POST}</a></p>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
-<!-- INCLUDE mcp_footer.html --> \ No newline at end of file
+<!-- INCLUDE mcp_footer.html -->
diff --git a/phpBB/styles/prosilver/template/memberlist_body.html b/phpBB/styles/prosilver/template/memberlist_body.html
index 5ea774bf06..5fba59159c 100644
--- a/phpBB/styles/prosilver/template/memberlist_body.html
+++ b/phpBB/styles/prosilver/template/memberlist_body.html
@@ -1,64 +1,63 @@
<!-- IF S_IN_SEARCH_POPUP -->
<!-- INCLUDE simple_header.html -->
<!-- INCLUDE memberlist_search.html -->
- <form method="post" id="results" action="{S_MODE_ACTION}" onsubmit="insert_marked(this.user); return false">
-
-<!-- ELSEIF S_SEARCH_USER -->
- <!-- INCLUDE overall_header.html -->
- <!-- INCLUDE memberlist_search.html -->
- <form method="post" action="{S_MODE_ACTION}">
+ <form method="post" id="results" action="{S_MODE_ACTION}" onsubmit="insert_marked_users('#results', this.user); return false;" data-form-name="{S_FORM_NAME}" data-field-name="{S_FIELD_NAME}">
<!-- ELSE -->
<!-- INCLUDE overall_header.html -->
+ <div class="panel" id="memberlist_search"<!-- IF not S_SEARCH_USER --> style="display: none;"<!-- ENDIF -->>
+ <!-- INCLUDE memberlist_search.html -->
+ </div>
<form method="post" action="{S_MODE_ACTION}">
<!-- ENDIF -->
<!-- IF S_SHOW_GROUP -->
-
- <h2<!-- IF GROUP_COLOR --> style="color:#{GROUP_COLOR};"<!-- ENDIF -->>{GROUP_NAME}</h2>
+ <h2 class="group-title"<!-- IF GROUP_COLOR --> style="color:#{GROUP_COLOR};"<!-- ENDIF -->>{GROUP_NAME}</h2>
+ <!-- IF U_MANAGE -->
+ <p class="right responsive-center manage rightside"><a href="{U_MANAGE}">{L_MANAGE_GROUP}</a></p>
+ <!-- ENDIF -->
<p>{GROUP_DESC} {GROUP_TYPE}</p>
+
<p>
<!-- IF AVATAR_IMG -->{AVATAR_IMG}<!-- ENDIF -->
<!-- IF RANK_IMG -->{RANK_IMG}<!-- ENDIF -->
<!-- IF GROUP_RANK -->{GROUP_RANK}<!-- ENDIF -->
</p>
-
<!-- ELSE -->
- <h2 class="solo">{PAGE_TITLE}<!-- IF SEARCH_WORDS -->: <a href="{U_SEARCH_WORDS}">{SEARCH_WORDS}</a><!-- ENDIF --></h2>
+ <h2 class="solo">{PAGE_TITLE}<!-- IF SEARCH_WORDS -->{L_COLON} <a href="{U_SEARCH_WORDS}">{SEARCH_WORDS}</a><!-- ENDIF --></h2>
- <div class="panel">
- <div class="inner"><span class="corners-top"><span></span></span>
-
- <ul class="linklist">
- <li>
-
- <!-- IF U_FIND_MEMBER and not S_SEARCH_USER --><a href="{U_FIND_MEMBER}">{L_FIND_USERNAME}</a> &bull; <!-- ELSEIF S_SEARCH_USER and U_HIDE_FIND_MEMBER and not S_IN_SEARCH_POPUP --><a href="{U_HIDE_FIND_MEMBER}">{L_HIDE_MEMBER_SEARCH}</a> &bull; <!-- ENDIF -->
- <strong style="font-size: 0.95em;">
+ <div class="action-bar top">
+ <div class="member-search panel">
+ <!-- IF U_FIND_MEMBER and not S_SEARCH_USER --><a href="{U_FIND_MEMBER}" id="member_search" data-alt-text="{LA_HIDE_MEMBER_SEARCH}">{L_FIND_USERNAME}</a> &bull; <!-- ELSEIF S_SEARCH_USER and U_HIDE_FIND_MEMBER and not S_IN_SEARCH_POPUP --><a href="{U_HIDE_FIND_MEMBER}" id="member_search" data-alt-text="{LA_FIND_USERNAME}">{L_HIDE_MEMBER_SEARCH}</a> &bull; <!-- ENDIF -->
+ <strong>
<!-- BEGIN first_char -->
- <a href="{first_char.U_SORT}">{first_char.DESC}</a>&nbsp;
+ <a href="{first_char.U_SORT}">{first_char.DESC}</a>&nbsp;
<!-- END first_char -->
</strong>
- </li>
- <li class="rightside pagination">
- {TOTAL_USERS} &bull;
- <!-- IF PAGINATION --><a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{PAGE_NUMBER}</a> &bull; <span>{PAGINATION}</span><!-- ELSE -->{PAGE_NUMBER}<!-- ENDIF -->
- </li>
- </ul>
-
- <span class="corners-bottom"><span></span></span></div>
+ </div>
+
+ <div class="pagination">
+ {TOTAL_USERS}
+ <!-- IF .pagination -->
+ <!-- INCLUDE pagination.html -->
+ <!-- ELSE -->
+ &bull; {PAGE_NUMBER}
+ <!-- ENDIF -->
+ </div>
</div>
<!-- ENDIF -->
+
<!-- IF S_LEADERS_SET or not S_SHOW_GROUP or not .memberrow -->
<div class="forumbg forumbg-table">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
- <table class="table1" cellspacing="1" id="memberlist">
+ <table class="table1" id="memberlist">
<thead>
<tr>
- <th class="name"><span class="rank-img"><a href="{U_SORT_RANK}">{L_RANK}</a></span><a href="{U_SORT_USERNAME}"><!-- IF S_SHOW_GROUP and .memberrow -->{L_GROUP_LEADER}<!-- ELSE -->{L_USERNAME}<!-- ENDIF --></a></th>
+ <th class="name" data-dfn="{L_RANK}{L_COMMA_SEPARATOR}<!-- IF S_SHOW_GROUP and .memberrow -->{L_GROUP_LEADER}<!-- ELSE -->{L_USERNAME}<!-- ENDIF -->"><span class="rank-img"><a href="{U_SORT_RANK}">{L_RANK}</a></span><a href="{U_SORT_USERNAME}"><!-- IF S_SHOW_GROUP and .memberrow -->{L_GROUP_LEADER}<!-- ELSE -->{L_USERNAME}<!-- ENDIF --></a></th>
<th class="posts"><a href="{U_SORT_POSTS}#memberlist">{L_POSTS}</a></th>
- <th class="info"><a href="{U_SORT_WEBSITE}#memberlist">{L_WEBSITE}</a>{L_COMMA_SEPARATOR}<a href="{U_SORT_LOCATION}">{L_LOCATION}</a></th>
+ <th class="info"><!-- BEGIN custom_fields --><!-- IF not custom_fields.S_FIRST_ROW -->{L_COMMA_SEPARATOR} <!-- ENDIF -->{custom_fields.PROFILE_FIELD_NAME}<!-- END custom_fields --></th>
<th class="joined"><a href="{U_SORT_JOINED}#memberlist">{L_JOINED}</a></th>
<!-- IF U_SORT_ACTIVE --><th class="active"><a href="{U_SORT_ACTIVE}#memberlist">{L_LAST_ACTIVE}</a></th><!-- ENDIF -->
</tr>
@@ -77,27 +76,27 @@
</tbody>
</table>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<!-- ENDIF -->
<div class="forumbg forumbg-table">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
- <table class="table1" cellspacing="1">
+ <table class="table1">
<thead>
<tr>
<!-- IF not S_LEADERS_SET -->
- <th class="name"><span class="rank-img"><a href="{U_SORT_RANK}">{L_RANK}</a></span><a href="{U_SORT_USERNAME}"><!-- IF S_SHOW_GROUP -->{L_GROUP_MEMBERS}<!-- ELSE -->{L_USERNAME}<!-- ENDIF --></a></th>
+ <th class="name" data-dfn="{L_RANK}{L_COMMA_SEPARATOR}{L_USERNAME}"><span class="rank-img"><a href="{U_SORT_RANK}">{L_RANK}</a></span><a href="{U_SORT_USERNAME}"><!-- IF S_SHOW_GROUP -->{L_GROUP_MEMBERS}<!-- ELSE -->{L_USERNAME}<!-- ENDIF --></a></th>
<th class="posts"><a href="{U_SORT_POSTS}#memberlist">{L_POSTS}</a></th>
- <th class="info"><a href="{U_SORT_WEBSITE}#memberlist">{L_WEBSITE}</a>{L_COMMA_SEPARATOR}<a href="{U_SORT_LOCATION}">{L_LOCATION}</a></th>
+ <th class="info"><!-- BEGIN custom_fields --><!-- IF not custom_fields.S_FIRST_ROW -->{L_COMMA_SEPARATOR} <!-- ENDIF -->{custom_fields.PROFILE_FIELD_NAME}<!-- END custom_fields --></th>
<th class="joined"><a href="{U_SORT_JOINED}#memberlist">{L_JOINED}</a></th>
<!-- IF U_SORT_ACTIVE --><th class="active"><a href="{U_SORT_ACTIVE}#memberlist">{L_LAST_ACTIVE}</a></th><!-- ENDIF -->
<!-- ELSEIF S_SHOW_GROUP -->
<th class="name">{L_GROUP_MEMBERS}</th>
- <th class="posts">&nbsp;</th>
- <th class="info">&nbsp;</th>
- <th class="joined">&nbsp;</th>
- <!-- IF U_SORT_ACTIVE --><th class="active">&nbsp;</th><!-- ENDIF -->
+ <th class="posts">{L_POSTS}</th>
+ <th class="info"><!-- BEGIN custom_fields --><!-- IF not custom_fields.S_FIRST_ROW -->{L_COMMA_SEPARATOR} <!-- ENDIF -->{custom_fields.PROFILE_FIELD_NAME}<!-- END custom_fields --></th>
+ <th class="joined">{L_JOINED}</th>
+ <!-- IF U_SORT_ACTIVE --><th class="active">{L_LAST_ACTIVE}</th><!-- ENDIF -->
<!-- ENDIF -->
</tr>
</thead>
@@ -106,12 +105,12 @@
<!-- ENDIF -->
<!-- ENDIF -->
- <tr class="<!-- IF memberrow.S_ROW_COUNT is even -->bg1<!-- ELSE -->bg2<!-- ENDIF -->">
- <td><!-- IF memberrow.RANK_IMG --><span class="rank-img">{memberrow.RANK_IMG}</span><!-- ELSE --><span class="rank-img">{memberrow.RANK_TITLE}</span><!-- ENDIF --><!-- IF S_IN_SEARCH_POPUP and not S_SELECT_SINGLE --><input type="checkbox" name="user" value="{memberrow.USERNAME}" /> <!-- ENDIF -->{memberrow.USERNAME_FULL}<!-- IF S_SELECT_SINGLE --><br />[&nbsp;<a href="#" onclick="insert_single('{memberrow.A_USERNAME}'); return false;">{L_SELECT}</a>&nbsp;]<!-- ENDIF --></td>
+ <tr class="<!-- IF memberrow.S_ROW_COUNT is even -->bg1<!-- ELSE -->bg2<!-- ENDIF --><!-- IF memberrow.S_INACTIVE --> inactive<!-- ENDIF -->">
+ <td><span class="rank-img"><!-- EVENT memberlist_body_rank_prepend --><!-- IF memberrow.RANK_IMG -->{memberrow.RANK_IMG}<!-- ELSE -->{memberrow.RANK_TITLE}<!-- ENDIF --><!-- EVENT memberlist_body_rank_append --></span><!-- IF S_IN_SEARCH_POPUP and not S_SELECT_SINGLE --><input type="checkbox" name="user" value="{memberrow.USERNAME}" /> <!-- ENDIF --><!-- EVENT memberlist_body_username_prepend -->{memberrow.USERNAME_FULL}<!-- IF memberrow.S_INACTIVE --> ({L_INACTIVE})<!-- ENDIF --><!-- EVENT memberlist_body_username_append --><!-- IF S_IN_SEARCH_POPUP --><br />[&nbsp;<a href="#" onclick="insert_single_user('#results', '{memberrow.A_USERNAME}'); return false;">{L_SELECT}</a>&nbsp;]<!-- ENDIF --></td>
<td class="posts"><!-- IF memberrow.POSTS and S_DISPLAY_SEARCH --><a href="{memberrow.U_SEARCH_USER}" title="{L_SEARCH_USER_POSTS}">{memberrow.POSTS}</a><!-- ELSE -->{memberrow.POSTS}<!-- ENDIF --></td>
- <td class="info"><!-- IF memberrow.U_WWW or memberrow.LOCATION --><!-- IF memberrow.U_WWW --><div><a href="{memberrow.U_WWW}" title="{L_VISIT_WEBSITE}: {memberrow.U_WWW}">{memberrow.U_SHORT_WWW}</a></div><!-- ENDIF --><!-- IF memberrow.LOCATION --><div>{memberrow.LOCATION}</div><!-- ENDIF --><!-- ELSE -->&nbsp;<!-- ENDIF --></td>
+ <td class="info"><!-- BEGIN custom_fields --><div>{memberrow.custom_fields.PROFILE_FIELD_VALUE}</div><!-- BEGINELSE -->&nbsp;<!-- END custom_fields --></td>
<td>{memberrow.JOINED}</td>
- <!-- IF S_VIEWONLINE --><td>{memberrow.VISITED}&nbsp;</td><!-- ENDIF -->
+ <!-- IF S_VIEWONLINE --><td>{memberrow.LAST_ACTIVE}&nbsp;</td><!-- ENDIF -->
</tr>
<!-- BEGINELSE -->
<tr class="bg1">
@@ -121,7 +120,7 @@
</tbody>
</table>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<!-- IF S_IN_SEARCH_POPUP and not S_SELECT_SINGLE -->
@@ -138,24 +137,28 @@
<!-- IF S_IN_SEARCH_POPUP and not S_SEARCH_USER -->
<fieldset class="display-options">
- <!-- IF PREVIOUS_PAGE --><a href="{PREVIOUS_PAGE}" class="left-box {S_CONTENT_FLOW_BEGIN}">{L_PREVIOUS}</a><!-- ENDIF -->
- <!-- IF NEXT_PAGE --><a href="{NEXT_PAGE}" class="right-box {S_CONTENT_FLOW_END}">{L_NEXT}</a><!-- ENDIF -->
- <label for="sk">{L_SELECT_SORT_METHOD}: <select name="sk" id="sk">{S_MODE_SELECT}</select></label>
- <label for="sd">{L_ORDER} <select name="sd" id="sd">{S_ORDER_SELECT}</select> <input type="submit" name="sort" value="{L_SUBMIT}" class="button2" /></label>
+ <label for="sk">{L_SELECT_SORT_METHOD}{L_COLON} <select name="sk" id="sk">{S_MODE_SELECT}</select></label>
+ <label for="sd">{L_ORDER} <select name="sd" id="sd">{S_ORDER_SELECT}</select></label>
+ <input type="submit" name="sort" value="{L_SUBMIT}" class="button2" />
</fieldset>
<!-- ENDIF -->
</form>
-<hr />
-
-<ul class="linklist">
- <li class="rightside pagination">{TOTAL_USERS} &bull; <!-- IF PAGINATION --><a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{PAGE_NUMBER}</a> &bull; <span>{PAGINATION}</span><!-- ELSE -->{PAGE_NUMBER}<!-- ENDIF --></li>
-</ul>
+<div class="action-bar bottom">
+ <div class="pagination">
+ {TOTAL_USERS}
+ <!-- IF .pagination -->
+ <!-- INCLUDE pagination.html -->
+ <!-- ELSE -->
+ &bull; {PAGE_NUMBER}
+ <!-- ENDIF -->
+ </div>
+</div>
<!-- IF S_IN_SEARCH_POPUP -->
<!-- INCLUDE simple_footer.html -->
<!-- ELSE -->
<!-- INCLUDE jumpbox.html -->
<!-- INCLUDE overall_footer.html -->
-<!-- ENDIF --> \ No newline at end of file
+<!-- ENDIF -->
diff --git a/phpBB/styles/prosilver/template/memberlist_email.html b/phpBB/styles/prosilver/template/memberlist_email.html
index e8870d8921..eea699da08 100644
--- a/phpBB/styles/prosilver/template/memberlist_email.html
+++ b/phpBB/styles/prosilver/template/memberlist_email.html
@@ -1,65 +1,107 @@
<!-- INCLUDE overall_header.html -->
-<h2 class="titlespace">{L_SEND_EMAIL_USER} {USERNAME}</h2>
+<!-- EVENT memberlist_email_before -->
+
+<!-- IF S_CONTACT_ADMIN-->
+<h2 class="titlespace">{L_CONTACT_ADMIN}</h2>
+<!-- ELSEIF S_SEND_USER -->
+<h2 class="titlespace">{L_SEND_EMAIL_USER}</h2>
+<!-- ELSE -->
+<h2 class="titlespace">{L_EMAIL_TOPIC}</h2>
+<!-- ENDIF -->
<form method="post" action="{S_POST_ACTION}" id="post">
-<div class="panel">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <!-- IF CONTACT_INFO -->
+ <div class="panel">
+ <div class="inner">
+ <div class="postbody">
+ <div class="content">
+ {CONTACT_INFO}
+ </div>
+ </div>
+ </div>
+ </div>
+ <br class="clear" />
+ <!-- ENDIF -->
+ <div class="panel">
+ <div class="inner">
<div class="content">
+
<!-- IF ERROR_MESSAGE --><p class="error">{ERROR_MESSAGE}</p><!-- ENDIF -->
<fieldset class="fields2">
<!-- IF S_SEND_USER -->
<dl>
- <dt><label>{L_RECIPIENT}:</label></dt>
- <dd><strong>{USERNAME}</strong></dd>
+ <dt><label>{L_RECIPIENT}{L_COLON}</label></dt>
+ <dd><strong>{USERNAME_FULL}</strong></dd>
</dl>
<dl>
- <dt><label for="subject">{L_SUBJECT}:</label></dt>
+ <dt><label for="subject">{L_SUBJECT}{L_COLON}</label></dt>
<dd><input class="inputbox autowidth" type="text" name="subject" id="subject" size="50" tabindex="1" value="{SUBJECT}" /></dd>
</dl>
+ <!-- ELSEIF S_CONTACT_ADMIN-->
+ <dl>
+ <dt><label>{L_RECIPIENT}{L_COLON}</label></dt>
+ <dd><strong>{L_ADMINISTRATOR}</strong></dd>
+ </dl>
+ <!-- IF not S_IS_REGISTERED -->
+ <dl>
+ <dt><label for="email">{L_SENDER_EMAIL_ADDRESS}{L_COLON}</label></dt>
+ <dd><input class="inputbox autowidth" type="text" name="email" id="email" size="50" maxlength="100" tabindex="1" value="{EMAIL}" /></dd>
+ </dl>
+ <dl>
+ <dt><label for="name">{L_SENDER_NAME}{L_COLON}</label></dt>
+ <dd><input class="inputbox autowidth" type="text" name="name" id="name" size="50" tabindex="2" value="{NAME}" /></dd>
+ </dl>
+ <!-- ENDIF -->
+ <dl>
+ <dt><label for="subject">{L_SUBJECT}{L_COLON}</label></dt>
+ <dd><input class="inputbox autowidth" type="text" name="subject" id="subject" size="50" tabindex="3" value="{SUBJECT}" /></dd>
+ </dl>
<!-- ELSE -->
<dl>
- <dt><label for="email">{L_EMAIL_ADDRESS}:</label></dt>
- <dd><input class="inputbox autowidth" type="text" name="email" id="email" size="50" maxlength="100" tabindex="2" value="{EMAIL}" /></dd>
+ <dt><label for="email">{L_EMAIL_ADDRESS}{L_COLON}</label></dt>
+ <dd><input class="inputbox autowidth" type="email" name="email" id="email" size="50" maxlength="100" tabindex="2" value="{EMAIL}" /></dd>
</dl>
<dl>
- <dt><label for="name">{L_REAL_NAME}:</label></dt>
+ <dt><label for="name">{L_REAL_NAME}{L_COLON}</label></dt>
<dd><input class="inputbox autowidth" type="text" name="name" id="name" size="50" tabindex="3" value="{NAME}" /></dd>
</dl>
<dl>
- <dt><label for="lang">{L_DEST_LANG}:</label><br />
+ <dt><label for="lang">{L_DEST_LANG}{L_COLON}</label><br />
<span>{L_DEST_LANG_EXPLAIN}</span></dt>
<dd><select name="lang">{S_LANG_OPTIONS}</select></dd>
</dl>
<!-- ENDIF -->
<dl>
- <dt><label for="message">{L_MESSAGE_BODY}:</label><br />
+ <dt><label for="message">{L_MESSAGE_BODY}{L_COLON}</label><br />
<span>{L_EMAIL_BODY_EXPLAIN}</span></dt>
<dd><textarea class="inputbox" name="message" id="message" rows="15" cols="76" tabindex="4">{MESSAGE}</textarea></dd>
</dl>
+ <!-- IF S_REGISTERED_USER -->
<dl>
<dt>&nbsp;</dt>
- <dd><label for="cc_email"><input type="checkbox" name="cc_email" id="cc_email" value="1" checked="checked" tabindex="5" /> {L_CC_EMAIL}</label></dd>
+ <dd><label for="cc_sender"><input type="checkbox" name="cc_sender" id="cc_sender" value="1" checked="checked" tabindex="5" /> {L_CC_SENDER}</label></dd>
</dl>
+ <!-- ENDIF -->
</fieldset>
</div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<div class="panel">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div class="content">
<fieldset class="submit-buttons">
<input type="submit" tabindex="6" name="submit" class="button1" value="{L_SEND_EMAIL}" />
</fieldset>
</div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
{S_FORM_TOKEN}
</div>
</form>
-<!-- INCLUDE overall_footer.html --> \ No newline at end of file
+<!-- INCLUDE overall_footer.html -->
diff --git a/phpBB/styles/prosilver/template/memberlist_im.html b/phpBB/styles/prosilver/template/memberlist_im.html
index 49de3b2596..874607d913 100644
--- a/phpBB/styles/prosilver/template/memberlist_im.html
+++ b/phpBB/styles/prosilver/template/memberlist_im.html
@@ -1,158 +1,46 @@
<!-- INCLUDE simple_header.html -->
-<!-- MSNM info from http://www.cdolive.net/ - doesn't seem to work with MSN Messenger -->
-<h2 class="solo">{L_SEND_IM}</h2>
+<h2>{L_SEND_IM}</h2>
<form method="post" action="{S_IM_ACTION}">
<div class="panel bg2">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<p>{L_SEND_IM_EXPLAIN}</p>
+ <!-- IF S_SENT_JABBER -->
+ <p>{L_IM_SENT_JABBER}</p>
+ <!-- ENDIF -->
+
<fieldset>
<dl class="fields2">
- <dt><label>{L_IM_RECIPIENT}:</label></dt>
- <dd><strong>{USERNAME}</strong><!-- IF S_SEND_ICQ or S_SEND_AIM or S_SEND_MSNM or S_NO_SEND_JABBER --> [ {IM_CONTACT} ]<!-- ENDIF --><!-- IF PRESENCE_IMG --> {PRESENCE_IMG}<!-- ENDIF --></dd>
+ <dt><label>{L_IM_RECIPIENT}{L_COLON}</label></dt>
+ <dd><strong>{USERNAME}</strong><!-- IF S_NO_SEND_JABBER --> [ {IM_CONTACT} ]<!-- ENDIF --><!-- IF PRESENCE_IMG --> {PRESENCE_IMG}<!-- ENDIF --></dd>
</dl>
- <!-- IF S_SEND_ICQ -->
- <dl class="fields2">
- <dt><label for="from">{L_IM_NAME}:</label></dt>
- <dd><input class="inputbox autowidth" type="text" name="from" id="from" size="20" /></dd>
- </dl>
- <dl class="fields2">
- <dt><label for="body">{L_IM_MESSAGE}:</label></dt>
- <dd><textarea class="inputbox autowidth" name="body" id="body" rows="5" cols="45"></textarea></dd>
- </dl>
- <dl class="fields2">
- <dt>&nbsp;</dt>
- <dd><input class="button1" name="submit" type="submit" value="{L_IM_SEND}" /></dd>
- </dl>
- <input type="hidden" name="fromemail" value="{EMAIL}" />
- <input type="hidden" name="subject" value="{SITENAME}" />
- <input type="hidden" name="to" value="{IM_CONTACT}" />
- <!-- ENDIF -->
-
- <!-- IF S_SEND_AIM -->
- <dl class="fields2">
- <dt>&nbsp;</dt>
- <dd><a href="{U_AIM_CONTACT}">{L_IM_ADD_CONTACT}</a></dd>
- <dd><a href="{U_AIM_MESSAGE}">{L_IM_SEND_MESSAGE}</a></dd>
- <dd><a href="http://www.aim.com">{L_IM_DOWNLOAD_APP}</a> | <a href="http://www.aim.com/products/express">{L_IM_AIM_EXPRESS}</a></dd>
- </dl>
- <!-- ENDIF -->
-
- <!-- IF S_SEND_MSNM -->
- <dl class="fields2">
- <dt>&nbsp;</dt>
- <dd><object classid="clsid:B69003B3-C55E-4B48-836C-BC5946FC3B28" codetype="application/x-oleobject" id="objMessengerApp" width="0" height="0"></object></dd>
- <dd><a href="#" onclick="add_contact('{A_IM_CONTACT}'); return false;">{L_IM_ADD_CONTACT}</a></dd>
- <dd><a href="#" onclick="im_contact('{A_IM_CONTACT}'); return false;">{L_IM_SEND_MESSAGE}</a></dd>
- </dl>
- <!-- ENDIF -->
-
<!-- IF S_SEND_JABBER -->
<dl class="fields2">
- <dt><label for="message">{L_IM_MESSAGE}:</label></dt>
+ <dt><label for="message">{L_IM_MESSAGE}{L_COLON}</label></dt>
<dd><textarea class="inputbox autowidth" name="message" id="message" rows="5" cols="45"></textarea></dd>
</dl>
<dl class="fields2">
<dt>&nbsp;</dt>
<dd><input class="button1" name="submit" type="submit" value="{L_IM_SEND}" /></dd>
</dl>
- <!-- ENDIF -->
-
- <!-- IF S_NO_SEND_JABBER -->
+ <!-- ELSE IF S_NO_SEND_JABBER -->
<dl class="fields2">
<dt>&nbsp;</dt>
<dd>{L_IM_NO_JABBER}</dd>
</dl>
<!-- ENDIF -->
-
- <!-- IF S_SENT_JABBER -->
- <dl class="fields2">
- <dt>&nbsp;</dt>
- <dd>{L_IM_SENT_JABBER}</dd>
- </dl>
- <!-- ENDIF -->
{S_FORM_TOKEN}
</fieldset>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
</form>
<a href="#" onclick="window.close(); return false;">{L_CLOSE_WINDOW}</a>
-<script type="text/javascript">
-// <![CDATA[
-
- /** The following will not work with Windows Vista **/
-
- var app = document.getElementById('objMessengerApp');
-
- /**
- * Check whether the browser supports this and whether MSNM is connected
- */
- function msn_supported()
- {
- // Does the browser support the MSNM object?
- if (app.MyStatus)
- {
- // Is MSNM connected?
- if (app.MyStatus == 1)
- {
- alert('{LA_IM_MSNM_CONNECT}');
- return false;
- }
- }
- else
- {
- alert('{LA_IM_MSNM_BROWSER}');
- return false;
- }
- return true;
- }
-
- /**
- * Add to your contact list
- */
- function add_contact(address)
- {
- if (msn_supported())
- {
- // Could return an error while MSNM is connecting, don't want that
- try
- {
- app.AddContact(0, address);
- }
- catch (e)
- {
- return;
- }
- }
-}
-
-/**
-* Write IM to contact
-*/
-function im_contact(address)
-{
- if (msn_supported())
- {
- // Could return an error while MSNM is connecting, don't want that
- try
- {
- app.InstantMessage(address);
- }
- catch (e)
- {
- return;
- }
- }
-}
-// ]]>
-</script>
-
-<!-- INCLUDE simple_footer.html --> \ No newline at end of file
+<!-- INCLUDE simple_footer.html -->
diff --git a/phpBB/styles/prosilver/template/memberlist_leaders.html b/phpBB/styles/prosilver/template/memberlist_leaders.html
deleted file mode 100644
index 26e299d261..0000000000
--- a/phpBB/styles/prosilver/template/memberlist_leaders.html
+++ /dev/null
@@ -1,76 +0,0 @@
-<!-- INCLUDE overall_header.html -->
-
-<h2 class="solo">{PAGE_TITLE}</h2>
-
-<form method="post" action="{S_MODE_ACTION}">
-
-<div class="forumbg forumbg-table">
- <div class="inner"><span class="corners-top"><span></span></span>
-
- <table class="table1" cellspacing="1">
- <thead>
- <tr>
- <th class="name"><span class="rank-img">{L_RANK}&nbsp;</span>{L_ADMINISTRATORS}</th>
- <th class="info">{L_PRIMARY_GROUP}</th>
- <th class="info">{L_FORUMS}</th>
- </tr>
- </thead>
- <tbody>
-<!-- BEGIN admin -->
- <tr class="<!-- IF admin.S_ROW_COUNT is even -->bg1<!-- ELSE -->bg2<!-- ENDIF -->">
- <td><!-- IF admin.RANK_IMG --><span class="rank-img">{admin.RANK_IMG}</span><!-- ELSE --><span class="rank-img">{admin.RANK_TITLE}</span><!-- ENDIF -->{admin.USERNAME_FULL}</td>
- <td class="info"><!-- IF admin.U_GROUP -->
- <a<!-- IF admin.GROUP_COLOR --> style="font-weight: bold; color:#{admin.GROUP_COLOR}"<!-- ENDIF --> href="{admin.U_GROUP}">{admin.GROUP_NAME}</a>
- <!-- ELSE -->
- {admin.GROUP_NAME}
- <!-- ENDIF --></td>
- <td class="info">-</td>
- </tr>
-<!-- BEGINELSE -->
- <tr class="bg1">
- <td colspan="3"><strong>{L_NO_ADMINISTRATORS}</strong></td>
- </tr>
-<!-- END admin -->
- </tbody>
- </table>
-
- <span class="corners-bottom"><span></span></span></div>
-</div>
-
-<div class="forumbg forumbg-table">
- <div class="inner"><span class="corners-top"><span></span></span>
-
- <table class="table1" cellspacing="1">
- <thead>
- <tr>
- <th class="name">{L_MODERATORS}</th>
- <th class="info">&nbsp;</th>
- <th class="info">&nbsp;</th>
- </tr>
- </thead>
- <tbody>
-<!-- BEGIN mod -->
- <tr class="<!-- IF mod.S_ROW_COUNT is even -->bg1<!-- ELSE -->bg2<!-- ENDIF -->">
- <td><!-- IF mod.RANK_IMG --><span class="rank-img">{mod.RANK_IMG}</span><!-- ELSE --><span class="rank-img">{mod.RANK_TITLE}</span><!-- ENDIF -->{mod.USERNAME_FULL}</td>
- <td class="info"><!-- IF mod.U_GROUP -->
- <a<!-- IF mod.GROUP_COLOR --> style="font-weight: bold; color:#{mod.GROUP_COLOR}"<!-- ENDIF --> href="{mod.U_GROUP}">{mod.GROUP_NAME}</a>
- <!-- ELSE -->
- {mod.GROUP_NAME}
- <!-- ENDIF --></td>
- <td class="info"><!-- IF not mod.FORUMS -->{L_ALL_FORUMS}<!-- ELSE --><select style="width: 100%;">{mod.FORUMS}</select><!-- ENDIF --></td>
- </tr>
-<!-- BEGINELSE -->
- <tr class="bg1">
- <td colspan="3"><strong>{L_NO_MODERATORS}</strong></td>
- </tr>
-<!-- END mod -->
- </tbody>
- </table>
-
- <span class="corners-bottom"><span></span></span></div>
-</div>
-
-</form>
-
-<!-- INCLUDE jumpbox.html -->
-<!-- INCLUDE overall_footer.html --> \ No newline at end of file
diff --git a/phpBB/styles/prosilver/template/memberlist_search.html b/phpBB/styles/prosilver/template/memberlist_search.html
index e6a4bfba97..b1c7a81709 100644
--- a/phpBB/styles/prosilver/template/memberlist_search.html
+++ b/phpBB/styles/prosilver/template/memberlist_search.html
@@ -1,115 +1,74 @@
-<!-- IF S_IN_SEARCH_POPUP -->
-<!-- You should retain this javascript in your own template! -->
-<script type="text/javascript">
-// <![CDATA[
-function insert_user(user)
-{
- opener.document.forms['{S_FORM_NAME}'].{S_FIELD_NAME}.value = ( opener.document.forms['{S_FORM_NAME}'].{S_FIELD_NAME}.value.length && opener.document.forms['{S_FORM_NAME}'].{S_FIELD_NAME}.type == "textarea" ) ? opener.document.forms['{S_FORM_NAME}'].{S_FIELD_NAME}.value + "\n" + user : user;
-}
-
-function insert_marked(users)
-{
- if (typeof(users.length) == "undefined")
- {
- if (users.checked)
- {
- insert_user(users.value);
- }
- }
- else if (users.length > 0)
- {
- for (i = 0; i < users.length; i++)
- {
- if (users[i].checked)
- {
- insert_user(users[i].value);
- }
- }
- }
-
- self.close();
-}
-
-function insert_single(user)
-{
- opener.document.forms['{S_FORM_NAME}'].{S_FIELD_NAME}.value = user;
- self.close();
-}
-// ]]>
-</script>
-<script type="text/javascript" src="{T_SUPER_TEMPLATE_PATH}/forum_fn.js"></script>
-<!-- ENDIF -->
-
<h2 class="solo">{L_FIND_USERNAME}</h2>
<form method="post" action="{S_MODE_ACTION}" id="search_memberlist">
<div class="panel">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<p>{L_FIND_USERNAME_EXPLAIN}</p>
+ <!-- EVENT memberlist_search_fields_before -->
<fieldset class="fields1 column1">
- <dl>
- <dt><label for="username">{L_USERNAME}:</label></dt>
- <dd><input type="text" name="username" id="username" value="{USERNAME}" class="inputbox" /></dd>
+ <dl style="overflow: visible;">
+ <dt><label for="username">{L_USERNAME}{L_COLON}</label></dt>
+ <dd>
+ <!-- IF U_LIVE_SEARCH --><div class="dropdown-container dropdown-{S_CONTENT_FLOW_END}"><!-- ENDIF -->
+ <input type="text" name="username" id="username" value="{USERNAME}" class="inputbox"<!-- IF U_LIVE_SEARCH --> autocomplete="off" data-filter="phpbb.search.filter" data-ajax="member_search" data-min-length="3" data-url="{U_LIVE_SEARCH}" data-results="#user-search" data-overlay="false"<!-- ENDIF --> />
+ <!-- IF U_LIVE_SEARCH -->
+ <div class="dropdown live-search hidden" id="user-search">
+ <div class="pointer"><div class="pointer-inner"></div></div>
+ <ul class="dropdown-contents search-results">
+ <li class="search-result-tpl"><span class="search-result"></span></li>
+ </ul>
+ </div>
+ </div>
+ <!-- ENDIF -->
+ </dd>
</dl>
<!-- IF S_EMAIL_SEARCH_ALLOWED -->
<dl>
- <dt><label for="email">{L_EMAIL}:</label></dt>
+ <dt><label for="email">{L_EMAIL}{L_COLON}</label></dt>
<dd><input type="text" name="email" id="email" value="{EMAIL}" class="inputbox" /></dd>
</dl>
<!-- ENDIF -->
+<!-- IF S_JABBER_ENABLED -->
<dl>
- <dt><label for="icq">{L_ICQ}:</label></dt>
- <dd><input type="text" name="icq" id="icq" value="{ICQ}" class="inputbox" /></dd>
- </dl>
- <dl>
- <dt><label for="aim">{L_AIM}:</label></dt>
- <dd><input type="text" name="aim" id="aim" value="{AIM}" class="inputbox" /></dd>
- </dl>
- <dl>
- <dt><label for="yahoo">{L_YIM}:</label></dt>
- <dd><input type="text" name="yahoo" id="yahoo" value="{YAHOO}" class="inputbox" /></dd>
+ <dt><label for="jabber">{L_JABBER}{L_COLON}</label></dt>
+ <dd><input type="text" name="jabber" id="jabber" value="{JABBER}" class="inputbox" /></dd>
</dl>
+<!-- ENDIF -->
<dl>
- <dt><label for="msn">{L_MSNM}:</label></dt>
- <dd><input type="text" name="msn" id="msn" value="{MSNM}" class="inputbox" /></dd>
+ <dt><label for="search_group_id">{L_GROUP}{L_COLON}</label></dt>
+ <dd><select name="search_group_id" id="search_group_id">{S_GROUP_SELECT}</select></dd>
</dl>
+ <!-- EVENT memberlist_search_sorting_options_before -->
<dl>
- <dt><label for="jabber">{L_JABBER}:</label></dt>
- <dd><input type="text" name="jabber" id="jabber" value="{JABBER}" class="inputbox" /></dd>
+ <dt><label for="sk" class="label3">{L_SORT_BY}{L_COLON}</label></dt>
+ <dd><select name="sk" id="sk">{S_SORT_OPTIONS}</select> <select name="sd">{S_ORDER_SELECT}</select></dd>
</dl>
</fieldset>
<fieldset class="fields1 column2">
<dl>
- <dt><label for="joined">{L_JOINED}:</label></dt>
+ <dt><label for="joined">{L_JOINED}{L_COLON}</label></dt>
<dd><select name="joined_select">{S_JOINED_TIME_OPTIONS}</select> <input class="inputbox medium" type="text" name="joined" id="joined" value="{JOINED}" /></dd>
</dl>
<!-- IF S_VIEWONLINE -->
<dl>
- <dt><label for="active">{L_LAST_ACTIVE}:</label></dt>
+ <dt><label for="active">{L_LAST_ACTIVE}{L_COLON}</label></dt>
<dd><select name="active_select">{S_ACTIVE_TIME_OPTIONS}</select> <input class="inputbox medium" type="text" name="active" id="active" value="{ACTIVE}" /></dd>
</dl>
<!-- ENDIF -->
<dl>
- <dt><label for="count">{L_POSTS}:</label></dt>
- <dd><select name="count_select">{S_COUNT_OPTIONS}</select> <input class="inputbox medium" type="text" name="count" id="count" value="{COUNT}" /></dd>
+ <dt><label for="count">{L_POSTS}{L_COLON}</label></dt>
+ <dd><select name="count_select">{S_COUNT_OPTIONS}</select> <input class="inputbox medium" type="number" min="0" name="count" id="count" value="{COUNT}" /></dd>
</dl>
<!-- IF S_IP_SEARCH_ALLOWED -->
<dl>
- <dt><label for="ip">{L_POST_IP}:</label></dt>
+ <dt><label for="ip">{L_POST_IP}{L_COLON}</label></dt>
<dd><input class="inputbox medium" type="text" name="ip" id="ip" value="{IP}" /></dd>
</dl>
<!-- ENDIF -->
- <dl>
- <dt><label for="search_group_id">{L_GROUP}:</label></dt>
- <dd><select name="search_group_id" id="search_group_id">{S_GROUP_SELECT}</select></dd>
- </dl>
- <dl>
- <dt><label for="sk" class="label3">{L_SORT_BY}:</label></dt>
- <dd><select name="sk" id="sk">{S_SORT_OPTIONS}</select> <select name="sd">{S_ORDER_SELECT}</select></dd>
- </dl>
+ <!-- EVENT memberlist_search_fields_after -->
</fieldset>
<div class="clear"></div>
@@ -122,7 +81,7 @@ function insert_single(user)
{S_FORM_TOKEN}
</fieldset>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
</form>
diff --git a/phpBB/styles/prosilver/template/memberlist_team.html b/phpBB/styles/prosilver/template/memberlist_team.html
new file mode 100644
index 0000000000..327dde412e
--- /dev/null
+++ b/phpBB/styles/prosilver/template/memberlist_team.html
@@ -0,0 +1,47 @@
+<!-- INCLUDE overall_header.html -->
+
+<h2 class="solo">{PAGE_TITLE}</h2>
+
+<form method="post" action="{S_MODE_ACTION}">
+
+<!-- BEGIN group -->
+<div class="forumbg forumbg-table">
+ <div class="inner">
+
+ <table class="table1" id="team">
+ <thead>
+ <tr>
+ <th class="name" data-dfn="{L_RANK}{L_COMMA_SEPARATOR}{L_USERNAME}"><span class="rank-img">{L_RANK}&nbsp;</span><!-- IF group.U_GROUP --><a href="{group.U_GROUP}">{group.GROUP_NAME}</a><!-- ELSE -->{group.GROUP_NAME}<!-- ENDIF --></th>
+ <th class="info">{L_PRIMARY_GROUP}</th>
+ <!-- IF S_DISPLAY_MODERATOR_FORUMS --><th class="info">{L_MODERATOR}</th><!-- ENDIF -->
+ </tr>
+ </thead>
+ <tbody>
+<!-- BEGIN user -->
+ <tr class="<!-- IF group.user.S_ROW_COUNT is even -->bg1<!-- ELSE -->bg2<!-- ENDIF --><!-- IF group.user.S_INACTIVE --> inactive<!-- ENDIF -->">
+ <td><!-- IF group.user.RANK_IMG --><span class="rank-img">{group.user.RANK_IMG}</span><!-- ELSE --><span class="rank-img">{group.user.RANK_TITLE}</span><!-- ENDIF --><!-- EVENT memberlist_team_username_prepend -->{group.user.USERNAME_FULL}<!-- IF group.user.S_INACTIVE --> ({L_INACTIVE})<!-- ENDIF --><!-- EVENT memberlist_team_username_append --></td>
+ <td class="info"><!-- IF group.user.U_GROUP -->
+ <a<!-- IF group.user.GROUP_COLOR --> style="font-weight: bold; color: #{group.user.GROUP_COLOR}"<!-- ENDIF --> href="{group.user.U_GROUP}">{group.user.GROUP_NAME}</a>
+ <!-- ELSE -->
+ {group.user.GROUP_NAME}
+ <!-- ENDIF --></td>
+ <!-- IF S_DISPLAY_MODERATOR_FORUMS -->
+ <td class="info"><!-- IF group.user.FORUM_OPTIONS --><select style="width: 100%;">{group.user.FORUMS}</select><!-- ELSEIF group.user.FORUMS -->{group.user.FORUMS}<!-- ELSE -->-<!-- ENDIF --></td>
+ <!-- ENDIF -->
+ </tr>
+<!-- BEGINELSE -->
+ <tr class="bg1">
+ <td colspan="3"><strong>{L_NO_MEMBERS}</strong></td>
+ </tr>
+<!-- END user -->
+ </tbody>
+ </table>
+
+ </div>
+</div>
+<!-- END group -->
+
+</form>
+
+<!-- INCLUDE jumpbox.html -->
+<!-- INCLUDE overall_footer.html -->
diff --git a/phpBB/styles/prosilver/template/memberlist_view.html b/phpBB/styles/prosilver/template/memberlist_view.html
index 2758a7e6cc..a7439bc759 100644
--- a/phpBB/styles/prosilver/template/memberlist_view.html
+++ b/phpBB/styles/prosilver/template/memberlist_view.html
@@ -1,75 +1,95 @@
<!-- INCLUDE overall_header.html -->
-<h2>{PAGE_TITLE}</h2>
+<h2 class="memberlist-title">{PAGE_TITLE}</h2>
+
+<!-- EVENT memberlist_view_content_prepend -->
<form method="post" action="{S_PROFILE_ACTION}" id="viewprofile">
<div class="panel bg1<!-- IF S_ONLINE --> online<!-- ENDIF -->">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<!-- IF AVATAR_IMG -->
<dl class="left-box">
- <dt>{AVATAR_IMG}</dt>
+ <dt class="profile-avatar">{AVATAR_IMG}</dt>
+ <!-- EVENT memberlist_view_rank_avatar_before -->
<!-- IF RANK_TITLE --><dd style="text-align: center;">{RANK_TITLE}</dd><!-- ENDIF -->
<!-- IF RANK_IMG --><dd style="text-align: center;">{RANK_IMG}</dd><!-- ENDIF -->
+ <!-- EVENT memberlist_view_rank_avatar_after -->
</dl>
<!-- ENDIF -->
- <dl class="left-box details" style="width: 80%;">
- <dt>{L_USERNAME}:</dt>
+ <dl class="left-box details profile-details">
+ <dt>{L_USERNAME}{L_COLON}</dt>
<dd>
<!-- IF USER_COLOR --><span style="color: {USER_COLOR}; font-weight: bold;"><!-- ELSE --><span><!-- ENDIF -->{USERNAME}</span>
+ <!-- IF U_EDIT_SELF --> [ <a href="{U_EDIT_SELF}">{L_EDIT_PROFILE}</a> ]<!-- ENDIF -->
<!-- IF U_USER_ADMIN --> [ <a href="{U_USER_ADMIN}">{L_USER_ADMIN}</a> ]<!-- ENDIF -->
<!-- IF U_USER_BAN --> [ <a href="{U_USER_BAN}">{L_USER_BAN}</a> ]<!-- ENDIF -->
<!-- IF U_SWITCH_PERMISSIONS --> [ <a href="{U_SWITCH_PERMISSIONS}">{L_USE_PERMISSIONS}</a> ]<!-- ENDIF -->
</dd>
<!-- IF not AVATAR_IMG -->
- <!-- IF RANK_TITLE --><dt>{L_RANK}:</dt> <dd>{RANK_TITLE}</dd><!-- ENDIF -->
- <!-- IF RANK_IMG --><dt><!-- IF RANK_TITLE -->&nbsp;<!-- ELSE -->{L_RANK}:<!-- ENDIF --></dt> <dd>{RANK_IMG}</dd><!-- ENDIF -->
+ <!-- EVENT memberlist_view_rank_no_avatar_before -->
+ <!-- IF RANK_TITLE --><dt>{L_RANK}{L_COLON}</dt> <dd>{RANK_TITLE}</dd><!-- ENDIF -->
+ <!-- IF RANK_IMG --><dt><!-- IF RANK_TITLE -->&nbsp;<!-- ELSE -->{L_RANK}{L_COLON}<!-- ENDIF --></dt> <dd>{RANK_IMG}</dd><!-- ENDIF -->
+ <!-- EVENT memberlist_view_rank_no_avatar_after -->
<!-- ENDIF -->
- <!-- IF S_USER_INACTIVE --><dt>{L_USER_IS_INACTIVE}:</dt> <dd>{USER_INACTIVE_REASON}</dd><!-- ENDIF -->
- <!-- IF LOCATION --><dt>{L_LOCATION}:</dt> <dd>{LOCATION}</dd><!-- ENDIF -->
- <!-- IF AGE !== '' --><dt>{L_AGE}:</dt> <dd>{AGE}</dd><!-- ENDIF -->
- <!-- IF OCCUPATION --><dt>{L_OCCUPATION}:</dt> <dd>{OCCUPATION}</dd><!-- ENDIF -->
- <!-- IF INTERESTS --><dt>{L_INTERESTS}:</dt> <dd>{INTERESTS}</dd><!-- ENDIF -->
- <!-- IF S_GROUP_OPTIONS --><dt>{L_USERGROUPS}:</dt> <dd><select name="g">{S_GROUP_OPTIONS}</select> <input type="submit" name="submit" value="{L_GO}" class="button2" /></dd><!-- ENDIF -->
- <!-- BEGIN custom_fields --><dt>{custom_fields.PROFILE_FIELD_NAME}:</dt> <dd>{custom_fields.PROFILE_FIELD_VALUE}</dd><!-- END custom_fields -->
+ <!-- IF S_USER_INACTIVE --><dt>{L_USER_IS_INACTIVE}{L_COLON}</dt> <dd>{USER_INACTIVE_REASON}</dd><!-- ENDIF -->
+ <!-- IF AGE !== '' --><dt>{L_AGE}{L_COLON}</dt> <dd>{AGE}</dd><!-- ENDIF -->
+ <!-- IF S_GROUP_OPTIONS --><dt>{L_USERGROUPS}{L_COLON}</dt> <dd><select name="g">{S_GROUP_OPTIONS}</select> <input type="submit" name="submit" value="{L_GO}" class="button2" /></dd><!-- ENDIF -->
+ <!-- EVENT memberlist_view_non_contact_custom_fields_before -->
+ <!-- BEGIN custom_fields -->
+ <!-- IF not custom_fields.S_PROFILE_CONTACT -->
+ <dt>{custom_fields.PROFILE_FIELD_NAME}{L_COLON}</dt> <dd>{custom_fields.PROFILE_FIELD_VALUE}</dd>
+ <!-- ENDIF -->
+ <!-- END custom_fields -->
+ <!-- EVENT memberlist_view_non_contact_custom_fields_after -->
+ <!-- EVENT memberlist_view_zebra_before -->
<!-- IF S_USER_LOGGED_IN and S_ZEBRA -->
<!-- IF U_REMOVE_FRIEND -->
- <dt>&nbsp;</dt> <dd><a href="{U_REMOVE_FRIEND}"><strong>{L_REMOVE_FRIEND}</strong></a></dd>
+ <dt>&nbsp;</dt> <dd class="zebra"><a href="{U_REMOVE_FRIEND}" data-ajax="zebra"><strong>{L_REMOVE_FRIEND}</strong></a></dd>
<!-- ELSEIF U_REMOVE_FOE -->
- <dt>&nbsp;</dt> <dd><a href="{U_REMOVE_FOE}"><strong>{L_REMOVE_FOE}</strong></a></dd>
+ <dt>&nbsp;</dt> <dd class="zebra"><a href="{U_REMOVE_FOE}" data-ajax="zebra"><strong>{L_REMOVE_FOE}</strong></a></dd>
<!-- ELSE -->
<!-- IF U_ADD_FRIEND -->
- <dt>&nbsp;</dt> <dd><a href="{U_ADD_FRIEND}"><strong>{L_ADD_FRIEND}</strong></a></dd>
+ <dt>&nbsp;</dt> <dd class="zebra"><a href="{U_ADD_FRIEND}" data-ajax="zebra"><strong>{L_ADD_FRIEND}</strong></a></dd>
<!-- ENDIF -->
<!-- IF U_ADD_FOE -->
- <dt>&nbsp;</dt> <dd><a href="{U_ADD_FOE}"><strong>{L_ADD_FOE}</strong></a></dd>
+ <dt>&nbsp;</dt> <dd class="zebra"><a href="{U_ADD_FOE}" data-ajax="zebra"><strong>{L_ADD_FOE}</strong></a></dd>
<!-- ENDIF -->
<!-- ENDIF -->
<!-- ENDIF -->
+ <!-- EVENT memberlist_view_zebra_after -->
</dl>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
+<!-- EVENT memberlist_view_contact_before -->
<div class="panel bg2">
- <div class="inner"><span class="corners-top"><span></span></span>
- <div class="column1">
+ <div class="inner">
- <h3>{L_CONTACT_USER} {USERNAME}</h3>
+ <div class="column1">
+ <h3>{L_CONTACT_USER}</h3>
<dl class="details">
- <!-- IF U_EMAIL --><dt>{L_EMAIL_ADDRESS}:</dt> <dd><a href="{U_EMAIL}">{L_SEND_EMAIL_USER} {USERNAME}</a></dd><!-- ENDIF -->
- <!-- IF U_WWW --><dt>{L_WEBSITE}:</dt> <dd><a href="{U_WWW}" title="{L_VISIT_WEBSITE}: {U_WWW}">{U_WWW}</a></dd><!-- ENDIF -->
- <!-- IF U_PM --><dt>{L_PM}:</dt> <dd><a href="{U_PM}">{L_SEND_PRIVATE_MESSAGE}</a></dd><!-- ENDIF -->
- <!-- IF U_MSN or USER_MSN --><dt>{L_MSNM}:</dt> <dd><!-- IF U_MSN --><a href="{U_MSN}" onclick="popup(this.href, 550, 320); return false;">{L_SEND_MSNM_MESSAGE}</a><!-- ELSE -->{USER_MSN}<!-- ENDIF --></dd><!-- ENDIF -->
- <!-- IF U_YIM or USER_YIM --><dt>{L_YIM}:</dt> <dd><!-- IF U_YIM --><a href="{U_YIM}" onclick="popup(this.href, 780, 550); return false;">{L_SEND_YIM_MESSAGE}</a><!-- ELSE -->{USER_YIM}<!-- ENDIF --></dd><!-- ENDIF -->
- <!-- IF U_AIM or USER_AIM --><dt>{L_AIM}:</dt> <dd><!-- IF U_AIM --><a href="{U_AIM}" onclick="popup(this.href, 550, 320); return false;">{L_SEND_AIM_MESSAGE}</a><!-- ELSE -->{USER_AIM}<!-- ENDIF --></dd><!-- ENDIF -->
- <!-- IF U_ICQ or USER_ICQ --><dt>{L_ICQ}:</dt> <dd><!-- IF U_ICQ --><a href="{U_ICQ}" onclick="popup(this.href, 550, 320); return false;">{L_SEND_ICQ_MESSAGE}</a><!-- ELSE -->{USER_ICQ}<!-- ENDIF --></dd><!-- ENDIF -->
- <!-- IF U_JABBER and S_JABBER_ENABLED --><dt>{L_JABBER}:</dt> <dd><a href="{U_JABBER}" onclick="popup(this.href, 550, 320); return false;">{L_SEND_JABBER_MESSAGE}</a></dd><!-- ELSEIF USER_JABBER --><dt>{L_JABBER}:</dt> <dd>{USER_JABBER}</dd><!-- ENDIF -->
+ <!-- IF U_EMAIL --><dt>{L_EMAIL_ADDRESS}{L_COLON}</dt> <dd><a href="{U_EMAIL}">{L_SEND_EMAIL_USER}</a></dd><!-- ENDIF -->
+ <!-- IF U_PM --><dt>{L_PM}{L_COLON}</dt> <dd><a href="{U_PM}">{L_SEND_PRIVATE_MESSAGE}</a></dd><!-- ENDIF -->
+ <!-- IF U_JABBER and S_JABBER_ENABLED --><dt>{L_JABBER}{L_COLON}</dt> <dd><a href="{U_JABBER}" onclick="popup(this.href, 750, 320); return false;">{L_SEND_JABBER_MESSAGE}</a></dd><!-- ELSEIF USER_JABBER --><dt>{L_JABBER}{L_COLON}</dt> <dd>{USER_JABBER}</dd><!-- ENDIF -->
+ <!-- EVENT memberlist_view_contact_custom_fields_before -->
+ <!-- BEGIN custom_fields -->
+ <!-- IF custom_fields.S_PROFILE_CONTACT -->
+ <dt>{custom_fields.PROFILE_FIELD_NAME}{L_COLON}</dt>
+ <!-- IF custom_fields.PROFILE_FIELD_CONTACT -->
+ <dd><a href="{custom_fields.PROFILE_FIELD_CONTACT}">{custom_fields.PROFILE_FIELD_DESC}</a></dd>
+ <!-- ELSE -->
+ <dd>{custom_fields.PROFILE_FIELD_VALUE}</dd>
+ <!-- ENDIF -->
+ <!-- ENDIF -->
+ <!-- END custom_fields -->
+ <!-- EVENT memberlist_view_contact_custom_fields_after -->
<!-- IF S_PROFILE_FIELD1 -->
<!-- NOTE: Use a construct like this to include admin defined profile fields. Replace FIELD1 with the name of your field. -->
- <dt>{PROFILE_FIELD1_NAME}:</dt> <dd>{PROFILE_FIELD1_VALUE}</dd>
+ <dt>{PROFILE_FIELD1_NAME}{L_COLON}</dt> <dd>{PROFILE_FIELD1_VALUE}</dd>
<!-- ENDIF -->
</dl>
</div>
@@ -77,40 +97,46 @@
<div class="column2">
<h3>{L_USER_FORUM}</h3>
<dl class="details">
- <dt>{L_JOINED}:</dt> <dd>{JOINED}</dd>
- <dt>{L_VISITED}:</dt> <dd>{VISITED}</dd>
+ <!-- EVENT memberlist_view_user_statistics_before -->
+ <dt>{L_JOINED}{L_COLON}</dt> <dd>{JOINED}</dd>
+ <dt>{L_LAST_ACTIVE}{L_COLON}</dt> <dd>{LAST_ACTIVE}</dd>
<!-- IF S_WARNINGS -->
- <dt>{L_WARNINGS}: </dt>
+ <dt>{L_WARNINGS}{L_COLON} </dt>
<dd><strong>{WARNINGS}</strong><!-- IF U_NOTES or U_WARN --> [ <!-- IF U_NOTES --><a href="{U_NOTES}">{L_VIEW_NOTES}</a><!-- ENDIF --> <!-- IF U_WARN --><!-- IF U_NOTES --> | <!-- ENDIF --><a href="{U_WARN}">{L_WARN_USER}</a><!-- ENDIF --> ]<!-- ENDIF --></dd>
<!-- ENDIF -->
- <dt>{L_TOTAL_POSTS}:</dt>
+ <dt>{L_TOTAL_POSTS}{L_COLON}</dt>
<dd>{POSTS} <!-- IF S_DISPLAY_SEARCH -->| <strong><a href="{U_SEARCH_USER}">{L_SEARCH_USER_POSTS}</a></strong><!-- ENDIF -->
<!-- IF POSTS_PCT --><br />({POSTS_PCT} / {POSTS_DAY})<!-- ENDIF -->
<!-- IF POSTS_IN_QUEUE and U_MCP_QUEUE --><br />(<a href="{U_MCP_QUEUE}">{L_POSTS_IN_QUEUE}</a>)<!-- ELSEIF POSTS_IN_QUEUE --><br />({L_POSTS_IN_QUEUE})<!-- ENDIF -->
</dd>
<!-- IF S_SHOW_ACTIVITY and POSTS -->
- <dt>{L_ACTIVE_IN_FORUM}:</dt> <dd><!-- IF ACTIVE_FORUM != '' --><strong><a href="{U_ACTIVE_FORUM}">{ACTIVE_FORUM}</a></strong><br />({ACTIVE_FORUM_POSTS} / {ACTIVE_FORUM_PCT})<!-- ELSE --> - <!-- ENDIF --></dd>
- <dt>{L_ACTIVE_IN_TOPIC}:</dt> <dd><!-- IF ACTIVE_TOPIC != '' --><strong><a href="{U_ACTIVE_TOPIC}">{ACTIVE_TOPIC}</a></strong><br />({ACTIVE_TOPIC_POSTS} / {ACTIVE_TOPIC_PCT})<!-- ELSE --> - <!-- ENDIF --></dd>
+ <dt>{L_ACTIVE_IN_FORUM}{L_COLON}</dt> <dd><!-- IF ACTIVE_FORUM != '' --><strong><a href="{U_ACTIVE_FORUM}">{ACTIVE_FORUM}</a></strong><br />({ACTIVE_FORUM_POSTS} / {ACTIVE_FORUM_PCT})<!-- ELSE --> - <!-- ENDIF --></dd>
+ <dt>{L_ACTIVE_IN_TOPIC}{L_COLON}</dt> <dd><!-- IF ACTIVE_TOPIC != '' --><strong><a href="{U_ACTIVE_TOPIC}">{ACTIVE_TOPIC}</a></strong><br />({ACTIVE_TOPIC_POSTS} / {ACTIVE_TOPIC_PCT})<!-- ELSE --> - <!-- ENDIF --></dd>
<!-- ENDIF -->
+ <!-- EVENT memberlist_view_user_statistics_after -->
</dl>
</div>
- <span class="corners-bottom"><span></span></span></div>
+
+ </div>
</div>
+<!-- EVENT memberlist_view_contact_after -->
<!-- IF SIGNATURE -->
<div class="panel bg1">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<h3>{L_SIGNATURE}</h3>
- <div class="postbody"><div class="signature" style="border-top:none; margin-top: 0;">{SIGNATURE}</div></div>
+ <div class="postbody"><div class="signature standalone">{SIGNATURE}</div></div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<!-- ENDIF -->
</form>
+<!-- EVENT memberlist_view_content_append -->
+
<!-- INCLUDE jumpbox.html -->
-<!-- INCLUDE overall_footer.html --> \ No newline at end of file
+<!-- INCLUDE overall_footer.html -->
diff --git a/phpBB/styles/prosilver/template/message_body.html b/phpBB/styles/prosilver/template/message_body.html
index 3a970769b7..71eca203bc 100644
--- a/phpBB/styles/prosilver/template/message_body.html
+++ b/phpBB/styles/prosilver/template/message_body.html
@@ -5,11 +5,11 @@
<!-- ENDIF -->
<div class="panel" id="message">
- <div class="inner"><span class="corners-top"><span></span></span>
- <h2>{MESSAGE_TITLE}</h2>
+ <div class="inner">
+ <h2 class="message-title">{MESSAGE_TITLE}</h2>
<p>{MESSAGE_TEXT}</p>
- <!-- IF SCRIPT_NAME == "search" and not S_BOARD_DISABLED and not S_NO_SEARCH and L_RETURN_TO_SEARCH_ADV --><p><a href="{U_SEARCH}" class="{S_CONTENT_FLOW_BEGIN}">{L_RETURN_TO_SEARCH_ADV}</a></p><!-- ENDIF -->
- <span class="corners-bottom"><span></span></span></div>
+ <!-- IF SCRIPT_NAME == "search" and not S_BOARD_DISABLED and not S_NO_SEARCH and L_RETURN_TO_SEARCH_ADV --><p><a href="{U_SEARCH}" class="arrow-{S_CONTENT_FLOW_BEGIN}">{L_GO_TO_SEARCH_ADV}</a></p><!-- ENDIF -->
+ </div>
</div>
<!-- IF S_SIMPLE_MESSAGE -->
diff --git a/phpBB/styles/prosilver/template/navbar_footer.html b/phpBB/styles/prosilver/template/navbar_footer.html
new file mode 100644
index 0000000000..b5a705d567
--- /dev/null
+++ b/phpBB/styles/prosilver/template/navbar_footer.html
@@ -0,0 +1,27 @@
+<div class="navbar" role="navigation">
+ <div class="inner">
+
+ <ul id="nav-footer" class="linklist bulletin" role="menubar">
+ <li class="small-icon icon-home breadcrumbs">
+ <!-- IF U_SITE_HOME --><span class="crumb"><a href="{U_SITE_HOME}" data-navbar-reference="home">{L_SITE_HOME}</a></span><!-- ENDIF -->
+ <!-- EVENT overall_footer_breadcrumb_prepend -->
+ <span class="crumb"><a href="{U_INDEX}" data-navbar-reference="index">{L_INDEX}</a></span>
+ <!-- EVENT overall_footer_breadcrumb_append -->
+ </li>
+ <!-- IF U_WATCH_FORUM_LINK and not S_IS_BOT --><li class="small-icon icon-<!-- IF S_WATCHING_FORUM -->unsubscribe<!-- ELSE -->subscribe<!-- ENDIF -->" data-last-responsive="true"><a href="{U_WATCH_FORUM_LINK}" title="{S_WATCH_FORUM_TITLE}" data-ajax="toggle_link" data-toggle-class="small-icon icon-<!-- IF not S_WATCHING_FORUM -->unsubscribe<!-- ELSE -->subscribe<!-- ENDIF -->" data-toggle-text="{S_WATCH_FORUM_TOGGLE}" data-toggle-url="{U_WATCH_FORUM_TOGGLE}">{S_WATCH_FORUM_TITLE}</a></li><!-- ENDIF -->
+
+ <!-- EVENT overall_footer_timezone_before -->
+ <li class="rightside">{S_TIMEZONE}</li>
+ <!-- EVENT overall_footer_timezone_after -->
+ <!-- IF not S_IS_BOT -->
+ <li class="small-icon icon-delete-cookies rightside"><a href="{U_DELETE_COOKIES}" data-ajax="true" data-refresh="true" role="menuitem">{L_DELETE_COOKIES}</a></li>
+ <!-- IF S_DISPLAY_MEMBERLIST --><li class="small-icon icon-members rightside" data-last-responsive="true"><a href="{U_MEMBERLIST}" title="{L_MEMBERLIST_EXPLAIN}" role="menuitem">{L_MEMBERLIST}</a></li><!-- ENDIF -->
+ <!-- ENDIF -->
+ <!-- EVENT overall_footer_teamlink_before -->
+ <!-- IF U_TEAM --><li class="small-icon icon-team rightside" data-last-responsive="true"><a href="{U_TEAM}" role="menuitem">{L_THE_TEAM}</a></li><!-- ENDIF -->
+ <!-- EVENT overall_footer_teamlink_after -->
+ <!-- IF U_CONTACT_US --><li class="small-icon icon-contact rightside" data-last-responsive="true"><a href="{U_CONTACT_US}" role="menuitem">{L_CONTACT_US}</a></li><!-- ENDIF -->
+ </ul>
+
+ </div>
+</div>
diff --git a/phpBB/styles/prosilver/template/navbar_header.html b/phpBB/styles/prosilver/template/navbar_header.html
new file mode 100644
index 0000000000..bdfb5fb87d
--- /dev/null
+++ b/phpBB/styles/prosilver/template/navbar_header.html
@@ -0,0 +1,116 @@
+<div class="navbar" role="navigation">
+ <div class="inner">
+
+ <ul id="nav-main" class="linklist bulletin" role="menubar">
+
+ <li id="quick-links" class="small-icon responsive-menu dropdown-container<!-- IF not S_DISPLAY_QUICK_LINKS and not S_DISPLAY_SEARCH --> hidden<!-- ENDIF -->" data-skip-responsive="true">
+ <a href="#" class="responsive-menu-link dropdown-trigger">{L_QUICK_LINKS}</a>
+ <div class="dropdown hidden">
+ <div class="pointer"><div class="pointer-inner"></div></div>
+ <ul class="dropdown-contents" role="menu">
+ <!-- EVENT navbar_header_quick_links_before -->
+
+ <!-- IF S_DISPLAY_SEARCH -->
+ <li class="separator"></li>
+ <!-- IF S_REGISTERED_USER -->
+ <li class="small-icon icon-search-self"><a href="{U_SEARCH_SELF}" role="menuitem">{L_SEARCH_SELF}</a></li>
+ <!-- ENDIF -->
+ <!-- IF S_USER_LOGGED_IN -->
+ <li class="small-icon icon-search-new"><a href="{U_SEARCH_NEW}" role="menuitem">{L_SEARCH_NEW}</a></li>
+ <!-- ENDIF -->
+ <!-- IF S_LOAD_UNREADS -->
+ <li class="small-icon icon-search-unread"><a href="{U_SEARCH_UNREAD}" role="menuitem">{L_SEARCH_UNREAD}</a></li>
+ <!-- ENDIF -->
+ <li class="small-icon icon-search-unanswered"><a href="{U_SEARCH_UNANSWERED}" role="menuitem">{L_SEARCH_UNANSWERED}</a></li>
+ <li class="small-icon icon-search-active"><a href="{U_SEARCH_ACTIVE_TOPICS}" role="menuitem">{L_SEARCH_ACTIVE_TOPICS}</a></li>
+ <li class="separator"></li>
+ <li class="small-icon icon-search"><a href="{U_SEARCH}" role="menuitem">{L_SEARCH}</a></li>
+ <!-- ENDIF -->
+
+ <!-- IF not S_IS_BOT and (S_DISPLAY_MEMBERLIST or U_TEAM) -->
+ <li class="separator"></li>
+ <!-- IF S_DISPLAY_MEMBERLIST --><li class="small-icon icon-members"><a href="{U_MEMBERLIST}" role="menuitem">{L_MEMBERLIST}</a></li><!-- ENDIF -->
+ <!-- IF U_TEAM --><li class="small-icon icon-team"><a href="{U_TEAM}" role="menuitem">{L_THE_TEAM}</a></li><!-- ENDIF -->
+ <!-- ENDIF -->
+ <li class="separator"></li>
+
+ <!-- EVENT navbar_header_quick_links_after -->
+ </ul>
+ </div>
+ </li>
+
+ <!-- EVENT overall_header_navigation_prepend -->
+ <li class="small-icon icon-faq" <!-- IF not S_USER_LOGGED_IN -->data-skip-responsive="true"<!-- ELSE -->data-last-responsive="true"<!-- ENDIF -->><a href="{U_FAQ}" rel="help" title="{L_FAQ_EXPLAIN}" role="menuitem">{L_FAQ}</a></li>
+ <!-- EVENT overall_header_navigation_append -->
+ <!-- IF U_ACP --><li class="small-icon icon-acp" data-last-responsive="true"><a href="{U_ACP}" title="{L_ACP}" role="menuitem">{L_ACP_SHORT}</a></li><!-- ENDIF -->
+ <!-- IF U_MCP --><li class="small-icon icon-mcp" data-last-responsive="true"><a href="{U_MCP}" title="{L_MCP}" role="menuitem">{L_MCP_SHORT}</a></li><!-- ENDIF -->
+
+ <!-- IF S_REGISTERED_USER -->
+ <!-- EVENT navbar_header_user_profile_prepend -->
+ <li id="username_logged_in" class="rightside <!-- IF CURRENT_USER_AVATAR --> no-bulletin<!-- ENDIF -->" data-skip-responsive="true">
+ <!-- EVENT navbar_header_username_prepend -->
+ <div class="header-profile dropdown-container">
+ <a href="{U_PROFILE}" class="header-avatar dropdown-trigger"><!-- IF CURRENT_USER_AVATAR -->{CURRENT_USER_AVATAR} <!-- ENDIF -->{CURRENT_USERNAME_SIMPLE}</a>
+ <div class="dropdown hidden">
+ <div class="pointer"><div class="pointer-inner"></div></div>
+ <ul class="dropdown-contents" role="menu">
+ <!-- IF U_RESTORE_PERMISSIONS --><li class="small-icon icon-restore-permissions"><a href="{U_RESTORE_PERMISSIONS}">{L_RESTORE_PERMISSIONS}</a></li><!-- ENDIF -->
+
+ <!-- EVENT navbar_header_profile_list_before -->
+
+ <li class="small-icon icon-ucp"><a href="{U_PROFILE}" title="{L_PROFILE}" role="menuitem">{L_PROFILE}</a></li>
+ <li class="small-icon icon-profile"><a href="{U_USER_PROFILE}" title="{L_READ_PROFILE}" role="menuitem">{L_READ_PROFILE}</a></li>
+
+ <!-- EVENT navbar_header_profile_list_after -->
+
+ <li class="separator"></li>
+ <li class="small-icon icon-logout"><a href="{U_LOGIN_LOGOUT}" title="{L_LOGIN_LOGOUT}" accesskey="x" role="menuitem">{L_LOGIN_LOGOUT}</a></li>
+ </ul>
+ </div>
+ </div>
+ <!-- EVENT navbar_header_username_append -->
+ </li>
+ <!-- IF S_DISPLAY_PM -->
+ <li class="small-icon icon-pm rightside" data-skip-responsive="true">
+ <a href="{U_PRIVATEMSGS}" role="menuitem"><span>{L_PRIVATE_MESSAGES} </span><strong class="badge<!-- IF not PRIVATE_MESSAGE_COUNT --> hidden<!-- ENDIF -->">{PRIVATE_MESSAGE_COUNT}</strong></a>
+ </li>
+ <!-- ENDIF -->
+ <!-- IF S_NOTIFICATIONS_DISPLAY -->
+ <li class="small-icon icon-notification dropdown-container dropdown-{S_CONTENT_FLOW_END} rightside" data-skip-responsive="true">
+ <a href="{U_VIEW_ALL_NOTIFICATIONS}" id="notification_list_button" class="dropdown-trigger"><span>{L_NOTIFICATIONS} </span><strong class="badge<!-- IF not NOTIFICATIONS_COUNT --> hidden<!-- ENDIF -->">{NOTIFICATIONS_COUNT}</strong></a>
+ <!-- INCLUDE notification_dropdown.html -->
+ </li>
+ <!-- ENDIF -->
+ <!-- EVENT navbar_header_user_profile_append -->
+ <!-- ELSE -->
+ <li class="small-icon icon-logout rightside" data-skip-responsive="true"><a href="{U_LOGIN_LOGOUT}" title="{L_LOGIN_LOGOUT}" accesskey="x" role="menuitem">{L_LOGIN_LOGOUT}</a></li>
+ <!-- IF S_REGISTER_ENABLED and not (S_SHOW_COPPA or S_REGISTRATION) -->
+ <li class="small-icon icon-register rightside" data-skip-responsive="true"><a href="{U_REGISTER}" role="menuitem">{L_REGISTER}</a></li>
+ <!-- ENDIF -->
+ <!-- EVENT navbar_header_logged_out_content -->
+ <!-- ENDIF -->
+ </ul>
+
+ <ul id="nav-breadcrumbs" class="linklist navlinks" role="menubar">
+ <!-- DEFINE $MICRODATA = ' itemtype="http://data-vocabulary.org/Breadcrumb" itemscope=""' -->
+ <!-- EVENT overall_header_breadcrumbs_before -->
+ <li class="small-icon icon-home breadcrumbs">
+ <!-- IF U_SITE_HOME --><span class="crumb"{$MICRODATA}><a href="{U_SITE_HOME}" data-navbar-reference="home" itemprop="url"><span itemprop="title">{L_SITE_HOME}</span></a></span><!-- ENDIF -->
+ <!-- EVENT overall_header_breadcrumb_prepend -->
+ <span class="crumb"{$MICRODATA}><a href="{U_INDEX}" accesskey="h" data-navbar-reference="index" itemprop="url"><span itemprop="title">{L_INDEX}</span></a></span>
+ <!-- BEGIN navlinks -->
+ <!-- EVENT overall_header_navlink_prepend -->
+ <span class="crumb"{$MICRODATA}<!-- IF navlinks.MICRODATA --> {navlinks.MICRODATA}<!-- ENDIF -->><a href="{navlinks.U_VIEW_FORUM}" itemprop="url"><span itemprop="title">{navlinks.FORUM_NAME}</span></a></span>
+ <!-- EVENT overall_header_navlink_append -->
+ <!-- END navlinks -->
+ <!-- EVENT overall_header_breadcrumb_append -->
+ </li>
+ <!-- EVENT overall_header_breadcrumbs_after -->
+
+ <!-- IF S_DISPLAY_SEARCH and not S_IN_SEARCH -->
+ <li class="rightside responsive-search" style="display: none;"><a href="{U_SEARCH}" title="{L_SEARCH_ADV_EXPLAIN}" role="menuitem">{L_SEARCH}</a></li>
+ <!-- ENDIF -->
+ </ul>
+
+ </div>
+</div>
diff --git a/phpBB/styles/prosilver/template/notification_dropdown.html b/phpBB/styles/prosilver/template/notification_dropdown.html
new file mode 100644
index 0000000000..13d90a9d38
--- /dev/null
+++ b/phpBB/styles/prosilver/template/notification_dropdown.html
@@ -0,0 +1,45 @@
+<div id="notification_list" class="dropdown dropdown-extended notification_list">
+ <div class="pointer"><div class="pointer-inner"></div></div>
+ <div class="dropdown-contents">
+ <div class="header">
+ {L_NOTIFICATIONS}
+ <span class="header_settings">
+ <a href="{U_NOTIFICATION_SETTINGS}">{L_SETTINGS}</a>
+ <!-- IF NOTIFICATIONS_COUNT -->
+ <span id="mark_all_notifications"> &bull; <a href="{U_MARK_ALL_NOTIFICATIONS}" data-ajax="notification.mark_all_read">{L_MARK_ALL_READ}</a></span>
+ <!-- ENDIF -->
+ </span>
+ </div>
+
+ <ul>
+ <!-- IF not .notifications -->
+ <li class="no_notifications">
+ {L_NO_NOTIFICATIONS}
+ </li>
+ <!-- ENDIF -->
+ <!-- BEGIN notifications -->
+ <li class="<!-- IF notifications.UNREAD --> bg2<!-- ENDIF --><!-- IF notifications.STYLING --> {notifications.STYLING}<!-- ENDIF --><!-- IF not notifications.URL --> no-url<!-- ENDIF -->">
+ <!-- IF notifications.URL -->
+ <a class="notification-block" href="<!-- IF notifications.UNREAD -->{notifications.U_MARK_READ}" data-real-url="{notifications.URL}<!-- ELSE -->{notifications.URL}<!-- ENDIF -->">
+ <!-- ENDIF -->
+ <!-- IF notifications.AVATAR -->{notifications.AVATAR}<!-- ELSE --><img src="{T_THEME_PATH}/images/no_avatar.gif" alt="" /><!-- ENDIF -->
+ <div class="notification_text">
+ <p class="notification-title">{notifications.FORMATTED_TITLE}</p>
+ <!-- IF notifications.REFERENCE --><p class="notification-reference">{notifications.REFERENCE}</p><!-- ENDIF -->
+ <!-- IF notifications.FORUM --><p class="notification-forum">{notifications.FORUM}</p><!-- ENDIF -->
+ <!-- IF notifications.REASON --><p class="notification-reason">{notifications.REASON}</p><!-- ENDIF -->
+ <p class="notification-time">{notifications.TIME}</p>
+ </div>
+ <!-- IF notifications.URL --></a><!-- ENDIF -->
+ <!-- IF notifications.UNREAD -->
+ <a href="{notifications.U_MARK_READ}" class="mark_read icon-mark" data-ajax="notification.mark_read" title="{L_MARK_READ}"></a>
+ <!-- ENDIF -->
+ </li>
+ <!-- END notifications -->
+ </ul>
+
+ <div class="footer">
+ <a href="{U_VIEW_ALL_NOTIFICATIONS}"><span>{L_SEE_ALL}</span></a>
+ </div>
+ </div>
+</div>
diff --git a/phpBB/styles/prosilver/template/overall_footer.html b/phpBB/styles/prosilver/template/overall_footer.html
index 951a1d116c..faacdbff42 100644
--- a/phpBB/styles/prosilver/template/overall_footer.html
+++ b/phpBB/styles/prosilver/template/overall_footer.html
@@ -1,37 +1,54 @@
+ <!-- EVENT overall_footer_content_after -->
</div>
-<div id="page-footer">
+<!-- EVENT overall_footer_page_body_after -->
- <div class="navbar">
- <div class="inner"><span class="corners-top"><span></span></span>
+<div id="page-footer" role="contentinfo">
+ <!-- INCLUDE navbar_footer.html -->
- <ul class="linklist">
- <li class="icon-home"><a href="{U_INDEX}">{L_INDEX}</a></li>
- <!-- IF not S_IS_BOT -->
- <!-- IF S_WATCH_FORUM_LINK --><li <!-- IF S_WATCHING_FORUM -->class="icon-unsubscribe"<!-- ELSE -->class="icon-subscribe"<!-- ENDIF -->><a href="{S_WATCH_FORUM_LINK}" title="{S_WATCH_FORUM_TITLE}">{S_WATCH_FORUM_TITLE}</a></li><!-- ENDIF -->
- <!-- IF U_WATCH_TOPIC --><li <!-- IF S_WATCHING_TOPIC -->class="icon-unsubscribe"<!-- ELSE -->class="icon-subscribe"<!-- ENDIF -->><a href="{U_WATCH_TOPIC}" title="{L_WATCH_TOPIC}">{L_WATCH_TOPIC}</a></li><!-- ENDIF -->
- <!-- IF U_BOOKMARK_TOPIC --><li class="icon-bookmark"><a href="{U_BOOKMARK_TOPIC}" title="{L_BOOKMARK_TOPIC}">{L_BOOKMARK_TOPIC}</a></li><!-- ENDIF -->
- <!-- IF U_BUMP_TOPIC --><li class="icon-bump"><a href="{U_BUMP_TOPIC}" title="{L_BUMP_TOPIC}">{L_BUMP_TOPIC}</a></li><!-- ENDIF -->
- <!-- ENDIF -->
- <li class="rightside"><!-- IF U_TEAM --><a href="{U_TEAM}">{L_THE_TEAM}</a> &bull; <!-- ENDIF --><!-- IF not S_IS_BOT --><a href="{U_DELETE_COOKIES}">{L_DELETE_COOKIES}</a> &bull; <!-- ENDIF -->{S_TIMEZONE}</li>
- </ul>
-
- <span class="corners-bottom"><span></span></span></div>
- </div>
-
- <div class="copyright">{CREDIT_LINE}
+ <div class="copyright">
+ <!-- EVENT overall_footer_copyright_prepend -->
+ {CREDIT_LINE}
<!-- IF TRANSLATION_INFO --><br />{TRANSLATION_INFO}<!-- ENDIF -->
+ <!-- EVENT overall_footer_copyright_append -->
<!-- IF DEBUG_OUTPUT --><br />{DEBUG_OUTPUT}<!-- ENDIF -->
<!-- IF U_ACP --><br /><strong><a href="{U_ACP}">{L_ACP}</a></strong><!-- ENDIF -->
</div>
+
+ <div id="darkenwrapper" data-ajax-error-title="{L_AJAX_ERROR_TITLE}" data-ajax-error-text="{L_AJAX_ERROR_TEXT}" data-ajax-error-text-abort="{L_AJAX_ERROR_TEXT_ABORT}" data-ajax-error-text-timeout="{L_AJAX_ERROR_TEXT_TIMEOUT}" data-ajax-error-text-parsererror="{L_AJAX_ERROR_TEXT_PARSERERROR}">
+ <div id="darken">&nbsp;</div>
+ </div>
+
+ <div id="phpbb_alert" class="phpbb_alert" data-l-err="{L_ERROR}" data-l-timeout-processing-req="{L_TIMEOUT_PROCESSING_REQ}">
+ <a href="#" class="alert_close"></a>
+ <h3 class="alert_title">&nbsp;</h3><p class="alert_text"></p>
+ </div>
+ <div id="phpbb_confirm" class="phpbb_alert">
+ <a href="#" class="alert_close"></a>
+ <div class="alert_text"></div>
+ </div>
</div>
</div>
<div>
- <a id="bottom" name="bottom" accesskey="z"></a>
+ <a id="bottom" class="anchor" accesskey="z"></a>
<!-- IF not S_IS_BOT -->{RUN_CRON_TASK}<!-- ENDIF -->
</div>
+
+<script type="text/javascript" src="{T_JQUERY_LINK}"></script>
+<!-- IF S_ALLOW_CDN --><script type="text/javascript">window.jQuery || document.write('\x3Cscript src="{T_ASSETS_PATH}/javascript/jquery.min.js?assets_version={T_ASSETS_VERSION}">\x3C/script>');</script><!-- ENDIF -->
+<script type="text/javascript" src="{T_ASSETS_PATH}/javascript/core.js?assets_version={T_ASSETS_VERSION}"></script>
+<!-- INCLUDEJS forum_fn.js -->
+<!-- INCLUDEJS ajax.js -->
+
+<!-- EVENT overall_footer_after -->
+
+<!-- IF S_PLUPLOAD --><!-- INCLUDE plupload.html --><!-- ENDIF -->
<script src="https://nav.mageia.org/js/"></script>
+{$SCRIPTS}
+
+<!-- EVENT overall_footer_body_after -->
+
</body>
</html>
diff --git a/phpBB/styles/prosilver/template/overall_header.html b/phpBB/styles/prosilver/template/overall_header.html
index e90dcc8923..8b2e592d02 100644
--- a/phpBB/styles/prosilver/template/overall_header.html
+++ b/phpBB/styles/prosilver/template/overall_header.html
@@ -1,26 +1,25 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" dir="{S_CONTENT_DIRECTION}" lang="{S_USER_LANG}" xml:lang="{S_USER_LANG}">
+<!DOCTYPE html>
+<html dir="{S_CONTENT_DIRECTION}" lang="{S_USER_LANG}">
<head>
-
-<meta http-equiv="content-type" content="text/html; charset={S_CONTENT_ENCODING}" />
-<meta http-equiv="content-style-type" content="text/css" />
-<meta http-equiv="content-language" content="{S_USER_LANG}" />
-<meta http-equiv="imagetoolbar" content="no" />
-<meta name="resource-type" content="document" />
-<meta name="distribution" content="global" />
-<meta name="keywords" content="" />
-<meta name="description" content="" />
+<meta charset="utf-8" />
+<meta http-equiv="X-UA-Compatible" content="IE=edge">
+<meta name="viewport" content="width=device-width, initial-scale=1" />
{META}
-<title>{SITENAME} &bull; <!-- IF S_IN_MCP -->{L_MCP} &bull; <!-- ELSEIF S_IN_UCP -->{L_UCP} &bull; <!-- ENDIF -->{PAGE_TITLE}</title>
+<title><!-- IF UNREAD_NOTIFICATIONS_COUNT -->({UNREAD_NOTIFICATIONS_COUNT}) <!-- ENDIF --><!-- IF not S_VIEWTOPIC and not S_VIEWFORUM -->{SITENAME} - <!-- ENDIF --><!-- IF S_IN_MCP -->{L_MCP} - <!-- ELSEIF S_IN_UCP -->{L_UCP} - <!-- ENDIF -->{PAGE_TITLE}<!-- IF S_VIEWTOPIC or S_VIEWFORUM --> - {SITENAME}<!-- ENDIF --></title>
<!-- IF S_ENABLE_FEEDS -->
- <!-- IF S_ENABLE_FEEDS_OVERALL --><link rel="alternate" type="application/atom+xml" title="{L_FEED} - {SITENAME}" href="{U_FEED}" /><!-- ENDIF -->
- <!-- IF S_ENABLE_FEEDS_NEWS --><link rel="alternate" type="application/atom+xml" title="{L_FEED} - {L_FEED_NEWS}" href="{U_FEED}?mode=news" /><!-- ENDIF -->
- <!-- IF S_ENABLE_FEEDS_FORUMS --><link rel="alternate" type="application/atom+xml" title="{L_FEED} - {L_ALL_FORUMS}" href="{U_FEED}?mode=forums" /><!-- ENDIF -->
- <!-- IF S_ENABLE_FEEDS_TOPICS --><link rel="alternate" type="application/atom+xml" title="{L_FEED} - {L_FEED_TOPICS_NEW}" href="{U_FEED}?mode=topics" /><!-- ENDIF -->
- <!-- IF S_ENABLE_FEEDS_TOPICS_ACTIVE --><link rel="alternate" type="application/atom+xml" title="{L_FEED} - {L_FEED_TOPICS_ACTIVE}" href="{U_FEED}?mode=topics_active" /><!-- ENDIF -->
- <!-- IF S_ENABLE_FEEDS_FORUM and S_FORUM_ID --><link rel="alternate" type="application/atom+xml" title="{L_FEED} - {L_FORUM} - {FORUM_NAME}" href="{U_FEED}?f={S_FORUM_ID}" /><!-- ENDIF -->
- <!-- IF S_ENABLE_FEEDS_TOPIC and S_TOPIC_ID --><link rel="alternate" type="application/atom+xml" title="{L_FEED} - {L_TOPIC} - {TOPIC_TITLE}" href="{U_FEED}?f={S_FORUM_ID}&amp;t={S_TOPIC_ID}" /><!-- ENDIF -->
+ <!-- IF S_ENABLE_FEEDS_OVERALL --><link rel="alternate" type="application/atom+xml" title="{L_FEED} - {SITENAME}" href="{U_FEED}"><!-- ENDIF -->
+ <!-- IF S_ENABLE_FEEDS_NEWS --><link rel="alternate" type="application/atom+xml" title="{L_FEED} - {L_FEED_NEWS}" href="{U_FEED}?mode=news"><!-- ENDIF -->
+ <!-- IF S_ENABLE_FEEDS_FORUMS --><link rel="alternate" type="application/atom+xml" title="{L_FEED} - {L_ALL_FORUMS}" href="{U_FEED}?mode=forums"><!-- ENDIF -->
+ <!-- IF S_ENABLE_FEEDS_TOPICS --><link rel="alternate" type="application/atom+xml" title="{L_FEED} - {L_FEED_TOPICS_NEW}" href="{U_FEED}?mode=topics"><!-- ENDIF -->
+ <!-- IF S_ENABLE_FEEDS_TOPICS_ACTIVE --><link rel="alternate" type="application/atom+xml" title="{L_FEED} - {L_FEED_TOPICS_ACTIVE}" href="{U_FEED}?mode=topics_active"><!-- ENDIF -->
+ <!-- IF S_ENABLE_FEEDS_FORUM and S_FORUM_ID --><link rel="alternate" type="application/atom+xml" title="{L_FEED} - {L_FORUM} - {FORUM_NAME}" href="{U_FEED}?f={S_FORUM_ID}"><!-- ENDIF -->
+ <!-- IF S_ENABLE_FEEDS_TOPIC and S_TOPIC_ID --><link rel="alternate" type="application/atom+xml" title="{L_FEED} - {L_TOPIC} - {TOPIC_TITLE}" href="{U_FEED}?f={S_FORUM_ID}&amp;t={S_TOPIC_ID}"><!-- ENDIF -->
+ <!-- EVENT overall_header_feeds -->
+<!-- ENDIF -->
+
+<!-- IF U_CANONICAL -->
+ <link rel="canonical" href="{U_CANONICAL}">
<!-- ENDIF -->
<!--
@@ -30,147 +29,101 @@
Modified by:
-->
-<script type="text/javascript">
-// <![CDATA[
- var jump_page = '{LA_JUMP_PAGE}:';
- var on_page = '{ON_PAGE}';
- var per_page = '{PER_PAGE}';
- var base_url = '{A_BASE_URL}';
- var style_cookie = 'phpBBstyle';
- var style_cookie_settings = '{A_COOKIE_SETTINGS}';
- var onload_functions = new Array();
- var onunload_functions = new Array();
-
- <!-- IF S_USER_PM_POPUP and S_NEW_PM -->
- var url = '{UA_POPUP_PM}';
- window.open(url.replace(/&amp;/g, '&'), '_phpbbprivmsg', 'height=225,resizable=yes,scrollbars=yes, width=400');
- <!-- ENDIF -->
-
- /**
- * Find a member
- */
- function find_username(url)
- {
- popup(url, 760, 570, '_usersearch');
- return false;
- }
-
- /**
- * New function for handling multiple calls to window.onload and window.unload by pentapenguin
- */
- window.onload = function()
- {
- for (var i = 0; i < onload_functions.length; i++)
- {
- eval(onload_functions[i]);
- }
- };
-
- window.onunload = function()
- {
- for (var i = 0; i < onunload_functions.length; i++)
- {
- eval(onunload_functions[i]);
- }
- };
-
-// ]]>
+<!-- IF S_ALLOW_CDN -->
+<script>
+ WebFontConfig = {
+ google: {
+ families: ['Open+Sans:600:cyrillic-ext,latin,greek-ext,greek,vietnamese,latin-ext,cyrillic']
+ }
+ };
+
+ (function(d) {
+ var wf = d.createElement('script'), s = d.scripts[0];
+ wf.src = 'https://ajax.googleapis.com/ajax/libs/webfont/1.5.18/webfont.js';
+ wf.async = true;
+ s.parentNode.insertBefore(wf, s);
+ })(document);
</script>
-<script type="text/javascript" src="{T_SUPER_TEMPLATE_PATH}/styleswitcher.js"></script>
-<script type="text/javascript" src="{T_SUPER_TEMPLATE_PATH}/forum_fn.js"></script>
+<!-- ENDIF -->
+<link href="{T_FONT_AWESOME_LINK}" rel="stylesheet">
+<link href="{T_STYLESHEET_LINK}" rel="stylesheet">
+<link href="{T_STYLESHEET_LANG_LINK}" rel="stylesheet">
+<link href="{T_THEME_PATH}/responsive.css?assets_version={T_ASSETS_VERSION}" rel="stylesheet" media="all and (max-width: 700px)">
-<link href="{T_THEME_PATH}/print.css" rel="stylesheet" type="text/css" media="print" title="printonly" />
-<link href="{T_STYLESHEET_LINK}" rel="stylesheet" type="text/css" media="screen, projection" />
+<!-- IF S_CONTENT_DIRECTION eq 'rtl' -->
+ <link href="{T_THEME_PATH}/bidi.css?assets_version={T_ASSETS_VERSION}" rel="stylesheet">
+<!-- ENDIF -->
-<link href="{T_THEME_PATH}/normal.css" rel="stylesheet" type="text/css" title="A" />
-<link href="{T_THEME_PATH}/medium.css" rel="alternate stylesheet" type="text/css" title="A+" />
-<link href="{T_THEME_PATH}/large.css" rel="alternate stylesheet" type="text/css" title="A++" />
+<!-- IF S_PLUPLOAD -->
+ <link href="{T_THEME_PATH}/plupload.css?assets_version={T_ASSETS_VERSION}" rel="stylesheet">
+<!-- ENDIF -->
-<!-- IF S_CONTENT_DIRECTION eq 'rtl' -->
- <link href="{T_THEME_PATH}/bidi.css" rel="stylesheet" type="text/css" media="screen, projection" />
+<!-- IF S_COOKIE_NOTICE -->
+ <link href="{T_ASSETS_PATH}/cookieconsent/cookieconsent.min.css?assets_version={T_ASSETS_VERSION}" rel="stylesheet">
<!-- ENDIF -->
<link rel="shortcut icon" type="image/png" href="https://nav.mageia.org/g/favicon.png" />
+
+<!--[if lte IE 9]>
+ <link href="{T_THEME_PATH}/tweaks.css?assets_version={T_ASSETS_VERSION}" rel="stylesheet">
+<![endif]-->
+
+<!-- EVENT overall_header_head_append -->
+
+{$STYLESHEETS}
+
+<!-- EVENT overall_header_stylesheets_after -->
+
</head>
+<body id="phpbb" class="nojs notouch section-{SCRIPT_NAME} {S_CONTENT_DIRECTION} {BODY_CLASS}">
-<body id="phpbb" class="section-{SCRIPT_NAME} {S_CONTENT_DIRECTION}">
+<!-- EVENT overall_header_body_before -->
<div id="wrap">
- <a id="top" name="top" accesskey="t"></a>
- <div id="page-header">
- <div class="headerbar">
- <div class="inner"><span class="corners-top"><span></span></span>
-
- <div id="site-description">
- <a href="{U_INDEX}" title="{L_INDEX}" id="logo">{SITE_LOGO_IMG}</a>
- <h1>{SITENAME}</h1>
- <p>{SITE_DESCRIPTION}</p>
- <p class="skiplink"><a href="#start_here">{L_SKIP}</a></p>
+ <a id="top" class="anchor" accesskey="t"></a>
+ <div id="page-header">
+ <div class="headerbar" role="banner">
+ <!-- EVENT overall_header_headerbar_before -->
+ <div class="inner">
+
+ <div id="site-description">
+ <a id="logo" class="logo" href="<!-- IF U_SITE_HOME -->{U_SITE_HOME}<!-- ELSE -->{U_INDEX}<!-- ENDIF -->" title="<!-- IF U_SITE_HOME -->{L_SITE_HOME}<!-- ELSE -->{L_INDEX}<!-- ENDIF -->">{SITE_LOGO_IMG}</a>
+ <h1>{SITENAME}</h1>
+ <p>{SITE_DESCRIPTION}</p>
+ <p class="skiplink"><a href="#start_here">{L_SKIP}</a></p>
</div>
- <!-- IF S_DISPLAY_SEARCH and not S_IN_SEARCH -->
- <div id="search-box">
- <form action="{U_SEARCH}" method="get" id="search">
- <fieldset>
- <input name="keywords" id="keywords" type="text" maxlength="128" title="{L_SEARCH_KEYWORDS}" class="inputbox search" value="<!-- IF SEARCH_WORDS-->{SEARCH_WORDS}<!-- ELSE -->{L_SEARCH_MINI}<!-- ENDIF -->" onclick="if(this.value=='{LA_SEARCH_MINI}')this.value='';" onblur="if(this.value=='')this.value='{LA_SEARCH_MINI}';" />
- <input class="button2" value="{L_SEARCH}" type="submit" /><br />
- <a href="{U_SEARCH}" title="{L_SEARCH_ADV_EXPLAIN}">{L_SEARCH_ADV}</a> {S_SEARCH_HIDDEN_FIELDS}
- </fieldset>
- </form>
+ <!-- EVENT overall_header_searchbox_before -->
+ <!-- IF S_DISPLAY_SEARCH and not S_IN_SEARCH -->
+ <div id="search-box" class="search-box search-header" role="search">
+ <form action="{U_SEARCH}" method="get" id="search">
+ <fieldset>
+ <input name="keywords" id="keywords" type="search" maxlength="128" title="{L_SEARCH_KEYWORDS}" class="inputbox search tiny" size="20" value="{SEARCH_WORDS}" placeholder="{L_SEARCH_MINI}" />
+ <button class="button icon-button search-icon" type="submit" title="{L_SEARCH}">{L_SEARCH}</button>
+ <a href="{U_SEARCH}" class="button icon-button search-adv-icon" title="{L_SEARCH_ADV}">{L_SEARCH_ADV}</a>
+ {S_SEARCH_HIDDEN_FIELDS}
+ </fieldset>
+ </form>
</div>
- <!-- ENDIF -->
-
- <span class="corners-bottom"><span></span></span></div>
- </div>
-
- <div class="navbar">
- <div class="inner"><span class="corners-top"><span></span></span>
-
- <ul class="linklist navlinks">
- <li class="icon-home"><a href="{U_INDEX}" accesskey="h">{L_INDEX}</a> <!-- BEGIN navlinks --> <strong>&#8249;</strong> <a href="{navlinks.U_VIEW_FORUM}">{navlinks.FORUM_NAME}</a><!-- END navlinks --></li>
-
- <li class="rightside"><a href="#" onclick="fontsizeup(); return false;" onkeypress="return fontsizeup(event);" class="fontsize" title="{L_CHANGE_FONT_SIZE}">{L_CHANGE_FONT_SIZE}</a></li>
-
- <!-- IF U_EMAIL_TOPIC --><li class="rightside"><a href="{U_EMAIL_TOPIC}" title="{L_EMAIL_TOPIC}" class="sendemail">{L_EMAIL_TOPIC}</a></li><!-- ENDIF -->
- <!-- IF U_EMAIL_PM --><li class="rightside"><a href="{U_EMAIL_PM}" title="{L_EMAIL_PM}" class="sendemail">{L_EMAIL_PM}</a></li><!-- ENDIF -->
- <!-- IF U_PRINT_TOPIC --><li class="rightside"><a href="{U_PRINT_TOPIC}" title="{L_PRINT_TOPIC}" accesskey="p" class="print">{L_PRINT_TOPIC}</a></li><!-- ENDIF -->
- <!-- IF U_PRINT_PM --><li class="rightside"><a href="{U_PRINT_PM}" title="{L_PRINT_PM}" accesskey="p" class="print">{L_PRINT_PM}</a></li><!-- ENDIF -->
- </ul>
-
- <!-- IF not S_IS_BOT and S_USER_LOGGED_IN -->
- <ul class="linklist leftside">
- <li class="icon-ucp">
- <a href="{U_PROFILE}" title="{L_PROFILE}" accesskey="e">{L_PROFILE}</a>
- <!-- IF S_DISPLAY_PM --> (<a href="{U_PRIVATEMSGS}">{PRIVATE_MESSAGE_INFO}</a>)<!-- ENDIF -->
- <!-- IF S_DISPLAY_SEARCH --> &bull;
- <a href="{U_SEARCH_SELF}">{L_SEARCH_SELF}</a>
- <!-- ENDIF -->
- <!-- IF U_RESTORE_PERMISSIONS --> &bull;
- <a href="{U_RESTORE_PERMISSIONS}">{L_RESTORE_PERMISSIONS}</a>
- <!-- ENDIF -->
- </li>
- </ul>
<!-- ENDIF -->
+ <!-- EVENT overall_header_searchbox_after -->
- <ul class="linklist rightside">
- <li class="icon-faq"><a href="{U_FAQ}" title="{L_FAQ_EXPLAIN}">{L_FAQ}</a></li>
- <!-- IF not S_IS_BOT -->
- <!-- IF S_DISPLAY_MEMBERLIST --><li class="icon-members"><a href="{U_MEMBERLIST}" title="{L_MEMBERLIST_EXPLAIN}">{L_MEMBERLIST}</a></li><!-- ENDIF -->
- <!-- IF not S_USER_LOGGED_IN and S_REGISTER_ENABLED and not (S_SHOW_COPPA or S_REGISTRATION) --><li class="icon-register"><a href="{U_REGISTER}">{L_REGISTER}</a></li><!-- ENDIF -->
- <li class="icon-logout"><a href="{U_LOGIN_LOGOUT}" title="{L_LOGIN_LOGOUT}" accesskey="x">{L_LOGIN_LOGOUT}</a></li>
- <!-- ENDIF -->
- </ul>
-
- <span class="corners-bottom"><span></span></span></div>
+ </div>
+ <!-- EVENT overall_header_headerbar_after -->
</div>
-
+ <!-- EVENT overall_header_navbar_before -->
+ <!-- INCLUDE navbar_header.html -->
</div>
- <a name="start_here"></a>
- <div id="page-body">
- <!-- IF S_BOARD_DISABLED and S_USER_LOGGED_IN and (U_MCP or U_ACP) -->
- <div id="information" class="rules">
- <div class="inner"><span class="corners-top"><span></span></span>
- <strong>{L_INFORMATION}:</strong> {L_BOARD_DISABLED}
- <span class="corners-bottom"><span></span></span></div>
+ <!-- EVENT overall_header_page_body_before -->
+
+ <a id="start_here" class="anchor"></a>
+ <div id="page-body" role="main">
+ <!-- IF S_BOARD_DISABLED and S_USER_LOGGED_IN and (U_MCP or U_ACP) -->
+ <div id="information" class="rules">
+ <div class="inner">
+ <strong>{L_INFORMATION}{L_COLON}</strong> {L_BOARD_DISABLED}
+ </div>
</div>
<!-- ENDIF -->
+
+ <!-- EVENT overall_header_content_before -->
diff --git a/phpBB/styles/prosilver/template/pagination.html b/phpBB/styles/prosilver/template/pagination.html
new file mode 100644
index 0000000000..88c67459c2
--- /dev/null
+++ b/phpBB/styles/prosilver/template/pagination.html
@@ -0,0 +1,30 @@
+<ul>
+<!-- IF BASE_URL and TOTAL_PAGES > 6 -->
+ <li class="dropdown-container dropdown-button-control dropdown-page-jump page-jump">
+ <a href="#" class="dropdown-trigger" title="{L_JUMP_TO_PAGE_CLICK}" role="button">{PAGE_NUMBER}</a>
+ <div class="dropdown hidden">
+ <div class="pointer"><div class="pointer-inner"></div></div>
+ <ul class="dropdown-contents">
+ <li>{L_JUMP_TO_PAGE}{L_COLON}</li>
+ <li class="page-jump-form">
+ <input type="number" name="page-number" min="1" max="999999" title="{L_JUMP_PAGE}" class="inputbox tiny" data-per-page="{PER_PAGE}" data-base-url="{BASE_URL|e('html_attr')}" data-start-name="{START_NAME}" />
+ <input class="button2" value="{L_GO}" type="button" />
+ </li>
+ </ul>
+ </div>
+ </li>
+<!-- ENDIF -->
+<!-- BEGIN pagination -->
+ <!-- IF pagination.S_IS_PREV -->
+ <li class="previous"><a href="{pagination.PAGE_URL}" rel="prev" role="button">{L_PREVIOUS}</a></li>
+ <!-- ELSEIF pagination.S_IS_CURRENT -->
+ <li class="active"><span>{pagination.PAGE_NUMBER}</span></li>
+ <!-- ELSEIF pagination.S_IS_ELLIPSIS -->
+ <li class="ellipsis" role="separator"><span>{L_ELLIPSIS}</span></li>
+ <!-- ELSEIF pagination.S_IS_NEXT -->
+ <li class="next"><a href="{pagination.PAGE_URL}" rel="next" role="button">{L_NEXT}</a></li>
+ <!-- ELSE -->
+ <li><a href="{pagination.PAGE_URL}" role="button">{pagination.PAGE_NUMBER}</a></li>
+ <!-- ENDIF -->
+<!-- END pagination -->
+</ul>
diff --git a/phpBB/styles/prosilver/template/plupload.html b/phpBB/styles/prosilver/template/plupload.html
new file mode 100644
index 0000000000..fc663118c1
--- /dev/null
+++ b/phpBB/styles/prosilver/template/plupload.html
@@ -0,0 +1,69 @@
+<script type="text/javascript">
+//<![CDATA[
+phpbb.plupload = {
+ i18n: {
+ 'b': '{LA_BYTES_SHORT}',
+ 'kb': '{LA_KB}',
+ 'mb': '{LA_MB}',
+ 'gb': '{LA_GB}',
+ 'tb': '{LA_TB}',
+ 'Add Files': '{LA_PLUPLOAD_ADD_FILES}',
+ 'Add files to the upload queue and click the start button.': '{LA_PLUPLOAD_ADD_FILES_TO_QUEUE}',
+ 'Close': '{LA_PLUPLOAD_CLOSE}',
+ 'Drag files here.': '{LA_PLUPLOAD_DRAG}',
+ 'Duplicate file error.': '{LA_PLUPLOAD_DUPLICATE_ERROR}',
+ 'File: %s': '{LA_PLUPLOAD_FILE}',
+ 'File: %s, size: %d, max file size: %d': '{LA_PLUPLOAD_FILE_DETAILS}',
+ 'File count error.': '{LA_PLUPLOAD_ERR_FILE_COUNT}',
+ 'File extension error.': '{LA_PLUPLOAD_EXTENSION_ERROR}',
+ 'File size error.': '{LA_PLUPLOAD_SIZE_ERROR}',
+ 'File too large:': '{LA_PLUPLOAD_ERR_FILE_TOO_LARGE}',
+ 'Filename': '{LA_PLUPLOAD_FILENAME}',
+ 'Generic error.': '{LA_PLUPLOAD_GENERIC_ERROR}',
+ 'HTTP Error.': '{LA_PLUPLOAD_HTTP_ERROR}',
+ 'Image format either wrong or not supported.': '{LA_PLUPLOAD_IMAGE_FORMAT}',
+ 'Init error.': '{LA_PLUPLOAD_INIT_ERROR}',
+ 'IO error.': '{LA_PLUPLOAD_IO_ERROR}',
+ 'Invalid file extension:': '{LA_PLUPLOAD_ERR_FILE_INVALID_EXT}',
+ 'N/A': '{LA_PLUPLOAD_NOT_APPLICABLE}',
+ 'Runtime ran out of available memory.': '{LA_PLUPLOAD_ERR_RUNTIME_MEMORY}',
+ 'Security error.': '{LA_PLUPLOAD_SECURITY_ERROR}',
+ 'Select files': '{LA_PLUPLOAD_SELECT_FILES}',
+ 'Size': '{LA_PLUPLOAD_SIZE}',
+ 'Start Upload': '{LA_PLUPLOAD_START_UPLOAD}',
+ 'Start uploading queue': '{LA_PLUPLOAD_START_CURRENT_UPLOAD}',
+ 'Status': '{LA_PLUPLOAD_STATUS}',
+ 'Stop Upload': '{LA_PLUPLOAD_STOP_UPLOAD}',
+ 'Stop current upload': '{LA_PLUPLOAD_STOP_CURRENT_UPLOAD}',
+ "Upload URL might be wrong or doesn't exist.": '{LA_PLUPLOAD_ERR_UPLOAD_URL}',
+ 'Uploaded %d/%d files': '{LA_PLUPLOAD_UPLOADED}',
+ '%d files queued': '{LA_PLUPLOAD_FILES_QUEUED}',
+ '%s already present in the queue.': '{LA_PLUPLOAD_ALREADY_QUEUED}'
+ },
+ config: {
+ runtimes: 'html5',
+ url: '{S_PLUPLOAD_URL}',
+ max_file_size: '{FILESIZE}b',
+ chunk_size: '{CHUNK_SIZE}b',
+ unique_names: true,
+ filters: [{FILTERS}],
+ {S_RESIZE}
+ headers: {'X-PHPBB-USING-PLUPLOAD': '1', 'X-Requested-With': 'XMLHttpRequest'},
+ file_data_name: 'fileupload',
+ multipart_params: {'add_file': '{LA_ADD_FILE}'},
+ form_hook: '#postform',
+ browse_button: 'add_files',
+ drop_element : 'message',
+ },
+ lang: {
+ ERROR: '{LA_ERROR}',
+ TOO_MANY_ATTACHMENTS: '{LA_TOO_MANY_ATTACHMENTS}',
+ },
+ order: '{ATTACH_ORDER}',
+ maxFiles: {MAX_ATTACHMENTS},
+ data: {S_ATTACH_DATA},
+}
+//]]>
+</script>
+<!-- INCLUDEJS {T_ASSETS_PATH}/plupload/plupload.full.min.js -->
+<!-- INCLUDEJS {T_ASSETS_PATH}/javascript/plupload.js -->
diff --git a/phpBB/styles/prosilver/template/posting_attach_body.html b/phpBB/styles/prosilver/template/posting_attach_body.html
index d39405487d..d7922297a7 100644
--- a/phpBB/styles/prosilver/template/posting_attach_body.html
+++ b/phpBB/styles/prosilver/template/posting_attach_body.html
@@ -1,21 +1,85 @@
-<div class="panel bg3" id="attach-panel">
- <div class="inner"><span class="corners-top"><span></span></span>
+<div class="panel bg3 panel-container" id="attach-panel">
+ <div class="inner">
- <p>{L_ADD_ATTACHMENT_EXPLAIN}</p>
+ <p>{L_ADD_ATTACHMENT_EXPLAIN} <span class="hidden" id="drag-n-drop-message">{L_PLUPLOAD_DRAG_TEXTAREA}</span></p>
- <fieldset class="fields2">
+ <fieldset class="fields2" id="attach-panel-basic">
<dl>
- <dt><label for="fileupload">{L_FILENAME}:</label></dt>
+ <dt><label for="fileupload">{L_FILENAME}{L_COLON}</label></dt>
<dd>
- <input type="file" name="fileupload" id="fileupload" maxlength="{FILESIZE}" value="" class="inputbox autowidth" />
+ <input type="file" name="fileupload" id="fileupload" class="inputbox autowidth" />
<input type="submit" name="add_file" value="{L_ADD_FILE}" class="button2" onclick="upload = true;" />
</dd>
</dl>
<dl>
- <dt><label for="filecomment">{L_FILE_COMMENT}:</label></dt>
+ <dt><label for="filecomment">{L_FILE_COMMENT}{L_COLON}</label></dt>
<dd><textarea name="filecomment" id="filecomment" rows="1" cols="40" class="inputbox autowidth">{FILE_COMMENT}</textarea></dd>
</dl>
</fieldset>
- <span class="corners-bottom"><span></span></span></div>
+ <div id="attach-panel-multi">
+ <input type="button" class="button2" value="{L_PLUPLOAD_ADD_FILES}" id="add_files" />
+ </div>
+
+ <div class="panel<!-- IF not .attach_row --> hidden<!-- ENDIF -->" id="file-list-container">
+ <div class="inner">
+ <table class="table1 zebra-list fixed-width-table">
+ <thead>
+ <tr>
+ <th class="attach-name">{L_PLUPLOAD_FILENAME}</th>
+ <th class="attach-comment">{L_FILE_COMMENT}</th>
+ <th class="attach-filesize">{L_PLUPLOAD_SIZE}</th>
+ <th class="attach-status">{L_PLUPLOAD_STATUS}</th>
+ </tr>
+ </thead>
+ <tbody class="responsive-skip-empty" id="file-list">
+ <tr class="attach-row" id="attach-row-tpl">
+ <td class="attach-name">
+ <span class="file-name ellipsis-text"></span>
+ <span class="attach-controls">
+ <input type="button" value="{L_PLACE_INLINE}" class="button2 hidden file-inline-bbcode" />&nbsp;
+ <input type="button" value="{L_DELETE_FILE}" class="button2 file-delete" />
+ </span>
+ <span class="clear"></span>
+ </td>
+ <td class="attach-comment">
+ <textarea rows="1" cols="30" class="inputbox"></textarea>
+ </td>
+ <td class="attach-filesize">
+ <span class="file-size"></span>
+ </td>
+ <td class="attach-status">
+ <span class="file-progress">
+ <span class="file-progress-bar"></span>
+ </span>
+ <span class="file-status"></span>
+ </td>
+ </tr>
+ <!-- BEGIN attach_row -->
+ <tr class="attach-row" data-attach-id="{attach_row.ATTACH_ID}">
+ <td class="attach-name">
+ <span class="file-name ellipsis-text"><a href="{attach_row.U_VIEW_ATTACHMENT}">{attach_row.FILENAME}</a></span>
+ <span class="attach-controls">
+ <!-- IF S_INLINE_ATTACHMENT_OPTIONS --><input type="button" value="{L_PLACE_INLINE}" class="button2 file-inline-bbcode" />&nbsp; <!-- ENDIF -->
+ <input type="submit" name="delete_file[{attach_row.ASSOC_INDEX}]" value="{L_DELETE_FILE}" class="button2 file-delete" />
+ </span>
+ <span class="clear"></span>
+ </td>
+ <td class="attach-comment">
+ <textarea name="comment_list[{attach_row.ASSOC_INDEX}]" rows="1" cols="30" class="inputbox">{attach_row.FILE_COMMENT}</textarea>
+ {attach_row.S_HIDDEN}
+ </td>
+ <td class="attach-filesize">
+ <span class="file-size">{attach_row.FILESIZE}</span>
+ </td>
+ <td class="attach-status">
+ <span class="file-status file-uploaded"></span>
+ </td>
+ </tr>
+ <!-- END attach_row -->
+ </tbody>
+ </table>
+ </div>
+ </div>
+ </div>
</div>
diff --git a/phpBB/styles/prosilver/template/posting_buttons.html b/phpBB/styles/prosilver/template/posting_buttons.html
index 78c2a0d9f2..1555b12369 100644
--- a/phpBB/styles/prosilver/template/posting_buttons.html
+++ b/phpBB/styles/prosilver/template/posting_buttons.html
@@ -32,64 +32,55 @@
<!-- END custom_tags -->
}
- var panels = new Array('options-panel', 'attach-panel', 'poll-panel');
- var show_panel = 'options-panel';
+ function change_palette()
+ {
+ phpbb.toggleDisplay('colour_palette');
+ e = document.getElementById('colour_palette');
+ if (e.style.display == 'block')
+ {
+ document.getElementById('bbpalette').value = '{LA_FONT_COLOR_HIDE}';
+ }
+ else
+ {
+ document.getElementById('bbpalette').value = '{LA_FONT_COLOR}';
+ }
+ }
// ]]>
</script>
-<script type="text/javascript" src="{T_SUPER_TEMPLATE_PATH}/editor.js"></script>
+<!-- INCLUDEJS {T_ASSETS_PATH}/javascript/editor.js -->
<!-- IF S_BBCODE_ALLOWED -->
<div id="colour_palette" style="display: none;">
<dl style="clear: left;">
- <dt><label>{L_FONT_COLOR}:</label></dt>
- <dd>
- <script type="text/javascript">
- // <![CDATA[
- function change_palette()
- {
- dE('colour_palette');
- e = document.getElementById('colour_palette');
-
- if (e.style.display == 'block')
- {
- document.getElementById('bbpalette').value = '{LA_FONT_COLOR_HIDE}';
- }
- else
- {
- document.getElementById('bbpalette').value = '{LA_FONT_COLOR}';
- }
- }
-
- colorPalette('h', 15, 10);
- // ]]>
- </script>
- </dd>
+ <dt><label>{L_FONT_COLOR}{L_COLON}</label></dt>
+ <dd id="color_palette_placeholder" data-orientation="h" data-height="12" data-width="15" data-bbcode="true"></dd>
</dl>
</div>
+<!-- EVENT posting_editor_buttons_before -->
<div id="format-buttons">
- <input type="button" class="button2" accesskey="b" name="addbbcode0" value=" B " style="font-weight:bold; width: 30px" onclick="bbstyle(0)" title="{L_BBCODE_B_HELP}" />
- <input type="button" class="button2" accesskey="i" name="addbbcode2" value=" i " style="font-style:italic; width: 30px" onclick="bbstyle(2)" title="{L_BBCODE_I_HELP}" />
- <input type="button" class="button2" accesskey="u" name="addbbcode4" value=" u " style="text-decoration: underline; width: 30px" onclick="bbstyle(4)" title="{L_BBCODE_U_HELP}" />
+ <input type="button" class="button2 bbcode-b" accesskey="b" name="addbbcode0" value=" B " style="font-weight:bold; width: 30px" onclick="bbstyle(0)" title="{L_BBCODE_B_HELP}" />
+ <input type="button" class="button2 bbcode-i" accesskey="i" name="addbbcode2" value=" i " style="font-style:italic; width: 30px" onclick="bbstyle(2)" title="{L_BBCODE_I_HELP}" />
+ <input type="button" class="button2 bbcode-u" accesskey="u" name="addbbcode4" value=" u " style="text-decoration: underline; width: 30px" onclick="bbstyle(4)" title="{L_BBCODE_U_HELP}" />
<!-- IF S_BBCODE_QUOTE -->
- <input type="button" class="button2" accesskey="q" name="addbbcode6" value="Quote" style="width: 50px" onclick="bbstyle(6)" title="{L_BBCODE_Q_HELP}" />
+ <input type="button" class="button2 bbcode-quote" accesskey="q" name="addbbcode6" value="Quote" style="width: 50px" onclick="bbstyle(6)" title="{L_BBCODE_Q_HELP}" />
<!-- ENDIF -->
- <input type="button" class="button2" accesskey="c" name="addbbcode8" value="Code" style="width: 40px" onclick="bbstyle(8)" title="{L_BBCODE_C_HELP}" />
- <input type="button" class="button2" accesskey="l" name="addbbcode10" value="List" style="width: 40px" onclick="bbstyle(10)" title="{L_BBCODE_L_HELP}" />
- <input type="button" class="button2" accesskey="o" name="addbbcode12" value="List=" style="width: 40px" onclick="bbstyle(12)" title="{L_BBCODE_O_HELP}" />
- <input type="button" class="button2" accesskey="y" name="addlistitem" value="[*]" style="width: 40px" onclick="bbstyle(-1)" title="{L_BBCODE_LISTITEM_HELP}" />
+ <input type="button" class="button2 bbcode-code" accesskey="c" name="addbbcode8" value="Code" style="width: 40px" onclick="bbstyle(8)" title="{L_BBCODE_C_HELP}" />
+ <input type="button" class="button2 bbcode-list" accesskey="l" name="addbbcode10" value="List" style="width: 40px" onclick="bbstyle(10)" title="{L_BBCODE_L_HELP}" />
+ <input type="button" class="button2 bbcode-list-" accesskey="o" name="addbbcode12" value="List=" style="width: 40px" onclick="bbstyle(12)" title="{L_BBCODE_O_HELP}" />
+ <input type="button" class="button2 bbcode-asterisk" accesskey="y" name="addlistitem" value="[*]" style="width: 40px" onclick="bbstyle(-1)" title="{L_BBCODE_LISTITEM_HELP}" />
<!-- IF S_BBCODE_IMG -->
- <input type="button" class="button2" accesskey="p" name="addbbcode14" value="Img" style="width: 40px" onclick="bbstyle(14)" title="{L_BBCODE_P_HELP}" />
+ <input type="button" class="button2 bbcode-img" accesskey="p" name="addbbcode14" value="Img" style="width: 40px" onclick="bbstyle(14)" title="{L_BBCODE_P_HELP}" />
<!-- ENDIF -->
<!-- IF S_LINKS_ALLOWED -->
- <input type="button" class="button2" accesskey="w" name="addbbcode16" value="URL" style="text-decoration: underline; width: 40px" onclick="bbstyle(16)" title="{L_BBCODE_W_HELP}" />
+ <input type="button" class="button2 bbcode-url" accesskey="w" name="addbbcode16" value="URL" style="text-decoration: underline; width: 40px" onclick="bbstyle(16)" title="{L_BBCODE_W_HELP}" />
<!-- ENDIF -->
<!-- IF S_BBCODE_FLASH -->
- <input type="button" class="button2" accesskey="d" name="addbbcode18" value="Flash" onclick="bbstyle(18)" title="{L_BBCODE_D_HELP}" />
+ <input type="button" class="button2 bbcode-flash" accesskey="d" name="addbbcode18" value="Flash" onclick="bbstyle(18)" title="{L_BBCODE_D_HELP}" />
<!-- ENDIF -->
- <select name="addbbcode20" onchange="bbfontstyle('[size=' + this.form.addbbcode20.options[this.form.addbbcode20.selectedIndex].value + ']', '[/size]');this.form.addbbcode20.selectedIndex = 2;" title="{L_BBCODE_F_HELP}">
+ <select name="addbbcode20" class="bbcode-size" onchange="bbfontstyle('[size=' + this.form.addbbcode20.options[this.form.addbbcode20.selectedIndex].value + ']', '[/size]');this.form.addbbcode20.selectedIndex = 2;" title="{L_BBCODE_F_HELP}">
<option value="50">{L_FONT_TINY}</option>
<option value="85">{L_FONT_SMALL}</option>
<option value="100" selected="selected">{L_FONT_NORMAL}</option>
@@ -100,9 +91,13 @@
<!-- ENDIF -->
<!-- ENDIF -->
</select>
- <input type="button" class="button2" name="bbpalette" id="bbpalette" value="{L_FONT_COLOR}" onclick="change_palette();" title="{L_BBCODE_S_HELP}" />
+ <input type="button" class="button2 bbcode-color" name="bbpalette" id="bbpalette" value="{L_FONT_COLOR}" onclick="change_palette();" title="{L_BBCODE_S_HELP}" />
+
+ <!-- EVENT posting_editor_buttons_custom_tags_before -->
+
<!-- BEGIN custom_tags -->
- <input type="button" class="button2" name="addbbcode{custom_tags.BBCODE_ID}" value="{custom_tags.BBCODE_TAG}" onclick="bbstyle({custom_tags.BBCODE_ID})" title="{custom_tags.BBCODE_HELPLINE}" />
+ <input type="button" class="button2 bbcode-{custom_tags.BBCODE_TAG_CLEAN}" name="addbbcode{custom_tags.BBCODE_ID}" value="{custom_tags.BBCODE_TAG}" onclick="bbstyle({custom_tags.BBCODE_ID})" title="{custom_tags.BBCODE_HELPLINE}" />
<!-- END custom_tags -->
</div>
+<!-- EVENT posting_editor_buttons_after -->
<!-- ENDIF -->
diff --git a/phpBB/styles/prosilver/template/posting_editor.html b/phpBB/styles/prosilver/template/posting_editor.html
index 5acdb3a08c..5258ea09a2 100644
--- a/phpBB/styles/prosilver/template/posting_editor.html
+++ b/phpBB/styles/prosilver/template/posting_editor.html
@@ -1,109 +1,33 @@
-<script type="text/javascript">
-// <![CDATA[
- onload_functions.push('apply_onkeypress_event()');
-// ]]>
-</script>
-
<fieldset class="fields1">
<!-- IF ERROR --><p class="error">{ERROR}</p><!-- ENDIF -->
- <!-- IF S_PRIVMSGS and not S_SHOW_DRAFTS -->
-
- <div class="column1">
- <!-- IF S_ALLOW_MASS_PM -->
- <!-- IF .to_recipient -->
- <dl>
- <dt><label>{L_TO}:</label></dt>
- <dd>
- <!-- BEGIN to_recipient -->
- <!-- IF not to_recipient.S_FIRST_ROW and to_recipient.S_ROW_COUNT mod 2 eq 0 --></dd><dd><!-- ENDIF -->
- <!-- IF to_recipient.IS_GROUP --><a href="{to_recipient.U_VIEW}"><strong>{to_recipient.NAME}</strong></a><!-- ELSE -->{to_recipient.NAME_FULL}<!-- ENDIF -->&nbsp;
- <!-- IF not S_EDIT_POST --><input type="submit" name="remove_{to_recipient.TYPE}[{to_recipient.UG_ID}]" value="x" class="button2" />&nbsp;<!-- ENDIF -->
- <!-- END to_recipient -->
- </dd>
- </dl>
- <!-- ENDIF -->
- <!-- IF .bcc_recipient -->
- <dl>
- <dt><label>{L_BCC}:</label></dt>
- <dd>
- <!-- BEGIN bcc_recipient -->
- <!-- IF not bcc_recipient.S_FIRST_ROW and bcc_recipient.S_ROW_COUNT mod 2 eq 0 --></dd><dd><!-- ENDIF -->
- <!-- IF bcc_recipient.IS_GROUP --><a href="{bcc_recipient.U_VIEW}"><strong>{bcc_recipient.NAME}</strong></a><!-- ELSE -->{bcc_recipient.NAME_FULL}<!-- ENDIF -->&nbsp;
- <!-- IF not S_EDIT_POST --><input type="submit" name="remove_{bcc_recipient.TYPE}[{bcc_recipient.UG_ID}]" value="x" class="button2" />&nbsp;<!-- ENDIF -->
- <!-- END bcc_recipient -->
- </dd>
- </dl>
- <!-- ENDIF -->
- <!-- IF not S_EDIT_POST -->
- <dl class="pmlist">
- <dt><textarea id="username_list" name="username_list" class="inputbox" cols="50" rows="2" tabindex="1"></textarea></dt>
- <dd><span><a href="{U_FIND_USERNAME}" onclick="find_username(this.href); return false;">{L_FIND_USERNAME}</a></span></dd>
- <dd><input type="submit" name="add_to" value="{L_ADD}" class="button2" tabindex="1" /></dd>
- <dd><input type="submit" name="add_bcc" value="{L_ADD_BCC}" class="button2" tabindex="1" /></dd>
- </dl>
- <!-- ENDIF -->
- <!-- ELSE -->
- <dl>
- <dt><label for="username_list">{L_TO}:</label><!-- IF not S_EDIT_POST --><br /><span><a href="{U_FIND_USERNAME}" onclick="find_username(this.href); return false">{L_FIND_USERNAME}</a></span><!-- ENDIF --></dt>
- <!-- IF .to_recipient -->
- <dd>
- <!-- BEGIN to_recipient -->
- <!-- IF not to_recipient.S_FIRST_ROW and to_recipient.S_ROW_COUNT mod 2 eq 0 --></dd><dd><!-- ENDIF -->
- <!-- IF to_recipient.IS_GROUP --><a href="{to_recipient.U_VIEW}"><strong>{to_recipient.NAME}</strong></a><!-- ELSE -->{to_recipient.NAME_FULL}<!-- ENDIF -->&nbsp;
- <!-- IF not S_EDIT_POST --><input type="submit" name="remove_{to_recipient.TYPE}[{to_recipient.UG_ID}]" value="x" class="button2" />&nbsp;<!-- ENDIF -->
- <!-- END to_recipient -->
- </dd>
- <!-- ENDIF -->
-
- <!-- IF not S_EDIT_POST -->
- <dd><input class="inputbox" type="text" name="username_list" id="username_list" size="20" value="" /> <input type="submit" name="add_to" value="{L_ADD}" class="button2" /></dd>
- <!-- ENDIF -->
- </dl>
- <!-- ENDIF -->
-
- </div>
-
- <!-- IF S_GROUP_OPTIONS -->
- <div class="column2">
- <dl>
- <dd><label for="group_list">{L_USERGROUPS}:</label> <select name="group_list[]" id="group_list" multiple="multiple" size="4" class="inputbox">{S_GROUP_OPTIONS}</select></dd>
- </dl>
- </div>
- <!-- ENDIF -->
-
- <div class="clear"></div>
-
- <!-- ENDIF -->
-
- <!-- IF S_DELETE_ALLOWED -->
- <dl>
- <dt><label for="delete">{L_DELETE_POST}:</label></dt>
- <dd><label for="delete"><input type="checkbox" name="delete" id="delete" /> {L_DELETE_POST_WARN}</label></dd>
- </dl>
- <!-- ENDIF -->
-
<!-- IF S_SHOW_TOPIC_ICONS or S_SHOW_PM_ICONS -->
<dl>
- <dt><label for="icon">{L_ICON}:</label></dt>
+ <dt><label for="icon">{L_ICON}{L_COLON}</label></dt>
<dd>
<label for="icon"><input type="radio" name="icon" id="icon" value="0" checked="checked" tabindex="1" /> <!-- IF S_SHOW_TOPIC_ICONS -->{L_NO_TOPIC_ICON}<!-- ELSE -->{L_NO_PM_ICON}<!-- ENDIF --></label>
- <!-- BEGIN topic_icon --><label for="icon-{topic_icon.ICON_ID}"><input type="radio" name="icon" id="icon-{topic_icon.ICON_ID}" value="{topic_icon.ICON_ID}" {topic_icon.S_ICON_CHECKED} tabindex="1" /><img src="{topic_icon.ICON_IMG}" width="{topic_icon.ICON_WIDTH}" height="{topic_icon.ICON_HEIGHT}" alt="" title="" /></label> <!-- END topic_icon -->
+ <!-- BEGIN topic_icon --><label for="icon-{topic_icon.ICON_ID}"><input type="radio" name="icon" id="icon-{topic_icon.ICON_ID}" value="{topic_icon.ICON_ID}" {topic_icon.S_ICON_CHECKED} tabindex="1" /><img src="{topic_icon.ICON_IMG}" width="{topic_icon.ICON_WIDTH}" height="{topic_icon.ICON_HEIGHT}" alt="{topic_icon.ICON_NAME}" title="" /></label> <!-- END topic_icon -->
</dd>
</dl>
<!-- ENDIF -->
<!-- IF not S_PRIVMSGS and S_DISPLAY_USERNAME -->
<dl style="clear: left;">
- <dt><label for="username">{L_USERNAME}:</label></dt>
+ <dt><label for="username">{L_USERNAME}{L_COLON}</label></dt>
<dd><input type="text" tabindex="1" name="username" id="username" size="25" value="{USERNAME}" class="inputbox autowidth" /></dd>
</dl>
<!-- ENDIF -->
+ <!-- EVENT posting_editor_subject_before -->
+
<!-- IF S_POST_ACTION or S_PRIVMSGS or S_EDIT_DRAFT -->
<dl style="clear: left;">
- <dt><label for="subject">{L_SUBJECT}:</label></dt>
- <dd><input type="text" name="subject" id="subject" size="45" maxlength="<!-- IF S_NEW_MESSAGE -->60<!-- ELSE -->64<!-- ENDIF -->" tabindex="2" value="{SUBJECT}{DRAFT_SUBJECT}" class="inputbox autowidth" /></dd>
+ <dt><label for="subject">{L_SUBJECT}{L_COLON}</label></dt>
+ <dd>
+ <!-- EVENT posting_editor_subject_prepend -->
+ <input type="text" name="subject" id="subject" size="45" maxlength="<!-- IF S_NEW_MESSAGE -->120<!-- ELSE -->124<!-- ENDIF -->" tabindex="2" value="{SUBJECT}{DRAFT_SUBJECT}" class="inputbox autowidth" />
+ <!-- EVENT posting_editor_subject_append -->
+ </dd>
</dl>
<!-- IF CAPTCHA_TEMPLATE and S_CONFIRM_CODE -->
<!-- DEFINE $CAPTCHA_TAB_INDEX = 3 -->
@@ -111,29 +35,35 @@
<!-- ENDIF -->
<!-- ENDIF -->
+ <!-- EVENT posting_editor_subject_after -->
+
<!-- INCLUDE posting_buttons.html -->
<div id="smiley-box">
+ <!-- EVENT posting_editor_smilies_before -->
<!-- IF S_SMILIES_ALLOWED and .smiley -->
<strong>{L_SMILIES}</strong><br />
<!-- BEGIN smiley -->
<a href="#" onclick="insert_text('{smiley.A_SMILEY_CODE}', true); return false;"><img src="{smiley.SMILEY_IMG}" width="{smiley.SMILEY_WIDTH}" height="{smiley.SMILEY_HEIGHT}" alt="{smiley.SMILEY_CODE}" title="{smiley.SMILEY_DESC}" /></a>
<!-- END smiley -->
<!-- ENDIF -->
- <!-- IF S_SHOW_SMILEY_LINK and S_SMILIES_ALLOWED-->
- <br /><a href="{U_MORE_SMILIES}" onclick="popup(this.href, 300, 350, '_phpbbsmilies'); return false;">{L_MORE_SMILIES}</a>
+ <!-- IF S_SHOW_SMILEY_LINK and S_SMILIES_ALLOWED -->
+ <br /><a href="{U_MORE_SMILIES}" onclick="popup(this.href, 750, 350, '_phpbbsmilies'); return false;">{L_MORE_SMILIES}</a>
<!-- ENDIF -->
-
+ <!-- EVENT posting_editor_smilies_after -->
<!-- IF BBCODE_STATUS -->
- <!-- IF .smiley --><hr /><!-- ENDIF -->
- {BBCODE_STATUS}<br />
- <!-- IF S_BBCODE_ALLOWED -->
- {IMG_STATUS}<br />
- {FLASH_STATUS}<br />
- {URL_STATUS}<br />
- <!-- ENDIF -->
- {SMILIES_STATUS}
+ <div class="bbcode-status">
+ <!-- IF .smiley --><hr /><!-- ENDIF -->
+ {BBCODE_STATUS}<br />
+ <!-- IF S_BBCODE_ALLOWED -->
+ {IMG_STATUS}<br />
+ {FLASH_STATUS}<br />
+ {URL_STATUS}<br />
+ <!-- ENDIF -->
+ {SMILIES_STATUS}
+ </div>
<!-- ENDIF -->
+ <!-- EVENT posting_editor_bbcode_status_after -->
<!-- IF S_EDIT_DRAFT || S_DISPLAY_REVIEW -->
<!-- IF S_DISPLAY_REVIEW --><hr /><!-- ENDIF -->
<!-- IF S_EDIT_DRAFT --><strong><a href="{S_UCP_ACTION}">{L_BACK_TO_DRAFTS}</a></strong><!-- ENDIF -->
@@ -141,52 +71,29 @@
<!-- ENDIF -->
</div>
+ <!-- EVENT posting_editor_message_before -->
+
<div id="message-box">
<textarea <!-- IF S_UCP_ACTION and not S_PRIVMSGS and not S_EDIT_DRAFT -->name="signature" id="signature" style="height: 9em;"<!-- ELSE -->name="message" id="message"<!-- ENDIF --> rows="15" cols="76" tabindex="4" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);" onfocus="initInsertions();" class="inputbox">{MESSAGE}{DRAFT_MESSAGE}{SIGNATURE}</textarea>
</div>
-</fieldset>
+
+ <!-- EVENT posting_editor_message_after -->
+ </fieldset>
<!-- IF $EXTRA_POSTING_OPTIONS eq 1 -->
<!-- IF not S_SHOW_DRAFTS -->
- <span class="corners-bottom"><span></span></span></div>
- </div>
- <!-- ENDIF -->
-
- <!-- IF S_HAS_ATTACHMENTS -->
- <div class="panel bg2">
- <div class="inner"><span class="corners-top"><span></span></span>
- <h3>{L_POSTED_ATTACHMENTS}</h3>
-
- <fieldset class="fields2">
-
- <!-- BEGIN attach_row -->
- <dl>
-
- <dt><label for="comment_list_{attach_row.ASSOC_INDEX}">{L_FILE_COMMENT}:</label></dt>
- <dd><textarea name="comment_list[{attach_row.ASSOC_INDEX}]" id="comment_list_{attach_row.ASSOC_INDEX}" rows="1" cols="35" class="inputbox">{attach_row.FILE_COMMENT}</textarea></dd>
- <dd><a href="{attach_row.U_VIEW_ATTACHMENT}">{attach_row.FILENAME}</a></dd>
- <dd style="margin-top: 5px;">
- <!-- IF S_INLINE_ATTACHMENT_OPTIONS --><input type="button" value="{L_PLACE_INLINE}" onclick="attach_inline({attach_row.ASSOC_INDEX}, '{attach_row.A_FILENAME}');" class="button2" />&nbsp; <!-- ENDIF -->
- <input type="submit" name="delete_file[{attach_row.ASSOC_INDEX}]" value="{L_DELETE_FILE}" class="button2" />
- </dd>
- </dl>
- {attach_row.S_HIDDEN}
- <!-- IF not attach_row.S_LAST_ROW --><hr class="dashed" /><!-- ENDIF -->
- <!-- END attach_row -->
-
- </fieldset>
-
- <span class="corners-bottom"><span></span></span></div>
</div>
+ </div>
<!-- ENDIF -->
<!-- IF not S_SHOW_DRAFTS and not $SIG_EDIT eq 1 -->
<div class="panel bg2">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<fieldset class="submit-buttons">
{S_HIDDEN_ADDRESS_FIELD}
{S_HIDDEN_FIELDS}
+ <!-- EVENT posting_editor_submit_buttons -->
<!-- IF S_HAS_DRAFTS --><input type="submit" accesskey="d" tabindex="8" name="load" value="{L_LOAD_DRAFT}" class="button2" onclick="load_draft = true;" />&nbsp; <!-- ENDIF -->
<!-- IF S_SAVE_ALLOWED --><input type="submit" accesskey="k" tabindex="7" name="save" value="{L_SAVE_DRAFT}" class="button2" />&nbsp; <!-- ENDIF -->
<input type="submit" tabindex="5" name="preview" value="{L_PREVIEW}" class="button1"<!-- IF not S_PRIVMSGS --> onclick="document.getElementById('postform').action += '#preview';"<!-- ENDIF --> />&nbsp;
@@ -194,25 +101,37 @@
</fieldset>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<!-- ENDIF -->
<!-- IF not S_PRIVMSGS and not S_SHOW_DRAFTS and not $SIG_EDIT eq 1 -->
- <div id="tabs">
+ <div id="tabs" class="sub-panels" data-show-panel="<!-- IF SHOW_PANEL -->{SHOW_PANEL}<!-- ELSE -->options-panel<!-- ENDIF -->" role="tablist">
<ul>
- <li id="options-panel-tab" class="activetab"><a href="#tabs" onclick="subPanels('options-panel'); return false;"><span>{L_OPTIONS}</span></a></li>
- <!-- IF S_SHOW_ATTACH_BOX --><li id="attach-panel-tab"><a href="#tabs" onclick="subPanels('attach-panel'); return false;"><span>{L_ADD_ATTACHMENT}</span></a></li><!-- ENDIF -->
- <!-- IF S_SHOW_POLL_BOX || S_POLL_DELETE --><li id="poll-panel-tab"><a href="#tabs" onclick="subPanels('poll-panel'); return false;"><span>{L_ADD_POLL}</span></a></li><!-- ENDIF -->
+ <li id="options-panel-tab" class="tab activetab"><a href="#tabs" data-subpanel="options-panel" role="tab" aria-controls="options-panel"><span>{L_OPTIONS}</span></a></li>
+ <!-- IF S_SHOW_ATTACH_BOX -->
+ <li id="attach-panel-tab" class="tab">
+ <a href="#tabs" data-subpanel="attach-panel" role="tab" aria-controls="attach-panel">
+ {L_ATTACHMENTS} <strong id="file-total-progress"><strong id="file-total-progress-bar"></strong></strong>
+ </a>
+ </li>
+ <!-- ENDIF -->
+ <!-- IF S_SHOW_POLL_BOX || S_POLL_DELETE -->
+ <li id="poll-panel-tab" class="tab">
+ <a href="#tabs" data-subpanel="poll-panel" role="tab" aria-controls="poll-panel">{L_ADD_POLL}</a>
+ </li>
+ <!-- ENDIF -->
+ <!-- EVENT posting_editor_add_panel_tab -->
</ul>
</div>
<!-- ENDIF -->
<!-- IF not S_SHOW_DRAFTS and not $SIG_EDIT eq 1 -->
<div class="panel bg3" id="options-panel">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<fieldset class="fields1">
+ <!-- EVENT posting_editor_options_prepend -->
<!-- IF S_BBCODE_ALLOWED -->
<div><label for="disable_bbcode"><input type="checkbox" name="disable_bbcode" id="disable_bbcode"{S_BBCODE_CHECKED} /> {L_DISABLE_BBCODE}</label></div>
<!-- ENDIF -->
@@ -241,26 +160,37 @@
<!-- IF S_TYPE_TOGGLE -->
<dl>
- <dt><label for="topic_type-0"><!-- IF S_EDIT_POST -->{L_CHANGE_TOPIC_TO}<!-- ELSE -->{L_POST_TOPIC_AS}<!-- ENDIF -->:</label></dt>
+ <dt><label for="topic_type-0"><!-- IF S_EDIT_POST -->{L_CHANGE_TOPIC_TO}<!-- ELSE -->{L_POST_TOPIC_AS}<!-- ENDIF -->{L_COLON}</label></dt>
<dd><!-- BEGIN topic_type --><label for="topic_type-{topic_type.VALUE}"><input type="radio" name="topic_type" id="topic_type-{topic_type.VALUE}" value="{topic_type.VALUE}"{topic_type.S_CHECKED} />{topic_type.L_TOPIC_TYPE}</label> <!-- END topic_type --></dd>
</dl>
<!-- ENDIF -->
<!-- IF S_TOPIC_TYPE_ANNOUNCE or S_TOPIC_TYPE_STICKY -->
<dl>
- <dt><label for="topic_time_limit">{L_STICK_TOPIC_FOR}:</label></dt>
- <dd><label for="topic_time_limit"><input type="text" name="topic_time_limit" id="topic_time_limit" size="3" maxlength="3" value="{TOPIC_TIME_LIMIT}" class="inputbox autowidth" /> {L_DAYS}</label></dd>
+ <dt><label for="topic_time_limit">{L_STICK_TOPIC_FOR}{L_COLON}</label></dt>
+ <dd><label for="topic_time_limit"><input type="number" min="0" max="999" name="topic_time_limit" id="topic_time_limit" value="{TOPIC_TIME_LIMIT}" class="inputbox autowidth" /> {L_DAYS}</label></dd>
<dd>{L_STICK_TOPIC_FOR_EXPLAIN}</dd>
</dl>
<!-- ENDIF -->
+ <!-- IF S_SOFTDELETE_ALLOWED or S_DELETE_ALLOWED -->
+ <hr class="dashed" />
+ <dl>
+ <dt><label for="delete">{L_DELETE_POST}{L_COLON}</label></dt>
+ <dd><label for="delete"><input type="checkbox" name="delete" id="delete" {S_SOFTDELETE_CHECKED} /> {L_DELETE_POST_WARN}</label></dd>
+ <!-- IF S_DELETE_ALLOWED and S_SOFTDELETE_ALLOWED -->
+ <dd><label for="delete_permanent"><input type="checkbox" name="delete_permanent" id="delete_permanent" /> {L_DELETE_POST_PERMANENTLY}</label></dd>
+ <!-- ENDIF -->
+ </dl>
+ <!-- ENDIF -->
+
<!-- IF S_EDIT_REASON -->
<dl>
- <dt><label for="edit_reason">{L_EDIT_REASON}:</label></dt>
+ <dt><label for="edit_reason">{L_EDIT_REASON}{L_COLON}</label></dt>
<dd><input type="text" name="edit_reason" id="edit_reason" value="{EDIT_REASON}" class="inputbox" /></dd>
</dl>
<!-- ENDIF -->
</fieldset>
<!-- ENDIF -->
-<!-- ENDIF --> \ No newline at end of file
+<!-- ENDIF -->
diff --git a/phpBB/styles/prosilver/template/posting_layout.html b/phpBB/styles/prosilver/template/posting_layout.html
index b81c8162d7..22da32076c 100644
--- a/phpBB/styles/prosilver/template/posting_layout.html
+++ b/phpBB/styles/prosilver/template/posting_layout.html
@@ -1,14 +1,14 @@
<!-- INCLUDE overall_header.html -->
<!-- IF TOPIC_TITLE -->
- <h2><a href="{U_VIEW_TOPIC}">{TOPIC_TITLE}</a></h2>
+ <h2 class="posting-title"><!-- EVENT posting_topic_title_before --><a href="{U_VIEW_TOPIC}">{TOPIC_TITLE}</a><!-- EVENT posting_topic_title_after --></h2>
<!-- ELSE -->
- <h2><a href="{U_VIEW_FORUM}">{FORUM_NAME}</a></h2>
+ <h2 class="posting-title"><a href="{U_VIEW_FORUM}">{FORUM_NAME}</a></h2>
<!-- ENDIF -->
<!-- IF S_FORUM_RULES -->
- <div class="rules">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="rules<!-- IF U_FORUM_RULES --> rules-link<!-- ENDIF -->">
+ <div class="inner">
<!-- IF U_FORUM_RULES -->
<a href="{U_FORUM_RULES}">{L_FORUM_RULES}</a>
@@ -17,7 +17,7 @@
{FORUM_RULES}
<!-- ENDIF -->
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<!-- ENDIF -->
@@ -25,12 +25,12 @@
<!-- IF S_DRAFT_LOADED -->
<div class="panel">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<h3>{L_INFORMATION}</h3>
<p>{L_DRAFT_LOADED}</p>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<!-- ENDIF -->
@@ -40,12 +40,12 @@
<!-- IF S_UNGLOBALISE -->
<div class="panel bg3">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<fieldset class="fields1">
<h2>{L_SELECT_DESTINATION_FORUM}</h2>
<p>{L_UNGLOBALISE_EXPLAIN}</p>
<dl>
- <dt><label for="to_forum_id">{L_MOVE}:</label></dt>
+ <dt><label for="to_forum_id">{L_MOVE}{L_COLON}</label></dt>
<dd><select id="to_forum_id" name="to_forum_id">{S_FORUM_SELECT}</select></dd>
</dl>
@@ -55,36 +55,32 @@
</dl>
</fieldset>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<!-- ENDIF -->
<!-- IF S_DISPLAY_PREVIEW --><!-- INCLUDE posting_preview.html --><!-- ENDIF -->
<div class="panel" id="postingbox">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<h3>{L_POST_A}</h3>
<!-- DEFINE $EXTRA_POSTING_OPTIONS = 1 -->
<!-- INCLUDE posting_editor.html -->
+ <input type="hidden" name="show_panel" value="options-panel" />
{S_FORM_TOKEN}
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<!-- IF S_SHOW_ATTACH_BOX --><!-- INCLUDE posting_attach_body.html --><!-- ENDIF -->
<!-- IF S_SHOW_POLL_BOX or S_POLL_DELETE --><!-- INCLUDE posting_poll_body.html --><!-- ENDIF -->
+<!-- EVENT posting_layout_include_panel_body -->
+
<!-- IF S_DISPLAY_REVIEW --><!-- INCLUDE posting_topic_review.html --><!-- ENDIF -->
</form>
-<!-- IF not S_PRIVMSGS -->
-<script type="text/javascript">
-// <![CDATA[
- subPanels(show_panel);
-// ]]>
-</script>
-<!-- ENDIF -->
<!-- INCLUDE overall_footer.html -->
diff --git a/phpBB/styles/prosilver/template/posting_pm_header.html b/phpBB/styles/prosilver/template/posting_pm_header.html
new file mode 100644
index 0000000000..032d8c6a6f
--- /dev/null
+++ b/phpBB/styles/prosilver/template/posting_pm_header.html
@@ -0,0 +1,83 @@
+<fieldset class="fields1">
+ <!-- IF not S_SHOW_DRAFTS -->
+
+ <!-- IF S_GROUP_OPTIONS -->
+ <div class="column2">
+ <label for="group_list"><strong>{L_TO_ADD_GROUPS}{L_COLON}</strong></label><br />
+ <select name="group_list[]" id="group_list" multiple="multiple" size="3" class="inputbox">{S_GROUP_OPTIONS}</select><br />
+ </div>
+ <!-- ENDIF -->
+ <!-- IF S_ALLOW_MASS_PM -->
+ <div class="column1">
+ <!-- IF not S_EDIT_POST -->
+ <dl class="pmlist">
+ <dt><label><strong>{L_TO_ADD_MASS}{L_COLON}</strong><textarea id="username_list" name="username_list" class="inputbox" cols="50" rows="2" tabindex="1"></textarea></label></dt>
+ <dd class="recipients">
+ <input type="submit" name="add_to" value="{L_ADD}" class="button2" tabindex="1" />
+ <input type="submit" name="add_bcc" value="{L_ADD_BCC}" class="button2" tabindex="1" />
+ <!-- EVENT posting_pm_header_find_username_before -->
+ <span><a href="{U_FIND_USERNAME}" onclick="find_username(this.href); return false;">{L_FIND_USERNAME}</a></span>
+ <!-- EVENT posting_pm_header_find_username_after -->
+ </dd>
+ </dl>
+ <!-- ENDIF -->
+ </div>
+ <!-- IF .to_recipient or .bcc_recipient --><hr /><!-- ENDIF -->
+ <div class="column1">
+ <!-- IF .to_recipient -->
+ <dl>
+ <dt><label>{L_TO_MASS}{L_COLON}</label></dt>
+ <dd class="recipients">
+ <ul class="recipients">
+ <!-- BEGIN to_recipient -->
+ <li>
+ <!-- IF not S_EDIT_POST --><input type="submit" name="remove_{to_recipient.TYPE}[{to_recipient.UG_ID}]" value="x" class="button2" /><!-- ENDIF -->
+ <!-- IF to_recipient.IS_GROUP --><a href="{to_recipient.U_VIEW}"><strong>{to_recipient.NAME}</strong></a><!-- ELSE -->{to_recipient.NAME_FULL}<!-- ENDIF -->
+ </li>
+ <!-- END to_recipient -->
+ </ul>
+ </dd>
+ </dl>
+ <!-- ENDIF -->
+ </div>
+ <!-- IF .bcc_recipient -->
+ <div class="column2">
+ <dl>
+ <dt><label>{L_BCC}{L_COLON}</label></dt>
+ <dd class="recipients">
+ <ul class="recipients">
+ <!-- BEGIN bcc_recipient -->
+ <li>
+ <!-- IF not S_EDIT_POST --><input type="submit" name="remove_{bcc_recipient.TYPE}[{bcc_recipient.UG_ID}]" value="x" class="button2" /><!-- ENDIF -->
+ <!-- IF bcc_recipient.IS_GROUP --><a href="{bcc_recipient.U_VIEW}"><strong>{bcc_recipient.NAME}</strong></a><!-- ELSE -->{bcc_recipient.NAME_FULL}<!-- ENDIF -->
+ </li>
+ <!-- END bcc_recipient -->
+ </ul>
+ </dd>
+ </dl>
+ </div>
+ <!-- ENDIF -->
+ <!-- ELSE -->
+ <div class="column1">
+ <dl>
+ <dt><label for="username_list">{L_TO_ADD}{L_COLON}</label><!-- IF not S_EDIT_POST --><br /><span><a href="{U_FIND_USERNAME}" onclick="find_username(this.href); return false">{L_FIND_USERNAME}</a></span><!-- ENDIF --></dt>
+ <!-- IF not S_EDIT_POST -->
+ <dd><input class="inputbox" type="text" name="username_list" id="username_list" size="20" value="" /> <input type="submit" name="add_to" value="{L_ADD}" class="button2" /></dd>
+ <!-- ENDIF -->
+ <!-- IF .to_recipient -->
+ <dd class="recipients">
+ <ul class="recipients">
+ <!-- BEGIN to_recipient -->
+ <li>
+ <!-- IF to_recipient.IS_GROUP --><a href="{to_recipient.U_VIEW}"><strong>{to_recipient.NAME}</strong></a><!-- ELSE -->{to_recipient.NAME_FULL}<!-- ENDIF -->&nbsp;
+ <!-- IF not S_EDIT_POST --><input type="submit" name="remove_{to_recipient.TYPE}[{to_recipient.UG_ID}]" value="x" class="button2" /><!-- ENDIF -->
+ </li>
+ <!-- END to_recipient -->
+ </dd>
+ <!-- ENDIF -->
+ </dl>
+ </div>
+ <!-- ENDIF -->
+
+ <!-- ENDIF -->
+ </fieldset>
diff --git a/phpBB/styles/prosilver/template/posting_pm_layout.html b/phpBB/styles/prosilver/template/posting_pm_layout.html
index 48812da102..7f4a0ea8d7 100644
--- a/phpBB/styles/prosilver/template/posting_pm_layout.html
+++ b/phpBB/styles/prosilver/template/posting_pm_layout.html
@@ -2,12 +2,12 @@
<!-- IF S_DRAFT_LOADED -->
<div class="panel">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<h3>{L_INFORMATION}</h3>
<p>{L_DRAFT_LOADED_PM}</p>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<!-- ENDIF -->
@@ -15,15 +15,23 @@
<!-- IF S_DISPLAY_PREVIEW --><!-- INCLUDE posting_preview.html --><!-- ENDIF -->
-<h2>{L_TITLE}</h2>
+<h2 class="posting-title">{L_TITLE}</h2>
+
+<div class="panel" id="pmheader-postingbox">
+ <div class="inner">
+ <!-- EVENT posting_pm_layout_include_pm_header_before -->
+ <!-- INCLUDE posting_pm_header.html -->
+ <!-- EVENT posting_pm_layout_include_pm_header_after -->
+ </div>
+</div>
<div class="panel" id="postingbox">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<!-- DEFINE $EXTRA_POSTING_OPTIONS = 1 -->
<!-- INCLUDE posting_editor.html -->
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<!-- IF S_SHOW_ATTACH_BOX --><!-- INCLUDE posting_attach_body.html --><!-- ENDIF -->
@@ -32,4 +40,4 @@
<!-- IF S_DISPLAY_HISTORY --><!-- INCLUDE ucp_pm_history.html --><!-- ENDIF -->
-<!-- INCLUDE ucp_footer.html --> \ No newline at end of file
+<!-- INCLUDE ucp_footer.html -->
diff --git a/phpBB/styles/prosilver/template/posting_poll_body.html b/phpBB/styles/prosilver/template/posting_poll_body.html
index ba0014ce57..ee7100aded 100644
--- a/phpBB/styles/prosilver/template/posting_poll_body.html
+++ b/phpBB/styles/prosilver/template/posting_poll_body.html
@@ -1,56 +1,53 @@
<div class="panel bg3" id="poll-panel">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<!-- IF S_SHOW_POLL_BOX -->
<p>{L_ADD_POLL_EXPLAIN}</p>
<!-- ENDIF -->
<fieldset class="fields2">
+ <!-- IF S_POLL_DELETE -->
+ <dl>
+ <dt><label for="poll_delete">{L_POLL_DELETE}{L_COLON}</label></dt>
+ <dd><label for="poll_delete"><input type="checkbox" name="poll_delete" id="poll_delete"<!-- IF S_POLL_DELETE_CHECKED --> checked="checked"<!-- ENDIF --> /> </label></dd>
+ </dl>
+ <!-- ENDIF -->
+
<!-- IF S_SHOW_POLL_BOX -->
- <!-- IF S_POLL_DELETE -->
- <dl>
- <dt><label for="poll_delete">{L_POLL_DELETE}:</label></dt>
- <dd><label for="poll_delete"><input type="checkbox" name="poll_delete" id="poll_delete"<!-- IF S_POLL_DELETE_CHECKED --> checked="checked"<!-- ENDIF --> /> </label></dd>
- </dl>
- <!-- ENDIF -->
<dl>
- <dt><label for="poll_title">{L_POLL_QUESTION}:</label></dt>
+ <dt><label for="poll_title">{L_POLL_QUESTION}{L_COLON}</label></dt>
<dd><input type="text" name="poll_title" id="poll_title" maxlength="255" value="{POLL_TITLE}" class="inputbox" /></dd>
</dl>
<dl>
- <dt><label for="poll_option_text">{L_POLL_OPTIONS}:</label><br /><span>{L_POLL_OPTIONS_EXPLAIN}</span></dt>
+ <dt><label for="poll_option_text">{L_POLL_OPTIONS}{L_COLON}</label><br /><span>{L_POLL_OPTIONS_EXPLAIN}</span></dt>
<dd><textarea name="poll_option_text" id="poll_option_text" rows="5" cols="35" class="inputbox">{POLL_OPTIONS}</textarea></dd>
</dl>
<hr class="dashed" />
<dl>
- <dt><label for="poll_max_options">{L_POLL_MAX_OPTIONS}:</label></dt>
- <dd><input type="text" name="poll_max_options" id="poll_max_options" size="3" maxlength="3" value="{POLL_MAX_OPTIONS}" class="inputbox autowidth" /></dd>
+ <dt><label for="poll_max_options">{L_POLL_MAX_OPTIONS}{L_COLON}</label></dt>
+ <dd><input type="number" min="0" max="999" name="poll_max_options" id="poll_max_options" value="{POLL_MAX_OPTIONS}" class="inputbox autowidth" /></dd>
<dd>{L_POLL_MAX_OPTIONS_EXPLAIN}</dd>
</dl>
<dl>
- <dt><label for="poll_length">{L_POLL_FOR}:</label></dt>
- <dd><label for="poll_length"><input type="text" name="poll_length" id="poll_length" size="3" maxlength="3" value="{POLL_LENGTH}" class="inputbox autowidth" /> {L_DAYS}</label></dd>
+ <dt><label for="poll_length">{L_POLL_FOR}{L_COLON}</label></dt>
+ <dd><label for="poll_length"><input type="number" min="0" max="999" name="poll_length" id="poll_length" value="{POLL_LENGTH}" class="inputbox autowidth" /> {L_DAYS}</label></dd>
<dd>{L_POLL_FOR_EXPLAIN}</dd>
</dl>
<!-- IF S_POLL_VOTE_CHANGE -->
<hr class="dashed" />
-
+
<dl>
- <dt><label for="poll_vote_change">{L_POLL_VOTE_CHANGE}:</label></dt>
+ <dt><label for="poll_vote_change">{L_POLL_VOTE_CHANGE}{L_COLON}</label></dt>
<dd><label for="poll_vote_change"><input type="checkbox" id="poll_vote_change" name="poll_vote_change"{VOTE_CHANGE_CHECKED} /> {L_POLL_VOTE_CHANGE_EXPLAIN}</label></dd>
</dl>
<!-- ENDIF -->
-
- <!-- ELSEIF S_POLL_DELETE -->
- <dl class="fields1">
- <dt><label for="poll_delete">{L_POLL_DELETE}:</label></dt>
- <dd><label for="poll_delete"><input type="checkbox" name="poll_delete" id="poll_delete"<!-- IF S_POLL_DELETE_CHECKED --> checked="checked"<!-- ENDIF --> /> </label></dd>
- </dl>
<!-- ENDIF -->
+
+ <!-- EVENT posting_poll_body_options_after -->
</fieldset>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
diff --git a/phpBB/styles/prosilver/template/posting_preview.html b/phpBB/styles/prosilver/template/posting_preview.html
index 82227c23b0..aac117c090 100644
--- a/phpBB/styles/prosilver/template/posting_preview.html
+++ b/phpBB/styles/prosilver/template/posting_preview.html
@@ -1,9 +1,9 @@
<div class="post <!-- IF S_PRIVMSGS -->pm<!-- ELSE -->bg2<!-- ENDIF -->" id="preview">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<!-- IF S_HAS_POLL_OPTIONS -->
<div class="content">
- <h2>{L_PREVIEW}: {POLL_QUESTION}</h2>
+ <h2>{L_PREVIEW}{L_COLON} {POLL_QUESTION}</h2>
<p class="author"><!-- IF L_POLL_LENGTH -->{L_POLL_LENGTH}<br /><!-- ENDIF -->{L_MAX_VOTES}</p>
<fieldset class="polls">
@@ -16,16 +16,18 @@
</fieldset>
</div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<div class="post bg2">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<!-- ENDIF -->
+<!-- EVENT posting_preview_poll_after -->
+
<div class="postbody">
- <h3>{L_PREVIEW}: {PREVIEW_SUBJECT}</h3>
+ <h3>{L_PREVIEW}{L_COLON} {PREVIEW_SUBJECT}</h3>
<div class="content">{PREVIEW_MESSAGE}</div>
@@ -41,7 +43,7 @@
<!-- IF PREVIEW_SIGNATURE --><div class="signature">{PREVIEW_SIGNATURE}</div><!-- ENDIF -->
</div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<hr />
diff --git a/phpBB/styles/prosilver/template/posting_review.html b/phpBB/styles/prosilver/template/posting_review.html
index 78b994c989..25b719420b 100644
--- a/phpBB/styles/prosilver/template/posting_review.html
+++ b/phpBB/styles/prosilver/template/posting_review.html
@@ -5,11 +5,11 @@
<!-- BEGIN post_review_row -->
<!-- IF post_review_row.S_IGNORE_POST -->
<div class="post bg3 post-ignore">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
{post_review_row.L_IGNORE_POST}
<!-- ELSE -->
-<div class="post <!-- IF post_review_row.S_ROW_COUNT is odd -->bg1<!-- ELSE -->bg2<!-- ENDIF --><!-- IF post_review_row.ONLINE_STATUS --> online<!-- ENDIF -->">
- <div class="inner"><span class="corners-top"><span></span></span>
+<div class="post <!-- IF post_review_row.S_ROW_COUNT is odd -->bg1<!-- ELSE -->bg2<!-- ENDIF -->">
+ <div class="inner">
<!-- ENDIF -->
<div class="postbody" id="ppr{post_review_row.POST_ID}">
@@ -28,8 +28,8 @@
</div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<!-- END post_review_row -->
-<hr /> \ No newline at end of file
+<hr />
diff --git a/phpBB/styles/prosilver/template/posting_smilies.html b/phpBB/styles/prosilver/template/posting_smilies.html
index d45b185ed3..3bd51275ec 100644
--- a/phpBB/styles/prosilver/template/posting_smilies.html
+++ b/phpBB/styles/prosilver/template/posting_smilies.html
@@ -6,18 +6,22 @@
var text_name = opener.text_name;
// ]]>
</script>
-<script type="text/javascript" src="{T_SUPER_TEMPLATE_PATH}/editor.js"></script>
+<!-- INCLUDEJS {T_ASSETS_PATH}/javascript/editor.js -->
<h2>{L_SMILIES}</h2>
<div class="panel">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<!-- BEGIN smiley -->
<a href="#" onclick="initInsertions(); insert_text('{smiley.A_SMILEY_CODE}', true, true); return false;"><img src="{smiley.SMILEY_IMG}" width="{smiley.SMILEY_WIDTH}" height="{smiley.SMILEY_HEIGHT}" alt="{smiley.SMILEY_CODE}" title="{smiley.SMILEY_DESC}" /></a>
- <!-- END smiley -->
+ <!-- END smiley -->
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
-<div>{PAGINATION}</div>
-<a href="#" onclick="window.close(); return false;">{L_CLOSE_WINDOW}</a>
+<!-- IF .pagination -->
+ <div class="pagination">
+ <!-- INCLUDE pagination.html -->
+ </div>
+<!-- ENDIF -->
+<a href="#" onclick="window.close(); return false;">{L_CLOSE_WINDOW}</a>
-<!-- INCLUDE simple_footer.html --> \ No newline at end of file
+<!-- INCLUDE simple_footer.html -->
diff --git a/phpBB/styles/prosilver/template/posting_topic_review.html b/phpBB/styles/prosilver/template/posting_topic_review.html
index a05f057e21..4d5ab16afe 100644
--- a/phpBB/styles/prosilver/template/posting_topic_review.html
+++ b/phpBB/styles/prosilver/template/posting_topic_review.html
@@ -1,7 +1,7 @@
<h3 id="review">
<span class="right-box"><a href="#review" onclick="viewableArea(getElementById('topicreview'), true); var rev_text = getElementById('review').getElementsByTagName('a').item(0).firstChild; if (rev_text.data == '{LA_EXPAND_VIEW}'){rev_text.data = '{LA_COLLAPSE_VIEW}'; } else if (rev_text.data == '{LA_COLLAPSE_VIEW}'){rev_text.data = '{LA_EXPAND_VIEW}'};">{L_EXPAND_VIEW}</a></span>
- {L_TOPIC_REVIEW}: {TOPIC_TITLE}
+ {L_TOPIC_REVIEW}{L_COLON} {TOPIC_TITLE}
</h3>
<div id="topicreview">
@@ -14,22 +14,43 @@
<!-- IF topic_review_row.S_IGNORE_POST -->
<div class="post bg3 post-ignore">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
{topic_review_row.L_IGNORE_POST}
+ <!-- ELSE IF topic_review_row.S_POST_DELETED -->
+ <div class="post bg3 post-ignore">
+ <div class="inner">
+ {topic_review_row.L_DELETE_POST}
<!-- ELSE -->
- <div class="post <!-- IF topic_review_row.S_ROW_COUNT is odd -->bg1<!-- ELSE -->bg2<!-- ENDIF -->">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="post <!-- IF topic_review_row.S_ROW_COUNT is odd -->bg1<!-- ELSE -->bg2<!-- ENDIF --><!-- IF topic_review_row.POST_ID == REPORTED_POST_ID --> reported<!-- ENDIF -->">
+ <div class="inner">
<!-- ENDIF -->
<div class="postbody" id="pr{topic_review_row.POST_ID}">
+ <h3><a href="#pr{topic_review_row.POST_ID}">{topic_review_row.POST_SUBJECT}</a></h3>
+
+ <!-- IF (topic_review_row.POSTER_QUOTE and topic_review_row.DECODED_MESSAGE) or topic_review_row.U_MCP_DETAILS -->
+ <ul class="post-buttons">
+ <!-- IF topic_review_row.U_MCP_DETAILS -->
+ <li>
+ <a href="{topic_review_row.U_MCP_DETAILS}" title="{L_POST_DETAILS}" class="button icon-button info-icon">
+ <span>{L_POST_DETAILS}</span>
+ </a>
+ <li>
+ <!-- ENDIF -->
<!-- IF topic_review_row.POSTER_QUOTE and topic_review_row.DECODED_MESSAGE -->
- <ul class="profile-icons">
- <li class="quote-icon"><a href="#postingbox" onclick="addquote({topic_review_row.POST_ID}, '{topic_review_row.POSTER_QUOTE}', '{LA_WROTE}');" title="{L_QUOTE} {topic_review_row.POST_AUTHOR}"><span>{L_QUOTE} {topic_review_row.POST_AUTHOR}</span></a></li>
+ <li>
+ <a href="#postingbox" onclick="addquote({topic_review_row.POST_ID}, '{topic_review_row.POSTER_QUOTE}', '{LA_WROTE}');" title="{L_QUOTE} {topic_review_row.POST_AUTHOR}" class="button icon-button quote-icon">
+ <span>{L_QUOTE} {topic_review_row.POST_AUTHOR}</span>
+ </a>
+ </li>
+ <!-- ENDIF -->
</ul>
<!-- ENDIF -->
- <!-- IF topic_review_row.U_MCP_DETAILS --><div class="right-box"><a href="{topic_review_row.U_MCP_DETAILS}">{L_POST_DETAILS}</a></div><!-- ENDIF -->
- <h3><a href="#pr{topic_review_row.POST_ID}">{topic_review_row.POST_SUBJECT}</a></h3>
+
+ <!-- EVENT posting_topic_review_row_post_details_before -->
<p class="author"><!-- IF S_IS_BOT -->{topic_review_row.MINI_POST_IMG}<!-- ELSE --><a href="{topic_review_row.U_MINI_POST}">{topic_review_row.MINI_POST_IMG}</a><!-- ENDIF --> {L_POST_BY_AUTHOR} <strong>{topic_review_row.POST_AUTHOR_FULL}</strong> &raquo; {topic_review_row.POST_DATE} </p>
+ <!-- EVENT posting_topic_review_row_post_details_after -->
+
<div class="content">{topic_review_row.MESSAGE}</div>
<!-- IF topic_review_row.S_HAS_ATTACHMENTS -->
@@ -45,7 +66,7 @@
<div id="message_{topic_review_row.POST_ID}" style="display: none;">{topic_review_row.DECODED_MESSAGE}</div>
<!-- ENDIF -->
</div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<!-- END topic_review_row -->
</div>
@@ -56,4 +77,4 @@
<p><a href="#report" class="top2">{L_BACK_TO_TOP}</a></p>
<!-- ELSE -->
<p><a href="#postingbox" class="top2">{L_BACK_TO_TOP}</a></p>
-<!-- ENDIF --> \ No newline at end of file
+<!-- ENDIF -->
diff --git a/phpBB/styles/prosilver/template/profilefields/bool.html b/phpBB/styles/prosilver/template/profilefields/bool.html
new file mode 100644
index 0000000000..f1d7ba75f4
--- /dev/null
+++ b/phpBB/styles/prosilver/template/profilefields/bool.html
@@ -0,0 +1,7 @@
+<!-- BEGIN bool -->
+<!-- IF bool.FIELD_LENGTH eq 1 -->
+ <!-- BEGIN options --><label for="{bool.FIELD_IDENT}_{bool.options.OPTION_ID}"><input type="radio" class="radio" name="{bool.FIELD_IDENT}" id="{bool.FIELD_IDENT}_{bool.options.OPTION_ID}" value="{bool.options.OPTION_ID}"{bool.options.CHECKED} /> {bool.options.VALUE}</label> <!-- END options -->
+<!-- ELSE -->
+ <input type="checkbox" class="radio" name="{bool.FIELD_IDENT}" id="{bool.FIELD_IDENT}"<!-- IF bool.FIELD_VALUE --> checked="checked"<!-- ENDIF --> />
+<!-- ENDIF -->
+<!-- END bool -->
diff --git a/phpBB/styles/prosilver/template/profilefields/date.html b/phpBB/styles/prosilver/template/profilefields/date.html
new file mode 100644
index 0000000000..5d5bc04ed6
--- /dev/null
+++ b/phpBB/styles/prosilver/template/profilefields/date.html
@@ -0,0 +1,5 @@
+<!-- BEGIN date -->
+<label for="{date.FIELD_IDENT}_day">{L_DAY}{L_COLON} <select name="{date.FIELD_IDENT}_day" id="{date.FIELD_IDENT}_day">{date.S_DAY_OPTIONS}</select></label>
+<label for="{date.FIELD_IDENT}_month">{L_MONTH}{L_COLON} <select name="{date.FIELD_IDENT}_month" id="{date.FIELD_IDENT}_month">{date.S_MONTH_OPTIONS}</select></label>
+<label for="{date.FIELD_IDENT}_year">{L_YEAR}{L_COLON} <select name="{date.FIELD_IDENT}_year" id="{date.FIELD_IDENT}_year">{date.S_YEAR_OPTIONS}</select></label>
+<!-- END date -->
diff --git a/phpBB/styles/prosilver/template/profilefields/dropdown.html b/phpBB/styles/prosilver/template/profilefields/dropdown.html
new file mode 100644
index 0000000000..243b7039da
--- /dev/null
+++ b/phpBB/styles/prosilver/template/profilefields/dropdown.html
@@ -0,0 +1,5 @@
+<!-- BEGIN dropdown -->
+<select name="{dropdown.FIELD_IDENT}" id="{dropdown.FIELD_IDENT}">
+ <!-- BEGIN options --><option value="{dropdown.options.OPTION_ID}"{dropdown.options.SELECTED}>{dropdown.options.VALUE}</option><!-- END options -->
+</select>
+<!-- END dropdown -->
diff --git a/phpBB/styles/prosilver/template/profilefields/int.html b/phpBB/styles/prosilver/template/profilefields/int.html
new file mode 100644
index 0000000000..a6f9a0a49e
--- /dev/null
+++ b/phpBB/styles/prosilver/template/profilefields/int.html
@@ -0,0 +1,3 @@
+<!-- BEGIN int -->
+<input type="number" min="{int.FIELD_MINLEN}" max="{int.FIELD_MAXLEN}" class="inputbox autowidth" name="{int.FIELD_IDENT}" id="{int.FIELD_IDENT}" size="{int.FIELD_LENGTH}" value="{int.FIELD_VALUE}" />
+<!-- END int -->
diff --git a/phpBB/styles/prosilver/template/profilefields/string.html b/phpBB/styles/prosilver/template/profilefields/string.html
new file mode 100644
index 0000000000..cf457d39ad
--- /dev/null
+++ b/phpBB/styles/prosilver/template/profilefields/string.html
@@ -0,0 +1,3 @@
+<!-- BEGIN string -->
+<input type="text" class="inputbox autowidth" name="{string.FIELD_IDENT}" id="{string.FIELD_IDENT}" size="{string.FIELD_LENGTH}" maxlength="{string.FIELD_MAXLEN}" value="{string.FIELD_VALUE}" />
+<!-- END string -->
diff --git a/phpBB/styles/prosilver/template/profilefields/text.html b/phpBB/styles/prosilver/template/profilefields/text.html
new file mode 100644
index 0000000000..f54c63925c
--- /dev/null
+++ b/phpBB/styles/prosilver/template/profilefields/text.html
@@ -0,0 +1,3 @@
+<!-- BEGIN text -->
+<textarea name="{text.FIELD_IDENT}" id="{text.FIELD_IDENT}" rows="{text.FIELD_ROWS}" cols="{text.FIELD_COLS}" class="inputbox">{text.FIELD_VALUE}</textarea>
+<!-- END text -->
diff --git a/phpBB/styles/prosilver/template/profilefields/url.html b/phpBB/styles/prosilver/template/profilefields/url.html
new file mode 100644
index 0000000000..8dd3a90de1
--- /dev/null
+++ b/phpBB/styles/prosilver/template/profilefields/url.html
@@ -0,0 +1,3 @@
+<!-- BEGIN url -->
+<input type="url" class="inputbox autowidth" name="{url.FIELD_IDENT}" id="{url.FIELD_IDENT}" size="{url.FIELD_LENGTH}" maxlength="{url.FIELD_MAXLEN}" value="{url.FIELD_VALUE}" />
+<!-- END url -->
diff --git a/phpBB/styles/prosilver/template/quickreply_editor.html b/phpBB/styles/prosilver/template/quickreply_editor.html
index ea07c2e6d8..ca8ccc0a6b 100644
--- a/phpBB/styles/prosilver/template/quickreply_editor.html
+++ b/phpBB/styles/prosilver/template/quickreply_editor.html
@@ -1,79 +1,27 @@
-<script type="text/javascript">
-// <![CDATA[
- function hide_qr(show)
- {
- dE('qr_editor_div');
- dE('qr_showeditor_div');
- if (show && document.getElementById('qr_editor_div').style.display != 'none')
- {
- document.getElementsByName('message')[0].focus();
- }
- return true;
- }
-
-
- function init_qr()
- {
- dE('qr_showeditor_div');
- return true;
- }
- onload_functions.push('init_qr();');
- // ]]>
-</script>
-<noscript>
- <form method="post" action="{U_QR_ACTION}">
- <div class="panel" id="qr_ns_editor_div">
- <div class="inner"><span class="corners-top"><span></span></span>
- <h2>{L_QUICKREPLY}</h2>
- <fieldset class="fields1">
- <dl style="clear: left;">
- <dt><label for="subject">{L_SUBJECT}:</label></dt>
- <dd><input type="text" name="subject" id="subject-ns" size="45" maxlength="64" tabindex="2" value="{SUBJECT}" class="inputbox autowidth" /></dd>
- </dl>
- <div id="message-box-ns">
- <textarea style="height: 9em;" name="message" rows="7" cols="76" tabindex="3" class="inputbox"></textarea>
- </div>
- </fieldset>
- <fieldset class="submit-buttons">
- {S_FORM_TOKEN}
- {QR_HIDDEN_FIELDS}
- <input type="submit" accesskey="s" tabindex="6" name="post" value="{L_SUBMIT}" class="button1" />&nbsp;
- <input type="submit" accesskey="f" tabindex="7" name="full_editor" value="{L_FULL_EDITOR}" class="button2" />&nbsp;
- </fieldset>
- <span class="corners-bottom"><span></span></span></div>
- </div>
- </form>
-</noscript>
-<form method="post" action="{U_QR_ACTION}">
- <div class="panel" style="display: none" id="qr_editor_div">
- <div class="inner"><span class="corners-top"><span></span></span>
- <h2>{L_QUICKREPLY}</h2>
+<form method="post" action="{U_QR_ACTION}" id="qr_postform">
+<!-- EVENT quickreply_editor_panel_before -->
+ <div class="panel">
+ <div class="inner">
+ <h2 class="quickreply-title">{L_QUICKREPLY}</h2>
<fieldset class="fields1">
+ <!-- EVENT quickreply_editor_subject_before -->
<dl style="clear: left;">
- <dt><label for="subject">{L_SUBJECT}:</label></dt>
- <dd><input type="text" name="subject" id="subject" size="45" maxlength="64" tabindex="2" value="{SUBJECT}" class="inputbox autowidth" /></dd>
+ <dt><label for="subject">{L_SUBJECT}{L_COLON}</label></dt>
+ <dd><input type="text" name="subject" id="subject" size="45" maxlength="124" tabindex="2" value="{SUBJECT}" class="inputbox autowidth" /></dd>
</dl>
+ <!-- EVENT quickreply_editor_message_before -->
<div id="message-box">
<textarea style="height: 9em;" name="message" rows="7" cols="76" tabindex="3" class="inputbox"></textarea>
</div>
+ <!-- EVENT quickreply_editor_message_after -->
</fieldset>
<fieldset class="submit-buttons">
{S_FORM_TOKEN}
{QR_HIDDEN_FIELDS}
- <input type="submit" accesskey="s" tabindex="6" name="post" value="{L_SUBMIT}" class="button1" />&nbsp;
- <input type="submit" accesskey="f" tabindex="7" name="full_editor" value="{L_FULL_EDITOR}" class="button2" />&nbsp;
+ <input type="submit" accesskey="f" tabindex="6" name="preview" value="{L_FULL_EDITOR}" class="button2" id="qr_full_editor" />&nbsp;
+ <input type="submit" accesskey="s" tabindex="7" name="post" value="{L_SUBMIT}" class="button1" />&nbsp;
</fieldset>
- <a href="" class="right-box up" onclick="hide_qr(false); return false;" title="{L_COLLAPSE_QR}">{L_COLLAPSE_QR}</a>
- <span class="corners-bottom"><span></span></span></div>
- </div>
- <div class="panel" style="display: none" id="qr_showeditor_div" >
- <div class="inner"><span class="corners-top"><span></span></span>
-
- <div class="content">
- <fieldset class="submit-buttons">
- <input type="submit" name="show_qr" tabindex="1" class="button2" value="{L_SHOW_QR}" onclick="hide_qr(true);return false;"/>
- </fieldset>
- </div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
+<!-- EVENT quickreply_editor_panel_after -->
</form>
diff --git a/phpBB/styles/prosilver/template/report_body.html b/phpBB/styles/prosilver/template/report_body.html
index 2d6a857afb..2a5e6c9d0e 100644
--- a/phpBB/styles/prosilver/template/report_body.html
+++ b/phpBB/styles/prosilver/template/report_body.html
@@ -4,7 +4,7 @@
<form method="post" action="{S_REPORT_ACTION}" id="report">
<div class="panel">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div class="content">
<p><!-- IF S_REPORT_POST -->{L_REPORT_POST_EXPLAIN}<!-- ELSE -->{L_REPORT_MESSAGE_EXPLAIN}<!-- ENDIF --></p>
@@ -12,12 +12,12 @@
<fieldset>
<!-- IF ERROR --><dl><dd class="error">{ERROR}</dd></dl><!-- ENDIF -->
<dl class="fields2">
- <dt><label for="reason_id">{L_REASON}:</label></dt>
+ <dt><label for="reason_id">{L_REASON}{L_COLON}</label></dt>
<dd><select name="reason_id" id="reason_id" class="full"><!-- BEGIN reason --><option value="{reason.ID}"<!-- IF reason.S_SELECTED --> selected="selected"<!-- ENDIF -->>{reason.DESCRIPTION}</option><!-- END reason --></select></dd>
</dl>
<!-- IF S_CAN_NOTIFY -->
<dl class="fields2">
- <dt><label for="notify1">{L_REPORT_NOTIFY}:</label><br /><span>{L_REPORT_NOTIFY_EXPLAIN}</span></dt>
+ <dt><label for="notify1">{L_REPORT_NOTIFY}{L_COLON}</label><br /><span>{L_REPORT_NOTIFY_EXPLAIN}</span></dt>
<dd>
<label for="notify1"><input type="radio" name="notify" id="notify1" value="1" <!-- IF not S_NOTIFY -->checked="checked"<!-- ENDIF --> /> {L_YES}</label>
<label for="notify0"><input type="radio" name="notify" id="notify0" value="0" <!-- IF S_NOTIFY -->checked="checked"<!-- ENDIF --> /> {L_NO}</label>
@@ -25,7 +25,7 @@
</dl>
<!-- ENDIF -->
<dl class="fields2">
- <dt><label for="report_text">{L_MORE_INFO}:</label><br /><span>{L_CAN_LEAVE_BLANK}</span></dt>
+ <dt><label for="report_text">{L_MORE_INFO}{L_COLON}</label><br /><span>{L_CAN_LEAVE_BLANK}</span></dt>
<dd><textarea name="report_text" id="report_text" rows="10" cols="76" class="inputbox">{REPORT_TEXT}</textarea></dd>
</dl>
<!-- IF CAPTCHA_TEMPLATE -->
@@ -34,11 +34,11 @@
</fieldset>
</div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<div class="panel">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div class="content">
<fieldset class="submit-buttons">
@@ -48,8 +48,8 @@
</fieldset>
</div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
</form>
-<!-- INCLUDE overall_footer.html --> \ No newline at end of file
+<!-- INCLUDE overall_footer.html -->
diff --git a/phpBB/styles/prosilver/template/search_body.html b/phpBB/styles/prosilver/template/search_body.html
index 4b1d30d77d..618e2680ba 100644
--- a/phpBB/styles/prosilver/template/search_body.html
+++ b/phpBB/styles/prosilver/template/search_body.html
@@ -1,107 +1,114 @@
<!-- INCLUDE overall_header.html -->
-<script type="text/javascript">
-// <![CDATA[
- onload_functions.push('document.getElementById("keywords").focus();');
-// ]]>
-</script>
-
<h2 class="solo">{L_SEARCH}</h2>
-<form method="get" action="{S_SEARCH_ACTION}">
+<!-- EVENT search_body_form_before -->
+<form method="get" action="{S_SEARCH_ACTION}" data-focus="keywords">
<div class="panel">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<h3>{L_SEARCH_QUERY}</h3>
+ <!-- EVENT search_body_search_query_before -->
<fieldset>
+ <!-- EVENT search_body_search_query_prepend -->
<dl>
- <dt><label for="keywords">{L_SEARCH_KEYWORDS}:</label><br /><span>{L_SEARCH_KEYWORDS_EXPLAIN}</span></dt>
- <dd><input type="text" class="inputbox" name="keywords" id="keywords" size="40" title="{L_SEARCH_KEYWORDS}" /></dd>
+ <dt><label for="keywords">{L_SEARCH_KEYWORDS}{L_COLON}</label><br /><span>{L_SEARCH_KEYWORDS_EXPLAIN}</span></dt>
+ <dd><input type="search" class="inputbox" name="keywords" id="keywords" size="40" title="{L_SEARCH_KEYWORDS}" /></dd>
<dd><label for="terms1"><input type="radio" name="terms" id="terms1" value="all" checked="checked" /> {L_SEARCH_ALL_TERMS}</label></dd>
<dd><label for="terms2"><input type="radio" name="terms" id="terms2" value="any" /> {L_SEARCH_ANY_TERMS}</label></dd>
</dl>
<dl>
- <dt><label for="author">{L_SEARCH_AUTHOR}:</label><br /><span>{L_SEARCH_AUTHOR_EXPLAIN}</span></dt>
- <dd><input type="text" class="inputbox" name="author" id="author" size="40" title="{L_SEARCH_AUTHOR}" /></dd>
+ <dt><label for="author">{L_SEARCH_AUTHOR}{L_COLON}</label><br /><span>{L_SEARCH_AUTHOR_EXPLAIN}</span></dt>
+ <dd><input type="search" class="inputbox" name="author" id="author" size="40" title="{L_SEARCH_AUTHOR}" /></dd>
</dl>
+ <!-- EVENT search_body_search_query_append -->
</fieldset>
+ <!-- EVENT search_body_search_query_after -->
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<div class="panel bg2">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<h3>{L_SEARCH_OPTIONS}</h3>
+ <!-- EVENT search_body_search_options_before -->
<fieldset>
+ <!-- EVENT search_body_search_options_prepend -->
<dl>
- <dt><label for="search_forum">{L_SEARCH_FORUMS}:</label><br /><span>{L_SEARCH_FORUMS_EXPLAIN}</span></dt>
+ <dt><label for="search_forum">{L_SEARCH_FORUMS}{L_COLON}</label><br /><span>{L_SEARCH_FORUMS_EXPLAIN}</span></dt>
<dd><select name="fid[]" id="search_forum" multiple="multiple" size="8" title="{L_SEARCH_FORUMS}">{S_FORUM_OPTIONS}</select></dd>
</dl>
<dl>
- <dt><label for="search_child1">{L_SEARCH_SUBFORUMS}:</label></dt>
+ <dt><label for="search_child1">{L_SEARCH_SUBFORUMS}{L_COLON}</label></dt>
<dd>
<label for="search_child1"><input type="radio" name="sc" id="search_child1" value="1" checked="checked" /> {L_YES}</label>
<label for="search_child2"><input type="radio" name="sc" id="search_child2" value="0" /> {L_NO}</label>
</dd>
</dl>
<dl>
- <dt><label for="sf1">{L_SEARCH_WITHIN}:</label></dt>
+ <dt><label for="sf1">{L_SEARCH_WITHIN}{L_COLON}</label></dt>
<dd><label for="sf1"><input type="radio" name="sf" id="sf1" value="all" checked="checked" /> {L_SEARCH_TITLE_MSG}</label></dd>
<dd><label for="sf2"><input type="radio" name="sf" id="sf2" value="msgonly" /> {L_SEARCH_MSG_ONLY}</label></dd>
<dd><label for="sf3"><input type="radio" name="sf" id="sf3" value="titleonly" /> {L_SEARCH_TITLE_ONLY}</label></dd>
<dd><label for="sf4"><input type="radio" name="sf" id="sf4" value="firstpost" /> {L_SEARCH_FIRST_POST}</label></dd>
</dl>
+ <!-- EVENT search_body_search_options_append -->
<hr class="dashed" />
+ <!-- EVENT search_body_search_display_options_prepend -->
<dl>
- <dt><label for="show_results1">{L_DISPLAY_RESULTS}:</label></dt>
+ <dt><label for="show_results1">{L_DISPLAY_RESULTS}{L_COLON}</label></dt>
<dd>
<label for="show_results1"><input type="radio" name="sr" id="show_results1" value="posts" checked="checked" /> {L_POSTS}</label>
<label for="show_results2"><input type="radio" name="sr" id="show_results2" value="topics" /> {L_TOPICS}</label>
</dd>
</dl>
<dl>
- <dt><label for="sd">{L_RESULT_SORT}:</label></dt>
+ <dt><label for="sd">{L_RESULT_SORT}{L_COLON}</label></dt>
<dd>{S_SELECT_SORT_KEY}&nbsp;
<label for="sa"><input type="radio" name="sd" id="sa" value="a" /> {L_SORT_ASCENDING}</label>
<label for="sd"><input type="radio" name="sd" id="sd" value="d" checked="checked" /> {L_SORT_DESCENDING}</label>
</dd>
</dl>
<dl>
- <dt><label>{L_RESULT_DAYS}:</label></dt>
+ <dt><label>{L_RESULT_DAYS}{L_COLON}</label></dt>
<dd>{S_SELECT_SORT_DAYS}</dd>
</dl>
<dl>
- <dt><label>{L_RETURN_FIRST}:</label></dt>
+ <dt><label>{L_RETURN_FIRST}{L_COLON}</label></dt>
<dd><select name="ch" title="{L_RETURN_FIRST}">{S_CHARACTER_OPTIONS}</select> {L_POST_CHARACTERS}</dd>
</dl>
+ <!-- EVENT search_body_search_display_options_append -->
</fieldset>
+ <!-- EVENT search_body_search_options_after -->
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<div class="panel bg3">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<fieldset class="submit-buttons">
{S_HIDDEN_FIELDS}<input type="reset" value="{L_RESET}" name="reset" class="button2" />&nbsp;
<input type="submit" name="submit" value="{L_SEARCH}" class="button1" />
</fieldset>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
</form>
+<!-- EVENT search_body_form_after -->
+<!-- EVENT search_body_recent_search_before -->
<!-- IF .recentsearch -->
<div class="forumbg forumbg-table">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
- <table class="table1" cellspacing="1">
+ <table class="table1">
<thead>
<tr>
<th colspan="2" class="name">{L_RECENT_SEARCHES}</th>
@@ -111,7 +118,7 @@
<!-- BEGIN recentsearch -->
<tr class="<!-- IF recentsearch.S_ROW_COUNT is even -->bg1<!-- ELSE -->bg2<!-- ENDIF -->">
<td><a href="{recentsearch.U_KEYWORDS}">{recentsearch.KEYWORDS}</a></td>
- <td class="active"><span>&nbsp;{recentsearch.TIME}</span></td>
+ <td class="active">{recentsearch.TIME}</td>
</tr>
<!-- BEGINELSE -->
<tr class="bg1">
@@ -121,8 +128,9 @@
</tbody>
</table>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<!-- ENDIF -->
+<!-- EVENT search_body_recent_search_after -->
<!-- INCLUDE overall_footer.html -->
diff --git a/phpBB/styles/prosilver/template/search_results.html b/phpBB/styles/prosilver/template/search_results.html
index 0ea9d8a047..4c83e95a1b 100644
--- a/phpBB/styles/prosilver/template/search_results.html
+++ b/phpBB/styles/prosilver/template/search_results.html
@@ -1,35 +1,47 @@
<!-- INCLUDE overall_header.html -->
-<h2><!-- IF SEARCH_TITLE -->{SEARCH_TITLE}<!-- ELSE -->{SEARCH_MATCHES}<!-- ENDIF --><!-- IF SEARCH_WORDS -->: <a href="{U_SEARCH_WORDS}">{SEARCH_WORDS}</a><!-- ENDIF --></h2>
-<!-- IF SEARCHED_QUERY --> <p>{L_SEARCHED_QUERY}: <strong>{SEARCHED_QUERY}</strong></p><!-- ENDIF -->
-<!-- IF IGNORED_WORDS --> <p>{L_IGNORED_TERMS}: <strong>{IGNORED_WORDS}</strong></p><!-- ENDIF -->
+<!-- EVENT search_results_header_before -->
+
+<h2 class="searchresults-title"><!-- IF SEARCH_TITLE -->{SEARCH_TITLE}<!-- ELSE -->{SEARCH_MATCHES}<!-- ENDIF --><!-- IF SEARCH_WORDS -->{L_COLON} <a href="{U_SEARCH_WORDS}">{SEARCH_WORDS}</a><!-- ENDIF --></h2>
+<!-- IF SEARCHED_QUERY --> <p>{L_SEARCHED_QUERY}{L_COLON} <strong>{SEARCHED_QUERY}</strong></p><!-- ENDIF -->
+<!-- IF IGNORED_WORDS --> <p>{L_IGNORED_TERMS}{L_COLON} <strong>{IGNORED_WORDS}</strong></p><!-- ENDIF -->
+<!-- IF PHRASE_SEARCH_DISABLED --> <p><strong>{L_PHRASE_SEARCH_DISABLED}</strong></p><!-- ENDIF -->
<!-- IF SEARCH_TOPIC -->
- <p><a class="{S_CONTENT_FLOW_BEGIN}" href="{U_SEARCH_TOPIC}">{L_RETURN_TO}: {SEARCH_TOPIC}</a></p>
+ <p class="return-link"><a class="arrow-{S_CONTENT_FLOW_BEGIN}" href="{U_SEARCH_TOPIC}">{L_RETURN_TO_TOPIC}</a></p>
<!-- ELSE -->
- <p><a class="{S_CONTENT_FLOW_BEGIN}" href="{U_SEARCH}" title="{L_SEARCH_ADV}">{L_RETURN_TO_SEARCH_ADV}</a></p>
+ <p class="advanced-search-link"><a class="arrow-{S_CONTENT_FLOW_BEGIN}" href="{U_SEARCH}" title="{L_SEARCH_ADV}">{L_GO_TO_SEARCH_ADV}</a></p>
<!-- ENDIF -->
-<!-- IF PAGINATION or SEARCH_MATCHES or PAGE_NUMBER -->
- <form method="post" action="{S_SEARCH_ACTION}">
+<!-- EVENT search_results_header_after -->
- <div class="topic-actions">
+<!-- IF .pagination or SEARCH_MATCHES or TOTAL_MATCHES or PAGE_NUMBER -->
+ <div class="action-bar top">
- <!-- IF SEARCH_MATCHES -->
- <div class="search-box">
- <!-- IF SEARCH_IN_RESULTS -->
- <label for="add_keywords">{L_SEARCH_IN_RESULTS}: <input type="text" name="add_keywords" id="add_keywords" value="" class="inputbox narrow" /></label>
- <input class="button2" type="submit" name="submit" value="{L_SEARCH}" />
- <!-- ENDIF -->
+ <!-- IF TOTAL_MATCHES > 0 -->
+ <div class="search-box" role="search">
+ <form method="post" action="{S_SEARCH_ACTION}">
+ <fieldset>
+ <input class="inputbox search tiny" type="search" name="add_keywords" id="add_keywords" value="" placeholder="{L_SEARCH_IN_RESULTS}" />
+ <button class="button icon-button search-icon" type="submit" title="{L_SEARCH}">{L_SEARCH}</button>
+ <a href="{U_SEARCH}" class="button icon-button search-adv-icon" title="{L_SEARCH_ADV}">{L_SEARCH_ADV}</a>
+ </fieldset>
+ </form>
</div>
<!-- ENDIF -->
- <div class="rightside pagination">
- {SEARCH_MATCHES}<!-- IF PAGINATION --> &bull; <a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{PAGE_NUMBER}</a> &bull; <span>{PAGINATION}</span><!-- ELSE --> &bull; {PAGE_NUMBER}<!-- ENDIF -->
+ <!-- EVENT search_results_searchbox_after -->
+
+ <div class="pagination">
+ <!-- IF U_MARK_ALL_READ --><a href="{U_MARK_ALL_READ}" class="mark-read" accesskey="m">{L_MARK_ALL_READ}</a> &bull;<!-- ENDIF -->
+ {SEARCH_MATCHES}
+ <!-- IF .pagination -->
+ <!-- INCLUDE pagination.html -->
+ <!-- ELSE -->
+ &bull; {PAGE_NUMBER}
+ <!-- ENDIF -->
</div>
</div>
-
- </form>
<!-- ENDIF -->
<!-- IF S_SHOW_TOPICS -->
@@ -37,11 +49,11 @@
<!-- IF .searchresults -->
<div class="forumbg">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<ul class="topiclist">
<li class="header">
<dl class="icon">
- <dt>{L_TOPICS}</dt>
+ <dt><div class="list-inner">{L_TOPICS}</div></dt>
<dd class="posts">{L_REPLIES}</dd>
<dd class="views">{L_VIEWS}</dd>
<dd class="lastpost"><span>{L_LAST_POST}</span></dd>
@@ -51,95 +63,118 @@
<ul class="topiclist topics">
<!-- BEGIN searchresults -->
+ <!-- EVENT search_results_topic_before -->
<li class="row<!-- IF searchresults.S_ROW_COUNT is even --> bg1<!-- ELSE --> bg2<!-- ENDIF -->">
- <dl class="icon" style="background-image: url({searchresults.TOPIC_FOLDER_IMG_SRC}); background-repeat: no-repeat;">
- <dt <!-- IF searchresults.TOPIC_ICON_IMG -->style="background-image: url({T_ICONS_PATH}{searchresults.TOPIC_ICON_IMG}); background-repeat: no-repeat;"<!-- ENDIF -->>
- <!-- IF searchresults.S_UNREAD_TOPIC --><a href="{searchresults.U_NEWEST_POST}">{NEWEST_POST_IMG}</a> <!-- ENDIF -->
- <a href="{searchresults.U_VIEW_TOPIC}" class="topictitle">{searchresults.TOPIC_TITLE}</a> {searchresults.ATTACH_ICON_IMG}
- <!-- IF searchresults.S_TOPIC_UNAPPROVED or searchresults.S_POSTS_UNAPPROVED --><a href="{searchresults.U_MCP_QUEUE}">{searchresults.UNAPPROVED_IMG}</a> <!-- ENDIF -->
- <!-- IF searchresults.S_TOPIC_REPORTED --><a href="{searchresults.U_MCP_REPORT}">{REPORTED_IMG}</a><!-- ENDIF --><br />
- <!-- IF searchresults.PAGINATION --><strong class="pagination"><span>{searchresults.PAGINATION}</span></strong><!-- ENDIF -->
- {L_POST_BY_AUTHOR} {searchresults.TOPIC_AUTHOR_FULL} &raquo; {searchresults.FIRST_POST_TIME}
- <!-- IF not searchresults.S_TOPIC_GLOBAL -->{L_IN} <a href="{searchresults.U_VIEW_FORUM}">{searchresults.FORUM_TITLE}</a><!-- ELSE --> ({L_GLOBAL})<!-- ENDIF -->
+ <dl class="icon {searchresults.TOPIC_IMG_STYLE}">
+ <dt <!-- IF searchresults.TOPIC_ICON_IMG -->style="background-image: url({T_ICONS_PATH}{searchresults.TOPIC_ICON_IMG}); background-repeat: no-repeat;"<!-- ENDIF --> title="{searchresults.TOPIC_FOLDER_IMG_ALT}">
+ <!-- IF searchresults.S_UNREAD_TOPIC and not S_IS_BOT --><a href="{searchresults.U_NEWEST_POST}" class="icon-link"></a><!-- ENDIF -->
+ <div class="list-inner">
+
+ <!-- EVENT topiclist_row_prepend -->
+ <!-- IF searchresults.S_UNREAD_TOPIC and not S_IS_BOT --><a href="{searchresults.U_NEWEST_POST}">{NEWEST_POST_IMG}</a> <!-- ENDIF -->
+ <a href="{searchresults.U_VIEW_TOPIC}" class="topictitle">{searchresults.TOPIC_TITLE}</a> {searchresults.ATTACH_ICON_IMG}
+ <!-- IF searchresults.S_TOPIC_UNAPPROVED or searchresults.S_POSTS_UNAPPROVED --><a href="{searchresults.U_MCP_QUEUE}">{searchresults.UNAPPROVED_IMG}</a> <!-- ENDIF -->
+ <!-- IF searchresults.S_TOPIC_DELETED --><a href="{searchresults.U_MCP_QUEUE}">{DELETED_IMG}</a> <!-- ENDIF -->
+ <!-- IF searchresults.S_TOPIC_REPORTED --><a href="{searchresults.U_MCP_REPORT}">{REPORTED_IMG}</a><!-- ENDIF --><br />
+ <!-- EVENT topiclist_row_topic_title_after -->
+ <!-- IF .searchresults.pagination -->
+ <div class="pagination">
+ <ul>
+ <!-- BEGIN pagination -->
+ <!-- IF searchresults.pagination.S_IS_PREV -->
+ <!-- ELSEIF searchresults.pagination.S_IS_CURRENT --><li class="active"><span>{searchresults.pagination.PAGE_NUMBER}</span></li>
+ <!-- ELSEIF searchresults.pagination.S_IS_ELLIPSIS --><li class="ellipsis"><span>{L_ELLIPSIS}</span></li>
+ <!-- ELSEIF searchresults.pagination.S_IS_NEXT -->
+ <!-- ELSE --><li><a href="{searchresults.pagination.PAGE_URL}">{searchresults.pagination.PAGE_NUMBER}</a></li>
+ <!-- ENDIF -->
+ <!-- END pagination -->
+ </ul>
+ </div>
+ <!-- ENDIF -->
+ <!-- IF searchresults.S_HAS_POLL -->{POLL_IMG} <!-- ENDIF -->
+ {L_POST_BY_AUTHOR} {searchresults.TOPIC_AUTHOR_FULL} &raquo; {searchresults.FIRST_POST_TIME} &raquo; {L_IN} <a href="{searchresults.U_VIEW_FORUM}">{searchresults.FORUM_TITLE}</a>
+ <!-- EVENT topiclist_row_append -->
+
+ </div>
</dt>
<dd class="posts">{searchresults.TOPIC_REPLIES}</dd>
<dd class="views">{searchresults.TOPIC_VIEWS}</dd>
<dd class="lastpost"><span>
{L_POST_BY_AUTHOR} {searchresults.LAST_POST_AUTHOR_FULL}
- <!-- IF not S_IS_BOT --><a href="{searchresults.U_LAST_POST}">{LAST_POST_IMG}</a> <!-- ENDIF --><br />{searchresults.LAST_POST_TIME}<br /> </span>
+ <!-- IF not S_IS_BOT --><a href="{searchresults.U_LAST_POST}" title="{L_GOTO_LAST_POST}">{LAST_POST_IMG}</a> <!-- ENDIF --><br />{searchresults.LAST_POST_TIME}<br /> </span>
</dd>
</dl>
</li>
+ <!-- EVENT search_results_topic_after -->
<!-- END searchresults -->
</ul>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<!-- ELSE -->
<div class="panel">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<strong>{L_NO_SEARCH_RESULTS}</strong>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<!-- ENDIF -->
<!-- ELSE -->
<!-- BEGIN searchresults -->
+ <!-- EVENT search_results_post_before -->
<div class="search post <!-- IF searchresults.S_ROW_COUNT is odd -->bg1<!-- ELSE -->bg2<!-- ENDIF --><!-- IF searchresults.S_POST_REPORTED --> reported<!-- ENDIF -->">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<!-- IF searchresults.S_IGNORE_POST -->
<div class="postbody">
{searchresults.L_IGNORE_POST}
</div>
<!-- ELSE -->
+ <dl class="postprofile">
+ <!-- EVENT search_results_postprofile_before -->
+ <dt class="author">{L_POST_BY_AUTHOR} {searchresults.POST_AUTHOR_FULL}</dt>
+ <dd class="search-result-date">{searchresults.POST_DATE}</dd>
+ <dd>{L_FORUM}{L_COLON} <a href="{searchresults.U_VIEW_FORUM}">{searchresults.FORUM_TITLE}</a></dd>
+ <dd>{L_TOPIC}{L_COLON} <a href="{searchresults.U_VIEW_TOPIC}">{searchresults.TOPIC_TITLE}</a></dd>
+ <!-- EVENT search_results_topic_title_after -->
+ <dd>{L_REPLIES}{L_COLON} <strong>{searchresults.TOPIC_REPLIES}</strong></dd>
+ <dd>{L_VIEWS}{L_COLON} <strong>{searchresults.TOPIC_VIEWS}</strong></dd>
+ <!-- EVENT search_results_postprofile_after -->
+ </dl>
+
<div class="postbody">
<h3><a href="{searchresults.U_VIEW_POST}">{searchresults.POST_SUBJECT}</a></h3>
<div class="content">{searchresults.MESSAGE}</div>
</div>
-
- <dl class="postprofile">
- <dt class="author">{L_POST_BY_AUTHOR} {searchresults.POST_AUTHOR_FULL}</dt>
- <dd>{searchresults.POST_DATE}</dd>
- <dd>&nbsp;</dd>
- <!-- IF searchresults.FORUM_TITLE -->
- <dd>{L_FORUM}: <a href="{searchresults.U_VIEW_FORUM}">{searchresults.FORUM_TITLE}</a></dd>
- <dd>{L_TOPIC}: <a href="{searchresults.U_VIEW_TOPIC}">{searchresults.TOPIC_TITLE}</a></dd>
- <!-- ELSE -->
- <dd>{L_GLOBAL}: <a href="{searchresults.U_VIEW_TOPIC}">{searchresults.TOPIC_TITLE}</a></dd>
- <!-- ENDIF -->
- <dd>{L_REPLIES}: <strong>{searchresults.TOPIC_REPLIES}</strong></dd>
- <dd>{L_VIEWS}: <strong>{searchresults.TOPIC_VIEWS}</strong></dd>
- </dl>
<!-- ENDIF -->
<!-- IF not searchresults.S_IGNORE_POST -->
<ul class="searchresults">
- <li ><a href="{searchresults.U_VIEW_POST}" class="{S_CONTENT_FLOW_END}">{L_JUMP_TO_POST}</a></li>
+ <li ><a href="{searchresults.U_VIEW_POST}" class="arrow-{S_CONTENT_FLOW_END}">{L_JUMP_TO_POST}</a></li>
</ul>
<!-- ENDIF -->
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
+ <!-- EVENT search_results_post_after -->
<!-- BEGINELSE -->
<div class="panel">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<strong>{L_NO_SEARCH_RESULTS}</strong>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<!-- END searchresults -->
<!-- ENDIF -->
-<!-- IF PAGINATION or .searchresults or S_SELECT_SORT_KEY or S_SELECT_SORT_DAYS -->
+<!-- IF .pagination or .searchresults or S_SELECT_SORT_KEY or S_SELECT_SORT_DAYS -->
<form method="post" action="{S_SEARCH_ACTION}">
<fieldset class="display-options">
- <!-- IF PREVIOUS_PAGE --><a href="{PREVIOUS_PAGE}" class="left-box {S_CONTENT_FLOW_BEGIN}">{L_PREVIOUS}</a><!-- ENDIF -->
- <!-- IF NEXT_PAGE --><a href="{NEXT_PAGE}" class="right-box {S_CONTENT_FLOW_END}">{L_NEXT}</a><!-- ENDIF -->
<!-- IF S_SELECT_SORT_DAYS or S_SELECT_SORT_KEY -->
<label><!-- IF S_SHOW_TOPICS -->{L_DISPLAY_POSTS}<!-- ELSE -->{L_SORT_BY}</label><label><!-- ENDIF --> {S_SELECT_SORT_DAYS}<!-- IF S_SELECT_SORT_KEY --></label> <label>{S_SELECT_SORT_KEY}</label>
- <label>{S_SELECT_SORT_DIR}<!-- ENDIF --> <input type="submit" name="sort" value="{L_GO}" class="button2" /></label>
+ <label>{S_SELECT_SORT_DIR}<!-- ENDIF --></label>
+ <input type="submit" name="sort" value="{L_GO}" class="button2" />
<!-- ENDIF -->
</fieldset>
@@ -148,14 +183,19 @@
<hr />
<!-- ENDIF -->
-<!-- IF PAGINATION or .searchresults or PAGE_NUMBER -->
- <ul class="linklist">
- <li class="rightside pagination">
- {SEARCH_MATCHES}<!-- IF PAGINATION --> &bull; <a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{PAGE_NUMBER}</a> &bull; <span>{PAGINATION}</span><!-- ELSE --> &bull; {PAGE_NUMBER}<!-- ENDIF -->
- </li>
- </ul>
+<!-- IF .pagination or .searchresults or PAGE_NUMBER -->
+<div class="action-bar bottom">
+ <div class="pagination">
+ {SEARCH_MATCHES}
+ <!-- IF .pagination -->
+ <!-- INCLUDE pagination.html -->
+ <!-- ELSE -->
+ &bull; {PAGE_NUMBER}
+ <!-- ENDIF -->
+ </div>
+</div>
<!-- ENDIF -->
<!-- INCLUDE jumpbox.html -->
-<!-- INCLUDE overall_footer.html --> \ No newline at end of file
+<!-- INCLUDE overall_footer.html -->
diff --git a/phpBB/styles/prosilver/template/simple_footer.html b/phpBB/styles/prosilver/template/simple_footer.html
index cc54c42d18..77980a9dea 100644
--- a/phpBB/styles/prosilver/template/simple_footer.html
+++ b/phpBB/styles/prosilver/template/simple_footer.html
@@ -1,10 +1,34 @@
</div>
- <div class="copyright">{CREDIT_LINE}
+ <div class="copyright" role="contentinfo">{CREDIT_LINE}
<!-- IF TRANSLATION_INFO --><br />{TRANSLATION_INFO}<!-- ENDIF -->
<!-- IF DEBUG_OUTPUT --><br />{DEBUG_OUTPUT}<!-- ENDIF -->
</div>
+
+ <div id="darkenwrapper" data-ajax-error-title="{L_AJAX_ERROR_TITLE}" data-ajax-error-text="{L_AJAX_ERROR_TEXT}" data-ajax-error-text-abort="{L_AJAX_ERROR_TEXT_ABORT}" data-ajax-error-text-timeout="{L_AJAX_ERROR_TEXT_TIMEOUT}" data-ajax-error-text-parsererror="{L_AJAX_ERROR_TEXT_PARSERERROR}">
+ <div id="darken">&nbsp;</div>
+ </div>
+ <div id="loading_indicator"></div>
+
+ <div id="phpbb_alert" class="phpbb_alert" data-l-err="{L_ERROR}" data-l-timeout-processing-req="{L_TIMEOUT_PROCESSING_REQ}">
+ <a href="#" class="alert_close"></a>
+ <h3 class="alert_title"></h3><p class="alert_text"></p>
+ </div>
+ <div id="phpbb_confirm" class="phpbb_alert">
+ <a href="#" class="alert_close"></a>
+ <div class="alert_text"></div>
+ </div>
</div>
+<script type="text/javascript" src="{T_JQUERY_LINK}"></script>
+<!-- IF S_ALLOW_CDN --><script type="text/javascript">window.jQuery || document.write('\x3Cscript src="{T_ASSETS_PATH}/javascript/jquery.min.js?assets_version={T_ASSETS_VERSION}">\x3C/script>');</script><!-- ENDIF -->
+<script type="text/javascript" src="{T_ASSETS_PATH}/javascript/core.js?assets_version={T_ASSETS_VERSION}"></script>
+<!-- INCLUDEJS forum_fn.js -->
+<!-- INCLUDEJS ajax.js -->
+
+<!-- EVENT simple_footer_after -->
+
+{$SCRIPTS}
+
</body>
-</html> \ No newline at end of file
+</html>
diff --git a/phpBB/styles/prosilver/template/simple_header.html b/phpBB/styles/prosilver/template/simple_header.html
index 9cc8060762..3924aa29d9 100644
--- a/phpBB/styles/prosilver/template/simple_header.html
+++ b/phpBB/styles/prosilver/template/simple_header.html
@@ -1,71 +1,54 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" dir="{S_CONTENT_DIRECTION}" lang="{S_USER_LANG}" xml:lang="{S_USER_LANG}">
+<!DOCTYPE html>
+<html dir="{S_CONTENT_DIRECTION}" lang="{S_USER_LANG}">
<head>
-
-<meta http-equiv="content-type" content="text/html; charset={S_CONTENT_ENCODING}" />
-<meta http-equiv="content-style-type" content="text/css" />
-<meta http-equiv="content-language" content="{S_USER_LANG}" />
-<meta http-equiv="imagetoolbar" content="no" />
-<meta name="resource-type" content="document" />
-<meta name="distribution" content="global" />
-<meta name="keywords" content="" />
-<meta name="description" content="" />
+<meta charset="utf-8" />
+<meta http-equiv="X-UA-Compatible" content="IE=edge">
+<meta name="viewport" content="width=device-width, initial-scale=1" />
{META}
<title>{SITENAME} &bull; <!-- IF S_IN_MCP -->{L_MCP} &bull; <!-- ELSEIF S_IN_UCP -->{L_UCP} &bull; <!-- ENDIF -->{PAGE_TITLE}</title>
-<script type="text/javascript">
-// <![CDATA[
-
- var jump_page = '{LA_JUMP_PAGE}:';
- var on_page = '{ON_PAGE}';
- var per_page = '{PER_PAGE}';
- var base_url = '{A_BASE_URL}';
- var style_cookie = 'phpBBstyle';
- var onload_functions = new Array();
- var onunload_functions = new Array();
- var style_cookie_settings = '{A_COOKIE_SETTINGS}';
-
- /**
- * New function for handling multiple calls to window.onload and window.unload by pentapenguin
- */
- window.onload = function()
- {
- for (var i = 0; i < onload_functions.length; i++)
- {
- eval(onload_functions[i]);
+<!-- IF S_ALLOW_CDN -->
+<script>
+ WebFontConfig = {
+ google: {
+ families: ['Open+Sans:600:cyrillic-ext,latin,greek-ext,greek,vietnamese,latin-ext,cyrillic']
}
- }
-
- window.onunload = function()
- {
- for (var i = 0; i < onunload_functions.length; i++)
- {
- eval(onunload_functions[i]);
- }
- }
-
-// ]]>
+ };
+
+ (function(d) {
+ var wf = d.createElement('script'), s = d.scripts[0];
+ wf.src = 'https://ajax.googleapis.com/ajax/libs/webfont/1.5.18/webfont.js';
+ wf.async = true;
+ s.parentNode.insertBefore(wf, s);
+ })(document);
</script>
-<script type="text/javascript" src="{T_SUPER_TEMPLATE_PATH}/styleswitcher.js"></script>
-<script type="text/javascript" src="{T_SUPER_TEMPLATE_PATH}/forum_fn.js"></script>
-
-<link href="{T_THEME_PATH}/print.css" rel="stylesheet" type="text/css" media="print" title="printonly" />
-<link href="{T_STYLESHEET_LINK}" rel="stylesheet" type="text/css" media="screen, projection" />
-
-<link href="{T_THEME_PATH}/normal.css" rel="alternate stylesheet" type="text/css" title="A" />
-<link href="{T_THEME_PATH}/medium.css" rel="alternate stylesheet" type="text/css" title="A+" />
-<link href="{T_THEME_PATH}/large.css" rel="alternate stylesheet" type="text/css" title="A++" />
+<!-- ENDIF -->
+<link href="{T_STYLESHEET_LINK}" rel="stylesheet">
+<link href="{T_STYLESHEET_LANG_LINK}" rel="stylesheet">
+<link href="{T_THEME_PATH}/responsive.css?assets_version={T_ASSETS_VERSION}" rel="stylesheet" media="all and (max-width: 700px)">
<!-- IF S_CONTENT_DIRECTION eq 'rtl' -->
- <link href="{T_THEME_PATH}/bidi.css" rel="stylesheet" type="text/css" media="screen, projection" />
+ <link href="{T_THEME_PATH}/bidi.css?assets_version={T_ASSETS_VERSION}" rel="stylesheet">
<!-- ENDIF -->
+<!--[if lte IE 8]>
+ <link href="{T_THEME_PATH}/tweaks.css?assets_version={T_ASSETS_VERSION}" rel="stylesheet">
+<![endif]-->
+
<!-- DEFINE $POPUP = 1 -->
+<!-- EVENT simple_header_head_append -->
+
+{$STYLESHEETS}
+
+<!-- EVENT simple_header_stylesheets_after -->
+
</head>
-<body id="phpbb" class="{S_CONTENT_DIRECTION}">
+<body id="phpbb" class="nojs {S_CONTENT_DIRECTION} {BODY_CLASS}">
+
+<!-- EVENT simple_header_body_before -->
-<div id="simple-wrap">
- <a id="top" name="top" accesskey="t"></a>
- <div id="page-body"> \ No newline at end of file
+<div id="wrap">
+ <a id="top" class="anchor" accesskey="t"></a>
+ <div id="page-body" role="main">
diff --git a/phpBB/styles/prosilver/template/styleswitcher.js b/phpBB/styles/prosilver/template/styleswitcher.js
deleted file mode 100644
index bbcac9b69c..0000000000
--- a/phpBB/styles/prosilver/template/styleswitcher.js
+++ /dev/null
@@ -1,193 +0,0 @@
-
-function fontsizeup(event)
-{
- // Skip tabs; 9 being the ASCII code for a tab
- if (event && getKeyCode(event) == 9)
- {
- return true;
- }
-
- var active = getActiveStyleSheet();
-
- switch (active)
- {
- case 'A--':
- setActiveStyleSheet('A-');
- break;
-
- case 'A-':
- setActiveStyleSheet('A');
- break;
-
- case 'A':
- setActiveStyleSheet('A+');
- break;
-
- case 'A+':
- setActiveStyleSheet('A++');
- break;
-
- case 'A++':
- setActiveStyleSheet('A');
- break;
-
- default:
- setActiveStyleSheet('A');
- break;
- }
-
- return false;
-}
-
-function fontsizedown(event)
-{
- // Skip tabs
- if (event && getKeyCode(event) == 9)
- {
- return true;
- }
-
- var active = getActiveStyleSheet();
-
- switch (active)
- {
- case 'A++' :
- setActiveStyleSheet('A+');
- break;
-
- case 'A+' :
- setActiveStyleSheet('A');
- break;
-
- case 'A' :
- setActiveStyleSheet('A-');
- break;
-
- case 'A-' :
- setActiveStyleSheet('A--');
- break;
-
- case 'A--' :
- break;
-
- default :
- setActiveStyleSheet('A--');
- break;
- }
-
- return false;
-}
-
-function getKeyCode(event)
-{
- // IE doesn't fire the onkeypress event for tabs
- // Reference: http://www.quirksmode.org/js/keys.html
-
- var code = (event.keyCode) ? event.keyCode : 0;
-
- // Probably using FF
- if (!code && event.charCode)
- {
- code = event.charCode;
- }
-
- return code;
-}
-
-function setActiveStyleSheet(title)
-{
- var i, a, main;
-
- for (i = 0; (a = document.getElementsByTagName('link')[i]); i++)
- {
- if (a.getAttribute('rel').indexOf('style') != -1 && a.getAttribute('title'))
- {
- a.disabled = true;
- if (a.getAttribute('title') == title)
- {
- a.disabled = false;
- }
- }
- }
-}
-
-function getActiveStyleSheet()
-{
- var i, a;
-
- for (i = 0; (a = document.getElementsByTagName('link')[i]); i++)
- {
- if (a.getAttribute('rel').indexOf('style') != -1 && a.getAttribute('title') && !a.disabled)
- {
- return a.getAttribute('title');
- }
- }
-
- return null;
-}
-
-function getPreferredStyleSheet()
-{
- return ('A-');
-}
-
-function createCookie(name, value, days)
-{
- if (days)
- {
- var date = new Date();
- date.setTime(date.getTime() + (days*24*60*60*1000));
- var expires = '; expires=' + date.toGMTString();
- }
- else
- {
- expires = '';
- }
-
- document.cookie = name + '=' + value + expires + style_cookie_settings;
-}
-
-function readCookie(name)
-{
- var nameEQ = name + '=';
- var ca = document.cookie.split(';');
-
- for (var i = 0; i < ca.length; i++)
- {
- var c = ca[i];
-
- while (c.charAt(0) == ' ')
- {
- c = c.substring(1, c.length);
- }
-
- if (c.indexOf(nameEQ) == 0)
- {
- return c.substring(nameEQ.length, c.length);
- }
- }
-
- return null;
-}
-
-function load_cookie()
-{
- var cookie = readCookie('style_cookie');
- var title = cookie ? cookie : getPreferredStyleSheet();
- setActiveStyleSheet(title);
-}
-
-function unload_cookie()
-{
- var title = getActiveStyleSheet();
- createCookie('style_cookie', title, 365);
-}
-
-onload_functions.push('load_cookie()');
-onunload_functions.push('unload_cookie()');
-
-/*
-var cookie = readCookie("style");
-var title = cookie ? cookie : getPreferredStyleSheet();
-setActiveStyleSheet(title);
-*/
diff --git a/phpBB/styles/prosilver/template/template.cfg b/phpBB/styles/prosilver/template/template.cfg
deleted file mode 100644
index 9ef3e42afe..0000000000
--- a/phpBB/styles/prosilver/template/template.cfg
+++ /dev/null
@@ -1,30 +0,0 @@
-#
-# phpBB Template Configuration File
-#
-# @package phpBB3
-# @copyright (c) 2006 phpBB Group
-# @license http://opensource.org/licenses/gpl-license.php GNU Public License
-#
-#
-# At the left is the name, please do not change this
-# At the right the value is entered
-# For on/off options the valid values are on, off, 1, 0, true and false
-#
-# Values get trimmed, if you want to add a space in front or at the end of
-# the value, then enclose the value with single or double quotes.
-# Single and double quotes do not need to be escaped.
-#
-#
-
-# General Information about this template
-name = prosilver
-copyright = &copy; phpBB Group, 2007
-version = 3.0.14
-
-# Defining a different template bitfield
-template_bitfield = lNg=
-
-# Template inheritance
-# See http://blog.phpbb.com/2008/07/31/templating-just-got-easier/
-# Set value to empty to ignore template inheritance
-inherit_from = prosilver
diff --git a/phpBB/styles/prosilver/template/timezone.js b/phpBB/styles/prosilver/template/timezone.js
new file mode 100644
index 0000000000..44ec1b0979
--- /dev/null
+++ b/phpBB/styles/prosilver/template/timezone.js
@@ -0,0 +1,20 @@
+/* global phpbb */
+
+(function($) { // Avoid conflicts with other libraries
+
+'use strict';
+
+$('#tz_date').change(function() {
+ phpbb.timezoneSwitchDate(false);
+});
+
+$('#tz_select_date_suggest').click(function(){
+ phpbb.timezonePreselectSelect(true);
+});
+
+$(function () {
+ phpbb.timezoneEnableDateSelection();
+ phpbb.timezonePreselectSelect($('#tz_select_date_suggest').attr('timezone-preselect') === 'true');
+});
+
+})(jQuery); // Avoid conflicts with other libraries
diff --git a/phpBB/styles/prosilver/template/timezone_option.html b/phpBB/styles/prosilver/template/timezone_option.html
new file mode 100644
index 0000000000..b8be456489
--- /dev/null
+++ b/phpBB/styles/prosilver/template/timezone_option.html
@@ -0,0 +1,28 @@
+<dl>
+ <dt><label for="timezone">{L_BOARD_TIMEZONE}{L_COLON}</label></dt>
+ <!-- IF .timezone_date -->
+ <dd id="tz_select_date" style="display: none;">
+ <select name="tz_date" id="tz_date" class="autowidth tz_select">
+ <option value="">{L_SELECT_CURRENT_TIME}</option>
+ <!-- BEGIN timezone_date -->
+ <option value="{timezone_date.VALUE}"<!-- IF timezone_date.SELECTED --> selected="selected"<!-- ENDIF -->>{timezone_date.TITLE}</option>
+ <!-- END timezone_date -->
+ </select>
+ <input type="button" id="tz_select_date_suggest" class="button2" style="display: none;" timezone-preselect="<!-- IF S_TZ_PRESELECT -->true<!-- ELSE -->false<!-- ENDIF -->" data-l-suggestion="{L_TIMEZONE_DATE_SUGGESTION}" value="{L_TIMEZONE_DATE_SUGGESTION}" />
+ </dd>
+ <!-- ENDIF -->
+ <dd>
+ <select name="tz" id="timezone" class="autowidth tz_select">
+ <option value="">{L_SELECT_TIMEZONE}</option>
+ <!-- BEGIN timezone_select -->
+ <optgroup label="{timezone_select.LABEL}" data-tz-value="{timezone_select.VALUE}">
+ <!-- BEGIN timezone_options -->
+ <option title="{timezone_select.timezone_options.TITLE}" value="{timezone_select.timezone_options.VALUE}"<!-- IF timezone_select.timezone_options.SELECTED --> selected="selected"<!-- ENDIF -->>{timezone_select.timezone_options.LABEL}</option>
+ <!-- END timezone_options -->
+ </optgroup>
+ <!-- END timezone_select -->
+ </select>
+
+ <!-- INCLUDEJS timezone.js -->
+ </dd>
+</dl>
diff --git a/phpBB/styles/prosilver/template/ucp_agreement.html b/phpBB/styles/prosilver/template/ucp_agreement.html
index 3825abc08f..943774c6ec 100644
--- a/phpBB/styles/prosilver/template/ucp_agreement.html
+++ b/phpBB/styles/prosilver/template/ucp_agreement.html
@@ -10,6 +10,7 @@
*/
function change_language(lang_iso)
{
+ document.cookie = '{COOKIE_NAME}_lang=' + lang_iso + '; path={COOKIE_PATH}';
document.forms['register'].change_lang.value = lang_iso;
document.forms['register'].submit();
}
@@ -19,7 +20,7 @@
<form method="post" action="{S_UCP_ACTION}" id="register">
<p class="rightside">
- <label for="lang">{L_LANGUAGE}:</label><select name="lang" id="lang" onchange="change_language(this.value); return false;" title="{L_LANGUAGE}">{S_LANG_OPTIONS}</select>
+ <label for="lang">{L_LANGUAGE}{L_COLON}</label><select name="lang" id="lang" onchange="change_language(this.value); return false;" title="{L_LANGUAGE}">{S_LANG_OPTIONS}</select>
{S_HIDDEN_FIELDS}
</p>
</form>
@@ -31,16 +32,18 @@
<form method="post" action="{S_UCP_ACTION}" id="agreement">
<div class="panel">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div class="content">
- <h2>{SITENAME} - {L_REGISTRATION}</h2>
+ <h2 class="sitename-title">{SITENAME} - {L_REGISTRATION}</h2>
+ <!-- EVENT ucp_agreement_terms_before -->
<p><!-- IF S_SHOW_COPPA -->{L_COPPA_BIRTHDAY}<!-- ELSE -->{L_TERMS_OF_USE}<!-- ENDIF --></p>
+ <!-- EVENT ucp_agreement_terms_after -->
+ </div>
</div>
- <span class="corners-bottom"><span></span></span></div>
</div>
<div class="panel">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<fieldset class="submit-buttons">
<!-- IF S_SHOW_COPPA -->
<strong><a href="{U_COPPA_NO}" class="button1">{L_COPPA_NO}</a></strong>&nbsp; <a href="{U_COPPA_YES}" class="button2">{L_COPPA_YES}</a>
@@ -51,21 +54,21 @@
{S_HIDDEN_FIELDS}
{S_FORM_TOKEN}
</fieldset>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
</form>
<!-- ELSEIF S_AGREEMENT -->
<div class="panel">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div class="content">
- <h2>{SITENAME} - {AGREEMENT_TITLE}</h2>
+ <h2 class="sitename-title">{SITENAME} - {AGREEMENT_TITLE}</h2>
<p>{AGREEMENT_TEXT}</p>
<hr class="dashed" />
<p><a href="{U_BACK}" class="button2">{L_BACK}</a></p>
</div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<!-- ENDIF -->
diff --git a/phpBB/styles/prosilver/template/ucp_attachments.html b/phpBB/styles/prosilver/template/ucp_attachments.html
index 8052fdc435..1d4963273c 100644
--- a/phpBB/styles/prosilver/template/ucp_attachments.html
+++ b/phpBB/styles/prosilver/template/ucp_attachments.html
@@ -5,35 +5,43 @@
<h2>{L_TITLE}</h2>
<div class="panel">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<p>{L_ATTACHMENTS_EXPLAIN}</p>
<!-- IF .attachrow -->
- <ul class="linklist">
- <li class="rightside pagination">
- <!-- IF TOTAL_ATTACHMENTS -->{TOTAL_ATTACHMENTS} {L_TITLE}<!-- ENDIF -->
- <!-- IF PAGE_NUMBER --><!-- IF PAGINATION --> &bull; <a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{PAGE_NUMBER}</a> &bull; <span>{PAGINATION}</span><!-- ELSE --> &bull; {PAGE_NUMBER}<!-- ENDIF --><!-- ENDIF -->
- </li>
- </ul>
+ <div class="action-bar top">
+ <div class="pagination">
+ {NUM_ATTACHMENTS}
+ <!-- IF .pagination -->
+ <!-- INCLUDE pagination.html -->
+ <!-- ELSE -->
+ &bull; {PAGE_NUMBER}
+ <!-- ENDIF -->
+ </div>
+ </div>
<ul class="topiclist">
<li class="header">
<dl>
- <dt style="width: 40%"><a href="{U_SORT_FILENAME}">{L_FILENAME}</a></dt>
+ <dt><div class="list-inner"><a href="{U_SORT_FILENAME}">{L_FILENAME}</a></div></dt>
<dd class="extra"><a href="{U_SORT_DOWNLOADS}">{L_DOWNLOADS}</a></dd>
<dd class="time"><span><a href="{U_SORT_POST_TIME}">{L_POST_TIME}</a></span></dd>
<dd class="mark">{L_MARK}</dd>
</dl>
</li>
</ul>
- <ul class="topiclist cplist">
+ <ul class="topiclist cplist responsive-show-columns">
<!-- BEGIN attachrow -->
<li class="row<!-- IF attachrow.S_ROW_COUNT is odd --> bg1<!-- ELSE --> bg2<!-- ENDIF -->">
<dl>
- <dt style="width: 40%"><a href="{attachrow.U_VIEW_ATTACHMENT}" class="topictitle">{attachrow.FILENAME}</a> ({attachrow.SIZE})<br />
- <!-- IF attachrow.S_IN_MESSAGE -->{L_PM}: <!-- ELSE -->{L_TOPIC}: <!-- ENDIF --><a href="{attachrow.U_VIEW_TOPIC}">{attachrow.TOPIC_TITLE}</a></dt>
+ <dt>
+ <div class="list-inner">
+ <a href="{attachrow.U_VIEW_ATTACHMENT}" class="topictitle attachment-filename ellipsis-text" title="{attachrow.FILENAME}">{attachrow.FILENAME}</a> ({attachrow.SIZE})<br />
+ <!-- IF attachrow.S_IN_MESSAGE -->{L_PM}{L_COLON} <!-- ELSE -->{L_TOPIC}{L_COLON} <!-- ENDIF --><a href="{attachrow.U_VIEW_TOPIC}">{attachrow.TOPIC_TITLE}</a>
+ </div>
+ </dt>
<dd class="extra">{attachrow.DOWNLOAD_COUNT}</dd>
<dd class="time"><span>{attachrow.POST_TIME}</span></dd>
<dd class="mark"><input type="checkbox" name="attachment[{attachrow.ATTACH_ID}]" value="1" /></dd>
@@ -43,27 +51,30 @@
</ul>
<fieldset class="display-options">
- <!-- IF NEXT_PAGE --><a href="{NEXT_PAGE}" class="right-box {S_CONTENT_FLOW_END}">{L_NEXT}</a><!-- ENDIF -->
- <!-- IF PREVIOUS_PAGE --><a href="{PREVIOUS_PAGE}" class="left-box {S_CONTENT_FLOW_BEGIN}">{L_PREVIOUS}</a><!-- ENDIF -->
- <label for="sk">{L_SORT_BY}: <select name="sk" id="sk">{S_SORT_OPTIONS}</select></label>
+ <label for="sk">{L_SORT_BY}{L_COLON} <select name="sk" id="sk">{S_SORT_OPTIONS}</select></label>
<label><select name="sd" id="sd">{S_ORDER_SELECT}</select></label>
<input class="button2" type="submit" name="sort" value="{L_SORT}" />
{S_FORM_TOKEN}
</fieldset>
<hr />
-
- <ul class="linklist">
- <li class="rightside pagination">
- <!-- IF TOTAL_ATTACHMENTS -->{TOTAL_ATTACHMENTS} {L_TITLE}<!-- ENDIF -->
- <!-- IF PAGE_NUMBER --><!-- IF PAGINATION --> &bull; <a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{PAGE_NUMBER}</a> &bull; <span>{PAGINATION}</span><!-- ELSE --> &bull; {PAGE_NUMBER}<!-- ENDIF --><!-- ENDIF -->
- </li>
- </ul>
+
+ <div class="action-bar bottom">
+ <div class="pagination">
+ {TOTAL_ATTACHMENTS} {L_TITLE}
+ <!-- IF .pagination -->
+ <!-- INCLUDE pagination.html -->
+ <!-- ELSE -->
+ &bull; {PAGE_NUMBER}
+ <!-- ENDIF -->
+ </div>
+ </div>
+
<!-- ELSE -->
<p><strong>{L_UCP_NO_ATTACHMENTS}</strong></p>
<!-- ENDIF -->
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<!-- IF S_ATTACHMENT_ROWS -->
@@ -75,4 +86,4 @@
<!-- ENDIF -->
</form>
-<!-- INCLUDE ucp_footer.html --> \ No newline at end of file
+<!-- INCLUDE ucp_footer.html -->
diff --git a/phpBB/styles/prosilver/template/ucp_auth_link.html b/phpBB/styles/prosilver/template/ucp_auth_link.html
new file mode 100644
index 0000000000..078da58d19
--- /dev/null
+++ b/phpBB/styles/prosilver/template/ucp_auth_link.html
@@ -0,0 +1,15 @@
+<!-- INCLUDE ucp_header.html -->
+
+<h2>{L_UCP_AUTH_LINK_TITLE}</h2>
+
+<div class="panel">
+ <div class="inner">
+ <!-- IF ERROR --><dl><dd class="error">{ERROR}</dd></dl><!-- ENDIF -->
+
+ <!-- IF PROVIDER_TEMPLATE_FILE -->
+ <!-- INCLUDE {PROVIDER_TEMPLATE_FILE} -->
+ <!-- ENDIF -->
+ </div>
+</div>
+
+<!-- INCLUDE ucp_footer.html -->
diff --git a/phpBB/styles/prosilver/template/ucp_auth_link_oauth.html b/phpBB/styles/prosilver/template/ucp_auth_link_oauth.html
new file mode 100644
index 0000000000..18316613b0
--- /dev/null
+++ b/phpBB/styles/prosilver/template/ucp_auth_link_oauth.html
@@ -0,0 +1,29 @@
+<!-- BEGIN oauth -->
+ <form id="ucp" method="post" action="{S_UCP_ACTION}">
+ <h3>{oauth.SERVICE_NAME}</h3>
+
+ <fieldset class="fields2">
+ <!-- IF oauth.UNIQUE_ID -->
+ <dl>
+ <dt>{L_UCP_AUTH_LINK_ID}{L_COLON}</dt>
+ <dd>{oauth.UNIQUE_ID}</dd>
+ </dl>
+ <dl>
+ <dt>&nbsp;</dt>
+ <dd><input type="submit" name="submit" tabindex="6" value="{L_UCP_AUTH_LINK_UNLINK}" class="button1" /></dd>
+ </dl>
+ <!-- ELSE -->
+ <dl>
+ <dd>{L_UCP_AUTH_LINK_ASK}</dd>
+ </dl>
+ <dl>
+ <dt>&nbsp;</dt>
+ <dd><input type="submit" name="submit" tabindex="6" value="{L_UCP_AUTH_LINK_LINK}" class="button1" /></dd>
+ </dl>
+ <!-- ENDIF -->
+ </fieldset>
+ {oauth.HIDDEN_FIELDS}
+ {S_HIDDEN_FIELDS}
+ {S_FORM_TOKEN}
+ </form>
+<!-- END oauth -->
diff --git a/phpBB/styles/prosilver/template/ucp_avatar_options.html b/phpBB/styles/prosilver/template/ucp_avatar_options.html
index 7012c42f3b..2cf9488ed0 100644
--- a/phpBB/styles/prosilver/template/ucp_avatar_options.html
+++ b/phpBB/styles/prosilver/template/ucp_avatar_options.html
@@ -1,70 +1,47 @@
-
<div class="panel">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<!-- IF not S_AVATARS_ENABLED -->
<p>{L_AVATAR_FEATURES_DISABLED}</p>
<!-- ENDIF -->
<fieldset>
<!-- IF ERROR --><p class="error">{ERROR}</p><!-- ENDIF -->
- <dl>
- <dt><label>{L_CURRENT_IMAGE}:</label><br /><span>{L_AVATAR_EXPLAIN}</span></dt>
- <dd><!-- IF AVATAR -->{AVATAR}<!-- ELSE --><img src="{T_THEME_PATH}/images/no_avatar.gif" alt="" /><!-- ENDIF --></dd>
- <dd><label for="delete"><input type="checkbox" name="delete" id="delete" /> {L_DELETE_AVATAR}</label></dd>
- </dl>
-
- <!-- IF S_UPLOAD_AVATAR_FILE -->
<dl>
- <dt><label for="uploadfile">{L_UPLOAD_AVATAR_FILE}:</label></dt>
- <dd><input type="hidden" name="MAX_FILE_SIZE" value="{AVATAR_SIZE}" /><input type="file" name="uploadfile" id="uploadfile" class="inputbox autowidth" /></dd>
- </dl>
- <!-- ENDIF -->
-
- <!-- IF S_UPLOAD_AVATAR_URL -->
- <dl>
- <dt><label for="uploadurl">{L_UPLOAD_AVATAR_URL}:</label><br /><span>{L_UPLOAD_AVATAR_URL_EXPLAIN}</span></dt>
- <dd><input type="text" name="uploadurl" id="uploadurl" value="{AVATAR_URL}" class="inputbox" /></dd>
- </dl>
- <!-- ENDIF -->
-
- <!-- IF S_LINK_AVATAR -->
- <dl>
- <dt><label for="remotelink">{L_LINK_REMOTE_AVATAR}:</label><br /><span>{L_LINK_REMOTE_AVATAR_EXPLAIN}</span></dt>
- <dd><input type="text" name="remotelink" id="remotelink" value="{AVATAR_REMOTE}" class="inputbox" /></dd>
+ <dt><label>{L_CURRENT_IMAGE}{L_COLON}</label><br /><span>{L_AVATAR_EXPLAIN}</span></dt>
+ <dd><!-- IF AVATAR -->{AVATAR}<!-- ELSE --><img src="{T_THEME_PATH}/images/no_avatar.gif" alt="" /><!-- ENDIF --></dd>
+ <dd><label for="avatar_delete"><input type="checkbox" name="avatar_delete" id="avatar_delete" /> {L_DELETE_AVATAR}</label></dd>
</dl>
+ </fieldset>
+ <h3>{L_AVATAR_SELECT}</h3>
+ <fieldset>
<dl>
- <dt><label for="width">{L_LINK_REMOTE_SIZE}:</label><br /><span>{L_LINK_REMOTE_SIZE_EXPLAIN}</span></dt>
- <dd>
- <label for="width"><input type="text" name="width" id="width" size="3" value="{AVATAR_WIDTH}" class="inputbox autowidth" /> {L_PIXEL}</label> &times;&nbsp;
- <label for="height"><input type="text" name="height" id="height" size="3" value="{AVATAR_HEIGHT}" class="inputbox autowidth" /> {L_PIXEL}</label>
- </dd>
+ <dt><label>{L_AVATAR_TYPE}{L_COLON}</label></dt>
+ <dd><select name="avatar_driver" id="avatar_driver" data-togglable-settings="true">
+ <!-- BEGIN avatar_drivers -->
+ <option value="{avatar_drivers.DRIVER}"<!-- IF avatar_drivers.SELECTED --> selected="selected"<!-- ENDIF --> data-toggle-setting="#avatar_option_{avatar_drivers.DRIVER}">{avatar_drivers.L_TITLE}</option>
+ <!-- END avatar_drivers -->
+ </select></dd>
</dl>
- <!-- ENDIF -->
</fieldset>
+ <div id="avatar_options">
+<!-- BEGIN avatar_drivers -->
+ <div id="avatar_option_{avatar_drivers.DRIVER}">
+ <noscript>
+ <h3 class="avatar_section_header">{avatar_drivers.L_TITLE}</h3>
+ </noscript>
+ <p>{avatar_drivers.L_EXPLAIN}</p>
- <!-- IF S_IN_AVATAR_GALLERY -->
- <span class="corners-bottom"><span></span></span></div>
+ <fieldset>
+ {avatar_drivers.OUTPUT}
+ </fieldset>
+ </div>
+<!-- END avatar_drivers -->
+ </div>
+<!-- IF not S_GROUP_MANAGE -->
+ <fieldset class="submit-buttons">
+ <input type="reset" value="{L_RESET}" name="reset" class="button2" /> &nbsp;
+ <input type="submit" name="submit" value="{L_SUBMIT}" class="button1" />
+ </fieldset>
+<!-- ENDIF -->
</div>
-
- <div class="panel">
- <div class="inner"><span class="corners-top"><span></span></span>
-
- <h3>{L_AVATAR_GALLERY}</h3>
-
- <fieldset>
- <label for="category">{L_AVATAR_CATEGORY}: <select name="category" id="category">{S_CAT_OPTIONS}</select></label>
- <input type="submit" value="{L_GO}" name="display_gallery" class="button2" />
- <input type="submit" name="cancel" value="{L_CANCEL}" class="button2" />
- </fieldset>
-
- <div id="gallery">
- <!-- BEGIN avatar_row --><!-- BEGIN avatar_column -->
- <label for="av-{avatar_row.S_ROW_COUNT}-{avatar_row.avatar_column.S_ROW_COUNT}"><img src="{avatar_row.avatar_column.AVATAR_IMAGE}" alt="" /><br />
- <input type="radio" name="avatar_select" id="av-{avatar_row.S_ROW_COUNT}-{avatar_row.avatar_column.S_ROW_COUNT}" value="{avatar_row.avatar_column.AVATAR_FILE}" /></label>
- <!-- END avatar_column --><!-- END avatar_row -->
- </div>
-
- <!-- ENDIF -->
-
- <span class="corners-bottom"><span></span></span></div>
</div>
diff --git a/phpBB/styles/prosilver/template/ucp_avatar_options_gravatar.html b/phpBB/styles/prosilver/template/ucp_avatar_options_gravatar.html
new file mode 100644
index 0000000000..130a7c2cca
--- /dev/null
+++ b/phpBB/styles/prosilver/template/ucp_avatar_options_gravatar.html
@@ -0,0 +1,11 @@
+<dl>
+ <dt><label for="avatar_gravatar_email">{L_GRAVATAR_AVATAR_EMAIL}{L_COLON}</label><br /><span>{L_GRAVATAR_AVATAR_EMAIL_EXPLAIN}</span></dt>
+ <dd><input type="email" name="avatar_gravatar_email" id="avatar_gravatar_email" value="{AVATAR_GRAVATAR_EMAIL}" class="inputbox" data-reset-on-edit="#avatar_gravatar_width, #avatar_gravatar_height" /></dd>
+</dl>
+<dl>
+ <dt><label for="avatar_gravatar_width">{L_GRAVATAR_AVATAR_SIZE}{L_COLON}</label><br /><span>{L_GRAVATAR_AVATAR_SIZE_EXPLAIN}</span></dt>
+ <dd>
+ <label for="avatar_gravatar_width"><input type="number" name="avatar_gravatar_width" id="avatar_gravatar_width" min="{AVATAR_MIN_WIDTH}" max="{AVATAR_MAX_WIDTH}" value="{AVATAR_GRAVATAR_WIDTH}" class="inputbox autowidth" /> {L_PIXEL}</label> &times;&nbsp;
+ <label for="avatar_gravatar_height"><input type="number" name="avatar_gravatar_height" id="avatar_gravatar_height" min="{AVATAR_MIN_HEIGHT}" max="{AVATAR_MAX_HEIGHT}" value="{AVATAR_GRAVATAR_HEIGHT}" class="inputbox autowidth" /> {L_PIXEL}</label>
+ </dd>
+</dl>
diff --git a/phpBB/styles/prosilver/template/ucp_avatar_options_local.html b/phpBB/styles/prosilver/template/ucp_avatar_options_local.html
new file mode 100644
index 0000000000..80c7f28ca3
--- /dev/null
+++ b/phpBB/styles/prosilver/template/ucp_avatar_options_local.html
@@ -0,0 +1,20 @@
+<!-- IF .avatar_local_cats -->
+<label for="category">{L_AVATAR_CATEGORY}{L_COLON} <select name="avatar_local_cat" id="category">
+<!-- BEGIN avatar_local_cats -->
+<option value="{avatar_local_cats.NAME}"<!-- IF avatar_local_cats.SELECTED --> selected="selected"<!-- ENDIF -->>{avatar_local_cats.NAME}</option>
+<!-- END avatar_local_cats -->
+</select></label>
+<input type="submit" value="{L_GO}" name="avatar_local_go" class="button2" />
+
+<div id="gallery">
+<!-- BEGIN avatar_local_row -->
+<!-- BEGIN avatar_local_col -->
+ <label for="av-{avatar_local_row.S_ROW_COUNT}-{avatar_local_row.avatar_local_col.S_ROW_COUNT}"><img src="{avatar_local_row.avatar_local_col.AVATAR_IMAGE}" alt="" /><br />
+ <input type="radio" name="avatar_local_file" id="av-{avatar_local_row.S_ROW_COUNT}-{avatar_local_row.avatar_local_col.S_ROW_COUNT}"
+ value="{avatar_local_row.avatar_local_col.AVATAR_FILE}"<!-- IF avatar_local_row.avatar_local_col.CHECKED --> checked="checked"<!-- ENDIF --> /></label>
+<!-- END avatar_local_col -->
+<!-- END avatar_local_row -->
+</div>
+<!-- ELSE -->
+<p><strong>{L_NO_AVATARS}</strong></p>
+<!-- ENDIF -->
diff --git a/phpBB/styles/prosilver/template/ucp_avatar_options_remote.html b/phpBB/styles/prosilver/template/ucp_avatar_options_remote.html
new file mode 100644
index 0000000000..8e175623ac
--- /dev/null
+++ b/phpBB/styles/prosilver/template/ucp_avatar_options_remote.html
@@ -0,0 +1,11 @@
+<dl>
+ <dt><label for="avatar_remote_url">{L_LINK_REMOTE_AVATAR}{L_COLON}</label><br /><span>{L_LINK_REMOTE_AVATAR_EXPLAIN}</span></dt>
+ <dd><input type="url" name="avatar_remote_url" id="avatar_remote_url" value="{AVATAR_REMOTE_URL}" class="inputbox" data-reset-on-edit="#avatar_remote_width, #avatar_remote_height" /></dd>
+</dl>
+<dl>
+ <dt><label for="avatar_remote_width">{L_LINK_REMOTE_SIZE}{L_COLON}</label><br /><span>{L_LINK_REMOTE_SIZE_EXPLAIN}</span></dt>
+ <dd>
+ <label for="avatar_remote_width"><input type="number" name="avatar_remote_width" id="avatar_remote_width" min="{AVATAR_MIN_WIDTH}" max="{AVATAR_MAX_WIDTH}" value="{AVATAR_REMOTE_WIDTH}" class="inputbox autowidth" /> {L_PIXEL}</label> &times;&nbsp;
+ <label for="avatar_remote_height"><input type="number" name="avatar_remote_height" id="avatar_remote_height" min="{AVATAR_MIN_HEIGHT}" max="{AVATAR_MAX_HEIGHT}" value="{AVATAR_REMOTE_HEIGHT}" class="inputbox autowidth" /> {L_PIXEL}</label>
+ </dd>
+</dl>
diff --git a/phpBB/styles/prosilver/template/ucp_avatar_options_upload.html b/phpBB/styles/prosilver/template/ucp_avatar_options_upload.html
new file mode 100644
index 0000000000..63a734ea7d
--- /dev/null
+++ b/phpBB/styles/prosilver/template/ucp_avatar_options_upload.html
@@ -0,0 +1,11 @@
+<dl>
+ <dt><label for="avatar_upload_file">{L_UPLOAD_AVATAR_FILE}{L_COLON}</label></dt>
+ <dd><input type="hidden" name="MAX_FILE_SIZE" value="{AVATAR_UPLOAD_SIZE}" /><input type="file" name="avatar_upload_file" id="avatar_upload_file" class="inputbox autowidth" /></dd>
+</dl>
+
+<!-- IF S_UPLOAD_AVATAR_URL -->
+ <dl>
+ <dt><label for="avatar_upload_url">{L_UPLOAD_AVATAR_URL}{L_COLON}</label><br /><span>{L_UPLOAD_AVATAR_URL_EXPLAIN}</span></dt>
+ <dd><input type="url" name="avatar_upload_url" id="avatar_upload_url" value="" class="inputbox" /></dd>
+ </dl>
+<!-- ENDIF -->
diff --git a/phpBB/styles/prosilver/template/ucp_footer.html b/phpBB/styles/prosilver/template/ucp_footer.html
index 4b3b14b4b7..f2f1a68db3 100644
--- a/phpBB/styles/prosilver/template/ucp_footer.html
+++ b/phpBB/styles/prosilver/template/ucp_footer.html
@@ -1,9 +1,8 @@
</div>
- <div class="clear"></div>
</div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<!-- IF S_COMPOSE_PM -->
<div>{S_FORM_TOKEN}</div>
@@ -12,4 +11,4 @@
<!-- INCLUDE jumpbox.html -->
-<!-- INCLUDE overall_footer.html --> \ No newline at end of file
+<!-- INCLUDE overall_footer.html -->
diff --git a/phpBB/styles/prosilver/template/ucp_groups_manage.html b/phpBB/styles/prosilver/template/ucp_groups_manage.html
index 53d2dfffb3..3b805c4862 100644
--- a/phpBB/styles/prosilver/template/ucp_groups_manage.html
+++ b/phpBB/styles/prosilver/template/ucp_groups_manage.html
@@ -5,7 +5,7 @@
<form id="ucp" method="post" action="{S_UCP_ACTION}"{S_FORM_ENCTYPE}>
<div class="panel">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<!-- IF S_ERROR -->
<fieldset>
@@ -20,18 +20,18 @@
<fieldset>
<dl>
- <dt><label for="group_name">{L_GROUP_NAME}:</label></dt>
+ <dt><label for="group_name">{L_GROUP_NAME}{L_COLON}</label></dt>
<dd><!-- IF S_SPECIAL_GROUP --><strong<!-- IF GROUP_COLOUR --> style="color: #{GROUP_COLOUR};"<!-- ENDIF -->>{GROUP_NAME}</strong> <input name="group_name" type="hidden" value="{GROUP_INTERNAL_NAME}" />
<!-- ELSE --><input name="group_name" type="text" id="group_name" value="{GROUP_INTERNAL_NAME}" class="inputbox" /><!-- ENDIF --></dd>
</dl>
<dl>
- <dt><label for="group_desc">{L_GROUP_DESC}:</label></dt>
+ <dt><label for="group_desc">{L_GROUP_DESC}{L_COLON}</label></dt>
<dd><textarea id="group_desc" name="group_desc" rows="5" cols="45" class="inputbox">{GROUP_DESC}</textarea></dd>
<dd><label for="desc_parse_bbcode"><input type="checkbox" class="radio" name="desc_parse_bbcode" id="desc_parse_bbcode"<!-- IF S_DESC_BBCODE_CHECKED --> checked="checked"<!-- ENDIF --> /> {L_PARSE_BBCODE}</label>&nbsp;<label for="desc_parse_smilies"><input type="checkbox" class="radio" name="desc_parse_smilies" id="desc_parse_smilies"<!-- IF S_DESC_SMILIES_CHECKED --> checked="checked"<!-- ENDIF --> /> {L_PARSE_SMILIES}</label>&nbsp;<label for="desc_parse_urls"><input type="checkbox" class="radio" name="desc_parse_urls" id="desc_parse_urls"<!-- IF S_DESC_URLS_CHECKED --> checked="checked"<!-- ENDIF --> /> {L_PARSE_URLS}</label></dd>
</dl>
<!-- IF not S_SPECIAL_GROUP -->
<dl>
- <dt><label for="group_type1">{L_GROUP_TYPE}:</label><br /><span>{L_GROUP_TYPE_EXPLAIN}</span></dt>
+ <dt><label for="group_type1">{L_GROUP_TYPE}{L_COLON}</label><br /><span>{L_GROUP_TYPE_EXPLAIN}</span></dt>
<dd>
<label for="group_type1"><input type="radio" class="radio" name="group_type" id="group_type1" value="{GROUP_TYPE_FREE}"{GROUP_FREE} /> {L_GROUP_OPEN}</label>
<label for="group_type2"><input type="radio" class="radio" name="group_type" id="group_type2" value="{GROUP_TYPE_OPEN}"{GROUP_OPEN} /> {L_GROUP_REQUEST}</label>
@@ -44,34 +44,37 @@
<!-- ENDIF -->
</fieldset>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<div class="panel">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<h3>{L_GROUP_SETTINGS_SAVE}</h3>
<fieldset>
<dl>
- <dt><label for="group_colour">{L_GROUP_COLOR}:</label><br /><span>{L_GROUP_COLOR_EXPLAIN}</span></dt>
- <dd><input name="group_colour" type="text" id="group_colour" value="{GROUP_COLOUR}" size="6" maxlength="6" class="inputbox narrow" /> <span style="background-color: #{GROUP_COLOUR};">&nbsp;&nbsp;&nbsp;</span> [ <a href="{U_SWATCH}" onclick="popup(this.href, 636, 150, '_swatch'); return false;">{L_COLOUR_SWATCH}</a> ]</dd>
+ <dt><label for="group_colour">{L_GROUP_COLOR}{L_COLON}</label><br /><span>{L_GROUP_COLOR_EXPLAIN}</span></dt>
+ <dd>
+ <input name="group_colour" type="text" id="group_colour" value="{GROUP_COLOUR}" size="6" maxlength="6" class="inputbox narrow" />
+ <span style="background-color: #{GROUP_COLOUR};">&nbsp;&nbsp;&nbsp;</span>
+ [ <a href="#" id="color_palette_toggle">{L_COLOUR_SWATCH}</a> ]
+ <div id="color_palette_placeholder" class="hidden" data-orientation="h" data-height="12" data-width="15" data-target="#group_colour"></div>
+ </dd>
</dl>
<dl>
- <dt><label for="group_rank">{L_GROUP_RANK}:</label></dt>
+ <dt><label for="group_rank">{L_GROUP_RANK}{L_COLON}</label></dt>
<dd><select name="group_rank" id="group_rank">{S_RANK_OPTIONS}</select></dd>
</dl>
</fieldset>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<!-- INCLUDE ucp_avatar_options.html -->
<fieldset class="submit-buttons">
{S_HIDDEN_FIELDS}
- <!-- IF S_DISPLAY_GALLERY --><input type="submit" name="display_gallery" value="{L_DISPLAY_GALLERY}" class="button2" />&nbsp; <!-- ENDIF -->
- <!-- IF S_IN_AVATAR_GALLERY --><input type="submit" name="cancel" value="{L_CANCEL}" class="button2" />&nbsp; <!-- ELSE -->
- <input type="reset" value="{L_RESET}" name="reset" class="button2" />&nbsp; <!-- ENDIF -->
+ <input type="reset" value="{L_RESET}" name="reset" class="button2" />&nbsp;
<input type="submit" name="update" value="{L_SUBMIT}" class="button1" />
{S_FORM_TOKEN}
</fieldset>
@@ -79,7 +82,7 @@
<!-- ELSEIF S_LIST -->
<!-- IF .leader -->
- <table class="table1" cellspacing="1">
+ <table class="table1">
<thead>
<tr>
<th class="name">{L_GROUP_LEAD}</th>
@@ -105,7 +108,7 @@
<!-- BEGIN member -->
<!-- IF member.S_PENDING -->
- <table class="table1" cellspacing="1">
+ <table class="table1">
<thead>
<tr>
<th class="name">{L_GROUP_PENDING}</th>
@@ -121,7 +124,7 @@
</tbody>
</table>
<!-- ENDIF -->
- <table class="table1" cellspacing="1">
+ <table class="table1">
<thead>
<tr>
<th class="name">{L_GROUP_APPROVED}</th>
@@ -142,7 +145,7 @@
</tr>
<!-- ENDIF -->
<!-- BEGINELSE -->
- <table class="table1" cellspacing="1">
+ <table class="table1">
<thead>
<tr>
<th class="name">{L_MEMBERS}</th>
@@ -156,13 +159,15 @@
</tbody>
</table>
- <ul class="linklist">
- <li class="leftside pagination">
- <!-- IF PAGINATION --><a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{S_ON_PAGE}</a> &bull; <span>{PAGINATION}</span><!-- ELSE -->{S_ON_PAGE}<!-- ENDIF -->
- </li>
- </ul>
+ <!-- IF .pagination -->
+ <div class="action-bar bottom">
+ <div class="pagination">
+ <!-- INCLUDE pagination.html -->
+ </div>
+ </div>
+ <!-- ENDIF -->
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<fieldset class="display-actions">
@@ -172,7 +177,7 @@
</fieldset>
<div class="panel">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<h3>{L_ADD_USERS}</h3>
@@ -180,20 +185,20 @@
<fieldset>
<dl>
- <dt><label for="default0">{L_USER_GROUP_DEFAULT}:</label><br /><span>{L_USER_GROUP_DEFAULT_EXPLAIN}</span></dt>
+ <dt><label for="default0">{L_USER_GROUP_DEFAULT}{L_COLON}</label><br /><span>{L_USER_GROUP_DEFAULT_EXPLAIN}</span></dt>
<dd>
<label for="default1"><input type="radio" name="default" id="default1" value="1" /> {L_YES}</label>
<label for="default0"><input type="radio" name="default" id="default0" value="0" checked="checked" /> {L_NO}</label>
</dd>
</dl>
<dl>
- <dt><label for="usernames">{L_USERNAME}:</label><br /><span>{L_USERNAMES_EXPLAIN}</span></dt>
+ <dt><label for="usernames">{L_USERNAME}{L_COLON}</label><br /><span>{L_USERNAMES_EXPLAIN}</span></dt>
<dd><textarea name="usernames" id="usernames" rows="3" cols="30" class="inputbox"></textarea></dd>
<dd><strong><a href="{U_FIND_USERNAME}" onclick="find_username(this.href); return false;">{L_FIND_USERNAME}</a></strong></dd>
</dl>
</fieldset>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<fieldset class="submit-buttons">
@@ -204,21 +209,25 @@
<!-- ELSE -->
<!-- IF .leader -->
- <ul class="topiclist">
+ <ul class="topiclist two-long-columns">
<li class="header">
<dl>
- <dt>{L_GROUP_LEADER}</dt>
+ <dt><div class="list-inner">{L_GROUP_LEADER}</div></dt>
<dd class="info"><span>{L_OPTIONS}</span></dd>
</dl>
</li>
</ul>
- <ul class="topiclist cplist">
+ <ul class="topiclist cplist two-long-columns responsive-show-all">
<!-- BEGIN leader -->
<li class="row<!-- IF attachrow.S_ROW_COUNT is odd --> bg1<!-- ELSE --> bg2<!-- ENDIF -->">
<dl>
- <dt><a href="{leader.U_EDIT}" class="topictitle"<!-- IF leader.GROUP_COLOUR --> style="color: #{leader.GROUP_COLOUR};"<!-- ENDIF -->>{leader.GROUP_NAME}</a>
- <!-- IF leader.GROUP_DESC --><br />{leader.GROUP_DESC}<!-- ENDIF --></dt>
+ <dt>
+ <div class="list-inner">
+ <a href="{leader.U_EDIT}" class="topictitle"<!-- IF leader.GROUP_COLOUR --> style="color: #{leader.GROUP_COLOUR};"<!-- ENDIF -->>{leader.GROUP_NAME}</a>
+ <!-- IF leader.GROUP_DESC --><br />{leader.GROUP_DESC}<!-- ENDIF -->
+ </div>
+ </dt>
<dd class="option"><span><a href="{leader.U_EDIT}" >{L_EDIT}</a></span></dd>
<dd class="option"><span><a href="{leader.U_LIST}">{L_GROUP_LIST}</a></span></dd>
</dl>
@@ -229,10 +238,10 @@
<p><strong>{L_NO_LEADERS}</strong></p>
<!-- ENDIF -->
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<!-- ENDIF -->
</form>
-<!-- INCLUDE ucp_footer.html --> \ No newline at end of file
+<!-- INCLUDE ucp_footer.html -->
diff --git a/phpBB/styles/prosilver/template/ucp_groups_membership.html b/phpBB/styles/prosilver/template/ucp_groups_membership.html
index ef595dd62d..d7df3b02c2 100644
--- a/phpBB/styles/prosilver/template/ucp_groups_membership.html
+++ b/phpBB/styles/prosilver/template/ucp_groups_membership.html
@@ -5,20 +5,20 @@
<form id="ucp" method="post" action="{S_UCP_ACTION}"{S_FORM_ENCTYPE}>
<div class="panel">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<p>{L_GROUPS_EXPLAIN}</p>
<!-- DEFINE $SHOW_BUTTONS = 0 -->
<!-- IF .leader -->
- <ul class="topiclist">
+ <ul class="topiclist two-columns">
<li class="header">
<dl>
- <dt>{L_GROUP_LEADER}</dt>
+ <dt><div class="list-inner">{L_GROUP_LEADER}</div></dt>
<dd class="mark">{L_SELECT}</dd>
</dl>
</li>
</ul>
- <ul class="topiclist cplist">
+ <ul class="topiclist cplist two-columns">
<!-- BEGIN leader -->
<!-- IF not leader.GROUP_SPECIAL -->
@@ -26,10 +26,13 @@
<!-- ENDIF -->
<li class="row<!-- IF leader.S_ROW_COUNT is odd --> bg1<!-- ELSE --> bg2<!-- ENDIF -->">
<dl>
- <dt><!-- IF S_CHANGE_DEFAULT --><input title="{L_CHANGE_DEFAULT_GROUP}" type="radio" name="default"<!-- IF leader.S_GROUP_DEFAULT --> checked="checked"<!-- ENDIF --> value="{leader.GROUP_ID}" /> <!-- ENDIF -->
- <a href="{leader.U_VIEW_GROUP}" class="forumtitle"<!-- IF leader.GROUP_COLOUR --> style="color:#{leader.GROUP_COLOUR}"<!-- ENDIF -->>{leader.GROUP_NAME}</a>
- <!-- IF leader.GROUP_DESC --><br />{leader.GROUP_DESC}<!-- ENDIF -->
- <!-- IF not leader.GROUP_SPECIAL --><br /><i>{leader.GROUP_STATUS}</i><!-- ENDIF -->
+ <dt>
+ <div class="list-inner">
+ <!-- IF S_CHANGE_DEFAULT --><input title="{L_CHANGE_DEFAULT_GROUP}" type="radio" name="default"<!-- IF leader.S_GROUP_DEFAULT --> checked="checked"<!-- ENDIF --> value="{leader.GROUP_ID}" /> <!-- ENDIF -->
+ <a href="{leader.U_VIEW_GROUP}" class="forumtitle"<!-- IF leader.GROUP_COLOUR --> style="color:#{leader.GROUP_COLOUR}"<!-- ENDIF -->>{leader.GROUP_NAME}</a>
+ <!-- IF leader.GROUP_DESC --><br />{leader.GROUP_DESC}<!-- ENDIF -->
+ <!-- IF not leader.GROUP_SPECIAL --><br /><i>{leader.GROUP_STATUS}</i><!-- ENDIF -->
+ </div>
</dt>
<dd class="mark"><input type="radio" name="selected" value="{leader.GROUP_ID}" <!-- IF leader.GROUP_SPECIAL -->disabled="disabled"<!-- ENDIF --> /></dd>
</dl>
@@ -39,15 +42,15 @@
<!-- ENDIF -->
<!-- IF .member -->
- <ul class="topiclist">
+ <ul class="topiclist two-columns">
<li class="header">
<dl>
- <dt>{L_GROUP_MEMBER}</dt>
+ <dt><div class="list-inner">{L_GROUP_MEMBER}</div></dt>
<dd class="mark">{L_SELECT}</dd>
</dl>
</li>
</ul>
- <ul class="topiclist cplist">
+ <ul class="topiclist cplist two-columns">
<!-- BEGIN member -->
<!-- IF not member.GROUP_SPECIAL -->
@@ -55,10 +58,13 @@
<!-- ENDIF -->
<li class="row<!-- IF member.S_ROW_COUNT is odd --> bg1<!-- ELSE --> bg2<!-- ENDIF -->">
<dl>
- <dt><!-- IF S_CHANGE_DEFAULT --><input title="{L_CHANGE_DEFAULT_GROUP}" type="radio" name="default"<!-- IF member.S_GROUP_DEFAULT --> checked="checked"<!-- ENDIF --> value="{member.GROUP_ID}" /> <!-- ENDIF -->
- <a href="{member.U_VIEW_GROUP}" class="forumtitle"<!-- IF member.GROUP_COLOUR --> style="color:#{member.GROUP_COLOUR}"<!-- ENDIF -->>{member.GROUP_NAME}</a>
- <!-- IF member.GROUP_DESC --><br />{member.GROUP_DESC}<!-- ENDIF -->
- <!-- IF not member.GROUP_SPECIAL --><br /><i>{member.GROUP_STATUS}</i><!-- ENDIF -->
+ <dt>
+ <div class="list-inner">
+ <!-- IF S_CHANGE_DEFAULT --><input title="{L_CHANGE_DEFAULT_GROUP}" type="radio" name="default"<!-- IF member.S_GROUP_DEFAULT --> checked="checked"<!-- ENDIF --> value="{member.GROUP_ID}" /> <!-- ENDIF -->
+ <a href="{member.U_VIEW_GROUP}" class="forumtitle"<!-- IF member.GROUP_COLOUR --> style="color:#{member.GROUP_COLOUR}"<!-- ENDIF -->>{member.GROUP_NAME}</a>
+ <!-- IF member.GROUP_DESC --><br />{member.GROUP_DESC}<!-- ENDIF -->
+ <!-- IF not member.GROUP_SPECIAL --><br /><i>{member.GROUP_STATUS}</i><!-- ENDIF -->
+ </div>
</dt>
<dd class="mark"><input type="radio" name="selected" value="{member.GROUP_ID}" <!-- IF member.GROUP_SPECIAL -->disabled="disabled"<!-- ENDIF --> /></dd>
</dl>
@@ -66,21 +72,21 @@
<!-- END member -->
</ul>
<!-- ENDIF -->
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<!-- IF .pending -->
<div class="panel">
- <div class="inner"><span class="corners-top"><span></span></span>
- <ul class="topiclist">
+ <div class="inner">
+ <ul class="topiclist two-columns">
<li class="header">
<dl>
- <dt>{L_GROUP_PENDING}</dt>
+ <dt><div class="list-inner">{L_GROUP_PENDING}</div></dt>
<dd class="mark">{L_SELECT}</dd>
</dl>
</li>
</ul>
- <ul class="topiclist cplist">
+ <ul class="topiclist cplist two-columns">
<!-- BEGIN pending -->
<!-- IF not pending.GROUP_SPECIAL -->
@@ -89,30 +95,32 @@
<li class="row<!-- IF pending.S_ROW_COUNT is odd --> bg1<!-- ELSE --> bg2<!-- ENDIF -->">
<dl>
<dt>
- <a href="{pending.U_VIEW_GROUP}" class="forumtitle"<!-- IF pending.GROUP_COLOUR --> style="color:#{pending.GROUP_COLOUR}"<!-- ENDIF -->>{pending.GROUP_NAME}</a>
- <!-- IF pending.GROUP_DESC --><br />{pending.GROUP_DESC}<!-- ENDIF -->
- <!-- IF not pending.GROUP_SPECIAL --><br /><i>{pending.GROUP_STATUS}</i><!-- ENDIF -->
+ <div class="list-inner">
+ <a href="{pending.U_VIEW_GROUP}" class="forumtitle"<!-- IF pending.GROUP_COLOUR --> style="color:#{pending.GROUP_COLOUR}"<!-- ENDIF -->>{pending.GROUP_NAME}</a>
+ <!-- IF pending.GROUP_DESC --><br />{pending.GROUP_DESC}<!-- ENDIF -->
+ <!-- IF not pending.GROUP_SPECIAL --><br /><i>{pending.GROUP_STATUS}</i><!-- ENDIF -->
+ </div>
</dt>
<dd class="mark"><input type="radio" name="selected" value="{pending.GROUP_ID}" <!-- IF pending.GROUP_SPECIAL -->disabled="disabled"<!-- ENDIF --> /></dd>
</dl>
</li>
<!-- END pending -->
</ul>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<!-- ENDIF -->
<!-- IF .nonmember -->
<div class="panel">
- <div class="inner"><span class="corners-top"><span></span></span>
- <ul class="topiclist">
+ <div class="inner">
+ <ul class="topiclist two-columns">
<li class="header">
<dl>
- <dt>{L_GROUP_NONMEMBER}</dt>
+ <dt><div class="list-inner">{L_GROUP_NONMEMBER}</div></dt>
<dd class="mark">{L_SELECT}</dd>
</dl>
</li>
</ul>
- <ul class="topiclist cplist">
+ <ul class="topiclist cplist two-columns">
<!-- BEGIN nonmember -->
<!-- IF nonmember.S_CAN_JOIN -->
@@ -121,16 +129,18 @@
<li class="row<!-- IF nonmember.S_ROW_COUNT is odd --> bg1<!-- ELSE --> bg2<!-- ENDIF -->">
<dl>
<dt>
- <a href="{nonmember.U_VIEW_GROUP}" class="forumtitle"<!-- IF nonmember.GROUP_COLOUR --> style="color:#{nonmember.GROUP_COLOUR}"<!-- ENDIF -->>{nonmember.GROUP_NAME}</a>
- <!-- IF nonmember.GROUP_DESC --><br />{nonmember.GROUP_DESC}<!-- ENDIF -->
- <!-- IF not nonmember.GROUP_SPECIAL --><br /><i>{nonmember.GROUP_STATUS}</i><!-- ENDIF -->
+ <div class="list-inner">
+ <a href="{nonmember.U_VIEW_GROUP}" class="forumtitle"<!-- IF nonmember.GROUP_COLOUR --> style="color:#{nonmember.GROUP_COLOUR}"<!-- ENDIF -->>{nonmember.GROUP_NAME}</a>
+ <!-- IF nonmember.GROUP_DESC --><br />{nonmember.GROUP_DESC}<!-- ENDIF -->
+ <!-- IF not nonmember.GROUP_SPECIAL --><br /><i>{nonmember.GROUP_STATUS}</i><!-- ENDIF -->
+ </div>
</dt>
<dd class="mark"><input type="radio" name="selected" value="{nonmember.GROUP_ID}" <!-- IF not nonmember.S_CAN_JOIN -->disabled="disabled"<!-- ENDIF --> /></dd>
</dl>
</li>
<!-- END nonmember -->
</ul>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<!-- ENDIF -->
@@ -146,7 +156,7 @@
<!-- IF $SHOW_BUTTONS eq 1 -->
<div class="right-box">
- <label for="action">{L_SELECT}:</label>
+ <label for="action">{L_SELECT}{L_COLON}</label>
<select name="action" id="action">
<option value="join">{L_JOIN_SELECTED}</option>
<option value="resign">{L_RESIGN_SELECTED}</option>
@@ -161,4 +171,4 @@
</form>
-<!-- INCLUDE ucp_footer.html --> \ No newline at end of file
+<!-- INCLUDE ucp_footer.html -->
diff --git a/phpBB/styles/prosilver/template/ucp_header.html b/phpBB/styles/prosilver/template/ucp_header.html
index 4d008564c4..a17f145cbc 100644
--- a/phpBB/styles/prosilver/template/ucp_header.html
+++ b/phpBB/styles/prosilver/template/ucp_header.html
@@ -1,11 +1,11 @@
<!-- INCLUDE overall_header.html -->
-<h2>{L_UCP}</h2>
+<h2 class="ucp-title">{L_UCP}</h2>
<div id="tabs">
<ul>
<!-- BEGIN t_block1 -->
- <li <!-- IF t_block1.S_SELECTED -->class="activetab"<!-- ENDIF -->><a href="{t_block1.U_TITLE}"><span>{t_block1.L_TITLE}</span></a></li>
+ <li class="tab<!-- IF t_block1.S_SELECTED --> activetab<!-- ENDIF -->"><a href="{t_block1.U_TITLE}">{t_block1.L_TITLE}</a></li>
<!-- END t_block1 -->
</ul>
</div>
@@ -15,12 +15,12 @@
<!-- ENDIF -->
<div class="panel bg3">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div style="width: 100%;">
<div id="cp-menu">
- <div id="navigation">
+ <div id="navigation" role="navigation">
<!-- IF S_PRIVMSGS -->
<!-- BEGIN t_block2 -->
@@ -63,7 +63,7 @@
<!-- IF .friends_online or .friends_offline -->
<div class="cp-mini">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<dl class="mini">
<dt>{L_FRIENDS}</dt>
@@ -77,13 +77,13 @@
<!-- END friends_offline -->
</dl>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<!-- ENDIF -->
<!-- IF S_SHOW_COLOUR_LEGEND -->
<div class="cp-mini">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<dl class="mini">
<dt>{L_MESSAGE_COLOURS}</dt>
@@ -92,10 +92,10 @@
<!-- END pm_colour_info -->
</dl>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<!-- ENDIF -->
</div>
- <div id="cp-main" class="ucp-main">
+ <div id="cp-main" class="ucp-main panel-container">
diff --git a/phpBB/styles/prosilver/template/ucp_login_link.html b/phpBB/styles/prosilver/template/ucp_login_link.html
new file mode 100644
index 0000000000..be173318cb
--- /dev/null
+++ b/phpBB/styles/prosilver/template/ucp_login_link.html
@@ -0,0 +1,58 @@
+<!-- INCLUDE overall_header.html -->
+
+<div class="panel">
+ <div class="inner">
+
+ <h2>{SITENAME} - {L_LOGIN_LINK}</h2>
+
+ <p>{L_LOGIN_LINK_EXPLAIN}</p>
+
+ <!-- IF LOGIN_LINK_ERROR --><div class="content">
+ <div class="error">{LOGIN_LINK_ERROR}</div>
+ </div><!-- ENDIF -->
+
+ <div class="content">
+ <h2>{L_REGISTER}</h2>
+
+ <form action="{REGISTER_ACTION}" method="post" id="register">
+ <fieldset class="fields1">
+ <dl>
+ <dt>&nbsp;</dt>
+ <dd>{S_HIDDEN_FIELDS}<input type="submit" name="register" tabindex="1" value="{L_REGISTER}" class="button1" /></dd>
+ </dl>
+ </fieldset>
+ </form>
+ </div>
+
+ <div class="content">
+ <h2>{L_LOGIN}</h2>
+
+ <form action="{LOGIN_ACTION}" method="post" id="login">
+ <fieldset class="fields1">
+ <!-- IF LOGIN_ERROR --><div class="error">{LOGIN_ERROR}</div><!-- ENDIF -->
+ <dl>
+ <dt><label for="{USERNAME_CREDENTIAL}">{L_USERNAME}{L_COLON}</label></dt>
+ <dd><input type="text" tabindex="2" name="{USERNAME_CREDENTIAL}" id="{USERNAME_CREDENTIAL}" size="25" value="{LOGIN_USERNAME}" class="inputbox autowidth" /></dd>
+ </dl>
+ <dl>
+ <dt><label for="{PASSWORD_CREDENTIAL}">{L_PASSWORD}{L_COLON}</label></dt>
+ <dd><input type="password" tabindex="3" id="{PASSWORD_CREDENTIAL}" name="{PASSWORD_CREDENTIAL}" size="25" class="inputbox autowidth" autocomplete="off" /></dd>
+ </dl>
+ <!-- IF CAPTCHA_TEMPLATE and S_CONFIRM_CODE -->
+ <!-- DEFINE $CAPTCHA_TAB_INDEX = 4 -->
+ <!-- INCLUDE {CAPTCHA_TEMPLATE} -->
+ <!-- ENDIF -->
+
+ {S_LOGIN_REDIRECT}
+ <dl>
+ <dt>&nbsp;</dt>
+ <dd>{S_HIDDEN_FIELDS}<input type="submit" name="login" tabindex="5" value="{L_LOGIN}" class="button1" /></dd>
+ </dl>
+ </fieldset>
+ </form>
+ </div>
+
+ </div>
+</div>
+
+<!-- INCLUDE overall_footer.html -->
diff --git a/phpBB/styles/prosilver/template/ucp_main_bookmarks.html b/phpBB/styles/prosilver/template/ucp_main_bookmarks.html
index 9d7c4ce1aa..f74728bdb3 100644
--- a/phpBB/styles/prosilver/template/ucp_main_bookmarks.html
+++ b/phpBB/styles/prosilver/template/ucp_main_bookmarks.html
@@ -5,7 +5,7 @@
<h2>{L_TITLE}</h2>
<div class="panel">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<p>{L_BOOKMARKS_EXPLAIN}</p>
@@ -14,33 +14,60 @@
<!-- ELSE -->
<!-- IF .topicrow -->
- <ul class="topiclist">
+ <ul class="topiclist missing-column">
<li class="header">
<dl class="icon">
- <dt>{L_BOOKMARKS}</dt>
+ <dt><div class="list-inner">{L_BOOKMARKS}</div></dt>
<dd class="lastpost"><span>{L_LAST_POST}</span></dd>
+ <dd class="mark">{L_MARK}</dd>
</dl>
</li>
</ul>
- <ul class="topiclist cplist">
+ <ul class="topiclist cplist missing-column">
<!-- BEGIN topicrow -->
<li class="row<!-- IF topicrow.S_TOPIC_REPORTED --> reported<!-- ELSEIF topicrow.S_ROW_COUNT is odd --> bg1<!-- ELSE --> bg2<!-- ENDIF -->">
<!-- IF topicrow.S_DELETED_TOPIC -->
- <dl><dt><strong>{L_DELETED_TOPIC}</strong></dt>
- <dd class="mark"><input type="checkbox" name="t[{topicrow.TOPIC_ID}]" id="t{topicrow.TOPIC_ID}" /></dd>
+ <dl>
+ <dt><div class="list-inner"><strong>{L_DELETED_TOPIC}</strong></div></dt>
+ <dd class="lastpost"><span>&nbsp;</span></dd>
+ <dd class="mark"><input type="checkbox" name="t[{topicrow.TOPIC_ID}]" id="t{topicrow.TOPIC_ID}" /></dd>
</dl>
<!-- ELSE -->
- <dl class="icon" style="background-image: url({topicrow.TOPIC_FOLDER_IMG_SRC}); background-repeat: no-repeat;">
+ <dl class="icon {topicrow.TOPIC_IMG_STYLE}">
<dt<!-- IF topicrow.TOPIC_ICON_IMG --> style="background-image: url({T_ICONS_PATH}{topicrow.TOPIC_ICON_IMG}); background-repeat: no-repeat;"<!-- ENDIF --> title="{topicrow.TOPIC_FOLDER_IMG_ALT}">
- <!-- IF topicrow.S_UNREAD_TOPIC --><a href="{topicrow.U_NEWEST_POST}">{NEWEST_POST_IMG}</a> <!-- ENDIF --><a href="{topicrow.U_VIEW_TOPIC}" class="topictitle">{topicrow.TOPIC_TITLE}</a>
- <!-- IF topicrow.S_TOPIC_UNAPPROVED or topicrow.S_POSTS_UNAPPROVED --><a href="{topicrow.U_MCP_QUEUE}">{topicrow.UNAPPROVED_IMG}</a> <!-- ENDIF -->
- <!-- IF topicrow.S_TOPIC_REPORTED --><a href="{topicrow.U_MCP_REPORT}">{REPORTED_IMG}</a><!-- ENDIF --><br />
- <!-- IF topicrow.PAGINATION --><strong class="pagination"><span>{topicrow.PAGINATION}</span></strong><!-- ENDIF -->
- <!-- IF topicrow.ATTACH_ICON_IMG -->{topicrow.ATTACH_ICON_IMG} <!-- ENDIF -->{L_POST_BY_AUTHOR} {topicrow.TOPIC_AUTHOR_FULL} &raquo; {topicrow.FIRST_POST_TIME}
+ <!-- IF topicrow.S_UNREAD_TOPIC --><a href="{topicrow.U_NEWEST_POST}" class="icon-link"></a><!-- ENDIF -->
+ <div class="list-inner">
+ <!-- IF topicrow.S_UNREAD_TOPIC --><a href="{topicrow.U_NEWEST_POST}">{NEWEST_POST_IMG}</a> <!-- ENDIF --><a href="{topicrow.U_VIEW_TOPIC}" class="topictitle">{topicrow.TOPIC_TITLE}</a>
+ <!-- IF topicrow.S_TOPIC_UNAPPROVED or topicrow.S_POSTS_UNAPPROVED --><a href="{topicrow.U_MCP_QUEUE}">{topicrow.UNAPPROVED_IMG}</a> <!-- ENDIF -->
+ <!-- IF topicrow.S_TOPIC_REPORTED --><a href="{topicrow.U_MCP_REPORT}">{REPORTED_IMG}</a><!-- ENDIF --><br />
+ <!-- IF .topicrow.pagination -->
+ <div class="pagination">
+ <ul>
+ <!-- BEGIN pagination -->
+ <!-- IF topicrow.pagination.S_IS_PREV -->
+ <!-- ELSEIF topicrow.pagination.S_IS_CURRENT --><li class="active"><span>{topicrow.pagination.PAGE_NUMBER}</span></li>
+ <!-- ELSEIF topicrow.pagination.S_IS_ELLIPSIS --><li class="ellipsis"><span>{L_ELLIPSIS}</span></li>
+ <!-- ELSEIF topicrow.pagination.S_IS_NEXT -->
+ <!-- ELSE --><li><a href="{topicrow.pagination.PAGE_URL}">{topicrow.pagination.PAGE_NUMBER}</a></li>
+ <!-- ENDIF -->
+ <!-- END pagination -->
+ </ul>
+ </div>
+ <!-- ENDIF -->
+ <div class="responsive-hide">
+ <!-- IF topicrow.ATTACH_ICON_IMG -->{topicrow.ATTACH_ICON_IMG} <!-- ENDIF -->
+ {L_POST_BY_AUTHOR} {topicrow.TOPIC_AUTHOR_FULL} &raquo; {topicrow.FIRST_POST_TIME}
+ </div>
+ <div class="responsive-show" style="display: none;">
+ <!-- IF topicrow.ATTACH_ICON_IMG -->{topicrow.ATTACH_ICON_IMG} <!-- ENDIF -->
+ {L_LAST_POST} {L_POST_BY_AUTHOR} {topicrow.LAST_POST_AUTHOR_FULL} &laquo;
+ <a href="{topicrow.U_LAST_POST}" title="{L_GOTO_LAST_POST}">{topicrow.LAST_POST_TIME}</a>
+ </div>
+ </div>
</dt>
<dd class="lastpost"><span><dfn>{L_LAST_POST} </dfn>{L_POST_BY_AUTHOR} {topicrow.LAST_POST_AUTHOR_FULL}
- <a href="{topicrow.U_LAST_POST}">{LAST_POST_IMG}</a> <br />{topicrow.LAST_POST_TIME}</span>
+ <a href="{topicrow.U_LAST_POST}" title="{L_GOTO_LAST_POST}">{LAST_POST_IMG}</a> <br />{topicrow.LAST_POST_TIME}</span>
</dd>
<dd class="mark"><input type="checkbox" name="t[{topicrow.TOPIC_ID}]" id="t{topicrow.TOPIC_ID}" /></dd>
</dl>
@@ -48,19 +75,25 @@
</li>
<!-- END topicrow -->
</ul>
- <ul class="linklist">
- <li class="rightside pagination">
- <!-- IF TOTAL_TOPICS --> {TOTAL_TOPICS} <!-- ENDIF -->
- <!-- IF PAGE_NUMBER --><!-- IF PAGINATION --> &bull; <a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{PAGE_NUMBER}</a> &bull; <span>{PAGINATION}</span><!-- ELSE --> &bull; {PAGE_NUMBER}<!-- ENDIF --><!-- ENDIF -->
- </li>
- </ul>
+
+ <div class="action-bar bottom">
+ <div class="pagination">
+ {TOTAL_TOPICS}
+ <!-- IF .pagination -->
+ <!-- INCLUDE pagination.html -->
+ <!-- ELSE -->
+ &bull; {PAGE_NUMBER}
+ <!-- ENDIF -->
+ </div>
+ </div>
+
<!-- ELSE -->
<p><strong>{L_NO_BOOKMARKS}</strong></p>
<!-- ENDIF -->
<!-- ENDIF -->
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<!-- IF .topicrow and not S_NO_DISPLAY_BOOKMARKS -->
@@ -72,4 +105,4 @@
<!-- ENDIF -->
</form>
-<!-- INCLUDE ucp_footer.html --> \ No newline at end of file
+<!-- INCLUDE ucp_footer.html -->
diff --git a/phpBB/styles/prosilver/template/ucp_main_drafts.html b/phpBB/styles/prosilver/template/ucp_main_drafts.html
index dffe0a37ef..52ad5b503b 100644
--- a/phpBB/styles/prosilver/template/ucp_main_drafts.html
+++ b/phpBB/styles/prosilver/template/ucp_main_drafts.html
@@ -5,14 +5,14 @@
<h2>{L_TITLE}</h2>
<div class="panel">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<p>{L_DRAFTS_EXPLAIN}</p>
<!-- IF S_EDIT_DRAFT -->
<!-- INCLUDE posting_editor.html -->
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<fieldset class="submit-buttons">
@@ -24,26 +24,32 @@
<!-- ELSE -->
<!-- IF .draftrow -->
- <ul class="topiclist">
+ <ul class="topiclist missing-column">
<li class="header">
<dl>
- <dt>{L_DRAFT_TITLE}</dt>
+ <dt><div class="list-inner">{L_DRAFT_TITLE}</div></dt>
<dd class="info"><span>{L_SAVE_DATE}</span></dd>
<dd class="mark">{L_MARK}</dd>
</dl>
</li>
</ul>
- <ul class="topiclist cplist">
+ <ul class="topiclist cplist missing-column">
<!-- BEGIN draftrow -->
<li class="row<!-- IF draftrow.S_ROW_COUNT is odd --> bg1<!-- ELSE --> bg2<!-- ENDIF -->">
<dl>
<dt>
- <a class="topictitle" href="{draftrow.U_VIEW_EDIT}">{draftrow.DRAFT_SUBJECT}</a><br />
- <!-- IF draftrow.S_LINK_TOPIC -->{L_TOPIC}: <a href="{draftrow.U_VIEW}">{draftrow.TITLE}</a>
- <!-- ELSEIF draftrow.S_LINK_FORUM -->{L_FORUM}: <a href="{draftrow.U_VIEW}">{draftrow.TITLE}</a>
- <!-- ELSEIF S_PRIVMSGS -->
- <!-- ELSE -->{L_NO_TOPIC_FORUM}<!-- ENDIF -->
+ <div class="list-inner">
+ <a class="topictitle" href="{draftrow.U_VIEW_EDIT}">{draftrow.DRAFT_SUBJECT}</a><br />
+ <!-- IF draftrow.S_LINK_TOPIC -->{L_TOPIC}{L_COLON} <a href="{draftrow.U_VIEW}">{draftrow.TITLE}</a>
+ <!-- ELSEIF draftrow.S_LINK_FORUM -->{L_FORUM}{L_COLON} <a href="{draftrow.U_VIEW}">{draftrow.TITLE}</a>
+ <!-- ELSEIF S_PRIVMSGS -->
+ <!-- ELSE -->{L_NO_TOPIC_FORUM}<!-- ENDIF -->
+ <div class="responsive-show" style="display: none;">
+ {L_SAVE_DATE}{L_COLON} <strong>{draftrow.DATE}</strong><br />
+ <!-- IF draftrow.U_INSERT --><a href="{draftrow.U_INSERT}">{L_LOAD_DRAFT}</a> &bull; <!-- ENDIF --><a href="{draftrow.U_VIEW_EDIT}">{L_VIEW_EDIT}</a>
+ </div>
+ </div>
</dt>
<dd class="info"><span>{draftrow.DATE}<br /><!-- IF draftrow.U_INSERT --><a href="{draftrow.U_INSERT}">{L_LOAD_DRAFT}</a> &bull; <!-- ENDIF --><a href="{draftrow.U_VIEW_EDIT}">{L_VIEW_EDIT}</a></span></dd>
<dd class="mark"><input type="checkbox" name="d[{draftrow.DRAFT_ID}]" id="d{draftrow.DRAFT_ID}" /></dd>
@@ -55,7 +61,7 @@
<p><strong>{L_NO_SAVED_DRAFTS}</strong></p>
<!-- ENDIF -->
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<!-- IF .draftrow -->
@@ -70,4 +76,4 @@
</form>
-<!-- INCLUDE ucp_footer.html --> \ No newline at end of file
+<!-- INCLUDE ucp_footer.html -->
diff --git a/phpBB/styles/prosilver/template/ucp_main_front.html b/phpBB/styles/prosilver/template/ucp_main_front.html
index 4a6fa3bf86..056ea300d8 100644
--- a/phpBB/styles/prosilver/template/ucp_main_front.html
+++ b/phpBB/styles/prosilver/template/ucp_main_front.html
@@ -3,24 +3,47 @@
<h2>{L_TITLE}</h2>
<div class="panel">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<p>{L_UCP_WELCOME}</p>
<!-- IF .topicrow -->
<h3>{L_IMPORTANT_NEWS}</h3>
- <ul class="topiclist cplist">
+ <ul class="topiclist cplist two-long-columns">
<!-- BEGIN topicrow -->
<li class="row<!-- IF topicrow.S_ROW_COUNT is odd --> bg1<!-- ELSE --> bg2<!-- ENDIF -->">
- <dl class="icon" style="background-image: url({topicrow.TOPIC_FOLDER_IMG_SRC}); background-repeat: no-repeat;">
+ <dl class="icon {topicrow.TOPIC_IMG_STYLE}">
<dt <!-- IF topicrow.TOPIC_ICON_IMG -->style="background-image: url({T_ICONS_PATH}{topicrow.TOPIC_ICON_IMG}); background-repeat: no-repeat;"<!-- ENDIF -->>
- <!-- IF topicrow.S_UNREAD --><a href="{topicrow.U_NEWEST_POST}">{NEWEST_POST_IMG}</a> <!-- ENDIF --><a href="{topicrow.U_VIEW_TOPIC}" class="topictitle">{topicrow.TOPIC_TITLE}</a><br />
- <!-- IF topicrow.PAGINATION --><strong class="pagination"><span>{topicrow.PAGINATION}</span></strong><!-- ENDIF -->
- <!-- IF topicrow.ATTACH_ICON_IMG -->{topicrow.ATTACH_ICON_IMG} <!-- ENDIF -->{L_POST_BY_AUTHOR} {topicrow.TOPIC_AUTHOR_FULL} &raquo; {topicrow.FIRST_POST_TIME}
+ <!-- IF topicrow.S_UNREAD_TOPIC --><a href="{topicrow.U_NEWEST_POST}" class="icon-link"></a><!-- ENDIF -->
+ <div class="list-inner">
+ <!-- IF topicrow.S_UNREAD --><a href="{topicrow.U_NEWEST_POST}">{NEWEST_POST_IMG}</a> <!-- ENDIF --><a href="{topicrow.U_VIEW_TOPIC}" class="topictitle">{topicrow.TOPIC_TITLE}</a><br />
+ <!-- IF .topicrow.pagination -->
+ <div class="pagination">
+ <ul>
+ <!-- BEGIN pagination -->
+ <!-- IF topicrow.pagination.S_IS_PREV -->
+ <!-- ELSEIF topicrow.pagination.S_IS_CURRENT --><li class="active"><span>{topicrow.pagination.PAGE_NUMBER}</span></li>
+ <!-- ELSEIF topicrow.pagination.S_IS_ELLIPSIS --><li class="ellipsis"><span>{L_ELLIPSIS}</span></li>
+ <!-- ELSEIF topicrow.pagination.S_IS_NEXT -->
+ <!-- ELSE --><li><a href="{topicrow.pagination.PAGE_URL}">{topicrow.pagination.PAGE_NUMBER}</a></li>
+ <!-- ENDIF -->
+ <!-- END pagination -->
+ </ul>
+ </div>
+ <!-- ENDIF -->
+ <div class="responsive-hide">
+ <!-- IF topicrow.ATTACH_ICON_IMG -->{topicrow.ATTACH_ICON_IMG} <!-- ENDIF -->
+ {L_POST_BY_AUTHOR} {topicrow.TOPIC_AUTHOR_FULL} &raquo; {topicrow.FIRST_POST_TIME}
+ </div>
+ <div class="responsive-show" style="display: none;">
+ <!-- IF topicrow.ATTACH_ICON_IMG -->{topicrow.ATTACH_ICON_IMG} <!-- ENDIF -->
+ {L_LAST_POST} {L_POST_BY_AUTHOR} {topicrow.LAST_POST_AUTHOR_FULL} &laquo; <a href="{topicrow.U_LAST_POST}" title="{L_GOTO_LAST_POST}">{topicrow.LAST_POST_TIME}</a>
+ </div>
+ </div>
</dt>
<dd class="lastpost"><span>{L_LAST_POST} {L_POST_BY_AUTHOR} {topicrow.LAST_POST_AUTHOR_FULL}
- <a href="{topicrow.U_LAST_POST}">{LAST_POST_IMG}</a> <br />{topicrow.LAST_POST_TIME}</span>
+ <a href="{topicrow.U_LAST_POST}" title="{L_GOTO_LAST_POST}">{LAST_POST_IMG}</a> <br />{topicrow.LAST_POST_TIME}</span>
</dd>
</dl>
</li>
@@ -30,16 +53,20 @@
<h3>{L_YOUR_DETAILS}</h3>
+<!-- EVENT ucp_main_front_user_activity_before -->
<dl class="details">
- <dt>{L_JOINED}:</dt> <dd>{JOINED}</dd>
- <dt>{L_VISITED}:</dt> <dd>{LAST_VISIT_YOU}</dd>
- <dt>{L_TOTAL_POSTS}:</dt> <dd><!-- IF POSTS_PCT -->{POSTS}<!-- IF S_DISPLAY_SEARCH --> | <strong><a href="{U_SEARCH_USER}">{L_SEARCH_YOUR_POSTS}</a></strong><!-- ENDIF --><br />({POSTS_DAY} / {POSTS_PCT})<!-- ELSE -->{POSTS}<!-- ENDIF --></dd>
- <!-- IF ACTIVE_FORUM != '' --><dt>{L_ACTIVE_IN_FORUM}:</dt> <dd><strong><a href="{U_ACTIVE_FORUM}">{ACTIVE_FORUM}</a></strong><br />({ACTIVE_FORUM_POSTS} / {ACTIVE_FORUM_PCT})</dd><!-- ENDIF -->
- <!-- IF ACTIVE_TOPIC != '' --><dt>{L_ACTIVE_IN_TOPIC}:</dt> <dd><strong><a href="{U_ACTIVE_TOPIC}">{ACTIVE_TOPIC}</a></strong><br />({ACTIVE_TOPIC_POSTS} / {ACTIVE_TOPIC_PCT})</dd><!-- ENDIF -->
- <!-- IF WARNINGS --><dt>{L_YOUR_WARNINGS}:</dt> <dd class="error">{WARNING_IMG} [{WARNINGS}]</dd><!-- ENDIF -->
+ <!-- EVENT ucp_main_front_user_activity_prepend -->
+ <dt>{L_JOINED}{L_COLON}</dt> <dd>{JOINED}</dd>
+ <dt>{L_LAST_ACTIVE}{L_COLON}</dt> <dd>{LAST_VISIT_YOU}</dd>
+ <dt>{L_TOTAL_POSTS}{L_COLON}</dt> <dd><!-- IF POSTS_PCT -->{POSTS}<!-- IF S_DISPLAY_SEARCH --> | <strong><a href="{U_SEARCH_USER}">{L_SEARCH_YOUR_POSTS}</a></strong><!-- ENDIF --><br />({POSTS_DAY} / {POSTS_PCT})<!-- ELSE -->{POSTS}<!-- ENDIF --></dd>
+ <!-- IF ACTIVE_FORUM != '' --><dt>{L_ACTIVE_IN_FORUM}{L_COLON}</dt> <dd><strong><a href="{U_ACTIVE_FORUM}">{ACTIVE_FORUM}</a></strong><br />({ACTIVE_FORUM_POSTS} / {ACTIVE_FORUM_PCT})</dd><!-- ENDIF -->
+ <!-- IF ACTIVE_TOPIC != '' --><dt>{L_ACTIVE_IN_TOPIC}{L_COLON}</dt> <dd><strong><a href="{U_ACTIVE_TOPIC}">{ACTIVE_TOPIC}</a></strong><br />({ACTIVE_TOPIC_POSTS} / {ACTIVE_TOPIC_PCT})</dd><!-- ENDIF -->
+ <!-- IF WARNINGS --><dt>{L_YOUR_WARNINGS}{L_COLON}</dt> <dd class="error">{WARNING_IMG} [{WARNINGS}]</dd><!-- ENDIF -->
+ <!-- EVENT ucp_main_front_user_activity_append -->
</dl>
+<!-- EVENT ucp_main_front_user_activity_after -->
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
-<!-- INCLUDE ucp_footer.html --> \ No newline at end of file
+<!-- INCLUDE ucp_footer.html -->
diff --git a/phpBB/styles/prosilver/template/ucp_main_subscribed.html b/phpBB/styles/prosilver/template/ucp_main_subscribed.html
index 210537ced8..2d65b800a0 100644
--- a/phpBB/styles/prosilver/template/ucp_main_subscribed.html
+++ b/phpBB/styles/prosilver/template/ucp_main_subscribed.html
@@ -4,28 +4,39 @@
<h2>{L_TITLE}</h2>
<div class="panel">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<p>{L_WATCHED_EXPLAIN}</p>
<!-- IF .forumrow -->
- <ul class="topiclist">
+ <ul class="topiclist missing-column">
<li class="header">
<dl class="icon">
- <dt>{L_WATCHED_FORUMS}</dt>
- <dd class="lastpost">{L_LAST_POST}</dd>
+ <dt><div class="list-inner">{L_WATCHED_FORUMS}</div></dt>
+ <dd class="lastpost"><span>{L_LAST_POST}</span></dd>
<dd class="mark">{L_MARK}</dd>
</dl>
</li>
</ul>
- <ul class="topiclist cplist">
+ <ul class="topiclist cplist missing-column">
<!-- BEGIN forumrow -->
<li class="row<!-- IF forumrow.S_ROW_COUNT is odd --> bg1<!-- ELSE --> bg2<!-- ENDIF -->">
- <dl class="icon" style="background-image: url({forumrow.FORUM_FOLDER_IMG_SRC}); background-repeat: no-repeat;">
- <dt><a href="{forumrow.U_VIEWFORUM}" class="forumtitle">{forumrow.FORUM_NAME}</a><br />{forumrow.FORUM_DESC}</dt>
+ <dl class="icon {forumrow.FORUM_IMG_STYLE}">
+ <dt>
+ <!-- IF forumrow.S_UNREAD_FORUM --><a href="{forumrow.U_VIEWFORUM}" class="icon-link"></a><!-- ENDIF -->
+ <div class="list-inner">
+ <a href="{forumrow.U_VIEWFORUM}" class="forumtitle">{forumrow.FORUM_NAME}</a><br />
+ {forumrow.FORUM_DESC}
+ <!-- IF forumrow.LAST_POST_TIME -->
+ <div class="responsive-show" style="display: none;">
+ {L_LAST_POST} {L_POST_BY_AUTHOR} {forumrow.LAST_POST_AUTHOR_FULL} &laquo; <a href="{forumrow.U_LAST_POST}">{forumrow.LAST_POST_TIME}</a>
+ </div>
+ <!-- ENDIF -->
+ </div>
+ </dt>
<dd class="lastpost"><!-- IF forumrow.LAST_POST_TIME --><span><dfn>{L_LAST_POST} </dfn>{L_POST_BY_AUTHOR} {forumrow.LAST_POST_AUTHOR_FULL}
- <a href="{topicrow.U_LAST_POST}">{LAST_POST_IMG}</a> <br />{forumrow.LAST_POST_TIME}</span>
+ <a href="{forumrow.U_LAST_POST}">{LAST_POST_IMG}</a> <br />{forumrow.LAST_POST_TIME}</span>
<!-- ELSE -->{L_NO_POSTS}<br />&nbsp;<!-- ENDIF -->
</dd>
<dd class="mark"><input type="checkbox" name="f[{forumrow.FORUM_ID}]" id="f{forumrow.FORUM_ID}" /></dd>
@@ -34,50 +45,94 @@
<!-- END forumrow -->
</ul>
<!-- ELSEIF S_FORUM_NOTIFY -->
+ <ul class="topiclist">
+ <li class="header">
+ <dl class="icon">
+ <dt>{L_WATCHED_FORUMS}</dt>
+ </dl>
+ </li>
+ </ul>
<p><strong>{L_NO_WATCHED_FORUMS}</strong></p>
<!-- ENDIF -->
+ <br />
<!-- IF .topicrow -->
- <ul class="topiclist">
+ <ul class="topiclist missing-column">
<li class="header">
<dl class="icon">
- <dt>{L_WATCHED_TOPICS}</dt>
- <dd class="lastpost">{L_LAST_POST}</dd>
+ <dt><div class="list-inner">{L_WATCHED_TOPICS}</div></dt>
+ <dd class="lastpost"><span>{L_LAST_POST}</span></dd>
<dd class="mark">{L_MARK}</dd>
</dl>
</li>
</ul>
- <ul class="topiclist cplist">
+ <ul class="topiclist cplist missing-column">
<!-- BEGIN topicrow -->
<li class="row<!-- IF topicrow.S_TOPIC_REPORTED --> reported<!-- ELSEIF topicrow.S_ROW_COUNT is odd --> bg1<!-- ELSE --> bg2<!-- ENDIF -->">
- <dl class="icon" style="background-image: url({topicrow.TOPIC_FOLDER_IMG_SRC}); background-repeat: no-repeat;">
+ <dl class="icon {topicrow.TOPIC_IMG_STYLE}">
<dt<!-- IF topicrow.TOPIC_ICON_IMG --> style="background-image: url({T_ICONS_PATH}{topicrow.TOPIC_ICON_IMG}); background-repeat: no-repeat;"<!-- ENDIF --> title="{topicrow.TOPIC_FOLDER_IMG_ALT}">
- <!-- IF topicrow.S_UNREAD_TOPIC --><a href="{topicrow.U_NEWEST_POST}">{NEWEST_POST_IMG}</a> <!-- ENDIF --><a href="{topicrow.U_VIEW_TOPIC}" class="topictitle">{topicrow.TOPIC_TITLE}</a>
- <!-- IF topicrow.S_TOPIC_UNAPPROVED or topicrow.S_POSTS_UNAPPROVED --><a href="{topicrow.U_MCP_QUEUE}">{topicrow.UNAPPROVED_IMG}</a> <!-- ENDIF -->
- <!-- IF topicrow.S_TOPIC_REPORTED --><a href="{topicrow.U_MCP_REPORT}">{REPORTED_IMG}</a><!-- ENDIF --><br />
- <!-- IF topicrow.PAGINATION --><strong class="pagination"><span>{topicrow.PAGINATION}</span></strong><!-- ENDIF -->
- <!-- IF topicrow.ATTACH_ICON_IMG -->{topicrow.ATTACH_ICON_IMG} <!-- ENDIF -->{L_POST_BY_AUTHOR} {topicrow.TOPIC_AUTHOR_FULL} &raquo; {topicrow.FIRST_POST_TIME}
+ <!-- IF topicrow.S_UNREAD_TOPIC --><a href="{topicrow.U_NEWEST_POST}" class="icon-link"></a><!-- ENDIF -->
+ <div class="list-inner">
+ <!-- IF topicrow.S_UNREAD_TOPIC --><a href="{topicrow.U_NEWEST_POST}">{NEWEST_POST_IMG}</a> <!-- ENDIF --><a href="{topicrow.U_VIEW_TOPIC}" class="topictitle">{topicrow.TOPIC_TITLE}</a>
+ <!-- IF topicrow.S_TOPIC_UNAPPROVED or topicrow.S_POSTS_UNAPPROVED --><a href="{topicrow.U_MCP_QUEUE}">{topicrow.UNAPPROVED_IMG}</a> <!-- ENDIF -->
+ <!-- IF topicrow.S_TOPIC_REPORTED --><a href="{topicrow.U_MCP_REPORT}">{REPORTED_IMG}</a><!-- ENDIF --><br />
+ <!-- IF .topicrow.pagination -->
+ <div class="pagination">
+ <ul>
+ <!-- BEGIN pagination -->
+ <!-- IF topicrow.pagination.S_IS_PREV -->
+ <!-- ELSEIF topicrow.pagination.S_IS_CURRENT --><li class="active"><span>{topicrow.pagination.PAGE_NUMBER}</span></li>
+ <!-- ELSEIF topicrow.pagination.S_IS_ELLIPSIS --><li class="ellipsis"><span>{L_ELLIPSIS}</span></li>
+ <!-- ELSEIF topicrow.pagination.S_IS_NEXT -->
+ <!-- ELSE --><li><a href="{topicrow.pagination.PAGE_URL}">{topicrow.pagination.PAGE_NUMBER}</a></li>
+ <!-- ENDIF -->
+ <!-- END pagination -->
+ </ul>
+ </div>
+ <!-- ENDIF -->
+ <div class="responsive-hide">
+ <!-- IF topicrow.ATTACH_ICON_IMG -->{topicrow.ATTACH_ICON_IMG} <!-- ENDIF -->
+ {L_POST_BY_AUTHOR} {topicrow.TOPIC_AUTHOR_FULL} &raquo; {topicrow.FIRST_POST_TIME}
+ </div>
+ <div class="responsive-show" style="display: none;">
+ <!-- IF topicrow.ATTACH_ICON_IMG -->{topicrow.ATTACH_ICON_IMG} <!-- ENDIF -->
+ {L_LAST_POST} {L_POST_BY_AUTHOR} {topicrow.LAST_POST_AUTHOR_FULL} &laquo; <a href="{topicrow.U_LAST_POST}" title="{L_GOTO_LAST_POST}">{topicrow.LAST_POST_TIME}</a>
+ </div>
+ </div>
</dt>
<dd class="lastpost"><span><dfn>{L_LAST_POST} </dfn>{L_POST_BY_AUTHOR} {topicrow.LAST_POST_AUTHOR_FULL}
- <a href="{topicrow.U_LAST_POST}">{LAST_POST_IMG}</a> <br />{topicrow.LAST_POST_TIME}</span>
+ <a href="{topicrow.U_LAST_POST}" title="{L_GOTO_LAST_POST}">{LAST_POST_IMG}</a> <br />{topicrow.LAST_POST_TIME}</span>
</dd>
<dd class="mark"><input type="checkbox" name="t[{topicrow.TOPIC_ID}]" id="t{topicrow.TOPIC_ID}" /></dd>
</dl>
</li>
<!-- END topicrow -->
</ul>
- <ul class="linklist">
- <li class="rightside pagination">
- <!-- IF TOTAL_TOPICS --> {TOTAL_TOPICS} <!-- ENDIF -->
- <!-- IF PAGE_NUMBER --><!-- IF PAGINATION --> &bull; <a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{PAGE_NUMBER}</a> &bull; <span>{PAGINATION}</span><!-- ELSE --> &bull; {PAGE_NUMBER}<!-- ENDIF --><!-- ENDIF -->
- </li>
- </ul>
+
+ <div class="action-bar bottom">
+ <div class="pagination">
+ {TOTAL_TOPICS}
+ <!-- IF .pagination -->
+ <!-- INCLUDE pagination.html -->
+ <!-- ELSE -->
+ &bull; {PAGE_NUMBER}
+ <!-- ENDIF -->
+ </div>
+ </div>
+
<!-- ELSEIF S_TOPIC_NOTIFY -->
+ <ul class="topiclist">
+ <li class="header">
+ <dl class="icon">
+ <dt>{L_WATCHED_TOPICS}</dt>
+ </dl>
+ </li>
+ </ul>
<p><strong>{L_NO_WATCHED_TOPICS}</strong></p>
<!-- ENDIF -->
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<!-- IF .topicrow or .forumrow -->
@@ -89,4 +144,4 @@
<!-- ENDIF -->
</form>
-<!-- INCLUDE ucp_footer.html --> \ No newline at end of file
+<!-- INCLUDE ucp_footer.html -->
diff --git a/phpBB/styles/prosilver/template/ucp_notifications.html b/phpBB/styles/prosilver/template/ucp_notifications.html
new file mode 100644
index 0000000000..500bae0c47
--- /dev/null
+++ b/phpBB/styles/prosilver/template/ucp_notifications.html
@@ -0,0 +1,122 @@
+<!-- INCLUDE ucp_header.html -->
+
+<form id="ucp" method="post" action="{S_UCP_ACTION}"{S_FORM_ENCTYPE}>
+
+<h2>{TITLE}</h2>
+<div class="panel">
+ <div class="inner">
+
+ <p>{TITLE_EXPLAIN}</p>
+
+ <!-- IF MODE == 'notification_options' -->
+ <table class="table1">
+ <thead>
+ <tr>
+ <th>{L_NOTIFICATION_TYPE}</th>
+ <!-- BEGIN notification_methods -->
+ <th class="mark">{notification_methods.NAME}</th>
+ <!-- END notification_methods -->
+ <th class="mark">{L_NOTIFICATIONS}</th>
+ </tr>
+ </thead>
+ <tbody>
+ <!-- BEGIN notification_types -->
+ <!-- IF notification_types.GROUP_NAME -->
+ <tr class="bg3">
+ <td colspan="{NOTIFICATION_TYPES_COLS}">{notification_types.GROUP_NAME}</td>
+ </tr>
+ <!-- ELSE -->
+ <tr class="<!-- IF notification_types.S_ROW_COUNT is odd -->bg1<!-- ELSE -->bg2<!-- ENDIF -->">
+ <td>
+ {notification_types.NAME}
+ <!-- IF notification_types.EXPLAIN --><br />&nbsp; &nbsp;{notification_types.EXPLAIN}<!-- ENDIF -->
+ </td>
+ <!-- BEGIN notification_methods -->
+ <td class="mark"><input type="checkbox" name="{notification_types.TYPE}_{notification_methods.METHOD}"<!-- IF notification_methods.SUBSCRIBED --> checked="checked"<!-- ENDIF --> /></td>
+ <!-- END notification_methods -->
+ <td class="mark"><input type="checkbox" name="{notification_types.TYPE}_notification"<!-- IF notification_types.SUBSCRIBED --> checked="checked"<!-- ENDIF --> /></td>
+ </tr>
+ <!-- ENDIF -->
+ <!-- END notification_types -->
+ </tbody>
+ </table>
+ <!-- ELSE -->
+ <!-- IF .notification_list -->
+ <div class="action-bar top">
+ <div class="pagination">
+ <!-- IF U_MARK_ALL --><a href="{U_MARK_ALL}" class="mark">{L_NOTIFICATIONS_MARK_ALL_READ}</a> &bull; <!-- ENDIF -->
+ {L_NOTIFICATIONS} [<strong>{TOTAL_COUNT}</strong>]
+ <!-- IF .pagination -->
+ <!-- INCLUDE pagination.html -->
+ <!-- ELSE -->
+ &bull; {PAGE_NUMBER}
+ <!-- ENDIF -->
+ </div>
+ </div>
+
+ <div class="notification_list">
+ <ul class="topiclist two-columns">
+ <li class="header">
+ <dl>
+ <dt><div class="list-inner">{L_NOTIFICATIONS}</div></dt>
+ <dd class="mark">{L_MARK_READ}</dd>
+ </dl>
+ </li>
+ </ul>
+ <ul class="topiclist cplist two-columns">
+ <!-- BEGIN notification_list -->
+ <li class="row<!-- IF notification_list.UNREAD --> bg3<!-- ELSE --><!-- IF notification_list.S_ROW_COUNT is odd --> bg1<!-- ELSE --> bg2<!-- ENDIF --><!-- ENDIF --><!-- IF notification_list.STYLING --> {notification_list.STYLING}<!-- ENDIF -->">
+ <dl>
+ <dt>
+ <div class="list-inner">
+ <!-- IF notification_list.AVATAR -->{notification_list.AVATAR}<!-- ELSE --><img src="{T_THEME_PATH}/images/no_avatar.gif" alt="" /><!-- ENDIF -->
+ <div class="notifications">
+ <!-- IF notification_list.URL --><a href="<!-- IF notification_list.UNREAD -->{notification_list.U_MARK_READ}<!-- ELSE -->{notification_list.URL}<!-- ENDIF -->"><!-- ENDIF -->
+ <p class="notifications_title">{notification_list.FORMATTED_TITLE}<!-- IF notification_list.REFERENCE --> {notification_list.REFERENCE}<!-- ENDIF --></p>
+ <!-- IF notification_list.URL --></a><!-- ENDIF -->
+ <!-- IF notification_list.FORUM --><p class="notifications_forum">{notification_list.FORUM}</p><!-- ENDIF -->
+ <!-- IF notification_list.REASON --><p class="notifications_reason">{notification_list.REASON}</p><!-- ENDIF -->
+ <p class="notifications_time">{notification_list.TIME}</p>
+ </div>
+ </div>
+ </dt>
+
+ <dd class="mark">&nbsp;<input type="checkbox" name="mark[]" value="{notification_list.NOTIFICATION_ID}"<!-- IF not notification_list.UNREAD --> disabled="disabled"<!-- ENDIF --> /> <dfn>{L_MARK_READ}</dfn>&nbsp;</dd>
+ </dl>
+ </li>
+ <!-- END notification_list -->
+ </ul>
+ </div>
+
+ <div class="action-bar bottom">
+ <div class="pagination">
+ {L_NOTIFICATIONS} [<strong>{TOTAL_COUNT}</strong>]
+ <!-- IF .pagination -->
+ <!-- INCLUDE pagination.html -->
+ <!-- ELSE -->
+ &bull; {PAGE_NUMBER}
+ <!-- ENDIF -->
+ </div>
+ </div>
+
+ <!-- ELSE -->
+ <p><strong>{L_NO_NOTIFICATIONS}</strong></p>
+ <!-- ENDIF -->
+
+ <!-- ENDIF -->
+ </div>
+</div>
+
+<!-- IF .notification_types or .notification_list -->
+<fieldset class="display-actions">
+ <input type="hidden" name="form_time" value="{FORM_TIME}" />
+ {S_HIDDEN_FIELDS}
+ <input type="submit" name="submit" value="<!-- IF MODE == 'notification_options' -->{L_SUBMIT}<!-- ELSE -->{L_MARK_READ}<!-- ENDIF -->" class="button1" />
+ <div><a href="#" onclick="$('#ucp input:checkbox').prop('checked', true); return false;">{L_MARK_ALL}</a> &bull; <a href="#" onclick="$('#ucp input:checkbox').prop('checked', false); return false;">{L_UNMARK_ALL}</a></div>
+ {S_FORM_TOKEN}
+</fieldset>
+<!-- ENDIF -->
+
+</form>
+
+<!-- INCLUDE ucp_footer.html -->
diff --git a/phpBB/styles/prosilver/template/ucp_pm_history.html b/phpBB/styles/prosilver/template/ucp_pm_history.html
index 0767920c1b..28f217ef66 100644
--- a/phpBB/styles/prosilver/template/ucp_pm_history.html
+++ b/phpBB/styles/prosilver/template/ucp_pm_history.html
@@ -1,9 +1,10 @@
<h3 id="review">
<span class="right-box"><a href="#review" onclick="viewableArea(getElementById('topicreview'), true); var rev_text = getElementById('review').getElementsByTagName('a').item(0).firstChild; if (rev_text.data == '{LA_EXPAND_VIEW}'){rev_text.data = '{LA_COLLAPSE_VIEW}'; } else if (rev_text.data == '{LA_COLLAPSE_VIEW}'){rev_text.data = '{LA_EXPAND_VIEW}'};">{L_EXPAND_VIEW}</a></span>
- {L_MESSAGE_HISTORY}:
+ {L_MESSAGE_HISTORY}{L_COLON}
</h3>
+<!-- EVENT ucp_pm_history_review_before -->
<div id="topicreview">
<script type="text/javascript">
// <![CDATA[
@@ -12,26 +13,39 @@
</script>
<!-- BEGIN history_row -->
<div class="post <!-- IF history_row.S_ROW_COUNT is even -->bg1<!-- ELSE -->bg2<!-- ENDIF -->">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div class="postbody" id="pr{history_row.MSG_ID}">
- <!-- IF history_row.U_QUOTE or history_row.MESSAGE_AUTHOR_QUOTE -->
- <ul class="profile-icons">
- <li class="quote-icon"><a <!-- IF history_row.U_QUOTE -->href="{history_row.U_QUOTE}"<!-- ELSE -->href="#postingbox" onclick="addquote({history_row.MSG_ID}, '{history_row.MESSAGE_AUTHOR_QUOTE}', '{LA_WROTE}');"<!-- ENDIF --> title="{L_QUOTE} {history_row.MESSAGE_AUTHOR}"><span>{L_QUOTE} {history_row.MESSAGE_AUTHOR}</span></a></li>
+ <h3><a href="{history_row.U_VIEW_MESSAGE}" <!-- IF history_row.S_CURRENT_MSG -->class="current"<!-- ENDIF -->>{history_row.SUBJECT}</a></h3>
+
+ <!-- DEFINE $SHOW_PM_HISTORY_POST_BUTTONS = (history_row.U_QUOTE or history_row.MESSAGE_AUTHOR_QUOTE) -->
+ <!-- EVENT ucp_pm_history_post_buttons_list_before -->
+ <!-- IF $SHOW_PM_HISTORY_POST_BUTTONS -->
+ <ul class="post-buttons">
+ <!-- EVENT ucp_pm_history_post_buttons_before -->
+ <!-- IF history_row.U_QUOTE or history_row.MESSAGE_AUTHOR_QUOTE -->
+ <li>
+ <a <!-- IF history_row.U_QUOTE -->href="{history_row.U_QUOTE}"<!-- ELSE -->href="#postingbox" onclick="addquote({history_row.MSG_ID}, '{history_row.MESSAGE_AUTHOR_QUOTE}', '{LA_WROTE}');"<!-- ENDIF --> title="{L_QUOTE} {history_row.MESSAGE_AUTHOR}" class="button icon-button quote-icon">
+ <span>{L_QUOTE} {history_row.MESSAGE_AUTHOR}</span>
+ </a>
+ </li>
+ <!-- ENDIF -->
+ <!-- EVENT ucp_pm_history_post_buttons_after -->
</ul>
<!-- ENDIF -->
+ <!-- EVENT ucp_pm_history_post_buttons_list_after -->
- <h3><a href="{history_row.U_VIEW_MESSAGE}" <!-- IF history_row.S_CURRENT_MSG -->class="current"<!-- ENDIF -->>{history_row.SUBJECT}</a></h3>
- <p class="author">{history_row.MINI_POST_IMG} {L_SENT_AT}: <strong>{history_row.SENT_DATE}</strong><br />
+ <p class="author">{history_row.MINI_POST_IMG} {L_SENT_AT}{L_COLON} <strong>{history_row.SENT_DATE}</strong><br />
{L_MESSAGE_BY_AUTHOR} {history_row.MESSAGE_AUTHOR_FULL}</p>
<div class="content"><!-- IF history_row.MESSAGE -->{history_row.MESSAGE}<!-- ELSE --><span class="error">{L_MESSAGE_REMOVED_FROM_OUTBOX}</span><!-- ENDIF --></div>
<div id="message_{history_row.MSG_ID}" style="display: none;">{history_row.DECODED_MESSAGE}</div>
</div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<!-- END history_row -->
</div>
+<!-- EVENT ucp_pm_history_review_after -->
<hr />
<p><a href="#cp-main" class="top2">{L_BACK_TO_TOP}</a></p>
diff --git a/phpBB/styles/prosilver/template/ucp_pm_message_header.html b/phpBB/styles/prosilver/template/ucp_pm_message_header.html
index ae66dd0a36..7be51e0034 100644
--- a/phpBB/styles/prosilver/template/ucp_pm_message_header.html
+++ b/phpBB/styles/prosilver/template/ucp_pm_message_header.html
@@ -1,28 +1,61 @@
-<h2>{L_TITLE}<!-- IF CUR_FOLDER_NAME -->: {CUR_FOLDER_NAME}<!-- ENDIF --></h2>
+<h2>{L_TITLE}<!-- IF CUR_FOLDER_NAME -->{L_COLON} {CUR_FOLDER_NAME}<!-- ENDIF --></h2>
<form id="viewfolder" method="post" action="{S_PM_ACTION}">
<div class="panel">
- <div class="inner"><span class="corners-top"><span></span></span>
-
+ <div class="inner">
<!-- IF FOLDER_STATUS and FOLDER_MAX_MESSAGES neq 0 --><p>{FOLDER_STATUS}</p><!-- ENDIF -->
+
+ <div class="action-bar top">
<!-- IF U_POST_REPLY_PM or U_POST_NEW_TOPIC or U_FORWARD_PM -->
<div class="buttons">
- <!-- IF U_POST_REPLY_PM --><div class="pmreply-icon"><a title="{L_POST_REPLY_PM}" href="{U_POST_REPLY_PM}"><span></span>{L_POST_REPLY_PM}</a></div>
- <!-- ELSEIF U_POST_NEW_TOPIC --><div class="newpm-icon"><a href="{U_POST_NEW_TOPIC}" accesskey="n" title="{L_UCP_PM_COMPOSE}"><span></span>{L_UCP_PM_COMPOSE}</a></div><!-- ENDIF -->
- <!-- IF U_FORWARD_PM --><div class="forwardpm-icon"><a title="{L_POST_FORWARD_PM}" href="{U_FORWARD_PM}"><span></span>{L_FORWARD_PM}</a></div><!-- ENDIF -->
- <!-- IF U_POST_REPLY_PM and S_PM_RECIPIENTS gt 1 --><div class="reply-all"><a class="left" title="{L_REPLY_TO_ALL}" href="{U_POST_REPLY_ALL}">{L_REPLY_TO_ALL}</a></div><!-- ENDIF -->
+ <!-- IF U_POST_REPLY_PM -->
+ <a title="{L_POST_REPLY_PM}" href="{U_POST_REPLY_PM}" class="button icon-button pmreply-icon">
+ {L_BUTTON_PM_REPLY}
+ </a>
+ <!-- ELSEIF U_POST_NEW_TOPIC -->
+ <a href="{U_POST_NEW_TOPIC}" accesskey="n" title="{L_UCP_PM_COMPOSE}" class="button icon-button newpm-icon">
+ {L_BUTTON_PM_NEW}
+ </a>
+ <!-- ENDIF -->
+ <!-- IF U_FORWARD_PM -->
+ <a title="{L_POST_FORWARD_PM}" href="{U_FORWARD_PM}" class="button icon-button forwardpm-icon">
+ {L_BUTTON_PM_FORWARD}
+ </a>
+ <!-- ENDIF -->
+ <!-- IF U_POST_REPLY_PM and S_PM_RECIPIENTS gt 1 -->
+ <a title="{L_REPLY_TO_ALL}" href="{U_POST_REPLY_ALL}" class="button icon-button reply-all">
+ {L_BUTTON_PM_REPLY_ALL}
+ </a>
+ <!-- ENDIF -->
+ </div>
+ <!-- ENDIF -->
+
+ <!-- IF not S_IS_BOT and U_PRINT_PM -->
+ <div class="dropdown-container dropdown-button-control topic-tools">
+ <span title="{L_PM_TOOLS}" class="dropdown-trigger dropdown-select button icon-button tools-icon"></span>
+ <div class="dropdown hidden">
+ <div class="pointer"><div class="pointer-inner"></div></div>
+ <ul class="dropdown-contents">
+ <!-- IF U_PRINT_PM --><li class="small-icon icon-print"><a href="{U_PRINT_PM}" title="{L_PRINT_PM}" accesskey="p">{L_PRINT_PM}</a></li><!-- ENDIF -->
+ </ul>
+ </div>
</div>
<!-- ENDIF -->
<!-- IF TOTAL_MESSAGES or S_VIEW_MESSAGE -->
- <ul class="linklist">
- <li class="rightside pagination">
- <!-- IF S_VIEW_MESSAGE --><a class="{S_CONTENT_FLOW_BEGIN}" href="{U_CURRENT_FOLDER}">{L_RETURN_TO} {CUR_FOLDER_NAME}</a><!-- ENDIF -->
- <!-- IF FOLDER_CUR_MESSAGES neq 0 -->
- <!-- IF TOTAL_MESSAGES -->{TOTAL_MESSAGES}<!-- ENDIF -->
- <!-- IF PAGE_NUMBER --><!-- IF PAGINATION --> &bull; <a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{PAGE_NUMBER}</a> &bull; <span>{PAGINATION}</span><!-- ELSE --> &bull; {PAGE_NUMBER}<!-- ENDIF --><!-- ENDIF -->
+ <div class="pagination">
+ <!-- IF S_VIEW_MESSAGE -->
+ <a class="arrow-{S_CONTENT_FLOW_BEGIN}" href="{U_CURRENT_FOLDER}">{L_RETURN_TO_FOLDER}</a>
+ <!-- ELSEIF FOLDER_CUR_MESSAGES neq 0 -->
+ <!-- IF U_MARK_ALL --><a href="{U_MARK_ALL}" class="mark">{L_PM_MARK_ALL_READ}</a> &bull; <!-- ENDIF -->
+ {TOTAL_MESSAGES}
+ <!-- IF .pagination -->
+ <!-- INCLUDE pagination.html -->
+ <!-- ELSE -->
+ &bull; {PAGE_NUMBER}
+ <!-- ENDIF -->
<!-- ENDIF -->
- </li>
- </ul>
+ </div>
<!-- ENDIF -->
+ </div>
diff --git a/phpBB/styles/prosilver/template/ucp_pm_options.html b/phpBB/styles/prosilver/template/ucp_pm_options.html
index a8693ac9b9..247be8b6fd 100644
--- a/phpBB/styles/prosilver/template/ucp_pm_options.html
+++ b/phpBB/styles/prosilver/template/ucp_pm_options.html
@@ -5,16 +5,16 @@
<form id="ucp" method="post" action="{S_UCP_ACTION}">
<div class="panel">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<!-- IF ERROR_MESSAGE --><p class="error">{ERROR_MESSAGE}</p><!-- ENDIF -->
<!-- IF NOTIFICATION_MESSAGE --><p class="error">{NOTIFICATION_MESSAGE}</p><!-- ENDIF -->
-
+
<h3>{L_DEFINED_RULES}</h3>
<ol class="def-rules">
<!-- BEGIN rule -->
- <li><div class="right-box"><input type="submit" name="delete_rule[{rule.RULE_ID}]" value="{L_DELETE_RULE}" class="button2" /></div><strong>{L_IF}</strong> {rule.CHECK} <em>{rule.RULE}</em> <!-- IF rule.STRING --><strong>{rule.STRING}</strong> | <!-- ENDIF -->{rule.ACTION}<!-- IF rule.FOLDER -->: {rule.FOLDER}<!-- ENDIF --><div style="clear: both;"></div></li>
+ <li><div class="right-box"><input type="submit" name="delete_rule[{rule.RULE_ID}]" value="{L_DELETE_RULE}" class="button2" /></div><strong>{L_IF}</strong> {rule.CHECK} <em>{rule.RULE}</em> <!-- IF rule.STRING --><strong>{rule.STRING}</strong> | <!-- ENDIF -->{rule.ACTION}<!-- IF rule.FOLDER -->{L_COLON} {rule.FOLDER}<!-- ENDIF --><div style="clear: both;"></div></li>
<!-- BEGINELSE -->
<li><strong>{L_NO_RULES_DEFINED}</strong></li>
<!-- END rule -->
@@ -26,7 +26,7 @@
<!-- IF S_CHECK_DEFINED -->
<dl>
- <dt><label<!-- IF S_CHECK_SELECT --> for="check_option"<!-- ENDIF -->>{L_IF}:</label></dt>
+ <dt><label<!-- IF S_CHECK_SELECT --> for="check_option"<!-- ENDIF -->>{L_IF}{L_COLON}</label></dt>
<dd>
<!-- IF S_CHECK_SELECT --><select name="check_option" id="check_option">{S_CHECK_OPTIONS}</select> <input type="submit" name="next" value="{L_NEXT_STEP}" class="button2" /><!-- ELSE -->{CHECK_CURRENT}<input type="hidden" name="check_option" value="{CHECK_OPTION}" /><!-- ENDIF -->
</dd>
@@ -81,26 +81,26 @@
<!-- IF not S_MAX_FOLDER_ZERO -->
<dl>
- <dt><label for="foldername">{L_ADD_FOLDER}:</label></dt>
+ <dt><label for="foldername">{L_ADD_FOLDER}{L_COLON}</label></dt>
<dd><!-- IF S_MAX_FOLDER_REACHED -->{L_MAX_FOLDER_REACHED}<!-- ELSE --><input type="text" class="inputbox medium" name="foldername" id="foldername" size="30" maxlength="30" /> <input class="button2" type="submit" name="addfolder" value="{L_ADD}" /><!-- ENDIF --></dd>
</dl>
<!-- IF S_FOLDER_OPTIONS --><hr class="dashed" /><!-- ENDIF -->
<!-- ENDIF -->
-
+
<!-- IF S_FOLDER_OPTIONS -->
<dl>
- <dt><label for="rename_folder_id">{L_RENAME_FOLDER}:</label></dt>
+ <dt><label for="rename_folder_id">{L_RENAME_FOLDER}{L_COLON}</label></dt>
<dd><select name="rename_folder_id" id="rename_folder_id">{S_FOLDER_OPTIONS}</select></dd>
- <dt><label for="new_folder_name">{L_NEW_FOLDER_NAME}:</label></dt>
+ <dt><label for="new_folder_name">{L_NEW_FOLDER_NAME}{L_COLON}</label></dt>
<dd><input type="text" class="inputbox tiny" name="new_folder_name" id="new_folder_name" maxlength="30" /> <input class="button2" type="submit" name="rename_folder" value="{L_RENAME}" /></dd>
</dl>
<hr class="dashed" />
<dl>
- <dt><label for="remove_folder_id">{L_REMOVE_FOLDER}:</label></dt>
+ <dt><label for="remove_folder_id">{L_REMOVE_FOLDER}{L_COLON}</label></dt>
<dd><select name="remove_folder_id" id="remove_folder_id">{S_FOLDER_OPTIONS}</select></dd>
- <dd style="margin-top: 3px;"><label for="remove_action1"><input type="radio" name="remove_action" id="remove_action1" value="1" checked="checked" /> {L_MOVE_DELETED_MESSAGES_TO}:</label> <select name="move_to">{S_TO_FOLDER_OPTIONS}</select></dd>
+ <dd style="margin-top: 3px;"><label for="remove_action1"><input type="radio" name="remove_action" id="remove_action1" value="1" checked="checked" /> {L_MOVE_DELETED_MESSAGES_TO}{L_COLON}</label> <select name="move_to">{S_TO_FOLDER_OPTIONS}</select></dd>
<dd style="margin-top: 3px;"><label for="remove_action2"><input type="radio" name="remove_action" id="remove_action2" value="2" /> {L_DELETE_MESSAGES_IN_FOLDER}</label></dd>
<dd style="margin-top: 3px;"><input class="button2" type="submit" name="remove_folder" value="{L_REMOVE}" /></dd>
</dl>
@@ -109,23 +109,23 @@
<hr class="dashed" />
<dl>
- <dt><label for="full_action1">{L_IF_FOLDER_FULL}:</label></dt>
+ <dt><label for="full_action1">{L_IF_FOLDER_FULL}{L_COLON}</label></dt>
<dd style="margin-top: 3px;"><label for="full_action1"><input type="radio" name="full_action" id="full_action1" value="1"{S_DELETE_CHECKED} /> {L_DELETE_OLDEST_MESSAGES}</label></dd>
- <dd style="margin-top: 3px;"><label for="full_action2"><input type="radio" name="full_action" id="full_action2" value="2"{S_MOVE_CHECKED} /> {L_MOVE_TO_FOLDER}:</label> <select name="full_move_to">{S_FULL_FOLDER_OPTIONS}</select></dd>
+ <dd style="margin-top: 3px;"><label for="full_action2"><input type="radio" name="full_action" id="full_action2" value="2"{S_MOVE_CHECKED} /> {L_MOVE_TO_FOLDER}{L_COLON}</label> <select name="full_move_to">{S_FULL_FOLDER_OPTIONS}</select></dd>
<dd style="margin-top: 3px;"><label for="full_action3" style="white-space:normal;"><input type="radio" name="full_action" id="full_action3" value="3"{S_HOLD_CHECKED} /> {L_HOLD_NEW_MESSAGES}</label></dd>
</dl>
<dl>
- <dt><label>{L_DEFAULT_ACTION}:</label><br /><span>{L_DEFAULT_ACTION_EXPLAIN}</span></dt>
+ <dt><label>{L_DEFAULT_ACTION}{L_COLON}</label><br /><span>{L_DEFAULT_ACTION_EXPLAIN}</span></dt>
<dd>{DEFAULT_ACTION}</dd>
<dd><input class="button2" type="submit" name="fullfolder" value="{L_CHANGE}" /></dd>
</dl>
</fieldset>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
{S_FORM_TOKEN}
</div>
</form>
-<!-- INCLUDE ucp_footer.html --> \ No newline at end of file
+<!-- INCLUDE ucp_footer.html -->
diff --git a/phpBB/styles/prosilver/template/ucp_pm_popup.html b/phpBB/styles/prosilver/template/ucp_pm_popup.html
deleted file mode 100644
index 325362dc4d..0000000000
--- a/phpBB/styles/prosilver/template/ucp_pm_popup.html
+++ /dev/null
@@ -1,25 +0,0 @@
-<!-- INCLUDE simple_header.html -->
-
-<script type="text/javascript">
-// <![CDATA[
-/**
-* Jump to inbox
-*/
-function jump_to_inbox(url)
-{
- opener.document.location.href = url.replace(/&amp;/g, '&');
- window.close();
-}
-// ]]>
-</script>
-
-<div class="panel">
- <div class="inner"><span class="corners-top"><span></span></span>
- <div class="content">
- <p><!-- IF S_NOT_LOGGED_IN -->{L_LOGIN_CHECK_PM}<!-- ELSE -->{MESSAGE}<br /><br />{CLICK_TO_VIEW}<!-- ENDIF --></p>
- <p class="small"><a href="#" onclick="window.close(); return false;">{L_CLOSE_WINDOW}</a></p>
- </div>
- <span class="corners-bottom"><span></span></span></div>
-</div>
-
-<!-- INCLUDE simple_footer.html --> \ No newline at end of file
diff --git a/phpBB/styles/prosilver/template/ucp_pm_viewfolder.html b/phpBB/styles/prosilver/template/ucp_pm_viewfolder.html
index c9f28cec64..47e4d1c63a 100644
--- a/phpBB/styles/prosilver/template/ucp_pm_viewfolder.html
+++ b/phpBB/styles/prosilver/template/ucp_pm_viewfolder.html
@@ -8,24 +8,24 @@
<h2>{L_EXPORT_AS_CSV}</h2>
<form id="viewfolder" method="post" action="{S_PM_ACTION}">
<div class="panel">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<h3>{L_OPTIONS}</h3>
<fieldset>
<dl>
- <dt><label for="delimiter">{L_DELIMITER}:</label></dt>
+ <dt><label for="delimiter">{L_DELIMITER}{L_COLON}</label></dt>
<dd><input class="inputbox" type="text" id="delimiter" name="delimiter" value="," /></dd>
</dl>
<dl>
- <dt><label for="enclosure">{L_ENCLOSURE}:</label></dt>
+ <dt><label for="enclosure">{L_ENCLOSURE}{L_COLON}</label></dt>
<dd><input class="inputbox" type="text" id="enclosure" name="enclosure" value="&#034;" /></dd>
</dl>
</fieldset>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<fieldset class="submit-buttons">
<input type="hidden" name="export_option" value="CSV" />
<input class="button1" type="submit" name="submit_export" value="{L_EXPORT_FOLDER}" />&nbsp;
- <input class="button2" type="reset" value="Reset" name="reset" />&nbsp;
+ <input class="button2" type="reset" value="{L_RESET}" name="reset" />&nbsp;
{S_FORM_TOKEN}
</fieldset>
</form>
@@ -45,20 +45,22 @@
<!-- ENDIF -->
<!-- IF .messagerow -->
- <ul class="topiclist">
+ <ul class="topiclist two-columns">
<li class="header">
<dl>
- <dt>{L_MESSAGE}</dt>
+ <dt><div class="list-inner">{L_MESSAGE}</div></dt>
<dd class="mark">{L_MARK}</dd>
</dl>
</li>
</ul>
- <ul class="topiclist cplist pmlist">
+ <ul class="topiclist cplist pmlist responsive-show-all <!-- IF S_SHOW_RECIPIENTS -->missing-column<!-- ELSE -->two-columns<!-- ENDIF -->">
<!-- BEGIN messagerow -->
<li class="row<!-- IF messagerow.S_ROW_COUNT is odd --> bg1<!-- ELSE --> bg2<!-- ENDIF --><!-- IF messagerow.PM_CLASS --> {messagerow.PM_CLASS}<!-- ENDIF -->">
- <dl class="icon" style="background-image: url({messagerow.FOLDER_IMG_SRC}); background-repeat: no-repeat;">
+ <dl class="icon {messagerow.FOLDER_IMG_STYLE}">
<dt<!-- IF messagerow.PM_ICON_URL and S_PM_ICONS --> style="background-image: url({messagerow.PM_ICON_URL}); background-repeat: no-repeat;"<!-- ENDIF -->>
+ <!-- IF messagerow.S_PM_UNREAD and not messagerow.S_PM_DELETED --><a href="{messagerow.U_VIEW_PM}" class="icon-link"></a><!-- ENDIF -->
+ <div class="list-inner">
<!-- IF messagerow.S_PM_DELETED -->
<a href="{messagerow.U_REMOVE_PM}" class="topictitle">{L_DELETE_MESSAGE}</a><br />
@@ -72,8 +74,10 @@
<!-- IF messagerow.S_PM_REPORTED --><a href="{messagerow.U_MCP_REPORT}">{REPORTED_IMG}</a><!-- ENDIF --> {messagerow.ATTACH_ICON_IMG}<br />
<!-- IF S_SHOW_RECIPIENTS -->{L_MESSAGE_TO} {messagerow.RECIPIENTS}<!-- ELSE -->{L_MESSAGE_BY_AUTHOR} {messagerow.MESSAGE_AUTHOR_FULL} &raquo; {messagerow.SENT_TIME}<!-- ENDIF -->
+
+ </div>
</dt>
- <!-- IF S_SHOW_RECIPIENTS --><dd class="info"><span>{L_SENT_AT}: {messagerow.SENT_TIME}</span></dd><!-- ENDIF -->
+ <!-- IF S_SHOW_RECIPIENTS --><dd class="info"><span>{L_SENT_AT}{L_COLON} {messagerow.SENT_TIME}</span></dd><!-- ENDIF -->
<!-- IF S_UNREAD --><dd class="info"><!-- IF messagerow.FOLDER --><a href="{messagerow.U_FOLDER}">{messagerow.FOLDER}</a><!-- ELSE -->{L_UNKNOWN_FOLDER}<!-- ENDIF --></dd><!-- ENDIF -->
<dd class="mark"><input type="checkbox" name="marked_msg_id[]" value="{messagerow.MESSAGE_ID}" /></dd>
</dl>
@@ -92,38 +96,39 @@
<!-- ENDIF -->
<!-- IF FOLDER_CUR_MESSAGES neq 0 -->
- <fieldset class="display-actions">
- <div class="left-box"><label for="export_option">{L_EXPORT_FOLDER}: <select name="export_option" id="export_option"><option value="CSV">{L_EXPORT_AS_CSV}</option><option value="CSV_EXCEL">{L_EXPORT_AS_CSV_EXCEL}</option><option value="XML">{L_EXPORT_AS_XML}</option></select></label> <input class="button2" type="submit" name="submit_export" value="{L_GO}" /><br /></div>
- <select name="mark_option">{S_MARK_OPTIONS}{S_MOVE_MARKED_OPTIONS}</select> <input class="button2" type="submit" name="submit_mark" value="{L_GO}" />
- <div><a href="#" onclick="marklist('viewfolder', 'marked_msg', true); return false;">{L_MARK_ALL}</a> &bull; <a href="#" onclick="marklist('viewfolder', 'marked_msg', false); return false;">{L_UNMARK_ALL}</a></div>
- </fieldset>
-
- <hr />
-
- <ul class="linklist">
- <!-- IF TOTAL_MESSAGES or S_VIEW_MESSAGE -->
- <li class="rightside pagination">
- <!-- IF TOTAL_MESSAGES -->{TOTAL_MESSAGES}<!-- ENDIF -->
- <!-- IF PAGE_NUMBER --><!-- IF PAGINATION --> &bull; <a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{PAGE_NUMBER}</a> &bull; <span>{PAGINATION}</span><!-- ELSE --> &bull; {PAGE_NUMBER}<!-- ENDIF --><!-- ENDIF -->
- </li>
- <!-- ENDIF -->
- </ul>
+ <fieldset class="display-actions">
+ <div class="left-box"><label for="export_option">{L_EXPORT_FOLDER}{L_COLON} <select name="export_option" id="export_option"><option value="CSV">{L_EXPORT_AS_CSV}</option><option value="CSV_EXCEL">{L_EXPORT_AS_CSV_EXCEL}</option><option value="XML">{L_EXPORT_AS_XML}</option></select></label> <input class="button2" type="submit" name="submit_export" value="{L_GO}" /><br /></div>
+ <select name="mark_option">{S_MARK_OPTIONS}{S_MOVE_MARKED_OPTIONS}</select> <input class="button2" type="submit" name="submit_mark" value="{L_GO}" />
+ <div><a href="#" onclick="marklist('viewfolder', 'marked_msg', true); return false;">{L_MARK_ALL}</a> &bull; <a href="#" onclick="marklist('viewfolder', 'marked_msg', false); return false;">{L_UNMARK_ALL}</a></div>
+ </fieldset>
+
+ <hr />
+
+ <div class="action-bar bottom">
+ <div class="pagination">
+ {TOTAL_MESSAGES}
+ <!-- IF .pagination -->
+ <!-- INCLUDE pagination.html -->
+ <!-- ELSE -->
+ &bull; {PAGE_NUMBER}
+ <!-- ENDIF -->
+ </div>
+ </div>
<!-- ENDIF -->
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<!-- IF FOLDER_CUR_MESSAGES neq 0 -->
<fieldset class="display-options">
- <!-- IF PREVIOUS_PAGE --><a href="{PREVIOUS_PAGE}" class="left-box {S_CONTENT_FLOW_BEGIN}">{L_PREVIOUS}</a><!-- ENDIF -->
- <!-- IF NEXT_PAGE --><a href="{NEXT_PAGE}" class="right-box {S_CONTENT_FLOW_END}">{L_NEXT}</a><!-- ENDIF -->
- <label>{L_DISPLAY}: {S_SELECT_SORT_DAYS}</label>
+ <label>{L_DISPLAY}{L_COLON} {S_SELECT_SORT_DAYS}</label>
<label>{L_SORT_BY} {S_SELECT_SORT_KEY}</label>
- <label>{S_SELECT_SORT_DIR} <input type="submit" name="sort" value="{L_GO}" class="button2" /></label>
+ <label>{S_SELECT_SORT_DIR}</label>
+ <input type="submit" name="sort" value="{L_GO}" class="button2" />
<input type="hidden" name="cur_folder_id" value="{CUR_FOLDER_ID}" />
</fieldset>
<!-- ENDIF -->
<!-- INCLUDE ucp_pm_message_footer.html -->
<!-- ENDIF -->
-<!-- INCLUDE ucp_footer.html --> \ No newline at end of file
+<!-- INCLUDE ucp_footer.html -->
diff --git a/phpBB/styles/prosilver/template/ucp_pm_viewmessage.html b/phpBB/styles/prosilver/template/ucp_pm_viewmessage.html
index 1840732b64..009a9bf975 100644
--- a/phpBB/styles/prosilver/template/ucp_pm_viewmessage.html
+++ b/phpBB/styles/prosilver/template/ucp_pm_viewmessage.html
@@ -2,60 +2,137 @@
<!-- INCLUDE ucp_pm_message_header.html -->
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<!-- IF S_DISPLAY_HISTORY and (U_VIEW_PREVIOUS_HISTORY or U_VIEW_NEXT_HISTORY) -->
<fieldset class="display-options clearfix">
- <!-- IF U_VIEW_PREVIOUS_HISTORY --><a href="{U_VIEW_PREVIOUS_HISTORY}" class="left-box {S_CONTENT_FLOW_BEGIN}">{L_VIEW_PREVIOUS_HISTORY}</a><!-- ENDIF -->
- <!-- IF U_VIEW_NEXT_HISTORY --><a href="{U_VIEW_NEXT_HISTORY}" class="right-box {S_CONTENT_FLOW_END}">{L_VIEW_NEXT_HISTORY}</a><!-- ENDIF -->
+ <!-- IF U_VIEW_PREVIOUS_HISTORY --><a href="{U_VIEW_PREVIOUS_HISTORY}" class="left-box arrow-{S_CONTENT_FLOW_BEGIN}">{L_VIEW_PREVIOUS_HISTORY}</a><!-- ENDIF -->
+ <!-- IF U_VIEW_NEXT_HISTORY --><a href="{U_VIEW_NEXT_HISTORY}" class="right-box arrow-{S_CONTENT_FLOW_END}">{L_VIEW_NEXT_HISTORY}</a><!-- ENDIF -->
</fieldset>
<!-- ENDIF -->
-<div id="post-{MESSAGE_ID}" class="post pm<!-- IF S_POST_UNAPPROVED or S_POST_REPORTED --> reported<!-- ENDIF --><!-- IF S_ONLINE --> online<!-- ENDIF -->">
-<div class="inner"><span class="corners-top"><span></span></span>
+<div id="post-{MESSAGE_ID}" class="post pm has-profile<!-- IF S_POST_UNAPPROVED or S_POST_REPORTED --> reported<!-- ENDIF --><!-- IF S_ONLINE --> online<!-- ENDIF -->">
+<div class="inner">
+
+ <dl class="postprofile" id="profile{MESSAGE_ID}">
+ <dt class="<!-- IF RANK_TITLE or RANK_IMG -->has-profile-rank<!-- ELSE -->no-profile-rank<!-- ENDIF --> <!-- IF AUTHOR_AVATAR -->has-avatar<!-- ELSE -->no-avatar<!-- ENDIF -->">
+ <div class="avatar-container">
+ <!-- EVENT ucp_pm_viewmessage_avatar_before -->
+ <!-- IF AUTHOR_AVATAR --><a href="{U_MESSAGE_AUTHOR}" class="avatar">{AUTHOR_AVATAR}</a><!-- ENDIF -->
+ <!-- EVENT ucp_pm_viewmessage_avatar_after -->
+ </div>
+ {MESSAGE_AUTHOR_FULL}
+ </dt>
+
+ <!-- EVENT ucp_pm_viewmessage_rank_before -->
+ <!-- IF RANK_TITLE or RANK_IMG --><dd class="profile-rank">{RANK_TITLE}<!-- IF RANK_TITLE and RANK_IMG --><br /><!-- ENDIF -->{RANK_IMG}</dd><!-- ENDIF -->
+ <!-- EVENT ucp_pm_viewmessage_rank_after -->
+
+ <dd class="profile-posts"><strong>{L_POSTS}{L_COLON}</strong> <!-- IF U_AUTHOR_POSTS != '' --><a href="{U_AUTHOR_POSTS}">{AUTHOR_POSTS}</a><!-- ELSE -->{AUTHOR_POSTS}<!-- ENDIF --></dd>
+ <!-- IF AUTHOR_JOINED --><dd class="profile-joined"><strong>{L_JOINED}{L_COLON}</strong> {AUTHOR_JOINED}</dd><!-- ENDIF -->
+
+ <!-- EVENT ucp_pm_viewmessage_custom_fields_before -->
+ <!-- BEGIN custom_fields -->
+ <!-- IF not custom_fields.S_PROFILE_CONTACT -->
+ <dd class="profile-custom-field profile-{custom_fields.PROFILE_FIELD_IDENT}"><strong>{custom_fields.PROFILE_FIELD_NAME}{L_COLON}</strong> {custom_fields.PROFILE_FIELD_VALUE}</dd>
+ <!-- ENDIF -->
+ <!-- END custom_fields -->
+ <!-- EVENT ucp_pm_viewmessage_custom_fields_after -->
+
+ <!-- EVENT ucp_pm_viewmessage_contact_fields_before -->
+ <!-- IF .contact -->
+ <dd class="profile-contact">
+ <strong>{L_CONTACT}{L_COLON}</strong>
+ <div class="dropdown-container dropdown-left">
+ <a href="#" class="dropdown-trigger"><span class="imageset icon_contact" title="{CONTACT_USER}">{CONTACT_USER}</span></a>
+ <div class="dropdown hidden">
+ <div class="pointer"><div class="pointer-inner"></div></div>
+ <div class="dropdown-contents contact-icons">
+ <!-- BEGIN contact -->
+ {% set REMAINDER = contact.S_ROW_COUNT % 4 %}
+ <!-- DEFINE $S_LAST_CELL = ((REMAINDER eq 3) or (contact.S_LAST_ROW and contact.S_NUM_ROWS < 4)) -->
+ <!-- IF REMAINDER eq 0 -->
+ <div>
+ <!-- ENDIF -->
+ <a href="<!-- IF contact.U_CONTACT -->{contact.U_CONTACT}<!-- ELSE -->{contact.U_PROFILE_AUTHOR}<!-- ENDIF -->" title="{contact.NAME}"<!-- IF $S_LAST_CELL --> class="last-cell"<!-- ENDIF --><!-- IF contact.ID eq 'jabber' --> onclick="popup(this.href, 750, 320); return false;"<!-- ENDIF -->>
+ <span class="contact-icon {contact.ID}-icon">{contact.NAME}</span>
+ </a>
+ <!-- IF REMAINDER eq 3 or contact.S_LAST_ROW -->
+ </div>
+ <!-- ENDIF -->
+ <!-- END contact -->
+ </div>
+ </div>
+ </div>
+ </dd>
+ <!-- ENDIF -->
+ <!-- EVENT ucp_pm_viewmessage_contact_fields_after -->
+ </dl>
<div class="postbody">
+ <h3 class="first">{SUBJECT}</h3>
- <!-- IF U_DELETE or U_EDIT or U_QUOTE or U_REPORT -->
- <ul class="profile-icons">
- <!-- IF U_EDIT --><li class="edit-icon"><a href="{U_EDIT}" title="{L_POST_EDIT_PM}"><span>{L_POST_EDIT_PM}</span></a></li><!-- ENDIF -->
- <!-- IF U_DELETE --><li class="delete-icon"><a href="{U_DELETE}" title="{L_DELETE_MESSAGE}"><span>{L_DELETE_MESSAGE}</span></a></li><!-- ENDIF -->
- <!-- IF U_REPORT --><li class="report-icon"><a href="{U_REPORT}" title="{L_REPORT_PM}"><span>{L_REPORT_PM}</span></a></li><!-- ENDIF -->
- <!-- IF U_QUOTE --><li class="quote-icon"><a href="{U_QUOTE}" title="{L_POST_QUOTE_PM}"><span>{L_POST_QUOTE_PM}</span></a></li><!-- ENDIF -->
+ <!-- DEFINE $SHOW_PM_POST_BUTTONS = (U_EDIT or U_DELETE or U_REPORT or U_QUOTE) -->
+ <!-- EVENT ucp_pm_viewmessage_post_buttons_list_before -->
+ <!-- IF $SHOW_PM_POST_BUTTONS -->
+ <ul class="post-buttons">
+ <!-- EVENT ucp_pm_viewmessage_post_buttons_before -->
+ <!-- IF U_EDIT -->
+ <li>
+ <a href="{U_EDIT}" title="{L_POST_EDIT_PM}" class="button icon-button edit-icon"><span>{L_POST_EDIT_PM}</span></a>
+ </li>
+ <!-- ENDIF -->
+ <!-- IF U_DELETE -->
+ <li>
+ <a href="{U_DELETE}" title="{L_DELETE_MESSAGE}" class="button icon-button delete-icon"><span>{L_DELETE_MESSAGE}</span></a>
+ </li>
+ <!-- ENDIF -->
+ <!-- IF U_REPORT -->
+ <li>
+ <a href="{U_REPORT}" title="{L_REPORT_PM}" class="button icon-button report-icon"><span>{L_REPORT_PM}</span></a>
+ </li>
+ <!-- ENDIF -->
+ <!-- IF U_QUOTE -->
+ <li>
+ <a href="{U_QUOTE}" title="{L_POST_QUOTE_PM}" class="button icon-button quote-icon"><span>{L_POST_QUOTE_PM}</span></a>
+ </li>
+ <!-- ENDIF -->
+ <!-- EVENT ucp_pm_viewmessage_post_buttons_after -->
</ul>
<!-- ENDIF -->
-
- <h3 class="first">{SUBJECT}</h3>
+ <!-- EVENT ucp_pm_viewmessage_post_buttons_list_after -->
<p class="author">
- <strong>{L_SENT_AT}:</strong> {SENT_DATE}
- <br /><strong>{L_PM_FROM}:</strong> {MESSAGE_AUTHOR_FULL}
- <!-- IF S_TO_RECIPIENT --><br /><strong>{L_TO}:</strong> <!-- BEGIN to_recipient --><!-- IF to_recipient.NAME_FULL -->{to_recipient.NAME_FULL}<!-- ELSE --><a href="{to_recipient.U_VIEW}" style="color:<!-- IF to_recipient.COLOUR -->{to_recipient.COLOUR}<!-- ELSEIF to_recipient.IS_GROUP -->#0000FF<!-- ENDIF -->;">{to_recipient.NAME}</a><!-- ENDIF -->&nbsp;<!-- END to_recipient --><!-- ENDIF -->
- <!-- IF S_BCC_RECIPIENT --><br /><strong>{L_BCC}:</strong> <!-- BEGIN bcc_recipient --><!-- IF bcc_recipient.NAME_FULL -->{bcc_recipient.NAME_FULL}<!-- ELSE --><a href="{bcc_recipient.U_VIEW}" style="color:<!-- IF bcc_recipient.COLOUR -->{bcc_recipient.COLOUR}<!-- ELSEIF bcc_recipient.IS_GROUP -->#0000FF<!-- ENDIF -->;">{bcc_recipient.NAME}</a><!-- ENDIF -->&nbsp;<!-- END bcc_recipient --><!-- ENDIF -->
+ <strong>{L_SENT_AT}{L_COLON}</strong> {SENT_DATE}
+ <br /><strong>{L_PM_FROM}{L_COLON}</strong> {MESSAGE_AUTHOR_FULL}
+ <!-- IF S_TO_RECIPIENT --><br /><strong>{L_TO}{L_COLON}</strong> <!-- BEGIN to_recipient --><!-- IF to_recipient.NAME_FULL -->{to_recipient.NAME_FULL}<!-- ELSE --><a href="{to_recipient.U_VIEW}" style="color:<!-- IF to_recipient.COLOUR -->{to_recipient.COLOUR}<!-- ELSEIF to_recipient.IS_GROUP -->#0000FF<!-- ENDIF -->;">{to_recipient.NAME}</a><!-- ENDIF -->&nbsp;<!-- END to_recipient --><!-- ENDIF -->
+ <!-- IF S_BCC_RECIPIENT --><br /><strong>{L_BCC}{L_COLON}</strong> <!-- BEGIN bcc_recipient --><!-- IF bcc_recipient.NAME_FULL -->{bcc_recipient.NAME_FULL}<!-- ELSE --><a href="{bcc_recipient.U_VIEW}" style="color:<!-- IF bcc_recipient.COLOUR -->{bcc_recipient.COLOUR}<!-- ELSEIF bcc_recipient.IS_GROUP -->#0000FF<!-- ENDIF -->;">{bcc_recipient.NAME}</a><!-- ENDIF -->&nbsp;<!-- END bcc_recipient --><!-- ENDIF -->
</p>
<div class="content">{MESSAGE}</div>
<!-- IF S_HAS_ATTACHMENTS -->
- <dl class="attachbox">
- <dt>{L_ATTACHMENTS}</dt>
- <!-- BEGIN attachment -->
- <dd>{attachment.DISPLAY_ATTACHMENT}</dd>
- <!-- END attachment -->
- </dl>
+ <dl class="attachbox">
+ <dt>
+ {L_ATTACHMENTS}
+ </dt>
+ <!-- BEGIN attachment -->
+ <dd>{attachment.DISPLAY_ATTACHMENT}</dd>
+ <!-- END attachment -->
+ </dl>
<!-- ENDIF -->
<!-- IF S_DISPLAY_NOTICE -->
- <div class="rules">{L_DOWNLOAD_NOTICE}</div>
+ <div class="post-notice error">{L_DOWNLOAD_NOTICE}</div>
<!-- ENDIF -->
<!-- IF EDITED_MESSAGE or EDIT_REASON -->
<div class="notice">{EDITED_MESSAGE}
- <!-- IF EDIT_REASON --><br /><strong>{L_REASON}:</strong> <em>{EDIT_REASON}</em><!-- ENDIF -->
+ <!-- IF EDIT_REASON --><br /><strong>{L_REASON}{L_COLON}</strong> <em>{EDIT_REASON}</em><!-- ENDIF -->
</div>
<!-- ENDIF -->
@@ -64,43 +141,19 @@
<!-- ENDIF -->
</div>
- <dl class="postprofile" id="profile{MESSAGE_ID}">
- <dt><!-- IF AUTHOR_AVATAR --><a href="{U_MESSAGE_AUTHOR}">{AUTHOR_AVATAR}</a><br /><!-- ENDIF -->{MESSAGE_AUTHOR_FULL}</dt>
- <!-- IF RANK_TITLE --><dd>{RANK_TITLE}</dd><!-- ENDIF -->
- <!-- IF RANK_IMG --><dd>{RANK_IMG}</dd><!-- ENDIF -->
- <dd>&nbsp;</dd>
- <dd><strong>{L_POSTS}:</strong> {AUTHOR_POSTS}</dd>
- <!-- IF AUTHOR_JOINED --><dd><strong>{L_JOINED}:</strong> {AUTHOR_JOINED}</dd><!-- ENDIF -->
- <!-- IF AUTHOR_FROM --><dd><strong>{L_LOCATION}:</strong> {AUTHOR_FROM}</dd><!-- ENDIF -->
-
- <!-- IF U_PM or U_EMAIL or U_WWW or U_MSN or U_ICQ or U_YIM or U_AIM or U_JABBER -->
- <dd>
- <ul class="profile-icons">
- <!-- IF U_PM --><li class="pm-icon"><a href="{U_PM}" title="{L_PRIVATE_MESSAGE}"><span>{L_PRIVATE_MESSAGE}</span></a></li><!-- ENDIF -->
- <!-- IF U_EMAIL --><li class="email-icon"><a href="{U_EMAIL}" title="{L_SEND_EMAIL_USER} {MESSAGE_AUTHOR}"><span>{L_SEND_EMAIL_USER} {MESSAGE_AUTHOR}</span></a></li><!-- ENDIF -->
- <!-- IF U_WWW --><li class="web-icon"><a href="{U_WWW}" title="{L_VISIT_WEBSITE}: {U_WWW}"><span>{L_WEBSITE}</span></a></li><!-- ENDIF -->
- <!-- IF U_MSN --><li class="msnm-icon"><a href="{U_MSN}" onclick="popup(this.href, 550, 320); return false;" title="{L_MSNM}"><span>{L_MSNM}</span></a></li><!-- ENDIF -->
- <!-- IF U_ICQ --><li class="icq-icon"><a href="{U_ICQ}" onclick="popup(this.href, 550, 320); return false;" title="{L_ICQ}"><span>{L_ICQ}</span></a></li><!-- ENDIF -->
- <!-- IF U_YIM --><li class="yahoo-icon"><a href="{U_YIM}" onclick="popup(this.href, 780, 550); return false;" title="{L_YIM}"><span>{L_YIM}</span></a></li><!-- ENDIF -->
- <!-- IF U_AIM --><li class="aim-icon"><a href="{U_AIM}" onclick="popup(this.href, 550, 320); return false;" title="{L_AIM}"><span>{L_AIM}</span></a></li><!-- ENDIF -->
- <!-- IF U_JABBER --><li class="jabber-icon"><a href="{U_JABBER}" onclick="popup(this.href, 550, 320); return false;" title="{L_JABBER}"><span>{L_JABBER}</span></a></li><!-- ENDIF -->
- </ul>
- </dd>
- <!-- ENDIF -->
- </dl>
-
<div class="back2top"><a href="#top" class="top" title="{L_BACK_TO_TOP}">{L_BACK_TO_TOP}</a></div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
+<!-- EVENT ucp_pm_viewmessage_options_before -->
<!-- IF S_VIEW_MESSAGE -->
<fieldset class="display-options">
- <!-- IF U_PREVIOUS_PM --><a href="{U_PREVIOUS_PM}" class="left-box {S_CONTENT_FLOW_BEGIN}">{L_VIEW_PREVIOUS_PM}</a><!-- ENDIF -->
- <!-- IF U_NEXT_PM --><a href="{U_NEXT_PM}" class="right-box {S_CONTENT_FLOW_END}">{L_VIEW_NEXT_PM}</a><!-- ENDIF -->
+ <!-- IF U_PREVIOUS_PM --><a href="{U_PREVIOUS_PM}" class="left-box arrow-{S_CONTENT_FLOW_BEGIN}">{L_VIEW_PREVIOUS_PM}</a><!-- ENDIF -->
+ <!-- IF U_NEXT_PM --><a href="{U_NEXT_PM}" class="right-box arrow-{S_CONTENT_FLOW_END}">{L_VIEW_NEXT_PM}</a><!-- ENDIF -->
<!-- IF S_MARK_OPTIONS --><label for="mark_option"><select name="mark_option" id="mark_option">{S_MARK_OPTIONS}</select></label>&nbsp;<input class="button2" type="submit" name="submit_mark" value="{L_GO}" /><!-- ENDIF -->
- <!-- IF not S_UNREAD and not S_SPECIAL_FOLDER --><label for="dest_folder"><!-- IF S_VIEW_MESSAGE -->{L_MOVE_TO_FOLDER}: <!-- ELSE -->{L_MOVE_MARKED_TO_FOLDER}<!-- ENDIF --> <select name="dest_folder" id="dest_folder">{S_TO_FOLDER_OPTIONS}</select></label> <input class="button2" type="submit" name="move_pm" value="{L_GO}" /><!-- ENDIF -->
+ <!-- IF not S_UNREAD and not S_SPECIAL_FOLDER --><label for="dest_folder"><!-- IF S_VIEW_MESSAGE -->{L_MOVE_TO_FOLDER}{L_COLON} <!-- ELSE -->{L_MOVE_MARKED_TO_FOLDER}<!-- ENDIF --> <select name="dest_folder" id="dest_folder">{S_TO_FOLDER_OPTIONS}</select></label> <input class="button2" type="submit" name="move_pm" value="{L_GO}" /><!-- ENDIF -->
<input type="hidden" name="marked_msg_id[]" value="{MSG_ID}" />
<input type="hidden" name="cur_folder_id" value="{CUR_FOLDER_ID}" />
<input type="hidden" name="p" value="{MSG_ID}" />
@@ -111,4 +164,4 @@
<!-- IF S_DISPLAY_HISTORY --><!-- INCLUDE ucp_pm_history.html --><!-- ENDIF -->
-<!-- INCLUDE ucp_footer.html --> \ No newline at end of file
+<!-- INCLUDE ucp_footer.html -->
diff --git a/phpBB/styles/prosilver/template/ucp_pm_viewmessage_print.html b/phpBB/styles/prosilver/template/ucp_pm_viewmessage_print.html
index 91dd4606c8..d431561834 100644
--- a/phpBB/styles/prosilver/template/ucp_pm_viewmessage_print.html
+++ b/phpBB/styles/prosilver/template/ucp_pm_viewmessage_print.html
@@ -1,23 +1,18 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" dir="{S_CONTENT_DIRECTION}" lang="{S_USER_LANG}" xml:lang="{S_USER_LANG}">
+<!DOCTYPE html>
+<html dir="{S_CONTENT_DIRECTION}" lang="{S_USER_LANG}">
<head>
-
-<meta http-equiv="content-type" content="text/html; charset={S_CONTENT_ENCODING}" />
-<meta http-equiv="content-style-type" content="text/css" />
-<meta http-equiv="content-language" content="{S_USER_LANG}" />
-<meta http-equiv="imagetoolbar" content="no" />
-<meta name="resource-type" content="document" />
-<meta name="distribution" content="global" />
+<meta charset="utf-8" />
+<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="robots" content="noindex" />
{META}
<title>{SITENAME} &bull; {PAGE_TITLE}</title>
-<link href="{T_THEME_PATH}/print.css" rel="stylesheet" type="text/css" />
+<link href="{T_THEME_PATH}/print.css" rel="stylesheet">
+<!-- EVENT ucp_pm_viewmessage_print_head_append -->
</head>
-
<body id="phpbb">
<div id="wrap">
- <a id="top" name="top" accesskey="t"></a>
+ <a id="top" class="anchor" accesskey="t"></a>
<div id="page-header">
<h1>{SITENAME}</h1>
@@ -46,9 +41,9 @@
<div id="page-footer">
<div class="page-number">{S_TIMEZONE}<br />{PAGE_NUMBER}</div>
- <div class="copyright">Powered by phpBB&reg; Forum Software &copy; phpBB Group<br />https://www.phpbb.com/</div>
+ <div class="copyright">Powered by phpBB&reg; Forum Software &copy; phpBB Limited<br />https://www.phpbb.com/</div>
</div>
</div>
</body>
-</html> \ No newline at end of file
+</html>
diff --git a/phpBB/styles/prosilver/template/ucp_prefs_personal.html b/phpBB/styles/prosilver/template/ucp_prefs_personal.html
index 600319fc72..4cd9f6655b 100644
--- a/phpBB/styles/prosilver/template/ucp_prefs_personal.html
+++ b/phpBB/styles/prosilver/template/ucp_prefs_personal.html
@@ -5,103 +5,81 @@
<h2>{L_TITLE}</h2>
<div class="panel">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<fieldset>
<!-- IF ERROR --><p class="error">{ERROR}</p><!-- ENDIF -->
+ <!-- EVENT ucp_prefs_personal_prepend -->
<dl>
- <dt><label for="viewemail0">{L_SHOW_EMAIL}:</label></dt>
+ <dt><label for="viewemail0">{L_SHOW_EMAIL}{L_COLON}</label></dt>
<dd>
- <label for="viewemail1"><input type="radio" name="viewemail" id="viewemail1" value="1"<!-- IF S_VIEW_EMAIL --> checked="checked"<!-- ENDIF --> /> {L_YES}</label>
+ <label for="viewemail1"><input type="radio" name="viewemail" id="viewemail1" value="1"<!-- IF S_VIEW_EMAIL --> checked="checked"<!-- ENDIF --> /> {L_YES}</label>
<label for="viewemail0"><input type="radio" name="viewemail" id="viewemail0" value="0"<!-- IF not S_VIEW_EMAIL --> checked="checked"<!-- ENDIF --> /> {L_NO}</label>
</dd>
</dl>
<dl>
- <dt><label for="massemail1">{L_ADMIN_EMAIL}:</label></dt>
+ <dt><label for="massemail1">{L_ADMIN_EMAIL}{L_COLON}</label></dt>
<dd>
- <label for="massemail1"><input type="radio" name="massemail" id="massemail1" value="1"<!-- IF S_MASS_EMAIL --> checked="checked"<!-- ENDIF --> /> {L_YES}</label>
+ <label for="massemail1"><input type="radio" name="massemail" id="massemail1" value="1"<!-- IF S_MASS_EMAIL --> checked="checked"<!-- ENDIF --> /> {L_YES}</label>
<label for="massemail0"><input type="radio" name="massemail" id="massemail0" value="0"<!-- IF not S_MASS_EMAIL --> checked="checked"<!-- ENDIF --> /> {L_NO}</label>
</dd>
</dl>
<dl>
- <dt><label for="allowpm1">{L_ALLOW_PM}:</label><br /><span>{L_ALLOW_PM_EXPLAIN}</span></dt>
+ <dt><label for="allowpm1">{L_ALLOW_PM}{L_COLON}</label><br /><span>{L_ALLOW_PM_EXPLAIN}</span></dt>
<dd>
- <label for="allowpm1"><input type="radio" name="allowpm" id="allowpm1" value="1"<!-- IF S_ALLOW_PM --> checked="checked"<!-- ENDIF --> /> {L_YES}</label>
+ <label for="allowpm1"><input type="radio" name="allowpm" id="allowpm1" value="1"<!-- IF S_ALLOW_PM --> checked="checked"<!-- ENDIF --> /> {L_YES}</label>
<label for="allowpm0"><input type="radio" name="allowpm" id="allowpm0" value="0"<!-- IF not S_ALLOW_PM --> checked="checked"<!-- ENDIF --> /> {L_NO}</label>
</dd>
</dl>
<!-- IF S_CAN_HIDE_ONLINE -->
<dl>
- <dt><label for="hideonline0">{L_HIDE_ONLINE}:</label><br /><span>{L_HIDE_ONLINE_EXPLAIN}</span></dt>
+ <dt><label for="hideonline0">{L_HIDE_ONLINE}{L_COLON}</label><br /><span>{L_HIDE_ONLINE_EXPLAIN}</span></dt>
<dd>
- <label for="hideonline1"><input type="radio" name="hideonline" id="hideonline1" value="1"<!-- IF S_HIDE_ONLINE --> checked="checked"<!-- ENDIF --> /> {L_YES}</label>
+ <label for="hideonline1"><input type="radio" name="hideonline" id="hideonline1" value="1"<!-- IF S_HIDE_ONLINE --> checked="checked"<!-- ENDIF --> /> {L_YES}</label>
<label for="hideonline0"><input type="radio" name="hideonline" id="hideonline0" value="0"<!-- IF not S_HIDE_ONLINE --> checked="checked"<!-- ENDIF --> /> {L_NO}</label>
</dd>
</dl>
- <!-- ENDIF -->
+ <!-- ENDIF -->
<!-- IF S_SELECT_NOTIFY -->
<dl>
- <dt><label for="notifymethod0">{L_NOTIFY_METHOD}:</label></dt>
+ <dt><label for="notifymethod0">{L_NOTIFY_METHOD}{L_COLON}</label></dt>
<dd>
- <label for="notifymethod0"><input type="radio" name="notifymethod" id="notifymethod0" value="0"<!-- IF S_NOTIFY_EMAIL --> checked="checked"<!-- ENDIF --> /> {L_NOTIFY_METHOD_EMAIL}</label>
- <label for="notifymethod1"><input type="radio" name="notifymethod" id="notifymethod1" value="1"<!-- IF S_NOTIFY_IM --> checked="checked"<!-- ENDIF --> /> {L_NOTIFY_METHOD_IM}</label>
+ <label for="notifymethod0"><input type="radio" name="notifymethod" id="notifymethod0" value="0"<!-- IF S_NOTIFY_EMAIL --> checked="checked"<!-- ENDIF --> /> {L_NOTIFY_METHOD_EMAIL}</label>
+ <label for="notifymethod1"><input type="radio" name="notifymethod" id="notifymethod1" value="1"<!-- IF S_NOTIFY_IM --> checked="checked"<!-- ENDIF --> /> {L_NOTIFY_METHOD_IM}</label>
<label for="notifymethod2"><input type="radio" name="notifymethod" id="notifymethod2" value="2"<!-- IF S_NOTIFY_BOTH --> checked="checked"<!-- ENDIF --> /> {L_NOTIFY_METHOD_BOTH}</label>
</dd>
</dl>
<!-- ENDIF -->
- <dl>
- <dt><label for="notifypm1">{L_NOTIFY_ON_PM}:</label></dt>
- <dd>
- <label for="notifypm1"><input type="radio" name="notifypm" id="notifypm1" value="1"<!-- IF S_NOTIFY_PM --> checked="checked"<!-- ENDIF --> /> {L_YES}</label>
- <label for="notifypm0"><input type="radio" name="notifypm" id="notifypm0" value="0"<!-- IF not S_NOTIFY_PM --> checked="checked"<!-- ENDIF --> /> {L_NO}</label>
- </dd>
- </dl>
- <dl>
- <dt><label for="popuppm0">{L_POPUP_ON_PM}:</label></dt>
- <dd>
- <label for="popuppm1"><input type="radio" name="popuppm" id="popuppm1" value="1"<!-- IF S_POPUP_PM --> checked="checked"<!-- ENDIF --> /> {L_YES}</label>
- <label for="popuppm0"><input type="radio" name="popuppm" id="popuppm0" value="0"<!-- IF not S_POPUP_PM --> checked="checked"<!-- ENDIF --> /> {L_NO}</label>
- </dd>
- </dl>
<!-- IF S_MORE_LANGUAGES -->
<dl>
- <dt><label for="lang">{L_BOARD_LANGUAGE}:</label></dt>
+ <dt><label for="lang">{L_BOARD_LANGUAGE}{L_COLON}</label></dt>
<dd><select name="lang" id="lang">{S_LANG_OPTIONS}</select></dd>
</dl>
<!-- ENDIF -->
<!-- IF S_STYLE_OPTIONS and S_MORE_STYLES -->
<dl>
- <dt><label for="style">{L_BOARD_STYLE}:</label></dt>
- <dd><select name="style" id="style">{S_STYLE_OPTIONS}</select></dd>
+ <dt><label for="user_style">{L_BOARD_STYLE}{L_COLON}</label></dt>
+ <dd><select name="user_style" id="user_style">{S_STYLE_OPTIONS}</select></dd>
</dl>
<!-- ENDIF -->
+ <!-- INCLUDE timezone_option.html -->
<dl>
- <dt><label for="timezone">{L_BOARD_TIMEZONE}:</label></dt>
- <dd><select name="tz" id="timezone" class="autowidth">{S_TZ_OPTIONS}</select></dd>
- </dl>
- <dl>
- <dt><label for="dst1">{L_BOARD_DST}:</label></dt>
- <dd>
- <label for="dst1"><input type="radio" name="dst" id="dst1" value="1"<!-- IF S_DST --> checked="checked"<!-- ENDIF --> /> {L_YES}</label>
- <label for="dst0"><input type="radio" name="dst" id="dst0" value="0"<!-- IF not S_DST --> checked="checked"<!-- ENDIF --> /> {L_NO}</label>
- </dd>
- </dl>
- <dl>
- <dt><label for="dateformat">{L_BOARD_DATE_FORMAT}:</label><br /><span>{L_BOARD_DATE_FORMAT_EXPLAIN}</span></dt>
+ <dt><label for="dateformat">{L_BOARD_DATE_FORMAT}{L_COLON}</label><br /><span>{L_BOARD_DATE_FORMAT_EXPLAIN}</span></dt>
<dd>
- <select name="dateoptions" id="dateoptions" onchange="if(this.value=='custom'){dE('custom_date',1);}else{dE('custom_date',-1);} if (this.value == 'custom') { document.getElementById('dateformat').value = default_dateformat; } else { document.getElementById('dateformat').value = this.value; }">
+ <select name="dateoptions" id="dateoptions" onchange="if(this.value=='custom'){phpbb.toggleDisplay('custom_date',1);}else{phpbb.toggleDisplay('custom_date',-1);} if (this.value == 'custom') { document.getElementById('dateformat').value = default_dateformat; } else { document.getElementById('dateformat').value = this.value; }">
{S_DATEFORMAT_OPTIONS}
</select>
</dd>
- <dd id="custom_date" style="display:none;"><input type="text" name="dateformat" id="dateformat" value="{DATE_FORMAT}" maxlength="30" class="inputbox narrow" style="margin-top: 3px;" /></dd>
+ <dd id="custom_date" style="display:none;"><input type="text" name="dateformat" id="dateformat" value="{DATE_FORMAT}" maxlength="64" class="inputbox narrow" style="margin-top: 3px;" /></dd>
</dl>
+ <!-- EVENT ucp_prefs_personal_append -->
</fieldset>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
-
+
<fieldset class="submit-buttons">
- {S_HIDDEN_FIELDS}<input type="reset" value="{L_RESET}" name="reset" class="button2" />&nbsp;
+ {S_HIDDEN_FIELDS}<input type="reset" value="{L_RESET}" name="reset" class="button2" />&nbsp;
<input type="submit" name="submit" value="{L_SUBMIT}" class="button1" />
{S_FORM_TOKEN}
</fieldset>
@@ -115,9 +93,9 @@
function customDates()
{
var e = document.getElementById('dateoptions');
-
+
e.selectedIndex = e.length - 1;
-
+
// Loop and match date_format in menu
for (var i = 0; i < e.length; i++)
{
@@ -127,20 +105,20 @@
break;
}
}
-
+
// Show/hide custom field
if (e.selectedIndex == e.length - 1)
{
- dE('custom_date',1);
+ phpbb.toggleDisplay('custom_date',1);
}
else
{
- dE('custom_date',-1);
+ phpbb.toggleDisplay('custom_date',-1);
}
}
- customDates();
+ window.onload = customDates;
// ]]>
</script>
-<!-- INCLUDE ucp_footer.html --> \ No newline at end of file
+<!-- INCLUDE ucp_footer.html -->
diff --git a/phpBB/styles/prosilver/template/ucp_prefs_post.html b/phpBB/styles/prosilver/template/ucp_prefs_post.html
index 74af90ca5a..891e49af6f 100644
--- a/phpBB/styles/prosilver/template/ucp_prefs_post.html
+++ b/phpBB/styles/prosilver/template/ucp_prefs_post.html
@@ -4,41 +4,43 @@
<h2>{L_TITLE}</h2>
<div class="panel">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<fieldset>
<!-- IF ERROR --><p class="error">{ERROR}</p><!-- ENDIF -->
+ <!-- EVENT ucp_prefs_post_prepend -->
<dl>
- <dt><label for="bbcode1">{L_DEFAULT_BBCODE}:</label></dt>
+ <dt><label for="bbcode1">{L_DEFAULT_BBCODE}{L_COLON}</label></dt>
<dd>
<label for="bbcode1"><input type="radio" name="bbcode" id="bbcode1" value="1"<!-- IF S_BBCODE --> checked="checked"<!-- ENDIF --> /> {L_YES}</label>
<label for="bbcode0"><input type="radio" name="bbcode" id="bbcode0" value="0"<!-- IF not S_BBCODE --> checked="checked"<!-- ENDIF --> /> {L_NO}</label>
</dd>
</dl>
<dl>
- <dt><label for="smilies1">{L_DEFAULT_SMILIES}:</label></dt>
+ <dt><label for="smilies1">{L_DEFAULT_SMILIES}{L_COLON}</label></dt>
<dd>
<label for="smilies1"><input type="radio" name="smilies" id="smilies1" value="1"<!-- IF S_SMILIES --> checked="checked"<!-- ENDIF --> /> {L_YES}</label>
<label for="smilies0"><input type="radio" name="smilies" id="smilies0" value="0"<!-- IF not S_SMILIES --> checked="checked"<!-- ENDIF --> /> {L_NO}</label>
</dd>
</dl>
<dl>
- <dt><label for="sig1">{L_DEFAULT_ADD_SIG}:</label></dt>
+ <dt><label for="sig1">{L_DEFAULT_ADD_SIG}{L_COLON}</label></dt>
<dd>
<label for="sig1"><input type="radio" name="sig" id="sig1" value="1"<!-- IF S_SIG --> checked="checked"<!-- ENDIF --> /> {L_YES}</label>
<label for="sig0"><input type="radio" name="sig" id="sig0" value="0"<!-- IF not S_SIG --> checked="checked"<!-- ENDIF --> /> {L_NO}</label>
</dd>
</dl>
<dl>
- <dt><label for="notify1">{L_DEFAULT_NOTIFY}:</label></dt>
+ <dt><label for="notify1">{L_DEFAULT_NOTIFY}{L_COLON}</label></dt>
<dd>
<label for="notify1"><input type="radio" name="notify" id="notify1" value="1"<!-- IF S_NOTIFY --> checked="checked"<!-- ENDIF --> /> {L_YES}</label>
<label for="notify0"><input type="radio" name="notify" id="notify0" value="0"<!-- IF not S_NOTIFY --> checked="checked"<!-- ENDIF --> /> {L_NO}</label>
</dd>
</dl>
+ <!-- EVENT ucp_prefs_post_append -->
</fieldset>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<fieldset class="submit-buttons">
@@ -48,4 +50,4 @@
</fieldset>
</form>
-<!-- INCLUDE ucp_footer.html --> \ No newline at end of file
+<!-- INCLUDE ucp_footer.html -->
diff --git a/phpBB/styles/prosilver/template/ucp_prefs_view.html b/phpBB/styles/prosilver/template/ucp_prefs_view.html
index dc773584df..7f8d0a344c 100644
--- a/phpBB/styles/prosilver/template/ucp_prefs_view.html
+++ b/phpBB/styles/prosilver/template/ucp_prefs_view.html
@@ -5,40 +5,41 @@
<h2>{L_TITLE}</h2>
<div class="panel">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<fieldset>
<!-- IF ERROR --><p class="error">{ERROR}</p><!-- ENDIF -->
+ <!-- EVENT ucp_prefs_view_radio_buttons_prepend -->
<dl>
- <dt><label for="images1">{L_VIEW_IMAGES}:</label></dt>
+ <dt><label for="images1">{L_VIEW_IMAGES}{L_COLON}</label></dt>
<dd>
<label for="images1"><input type="radio" name="images" id="images1" value="1"<!-- IF S_IMAGES --> checked="checked"<!-- ENDIF --> /> {L_YES}</label>
<label for="images0"><input type="radio" name="images" id="images0" value="0"<!-- IF not S_IMAGES --> checked="checked"<!-- ENDIF --> /> {L_NO}</label>
</dd>
</dl>
<dl>
- <dt><label for="flash0">{L_VIEW_FLASH}:</label></dt>
+ <dt><label for="flash0">{L_VIEW_FLASH}{L_COLON}</label></dt>
<dd>
<label for="flash1"><input type="radio" name="flash" id="flash1" value="1"<!-- IF S_FLASH --> checked="checked"<!-- ENDIF --> /> {L_YES}</label>
<label for="flash0"><input type="radio" name="flash" id="flash0" value="0"<!-- IF not S_FLASH --> checked="checked"<!-- ENDIF --> /> {L_NO}</label>
</dd>
</dl>
<dl>
- <dt><label for="smilies1">{L_VIEW_SMILIES}:</label></dt>
+ <dt><label for="smilies1">{L_VIEW_SMILIES}{L_COLON}</label></dt>
<dd>
<label for="smilies1"><input type="radio" name="smilies" id="smilies1" value="1"<!-- IF S_SMILIES --> checked="checked"<!-- ENDIF --> /> {L_YES}</label>
<label for="smilies0"><input type="radio" name="smilies" id="smilies0" value="0"<!-- IF not S_SMILIES --> checked="checked"<!-- ENDIF --> /> {L_NO}</label>
</dd>
</dl>
<dl>
- <dt><label for="sigs1">{L_VIEW_SIGS}:</label></dt>
+ <dt><label for="sigs1">{L_VIEW_SIGS}{L_COLON}</label></dt>
<dd>
<label for="sigs1"><input type="radio" name="sigs" id="sigs1" value="1"<!-- IF S_SIGS --> checked="checked"<!-- ENDIF --> /> {L_YES}</label>
<label for="sigs0"><input type="radio" name="sigs" id="sigs0" value="0"<!-- IF not S_SIGS --> checked="checked"<!-- ENDIF --> /> {L_NO}</label>
</dd>
</dl>
<dl>
- <dt><label for="avatars1">{L_VIEW_AVATARS}:</label></dt>
+ <dt><label for="avatars1">{L_VIEW_AVATARS}{L_COLON}</label></dt>
<dd>
<label for="avatars1"><input type="radio" name="avatars" id="avatars1" value="1"<!-- IF S_AVATARS --> checked="checked"<!-- ENDIF --> /> {L_YES}</label>
<label for="avatars0"><input type="radio" name="avatars" id="avatars0" value="0"<!-- IF not S_AVATARS --> checked="checked"<!-- ENDIF --> /> {L_NO}</label>
@@ -46,42 +47,45 @@
</dl>
<!-- IF S_CHANGE_CENSORS -->
<dl>
- <dt><label for="wordcensor1">{L_DISABLE_CENSORS}:</label></dt>
+ <dt><label for="wordcensor1">{L_DISABLE_CENSORS}{L_COLON}</label></dt>
<dd>
<label for="wordcensor1"><input type="radio" name="wordcensor" id="wordcensor1" value="1"<!-- IF S_DISABLE_CENSORS --> checked="checked"<!-- ENDIF --> /> {L_YES}</label>
<label for="wordcensor0"><input type="radio" name="wordcensor" id="wordcensor0" value="0"<!-- IF not S_DISABLE_CENSORS --> checked="checked"<!-- ENDIF --> /> {L_NO}</label>
</dd>
</dl>
<!-- ENDIF -->
+ <!-- EVENT ucp_prefs_view_radio_buttons_append -->
<hr />
+ <!-- EVENT ucp_prefs_view_select_menu_prepend -->
<dl>
- <dt><label>{L_VIEW_TOPICS_DAYS}:</label></dt>
+ <dt><label>{L_VIEW_TOPICS_DAYS}{L_COLON}</label></dt>
<dd>{S_TOPIC_SORT_DAYS}</dd>
</dl>
<dl>
- <dt><label>{L_VIEW_TOPICS_KEY}:</label></dt>
+ <dt><label>{L_VIEW_TOPICS_KEY}{L_COLON}</label></dt>
<dd>{S_TOPIC_SORT_KEY}</dd>
</dl>
<dl>
- <dt><label>{L_VIEW_TOPICS_DIR}:</label></dt>
+ <dt><label>{L_VIEW_TOPICS_DIR}{L_COLON}</label></dt>
<dd>{S_TOPIC_SORT_DIR}</dd>
</dl>
<hr />
<dl>
- <dt><label>{L_VIEW_POSTS_DAYS}:</label></dt>
+ <dt><label>{L_VIEW_POSTS_DAYS}{L_COLON}</label></dt>
<dd>{S_POST_SORT_DAYS}</dd>
</dl>
<dl>
- <dt><label>{L_VIEW_POSTS_KEY}:</label></dt>
+ <dt><label>{L_VIEW_POSTS_KEY}{L_COLON}</label></dt>
<dd>{S_POST_SORT_KEY}</dd>
</dl>
<dl>
- <dt><label>{L_VIEW_POSTS_DIR}:</label></dt>
+ <dt><label>{L_VIEW_POSTS_DIR}{L_COLON}</label></dt>
<dd>{S_POST_SORT_DIR}</dd>
</dl>
+ <!-- EVENT ucp_prefs_view_select_menu_append -->
</fieldset>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<fieldset class="submit-buttons">
@@ -91,4 +95,4 @@
</fieldset>
</form>
-<!-- INCLUDE ucp_footer.html --> \ No newline at end of file
+<!-- INCLUDE ucp_footer.html -->
diff --git a/phpBB/styles/prosilver/template/ucp_profile_autologin_keys.html b/phpBB/styles/prosilver/template/ucp_profile_autologin_keys.html
new file mode 100644
index 0000000000..65909b7068
--- /dev/null
+++ b/phpBB/styles/prosilver/template/ucp_profile_autologin_keys.html
@@ -0,0 +1,45 @@
+<!-- INCLUDE ucp_header.html -->
+
+<form id="ucp" method="post" action="{S_UCP_ACTION}"{S_FORM_ENCTYPE}>
+
+<h2>{L_TITLE}</h2>
+<div class="panel">
+ <div class="inner">
+ <p>{L_PROFILE_AUTOLOGIN_KEYS}</p>
+ <!-- IF ERROR --><p class="error">{ERROR}</p><!-- ENDIF -->
+ <table class="table1">
+ <thead>
+ <tr>
+ <th class="name">{L_LOGIN_KEY}</th>
+ <th class="center">{L_IP}</th>
+ <th class="center">{L_LOGIN_TIME}</th>
+ <th class="center mark">{L_MARK}</th>
+ </tr>
+ </thead>
+ <tbody>
+ <!-- BEGIN sessions -->
+ <!-- IF sessions.S_ROW_COUNT is even --><tr class="bg1"><!-- ELSE --><tr class="bg2"><!-- ENDIF -->
+ <td><label for="{sessions.KEY}">{sessions.KEY}</label></td>
+ <td class="center">{sessions.IP}</td>
+ <td class="center">{sessions.LOGIN_TIME}</td>
+ <td class="center mark"><input type="checkbox" name="keys[]" value="{sessions.KEY}" id="{sessions.KEY}" /></td>
+ </tr>
+ <!-- BEGINELSE -->
+ <tr><td colspan="4" class="bg1" style="text-align: center">{L_PROFILE_NO_AUTOLOGIN_KEYS}</td></tr>
+ <!-- END sessions -->
+ </tbody>
+ </table>
+ </div>
+</div>
+
+<!-- IF .sessions -->
+ <fieldset class="display-actions">
+ {S_HIDDEN_FIELDS}<input type="submit" name="submit" value="{L_DELETE_MARKED}" class="button2" />
+ <div><a href="#" onclick="$('#ucp input:checkbox').prop('checked', true); return false;">{L_MARK_ALL}</a> &bull; <a href="#" onclick="$('#ucp input:checkbox').prop('checked', false); return false;">{L_UNMARK_ALL}</a></div>
+ {S_FORM_TOKEN}
+ </fieldset>
+<!-- ENDIF -->
+
+</form>
+
+<!-- INCLUDE ucp_footer.html -->
diff --git a/phpBB/styles/prosilver/template/ucp_profile_avatar.html b/phpBB/styles/prosilver/template/ucp_profile_avatar.html
index 2669ed3c22..8157d8c15b 100644
--- a/phpBB/styles/prosilver/template/ucp_profile_avatar.html
+++ b/phpBB/styles/prosilver/template/ucp_profile_avatar.html
@@ -6,14 +6,8 @@
<!-- INCLUDE ucp_avatar_options.html -->
-<fieldset class="submit-buttons">
- {S_HIDDEN_FIELDS}
- <!-- IF S_DISPLAY_GALLERY --><input type="submit" name="display_gallery" value="{L_DISPLAY_GALLERY}" class="button2" />&nbsp; <!-- ENDIF -->
- <!-- IF S_IN_AVATAR_GALLERY --><input type="submit" name="cancel" value="{L_CANCEL}" class="button2" />&nbsp; <!-- ELSE -->
- <input type="reset" value="{L_RESET}" name="reset" class="button2" />&nbsp; <!-- ENDIF -->
- <input type="submit" name="submit" value="{L_SUBMIT}" class="button1" />
- {S_FORM_TOKEN}
-</fieldset>
+{S_HIDDEN_FIELDS}
+{S_FORM_TOKEN}
</form>
-<!-- INCLUDE ucp_footer.html --> \ No newline at end of file
+<!-- INCLUDE ucp_footer.html -->
diff --git a/phpBB/styles/prosilver/template/ucp_profile_profile_info.html b/phpBB/styles/prosilver/template/ucp_profile_profile_info.html
index 0d3a48c334..69eda8c42c 100644
--- a/phpBB/styles/prosilver/template/ucp_profile_profile_info.html
+++ b/phpBB/styles/prosilver/template/ucp_profile_profile_info.html
@@ -2,78 +2,50 @@
<form id="ucp" method="post" action="{S_UCP_ACTION}"{S_FORM_ENCTYPE}>
-<h2>{L_TITLE}</h2>
+<h2>{L_TITLE} <span class="small">[ <a href="{U_USER_PROFILE}" title="{L_VIEW_PROFILE}">{L_VIEW_PROFILE}</a> ]</span></h2>
<div class="panel">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<p>{L_PROFILE_INFO_NOTICE}</p>
<fieldset>
<!-- IF ERROR --><p class="error">{ERROR}</p><!-- ENDIF -->
- <dl>
- <dt><label for="icq">{L_UCP_ICQ}:</label></dt>
- <dd><input type="text" name="icq" id="icq" maxlength="15" value="{ICQ}" class="inputbox" /></dd>
- </dl>
- <dl>
- <dt><label for="aim">{L_UCP_AIM}:</label></dt>
- <dd><input type="text" name="aim" id="aim" maxlength="255" value="{AIM}" class="inputbox" /></dd>
- </dl>
- <dl>
- <dt><label for="msn">{L_UCP_MSNM}:</label></dt>
- <dd><input type="text" name="msn" id="msn" maxlength="255" value="{MSN}" class="inputbox" /></dd>
- </dl>
- <dl>
- <dt><label for="yim">{L_UCP_YIM}:</label></dt>
- <dd><input type="text" name="yim" id="yim" maxlength="255" value="{YIM}" class="inputbox" /></dd>
- </dl>
- <dl>
- <dt><label for="jabber">{L_UCP_JABBER}:</label></dt>
- <dd><input type="text" name="jabber" id="jabber" maxlength="255" value="{JABBER}" class="inputbox" /></dd>
- </dl>
- <dl>
- <dt><label for="website">{L_WEBSITE}:</label></dt>
- <dd><input type="text" name="website" id="website" maxlength="255" value="{WEBSITE}" class="inputbox" /></dd>
- </dl>
- <dl>
- <dt><label for="location">{L_LOCATION}:</label></dt>
- <dd><input type="text" name="location" id="location" maxlength="255" value="{LOCATION}" class="inputbox" /></dd>
- </dl>
- <dl>
- <dt><label for="occupation">{L_OCCUPATION}:</label></dt>
- <dd><textarea name="occupation" id="occupation" class="inputbox" rows="3" cols="30">{OCCUPATION}</textarea></dd>
- </dl>
- <dl>
- <dt><label for="interests">{L_INTERESTS}:</label></dt>
- <dd><textarea name="interests" id="interests" class="inputbox" rows="3" cols="30">{INTERESTS}</textarea></dd>
- </dl>
+ <!-- EVENT ucp_profile_profile_info_before -->
<!-- IF S_BIRTHDAYS_ENABLED -->
<dl>
- <dt><label for="bday_day">{L_BIRTHDAY}:</label><br /><span>{L_BIRTHDAY_EXPLAIN}</span></dt>
+ <dt><label for="bday_day">{L_BIRTHDAY}{L_COLON}</label><br /><span>{L_BIRTHDAY_EXPLAIN}</span></dt>
<dd>
- <label for="bday_day">{L_DAY}: <select name="bday_day" id="bday_day">{S_BIRTHDAY_DAY_OPTIONS}</select></label>
- <label for="bday_month">{L_MONTH}: <select name="bday_month" id="bday_month">{S_BIRTHDAY_MONTH_OPTIONS}</select></label>
- <label for="bday_year">{L_YEAR}: <select name="bday_year" id="bday_year">{S_BIRTHDAY_YEAR_OPTIONS}</select></label>
+ <label for="bday_day">{L_DAY}{L_COLON} <select name="bday_day" id="bday_day">{S_BIRTHDAY_DAY_OPTIONS}</select></label>
+ <label for="bday_month">{L_MONTH}{L_COLON} <select name="bday_month" id="bday_month">{S_BIRTHDAY_MONTH_OPTIONS}</select></label>
+ <label for="bday_year">{L_YEAR}{L_COLON} <select name="bday_year" id="bday_year">{S_BIRTHDAY_YEAR_OPTIONS}</select></label>
</dd>
</dl>
<!-- ENDIF -->
+ <!-- IF S_JABBER_ENABLED -->
+ <dl>
+ <dt><label for="jabber">{L_UCP_JABBER}{L_COLON}</label></dt>
+ <dd><input type="email" name="jabber" id="jabber" maxlength="255" value="{JABBER}" class="inputbox" /></dd>
+ </dl>
+ <!-- ENDIF -->
<!-- BEGIN profile_fields -->
<dl>
- <dt><label<!-- IF profile_fields.FIELD_ID --> for="{profile_fields.FIELD_ID}"<!-- ENDIF -->>{profile_fields.LANG_NAME}:<!-- IF profile_fields.S_REQUIRED --> *<!-- ENDIF --></label>
+ <dt><label<!-- IF profile_fields.FIELD_ID --> for="{profile_fields.FIELD_ID}"<!-- ENDIF -->>{profile_fields.LANG_NAME}{L_COLON}<!-- IF profile_fields.S_REQUIRED --> *<!-- ENDIF --></label>
<!-- IF profile_fields.LANG_EXPLAIN --><br /><span>{profile_fields.LANG_EXPLAIN}</span><!-- ENDIF --></dt>
<!-- IF profile_fields.ERROR --><dd class="error">{profile_fields.ERROR}</dd><!-- ENDIF -->
<dd>{profile_fields.FIELD}</dd>
</dl>
<!-- END profile_fields -->
+ <!-- EVENT ucp_profile_profile_info_after -->
</fieldset>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<fieldset class="submit-buttons">
- {S_HIDDEN_FIELDS}<input type="reset" value="{L_RESET}" name="reset" class="button2" />&nbsp;
+ {S_HIDDEN_FIELDS}<input type="reset" value="{L_RESET}" name="reset" class="button2" />&nbsp;
<input type="submit" name="submit" value="{L_SUBMIT}" class="button1" />
{S_FORM_TOKEN}
</fieldset>
</form>
-<!-- INCLUDE ucp_footer.html --> \ No newline at end of file
+<!-- INCLUDE ucp_footer.html -->
diff --git a/phpBB/styles/prosilver/template/ucp_profile_reg_details.html b/phpBB/styles/prosilver/template/ucp_profile_reg_details.html
index 2f24601645..462a7f8f20 100644
--- a/phpBB/styles/prosilver/template/ucp_profile_reg_details.html
+++ b/phpBB/styles/prosilver/template/ucp_profile_reg_details.html
@@ -4,7 +4,7 @@
<h2>{L_TITLE}</h2>
<div class="panel">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<!-- IF S_FORCE_PASSWORD -->
<p class="error">{L_FORCE_PASSWORD_EXPLAIN}</p>
@@ -12,45 +12,41 @@
<fieldset>
<!-- IF ERROR --><p class="error">{ERROR}</p><!-- ENDIF -->
+ <!-- EVENT ucp_profile_register_details_before -->
<dl>
- <dt><label <!-- IF S_CHANGE_USERNAME -->for="username"<!-- ENDIF -->>{L_USERNAME}:</label><br /><span>{L_USERNAME_EXPLAIN}</span></dt>
+ <dt><label <!-- IF S_CHANGE_USERNAME -->for="username"<!-- ENDIF -->>{L_USERNAME}{L_COLON}</label><br /><span>{L_USERNAME_EXPLAIN}</span></dt>
<dd><!-- IF S_CHANGE_USERNAME --><input type="text" name="username" id="username" value="{USERNAME}" class="inputbox" title="{L_USERNAME}" /><!-- ELSE --><strong>{USERNAME}</strong><!-- ENDIF --></dd>
</dl>
<dl>
- <dt><label for="email">{L_EMAIL_ADDRESS}:</label></dt>
- <dd><!-- IF S_CHANGE_EMAIL --><input type="text" name="email" id="email" maxlength="100" value="{EMAIL}" class="inputbox" title="{L_EMAIL_ADDRESS}" /><!-- ELSE --><strong>{EMAIL}</strong><!-- ENDIF --></dd>
+ <dt><label for="email">{L_EMAIL_ADDRESS}{L_COLON}</label></dt>
+ <dd><!-- IF S_CHANGE_EMAIL --><input type="email" name="email" id="email" maxlength="100" value="{EMAIL}" class="inputbox" title="{L_EMAIL_ADDRESS}" autocomplete="off" /><!-- ELSE --><strong>{EMAIL}</strong><!-- ENDIF --></dd>
</dl>
- <!-- IF S_CHANGE_EMAIL -->
- <dl>
- <dt><label for="email_confirm">{L_CONFIRM_EMAIL}:</label><br /><span>{L_CONFIRM_EMAIL_EXPLAIN}</span></dt>
- <dd><input type="text" name="email_confirm" id="email_confirm" maxlength="100" value="{CONFIRM_EMAIL}" class="inputbox" title="{L_CONFIRM_EMAIL}" /></dd>
- </dl>
- <!-- ENDIF -->
<!-- IF S_CHANGE_PASSWORD -->
<dl>
- <dt><label for="new_password">{L_NEW_PASSWORD}:</label><br /><span>{L_CHANGE_PASSWORD_EXPLAIN}</span></dt>
- <dd><input type="password" name="new_password" id="new_password" maxlength="255" value="{NEW_PASSWORD}" class="inputbox" title="{L_CHANGE_PASSWORD}" /></dd>
+ <dt><label for="new_password">{L_NEW_PASSWORD}{L_COLON}</label><br /><span>{L_CHANGE_PASSWORD_EXPLAIN}</span></dt>
+ <dd><input type="password" name="new_password" id="new_password" maxlength="255" value="{NEW_PASSWORD}" class="inputbox" title="{L_CHANGE_PASSWORD}" autocomplete="off" /></dd>
</dl>
<dl>
- <dt><label for="password_confirm">{L_CONFIRM_PASSWORD}:</label><br /><span>{L_CONFIRM_PASSWORD_EXPLAIN}</span></dt>
- <dd><input type="password" name="password_confirm" id="password_confirm" maxlength="255" value="{PASSWORD_CONFIRM}" class="inputbox" title="{L_CONFIRM_PASSWORD}" /></dd>
+ <dt><label for="password_confirm">{L_CONFIRM_PASSWORD}{L_COLON}</label><br /><span>{L_CONFIRM_PASSWORD_EXPLAIN}</span></dt>
+ <dd><input type="password" name="password_confirm" id="password_confirm" maxlength="255" value="{PASSWORD_CONFIRM}" class="inputbox" title="{L_CONFIRM_PASSWORD}" autocomplete="off" /></dd>
</dl>
<!-- ENDIF -->
+ <!-- EVENT ucp_profile_register_details_after -->
</fieldset>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<div class="panel">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<fieldset>
<dl>
- <dt><label for="cur_password">{L_CURRENT_PASSWORD}:</label><br /><span><!-- IF S_CHANGE_PASSWORD -->{L_CURRENT_CHANGE_PASSWORD_EXPLAIN}<!-- ELSE -->{L_CURRENT_PASSWORD_EXPLAIN}<!-- ENDIF --></span></dt>
- <dd><input type="password" name="cur_password" id="cur_password" maxlength="255" value="{CUR_PASSWORD}" class="inputbox" title="{L_CURRENT_PASSWORD}" /></dd>
+ <dt><label for="cur_password">{L_CURRENT_PASSWORD}{L_COLON}</label><br /><span><!-- IF S_CHANGE_PASSWORD -->{L_CURRENT_CHANGE_PASSWORD_EXPLAIN}<!-- ELSE -->{L_CURRENT_PASSWORD_EXPLAIN}<!-- ENDIF --></span></dt>
+ <dd><input type="password" name="cur_password" id="cur_password" maxlength="255" value="{CUR_PASSWORD}" class="inputbox" title="{L_CURRENT_PASSWORD}" autocomplete="off" /></dd>
</dl>
</fieldset>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<fieldset class="submit-buttons">
diff --git a/phpBB/styles/prosilver/template/ucp_profile_signature.html b/phpBB/styles/prosilver/template/ucp_profile_signature.html
index ab23b84076..614f6f440d 100644
--- a/phpBB/styles/prosilver/template/ucp_profile_signature.html
+++ b/phpBB/styles/prosilver/template/ucp_profile_signature.html
@@ -6,17 +6,17 @@
<!-- IF SIGNATURE_PREVIEW != '' -->
<div class="panel">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<h3>{L_SIGNATURE_PREVIEW}</h3>
<div class="postbody">
- <div class="signature" style="border-top:none; margin-top: 0; ">{SIGNATURE_PREVIEW}</div>
+ <div class="signature standalone">{SIGNATURE_PREVIEW}</div>
+ </div>
</div>
- <span class="corners-bottom"><span></span></span></div>
</div>
<!-- ENDIF -->
<div class="panel">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<p>{L_SIGNATURE_EXPLAIN}</p>
@@ -36,7 +36,7 @@
</fieldset>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<fieldset class="submit-buttons">
@@ -48,4 +48,4 @@
</fieldset>
</form>
-<!-- INCLUDE ucp_footer.html --> \ No newline at end of file
+<!-- INCLUDE ucp_footer.html -->
diff --git a/phpBB/styles/prosilver/template/ucp_register.html b/phpBB/styles/prosilver/template/ucp_register.html
index 0c632f5c69..38413addba 100644
--- a/phpBB/styles/prosilver/template/ucp_register.html
+++ b/phpBB/styles/prosilver/template/ucp_register.html
@@ -7,21 +7,17 @@
*/
function change_language(lang_iso)
{
+ document.cookie = '{COOKIE_NAME}_lang=' + lang_iso + '; path={COOKIE_PATH}';
document.forms['register'].change_lang.value = lang_iso;
document.forms['register'].submit.click();
}
-
- <!-- IF CAPTCHA_TEMPLATE and S_CONFIRM_REFRESH -->
- onload_functions.push('apply_onkeypress_event()');
- <!-- ENDIF -->
-
// ]]>
</script>
-<form method="post" action="{S_UCP_ACTION}" id="register">
+<form id="register" method="post" action="{S_UCP_ACTION}"{S_FORM_ENCTYPE}>
<div class="panel">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<h2>{SITENAME} - {L_REGISTRATION}</h2>
@@ -30,44 +26,42 @@
<!-- IF L_REG_COND -->
<dl><dd><strong>{L_REG_COND}</strong></dd></dl>
<!-- ENDIF -->
+ <!-- EVENT ucp_register_credentials_before -->
<dl>
- <dt><label for="username">{L_USERNAME}:</label><br /><span>{L_USERNAME_EXPLAIN}</span></dt>
+ <dt><label for="username">{L_USERNAME}{L_COLON}</label><br /><span>{L_USERNAME_EXPLAIN}</span></dt>
<dd><input type="text" tabindex="1" name="username" id="username" size="25" value="{USERNAME}" class="inputbox autowidth" title="{L_USERNAME}" /></dd>
</dl>
<dl>
- <dt><label for="email">{L_EMAIL_ADDRESS}:</label></dt>
- <dd><input type="text" tabindex="2" name="email" id="email" size="25" maxlength="100" value="{EMAIL}" class="inputbox autowidth" title="{L_EMAIL_ADDRESS}" /></dd>
+ <dt><label for="email">{L_EMAIL_ADDRESS}{L_COLON}</label></dt>
+ <dd><input type="email" tabindex="2" name="email" id="email" size="25" maxlength="100" value="{EMAIL}" class="inputbox autowidth" title="{L_EMAIL_ADDRESS}" autocomplete="off" /></dd>
</dl>
<dl>
- <dt><label for="email_confirm">{L_CONFIRM_EMAIL}:</label></dt>
- <dd><input type="text" tabindex="3" name="email_confirm" id="email_confirm" size="25" maxlength="100" value="{EMAIL_CONFIRM}" class="inputbox autowidth" title="{L_CONFIRM_EMAIL}" /></dd>
+ <dt><label for="new_password">{L_PASSWORD}{L_COLON}</label><br /><span>{L_PASSWORD_EXPLAIN}</span></dt>
+ <dd><input type="password" tabindex="4" name="new_password" id="new_password" size="25" value="{PASSWORD}" class="inputbox autowidth" title="{L_NEW_PASSWORD}" autocomplete="off" /></dd>
</dl>
<dl>
- <dt><label for="new_password">{L_PASSWORD}:</label><br /><span>{L_PASSWORD_EXPLAIN}</span></dt>
- <dd><input type="password" tabindex="4" name="new_password" id="new_password" size="25" value="{PASSWORD}" class="inputbox autowidth" title="{L_NEW_PASSWORD}" /></dd>
- </dl>
- <dl>
- <dt><label for="password_confirm">{L_CONFIRM_PASSWORD}:</label></dt>
- <dd><input type="password" tabindex="5" name="password_confirm" id="password_confirm" size="25" value="{PASSWORD_CONFIRM}" class="inputbox autowidth" title="{L_CONFIRM_PASSWORD}" /></dd>
+ <dt><label for="password_confirm">{L_CONFIRM_PASSWORD}{L_COLON}</label></dt>
+ <dd><input type="password" tabindex="5" name="password_confirm" id="password_confirm" size="25" value="{PASSWORD_CONFIRM}" class="inputbox autowidth" title="{L_CONFIRM_PASSWORD}" autocomplete="off" /></dd>
</dl>
+ <!-- EVENT ucp_register_credentials_after -->
<hr />
+ <!-- EVENT ucp_register_options_before -->
<dl>
- <dt><label for="lang">{L_LANGUAGE}:</label></dt>
+ <dt><label for="lang">{L_LANGUAGE}{L_COLON}</label></dt>
<dd><select name="lang" id="lang" onchange="change_language(this.value); return false;" tabindex="6" title="{L_LANGUAGE}">{S_LANG_OPTIONS}</select></dd>
</dl>
- <dl>
- <dt><label for="tz">{L_TIMEZONE}:</label></dt>
- <dd><select name="tz" id="tz" tabindex="7" class="autowidth">{S_TZ_OPTIONS}</select></dd>
- </dl>
+ <!-- INCLUDE timezone_option.html -->
+
+ <!-- EVENT ucp_register_profile_fields_before -->
<!-- IF .profile_fields -->
<dl><dd><strong>{L_ITEMS_REQUIRED}</strong></dd></dl>
<!-- BEGIN profile_fields -->
<dl>
- <dt><label<!-- IF profile_fields.FIELD_ID --> for="{profile_fields.FIELD_ID}"<!-- ENDIF -->>{profile_fields.LANG_NAME}:<!-- IF profile_fields.S_REQUIRED --> *<!-- ENDIF --></label>
+ <dt><label<!-- IF profile_fields.FIELD_ID --> for="{profile_fields.FIELD_ID}"<!-- ENDIF -->>{profile_fields.LANG_NAME}{L_COLON}<!-- IF profile_fields.S_REQUIRED --> *<!-- ENDIF --></label>
<!-- IF profile_fields.LANG_EXPLAIN --><br /><span>{profile_fields.LANG_EXPLAIN}</span><!-- ENDIF -->
<!-- IF profile_fields.ERROR --><br /><span class="error">{profile_fields.ERROR}</span><!-- ENDIF --></dt>
<dd>{profile_fields.FIELD}</dd>
@@ -75,8 +69,9 @@
<!-- END profile_fields -->
<!-- ENDIF -->
+ <!-- EVENT ucp_register_profile_fields_after -->
</fieldset>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<!-- IF CAPTCHA_TEMPLATE -->
<!-- DEFINE $CAPTCHA_TAB_INDEX = 8 -->
@@ -84,20 +79,20 @@
<!-- ENDIF -->
<!-- IF S_COPPA -->
-
-
<div class="panel">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<h4>{L_COPPA_COMPLIANCE}</h4>
<p>{L_COPPA_EXPLAIN}</p>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<!-- ENDIF -->
+<!-- EVENT ucp_register_buttons_before -->
+
<div class="panel">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<fieldset class="submit-buttons">
{S_HIDDEN_FIELDS}
@@ -106,8 +101,8 @@
{S_FORM_TOKEN}
</fieldset>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
</form>
-<!-- INCLUDE overall_footer.html --> \ No newline at end of file
+<!-- INCLUDE overall_footer.html -->
diff --git a/phpBB/styles/prosilver/template/ucp_remind.html b/phpBB/styles/prosilver/template/ucp_remind.html
index 7dbc23b733..0ab1251d9e 100644
--- a/phpBB/styles/prosilver/template/ucp_remind.html
+++ b/phpBB/styles/prosilver/template/ucp_remind.html
@@ -3,19 +3,19 @@
<form action="{S_PROFILE_ACTION}" method="post" id="remind">
<div class="panel">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div class="content">
<h2>{L_SEND_PASSWORD}</h2>
<fieldset>
<dl>
- <dt><label for="username">{L_USERNAME}:</label></dt>
+ <dt><label for="username">{L_USERNAME}{L_COLON}</label></dt>
<dd><input class="inputbox narrow" type="text" name="username" id="username" size="25" /></dd>
</dl>
<dl>
- <dt><label for="email">{L_EMAIL_ADDRESS}:</label><br /><span>{L_EMAIL_REMIND}</span></dt>
- <dd><input class="inputbox narrow" type="text" name="email" id="email" size="25" maxlength="100" /></dd>
+ <dt><label for="email">{L_EMAIL_ADDRESS}{L_COLON}</label><br /><span>{L_EMAIL_REMIND}</span></dt>
+ <dd><input class="inputbox narrow" type="email" name="email" id="email" size="25" maxlength="100" /></dd>
</dl>
<dl>
<dt>&nbsp;</dt>
@@ -25,8 +25,8 @@
</fieldset>
</div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
</form>
-<!-- INCLUDE overall_footer.html --> \ No newline at end of file
+<!-- INCLUDE overall_footer.html -->
diff --git a/phpBB/styles/prosilver/template/ucp_resend.html b/phpBB/styles/prosilver/template/ucp_resend.html
index 840e972995..7713efe521 100644
--- a/phpBB/styles/prosilver/template/ucp_resend.html
+++ b/phpBB/styles/prosilver/template/ucp_resend.html
@@ -4,19 +4,19 @@
<form action="{S_PROFILE_ACTION}" method="post" id="resend">
<div class="panel">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div class="content">
<h2>{L_UCP_RESEND}</h2>
<fieldset>
<dl>
- <dt><label for="username">{L_USERNAME}:</label></dt>
+ <dt><label for="username">{L_USERNAME}{L_COLON}</label></dt>
<dd><input class="inputbox narrow" type="text" name="username" id="username" size="25" /></dd>
</dl>
<dl>
- <dt><label for="email">{L_EMAIL_ADDRESS}:</label><br /><span>{L_EMAIL_REMIND}</span></dt>
- <dd><input class="inputbox narrow" type="text" name="email" id="email" size="25" maxlength="100" /></dd>
+ <dt><label for="email">{L_EMAIL_ADDRESS}{L_COLON}</label><br /><span>{L_EMAIL_REMIND}</span></dt>
+ <dd><input class="inputbox narrow" type="email" name="email" id="email" size="25" maxlength="100" /></dd>
</dl>
<dl>
<dt>&nbsp;</dt>
@@ -25,8 +25,8 @@
</fieldset>
</div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
</form>
-<!-- INCLUDE overall_footer.html --> \ No newline at end of file
+<!-- INCLUDE overall_footer.html -->
diff --git a/phpBB/styles/prosilver/template/ucp_zebra_foes.html b/phpBB/styles/prosilver/template/ucp_zebra_foes.html
index 3c1b1cddce..712479dc18 100644
--- a/phpBB/styles/prosilver/template/ucp_zebra_foes.html
+++ b/phpBB/styles/prosilver/template/ucp_zebra_foes.html
@@ -5,14 +5,14 @@
<h2>{L_TITLE}</h2>
<div class="panel">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<p>{L_FOES_EXPLAIN}</p>
<fieldset class="fields2">
<!-- IF ERROR --><p class="error">{ERROR}</p><!-- ENDIF -->
<dl>
- <dt><label <!-- IF S_USERNAME_OPTIONS -->for="usernames"<!-- ENDIF -->>{L_YOUR_FOES}:</label><br /><span>{L_YOUR_FOES_EXPLAIN}</span></dt>
+ <dt><label <!-- IF S_USERNAME_OPTIONS -->for="usernames"<!-- ENDIF -->>{L_YOUR_FOES}{L_COLON}</label><br /><span>{L_YOUR_FOES_EXPLAIN}</span></dt>
<dd>
<!-- IF S_USERNAME_OPTIONS -->
<select name="usernames[]" id="usernames" multiple="multiple" size="5">{S_USERNAME_OPTIONS}</select>
@@ -22,13 +22,13 @@
</dd>
</dl>
<dl>
- <dt><label for="add">{L_ADD_FOES}:</label><br /><span>{L_ADD_FOES_EXPLAIN}</span></dt>
+ <dt><label for="add">{L_ADD_FOES}{L_COLON}</label><br /><span>{L_ADD_FOES_EXPLAIN}</span></dt>
<dd><textarea name="add" id="add" rows="3" cols="30" class="inputbox">{USERNAMES}</textarea></dd>
<dd><strong><a href="{U_FIND_USERNAME}" onclick="find_username(this.href); return false;">{L_FIND_USERNAME}</a></strong></dd>
</dl>
</fieldset>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<fieldset class="submit-buttons">
@@ -38,4 +38,4 @@
</fieldset>
</form>
-<!-- INCLUDE ucp_footer.html --> \ No newline at end of file
+<!-- INCLUDE ucp_footer.html -->
diff --git a/phpBB/styles/prosilver/template/ucp_zebra_friends.html b/phpBB/styles/prosilver/template/ucp_zebra_friends.html
index 1e0efbfdf8..fac0a18706 100644
--- a/phpBB/styles/prosilver/template/ucp_zebra_friends.html
+++ b/phpBB/styles/prosilver/template/ucp_zebra_friends.html
@@ -5,14 +5,15 @@
<h2>{L_TITLE}</h2>
<div class="panel">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<p>{L_FRIENDS_EXPLAIN}</p>
<fieldset class="fields2">
<!-- IF ERROR --><p class="error">{ERROR}</p><!-- ENDIF -->
+ <!-- EVENT ucp_friend_list_before -->
<dl>
- <dt><label <!-- IF S_USERNAME_OPTIONS -->for="usernames"<!-- ENDIF -->>{L_YOUR_FRIENDS}:</label><br /><span>{L_YOUR_FRIENDS_EXPLAIN}</span></dt>
+ <dt><label <!-- IF S_USERNAME_OPTIONS -->for="usernames"<!-- ENDIF -->>{L_YOUR_FRIENDS}{L_COLON}</label><br /><span>{L_YOUR_FRIENDS_EXPLAIN}</span></dt>
<dd>
<!-- IF S_USERNAME_OPTIONS -->
<select name="usernames[]" id="usernames" multiple="multiple" size="5">{S_USERNAME_OPTIONS}</select>
@@ -21,14 +22,15 @@
<!-- ENDIF -->
</dd>
</dl>
+ <!-- EVENT ucp_friend_list_after -->
<dl>
- <dt><label for="add">{L_ADD_FRIENDS}:</label><br /><span>{L_ADD_FRIENDS_EXPLAIN}</span></dt>
+ <dt><label for="add">{L_ADD_FRIENDS}{L_COLON}</label><br /><span>{L_ADD_FRIENDS_EXPLAIN}</span></dt>
<dd><textarea name="add" id="add" rows="3" cols="30" class="inputbox">{USERNAMES}</textarea></dd>
<dd><strong><a href="{U_FIND_USERNAME}" onclick="find_username(this.href); return false;">{L_FIND_USERNAME}</a></strong></dd>
</dl>
</fieldset>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<fieldset class="submit-buttons">
@@ -38,4 +40,4 @@
</fieldset>
</form>
-<!-- INCLUDE ucp_footer.html --> \ No newline at end of file
+<!-- INCLUDE ucp_footer.html -->
diff --git a/phpBB/styles/prosilver/template/viewforum_body.html b/phpBB/styles/prosilver/template/viewforum_body.html
index 02f42fa097..f6fc07ea55 100644
--- a/phpBB/styles/prosilver/template/viewforum_body.html
+++ b/phpBB/styles/prosilver/template/viewforum_body.html
@@ -1,18 +1,18 @@
<!-- INCLUDE overall_header.html -->
-<!-- IF U_MCP --><p>[&nbsp;<a href="{U_MCP}">{L_MCP}</a>&nbsp;]</p><!-- ENDIF -->
-<h2><a href="{U_VIEW_FORUM}">{FORUM_NAME}</a></h2>
-
+<!-- EVENT viewforum_forum_title_before -->
+<h2 class="forum-title"><!-- EVENT viewforum_forum_name_prepend --><a href="{U_VIEW_FORUM}">{FORUM_NAME}</a><!-- EVENT viewforum_forum_name_append --></h2>
+<!-- EVENT viewforum_forum_title_after -->
<!-- IF FORUM_DESC or MODERATORS or U_MCP -->
<div>
<!-- NOTE: remove the style="display: none" when you want to have the forum description on the forum body -->
<!-- IF FORUM_DESC --><div style="display: none !important;">{FORUM_DESC}<br /></div><!-- ENDIF -->
- <!-- IF MODERATORS --><p><strong><!-- IF S_SINGLE_MODERATOR -->{L_MODERATOR}<!-- ELSE -->{L_MODERATORS}<!-- ENDIF -->:</strong> {MODERATORS}</p><!-- ENDIF -->
+ <!-- IF MODERATORS --><p><strong><!-- IF S_SINGLE_MODERATOR -->{L_MODERATOR}<!-- ELSE -->{L_MODERATORS}<!-- ENDIF -->{L_COLON}</strong> {MODERATORS}</p><!-- ENDIF -->
</div>
<!-- ENDIF -->
<!-- IF S_FORUM_RULES -->
- <div class="rules">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="rules<!-- IF U_FORUM_RULES --> rules-link<!-- ENDIF -->">
+ <div class="inner">
<!-- IF U_FORUM_RULES -->
<a href="{U_FORUM_RULES}">{L_FORUM_RULES}</a>
@@ -21,48 +21,56 @@
{FORUM_RULES}
<!-- ENDIF -->
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<!-- ENDIF -->
<!-- IF S_HAS_SUBFORUM -->
<!-- IF not S_IS_BOT and U_MARK_FORUMS -->
-<ul class="linklist">
- <li class="rightside"><a href="{U_MARK_FORUMS}">{L_MARK_SUBFORUMS_READ}</a></li>
-</ul>
+ <div class="action-bar compact">
+ <a href="{U_MARK_FORUMS}" class="mark-read rightside" data-ajax="mark_forums_read">{L_MARK_SUBFORUMS_READ}</a>
+ </div>
<!-- ENDIF -->
<!-- INCLUDE forumlist_body.html -->
<!-- ENDIF -->
-<!-- IF S_DISPLAY_POST_INFO or PAGINATION or TOTAL_POSTS or TOTAL_TOPICS -->
- <div class="topic-actions" <!-- IF S_HAS_SUBFORUM -->style="margin-top: 2em;"<!-- ENDIF -->>
+<!-- IF S_DISPLAY_POST_INFO or .pagination or TOTAL_POSTS or TOTAL_TOPICS -->
+ <div class="action-bar top">
<!-- IF not S_IS_BOT and S_DISPLAY_POST_INFO -->
<div class="buttons">
- <div class="<!-- IF S_IS_LOCKED -->locked-icon<!-- ELSE -->post-icon<!-- ENDIF -->" title="<!-- IF S_IS_LOCKED -->{L_FORUM_LOCKED}<!-- ELSE -->{L_POST_TOPIC}<!-- ENDIF -->"><a href="{U_POST_NEW_TOPIC}"><span></span><!-- IF S_IS_LOCKED -->{L_FORUM_LOCKED}<!-- ELSE -->{L_POST_TOPIC}<!-- ENDIF --></a></div>
+ <!-- EVENT viewforum_buttons_top_before -->
+
+ <a href="{U_POST_NEW_TOPIC}" class="button icon-button <!-- IF S_IS_LOCKED -->locked-icon<!-- ELSE -->post-icon<!-- ENDIF -->" title="<!-- IF S_IS_LOCKED -->{L_FORUM_LOCKED}<!-- ELSE -->{L_POST_TOPIC}<!-- ENDIF -->">
+ <!-- IF S_IS_LOCKED -->{L_BUTTON_FORUM_LOCKED}<!-- ELSE -->{L_BUTTON_NEW_TOPIC}<!-- ENDIF -->
+ </a>
+
+ <!-- EVENT viewforum_buttons_top_after -->
</div>
<!-- ENDIF -->
<!-- IF S_DISPLAY_SEARCHBOX -->
- <div class="search-box">
+ <div class="search-box" role="search">
<form method="get" id="forum-search" action="{S_SEARCHBOX_ACTION}">
<fieldset>
- <input class="inputbox search tiny" type="text" name="keywords" id="search_keywords" size="20" value="{L_SEARCH_FORUM}" onclick="if (this.value == '{LA_SEARCH_FORUM}') this.value = '';" onblur="if (this.value == '') this.value = '{LA_SEARCH_FORUM}';" />
- <input class="button2" type="submit" value="{L_SEARCH}" />
+ <input class="inputbox search tiny" type="search" name="keywords" id="search_keywords" size="20" placeholder="{L_SEARCH_FORUM}" />
+ <button class="button icon-button search-icon" type="submit" title="{L_SEARCH}">{L_SEARCH}</button>
+ <a href="{U_SEARCH}" class="button icon-button search-adv-icon" title="{L_SEARCH_ADV}">{L_SEARCH_ADV}</a>
{S_SEARCH_LOCAL_HIDDEN_FIELDS}
</fieldset>
</form>
</div>
<!-- ENDIF -->
- <!-- IF PAGINATION or TOTAL_POSTS or TOTAL_TOPICS -->
- <div class="pagination">
- <!-- IF not S_IS_BOT and U_MARK_TOPICS --><a href="{U_MARK_TOPICS}" accesskey="m">{L_MARK_TOPICS_READ}</a> &bull; <!-- ENDIF --><!-- IF TOTAL_TOPICS -->{TOTAL_TOPICS}<!-- ENDIF -->
- <!-- IF PAGE_NUMBER -->
- <!-- IF PAGINATION --> &bull; <a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{PAGE_NUMBER}</a> &bull; <span>{PAGINATION}</span><!-- ELSE --> &bull; {PAGE_NUMBER}<!-- ENDIF -->
- <!-- ENDIF -->
- </div>
- <!-- ENDIF -->
+ <div class="pagination">
+ <!-- IF not S_IS_BOT and U_MARK_TOPICS and .topicrow --><a href="{U_MARK_TOPICS}" class="mark" accesskey="m" data-ajax="mark_topics_read">{L_MARK_TOPICS_READ}</a> &bull; <!-- ENDIF -->
+ {TOTAL_TOPICS}
+ <!-- IF .pagination -->
+ <!-- INCLUDE pagination.html -->
+ <!-- ELSE -->
+ &bull; {PAGE_NUMBER}
+ <!-- ENDIF -->
+ </div>
</div>
<!-- ENDIF -->
@@ -70,9 +78,9 @@
<!-- IF S_NO_READ_ACCESS -->
<div class="panel">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<strong>{L_NO_READ_ACCESS}</strong>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<!-- IF not S_USER_LOGGED_IN and not S_IS_BOT -->
@@ -80,19 +88,19 @@
<form action="{S_LOGIN_ACTION}" method="post">
<div class="panel">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div class="content">
<h3><a href="{U_LOGIN_LOGOUT}">{L_LOGIN_LOGOUT}</a><!-- IF S_REGISTER_ENABLED -->&nbsp; &bull; &nbsp;<a href="{U_REGISTER}">{L_REGISTER}</a><!-- ENDIF --></h3>
<fieldset class="fields1">
<dl>
- <dt><label for="username">{L_USERNAME}:</label></dt>
+ <dt><label for="username">{L_USERNAME}{L_COLON}</label></dt>
<dd><input type="text" tabindex="1" name="username" id="username" size="25" value="{USERNAME}" class="inputbox autowidth" /></dd>
</dl>
<dl>
- <dt><label for="password">{L_PASSWORD}:</label></dt>
- <dd><input type="password" tabindex="2" id="password" name="password" size="25" class="inputbox autowidth" /></dd>
+ <dt><label for="password">{L_PASSWORD}{L_COLON}</label></dt>
+ <dd><input type="password" tabindex="2" id="password" name="password" size="25" class="inputbox autowidth" autocomplete="off" /></dd>
<!-- IF S_AUTOLOGIN_ENABLED --><dd><label for="autologin"><input type="checkbox" name="autologin" id="autologin" tabindex="3" /> {L_LOG_ME_IN}</label></dd><!-- ENDIF -->
<dd><label for="viewonline"><input type="checkbox" name="viewonline" id="viewonline" tabindex="4" /> {L_HIDE_ME}</label></dd>
</dl>
@@ -104,7 +112,7 @@
</fieldset>
</div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
</form>
@@ -113,21 +121,23 @@
<!-- ENDIF -->
+<!-- EVENT viewforum_body_topic_row_before -->
+
<!-- BEGIN topicrow -->
<!-- IF not topicrow.S_TOPIC_TYPE_SWITCH and not topicrow.S_FIRST_ROW -->
</ul>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<!-- ENDIF -->
<!-- IF topicrow.S_FIRST_ROW or not topicrow.S_TOPIC_TYPE_SWITCH -->
<div class="forumbg<!-- IF topicrow.S_TOPIC_TYPE_SWITCH and (topicrow.S_POST_ANNOUNCE or topicrow.S_POST_GLOBAL) --> announcement<!-- ENDIF -->">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<ul class="topiclist">
<li class="header">
<dl class="icon">
- <dt><!-- IF S_DISPLAY_ACTIVE -->{L_ACTIVE_TOPICS}<!-- ELSEIF topicrow.S_TOPIC_TYPE_SWITCH and (topicrow.S_POST_ANNOUNCE or topicrow.S_POST_GLOBAL) -->{L_ANNOUNCEMENTS}<!-- ELSE -->{L_TOPICS}<!-- ENDIF --></dt>
+ <dt<!-- IF S_DISPLAY_ACTIVE --> id="active_topics"<!-- ENDIF -->><div class="list-inner"><!-- IF S_DISPLAY_ACTIVE -->{L_ACTIVE_TOPICS}<!-- ELSEIF topicrow.S_TOPIC_TYPE_SWITCH and (topicrow.S_POST_ANNOUNCE or topicrow.S_POST_GLOBAL) -->{L_ANNOUNCEMENTS}<!-- ELSE -->{L_TOPICS}<!-- ENDIF --></div></dt>
<dd class="posts">{L_REPLIES}</dd>
<dd class="views">{L_VIEWS}</dd>
<dd class="lastpost"><span>{L_LAST_POST}</span></dd>
@@ -137,34 +147,74 @@
<ul class="topiclist topics">
<!-- ENDIF -->
+ <!-- EVENT viewforum_body_topicrow_row_before -->
<li class="row<!-- IF topicrow.S_ROW_COUNT is even --> bg1<!-- ELSE --> bg2<!-- ENDIF --><!-- IF topicrow.S_POST_GLOBAL --> global-announce<!-- ENDIF --><!-- IF topicrow.S_POST_ANNOUNCE --> announce<!-- ENDIF --><!-- IF topicrow.S_POST_STICKY --> sticky<!-- ENDIF --><!-- IF topicrow.S_TOPIC_REPORTED --> reported<!-- ENDIF -->">
- <dl class="icon" style="background-image: url({topicrow.TOPIC_FOLDER_IMG_SRC}); background-repeat: no-repeat;">
- <dt<!-- IF topicrow.TOPIC_ICON_IMG and S_TOPIC_ICONS --> style="background-image: url({T_ICONS_PATH}{topicrow.TOPIC_ICON_IMG}); background-repeat: no-repeat;"<!-- ENDIF --> title="{topicrow.TOPIC_FOLDER_IMG_ALT}"><!-- IF topicrow.S_UNREAD_TOPIC --><a href="{topicrow.U_NEWEST_POST}">{NEWEST_POST_IMG}</a> <!-- ENDIF --><a href="{topicrow.U_VIEW_TOPIC}" class="topictitle">{topicrow.TOPIC_TITLE}</a>
- <!-- IF topicrow.S_TOPIC_UNAPPROVED or topicrow.S_POSTS_UNAPPROVED --><a href="{topicrow.U_MCP_QUEUE}">{topicrow.UNAPPROVED_IMG}</a> <!-- ENDIF -->
- <!-- IF topicrow.S_TOPIC_REPORTED --><a href="{topicrow.U_MCP_REPORT}">{REPORTED_IMG}</a><!-- ENDIF --><br />
- <!-- IF topicrow.PAGINATION --><strong class="pagination"><span>{topicrow.PAGINATION}</span></strong><!-- ENDIF -->
- <!-- IF topicrow.ATTACH_ICON_IMG -->{topicrow.ATTACH_ICON_IMG} <!-- ENDIF -->{L_POST_BY_AUTHOR} {topicrow.TOPIC_AUTHOR_FULL} &raquo; {topicrow.FIRST_POST_TIME}
+ <!-- EVENT viewforum_body_topic_row_prepend -->
+ <dl class="icon {topicrow.TOPIC_IMG_STYLE}">
+ <dt<!-- IF topicrow.TOPIC_ICON_IMG and S_TOPIC_ICONS --> style="background-image: url({T_ICONS_PATH}{topicrow.TOPIC_ICON_IMG}); background-repeat: no-repeat;"<!-- ENDIF --> title="{topicrow.TOPIC_FOLDER_IMG_ALT}">
+ <!-- IF topicrow.S_UNREAD_TOPIC and not S_IS_BOT --><a href="{topicrow.U_NEWEST_POST}" class="icon-link"></a><!-- ENDIF -->
+ <div class="list-inner">
+ <!-- EVENT topiclist_row_prepend -->
+ <!-- IF topicrow.S_UNREAD_TOPIC and not S_IS_BOT --><a href="{topicrow.U_NEWEST_POST}">{NEWEST_POST_IMG}</a> <!-- ENDIF --><a href="{topicrow.U_VIEW_TOPIC}" class="topictitle">{topicrow.TOPIC_TITLE}</a>
+ <!-- IF topicrow.S_TOPIC_UNAPPROVED or topicrow.S_POSTS_UNAPPROVED --><a href="{topicrow.U_MCP_QUEUE}">{topicrow.UNAPPROVED_IMG}</a> <!-- ENDIF -->
+ <!-- IF topicrow.S_TOPIC_DELETED --><a href="{topicrow.U_MCP_QUEUE}">{DELETED_IMG}</a> <!-- ENDIF -->
+ <!-- IF topicrow.S_TOPIC_REPORTED --><a href="{topicrow.U_MCP_REPORT}">{REPORTED_IMG}</a><!-- ENDIF --><br />
+ <!-- EVENT topiclist_row_topic_title_after -->
+ <!-- IF not S_IS_BOT -->
+ <div class="responsive-show" style="display: none;">
+ {L_LAST_POST} {L_POST_BY_AUTHOR} {topicrow.LAST_POST_AUTHOR_FULL} &laquo; <a href="{topicrow.U_LAST_POST}" title="{L_GOTO_LAST_POST}">{topicrow.LAST_POST_TIME}</a>
+ <!-- IF topicrow.S_POST_GLOBAL and FORUM_ID != topicrow.FORUM_ID --><br />{L_POSTED} {L_IN} <a href="{topicrow.U_VIEW_FORUM}">{topicrow.FORUM_NAME}</a><!-- ENDIF -->
+ </div>
+ <!-- IF topicrow.REPLIES --><span class="responsive-show left-box" style="display: none;">{L_REPLIES}{L_COLON} <strong>{topicrow.REPLIES}</strong></span><!-- ENDIF -->
+ <!-- ENDIF -->
+
+ <!-- IF .topicrow.pagination -->
+ <div class="pagination">
+ <ul>
+ <!-- BEGIN pagination -->
+ <!-- IF topicrow.pagination.S_IS_PREV -->
+ <!-- ELSEIF topicrow.pagination.S_IS_CURRENT --><li class="active"><span>{topicrow.pagination.PAGE_NUMBER}</span></li>
+ <!-- ELSEIF topicrow.pagination.S_IS_ELLIPSIS --><li class="ellipsis"><span>{L_ELLIPSIS}</span></li>
+ <!-- ELSEIF topicrow.pagination.S_IS_NEXT -->
+ <!-- ELSE --><li><a href="{topicrow.pagination.PAGE_URL}">{topicrow.pagination.PAGE_NUMBER}</a></li>
+ <!-- ENDIF -->
+ <!-- END pagination -->
+ </ul>
+ </div>
+ <!-- ENDIF -->
+
+ <div class="responsive-hide">
+ <!-- IF topicrow.S_HAS_POLL -->{POLL_IMG} <!-- ENDIF -->
+ <!-- IF topicrow.ATTACH_ICON_IMG -->{topicrow.ATTACH_ICON_IMG} <!-- ENDIF -->
+ {L_POST_BY_AUTHOR} {topicrow.TOPIC_AUTHOR_FULL} &raquo; {topicrow.FIRST_POST_TIME}
+ <!-- IF topicrow.S_POST_GLOBAL and FORUM_ID != topicrow.FORUM_ID --> &raquo; {L_IN} <a href="{topicrow.U_VIEW_FORUM}">{topicrow.FORUM_NAME}</a><!-- ENDIF -->
+ </div>
+
+ <!-- EVENT topiclist_row_append -->
+ </div>
</dt>
<dd class="posts">{topicrow.REPLIES} <dfn>{L_REPLIES}</dfn></dd>
<dd class="views">{topicrow.VIEWS} <dfn>{L_VIEWS}</dfn></dd>
<dd class="lastpost"><span><dfn>{L_LAST_POST} </dfn>{L_POST_BY_AUTHOR} {topicrow.LAST_POST_AUTHOR_FULL}
- <!-- IF not S_IS_BOT --><a href="{topicrow.U_LAST_POST}">{LAST_POST_IMG}</a> <!-- ENDIF --><br />{topicrow.LAST_POST_TIME}</span>
+ <!-- IF not S_IS_BOT --><a href="{topicrow.U_LAST_POST}" title="{L_GOTO_LAST_POST}">{LAST_POST_IMG}</a> <!-- ENDIF --><br />{topicrow.LAST_POST_TIME}</span>
</dd>
</dl>
+ <!-- EVENT viewforum_body_topic_row_append -->
</li>
+ <!-- EVENT viewforum_body_topic_row_after -->
<!-- IF topicrow.S_LAST_ROW -->
</ul>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<!-- ENDIF -->
<!-- BEGINELSE -->
<!-- IF S_IS_POSTABLE -->
<div class="panel">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<strong>{L_NO_TOPICS}</strong>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<!-- ENDIF -->
<!-- END topicrow -->
@@ -172,12 +222,11 @@
<!-- IF S_SELECT_SORT_DAYS and not S_DISPLAY_ACTIVE -->
<form method="post" action="{S_FORUM_ACTION}">
<fieldset class="display-options">
- <!-- IF PREVIOUS_PAGE --><a href="{PREVIOUS_PAGE}" class="left-box {S_CONTENT_FLOW_BEGIN}">{L_PREVIOUS}</a><!-- ENDIF -->
- <!-- IF NEXT_PAGE --><a href="{NEXT_PAGE}" class="right-box {S_CONTENT_FLOW_END}">{L_NEXT}</a><!-- ENDIF -->
<!-- IF not S_IS_BOT -->
- <label>{L_DISPLAY_TOPICS}: {S_SELECT_SORT_DAYS}</label>
+ <label>{L_DISPLAY_TOPICS}{L_COLON} {S_SELECT_SORT_DAYS}</label>
<label>{L_SORT_BY} {S_SELECT_SORT_KEY}</label>
- <label>{S_SELECT_SORT_DIR} <input type="submit" name="sort" value="{L_GO}" class="button2" /></label>
+ <label>{S_SELECT_SORT_DIR}</label>
+ <input type="submit" name="sort" value="{L_GO}" class="button2" />
<!-- ENDIF -->
</fieldset>
</form>
@@ -185,35 +234,45 @@
<!-- ENDIF -->
<!-- IF .topicrow and not S_DISPLAY_ACTIVE -->
- <div class="topic-actions">
+ <div class="action-bar bottom">
<!-- IF not S_IS_BOT and S_DISPLAY_POST_INFO -->
- <div class="buttons">
- <div class="<!-- IF S_IS_LOCKED -->locked-icon<!-- ELSE -->post-icon<!-- ENDIF -->" title="<!-- IF S_IS_LOCKED -->{L_FORUM_LOCKED}<!-- ELSE -->{L_POST_TOPIC}<!-- ENDIF -->"><a href="{U_POST_NEW_TOPIC}"><span></span><!-- IF S_IS_LOCKED -->{L_FORUM_LOCKED}<!-- ELSE -->{L_POST_TOPIC}<!-- ENDIF --></a></div>
- </div>
+ <div class="buttons">
+ <!-- EVENT viewforum_buttons_bottom_before -->
+
+ <a href="{U_POST_NEW_TOPIC}" class="button icon-button <!-- IF S_IS_LOCKED -->locked-icon<!-- ELSE -->post-icon<!-- ENDIF -->" title="<!-- IF S_IS_LOCKED -->{L_FORUM_LOCKED}<!-- ELSE -->{L_POST_TOPIC}<!-- ENDIF -->">
+ <!-- IF S_IS_LOCKED -->{L_BUTTON_FORUM_LOCKED}<!-- ELSE -->{L_BUTTON_NEW_TOPIC}<!-- ENDIF -->
+ </a>
+
+ <!-- EVENT viewforum_buttons_bottom_after -->
+ </div>
<!-- ENDIF -->
- <!-- IF PAGINATION or TOTAL_POSTS or TOTAL_TOPICS -->
<div class="pagination">
- <!-- IF TOTAL_TOPICS and not S_IS_BOT and U_MARK_TOPICS --><a href="{U_MARK_TOPICS}">{L_MARK_TOPICS_READ}</a> &bull; <!-- ENDIF -->
- <!-- IF TOTAL_POSTS and not NEWEST_USER --> {TOTAL_POSTS}<!-- ELSEIF TOTAL_TOPICS and not NEWEST_USER --> {TOTAL_TOPICS}<!-- ENDIF -->
- <!-- IF TOTAL_USERS -->{TOTAL_USERS}<!-- ENDIF -->
- <!-- IF PAGINATION --> &bull; <a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{PAGE_NUMBER}</a>
- &bull; <span>{PAGINATION}</span><!-- ELSE --> &bull; {PAGE_NUMBER}<!-- ENDIF -->
+ <!-- IF not S_IS_BOT and U_MARK_TOPICS and .topicrow --><a href="{U_MARK_TOPICS}" data-ajax="mark_topics_read">{L_MARK_TOPICS_READ}</a> &bull; <!-- ENDIF -->
+ {TOTAL_TOPICS}
+ <!-- IF .pagination -->
+ <!-- INCLUDE pagination.html -->
+ <!-- ELSE -->
+ &bull; {PAGE_NUMBER}
+ <!-- ENDIF -->
</div>
- <!-- ENDIF -->
</div>
<!-- ENDIF -->
<!-- INCLUDE jumpbox.html -->
-<!-- IF S_DISPLAY_ONLINE_LIST -->
- <h3><!-- IF U_VIEWONLINE --><a href="{U_VIEWONLINE}">{L_WHO_IS_ONLINE}</a><!-- ELSE -->{L_WHO_IS_ONLINE}<!-- ENDIF --></h3>
- <p>{LOGGED_IN_USER_LIST}</p>
+<!-- IF S_DISPLAY_ONLINE_LIST and U_VIEWONLINE -->
+ <div class="stat-block online-list">
+ <h3><a href="{U_VIEWONLINE}">{L_WHO_IS_ONLINE}</a></h3>
+ <p>{LOGGED_IN_USER_LIST}</p>
+ </div>
<!-- ENDIF -->
<!-- IF S_DISPLAY_POST_INFO -->
- <h3>{L_FORUM_PERMISSIONS}</h3>
- <p><!-- BEGIN rules -->{rules.RULE}<br /><!-- END rules --></p>
+ <div class="stat-block permissions">
+ <h3>{L_FORUM_PERMISSIONS}</h3>
+ <p><!-- BEGIN rules -->{rules.RULE}<br /><!-- END rules --></p>
+ </div>
<!-- ENDIF -->
-<!-- INCLUDE overall_footer.html --> \ No newline at end of file
+<!-- INCLUDE overall_footer.html -->
diff --git a/phpBB/styles/prosilver/template/viewonline_body.html b/phpBB/styles/prosilver/template/viewonline_body.html
index 3f1f0e64bf..ee1672c6c9 100644
--- a/phpBB/styles/prosilver/template/viewonline_body.html
+++ b/phpBB/styles/prosilver/template/viewonline_body.html
@@ -1,16 +1,22 @@
<!-- INCLUDE overall_header.html -->
-<h2>{TOTAL_REGISTERED_USERS_ONLINE}</h2>
+<h2 class="viewonline-title">{TOTAL_REGISTERED_USERS_ONLINE}</h2>
<p>{TOTAL_GUEST_USERS_ONLINE}<!-- IF S_SWITCH_GUEST_DISPLAY --> &bull; <a href="{U_SWITCH_GUEST_DISPLAY}">{L_SWITCH_GUEST_DISPLAY}</a><!-- ENDIF --></p>
-<ul class="linklist">
- <li class="rightside pagination"><!-- IF PAGINATION --><a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{PAGE_NUMBER}</a> &bull; <span>{PAGINATION}</span><!-- ELSE -->{PAGE_NUMBER}<!-- ENDIF --></li>
-</ul>
+<div class="action-bar top">
+ <div class="pagination">
+ <!-- IF .pagination -->
+ <!-- INCLUDE pagination.html -->
+ <!-- ELSE -->
+ {PAGE_NUMBER}
+ <!-- ENDIF -->
+ </div>
+</div>
<div class="forumbg forumbg-table">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
- <table class="table1" cellspacing="1">
+ <table class="table1">
<!-- IF .user_row -->
<thead>
@@ -23,7 +29,7 @@
<tbody>
<!-- BEGIN user_row -->
<tr class="<!-- IF user_row.S_ROW_COUNT is odd -->bg1<!-- ELSE -->bg2<!-- ENDIF -->">
- <td>{user_row.USERNAME_FULL}<!-- IF user_row.USER_IP --> <span style="margin-left: 30px;">{L_IP}: <a href="{user_row.U_USER_IP}">{user_row.USER_IP}</a> &#187; <a href="{user_row.U_WHOIS}" onclick="popup(this.href, 750, 500); return false;">{L_WHOIS}</a></span><!-- ENDIF -->
+ <td>{user_row.USERNAME_FULL}<!-- IF user_row.USER_IP --> <span style="float: {S_CONTENT_FLOW_END};">{L_IP}{L_COLON} <a href="{user_row.U_USER_IP}">{user_row.USER_IP}</a> &#187; <a href="{user_row.U_WHOIS}" onclick="popup(this.href, 750, 500); return false;">{L_WHOIS}</a></span><!-- ENDIF -->
<!-- IF user_row.USER_BROWSER --><br />{user_row.USER_BROWSER}<!-- ENDIF --></td>
<td class="info"><a href="{user_row.U_FORUM_LOCATION}">{user_row.FORUM_LOCATION}</a></td>
<td class="active">{user_row.LASTUPDATE}</td>
@@ -38,20 +44,20 @@
</tbody>
</table>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
-<!-- IF PREVIOUS_PAGE or NEXT_PAGE -->
-<fieldset class="display-options right-box">
- <!-- IF PREVIOUS_PAGE --><a href="{PREVIOUS_PAGE}" class="{S_CONTENT_FLOW_BEGIN}">{L_PREVIOUS}</a><!-- ELSE -->{L_PREVIOUS}<!-- ENDIF --> &bull; <!-- IF NEXT_PAGE --><a href="{NEXT_PAGE}" class="{S_CONTENT_FLOW_END}">{L_NEXT}</a><!-- ELSE -->{L_NEXT}<!-- ENDIF -->
-</fieldset>
-<!-- ENDIF -->
-
-<!-- IF LEGEND --><p><em>{L_LEGEND}: {LEGEND}</em></p><!-- ENDIF -->
+<!-- IF LEGEND --><p><em>{L_LEGEND}{L_COLON} {LEGEND}</em></p><!-- ENDIF -->
-<ul class="linklist">
- <li class="rightside pagination"><!-- IF PAGINATION --><a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{PAGE_NUMBER}</a> &bull; <span>{PAGINATION}</span><!-- ELSE -->{PAGE_NUMBER}<!-- ENDIF --></li>
-</ul>
+<div class="action-bar bottom">
+ <div class="pagination">
+ <!-- IF .pagination -->
+ <!-- INCLUDE pagination.html -->
+ <!-- ELSE -->
+ {PAGE_NUMBER}
+ <!-- ENDIF -->
+ </div>
+</div>
<!-- INCLUDE jumpbox.html -->
<!-- INCLUDE overall_footer.html -->
diff --git a/phpBB/styles/prosilver/template/viewonline_whois.html b/phpBB/styles/prosilver/template/viewonline_whois.html
index a9c6473727..5d780490da 100644
--- a/phpBB/styles/prosilver/template/viewonline_whois.html
+++ b/phpBB/styles/prosilver/template/viewonline_whois.html
@@ -3,14 +3,10 @@
<h2>{L_WHOIS}</h2>
<div class="panel">
- <div class="inner"><span class="corners-top"><span></span></span>
-
- <div class="postbody"><div class="content">
- <pre>{WHOIS}</pre>
- </div></div>
-
- <span class="corners-bottom"><span></span></span></div>
+ <div class="inner">
+ <pre>{WHOIS}</pre>
+ </div>
</div>
<a href="#" onclick="window.close(); return false;">{L_CLOSE_WINDOW}</a>
-<!-- INCLUDE simple_footer.html --> \ No newline at end of file
+<!-- INCLUDE simple_footer.html -->
diff --git a/phpBB/styles/prosilver/template/viewtopic_body.html b/phpBB/styles/prosilver/template/viewtopic_body.html
index 57de96d853..22a77779bf 100644
--- a/phpBB/styles/prosilver/template/viewtopic_body.html
+++ b/phpBB/styles/prosilver/template/viewtopic_body.html
@@ -1,18 +1,19 @@
<!-- INCLUDE overall_header.html -->
-<!-- IF U_MCP --><p>[&nbsp;<a href="{U_MCP}">{L_MCP}</a>&nbsp;]</p><!-- ENDIF -->
-<h2><a href="{U_VIEW_TOPIC}">{TOPIC_TITLE}</a></h2>
+
+<h2 class="topic-title"><!-- EVENT viewtopic_topic_title_prepend --><a href="{U_VIEW_TOPIC}">{TOPIC_TITLE}</a><!-- EVENT viewtopic_topic_title_append --></h2>
+<!-- EVENT viewtopic_topic_title_after -->
<!-- NOTE: remove the style="display: none" when you want to have the forum description on the topic body -->
<!-- IF FORUM_DESC --><div style="display: none !important;">{FORUM_DESC}<br /></div><!-- ENDIF -->
<!-- IF MODERATORS -->
<p>
- <strong><!-- IF S_SINGLE_MODERATOR -->{L_MODERATOR}<!-- ELSE -->{L_MODERATORS}<!-- ENDIF -->:</strong> {MODERATORS}
+ <strong><!-- IF S_SINGLE_MODERATOR -->{L_MODERATOR}<!-- ELSE -->{L_MODERATORS}<!-- ENDIF -->{L_COLON}</strong> {MODERATORS}
</p>
<!-- ENDIF -->
<!-- IF S_FORUM_RULES -->
- <div class="rules">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="rules<!-- IF U_FORUM_RULES --> rules-link<!-- ENDIF -->">
+ <div class="inner">
<!-- IF U_FORUM_RULES -->
<a href="{U_FORUM_RULES}">{L_FORUM_RULES}</a>
@@ -21,251 +22,397 @@
{FORUM_RULES}
<!-- ENDIF -->
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<!-- ENDIF -->
-<div class="topic-actions">
+<div class="action-bar top">
<div class="buttons">
+ <!-- EVENT viewtopic_buttons_top_before -->
+
<!-- IF not S_IS_BOT and S_DISPLAY_REPLY_INFO -->
- <div class="<!-- IF S_IS_LOCKED -->locked-icon<!-- ELSE -->reply-icon<!-- ENDIF -->"><a href="{U_POST_REPLY_TOPIC}" title="<!-- IF S_IS_LOCKED -->{L_TOPIC_LOCKED}<!-- ELSE -->{L_POST_REPLY}<!-- ENDIF -->"><span></span><!-- IF S_IS_LOCKED -->{L_TOPIC_LOCKED_SHORT}<!-- ELSE -->{L_POST_REPLY}<!-- ENDIF --></a></div>
+ <a href="{U_POST_REPLY_TOPIC}" class="button icon-button <!-- IF S_IS_LOCKED -->locked-icon<!-- ELSE -->reply-icon<!-- ENDIF -->" title="<!-- IF S_IS_LOCKED -->{L_TOPIC_LOCKED}<!-- ELSE -->{L_POST_REPLY}<!-- ENDIF -->">
+ <!-- IF S_IS_LOCKED -->{L_BUTTON_TOPIC_LOCKED}<!-- ELSE -->{L_BUTTON_POST_REPLY}<!-- ENDIF -->
+ </a>
<!-- ENDIF -->
+
+ <!-- EVENT viewtopic_buttons_top_after -->
</div>
+ <!-- INCLUDE viewtopic_topic_tools.html -->
+ <!-- EVENT viewtopic_dropdown_top_custom -->
+
<!-- IF S_DISPLAY_SEARCHBOX -->
- <div class="search-box">
+ <div class="search-box" role="search">
<form method="get" id="topic-search" action="{S_SEARCHBOX_ACTION}">
<fieldset>
- <input class="inputbox search tiny" type="text" name="keywords" id="search_keywords" size="20" value="{L_SEARCH_TOPIC}" onclick="if(this.value=='{LA_SEARCH_TOPIC}')this.value='';" onblur="if(this.value=='')this.value='{LA_SEARCH_TOPIC}';" />
- <input class="button2" type="submit" value="{L_SEARCH}" />
+ <input class="inputbox search tiny" type="search" name="keywords" id="search_keywords" size="20" placeholder="{L_SEARCH_TOPIC}" />
+ <button class="button icon-button search-icon" type="submit" title="{L_SEARCH}">{L_SEARCH}</button>
+ <a href="{U_SEARCH}" class="button icon-button search-adv-icon" title="{L_SEARCH_ADV}">{L_SEARCH_ADV}</a>
{S_SEARCH_LOCAL_HIDDEN_FIELDS}
</fieldset>
</form>
</div>
<!-- ENDIF -->
- <!-- IF PAGINATION or TOTAL_POSTS -->
+ <!-- IF .pagination or TOTAL_POSTS -->
<div class="pagination">
- <!-- IF U_VIEW_UNREAD_POST and not S_IS_BOT --><a href="{U_VIEW_UNREAD_POST}">{L_VIEW_UNREAD_POST}</a> &bull; <!-- ENDIF -->{TOTAL_POSTS}
- <!-- IF PAGE_NUMBER --><!-- IF PAGINATION --> &bull; <a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{PAGE_NUMBER}</a> &bull; <span>{PAGINATION}</span><!-- ELSE --> &bull; {PAGE_NUMBER}<!-- ENDIF --><!-- ENDIF -->
+ <!-- IF U_VIEW_UNREAD_POST and not S_IS_BOT --><a href="{U_VIEW_UNREAD_POST}" class="mark">{L_VIEW_UNREAD_POST}</a> &bull; <!-- ENDIF -->{TOTAL_POSTS}
+ <!-- IF .pagination -->
+ <!-- INCLUDE pagination.html -->
+ <!-- ELSE -->
+ &bull; {PAGE_NUMBER}
+ <!-- ENDIF -->
</div>
<!-- ENDIF -->
-
+ <!-- EVENT viewtopic_body_pagination_top_after -->
</div>
-<div class="clear"></div>
+
+<!-- EVENT viewtopic_body_poll_before -->
<!-- IF S_HAS_POLL -->
- <form method="post" action="{S_POLL_ACTION}">
+ <form method="post" action="{S_POLL_ACTION}" data-ajax="vote_poll" class="topic_poll">
<div class="panel">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div class="content">
- <h2>{POLL_QUESTION}</h2>
- <p class="author">{L_POLL_LENGTH}<!-- IF S_CAN_VOTE and L_POLL_LENGTH --><br /><!-- ENDIF --><!-- IF S_CAN_VOTE -->{L_MAX_VOTES}<!-- ENDIF --></p>
+ <h2 class="poll-title"><!-- EVENT viewtopic_body_poll_question_prepend -->{POLL_QUESTION}<!-- EVENT viewtopic_body_poll_question_append --></h2>
+ <p class="author">{L_POLL_LENGTH}<!-- IF S_CAN_VOTE and L_POLL_LENGTH --><br /><!-- ENDIF --><!-- IF S_CAN_VOTE --><span class="poll_max_votes">{L_MAX_VOTES}</span><!-- ENDIF --></p>
<fieldset class="polls">
<!-- BEGIN poll_option -->
- <dl class="<!-- IF poll_option.POLL_OPTION_VOTED -->voted<!-- ENDIF -->"<!-- IF poll_option.POLL_OPTION_VOTED --> title="{L_POLL_VOTED_OPTION}"<!-- ENDIF -->>
+ <!-- EVENT viewtopic_body_poll_option_before -->
+ <dl class="<!-- IF poll_option.POLL_OPTION_VOTED -->voted<!-- ENDIF --><!-- IF poll_option.POLL_OPTION_MOST_VOTES --> most-votes<!-- ENDIF -->"<!-- IF poll_option.POLL_OPTION_VOTED --> title="{L_POLL_VOTED_OPTION}"<!-- ENDIF --> data-alt-text="{L_POLL_VOTED_OPTION}" data-poll-option-id="{poll_option.POLL_OPTION_ID}">
<dt><!-- IF S_CAN_VOTE --><label for="vote_{poll_option.POLL_OPTION_ID}">{poll_option.POLL_OPTION_CAPTION}</label><!-- ELSE -->{poll_option.POLL_OPTION_CAPTION}<!-- ENDIF --></dt>
- <!-- IF S_CAN_VOTE --><dd style="width: auto;"><!-- IF S_IS_MULTI_CHOICE --><input type="checkbox" name="vote_id[]" id="vote_{poll_option.POLL_OPTION_ID}" value="{poll_option.POLL_OPTION_ID}"<!-- IF poll_option.POLL_OPTION_VOTED --> checked="checked"<!-- ENDIF --> /><!-- ELSE --><input type="radio" name="vote_id[]" id="vote_{poll_option.POLL_OPTION_ID}" value="{poll_option.POLL_OPTION_ID}"<!-- IF poll_option.POLL_OPTION_VOTED --> checked="checked"<!-- ENDIF --> /><!-- ENDIF --></dd><!-- ENDIF -->
- <!-- IF S_DISPLAY_RESULTS --><dd class="resultbar"><div class="<!-- IF poll_option.POLL_OPTION_PCT < 20 -->pollbar1<!-- ELSEIF poll_option.POLL_OPTION_PCT < 40 -->pollbar2<!-- ELSEIF poll_option.POLL_OPTION_PCT < 60 -->pollbar3<!-- ELSEIF poll_option.POLL_OPTION_PCT < 80 -->pollbar4<!-- ELSE -->pollbar5<!-- ENDIF -->" style="width:{poll_option.POLL_OPTION_PERCENT};">{poll_option.POLL_OPTION_RESULT}</div></dd>
- <dd><!-- IF poll_option.POLL_OPTION_RESULT == 0 -->{L_NO_VOTES}<!-- ELSE -->{poll_option.POLL_OPTION_PERCENT}<!-- ENDIF --></dd><!-- ENDIF -->
+ <!-- IF S_CAN_VOTE --><dd style="width: auto;" class="poll_option_select"><!-- IF S_IS_MULTI_CHOICE --><input type="checkbox" name="vote_id[]" id="vote_{poll_option.POLL_OPTION_ID}" value="{poll_option.POLL_OPTION_ID}"<!-- IF poll_option.POLL_OPTION_VOTED --> checked="checked"<!-- ENDIF --> /><!-- ELSE --><input type="radio" name="vote_id[]" id="vote_{poll_option.POLL_OPTION_ID}" value="{poll_option.POLL_OPTION_ID}"<!-- IF poll_option.POLL_OPTION_VOTED --> checked="checked"<!-- ENDIF --> /><!-- ENDIF --></dd><!-- ENDIF -->
+ <dd class="resultbar<!-- IF not S_DISPLAY_RESULTS --> hidden<!-- ENDIF -->"><div class="<!-- IF poll_option.POLL_OPTION_PCT < 20 -->pollbar1<!-- ELSEIF poll_option.POLL_OPTION_PCT < 40 -->pollbar2<!-- ELSEIF poll_option.POLL_OPTION_PCT < 60 -->pollbar3<!-- ELSEIF poll_option.POLL_OPTION_PCT < 80 -->pollbar4<!-- ELSE -->pollbar5<!-- ENDIF -->" style="width:{poll_option.POLL_OPTION_PERCENT_REL};">{poll_option.POLL_OPTION_RESULT}</div></dd>
+ <dd class="poll_option_percent<!-- IF not S_DISPLAY_RESULTS --> hidden<!-- ENDIF -->"><!-- IF poll_option.POLL_OPTION_RESULT == 0 -->{L_NO_VOTES}<!-- ELSE -->{poll_option.POLL_OPTION_PERCENT}<!-- ENDIF --></dd>
</dl>
+ <!-- EVENT viewtopic_body_poll_option_after -->
<!-- END poll_option -->
- <!-- IF S_DISPLAY_RESULTS -->
- <dl>
+ <dl class="poll_total_votes<!-- IF not S_DISPLAY_RESULTS --> hidden<!-- ENDIF -->">
<dt>&nbsp;</dt>
- <dd class="resultbar">{L_TOTAL_VOTES} : {TOTAL_VOTES}</dd>
+ <dd class="resultbar">{L_TOTAL_VOTES}{L_COLON} <span class="poll_total_vote_cnt">{TOTAL_VOTES}</span></dd>
</dl>
- <!-- ENDIF -->
<!-- IF S_CAN_VOTE -->
- <dl style="border-top: none;">
+ <dl style="border-top: none;" class="poll_vote">
<dt>&nbsp;</dt>
<dd class="resultbar"><input type="submit" name="update" value="{L_SUBMIT_VOTE}" class="button1" /></dd>
</dl>
<!-- ENDIF -->
<!-- IF not S_DISPLAY_RESULTS -->
- <dl style="border-top: none;">
+ <dl style="border-top: none;" class="poll_view_results">
<dt>&nbsp;</dt>
<dd class="resultbar"><a href="{U_VIEW_RESULTS}">{L_VIEW_RESULTS}</a></dd>
</dl>
<!-- ENDIF -->
</fieldset>
+ <div class="vote-submitted hidden">{L_VOTE_SUBMITTED}</div>
</div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
{S_FORM_TOKEN}
{S_HIDDEN_FIELDS}
</div>
-
</form>
<hr />
<!-- ENDIF -->
+<!-- EVENT viewtopic_body_poll_after -->
+
<!-- BEGIN postrow -->
- <!-- IF postrow.S_FIRST_UNREAD --><a id="unread"></a><!-- ENDIF -->
- <div id="p{postrow.POST_ID}" class="post <!-- IF postrow.S_ROW_COUNT is odd -->bg1<!-- ELSE -->bg2<!-- ENDIF --><!-- IF postrow.S_UNREAD_POST --> unreadpost<!-- ENDIF --><!-- IF postrow.S_POST_REPORTED --> reported<!-- ENDIF --><!-- IF postrow.S_ONLINE and not postrow.S_IGNORE_POST --> online<!-- ENDIF -->">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <!-- EVENT viewtopic_body_postrow_post_before -->
+ <!-- IF postrow.S_FIRST_UNREAD -->
+ <a id="unread" class="anchor"<!-- IF S_UNREAD_VIEW --> data-url="{postrow.U_MINI_POST}"<!-- ENDIF -->></a>
+ <!-- ENDIF -->
+ <div id="p{postrow.POST_ID}" class="post has-profile <!-- IF postrow.S_ROW_COUNT is odd -->bg1<!-- ELSE -->bg2<!-- ENDIF --><!-- IF postrow.S_UNREAD_POST --> unreadpost<!-- ENDIF --><!-- IF postrow.S_POST_REPORTED --> reported<!-- ENDIF --><!-- IF postrow.S_POST_DELETED --> deleted<!-- ENDIF --><!-- IF postrow.S_ONLINE and not postrow.S_POST_HIDDEN --> online<!-- ENDIF --><!-- IF postrow.POSTER_WARNINGS --> warned<!-- ENDIF -->">
+ <div class="inner">
+
+ <dl class="postprofile" id="profile{postrow.POST_ID}"<!-- IF postrow.S_POST_HIDDEN --> style="display: none;"<!-- ENDIF -->>
+ <dt class="<!-- IF postrow.RANK_TITLE or postrow.RANK_IMG -->has-profile-rank<!-- ELSE -->no-profile-rank<!-- ENDIF --> <!-- IF postrow.POSTER_AVATAR -->has-avatar<!-- ELSE -->no-avatar<!-- ENDIF -->">
+ <div class="avatar-container">
+ <!-- EVENT viewtopic_body_avatar_before -->
+ <!-- IF postrow.POSTER_AVATAR -->
+ <!-- IF postrow.U_POST_AUTHOR --><a href="{postrow.U_POST_AUTHOR}" class="avatar">{postrow.POSTER_AVATAR}</a><!-- ELSE --><span class="avatar">{postrow.POSTER_AVATAR}</span><!-- ENDIF -->
+ <!-- ENDIF -->
+ <!-- EVENT viewtopic_body_avatar_after -->
+ </div>
+ <!-- EVENT viewtopic_body_post_author_before -->
+ <!-- IF not postrow.U_POST_AUTHOR --><strong>{postrow.POST_AUTHOR_FULL}</strong><!-- ELSE -->{postrow.POST_AUTHOR_FULL}<!-- ENDIF -->
+ <!-- EVENT viewtopic_body_post_author_after -->
+ </dt>
- <div class="postbody">
- <!-- IF postrow.S_IGNORE_POST -->
- <div class="ignore">{postrow.L_IGNORE_POST}</div>
- <!-- ELSE -->
+ <!-- EVENT viewtopic_body_postrow_rank_before -->
+ <!-- IF postrow.RANK_TITLE or postrow.RANK_IMG --><dd class="profile-rank">{postrow.RANK_TITLE}<!-- IF postrow.RANK_TITLE and postrow.RANK_IMG --><br /><!-- ENDIF -->{postrow.RANK_IMG}</dd><!-- ENDIF -->
+ <!-- EVENT viewtopic_body_postrow_rank_after -->
- <!-- IF not S_IS_BOT -->
- <!-- IF postrow.U_EDIT or postrow.U_DELETE or postrow.U_REPORT or postrow.U_WARN or postrow.U_INFO or postrow.U_QUOTE -->
- <ul class="profile-icons">
- <!-- IF postrow.U_EDIT --><li class="edit-icon"><a href="{postrow.U_EDIT}" title="{L_EDIT_POST}"><span>{L_EDIT_POST}</span></a></li><!-- ENDIF -->
- <!-- IF postrow.U_DELETE --><li class="delete-icon"><a href="{postrow.U_DELETE}" title="{L_DELETE_POST}"><span>{L_DELETE_POST}</span></a></li><!-- ENDIF -->
- <!-- IF postrow.U_REPORT --><li class="report-icon"><a href="{postrow.U_REPORT}" title="{L_REPORT_POST}"><span>{L_REPORT_POST}</span></a></li><!-- ENDIF -->
- <!-- IF postrow.U_WARN --><li class="warn-icon"><a href="{postrow.U_WARN}" title="{L_WARN_USER}"><span>{L_WARN_USER}</span></a></li><!-- ENDIF -->
- <!-- IF postrow.U_INFO --><li class="info-icon"><a href="{postrow.U_INFO}" title="{L_INFORMATION}"><span>{L_INFORMATION}</span></a></li><!-- ENDIF -->
- <!-- IF postrow.U_QUOTE --><li class="quote-icon"><a href="{postrow.U_QUOTE}" title="{L_REPLY_WITH_QUOTE}"><span>{L_REPLY_WITH_QUOTE}</span></a></li><!-- ENDIF -->
- </ul>
+ <!-- IF postrow.POSTER_POSTS != '' --><dd class="profile-posts"><strong>{L_POSTS}{L_COLON}</strong> <!-- IF postrow.U_SEARCH !== '' --><a href="{postrow.U_SEARCH}"><!-- ENDIF -->{postrow.POSTER_POSTS}<!-- IF postrow.U_SEARCH !== '' --></a><!-- ENDIF --></dd><!-- ENDIF -->
+ <!-- IF postrow.POSTER_JOINED --><dd class="profile-joined"><strong>{L_JOINED}{L_COLON}</strong> {postrow.POSTER_JOINED}</dd><!-- ENDIF -->
+ <!-- IF postrow.POSTER_WARNINGS --><dd class="profile-warnings"><strong>{L_WARNINGS}{L_COLON}</strong> {postrow.POSTER_WARNINGS}</dd><!-- ENDIF -->
+
+ <!-- IF postrow.S_PROFILE_FIELD1 -->
+ <!-- Use a construct like this to include admin defined profile fields. Replace FIELD1 with the name of your field. -->
+ <dd><strong>{postrow.PROFILE_FIELD1_NAME}{L_COLON}</strong> {postrow.PROFILE_FIELD1_VALUE}</dd>
+ <!-- ENDIF -->
+
+ <!-- EVENT viewtopic_body_postrow_custom_fields_before -->
+ <!-- BEGIN custom_fields -->
+ <!-- IF not postrow.custom_fields.S_PROFILE_CONTACT -->
+ <dd class="profile-custom-field profile-{postrow.custom_fields.PROFILE_FIELD_IDENT}"><strong>{postrow.custom_fields.PROFILE_FIELD_NAME}{L_COLON}</strong> {postrow.custom_fields.PROFILE_FIELD_VALUE}</dd>
<!-- ENDIF -->
+ <!-- END custom_fields -->
+ <!-- EVENT viewtopic_body_postrow_custom_fields_after -->
+
+ <!-- EVENT viewtopic_body_contact_fields_before -->
+ <!-- IF not S_IS_BOT and .postrow.contact -->
+ <dd class="profile-contact">
+ <strong>{L_CONTACT}{L_COLON}</strong>
+ <div class="dropdown-container dropdown-left">
+ <a href="#" class="dropdown-trigger"><span class="imageset icon_contact" title="{postrow.CONTACT_USER}">{postrow.CONTACT_USER}</span></a>
+ <div class="dropdown hidden">
+ <div class="pointer"><div class="pointer-inner"></div></div>
+ <div class="dropdown-contents contact-icons">
+ <!-- BEGIN contact -->
+ {% set REMAINDER = postrow.contact.S_ROW_COUNT % 4 %}
+ <!-- DEFINE $S_LAST_CELL = ((REMAINDER eq 3) or (postrow.contact.S_LAST_ROW and postrow.contact.S_NUM_ROWS < 4)) -->
+ <!-- IF REMAINDER eq 0 -->
+ <div>
+ <!-- ENDIF -->
+ <a href="<!-- IF postrow.contact.U_CONTACT -->{postrow.contact.U_CONTACT}<!-- ELSE -->{postrow.U_POST_AUTHOR}<!-- ENDIF -->" title="{postrow.contact.NAME}"<!-- IF $S_LAST_CELL --> class="last-cell"<!-- ENDIF --><!-- IF postrow.contact.ID eq 'jabber' --> onclick="popup(this.href, 750, 320); return false;"<!-- ENDIF -->>
+ <span class="contact-icon {postrow.contact.ID}-icon">{postrow.contact.NAME}</span>
+ </a>
+ <!-- IF REMAINDER eq 3 or postrow.contact.S_LAST_ROW -->
+ </div>
+ <!-- ENDIF -->
+ <!-- END contact -->
+ </div>
+ </div>
+ </div>
+ </dd>
<!-- ENDIF -->
+ <!-- EVENT viewtopic_body_contact_fields_after -->
+
+ </dl>
+
+ <div class="postbody">
+ <!-- IF postrow.S_POST_HIDDEN -->
+ <!-- IF postrow.S_POST_DELETED -->
+ <div class="ignore" id="post_hidden{postrow.POST_ID}">
+ {postrow.L_POST_DELETED_MESSAGE}<br />
+ {postrow.L_POST_DISPLAY}
+ </div>
+ <!-- ELSEIF postrow.S_IGNORE_POST -->
+ <div class="ignore" id="post_hidden{postrow.POST_ID}">
+ {postrow.L_IGNORE_POST}<br />
+ {postrow.L_POST_DISPLAY}
+ </div>
+ <!-- ENDIF -->
+ <!-- ENDIF -->
+ <div id="post_content{postrow.POST_ID}"<!-- IF postrow.S_POST_HIDDEN --> style="display: none;"<!-- ENDIF -->>
+ <!-- EVENT viewtopic_body_post_subject_before -->
<h3 <!-- IF postrow.S_FIRST_ROW -->class="first"<!-- ENDIF -->><!-- IF postrow.POST_ICON_IMG --><img src="{T_ICONS_PATH}{postrow.POST_ICON_IMG}" width="{postrow.POST_ICON_IMG_WIDTH}" height="{postrow.POST_ICON_IMG_HEIGHT}" alt="" /> <!-- ENDIF --><a href="#p{postrow.POST_ID}">{postrow.POST_SUBJECT}</a></h3>
- <p class="author"><!-- IF S_IS_BOT -->{postrow.MINI_POST_IMG}<!-- ELSE --><a href="{postrow.U_MINI_POST}">{postrow.MINI_POST_IMG}</a><!-- ENDIF -->{L_POST_BY_AUTHOR} <strong>{postrow.POST_AUTHOR_FULL}</strong> &raquo; {postrow.POST_DATE} </p>
- <!-- IF postrow.S_POST_UNAPPROVED or postrow.S_POST_REPORTED -->
- <p class="rules">
- <!-- IF postrow.S_POST_UNAPPROVED -->{UNAPPROVED_IMG} <a href="{postrow.U_MCP_APPROVE}"><strong>{L_POST_UNAPPROVED}</strong></a><br /><!-- ENDIF -->
- <!-- IF postrow.S_POST_REPORTED -->{REPORTED_IMG} <a href="{postrow.U_MCP_REPORT}"><strong>{L_POST_REPORTED}</strong></a><!-- ENDIF -->
+ <!-- DEFINE $SHOW_POST_BUTTONS = (postrow.U_EDIT or postrow.U_DELETE or postrow.U_REPORT or postrow.U_WARN or postrow.U_INFO or postrow.U_QUOTE) -->
+ <!-- EVENT viewtopic_body_post_buttons_list_before -->
+ <!-- IF not S_IS_BOT -->
+ <!-- IF $SHOW_POST_BUTTONS -->
+ <ul class="post-buttons">
+ <!-- EVENT viewtopic_body_post_buttons_before -->
+ <!-- IF postrow.U_EDIT -->
+ <li>
+ <a href="{postrow.U_EDIT}" title="{L_EDIT_POST}" class="button icon-button edit-icon"><span>{L_BUTTON_EDIT}</span></a>
+ </li>
+ <!-- ENDIF -->
+ <!-- IF postrow.U_DELETE -->
+ <li>
+ <a href="{postrow.U_DELETE}" title="{L_DELETE_POST}" class="button icon-button delete-icon"><span>{L_DELETE_POST}</span></a>
+ </li>
+ <!-- ENDIF -->
+ <!-- IF postrow.U_REPORT -->
+ <li>
+ <a href="{postrow.U_REPORT}" title="{L_REPORT_POST}" class="button icon-button report-icon"><span>{L_REPORT_POST}</span></a>
+ </li>
+ <!-- ENDIF -->
+ <!-- IF postrow.U_WARN -->
+ <li>
+ <a href="{postrow.U_WARN}" title="{L_WARN_USER}" class="button icon-button warn-icon"><span>{L_WARN_USER}</span></a>
+ </li>
+ <!-- ENDIF -->
+ <!-- IF postrow.U_INFO -->
+ <li>
+ <a href="{postrow.U_INFO}" title="{L_INFORMATION}" class="button icon-button info-icon"><span>{L_INFORMATION}</span></a>
+ </li>
+ <!-- ENDIF -->
+ <!-- IF postrow.U_QUOTE -->
+ <li>
+ <a href="{postrow.U_QUOTE}" title="{L_REPLY_WITH_QUOTE}" class="button icon-button quote-icon"><span>{L_QUOTE}</span></a>
+ </li>
+ <!-- ENDIF -->
+ <!-- EVENT viewtopic_body_post_buttons_after -->
+ </ul>
+ <!-- ENDIF -->
+ <!-- ENDIF -->
+ <!-- EVENT viewtopic_body_post_buttons_list_after -->
+
+ <!-- EVENT viewtopic_body_postrow_post_details_before -->
+ <p class="author"><!-- IF S_IS_BOT -->{postrow.MINI_POST_IMG}<!-- ELSE --><a href="{postrow.U_MINI_POST}">{postrow.MINI_POST_IMG}</a><!-- ENDIF --><span class="responsive-hide">{L_POST_BY_AUTHOR} <strong>{postrow.POST_AUTHOR_FULL}</strong> &raquo; </span>{postrow.POST_DATE} </p>
+ <!-- EVENT viewtopic_body_postrow_post_details_after -->
+
+ <!-- IF postrow.S_POST_UNAPPROVED -->
+ <form method="post" class="mcp_approve" action="{postrow.U_APPROVE_ACTION}">
+ <p class="post-notice unapproved">
+ <strong>{L_POST_UNAPPROVED_ACTION}</strong>
+ <input class="button2" type="submit" value="{L_DISAPPROVE}" name="action[disapprove]" />
+ <input class="button1" type="submit" value="{L_APPROVE}" name="action[approve]" />
+ <input type="hidden" name="post_id_list[]" value="{postrow.POST_ID}" />
+ {S_FORM_TOKEN}
</p>
+ </form>
+ <!-- ELSEIF postrow.S_POST_DELETED -->
+ <form method="post" class="mcp_approve" action="{postrow.U_APPROVE_ACTION}">
+ <p class="post-notice deleted">
+ <strong>{L_POST_DELETED_ACTION}</strong>
+ <!-- IF postrow.S_DELETE_PERMANENT -->
+ <input class="button2" type="submit" value="{L_DELETE}" name="action[delete]" />
+ <!-- ENDIF -->
+ <input class="button1" type="submit" value="{L_RESTORE}" name="action[restore]" />
+ <input type="hidden" name="post_id_list[]" value="{postrow.POST_ID}" />
+ {S_FORM_TOKEN}
+ </p>
+ </form>
+ <!-- ENDIF -->
+
+ <!-- IF postrow.S_POST_REPORTED -->
+ <p class="post-notice reported">
+ <a href="{postrow.U_MCP_REPORT}"><strong>{L_POST_REPORTED}</strong></a>
+ </p>
<!-- ENDIF -->
<div class="content">{postrow.MESSAGE}</div>
<!-- IF postrow.S_HAS_ATTACHMENTS -->
<dl class="attachbox">
- <dt>{L_ATTACHMENTS}</dt>
+ <dt>
+ {L_ATTACHMENTS}
+ </dt>
<!-- BEGIN attachment -->
<dd>{postrow.attachment.DISPLAY_ATTACHMENT}</dd>
<!-- END attachment -->
</dl>
<!-- ENDIF -->
+ <!-- EVENT viewtopic_body_postrow_post_notices_before -->
<!-- IF postrow.S_DISPLAY_NOTICE --><div class="rules">{L_DOWNLOAD_NOTICE}</div><!-- ENDIF -->
- <!-- IF postrow.EDITED_MESSAGE or postrow.EDIT_REASON -->
- <div class="notice">{postrow.EDITED_MESSAGE}
- <!-- IF postrow.EDIT_REASON --><br /><strong>{L_REASON}:</strong> <em>{postrow.EDIT_REASON}</em><!-- ENDIF -->
+ <!-- IF postrow.DELETED_MESSAGE or postrow.DELETE_REASON -->
+ <div class="notice post_deleted_msg">
+ {postrow.DELETED_MESSAGE}
+ <!-- IF postrow.DELETE_REASON --><br /><strong>{L_REASON}{L_COLON}</strong> <em>{postrow.DELETE_REASON}</em><!-- ENDIF -->
+ </div>
+ <!-- ELSEIF postrow.EDITED_MESSAGE or postrow.EDIT_REASON -->
+ <div class="notice">
+ {postrow.EDITED_MESSAGE}
+ <!-- IF postrow.EDIT_REASON --><br /><strong>{L_REASON}{L_COLON}</strong> <em>{postrow.EDIT_REASON}</em><!-- ENDIF -->
</div>
<!-- ENDIF -->
<!-- IF postrow.BUMPED_MESSAGE --><div class="notice"><br /><br />{postrow.BUMPED_MESSAGE}</div><!-- ENDIF -->
+ <!-- EVENT viewtopic_body_postrow_post_notices_after -->
<!-- IF postrow.SIGNATURE --><div id="sig{postrow.POST_ID}" class="signature">{postrow.SIGNATURE}</div><!-- ENDIF -->
- <!-- ENDIF -->
-
- </div>
-
- <!-- IF not postrow.S_IGNORE_POST -->
- <dl class="postprofile" id="profile{postrow.POST_ID}">
- <dt>
- <!-- IF postrow.POSTER_AVATAR -->
- <!-- IF postrow.U_POST_AUTHOR --><a href="{postrow.U_POST_AUTHOR}">{postrow.POSTER_AVATAR}</a><!-- ELSE -->{postrow.POSTER_AVATAR}<!-- ENDIF --><br />
- <!-- ENDIF -->
- <!-- IF not postrow.U_POST_AUTHOR --><strong>{postrow.POST_AUTHOR_FULL}</strong><!-- ELSE -->{postrow.POST_AUTHOR_FULL}<!-- ENDIF -->
- </dt>
-
- <!-- IF postrow.RANK_TITLE or postrow.RANK_IMG --><dd>{postrow.RANK_TITLE}<!-- IF postrow.RANK_TITLE and postrow.RANK_IMG --><br /><!-- ENDIF -->{postrow.RANK_IMG}</dd><!-- ENDIF -->
- <dd>&nbsp;</dd>
-
- <!-- IF postrow.POSTER_POSTS != '' --><dd><strong>{L_POSTS}:</strong> {postrow.POSTER_POSTS}</dd><!-- ENDIF -->
- <!-- IF postrow.POSTER_JOINED --><dd><strong>{L_JOINED}:</strong> {postrow.POSTER_JOINED}</dd><!-- ENDIF -->
- <!-- IF postrow.POSTER_FROM --><dd><strong>{L_LOCATION}:</strong> {postrow.POSTER_FROM}</dd><!-- ENDIF -->
-
- <!-- IF postrow.S_PROFILE_FIELD1 -->
- <!-- Use a construct like this to include admin defined profile fields. Replace FIELD1 with the name of your field. -->
- <dd><strong>{postrow.PROFILE_FIELD1_NAME}:</strong> {postrow.PROFILE_FIELD1_VALUE}</dd>
- <!-- ENDIF -->
-
- <!-- BEGIN custom_fields -->
- <dd><strong>{postrow.custom_fields.PROFILE_FIELD_NAME}:</strong> {postrow.custom_fields.PROFILE_FIELD_VALUE}</dd>
- <!-- END custom_fields -->
-
- <!-- IF not S_IS_BOT -->
- <!-- IF postrow.U_PM or postrow.U_EMAIL or postrow.U_WWW or postrow.U_MSN or postrow.U_ICQ or postrow.U_YIM or postrow.U_AIM or postrow.U_JABBER -->
- <dd>
- <ul class="profile-icons">
- <!-- IF postrow.U_PM --><li class="pm-icon"><a href="{postrow.U_PM}" title="{L_PRIVATE_MESSAGE}"><span>{L_PRIVATE_MESSAGE}</span></a></li><!-- ENDIF -->
- <!-- IF postrow.U_EMAIL --><li class="email-icon"><a href="{postrow.U_EMAIL}" title="{L_SEND_EMAIL_USER} {postrow.POST_AUTHOR}"><span>{L_SEND_EMAIL_USER} {postrow.POST_AUTHOR}</span></a></li><!-- ENDIF -->
- <!-- IF postrow.U_WWW --><li class="web-icon"><a href="{postrow.U_WWW}" title="{L_VISIT_WEBSITE}: {postrow.U_WWW}"><span>{L_WEBSITE}</span></a></li><!-- ENDIF -->
- <!-- IF postrow.U_MSN --><li class="msnm-icon"><a href="{postrow.U_MSN}" onclick="popup(this.href, 550, 320); return false;" title="{L_MSNM}"><span>{L_MSNM}</span></a></li><!-- ENDIF -->
- <!-- IF postrow.U_ICQ --><li class="icq-icon"><a href="{postrow.U_ICQ}" onclick="popup(this.href, 550, 320); return false;" title="{L_ICQ}"><span>{L_ICQ}</span></a></li><!-- ENDIF -->
- <!-- IF postrow.U_YIM --><li class="yahoo-icon"><a href="{postrow.U_YIM}" onclick="popup(this.href, 780, 550); return false;" title="{L_YIM}"><span>{L_YIM}</span></a></li><!-- ENDIF -->
- <!-- IF postrow.U_AIM --><li class="aim-icon"><a href="{postrow.U_AIM}" onclick="popup(this.href, 550, 320); return false;" title="{L_AIM}"><span>{L_AIM}</span></a></li><!-- ENDIF -->
- <!-- IF postrow.U_JABBER --><li class="jabber-icon"><a href="{postrow.U_JABBER}" onclick="popup(this.href, 550, 320); return false;" title="{L_JABBER}"><span>{L_JABBER}</span></a></li><!-- ENDIF -->
- </ul>
- </dd>
- <!-- ENDIF -->
- <!-- ENDIF -->
+ <!-- EVENT viewtopic_body_postrow_post_content_footer -->
+ </div>
- </dl>
- <!-- ENDIF -->
+ </div>
- <div class="back2top"><a href="#wrap" class="top" title="{L_BACK_TO_TOP}">{L_BACK_TO_TOP}</a></div>
+ <!-- EVENT viewtopic_body_postrow_back2top_before -->
+ <div class="back2top"><!-- EVENT viewtopic_body_postrow_back2top_prepend --><a href="#top" class="top" title="{L_BACK_TO_TOP}">{L_BACK_TO_TOP}</a><!-- EVENT viewtopic_body_postrow_back2top_append --></div>
+ <!-- EVENT viewtopic_body_postrow_back2top_after -->
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<hr class="divider" />
+ <!-- EVENT viewtopic_body_postrow_post_after -->
<!-- END postrow -->
+
<!-- IF S_QUICK_REPLY -->
<!-- INCLUDE quickreply_editor.html -->
<!-- ENDIF -->
-<!-- IF S_NUM_POSTS > 1 or PREVIOUS_PAGE -->
- <form id="viewtopic" method="post" action="{S_TOPIC_ACTION}">
+<!-- IF S_NUM_POSTS > 1 or .pagination -->
+ <form id="viewtopic" method="post" action="{S_TOPIC_ACTION}">
<fieldset class="display-options" style="margin-top: 0; ">
- <!-- IF PREVIOUS_PAGE --><a href="{PREVIOUS_PAGE}" class="left-box {S_CONTENT_FLOW_BEGIN}">{L_PREVIOUS}</a><!-- ENDIF -->
- <!-- IF NEXT_PAGE --><a href="{NEXT_PAGE}" class="right-box {S_CONTENT_FLOW_END}">{L_NEXT}</a><!-- ENDIF -->
<!-- IF not S_IS_BOT -->
- <label>{L_DISPLAY_POSTS}: {S_SELECT_SORT_DAYS}</label>
- <label>{L_SORT_BY} {S_SELECT_SORT_KEY}</label> <label>{S_SELECT_SORT_DIR} <input type="submit" name="sort" value="{L_GO}" class="button2" /></label>
+ <label>{L_DISPLAY_POSTS}{L_COLON} {S_SELECT_SORT_DAYS}</label>
+ <label>{L_SORT_BY} {S_SELECT_SORT_KEY}</label> <label>{S_SELECT_SORT_DIR}</label>
+ <input type="submit" name="sort" value="{L_GO}" class="button2" />
<!-- ENDIF -->
</fieldset>
-
</form>
<hr />
<!-- ENDIF -->
-<div class="topic-actions">
+<!-- EVENT viewtopic_body_topic_actions_before -->
+<div class="action-bar bottom">
<div class="buttons">
+ <!-- EVENT viewtopic_buttons_bottom_before -->
+
<!-- IF not S_IS_BOT and S_DISPLAY_REPLY_INFO -->
- <div class="<!-- IF S_IS_LOCKED -->locked-icon<!-- ELSE -->reply-icon<!-- ENDIF -->"><a href="{U_POST_REPLY_TOPIC}" title="<!-- IF S_IS_LOCKED -->{L_TOPIC_LOCKED}<!-- ELSE -->{L_POST_REPLY}<!-- ENDIF -->"><span></span><!-- IF S_IS_LOCKED -->{L_TOPIC_LOCKED_SHORT}<!-- ELSE -->{L_POST_REPLY}<!-- ENDIF --></a></div>
+ <a href="{U_POST_REPLY_TOPIC}" class="button icon-button <!-- IF S_IS_LOCKED -->locked-icon<!-- ELSE -->reply-icon<!-- ENDIF -->" title="<!-- IF S_IS_LOCKED -->{L_TOPIC_LOCKED}<!-- ELSE -->{L_POST_REPLY}<!-- ENDIF -->">
+ <!-- IF S_IS_LOCKED -->{L_BUTTON_TOPIC_LOCKED}<!-- ELSE -->{L_BUTTON_POST_REPLY}<!-- ENDIF -->
+ </a>
<!-- ENDIF -->
+
+ <!-- EVENT viewtopic_buttons_bottom_after -->
</div>
- <!-- IF PAGINATION or TOTAL_POSTS -->
+ <!-- INCLUDE viewtopic_topic_tools.html -->
+
+ <!-- IF .quickmod -->
+ <div class="dropdown-container dropdown-container-{S_CONTENT_FLOW_BEGIN} dropdown-up dropdown-{S_CONTENT_FLOW_END} dropdown-button-control" id="quickmod">
+ <span title="{L_QUICK_MOD}" class="dropdown-trigger button icon-button modtools-icon dropdown-select">{L_QUICK_MOD}</span>
+ <div class="dropdown hidden">
+ <div class="pointer"><div class="pointer-inner"></div></div>
+ <ul class="dropdown-contents">
+ <!-- BEGIN quickmod -->
+ <!-- DEFINE $QUICKMOD_AJAX = (quickmod.VALUE in ['lock', 'unlock', 'delete_topic', 'restore_topic', 'make_normal', 'make_sticky', 'make_announce', 'make_global']) -->
+ <li><a href="{quickmod.LINK}"<!-- IF $QUICKMOD_AJAX --> data-ajax="true" data-refresh="true"<!-- ENDIF -->>{quickmod.TITLE}</a></li>
+ <!-- END quickmod -->
+ </ul>
+ </div>
+ </div>
+ <!-- ENDIF -->
+
+ <!-- EVENT viewtopic_dropdown_bottom_custom -->
+
+ <!-- IF .pagination or TOTAL_POSTS -->
<div class="pagination">
{TOTAL_POSTS}
- <!-- IF PAGE_NUMBER --><!-- IF PAGINATION --> &bull; <a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{PAGE_NUMBER}</a> &bull; <span>{PAGINATION}</span><!-- ELSE --> &bull; {PAGE_NUMBER}<!-- ENDIF --><!-- ENDIF -->
+ <!-- IF .pagination -->
+ <!-- INCLUDE pagination.html -->
+ <!-- ELSE -->
+ &bull; {PAGE_NUMBER}
+ <!-- ENDIF -->
</div>
<!-- ENDIF -->
+ <div class="clear"></div>
</div>
+<!-- EVENT viewtopic_body_footer_before -->
<!-- INCLUDE jumpbox.html -->
-<!-- IF S_TOPIC_MOD -->
- <form method="post" action="{S_MOD_ACTION}">
- <fieldset class="quickmod">
- <label for="quick-mod-select">{L_QUICK_MOD}:</label> {S_TOPIC_MOD} <input type="submit" value="{L_GO}" class="button2" />
- {S_FORM_TOKEN}
- </fieldset>
- </form>
-<!-- ENDIF -->
-
-<!-- IF S_DISPLAY_ONLINE_LIST -->
- <h3><!-- IF U_VIEWONLINE --><a href="{U_VIEWONLINE}">{L_WHO_IS_ONLINE}</a><!-- ELSE -->{L_WHO_IS_ONLINE}<!-- ENDIF --></h3>
- <p>{LOGGED_IN_USER_LIST}</p>
+<!-- IF S_DISPLAY_ONLINE_LIST and U_VIEWONLINE -->
+ <div class="stat-block online-list">
+ <h3><a href="{U_VIEWONLINE}">{L_WHO_IS_ONLINE}</a></h3>
+ <p>{LOGGED_IN_USER_LIST}</p>
+ </div>
<!-- ENDIF -->
-<!-- INCLUDE overall_footer.html --> \ No newline at end of file
+<!-- INCLUDE overall_footer.html -->
diff --git a/phpBB/styles/prosilver/template/viewtopic_print.html b/phpBB/styles/prosilver/template/viewtopic_print.html
index 168305a6a4..919c9397e1 100644
--- a/phpBB/styles/prosilver/template/viewtopic_print.html
+++ b/phpBB/styles/prosilver/template/viewtopic_print.html
@@ -1,23 +1,18 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" dir="{S_CONTENT_DIRECTION}" lang="{S_USER_LANG}" xml:lang="{S_USER_LANG}">
+<!DOCTYPE html>
+<html dir="{S_CONTENT_DIRECTION}" lang="{S_USER_LANG}">
<head>
-
-<meta http-equiv="content-type" content="text/html; charset={S_CONTENT_ENCODING}" />
-<meta http-equiv="content-style-type" content="text/css" />
-<meta http-equiv="content-language" content="{S_USER_LANG}" />
-<meta http-equiv="imagetoolbar" content="no" />
-<meta name="resource-type" content="document" />
-<meta name="distribution" content="global" />
+<meta charset="utf-8" />
+<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="robots" content="noindex" />
{META}
<title>{SITENAME} &bull; {PAGE_TITLE}</title>
-<link href="{T_THEME_PATH}/print.css" rel="stylesheet" type="text/css" />
+<link href="{T_THEME_PATH}/print.css" rel="stylesheet">
+<!-- EVENT viewtopic_print_head_append -->
</head>
-
<body id="phpbb">
<div id="wrap">
- <a id="top" name="top" accesskey="t"></a>
+ <a id="top" class="anchor" accesskey="t"></a>
<div id="page-header">
<h1>{SITENAME}</h1>
@@ -32,7 +27,7 @@
<!-- BEGIN postrow -->
<div class="post">
<h3>{postrow.POST_SUBJECT}</h3>
- <div class="date">{postrow.MINI_POST_IMG}{L_POSTED}: <strong>{postrow.POST_DATE}</strong></div>
+ <div class="date">{L_POSTED}{L_COLON} <strong>{postrow.POST_DATE}</strong></div>
<div class="author">{L_POST_BY_AUTHOR} <strong>{postrow.POST_AUTHOR}</strong></div>
<div class="content">{postrow.MESSAGE}</div>
</div>
@@ -42,9 +37,9 @@
<div id="page-footer">
<div class="page-number">{S_TIMEZONE}<br />{PAGE_NUMBER}</div>
- <div class="copyright">Powered by phpBB&reg; Forum Software &copy; phpBB Group<br />https://www.phpbb.com/</div>
+ <div class="copyright">Powered by phpBB&reg; Forum Software &copy; phpBB Limited<br />https://www.phpbb.com/</div>
</div>
</div>
</body>
-</html> \ No newline at end of file
+</html>
diff --git a/phpBB/styles/prosilver/template/viewtopic_topic_tools.html b/phpBB/styles/prosilver/template/viewtopic_topic_tools.html
new file mode 100644
index 0000000000..8378e3bcf4
--- /dev/null
+++ b/phpBB/styles/prosilver/template/viewtopic_topic_tools.html
@@ -0,0 +1,25 @@
+<!-- IF not S_IS_BOT and (U_WATCH_TOPIC or U_BOOKMARK_TOPIC or U_BUMP_TOPIC or U_EMAIL_TOPIC or U_PRINT_TOPIC or S_DISPLAY_TOPIC_TOOLS) -->
+ <div class="dropdown-container dropdown-button-control topic-tools">
+ <span title="{L_TOPIC_TOOLS}" class="button icon-button tools-icon dropdown-trigger dropdown-select"></span>
+ <div class="dropdown hidden">
+ <div class="pointer"><div class="pointer-inner"></div></div>
+ <ul class="dropdown-contents">
+ <!-- EVENT viewtopic_topic_tools_before -->
+ <!-- IF U_WATCH_TOPIC -->
+ <li class="small-icon icon-<!-- IF S_WATCHING_TOPIC -->unsubscribe<!-- ELSE -->subscribe<!-- ENDIF -->">
+ <a href="{U_WATCH_TOPIC}" class="watch-topic-link" title="{S_WATCH_TOPIC_TITLE}" data-ajax="toggle_link" data-toggle-class="small-icon icon-<!-- IF not S_WATCHING_TOPIC -->unsubscribe<!-- ELSE -->subscribe<!-- ENDIF -->" data-toggle-text="{S_WATCH_TOPIC_TOGGLE}" data-toggle-url="{U_WATCH_TOPIC_TOGGLE}" data-update-all=".watch-topic-link">{S_WATCH_TOPIC_TITLE}</a>
+ </li>
+ <!-- ENDIF -->
+ <!-- IF U_BOOKMARK_TOPIC -->
+ <li class="small-icon icon-bookmark">
+ <a href="{U_BOOKMARK_TOPIC}" class="bookmark-link" title="{L_BOOKMARK_TOPIC}" data-ajax="alt_text" data-alt-text="{S_BOOKMARK_TOGGLE}" data-update-all=".bookmark-link">{S_BOOKMARK_TOPIC}</a>
+ </li>
+ <!-- ENDIF -->
+ <!-- IF U_BUMP_TOPIC --><li class="small-icon icon-bump"><a href="{U_BUMP_TOPIC}" title="{L_BUMP_TOPIC}" data-ajax="true">{L_BUMP_TOPIC}</a></li><!-- ENDIF -->
+ <!-- IF U_EMAIL_TOPIC --><li class="small-icon icon-sendemail"><a href="{U_EMAIL_TOPIC}" title="{L_EMAIL_TOPIC}">{L_EMAIL_TOPIC}</a></li><!-- ENDIF -->
+ <!-- IF U_PRINT_TOPIC --><li class="small-icon icon-print"><a href="{U_PRINT_TOPIC}" title="{L_PRINT_TOPIC}" accesskey="p">{L_PRINT_TOPIC}</a></li><!-- ENDIF -->
+ <!-- EVENT viewtopic_topic_tools_after -->
+ </ul>
+ </div>
+ </div>
+<!-- ENDIF -->
diff --git a/phpBB/styles/prosilver/theme/bidi.css b/phpBB/styles/prosilver/theme/bidi.css
index c258ed1245..f3468ebcf2 100644
--- a/phpBB/styles/prosilver/theme/bidi.css
+++ b/phpBB/styles/prosilver/theme/bidi.css
@@ -2,7 +2,7 @@
---------------------------------------- */
/**
-* common.css
+* common.css
*/
.rtl h1 {
margin-right: 0;
@@ -20,29 +20,13 @@
/* Main blocks
---------------------------------------- */
-.rtl #logo {
+.rtl .logo {
float: right;
padding: 10px 10px 0 13px;
}
-/* Search box
+/* Site Description
--------------------------------------------- */
-.rtl #search-box {
- float: left;
- text-align: left;
- margin-right: 0;
- margin-left: 5px;
-}
-
-.rtl #search-box li {
- text-align: left;
-}
-
-.rtl #search-box img {
- margin-right: 0;
- margin-left: 3px;
-}
-
.rtl #site-description {
float: right;
}
@@ -59,20 +43,20 @@
/* Horizontal lists
----------------------------------------*/
-.rtl ul.linklist li {
+.rtl ul.linklist > li {
float: right;
margin-right: 0;
- margin-left: 5px;
+ margin-left: 7px;
}
-.rtl ul.linklist li.rightside, .rtl p.rightside {
+.rtl ul.linklist > li.rightside, .rtl p.rightside, .rtl a.rightside {
float: left;
- margin-right: 5px;
+ margin-right: 7px;
margin-left: 0;
text-align: left;
}
-.rtl ul.leftside li, .rtl ul.rightside li {
+.rtl ul.leftside > li, .rtl ul.rightside > li {
float: left;
}
@@ -90,6 +74,78 @@
text-align: left;
}
+/* Bulletin icons for list items
+----------------------------------------*/
+.rtl ul.linklist.bulletin > li:before {
+ padding-left: 4px;
+ padding-right: 0;
+}
+
+.rtl ul.linklist li.responsive-menu a.responsive-menu-link:before {
+ left: auto;
+ right: 0;
+}
+
+/* Dropdown menu
+---------------------------------------- */
+.rtl .dropdown-container.topic-tools {
+ float: right;
+}
+
+.rtl .dropdown li {
+ text-align: right;
+}
+
+.rtl .dropdown-contents > li {
+ padding-left: 15px;
+ padding-right: 0;
+}
+
+.rtl .dropdown-nonscroll > li {
+ padding-left: 0;
+}
+
+.rtl .dropdown li li {
+ padding-left: 0;
+ padding-right: 18px;
+}
+
+.rtl .dropdown-extended .header {
+ text-align: right;
+}
+
+.rtl .dropdown-extended .header .header_settings {
+ float: left;
+}
+
+/* Notifications
+----------------------------------------*/
+.rtl .notification_list ul li img {
+ float: right;
+ margin-left: 5px;
+ margin-right: 0;
+}
+
+.rtl .notification_list div.notifications {
+ margin-left: 0;
+ margin-right: 50px;
+}
+
+.rtl .notification_text {
+ margin-left: 0;
+ margin-right: 58px;
+}
+
+.rtl .notification_list p.notification-time {
+ text-align: left;
+}
+
+/* Responsive breadcrumbs
+----------------------------------------*/
+.rtl .breadcrumbs .crumb {
+ float: right;
+}
+
/* Table styles
----------------------------------------*/
.rtl table.table1 thead th {
@@ -126,8 +182,7 @@
/* Misc layout styles
---------------------------------------- */
-/* column[1-2] styles are containers for two column layouts
- Also see tweaks.css */
+/* column[1-2] styles are containers for two column layouts */
.rtl .column1 {
float: right;
clear: right;
@@ -178,25 +233,39 @@
.rtl .pagination {
text-align: left;
float: left;
- padding-left: 5px;
+}
+
+.rtl .pagination > ul {
+ margin-left: 0;
+ margin-right: 5px;
}
/* Pagination in viewforum for multipage topics */
.rtl .row .pagination {
+ background-position: 100% 50%;
float: left;
- padding: 1px 0 1px 15px;
+ padding-left: 0;
+ padding-right: 15px;
+}
+
+.rtl .row .pagination > ul {
+ margin: 0;
}
.rtl .pagination span {
direction: ltr;
}
-.rtl .pagination span.page-sep {
- display: inline;
- visibility: hidden;
- position: absolute;
+.pagination li.page-jump {
+ margin-left: 5px;
+ margin-right: 0;
}
+.pagination li.previous a { background-position: -50px 2px; }
+.pagination li.next a { background-position: -30px 2px; }
+.pagination li.previous a:hover { background-position: -50px -18px; }
+.pagination li.next a:hover { background-position: -30px -18px; }
+
/* Miscellaneous styles
---------------------------------------- */
.rtl #forum-permissions {
@@ -208,12 +277,19 @@
text-align: left;
}
-.rtl .forabg {
- width: 99%; /* fix for IE6 */
+.rtl #quick-links {
+ margin-left: 7px;
+ margin-right: 0;
+}
+
+.rtl .header-avatar span:after {
+ float: left;
+ padding-left: 0;
+ padding-right: 2px;
}
-.rtl .forumbg {
- width: 99%; /* fix for IE6 */
+.rtl .member-search {
+ float: right;
}
/**
@@ -231,6 +307,18 @@
unicode-bidi: embed;
}
+li.breadcrumbs span:first-child > a {
+ padding-left: 0;
+ padding-right: 19px;
+}
+
+/* Notification mark read link */
+.rtl .dropdown-extended a.mark_read {
+ border-radius: 0 3px 3px 0;
+ left: 0;
+ right: auto;
+}
+
.rtl a.top {
float: left;
}
@@ -243,12 +331,8 @@
.rtl .skiplink {
/* invisible skip link, used for accessibility */
- position: relative;
- width: 1px;
- height: 1px;
- overflow: hidden;
- display: block;
left: 0;
+ right: -999px;
}
.rtl a.feed-icon-forum {
@@ -258,22 +342,45 @@
/**
* content.css
*/
-.rtl ul.topiclist dfn {
- /* Labels for post/view counts */
- position: relative;
- width: 1px;
- height: 1px;
- overflow: hidden;
- display: block;
- left: 0;
+.rtl ul.topiclist dt, .rtl li.header dt {
+ float: right;
+ margin-right: 0;
+ margin-left: -440px;
}
-.rtl ul.topiclist dt {
- float: right;
+.rtl ul.topiclist.missing-column dt {
+ margin-right: 0;
+ margin-left: -345px;
}
-.rtl ul.topiclist dl {
- position: static; /* fix for IE6 */
+.rtl ul.topiclist.two-long-columns dt {
+ margin-right: 0;
+ margin-left: -250px;
+}
+
+.rtl ul.topiclist.two-columns dt {
+ margin-right: 0;
+ margin-left: -80px;
+}
+
+.rtl ul.topiclist dt .list-inner {
+ margin-right: 0;
+ margin-left: 440px;
+}
+
+.rtl ul.topiclist.missing-column dt .list-inner {
+ margin-right: 0;
+ margin-left: 330px;
+}
+
+.rtl ul.topiclist.two-long-columns dt .list-inner {
+ margin-right: 0;
+ margin-left: 250px;
+}
+
+.rtl ul.topiclist.two-columns dt .list-inner {
+ margin-right: 0;
+ margin-left: 80px;
}
.rtl ul.topiclist dd {
@@ -283,6 +390,11 @@
border-left: none;
}
+.rtl ul.topiclist dfn {
+ left: auto;
+ right: -999px;
+}
+
.rtl ul.topiclist li.row dt a.subforum {
padding-right: 12px;
background-position: right;
@@ -300,47 +412,63 @@
}
.rtl li.header dd {
- margin-left: 0;
- margin-right: 1px;
+ padding-left: 0;
+ padding-right: 1px;
}
.rtl dl.icon {
background-position: 99.5% 50%;
}
-.rtl li.header dl.icon dt {
+.rtl li.header dl.icon dt .list-inner {
/* Tweak for headers alignment when folder icon used */
padding-right: 0;
padding-left: 50px;
}
.rtl dl.icon dt {
- padding-left: 0;
- padding-right: 45px; /* Space for folder icon */
background-position: 99.5% 95%; /* Position of topic icon */
}
-.rtl dd.lastpost span, .rtl ul.topiclist dd.searchby span, .rtl ul.topiclist dd.info span, .rtl ul.topiclist dd.time span, .rtl dd.redirect span, .rtl dd.moderation span {
- padding-left: 0;
- padding-right: 5px;
+.rtl dl.icon dt .list-inner {
+ padding-left: 5px;
+ padding-right: 45px; /* Space for folder icon */
}
-.rtl dd.mark {
- float: left !important;
+.rtl dl a.icon-link { /* topic row icon links */
+ display: inline-block;
+ left: auto;
+ right: 0;
+ margin-left: 0;
+ margin-right: 2px;
}
-.rtl ul.topiclist dd.searchextra {
- margin-left: 0;
- margin-right: 5px;
- border-right: none;
+.rtl dd.lastpost > span, .rtl ul.topiclist dd.info > span, .rtl ul.topiclist dd.time > span, .rtl dd.redirect > span, .rtl dd.moderation > span {
+ padding-left: 0;
+ padding-right: 5px;
}
/* Post body styles
----------------------------------------*/
-.rtl .postbody {
+.rtl .postbody, .rtl .postbody h3 {
float: right;
}
+.rtl .has-profile .postbody h3 {
+ margin-right: 0;
+ margin-left: 180px;
+}
+
+.rtl p.post-notice {
+ padding-left: 5px;
+ padding-right: 26px;
+}
+
+.rtl p.post-notice:before {
+ left: auto;
+ right: 0;
+}
+
/* Topic review panel
----------------------------------------*/
.rtl #topicreview {
@@ -355,11 +483,6 @@
margin-left: 0;
}
-/* Post author */
-.rtl p.author {
- margin: 0 0 0.6em 15em;
-}
-
.rtl .signature {
clear: right;
}
@@ -392,7 +515,7 @@
margin-left: 0;
}
-.rtl blockquote dl.codebox {
+.rtl blockquote .codebox {
margin-right: 0;
}
@@ -447,9 +570,7 @@
/* Poster profile block
----------------------------------------*/
.rtl .postprofile {
- border-left: none;
- border-right-width: 1px;
- border-right-style: solid;
+ border-width: 0 1px 0 0;
float: left;
/* text-align: right; */
}
@@ -465,6 +586,10 @@
margin-right: 8px;
}
+.rtl .postprofile .avatar {
+ float: right;
+}
+
.rtl .online {
background-position: 0 0;
}
@@ -477,45 +602,82 @@
/**
* buttons.css
*/
-/* Rollover buttons
- Based on: http://wellstyled.com/css-nopreload-rollovers.html
-----------------------------------------*/
-.rtl .buttons {
- float: right;
+.rtl .dropdown-select {
+ padding-left: 24px;
+ padding-right: 8px;
}
-/* Rollover state */
-.rtl .buttons div {
- margin: 0 1px 0 5px;
+.rtl .icon-button:before {
+ float: left;
+ margin-left: 0;
+ margin-right: 2px;
}
-/* Sub-header (navigation bar)
---------------------------------------------- */
-.rtl a.print, .rtl a.sendemail, .rtl a.fontsize {
- text-align: right;
+.rtl .dropdown-select.icon-button:before {
+ margin-left: 4px;
+ margin-right: 0;
+}
+
+.rtl .dropdown-select:after {
+ border-left: 0;
+ border-right-style: solid;
+ border-right-width: 1px;
+ left: 0;
+ right: auto;
+}
+
+.rtl .buttons, .rtl .buttons .button {
+ float: right;
+}
+
+.rtl .buttons .button, .rtl .dropdown-select {
+ margin-left: 5px;
+ margin-right: 0;
}
/* Icon images
---------------------------------------- */
-.rtl .sitehome, .rtl .icon-faq, .rtl .icon-members, .rtl .icon-home, .rtl .icon-ucp, .rtl .icon-register, .rtl .icon-logout,
-.rtl .icon-bookmark, .rtl .icon-bump, .rtl .icon-subscribe, .rtl .icon-unsubscribe, .rtl .icon-pages, .rtl .icon-search {
+.rtl .small-icon {
background-position: 100% 50%;
- padding: 1px 17px 0 0;
}
-/* Poster profile icons
-----------------------------------------*/
-/* Rollover state */
-.rtl .postprofile ul.profile-icons li {
- float: right;
- margin: 0 0 3px 6px;
+.rtl .small-icon > a {
+ padding-left: 0;
+ padding-right: 19px;
}
-/* Positioning of moderator icons */
-.rtl .postbody ul.profile-icons {
+/* Post control buttons
+--------------------------------------------- */
+.rtl .post-buttons {
float: left;
}
+.rtl .has-profile .post-buttons {
+ left: 0;
+ right: auto;
+}
+
+.rtl .post-buttons li {
+ float: right;
+}
+
+.post-buttons .icon-button:before {
+ margin-right: 0;
+}
+
+/* Poster contact icons
+ ----------------------------------------*/
+.rtl .contact-icons a {
+ border-left-width: 1px;
+ border-left-style: dotted;
+ border-right: none;
+ float: right;
+}
+
+.rtl .contact-icons .last-cell {
+ border-left: none;
+}
+
/**
* cp.css
*/
@@ -538,41 +700,75 @@
margin-left: 0;
}
-.rtl #cp-main .pagination {
- float: left;
-}
-
.rtl #cp-main .buttons {
margin-right: 0;
margin-left: 0;
}
+.tabs-container h2 {
+ float: right;
+}
+
/* CP tabbed menu
----------------------------------------*/
.rtl #tabs {
- margin: 20px 7px -1px 0;
+ margin-left: 0;
+ margin-right: 7px;
}
-.rtl #tabs a {
+.rtl #tabs .tab {
float: right;
}
-/*.rtl #tabs a span {
- float: right;
-}*/
+.rtl #tabs .tab > a {
+ margin-left: 1px;
+ margin-right: 0;
+}
/* Mini tabbed menu used in MCP
----------------------------------------*/
.rtl #minitabs {
- margin: -20px 0 0 7px;
+ float: left;
+ margin-right: 0;
+ margin-left: 7px;
}
-.rtl #minitabs li {
+.rtl #minitabs .tab {
float: left;
+}
+
+.rtl #minitabs .tab > a {
margin-right: 2px;
margin-left: 0;
}
+/* Responsive tabs
+----------------------------------------*/
+.rtl #tabs .dropdown {
+ margin-left: -2px;
+}
+
+.rtl #tabs .dropdown li {
+ text-align: left;
+}
+
+.rtl #minitabs .dropdown {
+ margin-left: -4px;
+}
+
+.rtl #minitabs .dropdown li {
+ text-align: right;
+}
+
+/* Responsive *CP navigation
+----------------------------------------*/
+@media only screen and (max-width: 900px), only screen and (max-device-width: 900px)
+{
+ .rtl #cp-menu, .rtl #navigation, .rtl #cp-main {
+ float: none;
+ }
+}
+
/* UCP navigation menu
----------------------------------------*/
@@ -623,6 +819,15 @@
float: right;
}
+/* Responsive *CP navigation
+----------------------------------------*/
+@media only screen and (max-width: 900px), only screen and (max-device-width: 900px)
+{
+ .rtl #cp-menu, .rtl #navigation, .rtl #cp-main {
+ float: none;
+ }
+}
+
/**
* forms.css
*/
@@ -659,7 +864,7 @@
}
.rtl fieldset.fields1 dd {
- margin-right: 10em;
+ margin-right: 15em;
margin-left: 0;
border-right-width: 0;
border-left-width: 1px;
@@ -726,16 +931,6 @@
float: left;
}
-/* Jumpbox */
-.rtl fieldset.jumpbox {
- text-align: left;
-}
-
-.rtl fieldset.quickmod {
- float: left;
- text-align: left;
-}
-
/* Posting page styles
----------------------------------------*/
@@ -744,27 +939,201 @@
float: left;
}
-/* Form button styles
+/* Search box
---------------------------------------- */
/* Topic and forum Search */
.rtl .search-box {
- margin-right: 5px;
- margin-left: 0;
float: right;
}
+.rtl .search-box .inputbox {
+ border-left-width: 0;
+ border-right-width: 1px;
+ border-radius: 0 4px 4px 0;
+ float: right;
+ padding: 3px;
+}
+
+.rtl .search-box .button {
+ float: right;
+}
+
+.rtl .search-box a.button {
+ border-left-width: 1px;
+ border-right-width: 0;
+ border-radius: 4px 0 0 4px;
+ padding-left: 5px;
+ padding-right: 3px;
+}
+
+.rtl .search-header {
+ float: left;
+ margin-right: 0;
+ margin-left: 5px;
+}
+
.rtl input.search {
background-position: right 1px;
padding-right: 17px;
padding-left: 0;
}
-/**
-* tweaks.css
-*/
+
+/* Form button styles
+---------------------------------------- */
/** Reference: Bug #27155 */
.rtl #wrap, .rtl .headerbar, .rtl #site-description, .rtl .navbar {
position: relative;
}
+
+/* Former imageset */
+.rtl .imageset.forum_link, .rtl .imageset.forum_read, .rtl .imageset.forum_read_locked, .rtl .imageset.forum_read_subforum, .rtl .imageset.forum_unread, .rtl .imageset.forum_unread_locked, .rtl .imageset.forum_unread_subforum, .rtl .imageset.topic_moved, .rtl .imageset.topic_read, .rtl .imageset.topic_read_mine, .rtl .imageset.topic_read_hot, .rtl .imageset.topic_read_hot_mine, .rtl .imageset.topic_read_locked, .rtl .imageset.topic_read_locked_mine, .rtl .imageset.topic_unread, .rtl .imageset.topic_unread_mine, .rtl .imageset.topic_unread_hot, .rtl .imageset.topic_unread_hot_mine, .rtl .imageset.topic_unread_locked, .rtl .imageset.topic_unread_locked_mine, .rtl .imageset.sticky_read, .rtl .imageset.sticky_read_mine, .rtl .imageset.sticky_read_locked, .rtl .imageset.sticky_read_locked_mine, .rtl .imageset.sticky_unread, .rtl .imageset.sticky_unread_mine, .rtl .imageset.sticky_unread_locked, .rtl .imageset.sticky_unread_locked_mine, .rtl .imageset.announce_read, .rtl .imageset.announce_read_mine, .rtl .imageset.announce_read_locked, .rtl .imageset.announce_read_locked_mine, .rtl .imageset.announce_unread, .rtl .imageset.announce_unread_mine, .rtl .imageset.announce_unread_locked, .rtl .imageset.announce_unread_locked_mine, .rtl .imageset.global_read, .rtl .imageset.global_read_mine, .rtl .imageset.global_read_locked, .rtl .imageset.global_read_locked_mine, .rtl .imageset.global_unread, .rtl .imageset.global_unread_mine, .rtl .imageset.global_unread_locked, .rtl .imageset.global_unread_locked_mine, .rtl .imageset.pm_read, .rtl .imageset.pm_unread {
+ padding-right: 27px;
+ padding-left: 0;
+}
+.rtl .imageset.subforum_read, .rtl .imageset.subforum_unread, .rtl .imageset.icon_post_target, .rtl .imageset.icon_post_target_unread, .rtl .imageset.icon_topic_latest, .rtl .imageset.icon_topic_newest {
+ padding-right: 11px;
+ padding-left: 0;
+}
+.rtl .imageset.icon_back_top {
+ padding-right: 11px;
+ padding-left: 0;
+}
+.rtl .imageset.icon_contact_aim, .rtl .imageset.phpbb_aol-icon, .rtl .imageset.icon_contact_email, .rtl .imageset.icon_contact_icq, .rtl .imageset.phpbb_icq-icon, .rtl .imageset.icon_contact_jabber, .rtl .imageset.icon_contact_msnm, .rtl .imageset.phpbb_wlm-icon, .rtl .imageset.icon_contact_www, .rtl .imageset.phpbb_website-icon, .rtl .imageset.icon_contact_yahoo, .rtl .imageset.phpbb_yahoo-icon, .rtl .imageset.icon_post_delete, .rtl .imageset.icon_post_info, .rtl .imageset.icon_post_report, .rtl .imageset.icon_user_warn {
+ padding-right: 20px;
+ padding-left: 0;
+}
+.rtl .imageset.icon_topic_attach {
+ padding-right: 7px;
+ padding-left: 0;
+}
+.rtl .imageset.icon_topic_reported, .rtl .imageset.icon_topic_unapproved {
+ padding-right: 16px;
+ padding-left: 0;
+}
+
+/**
+* plupload.css
+*/
+
+.rtl .attach-controls {
+ float: left;
+}
+
+/**
+* responsive.css
+*/
+@media only screen and (max-width: 700px), only screen and (max-device-width: 700px)
+{
+ /* .topiclist lists
+ ----------------------------------------*/
+ .rtl ul.topiclist li.header dt, .rtl ul.topiclist li.header dt .list-inner {
+ margin-left: 0 !important;
+ padding-left: 0;
+ }
+
+ .rtl ul.topiclist dt, .rtl ul.topiclist dt .list-inner,
+ .rtl ul.topiclist.missing-column dt, .rtl ul.topiclist.missing-column dt .list-inner,
+ .rtl ul.topiclist.two-long-columns dt, .rtl ul.topiclist.two-long-columns dt .list-inner,
+ .rtl ul.topiclist.two-columns dt, .rtl ul.topiclist.two-columns dt .list-inner {
+ margin-left: 0;
+ }
+
+ .rtl ul.topiclist dt .list-inner.with-mark {
+ padding-left: 34px;
+ }
+
+ /* Forums and topics lists
+ ----------------------------------------*/
+ .rtl ul.topiclist.forums dt {
+ margin-left: -250px;
+ }
+ .rtl ul.topiclist.forums dt .list-inner {
+ margin-left: 250px;
+ }
+
+ .rtl ul.topiclist dd.mark {
+ left: 5px;
+ right: auto;
+ text-align: right;
+ }
+
+ .rtl table.responsive.show-header thead, .rtl table.responsive.show-header th:first-child {
+ text-align: right !important;
+ }
+
+ .rtl table.responsive td {
+ text-align: right !important;
+ }
+
+ /* User profile
+ ----------------------------------------*/
+ .rtl .column1, .rtl .column2, .rtl .left-box.profile-details {
+ float: none;
+ }
+
+ /* Post
+ ----------------------------------------*/
+ .rtl .postprofile, .rtl .postbody, .rtl .search .postbody {
+ float: none;
+ }
+
+ .rtl .post .postprofile {
+ border-width: 0 0 1px 0;
+ }
+
+ .rtl .postprofile dt, .rtl .postprofile dd.profile-rank, .rtl .search .postprofile dd {
+ margin: 0;
+ }
+
+ .rtl .postprofile .avatar {
+ margin-left: 5px;
+ margin-right: 0;
+ }
+
+ .rtl .has-profile .post-buttons {
+ left: 20px;
+ }
+
+ /* Forms
+ ----------------------------------------*/
+ .rtl fieldset dt, .rtl fieldset.fields1 dt, .rtl fieldset.fields2 dt {
+ float: none;
+ }
+
+ .rtl fieldset dd, .rtl fieldset.fields1 dd, .rtl fieldset.fields2 dd {
+ margin-right: 20px;
+ }
+}
+
+@media only screen and (max-width: 550px), only screen and (max-device-width: 550px)
+{
+ /* .topiclist lists
+ ----------------------------------------*/
+ .rtl ul.topiclist.forums dt {
+ margin-left: 0;
+ }
+
+ .rtl ul.topiclist.forums dt .list-inner {
+ margin-left: 0;
+ }
+}
+
+@media only screen and (max-width: 500px), only screen and (max-device-width: 500px)
+{
+ .rtl dl.details dt, .rtl dl.details dd {
+ float: none;
+ text-align: right;
+ }
+
+ .rtl dl.details dd {
+ margin-left: 0;
+ margin-right: 20px;
+ }
+
+ .captcha-panel dd.captcha {
+ margin-right: 0;
+ }
+}
diff --git a/phpBB/styles/prosilver/theme/buttons.css b/phpBB/styles/prosilver/theme/buttons.css
index a9ded9cf98..a816c7f7f2 100644
--- a/phpBB/styles/prosilver/theme/buttons.css
+++ b/phpBB/styles/prosilver/theme/buttons.css
@@ -1,169 +1,250 @@
/* Button Styles
---------------------------------------- */
-/* Rollover buttons
- Based on: http://wellstyled.com/css-nopreload-rollovers.html
-----------------------------------------*/
-.buttons {
- float: left;
- width: auto;
- height: auto;
+.button {
+ cursor: pointer;
+ display: inline-block;
+ height: 18px;
+ font-size: 1.2em;
+ white-space: nowrap;
+ border: 1px solid transparent;
+ border-radius: 4px;
+ background: transparent none 0 0 repeat-x;
+ padding: 2px 8px;
+ font-family: "Open Sans", "Droid Sans", Verdana, Arial, Helvetica;
+ position: relative;
+ text-decoration: none !important;
+ outline-style: none !important;
+ vertical-align: bottom;
}
-/* Rollover state */
-.buttons div {
- float: left;
- margin: 0 5px 0 0;
- background-position: 0 100%;
+.dropdown-select {
+ padding-right: 24px;
}
-/* Rolloff state */
-.buttons div a {
- display: block;
- width: 100%;
- height: 100%;
- background-position: 0 0;
- position: relative;
- overflow: hidden;
+.icon-button:before {
+ background: transparent 0 0 no-repeat;
+ content: '';
+ display: inline-block;
+ float: right;
+ height: 12px;
+ margin: 3px 0 0 2px;
+ width: 12px;
}
-/* Hide <a> text and hide off-state image when rolling over (prevents flicker in IE) */
-/*.buttons div span { display: none; }*/
-/*.buttons div a:hover { background-image: none; }*/
-.buttons div span { position: absolute; width: 100%; height: 100%; cursor: pointer;}
-.buttons div a:hover span { background-position: 0 100%; }
+.dropdown-select.icon-button:before {
+ margin-right: 4px;
+}
-/* Big button images */
-.reply-icon span { background: transparent none 0 0 no-repeat; }
-.post-icon span { background: transparent none 0 0 no-repeat; }
-.locked-icon span { background: transparent none 0 0 no-repeat; }
-.pmreply-icon span { background: none 0 0 no-repeat; }
-.newpm-icon span { background: none 0 0 no-repeat; }
-.forwardpm-icon span { background: none 0 0 no-repeat; }
-
-/* Set big button dimensions */
-.buttons div.reply-icon { width: {IMG_BUTTON_TOPIC_REPLY_WIDTH}px; height: {IMG_BUTTON_TOPIC_REPLY_HEIGHT}px; }
-.buttons div.post-icon { width: {IMG_BUTTON_TOPIC_NEW_WIDTH}px; height: {IMG_BUTTON_TOPIC_NEW_HEIGHT}px; }
-.buttons div.locked-icon { width: {IMG_BUTTON_TOPIC_LOCKED_WIDTH}px; height: {IMG_BUTTON_TOPIC_LOCKED_HEIGHT}px; }
-.buttons div.pmreply-icon { width: {IMG_BUTTON_PM_REPLY_WIDTH}px; height: {IMG_BUTTON_PM_REPLY_HEIGHT}px; }
-.buttons div.newpm-icon { width: {IMG_BUTTON_PM_NEW_WIDTH}px; height: {IMG_BUTTON_PM_NEW_HEIGHT}px; }
-.buttons div.forwardpm-icon { width: {IMG_BUTTON_PM_FORWARD_WIDTH}px; height: {IMG_BUTTON_PM_FORWARD_HEIGHT}px; }
-
-/* Sub-header (navigation bar)
---------------------------------------------- */
-a.print, a.sendemail, a.fontsize {
- display: block;
- overflow: hidden;
- height: 18px;
- text-indent: -5000px;
- text-align: left;
- background-repeat: no-repeat;
+.dropdown-select:after {
+ background-position: -103px 10px;
+ border-left: 1px solid;
+ content: '';
+ position: absolute;
+ top: 0;
+ right: 0;
+ height: 22px;
+ width: 16px;
}
-a.print {
- background-image: none;
- width: 22px;
+.dropdown-visible .dropdown-select:after, .nojs .dropdown-container:hover .dropdown-select:after {
+ background-position: -103px -10px;
}
-a.sendemail {
- background-image: none;
- width: 22px;
+.buttons, .buttons .button {
+ float: left;
}
-a.fontsize {
- background-image: none;
- background-position: 0 -1px;
- width: 29px;
+.buttons .button, .dropdown-select {
+ margin-right: 5px;
+}
+
+#jumpbox .dropdown-select {
+ margin: 0;
+}
+
+/* Big button images */
+.reply-icon:before, .pmreply-icon:before { background-position: -20px 0; }
+.reply-icon:hover:before, .pmreply-icon:hover:before { background-position: -20px -20px; }
+
+.post-icon:before, .newpm-icon:before, .reply-all:before { background-position: 0 0; }
+.post-icon:hover:before,
+.newpm-icon:hover:before,
+.reply-all:hover:before { background-position: 0 -20px; }
+
+.locked-icon:before { background-position: -60px 0; }
+.locked-icon:hover:before { background-position: -60px -20px; }
+
+.forwardpm-icon:before { background-position: -40px 0; }
+.forwardpm-icon:hover:before { background-position: -40px -20px; }
+
+.modtools-icon {
+ font-size: 0;
}
-a.fontsize:hover {
- background-position: 0 -20px;
- text-decoration: none;
+.tools-icon:before, .modtools-icon:before, .search-icon:before, .search-adv-icon:before {
+ background-position: -80px 0;
+ height: 16px;
+ margin-top: 2px;
+ width: 16px;
}
+.dropdown-visible .tools-icon:before,
+.nojs .dropdown-container:hover .tools-icon:before { background-position: -80px -20px; }
+
+.search-icon:before { background-position: -245px 0; }
+.search-icon:hover:before { background-position: -245px -20px; }
+
+.search-adv-icon:before { background-position: -265px 0; }
+.search-adv-icon:hover:before { background-position: -265px -20px; }
+
+.modtools-icon:before { background-position: -225px 0; }
+.dropdown-visible .modtools-icon:before,
+.nojs .dropdown-container:hover .modtools-icon:before { background-position: -225px -20px; }
+
/* Icon images
---------------------------------------- */
-.sitehome, .icon-faq, .icon-members, .icon-home, .icon-ucp, .icon-register, .icon-logout,
-.icon-bookmark, .icon-bump, .icon-subscribe, .icon-unsubscribe, .icon-pages, .icon-search {
+.small-icon {
background-position: 0 50%;
background-repeat: no-repeat;
background-image: none;
- padding: 1px 0 0 17px;
}
-/* Poster profile icons
+.small-icon > a {
+ display: inline-block;
+ padding: 0 0 0 18px;
+}
+
+ul.linklist.bulletin > li.small-icon:before {
+ display: none;
+}
+
+.dropdown .small-icon > a {
+ display: block;
+}
+
+/* Poster contact icons
----------------------------------------*/
-ul.profile-icons {
- padding-top: 10px;
+.contact-icons.dropdown-contents {
+ min-width: 0;
+ padding: 0;
+ font-size: 0;
+}
+
+.contact-icon {
+ background-repeat: no-repeat;
+ display: block;
+ height: 16px;
+ width: 16px;
+}
+.contact-icons a {
+ border-bottom: 1px dotted;
+ border-right: 1px dotted;
+ display: block;
+ float: left;
+ padding: 8px;
+}
+
+.contact-icons .last-cell {
+ border-right: none;
+}
+
+.contact-icons div:last-child a {
+ border-bottom: none;
+}
+
+.contact-icons div {
+ clear: left;
+}
+
+/* Profile icons */
+.pm-icon { background-position: 0 0; }
+.email-icon { background-position: -21px 0; }
+.jabber-icon { background-position: -80px 0; }
+.phpbb_icq-icon { background-position: -61px 0 ; }
+.phpbb_wlm-icon { background-position: -182px 0; }
+.phpbb_aol-icon { background-position: -244px 0; }
+.phpbb_website-icon { background-position: -40px 0; }
+.phpbb_youtube-icon { background-position: -98px 0; }
+.phpbb_facebook-icon { background-position: -119px 0; }
+.phpbb_googleplus-icon { background-position: -140px 0; }
+.phpbb_skype-icon { background-position: -161px 0; }
+.phpbb_twitter-icon { background-position: -203px 0; }
+.phpbb_yahoo-icon { background-position: -224px 0; }
+
+/* Post control buttons
+--------------------------------------------- */
+.post-buttons {
+ float: right;
list-style: none;
+ margin-top: 2px;
}
-/* Rollover state */
-ul.profile-icons li {
+.has-profile .post-buttons {
+ float: none;
+ position: absolute;
+ margin: 0;
+ right: 0;
+ top: 5px;
+}
+
+.post-buttons > li {
float: left;
- margin: 0 6px 3px 0;
- background-position: 0 100%;
+ margin-right: 3px;
}
-/* Rolloff state */
-ul.profile-icons li a {
+.post-buttons .icon-button {
+ padding: 0 5px;
+}
+
+.hastouch .post-buttons .icon-button {
+ padding: 2px 8px;
+}
+
+.post-buttons .icon-button span {
display: block;
- width: 100%;
- height: 100%;
- background-position: 0 0;
+ height: 0;
+ overflow: hidden;
+ position: absolute;
+ width: 1px;
}
-/* Hide <a> text and hide off-state image when rolling over (prevents flicker in IE) */
-ul.profile-icons li span { display:none; }
-ul.profile-icons li a:hover { background: none; }
+.post-buttons .icon-button:before {
+ margin-left: 0;
+}
-/* Positioning of moderator icons */
-.postbody ul.profile-icons {
- float: right;
- width: auto;
- padding: 0;
+.quote-icon:before { background-position: -122px 0; }
+.quote-icon:hover:before { background-position: -122px -21px; }
+.edit-icon:before { background-position: -137px 0; }
+.edit-icon:hover:before { background-position: -137px -21px; }
+.warn-icon:before { background-position: -208px 0; }
+.warn-icon:hover:before { background-position: -208px -21px; }
+.delete-icon:before { background-position: -152px 0; }
+.delete-icon:hover:before { background-position: -152px -21px; }
+.report-icon:before { background-position: -165px 0; }
+.report-icon:hover:before { background-position: -165px -21px; }
+.info-icon:before { background-position: -175px 0; }
+.info-icon:hover:before { background-position: -175px -21px; }
+.button.responsive-menu-link:before { background-position: -191px 0; }
+.button.responsive-menu-link:hover:before { background-position: -191px -21px; }
+
+/* Responsive buttons in post body */
+.post-buttons .dropdown {
+ top: 18px;
}
-.postbody ul.profile-icons li {
- margin: 0 3px;
-}
-
-/* Profile & navigation icons */
-.email-icon, .email-icon a { background: none top left no-repeat; }
-.aim-icon, .aim-icon a { background: none top left no-repeat; }
-.yahoo-icon, .yahoo-icon a { background: none top left no-repeat; }
-.web-icon, .web-icon a { background: none top left no-repeat; }
-.msnm-icon, .msnm-icon a { background: none top left no-repeat; }
-.icq-icon, .icq-icon a { background: none top left no-repeat; }
-.jabber-icon, .jabber-icon a { background: none top left no-repeat; }
-.pm-icon, .pm-icon a { background: none top left no-repeat; }
-.quote-icon, .quote-icon a { background: none top left no-repeat; }
-
-/* Moderator icons */
-.report-icon, .report-icon a { background: none top left no-repeat; }
-.warn-icon, .warn-icon a { background: none top left no-repeat; }
-.edit-icon, .edit-icon a { background: none top left no-repeat; }
-.delete-icon, .delete-icon a { background: none top left no-repeat; }
-.info-icon, .info-icon a { background: none top left no-repeat; }
-
-/* Set profile icon dimensions */
-ul.profile-icons li.email-icon { width: {IMG_ICON_CONTACT_EMAIL_WIDTH}px; height: {IMG_ICON_CONTACT_EMAIL_HEIGHT}px; }
-ul.profile-icons li.aim-icon { width: {IMG_ICON_CONTACT_AIM_WIDTH}px; height: {IMG_ICON_CONTACT_AIM_HEIGHT}px; }
-ul.profile-icons li.yahoo-icon { width: {IMG_ICON_CONTACT_YAHOO_WIDTH}px; height: {IMG_ICON_CONTACT_YAHOO_HEIGHT}px; }
-ul.profile-icons li.web-icon { width: {IMG_ICON_CONTACT_WWW_WIDTH}px; height: {IMG_ICON_CONTACT_WWW_HEIGHT}px; }
-ul.profile-icons li.msnm-icon { width: {IMG_ICON_CONTACT_MSNM_WIDTH}px; height: {IMG_ICON_CONTACT_MSNM_HEIGHT}px; }
-ul.profile-icons li.icq-icon { width: {IMG_ICON_CONTACT_ICQ_WIDTH}px; height: {IMG_ICON_CONTACT_ICQ_HEIGHT}px; }
-ul.profile-icons li.jabber-icon { width: {IMG_ICON_CONTACT_JABBER_WIDTH}px; height: {IMG_ICON_CONTACT_JABBER_HEIGHT}px; }
-ul.profile-icons li.pm-icon { width: {IMG_ICON_CONTACT_PM_WIDTH}px; height: {IMG_ICON_CONTACT_PM_HEIGHT}px; }
-ul.profile-icons li.quote-icon { width: {IMG_ICON_POST_QUOTE_WIDTH}px; height: {IMG_ICON_POST_QUOTE_HEIGHT}px; }
-ul.profile-icons li.report-icon { width: {IMG_ICON_POST_REPORT_WIDTH}px; height: {IMG_ICON_POST_REPORT_HEIGHT}px; }
-ul.profile-icons li.edit-icon { width: {IMG_ICON_POST_EDIT_WIDTH}px; height: {IMG_ICON_POST_EDIT_HEIGHT}px; }
-ul.profile-icons li.delete-icon { width: {IMG_ICON_POST_DELETE_WIDTH}px; height: {IMG_ICON_POST_DELETE_HEIGHT}px; }
-ul.profile-icons li.info-icon { width: {IMG_ICON_POST_INFO_WIDTH}px; height: {IMG_ICON_POST_INFO_HEIGHT}px; }
-ul.profile-icons li.warn-icon { width: {IMG_ICON_USER_WARN_WIDTH}px; height: {IMG_ICON_USER_WARN_HEIGHT}px; }
-
-/* Fix profile icon default margins */
-ul.profile-icons li.edit-icon { margin: 0 0 0 3px; }
-ul.profile-icons li.quote-icon { margin: 0 0 0 10px; }
-ul.profile-icons li.info-icon, ul.profile-icons li.report-icon { margin: 0 3px 0 0; }
+.post-buttons .dropdown a {
+ display: block;
+ font-size: 1.2em;
+ text-align: right;
+}
+.hasjs .postbody .post-buttons {
+ max-width: 40%;
+}
+
+/* Browser-specific tweaks */
+button::-moz-focus-inner {
+ padding: 0;
+ border: 0
+}
diff --git a/phpBB/styles/prosilver/theme/colours.css b/phpBB/styles/prosilver/theme/colours.css
index ef345e5113..9095e61369 100644
--- a/phpBB/styles/prosilver/theme/colours.css
+++ b/phpBB/styles/prosilver/theme/colours.css
@@ -5,7 +5,7 @@ Colours and backgrounds for common.css
html, body {
color: #536482;
- background-color: #FFFFFF;
+ background-color: #F5F7FA;
}
h1 {
@@ -26,30 +26,30 @@ hr {
border-top-color: #CCCCCC;
}
-hr.dashed {
- border-top-color: #CCCCCC;
-}
-
/* Search box
--------------------------------------------- */
-#search-box {
- color: #FFFFFF;
-}
-
-#search-box #keywords {
- background-color: #FFF;
+.search-box .inputbox,
+.search-box .inputbox:hover,
+.search-box .inputbox:focus,
+.search-box .button:hover {
+ border-color: #C7C3BF;
}
-#search-box input {
- border-color: #0075B0;
+.search-header {
+ box-shadow: 0 0 10px #0075B0;
}
/* Round cornered boxes and backgrounds
---------------------------------------- */
+#wrap {
+ background-color: #FFF;
+ border-color: #E6E9ED;
+}
+
.headerbar {
background-color: #12A3EB;
- background-image: url("{T_THEME_PATH}/images/bg_header.gif");
+ background-image: url("./images/bg_header.gif");
color: #FFFFFF;
}
@@ -59,12 +59,12 @@ hr.dashed {
.forabg {
background-color: #0076b1;
- background-image: url("{T_THEME_PATH}/images/bg_list.gif");
+ background-image: url("./images/bg_list.gif");
}
.forumbg {
background-color: #12A3EB;
- background-image: url("{T_THEME_PATH}/images/bg_header.gif");
+ background-image: url("./images/bg_header.gif");
}
.panel {
@@ -80,39 +80,39 @@ hr.dashed {
color: #000000;
}
-.bg1 { background-color: #ECF3F7; }
-.bg2 { background-color: #e1ebf2; }
-.bg3 { background-color: #cadceb; }
+.bg1 {
+ background-color: #ECF3F7;
+}
-.ucprowbg {
- background-color: #DCDEE2;
+table.zebra-list tr:nth-child(odd) td, ul.zebra-list li:nth-child(odd) {
+ background-color: #ECF3F7;
}
-.fieldsbg {
- background-color: #E7E8EA;
+.bg2 {
+ background-color: #e1ebf2;
}
-span.corners-top {
- background-image: url("{T_THEME_PATH}/images/corners_left.png");
+table.zebra-list tr:nth-child(even) td, ul.zebra-list li:nth-child(even) {
+ background-color: #e1ebf2;
}
-span.corners-top span {
- background-image: url("{T_THEME_PATH}/images/corners_right.png");
+.bg3 {
+ background-color: #cadceb;
}
-span.corners-bottom {
- background-image: url("{T_THEME_PATH}/images/corners_left.png");
+.ucprowbg {
+ background-color: #DCDEE2;
}
-span.corners-bottom span {
- background-image: url("{T_THEME_PATH}/images/corners_right.png");
+.fieldsbg {
+ background-color: #E7E8EA;
}
/* Horizontal lists
----------------------------------------*/
ul.navlinks {
- border-bottom-color: #FFFFFF;
+ border-top-color: #FFFFFF;
}
/* Table styles
@@ -165,41 +165,36 @@ dl.details dd {
/* Pagination
---------------------------------------- */
-.pagination span strong {
- color: #FFFFFF;
- background-color: #4692BF;
- border-color: #4692BF;
-}
-
-.pagination span a, .pagination span a:link, .pagination span a:visited {
- color: #5C758C;
+.pagination li a {
background-color: #ECEDEE;
border-color: #B4BAC0;
+ color: #5C758C;
}
-.pagination span a:hover {
- border-color: #368AD2;
- background-color: #368AD2;
- color: #FFF;
+.pagination li.ellipsis span {
+ background-color: transparent;
+ color: #000000;
}
-.pagination span a:active {
- color: #5C758C;
- background-color: #ECEDEE;
- border-color: #B4BAC0;
+.pagination li.active span {
+ background-color: #4692BF;
+ border-color: #4692BF;
+ color: #FFFFFF;
}
-/* Pagination in viewforum for multipage topics */
-.row .pagination {
- background-image: url("{T_THEME_PATH}/images/icon_pages.gif");
+.pagination li a:hover, .pagination .dropdown-visible a.dropdown-trigger, .nojs .pagination .dropdown-container:hover a.dropdown-trigger {
+ background-color: #368AD2;
+ border-color: #368AD2;
+ color: #FFFFFF;
}
-.row .pagination span a, li.pagination span a {
- background-color: #FFFFFF;
+.pagination li.next a, .pagination li.previous a, .pagination li.page-jump a {
+ background-image: url("./images/icons_pagination.png");
}
-.row .pagination span a:hover, li.pagination span a:hover {
- background-color: #368AD2;
+/* Pagination in viewforum for multipage topics */
+.row .pagination {
+ background-image: url("./images/icon_pages.gif");
}
/* Miscellaneous styles
@@ -229,80 +224,54 @@ div.rules {
color: #BC2A4D;
}
-p.rules {
+p.post-notice {
background-color: #ECD5D8;
background-image: none;
}
+p.post-notice.deleted:before {
+ background-image: url("./images/icon_topic_deleted.png");
+}
+
+p.post-notice.unapproved:before {
+ background-image: url("./images/icon_topic_unapproved.gif");
+}
+
+p.post-notice.reported:before, p.post-notice.error:before {
+ background-image: url("./images/icon_topic_reported.gif");
+}
+
/*
--------------------------------------------------------------
Colours and backgrounds for links.css
-------------------------------------------------------------- */
-a:link { color: #105289; }
-a:visited { color: #105289; }
+a { color: #105289; }
a:hover { color: #D31141; }
-a:active { color: #368AD2; }
/* Links on gradient backgrounds */
-#search-box a:link, .navbg a:link, .forumbg .header a:link, .forabg .header a:link, th a:link {
+.forumbg .header a, .forabg .header a, th a {
color: #FFFFFF;
}
-#search-box a:visited, .navbg a:visited, .forumbg .header a:visited, .forabg .header a:visited, th a:visited {
- color: #FFFFFF;
-}
-
-#search-box a:hover, .navbg a:hover, .forumbg .header a:hover, .forabg .header a:hover, th a:hover {
+.forumbg .header a:hover, .forabg .header a:hover, th a:hover {
color: #A8D8FF;
}
-#search-box a:active, .navbg a:active, .forumbg .header a:active, .forabg .header a:active, th a:active {
- color: #C8E6FF;
-}
-
-/* Links for forum/topic lists */
-a.forumtitle {
- color: #105289;
-}
-
-/* a.forumtitle:visited { color: #105289; } */
-
-a.forumtitle:hover {
- color: #BC2A4D;
-}
-
-a.forumtitle:active {
- color: #105289;
-}
-
-a.topictitle {
- color: #105289;
-}
-
-/* a.topictitle:visited { color: #368AD2; } */
-
-a.topictitle:hover {
- color: #BC2A4D;
-}
-
-a.topictitle:active {
- color: #105289;
+/* Notification mark read link */
+.dropdown-extended a.mark_read {
+ background-color: #FFFFFF;
}
/* Post body links */
.postlink {
- color: #368AD2;
border-bottom-color: #368AD2;
+ color: #368AD2;
}
.postlink:visited {
- color: #5D8FBD;
border-bottom-color: #5D8FBD;
-}
-
-.postlink:active {
- color: #368AD2;
+ color: #5D8FBD;
}
.postlink:hover {
@@ -310,60 +279,37 @@ a.topictitle:active {
color: #0D4473;
}
-.signature a, .signature a:visited, .signature a:hover, .signature a:active {
+.signature a, .signature a:hover {
background-color: transparent;
}
-/* Profile links */
-.postprofile a:link, .postprofile a:visited, .postprofile dt.author a {
- color: #105289;
-}
-
-.postprofile a:hover, .postprofile dt.author a:hover {
- color: #D31141;
-}
-
-.postprofile a:active {
- color: #105289;
-}
-
-/* Profile searchresults */
-.search .postprofile a {
- color: #105289;
-}
-
-.search .postprofile a:hover {
- color: #D31141;
-}
-
/* Back to top of page */
a.top {
- background-image: url("{IMG_ICON_BACK_TOP_SRC}");
+ background-image: url("./images/icon_back_top.gif");
}
a.top2 {
- background-image: url("{IMG_ICON_BACK_TOP_SRC}");
+ background-image: url("./images/icon_back_top.gif");
}
/* Arrow links */
-a.up { background-image: url("{T_THEME_PATH}/images/arrow_up.gif"); }
-a.down { background-image: url("{T_THEME_PATH}/images/arrow_down.gif"); }
-a.left { background-image: url("{T_THEME_PATH}/images/arrow_left.gif"); }
-a.right { background-image: url("{T_THEME_PATH}/images/arrow_right.gif"); }
+a.arrow-up { background-image: url("./images/arrow_up.gif"); }
+a.arrow-down { background-image: url("./images/arrow_down.gif"); }
+a.arrow-left { background-image: url("./images/arrow_left.gif"); }
+a.arrow-right { background-image: url("./images/arrow_right.gif"); }
-a.up:hover {
+a.arrow-up:hover {
background-color: transparent;
}
-a.left:hover {
+a.arrow-left:hover {
color: #368AD2;
}
-a.right:hover {
+a.arrow-right:hover {
color: #368AD2;
}
-
/*
--------------------------------------------------------------
Colours and backgrounds for content.css
@@ -371,7 +317,7 @@ Colours and backgrounds for content.css
ul.forums {
background-color: #eef5f9;
- background-image: url("{T_THEME_PATH}/images/gradient.gif");
+ background-image: url("./images/gradient.gif");
}
ul.topiclist li {
@@ -388,11 +334,11 @@ ul.topiclist dd {
}
ul.topiclist li.row dt a.subforum.read {
- background-image: url("{IMG_SUBFORUM_READ_SRC}");
+ background-image: url("./images/subforum_read.gif");
}
ul.topiclist li.row dt a.subforum.unread {
- background-image: url("{IMG_SUBFORUM_UNREAD_SRC}");
+ background-image: url("./images/subforum_unread.gif");
}
li.row {
@@ -421,11 +367,6 @@ li.header dt, li.header dd {
color: #FFFFFF;
}
-/* Forum list column styles */
-ul.topiclist dd.searchextra {
- color: #333333;
-}
-
/* Post body styles
----------------------------------------*/
.postbody {
@@ -452,6 +393,10 @@ dl.faq dt {
color: #BC2A4D;
}
+.announce, .unreadpost {
+ /* Highlight the announcements & unread posts box */
+}
+
/* Post signature */
.signature {
border-top-color: #CCCCCC;
@@ -467,12 +412,12 @@ dl.faq dt {
/* Quote block */
blockquote {
background-color: #EBEADD;
- background-image: url("{T_THEME_PATH}/images/quote.gif");
+ background-image: url("./images/quote.gif");
border-color:#DBDBCE;
}
.rtl blockquote {
- background-image: url("{T_THEME_PATH}/images/quote_rtl.gif");
+ background-image: url("./images/quote_rtl.gif");
}
blockquote blockquote {
@@ -486,16 +431,16 @@ blockquote blockquote blockquote {
}
/* Code block */
-dl.codebox {
+.codebox {
background-color: #FFFFFF;
border-color: #C9D2D8;
}
-dl.codebox dt {
+.codebox p {
border-bottom-color: #CCCCCC;
}
-dl.codebox code {
+.codebox code {
color: #2E8B57;
}
@@ -630,21 +575,11 @@ fieldset.polls dd div {
----------------------------------------*/
.postprofile {
color: #666666;
- border-left-color: #FFFFFF;
-}
-
-.rtl .postprofile {
- border-right-color: #FFFFFF;
- border-left-color: transparent;
+ border-color: #FFFFFF;
}
.pm .postprofile {
- border-left-color: #DDDDDD;
-}
-
-.rtl .pm .postprofile {
- border-right-color: #DDDDDD;
- border-left-color: transparent;
+ border-color: #DDDDDD;
}
.postprofile strong {
@@ -652,67 +587,143 @@ fieldset.polls dd div {
}
.online {
- background-image: url("{IMG_ICON_USER_ONLINE_SRC}");
+ background-image: url("./en/icon_user_online.gif");
+}
+
+dd.profile-warnings {
+ color: #BC2A4D;
}
/*
--------------------------------------------------------------
Colours and backgrounds for buttons.css
-------------------------------------------------------------- */
+.button {
+ border-color: #C7C3BF;
+ background-color: #FFFFFF;
+ background-image: -moz-linear-gradient(top, #FFFFFF, #E9E9E9);
+ background-image: -webkit-linear-gradient(top, #FFFFFF, #E9E9E9);
+ background-image: -o-linear-gradient(top, #FFFFFF, #E9E9E9);
+ background-image: linear-gradient(to bottom, #FFFFFF, #E9E9E9);
+ -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorStr='#FFFFFF', EndColorStr='#E9E9E9')";
+ box-shadow: 0 0 0 1px #FFFFFF inset;
+ -webkit-box-shadow: 0 0 0 1px #FFFFFF inset;
+ color: #D31141;
+}
-/* Big button images */
-.reply-icon span { background-image: url("{IMG_BUTTON_TOPIC_REPLY_SRC}"); }
-.post-icon span { background-image: url("{IMG_BUTTON_TOPIC_NEW_SRC}"); }
-.locked-icon span { background-image: url("{IMG_BUTTON_TOPIC_LOCKED_SRC}"); }
-.pmreply-icon span { background-image: url("{IMG_BUTTON_PM_REPLY_SRC}"); }
-.newpm-icon span { background-image: url("{IMG_BUTTON_PM_NEW_SRC}"); }
-.forwardpm-icon span { background-image: url("{IMG_BUTTON_PM_FORWARD_SRC}"); }
-
-a.print {
- background-image: url("{T_THEME_PATH}/images/icon_print.gif");
+.dropdown-select {
+ color: #536482;
}
-a.sendemail {
- background-image: url("{T_THEME_PATH}/images/icon_sendemail.gif");
+.button:hover, .dropdown-visible .dropdown-select, .nojs .dropdown-container:hover .dropdown-select {
+ border-color: #0a8ed0;
+ background-image: -moz-linear-gradient(top, #E9E9E9, #FFFFFF);
+ background-image: -webkit-linear-gradient(top, #E9E9E9, #FFFFFF);
+ background-image: -o-linear-gradient(top, #E9E9E9, #FFFFFF);
+ background-image: linear-gradient(to bottom, #E9E9E9, #FFFFFF);
+ -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorStr='#E9E9E9', EndColorStr='#FFFFFF')";
+ text-shadow: 1px 1px 0 #FFFFFF, -1px -1px 0 #FFFFFF, -1px -1px 0 rgba(188, 42, 77, 0.2);
}
-a.fontsize {
- background-image: url("{T_THEME_PATH}/images/icon_fontsize.gif");
+.dropdown-select:after { border-color: #DADADA; }
+.dropdown-select:hover { border-color: #C7C3BF; }
+
+.dropdown-visible .dropdown-select, .dropdown-visible .dropdown-select:hover, .nojs .dropdown-container:hover .dropdown-select {
+ border-color: #A6B2BA;
+ color: #105289;
}
+.contact-icons a { border-color: #DCDCDC; }
+.contact-icons a:hover { background-color: #F2F6F9; }
+
/* Icon images
---------------------------------------- */
-.sitehome { background-image: url("{T_THEME_PATH}/images/icon_home.gif"); }
-.icon-faq { background-image: url("{T_THEME_PATH}/images/icon_faq.gif"); }
-.icon-members { background-image: url("{T_THEME_PATH}/images/icon_members.gif"); }
-.icon-home { background-image: url("{T_THEME_PATH}/images/icon_home.gif"); }
-.icon-ucp { background-image: url("{T_THEME_PATH}/images/icon_ucp.gif"); }
-.icon-register { background-image: url("{T_THEME_PATH}/images/icon_register.gif"); }
-.icon-logout { background-image: url("{T_THEME_PATH}/images/icon_logout.gif"); }
-.icon-bookmark { background-image: url("{T_THEME_PATH}/images/icon_bookmark.gif"); }
-.icon-bump { background-image: url("{T_THEME_PATH}/images/icon_bump.gif"); }
-.icon-subscribe { background-image: url("{T_THEME_PATH}/images/icon_subscribe.gif"); }
-.icon-unsubscribe { background-image: url("{T_THEME_PATH}/images/icon_unsubscribe.gif"); }
-.icon-pages { background-image: url("{T_THEME_PATH}/images/icon_pages.gif"); }
-.icon-search { background-image: url("{T_THEME_PATH}/images/icon_search.gif"); }
+.icon-acp { background-image: url("./images/icon_acp.gif"); }
+.icon-bookmark { background-image: url("./images/icon_bookmark.gif"); }
+.icon-bump { background-image: url("./images/icon_bump.gif"); }
+.icon-contact { background-image: url("./images/icon_pm.gif"); }
+.icon-delete-cookies { background-image: url("./images/icon_delete_cookies.gif"); }
+.icon-download { background-image: url("./images/icon_download.gif"); }
+.icon-faq { background-image: url("./images/icon_faq.gif"); }
+.icon-home { background-image: url("./images/icon_home.gif"); }
+.icon-logout { background-image: url("./images/icon_logout.gif"); }
+.icon-mark { background-image: url("./images/icon_mark.gif"); }
+.icon-mcp { background-image: url("./images/icon_mcp.gif"); }
+.icon-members { background-image: url("./images/icon_members.gif"); }
+.icon-notification { background-image: url("./images/icon_notification.gif"); }
+.icon-pages { background-image: url("./images/icon_pages.gif"); }
+.icon-pm { background-image: url("./images/icon_pm.gif"); }
+.icon-print { background-image: url("./images/icon_print.gif"); }
+.icon-profile { background-image: url("./images/icon_profile.gif"); }
+.icon-register { background-image: url("./images/icon_register.gif"); }
+.icon-search, .responsive-search a { background-image: url("./images/icon_search.gif"); }
+.icon-search-active { background-image: url("./images/subforum_read.gif"); }
+.icon-search-new { background-image: url("./images/subforum_unread.gif"); }
+.icon-search-self { background-image: url("./images/icon_topic_latest.gif"); }
+.icon-search-unanswered { background-image: url("./images/icon_post_target.gif"); }
+.icon-search-unread { background-image: url("./images/subforum_unread.gif"); }
+.icon-sendemail { background-image: url("./images/icon_sendemail.gif"); }
+.icon-subscribe { background-image: url("./images/icon_subscribe.gif"); }
+.icon-team { background-image: url("./images/icon_team.gif"); }
+.icon-ucp { background-image: url("./images/icon_ucp.gif"); }
+.icon-unsubscribe { background-image: url("./images/icon_unsubscribe.gif"); }
/* Profile & navigation icons */
-.email-icon, .email-icon a { background-image: url("{IMG_ICON_CONTACT_EMAIL_SRC}"); }
-.aim-icon, .aim-icon a { background-image: url("{IMG_ICON_CONTACT_AIM_SRC}"); }
-.yahoo-icon, .yahoo-icon a { background-image: url("{IMG_ICON_CONTACT_YAHOO_SRC}"); }
-.web-icon, .web-icon a { background-image: url("{IMG_ICON_CONTACT_WWW_SRC}"); }
-.msnm-icon, .msnm-icon a { background-image: url("{IMG_ICON_CONTACT_MSNM_SRC}"); }
-.icq-icon, .icq-icon a { background-image: url("{IMG_ICON_CONTACT_ICQ_SRC}"); }
-.jabber-icon, .jabber-icon a { background-image: url("{IMG_ICON_CONTACT_JABBER_SRC}"); }
-.pm-icon, .pm-icon a { background-image: url("{IMG_ICON_CONTACT_PM_SRC}"); }
-.quote-icon, .quote-icon a { background-image: url("{IMG_ICON_POST_QUOTE_SRC}"); }
-
-/* Moderator icons */
-.report-icon, .report-icon a { background-image: url("{IMG_ICON_POST_REPORT_SRC}"); }
-.edit-icon, .edit-icon a { background-image: url("{IMG_ICON_POST_EDIT_SRC}"); }
-.delete-icon, .delete-icon a { background-image: url("{IMG_ICON_POST_DELETE_SRC}"); }
-.info-icon, .info-icon a { background-image: url("{IMG_ICON_POST_INFO_SRC}"); }
-.warn-icon, .warn-icon a { background-image: url("{IMG_ICON_USER_WARN_SRC}"); } /* Need updated warn icon */
+.contact-icon { background-image: url("./images/icons_contact.png"); }
+.icon-button:before, .dropdown-select:after { background-image: url("./images/icons_button.png"); }
+
+/* Forum icons & Topic icons */
+.global_read { background-image: url("./images/announce_read.gif"); }
+.global_read_mine { background-image: url("./images/announce_read_mine.gif"); }
+.global_read_locked { background-image: url("./images/announce_read_locked.gif"); }
+.global_read_locked_mine { background-image: url("./images/announce_read_locked_mine.gif"); }
+.global_unread { background-image: url("./images/announce_unread.gif"); }
+.global_unread_mine { background-image: url("./images/announce_unread_mine.gif"); }
+.global_unread_locked { background-image: url("./images/announce_unread_locked.gif"); }
+.global_unread_locked_mine { background-image: url("./images/announce_unread_locked_mine.gif"); }
+
+.announce_read { background-image: url("./images/announce_read.gif"); }
+.announce_read_mine { background-image: url("./images/announce_read_mine.gif"); }
+.announce_read_locked { background-image: url("./images/announce_read_locked.gif"); }
+.announce_read_locked_mine { background-image: url("./images/announce_read_locked_mine.gif"); }
+.announce_unread { background-image: url("./images/announce_unread.gif"); }
+.announce_unread_mine { background-image: url("./images/announce_unread_mine.gif"); }
+.announce_unread_locked { background-image: url("./images/announce_unread_locked.gif"); }
+.announce_unread_locked_mine { background-image: url("./images/announce_unread_locked_mine.gif"); }
+
+.forum_link { background-image: url("./images/forum_link.gif"); }
+.forum_read { background-image: url("./images/forum_read.gif"); }
+.forum_read_locked { background-image: url("./images/forum_read_locked.gif"); }
+.forum_read_subforum { background-image: url("./images/forum_read_subforum.gif"); }
+.forum_unread { background-image: url("./images/forum_unread.gif"); }
+.forum_unread_locked { background-image: url("./images/forum_unread_locked.gif"); }
+.forum_unread_subforum { background-image: url("./images/forum_unread_subforum.gif"); }
+
+.sticky_read { background-image: url("./images/sticky_read.gif"); }
+.sticky_read_mine { background-image: url("./images/sticky_read_mine.gif"); }
+.sticky_read_locked { background-image: url("./images/sticky_read_locked.gif"); }
+.sticky_read_locked_mine { background-image: url("./images/sticky_read_locked_mine.gif"); }
+.sticky_unread { background-image: url("./images/sticky_unread.gif"); }
+.sticky_unread_mine { background-image: url("./images/sticky_unread_mine.gif"); }
+.sticky_unread_locked { background-image: url("./images/sticky_unread_locked.gif"); }
+.sticky_unread_locked_mine { background-image: url("./images/sticky_unread_locked_mine.gif"); }
+
+.topic_moved { background-image: url("./images/topic_moved.gif"); }
+.topic_read { background-image: url("./images/topic_read.gif"); }
+.topic_read_mine { background-image: url("./images/topic_read_mine.gif"); }
+.topic_read_hot { background-image: url("./images/topic_read_hot.gif"); }
+.topic_read_hot_mine { background-image: url("./images/topic_read_hot_mine.gif"); }
+.topic_read_locked { background-image: url("./images/topic_read_locked.gif"); }
+.topic_read_locked_mine { background-image: url("./images/topic_read_locked_mine.gif"); }
+.topic_unread { background-image: url("./images/topic_unread.gif"); }
+.topic_unread_mine { background-image: url("./images/topic_unread_mine.gif"); }
+.topic_unread_hot { background-image: url("./images/topic_unread_hot.gif"); }
+.topic_unread_hot_mine { background-image: url("./images/topic_unread_hot_mine.gif"); }
+.topic_unread_locked { background-image: url("./images/topic_unread_locked.gif"); }
+.topic_unread_locked_mine { background-image: url("./images/topic_unread_locked_mine.gif"); }
+
+.pm_read { background-image: url("./images/topic_read.gif"); }
+.pm_unread { background-image: url("./images/topic_unread.gif"); }
/*
--------------------------------------------------------------
@@ -722,11 +733,11 @@ Colours and backgrounds for cp.css
/* Main CP box
----------------------------------------*/
-#cp-main h3, #cp-main hr, #cp-menu hr {
+.panel-container h3, .panel-container hr, #cp-menu hr {
border-color: #A4B3BF;
}
-#cp-main .panel li.row {
+.panel-container .panel li.row {
border-bottom-color: #B5C1CB;
border-top-color: #F9F9F9;
}
@@ -735,11 +746,11 @@ ul.cplist {
border-top-color: #B5C1CB;
}
-#cp-main .panel li.header dd, #cp-main .panel li.header dt {
+.panel-container .panel li.header dd, .panel-container .panel li.header dt {
color: #000000;
}
-#cp-main table.table1 thead th {
+.panel-container table.table1 thead th {
color: #333333;
border-bottom-color: #333333;
}
@@ -751,43 +762,55 @@ ul.cplist {
/* CP tabbed menu
----------------------------------------*/
-#tabs a {
- background-image: url("{T_THEME_PATH}/images/bg_tabs1.gif");
-}
-
-#tabs a span {
- background-image: url("{T_THEME_PATH}/images/bg_tabs2.gif");
+#tabs .tab > a {
+ background: #BACCD9;
color: #536482;
}
-#tabs a:hover span {
- color: #BC2A4D;
-}
-
-#tabs .activetab a {
- border-bottom-color: #CADCEB;
+#tabs .tab > a:hover {
+ background: #DDEDFB;
+ color: #D31141;
}
-#tabs .activetab a span {
+#tabs .activetab > a,
+#tabs .activetab > a:hover {
+ background: #CADCEB;
+ background: -moz-linear-gradient(top, #E2F2FF 0%, #CADCEB 100%);
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #E2F2FF), color-stop(100%, #CADCEB));
+ background: -webkit-linear-gradient(top, #E2F2FF 0%, #CADCEB 100%);
+ background: -o-linear-gradient(top, #E2F2FF 0%, #CADCEB 100%);
+ background: -ms-linear-gradient(top, #E2F2FF 0%, #CADCEB 100%);
+ background: linear-gradient(to bottom, #E2F2FF 0%, #CADCEB 100%);
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#E2F2FF', endColorstr='#CADCEB', GradientType=0 );
+ border-color: #CADCEB;
+ box-shadow: 0 1px 1px #F2F9FF inset;
color: #333333;
}
-#tabs .activetab a:hover span {
+#tabs .activetab > a:hover {
color: #000000;
}
/* Mini tabbed menu used in MCP
----------------------------------------*/
-#minitabs li {
+#minitabs .tab > a {
background-color: #E1EBF2;
}
-#minitabs li.activetab {
+#minitabs .activetab > a,
+#minitabs .activetab > a:hover {
background-color: #F9F9F9;
+ color: #333333;
}
-#minitabs li.activetab a, #minitabs li.activetab a:hover {
- color: #333333;
+/* Responsive tabs
+----------------------------------------*/
+.responsive-tab .responsive-tab-link:before {
+ border-color: #536482;
+}
+
+.responsive-tab .responsive-tab-link:hover:before {
+ border-color: #D31141;
}
/* UCP navigation menu
@@ -796,38 +819,57 @@ ul.cplist {
/* Link styles for the sub-section links */
#navigation a {
color: #333;
- background-color: #B2C2CF;
- background-image: url("{T_THEME_PATH}/images/bg_menu.gif");
+ background: #B4C4D1;
+ background: -moz-linear-gradient(left, #B4C4D1 50%, #CADCEB 100%);
+ background: -webkit-gradient(left top, right top, color-stop(50%, #B4C4D1), color-stop(100%, #CADCEB));
+ background: -webkit-linear-gradient(left, #B4C4D1 50%, #CADCEB 100%);
+ background: -o-linear-gradient(left, #B4C4D1 50%, #CADCEB 100%);
+ background: -ms-linear-gradient(left, #B4C4D1 50%, #CADCEB 100%);
+ background: linear-gradient(to right, #B4C4D1 50%, #CADCEB 100%);
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#B4C4D1', endColorstr='#CADCEB', GradientType=1 );
}
.rtl #navigation a {
- background-image: url("{T_THEME_PATH}/images/bg_menu_rtl.gif");
- background-position: 0 100%;
+ background: #B4C4D1;
+ background: -moz-linear-gradient(left, #CADCEB 0%, #B4C4D1 50%);
+ background: -webkit-gradient(left top, right top, color-stop(0%, #CADCEB), color-stop(50%, #B4C4D1));
+ background: -webkit-linear-gradient(left, #CADCEB 0%, #B4C4D1 50%);
+ background: -o-linear-gradient(left, #CADCEB 0%, #B4C4D1 50%);
+ background: -ms-linear-gradient(left, #CADCEB 0%, #B4C4D1 50%);
+ background: linear-gradient(to right, #CADCEB 0%, #B4C4D1 50%);
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#CADCEB', endColorstr='#B4C4D1', GradientType=1 );
}
#navigation a:hover {
- background-image: none;
- background-color: #aabac6;
+ background: #AABAC6;
color: #BC2A4D;
+ filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
}
#navigation #active-subsection a {
+ background: #F9F9F9;
color: #D31141;
- background-color: #F9F9F9;
- background-image: none;
+ filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
}
#navigation #active-subsection a:hover {
color: #D31141;
}
+@media only screen and (max-width: 900px), only screen and (max-device-width: 900px)
+{
+ #navigation a, .rtl #navigation a {
+ background: #B2C2CF;
+ }
+}
+
/* Preferences pane layout
----------------------------------------*/
-#cp-main h2 {
+.panel-container h2 {
color: #333333;
}
-#cp-main .panel {
+.panel-container .panel {
background-color: #F9F9F9;
}
@@ -835,39 +877,6 @@ ul.cplist {
background-color: #FFFFFF;
}
-#cp-main span.corners-top, #cp-menu span.corners-top {
- background-image: url("{T_THEME_PATH}/images/corners_left2.gif");
-}
-
-#cp-main span.corners-top span, #cp-menu span.corners-top span {
- background-image: url("{T_THEME_PATH}/images/corners_right2.gif");
-}
-
-#cp-main span.corners-bottom, #cp-menu span.corners-bottom {
- background-image: url("{T_THEME_PATH}/images/corners_left2.gif");
-}
-
-#cp-main span.corners-bottom span, #cp-menu span.corners-bottom span {
- background-image: url("{T_THEME_PATH}/images/corners_right2.gif");
-}
-
-/* Topicreview */
-#cp-main .panel #topicreview span.corners-top, #cp-menu .panel #topicreview span.corners-top {
- background-image: url("{T_THEME_PATH}/images/corners_left.gif");
-}
-
-#cp-main .panel #topicreview span.corners-top span, #cp-menu .panel #topicreview span.corners-top span {
- background-image: url("{T_THEME_PATH}/images/corners_right.gif");
-}
-
-#cp-main .panel #topicreview span.corners-bottom, #cp-menu .panel #topicreview span.corners-bottom {
- background-image: url("{T_THEME_PATH}/images/corners_left.gif");
-}
-
-#cp-main .panel #topicreview span.corners-bottom span, #cp-menu .panel #topicreview span.corners-bottom span {
- background-image: url("{T_THEME_PATH}/images/corners_right.gif");
-}
-
/* Friends list */
.cp-mini {
background-color: #eef5f9;
@@ -908,7 +917,7 @@ dl.mini dt {
/* Avatar gallery */
#gallery label {
- background-color: #FFFFFF;
+ background: #FFFFFF;
border-color: #CCC;
}
@@ -943,6 +952,10 @@ dd label {
color: #333;
}
+fieldset.fields1 {
+ background-color: transparent;
+}
+
/* Hover effects */
fieldset dl:hover dt label {
color: #000000;
@@ -964,6 +977,14 @@ fieldset.quick-login input.inputbox {
color: #333333;
}
+#message-box textarea.drag-n-drop {
+ outline-color: rgba(102, 102, 102, 0.5);
+}
+
+#message-box textarea.drag-n-drop-highlight {
+ outline-color: rgba(17, 163, 234, 0.5);
+}
+
/* Input field styles
---------------------------------------- */
.inputbox {
@@ -972,6 +993,14 @@ fieldset.quick-login input.inputbox {
color: #333333;
}
+.inputbox:-moz-placeholder {
+ color: #333333;
+}
+
+.inputbox::-webkit-input-placeholder {
+ color: #333333;
+}
+
.inputbox:hover {
border-color: #11A3EA;
}
@@ -981,13 +1010,22 @@ fieldset.quick-login input.inputbox {
color: #0F4987;
}
+.inputbox:focus:-moz-placeholder {
+ color: transparent;
+}
+
+.inputbox:focus::-webkit-input-placeholder {
+ color: transparent;
+}
+
+
/* Form button styles
---------------------------------------- */
a.button1, input.button1, input.button3, a.button2, input.button2 {
color: #000;
background-color: #FAFAFA;
- background-image: url("{T_THEME_PATH}/images/bg_button.gif");
+ background-image: url("./images/bg_button.gif");
}
a.button1, input.button1 {
@@ -1004,7 +1042,7 @@ a.button2, input.button2, input.button3 {
}
/* <a> button in the style of the form buttons */
-a.button1, a.button1:link, a.button1:visited, a.button1:active, a.button2, a.button2:link, a.button2:visited, a.button2:active {
+a.button1, a.button2 {
color: #000000;
}
@@ -1014,10 +1052,117 @@ a.button1:hover, input.button1:hover, a.button2:hover, input.button2:hover, inpu
color: #BC2A4D;
}
+/* Focus states */
+input.button1:focus, input.button2:focus, input.button3:focus {
+ border-color: #11A3EA;
+ color: #0F4987;
+}
+
input.search {
- background-image: url("{T_THEME_PATH}/images/icon_textbox_search.gif");
+ background-image: url("./images/icon_textbox_search.gif");
}
input.disabled {
color: #666666;
}
+
+/* jQuery popups
+---------------------------------------- */
+.phpbb_alert {
+ background-color: #FFFFFF;
+ border-color: #999999;
+}
+.phpbb_alert .alert_close {
+ background-image: url("./images/alert_close.png");
+}
+#darken {
+ background-color: #000000;
+}
+
+#loading_indicator {
+ background-color: #000000;
+ background-image: url("./images/loading.gif");
+}
+
+.dropdown-extended ul li {
+ border-top-color: #B9B9B9;
+}
+
+.dropdown-extended ul li:hover {
+ background-color: #CFE1F6;
+ color: #000000;
+}
+
+.dropdown-extended .header, .dropdown-extended .footer {
+ border-color: #B9B9B9;
+ color: #000000;
+}
+
+.dropdown-extended .footer {
+ border-top-style: solid;
+ border-top-width: 1px;
+}
+
+.dropdown-extended .header {
+ background: #F1F8FF;
+ background: -moz-linear-gradient(top, #F1F8FF 0%, #CADCEB 100%);
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #F1F8FF), color-stop(100%, #CADCEB));
+ background: -webkit-linear-gradient(top, #F1F8FF 0%, #CADCEB 100%);
+ background: -o-linear-gradient(top, #F1F8FF 0%, #CADCEB 100%);
+ background: -ms-linear-gradient(top, #F1F8FF 0%, #CADCEB 100%);
+ background: linear-gradient(to bottom, #F1F8FF 0%, #CADCEB 100%);
+}
+
+.dropdown .pointer {
+ border-color: #B9B9B9 transparent;
+}
+
+.dropdown .pointer-inner {
+ border-color: #FFF transparent;
+}
+
+.dropdown-extended .pointer-inner {
+ border-color: #F1F8FF transparent;
+}
+
+ul.linklist li.responsive-menu a.responsive-menu-link:before {
+ border-color: #105289;
+}
+
+ul.linklist li.responsive-menu a.responsive-menu-link:hover:before, ul.linklist li.responsive-menu.visible a.responsive-menu-link:before {
+ border-color: #D31141;
+}
+
+.dropdown .dropdown-contents {
+ background: #fff;
+ border-color: #b9b9b9;
+ box-shadow: 1px 3px 5px rgba(0, 0, 0, 0.2);
+}
+
+.dropdown-up .dropdown-contents {
+ box-shadow: 1px 0 5px rgba(0, 0, 0, 0.2);
+}
+
+.dropdown li, .dropdown li li {
+ border-color: #DCDCDC;
+}
+
+.dropdown li.separator {
+ border-color: #DCDCDC;
+}
+
+/* Notifications
+---------------------------------------- */
+
+.notification_list p.notification-time {
+ color: #4C5D77;
+}
+
+li.notification-reported strong, li.notification-disapproved strong {
+ color: #D31141;
+}
+
+.badge {
+ background-color: #D31141;
+ color: #ffffff;
+}
diff --git a/phpBB/styles/prosilver/theme/common.css b/phpBB/styles/prosilver/theme/common.css
index 7eb00bd808..df923aa948 100644
--- a/phpBB/styles/prosilver/theme/common.css
+++ b/phpBB/styles/prosilver/theme/common.css
@@ -1,12 +1,54 @@
-/* General Markup Styles
+/* CSS Reset http://meyerweb.com/eric/tools/css/reset/ v2.0 | 20110126
---------------------------------------- */
-
-* {
- /* Reset browsers default margin, padding and font sizes */
+html, body, div, span, applet, object, iframe,
+h1, h2, h3, h4, h5, h6, p, blockquote, pre,
+a, abbr, acronym, address, big, cite, code,
+del, dfn, em, img, ins, kbd, q, s, samp,
+small, strike, strong, sub, sup, tt, var,
+b, u, i, center,
+dl, dt, dd, ol, ul, li,
+fieldset, form, label, legend,
+table, caption, tbody, tfoot, thead, tr, th, td,
+article, aside, canvas, details, embed,
+figure, figcaption, footer, header, hgroup,
+menu, nav, output, ruby, section, summary,
+time, mark, audio, video {
margin: 0;
padding: 0;
+ border: 0;
+ font-size: 100%;
+ font: inherit;
+ vertical-align: baseline;
+}
+/* HTML5 display-role reset for older browsers */
+article, aside, details, figcaption, figure,
+footer, header, hgroup, menu, nav, section {
+ display: block;
+}
+body {
+ line-height: 1;
+}
+ol, ul {
+ list-style: none;
+}
+blockquote, q {
+ quotes: none;
+}
+blockquote:before, blockquote:after,
+q:before, q:after {
+ content: '';
+ content: none;
+}
+table {
+ border-collapse: collapse;
+ border-spacing: 0;
+}
+abbr {
+ text-decoration: none;
}
+/* General Markup Styles
+---------------------------------------- */
html {
font-size: 100%;
/* Always show a scrollbar for short pages - stops the jump when the scrollbar appears. non-IE browsers */
@@ -14,21 +56,19 @@ html {
}
body {
- /* Text-Sizing with ems: http://www.clagnut.com/blog/348/ */
font-family: Verdana, Helvetica, Arial, sans-serif;
- color: #828282;
- background-color: #FFFFFF;
- /*font-size: 62.5%; This sets the default font size to be equivalent to 10px */
font-size: 10px;
+ line-height: normal;
margin: 0;
padding: 12px 0;
+ word-wrap: break-word;
+ -webkit-print-color-adjust: exact;
}
h1 {
/* Forum name */
font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
margin-right: 200px;
- color: #FFFFFF;
margin-top: 15px;
font-weight: bold;
font-size: 2em;
@@ -38,7 +78,6 @@ h2 {
/* Forum header titles */
font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
font-weight: normal;
- color: #3f3f3f;
font-size: 2em;
margin: 0.8em 0 0.2em 0;
}
@@ -52,11 +91,10 @@ h3 {
font-family: Arial, Helvetica, sans-serif;
font-weight: bold;
text-transform: uppercase;
- border-bottom: 1px solid #CCCCCC;
+ border-bottom: 1px solid transparent;
margin-bottom: 3px;
padding-bottom: 2px;
font-size: 1.05em;
- color: #989898;
margin-top: 20px;
}
@@ -77,9 +115,8 @@ img {
}
hr {
- /* Also see tweaks.css */
- border: 0 none #FFFFFF;
- border-top: 1px solid #CCCCCC;
+ border: 0 solid transparent;
+ border-top-width: 1px;
height: 1px;
margin: 5px 0;
display: block;
@@ -87,7 +124,7 @@ hr {
}
hr.dashed {
- border-top: 1px dashed #CCCCCC;
+ border-top-style: dashed;
margin: 10px 0;
}
@@ -99,15 +136,68 @@ p.right {
text-align: right;
}
+p.jumpbox-return {
+ margin-top: 10px;
+ margin-bottom: 0;
+ float: left;
+}
+
+b, strong {
+ font-weight: bold;
+}
+
+.text-strong {
+ font-weight: bold;
+}
+
+i, em {
+ font-style: italic;
+}
+
+.text-italics {
+ font-style: italic;
+}
+
+u {
+ text-decoration: underline;
+}
+
+ul {
+ list-style-type: disc;
+}
+
+ol {
+ list-style-type: decimal;
+}
+
+li {
+ display: list-item;
+}
+
+ul ul, ol ul {
+ list-style-type: circle;
+}
+
+ol ol ul, ol ul ul, ul ol ul, ul ul ul {
+ list-style-type: square;
+}
+
+
/* Main blocks
---------------------------------------- */
#wrap {
- padding: 0 20px;
- min-width: 650px;
+ border: 1px solid transparent;
+ border-radius: 8px;
+ margin: 0 auto;
+ max-width: 1152px;
+ min-width: 625px;
+ padding: 15px;
}
-#simple-wrap {
- padding: 6px 10px;
+@media only screen and (max-width: 1220px), only screen and (max-device-width: 1220px) {
+ #wrap {
+ margin: 0 12px;
+ }
}
#page-body {
@@ -123,57 +213,20 @@ p.right {
margin-top: 20px;
}
-#logo {
+.logo {
float: left;
width: auto;
padding: 10px 13px 0 10px;
}
-a#logo:hover {
+.logo:hover {
text-decoration: none;
}
-/* Search box
---------------------------------------------- */
-#search-box {
- color: #FFFFFF;
- position: relative;
- margin-top: 30px;
- margin-right: 5px;
- display: block;
- float: right;
- text-align: right;
- white-space: nowrap; /* For Opera */
-}
-
-#search-box #keywords {
- width: 95px;
- background-color: #FFF;
-}
-
-#search-box input {
- border: 1px solid #b0b0b0;
-}
-
-/* .button1 style defined later, just a few tweaks for the search button version */
-#search-box input.button1 {
- padding: 1px 5px;
-}
-
-#search-box li {
- text-align: right;
- margin-top: 4px;
-}
-
-#search-box img {
- vertical-align: middle;
- margin-right: 3px;
-}
-
/* Site description and logo */
#site-description {
float: left;
- width: 70%;
+ width: 65%;
}
#site-description h1 {
@@ -183,166 +236,413 @@ a#logo:hover {
/* Round cornered boxes and backgrounds
---------------------------------------- */
.headerbar {
- background: #ebebeb none repeat-x 0 0;
- color: #FFFFFF;
+ background: transparent none repeat-x 0 0;
margin-bottom: 4px;
- padding: 0 5px;
+ padding: 5px;
+ border-radius: 7px;
}
.navbar {
- background-color: #ebebeb;
- padding: 0 10px;
+ padding: 3px 10px;
+ border-radius: 7px;
}
.forabg {
- background: #b1b1b1 none repeat-x 0 0;
+ background: transparent none repeat-x 0 0;
margin-bottom: 4px;
- padding: 0 5px;
+ padding: 5px;
clear: both;
+ border-radius: 7px;
}
.forumbg {
- background: #ebebeb none repeat-x 0 0;
+ background: transparent none repeat-x 0 0;
margin-bottom: 4px;
- padding: 0 5px;
+ padding: 5px;
clear: both;
+ border-radius: 7px;
}
.panel {
margin-bottom: 4px;
- padding: 0 10px;
- background-color: #f3f3f3;
- color: #3f3f3f;
+ padding: 5px 10px;
+ border-radius: 7px;
}
.post {
- padding: 0 10px;
+ padding: 5px 10px;
margin-bottom: 4px;
background-repeat: no-repeat;
background-position: 100% 0;
+ border-radius: 7px;
+ position: relative;
}
-.post:target .content {
- color: #000000;
+.rowbg {
+ margin: 5px 5px 2px 5px;
}
-.post:target h3 a {
- color: #000000;
+/* Horizontal lists
+----------------------------------------*/
+.navbar ul.linklist {
+ padding: 2px 0;
}
-.bg1 { background-color: #f7f7f7;}
-.bg2 { background-color: #f2f2f2; }
-.bg3 { background-color: #ebebeb; }
+ul.linklist {
+ display: block;
+ margin: 0;
+}
-.rowbg {
- margin: 5px 5px 2px 5px;
+#cp-main .panel {
+ padding: 5px 10px;
}
-.ucprowbg {
- background-color: #e2e2e2;
+ul.linklist > li {
+ float: left;
+ font-size: 1.1em;
+ line-height: 2.2em;
+ list-style-type: none;
+ margin-right: 7px;
+ padding-top: 1px;
+ width: auto;
}
-.fieldsbg {
- /*border: 1px #DBDEE2 solid;*/
- background-color: #eaeaea;
+ul.linklist > li.rightside, p.rightside, a.rightside {
+ float: right;
+ margin-right: 0;
+ margin-left: 7px;
+ text-align: right;
}
-span.corners-top, span.corners-bottom, span.corners-top span, span.corners-bottom span {
- font-size: 1px;
- line-height: 1px;
- display: block;
- height: 5px;
- background-repeat: no-repeat;
+ul.navlinks {
+ border-top: 1px solid transparent;
}
-span.corners-top {
- background-image: none;
- background-position: 0 0;
- margin: 0 -5px;
+ul.leftside {
+ float: left;
+ margin-left: 0;
+ margin-right: 5px;
+ text-align: left;
}
-span.corners-top span {
- background-image: none;
- background-position: 100% 0;
+ul.rightside {
+ float: right;
+ margin-left: 5px;
+ margin-right: -5px;
+ text-align: right;
}
-span.corners-bottom {
- background-image: none;
- background-position: 0 100%;
- margin: 0 -5px;
- clear: both;
+ul.linklist li.responsive-menu {
+ position: relative;
+ margin: 0 5px;
}
-span.corners-bottom span {
- background-image: none;
- background-position: 100% 100%;
+ul.linklist li.responsive-menu a.responsive-menu-link {
+ display: inline-block;
+ margin: 0 5px;
+ font-size: 1.455em;
+ position: relative;
+ width: 16px;
+ line-height: 1.2em;
+ text-decoration: none;
}
-.headbg span.corners-bottom {
- margin-bottom: -1px;
+ul.linklist li.responsive-menu a.responsive-menu-link:before {
+ content: '';
+ position: absolute;
+ left: 0;
+ top: 7px;
+ height: .125em;
+ width: 14px;
+ border-bottom: 0.125em solid transparent;
+ border-top: 0.375em double transparent;
}
-.post span.corners-top, .post span.corners-bottom, .panel span.corners-top, .panel span.corners-bottom, .navbar span.corners-top, .navbar span.corners-bottom {
- margin: 0 -10px;
+.hasjs ul.linklist.leftside, .hasjs ul.linklist.rightside {
+ max-width: 48%;
}
-.rules span.corners-top {
- margin: 0 -10px 5px -10px;
+.hasjs ul.linklist.fullwidth {
+ max-width: none;
}
-.rules span.corners-bottom {
- margin: 5px -10px 0 -10px;
+li.responsive-menu.dropdown-right .dropdown {
+ left: -9px;
}
-/* Horizontal lists
+li.responsive-menu.dropdown-left .dropdown {
+ right: -6px;
+}
+
+ul.linklist .dropdown {
+ top: 22px;
+}
+
+ul.linklist .dropdown-up .dropdown {
+ bottom: 18px;
+ top: auto;
+}
+
+/* Bulletin icons for list items
----------------------------------------*/
-ul.linklist {
- display: block;
- margin: 0;
+ul.linklist.bulletin > li:before {
+ display: inline-block;
+ content: "\2022";
+ font-size: inherit;
+ line-height: inherit;
+ padding-right: 4px;
}
-ul.linklist li {
- display: block;
- list-style-type: none;
- float: left;
+ul.linklist.bulletin > li:first-child:before,
+ul.linklist.bulletin > li.rightside:last-child:before {
+ content: none;
+}
+
+ul.linklist.bulletin > li.no-bulletin:before {
+ content: none;
+}
+
+.responsive-menu:before {
+ display: none !important;
+}
+
+/* Profile in overall_header.html */
+.header-profile {
+ display: inline-block;
+ vertical-align: top;
+}
+
+.header-avatar:hover {
+ text-decoration: none;
+}
+
+.header-avatar img {
+ margin-bottom: 2px;
+ max-height: 20px;
+ vertical-align: middle;
width: auto;
- margin-right: 5px;
- font-size: 1.1em;
- line-height: 2.2em;
}
-ul.linklist li.rightside, p.rightside {
+.header-avatar span:after {
+ content: '\25BC';
+ display: inline-block;
+ font-size: 9px;
float: right;
- margin-right: 0;
- margin-left: 5px;
- text-align: right;
+ padding-left: 2px;
+ opacity: 0.7;
}
-ul.navlinks {
- padding-bottom: 1px;
- margin-bottom: 1px;
- border-bottom: 1px solid #FFFFFF;
- font-weight: bold;
+/* Dropdown menu
+----------------------------------------*/
+.dropdown-container {
+ position: relative;
}
-ul.leftside {
+.dropdown-container-right {
+ float: right;
+}
+
+.dropdown-container-left {
float: left;
- margin-left: 0;
- margin-right: 5px;
+}
+
+.nojs .dropdown-container:hover .dropdown {
+ display: block !important;
+}
+
+.dropdown {
+ position: absolute;
+ left: 0;
+ top: 1.2em;
+ z-index: 2;
+ border: 1px solid transparent;
+ border-radius: 5px;
+ padding: 9px 0 0;
+ margin-right: -500px;
+}
+
+.dropdown.live-search {
+ top: auto;
+}
+
+.dropdown-container.topic-tools {
+ float: left;
+}
+
+.dropdown-up .dropdown {
+ top: auto;
+ bottom: 1.2em;
+ padding: 0 0 9px;
+}
+
+.dropdown-left .dropdown, .nojs .rightside .dropdown {
+ left: auto;
+ right: 0;
+ margin-left: -500px;
+ margin-right: 0;
+}
+
+.dropdown-button-control .dropdown {
+ top: 24px;
+}
+
+.dropdown-button-control.dropdown-up .dropdown {
+ top: auto;
+ bottom: 24px;
+}
+
+.dropdown .pointer, .dropdown .pointer-inner {
+ position: absolute;
+ width: 0;
+ height: 0;
+ border-top-width: 0;
+ border-bottom: 10px solid transparent;
+ border-left: 10px dashed transparent;
+ border-right: 10px dashed transparent;
+ -webkit-transform: rotate(360deg); /* better anti-aliasing in webkit */
+ display: block;
+}
+
+.dropdown-up .pointer, .dropdown-up .pointer-inner {
+ border-bottom-width: 0;
+ border-top: 10px solid transparent;
+}
+
+.dropdown .pointer {
+ right: auto;
+ left: 10px;
+ top: 0;
+ z-index: 3;
+}
+
+.dropdown-up .pointer {
+ bottom: 0;
+ top: auto;
+}
+
+.dropdown-left .dropdown .pointer, .nojs .rightside .dropdown .pointer {
+ left: auto;
+ right: 10px;
+}
+
+.dropdown .pointer-inner {
+ top: auto;
+ bottom: -11px;
+ left: -10px;
+}
+
+.dropdown-up .pointer-inner {
+ bottom: auto;
+ top: -11px;
+}
+
+.dropdown .dropdown-contents {
+ z-index: 2;
+ overflow: hidden;
+ overflow-y: auto;
+ border: 1px solid transparent;
+ border-radius: 5px;
+ padding: 5px;
+ position: relative;
+ min-width: 40px;
+ max-height: 300px;
+ -webkit-box-sizing: border-box;
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
+}
+
+.dropdown li {
+ border-top: 1px dotted transparent;
+ float: none !important;
+ line-height: normal !important;
+ font-size: 1em !important;
+ list-style: none;
+ margin: 0;
+ padding-top: 4px;
+ padding-bottom: 4px;
+ white-space: nowrap;
text-align: left;
}
-ul.rightside {
- float: right;
- margin-left: 5px;
- margin-right: -5px;
- text-align: right;
+.dropdown-contents > li {
+ padding-right: 15px;
+}
+
+.dropdown-nonscroll > li {
+ padding-right: 0;
+}
+
+.dropdown li:first-child, .dropdown li.separator + li, .dropdown li li {
+ border-top: 0;
+}
+
+.dropdown li li:first-child {
+ margin-top: 4px;
+}
+
+.dropdown li li:last-child {
+ padding-bottom: 0;
+}
+
+.dropdown li li {
+ border-top: 1px dotted transparent;
+ padding-left: 18px;
}
+.wrap .dropdown li, .dropdown.wrap li, .dropdown-extended li {
+ white-space: normal;
+}
+
+.dropdown li.separator {
+ border-top: 1px solid transparent;
+ margin: 4px 0;
+ padding: 0;
+}
+
+.dropdown li.separator:first-child, .dropdown li.separator:last-child {
+ display: none !important;
+}
+
+/* Responsive breadcrumbs
+----------------------------------------*/
+.breadcrumbs .crumb {
+ float: left;
+ font-weight: bold;
+ word-wrap: normal;
+}
+
+.breadcrumbs .crumb:before {
+ content: '\2039';
+ font-weight: bold;
+ padding: 0 0.5em;
+}
+
+.breadcrumbs .crumb:first-child:before {
+ content: none;
+}
+
+.breadcrumbs .crumb a {
+ display: inline-block;
+ white-space: nowrap;
+ text-overflow: ellipsis;
+ vertical-align: bottom;
+ overflow: hidden;
+}
+
+.breadcrumbs.wrapped .crumb a { letter-spacing: -.3px; }
+.breadcrumbs.wrapped .crumb.wrapped-medium a { letter-spacing: -.4px; }
+.breadcrumbs.wrapped .crumb.wrapped-tiny a { letter-spacing: -.5px; }
+
+.breadcrumbs .crumb.wrapped-max a { max-width: 120px; }
+.breadcrumbs .crumb.wrapped-wide a { max-width: 100px; }
+.breadcrumbs .crumb.wrapped-medium a { max-width: 80px; }
+.breadcrumbs .crumb.wrapped-small a { max-width: 60px; }
+.breadcrumbs .crumb.wrapped-tiny a { max-width: 40px; }
+
/* Table styles
----------------------------------------*/
table.table1 {
- /* See tweaks.css */
+ width: 100%;
}
#ucp-main table.table1 {
@@ -352,7 +652,6 @@ table.table1 {
table.table1 thead th {
font-weight: normal;
text-transform: uppercase;
- color: #FFFFFF;
line-height: 1.3em;
font-size: 1em;
padding: 0 0 4px 3px;
@@ -363,35 +662,29 @@ table.table1 thead th span {
}
table.table1 tbody tr {
- border: 1px solid #cfcfcf;
-}
-
-table.table1 tbody tr:hover, table.table1 tbody tr.hover {
- background-color: #f6f6f6;
- color: #000;
+ border: 1px solid transparent;
}
table.table1 td {
- color: #6a6a6a;
font-size: 1.1em;
}
table.table1 tbody td {
padding: 5px;
- border-top: 1px solid #FAFAFA;
+ border-top: 1px solid transparent;
}
table.table1 tbody th {
padding: 5px;
- border-bottom: 1px solid #000000;
+ border-bottom: 1px solid transparent;
text-align: left;
- color: #333333;
- background-color: #FFFFFF;
}
/* Specific column styles */
table.table1 .name { text-align: left; }
-table.table1 .posts { text-align: center !important; width: 7%; }
+table.table1 .center { text-align: center; }
+table.table1 .reportby { width: 15%; }
+table.table1 .posts { text-align: center; width: 7%; }
table.table1 .joined { text-align: left; width: 15%; }
table.table1 .active { text-align: left; width: 15%; }
table.table1 .mark { text-align: center; width: 7%; }
@@ -413,7 +706,6 @@ table.info tbody th {
padding: 3px;
text-align: right;
vertical-align: top;
- color: #000000;
font-weight: normal;
}
@@ -425,18 +717,14 @@ table.info tbody th {
margin: 0 -1px;
}
-.forumbg-table > .inner > span.corners-top {
- margin: 0 -4px -1px -4px;
-}
-
-.forumbg-table > .inner > span.corners-bottom {
- margin: -1px -4px 0 -4px;
+#color_palette_placeholder table {
+ border-collapse: separate;
+ border-spacing: 1px;
}
/* Misc layout styles
---------------------------------------- */
-/* column[1-2] styles are containers for two column layouts
- Also see tweaks.css */
+/* column[1-2] styles are containers for two column layouts */
.column1 {
float: left;
clear: left;
@@ -454,12 +742,18 @@ table.info tbody th {
float: left;
width: auto;
text-align: left;
+ max-width: 100%;
+}
+
+.left-box.profile-details {
+ width: 80%;
}
.right-box {
float: right;
width: auto;
text-align: right;
+ max-width: 100%;
}
dl.details {
@@ -472,7 +766,6 @@ dl.details dt {
clear: left;
width: 30%;
text-align: right;
- color: #000000;
display: block;
}
@@ -480,83 +773,229 @@ dl.details dd {
margin-left: 0;
padding-left: 5px;
margin-bottom: 5px;
- color: #828282;
float: left;
width: 65%;
+ overflow: hidden;
+ text-overflow: ellipsis;
+}
+
+.clearfix, fieldset dl, ul.topiclist dl, dl.polls {
+ overflow: hidden;
+}
+
+fieldset.fields1 ul.recipients {
+ list-style-type: none;
+ line-height: 1.8;
+ max-height: 150px;
+ overflow-y: auto;
+}
+
+fieldset.fields1 dd.recipients {
+ clear: left;
+ margin-left: 1em;
+}
+
+fieldset.fields1 ul.recipients input.button2{
+ font-size: 0.8em;
+ margin-right: 0;
+ padding: 0;
+}
+
+fieldset.fields1 dl.pmlist > dt {
+ width: auto !important;
+}
+
+fieldset.fields1 dl.pmlist dd.recipients {
+ margin-left: 0 !important;
+}
+
+/* Action-bars (container for post/reply buttons, pagination, etc.)
+---------------------------------------- */
+.action-bar {
+ font-size: 1.1em;
+ margin: 4px 0;
+}
+
+.forabg + .action-bar {
+ margin-top: 2em;
}
/* Pagination
---------------------------------------- */
.pagination {
- height: 1%; /* IE tweak (holly hack) */
- width: auto;
- text-align: right;
- margin-top: 5px;
float: right;
+ margin-top: 3px;
+ text-align: right;
+ width: auto;
}
-.pagination span.page-sep {
- display: none;
-}
-
-li.pagination {
+.action-bar.bottom .pagination {
margin-top: 0;
}
-.pagination strong, .pagination b {
- font-weight: normal;
+.pagination > ul {
+ display: inline-block;
+ list-style: none !important;
+ margin-left: 5px;
}
-.pagination span strong {
- padding: 0 2px;
- margin: 0 2px;
- font-weight: normal;
- color: #FFFFFF;
- background-color: #bfbfbf;
- border: 1px solid #bfbfbf;
- font-size: 0.9em;
+.pagination > ul > li {
+ display: inline-block !important;
+ padding: 0;
+ font-size: 100%;
+ line-height: normal;
+ vertical-align: middle;
}
-.pagination span a, .pagination span a:link, .pagination span a:visited, .pagination span a:active {
+.pagination li a, .pagination li span {
+ border: 1px solid transparent;
+ border-radius: 2px;
+ display: block;
+ font-size: 0.9em;
font-weight: normal;
+ line-height: 1.4em;
+ min-width: 10px;
+ padding: 3px;
+ text-align: center;
text-decoration: none;
- color: #747474;
- margin: 0 2px;
- padding: 0 2px;
- background-color: #eeeeee;
- border: 1px solid #bababa;
- font-size: 0.9em;
- line-height: 1.5em;
}
-.pagination span a:hover {
- border-color: #d2d2d2;
- background-color: #d2d2d2;
- color: #FFF;
- text-decoration: none;
+.pagination li.ellipsis span {
+ border: none;
+ padding: 0;
}
-.pagination img {
- vertical-align: middle;
+.pagination li.page-jump {
+ margin-right: 5px;
}
+.pagination li.page-jump a, .pagination li.next a, .pagination li.previous a {
+ background-repeat: no-repeat;
+ font-size: 0;
+ height: 13px;
+ width: 11px;
+}
+
+.pagination li.page-jump a {
+ background-position: 0 2px;
+ width: 24px;
+}
+
+.pagination li.next a {
+ background-position: -50px 2px;
+}
+
+.pagination li.previous a {
+ background-position: -30px 2px;
+}
+
+.pagination li.page-jump a:hover, .pagination .dropdown-visible a.dropdown-trigger, .nojs .pagination .dropdown-container:hover a.dropdown-trigger { background-position: 0 -18px; }
+.pagination li.next a:hover { background-position: -50px -18px; }
+.pagination li.previous a:hover { background-position: -30px -18px; }
+
/* Pagination in viewforum for multipage topics */
.row .pagination {
display: block;
- float: right;
- width: auto;
margin-top: 0;
padding: 1px 0 1px 15px;
font-size: 0.9em;
background: none 0 50% no-repeat;
}
-.row .pagination span a, li.pagination span a {
- background-color: #FFFFFF;
+.row .pagination > ul {
+ margin: 0;
}
-.row .pagination span a:hover, li.pagination span a:hover {
- background-color: #d2d2d2;
+.row .pagination li a, .row .pagination li span {
+ border-radius: 1px;
+ padding: 1px;
+}
+
+/* jQuery popups
+---------------------------------------- */
+.phpbb_alert {
+ border: 1px solid transparent;
+ display: none;
+ left: 0;
+ padding: 0 25px 20px 25px;
+ position: fixed;
+ right: 0;
+ top: 150px;
+ z-index: 50;
+ width: 620px;
+ margin: 0 auto;
+}
+
+@media only screen and (max-height: 500px), only screen and (max-device-width: 500px)
+{
+ .phpbb_alert {
+ top: 25px;
+ }
+}
+
+.phpbb_alert .alert_close {
+ display: block;
+ float: right;
+ width: 16px;
+ height: 16px;
+ overflow: hidden;
+ text-decoration: none !important;
+ background: transparent none 0 0 no-repeat;
+ margin-top: -7px;
+ margin-right: -31px;
+}
+.phpbb_alert .alert_close:hover {
+ background-position: 0 -16px;
+}
+
+.phpbb_alert p {
+ margin: 8px 0;
+ padding-bottom: 8px;
+}
+
+.phpbb_alert label {
+ display: block;
+ margin: 8px 0;
+ padding-bottom: 8px;
+}
+
+.phpbb_alert div.alert_text > p,
+.phpbb_alert div.alert_text > label,
+.phpbb_alert div.alert_text > select,
+.phpbb_alert div.alert_text > textarea,
+.phpbb_alert div.alert_text > input {
+ font-size: 1.1em;
+}
+
+#darkenwrapper {
+ display: none;
+ position: relative;
+ z-index: 44;
+}
+
+#darken {
+ position: fixed;
+ left: 0;
+ top: 0;
+ width: 100%;
+ height: 100%;
+ opacity: 0.5;
+ z-index: 45;
+}
+
+#loading_indicator {
+ background: center center no-repeat;
+ border-radius: 5px;
+ display: none;
+ opacity: 0.8;
+ margin-top: -50px;
+ margin-left: -50px;
+ height: 50px;
+ width: 50px;
+ position: fixed;
+ left: 50%;
+ top: 50%;
+ z-index: 51;
}
/* Miscellaneous styles
@@ -573,7 +1012,6 @@ li.pagination {
.copyright {
padding: 5px;
text-align: center;
- color: #555555;
}
.small {
@@ -589,44 +1027,50 @@ li.pagination {
}
.error {
- color: #bcbcbc;
font-weight: bold;
font-size: 1em;
}
-.reported {
- background-color: #f7f7f7;
-}
-
-li.reported:hover {
- background-color: #ececec;
-}
-
div.rules {
- background-color: #ececec;
- color: #bcbcbc;
- padding: 0 10px;
margin: 10px 0;
font-size: 1.1em;
+ padding: 5px 10px;
+ border-radius: 7px;
}
div.rules ul, div.rules ol {
margin-left: 20px;
}
-p.rules {
- background-color: #ececec;
- background-image: none;
+p.post-notice {
+ position: relative;
padding: 5px;
+ padding-left: 26px;
+ min-height: 14px;
+ margin-bottom: 1em;
}
-p.rules img {
- vertical-align: middle;
- padding-top: 5px;
+p.post-notice:before {
+ content: '';
+ display: block;
+ position: absolute;
+ top: 0;
+ bottom: 0;
+ left: 0;
+ width: 28px;
+ background: transparent none 50% 50% no-repeat;
+ pointer-events: none;
}
-p.rules a {
- vertical-align: middle;
+form > p.post-notice strong {
+ line-height: 20px;
+}
+
+#jumpbox {
+ margin: 5px 0;
+}
+
+.stat-block {
clear: both;
}
@@ -642,3 +1086,247 @@ p.rules a {
line-height: 1px;
background: transparent;
}
+
+/* Inner box-model clearing */
+.inner:after,
+ul.linklist:after,
+.action-bar:after,
+.notification_text:after,
+.tabs-container:after,
+#tabs > ul:after,
+#minitabs > ul:after,
+.postprofile .avatar-container:after {
+ clear: both;
+ content: '';
+ display: block;
+}
+
+.hidden {
+ display: none;
+}
+
+.smilies {
+ vertical-align: text-bottom;
+}
+
+.icon-notification {
+ position: relative;
+}
+
+.member-search {
+ float: left;
+ margin: 0;
+ padding: 6px 10px;
+}
+
+.member-search strong {
+ font-size: 0.95em;
+}
+
+.dropdown-extended {
+ display: none;
+ z-index: 1;
+}
+
+.dropdown-extended ul {
+ max-height: 350px;
+ overflow-y: auto;
+ overflow-x: hidden;
+ clear: both;
+}
+
+.dropdown-extended ul li {
+ padding: 0;
+ margin: 0 !important;
+ float: none;
+ border-top: 1px solid;
+ list-style-type: none;
+ font-size: 0.95em;
+ clear: both;
+ position: relative;
+}
+
+.dropdown-extended ul li:first-child {
+ border-top: none;
+}
+
+.dropdown-extended ul li.no_notifications {
+ padding: 10px;
+}
+
+.dropdown-extended .dropdown-contents {
+ max-height: none;
+ padding: 0;
+ position: absolute;
+ width: 340px;
+}
+
+.nojs .dropdown-extended .dropdown-contents {
+ position: relative;
+}
+
+.dropdown-extended .header {
+ padding: 0 10px;
+ font-family: Arial, "Helvetica Neue", Helvetica, Arial, sans-serif;
+ font-weight: bold;
+ text-align: left;
+ text-shadow: 1px 1px 1px white;
+ text-transform: uppercase;
+ line-height: 3em;
+ border-bottom: 1px solid;
+ border-radius: 5px 5px 0 0;
+}
+
+.dropdown-extended .header .header_settings {
+ float: right;
+ font-weight: normal;
+ text-transform: none;
+}
+
+.dropdown-extended .header:after {
+ content: '';
+ display: table;
+ clear: both;
+}
+
+.dropdown-extended .footer {
+ text-align: center;
+ font-size: 1.1em;
+}
+
+.dropdown-extended ul li a, .dropdown-extended ul li.no-url {
+ padding: 8px;
+}
+
+.dropdown-extended .footer > a {
+ padding: 5px 0;
+}
+
+.dropdown-extended ul li a, .notification_list dt > a, .dropdown-extended .footer > a {
+ display: block;
+ text-decoration: none;
+}
+
+.notification_list ul li img {
+ float: left;
+ max-height: 50px;
+ max-width: 50px;
+ width: auto !important;
+ height: auto !important;
+ margin-right: 5px;
+}
+
+.notification_list ul li p {
+ margin-bottom: 4px;
+ font-size: 1em;
+}
+
+.notification_list p.notification-reference,
+.notification_list p.notification-location,
+.notification_list li a p.notification-reason {
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+
+.notification_list p.notification-time {
+ font-size: 0.9em;
+ margin: 0;
+ text-align: right;
+}
+
+.notification_list div.notifications {
+ margin-left: 50px;
+ padding: 5px;
+}
+
+.notification_list div.notifications a {
+ display: block;
+}
+
+.notification_list p.notifications_title {
+ font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
+ font-size: 1.2em !important;
+}
+
+.notification_list p.notifications_title strong {
+ font-weight: bold;
+}
+
+.notification_list p.notifications_time {
+ font-size: 0.9em !important;
+}
+
+.notification_text {
+ margin-left: 58px;
+}
+
+.badge {
+ border-radius: 10px;
+ opacity: 0.8;
+ text-align: center;
+ white-space: nowrap;
+ font-size: 10px;
+ line-height: 1;
+ float: right;
+ display: inline-block;
+ margin-left: 3px;
+ vertical-align: baseline;
+ position: relative;
+ top: 3px;
+ padding: 4px 6px;
+}
+
+.badge.hidden {
+ display: none;
+}
+
+/* Navbar specific list items
+----------------------------------------*/
+
+#quick-links {
+ margin: 0 7px 0 0;
+}
+
+#quick-links a.responsive-menu-link {
+ display: block;
+ font-size: inherit;
+ line-height: inherit;
+ margin: 0;
+ width: auto;
+}
+
+#quick-links a.responsive-menu-link:before {
+ font-size: 1.455em;
+ line-height: 16.5px;
+}
+
+.compact #quick-links a.responsive-menu-link {
+ width: 0;
+ overflow: hidden;
+ white-space: nowrap;
+}
+
+.compact .icon-notification > a > span, .compact .icon-pm > a > span {
+ display: none;
+}
+
+.dropdown-page-jump .dropdown {
+ top: 20px;
+}
+
+.dropdown-page-jump.dropdown-up .dropdown {
+ bottom: 20px;
+}
+
+.dropdown-page-jump input.tiny {
+ width: 50px;
+}
+
+.dropdown .clone.hidden + li.separator {
+ display: none;
+}
+
+.dropdown .clone.hidden + li {
+ border-top: none;
+}
diff --git a/phpBB/styles/prosilver/theme/content.css b/phpBB/styles/prosilver/theme/content.css
index 5f627c8f77..dfb91891fa 100644
--- a/phpBB/styles/prosilver/theme/content.css
+++ b/phpBB/styles/prosilver/theme/content.css
@@ -8,13 +8,12 @@ ul.topiclist {
}
ul.forums {
- background: #f9f9f9 none repeat-x 0 0;
+ background: transparent none repeat-x 0 0;
}
ul.topiclist li {
display: block;
list-style-type: none;
- color: #777777;
margin: 0;
}
@@ -26,20 +25,53 @@ ul.topiclist li.row dl {
padding: 2px 0;
}
-ul.topiclist dt {
+ul.topiclist dt, ul.topiclist dd {
display: block;
float: left;
- width: 50%;
+}
+
+ul.topiclist dt {
+ width: 100%;
+ margin-right: -440px;
font-size: 1.1em;
+}
+
+ul.topiclist.missing-column dt {
+ margin-right: -345px;
+}
+
+ul.topiclist.two-long-columns dt {
+ margin-right: -250px;
+}
+
+ul.topiclist.two-columns dt {
+ margin-right: -80px;
+}
+
+ul.topiclist dt .list-inner {
+ margin-right: 440px;
padding-left: 5px;
padding-right: 5px;
}
+ul.topiclist.missing-column dt .list-inner {
+ margin-right: 345px;
+}
+
+ul.topiclist.two-long-columns dt .list-inner {
+ margin-right: 250px;
+}
+
+ul.topiclist.two-columns dt .list-inner {
+ margin-right: 80px;
+}
+
ul.topiclist dd {
- display: block;
- float: left;
- border-left: 1px solid #FFFFFF;
+ border-left: 1px solid transparent;
padding: 4px 0;
+ -webkit-box-sizing: border-box;
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
}
ul.topiclist dfn {
@@ -65,28 +97,18 @@ ul.topiclist li.row dt a.subforum {
}
li.row {
- border-top: 1px solid #FFFFFF;
- border-bottom: 1px solid #8f8f8f;
+ border-top: 1px solid transparent;
+ border-bottom: 1px solid transparent;
}
li.row strong {
font-weight: normal;
- color: #000000;
-}
-
-li.row:hover {
- background-color: #f6f6f6;
-}
-
-li.row:hover dd {
- border-left-color: #CCCCCC;
}
li.header dt, li.header dd {
line-height: 1em;
border-left-width: 0;
margin: 2px 0 4px 0;
- color: #FFFFFF;
padding-top: 2px;
padding-bottom: 2px;
font-size: 1em;
@@ -96,17 +118,26 @@ li.header dt, li.header dd {
li.header dt {
font-weight: bold;
+ width: 100%;
+ margin-right: -440px;
+}
+
+li.header dt .list-inner {
+ margin-right: 440px;
}
li.header dd {
- margin-left: 1px;
+ padding-left: 1px;
+ -webkit-box-sizing: border-box;
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
}
-li.header dl.icon {
+li.header dl.icon dt, li.header dl.icon dd {
min-height: 0;
}
-li.header dl.icon dt {
+li.header dl.icon dt .list-inner {
/* Tweak for headers alignment when folder icon used */
padding-left: 0;
padding-right: 50px;
@@ -114,24 +145,46 @@ li.header dl.icon dt {
/* Forum list column styles */
dl.icon {
- min-height: 35px;
background-position: 10px 50%; /* Position of folder icon */
background-repeat: no-repeat;
}
dl.icon dt {
- padding-left: 45px; /* Space for folder icon */
background-repeat: no-repeat;
background-position: 5px 95%; /* Position of topic icon */
}
-dd.posts, dd.topics, dd.views {
- width: 8%;
+dl.icon dt .list-inner {
+ padding-left: 45px; /* Space for folder icon */
+}
+
+dl.icon dt, dl.icon dd {
+ min-height: 35px;
+}
+
+dl a.icon-link { /* topic row icon links */
+ display: block;
+ width: 30px;
+ height: 30px;
+ padding: 0;
+ position: absolute;
+ top: 50%;
+ left: 0;
+ margin-top: -15px;
+ margin-left: 9px;
+}
+
+dd.posts, dd.topics, dd.views, dd.extra, dd.mark {
+ width: 80px;
text-align: center;
line-height: 2.2em;
font-size: 1.2em;
}
+dd.posts, dd.topics, dd.views {
+ width: 95px;
+}
+
/* List in forum description */
dl.icon dt ol,
dl.icon dt ul {
@@ -144,94 +197,43 @@ dl.icon dt li {
list-style-type: inherit;
}
-dd.lastpost {
- width: 25%;
+dd.lastpost, dd.redirect, dd.moderation, dd.time, dd.info {
+ width: 250px;
font-size: 1.1em;
}
dd.redirect {
- font-size: 1.1em;
line-height: 2.5em;
}
-dd.moderation {
- font-size: 1.1em;
-}
-
-dd.lastpost span, ul.topiclist dd.searchby span, ul.topiclist dd.info span, ul.topiclist dd.time span, dd.redirect span, dd.moderation span {
- display: block;
- padding-left: 5px;
-}
-
dd.time {
- width: auto;
line-height: 200%;
- font-size: 1.1em;
}
-dd.extra {
- width: 12%;
- line-height: 200%;
- text-align: center;
- font-size: 1.1em;
+dd.lastpost > span, ul.topiclist dd.info > span, ul.topiclist dd.time > span, dd.redirect > span, dd.moderation > span {
+ display: block;
+ padding-left: 5px;
}
-dd.mark {
- float: right !important;
- width: 9%;
- text-align: center;
+dd.extra, dd.mark {
line-height: 200%;
- font-size: 1.2em;
-}
-
-dd.info {
- width: 30%;
}
dd.option {
- width: 15%;
+ width: 125px;
line-height: 200%;
text-align: center;
font-size: 1.1em;
}
-dd.searchby {
- width: 47%;
- font-size: 1.1em;
- line-height: 1em;
-}
-
-ul.topiclist dd.searchextra {
- margin-left: 5px;
- padding: 0.2em 0;
- font-size: 1.1em;
- color: #333333;
- border-left: none;
- clear: both;
- width: 98%;
- overflow: hidden;
-}
-
-/* Container for post/reply buttons and pagination */
-.topic-actions {
- margin-bottom: 3px;
- font-size: 1.1em;
- height: 28px;
- min-height: 28px;
-}
-div[class].topic-actions {
- height: auto;
-}
-
/* Post body styles
----------------------------------------*/
.postbody {
padding: 0;
line-height: 1.48em;
- color: #333333;
width: 76%;
float: left;
- clear: both;
+ position: relative;
}
.postbody .ignore {
@@ -245,9 +247,11 @@ div[class].topic-actions {
.postbody h3 {
/* Postbody requires a different h3 format - so change it here */
+ float: left;
font-size: 1.5em;
padding: 2px 0 0 0;
- margin: 0 0 0.3em 0 !important;
+ margin-top: 0 !important;
+ margin-bottom: 0.3em !important;
text-transform: none;
border: none;
font-family: "Trebuchet MS", Verdana, Helvetica, Arial, sans-serif;
@@ -255,12 +259,25 @@ div[class].topic-actions {
}
.postbody h3 img {
- /* Also see tweaks.css */
vertical-align: bottom;
}
+.has-profile .postbody h3 {
+ /* If there is a post-profile, we position the post-buttons differently */
+ float: none !important;
+ margin-right: 180px;
+}
+
.postbody .content {
font-size: 1.3em;
+ overflow-x: auto;
+}
+
+.postbody img.postimage {
+ max-width: 100%;
+ -webkit-box-sizing: border-box;
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
}
.search .postbody {
@@ -300,34 +317,27 @@ div[class].topic-actions {
/* MCP Post details
----------------------------------------*/
-#post_details
-{
+#post_details {
/* This will only work in IE7+, plus the others */
overflow: auto;
max-height: 300px;
}
-#expand
-{
- clear: both;
-}
-
/* Content container styles
----------------------------------------*/
.content {
+ clear: both;
min-height: 3em;
overflow: hidden;
line-height: 1.4em;
font-family: "Lucida Grande", "Trebuchet MS", Verdana, Helvetica, Arial, sans-serif;
font-size: 1em;
- color: #333333;
padding-bottom: 1px;
}
.content h2, .panel h2 {
font-weight: normal;
- color: #989898;
- border-bottom: 1px solid #CCCCCC;
+ border-bottom: 1px solid transparent;
font-size: 1.6em;
margin-top: 0.5em;
margin-bottom: 0.5em;
@@ -361,7 +371,6 @@ dl.faq {
dl.faq dt {
font-weight: bold;
- color: #333333;
}
.content dl.faq {
@@ -379,24 +388,17 @@ dl.faq dt {
}
.posthilit {
- background-color: #f3f3f3;
- color: #BCBCBC;
padding: 0 2px 1px 2px;
}
-.announce, .unreadpost {
- /* Highlight the announcements & unread posts box */
- border-left-color: #BCBCBC;
- border-right-color: #BCBCBC;
-}
-
/* Post author */
p.author {
- margin: 0 15em 0.6em 0;
+ margin-bottom: 0.6em;
padding: 0 0 5px 0;
font-family: Verdana, Helvetica, Arial, sans-serif;
font-size: 1em;
line-height: 1.2em;
+ clear: both;
}
/* Post signature */
@@ -404,13 +406,18 @@ p.author {
margin-top: 1.5em;
padding-top: 0.2em;
font-size: 1.1em;
- border-top: 1px solid #CCCCCC;
+ border-top: 1px solid transparent;
clear: left;
line-height: 140%;
overflow: hidden;
width: 100%;
}
+.signature.standalone {
+ border-top-width: 0;
+ margin-top: 0;
+}
+
dd .signature {
margin: 0;
padding: 0;
@@ -434,7 +441,7 @@ dd .signature {
margin-top: 1.5em;
padding-top: 0.2em;
font-size: 1em;
- border-top: 1px dashed #CCCCCC;
+ border-top: 1px dashed transparent;
clear: left;
line-height: 130%;
}
@@ -450,8 +457,8 @@ ul.searchresults {
----------------------------------------*/
/* Quote block */
blockquote {
- background: #ebebeb none 6px 8px no-repeat;
- border: 1px solid #dbdbdb;
+ background: transparent none 6px 8px no-repeat;
+ border: 1px solid transparent;
font-size: 0.95em;
margin: 0.5em 1px 0 25px;
overflow: hidden;
@@ -460,14 +467,8 @@ blockquote {
blockquote blockquote {
/* Nested quotes */
- background-color: #bababa;
font-size: 1em;
- margin: 0.5em 1px 0 15px;
-}
-
-blockquote blockquote blockquote {
- /* Nested quotes */
- background-color: #e4e4e4;
+ margin: 0.5em 1px 0 15px;
}
blockquote cite {
@@ -488,61 +489,52 @@ blockquote.uncited {
}
/* Code block */
-dl.codebox {
+.codebox {
padding: 3px;
- background-color: #FFFFFF;
- border: 1px solid #d8d8d8;
+ border: 1px solid transparent;
font-size: 1em;
+ overflow-x: scroll;
+ word-wrap: normal;
}
-dl.codebox dt {
+.codebox p {
text-transform: uppercase;
- border-bottom: 1px solid #CCCCCC;
+ border-bottom: 1px solid transparent;
margin-bottom: 3px;
- font-size: 0.8em;
+ font-size: 0.8em !important;
font-weight: bold;
display: block;
}
-blockquote dl.codebox {
+blockquote .codebox {
margin-left: 0;
}
-dl.codebox code {
- /* Also see tweaks.css */
+.codebox code {
overflow: auto;
display: block;
height: auto;
max-height: 200px;
white-space: normal;
padding-top: 5px;
- font: 0.9em Monaco, "Andale Mono","Courier New", Courier, mono;
+ font: 0.9em Monaco, "Andale Mono","Courier New", Courier, monospace;
line-height: 1.3em;
- color: #8b8b8b;
margin: 2px 0;
}
-.syntaxbg { color: #FFFFFF; }
-.syntaxcomment { color: #000000; }
-.syntaxdefault { color: #bcbcbc; }
-.syntaxhtml { color: #000000; }
-.syntaxkeyword { color: #585858; }
-.syntaxstring { color: #a7a7a7; }
-
/* Attachments
----------------------------------------*/
.attachbox {
float: left;
- width: auto;
+ width: auto;
+ max-width: 100%;
margin: 5px 5px 5px 0;
padding: 6px;
- background-color: #FFFFFF;
- border: 1px dashed #d8d8d8;
+ border: 1px dashed transparent;
clear: left;
-}
-
-.pm-message .attachbox {
- background-color: #f3f3f3;
+ -webkit-box-sizing: border-box;
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
}
.attachbox dt {
@@ -554,7 +546,8 @@ dl.codebox code {
margin-top: 4px;
padding-top: 4px;
clear: left;
- border-top: 1px solid #d8d8d8;
+ border-top: 1px solid transparent;
+ overflow-x: auto;
}
.attachbox dd dd {
@@ -563,7 +556,6 @@ dl.codebox code {
.attachbox p {
line-height: 110%;
- color: #666666;
font-weight: normal;
clear: left;
}
@@ -571,20 +563,17 @@ dl.codebox code {
.attachbox p.stats
{
line-height: 110%;
- color: #666666;
font-weight: normal;
clear: left;
}
.attach-image {
margin: 3px 0;
- width: 100%;
- max-height: 350px;
- overflow: auto;
+ max-width: 100%;
}
.attach-image img {
- border: 1px solid #999999;
+ border: 1px solid transparent;
/* cursor: move; */
cursor: default;
}
@@ -613,19 +602,17 @@ dl.file dt {
}
dl.file dd {
- color: #666666;
margin: 0;
- padding: 0;
+ padding: 0;
}
dl.thumbnail img {
padding: 3px;
- border: 1px solid #666666;
- background-color: #FFF;
+ border: 1px solid transparent;
+ box-sizing: border-box;
}
dl.thumbnail dd {
- color: #666666;
font-style: italic;
font-family: Verdana, Arial, Helvetica, sans-serif;
}
@@ -634,12 +621,8 @@ dl.thumbnail dd {
font-size: 100%;
}
-dl.thumbnail dt a:hover {
- background-color: #EEEEEE;
-}
-
dl.thumbnail dt a:hover img {
- border: 1px solid #d2d2d2;
+ border: 1px solid transparent;
}
/* Post poll styles
@@ -650,15 +633,13 @@ fieldset.polls {
fieldset.polls dl {
margin-top: 5px;
- border-top: 1px solid #e2e2e2;
+ border-top: 1px solid transparent;
padding: 5px 0 0 0;
line-height: 120%;
- color: #666666;
}
fieldset.polls dl.voted {
font-weight: bold;
- color: #000000;
}
fieldset.polls dt {
@@ -692,72 +673,93 @@ fieldset.polls dd input {
fieldset.polls dd div {
text-align: right;
font-family: Arial, Helvetica, sans-serif;
- color: #FFFFFF;
font-weight: bold;
- padding: 0 2px;
+ padding: 2px 2px 0 2px;
overflow: visible;
- min-width: 2%;
-}
-
-.pollbar1 {
- background-color: #aaaaaa;
- border-bottom: 1px solid #747474;
- border-right: 1px solid #747474;
-}
-
-.pollbar2 {
- background-color: #bebebe;
- border-bottom: 1px solid #8c8c8c;
- border-right: 1px solid #8c8c8c;
+ min-width: 8px;
}
-.pollbar3 {
- background-color: #D1D1D1;
- border-bottom: 1px solid #aaaaaa;
- border-right: 1px solid #aaaaaa;
+.pollbar1, .pollbar2, .pollbar3, .pollbar4, .pollbar5 {
+ border-bottom: 1px solid transparent;
+ border-right: 1px solid transparent;
}
-.pollbar4 {
- background-color: #e4e4e4;
- border-bottom: 1px solid #bebebe;
- border-right: 1px solid #bebebe;
-}
-
-.pollbar5 {
- background-color: #f8f8f8;
- border-bottom: 1px solid #D1D1D1;
- border-right: 1px solid #D1D1D1;
+.vote-submitted {
+ font-size: 1.2em;
+ font-weight: bold;
+ text-align: center;
}
/* Poster profile block
----------------------------------------*/
.postprofile {
- /* Also see tweaks.css */
margin: 5px 0 10px 0;
min-height: 80px;
- color: #666666;
- border-left: 1px solid #FFFFFF;
+ border: 1px solid transparent;
+ border-width: 0 0 0 1px;
width: 22%;
float: right;
display: inline;
}
-.pm .postprofile {
- border-left: 1px solid #DDDDDD;
-}
.postprofile dd, .postprofile dt {
line-height: 1.2em;
margin-left: 8px;
}
+.postprofile dd {
+ overflow: hidden;
+ text-overflow: ellipsis;
+}
+
.postprofile strong {
font-weight: normal;
- color: #000000;
}
-.avatar {
- border: none;
+.postprofile dt.no-profile-rank, .postprofile dd.profile-rank, .postprofile .search-result-date {
+ margin-bottom: 10px;
+}
+
+/* Post-profile avatars */
+.postprofile .has-avatar .avatar-container {
margin-bottom: 3px;
+ overflow: hidden;
+}
+
+.postprofile .avatar {
+ display: block;
+ float: left;
+ max-width: 100%;
+}
+
+.postprofile .avatar img {
+ display: block;
+ height: auto !important;
+ max-width: 100%;
+}
+
+.postprofile .profile-posts a {
+ font-weight: normal;
+}
+
+dd.profile-warnings {
+ font-weight: bold;
+}
+
+dd.profile-contact {
+ overflow: visible;
+}
+
+.profile-contact .dropdown-container {
+ display: inline-block;
+}
+
+.profile-contact .icon_contact {
+ vertical-align: middle;
+}
+
+.profile-contact .dropdown {
+ margin-right: -14px;
}
.online {
@@ -771,6 +773,11 @@ fieldset.polls dd div {
width: 30%;
}
+/* Profile used on view-profile */
+.profile-avatar img {
+ max-width: 100%;
+}
+
/* pm list in compose message if mass pm is enabled */
dl.pmlist dt {
width: 60% !important;
@@ -783,4 +790,61 @@ dl.pmlist dt textarea {
dl.pmlist dd {
margin-left: 61% !important;
margin-bottom: 2px;
-} \ No newline at end of file
+}
+
+.action-bar div.dl_links {
+ padding: 10px 0 0 10px;
+}
+
+div.dl_links {
+ display: inline-block;
+ text-transform: none;
+}
+
+.dl_links strong {
+ font-weight: bold;
+}
+
+.dl_links ul {
+ list-style-type: none;
+ margin: 0;
+ display: inline-block;
+}
+
+.dl_links li {
+ display: inline-block;
+}
+
+.attachment-filename {
+ width: 100%;
+}
+
+.ellipsis-text {
+ display: inline-block;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+
+table.fixed-width-table {
+ table-layout: fixed;
+}
+
+/* Show scrollbars for items with overflow on iOS devices
+----------------------------------------*/
+.postbody .content::-webkit-scrollbar, #topicreview::-webkit-scrollbar, #post_details::-webkit-scrollbar, .codebox code::-webkit-scrollbar, .attachbox dd::-webkit-scrollbar, .attach-image::-webkit-scrollbar, .dropdown-extended ul::-webkit-scrollbar {
+ width: 8px;
+ height: 8px;
+ -webkit-appearance: none;
+ background: rgba(0, 0, 0, .1);
+ border-radius: 3px;
+}
+
+.postbody .content::-webkit-scrollbar-thumb, #topicreview::-webkit-scrollbar-thumb, #post_details::-webkit-scrollbar-thumb, .codebox code::-webkit-scrollbar-thumb, .attachbox dd::-webkit-scrollbar-thumb, .attach-image::-webkit-scrollbar-thumb, .dropdown-extended ul::-webkit-scrollbar-thumb {
+ background: rgba(0, 0, 0, .3);
+ border-radius: 3px;
+}
+
+#memberlist tr.inactive, #team tr.inactive {
+ font-style: italic;
+}
diff --git a/phpBB/styles/prosilver/theme/cp.css b/phpBB/styles/prosilver/theme/cp.css
index 7c7158bd00..8a223f653f 100644
--- a/phpBB/styles/prosilver/theme/cp.css
+++ b/phpBB/styles/prosilver/theme/cp.css
@@ -20,65 +20,48 @@
padding: 0;
}
-#cp-main h3, #cp-main hr, #cp-menu hr {
- border-color: #bfbfbf;
-}
-
-#cp-main .panel p {
+.panel-container .panel p {
font-size: 1.1em;
}
-#cp-main .panel ol {
+.panel-container .panel ol {
margin-left: 2em;
font-size: 1.1em;
}
-#cp-main .panel li.row {
- border-bottom: 1px solid #cbcbcb;
- border-top: 1px solid #F9F9F9;
+.panel-container .panel li.row {
+ border-bottom: 1px solid transparent;
+ border-top: 1px solid transparent;
}
ul.cplist {
margin-bottom: 5px;
- border-top: 1px solid #cbcbcb;
+ border-top: 1px solid transparent;
}
-#cp-main .panel li.header dd, #cp-main .panel li.header dt {
- color: #000000;
+.panel-container .panel li.header dd, .panel-container .panel li.header dt {
margin-bottom: 2px;
}
-#cp-main table.table1 {
+.panel-container table.table1 {
margin-bottom: 1em;
}
-#cp-main table.table1 thead th {
- color: #333333;
+.panel-container table.table1 thead th {
font-weight: bold;
- border-bottom: 1px solid #333333;
+ border-bottom: 1px solid transparent;
padding: 5px;
}
-#cp-main table.table1 tbody th {
+.panel-container table.table1 tbody th {
font-style: italic;
background-color: transparent !important;
border-bottom: none;
}
-#cp-main .pagination {
- float: right;
- width: auto;
- padding-top: 1px;
-}
-
-#cp-main .postbody p {
- font-size: 1.1em;
-}
-
#cp-main .pm-message {
- border: 1px solid #e2e2e2;
+ border: 1px solid transparent;
margin: 10px 0;
- background-color: #FFFFFF;
width: auto;
float: none;
}
@@ -91,6 +74,10 @@ ul.cplist {
margin-top: 0;
}
+.panel-container .postbody p.author {
+ font-size: 1.1em;
+}
+
#cp-main .buttons {
margin-left: 0;
}
@@ -109,126 +96,122 @@ ul.cplist {
margin-bottom: 0px;
}
-.tabs-container #minitabs {
- float: right;
- margin-top: 19px;
-}
-
-.tabs-container:after {
- display: block;
- clear: both;
- content: '';
-}
-
-/* CP tabbed menu
+/* CP tabs shared
----------------------------------------*/
-#tabs {
+#tabs, #minitabs {
line-height: normal;
- margin: 20px 0 -1px 7px;
- min-width: 570px;
}
-#tabs ul {
- margin:0;
- padding: 0;
+#tabs > ul, #minitabs > ul {
list-style: none;
-}
-
-#tabs li {
- display: inline;
margin: 0;
padding: 0;
- font-size: 1em;
- font-weight: bold;
+ position: relative;
}
-#tabs a {
+#tabs .tab, #minitabs .tab {
+ display: block;
float: left;
- background: none no-repeat 0% -35px;
- margin: 0 1px 0 0;
- padding: 0 0 0 5px;
- text-decoration: none;
- position: relative;
- cursor: pointer;
+ font-size: 1em;
+ font-weight: bold;
+ line-height: 1.4em;
}
-#tabs a span {
- float: left;
+#tabs .tab > a, #minitabs .tab > a {
display: block;
- background: none no-repeat 100% -35px;
- padding: 6px 10px 6px 5px;
- color: #828282;
+ padding: 5px 9px;
+ position: relative;
+ text-decoration: none;
white-space: nowrap;
+ cursor: pointer;
}
-#tabs a:hover span {
- color: #bcbcbc;
+/* CP tabbed menu
+----------------------------------------*/
+#tabs {
+ margin: 20px 0 0 7px;
}
-#tabs .activetab a {
- background-position: 0 0;
- border-bottom: 1px solid #ebebeb;
+#tabs .tab > a {
+ border: 1px solid transparent;
+ border-radius: 4px 4px 0 0;
+ margin: 1px 1px 0 0;
}
-#tabs .activetab a span {
- background-position: 100% 0;
+#tabs .activetab > a {
+ margin-top: 0;
padding-bottom: 7px;
- color: #333333;
}
-#tabs a:hover {
- background-position: 0 -70px;
+/* Mini tabbed menu used in MCP
+----------------------------------------*/
+#minitabs {
+ float: right;
+ margin: 15px 7px 0 0;
+ max-width: 50%;
}
-#tabs a:hover span {
- background-position:100% -70px;
+#minitabs .tab {
+ float: right;
}
-#tabs .activetab a:hover {
- background-position: 0 0;
+#minitabs .tab > a {
+ border-radius: 5px 5px 0 0;
+ margin-left: 2px;
}
-#tabs .activetab a:hover span {
- color: #000000;
- background-position: 100% 0;
+#minitabs .tab > a:hover {
+ text-decoration: none;
}
-/* Mini tabbed menu used in MCP
+/* Responsive tabs
----------------------------------------*/
-#minitabs {
- line-height: normal;
- margin: -20px 7px 0 0;
+.responsive-tab {
+ position: relative;
}
-#minitabs ul {
- margin:0;
- padding: 0;
- list-style: none;
+.responsive-tab > a.responsive-tab-link {
+ display: block;
+ font-size: 1.6em;
+ position: relative;
+ width: 16px;
+ line-height: 0.9em;
+ text-decoration: none;
}
-#minitabs li {
- display: block;
- float: right;
- padding: 0 10px 4px 10px;
- font-size: 1em;
- font-weight: bold;
- background-color: #f2f2f2;
- margin-left: 2px;
+.responsive-tab .responsive-tab-link:before {
+ content: '';
+ position: absolute;
+ left: 10px;
+ top: 7px;
+ height: .125em;
+ width: 14px;
+ border-bottom: 0.125em solid transparent;
+ border-top: 0.375em double transparent;
+}
+
+#tabs .dropdown, #minitabs .dropdown {
+ top: 20px;
+ margin-right: -2px;
+ font-size: 1.1em;
+ font-weight: normal;
}
-#minitabs a {
+#minitabs .dropdown {
+ margin-right: -4px;
}
-#minitabs a:hover {
- text-decoration: none;
+#tabs .dropdown-up .dropdown, #minitabs .dropdown-up .dropdown {
+ bottom: 20px;
+ top: auto;
}
-#minitabs li.activetab {
- background-color: #F9F9F9;
+#tabs .dropdown li {
+ text-align: right;
}
-#minitabs li.activetab a, #minitabs li.activetab a:hover {
- color: #333333;
+#minitabs .dropdown li {
+ text-align: left;
}
/* UCP navigation menu
@@ -240,15 +223,15 @@ ul.cplist {
}
#navigation ul {
- list-style:none;
+ list-style: none;
}
/* Default list state */
#navigation li {
+ display: inline;
+ font-weight: bold;
margin: 1px 0;
padding: 0;
- font-weight: bold;
- display: inline;
}
/* Link styles for the sub-section links */
@@ -257,27 +240,10 @@ ul.cplist {
padding: 5px;
margin: 1px 0;
text-decoration: none;
- font-weight: bold;
- color: #333;
- background: #cfcfcf none repeat-y 100% 0;
}
#navigation a:hover {
text-decoration: none;
- background-color: #c6c6c6;
- color: #bcbcbc;
- background-image: none;
-}
-
-#navigation #active-subsection a {
- display: block;
- color: #d3d3d3;
- background-color: #F9F9F9;
- background-image: none;
-}
-
-#navigation #active-subsection a:hover {
- color: #d3d3d3;
}
/* Preferences pane layout
@@ -286,64 +252,19 @@ ul.cplist {
border-bottom: none;
padding: 0;
margin-left: 10px;
- color: #333333;
-}
-
-#cp-main .panel {
- background-color: #F9F9F9;
-}
-
-#cp-main .pm {
- background-color: #FFFFFF;
-}
-
-#cp-main span.corners-top, #cp-menu span.corners-top {
- background-image: none;
-}
-
-#cp-main span.corners-top span, #cp-menu span.corners-top span {
- background-image: none;
-}
-
-#cp-main span.corners-bottom, #cp-menu span.corners-bottom {
- background-image: none;
-}
-
-#cp-main span.corners-bottom span, #cp-menu span.corners-bottom span {
- background-image: none;
-}
-
-/* Topicreview */
-#cp-main .panel #topicreview span.corners-top, #cp-menu .panel #topicreview span.corners-top {
- background-image: none;
-}
-
-#cp-main .panel #topicreview span.corners-top span, #cp-menu .panel #topicreview span.corners-top span {
- background-image: none;
-}
-
-#cp-main .panel #topicreview span.corners-bottom, #cp-menu .panel #topicreview span.corners-bottom {
- background-image: none;
-}
-
-#cp-main .panel #topicreview span.corners-bottom span, #cp-menu .panel #topicreview span.corners-bottom span {
- background-image: none;
}
/* Friends list */
.cp-mini {
- background-color: #f9f9f9;
- padding: 0 5px;
margin: 10px 15px 10px 5px;
-}
-
-.cp-mini span.corners-top, .cp-mini span.corners-bottom {
- margin: 0 -5px;
+ max-height: 200px;
+ overflow-y: auto;
+ padding: 5px 10px;
+ border-radius: 7px;
}
dl.mini dt {
font-weight: bold;
- color: #676767;
}
dl.mini dd {
@@ -364,25 +285,6 @@ dl.mini dd {
line-height: 2.5em;
}
-/* PM panel adjustments */
-.reply-all a.left {
- background-position: 3px 60%;
-}
-
-.reply-all a.left:hover {
- background-position: 0px 60%;
-}
-
-.reply-all {
- font-size: 11px;
- padding-top: 5px;
-}
-
-/* PM Message history */
-.current {
- color: #999999;
-}
-
/* Defined rules list for PM options */
ol.def-rules {
padding-left: 0;
@@ -403,31 +305,16 @@ ol.def-rules li {
}
.pmlist li.pm_message_reported_colour, .pm_message_reported_colour {
- border-left-color: #bcbcbc;
- border-right-color: #bcbcbc;
-}
-
-.pmlist li.pm_marked_colour, .pm_marked_colour {
- padding: 0;
- border: solid 3px #ffffff;
- border-width: 0 3px;
-}
-
-.pmlist li.pm_replied_colour, .pm_replied_colour {
- padding: 0;
- border: solid 3px #c2c2c2;
- border-width: 0 3px;
-}
-
-.pmlist li.pm_friend_colour, .pm_friend_colour {
- padding: 0;
- border: solid 3px #bdbdbd;
- border-width: 0 3px;
+ border-left-color: transparent;
+ border-right-color: transparent;
}
+.pmlist li.pm_marked_colour, .pm_marked_colour,
+.pmlist li.pm_replied_colour, .pm_replied_colour,
+.pmlist li.pm_friend_colour, .pm_friend_colour,
.pmlist li.pm_foe_colour, .pm_foe_colour {
padding: 0;
- border: solid 3px #000000;
+ border: solid 3px transparent;
border-width: 0 3px;
}
@@ -446,11 +333,44 @@ ol.def-rules li {
margin: 10px;
padding: 5px;
width: auto;
- background: #FFFFFF;
- border: 1px solid #CCC;
+ border: 1px solid transparent;
text-align: center;
}
-#gallery label:hover {
- background-color: #EEE;
+/* Responsive *CP navigation
+----------------------------------------*/
+@media only screen and (max-width: 900px), only screen and (max-device-width: 900px)
+{
+ .nojs #tabs a span, .nojs #minitabs a span {
+ max-width: 40px;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ letter-spacing: -.5px;
+ }
+
+ #cp-menu, #navigation, #cp-main {
+ float: none;
+ width: auto;
+ margin: 0;
+ }
+
+ #navigation {
+ padding: 0;
+ margin: 0 auto;
+ max-width: 320px;
+ }
+
+ #navigation a {
+ background-image: none;
+ }
+
+ #navigation li:first-child a {
+ border-top-left-radius: 5px;
+ border-top-right-radius: 5px;
+ }
+
+ #navigation li:last-child a {
+ border-bottom-left-radius: 5px;
+ border-bottom-right-radius: 5px;
+ }
}
diff --git a/phpBB/styles/prosilver/imageset/de/icon_user_online.gif b/phpBB/styles/prosilver/theme/en/icon_user_online.gif
index 6b571ffce0..6b571ffce0 100644
--- a/phpBB/styles/prosilver/imageset/de/icon_user_online.gif
+++ b/phpBB/styles/prosilver/theme/en/icon_user_online.gif
Binary files differ
diff --git a/phpBB/styles/prosilver/theme/en/stylesheet.css b/phpBB/styles/prosilver/theme/en/stylesheet.css
new file mode 100644
index 0000000000..bf4bd31ffc
--- /dev/null
+++ b/phpBB/styles/prosilver/theme/en/stylesheet.css
@@ -0,0 +1,8 @@
+/* Online image */
+.online { background-image: url("./icon_user_online.gif"); }
+
+.imageset.icon_user_online {
+ background-image: url("./icon_user_online.gif");
+ padding-left: 58px;
+ padding-top: 58px;
+}
diff --git a/phpBB/styles/prosilver/theme/forms.css b/phpBB/styles/prosilver/theme/forms.css
index 3926da7139..235c230ed4 100644
--- a/phpBB/styles/prosilver/theme/forms.css
+++ b/phpBB/styles/prosilver/theme/forms.css
@@ -11,7 +11,6 @@ fieldset {
input {
font-weight: normal;
- cursor: pointer;
vertical-align: middle;
padding: 0 3px;
font-size: 1em;
@@ -23,9 +22,8 @@ select {
font-weight: normal;
cursor: pointer;
vertical-align: middle;
- border: 1px solid #666666;
+ border: 1px solid transparent;
padding: 1px;
- background-color: #FAFAFA;
font-size: 1em;
}
@@ -37,8 +35,9 @@ option {
padding-right: 1em;
}
-option.disabled-option {
- color: graytext;
+select optgroup option {
+ padding-right: 1em;
+ font-family: Verdana, Helvetica, Arial, sans-serif;
}
textarea {
@@ -52,7 +51,6 @@ textarea {
label {
cursor: default;
padding-right: 5px;
- color: #676767;
}
label input {
@@ -70,7 +68,7 @@ fieldset dl {
}
fieldset dt {
- float: left;
+ float: left;
width: 40%;
text-align: left;
display: block;
@@ -93,16 +91,12 @@ fieldset.fields1 dd {
border-left-width: 0;
}
-fieldset.fields1 {
- background-color: transparent;
-}
-
fieldset.fields1 div {
margin-bottom: 3px;
}
/* Set it back to 0px for the reCaptcha divs: PHPBB3-9587 */
-fieldset.fields1 #recaptcha_widget_div div {
+fieldset.fields1 #recaptcha_widget_div div, fieldset.fields1 .live-search div {
margin-bottom: 0;
}
@@ -125,7 +119,6 @@ dt label {
dd label {
white-space: nowrap;
- color: #333;
}
dd input, dd textarea {
@@ -136,27 +129,19 @@ dd select {
width: auto;
}
+dd select[multiple] {
+ width: 100%;
+}
+
dd textarea {
width: 85%;
}
/* Hover effects */
-fieldset dl:hover dt label {
- color: #000000;
-}
-
-fieldset.fields2 dl:hover dt label {
- color: inherit;
-}
-
#timezone {
width: 95%;
}
-* html #timezone {
- width: 50%;
-}
-
/* Quick-login on index page */
fieldset.quick-login {
margin-top: 5px;
@@ -170,7 +155,6 @@ fieldset.quick-login input.inputbox {
width: 15%;
vertical-align: middle;
margin-right: 5px;
- background-color: #f3f3f3;
}
fieldset.quick-login label {
@@ -221,20 +205,6 @@ fieldset.forum-selection2 {
float: right;
}
-/* Jumpbox */
-fieldset.jumpbox {
- text-align: right;
- margin-top: 15px;
- height: 2.5em;
-}
-
-fieldset.quickmod {
- width: 50%;
- float: right;
- text-align: right;
- height: 2.5em;
-}
-
/* Submit button fieldset */
fieldset.submit-buttons {
text-align: center;
@@ -272,7 +242,14 @@ fieldset.submit-buttons input {
min-width: 100%;
max-width: 100%;
font-size: 1.2em;
- color: #333333;
+ resize: vertical;
+ outline: 3px dashed transparent;
+ outline-offset: -4px;
+ -webkit-transition: all .5s ease;
+ -moz-transition: all .5s ease;
+ -ms-transition: all .5s ease;
+ -o-transition: all .5s ease;
+ transition: all .5s ease;
}
/* Emoticons panel */
@@ -288,27 +265,19 @@ fieldset.submit-buttons input {
/* Input field styles
---------------------------------------- */
.inputbox {
- background-color: #FFFFFF;
- border: 1px solid #c0c0c0;
- color: #333333;
+ border: 1px solid transparent;
padding: 2px;
- cursor: text;
-}
-
-.inputbox:hover {
- border: 1px solid #eaeaea;
}
-.inputbox:focus {
- border: 1px solid #eaeaea;
- color: #4b4b4b;
+.inputbox:hover, .inputbox:focus {
+ border: 1px solid transparent;
outline-style: none;
}
input.inputbox { width: 85%; }
input.medium { width: 50%; }
input.narrow { width: 25%; }
-input.tiny { width: 125px; }
+input.tiny { width: 150px; }
textarea.inputbox {
width: 85%;
@@ -318,6 +287,23 @@ textarea.inputbox {
width: auto !important;
}
+input[type="number"] {
+ -moz-padding-end: 0;
+}
+
+input[type="search"] {
+ -webkit-appearance: textfield;
+ -webkit-box-sizing: content-box;
+}
+
+input[type="search"]::-webkit-search-decoration, input[type="search"]::-webkit-search-results-button, input[type="search"]::-webkit-search-results-decoration {
+ display: none;
+}
+
+input[type="search"]::-webkit-search-cancel-button {
+ cursor: pointer;
+}
+
/* Form button styles
---------------------------------------- */
input.button1, input.button2 {
@@ -329,13 +315,12 @@ a.button1, input.button1, input.button3, a.button2, input.button2 {
padding-top: 1px;
padding-bottom: 1px;
font-family: "Lucida Grande", Verdana, Helvetica, Arial, sans-serif;
- color: #000;
- background: #FAFAFA none repeat-x top left;
+ background: transparent none repeat-x top left;
}
a.button1, input.button1 {
font-weight: bold;
- border: 1px solid #666666;
+ border: 1px solid transparent;
}
input.button3 {
@@ -347,15 +332,18 @@ input.button3 {
font-variant: small-caps;
}
+input[type="button"], input[type="submit"], input[type="reset"], input[type="checkbox"], input[type="radio"] {
+ cursor: pointer;
+}
+
/* Alternative button */
a.button2, input.button2, input.button3 {
- border: 1px solid #666666;
+ border: 1px solid transparent;
}
/* <a> button in the style of the form buttons */
a.button1, a.button1:link, a.button1:visited, a.button1:active, a.button2, a.button2:link, a.button2:visited, a.button2:active {
text-decoration: none;
- color: #000000;
padding: 2px 8px;
line-height: 250%;
vertical-align: text-bottom;
@@ -364,14 +352,12 @@ a.button1, a.button1:link, a.button1:visited, a.button1:active, a.button2, a.but
/* Hover states */
a.button1:hover, input.button1:hover, a.button2:hover, input.button2:hover, input.button3:hover {
- border: 1px solid #BCBCBC;
+ border: 1px solid transparent;
background-position: 0 100%;
- color: #BCBCBC;
}
input.disabled {
font-weight: normal;
- color: #666666;
}
/* Focus states */
@@ -381,12 +367,62 @@ input.button1:focus, input.button2:focus, input.button3:focus {
/* Topic and forum Search */
.search-box {
- margin-top: 3px;
- margin-left: 5px;
float: left;
}
-.search-box input {
+.search-box .inputbox {
+ background-image: none;
+ border-right-width: 0;
+ border-radius: 4px 0 0 4px;
+ float: left;
+ height: 24px;
+ padding: 3px;
+ -webkit-box-sizing: border-box;
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
+}
+
+.search-box button {
+ float: left;
+}
+
+.search-box button.search-icon {
+ border-radius: 0;
+ font-size: 0;
+ height: 24px;
+ margin: 0;
+ padding: 3px 5px;
+}
+
+.search-box a.button {
+ border-left-width: 0;
+ border-radius: 0 4px 4px 0;
+ font-size: 0;
+ margin: 0;
+ padding: 2px 5px 2px 3px;
+}
+
+/* Search box (header)
+--------------------------------------------- */
+.search-header {
+ border-radius: 4px;
+ display: block;
+ float: right;
+ margin-right: 5px;
+ margin-top: 30px;
+}
+
+.search-header .inputbox { border: 0; }
+
+.search-header button {
+ border-top: 0;
+ border-bottom: 0;
+}
+
+.search-header a.button {
+ border: 0;
+ border-left: 1px;
+ padding: 3px 5px 3px 4px;
}
input.search {
@@ -400,4 +436,3 @@ input.search {
.medium { width: 50%;}
.narrow { width: 25%;}
.tiny { width: 10%;}
-
diff --git a/phpBB/styles/prosilver/imageset/Mageia_logo.png b/phpBB/styles/prosilver/theme/images/Mageia_logo.png
index cc757380d8..cc757380d8 100644
--- a/phpBB/styles/prosilver/imageset/Mageia_logo.png
+++ b/phpBB/styles/prosilver/theme/images/Mageia_logo.png
Binary files differ
diff --git a/phpBB/styles/prosilver/theme/images/alert_close.png b/phpBB/styles/prosilver/theme/images/alert_close.png
new file mode 100644
index 0000000000..79750a013c
--- /dev/null
+++ b/phpBB/styles/prosilver/theme/images/alert_close.png
Binary files differ
diff --git a/phpBB/styles/prosilver/theme/images/announce_read.gif b/phpBB/styles/prosilver/theme/images/announce_read.gif
new file mode 100644
index 0000000000..9457870e6f
--- /dev/null
+++ b/phpBB/styles/prosilver/theme/images/announce_read.gif
Binary files differ
diff --git a/phpBB/styles/prosilver/imageset/announce_read_locked.gif b/phpBB/styles/prosilver/theme/images/announce_read_locked.gif
index 76ead8a02c..76ead8a02c 100644
--- a/phpBB/styles/prosilver/imageset/announce_read_locked.gif
+++ b/phpBB/styles/prosilver/theme/images/announce_read_locked.gif
Binary files differ
diff --git a/phpBB/styles/prosilver/imageset/announce_read_locked_mine.gif b/phpBB/styles/prosilver/theme/images/announce_read_locked_mine.gif
index 2105d21f10..2105d21f10 100644
--- a/phpBB/styles/prosilver/imageset/announce_read_locked_mine.gif
+++ b/phpBB/styles/prosilver/theme/images/announce_read_locked_mine.gif
Binary files differ
diff --git a/phpBB/styles/prosilver/theme/images/announce_read_mine.gif b/phpBB/styles/prosilver/theme/images/announce_read_mine.gif
new file mode 100644
index 0000000000..2c88cacca0
--- /dev/null
+++ b/phpBB/styles/prosilver/theme/images/announce_read_mine.gif
Binary files differ
diff --git a/phpBB/styles/prosilver/theme/images/announce_unread.gif b/phpBB/styles/prosilver/theme/images/announce_unread.gif
new file mode 100644
index 0000000000..33e10b2ccc
--- /dev/null
+++ b/phpBB/styles/prosilver/theme/images/announce_unread.gif
Binary files differ
diff --git a/phpBB/styles/prosilver/imageset/announce_unread_locked.gif b/phpBB/styles/prosilver/theme/images/announce_unread_locked.gif
index 76dcc6ca71..76dcc6ca71 100644
--- a/phpBB/styles/prosilver/imageset/announce_unread_locked.gif
+++ b/phpBB/styles/prosilver/theme/images/announce_unread_locked.gif
Binary files differ
diff --git a/phpBB/styles/prosilver/imageset/announce_unread_locked_mine.gif b/phpBB/styles/prosilver/theme/images/announce_unread_locked_mine.gif
index 53782fc3dc..53782fc3dc 100644
--- a/phpBB/styles/prosilver/imageset/announce_unread_locked_mine.gif
+++ b/phpBB/styles/prosilver/theme/images/announce_unread_locked_mine.gif
Binary files differ
diff --git a/phpBB/styles/prosilver/theme/images/announce_unread_mine.gif b/phpBB/styles/prosilver/theme/images/announce_unread_mine.gif
new file mode 100644
index 0000000000..bc07df0ce9
--- /dev/null
+++ b/phpBB/styles/prosilver/theme/images/announce_unread_mine.gif
Binary files differ
diff --git a/phpBB/styles/prosilver/theme/images/arrow_down.gif b/phpBB/styles/prosilver/theme/images/arrow_down.gif
index e45c365ecc..b7fbf7e276 100644
--- a/phpBB/styles/prosilver/theme/images/arrow_down.gif
+++ b/phpBB/styles/prosilver/theme/images/arrow_down.gif
Binary files differ
diff --git a/phpBB/styles/prosilver/theme/images/arrow_left.gif b/phpBB/styles/prosilver/theme/images/arrow_left.gif
index 076a5596f1..ac92cb4971 100644
--- a/phpBB/styles/prosilver/theme/images/arrow_left.gif
+++ b/phpBB/styles/prosilver/theme/images/arrow_left.gif
Binary files differ
diff --git a/phpBB/styles/prosilver/theme/images/arrow_right.gif b/phpBB/styles/prosilver/theme/images/arrow_right.gif
index c5827a401f..3a080ffdfe 100644
--- a/phpBB/styles/prosilver/theme/images/arrow_right.gif
+++ b/phpBB/styles/prosilver/theme/images/arrow_right.gif
Binary files differ
diff --git a/phpBB/styles/prosilver/theme/images/arrow_up.gif b/phpBB/styles/prosilver/theme/images/arrow_up.gif
index 38b5a62c17..0ff5872182 100644
--- a/phpBB/styles/prosilver/theme/images/arrow_up.gif
+++ b/phpBB/styles/prosilver/theme/images/arrow_up.gif
Binary files differ
diff --git a/phpBB/styles/prosilver/theme/images/bg_menu.gif b/phpBB/styles/prosilver/theme/images/bg_menu.gif
deleted file mode 100644
index 4a9f5a9174..0000000000
--- a/phpBB/styles/prosilver/theme/images/bg_menu.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/prosilver/theme/images/bg_menu_rtl.gif b/phpBB/styles/prosilver/theme/images/bg_menu_rtl.gif
deleted file mode 100644
index 10add09a17..0000000000
--- a/phpBB/styles/prosilver/theme/images/bg_menu_rtl.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/prosilver/theme/images/bg_tabs1.gif b/phpBB/styles/prosilver/theme/images/bg_tabs1.gif
deleted file mode 100644
index 335a72c711..0000000000
--- a/phpBB/styles/prosilver/theme/images/bg_tabs1.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/prosilver/theme/images/bg_tabs2.gif b/phpBB/styles/prosilver/theme/images/bg_tabs2.gif
deleted file mode 100644
index a2142d5432..0000000000
--- a/phpBB/styles/prosilver/theme/images/bg_tabs2.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/prosilver/theme/images/corners_left.gif b/phpBB/styles/prosilver/theme/images/corners_left.gif
deleted file mode 100644
index 206e50368d..0000000000
--- a/phpBB/styles/prosilver/theme/images/corners_left.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/prosilver/theme/images/corners_left.png b/phpBB/styles/prosilver/theme/images/corners_left.png
deleted file mode 100644
index 256bde3daa..0000000000
--- a/phpBB/styles/prosilver/theme/images/corners_left.png
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/prosilver/theme/images/corners_left2.gif b/phpBB/styles/prosilver/theme/images/corners_left2.gif
deleted file mode 100644
index fa27ce3ba2..0000000000
--- a/phpBB/styles/prosilver/theme/images/corners_left2.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/prosilver/theme/images/corners_right.gif b/phpBB/styles/prosilver/theme/images/corners_right.gif
deleted file mode 100644
index 0ba66d50b2..0000000000
--- a/phpBB/styles/prosilver/theme/images/corners_right.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/prosilver/theme/images/corners_right.png b/phpBB/styles/prosilver/theme/images/corners_right.png
deleted file mode 100644
index df41823b4c..0000000000
--- a/phpBB/styles/prosilver/theme/images/corners_right.png
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/prosilver/theme/images/corners_right2.gif b/phpBB/styles/prosilver/theme/images/corners_right2.gif
deleted file mode 100644
index 2d689446ee..0000000000
--- a/phpBB/styles/prosilver/theme/images/corners_right2.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/prosilver/theme/images/created_by.jpg b/phpBB/styles/prosilver/theme/images/created_by.jpg
deleted file mode 100644
index 68d56e2013..0000000000
--- a/phpBB/styles/prosilver/theme/images/created_by.jpg
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/prosilver/imageset/de/button_pm_forward.gif b/phpBB/styles/prosilver/theme/images/de/button_pm_forward.gif
index adf92b0af9..adf92b0af9 100644
--- a/phpBB/styles/prosilver/imageset/de/button_pm_forward.gif
+++ b/phpBB/styles/prosilver/theme/images/de/button_pm_forward.gif
Binary files differ
diff --git a/phpBB/styles/prosilver/imageset/de/button_pm_new.gif b/phpBB/styles/prosilver/theme/images/de/button_pm_new.gif
index f3d0f95824..f3d0f95824 100644
--- a/phpBB/styles/prosilver/imageset/de/button_pm_new.gif
+++ b/phpBB/styles/prosilver/theme/images/de/button_pm_new.gif
Binary files differ
diff --git a/phpBB/styles/prosilver/imageset/de/button_pm_reply.gif b/phpBB/styles/prosilver/theme/images/de/button_pm_reply.gif
index c99d50e11b..c99d50e11b 100644
--- a/phpBB/styles/prosilver/imageset/de/button_pm_reply.gif
+++ b/phpBB/styles/prosilver/theme/images/de/button_pm_reply.gif
Binary files differ
diff --git a/phpBB/styles/prosilver/imageset/de/button_topic_locked.gif b/phpBB/styles/prosilver/theme/images/de/button_topic_locked.gif
index 9fc1f6dc81..9fc1f6dc81 100644
--- a/phpBB/styles/prosilver/imageset/de/button_topic_locked.gif
+++ b/phpBB/styles/prosilver/theme/images/de/button_topic_locked.gif
Binary files differ
diff --git a/phpBB/styles/prosilver/imageset/de/button_topic_new.gif b/phpBB/styles/prosilver/theme/images/de/button_topic_new.gif
index 9405b4c9da..9405b4c9da 100644
--- a/phpBB/styles/prosilver/imageset/de/button_topic_new.gif
+++ b/phpBB/styles/prosilver/theme/images/de/button_topic_new.gif
Binary files differ
diff --git a/phpBB/styles/prosilver/imageset/de/button_topic_reply.gif b/phpBB/styles/prosilver/theme/images/de/button_topic_reply.gif
index c99d50e11b..c99d50e11b 100644
--- a/phpBB/styles/prosilver/imageset/de/button_topic_reply.gif
+++ b/phpBB/styles/prosilver/theme/images/de/button_topic_reply.gif
Binary files differ
diff --git a/phpBB/styles/prosilver/imageset/de/icon_contact_pm.gif b/phpBB/styles/prosilver/theme/images/de/icon_contact_pm.gif
index 389336c928..389336c928 100644
--- a/phpBB/styles/prosilver/imageset/de/icon_contact_pm.gif
+++ b/phpBB/styles/prosilver/theme/images/de/icon_contact_pm.gif
Binary files differ
diff --git a/phpBB/styles/prosilver/imageset/de/icon_post_edit.gif b/phpBB/styles/prosilver/theme/images/de/icon_post_edit.gif
index 69f3840f3c..69f3840f3c 100644
--- a/phpBB/styles/prosilver/imageset/de/icon_post_edit.gif
+++ b/phpBB/styles/prosilver/theme/images/de/icon_post_edit.gif
Binary files differ
diff --git a/phpBB/styles/prosilver/imageset/de/icon_post_quote.gif b/phpBB/styles/prosilver/theme/images/de/icon_post_quote.gif
index 325d9fd585..325d9fd585 100644
--- a/phpBB/styles/prosilver/imageset/de/icon_post_quote.gif
+++ b/phpBB/styles/prosilver/theme/images/de/icon_post_quote.gif
Binary files differ
diff --git a/phpBB/styles/prosilver/imageset/de_x_sie/icon_user_online.gif b/phpBB/styles/prosilver/theme/images/de/icon_user_online.gif
index 6b571ffce0..6b571ffce0 100644
--- a/phpBB/styles/prosilver/imageset/de_x_sie/icon_user_online.gif
+++ b/phpBB/styles/prosilver/theme/images/de/icon_user_online.gif
Binary files differ
diff --git a/phpBB/styles/prosilver/imageset/de/imageset.cfg b/phpBB/styles/prosilver/theme/images/de/imageset.cfg
index 8c07e30244..8c07e30244 100644
--- a/phpBB/styles/prosilver/imageset/de/imageset.cfg
+++ b/phpBB/styles/prosilver/theme/images/de/imageset.cfg
diff --git a/phpBB/styles/prosilver/imageset/de_x_sie/index.htm b/phpBB/styles/prosilver/theme/images/de/index.htm
index e69de29bb2..e69de29bb2 100644
--- a/phpBB/styles/prosilver/imageset/de_x_sie/index.htm
+++ b/phpBB/styles/prosilver/theme/images/de/index.htm
diff --git a/phpBB/styles/prosilver/imageset/de_x_sie/button_pm_forward.gif b/phpBB/styles/prosilver/theme/images/de_x_sie/button_pm_forward.gif
index adf92b0af9..adf92b0af9 100644
--- a/phpBB/styles/prosilver/imageset/de_x_sie/button_pm_forward.gif
+++ b/phpBB/styles/prosilver/theme/images/de_x_sie/button_pm_forward.gif
Binary files differ
diff --git a/phpBB/styles/prosilver/imageset/de_x_sie/button_pm_new.gif b/phpBB/styles/prosilver/theme/images/de_x_sie/button_pm_new.gif
index f3d0f95824..f3d0f95824 100644
--- a/phpBB/styles/prosilver/imageset/de_x_sie/button_pm_new.gif
+++ b/phpBB/styles/prosilver/theme/images/de_x_sie/button_pm_new.gif
Binary files differ
diff --git a/phpBB/styles/prosilver/imageset/de_x_sie/button_pm_reply.gif b/phpBB/styles/prosilver/theme/images/de_x_sie/button_pm_reply.gif
index c99d50e11b..c99d50e11b 100644
--- a/phpBB/styles/prosilver/imageset/de_x_sie/button_pm_reply.gif
+++ b/phpBB/styles/prosilver/theme/images/de_x_sie/button_pm_reply.gif
Binary files differ
diff --git a/phpBB/styles/prosilver/imageset/de_x_sie/button_topic_locked.gif b/phpBB/styles/prosilver/theme/images/de_x_sie/button_topic_locked.gif
index 9fc1f6dc81..9fc1f6dc81 100644
--- a/phpBB/styles/prosilver/imageset/de_x_sie/button_topic_locked.gif
+++ b/phpBB/styles/prosilver/theme/images/de_x_sie/button_topic_locked.gif
Binary files differ
diff --git a/phpBB/styles/prosilver/imageset/de_x_sie/button_topic_new.gif b/phpBB/styles/prosilver/theme/images/de_x_sie/button_topic_new.gif
index 9405b4c9da..9405b4c9da 100644
--- a/phpBB/styles/prosilver/imageset/de_x_sie/button_topic_new.gif
+++ b/phpBB/styles/prosilver/theme/images/de_x_sie/button_topic_new.gif
Binary files differ
diff --git a/phpBB/styles/prosilver/imageset/de_x_sie/button_topic_reply.gif b/phpBB/styles/prosilver/theme/images/de_x_sie/button_topic_reply.gif
index c99d50e11b..c99d50e11b 100644
--- a/phpBB/styles/prosilver/imageset/de_x_sie/button_topic_reply.gif
+++ b/phpBB/styles/prosilver/theme/images/de_x_sie/button_topic_reply.gif
Binary files differ
diff --git a/phpBB/styles/prosilver/imageset/de_x_sie/icon_contact_pm.gif b/phpBB/styles/prosilver/theme/images/de_x_sie/icon_contact_pm.gif
index 389336c928..389336c928 100644
--- a/phpBB/styles/prosilver/imageset/de_x_sie/icon_contact_pm.gif
+++ b/phpBB/styles/prosilver/theme/images/de_x_sie/icon_contact_pm.gif
Binary files differ
diff --git a/phpBB/styles/prosilver/imageset/de_x_sie/icon_post_edit.gif b/phpBB/styles/prosilver/theme/images/de_x_sie/icon_post_edit.gif
index 69f3840f3c..69f3840f3c 100644
--- a/phpBB/styles/prosilver/imageset/de_x_sie/icon_post_edit.gif
+++ b/phpBB/styles/prosilver/theme/images/de_x_sie/icon_post_edit.gif
Binary files differ
diff --git a/phpBB/styles/prosilver/imageset/de_x_sie/icon_post_quote.gif b/phpBB/styles/prosilver/theme/images/de_x_sie/icon_post_quote.gif
index 325d9fd585..325d9fd585 100644
--- a/phpBB/styles/prosilver/imageset/de_x_sie/icon_post_quote.gif
+++ b/phpBB/styles/prosilver/theme/images/de_x_sie/icon_post_quote.gif
Binary files differ
diff --git a/phpBB/styles/prosilver/imageset/en/icon_user_online.gif b/phpBB/styles/prosilver/theme/images/de_x_sie/icon_user_online.gif
index 6b571ffce0..6b571ffce0 100644
--- a/phpBB/styles/prosilver/imageset/en/icon_user_online.gif
+++ b/phpBB/styles/prosilver/theme/images/de_x_sie/icon_user_online.gif
Binary files differ
diff --git a/phpBB/styles/prosilver/imageset/de_x_sie/imageset.cfg b/phpBB/styles/prosilver/theme/images/de_x_sie/imageset.cfg
index 8c07e30244..8c07e30244 100644
--- a/phpBB/styles/prosilver/imageset/de_x_sie/imageset.cfg
+++ b/phpBB/styles/prosilver/theme/images/de_x_sie/imageset.cfg
diff --git a/phpBB/styles/prosilver/imageset/en/index.htm b/phpBB/styles/prosilver/theme/images/de_x_sie/index.htm
index e69de29bb2..e69de29bb2 100644
--- a/phpBB/styles/prosilver/imageset/en/index.htm
+++ b/phpBB/styles/prosilver/theme/images/de_x_sie/index.htm
diff --git a/phpBB/styles/prosilver/theme/images/forum_link.gif b/phpBB/styles/prosilver/theme/images/forum_link.gif
new file mode 100644
index 0000000000..efeaf0a11f
--- /dev/null
+++ b/phpBB/styles/prosilver/theme/images/forum_link.gif
Binary files differ
diff --git a/phpBB/styles/prosilver/theme/images/forum_read.gif b/phpBB/styles/prosilver/theme/images/forum_read.gif
new file mode 100644
index 0000000000..845618c1a2
--- /dev/null
+++ b/phpBB/styles/prosilver/theme/images/forum_read.gif
Binary files differ
diff --git a/phpBB/styles/prosilver/theme/images/forum_read_locked.gif b/phpBB/styles/prosilver/theme/images/forum_read_locked.gif
new file mode 100644
index 0000000000..7afb092a8f
--- /dev/null
+++ b/phpBB/styles/prosilver/theme/images/forum_read_locked.gif
Binary files differ
diff --git a/phpBB/styles/prosilver/theme/images/forum_read_subforum.gif b/phpBB/styles/prosilver/theme/images/forum_read_subforum.gif
new file mode 100644
index 0000000000..7119486539
--- /dev/null
+++ b/phpBB/styles/prosilver/theme/images/forum_read_subforum.gif
Binary files differ
diff --git a/phpBB/styles/prosilver/theme/images/forum_unread.gif b/phpBB/styles/prosilver/theme/images/forum_unread.gif
new file mode 100644
index 0000000000..1a397cb216
--- /dev/null
+++ b/phpBB/styles/prosilver/theme/images/forum_unread.gif
Binary files differ
diff --git a/phpBB/styles/prosilver/imageset/forum_unread_locked.gif b/phpBB/styles/prosilver/theme/images/forum_unread_locked.gif
index 34f1d46ad7..34f1d46ad7 100644
--- a/phpBB/styles/prosilver/imageset/forum_unread_locked.gif
+++ b/phpBB/styles/prosilver/theme/images/forum_unread_locked.gif
Binary files differ
diff --git a/phpBB/styles/prosilver/theme/images/forum_unread_subforum.gif b/phpBB/styles/prosilver/theme/images/forum_unread_subforum.gif
new file mode 100644
index 0000000000..e955887020
--- /dev/null
+++ b/phpBB/styles/prosilver/theme/images/forum_unread_subforum.gif
Binary files differ
diff --git a/phpBB/styles/prosilver/imageset/fr/button_pm_forward.gif b/phpBB/styles/prosilver/theme/images/fr/button_pm_forward.gif
index 815a97d182..815a97d182 100644
--- a/phpBB/styles/prosilver/imageset/fr/button_pm_forward.gif
+++ b/phpBB/styles/prosilver/theme/images/fr/button_pm_forward.gif
Binary files differ
diff --git a/phpBB/styles/prosilver/imageset/fr/button_pm_new.gif b/phpBB/styles/prosilver/theme/images/fr/button_pm_new.gif
index 7c9c8a2610..7c9c8a2610 100644
--- a/phpBB/styles/prosilver/imageset/fr/button_pm_new.gif
+++ b/phpBB/styles/prosilver/theme/images/fr/button_pm_new.gif
Binary files differ
diff --git a/phpBB/styles/prosilver/imageset/fr/button_pm_reply.gif b/phpBB/styles/prosilver/theme/images/fr/button_pm_reply.gif
index d950ecebfc..d950ecebfc 100644
--- a/phpBB/styles/prosilver/imageset/fr/button_pm_reply.gif
+++ b/phpBB/styles/prosilver/theme/images/fr/button_pm_reply.gif
Binary files differ
diff --git a/phpBB/styles/prosilver/imageset/fr/button_topic_locked.gif b/phpBB/styles/prosilver/theme/images/fr/button_topic_locked.gif
index e37338a42a..e37338a42a 100644
--- a/phpBB/styles/prosilver/imageset/fr/button_topic_locked.gif
+++ b/phpBB/styles/prosilver/theme/images/fr/button_topic_locked.gif
Binary files differ
diff --git a/phpBB/styles/prosilver/imageset/fr/button_topic_new.gif b/phpBB/styles/prosilver/theme/images/fr/button_topic_new.gif
index 7c9c8a2610..7c9c8a2610 100644
--- a/phpBB/styles/prosilver/imageset/fr/button_topic_new.gif
+++ b/phpBB/styles/prosilver/theme/images/fr/button_topic_new.gif
Binary files differ
diff --git a/phpBB/styles/prosilver/imageset/fr/button_topic_reply.gif b/phpBB/styles/prosilver/theme/images/fr/button_topic_reply.gif
index d950ecebfc..d950ecebfc 100644
--- a/phpBB/styles/prosilver/imageset/fr/button_topic_reply.gif
+++ b/phpBB/styles/prosilver/theme/images/fr/button_topic_reply.gif
Binary files differ
diff --git a/phpBB/styles/prosilver/imageset/fr/icon_contact_pm.gif b/phpBB/styles/prosilver/theme/images/fr/icon_contact_pm.gif
index 3051e15744..3051e15744 100644
--- a/phpBB/styles/prosilver/imageset/fr/icon_contact_pm.gif
+++ b/phpBB/styles/prosilver/theme/images/fr/icon_contact_pm.gif
Binary files differ
diff --git a/phpBB/styles/prosilver/imageset/fr/icon_post_edit.gif b/phpBB/styles/prosilver/theme/images/fr/icon_post_edit.gif
index 0ed8d22fca..0ed8d22fca 100644
--- a/phpBB/styles/prosilver/imageset/fr/icon_post_edit.gif
+++ b/phpBB/styles/prosilver/theme/images/fr/icon_post_edit.gif
Binary files differ
diff --git a/phpBB/styles/prosilver/imageset/fr/icon_post_quote.gif b/phpBB/styles/prosilver/theme/images/fr/icon_post_quote.gif
index e7c3fa4e6f..e7c3fa4e6f 100644
--- a/phpBB/styles/prosilver/imageset/fr/icon_post_quote.gif
+++ b/phpBB/styles/prosilver/theme/images/fr/icon_post_quote.gif
Binary files differ
diff --git a/phpBB/styles/prosilver/imageset/fr/icon_user_online.gif b/phpBB/styles/prosilver/theme/images/fr/icon_user_online.gif
index 16eb8025b8..16eb8025b8 100644
--- a/phpBB/styles/prosilver/imageset/fr/icon_user_online.gif
+++ b/phpBB/styles/prosilver/theme/images/fr/icon_user_online.gif
Binary files differ
diff --git a/phpBB/styles/prosilver/imageset/fr/imageset.cfg b/phpBB/styles/prosilver/theme/images/fr/imageset.cfg
index d7a0e3b539..d7a0e3b539 100644
--- a/phpBB/styles/prosilver/imageset/fr/imageset.cfg
+++ b/phpBB/styles/prosilver/theme/images/fr/imageset.cfg
diff --git a/phpBB/styles/prosilver/imageset/fr/index.htm b/phpBB/styles/prosilver/theme/images/fr/index.htm
index e69de29bb2..e69de29bb2 100644
--- a/phpBB/styles/prosilver/imageset/fr/index.htm
+++ b/phpBB/styles/prosilver/theme/images/fr/index.htm
diff --git a/phpBB/styles/prosilver/theme/images/icon_acp.gif b/phpBB/styles/prosilver/theme/images/icon_acp.gif
new file mode 100644
index 0000000000..3afa98ee8f
--- /dev/null
+++ b/phpBB/styles/prosilver/theme/images/icon_acp.gif
Binary files differ
diff --git a/phpBB/styles/prosilver/theme/images/icon_back_top.gif b/phpBB/styles/prosilver/theme/images/icon_back_top.gif
new file mode 100644
index 0000000000..4d2b8f3822
--- /dev/null
+++ b/phpBB/styles/prosilver/theme/images/icon_back_top.gif
Binary files differ
diff --git a/phpBB/styles/prosilver/theme/images/icon_contact.png b/phpBB/styles/prosilver/theme/images/icon_contact.png
new file mode 100644
index 0000000000..04e4d9ad17
--- /dev/null
+++ b/phpBB/styles/prosilver/theme/images/icon_contact.png
Binary files differ
diff --git a/phpBB/styles/prosilver/theme/images/icon_delete_cookies.gif b/phpBB/styles/prosilver/theme/images/icon_delete_cookies.gif
new file mode 100644
index 0000000000..f7665ebff8
--- /dev/null
+++ b/phpBB/styles/prosilver/theme/images/icon_delete_cookies.gif
Binary files differ
diff --git a/phpBB/styles/prosilver/theme/images/icon_download.gif b/phpBB/styles/prosilver/theme/images/icon_download.gif
new file mode 100644
index 0000000000..70cd61caf2
--- /dev/null
+++ b/phpBB/styles/prosilver/theme/images/icon_download.gif
Binary files differ
diff --git a/phpBB/styles/prosilver/theme/images/icon_fontsize.gif b/phpBB/styles/prosilver/theme/images/icon_fontsize.gif
deleted file mode 100644
index 1c7d83527c..0000000000
--- a/phpBB/styles/prosilver/theme/images/icon_fontsize.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/prosilver/theme/images/icon_mark.gif b/phpBB/styles/prosilver/theme/images/icon_mark.gif
new file mode 100644
index 0000000000..1a33fc3264
--- /dev/null
+++ b/phpBB/styles/prosilver/theme/images/icon_mark.gif
Binary files differ
diff --git a/phpBB/styles/prosilver/theme/images/icon_mcp.gif b/phpBB/styles/prosilver/theme/images/icon_mcp.gif
new file mode 100644
index 0000000000..80de2e53f7
--- /dev/null
+++ b/phpBB/styles/prosilver/theme/images/icon_mcp.gif
Binary files differ
diff --git a/phpBB/styles/prosilver/theme/images/icon_notification.gif b/phpBB/styles/prosilver/theme/images/icon_notification.gif
new file mode 100644
index 0000000000..11092f4dce
--- /dev/null
+++ b/phpBB/styles/prosilver/theme/images/icon_notification.gif
Binary files differ
diff --git a/phpBB/styles/prosilver/theme/images/icon_offline.gif b/phpBB/styles/prosilver/theme/images/icon_offline.gif
new file mode 100644
index 0000000000..5dc4212e9f
--- /dev/null
+++ b/phpBB/styles/prosilver/theme/images/icon_offline.gif
Binary files differ
diff --git a/phpBB/styles/prosilver/theme/images/icon_online.gif b/phpBB/styles/prosilver/theme/images/icon_online.gif
new file mode 100644
index 0000000000..d0d202dde5
--- /dev/null
+++ b/phpBB/styles/prosilver/theme/images/icon_online.gif
Binary files differ
diff --git a/phpBB/styles/prosilver/theme/images/icon_pages.gif b/phpBB/styles/prosilver/theme/images/icon_pages.gif
index 44cc34500e..20b2fe9f81 100644
--- a/phpBB/styles/prosilver/theme/images/icon_pages.gif
+++ b/phpBB/styles/prosilver/theme/images/icon_pages.gif
Binary files differ
diff --git a/phpBB/styles/prosilver/theme/images/icon_pm.gif b/phpBB/styles/prosilver/theme/images/icon_pm.gif
new file mode 100644
index 0000000000..103421a26f
--- /dev/null
+++ b/phpBB/styles/prosilver/theme/images/icon_pm.gif
Binary files differ
diff --git a/phpBB/styles/prosilver/theme/images/icon_post_target.gif b/phpBB/styles/prosilver/theme/images/icon_post_target.gif
new file mode 100644
index 0000000000..a2bc2a2c47
--- /dev/null
+++ b/phpBB/styles/prosilver/theme/images/icon_post_target.gif
Binary files differ
diff --git a/phpBB/styles/prosilver/theme/images/icon_post_target_unread.gif b/phpBB/styles/prosilver/theme/images/icon_post_target_unread.gif
new file mode 100644
index 0000000000..65d47bb900
--- /dev/null
+++ b/phpBB/styles/prosilver/theme/images/icon_post_target_unread.gif
Binary files differ
diff --git a/phpBB/styles/prosilver/theme/images/icon_print.gif b/phpBB/styles/prosilver/theme/images/icon_print.gif
index a71dfdde70..e464e304ea 100644
--- a/phpBB/styles/prosilver/theme/images/icon_print.gif
+++ b/phpBB/styles/prosilver/theme/images/icon_print.gif
Binary files differ
diff --git a/phpBB/styles/prosilver/theme/images/icon_profile.gif b/phpBB/styles/prosilver/theme/images/icon_profile.gif
new file mode 100644
index 0000000000..a0ec098460
--- /dev/null
+++ b/phpBB/styles/prosilver/theme/images/icon_profile.gif
Binary files differ
diff --git a/phpBB/styles/prosilver/imageset/icon_rate_bad.gif b/phpBB/styles/prosilver/theme/images/icon_rate_bad.gif
index 7901889408..7901889408 100644
--- a/phpBB/styles/prosilver/imageset/icon_rate_bad.gif
+++ b/phpBB/styles/prosilver/theme/images/icon_rate_bad.gif
Binary files differ
diff --git a/phpBB/styles/prosilver/imageset/icon_rate_good.gif b/phpBB/styles/prosilver/theme/images/icon_rate_good.gif
index 6d23034d71..6d23034d71 100644
--- a/phpBB/styles/prosilver/imageset/icon_rate_good.gif
+++ b/phpBB/styles/prosilver/theme/images/icon_rate_good.gif
Binary files differ
diff --git a/phpBB/styles/prosilver/theme/images/icon_sendemail.gif b/phpBB/styles/prosilver/theme/images/icon_sendemail.gif
index f6b8aa10e1..92a39c8af9 100644
--- a/phpBB/styles/prosilver/theme/images/icon_sendemail.gif
+++ b/phpBB/styles/prosilver/theme/images/icon_sendemail.gif
Binary files differ
diff --git a/phpBB/styles/prosilver/theme/images/icon_team.gif b/phpBB/styles/prosilver/theme/images/icon_team.gif
new file mode 100644
index 0000000000..613158257b
--- /dev/null
+++ b/phpBB/styles/prosilver/theme/images/icon_team.gif
Binary files differ
diff --git a/phpBB/styles/prosilver/theme/images/icon_topic_attach.gif b/phpBB/styles/prosilver/theme/images/icon_topic_attach.gif
new file mode 100644
index 0000000000..70203124fe
--- /dev/null
+++ b/phpBB/styles/prosilver/theme/images/icon_topic_attach.gif
Binary files differ
diff --git a/phpBB/styles/prosilver/theme/images/icon_topic_deleted.png b/phpBB/styles/prosilver/theme/images/icon_topic_deleted.png
new file mode 100644
index 0000000000..494b4fb563
--- /dev/null
+++ b/phpBB/styles/prosilver/theme/images/icon_topic_deleted.png
Binary files differ
diff --git a/phpBB/styles/prosilver/theme/images/icon_topic_latest.gif b/phpBB/styles/prosilver/theme/images/icon_topic_latest.gif
new file mode 100644
index 0000000000..815b26927a
--- /dev/null
+++ b/phpBB/styles/prosilver/theme/images/icon_topic_latest.gif
Binary files differ
diff --git a/phpBB/styles/prosilver/theme/images/icon_topic_newest.gif b/phpBB/styles/prosilver/theme/images/icon_topic_newest.gif
new file mode 100644
index 0000000000..fd6652d957
--- /dev/null
+++ b/phpBB/styles/prosilver/theme/images/icon_topic_newest.gif
Binary files differ
diff --git a/phpBB/styles/prosilver/theme/images/icon_topic_poll.gif b/phpBB/styles/prosilver/theme/images/icon_topic_poll.gif
new file mode 100644
index 0000000000..1c80ec87c1
--- /dev/null
+++ b/phpBB/styles/prosilver/theme/images/icon_topic_poll.gif
Binary files differ
diff --git a/phpBB/styles/prosilver/imageset/icon_topic_reported.gif b/phpBB/styles/prosilver/theme/images/icon_topic_reported.gif
index 006b1e2291..006b1e2291 100644
--- a/phpBB/styles/prosilver/imageset/icon_topic_reported.gif
+++ b/phpBB/styles/prosilver/theme/images/icon_topic_reported.gif
Binary files differ
diff --git a/phpBB/styles/prosilver/imageset/icon_topic_unapproved.gif b/phpBB/styles/prosilver/theme/images/icon_topic_unapproved.gif
index 09d8f387a7..09d8f387a7 100644
--- a/phpBB/styles/prosilver/imageset/icon_topic_unapproved.gif
+++ b/phpBB/styles/prosilver/theme/images/icon_topic_unapproved.gif
Binary files differ
diff --git a/phpBB/styles/prosilver/theme/images/icons_button.png b/phpBB/styles/prosilver/theme/images/icons_button.png
new file mode 100644
index 0000000000..50ac8994de
--- /dev/null
+++ b/phpBB/styles/prosilver/theme/images/icons_button.png
Binary files differ
diff --git a/phpBB/styles/prosilver/theme/images/icons_contact.png b/phpBB/styles/prosilver/theme/images/icons_contact.png
new file mode 100644
index 0000000000..f84abd36a5
--- /dev/null
+++ b/phpBB/styles/prosilver/theme/images/icons_contact.png
Binary files differ
diff --git a/phpBB/styles/prosilver/theme/images/icons_pagination.png b/phpBB/styles/prosilver/theme/images/icons_pagination.png
new file mode 100644
index 0000000000..872b7308c2
--- /dev/null
+++ b/phpBB/styles/prosilver/theme/images/icons_pagination.png
Binary files differ
diff --git a/phpBB/styles/prosilver/theme/images/loading.gif b/phpBB/styles/prosilver/theme/images/loading.gif
new file mode 100644
index 0000000000..e1ed0883e0
--- /dev/null
+++ b/phpBB/styles/prosilver/theme/images/loading.gif
Binary files differ
diff --git a/phpBB/styles/prosilver/theme/images/no_avatar.gif b/phpBB/styles/prosilver/theme/images/no_avatar.gif
index 80539c8c71..ad73330e71 100644
--- a/phpBB/styles/prosilver/theme/images/no_avatar.gif
+++ b/phpBB/styles/prosilver/theme/images/no_avatar.gif
Binary files differ
diff --git a/phpBB/styles/prosilver/theme/images/plupload/done.gif b/phpBB/styles/prosilver/theme/images/plupload/done.gif
new file mode 100644
index 0000000000..29f3ed7c97
--- /dev/null
+++ b/phpBB/styles/prosilver/theme/images/plupload/done.gif
Binary files differ
diff --git a/phpBB/styles/prosilver/theme/images/plupload/error.gif b/phpBB/styles/prosilver/theme/images/plupload/error.gif
new file mode 100644
index 0000000000..4682b63007
--- /dev/null
+++ b/phpBB/styles/prosilver/theme/images/plupload/error.gif
Binary files differ
diff --git a/phpBB/styles/prosilver/theme/images/plupload/throbber.gif b/phpBB/styles/prosilver/theme/images/plupload/throbber.gif
new file mode 100644
index 0000000000..4ae8b16a5a
--- /dev/null
+++ b/phpBB/styles/prosilver/theme/images/plupload/throbber.gif
Binary files differ
diff --git a/phpBB/styles/prosilver/theme/images/site_logo.gif b/phpBB/styles/prosilver/theme/images/site_logo.gif
new file mode 100644
index 0000000000..2517fbedd6
--- /dev/null
+++ b/phpBB/styles/prosilver/theme/images/site_logo.gif
Binary files differ
diff --git a/phpBB/styles/prosilver/theme/images/sticky_read.gif b/phpBB/styles/prosilver/theme/images/sticky_read.gif
new file mode 100644
index 0000000000..e1af585da5
--- /dev/null
+++ b/phpBB/styles/prosilver/theme/images/sticky_read.gif
Binary files differ
diff --git a/phpBB/styles/prosilver/imageset/sticky_read_locked.gif b/phpBB/styles/prosilver/theme/images/sticky_read_locked.gif
index 79f581be79..79f581be79 100644
--- a/phpBB/styles/prosilver/imageset/sticky_read_locked.gif
+++ b/phpBB/styles/prosilver/theme/images/sticky_read_locked.gif
Binary files differ
diff --git a/phpBB/styles/prosilver/imageset/sticky_read_locked_mine.gif b/phpBB/styles/prosilver/theme/images/sticky_read_locked_mine.gif
index ad056086e5..ad056086e5 100644
--- a/phpBB/styles/prosilver/imageset/sticky_read_locked_mine.gif
+++ b/phpBB/styles/prosilver/theme/images/sticky_read_locked_mine.gif
Binary files differ
diff --git a/phpBB/styles/prosilver/theme/images/sticky_read_mine.gif b/phpBB/styles/prosilver/theme/images/sticky_read_mine.gif
new file mode 100644
index 0000000000..8f5f28fe5e
--- /dev/null
+++ b/phpBB/styles/prosilver/theme/images/sticky_read_mine.gif
Binary files differ
diff --git a/phpBB/styles/prosilver/theme/images/sticky_unread.gif b/phpBB/styles/prosilver/theme/images/sticky_unread.gif
new file mode 100644
index 0000000000..d62b3c0f3a
--- /dev/null
+++ b/phpBB/styles/prosilver/theme/images/sticky_unread.gif
Binary files differ
diff --git a/phpBB/styles/prosilver/imageset/sticky_unread_locked.gif b/phpBB/styles/prosilver/theme/images/sticky_unread_locked.gif
index 5792b8649a..5792b8649a 100644
--- a/phpBB/styles/prosilver/imageset/sticky_unread_locked.gif
+++ b/phpBB/styles/prosilver/theme/images/sticky_unread_locked.gif
Binary files differ
diff --git a/phpBB/styles/prosilver/imageset/sticky_unread_locked_mine.gif b/phpBB/styles/prosilver/theme/images/sticky_unread_locked_mine.gif
index 93495770c8..93495770c8 100644
--- a/phpBB/styles/prosilver/imageset/sticky_unread_locked_mine.gif
+++ b/phpBB/styles/prosilver/theme/images/sticky_unread_locked_mine.gif
Binary files differ
diff --git a/phpBB/styles/prosilver/theme/images/sticky_unread_mine.gif b/phpBB/styles/prosilver/theme/images/sticky_unread_mine.gif
new file mode 100644
index 0000000000..e201a9f31f
--- /dev/null
+++ b/phpBB/styles/prosilver/theme/images/sticky_unread_mine.gif
Binary files differ
diff --git a/phpBB/styles/prosilver/imageset/subforum_read.gif b/phpBB/styles/prosilver/theme/images/subforum_read.gif
index 595595c296..595595c296 100644
--- a/phpBB/styles/prosilver/imageset/subforum_read.gif
+++ b/phpBB/styles/prosilver/theme/images/subforum_read.gif
Binary files differ
diff --git a/phpBB/styles/prosilver/imageset/subforum_unread.gif b/phpBB/styles/prosilver/theme/images/subforum_unread.gif
index b2b661dc78..b2b661dc78 100644
--- a/phpBB/styles/prosilver/imageset/subforum_unread.gif
+++ b/phpBB/styles/prosilver/theme/images/subforum_unread.gif
Binary files differ
diff --git a/phpBB/styles/prosilver/theme/images/topic_moved.gif b/phpBB/styles/prosilver/theme/images/topic_moved.gif
new file mode 100644
index 0000000000..3dafa46ed7
--- /dev/null
+++ b/phpBB/styles/prosilver/theme/images/topic_moved.gif
Binary files differ
diff --git a/phpBB/styles/prosilver/theme/images/topic_read.gif b/phpBB/styles/prosilver/theme/images/topic_read.gif
new file mode 100644
index 0000000000..640d5396f8
--- /dev/null
+++ b/phpBB/styles/prosilver/theme/images/topic_read.gif
Binary files differ
diff --git a/phpBB/styles/prosilver/imageset/topic_read_hot.gif b/phpBB/styles/prosilver/theme/images/topic_read_hot.gif
index dcb6f3bd60..dcb6f3bd60 100644
--- a/phpBB/styles/prosilver/imageset/topic_read_hot.gif
+++ b/phpBB/styles/prosilver/theme/images/topic_read_hot.gif
Binary files differ
diff --git a/phpBB/styles/prosilver/imageset/topic_read_hot_mine.gif b/phpBB/styles/prosilver/theme/images/topic_read_hot_mine.gif
index 1e5498a9be..1e5498a9be 100644
--- a/phpBB/styles/prosilver/imageset/topic_read_hot_mine.gif
+++ b/phpBB/styles/prosilver/theme/images/topic_read_hot_mine.gif
Binary files differ
diff --git a/phpBB/styles/prosilver/theme/images/topic_read_locked.gif b/phpBB/styles/prosilver/theme/images/topic_read_locked.gif
new file mode 100644
index 0000000000..a47affb2f2
--- /dev/null
+++ b/phpBB/styles/prosilver/theme/images/topic_read_locked.gif
Binary files differ
diff --git a/phpBB/styles/prosilver/theme/images/topic_read_locked_mine.gif b/phpBB/styles/prosilver/theme/images/topic_read_locked_mine.gif
new file mode 100644
index 0000000000..d6142f0ea7
--- /dev/null
+++ b/phpBB/styles/prosilver/theme/images/topic_read_locked_mine.gif
Binary files differ
diff --git a/phpBB/styles/prosilver/theme/images/topic_read_mine.gif b/phpBB/styles/prosilver/theme/images/topic_read_mine.gif
new file mode 100644
index 0000000000..18a1245b93
--- /dev/null
+++ b/phpBB/styles/prosilver/theme/images/topic_read_mine.gif
Binary files differ
diff --git a/phpBB/styles/prosilver/theme/images/topic_unread.gif b/phpBB/styles/prosilver/theme/images/topic_unread.gif
new file mode 100644
index 0000000000..3fa920b6fc
--- /dev/null
+++ b/phpBB/styles/prosilver/theme/images/topic_unread.gif
Binary files differ
diff --git a/phpBB/styles/prosilver/imageset/topic_unread_hot.gif b/phpBB/styles/prosilver/theme/images/topic_unread_hot.gif
index e712f6e827..e712f6e827 100644
--- a/phpBB/styles/prosilver/imageset/topic_unread_hot.gif
+++ b/phpBB/styles/prosilver/theme/images/topic_unread_hot.gif
Binary files differ
diff --git a/phpBB/styles/prosilver/imageset/topic_unread_hot_mine.gif b/phpBB/styles/prosilver/theme/images/topic_unread_hot_mine.gif
index fa8b167c64..fa8b167c64 100644
--- a/phpBB/styles/prosilver/imageset/topic_unread_hot_mine.gif
+++ b/phpBB/styles/prosilver/theme/images/topic_unread_hot_mine.gif
Binary files differ
diff --git a/phpBB/styles/prosilver/theme/images/topic_unread_locked.gif b/phpBB/styles/prosilver/theme/images/topic_unread_locked.gif
new file mode 100644
index 0000000000..0a9768ba7d
--- /dev/null
+++ b/phpBB/styles/prosilver/theme/images/topic_unread_locked.gif
Binary files differ
diff --git a/phpBB/styles/prosilver/theme/images/topic_unread_locked_mine.gif b/phpBB/styles/prosilver/theme/images/topic_unread_locked_mine.gif
new file mode 100644
index 0000000000..916b60517e
--- /dev/null
+++ b/phpBB/styles/prosilver/theme/images/topic_unread_locked_mine.gif
Binary files differ
diff --git a/phpBB/styles/prosilver/theme/images/topic_unread_mine.gif b/phpBB/styles/prosilver/theme/images/topic_unread_mine.gif
new file mode 100644
index 0000000000..4ca8492e74
--- /dev/null
+++ b/phpBB/styles/prosilver/theme/images/topic_unread_mine.gif
Binary files differ
diff --git a/phpBB/styles/prosilver/theme/imageset.css b/phpBB/styles/prosilver/theme/imageset.css
new file mode 100644
index 0000000000..5cd91348be
--- /dev/null
+++ b/phpBB/styles/prosilver/theme/imageset.css
@@ -0,0 +1,376 @@
+/* Former imageset */
+span.imageset {
+ display: inline-block !important;
+ background: transparent none 0 0 no-repeat;
+ margin: 0;
+ padding: 0;
+ width: 0;
+ height: 0;
+ overflow: hidden;
+}
+
+/* Global imageset items */
+.imageset.site_logo {
+ background-image: url("./images/site_logo.gif");
+ padding-left: 149px;
+ padding-top: 52px;
+}
+.imageset.forum_link {
+ background-image: url("./images/forum_link.gif");
+ padding-left: 27px;
+ padding-top: 27px;
+}
+.imageset.forum_read {
+ background-image: url("./images/forum_read.gif");
+ padding-left: 27px;
+ padding-top: 27px;
+}
+.imageset.forum_read_locked {
+ background-image: url("./images/forum_read_locked.gif");
+ padding-left: 27px;
+ padding-top: 27px;
+}
+.imageset.forum_read_subforum {
+ background-image: url("./images/forum_read_subforum.gif");
+ padding-left: 27px;
+ padding-top: 27px;
+}
+.imageset.forum_unread {
+ background-image: url("./images/forum_unread.gif");
+ padding-left: 27px;
+ padding-top: 27px;
+}
+.imageset.forum_unread_locked {
+ background-image: url("./images/forum_unread_locked.gif");
+ padding-left: 27px;
+ padding-top: 27px;
+}
+.imageset.forum_unread_subforum {
+ background-image: url("./images/forum_unread_subforum.gif");
+ padding-left: 27px;
+ padding-top: 27px;
+}
+.imageset.topic_moved {
+ background-image: url("./images/topic_moved.gif");
+ padding-left: 27px;
+ padding-top: 27px;
+}
+.imageset.topic_read {
+ background-image: url("./images/topic_read.gif");
+ padding-left: 27px;
+ padding-top: 27px;
+}
+.imageset.topic_read_mine {
+ background-image: url("./images/topic_read_mine.gif");
+ padding-left: 27px;
+ padding-top: 27px;
+}
+.imageset.topic_read_hot {
+ background-image: url("./images/topic_read_hot.gif");
+ padding-left: 27px;
+ padding-top: 27px;
+}
+.imageset.topic_read_hot_mine {
+ background-image: url("./images/topic_read_hot_mine.gif");
+ padding-left: 27px;
+ padding-top: 27px;
+}
+.imageset.topic_read_locked {
+ background-image: url("./images/topic_read_locked.gif");
+ padding-left: 27px;
+ padding-top: 27px;
+}
+.imageset.topic_read_locked_mine {
+ background-image: url("./images/topic_read_locked_mine.gif");
+ padding-left: 27px;
+ padding-top: 27px;
+}
+.imageset.topic_unread {
+ background-image: url("./images/topic_unread.gif");
+ padding-left: 27px;
+ padding-top: 27px;
+}
+.imageset.topic_unread_mine {
+ background-image: url("./images/topic_unread_mine.gif");
+ padding-left: 27px;
+ padding-top: 27px;
+}
+.imageset.topic_unread_hot {
+ background-image: url("./images/topic_unread_hot.gif");
+ padding-left: 27px;
+ padding-top: 27px;
+}
+.imageset.topic_unread_hot_mine {
+ background-image: url("./images/topic_unread_hot_mine.gif");
+ padding-left: 27px;
+ padding-top: 27px;
+}
+.imageset.topic_unread_locked {
+ background-image: url("./images/topic_unread_locked.gif");
+ padding-left: 27px;
+ padding-top: 27px;
+}
+.imageset.topic_unread_locked_mine {
+ background-image: url("./images/topic_unread_locked_mine.gif");
+ padding-left: 27px;
+ padding-top: 27px;
+}
+.imageset.sticky_read {
+ background-image: url("./images/sticky_read.gif");
+ padding-left: 27px;
+ padding-top: 27px;
+}
+.imageset.sticky_read_mine {
+ background-image: url("./images/sticky_read_mine.gif");
+ padding-left: 27px;
+ padding-top: 27px;
+}
+.imageset.sticky_read_locked {
+ background-image: url("./images/sticky_read_locked.gif");
+ padding-left: 27px;
+ padding-top: 27px;
+}
+.imageset.sticky_read_locked_mine {
+ background-image: url("./images/sticky_read_locked_mine.gif");
+ padding-left: 27px;
+ padding-top: 27px;
+}
+.imageset.sticky_unread {
+ background-image: url("./images/sticky_unread.gif");
+ padding-left: 27px;
+ padding-top: 27px;
+}
+.imageset.sticky_unread_mine {
+ background-image: url("./images/sticky_unread_mine.gif");
+ padding-left: 27px;
+ padding-top: 27px;
+}
+.imageset.sticky_unread_locked {
+ background-image: url("./images/sticky_unread_locked.gif");
+ padding-left: 27px;
+ padding-top: 27px;
+}
+.imageset.sticky_unread_locked_mine {
+ background-image: url("./images/sticky_unread_locked_mine.gif");
+ padding-left: 27px;
+ padding-top: 27px;
+}
+.imageset.announce_read {
+ background-image: url("./images/announce_read.gif");
+ padding-left: 27px;
+ padding-top: 27px;
+}
+.imageset.announce_read_mine {
+ background-image: url("./images/announce_read_mine.gif");
+ padding-left: 27px;
+ padding-top: 27px;
+}
+.imageset.announce_read_locked {
+ background-image: url("./images/announce_read_locked.gif");
+ padding-left: 27px;
+ padding-top: 27px;
+}
+.imageset.announce_read_locked_mine {
+ background-image: url("./images/announce_read_locked_mine.gif");
+ padding-left: 27px;
+ padding-top: 27px;
+}
+.imageset.announce_unread {
+ background-image: url("./images/announce_unread.gif");
+ padding-left: 27px;
+ padding-top: 27px;
+}
+.imageset.announce_unread_mine {
+ background-image: url("./images/announce_unread_mine.gif");
+ padding-left: 27px;
+ padding-top: 27px;
+}
+.imageset.announce_unread_locked {
+ background-image: url("./images/announce_unread_locked.gif");
+ padding-left: 27px;
+ padding-top: 27px;
+}
+.imageset.announce_unread_locked_mine {
+ background-image: url("./images/announce_unread_locked_mine.gif");
+ padding-left: 27px;
+ padding-top: 27px;
+}
+.imageset.global_read {
+ background-image: url("./images/announce_read.gif");
+ padding-left: 27px;
+ padding-top: 27px;
+}
+.imageset.global_read_mine {
+ background-image: url("./images/announce_read_mine.gif");
+ padding-left: 27px;
+ padding-top: 27px;
+}
+.imageset.global_read_locked {
+ background-image: url("./images/announce_read_locked.gif");
+ padding-left: 27px;
+ padding-top: 27px;
+}
+.imageset.global_read_locked_mine {
+ background-image: url("./images/announce_read_locked_mine.gif");
+ padding-left: 27px;
+ padding-top: 27px;
+}
+.imageset.global_unread {
+ background-image: url("./images/announce_unread.gif");
+ padding-left: 27px;
+ padding-top: 27px;
+}
+.imageset.global_unread_mine {
+ background-image: url("./images/announce_unread_mine.gif");
+ padding-left: 27px;
+ padding-top: 27px;
+}
+.imageset.global_unread_locked {
+ background-image: url("./images/announce_unread_locked.gif");
+ padding-left: 27px;
+ padding-top: 27px;
+}
+.imageset.global_unread_locked_mine {
+ background-image: url("./images/announce_unread_locked_mine.gif");
+ padding-left: 27px;
+ padding-top: 27px;
+}
+.imageset.subforum_read {
+ background-image: url("./images/subforum_read.gif");
+ padding-left: 11px;
+ padding-top: 9px;
+}
+.imageset.subforum_unread {
+ background-image: url("./images/subforum_unread.gif");
+ padding-left: 11px;
+ padding-top: 9px;
+}
+.imageset.pm_read {
+ background-image: url("./images/topic_read.gif");
+ padding-left: 27px;
+ padding-top: 27px;
+}
+.imageset.pm_unread {
+ background-image: url("./images/topic_unread.gif");
+ padding-left: 27px;
+ padding-top: 27px;
+}
+.imageset.icon_back_top {
+ background-image: url("./images/icon_back_top.gif");
+ padding-left: 11px;
+ padding-top: 11px;
+}
+.imageset.phpbb_aol-icon, .imageset.icon_contact_aim {
+ background-image: url("./images/icon_contact_aim.gif");
+ padding-left: 20px;
+ padding-top: 20px;
+}
+.imageset.icon_contact_email {
+ background-image: url("./images/icon_contact_email.gif");
+ padding-left: 20px;
+ padding-top: 20px;
+}
+.imageset.icon_contact_icq, .imageset.phpbb_icq-icon {
+ background-image: url("./images/icon_contact_icq.gif");
+ padding-left: 20px;
+ padding-top: 20px;
+}
+.imageset.icon_contact_jabber {
+ background-image: url("./images/icon_contact_jabber.gif");
+ padding-left: 20px;
+ padding-top: 20px;
+}
+.imageset.phpbb_wlm-icon, .imageset.icon_contact_msnm {
+ background-image: url("./images/icon_contact_msnm.gif");
+ padding-left: 20px;
+ padding-top: 20px;
+}
+.imageset.icon_contact_www, .imageset.phpbb_website-icon {
+ background-image: url("./images/icon_contact_www.gif");
+ padding-left: 20px;
+ padding-top: 20px;
+}
+.imageset.icon_contact_yahoo, .imageset.phpbb_yahoo-icon {
+ background-image: url("./images/icon_contact_yahoo.gif");
+ padding-left: 20px;
+ padding-top: 20px;
+}
+.imageset.icon_post_delete {
+ background-image: url("./images/icon_post_delete.gif");
+ padding-left: 20px;
+ padding-top: 20px;
+}
+.imageset.icon_post_info {
+ background-image: url("./images/icon_post_info.gif");
+ padding-left: 20px;
+ padding-top: 20px;
+}
+.imageset.icon_post_report {
+ background-image: url("./images/icon_post_report.gif");
+ padding-left: 20px;
+ padding-top: 20px;
+}
+.imageset.icon_post_target {
+ background-image: url("./images/icon_post_target.gif");
+ padding-left: 11px;
+ padding-top: 9px;
+}
+.imageset.icon_post_target_unread {
+ background-image: url("./images/icon_post_target_unread.gif");
+ padding-left: 11px;
+ padding-top: 9px;
+}
+.imageset.icon_topic_attach {
+ background-image: url("./images/icon_topic_attach.gif");
+ padding-left: 7px;
+ padding-top: 10px;
+}
+.imageset.icon_topic_latest {
+ background-image: url("./images/icon_topic_latest.gif");
+ padding-left: 11px;
+ padding-top: 9px;
+}
+.imageset.icon_topic_newest {
+ background-image: url("./images/icon_topic_newest.gif");
+ padding-left: 11px;
+ padding-top: 9px;
+}
+.imageset.icon_topic_reported {
+ background-image: url("./images/icon_topic_reported.gif");
+ padding-left: 16px;
+ padding-top: 14px;
+}
+.imageset.icon_topic_deleted {
+ background-image: url("./images/icon_topic_deleted.png");
+ padding-left: 16px;
+ padding-top: 14px;
+}
+.imageset.icon_topic_unapproved {
+ background-image: url("./images/icon_topic_unapproved.gif");
+ padding-left: 16px;
+ padding-top: 14px;
+}
+.imageset.icon_topic_poll {
+ background-image: url("./images/icon_topic_poll.gif");
+ padding-left: 11px;
+ padding-top: 10px;
+}
+.imageset.icon_user_warn {
+ background-image: url("./images/icon_user_warn.gif");
+ padding-left: 20px;
+ padding-top: 20px;
+}
+
+.imageset.icon_contact {
+ background-image: url("./images/icon_contact.png");
+ padding-left: 16px;
+ padding-top: 12px;
+}
+
+
+/* English images for fallback */
+.imageset.icon_user_online {
+ background-image: url("./en/icon_user_online.gif");
+ padding-left: 58px;
+ padding-top: 58px;
+}
diff --git a/phpBB/styles/prosilver/theme/large.css b/phpBB/styles/prosilver/theme/large.css
deleted file mode 100644
index dfb1d2c2e6..0000000000
--- a/phpBB/styles/prosilver/theme/large.css
+++ /dev/null
@@ -1,3 +0,0 @@
-body {
- font-size: 12px;
-} \ No newline at end of file
diff --git a/phpBB/styles/prosilver/theme/links.css b/phpBB/styles/prosilver/theme/links.css
index 05662b9b44..a2f512443c 100644
--- a/phpBB/styles/prosilver/theme/links.css
+++ b/phpBB/styles/prosilver/theme/links.css
@@ -5,12 +5,10 @@
a {
direction: ltr;
unicode-bidi: embed;
+ text-decoration: none;
}
-a:link { color: #898989; text-decoration: none; }
-a:visited { color: #898989; text-decoration: none; }
-a:hover { color: #d3d3d3; text-decoration: underline; }
-a:active { color: #d2d2d2; text-decoration: none; }
+a:hover { text-decoration: underline; }
/* Coloured usernames */
.username-coloured {
@@ -20,24 +18,44 @@ a:active { color: #d2d2d2; text-decoration: none; }
}
/* Links on gradient backgrounds */
-#search-box a:link, .navbg a:link, .forumbg .header a:link, .forabg .header a:link, th a:link {
- color: #FFFFFF;
+.forumbg .header a, .forabg .header a, th a {
text-decoration: none;
}
-#search-box a:visited, .navbg a:visited, .forumbg .header a:visited, .forabg .header a:visited, th a:visited {
- color: #FFFFFF;
- text-decoration: none;
+.forumbg .header a:hover, .forabg .header a:hover, th a:hover {
+ text-decoration: underline;
}
-#search-box a:hover, .navbg a:hover, .forumbg .header a:hover, .forabg .header a:hover, th a:hover {
- color: #ffffff;
- text-decoration: underline;
+/* Navigation bar links */
+li.breadcrumbs span:first-child > a {
+ display: inline-block;
+ padding-left: 17px;
}
-#search-box a:active, .navbg a:active, .forumbg .header a:active, .forabg .header a:active, th a:active {
- color: #ffffff;
- text-decoration: none;
+/* Notification mark read link */
+.dropdown-extended a.mark_read {
+ background-position: center center;
+ background-repeat: no-repeat;
+ border-radius: 3px 0 0 3px;
+ display: none;
+ margin-top: -20px;
+ position: absolute;
+ z-index: 2;
+ right: 0;
+ top: 50%;
+ width: 30px;
+ height: 40px;
+ -webkit-box-sizing: border-box;
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
+}
+
+.dropdown-extended li:hover a.mark_read {
+ display: block;
+}
+
+.dropdown-extended a.mark_read:hover {
+ width: 40px;
}
/* Links for forum/topic lists */
@@ -45,97 +63,67 @@ a.forumtitle {
font-family: "Trebuchet MS", Helvetica, Arial, Sans-serif;
font-size: 1.2em;
font-weight: bold;
- color: #898989;
text-decoration: none;
}
-/* a.forumtitle:visited { color: #898989; } */
-
a.forumtitle:hover {
- color: #bcbcbc;
text-decoration: underline;
}
-a.forumtitle:active {
- color: #898989;
-}
-
a.topictitle {
font-family: "Trebuchet MS", Helvetica, Arial, Sans-serif;
font-size: 1.2em;
font-weight: bold;
- color: #898989;
text-decoration: none;
}
-/* a.topictitle:visited { color: #d2d2d2; } */
-
a.topictitle:hover {
- color: #bcbcbc;
text-decoration: underline;
}
-a.topictitle:active {
- color: #898989;
+a.lastsubject {
+ font-weight: bold;
+ text-decoration: none;
+}
+
+a.lastsubject:hover {
+ text-decoration: underline;
}
/* Post body links */
.postlink {
text-decoration: none;
- color: #d2d2d2;
- border-bottom: 1px solid #d2d2d2;
+ border-bottom: 1px solid transparent;
padding-bottom: 0;
}
-/* .postlink:visited { color: #bdbdbd; } */
-
-.postlink:active {
- color: #d2d2d2;
-}
-
.postlink:hover {
- background-color: #f6f6f6;
text-decoration: none;
- color: #404040;
}
-.signature a, .signature a:visited, .signature a:hover, .signature a:active {
+.signature a, .signature a:hover {
border: none;
text-decoration: underline;
- background-color: transparent;
}
/* Profile links */
-.postprofile a:link, .postprofile a:visited, .postprofile dt.author a {
+.postprofile a, .postprofile dt.author a {
font-weight: bold;
- color: #898989;
text-decoration: none;
}
.postprofile a:hover, .postprofile dt.author a:hover {
text-decoration: underline;
- color: #d3d3d3;
}
-/* CSS spec requires a:link, a:visited, a:hover and a:active rules to be specified in this order. */
-/* See http://www.phpbb.com/bugs/phpbb3/59685 */
-.postprofile a:active {
- font-weight: bold;
- color: #898989;
- text-decoration: none;
-}
-
-
-/* Profile searchresults */
+/* Profile searchresults */
.search .postprofile a {
- color: #898989;
- text-decoration: none;
+ text-decoration: none;
font-weight: normal;
}
.search .postprofile a:hover {
- color: #d3d3d3;
- text-decoration: underline;
+ text-decoration: underline;
}
/* Back to top of page */
@@ -148,8 +136,8 @@ a.topictitle:active {
a.top {
background: none no-repeat top left;
text-decoration: none;
- width: {IMG_ICON_BACK_TOP_WIDTH}px;
- height: {IMG_ICON_BACK_TOP_HEIGHT}px;
+ width: 11px;
+ height: 11px;
display: block;
float: right;
overflow: hidden;
@@ -164,47 +152,44 @@ a.top2 {
}
/* Arrow links */
-a.up { background: none no-repeat left center; }
-a.down { background: none no-repeat right center; }
-a.left { background: none no-repeat 3px 60%; }
-a.right { background: none no-repeat 95% 60%; }
+a.arrow-up { background: none no-repeat left center; }
+a.arrow-down { background: none no-repeat right center; }
+a.arrow-left { background: none no-repeat 3px 60%; }
+a.arrow-right { background: none no-repeat 95% 60%; }
-a.up, a.up:link, a.up:active, a.up:visited {
+a.arrow-up {
padding-left: 10px;
text-decoration: none;
border-bottom-width: 0;
}
-a.up:hover {
+a.arrow-up:hover {
background-position: left top;
- background-color: transparent;
}
-a.down, a.down:link, a.down:active, a.down:visited {
+a.arrow-down {
padding-right: 10px;
}
-a.down:hover {
+a.arrow-down:hover {
background-position: right bottom;
text-decoration: none;
}
-a.left, a.left:active, a.left:visited {
+a.arrow-left {
padding-left: 12px;
}
-a.left:hover {
- color: #d2d2d2;
+a.arrow-left:hover {
text-decoration: none;
background-position: 0 60%;
}
-a.right, a.right:active, a.right:visited {
+a.arrow-right {
padding-right: 12px;
}
-a.right:hover {
- color: #d2d2d2;
+a.arrow-right:hover {
text-decoration: none;
background-position: 100% 60%;
}
@@ -221,3 +206,7 @@ a.feed-icon-forum {
float: right;
margin: 3px;
}
+
+a.anchor {
+ display: block;
+}
diff --git a/phpBB/styles/prosilver/theme/medium.css b/phpBB/styles/prosilver/theme/medium.css
deleted file mode 100644
index 4c992f9fd8..0000000000
--- a/phpBB/styles/prosilver/theme/medium.css
+++ /dev/null
@@ -1,3 +0,0 @@
-body {
- font-size: 11px;
-} \ No newline at end of file
diff --git a/phpBB/styles/prosilver/theme/normal.css b/phpBB/styles/prosilver/theme/normal.css
deleted file mode 100644
index d0783d1882..0000000000
--- a/phpBB/styles/prosilver/theme/normal.css
+++ /dev/null
@@ -1,3 +0,0 @@
-body {
- font-size: 10px;
-} \ No newline at end of file
diff --git a/phpBB/styles/prosilver/theme/plupload.css b/phpBB/styles/prosilver/theme/plupload.css
new file mode 100644
index 0000000000..b17cca5f25
--- /dev/null
+++ b/phpBB/styles/prosilver/theme/plupload.css
@@ -0,0 +1,86 @@
+#attach-panel-multi {
+ display: none;
+ margin-bottom: 1em;
+}
+
+#file-list td {
+ vertical-align: middle;
+}
+
+.attach-name {
+ width: 50%;
+}
+
+.attach-comment {
+ width: 30%;
+}
+
+.attach-comment .inputbox {
+ resize: vertical;
+ width: 100%;
+}
+
+.attach-filesize {
+ width: 15%;
+}
+
+.attach-status {
+ width: 5%;
+}
+
+.attach-filesize, .attach-status {
+ text-align: center;
+}
+
+.attach-controls {
+ display: inline-block;
+ float: right;
+}
+
+#attach-row-tpl, .nojs .file-inline-bbcode {
+ display: none;
+}
+
+#file-total-progress {
+ height: 2px;
+ display: block;
+ position: relative;
+ margin: 4px -10px -6px -10px;
+}
+
+.file-progress {
+ background-color: #CCCCCC;
+ display:inline-block;
+ height: 8px;
+ width: 50px;
+}
+
+.file-progress-bar, #file-total-progress-bar {
+ background-color: green;
+ display: block;
+ height: 100%;
+ width: 0;
+}
+
+.file-status.file-working {
+ background: url('./images/plupload/throbber.gif');
+}
+
+.file-status.file-uploaded {
+ background: url('./images/plupload/done.gif');
+}
+
+.file-status.file-error {
+ background: url('./images/plupload/error.gif');
+}
+
+.file-status {
+ display: inline-block;
+ height: 16px;
+ width: 16px;
+}
+
+.file-name {
+ max-width: 65%;
+ vertical-align: bottom;
+}
diff --git a/phpBB/styles/prosilver/theme/print.css b/phpBB/styles/prosilver/theme/print.css
index bc3ca80fdc..34129c92e8 100644
--- a/phpBB/styles/prosilver/theme/print.css
+++ b/phpBB/styles/prosilver/theme/print.css
@@ -91,11 +91,11 @@ hr {
}
/* Dont want to print url for names or titles in content area */
-.postbody .author a:link, .postbody .author a:visited,
-html>body .postbody .author a:link:after,
+.postbody .author a:link, .postbody .author a:visited,
+html>body .postbody .author a:link:after,
html>body .postbody .author a:visited:after,
-.postquote .quote-by a:link, .postquote .quote-by a:visited,
-html>body .postquote .quote-by a:link:after,
+.postquote .quote-by a:link, .postquote .quote-by a:visited,
+html>body .postquote .quote-by a:link:after,
html>body .postquote .quote-by a:visited:after,
html>body .postbody h1 a:link:after, html>body .postbody h2 a:link:after {
text-decoration: none;
@@ -119,7 +119,7 @@ html>body .postbody h1 a:link:after, html>body .postbody h2 a:link:after {
.postquote img { display: none; }
.postquote span { display: block; }
.postquote span .postquote { font-size: 100%; }
-.quote-by, blockquote cite {
+.quote-by, blockquote cite {
color: black;
display : block;
font-weight: bold;
@@ -136,4 +136,4 @@ div.spacer { clear: both; }
/* Accessibility tweaks: Mozilla.org */
.skip_link { display: none; }
-dl.codebox dt { display: none; }
+.codebox p { display: none; }
diff --git a/phpBB/styles/prosilver/theme/responsive.css b/phpBB/styles/prosilver/theme/responsive.css
new file mode 100644
index 0000000000..8653042a69
--- /dev/null
+++ b/phpBB/styles/prosilver/theme/responsive.css
@@ -0,0 +1,574 @@
+/* Responsive Design
+---------------------------------------- */
+
+.responsive-hide { display: none !important; }
+.responsive-show { display: block !important; }
+.responsive-show-inline { display: inline !important; }
+.responsive-show-inline-block { display: inline-block !important; }
+
+/* Content wrappers
+----------------------------------------*/
+html {
+ height: auto;
+}
+
+body {
+ padding: 0;
+}
+
+#wrap {
+ border: none;
+ border-radius: 0;
+ margin: 0;
+ min-width: 290px;
+ padding: 0 5px;
+}
+
+/* Common block wrappers
+----------------------------------------*/
+.headerbar, .navbar, .forabg, .forumbg, .post, .panel {
+ border-radius: 0;
+ margin-left: -5px;
+ margin-right: -5px;
+}
+
+#cp-main .forabg, #cp-main .forumdb, #cp-main .post, #cp-main .panel {
+ border-radius: 7px;
+}
+
+/* Logo block
+----------------------------------------*/
+#site-description {
+ float: none;
+ width: auto;
+ text-align: center;
+}
+
+.logo {
+ /* change display value to inline-block to show logo */
+ display: none;
+ float: none;
+ padding: 10px;
+}
+
+#site-description h1, #site-description p {
+ text-align: inherit;
+ float: none;
+ margin: 5px;
+ line-height: 1.2em;
+ overflow: hidden;
+ text-overflow: ellipsis;
+}
+
+#site-description p, .search-header {
+ display: none;
+}
+
+/* Navigation
+----------------------------------------*/
+.headerbar + .navbar {
+ margin-top: -5px;
+}
+
+/* Search
+----------------------------------------*/
+.responsive-search { display: block !important; }
+.responsive-search a {
+ display: block;
+ width: 16px;
+ height: 22px;
+ text-indent: 99px;
+ overflow: hidden;
+ background-position: 50% 50%;
+ background-repeat: no-repeat;
+ text-decoration: none;
+}
+
+/* .topiclist lists
+----------------------------------------*/
+li.header dt {
+ text-align: center;
+ text-transform: none;
+ line-height: 1em;
+ font-size: 1.2em;
+ padding-bottom: 4px;
+}
+
+ul.topiclist li.header dt, ul.topiclist li.header dt .list-inner {
+ margin-right: 0 !important;
+ padding-right: 0;
+}
+
+ul.topiclist li.header dd {
+ display: none !important;
+}
+
+ul.topiclist dt, ul.topiclist dt .list-inner,
+ul.topiclist.missing-column dt, ul.topiclist.missing-column dt .list-inner,
+ul.topiclist.two-long-columns dt, ul.topiclist.two-long-columns dt .list-inner,
+ul.topiclist.two-columns dt, ul.topiclist.two-columns dt .list-inner {
+ margin-right: 0;
+}
+
+ul.topiclist dt .list-inner.with-mark {
+ padding-right: 34px;
+}
+
+ul.topiclist dt .list-inner {
+ min-height: 28px;
+}
+
+ul.topiclist li.header dt .list-inner {
+ min-height: 0;
+}
+
+ul.topiclist dd {
+ display: none;
+}
+ul.topiclist dd.mark {
+ display: block;
+}
+
+/* Forums and topics lists
+----------------------------------------*/
+ul.topiclist.forums dt {
+ margin-right: -250px;
+}
+ul.topiclist.forums dt .list-inner {
+ margin-right: 250px;
+}
+
+ul.topiclist.forums dd.lastpost {
+ display: block;
+}
+
+ul.topiclist dd.mark {
+ display: block;
+ position: absolute;
+ right: 5px;
+ top: 0;
+ margin: 0;
+ width: auto;
+ min-width: 0;
+ text-align: left;
+}
+
+ul.topiclist.forums dd.topics dfn, ul.topiclist.topics dd.posts dfn {
+ position: relative;
+ left: 0;
+ width: auto;
+ display: inline;
+ font-weight: normal;
+}
+
+@media only screen and (max-width: 550px), only screen and (max-device-width: 550px) {
+ ul.topiclist.forums dt {
+ margin-right: 0;
+ }
+
+ ul.topiclist.forums dt .list-inner {
+ margin-right: 0;
+ }
+
+ ul.topiclist.forums dd.lastpost {
+ display: none;
+ }
+}
+
+li.row .responsive-show strong {
+ font-weight: bold;
+ color: inherit;
+}
+
+ul.topiclist li.row dt a.subforum {
+ display: inline-block;
+ vertical-align: bottom;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ max-width: 100px;
+}
+
+/* Notifications list
+----------------------------------------*/
+@media only screen and (max-width: 350px), only screen and (max-device-width: 350px) {
+ .dropdown-extended .dropdown-contents {
+ width: auto;
+ }
+}
+
+/* Pagination
+----------------------------------------*/
+.pagination > ul {
+ margin: 5px 0 0;
+}
+
+.row .pagination .ellipsis + li {
+ display: none !important;
+}
+
+/* Responsive tables
+----------------------------------------*/
+table.responsive, table.responsive tbody, table.responsive tr, table.responsive td {
+ display: block;
+}
+
+table.responsive thead, table.responsive th {
+ display: none;
+}
+
+table.responsive.show-header thead, table.responsive.show-header th:first-child {
+ display: block;
+ width: auto !important;
+ text-align: left !important;
+}
+
+table.responsive.show-header th:first-child span.rank-img {
+ display: none;
+}
+
+table.responsive tr {
+ margin: 2px 0;
+}
+
+table.responsive td {
+ width: auto !important;
+ text-align: left !important;
+ padding: 4px;
+}
+
+table.responsive td.empty {
+ display: none !important;
+}
+
+table.responsive td > dfn {
+ display: inline-block !important;
+}
+
+table.responsive td > dfn:after {
+ content: ':';
+ padding-right: 5px;
+}
+
+table.responsive span.rank-img {
+ float: none;
+ padding-right: 5px;
+}
+
+table.responsive#memberlist td:first-child input[type="checkbox"] {
+ float: right;
+}
+
+/* Forms
+----------------------------------------*/
+fieldset dt, fieldset.fields1 dt, fieldset.fields2 dt {
+ width: auto;
+ float: none;
+}
+
+fieldset dd, fieldset.fields1 dd, fieldset.fields2 dd {
+ margin-left: 20px;
+}
+
+textarea, dd textarea, #message-box textarea {
+ width: 100%;
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
+}
+
+dl.pmlist dt {
+ width: auto !important;
+ margin-bottom: 5px;
+}
+
+dl.pmlist dd {
+ display: inline-block;
+ margin-left: 0 !important;
+}
+
+dl.pmlist dd:first-of-type {
+ padding-left: 20px;
+}
+
+#smiley-box, #message-box {
+ float: none;
+ width: auto;
+}
+
+#smiley-box {
+ margin-top: 5px;
+}
+
+.bbcode-status {
+ display: none;
+}
+
+.colour-palette, .colour-palette tbody, .colour-palette tr {
+ display: block;
+}
+
+.colour-palette td {
+ display: inline-block;
+ margin-right: 2px;
+}
+
+.horizontal-palette td:nth-child(2n), .vertical-palette tr:nth-child(2n) {
+ display: none;
+}
+
+.colour-palette a {
+ display: inline-block !important;
+}
+
+fieldset.quick-login label {
+ display: block;
+ margin-bottom: 5px;
+ white-space: normal;
+}
+
+fieldset.quick-login label > span {
+ display: inline-block;
+ min-width: 100px;
+}
+
+fieldset.quick-login input.inputbox {
+ width: 85%;
+ max-width: 300px;
+ margin-left: 20px;
+}
+
+fieldset.quick-login label[for="autologin"] {
+ display: inline-block;
+ text-align: right;
+ min-width: 50%;
+}
+
+@media only screen and (max-width: 500px), only screen and (max-device-width: 500px) {
+ dd label {
+ white-space: normal;
+ }
+
+ select, .inputbox {
+ max-width: 260px;
+ }
+
+ .captcha-panel dd.captcha {
+ margin-left: 0;
+ }
+
+ .captcha-panel dd.captcha-image img {
+ width: 100%;
+ }
+
+ #recaptcha_challenge_image,
+ #recaptcha_response_field,
+ .recaptchatable #recaptcha_image {
+ width: 100% !important;
+ height: auto !important;
+ }
+
+ .recaptchatable tr td:last-child {
+ display: none;
+ }
+
+ .captcha-panel .recaptcha-responsive {
+ display: inline-block !important;
+ margin-top: 10px;
+ vertical-align: middle;
+ }
+}
+
+@media only screen and (max-width: 430px), only screen and (max-device-width: 430px) {
+ .section-viewtopic .search-box .inputbox {
+ width: 110px;
+ }
+}
+
+@media only screen and (max-width: 320px), only screen and (max-device-width: 320px) {
+ select, .inputbox {
+ max-width: 240px;
+ }
+}
+
+/* User profile
+----------------------------------------*/
+.column1, .column2, .left-box.profile-details {
+ float: none;
+ width: auto;
+}
+
+@media only screen and (max-width: 500px), only screen and (max-device-width: 500px) {
+ dl.details dt, dl.details dd {
+ width: auto;
+ float: none;
+ text-align: left;
+ }
+
+ dl.details dd {
+ margin-left: 20px;
+ }
+}
+
+/* Polls
+----------------------------------------*/
+fieldset.polls dt {
+ width: 90%;
+}
+
+fieldset.polls dd.resultbar {
+ padding-left: 20px;
+}
+
+fieldset.polls dd.poll_option_percent {
+ width: 20%;
+}
+
+fieldset.polls dd.resultbar, fieldset.polls dd.poll_option_percent {
+ margin-top: 5px;
+}
+
+/* Post
+----------------------------------------*/
+.postbody {
+ position: inherit;
+}
+
+.postprofile, .postbody, .search .postbody {
+ display: block;
+ width: auto;
+ float: none;
+ padding: 0;
+ min-height: 0;
+}
+
+.post .postprofile {
+ width: auto;
+ border-width: 0 0 1px 0;
+ padding-bottom: 5px;
+ margin: 0;
+ margin-bottom: 5px;
+ min-height: 40px;
+ overflow: hidden;
+}
+
+.postprofile dd {
+ display: none;
+}
+
+.postprofile dt, .postprofile dd.profile-rank, .search .postprofile dd {
+ display: block;
+ margin: 0;
+}
+
+.postprofile .has-avatar .avatar-container {
+ margin: 0;
+ overflow: inherit;
+}
+
+.postprofile .avatar-container:after {
+ clear: none;
+}
+
+.postprofile .avatar {
+ margin-right: 5px;
+}
+
+.postprofile .avatar img {
+ width: auto !important;
+ height: auto !important;
+ max-height: 32px;
+}
+
+.has-profile .postbody h3 {
+ margin-left: 0 !important;
+ margin-right: 0 !important;
+}
+
+.has-profile .post-buttons {
+ right: 20px;
+ top: 15px;
+}
+
+.online {
+ background-size: 40px;
+}
+
+/* Misc stuff
+----------------------------------------*/
+h2 {
+ margin-top: .5em;
+}
+
+p {
+ margin-bottom: .5em;
+ overflow: hidden;
+}
+
+p.rightside {
+ margin-bottom: 0;
+}
+
+fieldset.display-options label {
+ display: block;
+ clear: both;
+ margin-bottom: 5px;
+}
+
+dl.mini dd.pm-legend {
+ float: left;
+ min-width: 200px;
+}
+
+#topicreview {
+ margin: 0 -5px;
+ padding: 0 5px;
+}
+
+fieldset.display-actions {
+ white-space: normal;
+}
+
+.phpbb_alert {
+ width: auto;
+ margin: 0 5px;
+}
+
+.attach-comment dfn {
+ width: 100%;
+}
+
+@media only screen and (max-width: 500px), only screen and (max-device-width: 500px) {
+ p.responsive-center {
+ float: none;
+ text-align: center;
+ margin-bottom: 5px;
+ }
+
+ .action-bar > div {
+ margin-bottom: 5px;
+ }
+
+ .action-bar > .pagination {
+ float: none;
+ clear: both;
+ padding-bottom: 1px;
+ text-align: center;
+ }
+
+ .action-bar > .pagination li.page-jump {
+ margin: 0 2px;
+ }
+
+ p.jumpbox-return {
+ display: none;
+ }
+
+ .display-options > label:nth-child(1) {
+ display: block;
+ margin-bottom: 5px;
+ }
+
+ .attach-controls {
+ margin-top: 5px;
+ width: 100%;
+ }
+}
diff --git a/phpBB/styles/prosilver/theme/stylesheet.css b/phpBB/styles/prosilver/theme/stylesheet.css
index 40620179a1..77c7c88b07 100644
--- a/phpBB/styles/prosilver/theme/stylesheet.css
+++ b/phpBB/styles/prosilver/theme/stylesheet.css
@@ -1,9 +1,9 @@
/* phpBB3 Style Sheet
--------------------------------------------------------------
- Style name: prosilver (the default phpBB 3.0.x style)
+ Style name: prosilver (the default phpBB 3.1.x style)
Based on style:
Original author: Tom Beddard ( http://www.subblue.com/ )
- Modified by: phpBB Group ( https://www.phpbb.com/ )
+ Modified by: phpBB Limited ( https://www.phpbb.com/ )
--------------------------------------------------------------
*/
@@ -13,5 +13,5 @@
@import url("buttons.css");
@import url("cp.css");
@import url("forms.css");
-@import url("tweaks.css");
@import url("colours.css");
+@import url("imageset.css");
diff --git a/phpBB/styles/prosilver/theme/theme.cfg b/phpBB/styles/prosilver/theme/theme.cfg
deleted file mode 100644
index a88bff0023..0000000000
--- a/phpBB/styles/prosilver/theme/theme.cfg
+++ /dev/null
@@ -1,35 +0,0 @@
-#
-# phpBB Theme Configuration File
-#
-# @package phpBB3
-# @copyright (c) 2006 phpBB Group
-# @license http://opensource.org/licenses/gpl-license.php GNU Public License
-#
-#
-# At the left is the name, please do not change this
-# At the right the value is entered
-# For on/off options the valid values are on, off, 1, 0, true and false
-#
-# Values get trimmed, if you want to add a space in front or at the end of
-# the value, then enclose the value with single or double quotes.
-# Single and double quotes do not need to be escaped.
-#
-# Available and used values:
-# parse_css_file
-#
-
-# General Information about this theme
-name = prosilver
-copyright = &copy; phpBB Group, 2007
-version = 3.0.14
-
-# Some configuration options
-
-#
-# You have to turn this option on if you want to use the
-# path template variables ({T_IMAGESET_PATH} for example) within
-# your css file.
-# This is mostly the case if you want to use language specific
-# images within your css file.
-#
-parse_css_file = 1
diff --git a/phpBB/styles/prosilver/theme/tweaks.css b/phpBB/styles/prosilver/theme/tweaks.css
index 0c03020100..d2dad9e299 100644
--- a/phpBB/styles/prosilver/theme/tweaks.css
+++ b/phpBB/styles/prosilver/theme/tweaks.css
@@ -1,107 +1,29 @@
/* Style Sheet Tweaks
-These style definitions are mainly IE specific
-tweaks required due to its poor CSS support.
--------------------------------------------------*/
+These style definitions are IE 8 & 9 only.
+They are required due to the poor CSS support in IE browsers.
+------------------------------------------------------------------------------*/
-* html table, * html select, * html input { font-size: 100%; }
-* html hr { margin: 0; }
-* html span.corners-top, * html span.corners-bottom { background-image: url("{T_THEME_PATH}/images/corners_left.gif"); }
-* html span.corners-top span, * html span.corners-bottom span { background-image: url("{T_THEME_PATH}/images/corners_right.gif"); }
+/* IE 8 Tweaks (value)\9 equates to IE <= 8
+------------------------------------------------------------------------------*/
-table.table1 {
- width: 99%; /* IE < 6 browsers */
- /* Tantek hack */
- voice-family: "\"}\"";
- voice-family: inherit;
- width: 100%;
-}
-html>body table.table1 { width: 100%; } /* Reset 100% for opera */
-
-* html ul.topiclist li { position: relative; }
-* html .postbody h3 img { vertical-align: middle; }
-
-/* Form styles */
-html>body dd label input { vertical-align: text-bottom; } /* Align checkboxes/radio buttons nicely */
-
-* html input.button1, * html input.button2 {
- padding-bottom: 0;
- margin-bottom: 1px;
-}
-
-/* Misc layout styles */
-* html .column1, * html .column2 { width: 45%; }
+/* Clear float fix */
+.inner, ul.linklist { zoom: 1\9; }
-/* Nice method for clearing floated blocks without having to insert any extra markup (like spacer above)
- From http://www.positioniseverything.net/easyclearing.html
-#tabs:after, #minitabs:after, .post:after, .navbar:after, fieldset dl:after, ul.topiclist dl:after, ul.linklist:after, dl.polls:after {
- content: ".";
- display: block;
- height: 0;
- clear: both;
- visibility: hidden;
-}*/
+/* Align checkboxes/radio buttons nicely */
+dd label input { vertical-align: text-bottom\9; }
-.clearfix, #tabs, #minitabs, fieldset dl, ul.topiclist dl, dl.polls {
- height: 1%;
- overflow: hidden;
-}
-
-/* viewtopic fix */
-* html .post {
- height: 25%;
- overflow: hidden;
-}
+/* Fixes header-avatar aspect-ratio */
+.header-avatar img { height: 20px\9; }
-/* navbar fix */
-* html .clearfix, * html .navbar, ul.linklist {
- height: 4%;
- overflow: hidden;
-}
+/* IE8 often can't handle max-width in %, so we use px instead */
+.postprofile .avatar img { max-width: 150px\9; }
-/* Simple fix so forum and topic lists always have a min-height set, even in IE6
- From http://www.dustindiaz.com/min-height-fast-hack */
-dl.icon {
- min-height: 35px;
- height: auto !important;
- height: 35px;
-}
-* html li.row dl.icon dt {
- height: 35px;
- overflow: visible;
-}
+/* IE 9 Tweaks
+------------------------------------------------------------------------------*/
-* html #search-box {
- width: 25%;
+/* Border-radius bleed fix in IE9 */
+.search-header, .search-header .inputbox, .search-header a.button {
+ border-radius: 0;
}
-
-/* Correctly clear floating for details on profile view */
-*:first-child+html dl.details dd {
- margin-left: 30%;
- float: none;
-}
-
-* html dl.details dd {
- margin-left: 30%;
- float: none;
-}
-
-/* Headerbar height fix for IE7 and below */
-* html #site-description p {
- margin-bottom: 1.0em;
-}
-
-*:first-child+html #site-description p {
- margin-bottom: 1.0em;
-}
-
-/* #minitabs fix for IE */
-.tabs-container {
- zoom: 1;
-}
-
-#minitabs {
- white-space: nowrap;
- *min-width: 50%;
-} \ No newline at end of file
diff --git a/phpBB/styles/subsilver2/imageset/en/icon_contact_msnm.gif b/phpBB/styles/subsilver2/imageset/en/icon_contact_msnm.gif
deleted file mode 100644
index e3a5901bfc..0000000000
--- a/phpBB/styles/subsilver2/imageset/en/icon_contact_msnm.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/fr/imageset.cfg b/phpBB/styles/subsilver2/imageset/fr/imageset.cfg
deleted file mode 100644
index c0cc699737..0000000000
--- a/phpBB/styles/subsilver2/imageset/fr/imageset.cfg
+++ /dev/null
@@ -1,47 +0,0 @@
-#
-# phpBB Imageset Configuration File
-#
-# @package phpBB3
-# @copyright (c) 2005 phpBB Group
-# @license http://opensource.org/licenses/gpl-license.php GNU Public License
-#
-#
-# At the left is the name, please do not change this
-# At the right the value is entered
-# For on/off options the valid values are on, off, 1, 0, true and false
-#
-# Values get trimmed, if you want to add a space in front or at the end of
-# the value, then enclose the value with single or double quotes.
-# Single and double quotes do not need to be escaped.
-#
-#
-
-# Images
-img_icon_contact_aim = icon_contact_aim.gif
-img_icon_contact_email = icon_contact_email.gif
-img_icon_contact_icq = icon_contact_icq.gif
-img_icon_contact_jabber = icon_contact_jabber.gif
-img_icon_contact_msnm = icon_contact_msnm.gif
-img_icon_contact_pm = icon_contact_pm.gif
-img_icon_contact_yahoo = icon_contact_yahoo.gif
-img_icon_contact_www = icon_contact_www.gif
-
-img_icon_post_delete = icon_post_delete.gif
-img_icon_post_edit = icon_post_edit.gif
-img_icon_post_info = icon_post_info.gif
-img_icon_post_quote = icon_post_quote.gif
-img_icon_post_report = icon_post_report.gif
-
-img_icon_user_online = icon_user_online.gif
-img_icon_user_offline = icon_user_offline.gif
-img_icon_user_profile = icon_user_profile.gif
-img_icon_user_search = icon_user_search.gif
-img_icon_user_warn = icon_user_warn.gif
-
-img_button_pm_forward =
-img_button_pm_new = button_pm_new.gif
-img_button_pm_reply = button_pm_reply.gif
-img_button_topic_locked = button_topic_locked.gif
-img_button_topic_new = button_topic_new.gif
-img_button_topic_reply = button_topic_reply.gif
-
diff --git a/phpBB/styles/subsilver2/imageset/imageset.cfg b/phpBB/styles/subsilver2/imageset/imageset.cfg
deleted file mode 100644
index 7fa552bbfd..0000000000
--- a/phpBB/styles/subsilver2/imageset/imageset.cfg
+++ /dev/null
@@ -1,100 +0,0 @@
-#
-# phpBB Imageset Configuration File
-#
-# @package phpBB3
-# @copyright (c) 2005 phpBB Group
-# @license http://opensource.org/licenses/gpl-license.php GNU Public License
-#
-#
-# At the left is the name, please do not change this
-# At the right the value is entered
-# For on/off options the valid values are on, off, 1, 0, true and false
-#
-# Values get trimmed, if you want to add a space in front or at the end of
-# the value, then enclose the value with single or double quotes.
-# Single and double quotes do not need to be escaped.
-#
-#
-
-# General Information about this style
-name = subsilver2
-copyright = &copy; phpBB Group, 2003
-version = 3.0.14
-
-# Images
-img_site_logo = site_logo.gif*94*170
-img_upload_bar = upload_bar.gif*16*280
-img_poll_left = poll_left.gif*12*4
-img_poll_center = poll_center.gif*12*1
-img_poll_right = poll_right.gif*12*4
-img_icon_friend =
-img_icon_foe =
-
-img_forum_link = forum_link.gif*25*46
-img_forum_read = forum_read.gif*25*46
-img_forum_read_locked = forum_read_locked.gif*25*46
-img_forum_read_subforum = forum_read_subforum.gif*25*46
-img_forum_unread = forum_unread.gif*25*46
-img_forum_unread_locked = forum_unread_locked.gif*25*46
-img_forum_unread_subforum = forum_unread_subforum.gif*25*46
-
-img_topic_moved = topic_moved.gif*18*19
-
-img_topic_read = topic_read.gif*18*19
-img_topic_read_mine = topic_read_mine.gif*18*19
-img_topic_read_hot = topic_read_hot.gif*18*19
-img_topic_read_hot_mine = topic_read_hot_mine.gif*18*19
-img_topic_read_locked = topic_read_locked.gif*18*19
-img_topic_read_locked_mine = topic_read_locked_mine.gif*18*19
-
-img_topic_unread = topic_unread.gif*18*19
-img_topic_unread_mine = topic_unread_mine.gif*18*19
-img_topic_unread_hot = topic_unread_hot.gif*18*19
-img_topic_unread_hot_mine = topic_unread_hot_mine.gif*18*19
-img_topic_unread_locked = topic_unread_locked.gif*18*19
-img_topic_unread_locked_mine = topic_unread_locked_mine.gif*18*19
-
-img_sticky_read = sticky_read.gif*18*19
-img_sticky_read_mine = sticky_read_mine.gif*18*19
-img_sticky_read_locked = sticky_read_locked.gif*18*19
-img_sticky_read_locked_mine = sticky_read_locked_mine.gif*18*19
-img_sticky_unread = sticky_unread.gif*18*19
-img_sticky_unread_mine = sticky_unread_mine.gif*18*19
-img_sticky_unread_locked = sticky_unread_locked.gif*18*19
-img_sticky_unread_locked_mine = sticky_unread_locked_mine.gif*18*19
-
-img_announce_read = announce_read.gif*18*19
-img_announce_read_mine = announce_read_mine.gif*18*19
-img_announce_read_locked = announce_read_locked.gif*18*19
-img_announce_read_locked_mine = announce_read_locked_mine.gif*18*19
-img_announce_unread = announce_unread.gif*18*19
-img_announce_unread_mine = announce_unread_mine.gif*18*19
-img_announce_unread_locked = announce_unread_locked.gif*18*19
-img_announce_unread_locked_mine = announce_unread_locked_mine.gif*18*19
-
-img_global_read = announce_read.gif*18*19
-img_global_read_mine = announce_read_mine.gif*18*19
-img_global_read_locked = announce_read_locked.gif*18*19
-img_global_read_locked_mine = announce_read_locked_mine.gif*18*19
-img_global_unread = announce_unread.gif*18*19
-img_global_unread_mine = announce_unread_mine.gif*18*19
-img_global_unread_locked = announce_unread_locked.gif*18*19
-img_global_unread_locked_mine = announce_unread_locked_mine.gif*18*19
-
-img_subforum_read =
-img_subforum_unread =
-
-img_pm_read = topic_read.gif*18*19
-img_pm_unread = topic_unread.gif*18*19
-
-img_icon_back_top =
-
-img_icon_post_target = icon_post_target.gif*9*12
-img_icon_post_target_unread = icon_post_target_unread.gif*9*12
-
-img_icon_topic_attach = icon_topic_attach.gif*18*14
-img_icon_topic_latest = icon_topic_latest.gif*9*18
-img_icon_topic_newest = icon_topic_newest.gif*9*18
-img_icon_topic_reported = icon_topic_reported.gif*18*19
-img_icon_topic_unapproved = icon_topic_unapproved.gif*18*19
-
diff --git a/phpBB/styles/subsilver2/style.cfg b/phpBB/styles/subsilver2/style.cfg
index 697ee35c6a..65d846402d 100644
--- a/phpBB/styles/subsilver2/style.cfg
+++ b/phpBB/styles/subsilver2/style.cfg
@@ -1,14 +1,16 @@
#
# phpBB Style Configuration File
#
-# @package phpBB3
-# @copyright (c) 2005 phpBB Group
-# @license http://opensource.org/licenses/gpl-license.php GNU Public License
+# This file is part of the phpBB Forum Software package.
#
+# @copyright (c) phpBB Limited <https://www.phpbb.com>
+# @license GNU General Public License, version 2 (GPL-2.0)
+#
+# For full copyright and license information, please see
+# the docs/CREDITS.txt file.
#
# At the left is the name, please do not change this
# At the right the value is entered
-# For on/off options the valid values are on, off, 1, 0, true and false
#
# Values get trimmed, if you want to add a space in front or at the end of
# the value, then enclose the value with single or double quotes.
@@ -18,5 +20,13 @@
# General Information about this style
name = subsilver2
-copyright = © 2005 phpBB Group
-version = 3.0.14
+copyright = © 2005 phpBB Limited
+style_version = 3.1.11
+phpbb_version = 3.1.11
+
+# Defining a different template bitfield
+# template_bitfield = lNg=
+
+# Parent style
+# Set value to empty or to this style's name if this style does not have a parent style
+parent = subsilver2
diff --git a/phpBB/styles/subsilver2/template/attachment.html b/phpBB/styles/subsilver2/template/attachment.html
index fca620b481..65a28aead4 100644
--- a/phpBB/styles/subsilver2/template/attachment.html
+++ b/phpBB/styles/subsilver2/template/attachment.html
@@ -1,21 +1,23 @@
+<!-- EVENT attachment_file_before -->
<!-- BEGIN _file -->
<!-- IF _file.S_DENIED -->
<span class="genmed">[{_file.DENIED_MESSAGE}]</span><br />
<!-- ELSE -->
+ <!-- EVENT attachment_file_prepend -->
<!-- IF _file.COMMENT -->
- <span class="gensmall"><b>{L_FILE_COMMENT}:</b> {_file.COMMENT}</span><br />
+ <span class="gensmall"><b>{L_FILE_COMMENT}{L_COLON}</b> {_file.COMMENT}</span><br />
<!-- ENDIF -->
<!-- IF _file.S_THUMBNAIL -->
- <a href="{_file.U_DOWNLOAD_LINK}"><img src="{_file.THUMB_IMAGE}" alt="{_file.DOWNLOAD_NAME}" /></a><br />
+ <a href="{_file.U_DOWNLOAD_LINK}"><img src="{_file.THUMB_IMAGE}" class="postimage" alt="{_file.DOWNLOAD_NAME}" /></a><br />
<span class="gensmall">{_file.DOWNLOAD_NAME} [ {_file.FILESIZE} {_file.SIZE_LANG} | {_file.L_DOWNLOAD_COUNT} ]</span>
<!-- ENDIF -->
<!-- IF _file.S_IMAGE -->
- <img src="{_file.U_INLINE_LINK}" alt="{_file.DOWNLOAD_NAME}" /><br />
+ <img src="{_file.U_INLINE_LINK}" class="postimage" alt="{_file.DOWNLOAD_NAME}" /><br />
<span class="gensmall">{_file.DOWNLOAD_NAME} [ {_file.FILESIZE} {_file.SIZE_LANG} | {_file.L_DOWNLOAD_COUNT} ]</span>
<!-- ENDIF -->
@@ -115,7 +117,9 @@
<span class="gensmall"><a href="{_file.U_DOWNLOAD_LINK}">{_file.DOWNLOAD_NAME}</a> [ {_file.FILESIZE} {_file.SIZE_LANG} | {_file.L_DOWNLOAD_COUNT} ]</span>
<!-- ENDIF -->
+ <!-- EVENT attachment_file_append -->
<br />
<!-- ENDIF -->
<!-- END _file -->
+<!-- EVENT attachment_file_after -->
diff --git a/phpBB/styles/subsilver2/template/bbcode.html b/phpBB/styles/subsilver2/template/bbcode.html
index 50162740d0..9ee5acec34 100644
--- a/phpBB/styles/subsilver2/template/bbcode.html
+++ b/phpBB/styles/subsilver2/template/bbcode.html
@@ -9,11 +9,11 @@
<!-- BEGIN listitem_close --></li><!-- END listitem_close -->
<!-- BEGIN quote_username_open -->
-<div class="quotetitle">{USERNAME} {L_WROTE}:</div><div class="quotecontent">
+<div class="quotetitle">{USERNAME} {L_WROTE}{L_COLON}</div><div class="quotecontent">
<!-- END quote_username_open -->
<!-- BEGIN quote_open -->
-<div class="quotetitle"><b>{L_QUOTE}:</b></div><div class="quotecontent">
+<div class="quotetitle"><b>{L_QUOTE}{L_COLON}</b></div><div class="quotecontent">
<!-- END quote_open -->
<!-- BEGIN quote_close -->
@@ -21,15 +21,15 @@
<!-- END quote_close -->
<!-- BEGIN code_open -->
-<div class="codetitle"><b>{L_CODE}:</b></div><div class="codecontent">
+<div class="codetitle"><b>{L_CODE}{L_COLON}</b></div><pre class="codecontent">
<!-- END code_open -->
<!-- BEGIN code_close -->
-</div>
+</pre>
<!-- END code_close -->
<!-- BEGIN inline_attachment_open -->
-<div class="attachtitle">{L_ATTACHMENT}:</div><div class="attachcontent">
+<div class="attachtitle">{L_ATTACHMENT}{L_COLON}</div><div class="attachcontent">
<!-- END inline_attachment_open -->
<!-- BEGIN inline_attachment_close -->
@@ -50,7 +50,7 @@
<!-- BEGIN size --><span style="font-size: {SIZE}%; line-height: normal">{TEXT}</span><!-- END size -->
-<!-- BEGIN img --><img src="{URL}" alt="{L_IMAGE}" /><!-- END img -->
+<!-- BEGIN img --><img src="{URL}" class="postimage" alt="{L_IMAGE}" /><!-- END img -->
<!-- BEGIN url --><a href="{URL}" class="postlink">{DESCRIPTION}</a><!-- END url -->
diff --git a/phpBB/styles/subsilver2/template/breadcrumbs.html b/phpBB/styles/subsilver2/template/breadcrumbs.html
index ad180250ce..36983a5d88 100644
--- a/phpBB/styles/subsilver2/template/breadcrumbs.html
+++ b/phpBB/styles/subsilver2/template/breadcrumbs.html
@@ -1,8 +1,14 @@
+ <!-- IF $S_MICRODATA --><!-- DEFINE $MICRODATA = ' itemtype="http://data-vocabulary.org/Breadcrumb" itemscope=""' --><!-- ELSE --><!-- DEFINE $MICRODATA = '' --><!-- ENDIF -->
<table class="tablebg" width="100%" cellspacing="1" cellpadding="0" style="margin-top: 5px;">
<tr>
<td class="row1">
- <p class="breadcrumbs"><a href="{U_INDEX}">{L_INDEX}</a><!-- BEGIN navlinks --> &#187; <a href="{navlinks.U_VIEW_FORUM}">{navlinks.FORUM_NAME}</a><!-- END navlinks --></p>
+ <!-- EVENT overall_header_breadcrumbs_before -->
+ <p class="breadcrumbs"><!-- IF U_SITE_HOME --><span{$MICRODATA}><a href="{U_SITE_HOME}" data-navbar-reference="home" itemprop="url"><span itemprop="title">{L_SITE_HOME}</span></a></span> <strong>&#187;</strong> <!-- ENDIF --><!-- IF $OVERALL_HEADER_BREADCRUMBS --><!-- EVENT overall_header_breadcrumb_prepend --><!-- ELSE --><!-- EVENT overall_footer_breadcrumb_prepend --><!-- ENDIF --><span{$MICRODATA}><a href="{U_INDEX}" data-navbar-reference="index" itemprop="url"><span itemprop="title">{L_INDEX}</span></a></span><!-- BEGIN navlinks --><!-- EVENT overall_header_navlink_prepend --> &#187; <span{$MICRODATA}<!-- IF navlinks.MICRODATA --> {navlinks.MICRODATA}<!-- ENDIF -->><a href="{navlinks.U_VIEW_FORUM}" itemprop="url"><span itemprop="title">{navlinks.FORUM_NAME}</span></a></span><!-- EVENT overall_header_navlink_append --><!-- END navlinks -->
+ <!-- IF $OVERALL_HEADER_BREADCRUMBS --><!-- EVENT overall_header_breadcrumb_append --><!-- ELSE --><!-- EVENT overall_footer_breadcrumb_append --><!-- ENDIF --></p>
+ <!-- EVENT overall_header_breadcrumbs_after -->
+ <!-- EVENT overall_footer_timezone_before -->
<p class="datetime">{S_TIMEZONE}</p>
+ <!-- EVENT overall_footer_timezone_after -->
</td>
</tr>
- </table> \ No newline at end of file
+ </table>
diff --git a/phpBB/styles/subsilver2/template/captcha_default.html b/phpBB/styles/subsilver2/template/captcha_default.html
index e2edf0b810..1be25403ce 100644
--- a/phpBB/styles/subsilver2/template/captcha_default.html
+++ b/phpBB/styles/subsilver2/template/captcha_default.html
@@ -11,7 +11,7 @@
<input type="hidden" name="confirm_id" id="confirm_id" value="{CONFIRM_ID}" /></td>
</tr>
<tr>
- <td class="row1"><b class="genmed">{L_CONFIRM_CODE}:</b><br /><span class="gensmall">{L_CONFIRM_CODE_EXPLAIN}</span></td>
+ <td class="row1"><b class="genmed">{L_CONFIRM_CODE}{L_COLON}</b><br /><span class="gensmall">{L_CONFIRM_CODE_EXPLAIN}</span></td>
<td class="row2"><input class="post" type="text" name="confirm_code" size="8" maxlength="8"<!-- IF $CAPTCHA_TAB_INDEX --> tabindex="{$CAPTCHA_TAB_INDEX}"<!-- ENDIF --> />
<!-- IF S_CONFIRM_REFRESH --><input type="submit" name="refresh_vc" id="refresh_vc" class="btnlite" value="{L_VC_REFRESH}" /><!-- ENDIF --></td>
</tr>
diff --git a/phpBB/styles/subsilver2/template/captcha_qa.html b/phpBB/styles/subsilver2/template/captcha_qa.html
index 3a5778b33e..90a6492400 100644
--- a/phpBB/styles/subsilver2/template/captcha_qa.html
+++ b/phpBB/styles/subsilver2/template/captcha_qa.html
@@ -2,7 +2,7 @@
<th colspan="2" valign="middle">{L_CONFIRM_QUESTION}</th>
</tr>
<tr>
- <td class="row1"><b class="genmed">{QA_CONFIRM_QUESTION}:</b><br /><span class="gensmall">{L_CONFIRM_QUESTION_EXPLAIN}</span></td>
+ <td class="row1"><b class="genmed">{QA_CONFIRM_QUESTION}{L_COLON}</b><br /><span class="gensmall">{L_CONFIRM_QUESTION_EXPLAIN}</span></td>
<td class="row2"><input class="post" type="text" name="qa_answer" size="80"<!-- IF $CAPTCHA_TAB_INDEX --> tabindex="{$CAPTCHA_TAB_INDEX}"<!-- ENDIF --> />
<input type="hidden" name="qa_confirm_id" id="confirm_id" value="{QA_CONFIRM_ID}" /></td>
</tr>
diff --git a/phpBB/styles/subsilver2/template/captcha_recaptcha.html b/phpBB/styles/subsilver2/template/captcha_recaptcha.html
index ec09b28ef5..0d116b361f 100644
--- a/phpBB/styles/subsilver2/template/captcha_recaptcha.html
+++ b/phpBB/styles/subsilver2/template/captcha_recaptcha.html
@@ -3,7 +3,7 @@
<th colspan="2" valign="middle">{L_CONFIRM_CODE}</th>
</tr>
<tr>
- <td class="row1"><b class="genmed">{L_CONFIRM_CODE}:</b><br /><span class="gensmall">{L_RECAPTCHA_EXPLAIN}</span></td>
+ <td class="row1"><b class="genmed">{L_CONFIRM_CODE}{L_COLON}</b><br /><span class="gensmall">{L_RECAPTCHA_EXPLAIN}</span></td>
<td class="row2">
<script type="text/javascript">
// <![CDATA[
diff --git a/phpBB/styles/subsilver2/template/confirm_body.html b/phpBB/styles/subsilver2/template/confirm_body.html
index 92c2481c2d..1712017c38 100644
--- a/phpBB/styles/subsilver2/template/confirm_body.html
+++ b/phpBB/styles/subsilver2/template/confirm_body.html
@@ -9,7 +9,7 @@
<th>{MESSAGE_TITLE}</th>
</tr>
<tr>
- <td class="row1" align="center"><br /><p class="gen">{MESSAGE_TEXT}</p><br />{S_HIDDEN_FIELDS}<input type="submit" name="confirm" value="{YES_VALUE}" class="btnmain" />&nbsp;&nbsp;<input type="submit" name="cancel" value="{L_NO}" class="btnlite" /></td>
+ <td class="row1" align="center"><br /><p class="gen">{MESSAGE_TEXT}</p><br />{S_HIDDEN_FIELDS}<input type="submit" name="confirm" value="{YES_VALUE}" class="btnlite" />&nbsp;&nbsp;<input type="submit" name="cancel" value="{L_NO}" class="btnlite" /></td>
</tr>
</table>
@@ -25,4 +25,4 @@
<div align="{S_CONTENT_FLOW_END}"><!-- INCLUDE jumpbox.html --></div>
-<!-- INCLUDE overall_footer.html --> \ No newline at end of file
+<!-- INCLUDE overall_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/confirm_delete_body.html b/phpBB/styles/subsilver2/template/confirm_delete_body.html
new file mode 100644
index 0000000000..44aec9b60a
--- /dev/null
+++ b/phpBB/styles/subsilver2/template/confirm_delete_body.html
@@ -0,0 +1,55 @@
+<!-- INCLUDE overall_header.html -->
+
+<div id="pagecontent">
+
+ <form name="confirm" action="{S_CONFIRM_ACTION}" method="post">
+
+ <table class="tablebg" width="100%" cellspacing="1">
+ <tr>
+ <th>{MESSAGE_TITLE}</th>
+ </tr>
+ <tr>
+ <td class="row1" align="center">
+ <br />
+ <p class="gen">{MESSAGE_TEXT}</p>
+ <br />
+
+ <!-- IF not S_SHADOW_TOPICS -->
+ <table border="0" width="90%" cellspacing="2" cellpadding="1">
+ <!-- IF not S_SOFTDELETED and S_ALLOWED_DELETE and S_ALLOWED_SOFTDELETE -->
+ <tr>
+ <td class="row1" width="22%"><b class="gen">{L_DELETE_PERMANENTLY}{L_COLON}</b></td>
+ <td class="row1" width="78%">
+ <input id="delete_permanent" name="delete_permanent" type="checkbox" value="1" {S_CHECKED_PERMANENT} />
+ <!-- IF S_TOPIC_MODE -->{L_DELETE_TOPIC_PERMANENTLY}<!-- ELSE -->{L_DELETE_POST_PERMANENTLY}<!-- ENDIF -->
+ </td>
+ </tr>
+ <!-- ENDIF -->
+ <tr>
+ <td class="row1" valign="top"><span class="gen"><b>{L_DELETE_REASON}{L_COLON}</b></span><br /><span class="gensmall">{L_DELETE_REASON_EXPLAIN}</span></td>
+ <td class="row1"><input type="text" name="delete_reason" value="" class="inputbox autowidth" maxlength="120" size="45" /></td>
+ </tr>
+ </table>
+ <br />
+ <!-- ENDIF -->
+
+ {S_HIDDEN_FIELDS}
+ <input type="submit" name="confirm" value="{L_YES}" class="btnmain" />&nbsp;&nbsp;
+ <input type="submit" name="cancel" value="{L_NO}" class="btnlite" />
+ </td>
+ </tr>
+ </table>
+
+ </form>
+
+</div>
+
+<br clear="all" />
+
+<!-- INCLUDE breadcrumbs.html -->
+
+<br clear="all" />
+
+<div align="{S_CONTENT_FLOW_END}"><!-- INCLUDE jumpbox.html --></div>
+
+<!-- INCLUDE overall_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/custom_profile_fields.html b/phpBB/styles/subsilver2/template/custom_profile_fields.html
deleted file mode 100644
index c8f287ddb4..0000000000
--- a/phpBB/styles/subsilver2/template/custom_profile_fields.html
+++ /dev/null
@@ -1,31 +0,0 @@
-<!-- BEGIN dropdown -->
- <select name="{dropdown.FIELD_IDENT}">
- <!-- BEGIN options --><option value="{dropdown.options.OPTION_ID}"{dropdown.options.SELECTED}>{dropdown.options.VALUE}</option><!-- END options -->
- </select>
-<!-- END dropdown -->
-
-<!-- BEGIN text -->
- <textarea name="{text.FIELD_IDENT}" rows="{text.FIELD_ROWS}" cols="{text.FIELD_COLS}">{text.FIELD_VALUE}</textarea>
-<!-- END text -->
-
-<!-- BEGIN string -->
- <input type="text" class="post" name="{string.FIELD_IDENT}" size="{string.FIELD_LENGTH}" maxlength="{string.FIELD_MAXLEN}" value="{string.FIELD_VALUE}" />
-<!-- END string -->
-
-<!-- BEGIN bool -->
- <!-- IF bool.FIELD_LENGTH eq 1 -->
- <!-- BEGIN options --><input type="radio" class="radio" name="{bool.FIELD_IDENT}" value="{bool.options.OPTION_ID}"{bool.options.CHECKED} /><span class="genmed">{bool.options.VALUE}</span>&nbsp; &nbsp;<!-- END options -->
- <!-- ELSE -->
- <input type="checkbox" class="radio" name="{bool.FIELD_IDENT}" value="1"<!-- IF bool.FIELD_VALUE eq 1 --> checked="checked"<!-- ENDIF --> />
- <!-- ENDIF -->
-<!-- END bool -->
-
-<!-- BEGIN int -->
- <input type="text" class="post" name="{int.FIELD_IDENT}" size="{int.FIELD_LENGTH}" value="{int.FIELD_VALUE}" />
-<!-- END int -->
-
-<!-- BEGIN date -->
- <span class="genmed">{L_DAY}:</span> <select name="{date.FIELD_IDENT}_day">{date.S_DAY_OPTIONS}</select>
- <span class="genmed">{L_MONTH}:</span> <select name="{date.FIELD_IDENT}_month">{date.S_MONTH_OPTIONS}</select>
- <span class="genmed">{L_YEAR}:</span> <select name="{date.FIELD_IDENT}_year">{date.S_YEAR_OPTIONS}</select>
-<!-- END date -->
diff --git a/phpBB/styles/subsilver2/template/editor.js b/phpBB/styles/subsilver2/template/editor.js
deleted file mode 100644
index 103a271a71..0000000000
--- a/phpBB/styles/subsilver2/template/editor.js
+++ /dev/null
@@ -1,462 +0,0 @@
-/**
-* bbCode control by subBlue design [ www.subBlue.com ]
-* Includes unixsafe colour palette selector by SHS`
-*/
-
-// Startup variables
-var imageTag = false;
-var theSelection = false;
-var bbcodeEnabled = true;
-
-// Check for Browser & Platform for PC & IE specific bits
-// More details from: http://www.mozilla.org/docs/web-developer/sniffer/browser_type.html
-var clientPC = navigator.userAgent.toLowerCase(); // Get client info
-var clientVer = parseInt(navigator.appVersion); // Get browser version
-
-var is_ie = ((clientPC.indexOf('msie') != -1) && (clientPC.indexOf('opera') == -1));
-var is_win = ((clientPC.indexOf('win') != -1) || (clientPC.indexOf('16bit') != -1));
-
-var baseHeight;
-
-/**
-* Shows the help messages in the helpline window
-*/
-function helpline(help)
-{
- document.forms[form_name].helpbox.value = help_line[help];
-}
-
-/**
-* Fix a bug involving the TextRange object. From
-* http://www.frostjedi.com/terra/scripts/demo/caretBug.html
-*/
-function initInsertions()
-{
- var doc;
-
- if (document.forms[form_name])
- {
- doc = document;
- }
- else
- {
- doc = opener.document;
- }
-
- var textarea = doc.forms[form_name].elements[text_name];
- if (is_ie && typeof(baseHeight) != 'number')
- {
- textarea.focus();
- baseHeight = doc.selection.createRange().duplicate().boundingHeight;
-
- if (!document.forms[form_name])
- {
- document.body.focus();
- }
- }
-}
-
-/**
-* bbstyle
-*/
-function bbstyle(bbnumber)
-{
- if (bbnumber != -1)
- {
- bbfontstyle(bbtags[bbnumber], bbtags[bbnumber+1]);
- }
- else
- {
- insert_text('[*]');
- document.forms[form_name].elements[text_name].focus();
- }
-}
-
-/**
-* Apply bbcodes
-*/
-function bbfontstyle(bbopen, bbclose)
-{
- theSelection = false;
-
- var textarea = document.forms[form_name].elements[text_name];
-
- textarea.focus();
-
- if ((clientVer >= 4) && is_ie && is_win)
- {
- // Get text selection
- theSelection = document.selection.createRange().text;
-
- if (theSelection)
- {
- // Add tags around selection
- document.selection.createRange().text = bbopen + theSelection + bbclose;
- document.forms[form_name].elements[text_name].focus();
- theSelection = '';
- return;
- }
- }
- else if (document.forms[form_name].elements[text_name].selectionEnd && (document.forms[form_name].elements[text_name].selectionEnd - document.forms[form_name].elements[text_name].selectionStart > 0))
- {
- mozWrap(document.forms[form_name].elements[text_name], bbopen, bbclose);
- document.forms[form_name].elements[text_name].focus();
- theSelection = '';
- return;
- }
-
- //The new position for the cursor after adding the bbcode
- var caret_pos = getCaretPosition(textarea).start;
- var new_pos = caret_pos + bbopen.length;
-
- // Open tag
- insert_text(bbopen + bbclose);
-
- // Center the cursor when we don't have a selection
- // Gecko and proper browsers
- if (!isNaN(textarea.selectionStart))
- {
- textarea.selectionStart = new_pos;
- textarea.selectionEnd = new_pos;
- }
- // IE
- else if (document.selection)
- {
- var range = textarea.createTextRange();
- range.move("character", new_pos);
- range.select();
- storeCaret(textarea);
- }
-
- textarea.focus();
- return;
-}
-
-/**
-* Insert text at position
-*/
-function insert_text(text, spaces, popup)
-{
- var textarea;
-
- if (!popup)
- {
- textarea = document.forms[form_name].elements[text_name];
- }
- else
- {
- textarea = opener.document.forms[form_name].elements[text_name];
- }
- if (spaces)
- {
- text = ' ' + text + ' ';
- }
-
- // Since IE9, IE also has textarea.selectionStart, but it still needs to be treated the old way.
- // Therefore we simply add a !is_ie here until IE fixes the text-selection completely.
- if (!isNaN(textarea.selectionStart) && !is_ie)
- {
- var sel_start = textarea.selectionStart;
- var sel_end = textarea.selectionEnd;
-
- mozWrap(textarea, text, '');
- textarea.selectionStart = sel_start + text.length;
- textarea.selectionEnd = sel_end + text.length;
- }
-
- else if (textarea.createTextRange && textarea.caretPos)
- {
- if (baseHeight != textarea.caretPos.boundingHeight)
- {
- textarea.focus();
- storeCaret(textarea);
- }
- var caret_pos = textarea.caretPos;
- caret_pos.text = caret_pos.text.charAt(caret_pos.text.length - 1) == ' ' ? caret_pos.text + text + ' ' : caret_pos.text + text;
-
- }
- else
- {
- textarea.value = textarea.value + text;
- }
- if (!popup)
- {
- textarea.focus();
- }
-
-}
-
-/**
-* Add inline attachment at position
-*/
-function attach_inline(index, filename)
-{
- insert_text('[attachment=' + index + ']' + filename + '[/attachment]');
- document.forms[form_name].elements[text_name].focus();
-}
-
-/**
-* Add quote text to message
-*/
-function addquote(post_id, username, l_wrote)
-{
- var message_name = 'message_' + post_id;
- var theSelection = '';
- var divarea = false;
-
- if (l_wrote === undefined)
- {
- // Backwards compatibility
- l_wrote = 'wrote';
- }
-
- if (document.all)
- {
- divarea = document.all[message_name];
- }
- else
- {
- divarea = document.getElementById(message_name);
- }
-
- // Get text selection - not only the post content :(
- // IE9 must use the document.selection method but has the *.getSelection so we just force no IE
- if (window.getSelection && !is_ie && !window.opera)
- {
- theSelection = window.getSelection().toString();
- }
- else if (document.getSelection && !is_ie)
- {
- theSelection = document.getSelection();
- }
- else if (document.selection)
- {
- theSelection = document.selection.createRange().text;
- }
-
- if (theSelection == '' || typeof theSelection == 'undefined' || theSelection == null)
- {
- if (divarea.innerHTML)
- {
- theSelection = divarea.innerHTML.replace(/<br>/ig, '\n');
- theSelection = theSelection.replace(/<br\/>/ig, '\n');
- theSelection = theSelection.replace(/&lt\;/ig, '<');
- theSelection = theSelection.replace(/&gt\;/ig, '>');
- theSelection = theSelection.replace(/&amp\;/ig, '&');
- theSelection = theSelection.replace(/&nbsp\;/ig, ' ');
- }
- else if (document.all)
- {
- theSelection = divarea.innerText;
- }
- else if (divarea.textContent)
- {
- theSelection = divarea.textContent;
- }
- else if (divarea.firstChild.nodeValue)
- {
- theSelection = divarea.firstChild.nodeValue;
- }
- }
-
- if (theSelection)
- {
- if (bbcodeEnabled)
- {
- insert_text('[quote="' + username + '"]' + theSelection + '[/quote]');
- }
- else
- {
- insert_text(username + ' ' + l_wrote + ':' + '\n');
- var lines = split_lines(theSelection);
- for (i = 0; i < lines.length; i++)
- {
- insert_text('> ' + lines[i] + '\n');
- }
- }
- }
-
- return;
-}
-
-
-function split_lines(text)
-{
- var lines = text.split('\n');
- var splitLines = new Array();
- var j = 0;
- for(i = 0; i < lines.length; i++)
- {
- if (lines[i].length <= 80)
- {
- splitLines[j] = lines[i];
- j++;
- }
- else
- {
- var line = lines[i];
- do
- {
- var splitAt = line.indexOf(' ', 80);
-
- if (splitAt == -1)
- {
- splitLines[j] = line;
- j++;
- }
- else
- {
- splitLines[j] = line.substring(0, splitAt);
- line = line.substring(splitAt);
- j++;
- }
- }
- while(splitAt != -1);
- }
- }
- return splitLines;
-}
-
-/**
-* From http://www.massless.org/mozedit/
-*/
-function mozWrap(txtarea, open, close)
-{
- var selLength = (typeof(txtarea.textLength) == 'undefined') ? txtarea.value.length : txtarea.textLength;
- var selStart = txtarea.selectionStart;
- var selEnd = txtarea.selectionEnd;
- var scrollTop = txtarea.scrollTop;
-
- if (selEnd == 1 || selEnd == 2)
- {
- selEnd = selLength;
- }
-
- var s1 = (txtarea.value).substring(0,selStart);
- var s2 = (txtarea.value).substring(selStart, selEnd);
- var s3 = (txtarea.value).substring(selEnd, selLength);
-
- txtarea.value = s1 + open + s2 + close + s3;
- txtarea.selectionStart = selStart + open.length;
- txtarea.selectionEnd = selEnd + open.length;
- txtarea.focus();
- txtarea.scrollTop = scrollTop;
-
- return;
-}
-
-/**
-* Insert at Caret position. Code from
-* http://www.faqts.com/knowledge_base/view.phtml/aid/1052/fid/130
-*/
-function storeCaret(textEl)
-{
- if (textEl.createTextRange && document.selection)
- {
- textEl.caretPos = document.selection.createRange().duplicate();
- }
-}
-
-/**
-* Color pallette
-*/
-function colorPalette(dir, width, height)
-{
- var r = 0, g = 0, b = 0;
- var numberList = new Array(6);
- var color = '';
-
- numberList[0] = '00';
- numberList[1] = '40';
- numberList[2] = '80';
- numberList[3] = 'BF';
- numberList[4] = 'FF';
-
- document.writeln('<table cellspacing="1" cellpadding="0" border="0">');
-
- for (r = 0; r < 5; r++)
- {
- if (dir == 'h')
- {
- document.writeln('<tr>');
- }
-
- for (g = 0; g < 5; g++)
- {
- if (dir == 'v')
- {
- document.writeln('<tr>');
- }
-
- for (b = 0; b < 5; b++)
- {
- color = String(numberList[r]) + String(numberList[g]) + String(numberList[b]);
- document.write('<td bgcolor="#' + color + '" style="width: ' + width + 'px; height: ' + height + 'px;">');
- document.write('<a href="#" onclick="bbfontstyle(\'[color=#' + color + ']\', \'[/color]\'); return false;"><img src="images/spacer.gif" width="' + width + '" height="' + height + '" alt="#' + color + '" title="#' + color + '" /></a>');
- document.writeln('</td>');
- }
-
- if (dir == 'v')
- {
- document.writeln('</tr>');
- }
- }
-
- if (dir == 'h')
- {
- document.writeln('</tr>');
- }
- }
- document.writeln('</table>');
-}
-
-
-/**
-* Caret Position object
-*/
-function caretPosition()
-{
- var start = null;
- var end = null;
-}
-
-
-/**
-* Get the caret position in an textarea
-*/
-function getCaretPosition(txtarea)
-{
- var caretPos = new caretPosition();
-
- // simple Gecko/Opera way
- if(txtarea.selectionStart || txtarea.selectionStart == 0)
- {
- caretPos.start = txtarea.selectionStart;
- caretPos.end = txtarea.selectionEnd;
- }
- // dirty and slow IE way
- else if(document.selection)
- {
- // get current selection
- var range = document.selection.createRange();
-
- // a new selection of the whole textarea
- var range_all = document.body.createTextRange();
- range_all.moveToElementText(txtarea);
-
- // calculate selection start point by moving beginning of range_all to beginning of range
- var sel_start;
- for (sel_start = 0; range_all.compareEndPoints('StartToStart', range) < 0; sel_start++)
- {
- range_all.moveStart('character', 1);
- }
-
- txtarea.sel_start = sel_start;
-
- // we ignore the end value for IE, this is already dirty enough and we don't need it
- caretPos.start = txtarea.sel_start;
- caretPos.end = txtarea.sel_start;
- }
-
- return caretPos;
-}
diff --git a/phpBB/styles/subsilver2/template/faq_body.html b/phpBB/styles/subsilver2/template/faq_body.html
index 6a4df3659c..b3c41e932a 100644
--- a/phpBB/styles/subsilver2/template/faq_body.html
+++ b/phpBB/styles/subsilver2/template/faq_body.html
@@ -1,6 +1,6 @@
<!-- INCLUDE overall_header.html -->
-<a name="faqtop"></a>
+<a name="faqtop" class="anchor"></a>
<div id="pagecontent">
@@ -38,7 +38,7 @@
<!-- ELSE -->
<td class="row2" valign="top">
<!-- ENDIF -->
- <div class="postbody"><a name="f{faq_block.S_ROW_COUNT}r{faq_block.faq_row.S_ROW_COUNT}"></a><b>&#187; {faq_block.faq_row.FAQ_QUESTION}</b></div>
+ <div class="postbody"><a name="f{faq_block.S_ROW_COUNT}r{faq_block.faq_row.S_ROW_COUNT}" class="anchor"></a><b>&#187; {faq_block.faq_row.FAQ_QUESTION}</b></div>
<div class="postbody">{faq_block.faq_row.FAQ_ANSWER}</div>
<p class="gensmall"><a href="#faqtop">{L_BACK_TO_TOP}</a></p>
</td>
@@ -60,4 +60,4 @@
<div align="{S_CONTENT_FLOW_END}"><!-- INCLUDE jumpbox.html --></div>
-<!-- INCLUDE overall_footer.html --> \ No newline at end of file
+<!-- INCLUDE overall_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/forumlist_body.html b/phpBB/styles/subsilver2/template/forumlist_body.html
index a994e9e676..6b7f884aaa 100644
--- a/phpBB/styles/subsilver2/template/forumlist_body.html
+++ b/phpBB/styles/subsilver2/template/forumlist_body.html
@@ -9,23 +9,25 @@
<th>&nbsp;{L_LAST_POST}&nbsp;</th>
</tr>
<!-- BEGIN forumrow -->
+ <!-- EVENT forumlist_body_category_header_before -->
<!-- IF forumrow.S_IS_CAT -->
<tr>
<td class="cat" colspan="2"><h4><a href="{forumrow.U_VIEWFORUM}">{forumrow.FORUM_NAME}</a></h4></td>
<td class="catdiv" colspan="3">&nbsp;</td>
</tr>
+ <!-- EVENT forumlist_body_category_header_after -->
<!-- ELSEIF forumrow.S_IS_LINK -->
<tr>
<td class="row1" width="50" align="center">{forumrow.FORUM_FOLDER_IMG}</td>
<td class="row1">
<!-- IF forumrow.FORUM_IMAGE -->
- <div style="float: {S_CONTENT_FLOW_BEGIN}; margin-{S_CONTENT_FLOW_END}: 5px;">{forumrow.FORUM_IMAGE}</div>
+ <div style="float: {S_CONTENT_FLOW_BEGIN}; margin-{S_CONTENT_FLOW_END}{L_COLON} 5px;">{forumrow.FORUM_IMAGE}</div>
<!-- ENDIF -->
<a class="forumlink" href="{forumrow.U_VIEWFORUM}">{forumrow.FORUM_NAME}</a>
<p class="forumdesc">{forumrow.FORUM_DESC}</p>
</td>
<!-- IF forumrow.CLICKS -->
- <td class="row2" colspan="3" align="center"><span class="genmed">{L_REDIRECTS}: {forumrow.CLICKS}</span></td>
+ <td class="row2" colspan="3" align="center"><span class="genmed">{L_REDIRECTS}{L_COLON} {forumrow.CLICKS}</span></td>
<!-- ELSE -->
<td class="row2" colspan="3" align="center">&nbsp;</td>
<!-- ENDIF -->
@@ -37,38 +39,60 @@
<td class="catdiv" colspan="3">&nbsp;</td>
</tr>
<!-- ENDIF -->
+ <!-- EVENT forumlist_body_forum_row_before -->
<tr>
+ <!-- EVENT forumlist_body_forum_row_prepend -->
<td class="row1" width="50" align="center">{forumrow.FORUM_FOLDER_IMG}</td>
<td class="row1" width="100%">
<!-- IF forumrow.FORUM_IMAGE -->
- <div style="float: {S_CONTENT_FLOW_BEGIN}; margin-{S_CONTENT_FLOW_END}: 5px;">{forumrow.FORUM_IMAGE}</div>
+ <div style="float: {S_CONTENT_FLOW_BEGIN}; margin-{S_CONTENT_FLOW_END}{L_COLON} 5px;">{forumrow.FORUM_IMAGE}</div>
<!-- ENDIF -->
<a class="forumlink" href="{forumrow.U_VIEWFORUM}">{forumrow.FORUM_NAME}</a>
<p class="forumdesc">{forumrow.FORUM_DESC}</p>
<!-- IF forumrow.MODERATORS -->
- <p class="forumdesc"><strong>{forumrow.L_MODERATOR_STR}:</strong> {forumrow.MODERATORS}</p>
+ <p class="forumdesc"><strong>{forumrow.L_MODERATOR_STR}{L_COLON}</strong> {forumrow.MODERATORS}</p>
<!-- ENDIF -->
- <!-- IF forumrow.SUBFORUMS and forumrow.S_LIST_SUBFORUMS -->
- <p class="forumdesc"><strong>{forumrow.L_SUBFORUM_STR}</strong> {forumrow.SUBFORUMS}</p>
+ <!-- IF .forumrow.subforum and forumrow.S_LIST_SUBFORUMS -->
+ <!-- EVENT forumlist_body_subforums_before -->
+ <p class="forumdesc"><strong>{forumrow.L_SUBFORUM_STR}{L_COLON}</strong>
+ <!-- BEGIN subforum -->
+ <!-- EVENT forumlist_body_subforum_link_prepend --><a href="{forumrow.subforum.U_SUBFORUM}" class="subforum<!-- IF forumrow.subforum.S_UNREAD --> unread<!-- ELSE --> read<!-- ENDIF -->" title="<!-- IF forumrow.subforum.S_UNREAD -->{L_UNREAD_POSTS}<!-- ELSE -->{L_NO_UNREAD_POSTS}<!-- ENDIF -->">{forumrow.subforum.SUBFORUM_NAME}</a><!-- IF not forumrow.subforum.S_LAST_ROW -->{L_COMMA_SEPARATOR}<!-- ENDIF --><!-- EVENT forumlist_body_subforum_link_append -->
+ <!-- END subforum -->
+ </p>
+ <!-- EVENT forumlist_body_subforums_after -->
<!-- ENDIF -->
</td>
<td class="row2" align="center"><p class="topicdetails">{forumrow.TOPICS}</p></td>
<td class="row2" align="center"><p class="topicdetails">{forumrow.POSTS}</p></td>
<td class="row2" align="center" nowrap="nowrap">
<!-- IF forumrow.LAST_POST_TIME -->
- <p class="topicdetails"><!-- IF forumrow.U_UNAPPROVED_TOPICS --><a href="{forumrow.U_UNAPPROVED_TOPICS}">{UNAPPROVED_IMG}</a>&nbsp;<!-- ENDIF -->{forumrow.LAST_POST_TIME}</p>
+ <!-- IF forumrow.S_DISPLAY_SUBJECT -->
+ <!-- EVENT forumlist_body_last_post_title_prepend -->
+ <p class="topicdetails"><a href="{forumrow.U_LAST_POST}" title="{forumrow.LAST_POST_SUBJECT}" class="lastsubject">{forumrow.LAST_POST_SUBJECT_TRUNCATED}</a></p>
+ <!-- ENDIF -->
+ <p class="topicdetails">
+ <!-- IF forumrow.U_UNAPPROVED_TOPICS -->
+ <a href="{forumrow.U_UNAPPROVED_TOPICS}" class="imageset">{UNAPPROVED_IMG}</a>&nbsp;
+ <!-- ELSEIF forumrow.U_UNAPPROVED_POSTS -->
+ <a href="{forumrow.U_UNAPPROVED_POSTS}" class="imageset">{UNAPPROVED_POST_IMG}</a>&nbsp;
+ <!-- ENDIF -->
+ {forumrow.LAST_POST_TIME}
+ </p>
<p class="topicdetails">{forumrow.LAST_POSTER_FULL}
- <!-- IF not S_IS_BOT --><a href="{forumrow.U_LAST_POST}">{LAST_POST_IMG}</a><!-- ENDIF -->
+ <!-- IF not S_IS_BOT --><a href="{forumrow.U_LAST_POST}" class="imageset">{LAST_POST_IMG}</a><!-- ENDIF -->
</p>
<!-- ELSE -->
<p class="topicdetails">{L_NO_POSTS}</p>
<!-- ENDIF -->
</td>
+ <!-- EVENT forumlist_body_forum_row_append -->
</tr>
+ <!-- EVENT forumlist_body_forum_row_after -->
<!-- ENDIF -->
+ <!-- EVENT forumlist_body_last_row_after -->
<!-- BEGINELSE -->
<tr>
<td class="row1" colspan="5" align="center"><p class="gensmall">{L_NO_FORUMS}</p></td>
</tr>
<!-- END forumrow -->
-</table> \ No newline at end of file
+</table>
diff --git a/phpBB/styles/subsilver2/template/index.htm b/phpBB/styles/subsilver2/template/index.htm
index 4763c05f0e..a1356823e2 100644
--- a/phpBB/styles/subsilver2/template/index.htm
+++ b/phpBB/styles/subsilver2/template/index.htm
@@ -1,7 +1,7 @@
<html>
<head>
<title>subSilver created by subBlue Design</title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>
<body bgcolor="#FFFFFF" text="#000000">
diff --git a/phpBB/styles/subsilver2/template/index_body.html b/phpBB/styles/subsilver2/template/index_body.html
index 8faf76e9ee..de1523b11c 100644
--- a/phpBB/styles/subsilver2/template/index_body.html
+++ b/phpBB/styles/subsilver2/template/index_body.html
@@ -1,27 +1,46 @@
<!-- INCLUDE overall_header.html -->
-<!-- IF U_MCP -->
+<!-- EVENT index_body_markforums_before -->
+
+<!-- IF U_MCP or U_ACP -->
<div id="pageheader">
- <p class="linkmcp">[ <a href="{U_MCP}">{L_MCP}</a> ]</p>
+ <p class="linkmcp">[&nbsp;<!-- IF U_ACP --><a href="{U_ACP}">{L_ACP}</a><!-- IF U_MCP -->&nbsp;|&nbsp;<!-- ENDIF --><!-- ENDIF --><!-- IF U_MCP --><a href="{U_MCP}">{L_MCP}</a><!-- ENDIF -->&nbsp;]</p>
</div>
<br clear="all" /><br />
<!-- ENDIF -->
+<!-- EVENT index_body_markforums_after -->
+
<!-- INCLUDE forumlist_body.html -->
+<!-- EVENT index_body_forumlist_body_after -->
+
<!-- IF not S_IS_BOT or U_TEAM -->
-<span class="gensmall"><!-- IF not S_IS_BOT --><a href="{U_DELETE_COOKIES}">{L_DELETE_COOKIES}</a><!-- ENDIF --><!-- IF not S_IS_BOT and U_TEAM --> | <!-- ENDIF --><!-- IF U_TEAM --><a href="{U_TEAM}">{L_THE_TEAM}</a><!-- ENDIF --></span><br />
+<span class="gensmall">
+ <!-- IF not S_IS_BOT --><a href="{U_DELETE_COOKIES}">{L_DELETE_COOKIES}</a><!-- ENDIF -->
+ <!-- IF not S_IS_BOT and U_TEAM --> | <!-- ENDIF -->
+ <!-- EVENT overall_footer_teamlink_before -->
+ <!-- IF U_TEAM --><a href="{U_TEAM}">{L_THE_TEAM}</a><!-- ENDIF -->
+ <!-- IF U_CONTACT_US -->
+ <!-- IF U_TEAM --> | <!-- ENDIF -->
+ <a href="{U_CONTACT_US}">{L_CONTACT_US}</a>
+ <!-- ENDIF -->
+ <!-- EVENT overall_footer_teamlink_after -->
+</span>
<!-- ENDIF -->
+<br />
<br clear="all" />
<!-- INCLUDE breadcrumbs.html -->
+<!-- EVENT index_body_stat_blocks_before -->
+
<!-- IF S_DISPLAY_ONLINE_LIST -->
<br clear="all" />
- <table class="tablebg" width="100%" cellspacing="1">
+ <table class="tablebg stat-block online-list" width="100%" cellspacing="1">
<tr>
<td class="cat" colspan="2"><!-- IF U_VIEWONLINE --><h4><a href="{U_VIEWONLINE}">{L_WHO_IS_ONLINE}</a></h4><!-- ELSE --><h4>{L_WHO_IS_ONLINE}</h4><!-- ENDIF --></td>
</tr>
@@ -31,7 +50,13 @@
<!-- ELSE -->
<td class="row1" align="center" valign="middle"><img src="{T_THEME_PATH}/images/whosonline.gif" alt="{L_WHO_IS_ONLINE}" /></td>
<!-- ENDIF -->
- <td class="row1" width="100%"><span class="genmed">{TOTAL_USERS_ONLINE} ({L_ONLINE_EXPLAIN})<br />{RECORD_USERS}<br /><br />{LOGGED_IN_USER_LIST}</span></td>
+ <td class="row1" width="100%">
+ <span class="genmed">
+ <!-- EVENT index_body_block_online_prepend -->
+ {TOTAL_USERS_ONLINE} ({L_ONLINE_EXPLAIN})<br />{RECORD_USERS}<br /><br />{LOGGED_IN_USER_LIST}
+ <!-- EVENT index_body_block_online_append -->
+ </span>
+ </td>
</tr>
<!-- IF LEGEND -->
<tr>
@@ -41,32 +66,48 @@
</table>
<!-- ENDIF -->
+<!-- EVENT index_body_birthday_block_before -->
+
<!-- IF S_DISPLAY_BIRTHDAY_LIST -->
<br clear="all" />
- <table class="tablebg" width="100%" cellspacing="1">
+ <table class="tablebg stat-block birthday-list" width="100%" cellspacing="1">
<tr>
<td class="cat" colspan="2"><h4>{L_BIRTHDAYS}</h4></td>
</tr>
<tr>
<td class="row1" align="center" valign="middle"><img src="{T_THEME_PATH}/images/whosonline.gif" alt="{L_BIRTHDAYS}" /></td>
- <td class="row1" width="100%"><p class="genmed"><!-- IF BIRTHDAY_LIST -->{L_CONGRATULATIONS}: <b>{BIRTHDAY_LIST}</b><!-- ELSE -->{L_NO_BIRTHDAYS}<!-- ENDIF --></p></td>
+ <td class="row1" width="100%">
+ <p class="genmed">
+ <!-- EVENT index_body_block_birthday_prepend -->
+ <!-- IF .birthdays -->{L_CONGRATULATIONS}{L_COLON} <b><!-- BEGIN birthdays -->{birthdays.USERNAME}<!-- IF birthdays.AGE !== '' --> ({birthdays.AGE})<!-- ENDIF --><!-- IF not birthdays.S_LAST_ROW -->, <!-- ENDIF --><!-- END birthdays --></b><!-- ELSE -->{L_NO_BIRTHDAYS}<!-- ENDIF -->
+ <!-- EVENT index_body_block_birthday_append -->
+ </p>
+ </td>
</tr>
</table>
<!-- ENDIF -->
<br clear="all" />
-<table class="tablebg" width="100%" cellspacing="1">
+<table class="tablebg stat-block statistics" width="100%" cellspacing="1">
<tr>
<td class="cat" colspan="2"><h4>{L_STATISTICS}</h4></td>
</tr>
<tr>
<td class="row1"><img src="{T_THEME_PATH}/images/whosonline.gif" alt="{L_STATISTICS}" /></td>
- <td class="row1" width="100%" valign="middle"><p class="genmed">{TOTAL_POSTS} | {TOTAL_TOPICS} | {TOTAL_USERS} | {NEWEST_USER}</p></td>
+ <td class="row1" width="100%" valign="middle">
+ <p class="genmed">
+ <!-- EVENT index_body_block_stats_prepend -->
+ {TOTAL_POSTS} | {TOTAL_TOPICS} | {TOTAL_USERS} | {NEWEST_USER}
+ <!-- EVENT index_body_block_stats_append -->
+ </p>
+ </td>
</tr>
</table>
+<!-- EVENT index_body_stat_blocks_after -->
+
<!-- IF not S_USER_LOGGED_IN and not S_IS_BOT -->
<br clear="all" />
@@ -77,7 +118,7 @@
<td class="cat"><h4><a href="{U_LOGIN_LOGOUT}">{L_LOGIN_LOGOUT}</a></h4></td>
</tr>
<tr>
- <td class="row1" align="center"><span class="genmed">{L_USERNAME}:</span> <input class="post" type="text" name="username" size="10" />&nbsp; <span class="genmed">{L_PASSWORD}:</span> <input class="post" type="password" name="password" size="10" />&nbsp; <!-- IF S_AUTOLOGIN_ENABLED --> <span class="gensmall">{L_LOG_ME_IN}</span> <input type="checkbox" class="radio" name="autologin" /><!-- ENDIF -->&nbsp; <input type="submit" class="btnmain" name="login" value="{L_LOGIN}" /></td>
+ <td class="row1" align="center"><span class="genmed">{L_USERNAME}{L_COLON}</span> <input class="post" type="text" name="username" size="10" />&nbsp; <span class="genmed">{L_PASSWORD}{L_COLON}</span> <input class="post" type="password" name="password" size="10" autocomplete="off" />&nbsp; <!-- IF U_SEND_PASSWORD --><a href="{U_SEND_PASSWORD}">{L_FORGOT_PASS}</a>&nbsp; <!-- ENDIF --> <!-- IF S_AUTOLOGIN_ENABLED --> <span class="gensmall">{L_LOG_ME_IN}</span> <input type="checkbox" class="radio" name="autologin" /><!-- ENDIF -->&nbsp; <input type="submit" class="btnmain" name="login" value="{L_LOGIN}" /></td>
</tr>
</table>
{S_LOGIN_REDIRECT}
@@ -100,4 +141,4 @@
</tr>
</table>
-<!-- INCLUDE overall_footer.html --> \ No newline at end of file
+<!-- INCLUDE overall_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/jumpbox.html b/phpBB/styles/subsilver2/template/jumpbox.html
index f46fed9f27..e0603c6a6e 100644
--- a/phpBB/styles/subsilver2/template/jumpbox.html
+++ b/phpBB/styles/subsilver2/template/jumpbox.html
@@ -1,10 +1,10 @@
<!-- IF S_DISPLAY_JUMPBOX -->
- <form method="post" name="jumpbox" action="{S_JUMPBOX_ACTION}" onsubmit="if(document.jumpbox.f.value == -1){return false;}">
+ <form method="get" name="jumpbox" action="{S_JUMPBOX_ACTION}" onsubmit="if(document.jumpbox.f.value == -1){return false;}">
<table cellspacing="0" cellpadding="0" border="0">
<tr>
- <td nowrap="nowrap"><span class="gensmall"><!-- IF S_IN_MCP and S_MERGE_SELECT -->{L_SELECT_TOPICS_FROM}<!-- ELSEIF S_IN_MCP -->{L_MODERATE_FORUM}<!-- ELSE -->{L_JUMP_TO}<!-- ENDIF -->:</span>&nbsp;<select name="f" onchange="if(this.options[this.selectedIndex].value != -1){ document.forms['jumpbox'].submit() }">
+ <td nowrap="nowrap">{HIDDEN_FIELDS_FOR_JUMPBOX}<span class="gensmall"><!-- IF S_IN_MCP and S_MERGE_SELECT -->{L_SELECT_TOPICS_FROM}<!-- ELSEIF S_IN_MCP -->{L_MODERATE_FORUM}<!-- ELSE -->{L_JUMP_TO}<!-- ENDIF -->{L_COLON}</span>&nbsp;<select name="f" onchange="if(this.options[this.selectedIndex].value != -1){ document.forms['jumpbox'].submit() }">
<!-- BEGIN jumpbox_forums -->
<!-- IF jumpbox_forums.S_FORUM_COUNT eq 1 --><option value="-1">------------------</option><!-- ENDIF -->
@@ -16,4 +16,4 @@
</table>
</form>
-<!-- ENDIF --> \ No newline at end of file
+<!-- ENDIF -->
diff --git a/phpBB/styles/subsilver2/template/login_body.html b/phpBB/styles/subsilver2/template/login_body.html
index ba316517a9..1067f3738d 100644
--- a/phpBB/styles/subsilver2/template/login_body.html
+++ b/phpBB/styles/subsilver2/template/login_body.html
@@ -34,7 +34,7 @@
<!-- ENDIF -->
<tr>
- <td valign="top" <!-- IF S_ADMIN_AUTH -->style="width: 50%; text-align: {S_CONTENT_FLOW_END};"<!-- ENDIF -->><b class="gensmall">{L_USERNAME}:</b></td>
+ <td valign="top" <!-- IF S_ADMIN_AUTH -->style="width: 50%; text-align: {S_CONTENT_FLOW_END};"<!-- ENDIF -->><b class="gensmall">{L_USERNAME}{L_COLON}</b></td>
<td><input class="post" type="text" name="{USERNAME_CREDENTIAL}" size="25" value="{USERNAME}" tabindex="1" />
<!-- IF not S_ADMIN_AUTH and S_REGISTER_ENABLED -->
<br /><a class="gensmall" href="{U_REGISTER}">{L_REGISTER}</a>
@@ -42,9 +42,9 @@
</td>
</tr>
<tr>
- <td valign="top" <!-- IF S_ADMIN_AUTH -->style="width: 50%; text-align: {S_CONTENT_FLOW_END};"<!-- ENDIF -->><b class="gensmall">{L_PASSWORD}:</b></td>
+ <td valign="top" <!-- IF S_ADMIN_AUTH -->style="width: 50%; text-align: {S_CONTENT_FLOW_END};"<!-- ENDIF -->><b class="gensmall">{L_PASSWORD}{L_COLON}</b></td>
<td>
- <input class="post" type="password" name="{PASSWORD_CREDENTIAL}" size="25" tabindex="2" />
+ <input class="post" type="password" name="{PASSWORD_CREDENTIAL}" size="25" tabindex="2" autocomplete="off" />
<!-- IF U_SEND_PASSWORD --><br /><a class="gensmall" href="{U_SEND_PASSWORD}">{L_FORGOT_PASS}</a><!-- ENDIF -->
<!-- IF U_RESEND_ACTIVATION and not S_ADMIN_AUTH --><br /><a class="gensmall" href="{U_RESEND_ACTIVATION}">{L_RESEND_ACTIVATION}</a><!-- ENDIF -->
</td>
@@ -61,6 +61,9 @@
<td><input type="checkbox" class="radio" name="viewonline" tabindex="4" /> <span class="gensmall">{L_HIDE_ME}</span></td>
</tr>
<!-- ENDIF -->
+ <!-- IF not S_ADMIN_AUTH and PROVIDER_TEMPLATE_FILE -->
+ <!-- INCLUDE {PROVIDER_TEMPLATE_FILE} -->
+ <!-- ENDIF -->
</table>
</td>
</tr>
diff --git a/phpBB/styles/subsilver2/template/login_body_oauth.html b/phpBB/styles/subsilver2/template/login_body_oauth.html
new file mode 100644
index 0000000000..6f374fa4f2
--- /dev/null
+++ b/phpBB/styles/subsilver2/template/login_body_oauth.html
@@ -0,0 +1,7 @@
+<!-- BEGIN oauth -->
+ <tr>
+ <td>
+ <a href="{oauth.REDIRECT_URL}">{oauth.SERVICE_NAME}</a>
+ </td>
+ </tr>
+<!-- END oauth -->
diff --git a/phpBB/styles/subsilver2/template/login_forum.html b/phpBB/styles/subsilver2/template/login_forum.html
index e91a406611..2cda9f3452 100644
--- a/phpBB/styles/subsilver2/template/login_forum.html
+++ b/phpBB/styles/subsilver2/template/login_forum.html
@@ -29,8 +29,8 @@
</tr>
<!-- ENDIF -->
<tr>
- <td class="gensmall"><b>{L_PASSWORD}:</b></td>
- <td><input class="post" type="password" name="password" size="25" tabindex="2" /></td>
+ <td class="gensmall"><b>{L_PASSWORD}{L_COLON}</b></td>
+ <td><input class="post" type="password" name="password" size="25" tabindex="2" autocomplete="off" /></td>
</tr>
</table>
</td>
@@ -53,4 +53,4 @@
<div align="{S_CONTENT_FLOW_END}"><!-- INCLUDE jumpbox.html --></div>
-<!-- INCLUDE overall_footer.html --> \ No newline at end of file
+<!-- INCLUDE overall_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/mcp_approve.html b/phpBB/styles/subsilver2/template/mcp_approve.html
index 2d2013f05c..8c2ef0806b 100644
--- a/phpBB/styles/subsilver2/template/mcp_approve.html
+++ b/phpBB/styles/subsilver2/template/mcp_approve.html
@@ -16,15 +16,15 @@
<!-- IF S_NOTIFY_POSTER -->
<input type="checkbox" class="radio" name="notify_poster" checked="checked" /><span class="gen"><!-- IF S_APPROVE -->{L_NOTIFY_POSTER_APPROVAL}<!-- ELSE -->{L_NOTIFY_POSTER_DISAPPROVAL}<!-- ENDIF --></span><br />
<!-- ENDIF -->
- <!-- IF not S_APPROVE -->
+ <!-- IF not S_APPROVE and not S_RESTORE and .reason -->
<br />
<table border="0" width="90%" cellspacing="2" cellpadding="1">
<tr>
- <td class="row1" width="22%"><b class="gen">{L_DISAPPROVE_REASON}:</b></td>
+ <td class="row1" width="22%"><b class="gen">{L_DISAPPROVE_REASON}{L_COLON}</b></td>
<td class="row1" width="78%"><select name="reason_id"><!-- BEGIN reason --><option value="{reason.ID}"<!-- IF reason.S_SELECTED --> selected="selected"<!-- ENDIF -->>{reason.DESCRIPTION}</option><!-- END reason --></select></td>
</tr>
<tr>
- <td class="row1" valign="top"><span class="gen"><b>{L_MORE_INFO}:</b></span><br /><span class="gensmall">{L_CAN_LEAVE_BLANK}</span></td>
+ <td class="row1" valign="top"><span class="gen"><b>{L_MORE_INFO}{L_COLON}</b></span><br /><span class="gensmall">{L_CAN_LEAVE_BLANK}</span></td>
<td class="row1"><textarea class="post" style="width:500px" name="reason" rows="10" cols="40">{REASON}</textarea></td>
</tr>
</table>
diff --git a/phpBB/styles/subsilver2/template/mcp_ban.html b/phpBB/styles/subsilver2/template/mcp_ban.html
index 706c8b2cd2..cc24d21d73 100644
--- a/phpBB/styles/subsilver2/template/mcp_ban.html
+++ b/phpBB/styles/subsilver2/template/mcp_ban.html
@@ -5,27 +5,34 @@
var ban_length = new Array();
ban_length[-1] = '';
- <!-- BEGIN ban_length -->
- ban_length['{ban_length.BAN_ID}'] = '{ban_length.A_LENGTH}';
- <!-- END ban_length -->
-
var ban_reason = new Array();
ban_reason[-1] = '';
- <!-- BEGIN ban_reason -->
- ban_reason['{ban_reason.BAN_ID}'] = '{ban_reason.A_REASON}';
- <!-- END ban_reason -->
-
var ban_give_reason = new Array();
ban_give_reason[-1] = '';
- <!-- BEGIN ban_give_reason -->
- ban_give_reason['{ban_give_reason.BAN_ID}'] = '{ban_give_reason.A_REASON}';
- <!-- END ban_give_reason -->
+
+ <!-- BEGIN bans -->
+ ban_length['{bans.BAN_ID}'] = '{bans.A_LENGTH}';
+ <!-- IF bans.A_REASON -->
+ ban_reason['{bans.BAN_ID}'] = '{bans.A_REASON}';
+ <!-- ENDIF -->
+ <!-- IF bans.A_GIVE_REASON -->
+ ban_give_reason['{bans.BAN_ID}'] = '{bans.A_GIVE_REASON}';
+ <!-- ENDIF -->
+ <!-- END bans -->
function display_details(option)
{
- document.getElementById('mcp_ban').unbangivereason.value = ban_give_reason[option];
- document.getElementById('mcp_ban').unbanreason.value = ban_reason[option];
document.getElementById('mcp_ban').unbanlength.value = ban_length[option];
+ if (option in ban_reason) {
+ document.getElementById('mcp_ban').unbanreason.value = ban_reason[option];
+ } else {
+ document.getElementById('mcp_ban').unbanreason.value = '';
+ }
+ if (option in ban_give_reason) {
+ document.getElementById('mcp_ban').unbangivereason.value = ban_give_reason[option];
+ } else {
+ document.getElementById('mcp_ban').unbangivereason.value = '';
+ }
}
// ]]>
@@ -40,29 +47,31 @@
<tr>
<td class="row3" colspan="2">{L_EXPLAIN}</td>
</tr>
+<!-- EVENT mcp_ban_fields_before -->
<tr>
- <td class="row1" width="45%" valign="top"><b>{L_BAN_CELL}:</b></td>
+ <td class="row1" width="45%" valign="top"><b>{L_BAN_CELL}{L_COLON}</b></td>
<td class="row2">
<textarea name="ban" id="ban" cols="40" rows="3" class="post">{USERNAMES}</textarea>
<!-- IF S_USERNAME_BAN --><br />[ <a href="{U_FIND_USERNAME}" onclick="find_username(this.href); return false;">{L_FIND_USERNAME}</a> ]<!-- ENDIF -->
</td>
</tr>
<tr>
- <td class="row1" valign="top"><b>{L_BAN_LENGTH}:</b></td>
+ <td class="row1" valign="top"><b>{L_BAN_LENGTH}{L_COLON}</b></td>
<td class="row2"><select name="banlength">{S_BAN_END_OPTIONS}</select><br /><input type="text" name="banlengthother" class="post" /> {L_YEAR_MONTH_DAY}</td>
</tr>
<tr>
- <td class="row1" valign="top"><b>{L_BAN_EXCLUDE}:</b><br /><span class="gensmall">{L_BAN_EXCLUDE_EXPLAIN}</span></td>
+ <td class="row1" valign="top"><b>{L_BAN_EXCLUDE}{L_COLON}</b><br /><span class="gensmall">{L_BAN_EXCLUDE_EXPLAIN}</span></td>
<td class="row2"><input type="radio" class="radio" name="banexclude" value="1" /> {L_YES} &nbsp; <input type="radio" class="radio" name="banexclude" value="0" checked="checked" /> {L_NO}</td>
</tr>
<tr>
- <td class="row1" valign="top"><b>{L_BAN_REASON}:</b></td>
+ <td class="row1" valign="top"><b>{L_BAN_REASON}{L_COLON}</b></td>
<td class="row2"><input name="banreason" type="text" class="post" maxlength="255" /></td>
</tr>
<tr>
- <td class="row1" valign="top"><b>{L_BAN_GIVE_REASON}:</b></td>
+ <td class="row1" valign="top"><b>{L_BAN_GIVE_REASON}{L_COLON}</b></td>
<td class="row2"><input name="bangivereason" type="text" class="post" maxlength="255" /></td>
</tr>
+<!-- EVENT mcp_ban_fields_after -->
<tr>
<td class="cat" colspan="2" align="center"><input type="submit" name="bansubmit" value="{L_SUBMIT}" class="btnmain" />&nbsp; <input type="reset" value="{L_RESET}" class="btnlite" />&nbsp;</td>
</tr>
@@ -78,22 +87,24 @@
<td class="row3" colspan="2">{L_UNBAN_EXPLAIN}</td>
</tr>
<!-- IF S_BANNED_OPTIONS -->
+ <!-- EVENT mcp_ban_unban_before -->
<tr>
- <td class="row1" valign="top" width="45%"><b>{L_BAN_CELL}:</b></td>
+ <td class="row1" valign="top" width="45%"><b>{L_BAN_CELL}{L_COLON}</b></td>
<td class="row2"><select name="unban[]" multiple="multiple" size="10" style="width: 50%" onchange="if (this.selectedIndex > -1) display_details(this.options[this.selectedIndex].value); else display_details(-1);">{BANNED_OPTIONS}</select></td>
</tr>
<tr>
- <td class="row1" valign="top"><b>{L_BAN_LENGTH}:</b></td>
+ <td class="row1" valign="top"><b>{L_BAN_LENGTH}{L_COLON}</b></td>
<td class="row2"><input style="border: 0; width: 100%" type="text" name="unbanlength" readonly="readonly" /></td>
</tr>
<tr>
- <td class="row1" valign="top"><b>{L_BAN_REASON}:</b></td>
+ <td class="row1" valign="top"><b>{L_BAN_REASON}{L_COLON}</b></td>
<td class="row2"><textarea style="border: 0; width: 100%" name="unbanreason" readonly="readonly" rows="5" cols="80">&nbsp;</textarea></td>
</tr>
<tr>
- <td class="row1" valign="top"><b>{L_BAN_GIVE_REASON}:</b></td>
+ <td class="row1" valign="top"><b>{L_BAN_GIVE_REASON}{L_COLON}</b></td>
<td class="row2"><textarea style="border: 0; width: 100%" name="unbangivereason" readonly="readonly" rows="5" cols="80">&nbsp;</textarea></td>
</tr>
+ <!-- EVENT mcp_ban_unban_after -->
<tr>
<td class="cat" colspan="2" align="center"><input type="submit" name="unbansubmit" value="{L_SUBMIT}" class="btnmain" />&nbsp; <input type="reset" value="{L_RESET}" class="btnlite" />&nbsp;</td>
</tr>
@@ -106,4 +117,4 @@
{S_FORM_TOKEN}
</form>
-<!-- INCLUDE mcp_footer.html --> \ No newline at end of file
+<!-- INCLUDE mcp_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/mcp_footer.html b/phpBB/styles/subsilver2/template/mcp_footer.html
index 3105c15ae4..280920b148 100644
--- a/phpBB/styles/subsilver2/template/mcp_footer.html
+++ b/phpBB/styles/subsilver2/template/mcp_footer.html
@@ -3,7 +3,7 @@
</tr>
</table>
- <!-- IF PAGINATION -->
+ <!-- IF .pagination -->
<table width="80%" align="{S_CONTENT_FLOW_END}" cellspacing="1">
<tr>
<td class="nav" valign="middle" nowrap="nowrap">&nbsp;{PAGE_NUMBER}<br /></td>
@@ -24,4 +24,4 @@
<div align="{S_CONTENT_FLOW_END}"><!-- INCLUDE jumpbox.html --></div>
-<!-- INCLUDE overall_footer.html --> \ No newline at end of file
+<!-- INCLUDE overall_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/mcp_forum.html b/phpBB/styles/subsilver2/template/mcp_forum.html
index 80a6047858..12447b2b1e 100644
--- a/phpBB/styles/subsilver2/template/mcp_forum.html
+++ b/phpBB/styles/subsilver2/template/mcp_forum.html
@@ -10,7 +10,7 @@
<table class="tablebg" width="100%" cellspacing="1">
<tr>
- <td class="cat" colspan="6" align="center"><span class="gensmall">{L_DISPLAY_TOPICS}:</span> {S_SELECT_SORT_DAYS}&nbsp;<span class="gensmall">{L_SORT_BY}</span> {S_SELECT_SORT_KEY} {S_SELECT_SORT_DIR}&nbsp;<input class="btnlite" type="submit" name="sort" value="{L_GO}" /></td>
+ <td class="cat" colspan="6" align="center"><span class="gensmall">{L_DISPLAY_TOPICS}{L_COLON}</span> {S_SELECT_SORT_DAYS}&nbsp;<span class="gensmall">{L_SORT_BY}</span> {S_SELECT_SORT_KEY} {S_SELECT_SORT_DIR}&nbsp;<input class="btnlite" type="submit" name="sort" value="{L_GO}" /></td>
</tr>
<tr>
<th width="4%" nowrap="nowrap">&nbsp;</th>
@@ -26,20 +26,26 @@
<!-- td class="row1" width="25" align="center">{topicrow.TOPIC_ICON_IMG}</td -->
<!-- ENDIF -->
<td class="row1">
+ <!-- EVENT topiclist_row_prepend -->
<!-- IF topicrow.S_SELECT_TOPIC -->
<span class="genmed">[ <a href="{topicrow.U_SELECT_TOPIC}">{L_SELECT_MERGE}</a> ]&nbsp;</span>
<!-- ENDIF -->
- <p class="topictitle">{NEWEST_POST_IMG} {topicrow.ATTACH_ICON_IMG} <a href="{topicrow.U_VIEW_TOPIC}">{topicrow.TOPIC_TITLE}</a>
+ <p class="topictitle">{NEWEST_POST_IMG} {topicrow.ATTACH_ICON_IMG} <!-- EVENT mcp_forum_topic_title_before --><a href="{topicrow.U_VIEW_TOPIC}">{topicrow.TOPIC_TITLE}</a><!-- EVENT mcp_forum_topic_title_after -->
<!-- IF topicrow.S_TOPIC_UNAPPROVED or topicrow.S_POSTS_UNAPPROVED -->
- <a href="{topicrow.U_MCP_QUEUE}">{topicrow.UNAPPROVED_IMG}</a>&nbsp;
+ <a href="{topicrow.U_MCP_QUEUE}" class="imageset">{topicrow.UNAPPROVED_IMG}</a>&nbsp;
+ <!-- ENDIF -->
+ <!-- IF topicrow.S_TOPIC_DELETED or topicrow.S_POSTS_DELETED -->
+ <a href="{topicrow.U_MCP_QUEUE}" class="imageset">{topicrow.DELETED_IMG}</a>&nbsp;
<!-- ENDIF -->
<!-- IF topicrow.S_TOPIC_REPORTED and topicrow.U_MCP_REPORT -->
- <a href="{topicrow.U_MCP_REPORT}">{REPORTED_IMG}</a>&nbsp;
+ <a href="{topicrow.U_MCP_REPORT}" class="imageset">{REPORTED_IMG}</a>&nbsp;
<!-- ENDIF -->
<!-- IF topicrow.S_MOVED_TOPIC and S_CAN_DELETE -->
[ <a href="{topicrow.U_DELETE_TOPIC}">{L_DELETE_SHADOW_TOPIC}</a> ]&nbsp;
<!-- ENDIF -->
+ <!-- EVENT topiclist_row_topic_title_after -->
</p>
+ <!-- EVENT topiclist_row_append -->
</td>
<td class="row1" width="50" align="center"><p class="topicdetails">{topicrow.REPLIES}</p></td>
<td class="row1" width="120" align="center"><p class="topicdetails">{topicrow.LAST_POST_TIME}</p></td>
@@ -52,12 +58,14 @@
<td class="row1" colspan="8" align="center"><p class="gen">{L_NO_TOPICS}</p></td>
</tr>
<!-- END topicrow -->
+<!-- EVENT mcp_forum_actions_before -->
<!-- IF not S_MERGE_SELECT -->
<tr>
<td class="cat" colspan="6" align="{S_CONTENT_FLOW_END}">
<select name="action">
<option value="" selected="selected">{L_SELECT_ACTION}</option>
<!-- IF S_CAN_DELETE --><option value="delete_topic">{L_DELETE}</option><!-- ENDIF -->
+ <!-- IF S_CAN_RESTORE --><option value="restore_topic">{L_RESTORE}</option><!-- ENDIF -->
<!-- IF S_CAN_MERGE --><option value="merge_topics">{L_MERGE}</option><!-- ENDIF -->
<!-- IF S_CAN_MOVE --><option value="move">{L_MOVE}</option><!-- ENDIF -->
<!-- IF S_CAN_FORK --><option value="fork">{L_FORK}</option><!-- ENDIF -->
@@ -69,11 +77,13 @@
<option value="make_announce">{L_MAKE_ANNOUNCE}</option>
<option value="make_global">{L_MAKE_GLOBAL}</option>
<!-- ENDIF -->
+ <!-- EVENT mcp_forum_actions_append -->
</select>
<input class="btnmain" type="submit" value="{L_SUBMIT}" />
</td>
</tr>
<!-- ENDIF -->
+<!-- EVENT mcp_forum_actions_after -->
</table>
{S_FORM_TOKEN}
</form>
@@ -86,4 +96,4 @@
</table>
<!-- ENDIF -->
-<!-- INCLUDE mcp_footer.html --> \ No newline at end of file
+<!-- INCLUDE mcp_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/mcp_front.html b/phpBB/styles/subsilver2/template/mcp_front.html
index 7c63039259..55adb3b550 100644
--- a/phpBB/styles/subsilver2/template/mcp_front.html
+++ b/phpBB/styles/subsilver2/template/mcp_front.html
@@ -1,5 +1,7 @@
<!-- INCLUDE mcp_header.html -->
+<!-- EVENT mcp_front_latest_unapproved_before -->
+
<!-- IF S_SHOW_UNAPPROVED -->
<form name="mcp_queue" method="post" action="{S_MCP_QUEUE_ACTION}">
@@ -19,21 +21,15 @@
<tr>
<td class="row1" width="15%" valign="top"><span class="gen"><!-- IF unapproved.U_FORUM --><a href="{unapproved.U_FORUM}">{unapproved.FORUM_NAME}</a><!-- ELSE -->{unapproved.FORUM_NAME}<!-- ENDIF --></span><!-- IF unapproved.U_MCP_FORUM --><br /><span class="gensmall">[ <a href="{unapproved.U_MCP_FORUM}">{L_MODERATE}</a> ]</span><!-- ENDIF --></td>
<td class="row2" valign="top"><span class="gen"><a href="{unapproved.U_TOPIC}">{unapproved.TOPIC_TITLE}</a></span><br /><span class="gensmall">[ <a href="{unapproved.U_MCP_TOPIC}">{L_MODERATE}</a> ]</span></td>
- <td class="row1" valign="top"><span class="gen">{unapproved.SUBJECT}</span><br /><span class="gensmall">[ <a href="{unapproved.U_POST_DETAILS}">{L_VIEW_DETAILS}</a> ]</span></td>
+ <td class="row1" valign="top">{unapproved.ATTACH_ICON_IMG} <span class="gen">{unapproved.SUBJECT}</span><br /><span class="gensmall">[ <a href="{unapproved.U_POST_DETAILS}">{L_VIEW_DETAILS}</a> ]</span></td>
<td class="row2" align="center" width="15%" nowrap="nowrap" valign="top"><span class="gen">{unapproved.AUTHOR_FULL}</span></td>
<td class="row1" align="center" width="15%" nowrap="nowrap" valign="top"><span class="gensmall">{unapproved.POST_TIME}</span></td>
<td class="row2" align="center"><input type="checkbox" class="radio" name="post_id_list[]" value="{unapproved.POST_ID}" /></td>
</tr>
- <!-- BEGINELSE -->
- <tr>
- <td class="row1" colspan="6" align="center"><span class="gen">{L_UNAPPROVED_POSTS_ZERO_TOTAL}</span></td>
- </tr>
<!-- END unapproved -->
- <!-- IF S_HAS_UNAPPROVED_POSTS -->
<tr>
<td class="row3" colspan="6"><span class="gensmall">{L_UNAPPROVED_TOTAL}</span></td>
</tr>
- <!-- ENDIF -->
<tr>
<td class="cat" colspan="6" align="center">{S_HIDDEN_FIELDS}<input class="btnmain" type="submit" name="action[approve]" value="{L_APPROVE}" />&nbsp;&nbsp;<input class="btnlite" type="submit" name="action[disapprove]" value="{L_DISAPPROVE}" /></td>
</tr>
@@ -50,6 +46,8 @@
<br clear="all" /><br />
<!-- ENDIF -->
+<!-- EVENT mcp_front_latest_reported_before -->
+
<!-- IF S_SHOW_REPORTS -->
<table class="tablebg" width="100%" cellspacing="1">
<tr>
@@ -66,25 +64,21 @@
<tr>
<td class="row1" width="15%" valign="top"><span class="gen"><!-- IF report.U_FORUM --><a href="{report.U_FORUM}">{report.FORUM_NAME}</a><!-- ELSE -->{report.FORUM_NAME}<!-- ENDIF --></span><!-- IF report.U_MCP_FORUM --><br /><span class="gensmall">[ <a href="{report.U_MCP_FORUM}">{L_MODERATE}</a> ]</span><!-- ENDIF --></td>
<td class="row2" valign="top"><span class="gen"><a href="{report.U_TOPIC}">{report.TOPIC_TITLE}</a></span><br /><span class="gensmall">[ <a href="{report.U_MCP_TOPIC}">{L_MODERATE}</a> ]</span></td>
- <td class="row1" valign="top"><span class="gen">{report.SUBJECT}</span><br /><span class="gensmall">[ <a href="{report.U_POST_DETAILS}">{L_VIEW_DETAILS}</a> ]</span></td>
+ <td class="row1" valign="top">{report.ATTACH_ICON_IMG} <span class="gen">{report.SUBJECT}</span><br /><span class="gensmall">[ <a href="{report.U_POST_DETAILS}">{L_VIEW_DETAILS}</a> ]</span></td>
<td class="row2" align="center" width="15%" nowrap="nowrap" valign="top"><span class="gen">{report.REPORTER_FULL}</span></td>
<td class="row1" align="center" width="15%" nowrap="nowrap" valign="top"><span class="gensmall">{report.REPORT_TIME}</span></td>
</tr>
- <!-- BEGINELSE -->
- <tr>
- <td class="row1" colspan="5" align="center"><span class="gen">{L_REPORTS_ZERO_TOTAL}</span></td>
- </tr>
<!-- END report -->
- <!-- IF S_HAS_REPORTS -->
<tr>
<td class="row3" colspan="5"><span class="gensmall">{L_REPORTS_TOTAL}</span></td>
</tr>
- <!-- ENDIF -->
</table>
<br clear="all" /><br />
<!-- ENDIF -->
+<!-- EVENT mcp_front_latest_reported_pms_before -->
+
<!-- IF S_SHOW_PM_REPORTS -->
<table class="tablebg" width="100%" cellspacing="1">
<tr>
@@ -100,28 +94,24 @@
</tr>
<!-- BEGIN pm_report -->
<tr>
- <td class="row1" valign="top"><span class="gen">{pm_report.PM_SUBJECT}</span><br /><span class="gensmall">[ <a href="{pm_report.U_PM_DETAILS}">{L_VIEW_DETAILS}</a> ]</span></td>
+ <td class="row1" valign="top">{pm_report.ATTACH_ICON_IMG} <span class="gen">{pm_report.PM_SUBJECT}</span><br /><span class="gensmall">[ <a href="{pm_report.U_PM_DETAILS}">{L_VIEW_DETAILS}</a> ]</span></td>
<td class="row2" align="center" width="15%" nowrap="nowrap" valign="top"><span class="gen">{pm_report.PM_AUTHOR_FULL}</span></td>
<td class="row1" align="center" width="15%" nowrap="nowrap" valign="top"><span class="gen">{pm_report.RECIPIENTS}</span></td>
<td class="row2" align="center" width="10%" nowrap="nowrap" valign="top"><span class="gensmall">{pm_report.PM_TIME}</span></td>
<td class="row1" align="center" width="15%" nowrap="nowrap" valign="top"><span class="gen">{pm_report.REPORTER_FULL}</span></td>
<td class="row2" align="center" width="10%" nowrap="nowrap" valign="top"><span class="gensmall">{pm_report.REPORT_TIME}</span></td>
</tr>
- <!-- BEGINELSE -->
- <tr>
- <td class="row1" colspan="6" align="center"><span class="gen">{L_PM_REPORTS_ZERO_TOTAL}</span></td>
- </tr>
<!-- END pm_report -->
- <!-- IF S_HAS_PM_REPORTS -->
<tr>
<td class="row3" colspan="6"><span class="gensmall">{L_PM_REPORTS_TOTAL}</span></td>
</tr>
- <!-- ENDIF -->
</table>
<br clear="all" /><br />
<!-- ENDIF -->
+<!-- EVENT mcp_front_latest_logs_before -->
+
<!-- IF S_SHOW_LOGS -->
<table class="tablebg" width="100%" cellspacing="1" cellpadding="4" border="0" align="{S_CONTENT_FLOW_END}">
<tr>
@@ -152,4 +142,6 @@
<br clear="all" />
<!-- ENDIF -->
-<!-- INCLUDE mcp_footer.html --> \ No newline at end of file
+<!-- EVENT mcp_front_latest_logs_after -->
+
+<!-- INCLUDE mcp_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/mcp_header.html b/phpBB/styles/subsilver2/template/mcp_header.html
index f107732234..7144750ed4 100644
--- a/phpBB/styles/subsilver2/template/mcp_header.html
+++ b/phpBB/styles/subsilver2/template/mcp_header.html
@@ -3,9 +3,7 @@
<div id="pageheader">
<!-- IF U_MCP -->
<p class="linkmcp">
- [ <a href="{U_MCP}">{L_MCP}</a><!-- IF U_MCP_FORUM --> | <a href="{U_MCP_FORUM}">{L_MODERATE_FORUM}</a><!-- ENDIF -->
- <!-- IF U_MCP_TOPIC --> | <a href="{U_MCP_TOPIC}">{L_MODERATE_TOPIC}</a><!-- ENDIF -->
- <!-- IF U_MCP_POST --> | <a href="{U_MCP_POST}">{L_MODERATE_POST}</a><!-- ENDIF --> ]
+ [<!-- IF U_ACP -->&nbsp;<a href="{U_ACP}">{L_ACP}</a>&nbsp;|<!-- ENDIF -->&nbsp;<a href="{U_MCP}">{L_MCP}</a><!-- IF U_MCP_FORUM -->&nbsp;|&nbsp;<a href="{U_MCP_FORUM}">{L_MODERATE_FORUM}</a><!-- ENDIF --><!-- IF U_MCP_TOPIC -->&nbsp;|&nbsp;<a href="{U_MCP_TOPIC}">{L_MODERATE_TOPIC}</a><!-- ENDIF --><!-- IF U_MCP_POST -->&nbsp;|&nbsp;<a href="{U_MCP_POST}">{L_MODERATE_POST}</a><!-- ENDIF -->&nbsp;]
</p>
<!-- ENDIF -->
@@ -60,20 +58,3 @@
<br />
<!-- ENDIF -->
-
- <!-- IF CONFIRM_MESSAGE -->
- <form name="confirm" method="post" action="{S_CONFIRM_ACTION}">
-
- <table class="tablebg" width="100%" cellspacing="1">
- <tr>
- <th>{L_PLEASE_CONFIRM}</th>
- </tr>
- <tr>
- <td class="row1" align="center"><span class="gen"><br />{CONFIRM_MESSAGE}<br /><br />{S_HIDDEN_FIELDS}<input class="btnmain" type="submit" name="confirm" value="{L_YES}" />&nbsp;&nbsp;<input class="btnlite" type="submit" name="cancel" value="{L_NO}" /><br /><br /></span></td>
- </tr>
- </table>
-
- </form>
-
- <br />
- <!-- ENDIF -->
diff --git a/phpBB/styles/subsilver2/template/mcp_jumpbox.html b/phpBB/styles/subsilver2/template/mcp_jumpbox.html
deleted file mode 100644
index 14856596f0..0000000000
--- a/phpBB/styles/subsilver2/template/mcp_jumpbox.html
+++ /dev/null
@@ -1,18 +0,0 @@
-<!-- Note: no longer in use... -->
-
-<form name="jumpbox" method="post" action="{S_JUMPBOX_ACTION}">
-
- <span class="gensmall">{L_JUMP_TO}:</span>&nbsp;<select name="f" onChange="if(this.options[this.selectedIndex].value != -1 && this.options[this.selectedIndex].value != document.jumpbox.current_f.value){ document.forms['jumpbox'].submit() }">
-
-<!-- IF S_ENABLE_SELECT_ALL -->
- <option value="0">{L_ALL_FORUMS}</option>
-<!-- ELSE -->
- <option value="-1">{L_SELECT_FORUM}</option>
-<!-- ENDIF -->
-
-<!-- BEGIN options -->
- <option value="{options.VALUE}"<!-- IF options.VALUE eq -1 --> class="disabled-option"<!-- ENDIF -->{options.SELECTED}/>{options.TEXT}</option>
-<!-- BEGINELSE -->
-<!-- END options -->
-</select>&nbsp;<input type="hidden" name="current_f" value="{S_CURRENT_FORUM}" /><input name="jumpbox" class="btnlite" type="submit" value="{L_GO}" onclick="if(document.jumpbox.f.value == -1){return false;}" />
-</form>
diff --git a/phpBB/styles/subsilver2/template/mcp_logs.html b/phpBB/styles/subsilver2/template/mcp_logs.html
index 8b69197b0f..64f2a6a64d 100644
--- a/phpBB/styles/subsilver2/template/mcp_logs.html
+++ b/phpBB/styles/subsilver2/template/mcp_logs.html
@@ -22,10 +22,10 @@
</tr>
<!-- END log -->
<tr align="center">
- <td class="row3" colspan="<!-- IF S_CLEAR_ALLOWED -->5<!-- ELSE -->4<!-- ENDIF -->"><span class="gensmall">{L_SEARCH_KEYWORDS}:</span> <input type="text" name="keywords" value="{S_KEYWORDS}" />&nbsp;<input type="submit" class="btnlite" name="filter" value="{L_SEARCH}" /></td>
+ <td class="row3" colspan="<!-- IF S_CLEAR_ALLOWED -->5<!-- ELSE -->4<!-- ENDIF -->"><span class="gensmall">{L_SEARCH_KEYWORDS}{L_COLON}</span> <input type="text" name="keywords" value="{S_KEYWORDS}" />&nbsp;<input type="submit" class="btnlite" name="filter" value="{L_SEARCH}" /></td>
</tr>
<tr align="center">
- <td class="row3" colspan="<!-- IF S_CLEAR_ALLOWED -->5<!-- ELSE -->4<!-- ENDIF -->"><span class="gensmall">{L_DISPLAY_LOG}:</span> {S_SELECT_SORT_DAYS}&nbsp;<span class="gensmall">{L_SORT_BY}</span> {S_SELECT_SORT_KEY} {S_SELECT_SORT_DIR}&nbsp;<input class="btnlite" type="submit" value="{L_GO}" name="sort" /></td>
+ <td class="row3" colspan="<!-- IF S_CLEAR_ALLOWED -->5<!-- ELSE -->4<!-- ENDIF -->"><span class="gensmall">{L_DISPLAY_LOG}{L_COLON}</span> {S_SELECT_SORT_DAYS}&nbsp;<span class="gensmall">{L_SORT_BY}</span> {S_SELECT_SORT_KEY} {S_SELECT_SORT_DIR}&nbsp;<input class="btnlite" type="submit" value="{L_GO}" name="sort" /></td>
</tr>
<!-- IF S_CLEAR_ALLOWED -->
<tr>
@@ -43,4 +43,4 @@
<br clear="all" /><br />
-<!-- INCLUDE mcp_footer.html --> \ No newline at end of file
+<!-- INCLUDE mcp_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/mcp_message.html b/phpBB/styles/subsilver2/template/mcp_message.html
index 7645e5dd81..5699dd54af 100644
--- a/phpBB/styles/subsilver2/template/mcp_message.html
+++ b/phpBB/styles/subsilver2/template/mcp_message.html
@@ -11,4 +11,4 @@
<br clear="all" />
-<!-- INCLUDE mcp_footer.html --> \ No newline at end of file
+<!-- INCLUDE mcp_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/mcp_move.html b/phpBB/styles/subsilver2/template/mcp_move.html
index db7a6e7241..429fee7e38 100644
--- a/phpBB/styles/subsilver2/template/mcp_move.html
+++ b/phpBB/styles/subsilver2/template/mcp_move.html
@@ -1,9 +1,11 @@
<!-- INCLUDE overall_header.html -->
+<!-- EVENT mcp_move_before -->
+
<div id="pagecontent">
<form name="confirm" action="{S_CONFIRM_ACTION}" method="post">
-
+
<table class="tablebg" width="100%" cellspacing="1">
<tr>
<th>{MESSAGE_TITLE}</th>
@@ -17,7 +19,10 @@
<span class="gen"><br />{L_SELECT_DESTINATION_FORUM}&nbsp;&nbsp;</span>
<select name="to_forum_id">{S_FORUM_SELECT}</select><br />
<!-- IF S_CAN_LEAVE_SHADOW -->
- <input type="checkbox" class="radio" name="move_leave_shadow" checked="checked" /><span class="gen">{L_LEAVE_SHADOW}</span><br />
+ <input type="checkbox" class="radio" name="move_leave_shadow" /><span class="gen">{L_LEAVE_SHADOW}</span><br />
+ <!-- ENDIF -->
+ <!-- IF S_CAN_LOCK_TOPIC -->
+ <input type="checkbox" class="radio" name="move_lock_topics" /><span class="gen">{L_LOCK_TOPIC}</span><br />
<!-- ENDIF -->
<br />{S_HIDDEN_FIELDS}<span class="gen">{MESSAGE_TEXT}</span><br /><br />
<input type="submit" name="confirm" value="{YES_VALUE}" class="btnmain" />&nbsp;&nbsp;<input type="submit" name="cancel" value="{L_NO}" class="btnlite" />
@@ -29,9 +34,9 @@
</td>
</tr>
</table>
- {S_FORM_TOKEN}
+ {S_FORM_TOKEN}
</form>
-
+
</div>
<br clear="all" />
diff --git a/phpBB/styles/subsilver2/template/mcp_notes_front.html b/phpBB/styles/subsilver2/template/mcp_notes_front.html
index 17f389f7f3..e2e14e0150 100644
--- a/phpBB/styles/subsilver2/template/mcp_notes_front.html
+++ b/phpBB/styles/subsilver2/template/mcp_notes_front.html
@@ -7,7 +7,7 @@
<th colspan="2"align="center">{L_SELECT_USER}</th>
</tr>
<tr>
- <td class="row1" width="40%"><b class="gen">{L_FIND_USERNAME}: </b><br /><span class="gensmall">[ <a href="{U_FIND_USERNAME}" onclick="find_username(this.href); return false;">{L_FIND_USERNAME}</a> ]</span></td>
+ <td class="row1" width="40%"><b class="gen">{L_FIND_USERNAME}{L_COLON} </b><br /><span class="gensmall">[ <a href="{U_FIND_USERNAME}" onclick="find_username(this.href); return false;">{L_FIND_USERNAME}</a> ]</span></td>
<td class="row2"><input type="text" class="post" name="username" size="20" /></td>
</tr>
<tr>
@@ -19,4 +19,4 @@
<br clear="all" /><br />
-<!-- INCLUDE mcp_footer.html --> \ No newline at end of file
+<!-- INCLUDE mcp_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/mcp_notes_user.html b/phpBB/styles/subsilver2/template/mcp_notes_user.html
index 4ee3f9e04e..4bd8de6862 100644
--- a/phpBB/styles/subsilver2/template/mcp_notes_user.html
+++ b/phpBB/styles/subsilver2/template/mcp_notes_user.html
@@ -30,15 +30,15 @@
<td class="row1">
<table width="100%" cellspacing="1" cellpadding="2" border="0">
<tr>
- <td class="gen" align="{S_CONTENT_FLOW_END}" nowrap="nowrap">{L_JOINED}: </td>
+ <td class="gen" align="{S_CONTENT_FLOW_END}" nowrap="nowrap">{L_JOINED}{L_COLON} </td>
<td width="100%"><b class="gen">{JOINED}</b></td>
</tr>
<tr>
- <td class="gen" align="{S_CONTENT_FLOW_END}" valign="top" nowrap="nowrap">{L_TOTAL_POSTS}: </td>
+ <td class="gen" align="{S_CONTENT_FLOW_END}" valign="top" nowrap="nowrap">{L_TOTAL_POSTS}{L_COLON} </td>
<td><b class="gen">{POSTS}</b></td>
</tr>
<tr>
- <td class="gen" align="{S_CONTENT_FLOW_END}" valign="top" nowrap="nowrap">{L_WARNINGS}: </td>
+ <td class="gen" align="{S_CONTENT_FLOW_END}" valign="top" nowrap="nowrap">{L_WARNINGS}{L_COLON} </td>
<td><b class="gen">{WARNINGS}</b></td>
</tr>
</table>
@@ -55,10 +55,10 @@
<!-- IF S_USER_NOTES -->
<tr align="center">
- <td colspan="5" class="row3"><span class="gensmall">{L_SEARCH_KEYWORDS}:</span> <input type="text" name="keywords" value="{S_KEYWORDS}" />&nbsp;<input type="submit" class="btnlite" name="filter" value="{L_SEARCH}" /></td>
+ <td colspan="5" class="row3"><span class="gensmall">{L_SEARCH_KEYWORDS}{L_COLON}</span> <input type="text" name="keywords" value="{S_KEYWORDS}" />&nbsp;<input type="submit" class="btnlite" name="filter" value="{L_SEARCH}" /></td>
</tr>
<tr align="center">
- <td colspan="5" class="row3"><span class="gensmall">{L_DISPLAY_LOG}:</span> {S_SELECT_SORT_DAYS}&nbsp;<span class="gensmall">{L_SORT_BY}:</span> {S_SELECT_SORT_KEY} {S_SELECT_SORT_DIR}&nbsp;<input class="btnlite" type="submit" value="{L_GO}" name="sort" /></td>
+ <td colspan="5" class="row3"><span class="gensmall">{L_DISPLAY_LOG}{L_COLON}</span> {S_SELECT_SORT_DAYS}&nbsp;<span class="gensmall">{L_SORT_BY}{L_COLON}</span> {S_SELECT_SORT_KEY} {S_SELECT_SORT_DIR}&nbsp;<input class="btnlite" type="submit" value="{L_GO}" name="sort" /></td>
</tr>
<tr>
<th>{L_REPORT_BY}</th>
@@ -122,4 +122,4 @@
<br clear="all" /><br />
-<!-- INCLUDE mcp_footer.html --> \ No newline at end of file
+<!-- INCLUDE mcp_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/mcp_post.html b/phpBB/styles/subsilver2/template/mcp_post.html
index d026ac22c0..1a29df94b0 100644
--- a/phpBB/styles/subsilver2/template/mcp_post.html
+++ b/phpBB/styles/subsilver2/template/mcp_post.html
@@ -8,15 +8,15 @@
<th colspan="2" align="center"><!-- IF S_PM -->{L_PM_REPORT_DETAILS}<!-- ELSE -->{L_REPORT_DETAILS}<!-- ENDIF --></th>
</tr>
<tr>
- <td class="row1"><b class="gen">{L_REPORT_REASON}: </b></td>
+ <td class="row1"><b class="gen">{L_REPORT_REASON}{L_COLON} </b></td>
<td class="row2"><span class="gen">{REPORT_REASON_TITLE} &raquo; {REPORT_REASON_DESCRIPTION}</span></td>
</tr>
<tr>
- <td class="row1" width="20%"><b class="gen">{L_REPORTER}: </b></td>
+ <td class="row1" width="20%"><b class="gen">{L_REPORTER}{L_COLON} </b></td>
<td class="row2" width="80%"><span class="gen"<!-- IF REPORTER_COLOUR --> style="font-weight: bold; color: {REPORTER_COLOUR};"<!-- ENDIF -->>{REPORTER_NAME}</span> &nbsp; <span class="gen">[ <!-- IF U_VIEW_REPORTER_PROFILE --><a href="{U_VIEW_REPORTER_PROFILE}">{L_READ_PROFILE}</a><!-- ENDIF --><!-- IF S_USER_NOTES --><!-- IF U_VIEW_REPORTER_PROFILE --> | <!-- ENDIF --><a href="{U_MCP_REPORTER_NOTES}">{L_VIEW_NOTES}</a> | <a href="{U_MCP_WARN_REPORTER}">{L_WARN_USER}</a><!-- ENDIF --> ]</span></td>
</tr>
<tr>
- <td class="row1"><b class="gen">{L_REPORTED}: </b></td>
+ <td class="row1"><b class="gen">{L_REPORTED}{L_COLON} </b></td>
<td class="row2"><span class="postdetails">{REPORT_DATE}</span></td>
</tr>
<!-- IF REPORT_TEXT -->
@@ -49,16 +49,21 @@
<td class="row3" colspan="2" align="center"><span class="gensmall"><!-- IF S_MCP_QUEUE -->{RETURN_QUEUE} | {RETURN_TOPIC_SIMPLE} | {RETURN_POST}<!-- ELSEIF S_MCP_REPORT -->{RETURN_REPORTS}<!-- IF not S_PM --> | <a href="{U_VIEW_POST}">{L_VIEW_POST}</a> | <a href="{U_VIEW_TOPIC}">{L_VIEW_TOPIC}</a> | <a href="{U_VIEW_FORUM}">{L_VIEW_FORUM}</a><!-- ENDIF --><!-- ELSE -->{RETURN_TOPIC}<!-- ENDIF --></span></td>
</tr>
<tr>
- <td class="row1"><b class="gen"><!-- IF S_PM -->{L_PM_SUBJECT}<!-- ELSE -->{L_POST_SUBJECT}<!-- ENDIF -->: </b></td>
- <td class="row2"><span class="gen">{POST_SUBJECT}</span> <!-- IF S_POST_UNAPPROVED --><span class="postapprove">{UNAPPROVED_IMG} <a href="{U_MCP_APPROVE}">{L_POST_UNAPPROVED}</a></span> <!-- ENDIF --> <!-- IF S_POST_REPORTED and not S_MCP_REPORT --><span class="postreported">{REPORTED_IMG} <a href="{U_MCP_REPORT}">{L_POST_REPORTED}</a></span><!-- ENDIF --></td>
+ <td class="row1"><b class="gen"><!-- IF S_PM -->{L_PM_SUBJECT}<!-- ELSE -->{L_POST_SUBJECT}<!-- ENDIF -->{L_COLON} </b></td>
+ <td class="row2">
+ <span class="gen">{POST_SUBJECT}</span>
+ <!-- IF S_POST_UNAPPROVED --><span class="postapprove">{UNAPPROVED_IMG} <a href="{U_MCP_APPROVE}">{L_POST_UNAPPROVED}</a></span> <!-- ENDIF -->
+ <!-- IF S_POST_DELETED --><span class="postapprove">{DELETED_IMG} <a href="{U_MCP_APPROVE}">{L_POST_DELETED}</a></span> <!-- ENDIF -->
+ <!-- IF S_POST_REPORTED and not S_MCP_REPORT --><span class="postreported">{REPORTED_IMG} <a href="{U_MCP_REPORT}">{L_POST_REPORTED}</a></span><!-- ENDIF -->
+ </td>
</tr>
<tr>
- <td class="row1" width="20%"><b class="gen"><!-- IF S_PM -->{L_PM_FROM}<!-- ELSE -->{L_POSTER}<!-- ENDIF -->: </b></td>
+ <td class="row1" width="20%"><b class="gen"><!-- IF S_PM -->{L_PM_FROM}<!-- ELSE -->{L_POSTER}<!-- ENDIF -->{L_COLON} </b></td>
<td class="row2" width="80%"><span class="gen"<!-- IF POST_AUTHOR_COLOUR --> style="font-weight: bold; color: {POST_AUTHOR_COLOUR}"<!-- ENDIF -->>{POST_AUTHOR}</span><span class="gen"> &nbsp; [ <!-- IF U_POST_AUTHOR --><a href="{U_POST_AUTHOR}">{L_READ_PROFILE}</a><!-- ENDIF --><!-- IF S_USER_NOTES --><!-- IF U_POST_AUTHOR --> | <!-- ENDIF --><a href="{U_MCP_USER_NOTES}">{L_VIEW_NOTES}</a> <!-- IF U_MCP_WARN_USER -->| <a href="{U_MCP_WARN_USER}">{L_WARN_USER}</a><!-- ENDIF --><!-- ENDIF --> ]</span></td>
</tr>
<!-- IF S_CAN_VIEWIP -->
<tr>
- <td class="row1"><b class="gen"><!-- IF S_PM -->{L_THIS_PM_IP}<!-- ELSE -->{L_THIS_POST_IP}<!-- ENDIF -->: </b></td>
+ <td class="row1"><b class="gen"><!-- IF S_PM -->{L_THIS_PM_IP}<!-- ELSE -->{L_THIS_POST_IP}<!-- ENDIF -->{L_COLON} </b></td>
<td class="row2"><span class="gen">
<!-- IF U_WHOIS -->
<a href="{U_WHOIS}"><!-- IF POST_IPADDR -->{POST_IPADDR}<!-- ELSE -->{POST_IP}<!-- ENDIF --></a> (<!-- IF POST_IPADDR -->{POST_IP}<!-- ELSE --><a href="{U_LOOKUP_IP}">{L_LOOKUP_IP}</a><!-- ENDIF -->)
@@ -69,12 +74,12 @@
</tr>
<!-- ENDIF -->
<tr>
- <td class="row1"><b class="gen"><!-- IF S_PM -->{L_SENT_AT}<!-- ELSE -->{L_POSTED}<!-- ENDIF -->: </b></td>
+ <td class="row1"><b class="gen"><!-- IF S_PM -->{L_SENT_AT}<!-- ELSE -->{L_POSTED}<!-- ENDIF -->{L_COLON} </b></td>
<td class="row2"><span class="postdetails">{POST_DATE}</span></td>
</tr>
<!-- IF S_TO_RECIPIENT -->
<tr>
- <td class="row1" nowrap="nowrap" width="150"><b class="gen">{L_TO}:</b></td>
+ <td class="row1" nowrap="nowrap" width="150"><b class="gen">{L_TO}{L_COLON}</b></td>
<td class="row2 gen">
<!-- BEGIN to_recipient -->
<!-- IF to_recipient.IS_GROUP --><span class="sep"><a href="{to_recipient.U_VIEW}">{to_recipient.NAME}</a></span><!-- ELSE -->{to_recipient.NAME_FULL}&nbsp;<!-- ENDIF -->
@@ -85,7 +90,7 @@
<!-- IF S_BCC_RECIPIENT -->
<tr>
- <td class="row1" nowrap="nowrap" width="150"><b class="gen">{L_BCC}:</b></td>
+ <td class="row1" nowrap="nowrap" width="150"><b class="gen">{L_BCC}{L_COLON}</b></td>
<td class="row2 gen">
<!-- BEGIN bcc_recipient -->
<!-- IF bcc_recipient.IS_GROUP --><span class="sep"><a href="{bcc_recipient.U_VIEW}">{bcc_recipient.NAME}</a></span><!-- ELSE -->{bcc_recipient.NAME_FULL}&nbsp;<!-- ENDIF -->
@@ -98,7 +103,7 @@
</tr>
<tr>
<td class="row1" colspan="2">
- <!-- IF U_EDIT --><div class="gen" style="float: {S_CONTENT_FLOW_END};"><a href="{U_EDIT}">{EDIT_IMG}</a></div><!-- ENDIF -->
+ <!-- IF U_EDIT --><div class="gen" style="float: {S_CONTENT_FLOW_END};"><a href="{U_EDIT}" class="imageset">{EDIT_IMG}</a></div><!-- ENDIF -->
<div class="postbody">{POST_PREVIEW}</div>
@@ -107,7 +112,7 @@
<table class="tablebg" width="100%" cellspacing="1">
<tr>
- <td class="row3"><b class="genmed">{L_ATTACHMENTS}: </b></td>
+ <td class="row3"><b class="genmed">{L_ATTACHMENTS}{L_COLON} </b></td>
</tr>
<!-- BEGIN attachment -->
<tr>
@@ -138,8 +143,8 @@
<!-- IF S_TOPIC_REVIEW --><!-- INCLUDE posting_topic_review.html --><!-- ENDIF -->
<!-- ELSE -->
- <!-- IF S_CAN_LOCK_POST or S_CAN_DELETE_POST or S_CAN_CHGPOSTER -->
- <br /><a name="mod"></a>
+ <!-- IF S_CAN_LOCK_POST or S_CAN_DELETE_POST or S_CAN_CHGPOSTER or S_MCP_POST_ADDITIONAL_OPTS -->
+ <br /><a name="mod" class="anchor"></a>
<table width="100%" cellpadding="3" cellspacing="1" border="0" class="tablebg">
<tr>
@@ -151,6 +156,9 @@
<td class="row2"><form method="post" name="mcp_chgposter" action="{U_POST_ACTION}"><input class="post" type="text" name="username" value="" /> <input class="btnmain" type="submit" value="{L_CONFIRM}" name="action[chgposter]" /><br /><span class="gensmall">[ <a href="{U_FIND_USERNAME}" onclick="find_username(this.href); return false;">{L_FIND_USERNAME}</a> ]</span><!-- IF S_USER_SELECT --><br /><select name="u">{S_USER_SELECT}</select> <input type="submit" class="btnmain" name="action[chgposter_ip]" value="{L_CONFIRM}" /><!-- ENDIF -->{S_FORM_TOKEN}</form></td>
</tr>
<!-- ENDIF -->
+
+ <!-- EVENT mcp_post_additional_options -->
+
<!-- IF S_CAN_LOCK_POST or S_CAN_DELETE_POST -->
<tr>
<td class="row1" valign="top"><b class="gen">{L_MOD_OPTIONS}</b></td>
@@ -161,7 +169,7 @@
<!-- ENDIF -->
<!-- IF S_CAN_VIEWIP -->
- <br /><a name="ip"></a>
+ <br /><a name="ip" class="anchor"></a>
<table width="100%" cellpadding="3" cellspacing="1" border="0" class="tablebg">
<tr>
@@ -173,7 +181,7 @@
<!-- BEGIN userrow -->
<!-- IF userrow.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
<td><span class="gen"><!-- IF userrow.U_PROFILE --><a href="{userrow.U_PROFILE}">{userrow.USERNAME}</a><!-- ELSE -->{userrow.USERNAME}<!-- ENDIF --> [ {userrow.NUM_POSTS} {userrow.L_POST_S} ]</span></td>
- <td align="center"><a href="{userrow.U_SEARCHPOSTS}">{SEARCH_IMG}</a></td>
+ <td align="center"><a href="{userrow.U_SEARCHPOSTS}" class="imageset">{SEARCH_IMG}</a></td>
</tr>
<!-- BEGINELSE -->
<tr class="row1">
@@ -203,4 +211,4 @@
<!-- ENDIF -->
-<!-- INCLUDE mcp_footer.html --> \ No newline at end of file
+<!-- INCLUDE mcp_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/mcp_queue.html b/phpBB/styles/subsilver2/template/mcp_queue.html
index 4def047e51..7ca659b5da 100644
--- a/phpBB/styles/subsilver2/template/mcp_queue.html
+++ b/phpBB/styles/subsilver2/template/mcp_queue.html
@@ -7,7 +7,7 @@
<th colspan="4" nowrap="nowrap">{L_DISPLAY_OPTIONS}</th>
</tr>
<tr>
- <td colspan="4" class="cat" align="center"><span class="gensmall">{L_DISPLAY_ITEMS}:</span> {S_SELECT_SORT_DAYS}&nbsp;<span class="gensmall">{L_SORT_BY}</span> {S_SELECT_SORT_KEY} {S_SELECT_SORT_DIR}&nbsp;<span class="gensmall">{L_FORUM}</span> <select name="f">{S_FORUM_OPTIONS}</select> &nbsp; <!-- IF TOPIC_ID --><input type="checkbox" class="radio" name="t" value="{TOPIC_ID}" checked="checked" />&nbsp; <b>{L_ONLY_TOPIC}</b> &nbsp; <!-- ENDIF --><input class="btnlite" type="submit" name="sort" value="{L_GO}" /></td>
+ <td colspan="4" class="cat" align="center"><span class="gensmall">{L_DISPLAY_ITEMS}{L_COLON}</span> {S_SELECT_SORT_DAYS}&nbsp;<span class="gensmall">{L_SORT_BY}</span> {S_SELECT_SORT_KEY} {S_SELECT_SORT_DIR}&nbsp;<span class="gensmall">{L_FORUM}</span> <select name="f">{S_FORUM_OPTIONS}</select> &nbsp; <!-- IF TOPIC_ID --><input type="checkbox" class="radio" name="t" value="{TOPIC_ID}" checked="checked" />&nbsp; <b>{L_ONLY_TOPIC}</b> &nbsp; <!-- ENDIF --><input class="btnlite" type="submit" name="sort" value="{L_GO}" /></td>
</tr>
<tr>
<th>&nbsp;<!-- IF S_TOPICS -->{L_TOPIC}<!-- ELSE -->{L_POST}<!-- ENDIF -->&nbsp;</th>
@@ -18,20 +18,42 @@
<!-- BEGIN postrow -->
<!-- IF postrow.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
- <td style="padding: 4px;"><p class="topictitle"><a href="{postrow.U_VIEWPOST}">{postrow.POST_SUBJECT}</a></p>
- <span class="gensmall"><!-- IF postrow.U_VIEWFORUM -->{L_FORUM}: <a href="{postrow.U_VIEWFORUM}">{postrow.FORUM_NAME}</a><!-- ELSE -->{postrow.FORUM_NAME}<!-- ENDIF --></span></td>
+ <td style="padding: 4px;"><p class="topictitle">{postrow.ATTACH_ICON_IMG} <a href="{postrow.U_VIEWPOST}">{postrow.POST_SUBJECT}</a></p>
+ <span class="gensmall"><!-- IF postrow.U_VIEWFORUM -->{L_FORUM}{L_COLON} <a href="{postrow.U_VIEWFORUM}">{postrow.FORUM_NAME}</a><!-- ELSE -->{postrow.FORUM_NAME}<!-- ENDIF --></span></td>
<td style="padding: 4px;" align="{S_CONTENT_FLOW_BEGIN}" valign="top" nowrap="nowrap"><span class="gen">{postrow.POST_AUTHOR_FULL}</span><br />
<span class="gensmall">[ <a href="{postrow.U_VIEW_DETAILS}">{L_VIEW_DETAILS}</a> ]</span></td>
<td class="postdetails" style="padding: 4px;" align="{S_CONTENT_FLOW_BEGIN}" valign="top" nowrap="nowrap">{postrow.POST_TIME}</td>
- <td align="center"><input type="checkbox" class="radio" name="post_id_list[]" value="{postrow.POST_ID}" /></td>
+ <td align="center">
+ <!-- IF S_TOPICS -->
+ <input type="checkbox" class="radio" name="topic_id_list[]" value="{postrow.TOPIC_ID}" />
+ <!-- ELSE -->
+ <input type="checkbox" class="radio" name="post_id_list[]" value="{postrow.POST_ID}" />
+ <!-- ENDIF -->
+ </td>
</tr>
<!-- BEGINELSE -->
<tr>
- <td class="row1" colspan="4" height="30" align="center" valign="middle"><span class="gen"><!-- IF S_TOPICS -->{L_NO_TOPICS_QUEUE}<!-- ELSE -->{L_UNAPPROVED_POSTS_ZERO_TOTAL}<!-- ENDIF --></span></td>
+ <td class="row1" colspan="4" height="30" align="center" valign="middle">
+ <span class="gen">
+ <!-- IF S_RESTORE -->
+ <!-- IF S_TOPICS -->{L_NO_TOPICS_DELETED}<!-- ELSE -->{L_NO_POSTS_DELETED}<!-- ENDIF -->
+ <!-- ELSE -->
+ <!-- IF S_TOPICS -->{L_NO_TOPICS_QUEUE}<!-- ELSE -->{L_NO_POSTS_QUEUE}<!-- ENDIF -->
+ <!-- ENDIF -->
+ </span>
+ </td>
</tr>
<!-- END postrow -->
<tr>
- <td class="cat" colspan="4" align="center"><input class="btnmain" type="submit" name="action[approve]" value="{L_APPROVE}" />&nbsp;&nbsp;<input class="btnlite" type="submit" name="action[disapprove]" value="{L_DISAPPROVE}" /></td>
+ <td class="cat" colspan="4" align="center">
+ <!-- IF S_RESTORE -->
+ <input class="btnlite" type="submit" name="action[delete]" value="{L_DELETE}" />&nbsp;&nbsp;
+ <input class="btnmain" type="submit" name="action[restore]" value="{L_RESTORE}" />
+ <!-- ELSE -->
+ <input class="btnmain" type="submit" name="action[approve]" value="{L_APPROVE}" />&nbsp;&nbsp;
+ <input class="btnlite" type="submit" name="action[disapprove]" value="{L_DISAPPROVE}" />
+ <!-- ENDIF -->
+ </td>
</tr>
</table>
{S_FORM_TOKEN}
@@ -39,8 +61,16 @@
<table width="100%" cellspacing="2" cellpadding="2" border="0" align="center">
<tr>
- <td align="{S_CONTENT_FLOW_END}" valign="top" nowrap="nowrap"><b class="gensmall"><a href="#" onclick="marklist('mcp', '', true); return false;">{L_MARK_ALL}</a> :: <a href="#" onclick="marklist('mcp', '', false); return false;">{L_UNMARK_ALL}</a></b></td>
+ <td align="{S_CONTENT_FLOW_END}" valign="top" nowrap="nowrap">
+ <b class="gensmall">
+ <!-- IF S_TOPICS -->
+ <a href="#" onclick="marklist('mcp', 'topic_id_list', true); return false;">{L_MARK_ALL}</a> :: <a href="#" onclick="marklist('mcp', 'topic_id_list', false); return false;">{L_UNMARK_ALL}</a>
+ <!-- ELSE -->
+ <a href="#" onclick="marklist('mcp', 'post_id_list', true); return false;">{L_MARK_ALL}</a> :: <a href="#" onclick="marklist('mcp', 'post_id_list', false); return false;">{L_UNMARK_ALL}</a>
+ <!-- ENDIF -->
+ </b>
+ </td>
</tr>
</table>
-<!-- INCLUDE mcp_footer.html --> \ No newline at end of file
+<!-- INCLUDE mcp_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/mcp_reports.html b/phpBB/styles/subsilver2/template/mcp_reports.html
index 1b6a3b82b6..158f9c2603 100644
--- a/phpBB/styles/subsilver2/template/mcp_reports.html
+++ b/phpBB/styles/subsilver2/template/mcp_reports.html
@@ -7,7 +7,7 @@
<th colspan="5" nowrap="nowrap">{L_DISPLAY_OPTIONS}</th>
</tr>
<tr>
- <td colspan="5" class="cat" align="center"><span class="gensmall">{L_DISPLAY_POSTS}:</span> {S_SELECT_SORT_DAYS}&nbsp;<span class="gensmall">{L_SORT_BY}</span> {S_SELECT_SORT_KEY} {S_SELECT_SORT_DIR}<!-- IF not S_PM -->&nbsp;<span class="gensmall">{L_FORUM}</span> <select name="f">{S_FORUM_OPTIONS}</select> &nbsp; <!-- IF TOPIC_ID --><input type="checkbox" class="radio" name="t" value="{TOPIC_ID}" checked="checked" />&nbsp; <b>{L_ONLY_TOPIC}</b> &nbsp; <!-- ENDIF --><!-- ENDIF --><input class="btnlite" type="submit" name="sort" value="{L_GO}" /></td>
+ <td colspan="5" class="cat" align="center"><span class="gensmall">{L_DISPLAY_POSTS}{L_COLON}</span> {S_SELECT_SORT_DAYS}&nbsp;<span class="gensmall">{L_SORT_BY}</span> {S_SELECT_SORT_KEY} {S_SELECT_SORT_DIR}<!-- IF not S_PM -->&nbsp;<span class="gensmall">{L_FORUM}</span> <select name="f">{S_FORUM_OPTIONS}</select> &nbsp; <!-- IF TOPIC_ID --><input type="checkbox" class="radio" name="t" value="{TOPIC_ID}" checked="checked" />&nbsp; <b>{L_ONLY_TOPIC}</b> &nbsp; <!-- ENDIF --><!-- ENDIF --><input class="btnlite" type="submit" name="sort" value="{L_GO}" /></td>
</tr>
<tr>
<!-- IF S_PM -->
@@ -25,13 +25,13 @@
<!-- IF postrow.S_ROW_ is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
<!-- IF S_PM -->
- <td style="padding: 4px;"><p class="topictitle"><a href="{postrow.U_VIEW_DETAILS}">{postrow.PM_SUBJECT}</a></p>
- <span class="gensmall">{L_PM_FROM}: {postrow.PM_AUTHOR_FULL}</span></td>
+ <td style="padding: 4px;"><p class="topictitle">{postrow.ATTACH_ICON_IMG} <a href="{postrow.U_VIEW_DETAILS}">{postrow.PM_SUBJECT}</a></p>
+ <span class="gensmall">{L_PM_FROM}{L_COLON} {postrow.PM_AUTHOR_FULL}</span></td>
<td style="padding: 4px;" align="{S_CONTENT_FLOW_BEGIN}" valign="top"><span class="gen">{postrow.RECIPIENTS}</span><br />
- <span class="gensmall">{L_SENT_AT}: {postrow.PM_TIME}</span></td>
+ <span class="gensmall">{L_SENT_AT}{L_COLON} {postrow.PM_TIME}</span></td>
<!-- ELSE -->
- <td style="padding: 4px;"><p class="topictitle"><a href="{postrow.U_VIEWPOST}">{postrow.POST_SUBJECT}</a></p>
- <span class="gensmall"><!-- IF postrow.U_VIEWFORUM -->{L_FORUM}: <a href="{postrow.U_VIEWFORUM}">{postrow.FORUM_NAME}</a><!-- ELSE -->{postrow.FORUM_NAME}<!-- ENDIF --></span></td>
+ <td style="padding: 4px;"><p class="topictitle">{postrow.ATTACH_ICON_IMG} <a href="{postrow.U_VIEWPOST}">{postrow.POST_SUBJECT}</a></p>
+ <span class="gensmall"><!-- IF postrow.U_VIEWFORUM -->{L_FORUM}{L_COLON} <a href="{postrow.U_VIEWFORUM}">{postrow.FORUM_NAME}</a><!-- ELSE -->{postrow.FORUM_NAME}<!-- ENDIF --></span></td>
<td style="padding: 4px;" align="{S_CONTENT_FLOW_BEGIN}" valign="top" nowrap="nowrap"><span class="gen">{postrow.POST_AUTHOR_FULL}</span><br />
<span class="gensmall">{postrow.POST_TIME}</span></td>
<!-- ENDIF -->
@@ -64,4 +64,4 @@
</tr>
</table>
-<!-- INCLUDE mcp_footer.html --> \ No newline at end of file
+<!-- INCLUDE mcp_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/mcp_topic.html b/phpBB/styles/subsilver2/template/mcp_topic.html
index f9f9382ff2..eee7fa95ea 100644
--- a/phpBB/styles/subsilver2/template/mcp_topic.html
+++ b/phpBB/styles/subsilver2/template/mcp_topic.html
@@ -10,10 +10,12 @@
<tr>
<td class="row2" colspan="3" align="center"><span class="gensmall">{L_SPLIT_TOPIC_EXPLAIN}</span></td>
</tr>
+ <!-- EVENT mcp_topic_options_before -->
<tr>
<td class="row1" nowrap="nowrap"><span class="gen">{L_SPLIT_SUBJECT}</span></td>
- <td class="row2" colspan="2"><input class="post" style="width: 350px" type="text" size="35" maxlength="64" name="subject" value="{SPLIT_SUBJECT}" /></td>
+ <td class="row2" colspan="2"><input class="post" style="width: 350px" type="text" size="35" maxlength="124" name="subject" value="{SPLIT_SUBJECT}" /></td>
</tr>
+ <!-- EVENT mcp_topic_options_after -->
<tr>
<td class="row1" nowrap="nowrap"><span class="gen">{L_SPLIT_FORUM}</span></td>
<td class="row2" colspan="2"><select name="to_forum_id">{S_FORUM_SELECT}</select></td>
@@ -42,7 +44,7 @@
</tr>
<tr>
<td class="row1" nowrap="nowrap"><span class="gen">{L_MERGE_TOPIC_ID}</span></td>
- <td class="row2" colspan="2"><input class="post" type="text" size="6" name="to_topic_id" value="{TO_TOPIC_ID}" /> <a href="{U_SELECT_TOPIC}">{L_SELECT_TOPIC}</a></td>
+ <td class="row2" colspan="2"><input class="post" type="number" min="0" max="9999999999" name="to_topic_id" value="{TO_TOPIC_ID}" /> <a href="{U_SELECT_TOPIC}">{L_SELECT_TOPIC}</a></td>
</tr>
<!-- IF TO_TOPIC_INFO -->
<tr>
@@ -55,13 +57,13 @@
</tr>
<tr>
<td class="row1" nowrap="nowrap"><span class="gen">{L_POSTS_PER_PAGE}</span><br /><span class="gensmall">{L_POSTS_PER_PAGE_EXPLAIN}</span></td>
- <td class="row2" colspan="2"><input class="post" type="text" name="posts_per_page" size="6" value="{POSTS_PER_PAGE}" /></td>
+ <td class="row2" colspan="2"><input class="post" type="number" min="0" max="999999" name="posts_per_page" value="{POSTS_PER_PAGE}" /></td>
</tr>
<tr>
- <td class="cat" colspan="3" align="center"><span class="gensmall">{L_DISPLAY_POSTS}:</span> {S_SELECT_SORT_DAYS}&nbsp;<span class="gensmall">{L_SORT_BY}</span> {S_SELECT_SORT_KEY} {S_SELECT_SORT_DIR}&nbsp;<input class="btnlite" type="submit" name="sort" value="{L_GO}" /></td>
+ <td class="cat" colspan="3" align="center"><span class="gensmall">{L_DISPLAY_POSTS}{L_COLON}</span> {S_SELECT_SORT_DAYS}&nbsp;<span class="gensmall">{L_SORT_BY}</span> {S_SELECT_SORT_KEY} {S_SELECT_SORT_DIR}&nbsp;<input class="btnlite" type="submit" name="sort" value="{L_GO}" /></td>
</tr>
<tr>
- <th nowrap="nowrap" colspan="3">{L_TOPIC_REVIEW}: {TOPIC_TITLE}</th>
+ <th nowrap="nowrap" colspan="3">{L_TOPIC_REVIEW}{L_COLON} <!-- EVENT mcp_topic_topic_title_before -->{TOPIC_TITLE}<!-- EVENT mcp_topic_topic_title_after --></th>
</tr>
<tr>
<td class="row3" colspan="3" align="center"><span class="gensmall">{RETURN_TOPIC}</span></td>
@@ -72,14 +74,16 @@
<td align="center"><b class="postauthor">{postrow.POST_AUTHOR_FULL}</b></td>
<td width="100%">
+ <!-- EVENT mcp_topic_postrow_post_details_before -->
<table width="100%" cellspacing="0" cellpadding="0" border="0">
- <tr valign="top">
- <td class="gensmall" nowrap="nowrap">&nbsp;<b>{L_POST_SUBJECT}:</b>&nbsp;</td>
+ <tr style="vertical-align: top;">
+ <td class="gensmall" nowrap="nowrap">&nbsp;<b>{L_POST_SUBJECT}{L_COLON}</b>&nbsp;</td>
<td class="gensmall" width="100%">{postrow.POST_SUBJECT}</td>
</tr>
</table>
+ <!-- EVENT mcp_topic_postrow_post_details_after -->
</td>
- <td width="5%" align="center"><a href="{postrow.U_POST_DETAILS}">{INFO_IMG}</a></td>
+ <td width="5%" align="center"><a href="{postrow.U_POST_DETAILS}" class="imageset">{INFO_IMG}</a></td>
</tr>
<!-- IF postrow.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
@@ -94,7 +98,7 @@
<table class="tablebg" width="100%" cellspacing="1">
<tr>
- <td class="row3"><b class="genmed">{L_ATTACHMENTS}: </b></td>
+ <td class="row3"><b class="genmed">{L_ATTACHMENTS}{L_COLON} </b></td>
</tr>
<!-- BEGIN attachment -->
<tr>
@@ -112,10 +116,11 @@
<tr valign="middle">
<td width="100%">
<!-- IF postrow.S_POST_UNAPPROVED and postrow.U_MCP_APPROVE --><span class="postapprove">{UNAPPROVED_IMG} <a href="{postrow.U_MCP_APPROVE}">{L_POST_UNAPPROVED}</a></span><br /><!-- ENDIF -->
+ <!-- IF postrow.S_POST_DELETED and postrow.U_MCP_APPROVE --><span class="postapprove">{DELETED_IMG} <a href="{postrow.U_MCP_APPROVE}">{L_POST_DELETED}</a></span><br /><!-- ENDIF -->
<!-- IF postrow.S_POST_REPORTED and postrow.U_MCP_REPORT --><span class="postreported">{REPORTED_IMG} <a href="{postrow.U_MCP_REPORT}">{L_POST_REPORTED}</a></span><!-- ENDIF -->
</td>
<td width="10" nowrap="nowrap">{postrow.MINI_POST_IMG}</td>
- <td class="gensmall" nowrap="nowrap"><b>{L_POSTED}:</b> {postrow.POST_DATE}</td>
+ <td class="gensmall" nowrap="nowrap"><b>{L_POSTED}{L_COLON}</b> {postrow.POST_DATE}</td>
</tr>
</table>
</td>
@@ -133,6 +138,7 @@
<!-- IF S_CAN_APPROVE --><option value="approve">{L_APPROVE_POSTS}</option><!-- ENDIF -->
<!-- IF S_CAN_LOCK --><option value="lock_post">{L_LOCK_POST_POSTS} [ {L_LOCK_POST_EXPLAIN} ]</option><option value="unlock_post">{L_UNLOCK_POST_POSTS}</option><!-- ENDIF -->
<!-- IF S_CAN_DELETE --><option value="delete_post">{L_DELETE_POSTS}</option><!-- ENDIF -->
+ <!-- IF S_CAN_RESTORE --><option value="restore">{L_RESTORE_POSTS}</option><!-- ENDIF -->
<!-- IF S_CAN_MERGE --><option value="merge_posts"<!-- IF ACTION eq 'merge' --> selected="selected"<!-- ENDIF -->>{L_MERGE_POSTS}</option><!-- ENDIF -->
<!-- IF S_CAN_SPLIT --><option value="split_all"<!-- IF ACTION eq 'split' --> selected="selected"<!-- ENDIF -->>{L_SPLIT_POSTS}</option><option value="split_beyond">{L_SPLIT_AFTER}</option><!-- ENDIF -->
<!-- IF S_CAN_SYNC --><option value="resync">{L_RESYNC}</option><!-- ENDIF -->
diff --git a/phpBB/styles/subsilver2/template/mcp_viewlogs.html b/phpBB/styles/subsilver2/template/mcp_viewlogs.html
deleted file mode 100644
index b6431e4d51..0000000000
--- a/phpBB/styles/subsilver2/template/mcp_viewlogs.html
+++ /dev/null
@@ -1,52 +0,0 @@
-<!-- INCLUDE mcp_header.html -->
-
-<form method="post" name="mcp" action="{S_MCP_ACTION}">
-
-<table class="tablebg" width="100%" cellspacing="1" cellpadding="2" border="0">
-<tr>
- <th colspan="<!-- IF S_TOPIC_ID -->4<!-- ELSE -->5<!-- ENDIF -->" nowrap="nowrap">{L_DISPLAY_OPTIONS}</th>
-</tr>
-<tr>
- <td colspan="<!-- IF S_TOPIC_ID -->4<!-- ELSE -->5<!-- ENDIF -->" class="cat" align="center"><span class="gensmall">{L_DISPLAY_LOG}:</span> {S_SELECT_SORT_DAYS}&nbsp;<span class="gensmall">{L_SORT_BY}</span> {S_SELECT_SORT_KEY} {S_SELECT_SORT_DIR}&nbsp;<input class="btnlite" type="submit" name="sort" value="{L_GO}" /></span></td>
-</tr>
-<tr>
- <th width="15%" nowrap="nowrap">{L_USERNAME}</th>
- <th width="12%" nowrap="nowrap">{L_IP}</th>
- <th width="18%" nowrap="nowrap">{L_TIME}</th>
- <th width="45%" nowrap="nowrap">{L_ACTION}</th>
- <!-- IF not S_TOPIC_ID -->
- <th width="8%" nowrap="nowrap"></th>
- <!-- ENDIF -->
-</tr>
-<!-- IF S_TOPIC_ID -->
- <tr>
- <td class="row3" colspan="5"><span class="gensmall">{L_LOGS_CURRENT_TOPIC} <a href="{U_VIEW_TOPIC}"><b>{TOPIC_NAME}</b></a></span></td>
- </tr>
-<!-- ENDIF -->
-<!-- BEGIN log -->
- <tr>
- <td class="row1" nowrap="nowrap"><span class="gen">{log.USERNAME}</span></td>
- <td class="row1" align="center" nowrap="nowrap"><span class="gen">{log.IP}</span></td>
- <td class="row1" align="center" nowrap="nowrap"><span class="gensmall">{log.TIME}</span></td>
- <td class="row1"><span class="gen">{log.ACTION}</span></td>
- <!-- IF not S_TOPIC_ID -->
- <td class="row1" align="center" nowrap="nowrap"><span class="gensmall"><!-- IF log.U_VIEW_TOPIC --><a href="{log.U_VIEW_TOPIC}">{L_VIEW_TOPIC}</a><!-- IF log.U_VIEWLOGS --> | <!-- ENDIF --><!-- ENDIF --><!-- IF log.U_VIEWLOGS --><a href="{log.U_VIEWLOGS}">{L_VIEW_TOPIC_LOGS}</a><!-- ENDIF --></span></td>
- <!-- ENDIF -->
- </tr>
-<!-- BEGINELSE -->
- <tr>
- <td class="row1" colspan="<!-- IF S_TOPIC_ID -->4<!-- ELSE -->5<!-- ENDIF -->" align="center"><span class="gen">{L_NO_ENTRIES}</span></td>
- </tr>
-<!-- END log -->
-</table>
-{S_FORM_TOKEN}
-</form>
-
-<table width="100%" cellspacing="2" cellpadding="2" border="0" align="center">
-<tr>
- <td class="nav" align="{S_CONTENT_FLOW_BEGIN}" valign="middle">{PAGE_NUMBER}</td>
- <td align="{S_CONTENT_FLOW_END}" valign="top" nowrap="nowrap"><!-- INCLUDE pagination.html --></td>
-</tr>
-</table>
-
-<!-- INCLUDE mcp_footer.html --> \ No newline at end of file
diff --git a/phpBB/styles/subsilver2/template/mcp_warn_front.html b/phpBB/styles/subsilver2/template/mcp_warn_front.html
index 78673b690e..f6daec9cc5 100644
--- a/phpBB/styles/subsilver2/template/mcp_warn_front.html
+++ b/phpBB/styles/subsilver2/template/mcp_warn_front.html
@@ -7,7 +7,7 @@
<th colspan="2"align="center">{L_SELECT_USER}</th>
</tr>
<tr>
- <td class="row1" width="40%"><b class="gen">{L_FIND_USERNAME}: </b><br /><span class="gensmall">[ <a href="{U_FIND_USERNAME}" onclick="find_username(this.href); return false;">{L_FIND_USERNAME}</a> ]</span></td>
+ <td class="row1" width="40%"><b class="gen">{L_FIND_USERNAME}{L_COLON} </b><br /><span class="gensmall">[ <a href="{U_FIND_USERNAME}" onclick="find_username(this.href); return false;">{L_FIND_USERNAME}</a> ]</span></td>
<td class="row2"><input type="text" class="post" name="username" size="20" /></td>
</tr>
<tr>
@@ -38,7 +38,7 @@
</tr>
<!-- BEGINELSE -->
<tr>
- <td class="row1" colspan="4" align="center"><span class="gen">{L_WARNINGS_ZERO_TOTAL}</span></td>
+ <td class="row1" colspan="4" align="center"><span class="gen">{L_NO_WARNINGS}</span></td>
</tr>
<!-- END highest -->
</table>
@@ -64,11 +64,11 @@
</tr>
<!-- BEGINELSE -->
<tr>
- <td class="row1" colspan="4" align="center"><span class="gen">{L_WARNINGS_ZERO_TOTAL}</span></td>
+ <td class="row1" colspan="4" align="center"><span class="gen">{L_NO_WARNINGS}</span></td>
</tr>
<!-- END latest -->
</table>
<br clear="all" /><br />
-<!-- INCLUDE mcp_footer.html --> \ No newline at end of file
+<!-- INCLUDE mcp_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/mcp_warn_list.html b/phpBB/styles/subsilver2/template/mcp_warn_list.html
index 078bbc0b34..6e263b6403 100644
--- a/phpBB/styles/subsilver2/template/mcp_warn_list.html
+++ b/phpBB/styles/subsilver2/template/mcp_warn_list.html
@@ -21,11 +21,11 @@
</tr>
<!-- BEGINELSE -->
<tr>
- <td class="row1" colspan="4" align="center"><span class="gen">{L_WARNINGS_ZERO_TOTAL}</span></td>
+ <td class="row1" colspan="4" align="center"><span class="gen">{L_NO_WARNINGS}</span></td>
</tr>
<!-- END user -->
<tr align="center">
- <td class="row3" colspan="4"><span class="gensmall">{L_DISPLAY_POSTS}:</span> {S_SELECT_SORT_DAYS}&nbsp;<span class="gensmall">{L_SORT_BY}</span> {S_SELECT_SORT_KEY} {S_SELECT_SORT_DIR}&nbsp;<input class="btnlite" type="submit" value="{L_GO}" name="sort" /></td>
+ <td class="row3" colspan="4"><span class="gensmall">{L_DISPLAY_POSTS}{L_COLON}</span> {S_SELECT_SORT_DAYS}&nbsp;<span class="gensmall">{L_SORT_BY}</span> {S_SELECT_SORT_KEY} {S_SELECT_SORT_DIR}&nbsp;<input class="btnlite" type="submit" value="{L_GO}" name="sort" /></td>
</tr>
</table>
@@ -40,4 +40,4 @@
<br clear="all" /><br />
-<!-- INCLUDE mcp_footer.html --> \ No newline at end of file
+<!-- INCLUDE mcp_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/mcp_warn_post.html b/phpBB/styles/subsilver2/template/mcp_warn_post.html
index ef0595e48e..68715eff2d 100644
--- a/phpBB/styles/subsilver2/template/mcp_warn_post.html
+++ b/phpBB/styles/subsilver2/template/mcp_warn_post.html
@@ -35,6 +35,8 @@
<form method="post" name="mcp" action="{U_POST_ACTION}">
+<!-- EVENT mcp_warn_post_add_warning_field_before -->
+
<table width="100%" cellpadding="3" cellspacing="1" border="0" class="tablebg">
<tr>
<th align="center">{L_ADD_WARNING}</th>
@@ -54,9 +56,12 @@
<td class="cat" align="center"><input class="btnmain" type="submit" name="action[add_warning]" value="{L_SUBMIT}" />&nbsp;&nbsp;<input class="btnlite" type="reset" value="{L_RESET}" /></td>
</tr>
</table>
+
+<!-- EVENT mcp_warn_post_add_warning_field_after -->
+
{S_FORM_TOKEN}
</form>
<br clear="all" /><br />
-<!-- INCLUDE mcp_footer.html --> \ No newline at end of file
+<!-- INCLUDE mcp_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/mcp_warn_user.html b/phpBB/styles/subsilver2/template/mcp_warn_user.html
index 4bf6cabad3..20b57c6837 100644
--- a/phpBB/styles/subsilver2/template/mcp_warn_user.html
+++ b/phpBB/styles/subsilver2/template/mcp_warn_user.html
@@ -28,15 +28,15 @@
<td class="row1">
<table width="100%" cellspacing="1" cellpadding="2" border="0">
<tr>
- <td class="gen" align="{S_CONTENT_FLOW_END}" nowrap="nowrap">{L_JOINED}: </td>
+ <td class="gen" align="{S_CONTENT_FLOW_END}" nowrap="nowrap">{L_JOINED}{L_COLON} </td>
<td width="100%"><b class="gen">{JOINED}</b></td>
</tr>
<tr>
- <td class="gen" align="{S_CONTENT_FLOW_END}" valign="top" nowrap="nowrap">{L_TOTAL_POSTS}: </td>
+ <td class="gen" align="{S_CONTENT_FLOW_END}" valign="top" nowrap="nowrap">{L_TOTAL_POSTS}{L_COLON} </td>
<td><b class="gen">{POSTS}</b></td>
</tr>
<tr>
- <td class="gen" align="{S_CONTENT_FLOW_END}" valign="top" nowrap="nowrap">{L_WARNINGS}: </td>
+ <td class="gen" align="{S_CONTENT_FLOW_END}" valign="top" nowrap="nowrap">{L_WARNINGS}{L_COLON} </td>
<td><b class="gen">{WARNINGS}</b></td>
</tr>
</table>
@@ -48,6 +48,8 @@
<form method="post" name="mcp" action="{U_POST_ACTION}">
+<!-- EVENT mcp_warn_user_add_warning_field_before -->
+
<table width="100%" cellpadding="3" cellspacing="1" border="0" class="tablebg">
<tr>
<th align="center">{L_ADD_WARNING}</th>
@@ -67,9 +69,12 @@
<td class="cat" align="center"><input class="btnmain" type="submit" name="action[add_warning]" value="{L_SUBMIT}" />&nbsp;&nbsp;<input class="btnlite" type="reset" value="{L_RESET}" /></td>
</tr>
</table>
+
+<!-- EVENT mcp_warn_user_add_warning_field_after -->
+
{S_FORM_TOKEN}
</form>
<br clear="all" /><br />
-<!-- INCLUDE mcp_footer.html --> \ No newline at end of file
+<!-- INCLUDE mcp_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/mcp_whois.html b/phpBB/styles/subsilver2/template/mcp_whois.html
index 54b93eec69..3e3b983059 100644
--- a/phpBB/styles/subsilver2/template/mcp_whois.html
+++ b/phpBB/styles/subsilver2/template/mcp_whois.html
@@ -12,4 +12,4 @@
</tr>
</table>
-<!-- INCLUDE mcp_footer.html --> \ No newline at end of file
+<!-- INCLUDE mcp_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/memberlist_body.html b/phpBB/styles/subsilver2/template/memberlist_body.html
index 800162b7b0..9044896bca 100644
--- a/phpBB/styles/subsilver2/template/memberlist_body.html
+++ b/phpBB/styles/subsilver2/template/memberlist_body.html
@@ -14,7 +14,7 @@
<form method="post" name="charsearch" action="{S_MODE_ACTION}">
<table width="100%" cellspacing="1">
<tr>
- <td align="{S_CONTENT_FLOW_BEGIN}"><span class="genmed">{L_USERNAME_BEGINS_WITH}: </span>
+ <td align="{S_CONTENT_FLOW_BEGIN}"><span class="genmed">{L_USERNAME_BEGINS_WITH}{L_COLON} </span>
<select name="first_char" onchange="this.form.submit();">
<!-- BEGIN first_char -->
<option value="{first_char.VALUE}"<!-- IF first_char.S_SELECTED --> selected="selected"<!-- ENDIF -->>{first_char.DESC}</option>
@@ -39,13 +39,11 @@
<table class="tablebg" width="100%" cellspacing="1">
<tr>
<th nowrap="nowrap">#</th>
- <th nowrap="nowrap" width="25%" align="{S_CONTENT_FLOW_BEGIN}"><a href="{U_SORT_USERNAME}">{L_USERNAME}</a></th>
+ <th nowrap="nowrap" width="36%" align="{S_CONTENT_FLOW_BEGIN}"><a href="{U_SORT_USERNAME}">{L_USERNAME}</a></th>
<th nowrap="nowrap" width="15%"><a href="{U_SORT_JOINED}">{L_JOINED}</a></th>
<th nowrap="nowrap" width="10%"><a href="{U_SORT_POSTS}">{L_POSTS}</a></th>
<th nowrap="nowrap" width="15%"><a href="{U_SORT_RANK}">{L_RANK}</a></th>
- <th nowrap="nowrap" width="11%">{L_SEND_MESSAGE}</th>
<th nowrap="nowrap" width="11%"><a href="{U_SORT_EMAIL}">{L_EMAIL}</a></th>
- <th nowrap="nowrap" width="11%"><a href="{U_SORT_WEBSITE}">{L_WEBSITE}</a></th>
<!-- IF S_IN_SEARCH_POPUP and not S_SELECT_SINGLE --><th width="2%" nowrap="nowrap">{L_MARK}</th><!-- ENDIF -->
</tr>
<!-- BEGIN memberrow -->
@@ -53,11 +51,11 @@
<!-- IF S_SHOW_GROUP -->
<!-- IF memberrow.S_FIRST_ROW and memberrow.S_GROUP_LEADER -->
<tr class="row3">
- <td colspan="8"><b class="gensmall">{L_GROUP_LEADER}</b></td>
+ <td colspan="7"><b class="gensmall">{L_GROUP_LEADER}</b></td>
</tr>
<!-- ELSEIF not memberrow.S_GROUP_LEADER and not $S_MEMBER_HEADER -->
<tr class="row3">
- <td colspan="8"><b class="gensmall">{L_GROUP_MEMBERS}</b></td>
+ <td colspan="7"><b class="gensmall">{L_GROUP_MEMBERS}</b></td>
</tr>
<!-- DEFINE $S_MEMBER_HEADER = 1 -->
<!-- ENDIF -->
@@ -66,13 +64,11 @@
<!-- IF memberrow.S_ROW_COUNT is even --><tr class="row2"><!-- ELSE --> <tr class="row1"><!-- ENDIF -->
<td class="gen" align="center">&nbsp;{memberrow.ROW_NUMBER}&nbsp;</td>
- <td class="genmed" align="{S_CONTENT_FLOW_BEGIN}">{memberrow.USERNAME_FULL}<!-- IF S_SELECT_SINGLE --> [&nbsp;<a href="#" onclick="insert_single('{memberrow.A_USERNAME}'); return false;">{L_SELECT}</a>&nbsp;]<!-- ENDIF --></td>
+ <td class="genmed" align="{S_CONTENT_FLOW_BEGIN}"><!-- EVENT memberlist_body_username_prepend -->{memberrow.USERNAME_FULL}<!-- IF memberrow.S_INACTIVE --> <em>({L_INACTIVE})</em><!-- ENDIF --><!-- EVENT memberlist_body_username_append --><!-- IF S_SELECT_SINGLE --> [&nbsp;<a href="#" onclick="insert_single('{memberrow.A_USERNAME}'); return false;">{L_SELECT}</a>&nbsp;]<!-- ENDIF --></td>
<td class="genmed" align="center" nowrap="nowrap">&nbsp;{memberrow.JOINED}&nbsp;</td>
<td class="gen" align="center">{memberrow.POSTS}</td>
- <td class="gen" align="center"><!-- IF memberrow.RANK_IMG -->{memberrow.RANK_IMG}<!-- ELSE -->{memberrow.RANK_TITLE}<!-- ENDIF --></td>
- <td class="gen" align="center">&nbsp;<!-- IF memberrow.U_PM --><a href="{memberrow.U_PM}">{PM_IMG}</a><!-- ENDIF -->&nbsp;</td>
- <td class="gen" align="center">&nbsp;<!-- IF memberrow.U_EMAIL --><a href="{memberrow.U_EMAIL}">{EMAIL_IMG}</a><!-- ENDIF -->&nbsp;</td>
- <td class="gen" align="center">&nbsp;<!-- IF memberrow.U_WWW --><a href="{memberrow.U_WWW}">{WWW_IMG}</a><!-- ENDIF -->&nbsp;</td>
+ <td class="gen" align="center"><!-- EVENT memberlist_body_rank_prepend --><!-- IF memberrow.RANK_IMG -->{memberrow.RANK_IMG}<!-- ELSE -->{memberrow.RANK_TITLE}<!-- ENDIF --><!-- EVENT memberlist_body_rank_append --></td>
+ <td class="gen" align="center">&nbsp;<!-- IF memberrow.U_EMAIL --><a href="{memberrow.U_EMAIL}" class="imageset">{EMAIL_IMG}</a><!-- ENDIF -->&nbsp;</td>
<!-- IF memberrow.S_PROFILE_FIELD1 -->
<!-- Use a construct like this to include admin defined profile fields. Replace FIELD1 with the name of your field. -->
<td class="gen" align="center">&nbsp;{memberrow.PROFILE_FIELD1_VALUE}</td>
@@ -83,7 +79,7 @@
<!-- BEGINELSE -->
<tr>
- <td class="row1" colspan="<!-- IF S_IN_SEARCH_POPUP -->9<!-- ELSE -->8<!-- ENDIF -->" align="center">
+ <td class="row1" colspan="<!-- IF S_IN_SEARCH_POPUP -->8<!-- ELSE -->7<!-- ENDIF -->" align="center">
<span class="gen"><!-- IF S_SHOW_GROUP -->{L_NO_GROUP_MEMBERS}<!-- ELSE -->{L_NO_MEMBERS}<!-- ENDIF --></span>
</td>
</tr>
@@ -91,7 +87,7 @@
<!-- END memberrow -->
<tr>
- <td class="cat" colspan="<!-- IF S_IN_SEARCH_POPUP -->9<!-- ELSE -->8<!-- ENDIF -->" align="center"><!-- IF S_IN_SEARCH_POPUP and not S_SELECT_SINGLE --><input class="btnlite" type="submit" value="{L_SELECT_MARKED}" /><!-- ELSE --><span class="gensmall">{L_SELECT_SORT_METHOD}:</span>&nbsp;<select name="sk">{S_MODE_SELECT}</select>&nbsp; <span class="gensmall">{L_ORDER}</span>&nbsp;<select name="sd">{S_ORDER_SELECT}</select>&nbsp; <input type="submit" name="submit" value="{L_SUBMIT}" class="btnlite" /><!-- ENDIF --></td>
+ <td class="cat" colspan="<!-- IF S_IN_SEARCH_POPUP -->8<!-- ELSE -->7<!-- ENDIF -->" align="center"><!-- IF S_IN_SEARCH_POPUP and not S_SELECT_SINGLE --><input class="btnlite" type="submit" value="{L_SELECT_MARKED}" /><!-- ELSE --><span class="gensmall">{L_SELECT_SORT_METHOD}{L_COLON}</span>&nbsp;<select name="sk">{S_MODE_SELECT}</select>&nbsp; <span class="gensmall">{L_ORDER}</span>&nbsp;<select name="sd">{S_ORDER_SELECT}</select>&nbsp; <input type="submit" name="submit" value="{L_SUBMIT}" class="btnlite" /><!-- ENDIF --></td>
</tr>
</table>
{S_FORM_TOKEN}
@@ -118,4 +114,4 @@
<div align="{S_CONTENT_FLOW_END}"><!-- INCLUDE jumpbox.html --></div>
<!-- INCLUDE overall_footer.html -->
-<!-- ENDIF --> \ No newline at end of file
+<!-- ENDIF -->
diff --git a/phpBB/styles/subsilver2/template/memberlist_email.html b/phpBB/styles/subsilver2/template/memberlist_email.html
index 976ac1ad89..04f36b2244 100644
--- a/phpBB/styles/subsilver2/template/memberlist_email.html
+++ b/phpBB/styles/subsilver2/template/memberlist_email.html
@@ -1,63 +1,97 @@
<!-- INCLUDE overall_header.html -->
+<!-- EVENT memberlist_email_before -->
+
<div id="pagecontent">
<form action="{S_POST_ACTION}" method="post" name="postform">
-
+
<table class="tablebg" width="100%" cellspacing="1">
- <tr>
- <th colspan="2">{L_SEND_EMAIL_USER} {USERNAME}</th>
+ <tr>
+ <!-- IF S_CONTACT_ADMIN-->
+ <th colspan="2">{L_CONTACT_ADMIN}</th>
+ <!-- ELSEIF S_SEND_USER -->
+ <th colspan="2">{L_SEND_EMAIL_USER}</th>
+ <!-- ELSE -->
+ <th colspan="2">{L_EMAIL_TOPIC}</th>
+ <!-- ENDIF -->
</tr>
<!-- IF ERROR_MESSAGE -->
<tr>
<td class="row3" colspan="2" align="center"><span class="error">{ERROR_MESSAGE}</span></td>
</tr>
<!-- ENDIF -->
+ <!-- IF CONTACT_INFO -->
+ <tr>
+ <td class="row1" colspan="2">{CONTACT_INFO}</td>
+ </tr>
+ <!-- ENDIF -->
<!-- IF S_SEND_USER -->
- <tr>
+ <tr>
<td class="row1" width="35%"><b class="genmed">{L_RECIPIENT}</b></td>
<td class="row2" width="65%"><b class="genmed">{USERNAME}</b></td>
</tr>
- <tr>
+ <tr>
<td class="row1" width="35%"><b class="genmed">{L_SUBJECT}</b></td>
<td class="row2"><input class="post" type="text" name="subject" size="50" tabindex="2" value="{SUBJECT}" /></td>
</tr>
- <!-- ELSE -->
+ <!-- ELSEIF S_CONTACT_ADMIN-->
<tr>
- <td class="row1" width="35%"><b class="genmed">{L_EMAIL_ADDRESS}</b></td>
+ <td class="row1" width="35%"><b class="genmed">{L_RECIPIENT}</b></td>
+ <td class="row2" width="65%"><b class="genmed">{L_ADMINISTRATOR}</b></td>
+ </tr>
+ <!-- IF not S_IS_REGISTERED -->
+ <tr>
+ <td class="row1" width="35%"><b class="genmed">{L_SENDER_EMAIL_ADDRESS}</b></td>
<td class="row2"><input class="post" type="text" name="email" size="50" maxlength="100" value="{EMAIL}" /></td>
</tr>
- <tr>
+ <tr>
+ <td class="row1" width="35%"><b class="genmed">{L_SENDER_NAME}</b></td>
+ <td class="row2"><input class="post" type="text" name="name" size="50" value="{NAME}" /></td>
+ </tr>
+ <!-- ENDIF -->
+ <tr>
+ <td class="row1" width="35%"><b class="genmed">{L_SUBJECT}</b></td>
+ <td class="row2"><input class="post" type="text" name="subject" size="50" tabindex="2" value="{SUBJECT}" /></td>
+ </tr>
+ <!-- ELSE -->
+ <tr>
+ <td class="row1" width="35%"><b class="genmed">{L_EMAIL_ADDRESS}</b></td>
+ <td class="row2"><input class="post" type="email" name="email" size="50" maxlength="100" value="{EMAIL}" /></td>
+ </tr>
+ <tr>
<td class="row1" width="35%"><b class="genmed">{L_REAL_NAME}</b></td>
<td class="row2"><input class="post" type="text" name="name" size="50" value="{NAME}" /></td>
</tr>
- <tr>
+ <tr>
<td class="row1" width="35%"><b class="genmed">{L_DEST_LANG}</b><br /><span class="gensmall">{L_DEST_LANG_EXPLAIN}</span></td>
<td class="row2"><select name="lang">{S_LANG_OPTIONS}</select></td>
</tr>
<!-- ENDIF -->
- <tr>
+ <tr>
<td class="row1" valign="top"><b class="genmed">{L_MESSAGE_BODY}</b><br /><span class="gensmall">{L_EMAIL_BODY_EXPLAIN}</span></td>
<td class="row2"><textarea class="post" name="message" rows="15" cols="76" tabindex="3">{MESSAGE}</textarea></td>
</tr>
- <tr>
+ <!-- IF S_REGISTERED_USER -->
+ <tr>
<td class="row1" valign="top"><span class="gen"><b>{L_OPTIONS}</b></span></td>
<td class="row2">
<table cellspacing="0" cellpadding="1" border="0">
- <tr>
- <td><input type="checkbox" class="radio" name="cc_email" value="1" checked="checked" /></td>
- <td class="gen">{L_CC_EMAIL}</td>
+ <tr>
+ <td><input type="checkbox" class="radio" name="cc_sender" value="1" checked="checked" /></td>
+ <td class="gen">{L_CC_SENDER}</td>
</tr>
</table>
</td>
</tr>
+ <!-- ENDIF -->
<tr>
<td class="cat" colspan="2" align="center"><input type="submit" tabindex="6" name="submit" class="btnmain" value="{L_SEND_EMAIL}" /></td>
</tr>
</table>
{S_FORM_TOKEN}
-
+
</form>
</div>
@@ -70,4 +104,4 @@
<div style="float: {S_CONTENT_FLOW_END};"><!-- INCLUDE jumpbox.html --></div>
-<!-- INCLUDE overall_footer.html --> \ No newline at end of file
+<!-- INCLUDE overall_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/memberlist_group.html b/phpBB/styles/subsilver2/template/memberlist_group.html
index 650868f810..ff8c96c120 100644
--- a/phpBB/styles/subsilver2/template/memberlist_group.html
+++ b/phpBB/styles/subsilver2/template/memberlist_group.html
@@ -4,14 +4,14 @@
<th colspan="3">{L_GROUP_INFORMATION}</th>
</tr>
<tr>
- <td class="row1" width="20%"><b class="genmed">{L_GROUP_NAME}:</b></td>
- <td class="row2"><b class="gen"<!-- IF GROUP_COLOR --> style="color:#{GROUP_COLOR}"<!-- ENDIF -->>{GROUP_NAME}</b></td>
+ <td class="row1" width="20%"><b class="genmed">{L_GROUP_NAME}{L_COLON}</b></td>
+ <td class="row2"><b class="gen"<!-- IF GROUP_COLOR --> style="color:#{GROUP_COLOR}"<!-- ENDIF -->>{GROUP_NAME}</b> <!-- IF U_MANAGE --><a href="{U_MANAGE}">{L_MANAGE_GROUP}</a><!-- ENDIF --></td>
<!-- IF AVATAR_IMG or RANK_IMG or GROUP_RANK or U_PM -->
- <td class="row1" width="33%" rowspan="2" align="center"><!-- IF AVATAR_IMG -->{AVATAR_IMG}<br /><!-- ENDIF --><!-- IF RANK_IMG -->{RANK_IMG}<!-- ENDIF --><!-- IF GROUP_RANK --><span class="gensmall">{GROUP_RANK}</span><br /><br /><!-- ENDIF --><!-- IF U_PM --><a href="{U_PM}">{PM_IMG}</a><!-- ENDIF --></td>
+ <td class="row1" width="33%" rowspan="2" align="center"><!-- IF AVATAR_IMG -->{AVATAR_IMG}<br /><!-- ENDIF --><!-- IF RANK_IMG -->{RANK_IMG}<!-- ENDIF --><!-- IF GROUP_RANK --><span class="gensmall">{GROUP_RANK}</span><br /><br /><!-- ENDIF --><!-- IF U_PM --><a href="{U_PM}" class="imageset">{PM_IMG}</a><!-- ENDIF --></td>
<!-- ENDIF -->
</tr>
<tr>
- <td class="row1" width="20%"><b class="genmed">{L_GROUP_DESC}:</b></td>
+ <td class="row1" width="20%"><b class="genmed">{L_GROUP_DESC}{L_COLON}</b></td>
<td class="row2"><span class="gen">{GROUP_DESC}</span><p class="forumdesc">{GROUP_TYPE}</p></td>
</tr>
</table>
diff --git a/phpBB/styles/subsilver2/template/memberlist_im.html b/phpBB/styles/subsilver2/template/memberlist_im.html
index 0a92fd2ba0..ecd9aca86f 100644
--- a/phpBB/styles/subsilver2/template/memberlist_im.html
+++ b/phpBB/styles/subsilver2/template/memberlist_im.html
@@ -2,138 +2,42 @@
<br clear="all" />
-<!-- MSNM info from http://www.cdolive.net/ - doesn't seem to work with MSN Messenger -->
-
<form method="post" action="{S_IM_ACTION}">
<table class="tablebg" width="95%" cellspacing="1" cellpadding="4" border="0" align="center">
<tr>
<th colspan="2">{L_SEND_IM}</th>
</tr>
+ <!-- IF S_SENT_JABBER -->
+ <tr>
+ <td class="row1" colspan="2" align="center"><span class="gen">{L_IM_SENT_JABBER}</span></td>
+ </tr>
+ <!-- ENDIF -->
<tr>
<td class="row3" colspan="2"><span class="gensmall">{L_SEND_IM_EXPLAIN}</span></td>
</tr>
<tr>
- <td class="row1"><b class="genmed">{L_IM_RECIPIENT}: </b></td>
- <td class="row2"><span class="gen"><b>{USERNAME}</b><!-- IF S_SEND_ICQ or S_SEND_AIM or S_SEND_MSNM or S_NO_SEND_JABBER --> [ {IM_CONTACT} ]<!-- ENDIF --></span> <!-- IF PRESENCE_IMG -->{PRESENCE_IMG}<!-- ENDIF --></td>
+ <td class="row1"><b class="genmed">{L_IM_RECIPIENT}{L_COLON} </b></td>
+ <td class="row2"><span class="gen"><b>{USERNAME}</b><!-- IF S_NO_SEND_JABBER --> [ {IM_CONTACT} ]<!-- ENDIF --></span> <!-- IF PRESENCE_IMG -->{PRESENCE_IMG}<!-- ENDIF --></td>
</tr>
- <!-- IF S_SEND_AIM -->
- <tr>
- <td class="row1" colspan="2" align="center"><br /><a class="gen" href="{U_AIM_CONTACT}">{L_IM_ADD_CONTACT}</a><br /><a class="gen" href="{U_AIM_MESSAGE}">{L_IM_SEND_MESSAGE}</a><br /><br /><a class="gensmall" href="http://www.aim.com">{L_IM_DOWNLOAD_APP}</a> | <a class="gensmall" href="http://www.aim.com/products/express">{L_IM_AIM_EXPRESS}</a> </td>
- </tr>
- <tr>
- <td class="cat" colspan="2" align="center">&nbsp;</td>
- </tr>
- <!-- ENDIF -->
-
- <!-- IF S_SEND_MSNM -->
- <tr>
- <td class="row1" colspan="2" align="center">
- <object classid="clsid:B69003B3-C55E-4B48-836C-BC5946FC3B28" codetype="application/x-oleobject" id="objMessengerApp" width="0" height="0"></object>
- <script type="text/javascript">
- // <![CDATA[
- var app = document.getElementById('objMessengerApp');
-
- /**
- * Check whether the browser supports this and whether MSNM is connected
- */
- function msn_supported()
- {
- // Does the browser support the MSNM object?
- if (app.MyStatus)
- {
- // Is MSNM connected?
- if (app.MyStatus == 1)
- {
- alert('{LA_IM_MSNM_CONNECT}');
- return false;
- }
- }
- else
- {
- alert('{LA_IM_MSNM_BROWSER}');
- return false;
- }
- return true;
- }
-
- /**
- * Add to your contact list
- */
- function add_contact(address)
- {
- if (msn_supported())
- {
- // Could return an error while MSNM is connecting, don't want that
- try
- {
- app.AddContact(0, address);
- }
- catch (e)
- {
- return;
- }
- }
- }
-
- /**
- * Write IM to contact
- */
- function im_contact(address)
- {
- if (msn_supported())
- {
- // Could return an error while MSNM is connecting, don't want that
- try
- {
- app.InstantMessage(address);
- }
- catch (e)
- {
- return;
- }
- }
- }
- // ]]>
- </script>
-
- <a class="gen" href="#" onclick="add_contact('{A_IM_CONTACT}'); return false;">{L_IM_ADD_CONTACT}</a><br /><a class="gen" href="#" onclick="im_contact('{A_IM_CONTACT}'); return false;">{L_IM_SEND_MESSAGE}</a>
- </td>
- </tr>
- <tr>
- <td class="cat" colspan="2" align="center">&nbsp;</td>
- </tr>
- <!-- ENDIF -->
-
<!-- IF S_SEND_JABBER -->
<tr>
- <td class="row1"><b class="genmed">{L_IM_MESSAGE}: </b></td>
+ <td class="row1"><b class="genmed">{L_IM_MESSAGE}{L_COLON} </b></td>
<td class="row2"><textarea class="post" name="message" rows="5" cols="45"></textarea></td>
</tr>
<tr>
<td class="cat" colspan="2" align="center"><input class="btnmain" name="submit" type="submit" value="{L_IM_SEND}" /></td>
</tr>
- <!-- ENDIF -->
-
- <!-- IF S_NO_SEND_JABBER -->
+ <!-- ELSEIF S_NO_SEND_JABBER -->
<tr>
<td class="row1" colspan="2"><span class="genmed">{L_IM_NO_JABBER}</span></td>
</tr>
<!-- ENDIF -->
- <!-- IF S_SENT_JABBER -->
- <tr>
- <td class="row1" colspan="2" align="center"><span class="gen">{L_IM_SENT_JABBER}</span></td>
- </tr>
- <tr>
- <td class="cat" colspan="2" align="center"></td>
- </tr>
- <!-- ENDIF -->
-
</table>
{S_FORM_TOKEN}
</form>
<a class="nav" href="#" onclick="window.close(); return false;">{L_CLOSE_WINDOW}</a>
-<!-- INCLUDE simple_footer.html --> \ No newline at end of file
+<!-- INCLUDE simple_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/memberlist_leaders.html b/phpBB/styles/subsilver2/template/memberlist_leaders.html
deleted file mode 100644
index ba6dbde617..0000000000
--- a/phpBB/styles/subsilver2/template/memberlist_leaders.html
+++ /dev/null
@@ -1,71 +0,0 @@
-<!-- INCLUDE overall_header.html -->
-
-<form method="post" action="{S_MODE_ACTION}">
-
-<table class="tablebg" width="100%" cellspacing="1">
-<tr>
- <th nowrap="nowrap" width="20%">{L_USERNAME}</th>
- <th nowrap="nowrap" width="25%">{L_FORUMS}</th>
- <th nowrap="nowrap" width="20%">{L_PRIMARY_GROUP}</th>
- <th nowrap="nowrap" width="15%">{L_RANK}</th>
- <th nowrap="nowrap" width="11%">{L_SEND_MESSAGE}</th>
-</tr>
-<tr class="row3">
- <td colspan="5"><b class="gensmall">{L_ADMINISTRATORS}</b></td>
-</tr>
-<!-- BEGIN admin -->
- <!-- IF admin.S_ROW_COUNT is even --><tr class="row2"><!-- ELSE --><tr class="row1"><!-- ENDIF -->
-
- <td class="gen" align="center"><strong>{admin.USERNAME_FULL}</strong></td>
- <td class="gensmall" align="center">&nbsp;</td>
- <td class="gensmall" align="center" nowrap="nowrap">&nbsp;
- <!-- IF admin.U_GROUP -->
- <a<!-- IF admin.GROUP_COLOR --> style="font-weight: bold; color:#{admin.GROUP_COLOR}"<!-- ENDIF --> href="{admin.U_GROUP}">{admin.GROUP_NAME}</a>
- <!-- ELSE -->
- {admin.GROUP_NAME}
- <!-- ENDIF -->
- &nbsp;</td>
- <td class="gen" align="center"><!-- IF admin.RANK_IMG -->{admin.RANK_IMG}<!-- ELSE -->{admin.RANK_TITLE}<!-- ENDIF --></td>
- <td class="gen" align="center">&nbsp;<!-- IF admin.U_PM --><a href="{admin.U_PM}">{PM_IMG}</a><!-- ENDIF -->&nbsp;</td>
-</tr>
-<!-- BEGINELSE -->
- <tr>
- <td class="row1" colspan="5" align="center"><span class="gen">{L_NO_ADMINISTRATORS}</span></td>
- </tr>
-<!-- END admin -->
-<tr class="row3">
- <td colspan="5"><b class="gensmall">{L_MODERATORS}</b></td>
-</tr>
-<!-- BEGIN mod -->
- <!-- IF mod.S_ROW_COUNT is even --><tr class="row2"><!-- ELSE --><tr class="row1"><!-- ENDIF -->
-
- <td class="gen" align="center"><strong>{mod.USERNAME_FULL}</strong></td>
- <td align="center"><!-- IF not mod.FORUMS -->{L_ALL_FORUMS}<!-- ELSE --><select style="width: 200px;">{mod.FORUMS}</select><!-- ENDIF -->&nbsp;</td>
- <td class="gensmall" align="center" nowrap="nowrap">&nbsp;
- <!-- IF mod.U_GROUP -->
- <a<!-- IF mod.GROUP_COLOR --> style="font-weight: bold; color:#{mod.GROUP_COLOR}"<!-- ENDIF --> href="{mod.U_GROUP}">{mod.GROUP_NAME}</a>
- <!-- ELSE -->
- {mod.GROUP_NAME}
- <!-- ENDIF -->
- &nbsp;</td>
- <td class="gen" align="center"><!-- IF mod.RANK_IMG -->{mod.RANK_IMG}<!-- ELSE -->{mod.RANK_TITLE}<!-- ENDIF --></td>
- <td class="gen" align="center">&nbsp;<!-- IF mod.U_PM --><a href="{mod.U_PM}">{PM_IMG}</a><!-- ENDIF -->&nbsp;</td>
-</tr>
-<!-- BEGINELSE -->
- <tr>
- <td class="row1" colspan="5" align="center"><span class="gen">{L_NO_MODERATORS}</span></td>
- </tr>
-<!-- END mod -->
-</table>
-
-</form>
-
-<br clear="all" />
-
-<!-- INCLUDE breadcrumbs.html -->
-
-<br clear="all" />
-
-<div style="float: {S_CONTENT_FLOW_END};"><!-- INCLUDE jumpbox.html --></div>
-
-<!-- INCLUDE overall_footer.html --> \ No newline at end of file
diff --git a/phpBB/styles/subsilver2/template/memberlist_search.html b/phpBB/styles/subsilver2/template/memberlist_search.html
index 96ffad00d6..5a4c430cd2 100644
--- a/phpBB/styles/subsilver2/template/memberlist_search.html
+++ b/phpBB/styles/subsilver2/template/memberlist_search.html
@@ -35,7 +35,7 @@
{
opener.document.forms['{S_FORM_NAME}'].{S_FIELD_NAME}.value = user;
self.close();
- }
+ }
/**
* Mark/unmark checklist
@@ -43,11 +43,7 @@
*/
function marklist(id, name, state)
{
- var parent = document.getElementById(id);
- if (!parent)
- {
- eval('parent = document.' + id);
- }
+ var parent = document.getElementById(id) || document[id];
if (!parent)
{
@@ -55,10 +51,10 @@
}
var rb = parent.getElementsByTagName('input');
-
+
for (var r = 0; r < rb.length; r++)
{
- if (rb[r].name.substr(0, name.length) == name)
+ if (rb[r].name.substr(0, name.length) == name && rb[r].disabled !== true)
{
rb[r].checked = state;
}
@@ -70,6 +66,7 @@
<form method="post" action="{S_MODE_ACTION}" name="search">
+<!-- EVENT memberlist_search_fields_before -->
<table class="tablebg" width="100%" cellspacing="1">
<tr>
<th colspan="4">{L_FIND_USERNAME}</th>
@@ -78,65 +75,54 @@
<td class="row3" colspan="4"><span class="gensmall">{L_FIND_USERNAME_EXPLAIN}</span></td>
</tr>
<tr>
- <td class="row1"><b class="genmed">{L_USERNAME}:</b></td>
+ <td class="row1"><b class="genmed">{L_USERNAME}{L_COLON}</b></td>
<td class="row2"><input class="post" type="text" name="username" value="{USERNAME}" /></td>
- <td class="row1"><b class="genmed">{L_ICQ}:</b></td>
- <td class="row2"><input class="post" type="text" name="icq" value="{ICQ}" /></td>
+ <!-- IF S_EMAIL_SEARCH_ALLOWED -->
+ <td class="row1"><b class="genmed">{L_EMAIL}{L_COLON}</b></td>
+ <td class="row2"><input class="post" type="email" name="email" value="{EMAIL}" /></td>
+ <!-- ELSE -->
+ <td colspan="2" class="row1">&nbsp;</td>
+ <!-- ENDIF -->
</tr>
<tr>
-<!-- IF S_EMAIL_SEARCH_ALLOWED -->
- <td class="row1"><b class="genmed">{L_EMAIL}:</b></td>
- <td class="row2"><input class="post" type="text" name="email" value="{EMAIL}" /></td>
-<!-- ELSE -->
- <td colspan="2" class="row1">&nbsp;</td>
-<!-- ENDIF -->
- <td class="row1"><b class="genmed">{L_AIM}:</b></td>
- <td class="row2"><input class="post" type="text" name="aim" value="{AIM}" /></td>
-</tr>
-<tr>
- <td class="row1"><b class="genmed">{L_JOINED}:</b></td>
+ <td class="row1"><b class="genmed">{L_JOINED}{L_COLON}</b></td>
<td class="row2"><select name="joined_select">{S_JOINED_TIME_OPTIONS}</select> <input class="post" type="text" name="joined" value="{JOINED}" /></td>
- <td class="row1"><b class="genmed">{L_YIM}:</b></td>
- <td class="row2"><input class="post" type="text" name="yahoo" value="{YAHOO}" /></td>
+ <td class="row1"><b class="genmed">{L_POSTS}{L_COLON}</b></td>
+ <td class="row2"><select name="count_select">{S_COUNT_OPTIONS}</select> <input class="post" type="number" min="0" name="count" value="{COUNT}" /></td>
</tr>
-<tr>
<!-- IF S_VIEWONLINE -->
- <td class="row1"><b class="genmed">{L_LAST_ACTIVE}:</b></td>
+<tr>
+ <td class="row1"><b class="genmed">{L_LAST_ACTIVE}{L_COLON}</b></td>
<td class="row2"><select name="active_select">{S_ACTIVE_TIME_OPTIONS}</select> <input class="post" type="text" name="active" value="{ACTIVE}" /></td>
-<!-- ELSE -->
- <td colspan="2" class="row1">&nbsp;</td>
-<!-- ENDIF -->
- <td class="row1"><b class="genmed">{L_MSNM}:</b></td>
- <td class="row2"><input class="post" type="text" name="msn" value="{MSNM}" /></td>
+ <!-- IF S_IP_SEARCH_ALLOWED -->
+ <td class="row1"><b class="genmed">{L_POST_IP}{L_COLON}</b></td>
+ <td class="row2"><input class="post" type="text" name="ip" value="{IP}" /></td>
+ <!-- ELSE -->
+ <td colspan="2" class="row1">&nbsp;</td>
+ <!-- ENDIF -->
</tr>
+<!-- ENDIF -->
<tr>
- <td class="row1"><b class="genmed">{L_POSTS}:</b></td>
- <td class="row2"><select name="count_select">{S_COUNT_OPTIONS}</select> <input class="post" type="text" name="count" value="{COUNT}" /></td>
- <td class="row1"><b class="genmed">{L_JABBER}:</b></td>
- <td class="row2"><input class="post" type="text" name="jabber" value="{JABBER}" /></td>
+ <td class="row1"><b class="genmed">{L_GROUP}{L_COLON}</b></td>
+ <td class="row2" nowrap="nowrap"><select name="search_group_id">{S_GROUP_SELECT}</select></td>
+ <!-- IF S_JABBER_ENABLED -->
+ <td class="row1"><b class="genmed">{L_JABBER}{L_COLON}</b></td>
+ <td class="row2"><input class="post" type="text" name="jabber" value="{JABBER}" /></td>
+ <!-- ELSE -->
+ <td colspan="2" class="row1">&nbsp;</td>
+ <!-- ENDIF -->
</tr>
+<!-- EVENT memberlist_search_sorting_options_before -->
<tr>
- <td class="row1"><b class="genmed">{L_SORT_BY}:</b></td>
+ <td class="row1"><b class="genmed">{L_SORT_BY}{L_COLON}</b></td>
<td class="row2" nowrap="nowrap"><select name="sk">{S_SORT_OPTIONS}</select> <select name="sd">{S_ORDER_SELECT}</select>&nbsp;</td>
-<!-- IF S_IP_SEARCH_ALLOWED -->
- <td class="row1"><b class="genmed">{L_POST_IP}:</b></td>
- <td class="row2"><input class="post" type="text" name="ip" value="{IP}" /></td>
-</tr>
-<tr>
- <td class="row1"><b class="genmed">{L_GROUP}:</b></td>
- <td class="row2" nowrap="nowrap"><select name="search_group_id">{S_GROUP_SELECT}</select></td>
- <td class="row1">&nbsp;</td>
- <td class="row2">&nbsp;</td>
-</tr>
-<!-- ELSE -->
- <td class="row1"><b class="genmed">{L_GROUP}:</b></td>
- <td class="row2" nowrap="nowrap"><select name="search_group_id">{S_GROUP_SELECT}</select></td>
+ <td colspan="2" class="row1">&nbsp;</td>
</tr>
-<!-- ENDIF -->
<tr>
<td class="cat" colspan="4" align="center"><input class="btnmain" type="submit" name="submit" value="{L_SEARCH}" />&nbsp;&nbsp;<input class="btnlite" type="reset" value="{L_RESET}" /></td>
</tr>
</table>
+<!-- EVENT memberlist_search_fields_after -->
{S_FORM_TOKEN}
</form>
diff --git a/phpBB/styles/subsilver2/template/memberlist_team.html b/phpBB/styles/subsilver2/template/memberlist_team.html
new file mode 100644
index 0000000000..75fade184c
--- /dev/null
+++ b/phpBB/styles/subsilver2/template/memberlist_team.html
@@ -0,0 +1,50 @@
+<!-- INCLUDE overall_header.html -->
+
+<form method="post" action="{S_MODE_ACTION}">
+
+<table class="tablebg" width="100%" cellspacing="1">
+<tr>
+ <th nowrap="nowrap" width="20%">{L_USERNAME}</th>
+ <!-- IF S_DISPLAY_MODERATOR_FORUMS --><th nowrap="nowrap" width="25%">{L_FORUMS}</th><!-- ENDIF -->
+ <th nowrap="nowrap" width="20%">{L_PRIMARY_GROUP}</th>
+ <th nowrap="nowrap" width="15%">{L_RANK}</th>
+ <th nowrap="nowrap" width="11%">{L_SEND_MESSAGE}</th>
+</tr>
+<!-- BEGIN group -->
+<tr class="row3">
+ <td colspan="5"><b class="gensmall"><!-- IF group.U_GROUP --><a href="{group.U_GROUP}">{group.GROUP_NAME}</a><!-- ELSE -->{group.GROUP_NAME}<!-- ENDIF --></b></td>
+</tr>
+<!-- BEGIN user -->
+ <!-- IF group.user.S_ROW_COUNT is even --><tr class="row2"><!-- ELSE --><tr class="row1"><!-- ENDIF -->
+
+ <td class="gen" align="center"><!-- EVENT memberlist_team_username_prepend --><strong>{group.user.USERNAME_FULL}</strong><!-- IF group.user.S_INACTIVE --> <em>({L_INACTIVE})</em><!-- ENDIF --><!-- EVENT memberlist_team_username_append --></td>
+ <!-- IF S_DISPLAY_MODERATOR_FORUMS --><td class="gensmall" align="center"><!-- IF group.user.FORUM_OPTIONS --><select style="width: 100%;">{group.user.FORUMS}</select><!-- ELSEIF group.user.FORUMS -->{group.user.FORUMS}<!-- ELSE -->-<!-- ENDIF --></td><!-- ENDIF -->
+ <td class="gensmall" align="center" nowrap="nowrap">&nbsp;
+ <!-- IF group.user.U_GROUP -->
+ <a<!-- IF group.user.GROUP_COLOR --> style="font-weight: bold; color:#{group.user.GROUP_COLOR}"<!-- ENDIF --> href="{group.user.U_GROUP}">{group.user.GROUP_NAME}</a>
+ <!-- ELSE -->
+ {group.user.GROUP_NAME}
+ <!-- ENDIF -->
+ &nbsp;</td>
+ <td class="gen" align="center"><!-- IF group.user.RANK_IMG -->{group.user.RANK_IMG}<!-- ELSE -->{group.user.RANK_TITLE}<!-- ENDIF --></td>
+ <td class="gen" align="center">&nbsp;<!-- IF group.user.U_PM --><a href="{group.user.U_PM}" class="imageset">{PM_IMG}</a><!-- ENDIF -->&nbsp;</td>
+</tr>
+<!-- BEGINELSE -->
+ <tr>
+ <td class="row1" colspan="5" align="center"><span class="gen">{L_NO_MEMBERS}</span></td>
+ </tr>
+<!-- END user -->
+<!-- END group -->
+</table>
+
+</form>
+
+<br clear="all" />
+
+<!-- INCLUDE breadcrumbs.html -->
+
+<br clear="all" />
+
+<div style="float: {S_CONTENT_FLOW_END};"><!-- INCLUDE jumpbox.html --></div>
+
+<!-- INCLUDE overall_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/memberlist_view.html b/phpBB/styles/subsilver2/template/memberlist_view.html
index 7898e9b235..731d2c8bca 100644
--- a/phpBB/styles/subsilver2/template/memberlist_view.html
+++ b/phpBB/styles/subsilver2/template/memberlist_view.html
@@ -2,6 +2,8 @@
<div id="pagecontent">
+ <!-- EVENT memberlist_view_content_prepend -->
+
<form method="post" action="{S_PROFILE_ACTION}">
<table class="tablebg" width="100%" cellspacing="1">
@@ -18,12 +20,13 @@
<table cellspacing="1" cellpadding="2" border="0">
<!-- IF S_USER_INACTIVE -->
<tr>
- <td align="center"><b class="gen inactive">{L_USER_IS_INACTIVE}</b><br />{L_INACTIVE_REASON}: {USER_INACTIVE_REASON}<br /><br /></td>
+ <td align="center"><b class="gen inactive">{L_USER_IS_INACTIVE}</b><br />{L_INACTIVE_REASON}{L_COLON} {USER_INACTIVE_REASON}<br /><br /></td>
</tr>
<!-- ENDIF -->
<tr>
<td align="center"><!-- IF USER_COLOR --><b class="gen" style="color: {USER_COLOR}"><!-- ELSE --><b class="gen"><!-- ENDIF -->{USERNAME}</b><!-- IF U_USER_BAN --><span class="genmed"> [ <a href="{U_USER_BAN}">{L_USER_BAN}</a> ]</span><!-- ENDIF --><!-- IF U_USER_ADMIN --><span class="genmed"> [ <a href="{U_USER_ADMIN}">{L_USER_ADMIN}</a> ]</span><!-- ENDIF --></td>
</tr>
+ <!-- EVENT memberlist_view_rank_before -->
<!-- IF RANK_TITLE -->
<tr>
<td class="postdetails" align="center">{RANK_TITLE}</td>
@@ -34,6 +37,7 @@
<td align="center">{RANK_IMG}</td>
</tr>
<!-- ENDIF -->
+ <!-- EVENT memberlist_view_rank_after -->
<!-- IF AVATAR_IMG -->
<tr>
<td align="center">{AVATAR_IMG}</td>
@@ -49,6 +53,7 @@
<td class="genmed" align="center">[ <a href="{U_SWITCH_PERMISSIONS}">{L_USE_PERMISSIONS}</a> ]</td>
</tr>
<!-- ENDIF -->
+ <!-- EVENT memberlist_view_zebra_before -->
<!-- IF S_USER_LOGGED_IN and S_ZEBRA -->
<tr>
<td class="genmed" align="center">[
@@ -62,126 +67,119 @@
]</td>
</tr>
<!-- ENDIF -->
+ <!-- EVENT memberlist_view_zebra_after -->
</table>
</td>
<td class="row1">
<table width="100%" cellspacing="1" cellpadding="2" border="0">
+ <!-- EVENT memberlist_view_user_statistics_before -->
<tr>
- <td class="gen" align="{S_CONTENT_FLOW_END}" nowrap="nowrap">{L_JOINED}: </td>
+ <td class="gen" align="{S_CONTENT_FLOW_END}" nowrap="nowrap">{L_JOINED}{L_COLON} </td>
<td width="100%"><b class="gen">{JOINED}</b></td>
</tr>
<tr>
- <td class="gen" align="{S_CONTENT_FLOW_END}" nowrap="nowrap">{L_VISITED}: </td>
- <td width="100%"><b class="gen">{VISITED}</b></td>
+ <td class="gen" align="{S_CONTENT_FLOW_END}" nowrap="nowrap">{L_LAST_ACTIVE}{L_COLON} </td>
+ <td width="100%"><b class="gen">{LAST_ACTIVE}</b></td>
</tr>
<!-- IF S_WARNINGS -->
<tr>
- <td class="gen" align="{S_CONTENT_FLOW_END}" valign="top" nowrap="nowrap">{L_WARNINGS}: </td>
+ <td class="gen" align="{S_CONTENT_FLOW_END}" valign="top" nowrap="nowrap">{L_WARNINGS}{L_COLON} </td>
<td width="100%"><b class="gen">{WARNINGS}</b><!-- IF U_NOTES or U_WARN --><br /><span class="genmed"> [ <!-- IF U_NOTES --><a href="{U_NOTES}">{L_VIEW_NOTES}</a><!-- ENDIF --> <!-- IF U_WARN --><!-- IF U_NOTES --> | <!-- ENDIF --><a href="{U_WARN}">{L_WARN_USER}</a><!-- ENDIF --> ]</span><!-- ENDIF --></td>
</tr>
<!-- ENDIF -->
<tr>
- <td class="gen" align="{S_CONTENT_FLOW_END}" valign="top" nowrap="nowrap">{L_TOTAL_POSTS}: </td>
+ <td class="gen" align="{S_CONTENT_FLOW_END}" valign="top" nowrap="nowrap">{L_TOTAL_POSTS}{L_COLON} </td>
<td><b class="gen">{POSTS}</b><span class="genmed"><!-- IF POSTS_PCT --><br />[{POSTS_PCT} / {POSTS_DAY}]<!-- ENDIF -->
<!-- IF POSTS_IN_QUEUE and U_MCP_QUEUE --><br />[<a href="{U_MCP_QUEUE}">{L_POSTS_IN_QUEUE}</a>]<!-- ELSEIF POSTS_IN_QUEUE --><br />[{L_POSTS_IN_QUEUE}]<!-- ENDIF -->
<!-- IF S_DISPLAY_SEARCH --><br /><a href="{U_SEARCH_USER}">{L_SEARCH_USER_POSTS}</a><!-- ENDIF --></span></td>
</tr>
<!-- IF S_SHOW_ACTIVITY -->
<tr>
- <td class="gen" align="{S_CONTENT_FLOW_END}" valign="top" nowrap="nowrap">{L_ACTIVE_IN_FORUM}: </td>
+ <td class="gen" align="{S_CONTENT_FLOW_END}" valign="top" nowrap="nowrap">{L_ACTIVE_IN_FORUM}{L_COLON} </td>
<td><!-- IF ACTIVE_FORUM != '' --><b><a class="gen" href="{U_ACTIVE_FORUM}">{ACTIVE_FORUM}</a></b><br /><span class="genmed">[ {ACTIVE_FORUM_POSTS} / {ACTIVE_FORUM_PCT} ]</span><!-- ELSE --><span class="gen">-</span><!-- ENDIF --></td>
</tr>
<tr>
- <td class="gen" align="{S_CONTENT_FLOW_END}" valign="top" nowrap="nowrap">{L_ACTIVE_IN_TOPIC}: </td>
+ <td class="gen" align="{S_CONTENT_FLOW_END}" valign="top" nowrap="nowrap">{L_ACTIVE_IN_TOPIC}{L_COLON} </td>
<td><!-- IF ACTIVE_TOPIC != '' --><b><a class="gen" href="{U_ACTIVE_TOPIC}">{ACTIVE_TOPIC}</a></b><br /><span class="genmed">[ {ACTIVE_TOPIC_POSTS} / {ACTIVE_TOPIC_PCT} ]</span><!-- ELSE --><span class="gen">-</span><!-- ENDIF --></td>
</tr>
<!-- ENDIF -->
+ <!-- EVENT memberlist_view_user_statistics_after -->
</table>
</td>
</tr>
<tr>
- <td class="cat" align="center"><h4>{L_CONTACT_USER}</h4></td>
+ <td class="cat" align="center"><h4>{L_CONTACT}</h4></td>
<td class="cat" align="center"><h4>{L_ABOUT_USER}</h4></td>
</tr>
+ <!-- EVENT memberlist_view_contact_before -->
<tr>
<td class="row1">
<table width="100%" cellspacing="1" cellpadding="2" border="0">
<tr>
- <td class="gen" align="{S_CONTENT_FLOW_END}" nowrap="nowrap">{L_EMAIL_ADDRESS}: </td>
- <td width="100%"><!-- IF U_EMAIL --><a href="{U_EMAIL}">{EMAIL_IMG}</a><!-- ENDIF --></td>
+ <td class="gen" align="{S_CONTENT_FLOW_END}" nowrap="nowrap">{L_EMAIL_ADDRESS}{L_COLON} </td>
+ <td width="100%"><!-- IF U_EMAIL --><a href="{U_EMAIL}" class="imageset">{EMAIL_IMG}</a><!-- ENDIF --></td>
</tr>
<!-- IF U_PM -->
<tr>
- <td class="gen" nowrap="nowrap" align="{S_CONTENT_FLOW_END}">{L_PM}: </td>
- <td><a href="{U_PM}">{PM_IMG}</a></td>
+ <td class="gen" nowrap="nowrap" align="{S_CONTENT_FLOW_END}">{L_PM}{L_COLON} </td>
+ <td><a href="{U_PM}" class="imageset">{PM_IMG}</a></td>
</tr>
<!-- ENDIF -->
+ <!-- IF S_JABBER_ENABLED -->
<tr>
- <td class="gen" nowrap="nowrap" align="{S_CONTENT_FLOW_END}">{L_MSNM}: </td>
- <td><!-- IF U_MSN --><a href="{U_MSN}" onclick="popup(this.href, 550, 320); return false">{MSN_IMG}</a><!-- ELSEIF USER_MSN -->{USER_MSN}<!-- ENDIF --></td>
- </tr>
- <tr>
- <td class="gen" nowrap="nowrap" align="{S_CONTENT_FLOW_END}">{L_YIM}: </td>
- <td><!-- IF U_YIM --><a href="{U_YIM}" onclick="popup(this.href, 780, 550); return false">{YIM_IMG}</a><!-- ELSEIF USER_YIM -->{USER_YIM}<!-- ENDIF --></td>
- </tr>
- <tr>
- <td class="gen" nowrap="nowrap" align="{S_CONTENT_FLOW_END}">{L_AIM}: </td>
- <td><!-- IF U_AIM --><a href="{U_AIM}" onclick="popup(this.href, 550, 320); return false">{AIM_IMG}</a><!-- ELSEIF USER_AIM -->{USER_AIM}<!-- ENDIF --></td>
- </tr>
- <tr>
- <td class="gen" nowrap="nowrap" align="{S_CONTENT_FLOW_END}">{L_ICQ}: </td>
- <td><!-- IF U_ICQ --><a href="{U_ICQ}" onclick="popup(this.href, 550, 320); return false">{ICQ_IMG}</a><!-- ELSEIF USER_ICQ -->{USER_ICQ}<!-- ENDIF --></td>
- </tr>
- <tr>
- <td class="gen" nowrap="nowrap" align="{S_CONTENT_FLOW_END}">{L_JABBER}: </td>
- <td><!-- IF U_JABBER --><a href="{U_JABBER}" onclick="popup(this.href, 550, 320); return false">{JABBER_IMG}</a><!-- ELSEIF USER_JABBER -->{USER_JABBER_IMG}<!-- ENDIF --></td>
+ <td class="gen" nowrap="nowrap" align="{S_CONTENT_FLOW_END}">{L_JABBER}{L_COLON} </td>
+ <td><!-- IF U_JABBER --><a href="{U_JABBER}" onclick="popup(this.href, 550, 320); return false" class="imageset">{JABBER_IMG}</a><!-- ELSEIF USER_JABBER -->{USER_JABBER_IMG}<!-- ENDIF --></td>
</tr>
+ <!-- ENDIF -->
+ <!-- EVENT memberlist_view_contact_custom_fields_before -->
+ <!-- BEGIN custom_fields -->
+ <!-- IF custom_fields.S_PROFILE_CONTACT -->
+ <tr>
+ <td class="gen" align="{S_CONTENT_FLOW_END}" nowrap="nowrap">{custom_fields.PROFILE_FIELD_NAME}{L_COLON} </td>
+ <!-- IF custom_fields.PROFILE_FIELD_CONTACT -->
+ <td><a href="{custom_fields.PROFILE_FIELD_CONTACT}"><span class="imageset {custom_fields.PROFILE_FIELD_IDENT}-icon">{custom_fields.PROFILE_FIELD_DESC}</span></a></td>
+ <!-- ELSE -->
+ <td><b class="genmed">{custom_fields.PROFILE_FIELD_VALUE}</b></td>
+ <!-- ENDIF -->
+ </tr>
+ <!-- ENDIF -->
+ <!-- END custom_fields -->
+ <!-- EVENT memberlist_view_contact_custom_fields_after -->
</table>
</td>
<td class="row1">
<table cellspacing="1" cellpadding="2" border="0">
<tr>
- <td class="gen" align="{S_CONTENT_FLOW_END}" nowrap="nowrap">{L_USERGROUPS}: </td>
+ <td class="gen" align="{S_CONTENT_FLOW_END}" nowrap="nowrap">{L_USERGROUPS}{L_COLON} </td>
<td><select name="g">{S_GROUP_OPTIONS}</select> <input class="btnlite" type="submit" name="submit" value="{L_GO}" /></td>
</tr>
- <tr>
- <td class="gen" align="{S_CONTENT_FLOW_END}" nowrap="nowrap">{L_LOCATION}: </td>
- <td><!-- IF LOCATION --><b class="genmed">{LOCATION}</b><!-- ENDIF --></td>
- </tr>
<!-- IF AGE !== '' -->
<tr>
- <td class="gen" align="{S_CONTENT_FLOW_END}" nowrap="nowrap">{L_AGE}: </td>
+ <td class="gen" align="{S_CONTENT_FLOW_END}" nowrap="nowrap">{L_AGE}{L_COLON} </td>
<td><b class="genmed">{AGE}</b></td>
</tr>
<!-- ENDIF -->
- <tr>
- <td class="gen" align="{S_CONTENT_FLOW_END}" nowrap="nowrap">{L_OCCUPATION}: </td>
- <td><!-- IF OCCUPATION --><b class="genmed">{OCCUPATION}</b><!-- ENDIF --></td>
- </tr>
- <tr>
- <td class="gen" align="{S_CONTENT_FLOW_END}" nowrap="nowrap">{L_INTERESTS}: </td>
- <td><!-- IF INTERESTS --><b class="genmed">{INTERESTS}</b><!-- ENDIF --></td>
- </tr>
- <tr>
- <td class="gen" align="{S_CONTENT_FLOW_END}" nowrap="nowrap">{L_WEBSITE}: </td>
- <td><!-- IF U_WWW --><b><a class="genmed" href="{U_WWW}">{U_WWW}</a></b><!-- ENDIF --></td>
- </tr>
<!-- IF S_PROFILE_FIELD1 -->
<!-- Use a construct like this to include admin defined profile fields. Replace FIELD1 with the name of your field. -->
<tr>
- <td class="gen" align="{S_CONTENT_FLOW_END}" nowrap="nowrap">{PROFILE_FIELD1_NAME}: </td>
+ <td class="gen" align="{S_CONTENT_FLOW_END}" nowrap="nowrap">{PROFILE_FIELD1_NAME}{L_COLON} </td>
<td><b class="genmed">{PROFILE_FIELD1_VALUE}</b></td>
</tr>
<!-- ENDIF -->
+ <!-- EVENT memberlist_view_non_contact_custom_fields_before -->
<!-- BEGIN custom_fields -->
+ <!-- IF not custom_fields.S_PROFILE_CONTACT -->
<tr>
- <td class="gen" align="{S_CONTENT_FLOW_END}" nowrap="nowrap">{custom_fields.PROFILE_FIELD_NAME}: </td>
+ <td class="gen" align="{S_CONTENT_FLOW_END}" nowrap="nowrap">{custom_fields.PROFILE_FIELD_NAME}{L_COLON} </td>
<td><b class="genmed">{custom_fields.PROFILE_FIELD_VALUE}</b></td>
</tr>
+ <!-- ENDIF -->
<!-- END custom_fields -->
+ <!-- EVENT memberlist_view_non_contact_custom_fields_after -->
</table>
</td>
</tr>
+ <!-- EVENT memberlist_view_contact_after -->
<!-- IF SIGNATURE -->
<tr>
<td class="cat" colspan="2" align="center"><h4>{L_SIGNATURE}</h4></td>
@@ -194,6 +192,8 @@
</form>
+ <!-- EVENT memberlist_view_content_append -->
+
</div>
<br clear="all" />
@@ -204,4 +204,4 @@
<div style="float: {S_CONTENT_FLOW_END};"><!-- INCLUDE jumpbox.html --></div>
-<!-- INCLUDE overall_footer.html --> \ No newline at end of file
+<!-- INCLUDE overall_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/message_body.html b/phpBB/styles/subsilver2/template/message_body.html
index f61a3e6365..b9b502a57f 100644
--- a/phpBB/styles/subsilver2/template/message_body.html
+++ b/phpBB/styles/subsilver2/template/message_body.html
@@ -13,4 +13,4 @@
<!-- INCLUDE breadcrumbs.html -->
-<!-- INCLUDE overall_footer.html --> \ No newline at end of file
+<!-- INCLUDE overall_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/overall_footer.html b/phpBB/styles/subsilver2/template/overall_footer.html
index 6cd7a215b0..176110c58d 100644
--- a/phpBB/styles/subsilver2/template/overall_footer.html
+++ b/phpBB/styles/subsilver2/template/overall_footer.html
@@ -1,12 +1,29 @@
+ <!-- EVENT overall_footer_content_after -->
+
<!-- IF not S_IS_BOT -->{RUN_CRON_TASK}<!-- ENDIF -->
</div>
+<!-- EVENT overall_footer_page_body_after -->
+
<div id="wrapfooter">
<!-- IF U_ACP --><span class="gensmall">[ <a href="{U_ACP}">{L_ACP}</a> ]</span><br /><br /><!-- ENDIF -->
- <span class="copyright">{CREDIT_LINE}
+ <span class="copyright">
+ <!-- EVENT overall_footer_copyright_prepend -->
+ {CREDIT_LINE}
<!-- IF TRANSLATION_INFO --><br />{TRANSLATION_INFO}<!-- ENDIF -->
+ <!-- EVENT overall_footer_copyright_append -->
<!-- IF DEBUG_OUTPUT --><br /><bdo dir="ltr">[ {DEBUG_OUTPUT} ]</bdo><!-- ENDIF --></span>
</div>
+<script type="text/javascript" src="{T_JQUERY_LINK}"></script>
+<!-- IF S_ALLOW_CDN --><script type="text/javascript">window.jQuery || document.write(unescape('%3Cscript src="{T_ASSETS_PATH}/javascript/jquery.min.js?assets_version={T_ASSETS_VERSION}" type="text/javascript"%3E%3C/script%3E'));</script><!-- ENDIF -->
+<script type="text/javascript" src="{T_ASSETS_PATH}/javascript/core.js?assets_version={T_ASSETS_VERSION}"></script>
+
+<!-- EVENT overall_footer_after -->
+
+{$SCRIPTS}
+
+<!-- EVENT overall_footer_body_after -->
+
</body>
-</html> \ No newline at end of file
+</html>
diff --git a/phpBB/styles/subsilver2/template/overall_header.html b/phpBB/styles/subsilver2/template/overall_header.html
index 7eb736aa32..ae3d48215e 100644
--- a/phpBB/styles/subsilver2/template/overall_header.html
+++ b/phpBB/styles/subsilver2/template/overall_header.html
@@ -1,17 +1,10 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" dir="{S_CONTENT_DIRECTION}" lang="{S_USER_LANG}" xml:lang="{S_USER_LANG}">
+<!DOCTYPE html>
+<html dir="{S_CONTENT_DIRECTION}" lang="{S_USER_LANG}">
<head>
-
-<meta http-equiv="content-type" content="text/html; charset={S_CONTENT_ENCODING}" />
-<meta http-equiv="content-language" content="{S_USER_LANG}" />
-<meta http-equiv="content-style-type" content="text/css" />
-<meta http-equiv="imagetoolbar" content="no" />
-<meta name="resource-type" content="document" />
-<meta name="distribution" content="global" />
-<meta name="keywords" content="" />
-<meta name="description" content="" />
+<meta charset="utf-8" />
+<meta http-equiv="X-UA-Compatible" content="IE=edge">
{META}
-<title>{SITENAME} &bull; <!-- IF S_IN_MCP -->{L_MCP} &bull; <!-- ELSEIF S_IN_UCP -->{L_UCP} &bull; <!-- ENDIF -->{PAGE_TITLE}</title>
+<title><!-- IF UNREAD_NOTIFICATIONS_COUNT -->({UNREAD_NOTIFICATIONS_COUNT}) <!-- ENDIF --><!-- IF not S_VIEWTOPIC and not S_VIEWFORUM -->{SITENAME} - <!-- ENDIF --><!-- IF S_IN_MCP -->{L_MCP} - <!-- ELSEIF S_IN_UCP -->{L_UCP} - <!-- ENDIF -->{PAGE_TITLE}<!-- IF S_VIEWTOPIC or S_VIEWFORUM --> - {SITENAME}<!-- ENDIF --></title>
<!-- IF S_ENABLE_FEEDS -->
<!-- IF S_ENABLE_FEEDS_OVERALL --><link rel="alternate" type="application/atom+xml" title="{L_FEED} - {SITENAME}" href="{U_FEED}" /><!-- ENDIF -->
@@ -21,15 +14,18 @@
<!-- IF S_ENABLE_FEEDS_TOPICS_ACTIVE --><link rel="alternate" type="application/atom+xml" title="{L_FEED} - {L_FEED_TOPICS_ACTIVE}" href="{U_FEED}?mode=topics_active" /><!-- ENDIF -->
<!-- IF S_ENABLE_FEEDS_FORUM and S_FORUM_ID --><link rel="alternate" type="application/atom+xml" title="{L_FEED} - {L_FORUM} - {FORUM_NAME}" href="{U_FEED}?f={S_FORUM_ID}" /><!-- ENDIF -->
<!-- IF S_ENABLE_FEEDS_TOPIC and S_TOPIC_ID --><link rel="alternate" type="application/atom+xml" title="{L_FEED} - {L_TOPIC} - {TOPIC_TITLE}" href="{U_FEED}?f={S_FORUM_ID}&amp;t={S_TOPIC_ID}" /><!-- ENDIF -->
+ <!-- EVENT overall_header_feeds -->
+<!-- ENDIF -->
+
+<!-- IF U_CANONICAL -->
+ <link rel="canonical" href="{U_CANONICAL}" />
<!-- ENDIF -->
<link rel="stylesheet" href="{T_STYLESHEET_LINK}" type="text/css" />
+<link rel="stylesheet" href="{T_STYLESHEET_LANG_LINK}" type="text/css" />
<script type="text/javascript">
// <![CDATA[
-<!-- IF S_USER_PM_POPUP and S_NEW_PM -->
- popup('{UA_POPUP_PM}', 400, 225, '_phpbbprivmsg');
-<!-- ENDIF -->
function popup(url, width, height, name)
{
@@ -44,9 +40,9 @@ function popup(url, width, height, name)
function jumpto()
{
- var page = prompt('{LA_JUMP_PAGE}:', '{ON_PAGE}');
+ var page = prompt('{LA_JUMP_PAGE}{L_COLON}', '{CURRENT_PAGE}');
var per_page = '{PER_PAGE}';
- var base_url = '{A_BASE_URL}';
+ var base_url = '{BASE_URL|e('js')}';
if (page !== null && !isNaN(page) && page == Math.floor(page) && page > 0)
{
@@ -76,11 +72,7 @@ function find_username(url)
*/
function marklist(id, name, state)
{
- var parent = document.getElementById(id);
- if (!parent)
- {
- eval('parent = document.' + id);
- }
+ var parent = document.getElementById(id) || document[id];
if (!parent)
{
@@ -88,10 +80,10 @@ function marklist(id, name, state)
}
var rb = parent.getElementsByTagName('input');
-
+
for (var r = 0; r < rb.length; r++)
{
- if (rb[r].name.substr(0, name.length) == name)
+ if (rb[r].name.substr(0, name.length) == name && rb[r].disabled !== true)
{
rb[r].checked = state;
}
@@ -138,43 +130,97 @@ function marklist(id, name, state)
// ]]>
</script>
+
+<!-- EVENT overall_header_head_append -->
+
+{$STYLESHEETS}
+
+<!-- EVENT overall_header_stylesheets_after -->
+
</head>
-<body class="{S_CONTENT_DIRECTION}">
+<body class="{S_CONTENT_DIRECTION} {BODY_CLASS}">
-<a name="top"></a>
+<!-- EVENT overall_header_body_before -->
+
+<a name="top" class="anchor"></a>
<div id="wrapheader">
<div id="logodesc">
<table width="100%" cellspacing="0">
<tr>
- <td><a href="{U_INDEX}">{SITE_LOGO_IMG}</a></td>
+ <td><a href="<!-- IF U_SITE_HOME -->{U_SITE_HOME}<!-- ELSE -->{U_INDEX}<!-- ENDIF -->" class="imageset">{SITE_LOGO_IMG}</a></td>
<td width="100%" align="center"><h1>{SITENAME}</h1><span class="gen">{SITE_DESCRIPTION}</span></td>
</tr>
</table>
</div>
-
+ <!-- EVENT overall_header_navbar_before -->
<div id="menubar">
<table width="100%" cellspacing="0">
<tr>
- <td class="genmed">
- <!-- IF not S_IS_BOT --><a href="{U_LOGIN_LOGOUT}"><img src="{T_THEME_PATH}/images/icon_mini_login.gif" width="12" height="13" alt="*" /> {L_LOGIN_LOGOUT}</a>&nbsp;<!-- ENDIF -->
- <!-- IF U_RESTORE_PERMISSIONS --> &nbsp;<a href="{U_RESTORE_PERMISSIONS}"><img src="{T_THEME_PATH}/images/icon_mini_login.gif" width="12" height="13" alt="*" /> {L_RESTORE_PERMISSIONS}</a><!-- ENDIF -->
- <!-- IF S_BOARD_DISABLED and S_USER_LOGGED_IN --> &nbsp;<span class="error">{L_BOARD_DISABLED}</span><!-- ENDIF -->
+ <td class="genmed dropdown-container">
+ <!-- IF S_NOTIFICATIONS_DISPLAY and not S_IS_BOT and S_USER_LOGGED_IN -->
+ <a href="{U_VIEW_ALL_NOTIFICATIONS}" id="notification_list_button" class="dropdown-trigger">
+ <img src="{T_THEME_PATH}/images/icon_mini_notification.gif" width="12" height="13" alt="*" />
+ {L_NOTIFICATIONS} [<strong>{NOTIFICATIONS_COUNT}</strong>]
+ </a>&nbsp;
+ <div id="notification_list" class="notification_list dropdown">
+ <div class="row1 header">
+ {L_NOTIFICATIONS}
+ <span class="header_settings"><a href="{U_NOTIFICATION_SETTINGS}">{L_SETTINGS}</a></span>
+ </div>
+
+ <div class="notification_scroll">
+ <table class="tablebg" cellspacing="1">
+ <!-- BEGIN notifications -->
+ <tr class="row<!-- IF notifications.UNREAD -->2<!-- ELSE -->1<!-- ENDIF -->">
+ <td width="50">
+ <!-- IF notifications.AVATAR -->{notifications.AVATAR}<!-- ELSE --><img src="{T_THEME_PATH}/images/no_avatar.gif" alt="" /><!-- ENDIF -->
+ </td>
+ <td valign="top">
+ <div class="notification_title">
+ <!-- IF notifications.URL --><a href="<!-- IF notifications.UNREAD -->{notifications.U_MARK_READ}<!-- ELSE -->{notifications.URL}<!-- ENDIF -->"><!-- ENDIF -->
+ {notifications.FORMATTED_TITLE}
+ <!-- IF notifications.URL --></a><!-- ENDIF -->
+
+ <!-- IF notifications.REFERENCE --><br /><span class="notification-reference">{notifications.REFERENCE}</span><!-- ENDIF -->
+ <!-- IF notifications.FORUM --><br /><span class="notification-forum">{notifications.FORUM}</span><!-- ENDIF -->
+ <!-- IF notifications.REASON --><br /><span class="notification-reason">{notifications.REASON}</span><!-- ENDIF -->
+ <br /><span class="notification-time">{notifications.TIME}</span>
+ <!-- IF not notifications.URL and notifications.UNREAD -->
+ <br /><a href="{notifications.U_MARK_READ}">{L_MARK_READ}</a>
+ <!-- ENDIF -->
+ </div>
+ </td>
+ </tr>
+ <!-- END notifications -->
+ </table>
+ </div>
+
+ <div class="row1 footer">
+ <a href="{U_VIEW_ALL_NOTIFICATIONS}"><span>{L_SEE_ALL}</span></a>
+ </div>
+ </div>
+ <!-- ENDIF -->
<!-- IF not S_IS_BOT -->
<!-- IF S_USER_LOGGED_IN -->
- <!-- IF S_DISPLAY_PM --> &nbsp;<a href="{U_PRIVATEMSGS}"><img src="{T_THEME_PATH}/images/icon_mini_message.gif" width="12" height="13" alt="*" /> {PRIVATE_MESSAGE_INFO}<!-- IF PRIVATE_MESSAGE_INFO_UNREAD -->, {PRIVATE_MESSAGE_INFO_UNREAD}<!-- ENDIF --></a><!-- ENDIF -->
+ <!-- IF S_DISPLAY_PM --> &nbsp;<a href="{U_PRIVATEMSGS}"><img src="{T_THEME_PATH}/images/icon_mini_message.gif" width="12" height="13" alt="*" /> {L_PRIVATE_MESSAGES} [<strong>{PRIVATE_MESSAGE_COUNT}</strong>]</a><!-- ENDIF -->
<!-- ELSEIF S_REGISTER_ENABLED and not (S_SHOW_COPPA or S_REGISTRATION) --> &nbsp;<a href="{U_REGISTER}"><img src="{T_THEME_PATH}/images/icon_mini_register.gif" width="12" height="13" alt="*" /> {L_REGISTER}</a>
<!-- ENDIF -->
<!-- ENDIF -->
+ <!-- IF not S_IS_BOT --> &nbsp;<a href="{U_LOGIN_LOGOUT}"><img src="{T_THEME_PATH}/images/icon_mini_login.gif" width="12" height="13" alt="*" /> {L_LOGIN_LOGOUT}</a>&nbsp;<!-- ENDIF -->
+ <!-- IF U_RESTORE_PERMISSIONS --> &nbsp;<a href="{U_RESTORE_PERMISSIONS}"><img src="{T_THEME_PATH}/images/icon_mini_login.gif" width="12" height="13" alt="*" /> {L_RESTORE_PERMISSIONS}</a><!-- ENDIF -->
+ <!-- IF S_BOARD_DISABLED and S_USER_LOGGED_IN --> &nbsp;<span class="error">{L_BOARD_DISABLED}</span><!-- ENDIF -->
</td>
<td class="genmed" align="{S_CONTENT_FLOW_END}">
- <a href="{U_FAQ}"><img src="{T_THEME_PATH}/images/icon_mini_faq.gif" width="12" height="13" alt="*" /> {L_FAQ}</a>
+ <!-- EVENT overall_header_navigation_prepend -->
+ <a href="{U_FAQ}" rel="help"><img src="{T_THEME_PATH}/images/icon_mini_faq.gif" width="12" height="13" alt="*" /> {L_FAQ}</a>
<!-- IF S_DISPLAY_SEARCH -->&nbsp; &nbsp;<a href="{U_SEARCH}"><img src="{T_THEME_PATH}/images/icon_mini_search.gif" width="12" height="13" alt="*" /> {L_SEARCH}</a><!-- ENDIF -->
<!-- IF not S_IS_BOT -->
<!-- IF S_DISPLAY_MEMBERLIST -->&nbsp; &nbsp;<a href="{U_MEMBERLIST}"><img src="{T_THEME_PATH}/images/icon_mini_members.gif" width="12" height="13" alt="*" /> {L_MEMBERLIST}</a><!-- ENDIF -->
<!-- IF S_USER_LOGGED_IN -->&nbsp; &nbsp;<a href="{U_PROFILE}"><img src="{T_THEME_PATH}/images/icon_mini_profile.gif" width="12" height="13" alt="*" /> {L_PROFILE}</a><!-- ENDIF -->
<!-- ENDIF -->
+ <!-- EVENT overall_header_navigation_append -->
</td>
</tr>
</table>
@@ -191,6 +237,8 @@ function marklist(id, name, state)
</div>
+<!-- EVENT overall_header_page_body_before -->
+
<div id="wrapcentre">
<!-- IF S_DISPLAY_SEARCH -->
@@ -204,6 +252,11 @@ function marklist(id, name, state)
<br style="clear: both;" />
+ <!-- DEFINE $S_MICRODATA = 1 -->
+ <!-- DEFINE $OVERALL_HEADER_BREADCRUMBS = 1 -->
<!-- INCLUDE breadcrumbs.html -->
+ <!-- UNDEFINE $OVERALL_HEADER_BREADCRUMBS -->
+ <!-- DEFINE $S_MICRODATA = 0 -->
<br />
+ <!-- EVENT overall_header_content_before -->
diff --git a/phpBB/styles/subsilver2/template/pagination.html b/phpBB/styles/subsilver2/template/pagination.html
index bf9c854d9a..b1c1d0e6c9 100644
--- a/phpBB/styles/subsilver2/template/pagination.html
+++ b/phpBB/styles/subsilver2/template/pagination.html
@@ -1 +1,11 @@
-<!-- IF PAGINATION --><b><a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{L_GOTO_PAGE}</a> <!-- IF PREVIOUS_PAGE --><a href="{PREVIOUS_PAGE}">{L_PREVIOUS}</a>&nbsp;&nbsp;<!-- ENDIF -->{PAGINATION}<!-- IF NEXT_PAGE --> &nbsp;<a href="{NEXT_PAGE}">{L_NEXT}</a><!-- ENDIF --></b><!-- ENDIF --> \ No newline at end of file
+<!-- IF .pagination -->
+ <!-- IF BASE_URL --><b><a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE_CLICK}">{L_GOTO_PAGE}</a></b><!-- ENDIF -->
+ <!-- BEGIN pagination -->
+ <!-- IF pagination.S_IS_PREV --><a href="{pagination.PAGE_URL}">{L_PREVIOUS}</a>
+ <!-- ELSEIF pagination.S_IS_CURRENT --><strong>{pagination.PAGE_NUMBER}</strong>
+ <!-- ELSEIF pagination.S_IS_ELLIPSIS --> {L_ELLIPSIS}
+ <!-- ELSEIF pagination.S_IS_NEXT --><a href="{pagination.PAGE_URL}">{L_NEXT}</a>
+ <!-- ELSE --><a href="{pagination.PAGE_URL}">{pagination.PAGE_NUMBER}</a>
+ <!-- ENDIF -->
+ <!-- END pagination -->
+<!-- ENDIF -->
diff --git a/phpBB/styles/subsilver2/template/posting_attach_body.html b/phpBB/styles/subsilver2/template/posting_attach_body.html
index 8c70e4c831..67b3aaf3ea 100644
--- a/phpBB/styles/subsilver2/template/posting_attach_body.html
+++ b/phpBB/styles/subsilver2/template/posting_attach_body.html
@@ -31,7 +31,7 @@
<tr>
<td class="row1"><b class="genmed">{L_FILENAME}</b></td>
- <td class="row2"><input type="file" name="fileupload" size="40" maxlength="{FILESIZE}" value="" class="btnfile" /></td>
+ <td class="row2"><input type="file" name="fileupload" maxlength="{FILESIZE}" value="" class="btnfile" /></td>
</tr>
<tr>
<td class="row1"><b class="genmed">{L_FILE_COMMENT}</b></td>
diff --git a/phpBB/styles/subsilver2/template/posting_body.html b/phpBB/styles/subsilver2/template/posting_body.html
index 8e9934c173..95f817e838 100644
--- a/phpBB/styles/subsilver2/template/posting_body.html
+++ b/phpBB/styles/subsilver2/template/posting_body.html
@@ -5,7 +5,7 @@
<!-- ENDIF -->
<!-- IF S_FORUM_RULES -->
- <div class="forumrules">
+ <div class="forumrules<!-- IF U_FORUM_RULES --> rules-link<!-- ENDIF -->">
<!-- IF U_FORUM_RULES -->
<h3>{L_FORUM_RULES}</h3><br />
<a href="{U_FORUM_RULES}"><b>{L_FORUM_RULES_LINK}</b></a>
@@ -20,13 +20,13 @@
<!-- IF not S_PRIVMSGS -->
<div id="pageheader">
- <h2><!-- IF TOPIC_TITLE --><a class="titles" href="{U_VIEW_TOPIC}">{TOPIC_TITLE}</a><!-- ELSE --><a class="titles" href="{U_VIEW_FORUM}">{FORUM_NAME}</a><!-- ENDIF --></h2>
+ <h2><!-- IF TOPIC_TITLE --><!-- EVENT posting_topic_title_before --><a class="titles" href="{U_VIEW_TOPIC}">{TOPIC_TITLE}</a><!-- EVENT posting_topic_title_after --><!-- ELSE --><a class="titles" href="{U_VIEW_FORUM}">{FORUM_NAME}</a><!-- ENDIF --></h2>
<!-- IF MODERATORS -->
- <p class="moderators">{L_MODERATORS}: {MODERATORS}</p>
+ <p class="moderators">{L_MODERATORS}{L_COLON} {MODERATORS}</p>
<!-- ENDIF -->
- <!-- IF U_MCP -->
- <p class="linkmcp">[ <a href="{U_MCP}">{L_MCP}</a> ]</p>
+ <!-- IF U_MCP or U_ACP -->
+ <p class="linkmcp">[&nbsp;<!-- IF U_ACP --><a href="{U_ACP}">{L_ACP}</a><!-- IF U_MCP -->&nbsp;|&nbsp;<!-- ENDIF --><!-- ENDIF --><!-- IF U_MCP --><a href="{U_MCP}">{L_MCP}</a><!-- ENDIF -->&nbsp;]</p>
<!-- ENDIF -->
</div>
@@ -69,8 +69,8 @@
<td class="postdetails" style="padding: 4px;">{draftrow.DATE}</td>
<td style="padding: 4px;"><b class="gen">{draftrow.DRAFT_SUBJECT}</b>
- <!-- IF draftrow.S_LINK_TOPIC --><br /><span class="gensmall">{L_TOPIC}: <a href="{draftrow.U_VIEW}">{draftrow.TITLE}</a></span>
- <!-- ELSEIF draftrow.S_LINK_FORUM --><br /><span class="gensmall">{L_FORUM}: <a href="{draftrow.U_VIEW}">{draftrow.TITLE}</a></span>
+ <!-- IF draftrow.S_LINK_TOPIC --><br /><span class="gensmall">{L_TOPIC}{L_COLON} <a href="{draftrow.U_VIEW}">{draftrow.TITLE}</a></span>
+ <!-- ELSEIF draftrow.S_LINK_FORUM --><br /><span class="gensmall">{L_FORUM}{L_COLON} <a href="{draftrow.U_VIEW}">{draftrow.TITLE}</a></span>
<!-- ELSEIF draftrow.S_LINK_PM --><br /><span class="gensmall">{L_PRIVATE_MESSAGE}</span>
<!-- ELSE --><br /><span class="gensmall">{L_NO_TOPIC_FORUM}</span><!-- ENDIF -->
</td>
@@ -114,20 +114,13 @@
</tr>
<!-- ENDIF -->
-<!-- IF S_DELETE_ALLOWED -->
- <tr>
- <td class="row1"><b class="genmed">{L_DELETE_POST}:</b></td>
- <td class="row2"><input type="checkbox" class="radio" name="delete" /> <span class="gensmall">[ {L_DELETE_POST_WARN} ]</span></td>
- </tr>
-<!-- ENDIF -->
-
<!-- IF S_SHOW_TOPIC_ICONS or S_SHOW_PM_ICONS -->
<tr>
- <td class="row1"><b class="genmed">{L_ICON}:</b></td>
+ <td class="row1"><b class="genmed">{L_ICON}{L_COLON}</b></td>
<td class="row2">
<table width="100%" cellspacing="0" cellpadding="0" border="0">
<tr>
- <td><input type="radio" class="radio" name="icon" value="0"{S_NO_ICON_CHECKED} tabindex="1" /><span class="genmed"><!-- IF S_SHOW_TOPIC_ICONS -->{L_NO_TOPIC_ICON}<!-- ELSE -->{L_NO_PM_ICON}<!-- ENDIF --></span> <!-- BEGIN topic_icon --><span style="white-space: nowrap;"><input type="radio" class="radio" name="icon" value="{topic_icon.ICON_ID}"{topic_icon.S_ICON_CHECKED} tabindex="1" /><img src="{topic_icon.ICON_IMG}" width="{topic_icon.ICON_WIDTH}" height="{topic_icon.ICON_HEIGHT}" alt="" title="" hspace="2" vspace="2" /></span> <!-- END topic_icon --></td>
+ <td><input type="radio" class="radio" name="icon" value="0"{S_NO_ICON_CHECKED} tabindex="1" /><span class="genmed"><!-- IF S_SHOW_TOPIC_ICONS -->{L_NO_TOPIC_ICON}<!-- ELSE -->{L_NO_PM_ICON}<!-- ENDIF --></span> <!-- BEGIN topic_icon --><span style="white-space: nowrap;"><input type="radio" class="radio" name="icon" value="{topic_icon.ICON_ID}"{topic_icon.S_ICON_CHECKED} tabindex="1" /><img src="{topic_icon.ICON_IMG}" width="{topic_icon.ICON_WIDTH}" height="{topic_icon.ICON_HEIGHT}" alt="{topic_icon.ICON_NAME}" title="" hspace="2" vspace="2" /></span> <!-- END topic_icon --></td>
</tr>
</table>
</td>
@@ -136,14 +129,14 @@
<!-- IF not S_PRIVMSGS and S_DISPLAY_USERNAME -->
<tr>
- <td class="row1"><b class="genmed">{L_USERNAME}:</b></td>
+ <td class="row1"><b class="genmed">{L_USERNAME}{L_COLON}</b></td>
<td class="row2"><input class="post" type="text" tabindex="1" name="username" size="25" value="{USERNAME}" /></td>
</tr>
<!-- ENDIF -->
<!-- IF S_PRIVMSGS -->
<tr>
- <td class="row1"><b class="genmed">{L_TO}:</b></td>
+ <td class="row1"><b class="genmed">{L_TO}{L_COLON}</b></td>
<td class="row2">
{S_HIDDEN_ADDRESS_FIELD}
<!-- BEGIN to_recipient -->
@@ -157,7 +150,7 @@
</tr>
<!-- IF S_ALLOW_MASS_PM -->
<tr>
- <td class="row1"><b class="genmed">{L_BCC}:</b></td>
+ <td class="row1"><b class="genmed">{L_BCC}{L_COLON}</b></td>
<td class="row2">
<!-- BEGIN bcc_recipient -->
<span class="genmed nowrap"><strong>
@@ -170,13 +163,19 @@
</tr>
<!-- ENDIF -->
<!-- ENDIF -->
-
+<!-- EVENT posting_editor_subject_before -->
<tr>
- <td class="row1" width="22%"><b class="genmed">{L_SUBJECT}:</b></td>
- <td class="row2" width="78%"><input class="post" style="width:450px" type="text" name="subject" size="45" maxlength="<!-- IF S_NEW_MESSAGE -->60<!-- ELSE -->64<!-- ENDIF -->" tabindex="2" value="{SUBJECT}" /></td>
+ <td class="row1" width="22%"><b class="genmed">{L_SUBJECT}{L_COLON}</b></td>
+ <td class="row2" width="78%">
+ <!-- EVENT posting_editor_subject_prepend -->
+ <input class="post" style="width:450px" type="text" name="subject" size="45" maxlength="<!-- IF S_NEW_MESSAGE -->120<!-- ELSE -->124<!-- ENDIF -->" tabindex="2" value="{SUBJECT}" />
+ <!-- EVENT posting_editor_subject_append -->
+ </td>
</tr>
+<!-- EVENT posting_editor_subject_after -->
<tr>
- <td class="row1" valign="top"><b class="genmed">{L_MESSAGE_BODY}:</b><br /><span class="gensmall">{L_MESSAGE_BODY_EXPLAIN}&nbsp;</span><br /><br />
+ <td class="row1" valign="top"><b class="genmed">{L_MESSAGE_BODY}{L_COLON}</b><br /><span class="gensmall">{L_MESSAGE_BODY_EXPLAIN}&nbsp;</span><br /><br />
+ <!-- EVENT posting_editor_smilies_before -->
<!-- IF S_SMILIES_ALLOWED -->
<table width="100%" cellspacing="5" cellpadding="0" border="0" align="center">
<tr>
@@ -198,6 +197,7 @@
</table>
<!-- ENDIF -->
+ <!-- EVENT posting_editor_smilies_after -->
</td>
<td class="row2" valign="top">
<script type="text/javascript">
@@ -209,32 +209,29 @@
<table width="100%" cellspacing="0" cellpadding="0" border="0">
<!-- INCLUDE posting_buttons.html -->
+ <!-- EVENT posting_editor_message_before -->
<tr>
<td valign="top" style="width: 100%;"><textarea name="message" rows="15" cols="76" tabindex="3" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);" onfocus="initInsertions();" style="width: 700px; height: 270px; min-width: 98%; max-width: 98%;">{MESSAGE}</textarea></td>
<!-- IF S_BBCODE_ALLOWED -->
- <td width="80" align="center" valign="top">
- <script type="text/javascript">
- // <![CDATA[
- colorPalette('v', 7, 6)
- // ]]>
- </script>
+ <td width="80" align="center" valign="top" id="color_palette_placeholder" data-orientation="v" data-width="11" data-height="10" data-bbcode="true">
</td>
<!-- ENDIF -->
</tr>
+ <!-- EVENT posting_editor_message_after -->
</table>
</td>
</tr>
<!-- IF S_INLINE_ATTACHMENT_OPTIONS -->
<tr>
- <td class="row1"><b class="genmed">{L_ATTACHMENTS}:</b></td>
- <td class="row2"><select name="attachments">{S_INLINE_ATTACHMENT_OPTIONS}</select>&nbsp;<input type="button" class="btnbbcode" accesskey="a" value="{L_PLACE_INLINE}" name="attachinline" onclick="attach_form = document.forms[form_name].elements['attachments']; attach_inline(attach_form.value, attach_form.options[attach_form.selectedIndex].text);" onmouseover="helpline('a')" onmouseout="helpline('tip')" />
+ <td class="row1"><b class="genmed">{L_ATTACHMENTS}{L_COLON}</b></td>
+ <td class="row2"><select name="attachments">{S_INLINE_ATTACHMENT_OPTIONS}</select>&nbsp;<input type="button" class="btnbbcode" accesskey="a" value="{L_PLACE_INLINE}" name="attachinline" onclick="attach_form = document.forms[form_name].elements['attachments']; attachInline(attach_form.value, attach_form.options[attach_form.selectedIndex].text);" onmouseover="helpline('a')" onmouseout="helpline('tip')" />
</td>
</tr>
<!-- ENDIF -->
<tr>
- <td class="row1" valign="top"><b class="genmed">{L_OPTIONS}:</b><br />
+ <td class="row1" valign="top"><b class="genmed">{L_OPTIONS}{L_COLON}</b><br />
<table cellspacing="2" cellpadding="0" border="0">
<tr>
<td class="gensmall">{BBCODE_STATUS}</td>
@@ -255,8 +252,10 @@
</tr>
</table>
</td>
+ <!-- EVENT posting_editor_bbcode_status_after -->
<td class="row2">
<table cellpadding="1">
+ <!-- EVENT posting_editor_options_prepend -->
<!-- IF S_BBCODE_ALLOWED -->
<tr>
<td><input type="checkbox" class="radio" name="disable_bbcode"{S_BBCODE_CHECKED} /></td>
@@ -309,8 +308,8 @@
<!-- IF S_TYPE_TOGGLE -->
<tr>
- <td>&nbsp;</td>
- <td class="gen"><!-- IF S_EDIT_POST -->{L_CHANGE_TOPIC_TO}<!-- ELSE -->{L_POST_TOPIC_AS}<!-- ENDIF -->: <!-- BEGIN topic_type --><input type="radio" class="radio" name="topic_type" value="{topic_type.VALUE}"{topic_type.S_CHECKED} />{topic_type.L_TOPIC_TYPE}&nbsp;&nbsp;<!-- END topic_type --></td>
+ <td></td>
+ <td class="gen"><!-- IF S_EDIT_POST -->{L_CHANGE_TOPIC_TO}<!-- ELSE -->{L_POST_TOPIC_AS}<!-- ENDIF -->{L_COLON} <!-- BEGIN topic_type --><input type="radio" class="radio" name="topic_type" value="{topic_type.VALUE}"{topic_type.S_CHECKED} />{topic_type.L_TOPIC_TYPE}&nbsp;&nbsp;<!-- END topic_type --></td>
</tr>
<!-- ENDIF -->
<!-- ENDIF -->
@@ -318,16 +317,36 @@
</td>
</tr>
+<!-- IF S_SOFTDELETE_ALLOWED or S_DELETE_ALLOWED -->
+ <tr>
+ <td class="row1" valign="top"><b class="genmed">{L_DELETE_POST}{L_COLON}</b></td>
+ <td class="row2">
+ <table cellpadding="1">
+ <tr>
+ <td><input type="checkbox" class="radio" name="delete" /></td>
+ <td class="gen">{L_DELETE_POST_WARN}</td>
+ </tr>
+ <!-- IF S_SOFTDELETE_ALLOWED and S_DELETE_ALLOWED -->
+ <tr>
+ <td><input type="checkbox" class="radio" name="delete_permanent" /></td>
+ <td class="gen">{L_DELETE_POST_PERMANENTLY}</td>
+ </tr>
+ <!-- ENDIF -->
+ </table>
+ </td>
+ </tr>
+<!-- ENDIF -->
+
<!-- IF S_TOPIC_TYPE_ANNOUNCE or S_TOPIC_TYPE_STICKY -->
<tr>
- <td class="row1"><b class="genmed">{L_STICK_TOPIC_FOR}:</b><br /><span class="gensmall">{L_STICKY_ANNOUNCE_TIME_LIMIT}</span></td>
- <td class="row2"><input class="post" type="text" name="topic_time_limit" size="3" maxlength="3" value="{TOPIC_TIME_LIMIT}" />&nbsp;<b class="gen">{L_DAYS}</b> <span class="gensmall">{L_STICK_TOPIC_FOR_EXPLAIN}</span></td>
+ <td class="row1"><b class="genmed">{L_STICK_TOPIC_FOR}{L_COLON}</b><br /><span class="gensmall">{L_STICKY_ANNOUNCE_TIME_LIMIT}</span></td>
+ <td class="row2"><input class="post" type="number" min="0" max="999" name="topic_time_limit" value="{TOPIC_TIME_LIMIT}" />&nbsp;<b class="gen">{L_DAYS}</b> <span class="gensmall">{L_STICK_TOPIC_FOR_EXPLAIN}</span></td>
</tr>
<!-- ENDIF -->
<!-- IF S_EDIT_REASON -->
<tr>
- <td class="row1" valign="top"><b class="genmed">{L_EDIT_REASON}:</b></td>
+ <td class="row1" valign="top"><b class="genmed">{L_EDIT_REASON}{L_COLON}</b></td>
<td class="row2"><input class="post" type="text" name="edit_reason" size="50" value="{EDIT_REASON}" /></td>
</tr>
<!-- ENDIF -->
@@ -355,7 +374,7 @@
<!-- INCLUDE posting_poll_body.html -->
<!-- ELSEIF S_POLL_DELETE -->
<tr>
- <td class="row1"><span class="genmed"><b>{L_POLL_DELETE}:</b></span></td>
+ <td class="row1"><span class="genmed"><b>{L_POLL_DELETE}{L_COLON}</b></span></td>
<td class="row2"><input type="checkbox" class="radio" name="poll_delete" /></td>
</tr>
<!-- ENDIF -->
@@ -365,6 +384,7 @@
<td class="cat" colspan="2" align="center">{S_HIDDEN_FIELDS}
<input class="btnlite" type="submit" tabindex="10" name="preview" value="{L_PREVIEW}" />
&nbsp; <input class="btnmain" type="submit" accesskey="s" tabindex="11" name="post" value="{L_SUBMIT}" />
+ <!-- EVENT posting_editor_submit_buttons -->
<!-- IF not S_SHOW_ATTACH_BOX and not S_SHOW_POLL_BOX -->
<!-- IF S_SAVE_ALLOWED -->&nbsp; <input class="btnlite" type="submit" accesskey="k" tabindex="12" name="save" value="{L_SAVE_DRAFT}" /><!-- ENDIF -->
<!-- IF S_HAS_DRAFTS -->&nbsp; <input class="btnlite" type="submit" accesskey="d" tabindex="13" name="load" value="{L_LOAD_DRAFT}" /><!-- ENDIF -->
@@ -411,4 +431,4 @@
</table>
<!-- INCLUDE overall_footer.html -->
-<!-- ENDIF --> \ No newline at end of file
+<!-- ENDIF -->
diff --git a/phpBB/styles/subsilver2/template/posting_buttons.html b/phpBB/styles/subsilver2/template/posting_buttons.html
index cfe69dee56..516cd0922b 100644
--- a/phpBB/styles/subsilver2/template/posting_buttons.html
+++ b/phpBB/styles/subsilver2/template/posting_buttons.html
@@ -33,29 +33,31 @@
// ]]>
</script>
- <script type="text/javascript" src="{T_SUPER_TEMPLATE_PATH}/editor.js"></script>
+ <!-- INCLUDEJS {T_ASSETS_PATH}/javascript/editor.js -->
<!-- IF S_BBCODE_ALLOWED -->
- <input type="button" class="btnbbcode" accesskey="b" name="addbbcode0" value=" B " style="font-weight:bold; width: 30px;" onclick="bbstyle(0)" onmouseover="helpline('b')" onmouseout="helpline('tip')" />
- <input type="button" class="btnbbcode" accesskey="i" name="addbbcode2" value=" i " style="font-style:italic; width: 30px;" onclick="bbstyle(2)" onmouseover="helpline('i')" onmouseout="helpline('tip')" />
- <input type="button" class="btnbbcode" accesskey="u" name="addbbcode4" value=" u " style="text-decoration: underline; width: 30px;" onclick="bbstyle(4)" onmouseover="helpline('u')" onmouseout="helpline('tip')" />
+ <!-- EVENT posting_editor_buttons_before -->
+ <div id="core-bbcode-buttons">
+ <input type="button" class="btnbbcode bbcode-b" accesskey="b" name="addbbcode0" value=" B " style="font-weight:bold; width: 30px;" onclick="bbstyle(0)" onmouseover="helpline('b')" onmouseout="helpline('tip')" />
+ <input type="button" class="btnbbcode bbcode-i" accesskey="i" name="addbbcode2" value=" i " style="font-style:italic; width: 30px;" onclick="bbstyle(2)" onmouseover="helpline('i')" onmouseout="helpline('tip')" />
+ <input type="button" class="btnbbcode bbcode-u" accesskey="u" name="addbbcode4" value=" u " style="text-decoration: underline; width: 30px;" onclick="bbstyle(4)" onmouseover="helpline('u')" onmouseout="helpline('tip')" />
<!-- IF S_BBCODE_QUOTE -->
- <input type="button" class="btnbbcode" accesskey="q" name="addbbcode6" value="Quote" style="width: 50px" onclick="bbstyle(6)" onmouseover="helpline('q')" onmouseout="helpline('tip')" />
+ <input type="button" class="btnbbcode bbcode-quote" accesskey="q" name="addbbcode6" value="Quote" style="width: 50px" onclick="bbstyle(6)" onmouseover="helpline('q')" onmouseout="helpline('tip')" />
<!-- ENDIF -->
- <input type="button" class="btnbbcode" accesskey="c" name="addbbcode8" value="Code" style="width: 40px" onclick="bbstyle(8)" onmouseover="helpline('c')" onmouseout="helpline('tip')" />
- <input type="button" class="btnbbcode" accesskey="l" name="addbbcode10" value="List" style="width: 40px" onclick="bbstyle(10)" onmouseover="helpline('l')" onmouseout="helpline('tip')" />
- <input type="button" class="btnbbcode" accesskey="o" name="addbbcode12" value="List=" style="width: 40px" onclick="bbstyle(12)" onmouseover="helpline('o')" onmouseout="helpline('tip')" />
- <input type="button" class="btnbbcode" accesskey="y" name="addlistitem" value="[*]" style="width: 40px" onclick="bbstyle(-1)" onmouseover="helpline('e')" onmouseout="helpline('tip')" />
+ <input type="button" class="btnbbcode bbcode-code" accesskey="c" name="addbbcode8" value="Code" style="width: 40px" onclick="bbstyle(8)" onmouseover="helpline('c')" onmouseout="helpline('tip')" />
+ <input type="button" class="btnbbcode bbcode-list" accesskey="l" name="addbbcode10" value="List" style="width: 40px" onclick="bbstyle(10)" onmouseover="helpline('l')" onmouseout="helpline('tip')" />
+ <input type="button" class="btnbbcode bbcode-list-" accesskey="o" name="addbbcode12" value="List=" style="width: 40px" onclick="bbstyle(12)" onmouseover="helpline('o')" onmouseout="helpline('tip')" />
+ <input type="button" class="btnbbcode bbcode-asterisk" accesskey="y" name="addlistitem" value="[*]" style="width: 40px" onclick="bbstyle(-1)" onmouseover="helpline('e')" onmouseout="helpline('tip')" />
<!-- IF S_BBCODE_IMG -->
- <input type="button" class="btnbbcode" accesskey="p" name="addbbcode14" value="Img" style="width: 40px" onclick="bbstyle(14)" onmouseover="helpline('p')" onmouseout="helpline('tip')" />
+ <input type="button" class="btnbbcode bbcode-img" accesskey="p" name="addbbcode14" value="Img" style="width: 40px" onclick="bbstyle(14)" onmouseover="helpline('p')" onmouseout="helpline('tip')" />
<!-- ENDIF -->
<!-- IF S_LINKS_ALLOWED -->
- <input type="button" class="btnbbcode" accesskey="w" name="addbbcode16" value="URL" style="text-decoration: underline; width: 40px" onclick="bbstyle(16)" onmouseover="helpline('w')" onmouseout="helpline('tip')" />
+ <input type="button" class="btnbbcode bbcode-url" accesskey="w" name="addbbcode16" value="URL" style="text-decoration: underline; width: 40px" onclick="bbstyle(16)" onmouseover="helpline('w')" onmouseout="helpline('tip')" />
<!-- ENDIF -->
<!-- IF S_BBCODE_FLASH -->
- <input type="button" class="btnbbcode" accesskey="d" name="addbbcode18" value="Flash" onclick="bbstyle(18)" onmouseover="helpline('d')" onmouseout="helpline('tip')" />
+ <input type="button" class="btnbbcode bbcode-flash" accesskey="d" name="addbbcode18" value="Flash" onclick="bbstyle(18)" onmouseover="helpline('d')" onmouseout="helpline('tip')" />
<!-- ENDIF -->
- <span class="genmed nowrap">{L_FONT_SIZE}: <select class="gensmall" name="addbbcode20" onchange="bbfontstyle('[size=' + this.form.addbbcode20.options[this.form.addbbcode20.selectedIndex].value + ']', '[/size]');this.form.addbbcode20.selectedIndex = 2;" onmouseover="helpline('f')" onmouseout="helpline('tip')">
+ <span class="genmed nowrap">{L_FONT_SIZE}{L_COLON} <select class="gensmall bbcode-size" name="addbbcode20" onchange="bbfontstyle('[size=' + this.form.addbbcode20.options[this.form.addbbcode20.selectedIndex].value + ']', '[/size]');this.form.addbbcode20.selectedIndex = 2;" onmouseover="helpline('f')" onmouseout="helpline('tip')">
<option value="50">{L_FONT_TINY}</option>
<option value="85">{L_FONT_SMALL}</option>
<option value="100" selected="selected">{L_FONT_NORMAL}</option>
@@ -66,18 +68,19 @@
<!-- ENDIF -->
<!-- ENDIF -->
</select></span>
+ </div>
+ <!-- EVENT posting_editor_buttons_custom_tags_before -->
+ <!-- IF .custom_tags -->
+ <div id="custom-bbcode-buttons">
+ <!-- BEGIN custom_tags -->
+ <input type="button" class="btnbbcode bbcode-{custom_tags.BBCODE_TAG_CLEAN}" name="addbbcode{custom_tags.BBCODE_ID}" value="{custom_tags.BBCODE_TAG}" onclick="bbstyle({custom_tags.BBCODE_ID})"<!-- IF custom_tags.BBCODE_HELPLINE !== '' --> onmouseover="helpline('cb_{custom_tags.BBCODE_ID}')" onmouseout="helpline('tip')"<!-- ENDIF --> />
+ <!-- END custom_tags -->
+ </div>
+ <!-- ENDIF -->
+ <!-- EVENT posting_editor_buttons_after -->
<!-- ENDIF -->
</td>
</tr>
-<!-- IF S_BBCODE_ALLOWED and .custom_tags -->
- <tr valign="middle" align="{S_CONTENT_FLOW_BEGIN}">
- <td colspan="2">
- <!-- BEGIN custom_tags -->
- <input type="button" class="btnbbcode" name="addbbcode{custom_tags.BBCODE_ID}" value="{custom_tags.BBCODE_TAG}" onclick="bbstyle({custom_tags.BBCODE_ID})"<!-- IF custom_tags.BBCODE_HELPLINE !== '' --> onmouseover="helpline('cb_{custom_tags.BBCODE_ID}')" onmouseout="helpline('tip')"<!-- ENDIF --> />
- <!-- END custom_tags -->
- </td>
- </tr>
-<!-- ENDIF -->
<!-- IF S_BBCODE_ALLOWED -->
<tr>
<td<!-- IF $S_SIGNATURE or S_EDIT_DRAFT --> colspan="2"<!-- ENDIF -->><input type="text" readonly="readonly" name="helpbox" style="width:100%" class="helpline" value="{L_STYLES_TIP}" /></td>
diff --git a/phpBB/styles/subsilver2/template/posting_poll_body.html b/phpBB/styles/subsilver2/template/posting_poll_body.html
index 3a523182f7..a18f319c1c 100644
--- a/phpBB/styles/subsilver2/template/posting_poll_body.html
+++ b/phpBB/styles/subsilver2/template/posting_poll_body.html
@@ -6,31 +6,32 @@
<td class="row3" colspan="2"><span class="gensmall">{L_ADD_POLL_EXPLAIN}</span></td>
</tr>
<tr>
- <td class="row1"><b class="genmed">{L_POLL_QUESTION}:</b></td>
+ <td class="row1"><b class="genmed">{L_POLL_QUESTION}{L_COLON}</b></td>
<td class="row2"><input class="post" type="text" name="poll_title" size="50" maxlength="255" value="{POLL_TITLE}" /></td>
</tr>
<tr>
- <td class="row1"><b class="genmed">{L_POLL_OPTIONS}:</b><br /><span class="gensmall">{L_POLL_OPTIONS_EXPLAIN}</span></td>
+ <td class="row1"><b class="genmed">{L_POLL_OPTIONS}{L_COLON}</b><br /><span class="gensmall">{L_POLL_OPTIONS_EXPLAIN}</span></td>
<td class="row2"><textarea style="width:450px" name="poll_option_text" rows="5" cols="35">{POLL_OPTIONS}</textarea></td>
</tr>
<tr>
- <td class="row1"><b class="genmed">{L_POLL_MAX_OPTIONS}:</b><br /><span class="gensmall">{L_POLL_MAX_OPTIONS_EXPLAIN}</span></td>
- <td class="row2"><input class="post" type="text" name="poll_max_options" size="3" maxlength="3" value="{POLL_MAX_OPTIONS}" /></td>
+ <td class="row1"><b class="genmed">{L_POLL_MAX_OPTIONS}{L_COLON}</b><br /><span class="gensmall">{L_POLL_MAX_OPTIONS_EXPLAIN}</span></td>
+ <td class="row2"><input class="post" type="number" min="0" max="999" name="poll_max_options" value="{POLL_MAX_OPTIONS}" /></td>
</tr>
<tr>
- <td class="row1"><b class="genmed">{L_POLL_FOR}:</b></td>
- <td class="row2"><input class="post" type="text" name="poll_length" size="3" maxlength="3" value="{POLL_LENGTH}" />&nbsp;<b class="gen">{L_DAYS}</b> <span class="gensmall">{L_POLL_FOR_EXPLAIN}</span></td>
+ <td class="row1"><b class="genmed">{L_POLL_FOR}{L_COLON}</b></td>
+ <td class="row2"><input class="post" type="number" min="0" max="999" name="poll_length" value="{POLL_LENGTH}" />&nbsp;<b class="gen">{L_DAYS}</b> <span class="gensmall">{L_POLL_FOR_EXPLAIN}</span></td>
</tr>
<!-- IF S_POLL_VOTE_CHANGE -->
<tr>
- <td class="row1"><b class="genmed">{L_POLL_VOTE_CHANGE}:</b><br /><span class="gensmall">{L_POLL_VOTE_CHANGE_EXPLAIN}</span></td>
+ <td class="row1"><b class="genmed">{L_POLL_VOTE_CHANGE}{L_COLON}</b><br /><span class="gensmall">{L_POLL_VOTE_CHANGE_EXPLAIN}</span></td>
<td class="row2"><input type="checkbox" class="radio" name="poll_vote_change"{VOTE_CHANGE_CHECKED} /></td>
</tr>
<!-- ENDIF -->
+<!-- EVENT posting_poll_body_options_after -->
<!-- IF S_POLL_DELETE -->
<tr>
- <td class="row1"><b class="genmed">{L_POLL_DELETE}:</b></td>
+ <td class="row1"><b class="genmed">{L_POLL_DELETE}{L_COLON}</b></td>
<td class="row2"><input type="checkbox" class="radio" name="poll_delete"<!-- IF S_POLL_DELETE_CHECKED --> checked="checked"<!-- ENDIF --> /></td>
</tr>
<!-- ENDIF -->
diff --git a/phpBB/styles/subsilver2/template/posting_preview.html b/phpBB/styles/subsilver2/template/posting_preview.html
index b990428f36..c451e4c871 100644
--- a/phpBB/styles/subsilver2/template/posting_preview.html
+++ b/phpBB/styles/subsilver2/template/posting_preview.html
@@ -4,7 +4,7 @@
<th>{L_PREVIEW}</th>
</tr>
<tr>
- <td class="row1">{MINI_POST_IMG}<span class="postdetails">{L_POSTED}: {POST_DATE} &nbsp;&nbsp;&nbsp; {L_POST_SUBJECT}: {PREVIEW_SUBJECT}</span></td>
+ <td class="row1">{MINI_POST_IMG}<span class="postdetails">{L_POSTED}{L_COLON} {POST_DATE} &nbsp;&nbsp;&nbsp; {L_POST_SUBJECT}{L_COLON} {PREVIEW_SUBJECT}</span></td>
</tr>
<!-- IF S_HAS_POLL_OPTIONS -->
<tr>
@@ -38,6 +38,7 @@
</td>
</tr>
<!-- ENDIF -->
+<!-- EVENT posting_preview_poll_after -->
<tr>
<td class="row1">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
@@ -48,7 +49,7 @@
<table class="tablebg" width="100%" cellspacing="1">
<tr>
- <td class="row3"><b class="genmed">{L_ATTACHMENTS}: </b></td>
+ <td class="row3"><b class="genmed">{L_ATTACHMENTS}{L_COLON} </b></td>
</tr>
<!-- BEGIN attachment -->
<tr>
diff --git a/phpBB/styles/subsilver2/template/posting_review.html b/phpBB/styles/subsilver2/template/posting_review.html
index 13e895e95a..c118499564 100644
--- a/phpBB/styles/subsilver2/template/posting_review.html
+++ b/phpBB/styles/subsilver2/template/posting_review.html
@@ -23,7 +23,7 @@
<td colspan="2">{post_review_row.L_IGNORE_POST}</td>
<!-- ELSE -->
- <td rowspan="2" align="{S_CONTENT_FLOW_BEGIN}" valign="top"><a id="pr{post_review_row.POST_ID}"></a>
+ <td rowspan="2" align="{S_CONTENT_FLOW_BEGIN}" valign="top"><a id="pr{post_review_row.POST_ID}" class="anchor"></a>
<table width="150" cellspacing="0" cellpadding="4" border="0">
<tr>
<td align="center"><b class="postauthor">{post_review_row.POST_AUTHOR_FULL}</b></td>
@@ -34,7 +34,7 @@
<table width="100%" cellspacing="0" cellpadding="0" border="0">
<tr>
<td>&nbsp;</td>
- <td class="gensmall" valign="middle" nowrap="nowrap"><b>{L_POST_SUBJECT}:</b>&nbsp;</td>
+ <td class="gensmall" valign="middle" nowrap="nowrap"><b>{L_POST_SUBJECT}{L_COLON}</b>&nbsp;</td>
<td class="gensmall" width="100%" valign="middle">{post_review_row.POST_SUBJECT}</td>
<td>&nbsp;</td>
</tr>
@@ -57,7 +57,7 @@
<table class="tablebg" width="100%" cellspacing="1">
<tr>
- <td class="row3"><b class="genmed">{L_ATTACHMENTS}: </b></td>
+ <td class="row3"><b class="genmed">{L_ATTACHMENTS}{L_COLON} </b></td>
</tr>
<!-- BEGIN attachment -->
<tr>
@@ -77,8 +77,8 @@
<table width="100%" cellspacing="0" cellpadding="0" border="0">
<tr valign="middle">
<td width="100%">&nbsp;</td>
- <td width="10" nowrap="nowrap"><!-- IF S_IS_BOT -->{post_review_row.MINI_POST_IMG}<!-- ELSE --><a href="{post_review_row.U_MINI_POST}">{post_review_row.MINI_POST_IMG}</a><!-- ENDIF --></td>
- <td class="gensmall" nowrap="nowrap"><b>{L_POSTED}:</b> {post_review_row.POST_DATE}</td>
+ <td width="10" nowrap="nowrap"><!-- IF S_IS_BOT -->{post_review_row.MINI_POST_IMG}<!-- ELSE --><a href="{post_review_row.U_MINI_POST}" class="imageset">{post_review_row.MINI_POST_IMG}</a><!-- ENDIF --></td>
+ <td class="gensmall" nowrap="nowrap"><b>{L_POSTED}{L_COLON}</b> {post_review_row.POST_DATE}</td>
</tr>
</table>
</td>
@@ -96,4 +96,4 @@
</tr>
</table>
-<br clear="all" /> \ No newline at end of file
+<br clear="all" />
diff --git a/phpBB/styles/subsilver2/template/posting_smilies.html b/phpBB/styles/subsilver2/template/posting_smilies.html
index d2224887bc..7087414fa8 100644
--- a/phpBB/styles/subsilver2/template/posting_smilies.html
+++ b/phpBB/styles/subsilver2/template/posting_smilies.html
@@ -6,7 +6,7 @@
var text_name = opener.text_name;
// ]]>
</script>
-<script type="text/javascript" src="{T_SUPER_TEMPLATE_PATH}/editor.js"></script>
+<!-- INCLUDEJS {T_ASSETS_PATH}/javascript/editor.js -->
<table width="100%" cellspacing="1" cellpadding="4" border="0">
<tr>
@@ -16,10 +16,23 @@
<th>{L_SMILIES}</th>
</tr>
<tr>
- <td class="row1" align="center" valign="middle"><!-- BEGIN smiley --> <a href="#" onclick="initInsertions(); insert_text('{smiley.A_SMILEY_CODE}', true, true); return false;"><img src="{smiley.SMILEY_IMG}" width="{smiley.SMILEY_WIDTH}" height="{smiley.SMILEY_HEIGHT}" alt="{smiley.SMILEY_CODE}" title="{smiley.SMILEY_DESC}" hspace="2" vspace="2" /></a> <!-- END smiley --><br />{PAGINATION}<br /><a class="nav" href="#" onclick="window.close(); return false;">{L_CLOSE_WINDOW}</a></td>
+ <td class="row1" align="center" valign="middle"><!-- BEGIN smiley --> <a href="#" onclick="initInsertions(); insert_text('{smiley.A_SMILEY_CODE}', true, true); return false;"><img src="{smiley.SMILEY_IMG}" width="{smiley.SMILEY_WIDTH}" height="{smiley.SMILEY_HEIGHT}" alt="{smiley.SMILEY_CODE}" title="{smiley.SMILEY_DESC}" hspace="2" vspace="2" /></a> <!-- END smiley --><br />
+ <!-- IF .pagination -->
+ <b><a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE_CLICK}">{L_GOTO_PAGE}</a>
+ <!-- BEGIN pagination -->
+ <!-- IF pagination.S_IS_PREV --><a href="{pagination.PAGE_URL}">{pagination.PAGE_NUMBER}</a>
+ <!-- ELSEIF pagination.S_IS_CURRENT --><strong>{pagination.PAGE_NUMBER}</strong>
+ <!-- ELSEIF pagination.S_IS_ELLIPSIS --> {L_ELLIPSIS}
+ <!-- ELSEIF pagination.S_IS_NEXT --><a href="{pagination.PAGE_URL}">{pagination.PAGE_NUMBER}</a>
+ <!-- ELSE --><a href="{pagination.PAGE_URL}">{pagination.PAGE_NUMBER}</a>
+ <!-- ENDIF -->
+ <!-- END pagination -->
+ <br />
+ <!-- ENDIF -->
+ <a class="nav" href="#" onclick="window.close(); return false;">{L_CLOSE_WINDOW}</a></td>
</tr>
</table>
</td>
</tr>
</table>
-<!-- INCLUDE simple_footer.html --> \ No newline at end of file
+<!-- INCLUDE simple_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/posting_topic_review.html b/phpBB/styles/subsilver2/template/posting_topic_review.html
index 54bbf6e553..46329e19fa 100644
--- a/phpBB/styles/subsilver2/template/posting_topic_review.html
+++ b/phpBB/styles/subsilver2/template/posting_topic_review.html
@@ -18,12 +18,13 @@
</tr>
<!-- BEGIN topic_review_row -->
+ <!-- EVENT posting_topic_review_row_post_details_before -->
<!-- IF topic_review_row.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
<!-- IF topic_review_row.S_IGNORE_POST -->
<td colspan="2">{topic_review_row.L_IGNORE_POST}</td>
<!-- ELSE -->
- <td rowspan="2" align="{S_CONTENT_FLOW_BEGIN}" valign="top"><a id="pr{topic_review_row.POST_ID}"></a>
+ <td rowspan="2" align="{S_CONTENT_FLOW_BEGIN}" valign="top"><a id="pr{topic_review_row.POST_ID}" class="anchor"></a>
<table width="150" cellspacing="0">
<tr>
<td align="center"><b class="postauthor"<!-- IF topic_review_row.POST_AUTHOR_COLOUR --> style="color: {topic_review_row.POST_AUTHOR_COLOUR}"<!-- ENDIF -->>{topic_review_row.POST_AUTHOR}</b></td>
@@ -34,13 +35,14 @@
<table width="100%" cellspacing="0">
<tr>
<td>&nbsp;</td>
- <td class="gensmall" valign="middle" nowrap="nowrap"><b>{L_POST_SUBJECT}:</b>&nbsp;</td>
+ <td class="gensmall" valign="middle" nowrap="nowrap"><b>{L_POST_SUBJECT}{L_COLON}</b>&nbsp;</td>
<td class="gensmall" width="100%" valign="middle">{topic_review_row.POST_SUBJECT}</td>
- <td valign="top" nowrap="nowrap">&nbsp;<!-- IF topic_review_row.POSTER_QUOTE and topic_review_row.DECODED_MESSAGE --><a href="#" onclick="addquote({topic_review_row.POST_ID},'{topic_review_row.POSTER_QUOTE}', '{LA_WROTE}'); return false;">{QUOTE_IMG}</a><!-- ENDIF --></td>
+ <td valign="top" nowrap="nowrap">&nbsp;<!-- IF topic_review_row.POSTER_QUOTE and topic_review_row.DECODED_MESSAGE --><a href="#" onclick="addquote({topic_review_row.POST_ID},'{topic_review_row.POSTER_QUOTE}', '{LA_WROTE}'); return false;" class="imageset">{QUOTE_IMG}</a><!-- ENDIF --></td>
</tr>
</table>
</td>
</tr>
+ <!-- EVENT posting_topic_review_row_post_details_after -->
<!-- IF topic_review_row.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
@@ -51,6 +53,13 @@
<table width="100%" cellspacing="0" cellpadding="2">
<tr>
<td>
+ <!-- IF topic_review_row.POST_ID == REPORTED_POST_ID -->
+ <table width="100%" cellspacing="0">
+ <tr>
+ <span class="postreported">{REPORTED_IMG}</span>
+ </tr>
+ </table>
+ <!-- ENDIF -->
<div class="postbody">{topic_review_row.MESSAGE}</div>
<!-- IF topic_review_row.S_HAS_ATTACHMENTS -->
@@ -58,7 +67,7 @@
<table class="tablebg" width="100%" cellspacing="1">
<tr>
- <td class="row3"><b class="genmed">{L_ATTACHMENTS}: </b></td>
+ <td class="row3"><b class="genmed">{L_ATTACHMENTS}{L_COLON} </b></td>
</tr>
<!-- BEGIN attachment -->
<tr>
@@ -81,8 +90,8 @@
<table width="100%" cellspacing="0">
<tr valign="middle">
<td width="100%" align="{S_CONTENT_FLOW_BEGIN}"><span class="gensmall"><!-- IF topic_review_row.U_MCP_DETAILS -->[ <a href="{topic_review_row.U_MCP_DETAILS}">{L_POST_DETAILS}</a> ]<!-- ENDIF --></span></td>
- <td width="10" nowrap="nowrap"><!-- IF S_IS_BOT -->{topic_review_row.MINI_POST_IMG}<!-- ELSE --><a href="{topic_review_row.U_MINI_POST}">{topic_review_row.MINI_POST_IMG}</a><!-- ENDIF --></td>
- <td class="gensmall" nowrap="nowrap"><b>{L_POSTED}:</b> {topic_review_row.POST_DATE}</td>
+ <td width="10" nowrap="nowrap"><!-- IF S_IS_BOT -->{topic_review_row.MINI_POST_IMG}<!-- ELSE --><a href="{topic_review_row.U_MINI_POST}" class="imageset">{topic_review_row.MINI_POST_IMG}</a><!-- ENDIF --></td>
+ <td class="gensmall" nowrap="nowrap"><b>{L_POSTED}{L_COLON}</b> {topic_review_row.POST_DATE}</td>
</tr>
</table>
</td>
@@ -100,4 +109,4 @@
</tr>
</table>
-<br clear="all" /> \ No newline at end of file
+<br clear="all" />
diff --git a/phpBB/styles/subsilver2/template/profilefields/bool.html b/phpBB/styles/subsilver2/template/profilefields/bool.html
new file mode 100644
index 0000000000..f57bd4e4da
--- /dev/null
+++ b/phpBB/styles/subsilver2/template/profilefields/bool.html
@@ -0,0 +1,7 @@
+<!-- BEGIN bool -->
+ <!-- IF bool.FIELD_LENGTH eq 1 -->
+ <!-- BEGIN options --><input type="radio" class="radio" name="{bool.FIELD_IDENT}" value="{bool.options.OPTION_ID}"{bool.options.CHECKED} /><span class="genmed">{bool.options.VALUE}</span>&nbsp; &nbsp;<!-- END options -->
+ <!-- ELSE -->
+ <input type="checkbox" class="radio" name="{bool.FIELD_IDENT}" value="1"<!-- IF bool.FIELD_VALUE eq 1 --> checked="checked"<!-- ENDIF --> />
+ <!-- ENDIF -->
+<!-- END bool -->
diff --git a/phpBB/styles/subsilver2/template/profilefields/date.html b/phpBB/styles/subsilver2/template/profilefields/date.html
new file mode 100644
index 0000000000..e2da2463a5
--- /dev/null
+++ b/phpBB/styles/subsilver2/template/profilefields/date.html
@@ -0,0 +1,5 @@
+<!-- BEGIN date -->
+<span class="genmed">{L_DAY}{L_COLON}</span> <select name="{date.FIELD_IDENT}_day">{date.S_DAY_OPTIONS}</select>
+<span class="genmed">{L_MONTH}{L_COLON}</span> <select name="{date.FIELD_IDENT}_month">{date.S_MONTH_OPTIONS}</select>
+<span class="genmed">{L_YEAR}{L_COLON}</span> <select name="{date.FIELD_IDENT}_year">{date.S_YEAR_OPTIONS}</select>
+<!-- END date -->
diff --git a/phpBB/styles/subsilver2/template/profilefields/dropdown.html b/phpBB/styles/subsilver2/template/profilefields/dropdown.html
new file mode 100644
index 0000000000..16242da895
--- /dev/null
+++ b/phpBB/styles/subsilver2/template/profilefields/dropdown.html
@@ -0,0 +1,5 @@
+<!-- BEGIN dropdown -->
+<select name="{dropdown.FIELD_IDENT}">
+ <!-- BEGIN options --><option value="{dropdown.options.OPTION_ID}"{dropdown.options.SELECTED}>{dropdown.options.VALUE}</option><!-- END options -->
+</select>
+<!-- END dropdown -->
diff --git a/phpBB/styles/subsilver2/template/profilefields/int.html b/phpBB/styles/subsilver2/template/profilefields/int.html
new file mode 100644
index 0000000000..067921e320
--- /dev/null
+++ b/phpBB/styles/subsilver2/template/profilefields/int.html
@@ -0,0 +1,3 @@
+<!-- BEGIN int -->
+ <input type="number" min="{int.FIELD_MINLEN}" max="{int.FIELD_MAXLEN}" class="post" name="{int.FIELD_IDENT}" size="{int.FIELD_LENGTH}" value="{int.FIELD_VALUE}" />
+<!-- END int -->
diff --git a/phpBB/styles/subsilver2/template/profilefields/string.html b/phpBB/styles/subsilver2/template/profilefields/string.html
new file mode 100644
index 0000000000..5a98562e2a
--- /dev/null
+++ b/phpBB/styles/subsilver2/template/profilefields/string.html
@@ -0,0 +1,3 @@
+<!-- BEGIN string -->
+ <input type="text" class="post" name="{string.FIELD_IDENT}" size="{string.FIELD_LENGTH}" maxlength="{string.FIELD_MAXLEN}" value="{string.FIELD_VALUE}" />
+<!-- END string -->
diff --git a/phpBB/styles/subsilver2/template/profilefields/text.html b/phpBB/styles/subsilver2/template/profilefields/text.html
new file mode 100644
index 0000000000..df2474ad3e
--- /dev/null
+++ b/phpBB/styles/subsilver2/template/profilefields/text.html
@@ -0,0 +1,3 @@
+<!-- BEGIN text -->
+<textarea name="{text.FIELD_IDENT}" rows="{text.FIELD_ROWS}" cols="{text.FIELD_COLS}">{text.FIELD_VALUE}</textarea>
+<!-- END text -->
diff --git a/phpBB/styles/subsilver2/template/profilefields/url.html b/phpBB/styles/subsilver2/template/profilefields/url.html
new file mode 100644
index 0000000000..42805aa98d
--- /dev/null
+++ b/phpBB/styles/subsilver2/template/profilefields/url.html
@@ -0,0 +1,3 @@
+<!-- BEGIN url -->
+ <input type="url" class="post" name="{url.FIELD_IDENT}" id="{url.FIELD_IDENT}" size="{url.FIELD_LENGTH}" maxlength="{url.FIELD_MAXLEN}" value="{url.FIELD_VALUE}" />
+<!-- END url -->
diff --git a/phpBB/styles/subsilver2/template/quickreply_editor.html b/phpBB/styles/subsilver2/template/quickreply_editor.html
index 91a8c9a702..a7614e841f 100644
--- a/phpBB/styles/subsilver2/template/quickreply_editor.html
+++ b/phpBB/styles/subsilver2/template/quickreply_editor.html
@@ -1,27 +1,30 @@
<form method="post" action="{U_QR_ACTION}">
-
+<!-- EVENT quickreply_editor_panel_before -->
<table class="tablebg" width="100%" cellspacing="1">
<tr>
<th align="center" colspan="2">{L_QUICKREPLY}</th>
</tr>
+ <!-- EVENT quickreply_editor_subject_before -->
<tr>
- <td class="row1" width="22%"><b class="genmed">{L_SUBJECT}:</b></td>
- <td class="row2" width="78%"><input class="post" style="width:450px" type="text" name="subject" size="45" maxlength="64" tabindex="2" value="{SUBJECT}" /></td>
+ <td class="row1" width="22%"><b class="genmed">{L_SUBJECT}{L_COLON}</b></td>
+ <td class="row2" width="78%"><input class="post" style="width:450px" type="text" name="subject" size="45" maxlength="124" tabindex="2" value="{SUBJECT}" /></td>
</tr>
+ <!-- EVENT quickreply_editor_message_before -->
<tr>
- <td class="row1" width="22%"><b class="genmed">{L_MESSAGE}:</b></td>
+ <td class="row1" width="22%"><b class="genmed">{L_MESSAGE}{L_COLON}</b></td>
<td class="row2" valign="top" align="left" width="78%"><textarea name="message" rows="7" cols="76" tabindex="3" style="width: 700px; height: 130px; min-width: 98%; max-width: 98%;"></textarea> </td>
</tr>
+ <!-- EVENT quickreply_editor_message_after -->
<tr>
<td class="cat" colspan="2" align="center">
- <input class="btnmain" type="submit" accesskey="s" tabindex="6" name="post" value="{L_SUBMIT}" />&nbsp;
- <input class="btnlite" type="submit" accesskey="f" tabindex="7" name="full_editor" value="{L_FULL_EDITOR}" />
+ <input class="btnlite" type="submit" accesskey="f" tabindex="6" name="preview" value="{L_FULL_EDITOR}" />&nbsp;
+ <input class="btnmain" type="submit" accesskey="s" tabindex="7" name="post" value="{L_SUBMIT}" />
{S_FORM_TOKEN}
{QR_HIDDEN_FIELDS}
</td>
</tr>
</table>
-
+<!-- EVENT quickreply_editor_panel_after -->
</form>
-<br clear="all" /> \ No newline at end of file
+<br clear="all" />
diff --git a/phpBB/styles/subsilver2/template/report_body.html b/phpBB/styles/subsilver2/template/report_body.html
index 57747ffac0..906a957ef4 100644
--- a/phpBB/styles/subsilver2/template/report_body.html
+++ b/phpBB/styles/subsilver2/template/report_body.html
@@ -15,19 +15,19 @@
<td class="row3" colspan="2"><span class="gensmall"><!-- IF S_REPORT_POST -->{L_REPORT_POST_EXPLAIN}<!-- ELSE -->{L_REPORT_MESSAGE_EXPLAIN}<!-- ENDIF --></span></td>
</tr>
<tr>
- <td class="row1" width="22%"><b class="gen">{L_REASON}:</b></td>
+ <td class="row1" width="22%"><b class="gen">{L_REASON}{L_COLON}</b></td>
<td class="row2" width="78%"><select name="reason_id">
<!-- BEGIN reason --><option value="{reason.ID}"<!-- IF reason.S_SELECTED --> selected="selected"<!-- ENDIF -->>{reason.TITLE} &raquo; {reason.DESCRIPTION}</option><!-- END reason -->
</select></td>
</tr>
<!-- IF S_CAN_NOTIFY -->
<tr>
- <td class="row1"><span class="gen"><b>{L_REPORT_NOTIFY}:</b></span><br /><span class="gensmall">{L_REPORT_NOTIFY_EXPLAIN}</span></td>
+ <td class="row1"><span class="gen"><b>{L_REPORT_NOTIFY}{L_COLON}</b></span><br /><span class="gensmall">{L_REPORT_NOTIFY_EXPLAIN}</span></td>
<td class="row2"><span class="gen"><input type="radio" class="radio" name="notify" value="1"<!-- IF S_NOTIFY --> checked="checked"<!-- ENDIF --> />&nbsp; {L_YES} &nbsp;<input type="radio" class="radio" name="notify" value="0"<!-- IF not S_NOTIFY --> checked="checked"<!-- ENDIF --> />&nbsp; {L_NO}</span></td>
</tr>
<!-- ENDIF -->
<tr>
- <td class="row1" valign="top"><span class="gen"><b>{L_MORE_INFO}:</b></span><br /><span class="gensmall">{L_CAN_LEAVE_BLANK}</span></td>
+ <td class="row1" valign="top"><span class="gen"><b>{L_MORE_INFO}{L_COLON}</b></span><br /><span class="gensmall">{L_CAN_LEAVE_BLANK}</span></td>
<td class="row2"><textarea class="post" name="report_text" rows="10" cols="50">{REPORT_TEXT}</textarea></td>
</tr>
<!-- IF CAPTCHA_TEMPLATE -->
@@ -46,4 +46,4 @@
<div style="float: {S_CONTENT_FLOW_END};"><!-- INCLUDE jumpbox.html --></div>
-<!-- INCLUDE overall_footer.html --> \ No newline at end of file
+<!-- INCLUDE overall_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/search_body.html b/phpBB/styles/subsilver2/template/search_body.html
index 763a229c83..84ea73ea30 100644
--- a/phpBB/styles/subsilver2/template/search_body.html
+++ b/phpBB/styles/subsilver2/template/search_body.html
@@ -2,54 +2,68 @@
<div id="pagecontent">
+ <!-- EVENT search_body_form_before -->
<form method="get" action="{S_SEARCH_ACTION}">
<table class="tablebg" width="100%" cellspacing="1">
+ <!-- DEFINE $COLSPAN = 4 -->
+ <!-- EVENT search_body_search_query_before -->
<tr>
- <th colspan="4">{L_SEARCH_QUERY}</th>
+ <th colspan="{$COLSPAN}">{L_SEARCH_QUERY}</th>
</tr>
+ <!-- EVENT search_body_search_query_prepend -->
<tr>
- <td class="row1" colspan="2" width="50%"><b class="genmed">{L_SEARCH_KEYWORDS}: </b><br /><span class="gensmall">{L_SEARCH_KEYWORDS_EXPLAIN}</span></td>
+ <td class="row1" colspan="2" width="50%"><b class="genmed">{L_SEARCH_KEYWORDS}{L_COLON} </b><br /><span class="gensmall">{L_SEARCH_KEYWORDS_EXPLAIN}</span></td>
<td class="row2" colspan="2" valign="top"><input type="text" style="width: 300px" class="post" name="keywords" size="30" /><br /><input type="radio" class="radio" name="terms" value="all" checked="checked" /> <span class="genmed">{L_SEARCH_ALL_TERMS}</span><br /><input type="radio" class="radio" name="terms" value="any" /> <span class="genmed">{L_SEARCH_ANY_TERMS}</span></td>
</tr>
<tr>
- <td class="row1" colspan="2"><b class="genmed">{L_SEARCH_AUTHOR}:</b><br /><span class="gensmall">{L_SEARCH_AUTHOR_EXPLAIN}</span></td>
+ <td class="row1" colspan="2"><b class="genmed">{L_SEARCH_AUTHOR}{L_COLON}</b><br /><span class="gensmall">{L_SEARCH_AUTHOR_EXPLAIN}</span></td>
<td class="row2" colspan="2" valign="middle"><input type="text" style="width: 300px" class="post" name="author" size="30" /></td>
</tr>
<tr>
- <td class="row1" colspan="2"><b class="genmed">{L_SEARCH_FORUMS}: </b><br /><span class="gensmall">{L_SEARCH_FORUMS_EXPLAIN}</span></td>
+ <td class="row1" colspan="2"><b class="genmed">{L_SEARCH_FORUMS}{L_COLON} </b><br /><span class="gensmall">{L_SEARCH_FORUMS_EXPLAIN}</span></td>
<td class="row2" colspan="2"><select name="fid[]" multiple="multiple" size="5">{S_FORUM_OPTIONS}</select></td>
</tr>
+ <!-- EVENT search_body_search_query_append -->
+ <!-- EVENT search_body_search_query_after -->
+ <!-- EVENT search_body_search_options_before -->
<tr>
- <th colspan="4">{L_SEARCH_OPTIONS}</th>
+ <th colspan="{$COLSPAN}">{L_SEARCH_OPTIONS}</th>
</tr>
+ <!-- EVENT search_body_search_options_prepend -->
<tr>
- <td class="row1" width="25%" nowrap="nowrap"><b class="genmed">{L_SEARCH_SUBFORUMS}: </b></td>
+ <td class="row1" width="25%" nowrap="nowrap"><b class="genmed">{L_SEARCH_SUBFORUMS}{L_COLON} </b></td>
<td class="row2" width="25%" nowrap="nowrap"><input type="radio" class="radio" name="sc" value="1" checked="checked" /> <span class="genmed">{L_YES}</span>&nbsp;&nbsp;<input type="radio" class="radio" name="sc" value="0" /> <span class="genmed">{L_NO}</span></td>
- <td class="row1" width="25%" nowrap="nowrap"><b class="genmed">{L_SEARCH_WITHIN}: </b></td>
+ <td class="row1" width="25%" nowrap="nowrap"><b class="genmed">{L_SEARCH_WITHIN}{L_COLON} </b></td>
<td class="row2" width="25%" nowrap="nowrap"><input type="radio" class="radio" name="sf" value="all" checked="checked" /> <span class="genmed">{L_SEARCH_TITLE_MSG}</span><br /><input type="radio" class="radio" name="sf" value="msgonly" /> <span class="genmed">{L_SEARCH_MSG_ONLY}</span> <br /><input type="radio" class="radio" name="sf" value="titleonly" /> <span class="genmed">{L_SEARCH_TITLE_ONLY}</span> <br /><input type="radio" class="radio" name="sf" value="firstpost" /> <span class="genmed">{L_SEARCH_FIRST_POST}</span></td>
</tr>
+ <!-- EVENT search_body_search_options_append -->
+ <!-- EVENT search_body_search_display_options_prepend -->
<tr>
- <td class="row1"><b class="genmed">{L_RESULT_SORT}: </b></td>
+ <td class="row1"><b class="genmed">{L_RESULT_SORT}{L_COLON} </b></td>
<td class="row2" nowrap="nowrap">{S_SELECT_SORT_KEY}<br /><input type="radio" class="radio" name="sd" value="a" /> <span class="genmed">{L_SORT_ASCENDING}</span><br /><input type="radio" class="radio" name="sd" value="d" checked="checked" /> <span class="genmed">{L_SORT_DESCENDING}</span></td>
- <td class="row1" nowrap="nowrap"><b class="genmed">{L_DISPLAY_RESULTS}: </b></td>
+ <td class="row1" nowrap="nowrap"><b class="genmed">{L_DISPLAY_RESULTS}{L_COLON} </b></td>
<td class="row2" nowrap="nowrap"><input type="radio" class="radio" name="sr" value="posts" checked="checked" /> <span class="genmed">{L_POSTS}</span>&nbsp;&nbsp;<input type="radio" class="radio" name="sr" value="topics" /> <span class="genmed">{L_TOPICS}</span></td>
</tr>
<tr>
- <td class="row1" width="25%"><b class="genmed">{L_RESULT_DAYS}: </b></td>
+ <td class="row1" width="25%"><b class="genmed">{L_RESULT_DAYS}{L_COLON} </b></td>
<td class="row2" width="25%" nowrap="nowrap">{S_SELECT_SORT_DAYS}</td>
- <td class="row1" nowrap="nowrap"><b class="genmed">{L_RETURN_FIRST}: </b></td>
+ <td class="row1" nowrap="nowrap"><b class="genmed">{L_RETURN_FIRST}{L_COLON} </b></td>
<td class="row2" nowrap="nowrap"><select name="ch">{S_CHARACTER_OPTIONS}</select> <span class="genmed">{L_POST_CHARACTERS}</span></td>
</tr>
+ <!-- EVENT search_body_search_display_options_append -->
+ <!-- EVENT search_body_search_options_after -->
<tr>
- <td class="cat" colspan="4" align="center">{S_HIDDEN_FIELDS}<input class="btnmain" name="submit" type="submit" value="{L_SEARCH}" />&nbsp;&nbsp;<input class="btnlite" type="reset" value="{L_RESET}" /></td>
+ <td class="cat" colspan="{$COLSPAN}" align="center">{S_HIDDEN_FIELDS}<input class="btnmain" name="submit" type="submit" value="{L_SEARCH}" />&nbsp;&nbsp;<input class="btnlite" type="reset" value="{L_RESET}" /></td>
</tr>
</table>
</form>
+ <!-- EVENT search_body_form_after -->
<br clear="all" />
+ <!-- EVENT search_body_recent_search_before -->
<!-- IF .recentsearch -->
<table class="tablebg" width="100%" cellspacing="1">
<tr>
@@ -66,6 +80,7 @@
<br clear="all" />
<!-- ENDIF -->
+ <!-- EVENT search_body_recent_search_after -->
</div>
diff --git a/phpBB/styles/subsilver2/template/search_results.html b/phpBB/styles/subsilver2/template/search_results.html
index a6c30f97b2..1ba8af7fe2 100644
--- a/phpBB/styles/subsilver2/template/search_results.html
+++ b/phpBB/styles/subsilver2/template/search_results.html
@@ -1,5 +1,7 @@
<!-- INCLUDE overall_header.html -->
+<!-- EVENT search_results_header_before -->
+
<form method="post" action="{S_SEARCH_ACTION}">
<table width="100%" cellspacing="1">
@@ -7,11 +9,13 @@
<td colspan="2"><span class="titles"><!-- IF SEARCH_TITLE -->{SEARCH_TITLE}<!-- ELSE -->{SEARCH_MATCHES}<!-- ENDIF --></span><br /></td>
</tr>
<tr>
- <td class="genmed"><!-- IF SEARCH_TOPIC -->{L_SEARCHED_TOPIC}: <a href="{U_SEARCH_TOPIC}"><b>{SEARCH_TOPIC}</b></a><br /><!-- ENDIF --><!-- IF SEARCH_WORDS -->{L_SEARCHED_FOR}: <a href="{U_SEARCH_WORDS}"><b>{SEARCH_WORDS}</b></a><!-- ENDIF --><!-- IF IGNORED_WORDS --> {L_IGNORED_TERMS}: <b>{IGNORED_WORDS}</b><!-- ENDIF --></td>
- <td align="{S_CONTENT_FLOW_END}"><!-- IF SEARCH_IN_RESULTS --><span class="genmed">{L_SEARCH_IN_RESULTS}: </span><input class="post" type="text" name="add_keywords" value="" /> <input class="btnlite" type="submit" name="submit" value="{L_GO}" /><!-- ENDIF --></td>
+ <td class="genmed"><!-- IF SEARCH_TOPIC -->{L_SEARCHED_TOPIC}{L_COLON} <a href="{U_SEARCH_TOPIC}"><b>{SEARCH_TOPIC}</b></a><br /><!-- ENDIF --><!-- IF SEARCH_WORDS -->{L_SEARCHED_FOR}{L_COLON} <a href="{U_SEARCH_WORDS}"><b>{SEARCH_WORDS}</b></a><!-- ENDIF --><!-- IF IGNORED_WORDS --> {L_IGNORED_TERMS}{L_COLON} <b>{IGNORED_WORDS}</b><!-- ENDIF --></td>
+ <td align="{S_CONTENT_FLOW_END}"><!-- EVENT search_results_searchbox_after --><!-- IF SEARCH_IN_RESULTS --><span class="genmed">{L_SEARCH_IN_RESULTS}{L_COLON} </span><input class="post" type="text" name="add_keywords" value="" /> <input class="btnlite" type="submit" name="submit" value="{L_GO}" /><!-- ENDIF --></td>
</tr>
</table>
+<!-- EVENT search_results_header_after -->
+
<br clear="all" />
<!-- IF S_SHOW_TOPICS -->
@@ -26,6 +30,7 @@
<th nowrap="nowrap">&nbsp;{L_LAST_POST}&nbsp;</th>
</tr>
<!-- BEGIN searchresults -->
+ <!-- EVENT search_results_topic_before -->
<tr valign="middle">
<td class="row1" width="25" align="center">{searchresults.TOPIC_FOLDER_IMG}</td>
<td class="row1" width="25" align="center">
@@ -34,22 +39,33 @@
<!-- ENDIF -->
</td>
<td class="row1">
- <!-- IF searchresults.S_UNREAD_TOPIC --><a href="{searchresults.U_NEWEST_POST}">{NEWEST_POST_IMG}</a><!-- ENDIF -->
+ <!-- EVENT topiclist_row_prepend -->
+ <!-- IF searchresults.S_UNREAD_TOPIC --><a href="{searchresults.U_NEWEST_POST}" class="imageset">{NEWEST_POST_IMG}</a><!-- ENDIF -->
{searchresults.ATTACH_ICON_IMG} <a href="{searchresults.U_VIEW_TOPIC}" class="topictitle">{searchresults.TOPIC_TITLE}</a>
<!-- IF searchresults.S_TOPIC_UNAPPROVED or searchresults.S_POSTS_UNAPPROVED -->
- <a href="{searchresults.U_MCP_QUEUE}">{searchresults.UNAPPROVED_IMG}</a>&nbsp;
+ <a href="{searchresults.U_MCP_QUEUE}" class="imageset">{searchresults.UNAPPROVED_IMG}</a>&nbsp;
<!-- ENDIF -->
- <!-- IF searchresults.S_TOPIC_REPORTED -->
- <a href="{searchresults.U_MCP_REPORT}">{REPORTED_IMG}</a>&nbsp;
+ <!-- IF searchresults.S_TOPIC_DELETED -->
+ <a href="{searchresults.U_MCP_QUEUE}" class="imageset">{DELETED_IMG}</a>&nbsp;
<!-- ENDIF -->
- <!-- IF searchresults.PAGINATION -->
- <p class="gensmall"> [ {GOTO_PAGE_IMG}{L_GOTO_PAGE}: {searchresults.PAGINATION} ] </p>
+ <!-- IF searchresults.S_TOPIC_REPORTED -->
+ <a href="{searchresults.U_MCP_REPORT}" class="imageset">{REPORTED_IMG}</a>&nbsp;
<!-- ENDIF -->
- <!-- IF searchresults.S_TOPIC_GLOBAL -->
- <p class="gensmall">{L_GLOBAL}</p>
- <!-- ELSE -->
- <p class="gensmall">{L_IN} <a href="{searchresults.U_VIEW_FORUM}">{searchresults.FORUM_TITLE}</a></p>
+ <!-- EVENT topiclist_row_topic_title_after -->
+ <!-- IF .searchresults.pagination -->
+ <p class="gensmall"> [ {GOTO_PAGE_IMG}{L_GOTO_PAGE}{L_COLON}
+ <!-- BEGIN pagination -->
+ <!-- IF searchresults.pagination.S_IS_PREV -->
+ <!-- ELSEIF searchresults.pagination.S_IS_CURRENT --><strong>{searchresults.pagination.PAGE_NUMBER}</strong>
+ <!-- ELSEIF searchresults.pagination.S_IS_ELLIPSIS --> {L_ELLIPSIS}
+ <!-- ELSEIF searchresults.pagination.S_IS_NEXT -->
+ <!-- ELSE --><a href="{searchresults.pagination.PAGE_URL}">{searchresults.pagination.PAGE_NUMBER}</a>
+ <!-- ENDIF -->
+ <!-- END pagination -->
+ ] </p>
<!-- ENDIF -->
+ <p class="gensmall">{L_IN} <a href="{searchresults.U_VIEW_FORUM}">{searchresults.FORUM_TITLE}</a></p>
+ <!-- EVENT topiclist_row_append -->
</td>
<td class="row2" width="100" align="center"><p class="topicauthor">{searchresults.TOPIC_AUTHOR_FULL}</p></td>
<td class="row1" width="50" align="center"><p class="topicdetails">{searchresults.TOPIC_REPLIES}</p></td>
@@ -57,17 +73,18 @@
<td class="row1" width="120" align="center">
<p class="topicdetails">{searchresults.LAST_POST_TIME}</p>
<p class="topicdetails">{searchresults.LAST_POST_AUTHOR_FULL}
- <a href="{searchresults.U_LAST_POST}">{LAST_POST_IMG}</a>
+ <a href="{searchresults.U_LAST_POST}" class="imageset">{LAST_POST_IMG}</a>
</p>
</td>
</tr>
+ <!-- EVENT search_results_topic_after -->
<!-- BEGINELSE -->
<tr valign="middle">
<td colspan="7" class="row3" align="center">{L_NO_SEARCH_RESULTS}</td>
</tr>
<!-- END searchresults -->
<tr>
- <td class="cat" colspan="7" valign="middle" align="center"><!-- IF S_SELECT_SORT_DAYS or S_SELECT_SORT_KEY --><span class="gensmall">{L_DISPLAY_POSTS}:</span> {S_SELECT_SORT_DAYS}<!-- IF S_SELECT_SORT_KEY -->&nbsp;<span class="gensmall">{L_SORT_BY}:</span> {S_SELECT_SORT_KEY} {S_SELECT_SORT_DIR}<!-- ENDIF -->&nbsp;<input class="btnlite" type="submit" value="{L_GO}" name="sort" /><!-- ENDIF --></td>
+ <td class="cat" colspan="7" valign="middle" align="center"><!-- IF S_SELECT_SORT_DAYS or S_SELECT_SORT_KEY --><span class="gensmall">{L_DISPLAY_POSTS}{L_COLON}</span> {S_SELECT_SORT_DAYS}<!-- IF S_SELECT_SORT_KEY -->&nbsp;<span class="gensmall">{L_SORT_BY}{L_COLON}</span> {S_SELECT_SORT_KEY} {S_SELECT_SORT_DIR}<!-- ENDIF -->&nbsp;<input class="btnlite" type="submit" value="{L_GO}" name="sort" /><!-- ENDIF --></td>
</tr>
</table>
@@ -81,10 +98,11 @@
<!-- BEGIN searchresults -->
<tr class="row2">
+ <!-- EVENT search_results_post_before -->
<!-- IF searchresults.S_IGNORE_POST -->
<td class="gensmall" colspan="2" height="25" align="center">{searchresults.L_IGNORE_POST}</td>
<!-- ELSE -->
- <td colspan="2" height="25"><p class="topictitle"><a name="p{searchresults.POST_ID}" id="p{searchresults.POST_ID}"></a>&nbsp;<!-- IF searchresults.FORUM_TITLE -->{L_FORUM}: <a href="{searchresults.U_VIEW_FORUM}">{searchresults.FORUM_TITLE}</a><!-- ELSE -->{L_GLOBAL}<!-- ENDIF --> &nbsp; {L_TOPIC}: <a href="{searchresults.U_VIEW_TOPIC}">{searchresults.TOPIC_TITLE}</a> </p></td>
+ <td colspan="2" height="25"><p class="topictitle"><a name="p{searchresults.POST_ID}" id="p{searchresults.POST_ID}" class="anchor"></a>&nbsp;{L_FORUM}{L_COLON} <a href="{searchresults.U_VIEW_FORUM}">{searchresults.FORUM_TITLE}</a> &nbsp; {L_TOPIC}{L_COLON} <a href="{searchresults.U_VIEW_TOPIC}">{searchresults.TOPIC_TITLE}</a> </p></td>
</tr>
<tr class="row1">
<td width="150" align="center" valign="middle"><b class="postauthor">{searchresults.POST_AUTHOR_FULL}</b></td>
@@ -94,19 +112,19 @@
<td class="gensmall">
<div style="float: {S_CONTENT_FLOW_BEGIN};">
<!-- IF searchresults.POST_SUBJECT neq "" -->
- &nbsp;<b>{L_POST_SUBJECT}:</b> <a href="{searchresults.U_VIEW_POST}">{searchresults.POST_SUBJECT}</a>
+ &nbsp;<b>{L_POST_SUBJECT}{L_COLON}</b> <a href="{searchresults.U_VIEW_POST}">{searchresults.POST_SUBJECT}</a>
<!-- ELSE -->
[ <a href="{searchresults.U_VIEW_POST}">{L_JUMP_TO_POST}</a> ]
<!-- ENDIF -->
</div>
- <div style="float: {S_CONTENT_FLOW_END};"><b>{L_POSTED}:</b> {searchresults.POST_DATE}&nbsp;</div>
+ <div style="float: {S_CONTENT_FLOW_END};"><b>{L_POSTED}{L_COLON}</b> {searchresults.POST_DATE}&nbsp;</div>
</td>
</tr>
</table>
</td>
</tr>
<tr class="row1">
- <td width="150" align="center" valign="top"><br /><span class="postdetails">{L_REPLIES}: <b>{searchresults.TOPIC_REPLIES}</b><br />{L_VIEWS}: <b>{searchresults.TOPIC_VIEWS}</b></span><br /><br /></td>
+ <td width="150" align="center" valign="top"><br /><span class="postdetails">{L_REPLIES}{L_COLON} <b>{searchresults.TOPIC_REPLIES}</b><br />{L_VIEWS}{L_COLON} <b>{searchresults.TOPIC_VIEWS}</b></span><br /><br /></td>
<td valign="top">
<table width="100%" cellspacing="5">
<tr>
@@ -116,6 +134,7 @@
</td>
</tr>
<!-- ENDIF -->
+ <!-- EVENT search_results_post_after -->
<tr>
<td class="spacer" colspan="2"><img src="images/spacer.gif" height="1" alt="" /></td>
</tr>
@@ -125,7 +144,7 @@
</tr>
<!-- END searchresults -->
<tr>
- <td class="cat" colspan="2" align="center"><!-- IF S_SELECT_SORT_KEY --><span class="gensmall">{L_SORT_BY}:</span> {S_SELECT_SORT_KEY} {S_SELECT_SORT_DIR}&nbsp;<input class="btnlite" type="submit" name="sort" value="{L_GO}" /><!-- ENDIF --></td>
+ <td class="cat" colspan="2" align="center"><!-- IF S_SELECT_SORT_KEY --><span class="gensmall">{L_SORT_BY}{L_COLON}</span> {S_SELECT_SORT_KEY} {S_SELECT_SORT_DIR}&nbsp;<input class="btnlite" type="submit" name="sort" value="{L_GO}" /><!-- ENDIF --></td>
</tr>
</table>
<!-- ENDIF -->
@@ -143,4 +162,4 @@
<div align="{S_CONTENT_FLOW_END}"><!-- INCLUDE jumpbox.html --></div>
-<!-- INCLUDE overall_footer.html --> \ No newline at end of file
+<!-- INCLUDE overall_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/searchbox.html b/phpBB/styles/subsilver2/template/searchbox.html
index 622961c881..49de299ea2 100644
--- a/phpBB/styles/subsilver2/template/searchbox.html
+++ b/phpBB/styles/subsilver2/template/searchbox.html
@@ -1 +1 @@
-<form method="get" name="search" action="{S_SEARCHBOX_ACTION}"><span class="gensmall">{L_SEARCH_FOR}:</span> <input class="post" type="text" name="keywords" size="20" /> <input class="btnlite" type="submit" value="{L_GO}" />{S_SEARCH_LOCAL_HIDDEN_FIELDS}</form>
+<form method="get" name="search" action="{S_SEARCHBOX_ACTION}"><span class="gensmall">{L_SEARCH_FOR}{L_COLON}</span> <input class="post" type="text" name="keywords" size="20" /> <input class="btnlite" type="submit" value="{L_GO}" />{S_SEARCH_LOCAL_HIDDEN_FIELDS}</form>
diff --git a/phpBB/styles/subsilver2/template/simple_footer.html b/phpBB/styles/subsilver2/template/simple_footer.html
index 6cb4f401da..d69c56fb8c 100644
--- a/phpBB/styles/subsilver2/template/simple_footer.html
+++ b/phpBB/styles/subsilver2/template/simple_footer.html
@@ -5,5 +5,11 @@
<span class="copyright">{CREDIT_LINE}</span>
</div>
+<script type="text/javascript" src="{T_JQUERY_LINK}"></script>
+<!-- IF S_ALLOW_CDN --><script type="text/javascript">window.jQuery || document.write(unescape('%3Cscript src="{T_ASSETS_PATH}/javascript/jquery.min.js?assets_version={T_ASSETS_VERSION}" type="text/javascript"%3E%3C/script%3E'));</script><!-- ENDIF -->
+
+<!-- EVENT simple_footer_after -->
+
+{$SCRIPTS}
</body>
-</html> \ No newline at end of file
+</html>
diff --git a/phpBB/styles/subsilver2/template/simple_header.html b/phpBB/styles/subsilver2/template/simple_header.html
index b0dc908bc6..2beeac2548 100644
--- a/phpBB/styles/subsilver2/template/simple_header.html
+++ b/phpBB/styles/subsilver2/template/simple_header.html
@@ -1,21 +1,23 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" dir="{S_CONTENT_DIRECTION}" lang="{S_USER_LANG}" xml:lang="{S_USER_LANG}">
+<!DOCTYPE html>
+<html dir="{S_CONTENT_DIRECTION}" lang="{S_USER_LANG}">
<head>
-
-<meta http-equiv="content-type" content="text/html; charset={S_CONTENT_ENCODING}" />
-<meta http-equiv="content-language" content="{S_USER_LANG}" />
-<meta http-equiv="content-style-type" content="text/css" />
-<meta http-equiv="imagetoolbar" content="no" />
-<meta name="resource-type" content="document" />
-<meta name="distribution" content="global" />
-<meta name="keywords" content="" />
-<meta name="description" content="" />
+<meta charset="utf-8" />
+<meta http-equiv="X-UA-Compatible" content="IE=edge">
{META}
<title>{SITENAME} &bull; <!-- IF S_IN_MCP -->{L_MCP} &bull; <!-- ELSEIF S_IN_UCP -->{L_UCP} &bull; <!-- ENDIF -->{PAGE_TITLE}</title>
<link rel="stylesheet" href="{T_STYLESHEET_LINK}" type="text/css" />
+<link rel="stylesheet" href="{T_STYLESHEET_LANG_LINK}" type="text/css" />
+
+<!-- EVENT simple_header_head_append -->
+
+{$STYLESHEETS}
+
+<!-- EVENT simple_header_stylesheets_after -->
+
</head>
-<body class="{S_CONTENT_DIRECTION}">
-<a name="top"></a>
-<div id="wrapcentre"> \ No newline at end of file
+<body class="{S_CONTENT_DIRECTION} {BODY_CLASS}">
+<!-- EVENT simple_header_body_before -->
+<a name="top" class="anchor"></a>
+<div id="wrapcentre">
diff --git a/phpBB/styles/subsilver2/template/template.cfg b/phpBB/styles/subsilver2/template/template.cfg
deleted file mode 100644
index 0e89de0085..0000000000
--- a/phpBB/styles/subsilver2/template/template.cfg
+++ /dev/null
@@ -1,27 +0,0 @@
-#
-# phpBB Template Configuration File
-#
-# @package phpBB3
-# @copyright (c) 2005 phpBB Group
-# @license http://opensource.org/licenses/gpl-license.php GNU Public License
-#
-#
-# At the left is the name, please do not change this
-# At the right the value is entered
-# For on/off options the valid values are on, off, 1, 0, true and false
-#
-# Values get trimmed, if you want to add a space in front or at the end of
-# the value, then enclose the value with single or double quotes.
-# Single and double quotes do not need to be escaped.
-#
-#
-
-# General Information about this template
-name = subsilver2
-copyright = &copy; phpBB Group, 2003
-version = 3.0.14
-
-# Template inheritance
-# See http://blog.phpbb.com/2008/07/31/templating-just-got-easier/
-# Set value to empty to ignore template inheritance
-inherit_from = subsilver2
diff --git a/phpBB/styles/subsilver2/template/timezone.js b/phpBB/styles/subsilver2/template/timezone.js
new file mode 100644
index 0000000000..c5829c0bb1
--- /dev/null
+++ b/phpBB/styles/subsilver2/template/timezone.js
@@ -0,0 +1,21 @@
+(function($) { // Avoid conflicts with other libraries
+
+"use strict";
+
+$('#tz_date').change(function() {
+ phpbb.timezoneSwitchDate(false);
+});
+
+$('#tz_select_date_suggest').click(function(){
+ phpbb.timezonePreselectSelect(true);
+});
+
+$(document).ready(
+ phpbb.timezoneEnableDateSelection
+);
+
+$(document).ready(
+ phpbb.timezonePreselectSelect($('#tz_select_date_suggest').attr('timezone-preselect') == 'true')
+);
+
+})(jQuery); // Avoid conflicts with other libraries
diff --git a/phpBB/styles/subsilver2/template/timezone_option.html b/phpBB/styles/subsilver2/template/timezone_option.html
new file mode 100644
index 0000000000..3fc7467d16
--- /dev/null
+++ b/phpBB/styles/subsilver2/template/timezone_option.html
@@ -0,0 +1,28 @@
+<tr>
+ <td class="row1" width="50%"><b class="genmed">{L_BOARD_TIMEZONE}{L_COLON}</b></td>
+ <td class="row2">
+ <!-- IF .timezone_date -->
+ <div id="tz_select_date" style="display: none;">
+ <select name="tz_date" id="tz_date" class="autowidth tz_select">
+ <option value="">{L_SELECT_CURRENT_TIME}</option>
+ <!-- BEGIN timezone_date -->
+ <option value="{timezone_date.VALUE}"<!-- IF timezone_date.SELECTED --> selected="selected"<!-- ENDIF -->>{timezone_date.TITLE}</option>
+ <!-- END timezone_date -->
+ </select><br />
+ <input type="button" id="tz_select_date_suggest" class="btnlite" style="display: none;" timezone-preselect="<!-- IF S_TZ_PRESELECT -->true<!-- ELSE -->false<!-- ENDIF -->" data-l-suggestion="{L_TIMEZONE_DATE_SUGGESTION}" value="{L_TIMEZONE_DATE_SUGGESTION}" />
+ </div>
+ <!-- ENDIF -->
+ <select name="tz" id="timezone" class="autowidth tz_select">
+ <option value="">{L_SELECT_TIMEZONE}</option>
+ <!-- BEGIN timezone_select -->
+ <optgroup label="{timezone_select.LABEL}" data-tz-value="{timezone_select.VALUE}">
+ <!-- BEGIN timezone_options -->
+ <option title="{timezone_select.timezone_options.TITLE}" value="{timezone_select.timezone_options.VALUE}"<!-- IF timezone_select.timezone_options.SELECTED --> selected="selected"<!-- ENDIF -->>{timezone_select.timezone_options.LABEL}</option>
+ <!-- END timezone_options -->
+ </optgroup>
+ <!-- END timezone_select -->
+ </select>
+
+ <!-- INCLUDEJS timezone.js -->
+ </td>
+</tr>
diff --git a/phpBB/styles/subsilver2/template/ucp_agreement.html b/phpBB/styles/subsilver2/template/ucp_agreement.html
index d5420f66a6..fca7eb2368 100644
--- a/phpBB/styles/subsilver2/template/ucp_agreement.html
+++ b/phpBB/styles/subsilver2/template/ucp_agreement.html
@@ -10,6 +10,7 @@
*/
function change_language(lang_iso)
{
+ document.cookie = '{COOKIE_NAME}_lang=' + lang_iso + '; path={COOKIE_PATH}';
document.forms['register'].change_lang.value = lang_iso;
document.forms['register'].submit();
}
@@ -20,7 +21,7 @@
<form method="post" action="{S_UCP_ACTION}" id="register">
<table width="100%" cellspacing="0">
<tr>
- <td class="gensmall" align="{S_CONTENT_FLOW_END}">{L_LANGUAGE}: <select name="lang" id="lang" onchange="change_language(this.value); return false;" title="{L_LANGUAGE}">{S_LANG_OPTIONS}</select></td>
+ <td class="gensmall" align="{S_CONTENT_FLOW_END}">{L_LANGUAGE}{L_COLON} <select name="lang" id="lang" onchange="change_language(this.value); return false;" title="{L_LANGUAGE}">{S_LANG_OPTIONS}</select></td>
</tr>
</table>
{S_HIDDEN_FIELDS}
@@ -41,7 +42,9 @@
<td class="gen" align="center"><br />{L_COPPA_BIRTHDAY}<br /><br /><a href="{U_COPPA_NO}">{L_COPPA_NO}</a> :: <a href="{U_COPPA_YES}">{L_COPPA_YES}</a><br /><br /></td>
<!-- ELSE -->
<td>
+ <!-- EVENT ucp_agreement_terms_before -->
<span class="genmed"><br />{L_TERMS_OF_USE}<br /><br /></span>
+ <!-- EVENT ucp_agreement_terms_after -->
<div align="center">
<input class="btnlite" type="submit" id="agreed" name="agreed" value="{L_AGREE}" /><br /><br />
<input class="btnlite" type="submit" name="not_agreed" value="{L_NOT_AGREE}" />
diff --git a/phpBB/styles/subsilver2/template/ucp_attachments.html b/phpBB/styles/subsilver2/template/ucp_attachments.html
index 35dcd33ac4..c513f933c0 100644
--- a/phpBB/styles/subsilver2/template/ucp_attachments.html
+++ b/phpBB/styles/subsilver2/template/ucp_attachments.html
@@ -17,7 +17,7 @@
<table width="100%" cellspacing="1">
<tr>
<td class="nav" valign="middle" nowrap="nowrap">&nbsp;{PAGE_NUMBER}<br /></td>
- <td class="gensmall" nowrap="nowrap">&nbsp;[ {TOTAL_ATTACHMENTS} ]&nbsp;</td>
+ <td class="gensmall" nowrap="nowrap">&nbsp;[ {NUM_ATTACHMENTS} ]&nbsp;</td>
<td class="gensmall" width="100%" align="{S_CONTENT_FLOW_END}" nowrap="nowrap"><!-- INCLUDE pagination.html --></td>
</tr>
</table>
@@ -28,7 +28,7 @@
<!-- IF attachrow.S_ROW_COUNT is even --><tr class="row2"><!-- ELSE --><tr class="row1"><!-- ENDIF -->
<td class="genmed" style="padding: 4px;" align="center" width="2%">&nbsp;{attachrow.ROW_NUMBER}&nbsp;</td>
- <td style="padding: 4px;"><a class="gen" href="{attachrow.U_VIEW_ATTACHMENT}">{attachrow.FILENAME}</a><br /><span class="gensmall"><!-- IF attachrow.S_IN_MESSAGE --><b>{L_PM}: </b><!-- ELSE --><b>{L_TOPIC}: </b><!-- ENDIF --><a href="{attachrow.U_VIEW_TOPIC}">{attachrow.TOPIC_TITLE}</a></span></td>
+ <td style="padding: 4px;"><a class="gen" href="{attachrow.U_VIEW_ATTACHMENT}">{attachrow.FILENAME}</a><br /><span class="gensmall"><!-- IF attachrow.S_IN_MESSAGE --><b>{L_PM}{L_COLON} </b><!-- ELSE --><b>{L_TOPIC}{L_COLON} </b><!-- ENDIF --><a href="{attachrow.U_VIEW_TOPIC}">{attachrow.TOPIC_TITLE}</a></span></td>
<td class="gensmall" style="padding: 4px;" align="center" valign="middle" nowrap="nowrap">&nbsp;{attachrow.POST_TIME}&nbsp;</td>
<td class="genmed" style="padding: 4px;" align="center" valign="middle" nowrap="nowrap">{attachrow.SIZE}</td>
<td class="genmed" style="padding: 4px;" align="center">{attachrow.DOWNLOAD_COUNT}</td>
@@ -36,7 +36,7 @@
</tr>
<!-- END attachrow -->
<tr>
- <td class="cat" colspan="6"><div style="float: {S_CONTENT_FLOW_BEGIN};"><span class="gensmall">{L_SORT_BY}: </span><select name="sk">{S_SORT_OPTIONS}</select> <select name="sd">{S_ORDER_SELECT}</select>&nbsp;<input class="btnlite" type="submit" name="sort" value="{L_SORT}" /></div><div style="float: {S_CONTENT_FLOW_END};"><input class="btnlite" type="submit" name="delete" value="{L_DELETE_MARKED}" />&nbsp;</div></td>
+ <td class="cat" colspan="6"><div style="float: {S_CONTENT_FLOW_BEGIN};"><span class="gensmall">{L_SORT_BY}{L_COLON} </span><select name="sk">{S_SORT_OPTIONS}</select> <select name="sd">{S_ORDER_SELECT}</select>&nbsp;<input class="btnlite" type="submit" name="sort" value="{L_SORT}" /></div><div style="float: {S_CONTENT_FLOW_END};"><input class="btnlite" type="submit" name="delete" value="{L_DELETE_MARKED}" />&nbsp;</div></td>
</tr>
</table>
@@ -55,4 +55,4 @@
<!-- ENDIF -->
-<!-- INCLUDE ucp_footer.html --> \ No newline at end of file
+<!-- INCLUDE ucp_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/ucp_auth_link.html b/phpBB/styles/subsilver2/template/ucp_auth_link.html
new file mode 100644
index 0000000000..75e3133fcf
--- /dev/null
+++ b/phpBB/styles/subsilver2/template/ucp_auth_link.html
@@ -0,0 +1,19 @@
+<!-- INCLUDE ucp_header.html -->
+
+<table class="tablebg" width="100%" cellspacing="1">
+ <tr>
+ <th colspan="4">{L_UCP_AUTH_LINK_TITLE}</th>
+ </tr>
+
+ <!-- IF ERROR -->
+ <tr>
+ <td class="row1" colspan="2" align="center"><span class="genmed error">{ERROR}</span></td>
+ </tr>
+ <!-- ENDIF -->
+
+ <!-- IF PROVIDER_TEMPLATE_FILE -->
+ <!-- INCLUDE {PROVIDER_TEMPLATE_FILE} -->
+ <!-- ENDIF -->
+</table>
+
+<!-- INCLUDE ucp_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/ucp_auth_link_oauth.html b/phpBB/styles/subsilver2/template/ucp_auth_link_oauth.html
new file mode 100644
index 0000000000..80564d207b
--- /dev/null
+++ b/phpBB/styles/subsilver2/template/ucp_auth_link_oauth.html
@@ -0,0 +1,34 @@
+<!-- BEGIN oauth -->
+ <tr>
+ <th>{oauth.SERVICE_NAME}</th>
+ </tr>
+
+ <tr>
+ <td class="row1">
+ <form id="ucp" method="post" action="{S_UCP_ACTION}">
+ <table>
+ <!-- IF oauth.UNIQUE_ID -->
+ <tr>
+ <td class="row1">{L_UCP_AUTH_LINK_ID}{L_COLON}</td>
+ <td class="row1">{oauth.UNIQUE_ID}</td>
+ </tr>
+ <tr>
+ <td class="row1">&nbsp;</td>
+ <td class="row1"><input type="submit" name="submit" tabindex="6" value="{L_UCP_AUTH_LINK_UNLINK}" class="button1" /></td>
+ </tr>
+ <!-- ELSE -->
+ <tr>
+ <td class="row1">{L_UCP_AUTH_LINK_ASK}</td>
+ </tr>
+ <tr>
+ <td class="row1"><input type="submit" name="submit" tabindex="6" value="{L_UCP_AUTH_LINK_LINK}" class="button1" /></td>
+ </tr>
+ <!-- ENDIF -->
+ </table>
+ {oauth.HIDDEN_FIELDS}
+ {S_HIDDEN_FIELDS}
+ {S_FORM_TOKEN}
+ </form>
+ </td>
+ </tr>
+<!-- END oauth -->
diff --git a/phpBB/styles/subsilver2/template/ucp_avatar_options_gravatar.html b/phpBB/styles/subsilver2/template/ucp_avatar_options_gravatar.html
new file mode 100644
index 0000000000..9fb3f0e754
--- /dev/null
+++ b/phpBB/styles/subsilver2/template/ucp_avatar_options_gravatar.html
@@ -0,0 +1,13 @@
+<table class="tablebg" width="100%" cellspacing="1">
+ <tr>
+ <td class="row1" width="35%"><b class="genmed">{L_GRAVATAR_AVATAR_EMAIL}{L_COLON}</b><br /><span class="gensmall">{L_GRAVATAR_AVATAR_EMAIL_EXPLAIN}</span></td>
+ <td class="row2"><input type="text" name="avatar_gravatar_email" id="avatar_gravatar_email" value="{AVATAR_GRAVATAR_EMAIL}" class="inputbox" /></td>
+ </tr>
+ <tr>
+ <td class="row1" width="35%"><b class="genmed">{L_GRAVATAR_AVATAR_SIZE}{L_COLON}</b><br /><span class="gensmall">{L_GRAVATAR_AVATAR_SIZE_EXPLAIN}</span></td>
+ <td class="row2">
+ <input type="number" name="avatar_gravatar_width" id="avatar_gravatar_width" min="{AVATAR_MIN_WIDTH}" max="{AVATAR_MAX_WIDTH}" value="{AVATAR_GRAVATAR_WIDTH}" class="inputbox autowidth" /> {L_PIXEL} &times;&nbsp;
+ <input type="number" name="avatar_gravatar_height" id="avatar_gravatar_height" min="{AVATAR_MIN_HEIGHT}" max="{AVATAR_MAX_HEIGHT}" value="{AVATAR_GRAVATAR_HEIGHT}" class="inputbox autowidth" /> {L_PIXEL}
+ </td>
+ </tr>
+</table>
diff --git a/phpBB/styles/subsilver2/template/ucp_avatar_options_local.html b/phpBB/styles/subsilver2/template/ucp_avatar_options_local.html
new file mode 100644
index 0000000000..921126ba22
--- /dev/null
+++ b/phpBB/styles/subsilver2/template/ucp_avatar_options_local.html
@@ -0,0 +1,42 @@
+<table class="tablebg" width="100%" cellspacing="1">
+ <!-- IF .avatar_local_cats -->
+ <tr>
+ <td class="cat" colspan="2" align="center" valign="middle"><span class="genmed">{L_AVATAR_CATEGORY}{L_COLON} </span><select name="avatar_local_cat" id="category">
+ <!-- BEGIN avatar_local_cats -->
+ <option value="{avatar_local_cats.NAME}"<!-- IF avatar_local_cats.SELECTED --> selected="selected"<!-- ENDIF -->>{avatar_local_cats.NAME}</option>
+ <!-- END avatar_local_cats -->
+ </select>&nbsp; <input class="btnlite" tabindex="0" type="submit" value="{L_GO}" name="avatar_local_go" />
+ </td>
+ </tr>
+ <tr>
+ <td class="row1" colspan="2" align="center">
+ <table cellspacing="1" cellpadding="4" border="0">
+ <!-- BEGIN avatar_local_row -->
+ <tr>
+ <!-- BEGIN avatar_local_col -->
+ <td class="row1" align="center" id="av-{avatar_local_row.S_ROW_COUNT}-{avatar_local_row.avatar_local_col.S_ROW_COUNT}"><img src="{avatar_local_row.avatar_local_col.AVATAR_IMAGE}" alt="{avatar_local_row.avatar_local_col.AVATAR_NAME}" title="{avatar_local_row.avatar_local_col.AVATAR_NAME}" /></td>
+ <!-- END avatar_local_col -->
+ </tr>
+ <tr>
+ <!-- BEGIN avatar_local_option -->
+ <td class="row2" align="center"><input type="radio" class="radio" name="avatar_local_file"
+ id="av-{avatar_local_row.S_ROW_COUNT}-{avatar_local_row.avatar_local_col.S_ROW_COUNT}"
+ value="{avatar_local_row.avatar_local_option.S_OPTIONS_AVATAR}"
+ <!-- IF avatar_local_row.avatar_local_option.CHECKED --> checked="checked"<!-- ENDIF --> />
+ </td>
+ <!-- END avatar_local_option -->
+ </tr>
+ <!-- BEGINELSE -->
+ <tr>
+ <td class="row1" colspan="2">{L_NO_AVATAR_CATEGORY}</td>
+ </tr>
+ <!-- END avatar_local_row -->
+ </table>
+ </td>
+ </tr>
+ <!-- ELSE -->
+ <tr>
+ <td class="row1" colspan="2"><strong>{L_NO_AVATARS}</strong></td>
+ </tr>
+ <!-- ENDIF -->
+</table>
diff --git a/phpBB/styles/subsilver2/template/ucp_avatar_options_remote.html b/phpBB/styles/subsilver2/template/ucp_avatar_options_remote.html
new file mode 100644
index 0000000000..309b3f9836
--- /dev/null
+++ b/phpBB/styles/subsilver2/template/ucp_avatar_options_remote.html
@@ -0,0 +1,10 @@
+<table class="tablebg" width="100%" cellspacing="1">
+ <tr>
+ <td class="row1" width="35%"><b class="genmed">{L_LINK_REMOTE_AVATAR}{L_COLON} </b><br /><span class="gensmall">{L_LINK_REMOTE_AVATAR_EXPLAIN}</span></td>
+ <td class="row2"><input class="post" type="text" name="avatar_remote_url" size="40" value="{AVATAR_REMOTE_URL}" /></td>
+ </tr>
+ <tr>
+ <td class="row1" width="35%"><b class="genmed">{L_LINK_REMOTE_SIZE}{L_COLON} </b><br /><span class="gensmall">{L_LINK_REMOTE_SIZE_EXPLAIN}</span></td>
+ <td class="row2"><input class="post" type="number" name="avatar_remote_width" min="{AVATAR_MIN_WIDTH}" max="{AVATAR_MAX_WIDTH}" value="{AVATAR_REMOTE_WIDTH}" /> <span class="gen">{L_PIXEL} &times; </span> <input class="post" type="number" name="avatar_remote_height" min="{AVATAR_MIN_HEIGHT}" max="{AVATAR_MAX_HEIGHT}" value="{AVATAR_REMOTE_HEIGHT}" /> <span class="gen">{L_PIXEL}</span></td>
+ </tr>
+</table>
diff --git a/phpBB/styles/subsilver2/template/ucp_avatar_options_upload.html b/phpBB/styles/subsilver2/template/ucp_avatar_options_upload.html
new file mode 100644
index 0000000000..6b813baeaa
--- /dev/null
+++ b/phpBB/styles/subsilver2/template/ucp_avatar_options_upload.html
@@ -0,0 +1,12 @@
+<table class="tablebg" width="100%" cellspacing="1">
+ <tr>
+ <td class="row1" width="35%"><b class="genmed">{L_UPLOAD_AVATAR_FILE}{L_COLON} </b></td>
+ <td class="row2"><input type="hidden" name="MAX_FILE_SIZE" value="{AVATAR_SIZE}" /><input class="post" type="file" name="avatar_upload_file" /></td>
+ </tr>
+<!-- IF S_UPLOAD_AVATAR_URL -->
+ <tr>
+ <td class="row1" width="35%"><b class="genmed">{L_UPLOAD_AVATAR_URL}{L_COLON} </b><br /><span class="gensmall">{L_UPLOAD_AVATAR_URL_EXPLAIN}</span></td>
+ <td class="row2"><input class="post" type="text" name="avatar_upload_url" size="40" value="" /></td>
+ </tr>
+<!-- ENDIF -->
+</table>
diff --git a/phpBB/styles/subsilver2/template/ucp_footer.html b/phpBB/styles/subsilver2/template/ucp_footer.html
index 1681fe3849..57adb2da97 100644
--- a/phpBB/styles/subsilver2/template/ucp_footer.html
+++ b/phpBB/styles/subsilver2/template/ucp_footer.html
@@ -10,4 +10,4 @@
<div align="{S_CONTENT_FLOW_END}"><!-- INCLUDE jumpbox.html --></div>
-<!-- INCLUDE overall_footer.html --> \ No newline at end of file
+<!-- INCLUDE overall_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/ucp_groups_manage.html b/phpBB/styles/subsilver2/template/ucp_groups_manage.html
index 51e60c8b69..09d59c8ec0 100644
--- a/phpBB/styles/subsilver2/template/ucp_groups_manage.html
+++ b/phpBB/styles/subsilver2/template/ucp_groups_manage.html
@@ -21,18 +21,18 @@
<th colspan="2">{L_GROUP_DETAILS}</th>
</tr>
<tr>
- <td class="row1" width="35%"><label<!-- IF not S_SPECIAL_GROUP --> for="group_name"<!-- ENDIF -->>{L_GROUP_NAME}:</label></td>
+ <td class="row1" width="35%"><label<!-- IF not S_SPECIAL_GROUP --> for="group_name"<!-- ENDIF -->>{L_GROUP_NAME}{L_COLON}</label></td>
<td class="row2"><!-- IF S_SPECIAL_GROUP --><b<!-- IF GROUP_COLOUR --> style="color: #{GROUP_COLOUR};"<!-- ENDIF -->>{GROUP_NAME}</b><!-- ENDIF --><input name="group_name" type="<!-- IF S_SPECIAL_GROUP -->hidden<!-- ELSE -->text<!-- ENDIF -->" id="group_name" value="{GROUP_INTERNAL_NAME}" /></td>
</tr>
<tr>
- <td class="row1" width="35%"><label for="group_desc">{L_GROUP_DESC}:</label></td>
+ <td class="row1" width="35%"><label for="group_desc">{L_GROUP_DESC}{L_COLON}</label></td>
<td class="row2"><textarea id="group_desc" name="group_desc" rows="5" cols="45">{GROUP_DESC}</textarea>
<br /><input type="checkbox" class="radio" name="desc_parse_bbcode"<!-- IF S_DESC_BBCODE_CHECKED --> checked="checked"<!-- ENDIF --> /> {L_PARSE_BBCODE} &nbsp; <input type="checkbox" class="radio" name="desc_parse_smilies"<!-- IF S_DESC_SMILIES_CHECKED --> checked="checked"<!-- ENDIF --> /> {L_PARSE_SMILIES} &nbsp; <input type="checkbox" class="radio" name="desc_parse_urls"<!-- IF S_DESC_URLS_CHECKED --> checked="checked"<!-- ENDIF --> /> {L_PARSE_URLS}
</td>
</tr>
<!-- IF not S_SPECIAL_GROUP -->
<tr>
- <td class="row1" width="35%"><label for="group_type">{L_GROUP_TYPE}:</label><br /><span>{L_GROUP_TYPE_EXPLAIN}</span></td>
+ <td class="row1" width="35%"><label for="group_type">{L_GROUP_TYPE}{L_COLON}</label><br /><span>{L_GROUP_TYPE_EXPLAIN}</span></td>
<td class="row2">
<input name="group_type" type="radio" class="radio" id="group_type" value="{GROUP_TYPE_FREE}"{GROUP_FREE} /> {L_GROUP_OPEN} &nbsp;
<input name="group_type" type="radio" class="radio" value="{GROUP_TYPE_OPEN}"{GROUP_OPEN} /> {L_GROUP_REQUEST} &nbsp;
@@ -48,86 +48,58 @@
<th colspan="2">{L_GROUP_SETTINGS_SAVE}</th>
</tr>
<tr>
- <td class="row1" width="35%"><label for="group_colour">{L_GROUP_COLOR}:</label><br /><span>{L_GROUP_COLOR_EXPLAIN}</span></td>
- <td class="row2"><input name="group_colour" type="text" id="group_colour" value="{GROUP_COLOUR}" size="6" maxlength="6" />&nbsp;&nbsp;<span>[ <a href="{U_SWATCH}" onclick="popup(this.href, 636, 150, '_swatch'); return false;">{L_COLOUR_SWATCH}</a> ]</span></td>
+ <td class="row1" width="35%"><label for="group_colour">{L_GROUP_COLOR}{L_COLON}</label><br /><span>{L_GROUP_COLOR_EXPLAIN}</span></td>
+ <td class="row2">
+ <input name="group_colour" type="text" id="group_colour" value="{GROUP_COLOUR}" size="6" maxlength="6" />&nbsp;&nbsp;
+ <span>[ <a href="#" id="color_palette_toggle">{L_COLOUR_SWATCH}</a> ]</span>
+ <div id="color_palette_placeholder" style="display: none;" data-orientation="h" data-height="12" data-width="15" data-target="#group_colour"></div>
+ </td>
</tr>
<tr>
- <td class="row1" width="35%"><label for="group_rank">{L_GROUP_RANK}:</label></td>
+ <td class="row1" width="35%"><label for="group_rank">{L_GROUP_RANK}{L_COLON}</label></td>
<td class="row2"><select name="group_rank" id="group_rank">{S_RANK_OPTIONS}</select></td>
</tr>
<tr>
<th colspan="2">{L_GROUP_AVATAR}</th>
</tr>
<tr>
- <td class="row1" width="35%"><label>{L_CURRENT_IMAGE}:</label><br /><span>{L_AVATAR_EXPLAIN}</span></td>
- <td class="row2">{AVATAR_IMAGE}<br /><br /><input type="checkbox" class="radio" name="delete" />&nbsp;<span>{L_DELETE_AVATAR}</span></td>
+ <td class="row1" width="35%"><label>{L_CURRENT_IMAGE}{L_COLON}</label><br /><span>{L_AVATAR_EXPLAIN}</span></td>
+ <td class="row2">{AVATAR_IMAGE}<br /><br /><input type="checkbox" class="radio" name="avatar_delete" />&nbsp;<span>{L_DELETE_AVATAR}</span></td>
</tr>
- <!-- IF not S_IN_AVATAR_GALLERY -->
- <!-- IF S_UPLOAD_AVATAR_FILE -->
- <tr>
- <td class="row1" width="35%"><label for="uploadfile">{L_UPLOAD_AVATAR_FILE}:</label></td>
- <td class="row2"><input type="hidden" name="MAX_FILE_SIZE" value="{AVATAR_MAX_FILESIZE}" /><input type="file" id="uploadfile" name="uploadfile" /></td>
- </tr>
- <!-- ENDIF -->
- <!-- IF S_UPLOAD_AVATAR_URL -->
- <tr>
- <td class="row1" width="35%"><label for="uploadurl">{L_UPLOAD_AVATAR_URL}:</label><br /><span>{L_UPLOAD_AVATAR_URL_EXPLAIN}</span></td>
- <td class="row2"><input name="uploadurl" type="text" id="uploadurl" value="" /></td>
- </tr>
- <!-- ENDIF -->
- <!-- IF S_LINK_AVATAR -->
- <tr>
- <td class="row1" width="35%"><label for="remotelink">{L_LINK_REMOTE_AVATAR}:</label><br /><span>{L_LINK_REMOTE_AVATAR_EXPLAIN}</span></td>
- <td class="row2"><input name="remotelink" type="text" id="remotelink" value="" /></td>
- </tr>
- <tr>
- <td class="row1" width="35%"><label for="width">{L_LINK_REMOTE_SIZE}:</label><br /><span>{L_LINK_REMOTE_SIZE_EXPLAIN}</span></td>
- <td class="row2"><input name="width" type="text" id="width" size="3" value="{AVATAR_WIDTH}" /> <span>px X </span> <input type="text" name="height" size="3" value="{AVATAR_HEIGHT}" /> <span>px</span></td>
- </tr>
- <!-- ENDIF -->
- <!-- IF S_DISPLAY_GALLERY -->
- <tr>
- <td class="row1" width="35%"><label>{L_AVATAR_GALLERY}:</label></td>
- <td class="row2"><input class="btnmain" type="submit" name="display_gallery" value="{L_DISPLAY_GALLERY}" /></td>
- </tr>
- <!-- ENDIF -->
- <!-- ELSE -->
-
- <tr>
- <th colspan="2">{L_AVATAR_GALLERY}</th>
- </tr>
- <tr>
- <td class="row1" width="35%"><label for="category">{L_AVATAR_CATEGORY}:</label></td>
- <td class="row2"><select name="category" id="category">{S_CAT_OPTIONS}</select>&nbsp;<input class="btnmain" type="submit" value="{L_GO}" name="display_gallery" /></td>
- </tr>
- <tr>
- <td class="row1" width="35%">
- <table cellspacing="1">
- <!-- BEGIN avatar_row -->
- <tr>
- <!-- BEGIN avatar_column -->
- <td class="row1" style="text-align: center;"><img src="{avatar_row.avatar_column.AVATAR_IMAGE}" alt="{avatar_row.avatar_column.AVATAR_NAME}" title="{avatar_row.avatar_column.AVATAR_NAME}" /></td>
- <!-- END avatar_column -->
- </tr>
- <tr>
- <!-- BEGIN avatar_option_column -->
- <td class="row2" style="text-align: center;"><input type="radio" class="radio" name="avatar_select" value="{avatar_row.avatar_option_column.S_OPTIONS_AVATAR}" /></td>
- <!-- END avatar_option_column -->
- </tr>
- <!-- END avatar_row -->
- </table>
- </td>
- <td class="row2"><input class="btnmain" type="submit" name="cancel" value="{L_CANCEL}" /></td>
- </tr>
-
- <!-- ENDIF -->
+<!-- IF not S_AVATARS_ENABLED -->
+ <tr>
+ <td class="row3" colspan="2" align="center">{L_AVATAR_FEATURES_DISABLED}</td>
+ </tr>
+<!-- ENDIF -->
+ <tr>
+ <th colspan="2">{L_AVATAR_SELECT}</th>
+ </tr>
+ <tr>
+ <td class="row1" width="35%"><b class="genmed">{L_AVATAR_TYPE}{L_COLON}</b></td>
+ <td class="row2">
+ <select name="avatar_driver" id="avatar_driver">
+ <!-- BEGIN avatar_drivers -->
+ <option value="{avatar_drivers.DRIVER}"<!-- IF avatar_drivers.SELECTED --> selected="selected"<!-- ENDIF -->>{avatar_drivers.L_TITLE}</option>
+ <!-- END avatar_drivers -->
+ </select></td>
+ </tr>
+<!-- BEGIN avatar_drivers -->
+ <tr class="avatar_option_{avatar_drivers.DRIVER}">
+ <td class="row1" width="35%" colspan="2"><noscript><b class="genmed">{avatar_drivers.L_TITLE} </b><br /></noscript>{avatar_drivers.L_EXPLAIN}</span></td>
+ </tr>
+ <tr class="avatar_option_{avatar_drivers.DRIVER}">
+ <td colspan="2" style="padding: 0">{avatar_drivers.OUTPUT}</td>
+ </tr>
+<!-- END avatar_drivers -->
<tr>
- <td class="cat" colspan="2" align="center"><input class="btnlite" type="submit" id="submit" name="update" value="{L_SUBMIT}" />&nbsp;
+ <td class="cat" colspan="2" align="center">{S_HIDDEN_FIELDS}<input class="btnlite" type="submit" id="submit" name="update" value="{L_SUBMIT}" />&nbsp;
<input class="btnmain" type="reset" id="reset" name="reset" value="{L_RESET}" /></td>
</tr>
</table>
+<!-- INCLUDEJS avatars.js -->
+
<!-- ELSEIF S_LIST -->
<h1>{L_GROUP_MEMBERS}</h1>
@@ -185,10 +157,10 @@
</table>
<div class="pagination" style="float: {S_CONTENT_FLOW_BEGIN};">
- <!-- IF PAGINATION -->
+ <!-- IF .pagination -->
<!-- INCLUDE pagination.html -->
<!-- ELSE -->
- {S_ON_PAGE}
+ {PAGE_NUMBER}
<!-- ENDIF -->
</div>
@@ -204,11 +176,11 @@
<th colspan="2">{L_ADD_USERS}</th>
</tr>
<tr>
- <td class="row1"><label for="default">{L_USER_GROUP_DEFAULT}:</label><br /><span>{L_USER_GROUP_DEFAULT_EXPLAIN}</span></td>
+ <td class="row1"><label for="default">{L_USER_GROUP_DEFAULT}{L_COLON}</label><br /><span>{L_USER_GROUP_DEFAULT_EXPLAIN}</span></td>
<td class="row2"><input name="default" type="radio" class="radio" value="1" /> {L_YES} &nbsp; <input name="default" type="radio" class="radio" id="default" value="0" checked="checked" /> {L_NO}</td>
</tr>
<tr>
- <td class="row1"><label for="usernames">{L_USERNAME}:</label><br /><span>{L_USERNAMES_EXPLAIN}</span></td>
+ <td class="row1"><label for="usernames">{L_USERNAME}{L_COLON}</label><br /><span>{L_USERNAMES_EXPLAIN}</span></td>
<td class="row2"><textarea id="usernames" name="usernames" cols="40" rows="5"></textarea><br />[ <a href="{U_FIND_USERNAME}" onclick="find_username(this.href); return false;">{L_FIND_USERNAME}</a> ]</td>
</tr>
<tr>
@@ -254,4 +226,4 @@
<!-- ENDIF -->
-<!-- INCLUDE ucp_footer.html --> \ No newline at end of file
+<!-- INCLUDE ucp_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/ucp_groups_membership.html b/phpBB/styles/subsilver2/template/ucp_groups_membership.html
index b92dabc967..846d48007e 100644
--- a/phpBB/styles/subsilver2/template/ucp_groups_membership.html
+++ b/phpBB/styles/subsilver2/template/ucp_groups_membership.html
@@ -86,8 +86,8 @@
<!-- END nonmember -->
<tr>
- <td class="cat" colspan="3"><!-- IF S_CHANGE_DEFAULT --><div style="float: {S_CONTENT_FLOW_BEGIN};"><input class="btnlite" type="submit" name="change_default" value="{L_CHANGE_DEFAULT_GROUP}" /></div><!-- ENDIF --><div style="float: {S_CONTENT_FLOW_END};"><span class="genmed">{L_SELECT}: </span><select name="action"><option value="join">{L_JOIN_SELECTED}</option><option value="resign">{L_RESIGN_SELECTED}</option><option value="demote">{L_DEMOTE_SELECTED}</option></select>&nbsp;<input class="btnmain" type="submit" name="submit" value="{L_SUBMIT}" />&nbsp;</div></td>
+ <td class="cat" colspan="3"><!-- IF S_CHANGE_DEFAULT --><div style="float: {S_CONTENT_FLOW_BEGIN};"><input class="btnlite" type="submit" name="change_default" value="{L_CHANGE_DEFAULT_GROUP}" /></div><!-- ENDIF --><div style="float: {S_CONTENT_FLOW_END};"><span class="genmed">{L_SELECT}{L_COLON} </span><select name="action"><option value="join">{L_JOIN_SELECTED}</option><option value="resign">{L_RESIGN_SELECTED}</option><option value="demote">{L_DEMOTE_SELECTED}</option></select>&nbsp;<input class="btnmain" type="submit" name="submit" value="{L_SUBMIT}" />&nbsp;</div></td>
</tr>
</table>
-<!-- INCLUDE ucp_footer.html --> \ No newline at end of file
+<!-- INCLUDE ucp_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/ucp_header.html b/phpBB/styles/subsilver2/template/ucp_header.html
index 4ad27738fa..dff2841b54 100644
--- a/phpBB/styles/subsilver2/template/ucp_header.html
+++ b/phpBB/styles/subsilver2/template/ucp_header.html
@@ -15,7 +15,7 @@
</tr>
<!-- IF not S_ALLOW_MASS_PM -->
<tr>
- <td class="row1"><b class="genmed">{L_USERNAME}:</b><br />[ <a href="{U_FIND_USERNAME}" onclick="find_username(this.href); return false;">{L_FIND_USERNAME}</a> ]</td>
+ <td class="row1"><b class="genmed">{L_USERNAME}{L_COLON}</b><br />[ <a href="{U_FIND_USERNAME}" onclick="find_username(this.href); return false;">{L_FIND_USERNAME}</a> ]</td>
</tr>
<tr>
@@ -23,17 +23,19 @@
</tr>
<!-- ELSE -->
<tr>
- <td class="row1"><b class="genmed">{L_USERNAMES}:</b></td>
+ <td class="row1"><b class="genmed">{L_USERNAMES}{L_COLON}</b></td>
</tr>
+ <!-- EVENT posting_pm_header_find_username_before -->
<tr>
<td class="row2"><textarea name="username_list" rows="5" cols="22" tabindex="1"></textarea><br />
[ <a href="{U_FIND_USERNAME}" onclick="find_username(this.href); return false;">{L_FIND_USERNAME}</a> ]
</td>
</tr>
+ <!-- EVENT posting_pm_header_find_username_after -->
<!-- ENDIF -->
<!-- IF S_GROUP_OPTIONS -->
<tr>
- <td class="row1"><b class="genmed">{L_USERGROUPS}:</b></td>
+ <td class="row1"><b class="genmed">{L_USERGROUPS}{L_COLON}</b></td>
</tr>
<tr>
<td class="row2"><select name="group_list[]" multiple="multiple" size="5" style="width:150px">{S_GROUP_OPTIONS}</select></td>
diff --git a/phpBB/styles/subsilver2/template/ucp_login_link.html b/phpBB/styles/subsilver2/template/ucp_login_link.html
new file mode 100644
index 0000000000..6db9890d8c
--- /dev/null
+++ b/phpBB/styles/subsilver2/template/ucp_login_link.html
@@ -0,0 +1,74 @@
+<!-- INCLUDE overall_header.html -->
+
+<table class="tablebg" width="100%" cellspacing="1">
+ <tr>
+ <th>{SITENAME} - {L_LOGIN_LINK}</th>
+ </tr>
+
+ <tr>
+ <td class="row1" align="center"><span class="genmed">{L_LOGIN_LINK_EXPLAIN}</span></td>
+ </tr>
+
+ <!-- IF LOGIN_LINK_ERROR -->
+ <tr>
+ <td class="row1" align="center"><span class="genmed error">{LOGIN_LINK_ERROR}</span></td>
+ </tr>
+ <!-- ENDIF -->
+
+ <tr>
+ <td class="row1">
+ <form action="{REGISTER_ACTION}" method="post" id="register">
+ <table width="100%" cellspacing="1">
+ <tr>
+ <th colspan="2">{L_REGISTER}</th>
+ </tr>
+
+ <tr>
+ <td>{S_HIDDEN_FIELDS}<input type="submit" name="register" tabindex="1" value="{L_REGISTER}" class="button1" /></td>
+ </tr>
+ </table>
+ </form>
+ </td>
+ </tr>
+
+ <tr>
+ <td class="row1">
+ <form action="{LOGIN_ACTION}" method="post" id="login">
+ <table width="100%" cellspacing="1">
+ <tr>
+ <th colspan="2">{L_LOGIN}</th>
+ </tr>
+
+ <!-- IF LOGIN_ERROR -->
+ <tr>
+ <td class="row1" align="center" colspan="2"><span class="genmed error">{LOGIN_ERROR}</span></td>
+ </tr>
+ <!-- ENDIF -->
+
+ <tr>
+ <td><label for="{USERNAME_CREDENTIAL}">{L_USERNAME}{L_COLON}</label></td>
+ <td><input type="text" tabindex="2" name="{USERNAME_CREDENTIAL}" id="{USERNAME_CREDENTIAL}" size="25" value="{LOGIN_USERNAME}" class="inputbox autowidth" /></td>
+ </tr>
+
+ <tr>
+ <td><label for="{PASSWORD_CREDENTIAL}">{L_PASSWORD}{L_COLON}</label></td>
+ <td><input type="password" tabindex="3" id="{PASSWORD_CREDENTIAL}" name="{PASSWORD_CREDENTIAL}" size="25" class="inputbox autowidth" autocomplete="off" /></td>
+ </tr>
+
+ <!-- IF CAPTCHA_TEMPLATE and S_CONFIRM_CODE -->
+ <!-- DEFINE $CAPTCHA_TAB_INDEX = 4 -->
+ <!-- INCLUDE {CAPTCHA_TEMPLATE} -->
+ <!-- ENDIF -->
+
+ {S_LOGIN_REDIRECT}
+ <tr>
+ <td>&nbsp;</td>
+ <td>{S_HIDDEN_FIELDS}<input type="submit" name="login" tabindex="5" value="{L_LOGIN}" class="button1" /></td>
+ </tr>
+ </table>
+ </form>
+ </td>
+ </tr>
+</table>
+
+<!-- INCLUDE overall_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/ucp_main_bookmarks.html b/phpBB/styles/subsilver2/template/ucp_main_bookmarks.html
index 191e25c297..e91417503f 100644
--- a/phpBB/styles/subsilver2/template/ucp_main_bookmarks.html
+++ b/phpBB/styles/subsilver2/template/ucp_main_bookmarks.html
@@ -42,9 +42,18 @@
<!-- ELSE -->
<td style="padding: 4px;" width="100%" valign="top">
<p class="topictitle"><!-- IF topicrow.S_UNREAD_TOPIC --><a href="{topicrow.U_NEWEST_POST}">{NEWEST_POST_IMG}</a> <!-- ENDIF -->{topicrow.ATTACH_ICON_IMG} <a href="{topicrow.U_VIEW_TOPIC}">{topicrow.TOPIC_TITLE}</a></p>
- <!-- IF topicrow.S_GLOBAL_TOPIC --><span class="gensmall">{L_GLOBAL_ANNOUNCEMENT}</span><!-- ELSE --><span class="gensmall"><b>{L_FORUM}: </b><a href="{topicrow.U_VIEW_FORUM}">{topicrow.FORUM_NAME}</a></span><!-- ENDIF -->
- <!-- IF topicrow.PAGINATION -->
- <p class="gensmall"> [ {GOTO_PAGE_IMG}{L_GOTO_PAGE}: {topicrow.PAGINATION} ] </p>
+ <!-- IF topicrow.S_GLOBAL_TOPIC --><span class="gensmall">{L_GLOBAL_ANNOUNCEMENT}</span><!-- ELSE --><span class="gensmall"><b>{L_FORUM}{L_COLON} </b><a href="{topicrow.U_VIEW_FORUM}">{topicrow.FORUM_NAME}</a></span><!-- ENDIF -->
+ <!-- IF .topicrow.pagination -->
+ <p class="gensmall"> [ {GOTO_PAGE_IMG}{L_GOTO_PAGE}{L_COLON}
+ <!-- BEGIN pagination -->
+ <!-- IF topicrow.pagination.S_IS_PREV -->
+ <!-- ELSEIF topicrow.pagination.S_IS_CURRENT --><strong>{topicrow.pagination.PAGE_NUMBER}</strong>
+ <!-- ELSEIF topicrow.pagination.S_IS_ELLIPSIS --> {L_ELLIPSIS}
+ <!-- ELSEIF topicrow.pagination.S_IS_NEXT -->
+ <!-- ELSE --><a href="{topicrow.pagination.PAGE_URL}">{topicrow.pagination.PAGE_NUMBER}</a>
+ <!-- ENDIF -->
+ <!-- END pagination -->
+ ] </p>
<!-- ENDIF -->
</td>
<td style="padding: 4px;" align="{S_CONTENT_FLOW_BEGIN}" valign="top" nowrap="nowrap">
@@ -74,4 +83,4 @@
<div class="gensmall" style="float: {S_CONTENT_FLOW_END}; padding-top: 2px;"><b><a href="#" onclick="marklist('ucp', 't', true); return false;">{L_MARK_ALL}</a> :: <a href="#" onclick="marklist('ucp', 't', false); return false;">{L_UNMARK_ALL}</a></b></div>
<!-- ENDIF -->
-<!-- INCLUDE ucp_footer.html --> \ No newline at end of file
+<!-- INCLUDE ucp_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/ucp_main_drafts.html b/phpBB/styles/subsilver2/template/ucp_main_drafts.html
index e61c253b04..d63d678250 100644
--- a/phpBB/styles/subsilver2/template/ucp_main_drafts.html
+++ b/phpBB/styles/subsilver2/template/ucp_main_drafts.html
@@ -32,8 +32,8 @@
<td class="postdetails" style="padding: 4px;" nowrap="nowrap">{draftrow.DATE}</td>
<td style="padding: 4px;" valign="top" width="100%">
<p class="topictitle">{draftrow.DRAFT_SUBJECT}</p>
- <!-- IF draftrow.S_LINK_TOPIC --><span class="gensmall">{L_TOPIC}: <a href="{draftrow.U_VIEW}">{draftrow.TITLE}</a></span>
- <!-- ELSEIF draftrow.S_LINK_FORUM --><span class="gensmall">{L_FORUM}: <a href="{draftrow.U_VIEW}">{draftrow.TITLE}</a></span>
+ <!-- IF draftrow.S_LINK_TOPIC --><span class="gensmall">{L_TOPIC}{L_COLON} <a href="{draftrow.U_VIEW}">{draftrow.TITLE}</a></span>
+ <!-- ELSEIF draftrow.S_LINK_FORUM --><span class="gensmall">{L_FORUM}{L_COLON} <a href="{draftrow.U_VIEW}">{draftrow.TITLE}</a></span>
<!-- ELSEIF draftrow.S_LINK_PM --><span class="gensmall">{L_PRIVATE_MESSAGE}</span>
<!-- ELSE --><span class="gensmall">{L_NO_TOPIC_FORUM}</span><!-- ENDIF -->
</td>
@@ -54,11 +54,11 @@
<!-- ELSEIF S_EDIT_DRAFT -->
<tr>
- <td class="row1" width="22%"><b class="genmed">{L_SUBJECT}:</b></td>
+ <td class="row1" width="22%"><b class="genmed">{L_SUBJECT}{L_COLON}</b></td>
<td class="row2"><input class="post" style="width:450px" type="text" name="subject" size="45" maxlength="64" tabindex="2" value="{DRAFT_SUBJECT}" /></td>
</tr>
<tr>
- <td class="row1" width="22%"><b class="genmed">{L_MESSAGE}: </b><br /><span class="gensmall">{L_EDIT_DRAFT_EXPLAIN}</span></td>
+ <td class="row1" width="22%"><b class="genmed">{L_MESSAGE}{L_COLON} </b><br /><span class="gensmall">{L_EDIT_DRAFT_EXPLAIN}</span></td>
<td class="row2">
<script type="text/javascript">
// <![CDATA[
@@ -75,12 +75,7 @@
<td colspan="9">
<table cellspacing="0" cellpadding="0" border="0" width="100%">
<tr>
- <td align="{S_CONTENT_FLOW_BEGIN}">
- <script type="text/javascript">
- // <![CDATA[
- colorPalette('h', 6, 5)
- // ]]>
- </script>
+ <td align="{S_CONTENT_FLOW_BEGIN}" id="color_palette_placeholder" data-orientation="h" data-width="11" data-height="10" data-bbcode="true">
</td>
</tr>
</table>
@@ -98,4 +93,4 @@
<!-- ENDIF -->
</table>
-<!-- INCLUDE ucp_footer.html --> \ No newline at end of file
+<!-- INCLUDE ucp_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/ucp_main_front.html b/phpBB/styles/subsilver2/template/ucp_main_front.html
index dc945c83d6..485a58b7ab 100644
--- a/phpBB/styles/subsilver2/template/ucp_main_front.html
+++ b/phpBB/styles/subsilver2/template/ucp_main_front.html
@@ -35,38 +35,42 @@
<th colspan="3">{L_YOUR_DETAILS}</th>
</tr>
<tr>
+<!-- EVENT ucp_main_front_user_activity_before -->
<td class="row1" colspan="3">
<table width="100%" cellspacing="1" cellpadding="4">
+ <!-- EVENT ucp_main_front_user_activity_prepend -->
<tr>
- <td align="{S_CONTENT_FLOW_END}" valign="top" nowrap="nowrap"><b class="genmed">{L_JOINED}: </b></td>
+ <td align="{S_CONTENT_FLOW_END}" valign="top" nowrap="nowrap"><b class="genmed">{L_JOINED}{L_COLON} </b></td>
<td width="100%"><b class="gen">{JOINED}</b></td>
</tr>
<tr>
- <td align="{S_CONTENT_FLOW_END}" valign="top" nowrap="nowrap"><b class="genmed">{L_TOTAL_POSTS}: </b></td>
+ <td align="{S_CONTENT_FLOW_END}" valign="top" nowrap="nowrap"><b class="genmed">{L_TOTAL_POSTS}{L_COLON} </b></td>
<td><!-- IF POSTS_PCT --><b class="gen">{POSTS}</b><br /><span class="genmed">[{POSTS_PCT} / {POSTS_DAY}]<!-- IF S_DISPLAY_SEARCH --><br /><a href="{U_SEARCH_SELF}">{L_SEARCH_YOUR_POSTS}</a><!-- ENDIF --></span><!-- ELSE --><b class="gen">{POSTS}<b><!-- ENDIF --></td>
</tr>
<!-- IF S_SHOW_ACTIVITY -->
<tr>
- <td align="{S_CONTENT_FLOW_END}" valign="top" nowrap="nowrap"><b class="genmed">{L_ACTIVE_IN_FORUM}: </b></td>
+ <td align="{S_CONTENT_FLOW_END}" valign="top" nowrap="nowrap"><b class="genmed">{L_ACTIVE_IN_FORUM}{L_COLON} </b></td>
<td><!-- IF ACTIVE_FORUM != '' --><b><a class="gen" href="{U_ACTIVE_FORUM}">{ACTIVE_FORUM}</a></b><br /><span class="genmed">[ {ACTIVE_FORUM_POSTS} / {ACTIVE_FORUM_PCT} ]</span><!-- ELSE --><span class="gen">-</span><!-- ENDIF --></td>
</tr>
<tr>
- <td align="{S_CONTENT_FLOW_END}" valign="top" nowrap="nowrap"><b class="genmed">{L_ACTIVE_IN_TOPIC}: </b></td>
+ <td align="{S_CONTENT_FLOW_END}" valign="top" nowrap="nowrap"><b class="genmed">{L_ACTIVE_IN_TOPIC}{L_COLON} </b></td>
<td><!-- IF ACTIVE_TOPIC != '' --><b><a class="gen" href="{U_ACTIVE_TOPIC}">{ACTIVE_TOPIC}</a></b><br /><span class="genmed">[ {ACTIVE_TOPIC_POSTS} / {ACTIVE_TOPIC_PCT} ]</span><!-- ELSE --><span class="gen">-</span><!-- ENDIF --></td>
</tr>
<!-- ENDIF -->
<!-- IF WARNINGS -->
<tr>
- <td align="{S_CONTENT_FLOW_END}" valign="middle" nowrap="nowrap"><b class="genmed">{L_YOUR_WARNINGS}: </b></td>
+ <td align="{S_CONTENT_FLOW_END}" valign="middle" nowrap="nowrap"><b class="genmed">{L_YOUR_WARNINGS}{L_COLON} </b></td>
<td class="genmed">{WARNING_IMG} [ <b>{WARNINGS}</b> ]</td>
</tr>
<!-- ENDIF -->
+ <!-- EVENT ucp_main_front_user_activity_append -->
</table>
</td>
+<!-- EVENT ucp_main_front_user_activity_after -->
</tr>
<tr>
<td class="cat" colspan="3">&nbsp;</td>
</tr>
</table>
-<!-- INCLUDE ucp_footer.html --> \ No newline at end of file
+<!-- INCLUDE ucp_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/ucp_main_subscribed.html b/phpBB/styles/subsilver2/template/ucp_main_subscribed.html
index 9335d01f12..c6ae1b6cab 100644
--- a/phpBB/styles/subsilver2/template/ucp_main_subscribed.html
+++ b/phpBB/styles/subsilver2/template/ucp_main_subscribed.html
@@ -17,7 +17,7 @@
<!-- IF forumrow.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
<td style="padding: 4px;" width="20" align="center" valign="middle">{forumrow.FORUM_FOLDER_IMG}</td>
<td style="padding: 4px;" width="100%"><p class="topictitle"><a href="{forumrow.U_VIEWFORUM}">{forumrow.FORUM_NAME}</a></p></td>
- <td class="gensmall" style="padding: 4px;" align="center" valign="middle" nowrap="nowrap"><!-- IF forumrow.LAST_POST_TIME -->{forumrow.LAST_POST_TIME}<br />{forumrow.LAST_POST_AUTHOR_FULL} <a href="{forumrow.U_LAST_POST}">{LAST_POST_IMG}</a><!-- ELSE -->{L_NO_POSTS}<!-- ENDIF --></td>
+ <td class="gensmall" style="padding: 4px;" align="center" valign="middle" nowrap="nowrap"><!-- IF forumrow.LAST_POST_TIME -->{forumrow.LAST_POST_TIME}<br />{forumrow.LAST_POST_AUTHOR_FULL} <a href="{forumrow.U_LAST_POST}" class="imageset">{LAST_POST_IMG}</a><!-- ELSE -->{L_NO_POSTS}<!-- ENDIF --></td>
<td style="padding: 4px;"> <input type="checkbox" class="radio" name="f[{forumrow.FORUM_ID}]" /> </td>
</tr>
<!-- BEGINELSE -->
@@ -50,16 +50,27 @@
<!-- IF topicrow.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
<td style="padding: 4px;" width="20" align="center" valign="middle">{topicrow.TOPIC_FOLDER_IMG}</td>
<td style="padding: 4px;" width="100%" valign="top">
- <p class="topictitle"><!-- IF topicrow.S_UNREAD_TOPIC --><a href="{topicrow.U_NEWEST_POST}">{NEWEST_POST_IMG}</a> <!-- ENDIF -->{topicrow.ATTACH_ICON_IMG} <a href="{topicrow.U_VIEW_TOPIC}">{topicrow.TOPIC_TITLE}</a></p>
- <!-- IF topicrow.S_GLOBAL_TOPIC --><span class="gensmall">{L_GLOBAL_ANNOUNCEMENT}</span><!-- ELSE --><span class="gensmall"><b>{L_FORUM}: </b><a href="{topicrow.U_VIEW_FORUM}">{topicrow.FORUM_NAME}</a></span><!-- ENDIF -->
- <!-- IF topicrow.PAGINATION -->
- <p class="gensmall"> [ {GOTO_PAGE_IMG}{L_GOTO_PAGE}: {topicrow.PAGINATION} ] </p>
+ <p class="topictitle">
+ <!-- IF topicrow.S_UNREAD_TOPIC --><a href="{topicrow.U_NEWEST_POST}" class="imageset">{NEWEST_POST_IMG}</a> <!-- ENDIF -->{topicrow.ATTACH_ICON_IMG}<a href="{topicrow.U_VIEW_TOPIC}">{topicrow.TOPIC_TITLE}</a>
+ </p>
+ <!-- IF topicrow.S_GLOBAL_TOPIC --><span class="gensmall">{L_GLOBAL_ANNOUNCEMENT}</span><!-- ELSE --><span class="gensmall"><b>{L_FORUM}{L_COLON} </b><a href="{topicrow.U_VIEW_FORUM}">{topicrow.FORUM_NAME}</a></span><!-- ENDIF -->
+ <!-- IF .topicrow.pagination -->
+ <p class="gensmall"> [ {GOTO_PAGE_IMG}{L_GOTO_PAGE}{L_COLON}
+ <!-- BEGIN pagination -->
+ <!-- IF topicrow.pagination.S_IS_PREV -->
+ <!-- ELSEIF topicrow.pagination.S_IS_CURRENT --><strong>{topicrow.pagination.PAGE_NUMBER}</strong>
+ <!-- ELSEIF topicrow.pagination.S_IS_ELLIPSIS --> {L_ELLIPSIS}
+ <!-- ELSEIF topicrow.pagination.S_IS_NEXT -->
+ <!-- ELSE --><a href="{topicrow.pagination.PAGE_URL}">{topicrow.pagination.PAGE_NUMBER}</a>
+ <!-- ENDIF -->
+ <!-- END pagination -->
+ ] </p>
<!-- ENDIF -->
</td>
<td style="padding: 4px;" align="{S_CONTENT_FLOW_BEGIN}" valign="top" nowrap="nowrap">
<p class="topicdetails">{topicrow.LAST_POST_TIME}</p>
<p class="topicdetails">{topicrow.LAST_POST_AUTHOR_FULL}
- <a href="{topicrow.U_LAST_POST}">{LAST_POST_IMG}</a>
+ <a href="{topicrow.U_LAST_POST}" class="imageset">{LAST_POST_IMG}</a>
</p>
</td>
<td style="padding: 4px;"> <input type="checkbox" class="radio" name="t[{topicrow.TOPIC_ID}]" /> </td>
@@ -81,4 +92,4 @@
<div class="gensmall" style="float: {S_CONTENT_FLOW_END}; padding-top: 2px;"><b><a href="#" onclick="marklist('ucp', 't', true); marklist('ucp', 'f', true); return false;">{L_MARK_ALL}</a> :: <a href="#" onclick="marklist('ucp', 't', false);marklist('ucp', 'f', false); return false;">{L_UNMARK_ALL}</a></b></div>
<!-- ENDIF -->
-<!-- INCLUDE ucp_footer.html --> \ No newline at end of file
+<!-- INCLUDE ucp_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/ucp_notifications.html b/phpBB/styles/subsilver2/template/ucp_notifications.html
new file mode 100644
index 0000000000..b0d2925b68
--- /dev/null
+++ b/phpBB/styles/subsilver2/template/ucp_notifications.html
@@ -0,0 +1,141 @@
+<!-- INCLUDE ucp_header.html -->
+
+<form id="ucp" method="post" action="{S_UCP_ACTION}"{S_FORM_ENCTYPE}>
+
+<!-- IF MODE == 'notification_options' -->
+ <table width="100%" cellspacing="1">
+ <tr>
+ <th colspan="{NOTIFICATION_TYPES_COLS}">{TITLE}</th>
+ </tr>
+ <tr>
+ <td class="row1" colspan="{NOTIFICATION_TYPES_COLS}" align="center"><span class="genmed">{TITLE_EXPLAIN}</span></td>
+ </tr>
+ <tr>
+ <th>{L_NOTIFICATION_TYPE}</th>
+ <th width="10%">{L_NOTIFICATIONS}</th>
+ <!-- BEGIN notification_methods -->
+ <th width="10%">{notification_methods.NAME}</th>
+ <!-- END notification_methods -->
+ </tr>
+
+ <!-- BEGIN notification_types -->
+ <!-- IF notification_types.GROUP_NAME -->
+ <tr>
+ <td class="row3" colspan="{NOTIFICATION_TYPES_COLS}">{notification_types.GROUP_NAME}</td>
+ </tr>
+ <!-- ELSE -->
+ <!-- IF notification_types.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
+ <td>
+ {notification_types.NAME}
+ <!-- IF notification_types.EXPLAIN --><br />&nbsp; &nbsp;{notification_types.EXPLAIN}<!-- ENDIF -->
+ </td>
+ <td align="center"><input type="checkbox" name="{notification_types.TYPE}_notification"<!-- IF notification_types.SUBSCRIBED --> checked="checked"<!-- ENDIF --> /></td>
+ <!-- BEGIN notification_methods -->
+ <td align="center"><input type="checkbox" name="{notification_types.TYPE}_{notification_methods.METHOD}"<!-- IF notification_methods.SUBSCRIBED --> checked="checked"<!-- ENDIF --> /></td>
+ <!-- END notification_methods -->
+ </tr>
+ <!-- ENDIF -->
+ <!-- END notification_types -->
+ <tr>
+ <td class="cat" colspan="{NOTIFICATION_TYPES_COLS}" align="center">
+ <input type="hidden" name="form_time" value="{FORM_TIME}" />
+ {S_HIDDEN_FIELDS}
+ <input class="btnmain" type="submit" name="submit" value="{L_SUBMIT}" />&nbsp;&nbsp;
+ <input class="btnlite" type="reset" value="{L_RESET}" name="reset" />
+ {S_FORM_TOKEN}
+ </td>
+ </tr>
+ </table>
+<!-- ELSE -->
+ <table class="tablebg" width="100%" cellspacing="1" cellpadding="0">
+ <tr>
+ <td class="row1">
+ <table border="0" cellspacing="0" cellpadding="0" width="100%">
+ <tr>
+ <td align="{S_CONTENT_FLOW_BEGIN}">
+ <!-- IF TOTAL_COUNT -->
+ <table width="100%" cellspacing="1">
+ <tr>
+ <td class="nav" valign="middle" nowrap="nowrap">&nbsp;{PAGE_NUMBER}</td>
+ <td class="gensmall" nowrap="nowrap" width="100%">&nbsp;{L_NOTIFICATIONS} [ <b>{TOTAL_COUNT}</b> ]&nbsp;</td>
+ </tr>
+ </table>
+ <!-- ENDIF -->
+ </td>
+ <td align="{S_CONTENT_FLOW_END}"><!-- INCLUDE pagination.html --></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ </table>
+
+ <div class="notification_list">
+ <table class="tablebg" width="100%" cellspacing="1">
+ <tr>
+ <td class="cat" colspan="3">
+ <table width="100%" cellspacing="0">
+ <tr class="nav">
+ <td align="{S_CONTENT_FLOW_END}" valign="middle"><!-- IF U_MARK_ALL --><a href="{U_MARK_ALL}">{L_NOTIFICATIONS_MARK_ALL_READ}</a><!-- ENDIF --></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <th colspan="2">{L_NOTIFICATIONS}</th>
+ <th width="15%">{L_MARK_READ}</th>
+ </tr>
+ <!-- BEGIN notification_list -->
+ <tr class="row<!-- IF notification_list.UNREAD -->3<!-- ELSEIF notification_list.S_ROW_COUNT is even -->1<!-- ELSE -->2<!-- ENDIF -->">
+ <td width="50">
+ <!-- IF notification_list.AVATAR -->{notification_list.AVATAR}<!-- ELSE --><img src="{T_THEME_PATH}/images/no_avatar.gif" alt="" /><!-- ENDIF -->
+ </td>
+ <td valign="top">
+ <span class="gen">
+ <!-- IF notification_list.URL --><a href="<!-- IF notification_list.UNREAD -->{notification_list.U_MARK_READ}<!-- ELSE -->{notification_list.URL}<!-- ENDIF -->"><!-- ENDIF -->
+ {notification_list.FORMATTED_TITLE}<!-- IF notification_list.REFERENCE --> {notification_list.REFERENCE}<!-- ENDIF -->
+ <!-- IF notification_list.URL --></a><!-- ENDIF --><br />
+ <!-- IF notification_list.FORUM --><span class="notifications_forum">{notification_list.FORUM}</span><br /><!-- ENDIF -->
+ <!-- IF notification_list.REASON --><span class="notifications_reason">{notification_list.REASON}</span><br /><!-- ENDIF -->
+ <span class="notifications_time">{notification_list.TIME}</span>
+ </span>
+ </td>
+ <td align="center">
+ <input type="checkbox" name="mark[]" value="{notification_list.NOTIFICATION_ID}"<!-- IF not notification_list.UNREAD --> disabled="disabled"<!-- ENDIF --> />
+ </td>
+ </tr>
+ <!-- END notification_list -->
+ <tr>
+ <td class="cat" colspan="3" align="center">
+ <input type="hidden" name="form_time" value="{FORM_TIME}" />
+ {S_HIDDEN_FIELDS}
+ <input class="btnmain" type="submit" name="submit" value="{L_MARK_READ}" />
+ {S_FORM_TOKEN}
+ </td>
+ </tr>
+ </table>
+ </div>
+
+ <!-- IF .pagination -->
+ <table class="tablebg" width="100%" cellspacing="1" cellpadding="0">
+ <tr>
+ <td class="row1">
+ <table border="0" cellspacing="0" cellpadding="0" width="100%">
+ <tr>
+ <td align="{S_CONTENT_FLOW_BEGIN}">
+ <!-- INCLUDE pagination.html -->
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ </table>
+ <!-- ENDIF -->
+<!-- ENDIF -->
+
+<!-- IF .notifications -->
+<div class="gensmall" style="float: {S_CONTENT_FLOW_END}; padding-top: 2px;"><b><a href="#" onclick="$('#ucp input:checkbox').prop('checked', true); return false;">{L_MARK_ALL}</a> :: <a href="#" onclick="$('#ucp input:checkbox').prop('checked', false); return false;">{L_UNMARK_ALL}</a></b></div>
+<!-- ENDIF -->
+
+</form>
+
+<!-- INCLUDE ucp_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/ucp_pm_history.html b/phpBB/styles/subsilver2/template/ucp_pm_history.html
index e27417ea3f..b478431fa5 100644
--- a/phpBB/styles/subsilver2/template/ucp_pm_history.html
+++ b/phpBB/styles/subsilver2/template/ucp_pm_history.html
@@ -1,3 +1,4 @@
+<!-- EVENT ucp_pm_history_review_before -->
<script type="text/javascript">
// <![CDATA[
bbcodeEnabled = {S_BBCODE_ALLOWED};
@@ -18,7 +19,7 @@
</tr>
<!-- BEGIN history_row -->
<!-- IF history_row.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
- <td rowspan="2" align="{S_CONTENT_FLOW_BEGIN}" valign="top"><a name="{history_row.MSG_ID}"></a>
+ <td rowspan="2" align="{S_CONTENT_FLOW_BEGIN}" valign="top"><a name="{history_row.MSG_ID}" class="anchor"></a>
<table width="150" cellspacing="0">
<tr>
<td align="center" colspan="2"><span class="postauthor">{history_row.MESSAGE_AUTHOR_FULL}</span></td>
@@ -26,7 +27,7 @@
</table>
</td>
<td width="100%"<!-- IF history_row.S_CURRENT_MSG --> class="current"<!-- ENDIF -->>
- <div class="gensmall" style="float: {S_CONTENT_FLOW_BEGIN};"><b>{L_PM_SUBJECT}:</b>&nbsp;{history_row.SUBJECT}</div><div class="gensmall" style="float: {S_CONTENT_FLOW_END};"><b>{L_FOLDER}:</b>&nbsp;{history_row.FOLDER}</div>
+ <div class="gensmall" style="float: {S_CONTENT_FLOW_BEGIN};"><b>{L_PM_SUBJECT}{L_COLON}</b>&nbsp;{history_row.SUBJECT}</div><div class="gensmall" style="float: {S_CONTENT_FLOW_END};"><b>{L_FOLDER}{L_COLON}</b>&nbsp;{history_row.FOLDER}</div>
</td>
</tr>
@@ -48,7 +49,7 @@
<tr valign="middle">
<td width="100%">&nbsp;</td>
<td width="10" nowrap="nowrap">{history_row.MINI_POST_IMG}</td>
- <td class="gensmall" nowrap="nowrap"><b>{L_SENT_AT}:</b> {history_row.SENT_DATE}</td>
+ <td class="gensmall" nowrap="nowrap"><b>{L_SENT_AT}{L_COLON}</b> {history_row.SENT_DATE}</td>
</tr>
</table>
</td>
@@ -59,7 +60,18 @@
<!-- IF history_row.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
<td class="gensmall"><a href="{history_row.U_VIEW_MESSAGE}">{L_VIEW_PM}</a></td>
- <td><div class="gensmall" style="float: {S_CONTENT_FLOW_BEGIN};">&nbsp;<!-- IF history_row.U_PROFILE --><a href="{history_row.U_PROFILE}">{PROFILE_IMG}</a> <!-- ENDIF --> <!-- IF history_row.U_EMAIL --><a href="{history_row.U_EMAIL}">{EMAIL_IMG}</a> <!-- ENDIF -->&nbsp;</div> <div class="gensmall" style="float: {S_CONTENT_FLOW_END};"><!-- IF history_row.U_QUOTE or history_row.MESSAGE_AUTHOR_QUOTE --><a <!-- IF history_row.U_QUOTE -->href="{history_row.U_QUOTE}"<!-- ELSE -->href="#" onclick="addquote({history_row.MSG_ID}, '{history_row.MESSAGE_AUTHOR_QUOTE}', '{LA_WROTE}'); return false;"<!-- ENDIF -->>{QUOTE_IMG}</a> <!-- ENDIF --> <!-- IF history_row.U_POST_REPLY_PM --><a href="{history_row.U_POST_REPLY_PM}">{REPLY_IMG}</a><!-- ENDIF -->&nbsp;</div></td>
+ <td>
+ <div class="gensmall" style="float: {S_CONTENT_FLOW_BEGIN};">
+ &nbsp;<!-- IF history_row.U_PROFILE --><a href="{history_row.U_PROFILE}" class="imageset">{PROFILE_IMG}</a> <!-- ENDIF -->
+ <!-- IF history_row.U_EMAIL --><a href="{history_row.U_EMAIL}" class="imageset">{EMAIL_IMG}</a> <!-- ENDIF -->&nbsp;
+ </div>
+ <div class="gensmall" style="float: {S_CONTENT_FLOW_END};">
+ <!-- EVENT ucp_pm_history_post_buttons_before -->
+ <!-- IF history_row.U_QUOTE or history_row.MESSAGE_AUTHOR_QUOTE --> <a <!-- IF history_row.U_QUOTE -->href="{history_row.U_QUOTE}"<!-- ELSE -->href="#" onclick="addquote({history_row.MSG_ID}, '{history_row.MESSAGE_AUTHOR_QUOTE}', '{LA_WROTE}'); return false;"<!-- ENDIF --> class="imageset">{QUOTE_IMG}</a> <!-- ENDIF -->
+ <!-- IF history_row.U_POST_REPLY_PM --><a href="{history_row.U_POST_REPLY_PM}" class="imageset">{REPLY_IMG}</a><!-- ENDIF -->&nbsp;
+ <!-- EVENT ucp_pm_history_post_buttons_after -->
+ </div>
+ </td>
</tr>
<tr>
<td class="spacer" colspan="2"><img src="images/spacer.gif" alt="" width="1" height="1" /></td>
@@ -69,5 +81,6 @@
</div></td>
</tr>
</table>
+<!-- EVENT ucp_pm_history_review_after -->
<br clear="all" />
diff --git a/phpBB/styles/subsilver2/template/ucp_pm_message_footer.html b/phpBB/styles/subsilver2/template/ucp_pm_message_footer.html
index d1ef5ebd10..20c5c7fe9f 100644
--- a/phpBB/styles/subsilver2/template/ucp_pm_message_footer.html
+++ b/phpBB/styles/subsilver2/template/ucp_pm_message_footer.html
@@ -31,7 +31,7 @@
<!-- ENDIF -->
<!-- ELSE -->
<form name="sortmsg" method="post" action="{S_PM_ACTION}" style="margin:0px">
- <span class="gensmall">{L_DISPLAY_MESSAGES}:</span> {S_SELECT_SORT_DAYS} <span class="gensmall">{L_SORT_BY}</span> {S_SELECT_SORT_KEY} {S_SELECT_SORT_DIR} <input class="btnlite" type="submit" name="sort" value="{L_GO}" />
+ <span class="gensmall">{L_DISPLAY_MESSAGES}{L_COLON}</span> {S_SELECT_SORT_DAYS} <span class="gensmall">{L_SORT_BY}</span> {S_SELECT_SORT_KEY} {S_SELECT_SORT_DIR} <input class="btnlite" type="submit" name="sort" value="{L_GO}" />
{S_FORM_TOKEN}
</form>
<!-- ENDIF -->
diff --git a/phpBB/styles/subsilver2/template/ucp_pm_options.html b/phpBB/styles/subsilver2/template/ucp_pm_options.html
index 3ff18d8c15..beb867c75a 100644
--- a/phpBB/styles/subsilver2/template/ucp_pm_options.html
+++ b/phpBB/styles/subsilver2/template/ucp_pm_options.html
@@ -20,7 +20,7 @@
</tr>
<!-- IF S_CHECK_DEFINED -->
<tr>
- <td class="row1" width="50" align="{S_CONTENT_FLOW_BEGIN}" valign="top"><b class="gen">{L_IF}:</b></td>
+ <td class="row1" width="50" align="{S_CONTENT_FLOW_BEGIN}" valign="top"><b class="gen">{L_IF}{L_COLON}</b></td>
<td class="row2" align="center" valign="top"><!-- IF S_CHECK_SELECT --><select name="check_option">{S_CHECK_OPTIONS}</select><!-- ELSE --><b class="gen">{CHECK_CURRENT}</b><input type="hidden" name="check_option" value="{CHECK_OPTION}" /><!-- ENDIF --></td>
<td class="row1" width="50" align="{S_CONTENT_FLOW_END}" valign="top"><!-- IF S_CHECK_SELECT --><input type="submit" name="next" value="{L_NEXT_STEP}" class="btnlite" /><!-- ELSE -->&nbsp;<!-- ENDIF --></td>
</tr>
@@ -98,11 +98,11 @@
<th colspan="2">{L_RENAME_FOLDER}</th>
</tr>
<tr>
- <td class="row1" width="200"><b class="gen">{L_RENAME_FOLDER}: </b></td>
+ <td class="row1" width="200"><b class="gen">{L_RENAME_FOLDER}{L_COLON} </b></td>
<td class="row1"><select name="rename_folder_id">{S_FOLDER_OPTIONS}</select></td>
</tr>
<tr>
- <td class="row1" width="200"><b class="gen">{L_NEW_FOLDER_NAME}: </b></td>
+ <td class="row1" width="200"><b class="gen">{L_NEW_FOLDER_NAME}{L_COLON} </b></td>
<td class="row1"><input type="text" class="post" name="new_folder_name" size="30" maxlength="30" /></td>
</tr>
<tr>
@@ -124,7 +124,7 @@
</tr>
<!-- ELSE -->
<tr>
- <td class="row1" width="200"><b class="gen">{L_ADD_FOLDER}: </b></td>
+ <td class="row1" width="200"><b class="gen">{L_ADD_FOLDER}{L_COLON} </b></td>
<td class="row1"><input type="text" class="post" name="foldername" size="30" maxlength="30" /></td>
</tr>
<tr>
@@ -142,7 +142,7 @@
<th colspan="3">{L_REMOVE_FOLDER}</th>
</tr>
<tr>
- <td class="row1" width="200"><b class="gen">{L_REMOVE_FOLDER}: </b></td>
+ <td class="row1" width="200"><b class="gen">{L_REMOVE_FOLDER}{L_COLON} </b></td>
<td class="row1"><select name="remove_folder_id">{S_FOLDER_OPTIONS}</select></td>
<td class="row1"><b class="genmed">{L_AND}</b></td>
</tr>
@@ -168,19 +168,19 @@
<th colspan="2">{L_FOLDER_OPTIONS}</th>
</tr>
<tr>
- <td class="row1" width="200"><span><b class="genmed">{L_IF_FOLDER_FULL}: </b></span></td>
+ <td class="row1" width="200"><span><b class="genmed">{L_IF_FOLDER_FULL}{L_COLON} </b></span></td>
<td class="row1"><input type="radio" class="radio" name="full_action" value="1"{S_DELETE_CHECKED} />&nbsp;<span class="genmed">{L_DELETE_OLDEST_MESSAGES}</span></td>
</tr>
<tr>
<td class="row1" width="200">&nbsp;</td>
- <td class="row1"><input type="radio" class="radio" name="full_action" value="2"{S_MOVE_CHECKED} />&nbsp;<span class="genmed">{L_MOVE_TO_FOLDER}: </span><select name="full_move_to">{S_FULL_FOLDER_OPTIONS}</select></td>
+ <td class="row1"><input type="radio" class="radio" name="full_action" value="2"{S_MOVE_CHECKED} />&nbsp;<span class="genmed">{L_MOVE_TO_FOLDER}{L_COLON} </span><select name="full_move_to">{S_FULL_FOLDER_OPTIONS}</select></td>
</tr>
<tr>
<td class="row1" width="200">&nbsp;</td>
<td class="row1"><input type="radio" class="radio" name="full_action" value="3"{S_HOLD_CHECKED} />&nbsp;<span class="genmed">{L_HOLD_NEW_MESSAGES}</span></td>
</tr>
<tr>
- <td class="row2" width="200"><b class="genmed">{L_DEFAULT_ACTION}: </b><br /><span class="gensmall">{L_DEFAULT_ACTION_EXPLAIN}</span></td>
+ <td class="row2" width="200"><b class="genmed">{L_DEFAULT_ACTION}{L_COLON} </b><br /><span class="gensmall">{L_DEFAULT_ACTION_EXPLAIN}</span></td>
<td class="row2"><span class="genmed">{DEFAULT_ACTION}</span></td>
</tr>
<tr>
diff --git a/phpBB/styles/subsilver2/template/ucp_pm_popup.html b/phpBB/styles/subsilver2/template/ucp_pm_popup.html
deleted file mode 100644
index 68816b88a8..0000000000
--- a/phpBB/styles/subsilver2/template/ucp_pm_popup.html
+++ /dev/null
@@ -1,37 +0,0 @@
-<!-- INCLUDE simple_header.html -->
-
-<script type="text/javascript">
-// <![CDATA[
-/**
-* Jump to inbox
-*/
-function jump_to_inbox(url)
-{
- opener.document.location.href = url.replace(/&amp;/g, '&');
- window.close();
-}
-// ]]>
-</script>
-
-<table width="100%" border="0" cellspacing="0" cellpadding="10">
-<tr>
- <td>
- <table width="100%" border="0" cellspacing="1" cellpadding="4" class="tablebg">
- <tr class="row1">
- <td valign="top" align="center">
- <br /><span class="gen">
- <!-- IF S_NOT_LOGGED_IN -->
- {L_LOGIN_CHECK_PM}
- <!-- ELSE -->
- {MESSAGE}<br /><br />{CLICK_TO_VIEW}
- <!-- ENDIF -->
- </span>
- <br /><br /><span class="genmed"><a href="#" onclick="window.close(); return false;">{L_CLOSE_WINDOW}</a></span><br /><br />
- </td>
- </tr>
- </table>
- </td>
-</tr>
-</table>
-
-<!-- INCLUDE simple_footer.html --> \ No newline at end of file
diff --git a/phpBB/styles/subsilver2/template/ucp_pm_viewfolder.html b/phpBB/styles/subsilver2/template/ucp_pm_viewfolder.html
index f0b076edb2..6ab32df255 100644
--- a/phpBB/styles/subsilver2/template/ucp_pm_viewfolder.html
+++ b/phpBB/styles/subsilver2/template/ucp_pm_viewfolder.html
@@ -22,15 +22,15 @@
<th colspan="2" valign="middle">{L_OPTIONS}</th>
</tr>
<tr>
- <td class="row1" width="35%">{L_DELIMITER}: </td>
+ <td class="row1" width="35%">{L_DELIMITER}{L_COLON} </td>
<td class="row2"><input class="post" type="text" name="delimiter" value="," /></td>
</tr>
<tr>
- <td class="row1" width="35%">{L_ENCLOSURE}: </td>
+ <td class="row1" width="35%">{L_ENCLOSURE}{L_COLON} </td>
<td class="row2"><input class="post" type="text" name="enclosure" value="&#034;" /></td>
</tr>
<tr>
- <td class="cat" colspan="2" align="center"><input type="hidden" name="export_option" value="CSV" /><input class="btnmain" type="submit" name="submit_export" value="{L_EXPORT_FOLDER}" />&nbsp;&nbsp;<input class="btnlite" type="reset" value="Reset" name="reset" /></td>
+ <td class="cat" colspan="2" align="center"><input type="hidden" name="export_option" value="CSV" /><input class="btnmain" type="submit" name="submit_export" value="{L_EXPORT_FOLDER}" />&nbsp;&nbsp;<input class="btnlite" type="reset" value="{L_RESET}" name="reset" /></td>
</tr>
</table>
{S_FORM_TOKEN}
@@ -82,7 +82,7 @@
<a href="{messagerow.U_VIEW_PM}">{messagerow.SUBJECT}</a>
<!-- ENDIF -->
<!-- IF messagerow.S_PM_REPORTED -->
- <a href="{messagerow.U_MCP_REPORT}">{REPORTED_IMG}</a>&nbsp;
+ <a href="{messagerow.U_MCP_REPORT}" class="imageset">{REPORTED_IMG}</a>&nbsp;
<!-- ENDIF -->
<!-- IF messagerow.S_AUTHOR_DELETED -->
<br /><em class="gensmall">{L_PM_FROM_REMOVED_AUTHOR}</em>
diff --git a/phpBB/styles/subsilver2/template/ucp_pm_viewmessage.html b/phpBB/styles/subsilver2/template/ucp_pm_viewmessage.html
index 4971506a6d..9536b1f8c5 100644
--- a/phpBB/styles/subsilver2/template/ucp_pm_viewmessage.html
+++ b/phpBB/styles/subsilver2/template/ucp_pm_viewmessage.html
@@ -8,23 +8,23 @@
<table class="tablebg" width="100%" cellspacing="1" cellpadding="4">
<tr class="row1">
- <td class="genmed" nowrap="nowrap" width="150"><b>{L_PM_SUBJECT}:</b></td>
+ <td class="genmed" nowrap="nowrap" width="150"><b>{L_PM_SUBJECT}{L_COLON}</b></td>
<td class="gen">{SUBJECT}</td>
</tr>
<tr class="row1">
- <td class="genmed" nowrap="nowrap" width="150"><b>{L_PM_FROM}:</b></td>
+ <td class="genmed" nowrap="nowrap" width="150"><b>{L_PM_FROM}{L_COLON}</b></td>
<td class="gen">{MESSAGE_AUTHOR_FULL}</td>
</tr>
<tr class="row1">
- <td class="genmed" nowrap="nowrap" width="150"><b>{L_SENT_AT}:</b></td>
+ <td class="genmed" nowrap="nowrap" width="150"><b>{L_SENT_AT}{L_COLON}</b></td>
<td class="gen">{SENT_DATE}</td>
</tr>
<!-- IF S_TO_RECIPIENT -->
<tr class="row1">
- <td class="genmed" nowrap="nowrap" width="150"><b>{L_TO}:</b></td>
+ <td class="genmed" nowrap="nowrap" width="150"><b>{L_TO}{L_COLON}</b></td>
<td class="gen">
<!-- BEGIN to_recipient -->
<!-- IF to_recipient.IS_GROUP --><span class="sep"><a href="{to_recipient.U_VIEW}">{to_recipient.NAME}</a></span><!-- ELSE -->{to_recipient.NAME_FULL}&nbsp;<!-- ENDIF -->
@@ -35,7 +35,7 @@
<!-- IF S_BCC_RECIPIENT -->
<tr class="row1">
- <td class="genmed" nowrap="nowrap" width="150"><b>{L_BCC}:</b></td>
+ <td class="genmed" nowrap="nowrap" width="150"><b>{L_BCC}{L_COLON}</b></td>
<td class="gen">
<!-- BEGIN bcc_recipient -->
<!-- IF bcc_recipient.IS_GROUP --><span class="sep"><a href="{bcc_recipient.U_VIEW}">{bcc_recipient.NAME}</a></span><!-- ELSE -->{bcc_recipient.NAME_FULL}&nbsp;<!-- ENDIF -->
@@ -69,7 +69,7 @@
<table class="tablebg" width="100%" cellspacing="1">
<tr>
- <td class="row3"><b class="genmed">{L_ATTACHMENTS}: </b></td>
+ <td class="row3"><b class="genmed">{L_ATTACHMENTS}{L_COLON} </b></td>
</tr>
<!-- BEGIN attachment -->
<tr>
@@ -93,7 +93,7 @@
<table width="100%" cellspacing="0">
<tr valign="middle">
- <td class="gensmall" align="{S_CONTENT_FLOW_END}"> <!-- IF U_REPORT --><a href="{U_REPORT}">{REPORT_IMG}</a> <!-- ENDIF --><!-- IF U_DELETE --><a href="{U_DELETE}">{DELETE_IMG}</a> <!-- ENDIF --></td>
+ <td class="gensmall" align="{S_CONTENT_FLOW_END}"> <!-- IF U_REPORT --><a href="{U_REPORT}" class="imageset">{REPORT_IMG}</a> <!-- ENDIF --><!-- IF U_DELETE --><a href="{U_DELETE}" class="imageset">{DELETE_IMG}</a> <!-- ENDIF --></td>
</tr>
</table>
@@ -104,7 +104,19 @@
</tr>
<tr class="row1">
- <td><div class="gensmall" style="float: {S_CONTENT_FLOW_BEGIN};">&nbsp;<!-- IF U_MESSAGE_AUTHOR --><a href="{U_MESSAGE_AUTHOR}">{PROFILE_IMG}</a> <!-- ENDIF --> <!-- IF U_EMAIL --><a href="{U_EMAIL}">{EMAIL_IMG}</a> <!-- ENDIF -->&nbsp;</div> <div class="gensmall" style="float: {S_CONTENT_FLOW_END};"><!-- IF U_EDIT --><a href="{U_EDIT}">{EDIT_IMG}</a> <!-- ENDIF --> <!-- IF U_QUOTE --><a href="{U_QUOTE}">{QUOTE_IMG}</a> <!-- ENDIF --> <!-- IF U_POST_REPLY_PM --><a href="{U_POST_REPLY_PM}">{REPLY_IMG}</a><!-- ENDIF -->&nbsp;</div></td>
+ <td>
+ <div class="gensmall" style="float: {S_CONTENT_FLOW_BEGIN};">
+ &nbsp;<!-- IF U_MESSAGE_AUTHOR --><a href="{U_MESSAGE_AUTHOR}" class="imageset">{PROFILE_IMG}</a> <!-- ENDIF -->
+ <!-- IF U_EMAIL --><a href="{U_EMAIL}" class="imageset">{EMAIL_IMG}</a> <!-- ENDIF -->
+ &nbsp;</div>
+ <div class="gensmall" style="float: {S_CONTENT_FLOW_END};">
+ <!-- EVENT ucp_pm_viewmessage_post_buttons_before -->
+ <!-- IF U_EDIT --><a href="{U_EDIT}" class="imageset">{EDIT_IMG}</a> <!-- ENDIF -->
+ <!-- IF U_QUOTE --><a href="{U_QUOTE}" class="imageset">{QUOTE_IMG}</a> <!-- ENDIF -->
+ <!-- IF U_POST_REPLY_PM --><a href="{U_POST_REPLY_PM}" class="imageset">{REPLY_IMG}</a><!-- ENDIF -->
+ <!-- EVENT ucp_pm_viewmessage_post_buttons_after -->
+ &nbsp;</div>
+ </td>
</tr>
<tr>
diff --git a/phpBB/styles/subsilver2/template/ucp_pm_viewmessage_print.html b/phpBB/styles/subsilver2/template/ucp_pm_viewmessage_print.html
index 085e26ecd2..624a6ea8ef 100644
--- a/phpBB/styles/subsilver2/template/ucp_pm_viewmessage_print.html
+++ b/phpBB/styles/subsilver2/template/ucp_pm_viewmessage_print.html
@@ -1,9 +1,8 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<!DOCTYPE html>
<html dir="{S_CONTENT_DIRECTION}" lang="{S_USER_LANG}">
<head>
-<meta http-equiv="Content-Type" content="text/html; charset={S_CONTENT_ENCODING}">
-<meta http-equiv="Content-Style-Type" content="text/css">
-<meta http-equiv="Content-Language" content="{S_USER_LANG}">
+<meta charset="utf-8" />
+<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="robots" content="noindex" />
<title>{SITENAME} :: {PAGE_TITLE}</title>
@@ -56,7 +55,7 @@ hr.sep {
}
//-->
</style>
-
+<!-- EVENT ucp_pm_viewmessage_print_head_append -->
</head>
<body>
@@ -77,13 +76,13 @@ hr.sep {
<table width="85%" cellspacing="3" cellpadding="0" border="0" align="center">
<tr>
- <td width="10%" nowrap="nowrap">{L_PM_FROM}:&nbsp;</td>
+ <td width="10%" nowrap="nowrap">{L_PM_FROM}{L_COLON}&nbsp;</td>
<td><b>{MESSAGE_AUTHOR}</b> [ {SENT_DATE} ]</td>
</tr>
-
+
<!-- IF S_TO_RECIPIENT -->
<tr>
- <td width="10%" nowrap="nowrap">{L_TO}:</td>
+ <td width="10%" nowrap="nowrap">{L_TO}{L_COLON}</td>
<td>
<!-- BEGIN to_recipient -->
<span<!-- IF to_recipient.IS_GROUP --> class="sep"<!-- ENDIF -->>{to_recipient.NAME}</span>&nbsp;
@@ -94,7 +93,7 @@ hr.sep {
<!-- IF S_BCC_RECIPIENT -->
<tr>
- <td width="10%" nowrap="nowrap">{L_BCC}:</td>
+ <td width="10%" nowrap="nowrap">{L_BCC}{L_COLON}</td>
<td>
<!-- BEGIN bcc_recipient -->
<!-- IF bcc_recipient.COLOUR --><span style="color:{bcc_recipient.COLOUR}"><!-- ELSE --><span<!-- IF bcc_recipient.IS_GROUP --> class="sep"<!-- ENDIF -->><!-- ENDIF -->{bcc_recipient.NAME}</span>&nbsp;
@@ -115,7 +114,7 @@ hr.sep {
<td align="{S_CONTENT_FLOW_END}"><span class="gensmall">{S_TIMEZONE}</span></td>
</tr>
<tr>
- <td colspan="2" align="center"><span class="gensmall">Powered by phpBB&reg; Forum Software &copy; phpBB Group<br />https://www.phpbb.com/</span></td>
+ <td colspan="2" align="center"><span class="gensmall">Powered by phpBB&reg; Forum Software &copy; phpBB Limited<br />https://www.phpbb.com/</span></td>
</tr>
</table>
diff --git a/phpBB/styles/subsilver2/template/ucp_prefs_personal.html b/phpBB/styles/subsilver2/template/ucp_prefs_personal.html
index 4cd0f37a80..0dd50b8fa2 100644
--- a/phpBB/styles/subsilver2/template/ucp_prefs_personal.html
+++ b/phpBB/styles/subsilver2/template/ucp_prefs_personal.html
@@ -2,20 +2,6 @@
<script type="text/javascript">
// <![CDATA[
- /**
- * Set display of page element
- * s[-1,0,1] = hide,toggle display,show
- */
- function dE(n,s)
- {
- var e = document.getElementById(n);
- if (!s)
- {
- s = (e.style.display == '') ? -1 : 1;
- }
- e.style.display = (s == 1) ? 'block' : 'none';
- }
-
var default_dateformat = '{A_DEFAULT_DATEFORMAT}';
// ]]>
</script>
@@ -29,72 +15,57 @@
<td class="row3" colspan="2" align="center"><span class="gensmall error">{ERROR}</span></td>
</tr>
<!-- ENDIF -->
-<tr>
- <td class="row1" width="50%"><b class="genmed">{L_SHOW_EMAIL}:</b></td>
+<!-- EVENT ucp_prefs_personal_prepend -->
+<tr>
+ <td class="row1" width="50%"><b class="genmed">{L_SHOW_EMAIL}{L_COLON}</b></td>
<td class="row2"><input type="radio" class="radio" name="viewemail" value="1"<!-- IF S_VIEW_EMAIL --> checked="checked"<!-- ENDIF --> /><span class="genmed">{L_YES}</span>&nbsp;&nbsp;<input type="radio" class="radio" name="viewemail" value="0"<!-- IF not S_VIEW_EMAIL --> checked="checked"<!-- ENDIF --> /><span class="genmed">{L_NO}</span></td>
</tr>
-<tr>
- <td class="row1" width="50%"><b class="genmed">{L_ADMIN_EMAIL}:</b></td>
+<tr>
+ <td class="row1" width="50%"><b class="genmed">{L_ADMIN_EMAIL}{L_COLON}</b></td>
<td class="row2"><input type="radio" class="radio" name="massemail" value="1"<!-- IF S_MASS_EMAIL --> checked="checked"<!-- ENDIF --> /><span class="genmed">{L_YES}</span>&nbsp;&nbsp;<input type="radio" class="radio" name="massemail" value="0"<!-- IF not S_MASS_EMAIL --> checked="checked"<!-- ENDIF --> /><span class="genmed">{L_NO}</span></td>
</tr>
-<tr>
- <td class="row1" width="50%"><b class="genmed">{L_ALLOW_PM}:</b><br /><span class="gensmall">{L_ALLOW_PM_EXPLAIN}</span></td>
+<tr>
+ <td class="row1" width="50%"><b class="genmed">{L_ALLOW_PM}{L_COLON}</b><br /><span class="gensmall">{L_ALLOW_PM_EXPLAIN}</span></td>
<td class="row2"><input type="radio" class="radio" name="allowpm" value="1"<!-- IF S_ALLOW_PM --> checked="checked"<!-- ENDIF --> /><span class="genmed">{L_YES}</span>&nbsp;&nbsp;<input type="radio" class="radio" name="allowpm" value="0"<!-- IF not S_ALLOW_PM --> checked="checked"<!-- ENDIF --> /><span class="genmed">{L_NO}</span></td>
</tr>
<!-- IF S_CAN_HIDE_ONLINE -->
- <tr>
- <td class="row1" width="50%"><b class="genmed">{L_HIDE_ONLINE}:</b><br /><span class="gensmall">{L_HIDE_ONLINE_EXPLAIN}</span></td>
+ <tr>
+ <td class="row1" width="50%"><b class="genmed">{L_HIDE_ONLINE}{L_COLON}</b><br /><span class="gensmall">{L_HIDE_ONLINE_EXPLAIN}</span></td>
<td class="row2"><input type="radio" class="radio" name="hideonline" value="1"<!-- IF S_HIDE_ONLINE --> checked="checked"<!-- ENDIF --> /><span class="genmed">{L_YES}</span>&nbsp;&nbsp;<input type="radio" class="radio" name="hideonline" value="0"<!-- IF not S_HIDE_ONLINE --> checked="checked"<!-- ENDIF --> /><span class="genmed">{L_NO}</span></td>
</tr>
<!-- ENDIF -->
<!-- IF S_SELECT_NOTIFY -->
- <tr>
- <td class="row1" width="50%"><b class="genmed">{L_NOTIFY_METHOD}:</b><br /><span class="gensmall">{L_NOTIFY_METHOD_EXPLAIN}</span></td>
+ <tr>
+ <td class="row1" width="50%"><b class="genmed">{L_NOTIFY_METHOD}{L_COLON}</b><br /><span class="gensmall">{L_NOTIFY_METHOD_EXPLAIN}</span></td>
<td class="row2"><input type="radio" class="radio" name="notifymethod" value="0"<!-- IF S_NOTIFY_EMAIL --> checked="checked"<!-- ENDIF --> /><span class="genmed">{L_NOTIFY_METHOD_EMAIL}</span>&nbsp;&nbsp;<input type="radio" class="radio" name="notifymethod" value="1"<!-- IF S_NOTIFY_IM --> checked="checked"<!-- ENDIF --> /><span class="genmed">{L_NOTIFY_METHOD_IM}</span>&nbsp;&nbsp;<input type="radio" class="radio" name="notifymethod" value="2"<!-- IF S_NOTIFY_BOTH --> checked="checked"<!-- ENDIF --> /><span class="genmed">{L_NOTIFY_METHOD_BOTH}</span></td>
</tr>
<!-- ENDIF -->
-<tr>
- <td class="row1" width="50%"><b class="genmed">{L_NOTIFY_ON_PM}:</b></td>
- <td class="row2"><input type="radio" class="radio" name="notifypm" value="1"<!-- IF S_NOTIFY_PM --> checked="checked"<!-- ENDIF --> /><span class="genmed">{L_YES}</span>&nbsp;&nbsp;<input type="radio" class="radio" name="notifypm" value="0"<!-- IF not S_NOTIFY_PM --> checked="checked"<!-- ENDIF --> /><span class="genmed">{L_NO}</span></td>
-</tr>
-<tr>
- <td class="row1" width="50%"><b class="genmed">{L_POPUP_ON_PM}:</b></td>
- <td class="row2"><input type="radio" class="radio" name="popuppm" value="1"<!-- IF S_POPUP_PM --> checked="checked"<!-- ENDIF --> /><span class="genmed">{L_YES}</span>&nbsp;&nbsp;<input type="radio" class="radio" name="popuppm" value="0"<!-- IF not S_POPUP_PM --> checked="checked"<!-- ENDIF --> /><span class="genmed">{L_NO}</span></td>
-</tr>
<!-- IF S_MORE_LANGUAGES -->
<tr>
- <td class="row1" width="50%"><b class="genmed">{L_BOARD_LANGUAGE}:</b></td>
+ <td class="row1" width="50%"><b class="genmed">{L_BOARD_LANGUAGE}{L_COLON}</b></td>
<td class="row2"><select name="lang">{S_LANG_OPTIONS}</select></td>
</tr>
<!-- ENDIF -->
<!-- IF S_STYLE_OPTIONS and S_MORE_STYLES -->
<tr>
- <td class="row1" width="50%"><b class="genmed">{L_BOARD_STYLE}:</b></td>
- <td class="row2"><select name="style">{S_STYLE_OPTIONS}</select></td>
+ <td class="row1" width="50%"><b class="genmed">{L_BOARD_STYLE}{L_COLON}</b></td>
+ <td class="row2"><select name="user_style">{S_STYLE_OPTIONS}</select></td>
</tr>
<!-- ENDIF -->
+<!-- INCLUDE timezone_option.html -->
<tr>
- <td class="row1" width="50%"><b class="genmed">{L_BOARD_TIMEZONE}:</b></td>
- <td class="row2">
- <select id="tz" name="tz">{S_TZ_OPTIONS}</select>
- </td>
-</tr>
-<tr>
- <td class="row1" width="50%"><b class="genmed">{L_BOARD_DST}:</b></td>
- <td class="row2"><input type="radio" class="radio" name="dst" value="1"<!-- IF S_DST --> checked="checked"<!-- ENDIF --> /> <span class="genmed">{L_YES}</span>&nbsp;&nbsp;<input type="radio" class="radio" name="dst" value="0"<!-- IF not S_DST --> checked="checked"<!-- ENDIF --> /> <span class="genmed">{L_NO}</span></td>
-</tr>
-<tr>
- <td class="row1" width="50%"><b class="genmed">{L_BOARD_DATE_FORMAT}:</b><br /><span class="gensmall">{L_BOARD_DATE_FORMAT_EXPLAIN}</span></td>
+ <td class="row1" width="50%"><b class="genmed">{L_BOARD_DATE_FORMAT}{L_COLON}</b><br /><span class="gensmall">{L_BOARD_DATE_FORMAT_EXPLAIN}</span></td>
<td class="row2">
- <select name="dateoptions" id="dateoptions" onchange="if(this.value=='custom'){dE('custom_date',1);}else{dE('custom_date',-1);} if (this.value == 'custom') { document.getElementById('dateformat').value = default_dateformat; } else { document.getElementById('dateformat').value = this.value; }">
+ <select name="dateoptions" id="dateoptions" onchange="if(this.value=='custom'){phpbb.toggleDisplay('custom_date',1);}else{phpbb.toggleDisplay('custom_date',-1);} if (this.value == 'custom') { document.getElementById('dateformat').value = default_dateformat; } else { document.getElementById('dateformat').value = this.value; }">
{S_DATEFORMAT_OPTIONS}
</select>
- <div id="custom_date"<!-- IF not S_CUSTOM_DATEFORMAT --> style="display:none;"<!-- ENDIF -->><input type="text" name="dateformat" id="dateformat" value="{DATE_FORMAT}" maxlength="30" class="post" style="margin-top: 3px;" /></div>
+ <div id="custom_date"<!-- IF not S_CUSTOM_DATEFORMAT --> style="display:none;"<!-- ENDIF -->><input type="text" name="dateformat" id="dateformat" value="{DATE_FORMAT}" maxlength="64" class="post" style="margin-top: 3px;" /></div>
</td>
</tr>
+<!-- EVENT ucp_prefs_personal_append -->
<tr>
<td class="cat" colspan="2" align="center">{S_HIDDEN_FIELDS}<input class="btnmain" type="submit" name="submit" value="{L_SUBMIT}" />&nbsp;&nbsp;<input class="btnlite" type="reset" value="{L_RESET}" name="reset" /></td>
</tr>
</table>
-<!-- INCLUDE ucp_footer.html --> \ No newline at end of file
+<!-- INCLUDE ucp_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/ucp_prefs_post.html b/phpBB/styles/subsilver2/template/ucp_prefs_post.html
index edf0070baa..0a558b863c 100644
--- a/phpBB/styles/subsilver2/template/ucp_prefs_post.html
+++ b/phpBB/styles/subsilver2/template/ucp_prefs_post.html
@@ -9,25 +9,27 @@
<td class="row3" colspan="2" align="center"><span class="gensmall error">{ERROR}</span></td>
</tr>
<!-- ENDIF -->
+<!-- EVENT ucp_prefs_post_prepend -->
<tr>
- <td class="row1" width="50%"><b class="genmed">{L_DEFAULT_BBCODE}:</b></td>
+ <td class="row1" width="50%"><b class="genmed">{L_DEFAULT_BBCODE}{L_COLON}</b></td>
<td class="row2"><input type="radio" class="radio" name="bbcode" value="1"<!-- IF S_BBCODE --> checked="checked"<!-- ENDIF --> /><span class="gen">{L_YES}</span>&nbsp; &nbsp;<input type="radio" class="radio" name="bbcode" value="0"<!-- IF not S_BBCODE --> checked="checked"<!-- ENDIF --> /><span class="gen">{L_NO}</span></td>
</tr>
<tr>
- <td class="row1" width="50%"><b class="genmed">{L_DEFAULT_SMILIES}:</b></td>
+ <td class="row1" width="50%"><b class="genmed">{L_DEFAULT_SMILIES}{L_COLON}</b></td>
<td class="row2"><input type="radio" class="radio" name="smilies" value="1"<!-- IF S_SMILIES --> checked="checked"<!-- ENDIF --> /><span class="gen">{L_YES}</span>&nbsp; &nbsp;<input type="radio" class="radio" name="smilies" value="0"<!-- IF not S_SMILIES --> checked="checked"<!-- ENDIF --> /><span class="gen">{L_NO}</span></td>
</tr>
<tr>
- <td class="row1" width="50%"><b class="genmed">{L_DEFAULT_ADD_SIG}:</b></td>
+ <td class="row1" width="50%"><b class="genmed">{L_DEFAULT_ADD_SIG}{L_COLON}</b></td>
<td class="row2"><input type="radio" class="radio" name="sig" value="1"<!-- IF S_SIG --> checked="checked"<!-- ENDIF --> /><span class="gen">{L_YES}</span>&nbsp; &nbsp;<input type="radio" class="radio" name="sig" value="0"<!-- IF not S_SIG --> checked="checked"<!-- ENDIF --> /><span class="gen">{L_NO}</span></td>
</tr>
<tr>
- <td class="row1" width="50%"><b class="genmed">{L_DEFAULT_NOTIFY}:</b></td>
+ <td class="row1" width="50%"><b class="genmed">{L_DEFAULT_NOTIFY}{L_COLON}</b></td>
<td class="row2"><input type="radio" class="radio" name="notify" value="1"<!-- IF S_NOTIFY --> checked="checked"<!-- ENDIF --> /><span class="gen">{L_YES}</span>&nbsp; &nbsp;<input type="radio" class="radio" name="notify" value="0"<!-- IF not S_NOTIFY --> checked="checked"<!-- ENDIF --> /><span class="gen">{L_NO}</span></td>
</tr>
+<!-- EVENT ucp_prefs_post_append -->
<tr>
<td class="cat" colspan="2" align="center">{S_HIDDEN_FIELDS}<input class="btnmain" type="submit" name="submit" value="{L_SUBMIT}" />&nbsp;&nbsp;<input class="btnlite" type="reset" value="{L_RESET}" name="reset" /></td>
</tr>
</table>
-<!-- INCLUDE ucp_footer.html --> \ No newline at end of file
+<!-- INCLUDE ucp_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/ucp_prefs_view.html b/phpBB/styles/subsilver2/template/ucp_prefs_view.html
index b97bcfde00..c10c458627 100644
--- a/phpBB/styles/subsilver2/template/ucp_prefs_view.html
+++ b/phpBB/styles/subsilver2/template/ucp_prefs_view.html
@@ -9,65 +9,69 @@
<td class="row3" colspan="2" align="center"><span class="gensmall error">{ERROR}</span></td>
</tr>
<!-- ENDIF -->
+<!-- EVENT ucp_prefs_view_radio_buttons_prepend -->
<tr>
- <td class="row1" width="50%"><b class="genmed">{L_VIEW_IMAGES}:</b></td>
+ <td class="row1" width="50%"><b class="genmed">{L_VIEW_IMAGES}{L_COLON}</b></td>
<td class="row2"><input type="radio" class="radio" name="images" value="1"<!-- IF S_IMAGES --> checked="checked"<!-- ENDIF --> /><span class="gen">{L_YES}</span>&nbsp; &nbsp;<input type="radio" class="radio" name="images" value="0"<!-- IF not S_IMAGES --> checked="checked"<!-- ENDIF --> /><span class="gen">{L_NO}</span></td>
</tr>
<tr>
- <td class="row1" width="50%"><b class="genmed">{L_VIEW_FLASH}:</b></td>
+ <td class="row1" width="50%"><b class="genmed">{L_VIEW_FLASH}{L_COLON}</b></td>
<td class="row2"><input type="radio" class="radio" name="flash" value="1"<!-- IF S_FLASH --> checked="checked"<!-- ENDIF --> /><span class="gen">{L_YES}</span>&nbsp; &nbsp;<input type="radio" class="radio" name="flash" value="0"<!-- IF not S_FLASH --> checked="checked"<!-- ENDIF --> /><span class="gen">{L_NO}</span></td>
</tr>
<tr>
- <td class="row1" width="50%"><b class="genmed">{L_VIEW_SMILIES}:</b></td>
+ <td class="row1" width="50%"><b class="genmed">{L_VIEW_SMILIES}{L_COLON}</b></td>
<td class="row2"><input type="radio" class="radio" name="smilies" value="1"<!-- IF S_SMILIES --> checked="checked"<!-- ENDIF --> /><span class="gen">{L_YES}</span>&nbsp; &nbsp;<input type="radio" class="radio" name="smilies" value="0"<!-- IF not S_SMILIES --> checked="checked"<!-- ENDIF --> /><span class="gen">{L_NO}</span></td>
</tr>
<tr>
- <td class="row1" width="50%"><b class="genmed">{L_VIEW_SIGS}:</b></td>
+ <td class="row1" width="50%"><b class="genmed">{L_VIEW_SIGS}{L_COLON}</b></td>
<td class="row2"><input type="radio" class="radio" name="sigs" value="1"<!-- IF S_SIGS --> checked="checked"<!-- ENDIF --> /><span class="gen">{L_YES}</span>&nbsp; &nbsp;<input type="radio" class="radio" name="sigs" value="0"<!-- IF not S_SIGS --> checked="checked"<!-- ENDIF --> /><span class="gen">{L_NO}</span></td>
</tr>
<tr>
- <td class="row1" width="50%"><b class="genmed">{L_VIEW_AVATARS}:</b></td>
+ <td class="row1" width="50%"><b class="genmed">{L_VIEW_AVATARS}{L_COLON}</b></td>
<td class="row2"><input type="radio" class="radio" name="avatars" value="1"<!-- IF S_AVATARS --> checked="checked"<!-- ENDIF --> /><span class="gen">{L_YES}</span>&nbsp; &nbsp;<input type="radio" class="radio" name="avatars" value="0"<!-- IF not S_AVATARS --> checked="checked"<!-- ENDIF --> /><span class="gen">{L_NO}</span></td>
</tr>
<!-- IF S_CHANGE_CENSORS -->
<tr>
- <td class="row1" width="50%"><b class="genmed">{L_DISABLE_CENSORS}:</b></td>
+ <td class="row1" width="50%"><b class="genmed">{L_DISABLE_CENSORS}{L_COLON}</b></td>
<td class="row2"><input type="radio" class="radio" name="wordcensor" value="1"<!-- IF S_DISABLE_CENSORS --> checked="checked"<!-- ENDIF --> /><span class="gen">{L_YES}</span>&nbsp; &nbsp;<input type="radio" class="radio" name="wordcensor" value="0"<!-- IF not S_DISABLE_CENSORS --> checked="checked"<!-- ENDIF --> /><span class="gen">{L_NO}</span></td>
</tr>
<!-- ENDIF -->
+<!-- EVENT ucp_prefs_view_radio_buttons_append -->
<tr>
<td colspan="2" class="spacer"></td>
</tr>
+<!-- EVENT ucp_prefs_view_select_menu_prepend -->
<tr>
- <td class="row1" width="50%"><b class="genmed">{L_VIEW_TOPICS_DAYS}:</b></td>
+ <td class="row1" width="50%"><b class="genmed">{L_VIEW_TOPICS_DAYS}{L_COLON}</b></td>
<td class="row2">{S_TOPIC_SORT_DAYS}</td>
</tr>
<tr>
- <td class="row1" width="50%"><b class="genmed">{L_VIEW_TOPICS_KEY}:</b></td>
+ <td class="row1" width="50%"><b class="genmed">{L_VIEW_TOPICS_KEY}{L_COLON}</b></td>
<td class="row2">{S_TOPIC_SORT_KEY}</td>
</tr>
<tr>
- <td class="row1" width="50%"><b class="genmed">{L_VIEW_TOPICS_DIR}:</b></td>
+ <td class="row1" width="50%"><b class="genmed">{L_VIEW_TOPICS_DIR}{L_COLON}</b></td>
<td class="row2">{S_TOPIC_SORT_DIR}</td>
</tr>
<tr>
<td colspan="2" class="spacer"></td>
</tr>
<tr>
- <td class="row1" width="50%"><b class="genmed">{L_VIEW_POSTS_DAYS}:</b></td>
+ <td class="row1" width="50%"><b class="genmed">{L_VIEW_POSTS_DAYS}{L_COLON}</b></td>
<td class="row2">{S_POST_SORT_DAYS}</td>
</tr>
<tr>
- <td class="row1" width="50%"><b class="genmed">{L_VIEW_POSTS_KEY}:</b></td>
+ <td class="row1" width="50%"><b class="genmed">{L_VIEW_POSTS_KEY}{L_COLON}</b></td>
<td class="row2">{S_POST_SORT_KEY}</td>
</tr>
<tr>
- <td class="row1" width="50%"><b class="genmed">{L_VIEW_POSTS_DIR}:</b></td>
+ <td class="row1" width="50%"><b class="genmed">{L_VIEW_POSTS_DIR}{L_COLON}</b></td>
<td class="row2">{S_POST_SORT_DIR}</td>
</tr>
+<!-- EVENT ucp_prefs_view_select_menu_append -->
<tr>
<td class="cat" colspan="2" align="center">{S_HIDDEN_FIELDS}<input class="btnmain" type="submit" name="submit" value="{L_SUBMIT}" />&nbsp;&nbsp;<input class="btnlite" type="reset" value="{L_RESET}" name="reset" /></td>
</tr>
</table>
-<!-- INCLUDE ucp_footer.html --> \ No newline at end of file
+<!-- INCLUDE ucp_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/ucp_profile_autologin_keys.html b/phpBB/styles/subsilver2/template/ucp_profile_autologin_keys.html
new file mode 100644
index 0000000000..087ae89743
--- /dev/null
+++ b/phpBB/styles/subsilver2/template/ucp_profile_autologin_keys.html
@@ -0,0 +1,50 @@
+<!-- INCLUDE ucp_header.html -->
+
+<table class="tablebg" width="100%" cellspacing="1">
+<tr>
+ <th colspan="4">{L_TITLE}</th>
+</tr>
+
+<!-- IF ERROR -->
+ <tr>
+ <td class="row3" colspan="4" align="center"><span class="genmed error">{ERROR}</span></td>
+ </tr>
+<!-- ENDIF -->
+
+<tr>
+ <td colspan="4" class="row1">{L_PROFILE_AUTOLOGIN_KEYS}</td>
+</tr>
+<tr>
+ <th>{L_LOGIN_KEY}</th>
+ <th class="center">{L_IP}</th>
+ <th class="center">{L_LOGIN_TIME}</th>
+ <th class="center">{L_MARK}</th>
+</tr>
+<!-- BEGIN sessions -->
+ <!-- IF sessions.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
+ <td class="genmed"><label for="{sessions.KEY}">{sessions.KEY}</label></td>
+ <td class="genmed" style="text-align: center">{sessions.IP}</td>
+ <td class="genmed" style="text-align: center">{sessions.LOGIN_TIME}</td>
+ <td class="genmed" style="text-align: center"><input type="checkbox" name="keys[]" value="{sessions.KEY}" id="{sessions.KEY}"/></td>
+ </tr>
+<!-- BEGINELSE -->
+ <tr>
+ <td colspan="4" class="row1" style="text-align: center">{L_PROFILE_NO_AUTOLOGIN_KEYS}</td>
+ </tr>
+<!-- END sessions -->
+
+<!-- IF .sessions -->
+ <tr>
+ <td class="cat" colspan="4" align="{S_CONTENT_FLOW_END}">
+ {S_HIDDEN_FIELDS}<input class="btnlite" type="submit" name="submit" value="{L_DELETE_MARKED}" />
+ {S_FORM_TOKEN}
+ </td>
+ </tr>
+<!-- ENDIF -->
+</table>
+
+<!-- IF .sessions -->
+ <div class="gensmall" style="float: {S_CONTENT_FLOW_END}; padding-top: 2px;"><b><a href="#" onclick="marklist('ucp', 'keys', true); return false;">{L_MARK_ALL}</a> :: <a href="#" onclick="marklist('ucp', 'keys', false); return false;">{L_UNMARK_ALL}</a></b></div>
+<!-- ENDIF -->
+
+<!-- INCLUDE ucp_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/ucp_profile_avatar.html b/phpBB/styles/subsilver2/template/ucp_profile_avatar.html
index 4188d0e5f2..8b1e8cffac 100644
--- a/phpBB/styles/subsilver2/template/ucp_profile_avatar.html
+++ b/phpBB/styles/subsilver2/template/ucp_profile_avatar.html
@@ -9,10 +9,10 @@
<td class="row3" colspan="2" align="center"><span class="gensmall error">{ERROR}</span></td>
</tr>
<!-- ENDIF -->
-<tr>
- <td class="row1" width="35%"><b class="genmed">{L_CURRENT_IMAGE}: </b><br /><span class="gensmall">{L_AVATAR_EXPLAIN}</span></td>
+<tr>
+ <td class="row1" width="35%"><b class="genmed">{L_CURRENT_IMAGE}{L_COLON} </b><br /><span class="gensmall">{L_AVATAR_EXPLAIN}</span></td>
<td class="row2" align="center"><br />
- <!-- IF AVATAR -->{AVATAR}<br /><br /><input type="checkbox" class="radio" name="delete" />&nbsp;<span class="gensmall">{L_DELETE_AVATAR}</span>
+ <!-- IF AVATAR -->{AVATAR}<br /><br /><input type="checkbox" class="radio" name="avatar_delete" />&nbsp;<span class="gensmall">{L_DELETE_AVATAR}</span>
<!-- ELSE --><img src="{T_THEME_PATH}/images/no_avatar.gif" alt="" />
<!-- ENDIF --></td>
</tr>
@@ -21,67 +21,30 @@
<td class="row3" colspan="2" align="center">{L_AVATAR_FEATURES_DISABLED}</td>
</tr>
<!-- ENDIF -->
-<!-- IF S_UPLOAD_AVATAR_FILE -->
- <tr>
- <td class="row1" width="35%"><b class="genmed">{L_UPLOAD_AVATAR_FILE}: </b></td>
- <td class="row2"><input type="hidden" name="MAX_FILE_SIZE" value="{AVATAR_SIZE}" /><input class="post" type="file" name="uploadfile" /></td>
- </tr>
-<!-- ENDIF -->
-<!-- IF S_UPLOAD_AVATAR_URL -->
- <tr>
- <td class="row1" width="35%"><b class="genmed">{L_UPLOAD_AVATAR_URL}: </b><br /><span class="gensmall">{L_UPLOAD_AVATAR_URL_EXPLAIN}</span></td>
- <td class="row2"><input class="post" type="text" name="uploadurl" size="40" value="{AVATAR_URL}" /></td>
- </tr>
-<!-- ENDIF -->
-<!-- IF S_LINK_AVATAR -->
- <tr>
- <td class="row1" width="35%"><b class="genmed">{L_LINK_REMOTE_AVATAR}: </b><br /><span class="gensmall">{L_LINK_REMOTE_AVATAR_EXPLAIN}</span></td>
- <td class="row2"><input class="post" type="text" name="remotelink" size="40" value="{AVATAR_REMOTE}" /></td>
- </tr>
- <tr>
- <td class="row1" width="35%"><b class="genmed">{L_LINK_REMOTE_SIZE}: </b><br /><span class="gensmall">{L_LINK_REMOTE_SIZE_EXPLAIN}</span></td>
- <td class="row2"><input class="post" type="text" name="width" size="3" value="{AVATAR_WIDTH}" /> <span class="gen">{L_PIXEL} &times; </span> <input class="post" type="text" name="height" size="3" value="{AVATAR_HEIGHT}" /> <span class="gen">{L_PIXEL}</span></td>
- </tr>
-<!-- ENDIF -->
-<!-- IF S_DISPLAY_GALLERY -->
- <tr>
- <td class="row1" width="35%"><b class="genmed">{L_AVATAR_GALLERY}: </b></td>
- <td class="row2"><strong><a href="{U_GALLERY}">{L_DISPLAY_GALLERY}</a></strong></td>
- </tr>
-<!-- ENDIF -->
-
-<!-- IF S_IN_AVATAR_GALLERY -->
- <tr>
- <th colspan="2">{L_AVATAR_GALLERY}</th>
- </tr>
- <tr>
- <td class="cat" colspan="2" align="center" valign="middle"><span class="genmed">{L_AVATAR_CATEGORY}: </span><select name="category">{S_CAT_OPTIONS}</select>&nbsp; <input class="btnlite" tabindex="0" type="submit" value="{L_GO}" name="display_gallery" /></td>
- </tr>
- <tr>
- <td class="row1" colspan="2" align="center">
- <table cellspacing="1" cellpadding="4" border="0">
- <!-- BEGIN avatar_row -->
- <tr>
- <!-- BEGIN avatar_column -->
- <td class="row1" align="center"><img src="{avatar_row.avatar_column.AVATAR_IMAGE}" alt="{avatar_row.avatar_column.AVATAR_NAME}" title="{avatar_row.avatar_column.AVATAR_NAME}" /></td>
- <!-- END avatar_column -->
- </tr>
- <tr>
- <!-- BEGIN avatar_option_column -->
- <td class="row2" align="center"><input type="radio" class="radio" name="avatar_select" value="{avatar_row.avatar_option_column.S_OPTIONS_AVATAR}" /></td>
- <!-- END avatar_option_column -->
- </tr>
- <!-- END avatar_row -->
- </table>
- </td>
+ <tr>
+ <th colspan="2">{L_AVATAR_SELECT}</th>
</tr>
-<!-- ENDIF -->
+ <tr>
+ <td class="row1" width="35%"><b class="genmed">{L_AVATAR_TYPE}{L_COLON}</b></td>
+ <td class="row2">
+ <select name="avatar_driver" id="avatar_driver" data-togglable-settings="true">
+ <!-- BEGIN avatar_drivers -->
+ <option value="{avatar_drivers.DRIVER}"<!-- IF avatar_drivers.SELECTED --> selected="selected"<!-- ENDIF --> data-toggle-setting=".avatar_option_{avatar_drivers.DRIVER}">{avatar_drivers.L_TITLE}</option>
+ <!-- END avatar_drivers -->
+ </select></td>
+ </tr>
+<!-- BEGIN avatar_drivers -->
+ <tr class="avatar_option_{avatar_drivers.DRIVER}">
+ <td class="row1" width="35%" colspan="2"><noscript><b class="genmed">{avatar_drivers.L_TITLE} </b><br /></noscript>{avatar_drivers.L_EXPLAIN}</span></td>
+ </tr>
+ <tr class="avatar_option_{avatar_drivers.DRIVER}">
+ <td colspan="2" style="padding: 0">{avatar_drivers.OUTPUT}</td>
+ </tr>
+<!-- END avatar_drivers -->
-<!-- IF S_DISPLAY_GALLERY or S_IN_AVATAR_GALLERY or S_LINK_AVATAR or S_UPLOAD_AVATAR_URL or S_UPLOAD_AVATAR_FILE or AVATAR -->
<tr>
<td class="cat" colspan="2" align="center">{S_HIDDEN_FIELDS}<input class="btnmain" type="submit" name="submit" value="{L_SUBMIT}" />&nbsp;&nbsp;<!-- IF S_IN_AVATAR_GALLERY --><input class="btnlite" type="submit" name="cancel" value="{L_CANCEL}" /><!-- ELSE --><input class="btnlite" type="reset" value="{L_RESET}" name="reset" /><!-- ENDIF --></td>
</tr>
-<!-- ENDIF -->
</table>
-<!-- INCLUDE ucp_footer.html --> \ No newline at end of file
+<!-- INCLUDE ucp_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/ucp_profile_profile_info.html b/phpBB/styles/subsilver2/template/ucp_profile_profile_info.html
index c08b873834..bfc2dd0244 100644
--- a/phpBB/styles/subsilver2/template/ucp_profile_profile_info.html
+++ b/phpBB/styles/subsilver2/template/ucp_profile_profile_info.html
@@ -9,64 +9,36 @@
<td class="row3" colspan="2" align="center"><span class="gensmall error">{ERROR}</span></td>
</tr>
<!-- ENDIF -->
-<tr>
+<tr>
<td class="row1" colspan="2"><span class="gensmall">{L_PROFILE_INFO_NOTICE}</span></td>
</tr>
-<tr>
- <td class="row1" width="35%"><b class="genmed">{L_UCP_ICQ}: </b></td>
- <td class="row2"><input class="post" type="text" name="icq" size="30" maxlength="15" value="{ICQ}" /></td>
-</tr>
-<tr>
- <td class="row1" width="35%"><b class="genmed">{L_UCP_AIM}: </b></td>
- <td class="row2"><input class="post" type="text" name="aim" size="30" maxlength="255" value="{AIM}" /></td>
-</tr>
-<tr>
- <td class="row1" width="35%"><b class="genmed">{L_UCP_MSNM}: </b></td>
- <td class="row2"><input class="post" type="text" name="msn" size="30" maxlength="255" value="{MSN}" /></td>
-</tr>
-<tr>
- <td class="row1" width="35%"><b class="genmed">{L_UCP_YIM}: </b></td>
- <td class="row2"><input class="post" type="text" name="yim" size="30" maxlength="255" value="{YIM}" /></td>
-</tr>
-<tr>
- <td class="row1" width="35%"><b class="genmed">{L_UCP_JABBER}: </b></td>
+<!-- EVENT ucp_profile_profile_info_before -->
+<!-- IF S_JABBER_ENABLED -->
+<tr>
+ <td class="row1" width="35%"><b class="genmed">{L_UCP_JABBER}{L_COLON} </b></td>
<td class="row2"><input class="post" type="text" name="jabber" size="30" maxlength="255" value="{JABBER}" /></td>
</tr>
-<tr>
- <td class="row1" width="35%"><b class="genmed">{L_WEBSITE}: </b></td>
- <td class="row2"><input class="post" type="text" name="website" size="30" maxlength="255" value="{WEBSITE}" /></td>
-</tr>
-<tr>
- <td class="row1" width="35%"><b class="genmed">{L_LOCATION}: </b></td>
- <td class="row2"><input class="post" type="text" name="location" size="30" maxlength="100" value="{LOCATION}" /></td>
-</tr>
-<tr>
- <td class="row1" width="35%"><b class="genmed">{L_OCCUPATION}: </b></td>
- <td class="row2"><textarea class="post" name="occupation" rows="3" cols="30">{OCCUPATION}</textarea></td>
-</tr>
-<tr>
- <td class="row1" width="35%"><b class="genmed">{L_INTERESTS}: </b></td>
- <td class="row2"><textarea class="post" name="interests" rows="3" cols="30">{INTERESTS}</textarea></td>
-</tr>
+<!-- ENDIF -->
<!-- IF S_BIRTHDAYS_ENABLED -->
- <tr>
- <td class="row1" width="35%"><b class="genmed">{L_BIRTHDAY}: </b><br /><span class="gensmall">{L_BIRTHDAY_EXPLAIN}</span></td>
- <td class="row2"><span class="genmed">{L_DAY}:</span> <select name="bday_day">{S_BIRTHDAY_DAY_OPTIONS}</select> <span class="genmed">{L_MONTH}:</span> <select name="bday_month">{S_BIRTHDAY_MONTH_OPTIONS}</select> <span class="genmed">{L_YEAR}:</span> <select name="bday_year">{S_BIRTHDAY_YEAR_OPTIONS}</select></td>
+ <tr>
+ <td class="row1" width="35%"><b class="genmed">{L_BIRTHDAY}{L_COLON} </b><br /><span class="gensmall">{L_BIRTHDAY_EXPLAIN}</span></td>
+ <td class="row2"><span class="genmed">{L_DAY}{L_COLON}</span> <select name="bday_day">{S_BIRTHDAY_DAY_OPTIONS}</select> <span class="genmed">{L_MONTH}{L_COLON}</span> <select name="bday_month">{S_BIRTHDAY_MONTH_OPTIONS}</select> <span class="genmed">{L_YEAR}{L_COLON}</span> <select name="bday_year">{S_BIRTHDAY_YEAR_OPTIONS}</select></td>
</tr>
<!-- ENDIF -->
<!-- BEGIN profile_fields -->
- <tr>
+ <tr>
<td class="row1" width="35%">
- <b class="genmed">{profile_fields.LANG_NAME}: </b>
+ <b class="genmed">{profile_fields.LANG_NAME}{L_COLON} </b>
<!-- IF profile_fields.S_REQUIRED --><b>*</b><!-- ENDIF -->
<!-- IF profile_fields.LANG_EXPLAIN --><br /><span class="gensmall">{profile_fields.LANG_EXPLAIN}</span><!-- ENDIF -->
</td>
<td class="row2">{profile_fields.FIELD}<!-- IF profile_fields.ERROR --><br /><span class="gensmall error">{profile_fields.ERROR}</span><!-- ENDIF --></td>
</tr>
<!-- END profile_fields -->
+<!-- EVENT ucp_profile_profile_info_after -->
<tr>
<td class="cat" colspan="2" align="center">{S_HIDDEN_FIELDS}<input class="btnmain" type="submit" name="submit" value="{L_SUBMIT}" />&nbsp;&nbsp;<input class="btnlite" type="reset" value="{L_RESET}" name="reset" /></td>
</tr>
</table>
-<!-- INCLUDE ucp_footer.html --> \ No newline at end of file
+<!-- INCLUDE ucp_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/ucp_profile_reg_details.html b/phpBB/styles/subsilver2/template/ucp_profile_reg_details.html
index 2eca7a93c8..862956a1d0 100644
--- a/phpBB/styles/subsilver2/template/ucp_profile_reg_details.html
+++ b/phpBB/styles/subsilver2/template/ucp_profile_reg_details.html
@@ -14,36 +14,32 @@
<td class="row3" colspan="2" align="center"><span class="gensmall error">{ERROR}</span></td>
</tr>
<!-- ENDIF -->
+<!-- EVENT ucp_profile_register_details_before -->
<tr>
- <td class="row1" width="35%"><b class="genmed">{L_USERNAME}: </b><br /><span class="gensmall">{L_USERNAME_EXPLAIN}</span></td>
+ <td class="row1" width="35%"><b class="genmed">{L_USERNAME}{L_COLON} </b><br /><span class="gensmall">{L_USERNAME_EXPLAIN}</span></td>
<td class="row2"><!-- IF S_CHANGE_USERNAME --><input type="text" class="post" name="username" size="30" value="{USERNAME}" /><!-- ELSE --><b class="gen">{USERNAME}</b><!-- ENDIF --></td>
</tr>
<tr>
- <td class="row1" width="35%"><b class="genmed">{L_EMAIL_ADDRESS}: </b></td>
- <td class="row2"><!-- IF S_CHANGE_EMAIL --><input type="text" class="post" name="email" size="30" maxlength="100" value="{EMAIL}" /><!-- ELSE --><b class="gen">{EMAIL}</b><!-- ENDIF --></td>
+ <td class="row1" width="35%"><b class="genmed">{L_EMAIL_ADDRESS}{L_COLON} </b></td>
+ <td class="row2"><!-- IF S_CHANGE_EMAIL --><input type="email" class="post" name="email" size="30" maxlength="100" value="{EMAIL}" autocomplete="off" /><!-- ELSE --><b class="gen">{EMAIL}</b><!-- ENDIF --></td>
</tr>
-<!-- IF S_CHANGE_EMAIL -->
- <tr>
- <td class="row1" width="35%"><b class="genmed">{L_CONFIRM_EMAIL}: </b><br /><span class="gensmall">{L_CONFIRM_EMAIL_EXPLAIN}</span></td>
- <td class="row2"><input type="text" class="post" name="email_confirm" size="30" maxlength="100" value="{CONFIRM_EMAIL}" /></td>
- </tr>
-<!-- ENDIF -->
<!-- IF S_CHANGE_PASSWORD -->
<tr>
- <td class="row1" width="35%"><b class="genmed">{L_NEW_PASSWORD}: </b><br /><span class="gensmall">{L_CHANGE_PASSWORD_EXPLAIN}</span></td>
- <td class="row2"><input type="password" class="post" name="new_password" size="30" maxlength="255" value="{NEW_PASSWORD}" /></td>
+ <td class="row1" width="35%"><b class="genmed">{L_NEW_PASSWORD}{L_COLON} </b><br /><span class="gensmall">{L_CHANGE_PASSWORD_EXPLAIN}</span></td>
+ <td class="row2"><input type="password" class="post" name="new_password" size="30" maxlength="255" value="{NEW_PASSWORD}" autocomplete="off" /></td>
</tr>
<tr>
- <td class="row1" width="35%"><b class="genmed">{L_CONFIRM_PASSWORD}: </b><br /><span class="gensmall">{L_CONFIRM_PASSWORD_EXPLAIN}</span></td>
- <td class="row2"><input type="password" class="post" name="password_confirm" size="30" maxlength="255" value="{PASSWORD_CONFIRM}" /></td>
+ <td class="row1" width="35%"><b class="genmed">{L_CONFIRM_PASSWORD}{L_COLON} </b><br /><span class="gensmall">{L_CONFIRM_PASSWORD_EXPLAIN}</span></td>
+ <td class="row2"><input type="password" class="post" name="password_confirm" size="30" maxlength="255" value="{PASSWORD_CONFIRM}" autocomplete="off" /></td>
</tr>
<!-- ENDIF -->
+<!-- EVENT ucp_profile_register_details_after -->
<tr>
<th colspan="2">{L_CONFIRM_CHANGES}</th>
</tr>
<tr>
- <td class="row1" width="35%"><b class="genmed">{L_CURRENT_PASSWORD}: </b><br /><span class="gensmall"><!-- IF S_CHANGE_PASSWORD -->{L_CURRENT_CHANGE_PASSWORD_EXPLAIN}<!-- ELSE -->{L_CURRENT_PASSWORD_EXPLAIN}<!-- ENDIF --></span></td>
- <td class="row2"><input type="password" class="post" name="cur_password" size="30" maxlength="255" value="{CUR_PASSWORD}" /></td>
+ <td class="row1" width="35%"><b class="genmed">{L_CURRENT_PASSWORD}{L_COLON} </b><br /><span class="gensmall"><!-- IF S_CHANGE_PASSWORD -->{L_CURRENT_CHANGE_PASSWORD_EXPLAIN}<!-- ELSE -->{L_CURRENT_PASSWORD_EXPLAIN}<!-- ENDIF --></span></td>
+ <td class="row2"><input type="password" class="post" name="cur_password" size="30" maxlength="255" value="{CUR_PASSWORD}" autocomplete="off" /></td>
</tr>
<tr>
<td class="cat" colspan="2" align="center">{S_HIDDEN_FIELDS}<input class="btnmain" type="submit" name="submit" value="{L_SUBMIT}" />&nbsp;&nbsp;<input class="btnlite" type="reset" value="{L_RESET}" name="reset" /></td>
diff --git a/phpBB/styles/subsilver2/template/ucp_profile_signature.html b/phpBB/styles/subsilver2/template/ucp_profile_signature.html
index 54e8aaa723..5a2690edda 100644
--- a/phpBB/styles/subsilver2/template/ucp_profile_signature.html
+++ b/phpBB/styles/subsilver2/template/ucp_profile_signature.html
@@ -61,12 +61,7 @@
<td colspan="2">
<table cellspacing="0" cellpadding="0" border="0" width="100%">
<tr>
- <td align="{S_CONTENT_FLOW_BEGIN}">
- <script type="text/javascript">
- // <![CDATA[
- colorPalette('h', 6, 5)
- // ]]>
- </script>
+ <td align="{S_CONTENT_FLOW_BEGIN}" id="color_palette_placeholder" data-orientation="h" data-width="11" data-height="10">
</td>
</tr>
</table>
@@ -134,4 +129,4 @@
</tr>
</table>
-<!-- INCLUDE ucp_footer.html --> \ No newline at end of file
+<!-- INCLUDE ucp_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/ucp_register.html b/phpBB/styles/subsilver2/template/ucp_register.html
index ebcdf2d76b..db26f51ebd 100644
--- a/phpBB/styles/subsilver2/template/ucp_register.html
+++ b/phpBB/styles/subsilver2/template/ucp_register.html
@@ -7,6 +7,7 @@
*/
function change_language(lang_iso)
{
+ document.cookie = '{COOKIE_NAME}_lang=' + lang_iso + '; path={COOKIE_PATH}';
document.forms['register'].change_lang.value = lang_iso;
document.forms['register'].submit.click();
}
@@ -33,34 +34,33 @@
</tr>
<!-- ENDIF -->
+<!-- EVENT ucp_register_credentials_before -->
<tr>
- <td class="row1" width="38%"><b class="genmed">{L_USERNAME}: </b><br /><span class="gensmall">{L_USERNAME_EXPLAIN}</span></td>
+ <td class="row1" width="38%"><b class="genmed">{L_USERNAME}{L_COLON} </b><br /><span class="gensmall">{L_USERNAME_EXPLAIN}</span></td>
<td class="row2"><input class="post" type="text" name="username" size="25" value="{USERNAME}" /></td>
</tr>
<tr>
- <td class="row1"><b class="genmed">{L_EMAIL_ADDRESS}: </b></td>
- <td class="row2"><input class="post" type="text" name="email" size="25" maxlength="100" value="{EMAIL}" /></td>
+ <td class="row1"><b class="genmed">{L_EMAIL_ADDRESS}{L_COLON} </b></td>
+ <td class="row2"><input class="post" type="email" name="email" size="25" maxlength="100" value="{EMAIL}" autocomplete="off" /></td>
</tr>
<tr>
- <td class="row1"><b class="genmed">{L_CONFIRM_EMAIL}: </b></td>
- <td class="row2"><input class="post" type="text" name="email_confirm" size="25" maxlength="100" value="{EMAIL_CONFIRM}" /></td>
+ <td class="row1"><b class="genmed">{L_PASSWORD}{L_COLON} </b><br /><span class="gensmall">{L_PASSWORD_EXPLAIN}</span></td>
+ <td class="row2"><input class="post" type="password" name="new_password" size="25" value="{PASSWORD}" autocomplete="off" /></td>
</tr>
<tr>
- <td class="row1"><b class="genmed">{L_PASSWORD}: </b><br /><span class="gensmall">{L_PASSWORD_EXPLAIN}</span></td>
- <td class="row2"><input class="post" type="password" name="new_password" size="25" value="{PASSWORD}" /></td>
+ <td class="row1"><b class="genmed">{L_CONFIRM_PASSWORD}{L_COLON} </b></td>
+ <td class="row2"><input class="post" type="password" name="password_confirm" size="25" value="{PASSWORD_CONFIRM}" autocomplete="off" /></td>
</tr>
+<!-- EVENT ucp_register_credentials_after -->
+<!-- EVENT ucp_register_options_before -->
<tr>
- <td class="row1"><b class="genmed">{L_CONFIRM_PASSWORD}: </b></td>
- <td class="row2"><input class="post" type="password" name="password_confirm" size="25" value="{PASSWORD_CONFIRM}" /></td>
-</tr>
-<tr>
- <td class="row1"><b class="genmed">{L_LANGUAGE}: </b></td>
+ <td class="row1"><b class="genmed">{L_LANGUAGE}{L_COLON} </b></td>
<td class="row2"><select name="lang" onchange="change_language(this.value); return false;">{S_LANG_OPTIONS}</select></td>
</tr>
-<tr>
- <td class="row1"><b class="genmed">{L_TIMEZONE}: </b></td>
- <td class="row2"><select name="tz">{S_TZ_OPTIONS}</select></td>
-</tr>
+
+<!-- INCLUDE timezone_option.html -->
+
+<!-- EVENT ucp_register_profile_fields_before -->
<!-- IF .profile_fields -->
<tr>
<td class="row2" colspan="2"><span class="gensmall">{L_ITEMS_REQUIRED}</span></td>
@@ -68,7 +68,7 @@
<!-- BEGIN profile_fields -->
<tr>
<td class="row1" width="35%">
- <b class="genmed">{profile_fields.LANG_NAME}: </b>
+ <b class="genmed">{profile_fields.LANG_NAME}{L_COLON} </b>
<!-- IF profile_fields.S_REQUIRED --><b>*</b><!-- ENDIF -->
<!-- IF profile_fields.LANG_EXPLAIN --><br /><span class="gensmall">{profile_fields.LANG_EXPLAIN}</span><!-- ENDIF -->
</td>
@@ -77,7 +77,7 @@
<!-- END profile_fields -->
<!-- ENDIF -->
-
+<!-- EVENT ucp_register_profile_fields_after -->
<!-- IF CAPTCHA_TEMPLATE -->
<!-- INCLUDE {CAPTCHA_TEMPLATE} -->
<!-- ENDIF -->
@@ -91,6 +91,8 @@
</tr>
<!-- ENDIF -->
+<!-- EVENT ucp_register_buttons_before -->
+
<tr>
<td class="cat" colspan="2" align="center">{S_HIDDEN_FIELDS}<input class="btnmain" type="submit" name="submit" id="submit" value="{L_SUBMIT}" />&nbsp;&nbsp;<input class="btnlite" type="reset" value="{L_RESET}" name="reset" /></td>
</tr>
@@ -98,4 +100,4 @@
{S_FORM_TOKEN}
</form>
-<!-- INCLUDE overall_footer.html --> \ No newline at end of file
+<!-- INCLUDE overall_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/ucp_remind.html b/phpBB/styles/subsilver2/template/ucp_remind.html
index b14fbe8305..f7fde4b3be 100644
--- a/phpBB/styles/subsilver2/template/ucp_remind.html
+++ b/phpBB/styles/subsilver2/template/ucp_remind.html
@@ -9,12 +9,12 @@
<th colspan="2">{L_SEND_PASSWORD}</th>
</tr>
<tr>
- <td class="row1" width="38%"><b class="genmed">{L_USERNAME}: </b></td>
+ <td class="row1" width="38%"><b class="genmed">{L_USERNAME}{L_COLON} </b></td>
<td class="row2"><input type="text" class="post" name="username" size="25" value="{USERNAME}" /></td>
</tr>
<tr>
- <td class="row1"><b class="genmed">{L_EMAIL_ADDRESS}: </b><br /><span class="gensmall">{L_EMAIL_REMIND}</span></td>
- <td class="row2"><input type="text" class="post" name="email" size="25" maxlength="100" value="{EMAIL}" /></td>
+ <td class="row1"><b class="genmed">{L_EMAIL_ADDRESS}{L_COLON} </b><br /><span class="gensmall">{L_EMAIL_REMIND}</span></td>
+ <td class="row2"><input type="email" class="post" name="email" size="25" maxlength="100" value="{EMAIL}" /></td>
</tr>
<tr>
<td class="cat" colspan="2" align="center">{S_HIDDEN_FIELDS}<input type="submit" name="submit" value="{L_SUBMIT}" class="btnmain" />&nbsp;&nbsp;<input type="reset" value="{L_RESET}" name="reset" class="btnlite" /></td>
@@ -25,4 +25,4 @@
</div>
-<!-- INCLUDE overall_footer.html --> \ No newline at end of file
+<!-- INCLUDE overall_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/ucp_resend.html b/phpBB/styles/subsilver2/template/ucp_resend.html
index 3a39f904aa..62e7e96d6b 100644
--- a/phpBB/styles/subsilver2/template/ucp_resend.html
+++ b/phpBB/styles/subsilver2/template/ucp_resend.html
@@ -9,12 +9,12 @@
<th colspan="2">{L_UCP_RESEND}</th>
</tr>
<tr>
- <td class="row1" width="38%"><b class="genmed">{L_USERNAME}: </b></td>
+ <td class="row1" width="38%"><b class="genmed">{L_USERNAME}{L_COLON} </b></td>
<td class="row2"><input type="text" class="post" name="username" size="25" value="{USERNAME}" /></td>
</tr>
<tr>
- <td class="row1"><b class="genmed">{L_EMAIL_ADDRESS}: </b><br /><span class="gensmall">{L_EMAIL_REMIND}</span></td>
- <td class="row2"><input type="text" class="post" name="email" size="25" maxlength="100" value="{EMAIL}" /></td>
+ <td class="row1"><b class="genmed">{L_EMAIL_ADDRESS}{L_COLON} </b><br /><span class="gensmall">{L_EMAIL_REMIND}</span></td>
+ <td class="row2"><input type="email" class="post" name="email" size="25" maxlength="100" value="{EMAIL}" /></td>
</tr>
<tr>
<td class="cat" colspan="2" align="center">{S_HIDDEN_FIELDS}<input type="submit" name="submit" value="{L_SUBMIT}" class="btnmain" />&nbsp;&nbsp;<input type="reset" value="{L_RESET}" name="reset" class="btnlite" /></td>
@@ -26,4 +26,4 @@
</div>
-<!-- INCLUDE overall_footer.html --> \ No newline at end of file
+<!-- INCLUDE overall_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/ucp_zebra_foes.html b/phpBB/styles/subsilver2/template/ucp_zebra_foes.html
index 89be18ccc1..6149a80e69 100644
--- a/phpBB/styles/subsilver2/template/ucp_zebra_foes.html
+++ b/phpBB/styles/subsilver2/template/ucp_zebra_foes.html
@@ -13,11 +13,11 @@
</tr>
<!-- ENDIF -->
<tr>
- <td class="row1" width="40%"><b class="genmed">{L_YOUR_FOES}:</b><br /><span class="gensmall">{L_YOUR_FOES_EXPLAIN}</span></td>
+ <td class="row1" width="40%"><b class="genmed">{L_YOUR_FOES}{L_COLON}</b><br /><span class="gensmall">{L_YOUR_FOES_EXPLAIN}</span></td>
<td class="row2" align="center"><!-- IF S_USERNAME_OPTIONS --><select name="usernames[]" multiple="multiple" size="5">{S_USERNAME_OPTIONS}</select><!-- ELSE --><b class="genmed">{L_NO_FOES}</b><!-- ENDIF --></td>
</tr>
<tr>
- <td class="row1"><b class="genmed">{L_ADD_FOES}:</b><br /><span class="gensmall">{L_ADD_FOES_EXPLAIN} [ <a href="{U_FIND_USERNAME}" onclick="find_username(this.href); return false;">{L_FIND_USERNAME}</a> ]</span></td>
+ <td class="row1"><b class="genmed">{L_ADD_FOES}{L_COLON}</b><br /><span class="gensmall">{L_ADD_FOES_EXPLAIN} [ <a href="{U_FIND_USERNAME}" onclick="find_username(this.href); return false;">{L_FIND_USERNAME}</a> ]</span></td>
<td class="row2" align="center"><textarea name="add" rows="5" cols="30">{USERNAMES}</textarea><br /></td>
</tr>
<tr>
@@ -25,4 +25,4 @@
</tr>
</table>
-<!-- INCLUDE ucp_footer.html --> \ No newline at end of file
+<!-- INCLUDE ucp_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/ucp_zebra_friends.html b/phpBB/styles/subsilver2/template/ucp_zebra_friends.html
index 2abea04b8f..3e18af9969 100644
--- a/phpBB/styles/subsilver2/template/ucp_zebra_friends.html
+++ b/phpBB/styles/subsilver2/template/ucp_zebra_friends.html
@@ -4,6 +4,7 @@
<tr>
<th colspan="2" valign="middle">{L_TITLE}</th>
</tr>
+<!-- EVENT ucp_friend_list_before -->
<tr>
<td class="row3" colspan="2"><span class="gensmall">{L_FRIENDS_EXPLAIN}</span></td>
</tr>
@@ -13,11 +14,12 @@
</tr>
<!-- ENDIF -->
<tr>
- <td class="row1" width="40%"><b class="genmed">{L_YOUR_FRIENDS}:</b><br /><span class="gensmall">{L_YOUR_FRIENDS_EXPLAIN}</span></td>
+ <td class="row1" width="40%"><b class="genmed">{L_YOUR_FRIENDS}{L_COLON}</b><br /><span class="gensmall">{L_YOUR_FRIENDS_EXPLAIN}</span></td>
<td class="row2" align="center"><!-- IF S_USERNAME_OPTIONS --><select name="usernames[]" multiple="multiple" size="5">{S_USERNAME_OPTIONS}</select><!-- ELSE --><b class="genmed">{L_NO_FRIENDS}</b><!-- ENDIF --></td>
</tr>
+<!-- EVENT ucp_friend_list_after -->
<tr>
- <td class="row1"><b class="genmed">{L_ADD_FRIENDS}:</b><br /><span class="gensmall">{L_ADD_FRIENDS_EXPLAIN} [ <a href="{U_FIND_USERNAME}" onclick="find_username(this.href); return false;">{L_FIND_USERNAME}</a> ]</span></td>
+ <td class="row1"><b class="genmed">{L_ADD_FRIENDS}{L_COLON}</b><br /><span class="gensmall">{L_ADD_FRIENDS_EXPLAIN} [ <a href="{U_FIND_USERNAME}" onclick="find_username(this.href); return false;">{L_FIND_USERNAME}</a> ]</span></td>
<td class="row2" align="center"><textarea name="add" rows="5" cols="30">{USERNAMES}</textarea><br /></td>
</tr>
<tr>
@@ -25,4 +27,4 @@
</tr>
</table>
-<!-- INCLUDE ucp_footer.html --> \ No newline at end of file
+<!-- INCLUDE ucp_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/viewforum_body.html b/phpBB/styles/subsilver2/template/viewforum_body.html
index ee6ec26ab2..c76c081ba7 100644
--- a/phpBB/styles/subsilver2/template/viewforum_body.html
+++ b/phpBB/styles/subsilver2/template/viewforum_body.html
@@ -1,7 +1,7 @@
<!-- INCLUDE overall_header.html -->
<!-- IF S_FORUM_RULES -->
- <div class="forumrules">
+ <div class="forumrules<!-- IF U_FORUM_RULES --> rules-link<!-- ENDIF -->">
<!-- IF U_FORUM_RULES -->
<h3>{L_FORUM_RULES}</h3><br />
<a href="{U_FORUM_RULES}"><b>{L_FORUM_RULES_LINK}</b></a>
@@ -32,25 +32,44 @@
<th>&nbsp;{L_LAST_POST}&nbsp;</th>
</tr>
+ <!-- EVENT viewforum_body_topic_row_before -->
+
<!-- BEGIN topicrow -->
+ <!-- EVENT viewforum_body_topicrow_row_before -->
<tr>
+ <!-- EVENT viewforum_body_topic_row_prepend -->
<td class="row1" width="25" align="center">{topicrow.TOPIC_FOLDER_IMG}</td>
<!-- IF S_TOPIC_ICONS -->
<td class="row1" width="25" align="center"><!-- IF topicrow.TOPIC_ICON_IMG --><img src="{T_ICONS_PATH}{topicrow.TOPIC_ICON_IMG}" width="{topicrow.TOPIC_ICON_IMG_WIDTH}" height="{topicrow.TOPIC_ICON_IMG_HEIGHT}" alt="" title="" /><!-- ENDIF --></td>
<!-- ENDIF -->
<td class="row1">
- <!-- IF topicrow.S_UNREAD_TOPIC --><a href="{topicrow.U_NEWEST_POST}">{NEWEST_POST_IMG}</a><!-- ENDIF -->
- {topicrow.ATTACH_ICON_IMG} <!-- IF topicrow.S_HAS_POLL or topicrow.S_TOPIC_MOVED --><b>{topicrow.TOPIC_TYPE}</b> <!-- ENDIF --><a title="{L_POSTED}: {topicrow.FIRST_POST_TIME}" href="{topicrow.U_VIEW_TOPIC}"class="topictitle">{topicrow.TOPIC_TITLE}</a>
+ <!-- EVENT topiclist_row_prepend -->
+ <!-- IF topicrow.S_UNREAD_TOPIC --><a href="{topicrow.U_NEWEST_POST}" class="imageset">{NEWEST_POST_IMG}</a><!-- ENDIF -->
+ {topicrow.ATTACH_ICON_IMG} <!-- IF topicrow.S_HAS_POLL or topicrow.S_TOPIC_MOVED --><b>{topicrow.TOPIC_TYPE}</b> <!-- ENDIF --><a title="{L_POSTED}{L_COLON} {topicrow.FIRST_POST_TIME}" href="{topicrow.U_VIEW_TOPIC}"class="topictitle">{topicrow.TOPIC_TITLE}</a>
<!-- IF topicrow.S_TOPIC_UNAPPROVED or topicrow.S_POSTS_UNAPPROVED -->
- <a href="{topicrow.U_MCP_QUEUE}">{UNAPPROVED_IMG}</a>&nbsp;
+ <a href="{topicrow.U_MCP_QUEUE}" class="imageset">{topicrow.UNAPPROVED_IMG}</a>&nbsp;
+ <!-- ENDIF -->
+ <!-- IF topicrow.S_TOPIC_DELETED -->
+ <a href="{topicrow.U_MCP_QUEUE}" class="imageset">{DELETED_IMG}</a>&nbsp;
<!-- ENDIF -->
<!-- IF topicrow.S_TOPIC_REPORTED -->
- <a href="{topicrow.U_MCP_REPORT}">{REPORTED_IMG}</a>&nbsp;
+ <a href="{topicrow.U_MCP_REPORT}" class="imageset">{REPORTED_IMG}</a>&nbsp;
<!-- ENDIF -->
- <!-- IF topicrow.PAGINATION -->
- <p class="gensmall"> [ {GOTO_PAGE_IMG}{L_GOTO_PAGE}: {topicrow.PAGINATION} ] </p>
+ <!-- EVENT topiclist_row_topic_title_after -->
+ <!-- IF .topicrow.pagination -->
+ <p class="gensmall"> [ {GOTO_PAGE_IMG}{L_GOTO_PAGE}{L_COLON}
+ <!-- BEGIN pagination -->
+ <!-- IF topicrow.pagination.S_IS_PREV -->
+ <!-- ELSEIF topicrow.pagination.S_IS_CURRENT --><strong>{topicrow.pagination.PAGE_NUMBER}</strong>
+ <!-- ELSEIF topicrow.pagination.S_IS_ELLIPSIS --> {L_ELLIPSIS}
+ <!-- ELSEIF topicrow.pagination.S_IS_NEXT -->
+ <!-- ELSE --><a href="{topicrow.pagination.PAGE_URL}">{topicrow.pagination.PAGE_NUMBER}</a>
+ <!-- ENDIF -->
+ <!-- END pagination -->
+ ] </p>
<!-- ENDIF -->
+ <!-- EVENT topiclist_row_append -->
</td>
<td class="row2" width="130" align="center"><p class="topicauthor">{topicrow.TOPIC_AUTHOR_FULL}</p></td>
<td class="row1" width="50" align="center"><p class="topicdetails">{topicrow.REPLIES}</p></td>
@@ -58,10 +77,12 @@
<td class="row1" width="140" align="center">
<p class="topicdetails" style="white-space: nowrap;">{topicrow.LAST_POST_TIME}</p>
<p class="topicdetails">{topicrow.LAST_POST_AUTHOR_FULL}
- <!-- IF not S_IS_BOT --><a href="{topicrow.U_LAST_POST}">{LAST_POST_IMG}</a><!-- ENDIF -->
+ <!-- IF not S_IS_BOT --><a href="{topicrow.U_LAST_POST}" class="imageset">{LAST_POST_IMG}</a><!-- ENDIF -->
</p>
</td>
+ <!-- EVENT viewforum_body_topic_row_append -->
</tr>
+ <!-- EVENT viewforum_body_topic_row_after -->
<!-- BEGINELSE -->
@@ -89,13 +110,14 @@
<!-- IF S_IS_POSTABLE or S_NO_READ_ACCESS -->
<div id="pageheader">
- <h2><a class="titles" href="{U_VIEW_FORUM}">{FORUM_NAME}</a></h2>
-
+ <!-- EVENT viewforum_forum_title_before -->
+ <h2><!-- EVENT viewforum_forum_name_prepend --><a class="titles" href="{U_VIEW_FORUM}">{FORUM_NAME}</a><!-- EVENT viewforum_forum_name_append --></h2>
+ <!-- EVENT viewforum_forum_title_after -->
<!-- IF MODERATORS -->
- <p class="moderators"><!-- IF S_SINGLE_MODERATOR -->{L_MODERATOR}<!-- ELSE -->{L_MODERATORS}<!-- ENDIF -->: {MODERATORS}</p>
+ <p class="moderators"><!-- IF S_SINGLE_MODERATOR -->{L_MODERATOR}<!-- ELSE -->{L_MODERATORS}<!-- ENDIF -->{L_COLON} {MODERATORS}</p>
<!-- ENDIF -->
<!-- IF U_MCP -->
- <p class="linkmcp">[ <a href="{U_MCP}">{L_MCP}</a> ]</p>
+ <p class="linkmcp">[&nbsp;<!-- IF U_ACP --><a href="{U_ACP}">{L_ACP}</a><!-- IF U_MCP -->&nbsp;|&nbsp;<!-- ENDIF --><!-- ENDIF --><!-- IF U_MCP --><a href="{U_MCP}">{L_MCP}</a><!-- ENDIF -->&nbsp;]</p>
<!-- ENDIF -->
</div>
@@ -122,7 +144,7 @@
<td class="cat"><h4><a href="{U_LOGIN_LOGOUT}">{L_LOGIN_LOGOUT}</a></h4></td>
</tr>
<tr>
- <td class="row1" align="center"><span class="genmed">{L_USERNAME}:</span> <input class="post" type="text" name="username" size="10" />&nbsp; <span class="genmed">{L_PASSWORD}:</span> <input class="post" type="password" name="password" size="10" /><!-- IF S_AUTOLOGIN_ENABLED -->&nbsp; <span class="gensmall">{L_LOG_ME_IN}</span> <input type="checkbox" class="radio" name="autologin" /><!-- ENDIF -->&nbsp; <input type="submit" class="btnmain" name="login" value="{L_LOGIN}" /></td>
+ <td class="row1" align="center"><span class="genmed">{L_USERNAME}{L_COLON}</span> <input class="post" type="text" name="username" size="10" />&nbsp; <span class="genmed">{L_PASSWORD}{L_COLON}</span> <input class="post" type="password" name="password" size="10" autocomplete="off" /><!-- IF S_AUTOLOGIN_ENABLED -->&nbsp; <span class="gensmall">{L_LOG_ME_IN}</span> <input type="checkbox" class="radio" name="autologin" /><!-- ENDIF -->&nbsp; <input type="submit" class="btnmain" name="login" value="{L_LOGIN}" /></td>
</tr>
</table>
{S_LOGIN_REDIRECT}
@@ -136,9 +158,16 @@
<!-- IF S_DISPLAY_POST_INFO or TOTAL_TOPICS -->
<table width="100%" cellspacing="1">
<tr>
+ <td align="{S_CONTENT_FLOW_BEGIN}" valign="middle" nowrap="nowrap">
+ <!-- EVENT viewforum_buttons_top_before -->
+
<!-- IF S_DISPLAY_POST_INFO and not S_IS_BOT -->
- <td align="{S_CONTENT_FLOW_BEGIN}" valign="middle"><a href="{U_POST_NEW_TOPIC}">{POST_IMG}</a></td>
+ <a href="{U_POST_NEW_TOPIC}" class="imageset">{POST_IMG}</a>
<!-- ENDIF -->
+
+ <!-- EVENT viewforum_buttons_top_after -->
+ </td>
+
<!-- IF TOTAL_TOPICS -->
<td class="nav" valign="middle" nowrap="nowrap">&nbsp;{PAGE_NUMBER}<br /></td>
<td class="gensmall" nowrap="nowrap">&nbsp;[ {TOTAL_TOPICS} ]&nbsp;</td>
@@ -154,7 +183,7 @@
<td class="cat" colspan="<!-- IF S_TOPIC_ICONS -->7<!-- ELSE -->6<!-- ENDIF -->">
<table width="100%" cellspacing="0">
<tr class="nav">
- <td valign="middle">&nbsp;<!-- IF S_WATCH_FORUM_LINK and not S_IS_BOT --><a href="{S_WATCH_FORUM_LINK}">{S_WATCH_FORUM_TITLE}</a><!-- ENDIF --></td>
+ <td valign="middle">&nbsp;<!-- IF U_WATCH_FORUM_LINK and not S_IS_BOT --><a href="{U_WATCH_FORUM_LINK}">{S_WATCH_FORUM_TITLE}</a><!-- ENDIF --></td>
<td align="{S_CONTENT_FLOW_END}" valign="middle"><!-- IF not S_IS_BOT and U_MARK_TOPICS and .topicrow --><a href="{U_MARK_TOPICS}">{L_MARK_TOPICS_READ}</a><!-- ENDIF -->&nbsp;</td>
</tr>
</table>
@@ -191,17 +220,33 @@
<td class="row1" width="25" align="center"><!-- IF topicrow.TOPIC_ICON_IMG --><img src="{T_ICONS_PATH}{topicrow.TOPIC_ICON_IMG}" width="{topicrow.TOPIC_ICON_IMG_WIDTH}" height="{topicrow.TOPIC_ICON_IMG_HEIGHT}" alt="" title="" /><!-- ENDIF --></td>
<!-- ENDIF -->
<td class="row1">
- <!-- IF topicrow.S_UNREAD_TOPIC --><a href="{topicrow.U_NEWEST_POST}">{NEWEST_POST_IMG}</a><!-- ENDIF -->
- {topicrow.ATTACH_ICON_IMG} <!-- IF topicrow.S_HAS_POLL or topicrow.S_TOPIC_MOVED --><b>{topicrow.TOPIC_TYPE}</b> <!-- ENDIF --><a title="{L_POSTED}: {topicrow.FIRST_POST_TIME}" href="{topicrow.U_VIEW_TOPIC}" class="topictitle">{topicrow.TOPIC_TITLE}</a>
+ <!-- EVENT topiclist_row_prepend -->
+ <!-- IF topicrow.S_UNREAD_TOPIC --><a href="{topicrow.U_NEWEST_POST}" class="imageset">{NEWEST_POST_IMG}</a><!-- ENDIF -->
+ {topicrow.ATTACH_ICON_IMG} <!-- IF topicrow.S_HAS_POLL or topicrow.S_TOPIC_MOVED --><b>{topicrow.TOPIC_TYPE}</b> <!-- ENDIF -->
+ <a title="{L_POSTED}{L_COLON} {topicrow.FIRST_POST_TIME}" href="{topicrow.U_VIEW_TOPIC}" class="topictitle">{topicrow.TOPIC_TITLE}</a>
<!-- IF topicrow.S_TOPIC_UNAPPROVED or topicrow.S_POSTS_UNAPPROVED -->
- <a href="{topicrow.U_MCP_QUEUE}">{topicrow.UNAPPROVED_IMG}</a>&nbsp;
+ <a href="{topicrow.U_MCP_QUEUE}" class="imageset">{topicrow.UNAPPROVED_IMG}</a>&nbsp;
+ <!-- ENDIF -->
+ <!-- IF topicrow.S_TOPIC_DELETED -->
+ <a href="{topicrow.U_MCP_QUEUE}" class="imageset">{DELETED_IMG}</a>&nbsp;
<!-- ENDIF -->
<!-- IF topicrow.S_TOPIC_REPORTED -->
- <a href="{topicrow.U_MCP_REPORT}">{REPORTED_IMG}</a>&nbsp;
+ <a href="{topicrow.U_MCP_REPORT}" class="imageset">{REPORTED_IMG}</a>&nbsp;
<!-- ENDIF -->
- <!-- IF topicrow.PAGINATION -->
- <p class="gensmall"> [ {GOTO_PAGE_IMG}{L_GOTO_PAGE}: {topicrow.PAGINATION} ] </p>
+ <!-- IF .topicrow.pagination -->
+ <p class="gensmall"> [ {GOTO_PAGE_IMG}{L_GOTO_PAGE}{L_COLON}
+ <!-- BEGIN pagination -->
+ <!-- IF topicrow.pagination.S_IS_PREV -->
+ <!-- ELSEIF topicrow.pagination.S_IS_CURRENT --><strong>{topicrow.pagination.PAGE_NUMBER}</strong>
+ <!-- ELSEIF topicrow.pagination.S_IS_ELLIPSIS --> {L_ELLIPSIS}
+ <!-- ELSEIF topicrow.pagination.S_IS_NEXT -->
+ <!-- ELSE --><a href="{topicrow.pagination.PAGE_URL}">{topicrow.pagination.PAGE_NUMBER}</a>
+ <!-- ENDIF -->
+ <!-- END pagination -->
+ ] </p>
<!-- ENDIF -->
+ <!-- IF topicrow.S_POST_GLOBAL and FORUM_ID != topicrow.FORUM_ID --><p class="gensmall">{L_IN} <a href="{topicrow.U_VIEW_FORUM}">{topicrow.FORUM_NAME}</a></p><!-- ENDIF -->
+ <!-- EVENT topiclist_row_append -->
</td>
<td class="row2" width="130" align="center"><p class="topicauthor">{topicrow.TOPIC_AUTHOR_FULL}</p></td>
<td class="row1" width="50" align="center"><p class="topicdetails">{topicrow.REPLIES}</p></td>
@@ -209,7 +254,7 @@
<td class="row1" width="140" align="center">
<p class="topicdetails" style="white-space: nowrap;">{topicrow.LAST_POST_TIME}</p>
<p class="topicdetails">{topicrow.LAST_POST_AUTHOR_FULL}
- <!-- IF not S_IS_BOT --><a href="{topicrow.U_LAST_POST}">{LAST_POST_IMG}</a><!-- ENDIF -->
+ <!-- IF not S_IS_BOT --><a href="{topicrow.U_LAST_POST}" class="imageset">{LAST_POST_IMG}</a><!-- ENDIF -->
</p>
</td>
</tr>
@@ -233,7 +278,7 @@
<!-- ELSE -->
<td class="cat" colspan="6">
<!-- ENDIF -->
- <form method="post" action="{S_FORUM_ACTION}"><span class="gensmall">{L_DISPLAY_TOPICS}:</span>&nbsp;{S_SELECT_SORT_DAYS}&nbsp;<span class="gensmall">{L_SORT_BY}</span> {S_SELECT_SORT_KEY} {S_SELECT_SORT_DIR}&nbsp;<input class="btnlite" type="submit" name="sort" value="{L_GO}" /></form>
+ <form method="post" action="{S_FORUM_ACTION}"><span class="gensmall">{L_DISPLAY_TOPICS}{L_COLON}</span>&nbsp;{S_SELECT_SORT_DAYS}&nbsp;<span class="gensmall">{L_SORT_BY}</span> {S_SELECT_SORT_KEY} {S_SELECT_SORT_DIR}&nbsp;<input class="btnlite" type="submit" name="sort" value="{L_GO}" /></form>
</td>
</tr>
<!-- ENDIF -->
@@ -243,9 +288,16 @@
<!-- IF S_DISPLAY_POST_INFO or TOTAL_TOPICS -->
<table width="100%" cellspacing="1">
<tr>
+ <td align="{S_CONTENT_FLOW_BEGIN}" valign="middle" nowrap="nowrap">
+ <!-- EVENT viewforum_buttons_bottom_before -->
+
<!-- IF S_DISPLAY_POST_INFO and not S_IS_BOT -->
- <td align="{S_CONTENT_FLOW_BEGIN}" valign="middle"><a href="{U_POST_NEW_TOPIC}">{POST_IMG}</a></td>
+ <a href="{U_POST_NEW_TOPIC}" class="imageset">{POST_IMG}</a>
<!-- ENDIF -->
+
+ <!-- EVENT viewforum_buttons_bottom_after -->
+ </td>
+
<!-- IF TOTAL_TOPICS -->
<td class="nav" valign="middle" nowrap="nowrap">&nbsp;{PAGE_NUMBER}<br /></td>
<td class="gensmall" nowrap="nowrap">&nbsp;[ {TOTAL_TOPICS} ]&nbsp;</td>
@@ -263,7 +315,7 @@
<!-- IF S_DISPLAY_ONLINE_LIST -->
<br clear="all" />
- <table class="tablebg" width="100%" cellspacing="1">
+ <table class="tablebg stat-block online-list" width="100%" cellspacing="1">
<tr>
<td class="cat"><h4>{L_WHO_IS_ONLINE}</h4></td>
</tr>
@@ -326,4 +378,4 @@
</tr>
</table>
-<!-- INCLUDE overall_footer.html --> \ No newline at end of file
+<!-- INCLUDE overall_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/viewonline_body.html b/phpBB/styles/subsilver2/template/viewonline_body.html
index 1fcab016b6..70b8b52efa 100644
--- a/phpBB/styles/subsilver2/template/viewonline_body.html
+++ b/phpBB/styles/subsilver2/template/viewonline_body.html
@@ -4,11 +4,11 @@
<h4>{TOTAL_GUEST_USERS_ONLINE}<!-- IF S_SWITCH_GUEST_DISPLAY --> [ <a href="{U_SWITCH_GUEST_DISPLAY}">{L_SWITCH_GUEST_DISPLAY}</a> ]<!-- ENDIF --></h4>
<br />
-<!-- IF PAGINATION -->
+<!-- IF .pagination -->
<table width="100%" cellspacing="1">
<tr>
<td class="nav" valign="middle" nowrap="nowrap">&nbsp;{PAGE_NUMBER}<br /></td>
- <td class="gensmall" width="100%" align="{S_CONTENT_FLOW_END}" nowrap="nowrap"><b><a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{L_GOTO_PAGE}</a> <!-- IF PREVIOUS_PAGE --><a href="{PREVIOUS_PAGE}">{L_PREVIOUS}</a>&nbsp;&nbsp;<!-- ENDIF -->{PAGINATION}<!-- IF NEXT_PAGE -->&nbsp;&nbsp;<a href="{NEXT_PAGE}">{L_NEXT}</a><!-- ENDIF --></b></td>
+ <td class="gensmall" width="100%" align="{S_CONTENT_FLOW_END}" nowrap="nowrap"><!-- INCLUDE pagination.html --></td>
</tr>
</table>
<!-- ENDIF -->
@@ -21,7 +21,7 @@
</tr>
<!-- BEGIN user_row -->
<tr>
- <td class="row1"><p class="gen">{user_row.USERNAME_FULL}</p><!-- IF user_row.USER_IP --><p class="gensmall">{L_IP}: <a href="{user_row.U_USER_IP}">{user_row.USER_IP}</a> &#187; <a href="{user_row.U_WHOIS}" onclick="popup(this.href, 750, 500); return false;">{L_WHOIS}</a></p><!-- ENDIF -->
+ <td class="row1"><p class="gen">{user_row.USERNAME_FULL}</p><!-- IF user_row.USER_IP --><p class="gensmall">{L_IP}{L_COLON} <a href="{user_row.U_USER_IP}">{user_row.USER_IP}</a> &#187; <a href="{user_row.U_WHOIS}" onclick="popup(this.href, 750, 500); return false;">{L_WHOIS}</a></p><!-- ENDIF -->
<!-- IF user_row.USER_BROWSER -->{user_row.USER_BROWSER}<!-- ENDIF --></td>
<td class="row2" align="center" nowrap="nowrap"><p class="genmed">&nbsp;{user_row.LASTUPDATE}</p></td>
<td class="row1"><p class="genmed"><a href="{user_row.U_FORUM_LOCATION}">{user_row.FORUM_LOCATION}</a></p></td>
@@ -35,11 +35,11 @@
<!-- ENDIF -->
</table>
-<!-- IF PAGINATION -->
+<!-- IF .pagination -->
<table width="100%" cellspacing="1">
<tr>
<td class="nav" valign="middle" nowrap="nowrap">&nbsp;{PAGE_NUMBER}<br /></td>
- <td class="gensmall" width="100%" align="{S_CONTENT_FLOW_END}" nowrap="nowrap"><b><a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{L_GOTO_PAGE}</a> <!-- IF PREVIOUS_PAGE --><a href="{PREVIOUS_PAGE}">{L_PREVIOUS}</a>&nbsp;&nbsp;<!-- ENDIF -->{PAGINATION}<!-- IF NEXT_PAGE -->&nbsp;&nbsp;<a href="{NEXT_PAGE}">{L_NEXT}</a><!-- ENDIF --></b></td>
+ <td class="gensmall" width="100%" align="{S_CONTENT_FLOW_END}" nowrap="nowrap"><!-- INCLUDE pagination.html --></td>
</tr>
</table>
<!-- ENDIF -->
@@ -54,4 +54,4 @@
<div align="{S_CONTENT_FLOW_END}"><!-- INCLUDE jumpbox.html --></div>
-<!-- INCLUDE overall_footer.html --> \ No newline at end of file
+<!-- INCLUDE overall_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/viewonline_whois.html b/phpBB/styles/subsilver2/template/viewonline_whois.html
index 033d848ac4..ca5b326df8 100644
--- a/phpBB/styles/subsilver2/template/viewonline_whois.html
+++ b/phpBB/styles/subsilver2/template/viewonline_whois.html
@@ -9,4 +9,4 @@
</tr>
</table>
-<!-- INCLUDE simple_footer.html --> \ No newline at end of file
+<!-- INCLUDE simple_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/viewtopic_body.html b/phpBB/styles/subsilver2/template/viewtopic_body.html
index 630871af61..e340334cf8 100644
--- a/phpBB/styles/subsilver2/template/viewtopic_body.html
+++ b/phpBB/styles/subsilver2/template/viewtopic_body.html
@@ -1,7 +1,7 @@
<!-- INCLUDE overall_header.html -->
<!-- IF S_FORUM_RULES -->
- <div class="forumrules">
+ <div class="forumrules<!-- IF U_FORUM_RULES --> rules-link<!-- ENDIF -->">
<!-- IF U_FORUM_RULES -->
<h3>{L_FORUM_RULES}</h3><br />
<a href="{U_FORUM_RULES}"><b>{L_FORUM_RULES_LINK}</b></a>
@@ -15,13 +15,14 @@
<!-- ENDIF -->
<div id="pageheader">
- <h2><a class="titles" href="{U_VIEW_TOPIC}">{TOPIC_TITLE}</a></h2>
+ <h2><!-- EVENT viewtopic_topic_title_prepend --><a class="titles" href="{U_VIEW_TOPIC}">{TOPIC_TITLE}</a><!-- EVENT viewtopic_topic_title_append --></h2>
+ <!-- EVENT viewtopic_topic_title_after -->
<!-- IF MODERATORS -->
- <p class="moderators"><!-- IF S_SINGLE_MODERATOR -->{L_MODERATOR}<!-- ELSE -->{L_MODERATORS}<!-- ENDIF -->: {MODERATORS}</p>
+ <p class="moderators"><!-- IF S_SINGLE_MODERATOR -->{L_MODERATOR}<!-- ELSE -->{L_MODERATORS}<!-- ENDIF -->{L_COLON} {MODERATORS}</p>
<!-- ENDIF -->
<!-- IF U_MCP -->
- <p class="linkmcp">[ <a href="{U_MCP}">{L_MCP}</a> ]</p>
+ <p class="linkmcp">[&nbsp;<!-- IF U_ACP --><a href="{U_ACP}">{L_ACP}</a><!-- IF U_MCP -->&nbsp;|&nbsp;<!-- ENDIF --><!-- ENDIF --><!-- IF U_MCP --><a href="{U_MCP}">{L_MCP}</a><!-- ENDIF -->&nbsp;]</p>
<!-- ENDIF -->
</div>
@@ -32,15 +33,19 @@
<table width="100%" cellspacing="1">
<tr>
<td align="{S_CONTENT_FLOW_BEGIN}" valign="middle" nowrap="nowrap">
+ <!-- EVENT viewtopic_buttons_top_before -->
+
<!-- IF not S_IS_BOT -->
- <!-- IF S_DISPLAY_POST_INFO --><a href="{U_POST_NEW_TOPIC}">{POST_IMG}</a>&nbsp;<!-- ENDIF -->
- <!-- IF S_DISPLAY_REPLY_INFO --><a href="{U_POST_REPLY_TOPIC}">{REPLY_IMG}</a><!-- ENDIF -->
+ <!-- IF S_DISPLAY_POST_INFO --><a href="{U_POST_NEW_TOPIC}" class="imageset">{POST_IMG}</a>&nbsp;<!-- ENDIF -->
+ <!-- IF S_DISPLAY_REPLY_INFO --><a href="{U_POST_REPLY_TOPIC}" class="imageset">{REPLY_IMG}</a><!-- ENDIF -->
<!-- ENDIF -->
+
+ <!-- EVENT viewtopic_buttons_top_after -->
</td>
<!-- IF TOTAL_POSTS -->
<td class="nav" valign="middle" nowrap="nowrap">&nbsp;{PAGE_NUMBER}<br /></td>
<td class="gensmall" nowrap="nowrap">&nbsp;[ {TOTAL_POSTS} ]&nbsp;</td>
- <td class="gensmall" width="100%" align="{S_CONTENT_FLOW_END}" nowrap="nowrap"><!-- INCLUDE pagination.html --></td>
+ <td class="gensmall" width="100%" align="{S_CONTENT_FLOW_END}" nowrap="nowrap"><!-- INCLUDE pagination.html --><!-- EVENT viewtopic_body_pagination_top_after --></td>
<!-- ENDIF -->
</tr>
</table>
@@ -52,8 +57,8 @@
<tr>
<td class="nav" nowrap="nowrap">&nbsp;
<!-- IF not S_IS_BOT -->
- <!-- IF U_WATCH_TOPIC --><a href="{U_WATCH_TOPIC}" title="{L_WATCH_TOPIC}">{L_WATCH_TOPIC}</a><!-- IF U_PRINT_TOPIC or U_EMAIL_TOPIC or U_BUMP_TOPIC or U_BOOKMARK_TOPIC --> | <!-- ENDIF --><!-- ENDIF -->
- <!-- IF U_BOOKMARK_TOPIC --><a href="{U_BOOKMARK_TOPIC}" title="{L_BOOKMARK_TOPIC}">{L_BOOKMARK_TOPIC}</a><!-- IF U_PRINT_TOPIC or U_EMAIL_TOPIC or U_BUMP_TOPIC --> | <!-- ENDIF --><!-- ENDIF -->
+ <!-- IF U_WATCH_TOPIC --><a href="{U_WATCH_TOPIC}" title="{S_WATCH_TOPIC_TITLE}">{S_WATCH_TOPIC_TITLE}</a><!-- IF U_PRINT_TOPIC or U_EMAIL_TOPIC or U_BUMP_TOPIC or U_BOOKMARK_TOPIC --> | <!-- ENDIF --><!-- ENDIF -->
+ <!-- IF U_BOOKMARK_TOPIC --><a href="{U_BOOKMARK_TOPIC}" title="{S_BOOKMARK_TOPIC}">{S_BOOKMARK_TOPIC}</a><!-- IF U_PRINT_TOPIC or U_EMAIL_TOPIC or U_BUMP_TOPIC --> | <!-- ENDIF --><!-- ENDIF -->
<!-- IF U_PRINT_TOPIC --><a href="{U_PRINT_TOPIC}" title="{L_PRINT_TOPIC}">{L_PRINT_TOPIC}</a><!-- IF U_EMAIL_TOPIC or U_BUMP_TOPIC --> | <!-- ENDIF --><!-- ENDIF -->
<!-- IF U_EMAIL_TOPIC --><a href="{U_EMAIL_TOPIC}" title="{L_EMAIL_TOPIC}">{L_EMAIL_TOPIC}</a><!-- IF U_BUMP_TOPIC --> | <!-- ENDIF --><!-- ENDIF -->
<!-- IF U_BUMP_TOPIC --><a href="{U_BUMP_TOPIC}" title="{L_BUMP_TOPIC}">{L_BUMP_TOPIC}</a><!-- ENDIF -->
@@ -64,6 +69,7 @@
</table>
</td>
</tr>
+<!-- EVENT viewtopic_body_poll_before -->
<!-- IF S_HAS_POLL -->
<tr>
<td class="row2" colspan="2" align="center"><br clear="all" />
@@ -72,15 +78,16 @@
<table cellspacing="0" cellpadding="4" border="0" align="center">
<tr>
- <td align="center"><span class="gen"><b>{POLL_QUESTION}</b></span><br /><span class="gensmall">{L_POLL_LENGTH}</span></td>
+ <td align="center"><span class="gen"><!-- EVENT viewtopic_body_poll_question_prepend --><b>{POLL_QUESTION}</b><!-- EVENT viewtopic_body_poll_question_append --></span><br /><span class="gensmall">{L_POLL_LENGTH}</span></td>
</tr>
<tr>
<td align="{S_CONTENT_FLOW_BEGIN}">
<table cellspacing="0" cellpadding="2" border="0">
<!-- BEGIN poll_option -->
<tr>
+ <!-- EVENT viewtopic_body_poll_option_before -->
<!-- IF S_CAN_VOTE -->
- <td>
+ <td<!-- IF poll_option.POLL_OPTION_MOST_VOTES --> class="most-votes"<!-- ENDIF -->>
<!-- IF S_IS_MULTI_CHOICE -->
<input type="checkbox" class="radio" name="vote_id[]" value="{poll_option.POLL_OPTION_ID}"<!-- IF poll_option.POLL_OPTION_VOTED --> checked="checked"<!-- ENDIF --> />
<!-- ELSE -->
@@ -90,13 +97,14 @@
<!-- ENDIF -->
<td><span class="gen">{poll_option.POLL_OPTION_CAPTION}</span></td>
<!-- IF S_DISPLAY_RESULTS -->
- <td dir="ltr">{POLL_LEFT_CAP_IMG}{poll_option.POLL_OPTION_IMG}{POLL_RIGHT_CAP_IMG}</td>
+ <td dir="ltr">{POLL_LEFT_CAP_IMG}<span class="imageset poll_center" style="width: {poll_option.POLL_OPTION_WIDTH}px; background-repeat: repeat-x;">{poll_option.POLL_OPTION_PERCENT}</span>{POLL_RIGHT_CAP_IMG}</td>
<td class="gen" align="{S_CONTENT_FLOW_END}"><b>&nbsp;{poll_option.POLL_OPTION_PERCENT}&nbsp;</b></td>
<td class="gen" align="center">[ {poll_option.POLL_OPTION_RESULT} ]</td>
<!-- IF poll_option.POLL_OPTION_VOTED -->
<td class="gensmall" valign="top"><b title="{L_POLL_VOTED_OPTION}">x</b></td>
<!-- ENDIF -->
<!-- ENDIF -->
+ <!-- EVENT viewtopic_body_poll_option_after -->
</tr>
<!-- END poll_option -->
</table>
@@ -109,7 +117,7 @@
<!-- ENDIF -->
<!-- IF S_DISPLAY_RESULTS -->
<tr>
- <td class="gensmall" colspan="4" align="center"><b>{L_TOTAL_VOTES} : {TOTAL_VOTES}</b></td>
+ <td class="gensmall" colspan="4" align="center"><b>{L_TOTAL_VOTES}{L_COLON} {TOTAL_VOTES}</b></td>
</tr>
<!-- ELSE -->
<tr>
@@ -124,9 +132,11 @@
</td>
</tr>
<!-- ENDIF -->
+<!-- EVENT viewtopic_body_poll_after -->
</table>
<!-- BEGIN postrow -->
+ <!-- EVENT viewtopic_body_postrow_post_before -->
<table class="tablebg" width="100%" cellspacing="1">
<!-- IF postrow.S_FIRST_ROW -->
<tr>
@@ -136,24 +146,43 @@
<!-- ENDIF -->
<!-- IF postrow.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
- <!-- IF postrow.S_IGNORE_POST -->
- <td class="gensmall" colspan="2" height="25" align="center"><!-- IF postrow.S_FIRST_UNREAD --><a name="unread"></a><!-- ENDIF --><a name="p{postrow.POST_ID}"></a>{postrow.L_IGNORE_POST}</td>
+ <!-- IF postrow.S_POST_HIDDEN -->
+ <td class="gensmall" colspan="2" height="25" align="center">
+ <!-- IF postrow.S_FIRST_UNREAD --><a id="unread" class="anchor" data-url="{postrow.U_MINI_POST}"></a><!-- ENDIF -->
+ <a name="p{postrow.POST_ID}" class="anchor"></a>
+ <!-- IF postrow.S_POST_HIDDEN -->
+ <!-- IF postrow.S_POST_DELETED -->
+ {postrow.L_POST_DELETED_MESSAGE}
+ <!-- ELSEIF postrow.S_IGNORE_POST -->
+ {postrow.L_IGNORE_POST}
+ <!-- ENDIF -->
+ <br />{postrow.L_POST_DISPLAY}
+ <!-- ENDIF -->
+ </td>
<!-- ELSE -->
<td align="center" valign="middle">
- <!-- IF postrow.S_FIRST_UNREAD --><a name="unread"></a><!-- ENDIF --><a name="p{postrow.POST_ID}"></a>
+ <!-- IF postrow.S_FIRST_UNREAD -->
+ <a id="unread" class="anchor"<!-- IF S_UNREAD_VIEW --> data-url="{postrow.U_MINI_POST}"<!-- ENDIF -->></a>
+ <!-- ENDIF -->
+ <a name="p{postrow.POST_ID}" class="anchor"></a>
+ <!-- EVENT viewtopic_body_post_author_before -->
<b class="postauthor"<!-- IF postrow.POST_AUTHOR_COLOUR --> style="color: {postrow.POST_AUTHOR_COLOUR}"<!-- ENDIF -->>{postrow.POST_AUTHOR}</b>
+ <!-- EVENT viewtopic_body_post_author_after -->
</td>
+ <!-- EVENT viewtopic_body_postrow_post_details_before -->
+ <!-- EVENT viewtopic_body_post_subject_before -->
<td width="100%" height="25">
<table width="100%" cellspacing="0">
<tr>
<!-- IF postrow.POST_ICON_IMG -->
<td><img src="{T_ICONS_PATH}{postrow.POST_ICON_IMG}" width="{postrow.POST_ICON_IMG_WIDTH}" height="{postrow.POST_ICON_IMG_HEIGHT}" alt="" title="" /></td>
<!-- ENDIF -->
- <td class="gensmall" width="100%"><div style="float: {S_CONTENT_FLOW_BEGIN};">&nbsp;<b>{L_POST_SUBJECT}:</b> <a href="#p{postrow.POST_ID}">{postrow.POST_SUBJECT}</a></div><div style="float: {S_CONTENT_FLOW_END};"><!-- IF S_IS_BOT -->{postrow.MINI_POST_IMG}<!-- ELSE --><a href="{postrow.U_MINI_POST}">{postrow.MINI_POST_IMG}</a><!-- ENDIF --><b>{L_POSTED}:</b> {postrow.POST_DATE}&nbsp;</div></td>
+ <td class="gensmall" width="100%"><div style="float: {S_CONTENT_FLOW_BEGIN};">&nbsp;<b>{L_POST_SUBJECT}{L_COLON}</b> <a href="#p{postrow.POST_ID}">{postrow.POST_SUBJECT}</a></div><div style="float: {S_CONTENT_FLOW_END};"><!-- IF S_IS_BOT -->{postrow.MINI_POST_IMG}<!-- ELSE --><a href="{postrow.U_MINI_POST}" class="imageset">{postrow.MINI_POST_IMG}</a><!-- ENDIF --><b>{L_POSTED}{L_COLON}</b> {postrow.POST_DATE}&nbsp;</div></td>
</tr>
</table>
</td>
+ <!-- EVENT viewtopic_body_postrow_post_details_after -->
</tr>
<!-- IF postrow.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
@@ -165,6 +194,7 @@
<td>{postrow.ONLINE_IMG}</td>
</tr>
<!-- ENDIF -->
+ <!-- EVENT viewtopic_body_postrow_rank_before -->
<!-- IF postrow.RANK_TITLE -->
<tr>
<td class="postdetails">{postrow.RANK_TITLE}</td>
@@ -175,11 +205,16 @@
<td>{postrow.RANK_IMG}</td>
</tr>
<!-- ENDIF -->
+ <!-- EVENT viewtopic_body_postrow_rank_after -->
+
+ <!-- EVENT viewtopic_body_avatar_before -->
<!-- IF postrow.POSTER_AVATAR -->
<tr>
<td>{postrow.POSTER_AVATAR}</td>
</tr>
<!-- ENDIF -->
+ <!-- EVENT viewtopic_body_avatar_after -->
+
<!-- IF not (postrow.ONLINE_IMG or postrow.RANK_TITLE or postrow.RANK_IMG or postrow.POSTER_AVATAR) -->
<tr>
<td></td>
@@ -188,18 +223,22 @@
</table>
<span class="postdetails">
- <!-- IF postrow.POSTER_JOINED --><br /><b>{L_JOINED}:</b> {postrow.POSTER_JOINED}<!-- ENDIF -->
- <!-- IF postrow.POSTER_POSTS != '' --><br /><b>{L_POSTS}:</b> {postrow.POSTER_POSTS}<!-- ENDIF -->
- <!-- IF postrow.POSTER_FROM --><br /><b>{L_LOCATION}:</b> {postrow.POSTER_FROM}<!-- ENDIF -->
+ <!-- IF postrow.POSTER_JOINED --><br /><b>{L_JOINED}{L_COLON}</b> {postrow.POSTER_JOINED}<!-- ENDIF -->
+ <!-- IF postrow.POSTER_POSTS != '' --><br /><b>{L_POSTS}{L_COLON}</b> {postrow.POSTER_POSTS}<!-- ENDIF -->
+ <!-- IF postrow.POSTER_WARNINGS --><br /><b>{L_WARNINGS}{L_COLON}</b> {postrow.POSTER_WARNINGS}<!-- ENDIF -->
<!-- IF postrow.S_PROFILE_FIELD1 -->
<!-- Use a construct like this to include admin defined profile fields. Replace FIELD1 with the name of your field. -->
- <br /><b>{postrow.PROFILE_FIELD1_NAME}:</b> {postrow.PROFILE_FIELD1_VALUE}
+ <br /><b>{postrow.PROFILE_FIELD1_NAME}{L_COLON}</b> {postrow.PROFILE_FIELD1_VALUE}
<!-- ENDIF -->
+ <!-- EVENT viewtopic_body_postrow_custom_fields_before -->
<!-- BEGIN custom_fields -->
- <br /><b>{postrow.custom_fields.PROFILE_FIELD_NAME}:</b> {postrow.custom_fields.PROFILE_FIELD_VALUE}
+ <!-- IF not postrow.custom_fields.S_PROFILE_CONTACT -->
+ <br /><b>{postrow.custom_fields.PROFILE_FIELD_NAME}{L_COLON}</b> {postrow.custom_fields.PROFILE_FIELD_VALUE}
+ <!-- ENDIF -->
<!-- END custom_fields -->
+ <!-- EVENT viewtopic_body_postrow_custom_fields_after -->
</span>
</td>
@@ -207,10 +246,14 @@
<table width="100%" cellspacing="5">
<tr>
<td>
- <!-- IF postrow.S_POST_UNAPPROVED or postrow.S_POST_REPORTED -->
+ <!-- IF postrow.S_POST_UNAPPROVED or postrow.S_POST_DELETED or postrow.S_POST_REPORTED -->
<table width="100%" cellspacing="0">
<tr>
- <td class="gensmall"><!-- IF postrow.S_POST_UNAPPROVED --><span class="postapprove">{UNAPPROVED_IMG} <a href="{postrow.U_MCP_APPROVE}">{L_POST_UNAPPROVED}</a></span><br /> <!-- ENDIF --> <!-- IF postrow.S_POST_REPORTED --><span class="postreported">{REPORTED_IMG} <a href="{postrow.U_MCP_REPORT}">{L_POST_REPORTED}</a></span><!-- ENDIF --></td>
+ <td class="gensmall">
+ <!-- IF postrow.S_POST_UNAPPROVED --><span class="postapprove">{UNAPPROVED_IMG} <a href="{postrow.U_MCP_APPROVE}">{L_POST_UNAPPROVED}</a></span><br /> <!-- ENDIF -->
+ <!-- IF postrow.S_POST_DELETED --><span class="postapprove">{DELETED_IMG} <a href="{postrow.U_MCP_RESTORE}">{L_POST_DELETED}</a></span><br /> <!-- ENDIF -->
+ <!-- IF postrow.S_POST_REPORTED --><span class="postreported">{REPORTED_IMG} <a href="{postrow.U_MCP_REPORT}">{L_POST_REPORTED}</a></span><!-- ENDIF -->
+ </td>
</tr>
</table>
@@ -224,7 +267,7 @@
<table class="tablebg" width="100%" cellspacing="1">
<tr>
- <td class="row3"><b class="genmed">{L_ATTACHMENTS}: </b></td>
+ <td class="row3"><b class="genmed">{L_ATTACHMENTS}{L_COLON} </b></td>
</tr>
<!-- BEGIN attachment -->
<tr>
@@ -241,7 +284,23 @@
<div class="postbody"><br />_________________<br />{postrow.SIGNATURE}</div>
<!-- ENDIF -->
- <!-- IF postrow.EDITED_MESSAGE or postrow.EDIT_REASON -->
+ <!-- EVENT viewtopic_body_postrow_post_notices_before -->
+ <!-- IF postrow.DELETED_MESSAGE or postrow.DELETE_REASON -->
+ <!-- IF postrow.DELETE_REASON -->
+ <br /><br />
+ <table class="tablebg" width="100%" cellspacing="1">
+ <tr>
+ <td class="row3"><span class="gensmall">{postrow.DELETED_MESSAGE}</span></td>
+ </tr>
+ <tr>
+ <td class="row2"><span class="genmed">{postrow.DELETE_REASON}</span></td>
+ </tr>
+ </table>
+ <!-- ELSE -->
+ <br /><br />
+ <span class="gensmall">{postrow.DELETED_MESSAGE}</span>
+ <!-- ENDIF -->
+ <!-- ELSEIF postrow.EDITED_MESSAGE or postrow.EDIT_REASON -->
<!-- IF postrow.EDIT_REASON -->
<br /><br />
<table class="tablebg" width="100%" cellspacing="1">
@@ -261,6 +320,9 @@
<!-- IF postrow.BUMPED_MESSAGE -->
<span class="gensmall"><br /><br />{postrow.BUMPED_MESSAGE}</span>
<!-- ENDIF -->
+ <!-- EVENT viewtopic_body_postrow_post_notices_after -->
+
+ <!-- EVENT viewtopic_body_postrow_post_content_footer -->
<!-- IF not postrow.S_HAS_ATTACHMENTS --><br clear="all" /><br /><!-- ENDIF -->
@@ -268,10 +330,10 @@
<tr valign="middle">
<td class="gensmall" align="{S_CONTENT_FLOW_END}">
<!-- IF not S_IS_BOT -->
- <!-- IF postrow.U_REPORT --><a href="{postrow.U_REPORT}">{REPORT_IMG}</a> <!-- ENDIF -->
- <!-- IF postrow.U_INFO --><a href="{postrow.U_INFO}">{INFO_IMG}</a> <!-- ENDIF -->
- <!-- IF postrow.U_WARN --><a href="{postrow.U_WARN}">{WARN_IMG}</a> <!-- ENDIF -->
- <!-- IF postrow.U_DELETE --><a href="{postrow.U_DELETE}">{DELETE_IMG}</a> <!-- ENDIF -->
+ <!-- IF postrow.U_REPORT --><a href="{postrow.U_REPORT}" class="imageset">{REPORT_IMG}</a> <!-- ENDIF -->
+ <!-- IF postrow.U_INFO --><a href="{postrow.U_INFO}" class="imageset">{INFO_IMG}</a> <!-- ENDIF -->
+ <!-- IF postrow.U_WARN --><a href="{postrow.U_WARN}" class="imageset">{WARN_IMG}</a> <!-- ENDIF -->
+ <!-- IF postrow.U_DELETE --><a href="{postrow.U_DELETE}" class="imageset">{DELETE_IMG}</a> <!-- ENDIF -->
<!-- ENDIF -->
</td>
</tr>
@@ -284,8 +346,24 @@
<!-- IF postrow.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
- <td class="profile"><strong><a href="#wrapheader">{L_BACK_TO_TOP}</a></strong></td>
- <td><div class="gensmall" style="float: {S_CONTENT_FLOW_BEGIN};">&nbsp;<!-- IF postrow.U_POST_AUTHOR --><a href="{postrow.U_POST_AUTHOR}">{PROFILE_IMG}</a> <!-- ENDIF --> <!-- IF postrow.U_PM --><a href="{postrow.U_PM}">{PM_IMG}</a> <!-- ENDIF --> <!-- IF postrow.U_EMAIL --><a href="{postrow.U_EMAIL}">{EMAIL_IMG}</a> <!-- ENDIF -->&nbsp;</div> <div class="gensmall" style="float: {S_CONTENT_FLOW_END};"><!-- IF not S_IS_BOT --><!-- IF postrow.U_EDIT --><a href="{postrow.U_EDIT}">{EDIT_IMG}</a> <!-- ENDIF --> <!-- IF postrow.U_QUOTE --><a href="{postrow.U_QUOTE}">{QUOTE_IMG}</a> <!-- ENDIF --> <!-- ENDIF -->&nbsp;</div></td>
+ <!-- EVENT viewtopic_body_postrow_back2top_before -->
+ <td class="profile"><!-- EVENT viewtopic_body_postrow_back2top_prepend --><strong><a href="#wrapheader">{L_BACK_TO_TOP}</a></strong><!-- EVENT viewtopic_body_postrow_back2top_append --></td>
+ <!-- EVENT viewtopic_body_postrow_back2top_after -->
+ <td>
+ <div class="gensmall" style="float: {S_CONTENT_FLOW_BEGIN};">
+ &nbsp;<!-- IF postrow.U_POST_AUTHOR --><a href="{postrow.U_POST_AUTHOR}" class="imageset">{PROFILE_IMG}</a><!-- ENDIF -->
+ <!-- IF postrow.U_PM --><a href="{postrow.U_PM}" class="imageset">{PM_IMG}</a><!-- ENDIF -->
+ <!-- IF postrow.U_EMAIL --><a href="{postrow.U_EMAIL}" class="imageset">{EMAIL_IMG}</a><!-- ENDIF -->
+ &nbsp;</div>
+ <div class="gensmall" style="float: {S_CONTENT_FLOW_END};">
+ <!-- EVENT viewtopic_body_post_buttons_before -->
+ <!-- IF not S_IS_BOT -->
+ <!-- IF postrow.U_EDIT --><a href="{postrow.U_EDIT}" class="imageset">{EDIT_IMG}</a><!-- ENDIF -->
+ <!-- IF postrow.U_QUOTE --><a href="{postrow.U_QUOTE}" class="imageset">{QUOTE_IMG}</a><!-- ENDIF -->
+ <!-- ENDIF -->
+ <!-- EVENT viewtopic_body_post_buttons_after -->
+ &nbsp;</div>
+ </td>
<!-- ENDIF -->
</tr>
@@ -293,23 +371,30 @@
<td class="spacer" colspan="2" height="1"><img src="images/spacer.gif" alt="" width="1" height="1" /></td>
</tr>
</table>
+ <!-- EVENT viewtopic_body_postrow_post_after -->
<!-- END postrow -->
<!-- IF not S_IS_BOT -->
<table width="100%" cellspacing="1" class="tablebg">
<tr align="center">
- <td class="cat"><form name="viewtopic" method="post" action="{S_TOPIC_ACTION}"><span class="gensmall">{L_DISPLAY_POSTS}:</span> {S_SELECT_SORT_DAYS}&nbsp;<span class="gensmall">{L_SORT_BY}</span> {S_SELECT_SORT_KEY} {S_SELECT_SORT_DIR}&nbsp;<input class="btnlite" type="submit" value="{L_GO}" name="sort" /></form></td>
+ <td class="cat"><form name="viewtopic" method="post" action="{S_TOPIC_ACTION}"><span class="gensmall">{L_DISPLAY_POSTS}{L_COLON}</span> {S_SELECT_SORT_DAYS}&nbsp;<span class="gensmall">{L_SORT_BY}</span> {S_SELECT_SORT_KEY} {S_SELECT_SORT_DIR}&nbsp;<input class="btnlite" type="submit" value="{L_GO}" name="sort" /></form></td>
</tr>
</table>
<!-- ENDIF -->
+ <!-- EVENT viewtopic_body_topic_actions_before -->
+
<table width="100%" cellspacing="1">
<tr>
<td align="{S_CONTENT_FLOW_BEGIN}" valign="middle" nowrap="nowrap">
+ <!-- EVENT viewtopic_buttons_bottom_before -->
+
<!-- IF not S_IS_BOT -->
- <!-- IF S_DISPLAY_POST_INFO --><a href="{U_POST_NEW_TOPIC}">{POST_IMG}</a>&nbsp;<!-- ENDIF -->
- <!-- IF S_DISPLAY_REPLY_INFO --><a href="{U_POST_REPLY_TOPIC}">{REPLY_IMG}</a><!-- ENDIF -->
+ <!-- IF S_DISPLAY_POST_INFO --><a href="{U_POST_NEW_TOPIC}" class="imageset">{POST_IMG}</a>&nbsp;<!-- ENDIF -->
+ <!-- IF S_DISPLAY_REPLY_INFO --><a href="{U_POST_REPLY_TOPIC}" class="imageset">{REPLY_IMG}</a><!-- ENDIF -->
<!-- ENDIF -->
+
+ <!-- EVENT viewtopic_buttons_bottom_after -->
</td>
<!-- IF TOTAL_POSTS -->
<td class="nav" valign="middle" nowrap="nowrap">&nbsp;{PAGE_NUMBER}<br /></td>
@@ -328,12 +413,13 @@
<!-- INCLUDE quickreply_editor.html -->
<!-- ENDIF -->
+<!-- EVENT viewtopic_body_footer_before -->
<!-- INCLUDE breadcrumbs.html -->
<!-- IF S_DISPLAY_ONLINE_LIST -->
<br clear="all" />
- <table class="tablebg" width="100%" cellspacing="1">
+ <table class="tablebg stat-block online-list" width="100%" cellspacing="1">
<tr>
<td class="cat"><h4>{L_WHO_IS_ONLINE}</h4></td>
</tr>
@@ -347,7 +433,19 @@
<table width="100%" cellspacing="1">
<tr>
- <td width="40%" valign="top" nowrap="nowrap" align="{S_CONTENT_FLOW_BEGIN}"><!-- IF S_TOPIC_MOD --><form method="post" action="{S_MOD_ACTION}"><span class="gensmall">{L_QUICK_MOD}:</span> {S_TOPIC_MOD} <input class="btnlite" type="submit" value="{L_GO}" /></form><!-- ENDIF --></td>
+ <td width="40%" valign="top" nowrap="nowrap" align="{S_CONTENT_FLOW_BEGIN}">
+ <!-- IF .quickmod -->
+ <form method="post" action="{S_MOD_ACTION}">
+ <span class="gensmall">{L_QUICK_MOD}{L_COLON}</span>
+ <select name="action" id="quick-mod-select">
+ <!-- BEGIN quickmod -->
+ <option value="{quickmod.VALUE}">{quickmod.TITLE}</option>
+ <!-- END quickmod -->
+ </select>
+ <input class="btnlite" type="submit" value="{L_GO}" />
+ </form>
+ <!-- ENDIF -->
+ </td>
<td align="{S_CONTENT_FLOW_END}" valign="top" nowrap="nowrap"><span class="gensmall"><!-- BEGIN rules -->{rules.RULE}<br /><!-- END rules --></span></td>
</tr>
</table>
@@ -361,4 +459,4 @@
</tr>
</table>
-<!-- INCLUDE overall_footer.html --> \ No newline at end of file
+<!-- INCLUDE overall_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/viewtopic_print.html b/phpBB/styles/subsilver2/template/viewtopic_print.html
index 47b5bdb28e..53b38f414e 100644
--- a/phpBB/styles/subsilver2/template/viewtopic_print.html
+++ b/phpBB/styles/subsilver2/template/viewtopic_print.html
@@ -1,9 +1,8 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<!DOCTYPE html>
<html dir="{S_CONTENT_DIRECTION}" lang="{S_USER_LANG}">
<head>
-<meta http-equiv="Content-Type" content="text/html; charset={S_CONTENT_ENCODING}">
-<meta http-equiv="Content-Style-Type" content="text/css">
-<meta http-equiv="Content-Language" content="{S_USER_LANG}">
+<meta charset="utf-8" />
+<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="robots" content="noindex" />
<title>{SITENAME} :: {PAGE_TITLE}</title>
@@ -25,7 +24,7 @@ td {
line-height: 150%;
}
-.code, .codecontent,
+.code, .codecontent,
.quote, .quotecontent {
margin: 0 5px 0 5px;
padding: 5px;
@@ -68,7 +67,7 @@ hr.sep {
}
//-->
</style>
-
+<!-- EVENT viewtopic_print_head_append -->
</head>
<body>
@@ -91,11 +90,11 @@ hr.sep {
<table width="85%" cellspacing="3" cellpadding="0" border="0" align="center">
<tr>
- <td width="10%" nowrap="nowrap">{L_AUTHOR}:&nbsp;</td>
+ <td width="10%" nowrap="nowrap">{L_AUTHOR}{L_COLON}&nbsp;</td>
<td><b>{postrow.POST_AUTHOR}</b> [ {postrow.POST_DATE} ]</td>
</tr>
<tr>
- <td width="10%" nowrap="nowrap">{L_POST_SUBJECT}:&nbsp;</td>
+ <td width="10%" nowrap="nowrap">{L_POST_SUBJECT}{L_COLON}&nbsp;</td>
<td><b>{postrow.POST_SUBJECT}</b></td>
</tr>
<tr>
@@ -106,7 +105,7 @@ hr.sep {
<table class="tablebg" width="100%" cellspacing="1">
<tr>
- <td><b class="genmed">{L_ATTACHMENTS}: </b></td>
+ <td><b class="genmed">{L_ATTACHMENTS}{L_COLON} </b></td>
</tr>
<!-- BEGIN attachment -->
<tr>
@@ -129,9 +128,9 @@ hr.sep {
<td align="{S_CONTENT_FLOW_END}"><span class="gensmall">{S_TIMEZONE}</span></td>
</tr>
<tr>
- <td colspan="2" align="center"><span class="gensmall">Powered by phpBB&reg; Forum Software &copy; phpBB Group<br />https://www.phpbb.com/</span></td>
+ <td colspan="2" align="center"><span class="gensmall">Powered by phpBB&reg; Forum Software &copy; phpBB Limited<br />https://www.phpbb.com/</span></td>
</tr>
</table>
</body>
-</html> \ No newline at end of file
+</html>
diff --git a/phpBB/styles/subsilver2/imageset/en/button_pm_new.gif b/phpBB/styles/subsilver2/theme/en/button_pm_new.gif
index 07df748d3a..07df748d3a 100644
--- a/phpBB/styles/subsilver2/imageset/en/button_pm_new.gif
+++ b/phpBB/styles/subsilver2/theme/en/button_pm_new.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/en/button_pm_reply.gif b/phpBB/styles/subsilver2/theme/en/button_pm_reply.gif
index c476f06a44..c476f06a44 100644
--- a/phpBB/styles/subsilver2/imageset/en/button_pm_reply.gif
+++ b/phpBB/styles/subsilver2/theme/en/button_pm_reply.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/en/button_topic_locked.gif b/phpBB/styles/subsilver2/theme/en/button_topic_locked.gif
index 124a2d4a7d..124a2d4a7d 100644
--- a/phpBB/styles/subsilver2/imageset/en/button_topic_locked.gif
+++ b/phpBB/styles/subsilver2/theme/en/button_topic_locked.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/en/button_topic_new.gif b/phpBB/styles/subsilver2/theme/en/button_topic_new.gif
index 66e1007129..66e1007129 100644
--- a/phpBB/styles/subsilver2/imageset/en/button_topic_new.gif
+++ b/phpBB/styles/subsilver2/theme/en/button_topic_new.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/en/button_topic_reply.gif b/phpBB/styles/subsilver2/theme/en/button_topic_reply.gif
index e8fe5115a0..e8fe5115a0 100644
--- a/phpBB/styles/subsilver2/imageset/en/button_topic_reply.gif
+++ b/phpBB/styles/subsilver2/theme/en/button_topic_reply.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/en/icon_contact_aim.gif b/phpBB/styles/subsilver2/theme/en/icon_contact_aim.gif
index c6533e2817..c6533e2817 100644
--- a/phpBB/styles/subsilver2/imageset/en/icon_contact_aim.gif
+++ b/phpBB/styles/subsilver2/theme/en/icon_contact_aim.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/en/icon_contact_email.gif b/phpBB/styles/subsilver2/theme/en/icon_contact_email.gif
index f126a1960d..f126a1960d 100644
--- a/phpBB/styles/subsilver2/imageset/en/icon_contact_email.gif
+++ b/phpBB/styles/subsilver2/theme/en/icon_contact_email.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/en/icon_contact_icq.gif b/phpBB/styles/subsilver2/theme/en/icon_contact_icq.gif
index ba3fa12436..ba3fa12436 100644
--- a/phpBB/styles/subsilver2/imageset/en/icon_contact_icq.gif
+++ b/phpBB/styles/subsilver2/theme/en/icon_contact_icq.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/en/icon_contact_jabber.gif b/phpBB/styles/subsilver2/theme/en/icon_contact_jabber.gif
index be2e53f9c2..be2e53f9c2 100644
--- a/phpBB/styles/subsilver2/imageset/en/icon_contact_jabber.gif
+++ b/phpBB/styles/subsilver2/theme/en/icon_contact_jabber.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/theme/en/icon_contact_msnm.gif b/phpBB/styles/subsilver2/theme/en/icon_contact_msnm.gif
new file mode 100644
index 0000000000..1bf681e9a2
--- /dev/null
+++ b/phpBB/styles/subsilver2/theme/en/icon_contact_msnm.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/en/icon_contact_pm.gif b/phpBB/styles/subsilver2/theme/en/icon_contact_pm.gif
index 26ac558c2f..26ac558c2f 100644
--- a/phpBB/styles/subsilver2/imageset/en/icon_contact_pm.gif
+++ b/phpBB/styles/subsilver2/theme/en/icon_contact_pm.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/en/icon_contact_www.gif b/phpBB/styles/subsilver2/theme/en/icon_contact_www.gif
index 14a33b36a5..14a33b36a5 100644
--- a/phpBB/styles/subsilver2/imageset/en/icon_contact_www.gif
+++ b/phpBB/styles/subsilver2/theme/en/icon_contact_www.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/en/icon_contact_yahoo.gif b/phpBB/styles/subsilver2/theme/en/icon_contact_yahoo.gif
index d11711789f..d11711789f 100644
--- a/phpBB/styles/subsilver2/imageset/en/icon_contact_yahoo.gif
+++ b/phpBB/styles/subsilver2/theme/en/icon_contact_yahoo.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/en/icon_post_delete.gif b/phpBB/styles/subsilver2/theme/en/icon_post_delete.gif
index e008e5ff9f..e008e5ff9f 100644
--- a/phpBB/styles/subsilver2/imageset/en/icon_post_delete.gif
+++ b/phpBB/styles/subsilver2/theme/en/icon_post_delete.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/en/icon_post_edit.gif b/phpBB/styles/subsilver2/theme/en/icon_post_edit.gif
index 1511ee34d3..1511ee34d3 100644
--- a/phpBB/styles/subsilver2/imageset/en/icon_post_edit.gif
+++ b/phpBB/styles/subsilver2/theme/en/icon_post_edit.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/en/icon_post_info.gif b/phpBB/styles/subsilver2/theme/en/icon_post_info.gif
index 166de2724f..166de2724f 100644
--- a/phpBB/styles/subsilver2/imageset/en/icon_post_info.gif
+++ b/phpBB/styles/subsilver2/theme/en/icon_post_info.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/en/icon_post_quote.gif b/phpBB/styles/subsilver2/theme/en/icon_post_quote.gif
index 4cf103280c..4cf103280c 100644
--- a/phpBB/styles/subsilver2/imageset/en/icon_post_quote.gif
+++ b/phpBB/styles/subsilver2/theme/en/icon_post_quote.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/en/icon_post_report.gif b/phpBB/styles/subsilver2/theme/en/icon_post_report.gif
index 9a3f65b1e3..9a3f65b1e3 100644
--- a/phpBB/styles/subsilver2/imageset/en/icon_post_report.gif
+++ b/phpBB/styles/subsilver2/theme/en/icon_post_report.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/en/icon_user_offline.gif b/phpBB/styles/subsilver2/theme/en/icon_user_offline.gif
index 3065f4d7fe..3065f4d7fe 100644
--- a/phpBB/styles/subsilver2/imageset/en/icon_user_offline.gif
+++ b/phpBB/styles/subsilver2/theme/en/icon_user_offline.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/en/icon_user_online.gif b/phpBB/styles/subsilver2/theme/en/icon_user_online.gif
index b950612c57..b950612c57 100644
--- a/phpBB/styles/subsilver2/imageset/en/icon_user_online.gif
+++ b/phpBB/styles/subsilver2/theme/en/icon_user_online.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/en/icon_user_profile.gif b/phpBB/styles/subsilver2/theme/en/icon_user_profile.gif
index d9cf7f4c4a..d9cf7f4c4a 100644
--- a/phpBB/styles/subsilver2/imageset/en/icon_user_profile.gif
+++ b/phpBB/styles/subsilver2/theme/en/icon_user_profile.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/en/icon_user_search.gif b/phpBB/styles/subsilver2/theme/en/icon_user_search.gif
index 46475fbf4c..46475fbf4c 100644
--- a/phpBB/styles/subsilver2/imageset/en/icon_user_search.gif
+++ b/phpBB/styles/subsilver2/theme/en/icon_user_search.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/en/icon_user_warn.gif b/phpBB/styles/subsilver2/theme/en/icon_user_warn.gif
index 44cbcc953a..44cbcc953a 100644
--- a/phpBB/styles/subsilver2/imageset/en/icon_user_warn.gif
+++ b/phpBB/styles/subsilver2/theme/en/icon_user_warn.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/theme/en/stylesheet.css b/phpBB/styles/subsilver2/theme/en/stylesheet.css
new file mode 100644
index 0000000000..57f9fce26d
--- /dev/null
+++ b/phpBB/styles/subsilver2/theme/en/stylesheet.css
@@ -0,0 +1,116 @@
+/* EN Language Pack */
+.imageset.phpbb_aol-icon, .imageset.icon_contact_aim {
+ background-image: url("./icon_contact_aim.gif");
+ padding-left: 72px;
+ padding-top: 20px;
+}
+.imageset.icon_contact_email {
+ background-image: url("./icon_contact_email.gif");
+ padding-left: 72px;
+ padding-top: 20px;
+}
+.imageset.phpbb_icq-icon, .imageset.icon_contact_icq {
+ background-image: url("./icon_contact_icq.gif");
+ padding-left: 72px;
+ padding-top: 20px;
+}
+.imageset.icon_contact_jabber {
+ background-image: url("./icon_contact_jabber.gif");
+ padding-left: 72px;
+ padding-top: 20px;
+}
+.imageset.phpbb_wlm-icon, .imageset.icon_contact_msnm {
+ background-image: url("./icon_contact_msnm.gif");
+ padding-left: 72px;
+ padding-top: 20px;
+}
+.imageset.icon_contact_pm {
+ background-image: url("./icon_contact_pm.gif");
+ padding-left: 72px;
+ padding-top: 20px;
+}
+.imageset.phpbb_yahoo-icon, .imageset.icon_contact_yahoo {
+ background-image: url("./icon_contact_yahoo.gif");
+ padding-left: 72px;
+ padding-top: 20px;
+}
+.imageset.phpbb_website-icon, .imageset.icon_contact_www {
+ background-image: url("./icon_contact_www.gif");
+ padding-left: 72px;
+ padding-top: 20px;
+}
+.imageset.icon_post_delete {
+ background-image: url("./icon_post_delete.gif");
+ padding-left: 20px;
+ padding-top: 20px;
+}
+.imageset.icon_post_edit {
+ background-image: url("./icon_post_edit.gif");
+ padding-left: 90px;
+ padding-top: 20px;
+}
+.imageset.icon_post_info {
+ background-image: url("./icon_post_info.gif");
+ padding-left: 20px;
+ padding-top: 20px;
+}
+.imageset.icon_post_quote {
+ background-image: url("./icon_post_quote.gif");
+ padding-left: 90px;
+ padding-top: 20px;
+}
+.imageset.icon_post_report {
+ background-image: url("./icon_post_report.gif");
+ padding-left: 20px;
+ padding-top: 20px;
+}
+.imageset.icon_user_online {
+ background-image: url("./icon_user_online.gif");
+ padding-left: 72px;
+ padding-top: 20px;
+}
+.imageset.icon_user_offline {
+ background-image: url("./icon_user_offline.gif");
+ padding-left: 72px;
+ padding-top: 20px;
+}
+.imageset.icon_user_profile {
+ background-image: url("./icon_user_profile.gif");
+ padding-left: 72px;
+ padding-top: 20px;
+}
+.imageset.icon_user_search {
+ background-image: url("./icon_user_search.gif");
+ padding-left: 72px;
+ padding-top: 20px;
+}
+.imageset.icon_user_warn {
+ background-image: url("./icon_user_warn.gif");
+ padding-left: 20px;
+ padding-top: 20px;
+}
+.imageset.button_pm_new {
+ background-image: url("./button_pm_new.gif");
+ padding-left: 97px;
+ padding-top: 27px;
+}
+.imageset.button_pm_reply {
+ background-image: url("./button_pm_reply.gif");
+ padding-left: 90px;
+ padding-top: 20px;
+}
+.imageset.button_topic_locked {
+ background-image: url("./button_topic_locked.gif");
+ padding-left: 97px;
+ padding-top: 27px;
+}
+.imageset.button_topic_new {
+ background-image: url("./button_topic_new.gif");
+ padding-left: 97px;
+ padding-top: 27px;
+}
+.imageset.button_topic_reply {
+ background-image: url("./button_topic_reply.gif");
+ padding-left: 97px;
+ padding-top: 27px;
+}
diff --git a/phpBB/styles/subsilver2/imageset/announce_read.gif b/phpBB/styles/subsilver2/theme/images/announce_read.gif
index 0589feb14f..0589feb14f 100644
--- a/phpBB/styles/subsilver2/imageset/announce_read.gif
+++ b/phpBB/styles/subsilver2/theme/images/announce_read.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/announce_read_locked.gif b/phpBB/styles/subsilver2/theme/images/announce_read_locked.gif
index a738616e06..a738616e06 100644
--- a/phpBB/styles/subsilver2/imageset/announce_read_locked.gif
+++ b/phpBB/styles/subsilver2/theme/images/announce_read_locked.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/announce_read_locked_mine.gif b/phpBB/styles/subsilver2/theme/images/announce_read_locked_mine.gif
index f7ffe7f8dd..f7ffe7f8dd 100644
--- a/phpBB/styles/subsilver2/imageset/announce_read_locked_mine.gif
+++ b/phpBB/styles/subsilver2/theme/images/announce_read_locked_mine.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/announce_read_mine.gif b/phpBB/styles/subsilver2/theme/images/announce_read_mine.gif
index 636d353867..636d353867 100644
--- a/phpBB/styles/subsilver2/imageset/announce_read_mine.gif
+++ b/phpBB/styles/subsilver2/theme/images/announce_read_mine.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/announce_unread.gif b/phpBB/styles/subsilver2/theme/images/announce_unread.gif
index 56b2702b17..56b2702b17 100644
--- a/phpBB/styles/subsilver2/imageset/announce_unread.gif
+++ b/phpBB/styles/subsilver2/theme/images/announce_unread.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/announce_unread_locked.gif b/phpBB/styles/subsilver2/theme/images/announce_unread_locked.gif
index 37033da653..37033da653 100644
--- a/phpBB/styles/subsilver2/imageset/announce_unread_locked.gif
+++ b/phpBB/styles/subsilver2/theme/images/announce_unread_locked.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/announce_unread_locked_mine.gif b/phpBB/styles/subsilver2/theme/images/announce_unread_locked_mine.gif
index d91f2520ca..d91f2520ca 100644
--- a/phpBB/styles/subsilver2/imageset/announce_unread_locked_mine.gif
+++ b/phpBB/styles/subsilver2/theme/images/announce_unread_locked_mine.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/announce_unread_mine.gif b/phpBB/styles/subsilver2/theme/images/announce_unread_mine.gif
index e1dd23a0bf..e1dd23a0bf 100644
--- a/phpBB/styles/subsilver2/imageset/announce_unread_mine.gif
+++ b/phpBB/styles/subsilver2/theme/images/announce_unread_mine.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/de/button_pm_new.gif b/phpBB/styles/subsilver2/theme/images/de/button_pm_new.gif
index 3f794d3733..3f794d3733 100644
--- a/phpBB/styles/subsilver2/imageset/de/button_pm_new.gif
+++ b/phpBB/styles/subsilver2/theme/images/de/button_pm_new.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/de/button_pm_reply.gif b/phpBB/styles/subsilver2/theme/images/de/button_pm_reply.gif
index f501b2a30d..f501b2a30d 100644
--- a/phpBB/styles/subsilver2/imageset/de/button_pm_reply.gif
+++ b/phpBB/styles/subsilver2/theme/images/de/button_pm_reply.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/de/button_topic_locked.gif b/phpBB/styles/subsilver2/theme/images/de/button_topic_locked.gif
index e3ee12eb2d..e3ee12eb2d 100644
--- a/phpBB/styles/subsilver2/imageset/de/button_topic_locked.gif
+++ b/phpBB/styles/subsilver2/theme/images/de/button_topic_locked.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/de/button_topic_new.gif b/phpBB/styles/subsilver2/theme/images/de/button_topic_new.gif
index 68e640f90c..68e640f90c 100644
--- a/phpBB/styles/subsilver2/imageset/de/button_topic_new.gif
+++ b/phpBB/styles/subsilver2/theme/images/de/button_topic_new.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/de/button_topic_reply.gif b/phpBB/styles/subsilver2/theme/images/de/button_topic_reply.gif
index fc3fac2070..fc3fac2070 100644
--- a/phpBB/styles/subsilver2/imageset/de/button_topic_reply.gif
+++ b/phpBB/styles/subsilver2/theme/images/de/button_topic_reply.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/de/icon_contact_aim.gif b/phpBB/styles/subsilver2/theme/images/de/icon_contact_aim.gif
index c15d4b7c35..c15d4b7c35 100644
--- a/phpBB/styles/subsilver2/imageset/de/icon_contact_aim.gif
+++ b/phpBB/styles/subsilver2/theme/images/de/icon_contact_aim.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/de/icon_contact_email.gif b/phpBB/styles/subsilver2/theme/images/de/icon_contact_email.gif
index 33b80728e6..33b80728e6 100644
--- a/phpBB/styles/subsilver2/imageset/de/icon_contact_email.gif
+++ b/phpBB/styles/subsilver2/theme/images/de/icon_contact_email.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/de/icon_contact_icq.gif b/phpBB/styles/subsilver2/theme/images/de/icon_contact_icq.gif
index efba62468a..efba62468a 100644
--- a/phpBB/styles/subsilver2/imageset/de/icon_contact_icq.gif
+++ b/phpBB/styles/subsilver2/theme/images/de/icon_contact_icq.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/de/icon_contact_jabber.gif b/phpBB/styles/subsilver2/theme/images/de/icon_contact_jabber.gif
index aa931da3fc..aa931da3fc 100644
--- a/phpBB/styles/subsilver2/imageset/de/icon_contact_jabber.gif
+++ b/phpBB/styles/subsilver2/theme/images/de/icon_contact_jabber.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/de/icon_contact_msnm.gif b/phpBB/styles/subsilver2/theme/images/de/icon_contact_msnm.gif
index 3b9ca56ee3..3b9ca56ee3 100644
--- a/phpBB/styles/subsilver2/imageset/de/icon_contact_msnm.gif
+++ b/phpBB/styles/subsilver2/theme/images/de/icon_contact_msnm.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/de/icon_contact_pm.gif b/phpBB/styles/subsilver2/theme/images/de/icon_contact_pm.gif
index 4489b7e639..4489b7e639 100644
--- a/phpBB/styles/subsilver2/imageset/de/icon_contact_pm.gif
+++ b/phpBB/styles/subsilver2/theme/images/de/icon_contact_pm.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/de/icon_contact_www.gif b/phpBB/styles/subsilver2/theme/images/de/icon_contact_www.gif
index 11c9fcd7d2..11c9fcd7d2 100644
--- a/phpBB/styles/subsilver2/imageset/de/icon_contact_www.gif
+++ b/phpBB/styles/subsilver2/theme/images/de/icon_contact_www.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/de/icon_contact_yahoo.gif b/phpBB/styles/subsilver2/theme/images/de/icon_contact_yahoo.gif
index 2fde457f62..2fde457f62 100644
--- a/phpBB/styles/subsilver2/imageset/de/icon_contact_yahoo.gif
+++ b/phpBB/styles/subsilver2/theme/images/de/icon_contact_yahoo.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/de/icon_post_delete.gif b/phpBB/styles/subsilver2/theme/images/de/icon_post_delete.gif
index 8581ba8b1d..8581ba8b1d 100644
--- a/phpBB/styles/subsilver2/imageset/de/icon_post_delete.gif
+++ b/phpBB/styles/subsilver2/theme/images/de/icon_post_delete.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/de/icon_post_edit.gif b/phpBB/styles/subsilver2/theme/images/de/icon_post_edit.gif
index 4b1b1ec8c3..4b1b1ec8c3 100644
--- a/phpBB/styles/subsilver2/imageset/de/icon_post_edit.gif
+++ b/phpBB/styles/subsilver2/theme/images/de/icon_post_edit.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/de/icon_post_info.gif b/phpBB/styles/subsilver2/theme/images/de/icon_post_info.gif
index 1b1630022c..1b1630022c 100644
--- a/phpBB/styles/subsilver2/imageset/de/icon_post_info.gif
+++ b/phpBB/styles/subsilver2/theme/images/de/icon_post_info.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/de/icon_post_quote.gif b/phpBB/styles/subsilver2/theme/images/de/icon_post_quote.gif
index 07255c4c78..07255c4c78 100644
--- a/phpBB/styles/subsilver2/imageset/de/icon_post_quote.gif
+++ b/phpBB/styles/subsilver2/theme/images/de/icon_post_quote.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/de/icon_post_report.gif b/phpBB/styles/subsilver2/theme/images/de/icon_post_report.gif
index 57fd83cb8c..57fd83cb8c 100644
--- a/phpBB/styles/subsilver2/imageset/de/icon_post_report.gif
+++ b/phpBB/styles/subsilver2/theme/images/de/icon_post_report.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/de/icon_user_offline.gif b/phpBB/styles/subsilver2/theme/images/de/icon_user_offline.gif
index a8a73857ff..a8a73857ff 100644
--- a/phpBB/styles/subsilver2/imageset/de/icon_user_offline.gif
+++ b/phpBB/styles/subsilver2/theme/images/de/icon_user_offline.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/de/icon_user_online.gif b/phpBB/styles/subsilver2/theme/images/de/icon_user_online.gif
index e9335b54fe..e9335b54fe 100644
--- a/phpBB/styles/subsilver2/imageset/de/icon_user_online.gif
+++ b/phpBB/styles/subsilver2/theme/images/de/icon_user_online.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/de/icon_user_profile.gif b/phpBB/styles/subsilver2/theme/images/de/icon_user_profile.gif
index da25e702fd..da25e702fd 100644
--- a/phpBB/styles/subsilver2/imageset/de/icon_user_profile.gif
+++ b/phpBB/styles/subsilver2/theme/images/de/icon_user_profile.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/de/icon_user_search.gif b/phpBB/styles/subsilver2/theme/images/de/icon_user_search.gif
index c773c948e1..c773c948e1 100644
--- a/phpBB/styles/subsilver2/imageset/de/icon_user_search.gif
+++ b/phpBB/styles/subsilver2/theme/images/de/icon_user_search.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/de/icon_user_warn.gif b/phpBB/styles/subsilver2/theme/images/de/icon_user_warn.gif
index f138804942..f138804942 100644
--- a/phpBB/styles/subsilver2/imageset/de/icon_user_warn.gif
+++ b/phpBB/styles/subsilver2/theme/images/de/icon_user_warn.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/de/imageset.cfg b/phpBB/styles/subsilver2/theme/images/de/imageset.cfg
index 9465938d74..9465938d74 100644
--- a/phpBB/styles/subsilver2/imageset/de/imageset.cfg
+++ b/phpBB/styles/subsilver2/theme/images/de/imageset.cfg
diff --git a/phpBB/styles/subsilver2/imageset/de_x_sie/button_pm_new.gif b/phpBB/styles/subsilver2/theme/images/de_x_sie/button_pm_new.gif
index 3f794d3733..3f794d3733 100644
--- a/phpBB/styles/subsilver2/imageset/de_x_sie/button_pm_new.gif
+++ b/phpBB/styles/subsilver2/theme/images/de_x_sie/button_pm_new.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/de_x_sie/button_pm_reply.gif b/phpBB/styles/subsilver2/theme/images/de_x_sie/button_pm_reply.gif
index f501b2a30d..f501b2a30d 100644
--- a/phpBB/styles/subsilver2/imageset/de_x_sie/button_pm_reply.gif
+++ b/phpBB/styles/subsilver2/theme/images/de_x_sie/button_pm_reply.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/de_x_sie/button_topic_locked.gif b/phpBB/styles/subsilver2/theme/images/de_x_sie/button_topic_locked.gif
index e3ee12eb2d..e3ee12eb2d 100644
--- a/phpBB/styles/subsilver2/imageset/de_x_sie/button_topic_locked.gif
+++ b/phpBB/styles/subsilver2/theme/images/de_x_sie/button_topic_locked.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/de_x_sie/button_topic_new.gif b/phpBB/styles/subsilver2/theme/images/de_x_sie/button_topic_new.gif
index 68e640f90c..68e640f90c 100644
--- a/phpBB/styles/subsilver2/imageset/de_x_sie/button_topic_new.gif
+++ b/phpBB/styles/subsilver2/theme/images/de_x_sie/button_topic_new.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/de_x_sie/button_topic_reply.gif b/phpBB/styles/subsilver2/theme/images/de_x_sie/button_topic_reply.gif
index fc3fac2070..fc3fac2070 100644
--- a/phpBB/styles/subsilver2/imageset/de_x_sie/button_topic_reply.gif
+++ b/phpBB/styles/subsilver2/theme/images/de_x_sie/button_topic_reply.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/de_x_sie/icon_contact_aim.gif b/phpBB/styles/subsilver2/theme/images/de_x_sie/icon_contact_aim.gif
index c15d4b7c35..c15d4b7c35 100644
--- a/phpBB/styles/subsilver2/imageset/de_x_sie/icon_contact_aim.gif
+++ b/phpBB/styles/subsilver2/theme/images/de_x_sie/icon_contact_aim.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/de_x_sie/icon_contact_email.gif b/phpBB/styles/subsilver2/theme/images/de_x_sie/icon_contact_email.gif
index 33b80728e6..33b80728e6 100644
--- a/phpBB/styles/subsilver2/imageset/de_x_sie/icon_contact_email.gif
+++ b/phpBB/styles/subsilver2/theme/images/de_x_sie/icon_contact_email.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/de_x_sie/icon_contact_icq.gif b/phpBB/styles/subsilver2/theme/images/de_x_sie/icon_contact_icq.gif
index efba62468a..efba62468a 100644
--- a/phpBB/styles/subsilver2/imageset/de_x_sie/icon_contact_icq.gif
+++ b/phpBB/styles/subsilver2/theme/images/de_x_sie/icon_contact_icq.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/de_x_sie/icon_contact_jabber.gif b/phpBB/styles/subsilver2/theme/images/de_x_sie/icon_contact_jabber.gif
index aa931da3fc..aa931da3fc 100644
--- a/phpBB/styles/subsilver2/imageset/de_x_sie/icon_contact_jabber.gif
+++ b/phpBB/styles/subsilver2/theme/images/de_x_sie/icon_contact_jabber.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/de_x_sie/icon_contact_msnm.gif b/phpBB/styles/subsilver2/theme/images/de_x_sie/icon_contact_msnm.gif
index 3b9ca56ee3..3b9ca56ee3 100644
--- a/phpBB/styles/subsilver2/imageset/de_x_sie/icon_contact_msnm.gif
+++ b/phpBB/styles/subsilver2/theme/images/de_x_sie/icon_contact_msnm.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/de_x_sie/icon_contact_pm.gif b/phpBB/styles/subsilver2/theme/images/de_x_sie/icon_contact_pm.gif
index 4489b7e639..4489b7e639 100644
--- a/phpBB/styles/subsilver2/imageset/de_x_sie/icon_contact_pm.gif
+++ b/phpBB/styles/subsilver2/theme/images/de_x_sie/icon_contact_pm.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/de_x_sie/icon_contact_www.gif b/phpBB/styles/subsilver2/theme/images/de_x_sie/icon_contact_www.gif
index 11c9fcd7d2..11c9fcd7d2 100644
--- a/phpBB/styles/subsilver2/imageset/de_x_sie/icon_contact_www.gif
+++ b/phpBB/styles/subsilver2/theme/images/de_x_sie/icon_contact_www.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/de_x_sie/icon_contact_yahoo.gif b/phpBB/styles/subsilver2/theme/images/de_x_sie/icon_contact_yahoo.gif
index 2fde457f62..2fde457f62 100644
--- a/phpBB/styles/subsilver2/imageset/de_x_sie/icon_contact_yahoo.gif
+++ b/phpBB/styles/subsilver2/theme/images/de_x_sie/icon_contact_yahoo.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/de_x_sie/icon_post_delete.gif b/phpBB/styles/subsilver2/theme/images/de_x_sie/icon_post_delete.gif
index 8581ba8b1d..8581ba8b1d 100644
--- a/phpBB/styles/subsilver2/imageset/de_x_sie/icon_post_delete.gif
+++ b/phpBB/styles/subsilver2/theme/images/de_x_sie/icon_post_delete.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/de_x_sie/icon_post_edit.gif b/phpBB/styles/subsilver2/theme/images/de_x_sie/icon_post_edit.gif
index 4b1b1ec8c3..4b1b1ec8c3 100644
--- a/phpBB/styles/subsilver2/imageset/de_x_sie/icon_post_edit.gif
+++ b/phpBB/styles/subsilver2/theme/images/de_x_sie/icon_post_edit.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/de_x_sie/icon_post_info.gif b/phpBB/styles/subsilver2/theme/images/de_x_sie/icon_post_info.gif
index 1b1630022c..1b1630022c 100644
--- a/phpBB/styles/subsilver2/imageset/de_x_sie/icon_post_info.gif
+++ b/phpBB/styles/subsilver2/theme/images/de_x_sie/icon_post_info.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/de_x_sie/icon_post_quote.gif b/phpBB/styles/subsilver2/theme/images/de_x_sie/icon_post_quote.gif
index 07255c4c78..07255c4c78 100644
--- a/phpBB/styles/subsilver2/imageset/de_x_sie/icon_post_quote.gif
+++ b/phpBB/styles/subsilver2/theme/images/de_x_sie/icon_post_quote.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/de_x_sie/icon_post_report.gif b/phpBB/styles/subsilver2/theme/images/de_x_sie/icon_post_report.gif
index 57fd83cb8c..57fd83cb8c 100644
--- a/phpBB/styles/subsilver2/imageset/de_x_sie/icon_post_report.gif
+++ b/phpBB/styles/subsilver2/theme/images/de_x_sie/icon_post_report.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/de_x_sie/icon_user_offline.gif b/phpBB/styles/subsilver2/theme/images/de_x_sie/icon_user_offline.gif
index a8a73857ff..a8a73857ff 100644
--- a/phpBB/styles/subsilver2/imageset/de_x_sie/icon_user_offline.gif
+++ b/phpBB/styles/subsilver2/theme/images/de_x_sie/icon_user_offline.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/de_x_sie/icon_user_online.gif b/phpBB/styles/subsilver2/theme/images/de_x_sie/icon_user_online.gif
index e9335b54fe..e9335b54fe 100644
--- a/phpBB/styles/subsilver2/imageset/de_x_sie/icon_user_online.gif
+++ b/phpBB/styles/subsilver2/theme/images/de_x_sie/icon_user_online.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/de_x_sie/icon_user_profile.gif b/phpBB/styles/subsilver2/theme/images/de_x_sie/icon_user_profile.gif
index da25e702fd..da25e702fd 100644
--- a/phpBB/styles/subsilver2/imageset/de_x_sie/icon_user_profile.gif
+++ b/phpBB/styles/subsilver2/theme/images/de_x_sie/icon_user_profile.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/de_x_sie/icon_user_search.gif b/phpBB/styles/subsilver2/theme/images/de_x_sie/icon_user_search.gif
index c773c948e1..c773c948e1 100644
--- a/phpBB/styles/subsilver2/imageset/de_x_sie/icon_user_search.gif
+++ b/phpBB/styles/subsilver2/theme/images/de_x_sie/icon_user_search.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/de_x_sie/icon_user_warn.gif b/phpBB/styles/subsilver2/theme/images/de_x_sie/icon_user_warn.gif
index f138804942..f138804942 100644
--- a/phpBB/styles/subsilver2/imageset/de_x_sie/icon_user_warn.gif
+++ b/phpBB/styles/subsilver2/theme/images/de_x_sie/icon_user_warn.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/de_x_sie/imageset.cfg b/phpBB/styles/subsilver2/theme/images/de_x_sie/imageset.cfg
index 9465938d74..9465938d74 100644
--- a/phpBB/styles/subsilver2/imageset/de_x_sie/imageset.cfg
+++ b/phpBB/styles/subsilver2/theme/images/de_x_sie/imageset.cfg
diff --git a/phpBB/styles/subsilver2/imageset/forum_link.gif b/phpBB/styles/subsilver2/theme/images/forum_link.gif
index d5e86d47d7..d5e86d47d7 100644
--- a/phpBB/styles/subsilver2/imageset/forum_link.gif
+++ b/phpBB/styles/subsilver2/theme/images/forum_link.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/forum_read.gif b/phpBB/styles/subsilver2/theme/images/forum_read.gif
index 9b2bc47c67..9b2bc47c67 100644
--- a/phpBB/styles/subsilver2/imageset/forum_read.gif
+++ b/phpBB/styles/subsilver2/theme/images/forum_read.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/forum_read_locked.gif b/phpBB/styles/subsilver2/theme/images/forum_read_locked.gif
index 436f3d21c8..436f3d21c8 100644
--- a/phpBB/styles/subsilver2/imageset/forum_read_locked.gif
+++ b/phpBB/styles/subsilver2/theme/images/forum_read_locked.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/forum_read_subforum.gif b/phpBB/styles/subsilver2/theme/images/forum_read_subforum.gif
index 9179303e7f..9179303e7f 100644
--- a/phpBB/styles/subsilver2/imageset/forum_read_subforum.gif
+++ b/phpBB/styles/subsilver2/theme/images/forum_read_subforum.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/forum_unread.gif b/phpBB/styles/subsilver2/theme/images/forum_unread.gif
index 5eec565b38..5eec565b38 100644
--- a/phpBB/styles/subsilver2/imageset/forum_unread.gif
+++ b/phpBB/styles/subsilver2/theme/images/forum_unread.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/forum_unread_locked.gif b/phpBB/styles/subsilver2/theme/images/forum_unread_locked.gif
index 58a79c376c..58a79c376c 100644
--- a/phpBB/styles/subsilver2/imageset/forum_unread_locked.gif
+++ b/phpBB/styles/subsilver2/theme/images/forum_unread_locked.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/forum_unread_subforum.gif b/phpBB/styles/subsilver2/theme/images/forum_unread_subforum.gif
index af3c93b1a1..af3c93b1a1 100644
--- a/phpBB/styles/subsilver2/imageset/forum_unread_subforum.gif
+++ b/phpBB/styles/subsilver2/theme/images/forum_unread_subforum.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/fr/button_pm_new.gif b/phpBB/styles/subsilver2/theme/images/fr/button_pm_new.gif
index 2cf18ec180..2cf18ec180 100644
--- a/phpBB/styles/subsilver2/imageset/fr/button_pm_new.gif
+++ b/phpBB/styles/subsilver2/theme/images/fr/button_pm_new.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/fr/button_pm_reply.gif b/phpBB/styles/subsilver2/theme/images/fr/button_pm_reply.gif
index 04fc5663aa..04fc5663aa 100644
--- a/phpBB/styles/subsilver2/imageset/fr/button_pm_reply.gif
+++ b/phpBB/styles/subsilver2/theme/images/fr/button_pm_reply.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/fr/button_topic_locked.gif b/phpBB/styles/subsilver2/theme/images/fr/button_topic_locked.gif
index 7bcf046237..7bcf046237 100644
--- a/phpBB/styles/subsilver2/imageset/fr/button_topic_locked.gif
+++ b/phpBB/styles/subsilver2/theme/images/fr/button_topic_locked.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/fr/button_topic_new.gif b/phpBB/styles/subsilver2/theme/images/fr/button_topic_new.gif
index 2cf18ec180..2cf18ec180 100644
--- a/phpBB/styles/subsilver2/imageset/fr/button_topic_new.gif
+++ b/phpBB/styles/subsilver2/theme/images/fr/button_topic_new.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/fr/button_topic_reply.gif b/phpBB/styles/subsilver2/theme/images/fr/button_topic_reply.gif
index 4065c805f0..4065c805f0 100644
--- a/phpBB/styles/subsilver2/imageset/fr/button_topic_reply.gif
+++ b/phpBB/styles/subsilver2/theme/images/fr/button_topic_reply.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/fr/icon_contact_aim.gif b/phpBB/styles/subsilver2/theme/images/fr/icon_contact_aim.gif
index c6533e2817..c6533e2817 100644
--- a/phpBB/styles/subsilver2/imageset/fr/icon_contact_aim.gif
+++ b/phpBB/styles/subsilver2/theme/images/fr/icon_contact_aim.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/fr/icon_contact_email.gif b/phpBB/styles/subsilver2/theme/images/fr/icon_contact_email.gif
index 1069ee5367..1069ee5367 100644
--- a/phpBB/styles/subsilver2/imageset/fr/icon_contact_email.gif
+++ b/phpBB/styles/subsilver2/theme/images/fr/icon_contact_email.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/fr/icon_contact_icq.gif b/phpBB/styles/subsilver2/theme/images/fr/icon_contact_icq.gif
index ba3fa12436..ba3fa12436 100644
--- a/phpBB/styles/subsilver2/imageset/fr/icon_contact_icq.gif
+++ b/phpBB/styles/subsilver2/theme/images/fr/icon_contact_icq.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/fr/icon_contact_jabber.gif b/phpBB/styles/subsilver2/theme/images/fr/icon_contact_jabber.gif
index cb0ea011e1..cb0ea011e1 100644
--- a/phpBB/styles/subsilver2/imageset/fr/icon_contact_jabber.gif
+++ b/phpBB/styles/subsilver2/theme/images/fr/icon_contact_jabber.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/fr/icon_contact_msnm.gif b/phpBB/styles/subsilver2/theme/images/fr/icon_contact_msnm.gif
index c8ef308663..c8ef308663 100644
--- a/phpBB/styles/subsilver2/imageset/fr/icon_contact_msnm.gif
+++ b/phpBB/styles/subsilver2/theme/images/fr/icon_contact_msnm.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/fr/icon_contact_pm.gif b/phpBB/styles/subsilver2/theme/images/fr/icon_contact_pm.gif
index 87134a3ed0..87134a3ed0 100644
--- a/phpBB/styles/subsilver2/imageset/fr/icon_contact_pm.gif
+++ b/phpBB/styles/subsilver2/theme/images/fr/icon_contact_pm.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/fr/icon_contact_www.gif b/phpBB/styles/subsilver2/theme/images/fr/icon_contact_www.gif
index 14a33b36a5..14a33b36a5 100644
--- a/phpBB/styles/subsilver2/imageset/fr/icon_contact_www.gif
+++ b/phpBB/styles/subsilver2/theme/images/fr/icon_contact_www.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/fr/icon_contact_yahoo.gif b/phpBB/styles/subsilver2/theme/images/fr/icon_contact_yahoo.gif
index d11711789f..d11711789f 100644
--- a/phpBB/styles/subsilver2/imageset/fr/icon_contact_yahoo.gif
+++ b/phpBB/styles/subsilver2/theme/images/fr/icon_contact_yahoo.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/fr/icon_post_delete.gif b/phpBB/styles/subsilver2/theme/images/fr/icon_post_delete.gif
index e008e5ff9f..e008e5ff9f 100644
--- a/phpBB/styles/subsilver2/imageset/fr/icon_post_delete.gif
+++ b/phpBB/styles/subsilver2/theme/images/fr/icon_post_delete.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/fr/icon_post_edit.gif b/phpBB/styles/subsilver2/theme/images/fr/icon_post_edit.gif
index 524ea5090c..524ea5090c 100644
--- a/phpBB/styles/subsilver2/imageset/fr/icon_post_edit.gif
+++ b/phpBB/styles/subsilver2/theme/images/fr/icon_post_edit.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/fr/icon_post_info.gif b/phpBB/styles/subsilver2/theme/images/fr/icon_post_info.gif
index 166de2724f..166de2724f 100644
--- a/phpBB/styles/subsilver2/imageset/fr/icon_post_info.gif
+++ b/phpBB/styles/subsilver2/theme/images/fr/icon_post_info.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/fr/icon_post_quote.gif b/phpBB/styles/subsilver2/theme/images/fr/icon_post_quote.gif
index dee92d6c92..dee92d6c92 100644
--- a/phpBB/styles/subsilver2/imageset/fr/icon_post_quote.gif
+++ b/phpBB/styles/subsilver2/theme/images/fr/icon_post_quote.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/fr/icon_post_report.gif b/phpBB/styles/subsilver2/theme/images/fr/icon_post_report.gif
index 9a3f65b1e3..9a3f65b1e3 100644
--- a/phpBB/styles/subsilver2/imageset/fr/icon_post_report.gif
+++ b/phpBB/styles/subsilver2/theme/images/fr/icon_post_report.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/fr/icon_user_offline.gif b/phpBB/styles/subsilver2/theme/images/fr/icon_user_offline.gif
index f9f2db9e48..f9f2db9e48 100644
--- a/phpBB/styles/subsilver2/imageset/fr/icon_user_offline.gif
+++ b/phpBB/styles/subsilver2/theme/images/fr/icon_user_offline.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/fr/icon_user_online.gif b/phpBB/styles/subsilver2/theme/images/fr/icon_user_online.gif
index f059d03d09..f059d03d09 100644
--- a/phpBB/styles/subsilver2/imageset/fr/icon_user_online.gif
+++ b/phpBB/styles/subsilver2/theme/images/fr/icon_user_online.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/fr/icon_user_profile.gif b/phpBB/styles/subsilver2/theme/images/fr/icon_user_profile.gif
index ee386aa018..ee386aa018 100644
--- a/phpBB/styles/subsilver2/imageset/fr/icon_user_profile.gif
+++ b/phpBB/styles/subsilver2/theme/images/fr/icon_user_profile.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/fr/icon_user_search.gif b/phpBB/styles/subsilver2/theme/images/fr/icon_user_search.gif
index c84aba4b95..c84aba4b95 100644
--- a/phpBB/styles/subsilver2/imageset/fr/icon_user_search.gif
+++ b/phpBB/styles/subsilver2/theme/images/fr/icon_user_search.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/fr/icon_user_warn.gif b/phpBB/styles/subsilver2/theme/images/fr/icon_user_warn.gif
index 44cbcc953a..44cbcc953a 100644
--- a/phpBB/styles/subsilver2/imageset/fr/icon_user_warn.gif
+++ b/phpBB/styles/subsilver2/theme/images/fr/icon_user_warn.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/en/imageset.cfg b/phpBB/styles/subsilver2/theme/images/fr/imageset.cfg
index c0cc699737..c0cc699737 100644
--- a/phpBB/styles/subsilver2/imageset/en/imageset.cfg
+++ b/phpBB/styles/subsilver2/theme/images/fr/imageset.cfg
diff --git a/phpBB/styles/subsilver2/imageset/fr/index.htm b/phpBB/styles/subsilver2/theme/images/fr/index.htm
index 90a3130b62..90a3130b62 100644
--- a/phpBB/styles/subsilver2/imageset/fr/index.htm
+++ b/phpBB/styles/subsilver2/theme/images/fr/index.htm
diff --git a/phpBB/styles/subsilver2/theme/images/icon_mini_notification.gif b/phpBB/styles/subsilver2/theme/images/icon_mini_notification.gif
new file mode 100644
index 0000000000..f165d3cb27
--- /dev/null
+++ b/phpBB/styles/subsilver2/theme/images/icon_mini_notification.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/icon_post_target.gif b/phpBB/styles/subsilver2/theme/images/icon_post_target.gif
index d172abb060..d172abb060 100644
--- a/phpBB/styles/subsilver2/imageset/icon_post_target.gif
+++ b/phpBB/styles/subsilver2/theme/images/icon_post_target.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/icon_post_target_unread.gif b/phpBB/styles/subsilver2/theme/images/icon_post_target_unread.gif
index 8ec44a1787..8ec44a1787 100644
--- a/phpBB/styles/subsilver2/imageset/icon_post_target_unread.gif
+++ b/phpBB/styles/subsilver2/theme/images/icon_post_target_unread.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/icon_topic_attach.gif b/phpBB/styles/subsilver2/theme/images/icon_topic_attach.gif
index 1c9c89bc70..1c9c89bc70 100644
--- a/phpBB/styles/subsilver2/imageset/icon_topic_attach.gif
+++ b/phpBB/styles/subsilver2/theme/images/icon_topic_attach.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/theme/images/icon_topic_deleted.png b/phpBB/styles/subsilver2/theme/images/icon_topic_deleted.png
new file mode 100644
index 0000000000..494b4fb563
--- /dev/null
+++ b/phpBB/styles/subsilver2/theme/images/icon_topic_deleted.png
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/icon_topic_latest.gif b/phpBB/styles/subsilver2/theme/images/icon_topic_latest.gif
index b45e57aedb..b45e57aedb 100644
--- a/phpBB/styles/subsilver2/imageset/icon_topic_latest.gif
+++ b/phpBB/styles/subsilver2/theme/images/icon_topic_latest.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/icon_topic_newest.gif b/phpBB/styles/subsilver2/theme/images/icon_topic_newest.gif
index eca2861836..eca2861836 100644
--- a/phpBB/styles/subsilver2/imageset/icon_topic_newest.gif
+++ b/phpBB/styles/subsilver2/theme/images/icon_topic_newest.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/icon_topic_reported.gif b/phpBB/styles/subsilver2/theme/images/icon_topic_reported.gif
index 026092854a..026092854a 100644
--- a/phpBB/styles/subsilver2/imageset/icon_topic_reported.gif
+++ b/phpBB/styles/subsilver2/theme/images/icon_topic_reported.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/icon_topic_unapproved.gif b/phpBB/styles/subsilver2/theme/images/icon_topic_unapproved.gif
index 2ccaf19c23..2ccaf19c23 100644
--- a/phpBB/styles/subsilver2/imageset/icon_topic_unapproved.gif
+++ b/phpBB/styles/subsilver2/theme/images/icon_topic_unapproved.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/theme/images/index.htm b/phpBB/styles/subsilver2/theme/images/index.htm
index 29531416fe..957f68a803 100644
--- a/phpBB/styles/subsilver2/theme/images/index.htm
+++ b/phpBB/styles/subsilver2/theme/images/index.htm
@@ -1,7 +1,7 @@
<html>
<head>
<title>subSilver created by subBlue Design</title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>
<body bgcolor="#FFFFFF" text="#000000">
diff --git a/phpBB/styles/subsilver2/theme/images/no_avatar.gif b/phpBB/styles/subsilver2/theme/images/no_avatar.gif
index 80539c8c71..ad73330e71 100644
--- a/phpBB/styles/subsilver2/theme/images/no_avatar.gif
+++ b/phpBB/styles/subsilver2/theme/images/no_avatar.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/poll_center.gif b/phpBB/styles/subsilver2/theme/images/poll_center.gif
index 99473151ec..99473151ec 100644
--- a/phpBB/styles/subsilver2/imageset/poll_center.gif
+++ b/phpBB/styles/subsilver2/theme/images/poll_center.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/poll_left.gif b/phpBB/styles/subsilver2/theme/images/poll_left.gif
index 269088b81d..269088b81d 100644
--- a/phpBB/styles/subsilver2/imageset/poll_left.gif
+++ b/phpBB/styles/subsilver2/theme/images/poll_left.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/poll_right.gif b/phpBB/styles/subsilver2/theme/images/poll_right.gif
index f9584e23a1..f9584e23a1 100644
--- a/phpBB/styles/subsilver2/imageset/poll_right.gif
+++ b/phpBB/styles/subsilver2/theme/images/poll_right.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/site_logo.gif b/phpBB/styles/subsilver2/theme/images/site_logo.gif
index abce3cd51d..abce3cd51d 100644
--- a/phpBB/styles/subsilver2/imageset/site_logo.gif
+++ b/phpBB/styles/subsilver2/theme/images/site_logo.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/sticky_read.gif b/phpBB/styles/subsilver2/theme/images/sticky_read.gif
index 09861a996c..09861a996c 100644
--- a/phpBB/styles/subsilver2/imageset/sticky_read.gif
+++ b/phpBB/styles/subsilver2/theme/images/sticky_read.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/sticky_read_locked.gif b/phpBB/styles/subsilver2/theme/images/sticky_read_locked.gif
index 24bca303d6..24bca303d6 100644
--- a/phpBB/styles/subsilver2/imageset/sticky_read_locked.gif
+++ b/phpBB/styles/subsilver2/theme/images/sticky_read_locked.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/sticky_read_locked_mine.gif b/phpBB/styles/subsilver2/theme/images/sticky_read_locked_mine.gif
index 3fd04ec3a9..3fd04ec3a9 100644
--- a/phpBB/styles/subsilver2/imageset/sticky_read_locked_mine.gif
+++ b/phpBB/styles/subsilver2/theme/images/sticky_read_locked_mine.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/sticky_read_mine.gif b/phpBB/styles/subsilver2/theme/images/sticky_read_mine.gif
index 381634c364..381634c364 100644
--- a/phpBB/styles/subsilver2/imageset/sticky_read_mine.gif
+++ b/phpBB/styles/subsilver2/theme/images/sticky_read_mine.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/sticky_unread.gif b/phpBB/styles/subsilver2/theme/images/sticky_unread.gif
index dd2e366543..dd2e366543 100644
--- a/phpBB/styles/subsilver2/imageset/sticky_unread.gif
+++ b/phpBB/styles/subsilver2/theme/images/sticky_unread.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/sticky_unread_locked.gif b/phpBB/styles/subsilver2/theme/images/sticky_unread_locked.gif
index 608f4822e3..608f4822e3 100644
--- a/phpBB/styles/subsilver2/imageset/sticky_unread_locked.gif
+++ b/phpBB/styles/subsilver2/theme/images/sticky_unread_locked.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/sticky_unread_locked_mine.gif b/phpBB/styles/subsilver2/theme/images/sticky_unread_locked_mine.gif
index fe5e115312..fe5e115312 100644
--- a/phpBB/styles/subsilver2/imageset/sticky_unread_locked_mine.gif
+++ b/phpBB/styles/subsilver2/theme/images/sticky_unread_locked_mine.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/sticky_unread_mine.gif b/phpBB/styles/subsilver2/theme/images/sticky_unread_mine.gif
index b5fc3b3627..b5fc3b3627 100644
--- a/phpBB/styles/subsilver2/imageset/sticky_unread_mine.gif
+++ b/phpBB/styles/subsilver2/theme/images/sticky_unread_mine.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/topic_moved.gif b/phpBB/styles/subsilver2/theme/images/topic_moved.gif
index fe758f02ca..fe758f02ca 100644
--- a/phpBB/styles/subsilver2/imageset/topic_moved.gif
+++ b/phpBB/styles/subsilver2/theme/images/topic_moved.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/topic_read.gif b/phpBB/styles/subsilver2/theme/images/topic_read.gif
index c16bfa75d5..c16bfa75d5 100644
--- a/phpBB/styles/subsilver2/imageset/topic_read.gif
+++ b/phpBB/styles/subsilver2/theme/images/topic_read.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/topic_read_hot.gif b/phpBB/styles/subsilver2/theme/images/topic_read_hot.gif
index a7a7e8fc78..a7a7e8fc78 100644
--- a/phpBB/styles/subsilver2/imageset/topic_read_hot.gif
+++ b/phpBB/styles/subsilver2/theme/images/topic_read_hot.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/topic_read_hot_mine.gif b/phpBB/styles/subsilver2/theme/images/topic_read_hot_mine.gif
index 853452a74b..853452a74b 100644
--- a/phpBB/styles/subsilver2/imageset/topic_read_hot_mine.gif
+++ b/phpBB/styles/subsilver2/theme/images/topic_read_hot_mine.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/topic_read_locked.gif b/phpBB/styles/subsilver2/theme/images/topic_read_locked.gif
index 10eb776972..10eb776972 100644
--- a/phpBB/styles/subsilver2/imageset/topic_read_locked.gif
+++ b/phpBB/styles/subsilver2/theme/images/topic_read_locked.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/topic_read_locked_mine.gif b/phpBB/styles/subsilver2/theme/images/topic_read_locked_mine.gif
index 3f24928b48..3f24928b48 100644
--- a/phpBB/styles/subsilver2/imageset/topic_read_locked_mine.gif
+++ b/phpBB/styles/subsilver2/theme/images/topic_read_locked_mine.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/topic_read_mine.gif b/phpBB/styles/subsilver2/theme/images/topic_read_mine.gif
index 560927aa06..560927aa06 100644
--- a/phpBB/styles/subsilver2/imageset/topic_read_mine.gif
+++ b/phpBB/styles/subsilver2/theme/images/topic_read_mine.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/topic_unread.gif b/phpBB/styles/subsilver2/theme/images/topic_unread.gif
index 4e56157dce..4e56157dce 100644
--- a/phpBB/styles/subsilver2/imageset/topic_unread.gif
+++ b/phpBB/styles/subsilver2/theme/images/topic_unread.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/topic_unread_hot.gif b/phpBB/styles/subsilver2/theme/images/topic_unread_hot.gif
index ceef4919d5..ceef4919d5 100644
--- a/phpBB/styles/subsilver2/imageset/topic_unread_hot.gif
+++ b/phpBB/styles/subsilver2/theme/images/topic_unread_hot.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/topic_unread_hot_mine.gif b/phpBB/styles/subsilver2/theme/images/topic_unread_hot_mine.gif
index 1c748f708a..1c748f708a 100644
--- a/phpBB/styles/subsilver2/imageset/topic_unread_hot_mine.gif
+++ b/phpBB/styles/subsilver2/theme/images/topic_unread_hot_mine.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/topic_unread_locked.gif b/phpBB/styles/subsilver2/theme/images/topic_unread_locked.gif
index 720e210289..720e210289 100644
--- a/phpBB/styles/subsilver2/imageset/topic_unread_locked.gif
+++ b/phpBB/styles/subsilver2/theme/images/topic_unread_locked.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/topic_unread_locked_mine.gif b/phpBB/styles/subsilver2/theme/images/topic_unread_locked_mine.gif
index 90873431ef..90873431ef 100644
--- a/phpBB/styles/subsilver2/imageset/topic_unread_locked_mine.gif
+++ b/phpBB/styles/subsilver2/theme/images/topic_unread_locked_mine.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/topic_unread_mine.gif b/phpBB/styles/subsilver2/theme/images/topic_unread_mine.gif
index 34fd2ec179..34fd2ec179 100644
--- a/phpBB/styles/subsilver2/imageset/topic_unread_mine.gif
+++ b/phpBB/styles/subsilver2/theme/images/topic_unread_mine.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/imageset/upload_bar.gif b/phpBB/styles/subsilver2/theme/images/upload_bar.gif
index 75cf61c59e..75cf61c59e 100644
--- a/phpBB/styles/subsilver2/imageset/upload_bar.gif
+++ b/phpBB/styles/subsilver2/theme/images/upload_bar.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/theme/stylesheet.css b/phpBB/styles/subsilver2/theme/stylesheet.css
index ec36baa251..8f0bbffdda 100644
--- a/phpBB/styles/subsilver2/theme/stylesheet.css
+++ b/phpBB/styles/subsilver2/theme/stylesheet.css
@@ -3,7 +3,7 @@
Style name: subsilver2
Based on style: subSilver (the default phpBB 2.0.x style)
Original author: Tom Beddard ( http://www.subblue.com/ )
- Modified by: phpBB Group ( https://www.phpbb.com/ )
+ Modified by: phpBB Limited ( https://www.phpbb.com/ )
--------------------------------------------------------------
*/
@@ -15,6 +15,10 @@
padding: 0;
}
+abbr {
+ text-decoration: none;
+}
+
html {
font-size: 100%;
}
@@ -303,6 +307,15 @@ p.topicdetails {
/* Tables
------------ */
+#color_palette_placeholder table {
+ border-collapse: separate;
+ border-spacing: 1px;
+}
+
+#color_palette_placeholder td {
+ padding: 0;
+}
+
th {
color: #FFA34F;
font-size: 1.1em;
@@ -313,6 +326,10 @@ th {
padding: 7px 5px;
}
+th.center {
+ text-align: center;
+}
+
td {
padding: 2px;
}
@@ -430,6 +447,15 @@ a.topictitle:visited {
text-decoration: none;
}
+a.lastsubject {
+ font-weight: bold;
+ text-decoration: none;
+}
+
+a.lastsubject:hover {
+ text-decoration: underline;
+}
+
th a,
th a:visited {
color: #FFA34F !important;
@@ -440,6 +466,10 @@ th a:hover {
text-decoration: underline;
}
+a.anchor {
+ display: block;
+}
+
/* Form Elements
------------ */
@@ -609,6 +639,10 @@ input:focus, select:focus, textarea:focus {
background-color: #FAFAFA;
}
+.postimage {
+ max-width: 100%;
+}
+
.syntaxbg {
color: #FFFFFF;
}
@@ -680,3 +714,543 @@ pre {
.username-coloured {
font-weight: bold;
}
+
+
+/* Former imageset */
+span.imageset {
+ display: inline-block;
+ background: transparent none 0 0 no-repeat;
+ margin: 0;
+ padding: 0;
+ width: 0;
+ height: 0;
+ overflow: hidden;
+}
+a.imageset {
+ text-decoration: none !important;
+}
+
+/* Global imageset items */
+.imageset.site_logo {
+ background-image: url("./images/site_logo.gif");
+ padding-left: 170px;
+ padding-top: 94px;
+}
+.imageset.upload_bar {
+ background-image: url("./images/upload_bar.gif");
+ padding-left: 280px;
+ padding-top: 16px;
+}
+.imageset.poll_left {
+ background-image: url("./images/poll_left.gif");
+ padding-left: 4px;
+ padding-top: 12px;
+}
+.imageset.poll_center {
+ background-image: url("./images/poll_center.gif");
+ padding-left: 1px;
+ padding-top: 12px;
+}
+.imageset.poll_right {
+ background-image: url("./images/poll_right.gif");
+ padding-left: 4px;
+ padding-top: 12px;
+}
+.imageset.forum_link {
+ background-image: url("./images/forum_link.gif");
+ padding-left: 46px;
+ padding-top: 25px;
+}
+.imageset.forum_read {
+ background-image: url("./images/forum_read.gif");
+ padding-left: 46px;
+ padding-top: 25px;
+}
+.imageset.forum_read_locked {
+ background-image: url("./images/forum_read_locked.gif");
+ padding-left: 46px;
+ padding-top: 25px;
+}
+.imageset.forum_read_subforum {
+ background-image: url("./images/forum_read_subforum.gif");
+ padding-left: 46px;
+ padding-top: 25px;
+}
+.imageset.forum_unread {
+ background-image: url("./images/forum_unread.gif");
+ padding-left: 46px;
+ padding-top: 25px;
+}
+.imageset.forum_unread_locked {
+ background-image: url("./images/forum_unread_locked.gif");
+ padding-left: 46px;
+ padding-top: 25px;
+}
+.imageset.forum_unread_subforum {
+ background-image: url("./images/forum_unread_subforum.gif");
+ padding-left: 46px;
+ padding-top: 25px;
+}
+.imageset.topic_moved {
+ background-image: url("./images/topic_moved.gif");
+ padding-left: 19px;
+ padding-top: 18px;
+}
+.imageset.topic_read {
+ background-image: url("./images/topic_read.gif");
+ padding-left: 19px;
+ padding-top: 18px;
+}
+.imageset.topic_read_mine {
+ background-image: url("./images/topic_read_mine.gif");
+ padding-left: 19px;
+ padding-top: 18px;
+}
+.imageset.topic_read_hot {
+ background-image: url("./images/topic_read_hot.gif");
+ padding-left: 19px;
+ padding-top: 18px;
+}
+.imageset.topic_read_hot_mine {
+ background-image: url("./images/topic_read_hot_mine.gif");
+ padding-left: 19px;
+ padding-top: 18px;
+}
+.imageset.topic_read_locked {
+ background-image: url("./images/topic_read_locked.gif");
+ padding-left: 19px;
+ padding-top: 18px;
+}
+.imageset.topic_read_locked_mine {
+ background-image: url("./images/topic_read_locked_mine.gif");
+ padding-left: 19px;
+ padding-top: 18px;
+}
+.imageset.topic_unread {
+ background-image: url("./images/topic_unread.gif");
+ padding-left: 19px;
+ padding-top: 18px;
+}
+.imageset.topic_unread_mine {
+ background-image: url("./images/topic_unread_mine.gif");
+ padding-left: 19px;
+ padding-top: 18px;
+}
+.imageset.topic_unread_hot {
+ background-image: url("./images/topic_unread_hot.gif");
+ padding-left: 19px;
+ padding-top: 18px;
+}
+.imageset.topic_unread_hot_mine {
+ background-image: url("./images/topic_unread_hot_mine.gif");
+ padding-left: 19px;
+ padding-top: 18px;
+}
+.imageset.topic_unread_locked {
+ background-image: url("./images/topic_unread_locked.gif");
+ padding-left: 19px;
+ padding-top: 18px;
+}
+.imageset.topic_unread_locked_mine {
+ background-image: url("./images/topic_unread_locked_mine.gif");
+ padding-left: 19px;
+ padding-top: 18px;
+}
+.imageset.sticky_read {
+ background-image: url("./images/sticky_read.gif");
+ padding-left: 19px;
+ padding-top: 18px;
+}
+.imageset.sticky_read_mine {
+ background-image: url("./images/sticky_read_mine.gif");
+ padding-left: 19px;
+ padding-top: 18px;
+}
+.imageset.sticky_read_locked {
+ background-image: url("./images/sticky_read_locked.gif");
+ padding-left: 19px;
+ padding-top: 18px;
+}
+.imageset.sticky_read_locked_mine {
+ background-image: url("./images/sticky_read_locked_mine.gif");
+ padding-left: 19px;
+ padding-top: 18px;
+}
+.imageset.sticky_unread {
+ background-image: url("./images/sticky_unread.gif");
+ padding-left: 19px;
+ padding-top: 18px;
+}
+.imageset.sticky_unread_mine {
+ background-image: url("./images/sticky_unread_mine.gif");
+ padding-left: 19px;
+ padding-top: 18px;
+}
+.imageset.sticky_unread_locked {
+ background-image: url("./images/sticky_unread_locked.gif");
+ padding-left: 19px;
+ padding-top: 18px;
+}
+.imageset.sticky_unread_locked_mine {
+ background-image: url("./images/sticky_unread_locked_mine.gif");
+ padding-left: 19px;
+ padding-top: 18px;
+}
+.imageset.announce_read {
+ background-image: url("./images/announce_read.gif");
+ padding-left: 19px;
+ padding-top: 18px;
+}
+.imageset.announce_read_mine {
+ background-image: url("./images/announce_read_mine.gif");
+ padding-left: 19px;
+ padding-top: 18px;
+}
+.imageset.announce_read_locked {
+ background-image: url("./images/announce_read_locked.gif");
+ padding-left: 19px;
+ padding-top: 18px;
+}
+.imageset.announce_read_locked_mine {
+ background-image: url("./images/announce_read_locked_mine.gif");
+ padding-left: 19px;
+ padding-top: 18px;
+}
+.imageset.announce_unread {
+ background-image: url("./images/announce_unread.gif");
+ padding-left: 19px;
+ padding-top: 18px;
+}
+.imageset.announce_unread_mine {
+ background-image: url("./images/announce_unread_mine.gif");
+ padding-left: 19px;
+ padding-top: 18px;
+}
+.imageset.announce_unread_locked {
+ background-image: url("./images/announce_unread_locked.gif");
+ padding-left: 19px;
+ padding-top: 18px;
+}
+.imageset.announce_unread_locked_mine {
+ background-image: url("./images/announce_unread_locked_mine.gif");
+ padding-left: 19px;
+ padding-top: 18px;
+}
+.imageset.global_read {
+ background-image: url("./images/announce_read.gif");
+ padding-left: 19px;
+ padding-top: 18px;
+}
+.imageset.global_read_mine {
+ background-image: url("./images/announce_read_mine.gif");
+ padding-left: 19px;
+ padding-top: 18px;
+}
+.imageset.global_read_locked {
+ background-image: url("./images/announce_read_locked.gif");
+ padding-left: 19px;
+ padding-top: 18px;
+}
+.imageset.global_read_locked_mine {
+ background-image: url("./images/announce_read_locked_mine.gif");
+ padding-left: 19px;
+ padding-top: 18px;
+}
+.imageset.global_unread {
+ background-image: url("./images/announce_unread.gif");
+ padding-left: 19px;
+ padding-top: 18px;
+}
+.imageset.global_unread_mine {
+ background-image: url("./images/announce_unread_mine.gif");
+ padding-left: 19px;
+ padding-top: 18px;
+}
+.imageset.global_unread_locked {
+ background-image: url("./images/announce_unread_locked.gif");
+ padding-left: 19px;
+ padding-top: 18px;
+}
+.imageset.global_unread_locked_mine {
+ background-image: url("./images/announce_unread_locked_mine.gif");
+ padding-left: 19px;
+ padding-top: 18px;
+}
+.imageset.pm_read {
+ background-image: url("./images/topic_read.gif");
+ padding-left: 19px;
+ padding-top: 18px;
+}
+.imageset.pm_unread {
+ background-image: url("./images/topic_unread.gif");
+ padding-left: 19px;
+ padding-top: 18px;
+}
+.imageset.icon_post_target {
+ background-image: url("./images/icon_post_target.gif");
+ padding-left: 12px;
+ padding-top: 9px;
+}
+.imageset.icon_post_target_unread {
+ background-image: url("./images/icon_post_target_unread.gif");
+ padding-left: 12px;
+ padding-top: 9px;
+}
+.imageset.icon_topic_attach {
+ background-image: url("./images/icon_topic_attach.gif");
+ padding-left: 14px;
+ padding-top: 18px;
+}
+.imageset.icon_topic_latest {
+ background-image: url("./images/icon_topic_latest.gif");
+ padding-left: 18px;
+ padding-top: 9px;
+}
+.imageset.icon_topic_newest {
+ background-image: url("./images/icon_topic_newest.gif");
+ padding-left: 18px;
+ padding-top: 9px;
+}
+.imageset.icon_topic_reported {
+ background-image: url("./images/icon_topic_reported.gif");
+ padding-left: 19px;
+ padding-top: 18px;
+}
+.imageset.icon_topic_unapproved {
+ background-image: url("./images/icon_topic_unapproved.gif");
+ padding-left: 19px;
+ padding-top: 18px;
+}
+.imageset.icon_topic_deleted {
+ background-image: url("./images/icon_topic_deleted.png");
+ padding-left: 14px;
+ padding-top: 14px;
+}
+
+
+/* English images for fallback */
+.imageset.phpbb_aol-icon, .imageset.icon_contact_aim {
+ background-image: url("./en/icon_contact_aim.gif");
+ padding-left: 72px;
+ padding-top: 20px;
+}
+.imageset.icon_contact_email {
+ background-image: url("./en/icon_contact_email.gif");
+ padding-left: 72px;
+ padding-top: 20px;
+}
+.imageset.phpbb_icq-icon, .imageset.icon_contact_icq {
+ background-image: url("./en/icon_contact_icq.gif");
+ padding-left: 72px;
+ padding-top: 20px;
+}
+.imageset.icon_contact_jabber {
+ background-image: url("./en/icon_contact_jabber.gif");
+ padding-left: 72px;
+ padding-top: 20px;
+}
+.imageset.phpbb_wlm-icon, .imageset.icon_contact_msnm {
+ background-image: url("./en/icon_contact_msnm.gif");
+ padding-left: 72px;
+ padding-top: 20px;
+}
+.imageset.icon_contact_pm {
+ background-image: url("./en/icon_contact_pm.gif");
+ padding-left: 72px;
+ padding-top: 20px;
+}
+.imageset.phpbb_yahoo-icon, .imageset.icon_contact_yahoo {
+ background-image: url("./en/icon_contact_yahoo.gif");
+ padding-left: 72px;
+ padding-top: 20px;
+}
+.imageset.phpbb_website-icon, .imageset.icon_contact_www {
+ background-image: url("./en/icon_contact_www.gif");
+ padding-left: 72px;
+ padding-top: 20px;
+}
+.imageset.icon_post_delete {
+ background-image: url("./en/icon_post_delete.gif");
+ padding-left: 20px;
+ padding-top: 20px;
+}
+.imageset.icon_post_edit {
+ background-image: url("./en/icon_post_edit.gif");
+ padding-left: 90px;
+ padding-top: 20px;
+}
+.imageset.icon_post_info {
+ background-image: url("./en/icon_post_info.gif");
+ padding-left: 20px;
+ padding-top: 20px;
+}
+.imageset.icon_post_quote {
+ background-image: url("./en/icon_post_quote.gif");
+ padding-left: 90px;
+ padding-top: 20px;
+}
+.imageset.icon_post_report {
+ background-image: url("./en/icon_post_report.gif");
+ padding-left: 20px;
+ padding-top: 20px;
+}
+.imageset.icon_user_online {
+ background-image: url("./en/icon_user_online.gif");
+ padding-left: 72px;
+ padding-top: 20px;
+}
+.imageset.icon_user_offline {
+ background-image: url("./en/icon_user_offline.gif");
+ padding-left: 72px;
+ padding-top: 20px;
+}
+.imageset.icon_user_profile {
+ background-image: url("./en/icon_user_profile.gif");
+ padding-left: 72px;
+ padding-top: 20px;
+}
+.imageset.icon_user_search {
+ background-image: url("./en/icon_user_search.gif");
+ padding-left: 72px;
+ padding-top: 20px;
+}
+.imageset.icon_user_warn {
+ background-image: url("./en/icon_user_warn.gif");
+ padding-left: 20px;
+ padding-top: 20px;
+}
+.imageset.button_pm_new {
+ background-image: url("./en/button_pm_new.gif");
+ padding-left: 97px;
+ padding-top: 27px;
+}
+.imageset.button_pm_reply {
+ background-image: url("./en/button_pm_reply.gif");
+ padding-left: 90px;
+ padding-top: 20px;
+}
+.imageset.button_topic_locked {
+ background-image: url("./en/button_topic_locked.gif");
+ padding-left: 97px;
+ padding-top: 27px;
+}
+.imageset.button_topic_new {
+ background-image: url("./en/button_topic_new.gif");
+ padding-left: 97px;
+ padding-top: 27px;
+}
+.imageset.button_topic_reply {
+ background-image: url("./en/button_topic_reply.gif");
+ padding-left: 97px;
+ padding-top: 27px;
+}
+
+/* RTL imageset entries */
+.rtl .imageset.site_logo {
+ padding-right: 170px;
+ padding-left: 0;
+}
+.rtl .imageset.upload_bar {
+ padding-right: 280px;
+ padding-left: 0;
+}
+.rtl .imageset.poll_left, .rtl .imageset.poll_right {
+ padding-right: 4px;
+ padding-left: 0;
+}
+.rtl .imageset.poll_center {
+ padding-right: 1px;
+ padding-left: 0;
+}
+.rtl .imageset.forum_link, .rtl .imageset.forum_read, .rtl .imageset.forum_read_locked, .rtl .imageset.forum_read_subforum, .rtl .imageset.forum_unread, .rtl .imageset.forum_unread_locked, .rtl .imageset.forum_unread_subforum {
+ padding-right: 46px;
+ padding-left: 0;
+}
+.rtl .imageset.topic_moved, .rtl .imageset.topic_read, .rtl .imageset.topic_read_mine, .rtl .imageset.topic_read_hot, .rtl .imageset.topic_read_hot_mine, .rtl .imageset.topic_read_locked, .rtl .imageset.topic_read_locked_mine, .rtl .imageset.topic_unread, .rtl .imageset.topic_unread_mine, .rtl .imageset.topic_unread_hot, .rtl .imageset.topic_unread_hot_mine, .rtl .imageset.topic_unread_locked, .rtl .imageset.topic_unread_locked_mine, .rtl .imageset.sticky_read, .rtl .imageset.sticky_read_mine, .rtl .imageset.sticky_read_locked, .rtl .imageset.sticky_read_locked_mine, .rtl .imageset.sticky_unread, .rtl .imageset.sticky_unread_mine, .rtl .imageset.sticky_unread_locked, .rtl .imageset.sticky_unread_locked_mine, .rtl .imageset.announce_read, .rtl .imageset.announce_read_mine, .rtl .imageset.announce_read_locked, .rtl .imageset.announce_read_locked_mine, .rtl .imageset.announce_unread, .rtl .imageset.announce_unread_mine, .rtl .imageset.announce_unread_locked, .rtl .imageset.announce_unread_locked_mine, .rtl .imageset.global_read, .rtl .imageset.global_read_mine, .rtl .imageset.global_read_locked, .rtl .imageset.global_read_locked_mine, .rtl .imageset.global_unread, .rtl .imageset.global_unread_mine, .rtl .imageset.global_unread_locked, .rtl .imageset.global_unread_locked_mine, .rtl .imageset.pm_read, .rtl .imageset.pm_unread, .rtl .imageset.icon_topic_reported, .rtl .imageset.icon_topic_unapproved {
+ padding-right: 19px;
+ padding-left: 0;
+}
+.rtl .imageset.icon_post_target, .rtl .imageset.icon_post_target_unread {
+ padding-right: 12px;
+ padding-left: 0;
+}
+.rtl .imageset.icon_topic_attach {
+ padding-right: 14px;
+ padding-left: 0;
+}
+.rtl .imageset.icon_topic_latest, .rtl .imageset.icon_topic_newest {
+ padding-right: 18px;
+ padding-left: 0;
+}
+
+#notification_list {
+ display: none;
+ position: absolute;
+ width: 310px;
+ z-index: 1;
+ box-shadow: 3px 3px 5px darkgray;
+}
+
+#notification_list .notification_scroll {
+ max-height: 350px;
+ overflow-y: auto;
+ overflow-x: hidden;
+}
+
+#notification_list table {
+ width: 100%;
+}
+
+#notification_list .notification_title {
+ padding: 3px;
+}
+
+#notification_list .notification_title:after {
+ clear: both;
+ content: '';
+ display: block;
+}
+
+#notification_list .header {
+ padding: 5px;
+ font-weight: bold;
+ border: 1px solid #A9B8C2;
+ border-bottom: 0;
+}
+
+#notification_list > .header > .header_settings {
+ float: right;
+ font-weight: normal;
+ text-transform: none;
+}
+
+#notification_list .header:after {
+ content: '';
+ display: table;
+ clear: both;
+}
+
+#notification_list .footer {
+ text-align: center;
+ font-size: 1.2em;
+ border: 1px solid #A9B8C2;
+ border-top: 0;
+}
+
+.notification_list img {
+ max-width: 50px;
+ max-height: 50px;
+}
+
+#notification_list .footer > a {
+ display: block;
+}
+
+#notification_list .notification-time {
+ font-size: 0.9em;
+ float: right;
+}
+
+.notification_list .notifications_time {
+ font-size: 0.8em;
+}
diff --git a/phpBB/styles/subsilver2/theme/theme.cfg b/phpBB/styles/subsilver2/theme/theme.cfg
deleted file mode 100644
index 11e942fd35..0000000000
--- a/phpBB/styles/subsilver2/theme/theme.cfg
+++ /dev/null
@@ -1,35 +0,0 @@
-#
-# phpBB Theme Configuration File
-#
-# @package phpBB3
-# @copyright (c) 2005 phpBB Group
-# @license http://opensource.org/licenses/gpl-license.php GNU Public License
-#
-#
-# At the left is the name, please do not change this
-# At the right the value is entered
-# For on/off options the valid values are on, off, 1, 0, true and false
-#
-# Values get trimmed, if you want to add a space in front or at the end of
-# the value, then enclose the value with single or double quotes.
-# Single and double quotes do not need to be escaped.
-#
-# Available and used values:
-# parse_css_file
-#
-
-# General Information about this theme
-name = subsilver2
-copyright = &copy; phpBB Group, 2003
-version = 3.0.14
-
-# Some configuration options
-
-#
-# You have to turn this option on if you want to use the
-# path template variables ({T_IMAGESET_PATH} for example) within
-# your css file.
-# This is mostly the case if you want to use language specific
-# images within your css file.
-#
-parse_css_file = off
diff --git a/phpBB/ucp.php b/phpBB/ucp.php
index 520ab3caad..5cd602bab5 100644
--- a/phpBB/ucp.php
+++ b/phpBB/ucp.php
@@ -1,10 +1,13 @@
<?php
/**
*
-* @package ucp
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -22,7 +25,7 @@ require($phpbb_root_path . 'includes/functions_module.' . $phpEx);
$id = request_var('i', '');
$mode = request_var('mode', '');
-if (in_array($mode, array('login', 'logout', 'confirm', 'sendpassword', 'activate')))
+if (in_array($mode, array('login', 'login_link', 'logout', 'confirm', 'sendpassword', 'activate')))
{
define('IN_LOGIN', true);
}
@@ -81,22 +84,30 @@ switch ($mode)
login_box(request_var('redirect', "index.$phpEx"));
break;
+ case 'login_link':
+ if ($user->data['is_registered'])
+ {
+ redirect(append_sid("{$phpbb_root_path}index.$phpEx"));
+ }
+
+ $module->load('ucp', 'login_link');
+ $module->display($user->lang['UCP_LOGIN_LINK']);
+ break;
+
case 'logout':
- if ($user->data['user_id'] != ANONYMOUS && isset($_GET['sid']) && !is_array($_GET['sid']) && $_GET['sid'] === $user->session_id)
+ if ($user->data['user_id'] != ANONYMOUS && $request->is_set('sid') && $request->variable('sid', '') === $user->session_id)
{
$user->session_kill();
- $user->session_begin();
- $message = $user->lang['LOGOUT_REDIRECT'];
}
- else
+ else if ($user->data['user_id'] != ANONYMOUS)
{
- $message = ($user->data['user_id'] == ANONYMOUS) ? $user->lang['LOGOUT_REDIRECT'] : $user->lang['LOGOUT_FAILED'];
- }
- meta_refresh(3, append_sid("{$phpbb_root_path}index.$phpEx"));
+ meta_refresh(3, append_sid("{$phpbb_root_path}index.$phpEx"));
- $message = $message . '<br /><br />' . sprintf($user->lang['RETURN_INDEX'], '<a href="' . append_sid("{$phpbb_root_path}index.$phpEx") . '">', '</a> ');
- trigger_error($message);
+ $message = $user->lang['LOGOUT_FAILED'] . '<br /><br />' . sprintf($user->lang['RETURN_INDEX'], '<a href="' . append_sid("{$phpbb_root_path}index.$phpEx") . '">', '</a> ');
+ trigger_error($message);
+ }
+ redirect(append_sid("{$phpbb_root_path}index.$phpEx"));
break;
case 'terms':
@@ -120,7 +131,7 @@ switch ($mode)
);
// Disable online list
- page_header($user->lang[$title], false);
+ page_header($user->lang[$title]);
$template->assign_vars(array(
'S_AGREEMENT' => true,
@@ -141,8 +152,10 @@ switch ($mode)
{
$set_time = time() - 31536000;
- foreach ($_COOKIE as $cookie_name => $cookie_data)
+ foreach ($request->variable_names(\phpbb\request\request_interface::COOKIE) as $cookie_name)
{
+ $cookie_data = $request->variable($cookie_name, '', true, \phpbb\request\request_interface::COOKIE);
+
// Only delete board cookies, no other ones...
if (strpos($cookie_name, $config['cookie_name'] . '_') !== 0)
{
@@ -151,6 +164,22 @@ switch ($mode)
$cookie_name = str_replace($config['cookie_name'] . '_', '', $cookie_name);
+ /**
+ * Event to save custom cookies from deletion
+ *
+ * @event core.ucp_delete_cookies
+ * @var string cookie_name Cookie name to checking
+ * @var bool retain_cookie Do we retain our cookie or not, true if retain
+ * @since 3.1.3-RC1
+ */
+ $retain_cookie = false;
+ $vars = array('cookie_name', 'retain_cookie');
+ extract($phpbb_dispatcher->trigger_event('core.ucp_delete_cookies', compact($vars)));
+ if ($retain_cookie)
+ {
+ continue;
+ }
+
// Polls are stored as {cookie_name}_poll_{topic_id}, cookie_name_ got removed, therefore checking for poll_
if (strpos($cookie_name, 'poll_') !== 0)
{
@@ -208,6 +237,19 @@ switch ($mode)
add_log('admin', 'LOG_ACL_TRANSFER_PERMISSIONS', $user_row['username']);
$message = sprintf($user->lang['PERMISSIONS_TRANSFERRED'], $user_row['username']) . '<br /><br />' . sprintf($user->lang['RETURN_INDEX'], '<a href="' . append_sid("{$phpbb_root_path}index.$phpEx") . '">', '</a>');
+
+ /**
+ * Event to run code after permissions are switched
+ *
+ * @event core.ucp_switch_permissions
+ * @var int user_id User ID to switch permission to
+ * @var array user_row User data
+ * @var string message Success message
+ * @since 3.1.11-RC1
+ */
+ $vars = array('user_id', 'user_row', 'message');
+ extract($phpbb_dispatcher->trigger_event('core.ucp_switch_permissions', compact($vars)));
+
trigger_error($message);
break;
@@ -231,6 +273,18 @@ switch ($mode)
add_log('admin', 'LOG_ACL_RESTORE_PERMISSIONS', $username);
$message = $user->lang['PERMISSIONS_RESTORED'] . '<br /><br />' . sprintf($user->lang['RETURN_INDEX'], '<a href="' . append_sid("{$phpbb_root_path}index.$phpEx") . '">', '</a>');
+
+ /**
+ * Event to run code after permissions are restored
+ *
+ * @event core.ucp_restore_permissions
+ * @var string username User name
+ * @var string message Success message
+ * @since 3.1.11-RC1
+ */
+ $vars = array('username', 'message');
+ extract($phpbb_dispatcher->trigger_event('core.ucp_restore_permissions', compact($vars)));
+
trigger_error($message);
break;
@@ -272,19 +326,19 @@ if ($module->is_active('zebra', 'friends'))
// Output listing of friends online
$update_time = $config['load_online_time'] * 60;
- $sql = $db->sql_build_query('SELECT_DISTINCT', array(
+ $sql_ary = array(
'SELECT' => 'u.user_id, u.username, u.username_clean, u.user_colour, MAX(s.session_time) as online_time, MIN(s.session_viewonline) AS viewonline',
'FROM' => array(
USERS_TABLE => 'u',
- ZEBRA_TABLE => 'z'
+ ZEBRA_TABLE => 'z',
),
'LEFT_JOIN' => array(
array(
'FROM' => array(SESSIONS_TABLE => 's'),
- 'ON' => 's.session_user_id = z.zebra_id'
- )
+ 'ON' => 's.session_user_id = z.zebra_id',
+ ),
),
'WHERE' => 'z.user_id = ' . $user->data['user_id'] . '
@@ -294,8 +348,9 @@ if ($module->is_active('zebra', 'friends'))
'GROUP_BY' => 'z.zebra_id, u.user_id, u.username_clean, u.user_colour, u.username',
'ORDER_BY' => 'u.username_clean ASC',
- ));
+ );
+ $sql = $db->sql_build_query('SELECT_DISTINCT', $sql_ary);
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result))
@@ -320,6 +375,18 @@ if (!$config['allow_topic_notify'] && !$config['allow_forum_notify'])
$module->set_display('main', 'subscribed', false);
}
+/**
+* Use this event to enable and disable additional UCP modules
+*
+* @event core.ucp_display_module_before
+* @var p_master module Object holding all modules and their status
+* @var mixed id Active module category (can be the int or string)
+* @var string mode Active module
+* @since 3.1.0-a1
+*/
+$vars = array('module', 'id', 'mode');
+extract($phpbb_dispatcher->trigger_event('core.ucp_display_module_before', compact($vars)));
+
// Select the active module
$module->set_active($id, $mode);
@@ -330,26 +397,4 @@ $module->load_active();
$module->assign_tpl_vars(append_sid("{$phpbb_root_path}ucp.$phpEx"));
// Generate the page, do not display/query online list
-$module->display($module->get_page_title(), false);
-
-/**
-* Function for assigning a template var if the zebra module got included
-*/
-function _module_zebra($mode, &$module_row)
-{
- global $template;
-
- $template->assign_var('S_ZEBRA_ENABLED', true);
-
- if ($mode == 'friends')
- {
- $template->assign_var('S_ZEBRA_FRIENDS_ENABLED', true);
- }
-
- if ($mode == 'foes')
- {
- $template->assign_var('S_ZEBRA_FOES_ENABLED', true);
- }
-}
-
-?> \ No newline at end of file
+$module->display($module->get_page_title());
diff --git a/phpBB/viewforum.php b/phpBB/viewforum.php
index 6fec662b02..5c51975150 100644
--- a/phpBB/viewforum.php
+++ b/phpBB/viewforum.php
@@ -1,10 +1,13 @@
<?php
/**
*
-* @package phpBB3
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -34,6 +37,8 @@ $sort_days = request_var('st', $default_sort_days);
$sort_key = request_var('sk', $default_sort_key);
$sort_dir = request_var('sd', $default_sort_dir);
+$pagination = $phpbb_container->get('pagination');
+
// Check if the user has actually sent a forum ID with his/her request
// If not give them a nice error page.
if (!$forum_id)
@@ -106,7 +111,7 @@ if ($forum_data['forum_type'] == FORUM_LINK && $forum_data['forum_link'])
if ($forum_data['forum_flags'] & FORUM_FLAG_LINK_TRACK)
{
$sql = 'UPDATE ' . FORUMS_TABLE . '
- SET forum_posts = forum_posts + 1
+ SET forum_posts_approved = forum_posts_approved + 1
WHERE forum_id = ' . $forum_id;
$db->sql_query($sql);
}
@@ -141,8 +146,20 @@ else
}
}
+// Is a forum specific topic count required?
+if ($forum_data['forum_topics_per_page'])
+{
+ $config['topics_per_page'] = $forum_data['forum_topics_per_page'];
+}
+
+/* @var $phpbb_content_visibility \phpbb\content_visibility */
+$phpbb_content_visibility = $phpbb_container->get('content.visibility');
+
// Dump out the page header and load viewforum template
-page_header($user->lang['VIEW_FORUM'] . ' - ' . $forum_data['forum_name'], true, $forum_id);
+$topics_count = $phpbb_content_visibility->get_count('forum_topics', $forum_data, $forum_id);
+$start = $pagination->validate_start($start, $config['topics_per_page'], $topics_count);
+
+page_header($forum_data['forum_name'] . ($start ? ' - ' . $user->lang('PAGE_TITLE_NUMBER', $pagination->get_on_page($config['topics_per_page'], $start)) : ''), true, $forum_id);
$template->set_filenames(array(
'body' => 'viewforum_body.html')
@@ -177,35 +194,65 @@ if ($mark_read == 'topics')
$token = request_var('hash', '');
if (check_link_hash($token, 'global'))
{
- // Add 0 to forums array to mark global announcements correctly
- markread('topics', array($forum_id, 0));
+ markread('topics', array($forum_id), false, request_var('mark_time', 0));
}
$redirect_url = append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_id);
meta_refresh(3, $redirect_url);
- trigger_error($user->lang['TOPICS_MARKED'] . '<br /><br />' . sprintf($user->lang['RETURN_FORUM'], '<a href="' . $redirect_url . '">', '</a>'));
-}
+ if ($request->is_ajax())
+ {
+ // Tell the ajax script what language vars and URL need to be replaced
+ $data = array(
+ 'NO_UNREAD_POSTS' => $user->lang['NO_UNREAD_POSTS'],
+ 'UNREAD_POSTS' => $user->lang['UNREAD_POSTS'],
+ 'U_MARK_TOPICS' => ($user->data['is_registered'] || $config['load_anon_lastread']) ? append_sid("{$phpbb_root_path}viewforum.$phpEx", 'hash=' . generate_link_hash('global') . "&f=$forum_id&mark=topics&mark_time=" . time()) : '',
+ 'MESSAGE_TITLE' => $user->lang['INFORMATION'],
+ 'MESSAGE_TEXT' => $user->lang['TOPICS_MARKED']
+ );
+ $json_response = new \phpbb\json_response();
+ $json_response->send($data);
+ }
-// Is a forum specific topic count required?
-if ($forum_data['forum_topics_per_page'])
-{
- $config['topics_per_page'] = $forum_data['forum_topics_per_page'];
+ trigger_error($user->lang['TOPICS_MARKED'] . '<br /><br />' . sprintf($user->lang['RETURN_FORUM'], '<a href="' . $redirect_url . '">', '</a>'));
}
// Do the forum Prune thang - cron type job ...
-if ($forum_data['prune_next'] < time() && $forum_data['enable_prune'])
+if (!$config['use_system_cron'])
{
- $template->assign_var('RUN_CRON_TASK', '<img src="' . append_sid($phpbb_root_path . 'cron.' . $phpEx, 'cron_type=prune_forum&amp;f=' . $forum_id) . '" alt="cron" width="1" height="1" />');
+ $cron = $phpbb_container->get('cron.manager');
+
+ $task = $cron->find_task('cron.task.core.prune_forum');
+ $task->set_forum_data($forum_data);
+
+ if ($task->is_ready())
+ {
+ $url = $task->get_url();
+ $template->assign_var('RUN_CRON_TASK', '<img src="' . $url . '" width="1" height="1" alt="cron" />');
+ }
+ else
+ {
+ // See if we should prune the shadow topics instead
+ $task = $cron->find_task('cron.task.core.prune_shadow_topics');
+ $task->set_forum_data($forum_data);
+
+ if ($task->is_ready())
+ {
+ $url = $task->get_url();
+ $template->assign_var('RUN_CRON_TASK', '<img src="' . $url . '" width="1" height="1" alt="cron" />');
+ }
+ }
}
// Forum rules and subscription info
$s_watching_forum = array(
'link' => '',
+ 'link_toggle' => '',
'title' => '',
+ 'title_toggle' => '',
'is_watching' => false,
);
-if (($config['email_enable'] || $config['jab_enable']) && $config['allow_forum_notify'] && $forum_data['forum_type'] == FORUM_POST && ($auth->acl_get('f_subscribe', $forum_id) || $user->data['user_id'] == ANONYMOUS))
+if ($config['allow_forum_notify'] && $forum_data['forum_type'] == FORUM_POST && ($auth->acl_get('f_subscribe', $forum_id) || $user->data['user_id'] == ANONYMOUS))
{
$notify_status = (isset($forum_data['notify_status'])) ? $forum_data['notify_status'] : NULL;
watch_topic_forum('forum', $s_watching_forum, $user->data['user_id'], $forum_id, 0, $notify_status, $start, $forum_data['forum_name']);
@@ -218,25 +265,52 @@ gen_forum_auth_level('forum', $forum_id, $forum_data['forum_status']);
$limit_days = array(0 => $user->lang['ALL_TOPICS'], 1 => $user->lang['1_DAY'], 7 => $user->lang['7_DAYS'], 14 => $user->lang['2_WEEKS'], 30 => $user->lang['1_MONTH'], 90 => $user->lang['3_MONTHS'], 180 => $user->lang['6_MONTHS'], 365 => $user->lang['1_YEAR']);
$sort_by_text = array('a' => $user->lang['AUTHOR'], 't' => $user->lang['POST_TIME'], 'r' => $user->lang['REPLIES'], 's' => $user->lang['SUBJECT'], 'v' => $user->lang['VIEWS']);
-$sort_by_sql = array('a' => 't.topic_first_poster_name', 't' => 't.topic_last_post_time', 'r' => 't.topic_replies', 's' => 't.topic_title', 'v' => 't.topic_views');
+$sort_by_sql = array('a' => 't.topic_first_poster_name', 't' => array('t.topic_last_post_time', 't.topic_last_post_id'), 'r' => (($auth->acl_get('m_approve', $forum_id)) ? 't.topic_posts_approved + t.topic_posts_unapproved + t.topic_posts_softdeleted' : 't.topic_posts_approved'), 's' => 'LOWER(t.topic_title)', 'v' => 't.topic_views');
$s_limit_days = $s_sort_key = $s_sort_dir = $u_sort_param = '';
gen_sort_selects($limit_days, $sort_by_text, $sort_days, $sort_key, $sort_dir, $s_limit_days, $s_sort_key, $s_sort_dir, $u_sort_param, $default_sort_days, $default_sort_key, $default_sort_dir);
// Limit topics to certain time frame, obtain correct topic count
-// global announcements must not be counted, normal announcements have to
-// be counted, as forum_topics(_real) includes them
if ($sort_days)
{
$min_post_time = time() - ($sort_days * 86400);
- $sql = 'SELECT COUNT(topic_id) AS num_topics
- FROM ' . TOPICS_TABLE . "
- WHERE forum_id = $forum_id
- AND ((topic_type <> " . POST_GLOBAL . " AND topic_last_post_time >= $min_post_time)
- OR topic_type = " . POST_ANNOUNCE . ")
- " . (($auth->acl_get('m_approve', $forum_id)) ? '' : 'AND topic_approved = 1');
- $result = $db->sql_query($sql);
+ $sql_array = array(
+ 'SELECT' => 'COUNT(t.topic_id) AS num_topics',
+ 'FROM' => array(
+ TOPICS_TABLE => 't',
+ ),
+ 'WHERE' => 't.forum_id = ' . $forum_id . '
+ AND (t.topic_last_post_time >= ' . $min_post_time . '
+ OR t.topic_type = ' . POST_ANNOUNCE . '
+ OR t.topic_type = ' . POST_GLOBAL . ')
+ AND ' . $phpbb_content_visibility->get_visibility_sql('topic', $forum_id, 't.'),
+ );
+
+ /**
+ * Modify the sort data SQL query for getting additional fields if needed
+ *
+ * @event core.viewforum_modify_sort_data_sql
+ * @var int forum_id The forum_id whose topics are being listed
+ * @var int start Variable containing start for pagination
+ * @var int sort_days The oldest topic displayable in elapsed days
+ * @var string sort_key The sorting by. It is one of the first character of (in low case):
+ * Author, Post time, Replies, Subject, Views
+ * @var string sort_dir Either "a" for ascending or "d" for descending
+ * @var array sql_array The SQL array to get the data of all topics
+ * @since 3.1.9-RC1
+ */
+ $vars = array(
+ 'forum_id',
+ 'start',
+ 'sort_days',
+ 'sort_key',
+ 'sort_dir',
+ 'sql_array',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.viewforum_modify_sort_data_sql', compact($vars)));
+
+ $result = $db->sql_query($db->sql_build_query('SELECT', $sql_array));
$topics_count = (int) $db->sql_fetchfield('num_topics');
$db->sql_freeresult($result);
@@ -251,16 +325,9 @@ if ($sort_days)
}
else
{
- $topics_count = ($auth->acl_get('m_approve', $forum_id)) ? $forum_data['forum_topics_real'] : $forum_data['forum_topics'];
$sql_limit_time = '';
}
-// Make sure $start is set to the last page if it exceeds the amount
-if ($start < 0 || $start > $topics_count)
-{
- $start = ($start < 0) ? 0 : floor(($topics_count - 1) / $config['topics_per_page']) * $config['topics_per_page'];
-}
-
// Basic pagewide vars
$post_alt = ($forum_data['forum_status'] == ITEM_LOCKED) ? $user->lang['FORUM_LOCKED'] : $user->lang['POST_NEW_TOPIC'];
@@ -283,7 +350,7 @@ if (!empty($_EXTRA_URL))
}
$template->assign_vars(array(
- 'MODERATORS' => (!empty($moderators[$forum_id])) ? implode(', ', $moderators[$forum_id]) : '',
+ 'MODERATORS' => (!empty($moderators[$forum_id])) ? implode($user->lang['COMMA_SEPARATOR'], $moderators[$forum_id]) : '',
'POST_IMG' => ($forum_data['forum_status'] == ITEM_LOCKED) ? $user->img('button_topic_locked', $post_alt) : $user->img('button_topic_new', $post_alt),
'NEWEST_POST_IMG' => $user->img('icon_topic_newest', 'VIEW_NEWEST_POST'),
@@ -301,6 +368,8 @@ $template->assign_vars(array(
'FOLDER_MOVED_IMG' => $user->img('topic_moved', 'TOPIC_MOVED'),
'REPORTED_IMG' => $user->img('icon_topic_reported', 'TOPIC_REPORTED'),
'UNAPPROVED_IMG' => $user->img('icon_topic_unapproved', 'TOPIC_UNAPPROVED'),
+ 'DELETED_IMG' => $user->img('icon_topic_deleted', 'TOPIC_DELETED'),
+ 'POLL_IMG' => $user->img('icon_topic_poll', 'TOPIC_POLL'),
'GOTO_PAGE_IMG' => $user->img('icon_post_target', 'GOTO_PAGE'),
'L_NO_TOPICS' => ($forum_data['forum_status'] == ITEM_LOCKED) ? $user->lang['POST_FORUM_LOCKED'] : $user->lang['NO_TOPICS'],
@@ -314,8 +383,10 @@ $template->assign_vars(array(
'S_SELECT_SORT_KEY' => $s_sort_key,
'S_SELECT_SORT_DAYS' => $s_limit_days,
'S_TOPIC_ICONS' => ($s_display_active && sizeof($active_forum_ary)) ? max($active_forum_ary['enable_icons']) : (($forum_data['enable_icons']) ? true : false),
- 'S_WATCH_FORUM_LINK' => $s_watching_forum['link'],
+ 'U_WATCH_FORUM_LINK' => $s_watching_forum['link'],
+ 'U_WATCH_FORUM_TOGGLE' => $s_watching_forum['link_toggle'],
'S_WATCH_FORUM_TITLE' => $s_watching_forum['title'],
+ 'S_WATCH_FORUM_TOGGLE' => $s_watching_forum['title_toggle'],
'S_WATCHING_FORUM' => $s_watching_forum['is_watching'],
'S_FORUM_ACTION' => append_sid("{$phpbb_root_path}viewforum.$phpEx", "f=$forum_id" . (($start == 0) ? '' : "&amp;start=$start")),
'S_DISPLAY_SEARCHBOX' => ($auth->acl_get('u_search') && $auth->acl_get('f_search', $forum_id) && $config['load_search']) ? true : false,
@@ -328,14 +399,15 @@ $template->assign_vars(array(
'U_MCP' => ($auth->acl_get('m_', $forum_id)) ? append_sid("{$phpbb_root_path}mcp.$phpEx", "f=$forum_id&amp;i=main&amp;mode=forum_view", true, $user->session_id) : '',
'U_POST_NEW_TOPIC' => ($auth->acl_get('f_post', $forum_id) || $user->data['user_id'] == ANONYMOUS) ? append_sid("{$phpbb_root_path}posting.$phpEx", 'mode=post&amp;f=' . $forum_id) : '',
'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", "f=$forum_id" . ((strlen($u_sort_param)) ? "&amp;$u_sort_param" : '') . (($start == 0) ? '' : "&amp;start=$start")),
- 'U_MARK_TOPICS' => ($user->data['is_registered'] || $config['load_anon_lastread']) ? append_sid("{$phpbb_root_path}viewforum.$phpEx", 'hash=' . generate_link_hash('global') . "&amp;f=$forum_id&amp;mark=topics") : '',
+ 'U_CANONICAL' => generate_board_url() . '/' . append_sid("viewforum.$phpEx", "f=$forum_id" . (($start) ? "&amp;start=$start" : ''), true, ''),
+ 'U_MARK_TOPICS' => ($user->data['is_registered'] || $config['load_anon_lastread']) ? append_sid("{$phpbb_root_path}viewforum.$phpEx", 'hash=' . generate_link_hash('global') . "&amp;f=$forum_id&amp;mark=topics&amp;mark_time=" . time()) : '',
));
// Grab icons
$icons = $cache->obtain_icons();
// Grab all topic data
-$rowset = $announcement_list = $topic_list = $global_announce_list = array();
+$rowset = $announcement_list = $topic_list = $global_announce_forums = array();
$sql_array = array(
'SELECT' => 't.*',
@@ -345,7 +417,37 @@ $sql_array = array(
'LEFT_JOIN' => array(),
);
-$sql_approved = ($auth->acl_get('m_approve', $forum_id)) ? '' : 'AND t.topic_approved = 1';
+/**
+* Event to modify the SQL query before the topic data is retrieved
+*
+* It may also be used to override the above assigned template vars
+*
+* @event core.viewforum_get_topic_data
+* @var array forum_data Array with forum data
+* @var array sql_array The SQL array to get the data of all topics
+* @var int forum_id The forum_id whose topics are being listed
+* @var int topics_count The total number of topics for display
+* @var int sort_days The oldest topic displayable in elapsed days
+* @var string sort_key The sorting by. It is one of the first character of (in low case):
+* Author, Post time, Replies, Subject, Views
+* @var string sort_dir Either "a" for ascending or "d" for descending
+* @since 3.1.0-a1
+* @changed 3.1.0-RC4 Added forum_data var
+* @changed 3.1.4-RC1 Added forum_id, topics_count, sort_days, sort_key and sort_dir vars
+* @changed 3.1.9-RC1 Fix types of properties
+*/
+$vars = array(
+ 'forum_data',
+ 'sql_array',
+ 'forum_id',
+ 'topics_count',
+ 'sort_days',
+ 'sort_key',
+ 'sort_dir',
+);
+extract($phpbb_dispatcher->trigger_event('core.viewforum_get_topic_data', compact($vars)));
+
+$sql_approved = ' AND ' . $phpbb_content_visibility->get_visibility_sql('topic', $forum_id, 't.');
if ($user->data['is_registered'])
{
@@ -370,40 +472,92 @@ if ($user->data['is_registered'])
if ($forum_data['forum_type'] == FORUM_POST)
{
+ // Get global announcement forums
+ $g_forum_ary = $auth->acl_getf('f_read', true);
+ $g_forum_ary = array_unique(array_keys($g_forum_ary));
+
+ $sql_anounce_array['LEFT_JOIN'] = $sql_array['LEFT_JOIN'];
+ $sql_anounce_array['LEFT_JOIN'][] = array('FROM' => array(FORUMS_TABLE => 'f'), 'ON' => 'f.forum_id = t.forum_id');
+ $sql_anounce_array['SELECT'] = $sql_array['SELECT'] . ', f.forum_name';
+
// Obtain announcements ... removed sort ordering, sort by time in all cases
- $sql = $db->sql_build_query('SELECT', array(
- 'SELECT' => $sql_array['SELECT'],
+ $sql_ary = array(
+ 'SELECT' => $sql_anounce_array['SELECT'],
'FROM' => $sql_array['FROM'],
- 'LEFT_JOIN' => $sql_array['LEFT_JOIN'],
+ 'LEFT_JOIN' => $sql_anounce_array['LEFT_JOIN'],
- 'WHERE' => 't.forum_id IN (' . $forum_id . ', 0)
- AND t.topic_type IN (' . POST_ANNOUNCE . ', ' . POST_GLOBAL . ')',
+ 'WHERE' => '(t.forum_id = ' . $forum_id . '
+ AND t.topic_type = ' . POST_ANNOUNCE . ') OR
+ (' . $db->sql_in_set('t.forum_id', $g_forum_ary) . '
+ AND t.topic_type = ' . POST_GLOBAL . ')',
'ORDER_BY' => 't.topic_time DESC',
- ));
+ );
+
+ /**
+ * Event to modify the SQL query before the announcement topic ids data is retrieved
+ *
+ * @event core.viewforum_get_announcement_topic_ids_data
+ * @var array forum_data Data about the forum
+ * @var array g_forum_ary Global announcement forums array
+ * @var array sql_anounce_array SQL announcement array
+ * @var array sql_ary SQL query array to get the announcement topic ids data
+ * @var int forum_id The forum ID
+ *
+ * @since 3.1.10-RC1
+ */
+ $vars = array(
+ 'forum_data',
+ 'g_forum_ary',
+ 'sql_anounce_array',
+ 'sql_ary',
+ 'forum_id',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.viewforum_get_announcement_topic_ids_data', compact($vars)));
+
+ $sql = $db->sql_build_query('SELECT', $sql_ary);
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result))
{
- if (!$row['topic_approved'] && !$auth->acl_get('m_approve', $row['forum_id']))
+ if ($row['topic_visibility'] != ITEM_APPROVED && !$auth->acl_get('m_approve', $row['forum_id']))
{
- // Do not display announcements that are waiting for approval.
+ // Do not display announcements that are waiting for approval or soft deleted.
continue;
}
$rowset[$row['topic_id']] = $row;
$announcement_list[] = $row['topic_id'];
- if ($row['topic_type'] == POST_GLOBAL)
+ if ($forum_id != $row['forum_id'])
{
- $global_announce_list[$row['topic_id']] = true;
+ $topics_count++;
+ $global_announce_forums[] = $row['forum_id'];
}
- else
+ }
+ $db->sql_freeresult($result);
+}
+
+$forum_tracking_info = array();
+
+if ($user->data['is_registered'] && $config['load_db_lastread'])
+{
+ $forum_tracking_info[$forum_id] = $forum_data['mark_time'];
+
+ if (!empty($global_announce_forums))
+ {
+ $sql = 'SELECT forum_id, mark_time
+ FROM ' . FORUMS_TRACK_TABLE . '
+ WHERE ' . $db->sql_in_set('forum_id', $global_announce_forums) . '
+ AND user_id = ' . $user->data['user_id'];
+ $result = $db->sql_query($sql);
+
+ while ($row = $db->sql_fetchrow($result))
{
- $topics_count--;
+ $forum_tracking_info[$row['forum_id']] = $row['mark_time'];
}
+ $db->sql_freeresult($result);
}
- $db->sql_freeresult($result);
}
// If the user is trying to reach late pages, start searching from the end
@@ -413,22 +567,28 @@ if ($start > $topics_count / 2)
{
$store_reverse = true;
- if ($start + $config['topics_per_page'] > $topics_count)
- {
- $sql_limit = min($config['topics_per_page'], max(1, $topics_count - $start));
- }
-
// Select the sort order
- $sql_sort_order = $sort_by_sql[$sort_key] . ' ' . (($sort_dir == 'd') ? 'ASC' : 'DESC');
- $sql_start = max(0, $topics_count - $sql_limit - $start);
+ $direction = (($sort_dir == 'd') ? 'ASC' : 'DESC');
+
+ $sql_limit = $pagination->reverse_limit($start, $sql_limit, $topics_count - sizeof($announcement_list));
+ $sql_start = $pagination->reverse_start($start, $sql_limit, $topics_count - sizeof($announcement_list));
}
else
{
// Select the sort order
- $sql_sort_order = $sort_by_sql[$sort_key] . ' ' . (($sort_dir == 'd') ? 'DESC' : 'ASC');
+ $direction = (($sort_dir == 'd') ? 'DESC' : 'ASC');
$sql_start = $start;
}
+if (is_array($sort_by_sql[$sort_key]))
+{
+ $sql_sort_order = implode(' ' . $direction . ', ', $sort_by_sql[$sort_key]) . ' ' . $direction;
+}
+else
+{
+ $sql_sort_order = $sort_by_sql[$sort_key] . ' ' . $direction;
+}
+
if ($forum_data['forum_type'] == FORUM_POST || !sizeof($active_forum_ary))
{
$sql_where = 't.forum_id = ' . $forum_id;
@@ -444,13 +604,50 @@ else
}
// Grab just the sorted topic ids
-$sql = 'SELECT t.topic_id
- FROM ' . TOPICS_TABLE . " t
- WHERE $sql_where
+$sql_ary = array(
+ 'SELECT' => 't.topic_id',
+ 'FROM' => array(
+ TOPICS_TABLE => 't',
+ ),
+ 'WHERE' => "$sql_where
AND t.topic_type IN (" . POST_NORMAL . ', ' . POST_STICKY . ")
$sql_approved
- $sql_limit_time
- ORDER BY t.topic_type " . ((!$store_reverse) ? 'DESC' : 'ASC') . ', ' . $sql_sort_order;
+ $sql_limit_time",
+ 'ORDER_BY' => 't.topic_type ' . ((!$store_reverse) ? 'DESC' : 'ASC') . ', ' . $sql_sort_order,
+);
+
+/**
+* Event to modify the SQL query before the topic ids data is retrieved
+*
+* @event core.viewforum_get_topic_ids_data
+* @var array forum_data Data about the forum
+* @var array sql_ary SQL query array to get the topic ids data
+* @var string sql_approved Topic visibility SQL string
+* @var int sql_limit Number of records to select
+* @var string sql_limit_time SQL string to limit topic_last_post_time data
+* @var array sql_sort_order SQL sorting string
+* @var int sql_start Offset point to start selection from
+* @var string sql_where SQL WHERE clause string
+* @var bool store_reverse Flag indicating if we select from the late pages
+*
+* @since 3.1.0-RC4
+*
+* @changed 3.1.3 Added forum_data
+*/
+$vars = array(
+ 'forum_data',
+ 'sql_ary',
+ 'sql_approved',
+ 'sql_limit',
+ 'sql_limit_time',
+ 'sql_sort_order',
+ 'sql_start',
+ 'sql_where',
+ 'store_reverse',
+);
+extract($phpbb_dispatcher->trigger_event('core.viewforum_get_topic_ids_data', compact($vars)));
+
+$sql = $db->sql_build_query('SELECT', $sql_ary);
$result = $db->sql_query_limit($sql, $sql_limit, $sql_start);
while ($row = $db->sql_fetchrow($result))
@@ -494,9 +691,26 @@ if (sizeof($topic_list))
// If we have some shadow topics, update the rowset to reflect their topic information
if (sizeof($shadow_topic_list))
{
- $sql = 'SELECT *
- FROM ' . TOPICS_TABLE . '
- WHERE ' . $db->sql_in_set('topic_id', array_keys($shadow_topic_list));
+ // SQL array for obtaining shadow topics
+ $sql_array = array(
+ 'SELECT' => 't.*',
+ 'FROM' => array(
+ TOPICS_TABLE => 't'
+ ),
+ 'WHERE' => $db->sql_in_set('t.topic_id', array_keys($shadow_topic_list)),
+ );
+
+ /**
+ * Event to modify the SQL query before the shadowtopic data is retrieved
+ *
+ * @event core.viewforum_get_shadowtopic_data
+ * @var array sql_array SQL array to get the data of any shadowtopics
+ * @since 3.1.0-a1
+ */
+ $vars = array('sql_array');
+ extract($phpbb_dispatcher->trigger_event('core.viewforum_get_shadowtopic_data', compact($vars)));
+
+ $sql = $db->sql_build_query('SELECT', $sql_array);
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result))
@@ -548,63 +762,78 @@ if ($s_display_active)
$topics_count = 1;
}
-// We need to readd the local announcements to the forums total topic count, otherwise the number is different from the one on the forum list
-$total_topic_count = $topics_count + sizeof($announcement_list) - sizeof($global_announce_list);
+// We need to remove the global announcements from the forums total topic count,
+// otherwise the number is different from the one on the forum list
+$total_topic_count = $topics_count - sizeof($announcement_list);
+
+$base_url = append_sid("{$phpbb_root_path}viewforum.$phpEx", "f=$forum_id" . ((strlen($u_sort_param)) ? "&amp;$u_sort_param" : ''));
+$pagination->generate_template_pagination($base_url, 'pagination', 'start', $total_topic_count, $config['topics_per_page'], $start);
$template->assign_vars(array(
- 'PAGINATION' => generate_pagination(append_sid("{$phpbb_root_path}viewforum.$phpEx", "f=$forum_id" . ((strlen($u_sort_param)) ? "&amp;$u_sort_param" : '')), $topics_count, $config['topics_per_page'], $start),
- 'PAGE_NUMBER' => on_page($topics_count, $config['topics_per_page'], $start),
- 'TOTAL_TOPICS' => ($s_display_active) ? false : (($total_topic_count == 1) ? $user->lang['VIEW_FORUM_TOPIC'] : sprintf($user->lang['VIEW_FORUM_TOPICS'], $total_topic_count)))
-);
+ 'TOTAL_TOPICS' => ($s_display_active) ? false : $user->lang('VIEW_FORUM_TOPICS', (int) $total_topic_count),
+));
$topic_list = ($store_reverse) ? array_merge($announcement_list, array_reverse($topic_list)) : array_merge($announcement_list, $topic_list);
$topic_tracking_info = $tracking_topics = array();
+/**
+* Modify topics data before we display the viewforum page
+*
+* @event core.viewforum_modify_topics_data
+* @var array topic_list Array with current viewforum page topic ids
+* @var array rowset Array with topics data (in topic_id => topic_data format)
+* @var int total_topic_count Forum's total topic count
+* @var int forum_id Forum identifier
+* @since 3.1.0-b3
+* @changed 3.1.11-RC1 Added forum_id
+*/
+$vars = array('topic_list', 'rowset', 'total_topic_count', 'forum_id');
+extract($phpbb_dispatcher->trigger_event('core.viewforum_modify_topics_data', compact($vars)));
+
// Okay, lets dump out the page ...
if (sizeof($topic_list))
{
$mark_forum_read = true;
$mark_time_forum = 0;
- // Active topics?
- if ($s_display_active && sizeof($active_forum_ary))
+ // Generate topic forum list...
+ $topic_forum_list = array();
+ foreach ($rowset as $t_id => $row)
{
- // Generate topic forum list...
- $topic_forum_list = array();
- foreach ($rowset as $t_id => $row)
+ if (isset($forum_tracking_info[$row['forum_id']]))
{
- $topic_forum_list[$row['forum_id']]['forum_mark_time'] = ($config['load_db_lastread'] && $user->data['is_registered'] && isset($row['forum_mark_time'])) ? $row['forum_mark_time'] : 0;
- $topic_forum_list[$row['forum_id']]['topics'][] = $t_id;
+ $row['forum_mark_time'] = $forum_tracking_info[$row['forum_id']];
}
- if ($config['load_db_lastread'] && $user->data['is_registered'])
+ $topic_forum_list[$row['forum_id']]['forum_mark_time'] = ($config['load_db_lastread'] && $user->data['is_registered'] && isset($row['forum_mark_time'])) ? $row['forum_mark_time'] : 0;
+ $topic_forum_list[$row['forum_id']]['topics'][] = (int) $t_id;
+ }
+
+ if ($config['load_db_lastread'] && $user->data['is_registered'])
+ {
+ foreach ($topic_forum_list as $f_id => $topic_row)
{
- foreach ($topic_forum_list as $f_id => $topic_row)
- {
- $topic_tracking_info += get_topic_tracking($f_id, $topic_row['topics'], $rowset, array($f_id => $topic_row['forum_mark_time']), false);
- }
+ $topic_tracking_info += get_topic_tracking($f_id, $topic_row['topics'], $rowset, array($f_id => $topic_row['forum_mark_time']));
}
- else if ($config['load_anon_lastread'] || $user->data['is_registered'])
+ }
+ else if ($config['load_anon_lastread'] || $user->data['is_registered'])
+ {
+ foreach ($topic_forum_list as $f_id => $topic_row)
{
- foreach ($topic_forum_list as $f_id => $topic_row)
- {
- $topic_tracking_info += get_complete_topic_tracking($f_id, $topic_row['topics'], false);
- }
+ $topic_tracking_info += get_complete_topic_tracking($f_id, $topic_row['topics']);
}
-
- unset($topic_forum_list);
}
- else
+
+ unset($topic_forum_list);
+
+ if (!$s_display_active)
{
if ($config['load_db_lastread'] && $user->data['is_registered'])
{
- $topic_tracking_info = get_topic_tracking($forum_id, $topic_list, $rowset, array($forum_id => $forum_data['mark_time']), $global_announce_list);
$mark_time_forum = (!empty($forum_data['mark_time'])) ? $forum_data['mark_time'] : $user->data['user_lastmark'];
}
else if ($config['load_anon_lastread'] || $user->data['is_registered'])
{
- $topic_tracking_info = get_complete_topic_tracking($forum_id, $topic_list, $global_announce_list);
-
if (!$user->data['is_registered'])
{
$user->data['user_lastmark'] = (isset($tracking_topics['l'])) ? (int) (base_convert($tracking_topics['l'], 36, 10) + $config['board_startdate']) : 0;
@@ -625,7 +854,7 @@ if (sizeof($topic_list))
$s_type_switch_test = ($row['topic_type'] == POST_ANNOUNCE || $row['topic_type'] == POST_GLOBAL) ? 1 : 0;
// Replies
- $replies = ($auth->acl_get('m_approve', $topic_forum_id)) ? $row['topic_replies_real'] : $row['topic_replies'];
+ $replies = $phpbb_content_visibility->get_count('topic_posts', $row, $topic_forum_id) - 1;
if ($row['topic_status'] == ITEM_MOVED)
{
@@ -642,16 +871,19 @@ if (sizeof($topic_list))
topic_status($row, $replies, $unread_topic, $folder_img, $folder_alt, $topic_type);
// Generate all the URIs ...
- $view_topic_url_params = 'f=' . $topic_forum_id . '&amp;t=' . $topic_id;
+ $view_topic_url_params = 'f=' . $row['forum_id'] . '&amp;t=' . $topic_id;
$view_topic_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", $view_topic_url_params);
- $topic_unapproved = (!$row['topic_approved'] && $auth->acl_get('m_approve', $topic_forum_id)) ? true : false;
- $posts_unapproved = ($row['topic_approved'] && $row['topic_replies'] < $row['topic_replies_real'] && $auth->acl_get('m_approve', $topic_forum_id)) ? true : false;
+ $topic_unapproved = (($row['topic_visibility'] == ITEM_UNAPPROVED || $row['topic_visibility'] == ITEM_REAPPROVE) && $auth->acl_get('m_approve', $row['forum_id']));
+ $posts_unapproved = ($row['topic_visibility'] == ITEM_APPROVED && $row['topic_posts_unapproved'] && $auth->acl_get('m_approve', $row['forum_id']));
+ $topic_deleted = $row['topic_visibility'] == ITEM_DELETED;
+
$u_mcp_queue = ($topic_unapproved || $posts_unapproved) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue&amp;mode=' . (($topic_unapproved) ? 'approve_details' : 'unapproved_posts') . "&amp;t=$topic_id", true, $user->session_id) : '';
+ $u_mcp_queue = (!$u_mcp_queue && $topic_deleted) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue&amp;mode=deleted_topics&amp;t=' . $topic_id, true, $user->session_id) : $u_mcp_queue;
// Send vars to template
- $template->assign_block_vars('topicrow', array(
- 'FORUM_ID' => $topic_forum_id,
+ $topic_row = array(
+ 'FORUM_ID' => $row['forum_id'],
'TOPIC_ID' => $topic_id,
'TOPIC_AUTHOR' => get_username_string('username', $row['topic_poster'], $row['topic_first_poster_name'], $row['topic_first_poster_colour']),
'TOPIC_AUTHOR_COLOUR' => get_username_string('colour', $row['topic_poster'], $row['topic_first_poster_name'], $row['topic_first_poster_colour']),
@@ -664,30 +896,29 @@ if (sizeof($topic_list))
'LAST_POST_AUTHOR_COLOUR' => get_username_string('colour', $row['topic_last_poster_id'], $row['topic_last_poster_name'], $row['topic_last_poster_colour']),
'LAST_POST_AUTHOR_FULL' => get_username_string('full', $row['topic_last_poster_id'], $row['topic_last_poster_name'], $row['topic_last_poster_colour']),
- 'PAGINATION' => topic_generate_pagination($replies, $view_topic_url),
'REPLIES' => $replies,
'VIEWS' => $row['topic_views'],
'TOPIC_TITLE' => censor_text($row['topic_title']),
'TOPIC_TYPE' => $topic_type,
+ 'FORUM_NAME' => (isset($row['forum_name'])) ? $row['forum_name'] : $forum_data['forum_name'],
+ 'TOPIC_IMG_STYLE' => $folder_img,
'TOPIC_FOLDER_IMG' => $user->img($folder_img, $folder_alt),
- 'TOPIC_FOLDER_IMG_SRC' => $user->img($folder_img, $folder_alt, false, '', 'src'),
'TOPIC_FOLDER_IMG_ALT' => $user->lang[$folder_alt],
- 'TOPIC_FOLDER_IMG_WIDTH'=> $user->img($folder_img, '', false, '', 'width'),
- 'TOPIC_FOLDER_IMG_HEIGHT' => $user->img($folder_img, '', false, '', 'height'),
'TOPIC_ICON_IMG' => (!empty($icons[$row['icon_id']])) ? $icons[$row['icon_id']]['img'] : '',
'TOPIC_ICON_IMG_WIDTH' => (!empty($icons[$row['icon_id']])) ? $icons[$row['icon_id']]['width'] : '',
'TOPIC_ICON_IMG_HEIGHT' => (!empty($icons[$row['icon_id']])) ? $icons[$row['icon_id']]['height'] : '',
- 'ATTACH_ICON_IMG' => ($auth->acl_get('u_download') && $auth->acl_get('f_download', $topic_forum_id) && $row['topic_attachment']) ? $user->img('icon_topic_attach', $user->lang['TOTAL_ATTACHMENTS']) : '',
+ 'ATTACH_ICON_IMG' => ($auth->acl_get('u_download') && $auth->acl_get('f_download', $row['forum_id']) && $row['topic_attachment']) ? $user->img('icon_topic_attach', $user->lang['TOTAL_ATTACHMENTS']) : '',
'UNAPPROVED_IMG' => ($topic_unapproved || $posts_unapproved) ? $user->img('icon_topic_unapproved', ($topic_unapproved) ? 'TOPIC_UNAPPROVED' : 'POSTS_UNAPPROVED') : '',
'S_TOPIC_TYPE' => $row['topic_type'],
'S_USER_POSTED' => (isset($row['topic_posted']) && $row['topic_posted']) ? true : false,
'S_UNREAD_TOPIC' => $unread_topic,
- 'S_TOPIC_REPORTED' => (!empty($row['topic_reported']) && $auth->acl_get('m_report', $topic_forum_id)) ? true : false,
+ 'S_TOPIC_REPORTED' => (!empty($row['topic_reported']) && $auth->acl_get('m_report', $row['forum_id'])) ? true : false,
'S_TOPIC_UNAPPROVED' => $topic_unapproved,
'S_POSTS_UNAPPROVED' => $posts_unapproved,
+ 'S_TOPIC_DELETED' => $topic_deleted,
'S_HAS_POLL' => ($row['poll_start']) ? true : false,
'S_POST_ANNOUNCE' => ($row['topic_type'] == POST_ANNOUNCE) ? true : false,
'S_POST_GLOBAL' => ($row['topic_type'] == POST_GLOBAL) ? true : false,
@@ -700,14 +931,56 @@ if (sizeof($topic_list))
'U_LAST_POST_AUTHOR' => get_username_string('profile', $row['topic_last_poster_id'], $row['topic_last_poster_name'], $row['topic_last_poster_colour']),
'U_TOPIC_AUTHOR' => get_username_string('profile', $row['topic_poster'], $row['topic_first_poster_name'], $row['topic_first_poster_colour']),
'U_VIEW_TOPIC' => $view_topic_url,
- 'U_MCP_REPORT' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=reports&amp;mode=reports&amp;f=' . $topic_forum_id . '&amp;t=' . $topic_id, true, $user->session_id),
+ 'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $row['forum_id']),
+ 'U_MCP_REPORT' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=reports&amp;mode=reports&amp;f=' . $row['forum_id'] . '&amp;t=' . $topic_id, true, $user->session_id),
'U_MCP_QUEUE' => $u_mcp_queue,
- 'S_TOPIC_TYPE_SWITCH' => ($s_type_switch == $s_type_switch_test) ? -1 : $s_type_switch_test)
+ 'S_TOPIC_TYPE_SWITCH' => ($s_type_switch == $s_type_switch_test) ? -1 : $s_type_switch_test,
);
+ /**
+ * Modify the topic data before it is assigned to the template
+ *
+ * @event core.viewforum_modify_topicrow
+ * @var array row Array with topic data
+ * @var array topic_row Template array with topic data
+ * @var bool s_type_switch Flag indicating if the topic type is [global] announcement
+ * @var bool s_type_switch_test Flag indicating if the test topic type is [global] announcement
+ * @since 3.1.0-a1
+ *
+ * @changed 3.1.10-RC1 Added s_type_switch, s_type_switch_test
+ */
+ $vars = array('row', 'topic_row', 's_type_switch', 's_type_switch_test');
+ extract($phpbb_dispatcher->trigger_event('core.viewforum_modify_topicrow', compact($vars)));
+
+ $template->assign_block_vars('topicrow', $topic_row);
+
+ $pagination->generate_template_pagination($view_topic_url, 'topicrow.pagination', 'start', $replies + 1, $config['posts_per_page'], 1, true, true);
+
$s_type_switch = ($row['topic_type'] == POST_ANNOUNCE || $row['topic_type'] == POST_GLOBAL) ? 1 : 0;
+ /**
+ * Event after the topic data has been assigned to the template
+ *
+ * @event core.viewforum_topic_row_after
+ * @var array row Array with the topic data
+ * @var array rowset Array with topics data (in topic_id => topic_data format)
+ * @var bool s_type_switch Flag indicating if the topic type is [global] announcement
+ * @var int topic_id The topic ID
+ * @var array topic_list Array with current viewforum page topic ids
+ * @var array topic_row Template array with topic data
+ * @since 3.1.3-RC1
+ */
+ $vars = array(
+ 'row',
+ 'rowset',
+ 's_type_switch',
+ 'topic_id',
+ 'topic_list',
+ 'topic_row',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.viewforum_topic_row_after', compact($vars)));
+
if ($unread_topic)
{
$mark_forum_read = false;
@@ -727,5 +1000,3 @@ if ($forum_data['forum_type'] == FORUM_POST && sizeof($topic_list) && $mark_foru
}
page_footer();
-
-?> \ No newline at end of file
diff --git a/phpBB/viewonline.php b/phpBB/viewonline.php
index 5eb2894441..0a8af2001c 100644
--- a/phpBB/viewonline.php
+++ b/phpBB/viewonline.php
@@ -1,10 +1,13 @@
<?php
/**
*
-* @package phpBB3
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -27,7 +30,7 @@ $session_id = request_var('s', '');
$start = request_var('start', 0);
$sort_key = request_var('sk', 'b');
$sort_dir = request_var('sd', 'd');
-$show_guests= ($config['load_online_guests']) ? request_var('sg', 0) : 0;
+$show_guests = ($config['load_online_guests']) ? request_var('sg', 0) : 0;
// Can this user view profiles/memberlist?
if (!$auth->acl_gets('u_viewprofile', 'a_user', 'a_useradd', 'a_userdel'))
@@ -40,6 +43,9 @@ if (!$auth->acl_gets('u_viewprofile', 'a_user', 'a_useradd', 'a_userdel'))
login_box('', $user->lang['LOGIN_EXPLAIN_VIEWONLINE']);
}
+$pagination = $phpbb_container->get('pagination');
+$viewonline_helper = $phpbb_container->get('viewonline_helper');
+
$sort_key_text = array('a' => $user->lang['SORT_USERNAME'], 'b' => $user->lang['SORT_JOINED'], 'c' => $user->lang['SORT_LOCATION']);
$sort_key_sql = array('a' => 'u.username_clean', 'b' => 's.session_time', 'c' => 's.session_page');
@@ -54,7 +60,10 @@ $order_by = $sort_key_sql[$sort_key] . ' ' . (($sort_dir == 'a') ? 'ASC' : 'DESC
// Whois requested
if ($mode == 'whois' && $auth->acl_get('a_') && $session_id)
{
- include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
+ if (!function_exists('user_get_id_name'))
+ {
+ include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
+ }
$sql = 'SELECT u.user_id, u.username, u.user_type, s.session_ip
FROM ' . USERS_TABLE . ' u, ' . SESSIONS_TABLE . " s
@@ -79,11 +88,29 @@ if ($mode == 'whois' && $auth->acl_get('a_') && $session_id)
page_footer();
}
+$user->update_session_infos();
+
// Forum info
-$sql = 'SELECT forum_id, forum_name, parent_id, forum_type, left_id, right_id
- FROM ' . FORUMS_TABLE . '
- ORDER BY left_id ASC';
-$result = $db->sql_query($sql, 600);
+$sql_ary = array(
+ 'SELECT' => 'f.forum_id, f.forum_name, f.parent_id, f.forum_type, f.left_id, f.right_id',
+ 'FROM' => array(
+ FORUMS_TABLE => 'f',
+ ),
+ 'ORDER_BY' => 'f.left_id ASC',
+);
+
+/**
+* Modify the forum data SQL query for getting additional fields if needed
+*
+* @event core.viewonline_modify_forum_data_sql
+* @var array sql_ary The SQL array
+* @since 3.1.5-RC1
+*/
+$vars = array('sql_ary');
+extract($phpbb_dispatcher->trigger_event('core.viewonline_modify_forum_data_sql', compact($vars)));
+
+$result = $db->sql_query($db->sql_build_query('SELECT', $sql_ary), 600);
+unset($sql_ary);
$forum_data = array();
while ($row = $db->sql_fetchrow($result))
@@ -97,9 +124,10 @@ $guest_counter = 0;
// Get number of online guests (if we do not display them)
if (!$show_guests)
{
- switch ($db->sql_layer)
+ switch ($db->get_sql_layer())
{
case 'sqlite':
+ case 'sqlite3':
$sql = 'SELECT COUNT(session_ip) as num_guests
FROM (
SELECT DISTINCT session_ip
@@ -122,13 +150,33 @@ if (!$show_guests)
}
// Get user list
-$sql = 'SELECT u.user_id, u.username, u.username_clean, u.user_type, u.user_colour, s.session_id, s.session_time, s.session_page, s.session_ip, s.session_browser, s.session_viewonline, s.session_forum_id
- FROM ' . USERS_TABLE . ' u, ' . SESSIONS_TABLE . ' s
- WHERE u.user_id = s.session_user_id
+$sql_ary = array(
+ 'SELECT' => 'u.user_id, u.username, u.username_clean, u.user_type, u.user_colour, s.session_id, s.session_time, s.session_page, s.session_ip, s.session_browser, s.session_viewonline, s.session_forum_id',
+ 'FROM' => array(
+ USERS_TABLE => 'u',
+ SESSIONS_TABLE => 's',
+ ),
+ 'WHERE' => 'u.user_id = s.session_user_id
AND s.session_time >= ' . (time() - ($config['load_online_time'] * 60)) .
- ((!$show_guests) ? ' AND s.session_user_id <> ' . ANONYMOUS : '') . '
- ORDER BY ' . $order_by;
-$result = $db->sql_query($sql);
+ ((!$show_guests) ? ' AND s.session_user_id <> ' . ANONYMOUS : ''),
+ 'ORDER_BY' => $order_by,
+);
+
+/**
+* Modify the SQL query for getting the user data to display viewonline list
+*
+* @event core.viewonline_modify_sql
+* @var array sql_ary The SQL array
+* @var bool show_guests Do we display guests in the list
+* @var int guest_counter Number of guests displayed
+* @var array forum_data Array with forum data
+* @since 3.1.0-a1
+* @changed 3.1.0-a2 Added vars guest_counter and forum_data
+*/
+$vars = array('sql_ary', 'show_guests', 'guest_counter', 'forum_data');
+extract($phpbb_dispatcher->trigger_event('core.viewonline_modify_sql', compact($vars)));
+
+$result = $db->sql_query($db->sql_build_query('SELECT', $sql_ary));
$prev_id = $prev_ip = $user_list = array();
$logged_visible_online = $logged_hidden_online = $counter = 0;
@@ -144,7 +192,7 @@ while ($row = $db->sql_fetchrow($result))
if (!$row['session_viewonline'])
{
- $view_online = ($auth->acl_get('u_viewonline')) ? true : false;
+ $view_online = ($auth->acl_get('u_viewonline') || $row['user_id'] === $user->data['user_id']) ? true : false;
$logged_hidden_online++;
$username_full = '<em>' . $username_full . '</em>';
@@ -187,11 +235,7 @@ while ($row = $db->sql_fetchrow($result))
continue;
}
- preg_match('#^([a-z0-9/_-]+)#i', $row['session_page'], $on_page);
- if (!sizeof($on_page))
- {
- $on_page[1] = '';
- }
+ $on_page = $viewonline_helper->get_user_page($row['session_page']);
switch ($on_page[1])
{
@@ -200,7 +244,7 @@ while ($row = $db->sql_fetchrow($result))
$location_url = append_sid("{$phpbb_root_path}index.$phpEx");
break;
- case 'adm/index':
+ case $phpbb_adm_relative_path . 'index':
$location = $user->lang['ACP'];
$location_url = append_sid("{$phpbb_root_path}index.$phpEx");
break;
@@ -272,8 +316,21 @@ while ($row = $db->sql_fetchrow($result))
break;
case 'memberlist':
- $location = (strpos($row['session_page'], 'mode=viewprofile') !== false) ? $user->lang['VIEWING_MEMBER_PROFILE'] : $user->lang['VIEWING_MEMBERS'];
$location_url = append_sid("{$phpbb_root_path}memberlist.$phpEx");
+
+ if (strpos($row['session_page'], 'mode=viewprofile') !== false)
+ {
+ $location = $user->lang['VIEWING_MEMBER_PROFILE'];
+ }
+ else if (strpos($row['session_page'], 'mode=contactadmin') !== false)
+ {
+ $location = $user->lang['VIEWING_CONTACT_ADMIN'];
+ $location_url = append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=contactadmin');
+ }
+ else
+ {
+ $location = $user->lang['VIEWING_MEMBERS'];
+ }
break;
case 'mcp':
@@ -321,7 +378,22 @@ while ($row = $db->sql_fetchrow($result))
break;
}
- $template->assign_block_vars('user_row', array(
+ /**
+ * Overwrite the location's name and URL, which are displayed in the list
+ *
+ * @event core.viewonline_overwrite_location
+ * @var array on_page File name and query string
+ * @var array row Array with the users sql row
+ * @var string location Page name to displayed in the list
+ * @var string location_url Page url to displayed in the list
+ * @var array forum_data Array with forum data
+ * @since 3.1.0-a1
+ * @changed 3.1.0-a2 Added var forum_data
+ */
+ $vars = array('on_page', 'row', 'location', 'location_url', 'forum_data');
+ extract($phpbb_dispatcher->trigger_event('core.viewonline_overwrite_location', compact($vars)));
+
+ $template_row = array(
'USERNAME' => $row['username'],
'USERNAME_COLOUR' => $row['user_colour'],
'USERNAME_FULL' => $username_full,
@@ -338,50 +410,38 @@ while ($row = $db->sql_fetchrow($result))
'S_USER_HIDDEN' => $s_user_hidden,
'S_GUEST' => ($row['user_id'] == ANONYMOUS) ? true : false,
'S_USER_TYPE' => $row['user_type'],
- ));
+ );
+
+ /**
+ * Modify viewonline template data before it is displayed in the list
+ *
+ * @event core.viewonline_modify_user_row
+ * @var array on_page File name and query string
+ * @var array row Array with the users sql row
+ * @var array forum_data Array with forum data
+ * @var array template_row Array with template variables for the user row
+ * @since 3.1.0-RC4
+ */
+ $vars = array('on_page', 'row', 'forum_data', 'template_row');
+ extract($phpbb_dispatcher->trigger_event('core.viewonline_modify_user_row', compact($vars)));
+
+ $template->assign_block_vars('user_row', $template_row);
}
$db->sql_freeresult($result);
unset($prev_id, $prev_ip);
-// Generate reg/hidden/guest online text
-$vars_online = array(
- 'REG' => array('logged_visible_online', 'l_r_user_s'),
- 'HIDDEN'=> array('logged_hidden_online', 'l_h_user_s'),
- 'GUEST' => array('guest_counter', 'l_g_user_s')
-);
-
-foreach ($vars_online as $l_prefix => $var_ary)
-{
- switch ($$var_ary[0])
- {
- case 0:
- $$var_ary[1] = $user->lang[$l_prefix . '_USERS_ZERO_ONLINE'];
- break;
-
- case 1:
- $$var_ary[1] = $user->lang[$l_prefix . '_USER_ONLINE'];
- break;
-
- default:
- $$var_ary[1] = $user->lang[$l_prefix . '_USERS_ONLINE'];
- break;
- }
-}
-unset($vars_online);
-
-$pagination = generate_pagination(append_sid("{$phpbb_root_path}viewonline.$phpEx", "sg=$show_guests&amp;sk=$sort_key&amp;sd=$sort_dir"), $counter, $config['topics_per_page'], $start);
-
+$order_legend = ($config['legend_sort_groupname']) ? 'group_name' : 'group_legend';
// Grab group details for legend display
if ($auth->acl_gets('a_group', 'a_groupadd', 'a_groupdel'))
{
- $sql = 'SELECT group_id, group_name, group_colour, group_type
+ $sql = 'SELECT group_id, group_name, group_colour, group_type, group_legend
FROM ' . GROUPS_TABLE . '
- WHERE group_legend = 1
- ORDER BY group_name ASC';
+ WHERE group_legend > 0
+ ORDER BY ' . $order_legend . ' ASC';
}
else
{
- $sql = 'SELECT g.group_id, g.group_name, g.group_colour, g.group_type
+ $sql = 'SELECT g.group_id, g.group_name, g.group_colour, g.group_type, g.group_legend
FROM ' . GROUPS_TABLE . ' g
LEFT JOIN ' . USER_GROUP_TABLE . ' ug
ON (
@@ -389,9 +449,9 @@ else
AND ug.user_id = ' . $user->data['user_id'] . '
AND ug.user_pending = 0
)
- WHERE g.group_legend = 1
+ WHERE g.group_legend > 0
AND (g.group_type <> ' . GROUP_HIDDEN . ' OR ug.user_id = ' . $user->data['user_id'] . ')
- ORDER BY g.group_name ASC';
+ ORDER BY g.' . $order_legend . ' ASC';
}
$result = $db->sql_query($sql);
@@ -412,13 +472,15 @@ $db->sql_freeresult($result);
// Refreshing the page every 60 seconds...
meta_refresh(60, append_sid("{$phpbb_root_path}viewonline.$phpEx", "sg=$show_guests&amp;sk=$sort_key&amp;sd=$sort_dir&amp;start=$start"));
+$start = $pagination->validate_start($start, $config['topics_per_page'], $counter);
+$base_url = append_sid("{$phpbb_root_path}viewonline.$phpEx", "sg=$show_guests&amp;sk=$sort_key&amp;sd=$sort_dir");
+$pagination->generate_template_pagination($base_url, 'pagination', 'start', $counter, $config['topics_per_page'], $start);
+
// Send data to template
$template->assign_vars(array(
- 'TOTAL_REGISTERED_USERS_ONLINE' => sprintf($l_r_user_s, $logged_visible_online) . sprintf($l_h_user_s, $logged_hidden_online),
- 'TOTAL_GUEST_USERS_ONLINE' => sprintf($l_g_user_s, $guest_counter),
+ 'TOTAL_REGISTERED_USERS_ONLINE' => $user->lang('REG_USERS_ONLINE', (int) $logged_visible_online, $user->lang('HIDDEN_USERS_ONLINE', (int) $logged_hidden_online)),
+ 'TOTAL_GUEST_USERS_ONLINE' => $user->lang('GUEST_USERS_ONLINE', (int) $guest_counter),
'LEGEND' => $legend,
- 'PAGINATION' => $pagination,
- 'PAGE_NUMBER' => on_page($counter, $config['topics_per_page'], $start),
'U_SORT_USERNAME' => append_sid("{$phpbb_root_path}viewonline.$phpEx", 'sk=a&amp;sd=' . (($sort_key == 'a' && $sort_dir == 'a') ? 'd' : 'a') . '&amp;sg=' . ((int) $show_guests)),
'U_SORT_UPDATED' => append_sid("{$phpbb_root_path}viewonline.$phpEx", 'sk=b&amp;sd=' . (($sort_key == 'b' && $sort_dir == 'a') ? 'd' : 'a') . '&amp;sg=' . ((int) $show_guests)),
@@ -426,8 +488,9 @@ $template->assign_vars(array(
'U_SWITCH_GUEST_DISPLAY' => append_sid("{$phpbb_root_path}viewonline.$phpEx", 'sg=' . ((int) !$show_guests)),
'L_SWITCH_GUEST_DISPLAY' => ($show_guests) ? $user->lang['HIDE_GUESTS'] : $user->lang['DISPLAY_GUESTS'],
- 'S_SWITCH_GUEST_DISPLAY' => ($config['load_online_guests']) ? true : false)
-);
+ 'S_SWITCH_GUEST_DISPLAY' => ($config['load_online_guests']) ? true : false,
+ 'S_VIEWONLINE' => true,
+));
// We do not need to load the who is online box here. ;)
$config['load_online'] = false;
@@ -441,5 +504,3 @@ $template->set_filenames(array(
make_jumpbox(append_sid("{$phpbb_root_path}viewforum.$phpEx"));
page_footer();
-
-?> \ No newline at end of file
diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php
index f52e04e1a8..103fc7f108 100644
--- a/phpBB/viewtopic.php
+++ b/phpBB/viewtopic.php
@@ -1,10 +1,13 @@
<?php
/**
*
-* @package phpBB3
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -17,6 +20,7 @@ $phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
include($phpbb_root_path . 'includes/bbcode.' . $phpEx);
+include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
// Start session management
$user->session_begin();
@@ -44,6 +48,8 @@ $sort_dir = request_var('sd', $default_sort_dir);
$update = request_var('update', false);
+$pagination = $phpbb_container->get('pagination');
+
$s_can_vote = false;
/**
* @todo normalize?
@@ -56,6 +62,8 @@ if (!$topic_id && !$post_id)
trigger_error('NO_TOPIC');
}
+$phpbb_content_visibility = $phpbb_container->get('content.visibility');
+
// Find topic id if user requested a newer or older topic
if ($view && !$post_id)
{
@@ -78,16 +86,15 @@ if ($view && !$post_id)
{
// Get topic tracking info
$topic_tracking_info = get_complete_topic_tracking($forum_id, $topic_id);
-
$topic_last_read = (isset($topic_tracking_info[$topic_id])) ? $topic_tracking_info[$topic_id] : 0;
$sql = 'SELECT post_id, topic_id, forum_id
FROM ' . POSTS_TABLE . "
WHERE topic_id = $topic_id
- " . (($auth->acl_get('m_approve', $forum_id)) ? '' : 'AND post_approved = 1') . "
+ AND " . $phpbb_content_visibility->get_visibility_sql('post', $forum_id) . "
AND post_time > $topic_last_read
AND forum_id = $forum_id
- ORDER BY post_time ASC";
+ ORDER BY post_time ASC, post_id ASC";
$result = $db->sql_query_limit($sql, 1);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
@@ -138,8 +145,8 @@ if ($view && !$post_id)
WHERE forum_id = ' . $row['forum_id'] . "
AND topic_moved_id = 0
AND topic_last_post_time $sql_condition {$row['topic_last_post_time']}
- " . (($auth->acl_get('m_approve', $row['forum_id'])) ? '' : 'AND topic_approved = 1') . "
- ORDER BY topic_last_post_time $sql_ordering";
+ AND " . $phpbb_content_visibility->get_visibility_sql('topic', $row['forum_id']) . "
+ ORDER BY topic_last_post_time $sql_ordering, topic_last_post_id $sql_ordering";
$result = $db->sql_query_limit($sql, 1);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
@@ -159,26 +166,12 @@ if ($view && !$post_id)
else
{
$topic_id = $row['topic_id'];
-
- // Check for global announcement correctness?
- if (!$row['forum_id'] && !$forum_id)
- {
- trigger_error('NO_TOPIC');
- }
- else if ($row['forum_id'])
- {
- $forum_id = $row['forum_id'];
- }
+ $forum_id = $row['forum_id'];
}
}
}
- // Check for global announcement correctness?
- if ((!isset($row) || !$row['forum_id']) && !$forum_id)
- {
- trigger_error('NO_TOPIC');
- }
- else if (isset($row) && $row['forum_id'])
+ if (isset($row) && $row['forum_id'])
{
$forum_id = $row['forum_id'];
}
@@ -193,17 +186,10 @@ $sql_array = array(
'FROM' => array(FORUMS_TABLE => 'f'),
);
-// Firebird handles two columns of the same name a little differently, this
-// addresses that by forcing the forum_id to come from the forums table.
-if ($db->sql_layer === 'firebird')
-{
- $sql_array['SELECT'] = 'f.forum_id AS forum_id, ' . $sql_array['SELECT'];
-}
-
// The FROM-Order is quite important here, else t.* columns can not be correctly bound.
if ($post_id)
{
- $sql_array['SELECT'] .= ', p.post_approved, p.post_time, p.post_id';
+ $sql_array['SELECT'] .= ', p.post_visibility, p.post_time, p.post_id';
$sql_array['FROM'][POSTS_TABLE] = 'p';
}
@@ -254,26 +240,8 @@ else
$sql_array['WHERE'] = "p.post_id = $post_id AND t.topic_id = p.topic_id";
}
-$sql_array['WHERE'] .= ' AND (f.forum_id = t.forum_id';
-
-if (!$forum_id)
-{
- // If it is a global announcement make sure to set the forum id to a postable forum
- $sql_array['WHERE'] .= ' OR (t.topic_type = ' . POST_GLOBAL . '
- AND f.forum_type = ' . FORUM_POST . ')';
-}
-else
-{
- $sql_array['WHERE'] .= ' OR (t.topic_type = ' . POST_GLOBAL . "
- AND f.forum_id = $forum_id)";
-}
-
-$sql_array['WHERE'] .= ')';
+$sql_array['WHERE'] .= ' AND f.forum_id = t.forum_id';
-// Join to forum table on topic forum_id unless topic forum_id is zero
-// whereupon we join on the forum_id passed as a parameter ... this
-// is done so navigation, forum name, etc. remain consistent with where
-// user clicked to view a global topic
$sql = $db->sql_build_query('SELECT', $sql_array);
$result = $db->sql_query($sql);
$topic_data = $db->sql_fetchrow($result);
@@ -292,11 +260,18 @@ if (!$topic_data)
}
$forum_id = (int) $topic_data['forum_id'];
+
+// Now we know the forum_id and can check the permissions
+if ($topic_data['topic_visibility'] != ITEM_APPROVED && !$auth->acl_get('m_approve', $forum_id))
+{
+ trigger_error('NO_TOPIC');
+}
+
// This is for determining where we are (page)
if ($post_id)
{
// are we where we are supposed to be?
- if (!$topic_data['post_approved'] && !$auth->acl_get('m_approve', $topic_data['forum_id']))
+ if (($topic_data['post_visibility'] == ITEM_UNAPPROVED || $topic_data['post_visibility'] == ITEM_REAPPROVE) && !$auth->acl_get('m_approve', $topic_data['forum_id']))
{
// If post_id was submitted, we try at least to display the topic as a last resort...
if ($topic_id)
@@ -312,7 +287,7 @@ if ($post_id)
if ($sort_dir == $check_sort)
{
- $topic_data['prev_posts'] = ($auth->acl_get('m_approve', $forum_id)) ? $topic_data['topic_replies_real'] : $topic_data['topic_replies'];
+ $topic_data['prev_posts'] = $phpbb_content_visibility->get_count('topic_posts', $topic_data, $forum_id) - 1;
}
else
{
@@ -324,7 +299,7 @@ if ($post_id)
$sql = 'SELECT COUNT(p.post_id) AS prev_posts
FROM ' . POSTS_TABLE . " p
WHERE p.topic_id = {$topic_data['topic_id']}
- " . ((!$auth->acl_get('m_approve', $forum_id)) ? 'AND p.post_approved = 1' : '');
+ AND " . $phpbb_content_visibility->get_visibility_sql('post', $forum_id, 'p.');
if ($sort_dir == 'd')
{
@@ -344,8 +319,7 @@ if ($post_id)
}
$topic_id = (int) $topic_data['topic_id'];
-//
-$topic_replies = ($auth->acl_get('m_approve', $forum_id)) ? $topic_data['topic_replies_real'] : $topic_data['topic_replies'];
+$topic_replies = $phpbb_content_visibility->get_count('topic_posts', $topic_data, $forum_id) - 1;
// Check sticky/announcement time limit
if (($topic_data['topic_type'] == POST_STICKY || $topic_data['topic_type'] == POST_ANNOUNCE) && $topic_data['topic_time_limit'] && ($topic_data['topic_time'] + $topic_data['topic_time_limit']) < time())
@@ -362,13 +336,41 @@ if (($topic_data['topic_type'] == POST_STICKY || $topic_data['topic_type'] == PO
// Setup look and feel
$user->setup('viewtopic', $topic_data['forum_style']);
-if (!$topic_data['topic_approved'] && !$auth->acl_get('m_approve', $forum_id))
-{
- trigger_error('NO_TOPIC');
-}
+$overrides_f_read_check = false;
+$overrides_forum_password_check = false;
+$topic_tracking_info = isset($topic_tracking_info) ? $topic_tracking_info : null;
+
+/**
+* Event to apply extra permissions and to override original phpBB's f_read permission and forum password check
+* on viewtopic access
+*
+* @event core.viewtopic_before_f_read_check
+* @var int forum_id The forum id from where the topic belongs
+* @var int topic_id The id of the topic the user tries to access
+* @var int post_id The id of the post the user tries to start viewing at.
+* It may be 0 for none given.
+* @var array topic_data All the information from the topic and forum tables for this topic
+* It includes posts information if post_id is not 0
+* @var bool overrides_f_read_check Set true to remove f_read check afterwards
+* @var bool overrides_forum_password_check Set true to remove forum_password check afterwards
+* @var array topic_tracking_info Information upon calling get_topic_tracking()
+* Set it to NULL to allow auto-filling later.
+* Set it to an array to override original data.
+* @since 3.1.3-RC1
+*/
+$vars = array(
+ 'forum_id',
+ 'topic_id',
+ 'post_id',
+ 'topic_data',
+ 'overrides_f_read_check',
+ 'overrides_forum_password_check',
+ 'topic_tracking_info',
+);
+extract($phpbb_dispatcher->trigger_event('core.viewtopic_before_f_read_check', compact($vars)));
// Start auth check
-if (!$auth->acl_get('f_read', $forum_id))
+if (!$overrides_f_read_check && !$auth->acl_get('f_read', $forum_id))
{
if ($user->data['user_id'] != ANONYMOUS)
{
@@ -380,28 +382,15 @@ if (!$auth->acl_get('f_read', $forum_id))
// Forum is passworded ... check whether access has been granted to this
// user this session, if not show login box
-if ($topic_data['forum_password'])
+if (!$overrides_forum_password_check && $topic_data['forum_password'])
{
login_forum_box($topic_data);
}
-// Redirect to login or to the correct post upon emailed notification links
-if (isset($_GET['e']))
+// Redirect to login upon emailed notification links if user is not logged in.
+if (isset($_GET['e']) && $user->data['user_id'] == ANONYMOUS)
{
- $jump_to = request_var('e', 0);
-
- $redirect_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&amp;t=$topic_id");
-
- if ($user->data['user_id'] == ANONYMOUS)
- {
- login_box($redirect_url . "&amp;p=$post_id&amp;e=$jump_to", $user->lang['LOGIN_NOTIFY_TOPIC']);
- }
-
- if ($jump_to > 0)
- {
- // We direct the already logged in user to the correct post...
- redirect($redirect_url . ((!$post_id) ? "&amp;p=$jump_to" : "&amp;p=$post_id") . "#p$jump_to");
- }
+ login_box(build_url('e') . '#unread', $user->lang['LOGIN_NOTIFY_TOPIC']);
}
// What is start equal to?
@@ -432,7 +421,7 @@ if (!isset($topic_tracking_info))
$limit_days = array(0 => $user->lang['ALL_POSTS'], 1 => $user->lang['1_DAY'], 7 => $user->lang['7_DAYS'], 14 => $user->lang['2_WEEKS'], 30 => $user->lang['1_MONTH'], 90 => $user->lang['3_MONTHS'], 180 => $user->lang['6_MONTHS'], 365 => $user->lang['1_YEAR']);
$sort_by_text = array('a' => $user->lang['AUTHOR'], 't' => $user->lang['POST_TIME'], 's' => $user->lang['SUBJECT']);
-$sort_by_sql = array('a' => array('u.username_clean', 'p.post_id'), 't' => 'p.post_time', 's' => array('p.post_subject', 'p.post_id'));
+$sort_by_sql = array('a' => array('u.username_clean', 'p.post_id'), 't' => array('p.post_time', 'p.post_id'), 's' => array('p.post_subject', 'p.post_id'));
$join_user_sql = array('a' => true, 't' => false, 's' => false);
$s_limit_days = $s_sort_key = $s_sort_dir = $u_sort_param = '';
@@ -449,7 +438,7 @@ if ($sort_days)
FROM ' . POSTS_TABLE . "
WHERE topic_id = $topic_id
AND post_time >= $min_post_time
- " . (($auth->acl_get('m_approve', $forum_id)) ? '' : 'AND post_approved = 1');
+ AND " . $phpbb_content_visibility->get_visibility_sql('post', $forum_id);
$result = $db->sql_query($sql);
$total_posts = (int) $db->sql_fetchfield('num_posts');
$db->sql_freeresult($result);
@@ -479,10 +468,7 @@ if ($hilit_words)
}
// Make sure $start is set to the last page if it exceeds the amount
-if ($start < 0 || $start >= $total_posts)
-{
- $start = ($start < 0) ? 0 : floor(($total_posts - 1) / $config['posts_per_page']) * $config['posts_per_page'];
-}
+$start = $pagination->validate_start($start, $config['posts_per_page'], $total_posts);
// General Viewtopic URL for return links
$viewtopic_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&amp;t=$topic_id" . (($start == 0) ? '' : "&amp;start=$start") . ((strlen($u_sort_param)) ? "&amp;$u_sort_param" : '') . (($highlight_match) ? "&amp;hilit=$highlight" : ''));
@@ -490,11 +476,13 @@ $viewtopic_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&a
// Are we watching this topic?
$s_watching_topic = array(
'link' => '',
+ 'link_toggle' => '',
'title' => '',
+ 'title_toggle' => '',
'is_watching' => false,
);
-if (($config['email_enable'] || $config['jab_enable']) && $config['allow_topic_notify'])
+if ($config['allow_topic_notify'])
{
$notify_status = (isset($topic_data['notify_status'])) ? $topic_data['notify_status'] : null;
watch_topic_forum('topic', $s_watching_topic, $user->data['user_id'], $forum_id, $topic_id, $notify_status, $start, $topic_data['topic_title']);
@@ -507,6 +495,28 @@ if (($config['email_enable'] || $config['jab_enable']) && $config['allow_topic_n
}
}
+/**
+* Event to modify highlight.
+*
+* @event core.viewtopic_highlight_modify
+* @var string highlight String to be highlighted
+* @var string highlight_match Highlight string to be used in preg_replace
+* @var array topic_data Topic data
+* @var int start Pagination start
+* @var int total_posts Number of posts
+* @var string viewtopic_url Current viewtopic URL
+* @since 3.1.11-RC1
+*/
+$vars = array(
+ 'highlight',
+ 'highlight_match',
+ 'topic_data',
+ 'start',
+ 'total_posts',
+ 'viewtopic_url',
+);
+extract($phpbb_dispatcher->trigger_event('core.viewtopic_highlight_modify', compact($vars)));
+
// Bookmarks
if ($config['allow_bookmarks'] && $user->data['is_registered'] && request_var('bookmark', 0))
{
@@ -527,11 +537,21 @@ if ($config['allow_bookmarks'] && $user->data['is_registered'] && request_var('b
AND topic_id = $topic_id";
$db->sql_query($sql);
}
- $message = (($topic_data['bookmarked']) ? $user->lang['BOOKMARK_REMOVED'] : $user->lang['BOOKMARK_ADDED']) . '<br /><br />' . sprintf($user->lang['RETURN_TOPIC'], '<a href="' . $viewtopic_url . '">', '</a>');
+ $message = (($topic_data['bookmarked']) ? $user->lang['BOOKMARK_REMOVED'] : $user->lang['BOOKMARK_ADDED']);
+
+ if (!$request->is_ajax())
+ {
+ $message .= '<br /><br />' . $user->lang('RETURN_TOPIC', '<a href="' . $viewtopic_url . '">', '</a>');
+ }
}
else
{
- $message = $user->lang['BOOKMARK_ERR'] . '<br /><br />' . sprintf($user->lang['RETURN_TOPIC'], '<a href="' . $viewtopic_url . '">', '</a>');
+ $message = $user->lang['BOOKMARK_ERR'];
+
+ if (!$request->is_ajax())
+ {
+ $message .= '<br /><br />' . $user->lang('RETURN_TOPIC', '<a href="' . $viewtopic_url . '">', '</a>');
+ }
}
meta_refresh(3, $viewtopic_url);
@@ -558,22 +578,72 @@ gen_forum_auth_level('topic', $forum_id, $topic_data['forum_status']);
// Quick mod tools
$allow_change_type = ($auth->acl_get('m_', $forum_id) || ($user->data['is_registered'] && $user->data['user_id'] == $topic_data['topic_poster'])) ? true : false;
-$topic_mod = '';
-$topic_mod .= ($auth->acl_get('m_lock', $forum_id) || ($auth->acl_get('f_user_lock', $forum_id) && $user->data['is_registered'] && $user->data['user_id'] == $topic_data['topic_poster'] && $topic_data['topic_status'] == ITEM_UNLOCKED)) ? (($topic_data['topic_status'] == ITEM_UNLOCKED) ? '<option value="lock">' . $user->lang['LOCK_TOPIC'] . '</option>' : '<option value="unlock">' . $user->lang['UNLOCK_TOPIC'] . '</option>') : '';
-$topic_mod .= ($auth->acl_get('m_delete', $forum_id)) ? '<option value="delete_topic">' . $user->lang['DELETE_TOPIC'] . '</option>' : '';
-$topic_mod .= ($auth->acl_get('m_move', $forum_id) && $topic_data['topic_status'] != ITEM_MOVED) ? '<option value="move">' . $user->lang['MOVE_TOPIC'] . '</option>' : '';
-$topic_mod .= ($auth->acl_get('m_split', $forum_id)) ? '<option value="split">' . $user->lang['SPLIT_TOPIC'] . '</option>' : '';
-$topic_mod .= ($auth->acl_get('m_merge', $forum_id)) ? '<option value="merge">' . $user->lang['MERGE_POSTS'] . '</option>' : '';
-$topic_mod .= ($auth->acl_get('m_merge', $forum_id)) ? '<option value="merge_topic">' . $user->lang['MERGE_TOPIC'] . '</option>' : '';
-$topic_mod .= ($auth->acl_get('m_move', $forum_id)) ? '<option value="fork">' . $user->lang['FORK_TOPIC'] . '</option>' : '';
-$topic_mod .= ($allow_change_type && $auth->acl_gets('f_sticky', 'f_announce', $forum_id) && $topic_data['topic_type'] != POST_NORMAL) ? '<option value="make_normal">' . $user->lang['MAKE_NORMAL'] . '</option>' : '';
-$topic_mod .= ($allow_change_type && $auth->acl_get('f_sticky', $forum_id) && $topic_data['topic_type'] != POST_STICKY) ? '<option value="make_sticky">' . $user->lang['MAKE_STICKY'] . '</option>' : '';
-$topic_mod .= ($allow_change_type && $auth->acl_get('f_announce', $forum_id) && $topic_data['topic_type'] != POST_ANNOUNCE) ? '<option value="make_announce">' . $user->lang['MAKE_ANNOUNCE'] . '</option>' : '';
-$topic_mod .= ($allow_change_type && $auth->acl_get('f_announce', $forum_id) && $topic_data['topic_type'] != POST_GLOBAL) ? '<option value="make_global">' . $user->lang['MAKE_GLOBAL'] . '</option>' : '';
-$topic_mod .= ($auth->acl_get('m_', $forum_id)) ? '<option value="topic_logs">' . $user->lang['VIEW_TOPIC_LOGS'] . '</option>' : '';
+$s_quickmod_action = append_sid(
+ "{$phpbb_root_path}mcp.$phpEx",
+ array(
+ 'f' => $forum_id,
+ 't' => $topic_id,
+ 'start' => $start,
+ 'quickmod' => 1,
+ 'redirect' => urlencode(str_replace('&amp;', '&', $viewtopic_url)),
+ ),
+ true,
+ $user->session_id
+);
-// If we've got a hightlight set pass it on to pagination.
-$pagination = generate_pagination(append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&amp;t=$topic_id" . ((strlen($u_sort_param)) ? "&amp;$u_sort_param" : '') . (($highlight_match) ? "&amp;hilit=$highlight" : '')), $total_posts, $config['posts_per_page'], $start);
+$quickmod_array = array(
+// 'key' => array('LANG_KEY', $userHasPermissions),
+
+ 'lock' => array('LOCK_TOPIC', ($topic_data['topic_status'] == ITEM_UNLOCKED) && ($auth->acl_get('m_lock', $forum_id) || ($auth->acl_get('f_user_lock', $forum_id) && $user->data['is_registered'] && $user->data['user_id'] == $topic_data['topic_poster']))),
+ 'unlock' => array('UNLOCK_TOPIC', ($topic_data['topic_status'] != ITEM_UNLOCKED) && ($auth->acl_get('m_lock', $forum_id))),
+ 'delete_topic' => array('DELETE_TOPIC', ($auth->acl_get('m_delete', $forum_id) || (($topic_data['topic_visibility'] != ITEM_DELETED) && $auth->acl_get('m_softdelete', $forum_id)))),
+ 'restore_topic' => array('RESTORE_TOPIC', (($topic_data['topic_visibility'] == ITEM_DELETED) && $auth->acl_get('m_approve', $forum_id))),
+ 'move' => array('MOVE_TOPIC', $auth->acl_get('m_move', $forum_id) && $topic_data['topic_status'] != ITEM_MOVED),
+ 'split' => array('SPLIT_TOPIC', $auth->acl_get('m_split', $forum_id)),
+ 'merge' => array('MERGE_POSTS', $auth->acl_get('m_merge', $forum_id)),
+ 'merge_topic' => array('MERGE_TOPIC', $auth->acl_get('m_merge', $forum_id)),
+ 'fork' => array('FORK_TOPIC', $auth->acl_get('m_move', $forum_id)),
+ 'make_normal' => array('MAKE_NORMAL', ($allow_change_type && $auth->acl_gets('f_sticky', 'f_announce', $forum_id) && $topic_data['topic_type'] != POST_NORMAL)),
+ 'make_sticky' => array('MAKE_STICKY', ($allow_change_type && $auth->acl_get('f_sticky', $forum_id) && $topic_data['topic_type'] != POST_STICKY)),
+ 'make_announce' => array('MAKE_ANNOUNCE', ($allow_change_type && $auth->acl_get('f_announce', $forum_id) && $topic_data['topic_type'] != POST_ANNOUNCE)),
+ 'make_global' => array('MAKE_GLOBAL', ($allow_change_type && $auth->acl_get('f_announce', $forum_id) && $topic_data['topic_type'] != POST_GLOBAL)),
+ 'topic_logs' => array('VIEW_TOPIC_LOGS', $auth->acl_get('m_', $forum_id)),
+);
+
+/**
+* Event to modify data in the quickmod_array before it gets sent to the
+* phpbb_add_quickmod_option function.
+*
+* @event core.viewtopic_add_quickmod_option_before
+* @var int forum_id Forum ID
+* @var int post_id Post ID
+* @var array quickmod_array Array with quick moderation options data
+* @var array topic_data Array with topic data
+* @var int topic_id Topic ID
+* @var array topic_tracking_info Array with topic tracking data
+* @var string viewtopic_url URL to the topic page
+* @var bool allow_change_type Topic change permissions check
+* @since 3.1.9-RC1
+*/
+$vars = array(
+ 'forum_id',
+ 'post_id',
+ 'quickmod_array',
+ 'topic_data',
+ 'topic_id',
+ 'topic_tracking_info',
+ 'viewtopic_url',
+ 'allow_change_type',
+);
+extract($phpbb_dispatcher->trigger_event('core.viewtopic_add_quickmod_option_before', compact($vars)));
+
+foreach ($quickmod_array as $option => $qm_ary)
+{
+ if (!empty($qm_ary[1]))
+ {
+ phpbb_add_quickmod_option($s_quickmod_action, $option, $qm_ary[0]);
+ }
+}
// Navigation links
generate_forum_nav($topic_data);
@@ -612,6 +682,42 @@ if (!empty($_EXTRA_URL))
}
}
+// If we've got a hightlight set pass it on to pagination.
+$base_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&amp;t=$topic_id" . ((strlen($u_sort_param)) ? "&amp;$u_sort_param" : '') . (($highlight_match) ? "&amp;hilit=$highlight" : ''));
+
+/**
+* Event to modify data before template variables are being assigned
+*
+* @event core.viewtopic_assign_template_vars_before
+* @var string base_url URL to be passed to generate pagination
+* @var int forum_id Forum ID
+* @var int post_id Post ID
+* @var array quickmod_array Array with quick moderation options data
+* @var int start Pagination information
+* @var array topic_data Array with topic data
+* @var int topic_id Topic ID
+* @var array topic_tracking_info Array with topic tracking data
+* @var int total_posts Topic total posts count
+* @var string viewtopic_url URL to the topic page
+* @since 3.1.0-RC4
+* @changed 3.1.2-RC1 Added viewtopic_url
+*/
+$vars = array(
+ 'base_url',
+ 'forum_id',
+ 'post_id',
+ 'quickmod_array',
+ 'start',
+ 'topic_data',
+ 'topic_id',
+ 'topic_tracking_info',
+ 'total_posts',
+ 'viewtopic_url',
+);
+extract($phpbb_dispatcher->trigger_event('core.viewtopic_assign_template_vars_before', compact($vars)));
+
+$pagination->generate_template_pagination($base_url, 'pagination', 'start', $total_posts, $config['posts_per_page'], $start);
+
// Send vars to template
$template->assign_vars(array(
'FORUM_ID' => $forum_id,
@@ -625,27 +731,21 @@ $template->assign_vars(array(
'TOPIC_AUTHOR_COLOUR' => get_username_string('colour', $topic_data['topic_poster'], $topic_data['topic_first_poster_name'], $topic_data['topic_first_poster_colour']),
'TOPIC_AUTHOR' => get_username_string('username', $topic_data['topic_poster'], $topic_data['topic_first_poster_name'], $topic_data['topic_first_poster_colour']),
- 'PAGINATION' => $pagination,
- 'PAGE_NUMBER' => on_page($total_posts, $config['posts_per_page'], $start),
- 'TOTAL_POSTS' => ($total_posts == 1) ? $user->lang['VIEW_TOPIC_POST'] : sprintf($user->lang['VIEW_TOPIC_POSTS'], $total_posts),
+ 'TOTAL_POSTS' => $user->lang('VIEW_TOPIC_POSTS', (int) $total_posts),
'U_MCP' => ($auth->acl_get('m_', $forum_id)) ? append_sid("{$phpbb_root_path}mcp.$phpEx", "i=main&amp;mode=topic_view&amp;f=$forum_id&amp;t=$topic_id" . (($start == 0) ? '' : "&amp;start=$start") . ((strlen($u_sort_param)) ? "&amp;$u_sort_param" : ''), true, $user->session_id) : '',
- 'MODERATORS' => (isset($forum_moderators[$forum_id]) && sizeof($forum_moderators[$forum_id])) ? implode(', ', $forum_moderators[$forum_id]) : '',
+ 'MODERATORS' => (isset($forum_moderators[$forum_id]) && sizeof($forum_moderators[$forum_id])) ? implode($user->lang['COMMA_SEPARATOR'], $forum_moderators[$forum_id]) : '',
'POST_IMG' => ($topic_data['forum_status'] == ITEM_LOCKED) ? $user->img('button_topic_locked', 'FORUM_LOCKED') : $user->img('button_topic_new', 'POST_NEW_TOPIC'),
'QUOTE_IMG' => $user->img('icon_post_quote', 'REPLY_WITH_QUOTE'),
'REPLY_IMG' => ($topic_data['forum_status'] == ITEM_LOCKED || $topic_data['topic_status'] == ITEM_LOCKED) ? $user->img('button_topic_locked', 'TOPIC_LOCKED') : $user->img('button_topic_reply', 'REPLY_TO_TOPIC'),
'EDIT_IMG' => $user->img('icon_post_edit', 'EDIT_POST'),
'DELETE_IMG' => $user->img('icon_post_delete', 'DELETE_POST'),
+ 'DELETED_IMG' => $user->img('icon_topic_deleted', 'POST_DELETED_RESTORE'),
'INFO_IMG' => $user->img('icon_post_info', 'VIEW_INFO'),
'PROFILE_IMG' => $user->img('icon_user_profile', 'READ_PROFILE'),
'SEARCH_IMG' => $user->img('icon_user_search', 'SEARCH_USER_POSTS'),
'PM_IMG' => $user->img('icon_contact_pm', 'SEND_PRIVATE_MESSAGE'),
'EMAIL_IMG' => $user->img('icon_contact_email', 'SEND_EMAIL'),
- 'WWW_IMG' => $user->img('icon_contact_www', 'VISIT_WEBSITE'),
- 'ICQ_IMG' => $user->img('icon_contact_icq', 'ICQ'),
- 'AIM_IMG' => $user->img('icon_contact_aim', 'AIM'),
- 'MSN_IMG' => $user->img('icon_contact_msnm', 'MSNM'),
- 'YIM_IMG' => $user->img('icon_contact_yahoo', 'YIM'),
'JABBER_IMG' => $user->img('icon_contact_jabber', 'JABBER') ,
'REPORT_IMG' => $user->img('icon_post_report', 'REPORT_POST'),
'REPORTED_IMG' => $user->img('icon_topic_reported', 'POST_REPORTED'),
@@ -658,10 +758,11 @@ $template->assign_vars(array(
'S_SELECT_SORT_DAYS' => $s_limit_days,
'S_SINGLE_MODERATOR' => (!empty($forum_moderators[$forum_id]) && sizeof($forum_moderators[$forum_id]) > 1) ? false : true,
'S_TOPIC_ACTION' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&amp;t=$topic_id" . (($start == 0) ? '' : "&amp;start=$start")),
- 'S_TOPIC_MOD' => ($topic_mod != '') ? '<select name="action" id="quick-mod-select">' . $topic_mod . '</select>' : '',
- 'S_MOD_ACTION' => append_sid("{$phpbb_root_path}mcp.$phpEx", "f=$forum_id&amp;t=$topic_id" . (($start == 0) ? '' : "&amp;start=$start") . "&amp;quickmod=1&amp;redirect=" . urlencode(str_replace('&amp;', '&', $viewtopic_url)), true, $user->session_id),
+ 'S_MOD_ACTION' => $s_quickmod_action,
+ 'L_RETURN_TO_FORUM' => $user->lang('RETURN_TO', $topic_data['forum_name']),
'S_VIEWTOPIC' => true,
+ 'S_UNREAD_VIEW' => $view == 'unread',
'S_DISPLAY_SEARCHBOX' => ($auth->acl_get('u_search') && $auth->acl_get('f_search', $forum_id) && $config['load_search']) ? true : false,
'S_SEARCHBOX_ACTION' => append_sid("{$phpbb_root_path}search.$phpEx"),
'S_SEARCH_LOCAL_HIDDEN_FIELDS' => build_hidden_fields($s_search_hidden_fields),
@@ -673,18 +774,23 @@ $template->assign_vars(array(
'U_TOPIC' => "{$server_path}viewtopic.$phpEx?f=$forum_id&amp;t=$topic_id",
'U_FORUM' => $server_path,
'U_VIEW_TOPIC' => $viewtopic_url,
+ 'U_CANONICAL' => generate_board_url() . '/' . append_sid("viewtopic.$phpEx", "t=$topic_id" . (($start) ? "&amp;start=$start" : ''), true, ''),
'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_id),
'U_VIEW_OLDER_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&amp;t=$topic_id&amp;view=previous"),
'U_VIEW_NEWER_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&amp;t=$topic_id&amp;view=next"),
'U_PRINT_TOPIC' => ($auth->acl_get('f_print', $forum_id)) ? $viewtopic_url . '&amp;view=print' : '',
'U_EMAIL_TOPIC' => ($auth->acl_get('f_email', $forum_id) && $config['email_enable']) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=email&amp;t=$topic_id") : '',
- 'U_WATCH_TOPIC' => $s_watching_topic['link'],
- 'L_WATCH_TOPIC' => $s_watching_topic['title'],
+ 'U_WATCH_TOPIC' => $s_watching_topic['link'],
+ 'U_WATCH_TOPIC_TOGGLE' => $s_watching_topic['link_toggle'],
+ 'S_WATCH_TOPIC_TITLE' => $s_watching_topic['title'],
+ 'S_WATCH_TOPIC_TOGGLE' => $s_watching_topic['title_toggle'],
'S_WATCHING_TOPIC' => $s_watching_topic['is_watching'],
'U_BOOKMARK_TOPIC' => ($user->data['is_registered'] && $config['allow_bookmarks']) ? $viewtopic_url . '&amp;bookmark=1&amp;hash=' . generate_link_hash("topic_$topic_id") : '',
- 'L_BOOKMARK_TOPIC' => ($user->data['is_registered'] && $config['allow_bookmarks'] && $topic_data['bookmarked']) ? $user->lang['BOOKMARK_TOPIC_REMOVE'] : $user->lang['BOOKMARK_TOPIC'],
+ 'S_BOOKMARK_TOPIC' => ($user->data['is_registered'] && $config['allow_bookmarks'] && $topic_data['bookmarked']) ? $user->lang['BOOKMARK_TOPIC_REMOVE'] : $user->lang['BOOKMARK_TOPIC'],
+ 'S_BOOKMARK_TOGGLE' => (!$user->data['is_registered'] || !$config['allow_bookmarks'] || !$topic_data['bookmarked']) ? $user->lang['BOOKMARK_TOPIC_REMOVE'] : $user->lang['BOOKMARK_TOPIC'],
+ 'S_BOOKMARKED_TOPIC' => ($user->data['is_registered'] && $config['allow_bookmarks'] && $topic_data['bookmarked']) ? true : false,
'U_POST_NEW_TOPIC' => ($auth->acl_get('f_post', $forum_id) || $user->data['user_id'] == ANONYMOUS) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=post&amp;f=$forum_id") : '',
'U_POST_REPLY_TOPIC' => ($auth->acl_get('f_reply', $forum_id) || $user->data['user_id'] == ANONYMOUS) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=reply&amp;f=$forum_id&amp;t=$topic_id") : '',
@@ -702,10 +808,12 @@ if (!empty($topic_data['poll_start']))
ORDER BY o.poll_option_id";
$result = $db->sql_query($sql);
- $poll_info = array();
+ $poll_info = $vote_counts = array();
while ($row = $db->sql_fetchrow($result))
{
$poll_info[] = $row;
+ $option_id = (int) $row['poll_option_id'];
+ $vote_counts[$option_id] = (int) $row['poll_option_total'];
}
$db->sql_freeresult($result);
@@ -729,9 +837,9 @@ if (!empty($topic_data['poll_start']))
// Cookie based guest tracking ... I don't like this but hum ho
// it's oft requested. This relies on "nice" users who don't feel
// the need to delete cookies to mess with results.
- if (isset($_COOKIE[$config['cookie_name'] . '_poll_' . $topic_id]))
+ if ($request->is_set($config['cookie_name'] . '_poll_' . $topic_id, \phpbb\request\request_interface::COOKIE))
{
- $cur_voted_id = explode(',', $_COOKIE[$config['cookie_name'] . '_poll_' . $topic_id]);
+ $cur_voted_id = explode(',', $request->variable($config['cookie_name'] . '_poll_' . $topic_id, '', true, \phpbb\request\request_interface::COOKIE));
$cur_voted_id = array_map('intval', $cur_voted_id);
}
}
@@ -745,6 +853,36 @@ if (!empty($topic_data['poll_start']))
($auth->acl_get('f_votechg', $forum_id) && $topic_data['poll_vote_change']))) ? true : false;
$s_display_results = (!$s_can_vote || ($s_can_vote && sizeof($cur_voted_id)) || $view == 'viewpoll') ? true : false;
+ /**
+ * Event to manipulate the poll data
+ *
+ * @event core.viewtopic_modify_poll_data
+ * @var array cur_voted_id Array with options' IDs current user has voted for
+ * @var int forum_id The topic's forum id
+ * @var array poll_info Array with the poll information
+ * @var bool s_can_vote Flag indicating if a user can vote
+ * @var bool s_display_results Flag indicating if results or poll options should be displayed
+ * @var int topic_id The id of the topic the user tries to access
+ * @var array topic_data All the information from the topic and forum tables for this topic
+ * @var string viewtopic_url URL to the topic page
+ * @var array vote_counts Array with the vote counts for every poll option
+ * @var array voted_id Array with updated options' IDs current user is voting for
+ * @since 3.1.5-RC1
+ */
+ $vars = array(
+ 'cur_voted_id',
+ 'forum_id',
+ 'poll_info',
+ 's_can_vote',
+ 's_display_results',
+ 'topic_id',
+ 'topic_data',
+ 'viewtopic_url',
+ 'vote_counts',
+ 'voted_id',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.viewtopic_modify_poll_data', compact($vars)));
+
if ($update && $s_can_vote)
{
@@ -787,6 +925,8 @@ if (!empty($topic_data['poll_start']))
AND topic_id = ' . (int) $topic_id;
$db->sql_query($sql);
+ $vote_counts[$option]++;
+
if ($user->data['is_registered'])
{
$sql_ary = array(
@@ -811,6 +951,8 @@ if (!empty($topic_data['poll_start']))
AND topic_id = ' . (int) $topic_id;
$db->sql_query($sql);
+ $vote_counts[$option]--;
+
if ($user->data['is_registered'])
{
$sql = 'DELETE FROM ' . POLL_VOTES_TABLE . '
@@ -834,76 +976,77 @@ if (!empty($topic_data['poll_start']))
$db->sql_query($sql);
$redirect_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&amp;t=$topic_id" . (($start == 0) ? '' : "&amp;start=$start"));
+ $message = $user->lang['VOTE_SUBMITTED'] . '<br /><br />' . sprintf($user->lang['RETURN_TOPIC'], '<a href="' . $redirect_url . '">', '</a>');
+
+ if ($request->is_ajax())
+ {
+ // Filter out invalid options
+ $valid_user_votes = array_intersect(array_keys($vote_counts), $voted_id);
+
+ $data = array(
+ 'NO_VOTES' => $user->lang['NO_VOTES'],
+ 'success' => true,
+ 'user_votes' => array_flip($valid_user_votes),
+ 'vote_counts' => $vote_counts,
+ 'total_votes' => array_sum($vote_counts),
+ 'can_vote' => !sizeof($valid_user_votes) || ($auth->acl_get('f_votechg', $forum_id) && $topic_data['poll_vote_change']),
+ );
+ $json_response = new \phpbb\json_response();
+ $json_response->send($data);
+ }
meta_refresh(5, $redirect_url);
- trigger_error($user->lang['VOTE_SUBMITTED'] . '<br /><br />' . sprintf($user->lang['RETURN_TOPIC'], '<a href="' . $redirect_url . '">', '</a>'));
+ trigger_error($message);
}
$poll_total = 0;
+ $poll_most = 0;
foreach ($poll_info as $poll_option)
{
$poll_total += $poll_option['poll_option_total'];
+ $poll_most = ($poll_option['poll_option_total'] >= $poll_most) ? $poll_option['poll_option_total'] : $poll_most;
}
- if ($poll_info[0]['bbcode_bitfield'])
- {
- $poll_bbcode = new bbcode();
- }
- else
- {
- $poll_bbcode = false;
- }
+ $parse_flags = ($poll_info[0]['bbcode_bitfield'] ? OPTION_FLAG_BBCODE : 0) | OPTION_FLAG_SMILIES;
for ($i = 0, $size = sizeof($poll_info); $i < $size; $i++)
{
- $poll_info[$i]['poll_option_text'] = censor_text($poll_info[$i]['poll_option_text']);
-
- if ($poll_bbcode !== false)
- {
- $poll_bbcode->bbcode_second_pass($poll_info[$i]['poll_option_text'], $poll_info[$i]['bbcode_uid'], $poll_option['bbcode_bitfield']);
- }
-
- $poll_info[$i]['poll_option_text'] = bbcode_nl2br($poll_info[$i]['poll_option_text']);
- $poll_info[$i]['poll_option_text'] = smiley_text($poll_info[$i]['poll_option_text']);
+ $poll_info[$i]['poll_option_text'] = generate_text_for_display($poll_info[$i]['poll_option_text'], $poll_info[$i]['bbcode_uid'], $poll_option['bbcode_bitfield'], $parse_flags, true);
}
- $topic_data['poll_title'] = censor_text($topic_data['poll_title']);
-
- if ($poll_bbcode !== false)
- {
- $poll_bbcode->bbcode_second_pass($topic_data['poll_title'], $poll_info[0]['bbcode_uid'], $poll_info[0]['bbcode_bitfield']);
- }
-
- $topic_data['poll_title'] = bbcode_nl2br($topic_data['poll_title']);
- $topic_data['poll_title'] = smiley_text($topic_data['poll_title']);
-
- unset($poll_bbcode);
+ $topic_data['poll_title'] = generate_text_for_display($topic_data['poll_title'], $poll_info[0]['bbcode_uid'], $poll_info[0]['bbcode_bitfield'], $parse_flags, true);
+ $poll_template_data = $poll_options_template_data = array();
foreach ($poll_info as $poll_option)
{
$option_pct = ($poll_total > 0) ? $poll_option['poll_option_total'] / $poll_total : 0;
$option_pct_txt = sprintf("%.1d%%", round($option_pct * 100));
-
- $template->assign_block_vars('poll_option', array(
- 'POLL_OPTION_ID' => $poll_option['poll_option_id'],
- 'POLL_OPTION_CAPTION' => $poll_option['poll_option_text'],
- 'POLL_OPTION_RESULT' => $poll_option['poll_option_total'],
- 'POLL_OPTION_PERCENT' => $option_pct_txt,
- 'POLL_OPTION_PCT' => round($option_pct * 100),
- 'POLL_OPTION_IMG' => $user->img('poll_center', $option_pct_txt, round($option_pct * 250)),
- 'POLL_OPTION_VOTED' => (in_array($poll_option['poll_option_id'], $cur_voted_id)) ? true : false)
+ $option_pct_rel = ($poll_most > 0) ? $poll_option['poll_option_total'] / $poll_most : 0;
+ $option_pct_rel_txt = sprintf("%.1d%%", round($option_pct_rel * 100));
+ $option_most_votes = ($poll_option['poll_option_total'] > 0 && $poll_option['poll_option_total'] == $poll_most) ? true : false;
+
+ $poll_options_template_data[] = array(
+ 'POLL_OPTION_ID' => $poll_option['poll_option_id'],
+ 'POLL_OPTION_CAPTION' => $poll_option['poll_option_text'],
+ 'POLL_OPTION_RESULT' => $poll_option['poll_option_total'],
+ 'POLL_OPTION_PERCENT' => $option_pct_txt,
+ 'POLL_OPTION_PERCENT_REL' => $option_pct_rel_txt,
+ 'POLL_OPTION_PCT' => round($option_pct * 100),
+ 'POLL_OPTION_WIDTH' => round($option_pct * 250),
+ 'POLL_OPTION_VOTED' => (in_array($poll_option['poll_option_id'], $cur_voted_id)) ? true : false,
+ 'POLL_OPTION_MOST_VOTES' => $option_most_votes,
);
}
$poll_end = $topic_data['poll_length'] + $topic_data['poll_start'];
- $template->assign_vars(array(
+ $poll_template_data = array(
'POLL_QUESTION' => $topic_data['poll_title'],
'TOTAL_VOTES' => $poll_total,
'POLL_LEFT_CAP_IMG' => $user->img('poll_left'),
'POLL_RIGHT_CAP_IMG'=> $user->img('poll_right'),
- 'L_MAX_VOTES' => ($topic_data['poll_max_options'] == 1) ? $user->lang['MAX_OPTION_SELECT'] : sprintf($user->lang['MAX_OPTIONS_SELECT'], $topic_data['poll_max_options']),
+ 'L_MAX_VOTES' => $user->lang('MAX_OPTIONS_SELECT', (int) $topic_data['poll_max_options']),
'L_POLL_LENGTH' => ($topic_data['poll_length']) ? sprintf($user->lang[($poll_end > time()) ? 'POLL_RUN_TILL' : 'POLL_ENDED_AT'], $user->format_date($poll_end)) : '',
'S_HAS_POLL' => true,
@@ -912,10 +1055,46 @@ if (!empty($topic_data['poll_start']))
'S_IS_MULTI_CHOICE' => ($topic_data['poll_max_options'] > 1) ? true : false,
'S_POLL_ACTION' => $viewtopic_url,
- 'U_VIEW_RESULTS' => $viewtopic_url . '&amp;view=viewpoll')
+ 'U_VIEW_RESULTS' => $viewtopic_url . '&amp;view=viewpoll',
);
- unset($poll_end, $poll_info, $voted_id);
+ /**
+ * Event to add/modify poll template data
+ *
+ * @event core.viewtopic_modify_poll_template_data
+ * @var array cur_voted_id Array with options' IDs current user has voted for
+ * @var int poll_end The poll end time
+ * @var array poll_info Array with the poll information
+ * @var array poll_options_template_data Array with the poll options template data
+ * @var array poll_template_data Array with the common poll template data
+ * @var int poll_total Total poll votes count
+ * @var int poll_most Mostly voted option votes count
+ * @var array topic_data All the information from the topic and forum tables for this topic
+ * @var string viewtopic_url URL to the topic page
+ * @var array vote_counts Array with the vote counts for every poll option
+ * @var array voted_id Array with updated options' IDs current user is voting for
+ * @since 3.1.5-RC1
+ */
+ $vars = array(
+ 'cur_voted_id',
+ 'poll_end',
+ 'poll_info',
+ 'poll_options_template_data',
+ 'poll_template_data',
+ 'poll_total',
+ 'poll_most',
+ 'topic_data',
+ 'viewtopic_url',
+ 'vote_counts',
+ 'voted_id',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.viewtopic_modify_poll_template_data', compact($vars)));
+
+ $template->assign_block_vars_array('poll_option', $poll_options_template_data);
+
+ $template->assign_vars($poll_template_data);
+
+ unset($poll_end, $poll_info, $poll_options_template_data, $poll_template_data, $voted_id);
}
// If the user is trying to reach the second half of the topic, fetch it starting from the end
@@ -927,14 +1106,11 @@ if ($start > $total_posts / 2)
{
$store_reverse = true;
- if ($start + $config['posts_per_page'] > $total_posts)
- {
- $sql_limit = min($config['posts_per_page'], max(1, $total_posts - $start));
- }
-
// Select the sort order
$direction = (($sort_dir == 'd') ? 'ASC' : 'DESC');
- $sql_start = max(0, $total_posts - $sql_limit - $start);
+
+ $sql_limit = $pagination->reverse_limit($start, $sql_limit, $total_posts);
+ $sql_start = $pagination->reverse_start($start, $sql_limit, $total_posts);
}
else
{
@@ -953,16 +1129,15 @@ else
}
// Container for user details, only process once
-$post_list = $user_cache = $id_cache = $attachments = $attach_list = $rowset = $update_count = $post_edit_list = array();
-$has_attachments = $display_notice = false;
-$bbcode_bitfield = '';
+$post_list = $user_cache = $id_cache = $attachments = $attach_list = $rowset = $update_count = $post_edit_list = $post_delete_list = array();
+$has_unapproved_attachments = $has_approved_attachments = $display_notice = false;
$i = $i_total = 0;
// Go ahead and pull all data for this topic
$sql = 'SELECT p.post_id
FROM ' . POSTS_TABLE . ' p' . (($join_user_sql[$sort_key]) ? ', ' . USERS_TABLE . ' u': '') . "
WHERE p.topic_id = $topic_id
- " . ((!$auth->acl_get('m_approve', $forum_id)) ? 'AND p.post_approved = 1' : '') . "
+ AND " . $phpbb_content_visibility->get_visibility_sql('post', $forum_id, 'p.') . "
" . (($join_user_sql[$sort_key]) ? 'AND u.user_id = p.poster_id': '') . "
$limit_posts_time
ORDER BY $sql_sort_order";
@@ -992,7 +1167,7 @@ if (!sizeof($post_list))
// We need to grab it because we do reverse ordering sometimes
$max_post_time = 0;
-$sql = $db->sql_build_query('SELECT', array(
+$sql_ary = array(
'SELECT' => 'u.*, z.friend, z.foe, p.*',
'FROM' => array(
@@ -1003,17 +1178,48 @@ $sql = $db->sql_build_query('SELECT', array(
'LEFT_JOIN' => array(
array(
'FROM' => array(ZEBRA_TABLE => 'z'),
- 'ON' => 'z.user_id = ' . $user->data['user_id'] . ' AND z.zebra_id = p.poster_id'
- )
+ 'ON' => 'z.user_id = ' . $user->data['user_id'] . ' AND z.zebra_id = p.poster_id',
+ ),
),
'WHERE' => $db->sql_in_set('p.post_id', $post_list) . '
- AND u.user_id = p.poster_id'
-));
+ AND u.user_id = p.poster_id',
+);
+
+/**
+* Event to modify the SQL query before the post and poster data is retrieved
+*
+* @event core.viewtopic_get_post_data
+* @var int forum_id Forum ID
+* @var int topic_id Topic ID
+* @var array topic_data Array with topic data
+* @var array post_list Array with post_ids we are going to retrieve
+* @var int sort_days Display posts of previous x days
+* @var string sort_key Key the posts are sorted by
+* @var string sort_dir Direction the posts are sorted by
+* @var int start Pagination information
+* @var array sql_ary The SQL array to get the data of posts and posters
+* @since 3.1.0-a1
+* @changed 3.1.0-a2 Added vars forum_id, topic_id, topic_data, post_list, sort_days, sort_key, sort_dir, start
+*/
+$vars = array(
+ 'forum_id',
+ 'topic_id',
+ 'topic_data',
+ 'post_list',
+ 'sort_days',
+ 'sort_key',
+ 'sort_dir',
+ 'start',
+ 'sql_ary',
+);
+extract($phpbb_dispatcher->trigger_event('core.viewtopic_get_post_data', compact($vars)));
+$sql = $db->sql_build_query('SELECT', $sql_ary);
$result = $db->sql_query($sql);
-$now = phpbb_gmgetdate(time() + $user->timezone + $user->dst);
+$now = $user->create_datetime();
+$now = phpbb_gmgetdate($now->getTimestamp() + $now->getOffset());
// Posts are stored in the $rowset array while $attach_list, $user_cache
// and the global bbcode_bitfield are built
@@ -1032,14 +1238,18 @@ while ($row = $db->sql_fetchrow($result))
{
$attach_list[] = (int) $row['post_id'];
- if ($row['post_approved'])
+ if ($row['post_visibility'] == ITEM_UNAPPROVED || $row['post_visibility'] == ITEM_REAPPROVE)
{
- $has_attachments = true;
+ $has_unapproved_attachments = true;
+ }
+ else if ($row['post_visibility'] == ITEM_APPROVED)
+ {
+ $has_approved_attachments = true;
}
}
- $rowset[$row['post_id']] = array(
- 'hide_post' => ($row['foe'] && ($view != 'show' || $post_id != $row['post_id'])) ? true : false,
+ $rowset_data = array(
+ 'hide_post' => (($row['foe'] || $row['post_visibility'] == ITEM_DELETED) && ($view != 'show' || $post_id != $row['post_id'])) ? true : false,
'post_id' => $row['post_id'],
'post_time' => $row['post_time'],
@@ -1054,11 +1264,14 @@ while ($row = $db->sql_fetchrow($result))
'post_edit_reason' => $row['post_edit_reason'],
'post_edit_user' => $row['post_edit_user'],
'post_edit_locked' => $row['post_edit_locked'],
+ 'post_delete_time' => $row['post_delete_time'],
+ 'post_delete_reason'=> $row['post_delete_reason'],
+ 'post_delete_user' => $row['post_delete_user'],
// Make sure the icon actually exists
'icon_id' => (isset($icons[$row['icon_id']]['img'], $icons[$row['icon_id']]['height'], $icons[$row['icon_id']]['width'])) ? $row['icon_id'] : 0,
'post_attachment' => $row['post_attachment'],
- 'post_approved' => $row['post_approved'],
+ 'post_visibility' => $row['post_visibility'],
'post_reported' => $row['post_reported'],
'post_username' => $row['post_username'],
'post_text' => $row['post_text'],
@@ -1070,14 +1283,18 @@ while ($row = $db->sql_fetchrow($result))
'foe' => $row['foe'],
);
- // Define the global bbcode bitfield, will be used to load bbcodes
- $bbcode_bitfield = $bbcode_bitfield | base64_decode($row['bbcode_bitfield']);
+ /**
+ * Modify the post rowset containing data to be displayed with posts
+ *
+ * @event core.viewtopic_post_rowset_data
+ * @var array rowset_data Array with the rowset data for this post
+ * @var array row Array with original user and post data
+ * @since 3.1.0-a1
+ */
+ $vars = array('rowset_data', 'row');
+ extract($phpbb_dispatcher->trigger_event('core.viewtopic_post_rowset_data', compact($vars)));
- // Is a signature attached? Are we going to display it?
- if ($row['enable_sig'] && $config['allow_sig'] && $user->optionget('viewsigs'))
- {
- $bbcode_bitfield = $bbcode_bitfield | base64_decode($row['user_sig_bbcode_bitfield']);
- }
+ $rowset[$row['post_id']] = $rowset_data;
// Cache various user specific data ... so we don't have to recompute
// this each time the same user appears on this page
@@ -1085,48 +1302,58 @@ while ($row = $db->sql_fetchrow($result))
{
if ($poster_id == ANONYMOUS)
{
- $user_cache[$poster_id] = array(
+ $user_cache_data = array(
+ 'user_type' => USER_IGNORE,
'joined' => '',
'posts' => '',
- 'from' => '',
'sig' => '',
'sig_bbcode_uid' => '',
'sig_bbcode_bitfield' => '',
'online' => false,
- 'avatar' => ($user->optionget('viewavatars')) ? get_user_avatar($row['user_avatar'], $row['user_avatar_type'], $row['user_avatar_width'], $row['user_avatar_height']) : '',
+ 'avatar' => ($user->optionget('viewavatars')) ? phpbb_get_user_avatar($row) : '',
'rank_title' => '',
'rank_image' => '',
'rank_image_src' => '',
- 'sig' => '',
- 'profile' => '',
'pm' => '',
'email' => '',
- 'www' => '',
- 'icq_status_img' => '',
- 'icq' => '',
- 'aim' => '',
- 'msn' => '',
- 'yim' => '',
'jabber' => '',
'search' => '',
'age' => '',
'username' => $row['username'],
'user_colour' => $row['user_colour'],
+ 'contact_user' => '',
'warnings' => 0,
'allow_pm' => 0,
);
- get_user_rank($row['user_rank'], false, $user_cache[$poster_id]['rank_title'], $user_cache[$poster_id]['rank_image'], $user_cache[$poster_id]['rank_image_src']);
+ /**
+ * Modify the guest user's data displayed with the posts
+ *
+ * @event core.viewtopic_cache_guest_data
+ * @var array user_cache_data Array with the user's data
+ * @var int poster_id Poster's user id
+ * @var array row Array with original user and post data
+ * @since 3.1.0-a1
+ */
+ $vars = array('user_cache_data', 'poster_id', 'row');
+ extract($phpbb_dispatcher->trigger_event('core.viewtopic_cache_guest_data', compact($vars)));
+
+ $user_cache[$poster_id] = $user_cache_data;
+
+ $user_rank_data = phpbb_get_user_rank($row, false);
+ $user_cache[$poster_id]['rank_title'] = $user_rank_data['title'];
+ $user_cache[$poster_id]['rank_image'] = $user_rank_data['img'];
+ $user_cache[$poster_id]['rank_image_src'] = $user_rank_data['img_src'];
}
else
{
$user_sig = '';
- // We add the signature to every posters entry because enable_sig is post dependant
+ // We add the signature to every posters entry because enable_sig is post dependent
if ($row['user_sig'] && $config['allow_sig'] && $user->optionget('viewsigs'))
{
$user_sig = $row['user_sig'];
@@ -1134,11 +1361,13 @@ while ($row = $db->sql_fetchrow($result))
$id_cache[] = $poster_id;
- $user_cache[$poster_id] = array(
+ $user_cache_data = array(
+ 'user_type' => $row['user_type'],
+ 'user_inactive_reason' => $row['user_inactive_reason'],
+
'joined' => $user->format_date($row['user_regdate']),
'posts' => $row['user_posts'],
'warnings' => (isset($row['user_warnings'])) ? $row['user_warnings'] : 0,
- 'from' => (!empty($row['user_from'])) ? $row['user_from'] : '',
'sig' => $user_sig,
'sig_bbcode_uid' => (!empty($row['user_sig_bbcode_uid'])) ? $row['user_sig_bbcode_uid'] : '',
@@ -1147,7 +1376,7 @@ while ($row = $db->sql_fetchrow($result))
'viewonline' => $row['user_allow_viewonline'],
'allow_pm' => $row['user_allow_pm'],
- 'avatar' => ($user->optionget('viewavatars')) ? get_user_avatar($row['user_avatar'], $row['user_avatar_type'], $row['user_avatar_width'], $row['user_avatar_height']) : '',
+ 'avatar' => ($user->optionget('viewavatars')) ? phpbb_get_user_avatar($row) : '',
'age' => '',
'rank_title' => '',
@@ -1156,15 +1385,11 @@ while ($row = $db->sql_fetchrow($result))
'username' => $row['username'],
'user_colour' => $row['user_colour'],
+ 'contact_user' => $user->lang('CONTACT_USER', get_username_string('username', $poster_id, $row['username'], $row['user_colour'], $row['username'])),
'online' => false,
- 'profile' => append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=viewprofile&amp;u=$poster_id"),
- 'www' => $row['user_website'],
- 'aim' => ($row['user_aim'] && $auth->acl_get('u_sendim')) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=contact&amp;action=aim&amp;u=$poster_id") : '',
- 'msn' => ($row['user_msnm'] && $auth->acl_get('u_sendim')) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=contact&amp;action=msnm&amp;u=$poster_id") : '',
- 'yim' => ($row['user_yim']) ? 'http://edit.yahoo.com/config/send_webmesg?.target=' . urlencode($row['user_yim']) . '&amp;.src=pg' : '',
- 'jabber' => ($row['user_jabber'] && $auth->acl_get('u_sendim')) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=contact&amp;action=jabber&amp;u=$poster_id") : '',
- 'search' => ($auth->acl_get('u_search')) ? append_sid("{$phpbb_root_path}search.$phpEx", "author_id=$poster_id&amp;sr=posts") : '',
+ 'jabber' => ($config['jab_enable'] && $row['user_jabber'] && $auth->acl_get('u_sendim')) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=contact&amp;action=jabber&amp;u=$poster_id") : '',
+ 'search' => ($config['load_search'] && $auth->acl_get('u_search')) ? append_sid("{$phpbb_root_path}search.$phpEx", "author_id=$poster_id&amp;sr=posts") : '',
'author_full' => get_username_string('full', $poster_id, $row['username'], $row['user_colour']),
'author_colour' => get_username_string('colour', $poster_id, $row['username'], $row['user_colour']),
@@ -1172,7 +1397,24 @@ while ($row = $db->sql_fetchrow($result))
'author_profile' => get_username_string('profile', $poster_id, $row['username'], $row['user_colour']),
);
- get_user_rank($row['user_rank'], $row['user_posts'], $user_cache[$poster_id]['rank_title'], $user_cache[$poster_id]['rank_image'], $user_cache[$poster_id]['rank_image_src']);
+ /**
+ * Modify the users' data displayed with their posts
+ *
+ * @event core.viewtopic_cache_user_data
+ * @var array user_cache_data Array with the user's data
+ * @var int poster_id Poster's user id
+ * @var array row Array with original user and post data
+ * @since 3.1.0-a1
+ */
+ $vars = array('user_cache_data', 'poster_id', 'row');
+ extract($phpbb_dispatcher->trigger_event('core.viewtopic_cache_user_data', compact($vars)));
+
+ $user_cache[$poster_id] = $user_cache_data;
+
+ $user_rank_data = phpbb_get_user_rank($row, $row['user_posts']);
+ $user_cache[$poster_id]['rank_title'] = $user_rank_data['title'];
+ $user_cache[$poster_id]['rank_image'] = $user_rank_data['img'];
+ $user_cache[$poster_id]['rank_image_src'] = $user_rank_data['img_src'];
if ((!empty($row['user_allow_viewemail']) && $auth->acl_get('u_sendemail')) || $auth->acl_get('a_email'))
{
@@ -1183,17 +1425,6 @@ while ($row = $db->sql_fetchrow($result))
$user_cache[$poster_id]['email'] = '';
}
- if (!empty($row['user_icq']))
- {
- $user_cache[$poster_id]['icq'] = 'http://www.icq.com/people/' . urlencode($row['user_icq']) . '/';
- $user_cache[$poster_id]['icq_status_img'] = '<img src="http://web.icq.com/whitepages/online?icq=' . $row['user_icq'] . '&amp;img=5" width="18" height="18" alt="" />';
- }
- else
- {
- $user_cache[$poster_id]['icq_status_img'] = '';
- $user_cache[$poster_id]['icq'] = '';
- }
-
if ($config['allow_birthdays'] && !empty($row['user_birthday']))
{
list($bday_day, $bday_month, $bday_year) = array_map('intval', explode('-', $row['user_birthday']));
@@ -1221,14 +1452,10 @@ $db->sql_freeresult($result);
// Load custom profile fields
if ($config['load_cpf_viewtopic'])
{
- if (!class_exists('custom_profile'))
- {
- include($phpbb_root_path . 'includes/functions_profile_fields.' . $phpEx);
- }
- $cp = new custom_profile();
+ $cp = $phpbb_container->get('profilefields.manager');
// Grab all profile fields from users in id cache for later use - similar to the poster cache
- $profile_fields_tmp = $cp->generate_profile_fields_template('grab', $id_cache);
+ $profile_fields_tmp = $cp->grab_profile_fields_data($id_cache);
// filter out fields not to be displayed on viewtopic. Yes, it's a hack, but this shouldn't break any MODs.
$profile_fields_cache = array();
@@ -1273,7 +1500,7 @@ if (sizeof($attach_list))
FROM ' . ATTACHMENTS_TABLE . '
WHERE ' . $db->sql_in_set('post_msg_id', $attach_list) . '
AND in_message = 0
- ORDER BY filetime DESC, post_msg_id ASC';
+ ORDER BY attach_id DESC, post_msg_id ASC';
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result))
@@ -1297,8 +1524,8 @@ if (sizeof($attach_list))
$sql = 'SELECT a.post_msg_id as post_id
FROM ' . ATTACHMENTS_TABLE . ' a, ' . POSTS_TABLE . " p
WHERE p.topic_id = $topic_id
- AND p.post_approved = 1
- AND p.topic_id = a.topic_id";
+ AND p.post_visibility = " . ITEM_APPROVED . '
+ AND p.topic_id = a.topic_id';
$result = $db->sql_query_limit($sql, 1);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
@@ -1319,7 +1546,7 @@ if (sizeof($attach_list))
$db->sql_query($sql);
}
}
- else if ($has_attachments && !$topic_data['topic_attachment'])
+ else if ($has_approved_attachments && !$topic_data['topic_attachment'])
{
// Topic has approved attachments but its flag is wrong
$sql = 'UPDATE ' . TOPICS_TABLE . "
@@ -1329,6 +1556,11 @@ if (sizeof($attach_list))
$topic_data['topic_attachment'] = 1;
}
+ else if ($has_unapproved_attachments && !$topic_data['topic_attachment'])
+ {
+ // Topic has only unapproved attachments but we have the right to see and download them
+ $topic_data['topic_attachment'] = 1;
+ }
}
else
{
@@ -1336,19 +1568,61 @@ if (sizeof($attach_list))
}
}
-// Instantiate BBCode if need be
-if ($bbcode_bitfield !== '')
-{
- $bbcode = new bbcode(base64_encode($bbcode_bitfield));
-}
+// Get the list of users who can receive private messages
+$can_receive_pm_list = $auth->acl_get_list(array_keys($user_cache), 'u_readpm');
+$can_receive_pm_list = (empty($can_receive_pm_list) || !isset($can_receive_pm_list[0]['u_readpm'])) ? array() : $can_receive_pm_list[0]['u_readpm'];
+
+// Get the list of permanently banned users
+$permanently_banned_users = phpbb_get_banned_user_ids(array_keys($user_cache), false);
$i_total = sizeof($rowset) - 1;
$prev_post_id = '';
$template->assign_vars(array(
+ 'S_HAS_ATTACHMENTS' => $topic_data['topic_attachment'],
'S_NUM_POSTS' => sizeof($post_list))
);
+/**
+* Event to modify the post, poster and attachment data before assigning the posts
+*
+* @event core.viewtopic_modify_post_data
+* @var int forum_id Forum ID
+* @var int topic_id Topic ID
+* @var array topic_data Array with topic data
+* @var array post_list Array with post_ids we are going to display
+* @var array rowset Array with post_id => post data
+* @var array user_cache Array with prepared user data
+* @var int start Pagination information
+* @var int sort_days Display posts of previous x days
+* @var string sort_key Key the posts are sorted by
+* @var string sort_dir Direction the posts are sorted by
+* @var bool display_notice Shall we display a notice instead of attachments
+* @var bool has_approved_attachments Does the topic have approved attachments
+* @var array attachments List of attachments post_id => array of attachments
+* @var array permanently_banned_users List of permanently banned users
+* @var array can_receive_pm_list Array with posters that can receive pms
+* @since 3.1.0-RC3
+*/
+$vars = array(
+ 'forum_id',
+ 'topic_id',
+ 'topic_data',
+ 'post_list',
+ 'rowset',
+ 'user_cache',
+ 'sort_days',
+ 'sort_key',
+ 'sort_dir',
+ 'start',
+ 'permanently_banned_users',
+ 'can_receive_pm_list',
+ 'display_notice',
+ 'has_approved_attachments',
+ 'attachments',
+);
+extract($phpbb_dispatcher->trigger_event('core.viewtopic_modify_post_data', compact($vars)));
+
// Output the posts
$first_unread = $post_unread = false;
for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i)
@@ -1360,35 +1634,19 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i)
continue;
}
- $row =& $rowset[$post_list[$i]];
+ $row = $rowset[$post_list[$i]];
$poster_id = $row['user_id'];
// End signature parsing, only if needed
if ($user_cache[$poster_id]['sig'] && $row['enable_sig'] && empty($user_cache[$poster_id]['sig_parsed']))
{
- $user_cache[$poster_id]['sig'] = censor_text($user_cache[$poster_id]['sig']);
-
- if ($user_cache[$poster_id]['sig_bbcode_bitfield'])
- {
- $bbcode->bbcode_second_pass($user_cache[$poster_id]['sig'], $user_cache[$poster_id]['sig_bbcode_uid'], $user_cache[$poster_id]['sig_bbcode_bitfield']);
- }
-
- $user_cache[$poster_id]['sig'] = bbcode_nl2br($user_cache[$poster_id]['sig']);
- $user_cache[$poster_id]['sig'] = smiley_text($user_cache[$poster_id]['sig']);
- $user_cache[$poster_id]['sig_parsed'] = true;
+ $parse_flags = ($user_cache[$poster_id]['sig_bbcode_bitfield'] ? OPTION_FLAG_BBCODE : 0) | OPTION_FLAG_SMILIES;
+ $user_cache[$poster_id]['sig'] = generate_text_for_display($user_cache[$poster_id]['sig'], $user_cache[$poster_id]['sig_bbcode_uid'], $user_cache[$poster_id]['sig_bbcode_bitfield'], $parse_flags, true);
}
// Parse the message and subject
- $message = censor_text($row['post_text']);
-
- // Second parse bbcode here
- if ($row['bbcode_bitfield'])
- {
- $bbcode->bbcode_second_pass($message, $row['bbcode_uid'], $row['bbcode_bitfield']);
- }
-
- $message = bbcode_nl2br($message);
- $message = smiley_text($message);
+ $parse_flags = ($row['bbcode_bitfield'] ? OPTION_FLAG_BBCODE : 0) | OPTION_FLAG_SMILIES;
+ $message = generate_text_for_display($row['post_text'], $row['bbcode_uid'], $row['bbcode_bitfield'], $parse_flags, true);
if (!empty($attachments[$row['post_id']]))
{
@@ -1430,8 +1688,6 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i)
unset($post_storage_list);
}
- $l_edit_time_total = ($row['post_edit_count'] == 1) ? $user->lang['EDITED_TIME_TOTAL'] : $user->lang['EDITED_TIMES_TOTAL'];
-
if ($row['post_edit_reason'])
{
// User having edited the post also being the post author?
@@ -1444,7 +1700,7 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i)
$display_username = get_username_string('full', $row['post_edit_user'], $post_edit_list[$row['post_edit_user']]['username'], $post_edit_list[$row['post_edit_user']]['user_colour']);
}
- $l_edited_by = sprintf($l_edit_time_total, $display_username, $user->format_date($row['post_edit_time'], false, true), $row['post_edit_count']);
+ $l_edited_by = $user->lang('EDITED_TIMES_TOTAL', (int) $row['post_edit_count'], $display_username, $user->format_date($row['post_edit_time'], false, true));
}
else
{
@@ -1463,7 +1719,7 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i)
$display_username = get_username_string('full', $row['post_edit_user'], $user_cache[$row['post_edit_user']]['username'], $user_cache[$row['post_edit_user']]['user_colour']);
}
- $l_edited_by = sprintf($l_edit_time_total, $display_username, $user->format_date($row['post_edit_time'], false, true), $row['post_edit_count']);
+ $l_edited_by = $user->lang('EDITED_TIMES_TOTAL', (int) $row['post_edit_count'], $display_username, $user->format_date($row['post_edit_time'], false, true));
}
}
else
@@ -1471,6 +1727,62 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i)
$l_edited_by = '';
}
+ // Deleting information
+ if ($row['post_visibility'] == ITEM_DELETED && $row['post_delete_user'])
+ {
+ // Get usernames for all following posts if not already stored
+ if (!sizeof($post_delete_list) && ($row['post_delete_reason'] || ($row['post_delete_user'] && !isset($user_cache[$row['post_delete_user']]))))
+ {
+ // Remove all post_ids already parsed (we do not have to check them)
+ $post_storage_list = (!$store_reverse) ? array_slice($post_list, $i) : array_slice(array_reverse($post_list), $i);
+
+ $sql = 'SELECT DISTINCT u.user_id, u.username, u.user_colour
+ FROM ' . POSTS_TABLE . ' p, ' . USERS_TABLE . ' u
+ WHERE ' . $db->sql_in_set('p.post_id', $post_storage_list) . '
+ AND p.post_delete_user <> 0
+ AND p.post_delete_user = u.user_id';
+ $result2 = $db->sql_query($sql);
+ while ($user_delete_row = $db->sql_fetchrow($result2))
+ {
+ $post_delete_list[$user_delete_row['user_id']] = $user_delete_row;
+ }
+ $db->sql_freeresult($result2);
+
+ unset($post_storage_list);
+ }
+
+ if ($row['post_delete_user'] && !isset($user_cache[$row['post_delete_user']]))
+ {
+ $user_cache[$row['post_delete_user']] = $post_delete_list[$row['post_delete_user']];
+ }
+
+ $display_postername = get_username_string('full', $poster_id, $row['username'], $row['user_colour'], $row['post_username']);
+
+ // User having deleted the post also being the post author?
+ if (!$row['post_delete_user'] || $row['post_delete_user'] == $poster_id)
+ {
+ $display_username = $display_postername;
+ }
+ else
+ {
+ $display_username = get_username_string('full', $row['post_delete_user'], $user_cache[$row['post_delete_user']]['username'], $user_cache[$row['post_delete_user']]['user_colour']);
+ }
+
+ if ($row['post_delete_reason'])
+ {
+ $l_deleted_message = $user->lang('POST_DELETED_BY_REASON', $display_postername, $display_username, $user->format_date($row['post_delete_time'], false, true), $row['post_delete_reason']);
+ }
+ else
+ {
+ $l_deleted_message = $user->lang('POST_DELETED_BY', $display_postername, $display_username, $user->format_date($row['post_delete_time'], false, true));
+ }
+ $l_deleted_by = $user->lang('DELETED_INFORMATION', $display_username, $user->format_date($row['post_delete_time'], false, true));
+ }
+ else
+ {
+ $l_deleted_by = $l_deleted_message = '';
+ }
+
// Bump information
if ($topic_data['topic_bumped'] && $row['post_id'] == $topic_data['topic_last_post_id'] && isset($user_cache[$topic_data['topic_bumper']]) )
{
@@ -1489,7 +1801,7 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i)
//
if ($config['load_cpf_viewtopic'])
{
- $cp_row = (isset($profile_fields_cache[$poster_id])) ? $cp->generate_profile_fields_template('show', false, $profile_fields_cache[$poster_id]) : array();
+ $cp_row = (isset($profile_fields_cache[$poster_id])) ? $cp->generate_profile_fields_template_data($profile_fields_cache[$poster_id]) : array();
}
$post_unread = (isset($topic_tracking_info[$topic_id]) && $row['post_time'] > $topic_tracking_info[$topic_id]) ? true : false;
@@ -1500,30 +1812,107 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i)
$s_first_unread = $first_unread = true;
}
- $edit_allowed = ($user->data['is_registered'] && ($auth->acl_get('m_edit', $forum_id) || (
- $user->data['user_id'] == $poster_id &&
- $auth->acl_get('f_edit', $forum_id) &&
- $topic_data['topic_status'] != ITEM_LOCKED &&
- !$row['post_edit_locked'] &&
- ($row['post_time'] > time() - ($config['edit_time'] * 60) || !$config['edit_time'])
+ $force_edit_allowed = $force_delete_allowed = $force_softdelete_allowed = false;
+
+ $s_cannot_edit = !$auth->acl_get('f_edit', $forum_id) || $user->data['user_id'] != $poster_id;
+ $s_cannot_edit_time = $config['edit_time'] && $row['post_time'] <= time() - ($config['edit_time'] * 60);
+ $s_cannot_edit_locked = $topic_data['topic_status'] == ITEM_LOCKED || $row['post_edit_locked'];
+
+ $s_cannot_delete = $user->data['user_id'] != $poster_id || (
+ !$auth->acl_get('f_delete', $forum_id) &&
+ (!$auth->acl_get('f_softdelete', $forum_id) || $row['post_visibility'] == ITEM_DELETED)
+ );
+ $s_cannot_delete_lastpost = $topic_data['topic_last_post_id'] != $row['post_id'];
+ $s_cannot_delete_time = $config['delete_time'] && $row['post_time'] <= time() - ($config['delete_time'] * 60);
+ // we do not want to allow removal of the last post if a moderator locked it!
+ $s_cannot_delete_locked = $topic_data['topic_status'] == ITEM_LOCKED || $row['post_edit_locked'];
+
+ /**
+ * This event allows you to modify the conditions for the "can edit post" and "can delete post" checks
+ *
+ * @event core.viewtopic_modify_post_action_conditions
+ * @var array row Array with post data
+ * @var array topic_data Array with topic data
+ * @var bool force_edit_allowed Allow the user to edit the post (all permissions and conditions are ignored)
+ * @var bool s_cannot_edit User can not edit the post because it's not his
+ * @var bool s_cannot_edit_locked User can not edit the post because it's locked
+ * @var bool s_cannot_edit_time User can not edit the post because edit_time has passed
+ * @var bool force_delete_allowed Allow the user to delete the post (all permissions and conditions are ignored)
+ * @var bool s_cannot_delete User can not delete the post because it's not his
+ * @var bool s_cannot_delete_lastpost User can not delete the post because it's not the last post of the topic
+ * @var bool s_cannot_delete_locked User can not delete the post because it's locked
+ * @var bool s_cannot_delete_time User can not delete the post because edit_time has passed
+ * @var bool force_softdelete_allowed Allow the user to ыoftdelete the post (all permissions and conditions are ignored)
+ * @since 3.1.0-b4
+ * @changed 3.1.11-RC1 Added force_softdelete_allowed var
+ */
+ $vars = array(
+ 'row',
+ 'topic_data',
+ 'force_edit_allowed',
+ 's_cannot_edit',
+ 's_cannot_edit_locked',
+ 's_cannot_edit_time',
+ 'force_delete_allowed',
+ 's_cannot_delete',
+ 's_cannot_delete_lastpost',
+ 's_cannot_delete_locked',
+ 's_cannot_delete_time',
+ 'force_softdelete_allowed',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.viewtopic_modify_post_action_conditions', compact($vars)));
+
+ $edit_allowed = $force_edit_allowed || ($user->data['is_registered'] && ($auth->acl_get('m_edit', $forum_id) || (
+ !$s_cannot_edit &&
+ !$s_cannot_edit_time &&
+ !$s_cannot_edit_locked
)));
$quote_allowed = $auth->acl_get('m_edit', $forum_id) || ($topic_data['topic_status'] != ITEM_LOCKED &&
($user->data['user_id'] == ANONYMOUS || $auth->acl_get('f_reply', $forum_id))
);
- $delete_allowed = ($user->data['is_registered'] && ($auth->acl_get('m_delete', $forum_id) || (
- $user->data['user_id'] == $poster_id &&
- $auth->acl_get('f_delete', $forum_id) &&
- $topic_data['topic_status'] != ITEM_LOCKED &&
- $topic_data['topic_last_post_id'] == $row['post_id'] &&
- ($row['post_time'] > time() - ($config['delete_time'] * 60) || !$config['delete_time']) &&
- // we do not want to allow removal of the last post if a moderator locked it!
- !$row['post_edit_locked']
- )));
+ // Only display the quote button if the post is quotable. Posts not approved are not quotable.
+ $quote_allowed = ($quote_allowed && $row['post_visibility'] == ITEM_APPROVED) ? true : false;
+
+ $delete_allowed = $force_delete_allowed || ($user->data['is_registered'] && (
+ ($auth->acl_get('m_delete', $forum_id) || ($auth->acl_get('m_softdelete', $forum_id) && $row['post_visibility'] != ITEM_DELETED)) ||
+ (!$s_cannot_delete && !$s_cannot_delete_lastpost && !$s_cannot_delete_time && !$s_cannot_delete_locked)
+ ));
+
+ $softdelete_allowed = $force_softdelete_allowed || (($auth->acl_get('m_softdelete', $forum_id) ||
+ ($auth->acl_get('f_softdelete', $forum_id) && $user->data['user_id'] == $poster_id)) && ($row['post_visibility'] != ITEM_DELETED));
+
+ $permanent_delete_allowed = $force_delete_allowed || ($auth->acl_get('m_delete', $forum_id) ||
+ ($auth->acl_get('f_delete', $forum_id) && $user->data['user_id'] == $poster_id));
+
+ // Can this user receive a Private Message?
+ $can_receive_pm = (
+ // They must be a "normal" user
+ $user_cache[$poster_id]['user_type'] != USER_IGNORE &&
+
+ // They must not be deactivated by the administrator
+ ($user_cache[$poster_id]['user_type'] != USER_INACTIVE || $user_cache[$poster_id]['user_inactive_reason'] != INACTIVE_MANUAL) &&
+
+ // They must be able to read PMs
+ in_array($poster_id, $can_receive_pm_list) &&
+
+ // They must not be permanently banned
+ !in_array($poster_id, $permanently_banned_users) &&
+
+ // They must allow users to contact via PM
+ (($auth->acl_gets('a_', 'm_') || $auth->acl_getf_global('m_')) || $user_cache[$poster_id]['allow_pm'])
+ );
+
+ $u_pm = '';
+
+ if ($config['allow_privmsg'] && $auth->acl_get('u_sendpm') && $can_receive_pm)
+ {
+ $u_pm = append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&amp;mode=compose&amp;action=quotepost&amp;p=' . $row['post_id']);
+ }
//
- $postrow = array(
+ $post_row = array(
'POST_AUTHOR_FULL' => ($poster_id != ANONYMOUS) ? $user_cache[$poster_id]['author_full'] : get_username_string('full', $poster_id, $row['username'], $row['user_colour'], $row['post_username']),
'POST_AUTHOR_COLOUR' => ($poster_id != ANONYMOUS) ? $user_cache[$poster_id]['author_colour'] : get_username_string('colour', $poster_id, $row['username'], $row['user_colour'], $row['post_username']),
'POST_AUTHOR' => ($poster_id != ANONYMOUS) ? $user_cache[$poster_id]['author_username'] : get_username_string('username', $poster_id, $row['username'], $row['user_colour'], $row['post_username']),
@@ -1534,10 +1923,10 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i)
'RANK_IMG_SRC' => $user_cache[$poster_id]['rank_image_src'],
'POSTER_JOINED' => $user_cache[$poster_id]['joined'],
'POSTER_POSTS' => $user_cache[$poster_id]['posts'],
- 'POSTER_FROM' => $user_cache[$poster_id]['from'],
'POSTER_AVATAR' => $user_cache[$poster_id]['avatar'],
- 'POSTER_WARNINGS' => $user_cache[$poster_id]['warnings'],
+ 'POSTER_WARNINGS' => $auth->acl_get('m_warn') ? $user_cache[$poster_id]['warnings'] : '',
'POSTER_AGE' => $user_cache[$poster_id]['age'],
+ 'CONTACT_USER' => $user_cache[$poster_id]['contact_user'],
'POST_DATE' => $user->format_date($row['post_time'], false, ($view == 'print') ? true : false),
'POST_SUBJECT' => $row['post_subject'],
@@ -1545,36 +1934,33 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i)
'SIGNATURE' => ($row['enable_sig']) ? $user_cache[$poster_id]['sig'] : '',
'EDITED_MESSAGE' => $l_edited_by,
'EDIT_REASON' => $row['post_edit_reason'],
+ 'DELETED_MESSAGE' => $l_deleted_by,
+ 'DELETE_REASON' => $row['post_delete_reason'],
'BUMPED_MESSAGE' => $l_bumped_by,
'MINI_POST_IMG' => ($post_unread) ? $user->img('icon_post_target_unread', 'UNREAD_POST') : $user->img('icon_post_target', 'POST'),
'POST_ICON_IMG' => ($topic_data['enable_icons'] && !empty($row['icon_id'])) ? $icons[$row['icon_id']]['img'] : '',
'POST_ICON_IMG_WIDTH' => ($topic_data['enable_icons'] && !empty($row['icon_id'])) ? $icons[$row['icon_id']]['width'] : '',
'POST_ICON_IMG_HEIGHT' => ($topic_data['enable_icons'] && !empty($row['icon_id'])) ? $icons[$row['icon_id']]['height'] : '',
- 'ICQ_STATUS_IMG' => $user_cache[$poster_id]['icq_status_img'],
'ONLINE_IMG' => ($poster_id == ANONYMOUS || !$config['load_onlinetrack']) ? '' : (($user_cache[$poster_id]['online']) ? $user->img('icon_user_online', 'ONLINE') : $user->img('icon_user_offline', 'OFFLINE')),
'S_ONLINE' => ($poster_id == ANONYMOUS || !$config['load_onlinetrack']) ? false : (($user_cache[$poster_id]['online']) ? true : false),
'U_EDIT' => ($edit_allowed) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=edit&amp;f=$forum_id&amp;p={$row['post_id']}") : '',
'U_QUOTE' => ($quote_allowed) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=quote&amp;f=$forum_id&amp;p={$row['post_id']}") : '',
'U_INFO' => ($auth->acl_get('m_info', $forum_id)) ? append_sid("{$phpbb_root_path}mcp.$phpEx", "i=main&amp;mode=post_details&amp;f=$forum_id&amp;p=" . $row['post_id'], true, $user->session_id) : '',
- 'U_DELETE' => ($delete_allowed) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=delete&amp;f=$forum_id&amp;p={$row['post_id']}") : '',
+ 'U_DELETE' => ($delete_allowed) ? append_sid("{$phpbb_root_path}posting.$phpEx", 'mode=' . (($softdelete_allowed) ? 'soft_delete' : 'delete') . "&amp;f=$forum_id&amp;p={$row['post_id']}") : '',
- 'U_PROFILE' => $user_cache[$poster_id]['profile'],
'U_SEARCH' => $user_cache[$poster_id]['search'],
- 'U_PM' => ($poster_id != ANONYMOUS && $config['allow_privmsg'] && $auth->acl_get('u_sendpm') && ($user_cache[$poster_id]['allow_pm'] || $auth->acl_gets('a_', 'm_') || $auth->acl_getf_global('m_'))) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&amp;mode=compose&amp;action=quotepost&amp;p=' . $row['post_id']) : '',
+ 'U_PM' => $u_pm,
'U_EMAIL' => $user_cache[$poster_id]['email'],
- 'U_WWW' => $user_cache[$poster_id]['www'],
- 'U_ICQ' => $user_cache[$poster_id]['icq'],
- 'U_AIM' => $user_cache[$poster_id]['aim'],
- 'U_MSN' => $user_cache[$poster_id]['msn'],
- 'U_YIM' => $user_cache[$poster_id]['yim'],
'U_JABBER' => $user_cache[$poster_id]['jabber'],
+ 'U_APPROVE_ACTION' => append_sid("{$phpbb_root_path}mcp.$phpEx", "i=queue&amp;p={$row['post_id']}&amp;f=$forum_id&amp;redirect=" . urlencode(str_replace('&amp;', '&', $viewtopic_url . '&amp;p=' . $row['post_id'] . '#p' . $row['post_id']))),
'U_REPORT' => ($auth->acl_get('f_report', $forum_id)) ? append_sid("{$phpbb_root_path}report.$phpEx", 'f=' . $forum_id . '&amp;p=' . $row['post_id']) : '',
'U_MCP_REPORT' => ($auth->acl_get('m_report', $forum_id)) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=reports&amp;mode=report_details&amp;f=' . $forum_id . '&amp;p=' . $row['post_id'], true, $user->session_id) : '',
'U_MCP_APPROVE' => ($auth->acl_get('m_approve', $forum_id)) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue&amp;mode=approve_details&amp;f=' . $forum_id . '&amp;p=' . $row['post_id'], true, $user->session_id) : '',
- 'U_MINI_POST' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'p=' . $row['post_id']) . (($topic_data['topic_type'] == POST_GLOBAL) ? '&amp;f=' . $forum_id : '') . '#p' . $row['post_id'],
+ 'U_MCP_RESTORE' => ($auth->acl_get('m_approve', $forum_id)) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue&amp;mode=' . (($topic_data['topic_visibility'] != ITEM_DELETED) ? 'deleted_posts' : 'deleted_topics') . '&amp;f=' . $forum_id . '&amp;p=' . $row['post_id'], true, $user->session_id) : '',
+ 'U_MINI_POST' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'p=' . $row['post_id']) . '#p' . $row['post_id'],
'U_NEXT_POST_ID' => ($i < $i_total && isset($rowset[$post_list[$i + 1]])) ? $rowset[$post_list[$i + 1]]['post_id'] : '',
'U_PREV_POST_ID' => $prev_post_id,
'U_NOTES' => ($auth->acl_getf_global('m_')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&amp;mode=user_notes&amp;u=' . $poster_id, true, $user->session_id) : '',
@@ -1585,7 +1971,10 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i)
'POSTER_ID' => $poster_id,
'S_HAS_ATTACHMENTS' => (!empty($attachments[$row['post_id']])) ? true : false,
- 'S_POST_UNAPPROVED' => ($row['post_approved']) ? false : true,
+ 'S_MULTIPLE_ATTACHMENTS' => !empty($attachments[$row['post_id']]) && sizeof($attachments[$row['post_id']]) > 1,
+ 'S_POST_UNAPPROVED' => ($row['post_visibility'] == ITEM_UNAPPROVED || $row['post_visibility'] == ITEM_REAPPROVE) ? true : false,
+ 'S_POST_DELETED' => ($row['post_visibility'] == ITEM_DELETED) ? true : false,
+ 'L_POST_DELETED_MESSAGE' => $l_deleted_message,
'S_POST_REPORTED' => ($row['post_reported'] && $auth->acl_get('m_report', $forum_id)) ? true : false,
'S_DISPLAY_NOTICE' => $display_notice && $row['post_attachment'],
'S_FRIEND' => ($row['friend']) ? true : false,
@@ -1594,23 +1983,102 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i)
'S_CUSTOM_FIELDS' => (isset($cp_row['row']) && sizeof($cp_row['row'])) ? true : false,
'S_TOPIC_POSTER' => ($topic_data['topic_poster'] == $poster_id) ? true : false,
- 'S_IGNORE_POST' => ($row['hide_post']) ? true : false,
- 'L_IGNORE_POST' => ($row['hide_post']) ? sprintf($user->lang['POST_BY_FOE'], get_username_string('full', $poster_id, $row['username'], $row['user_colour'], $row['post_username']), '<a href="' . $viewtopic_url . "&amp;p={$row['post_id']}&amp;view=show#p{$row['post_id']}" . '">', '</a>') : '',
+ 'S_IGNORE_POST' => ($row['foe']) ? true : false,
+ 'L_IGNORE_POST' => ($row['foe']) ? sprintf($user->lang['POST_BY_FOE'], get_username_string('full', $poster_id, $row['username'], $row['user_colour'], $row['post_username'])) : '',
+ 'S_POST_HIDDEN' => $row['hide_post'],
+ 'L_POST_DISPLAY' => ($row['hide_post']) ? $user->lang('POST_DISPLAY', '<a class="display_post" data-post-id="' . $row['post_id'] . '" href="' . $viewtopic_url . "&amp;p={$row['post_id']}&amp;view=show#p{$row['post_id']}" . '">', '</a>') : '',
+ 'S_DELETE_PERMANENT' => $permanent_delete_allowed,
);
+ $user_poster_data = $user_cache[$poster_id];
+
+ $current_row_number = $i;
+
+ /**
+ * Modify the posts template block
+ *
+ * @event core.viewtopic_modify_post_row
+ * @var int start Start item of this page
+ * @var int current_row_number Number of the post on this page
+ * @var int end Number of posts on this page
+ * @var int total_posts Total posts count
+ * @var int poster_id Post author id
+ * @var array row Array with original post and user data
+ * @var array cp_row Custom profile field data of the poster
+ * @var array attachments List of attachments
+ * @var array user_poster_data Poster's data from user cache
+ * @var array post_row Template block array of the post
+ * @var array topic_data Array with topic data
+ * @since 3.1.0-a1
+ * @changed 3.1.0-a3 Added vars start, current_row_number, end, attachments
+ * @changed 3.1.0-b3 Added topic_data array, total_posts
+ * @changed 3.1.0-RC3 Added poster_id
+ */
+ $vars = array(
+ 'start',
+ 'current_row_number',
+ 'end',
+ 'total_posts',
+ 'poster_id',
+ 'row',
+ 'cp_row',
+ 'attachments',
+ 'user_poster_data',
+ 'post_row',
+ 'topic_data',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.viewtopic_modify_post_row', compact($vars)));
+
+ $i = $current_row_number;
+
if (isset($cp_row['row']) && sizeof($cp_row['row']))
{
- $postrow = array_merge($postrow, $cp_row['row']);
+ $post_row = array_merge($post_row, $cp_row['row']);
}
// Dump vars into template
- $template->assign_block_vars('postrow', $postrow);
+ $template->assign_block_vars('postrow', $post_row);
+
+ $contact_fields = array(
+ array(
+ 'ID' => 'pm',
+ 'NAME' => $user->lang['SEND_PRIVATE_MESSAGE'],
+ 'U_CONTACT' => $u_pm,
+ ),
+ array(
+ 'ID' => 'email',
+ 'NAME' => $user->lang['SEND_EMAIL'],
+ 'U_CONTACT' => $user_cache[$poster_id]['email'],
+ ),
+ array(
+ 'ID' => 'jabber',
+ 'NAME' => $user->lang['JABBER'],
+ 'U_CONTACT' => $user_cache[$poster_id]['jabber'],
+ ),
+ );
+
+ foreach ($contact_fields as $field)
+ {
+ if ($field['U_CONTACT'])
+ {
+ $template->assign_block_vars('postrow.contact', $field);
+ }
+ }
if (!empty($cp_row['blockrow']))
{
foreach ($cp_row['blockrow'] as $field_data)
{
$template->assign_block_vars('postrow.custom_fields', $field_data);
+
+ if ($field_data['S_PROFILE_CONTACT'])
+ {
+ $template->assign_block_vars('postrow.contact', array(
+ 'ID' => $field_data['PROFILE_FIELD_IDENT'],
+ 'NAME' => $field_data['PROFILE_FIELD_NAME'],
+ 'U_CONTACT' => $field_data['PROFILE_FIELD_CONTACT'],
+ ));
+ }
}
}
@@ -1625,6 +2093,41 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i)
}
}
+ $current_row_number = $i;
+
+ /**
+ * Event after the post data has been assigned to the template
+ *
+ * @event core.viewtopic_post_row_after
+ * @var int start Start item of this page
+ * @var int current_row_number Number of the post on this page
+ * @var int end Number of posts on this page
+ * @var int total_posts Total posts count
+ * @var array row Array with original post and user data
+ * @var array cp_row Custom profile field data of the poster
+ * @var array attachments List of attachments
+ * @var array user_poster_data Poster's data from user cache
+ * @var array post_row Template block array of the post
+ * @var array topic_data Array with topic data
+ * @since 3.1.0-a3
+ * @changed 3.1.0-b3 Added topic_data array, total_posts
+ */
+ $vars = array(
+ 'start',
+ 'current_row_number',
+ 'end',
+ 'total_posts',
+ 'row',
+ 'cp_row',
+ 'attachments',
+ 'user_poster_data',
+ 'post_row',
+ 'topic_data',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.viewtopic_post_row_after', compact($vars)));
+
+ $i = $current_row_number;
+
$prev_post_id = $row['post_id'];
unset($rowset[$post_list[$i]]);
@@ -1650,41 +2153,21 @@ if (isset($user->data['session_page']) && !$user->data['is_bot'] && (strpos($use
}
}
-// Get last post time for all global announcements
-// to keep proper forums tracking
-if ($topic_data['topic_type'] == POST_GLOBAL)
-{
- $sql = 'SELECT topic_last_post_time as forum_last_post_time
- FROM ' . TOPICS_TABLE . '
- WHERE forum_id = 0
- ORDER BY topic_last_post_time DESC';
- $result = $db->sql_query_limit($sql, 1);
- $topic_data['forum_last_post_time'] = (int) $db->sql_fetchfield('forum_last_post_time');
- $db->sql_freeresult($result);
-
- $sql = 'SELECT mark_time as forum_mark_time
- FROM ' . FORUMS_TRACK_TABLE . '
- WHERE forum_id = 0
- AND user_id = ' . $user->data['user_id'];
- $result = $db->sql_query($sql);
- $topic_data['forum_mark_time'] = (int) $db->sql_fetchfield('forum_mark_time');
- $db->sql_freeresult($result);
-}
-
// Only mark topic if it's currently unread. Also make sure we do not set topic tracking back if earlier pages are viewed.
if (isset($topic_tracking_info[$topic_id]) && $topic_data['topic_last_post_time'] > $topic_tracking_info[$topic_id] && $max_post_time > $topic_tracking_info[$topic_id])
{
- markread('topic', (($topic_data['topic_type'] == POST_GLOBAL) ? 0 : $forum_id), $topic_id, $max_post_time);
+ markread('topic', $forum_id, $topic_id, $max_post_time);
// Update forum info
- $all_marked_read = update_forum_tracking_info((($topic_data['topic_type'] == POST_GLOBAL) ? 0 : $forum_id), $topic_data['forum_last_post_time'], (isset($topic_data['forum_mark_time'])) ? $topic_data['forum_mark_time'] : false, false);
+ $all_marked_read = update_forum_tracking_info($forum_id, $topic_data['forum_last_post_time'], (isset($topic_data['forum_mark_time'])) ? $topic_data['forum_mark_time'] : false, false);
}
else
{
$all_marked_read = true;
}
-// If there are absolutely no more unread posts in this forum and unread posts shown, we can savely show the #unread link
+// If there are absolutely no more unread posts in this forum
+// and unread posts shown, we can safely show the #unread link
if ($all_marked_read)
{
if ($post_unread)
@@ -1767,19 +2250,36 @@ if ($s_can_vote || $s_quick_reply)
// We overwrite $_REQUEST['f'] if there is no forum specified
// to be able to display the correct online list.
// One downside is that the user currently viewing this topic/post is not taken into account.
-if (empty($_REQUEST['f']))
+if (!request_var('f', 0))
{
- $_REQUEST['f'] = $forum_id;
+ $request->overwrite('f', $forum_id);
}
// We need to do the same with the topic_id. See #53025.
-if (empty($_REQUEST['t']) && !empty($topic_id))
+if (!request_var('t', 0) && !empty($topic_id))
{
- $_REQUEST['t'] = $topic_id;
+ $request->overwrite('t', $topic_id);
}
+$page_title = $topic_data['topic_title'] . ($start ? ' - ' . sprintf($user->lang['PAGE_TITLE_NUMBER'], $pagination->get_on_page($config['posts_per_page'], $start)) : '');
+
+/**
+* You can use this event to modify the page title of the viewtopic page
+*
+* @event core.viewtopic_modify_page_title
+* @var string page_title Title of the viewtopic page
+* @var array topic_data Array with topic data
+* @var int forum_id Forum ID of the topic
+* @var int start Start offset used to calculate the page
+* @var array post_list Array with post_ids we are going to display
+* @since 3.1.0-a1
+* @changed 3.1.0-RC4 Added post_list var
+*/
+$vars = array('page_title', 'topic_data', 'forum_id', 'start', 'post_list');
+extract($phpbb_dispatcher->trigger_event('core.viewtopic_modify_page_title', compact($vars)));
+
// Output the page
-page_header($user->lang['VIEW_TOPIC'] . ' - ' . $topic_data['topic_title'], true, $forum_id);
+page_header($page_title, true, $forum_id);
$template->set_filenames(array(
'body' => ($view == 'print') ? 'viewtopic_print.html' : 'viewtopic_body.html')
@@ -1787,5 +2287,3 @@ $template->set_filenames(array(
make_jumpbox(append_sid("{$phpbb_root_path}viewforum.$phpEx"), $forum_id);
page_footer();
-
-?> \ No newline at end of file
diff --git a/phpBB/web.config b/phpBB/web.config
index a73c328626..d0a3cb33fe 100644
--- a/phpBB/web.config
+++ b/phpBB/web.config
@@ -1,12 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
+ <rewrite>
+ <rules>
+ <rule name="Extension Routes" stopProcessing="true">
+ <match url="^(.*)$" ignoreCase="true" />
+ <conditions>
+ <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
+ <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
+ </conditions>
+ <action type="Rewrite" url="app.php" appendQueryString="true" />
+ </rule>
+ </rules>
+ </rewrite>
<security>
<requestFiltering>
<hiddenSegments>
<add segment="cache" />
<add segment="files" />
+ <add segment="includes" />
+ <add segment="phpbb" />
<add segment="store" />
+ <add segment="vendor" />
<add segment="config.php" />
<add segment="common.php" />
</hiddenSegments>
diff --git a/phpunit.xml.dist b/phpunit.xml.dist
index bfd2ca1977..c6e539b7ba 100644
--- a/phpunit.xml.dist
+++ b/phpunit.xml.dist
@@ -16,13 +16,18 @@
<directory suffix="_test.php">./tests</directory>
<exclude>./tests/functional</exclude>
<exclude>./tests/lint_test.php</exclude>
+ <exclude>./tests/ui</exclude>
</testsuite>
<testsuite name="phpBB Functional Tests">
- <directory suffix="_test.php" phpVersion="5.3.0" phpVersionOperator=">=">./tests/functional</directory>
+ <directory suffix="_test.php">./tests/functional</directory>
</testsuite>
<testsuite name="phpBB Lint Test">
<file>./tests/lint_test.php</file>
</testsuite>
+ <testsuite name="phpBB UI Tests">
+ <directory suffix="_test.php" phpVersion="5.3.19"
+ phpVersionOperator=">=">./tests/ui</directory>
+ </testsuite>
</testsuites>
<groups>
@@ -34,6 +39,7 @@
<filter>
<whitelist>
<directory suffix=".php">./phpBB/includes/</directory>
+ <directory suffix=".php">./phpBB/phpbb/</directory>
</whitelist>
</filter>
</phpunit>
diff --git a/tests/RUNNING_TESTS.md b/tests/RUNNING_TESTS.md
index d9306d78d7..afd7caa709 100644
--- a/tests/RUNNING_TESTS.md
+++ b/tests/RUNNING_TESTS.md
@@ -24,6 +24,7 @@ the following PHP extensions must be installed and enabled to run unit tests:
- ctype (also a PHPUnit dependency)
- dom (PHPUnit dependency)
+- json (also a phpBB dependency)
Some of the functionality in phpBB and/or the test suite uses additional
PHP extensions. If these extensions are not loaded, respective tests
@@ -31,11 +32,12 @@ will be skipped:
- apc (APC cache driver)
- bz2 (compress tests)
-- interbase, pdo_firebird (Firebird database driver)
- mysql, pdo_mysql (MySQL database driver)
- mysqli, pdo_mysql (MySQLi database driver)
+- pcntl (flock class)
- pdo (any database tests)
- pgsql, pdo_pgsql (PostgreSQL database driver)
+- redis (https://github.com/nicolasff/phpredis, Redis cache driver)
- simplexml (any database tests)
- sqlite, pdo_sqlite (SQLite database driver, requires SQLite 2.x support
in pdo_sqlite)
@@ -54,7 +56,7 @@ found below. More information on configuration options can be found on the
wiki (see below).
<?php
- $dbms = 'mysqli';
+ $dbms = 'phpbb\db\driver\mysqli';
$dbhost = 'localhost';
$dbport = '';
$dbname = 'database';
@@ -79,16 +81,10 @@ Special Database Cases
----------------------
In order to run tests on some of the databases that we support, it will be
necessary to provide a custom DSN string in test_config.php. This is only
-needed for MSSQL 2000+ (PHP module), MSSQL via ODBC, and Firebird when
-PDO_Firebird does not work on your system
-(https://bugs.php.net/bug.php?id=61183). The variable must be named `$custom_dsn`.
+needed for MSSQL 2000+ (PHP module) and MSSQL via ODBC. The variable must be
+named `$custom_dsn`.
-Examples:
-Firebird using http://www.firebirdsql.org/en/odbc-driver/
-
- $custom_dsn = "Driver={Firebird/InterBase(r) driver};dbname=$dbhost:$dbname";
-
-MSSQL
+Example MSSQL:
$custom_dsn = "Driver={SQL Server Native Client 10.0};Server=$dbhost;Database=$dbname";
@@ -98,6 +94,21 @@ to connect to that database in phpBB.
Additionally, you will need to be running the DbUnit fork from
https://github.com/phpbb/dbunit/tree/phpbb.
+Redis
+-----
+
+In order to run tests for the Redis cache driver, at least one of Redis host
+or port must be specified in test configuration. This can be done via
+test_config.php as follows:
+
+ <?php
+ $phpbb_redis_host = 'localhost';
+ $phpbb_redis_port = 6379;
+
+Or via environment variables as follows:
+
+ $ PHPBB_TEST_REDIS_HOST=localhost PHPBB_TEST_REDIS_PORT=6379 phpunit
+
Running
=======
diff --git a/tests/acp_board/auth_provider/invalid.php b/tests/acp_board/auth_provider/invalid.php
new file mode 100644
index 0000000000..dbd1d159a4
--- /dev/null
+++ b/tests/acp_board/auth_provider/invalid.php
@@ -0,0 +1,19 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\auth\provider\acp;
+
+class board_invalid
+{
+
+}
diff --git a/tests/acp_board/auth_provider/valid.php b/tests/acp_board/auth_provider/valid.php
new file mode 100644
index 0000000000..6477bf4b53
--- /dev/null
+++ b/tests/acp_board/auth_provider/valid.php
@@ -0,0 +1,22 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\auth\provider\acp;
+
+class board_valid extends \phpbb\auth\provider\base
+{
+ public function login($username, $password)
+ {
+ return;
+ }
+}
diff --git a/tests/acp_board/select_auth_method_test.php b/tests/acp_board/select_auth_method_test.php
new file mode 100644
index 0000000000..16e5954c64
--- /dev/null
+++ b/tests/acp_board/select_auth_method_test.php
@@ -0,0 +1,52 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+require_once dirname(__FILE__) . '/../../phpBB/includes/acp/acp_board.php';
+require_once dirname(__FILE__) . '/auth_provider/invalid.php';
+require_once dirname(__FILE__) . '/auth_provider/valid.php';
+
+class phpbb_acp_board_select_auth_method_test extends phpbb_test_case
+{
+ protected $acp_board;
+
+ public static function select_auth_method_data()
+ {
+ return array(
+ array('acp_board_valid', '<option value="acp_board_valid" selected="selected" data-toggle-setting="#auth_acp_board_valid_settings">Acp_board_valid</option>'),
+ array('acp_board_invalid', '<option value="acp_board_valid" data-toggle-setting="#auth_acp_board_valid_settings">Acp_board_valid</option>'),
+ );
+ }
+
+ public function setUp()
+ {
+ parent::setUp();
+
+ global $phpbb_container;
+ $phpbb_container = new phpbb_mock_container_builder();
+
+ $phpbb_container->set('auth.provider_collection', array(
+ 'auth.provider.acp_board_valid' => new phpbb\auth\provider\acp\board_valid,
+ 'auth.provider.acp_board_invalid' => new phpbb\auth\provider\acp\board_invalid,
+ ));
+
+ $this->acp_board = new acp_board();
+ }
+
+ /**
+ * @dataProvider select_auth_method_data
+ */
+ public function test_select_auth_method($selected, $expected)
+ {
+ $this->assertEquals($expected, $this->acp_board->select_auth_method($selected));
+ }
+}
diff --git a/tests/auth/fixtures/oauth_tokens.xml b/tests/auth/fixtures/oauth_tokens.xml
new file mode 100644
index 0000000000..6c82e94e62
--- /dev/null
+++ b/tests/auth/fixtures/oauth_tokens.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<dataset>
+ <table name="phpbb_oauth_tokens">
+ <column>user_id</column>
+ <column>session_id</column>
+ <column>provider</column>
+ <column>oauth_token</column>
+ <row>
+ <value>1</value>
+ <value>abcd</value>
+ <value>auth.provider.oauth.service.testing</value>
+ <value>{"token_class":"phpbb_not_a_token","accessToken":"error","refreshToken":0,"endOfLife":null,"extraParams":null}</value>
+ </row>
+ </table>
+</dataset>
+
diff --git a/tests/auth/fixtures/user.xml b/tests/auth/fixtures/user.xml
new file mode 100644
index 0000000000..1e0eb6ee49
--- /dev/null
+++ b/tests/auth/fixtures/user.xml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<dataset>
+ <table name="phpbb_users">
+ <column>user_id</column>
+ <column>username</column>
+ <column>username_clean</column>
+ <column>user_password</column>
+ <column>user_passchg</column>
+ <column>user_email</column>
+ <column>user_type</column>
+ <column>user_login_attempts</column>
+ <column>user_permissions</column>
+ <column>user_sig</column>
+ <row>
+ <value>1</value>
+ <value>foobar</value>
+ <value>foobar</value>
+ <value>$2y$10$4RmpyVu2y8Yf/lP3.yQBquKvE54TCUuEDEBJYY6FDDFN3LcbCGz9i</value>
+ <value>0</value>
+ <value>example@example.com</value>
+ <value>0</value>
+ <value>0</value>
+ <value></value>
+ <value></value>
+ </row>
+ <row>
+ <value>2</value>
+ <value>foobar2</value>
+ <value>foobar2</value>
+ <value>$H$9E45lK6J8nLTSm9oJE5aNCSTFK9wqa/</value>
+ <value>0</value>
+ <value>example@example.com</value>
+ <value>0</value>
+ <value>0</value>
+ <value></value>
+ <value></value>
+ </row>
+ </table>
+</dataset>
diff --git a/tests/auth/fixtures/user_533.xml b/tests/auth/fixtures/user_533.xml
new file mode 100644
index 0000000000..9731e4db4a
--- /dev/null
+++ b/tests/auth/fixtures/user_533.xml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<dataset>
+ <table name="phpbb_users">
+ <column>user_id</column>
+ <column>username</column>
+ <column>username_clean</column>
+ <column>user_password</column>
+ <column>user_passchg</column>
+ <column>user_email</column>
+ <column>user_type</column>
+ <column>user_login_attempts</column>
+ <column>user_permissions</column>
+ <column>user_sig</column>
+ <row>
+ <value>1</value>
+ <value>foobar</value>
+ <value>foobar</value>
+ <value>$2a$10$e01Syh9PbJjUkio66eFuUu4FhCE2nRgG7QPc1JACalsPXcIuG2bbi</value>
+ <value>0</value>
+ <value>example@example.com</value>
+ <value>0</value>
+ <value>0</value>
+ <value></value>
+ <value></value>
+ </row>
+ <row>
+ <value>2</value>
+ <value>foobar2</value>
+ <value>foobar2</value>
+ <value>$H$9E45lK6J8nLTSm9oJE5aNCSTFK9wqa/</value>
+ <value>0</value>
+ <value>example@example.com</value>
+ <value>0</value>
+ <value>0</value>
+ <value></value>
+ <value></value>
+ </row>
+ </table>
+</dataset>
diff --git a/tests/auth/phpbb_not_a_token.php b/tests/auth/phpbb_not_a_token.php
new file mode 100644
index 0000000000..61cc14fa10
--- /dev/null
+++ b/tests/auth/phpbb_not_a_token.php
@@ -0,0 +1,23 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+class phpbb_not_a_token
+{
+ public function __construct($param1, $param2, $param3, $param4)
+ {
+ }
+
+ public function setEndOfLife()
+ {
+ }
+}
diff --git a/tests/auth/provider_apache_test.php b/tests/auth/provider_apache_test.php
new file mode 100644
index 0000000000..68ad7b2c19
--- /dev/null
+++ b/tests/auth/provider_apache_test.php
@@ -0,0 +1,229 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
+require_once dirname(__FILE__) . '/../../phpBB/includes/utf/utf_tools.php';
+
+class phpbb_auth_provider_apache_test extends phpbb_database_test_case
+{
+ protected $provider;
+ protected $user;
+ protected $request;
+
+ protected function setup()
+ {
+ parent::setUp();
+
+ global $phpbb_root_path, $phpEx;
+
+ $db = $this->new_dbal();
+ $config = new \phpbb\config\config(array());
+ $this->request = $this->getMock('\phpbb\request\request');
+ $this->user = new \phpbb\user('\phpbb\datetime');
+ $driver_helper = new \phpbb\passwords\driver\helper($config);
+ $passwords_drivers = array(
+ 'passwords.driver.bcrypt_2y' => new \phpbb\passwords\driver\bcrypt_2y($config, $driver_helper),
+ 'passwords.driver.bcrypt' => new \phpbb\passwords\driver\bcrypt($config, $driver_helper),
+ 'passwords.driver.salted_md5' => new \phpbb\passwords\driver\salted_md5($config, $driver_helper),
+ 'passwords.driver.phpass' => new \phpbb\passwords\driver\phpass($config, $driver_helper),
+ );
+
+ $passwords_helper = new \phpbb\passwords\helper;
+ // Set up passwords manager
+ $passwords_manager = new \phpbb\passwords\manager($config, $passwords_drivers, $passwords_helper, array_keys($passwords_drivers));
+
+ if (version_compare(PHP_VERSION, '5.3.7', '<'))
+ {
+ $this->password_hash = '$2a$10$e01Syh9PbJjUkio66eFuUu4FhCE2nRgG7QPc1JACalsPXcIuG2bbi';
+ }
+ else
+ {
+ $this->password_hash = '$2y$10$4RmpyVu2y8Yf/lP3.yQBquKvE54TCUuEDEBJYY6FDDFN3LcbCGz9i';
+ }
+
+ $this->provider = new \phpbb\auth\provider\apache($db, $config, $passwords_manager, $this->request, $this->user, $phpbb_root_path, $phpEx);
+ }
+
+ public function getDataSet()
+ {
+ if ((version_compare(PHP_VERSION, '5.3.7', '<')))
+ {
+ return $this->createXMLDataSet(dirname(__FILE__).'/fixtures/user_533.xml');
+ }
+ else
+ {
+ return $this->createXMLDataSet(dirname(__FILE__).'/fixtures/user.xml');
+ }
+ }
+
+ /**
+ * Test to see if a user is identified to Apache. Expects false if they are.
+ */
+ public function test_init()
+ {
+ $this->user->data['username'] = 'foobar';
+ $this->request->expects($this->once())
+ ->method('is_set')
+ ->with('PHP_AUTH_USER',
+ \phpbb\request\request_interface::SERVER)
+ ->will($this->returnValue(true));
+ $this->request->expects($this->once())
+ ->method('server')
+ ->with('PHP_AUTH_USER')
+ ->will($this->returnValue('foobar'));
+
+ $this->assertFalse($this->provider->init());
+ }
+
+ public function test_login()
+ {
+ $username = 'foobar';
+ $password = 'example';
+
+ $this->request->expects($this->once())
+ ->method('is_set')
+ ->with('PHP_AUTH_USER',
+ \phpbb\request\request_interface::SERVER)
+ ->will($this->returnValue(true));
+ $this->request->expects($this->at(1))
+ ->method('server')
+ ->with('PHP_AUTH_USER')
+ ->will($this->returnValue('foobar'));
+ $this->request->expects($this->at(2))
+ ->method('server')
+ ->with('PHP_AUTH_PW')
+ ->will($this->returnValue('example'));
+
+ $expected = array(
+ 'status' => LOGIN_SUCCESS,
+ 'error_msg' => false,
+ 'user_row' => array(
+ 'user_id' => '1',
+ 'username' => 'foobar',
+ 'user_password' => $this->password_hash,
+ 'user_passchg' => '0',
+ 'user_email' => 'example@example.com',
+ 'user_type' => '0',
+ ),
+ );
+
+ $this->assertEquals($expected, $this->provider->login($username, $password));
+ }
+
+ public function test_autologin()
+ {
+ $this->request->expects($this->once())
+ ->method('is_set')
+ ->with('PHP_AUTH_USER',
+ \phpbb\request\request_interface::SERVER)
+ ->will($this->returnValue(true));
+ $this->request->expects($this->at(1))
+ ->method('server')
+ ->with('PHP_AUTH_USER')
+ ->will($this->returnValue('foobar'));
+ $this->request->expects($this->at(2))
+ ->method('server')
+ ->with('PHP_AUTH_PW')
+ ->will($this->returnValue('example'));
+
+ $expected = array(
+ 'user_id' => '1',
+ 'user_type' => '0',
+ 'group_id' => '3',
+ 'user_permissions' => '',
+ 'user_perm_from' => '0',
+ 'user_ip' => '',
+ 'user_regdate' => '0',
+ 'username' => 'foobar',
+ 'username_clean' => 'foobar',
+ 'user_password' => $this->password_hash,
+ 'user_passchg' => '0',
+ 'user_email' => 'example@example.com',
+ 'user_email_hash' => '0',
+ 'user_birthday' => '',
+ 'user_lastvisit' => '0',
+ 'user_lastmark' => '0',
+ 'user_lastpost_time' => '0',
+ 'user_lastpage' => '',
+ 'user_last_confirm_key' => '',
+ 'user_last_search' => '0',
+ 'user_warnings' => '0',
+ 'user_last_warning' => '0',
+ 'user_login_attempts' => '0',
+ 'user_inactive_reason' => '0',
+ 'user_inactive_time' => '0',
+ 'user_posts' => '0',
+ 'user_lang' => '',
+ 'user_timezone' => '',
+ 'user_dateformat' => 'd M Y H:i',
+ 'user_style' => '0',
+ 'user_rank' => '0',
+ 'user_colour' => '',
+ 'user_new_privmsg' => '0',
+ 'user_unread_privmsg' => '0',
+ 'user_last_privmsg' => '0',
+ 'user_message_rules' => '0',
+ 'user_full_folder' => '-3',
+ 'user_emailtime' => '0',
+ 'user_topic_show_days' => '0',
+ 'user_topic_sortby_type' => 't',
+ 'user_topic_sortby_dir' => 'd',
+ 'user_post_show_days' => '0',
+ 'user_post_sortby_type' => 't',
+ 'user_post_sortby_dir' => 'a',
+ 'user_notify' => '0',
+ 'user_notify_pm' => '1',
+ 'user_notify_type' => '0',
+ 'user_allow_pm' => '1',
+ 'user_allow_viewonline' => '1',
+ 'user_allow_viewemail' => '1',
+ 'user_allow_massemail' => '1',
+ 'user_options' => '230271',
+ 'user_avatar' => '',
+ 'user_avatar_type' => '',
+ 'user_avatar_width' => '0',
+ 'user_avatar_height' => '0',
+ 'user_sig' => '',
+ 'user_sig_bbcode_uid' => '',
+ 'user_sig_bbcode_bitfield' => '',
+ 'user_jabber' => '',
+ 'user_actkey' => '',
+ 'user_newpasswd' => '',
+ 'user_form_salt' => '',
+ 'user_new' => '1',
+ 'user_reminded' => '0',
+ 'user_reminded_time' => '0',
+ );
+
+ $this->assertEquals($expected, $this->provider->autologin());
+ }
+
+ public function test_validate_session()
+ {
+ $user = array(
+ 'username' => 'foobar',
+ 'user_type'
+ );
+ $this->request->expects($this->once())
+ ->method('is_set')
+ ->with('PHP_AUTH_USER',
+ \phpbb\request\request_interface::SERVER)
+ ->will($this->returnValue(true));
+ $this->request->expects($this->once())
+ ->method('server')
+ ->with('PHP_AUTH_USER')
+ ->will($this->returnValue('foobar'));
+
+ $this->assertTrue($this->provider->validate_session($user));
+ }
+}
diff --git a/tests/auth/provider_db_test.php b/tests/auth/provider_db_test.php
new file mode 100644
index 0000000000..09ca0816bf
--- /dev/null
+++ b/tests/auth/provider_db_test.php
@@ -0,0 +1,95 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
+require_once dirname(__FILE__) . '/../../phpBB/includes/utf/utf_tools.php';
+
+class phpbb_auth_provider_db_test extends phpbb_database_test_case
+{
+ public function getDataSet()
+ {
+ if ((version_compare(PHP_VERSION, '5.3.7', '<')))
+ {
+ return $this->createXMLDataSet(dirname(__FILE__).'/fixtures/user_533.xml');
+ }
+ else
+ {
+ return $this->createXMLDataSet(dirname(__FILE__).'/fixtures/user.xml');
+ }
+ }
+
+ public function test_login()
+ {
+ global $phpbb_root_path, $phpEx;
+
+ $db = $this->new_dbal();
+ $config = new \phpbb\config\config(array(
+ 'ip_login_limit_max' => 0,
+ 'ip_login_limit_use_forwarded' => 0,
+ 'max_login_attempts' => 0,
+ ));
+ $request = $this->getMock('\phpbb\request\request');
+ $user = new \phpbb\user('\phpbb\datetime');
+ $driver_helper = new \phpbb\passwords\driver\helper($config);
+ $passwords_drivers = array(
+ 'passwords.driver.bcrypt_2y' => new \phpbb\passwords\driver\bcrypt_2y($config, $driver_helper),
+ 'passwords.driver.bcrypt' => new \phpbb\passwords\driver\bcrypt($config, $driver_helper),
+ 'passwords.driver.salted_md5' => new \phpbb\passwords\driver\salted_md5($config, $driver_helper),
+ 'passwords.driver.phpass' => new \phpbb\passwords\driver\phpass($config, $driver_helper),
+ );
+
+ $passwords_helper = new \phpbb\passwords\helper;
+ // Set up passwords manager
+ $passwords_manager = new \phpbb\passwords\manager($config, $passwords_drivers, $passwords_helper, array_keys($passwords_drivers));
+
+ $phpbb_container = new phpbb_mock_container_builder();
+
+ $provider = new \phpbb\auth\provider\db($db, $config, $passwords_manager, $request, $user, $phpbb_container, $phpbb_root_path, $phpEx);
+ if (version_compare(PHP_VERSION, '5.3.7', '<'))
+ {
+ $password_hash = '$2a$10$e01Syh9PbJjUkio66eFuUu4FhCE2nRgG7QPc1JACalsPXcIuG2bbi';
+ }
+ else
+ {
+ $password_hash = '$2y$10$4RmpyVu2y8Yf/lP3.yQBquKvE54TCUuEDEBJYY6FDDFN3LcbCGz9i';
+ }
+
+ $expected = array(
+ 'status' => LOGIN_SUCCESS,
+ 'error_msg' => false,
+ 'user_row' => array(
+ 'user_id' => '1',
+ 'username' => 'foobar',
+ 'user_password' => $password_hash,
+ 'user_passchg' => '0',
+ 'user_email' => 'example@example.com',
+ 'user_type' => '0',
+ 'user_login_attempts' => '0',
+ ),
+ );
+
+ $login_return = $provider->login('foobar', 'example');
+ $this->assertEquals($expected['status'], $login_return['status']);
+ $this->assertEquals($expected['error_msg'], $login_return['error_msg']);
+
+ foreach ($expected['user_row'] as $key => $value)
+ {
+ $this->assertEquals($value, $login_return['user_row'][$key]);
+ }
+
+ // Check if convert works
+ $login_return = $provider->login('foobar2', 'example');
+ $password_start = (version_compare(PHP_VERSION, '5.3.7', '<')) ? '$2a$10$' : '$2y$10$';
+ $this->assertStringStartsWith($password_start, $login_return['user_row']['user_password']);
+ }
+}
diff --git a/tests/auth/provider_oauth_token_storage_test.php b/tests/auth/provider_oauth_token_storage_test.php
new file mode 100644
index 0000000000..71b49ff439
--- /dev/null
+++ b/tests/auth/provider_oauth_token_storage_test.php
@@ -0,0 +1,229 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+use OAuth\OAuth2\Token\StdOAuth2Token;
+
+require_once dirname(__FILE__) . '/phpbb_not_a_token.php';
+
+class phpbb_auth_provider_oauth_token_storage_test extends phpbb_database_test_case
+{
+ protected $db;
+ protected $service_name;
+ protected $session_id;
+ protected $token_storage;
+ protected $token_storage_table;
+ protected $user;
+
+ protected function setup()
+ {
+ parent::setUp();
+
+ global $phpbb_root_path, $phpEx;
+
+ $this->db = $this->new_dbal();
+ $this->user = new \phpbb\user('\phpbb\datetime');
+ $this->service_name = 'auth.provider.oauth.service.testing';
+ $this->token_storage_table = 'phpbb_oauth_tokens';
+
+ // Give the user a session_id that we will remember
+ $this->session_id = '12345';
+ $this->user->data['session_id'] = $this->session_id;
+
+ // Set the user id to anonymous
+ $this->user->data['user_id'] = ANONYMOUS;
+
+ $this->token_storage = new \phpbb\auth\provider\oauth\token_storage($this->db, $this->user, $this->token_storage_table);
+ }
+
+ public function getDataSet()
+ {
+ return $this->createXMLDataSet(dirname(__FILE__).'/fixtures/oauth_tokens.xml');
+ }
+
+ public static function retrieveAccessToken_data()
+ {
+ return array(
+ array(new StdOAuth2Token('access', 'refresh', StdOAuth2Token::EOL_NEVER_EXPIRES, array('extra' => 'param')), null),
+ array(null, 'OAuth\Common\Storage\Exception\TokenNotFoundException'),
+ );
+ }
+
+ /**
+ * @dataProvider retrieveAccessToken_data
+ */
+ public function test_retrieveAccessToken($cache_token, $exception)
+ {
+ if ($cache_token)
+ {
+ $this->token_storage->storeAccessToken($this->service_name, $cache_token);
+ $token = $cache_token;
+ }
+
+ $this->setExpectedException($exception);
+
+ $stored_token = $this->token_storage->retrieveAccessToken($this->service_name);
+ $this->assertEquals($token, $stored_token);
+ }
+
+ public function test_retrieveAccessToken_wrong_token()
+ {
+ $this->user->data['session_id'] = 'abcd';
+ try
+ {
+ $this->token_storage->retrieveAccessToken($this->service_name);
+ $this->fail('The token can not be deserialized and an exception should be thrown.');
+ }
+ catch (\OAuth\Common\Storage\Exception\TokenNotFoundException $e)
+ {
+ }
+
+ $row = $this->get_token_row_by_session_id('abcd');
+ $this->assertFalse($row);
+ }
+
+ public function test_retrieveAccessToken_from_db()
+ {
+ $expected_token = new StdOAuth2Token('access', 'refresh', StdOAuth2Token::EOL_NEVER_EXPIRES);
+
+ // Store a token in the database
+ $temp_storage = new \phpbb\auth\provider\oauth\token_storage($this->db, $this->user, $this->token_storage_table);
+ $temp_storage->storeAccessToken($this->service_name, $expected_token);
+ unset($temp_storage);
+
+ // Test to see if the token can be retrieved
+ $stored_token = $this->token_storage->retrieveAccessToken($this->service_name);
+ $this->assertEquals($expected_token, $stored_token);
+ }
+
+ /**
+ * @dataProvider retrieveAccessToken_data
+ */
+ public function test_retrieve_access_token_by_session($cache_token, $exception)
+ {
+ if ($cache_token)
+ {
+ $this->token_storage->storeAccessToken($this->service_name, $cache_token);
+ $token = $cache_token;
+ }
+
+ $this->setExpectedException($exception);
+
+ $stored_token = $this->token_storage->retrieve_access_token_by_session($this->service_name);
+ $this->assertEquals($token, $stored_token);
+ }
+
+ public function test_retrieve_access_token_by_session_from_db()
+ {
+ $expected_token = new StdOAuth2Token('access', 'refresh', StdOAuth2Token::EOL_NEVER_EXPIRES);
+
+ // Store a token in the database
+ $temp_storage = new \phpbb\auth\provider\oauth\token_storage($this->db, $this->user, $this->token_storage_table);
+ $temp_storage->storeAccessToken($this->service_name, $expected_token);
+ unset($temp_storage);
+
+ // Test to see if the token can be retrieved
+ $stored_token = $this->token_storage->retrieve_access_token_by_session($this->service_name);
+ $this->assertEquals($expected_token, $stored_token);
+ }
+
+ public function test_storeAccessToken()
+ {
+ $token = new StdOAuth2Token('access', 'refresh', StdOAuth2Token::EOL_NEVER_EXPIRES, array('extra' => 'param') );
+ $this->token_storage->storeAccessToken($this->service_name, $token);
+
+ // Confirm that the token is cached
+ $extraParams = $this->token_storage->retrieveAccessToken($this->service_name)->getExtraParams();
+ $this->assertEquals( 'param', $extraParams['extra'] );
+ $this->assertEquals( 'access', $this->token_storage->retrieveAccessToken($this->service_name)->getAccessToken() );
+
+ $row = $this->get_token_row_by_session_id($this->session_id);
+
+ // The token is serialized before stored in the database
+ $this->assertEquals($this->token_storage->json_encode_token($token), $row['oauth_token']);
+ }
+
+ public static function hasAccessToken_data()
+ {
+ return array(
+ array(null, false),
+ array(new StdOAuth2Token('access', 'refresh', StdOAuth2Token::EOL_NEVER_EXPIRES, array('extra' => 'param') ), true),
+ );
+ }
+
+ /**
+ * @dataProvider hasAccessToken_data
+ */
+ public function test_hasAccessToken($token, $expected)
+ {
+ if ($token)
+ {
+ $this->token_storage->storeAccessToken($this->service_name, $token);
+ }
+
+ $has_access_token = $this->token_storage->hasAccessToken($this->service_name);
+ $this->assertEquals($expected, $has_access_token);
+ }
+
+ /**
+ * @dataProvider hasAccessToken_data
+ */
+ public function test_has_access_token_by_session($token, $expected)
+ {
+ if ($token)
+ {
+ $this->token_storage->storeAccessToken($this->service_name, $token);
+ }
+
+ $has_access_token = $this->token_storage->has_access_token_by_session($this->service_name);
+ $this->assertEquals($expected, $has_access_token);
+ }
+
+ public function test_clearToken()
+ {
+ $token = new StdOAuth2Token('access', 'refresh', StdOAuth2Token::EOL_NEVER_EXPIRES, array('extra' => 'param') );
+ $this->token_storage->storeAccessToken($this->service_name, $token);
+
+ $this->token_storage->clearToken($this->service_name);
+
+ // Check that the database has been cleared
+ $row = $this->get_token_row_by_session_id($this->session_id);
+ $this->assertFalse($row);
+
+ // Check that the token is no longer in memory
+ $this->assertFalse($this->token_storage->hasAccessToken($this->service_name));
+ }
+
+ public function test_set_user_id()
+ {
+ $token = new StdOAuth2Token('access', 'refresh', StdOAuth2Token::EOL_NEVER_EXPIRES, array('extra' => 'param') );
+ $this->token_storage->storeAccessToken($this->service_name, $token);
+
+ $new_user_id = ANONYMOUS + 1;
+ $this->token_storage->set_user_id($new_user_id);
+
+ $row = $this->get_token_row_by_session_id($this->session_id);
+ $this->assertEquals($new_user_id, $row['user_id']);
+ }
+
+ protected function get_token_row_by_session_id($session_id)
+ {
+ // Test that the token is stored in the database
+ $sql = 'SELECT * FROM phpbb_oauth_tokens
+ WHERE session_id = \'' . $this->db->sql_escape($session_id) . '\'';
+ $result = $this->db->sql_query($sql);
+ $row = $this->db->sql_fetchrow($result);
+ $this->db->sql_freeresult($result);
+
+ return $row;
+ }
+}
diff --git a/tests/avatar/driver/barfoo.php b/tests/avatar/driver/barfoo.php
new file mode 100644
index 0000000000..0bf30b8a91
--- /dev/null
+++ b/tests/avatar/driver/barfoo.php
@@ -0,0 +1,26 @@
+<?php
+
+namespace phpbb\avatar\driver;
+
+class barfoo extends \phpbb\avatar\driver\driver
+{
+ public function get_data($row)
+ {
+ return array();
+ }
+
+ public function prepare_form($request, $template, $user, $row, &$error)
+ {
+ return false;
+ }
+
+ public function process_form($request, $template, $user, $row, &$error)
+ {
+ return false;
+ }
+
+ public function get_template_name()
+ {
+ return 'barfoo.html';
+ }
+}
diff --git a/tests/avatar/driver/foobar.php b/tests/avatar/driver/foobar.php
new file mode 100644
index 0000000000..aabdaf5ac4
--- /dev/null
+++ b/tests/avatar/driver/foobar.php
@@ -0,0 +1,26 @@
+<?php
+
+namespace phpbb\avatar\driver;
+
+class foobar extends \phpbb\avatar\driver\driver
+{
+ public function get_data($row)
+ {
+ return array();
+ }
+
+ public function prepare_form($request, $template, $user, $row, &$error)
+ {
+ return false;
+ }
+
+ public function process_form($request, $template, $user, $row, &$error)
+ {
+ return false;
+ }
+
+ public function get_template_name()
+ {
+ return 'foobar.html';
+ }
+}
diff --git a/tests/avatar/fixtures/users.xml b/tests/avatar/fixtures/users.xml
new file mode 100644
index 0000000000..1773d438c2
--- /dev/null
+++ b/tests/avatar/fixtures/users.xml
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<dataset>
+ <table name="phpbb_users">
+ <column>user_id</column>
+ <column>username_clean</column>
+ <column>user_permissions</column>
+ <column>user_sig</column>
+ <column>user_avatar</column>
+ <column>user_avatar_type</column>
+ <column>user_avatar_width</column>
+ <column>user_avatar_height</column>
+ <row>
+ <value>1</value>
+ <value>barfoo</value>
+ <value></value>
+ <value></value>
+ <value>foobar@example.com</value>
+ <value>avatar.driver.gravatar</value>
+ <value>80</value>
+ <value>80</value>
+ </row>
+ <row>
+ <value>2</value>
+ <value>foobar</value>
+ <value></value>
+ <value></value>
+ <value></value>
+ <value></value>
+ <value></value>
+ <value></value>
+ </row>
+ <row>
+ <value>3</value>
+ <value>foo</value>
+ <value></value>
+ <value></value>
+ <value>g5_1414350991.jpg</value>
+ <value>avatar.driver.upload</value>
+ <value>80</value>
+ <value>80</value>
+ </row>
+ </table>
+ <table name="phpbb_groups">
+ <column>group_id</column>
+ <column>group_type</column>
+ <column>group_name</column>
+ <column>group_avatar</column>
+ <column>group_avatar_type</column>
+ <column>group_avatar_width</column>
+ <column>group_avatar_height</column>
+ <row>
+ <value>5</value>
+ <value>3</value>
+ <value>ADMINISTRATORS</value>
+ <value>g5_1414350991.jpg</value>
+ <value>avatar.driver.upload</value>
+ <value>80</value>
+ <value>80</value>
+ </row>
+ </table>
+</dataset>
diff --git a/tests/avatar/manager_test.php b/tests/avatar/manager_test.php
new file mode 100644
index 0000000000..802e71939d
--- /dev/null
+++ b/tests/avatar/manager_test.php
@@ -0,0 +1,430 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+require_once dirname(__FILE__) . '/driver/foobar.php';
+
+class phpbb_avatar_manager_test extends \phpbb_database_test_case
+{
+ /** @var \phpbb\avatar\manager */
+ protected $manager;
+ protected $avatar_foobar;
+ protected $avatar_barfoo;
+
+ public function getDataSet()
+ {
+ return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/users.xml');
+ }
+
+ public function setUp()
+ {
+ global $phpbb_root_path, $phpEx;
+
+ // Mock phpbb_container
+ $phpbb_container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface');
+ $phpbb_container->expects($this->any())
+ ->method('get')
+ ->will($this->returnArgument(0));
+
+ // Prepare dependencies for avatar manager and driver
+ $this->config = new \phpbb\config\config(array());
+ $cache = $this->getMock('\phpbb\cache\driver\driver_interface');
+ $path_helper = new \phpbb\path_helper(
+ new \phpbb\symfony_request(
+ new phpbb_mock_request()
+ ),
+ new \phpbb\filesystem(),
+ $this->getMock('\phpbb\request\request'),
+ $phpbb_root_path,
+ $phpEx
+ );
+
+ $guessers = array(
+ new \Symfony\Component\HttpFoundation\File\MimeType\FileinfoMimeTypeGuesser(),
+ new \Symfony\Component\HttpFoundation\File\MimeType\FileBinaryMimeTypeGuesser(),
+ new \phpbb\mimetype\extension_guesser,
+ new \phpbb\mimetype\content_guesser,
+ );
+ $guesser = new \phpbb\mimetype\guesser($guessers);
+
+ $dispatcher = new phpbb_mock_event_dispatcher();
+
+ // $this->avatar_foobar will be needed later on
+ $this->avatar_foobar = $this->getMock('\phpbb\avatar\driver\foobar', array('get_name'), array($this->config, $phpbb_root_path, $phpEx, $path_helper, $cache));
+ $this->avatar_foobar->expects($this->any())
+ ->method('get_name')
+ ->will($this->returnValue('avatar.driver.foobar'));
+ // barfoo driver can't be mocked with constructor arguments
+ $this->avatar_barfoo = $this->getMock('\phpbb\avatar\driver\barfoo', array('get_name', 'get_config_name'));
+ $this->avatar_barfoo->expects($this->any())
+ ->method('get_name')
+ ->will($this->returnValue('avatar.driver.barfoo'));
+ $this->avatar_barfoo->expects($this->any())
+ ->method('get_config_name')
+ ->will($this->returnValue('barfoo'));
+ $avatar_drivers = array($this->avatar_foobar, $this->avatar_barfoo);
+
+ foreach ($this->avatar_drivers() as $driver)
+ {
+ if ($driver !== 'upload')
+ {
+ $cur_avatar = $this->getMock('\phpbb\avatar\driver\\' . $driver, array('get_name'), array($this->config, $phpbb_root_path, $phpEx, $path_helper, $cache));
+ }
+ else
+ {
+ $cur_avatar = $this->getMock('\phpbb\avatar\driver\\' . $driver, array('get_name'), array($this->config, $phpbb_root_path, $phpEx, $path_helper, $guesser, $dispatcher, $cache));
+ }
+ $cur_avatar->expects($this->any())
+ ->method('get_name')
+ ->will($this->returnValue('avatar.driver.' . $driver));
+ $this->config['allow_avatar_' . get_class($cur_avatar)] = $driver == 'gravatar';
+ $avatar_drivers[] = $cur_avatar;
+ }
+
+ $this->config['allow_avatar_' . get_class($this->avatar_foobar)] = true;
+ $this->config['allow_avatar_' . get_class($this->avatar_barfoo)] = false;
+
+ // Set up avatar manager
+ $this->manager = new \phpbb\avatar\manager($this->config, $avatar_drivers, $phpbb_container);
+ $this->db = $this->new_dbal();
+ $this->user = new \phpbb\user('\phpbb\datetime');
+ }
+
+ protected function avatar_drivers()
+ {
+ return array(
+ 'local',
+ 'upload',
+ 'remote',
+ 'gravatar',
+ );
+ }
+
+ public function test_get_all_drivers()
+ {
+ $drivers = $this->manager->get_all_drivers();
+ $this->assertEquals(array(
+ 'avatar.driver.barfoo' => 'avatar.driver.barfoo',
+ 'avatar.driver.foobar' => 'avatar.driver.foobar',
+ 'avatar.driver.local' => 'avatar.driver.local',
+ 'avatar.driver.remote' => 'avatar.driver.remote',
+ 'avatar.driver.upload' => 'avatar.driver.upload',
+ 'avatar.driver.gravatar' => 'avatar.driver.gravatar',
+ ), $drivers);
+ }
+
+ public function test_get_enabled_drivers()
+ {
+ $drivers = $this->manager->get_enabled_drivers();
+ $this->assertArrayHasKey('avatar.driver.foobar', $drivers);
+ $this->assertArrayNotHasKey('avatar.driver.barfoo', $drivers);
+ $this->assertEquals('avatar.driver.foobar', $drivers['avatar.driver.foobar']);
+ }
+
+ public function get_driver_data_enabled()
+ {
+ return array(
+ array('avatar.driver.foobar', 'avatar.driver.foobar'),
+ array('avatar.driver.gravatar', 'avatar.driver.gravatar'),
+ array('avatar.driver.foo_wrong', null),
+ array('avatar.driver.local', null),
+ array(AVATAR_GALLERY, null),
+ array(AVATAR_UPLOAD, null),
+ array(AVATAR_REMOTE, null),
+ );
+ }
+
+ /**
+ * @dataProvider get_driver_data_enabled
+ */
+ public function test_get_driver_enabled($driver_name, $expected)
+ {
+ $driver = $this->manager->get_driver($driver_name);
+ $this->assertEquals($expected, ($driver === null) ? null : $driver->get_name());
+ }
+
+ public function get_driver_data_all()
+ {
+ return array(
+ array('avatar.driver.foobar', 'avatar.driver.foobar'),
+ array('avatar.driver.foo_wrong', null),
+ array('avatar.driver.local', 'avatar.driver.local'),
+ array(AVATAR_GALLERY, 'avatar.driver.local'),
+ array(AVATAR_UPLOAD, 'avatar.driver.upload'),
+ array(AVATAR_REMOTE, 'avatar.driver.remote'),
+ );
+ }
+
+ /**
+ * @dataProvider get_driver_data_all
+ */
+ public function test_get_driver_all($driver_name, $expected)
+ {
+ $driver = $this->manager->get_driver($driver_name, false);
+ $this->assertEquals($expected, ($driver === null) ? $driver : $driver->get_name());
+ }
+
+ public function test_get_avatar_settings()
+ {
+ $avatar_settings = $this->manager->get_avatar_settings($this->avatar_foobar);
+
+ $expected_settings = array(
+ 'allow_avatar_' . get_class($this->avatar_foobar) => array('lang' => 'ALLOW_' . strtoupper(get_class($this->avatar_foobar)), 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
+ );
+
+ $this->assertEquals($expected_settings, $avatar_settings);
+ }
+
+ public function database_row_data()
+ {
+ return array(
+ array(
+ array(
+ 'user_avatar' => '',
+ 'user_avatar_type' => '',
+ 'user_avatar_width' => '',
+ 'user_avatar_height' => '',
+ 'group_avatar' => '',
+ ),
+ array(
+ 'user_avatar' => '',
+ 'user_avatar_type' => '',
+ 'user_avatar_width' => '',
+ 'user_avatar_height' => '',
+ 'group_avatar' => '',
+ ),
+ 'foobar',
+ ),
+ array(
+ array(),
+ array(
+ 'avatar' => '',
+ 'avatar_type' => '',
+ 'avatar_width' => 0,
+ 'avatar_height' => 0,
+ ),
+ ),
+ array(
+ array(
+ 'user_avatar' => '',
+ 'user_id' => 5,
+ 'group_id' => 4,
+ ),
+ array(
+ 'user_avatar' => '',
+ 'user_id' => 5,
+ 'group_id' => 4,
+ ),
+ ),
+ array(
+ array(
+ 'user_avatar' => '',
+ 'user_id' => 5,
+ 'group_id' => 4,
+ ),
+ array(
+ 'avatar' => '',
+ 'id' => 5,
+ 'group_id' => 4,
+ ),
+ 'user',
+ ),
+ array(
+ array(
+ 'group_avatar' => '',
+ 'user_id' => 5,
+ 'group_id' => 4,
+ ),
+ array(
+ 'avatar' => '',
+ 'id' => 'g4',
+ 'user_id' => 5,
+ ),
+ 'group',
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider database_row_data
+ */
+ public function test_clean_row(array $input, array $output, $prefix = '')
+ {
+ $cleaned_row = \phpbb\avatar\manager::clean_row($input, $prefix);
+ foreach ($output as $key => $value)
+ {
+ $this->assertArrayHasKey($key, $cleaned_row);
+ $this->assertEquals($cleaned_row[$key], $value);
+ }
+ }
+
+ public function test_clean_driver_name()
+ {
+ $this->assertEquals('avatar.driver.local', $this->manager->clean_driver_name('avatar_driver_local'));
+ }
+
+ public function test_prepare_driver_name()
+ {
+ $this->assertEquals('avatar_driver_local', $this->manager->prepare_driver_name('avatar.driver.local'));
+ }
+
+ public function test_localize_errors()
+ {
+ $user = $this->getMock('\phpbb\user', array(), array('\phpbb\datetime'));
+ $lang_array = array(
+ array('FOOBAR_OFF', 'foobar_off'),
+ array('FOOBAR_EXPLAIN', 'FOOBAR_EXPLAIN %s'),
+ );
+ $user->expects($this->any())
+ ->method('lang')
+ ->will($this->returnValueMap($lang_array));
+
+ // Pass error as string
+ $this->assertEquals(array('foobar_off'), $this->manager->localize_errors($user, array('FOOBAR_OFF')));
+
+ // Pass error as array for vsprintf()
+ $this->assertEquals(array('FOOBAR_EXPLAIN foo'), $this->manager->localize_errors($user, array(array('FOOBAR_EXPLAIN', 'foo'))));
+
+ // Pass both types
+ $this->assertEquals(array('foobar_off', 'FOOBAR_EXPLAIN foo'), $this->manager->localize_errors($user, array(
+ 'FOOBAR_OFF',
+ array('FOOBAR_EXPLAIN', 'foo'),
+ )));
+ }
+
+ public function data_handle_avatar_delete()
+ {
+ return array(
+ array(
+ array(
+ 'avatar' => '',
+ 'avatar_type' => '',
+ 'avatar_width' => 0,
+ 'avatar_height' => 0,
+ ), 1, array(
+ 'avatar' => 'foobar@example.com',
+ 'avatar_type' => 'avatar.driver.gravatar',
+ 'avatar_width' => '16',
+ 'avatar_height' => '16',
+ ), USERS_TABLE, 'user_',
+ ),
+ array(
+ array(
+ 'avatar' => '',
+ 'avatar_type' => '',
+ 'avatar_width' => 0,
+ 'avatar_height' => 0,
+ ), 5, array(
+ 'avatar' => 'g5_1414350991.jpg',
+ 'avatar_type' => 'avatar.driver.upload',
+ 'avatar_width' => '80',
+ 'avatar_height' => '80'
+ ), GROUPS_TABLE, 'group_',
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider data_handle_avatar_delete
+ */
+ public function test_handle_avatar_delete($expected, $id, $avatar_data, $table, $prefix)
+ {
+ $this->config['allow_avatar_gravatar'] = true;
+ $this->assertNull($this->manager->handle_avatar_delete($this->db, $this->user, $avatar_data, $table, $prefix));
+
+ $sql = 'SELECT * FROM ' . $table . '
+ WHERE ' . $prefix . 'id = ' . $id;
+ $result = $this->db->sql_query_limit($sql, 1);
+
+ $row = $this->manager->clean_row($this->db->sql_fetchrow($result), substr($prefix, 0, -1));
+ $this->db->sql_freeresult($result);
+
+ foreach ($expected as $key => $value)
+ {
+ $this->assertEquals($value, $row[$key]);
+ }
+ }
+
+ /**
+ * @dependsOn test_handle_avatar_delete
+ */
+ public function test_user_group_avatar_deleted()
+ {
+ $sql = 'SELECT * FROM ' . USERS_TABLE . '
+ WHERE user_id = 3';
+ $result = $this->db->sql_query_limit($sql, 1);
+ $row = $this->manager->clean_row($this->db->sql_fetchrow($result), 'user');
+ $this->db->sql_freeresult($result);
+
+ $this->assertEquals(array(
+ 'avatar' => '',
+ 'avatar_type' => '',
+ 'avatar_width' => 0,
+ 'avatar_height' => 0,
+ ), $row);
+ }
+
+ public function data_remote_avatar_url()
+ {
+ return array(
+ array('127.0.0.1:91?foo.jpg', 80, 80, array('AVATAR_URL_INVALID')),
+ array(gethostbyname('secure.gravatar.com') . '/avatar/55502f40dc8b7c769880b10874abc9d0.jpg', 80, 80, array('AVATAR_URL_INVALID')),
+ array('secure.gravatar.com/avatar/55502f40dc8b7c769880b10874abc9d0.jpg', 80, 80),
+ array(gethostbyname('secure.gravatar.com') . ':120/avatar/55502f40dc8b7c769880b10874abc9d0.jpg', 80, 80, array('AVATAR_URL_INVALID')),
+ array('secure.gravatar.com:80/avatar/55502f40dc8b7c769880b10874abc9d0.jpg', 80, 80, array('AVATAR_URL_INVALID')),
+ array('secure.gravatar.com:80?55502f40dc8b7c769880b10874abc9d0.jpg', 80, 80, array('AVATAR_URL_INVALID')),
+ array('secure.gravatar.com?55502f40dc8b7c769880b10874abc9d0.jpg', 80, 80, array('AVATAR_URL_INVALID')), // should be a 404
+ array('2001:db8:0:0:0:0:2:1/avatar/55502f40dc8b7c769880b10874abc9d0.jpg', 80, 80, array('AVATAR_URL_INVALID')),
+ array('secure.gravatar.com/2001:db8:0:0:0:0:2:1/avatar/55502f40dc8b7c769880b10874abc9d0.jpg', 80, 80, array('AVATAR_URL_INVALID')),
+ array('secure.gravatar.com/127.0.0.1:80/avatar/55502f40dc8b7c769880b10874abc9d0.jpg', 80, 80, array('AVATAR_URL_INVALID')),
+ );
+ }
+
+ /**
+ * @dataProvider data_remote_avatar_url
+ */
+ public function test_remote_avatar_url($url, $width, $height, $expected_error = array())
+ {
+ global $phpbb_root_path, $phpEx;
+
+ if (!function_exists('get_preg_expression'))
+ {
+ require($phpbb_root_path . 'includes/functions.' . $phpEx);
+ }
+
+ $this->config['server_name'] = 'foobar.com';
+
+ /** @var \phpbb\avatar\driver\remote $remote_avatar */
+ $remote_avatar = $this->manager->get_driver('avatar.driver.remote', false);
+
+ $request = new phpbb_mock_request(array(), array(
+ 'avatar_remote_url' => $url,
+ 'avatar_remote_width' => $width,
+ 'avatar_remote_height' => $height,
+ ));
+
+ $user = new \phpbb\user('\phpbb\datetime');
+ $row = array();
+ $error = array();
+
+ $return = $remote_avatar->process_form($request, null, $user, $row, $error);
+ if (count($expected_error) > 0)
+ {
+ $this->assertFalse($return);
+ }
+ else
+ {
+ $this->assertNotEquals(false, $return);
+ }
+ $this->assertSame($expected_error, $error);
+ }
+}
diff --git a/tests/bbcode/parser_test.php b/tests/bbcode/parser_test.php
new file mode 100644
index 0000000000..14736627f3
--- /dev/null
+++ b/tests/bbcode/parser_test.php
@@ -0,0 +1,269 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions_content.php';
+require_once dirname(__FILE__) . '/../../phpBB/includes/bbcode.php';
+require_once dirname(__FILE__) . '/../../phpBB/includes/message_parser.php';
+
+class phpbb_bbcode_parser_test extends \phpbb_test_case
+{
+ public function bbcode_firstpass_data()
+ {
+ return array(
+ // Default bbcodes from in their simplest way
+ array(
+ 'Test default bbcodes: simple bold',
+ '[b]bold[/b]',
+ '[b:]bold[/b:]',
+ ),
+ array(
+ 'Test default bbcodes: simple underlined',
+ '[u]underlined[/u]',
+ '[u:]underlined[/u:]',
+ ),
+ array(
+ 'Test default bbcodes: simple italic',
+ '[i]italic[/i]',
+ '[i:]italic[/i:]',
+ ),
+ array(
+ 'Test default bbcodes: simple color rgb',
+ '[color=#FF0000]colored[/color]',
+ '[color=#FF0000:]colored[/color:]',
+ ),
+ array(
+ 'Test default bbcodes: simple color name',
+ '[color=red]colored[/color]',
+ '[color=red:]colored[/color:]',
+ ),
+ array(
+ 'Test default bbcodes: simple size',
+ '[size=75]smaller[/size]',
+ '[size=75:]smaller[/size:]',
+ ),
+ array(
+ 'Test default bbcodes: simple quote',
+ '[quote]quoted[/quote]',
+ '[quote:]quoted[/quote:]',
+ ),
+ array(
+ 'Test default bbcodes: simple quote with username',
+ '[quote=&quot;username&quot;]quoted[/quote]',
+ '[quote=&quot;username&quot;:]quoted[/quote:]',
+ ),
+ array(
+ 'Test default bbcodes: simple code',
+ '[code]unparsed code[/code]',
+ '[code:]unparsed code[/code:]',
+ ),
+ array(
+ 'Test default bbcodes: simple php code',
+ '[code=php]unparsed code[/code]',
+ '[code=php:]<span class="syntaxdefault">unparsed&nbsp;code</span>[/code:]',
+ ),
+ array(
+ 'Test default bbcodes: simple list',
+ '[list]no item[/list]',
+ '[list:]no item[/list:u:]',
+ ),
+ array(
+ 'Test default bbcodes: simple list-item only',
+ '[*]unparsed',
+ '[*]unparsed',
+ ),
+ array(
+ 'Test default bbcodes: simple list-item',
+ '[list][*]item[/list]',
+ '[list:][*:]item[/*:m:][/list:u:]',
+ ),
+ array(
+ 'Test default bbcodes: simple list-item closed',
+ '[list][*]item[/*][/list]',
+ '[list:][*:]item[/*:][/list:u:]',
+ ),
+ array(
+ 'Test default bbcodes: simple list-item numbered',
+ '[list=1][*]item[/list]',
+ '[list=1:][*:]item[/*:m:][/list:o:]',
+ ),
+ array(
+ 'Test default bbcodes: simple list-item alpha',
+ '[list=a][*]item[/list]',
+ '[list=a:][*:]item[/*:m:][/list:o:]',
+ ),
+ array(
+ 'Test default bbcodes: simple list-item roman',
+ '[list=i][*]item[/list]',
+ '[list=i:][*:]item[/*:m:][/list:o:]',
+ ),
+ array(
+ 'Test default bbcodes: simple list-item disc',
+ '[list=disc][*]item[/list]',
+ '[list=disc:][*:]item[/*:m:][/list:u:]',
+ ),
+ array(
+ 'Test default bbcodes: simple list-item circle',
+ '[list=circle][*]item[/list]',
+ '[list=circle:][*:]item[/*:m:][/list:u:]',
+ ),
+ array(
+ 'Test default bbcodes: simple list-item square',
+ '[list=square][*]item[/list]',
+ '[list=square:][*:]item[/*:m:][/list:u:]',
+ ),
+ array(
+ 'Test default bbcodes: simple img',
+ '[img]https://area51.phpbb.com/images/area51.png[/img]',
+ '[img:]https&#58;//area51&#46;phpbb&#46;com/images/area51&#46;png[/img:]',
+ ),
+ array(
+ 'Test default bbcodes: simple url',
+ '[url]https://area51.phpbb.com/[/url]',
+ '[url:]https&#58;//area51&#46;phpbb&#46;com/[/url:]',
+ ),
+ array(
+ 'Test default bbcodes: simple url with description',
+ '[url=https://area51.phpbb.com/]Area51[/url]',
+ '[url=https&#58;//area51&#46;phpbb&#46;com/:]Area51[/url:]',
+ ),
+ array(
+ 'Test default bbcodes: simple email',
+ '[email]bbcode-test@phpbb.com[/email]',
+ '[email:]bbcode-test@phpbb&#46;com[/email:]',
+ ),
+ array(
+ 'Test default bbcodes: simple email with description',
+ '[email=bbcode-test@phpbb.com]Email[/email]',
+ '[email=bbcode-test@phpbb&#46;com:]Email[/email:]',
+ ),
+ array(
+ 'Test default bbcodes: simple attachment',
+ '[attachment=0]filename[/attachment]',
+ '[attachment=0:]<!-- ia0 -->filename<!-- ia0 -->[/attachment:]',
+ ),
+
+ // Special cases for quote which were reported as bugs before
+ array(
+ 'PHPBB3-1401 - correct: parsed',
+ '[quote=&quot;&#91;test]test&quot;]test [ test[/quote]',
+ '[quote=&quot;&#91;test]test&quot;:]test [ test[/quote:]',
+ ),
+ array(
+ 'PHPBB3-6117 - correct: parsed',
+ '[quote]test[/quote] test ] and [ test [quote]test[/quote]',
+ '[quote:]test[/quote:] test ] and [ test [quote:]test[/quote:]',
+ ),
+ array(
+ 'PHPBB3-6200 - correct: parsed',
+ '[quote=&quot;[&quot;]test[/quote]',
+ '[quote=&quot;&#91;&quot;:]test[/quote:]',
+ ),
+ array(
+ 'PHPBB3-9364 - quoted: "test[/[/b]quote] test" / non-quoted: "[/quote] test" - also failed if layout distorted',
+ '[quote]test[/[/b]quote] test [/quote][/quote] test',
+ '[quote:]test[/[/b]quote] test [/quote:][/quote] test',
+ ),
+ array(
+ 'PHPBB3-8096 - first quote tag parsed, second quote tag unparsed',
+ '[quote=&quot;a&quot;]a[/quote][quote=&quot;a]a[/quote]',
+ '[quote=&quot;a&quot;:]a[/quote:][quote=&quot;a]a[/quote]',
+ ),
+
+ // Simple bbcodes nesting
+ array(
+ 'Allow textual bbcodes in textual bbcodes',
+ '[b]bold [i]bold + italic[/i][/b]',
+ '[b:]bold [i:]bold + italic[/i:][/b:]',
+ ),
+ array(
+ 'Allow textual bbcodes in url with description',
+ '[url=https://area51.phpbb.com/]Area51 [i]italic[/i][/url]',
+ '[url=https&#58;//area51&#46;phpbb&#46;com/:]Area51 [i:]italic[/i:][/url:]',
+ ),
+ array(
+ 'Allow url with description in textual bbcodes',
+ '[i]italic [url=https://area51.phpbb.com/]Area51[/url][/i]',
+ '[i:]italic [url=https&#58;//area51&#46;phpbb&#46;com/:]Area51[/url:][/i:]',
+ ),
+
+ // Nesting bbcodes into quote usernames
+ array(
+ 'Allow textual bbcodes in usernames',
+ '[quote=&quot;[i]test[/i]&quot;]test[/quote]',
+ '[quote=&quot;[i:]test[/i:]&quot;:]test[/quote:]',
+ ),
+ array(
+ 'Allow links bbcodes in usernames',
+ '[quote=&quot;[url=https://area51.phpbb.com/]test[/url]&quot;]test[/quote]',
+ '[quote=&quot;[url=https&#58;//area51&#46;phpbb&#46;com/:]test[/url:]&quot;:]test[/quote:]',
+ ),
+ array(
+ 'Allow img bbcodes in usernames - Username displayed the image',
+ '[quote=&quot;[img]https://area51.phpbb.com/images/area51.png[/img]&quot;]test[/quote]',
+ '[quote=&quot;[img:]https&#58;//area51&#46;phpbb&#46;com/images/area51&#46;png[/img:]&quot;:]test[/quote:]',
+ ),
+ array(
+ 'Disallow flash bbcodes in usernames - Username displayed as [flash]http://www.phpbb.com/[/flash]',
+ '[quote=&quot;[flash]http://www.phpbb.com/[/flash]&quot;]test[/quote]',
+ '[quote=&quot;&#91;flash]http://www.phpbb.com/&#91;/flash]&quot;:]test[/quote:]',
+ ),
+ array(
+ 'Disallow quote bbcodes in usernames - Username displayed as [quote]test[/quote]',
+ '[quote=&quot;[quote]test[/quote]&quot;]test[/quote]',
+ '[quote=&quot;&#91;quote]test&#91;/quote]&quot;:]test[/quote:]',
+ ),
+
+ // Do not parse bbcodes in code boxes
+ array(
+ 'Do not parse textual bbcodes in code',
+ '[code]unparsed code [b]bold [i]bold + italic[/i][/b][/code]',
+ '[code:]unparsed code &#91;b&#93;bold &#91;i&#93;bold + italic&#91;/i&#93;&#91;/b&#93;[/code:]',
+ ),
+ array(
+ 'Do not parse quote bbcodes in code',
+ '[code]unparsed code [quote=&quot;username&quot;]quoted[/quote][/code]',
+ '[code:]unparsed code &#91;quote=&quot;username&quot;&#93;quoted&#91;/quote&#93;[/code:]',
+ ),
+
+ // New user friendly mixed nesting
+ array(
+ 'Textual bbcode nesting into textual bbcode',
+ '[b]bold [i]bold + italic[/b] italic[/i]',
+ '[b:]bold [i:]bold + italic[/b:] italic[/i:]',
+ 'Incomplete test case: secondpass parses as [b:]bold [i:]bold + italic[/i:] italic[/b:]',
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider bbcode_firstpass_data
+ */
+ public function test_bbcode_firstpass($description, $message, $expected, $incomplete = false)
+ {
+ if ($incomplete)
+ {
+ $this->markTestIncomplete($incomplete);
+ }
+
+ global $user, $request;
+ $user = new phpbb_mock_user;
+ $request = new phpbb_mock_request;
+
+ $bbcode = new bbcode_firstpass();
+ $bbcode->message = $message;
+ $bbcode->bbcode_init(false);
+ $bbcode->parse_bbcode();
+ $this->assertEquals($expected, $bbcode->message);
+ }
+}
diff --git a/tests/bbcode/url_bbcode_test.php b/tests/bbcode/url_bbcode_test.php
index 6b5afe5808..83176abe4c 100644
--- a/tests/bbcode/url_bbcode_test.php
+++ b/tests/bbcode/url_bbcode_test.php
@@ -1,9 +1,13 @@
<?php
/**
*
-* @package testing
-* @copyright (c) 2010 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -11,7 +15,6 @@ require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
require_once dirname(__FILE__) . '/../../phpBB/includes/functions_content.php';
require_once dirname(__FILE__) . '/../../phpBB/includes/bbcode.php';
require_once dirname(__FILE__) . '/../../phpBB/includes/message_parser.php';
-require_once dirname(__FILE__) . '/../mock/user.php';
class phpbb_url_bbcode_test extends phpbb_test_case
{
@@ -51,8 +54,9 @@ class phpbb_url_bbcode_test extends phpbb_test_case
*/
public function test_url($description, $message, $expected)
{
- global $user;
+ global $user, $request;
$user = new phpbb_mock_user;
+ $request = new phpbb_mock_request;
$bbcode = new bbcode_firstpass();
$bbcode->message = $message;
diff --git a/tests/bootstrap.php b/tests/bootstrap.php
index d687db622a..0e81f4372a 100644
--- a/tests/bootstrap.php
+++ b/tests/bootstrap.php
@@ -1,9 +1,13 @@
<?php
/**
*
-* @package testing
-* @copyright (c) 2008 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -14,28 +18,24 @@ require_once $phpbb_root_path . 'includes/startup.php';
$table_prefix = 'phpbb_';
require_once $phpbb_root_path . 'includes/constants.php';
+require_once $phpbb_root_path . 'phpbb/class_loader.' . $phpEx;
+require_once($phpbb_root_path . 'includes/utf/utf_tools.' . $phpEx);
+
+$phpbb_class_loader_mock = new \phpbb\class_loader('phpbb_mock_', $phpbb_root_path . '../tests/mock/', "php");
+$phpbb_class_loader_mock->register();
+$phpbb_class_loader_ext = new \phpbb\class_loader('\\', $phpbb_root_path . 'ext/', "php");
+$phpbb_class_loader_ext->register();
+$phpbb_class_loader = new \phpbb\class_loader('phpbb\\', $phpbb_root_path . 'phpbb/', "php");
+$phpbb_class_loader->register();
require_once 'test_framework/phpbb_test_case_helpers.php';
require_once 'test_framework/phpbb_test_case.php';
require_once 'test_framework/phpbb_database_test_case.php';
require_once 'test_framework/phpbb_database_test_connection_manager.php';
+require_once 'test_framework/phpbb_functional_test_case.php';
+require_once 'test_framework/phpbb_ui_test_case.php';
-if (version_compare(PHP_VERSION, '5.3.0-dev', '>='))
+if (version_compare(PHP_VERSION, '5.3.19', ">=") && file_exists(__DIR__ . '/vendor/autoload.php'))
{
- if (getenv('PHPBB_NO_COMPOSER_AUTOLOAD'))
- {
- if (getenv('PHPBB_AUTOLOAD'))
- {
- require(getenv('PHPBB_AUTOLOAD'));
- }
- }
- else
- {
- if (!file_exists($phpbb_root_path . 'vendor/autoload.php'))
- {
- trigger_error('You have not set up composer dependencies. See http://getcomposer.org/.', E_USER_ERROR);
- }
- require($phpbb_root_path . 'vendor/autoload.php');
- }
- require_once 'test_framework/phpbb_functional_test_case.php';
+ require_once __DIR__ . '/vendor/autoload.php';
}
diff --git a/tests/cache/apc_driver_test.php b/tests/cache/apc_driver_test.php
new file mode 100644
index 0000000000..10130b465b
--- /dev/null
+++ b/tests/cache/apc_driver_test.php
@@ -0,0 +1,57 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+// Important: apc.enable_cli=1 must be in php.ini.
+// http://forums.devshed.com/php-development-5/apc-problem-561290.html
+// http://php.net/manual/en/apc.configuration.php
+
+require_once dirname(__FILE__) . '/common_test_case.php';
+
+class phpbb_cache_apc_driver_test extends phpbb_cache_common_test_case
+{
+ protected static $config;
+ protected $driver;
+
+ public function getDataSet()
+ {
+ return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/config.xml');
+ }
+
+ static public function setUpBeforeClass()
+ {
+ if (!extension_loaded('apc'))
+ {
+ self::markTestSkipped('APC extension is not loaded');
+ }
+
+ $php_ini = new \phpbb\php\ini;
+
+ if (!$php_ini->get_bool('apc.enabled'))
+ {
+ self::markTestSkipped('APC is not enabled. Make sure apc.enabled=1 in php.ini');
+ }
+
+ if (PHP_SAPI == 'cli' && !$php_ini->get_bool('apc.enable_cli'))
+ {
+ self::markTestSkipped('APC is not enabled for CLI. Set apc.enable_cli=1 in php.ini');
+ }
+ }
+
+ protected function setUp()
+ {
+ parent::setUp();
+
+ $this->driver = new \phpbb\cache\driver\apc;
+ $this->driver->purge();
+ }
+}
diff --git a/tests/cache/cache_memory.php b/tests/cache/cache_memory.php
index c468cb4658..806edb963a 100644
--- a/tests/cache/cache_memory.php
+++ b/tests/cache/cache_memory.php
@@ -1,15 +1,17 @@
<?php
/**
-*
-* @package testing
-* @copyright (c) 2014 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
-*
-*/
+ *
+ * This file is part of the phpBB Forum Software package.
+ *
+ * @copyright (c) phpBB Limited <https://www.phpbb.com>
+ * @license GNU General Public License, version 2 (GPL-2.0)
+ *
+ * For full copyright and license information, please see
+ * the docs/CREDITS.txt file.
+ *
+ */
-require_once dirname(__FILE__) . '/../../phpBB/includes/acm/acm_memory.php';
-
-class phpbb_cache_memory extends acm_memory
+class phpbb_cache_memory extends \phpbb\cache\driver\memory
{
protected $data = array();
diff --git a/tests/cache/cache_memory_test.php b/tests/cache/cache_memory_test.php
index 7a529c1d04..9f92e8d8dc 100644
--- a/tests/cache/cache_memory_test.php
+++ b/tests/cache/cache_memory_test.php
@@ -1,17 +1,22 @@
<?php
/**
-*
-* @package testing
-* @copyright (c) 2014 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
-*
-*/
+ *
+ * This file is part of the phpBB Forum Software package.
+ *
+ * @copyright (c) phpBB Limited <https://www.phpbb.com>
+ * @license GNU General Public License, version 2 (GPL-2.0)
+ *
+ * For full copyright and license information, please see
+ * the docs/CREDITS.txt file.
+ *
+ */
require_once dirname(__FILE__) . '/cache_memory.php';
class phpbb_cache_memory_test extends phpbb_database_test_case
{
protected $cache;
+ protected $db;
public function getDataSet()
{
@@ -25,6 +30,7 @@ class phpbb_cache_memory_test extends phpbb_database_test_case
$this->cache = new phpbb_cache_memory();
$db = $this->new_dbal();
+ $this->db = $db;
}
static public function cache_single_query_data()
@@ -97,13 +103,11 @@ class phpbb_cache_memory_test extends phpbb_database_test_case
*/
public function test_cache_single_query($sql_queries, $table)
{
- global $db;
-
foreach ($sql_queries as $query)
{
- $sql_request_res = $db->sql_query($query[0]);
+ $sql_request_res = $this->db->sql_query($query[0]);
- $this->cache->sql_save($query[0], $sql_request_res, 1);
+ $this->cache->sql_save($this->db, $query[0], $sql_request_res, 1);
$results = array();
$query_id = $this->cache->sql_load($query[0]);
diff --git a/tests/cache/common_test_case.php b/tests/cache/common_test_case.php
new file mode 100644
index 0000000000..ee0649a755
--- /dev/null
+++ b/tests/cache/common_test_case.php
@@ -0,0 +1,102 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+abstract class phpbb_cache_common_test_case extends phpbb_database_test_case
+{
+ public function test_get_put_exists()
+ {
+ $this->assertFalse($this->driver->_exists('test_key'));
+ $this->assertSame(false, $this->driver->get('test_key'));
+
+ $this->driver->put('test_key', 'test_value');
+
+ $this->assertTrue($this->driver->_exists('test_key'));
+ $this->assertEquals(
+ 'test_value',
+ $this->driver->get('test_key'),
+ 'File ACM put and get'
+ );
+ }
+
+ public function test_purge()
+ {
+ $this->driver->put('test_key', 'test_value');
+
+ $this->assertEquals(
+ 'test_value',
+ $this->driver->get('test_key'),
+ 'File ACM put and get'
+ );
+
+ $this->driver->purge();
+
+ $this->assertSame(false, $this->driver->get('test_key'));
+ }
+
+ public function test_destroy()
+ {
+ $this->driver->put('first_key', 'first_value');
+ $this->driver->put('second_key', 'second_value');
+
+ $this->assertEquals(
+ 'first_value',
+ $this->driver->get('first_key')
+ );
+ $this->assertEquals(
+ 'second_value',
+ $this->driver->get('second_key')
+ );
+
+ $this->driver->destroy('first_key');
+
+ $this->assertFalse($this->driver->_exists('first_key'));
+ $this->assertEquals(
+ 'second_value',
+ $this->driver->get('second_key')
+ );
+ }
+
+ public function test_cache_sql()
+ {
+ global $db, $cache, $phpbb_root_path, $phpEx;
+ $config = new phpbb\config\config(array());
+ $db = $this->new_dbal();
+ $cache = new \phpbb\cache\service($this->driver, $config, $db, $phpbb_root_path, $phpEx);
+
+ $sql = "SELECT * FROM phpbb_config
+ WHERE config_name = 'foo'";
+
+ $result = $db->sql_query($sql, 300);
+ $first_result = $db->sql_fetchrow($result);
+ $expected = array('config_name' => 'foo', 'config_value' => '23', 'is_dynamic' => 0);
+ $this->assertEquals($expected, $first_result);
+
+ $sql = 'DELETE FROM phpbb_config';
+ $result = $db->sql_query($sql);
+
+ $sql = "SELECT * FROM phpbb_config
+ WHERE config_name = 'foo'";
+ $result = $db->sql_query($sql, 300);
+
+ $this->assertEquals($expected, $db->sql_fetchrow($result));
+
+ $sql = "SELECT * FROM phpbb_config
+ WHERE config_name = 'foo'";
+ $result = $db->sql_query($sql);
+
+ $no_cache_result = $db->sql_fetchrow($result);
+ $this->assertSame(false, $no_cache_result);
+
+ $db->sql_close();
+ }
+}
diff --git a/tests/cache/file_driver_test.php b/tests/cache/file_driver_test.php
new file mode 100644
index 0000000000..471316847d
--- /dev/null
+++ b/tests/cache/file_driver_test.php
@@ -0,0 +1,73 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+require_once dirname(__FILE__) . '/common_test_case.php';
+
+class phpbb_cache_file_driver_test extends phpbb_cache_common_test_case
+{
+ private $cache_dir;
+ protected $driver;
+
+ public function __construct()
+ {
+ $this->cache_dir = dirname(__FILE__) . '/../tmp/cache/';
+ }
+
+ public function getDataSet()
+ {
+ return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/config.xml');
+ }
+
+ protected function setUp()
+ {
+ parent::setUp();
+
+ if (file_exists($this->cache_dir))
+ {
+ // cache directory possibly left after aborted
+ // or failed run earlier
+ $this->remove_cache_dir();
+ }
+ $this->create_cache_dir();
+
+ $this->driver = new \phpbb\cache\driver\file($this->cache_dir);
+ }
+
+ protected function tearDown()
+ {
+ if (file_exists($this->cache_dir))
+ {
+ $this->remove_cache_dir();
+ }
+
+ parent::tearDown();
+ }
+
+ private function create_cache_dir()
+ {
+ $this->get_test_case_helpers()->makedirs($this->cache_dir);
+ }
+
+ private function remove_cache_dir()
+ {
+ $iterator = new DirectoryIterator($this->cache_dir);
+ foreach ($iterator as $file)
+ {
+ if ($file != '.' && $file != '..')
+ {
+ unlink($this->cache_dir . '/' . $file);
+ }
+ }
+ rmdir($this->cache_dir);
+ }
+}
diff --git a/tests/cache/fixtures/cache_memory.xml b/tests/cache/fixtures/cache_memory.xml
index 6954c7b76b..9c19ebb7ba 100644
--- a/tests/cache/fixtures/cache_memory.xml
+++ b/tests/cache/fixtures/cache_memory.xml
@@ -49,8 +49,6 @@
<column>username_clean</column>
<column>user_permissions</column>
<column>user_sig</column>
- <column>user_occ</column>
- <column>user_interests</column>
<row>
<value>1</value>
<value>1</value>
@@ -58,8 +56,6 @@
<value>user 1</value>
<value></value>
<value></value>
- <value></value>
- <value></value>
</row>
<row>
<value>2</value>
@@ -68,8 +64,6 @@
<value>user 2</value>
<value></value>
<value></value>
- <value></value>
- <value></value>
</row>
<row>
<value>3</value>
@@ -78,8 +72,6 @@
<value>user 3</value>
<value></value>
<value></value>
- <value></value>
- <value></value>
</row>
</table>
</dataset>
diff --git a/tests/cache/fixtures/config.xml b/tests/cache/fixtures/config.xml
new file mode 100644
index 0000000000..9d395b685c
--- /dev/null
+++ b/tests/cache/fixtures/config.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<dataset>
+ <table name="phpbb_config">
+ <column>config_name</column>
+ <column>config_value</column>
+ <column>is_dynamic</column>
+ <row>
+ <value>foo</value>
+ <value>23</value>
+ <value>0</value>
+ </row>
+ <row>
+ <value>bar</value>
+ <value>42</value>
+ <value>1</value>
+ </row>
+ </table>
+</dataset>
diff --git a/tests/cache/null_driver_test.php b/tests/cache/null_driver_test.php
new file mode 100644
index 0000000000..b9f96732f5
--- /dev/null
+++ b/tests/cache/null_driver_test.php
@@ -0,0 +1,77 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+class phpbb_cache_null_driver_test extends phpbb_database_test_case
+{
+ protected $driver;
+
+ public function getDataSet()
+ {
+ return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/config.xml');
+ }
+
+ protected function setUp()
+ {
+ parent::setUp();
+
+ $this->driver = new \phpbb\cache\driver\null;
+ }
+
+ public function test_get_put()
+ {
+ $this->assertSame(false, $this->driver->get('key'));
+
+ $this->driver->put('key', 'value');
+
+ // null driver does not cache
+ $this->assertSame(false, $this->driver->get('key'));
+ }
+
+ public function test_purge()
+ {
+ $this->assertNull($this->driver->purge());
+ }
+
+ public function test_destroy()
+ {
+ $this->assertNull($this->driver->destroy('foo'));
+ }
+
+ public function test_cache_sql()
+ {
+ global $db, $cache, $phpbb_root_path, $phpEx;
+ $config = new phpbb\config\config(array());
+ $db = $this->new_dbal();
+ $cache = new \phpbb\cache\service($this->driver, $config, $db, $phpbb_root_path, $phpEx);
+
+ $sql = "SELECT * FROM phpbb_config
+ WHERE config_name = 'foo'";
+ $result = $db->sql_query($sql, 300);
+ $first_result = $db->sql_fetchrow($result);
+ $expected = array('config_name' => 'foo', 'config_value' => '23', 'is_dynamic' => 0);
+ $this->assertEquals($expected, $first_result);
+
+ $sql = 'DELETE FROM phpbb_config';
+ $result = $db->sql_query($sql);
+
+ // As null cache driver does not actually cache,
+ // this should return no results
+ $sql = "SELECT * FROM phpbb_config
+ WHERE config_name = 'foo'";
+ $result = $db->sql_query($sql, 300);
+
+ $this->assertSame(false, $db->sql_fetchrow($result));
+
+ $db->sql_close();
+ }
+}
diff --git a/tests/cache/redis_driver_test.php b/tests/cache/redis_driver_test.php
new file mode 100644
index 0000000000..387e6ca855
--- /dev/null
+++ b/tests/cache/redis_driver_test.php
@@ -0,0 +1,53 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+require_once dirname(__FILE__) . '/common_test_case.php';
+
+class phpbb_cache_redis_driver_test extends phpbb_cache_common_test_case
+{
+ protected static $config;
+ protected $driver;
+
+ public function getDataSet()
+ {
+ return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/config.xml');
+ }
+
+ static public function setUpBeforeClass()
+ {
+ if (!extension_loaded('redis'))
+ {
+ self::markTestSkipped('redis extension is not loaded');
+ }
+
+ $config = phpbb_test_case_helpers::get_test_config();
+ if (isset($config['redis_host']) || isset($config['redis_port']))
+ {
+ $host = isset($config['redis_host']) ? $config['redis_host'] : 'localhost';
+ $port = isset($config['redis_port']) ? $config['redis_port'] : 6379;
+ self::$config = array('host' => $host, 'port' => $port);
+ }
+ else
+ {
+ self::markTestSkipped('Test redis host/port is not specified');
+ }
+ }
+
+ protected function setUp()
+ {
+ parent::setUp();
+
+ $this->driver = new \phpbb\cache\driver\redis(self::$config['host'], self::$config['port']);
+ $this->driver->purge();
+ }
+}
diff --git a/tests/captcha/qa_test.php b/tests/captcha/qa_test.php
new file mode 100644
index 0000000000..1f2f9f3070
--- /dev/null
+++ b/tests/captcha/qa_test.php
@@ -0,0 +1,94 @@
+<?php
+/**
+ *
+ * This file is part of the phpBB Forum Software package.
+ *
+ * @copyright (c) phpBB Limited <https://www.phpbb.com>
+ * @license GNU General Public License, version 2 (GPL-2.0)
+ *
+ * For full copyright and license information, please see
+ * the docs/CREDITS.txt file.
+ *
+ */
+
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
+
+class phpbb_captcha_qa_test extends \phpbb_database_test_case
+{
+ protected $request;
+
+ /** @var \phpbb\captcha\plugins\qa */
+ protected $qa;
+
+ public function getDataSet()
+ {
+ return $this->createXMLDataSet(dirname(__FILE__) . '/../fixtures/empty.xml');
+ }
+
+ public function setUp()
+ {
+ global $db;
+
+ $db = $this->new_dbal();
+
+ parent::setUp();
+
+ $this->request = new \phpbb_mock_request();
+ request_var(false, false, false, false, $this->request);
+ $this->qa = new \phpbb\captcha\plugins\qa('phpbb_captcha_questions', 'phpbb_captcha_answers', 'phpbb_qa_confirm');
+ }
+
+ public function test_is_installed()
+ {
+ $this->assertFalse($this->qa->is_installed());
+
+ $this->qa->install();
+
+ $this->assertTrue($this->qa->is_installed());
+ }
+
+ public function test_set_get_name()
+ {
+ $this->assertNull($this->qa->get_service_name());
+ $this->qa->set_name('foobar');
+ $this->assertSame('foobar', $this->qa->get_service_name());
+ }
+
+ public function data_acp_get_question_input()
+ {
+ return array(
+ array("foobar\ntest\nyes", array(
+ 'question_text' => '',
+ 'strict' => false,
+ 'lang_iso' => '',
+ 'answers' => array('foobar', 'test', 'yes')
+ )),
+ array("foobar\ntest\n \nyes", array(
+ 'question_text' => '',
+ 'strict' => false,
+ 'lang_iso' => '',
+ 'answers' => array(
+ 0 => 'foobar',
+ 1 => 'test',
+ 3 => 'yes',
+ )
+ )),
+ array('', array(
+ 'question_text' => '',
+ 'strict' => false,
+ 'lang_iso' => '',
+ 'answers' => '',
+ )),
+ );
+ }
+
+ /**
+ * @dataProvider data_acp_get_question_input
+ */
+ public function test_acp_get_question_input($value, $expected)
+ {
+ $this->request->overwrite('answers', $value);
+
+ $this->assertEquals($expected, $this->qa->acp_get_question_input());
+ }
+}
diff --git a/tests/class_loader/class_loader_test.php b/tests/class_loader/class_loader_test.php
new file mode 100644
index 0000000000..ffb14b0720
--- /dev/null
+++ b/tests/class_loader/class_loader_test.php
@@ -0,0 +1,101 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+class phpbb_class_loader_test extends \phpbb_test_case
+{
+ public function setUp()
+ {
+ global $phpbb_class_loader;
+ $phpbb_class_loader->unregister();
+
+ global $phpbb_class_loader_ext;
+ $phpbb_class_loader_ext->unregister();
+ }
+
+ public function tearDown()
+ {
+ global $phpbb_class_loader_ext;
+ $phpbb_class_loader_ext->register();
+
+ global $phpbb_class_loader;
+ $phpbb_class_loader->register();
+ }
+
+ public function test_resolve_path()
+ {
+ $prefix = dirname(__FILE__) . '/';
+ $class_loader = new \phpbb\class_loader('phpbb\\', $prefix . 'phpbb/');
+
+ $prefix .= 'phpbb/';
+
+ $this->assertEquals(
+ $prefix . 'class_name.php',
+ $class_loader->resolve_path('\\phpbb\\class_name'),
+ 'Top level class'
+ );
+ $this->assertEquals(
+ $prefix . 'dir/class_name.php',
+ $class_loader->resolve_path('\\phpbb\\dir\\class_name'),
+ 'Class in a directory'
+ );
+ $this->assertEquals(
+ $prefix . 'dir/subdir/class_name.php',
+ $class_loader->resolve_path('\\phpbb\\dir\\subdir\\class_name'),
+ 'Class in a sub-directory'
+ );
+ $this->assertEquals(
+ $prefix . 'dir2/dir2.php',
+ $class_loader->resolve_path('\\phpbb\\dir2\\dir2'),
+ 'Class with name of dir within dir'
+ );
+ }
+
+ public function test_resolve_cached()
+ {
+ $cache_map = array(
+ 'class_loader___phpbb__' => array('\\phpbb\\a\\cached_name' => 'a/cached_name'),
+ 'class_loader___' => array('\\phpbb\\ext\\foo' => 'foo'),
+ );
+ $cache = new phpbb_mock_cache($cache_map);
+
+ $prefix = dirname(__FILE__) . '/';
+ $class_loader = new \phpbb\class_loader('phpbb\\', $prefix . 'phpbb/', 'php', $cache);
+ $class_loader_ext = new \phpbb\class_loader('\\', $prefix . 'phpbb/', 'php', $cache);
+
+ $prefix .= 'phpbb/';
+
+ $this->assertEquals(
+ $prefix . 'dir/class_name.php',
+ $class_loader->resolve_path('\\phpbb\\dir\\class_name'),
+ 'Class in a directory'
+ );
+
+ $this->assertFalse($class_loader->resolve_path('\\phpbb\\ext\\foo'));
+ $this->assertFalse($class_loader_ext->resolve_path('\\phpbb\\a\\cached_name'));
+
+ $this->assertEquals(
+ $prefix . 'a/cached_name.php',
+ $class_loader->resolve_path('\\phpbb\\a\\cached_name'),
+ 'Cached class found'
+ );
+
+ $this->assertEquals(
+ $prefix . 'foo.php',
+ $class_loader_ext->resolve_path('\\phpbb\\ext\\foo'),
+ 'Cached class found in alternative loader'
+ );
+
+ $cache_map['class_loader___phpbb__']['\\phpbb\\dir\\class_name'] = 'dir/class_name';
+ $cache->check($this, $cache_map);
+ }
+}
diff --git a/tests/class_loader/phpbb/class_name.php b/tests/class_loader/phpbb/class_name.php
new file mode 100644
index 0000000000..64a3fa646e
--- /dev/null
+++ b/tests/class_loader/phpbb/class_name.php
@@ -0,0 +1,8 @@
+<?php
+
+namespace phpbb;
+
+class class_name
+{
+}
+
diff --git a/tests/class_loader/phpbb/dir/class_name.php b/tests/class_loader/phpbb/dir/class_name.php
new file mode 100644
index 0000000000..1cd39a1181
--- /dev/null
+++ b/tests/class_loader/phpbb/dir/class_name.php
@@ -0,0 +1,8 @@
+<?php
+
+namespace phpbb\dir;
+
+class class_name
+{
+}
+
diff --git a/tests/class_loader/phpbb/dir/subdir/class_name.php b/tests/class_loader/phpbb/dir/subdir/class_name.php
new file mode 100644
index 0000000000..89affbc847
--- /dev/null
+++ b/tests/class_loader/phpbb/dir/subdir/class_name.php
@@ -0,0 +1,8 @@
+<?php
+
+namespace phpbb\dir\subdir;
+
+class class_name
+{
+}
+
diff --git a/tests/class_loader/phpbb/dir2/dir2.php b/tests/class_loader/phpbb/dir2/dir2.php
new file mode 100644
index 0000000000..b273511fcd
--- /dev/null
+++ b/tests/class_loader/phpbb/dir2/dir2.php
@@ -0,0 +1,8 @@
+<?php
+
+namespace phpbb;
+
+class dir2
+{
+}
+
diff --git a/tests/composer.json b/tests/composer.json
new file mode 100644
index 0000000000..057e0115a5
--- /dev/null
+++ b/tests/composer.json
@@ -0,0 +1,5 @@
+{
+ "require-dev": {
+ "facebook/webdriver": "~1.1"
+ }
+}
diff --git a/tests/composer.lock b/tests/composer.lock
new file mode 100644
index 0000000000..f172de4669
--- /dev/null
+++ b/tests/composer.lock
@@ -0,0 +1,63 @@
+{
+ "_readme": [
+ "This file locks the dependencies of your project to a known state",
+ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
+ "This file is @generated automatically"
+ ],
+ "hash": "25ad22c35c19f2b0a2331640fb6b5577",
+ "content-hash": "617c33144bd2877c3c9a78f167a871b6",
+ "packages": [],
+ "packages-dev": [
+ {
+ "name": "facebook/webdriver",
+ "version": "1.1.2",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/facebook/php-webdriver.git",
+ "reference": "0b889d7de7461439f8a3bbcca46e0f696cb27986"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/facebook/php-webdriver/zipball/0b889d7de7461439f8a3bbcca46e0f696cb27986",
+ "reference": "0b889d7de7461439f8a3bbcca46e0f696cb27986",
+ "shasum": ""
+ },
+ "require": {
+ "ext-curl": "*",
+ "php": ">=5.3.19"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "4.6.*"
+ },
+ "suggest": {
+ "phpdocumentor/phpdocumentor": "2.*"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "Facebook\\WebDriver\\": "lib/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "Apache-2.0"
+ ],
+ "description": "A PHP client for WebDriver",
+ "homepage": "https://github.com/facebook/php-webdriver",
+ "keywords": [
+ "facebook",
+ "php",
+ "selenium",
+ "webdriver"
+ ],
+ "time": "2016-06-04 00:02:34"
+ }
+ ],
+ "aliases": [],
+ "minimum-stability": "stable",
+ "stability-flags": [],
+ "prefer-stable": false,
+ "prefer-lowest": false,
+ "platform": [],
+ "platform-dev": []
+}
diff --git a/tests/compress/compress_test.php b/tests/compress/compress_test.php
index ce193cf3ba..56c406b206 100644
--- a/tests/compress/compress_test.php
+++ b/tests/compress/compress_test.php
@@ -1,11 +1,15 @@
<?php
/**
- *
- * @package testing
- * @copyright (c) 2012 phpBB Group
- * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
- *
- */
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
require_once dirname(__FILE__) . '/../../phpBB/includes/functions_admin.php';
@@ -25,6 +29,12 @@ class phpbb_compress_test extends phpbb_test_case
'dir/subdir/4.txt',
);
+ protected $conflicts = array(
+ '1_1.txt',
+ '1_2.txt',
+ 'dir/2_1.txt',
+ );
+
protected function setUp()
{
// Required for compress::add_file
@@ -88,6 +98,11 @@ class phpbb_compress_test extends phpbb_test_case
);
$compress->add_custom_file($this->path . 'dir/3.txt', 'dir/3.txt');
$compress->add_data(file_get_contents($this->path . 'dir/subdir/4.txt'), 'dir/subdir/4.txt');
+
+ // Add multiples of the same file to check conflicts are handled
+ $compress->add_file($this->path . '1.txt', $this->path);
+ $compress->add_file($this->path . '1.txt', $this->path);
+ $compress->add_file($this->path . 'dir/2.txt', $this->path);
}
protected function valid_extraction($extra = array())
@@ -150,7 +165,7 @@ class phpbb_compress_test extends phpbb_test_case
$compress->mode = 'r';
$compress->open();
$compress->extract('tests/compress/' . self::EXTRACT_DIR);
- $this->valid_extraction();
+ $this->valid_extraction($this->conflicts);
}
/**
@@ -168,6 +183,6 @@ class phpbb_compress_test extends phpbb_test_case
$compress = new compress_zip('r', $zip);
$compress->extract('tests/compress/' . self::EXTRACT_DIR);
- $this->valid_extraction();
+ $this->valid_extraction($this->conflicts);
}
}
diff --git a/tests/config/config_test.php b/tests/config/config_test.php
new file mode 100644
index 0000000000..380b4336a7
--- /dev/null
+++ b/tests/config/config_test.php
@@ -0,0 +1,124 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+class phpbb_config_test extends phpbb_test_case
+{
+ public function test_offset_exists()
+ {
+ $config = new \phpbb\config\config(array('foo' => 'bar'));
+
+ $this->assertTrue(isset($config['foo']));
+ $this->assertFalse(isset($config['foobar']));
+ }
+
+ public function test_offset_get()
+ {
+ $config = new \phpbb\config\config(array('foo' => 'bar'));
+ $this->assertEquals('bar', $config['foo']);
+ }
+
+ public function test_offset_get_missing()
+ {
+ $config = new \phpbb\config\config(array());
+ $this->assertEquals('', $config['foo']);
+ }
+
+ public function test_offset_set()
+ {
+ $config = new \phpbb\config\config(array());
+ $config['foo'] = 'x';
+ $this->assertEquals('x', $config['foo']);
+ }
+
+ public function test_offset_unset_fails()
+ {
+ $this->setExpectedTriggerError(E_USER_ERROR);
+ $config = new \phpbb\config\config(array('foo' => 'x'));
+ unset($config['foo']);
+ }
+
+ public function test_count()
+ {
+ $config = new \phpbb\config\config(array('foo' => 'bar'));
+ $this->assertEquals(1, count($config));
+ }
+
+ public function test_iterate()
+ {
+ $vars = array('foo' => '23', 'bar' => '42');
+ $config = new \phpbb\config\config($vars);
+
+ $count = 0;
+ foreach ($config as $key => $value)
+ {
+ $this->assertTrue(isset($vars[$key]));
+ $this->assertEquals($vars[$key], $value);
+
+ $count++;
+ }
+
+ $this->assertEquals(count($vars), $count);
+ }
+
+ public function test_set_overwrite()
+ {
+ $config = new \phpbb\config\config(array('foo' => 'x'));
+ $config->set('foo', 'bar');
+ $this->assertEquals('bar', $config['foo']);
+ }
+
+ public function test_set_new()
+ {
+ $config = new \phpbb\config\config(array());
+ $config->set('foo', 'bar');
+ $this->assertEquals('bar', $config['foo']);
+ }
+
+ public function test_set_atomic_overwrite()
+ {
+ $config = new \phpbb\config\config(array('foo' => 'bar'));
+ $this->assertTrue($config->set_atomic('foo', 'bar', '23'));
+ $this->assertEquals('23', $config['foo']);
+ }
+
+ public function test_set_atomic_new()
+ {
+ $config = new \phpbb\config\config(array());
+ $this->assertTrue($config->set_atomic('foo', false, '23'));
+ $this->assertEquals('23', $config['foo']);
+ }
+
+ public function test_set_atomic_failure()
+ {
+ $config = new \phpbb\config\config(array('foo' => 'bar'));
+ $this->assertFalse($config->set_atomic('foo', 'wrong', '23'));
+ $this->assertEquals('bar', $config['foo']);
+ }
+
+ public function test_increment()
+ {
+ $config = new \phpbb\config\config(array('foo' => '23'));
+ $config->increment('foo', 3);
+ $this->assertEquals(26, $config['foo']);
+ $config->increment('foo', 1);
+ $this->assertEquals(27, $config['foo']);
+ }
+
+ public function test_delete()
+ {
+ $config = new \phpbb\config\config(array('foo' => 'bar'));
+
+ $config->delete('foo');
+ $this->assertFalse(isset($config['foo']));
+ }
+}
diff --git a/tests/config/db_test.php b/tests/config/db_test.php
new file mode 100644
index 0000000000..713e6cb6d9
--- /dev/null
+++ b/tests/config/db_test.php
@@ -0,0 +1,168 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+class phpbb_config_db_test extends phpbb_database_test_case
+{
+ private $cache;
+ private $db;
+ private $config;
+
+ public function getDataSet()
+ {
+ return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/config.xml');
+ }
+
+ public function setUp()
+ {
+ parent::setUp();
+
+ $this->cache = new phpbb_mock_cache;
+ $this->db = $this->new_dbal();
+ $this->config = new \phpbb\config\db($this->db, $this->cache, 'phpbb_config');
+ }
+
+ public function test_load_config()
+ {
+ $this->assertEquals('23', $this->config['foo']);
+ $this->assertEquals('42', $this->config['bar']);
+ }
+
+ public function test_load_cached()
+ {
+ $cache = new phpbb_mock_cache(array('config' => array('x' => 'y')));
+ $this->config = new \phpbb\config\db($this->db, $cache, 'phpbb_config');
+
+ $this->assertTrue(!isset($this->config['foo']));
+ $this->assertEquals('42', $this->config['bar']);
+
+ $this->assertEquals('y', $this->config['x']);
+ }
+
+ public function test_offset_set()
+ {
+ $this->config['foo'] = 'x'; // temporary set
+ $this->assertEquals('x', $this->config['foo']);
+
+ $config2 = new \phpbb\config\db($this->db, $this->cache, 'phpbb_config');
+ $this->assertEquals('23', $config2['foo']);
+ }
+
+ public function test_set_overwrite()
+ {
+ $this->config->set('foo', '17');
+ $this->assertEquals('17', $this->config['foo']);
+
+ // re-read config and populate cache
+ $config2 = new \phpbb\config\db($this->db, $this->cache, 'phpbb_config');
+ $this->cache->checkVar($this, 'config', array('foo' => '17'));
+ }
+
+ public function test_set_overwrite_uncached()
+ {
+ $this->config->set('bar', '17', false);
+
+ // re-read config and populate cache
+ $config2 = new \phpbb\config\db($this->db, $this->cache, 'phpbb_config');
+ $this->cache->checkVar($this, 'config', array('foo' => '23'));
+ }
+
+ public function test_set_new()
+ {
+ $this->config->set('foobar', '5');
+ $this->assertEquals('5', $this->config['foobar']);
+
+ // re-read config and populate cache
+ $config2 = new \phpbb\config\db($this->db, $this->cache, 'phpbb_config');
+ $this->cache->checkVar($this, 'config', array('foo' => '23', 'foobar' => '5'));
+ }
+
+ public function test_set_new_uncached()
+ {
+ $this->config->set('foobar', '5', false);
+ $this->assertEquals('5', $this->config['foobar']);
+
+ // re-read config and populate cache
+ $config2 = new \phpbb\config\db($this->db, $this->cache, 'phpbb_config');
+ $this->cache->checkVar($this, 'config', array('foo' => '23'));
+ }
+
+ public function test_set_atomic_overwrite()
+ {
+ $this->assertTrue($this->config->set_atomic('foo', '23', '17'));
+ $this->assertEquals('17', $this->config['foo']);
+ }
+
+ public function test_set_atomic_new()
+ {
+ $this->assertTrue($this->config->set_atomic('foobar', false, '5'));
+ $this->assertEquals('5', $this->config['foobar']);
+ }
+
+ public function test_set_atomic_failure()
+ {
+ $this->assertFalse($this->config->set_atomic('foo', 'wrong', '17'));
+ $this->assertEquals('23', $this->config['foo']);
+ }
+
+ public function test_increment()
+ {
+ $this->config->increment('foo', 3);
+ $this->assertEquals(26, $this->config['foo']);
+ $this->config->increment('foo', 1);
+ $this->assertEquals(27, $this->config['foo']);
+ }
+
+ public function test_increment_new()
+ {
+ $this->config->increment('foobar', 3);
+ $this->assertEquals(3, $this->config['foobar']);;
+ }
+
+ public function test_delete()
+ {
+ $this->assertTrue(isset($this->config['foo']));
+ $this->config->delete('foo');
+ $this->cache->checkVarUnset($this, 'foo');
+ $this->assertFalse(isset($this->config['foo']));
+
+ // re-read config and populate cache
+ $cache2 = new phpbb_mock_cache;
+ $config2 = new \phpbb\config\db($this->db, $cache2, 'phpbb_config');
+ $cache2->checkVarUnset($this, 'foo');
+ $this->assertFalse(isset($config2['foo']));
+ }
+
+ public function test_delete_write_read_not_cacheable()
+ {
+ // bar is dynamic
+ $this->assertTrue(isset($this->config['bar']));
+ $this->config->delete('bar');
+ $this->cache->checkVarUnset($this, 'bar');
+ $this->assertFalse(isset($this->config['bar']));
+
+ $this->config->set('bar', 'new bar', false);
+ $this->assertEquals('new bar', $this->config['bar']);
+ }
+
+ public function test_delete_write_read_cacheable()
+ {
+ // foo is not dynamic
+ $this->assertTrue(isset($this->config['foo']));
+ $this->config->delete('foo');
+ $this->cache->checkVarUnset($this, 'foo');
+ $this->assertFalse(isset($this->config['foo']));
+
+ $this->config->set('foo', 'new foo', true);
+ $this->assertEquals('new foo', $this->config['foo']);
+ }
+}
diff --git a/tests/config/db_text_test.php b/tests/config/db_text_test.php
new file mode 100644
index 0000000000..a91abf990f
--- /dev/null
+++ b/tests/config/db_text_test.php
@@ -0,0 +1,127 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+class phpbb_config_db_text_test extends phpbb_database_test_case
+{
+ /** @var \phpbb\config\db_text */
+ protected $config_text;
+
+ public function getDataSet()
+ {
+ return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/config_text.xml');
+ }
+
+ public function setUp()
+ {
+ parent::setUp();
+
+ $this->db = $this->new_dbal();
+ $this->config_text = new \phpbb\config\db_text($this->db, 'phpbb_config_text');
+ }
+
+ public function test_get()
+ {
+ $this->assertSame('23', $this->config_text->get('foo'));
+ $this->assertSame('string-de-ding', $this->config_text->get('meh'));
+ }
+
+ public function test_get_nonexisting()
+ {
+ $this->assertNull($this->config_text->get('noooooo'));
+ }
+
+ public function test_set_new_get()
+ {
+ $this->config_text->set('barz', 'phpbb');
+ $this->assertSame('phpbb', $this->config_text->get('barz'));
+ }
+
+ public function test_set_replace_get()
+ {
+ $this->config_text->set('foo', '24');
+ $this->assertSame('24', $this->config_text->get('foo'));
+ }
+
+ public function test_set_same_value_get()
+ {
+ $this->config_text->set('foo', '23');
+ $this->assertSame('23', $this->config_text->get('foo'));
+ }
+
+ public function test_set_get_long_string()
+ {
+ $expected = str_repeat('ABC', 10000);
+ $this->config_text->set('long', $expected);
+ $this->assertSame($expected, $this->config_text->get('long'));
+ }
+
+ public function test_delete_get()
+ {
+ $this->config_text->delete('foo');
+ $this->assertNull($this->config_text->get('foo'));
+
+ $this->assertSame('42', $this->config_text->get('bar'));
+ $this->assertSame('string-de-ding', $this->config_text->get('meh'));
+ }
+
+ public function test_get_array_empty()
+ {
+ $this->assertEmpty($this->config_text->get_array(array('key1', 'key2')));
+ }
+
+ public function test_get_array_subset()
+ {
+ $expected = array(
+ 'bar' => '42',
+ 'foo' => '23',
+ );
+
+ $actual = $this->config_text->get_array(array_keys($expected));
+ ksort($actual);
+
+ $this->assertSame($expected, $actual);
+ }
+
+ public function test_set_array_get_array_subset()
+ {
+ $set_array_param = array(
+ // New entry
+ 'baby' => 'phpBB',
+ // Entry update
+ 'bar' => '64',
+ // Entry update - same value
+ 'foo' => '23',
+ );
+
+ $this->config_text->set_array($set_array_param);
+
+ $expected = array_merge($set_array_param, array(
+ 'foo' => '23',
+ ));
+
+ $actual = $this->config_text->get_array(array_keys($expected));
+ ksort($actual);
+
+ $this->assertSame($expected, $actual);
+ }
+
+ public function test_delete_array_get_remaining()
+ {
+ $this->config_text->delete_array(array('foo', 'bar'));
+
+ $this->assertNull($this->config_text->get('bar'));
+ $this->assertNull($this->config_text->get('foo'));
+
+ $this->assertSame('string-de-ding', $this->config_text->get('meh'));
+ }
+}
diff --git a/tests/config/fixtures/config.xml b/tests/config/fixtures/config.xml
new file mode 100644
index 0000000000..9d395b685c
--- /dev/null
+++ b/tests/config/fixtures/config.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<dataset>
+ <table name="phpbb_config">
+ <column>config_name</column>
+ <column>config_value</column>
+ <column>is_dynamic</column>
+ <row>
+ <value>foo</value>
+ <value>23</value>
+ <value>0</value>
+ </row>
+ <row>
+ <value>bar</value>
+ <value>42</value>
+ <value>1</value>
+ </row>
+ </table>
+</dataset>
diff --git a/tests/config/fixtures/config_text.xml b/tests/config/fixtures/config_text.xml
new file mode 100644
index 0000000000..5acac13ea3
--- /dev/null
+++ b/tests/config/fixtures/config_text.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<dataset>
+ <table name="phpbb_config_text">
+ <column>config_name</column>
+ <column>config_value</column>
+ <row>
+ <value>foo</value>
+ <value>23</value>
+ </row>
+ <row>
+ <value>bar</value>
+ <value>42</value>
+ </row>
+ <row>
+ <value>meh</value>
+ <value>string-de-ding</value>
+ </row>
+ </table>
+</dataset>
diff --git a/tests/config_php_file_test.php b/tests/config_php_file_test.php
new file mode 100644
index 0000000000..c319678108
--- /dev/null
+++ b/tests/config_php_file_test.php
@@ -0,0 +1,40 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+class phpbb_config_php_file_test extends phpbb_test_case
+{
+ public function test_default()
+ {
+ $config_php = new \phpbb\config_php_file(dirname( __FILE__ ) . '/fixtures/', 'php');
+ $this->assertSame('bar', $config_php->get('foo'));
+ $this->assertNull($config_php->get('bar'));
+ $this->assertSame(array('foo' => 'bar', 'foo_foo' => 'bar bar'), $config_php->get_all());
+ }
+
+ public function test_set_config_file()
+ {
+ $config_php = new \phpbb\config_php_file(dirname( __FILE__ ) . '/fixtures/', 'php');
+ $config_php->set_config_file(dirname( __FILE__ ) . '/fixtures/config_other.php');
+ $this->assertSame('foo', $config_php->get('bar'));
+ $this->assertNull($config_php->get('foo'));
+ $this->assertSame(array('bar' => 'foo', 'bar_bar' => 'foo foo'), $config_php->get_all());
+ }
+
+ public function test_non_existent_file()
+ {
+ $config_php = new \phpbb\config_php_file(dirname( __FILE__ ) . '/fixtures/non_existent/', 'php');
+ $this->assertNull($config_php->get('bar'));
+ $this->assertNull($config_php->get('foo'));
+ $this->assertSame(array(), $config_php->get_all());
+ }
+}
diff --git a/tests/console/cache/purge_test.php b/tests/console/cache/purge_test.php
new file mode 100644
index 0000000000..96988c1028
--- /dev/null
+++ b/tests/console/cache/purge_test.php
@@ -0,0 +1,95 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+use Symfony\Component\Console\Application;
+use Symfony\Component\Console\Tester\CommandTester;
+use phpbb\console\command\cache\purge;
+
+require_once dirname(__FILE__) . '/../../../phpBB/includes/functions_admin.php';
+
+class phpbb_console_command_cache_purge_test extends phpbb_test_case
+{
+ protected $cache_dir;
+ protected $cache;
+ protected $command_name;
+ protected $db;
+ protected $config;
+
+ public function __construct()
+ {
+ $this->cache_dir = dirname(__FILE__) . '/tmp/cache/';
+ }
+
+ protected function setUp()
+ {
+ if (file_exists($this->cache_dir))
+ {
+ // cache directory possibly left after aborted
+ // or failed run earlier
+ $this->remove_cache_dir();
+ }
+ $this->create_cache_dir();
+
+ $this->cache = new \phpbb\cache\driver\file($this->cache_dir);
+
+ $this->db = $this->getMock('\phpbb\db\driver\driver_interface');
+
+ $this->config = new \phpbb\config\config(array('assets_version' => 1));
+ $this->user = $this->getMock('\phpbb\user', array(), array('\phpbb\datetime'));
+ }
+
+ public function test_purge()
+ {
+ $this->cache->put('test_key', 'test_value');
+
+ $this->assertEquals(
+ 'test_value',
+ $this->cache->get('test_key'),
+ 'File ACM put and get'
+ );
+
+ $command_tester = $this->get_command_tester();
+ $exit_status = $command_tester->execute(array('command' => $this->command_name));
+
+ $this->assertSame(false, $this->cache->get('test_key'));
+ $this->assertSame(2, $this->config['assets_version']);
+ }
+
+ private function create_cache_dir()
+ {
+ $this->get_test_case_helpers()->makedirs($this->cache_dir);
+ }
+
+ private function remove_cache_dir()
+ {
+ $iterator = new DirectoryIterator($this->cache_dir);
+ foreach ($iterator as $file)
+ {
+ if ($file != '.' && $file != '..')
+ {
+ unlink($this->cache_dir . '/' . $file);
+ }
+ }
+ rmdir($this->cache_dir);
+ }
+
+ public function get_command_tester()
+ {
+ $application = new Application();
+ $application->add(new purge($this->user, $this->cache, $this->db, $this->getMock('\phpbb\auth\auth'), new \phpbb\log\null(), $this->config));
+
+ $command = $application->find('cache:purge');
+ $this->command_name = $command->getName();
+ return new CommandTester($command);
+ }
+}
diff --git a/tests/console/config/config_test.php b/tests/console/config/config_test.php
new file mode 100644
index 0000000000..7c098af004
--- /dev/null
+++ b/tests/console/config/config_test.php
@@ -0,0 +1,251 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+use Symfony\Component\Console\Application;
+use Symfony\Component\Console\Tester\CommandTester;
+
+class phpbb_console_command_config_test extends phpbb_test_case
+{
+ protected $config;
+ protected $command_name;
+ protected $user;
+
+ public function setUp()
+ {
+ $this->config = new \phpbb\config\config(array());
+
+ $this->user = $this->getMock('\phpbb\user', array(), array('\phpbb\datetime'));
+ $this->user->method('lang')->will($this->returnArgument(0));
+ }
+
+ public function test_set_dynamic()
+ {
+ $this->assertEmpty($this->config);
+
+ $command_tester = $this->get_command_tester('set');
+ $command_tester->execute(array(
+ 'command' => $this->command_name,
+ 'key' => 'test_key',
+ 'value' => 'test_value',
+ '--dynamic' => true,
+ ));
+
+ $this->assertSame($this->config['test_key'], 'test_value');
+ }
+
+ public function test_set_no_dynamic()
+ {
+ $this->assertEmpty($this->config);
+
+ $command_tester = $this->get_command_tester('set');
+ $command_tester->execute(array(
+ 'command' => $this->command_name,
+ 'key' => 'test_key',
+ 'value' => 'test_value',
+ '--dynamic' => false,
+ ));
+
+ $this->assertSame($this->config['test_key'], 'test_value');
+ }
+
+ public function test_set_atomic_dynamic()
+ {
+ $this->assertEmpty($this->config);
+
+ $this->config->set('test_key', 'old_value', true);
+ $this->assertSame($this->config['test_key'], 'old_value');
+
+ $command_tester = $this->get_command_tester('set_atomic');
+ $command_tester->execute(array(
+ 'command' => $this->command_name,
+ 'key' => 'test_key',
+ 'old' => 'old_value',
+ 'new' => 'new_value',
+ '--dynamic' => true,
+ ));
+
+ $this->assertSame($this->config['test_key'], 'new_value');
+ }
+
+ public function test_set_atomic_no_dynamic()
+ {
+ $this->assertEmpty($this->config);
+
+ $this->config->set('test_key', 'old_value', false);
+ $this->assertSame($this->config['test_key'], 'old_value');
+
+ $command_tester = $this->get_command_tester('set_atomic');
+ $command_tester->execute(array(
+ 'command' => $this->command_name,
+ 'key' => 'test_key',
+ 'old' => 'old_value',
+ 'new' => 'new_value',
+ '--dynamic' => false,
+ ));
+
+ $this->assertSame($this->config['test_key'], 'new_value');
+ }
+
+ public function test_set_atomic_error_dynamic()
+ {
+ $this->assertEmpty($this->config);
+
+ $this->config->set('test_key', 'wrong_value', true);
+ $this->assertSame($this->config['test_key'], 'wrong_value');
+
+ $command_tester = $this->get_command_tester('set_atomic');
+ $command_tester->execute(array(
+ 'command' => $this->command_name,
+ 'key' => 'test_key',
+ 'old' => 'old_value',
+ 'new' => 'new_value',
+ '--dynamic' => true,
+ ));
+
+ $this->assertSame($this->config['test_key'], 'wrong_value');
+ }
+
+ public function test_get_no_new_line()
+ {
+ $this->config->set('test_key', 'test_value', false);
+ $this->assertSame($this->config['test_key'], 'test_value');
+
+ $command_tester = $this->get_command_tester('get');
+ $command_tester->execute(array(
+ 'command' => $this->command_name,
+ 'key' => 'test_key',
+ '--no-newline' => true,
+ ));
+
+ $this->assertSame($this->config['test_key'], $command_tester->getDisplay());
+ }
+
+ public function test_get_new_line()
+ {
+ $this->config->set('test_key', 'test_value', false);
+ $this->assertSame($this->config['test_key'], 'test_value');
+
+ $command_tester = $this->get_command_tester('get');
+ $command_tester->execute(array(
+ 'command' => $this->command_name,
+ 'key' => 'test_key',
+ '--no-newline' => false,
+ ));
+
+ $this->assertSame($this->config['test_key'] . PHP_EOL, $command_tester->getDisplay());
+ }
+
+ public function test_get_error()
+ {
+ $this->config->set('test_key', 'test_value', false);
+ $this->assertSame($this->config['test_key'], 'test_value');
+
+ $command_tester = $this->get_command_tester('get');
+ $command_tester->execute(array(
+ 'command' => $this->command_name,
+ 'key' => 'wrong_key',
+ '--no-newline' => false,
+ ));
+
+ $this->assertContains('CLI_CONFIG_NOT_EXISTS', $command_tester->getDisplay());
+ }
+
+ public function test_increment_dynamic()
+ {
+ $this->config->set('test_key', 0, false);
+ $this->assertSame($this->config['test_key'], 0);
+
+ $command_tester = $this->get_command_tester('increment');
+ $command_tester->execute(array(
+ 'command' => $this->command_name,
+ 'key' => 'test_key',
+ 'increment' => 2,
+ '--dynamic' => true,
+ ));
+
+ $this->assertContains('CLI_CONFIG_INCREMENT_SUCCESS', $command_tester->getDisplay());
+ $this->assertSame(2, $this->config['test_key']);
+ }
+
+ public function test_increment_no_dynamic()
+ {
+ $this->config->set('test_key', 0, false);
+ $this->assertSame($this->config['test_key'], 0);
+
+ $command_tester = $this->get_command_tester('increment');
+ $command_tester->execute(array(
+ 'command' => $this->command_name,
+ 'key' => 'test_key',
+ 'increment' => 2,
+ '--dynamic' => false,
+ ));
+
+ $this->assertContains('CLI_CONFIG_INCREMENT_SUCCESS', $command_tester->getDisplay());
+ $this->assertSame(2, $this->config['test_key']);
+ }
+
+ public function test_increment_no_set()
+ {
+ $this->assertEmpty($this->config);
+
+ $command_tester = $this->get_command_tester('increment');
+ $command_tester->execute(array(
+ 'command' => $this->command_name,
+ 'key' => 'test_key',
+ 'increment' => 2,
+ '--dynamic' => true,
+ ));
+
+ $this->assertContains('CLI_CONFIG_INCREMENT_SUCCESS', $command_tester->getDisplay());
+ $this->assertSame(2, $this->config['test_key']);
+ }
+
+ public function test_delete_ok()
+ {
+ $this->config->set('test_key', 'test_value', false);
+ $this->assertSame($this->config['test_key'], 'test_value');
+
+ $command_tester = $this->get_command_tester('delete');
+ $command_tester->execute(array(
+ 'command' => $this->command_name,
+ 'key' => 'test_key',
+ ));
+
+ $this->assertContains('CLI_CONFIG_DELETE_SUCCESS', $command_tester->getDisplay());
+ $this->assertEmpty($this->config);
+ }
+
+ public function test_delete_error()
+ {
+ $this->assertEmpty($this->config);
+
+ $command_tester = $this->get_command_tester('delete');
+ $command_tester->execute(array(
+ 'command' => $this->command_name,
+ 'key' => 'wrong_key',
+ ));
+
+ $this->assertContains('CLI_CONFIG_NOT_EXISTS', $command_tester->getDisplay());
+ $this->assertEmpty($this->config);
+ }
+
+ public function get_command_tester($class_name)
+ {
+ $command_complete_name = '\phpbb\console\command\config' . '\\' . $class_name;
+ $application = new Application();
+ $application->add(new $command_complete_name($this->user, $this->config));
+ $command = $application->find('config:' . $this->command_name);
+ $this->command_name = $command->getName();
+ return new CommandTester($command);
+ }
+}
diff --git a/tests/console/cron/cron_list_test.php b/tests/console/cron/cron_list_test.php
new file mode 100644
index 0000000000..22423304be
--- /dev/null
+++ b/tests/console/cron/cron_list_test.php
@@ -0,0 +1,103 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+require_once dirname(__FILE__) . '/tasks/simple_ready.php';
+require_once dirname(__FILE__) . '/tasks/simple_not_ready.php';
+
+use Symfony\Component\Console\Application;
+use Symfony\Component\Console\Tester\CommandTester;
+use phpbb\console\command\cron\cron_list;
+
+class phpbb_console_command_cron_list_test extends phpbb_test_case
+{
+ /** @var \phpbb\cron\manager */
+ protected $cron_manager;
+
+ /** @var \phpbb\user */
+ protected $user;
+
+ protected $command_name;
+
+ protected $command_tester;
+
+ protected function setUp()
+ {
+ $this->user = $this->getMock('\phpbb\user', array(), array('\phpbb\datetime'));
+ $this->user->method('lang')->will($this->returnArgument(0));
+ }
+
+ public function test_no_task()
+ {
+ $this->initiate_test(0, 0);
+ $this->assertContains('CRON_NO_TASKS', $this->command_tester->getDisplay());
+ }
+
+ public function test_only_ready()
+ {
+ $this->initiate_test(2, 0);
+ $this->assertContains('TASKS_READY command1 command2', preg_replace('/\s+/', ' ', trim($this->command_tester->getDisplay())));
+ }
+
+ public function test_only_not_ready()
+ {
+ $this->initiate_test(0, 2);
+ $this->assertContains('TASKS_NOT_READY command1 command2', preg_replace('/\s+/', ' ', trim($this->command_tester->getDisplay())));
+ }
+
+ public function test_both_ready()
+ {
+ $this->initiate_test(2, 2);
+ $this->assertSame('TASKS_READY command1 command2 TASKS_NOT_READY command3 command4', preg_replace('/\s+/', ' ', trim($this->command_tester->getDisplay())));
+ }
+
+ public function get_cron_manager(array $tasks)
+ {
+ global $pathEx, $phpbb_root_path;
+ $i = 1;
+ foreach ($tasks as $task)
+ {
+ $task->set_name('command' . $i);
+ $i++;
+ }
+ $this->cron_manager = new \phpbb\cron\manager($tasks, $phpbb_root_path, $pathEx);
+ }
+
+ public function get_command_tester()
+ {
+ $application = new Application();
+ $application->add(new cron_list($this->user, $this->cron_manager));
+
+ $command = $application->find('cron:list');
+ $this->command_name = $command->getName();
+ return new CommandTester($command);
+ }
+
+ public function initiate_test($number_ready, $number_not_ready)
+ {
+ $tasks = array();
+
+ for ($i = 0; $i < $number_ready; $i++)
+ {
+ $tasks[] = new phpbb_cron_task_simple_ready();
+ }
+
+ for ($i = 0; $i < $number_not_ready; $i++)
+ {
+ $tasks[] = new phpbb_cron_task_simple_not_ready();
+ }
+
+ $this->get_cron_manager($tasks);
+ $this->command_tester = $this->get_command_tester();
+ $this->command_tester->execute(array('command' => $this->command_name), array('decorated' => false));
+ }
+}
diff --git a/tests/console/cron/fixtures/config.xml b/tests/console/cron/fixtures/config.xml
new file mode 100644
index 0000000000..2cb683d409
--- /dev/null
+++ b/tests/console/cron/fixtures/config.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<dataset>
+ <table name="phpbb_config">
+ <column>config_name</column>
+ <column>config_value</column>
+ <column>is_dynamic</column>
+ </table>
+</dataset>
diff --git a/tests/console/cron/run_test.php b/tests/console/cron/run_test.php
new file mode 100644
index 0000000000..f76e967484
--- /dev/null
+++ b/tests/console/cron/run_test.php
@@ -0,0 +1,158 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+use Symfony\Component\Console\Application;
+use Symfony\Component\Console\Tester\CommandTester;
+use phpbb\console\command\cron\run;
+
+require_once dirname(__FILE__) . '/tasks/simple.php';
+require_once dirname(__FILE__) . '/../../../phpBB/includes/functions.php';
+
+class phpbb_console_command_cron_run_test extends phpbb_database_test_case
+{
+ protected $db;
+ protected $config;
+ protected $lock;
+ protected $user;
+ protected $cron_manager;
+ protected $command_name;
+ protected $task;
+
+ public function getDataSet()
+ {
+ return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/config.xml');
+ }
+
+ public function setUp()
+ {
+ global $db, $config, $phpbb_root_path, $phpEx;
+
+ $db = $this->db = $this->new_dbal();
+ $config = $this->config = new \phpbb\config\config(array('cron_lock' => '0'));
+ set_config(null, null, null, $this->config);
+ $this->lock = new \phpbb\lock\db('cron_lock', $this->config, $this->db);
+
+ $this->user = $this->getMock('\phpbb\user', array(), array('\phpbb\datetime'));
+ $this->user->method('lang')->will($this->returnArgument(0));
+
+ $this->task = new phpbb_cron_task_simple();
+ $tasks = array(
+ $this->task,
+ );
+ $this->cron_manager = new \phpbb\cron\manager($tasks, $phpbb_root_path, $phbEx);
+
+ $this->assertSame('0', $config['cron_lock']);
+ }
+
+ public function test_normal_use()
+ {
+ $command_tester = $this->get_command_tester();
+ $exit_status = $command_tester->execute(array('command' => $this->command_name));
+
+ $this->assertSame('', $command_tester->getDisplay());
+ $this->assertSame(true, $this->task->executed);
+ $this->assertSame(0, $exit_status);
+ $this->assertSame(false, $this->lock->owns_lock());
+ }
+
+ public function test_verbose_mode()
+ {
+ $command_tester = $this->get_command_tester();
+ $exit_status = $command_tester->execute(array('command' => $this->command_name, '--verbose' => true));
+
+ $this->assertContains('RUNNING_TASK', $command_tester->getDisplay());
+ $this->assertSame(true, $this->task->executed);
+ $this->assertSame(0, $exit_status);
+ $this->assertSame(false, $this->lock->owns_lock());
+ }
+
+ public function test_error_lock()
+ {
+ $this->lock->acquire();
+ $command_tester = $this->get_command_tester();
+ $exit_status = $command_tester->execute(array('command' => $this->command_name));
+
+ $this->assertContains('CRON_LOCK_ERROR', $command_tester->getDisplay());
+ $this->assertSame(false, $this->task->executed);
+ $this->assertSame(1, $exit_status);
+ }
+
+ public function test_no_task()
+ {
+ $tasks = array(
+ );
+ $this->cron_manager = new \phpbb\cron\manager($tasks, $phpbb_root_path, $phpEx);
+ $command_tester = $this->get_command_tester();
+ $exit_status = $command_tester->execute(array('command' => $this->command_name));
+
+ $this->assertSame('', $command_tester->getDisplay());
+ $this->assertSame(0, $exit_status);
+ $this->assertSame(false, $this->lock->owns_lock());
+ }
+
+ public function test_no_task_verbose()
+ {
+ $tasks = array(
+ );
+ $this->cron_manager = new \phpbb\cron\manager($tasks, $phpbb_root_path, $phpEx);
+ $command_tester = $this->get_command_tester();
+ $exit_status = $command_tester->execute(array('command' => $this->command_name, '--verbose' => true));
+
+ $this->assertContains('CRON_NO_TASK', $command_tester->getDisplay());
+ $this->assertSame(0, $exit_status);
+ $this->assertSame(false, $this->lock->owns_lock());
+ }
+
+ public function test_arg_valid()
+ {
+ $command_tester = $this->get_command_tester();
+ $exit_status = $command_tester->execute(array('command' => $this->command_name, 'name' => 'phpbb_cron_task_simple'));
+
+ $this->assertSame('', $command_tester->getDisplay());
+ $this->assertSame(true, $this->task->executed);
+ $this->assertSame(0, $exit_status);
+ $this->assertSame(false, $this->lock->owns_lock());
+ }
+
+ public function test_arg_invalid()
+ {
+ $command_tester = $this->get_command_tester();
+ $exit_status = $command_tester->execute(array('command' => $this->command_name, 'name' => 'foo'));
+
+ $this->assertContains('CRON_NO_SUCH_TASK', $command_tester->getDisplay());
+ $this->assertSame(false, $this->task->executed);
+ $this->assertSame(2, $exit_status);
+ $this->assertSame(false, $this->lock->owns_lock());
+ }
+
+ public function test_arg_valid_verbose()
+ {
+ $command_tester = $this->get_command_tester();
+ $exit_status = $command_tester->execute(array('command' => $this->command_name, 'name' => 'phpbb_cron_task_simple', '--verbose' => true));
+
+ $this->assertContains('RUNNING_TASK', $command_tester->getDisplay());
+ $this->assertSame(true, $this->task->executed);
+ $this->assertSame(0, $exit_status);
+ $this->assertSame(false, $this->lock->owns_lock());
+ }
+
+ public function get_command_tester()
+ {
+ $application = new Application();
+ $application->add(new run($this->user, $this->cron_manager, $this->lock));
+
+ $command = $application->find('cron:run');
+ $this->command_name = $command->getName();
+ return new CommandTester($command);
+ }
+}
diff --git a/tests/console/cron/tasks/simple.php b/tests/console/cron/tasks/simple.php
new file mode 100644
index 0000000000..194c52afe1
--- /dev/null
+++ b/tests/console/cron/tasks/simple.php
@@ -0,0 +1,27 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+class phpbb_cron_task_simple extends \phpbb\cron\task\base
+{
+ public $executed = false;
+
+ public function get_name()
+ {
+ return get_class($this);
+ }
+
+ public function run()
+ {
+ $this->executed = true;
+ }
+}
diff --git a/tests/console/cron/tasks/simple_not_ready.php b/tests/console/cron/tasks/simple_not_ready.php
new file mode 100644
index 0000000000..887768e5fe
--- /dev/null
+++ b/tests/console/cron/tasks/simple_not_ready.php
@@ -0,0 +1,13 @@
+<?php
+
+class phpbb_cron_task_simple_not_ready extends \phpbb\cron\task\base
+{
+ public function run()
+ {
+ }
+
+ public function should_run()
+ {
+ return false;
+ }
+}
diff --git a/tests/console/cron/tasks/simple_ready.php b/tests/console/cron/tasks/simple_ready.php
new file mode 100644
index 0000000000..47970e104f
--- /dev/null
+++ b/tests/console/cron/tasks/simple_ready.php
@@ -0,0 +1,8 @@
+<?php
+
+class phpbb_cron_task_simple_ready extends \phpbb\cron\task\base
+{
+ public function run()
+ {
+ }
+}
diff --git a/tests/content_visibility/delete_post_test.php b/tests/content_visibility/delete_post_test.php
new file mode 100644
index 0000000000..6ad6351a0c
--- /dev/null
+++ b/tests/content_visibility/delete_post_test.php
@@ -0,0 +1,350 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions_admin.php';
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions_content.php';
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions_posting.php';
+require_once dirname(__FILE__) . '/../../phpBB/includes/utf/utf_tools.php';
+require_once dirname(__FILE__) . '/../mock/search.php';
+
+class phpbb_content_visibility_delete_post_test extends phpbb_database_test_case
+{
+ public function getDataSet()
+ {
+ return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/delete_post.xml');
+ }
+
+ public function delete_post_data()
+ {
+ $info_data = array(
+ 'topic_first_post_id' => 1,
+ 'topic_last_post_id' => 3,
+ 'topic_posts_approved' => 3,
+ 'topic_posts_unapproved' => 0,
+ 'topic_posts_softdeleted' => 0,
+ 'topic_visibility' => ITEM_APPROVED,
+ 'post_time' => 2,
+ 'post_visibility' => ITEM_APPROVED,
+ 'post_postcount' => true,
+ 'poster_id' => 1,
+ 'post_reported' => false,
+ );
+
+ return array(
+ array(
+ 1, 1, 2,
+ array_merge($info_data, array(
+ 'post_time' => 2,
+ )),
+ false, 'harddelete',
+ array(
+ array('post_id' => 1, 'post_visibility' => ITEM_APPROVED, 'post_delete_reason' => ''),
+ //array('post_id' => 2, 'post_visibility' => ITEM_APPROVED, 'post_delete_reason' => ''),
+ array('post_id' => 3, 'post_visibility' => ITEM_APPROVED, 'post_delete_reason' => ''),
+ ),
+ array(
+ array(
+ 'topic_visibility' => ITEM_APPROVED,
+ 'topic_first_post_id' => 1,
+ 'topic_last_post_id' => 3,
+ 'topic_posts_approved' => 2,
+ 'topic_posts_unapproved' => 0,
+ 'topic_posts_softdeleted' => 0,
+ 'topic_delete_reason' => '',
+ ),
+ ),
+ array(
+ array('forum_posts_approved' => 2, 'forum_posts_unapproved' => 0, 'forum_posts_softdeleted' => 0, 'forum_topics_approved' => 1, 'forum_topics_unapproved' => 0, 'forum_topics_softdeleted' => 0, 'forum_last_post_id' => 3),
+ ),
+ array(
+ array('user_posts' => 3),
+ ),
+ ),
+ array(
+ 1, 1, 1,
+ array_merge($info_data, array(
+ 'post_time' => 1,
+ )),
+ false, 'harddelete',
+ array(
+ //array('post_id' => 1, 'post_visibility' => ITEM_APPROVED, 'post_delete_reason' => ''),
+ array('post_id' => 2, 'post_visibility' => ITEM_APPROVED, 'post_delete_reason' => ''),
+ array('post_id' => 3, 'post_visibility' => ITEM_APPROVED, 'post_delete_reason' => ''),
+ ),
+ array(
+ array(
+ 'topic_visibility' => ITEM_APPROVED,
+ 'topic_first_post_id' => 2,
+ 'topic_last_post_id' => 3,
+ 'topic_posts_approved' => 2,
+ 'topic_posts_unapproved' => 0,
+ 'topic_posts_softdeleted' => 0,
+ 'topic_delete_reason' => '',
+ ),
+ ),
+ array(
+ array('forum_posts_approved' => 2, 'forum_posts_unapproved' => 0, 'forum_posts_softdeleted' => 0, 'forum_topics_approved' => 1, 'forum_topics_unapproved' => 0, 'forum_topics_softdeleted' => 0, 'forum_last_post_id' => 3),
+ ),
+ array(
+ array('user_posts' => 3),
+ ),
+ ),
+ array(
+ 1, 1, 3,
+ array_merge($info_data, array(
+ 'post_time' => 3,
+ )),
+ false, 'harddelete',
+ array(
+ array('post_id' => 1, 'post_visibility' => ITEM_APPROVED, 'post_delete_reason' => ''),
+ array('post_id' => 2, 'post_visibility' => ITEM_APPROVED, 'post_delete_reason' => ''),
+ //array('post_id' => 3, 'post_visibility' => ITEM_APPROVED, 'post_delete_reason' => ''),
+ ),
+ array(
+ array(
+ 'topic_visibility' => ITEM_APPROVED,
+ 'topic_first_post_id' => 1,
+ 'topic_last_post_id' => 2,
+ 'topic_posts_approved' => 2,
+ 'topic_posts_unapproved' => 0,
+ 'topic_posts_softdeleted' => 0,
+ 'topic_delete_reason' => '',
+ ),
+ ),
+ array(
+ array('forum_posts_approved' => 2, 'forum_posts_unapproved' => 0, 'forum_posts_softdeleted' => 0, 'forum_topics_approved' => 1, 'forum_topics_unapproved' => 0, 'forum_topics_softdeleted' => 0, 'forum_last_post_id' => 2),
+ ),
+ array(
+ array('user_posts' => 3),
+ ),
+ ),
+ array(
+ 1, 1, 2,
+ array_merge($info_data, array(
+ 'post_time' => 2,
+ )),
+ true, 'soft delete',
+ array(
+ array('post_id' => 1, 'post_visibility' => ITEM_APPROVED, 'post_delete_reason' => ''),
+ array('post_id' => 2, 'post_visibility' => ITEM_DELETED, 'post_delete_reason' => 'soft delete'),
+ array('post_id' => 3, 'post_visibility' => ITEM_APPROVED, 'post_delete_reason' => ''),
+ ),
+ array(
+ array(
+ 'topic_visibility' => ITEM_APPROVED,
+ 'topic_first_post_id' => 1,
+ 'topic_last_post_id' => 3,
+ 'topic_posts_approved' => 2,
+ 'topic_posts_unapproved' => 0,
+ 'topic_posts_softdeleted' => 1,
+ 'topic_delete_reason' => '',
+ ),
+ ),
+ array(
+ array('forum_posts_approved' => 2, 'forum_posts_unapproved' => 0, 'forum_posts_softdeleted' => 1, 'forum_topics_approved' => 1, 'forum_topics_unapproved' => 0, 'forum_topics_softdeleted' => 0, 'forum_last_post_id' => 3),
+ ),
+ array(
+ array('user_posts' => 3),
+ ),
+ ),
+ array(
+ 1, 1, 1,
+ array_merge($info_data, array(
+ 'post_time' => 1,
+ )),
+ true, 'soft delete',
+ array(
+ array('post_id' => 1, 'post_visibility' => ITEM_DELETED, 'post_delete_reason' => 'soft delete'),
+ array('post_id' => 2, 'post_visibility' => ITEM_APPROVED, 'post_delete_reason' => ''),
+ array('post_id' => 3, 'post_visibility' => ITEM_APPROVED, 'post_delete_reason' => ''),
+ ),
+ array(
+ array(
+ 'topic_visibility' => ITEM_APPROVED,
+ 'topic_first_post_id' => 2,
+ 'topic_last_post_id' => 3,
+ 'topic_posts_approved' => 2,
+ 'topic_posts_unapproved' => 0,
+ 'topic_posts_softdeleted' => 1,
+ 'topic_delete_reason' => '',
+ ),
+ ),
+ array(
+ array('forum_posts_approved' => 2, 'forum_posts_unapproved' => 0, 'forum_posts_softdeleted' => 1, 'forum_topics_approved' => 1, 'forum_topics_unapproved' => 0, 'forum_topics_softdeleted' => 0, 'forum_last_post_id' => 3),
+ ),
+ array(
+ array('user_posts' => 3),
+ ),
+ ),
+ array(
+ 1, 1, 3,
+ array_merge($info_data, array(
+ 'post_time' => 3,
+ )),
+ true, 'soft delete',
+ array(
+ array('post_id' => 1, 'post_visibility' => ITEM_APPROVED, 'post_delete_reason' => ''),
+ array('post_id' => 2, 'post_visibility' => ITEM_APPROVED, 'post_delete_reason' => ''),
+ array('post_id' => 3, 'post_visibility' => ITEM_DELETED, 'post_delete_reason' => 'soft delete'),
+ ),
+ array(
+ array(
+ 'topic_visibility' => ITEM_APPROVED,
+ 'topic_first_post_id' => 1,
+ 'topic_last_post_id' => 2,
+ 'topic_posts_approved' => 2,
+ 'topic_posts_unapproved' => 0,
+ 'topic_posts_softdeleted' => 1,
+ 'topic_delete_reason' => '',
+ ),
+ ),
+ array(
+ array('forum_posts_approved' => 2, 'forum_posts_unapproved' => 0, 'forum_posts_softdeleted' => 1, 'forum_topics_approved' => 1, 'forum_topics_unapproved' => 0, 'forum_topics_softdeleted' => 0, 'forum_last_post_id' => 2),
+ ),
+ array(
+ array('user_posts' => 3),
+ ),
+ ),
+
+ array(
+ 2, 2, 4,
+ array(
+ 'topic_first_post_id' => 4,
+ 'topic_last_post_id' => 4,
+ 'topic_posts_approved' => 1,
+ 'topic_posts_unapproved' => 0,
+ 'topic_posts_softdeleted' => 0,
+ 'topic_visibility' => ITEM_APPROVED,
+ 'post_time' => 4,
+ 'post_visibility' => ITEM_APPROVED,
+ 'post_postcount' => true,
+ 'poster_id' => 1,
+ 'post_reported' => false,
+ ),
+ false, 'harddelete',
+ array(
+ ),
+ array(
+ ),
+ array(
+ array('forum_posts_approved' => 0, 'forum_posts_unapproved' => 0, 'forum_posts_softdeleted' => 0, 'forum_topics_approved' => 0, 'forum_topics_unapproved' => 0, 'forum_topics_softdeleted' => 0, 'forum_last_post_id' => 0),
+ ),
+ array(
+ array('user_posts' => 3),
+ ),
+ ),
+
+ array(
+ 2, 2, 4,
+ array(
+ 'topic_first_post_id' => 4,
+ 'topic_last_post_id' => 4,
+ 'topic_posts_approved' => 1,
+ 'topic_posts_unapproved' => 0,
+ 'topic_posts_softdeleted' => 0,
+ 'topic_visibility' => ITEM_APPROVED,
+ 'post_time' => 4,
+ 'post_visibility' => ITEM_APPROVED,
+ 'post_postcount' => true,
+ 'poster_id' => 1,
+ 'post_reported' => false,
+ ),
+ true, 'soft delete',
+ array(
+ array('post_id' => 4, 'post_visibility' => ITEM_DELETED, 'post_delete_reason' => ''),
+ ),
+ array(
+ array(
+ 'topic_visibility' => ITEM_DELETED,
+ 'topic_first_post_id' => 4,
+ 'topic_last_post_id' => 4,
+ 'topic_posts_approved' => 0,
+ 'topic_posts_unapproved' => 0,
+ 'topic_posts_softdeleted' => 1,
+ 'topic_delete_reason' => 'soft delete',
+ ),
+ ),
+ array(
+ array('forum_posts_approved' => 0, 'forum_posts_unapproved' => 0, 'forum_posts_softdeleted' => 1, 'forum_topics_approved' => 0, 'forum_topics_unapproved' => 0, 'forum_topics_softdeleted' => 1, 'forum_last_post_id' => 0),
+ ),
+ array(
+ array('user_posts' => 3),
+ ),
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider delete_post_data
+ */
+ public function test_delete_post($forum_id, $topic_id, $post_id, $data, $is_soft, $reason, $expected_posts, $expected_topic, $expected_forum, $expected_user)
+ {
+ global $auth, $cache, $config, $db, $phpbb_container, $phpbb_dispatcher, $phpbb_root_path, $phpEx;
+
+ $config['search_type'] = 'phpbb_mock_search';
+ $cache = new phpbb_mock_cache;
+ $db = $this->new_dbal();
+ $phpbb_config = new \phpbb\config\config(array('num_posts' => 3, 'num_topics' => 1));
+ $phpbb_dispatcher = new phpbb_mock_event_dispatcher();
+ set_config_count(null, null, null, $phpbb_config);
+
+ // Create auth mock
+ $auth = $this->getMock('\phpbb\auth\auth');
+ $auth->expects($this->any())
+ ->method('acl_get')
+ ->with($this->stringContains('_'), $this->anything())
+ ->will($this->returnValueMap(array(
+ array('m_approve', 1, true),
+ )));
+ $user = new \phpbb\user('\phpbb\datetime');
+
+ $phpbb_dispatcher = new phpbb_mock_event_dispatcher();
+
+ $phpbb_container = new phpbb_mock_container_builder();
+ $phpbb_container->set('notification_manager', new phpbb_mock_notification_manager());
+ $phpbb_container->set('content.visibility', new \phpbb\content_visibility($auth, $phpbb_config, $phpbb_dispatcher, $db, $user, $phpbb_root_path, $phpEx, FORUMS_TABLE, POSTS_TABLE, TOPICS_TABLE, USERS_TABLE));
+
+ delete_post($forum_id, $topic_id, $post_id, $data, $is_soft, $reason);
+
+ $result = $db->sql_query('SELECT post_id, post_visibility, post_delete_reason
+ FROM phpbb_posts
+ WHERE topic_id = ' . $topic_id . '
+ ORDER BY post_id ASC');
+
+ $this->assertEquals($expected_posts, $db->sql_fetchrowset($result));
+ $db->sql_freeresult($result);
+
+ $result = $db->sql_query('SELECT topic_visibility, topic_first_post_id, topic_last_post_id, topic_posts_approved, topic_posts_unapproved, topic_posts_softdeleted, topic_delete_reason
+ FROM phpbb_topics
+ WHERE topic_id = ' . $topic_id);
+
+ $this->assertEquals($expected_topic, $db->sql_fetchrowset($result));
+ $db->sql_freeresult($result);
+
+ $result = $db->sql_query('SELECT forum_posts_approved, forum_posts_unapproved, forum_posts_softdeleted, forum_topics_approved, forum_topics_unapproved, forum_topics_softdeleted, forum_last_post_id
+ FROM phpbb_forums
+ WHERE forum_id = ' . $forum_id);
+
+ $this->assertEquals($expected_forum, $db->sql_fetchrowset($result));
+ $db->sql_freeresult($result);
+
+ $sql = 'SELECT user_posts
+ FROM ' . USERS_TABLE . '
+ WHERE user_id = ' . (int) $data['poster_id'];
+ $result = $db->sql_query($sql);
+
+ $this->assertEquals($expected_user, $db->sql_fetchrowset($result));
+ $db->sql_freeresult($result);
+ }
+}
diff --git a/tests/content_visibility/fixtures/delete_post.xml b/tests/content_visibility/fixtures/delete_post.xml
new file mode 100644
index 0000000000..c29ad23019
--- /dev/null
+++ b/tests/content_visibility/fixtures/delete_post.xml
@@ -0,0 +1,163 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<dataset>
+ <table name="phpbb_forums">
+ <column>forum_id</column>
+ <column>forum_posts_approved</column>
+ <column>forum_posts_unapproved</column>
+ <column>forum_posts_softdeleted</column>
+ <column>forum_topics_approved</column>
+ <column>forum_topics_unapproved</column>
+ <column>forum_topics_softdeleted</column>
+ <column>forum_last_post_id</column>
+ <column>forum_parents</column>
+ <column>forum_desc</column>
+ <column>forum_rules</column>
+
+ <row>
+ <value>1</value>
+ <value>3</value>
+ <value>0</value>
+ <value>0</value>
+ <value>1</value>
+ <value>0</value>
+ <value>0</value>
+ <value>3</value>
+ <value></value>
+ <value></value>
+ <value></value>
+ </row>
+ <row>
+ <value>2</value>
+ <value>1</value>
+ <value>0</value>
+ <value>0</value>
+ <value>1</value>
+ <value>0</value>
+ <value>0</value>
+ <value>4</value>
+ <value></value>
+ <value></value>
+ <value></value>
+ </row>
+ </table>
+ <table name="phpbb_topics">
+ <column>topic_id</column>
+ <column>forum_id</column>
+ <column>topic_visibility</column>
+ <column>topic_title</column>
+ <column>topic_first_post_id</column>
+ <column>topic_last_post_id</column>
+ <column>topic_delete_user</column>
+ <column>topic_delete_time</column>
+ <column>topic_delete_reason</column>
+ <column>topic_posts_approved</column>
+ <column>topic_posts_unapproved</column>
+ <column>topic_posts_softdeleted</column>
+
+ <row>
+ <value>1</value>
+ <value>1</value>
+ <value>1</value>
+ <value>Approved</value>
+ <value>1</value>
+ <value>3</value>
+ <value>0</value>
+ <value>0</value>
+ <value></value>
+ <value>3</value>
+ <value>0</value>
+ <value>0</value>
+ </row>
+ <row>
+ <value>2</value>
+ <value>2</value>
+ <value>1</value>
+ <value>Approved</value>
+ <value>4</value>
+ <value>4</value>
+ <value>0</value>
+ <value>0</value>
+ <value></value>
+ <value>1</value>
+ <value>0</value>
+ <value>0</value>
+ </row>
+ </table>
+ <table name="phpbb_posts">
+ <column>post_id</column>
+ <column>poster_id</column>
+ <column>topic_id</column>
+ <column>forum_id</column>
+ <column>post_visibility</column>
+ <column>post_time</column>
+ <column>post_text</column>
+ <column>post_delete_user</column>
+ <column>post_delete_time</column>
+ <column>post_delete_reason</column>
+ <row>
+ <value>1</value>
+ <value>1</value>
+ <value>1</value>
+ <value>1</value>
+ <value>1</value>
+ <value>1</value>
+ <value>Approved</value>
+ <value>0</value>
+ <value>0</value>
+ <value></value>
+ </row>
+ <row>
+ <value>2</value>
+ <value>1</value>
+ <value>1</value>
+ <value>1</value>
+ <value>1</value>
+ <value>2</value>
+ <value>Approved</value>
+ <value>0</value>
+ <value>0</value>
+ <value></value>
+ </row>
+ <row>
+ <value>3</value>
+ <value>1</value>
+ <value>1</value>
+ <value>1</value>
+ <value>1</value>
+ <value>3</value>
+ <value>Approved</value>
+ <value>0</value>
+ <value>0</value>
+ <value></value>
+ </row>
+
+ <row>
+ <value>4</value>
+ <value>1</value>
+ <value>2</value>
+ <value>2</value>
+ <value>1</value>
+ <value>4</value>
+ <value>Approved</value>
+ <value>0</value>
+ <value>0</value>
+ <value></value>
+ </row>
+ </table>
+ <table name="phpbb_users">
+ <column>user_id</column>
+ <column>user_posts</column>
+ <column>username</column>
+ <column>username_clean</column>
+ <column>user_permissions</column>
+ <column>user_sig</column>
+ <row>
+ <value>1</value>
+ <value>4</value>
+ <value>user 1</value>
+ <value>user 1</value>
+ <value></value>
+ <value></value>
+ </row>
+ </table>
+</dataset>
diff --git a/tests/content_visibility/fixtures/get_forums_visibility_sql.xml b/tests/content_visibility/fixtures/get_forums_visibility_sql.xml
new file mode 100644
index 0000000000..658d34398f
--- /dev/null
+++ b/tests/content_visibility/fixtures/get_forums_visibility_sql.xml
@@ -0,0 +1,133 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<dataset>
+ <table name="phpbb_topics">
+ <column>topic_id</column>
+ <column>forum_id</column>
+ <column>topic_visibility</column>
+ <column>topic_title</column>
+ <row>
+ <value>1</value>
+ <value>1</value>
+ <value>0</value>
+ <value>Unapproved</value>
+ </row>
+ <row>
+ <value>2</value>
+ <value>1</value>
+ <value>1</value>
+ <value>Approved</value>
+ </row>
+ <row>
+ <value>3</value>
+ <value>1</value>
+ <value>2</value>
+ <value>Softdeleted</value>
+ </row>
+ <row>
+ <value>4</value>
+ <value>2</value>
+ <value>0</value>
+ <value>Unapproved</value>
+ </row>
+ <row>
+ <value>5</value>
+ <value>2</value>
+ <value>1</value>
+ <value>Approved</value>
+ </row>
+ <row>
+ <value>6</value>
+ <value>2</value>
+ <value>2</value>
+ <value>Softdeleted</value>
+ </row>
+ <row>
+ <value>7</value>
+ <value>3</value>
+ <value>0</value>
+ <value>Unapproved</value>
+ </row>
+ <row>
+ <value>8</value>
+ <value>3</value>
+ <value>1</value>
+ <value>Approved</value>
+ </row>
+ <row>
+ <value>9</value>
+ <value>3</value>
+ <value>2</value>
+ <value>Softdeleted</value>
+ </row>
+ </table>
+ <table name="phpbb_posts">
+ <column>post_id</column>
+ <column>topic_id</column>
+ <column>forum_id</column>
+ <column>post_visibility</column>
+ <column>post_text</column>
+ <row>
+ <value>1</value>
+ <value>1</value>
+ <value>1</value>
+ <value>0</value>
+ <value>Unapproved</value>
+ </row>
+ <row>
+ <value>2</value>
+ <value>2</value>
+ <value>1</value>
+ <value>1</value>
+ <value>Approved</value>
+ </row>
+ <row>
+ <value>3</value>
+ <value>3</value>
+ <value>1</value>
+ <value>2</value>
+ <value>Softdeleted</value>
+ </row>
+ <row>
+ <value>4</value>
+ <value>4</value>
+ <value>2</value>
+ <value>0</value>
+ <value>Unapproved</value>
+ </row>
+ <row>
+ <value>5</value>
+ <value>5</value>
+ <value>2</value>
+ <value>1</value>
+ <value>Approved</value>
+ </row>
+ <row>
+ <value>6</value>
+ <value>6</value>
+ <value>2</value>
+ <value>2</value>
+ <value>Softdeleted</value>
+ </row>
+ <row>
+ <value>7</value>
+ <value>7</value>
+ <value>3</value>
+ <value>0</value>
+ <value>Unapproved</value>
+ </row>
+ <row>
+ <value>8</value>
+ <value>8</value>
+ <value>3</value>
+ <value>1</value>
+ <value>Approved</value>
+ </row>
+ <row>
+ <value>9</value>
+ <value>9</value>
+ <value>3</value>
+ <value>2</value>
+ <value>Softdeleted</value>
+ </row>
+ </table>
+</dataset>
diff --git a/tests/content_visibility/fixtures/get_visibility_sql.xml b/tests/content_visibility/fixtures/get_visibility_sql.xml
new file mode 100644
index 0000000000..146244263e
--- /dev/null
+++ b/tests/content_visibility/fixtures/get_visibility_sql.xml
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<dataset>
+ <table name="phpbb_topics">
+ <column>topic_id</column>
+ <column>forum_id</column>
+ <column>topic_visibility</column>
+ <column>topic_title</column>
+ <row>
+ <value>1</value>
+ <value>1</value>
+ <value>0</value>
+ <value>Unapproved</value>
+ </row>
+ <row>
+ <value>2</value>
+ <value>1</value>
+ <value>1</value>
+ <value>Approved</value>
+ </row>
+ <row>
+ <value>3</value>
+ <value>1</value>
+ <value>2</value>
+ <value>Softdeleted</value>
+ </row>
+ </table>
+ <table name="phpbb_posts">
+ <column>post_id</column>
+ <column>topic_id</column>
+ <column>forum_id</column>
+ <column>post_visibility</column>
+ <column>post_text</column>
+ <row>
+ <value>1</value>
+ <value>1</value>
+ <value>1</value>
+ <value>0</value>
+ <value>Unapproved</value>
+ </row>
+ <row>
+ <value>2</value>
+ <value>2</value>
+ <value>1</value>
+ <value>1</value>
+ <value>Approved</value>
+ </row>
+ <row>
+ <value>3</value>
+ <value>3</value>
+ <value>1</value>
+ <value>2</value>
+ <value>Softdeleted</value>
+ </row>
+ </table>
+</dataset>
diff --git a/tests/content_visibility/fixtures/set_post_visibility.xml b/tests/content_visibility/fixtures/set_post_visibility.xml
new file mode 100644
index 0000000000..1b8dac2670
--- /dev/null
+++ b/tests/content_visibility/fixtures/set_post_visibility.xml
@@ -0,0 +1,238 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<dataset>
+ <table name="phpbb_topics">
+ <column>topic_id</column>
+ <column>forum_id</column>
+ <column>topic_visibility</column>
+ <column>topic_title</column>
+ <column>topic_first_post_id</column>
+ <column>topic_last_post_id</column>
+ <column>topic_posts_approved</column>
+ <column>topic_posts_softdeleted</column>
+ <column>topic_posts_unapproved</column>
+ <column>topic_attachment</column>
+ <row>
+ <value>1</value>
+ <value>1</value>
+ <value>1</value>
+ <value>Approved</value>
+ <value>2</value>
+ <value>2</value>
+ <value>1</value>
+ <value>1</value>
+ <value>1</value>
+ <value>0</value>
+ </row>
+
+ <row>
+ <value>2</value>
+ <value>1</value>
+ <value>1</value>
+ <value>2 Approved posts</value>
+ <value>5</value>
+ <value>6</value>
+ <value>1</value>
+ <value>1</value>
+ <value>1</value>
+ <value>0</value>
+ </row>
+
+ <row>
+ <value>3</value>
+ <value>1</value>
+ <value>1</value>
+ <value>Only 1 Approved posts</value>
+ <value>8</value>
+ <value>8</value>
+ <value>1</value>
+ <value>0</value>
+ <value>0</value>
+ <value>0</value>
+ </row>
+
+ <row>
+ <value>10</value>
+ <value>10</value>
+ <value>1</value>
+ <value>Only 3 posts (2 with attachments)</value>
+ <value>10</value>
+ <value>12</value>
+ <value>3</value>
+ <value>0</value>
+ <value>0</value>
+ <value>1</value>
+ </row>
+
+ <row>
+ <value>11</value>
+ <value>10</value>
+ <value>1</value>
+ <value>Only 2 posts (1 with attachments)</value>
+ <value>13</value>
+ <value>14</value>
+ <value>3</value>
+ <value>0</value>
+ <value>0</value>
+ <value>1</value>
+ </row>
+ </table>
+ <table name="phpbb_posts">
+ <column>post_id</column>
+ <column>poster_id</column>
+ <column>topic_id</column>
+ <column>forum_id</column>
+ <column>post_visibility</column>
+ <column>post_text</column>
+ <column>post_attachment</column>
+ <row>
+ <value>1</value>
+ <value>1</value>
+ <value>1</value>
+ <value>1</value>
+ <value>0</value>
+ <value>Unapproved</value>
+ <value>0</value>
+ </row>
+ <row>
+ <value>2</value>
+ <value>2</value>
+ <value>1</value>
+ <value>1</value>
+ <value>1</value>
+ <value>Approved</value>
+ <value>0</value>
+ </row>
+ <row>
+ <value>3</value>
+ <value>3</value>
+ <value>1</value>
+ <value>1</value>
+ <value>2</value>
+ <value>Softdeleted</value>
+ <value>0</value>
+ </row>
+
+ <row>
+ <value>4</value>
+ <value>1</value>
+ <value>2</value>
+ <value>1</value>
+ <value>0</value>
+ <value>Unapproved</value>
+ <value>0</value>
+ </row>
+ <row>
+ <value>5</value>
+ <value>2</value>
+ <value>2</value>
+ <value>1</value>
+ <value>1</value>
+ <value>Approved</value>
+ <value>0</value>
+ </row>
+ <row>
+ <value>6</value>
+ <value>2</value>
+ <value>2</value>
+ <value>1</value>
+ <value>1</value>
+ <value>Approved 2</value>
+ <value>0</value>
+ </row>
+ <row>
+ <value>7</value>
+ <value>3</value>
+ <value>2</value>
+ <value>1</value>
+ <value>2</value>
+ <value>Softdeleted</value>
+ <value>0</value>
+ </row>
+ <row>
+ <value>8</value>
+ <value>1</value>
+ <value>3</value>
+ <value>1</value>
+ <value>1</value>
+ <value>Approved</value>
+ <value>0</value>
+ </row>
+ <row>
+ <value>10</value>
+ <value>1</value>
+ <value>10</value>
+ <value>10</value>
+ <value>1</value>
+ <value>Softdeleted</value>
+ <value>1</value>
+ </row>
+ <row>
+ <value>11</value>
+ <value>1</value>
+ <value>10</value>
+ <value>10</value>
+ <value>1</value>
+ <value>Softdeleted</value>
+ <value>1</value>
+ </row>
+ <row>
+ <value>12</value>
+ <value>1</value>
+ <value>10</value>
+ <value>10</value>
+ <value>1</value>
+ <value>Approved</value>
+ <value>0</value>
+ </row>
+ <row>
+ <value>13</value>
+ <value>1</value>
+ <value>11</value>
+ <value>10</value>
+ <value>1</value>
+ <value>Approved</value>
+ <value>1</value>
+ </row>
+ <row>
+ <value>14</value>
+ <value>1</value>
+ <value>11</value>
+ <value>10</value>
+ <value>1</value>
+ <value>Approved</value>
+ <value>0</value>
+ </row>
+ </table>
+ <table name="phpbb_users">
+ <column>user_id</column>
+ <column>user_posts</column>
+ <column>username</column>
+ <column>username_clean</column>
+ <column>user_permissions</column>
+ <column>user_sig</column>
+ <row>
+ <value>1</value>
+ <value>1</value>
+ <value>user 1</value>
+ <value>user 1</value>
+ <value></value>
+ <value></value>
+ </row>
+ <row>
+ <value>2</value>
+ <value>1</value>
+ <value>user 2</value>
+ <value>user 2</value>
+ <value></value>
+ <value></value>
+ </row>
+ <row>
+ <value>3</value>
+ <value>1</value>
+ <value>user 3</value>
+ <value>user 3</value>
+ <value></value>
+ <value></value>
+ </row>
+ </table>
+</dataset>
diff --git a/tests/content_visibility/fixtures/set_topic_visibility.xml b/tests/content_visibility/fixtures/set_topic_visibility.xml
new file mode 100644
index 0000000000..02ab5f16fe
--- /dev/null
+++ b/tests/content_visibility/fixtures/set_topic_visibility.xml
@@ -0,0 +1,132 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<dataset>
+ <table name="phpbb_topics">
+ <column>topic_id</column>
+ <column>forum_id</column>
+ <column>topic_visibility</column>
+ <column>topic_title</column>
+ <column>topic_first_post_id</column>
+ <column>topic_last_post_id</column>
+ <column>topic_delete_user</column>
+ <column>topic_delete_time</column>
+ <column>topic_delete_reason</column>
+
+ <row>
+ <value>1</value>
+ <value>1</value>
+ <value>1</value>
+ <value>Approved</value>
+ <value>1</value>
+ <value>1</value>
+ <value>0</value>
+ <value>0</value>
+ <value></value>
+ </row>
+
+ <row>
+ <value>2</value>
+ <value>1</value>
+ <value>2</value>
+ <value>Soft deleted</value>
+ <value>4</value>
+ <value>5</value>
+ <value>2</value>
+ <value>123</value>
+ <value></value>
+ </row>
+ </table>
+ <table name="phpbb_posts">
+ <column>post_id</column>
+ <column>poster_id</column>
+ <column>topic_id</column>
+ <column>forum_id</column>
+ <column>post_visibility</column>
+ <column>post_text</column>
+ <column>post_delete_user</column>
+ <column>post_delete_time</column>
+ <column>post_delete_reason</column>
+ <row>
+ <value>1</value>
+ <value>1</value>
+ <value>1</value>
+ <value>1</value>
+ <value>1</value>
+ <value>Approved</value>
+ <value>2</value>
+ <value>0</value>
+ <value></value>
+ </row>
+ <row>
+ <value>2</value>
+ <value>1</value>
+ <value>1</value>
+ <value>1</value>
+ <value>2</value>
+ <value>Soft deleted</value>
+ <value>2</value>
+ <value>123</value>
+ <value>manually</value>
+ </row>
+ <row>
+ <value>3</value>
+ <value>1</value>
+ <value>1</value>
+ <value>1</value>
+ <value>0</value>
+ <value>Unapproved</value>
+ <value>0</value>
+ <value>0</value>
+ <value></value>
+ </row>
+
+ <row>
+ <value>4</value>
+ <value>1</value>
+ <value>2</value>
+ <value>1</value>
+ <value>2</value>
+ <value>Soft deleted by topic soft delete</value>
+ <value>2</value>
+ <value>123</value>
+ <value></value>
+ </row>
+ <row>
+ <value>5</value>
+ <value>1</value>
+ <value>2</value>
+ <value>1</value>
+ <value>2</value>
+ <value>Soft deleted before the topic was soft deleted</value>
+ <value>2</value>
+ <value>120</value>
+ <value>manually</value>
+ </row>
+ <row>
+ <value>6</value>
+ <value>1</value>
+ <value>2</value>
+ <value>1</value>
+ <value>0</value>
+ <value>Unapproved before the topic was soft deleted</value>
+ <value>0</value>
+ <value>0</value>
+ <value></value>
+ </row>
+ </table>
+ <table name="phpbb_users">
+ <column>user_id</column>
+ <column>user_posts</column>
+ <column>username</column>
+ <column>username_clean</column>
+ <column>user_permissions</column>
+ <column>user_sig</column>
+ <row>
+ <value>1</value>
+ <value>6</value>
+ <value>user 1</value>
+ <value>user 1</value>
+ <value></value>
+ <value></value>
+ </row>
+ </table>
+</dataset>
diff --git a/tests/content_visibility/get_forums_visibility_sql_test.php b/tests/content_visibility/get_forums_visibility_sql_test.php
new file mode 100644
index 0000000000..28e463ecb5
--- /dev/null
+++ b/tests/content_visibility/get_forums_visibility_sql_test.php
@@ -0,0 +1,149 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+class phpbb_content_visibility_get_forums_visibility_sql_test extends phpbb_database_test_case
+{
+ public function getDataSet()
+ {
+ return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/get_forums_visibility_sql.xml');
+ }
+
+ public function get_forums_visibility_sql_data()
+ {
+ return array(
+ array(
+ 'phpbb_topics',
+ 'topic', array(1, 2, 3), '',
+ array(
+ array('m_approve', true, array(1 => true, 2 => true, 3 => true)),
+ ),
+ array(
+ array('topic_id' => 1),
+ array('topic_id' => 2),
+ array('topic_id' => 3),
+ array('topic_id' => 4),
+ array('topic_id' => 5),
+ array('topic_id' => 6),
+ array('topic_id' => 7),
+ array('topic_id' => 8),
+ array('topic_id' => 9),
+ ),
+ ),
+ array(
+ 'phpbb_topics',
+ 'topic', array(1, 2), '',
+ array(
+ array('m_approve', true, array(1 => true, 2 => true, 3 => true)),
+ ),
+ array(
+ array('topic_id' => 1),
+ array('topic_id' => 2),
+ array('topic_id' => 3),
+ array('topic_id' => 4),
+ array('topic_id' => 5),
+ array('topic_id' => 6),
+ ),
+ ),
+ array(
+ 'phpbb_topics',
+ 'topic', array(1, 2, 3), '',
+ array(
+ array('m_approve', true, array(2 => true)),
+ ),
+ array(
+ array('topic_id' => 2),
+ array('topic_id' => 4),
+ array('topic_id' => 5),
+ array('topic_id' => 6),
+ array('topic_id' => 8),
+ ),
+ ),
+ array(
+ 'phpbb_posts',
+ 'post', array(1, 2, 3), '',
+ array(
+ array('m_approve', true, array(1 => true, 2 => true, 3 => true)),
+ ),
+ array(
+ array('post_id' => 1),
+ array('post_id' => 2),
+ array('post_id' => 3),
+ array('post_id' => 4),
+ array('post_id' => 5),
+ array('post_id' => 6),
+ array('post_id' => 7),
+ array('post_id' => 8),
+ array('post_id' => 9),
+ ),
+ ),
+ array(
+ 'phpbb_posts',
+ 'post', array(1, 2), '',
+ array(
+ array('m_approve', true, array(1 => true, 2 => true, 3 => true)),
+ ),
+ array(
+ array('post_id' => 1),
+ array('post_id' => 2),
+ array('post_id' => 3),
+ array('post_id' => 4),
+ array('post_id' => 5),
+ array('post_id' => 6),
+ ),
+ ),
+ array(
+ 'phpbb_posts',
+ 'post', array(1, 2, 3), '',
+ array(
+ array('m_approve', true, array(2 => true)),
+ ),
+ array(
+ array('post_id' => 2),
+ array('post_id' => 4),
+ array('post_id' => 5),
+ array('post_id' => 6),
+ array('post_id' => 8),
+ ),
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider get_forums_visibility_sql_data
+ */
+ public function test_get_forums_visibility_sql($table, $mode, $forum_ids, $table_alias, $permissions, $expected)
+ {
+ global $cache, $db, $auth, $phpbb_root_path, $phpEx;
+
+ $cache = new phpbb_mock_cache;
+ $db = $this->new_dbal();
+
+ // Create auth mock
+ $auth = $this->getMock('\phpbb\auth\auth');
+ $auth->expects($this->any())
+ ->method('acl_getf')
+ ->with($this->stringContains('_'), $this->anything())
+ ->will($this->returnValueMap($permissions));
+ $user = new \phpbb\user('\phpbb\datetime');
+ $config = new phpbb\config\config(array());
+ $phpbb_dispatcher = new phpbb_mock_event_dispatcher();
+ $content_visibility = new \phpbb\content_visibility($auth, $config, $phpbb_dispatcher, $db, $user, $phpbb_root_path, $phpEx, FORUMS_TABLE, POSTS_TABLE, TOPICS_TABLE, USERS_TABLE);
+
+ $result = $db->sql_query('SELECT ' . $mode . '_id
+ FROM ' . $table . '
+ WHERE ' . $content_visibility->get_forums_visibility_sql($mode, $forum_ids, $table_alias) . '
+ ORDER BY ' . $mode . '_id ASC');
+
+ $this->assertEquals($expected, $db->sql_fetchrowset($result));
+ }
+}
diff --git a/tests/content_visibility/get_global_visibility_sql_test.php b/tests/content_visibility/get_global_visibility_sql_test.php
new file mode 100644
index 0000000000..586bae8668
--- /dev/null
+++ b/tests/content_visibility/get_global_visibility_sql_test.php
@@ -0,0 +1,149 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+class phpbb_content_visibility_get_global_visibility_sql_test extends phpbb_database_test_case
+{
+ public function getDataSet()
+ {
+ return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/get_forums_visibility_sql.xml');
+ }
+
+ public function get_global_visibility_sql_data()
+ {
+ return array(
+ array(
+ 'phpbb_topics',
+ 'topic', array(), '',
+ array(
+ array('m_approve', true, array(1 => true, 2 => true, 3 => true)),
+ ),
+ array(
+ array('topic_id' => 1),
+ array('topic_id' => 2),
+ array('topic_id' => 3),
+ array('topic_id' => 4),
+ array('topic_id' => 5),
+ array('topic_id' => 6),
+ array('topic_id' => 7),
+ array('topic_id' => 8),
+ array('topic_id' => 9),
+ ),
+ ),
+ array(
+ 'phpbb_topics',
+ 'topic', array(3), '',
+ array(
+ array('m_approve', true, array(1 => true, 2 => true, 3 => true)),
+ ),
+ array(
+ array('topic_id' => 1),
+ array('topic_id' => 2),
+ array('topic_id' => 3),
+ array('topic_id' => 4),
+ array('topic_id' => 5),
+ array('topic_id' => 6),
+ ),
+ ),
+ array(
+ 'phpbb_topics',
+ 'topic', array(), '',
+ array(
+ array('m_approve', true, array(2 => true)),
+ ),
+ array(
+ array('topic_id' => 2),
+ array('topic_id' => 4),
+ array('topic_id' => 5),
+ array('topic_id' => 6),
+ array('topic_id' => 8),
+ ),
+ ),
+ array(
+ 'phpbb_posts',
+ 'post', array(), '',
+ array(
+ array('m_approve', true, array(1 => true, 2 => true, 3 => true)),
+ ),
+ array(
+ array('post_id' => 1),
+ array('post_id' => 2),
+ array('post_id' => 3),
+ array('post_id' => 4),
+ array('post_id' => 5),
+ array('post_id' => 6),
+ array('post_id' => 7),
+ array('post_id' => 8),
+ array('post_id' => 9),
+ ),
+ ),
+ array(
+ 'phpbb_posts',
+ 'post', array(3), '',
+ array(
+ array('m_approve', true, array(1 => true, 2 => true, 3 => true)),
+ ),
+ array(
+ array('post_id' => 1),
+ array('post_id' => 2),
+ array('post_id' => 3),
+ array('post_id' => 4),
+ array('post_id' => 5),
+ array('post_id' => 6),
+ ),
+ ),
+ array(
+ 'phpbb_posts',
+ 'post', array(), '',
+ array(
+ array('m_approve', true, array(2 => true)),
+ ),
+ array(
+ array('post_id' => 2),
+ array('post_id' => 4),
+ array('post_id' => 5),
+ array('post_id' => 6),
+ array('post_id' => 8),
+ ),
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider get_global_visibility_sql_data
+ */
+ public function test_get_global_visibility_sql($table, $mode, $forum_ids, $table_alias, $permissions, $expected)
+ {
+ global $cache, $db, $auth, $phpbb_root_path, $phpEx;
+
+ $cache = new phpbb_mock_cache;
+ $db = $this->new_dbal();
+
+ // Create auth mock
+ $auth = $this->getMock('\phpbb\auth\auth');
+ $auth->expects($this->any())
+ ->method('acl_getf')
+ ->with($this->stringContains('_'), $this->anything())
+ ->will($this->returnValueMap($permissions));
+ $user = new \phpbb\user('\phpbb\datetime');
+ $config = new phpbb\config\config(array());
+ $phpbb_dispatcher = new phpbb_mock_event_dispatcher();
+ $content_visibility = new \phpbb\content_visibility($auth, $config, $phpbb_dispatcher, $db, $user, $phpbb_root_path, $phpEx, FORUMS_TABLE, POSTS_TABLE, TOPICS_TABLE, USERS_TABLE);
+
+ $result = $db->sql_query('SELECT ' . $mode . '_id
+ FROM ' . $table . '
+ WHERE ' . $content_visibility->get_global_visibility_sql($mode, $forum_ids, $table_alias) . '
+ ORDER BY ' . $mode . '_id ASC');
+
+ $this->assertEquals($expected, $db->sql_fetchrowset($result));
+ }
+}
diff --git a/tests/content_visibility/get_visibility_sql_test.php b/tests/content_visibility/get_visibility_sql_test.php
new file mode 100644
index 0000000000..9ae2d2fdc4
--- /dev/null
+++ b/tests/content_visibility/get_visibility_sql_test.php
@@ -0,0 +1,96 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+class phpbb_content_visibility_get_visibility_sql_test extends phpbb_database_test_case
+{
+ public function getDataSet()
+ {
+ return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/get_visibility_sql.xml');
+ }
+
+ public function get_visibility_sql_data()
+ {
+ return array(
+ array(
+ 'phpbb_posts',
+ 'post', 1, '',
+ array(
+ array('m_approve', 1, true),
+ ),
+ array(
+ array('post_id' => 1),
+ array('post_id' => 2),
+ array('post_id' => 3),
+ ),
+ ),
+ array(
+ 'phpbb_posts',
+ 'post', 1, '',
+ array(
+ ),
+ array(
+ array('post_id' => 2),
+ ),
+ ),
+ array(
+ 'phpbb_topics',
+ 'topic', 1, '',
+ array(
+ array('m_approve', 1, true),
+ ),
+ array(
+ array('topic_id' => 1),
+ array('topic_id' => 2),
+ array('topic_id' => 3),
+ ),
+ ),
+ array(
+ 'phpbb_topics',
+ 'topic', 1, '',
+ array(),
+ array(
+ array('topic_id' => 2),
+ ),
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider get_visibility_sql_data
+ */
+ public function test_get_visibility_sql($table, $mode, $forum_id, $table_alias, $permissions, $expected)
+ {
+ global $cache, $db, $auth, $phpbb_root_path, $phpEx;
+
+ $cache = new phpbb_mock_cache;
+ $db = $this->new_dbal();
+
+ // Create auth mock
+ $auth = $this->getMock('\phpbb\auth\auth');
+ $auth->expects($this->any())
+ ->method('acl_get')
+ ->with($this->stringContains('_'), $this->anything())
+ ->will($this->returnValueMap($permissions));
+ $user = new \phpbb\user('\phpbb\datetime');
+ $config = new phpbb\config\config(array());
+ $phpbb_dispatcher = new phpbb_mock_event_dispatcher();
+ $content_visibility = new \phpbb\content_visibility($auth, $config, $phpbb_dispatcher, $db, $user, $phpbb_root_path, $phpEx, FORUMS_TABLE, POSTS_TABLE, TOPICS_TABLE, USERS_TABLE);
+
+ $result = $db->sql_query('SELECT ' . $mode . '_id
+ FROM ' . $table . '
+ WHERE ' . $content_visibility->get_visibility_sql($mode, $forum_id, $table_alias) . '
+ ORDER BY ' . $mode . '_id ASC');
+
+ $this->assertEquals($expected, $db->sql_fetchrowset($result));
+ }
+}
diff --git a/tests/content_visibility/set_post_visibility_test.php b/tests/content_visibility/set_post_visibility_test.php
new file mode 100644
index 0000000000..36ebf58374
--- /dev/null
+++ b/tests/content_visibility/set_post_visibility_test.php
@@ -0,0 +1,192 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions_admin.php';
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions_content.php';
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions_posting.php';
+require_once dirname(__FILE__) . '/../../phpBB/includes/utf/utf_tools.php';
+
+class phpbb_content_visibility_set_post_visibility_test extends phpbb_database_test_case
+{
+ public function getDataSet()
+ {
+ return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/set_post_visibility.xml');
+ }
+
+ public function set_post_visibility_data()
+ {
+ return array(
+ array(
+ ITEM_APPROVED,
+ 1, 1, 1,
+ 2, time(), 'approve',
+ true, false,
+ array(
+ array('post_id' => 1, 'post_visibility' => 1, 'post_delete_reason' => 'approve'),
+ array('post_id' => 2, 'post_visibility' => 1, 'post_delete_reason' => ''),
+ array('post_id' => 3, 'post_visibility' => 2, 'post_delete_reason' => ''),
+ ),
+ array(
+ array('topic_visibility' => 1, 'topic_first_post_id' => 1, 'topic_last_post_id' => 2),
+ ),
+ ),
+ array(
+ ITEM_APPROVED,
+ 3, 1, 1,
+ 2, time(), 'approve',
+ false, true,
+ array(
+ array('post_id' => 1, 'post_visibility' => 0, 'post_delete_reason' => ''),
+ array('post_id' => 2, 'post_visibility' => 1, 'post_delete_reason' => ''),
+ array('post_id' => 3, 'post_visibility' => 1, 'post_delete_reason' => 'approve'),
+ ),
+ array(
+ array('topic_visibility' => 1, 'topic_first_post_id' => 2, 'topic_last_post_id' => 3),
+ ),
+ ),
+ array(
+ ITEM_DELETED,
+ 2, 1, 1,
+ 2, time(), 'deleted',
+ true, true,
+ array(
+ array('post_id' => 1, 'post_visibility' => 0, 'post_delete_reason' => ''),
+ array('post_id' => 2, 'post_visibility' => 2, 'post_delete_reason' => 'deleted'),
+ array('post_id' => 3, 'post_visibility' => 2, 'post_delete_reason' => ''),
+ ),
+ array(
+ array('topic_visibility' => 2, 'topic_first_post_id' => 1, 'topic_last_post_id' => 3),
+ ),
+ ),
+ array(
+ ITEM_DELETED,
+ 5, 2, 1,
+ 2, time(), 'deleted',
+ true, false,
+ array(
+ array('post_id' => 4, 'post_visibility' => 0, 'post_delete_reason' => ''),
+ array('post_id' => 5, 'post_visibility' => 2, 'post_delete_reason' => 'deleted'),
+ array('post_id' => 6, 'post_visibility' => 1, 'post_delete_reason' => ''),
+ array('post_id' => 7, 'post_visibility' => 2, 'post_delete_reason' => ''),
+ ),
+ array(
+ array('topic_visibility' => 1, 'topic_first_post_id' => 6, 'topic_last_post_id' => 6),
+ ),
+ ),
+ array(
+ ITEM_DELETED,
+ 6, 2, 1,
+ 2, time(), 'deleted',
+ false, true,
+ array(
+ array('post_id' => 4, 'post_visibility' => 0, 'post_delete_reason' => ''),
+ array('post_id' => 5, 'post_visibility' => 1, 'post_delete_reason' => ''),
+ array('post_id' => 6, 'post_visibility' => 2, 'post_delete_reason' => 'deleted'),
+ array('post_id' => 7, 'post_visibility' => 2, 'post_delete_reason' => ''),
+ ),
+ array(
+ array('topic_visibility' => 1, 'topic_first_post_id' => 5, 'topic_last_post_id' => 5),
+ ),
+ ),
+ array(
+ ITEM_DELETED,
+ 8, 3, 1,
+ 2, time(), 'deleted',
+ true, true,
+ array(
+ array('post_id' => 8, 'post_visibility' => 2, 'post_delete_reason' => 'deleted'),
+ ),
+ array(
+ array('topic_visibility' => 2, 'topic_first_post_id' => 8, 'topic_last_post_id' => 8),
+ ),
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider set_post_visibility_data
+ */
+ public function test_set_post_visibility($visibility, $post_id, $topic_id, $forum_id, $user_id, $time, $reason, $is_starter, $is_latest, $expected, $expected_topic)
+ {
+ global $cache, $db, $auth, $phpbb_root_path, $phpEx;
+
+ $cache = new phpbb_mock_cache;
+ $db = $this->new_dbal();
+ $auth = $this->getMock('\phpbb\auth\auth');
+ $user = new \phpbb\user('\phpbb\datetime');
+ $config = new phpbb\config\config(array());
+ $phpbb_dispatcher = new phpbb_mock_event_dispatcher();
+ $content_visibility = new \phpbb\content_visibility($auth, $config, $phpbb_dispatcher, $db, $user, $phpbb_root_path, $phpEx, FORUMS_TABLE, POSTS_TABLE, TOPICS_TABLE, USERS_TABLE);
+
+ $content_visibility->set_post_visibility($visibility, $post_id, $topic_id, $forum_id, $user_id, $time, $reason, $is_starter, $is_latest);
+
+ $result = $db->sql_query('SELECT post_id, post_visibility, post_delete_reason
+ FROM phpbb_posts
+ WHERE topic_id = ' . $topic_id . '
+ ORDER BY post_id ASC');
+
+ $this->assertEquals($expected, $db->sql_fetchrowset($result));
+ $db->sql_freeresult($result);
+
+ $result = $db->sql_query('SELECT topic_visibility, topic_first_post_id, topic_last_post_id
+ FROM phpbb_topics
+ WHERE topic_id = ' . $topic_id);
+
+ $this->assertEquals($expected_topic, $db->sql_fetchrowset($result));
+ $db->sql_freeresult($result);
+ }
+
+ public function set_post_soft_deleted_data()
+ {
+ return array(
+ array(
+ 10, 10, 10,
+ 1, time(), 'soft-deleted',
+ true, false,
+ array(array('topic_attachment' => 1)),
+ ),
+ array(
+ 13, 11, 10,
+ 1, time(), 'soft-deleted',
+ true, false,
+ array(array('topic_attachment' => 0)),
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider set_post_soft_deleted_data
+ */
+ public function test_set_post_soft_deleted($post_id, $topic_id, $forum_id, $user_id, $time, $reason, $is_starter, $is_latest, $expected)
+ {
+ global $cache, $db, $auth, $phpbb_root_path, $phpEx;
+
+ $cache = new phpbb_mock_cache;
+ $db = $this->new_dbal();
+ $auth = $this->getMock('\phpbb\auth\auth');
+ $user = new \phpbb\user('\phpbb\datetime');
+ $config = new phpbb\config\config(array());
+ $phpbb_dispatcher = new phpbb_mock_event_dispatcher();
+ $content_visibility = new \phpbb\content_visibility($auth, $config, $phpbb_dispatcher, $db, $user, $phpbb_root_path, $phpEx, FORUMS_TABLE, POSTS_TABLE, TOPICS_TABLE, USERS_TABLE);
+
+ $content_visibility->set_post_visibility(ITEM_DELETED, $post_id, $topic_id, $forum_id, $user_id, $time, $reason, $is_starter, $is_latest);
+
+ $result = $db->sql_query('SELECT topic_attachment
+ FROM phpbb_topics
+ WHERE topic_id = ' . $topic_id);
+
+ $this->assertEquals($expected, $db->sql_fetchrowset($result));
+ $db->sql_freeresult($result);
+ }
+}
diff --git a/tests/content_visibility/set_topic_visibility_test.php b/tests/content_visibility/set_topic_visibility_test.php
new file mode 100644
index 0000000000..6c34f42167
--- /dev/null
+++ b/tests/content_visibility/set_topic_visibility_test.php
@@ -0,0 +1,113 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions_admin.php';
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions_content.php';
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions_posting.php';
+require_once dirname(__FILE__) . '/../../phpBB/includes/utf/utf_tools.php';
+
+class phpbb_content_visibility_set_topic_visibility_test extends phpbb_database_test_case
+{
+ public function getDataSet()
+ {
+ return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/set_topic_visibility.xml');
+ }
+
+ public function set_topic_visibility_data()
+ {
+ return array(
+ array(
+ ITEM_DELETED, 1, 1,
+ 2, time(), 'delete', false,
+ array(
+ array('post_id' => 1, 'post_visibility' => 2, 'post_delete_reason' => ''),
+ array('post_id' => 2, 'post_visibility' => 2, 'post_delete_reason' => 'manually'),
+ array('post_id' => 3, 'post_visibility' => 0, 'post_delete_reason' => ''),
+ ),
+ array(
+ array('topic_visibility' => 2, 'topic_first_post_id' => 1, 'topic_last_post_id' => 3, 'topic_delete_reason' => 'delete'),
+ ),
+ ),
+ array(
+ ITEM_DELETED, 1, 1,
+ 2, time(), 'delete-forced', true,
+ array(
+ array('post_id' => 1, 'post_visibility' => 2, 'post_delete_reason' => ''),
+ array('post_id' => 2, 'post_visibility' => 2, 'post_delete_reason' => ''),
+ array('post_id' => 3, 'post_visibility' => 2, 'post_delete_reason' => ''),
+ ),
+ array(
+ array('topic_visibility' => 2, 'topic_first_post_id' => 1, 'topic_last_post_id' => 3, 'topic_delete_reason' => 'delete-forced'),
+ ),
+ ),
+ array(
+ ITEM_APPROVED, 2, 1,
+ 2, time(), 'approved', false,
+ array(
+ array('post_id' => 4, 'post_visibility' => 1, 'post_delete_reason' => ''),
+ array('post_id' => 5, 'post_visibility' => 2, 'post_delete_reason' => 'manually'),
+ array('post_id' => 6, 'post_visibility' => 0, 'post_delete_reason' => ''),
+ ),
+ array(
+ array('topic_visibility' => 1, 'topic_first_post_id' => 4, 'topic_last_post_id' => 4, 'topic_delete_reason' => 'approved'),
+ ),
+ ),
+ array(
+ ITEM_APPROVED, 2, 1,
+ 2, time(), 'approved-forced', true,
+ array(
+ array('post_id' => 4, 'post_visibility' => 1, 'post_delete_reason' => ''),
+ array('post_id' => 5, 'post_visibility' => 1, 'post_delete_reason' => ''),
+ array('post_id' => 6, 'post_visibility' => 1, 'post_delete_reason' => ''),
+ ),
+ array(
+ array('topic_visibility' => 1, 'topic_first_post_id' => 4, 'topic_last_post_id' => 6, 'topic_delete_reason' => 'approved-forced'),
+ ),
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider set_topic_visibility_data
+ */
+ public function test_set_topic_visibility($visibility, $topic_id, $forum_id, $user_id, $time, $reason, $force_update_all, $expected_posts, $expected_topic)
+ {
+ global $cache, $db, $auth, $phpbb_root_path, $phpEx;
+
+ $cache = new phpbb_mock_cache;
+ $db = $this->new_dbal();
+ $auth = $this->getMock('\phpbb\auth\auth');
+ $user = new \phpbb\user('\phpbb\datetime');
+ $config = new phpbb\config\config(array());
+ $phpbb_dispatcher = new phpbb_mock_event_dispatcher();
+ $content_visibility = new \phpbb\content_visibility($auth, $config, $phpbb_dispatcher, $db, $user, $phpbb_root_path, $phpEx, FORUMS_TABLE, POSTS_TABLE, TOPICS_TABLE, USERS_TABLE);
+
+ $content_visibility->set_topic_visibility($visibility, $topic_id, $forum_id, $user_id, $time, $reason, $force_update_all);
+
+ $result = $db->sql_query('SELECT post_id, post_visibility, post_delete_reason
+ FROM phpbb_posts
+ WHERE topic_id = ' . $topic_id . '
+ ORDER BY post_id ASC');
+
+ $this->assertEquals($expected_posts, $db->sql_fetchrowset($result));
+ $db->sql_freeresult($result);
+
+ $result = $db->sql_query('SELECT topic_visibility, topic_first_post_id, topic_last_post_id, topic_delete_reason
+ FROM phpbb_topics
+ WHERE topic_id = ' . $topic_id);
+
+ $this->assertEquals($expected_topic, $db->sql_fetchrowset($result));
+ $db->sql_freeresult($result);
+ }
+}
diff --git a/tests/controller/common_helper_route.php b/tests/controller/common_helper_route.php
new file mode 100644
index 0000000000..ea77a289c9
--- /dev/null
+++ b/tests/controller/common_helper_route.php
@@ -0,0 +1,467 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
+
+use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
+
+abstract class phpbb_controller_common_helper_route extends phpbb_test_case
+{
+ protected $root_path;
+ private $user;
+ private $config;
+ private $template;
+ private $extension_manager;
+ private $request;
+ private $symfony_request;
+ private $provider;
+ private $filesystem;
+ private $phpbb_path_helper;
+
+ public function setUp()
+ {
+ global $phpbb_dispatcher, $phpbb_root_path, $phpEx;
+
+ $this->extension_manager = new phpbb_mock_extension_manager(
+ dirname(__FILE__) . '/',
+ array(
+ 'vendor2/foo' => array(
+ 'ext_name' => 'vendor2/foo',
+ 'ext_active' => '1',
+ 'ext_path' => 'ext/vendor2/foo/',
+ ),
+ )
+ );
+ $this->generate_route_objects();
+ $phpbb_dispatcher = new phpbb_mock_event_dispatcher;
+ $this->user = new \phpbb\user('\phpbb\datetime');
+
+ $this->config = new \phpbb\config\config(array('enable_mod_rewrite' => '0'));
+ $this->template = new phpbb\template\twig\twig($this->phpbb_path_helper, $this->config, $this->user, new \phpbb\template\context());
+ }
+
+ protected function get_phpbb_root_path()
+ {
+ return '';
+ }
+
+ protected function get_uri()
+ {
+ return '/app.php';
+ }
+
+ protected function get_base_uri()
+ {
+ return $this->get_uri();
+ }
+
+ protected function get_script_name()
+ {
+ return 'app.php';
+ }
+
+ protected function path_to_app()
+ {
+ return '';
+ }
+
+ protected function generate_route_objects()
+ {
+ global $request;
+
+ $this->request = new phpbb_mock_request();
+ $this->request->overwrite('SCRIPT_NAME', $this->get_uri(), \phpbb\request\request_interface::SERVER);
+ $this->request->overwrite('SCRIPT_FILENAME', $this->get_script_name(), \phpbb\request\request_interface::SERVER);
+ $this->request->overwrite('REQUEST_URI', $this->get_base_uri(), \phpbb\request\request_interface::SERVER);
+ $this->request->overwrite('SERVER_NAME', 'localhost', \phpbb\request\request_interface::SERVER);
+ $this->request->overwrite('SERVER_PORT', '80', \phpbb\request\request_interface::SERVER);
+
+ $request = $this->request;
+
+ $this->symfony_request = new \phpbb\symfony_request(
+ $this->request
+ );
+ $this->filesystem = new \phpbb\filesystem();
+ $this->phpbb_path_helper = new \phpbb\path_helper(
+ $this->symfony_request,
+ $this->filesystem,
+ $this->request,
+ $phpbb_root_path,
+ $phpEx
+ );
+
+ $finder = new \phpbb\finder(
+ new \phpbb\filesystem(),
+ dirname(__FILE__) . '/',
+ new phpbb_mock_cache()
+ );
+ $finder->set_extensions(array_keys($this->extension_manager->all_enabled()));
+ $this->provider = new \phpbb\controller\provider();
+ $this->provider->find_routing_files($finder);
+ $this->provider->find(dirname(__FILE__) . '/');
+ // Set correct current phpBB root path
+ $this->root_path = $this->get_phpbb_root_path();
+ }
+
+ public function helper_url_data_no_rewrite()
+ {
+ return array(
+ array('controller2', array('t' => 1, 'f' => 2), true, false, '/' . $this->path_to_app() . 'app.php/foo/bar?t=1&amp;f=2', 'parameters in params-argument as array'),
+ array('controller2', array('t' => 1, 'f' => 2), false, false, '/' . $this->path_to_app() . 'app.php/foo/bar?t=1&f=2', 'parameters in params-argument as array'),
+ array('controller3', array('p' => 3, 't' => 1, 'f' => 2), true, false, '/' . $this->path_to_app() . 'app.php/foo/bar/p-3?t=1&amp;f=2', 'parameters in params-argument as array'),
+ array('controller3', array('p' => 3, 't' => 1, 'f' => 2), false, false, '/' . $this->path_to_app() . 'app.php/foo/bar/p-3?t=1&f=2', 'parameters in params-argument as array'),
+
+ // Custom sid parameter
+ array('controller2', array('t' => 1, 'f' => 2), true, 'custom-sid', '/' . $this->path_to_app() . 'app.php/foo/bar?t=1&amp;f=2&amp;sid=custom-sid', 'params-argument (array) using session_id'),
+ array('controller2', array('t' => 1, 'f' => 2), false, 'custom-sid', '/' . $this->path_to_app() . 'app.php/foo/bar?t=1&f=2&sid=custom-sid', 'params-argument (array) using session_id'),
+ array('controller3', array('p' => 3, 't' => 1, 'f' => 2), true, 'custom-sid', '/' . $this->path_to_app() . 'app.php/foo/bar/p-3?t=1&amp;f=2&amp;sid=custom-sid', 'params-argument (array) using session_id'),
+
+ // Testing anchors
+ array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), true, false, '/' . $this->path_to_app() . 'app.php/foo/bar?t=1&amp;f=2#anchor', 'anchor in params-argument (array)'),
+ array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), false, false, '/' . $this->path_to_app() . 'app.php/foo/bar?t=1&f=2#anchor', 'anchor in params-argument (array)'),
+ array('controller3', array('p' => 3, 't' => 1, 'f' => 2, '#' => 'anchor'), true, false, '/' . $this->path_to_app() . 'app.php/foo/bar/p-3?t=1&amp;f=2#anchor', 'anchor in params-argument (array)'),
+
+ // Anchors and custom sid
+ array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), true, 'custom-sid', '/' . $this->path_to_app() . 'app.php/foo/bar?t=1&amp;f=2&amp;sid=custom-sid#anchor', 'anchor in params-argument (array) using session_id'),
+ array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), false, 'custom-sid', '/' . $this->path_to_app() . 'app.php/foo/bar?t=1&f=2&sid=custom-sid#anchor', 'anchor in params-argument (array) using session_id'),
+ array('controller3', array('p' => 3, 't' => 1, 'f' => 2, '#' => 'anchor'), true, 'custom-sid', '/' . $this->path_to_app() . 'app.php/foo/bar/p-3?t=1&amp;f=2&amp;sid=custom-sid#anchor', 'anchor in params-argument (array) using session_id'),
+
+ // Empty parameters should not append the &amp; or ?
+ array('controller2', array(), true, false, '/' . $this->path_to_app() . 'app.php/foo/bar', 'no params using empty array'),
+ array('controller2', array(), false, false, '/' . $this->path_to_app() . 'app.php/foo/bar', 'no params using empty array'),
+ array('controller3', array('p' => 3), true, false, '/' . $this->path_to_app() . 'app.php/foo/bar/p-3', 'no params using empty array'),
+ );
+ }
+
+ /**
+ * @dataProvider helper_url_data_no_rewrite()
+ */
+ public function test_helper_url_no_rewrite($route, $params, $is_amp, $session_id, $expected, $description)
+ {
+ $helper = new phpbb_mock_controller_helper($this->template, $this->user, $this->config, $this->provider, $this->extension_manager, $this->symfony_request, $this->request, $this->filesystem, $this->root_path, 'php', dirname(__FILE__) . '/');
+ static::assertEquals($expected, $helper->route($route, $params, $is_amp, $session_id), $description);
+ }
+
+ public function helper_url_data_with_rewrite()
+ {
+ return array(
+ array('controller2', array('t' => 1, 'f' => 2), true, false, '/' . $this->path_to_app() . 'foo/bar?t=1&amp;f=2', 'parameters in params-argument as array'),
+ array('controller2', array('t' => 1, 'f' => 2), false, false, '/' . $this->path_to_app() . 'foo/bar?t=1&f=2', 'parameters in params-argument as array'),
+ array('controller3', array('p' => 3, 't' => 1, 'f' => 2), true, false, '/' . $this->path_to_app() . 'foo/bar/p-3?t=1&amp;f=2', 'parameters in params-argument as array'),
+ array('controller3', array('p' => 3, 't' => 1, 'f' => 2), false, false, '/' . $this->path_to_app() . 'foo/bar/p-3?t=1&f=2', 'parameters in params-argument as array'),
+
+ // Custom sid parameter
+ array('controller2', array('t' => 1, 'f' => 2), true, 'custom-sid', '/' . $this->path_to_app() . 'foo/bar?t=1&amp;f=2&amp;sid=custom-sid', 'params-argument (array) using session_id'),
+ array('controller2', array('t' => 1, 'f' => 2), false, 'custom-sid', '/' . $this->path_to_app() . 'foo/bar?t=1&f=2&sid=custom-sid', 'params-argument (array) using session_id'),
+ array('controller3', array('p' => 3, 't' => 1, 'f' => 2), true, 'custom-sid', '/' . $this->path_to_app() . 'foo/bar/p-3?t=1&amp;f=2&amp;sid=custom-sid', 'params-argument (array) using session_id'),
+
+ // Testing anchors
+ array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), true, false, '/' . $this->path_to_app() . 'foo/bar?t=1&amp;f=2#anchor', 'anchor in params-argument (array)'),
+ array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), false, false, '/' . $this->path_to_app() . 'foo/bar?t=1&f=2#anchor', 'anchor in params-argument (array)'),
+ array('controller3', array('p' => 3, 't' => 1, 'f' => 2, '#' => 'anchor'), true, false, '/' . $this->path_to_app() . 'foo/bar/p-3?t=1&amp;f=2#anchor', 'anchor in params-argument (array)'),
+
+ // Anchors and custom sid
+ array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), true, 'custom-sid', '/' . $this->path_to_app() . 'foo/bar?t=1&amp;f=2&amp;sid=custom-sid#anchor', 'anchor in params-argument (array) using session_id'),
+ array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), false, 'custom-sid', '/' . $this->path_to_app() . 'foo/bar?t=1&f=2&sid=custom-sid#anchor', 'anchor in params-argument (array) using session_id'),
+ array('controller3', array('p' => 3, 't' => 1, 'f' => 2, '#' => 'anchor'), true, 'custom-sid', '/' . $this->path_to_app() . 'foo/bar/p-3?t=1&amp;f=2&amp;sid=custom-sid#anchor', 'anchor in params-argument (array) using session_id'),
+
+ // Empty parameters should not append the &amp; or ?
+ array('controller2', array(), true, false, '/' . $this->path_to_app() . 'foo/bar', 'no params using empty array'),
+ array('controller2', array(), false, false, '/' . $this->path_to_app() . 'foo/bar', 'no params using empty array'),
+ array('controller3', array('p' => 3), true, false, '/' . $this->path_to_app() . 'foo/bar/p-3', 'no params using empty array'),
+ );
+ }
+
+ /**
+ * @dataProvider helper_url_data_with_rewrite()
+ */
+ public function test_helper_url_with_rewrite($route, $params, $is_amp, $session_id, $expected, $description)
+ {
+ $this->config = new \phpbb\config\config(array('enable_mod_rewrite' => '1'));
+ $helper = new phpbb_mock_controller_helper($this->template, $this->user, $this->config, $this->provider, $this->extension_manager, $this->symfony_request, $this->request, $this->filesystem, $this->root_path, 'php', dirname(__FILE__) . '/');
+ static::assertEquals($expected, $helper->route($route, $params, $is_amp, $session_id), $description);
+ }
+
+ public function helper_url_data_absolute()
+ {
+ return array(
+ array('controller2', array('t' => 1, 'f' => 2), true, false, 'http://localhost/' . $this->path_to_app() . 'app.php/foo/bar?t=1&amp;f=2', 'parameters in params-argument as array'),
+ array('controller2', array('t' => 1, 'f' => 2), false, false, 'http://localhost/' . $this->path_to_app() . 'app.php/foo/bar?t=1&f=2', 'parameters in params-argument as array'),
+ array('controller3', array('p' => 3, 't' => 1, 'f' => 2), true, false, 'http://localhost/' . $this->path_to_app() . 'app.php/foo/bar/p-3?t=1&amp;f=2', 'parameters in params-argument as array'),
+ array('controller3', array('p' => 3, 't' => 1, 'f' => 2), false, false, 'http://localhost/' . $this->path_to_app() . 'app.php/foo/bar/p-3?t=1&f=2', 'parameters in params-argument as array'),
+
+ // Custom sid parameter
+ array('controller2', array('t' => 1, 'f' => 2), true, 'custom-sid', 'http://localhost/' . $this->path_to_app() . 'app.php/foo/bar?t=1&amp;f=2&amp;sid=custom-sid', 'params-argument (array) using session_id'),
+ array('controller2', array('t' => 1, 'f' => 2), false, 'custom-sid', 'http://localhost/' . $this->path_to_app() . 'app.php/foo/bar?t=1&f=2&sid=custom-sid', 'params-argument (array) using session_id'),
+ array('controller3', array('p' => 3, 't' => 1, 'f' => 2), true, 'custom-sid', 'http://localhost/' . $this->path_to_app() . 'app.php/foo/bar/p-3?t=1&amp;f=2&amp;sid=custom-sid', 'params-argument (array) using session_id'),
+
+ // Testing anchors
+ array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), true, false, 'http://localhost/' . $this->path_to_app() . 'app.php/foo/bar?t=1&amp;f=2#anchor', 'anchor in params-argument (array)'),
+ array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), false, false, 'http://localhost/' . $this->path_to_app() . 'app.php/foo/bar?t=1&f=2#anchor', 'anchor in params-argument (array)'),
+ array('controller3', array('p' => 3, 't' => 1, 'f' => 2, '#' => 'anchor'), true, false, 'http://localhost/' . $this->path_to_app() . 'app.php/foo/bar/p-3?t=1&amp;f=2#anchor', 'anchor in params-argument (array)'),
+
+ // Anchors and custom sid
+ array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), true, 'custom-sid', 'http://localhost/' . $this->path_to_app() . 'app.php/foo/bar?t=1&amp;f=2&amp;sid=custom-sid#anchor', 'anchor in params-argument (array) using session_id'),
+ array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), false, 'custom-sid', 'http://localhost/' . $this->path_to_app() . 'app.php/foo/bar?t=1&f=2&sid=custom-sid#anchor', 'anchor in params-argument (array) using session_id'),
+ array('controller3', array('p' => 3, 't' => 1, 'f' => 2, '#' => 'anchor'), true, 'custom-sid', 'http://localhost/' . $this->path_to_app() . 'app.php/foo/bar/p-3?t=1&amp;f=2&amp;sid=custom-sid#anchor', 'anchor in params-argument (array) using session_id'),
+
+ // Empty parameters should not append the &amp; or ?
+ array('controller2', array(), true, false, 'http://localhost/' . $this->path_to_app() . 'app.php/foo/bar', 'no params using empty array'),
+ array('controller2', array(), false, false, 'http://localhost/' . $this->path_to_app() . 'app.php/foo/bar', 'no params using empty array'),
+ array('controller3', array('p' => 3), true, false, 'http://localhost/' . $this->path_to_app() . 'app.php/foo/bar/p-3', 'no params using empty array'),
+ );
+ }
+
+ /**
+ * @dataProvider helper_url_data_absolute()
+ */
+ public function test_helper_url_absolute($route, $params, $is_amp, $session_id, $expected, $description)
+ {
+ $this->config = new \phpbb\config\config(array('enable_mod_rewrite' => '0'));
+ $helper = new phpbb_mock_controller_helper($this->template, $this->user, $this->config, $this->provider, $this->extension_manager, $this->symfony_request, $this->request, $this->filesystem, $this->root_path, 'php', dirname(__FILE__) . '/');
+ static::assertEquals($expected, $helper->route($route, $params, $is_amp, $session_id, UrlGeneratorInterface::ABSOLUTE_URL), $description);
+ }
+
+ public function helper_url_data_relative_path()
+ {
+ return array(
+ array('controller2', array('t' => 1, 'f' => 2), true, false, 'app.php/foo/bar?t=1&amp;f=2', 'parameters in params-argument as array'),
+ array('controller2', array('t' => 1, 'f' => 2), false, false, 'app.php/foo/bar?t=1&f=2', 'parameters in params-argument as array'),
+ array('controller3', array('p' => 3, 't' => 1, 'f' => 2), true, false, 'app.php/foo/bar/p-3?t=1&amp;f=2', 'parameters in params-argument as array'),
+ array('controller3', array('p' => 3, 't' => 1, 'f' => 2), false, false, 'app.php/foo/bar/p-3?t=1&f=2', 'parameters in params-argument as array'),
+
+ // Custom sid parameter
+ array('controller2', array('t' => 1, 'f' => 2), true, 'custom-sid', 'app.php/foo/bar?t=1&amp;f=2&amp;sid=custom-sid', 'params-argument (array) using session_id'),
+ array('controller2', array('t' => 1, 'f' => 2), false, 'custom-sid', 'app.php/foo/bar?t=1&f=2&sid=custom-sid', 'params-argument (array) using session_id'),
+ array('controller3', array('p' => 3, 't' => 1, 'f' => 2), true, 'custom-sid', 'app.php/foo/bar/p-3?t=1&amp;f=2&amp;sid=custom-sid', 'params-argument (array) using session_id'),
+
+ // Testing anchors
+ array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), true, false, 'app.php/foo/bar?t=1&amp;f=2#anchor', 'anchor in params-argument (array)'),
+ array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), false, false, 'app.php/foo/bar?t=1&f=2#anchor', 'anchor in params-argument (array)'),
+ array('controller3', array('p' => 3, 't' => 1, 'f' => 2, '#' => 'anchor'), true, false, 'app.php/foo/bar/p-3?t=1&amp;f=2#anchor', 'anchor in params-argument (array)'),
+
+ // Anchors and custom sid
+ array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), true, 'custom-sid', 'app.php/foo/bar?t=1&amp;f=2&amp;sid=custom-sid#anchor', 'anchor in params-argument (array) using session_id'),
+ array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), false, 'custom-sid', 'app.php/foo/bar?t=1&f=2&sid=custom-sid#anchor', 'anchor in params-argument (array) using session_id'),
+ array('controller3', array('p' => 3, 't' => 1, 'f' => 2, '#' => 'anchor'), true, 'custom-sid', 'app.php/foo/bar/p-3?t=1&amp;f=2&amp;sid=custom-sid#anchor', 'anchor in params-argument (array) using session_id'),
+
+ // Empty parameters should not append the &amp; or ?
+ array('controller2', array(), true, false, 'app.php/foo/bar', 'no params using empty array'),
+ array('controller2', array(), false, false, 'app.php/foo/bar', 'no params using empty array'),
+ array('controller3', array('p' => 3), true, false, 'app.php/foo/bar/p-3', 'no params using empty array'),
+ );
+ }
+
+ /**
+ * @dataProvider helper_url_data_relative_path()
+ */
+ public function test_helper_url_relative_path($route, $params, $is_amp, $session_id, $expected, $description)
+ {
+ $this->config = new \phpbb\config\config(array('enable_mod_rewrite' => '0'));
+ $helper = new phpbb_mock_controller_helper($this->template, $this->user, $this->config, $this->provider, $this->extension_manager, $this->symfony_request, $this->request, $this->filesystem, $this->root_path, 'php', dirname(__FILE__) . '/');
+ static::assertEquals($expected, $helper->route($route, $params, $is_amp, $session_id, UrlGeneratorInterface::RELATIVE_PATH), $description);
+ }
+
+ public function helper_url_data_network()
+ {
+ return array(
+ array('controller2', array('t' => 1, 'f' => 2), true, false, '//localhost/' . $this->path_to_app() . 'app.php/foo/bar?t=1&amp;f=2', 'parameters in params-argument as array'),
+ array('controller2', array('t' => 1, 'f' => 2), false, false, '//localhost/' . $this->path_to_app() . 'app.php/foo/bar?t=1&f=2', 'parameters in params-argument as array'),
+ array('controller3', array('p' => 3, 't' => 1, 'f' => 2), true, false, '//localhost/' . $this->path_to_app() . 'app.php/foo/bar/p-3?t=1&amp;f=2', 'parameters in params-argument as array'),
+ array('controller3', array('p' => 3, 't' => 1, 'f' => 2), false, false, '//localhost/' . $this->path_to_app() . 'app.php/foo/bar/p-3?t=1&f=2', 'parameters in params-argument as array'),
+
+ // Custom sid parameter
+ array('controller2', array('t' => 1, 'f' => 2), true, 'custom-sid', '//localhost/' . $this->path_to_app() . 'app.php/foo/bar?t=1&amp;f=2&amp;sid=custom-sid', 'params-argument (array) using session_id'),
+ array('controller2', array('t' => 1, 'f' => 2), false, 'custom-sid', '//localhost/' . $this->path_to_app() . 'app.php/foo/bar?t=1&f=2&sid=custom-sid', 'params-argument (array) using session_id'),
+ array('controller3', array('p' => 3, 't' => 1, 'f' => 2), true, 'custom-sid', '//localhost/' . $this->path_to_app() . 'app.php/foo/bar/p-3?t=1&amp;f=2&amp;sid=custom-sid', 'params-argument (array) using session_id'),
+
+ // Testing anchors
+ array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), true, false, '//localhost/' . $this->path_to_app() . 'app.php/foo/bar?t=1&amp;f=2#anchor', 'anchor in params-argument (array)'),
+ array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), false, false, '//localhost/' . $this->path_to_app() . 'app.php/foo/bar?t=1&f=2#anchor', 'anchor in params-argument (array)'),
+ array('controller3', array('p' => 3, 't' => 1, 'f' => 2, '#' => 'anchor'), true, false, '//localhost/' . $this->path_to_app() . 'app.php/foo/bar/p-3?t=1&amp;f=2#anchor', 'anchor in params-argument (array)'),
+
+ // Anchors and custom sid
+ array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), true, 'custom-sid', '//localhost/' . $this->path_to_app() . 'app.php/foo/bar?t=1&amp;f=2&amp;sid=custom-sid#anchor', 'anchor in params-argument (array) using session_id'),
+ array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), false, 'custom-sid', '//localhost/' . $this->path_to_app() . 'app.php/foo/bar?t=1&f=2&sid=custom-sid#anchor', 'anchor in params-argument (array) using session_id'),
+ array('controller3', array('p' => 3, 't' => 1, 'f' => 2, '#' => 'anchor'), true, 'custom-sid', '//localhost/' . $this->path_to_app() . 'app.php/foo/bar/p-3?t=1&amp;f=2&amp;sid=custom-sid#anchor', 'anchor in params-argument (array) using session_id'),
+
+ // Empty parameters should not append the &amp; or ?
+ array('controller2', array(), true, false, '//localhost/' . $this->path_to_app() . 'app.php/foo/bar', 'no params using empty array'),
+ array('controller2', array(), false, false, '//localhost/' . $this->path_to_app() . 'app.php/foo/bar', 'no params using empty array'),
+ array('controller3', array('p' => 3), true, false, '//localhost/' . $this->path_to_app() . 'app.php/foo/bar/p-3', 'no params using empty array'),
+ );
+ }
+
+ /**
+ * @dataProvider helper_url_data_network()
+ */
+ public function test_helper_url_network($route, $params, $is_amp, $session_id, $expected, $description)
+ {
+ $this->config = new \phpbb\config\config(array('enable_mod_rewrite' => '0'));
+ $helper = new phpbb_mock_controller_helper($this->template, $this->user, $this->config, $this->provider, $this->extension_manager, $this->symfony_request, $this->request, $this->filesystem, $this->root_path, 'php', dirname(__FILE__) . '/');
+ static::assertEquals($expected, $helper->route($route, $params, $is_amp, $session_id, UrlGeneratorInterface::NETWORK_PATH), $description);
+ }
+//TODO
+ public function helper_url_data_absolute_with_rewrite()
+ {
+ return array(
+ array('controller2', array('t' => 1, 'f' => 2), true, false, 'http://localhost/' . $this->path_to_app() . 'foo/bar?t=1&amp;f=2', 'parameters in params-argument as array'),
+ array('controller2', array('t' => 1, 'f' => 2), false, false, 'http://localhost/' . $this->path_to_app() . 'foo/bar?t=1&f=2', 'parameters in params-argument as array'),
+ array('controller3', array('p' => 3, 't' => 1, 'f' => 2), true, false, 'http://localhost/' . $this->path_to_app() . 'foo/bar/p-3?t=1&amp;f=2', 'parameters in params-argument as array'),
+ array('controller3', array('p' => 3, 't' => 1, 'f' => 2), false, false, 'http://localhost/' . $this->path_to_app() . 'foo/bar/p-3?t=1&f=2', 'parameters in params-argument as array'),
+
+ // Custom sid parameter
+ array('controller2', array('t' => 1, 'f' => 2), true, 'custom-sid', 'http://localhost/' . $this->path_to_app() . 'foo/bar?t=1&amp;f=2&amp;sid=custom-sid', 'params-argument (array) using session_id'),
+ array('controller2', array('t' => 1, 'f' => 2), false, 'custom-sid', 'http://localhost/' . $this->path_to_app() . 'foo/bar?t=1&f=2&sid=custom-sid', 'params-argument (array) using session_id'),
+ array('controller3', array('p' => 3, 't' => 1, 'f' => 2), true, 'custom-sid', 'http://localhost/' . $this->path_to_app() . 'foo/bar/p-3?t=1&amp;f=2&amp;sid=custom-sid', 'params-argument (array) using session_id'),
+
+ // Testing anchors
+ array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), true, false, 'http://localhost/' . $this->path_to_app() . 'foo/bar?t=1&amp;f=2#anchor', 'anchor in params-argument (array)'),
+ array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), false, false, 'http://localhost/' . $this->path_to_app() . 'foo/bar?t=1&f=2#anchor', 'anchor in params-argument (array)'),
+ array('controller3', array('p' => 3, 't' => 1, 'f' => 2, '#' => 'anchor'), true, false, 'http://localhost/' . $this->path_to_app() . 'foo/bar/p-3?t=1&amp;f=2#anchor', 'anchor in params-argument (array)'),
+
+ // Anchors and custom sid
+ array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), true, 'custom-sid', 'http://localhost/' . $this->path_to_app() . 'foo/bar?t=1&amp;f=2&amp;sid=custom-sid#anchor', 'anchor in params-argument (array) using session_id'),
+ array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), false, 'custom-sid', 'http://localhost/' . $this->path_to_app() . 'foo/bar?t=1&f=2&sid=custom-sid#anchor', 'anchor in params-argument (array) using session_id'),
+ array('controller3', array('p' => 3, 't' => 1, 'f' => 2, '#' => 'anchor'), true, 'custom-sid', 'http://localhost/' . $this->path_to_app() . 'foo/bar/p-3?t=1&amp;f=2&amp;sid=custom-sid#anchor', 'anchor in params-argument (array) using session_id'),
+
+ // Empty parameters should not append the &amp; or ?
+ array('controller2', array(), true, false, 'http://localhost/' . $this->path_to_app() . 'foo/bar', 'no params using empty array'),
+ array('controller2', array(), false, false, 'http://localhost/' . $this->path_to_app() . 'foo/bar', 'no params using empty array'),
+ array('controller3', array('p' => 3), true, false, 'http://localhost/' . $this->path_to_app() . 'foo/bar/p-3', 'no params using empty array'),
+ );
+ }
+
+ /**
+ * @dataProvider helper_url_data_absolute_with_rewrite()
+ */
+ public function test_helper_url_absolute_with_rewrite($route, $params, $is_amp, $session_id, $expected, $description)
+ {
+ $this->config = new \phpbb\config\config(array('enable_mod_rewrite' => '1'));
+ $helper = new phpbb_mock_controller_helper($this->template, $this->user, $this->config, $this->provider, $this->extension_manager, $this->symfony_request, $this->request, $this->filesystem, $this->root_path, 'php', dirname(__FILE__) . '/');
+ static::assertEquals($expected, $helper->route($route, $params, $is_amp, $session_id, UrlGeneratorInterface::ABSOLUTE_URL), $description);
+ }
+
+ public function helper_url_data_relative_path_with_rewrite()
+ {
+ return array(
+ array('controller2', array('t' => 1, 'f' => 2), true, false, 'foo/bar?t=1&amp;f=2', 'parameters in params-argument as array'),
+ array('controller2', array('t' => 1, 'f' => 2), false, false, 'foo/bar?t=1&f=2', 'parameters in params-argument as array'),
+ array('controller3', array('p' => 3, 't' => 1, 'f' => 2), true, false, 'foo/bar/p-3?t=1&amp;f=2', 'parameters in params-argument as array'),
+ array('controller3', array('p' => 3, 't' => 1, 'f' => 2), false, false, 'foo/bar/p-3?t=1&f=2', 'parameters in params-argument as array'),
+
+ // Custom sid parameter
+ array('controller2', array('t' => 1, 'f' => 2), true, 'custom-sid', 'foo/bar?t=1&amp;f=2&amp;sid=custom-sid', 'params-argument (array) using session_id'),
+ array('controller2', array('t' => 1, 'f' => 2), false, 'custom-sid', 'foo/bar?t=1&f=2&sid=custom-sid', 'params-argument (array) using session_id'),
+ array('controller3', array('p' => 3, 't' => 1, 'f' => 2), true, 'custom-sid', 'foo/bar/p-3?t=1&amp;f=2&amp;sid=custom-sid', 'params-argument (array) using session_id'),
+
+ // Testing anchors
+ array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), true, false, 'foo/bar?t=1&amp;f=2#anchor', 'anchor in params-argument (array)'),
+ array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), false, false, 'foo/bar?t=1&f=2#anchor', 'anchor in params-argument (array)'),
+ array('controller3', array('p' => 3, 't' => 1, 'f' => 2, '#' => 'anchor'), true, false, 'foo/bar/p-3?t=1&amp;f=2#anchor', 'anchor in params-argument (array)'),
+
+ // Anchors and custom sid
+ array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), true, 'custom-sid', 'foo/bar?t=1&amp;f=2&amp;sid=custom-sid#anchor', 'anchor in params-argument (array) using session_id'),
+ array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), false, 'custom-sid', 'foo/bar?t=1&f=2&sid=custom-sid#anchor', 'anchor in params-argument (array) using session_id'),
+ array('controller3', array('p' => 3, 't' => 1, 'f' => 2, '#' => 'anchor'), true, 'custom-sid', 'foo/bar/p-3?t=1&amp;f=2&amp;sid=custom-sid#anchor', 'anchor in params-argument (array) using session_id'),
+
+ // Empty parameters should not append the &amp; or ?
+ array('controller2', array(), true, false, 'foo/bar', 'no params using empty array'),
+ array('controller2', array(), false, false, 'foo/bar', 'no params using empty array'),
+ array('controller3', array('p' => 3), true, false, 'foo/bar/p-3', 'no params using empty array'),
+ );
+ }
+
+ /**
+ * @dataProvider helper_url_data_relative_path_with_rewrite()
+ */
+ public function test_helper_url_relative_path_with_rewrite($route, $params, $is_amp, $session_id, $expected, $description)
+ {
+ $this->config = new \phpbb\config\config(array('enable_mod_rewrite' => '1'));
+ $helper = new phpbb_mock_controller_helper($this->template, $this->user, $this->config, $this->provider, $this->extension_manager, $this->symfony_request, $this->request, $this->filesystem, $this->root_path, 'php', dirname(__FILE__) . '/');
+ static::assertEquals($expected, $helper->route($route, $params, $is_amp, $session_id, UrlGeneratorInterface::RELATIVE_PATH), $description);
+ }
+
+ public function helper_url_data_network_with_rewrite()
+ {
+ return array(
+ array('controller2', array('t' => 1, 'f' => 2), true, false, '//localhost/' . $this->path_to_app() . 'foo/bar?t=1&amp;f=2', 'parameters in params-argument as array'),
+ array('controller2', array('t' => 1, 'f' => 2), false, false, '//localhost/' . $this->path_to_app() . 'foo/bar?t=1&f=2', 'parameters in params-argument as array'),
+ array('controller3', array('p' => 3, 't' => 1, 'f' => 2), true, false, '//localhost/' . $this->path_to_app() . 'foo/bar/p-3?t=1&amp;f=2', 'parameters in params-argument as array'),
+ array('controller3', array('p' => 3, 't' => 1, 'f' => 2), false, false, '//localhost/' . $this->path_to_app() . 'foo/bar/p-3?t=1&f=2', 'parameters in params-argument as array'),
+
+ // Custom sid parameter
+ array('controller2', array('t' => 1, 'f' => 2), true, 'custom-sid', '//localhost/' . $this->path_to_app() . 'foo/bar?t=1&amp;f=2&amp;sid=custom-sid', 'params-argument (array) using session_id'),
+ array('controller2', array('t' => 1, 'f' => 2), false, 'custom-sid', '//localhost/' . $this->path_to_app() . 'foo/bar?t=1&f=2&sid=custom-sid', 'params-argument (array) using session_id'),
+ array('controller3', array('p' => 3, 't' => 1, 'f' => 2), true, 'custom-sid', '//localhost/' . $this->path_to_app() . 'foo/bar/p-3?t=1&amp;f=2&amp;sid=custom-sid', 'params-argument (array) using session_id'),
+
+ // Testing anchors
+ array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), true, false, '//localhost/' . $this->path_to_app() . 'foo/bar?t=1&amp;f=2#anchor', 'anchor in params-argument (array)'),
+ array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), false, false, '//localhost/' . $this->path_to_app() . 'foo/bar?t=1&f=2#anchor', 'anchor in params-argument (array)'),
+ array('controller3', array('p' => 3, 't' => 1, 'f' => 2, '#' => 'anchor'), true, false, '//localhost/' . $this->path_to_app() . 'foo/bar/p-3?t=1&amp;f=2#anchor', 'anchor in params-argument (array)'),
+
+ // Anchors and custom sid
+ array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), true, 'custom-sid', '//localhost/' . $this->path_to_app() . 'foo/bar?t=1&amp;f=2&amp;sid=custom-sid#anchor', 'anchor in params-argument (array) using session_id'),
+ array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), false, 'custom-sid', '//localhost/' . $this->path_to_app() . 'foo/bar?t=1&f=2&sid=custom-sid#anchor', 'anchor in params-argument (array) using session_id'),
+ array('controller3', array('p' => 3, 't' => 1, 'f' => 2, '#' => 'anchor'), true, 'custom-sid', '//localhost/' . $this->path_to_app() . 'foo/bar/p-3?t=1&amp;f=2&amp;sid=custom-sid#anchor', 'anchor in params-argument (array) using session_id'),
+
+ // Empty parameters should not append the &amp; or ?
+ array('controller2', array(), true, false, '//localhost/' . $this->path_to_app() . 'foo/bar', 'no params using empty array'),
+ array('controller2', array(), false, false, '//localhost/' . $this->path_to_app() . 'foo/bar', 'no params using empty array'),
+ array('controller3', array('p' => 3), true, false, '//localhost/' . $this->path_to_app() . 'foo/bar/p-3', 'no params using empty array'),
+ );
+ }
+
+ /**
+ * @dataProvider helper_url_data_network_with_rewrite()
+ */
+ public function test_helper_url_network_with_rewrite($route, $params, $is_amp, $session_id, $expected, $description)
+ {
+ $this->config = new \phpbb\config\config(array('enable_mod_rewrite' => '1'));
+ $helper = new phpbb_mock_controller_helper($this->template, $this->user, $this->config, $this->provider, $this->extension_manager, $this->symfony_request, $this->request, $this->filesystem, $this->root_path, 'php', dirname(__FILE__) . '/');
+ static::assertEquals($expected, $helper->route($route, $params, $is_amp, $session_id, UrlGeneratorInterface::NETWORK_PATH), $description);
+ }
+
+ public function helper_url_data_force_server_vars()
+ {
+ return array(
+ array(false, true, 'my_server', 443, '/my/board', 'http://', UrlGeneratorInterface::ABSOLUTE_URL, 'http://my_server:443/my/board/app.php/foo'),
+ array(true, true, 'my_server', 444, '/my/board', 'https://', UrlGeneratorInterface::ABSOLUTE_URL, 'https://my_server:444/my/board/foo'),
+ array(false, true, 'my_server', 443, '/my/board', 'http://', UrlGeneratorInterface::NETWORK_PATH, '//my_server:443/my/board/app.php/foo'),
+ array(true, true, 'my_server', 444, '/my/board', 'https://', UrlGeneratorInterface::NETWORK_PATH, '//my_server:444/my/board/foo'),
+ array(false, true, 'my_server', 443, '/my/board', 'http://', UrlGeneratorInterface::ABSOLUTE_PATH, '/my/board/app.php/foo'),
+ array(true, true, 'my_server', 443, '/my/board', 'http://', UrlGeneratorInterface::ABSOLUTE_PATH, '/my/board/foo'),
+ array(false, true, 'my_server', 443, '/my/board', 'http://', UrlGeneratorInterface::RELATIVE_PATH, 'app.php/foo'),
+ array(true, true, 'my_server', 443, '/my/board', 'http://', UrlGeneratorInterface::RELATIVE_PATH, 'foo'),
+ );
+ }
+
+ /**
+ * @dataProvider helper_url_data_force_server_vars()
+ */
+ public function test_helper_url_force_server_vars($enable_mod_rewrite, $force_server_vars, $server_name, $server_port, $script_path, $server_protocol, $type, $expected)
+ {
+ $this->config = new \phpbb\config\config(array(
+ 'enable_mod_rewrite' => $enable_mod_rewrite,
+ 'force_server_vars' => $force_server_vars,
+ 'server_name' => $server_name,
+ 'server_port' => $server_port,
+ 'script_path' => $script_path,
+ 'server_protocol' => $server_protocol,
+ ));
+
+ $helper = new phpbb_mock_controller_helper($this->template, $this->user, $this->config, $this->provider, $this->extension_manager, $this->symfony_request, $this->request, $this->filesystem, $this->root_path, 'php', dirname(__FILE__) . '/');
+ static::assertEquals($expected, $helper->route('controller1', array(), false, false, $type));
+
+ }
+}
diff --git a/tests/controller/config/routing.yml b/tests/controller/config/routing.yml
new file mode 100644
index 0000000000..1e7df02684
--- /dev/null
+++ b/tests/controller/config/routing.yml
@@ -0,0 +1,3 @@
+core_controller:
+ path: /core_foo
+ defaults: { _controller: core_foo.controller:bar }
diff --git a/tests/controller/config/services.yml b/tests/controller/config/services.yml
new file mode 100644
index 0000000000..e4412af3d7
--- /dev/null
+++ b/tests/controller/config/services.yml
@@ -0,0 +1,3 @@
+services:
+ core_foo.controller:
+ class: phpbb\controller\foo
diff --git a/tests/controller/controller_test.php b/tests/controller/controller_test.php
new file mode 100644
index 0000000000..62feee3fed
--- /dev/null
+++ b/tests/controller/controller_test.php
@@ -0,0 +1,88 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
+
+use Symfony\Component\HttpFoundation\Request;
+use Symfony\Component\Config\FileLocator;
+use Symfony\Component\DependencyInjection\ContainerBuilder;
+use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
+
+class phpbb_controller_controller_test extends phpbb_test_case
+{
+ public function setUp()
+ {
+ $this->extension_manager = new phpbb_mock_extension_manager(
+ dirname(__FILE__) . '/',
+ array(
+ 'vendor2/foo' => array(
+ 'ext_name' => 'vendor2/foo',
+ 'ext_active' => '1',
+ 'ext_path' => 'ext/vendor2/foo/',
+ ),
+ ));
+ }
+
+ public function test_provider()
+ {
+ $provider = new \phpbb\controller\provider();
+ $provider->find_routing_files($this->extension_manager->get_finder());
+ $routes = $provider->find(__DIR__)->get_routes();
+
+ // This will need to be updated if any new routes are defined
+ $this->assertInstanceOf('Symfony\Component\Routing\Route', $routes->get('core_controller'));
+ $this->assertEquals('/core_foo', $routes->get('core_controller')->getPath());
+
+ $this->assertInstanceOf('Symfony\Component\Routing\Route', $routes->get('controller1'));
+ $this->assertEquals('/foo', $routes->get('controller1')->getPath());
+
+ $this->assertInstanceOf('Symfony\Component\Routing\Route', $routes->get('controller2'));
+ $this->assertEquals('/foo/bar', $routes->get('controller2')->getPath());
+
+ $this->assertNull($routes->get('controller_noroute'));
+ }
+
+ public function test_controller_resolver()
+ {
+ $container = new ContainerBuilder();
+ // YamlFileLoader only uses one path at a time, so we need to loop
+ // through all of the ones we are using.
+ foreach (array(__DIR__.'/config', __DIR__ . '/ext/vendor2/foo/config') as $path)
+ {
+ $loader = new YamlFileLoader($container, new FileLocator($path));
+ $loader->load('services.yml');
+ }
+
+ // Autoloading classes within the tests folder does not work
+ // so I'll include them manually.
+ if (!class_exists('vendor2\\foo\\controller'))
+ {
+ include(__DIR__ . '/ext/vendor2/foo/controller.php');
+ }
+ if (!class_exists('phpbb\\controller\\foo'))
+ {
+ include(__DIR__.'/phpbb/controller/foo.php');
+ }
+
+ $resolver = new \phpbb\controller\resolver(new \phpbb\user('\phpbb\datetime'), $container, dirname(__FILE__) . '/');
+ $symfony_request = new Request();
+ $symfony_request->attributes->set('_controller', 'foo.controller:handle');
+
+ $this->assertEquals($resolver->getController($symfony_request), array(new foo\controller, 'handle'));
+
+ $symfony_request = new Request();
+ $symfony_request->attributes->set('_controller', 'core_foo.controller:bar');
+
+ $this->assertEquals($resolver->getController($symfony_request), array(new phpbb\controller\foo, 'bar'));
+ }
+}
diff --git a/tests/controller/ext/vendor2/foo/config/routing.yml b/tests/controller/ext/vendor2/foo/config/routing.yml
new file mode 100644
index 0000000000..e3e8ee5f98
--- /dev/null
+++ b/tests/controller/ext/vendor2/foo/config/routing.yml
@@ -0,0 +1,7 @@
+controller1:
+ path: /foo
+ defaults: { _controller: foo.controller:handle }
+
+include_controller2:
+ resource: "routing_2.yml"
+ prefix: /foo
diff --git a/tests/controller/ext/vendor2/foo/config/routing_2.yml b/tests/controller/ext/vendor2/foo/config/routing_2.yml
new file mode 100644
index 0000000000..ee05898c66
--- /dev/null
+++ b/tests/controller/ext/vendor2/foo/config/routing_2.yml
@@ -0,0 +1,6 @@
+controller2:
+ path: /bar
+ defaults: { _controller: foo.controller:handle }
+controller3:
+ path: /bar/p-{p}
+ defaults: { _controller: foo.controller:handle }
diff --git a/tests/controller/ext/vendor2/foo/config/services.yml b/tests/controller/ext/vendor2/foo/config/services.yml
new file mode 100644
index 0000000000..9ed67d5bc2
--- /dev/null
+++ b/tests/controller/ext/vendor2/foo/config/services.yml
@@ -0,0 +1,3 @@
+services:
+ foo.controller:
+ class: foo\controller
diff --git a/tests/controller/ext/vendor2/foo/controller.php b/tests/controller/ext/vendor2/foo/controller.php
new file mode 100644
index 0000000000..ce2233b3c9
--- /dev/null
+++ b/tests/controller/ext/vendor2/foo/controller.php
@@ -0,0 +1,18 @@
+<?php
+
+namespace foo;
+
+use Symfony\Component\HttpFoundation\Response;
+
+class controller
+{
+ /**
+ * Handle method
+ *
+ * @return null
+ */
+ public function handle()
+ {
+ return new Response('Test', 200);
+ }
+}
diff --git a/tests/controller/ext/vendor2/foo/subfolder/config/routing.yml b/tests/controller/ext/vendor2/foo/subfolder/config/routing.yml
new file mode 100644
index 0000000000..20810a8f25
--- /dev/null
+++ b/tests/controller/ext/vendor2/foo/subfolder/config/routing.yml
@@ -0,0 +1,3 @@
+controller_noroute:
+ path: /donotfindthis
+ defaults: { _controller: foo.controller:handle }
diff --git a/tests/controller/helper_route_adm_subdir_test.php b/tests/controller/helper_route_adm_subdir_test.php
new file mode 100644
index 0000000000..f27ac81b04
--- /dev/null
+++ b/tests/controller/helper_route_adm_subdir_test.php
@@ -0,0 +1,33 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
+require_once dirname(__FILE__) . '/common_helper_route.php';
+
+class phpbb_controller_helper_route_adm_subdir_test extends phpbb_controller_common_helper_route
+{
+ protected function get_phpbb_root_path()
+ {
+ return './../../';
+ }
+
+ protected function get_uri()
+ {
+ return '/adm/subdir/index.php';
+ }
+
+ protected function get_script_name()
+ {
+ return 'index.php';
+ }
+}
diff --git a/tests/controller/helper_route_adm_test.php b/tests/controller/helper_route_adm_test.php
new file mode 100644
index 0000000000..86dc36ef1f
--- /dev/null
+++ b/tests/controller/helper_route_adm_test.php
@@ -0,0 +1,33 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
+require_once dirname(__FILE__) . '/common_helper_route.php';
+
+class phpbb_controller_helper_route_adm_test extends phpbb_controller_common_helper_route
+{
+ protected function get_phpbb_root_path()
+ {
+ return './../';
+ }
+
+ protected function get_uri()
+ {
+ return '/adm/index.php';
+ }
+
+ protected function get_script_name()
+ {
+ return 'index.php';
+ }
+}
diff --git a/tests/controller/helper_route_other_app.php b/tests/controller/helper_route_other_app.php
new file mode 100644
index 0000000000..e5513a5180
--- /dev/null
+++ b/tests/controller/helper_route_other_app.php
@@ -0,0 +1,37 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+require_once dirname(__FILE__) . '/common_helper_route.php';
+
+class phpbb_controller_helper_route_other_app_test extends phpbb_controller_common_helper_route
+{
+ protected function get_phpbb_root_path()
+ {
+ return './../';
+ }
+
+ protected function get_uri()
+ {
+ return '/foo/app.php';
+ }
+
+ protected function get_script_name()
+ {
+ return 'app.php';
+ }
+
+ protected function path_to_app()
+ {
+ return 'foo/';
+ }
+}
diff --git a/tests/controller/helper_route_root_test.php b/tests/controller/helper_route_root_test.php
new file mode 100644
index 0000000000..63a2f2f8f7
--- /dev/null
+++ b/tests/controller/helper_route_root_test.php
@@ -0,0 +1,33 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
+require_once dirname(__FILE__) . '/common_helper_route.php';
+
+class phpbb_controller_helper_route_test extends phpbb_controller_common_helper_route
+{
+ protected function get_phpbb_root_path()
+ {
+ return '';
+ }
+
+ protected function get_uri()
+ {
+ return '/app.php';
+ }
+
+ protected function get_script_name()
+ {
+ return 'app.php';
+ }
+}
diff --git a/tests/controller/helper_route_slash_test.php b/tests/controller/helper_route_slash_test.php
new file mode 100644
index 0000000000..3db5ec19e5
--- /dev/null
+++ b/tests/controller/helper_route_slash_test.php
@@ -0,0 +1,43 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
+require_once dirname(__FILE__) . '/common_helper_route.php';
+
+class phpbb_controller_helper_route_slash_test extends phpbb_controller_common_helper_route
+{
+ protected function get_phpbb_root_path()
+ {
+ return './../';
+ }
+
+ protected function get_uri()
+ {
+ return '/phpBB3/app.php';
+ }
+
+ protected function get_base_uri()
+ {
+ return '/phpBB3/';
+ }
+
+ protected function get_script_name()
+ {
+ return 'app.php';
+ }
+
+ protected function path_to_app()
+ {
+ return 'phpBB3/';
+ }
+}
diff --git a/tests/controller/helper_route_unclean_path_test.php b/tests/controller/helper_route_unclean_path_test.php
new file mode 100644
index 0000000000..9d8b62bc1c
--- /dev/null
+++ b/tests/controller/helper_route_unclean_path_test.php
@@ -0,0 +1,33 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
+require_once dirname(__FILE__) . '/common_helper_route.php';
+
+class phpbb_controller_helper_route_unclean_path_test extends phpbb_controller_common_helper_route
+{
+ protected function get_phpbb_root_path()
+ {
+ return './../';
+ }
+
+ protected function get_uri()
+ {
+ return '/adm/../bertie/index.php';
+ }
+
+ protected function get_script_name()
+ {
+ return 'index.php';
+ }
+}
diff --git a/tests/controller/phpbb/controller/foo.php b/tests/controller/phpbb/controller/foo.php
new file mode 100644
index 0000000000..98669f428f
--- /dev/null
+++ b/tests/controller/phpbb/controller/foo.php
@@ -0,0 +1,18 @@
+<?php
+
+namespace phpbb\controller;
+
+use Symfony\Component\HttpFoundation\Response;
+
+class foo
+{
+ /**
+ * Bar method
+ *
+ * @return null
+ */
+ public function bar()
+ {
+ return new Response('bar()', 200);
+ }
+}
diff --git a/tests/cron/ext/testext/cron/dummy_task.php b/tests/cron/ext/testext/cron/dummy_task.php
new file mode 100644
index 0000000000..5c474dca4f
--- /dev/null
+++ b/tests/cron/ext/testext/cron/dummy_task.php
@@ -0,0 +1,32 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+class phpbb_ext_testext_cron_dummy_task extends \phpbb\cron\task\base
+{
+ static public $was_run = 0;
+
+ public function get_name()
+ {
+ return get_class($this);
+ }
+
+ public function run()
+ {
+ self::$was_run++;
+ }
+
+ public function should_run()
+ {
+ return true;
+ }
+}
diff --git a/tests/cron/includes/cron/task/core/dummy_task.php b/tests/cron/includes/cron/task/core/dummy_task.php
new file mode 100644
index 0000000000..1ef28c5cca
--- /dev/null
+++ b/tests/cron/includes/cron/task/core/dummy_task.php
@@ -0,0 +1,32 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+class phpbb_cron_task_core_dummy_task extends \phpbb\cron\task\base
+{
+ static public $was_run = 0;
+
+ public function get_name()
+ {
+ return get_class($this);
+ }
+
+ public function run()
+ {
+ self::$was_run++;
+ }
+
+ public function should_run()
+ {
+ return true;
+ }
+}
diff --git a/tests/cron/includes/cron/task/core/second_dummy_task.php b/tests/cron/includes/cron/task/core/second_dummy_task.php
new file mode 100644
index 0000000000..ada175a501
--- /dev/null
+++ b/tests/cron/includes/cron/task/core/second_dummy_task.php
@@ -0,0 +1,32 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+class phpbb_cron_task_core_second_dummy_task extends \phpbb\cron\task\base
+{
+ static public $was_run = 0;
+
+ public function get_name()
+ {
+ return get_class($this);
+ }
+
+ public function run()
+ {
+ self::$was_run++;
+ }
+
+ public function should_run()
+ {
+ return true;
+ }
+}
diff --git a/tests/cron/manager_test.php b/tests/cron/manager_test.php
new file mode 100644
index 0000000000..f4dd69b19b
--- /dev/null
+++ b/tests/cron/manager_test.php
@@ -0,0 +1,80 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+require_once dirname(__FILE__) . '/includes/cron/task/core/dummy_task.php';
+require_once dirname(__FILE__) . '/includes/cron/task/core/second_dummy_task.php';
+require_once dirname(__FILE__) . '/ext/testext/cron/dummy_task.php';
+require_once dirname(__FILE__) . '/tasks/simple_ready.php';
+require_once dirname(__FILE__) . '/tasks/simple_not_runnable.php';
+require_once dirname(__FILE__) . '/tasks/simple_should_not_run.php';
+
+class phpbb_cron_manager_test extends \phpbb_test_case
+{
+ public function setUp()
+ {
+ $this->manager = $this->create_cron_manager(array(
+ new phpbb_cron_task_core_dummy_task(),
+ new phpbb_cron_task_core_second_dummy_task(),
+ new phpbb_ext_testext_cron_dummy_task(),
+ ));
+ $this->task_name = 'phpbb_cron_task_core_dummy_task';
+ }
+
+ public function test_manager_finds_shipped_task_by_name()
+ {
+ $task = $this->manager->find_task($this->task_name);
+ $this->assertInstanceOf('\phpbb\cron\task\wrapper', $task);
+ $this->assertEquals($this->task_name, $task->get_name());
+ }
+
+ public function test_manager_finds_all_ready_tasks()
+ {
+ $tasks = $this->manager->find_all_ready_tasks();
+ $this->assertEquals(3, sizeof($tasks));
+ }
+
+ public function test_manager_finds_one_ready_task()
+ {
+ $task = $this->manager->find_one_ready_task();
+ $this->assertInstanceOf('\phpbb\cron\task\wrapper', $task);
+ }
+
+ public function test_manager_finds_only_ready_tasks()
+ {
+ $manager = $this->create_cron_manager(array(
+ new phpbb_cron_task_core_simple_ready(),
+ new phpbb_cron_task_core_simple_not_runnable(),
+ new phpbb_cron_task_core_simple_should_not_run(),
+ ));
+ $tasks = $manager->find_all_ready_tasks();
+ $task_names = $this->tasks_to_names($tasks);
+ $this->assertEquals(array('phpbb_cron_task_core_simple_ready'), $task_names);
+ }
+
+ private function tasks_to_names($tasks)
+ {
+ $names = array();
+ foreach ($tasks as $task)
+ {
+ $names[] = $task->get_name();
+ }
+ return $names;
+ }
+
+ private function create_cron_manager($tasks)
+ {
+ global $phpbb_root_path, $phpEx;
+
+ return new \phpbb\cron\manager($tasks, $phpbb_root_path, $phpEx);
+ }
+}
diff --git a/tests/cron/tasks/simple_not_runnable.php b/tests/cron/tasks/simple_not_runnable.php
new file mode 100644
index 0000000000..4951b5b4b9
--- /dev/null
+++ b/tests/cron/tasks/simple_not_runnable.php
@@ -0,0 +1,18 @@
+<?php
+
+class phpbb_cron_task_core_simple_not_runnable extends \phpbb\cron\task\base
+{
+ public function get_name()
+ {
+ return get_class($this);
+ }
+
+ public function run()
+ {
+ }
+
+ public function is_runnable()
+ {
+ return false;
+ }
+}
diff --git a/tests/cron/tasks/simple_ready.php b/tests/cron/tasks/simple_ready.php
new file mode 100644
index 0000000000..245d9ba738
--- /dev/null
+++ b/tests/cron/tasks/simple_ready.php
@@ -0,0 +1,13 @@
+<?php
+
+class phpbb_cron_task_core_simple_ready extends \phpbb\cron\task\base
+{
+ public function get_name()
+ {
+ return get_class($this);
+ }
+
+ public function run()
+ {
+ }
+}
diff --git a/tests/cron/tasks/simple_should_not_run.php b/tests/cron/tasks/simple_should_not_run.php
new file mode 100644
index 0000000000..7bd9df31b6
--- /dev/null
+++ b/tests/cron/tasks/simple_should_not_run.php
@@ -0,0 +1,18 @@
+<?php
+
+class phpbb_cron_task_core_simple_should_not_run extends \phpbb\cron\task\base
+{
+ public function get_name()
+ {
+ return get_class($this);
+ }
+
+ public function run()
+ {
+ }
+
+ public function should_run()
+ {
+ return false;
+ }
+}
diff --git a/tests/datetime/from_format_test.php b/tests/datetime/from_format_test.php
new file mode 100644
index 0000000000..8968619bb5
--- /dev/null
+++ b/tests/datetime/from_format_test.php
@@ -0,0 +1,126 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+require_once dirname(__FILE__) . '/../mock/lang.php';
+
+class phpbb_datetime_from_format_test extends phpbb_test_case
+{
+ public function from_format_data()
+ {
+ return array(
+ array(
+ 'UTC',
+ 'Y-m-d',
+ '2012-06-08',
+ ),
+
+ array(
+ 'Europe/Berlin',
+ 'Y-m-d H:i:s',
+ '2012-06-08 14:01:02',
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider from_format_data()
+ */
+ public function test_from_format($timezone, $format, $expected)
+ {
+ $user = new \phpbb\user('\phpbb\datetime');
+ $user->timezone = new DateTimeZone($timezone);
+ $user->lang['datetime'] = array(
+ 'TODAY' => 'Today',
+ 'TOMORROW' => 'Tomorrow',
+ 'YESTERDAY' => 'Yesterday',
+ 'AGO' => array(
+ 0 => 'less than a minute ago',
+ 1 => '%d minute ago',
+ 2 => '%d minutes ago',
+ ),
+ );
+
+ $timestamp = $user->get_timestamp_from_format($format, $expected, new DateTimeZone($timezone));
+ $this->assertEquals($expected, $user->format_date($timestamp, $format, true));
+ }
+
+
+ public function relative_format_date_data()
+ {
+ // If the current time is too close to the testing time,
+ // the relative time will use "x minutes ago" instead of "today ..."
+ // So we use 18:01 in the morning and 06:01 in the afternoon.
+ $testing_time = gmdate('H') <= 12 ? '18:01' : '06:01';
+
+ return array(
+ array(
+ gmdate('Y-m-d', time() + 2 * 86400) . ' ' . $testing_time, false,
+ gmdate('Y-m-d', time() + 2 * 86400) . ' ' . $testing_time,
+ ),
+
+ array(
+ gmdate('Y-m-d', time() + 86400) . ' ' . $testing_time, false,
+ 'Tomorrow ' . $testing_time,
+ ),
+ array(
+ gmdate('Y-m-d', time() + 86400) . ' ' . $testing_time, true,
+ gmdate('Y-m-d', time() + 86400) . ' ' . $testing_time,
+ ),
+
+ array(
+ gmdate('Y-m-d') . ' ' . $testing_time, false,
+ 'Today ' . $testing_time,
+ ),
+ array(
+ gmdate('Y-m-d') . ' ' . $testing_time, true,
+ gmdate('Y-m-d') . ' ' . $testing_time,
+ ),
+
+ array(
+ gmdate('Y-m-d', time() - 86400) . ' ' . $testing_time, false,
+ 'Yesterday ' . $testing_time,
+ ),
+ array(
+ gmdate('Y-m-d', time() - 86400) . ' ' . $testing_time, true,
+ gmdate('Y-m-d', time() - 86400) . ' ' . $testing_time,
+ ),
+
+ array(
+ gmdate('Y-m-d', time() - 2 * 86400) . ' ' . $testing_time, false,
+ gmdate('Y-m-d', time() - 2 * 86400) . ' ' . $testing_time,
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider relative_format_date_data()
+ */
+ public function test_relative_format_date($timestamp, $forcedate, $expected)
+ {
+ $user = new \phpbb\user('\phpbb\datetime');
+ $user->timezone = new DateTimeZone('UTC');
+ $user->lang['datetime'] = array(
+ 'TODAY' => 'Today',
+ 'TOMORROW' => 'Tomorrow',
+ 'YESTERDAY' => 'Yesterday',
+ 'AGO' => array(
+ 0 => 'less than a minute ago',
+ 1 => '%d minute ago',
+ 2 => '%d minutes ago',
+ ),
+ );
+
+ $timestamp = $user->get_timestamp_from_format('Y-m-d H:i', $timestamp, new DateTimeZone('UTC'));
+ $this->assertEquals($expected, $user->format_date($timestamp, '|Y-m-d| H:i', $forcedate));
+ }
+}
diff --git a/tests/dbal/auto_increment_test.php b/tests/dbal/auto_increment_test.php
index e87fc1c6bd..1ed8ea29e3 100644
--- a/tests/dbal/auto_increment_test.php
+++ b/tests/dbal/auto_increment_test.php
@@ -1,14 +1,17 @@
<?php
/**
*
-* @package testing
-* @copyright (c) 2012 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
-require_once dirname(__FILE__) . '/../../phpBB/includes/db/db_tools.php';
class phpbb_dbal_auto_increment_test extends phpbb_database_test_case
{
@@ -27,7 +30,7 @@ class phpbb_dbal_auto_increment_test extends phpbb_database_test_case
parent::setUp();
$this->db = $this->new_dbal();
- $this->tools = new phpbb_db_tools($this->db);
+ $this->tools = new \phpbb\db\tools($this->db);
$this->table_data = array(
'COLUMNS' => array(
diff --git a/tests/dbal/case_test.php b/tests/dbal/case_test.php
new file mode 100644
index 0000000000..5f1c7d61fa
--- /dev/null
+++ b/tests/dbal/case_test.php
@@ -0,0 +1,73 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+class phpbb_dbal_case_test extends phpbb_database_test_case
+{
+ public function getDataSet()
+ {
+ return $this->createXMLDataSet(dirname(__FILE__).'/fixtures/config.xml');
+ }
+
+ public function test_case_int()
+ {
+ $db = $this->new_dbal();
+
+ $sql = 'SELECT ' . $db->sql_case('1 = 1', '1', '2') . ' AS test_num
+ FROM phpbb_config';
+ $result = $db->sql_query_limit($sql, 1);
+
+ $this->assertEquals(1, (int) $db->sql_fetchfield('test_num'));
+
+ $sql = 'SELECT ' . $db->sql_case('1 = 0', '1', '2') . ' AS test_num
+ FROM phpbb_config';
+ $result = $db->sql_query_limit($sql, 1);
+
+ $this->assertEquals(2, (int) $db->sql_fetchfield('test_num'));
+ }
+
+ public function test_case_string()
+ {
+ $db = $this->new_dbal();
+
+ $sql = 'SELECT ' . $db->sql_case('1 = 1', "'foo'", "'bar'") . ' AS test_string
+ FROM phpbb_config';
+ $result = $db->sql_query_limit($sql, 1);
+
+ $this->assertEquals('foo', $db->sql_fetchfield('test_string'));
+
+ $sql = 'SELECT ' . $db->sql_case('1 = 0', "'foo'", "'bar'") . ' AS test_string
+ FROM phpbb_config';
+ $result = $db->sql_query_limit($sql, 1);
+
+ $this->assertEquals('bar', $db->sql_fetchfield('test_string'));
+ }
+
+ public function test_case_column()
+ {
+ $db = $this->new_dbal();
+
+ $sql = 'SELECT ' . $db->sql_case("config_name = 'config1'", 'config_name', 'config_value') . " AS test_string
+ FROM phpbb_config
+ WHERE config_name = 'config1'";
+ $result = $db->sql_query_limit($sql, 1);
+
+ $this->assertEquals('config1', $db->sql_fetchfield('test_string'));
+
+ $sql = 'SELECT ' . $db->sql_case("config_name = 'config1'", 'config_name', 'config_value') . " AS test_string
+ FROM phpbb_config
+ WHERE config_value = 'bar'";
+ $result = $db->sql_query_limit($sql, 1);
+
+ $this->assertEquals('bar', $db->sql_fetchfield('test_string'));
+ }
+}
diff --git a/tests/dbal/concatenate_test.php b/tests/dbal/concatenate_test.php
new file mode 100644
index 0000000000..00e7e107aa
--- /dev/null
+++ b/tests/dbal/concatenate_test.php
@@ -0,0 +1,68 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+class phpbb_dbal_concatenate_test extends phpbb_database_test_case
+{
+ public function getDataSet()
+ {
+ return $this->createXMLDataSet(dirname(__FILE__).'/fixtures/config.xml');
+ }
+
+ public function test_concatenate_string()
+ {
+ $db = $this->new_dbal();
+
+ $sql = 'SELECT config_name, ' . $db->sql_concatenate('config_name', "'" . $db->sql_escape('append') . "'") . ' AS string
+ FROM phpbb_config';
+ $result = $db->sql_query($sql);
+
+ $db->sql_return_on_error(false);
+
+ $this->assertEquals(array(
+ array(
+ 'config_name' => 'config1',
+ 'string' => 'config1append',
+ ),
+ array(
+ 'config_name' => 'config2',
+ 'string' => 'config2append',
+ ),
+ ),
+ $db->sql_fetchrowset($result)
+ );
+ }
+
+ public function test_concatenate_statement()
+ {
+ $db = $this->new_dbal();
+
+ $sql = 'SELECT config_name, ' . $db->sql_concatenate('config_name', 'config_value') . ' AS string
+ FROM phpbb_config';
+ $result = $db->sql_query($sql);
+
+ $db->sql_return_on_error(false);
+
+ $this->assertEquals(array(
+ array(
+ 'config_name' => 'config1',
+ 'string' => 'config1foo',
+ ),
+ array(
+ 'config_name' => 'config2',
+ 'string' => 'config2bar',
+ ),
+ ),
+ $db->sql_fetchrowset($result)
+ );
+ }
+}
diff --git a/tests/dbal/connect_test.php b/tests/dbal/connect_test.php
index 505ce28fa1..1ae34bd2b6 100644
--- a/tests/dbal/connect_test.php
+++ b/tests/dbal/connect_test.php
@@ -1,9 +1,13 @@
<?php
/**
*
-* @package testing
-* @copyright (c) 2012 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -22,9 +26,7 @@ class phpbb_dbal_connect_test extends phpbb_database_test_case
$config = $this->get_database_config();
- require_once dirname(__FILE__) . '/../../phpBB/includes/db/' . $config['dbms'] . '.php';
- $dbal = 'dbal_' . $config['dbms'];
- $db = new $dbal();
+ $db = new $config['dbms']();
// Failure to connect results in a trigger_error call in dbal.
// phpunit converts triggered errors to exceptions.
diff --git a/tests/dbal/cross_join_test.php b/tests/dbal/cross_join_test.php
index 6c6b8a8449..7ba937ccc6 100644
--- a/tests/dbal/cross_join_test.php
+++ b/tests/dbal/cross_join_test.php
@@ -1,9 +1,13 @@
<?php
/**
*
-* @package testing
-* @copyright (c) 2011 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
diff --git a/tests/dbal/db_tools_test.php b/tests/dbal/db_tools_test.php
index c20e46011f..5832b966d8 100644
--- a/tests/dbal/db_tools_test.php
+++ b/tests/dbal/db_tools_test.php
@@ -1,18 +1,23 @@
<?php
/**
*
-* @package testing
-* @copyright (c) 2011 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
-require_once dirname(__FILE__) . '/../../phpBB/includes/db/db_tools.php';
class phpbb_dbal_db_tools_test extends phpbb_database_test_case
{
+ /** @var \phpbb\db\driver\driver_interface */
protected $db;
+ /** @var \phpbb\db\tools */
protected $tools;
protected $table_exists;
protected $table_data;
@@ -27,7 +32,7 @@ class phpbb_dbal_db_tools_test extends phpbb_database_test_case
parent::setUp();
$this->db = $this->new_dbal();
- $this->tools = new phpbb_db_tools($this->db);
+ $this->tools = new \phpbb\db\tools($this->db);
$this->table_data = array(
'COLUMNS' => array(
@@ -41,6 +46,7 @@ class phpbb_dbal_db_tools_test extends phpbb_database_test_case
'c_bool' => array('BOOL', 1),
'c_vchar' => array('VCHAR', 'foo'),
'c_vchar_size' => array('VCHAR:4', 'foo'),
+ 'c_vchar_null' => array('VCHAR', null),
'c_char_size' => array('CHAR:4', 'foo'),
'c_xstext' => array('XSTEXT', 'foo'),
'c_stext' => array('STEXT', 'foo'),
@@ -106,6 +112,7 @@ class phpbb_dbal_db_tools_test extends phpbb_database_test_case
'c_bool' => 0,
'c_vchar' => '',
'c_vchar_size' => '',
+ 'c_vchar_null' => null,
'c_char_size' => 'abcd',
'c_xstext' => '',
'c_stext' => '',
@@ -139,6 +146,7 @@ class phpbb_dbal_db_tools_test extends phpbb_database_test_case
array('c_bool', 0),
array('c_vchar', str_repeat('a', 255)),
array('c_vchar_size', str_repeat('a', 4)),
+ array('c_vchar_null', str_repeat('a', 4)),
array('c_char_size', str_repeat('a', 4)),
array('c_xstext', str_repeat('a', 1000)),
array('c_stext', str_repeat('a', 3000)),
@@ -208,6 +216,50 @@ class phpbb_dbal_db_tools_test extends phpbb_database_test_case
$this->assertFalse($this->tools->sql_column_exists('prefix_table_name', 'column_does_not_exist'));
}
+ public function test_column_change_with_index()
+ {
+ // Create column
+ $this->assertFalse($this->tools->sql_column_exists('prefix_table_name', 'c_bug_12012'));
+ $this->assertTrue($this->tools->sql_column_add('prefix_table_name', 'c_bug_12012', array('DECIMAL', 0)));
+ $this->assertTrue($this->tools->sql_column_exists('prefix_table_name', 'c_bug_12012'));
+
+ // Create index over the column
+ $this->assertFalse($this->tools->sql_index_exists('prefix_table_name', 'i_bug_12012'));
+ $this->assertTrue($this->tools->sql_create_index('prefix_table_name', 'i_bug_12012', array('c_bug_12012', 'c_bool')));
+ $this->assertTrue($this->tools->sql_index_exists('prefix_table_name', 'i_bug_12012'));
+
+ // Change type from int to string
+ $this->assertTrue($this->tools->sql_column_change('prefix_table_name', 'c_bug_12012', array('VCHAR:100', '')));
+
+ // Remove the index
+ $this->assertTrue($this->tools->sql_index_exists('prefix_table_name', 'i_bug_12012'));
+ $this->assertTrue($this->tools->sql_index_drop('prefix_table_name', 'i_bug_12012'));
+ $this->assertFalse($this->tools->sql_index_exists('prefix_table_name', 'i_bug_12012'));
+
+ // Remove the column
+ $this->assertTrue($this->tools->sql_column_exists('prefix_table_name', 'c_bug_12012'));
+ $this->assertTrue($this->tools->sql_column_remove('prefix_table_name', 'c_bug_12012'));
+ $this->assertFalse($this->tools->sql_column_exists('prefix_table_name', 'c_bug_12012'));
+ }
+
+ public function test_column_change_with_composite_primary()
+ {
+ // Remove the old primary key
+ $this->assertTrue($this->tools->sql_column_remove('prefix_table_name', 'c_id'));
+ $this->assertTrue($this->tools->sql_column_add('prefix_table_name', 'c_id', array('UINT', 0)));
+
+ // Create a composite key
+ $this->assertTrue($this->tools->sql_create_primary_key('prefix_table_name', array('c_id', 'c_uint')));
+
+ // Create column
+ $this->assertFalse($this->tools->sql_column_exists('prefix_table_name', 'c_bug_12643'));
+ $this->assertTrue($this->tools->sql_column_add('prefix_table_name', 'c_bug_12643', array('DECIMAL', 0)));
+ $this->assertTrue($this->tools->sql_column_exists('prefix_table_name', 'c_bug_12643'));
+
+ // Change type from int to string
+ $this->assertTrue($this->tools->sql_column_change('prefix_table_name', 'c_bug_12643', array('VCHAR:100', '')));
+ }
+
public function test_column_remove()
{
$this->assertTrue($this->tools->sql_column_exists('prefix_table_name', 'c_int_size'));
@@ -217,6 +269,39 @@ class phpbb_dbal_db_tools_test extends phpbb_database_test_case
$this->assertFalse($this->tools->sql_column_exists('prefix_table_name', 'c_int_size'));
}
+ public function test_column_remove_similar_name()
+ {
+ $this->assertTrue($this->tools->sql_column_exists('prefix_table_name', 'c_vchar'));
+ $this->assertTrue($this->tools->sql_column_exists('prefix_table_name', 'c_vchar_size'));
+
+ $this->assertTrue($this->tools->sql_column_remove('prefix_table_name', 'c_vchar'));
+
+ $this->assertFalse($this->tools->sql_column_exists('prefix_table_name', 'c_vchar'));
+ $this->assertTrue($this->tools->sql_column_exists('prefix_table_name', 'c_vchar_size'));
+ }
+
+ public function test_column_remove_with_index()
+ {
+ // Create column
+ $this->assertFalse($this->tools->sql_column_exists('prefix_table_name', 'c_bug_12012_2'));
+ $this->assertTrue($this->tools->sql_column_add('prefix_table_name', 'c_bug_12012_2', array('UINT', 4)));
+ $this->assertTrue($this->tools->sql_column_exists('prefix_table_name', 'c_bug_12012_2'));
+
+ // Create index over the column
+ $this->assertFalse($this->tools->sql_index_exists('prefix_table_name', 'bug_12012_2'));
+ $this->assertTrue($this->tools->sql_create_index('prefix_table_name', 'bug_12012_2', array('c_bug_12012_2', 'c_bool')));
+ $this->assertTrue($this->tools->sql_index_exists('prefix_table_name', 'bug_12012_2'));
+
+ $this->assertFalse($this->tools->sql_index_exists('prefix_table_name', 'bug_12012_3'));
+ $this->assertTrue($this->tools->sql_create_index('prefix_table_name', 'bug_12012_3', array('c_bug_12012_2')));
+ $this->assertTrue($this->tools->sql_index_exists('prefix_table_name', 'bug_12012_3'));
+
+ // Remove the column
+ $this->assertTrue($this->tools->sql_column_exists('prefix_table_name', 'c_bug_12012_2'));
+ $this->assertTrue($this->tools->sql_column_remove('prefix_table_name', 'c_bug_12012_2'));
+ $this->assertFalse($this->tools->sql_column_exists('prefix_table_name', 'c_bug_12012_2'));
+ }
+
public function test_column_remove_primary()
{
$this->assertTrue($this->tools->sql_column_exists('prefix_table_name', 'c_id'));
@@ -253,9 +338,9 @@ class phpbb_dbal_db_tools_test extends phpbb_database_test_case
$this->assertFalse($this->tools->sql_table_exists('prefix_test_table'));
}
- public function test_peform_schema_changes_drop_tables()
+ public function test_perform_schema_changes_drop_tables()
{
- $db_tools = $this->getMock('phpbb_db_tools', array(
+ $db_tools = $this->getMock('\phpbb\db\tools', array(
'sql_table_exists',
'sql_table_drop',
), array(&$this->db));
@@ -279,9 +364,9 @@ class phpbb_dbal_db_tools_test extends phpbb_database_test_case
));
}
- public function test_peform_schema_changes_drop_columns()
+ public function test_perform_schema_changes_drop_columns()
{
- $db_tools = $this->getMock('phpbb_db_tools', array(
+ $db_tools = $this->getMock('\phpbb\db\tools', array(
'sql_column_exists',
'sql_column_remove',
), array(&$this->db));
@@ -330,4 +415,11 @@ class phpbb_dbal_db_tools_test extends phpbb_database_test_case
$this->tools->sql_create_unique_index('prefix_table_name', 'i_uniq_ts_id', array('c_timestamp', 'c_id'));
$this->assertTrue($this->tools->sql_unique_index_exists('prefix_table_name', 'i_uniq_ts_id'));
}
+
+ public function test_create_int_default_null()
+ {
+ $this->assertFalse($this->tools->sql_column_exists('prefix_table_name', 'c_bug_13282'));
+ $this->assertTrue($this->tools->sql_column_add('prefix_table_name', 'c_bug_13282', array('TINT:2')));
+ $this->assertTrue($this->tools->sql_column_exists('prefix_table_name', 'c_bug_13282'));
+ }
}
diff --git a/tests/dbal/fixtures/massmail_crossjoin.xml b/tests/dbal/fixtures/massmail_crossjoin.xml
index ef0a2b7149..1050ba067e 100644
--- a/tests/dbal/fixtures/massmail_crossjoin.xml
+++ b/tests/dbal/fixtures/massmail_crossjoin.xml
@@ -14,16 +14,12 @@
<column>username_clean</column>
<column>user_permissions</column>
<column>user_sig</column>
- <column>user_occ</column>
- <column>user_interests</column>
<row>
<value>1</value>
<value>mass email</value>
<value>mass email</value>
<value></value>
<value></value>
- <value></value>
- <value></value>
</row>
<row>
<value>2</value>
@@ -31,8 +27,6 @@
<value>banned</value>
<value></value>
<value></value>
- <value></value>
- <value></value>
</row>
<row>
<value>3</value>
@@ -40,8 +34,6 @@
<value>not in group</value>
<value></value>
<value></value>
- <value></value>
- <value></value>
</row>
</table>
<table name="phpbb_user_group">
diff --git a/tests/dbal/fixtures/migrator.xml b/tests/dbal/fixtures/migrator.xml
new file mode 100644
index 0000000000..25be4d4129
--- /dev/null
+++ b/tests/dbal/fixtures/migrator.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<dataset>
+ <table name="phpbb_migrations">
+ <column>migration_name</column>
+ <column>migration_depends_on</column>
+ <column>migration_schema_done</column>
+ <column>migration_data_done</column>
+ <column>migration_data_state</column>
+ <column>migration_start_time</column>
+ <column>migration_end_time</column>
+ <row>
+ <value>installed_migration</value>
+ <value></value>
+ <value>1</value>
+ <value>1</value>
+ <value></value>
+ <value>1234</value>
+ <value>5678</value>
+ </row>
+ </table>
+ <table name="phpbb_config">
+ <column>config_name</column>
+ <column>config_value</column>
+ <row>
+ <value>foo</value>
+ <value>bar</value>
+ </row>
+ </table>
+</dataset>
diff --git a/tests/dbal/fixtures/migrator_config_text.xml b/tests/dbal/fixtures/migrator_config_text.xml
new file mode 100644
index 0000000000..ba8e1fcfcc
--- /dev/null
+++ b/tests/dbal/fixtures/migrator_config_text.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<dataset>
+ <table name="phpbb_config_text">
+ <column>config_name</column>
+ <column>config_value</column>
+ </table>
+</dataset>
diff --git a/tests/dbal/fixtures/migrator_module.xml b/tests/dbal/fixtures/migrator_module.xml
new file mode 100644
index 0000000000..e85c43ee25
--- /dev/null
+++ b/tests/dbal/fixtures/migrator_module.xml
@@ -0,0 +1,133 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<dataset>
+ <table name="phpbb_modules">
+ <column>module_id</column>
+ <column>module_enabled</column>
+ <column>module_display</column>
+ <column>module_basename</column>
+ <column>module_class</column>
+ <column>parent_id</column>
+ <column>left_id</column>
+ <column>right_id</column>
+ <column>module_langname</column>
+ <column>module_mode</column>
+ <column>module_auth</column>
+ <row>
+ <value>1</value>
+ <value>1</value>
+ <value>1</value>
+ <value></value>
+ <value>acp</value>
+ <value>0</value>
+ <value>1</value>
+ <value>6</value>
+ <value>ACP_CAT</value>
+ <value></value>
+ <value></value>
+ </row>
+ <row>
+ <value>2</value>
+ <value>1</value>
+ <value>1</value>
+ <value>acp_test</value>
+ <value>acp</value>
+ <value>1</value>
+ <value>2</value>
+ <value>3</value>
+ <value>ACP_MODULE</value>
+ <value>test</value>
+ <value></value>
+ </row>
+ <row>
+ <value>3</value>
+ <value>1</value>
+ <value>1</value>
+ <value></value>
+ <value>acp</value>
+ <value>1</value>
+ <value>4</value>
+ <value>5</value>
+ <value>ACP_FORUM_BASED_PERMISSIONS</value>
+ <value></value>
+ <value></value>
+ </row>
+ <row>
+ <value>4</value>
+ <value>1</value>
+ <value>1</value>
+ <value></value>
+ <value>acp</value>
+ <value>0</value>
+ <value>7</value>
+ <value>12</value>
+ <value>ACP_CAT_FORUMS</value>
+ <value></value>
+ <value></value>
+ </row>
+ <row>
+ <value>5</value>
+ <value>1</value>
+ <value>1</value>
+ <value></value>
+ <value>acp</value>
+ <value>4</value>
+ <value>8</value>
+ <value>11</value>
+ <value>ACP_FORUM_BASED_PERMISSIONS</value>
+ <value></value>
+ <value></value>
+ </row>
+ <row>
+ <value>6</value>
+ <value>1</value>
+ <value>1</value>
+ <value></value>
+ <value>acp</value>
+ <value>5</value>
+ <value>9</value>
+ <value>10</value>
+ <value>ACP_FORUM_BASED_PERMISSIONS_CHILD_1</value>
+ <value></value>
+ <value></value>
+ </row>
+ <row>
+ <value>7</value>
+ <value>1</value>
+ <value>1</value>
+ <value></value>
+ <value>ucp</value>
+ <value>0</value>
+ <value>13</value>
+ <value>18</value>
+ <value>UCP_MAIN_CAT</value>
+ <value></value>
+ <value></value>
+ </row>
+ <row>
+ <value>8</value>
+ <value>1</value>
+ <value>1</value>
+ <value>ucp_subcat</value>
+ <value>ucp</value>
+ <value>7</value>
+ <value>14</value>
+ <value>17</value>
+ <value>UCP_SUBCATEGORY</value>
+ <value>ucp_test</value>
+ <value></value>
+ </row>
+ <row>
+ <value>9</value>
+ <value>1</value>
+ <value>1</value>
+ <value>ucp_module</value>
+ <value>ucp</value>
+ <value>8</value>
+ <value>15</value>
+ <value>16</value>
+ <value>UCP_MODULE</value>
+ <value>ucp_module_test</value>
+ <value></value>
+ </row>
+ </table>
+</dataset>
diff --git a/tests/dbal/fixtures/migrator_permission.xml b/tests/dbal/fixtures/migrator_permission.xml
new file mode 100644
index 0000000000..c07956fa85
--- /dev/null
+++ b/tests/dbal/fixtures/migrator_permission.xml
@@ -0,0 +1,165 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<dataset>
+ <table name="phpbb_acl_options">
+ <column>auth_option_id</column>
+ <column>auth_option</column>
+ <column>is_global</column>
+ <column>is_local</column>
+ <column>founder_only</column>
+ <row>
+ <value>1</value>
+ <value>global</value>
+ <value>1</value>
+ <value>0</value>
+ <value>0</value>
+ </row>
+ <row>
+ <value>2</value>
+ <value>local</value>
+ <value>0</value>
+ <value>1</value>
+ <value>0</value>
+ </row>
+ <row>
+ <value>3</value>
+ <value>both</value>
+ <value>1</value>
+ <value>1</value>
+ <value>0</value>
+ </row>
+ <row>
+ <value>4</value>
+ <value>a_test</value>
+ <value>1</value>
+ <value>0</value>
+ <value>0</value>
+ </row>
+ <row>
+ <value>5</value>
+ <value>m_test</value>
+ <value>1</value>
+ <value>0</value>
+ <value>0</value>
+ </row>
+ <row>
+ <value>6</value>
+ <value>u_test</value>
+ <value>1</value>
+ <value>0</value>
+ <value>0</value>
+ </row>
+ </table>
+
+ <table name="phpbb_groups">
+ <column>group_id</column>
+ <column>group_name</column>
+ <column>group_desc</column>
+ <row>
+ <value>2</value>
+ <value>REGISTERED</value>
+ <value></value>
+ </row>
+ <row>
+ <value>4</value>
+ <value>GLOBAL_MODERATORS</value>
+ <value></value>
+ </row>
+ <row>
+ <value>5</value>
+ <value>ADMINISTRATORS</value>
+ <value></value>
+ </row>
+ </table>
+
+ <table name="phpbb_acl_groups">
+ <column>group_id</column>
+ <column>auth_role_id</column>
+ <column>forum_id</column>
+ <row>
+ <value>2</value>
+ <value>5</value>
+ <value>0</value>
+ </row>
+ <row>
+ <value>4</value>
+ <value>5</value>
+ <value>0</value>
+ </row>
+ <row>
+ <value>4</value>
+ <value>10</value>
+ <value>0</value>
+ </row>
+ <row>
+ <value>5</value>
+ <value>1</value>
+ <value>0</value>
+ </row>
+ <row>
+ <value>5</value>
+ <value>5</value>
+ <value>0</value>
+ </row>
+ </table>
+
+ <table name="phpbb_acl_roles">
+ <column>role_id</column>
+ <column>role_name</column>
+ <column>role_type</column>
+ <column>role_description</column>
+ <row>
+ <value>1</value>
+ <value>ROLE_ADMIN_STANDARD</value>
+ <value>a_</value>
+ <value></value>
+ </row>
+ <row>
+ <value>5</value>
+ <value>ROLE_USER_FULL</value>
+ <value>u_</value>
+ <value></value>
+ </row>
+ <row>
+ <value>10</value>
+ <value>ROLE_MOD_FULL</value>
+ <value>m_</value>
+ <value></value>
+ </row>
+ </table>
+
+ <table name="phpbb_acl_roles_data">
+ <column>role_id</column>
+ <column>auth_option_id</column>
+ <column>auth_setting</column>
+ <row>
+ <value>1</value>
+ <value>4</value>
+ <value>0</value>
+ </row>
+ <row>
+ <value>1</value>
+ <value>5</value>
+ <value>0</value>
+ </row>
+ <row>
+ <value>1</value>
+ <value>6</value>
+ <value>0</value>
+ </row>
+ <row>
+ <value>6</value>
+ <value>6</value>
+ <value>0</value>
+ </row>
+ <row>
+ <value>10</value>
+ <value>5</value>
+ <value>0</value>
+ </row>
+ <row>
+ <value>10</value>
+ <value>6</value>
+ <value>0</value>
+ </row>
+ </table>
+</dataset>
diff --git a/tests/dbal/fixtures/styles.xml b/tests/dbal/fixtures/styles.xml
index 47b384c47f..d51dcd0320 100644
--- a/tests/dbal/fixtures/styles.xml
+++ b/tests/dbal/fixtures/styles.xml
@@ -5,35 +5,39 @@
<column>style_name</column>
<column>style_copyright</column>
<column>style_active</column>
- <column>template_id</column>
- <column>theme_id</column>
- <column>imageset_id</column>
+ <column>style_path</column>
+ <column>bbcode_bitfield</column>
+ <column>style_parent_id</column>
+ <column>style_parent_tree</column>
<row>
<value>1</value>
<value>prosilver</value>
- <value>&amp;copy; phpBB Group</value>
- <value>1</value>
- <value>1</value>
- <value>1</value>
+ <value>&amp;copy; phpBB Limited</value>
<value>1</value>
+ <value>prosilver</value>
+ <value>kNg=</value>
+ <value>0</value>
+ <value></value>
</row>
<row>
<value>2</value>
<value>prosilver2</value>
- <value>&amp;copy; phpBB Group</value>
+ <value>&amp;copy; phpBB Limited</value>
<value>0</value>
- <value>2</value>
- <value>2</value>
- <value>2</value>
+ <value>prosilver2</value>
+ <value>kNg=</value>
+ <value>0</value>
+ <value></value>
</row>
<row>
<value>3</value>
<value>Prosilver1</value>
- <value>&amp;copy; phpBB Group</value>
+ <value>&amp;copy; phpBB Limited</value>
<value>0</value>
- <value>3</value>
- <value>3</value>
- <value>3</value>
+ <value>prosilver1</value>
+ <value>kNg=</value>
+ <value>1</value>
+ <value>prosilver</value>
</row>
</table>
</dataset>
diff --git a/tests/dbal/fixtures/three_users.xml b/tests/dbal/fixtures/three_users.xml
index a50e3e8634..a601e539e1 100644
--- a/tests/dbal/fixtures/three_users.xml
+++ b/tests/dbal/fixtures/three_users.xml
@@ -5,31 +5,23 @@
<column>username_clean</column>
<column>user_permissions</column>
<column>user_sig</column>
- <column>user_occ</column>
- <column>user_interests</column>
<row>
<value>1</value>
<value>barfoo</value>
<value></value>
<value></value>
- <value></value>
- <value></value>
</row>
<row>
<value>2</value>
<value>foobar</value>
<value></value>
<value></value>
- <value></value>
- <value></value>
</row>
<row>
<value>3</value>
<value>bertie</value>
<value></value>
<value></value>
- <value></value>
- <value></value>
</row>
</table>
</dataset>
diff --git a/tests/dbal/migration/dummy.php b/tests/dbal/migration/dummy.php
new file mode 100644
index 0000000000..d564754892
--- /dev/null
+++ b/tests/dbal/migration/dummy.php
@@ -0,0 +1,31 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+class phpbb_dbal_migration_dummy extends \phpbb\db\migration\migration
+{
+ static public function depends_on()
+ {
+ return array('installed_migration');
+ }
+
+ function update_schema()
+ {
+ return array(
+ 'add_columns' => array(
+ 'phpbb_config' => array(
+ 'extra_column' => array('UINT', 1),
+ ),
+ ),
+ );
+ }
+}
diff --git a/tests/dbal/migration/dummy_order.php b/tests/dbal/migration/dummy_order.php
new file mode 100644
index 0000000000..5ab8f5d129
--- /dev/null
+++ b/tests/dbal/migration/dummy_order.php
@@ -0,0 +1,30 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+class phpbb_dbal_migration_dummy_order extends \phpbb\db\migration\migration
+{
+ function update_schema()
+ {
+ return array(
+ 'add_tables' => array(
+ $this->table_prefix . 'column_order_test1' => array(
+ 'COLUMNS' => array(
+ 'foobar1' => array('BOOL', 0),
+ 'foobar3' => array('BOOL', 0),
+ ),
+ 'PRIMARY_KEY' => array('foobar1'),
+ ),
+ ),
+ );
+ }
+}
diff --git a/tests/dbal/migration/dummy_order_0.php b/tests/dbal/migration/dummy_order_0.php
new file mode 100644
index 0000000000..4caea76704
--- /dev/null
+++ b/tests/dbal/migration/dummy_order_0.php
@@ -0,0 +1,26 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+class phpbb_dbal_migration_dummy_order_0 extends \phpbb\db\migration\migration
+{
+ function update_schema()
+ {
+ return array(
+ 'add_columns' => array(
+ $this->table_prefix . 'column_order_test1' => array(
+ 'foobar2' => array('BOOL', 0, 'after' => 'foobar1'),
+ ),
+ ),
+ );
+ }
+}
diff --git a/tests/dbal/migration/dummy_order_1.php b/tests/dbal/migration/dummy_order_1.php
new file mode 100644
index 0000000000..ea512765fa
--- /dev/null
+++ b/tests/dbal/migration/dummy_order_1.php
@@ -0,0 +1,26 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+class phpbb_dbal_migration_dummy_order_1 extends \phpbb\db\migration\migration
+{
+ function update_schema()
+ {
+ return array(
+ 'add_columns' => array(
+ $this->table_prefix . 'column_order_test1' => array(
+ 'foobar4' => array('BOOL', 0, 'after' => 'foobar3'),
+ ),
+ ),
+ );
+ }
+}
diff --git a/tests/dbal/migration/dummy_order_2.php b/tests/dbal/migration/dummy_order_2.php
new file mode 100644
index 0000000000..a7669b1ac8
--- /dev/null
+++ b/tests/dbal/migration/dummy_order_2.php
@@ -0,0 +1,26 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+class phpbb_dbal_migration_dummy_order_2 extends \phpbb\db\migration\migration
+{
+ function update_schema()
+ {
+ return array(
+ 'add_columns' => array(
+ $this->table_prefix . 'column_order_test1' => array(
+ 'foobar5' => array('BOOL', 0, 'after' => 'non-existing'),
+ ),
+ ),
+ );
+ }
+}
diff --git a/tests/dbal/migration/dummy_order_3.php b/tests/dbal/migration/dummy_order_3.php
new file mode 100644
index 0000000000..501db09b7e
--- /dev/null
+++ b/tests/dbal/migration/dummy_order_3.php
@@ -0,0 +1,26 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+class phpbb_dbal_migration_dummy_order_3 extends \phpbb\db\migration\migration
+{
+ function update_schema()
+ {
+ return array(
+ 'add_columns' => array(
+ $this->table_prefix . 'column_order_test1' => array(
+ 'foobar6' => array('BOOL', 0, 'after' => ''),
+ ),
+ ),
+ );
+ }
+}
diff --git a/tests/dbal/migration/dummy_order_4.php b/tests/dbal/migration/dummy_order_4.php
new file mode 100644
index 0000000000..77bb5a24b3
--- /dev/null
+++ b/tests/dbal/migration/dummy_order_4.php
@@ -0,0 +1,26 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+class phpbb_dbal_migration_dummy_order_4 extends \phpbb\db\migration\migration
+{
+ function update_schema()
+ {
+ return array(
+ 'add_columns' => array(
+ $this->table_prefix . 'column_order_test1' => array(
+ 'foobar7' => array('BOOL', 0),
+ ),
+ ),
+ );
+ }
+}
diff --git a/tests/dbal/migration/dummy_order_5.php b/tests/dbal/migration/dummy_order_5.php
new file mode 100644
index 0000000000..8f92392a8b
--- /dev/null
+++ b/tests/dbal/migration/dummy_order_5.php
@@ -0,0 +1,27 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+class phpbb_dbal_migration_dummy_order_5 extends \phpbb\db\migration\migration
+{
+ function update_schema()
+ {
+ return array(
+ 'add_columns' => array(
+ $this->table_prefix . 'column_order_test1' => array(
+ 'foobar8' => array('BOOL', 0, 'after' => 'foobar3'),
+ 'foobar9' => array('BOOL', 0, 'after' => 'foobar3'),
+ ),
+ ),
+ );
+ }
+}
diff --git a/tests/dbal/migration/fail.php b/tests/dbal/migration/fail.php
new file mode 100644
index 0000000000..a7a8a41694
--- /dev/null
+++ b/tests/dbal/migration/fail.php
@@ -0,0 +1,45 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+class phpbb_dbal_migration_fail extends \phpbb\db\migration\migration
+{
+ function update_schema()
+ {
+ return array(
+ 'add_columns' => array(
+ $this->table_prefix . 'config' => array(
+ 'test_column' => array('BOOL', 1),
+ ),
+ ),
+ );
+ }
+
+ function revert_schema()
+ {
+ return array(
+ 'drop_columns' => array(
+ $this->table_prefix . 'config' => array(
+ 'test_column',
+ ),
+ ),
+ );
+ }
+
+ function update_data()
+ {
+ return array(
+ array('config.add', array('foobar3', true)),
+ array('config.update', array('does_not_exist', true)),
+ );
+ }
+}
diff --git a/tests/dbal/migration/if.php b/tests/dbal/migration/if.php
new file mode 100644
index 0000000000..481250ea77
--- /dev/null
+++ b/tests/dbal/migration/if.php
@@ -0,0 +1,48 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+class phpbb_dbal_migration_if extends \phpbb\db\migration\migration
+{
+ function update_schema()
+ {
+ return array();
+ }
+
+ function update_data()
+ {
+ return array(
+ array('if', array(
+ true,
+ array('custom', array(array(&$this, 'test_true'))),
+ )),
+ array('if', array(
+ false,
+ array('custom', array(array(&$this, 'test_false'))),
+ )),
+ );
+ }
+
+ function test_true()
+ {
+ global $migrator_test_if_true_failed;
+
+ $migrator_test_if_true_failed = !$migrator_test_if_true_failed;
+ }
+
+ function test_false()
+ {
+ global $migrator_test_if_false_failed;
+
+ $migrator_test_if_false_failed = !$migrator_test_if_false_failed;
+ }
+}
diff --git a/tests/dbal/migration/installed.php b/tests/dbal/migration/installed.php
new file mode 100644
index 0000000000..83edaae23a
--- /dev/null
+++ b/tests/dbal/migration/installed.php
@@ -0,0 +1,34 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+class phpbb_dbal_migration_installed extends \phpbb\db\migration\migration
+{
+ function effectively_installed()
+ {
+ return true;
+ }
+
+ function update_data()
+ {
+ return array(
+ array('custom', array(array(&$this, 'test'))),
+ );
+ }
+
+ function test()
+ {
+ global $migrator_test_installed_failed;
+
+ $migrator_test_installed_failed = true;
+ }
+}
diff --git a/tests/dbal/migration/recall.php b/tests/dbal/migration/recall.php
new file mode 100644
index 0000000000..c0333b084d
--- /dev/null
+++ b/tests/dbal/migration/recall.php
@@ -0,0 +1,42 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+class phpbb_dbal_migration_recall extends \phpbb\db\migration\migration
+{
+ function update_schema()
+ {
+ return array();
+ }
+
+ function update_data()
+ {
+ return array(
+ array('custom', array(array(&$this, 'test_call'))),
+ );
+ }
+
+ // This function should be called 10 times
+ function test_call($input)
+ {
+ global $migrator_test_call_input;
+
+ $migrator_test_call_input = (int) $input;
+
+ if ($migrator_test_call_input < 10)
+ {
+ return ($migrator_test_call_input + 1);
+ }
+
+ return;
+ }
+}
diff --git a/tests/dbal/migration/revert.php b/tests/dbal/migration/revert.php
new file mode 100644
index 0000000000..7da65a83f1
--- /dev/null
+++ b/tests/dbal/migration/revert.php
@@ -0,0 +1,52 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+class phpbb_dbal_migration_revert extends \phpbb\db\migration\migration
+{
+ function update_schema()
+ {
+ return array(
+ 'add_columns' => array(
+ 'phpbb_config' => array(
+ 'bar_column' => array('UINT', 1),
+ ),
+ ),
+ );
+ }
+
+ function revert_schema()
+ {
+ return array(
+ 'drop_columns' => array(
+ 'phpbb_config' => array(
+ 'bar_column',
+ ),
+ ),
+ );
+ }
+
+ function update_data()
+ {
+ return array(
+ array('config.add', array('foobartest', 0)),
+ array('custom', array(array(&$this, 'my_custom_function'))),
+ );
+ }
+
+ function my_custom_function()
+ {
+ global $migrator_test_revert_counter;
+
+ $migrator_test_revert_counter += 1;
+ }
+}
diff --git a/tests/dbal/migration/revert_with_dependency.php b/tests/dbal/migration/revert_with_dependency.php
new file mode 100644
index 0000000000..43e9a4aa42
--- /dev/null
+++ b/tests/dbal/migration/revert_with_dependency.php
@@ -0,0 +1,20 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+class phpbb_dbal_migration_revert_with_dependency extends \phpbb\db\migration\migration
+{
+ static public function depends_on()
+ {
+ return array('phpbb_dbal_migration_revert');
+ }
+}
diff --git a/tests/dbal/migration/schema.php b/tests/dbal/migration/schema.php
new file mode 100644
index 0000000000..38663bcc16
--- /dev/null
+++ b/tests/dbal/migration/schema.php
@@ -0,0 +1,48 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+class phpbb_dbal_migration_schema extends \phpbb\db\migration\migration
+{
+ function update_schema()
+ {
+ return array(
+ 'add_columns' => array(
+ $this->table_prefix . 'config' => array(
+ 'test_column1' => array('BOOL', 1),
+ ),
+ ),
+ 'add_tables' => array(
+ $this->table_prefix . 'foobar' => array(
+ 'COLUMNS' => array(
+ 'module_id' => array('UINT:3', NULL, 'auto_increment'),
+ ),
+ 'PRIMARY_KEY' => 'module_id',
+ ),
+ ),
+ );
+ }
+
+ function revert_schema()
+ {
+ return array(
+ 'drop_columns' => array(
+ $this->table_prefix . 'config' => array(
+ 'test_column1',
+ ),
+ ),
+ 'drop_tables' => array(
+ $this->table_prefix . 'foobar',
+ ),
+ );
+ }
+}
diff --git a/tests/dbal/migration/unfulfillable.php b/tests/dbal/migration/unfulfillable.php
new file mode 100644
index 0000000000..11c87a6b85
--- /dev/null
+++ b/tests/dbal/migration/unfulfillable.php
@@ -0,0 +1,30 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+class phpbb_dbal_migration_unfulfillable extends \phpbb\db\migration\migration
+{
+ static public function depends_on()
+ {
+ return array('installed_migration', 'phpbb_dbal_migration_dummy', 'non_existant_migration');
+ }
+
+ function update_schema()
+ {
+ trigger_error('Schema update of migration with unfulfillable dependency was run!');
+ }
+
+ function update_data()
+ {
+ trigger_error('Data update of migration with unfulfillable dependency was run!');
+ }
+}
diff --git a/tests/dbal/migrator_test.php b/tests/dbal/migrator_test.php
new file mode 100644
index 0000000000..798200eef1
--- /dev/null
+++ b/tests/dbal/migrator_test.php
@@ -0,0 +1,315 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
+require_once dirname(__FILE__) . '/migration/dummy.php';
+require_once dirname(__FILE__) . '/migration/unfulfillable.php';
+require_once dirname(__FILE__) . '/migration/if.php';
+require_once dirname(__FILE__) . '/migration/recall.php';
+require_once dirname(__FILE__) . '/migration/revert.php';
+require_once dirname(__FILE__) . '/migration/revert_with_dependency.php';
+require_once dirname(__FILE__) . '/migration/fail.php';
+require_once dirname(__FILE__) . '/migration/installed.php';
+require_once dirname(__FILE__) . '/migration/schema.php';
+
+class phpbb_dbal_migrator_test extends phpbb_database_test_case
+{
+ protected $db;
+ protected $db_tools;
+ protected $migrator;
+
+ public function getDataSet()
+ {
+ return $this->createXMLDataSet(dirname(__FILE__).'/fixtures/migrator.xml');
+ }
+
+ public function setUp()
+ {
+ parent::setUp();
+
+ $this->db = $this->new_dbal();
+ $this->db_tools = new \phpbb\db\tools($this->db);
+
+ $this->config = new \phpbb\config\db($this->db, new phpbb_mock_cache, 'phpbb_config');
+
+ $tools = array(
+ new \phpbb\db\migration\tool\config($this->config),
+ );
+
+ $container = new phpbb_mock_container_builder();
+
+ $this->migrator = new \phpbb\db\migrator(
+ $container,
+ $this->config,
+ $this->db,
+ $this->db_tools,
+ 'phpbb_migrations',
+ dirname(__FILE__) . '/../../phpBB/',
+ 'php',
+ 'phpbb_',
+ $tools,
+ new \phpbb\db\migration\helper()
+ );
+ $container->set('migrator', $this->migrator);
+ $container->set('dispatcher', new phpbb_mock_event_dispatcher());
+ $user = new \phpbb\user('\phpbb\datetime');
+
+ $this->extension_manager = new \phpbb\extension\manager(
+ $container,
+ $this->db,
+ $this->config,
+ new phpbb\filesystem(),
+ $user,
+ 'phpbb_ext',
+ dirname(__FILE__) . '/../../phpBB/',
+ 'php',
+ null
+ );
+ }
+
+ public function test_update()
+ {
+ $this->migrator->set_migrations(array('phpbb_dbal_migration_dummy'));
+
+ // schema
+ $this->migrator->update();
+ $this->assertFalse($this->migrator->finished());
+
+ $this->assertSqlResultEquals(
+ array(array('success' => '1')),
+ "SELECT 1 as success
+ FROM phpbb_migrations
+ WHERE migration_name = 'phpbb_dbal_migration_dummy'
+ AND migration_start_time >= " . (time() - 1) . "
+ AND migration_start_time <= " . (time() + 1),
+ 'Start time set correctly'
+ );
+
+ // data
+ $this->migrator->update();
+ $this->assertTrue($this->migrator->finished());
+
+ $this->assertSqlResultEquals(
+ array(array('extra_column' => '1')),
+ "SELECT extra_column FROM phpbb_config WHERE config_name = 'foo'",
+ 'Dummy migration created extra_column with value 1 in all rows.'
+ );
+
+ $this->assertSqlResultEquals(
+ array(array('success' => '1')),
+ "SELECT 1 as success
+ FROM phpbb_migrations
+ WHERE migration_name = 'phpbb_dbal_migration_dummy'
+ AND migration_start_time <= migration_end_time
+ AND migration_end_time >= " . (time() - 1) . "
+ AND migration_end_time <= " . (time() + 1),
+ 'End time set correctly'
+ );
+
+ // cleanup
+ $this->db_tools->sql_column_remove('phpbb_config', 'extra_column');
+ }
+
+ public function test_unfulfillable()
+ {
+ $this->migrator->set_migrations(array('phpbb_dbal_migration_unfulfillable', 'phpbb_dbal_migration_dummy'));
+
+ while (!$this->migrator->finished())
+ {
+ $this->migrator->update();
+ }
+
+ $this->assertTrue($this->migrator->finished());
+
+ $this->assertSqlResultEquals(
+ array(array('extra_column' => '1')),
+ "SELECT extra_column FROM phpbb_config WHERE config_name = 'foo'",
+ 'Dummy migration was run, even though an unfulfillable migration was found.'
+ );
+
+ $this->db_tools->sql_column_remove('phpbb_config', 'extra_column');
+ }
+
+ public function test_if()
+ {
+ $this->migrator->set_migrations(array('phpbb_dbal_migration_if'));
+
+ // Don't like this, but I'm not sure there is any other way to do this
+ global $migrator_test_if_true_failed, $migrator_test_if_false_failed;
+ $migrator_test_if_true_failed = true;
+ $migrator_test_if_false_failed = false;
+
+ while (!$this->migrator->finished())
+ {
+ $this->migrator->update();
+ }
+
+ $this->assertFalse($migrator_test_if_true_failed, 'True test failed');
+ $this->assertFalse($migrator_test_if_false_failed, 'False test failed');
+
+ while ($this->migrator->migration_state('phpbb_dbal_migration_if') !== false)
+ {
+ $this->migrator->revert('phpbb_dbal_migration_if');
+ }
+
+ $this->assertFalse($migrator_test_if_true_failed, 'True test after revert failed');
+ $this->assertFalse($migrator_test_if_false_failed, 'False test after revert failed');
+ }
+
+ public function test_recall()
+ {
+ $this->migrator->set_migrations(array('phpbb_dbal_migration_recall'));
+
+ global $migrator_test_call_input;
+
+ // Run the schema first
+ $this->migrator->update();
+
+ $i = 0;
+ while (!$this->migrator->finished())
+ {
+ $this->migrator->update();
+
+ $this->assertSame($i, $migrator_test_call_input);
+
+ $i++;
+ }
+
+ $this->assertSame(10, $migrator_test_call_input);
+ }
+
+ public function test_revert()
+ {
+ global $migrator_test_revert_counter;
+
+ // Make sure there are no other migrations in the db, this could cause issues
+ $this->db->sql_query("DELETE FROM phpbb_migrations");
+ $this->migrator->load_migration_state();
+
+ $migrator_test_revert_counter = 0;
+
+ $this->migrator->set_migrations(array('phpbb_dbal_migration_revert', 'phpbb_dbal_migration_revert_with_dependency'));
+
+ $this->assertFalse($this->migrator->migration_state('phpbb_dbal_migration_revert'));
+ $this->assertFalse($this->migrator->migration_state('phpbb_dbal_migration_revert_with_dependency'));
+
+ // Install the migration first
+ while (!$this->migrator->finished())
+ {
+ $this->migrator->update();
+ }
+
+ $this->assertTrue($this->migrator->migration_state('phpbb_dbal_migration_revert') !== false);
+ $this->assertTrue($this->migrator->migration_state('phpbb_dbal_migration_revert_with_dependency') !== false);
+
+ $this->assertSqlResultEquals(
+ array(array('bar_column' => '1')),
+ "SELECT bar_column FROM phpbb_config WHERE config_name = 'foo'",
+ 'Installing revert migration failed to create bar_column.'
+ );
+
+ $this->assertTrue(isset($this->config['foobartest']));
+
+ while ($this->migrator->migration_state('phpbb_dbal_migration_revert') !== false)
+ {
+ $this->migrator->revert('phpbb_dbal_migration_revert');
+ }
+
+ $this->assertFalse($this->migrator->migration_state('phpbb_dbal_migration_revert'));
+ $this->assertFalse($this->migrator->migration_state('phpbb_dbal_migration_revert_with_dependency'));
+
+ $this->assertFalse(isset($this->config['foobartest']));
+
+ $sql = 'SELECT * FROM phpbb_config';
+ $result = $this->db->sql_query_limit($sql, 1);
+ $row = $this->db->sql_fetchrow($result);
+ $this->db->sql_freeresult($result);
+
+ if (isset($row['bar_column']))
+ {
+ $this->fail('Revert did not remove test_column.');
+ }
+
+ $this->assertEquals(1, $migrator_test_revert_counter, 'Revert did call custom function again');
+ }
+
+ public function test_fail()
+ {
+ $this->migrator->set_migrations(array('phpbb_dbal_migration_fail'));
+
+ $this->assertFalse(isset($this->config['foobar3']));
+
+ try
+ {
+ while (!$this->migrator->finished())
+ {
+ $this->migrator->update();
+ }
+ }
+ catch (\phpbb\db\migration\exception $e) {}
+
+ // Failure should have caused an automatic roll-back, so this should not exist.
+ $this->assertFalse(isset($this->config['foobar3']));
+
+ $sql = 'SELECT * FROM phpbb_config';
+ $result = $this->db->sql_query_limit($sql, 1);
+ $row = $this->db->sql_fetchrow($result);
+ $this->db->sql_freeresult($result);
+
+ if (isset($row['test_column']))
+ {
+ $this->fail('Revert did not remove test_column.');
+ }
+ }
+
+ public function test_installed()
+ {
+ $this->migrator->set_migrations(array('phpbb_dbal_migration_installed'));
+
+ global $migrator_test_installed_failed;
+ $migrator_test_installed_failed = false;
+
+ while (!$this->migrator->finished())
+ {
+ $this->migrator->update();
+ }
+
+ $this->assertTrue($this->migrator->migration_state('phpbb_dbal_migration_installed') !== false);
+
+ if ($migrator_test_installed_failed)
+ {
+ $this->fail('Installed test failed');
+ }
+ }
+
+ public function test_schema()
+ {
+ $this->migrator->set_migrations(array('phpbb_dbal_migration_schema'));
+
+ while (!$this->migrator->finished())
+ {
+ $this->migrator->update();
+ }
+
+ $this->assertTrue($this->db_tools->sql_column_exists('phpbb_config', 'test_column1'));
+ $this->assertTrue($this->db_tools->sql_table_exists('phpbb_foobar'));
+
+ while ($this->migrator->migration_state('phpbb_dbal_migration_schema'))
+ {
+ $this->migrator->revert('phpbb_dbal_migration_schema');
+ }
+
+ $this->assertFalse($this->db_tools->sql_column_exists('phpbb_config', 'test_column1'));
+ $this->assertFalse($this->db_tools->sql_table_exists('phpbb_foobar'));
+ }
+}
diff --git a/tests/dbal/migrator_tool_config_test.php b/tests/dbal/migrator_tool_config_test.php
new file mode 100644
index 0000000000..13e0c13e3c
--- /dev/null
+++ b/tests/dbal/migrator_tool_config_test.php
@@ -0,0 +1,90 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+class phpbb_dbal_migrator_tool_config_test extends phpbb_test_case
+{
+ public function setup()
+ {
+ $this->config = new \phpbb\config\config(array());
+
+ $this->tool = new \phpbb\db\migration\tool\config($this->config);
+
+ parent::setup();
+ }
+
+ public function test_add()
+ {
+ $this->tool->add('foo', 'bar');
+ $this->assertEquals('bar', $this->config['foo']);
+ }
+
+ public function test_add_twice()
+ {
+ $this->tool->add('foo', 'bar');
+ $this->assertEquals('bar', $this->config['foo']);
+
+ $this->tool->add('foo', 'bar2');
+ $this->assertEquals('bar', $this->config['foo']);
+ }
+
+ public function test_update()
+ {
+ $this->config->set('foo', 'bar');
+
+ $this->tool->update('foo', 'bar2');
+ $this->assertEquals('bar2', $this->config['foo']);
+ }
+
+ public function test_update_if_equals()
+ {
+ $this->config->set('foo', 'bar');
+
+ $this->tool->update_if_equals('', 'foo', 'bar2');
+ $this->assertEquals('bar', $this->config['foo']);
+
+ $this->tool->update_if_equals('bar', 'foo', 'bar2');
+ $this->assertEquals('bar2', $this->config['foo']);
+ }
+
+ public function test_remove()
+ {
+ $this->config->set('foo', 'bar');
+
+ $this->tool->remove('foo');
+ $this->assertFalse(isset($this->config['foo']));
+ }
+
+ public function test_reverse_add()
+ {
+ $this->config->set('foo', 'bar');
+
+ $this->tool->reverse('add', 'foo');
+ $this->assertFalse(isset($this->config['foo']));
+ }
+
+ public function test_reverse_remove()
+ {
+ $this->config->delete('foo');
+
+ $this->tool->reverse('remove', 'foo');
+ $this->assertEquals('', $this->config['foo']);
+ }
+
+ public function test_reverse_update_if_equals()
+ {
+ $this->config->set('foo', 'bar');
+
+ $this->tool->reverse('update_if_equals', 'test', 'foo', 'bar');
+ $this->assertEquals('test', $this->config['foo']);
+ }
+}
diff --git a/tests/dbal/migrator_tool_config_text_test.php b/tests/dbal/migrator_tool_config_text_test.php
new file mode 100644
index 0000000000..b271c2d62e
--- /dev/null
+++ b/tests/dbal/migrator_tool_config_text_test.php
@@ -0,0 +1,75 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+class phpbb_dbal_migrator_tool_config_text_test extends phpbb_database_test_case
+{
+ public function getDataSet()
+ {
+ return $this->createXMLDataSet(dirname(__FILE__).'/fixtures/migrator_config_text.xml');
+ }
+
+ public function setup()
+ {
+ parent::setup();
+
+ $this->db = $this->new_dbal();
+ $this->config_text = new \phpbb\config\db_text($this->db, 'phpbb_config_text');
+
+ $this->tool = new \phpbb\db\migration\tool\config_text($this->config_text);
+ }
+
+ public function test_add()
+ {
+ $this->tool->add('foo', 'bar');
+ $this->assertEquals('bar', $this->config_text->get('foo'));
+ }
+
+ public function test_add_twice()
+ {
+ $this->tool->add('foo', 'bar');
+ $this->assertEquals('bar', $this->config_text->get('foo'));
+
+ $this->tool->add('foo', 'bar2');
+ $this->assertEquals('bar', $this->config_text->get('foo'));
+ }
+
+ public function test_update()
+ {
+ $this->config_text->set('foo', 'bar');
+
+ $this->tool->update('foo', 'bar2');
+ $this->assertEquals('bar2', $this->config_text->get('foo'));
+ }
+
+ public function test_remove()
+ {
+ $this->config_text->set('foo', 'bar');
+
+ $this->tool->remove('foo');
+ $this->assertNull($this->config_text->get('foo'));
+ }
+
+ public function test_reverse_add()
+ {
+ $this->config_text->set('foo', 'bar');
+
+ $this->tool->reverse('add', 'foo');
+ $this->assertNull($this->config_text->get('foo'));
+ }
+
+ public function test_reverse_remove()
+ {
+ $this->tool->reverse('remove', 'foo');
+ $this->assertSame('', $this->config_text->get('foo'));
+ }
+}
diff --git a/tests/dbal/migrator_tool_module_test.php b/tests/dbal/migrator_tool_module_test.php
new file mode 100644
index 0000000000..bbe543f347
--- /dev/null
+++ b/tests/dbal/migrator_tool_module_test.php
@@ -0,0 +1,305 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
+
+class phpbb_dbal_migrator_tool_module_test extends phpbb_database_test_case
+{
+ public function getDataSet()
+ {
+ return $this->createXMLDataSet(dirname(__FILE__).'/fixtures/migrator_module.xml');
+ }
+
+ public function setup()
+ {
+ // Need global $db, $user for delete_module function in acp_modules
+ global $phpbb_root_path, $phpEx, $skip_add_log, $db, $user, $phpbb_log;
+
+ parent::setup();
+
+ // Force add_log function to not be used
+ $skip_add_log = true;
+
+ $db = $this->db = $this->new_dbal();
+ $this->cache = new \phpbb\cache\service(new \phpbb\cache\driver\null(), new \phpbb\config\config(array()), $this->db, $phpbb_root_path, $phpEx);
+ $user = $this->user = new \phpbb\user('\phpbb\user');
+
+ $cache = new phpbb_mock_cache;
+ $phpbb_dispatcher = new phpbb_mock_event_dispatcher();
+ $auth = $this->getMock('\phpbb\auth\auth');
+ $phpbb_log = new \phpbb\log\log($db, $user, $auth, $phpbb_dispatcher, $phpbb_root_path, 'adm/', $phpEx, LOG_TABLE);
+
+ $this->tool = new \phpbb\db\migration\tool\module($this->db, $this->cache, $this->user, $phpbb_root_path, $phpEx, 'phpbb_modules');
+ }
+
+ public function exists_data_acp()
+ {
+ return array(
+ // Test the existing category
+ array(
+ '',
+ 'ACP_CAT',
+ true,
+ ),
+ array(
+ 0,
+ 'ACP_CAT',
+ true,
+ ),
+
+ // Test the existing module
+ array(
+ '',
+ 'ACP_MODULE',
+ false,
+ ),
+ array(
+ false,
+ 'ACP_MODULE',
+ true,
+ ),
+ array(
+ 'ACP_CAT',
+ 'ACP_MODULE',
+ true,
+ ),
+
+ // Test for non-existant modules
+ array(
+ '',
+ 'ACP_NON_EXISTANT_CAT',
+ false,
+ ),
+ array(
+ 'ACP_CAT',
+ 'ACP_NON_EXISTANT_MODULE',
+ false,
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider exists_data_acp
+ */
+ public function test_exists_acp($parent, $module, $expected)
+ {
+ $this->assertEquals($expected, $this->tool->exists('acp', $parent, $module));
+ }
+
+ public function exists_data_ucp()
+ {
+ return array(
+ // Test the existing category
+ array(
+ '',
+ 'UCP_MAIN_CAT',
+ true,
+ ),
+ array(
+ 0,
+ 'UCP_MAIN_CAT',
+ true,
+ ),
+
+ // Test the existing module
+ array(
+ '',
+ 'UCP_SUBCATEGORY',
+ false,
+ ),
+ array(
+ false,
+ 'UCP_SUBCATEGORY',
+ true,
+ ),
+ array(
+ 'UCP_MAIN_CAT',
+ 'UCP_SUBCATEGORY',
+ true,
+ ),
+ array(
+ 'UCP_SUBCATEGORY',
+ 'UCP_MODULE',
+ true,
+ ),
+
+ // Test for non-existant modules
+ array(
+ '',
+ 'UCP_NON_EXISTANT_CAT',
+ false,
+ ),
+ array(
+ 'UCP_MAIN_CAT',
+ 'UCP_NON_EXISTANT_MODULE',
+ false,
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider exists_data_ucp
+ */
+ public function test_exists_ucp($parent, $module, $expected)
+ {
+ $this->assertEquals($expected, $this->tool->exists('ucp', $parent, $module));
+ }
+
+ public function test_add()
+ {
+ try
+ {
+ $this->tool->add('acp', 0, 'ACP_NEW_CAT');
+ }
+ catch (Exception $e)
+ {
+ $this->fail($e);
+ }
+ $this->assertEquals(true, $this->tool->exists('acp', 0, 'ACP_NEW_CAT'));
+
+ // Should throw an exception when trying to add a module that already exists
+ try
+ {
+ $this->tool->add('acp', 0, 'ACP_NEW_CAT');
+ $this->fail('Exception not thrown');
+ }
+ catch (Exception $e) {}
+
+ try
+ {
+ $this->tool->add('acp', 'ACP_NEW_CAT', array(
+ 'module_basename' => 'acp_new_module',
+ 'module_langname' => 'ACP_NEW_MODULE',
+ 'module_mode' => 'test',
+ 'module_auth' => '',
+ ));
+ }
+ catch (Exception $e)
+ {
+ $this->fail($e);
+ }
+ $this->assertEquals(true, $this->tool->exists('acp', 'ACP_NEW_CAT', 'ACP_NEW_MODULE'));
+
+ // Test adding module when plural parent module_langname exists
+ // PHPBB3-14703
+ // Adding fail
+ try
+ {
+ $this->tool->add('acp', 'ACP_FORUM_BASED_PERMISSIONS', array(
+ 'module_basename' => 'acp_new_permissions_module',
+ 'module_langname' => 'ACP_NEW_PERMISSIONS_MODULE',
+ 'module_mode' => 'test',
+ 'module_auth' => '',
+ ));
+ $this->fail('Exception not thrown');
+ }
+ catch (Exception $e)
+ {
+ $this->assertEquals('phpbb\db\migration\exception', get_class($e));
+ $this->assertEquals('MODULE_EXIST_MULTIPLE', $e->getMessage());
+ }
+
+ // Test adding module when plural parent module_langname exists
+ // PHPBB3-14703
+ // Adding success
+ try
+ {
+ $this->tool->add('acp', 'ACP_FORUM_BASED_PERMISSIONS', array(
+ 'module_basename' => 'acp_new_permissions_module',
+ 'module_langname' => 'ACP_NEW_PERMISSIONS_MODULE',
+ 'module_mode' => 'test',
+ 'module_auth' => '',
+ 'after' => 'ACP_FORUM_BASED_PERMISSIONS_CHILD_1',
+ ));
+ }
+ catch (Exception $e)
+ {
+ $this->fail($e);
+ }
+ $this->assertEquals(true, $this->tool->exists('acp', 'ACP_FORUM_BASED_PERMISSIONS', 'ACP_NEW_PERMISSIONS_MODULE'));
+
+ // Test adding UCP modules
+ // Test adding new UCP category
+ try
+ {
+ $this->tool->add('ucp', 0, 'UCP_NEW_CAT');
+ }
+ catch (Exception $e)
+ {
+ $this->fail($e);
+ }
+ $this->assertEquals(true, $this->tool->exists('ucp', 0, 'UCP_NEW_CAT'));
+
+ // Test adding new UCP subcategory
+ try
+ {
+ $this->tool->add('ucp', 'UCP_NEW_CAT', 'UCP_NEW_SUBCAT');
+ }
+ catch (Exception $e)
+ {
+ $this->fail($e);
+ }
+ $this->assertEquals(true, $this->tool->exists('ucp', 'UCP_NEW_CAT', 'UCP_NEW_SUBCAT'));
+
+ // Test adding new UCP module
+ try
+ {
+ $this->tool->add('ucp', 'UCP_NEW_SUBCAT', array(
+ 'module_basename' => 'ucp_new_module',
+ 'module_langname' => 'UCP_NEW_MODULE',
+ 'module_mode' => 'ucp_test',
+ 'module_auth' => '',
+ ));
+ }
+ catch (Exception $e)
+ {
+ $this->fail($e);
+ }
+ $this->assertEquals(true, $this->tool->exists('ucp', 'UCP_NEW_SUBCAT', 'UCP_NEW_MODULE'));
+ }
+
+ public function test_remove()
+ {
+ try
+ {
+ $this->tool->remove('acp', 'ACP_CAT', 'ACP_MODULE');
+ }
+ catch (Exception $e)
+ {
+ $this->fail($e);
+ }
+ $this->assertEquals(false, $this->tool->exists('acp', 'ACP_CAT', 'ACP_MODULE'));
+ }
+
+ public function test_reverse()
+ {
+ try
+ {
+ $this->tool->add('acp', 0, 'ACP_NEW_CAT');
+ }
+ catch (Exception $e)
+ {
+ $this->fail($e);
+ }
+
+ try
+ {
+ $this->tool->reverse('add', 'acp', 0, 'ACP_NEW_CAT');
+ }
+ catch (Exception $e)
+ {
+ $this->fail($e);
+ }
+ $this->assertFalse($this->tool->exists('acp', 0, 'ACP_NEW_CAT'));
+ }
+}
diff --git a/tests/dbal/migrator_tool_permission_test.php b/tests/dbal/migrator_tool_permission_test.php
new file mode 100644
index 0000000000..2d673864f7
--- /dev/null
+++ b/tests/dbal/migrator_tool_permission_test.php
@@ -0,0 +1,223 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
+
+class phpbb_dbal_migrator_tool_permission_test extends phpbb_database_test_case
+{
+ public $group_ids = array(
+ 'REGISTERED' => 2,
+ 'GLOBAL_MODERATORS' => 4,
+ 'ADMINISTRATORS' => 5,
+ );
+
+ public function getDataSet()
+ {
+ return $this->createXMLDataSet(dirname(__FILE__).'/fixtures/migrator_permission.xml');
+ }
+
+ public function setup()
+ {
+ // Global $db and $cache are needed in acp/auth.php constructor
+ global $phpbb_root_path, $phpEx, $db, $cache;
+
+ parent::setup();
+
+ $db = $this->db = $this->new_dbal();
+ $cache = $this->cache = new \phpbb\cache\service(new \phpbb\cache\driver\null(), new \phpbb\config\config(array()), $this->db, $phpbb_root_path, $phpEx);
+ $this->auth = new \phpbb\auth\auth();
+
+ $this->tool = new \phpbb\db\migration\tool\permission($this->db, $this->cache, $this->auth, $phpbb_root_path, $phpEx);
+ }
+
+ public function exists_data()
+ {
+ return array(
+ array(
+ 'global',
+ true,
+ true,
+ ),
+ array(
+ 'local',
+ false,
+ true,
+ ),
+ array(
+ 'both',
+ true,
+ true,
+ ),
+ array(
+ 'both',
+ false,
+ true,
+ ),
+ array(
+ 'does_not_exist',
+ true,
+ false,
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider exists_data
+ */
+ public function test_exists($auth_option, $global, $expected)
+ {
+ $this->assertEquals($expected, $this->tool->exists($auth_option, $global));
+ }
+
+ public function test_add()
+ {
+ try
+ {
+ $this->tool->add('new', true);
+ }
+ catch (Exception $e)
+ {
+ $this->fail($e);
+ }
+ $this->assertEquals(true, $this->tool->exists('new', true));
+ $this->assertEquals(false, $this->tool->exists('new', false));
+
+ try
+ {
+ $this->tool->add('new', false);
+ }
+ catch (Exception $e)
+ {
+ $this->fail($e);
+ }
+ $this->assertEquals(true, $this->tool->exists('new', false));
+
+ // Should fail (duplicate)
+ try
+ {
+ $this->tool->add('new', true);
+ $this->fail('Did not throw exception on duplicate');
+ }
+ catch (Exception $e) {}
+ }
+
+ public function test_remove()
+ {
+ try
+ {
+ $this->tool->remove('global', true);
+ }
+ catch (Exception $e)
+ {
+ $this->fail($e);
+ }
+ $this->assertEquals(false, $this->tool->exists('global', true));
+
+ try
+ {
+ $this->tool->remove('both', false);
+ }
+ catch (Exception $e)
+ {
+ $this->fail($e);
+ }
+ $this->assertEquals(false, $this->tool->exists('both', false));
+
+ // Should fail (does not exist)
+ try
+ {
+ $this->tool->remove('new', true);
+ $this->fail('Did not throw exception on duplicate');
+ }
+ catch (Exception $e) {}
+ }
+
+ public function test_reverse()
+ {
+ try
+ {
+ $this->tool->reverse('remove', 'global_test', true);
+ }
+ catch (Exception $e)
+ {
+ $this->fail($e);
+ }
+ $this->assertTrue($this->tool->exists('global_test', true));
+
+ try
+ {
+ $this->tool->reverse('add', 'global_test', true);
+ }
+ catch (Exception $e)
+ {
+ $this->fail($e);
+ }
+ $this->assertFalse($this->tool->exists('global_test', true));
+ }
+
+ public function test_permission_set_data()
+ {
+ return array(
+ array(
+ 'ADMINISTRATORS',
+ 'a_test',
+ 'group',
+ true,
+ ),
+ array(
+ 'GLOBAL_MODERATORS',
+ 'm_test',
+ 'group',
+ true,
+ ),
+ array(
+ 'REGISTERED',
+ 'u_test',
+ 'group',
+ true,
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider test_permission_set_data
+ */
+ public function test_permission_set($group_name, $auth_option, $type, $has_permission)
+ {
+ $this->tool->permission_set($group_name, $auth_option, $type, $has_permission);
+ $administrators_perm = $this->auth->acl_group_raw_data($this->group_ids['ADMINISTRATORS'], $auth_option);
+ $global_moderators_perm = $this->auth->acl_group_raw_data($this->group_ids['GLOBAL_MODERATORS'], $auth_option);
+ $registered_users_perm = $this->auth->acl_group_raw_data($this->group_ids['REGISTERED'], $auth_option);
+
+ switch($group_name)
+ {
+ case 'GLOBAL_MODERATORS':
+ $this->assertEquals(false, empty($administrators_perm), 'm_test is not empty for Administrators');
+ $this->assertEquals(false, empty($global_moderators_perm), 'm_test is not empty for Global moderators');
+ $this->assertEquals(true, empty($registered_users_perm), 'm_test empty for Registered users');
+ break;
+
+ case 'ADMINISTRATORS':
+ $this->assertEquals(false, empty($administrators_perm), 'a_test is not empty for Administrators');
+ $this->assertEquals(true, empty($global_moderators_perm), 'a_test is empty for Global moderators');
+ $this->assertEquals(true, empty($registered_users_perm), 'a_test is empty for Registered users');
+ break;
+
+ case 'REGISTERED':
+ $this->assertEquals(false, empty($administrators_perm), 'u_test is not empty for Administrators');
+ $this->assertEquals(false, empty($global_moderators_perm), 'u_test is not empty for Global moderators');
+ $this->assertEquals(false, empty($registered_users_perm), 'u_test is not empty for Registered users');
+ break;
+ }
+ }
+}
diff --git a/tests/dbal/order_lower_test.php b/tests/dbal/order_lower_test.php
index e17295a4ea..b101d28c7d 100644
--- a/tests/dbal/order_lower_test.php
+++ b/tests/dbal/order_lower_test.php
@@ -1,9 +1,13 @@
<?php
/**
*
-* @package testing
-* @copyright (c) 2011 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -18,7 +22,7 @@ class phpbb_dbal_order_lower_test extends phpbb_database_test_case
{
$db = $this->new_dbal();
- if (strpos($db->sql_layer, 'mysql') === 0 && version_compare($db->sql_server_info(true, false), '5.6', '>='))
+ if (strpos($db->get_sql_layer(), 'mysql') === 0 && version_compare($db->sql_server_info(true, false), '5.6', '>='))
{
$this->markTestSkipped('MySQL 5.6 fails to order things correctly. See also: http://tracker.phpbb.com/browse/PHPBB3-11571 http://bugs.mysql.com/bug.php?id=69005');
}
@@ -36,29 +40,32 @@ class phpbb_dbal_order_lower_test extends phpbb_database_test_case
array(
'style_id' => 1,
'style_name' => 'prosilver',
- 'style_copyright' => '&copy; phpBB Group',
+ 'style_copyright' => '&copy; phpBB Limited',
'style_active' => 1,
- 'template_id' => 1,
- 'theme_id' => 1,
- 'imageset_id' => 1
+ 'style_path' => 'prosilver',
+ 'bbcode_bitfield' => 'kNg=',
+ 'style_parent_id' => 0,
+ 'style_parent_tree' => '',
),
array(
'style_id' => 3,
'style_name' => 'Prosilver1',
- 'style_copyright' => '&copy; phpBB Group',
+ 'style_copyright' => '&copy; phpBB Limited',
'style_active' => 0,
- 'template_id' => 3,
- 'theme_id' => 3,
- 'imageset_id' => 3
+ 'style_path' => 'prosilver1',
+ 'bbcode_bitfield' => 'kNg=',
+ 'style_parent_id' => 1,
+ 'style_parent_tree' => 'prosilver',
),
array(
'style_id' => 2,
'style_name' => 'prosilver2',
- 'style_copyright' => '&copy; phpBB Group',
+ 'style_copyright' => '&copy; phpBB Limited',
'style_active' => 0,
- 'template_id' => 2,
- 'theme_id' => 2,
- 'imageset_id' => 2
+ 'style_path' => 'prosilver2',
+ 'bbcode_bitfield' => 'kNg=',
+ 'style_parent_id' => 0,
+ 'style_parent_tree' => '',
)
),
$db->sql_fetchrowset($result)
diff --git a/tests/dbal/schema_test.php b/tests/dbal/schema_test.php
new file mode 100644
index 0000000000..f13c7ce032
--- /dev/null
+++ b/tests/dbal/schema_test.php
@@ -0,0 +1,42 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
+
+class phpbb_dbal_schema_test extends phpbb_database_test_case
+{
+ public function getDataSet()
+ {
+ return $this->createXMLDataSet(dirname(__FILE__).'/fixtures/config.xml');
+ }
+
+ public function test_config_value_multibyte()
+ {
+ $db = $this->new_dbal();
+
+ $value = str_repeat("\xC3\x84", 255);
+ $sql = "INSERT INTO phpbb_config
+ (config_name, config_value)
+ VALUES ('name', '$value')";
+ $result = $db->sql_query($sql);
+
+ $sql = "SELECT config_value
+ FROM phpbb_config
+ WHERE config_name = 'name'";
+ $result = $db->sql_query_limit($sql, 1);
+ $row = $db->sql_fetchrow($result);
+ $db->sql_freeresult($result);
+
+ $this->assertEquals($value, $row['config_value']);
+ }
+}
diff --git a/tests/dbal/select_test.php b/tests/dbal/select_test.php
index 6dbab05a41..b7074552ba 100644
--- a/tests/dbal/select_test.php
+++ b/tests/dbal/select_test.php
@@ -1,9 +1,13 @@
<?php
/**
*
-* @package testing
-* @copyright (c) 2008 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -17,7 +21,7 @@ class phpbb_dbal_select_test extends phpbb_database_test_case
return $this->createXMLDataSet(dirname(__FILE__).'/fixtures/three_users.xml');
}
- static public function return_on_error_select_data()
+ public function return_on_error_select_data()
{
return array(
array('phpbb_users', "username_clean = 'bertie'", array(array('username_clean' => 'bertie'))),
@@ -44,7 +48,7 @@ class phpbb_dbal_select_test extends phpbb_database_test_case
$this->assertEquals($expected, $db->sql_fetchrowset($result));
}
- static public function fetchrow_data()
+ public function fetchrow_data()
{
return array(
array('', array(array('username_clean' => 'barfoo'),
@@ -95,7 +99,7 @@ class phpbb_dbal_select_test extends phpbb_database_test_case
$db->sql_freeresult($result);
}
- static public function fetchfield_data()
+ public function fetchfield_data()
{
return array(
array('', array('barfoo', 'foobar', 'bertie')),
@@ -192,7 +196,7 @@ class phpbb_dbal_select_test extends phpbb_database_test_case
$this->assertEquals($expected, $ary);
}
- static public function like_expression_data()
+ public function like_expression_data()
{
// * = any_char; # = one_char
return array(
@@ -215,8 +219,8 @@ class phpbb_dbal_select_test extends phpbb_database_test_case
{
$db = $this->new_dbal();
- $like_expression = str_replace('*', $db->any_char, $like_expression);
- $like_expression = str_replace('#', $db->one_char, $like_expression);
+ $like_expression = str_replace('*', $db->get_any_char(), $like_expression);
+ $like_expression = str_replace('#', $db->get_one_char(), $like_expression);
$where = ($like_expression) ? 'username_clean ' . $db->sql_like_expression($like_expression) : '';
$result = $db->sql_query('SELECT username_clean
@@ -229,7 +233,67 @@ class phpbb_dbal_select_test extends phpbb_database_test_case
$db->sql_freeresult($result);
}
- static public function in_set_data()
+ public function not_like_expression_data()
+ {
+ // * = any_char; # = one_char
+ return array(
+ array('barfoo', array(
+ array('username_clean' => 'foobar'),
+ array('username_clean' => 'bertie')
+ )),
+ array('bar', array(
+ array('username_clean' => 'barfoo'),
+ array('username_clean' => 'foobar'),
+ array('username_clean' => 'bertie'),
+ )),
+ array('bar*', array(
+ array('username_clean' => 'foobar'),
+ array('username_clean' => 'bertie'))
+ ),
+ array('*bar*', array(array('username_clean' => 'bertie'))),
+ array('b*r', array(
+ array('username_clean' => 'barfoo'),
+ array('username_clean' => 'foobar'),
+ array('username_clean' => 'bertie')
+ )),
+ array('b*e', array(
+ array('username_clean' => 'barfoo'),
+ array('username_clean' => 'foobar')
+ )),
+ array('#b*e', array(
+ array('username_clean' => 'barfoo'),
+ array('username_clean' => 'foobar'),
+ array('username_clean' => 'bertie')
+ )),
+ array('b####e', array(
+ array('username_clean' => 'barfoo'),
+ array('username_clean' => 'foobar')
+ )),
+ );
+ }
+
+ /**
+ * @dataProvider not_like_expression_data
+ */
+ public function test_not_like_expression($like_expression, $expected)
+ {
+ $db = $this->new_dbal();
+
+ $like_expression = str_replace('*', $db->get_any_char(), $like_expression);
+ $like_expression = str_replace('#', $db->get_one_char(), $like_expression);
+ $where = ($like_expression) ? 'username_clean ' . $db->sql_not_like_expression($like_expression) : '';
+
+ $result = $db->sql_query('SELECT username_clean
+ FROM phpbb_users
+ ' . (($where) ? ' WHERE ' . $where : '') . '
+ ORDER BY user_id ASC');
+
+ $this->assertEquals($expected, $db->sql_fetchrowset($result));
+
+ $db->sql_freeresult($result);
+ }
+
+ public function in_set_data()
{
return array(
array('user_id', 3, false, false, array(array('username_clean' => 'bertie'))),
@@ -303,7 +367,7 @@ class phpbb_dbal_select_test extends phpbb_database_test_case
$db->sql_freeresult($result);
}
- static public function build_array_data()
+ public function build_array_data()
{
return array(
array(array('username_clean' => 'barfoo'), array(array('username_clean' => 'barfoo'))),
diff --git a/tests/dbal/sql_affected_rows_test.php b/tests/dbal/sql_affected_rows_test.php
new file mode 100644
index 0000000000..07d7318358
--- /dev/null
+++ b/tests/dbal/sql_affected_rows_test.php
@@ -0,0 +1,68 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+class phpbb_dbal_sql_affected_rows_test extends phpbb_database_test_case
+{
+ /** @var \phpbb\db\driver\driver_interface */
+ protected $db;
+
+ public function setUp()
+ {
+ parent::setUp();
+ $this->db = $this->new_dbal();
+ }
+
+ public function getDataSet()
+ {
+ return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/config.xml');
+ }
+
+ public function test_update()
+ {
+ $sql = 'UPDATE ' . CONFIG_TABLE . "
+ SET config_value = 'bertie'";
+ $this->db->sql_query($sql);
+
+ $this->assertEquals(2, $this->db->sql_affectedrows());
+ }
+
+ public function test_update_all_matched_unequal_updated()
+ {
+ $sql = 'UPDATE ' . CONFIG_TABLE . "
+ SET config_value = 'foo'";
+ $this->db->sql_query($sql);
+
+ $this->assertEquals(2, $this->db->sql_affectedrows());
+ }
+
+ public function test_update_same_value_matched_unequal_updated()
+ {
+ $sql = 'UPDATE ' . CONFIG_TABLE . "
+ SET config_value = 'foo'
+ WHERE config_value = 'foo'";
+ $this->db->sql_query($sql);
+
+ $this->assertEquals(1, $this->db->sql_affectedrows());
+ }
+
+ public function test_insert()
+ {
+ $sql = 'INSERT INTO ' . CONFIG_TABLE . ' ' . $this->db->sql_build_array('INSERT', array(
+ 'config_name' => 'bertie',
+ 'config_value' => 'rules',
+ ));
+ $this->db->sql_query($sql);
+
+ $this->assertEquals(1, $this->db->sql_affectedrows());
+ }
+}
diff --git a/tests/dbal/sql_insert_buffer_test.php b/tests/dbal/sql_insert_buffer_test.php
new file mode 100644
index 0000000000..eae0abceba
--- /dev/null
+++ b/tests/dbal/sql_insert_buffer_test.php
@@ -0,0 +1,120 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+class phpbb_dbal_sql_insert_buffer_test extends phpbb_database_test_case
+{
+ protected $db;
+ protected $buffer;
+
+ public function setUp()
+ {
+ parent::setUp();
+
+ $this->db = $this->new_dbal();
+ $this->buffer = new \phpbb\db\sql_insert_buffer($this->db, 'phpbb_config', 2);
+ $this->assert_config_count(2);
+ }
+
+ public function getDataSet()
+ {
+ return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/config.xml');
+ }
+
+ public function test_multi_insert_disabled_insert_and_flush()
+ {
+ $this->db->set_multi_insert(false);
+ $this->assertTrue($this->buffer->insert($this->get_row(1)));
+ $this->assert_config_count(3);
+ $this->assertFalse($this->buffer->flush());
+ $this->assert_config_count(3);
+ }
+
+ public function test_multi_insert_enabled_insert_and_flush()
+ {
+ $this->check_multi_insert_support();
+ $this->assertFalse($this->buffer->insert($this->get_row(1)));
+ $this->assert_config_count(2);
+ $this->assertTrue($this->buffer->flush());
+ $this->assert_config_count(3);
+ }
+
+ public function test_multi_insert_disabled_insert_with_flush()
+ {
+ $this->db->set_multi_insert(false);
+ $this->assertTrue($this->buffer->insert($this->get_row(1)));
+ $this->assert_config_count(3);
+ $this->assertTrue($this->buffer->insert($this->get_row(2)));
+ $this->assert_config_count(4);
+ }
+
+ public function test_multi_insert_enabled_insert_with_flush()
+ {
+ $this->check_multi_insert_support();
+ $this->assertFalse($this->buffer->insert($this->get_row(1)));
+ $this->assert_config_count(2);
+ $this->assertTrue($this->buffer->insert($this->get_row(2)));
+ $this->assert_config_count(4);
+ }
+
+ public function test_multi_insert_disabled_insert_all_and_flush()
+ {
+ $this->db->set_multi_insert(false);
+ $this->assertTrue($this->buffer->insert_all($this->get_rows(3)));
+ $this->assert_config_count(5);
+ }
+
+ public function test_multi_insert_enabled_insert_all_and_flush()
+ {
+ $this->check_multi_insert_support();
+ $this->assertTrue($this->buffer->insert_all($this->get_rows(3)));
+ $this->assert_config_count(4);
+ $this->assertTrue($this->buffer->flush());
+ $this->assert_config_count(5);
+ }
+
+ protected function assert_config_count($num_configs)
+ {
+ $sql = 'SELECT COUNT(*) AS num_configs
+ FROM phpbb_config';
+ $result = $this->db->sql_query($sql);
+ $this->assertEquals($num_configs, $this->db->sql_fetchfield('num_configs'));
+ $this->db->sql_freeresult($result);
+ }
+
+ protected function check_multi_insert_support()
+ {
+ if (!$this->db->get_multi_insert())
+ {
+ $this->markTestSkipped('Database does not support multi_insert');
+ }
+ }
+
+ protected function get_row($rownum)
+ {
+ return array(
+ 'config_name' => "name$rownum",
+ 'config_value' => "value$rownum",
+ 'is_dynamic' => '0',
+ );
+ }
+
+ protected function get_rows($n)
+ {
+ $result = array();
+ for ($i = 0; $i < $n; ++$i)
+ {
+ $result[] = $this->get_row($i);
+ }
+ return $result;
+ }
+}
diff --git a/tests/dbal/write_sequence_test.php b/tests/dbal/write_sequence_test.php
index 8975cfbfb1..a1b589c578 100644
--- a/tests/dbal/write_sequence_test.php
+++ b/tests/dbal/write_sequence_test.php
@@ -1,9 +1,13 @@
<?php
/**
*
-* @package testing
-* @copyright (c) 2012 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -33,13 +37,15 @@ class phpbb_dbal_write_sequence_test extends phpbb_database_test_case
{
$db = $this->new_dbal();
+ // dbal uses cache
+ global $cache;
+ $cache = new phpbb_mock_cache();
+
$sql = 'INSERT INTO phpbb_users ' . $db->sql_build_array('INSERT', array(
'username' => $username,
'username_clean' => $username,
'user_permissions' => '',
'user_sig' => '',
- 'user_occ' => '',
- 'user_interests' => '',
));
$db->sql_query($sql);
diff --git a/tests/dbal/write_test.php b/tests/dbal/write_test.php
index ecfd774896..2426f2b0be 100644
--- a/tests/dbal/write_test.php
+++ b/tests/dbal/write_test.php
@@ -1,9 +1,13 @@
<?php
/**
*
-* @package testing
-* @copyright (c) 2008 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -16,7 +20,7 @@ class phpbb_dbal_write_test extends phpbb_database_test_case
return $this->createXMLDataSet(dirname(__FILE__).'/fixtures/config.xml');
}
- static public function build_array_insert_data()
+ public function build_array_insert_data()
{
return array(
array(array(
@@ -64,7 +68,7 @@ class phpbb_dbal_write_test extends phpbb_database_test_case
FROM phpbb_config';
$result = $db->sql_query($sql);
$rows = $db->sql_fetchrowset($result);
-
+
$this->assertEquals(1, sizeof($rows));
$this->assertEquals('config2', $rows[0]['config_name']);
@@ -104,7 +108,7 @@ class phpbb_dbal_write_test extends phpbb_database_test_case
$db->sql_freeresult($result);
}
- static public function update_data()
+ public function update_data()
{
return array(
array(
diff --git a/tests/di/create_container_test.php b/tests/di/create_container_test.php
new file mode 100644
index 0000000000..1a7eb4698c
--- /dev/null
+++ b/tests/di/create_container_test.php
@@ -0,0 +1,205 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace
+{
+ require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
+
+ class phpbb_di_container_test extends \phpbb_test_case
+ {
+ protected $config_php;
+
+ /**
+ * @var \phpbb\di\container_builder
+ */
+ protected $builder;
+ protected $phpbb_root_path;
+ protected $filename;
+
+ public function setUp()
+ {
+ $this->phpbb_root_path = dirname(__FILE__) . '/';
+ $this->config_php = new \phpbb\config_php_file($this->phpbb_root_path . 'fixtures/', 'php');
+ $this->builder = new phpbb_mock_phpbb_di_container_builder($this->config_php, $this->phpbb_root_path . 'fixtures/', 'php');
+
+ $this->filename = $this->phpbb_root_path . '../tmp/container.php';
+ if (is_file($this->filename))
+ {
+ unlink($this->filename);
+ }
+
+ parent::setUp();
+ }
+
+ public function test_default_container()
+ {
+ $container = $this->builder->get_container();
+ $this->assertInstanceOf('Symfony\Component\DependencyInjection\ContainerBuilder', $container);
+
+ // Checks the core services
+ $this->assertTrue($container->hasParameter('core'));
+
+ // Checks compile_container
+ $this->assertTrue($container->isFrozen());
+
+ // Checks inject_config
+ $this->assertTrue($container->hasParameter('core.table_prefix'));
+
+ // Checks use_extensions
+ $this->assertTrue($container->hasParameter('enabled'));
+ $this->assertFalse($container->hasParameter('disabled'));
+ $this->assertFalse($container->hasParameter('available'));
+
+ // Checks set_custom_parameters
+ $this->assertTrue($container->hasParameter('core.root_path'));
+
+ // Checks dump_container
+ $this->assertTrue(is_file($this->filename));
+
+ // Checks the construction of a dumped container
+ $container = $this->builder->get_container();
+ $this->assertInstanceOf('phpbb_cache_container', $container);
+ $this->assertFalse($container->isFrozen());
+ $container->getParameterBag(); // needed, otherwise the container is not marked as frozen
+ $this->assertTrue($container->isFrozen());
+ }
+
+ public function test_dump_container()
+ {
+ $this->builder->set_dump_container(false);
+ $container = $this->builder->get_container();
+ $this->assertInstanceOf('Symfony\Component\DependencyInjection\ContainerBuilder', $container);
+
+ // Checks dump_container
+ $this->assertFalse(is_file($this->filename));
+
+ // Checks the construction of a dumped container
+ $container = $this->builder->get_container();
+ $this->assertNotInstanceOf('phpbb_cache_container', $container);
+ $this->assertInstanceOf('Symfony\Component\DependencyInjection\ContainerBuilder', $container);
+ $this->assertTrue($container->isFrozen());
+ }
+
+ public function test_use_extensions()
+ {
+ $this->builder->set_use_extensions(false);
+ $container = $this->builder->get_container();
+ $this->assertInstanceOf('Symfony\Component\DependencyInjection\ContainerBuilder', $container);
+
+ // Checks the core services
+ $this->assertTrue($container->hasParameter('core'));
+
+ // Checks use_extensions
+ $this->assertFalse($container->hasParameter('enabled'));
+ $this->assertFalse($container->hasParameter('disabled'));
+ $this->assertFalse($container->hasParameter('available'));
+ }
+
+ public function test_compile_container()
+ {
+ $this->builder->set_compile_container(false);
+ $container = $this->builder->get_container();
+ $this->assertInstanceOf('Symfony\Component\DependencyInjection\ContainerBuilder', $container);
+
+ // Checks compile_container
+ $this->assertFalse($container->isFrozen());
+ }
+
+ public function test_inject_config()
+ {
+ $this->builder->set_inject_config(false);
+ $container = $this->builder->get_container();
+ $this->assertInstanceOf('Symfony\Component\DependencyInjection\ContainerBuilder', $container);
+
+ // Checks inject_config
+ $this->assertFalse($container->hasParameter('dbal.dbhost'));
+ }
+
+ public function test_set_config_path()
+ {
+ $this->builder->set_config_path($this->phpbb_root_path . 'fixtures/other_config/');
+ $container = $this->builder->get_container();
+ $this->assertInstanceOf('Symfony\Component\DependencyInjection\ContainerBuilder', $container);
+
+ $this->assertTrue($container->hasParameter('other_config'));
+ $this->assertFalse($container->hasParameter('core'));
+ }
+
+ public function test_set_custom_parameters()
+ {
+ $this->builder->set_custom_parameters(array('my_parameter' => true));
+ $container = $this->builder->get_container();
+ $this->assertInstanceOf('Symfony\Component\DependencyInjection\ContainerBuilder', $container);
+
+ $this->assertTrue($container->hasParameter('my_parameter'));
+ $this->assertFalse($container->hasParameter('core.root_path'));
+ }
+ }
+}
+
+namespace phpbb\db\driver
+{
+ class container_mock extends \phpbb\db\driver\driver
+ {
+ public function sql_connect($sqlserver, $sqluser, $sqlpassword, $database, $port = false, $persistency = false, $new_link = false)
+ {
+ }
+
+ public function sql_query($query = '', $cache_ttl = 0)
+ {
+ }
+
+ public function sql_fetchrow($query_id = false)
+ {
+ }
+
+ public function sql_freeresult($query_id = false)
+ {
+ }
+
+ function sql_server_info($raw = false, $use_cache = true)
+ {
+ }
+
+ function sql_affectedrows()
+ {
+ }
+
+ function sql_rowseek($rownum, &$query_id)
+ {
+ }
+
+ function sql_nextid()
+ {
+ }
+
+ function sql_escape($msg)
+ {
+ }
+
+ function sql_like_expression($expression)
+ {
+ }
+
+ function sql_not_like_expression($expression)
+ {
+ }
+
+ function sql_fetchrowset($query_id = false)
+ {
+ return array(
+ array('ext_name' => 'vendor/enabled'),
+ );
+ }
+ }
+}
diff --git a/tests/di/fixtures/config.php b/tests/di/fixtures/config.php
new file mode 100644
index 0000000000..04e20f63d8
--- /dev/null
+++ b/tests/di/fixtures/config.php
@@ -0,0 +1,11 @@
+<?php
+// phpBB 3.1.x auto-generated configuration file
+// Do not change anything in this file!
+$dbms = 'container_mock';
+$dbhost = '127.0.0.1';
+$dbport = '';
+$dbname = 'phpbb';
+$dbuser = 'root';
+$dbpasswd = '';
+$table_prefix = 'phpbb_';
+$acm_type = '\phpbb\cache\driver\null';
diff --git a/tests/di/fixtures/config/services.yml b/tests/di/fixtures/config/services.yml
new file mode 100644
index 0000000000..913a2603c9
--- /dev/null
+++ b/tests/di/fixtures/config/services.yml
@@ -0,0 +1,17 @@
+parameters:
+ core: true
+
+services:
+ config.php:
+ synthetic: true
+
+ dbal.conn:
+ class: phpbb\db\driver\factory
+ arguments:
+ - @service_container
+
+ dbal.conn.driver:
+ synthetic: true
+
+ dispatcher:
+ class: phpbb\db\driver\container_mock
diff --git a/tests/di/fixtures/ext/vendor/available/config/services.yml b/tests/di/fixtures/ext/vendor/available/config/services.yml
new file mode 100644
index 0000000000..2ced431f5a
--- /dev/null
+++ b/tests/di/fixtures/ext/vendor/available/config/services.yml
@@ -0,0 +1,2 @@
+parameters:
+ available: true
diff --git a/tests/di/fixtures/ext/vendor/disabled/config/services.yml b/tests/di/fixtures/ext/vendor/disabled/config/services.yml
new file mode 100644
index 0000000000..31ada384bf
--- /dev/null
+++ b/tests/di/fixtures/ext/vendor/disabled/config/services.yml
@@ -0,0 +1,2 @@
+parameters:
+ disabled: true
diff --git a/tests/di/fixtures/ext/vendor/enabled/config/services.yml b/tests/di/fixtures/ext/vendor/enabled/config/services.yml
new file mode 100644
index 0000000000..88a7919ed1
--- /dev/null
+++ b/tests/di/fixtures/ext/vendor/enabled/config/services.yml
@@ -0,0 +1,2 @@
+parameters:
+ enabled: true
diff --git a/tests/di/fixtures/other_config/services.yml b/tests/di/fixtures/other_config/services.yml
new file mode 100644
index 0000000000..d6246d3bc0
--- /dev/null
+++ b/tests/di/fixtures/other_config/services.yml
@@ -0,0 +1,17 @@
+parameters:
+ other_config: true
+
+services:
+ config.php:
+ synthetic: true
+
+ dbal.conn:
+ class: phpbb\db\driver\factory
+ arguments:
+ - @service_container
+
+ dbal.conn.driver:
+ synthetic: true
+
+ dispatcher:
+ class: phpbb\db\driver\container_mock
diff --git a/tests/download/http_byte_range_test.php b/tests/download/http_byte_range_test.php
new file mode 100644
index 0000000000..f920299048
--- /dev/null
+++ b/tests/download/http_byte_range_test.php
@@ -0,0 +1,68 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions_download.php';
+
+class phpbb_download_http_byte_range_test extends phpbb_test_case
+{
+ public function test_find_range_request()
+ {
+ // Missing 'bytes=' prefix
+ $GLOBALS['request'] = new phpbb_mock_request();
+ $GLOBALS['request']->set_header('Range', 'bztes=');
+ $this->assertEquals(false, phpbb_find_range_request());
+ unset($GLOBALS['request']);
+
+ $GLOBALS['request'] = new phpbb_mock_request();
+ $_ENV['HTTP_RANGE'] = 'bztes=';
+ $this->assertEquals(false, phpbb_find_range_request());
+ unset($_ENV['HTTP_RANGE']);
+
+ $GLOBALS['request'] = new phpbb_mock_request();
+ $GLOBALS['request']->set_header('Range', 'bytes=0-0,123-125');
+ $this->assertEquals(array('0-0', '123-125'), phpbb_find_range_request());
+ unset($GLOBALS['request']);
+ }
+
+ /**
+ * @dataProvider parse_range_request_data()
+ */
+ public function test_parse_range_request($request_array, $filesize, $expected)
+ {
+ $this->assertEquals($expected, phpbb_parse_range_request($request_array, $filesize));
+ }
+
+ public function parse_range_request_data()
+ {
+ return array(
+ // Does not read until the end of file.
+ array(
+ array('3-4'),
+ 10,
+ false,
+ ),
+
+ // Valid request, handle second range.
+ array(
+ array('0-0', '120-125'),
+ 125,
+ array(
+ 'byte_pos_start' => 120,
+ 'byte_pos_end' => 124,
+ 'bytes_requested' => 5,
+ 'bytes_total' => 125,
+ )
+ ),
+ );
+ }
+}
diff --git a/tests/download/http_user_agent_test.php b/tests/download/http_user_agent_test.php
new file mode 100644
index 0000000000..bfee265add
--- /dev/null
+++ b/tests/download/http_user_agent_test.php
@@ -0,0 +1,134 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions_download.php';
+
+class phpbb_download_http_user_agent_test extends phpbb_test_case
+{
+ public function user_agents_check_greater_ie_version()
+ {
+ return array(
+ // user agent
+ // IE version
+ // expected
+ array(
+ 'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)',
+ 7,
+ true,
+ ),
+ array(
+ 'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/6.0)',
+ 7,
+ true,
+ ),
+ array(
+ 'Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; GTB7.4; InfoPath.2; SV1; .NET CLR 3.3.69573; WOW64; en-US)',
+ 7,
+ true,
+ ),
+ array(
+ 'Mozilla/5.0 (Windows; U; MSIE 7.0; Windows NT 6.0; en-US)',
+ 7,
+ false,
+ ),
+ array(
+ 'Mozilla/4.0 (compatible; MSIE 6.1; Windows XP; .NET CLR 1.1.4322; .NET CLR 2.0.50727)',
+ 7,
+ false,
+ ),
+ array(
+ 'Mozilla/4.0 (compatible; MSIE 6.01; Windows NT 6.0)',
+ 7,
+ false,
+ ),
+ array(
+ 'Mozilla/5.0 (Windows; U; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727)',
+ 7,
+ false,
+ ),
+ array(
+ 'Mozilla/5.0 (Windows NT 6.2; Win64; x64;) Gecko/20100101 Firefox/20.0',
+ 7,
+ false,
+ ),
+ array(
+ 'Mozilla/5.0 (Windows NT 6.2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1464.0 Safari/537.36',
+ 7,
+ false,
+ ),
+ array(
+ 'Googlebot-Image/1.0',
+ 7,
+ false,
+ ),
+ array(
+ 'Googlebot/2.1 ( http://www.google.com/bot.html)',
+ 7,
+ false,
+ ),
+ array(
+ 'Lynx/2.8.3dev.9 libwww-FM/2.14 SSL-MM/1.4.1 OpenSSL/0.9.6',
+ 7,
+ false,
+ ),
+ array(
+ 'Links (0.9x; Linux 2.4.7-10 i686)',
+ 7,
+ false,
+ ),
+ array(
+ 'Opera/9.60 (Windows NT 5.1; U; de) Presto/2.1.1',
+ 7,
+ false,
+ ),
+ array(
+ 'Mozilla/4.0 (compatible; MSIE 5.0; Windows NT;)',
+ 7,
+ false,
+ ),
+ array(
+ 'Mozilla/4.0 (compatible; MSIE 5.0; Windows NT 4.0) Opera 6.01 [en]',
+ 7,
+ false,
+ ),
+ array(
+ 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; en) Opera 9.24',
+ 7,
+ false,
+ ),
+ array(
+ 'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)',
+ 8,
+ true,
+ ),
+ array(
+ 'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/6.0)',
+ 9,
+ true,
+ ),
+ array(
+ 'Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; GTB7.4; InfoPath.2; SV1; .NET CLR 3.3.69573; WOW64; en-US)',
+ 10,
+ false,
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider user_agents_check_greater_ie_version
+ */
+ public function test_is_greater_ie_version($user_agent, $version, $expected)
+ {
+ $this->assertEquals($expected, phpbb_is_greater_ie_version($user_agent, $version));
+ }
+}
diff --git a/tests/error_collector_test.php b/tests/error_collector_test.php
index d67dea3719..b92c4fa6bb 100644
--- a/tests/error_collector_test.php
+++ b/tests/error_collector_test.php
@@ -1,20 +1,23 @@
<?php
/**
*
-* @package testing
-* @copyright (c) 2011 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
require_once dirname(__FILE__) . '/../phpBB/includes/functions.php';
-require_once dirname(__FILE__) . '/../phpBB/includes/error_collector.php';
class phpbb_error_collector_test extends phpbb_test_case
{
public function test_collection()
{
- $collector = new phpbb_error_collector;
+ $collector = new \phpbb\error_collector(E_ALL | E_STRICT); // php set_error_handler() default
$collector->install();
// Cause a warning
@@ -32,4 +35,32 @@ class phpbb_error_collector_test extends phpbb_test_case
$this->assertStringStartsWith('Errno 2: Division by zero at ', $error_contents);
$this->assertStringEndsWith(" line $line", $error_contents);
}
+
+ public function test_collection_with_mask()
+ {
+ $collector = new \phpbb\error_collector(E_ALL & ~E_NOTICE); // not collecting notices
+ $collector->install();
+
+ // Cause a warning
+ 1/0; $line = __LINE__;
+
+ // Cause a notice
+ $array = array('ITEM' => 'value');
+ $value = $array[ITEM]; $line2 = __LINE__;
+
+ $collector->uninstall();
+
+ // The notice should not be collected
+ $this->assertEmpty($collector->errors[1]);
+
+ list($errno, $msg_text, $errfile, $errline) = $collector->errors[0];
+ $error_contents = $collector->format_errors();
+
+ $this->assertEquals($errno, 2);
+
+ // Unfortunately $error_contents will contain the full path here,
+ // because the tests directory is outside of phpbb root path.
+ $this->assertStringStartsWith('Errno 2: Division by zero at ', $error_contents);
+ $this->assertStringEndsWith(" line $line", $error_contents);
+ }
}
diff --git a/tests/event/dispatcher_test.php b/tests/event/dispatcher_test.php
new file mode 100644
index 0000000000..7bba5bf337
--- /dev/null
+++ b/tests/event/dispatcher_test.php
@@ -0,0 +1,33 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+class phpbb_event_dispatcher_test extends phpbb_test_case
+{
+ public function test_trigger_event()
+ {
+ $dispatcher = new \phpbb\event\dispatcher(new phpbb_mock_container_builder());
+
+ $dispatcher->addListener('core.test_event', function (\phpbb\event\data $event) {
+ $event['foo'] = $event['foo'] . '2';
+ $event['bar'] = $event['bar'] . '2';
+ });
+
+ $foo = 'foo';
+ $bar = 'bar';
+
+ $vars = array('foo', 'bar');
+ $result = $dispatcher->trigger_event('core.test_event', compact($vars));
+
+ $this->assertSame(array('foo' => 'foo2', 'bar' => 'bar2'), $result);
+ }
+}
diff --git a/tests/event/exception_listener_test.php b/tests/event/exception_listener_test.php
new file mode 100644
index 0000000000..4d3453cd83
--- /dev/null
+++ b/tests/event/exception_listener_test.php
@@ -0,0 +1,100 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
+
+class exception_listener extends phpbb_test_case
+{
+ public function phpbb_exception_data()
+ {
+ return array(
+ array(
+ true,
+ new \Exception(),
+ array(
+ 'status_code' => 500,
+ ),
+ ),
+ array(
+ true,
+ new \Exception('AJAX_ERROR_TEXT'),
+ array(
+ 'status_code' => 500,
+ 'content' => 'AJAX_ERROR_TEXT',
+ ),
+ ),
+ array(
+ true,
+ new \phpbb\exception\runtime_exception('AJAX_ERROR_TEXT'),
+ array(
+ 'status_code' => 500,
+ 'content' => 'Something went wrong when processing your request.',
+ ),
+ ),
+ array(
+ true,
+ new \Symfony\Component\HttpKernel\Exception\HttpException(404, 'AJAX_ERROR_TEXT'),
+ array(
+ 'status_code' => 404,
+ 'content' => 'AJAX_ERROR_TEXT',
+ ),
+ ),
+ array(
+ true,
+ new \phpbb\exception\http_exception(404, 'AJAX_ERROR_TEXT'),
+ array(
+ 'status_code' => 404,
+ 'content' => 'Something went wrong when processing your request.',
+ ),
+ ),
+ array(
+ true,
+ new \phpbb\exception\http_exception(404, 'CURRENT_TIME', array('today')),
+ array(
+ 'status_code' => 404,
+ 'content' => 'It is currently today',
+ ),
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider phpbb_exception_data
+ */
+ public function test_phpbb_exception($is_ajax, $exception, $expected)
+ {
+ $request = \Symfony\Component\HttpFoundation\Request::create('test.php', 'GET', array(), array(), array(), $is_ajax ? array('HTTP_X_REQUESTED_WITH' => 'XMLHttpRequest') : array());
+
+ $template = $this->getMockBuilder('\phpbb\template\twig\twig')
+ ->disableOriginalConstructor()
+ ->getMock();
+
+ $user = new \phpbb\user('\phpbb\datetime');
+ $user->add_lang('common');
+
+ $exception_listener = new \phpbb\event\kernel_exception_subscriber($template, $user);
+
+ $event = new \Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent($this->getMock('Symfony\Component\HttpKernel\HttpKernelInterface'), $request, \Symfony\Component\HttpKernel\HttpKernelInterface::MASTER_REQUEST, $exception);
+ $exception_listener->on_kernel_exception($event);
+
+ $response = $event->getResponse();
+
+ $this->assertEquals($expected['status_code'], $response->getStatusCode());
+ $this->assertEquals($is_ajax, $response instanceof \Symfony\Component\HttpFoundation\JsonResponse);
+
+ if (isset($expected['content']))
+ {
+ $this->assertContains($expected['content'], $response->getContent());
+ }
+ }
+}
diff --git a/tests/event/export_php_test.php b/tests/event/export_php_test.php
new file mode 100644
index 0000000000..21bbb0620a
--- /dev/null
+++ b/tests/event/export_php_test.php
@@ -0,0 +1,49 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+class phpbb_event_export_php_test extends phpbb_test_case
+{
+ /** @var \phpbb\event\php_exporter */
+ protected $exporter;
+
+ public function setUp()
+ {
+ parent::setUp();
+
+ global $phpbb_root_path;
+ $this->exporter = new \phpbb\event\php_exporter($phpbb_root_path);
+ }
+
+ static public function crawl_php_file_data()
+ {
+ global $phpbb_root_path;
+ $exporter = new \phpbb\event\php_exporter($phpbb_root_path);
+ $files = $exporter->get_recursive_file_list($phpbb_root_path);
+
+ $data_provider = array();
+ foreach ($files as $file)
+ {
+ $data_provider[] = array($file);
+ }
+
+ return $data_provider;
+ }
+
+ /**
+ * @dataProvider crawl_php_file_data
+ */
+ public function test_crawl_php_file($file)
+ {
+ $this->assertGreaterThanOrEqual(0, $this->exporter->crawl_php_file($file));
+ }
+}
diff --git a/phpBB/styles/prosilver/imageset/index.htm b/tests/event/fixtures/adm/style/acp_bbcodes.html
index e69de29bb2..e69de29bb2 100644
--- a/phpBB/styles/prosilver/imageset/index.htm
+++ b/tests/event/fixtures/adm/style/acp_bbcodes.html
diff --git a/tests/event/fixtures/default.test b/tests/event/fixtures/default.test
new file mode 100644
index 0000000000..edfe4823dc
--- /dev/null
+++ b/tests/event/fixtures/default.test
@@ -0,0 +1,9 @@
+<?php
+
+/**
+* Description
+*
+* @event default.dispatch
+* @since 3.1.0-b2
+*/
+$phpbb_dispatcher->dispatch('default.dispatch');
diff --git a/tests/event/fixtures/duplicate_event.test b/tests/event/fixtures/duplicate_event.test
new file mode 100644
index 0000000000..b042ca0377
--- /dev/null
+++ b/tests/event/fixtures/duplicate_event.test
@@ -0,0 +1,19 @@
+<?php
+
+ /**
+ * Event after the post data has been assigned to the template
+ *
+ * @event duplicate.trigger
+ * @var int start Start item of this page
+ * @since 3.1.0-a3
+ */
+ $vars = array('start');
+ extract($phpbb_dispatcher->trigger_event('duplicate.trigger', compact($vars)));
+
+ /**
+ * Event after the post data has been assigned to the template
+ *
+ * @event duplicate.trigger
+ * @since 3.1.0-b1
+ */
+ $phpbb_dispatcher->dispatch('duplicate.trigger');
diff --git a/tests/event/fixtures/extra_description.test b/tests/event/fixtures/extra_description.test
new file mode 100644
index 0000000000..ce8f97ce89
--- /dev/null
+++ b/tests/event/fixtures/extra_description.test
@@ -0,0 +1,11 @@
+<?php
+
+/**
+* Description
+*
+* NOTE: This will not be exported
+*
+* @event extra_description.dispatch
+* @since 3.1.0-b2
+*/
+$phpbb_dispatcher->dispatch('extra_description.dispatch');
diff --git a/tests/event/fixtures/missing_var.test b/tests/event/fixtures/missing_var.test
new file mode 100644
index 0000000000..7ced5e93dc
--- /dev/null
+++ b/tests/event/fixtures/missing_var.test
@@ -0,0 +1,17 @@
+<?php
+
+ /**
+ * Event after the post data has been assigned to the template
+ *
+ * @event core.trigger
+ * @var int start Start item of this page
+ * @var int current_row_number Number of the post on this page
+ * @var int end Number of posts on this page
+ * @var array row Array with original post and user data
+ * @var array cp_row Custom profile field data of the poster
+ * @var array attachments List of attachments
+ * @var array user_poster_data Poster's data from user cache
+ * @since 3.1.0-a3
+ */
+ $vars = array('start', 'current_row_number', 'end', 'row', 'cp_row', 'attachments', 'user_poster_data', 'post_row');
+ extract($phpbb_dispatcher->trigger_event('core.trigger', compact($vars)));
diff --git a/tests/event/fixtures/none.test b/tests/event/fixtures/none.test
new file mode 100644
index 0000000000..6e2267024b
--- /dev/null
+++ b/tests/event/fixtures/none.test
@@ -0,0 +1,6 @@
+<?php
+
+/**
+* Hi there :)
+*/
+echo 1 + 2;
diff --git a/tests/event/fixtures/normal_events.md.test b/tests/event/fixtures/normal_events.md.test
new file mode 100644
index 0000000000..47921c4e57
--- /dev/null
+++ b/tests/event/fixtures/normal_events.md.test
@@ -0,0 +1,20 @@
+acp_bbcodes_actions_append
+===
+* Location: adm/style/acp_bbcodes.html
+* Since: 3.1.0-a3
+* Changed: 3.1.0-a4
+* Purpose: desc1
+
+acp_bbcodes_actions_prepend
+===
+* Location: adm/style/acp_bbcodes.html
+* Since: 3.1.0-a5
+* Purpose: desc2
+
+acp_bbcodes_actions_prepend2
+===
+* Location: adm/style/acp_bbcodes.html
+* Since: 3.1.0-a4
+* Changed: 3.1.0-a5 Moved up
+* Changed: 3.1.0-a6 Moved down
+* Purpose: desc2
diff --git a/tests/event/fixtures/trigger.test b/tests/event/fixtures/trigger.test
new file mode 100644
index 0000000000..7cd6a7b956
--- /dev/null
+++ b/tests/event/fixtures/trigger.test
@@ -0,0 +1,15 @@
+<?php
+
+ /**
+ * Event after the post data has been assigned to the template
+ *
+ * @event core.trigger
+ * @var int start Start item of this page
+ * @var int current_row_number Number of the post on this page
+ * @var int end Number of posts on this page
+ * @var array row Array with original post and user data
+ * @var array cp_row Custom profile field data of the poster
+ * @since 3.1.0-a3
+ */
+ $vars = array('start', 'current_row_number', 'end', 'row', 'cp_row');
+ extract($phpbb_dispatcher->trigger_event('core.trigger', compact($vars)));
diff --git a/tests/event/fixtures/trigger_many_vars.test b/tests/event/fixtures/trigger_many_vars.test
new file mode 100644
index 0000000000..5e0720d13b
--- /dev/null
+++ b/tests/event/fixtures/trigger_many_vars.test
@@ -0,0 +1,65 @@
+<?php
+
+ /**
+ * This event allows you to modify template variables for the posting screen
+ *
+ * @event core.posting_modify_template_vars
+ * @var array post_data Array with post data
+ * @var array moderators Array with forum moderators
+ * @var string mode What action to take if the form is submitted
+ * post|reply|quote|edit|delete|bump|smilies|popup
+ * @var string page_title Title of the mode page
+ * @var bool s_topic_icons Whether or not to show the topic icons
+ * @var string form_enctype If attachments are allowed for this form
+ * "multipart/form-data" or empty string
+ * @var string s_action The URL to submit the POST data to
+ * @var string s_hidden_fields Concatenated hidden input tags of posting form
+ * @var int post_id ID of the post
+ * @var int topic_id ID of the topic
+ * @var int forum_id ID of the forum
+ * @var bool submit Whether or not the form has been submitted
+ * @var bool preview Whether or not the post is being previewed
+ * @var bool save Whether or not a draft is being saved
+ * @var bool load Whether or not a draft is being loaded
+ * @var bool delete Whether or not the post is being deleted
+ * @var bool cancel Whether or not to cancel the form (returns to
+ * viewtopic or viewforum depending on if the user
+ * is posting a new topic or editing a post)
+ * @var array error Any error strings; a non-empty array aborts
+ * form submission.
+ * NOTE: Should be actual language strings, NOT
+ * language keys.
+ * @var bool refresh Whether or not to retain previously submitted data
+ * @var array page_data Posting page data that should be passed to the
+ * posting page via $template->assign_vars()
+ * @var object message_parser The message parser object
+ * @since 3.1.0-a1
+ * @changed 3.1.0-b3 Added vars post_data, moderators, mode, page_title,
+ * s_topic_icons, form_enctype, s_action, s_hidden_fields,
+ * post_id, topic_id, forum_id, submit, preview, save, load,
+ * delete, cancel, refresh, error, page_data, message_parser
+ */
+ $vars = array(
+ 'post_data',
+ 'moderators',
+ 'mode',
+ 'page_title',
+ 's_topic_icons',
+ 'form_enctype',
+ 's_action',
+ 's_hidden_fields',
+ 'post_id',
+ 'topic_id',
+ 'forum_id',
+ 'submit',
+ 'preview',
+ 'save',
+ 'load',
+ 'delete',
+ 'cancel',
+ 'refresh',
+ 'error',
+ 'page_data',
+ 'message_parser',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.posting_modify_template_vars', compact($vars)));
diff --git a/tests/event/fixtures/trigger_wspace.test b/tests/event/fixtures/trigger_wspace.test
new file mode 100644
index 0000000000..0334a9c80b
--- /dev/null
+++ b/tests/event/fixtures/trigger_wspace.test
@@ -0,0 +1,15 @@
+<?php
+
+ /**
+ * Event after the post data has been assigned to the template
+ *
+ * @event core.trigger
+ * @var int start Start item of this page
+ * @var int current_row_number Number of the post on this page
+ * @var int end Number of posts on this page
+ * @var array row Array with original post and user data
+ * @var array cp_row Custom profile field data of the poster
+ * @since 3.1.0-a3
+ */
+ $vars = array('start', 'current_row_number', 'end', 'row', 'cp_row');
+ extract($phpbb_dispatcher->trigger_event('core.trigger', compact($vars)));
diff --git a/tests/event/md_exporter_test.php b/tests/event/md_exporter_test.php
new file mode 100644
index 0000000000..1a51204cbe
--- /dev/null
+++ b/tests/event/md_exporter_test.php
@@ -0,0 +1,160 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
+
+class phpbb_event_md_exporter_test extends phpbb_test_case
+{
+ static public function crawl_eventsmd_data()
+ {
+ return array(
+ array('normal_events.md.test', null, null, array(
+ 'acp_bbcodes_actions_append' => array(
+ 'event' => 'acp_bbcodes_actions_append',
+ 'files' => array(
+ 'prosilver' => array(),
+ 'subsilver2' => array(),
+ 'adm' => array('acp_bbcodes.html'),
+ ),
+ 'since' => '3.1.0-a3',
+ 'changed' => array(
+ '3.1.0-a4' => '',
+ ),
+ 'description' => 'desc1' . "\n",
+ ),
+ 'acp_bbcodes_actions_prepend' => array(
+ 'event' => 'acp_bbcodes_actions_prepend',
+ 'files' => array(
+ 'prosilver' => array(),
+ 'subsilver2' => array(),
+ 'adm' => array('acp_bbcodes.html'),
+ ),
+ 'since' => '3.1.0-a5',
+ 'changed' => array(),
+ 'description' => 'desc2' . "\n",
+ ),
+ 'acp_bbcodes_actions_prepend2' => array(
+ 'event' => 'acp_bbcodes_actions_prepend2',
+ 'files' => array(
+ 'prosilver' => array(),
+ 'subsilver2' => array(),
+ 'adm' => array('acp_bbcodes.html'),
+ ),
+ 'since' => '3.1.0-a4',
+ 'changed' => array(
+ '3.1.0-a5' => 'Moved up',
+ '3.1.0-a6' => 'Moved down',
+ ),
+ 'description' => 'desc2' . "\n",
+ ),
+ )),
+ array('normal_events.md.test', '3.1.0-a5', '3.1.0-a5', array(
+ 'acp_bbcodes_actions_prepend' => array(
+ 'event' => 'acp_bbcodes_actions_prepend',
+ 'files' => array(
+ 'prosilver' => array(),
+ 'subsilver2' => array(),
+ 'adm' => array('acp_bbcodes.html'),
+ ),
+ 'since' => '3.1.0-a5',
+ 'changed' => array(),
+ 'description' => 'desc2' . "\n",
+ ),
+ 'acp_bbcodes_actions_prepend2' => array(
+ 'event' => 'acp_bbcodes_actions_prepend2',
+ 'files' => array(
+ 'prosilver' => array(),
+ 'subsilver2' => array(),
+ 'adm' => array('acp_bbcodes.html'),
+ ),
+ 'since' => '3.1.0-a4',
+ 'changed' => array(
+ '3.1.0-a5' => 'Moved up',
+ '3.1.0-a6' => 'Moved down',
+ ),
+ 'description' => 'desc2' . "\n",
+ ),
+ )),
+ );
+ }
+
+ /**
+ * @dataProvider crawl_eventsmd_data
+ *
+ * @param string $file
+ * @param string $min_version
+ * @param string $max_version
+ * @param array $events
+ */
+ public function test_crawl_eventsmd($file, $min_version, $max_version, $events)
+ {
+ $exporter = new \phpbb\event\md_exporter(dirname(__FILE__) . '/fixtures/', null, $min_version, $max_version);
+ $this->assertSame(sizeof($events), $exporter->crawl_eventsmd($file, 'adm'));
+ $this->assertEquals($events, $exporter->get_events());
+ }
+
+ static public function crawl_phpbb_eventsmd_data()
+ {
+ return array(
+ array('styles'),
+ array('adm'),
+ );
+ }
+
+ /**
+ * @dataProvider crawl_phpbb_eventsmd_data
+ */
+ public function test_crawl_phpbb_eventsmd($filter)
+ {
+ global $phpbb_root_path;
+ $exporter = new \phpbb\event\md_exporter($phpbb_root_path);
+ $this->assertGreaterThan(0, $exporter->crawl_eventsmd('docs/events.md', $filter));
+ }
+
+ static public function crawl_template_file_data()
+ {
+ global $phpbb_root_path;
+ $exporter = new \phpbb\event\md_exporter($phpbb_root_path);
+ $data_provider = array();
+
+ $styles = array(
+ 'adm/style/' => 'adm',
+ 'styles/prosilver/template/' => 'styles',
+ 'styles/subsilver2/template/' => 'styles',
+ );
+ foreach ($styles as $path => $filter)
+ {
+ $files = $exporter->get_recursive_file_list($phpbb_root_path . $path, $path);
+ foreach ($files as $file)
+ {
+ $data_provider[] = array($filter, $path . $file);
+ }
+ }
+
+ return $data_provider;
+ }
+
+ /**
+ * @dataProvider crawl_template_file_data
+ */
+ public function test_crawl_template_file($filter, $file)
+ {
+ global $phpbb_root_path;
+ $exporter = new \phpbb\event\md_exporter($phpbb_root_path);
+ $exporter->crawl_eventsmd('docs/events.md', $filter);
+ $events = $exporter->crawl_file_for_events($file);
+
+ $this->assertGreaterThanOrEqual(0, sizeof($events));
+ $this->assertTrue($exporter->validate_events_from_file($file, $events));
+ }
+}
diff --git a/tests/event/php_exporter_test.php b/tests/event/php_exporter_test.php
new file mode 100644
index 0000000000..692a57f93c
--- /dev/null
+++ b/tests/event/php_exporter_test.php
@@ -0,0 +1,740 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+class phpbb_event_php_exporter_test extends phpbb_test_case
+{
+ /** @var \phpbb\event\php_exporter */
+ protected $exporter;
+
+ public function setUp()
+ {
+ parent::setUp();
+ $this->exporter = new \phpbb\event\php_exporter(dirname(__FILE__) . '/fixtures/');
+ }
+
+ static public function crawl_php_file_data()
+ {
+ return array(
+ array(
+ 'default.test',
+ array(
+ 'default.dispatch' => array(
+ 'event' => 'default.dispatch',
+ 'file' => 'default.test',
+ 'arguments' => array(),
+ 'since' => '3.1.0-b2',
+ 'description' => 'Description',
+ ),
+ ),
+ ),
+ array(
+ 'extra_description.test',
+ array(
+ 'extra_description.dispatch' => array(
+ 'event' => 'extra_description.dispatch',
+ 'file' => 'extra_description.test',
+ 'arguments' => array(),
+ 'since' => '3.1.0-b2',
+ 'description' => 'Description',
+ ),
+ ),
+ ),
+ array(
+ 'trigger.test',
+ array(
+ 'core.trigger' => array(
+ 'event' => 'core.trigger',
+ 'file' => 'trigger.test',
+ 'arguments' => array('cp_row', 'current_row_number', 'end', 'row', 'start'),
+ 'since' => '3.1.0-a3',
+ 'description' => 'Event after the post data has been assigned to the template',
+ ),
+ ),
+ ),
+ array(
+ 'trigger_wspace.test',
+ array(
+ 'core.trigger' => array(
+ 'event' => 'core.trigger',
+ 'file' => 'trigger_wspace.test',
+ 'arguments' => array('cp_row', 'current_row_number', 'end', 'row', 'start'),
+ 'since' => '3.1.0-a3',
+ 'description' => 'Event after the post data has been assigned to the template',
+ ),
+ ),
+ ),
+ array(
+ 'trigger_many_vars.test',
+ array(
+ 'core.posting_modify_template_vars' => array(
+ 'event' => 'core.posting_modify_template_vars',
+ 'file' => 'trigger_many_vars.test',
+ 'arguments' => array(
+ 'cancel', 'delete', 'error', 'form_enctype', 'forum_id',
+ 'load', 'message_parser', 'mode', 'moderators', 'page_data',
+ 'page_title', 'post_data', 'post_id', 'preview', 'refresh',
+ 's_action', 's_hidden_fields', 's_topic_icons', 'save',
+ 'submit', 'topic_id',
+ ),
+ 'since' => '3.1.0-a1',
+ 'description' => 'This event allows you to modify template variables for the posting screen',
+ ),
+ ),
+ ),
+ array(
+ 'none.test',
+ array(),
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider crawl_php_file_data
+ */
+ public function test_crawl_php_file($file, $expected)
+ {
+ $this->exporter->crawl_php_file($file);
+ $this->assertEquals($expected, $this->exporter->get_events());
+ }
+
+ static public function crawl_php_file_throws_data()
+ {
+ return array(
+ array('missing_var.test', null),
+ array('duplicate_event.test', 10),
+ );
+ }
+
+ /**
+ * @dataProvider crawl_php_file_throws_data
+ */
+ public function test_crawl_php_file_throws($file, $exception_code)
+ {
+ $this->setExpectedException('LogicException', '', $exception_code);
+ $this->exporter->crawl_php_file($file);
+ }
+
+ static public function validate_since_data()
+ {
+ return array(
+ array('* @since 3.1.0-a1', '3.1.0-a1'),
+ array('* @since 3.1.0-b3', '3.1.0-b3'),
+ array(' * @since 3.1.0-b3', '3.1.0-b3'),
+ array('* @since 3.1.0-RC2', '3.1.0-RC2'),
+ array(' * @since 3.1.0-a1', '3.1.0-a1'),
+ );
+ }
+
+ /**
+ * @dataProvider validate_since_data
+ */
+ public function test_validate_since($since, $expected)
+ {
+ $this->assertEquals($expected, $this->exporter->validate_since($since));
+ }
+
+ static public function validate_since_throws_data()
+ {
+ return array(
+ array('* @since 3.1.0-a1 '),
+ array('* @since 3.1.0-a1 bertie is cool'),
+ array('bertie* @since 3.1.0-a1'),
+ array('* @since 3.1-A2'),
+ array('* @since 3.1.0-rc1'),
+ );
+ }
+
+ /**
+ * @dataProvider validate_since_throws_data
+ * @expectedException LogicException
+ */
+ public function test_validate_since_throws($since)
+ {
+ $this->exporter->validate_since($since);
+ }
+
+ static public function validate_event_data()
+ {
+ return array(
+ array('test.event', '* @event test.event', 'test.event'),
+ array('test.event2', ' * @event test.event2', 'test.event2'),
+ array('test.event', ' * @event test.event', 'test.event'),
+ );
+ }
+
+ /**
+ * @dataProvider validate_event_data
+ */
+ public function test_validate_event($event_name, $event, $expected)
+ {
+ $this->assertEquals($expected, $this->exporter->validate_event($event_name, $event));
+ }
+
+ static public function validate_event_throws_data()
+ {
+ return array(
+ array('test.event', '* @event test.event bertie is cool', 2),
+ array('test.event', 'bertie* @event test.event', 2),
+ );
+ }
+
+ /**
+ * @dataProvider validate_event_throws_data
+ * @expectedException LogicException
+ */
+ public function test_validate_event_throws($event_name, $event, $exception_code)
+ {
+ $this->setExpectedException('LogicException', '', $exception_code);
+ $this->exporter->validate_event($event_name, $event);
+ }
+
+ static public function validate_vars_docblock_array_data()
+ {
+ return array(
+ array(array('abc', 'def'), array('abc', 'def')),
+ );
+ }
+
+ /**
+ * @dataProvider validate_vars_docblock_array_data
+ */
+ public function test_validate_vars_docblock_array($vars_array, $vars_docblock)
+ {
+ $this->assertNull($this->exporter->validate_vars_docblock_array($vars_array, $vars_docblock));
+ }
+
+ static public function validate_vars_docblock_array_throws_data()
+ {
+ return array(
+ array(array('abc', 'def'), array()),
+ array(array('abc', 'def'), array('abc')),
+ array(array('abc', 'defg'), array('abc', 'def')),
+ array(array('abc'), array('abc', 'def')),
+ array(array(), array('abc', 'def')),
+ );
+ }
+
+ /**
+ * @dataProvider validate_vars_docblock_array_throws_data
+ * @expectedException LogicException
+ */
+ public function test_validate_vars_docblock_array_throws($vars_array, $vars_docblock)
+ {
+ $this->exporter->validate_vars_docblock_array($vars_array, $vars_docblock);
+ }
+
+ static public function get_dispatch_name_data()
+ {
+ return array(
+ array("\$phpbb_dispatcher->dispatch('dispatch.one2');", 'dispatch.one2'),
+ array("\t\$phpbb_dispatcher->dispatch('dispatch.one2.thr_ee4');", 'dispatch.one2.thr_ee4'),
+ array("\$this->dispatcher->dispatch('dispatch.one2');", 'dispatch.one2'),
+ array("\$phpbb_dispatcher->dispatch('dis_patch.one');", 'dis_patch.one'),
+ );
+ }
+
+ /**
+ * @dataProvider get_dispatch_name_data
+ */
+ public function test_get_dispatch_name($event_line, $expected)
+ {
+ $this->exporter->set_content(array($event_line));
+ $this->assertEquals($expected, $this->exporter->get_event_name(0, true));
+ }
+
+ static public function get_dispatch_name_throws_data()
+ {
+ return array(
+ array("\$phpbb_dispatcher->dispatch();"),
+ array("\$phpbb_dispatcher->dispatch('');"),
+ array("\$phpbb_dispatcher->dispatch('dispatch.2one');"),
+ array("\$phpbb_dispatcher->dispatch('dispatch');"),
+ );
+ }
+
+ /**
+ * @dataProvider get_dispatch_name_throws_data
+ * @expectedException LogicException
+ */
+ public function test_get_dispatch_name_throws($event_line)
+ {
+ $this->exporter->set_content(array($event_line));
+ $this->exporter->get_event_name(0, true);
+ }
+
+ static public function get_trigger_event_name_data()
+ {
+ return array(
+ array("extract(\$phpbb_dispatcher->trigger_event('dispatch.one2', compact(\$vars)));", 'dispatch.one2'),
+ array("\textract(\$phpbb_dispatcher->trigger_event('dispatch.one2.thr_ee4', compact(\$vars)));", 'dispatch.one2.thr_ee4'),
+ array("extract(\$this->dispatcher->trigger_event('dispatch.one2', compact(\$vars)));", 'dispatch.one2'),
+ array("extract(\$phpbb_dispatcher->trigger_event('dis_patch.one', compact(\$vars)));", 'dis_patch.one'),
+ );
+ }
+
+ /**
+ * @dataProvider get_trigger_event_name_data
+ */
+ public function test_get_trigger_event_name($event_line, $expected)
+ {
+ $this->exporter->set_content(array($event_line));
+ $this->assertEquals($expected, $this->exporter->get_event_name(0, false));
+ }
+
+ static public function get_trigger_event_name_throws_data()
+ {
+ return array(
+ array("extract(\$phpbb_dispatcher->trigger_event());"),
+ array("extract(\$phpbb_dispatcher->trigger_event(''));"),
+ array("extract(\$phpbb_dispatcher->trigger_event('dispatch.2one'));"),
+ array("extract(\$phpbb_dispatcher->trigger_event('dispatch'));"),
+ array("extract(\$phpbb_dispatcher->trigger_event('dispatch.one', \$vars));"),
+ array("extract(\$phpbb_dispatcher->trigger_event('dispatch.one', compact(\$var)));"),
+ array("extract(\$phpbb_dispatcher->trigger_event('dispatch.one', compact(\$array)));"),
+ array("\$phpbb_dispatcher->trigger_event('dis_patch.one', compact(\$vars));", 'dis_patch.one'),
+ );
+ }
+
+ /**
+ * @dataProvider get_trigger_event_name_throws_data
+ * @expectedException LogicException
+ */
+ public function test_get_trigger_event_name_throws($event_line)
+ {
+ $this->exporter->set_content(array($event_line));
+ $this->exporter->get_event_name(0, false);
+ }
+
+ static public function get_vars_from_array_data()
+ {
+ return array(
+ array(
+ array(
+ '/**',
+ '*/',
+ '$vars = array(\'bertie\');',
+ '$phpbb_dispatcher->dispatch(\'test\');',
+ ),
+ 3,
+ array('bertie'),
+ ),
+ array(
+ array(
+ "\t/**",
+ "\t*/",
+ "\t\$vars = array('_Strange123', 'phpBB3_Test');",
+ "\t\$this->dispatcher->dispatch('test');",
+ ),
+ 3,
+ array('_Strange123', 'phpBB3_Test'),
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider get_vars_from_array_data
+ */
+ public function test_get_vars_from_array($lines, $event_line, $expected)
+ {
+ $this->exporter->set_current_event('', $event_line);
+ $this->exporter->set_content($lines);
+ $this->assertEquals($expected, $this->exporter->get_vars_from_array());
+ }
+
+ static public function get_vars_from_array_throws_data()
+ {
+ return array(
+ array(
+ array(
+ '/**',
+ '*/',
+ '$phpbb_dispatcher->trigger_event(\'test\', compact($vars));',
+ ),
+ 2,
+ 1,
+ ),
+ array(
+ array(
+ '/**',
+ '*/',
+ '$vars = $bertie;',
+ '$phpbb_dispatcher->trigger_event(\'test\', compact($vars));',
+ ),
+ 3,
+ 1,
+ ),
+ array(
+ array(
+ '/**',
+ '*/',
+ '$vars = array(\'$bertie\');',
+ '$phpbb_dispatcher->trigger_event(\'test\', compact($vars));',
+ ),
+ 3,
+ 1,
+ ),
+ array(
+ array(
+ '/**',
+ '*/',
+ '$vars = array();',
+ '$phpbb_dispatcher->trigger_event(\'test\', compact($vars));',
+ ),
+ 3,
+ 1,
+ ),
+ array(
+ array(
+ '/**',
+ '*/',
+ '$vars = array(\'t1\', \'t2\', \'t3\', \'t4\', \'t5\', \'t6\', \'t7\');',
+ '$phpbb_dispatcher->trigger_event(\'test\', compact($vars));',
+ ),
+ 3,
+ 2,
+ ),
+ array(
+ array(
+ '/**',
+ '*/',
+ '$vars = array(\'test2\', \'\');',
+ '$phpbb_dispatcher->trigger_event(\'test\', compact($vars));',
+ ),
+ 3,
+ 3,
+ ),
+ array(
+ array(
+ '/**',
+ '*/',
+ '$vars = array(\'bertie\'\');',
+ '$phpbb_dispatcher->trigger_event(\'test\', compact($vars));',
+ ),
+ 3,
+ 3,
+ ),
+ array(
+ array(
+ '/**',
+ '*/',
+ '$vars = array(\'bertie\',\'basically_valid\');',
+ '$phpbb_dispatcher->trigger_event(\'test\', compact($vars));',
+ ),
+ 3,
+ 3,
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider get_vars_from_array_throws_data
+ * @expectedException LogicException
+ */
+ public function test_get_vars_from_array_throws($lines, $event_line, $exception_code)
+ {
+ $this->setExpectedException('LogicException', '', $exception_code);
+
+ $this->exporter->set_current_event('', $event_line);
+ $this->exporter->set_content($lines);
+ $this->exporter->get_vars_from_array();
+ }
+
+ static public function get_vars_from_docblock_data()
+ {
+ return array(
+ array(
+ array(
+ '/**',
+ '* @var int name1 Description',
+ '* @var array name2 Description test',
+ '*/',
+ '$phpbb_dispatcher->dispatch(\'test\');',
+ ),
+ 4,
+ array('name1', 'name2'),
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider get_vars_from_docblock_data
+ */
+ public function test_get_vars_from_docblock($lines, $event_line, $expected)
+ {
+ $this->exporter->set_current_event('', $event_line);
+ $this->exporter->set_content($lines);
+ $this->assertEquals($expected, $this->exporter->get_vars_from_docblock());
+ }
+
+ static public function get_vars_from_docblock_throws_data()
+ {
+ return array(
+ array(
+ array(
+ '$vars = array();',
+ '$phpbb_dispatcher->dispatch(\'test\');',
+ ),
+ 1,
+ 2,
+ ),
+ array(
+ array(
+ '/**',
+ '* @var int name1',
+ '* @var array name2 Description test',
+ '*/',
+ '$phpbb_dispatcher->dispatch(\'test\');',
+ ),
+ 4,
+ 1,
+ ),
+ array(
+ array(
+ '/**',
+ '*/',
+ '$phpbb_dispatcher->dispatch(\'test\');',
+ ),
+ 2,
+ 3,
+ ),
+ array(
+ array(
+ '/**',
+ '* @var int name1 Description',
+ '* @var array $name2 Description',
+ '*/',
+ '$phpbb_dispatcher->dispatch(\'test\');',
+ ),
+ 4,
+ 4,
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider get_vars_from_docblock_throws_data
+ * @expectedException LogicException
+ */
+ public function test_get_vars_from_docblock_throws($lines, $event_line, $exception_code)
+ {
+ $this->setExpectedException('LogicException', '', $exception_code);
+
+ $this->exporter->set_current_event('', $event_line);
+ $this->exporter->set_content($lines);
+ $this->exporter->get_vars_from_docblock();
+ }
+
+ static public function find_since_data()
+ {
+ return array(
+ array(
+ array(
+ '/**',
+ '* @since 3.1.0-a1',
+ '*/',
+ '$phpbb_dispatcher->dispatch(\'test\');',
+ ),
+ 3,
+ 1,
+ ),
+ array(
+ array(
+ '* @since 3.1.0-a1',
+ '/**',
+ '* @since 3.1.0-a1',
+ '* @changed 3.1.0-a2',
+ '*/',
+ '$phpbb_dispatcher->dispatch(\'test\');',
+ ),
+ 5,
+ 2,
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider find_since_data
+ */
+ public function test_find_since($lines, $event_line, $expected)
+ {
+ $this->exporter->set_current_event('', $event_line);
+ $this->exporter->set_content($lines);
+ $this->assertEquals($expected, $this->exporter->find_since());
+ }
+
+ static public function find_since_throws_data()
+ {
+ return array(
+ array(
+ array(
+ '/**',
+ '* @since 3.1.0-a1',
+ '*/',
+ '/**',
+ '*/',
+ '$phpbb_dispatcher->dispatch(\'test\');',
+ ),
+ 5,
+ 1,
+ ),
+ array(
+ array(
+ '/**',
+ '* @changed 3.1.0-a1',
+ '* @changed 3.1.0-a2',
+ '* @changed 3.1.0-a3',
+ '*/',
+ '$phpbb_dispatcher->dispatch(\'test\');',
+ ),
+ 5,
+ 2,
+ ),
+ array(
+ array(
+ '/**',
+ '* @since 3.1.0-a2',
+ '* @var',
+ '*/',
+ '$phpbb_dispatcher->dispatch(\'test\');',
+ ),
+ 4,
+ 3,
+ ),
+ array(
+ array(
+ '/**',
+ '* @since 3.1.0-a2',
+ '* @event',
+ '*/',
+ '$phpbb_dispatcher->dispatch(\'test\');',
+ ),
+ 4,
+ 3,
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider find_since_throws_data
+ * @expectedException LogicException
+ */
+ public function test_find_since_throws($lines, $event_line, $exception_code)
+ {
+ $this->setExpectedException('LogicException', '', $exception_code);
+
+ $this->exporter->set_current_event('', $event_line);
+ $this->exporter->set_content($lines);
+ $this->exporter->find_since();
+ }
+
+ static public function find_description_data()
+ {
+ return array(
+ array(
+ array(
+ '/**',
+ '* Hello Bertie!',
+ '* @since 3.1.0-a1',
+ '*/',
+ '$phpbb_dispatcher->dispatch(\'test\');',
+ ),
+ 4,
+ 1,
+ ),
+ array(
+ array(
+ ' /**',
+ ' * Hello Bertie!',
+ ' *',
+ ' * @since 3.1.0-a1',
+ ' * @changed 3.1.0-a2',
+ ' */',
+ ' $phpbb_dispatcher->dispatch(\'test\');',
+ ),
+ 6,
+ 1,
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider find_description_data
+ */
+ public function test_find_description($lines, $event_line, $expected)
+ {
+ $this->exporter->set_current_event('', $event_line);
+ $this->exporter->set_content($lines);
+ $this->assertEquals($expected, $this->exporter->find_description());
+ }
+
+ static public function find_description_throws_data()
+ {
+ return array(
+ array(
+ array(
+ '$vars = array();',
+ '$phpbb_dispatcher->dispatch(\'test\');',
+ ),
+ 1,
+ 1,
+ ),
+ array(
+ array(
+ '/**',
+ '* @changed 3.1.0-a1',
+ '* @changed 3.1.0-a2',
+ '* @changed 3.1.0-a3',
+ '*/',
+ '$phpbb_dispatcher->dispatch(\'test\');',
+ ),
+ 5,
+ 2,
+ ),
+ array(
+ array(
+ '/**',
+ '*',
+ '* @since 3.1.0-a2',
+ '*/',
+ '$phpbb_dispatcher->dispatch(\'test\');',
+ ),
+ 4,
+ 2,
+ ),
+ array(
+ array(
+ '/**',
+ '* ',
+ '* @event',
+ '*/',
+ '$phpbb_dispatcher->dispatch(\'test\');',
+ ),
+ 4,
+ 2,
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider find_description_throws_data
+ * @expectedException LogicException
+ */
+ public function test_find_description_throws($lines, $event_line, $exception_code)
+ {
+ $this->setExpectedException('LogicException', '', $exception_code);
+
+ $this->exporter->set_current_event('', $event_line);
+ $this->exporter->set_content($lines);
+ $this->exporter->find_description();
+ }
+}
diff --git a/tests/extension/ext/barfoo/composer.json b/tests/extension/ext/barfoo/composer.json
new file mode 100644
index 0000000000..05bb099707
--- /dev/null
+++ b/tests/extension/ext/barfoo/composer.json
@@ -0,0 +1,24 @@
+{
+ "name": "vendor/barfoo",
+ "type": "phpbb-extension",
+ "description": "An example/sample extension to be used for testing purposes in phpBB Development.",
+ "version": "1.0.0",
+ "time": "2012-02-15 01:01:01",
+ "license": "GNU GPL v2",
+ "authors": [{
+ "name": "John Smith",
+ "username": "JohnSmith27",
+ "email": "email@phpbb.com",
+ "homepage": "http://phpbb.com",
+ "role": "N/A"
+ }],
+ "require": {
+ "php": ">=5.3"
+ },
+ "extra": {
+ "display-name": "phpBB BarFoo Extension",
+ "soft-require": {
+ "phpbb/phpbb": "3.1.*@dev"
+ }
+ }
+}
diff --git a/tests/extension/ext/barfoo/ext.php b/tests/extension/ext/barfoo/ext.php
new file mode 100644
index 0000000000..0de403424c
--- /dev/null
+++ b/tests/extension/ext/barfoo/ext.php
@@ -0,0 +1,7 @@
+<?php
+
+namespace vendor\barfoo;
+
+class ext extends \phpbb\extension\base
+{
+}
diff --git a/tests/extension/ext/vendor/moo/composer.json b/tests/extension/ext/vendor/moo/composer.json
new file mode 100644
index 0000000000..d49aab47cd
--- /dev/null
+++ b/tests/extension/ext/vendor/moo/composer.json
@@ -0,0 +1,24 @@
+{
+ "name": "vendor/moo",
+ "type": "phpbb-extension",
+ "description": "An example/sample extension to be used for testing purposes in phpBB Development.",
+ "version": "1.0.0",
+ "time": "2012-02-15 01:01:01",
+ "license": "GNU GPL v2",
+ "authors": [{
+ "name": "John Smith",
+ "username": "JohnSmith27",
+ "email": "email@phpbb.com",
+ "homepage": "http://phpbb.com",
+ "role": "N/A"
+ }],
+ "require": {
+ "php": ">=5.3"
+ },
+ "extra": {
+ "display-name": "phpBB Moo Extension",
+ "soft-require": {
+ "phpbb/phpbb": "3.1.*@dev"
+ }
+ }
+}
diff --git a/tests/extension/ext/vendor/moo/ext.php b/tests/extension/ext/vendor/moo/ext.php
new file mode 100644
index 0000000000..41ef570452
--- /dev/null
+++ b/tests/extension/ext/vendor/moo/ext.php
@@ -0,0 +1,15 @@
+<?php
+
+namespace vendor\moo;
+
+class ext extends \phpbb\extension\base
+{
+ static public $purged;
+
+ public function purge_step($old_state)
+ {
+ self::$purged = true;
+
+ return false;
+ }
+}
diff --git a/tests/extension/ext/vendor/moo/feature_class.php b/tests/extension/ext/vendor/moo/feature_class.php
new file mode 100644
index 0000000000..cb8bb3da56
--- /dev/null
+++ b/tests/extension/ext/vendor/moo/feature_class.php
@@ -0,0 +1,7 @@
+<?php
+
+namespace vendor\moo;
+
+class feature_class
+{
+}
diff --git a/tests/extension/ext/vendor2/bar/acp/a_info.php b/tests/extension/ext/vendor2/bar/acp/a_info.php
new file mode 100644
index 0000000000..8132df587f
--- /dev/null
+++ b/tests/extension/ext/vendor2/bar/acp/a_info.php
@@ -0,0 +1,18 @@
+<?php
+
+namespace vendor2\bar\acp;
+
+class a_info
+{
+ public function module()
+ {
+ return array(
+ 'filename' => 'vendor2\\bar\\acp\\a_module',
+ 'title' => 'Bar',
+ 'version' => '3.1.0-dev',
+ 'modes' => array(
+ 'config' => array('title' => 'Config', 'auth' => '', 'cat' => array('ACP_MODS')),
+ ),
+ );
+ }
+}
diff --git a/tests/extension/ext/vendor2/bar/acp/a_module.php b/tests/extension/ext/vendor2/bar/acp/a_module.php
new file mode 100644
index 0000000000..3a3d105790
--- /dev/null
+++ b/tests/extension/ext/vendor2/bar/acp/a_module.php
@@ -0,0 +1,7 @@
+<?php
+
+namespace vendor2\bar\acp;
+
+class a_module
+{
+}
diff --git a/tests/extension/ext/vendor2/bar/composer.json b/tests/extension/ext/vendor2/bar/composer.json
new file mode 100644
index 0000000000..9d2ed86a0c
--- /dev/null
+++ b/tests/extension/ext/vendor2/bar/composer.json
@@ -0,0 +1,23 @@
+{
+ "name": "vendor2/bar",
+ "type": "phpbb-extension",
+ "description": "An example/sample extension to be used for testing purposes in phpBB Development.",
+ "version": "1.0.0",
+ "time": "2012-02-15 01:01:01",
+ "license": "GPL-2.0",
+ "authors": [{
+ "name": "John Smith",
+ "email": "email@phpbb.com",
+ "homepage": "http://phpbb.com",
+ "role": "N/A"
+ }],
+ "require": {
+ "php": ">=5.3"
+ },
+ "extra": {
+ "display-name": "phpBB Bar Extension",
+ "soft-require": {
+ "phpbb/phpbb": "3.1.*@dev"
+ }
+ }
+}
diff --git a/tests/extension/ext/vendor2/bar/ext.php b/tests/extension/ext/vendor2/bar/ext.php
new file mode 100644
index 0000000000..f94ab9ad81
--- /dev/null
+++ b/tests/extension/ext/vendor2/bar/ext.php
@@ -0,0 +1,26 @@
+<?php
+
+namespace vendor2\bar;
+
+class ext extends \phpbb\extension\base
+{
+ static public $state;
+
+ public function enable_step($old_state)
+ {
+ // run 4 steps, then quit
+ if ($old_state === 4)
+ {
+ return false;
+ }
+
+ if ($old_state === false)
+ {
+ $old_state = 0;
+ }
+
+ self::$state = ++$old_state;
+
+ return self::$state;
+ }
+}
diff --git a/tests/extension/ext/vendor2/bar/migrations/migration.php b/tests/extension/ext/vendor2/bar/migrations/migration.php
new file mode 100644
index 0000000000..71caa34fd9
--- /dev/null
+++ b/tests/extension/ext/vendor2/bar/migrations/migration.php
@@ -0,0 +1,18 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace vendor2\bar\migrations;
+
+class migration extends \phpbb\db\migration\migration
+{
+}
diff --git a/tests/extension/ext/vendor2/foo/a_class.php b/tests/extension/ext/vendor2/foo/a_class.php
new file mode 100644
index 0000000000..06278c0e0c
--- /dev/null
+++ b/tests/extension/ext/vendor2/foo/a_class.php
@@ -0,0 +1,7 @@
+<?php
+
+namespace vendor2\foo;
+
+class a_class
+{
+}
diff --git a/tests/extension/ext/vendor2/foo/acp/a_info.php b/tests/extension/ext/vendor2/foo/acp/a_info.php
new file mode 100644
index 0000000000..e1eaa340b7
--- /dev/null
+++ b/tests/extension/ext/vendor2/foo/acp/a_info.php
@@ -0,0 +1,18 @@
+<?php
+
+namespace vendor2\foo\acp;
+
+class a_info
+{
+ public function module()
+ {
+ return array(
+ 'filename' => 'vendor2\\foo\\acp\\a_module',
+ 'title' => 'Foobar',
+ 'version' => '3.1.0-dev',
+ 'modes' => array(
+ 'config' => array('title' => 'Config', 'auth' => 'ext_vendor2/foo', 'cat' => array('ACP_MODS')),
+ ),
+ );
+ }
+}
diff --git a/tests/extension/ext/vendor2/foo/acp/a_module.php b/tests/extension/ext/vendor2/foo/acp/a_module.php
new file mode 100644
index 0000000000..78d91af2fe
--- /dev/null
+++ b/tests/extension/ext/vendor2/foo/acp/a_module.php
@@ -0,0 +1,7 @@
+<?php
+
+namespace vendor2\foo\acp;
+
+class a_module
+{
+}
diff --git a/tests/extension/ext/vendor2/foo/acp/fail_info.php b/tests/extension/ext/vendor2/foo/acp/fail_info.php
new file mode 100644
index 0000000000..d9b4353957
--- /dev/null
+++ b/tests/extension/ext/vendor2/foo/acp/fail_info.php
@@ -0,0 +1,22 @@
+<?php
+
+namespace vendor2\foo\acp;
+
+/*
+* Due to the mismatch between the class name and the file name, this module
+* file shouldn't be found by the extension finder
+*/
+class foo_info
+{
+ public function module()
+ {
+ return array(
+ 'filename' => 'vendor2\foo\acp\fail_module',
+ 'title' => 'Foobar',
+ 'version' => '3.1.0-dev',
+ 'modes' => array(
+ 'config' => array('title' => 'Config', 'auth' => '', 'cat' => array('ACP_MODS')),
+ ),
+ );
+ }
+}
diff --git a/tests/extension/ext/vendor2/foo/acp/fail_module.php b/tests/extension/ext/vendor2/foo/acp/fail_module.php
new file mode 100644
index 0000000000..c8a5eae745
--- /dev/null
+++ b/tests/extension/ext/vendor2/foo/acp/fail_module.php
@@ -0,0 +1,11 @@
+<?php
+
+namespace vendor2\foo\acp;
+
+/*
+* Due to the mismatch between the class name and the file name of the module
+* info file, this module's info file shouldn't be found
+*/
+class fail_module
+{
+}
diff --git a/tests/extension/ext/vendor2/foo/b_class.php b/tests/extension/ext/vendor2/foo/b_class.php
new file mode 100644
index 0000000000..3d0f193908
--- /dev/null
+++ b/tests/extension/ext/vendor2/foo/b_class.php
@@ -0,0 +1,7 @@
+<?php
+
+namespace vendor2\foo;
+
+class b_class
+{
+}
diff --git a/tests/extension/ext/vendor2/foo/composer.json b/tests/extension/ext/vendor2/foo/composer.json
new file mode 100644
index 0000000000..efcdfc338f
--- /dev/null
+++ b/tests/extension/ext/vendor2/foo/composer.json
@@ -0,0 +1,23 @@
+{
+ "name": "vendor2/foo",
+ "type": "phpbb-extension",
+ "description": "An example/sample extension to be used for testing purposes in phpBB Development.",
+ "version": "1.0.0",
+ "time": "2012-02-15 01:01:01",
+ "license": "GPL-2.0",
+ "authors": [{
+ "name": "John Smith",
+ "email": "email@phpbb.com",
+ "homepage": "http://phpbb.com",
+ "role": "N/A"
+ }],
+ "require": {
+ "php": ">=5.3"
+ },
+ "extra": {
+ "display-name": "phpBB Foo Extension",
+ "soft-require": {
+ "phpbb/phpbb": "3.1.*@dev"
+ }
+ }
+}
diff --git a/tests/extension/ext/vendor2/foo/ext.php b/tests/extension/ext/vendor2/foo/ext.php
new file mode 100644
index 0000000000..15480fe92a
--- /dev/null
+++ b/tests/extension/ext/vendor2/foo/ext.php
@@ -0,0 +1,15 @@
+<?php
+
+namespace vendor2\foo;
+
+class ext extends \phpbb\extension\base
+{
+ static public $disabled;
+
+ public function disable_step($old_state)
+ {
+ self::$disabled = true;
+
+ return false;
+ }
+}
diff --git a/tests/extension/ext/vendor2/foo/mcp/a_info.php b/tests/extension/ext/vendor2/foo/mcp/a_info.php
new file mode 100644
index 0000000000..b5599fde65
--- /dev/null
+++ b/tests/extension/ext/vendor2/foo/mcp/a_info.php
@@ -0,0 +1,18 @@
+<?php
+
+namespace vendor2\foo\mcp;
+
+class a_info
+{
+ public function module()
+ {
+ return array(
+ 'filename' => 'vendor2\\foo\\mcp\\a_module',
+ 'title' => 'Foobar',
+ 'version' => '3.1.0-dev',
+ 'modes' => array(
+ 'config' => array('title' => 'Config', 'auth' => '', 'cat' => array('MCP_MAIN')),
+ ),
+ );
+ }
+}
diff --git a/tests/extension/ext/vendor2/foo/mcp/a_module.php b/tests/extension/ext/vendor2/foo/mcp/a_module.php
new file mode 100644
index 0000000000..fe29783827
--- /dev/null
+++ b/tests/extension/ext/vendor2/foo/mcp/a_module.php
@@ -0,0 +1,7 @@
+<?php
+
+namespace vendor2\foo\mcp;
+
+class a_module
+{
+}
diff --git a/tests/extension/ext/vendor2/foo/sub/type/alternative.php b/tests/extension/ext/vendor2/foo/sub/type/alternative.php
new file mode 100644
index 0000000000..1eaf794609
--- /dev/null
+++ b/tests/extension/ext/vendor2/foo/sub/type/alternative.php
@@ -0,0 +1,7 @@
+<?php
+
+namespace foo\sub\type;
+
+class alternative
+{
+}
diff --git a/tests/extension/ext/vendor2/foo/type/alternative.php b/tests/extension/ext/vendor2/foo/type/alternative.php
new file mode 100644
index 0000000000..8f753491ef
--- /dev/null
+++ b/tests/extension/ext/vendor2/foo/type/alternative.php
@@ -0,0 +1,7 @@
+<?php
+
+namespace foo\type;
+
+class alternative
+{
+}
diff --git a/tests/extension/ext/vendor2/foo/type/dummy/empty.txt b/tests/extension/ext/vendor2/foo/type/dummy/empty.txt
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/extension/ext/vendor2/foo/type/dummy/empty.txt
diff --git a/tests/extension/ext/vendor2/foo/typewrong/error.php b/tests/extension/ext/vendor2/foo/typewrong/error.php
new file mode 100644
index 0000000000..5020926043
--- /dev/null
+++ b/tests/extension/ext/vendor2/foo/typewrong/error.php
@@ -0,0 +1,7 @@
+<?php
+
+namespace foo\typewrong;
+
+class error
+{
+}
diff --git a/tests/extension/ext/vendor3/bar/ext.php b/tests/extension/ext/vendor3/bar/ext.php
new file mode 100644
index 0000000000..37a5e92059
--- /dev/null
+++ b/tests/extension/ext/vendor3/bar/ext.php
@@ -0,0 +1,26 @@
+<?php
+
+namespace vendor3\bar;
+
+class ext extends \phpbb\extension\base
+{
+ static public $state;
+
+ public function enable_step($old_state)
+ {
+ // run 4 steps, then quit
+ if ($old_state === 4)
+ {
+ return false;
+ }
+
+ if ($old_state === false)
+ {
+ $old_state = 0;
+ }
+
+ self::$state = ++$old_state;
+
+ return self::$state;
+ }
+}
diff --git a/tests/extension/ext/vendor3/bar/my/hidden_class.php b/tests/extension/ext/vendor3/bar/my/hidden_class.php
new file mode 100644
index 0000000000..38eb59aadf
--- /dev/null
+++ b/tests/extension/ext/vendor3/bar/my/hidden_class.php
@@ -0,0 +1,7 @@
+<?php
+
+namespace vendor3\bar\my;
+
+class hidden_class
+{
+}
diff --git a/tests/extension/ext/vendor3/bar/styles/prosilver/template/foobar_body.html b/tests/extension/ext/vendor3/bar/styles/prosilver/template/foobar_body.html
new file mode 100644
index 0000000000..00c2a84a18
--- /dev/null
+++ b/tests/extension/ext/vendor3/bar/styles/prosilver/template/foobar_body.html
@@ -0,0 +1 @@
+bertie rules!
diff --git a/tests/extension/ext/vendor3/foo/composer.json b/tests/extension/ext/vendor3/foo/composer.json
new file mode 100644
index 0000000000..b4b3e6f32f
--- /dev/null
+++ b/tests/extension/ext/vendor3/foo/composer.json
@@ -0,0 +1,23 @@
+{
+ "name": "vendor3/foo",
+ "type": "phpbb-extension",
+ "description": "An example/sample extension to be used for testing purposes in phpBB Development.",
+ "version": "1.0.0",
+ "time": "2012-02-15 01:01:01",
+ "license": "GPL-2.0",
+ "authors": [{
+ "name": "John Smith",
+ "email": "email@phpbb.com",
+ "homepage": "http://phpbb.com",
+ "role": "N/A"
+ }],
+ "require": {
+ "php": ">=5.3"
+ },
+ "extra": {
+ "display-name": "phpBB Bar Extension",
+ "soft-require": {
+ "phpbb/phpbb": "3.1.*@dev"
+ }
+ }
+}
diff --git a/tests/extension/ext/vendor3/foo/ext.php b/tests/extension/ext/vendor3/foo/ext.php
new file mode 100644
index 0000000000..b52649d921
--- /dev/null
+++ b/tests/extension/ext/vendor3/foo/ext.php
@@ -0,0 +1,20 @@
+<?php
+
+namespace vendor3\foo;
+
+class ext extends \phpbb\extension\base
+{
+ static public $enabled;
+
+ public function enable_step($old_state)
+ {
+ self::$enabled = true;
+
+ return self::$enabled;
+ }
+
+ public function is_enableable()
+ {
+ return false;
+ }
+}
diff --git a/tests/extension/ext/vendor4/bar/composer.json b/tests/extension/ext/vendor4/bar/composer.json
new file mode 100644
index 0000000000..1a2fddc3f4
--- /dev/null
+++ b/tests/extension/ext/vendor4/bar/composer.json
@@ -0,0 +1,23 @@
+{
+ "name": "vendor4/bar",
+ "type": "phpbb-extension",
+ "description": "An example/sample extension to be used for testing purposes in phpBB Development.",
+ "version": "1.0.0",
+ "time": "2012-02-15 01:01:01",
+ "license": "GPL-2.0",
+ "authors": [{
+ "name": "John Smith",
+ "email": "email@phpbb.com",
+ "homepage": "http://phpbb.com",
+ "role": "N/A"
+ }],
+ "require": {
+ "php": ">=5.3"
+ },
+ "extra": {
+ "display-name": "phpBB Bar Extension",
+ "soft-require": {
+ "phpbb/phpbb": "3.1.*@dev"
+ }
+ }
+}
diff --git a/tests/extension/ext/vendor4/bar/styles/all/template/foobar_body.html b/tests/extension/ext/vendor4/bar/styles/all/template/foobar_body.html
new file mode 100644
index 0000000000..c8f8cf957e
--- /dev/null
+++ b/tests/extension/ext/vendor4/bar/styles/all/template/foobar_body.html
@@ -0,0 +1 @@
+All folder
diff --git a/tests/extension/extension_base_test.php b/tests/extension/extension_base_test.php
new file mode 100644
index 0000000000..eee38186db
--- /dev/null
+++ b/tests/extension/extension_base_test.php
@@ -0,0 +1,79 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
+
+class phpbb_extension_extension_base_test extends phpbb_test_case
+{
+ protected static $reflection_method_get_migration_file_list;
+
+ /** @var phpbb_mock_extension_manager */
+ protected $extension_manager;
+
+ public static function setUpBeforeClass()
+ {
+ parent::setUpBeforeClass();
+
+ $reflection_class = new ReflectionClass('\phpbb\extension\base');
+ self::$reflection_method_get_migration_file_list = $reflection_class->getMethod('get_migration_file_list');
+ self::$reflection_method_get_migration_file_list->setAccessible(true);
+ }
+
+ public function setUp()
+ {
+ $container = new phpbb_mock_container_builder();
+ $migrator = new phpbb_mock_migrator();
+ $container->set('migrator', $migrator);
+
+ $this->extension_manager = new phpbb_mock_extension_manager(
+ dirname(__FILE__) . '/',
+ array(
+ 'vendor2/foo' => array(
+ 'ext_name' => 'vendor2/foo',
+ 'ext_active' => '1',
+ 'ext_path' => 'ext/vendor2/foo/',
+ ),
+ 'vendor3/bar' => array(
+ 'ext_name' => 'vendor3/bar',
+ 'ext_active' => '1',
+ 'ext_path' => 'ext/vendor3/bar/',
+ ),
+ 'vendor2/bar' => array(
+ 'ext_name' => 'vendor2/bar',
+ 'ext_active' => '1',
+ 'ext_path' => 'ext/vendor2/bar/',
+ ),
+ ),
+ $container);
+ }
+
+ public function data_test_suffix_get_classes()
+ {
+ return array(
+ array(
+ 'vendor2/bar',
+ array(
+ '\vendor2\bar\migrations\migration',
+ ),
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider data_test_suffix_get_classes
+ */
+ public function test_suffix_get_classes($extension_name, $expected)
+ {
+ $extension = $this->extension_manager->get_extension($extension_name);
+ $this->assertEquals($expected, self::$reflection_method_get_migration_file_list->invoke($extension));
+ }
+}
diff --git a/tests/extension/finder_test.php b/tests/extension/finder_test.php
new file mode 100644
index 0000000000..2116cc057b
--- /dev/null
+++ b/tests/extension/finder_test.php
@@ -0,0 +1,309 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
+
+class phpbb_extension_finder_test extends phpbb_test_case
+{
+ /** @var \phpbb\extension\manager */
+ protected $extension_manager;
+ /** @var \phpbb\finder */
+ protected $finder;
+
+ public function setUp()
+ {
+ $this->extension_manager = new phpbb_mock_extension_manager(
+ dirname(__FILE__) . '/',
+ array(
+ 'vendor2/foo' => array(
+ 'ext_name' => 'vendor2/foo',
+ 'ext_active' => '1',
+ 'ext_path' => 'ext/vendor2/foo/',
+ ),
+ 'vendor3/bar' => array(
+ 'ext_name' => 'vendor3/bar',
+ 'ext_active' => '1',
+ 'ext_path' => 'ext/vendor3/bar/',
+ ),
+ ));
+
+ $this->finder = $this->extension_manager->get_finder();
+ }
+
+ public function test_suffix_get_classes()
+ {
+ $classes = $this->finder
+ ->core_path('phpbb/default/')
+ ->extension_suffix('_class')
+ ->get_classes();
+
+ sort($classes);
+ $this->assertEquals(
+ array(
+ '\phpbb\default\implementation',
+ '\vendor2\foo\a_class',
+ '\vendor2\foo\b_class',
+ '\vendor3\bar\my\hidden_class',
+ ),
+ $classes
+ );
+ }
+
+ public function set_extensions_data()
+ {
+ return array(
+ array(
+ array(),
+ array('\phpbb\default\implementation'),
+ ),
+ array(
+ array('vendor3/bar'),
+ array(
+ '\phpbb\default\implementation',
+ '\vendor3\bar\my\hidden_class',
+ ),
+ ),
+ array(
+ array('vendor2/foo', 'vendor3/bar'),
+ array(
+ '\phpbb\default\implementation',
+ '\vendor2\foo\a_class',
+ '\vendor2\foo\b_class',
+ '\vendor3\bar\my\hidden_class',
+ ),
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider set_extensions_data
+ */
+ public function test_set_extensions($extensions, $expected)
+ {
+ $classes = $this->finder
+ ->set_extensions($extensions)
+ ->core_path('phpbb/default/')
+ ->extension_suffix('_class')
+ ->get_classes();
+
+ sort($classes);
+ $this->assertEquals($expected, $classes);
+ }
+
+ public function test_get_directories()
+ {
+ $dirs = $this->finder
+ ->directory('/type')
+ ->get_directories();
+
+ sort($dirs);
+ $this->assertEquals(array(
+ dirname(__FILE__) . '/ext/vendor2/foo/type/',
+ ), $dirs);
+ }
+
+ public function test_prefix_get_directories()
+ {
+ $dirs = $this->finder
+ ->prefix('ty')
+ ->get_directories();
+
+ sort($dirs);
+ $this->assertEquals(array(
+ dirname(__FILE__) . '/ext/vendor2/foo/sub/type/',
+ dirname(__FILE__) . '/ext/vendor2/foo/type/',
+ dirname(__FILE__) . '/ext/vendor2/foo/typewrong/',
+ ), $dirs);
+ }
+
+ public function test_prefix_get_classes()
+ {
+ $classes = $this->finder
+ ->core_path('phpbb/default/')
+ ->extension_prefix('hidden_')
+ ->get_classes();
+
+ sort($classes);
+ $this->assertEquals(
+ array(
+ '\phpbb\default\implementation',
+ '\vendor3\bar\my\hidden_class',
+ ),
+ $classes
+ );
+ }
+
+ public function test_directory_get_classes()
+ {
+ $classes = $this->finder
+ ->core_path('phpbb/default/')
+ ->extension_directory('type')
+ ->get_classes();
+
+ sort($classes);
+ $this->assertEquals(
+ array(
+ '\phpbb\default\implementation',
+ '\vendor2\foo\sub\type\alternative',
+ '\vendor2\foo\type\alternative',
+ ),
+ $classes
+ );
+ }
+
+ public function test_absolute_directory_get_classes()
+ {
+ $classes = $this->finder
+ ->directory('/type/')
+ ->get_classes();
+
+ sort($classes);
+ $this->assertEquals(
+ array(
+ '\vendor2\foo\type\alternative',
+ ),
+ $classes
+ );
+ }
+
+ public function test_non_absolute_directory_get_classes()
+ {
+ $classes = $this->finder
+ ->directory('type/')
+ ->get_classes();
+
+ sort($classes);
+ $this->assertEquals(
+ array(
+ '\vendor2\foo\sub\type\alternative',
+ '\vendor2\foo\type\alternative',
+ ),
+ $classes
+ );
+ }
+
+ public function test_sub_directory_get_classes()
+ {
+ $classes = $this->finder
+ ->directory('/sub/type')
+ ->get_classes();
+
+ sort($classes);
+ $this->assertEquals(
+ array(
+ '\vendor2\foo\sub\type\alternative',
+ ),
+ $classes
+ );
+ }
+
+ public function test_uncleansub_directory_get_classes()
+ {
+ $classes = $this->finder
+ ->directory('/sub/../sub/type')
+ ->get_classes();
+
+ sort($classes);
+ $this->assertEquals(
+ array(
+ '\vendor2\foo\sub\type\alternative',
+ ),
+ $classes
+ );
+ }
+
+ public function test_find_from_extension()
+ {
+ $files = $this->finder
+ ->extension_directory('/type')
+ ->find_from_extension('vendor2/foo', dirname(__FILE__) . '/ext/vendor2/foo/');
+ $classes = $this->finder->get_classes_from_files($files);
+
+ sort($classes);
+ $this->assertEquals(
+ array(
+ '\vendor2\foo\type\alternative',
+ '\vendor2\foo\type\dummy\empty',
+ ),
+ $classes
+ );
+ }
+
+ /**
+ * These do not work because of changes with PHPBB3-11386
+ * They do not seem neccessary to me, so I am commenting them out for now
+ public function test_get_classes_create_cache()
+ {
+ $cache = new phpbb_mock_cache;
+ $finder = new \phpbb\finder(new \phpbb\filesystem(), dirname(__FILE__) . '/', $cache, 'php', '_custom_cache_name');
+ $finder->set_extensions(array_keys($this->extension_manager->all_enabled()));
+ $files = $finder->suffix('_class.php')->get_files();
+
+ $expected_files = array(
+ 'ext/bar/my/hidden_class.php' => 'bar',
+ 'ext/foo/a_class.php' => 'foo',
+ 'ext/foo/b_class.php' => 'foo',
+ );
+
+ $query = array(
+ 'core_path' => false,
+ 'core_suffix' => '_class.php',
+ 'core_prefix' => false,
+ 'core_directory' => false,
+ 'extension_suffix' => '_class.php',
+ 'extension_prefix' => false,
+ 'extension_directory' => false,
+ 'is_dir' => false,
+ );
+
+ $cache->checkAssociativeVar($this, '_custom_cache_name', array(
+ md5(serialize($query)) => $expected_files,
+ ), false);
+ }
+
+ public function test_cached_get_files()
+ {
+ $query = array(
+ 'core_path' => 'phpbb/foo',
+ 'core_suffix' => false,
+ 'core_prefix' => false,
+ 'core_directory' => 'bar',
+ 'extension_suffix' => false,
+ 'extension_prefix' => false,
+ 'extension_directory' => false,
+ 'is_dir' => false,
+ );
+
+ $finder = new \phpbb\finder(
+ new \phpbb\filesystem(),
+ dirname(__FILE__) . '/',
+ new phpbb_mock_cache(array(
+ '_ext_finder' => array(
+ md5(serialize($query)) => array('file_name' => 'extension'),
+ ),
+ ))
+ );
+ $finder->set_extensions(array_keys($this->extension_manager->all_enabled()));
+
+ $classes = $finder
+ ->core_path($query['core_path'])
+ ->core_directory($query['core_directory'])
+ ->get_files();
+
+ sort($classes);
+ $this->assertEquals(
+ array(dirname(__FILE__) . '/file_name'),
+ $classes
+ );
+ }
+ */
+}
diff --git a/tests/extension/fixtures/extensions.xml b/tests/extension/fixtures/extensions.xml
new file mode 100644
index 0000000000..6846162f0f
--- /dev/null
+++ b/tests/extension/fixtures/extensions.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<dataset>
+ <table name="phpbb_ext">
+ <column>ext_name</column>
+ <column>ext_active</column>
+ <column>ext_state</column>
+ <row>
+ <value>vendor2/foo</value>
+ <value>1</value>
+ <value></value>
+ </row>
+ <row>
+ <value>vendor/moo</value>
+ <value>0</value>
+ <value></value>
+ </row>
+ </table>
+</dataset>
diff --git a/tests/extension/includes/acp/acp_foobar.php b/tests/extension/includes/acp/acp_foobar.php
new file mode 100644
index 0000000000..c4591cae07
--- /dev/null
+++ b/tests/extension/includes/acp/acp_foobar.php
@@ -0,0 +1,29 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+/**
+* @ignore
+*/
+if (!defined('IN_PHPBB'))
+{
+ exit;
+}
+
+class acp_foobar
+{
+ var $u_action;
+
+ function main($id, $mode)
+ {
+ }
+}
diff --git a/tests/extension/includes/acp/info/acp_foobar.php b/tests/extension/includes/acp/info/acp_foobar.php
new file mode 100644
index 0000000000..870225ba4f
--- /dev/null
+++ b/tests/extension/includes/acp/info/acp_foobar.php
@@ -0,0 +1,27 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+class acp_foobar_info
+{
+ function module()
+ {
+ return array(
+ 'filename' => 'acp_foobar',
+ 'title' => 'ACP Foobar',
+ 'version' => '3.1.0-dev',
+ 'modes' => array(
+ 'test' => array('title' => 'Test', 'auth' => '', 'cat' => array('ACP_GENERAL')),
+ ),
+ );
+ }
+}
diff --git a/tests/extension/manager_test.php b/tests/extension/manager_test.php
new file mode 100644
index 0000000000..0eeb060936
--- /dev/null
+++ b/tests/extension/manager_test.php
@@ -0,0 +1,187 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+require_once dirname(__FILE__) . '/ext/vendor2/bar/ext.php';
+require_once dirname(__FILE__) . '/ext/vendor2/foo/ext.php';
+require_once dirname(__FILE__) . '/ext/vendor3/foo/ext.php';
+require_once dirname(__FILE__) . '/ext/vendor/moo/ext.php';
+
+class phpbb_extension_manager_test extends phpbb_database_test_case
+{
+ protected $extension_manager;
+ protected $class_loader;
+
+ public function getDataSet()
+ {
+ return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/extensions.xml');
+ }
+
+ protected function setUp()
+ {
+ parent::setUp();
+
+ $this->extension_manager = $this->create_extension_manager();
+ }
+
+ public function test_all_available()
+ {
+ // barfoo and vendor3/bar should not listed due to missing composer.json. barfoo also has incorrect dir structure.
+ $this->assertEquals(array('vendor/moo', 'vendor2/bar', 'vendor2/foo', 'vendor3/foo', 'vendor4/bar'), array_keys($this->extension_manager->all_available()));
+ }
+
+ public function test_all_enabled()
+ {
+ $this->assertEquals(array('vendor2/foo'), array_keys($this->extension_manager->all_enabled()));
+ }
+
+ public function test_all_configured()
+ {
+ $this->assertEquals(array('vendor/moo', 'vendor2/foo'), array_keys($this->extension_manager->all_configured()));
+ }
+
+ public function test_is_enabled()
+ {
+ $this->assertSame(true, $this->extension_manager->is_enabled('vendor2/foo'));
+ $this->assertSame(false, $this->extension_manager->is_enabled('vendor/moo'));
+ $this->assertSame(false, $this->extension_manager->is_enabled('vendor2/bar'));
+ $this->assertSame(false, $this->extension_manager->is_enabled('bertie/worlddominationplan'));
+ }
+
+ public function test_is_disabled()
+ {
+ $this->assertSame(false, $this->extension_manager->is_disabled('vendor2/foo'));
+ $this->assertSame(true, $this->extension_manager->is_disabled('vendor/moo'));
+ $this->assertSame(false, $this->extension_manager->is_disabled('vendor2/bar'));
+ $this->assertSame(false, $this->extension_manager->is_disabled('bertie/worlddominationplan'));
+ }
+
+ public function test_is_purged()
+ {
+ $this->assertSame(false, $this->extension_manager->is_purged('vendor2/foo'));
+ $this->assertSame(false, $this->extension_manager->is_purged('vendor/moo'));
+ $this->assertSame(true, $this->extension_manager->is_purged('vendor2/bar'));
+ $this->assertSame(false, $this->extension_manager->is_purged('bertie/worlddominationplan'));
+ }
+
+ public function test_is_configured()
+ {
+ $this->assertSame(true, $this->extension_manager->is_configured('vendor2/foo'));
+ $this->assertSame(true, $this->extension_manager->is_configured('vendor/moo'));
+ $this->assertSame(false, $this->extension_manager->is_configured('vendor2/bar'));
+ $this->assertSame(false, $this->extension_manager->is_configured('bertie/worlddominationplan'));
+ }
+
+ public function test_is_available()
+ {
+ $this->assertSame(true, $this->extension_manager->is_available('vendor2/foo'));
+ $this->assertSame(true, $this->extension_manager->is_available('vendor/moo'));
+ $this->assertSame(true, $this->extension_manager->is_available('vendor2/bar'));
+ $this->assertSame(false, $this->extension_manager->is_available('bertie/worlddominationplan'));
+ }
+
+ public function test_enable()
+ {
+ vendor2\bar\ext::$state = 0;
+
+ $this->assertEquals(array('vendor2/foo'), array_keys($this->extension_manager->all_enabled()));
+ $this->extension_manager->enable('vendor2/bar');
+ $this->assertEquals(array('vendor2/bar', 'vendor2/foo'), array_keys($this->extension_manager->all_enabled()));
+ $this->assertEquals(array('vendor/moo', 'vendor2/bar', 'vendor2/foo'), array_keys($this->extension_manager->all_configured()));
+
+ $this->assertEquals(4, vendor2\bar\ext::$state);
+ }
+
+ public function test_enable_not_enableable()
+ {
+ vendor3\foo\ext::$enabled = false;
+
+ $this->assertEquals(array('vendor2/foo'), array_keys($this->extension_manager->all_enabled()));
+ $this->extension_manager->enable('vendor3/foo');
+ $this->assertEquals(array('vendor2/foo'), array_keys($this->extension_manager->all_enabled()));
+ $this->assertEquals(array('vendor/moo', 'vendor2/foo'), array_keys($this->extension_manager->all_configured()));
+
+ $this->assertSame(false, vendor3\foo\ext::$enabled);
+ }
+
+ public function test_disable()
+ {
+ vendor2\foo\ext::$disabled = false;
+
+ $this->assertEquals(array('vendor2/foo'), array_keys($this->extension_manager->all_enabled()));
+ $this->extension_manager->disable('vendor2/foo');
+ $this->assertEquals(array(), array_keys($this->extension_manager->all_enabled()));
+ $this->assertEquals(array('vendor/moo', 'vendor2/foo'), array_keys($this->extension_manager->all_configured()));
+
+ $this->assertTrue(vendor2\foo\ext::$disabled);
+ }
+
+ public function test_purge()
+ {
+ vendor\moo\ext::$purged = false;
+
+ $this->assertEquals(array('vendor2/foo'), array_keys($this->extension_manager->all_enabled()));
+ $this->assertEquals(array('vendor/moo', 'vendor2/foo'), array_keys($this->extension_manager->all_configured()));
+ $this->extension_manager->purge('vendor/moo');
+ $this->assertEquals(array('vendor2/foo'), array_keys($this->extension_manager->all_enabled()));
+ $this->assertEquals(array('vendor2/foo'), array_keys($this->extension_manager->all_configured()));
+
+ $this->assertTrue(vendor\moo\ext::$purged);
+ }
+
+ public function test_enabled_no_cache()
+ {
+ $extension_manager = $this->create_extension_manager(false);
+
+ $this->assertEquals(array('vendor2/foo'), array_keys($extension_manager->all_enabled()));
+ }
+
+ protected function create_extension_manager($with_cache = true)
+ {
+
+ $config = new \phpbb\config\config(array('version' => PHPBB_VERSION));
+ $db = $this->new_dbal();
+ $db_tools = new \phpbb\db\tools($db);
+ $phpbb_root_path = __DIR__ . './../../phpBB/';
+ $php_ext = 'php';
+ $table_prefix = 'phpbb_';
+ $user = new \phpbb\user('\phpbb\user');
+
+ $container = new phpbb_mock_container_builder();
+
+ $migrator = new \phpbb\db\migrator(
+ $container,
+ $config,
+ $db,
+ $db_tools,
+ 'phpbb_migrations',
+ $phpbb_root_path,
+ $php_ext,
+ $table_prefix,
+ array(),
+ new \phpbb\db\migration\helper()
+ );
+ $container->set('migrator', $migrator);
+
+ return new \phpbb\extension\manager(
+ $container,
+ $db,
+ $config,
+ new \phpbb\filesystem(),
+ $user,
+ 'phpbb_ext',
+ dirname(__FILE__) . '/',
+ $php_ext,
+ ($with_cache) ? new phpbb_mock_cache() : null
+ );
+ }
+}
diff --git a/tests/extension/metadata_manager_test.php b/tests/extension/metadata_manager_test.php
new file mode 100644
index 0000000000..2a746d3792
--- /dev/null
+++ b/tests/extension/metadata_manager_test.php
@@ -0,0 +1,343 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+class phpbb_extension_metadata_manager_test extends phpbb_database_test_case
+{
+ protected $class_loader;
+ protected $extension_manager;
+
+ protected $cache;
+ protected $config;
+ protected $db;
+ protected $db_tools;
+ protected $table_prefix;
+ protected $phpbb_root_path;
+ protected $phpEx;
+ protected $migrator;
+ protected $template;
+ protected $user;
+
+ public function getDataSet()
+ {
+ return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/extensions.xml');
+ }
+
+ protected function setUp()
+ {
+ parent::setUp();
+
+ $this->cache = new phpbb_mock_cache();
+ $this->config = new \phpbb\config\config(array(
+ 'version' => '3.1.0',
+ ));
+ $this->db = $this->new_dbal();
+ $this->db_tools = new \phpbb\db\tools($this->db);
+ $this->phpbb_root_path = dirname(__FILE__) . '/';
+ $this->phpEx = 'php';
+ $this->user = new \phpbb\user('\phpbb\datetime');
+ $this->table_prefix = 'phpbb_';
+
+ $this->template = new \phpbb\template\twig\twig(
+ new \phpbb\path_helper(
+ new \phpbb\symfony_request(
+ new phpbb_mock_request()
+ ),
+ new \phpbb\filesystem(),
+ $this->getMock('\phpbb\request\request'),
+ $this->phpbb_root_path,
+ $this->phpEx
+ ),
+ $this->config,
+ $this->user,
+ new \phpbb\template\context()
+ );
+
+ $container = new phpbb_mock_container_builder();
+
+ $this->migrator = new \phpbb\db\migrator(
+ $container,
+ $this->config,
+ $this->db,
+ $this->db_tools,
+ 'phpbb_migrations',
+ $this->phpbb_root_path,
+ 'php',
+ $this->table_prefix,
+ array(),
+ new \phpbb\db\migration\helper()
+ );
+ $container->set('migrator', $this->migrator);
+
+ $this->extension_manager = new \phpbb\extension\manager(
+ $container,
+ $this->db,
+ $this->config,
+ new \phpbb\filesystem(),
+ $this->user,
+ 'phpbb_ext',
+ $this->phpbb_root_path,
+ $this->phpEx,
+ $this->cache
+ );
+ }
+
+ // Should fail from missing composer.json
+ public function test_bar()
+ {
+ $ext_name = 'vendor3/bar';
+
+ $manager = $this->get_metadata_manager($ext_name);
+
+ try
+ {
+ $manager->get_metadata();
+ }
+ catch (\phpbb\extension\exception $e)
+ {
+ $this->assertEquals((string) $e, $this->user->lang('FILE_NOT_FOUND', $this->phpbb_root_path . $this->extension_manager->get_extension_path($ext_name) . 'composer.json'));
+ }
+ }
+
+ // Should be the same as a direct json_decode of the composer.json file
+ public function test_foo()
+ {
+ $ext_name = 'vendor2/foo';
+
+ $manager = $this->get_metadata_manager($ext_name);
+
+ try
+ {
+ $metadata = $manager->get_metadata();
+ }
+ catch (\phpbb\extension\exception $e)
+ {
+ $this->fail($e);
+ }
+
+ $json = json_decode(file_get_contents($this->phpbb_root_path . 'ext/vendor2/foo/composer.json'), true);
+ array_walk_recursive($json, array($manager, 'sanitize_json'));
+
+ $this->assertEquals($metadata, $json);
+ }
+
+ public function validator_non_existing_data()
+ {
+ return array(
+ array('name'),
+ array('type'),
+ array('license'),
+ array('version'),
+ );
+ }
+
+ /**
+ * @dataProvider validator_non_existing_data
+ */
+ public function test_validator_non_existing($field_name)
+ {
+ $manager = $this->get_metadata_manager('validator');
+ try
+ {
+ $manager->validate($field_name);
+ $this->fail('Exception not triggered');
+ }
+ catch(\phpbb\extension\exception $e)
+ {
+ $this->assertEquals((string) $e, $this->user->lang('META_FIELD_NOT_SET', $field_name));
+ }
+ }
+
+ public function test_validator_non_existing_authors()
+ {
+ $manager = $this->get_metadata_manager('validator');
+ try
+ {
+ $manager->validate_authors();
+ $this->fail('Exception not triggered');
+ }
+ catch (\phpbb\extension\exception $e)
+ {
+ $this->assertEquals((string) $e, $this->user->lang('META_FIELD_NOT_SET', 'authors'));
+ }
+
+ $manager->merge_metadata(array(
+ 'authors' => array(
+ array(),
+ ),
+ ));
+
+ try
+ {
+ $manager->validate_authors();
+ $this->fail('Exception not triggered');
+ }
+ catch (\phpbb\extension\exception $e)
+ {
+ $this->assertEquals((string) $e, $this->user->lang('META_FIELD_NOT_SET', 'author name'));
+ }
+ }
+
+ public function validator_invalid_data()
+ {
+ return array(
+ array('name', 'asdf'),
+ array('type', 'asdf'),
+ array('license', ''),
+ array('version', ''),
+ );
+ }
+
+ /**
+ * @dataProvider validator_invalid_data
+ */
+ public function test_validator_invalid($field_name, $field_value)
+ {
+ $manager = $this->get_metadata_manager('validator');
+
+ // Invalid data
+ $manager->set_metadata(array(
+ $field_name => $field_value,
+ ));
+
+ try
+ {
+ $manager->validate($field_name);
+ $this->fail('Exception not triggered');
+ }
+ catch(\phpbb\extension\exception $e)
+ {
+ $this->assertEquals((string) $e, $this->user->lang('META_FIELD_INVALID', $field_name));
+ }
+ }
+
+ public function test_validator_valid()
+ {
+ $ext_name = 'validator';
+
+ $manager = $this->get_metadata_manager($ext_name);
+
+ // Valid data
+ $manager->set_metadata(array(
+ 'name' => 'test/foo',
+ 'type' => 'phpbb-extension',
+ 'license' => 'GPL v2',
+ 'version' => '1.0.0',
+ ));
+
+ try
+ {
+ $this->assertEquals(true, $manager->validate('enable'));
+ }
+ catch(\phpbb\extension\exception $e)
+ {
+ $this->fail($e);
+ }
+ }
+
+ public function validator_requirements_data()
+ {
+ return array(
+ array(
+ '10.0.0',
+ '100.2.0',
+ false,
+ false,
+ 'Versions are not compared at the moment',
+ ),
+ array(
+ '5.3.0',
+ '3.1.0-beta',
+ true,
+ true,
+ ),
+ array(
+ '>' . phpversion(),
+ '>3.1.0',
+ false,
+ false,
+ 'Versions are not compared at the moment',
+ ),
+ array(
+ '<' . phpversion(),
+ '<3.1.0',
+ false,
+ false,
+ 'Versions are not compared at the moment',
+ ),
+ array(
+ phpversion(),
+ '3.1.0',
+ true,
+ true,
+ ),
+ array(
+ '>=' . phpversion(),
+ '>=3.1.0',
+ true,
+ true,
+ ),
+ array(
+ '<=' . phpversion(),
+ '<=3.1.0',
+ true,
+ true,
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider validator_requirements_data
+ */
+ public function test_validator_requirements($php_version, $phpbb_version, $expected_php, $expected_phpbb, $incomplete_reason = '')
+ {
+ if ($incomplete_reason)
+ {
+ $this->markTestIncomplete($incomplete_reason);
+ }
+
+ $ext_name = 'validator';
+ $manager = $this->get_metadata_manager($ext_name);
+ // Too high of requirements
+ $manager->merge_metadata(array(
+ 'require' => array(
+ 'php' => $php_version,
+ ),
+ 'extra' => array(
+ 'soft-require' => array(
+ 'phpbb/phpbb' => $phpbb_version, // config is set to 3.1.0
+ ),
+ ),
+ ));
+
+ $this->assertEquals($expected_php, $manager->validate_require_php());
+ $this->assertEquals($expected_phpbb, $manager->validate_require_phpbb());
+ }
+
+ /**
+ * Get an instance of the metadata manager
+ *
+ * @param string $ext_name
+ * @return phpbb_mock_metadata_manager
+ */
+ private function get_metadata_manager($ext_name)
+ {
+ return new phpbb_mock_metadata_manager(
+ $ext_name,
+ $this->config,
+ $this->extension_manager,
+ $this->template,
+ $this->user,
+ $this->phpbb_root_path
+ );
+ }
+}
diff --git a/tests/extension/modules_test.php b/tests/extension/modules_test.php
new file mode 100644
index 0000000000..21f1c6aca5
--- /dev/null
+++ b/tests/extension/modules_test.php
@@ -0,0 +1,238 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+require_once dirname(__FILE__) . '/ext/vendor2/foo/acp/a_info.php';
+require_once dirname(__FILE__) . '/ext/vendor2/foo/mcp/a_info.php';
+require_once dirname(__FILE__) . '/ext/vendor2/foo/acp/fail_info.php';
+require_once dirname(__FILE__) . '/ext/vendor2/bar/acp/a_info.php';
+require_once dirname(__FILE__) . '/../../phpBB/includes/acp/acp_modules.php';
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions_module.php';
+
+class phpbb_extension_modules_test extends phpbb_test_case
+{
+ protected $extension_manager;
+ protected $finder;
+
+ public function setUp()
+ {
+ global $phpbb_extension_manager;
+
+ $this->extension_manager = new phpbb_mock_extension_manager(
+ dirname(__FILE__) . '/',
+ array(
+ 'vendor2/foo' => array(
+ 'ext_name' => 'vendor2/foo',
+ 'ext_active' => '1',
+ 'ext_path' => 'ext/vendor2/foo/',
+ ),
+ 'vendor3/bar' => array(
+ 'ext_name' => 'vendor3/bar',
+ 'ext_active' => '1',
+ 'ext_path' => 'ext/vendor3/bar/',
+ ),
+ ));
+ $phpbb_extension_manager = $this->extension_manager;
+
+ $this->acp_modules = new acp_modules();
+ }
+
+ public function test_get_module_infos()
+ {
+ global $phpbb_root_path;
+
+// $this->markTestIncomplete('Modules no speak namespace! Going to get rid of db modules altogether and fix this test after.');
+
+ // Correctly set the root path for this test to this directory, so the classes can be found
+ $phpbb_root_path = dirname(__FILE__) . '/';
+
+ // Find acp module info files
+ $this->acp_modules->module_class = 'acp';
+ $acp_modules = $this->acp_modules->get_module_infos();
+ $this->assertEquals(array(
+ 'vendor2\\foo\\acp\\a_module' => array(
+ 'filename' => 'vendor2\\foo\\acp\\a_module',
+ 'title' => 'Foobar',
+ 'version' => '3.1.0-dev',
+ 'modes' => array(
+ 'config' => array('title' => 'Config', 'auth' => 'ext_vendor2/foo', 'cat' => array('ACP_MODS')),
+ ),
+ ),
+ 'acp_foobar' => array(
+ 'filename' => 'acp_foobar',
+ 'title' => 'ACP Foobar',
+ 'version' => '3.1.0-dev',
+ 'modes' => array(
+ 'test' => array('title' => 'Test', 'auth' => '', 'cat' => array('ACP_GENERAL')),
+ ),
+ ),
+ ), $acp_modules);
+
+ // Find mcp module info files
+ $this->acp_modules->module_class = 'mcp';
+ $acp_modules = $this->acp_modules->get_module_infos();
+ $this->assertEquals(array(
+ 'vendor2\\foo\\mcp\\a_module' => array(
+ 'filename' => 'vendor2\\foo\\mcp\\a_module',
+ 'title' => 'Foobar',
+ 'version' => '3.1.0-dev',
+ 'modes' => array(
+ 'config' => array('title' => 'Config', 'auth' => '', 'cat' => array('MCP_MAIN')),
+ ),
+ ),
+ ), $acp_modules);
+
+ // Find a specific module info file (mcp_a_module)
+ $this->acp_modules->module_class = 'mcp';
+ $acp_modules = $this->acp_modules->get_module_infos('mcp_a_module');
+ $this->assertEquals(array(
+ 'vendor2\\foo\\mcp\\a_module' => array(
+ 'filename' => 'vendor2\\foo\\mcp\\a_module',
+ 'title' => 'Foobar',
+ 'version' => '3.1.0-dev',
+ 'modes' => array(
+ 'config' => array('title' => 'Config', 'auth' => '', 'cat' => array('MCP_MAIN')),
+ ),
+ ),
+ ), $acp_modules);
+
+ // Find a specific module info file (mcp_a_module) with passing the module_class
+ $this->acp_modules->module_class = '';
+ $acp_modules = $this->acp_modules->get_module_infos('mcp_a_module', 'mcp');
+ $this->assertEquals(array(
+ 'vendor2\\foo\\mcp\\a_module' => array(
+ 'filename' => 'vendor2\\foo\\mcp\\a_module',
+ 'title' => 'Foobar',
+ 'version' => '3.1.0-dev',
+ 'modes' => array(
+ 'config' => array('title' => 'Config', 'auth' => '', 'cat' => array('MCP_MAIN')),
+ ),
+ ),
+ ), $acp_modules);
+
+ // The mcp module info file we're looking for shouldn't exist
+ $this->acp_modules->module_class = 'mcp';
+ $acp_modules = $this->acp_modules->get_module_infos('mcp_a_fail');
+ $this->assertEquals(array(), $acp_modules);
+
+ // As there are no ucp modules we shouldn't find any
+ $this->acp_modules->module_class = 'ucp';
+ $acp_modules = $this->acp_modules->get_module_infos();
+ $this->assertEquals(array(), $acp_modules);
+
+ // Get module info of specified extension module
+ $this->acp_modules->module_class = 'acp';
+ $acp_modules = $this->acp_modules->get_module_infos('foo_acp_a_module');
+ $this->assertEquals(array(
+ 'vendor2\\foo\\acp\\a_module' => array (
+ 'filename' => 'vendor2\\foo\\acp\\a_module',
+ 'title' => 'Foobar',
+ 'version' => '3.1.0-dev',
+ 'modes' => array (
+ 'config' => array ('title' => 'Config', 'auth' => 'ext_vendor2/foo', 'cat' => array ('ACP_MODS')),
+ ),
+ ),
+ ), $acp_modules);
+
+ // No specific module and module class set to an incorrect name
+ $acp_modules = $this->acp_modules->get_module_infos('', 'wcp', true);
+ $this->assertEquals(array(), $acp_modules);
+
+ // No specific module, no module_class set in the function parameter, and an incorrect module class
+ $this->acp_modules->module_class = 'wcp';
+ $acp_modules = $this->acp_modules->get_module_infos();
+ $this->assertEquals(array(), $acp_modules);
+
+ // No specific module, module class set to false (will default to the above acp)
+ // Setting $use_all_available will cause get_module_infos() to also load not enabled extensions (vendor2/bar)
+ $this->acp_modules->module_class = 'acp';
+ $acp_modules = $this->acp_modules->get_module_infos('', false, true);
+ $this->assertEquals(array(
+ 'vendor2\\foo\\acp\\a_module' => array(
+ 'filename' => 'vendor2\\foo\\acp\\a_module',
+ 'title' => 'Foobar',
+ 'version' => '3.1.0-dev',
+ 'modes' => array(
+ 'config' => array('title' => 'Config', 'auth' => 'ext_vendor2/foo', 'cat' => array('ACP_MODS')),
+ ),
+ ),
+ 'acp_foobar' => array(
+ 'filename' => 'acp_foobar',
+ 'title' => 'ACP Foobar',
+ 'version' => '3.1.0-dev',
+ 'modes' => array(
+ 'test' => array('title' => 'Test', 'auth' => '', 'cat' => array('ACP_GENERAL')),
+ ),
+ ),
+ 'vendor2\\bar\\acp\\a_module' => array(
+ 'filename' => 'vendor2\\bar\\acp\\a_module',
+ 'title' => 'Bar',
+ 'version' => '3.1.0-dev',
+ 'modes' => array(
+ 'config' => array('title' => 'Config', 'auth' => '', 'cat' => array('ACP_MODS')),
+ ),
+ )
+ ), $acp_modules);
+
+ // Specific module set to disabled extension
+ $acp_modules = $this->acp_modules->get_module_infos('vendor2_bar_acp_a_module', 'acp', true);
+ $this->assertEquals(array(
+ 'vendor2\\bar\\acp\\a_module' => array(
+ 'filename' => 'vendor2\\bar\\acp\\a_module',
+ 'title' => 'Bar',
+ 'version' => '3.1.0-dev',
+ 'modes' => array(
+ 'config' => array('title' => 'Config', 'auth' => '', 'cat' => array('ACP_MODS')),
+ ),
+ )
+ ), $acp_modules);
+ }
+
+ public function module_auth_test_data()
+ {
+ return array(
+ // module_auth, expected result
+ array('ext_foo', false),
+ array('ext_foo/bar', false),
+ array('ext_vendor3/bar', false),
+ array('ext_vendor2/foo', true),
+ );
+ }
+
+ /**
+ * @dataProvider module_auth_test_data
+ */
+ public function test_modules_auth($module_auth, $expected)
+ {
+ global $phpbb_extension_manager, $phpbb_dispatcher;
+
+ $phpbb_extension_manager = $this->extension_manager = new phpbb_mock_extension_manager(
+ dirname(__FILE__) . '/',
+ array(
+ 'vendor2/foo' => array(
+ 'ext_name' => 'vendor2/foo',
+ 'ext_active' => '1',
+ 'ext_path' => 'ext/vendor2/foo/',
+ ),
+ 'vendor3/bar' => array(
+ 'ext_name' => 'vendor3/bar',
+ 'ext_active' => '0',
+ 'ext_path' => 'ext/vendor3/bar/',
+ ),
+ )
+ );
+
+ $phpbb_dispatcher = new phpbb_mock_event_dispatcher();
+
+ $this->assertEquals($expected, p_master::module_auth($module_auth, 0));
+ }
+}
diff --git a/tests/extension/phpbb/default/implementation.php b/tests/extension/phpbb/default/implementation.php
new file mode 100644
index 0000000000..91d5f8aa2f
--- /dev/null
+++ b/tests/extension/phpbb/default/implementation.php
@@ -0,0 +1,5 @@
+<?php
+
+class phpbb_default_impl_class implements phpbb_default_interface
+{
+}
diff --git a/tests/feed/attachments_base_test.php b/tests/feed/attachments_base_test.php
new file mode 100644
index 0000000000..c980dfd3d7
--- /dev/null
+++ b/tests/feed/attachments_base_test.php
@@ -0,0 +1,94 @@
+<?php
+/**
+ *
+ * This file is part of the phpBB Forum Software package.
+ *
+ * @copyright (c) phpBB Limited <https://www.phpbb.com>
+ * @license GNU General Public License, version 2 (GPL-2.0)
+ *
+ * For full copyright and license information, please see
+ * the docs/CREDITS.txt file.
+ *
+ */
+
+require_once(dirname(__FILE__) . '/attachments_mock_feed.php');
+
+class phpbb_feed_attachments_base_test extends phpbb_database_test_case
+{
+ protected $filesystem;
+
+ /** @var \phpbb_feed_attachments_mock_feed */
+ protected $attachments_mocks_feed;
+
+ public function getDataSet()
+ {
+ return $this->createXMLDataSet(dirname(__FILE__) . '/../extension/fixtures/extensions.xml');
+ }
+
+ public function setUp()
+ {
+ global $phpbb_root_path, $phpEx;
+
+ $this->filesystem = new \phpbb\filesystem();
+ $config = new \phpbb\config\config(array());
+ $user = new \phpbb\user('\phpbb\datetime');
+ $feed_helper = new \phpbb\feed\helper($config, $user, $phpbb_root_path, $phpEx);
+ $db = $this->new_dbal();
+ $cache = new \phpbb_mock_cache();
+ $auth = new \phpbb\auth\auth();
+ $content_visibility = new \phpbb\content_visibility(
+ $auth,
+ $config,
+ new \phpbb_mock_event_dispatcher(),
+ $db,
+ $user,
+ $phpbb_root_path,
+ $phpEx,
+ FORUMS_TABLE,
+ POSTS_TABLE,
+ TOPICS_TABLE,
+ USERS_TABLE
+ );
+
+ $this->attachments_mocks_feed = new \phpbb_feed_attachments_mock_feed(
+ $feed_helper,
+ $config,
+ $db,
+ $cache,
+ $user,
+ $auth,
+ $content_visibility,
+ new \phpbb_mock_event_dispatcher(),
+ $phpEx
+ );
+ }
+
+ public function data_fetch_attachments()
+ {
+ return array(
+ array(array(0), array(0)),
+ array(array(), array(1)),
+ array(array(), array(), 'RuntimeException')
+ );
+ }
+
+ /**
+ * @dataProvider data_fetch_attachments
+ */
+ public function test_fetch_attachments($post_ids, $topic_ids, $expected_exception = false)
+ {
+ $this->attachments_mocks_feed->post_ids = $post_ids;
+ $this->attachments_mocks_feed->topic_ids = $topic_ids;
+
+ if ($expected_exception !== false)
+ {
+ $this->setExpectedException($expected_exception);
+
+ $this->attachments_mocks_feed->get_sql();
+ }
+ else
+ {
+ $this->assertTrue($this->attachments_mocks_feed->get_sql());
+ }
+ }
+}
diff --git a/tests/feed/attachments_mock_feed.php b/tests/feed/attachments_mock_feed.php
new file mode 100644
index 0000000000..0e623fed24
--- /dev/null
+++ b/tests/feed/attachments_mock_feed.php
@@ -0,0 +1,31 @@
+<?php
+/**
+ *
+ * This file is part of the phpBB Forum Software package.
+ *
+ * @copyright (c) phpBB Limited <https://www.phpbb.com>
+ * @license GNU General Public License, version 2 (GPL-2.0)
+ *
+ * For full copyright and license information, please see
+ * the docs/CREDITS.txt file.
+ *
+ */
+
+/**
+ * Board wide feed (aka overall feed)
+ *
+ * This will give you the newest {$this->num_items} posts
+ * from the whole board.
+ */
+class phpbb_feed_attachments_mock_feed extends \phpbb\feed\attachments_base
+{
+ public $topic_ids = array();
+ public $post_ids = array();
+
+ function get_sql()
+ {
+ parent::fetch_attachments($this->post_ids, $this->topic_ids);
+
+ return true;
+ }
+}
diff --git a/tests/filesystem/clean_path_test.php b/tests/filesystem/clean_path_test.php
new file mode 100644
index 0000000000..c585b17155
--- /dev/null
+++ b/tests/filesystem/clean_path_test.php
@@ -0,0 +1,54 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+class phpbb_filesystem_clean_path_test extends phpbb_test_case
+{
+ protected $filesystem;
+
+ public function setUp()
+ {
+ parent::setUp();
+ $this->filesystem = new \phpbb\filesystem();
+ }
+
+ public function clean_path_data()
+ {
+ return array(
+ array('foo', 'foo'),
+ array('foo/bar', 'foo/bar'),
+ array('foo/bar/', 'foo/bar/'),
+ array('foo/./bar', 'foo/bar'),
+ array('foo/./././bar', 'foo/bar'),
+ array('foo/bar/.', 'foo/bar'),
+ array('./foo/bar', './foo/bar'),
+ array('../foo/bar', '../foo/bar'),
+ array('./../foo/bar', './../foo/bar'),
+ array('././../foo/bar', './../foo/bar'),
+ array('one/two/three', 'one/two/three'),
+ array('one/two/../three', 'one/three'),
+ array('one/../two/three', 'two/three'),
+ array('one/two/..', 'one'),
+ array('one/two/../', 'one/'),
+ array('one/two/../three/../four', 'one/four'),
+ array('one/two/three/../../four', 'one/four'),
+ );
+ }
+
+ /**
+ * @dataProvider clean_path_data
+ */
+ public function test_clean_path($input, $expected)
+ {
+ $this->assertEquals($expected, $this->filesystem->clean_path($input));
+ }
+}
diff --git a/tests/fixtures/config.php b/tests/fixtures/config.php
new file mode 100644
index 0000000000..ae9e8c22de
--- /dev/null
+++ b/tests/fixtures/config.php
@@ -0,0 +1,3 @@
+<?php
+$foo = 'bar';
+$foo_foo = 'bar bar';
diff --git a/tests/fixtures/config_other.php b/tests/fixtures/config_other.php
new file mode 100644
index 0000000000..e0ecc17bb9
--- /dev/null
+++ b/tests/fixtures/config_other.php
@@ -0,0 +1,3 @@
+<?php
+$bar = 'foo';
+$bar_bar = 'foo foo';
diff --git a/tests/functional/acp_groups_test.php b/tests/functional/acp_groups_test.php
index 3d8cabb086..9dfdc93474 100644
--- a/tests/functional/acp_groups_test.php
+++ b/tests/functional/acp_groups_test.php
@@ -1,21 +1,124 @@
<?php
/**
*
-* @package testing
-* @copyright (c) 2013 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
-require_once dirname(__FILE__) . '/common_groups_test.php';
+require_once dirname(__FILE__) . '/common_groups_test_case.php';
/**
* @group functional
*/
-class phpbb_functional_acp_groups_test extends phpbb_functional_common_groups_test
+class phpbb_functional_acp_groups_test extends phpbb_functional_common_groups_test_case
{
+ protected $form_data;
+
protected function get_url()
{
return 'adm/index.php?i=groups&mode=manage&action=edit';
}
+
+ public function acp_group_test_data()
+ {
+ return array(
+ 'both_yes' => array(
+ 5,
+ true,
+ true,
+ ),
+ 'legend_no_teampage' => array(
+ 5,
+ true,
+ false,
+ ),
+ 'no_legend_teampage' => array(
+ 5,
+ false,
+ true,
+ ),
+ 'both_no' => array(
+ 5,
+ false,
+ false,
+ ),
+ 'no_change' => array(
+ 5,
+ NULL,
+ NULL,
+ ),
+ 'back_to_default' => array(
+ 5,
+ true,
+ true,
+ ),
+ // Remove and add moderators back in order to reset
+ // group order to default one
+ 'mods_both_no' => array(
+ 4,
+ false,
+ false,
+ ),
+ 'mods_back_to_default' => array(
+ 4,
+ true,
+ true,
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider acp_group_test_data
+ */
+ public function test_acp_groups_teampage($group_id, $tick_legend, $tick_teampage)
+ {
+ $this->group_manage_login();
+
+ // Manage Administrators group
+ $form = $this->get_group_manage_form($group_id);
+ $this->form_data[0] = $form->getValues();
+
+ if (isset($tick_legend) && isset($tick_teampage))
+ {
+ if ($tick_legend)
+ {
+ $form['group_legend']->tick();
+ }
+ else
+ {
+ $form['group_legend']->untick();
+ }
+
+ if ($tick_teampage)
+ {
+ $form['group_teampage']->tick();
+ }
+ else
+ {
+ $form['group_teampage']->untick();
+ }
+ }
+ $crawler = self::submit($form);
+ $this->assertContains($this->lang('GROUP_UPDATED'), $crawler->text());
+
+ $form = $this->get_group_manage_form($group_id);
+ if (!isset($tick_legend) && !isset($tick_teampage))
+ {
+ $this->form_data[1] = $form->getValues();
+ unset($this->form_data[0]['creation_time'], $this->form_data[0]['form_token'], $this->form_data[1]['creation_time'], $this->form_data[1]['form_token']);
+ $this->assertEquals($this->form_data[0], $this->form_data[1]);
+ }
+ else
+ {
+ $this->form_data = $form->getValues();
+ $this->assertEquals($tick_legend, $this->form_data['group_legend']);
+ $this->assertEquals($tick_teampage, $this->form_data['group_teampage']);
+ }
+ }
}
diff --git a/tests/functional/acp_permissions_test.php b/tests/functional/acp_permissions_test.php
new file mode 100644
index 0000000000..0a40e76057
--- /dev/null
+++ b/tests/functional/acp_permissions_test.php
@@ -0,0 +1,127 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+/**
+* @group functional
+*/
+class phpbb_functional_acp_permissions_test extends phpbb_functional_test_case
+{
+ public function setUp()
+ {
+ parent::setUp();
+
+ $this->login();
+ $this->admin_login();
+ $this->add_lang('acp/permissions');
+ }
+
+ public function test_permissions_tab()
+ {
+ // Permissions tab
+ // XXX hardcoded id
+ $crawler = self::request('GET', 'adm/index.php?i=16&sid=' . $this->sid);
+ // these language strings are html
+ $this->assertContains($this->lang('ACP_PERMISSIONS_EXPLAIN'), $this->get_content());
+ }
+
+ public function test_select_user()
+ {
+ // User permissions
+ $crawler = self::request('GET', 'adm/index.php?i=acp_permissions&icat=16&mode=setting_user_global&sid=' . $this->sid);
+ $this->assertContains($this->lang('ACP_USERS_PERMISSIONS_EXPLAIN'), $this->get_content());
+
+ // Select admin
+ $form = $crawler->selectButton($this->lang('SUBMIT'))->form();
+ $data = array('username[0]' => 'admin');
+ $form->setValues($data);
+ $crawler = self::submit($form);
+ $this->assertContains($this->lang('ACL_SET'), $crawler->filter('h1')->eq(1)->text());
+ }
+
+ public function permissions_data()
+ {
+ return array(
+ // description
+ // permission type
+ // permission name
+ // mode
+ // object name
+ // object id
+ array(
+ 'user permission',
+ 'u_',
+ 'u_hideonline',
+ 'setting_user_global',
+ 'user_id',
+ 2,
+ ),
+ array(
+ 'moderator permission',
+ 'm_',
+ 'm_ban',
+ 'setting_mod_global',
+ 'group_id',
+ 4,
+ ),
+ /* Admin does not work yet, probably because founder can do everything
+ array(
+ 'admin permission',
+ 'a_',
+ 'a_forum',
+ 'setting_admin_global',
+ 'group_id',
+ 5,
+ ),
+ */
+ );
+ }
+
+ /**
+ * @dataProvider permissions_data
+ */
+ public function test_change_permission($description, $permission_type, $permission, $mode, $object_name, $object_id)
+ {
+ // Get the form
+ $crawler = self::request('GET', "adm/index.php?i=acp_permissions&icat=16&mode=$mode&${object_name}[0]=$object_id&type=$permission_type&sid=" . $this->sid);
+ $this->assertContains($this->lang('ACL_SET'), $crawler->filter('h1')->eq(1)->text());
+
+ // XXX globals for \phpbb\auth\auth, refactor it later
+ global $db, $cache;
+ $db = $this->get_db();
+ $cache = new phpbb_mock_null_cache;
+
+ $auth = new \phpbb\auth\auth;
+ // XXX hardcoded id
+ $user_data = $auth->obtain_user_data(2);
+ $auth->acl($user_data);
+ $this->assertEquals(1, $auth->acl_get($permission));
+
+ // Set u_hideonline to never
+ $form = $crawler->selectButton($this->lang('APPLY_PERMISSIONS'))->form();
+ // initially it should be a yes
+ $values = $form->getValues();
+ $this->assertEquals(1, $values["setting[$object_id][0][$permission]"]);
+ // set to never
+ $data = array("setting[$object_id][0][$permission]" => '0');
+ $form->setValues($data);
+ $crawler = self::submit($form);
+ $this->assertContains($this->lang('AUTH_UPDATED'), $crawler->text());
+
+ // check acl again
+ $auth = new \phpbb\auth\auth;
+ // XXX hardcoded id
+ $user_data = $auth->obtain_user_data(2);
+ $auth->acl($user_data);
+ $this->assertEquals(0, $auth->acl_get($permission));
+ }
+}
diff --git a/tests/functional/acp_profile_field_test.php b/tests/functional/acp_profile_field_test.php
new file mode 100644
index 0000000000..88df782faa
--- /dev/null
+++ b/tests/functional/acp_profile_field_test.php
@@ -0,0 +1,71 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+/**
+* @group functional
+*/
+class phpbb_functional_acp_profile_field_test extends phpbb_functional_test_case
+{
+ public function setUp()
+ {
+ parent::setUp();
+
+ $this->login();
+ $this->admin_login();
+ $this->add_lang('acp/profile');
+ }
+
+ public function data_add_profile_field()
+ {
+ return array(
+ array('bool', 'profilefields.type.bool',
+ array(
+ 'lang_options[0]' => 'foo',
+ 'lang_options[1]' => 'bar',
+ ),
+ array(),
+ ),
+ array('dropdown', 'profilefields.type.dropdown',
+ array(
+ 'lang_options' => "foo\nbar\nbar\nfoo",
+ ),
+ array(),
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider data_add_profile_field
+ */
+ public function test_add_profile_field($name, $type, $page1_settings, $page2_settings)
+ {
+ // Custom profile fields page
+ $crawler = self::request('GET', 'adm/index.php?i=acp_profile&mode=profile&sid=' . $this->sid);
+ // these language strings are html
+ $form = $crawler->selectButton('Create new field')->form(array(
+ 'field_ident' => $name,
+ 'field_type' => $type,
+ ));
+ $crawler = self::submit($form);
+
+ // Fill form for profile field options
+ $form = $crawler->selectButton('Profile type specific options')->form($page1_settings);
+ $crawler = self::submit($form);
+
+ // Fill form for profile field specific options
+ $form = $crawler->selectButton('Save')->form($page2_settings);
+ $crawler= self::submit($form);
+
+ $this->assertContainsLang('ADDED_PROFILE_FIELD', $crawler->text());
+ }
+}
diff --git a/tests/functional/acp_registration_test.php b/tests/functional/acp_registration_test.php
new file mode 100644
index 0000000000..ef9843679e
--- /dev/null
+++ b/tests/functional/acp_registration_test.php
@@ -0,0 +1,55 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+/**
+* @group functional
+*/
+class phpbb_functional_acp_registration_test extends phpbb_functional_test_case
+{
+ protected function set_email_enable($db, $status)
+ {
+ $sql = "UPDATE phpbb_config
+ SET config_value = '" . (($status) ? '1' : '0') . "'
+ WHERE config_name = 'email_enable'";
+ $db->sql_query($sql);
+
+ $this->purge_cache();
+ }
+
+ public function test_submitting_activation_method()
+ {
+ $db = $this->get_db();
+
+ $this->set_email_enable($db, false);
+
+ $this->add_lang('acp/board');
+ $this->login();
+ $this->admin_login();
+
+ $crawler = self::request('GET', 'adm/index.php?i=acp_board&mode=registration&sid=' . $this->sid);
+ $this->assertContainsLang('ACP_REGISTER_SETTINGS_EXPLAIN', $this->get_content());
+
+ $form = $crawler->selectButton($this->lang('SUBMIT'))->form();
+ $form['config[require_activation]']->select(USER_ACTIVATION_ADMIN);
+ $crawler = self::submit($form);
+ $this->assertContainsLang('ACC_ACTIVATION_WARNING', $crawler->filter('div.main')->text());
+
+ $crawler = self::request('GET', 'adm/index.php?i=acp_board&mode=registration&sid=' . $this->sid);
+ $form = $crawler->selectButton($this->lang('SUBMIT'))->form();
+ $form['config[require_activation]']->select(USER_ACTIVATION_NONE);
+ $crawler = self::submit($form);
+ $this->assertNotContainsLang('ACC_ACTIVATION_WARNING', $crawler->filter('div.main')->text());
+
+ $this->set_email_enable($db, true);
+ }
+}
diff --git a/tests/functional/acp_users_test.php b/tests/functional/acp_users_test.php
index 50d9a67dc1..78028aacb8 100644
--- a/tests/functional/acp_users_test.php
+++ b/tests/functional/acp_users_test.php
@@ -1,9 +1,13 @@
<?php
/**
*
-* @package testing
-* @copyright (c) 2014 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
diff --git a/tests/functional/auth_test.php b/tests/functional/auth_test.php
index afb4f15fc2..76e1709afb 100644
--- a/tests/functional/auth_test.php
+++ b/tests/functional/auth_test.php
@@ -1,9 +1,13 @@
<?php
/**
*
-* @package testing
-* @copyright (c) 2012 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -18,7 +22,7 @@ class phpbb_functional_auth_test extends phpbb_functional_test_case
// check for logout link
$crawler = self::request('GET', 'index.php');
- $this->assertContains($this->lang('LOGOUT_USER', 'admin'), $crawler->filter('.navbar')->text());
+ $this->assertContains($this->lang('LOGOUT', 'admin'), $crawler->filter('.navbar')->text());
}
public function test_login_other()
@@ -26,7 +30,26 @@ class phpbb_functional_auth_test extends phpbb_functional_test_case
$this->create_user('anothertestuser');
$this->login('anothertestuser');
$crawler = self::request('GET', 'index.php');
- $this->assertContains('anothertestuser', $crawler->filter('.icon-logout')->text());
+ $this->assertContains('anothertestuser', $crawler->filter('#username_logged_in')->text());
+ }
+
+ /**
+ * @dependsOn test_login_other
+ */
+ public function test_login_ucp_other_auth_provider()
+ {
+ global $cache, $config;
+ $cache = new phpbb_mock_null_cache;
+ $db = $this->get_db();
+ $sql = 'UPDATE ' . CONFIG_TABLE . " SET config_value = 'foobar' WHERE config_name = 'auth_method'";
+ $db->sql_query($sql);
+ $config['auth_method'] = 'foobar';
+ $this->login('anothertestuser');
+ $crawler = self::request('GET', 'index.php');
+ $this->assertContains('anothertestuser', $crawler->filter('#username_logged_in')->text());
+ $sql = 'UPDATE ' . CONFIG_TABLE . " SET config_value = 'db' WHERE config_name = 'auth_method'";
+ $db->sql_query($sql);
+ $config['auth_method'] = 'db';
}
/**
@@ -39,10 +62,19 @@ class phpbb_functional_auth_test extends phpbb_functional_test_case
// logout
$crawler = self::request('GET', 'ucp.php?sid=' . $this->sid . '&mode=logout');
- $this->assertContains($this->lang('LOGOUT_REDIRECT'), $crawler->filter('#message')->text());
// look for a register link, which should be visible only when logged out
$crawler = self::request('GET', 'index.php');
$this->assertContains($this->lang('REGISTER'), $crawler->filter('.navbar')->text());
}
+
+ public function test_acp_login()
+ {
+ $this->login();
+ $this->admin_login();
+
+ // check that we are logged in
+ $crawler = self::request('GET', 'adm/index.php?sid=' . $this->sid);
+ $this->assertContains($this->lang('ADMIN_PANEL'), $crawler->filter('h1')->text());
+ }
}
diff --git a/tests/functional/avatar_acp_groups_test.php b/tests/functional/avatar_acp_groups_test.php
new file mode 100644
index 0000000000..ca8c84ab2e
--- /dev/null
+++ b/tests/functional/avatar_acp_groups_test.php
@@ -0,0 +1,85 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+require_once dirname(__FILE__) . '/common_avatar_test_case.php';
+
+/**
+ * @group functional
+ */
+class phpbb_functional_avatar_acp_groups_test extends phpbb_functional_common_avatar_test_case
+{
+ public function get_url()
+ {
+ return 'adm/index.php?i=acp_groups&mode=manage&action=edit&g=5';
+ }
+
+ public function avatar_acp_groups_data()
+ {
+ return array(
+ // Correct Gravatar
+ array(
+ 'GROUP_UPDATED',
+ 'avatar_driver_gravatar',
+ array(
+ 'avatar_gravatar_email' => 'test@example.com',
+ 'avatar_gravatar_width' => 80,
+ 'avatar_gravatar_height' => 80,
+ ),
+ ),
+ // Gravatar with incorrect size
+ array(
+ 'The submitted avatar is 120 wide and 120 high. Avatars must be at least 20 wide and 20 high, but no larger than 90 wide and 90 high.',
+ 'avatar_driver_gravatar',
+ array(
+ 'avatar_gravatar_email' => 'test@example.com',
+ 'avatar_gravatar_width' => 120,
+ 'avatar_gravatar_height' => 120,
+ ),
+ ),
+ // Delete avatar image to reset group settings
+ array(
+ array('CONFIRM_AVATAR_DELETE', 'GROUP_UPDATED'),
+ 'avatar_driver_gravatar',
+ array(
+ 'avatar_delete' => array('tick', ''),
+ ),
+ ),
+ array(
+ 'The URL you specified is invalid.',
+ 'avatar_driver_remote',
+ array(
+ 'avatar_remote_url' => 'https://www.phpbb.com/avatar/55502f40dc8b7c769880b10874abc9d0.jpg',
+ 'avatar_remote_width' => 80,
+ 'avatar_remote_height' => 80,
+ ),
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider avatar_acp_groups_data
+ */
+ public function test_avatar_acp_groups($expected, $avatar_type, $data)
+ {
+ $this->assert_avatar_submit($expected, $avatar_type, $data);
+ }
+
+ // Test if avatar was really deleted
+ public function test_no_avatar_acp_groups()
+ {
+ $crawler = self::request('GET', $this->get_url() . '&sid=' . $this->sid);
+ $form = $crawler->selectButton($this->lang('SUBMIT'))->form();
+ $form_data = $form->getValues();
+ $this->assertEmpty($form_data['avatar_type']);
+ }
+}
diff --git a/tests/functional/avatar_acp_users_test.php b/tests/functional/avatar_acp_users_test.php
new file mode 100644
index 0000000000..8b05a28658
--- /dev/null
+++ b/tests/functional/avatar_acp_users_test.php
@@ -0,0 +1,65 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+require_once dirname(__FILE__) . '/common_avatar_test_case.php';
+
+/**
+ * @group functional
+ */
+class phpbb_functional_avatar_acp_users_test extends phpbb_functional_common_avatar_test_case
+{
+ public function get_url()
+ {
+ return 'adm/index.php?i=acp_users&u=2&mode=avatar';
+ }
+
+ public function avatar_acp_users_data()
+ {
+ return array(
+ // Gravatar with incorrect email
+ array(
+ 'EMAIL_INVALID_EMAIL',
+ 'avatar_driver_gravatar',
+ array(
+ 'avatar_gravatar_email' => 'test.example.com',
+ 'avatar_gravatar_width' => 80,
+ 'avatar_gravatar_height' => 80,
+ ),
+ ),
+ // Remote avatar with correct link
+ array(
+ 'USER_AVATAR_UPDATED',
+ 'avatar_driver_upload',
+ array(
+ 'avatar_upload_url' => 'https://secure.gravatar.com/avatar/55502f40dc8b7c769880b10874abc9d0.jpg',
+ ),
+ ),
+ // Reset avatar settings
+ array(
+ array('CONFIRM_AVATAR_DELETE', 'USER_AVATAR_UPDATED'),
+ 'avatar_driver_gravatar',
+ array(
+ 'avatar_delete' => array('tick', ''),
+ ),
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider avatar_acp_users_data
+ */
+ public function test_avatar_acp_users($expected, $avatar_type, $data)
+ {
+ $this->assert_avatar_submit($expected, $avatar_type, $data);
+ }
+}
diff --git a/tests/functional/avatar_ucp_groups_test.php b/tests/functional/avatar_ucp_groups_test.php
new file mode 100644
index 0000000000..52ef67543e
--- /dev/null
+++ b/tests/functional/avatar_ucp_groups_test.php
@@ -0,0 +1,74 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+require_once dirname(__FILE__) . '/common_avatar_test_case.php';
+
+/**
+ * @group functional
+ */
+class phpbb_functional_avatar_ucp_groups_test extends phpbb_functional_common_avatar_test_case
+{
+ public function get_url()
+ {
+ return 'ucp.php?i=ucp_groups&mode=manage&action=edit&g=5';
+ }
+
+ public function avatar_ucp_groups_data()
+ {
+ return array(
+ // Incorrect URL
+ array(
+ 'AVATAR_URL_INVALID',
+ 'avatar_driver_upload',
+ array(
+ 'avatar_upload_url' => 'https://secure.gravatar.com/avatar/55502f40dc8b7c769880b10874abc9d0?s=80',
+ ),
+ ),
+ /*
+ // Does not work due to DomCrawler issue
+ // Valid file upload
+ array(
+ 'GROUP_UPDATED',
+ 'avatar_driver_upload',
+ array(
+ 'avatar_upload_file' => array('upload', $this->path . 'valid.jpg'),
+ ),
+ ),
+ */
+ // Correct remote avatar
+ array(
+ 'GROUP_UPDATED',
+ 'avatar_driver_remote',
+ array(
+ 'avatar_remote_url' => 'https://secure.gravatar.com/avatar/55502f40dc8b7c769880b10874abc9d0.jpg',
+ 'avatar_remote_width' => 80,
+ 'avatar_remote_height' => 80,
+ ),
+ ),
+ array(
+ array('CONFIRM_AVATAR_DELETE', 'GROUP_UPDATED'),
+ 'avatar_driver_gravatar',
+ array(
+ 'avatar_delete' => array('tick', ''),
+ ),
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider avatar_ucp_groups_data
+ */
+ public function test_avatar_ucp_groups($expected, $avatar_type, $data)
+ {
+ $this->assert_avatar_submit($expected, $avatar_type, $data);
+ }
+}
diff --git a/tests/functional/avatar_ucp_users_test.php b/tests/functional/avatar_ucp_users_test.php
new file mode 100644
index 0000000000..2f0832e092
--- /dev/null
+++ b/tests/functional/avatar_ucp_users_test.php
@@ -0,0 +1,73 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+require_once dirname(__FILE__) . '/common_avatar_test_case.php';
+
+/**
+ * @group functional
+ */
+class phpbb_functional_avatar_ucp_users_test extends phpbb_functional_common_avatar_test_case
+{
+ public function get_url()
+ {
+ return 'ucp.php?i=ucp_profile&mode=avatar';
+ }
+
+ public function avatar_ucp_groups_data()
+ {
+ return array(
+ // Gravatar with correct settings
+ array(
+ 'PROFILE_UPDATED',
+ 'avatar_driver_gravatar',
+ array(
+ 'avatar_gravatar_email' => 'test@example.com',
+ 'avatar_gravatar_width' => 80,
+ 'avatar_gravatar_height' => 80,
+ ),
+ ),
+
+ array(
+ array('CONFIRM_AVATAR_DELETE', 'PROFILE_UPDATED'),
+ 'avatar_driver_gravatar',
+ array(
+ 'avatar_delete' => array('tick', ''),
+ ),
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider avatar_ucp_groups_data
+ */
+ public function test_avatar_ucp_groups($expected, $avatar_type, $data)
+ {
+ $this->assert_avatar_submit($expected, $avatar_type, $data);
+ }
+
+ public function test_display_upload_avatar()
+ {
+ $this->assert_avatar_submit('PROFILE_UPDATED',
+ 'avatar_driver_upload',
+ array(
+ 'avatar_upload_url' => 'https://secure.gravatar.com/avatar/55502f40dc8b7c769880b10874abc9d0.jpg',
+ )
+ );
+
+ $crawler = self::request('GET', $this->get_url() . '&sid=' . $this->sid);
+ $avatar_link = $crawler->filter('img')->attr('src');
+ $crawler = self::request('GET', $avatar_link . '&sid=' . $this->sid, array(), false);
+ $content = self::$client->getResponse()->getContent();
+ self::assertEquals(false, stripos(trim($content), 'debug'), 'Output contains debug message');
+ }
+}
diff --git a/tests/functional/browse_test.php b/tests/functional/browse_test.php
index 18a2ad9464..b9e74a280f 100644
--- a/tests/functional/browse_test.php
+++ b/tests/functional/browse_test.php
@@ -1,9 +1,13 @@
<?php
/**
*
-* @package testing
-* @copyright (c) 2011 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -29,4 +33,11 @@ class phpbb_functional_browse_test extends phpbb_functional_test_case
$crawler = self::request('GET', 'viewtopic.php?t=1');
$this->assertGreaterThan(0, $crawler->filter('.postbody')->count());
}
+
+ public function test_feed()
+ {
+ $crawler = self::request('GET', 'feed.php', array(), false);
+ self::assert_response_xml();
+ $this->assertGreaterThan(0, $crawler->filter('entry')->count());
+ }
}
diff --git a/tests/functional/common_avatar_test_case.php b/tests/functional/common_avatar_test_case.php
new file mode 100644
index 0000000000..924eb1273c
--- /dev/null
+++ b/tests/functional/common_avatar_test_case.php
@@ -0,0 +1,97 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+/**
+ * @group functional
+ */
+abstract class phpbb_functional_common_avatar_test_case extends phpbb_functional_test_case
+{
+ private $path;
+ private $form_content;
+
+ abstract function get_url();
+
+ public function setUp()
+ {
+ parent::setUp();
+ $this->path = __DIR__ . '/fixtures/files/';
+ $this->login();
+ $this->admin_login();
+ $this->add_lang(array('acp/board', 'ucp', 'acp/users', 'acp/groups'));
+ $this->set_acp_settings();
+ }
+
+ private function set_acp_settings()
+ {
+ $crawler = self::request('GET', 'adm/index.php?i=acp_board&mode=avatar&sid=' . $this->sid);
+ // Check the default entries we should have
+ $this->assertContainsLang('ALLOW_GRAVATAR', $crawler->text());
+ $this->assertContainsLang('ALLOW_REMOTE_UPLOAD', $crawler->text());
+ $this->assertContainsLang('ALLOW_AVATARS', $crawler->text());
+ $this->assertContainsLang('ALLOW_LOCAL', $crawler->text());
+
+ // Now start setting the needed settings
+ $form = $crawler->selectButton($this->lang('SUBMIT'))->form();
+ $form['config[allow_avatar_local]']->select(1);
+ $form['config[allow_avatar_gravatar]']->select(1);
+ $form['config[allow_avatar_remote]']->select(1);
+ $form['config[allow_avatar_remote_upload]']->select(1);
+ $crawler = self::submit($form);
+ $this->assertContainsLang('CONFIG_UPDATED', $crawler->text());
+ }
+
+ public function assert_avatar_submit($expected, $type, $data, $delete = false, $button_text = 'SUBMIT')
+ {
+ $crawler = self::request('GET', $this->get_url() . '&sid=' . $this->sid);
+
+ // Test if setting a gravatar avatar properly works
+ $form = $crawler->selectButton($this->lang($button_text))->form();
+ $form['avatar_driver']->select($type);
+
+ foreach ($data as $key => $value)
+ {
+ if (is_array($value))
+ {
+ $form[$key]->{$value[0]}($value[1]);
+ }
+ else
+ {
+ $form[$key]->setValue($value);
+ }
+ }
+
+ $crawler = self::submit($form);
+
+ if (is_array($expected))
+ {
+ $delete_expected = $expected[1];
+ $expected = $expected[0];
+ }
+
+ try
+ {
+ $this->assertContainsLang($expected, $crawler->text());
+ }
+ catch (Exception $e)
+ {
+ $this->assertContains($expected, $crawler->text());
+ }
+
+ if ($delete)
+ {
+ $form = $crawler->selectButton('confirm')->form();
+ $crawler = self::submit($form);
+ $this->assertContainsLang($delete_expected, $crawler->text());
+ }
+ }
+}
diff --git a/tests/functional/common_groups_test.php b/tests/functional/common_groups_test.php
deleted file mode 100644
index 427a930cb9..0000000000
--- a/tests/functional/common_groups_test.php
+++ /dev/null
@@ -1,93 +0,0 @@
-<?php
-/**
-*
-* @package testing
-* @copyright (c) 2013 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
-*
-*/
-
-/**
-* @group functional
-*/
-abstract class phpbb_functional_common_groups_test extends phpbb_functional_test_case
-{
- abstract protected function get_url();
-
- // Enable all avatars in the ACP
- protected function enable_all_avatars()
- {
- $this->add_lang('acp/board');
-
- $crawler = self::request('GET', 'adm/index.php?i=board&mode=avatar&sid=' . $this->sid);
- // Check the default entries we should have
- $this->assertContains($this->lang('ALLOW_REMOTE'), $crawler->text());
- $this->assertContains($this->lang('ALLOW_AVATARS'), $crawler->text());
- $this->assertContains($this->lang('ALLOW_LOCAL'), $crawler->text());
-
- // Now start setting the needed settings
- $form = $crawler->selectButton($this->lang('SUBMIT'))->form();
- $form['config[allow_avatar_local]']->select(1);
- $form['config[allow_avatar_remote]']->select(1);
- $form['config[allow_avatar_remote_upload]']->select(1);
- $crawler = self::submit($form);
- $this->assertContains($this->lang('CONFIG_UPDATED'), $crawler->text());
- }
-
- public function groups_manage_test_data()
- {
- return array(
- array('', 'GROUP_UPDATED'),
- array('aa0000', 'GROUP_UPDATED'),
-
- array('AAG000','WRONG_DATA_COLOUR'),
- array('#AA0000', 'WRONG_DATA_COLOUR'),
- );
- }
-
- /**
- * @dataProvider groups_manage_test_data
- */
- public function test_groups_manage($input, $expected)
- {
- $this->login();
- $this->admin_login();
- $this->add_lang(array('ucp', 'acp/groups'));
-
- // Manage Administrators group
- $crawler = self::request('GET', $this->get_url() . '&g=5&sid=' . $this->sid);
- $form = $crawler->selectButton($this->lang('SUBMIT'))->form();
- $form['group_colour']->setValue($input);
- $crawler = self::submit($form);
- $this->assertContains($this->lang($expected), $crawler->text());
- }
-
- public function group_avatar_min_max_data()
- {
- return array(
- array('uploadurl', 'foo', 'TOO_SHORT'),
- array('uploadurl', 'foobar', 'AVATAR_URL_INVALID'),
- array('uploadurl', str_repeat('f', 256), 'TOO_LONG'),
- array('remotelink', 'foo', 'TOO_SHORT'),
- array('remotelink', 'foobar', 'AVATAR_URL_INVALID'),
- array('remotelink', str_repeat('f', 256), 'TOO_LONG'),
- );
- }
-
- /**
- * @dataProvider group_avatar_min_max_data
- */
- public function test_group_avatar_min_max($form_name, $input, $expected)
- {
- $this->login();
- $this->admin_login();
- $this->add_lang(array('ucp', 'acp/groups'));
- $this->enable_all_avatars();
-
- $crawler = self::request('GET', $this->get_url() . '&g=5&sid=' . $this->sid);
- $form = $crawler->selectButton($this->lang('SUBMIT'))->form();
- $form[$form_name]->setValue($input);
- $crawler = self::submit($form);
- $this->assertContains($this->lang($expected), $crawler->text());
- }
-}
diff --git a/tests/functional/common_groups_test_case.php b/tests/functional/common_groups_test_case.php
new file mode 100644
index 0000000000..521b7c84d2
--- /dev/null
+++ b/tests/functional/common_groups_test_case.php
@@ -0,0 +1,117 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+/**
+* @group functional
+*/
+abstract class phpbb_functional_common_groups_test_case extends phpbb_functional_test_case
+{
+ abstract protected function get_url();
+
+ /**
+ * Get group_manage form
+ * @param int $group_id ID of the group that should be managed
+ */
+ protected function get_group_manage_form($group_id = 5)
+ {
+ // Manage Administrators group
+ $crawler = self::request('GET', $this->get_url() . "&g=$group_id&sid=" . $this->sid);
+ $form = $crawler->selectButton($this->lang('SUBMIT'))->form();
+ return $form;
+ }
+
+ /**
+ * Execute login calls and add_lang() calls for tests
+ */
+ protected function group_manage_login()
+ {
+ $this->login();
+ $this->admin_login();
+ $this->add_lang(array('ucp', 'acp/groups'));
+ }
+
+ // Enable all avatars in the ACP
+ protected function enable_all_avatars()
+ {
+ $this->add_lang('acp/board');
+
+ $crawler = self::request('GET', 'adm/index.php?i=board&mode=avatar&sid=' . $this->sid);
+ // Check the default entries we should have
+ $this->assertContains($this->lang('ALLOW_REMOTE_UPLOAD'), $crawler->text());
+ $this->assertContains($this->lang('ALLOW_AVATARS'), $crawler->text());
+ $this->assertContains($this->lang('ALLOW_LOCAL'), $crawler->text());
+
+ // Now start setting the needed settings
+ $form = $crawler->selectButton($this->lang('SUBMIT'))->form();
+ $form['config[allow_avatar_local]']->select(1);
+ $form['config[allow_avatar_remote]']->select(1);
+ $form['config[allow_avatar_remote_upload]']->select(1);
+ $crawler = self::submit($form);
+ $this->assertContains($this->lang('CONFIG_UPDATED'), $crawler->text());
+ }
+
+ public function groups_manage_test_data()
+ {
+ return array(
+ array('', 'GROUP_UPDATED'),
+ array('aa0000', 'GROUP_UPDATED'),
+
+ array('AAG000','WRONG_DATA_COLOUR'),
+ array('#AA0000', 'WRONG_DATA_COLOUR'),
+ );
+ }
+
+ /**
+ * @dataProvider groups_manage_test_data
+ */
+ public function test_groups_manage($input, $expected)
+ {
+ $this->group_manage_login();
+
+ // Manage Administrators group
+ $form = $this->get_group_manage_form();
+ $form['group_colour']->setValue($input);
+ $crawler = self::submit($form);
+ $this->assertContains($this->lang($expected), $crawler->text());
+ }
+
+ public function group_avatar_min_max_data()
+ {
+ return array(
+ array('avatar_driver_upload', 'avatar_upload_url', 'foo', 'AVATAR_URL_INVALID'),
+ array('avatar_driver_upload', 'avatar_upload_url', 'foobar', 'AVATAR_URL_INVALID'),
+ array('avatar_driver_upload', 'avatar_upload_url', 'http://www.phpbb.com/' . str_repeat('f', 240) . '.png', 'TOO_LONG'),
+ array('avatar_driver_remote', 'avatar_remote_url', 'foo', 'AVATAR_URL_INVALID'),
+ array('avatar_driver_remote', 'avatar_remote_url', 'foobar', 'AVATAR_URL_INVALID'),
+ array('avatar_driver_remote', 'avatar_remote_url', 'http://www.phpbb.com/' . str_repeat('f', 240) . '.png', 'TOO_LONG'),
+ );
+ }
+
+ /**
+ * @dataProvider group_avatar_min_max_data
+ */
+ public function test_group_avatar_min_max($avatar_type, $form_name, $input, $expected)
+ {
+ $this->login();
+ $this->admin_login();
+ $this->add_lang(array('ucp', 'acp/groups'));
+ $this->enable_all_avatars();
+
+ $crawler = self::request('GET', $this->get_url() . '&g=5&sid=' . $this->sid);
+ $form = $crawler->selectButton($this->lang('SUBMIT'))->form();
+ $form['avatar_driver']->setValue($avatar_type);
+ $form[$form_name]->setValue($input);
+ $crawler = self::submit($form);
+ $this->assertContains($this->lang($expected), $crawler->text());
+ }
+}
diff --git a/tests/functional/download_test.php b/tests/functional/download_test.php
new file mode 100644
index 0000000000..1e863210e6
--- /dev/null
+++ b/tests/functional/download_test.php
@@ -0,0 +1,296 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions_content.php';
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions_posting.php';
+require_once dirname(__FILE__) . '/../../phpBB/includes/utf/utf_tools.php';
+
+/**
+* @group functional
+*/
+class phpbb_functional_download_test extends phpbb_functional_test_case
+{
+ protected $data = array();
+
+ public function test_setup_forums()
+ {
+ $this->login();
+ $this->admin_login();
+
+ $crawler = self::request('GET', "adm/index.php?i=acp_forums&mode=manage&sid={$this->sid}");
+ $form = $crawler->selectButton('addforum')->form(array(
+ 'forum_name' => 'Download #1',
+ ));
+ $crawler = self::submit($form);
+ $form = $crawler->selectButton('update')->form(array(
+ 'forum_perm_from' => 2,
+ ));
+ $crawler = self::submit($form);
+ }
+
+ public function test_create_post()
+ {
+ $this->login();
+ $this->load_ids(array(
+ 'forums' => array(
+ 'Download #1',
+ ),
+ ));
+
+ // Test creating topic
+ $post = $this->create_topic($this->data['forums']['Download #1'], 'Download Topic #1', 'This is a test topic posted by the testing framework.', array('upload_files' => 1));
+ $crawler = self::request('GET', "viewtopic.php?t={$post['topic_id']}&sid={$this->sid}");
+
+ $this->assertContains('Download Topic #1', $crawler->filter('html')->text());
+ $this->data['topics']['Download Topic #1'] = (int) $post['topic_id'];
+ $this->data['posts']['Download Topic #1'] = (int) $this->get_parameter_from_link($crawler->filter('.post')->selectLink($this->lang('POST', '', ''))->link()->getUri(), 'p');
+
+ // Test creating a reply
+ $post2 = $this->create_post($this->data['forums']['Download #1'], $post['topic_id'], 'Re: Download Topic #1-#2', 'This is a test post posted by the testing framework.', array('upload_files' => 1));
+ $crawler = self::request('GET', "viewtopic.php?t={$post2['topic_id']}&sid={$this->sid}");
+
+ $this->assertContains('Re: Download Topic #1-#2', $crawler->filter('html')->text());
+ $this->data['posts']['Re: Download Topic #1-#2'] = (int) $post2['post_id'];
+ }
+
+ public function test_download_accessible()
+ {
+ if (!class_exists('finfo'))
+ {
+ $this->markTestSkipped('Unable to run test with fileinfo disabled');
+ }
+
+ $this->load_ids(array(
+ 'forums' => array(
+ 'Download #1',
+ ),
+ 'topics' => array(
+ 'Download Topic #1',
+ ),
+ 'posts' => array(
+ 'Download Topic #1',
+ 'Re: Download Topic #1-#2',
+ ),
+ 'attachments' => true,
+ ));
+
+ // Download attachment as guest
+ $crawler = self::request('GET', "download/file.php?id={$this->data['attachments'][$this->data['posts']['Re: Download Topic #1-#2']]}", array(), false);
+ self::assert_response_status_code(200);
+ $content = self::$client->getResponse()->getContent();
+ $finfo = new finfo(FILEINFO_MIME_TYPE);
+ self::assertEquals('image/jpeg', $finfo->buffer($content));
+ }
+
+ public function test_softdelete_post()
+ {
+ $this->login();
+ $this->load_ids(array(
+ 'forums' => array(
+ 'Download #1',
+ ),
+ 'topics' => array(
+ 'Download Topic #1',
+ ),
+ 'posts' => array(
+ 'Download Topic #1',
+ 'Re: Download Topic #1-#2',
+ ),
+ ));
+ $this->add_lang('posting');
+
+ $crawler = self::request('GET', "posting.php?mode=delete&f={$this->data['forums']['Download #1']}&p={$this->data['posts']['Re: Download Topic #1-#2']}&sid={$this->sid}");
+ $this->assertContainsLang('DELETE_PERMANENTLY', $crawler->text());
+
+ $form = $crawler->selectButton('Yes')->form();
+ $crawler = self::submit($form);
+ $this->assertContainsLang('POST_DELETED', $crawler->text());
+
+ $crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Download Topic #1']}&sid={$this->sid}");
+ $this->assertContains($this->lang('POST_DISPLAY', '', ''), $crawler->text());
+ }
+
+ public function test_download_softdeleted_post()
+ {
+ if (!class_exists('finfo'))
+ {
+ $this->markTestSkipped('Unable to run test with fileinfo disabled');
+ }
+
+ $this->load_ids(array(
+ 'forums' => array(
+ 'Download #1',
+ ),
+ 'topics' => array(
+ 'Download Topic #1',
+ ),
+ 'posts' => array(
+ 'Download Topic #1',
+ 'Re: Download Topic #1-#2',
+ ),
+ 'attachments' => true,
+ ));
+ $this->add_lang('viewtopic');
+
+ // No download attachment as guest
+ $crawler = self::request('GET', "download/file.php?id={$this->data['attachments'][$this->data['posts']['Re: Download Topic #1-#2']]}", array(), false);
+ self::assert_response_html(404);
+ $this->assertContainsLang('ERROR_NO_ATTACHMENT', $crawler->filter('#message')->text());
+
+ // Login as admin and try again, should work now.
+ $this->login();
+
+ // Download attachment as admin
+ $crawler = self::request('GET', "download/file.php?id={$this->data['attachments'][$this->data['posts']['Re: Download Topic #1-#2']]}", array(), false);
+ self::assert_response_status_code(200);
+ $content = self::$client->getResponse()->getContent();
+ $finfo = new finfo(FILEINFO_MIME_TYPE);
+ self::assertEquals('image/jpeg', $finfo->buffer($content));
+ }
+
+ public function test_softdelete_topic()
+ {
+ $this->login();
+ $this->load_ids(array(
+ 'forums' => array(
+ 'Download #1',
+ ),
+ 'topics' => array(
+ 'Download Topic #1',
+ ),
+ 'posts' => array(
+ 'Download Topic #1',
+ 'Re: Download Topic #1-#2',
+ ),
+ ));
+
+ $this->add_lang('posting');
+ $crawler = $this->get_quickmod_page($this->data['topics']['Download Topic #1'], 'DELETE_TOPIC');
+ $this->assertContainsLang('DELETE_PERMANENTLY', $crawler->text());
+
+ $this->add_lang('mcp');
+ $form = $crawler->selectButton('Yes')->form();
+ $crawler = self::submit($form);
+ $this->assertContainsLang('TOPIC_DELETED_SUCCESS', $crawler->text());
+
+ $crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Download Topic #1']}&sid={$this->sid}");
+ $this->assertContains('Download Topic #1', $crawler->filter('h2')->text());
+ }
+
+ public function test_download_softdeleted_topic()
+ {
+ if (!class_exists('finfo'))
+ {
+ $this->markTestSkipped('Unable to run test with fileinfo disabled');
+ }
+
+ $this->load_ids(array(
+ 'forums' => array(
+ 'Download #1',
+ ),
+ 'topics' => array(
+ 'Download Topic #1',
+ ),
+ 'posts' => array(
+ 'Download Topic #1',
+ 'Re: Download Topic #1-#2',
+ ),
+ 'attachments' => true,
+ ));
+ $this->add_lang('viewtopic');
+
+ // No download attachment as guest
+ $crawler = self::request('GET', "download/file.php?id={$this->data['attachments'][$this->data['posts']['Re: Download Topic #1-#2']]}", array(), false);
+ self::assert_response_html(404);
+ $this->assertContainsLang('ERROR_NO_ATTACHMENT', $crawler->filter('#message')->text());
+
+ // Login as admin and try again, should work now.
+ $this->login();
+
+ // Download attachment as admin
+ $crawler = self::request('GET', "download/file.php?id={$this->data['attachments'][$this->data['posts']['Re: Download Topic #1-#2']]}", array(), false);
+ self::assert_response_status_code(200);
+ $content = self::$client->getResponse()->getContent();
+ $finfo = new finfo(FILEINFO_MIME_TYPE);
+ self::assertEquals('image/jpeg', $finfo->buffer($content));
+ }
+
+ public function load_ids($data)
+ {
+ $this->db = $this->get_db();
+
+ if (!empty($data['forums']))
+ {
+ $sql = 'SELECT *
+ FROM phpbb_forums
+ WHERE ' . $this->db->sql_in_set('forum_name', $data['forums']);
+ $result = $this->db->sql_query($sql);
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ if (in_array($row['forum_name'], $data['forums']))
+ {
+ $this->data['forums'][$row['forum_name']] = (int) $row['forum_id'];
+ }
+ }
+ $this->db->sql_freeresult($result);
+ }
+
+ if (!empty($data['topics']))
+ {
+ $sql = 'SELECT *
+ FROM phpbb_topics
+ WHERE ' . $this->db->sql_in_set('topic_title', $data['topics']);
+ $result = $this->db->sql_query($sql);
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ if (in_array($row['topic_title'], $data['topics']))
+ {
+ $this->data['topics'][$row['topic_title']] = (int) $row['topic_id'];
+ }
+ }
+ $this->db->sql_freeresult($result);
+ }
+
+ $post_ids = array();
+ if (!empty($data['posts']))
+ {
+ $sql = 'SELECT *
+ FROM phpbb_posts
+ WHERE ' . $this->db->sql_in_set('post_subject', $data['posts']);
+ $result = $this->db->sql_query($sql);
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ if (in_array($row['post_subject'], $data['posts']))
+ {
+ $this->data['posts'][$row['post_subject']] = (int) $row['post_id'];
+ $post_ids[] = (int) $row['post_id'];
+ }
+ }
+ $this->db->sql_freeresult($result);
+
+ if (isset($data['attachments']))
+ {
+ $sql = 'SELECT *
+ FROM phpbb_attachments
+ WHERE in_message = 0 AND ' . $this->db->sql_in_set('post_msg_id', $post_ids);
+ $result = $this->db->sql_query($sql);
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $this->data['attachments'][(int) $row['post_msg_id']] = (int) $row['attach_id'];
+ }
+ $this->db->sql_freeresult($result);
+ }
+ }
+ }
+}
diff --git a/tests/functional/extension_acp_test.php b/tests/functional/extension_acp_test.php
new file mode 100644
index 0000000000..8a71a5ce04
--- /dev/null
+++ b/tests/functional/extension_acp_test.php
@@ -0,0 +1,237 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+/**
+* @group functional
+*/
+class phpbb_functional_extension_acp_test extends phpbb_functional_test_case
+{
+ static private $helper;
+
+ static protected $fixtures = array(
+ './',
+ );
+
+ static public function setUpBeforeClass()
+ {
+ parent::setUpBeforeClass();
+
+ self::$helper = new phpbb_test_case_helpers(self);
+ self::$helper->copy_ext_fixtures(dirname(__FILE__) . '/../extension/ext/', self::$fixtures);
+ }
+
+ static public function tearDownAfterClass()
+ {
+ parent::tearDownAfterClass();
+
+ self::$helper->restore_original_ext_dir();
+ }
+
+ public function setUp()
+ {
+ parent::setUp();
+
+ $this->purge_cache();
+
+ $this->get_db();
+
+ // Clear the phpbb_ext table
+ $this->db->sql_query('DELETE FROM phpbb_ext');
+
+ // Insert our base data
+ $insert_rows = array(
+ array(
+ 'ext_name' => 'vendor2/foo',
+ 'ext_active' => true,
+ 'ext_state' => 'b:0;',
+ ),
+ array(
+ 'ext_name' => 'vendor/moo',
+ 'ext_active' => false,
+ 'ext_state' => 'b:0;',
+ ),
+
+ // do not exist
+ array(
+ 'ext_name' => 'vendor/test2',
+ 'ext_active' => true,
+ 'ext_state' => 'b:0;',
+ ),
+ array(
+ 'ext_name' => 'vendor/test3',
+ 'ext_active' => false,
+ 'ext_state' => 'b:0;',
+ ),
+ );
+ $this->db->sql_multi_insert('phpbb_ext', $insert_rows);
+
+ $this->login();
+ $this->admin_login();
+
+ $this->add_lang('acp/extensions');
+ }
+
+ public function test_list()
+ {
+ $crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&sid=' . $this->sid);
+
+ $this->assertCount(1, $crawler->filter('.ext_enabled'));
+ $this->assertCount(6, $crawler->filter('.ext_disabled'));
+
+ $this->assertContains('phpBB Foo Extension', $crawler->filter('.ext_enabled')->eq(0)->text());
+ $this->assertContainsLang('EXTENSION_DISABLE', $crawler->filter('.ext_enabled')->eq(0)->text());
+
+ $this->assertContains('phpBB Moo Extension', $crawler->filter('.ext_disabled')->eq(2)->text());
+ $this->assertContainsLang('DETAILS', $crawler->filter('.ext_disabled')->eq(2)->text());
+ $this->assertContainsLang('EXTENSION_ENABLE', $crawler->filter('.ext_disabled')->eq(2)->text());
+ $this->assertContainsLang('EXTENSION_DELETE_DATA', $crawler->filter('.ext_disabled')->eq(2)->text());
+
+ $this->assertContains('The “vendor/test2” extension is not valid.', $crawler->filter('.ext_disabled')->eq(0)->text());
+
+ $this->assertContains('The “vendor/test3” extension is not valid.', $crawler->filter('.ext_disabled')->eq(1)->text());
+
+ $this->assertContains('phpBB Bar Extension', $crawler->filter('.ext_disabled')->eq(3)->text());
+ $this->assertContainsLang('DETAILS', $crawler->filter('.ext_disabled')->eq(3)->text());
+ $this->assertContainsLang('EXTENSION_ENABLE', $crawler->filter('.ext_disabled')->eq(3)->text());
+
+ // Check that invalid extensions are not listed.
+ $this->assertNotContains('phpBB BarFoo Extension', $crawler->filter('.table1')->text());
+ $this->assertNotContains('barfoo', $crawler->filter('.table1')->text());
+
+ $this->assertNotContains('vendor3/bar', $crawler->filter('.table1')->text());
+ }
+
+ public function test_details()
+ {
+ $crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=details&ext_name=vendor2%2Ffoo&sid=' . $this->sid);
+
+ $validation = array(
+ 'DISPLAY_NAME' => 'phpBB Foo Extension',
+ 'CLEAN_NAME' => 'vendor2/foo',
+ 'TYPE' => 'phpbb-extension',
+ 'DESCRIPTION' => 'An example/sample extension to be used for testing purposes in phpBB Development.',
+ 'VERSION' => '1.0.0',
+ 'TIME' => '2012-02-15 01:01:01',
+ 'LICENSE' => 'GPL-2.0',
+ 'PHPBB_VERSION' => '3.1.*@dev',
+ 'PHP_VERSION' => '>=5.3',
+ 'AUTHOR_NAME' => 'John Smith',
+ 'AUTHOR_EMAIL' => 'email@phpbb.com',
+ 'AUTHOR_HOMEPAGE' => 'http://phpbb.com',
+ 'AUTHOR_ROLE' => 'N/A',
+ );
+
+ for ($i = 0; $i < $crawler->filter('dl')->count(); $i++)
+ {
+ $text = $crawler->filter('dl')->eq($i)->text();
+
+ $match = false;
+
+ foreach ($validation as $language_key => $expected)
+ {
+ if (strpos($text, $this->lang($language_key)) === 0)
+ {
+ $match = true;
+
+ $this->assertContains($expected, $text);
+ }
+ }
+
+ if (!$match)
+ {
+ $this->fail('Unexpected field: "' . $text . '"');
+ }
+ }
+ }
+
+ public function test_enable_pre()
+ {
+ // Foo is already enabled (redirect to list)
+ $crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=enable_pre&ext_name=vendor2%2Ffoo&sid=' . $this->sid);
+ $this->assertContainsLang('EXTENSION_NAME', $crawler->filter('div.main thead')->text());
+ $this->assertContainsLang('EXTENSION_OPTIONS', $crawler->filter('div.main thead')->text());
+ $this->assertContainsLang('EXTENSION_ACTIONS', $crawler->filter('div.main thead')->text());
+
+ $crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=enable_pre&ext_name=vendor%2Fmoo&sid=' . $this->sid);
+ $this->assertContains($this->lang('EXTENSION_ENABLE_CONFIRM', 'phpBB Moo Extension'), $crawler->filter('#main')->text());
+
+ // Correctly submit the enable form
+ $crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=enable_pre&ext_name=vendor3%2Ffoo&sid=' . $this->sid);
+ $this->assertContainsLang('EXTENSION_NOT_ENABLEABLE', $crawler->filter('.errorbox')->text());
+ }
+
+ public function test_disable_pre()
+ {
+ // Moo is not enabled (redirect to list)
+ $crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=disable_pre&ext_name=vendor%2Fmoo&sid=' . $this->sid);
+ $this->assertContainsLang('EXTENSION_NAME', $crawler->filter('div.main thead')->text());
+ $this->assertContainsLang('EXTENSION_OPTIONS', $crawler->filter('div.main thead')->text());
+ $this->assertContainsLang('EXTENSION_ACTIONS', $crawler->filter('div.main thead')->text());
+
+ $crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=disable_pre&ext_name=vendor2%2Ffoo&sid=' . $this->sid);
+ $this->assertContains($this->lang('EXTENSION_DISABLE_CONFIRM', 'phpBB Foo Extension'), $crawler->filter('#main')->text());
+ }
+
+ public function test_delete_data_pre()
+ {
+ // test2 is not available (error)
+ $crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=delete_data_pre&ext_name=test2&sid=' . $this->sid);
+ $this->assertContains($this->lang('FILE_NOT_FOUND', ''), $crawler->filter('.errorbox')->text());
+
+ // foo is not disabled (redirect to list)
+ $crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=delete_data_pre&ext_name=vendor2%2Ffoo&sid=' . $this->sid);
+ $this->assertContainsLang('EXTENSION_NAME', $crawler->filter('div.main thead')->text());
+ $this->assertContainsLang('EXTENSION_OPTIONS', $crawler->filter('div.main thead')->text());
+ $this->assertContainsLang('EXTENSION_ACTIONS', $crawler->filter('div.main thead')->text());
+
+ $crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=delete_data_pre&ext_name=vendor%2Fmoo&sid=' . $this->sid);
+ $this->assertContains('Are you sure that you wish to delete the data associated with “phpBB Moo Extension”?', $crawler->filter('.errorbox')->text());
+ }
+
+ public function test_actions()
+ {
+ // Access enable page without hash
+ $crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=enable&ext_name=vendor%2Fmoo&sid=' . $this->sid);
+ $this->assertContainsLang('FORM_INVALID', $crawler->filter('.errorbox')->text());
+
+ // Correctly submit the enable form
+ $crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=enable_pre&ext_name=vendor%2Fmoo&sid=' . $this->sid);
+ $form = $crawler->selectButton('enable')->form();
+ $crawler = self::submit($form);
+ $this->assertContainsLang('EXTENSION_ENABLE_SUCCESS', $crawler->filter('.successbox')->text());
+
+ // Access disable page without hash
+ $crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=disable&ext_name=vendor%2Fmoo&sid=' . $this->sid);
+ $this->assertContainsLang('FORM_INVALID', $crawler->filter('.errorbox')->text());
+
+ // Correctly submit the disable form
+ $crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=disable_pre&ext_name=vendor%2Fmoo&sid=' . $this->sid);
+ $form = $crawler->selectButton('disable')->form();
+ $crawler = self::submit($form);
+ $this->assertContainsLang('EXTENSION_DISABLE_SUCCESS', $crawler->filter('.successbox')->text());
+
+ // Access delete_data page without hash
+ $crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=delete_data&ext_name=vendor%2Fmoo&sid=' . $this->sid);
+ $this->assertContainsLang('FORM_INVALID', $crawler->filter('.errorbox')->text());
+
+ // Correctly submit the delete data form
+ $crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=delete_data_pre&ext_name=vendor%2Fmoo&sid=' . $this->sid);
+ $form = $crawler->selectButton('delete_data')->form();
+ $crawler = self::submit($form);
+ $this->assertContainsLang('EXTENSION_DELETE_DATA_SUCCESS', $crawler->filter('.successbox')->text());
+
+ // Attempt to enable invalid extension
+ $crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=enable_pre&ext_name=barfoo&sid=' . $this->sid);
+ $this->assertContainsLang('EXTENSION_DIR_INVALID', $crawler->filter('.errorbox')->text());
+ }
+}
diff --git a/tests/functional/extension_controller_test.php b/tests/functional/extension_controller_test.php
new file mode 100644
index 0000000000..18eb9ad4c6
--- /dev/null
+++ b/tests/functional/extension_controller_test.php
@@ -0,0 +1,181 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+/**
+* @group functional
+*/
+class phpbb_functional_extension_controller_test extends phpbb_functional_test_case
+{
+ protected $phpbb_extension_manager;
+
+ static private $helper;
+
+ static protected $fixtures = array(
+ 'foo/bar/config/',
+ 'foo/bar/controller/',
+ 'foo/bar/event/',
+ 'foo/bar/language/en/',
+ 'foo/bar/styles/prosilver/template/',
+ 'foo/foo/config/',
+ 'foo/foo/controller/',
+ );
+
+ static public function setUpBeforeClass()
+ {
+ parent::setUpBeforeClass();
+
+ self::$helper = new phpbb_test_case_helpers(self);
+ self::$helper->copy_ext_fixtures(dirname(__FILE__) . '/fixtures/ext/', self::$fixtures);
+ }
+
+ static public function tearDownAfterClass()
+ {
+ parent::tearDownAfterClass();
+
+ self::$helper->restore_original_ext_dir();
+ }
+
+ public function setUp()
+ {
+ parent::setUp();
+
+ $this->phpbb_extension_manager = $this->get_extension_manager();
+
+ $this->purge_cache();
+ }
+
+ /**
+ * Check a controller for extension foo/bar.
+ */
+ public function test_foo_bar()
+ {
+ $this->phpbb_extension_manager->enable('foo/bar');
+ $crawler = self::request('GET', 'app.php/foo/bar', array(), false);
+ self::assert_response_status_code();
+ $this->assertContains("foo/bar controller handle() method", $crawler->filter('body')->text());
+ $this->phpbb_extension_manager->purge('foo/bar');
+ }
+
+ /**
+ * Check a controller for extension foo/bar.
+ */
+ public function test_routing_resources()
+ {
+ $this->phpbb_extension_manager->enable('foo/foo');
+ $crawler = self::request('GET', 'app.php/foo/foo', array(), false);
+ self::assert_response_status_code();
+ $this->assertContains("foo/foo controller handle() method", $crawler->filter('body')->text());
+ $this->phpbb_extension_manager->purge('foo/foo');
+ }
+
+ /**
+ * Check the output of a controller using the template system
+ */
+ public function test_controller_with_template()
+ {
+ $this->phpbb_extension_manager->enable('foo/bar');
+ $crawler = self::request('GET', 'app.php/foo/template');
+ $this->assertContains("I am a variable", $crawler->filter('#content')->text());
+ $this->phpbb_extension_manager->purge('foo/bar');
+ }
+
+ /**
+ * Check the error produced by calling a controller without a required
+ * argument.
+ */
+ public function test_missing_argument()
+ {
+ $this->phpbb_extension_manager->enable('foo/bar');
+ $crawler = self::request('GET', 'app.php/foo/baz', array(), false);
+ $this->assert_response_html(500);
+ $this->assertContains('Missing value for argument #1: test in class foo\bar\controller\controller:baz', $crawler->filter('body')->text());
+ $this->phpbb_extension_manager->purge('foo/bar');
+ }
+
+ /**
+ * Check the status code resulting from an exception thrown by a controller
+ */
+ public function test_exception_should_result_in_500_status_code()
+ {
+ $this->phpbb_extension_manager->enable('foo/bar');
+ $crawler = self::request('GET', 'app.php/foo/exception', array(), false);
+ $this->assert_response_html(500);
+ $this->assertContains('Exception thrown from foo/exception route', $crawler->filter('body')->text());
+ $this->phpbb_extension_manager->purge('foo/bar');
+ }
+
+ /**
+ * Check the error produced by extension at ./ext/does/not/exist.
+ *
+ * If an extension is disabled, its routes are not loaded. Because we
+ * are not looking for a controller based on a specified extension,
+ * we don't know the difference between a route in a disabled
+ * extension and a route that is not defined anyway; it is the same
+ * error message.
+ */
+ public function test_error_ext_disabled_or_404()
+ {
+ $crawler = self::request('GET', 'app.php/does/not/exist', array(), false);
+ $this->assert_response_html(404);
+ $this->assertContains('No route found for "GET /does/not/exist"', $crawler->filter('body')->text());
+ }
+
+ /**
+ * Check the redirect after using the login_box() form
+ */
+ public function test_login_redirect()
+ {
+ $this->markTestIncomplete('Session table contains incorrect data for controllers on travis,'
+ . 'therefor the redirect fails.');
+
+ $this->phpbb_extension_manager->enable('foo/bar');
+ $crawler = self::request('GET', 'app.php/foo/login_redirect');
+ $this->assertContainsLang('LOGIN', $crawler->filter('h2')->text());
+ $form = $crawler->selectButton('login')->form(array(
+ 'username' => 'admin',
+ 'password' => 'adminadmin',
+ ));
+ $this->assertStringStartsWith('./app.php/foo/login_redirect', $form->get('redirect')->getValue());
+
+ $crawler = self::submit($form);
+ $this->assertContains("I am a variable", $crawler->filter('#content')->text(), 'Unsuccessful redirect after using login_box()');
+ $this->phpbb_extension_manager->purge('foo/bar');
+ }
+
+ /**
+ * Check the output of a controller using the template system
+ */
+ public function test_redirect()
+ {
+ $this->phpbb_extension_manager->enable('foo/bar');
+ $crawler = self::request('GET', 'app.php/foo/redirect');
+
+ $nodes = $crawler->filter('div')->extract(array('id'));
+
+ foreach ($nodes as $redirect)
+ {
+ if (strpos($redirect, 'redirect_expected') !== 0)
+ {
+ continue;
+ }
+
+ $row_num = str_replace('redirect_expected_', '', $redirect);
+
+ $redirect = $crawler->filter('#redirect_' . $row_num)->text();
+ $redirect = substr($redirect, 0, strpos($redirect, 'sid') - 1);
+ $this->assertEquals($crawler->filter('#redirect_expected_' . $row_num)->text(), $redirect);
+ }
+
+ $this->phpbb_extension_manager->purge('foo/bar');
+ }
+}
diff --git a/tests/functional/extension_global_lang_test.php b/tests/functional/extension_global_lang_test.php
new file mode 100644
index 0000000000..f615114c08
--- /dev/null
+++ b/tests/functional/extension_global_lang_test.php
@@ -0,0 +1,75 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+/**
+* @group functional
+*/
+class phpbb_functional_extension_global_lang_test extends phpbb_functional_test_case
+{
+ protected $phpbb_extension_manager;
+
+ static private $helper;
+
+ static protected $fixtures = array(
+ 'foo/bar/config/',
+ 'foo/bar/event/',
+ 'foo/bar/language/en/',
+ );
+
+ static public function setUpBeforeClass()
+ {
+ parent::setUpBeforeClass();
+
+ self::$helper = new phpbb_test_case_helpers(self);
+ self::$helper->copy_ext_fixtures(dirname(__FILE__) . '/fixtures/ext/', self::$fixtures);
+ }
+
+ static public function tearDownAfterClass()
+ {
+ parent::tearDownAfterClass();
+
+ self::$helper->restore_original_ext_dir();
+ }
+
+ public function setUp()
+ {
+ parent::setUp();
+
+ $this->get_db();
+
+ $this->phpbb_extension_manager = $this->get_extension_manager();
+
+ $this->purge_cache();
+ }
+
+ public function tearDown()
+ {
+ parent::tearDown();
+
+ $this->purge_cache();
+ }
+
+ public function test_load_extension_lang_globally()
+ {
+ $this->phpbb_extension_manager->enable('foo/bar');
+
+ // The board index, which should contain an overwritten translation
+ $crawler = self::request('GET', 'index.php');
+
+ // language from language/en/common.php
+ $this->assertNotContains('Skip to content', $crawler->filter('.skiplink')->text());
+
+ // language from ext/foo/bar/language/en/foo_global.php
+ $this->assertContains('Overwritten by foo', $crawler->filter('.skiplink')->text());
+ }
+}
diff --git a/tests/functional/extension_module_test.php b/tests/functional/extension_module_test.php
new file mode 100644
index 0000000000..ee084720e4
--- /dev/null
+++ b/tests/functional/extension_module_test.php
@@ -0,0 +1,136 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+require_once dirname(__FILE__) . '/../../phpBB/includes/acp/acp_modules.php';
+
+/**
+* @group functional
+*/
+class phpbb_functional_extension_module_test extends phpbb_functional_test_case
+{
+ protected $phpbb_extension_manager;
+
+ static private $helper;
+
+ static protected $fixtures = array(
+ './',
+ );
+
+ static public function setUpBeforeClass()
+ {
+ parent::setUpBeforeClass();
+
+ self::$helper = new phpbb_test_case_helpers(self);
+ self::$helper->copy_ext_fixtures(dirname(__FILE__) . '/fixtures/ext/', self::$fixtures);
+ }
+
+ static public function tearDownAfterClass()
+ {
+ parent::tearDownAfterClass();
+
+ self::$helper->restore_original_ext_dir();
+ }
+
+ public function setUp()
+ {
+ global $db;
+
+ parent::setUp();
+
+ $this->phpbb_extension_manager = $this->get_extension_manager();
+ $this->phpbb_extension_manager->enable('foo/bar');
+
+ $modules = new acp_modules();
+ $db = $this->get_db();
+
+ $sql = 'SELECT module_id
+ FROM ' . MODULES_TABLE . "
+ WHERE module_langname = 'acp'
+ AND module_class = 'ACP_CAT_DOT_MODS'";
+ $result = $db->sql_query($sql);
+ $module_id = (int) $db->sql_fetchfield('module_id');
+ $db->sql_freeresult($result);
+
+ $parent_data = array(
+ 'module_basename' => '',
+ 'module_enabled' => 1,
+ 'module_display' => 1,
+ 'parent_id' => $module_id,
+ 'module_class' => 'acp',
+ 'module_langname' => 'ACP_FOOBAR_TITLE',
+ 'module_mode' => '',
+ 'module_auth' => '',
+ );
+ $modules->update_module_data($parent_data, true);
+
+ $module_data = array(
+ 'module_basename' => 'foo\\bar\\acp\\main_module',
+ 'module_enabled' => 1,
+ 'module_display' => 1,
+ 'parent_id' => $parent_data['module_id'],
+ 'module_class' => 'acp',
+ 'module_langname' => 'ACP_FOOBAR_TITLE',
+ 'module_mode' => 'mode',
+ 'module_auth' => '',
+ );
+ $modules->update_module_data($module_data, true);
+
+ $parent_data = array(
+ 'module_basename' => '',
+ 'module_enabled' => 1,
+ 'module_display' => 1,
+ 'parent_id' => 0,
+ 'module_class' => 'ucp',
+ 'module_langname' => 'UCP_FOOBAR_TITLE',
+ 'module_mode' => '',
+ 'module_auth' => '',
+ );
+ $modules->update_module_data($parent_data, true);
+
+ $module_data = array(
+ 'module_basename' => 'foo\\bar\\ucp\\main_module',
+ 'module_enabled' => 1,
+ 'module_display' => 1,
+ 'parent_id' => $parent_data['module_id'],
+ 'module_class' => 'ucp',
+ 'module_langname' => 'UCP_FOOBAR_TITLE',
+ 'module_mode' => 'mode',
+ 'module_auth' => '',
+ );
+ $modules->update_module_data($module_data, true);
+
+ $this->purge_cache();
+ }
+
+ public function test_acp()
+ {
+ $this->login();
+ $this->admin_login();
+
+ $crawler = self::request('GET', 'adm/index.php?i=foo%5cbar%5cacp%5cmain_module&mode=mode&sid=' . $this->sid);
+ $this->assertContains('Bertie rulez!', $crawler->filter('#main')->text());
+ }
+
+ public function test_ucp()
+ {
+ $this->login();
+
+ $crawler = self::request('GET', 'ucp.php?sid=' . $this->sid);
+ $this->assertContains('UCP_FOOBAR_TITLE', $crawler->filter('#tabs')->text());
+
+ $link = $crawler->selectLink('UCP_FOOBAR_TITLE')->link()->getUri();
+ $crawler = self::request('GET', substr($link, strpos($link, 'ucp.')));
+ $this->assertContains('UCP Extension Template Test Passed!', $crawler->filter('#content')->text());
+
+ $this->phpbb_extension_manager->purge('foo/bar');
+ }
+}
diff --git a/tests/functional/extension_permission_lang_test.php b/tests/functional/extension_permission_lang_test.php
new file mode 100644
index 0000000000..92d8d596c7
--- /dev/null
+++ b/tests/functional/extension_permission_lang_test.php
@@ -0,0 +1,86 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+/**
+* @group functional
+*/
+class phpbb_functional_extension_permission_lang_test extends phpbb_functional_test_case
+{
+ protected $phpbb_extension_manager;
+
+ static private $helper;
+
+ static protected $fixtures = array(
+ 'foo/bar/config/',
+ 'foo/bar/event/',
+ 'foo/bar/language/en/',
+ );
+
+ static public function setUpBeforeClass()
+ {
+ parent::setUpBeforeClass();
+
+ self::$helper = new phpbb_test_case_helpers(self);
+ self::$helper->copy_ext_fixtures(dirname(__FILE__) . '/fixtures/ext/', self::$fixtures);
+ }
+
+ static public function tearDownAfterClass()
+ {
+ parent::tearDownAfterClass();
+
+ self::$helper->restore_original_ext_dir();
+ }
+
+ public function setUp()
+ {
+ parent::setUp();
+
+ $this->get_db();
+
+ $acl_ary = array(
+ 'auth_option' => 'u_foo',
+ 'is_global' => 1,
+ );
+
+ $sql = 'INSERT INTO phpbb_acl_options ' . $this->db->sql_build_array('INSERT', $acl_ary);
+ $this->db->sql_query($sql);
+
+ $this->phpbb_extension_manager = $this->get_extension_manager();
+
+ $this->purge_cache();
+
+ $this->login();
+ $this->admin_login();
+ $this->add_lang('acp/permissions');
+ }
+
+ public function test_auto_include_permission_lang_from_extensions()
+ {
+ $this->phpbb_extension_manager->enable('foo/bar');
+
+ // User permissions
+ $crawler = self::request('GET', 'adm/index.php?i=acp_permissions&icat=16&mode=setting_user_global&sid=' . $this->sid);
+
+ // Select admin
+ $form = $crawler->selectButton($this->lang('SUBMIT'))->form();
+ $data = array('username[0]' => 'admin');
+ $form->setValues($data);
+ $crawler = self::submit($form);
+
+ // language from language/en/acp/permissions_phpbb.php
+ $this->assertContains('Can attach files', $crawler->filter('body')->text());
+
+ // language from ext/foo/bar/language/en/permissions_foo.php
+ $this->assertContains('Can view foobar', $crawler->filter('body')->text());
+ }
+}
diff --git a/tests/functional/feed_test.php b/tests/functional/feed_test.php
new file mode 100644
index 0000000000..e48dfc043a
--- /dev/null
+++ b/tests/functional/feed_test.php
@@ -0,0 +1,1503 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+/**
+* @group functional
+*/
+class phpbb_functional_feed_test extends phpbb_functional_test_case
+{
+ protected $data = array();
+
+ static public $init_values = array();
+
+ public function setUp()
+ {
+ parent::setUp();
+ $this->purge_cache();
+ }
+
+ public function __construct($name = null, array $data = array(), $dataName = '')
+ {
+ parent::__construct($name, $data, $dataName);
+
+ $this->backupStaticAttributesBlacklist += array(
+ 'phpbb_functional_feed_test' => array('init_values'),
+ );
+ }
+
+ public function test_setup_config_before_state()
+ {
+ $this->login();
+ $this->admin_login();
+
+ $crawler = self::request('GET', "adm/index.php?sid={$this->sid}&i=acp_board&mode=feed");
+
+ $form = $crawler->selectButton('Submit')->form();
+ $values = $form->getValues();
+
+ self::$init_values['post_base_items'] = (int) $values['config[feed_limit_post]'];
+ self::$init_values['topic_base_items'] = (int) $values['config[feed_limit_topic]'];
+
+ // Enable all feeds
+ $values['config[feed_enable]'] = true;
+ $values['config[feed_forum]'] = true;
+ $values['config[feed_item_statistics]'] = true;
+ $values['config[feed_overall]'] = true;
+ $values['config[feed_overall_forums]'] = true;
+ $values['config[feed_topic]'] = true;
+ $values['config[feed_topics_active]'] = true;
+ $values['config[feed_topics_new]'] = true;
+
+ $form->setValues($values);
+
+ $crawler = self::submit($form);
+ $this->assertContainsLang('CONFIG_UPDATED', $crawler->filter('.successbox')->text());
+
+ // Special config (Guest can't see attachments)
+ $this->add_lang('acp/permissions');
+
+ $crawler = self::request('GET', "adm/index.php?i=acp_permissions&sid={$this->sid}&icat=16&mode=setting_group_global&group_id[0]=1");
+ $this->assertContains($this->lang('ACL_SET'), $crawler->filter('h1')->eq(1)->text());
+
+ $form = $crawler->selectButton($this->lang('APPLY_PERMISSIONS'))->form();
+ $form['setting[1][0][u_download]']->select(-1);
+
+ $crawler = self::submit($form);
+ $this->assertContainsLang('AUTH_UPDATED', $crawler->filter('.successbox')->text());
+ }
+
+ public function test_dump_board_state()
+ {
+ $crawler = self::request('GET', 'feed.php?mode=forums', array(), false);
+ self::assert_response_xml();
+ self::$init_values['disapprove_user']['forums_value'] = $crawler->filterXPath('//entry')->count();
+
+ $crawler = self::request('GET', 'feed.php?mode=overall', array(), false);
+ self::assert_response_xml();
+ self::$init_values['disapprove_user']['overall_value'] = $crawler->filterXPath('//entry')->count();
+
+ $crawler = self::request('GET', 'feed.php?mode=topics', array(), false);
+ self::assert_response_xml();
+ self::$init_values['disapprove_user']['topics_value'] = $crawler->filterXPath('//entry')->count();
+
+ $crawler = self::request('GET', 'feed.php?mode=topics_new', array(), false);
+ self::assert_response_xml();
+ self::$init_values['disapprove_user']['topics_new_value'] = $crawler->filterXPath('//entry')->count();
+
+ $crawler = self::request('GET', 'feed.php?mode=topics_active', array(), false);
+ self::assert_response_xml();
+ self::$init_values['disapprove_user']['topics_active_value'] = $crawler->filterXPath('//entry')->count();
+
+ $this->login();
+
+ $crawler = self::request('GET', 'feed.php?mode=forums', array(), false);
+ self::assert_response_xml();
+ self::$init_values['admin']['forums_value'] = $crawler->filterXPath('//entry')->count();
+
+ $crawler = self::request('GET', 'feed.php?mode=overall', array(), false);
+ self::assert_response_xml();
+ self::$init_values['admin']['overall_value'] = $crawler->filterXPath('//entry')->count();
+
+ $crawler = self::request('GET', 'feed.php?mode=topics', array(), false);
+ self::assert_response_xml();
+ self::$init_values['admin']['topics_value'] = $crawler->filterXPath('//entry')->count();
+
+ $crawler = self::request('GET', 'feed.php?mode=topics_new', array(), false);
+ self::assert_response_xml();
+ self::$init_values['admin']['topics_new_value'] = $crawler->filterXPath('//entry')->count();
+
+ $crawler = self::request('GET', 'feed.php?mode=topics_active', array(), false);
+ self::assert_response_xml();
+ self::$init_values['admin']['topics_active_value'] = $crawler->filterXPath('//entry')->count();
+
+
+ }
+
+ public function test_setup_forums()
+ {
+ $this->login();
+ $this->admin_login();
+ $this->create_user('disapprove_user');
+ $this->add_user_group('NEWLY_REGISTERED', array('disapprove_user'));
+
+ $crawler = self::request('GET', "adm/index.php?i=acp_forums&mode=manage&sid={$this->sid}");
+ $form = $crawler->selectButton('addforum')->form(array(
+ 'forum_name' => 'Feeds #1',
+ ));
+ $crawler = self::submit($form);
+ $form = $crawler->selectButton('update')->form(array(
+ 'forum_perm_from' => 2,
+ ));
+ $crawler = self::submit($form);
+
+ $this->load_ids(array(
+ 'forums' => array(
+ 'Feeds #1',
+ ),
+ ));
+
+ // 'Feeds #1.1' is a sub-forum of 'Feeds #1'
+ $crawler = self::request('GET', "adm/index.php?i=acp_forums&sid={$this->sid}&icat=6&mode=manage&parent_id={$this->data['forums']['Feeds #1']}");
+ $form = $crawler->selectButton('addforum')->form(array(
+ 'forum_name' => 'Feeds #1.1',
+ ));
+ $crawler = self::submit($form);
+ $form = $crawler->selectButton('update')->form(array(
+ 'forum_perm_from' => 2,
+ ));
+ $crawler = self::submit($form);
+
+ // 'Feeds #news' will be used for feed.php?mode=news
+ $crawler = self::request('GET', "adm/index.php?i=acp_forums&mode=manage&sid={$this->sid}");
+ $form = $crawler->selectButton('addforum')->form(array(
+ 'forum_name' => 'Feeds #news',
+ ));
+ $crawler = self::submit($form);
+ $form = $crawler->selectButton('update')->form(array(
+ 'forum_perm_from' => 2,
+ ));
+ $crawler = self::submit($form);
+
+ // 'Feeds #exclude' will not be displayed on feed.php?mode=forums
+ $crawler = self::request('GET', "adm/index.php?i=acp_forums&mode=manage&sid={$this->sid}");
+ $form = $crawler->selectButton('addforum')->form(array(
+ 'forum_name' => 'Feeds #exclude',
+ ));
+ $crawler = self::submit($form);
+ $form = $crawler->selectButton('update')->form(array(
+ 'forum_perm_from' => 2,
+ ));
+ $crawler = self::submit($form);
+ }
+
+ public function test_setup_config_after_forums()
+ {
+ $this->login();
+ $this->admin_login();
+
+ $this->load_ids(array(
+ 'forums' => array(
+ 'Feeds #news',
+ 'Feeds #exclude',
+ ),
+ ));
+
+ $crawler = self::request('GET', "adm/index.php?sid={$this->sid}&i=acp_board&mode=feed");
+
+ $form = $crawler->selectButton('Submit')->form();
+
+ // News/Exclude's forums config
+ $form['feed_news_id']->select(array($this->data['forums']['Feeds #news']));
+ $form['feed_exclude_id']->select(array($this->data['forums']['Feeds #exclude']));
+
+ $crawler = self::submit($form);
+ $this->assertContainsLang('CONFIG_UPDATED', $crawler->filter('.successbox')->text());
+ }
+
+ public function test_feeds_empty()
+ {
+ $this->load_ids(array(
+ 'forums' => array(
+ 'Feeds #1',
+ 'Feeds #1.1',
+ ),
+ ));
+
+ // Excluded forums (and topics under them) shouldn't be displayed in feeds
+ $this->assert_feeds(array(
+ 'f' => array(
+ array(
+ 'id' => $this->data['forums']['Feeds #1'],
+ 'nb_entries' => 0,
+ ),
+ array(
+ 'id' => $this->data['forums']['Feeds #1.1'],
+ 'nb_entries' => 0,
+ ),
+ ),
+ 'forums' => array(
+ array(
+ 'nb_entries' => 3,
+ 'xpath' => array(
+ '//entry/category[@label="Feeds #exclude"]' => 0,
+ ),
+ ),
+ ),
+ 'news' => array(
+ array(
+ 'nb_entries' => 0,
+ ),
+ ),
+ ), 'admin');
+ }
+
+ public function test_create_exclude_topic()
+ {
+ $this->login();
+ $this->load_ids(array(
+ 'forums' => array(
+ 'Feeds #exclude',
+ ),
+ ));
+
+ $post = $this->create_topic($this->data['forums']['Feeds #exclude'], 'Feeds #exclude - Topic #1', 'This is a test topic posted by the testing framework.');
+ $this->data['topics']['Feeds #exclude - Topic #1'] = (int) $post['topic_id'];
+ }
+
+ public function test_feeds_exclude()
+ {
+ $this->load_ids(array(
+ 'forums' => array(
+ 'Feeds #exclude',
+ ),
+ 'topics' => array(
+ 'Feeds #exclude - Topic #1',
+ ),
+ ));
+
+ // Assert that feeds aren't available for excluded forums
+ $this->assert_feeds(array(
+ 'f' => array(
+ array(
+ 'id' => $this->data['forums']['Feeds #exclude'],
+ 'contents_lang' => array('NO_FEED'),
+ 'invalid' => true,
+ ),
+ ),
+ 't' => array(
+ array(
+ 'id' => $this->data['topics']['Feeds #exclude - Topic #1'],
+ 'contents_lang' => array('NO_FEED'),
+ 'invalid' => true,
+ ),
+ ),
+ 'overall' => array(
+ array(
+ 'nb_entries' => 0,
+ 'xpath' => array(
+ '//entry/title[contains(., "#exclude")]' => 0,
+ ),
+ ),
+ ),
+ 'topics' => array(
+ array(
+ 'nb_entries' => 0,
+ 'xpath' => array(
+ '//entry/title[contains(., "#exclude")]' => 0,
+ ),
+ ),
+ ),
+ 'topics_new' => array(
+ array(
+ 'nb_entries' => 0,
+ 'xpath' => array(
+ '//entry/title[contains(., "#exclude")]' => 0,
+ ),
+ ),
+ ),
+ 'topics_active' => array(
+ array(
+ 'nb_entries' => 0,
+ 'xpath' => array(
+ '//entry/title[contains(., "#exclude")]' => 0,
+ ),
+ ),
+ ),
+ ), 'admin');
+ }
+
+ public function test_create_news_topics()
+ {
+ $this->login();
+ $this->load_ids(array(
+ 'forums' => array(
+ 'Feeds #news',
+ ),
+ ));
+
+ $post = $this->create_topic($this->data['forums']['Feeds #news'], 'Feeds #news - Topic #1', 'This is a test topic posted by the testing framework.');
+ $this->data['topics']['Feeds #news - Topic #1'] = (int) $post['topic_id'];
+
+ $post = $this->create_topic($this->data['forums']['Feeds #news'], 'Feeds #news - Topic #2', 'This is a test topic posted by the testing framework.');
+ $crawler = self::request('GET', "viewtopic.php?t={$post['topic_id']}&sid={$this->sid}");
+
+ $this->assertContains('Feeds #news - Topic #2', $crawler->filter('html')->text());
+ $this->data['topics']['Feeds #news - Topic #2'] = (int) $post['topic_id'];
+ $this->data['posts']['Feeds #news - Topic #2'] = (int) $this->get_parameter_from_link($crawler->filter('.post')->selectLink($this->lang('POST', '', ''))->link()->getUri(), 'p');
+
+ // Test creating a reply
+ $post2 = $this->create_post($this->data['forums']['Feeds #news'], $post['topic_id'], 'Re: Feeds #news - Topic #2', 'This is a test post posted by the testing framework.');
+ $crawler = self::request('GET', "viewtopic.php?t={$post2['topic_id']}&sid={$this->sid}");
+
+ $this->assertContains('Re: Feeds #news - Topic #2', $crawler->filter('html')->text());
+ $this->data['posts']['Re: Feeds #news - Topic #2'] = (int) $post2['post_id'];
+ }
+
+ public function test_feeds_news_admin()
+ {
+ $this->load_ids(array(
+ 'forums' => array(
+ 'Feeds #news',
+ ),
+ 'topics' => array(
+ 'Feeds #news - Topic #1',
+ 'Feeds #news - Topic #2',
+ ),
+ 'posts' => array(
+ 'Feeds #news - Topic #2',
+ ),
+ ));
+
+ // Assert that the first post of the two topics are displayed in news feed
+ $this->assert_feeds(array(
+ 'news' => array(
+ array(
+ 'nb_entries' => 2,
+ 'contents' => array(
+ 1 => 'This is a test topic posted by the testing framework.',
+ 2 => 'This is a test topic posted by the testing framework.',
+ ),
+ ),
+ ),
+ // News should also be displayed in other feeds
+ 'f' => array(
+ array(
+ 'nb_entries' => 3,
+ 'id' => $this->data['forums']['Feeds #news'],
+ ),
+ ),
+ 't' => array(
+ array(
+ 'nb_entries' => 1,
+ 'id' => $this->data['topics']['Feeds #news - Topic #1'],
+ ),
+ array(
+ 'nb_entries' => 2,
+ 'id' => $this->data['topics']['Feeds #news - Topic #2'],
+ ),
+ ),
+ 'overall' => array(
+ array(
+ 'nb_entries' => 3,
+ 'xpath' => array(
+ '//entry/title[contains(., "#news")]' => 3,
+ ),
+ ),
+ ),
+ 'topics' => array(
+ array(
+ 'nb_entries' => 2,
+ 'xpath' => array(
+ '//entry/title[contains(., "#news")]' => 2,
+ ),
+ ),
+ ),
+ 'topics_new' => array(
+ array(
+ 'nb_entries' => 2,
+ 'xpath' => array(
+ '//entry/title[contains(., "#news")]' => 2,
+ ),
+ ),
+ ),
+ 'topics_active' => array(
+ array(
+ 'nb_entries' => 2,
+ 'xpath' => array(
+ '//entry/title[contains(., "#news")]' => 2,
+ ),
+ ),
+ ),
+ ), 'admin');
+ }
+
+ public function test_feeds_news_guest()
+ {
+ $this->load_ids(array(
+ 'posts' => array(
+ 'Feeds #news - Topic #2',
+ ),
+ ));
+
+ // Assert that first post of the the two topics are displayed in news feed
+ $this->assert_feeds(array(
+ 'news' => array(
+ array(
+ 'nb_entries' => 2,
+ 'contents' => array(
+ 1 => 'This is a test topic posted by the testing framework.',
+ 2 => 'This is a test topic posted by the testing framework.',
+ ),
+ ),
+ ),
+ ));
+ }
+
+ public function test_create_sub_forum_topic()
+ {
+ $this->login();
+ $this->load_ids(array(
+ 'forums' => array(
+ 'Feeds #1',
+ 'Feeds #1.1',
+ ),
+ ));
+
+ $post = $this->create_topic($this->data['forums']['Feeds #1'], 'Feeds #1 - Topic #1', 'This is a test topic posted by the testing framework.');
+ $this->data['topics']['Feeds #1 - Topic #1'] = (int) $post['topic_id'];
+
+ $post = $this->create_topic($this->data['forums']['Feeds #1.1'], 'Feeds #1.1 - Topic #1', 'This is a test topic posted by the testing framework.');
+ $this->data['topics']['Feeds #1.1 - Topic #1'] = (int) $post['topic_id'];
+ }
+
+ public function test_feeds_sub_forum()
+ {
+ $this->load_ids(array(
+ 'forums' => array(
+ 'Feeds #1',
+ ),
+ ));
+
+ // The topics of the sub-forum shouldn't be displayed
+ $this->assert_feeds(array(
+ 'f' => array(
+ array(
+ 'nb_entries' => 1,
+ 'id' => $this->data['forums']['Feeds #1'],
+ ),
+ ),
+ ), 'admin');
+ }
+
+ public function test_create_softdelete_post()
+ {
+ $this->login();
+ $this->load_ids(array(
+ 'forums' => array(
+ 'Feeds #1',
+ ),
+ ));
+
+ $post = $this->create_topic($this->data['forums']['Feeds #1'], 'Feeds #1 - Topic #2', 'This is a test topic posted by the testing framework.');
+ $this->data['topics']['Feeds #1 - Topic #2'] = (int) $post['topic_id'];
+
+ // Test creating a reply
+ $post2 = $this->create_post($this->data['forums']['Feeds #1'], $post['topic_id'], 'Re: Feeds #1 - Topic #2', 'This is a test post posted by the testing framework.');
+ $crawler = self::request('GET', "viewtopic.php?t={$post2['topic_id']}&sid={$this->sid}");
+
+ $this->assertContains('Re: Feeds #1 - Topic #2', $crawler->filter('html')->text());
+ $this->data['posts']['Re: Feeds #1 - Topic #2'] = (int) $post2['post_id'];
+ }
+
+ public function test_softdelete_post()
+ {
+ $this->login();
+ $this->load_ids(array(
+ 'forums' => array(
+ 'Feeds #1',
+ ),
+ 'topics' => array(
+ 'Feeds #1 - Topic #2',
+ ),
+ 'posts' => array(
+ 'Re: Feeds #1 - Topic #2',
+ ),
+ ));
+ $this->add_lang('posting');
+
+ $crawler = self::request('GET', "posting.php?mode=delete&f={$this->data['forums']['Feeds #1']}&p={$this->data['posts']['Re: Feeds #1 - Topic #2']}&sid={$this->sid}");
+ $this->assertContainsLang('DELETE_PERMANENTLY', $crawler->text());
+
+ $form = $crawler->selectButton('Yes')->form();
+ $crawler = self::submit($form);
+ $this->assertContainsLang('POST_DELETED', $crawler->text());
+
+ $crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Feeds #1 - Topic #2']}&sid={$this->sid}");
+ $this->assertContains($this->lang('POST_DISPLAY', '', ''), $crawler->text());
+ }
+
+ public function test_feeds_softdeleted_post_admin()
+ {
+ $this->load_ids(array(
+ 'forums' => array(
+ 'Feeds #1',
+ ),
+ 'topics' => array(
+ 'Feeds #1 - Topic #2',
+ ),
+ ));
+
+ // Assert that the soft-deleted post is marked as soft-delete for users that have the right to see it.
+ $this->assert_feeds(array(
+ 'f' => array(
+ array(
+ 'nb_entries' => 3,
+ 'id' => $this->data['forums']['Feeds #1'],
+ 'contents_lang' => array(
+ 1 => 'POST_DELETED',
+ ),
+ ),
+ ),
+ 't' => array(
+ array(
+ 'nb_entries' => 2,
+ 'id' => $this->data['topics']['Feeds #1 - Topic #2'],
+ 'contents_lang' => array(
+ 1 => 'POST_DELETED',
+ ),
+ ),
+ ),
+ 'overall' => array(
+ array(
+ 'nb_entries' => 7,
+ 'contents_lang' => array(
+ 1 => 'POST_DELETED',
+ ),
+ ),
+ ),
+ ), 'admin');
+ }
+
+ public function test_feeds_softdeleted_post_guest()
+ {
+ $this->load_ids(array(
+ 'forums' => array(
+ 'Feeds #1',
+ ),
+ 'topics' => array(
+ 'Feeds #1 - Topic #2',
+ ),
+ ));
+
+ // Assert that the soft-deleted post is marked as soft-delete for users that have the right to see it.
+ $this->assert_feeds(array(
+ 'f' => array(
+ array(
+ 'nb_entries' => 2,
+ 'id' => $this->data['forums']['Feeds #1'],
+ ),
+ ),
+ 't' => array(
+ array(
+ 'nb_entries' => 1,
+ 'id' => $this->data['topics']['Feeds #1 - Topic #2'],
+ ),
+ ),
+ 'overall' => array(
+ array(
+ 'nb_entries' => 6,
+ ),
+ ),
+ ));
+ }
+
+ public function test_softdelete_topic()
+ {
+ $this->login();
+ $this->load_ids(array(
+ 'forums' => array(
+ 'Feeds #1',
+ ),
+ 'topics' => array(
+ 'Feeds #1 - Topic #2',
+ ),
+ ));
+
+ $this->add_lang('posting');
+ $crawler = $this->get_quickmod_page($this->data['topics']['Feeds #1 - Topic #2'], 'DELETE_TOPIC');
+ $this->assertContainsLang('DELETE_PERMANENTLY', $crawler->text());
+
+ $this->add_lang('mcp');
+ $form = $crawler->selectButton('Yes')->form();
+ $crawler = self::submit($form);
+ $this->assertContainsLang('TOPIC_DELETED_SUCCESS', $crawler->text());
+
+ $crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Feeds #1 - Topic #2']}&sid={$this->sid}");
+ $this->assertContains('Feeds #1 - Topic #2', $crawler->filter('h2')->text());
+ }
+
+ public function test_feeds_softdeleted_topic_admin()
+ {
+ $this->load_ids(array(
+ 'forums' => array(
+ 'Feeds #1',
+ ),
+ 'topics' => array(
+ 'Feeds #1 - Topic #2',
+ ),
+ ));
+
+ // Assert that the soft-deleted post is marked as soft-delete for users that have the right to see it.
+ $this->assert_feeds(array(
+ 'f' => array(
+ array(
+ 'nb_entries' => 3,
+ 'id' => $this->data['forums']['Feeds #1'],
+ 'contents_lang' => array(
+ 1 => 'POST_DELETED',
+ 2 => 'POST_DELETED',
+ ),
+ ),
+ ),
+ 't' => array(
+ array(
+ 'nb_entries' => 2,
+ 'id' => $this->data['topics']['Feeds #1 - Topic #2'],
+ 'contents_lang' => array(
+ 1 => 'POST_DELETED',
+ 2 => 'POST_DELETED',
+ ),
+ ),
+ ),
+ 'overall' => array(
+ array(
+ 'nb_entries' => 7,
+ 'contents_lang' => array(
+ 1 => 'POST_DELETED',
+ 2 => 'POST_DELETED',
+ ),
+ ),
+ ),
+ 'topics' => array(
+ array(
+ 'nb_entries' => 5,
+ 'contents_lang' => array(
+ 1 => 'TOPIC_DELETED',
+ ),
+ ),
+ ),
+ 'topics_new' => array(
+ array(
+ 'nb_entries' => 5,
+ 'contents_lang' => array(
+ 1 => 'TOPIC_DELETED',
+ ),
+ ),
+ ),
+ 'topics_active' => array(
+ array(
+ 'nb_entries' => 5,
+ 'contents_lang' => array(
+ 1 => 'TOPIC_DELETED',
+ ),
+ ),
+ ),
+ ), 'admin');
+ }
+
+ public function test_feeds_softdeleted_topic_guest()
+ {
+ $this->load_ids(array(
+ 'forums' => array(
+ 'Feeds #1',
+ ),
+ 'topics' => array(
+ 'Feeds #1 - Topic #2',
+ ),
+ ));
+
+ $this->assert_feeds(array(
+ 'f' => array(
+ array(
+ 'nb_entries' => 1,
+ 'id' => $this->data['forums']['Feeds #1'],
+ ),
+ ),
+ 't' => array(
+ array(
+ 'id' => $this->data['topics']['Feeds #1 - Topic #2'],
+ 'contents_lang' => array('SORRY_AUTH_READ'),
+ 'invalid' => true,
+ ),
+ ),
+ 'overall' => array(
+ array(
+ 'nb_entries' => 5,
+ ),
+ ),
+ 'topics' => array(
+ array(
+ 'nb_entries' => 4,
+ ),
+ ),
+ 'topics_new' => array(
+ array(
+ 'nb_entries' => 4,
+ ),
+ ),
+ 'topics_active' => array(
+ array(
+ 'nb_entries' => 4,
+ ),
+ ),
+ ));
+ }
+
+ public function test_create_unapproved_post()
+ {
+ $this->load_ids(array(
+ 'forums' => array(
+ 'Feeds #1.1',
+ ),
+ ));
+
+ $this->login('admin');
+ $post = $this->create_topic($this->data['forums']['Feeds #1.1'], 'Feeds #1.1 - Topic #2', 'This is a test topic posted by the testing framework.');
+ $this->data['topics']['Feeds #1.1 - Topic #2'] = (int) $post['topic_id'];
+ $this->logout();
+
+ // Test creating a reply
+ $this->login('disapprove_user');
+ $post2 = $this->create_post($this->data['forums']['Feeds #1.1'], $post['topic_id'], 'Re: Feeds #1.1 - Topic #2', 'This is a test post posted by the testing framework.', array(), 'POST_STORED_MOD');
+
+ $crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Feeds #1.1 - Topic #2']}&sid={$this->sid}");
+ $this->assertNotContains('Re: Feeds #1.1 - Topic #2', $crawler->filter('html')->text());
+ }
+
+ public function test_feeds_unapproved_post_admin()
+ {
+ $this->load_ids(array(
+ 'forums' => array(
+ 'Feeds #1.1',
+ ),
+ 'topics' => array(
+ 'Feeds #1.1 - Topic #2',
+ ),
+ ));
+
+ // Assert that the unapproved post is marked as unapproved for users that have the right to see it.
+ $this->assert_feeds(array(
+ 'f' => array(
+ array(
+ 'nb_entries' => 3,
+ 'id' => $this->data['forums']['Feeds #1.1'],
+ 'contents_lang' => array(
+ 1 => 'POST_UNAPPROVED',
+ ),
+ ),
+ ),
+ 't' => array(
+ array(
+ 'nb_entries' => 2,
+ 'id' => $this->data['topics']['Feeds #1.1 - Topic #2'],
+ 'contents_lang' => array(
+ 1 => 'POST_UNAPPROVED',
+ ),
+ ),
+ ),
+ 'overall' => array(
+ array(
+ 'nb_entries' => 9,
+ 'contents_lang' => array(
+ 1 => 'POST_UNAPPROVED',
+ ),
+ ),
+ ),
+ ), 'admin');
+ }
+
+ public function test_feeds_unapproved_post_disapprove_user()
+ {
+ $this->load_ids(array(
+ 'forums' => array(
+ 'Feeds #1.1',
+ ),
+ 'topics' => array(
+ 'Feeds #1.1 - Topic #2',
+ ),
+ ));
+
+ // Assert that the unapproved isn't displayed for regular users
+ $this->assert_feeds(array(
+ 'f' => array(
+ array(
+ 'nb_entries' => 2,
+ 'id' => $this->data['forums']['Feeds #1.1'],
+ ),
+ ),
+ 't' => array(
+ array(
+ 'nb_entries' => 1,
+ 'id' => $this->data['topics']['Feeds #1.1 - Topic #2'],
+ ),
+ ),
+ 'overall' => array(
+ array(
+ 'nb_entries' => 6,
+ ),
+ ),
+ ), 'disapprove_user');
+ }
+
+ public function test_create_unapproved_topic()
+ {
+ $this->load_ids(array(
+ 'forums' => array(
+ 'Feeds #1.1',
+ ),
+ ));
+ $this->set_flood_interval(0);
+
+ $this->login('disapprove_user');
+ $post = $this->create_topic($this->data['forums']['Feeds #1.1'], 'Feeds #1.1 - Topic #3', 'This is a test topic posted by the testing framework.', array(), 'POST_STORED_MOD');
+ $this->data['topics']['Feeds #1 - Topic #3'] = (int) $post['topic_id'];
+ $crawler = self::request('GET', "viewforum.php?f={$this->data['forums']['Feeds #1.1']}&sid={$this->sid}");
+
+ $this->assertNotContains('Feeds #1.1 - Topic #3', $crawler->filter('html')->text());
+
+ $this->logout();
+ $this->set_flood_interval(15);
+ }
+
+ protected function set_flood_interval($flood_interval)
+ {
+ $this->login();
+ $this->admin_login();
+
+ $crawler = self::request('GET', 'adm/index.php?sid=' . $this->sid . '&i=acp_board&mode=post');
+
+ $form = $crawler->selectButton('Submit')->form();
+ $values = $form->getValues();
+
+ $values["config[flood_interval]"] = $flood_interval;
+ $form->setValues($values);
+ $crawler = self::submit($form);
+ $this->assertGreaterThan(0, $crawler->filter('.successbox')->count());
+
+ $this->logout();
+ }
+
+ public function test_feeds_unapproved_topic_admin()
+ {
+ $this->load_ids(array(
+ 'forums' => array(
+ 'Feeds #1.1',
+ ),
+ 'topics' => array(
+ 'Feeds #1.1 - Topic #3',
+ ),
+ ));
+
+ // Assert that the unapproved topic is marked as unapproved for users that have the right to see it.
+ $this->assert_feeds(array(
+ 'f' => array(
+ array(
+ 'nb_entries' => 4,
+ 'id' => $this->data['forums']['Feeds #1.1'],
+ 'contents_lang' => array(
+ 1 => 'POST_UNAPPROVED',
+ ),
+ ),
+ ),
+ 't' => array(
+ array(
+ 'nb_entries' => 1,
+ 'id' => $this->data['topics']['Feeds #1.1 - Topic #3'],
+ 'contents_lang' => array(
+ 1 => 'POST_UNAPPROVED',
+ ),
+ ),
+ ),
+ 'overall' => array(
+ array(
+ 'nb_entries' => 10,
+ 'contents_lang' => array(
+ 1 => 'POST_UNAPPROVED',
+ ),
+ ),
+ ),
+ 'topics' => array(
+ array(
+ 'nb_entries' => 7,
+ 'contents_lang' => array(
+ 1 => 'TOPIC_UNAPPROVED',
+ ),
+ ),
+ ),
+ 'topics_new' => array(
+ array(
+ 'nb_entries' => 7,
+ 'contents_lang' => array(
+ 1 => 'TOPIC_UNAPPROVED',
+ ),
+ ),
+ ),
+ 'topics_active' => array(
+ array(
+ 'nb_entries' => 7,
+ 'contents_lang' => array(
+ 1 => 'TOPIC_UNAPPROVED',
+ ),
+ ),
+ ),
+ ), 'admin');
+ }
+
+ public function test_feeds_unapproved_topic_disapprove_user()
+ {
+ $this->load_ids(array(
+ 'forums' => array(
+ 'Feeds #1.1',
+ ),
+ 'topics' => array(
+ 'Feeds #1.1 - Topic #3',
+ ),
+ ));
+
+ $this->assert_feeds(array(
+ 'f' => array(
+ array(
+ 'nb_entries' => 2,
+ 'id' => $this->data['forums']['Feeds #1.1'],
+ ),
+ ),
+ 't' => array(
+ array(
+ 'id' => $this->data['topics']['Feeds #1.1 - Topic #3'],
+ 'contents_lang' => array('SORRY_AUTH_READ'),
+ 'invalid' => true,
+ ),
+ ),
+ 'overall' => array(
+ array(
+ 'nb_entries' => 6,
+ ),
+ ),
+ 'topics' => array(
+ array(
+ 'nb_entries' => 5,
+ ),
+ ),
+ 'topics_new' => array(
+ array(
+ 'nb_entries' => 5,
+ ),
+ ),
+ 'topics_active' => array(
+ array(
+ 'nb_entries' => 5,
+ ),
+ ),
+ ), 'disapprove_user');
+ }
+
+ public function test_create_attachment_topic()
+ {
+ $this->login();
+ $this->load_ids(array(
+ 'forums' => array(
+ 'Feeds #1',
+ ),
+ ));
+
+ // Test creating a topic with 1 attachment
+ $post = $this->create_topic($this->data['forums']['Feeds #1'], 'Feeds #1 - Topic #3', 'This is a test topic posted by the testing framework. [attachment=0]Attachment #0[/attachment]', array('upload_files' => 1));
+ $crawler = self::request('GET', "viewtopic.php?t={$post['topic_id']}&sid={$this->sid}");
+
+ $this->assertContains('Feeds #1 - Topic #3', $crawler->filter('html')->text());
+ $this->data['topics']['Feeds #1 - Topic #3'] = (int) $post['topic_id'];
+ }
+
+ public function test_feeds_attachment_admin()
+ {
+ $this->load_ids(array(
+ 'forums' => array(
+ 'Feeds #1',
+ ),
+ 'topics' => array(
+ 'Feeds #1 - Topic #3',
+ ),
+ 'posts' => array(
+ 'Feeds #1 - Topic #3',
+ ),
+ 'attachments' => true,
+ ));
+
+ $this->assert_feeds(array(
+ 'f' => array(
+ array(
+ 'nb_entries' => 4,
+ 'id' => $this->data['forums']['Feeds #1'],
+ 'attachments' => array(
+ 1 => array( // First entry
+ array( // First attachment to fetch
+ 'id' => $this->data['attachments'][$this->data['posts']['Feeds #1 - Topic #3']][0],
+ 'displayed' => true,
+ ),
+ ),
+ ),
+ ),
+ ),
+ 't' => array(
+ array(
+ 'nb_entries' => 1,
+ 'id' => $this->data['topics']['Feeds #1 - Topic #3'],
+ 'attachments' => array(
+ 1 => array( // First entry
+ array( // First attachment to fetch
+ 'id' => $this->data['attachments'][$this->data['posts']['Feeds #1 - Topic #3']][0],
+ 'displayed' => true,
+ ),
+ ),
+ ),
+ ),
+ ),
+ 'overall' => array(
+ array(
+ 'nb_entries' => 11,
+ 'attachments' => array(
+ 1 => array( // First entry
+ array( // First attachment to fetch
+ 'id' => $this->data['attachments'][$this->data['posts']['Feeds #1 - Topic #3']][0],
+ 'displayed' => true,
+ ),
+ ),
+ ),
+ ),
+ ),
+ 'topics' => array(
+ array(
+ 'nb_entries' => 8,
+ 'attachments' => array(
+ 1 => array( // First entry
+ array( // First attachment to fetch
+ 'id' => $this->data['attachments'][$this->data['posts']['Feeds #1 - Topic #3']][0],
+ 'displayed' => true,
+ ),
+ ),
+ ),
+ ),
+ ),
+ 'topics_new' => array(
+ array(
+ 'nb_entries' => 8,
+ 'attachments' => array(
+ 1 => array( // First entry
+ array( // First attachment to fetch
+ 'id' => $this->data['attachments'][$this->data['posts']['Feeds #1 - Topic #3']][0],
+ 'displayed' => true,
+ ),
+ ),
+ ),
+ ),
+ ),
+ 'topics_active' => array(
+ array(
+ 'nb_entries' => 8,
+ 'attachments' => array(
+ 1 => array( // First entry
+ array( // First attachment to fetch
+ 'id' => $this->data['attachments'][$this->data['posts']['Feeds #1 - Topic #3']][0],
+ 'displayed' => true,
+ ),
+ ),
+ ),
+ ),
+ ),
+ ), 'admin');
+ }
+
+ public function test_feeds_attachment_guest()
+ {
+ $this->load_ids(array(
+ 'forums' => array(
+ 'Feeds #1',
+ ),
+ 'topics' => array(
+ 'Feeds #1 - Topic #3',
+ ),
+ 'posts' => array(
+ 'Feeds #1 - Topic #3',
+ ),
+ 'attachments' => true,
+ ));
+
+ $this->assert_feeds(array(
+ 'f' => array(
+ array(
+ 'nb_entries' => 2,
+ 'id' => $this->data['forums']['Feeds #1'],
+ 'attachments' => array(
+ 1 => array( // First entry
+ array( // First attachment to fetch
+ 'id' => $this->data['attachments'][$this->data['posts']['Feeds #1 - Topic #3']][0],
+ 'displayed' => false,
+ ),
+ ),
+ ),
+ ),
+ ),
+ 't' => array(
+ array(
+ 'nb_entries' => 1,
+ 'id' => $this->data['topics']['Feeds #1 - Topic #3'],
+ 'attachments' => array(
+ 1 => array( // First entry
+ array( // First attachment to fetch
+ 'id' => $this->data['attachments'][$this->data['posts']['Feeds #1 - Topic #3']][0],
+ 'displayed' => false,
+ ),
+ ),
+ ),
+ ),
+ ),
+ 'overall' => array(
+ array(
+ 'nb_entries' => 7,
+ 'attachments' => array(
+ 1 => array( // First entry
+ array( // First attachment to fetch
+ 'id' => $this->data['attachments'][$this->data['posts']['Feeds #1 - Topic #3']][0],
+ 'displayed' => false,
+ ),
+ ),
+ ),
+ ),
+ ),
+ 'topics' => array(
+ array(
+ 'nb_entries' => 6,
+ 'attachments' => array(
+ 1 => array( // First entry
+ array( // First attachment to fetch
+ 'id' => $this->data['attachments'][$this->data['posts']['Feeds #1 - Topic #3']][0],
+ 'displayed' => false,
+ ),
+ ),
+ ),
+ ),
+ ),
+ 'topics_new' => array(
+ array(
+ 'nb_entries' => 6,
+ 'attachments' => array(
+ 1 => array( // First entry
+ array( // First attachment to fetch
+ 'id' => $this->data['attachments'][$this->data['posts']['Feeds #1 - Topic #3']][0],
+ 'displayed' => false,
+ ),
+ ),
+ ),
+ ),
+ ),
+ 'topics_active' => array(
+ array(
+ 'nb_entries' => 6,
+ 'attachments' => array(
+ 1 => array( // First entry
+ array( // First attachment to fetch
+ 'id' => $this->data['attachments'][$this->data['posts']['Feeds #1 - Topic #3']][0],
+ 'displayed' => false,
+ ),
+ ),
+ ),
+ ),
+ ),
+ ));
+ }
+
+ public function test_create_missing_attachment_post()
+ {
+ $this->login();
+ $this->load_ids(array(
+ 'forums' => array(
+ 'Feeds #1',
+ ),
+ 'topics' => array(
+ 'Feeds #1 - Topic #3',
+ ),
+ ));
+
+ // Test creating a reply with 1 missing attachment
+ $post2 = $this->create_post($this->data['forums']['Feeds #1'], $this->data['topics']['Feeds #1 - Topic #3'], 'Re: Feeds #1 - Topic #3-1', 'This is a test post posted by the testing framework. [attachment=0]Attachment #0[/attachment]');
+ $crawler = self::request('GET', "viewtopic.php?t={$post2['topic_id']}&sid={$this->sid}");
+
+ $this->assertContains('Re: Feeds #1 - Topic #3-1', $crawler->filter('html')->text());
+ $this->data['posts']['Re: Feeds #1 - Topic #3-1'] = (int) $post2['post_id'];
+ }
+
+ public function test_feeds_missing_attachment_admin()
+ {
+ $this->load_ids(array(
+ 'forums' => array(
+ 'Feeds #1',
+ ),
+ 'topics' => array(
+ 'Feeds #1 - Topic #3',
+ ),
+ 'posts' => array(
+ 'Feeds #1 - Topic #3',
+ ),
+ ));
+
+ $this->add_lang('viewtopic');
+
+ $this->assert_feeds(array(
+ 'f' => array(
+ array(
+ 'nb_entries' => 5,
+ 'id' => $this->data['forums']['Feeds #1'],
+ 'contents' => array(
+ 1 => 'Attachment #0',
+ ),
+ ),
+ ),
+ 't' => array(
+ array(
+ 'nb_entries' => 2,
+ 'id' => $this->data['topics']['Feeds #1 - Topic #3'],
+ 'contents' => array(
+ 1 => 'Attachment #0',
+ ),
+ ),
+ ),
+ 'overall' => array(
+ array(
+ 'nb_entries' => 12,
+ 'contents' => array(
+ 1 => 'Attachment #0',
+ ),
+ ),
+ ),
+ 'topics' => array(
+ array(
+ 'nb_entries' => 8,
+ 'attachments' => array(
+ 1 => array( // First entry
+ array( // First attachment to fetch
+ 'id' => $this->data['attachments'][$this->data['posts']['Feeds #1 - Topic #3']][0],
+ 'displayed' => true,
+ ),
+ ),
+ ),
+ ),
+ ),
+ 'topics_new' => array(
+ array(
+ 'nb_entries' => 8,
+ 'attachments' => array(
+ 1 => array( // First entry
+ array( // First attachment to fetch
+ 'id' => $this->data['attachments'][$this->data['posts']['Feeds #1 - Topic #3']][0],
+ 'displayed' => true,
+ ),
+ ),
+ ),
+ ),
+ ),
+ 'topics_active' => array(
+ array(
+ 'nb_entries' => 8,
+ 'contents' => array(
+ 1 => 'Attachment #0',
+ ),
+ ),
+ ),
+ ), 'admin');
+ }
+
+ protected function assert_feeds($data, $username = false)
+ {
+ if ($username)
+ {
+ $this->login($username);
+ $init_values = self::$init_values[$username];
+ }
+ else
+ {
+ $init_values = self::$init_values['disapprove_user'];
+ }
+
+ foreach ($data as $mode => $feeds)
+ {
+ foreach ($feeds as $feed_data)
+ {
+ if ($mode === 'f' || $mode === 't')
+ {
+ $params = "?{$mode}={$feed_data['id']}";
+ $this->assert_feed($params, $feed_data);
+ }
+ else
+ {
+ switch ($mode) {
+ case 'forums':
+ $feed_data['nb_entries'] = ((int)$feed_data['nb_entries'] + $init_values['forums_value']);
+ break;
+ case 'overall':
+ $feed_data['nb_entries'] = min($feed_data['nb_entries'] + $init_values['overall_value'], self::$init_values['post_base_items']);
+ break;
+ case 'topics':
+ $feed_data['nb_entries'] = min($feed_data['nb_entries'] + $init_values['topics_value'], self::$init_values['topic_base_items']);
+ break;
+ case 'topics_new':
+ $feed_data['nb_entries'] = min($feed_data['nb_entries'] + $init_values['topics_new_value'], self::$init_values['topic_base_items']);
+ break;
+ case 'topics_active':
+ $feed_data['nb_entries'] = min($feed_data['nb_entries'] + $init_values['topics_active_value'], self::$init_values['topic_base_items']);
+ break;
+ case 'news':
+ break;
+ default:
+ $this->fail('Unsupported feed mode: ' . $mode);
+ }
+
+ $params = "?mode={$mode}";
+ $this->assert_feed($params, $feed_data);
+ }
+ }
+ }
+ }
+
+ protected function assert_feed($params, $data)
+ {
+ $crawler = self::request('GET', 'feed.php' . $params, array(), false);
+
+ if (empty($data['invalid']))
+ {
+ self::assert_response_xml();
+ $this->assertEquals($data['nb_entries'], $crawler->filter('entry')->count(), "Tested feed : 'feed.php{$params}'");
+
+ if (!empty($data['xpath']))
+ {
+
+ foreach($data['xpath'] as $xpath => $count_expected)
+ {
+ $this->assertCount($count_expected, $crawler->filterXPath($xpath), "Tested feed : 'feed.php{$params}', Search for {$xpath}");
+ }
+ }
+
+ if (!empty($data['contents']))
+ {
+ foreach($data['contents'] as $entry_id => $string)
+ {
+ $content = $crawler->filterXPath("//entry[{$entry_id}]/content")->text();
+ $this->assertContains($string, $content, "Tested feed : 'feed.php{$params}'");
+ }
+ }
+
+ if (!empty($data['contents_lang']))
+ {
+ foreach($data['contents_lang'] as $entry_id => $string)
+ {
+ $content = $crawler->filterXPath("//entry[{$entry_id}]/content")->text();
+ $this->assertContainsLang($string, $content, "Tested feed : 'feed.php{$params}'");
+ }
+ }
+
+ if (!empty($data['attachments']))
+ {
+ foreach($data['attachments'] as $entry_id => $attachments)
+ {
+ foreach ($attachments as $i => $attachment)
+ {
+ $content = $crawler->filterXPath("//entry[{$entry_id}]/content")->text();
+ $url = self::$root_url . "download/file.php?id={$attachment['id']}";
+ $string = "Attachment #{$i}";
+
+ if ($attachment['displayed'])
+ {
+ $this->assertContains($url, $content, "Tested feed : 'feed.php{$params}'");
+ $this->assertNotContains($string, $content, "Tested feed : 'feed.php{$params}'");
+ }
+ else
+ {
+ $this->assertContains($string, $content, "Tested feed : 'feed.php{$params}'");
+ $this->assertNotContains($url, $content, "Tested feed : 'feed.php{$params}'");
+ }
+ }
+ }
+ }
+ }
+ else
+ {
+ self::assert_response_html();
+
+ if (!empty($data['contents_lang']))
+ {
+ foreach($data['contents_lang'] as $string)
+ {
+ $content = $crawler->filter('html')->text();
+ $this->assertContainsLang($string, $content, "Tested feed : 'feed.php{$params}'");
+ }
+ }
+ }
+ }
+
+ protected function load_ids($data)
+ {
+ $this->db = $this->get_db();
+
+ if (!empty($data['forums']))
+ {
+ $sql = 'SELECT *
+ FROM phpbb_forums
+ WHERE ' . $this->db->sql_in_set('forum_name', $data['forums']);
+ $result = $this->db->sql_query($sql);
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ if (in_array($row['forum_name'], $data['forums']))
+ {
+ $this->data['forums'][$row['forum_name']] = (int) $row['forum_id'];
+ }
+ }
+ $this->db->sql_freeresult($result);
+ }
+
+ if (!empty($data['topics']))
+ {
+ $sql = 'SELECT *
+ FROM phpbb_topics
+ WHERE ' . $this->db->sql_in_set('topic_title', $data['topics']);
+ $result = $this->db->sql_query($sql);
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ if (in_array($row['topic_title'], $data['topics']))
+ {
+ $this->data['topics'][$row['topic_title']] = (int) $row['topic_id'];
+ }
+ }
+ $this->db->sql_freeresult($result);
+ }
+
+ $post_ids = array();
+ if (!empty($data['posts']))
+ {
+ $sql = 'SELECT *
+ FROM phpbb_posts
+ WHERE ' . $this->db->sql_in_set('post_subject', $data['posts']);
+ $result = $this->db->sql_query($sql);
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ if (in_array($row['post_subject'], $data['posts']))
+ {
+ $this->data['posts'][$row['post_subject']] = (int) $row['post_id'];
+ $post_ids[] = (int) $row['post_id'];
+ }
+ }
+ $this->db->sql_freeresult($result);
+
+ if (isset($data['attachments']))
+ {
+ $sql = 'SELECT *
+ FROM phpbb_attachments
+ WHERE in_message = 0 AND ' . $this->db->sql_in_set('post_msg_id', $post_ids);
+ $result = $this->db->sql_query($sql);
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $this->data['attachments'][(int) $row['post_msg_id']][] = (int) $row['attach_id'];
+ }
+ $this->db->sql_freeresult($result);
+ }
+ }
+ }
+}
diff --git a/tests/functional/fileupload_form_test.php b/tests/functional/fileupload_form_test.php
new file mode 100644
index 0000000000..d381fa1ae2
--- /dev/null
+++ b/tests/functional/fileupload_form_test.php
@@ -0,0 +1,145 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+/**
+ * @group functional
+ */
+class phpbb_functional_fileupload_form_test extends phpbb_functional_test_case
+{
+ private $path;
+
+ public function setUp()
+ {
+ parent::setUp();
+ $this->path = __DIR__ . '/fixtures/files/';
+ $this->add_lang('posting');
+ }
+
+ public function tearDown()
+ {
+ $iterator = new DirectoryIterator(__DIR__ . '/../../phpBB/files/');
+ foreach ($iterator as $fileinfo)
+ {
+ if (
+ $fileinfo->isDot()
+ || $fileinfo->isDir()
+ || $fileinfo->getFilename() === 'index.htm'
+ || $fileinfo->getFilename() === '.htaccess'
+ )
+ {
+ continue;
+ }
+
+ unlink($fileinfo->getPathname());
+ }
+ }
+
+ private function upload_file($filename, $mimetype)
+ {
+ $file = array(
+ 'tmp_name' => $this->path . $filename,
+ 'name' => $filename,
+ 'type' => $mimetype,
+ 'size' => filesize($this->path . $filename),
+ 'error' => UPLOAD_ERR_OK,
+ );
+
+ $crawler = self::$client->request(
+ 'POST',
+ 'posting.php?mode=reply&f=2&t=1&sid=' . $this->sid,
+ array('add_file' => $this->lang('ADD_FILE')),
+ array('fileupload' => $file)
+ );
+
+ return $crawler;
+ }
+
+ public function test_empty_file()
+ {
+ $this->login();
+
+ $crawler = $this->upload_file('empty.png', 'image/png');
+ $this->assertEquals($this->lang('EMPTY_FILEUPLOAD'), $crawler->filter('p.error')->text());
+ }
+
+ public function test_invalid_extension()
+ {
+ $this->login();
+
+ $crawler = $this->upload_file('illegal-extension.bif', 'application/octet-stream');
+ $this->assertEquals($this->lang('DISALLOWED_EXTENSION', 'bif'), $crawler->filter('p.error')->text());
+ }
+
+ public function test_disallowed_content()
+ {
+ $this->login();
+
+ $crawler = $this->upload_file('disallowed.jpg', 'image/jpeg');
+ $this->assertEquals($this->lang('DISALLOWED_CONTENT'), $crawler->filter('p.error')->text());
+ }
+
+ public function test_disallowed_content_no_check()
+ {
+ $this->login();
+ $this->admin_login();
+ $this->add_lang('ucp');
+
+ // Make sure check_attachment_content is set to false
+ $crawler = self::request('GET', 'adm/index.php?sid=' . $this->sid . '&i=acp_attachments&mode=attach');
+
+ $form = $crawler->selectButton('Submit')->form(array(
+ 'config[check_attachment_content]' => 0,
+ 'config[img_imagick]' => '',
+ ));
+ self::submit($form);
+
+ // Request index for correct URL
+ self::request('GET', 'index.php?sid=' . $this->sid);
+
+ $crawler = $this->upload_file('disallowed.jpg', 'image/jpeg');
+
+ // Hitting the UNABLE_GET_IMAGE_SIZE error means we passed the
+ // DISALLOWED_CONTENT check
+ $this->assertContainsLang('UNABLE_GET_IMAGE_SIZE', $crawler->text());
+
+ // Reset check_attachment_content to default (enabled)
+ $crawler = self::request('GET', 'adm/index.php?sid=' . $this->sid . '&i=acp_attachments&mode=attach');
+
+ $form = $crawler->selectButton('Submit')->form(array(
+ 'config[check_attachment_content]' => 1,
+ ));
+ self::submit($form);
+ }
+
+ public function test_too_large()
+ {
+ $this->create_user('fileupload');
+ $this->login('fileupload');
+
+ $crawler = $this->upload_file('too-large.png', 'image/png');
+ $this->assertEquals($this->lang('WRONG_FILESIZE', '256', 'KiB'), $crawler->filter('p.error')->text());
+ }
+
+ public function test_valid_file()
+ {
+ $this->login();
+
+ $crawler = $this->upload_file('valid.jpg', 'image/jpeg');
+
+ // Ensure there was no error message rendered
+ $this->assertNotContains('<h2>' . $this->lang('INFORMATION') . '</h2>', $this->get_content());
+
+ // Also the file name should be in the first row of the files table
+ $this->assertEquals('valid.jpg', $crawler->filter('span.file-name')->eq(1)->text());
+ }
+}
diff --git a/tests/functional/fileupload_remote_test.php b/tests/functional/fileupload_remote_test.php
new file mode 100644
index 0000000000..6ece150b23
--- /dev/null
+++ b/tests/functional/fileupload_remote_test.php
@@ -0,0 +1,79 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+require_once __DIR__ . '/../../phpBB/includes/functions_upload.php';
+
+/**
+ * @group functional
+ */
+class phpbb_functional_fileupload_remote_test extends phpbb_functional_test_case
+{
+ public function setUp()
+ {
+ parent::setUp();
+ // Only doing this within the functional framework because we need a
+ // URL
+
+ // Global $config required by unique_id
+ // Global $user required by fileupload::remote_upload
+ global $config, $user;
+
+ if (!is_array($config))
+ {
+ $config = array();
+ }
+
+ $config['rand_seed'] = '';
+ $config['rand_seed_last_update'] = time() + 600;
+
+ $user = new phpbb_mock_user();
+ $user->lang = new phpbb_mock_lang();
+ }
+
+ public function tearDown()
+ {
+ global $config, $user;
+ $user = null;
+ $config = array();
+ }
+
+ public function test_invalid_extension()
+ {
+ $upload = new fileupload('', array('jpg'), 100);
+ $file = $upload->remote_upload(self::$root_url . 'develop/blank.gif');
+ $this->assertEquals('URL_INVALID', $file->error[0]);
+ }
+
+ public function test_empty_file()
+ {
+ $upload = new fileupload('', array('jpg'), 100);
+ $file = $upload->remote_upload(self::$root_url . 'develop/blank.jpg');
+ $this->assertEquals('EMPTY_REMOTE_DATA', $file->error[0]);
+ }
+
+ public function test_successful_upload()
+ {
+ $upload = new fileupload('', array('gif'), 1000);
+ $file = $upload->remote_upload(self::$root_url . 'styles/prosilver/theme/images/forum_read.gif');
+ $this->assertEquals(0, sizeof($file->error));
+ $this->assertTrue(file_exists($file->filename));
+ }
+
+ public function test_too_large()
+ {
+ $upload = new fileupload('', array('gif'), 100);
+ $file = $upload->remote_upload(self::$root_url . 'styles/prosilver/theme/images/forum_read.gif');
+ $this->assertEquals(1, sizeof($file->error));
+ $this->assertEquals('WRONG_FILESIZE', $file->error[0]);
+ }
+}
diff --git a/tests/functional/fixtures/ext/foo/bar/acp/main_info.php b/tests/functional/fixtures/ext/foo/bar/acp/main_info.php
new file mode 100644
index 0000000000..ec378e0e75
--- /dev/null
+++ b/tests/functional/fixtures/ext/foo/bar/acp/main_info.php
@@ -0,0 +1,37 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace foo\bar\acp;
+
+/**
+* @ignore
+*/
+if (!defined('IN_PHPBB'))
+{
+ exit;
+}
+
+class main_info
+{
+ function module()
+ {
+ return array(
+ 'filename' => 'foo\bar\acp\main_module',
+ 'title' => 'ACP_FOOBAR_TITLE',
+ 'version' => '1.0.0',
+ 'modes' => array(
+ 'mode' => array('title' => 'ACP_FOOBAR_MODE', 'auth' => '', 'cat' => array('ACP_FOOBAR_TITLE')),
+ ),
+ );
+ }
+}
diff --git a/tests/functional/fixtures/ext/foo/bar/acp/main_module.php b/tests/functional/fixtures/ext/foo/bar/acp/main_module.php
new file mode 100644
index 0000000000..ee797c718d
--- /dev/null
+++ b/tests/functional/fixtures/ext/foo/bar/acp/main_module.php
@@ -0,0 +1,33 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace foo\bar\acp;
+
+/**
+* @ignore
+*/
+if (!defined('IN_PHPBB'))
+{
+ exit;
+}
+
+class main_module
+{
+ var $u_action;
+
+ function main($id, $mode)
+ {
+ $this->tpl_name = 'foobar';
+ $this->page_title = 'Bertie';
+ }
+}
diff --git a/tests/functional/fixtures/ext/foo/bar/adm/style/foobar.html b/tests/functional/fixtures/ext/foo/bar/adm/style/foobar.html
new file mode 100644
index 0000000000..3cb45c269c
--- /dev/null
+++ b/tests/functional/fixtures/ext/foo/bar/adm/style/foobar.html
@@ -0,0 +1,3 @@
+<!-- INCLUDE overall_header.html -->
+Bertie rulez!
+<!-- INCLUDE overall_footer.html -->
diff --git a/tests/functional/fixtures/ext/foo/bar/composer.json b/tests/functional/fixtures/ext/foo/bar/composer.json
new file mode 100644
index 0000000000..f0c7f0e6c1
--- /dev/null
+++ b/tests/functional/fixtures/ext/foo/bar/composer.json
@@ -0,0 +1,24 @@
+{
+ "name": "foo/bar",
+ "type": "phpbb-extension",
+ "description": "Testing extensions",
+ "homepage": "",
+ "version": "1.0.0",
+ "time": "2013-03-21 01:01:01",
+ "license": "GPL-2.0",
+ "authors": [{
+ "name": "Joas Schilling",
+ "email": "nickvergessen@phpbb.com",
+ "homepage": "http://www.phpbb.com",
+ "role": "Developer"
+ }],
+ "require": {
+ "php": ">=5.3"
+ },
+ "extra": {
+ "display-name": "phpBB 3.1 Extension Testing",
+ "soft-require": {
+ "phpbb/phpbb": "3.1.*@dev"
+ }
+ }
+}
diff --git a/tests/functional/fixtures/ext/foo/bar/config/routing.yml b/tests/functional/fixtures/ext/foo/bar/config/routing.yml
new file mode 100644
index 0000000000..374a58046d
--- /dev/null
+++ b/tests/functional/fixtures/ext/foo/bar/config/routing.yml
@@ -0,0 +1,35 @@
+foo_bar_controller:
+ path: /foo/bar
+ defaults: { _controller: foo_bar.controller:handle }
+
+foo_baz_controller:
+ path: /foo/baz
+ defaults: { _controller: foo_bar.controller:baz }
+
+foo_template_controller:
+ path: /foo/template
+ defaults: { _controller: foo_bar.controller:template }
+
+foo_exception_controller:
+ path: /foo/exception
+ defaults: { _controller: foo_bar.controller:exception }
+
+foo_login_redirect_controller:
+ path: /foo/login_redirect
+ defaults: { _controller: foo_bar.controller:login_redirect }
+
+foo_redirect_controller:
+ path: /foo/redirect
+ defaults: { _controller: foo_bar.controller:redirect }
+
+foo_index_controller:
+ path: /index
+ defaults: { _controller: foo_bar.controller:redirect }
+
+foo_tests_index_controller:
+ path: /tests/index
+ defaults: { _controller: foo_bar.controller:redirect }
+
+foo_tests_dotdot_index_controller:
+ path: /tests/../index
+ defaults: { _controller: foo_bar.controller:redirect }
diff --git a/tests/functional/fixtures/ext/foo/bar/config/services.yml b/tests/functional/fixtures/ext/foo/bar/config/services.yml
new file mode 100644
index 0000000000..d35be7955a
--- /dev/null
+++ b/tests/functional/fixtures/ext/foo/bar/config/services.yml
@@ -0,0 +1,20 @@
+services:
+ foo_bar.controller:
+ class: foo\bar\controller\controller
+ arguments:
+ - @controller.helper
+ - @path_helper
+ - @template
+ - @config
+ - @user
+ - %core.root_path%
+ - %core.php_ext%
+
+ foo_bar.listener.permission:
+ class: foo\bar\event\permission
+ tags:
+ - { name: event.listener }
+ foo_bar.listener.user_setup:
+ class: foo\bar\event\user_setup
+ tags:
+ - { name: event.listener }
diff --git a/tests/functional/fixtures/ext/foo/bar/controller/controller.php b/tests/functional/fixtures/ext/foo/bar/controller/controller.php
new file mode 100644
index 0000000000..47d856a5df
--- /dev/null
+++ b/tests/functional/fixtures/ext/foo/bar/controller/controller.php
@@ -0,0 +1,109 @@
+<?php
+
+namespace foo\bar\controller;
+
+use Symfony\Component\HttpFoundation\Response;
+
+class controller
+{
+ protected $template;
+ protected $helper;
+ protected $path_helper;
+ protected $config;
+ protected $user;
+
+ public function __construct(\phpbb\controller\helper $helper, \phpbb\path_helper $path_helper, \phpbb\template\template $template, \phpbb\config\config $config, \phpbb\user $user, $root_path, $php_ext)
+ {
+ $this->template = $template;
+ $this->helper = $helper;
+ $this->path_helper = $path_helper;
+ $this->config = $config;
+ $this->user = $user;
+ $this->root_path = $root_path;
+ $this->php_ext = $php_ext;
+ }
+
+ public function handle()
+ {
+ return new Response('foo/bar controller handle() method', 200);
+ }
+
+ public function baz($test)
+ {
+ return new Response('Value of "test" URL argument is: ' . $test);
+ }
+
+ public function template()
+ {
+ $this->template->assign_var('A_VARIABLE', 'I am a variable');
+
+ return $this->helper->render('foo_bar_body.html');
+ }
+
+ public function exception()
+ {
+ throw new \phpbb\controller\exception('Exception thrown from foo/exception route');
+ }
+
+ public function login_redirect()
+ {
+ if (!$this->user->data['is_registered'])
+ {
+ login_box();
+ }
+
+ $this->template->assign_var('A_VARIABLE', 'I am a variable');
+
+ return $this->helper->render('foo_bar_body.html');
+ }
+
+ public function redirect()
+ {
+ $url_root = generate_board_url();
+
+ $rewrite_prefix = (!empty($this->config['enable_mod_rewrite'])) ? '' : 'app.php/';
+
+ $redirects = array(
+ array(
+ append_sid($this->root_path . 'index.' . $this->php_ext),
+ 'index.php',
+ ),
+ array(
+ append_sid($this->root_path . 'foo/bar/index.' . $this->php_ext),
+ 'foo/bar/index.php',
+ ),
+ array(
+ append_sid($this->root_path . 'tests/index.' . $this->php_ext),
+ 'tests/index.php',
+ ),
+ array(
+ $this->helper->route('foo_index_controller'),
+ $rewrite_prefix . 'index',
+ ),
+ array(
+ $this->helper->route('foo_tests_index_controller'),
+ $rewrite_prefix . 'tests/index',
+ ),
+ /**
+ * Symfony does not allow /../ in routes
+ array(
+ $this->helper->route('foo_tests_dotdot_index_controller'),
+ $rewrite_prefix . 'index',
+ ),
+ */
+ );
+
+ foreach ($redirects as $redirect)
+ {
+ $this->template->assign_block_vars('redirects', array(
+ 'URL' => redirect($redirect[0], true),
+ ));
+
+ $this->template->assign_block_vars('redirects_expected', array(
+ 'URL' => $this->path_helper->clean_url($url_root . '/' . $redirect[1]),
+ ));
+ }
+
+ return $this->helper->render('redirect_body.html');
+ }
+}
diff --git a/tests/functional/fixtures/ext/foo/bar/event/permission.php b/tests/functional/fixtures/ext/foo/bar/event/permission.php
new file mode 100644
index 0000000000..cdbdf40465
--- /dev/null
+++ b/tests/functional/fixtures/ext/foo/bar/event/permission.php
@@ -0,0 +1,36 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace foo\bar\event;
+
+/**
+* Event listener
+*/
+use Symfony\Component\EventDispatcher\EventSubscriberInterface;
+
+class permission implements EventSubscriberInterface
+{
+ static public function getSubscribedEvents()
+ {
+ return array(
+ 'core.permissions' => 'add_permissions',
+ );
+ }
+
+ public function add_permissions($event)
+ {
+ $permissions = $event['permissions'];
+ $permissions['u_foo'] = array('lang' => 'ACL_U_FOOBAR', 'cat' => 'post');
+ $event['permissions'] = $permissions;
+ }
+}
diff --git a/tests/functional/fixtures/ext/foo/bar/event/user_setup.php b/tests/functional/fixtures/ext/foo/bar/event/user_setup.php
new file mode 100644
index 0000000000..3a60019f68
--- /dev/null
+++ b/tests/functional/fixtures/ext/foo/bar/event/user_setup.php
@@ -0,0 +1,39 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace foo\bar\event;
+
+/**
+* Event listener
+*/
+use Symfony\Component\EventDispatcher\EventSubscriberInterface;
+
+class user_setup implements EventSubscriberInterface
+{
+ static public function getSubscribedEvents()
+ {
+ return array(
+ 'core.user_setup' => 'add_global_translations',
+ );
+ }
+
+ public function add_global_translations($event)
+ {
+ $lang_set_ext = $event['lang_set_ext'];
+ $lang_set_ext[] = array(
+ 'ext_name' => 'foo/bar',
+ 'lang_set' => 'foo_global',
+ );
+ $event['lang_set_ext'] = $lang_set_ext;
+ }
+}
diff --git a/tests/functional/fixtures/ext/foo/bar/ext.php b/tests/functional/fixtures/ext/foo/bar/ext.php
new file mode 100644
index 0000000000..1288edd5ec
--- /dev/null
+++ b/tests/functional/fixtures/ext/foo/bar/ext.php
@@ -0,0 +1,8 @@
+<?php
+
+namespace foo\bar;
+
+class ext extends \phpbb\extension\base
+{
+
+}
diff --git a/tests/functional/fixtures/ext/foo/bar/language/en/foo_global.php b/tests/functional/fixtures/ext/foo/bar/language/en/foo_global.php
new file mode 100644
index 0000000000..a6af8680d3
--- /dev/null
+++ b/tests/functional/fixtures/ext/foo/bar/language/en/foo_global.php
@@ -0,0 +1,5 @@
+<?php
+
+$lang = array_merge($lang, array(
+ 'SKIP' => 'Overwritten by foo',
+));
diff --git a/tests/functional/fixtures/ext/foo/bar/language/en/permissions_foo.php b/tests/functional/fixtures/ext/foo/bar/language/en/permissions_foo.php
new file mode 100644
index 0000000000..64b497c394
--- /dev/null
+++ b/tests/functional/fixtures/ext/foo/bar/language/en/permissions_foo.php
@@ -0,0 +1,5 @@
+<?php
+
+$lang = array_merge($lang, array(
+ 'ACL_U_FOOBAR' => 'Can view foobar with permission foo',
+));
diff --git a/tests/functional/fixtures/ext/foo/bar/styles/prosilver/template/foo_bar_body.html b/tests/functional/fixtures/ext/foo/bar/styles/prosilver/template/foo_bar_body.html
new file mode 100644
index 0000000000..8fb6994d3d
--- /dev/null
+++ b/tests/functional/fixtures/ext/foo/bar/styles/prosilver/template/foo_bar_body.html
@@ -0,0 +1,3 @@
+<!-- INCLUDE overall_header.html -->
+<div id="content">{A_VARIABLE}</div>
+<!-- INCLUDE overall_footer.html -->
diff --git a/tests/functional/fixtures/ext/foo/bar/styles/prosilver/template/foobar.html b/tests/functional/fixtures/ext/foo/bar/styles/prosilver/template/foobar.html
new file mode 100644
index 0000000000..cbded623f4
--- /dev/null
+++ b/tests/functional/fixtures/ext/foo/bar/styles/prosilver/template/foobar.html
@@ -0,0 +1,3 @@
+<!-- INCLUDE overall_header.html -->
+<div id="content">UCP Extension Template Test Passed!</div>
+<!-- INCLUDE overall_footer.html -->
diff --git a/tests/functional/fixtures/ext/foo/bar/styles/prosilver/template/redirect_body.html b/tests/functional/fixtures/ext/foo/bar/styles/prosilver/template/redirect_body.html
new file mode 100644
index 0000000000..2b70b0fe59
--- /dev/null
+++ b/tests/functional/fixtures/ext/foo/bar/styles/prosilver/template/redirect_body.html
@@ -0,0 +1,8 @@
+<!-- INCLUDE overall_header.html -->
+<!-- BEGIN redirects -->
+<div id="redirect_{redirects.S_ROW_COUNT}">{redirects.URL}</div>
+<!-- END redirects -->
+<!-- BEGIN redirects_expected -->
+<div id="redirect_expected_{redirects_expected.S_ROW_COUNT}">{redirects_expected.URL}</div>
+<!-- END redirects_expected -->
+<!-- INCLUDE overall_footer.html -->
diff --git a/tests/functional/fixtures/ext/foo/bar/ucp/main_info.php b/tests/functional/fixtures/ext/foo/bar/ucp/main_info.php
new file mode 100644
index 0000000000..d34244f800
--- /dev/null
+++ b/tests/functional/fixtures/ext/foo/bar/ucp/main_info.php
@@ -0,0 +1,29 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace foo\bar\ucp;
+
+class main_info
+{
+ function module()
+ {
+ return array(
+ 'filename' => '\foo\bar\ucp\main_module',
+ 'title' => 'ACP_FOOBAR_TITLE',
+ 'version' => '1.0.0',
+ 'modes' => array(
+ 'mode' => array('title' => 'ACP_FOOBAR_MODE', 'auth' => '', 'cat' => array('ACP_FOOBAR_TITLE')),
+ ),
+ );
+ }
+}
diff --git a/tests/functional/fixtures/ext/foo/bar/ucp/main_module.php b/tests/functional/fixtures/ext/foo/bar/ucp/main_module.php
new file mode 100644
index 0000000000..f1cd03f4ab
--- /dev/null
+++ b/tests/functional/fixtures/ext/foo/bar/ucp/main_module.php
@@ -0,0 +1,25 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace foo\bar\ucp;
+
+class main_module
+{
+ var $u_action;
+
+ function main($id, $mode)
+ {
+ $this->tpl_name = 'foobar';
+ $this->page_title = 'Bertie';
+ }
+}
diff --git a/tests/functional/fixtures/ext/foo/foo/composer.json b/tests/functional/fixtures/ext/foo/foo/composer.json
new file mode 100644
index 0000000000..d85c76a6a2
--- /dev/null
+++ b/tests/functional/fixtures/ext/foo/foo/composer.json
@@ -0,0 +1,24 @@
+{
+ "name": "foo/foo",
+ "type": "phpbb-extension",
+ "description": "Testing extensions",
+ "homepage": "",
+ "version": "1.0.0",
+ "time": "2013-03-21 01:01:01",
+ "license": "GPL-2.0",
+ "authors": [{
+ "name": "Tristan Darricau",
+ "email": "nicofuma@phpbb.com",
+ "homepage": "http://www.phpbb.com",
+ "role": "Developer"
+ }],
+ "require": {
+ "php": ">=5.3"
+ },
+ "extra": {
+ "display-name": "phpBB 3.1 Extension Testing",
+ "soft-require": {
+ "phpbb/phpbb": "3.1.*@dev"
+ }
+ }
+}
diff --git a/tests/functional/fixtures/ext/foo/foo/config/resource.yml b/tests/functional/fixtures/ext/foo/foo/config/resource.yml
new file mode 100644
index 0000000000..4f2b9cce70
--- /dev/null
+++ b/tests/functional/fixtures/ext/foo/foo/config/resource.yml
@@ -0,0 +1,3 @@
+foo_foo_controller:
+ path: /foo
+ defaults: { _controller: foo_foo.controller:handle }
diff --git a/tests/functional/fixtures/ext/foo/foo/config/routing.yml b/tests/functional/fixtures/ext/foo/foo/config/routing.yml
new file mode 100644
index 0000000000..c2c401687d
--- /dev/null
+++ b/tests/functional/fixtures/ext/foo/foo/config/routing.yml
@@ -0,0 +1,3 @@
+foo_foo.general:
+ resource: "resource.yml"
+ prefix: /foo
diff --git a/tests/functional/fixtures/ext/foo/foo/config/services.yml b/tests/functional/fixtures/ext/foo/foo/config/services.yml
new file mode 100644
index 0000000000..b3c7719715
--- /dev/null
+++ b/tests/functional/fixtures/ext/foo/foo/config/services.yml
@@ -0,0 +1,3 @@
+services:
+ foo_foo.controller:
+ class: foo\foo\controller\controller
diff --git a/tests/functional/fixtures/ext/foo/foo/controller/controller.php b/tests/functional/fixtures/ext/foo/foo/controller/controller.php
new file mode 100644
index 0000000000..771eaeacfc
--- /dev/null
+++ b/tests/functional/fixtures/ext/foo/foo/controller/controller.php
@@ -0,0 +1,13 @@
+<?php
+
+namespace foo\foo\controller;
+
+use Symfony\Component\HttpFoundation\Response;
+
+class controller
+{
+ public function handle()
+ {
+ return new Response('foo/foo controller handle() method', 200);
+ }
+}
diff --git a/tests/functional/fixtures/ext/foo/foo/ext.php b/tests/functional/fixtures/ext/foo/foo/ext.php
new file mode 100644
index 0000000000..80acda74fe
--- /dev/null
+++ b/tests/functional/fixtures/ext/foo/foo/ext.php
@@ -0,0 +1,8 @@
+<?php
+
+namespace foo\foo;
+
+class ext extends \phpbb\extension\base
+{
+
+}
diff --git a/tests/functional/fixtures/files/disallowed.jpg b/tests/functional/fixtures/files/disallowed.jpg
new file mode 100644
index 0000000000..06a437585a
--- /dev/null
+++ b/tests/functional/fixtures/files/disallowed.jpg
Binary files differ
diff --git a/tests/functional/fixtures/files/empty.png b/tests/functional/fixtures/files/empty.png
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/functional/fixtures/files/empty.png
diff --git a/tests/functional/fixtures/files/illegal-extension.bif b/tests/functional/fixtures/files/illegal-extension.bif
new file mode 100644
index 0000000000..3cd5038e38
--- /dev/null
+++ b/tests/functional/fixtures/files/illegal-extension.bif
Binary files differ
diff --git a/tests/functional/fixtures/files/too-large.png b/tests/functional/fixtures/files/too-large.png
new file mode 100644
index 0000000000..ed4b0abd80
--- /dev/null
+++ b/tests/functional/fixtures/files/too-large.png
Binary files differ
diff --git a/tests/functional/fixtures/files/valid.jpg b/tests/functional/fixtures/files/valid.jpg
new file mode 100644
index 0000000000..95a87ddbdf
--- /dev/null
+++ b/tests/functional/fixtures/files/valid.jpg
Binary files differ
diff --git a/tests/functional/forgot_password_test.php b/tests/functional/forgot_password_test.php
new file mode 100644
index 0000000000..64fa19557f
--- /dev/null
+++ b/tests/functional/forgot_password_test.php
@@ -0,0 +1,61 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+/**
+* @group functional
+*/
+class phpbb_functional_forgot_password_test extends phpbb_functional_test_case
+{
+ public function test_forgot_password_enabled()
+ {
+ global $config;
+ $this->add_lang('ucp');
+ $crawler = self::request('GET', 'ucp.php?mode=sendpassword');
+ $this->assertEquals($this->lang('SEND_PASSWORD'), $crawler->filter('h2')->text());
+ }
+
+ public function test_forgot_password_disabled()
+ {
+ $this->login();
+ $this->admin_login();
+ $this->add_lang('ucp');
+ $crawler = self::request('GET', 'adm/index.php?sid=' . $this->sid . '&i=acp_board&mode=security');
+
+ $form = $crawler->selectButton('Submit')->form();
+ $values = $form->getValues();
+
+ $values["config[allow_password_reset]"] = 0;
+ $form->setValues($values);
+ $crawler = self::submit($form);
+
+ $this->logout();
+
+ $crawler = self::request('GET', 'ucp.php?mode=sendpassword');
+ $this->assertContains($this->lang('UCP_PASSWORD_RESET_DISABLED', '', ''), $crawler->text());
+
+ }
+
+ public function tearDown()
+ {
+ $this->login();
+ $this->admin_login();
+
+ $crawler = self::request('GET', 'adm/index.php?sid=' . $this->sid . '&i=acp_board&mode=security');
+
+ // Enable allow_password_reset again after test
+ $form = $crawler->selectButton('Submit')->form(array(
+ 'config[allow_password_reset]' => 1,
+ ));
+ $crawler = self::submit($form);
+ }
+}
diff --git a/tests/functional/forum_password_test.php b/tests/functional/forum_password_test.php
new file mode 100644
index 0000000000..4b2b69a92c
--- /dev/null
+++ b/tests/functional/forum_password_test.php
@@ -0,0 +1,59 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+/**
+* @group functional
+*/
+class phpbb_functional_forum_password_test extends phpbb_functional_test_case
+{
+ public function test_setup_forum_with_password()
+ {
+ $this->login();
+ $this->admin_login();
+
+ $crawler = self::request('GET', "adm/index.php?i=acp_forums&mode=manage&sid={$this->sid}");
+ $form = $crawler->selectButton('addforum')->form(array(
+ 'forum_name' => 'Password protected',
+ ));
+ $crawler = self::submit($form);
+ $form = $crawler->selectButton('update')->form(array(
+ 'forum_perm_from' => 2,
+ 'forum_password' => 'foobar',
+ 'forum_password_confirm' => 'foobar',
+ ));
+ $crawler = self::submit($form);
+ }
+
+ public function data_enter_forum_with_password()
+ {
+ return array(
+ array('foowrong', 'WRONG_PASSWORD'),
+ array('foobar', 'NO_TOPICS'),
+ );
+ }
+
+ /**
+ * @dataProvider data_enter_forum_with_password
+ */
+ public function test_enter_forum_with_password($password, $message)
+ {
+ $crawler = self::request('GET', "index.php?sid={$this->sid}");
+ preg_match('/.?f=([0-9])/', $crawler->selectLink('Password protected')->link()->getUri(), $match);
+ $crawler = self::request('GET', "viewforum.php?f={$match[1]}&sid={$this->sid}");
+ $form = $crawler->selectButton('login')->form(array(
+ 'password' => $password,
+ ));
+ $crawler = self::submit($form);
+ $this->assertContainsLang($message, $crawler->text());
+ }
+}
diff --git a/tests/functional/forum_style_test.php b/tests/functional/forum_style_test.php
index 59f7341eb6..65be94f4d0 100644
--- a/tests/functional/forum_style_test.php
+++ b/tests/functional/forum_style_test.php
@@ -1,9 +1,13 @@
<?php
/**
*
-* @package testing
-* @copyright (c) 2013 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
diff --git a/tests/functional/group_create_test.php b/tests/functional/group_create_test.php
new file mode 100644
index 0000000000..a1417b5ba0
--- /dev/null
+++ b/tests/functional/group_create_test.php
@@ -0,0 +1,35 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+/**
+* @group functional
+*/
+class phpbb_functional_group_create_test extends phpbb_functional_test_case
+{
+
+ public function test_create_group()
+ {
+ $this->login();
+ $this->admin_login();
+ $this->add_lang('acp/groups');
+
+ $crawler = self::request('GET', 'adm/index.php?i=acp_groups&mode=manage&sid=' . $this->sid);
+ $form = $crawler->selectButton($this->lang('SUBMIT'))->form();
+ $crawler = self::submit($form, array('group_name' => 'testtest'));
+
+ $form = $crawler->selectButton($this->lang('SUBMIT'))->form();
+ $crawler = self::submit($form, array('group_name' => 'testtest'));
+
+ $this->assertContainsLang('GROUP_CREATED', $crawler->filter('#main')->text());
+ }
+}
diff --git a/tests/functional/jumpbox_test.php b/tests/functional/jumpbox_test.php
new file mode 100644
index 0000000000..f5a671b1b9
--- /dev/null
+++ b/tests/functional/jumpbox_test.php
@@ -0,0 +1,35 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+/**
+* @group functional
+*/
+class phpbb_functional_jumpbox_test extends phpbb_functional_test_case
+{
+ public function test_jumpbox()
+ {
+ $this->login();
+
+ $this->crawler = $this->get_quickmod_page(1, 'MERGE_TOPIC');
+ $this->check_valid_jump('Your first forum');
+
+ $link = $this->crawler->filter('#jumpbox')->selectLink('Your first category')->link()->getUri();
+ $this->crawler = self::request('GET', substr($link, strpos($link, 'mcp.')));
+ $this->check_valid_jump('Your first category');
+ }
+
+ protected function check_valid_jump($forum)
+ {
+ $this->assertContains($this->lang('FORUM') . ": $forum", $this->crawler->filter('#cp-main h2')->text(), $this->crawler->text());
+ }
+}
diff --git a/tests/functional/lang_test.php b/tests/functional/lang_test.php
index 053806a431..7cffd0ef61 100644
--- a/tests/functional/lang_test.php
+++ b/tests/functional/lang_test.php
@@ -1,9 +1,13 @@
<?php
/**
*
-* @package testing
-* @copyright (c) 2012 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
diff --git a/tests/functional/mcp_test.php b/tests/functional/mcp_test.php
index f65a7d0784..40615d66a5 100644
--- a/tests/functional/mcp_test.php
+++ b/tests/functional/mcp_test.php
@@ -1,9 +1,13 @@
<?php
/**
*
-* @package testing
-* @copyright (c) 2013 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -31,11 +35,7 @@ class phpbb_functional_mcp_test extends phpbb_functional_test_case
public function test_handle_quickmod($crawler)
{
// Test moving a post
- $form = $crawler->selectButton('Go')->eq(1)->form();
- $form['action']->select('merge');
- $crawler = self::submit($form);
-
- return $crawler;
+ return $this->get_quickmod_page(0, 'MERGE_POSTS', $crawler);
}
/**
@@ -64,4 +64,20 @@ class phpbb_functional_mcp_test extends phpbb_functional_test_case
$crawler = self::submit($form);
$this->assertContains($this->lang('POSTS_MERGED_SUCCESS'), $crawler->text());
}
+
+ public function test_delete_logs()
+ {
+ $this->login();
+ $crawler = self::request('GET', "mcp.php?i=mcp_logs&mode=front&sid={$this->sid}");
+ $this->assertGreaterThanOrEqual(1, $crawler->filter('input[type=checkbox]')->count());
+
+ $this->add_lang('mcp');
+ $form = $crawler->selectButton($this->lang('DELETE_ALL'))->form();
+ $crawler = self::submit($form);
+
+ $form = $crawler->selectButton('Yes')->form();
+ $crawler = self::submit($form);
+
+ $this->assertCount(0, $crawler->filter('input[type=checkbox]'));
+ }
}
diff --git a/tests/functional/memberlist_test.php b/tests/functional/memberlist_test.php
new file mode 100644
index 0000000000..1da5c39401
--- /dev/null
+++ b/tests/functional/memberlist_test.php
@@ -0,0 +1,137 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+/**
+* @group functional
+*/
+class phpbb_functional_memberlist_test extends phpbb_functional_test_case
+{
+ public function test_memberlist()
+ {
+ $this->create_user('memberlist-test-user');
+ // logs in as admin
+ $this->login();
+ $crawler = self::request('GET', 'memberlist.php?sid=' . $this->sid);
+ $this->assertContains('memberlist-test-user', $crawler->text());
+
+ // restrict by first character
+ $crawler = self::request('GET', 'memberlist.php?first_char=m&sid=' . $this->sid);
+ $this->assertContains('memberlist-test-user', $crawler->text());
+
+ // make sure results for wrong character are not returned
+ $crawler = self::request('GET', 'memberlist.php?first_char=a&sid=' . $this->sid);
+ $this->assertNotContains('memberlist-test-user', $crawler->text());
+ }
+
+ public function test_viewprofile()
+ {
+ $this->login();
+ // XXX hardcoded user id
+ $crawler = self::request('GET', 'memberlist.php?mode=viewprofile&u=2&sid=' . $this->sid);
+ $this->assertContains('admin', $crawler->filter('h2')->text());
+ }
+
+ protected function get_memberlist_leaders_table_crawler()
+ {
+ $crawler = self::request('GET', 'memberlist.php?mode=team&sid=' . $this->sid);
+ return $crawler->filter('.forumbg-table');
+ }
+
+ public function test_leaders()
+ {
+ $this->login();
+ $this->create_user('memberlist-test-moderator');
+
+ $crawler = $this->get_memberlist_leaders_table_crawler();
+
+ // Admin in admin group, but not in moderators
+ $this->assertContains('admin', $crawler->eq(0)->text());
+ $this->assertNotContains('admin', $crawler->eq(1)->text());
+
+ // memberlist-test-user in neither group
+ $this->assertNotContains('memberlist-test-user', $crawler->eq(0)->text());
+ $this->assertNotContains('memberlist-test-user', $crawler->eq(1)->text());
+
+ // memberlist-test-moderator in neither group
+ $this->assertNotContains('memberlist-test-moderator', $crawler->eq(0)->text());
+ $this->assertNotContains('memberlist-test-moderator', $crawler->eq(1)->text());
+ }
+
+ public function test_leaders_remove_users()
+ {
+ $this->login();
+
+ // Remove admin from admins, but is now in moderators
+ $this->remove_user_group('ADMINISTRATORS', array('admin'));
+ $crawler = $this->get_memberlist_leaders_table_crawler();
+ $this->assertNotContains('admin', $crawler->eq(0)->text());
+ $this->assertContains('admin', $crawler->eq(1)->text());
+
+ // Remove admin from moderators, should not be visible anymore
+ $this->remove_user_group('GLOBAL_MODERATORS', array('admin'));
+ $crawler = $this->get_memberlist_leaders_table_crawler();
+ $this->assertNotContains('admin', $crawler->eq(0)->text());
+ $this->assertNotContains('admin', $crawler->eq(1)->text());
+ }
+
+ public function test_leaders_add_users()
+ {
+ $this->login();
+
+ // Add memberlist-test-moderator to moderators
+ $this->add_user_group('GLOBAL_MODERATORS', array('memberlist-test-moderator'));
+ $crawler = $this->get_memberlist_leaders_table_crawler();
+ $this->assertNotContains('memberlist-test-moderator', $crawler->eq(0)->text());
+ $this->assertContains('memberlist-test-moderator', $crawler->eq(1)->text());
+
+ // Add admin to moderators, should be visible as moderator
+ $this->add_user_group('GLOBAL_MODERATORS', array('admin'), true);
+ $crawler = $this->get_memberlist_leaders_table_crawler();
+ $this->assertNotContains('admin', $crawler->eq(0)->text());
+ $this->assertContains('admin', $crawler->eq(1)->text());
+
+ // Add admin to admins as leader, should be visible as admin, not moderator
+ $this->add_user_group('ADMINISTRATORS', array('admin'), true, true);
+ $crawler = $this->get_memberlist_leaders_table_crawler();
+ $this->assertContains('admin', $crawler->eq(0)->text());
+ $this->assertNotContains('admin', $crawler->eq(1)->text());
+ }
+
+ public function test_group_rank()
+ {
+ copy(__DIR__ . '/fixtures/files/valid.jpg', __DIR__ . '/../../phpBB/images/ranks/valid.jpg');
+
+ $this->login();
+ $this->admin_login();
+ $this->add_lang(array('acp/groups', 'acp/posting'));
+
+ // Set a group rank to the registered users
+ $crawler = self::request('GET', "adm/index.php?sid={$this->sid}&i=acp_groups&mode=manage&action=edit&g=2");
+ $form = $crawler->selectButton('Submit')->form();
+ $form['group_rank']->select('1');
+ $crawler = self::submit($form);
+ $this->assertContainsLang('GROUP_UPDATED', $crawler->filter('.successbox')->text());
+
+ // Set a rank image for site_admin
+ $crawler = self::request('GET', "adm/index.php?sid={$this->sid}&i=acp_ranks&mode=ranks&action=edit&id=1");
+ $form = $crawler->selectButton('Submit')->form();
+ $form['rank_image']->select('valid.jpg');
+ $crawler = self::submit($form);
+ $this->assertContainsLang('RANK_UPDATED', $crawler->filter('.successbox')->text());
+
+ $crawler = self::request('GET', 'memberlist.php?mode=group&g=2');
+ $this->assertContains('memberlist-test-user', $crawler->text());
+
+ unlink(__DIR__ . '/../../phpBB/images/ranks/valid.jpg');
+ }
+}
diff --git a/tests/functional/metadata_manager_test.php b/tests/functional/metadata_manager_test.php
new file mode 100644
index 0000000000..0d2fdf082e
--- /dev/null
+++ b/tests/functional/metadata_manager_test.php
@@ -0,0 +1,94 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+/**
+* @group functional
+*/
+class phpbb_functional_metadata_manager_test extends phpbb_functional_test_case
+{
+ protected $phpbb_extension_manager;
+
+ static private $helper;
+
+ static protected $fixtures = array(
+ 'foo/bar/',
+ );
+
+ public function tearDown()
+ {
+ $this->purge_cache();
+
+ parent::tearDown();
+ }
+
+ static public function setUpBeforeClass()
+ {
+ parent::setUpBeforeClass();
+
+ self::$helper = new phpbb_test_case_helpers(self);
+ self::$helper->copy_ext_fixtures(dirname(__FILE__) . '/fixtures/ext/', self::$fixtures);
+ }
+
+ static public function tearDownAfterClass()
+ {
+ parent::tearDownAfterClass();
+
+ self::$helper->restore_original_ext_dir();
+ }
+
+ public function setUp()
+ {
+ parent::setUp();
+
+ $this->phpbb_extension_manager = $this->get_extension_manager();
+
+ $this->purge_cache();
+ $this->phpbb_extension_manager->enable('foo/bar');
+
+ $this->login();
+ $this->admin_login();
+ $this->add_lang('acp/extensions');
+ }
+
+ public function test_extensions_list()
+ {
+ $crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&sid=' . $this->sid);
+ $this->assertContains($this->lang('EXTENSIONS_EXPLAIN'), $crawler->filter('#main')->text());
+ $this->assertContains('phpBB 3.1 Extension Testing', $crawler->filter('#main')->text());
+ $this->assertContains('Details', $crawler->filter('#main')->text());
+ }
+
+ public function test_extensions_details()
+ {
+ $crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=details&ext_name=foo%2Fbar&sid=' . $this->sid);
+
+ // Test whether the details are displayed
+ $this->assertContains($this->lang('CLEAN_NAME'), $crawler->filter('#main')->text());
+ $this->assertContains('foo/bar', $crawler->filter('#meta_name')->text());
+
+ $this->assertContains($this->lang('PHP_VERSION'), $crawler->filter('#main')->text());
+ $this->assertContains('>=5.3', $crawler->filter('#require_php')->text());
+ // Details should be html escaped
+ // However, text() only returns the displayed text, so HTML Special Chars are decoded.
+ // So we test this directly on the content of the response.
+ $this->assertContains('<span id="require_php">&gt;=5.3</span>', $this->get_content());
+ }
+
+ public function test_extensions_details_notexists()
+ {
+ $crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=details&ext_name=not%2Fexists&sid=' . $this->sid);
+
+ // Error message because the files do not exist
+ $this->assertContains($this->lang('FILE_NOT_FOUND', ''), $crawler->filter('#main')->text());
+ }
+}
diff --git a/tests/functional/notification_test.php b/tests/functional/notification_test.php
new file mode 100644
index 0000000000..f21d73817a
--- /dev/null
+++ b/tests/functional/notification_test.php
@@ -0,0 +1,88 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+/**
+* @group functional
+*/
+class phpbb_functional_notification_test extends phpbb_functional_test_case
+{
+ static public function user_subscription_data()
+ {
+ return array(
+ // Rows inserted by phpBB/install/schemas/schema_data.sql
+ // Also see PHPBB3-11460
+ array('notification.type.post_notification', true),
+ array('notification.type.topic_notification', true),
+ array('notification.type.post_notification.method.email', true),
+ array('notification.type.topic_notification.method.email', true),
+
+ // Default behaviour for in-board notifications:
+ // If user did not opt-out, in-board notifications are on.
+ array('notification.type.bookmark_notification', true),
+ array('notification.type.quote_notification', true),
+
+ // Default behaviour for email notifications:
+ // If user did not opt-in, email notifications are off.
+ array('notification.type.bookmark_notification.method.email', false),
+ array('notification.type.quote_notification.method.email', false),
+ );
+ }
+
+ /**
+ * @dataProvider user_subscription_data
+ */
+ public function test_user_subscriptions($checkbox_name, $expected_status)
+ {
+ $this->login();
+ $crawler = self::request('GET', 'ucp.php?i=ucp_notifications&mode=notification_options');
+
+ $cplist = $crawler->filter('.table1');
+ if ($expected_status)
+ {
+ $this->assert_checkbox_is_checked($cplist, $checkbox_name);
+ }
+ else
+ {
+ $this->assert_checkbox_is_unchecked($cplist, $checkbox_name);
+ }
+ }
+
+ public function test_mark_notifications_read()
+ {
+ // Create a new standard user
+ $this->create_user('notificationtestuser');
+ $this->add_user_group('NEWLY_REGISTERED', array('notificationtestuser'));
+ $this->login('notificationtestuser');
+
+ // Post a new post that needs approval
+ $this->create_post(2, 1, 'Re: Welcome to phpBB3', 'This is a test [b]post[/b] posted by notificationtestuser.', array(), 'POST_STORED_MOD');
+ $crawler = self::request('GET', "viewtopic.php?t=1&sid={$this->sid}");
+ $this->assertNotContains('This is a test post posted by notificationtestuser.', $crawler->filter('html')->text());
+
+ // Login as admin
+ $this->logout();
+ $this->login();
+ $this->add_lang('ucp');
+
+ $crawler = self::request('GET', 'ucp.php?i=ucp_notifications');
+
+ // At least one notification should exist
+ $this->assertGreaterThan(0, $crawler->filter('#notification_list_button strong')->text());
+
+ // Get form token
+ $link = $crawler->selectLink($this->lang('NOTIFICATIONS_MARK_ALL_READ'))->link()->getUri();
+ $crawler = self::request('GET', substr($link, strpos($link, 'ucp.')));
+ $this->assertCount(1, $crawler->filter('#notification_list_button strong.badge.hidden'));
+ $this->assertEquals("0", $crawler->filter('#notification_list_button strong.badge.hidden')->text());
+ }
+}
diff --git a/tests/functional/paging_test.php b/tests/functional/paging_test.php
new file mode 100644
index 0000000000..cfaf9104a8
--- /dev/null
+++ b/tests/functional/paging_test.php
@@ -0,0 +1,43 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+/**
+* @group functional
+*/
+class phpbb_functional_paging_test extends phpbb_functional_test_case
+{
+
+ public function test_pagination()
+ {
+ $this->login();
+
+ $post = $this->create_topic(2, 'Test Topic 1', 'This is a test topic posted by the testing framework.');
+ for ($post_id = 1; $post_id <= 16; $post_id++)
+ {
+ $this->create_post(2, $post['topic_id'], 'Re: Test Topic 1', 'This is a test post no' . $post_id . ' posted by the testing framework.');
+ }
+ $crawler = self::request('GET', "viewtopic.php?t={$post['topic_id']}&sid={$this->sid}");
+ $this->assertContains('post no4', $crawler->text());
+ $this->assertNotContains('post no16', $crawler->text());
+
+ $next_link = $crawler->filter('.pagination > ul > li.next > a')->attr('href');
+ $crawler = self::request('GET', $next_link);
+ $this->assertNotContains('post no4', $crawler->text());
+ $this->assertContains('post no16', $crawler->text());
+
+ $prev_link = $crawler->filter('.pagination > ul > li.previous > a')->attr('href');
+ $crawler = self::request('GET', $prev_link);
+ $this->assertContains('post no4', $crawler->text());
+ $this->assertNotContains('post no16', $crawler->text());
+ }
+}
diff --git a/tests/functional/plupload_test.php b/tests/functional/plupload_test.php
new file mode 100644
index 0000000000..d358681ad1
--- /dev/null
+++ b/tests/functional/plupload_test.php
@@ -0,0 +1,154 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+/**
+ * @group functional
+ */
+class phpbb_functional_plupload_test extends phpbb_functional_test_case
+{
+ const CHUNKS = 4;
+ private $path;
+
+ protected function set_extension_group_permission($val)
+ {
+ $db = $this->get_db();
+ $query = "
+ UPDATE phpbb_extension_groups
+ SET allow_in_pm = '$val'
+ WHERE group_name = 'IMAGES'
+ ";
+ $db->sql_query($query);
+ }
+
+ public function setUp()
+ {
+ parent::setUp();
+ $this->purge_cache();
+ $this->set_extension_group_permission(1);
+ $this->path = __DIR__ . '/fixtures/files/';
+ $this->add_lang('posting');
+ $this->login();
+ }
+
+ public function tearDown()
+ {
+ $this->set_extension_group_permission(0);
+ $iterator = new DirectoryIterator(__DIR__ . '/../../phpBB/files/');
+ foreach ($iterator as $fileinfo)
+ {
+ if (
+ $fileinfo->isDot()
+ || $fileinfo->isDir()
+ || $fileinfo->getFilename() === 'index.htm'
+ || $fileinfo->getFilename() === '.htaccess'
+ )
+ {
+ continue;
+ }
+
+ unlink($fileinfo->getPathname());
+ }
+ }
+
+ public function get_urls()
+ {
+ return array(
+ array('posting.php?mode=reply&f=2&t=1'),
+ array('ucp.php?i=pm&mode=compose'),
+ );
+ }
+
+ /**
+ * @dataProvider get_urls
+ */
+ public function test_chunked_upload($url)
+ {
+ $chunk_size = ceil(filesize($this->path . 'valid.jpg') / self::CHUNKS);
+ $handle = fopen($this->path . 'valid.jpg', 'rb');
+
+ for ($i = 0; $i < self::CHUNKS; $i++)
+ {
+ $chunk = fread($handle, $chunk_size);
+ file_put_contents($this-> path . 'chunk', $chunk);
+
+ $file = array(
+ 'tmp_name' => $this->path . 'chunk',
+ 'name' => 'blob',
+ 'type' => 'application/octet-stream',
+ 'size' => strlen($chunk),
+ 'error' => UPLOAD_ERR_OK,
+ );
+
+ self::$client->setServerParameter('HTTP_X_PHPBB_USING_PLUPLOAD', '1');
+
+ $crawler = self::$client->request(
+ 'POST',
+ $url . '&sid=' . $this->sid,
+ array(
+ 'chunk' => $i,
+ 'chunks' => self::CHUNKS,
+ 'name' => md5('valid') . '.jpg',
+ 'real_filename' => 'valid.jpg',
+ 'add_file' => $this->lang('ADD_FILE'),
+ ),
+ array('fileupload' => $file),
+ array('X-PHPBB-USING-PLUPLOAD' => '1')
+ );
+
+ if ($i < self::CHUNKS - 1)
+ {
+ $this->assertContains('{"jsonrpc":"2.0","id":"id","result":null}', self::$client->getResponse()->getContent());
+ }
+ else
+ {
+ $response = json_decode(self::$client->getResponse()->getContent(), true);
+ $this->assertEquals('valid.jpg', $response['data'][0]['real_filename']);
+ }
+
+ unlink($this->path . 'chunk');
+ }
+
+ fclose($handle);
+ }
+
+ /**
+ * @dataProvider get_urls
+ */
+ public function test_normal_upload($url)
+ {
+ $file = array(
+ 'tmp_name' => $this->path . 'valid.jpg',
+ 'name' => 'valid.jpg',
+ 'type' => 'image/jpeg',
+ 'size' => filesize($this->path . 'valid.jpg'),
+ 'error' => UPLOAD_ERR_OK,
+ );
+
+ $crawler = self::$client->request(
+ 'POST',
+ $url . '&sid=' . $this->sid,
+ array(
+ 'chunk' => '0',
+ 'chunks' => '1',
+ 'name' => md5('valid') . '.jpg',
+ 'real_filename' => 'valid.jpg',
+ 'add_file' => $this->lang('ADD_FILE'),
+ ),
+ array('fileupload' => $file),
+ array('X-PHPBB-USING-PLUPLOAD' => '1')
+ );
+
+ $response = json_decode(self::$client->getResponse()->getContent(), true);
+ $this->assertEquals('valid.jpg', $response['data'][0]['real_filename']);
+ }
+}
diff --git a/tests/functional/posting_test.php b/tests/functional/posting_test.php
index 7fd1e4fdcf..914233240e 100644
--- a/tests/functional/posting_test.php
+++ b/tests/functional/posting_test.php
@@ -1,9 +1,13 @@
<?php
/**
*
-* @package testing
-* @copyright (c) 2012 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -22,8 +26,8 @@ class phpbb_functional_posting_test extends phpbb_functional_test_case
$crawler = self::request('GET', "viewtopic.php?t={$post['topic_id']}&sid={$this->sid}");
$this->assertContains('This is a test topic posted by the testing framework.', $crawler->filter('html')->text());
- // Test creating a reply
- $post2 = $this->create_post(2, $post['topic_id'], 'Re: Test Topic 1', 'This is a test post posted by the testing framework.');
+ // Test creating a reply with bbcode
+ $post2 = $this->create_post(2, $post['topic_id'], 'Re: Test Topic 1', 'This is a test [b]post[/b] posted by the testing framework.');
$crawler = self::request('GET', "viewtopic.php?t={$post2['topic_id']}&sid={$this->sid}");
$this->assertContains('This is a test post posted by the testing framework.', $crawler->filter('html')->text());
@@ -32,4 +36,124 @@ class phpbb_functional_posting_test extends phpbb_functional_test_case
$crawler = self::request('GET', "posting.php?mode=quote&f=2&t={$post2['topic_id']}&p={$post2['post_id']}&sid={$this->sid}");
$this->assertContains('This is a test post posted by the testing framework.', $crawler->filter('html')->text());
}
+
+ public function test_unsupported_characters()
+ {
+ $this->login();
+
+ $this->add_lang('posting');
+
+ self::create_post(2,
+ 1,
+ 'Unsupported characters',
+ "This is a test with these weird characters: \xF0\x9F\x88\xB3 \xF0\x9F\x9A\xB6",
+ array(),
+ 'Your message contains the following unsupported characters'
+ );
+
+ self::create_post(2,
+ 1,
+ "Unsupported: \xF0\x9F\x88\xB3 \xF0\x9F\x9A\xB6",
+ 'This is a test with emoji characters in the topic title.',
+ array(),
+ 'Your subject contains the following unsupported characters'
+ );
+ }
+
+ /**
+ * @testdox max_quote_depth is applied to the text populating the posting form
+ */
+ public function test_quote_depth_form()
+ {
+ $text = '0[quote]1[quote]2[/quote]1[/quote]0';
+ $expected = array(
+ 0 => '[quote="admin"]0[quote]1[quote]2[/quote]1[/quote]0[/quote]',
+ 1 => '[quote="admin"]00[/quote]',
+ 2 => '[quote="admin"]0[quote]11[/quote]0[/quote]',
+ 3 => '[quote="admin"]0[quote]1[quote]2[/quote]1[/quote]0[/quote]',
+ );
+
+ $this->login();
+ $topic = $this->create_topic(2, 'Test Topic 1', 'Test topic');
+ $post = $this->create_post(2, $topic['topic_id'], 'Re: Test Topic 1', $text);
+ $quote_url = "posting.php?mode=quote&f=2&t={$post['topic_id']}&p={$post['post_id']}&sid={$this->sid}";
+
+ $this->admin_login();
+ foreach ($expected as $quote_depth => $expected_text)
+ {
+ $this->set_quote_depth($quote_depth);
+ $crawler = self::request('GET', $quote_url);
+ $this->assertContains($expected_text, $crawler->filter('textarea#message')->text());
+ }
+ }
+
+ /**
+ * @testdox max_quote_depth is applied to the submitted text
+ */
+ public function test_quote_depth_submit()
+ {
+ $text = 'depth:0[quote]depth:1[quote]depth:2[quote]depth:3[/quote][/quote][/quote]';
+ $contains = array(
+ 0 => array('depth:0', 'depth:1', 'depth:2', 'depth:3'),
+ 1 => array('depth:0', 'depth:1'),
+ 2 => array('depth:0', 'depth:1', 'depth:2'),
+ 3 => array('depth:0', 'depth:1', 'depth:2', 'depth:3'),
+ );
+ $not_contains = array(
+ 0 => array(),
+ 1 => array('depth:2', 'depth:3'),
+ 2 => array('depth:3'),
+ 3 => array(),
+ );
+
+ $this->login();
+ $this->admin_login();
+ $topic = $this->create_topic(2, 'Test Topic 1', 'Test topic');
+
+ for ($quote_depth = 0; $quote_depth <= 2; ++$quote_depth)
+ {
+ $this->set_quote_depth($quote_depth);
+
+ $post = $this->create_post(2, $topic['topic_id'], 'Re: Test Topic 1', $text);
+ $url = "viewtopic.php?p={$post['post_id']}&sid={$this->sid}";
+
+ $crawler = self::request('GET', $url);
+ $text_content = $crawler->filter('#p' . $post['post_id'])->text();
+ foreach ($contains[$quote_depth] as $contains_text)
+ {
+ $this->assertContains($contains_text, $text_content);
+ }
+ foreach ($not_contains[$quote_depth] as $not_contains_text)
+ {
+ $this->assertNotContains($not_contains_text, $text_content);
+ }
+ }
+ }
+
+ public function test_post_poll()
+ {
+ $this->login();
+
+ $post = $this->create_topic(
+ 2,
+ '[ticket/14802] Test Poll Option Spacing',
+ 'Empty/blank lines should not be additional poll options.',
+ array('poll_title' => 'Poll Title', 'poll_option_text' => "\n A \nB\n\nC \n D\nE\n\n \n")
+ );
+
+ $crawler = self::request('GET', "viewtopic.php?t={$post['topic_id']}&sid={$this->sid}");
+ $this->assertEquals('Poll Title', $crawler->filter('.poll-title')->text());
+ $this->assertEquals(5, $crawler->filter('*[data-poll-option-id]')->count());
+ }
+
+ protected function set_quote_depth($depth)
+ {
+ $crawler = self::request('GET', 'adm/index.php?sid=' . $this->sid . '&i=acp_board&mode=post');
+ $form = $crawler->selectButton('Submit')->form();
+ $values = $form->getValues();
+ $values['config[max_quote_depth]'] = $depth;
+ $form->setValues($values);
+ $crawler = self::submit($form);
+ $this->assertEquals(1, $crawler->filter('.successbox')->count());
+ }
}
diff --git a/tests/functional/private_messages_test.php b/tests/functional/private_messages_test.php
index 15aa2b681a..1f6dc3a979 100644
--- a/tests/functional/private_messages_test.php
+++ b/tests/functional/private_messages_test.php
@@ -1,9 +1,13 @@
<?php
/**
*
-* @package testing
-* @copyright (c) 2014 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
diff --git a/tests/functional/prune_shadow_topic_test.php b/tests/functional/prune_shadow_topic_test.php
new file mode 100644
index 0000000000..c014119b98
--- /dev/null
+++ b/tests/functional/prune_shadow_topic_test.php
@@ -0,0 +1,211 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+/**
+* @group functional
+*/
+class phpbb_functional_prune_shadow_topic_test extends phpbb_functional_test_case
+{
+ protected $data = array();
+ protected $post;
+
+ public function test_setup_forums()
+ {
+ $this->login();
+ $this->admin_login();
+
+ $crawler = self::request('GET', "adm/index.php?i=acp_forums&mode=manage&sid={$this->sid}");
+ $form = $crawler->selectButton('addforum')->form(array(
+ 'forum_name' => 'Prune Shadow',
+ ));
+ $crawler = self::submit($form);
+ $form = $crawler->selectButton('update')->form(array(
+ 'forum_perm_from' => 2,
+ 'enable_shadow_prune' => true,
+ 'prune_shadow_freq' => 1,
+ 'prune_shadow_days' => 1,
+ ));
+ $crawler = self::submit($form);
+ }
+
+ public function test_create_post()
+ {
+ $this->login();
+ $this->load_ids(array(
+ 'forums' => array(
+ 'Prune Shadow',
+ ),
+ ));
+
+ $this->assert_forum_details($this->data['forums']['Prune Shadow'], array(
+ 'forum_posts_approved' => 0,
+ 'forum_posts_unapproved' => 0,
+ 'forum_posts_softdeleted' => 0,
+ 'forum_topics_approved' => 0,
+ 'forum_topics_unapproved' => 0,
+ 'forum_topics_softdeleted' => 0,
+ 'forum_last_post_id' => 0,
+ ), 'initial comparison');
+
+ // Test creating topic
+ $this->post = $this->create_topic($this->data['forums']['Prune Shadow'], 'Prune Shadow #1', 'This is a test topic posted by the testing framework.');
+ $crawler = self::request('GET', "viewtopic.php?t={$this->post['topic_id']}&sid={$this->sid}");
+
+ $this->assertContains('Prune Shadow #1', $crawler->filter('html')->text());
+ $this->data['topics']['Prune Shadow #1'] = (int) $this->post['topic_id'];
+ $this->data['posts']['Prune Shadow #1'] = (int) $this->get_parameter_from_link($crawler->filter('.post')->selectLink($this->lang('POST', '', ''))->link()->getUri(), 'p');
+
+ $this->assert_forum_details($this->data['forums']['Prune Shadow'], array(
+ 'forum_posts_approved' => 1,
+ 'forum_posts_unapproved' => 0,
+ 'forum_posts_softdeleted' => 0,
+ 'forum_topics_approved' => 1,
+ 'forum_topics_unapproved' => 0,
+ 'forum_topics_softdeleted' => 0,
+ 'forum_last_post_id' => $this->data['posts']['Prune Shadow #1'],
+ ), 'after creating topic #1');
+
+ // Test creating a reply
+ $post2 = $this->create_post($this->data['forums']['Prune Shadow'], $this->post['topic_id'], 'Re: Prune Shadow #1-#2', 'This is a test post posted by the testing framework.');
+ $crawler = self::request('GET', "viewtopic.php?t={$post2['topic_id']}&sid={$this->sid}");
+
+ $this->assertContains('Re: Prune Shadow #1-#2', $crawler->filter('html')->text());
+ $this->data['posts']['Re: Prune Shadow #1-#2'] = (int) $post2['post_id'];
+
+ $this->assert_forum_details($this->data['forums']['Prune Shadow'], array(
+ 'forum_posts_approved' => 2,
+ 'forum_posts_unapproved' => 0,
+ 'forum_posts_softdeleted' => 0,
+ 'forum_topics_approved' => 1,
+ 'forum_topics_unapproved' => 0,
+ 'forum_topics_softdeleted' => 0,
+ 'forum_last_post_id' => $this->data['posts']['Re: Prune Shadow #1-#2'],
+ ), 'after replying');
+ }
+
+ public function test_move_topic()
+ {
+ $this->login();
+ $this->load_ids(array(
+ 'forums' => array(
+ 'Prune Shadow',
+ ),
+ 'topics' => array(
+ 'Prune Shadow #1',
+ ),
+ ));
+
+ $crawler = self::request('GET', "mcp.php?f={$this->data['forums']['Prune Shadow']}&i=main&action=move&mode=forum_view&start=0&topic_id_list[]={$this->data['topics']['Prune Shadow #1']}&sid={$this->sid}");
+ $form = $crawler->selectButton('confirm')->form(array(
+ 'to_forum_id' => 2,
+ 'move_leave_shadow' => true,
+ ));
+ $crawler = self::submit($form);
+
+ $this->assert_forum_details($this->data['forums']['Prune Shadow'], array(
+ 'forum_posts_approved' => 0,
+ 'forum_posts_unapproved' => 0,
+ 'forum_posts_softdeleted' => 0,
+ 'forum_topics_approved' => 1,
+ 'forum_topics_unapproved' => 0,
+ 'forum_topics_softdeleted' => 0,
+ ), 'after moving');
+
+ $this->db = $this->get_db();
+ // Date topic 3 days back
+ $sql = 'UPDATE phpbb_topics
+ SET topic_last_post_time = ' . (time() - 60*60*24*3) . '
+ WHERE topic_id = ' . ($this->data['topics']['Prune Shadow #1'] + 1);
+ $result = $this->db->sql_query($sql);
+
+ $crawler = self::request('GET', "viewforum.php?f={$this->data['forums']['Prune Shadow']}&sid={$this->sid}");
+ $this->assertNotEmpty($crawler->filter('img')->last()->attr('src'));
+ self::request('GET', "cron.php?cron_type=cron.task.core.prune_shadow_topics&f={$this->data['forums']['Prune Shadow']}&sid={$this->sid}", array(), false);
+
+ $this->assert_forum_details($this->data['forums']['Prune Shadow'], array(
+ 'forum_posts_approved' => 0,
+ 'forum_posts_unapproved' => 0,
+ 'forum_posts_softdeleted' => 0,
+ 'forum_topics_approved' => 0,
+ 'forum_topics_unapproved' => 0,
+ 'forum_topics_softdeleted' => 0,
+ ), 'after the cron job');
+ }
+
+ public function assert_forum_details($forum_id, $details, $additional_error_message = '')
+ {
+ $this->db = $this->get_db();
+
+ $sql = 'SELECT ' . implode(', ', array_keys($details)) . '
+ FROM phpbb_forums
+ WHERE forum_id = ' . (int) $forum_id;
+ $result = $this->db->sql_query($sql);
+ $data = $this->db->sql_fetchrow($result);
+ $this->db->sql_freeresult($result);
+
+ $this->assertEquals($details, $data, "Forum {$forum_id} does not match expected {$additional_error_message}");
+ }
+
+ public function load_ids($data)
+ {
+ $this->db = $this->get_db();
+
+ if (!empty($data['forums']))
+ {
+ $sql = 'SELECT *
+ FROM phpbb_forums
+ WHERE ' . $this->db->sql_in_set('forum_name', $data['forums']);
+ $result = $this->db->sql_query($sql);
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ if (in_array($row['forum_name'], $data['forums']))
+ {
+ $this->data['forums'][$row['forum_name']] = (int) $row['forum_id'];
+ }
+ }
+ $this->db->sql_freeresult($result);
+ }
+
+ if (!empty($data['topics']))
+ {
+ $sql = 'SELECT *
+ FROM phpbb_topics
+ WHERE ' . $this->db->sql_in_set('topic_title', $data['topics']);
+ $result = $this->db->sql_query($sql);
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ if (in_array($row['topic_title'], $data['topics']))
+ {
+ $this->data['topics'][$row['topic_title']] = (int) $row['topic_id'];
+ }
+ }
+ $this->db->sql_freeresult($result);
+ }
+
+ if (!empty($data['posts']))
+ {
+ $sql = 'SELECT *
+ FROM phpbb_posts
+ WHERE ' . $this->db->sql_in_set('post_subject', $data['posts']);
+ $result = $this->db->sql_query($sql);
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ if (in_array($row['post_subject'], $data['posts']))
+ {
+ $this->data['posts'][$row['post_subject']] = (int) $row['post_id'];
+ }
+ }
+ $this->db->sql_freeresult($result);
+ }
+ }
+}
diff --git a/tests/functional/registration_test.php b/tests/functional/registration_test.php
new file mode 100644
index 0000000000..690f4ae9f2
--- /dev/null
+++ b/tests/functional/registration_test.php
@@ -0,0 +1,67 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+/**
+* @group functional
+*/
+class phpbb_functional_registration_test extends phpbb_functional_test_case
+{
+ public function test_disable_captcha_on_registration()
+ {
+ $this->login();
+ $this->admin_login();
+
+ $crawler = self::request('GET', "adm/index.php?i=acp_board&mode=registration&sid={$this->sid}");
+ $form = $crawler->selectButton('Submit')->form();
+ $form['config[enable_confirm]']->setValue('0');
+ $crawler = self::submit($form);
+
+ $this->assertContainsLang('CONFIG_UPDATED', $crawler->filter('#main .successbox')->text());
+ }
+
+ /**
+ * @depends test_disable_captcha_on_registration
+ */
+ public function test_register_new_account()
+ {
+ $this->add_lang('ucp');
+
+ $crawler = self::request('GET', 'ucp.php?mode=register');
+ $this->assertContainsLang('REGISTRATION', $crawler->filter('div.content h2')->text());
+
+ $form = $crawler->selectButton('I agree to these terms')->form();
+ $crawler = self::submit($form);
+
+ $form = $crawler->selectButton('Submit')->form(array(
+ 'username' => 'user-reg-test',
+ 'email' => 'user-reg-test@phpbb.com',
+ 'new_password' => 'user-reg-testuser-reg-test',
+ 'password_confirm' => 'user-reg-testuser-reg-test',
+ ));
+ $form['tz']->select('Europe/Berlin');
+ $crawler = self::submit($form);
+
+ $this->assertContainsLang('ACCOUNT_ADDED', $crawler->filter('#message')->text());
+ }
+
+ /**
+ * @depends test_register_new_account
+ */
+ public function test_default_subscription_options()
+ {
+ $this->login('user-reg-test');
+ $crawler = self::request('GET', 'ucp.php?i=ucp_notifications&mode=notification_options&sid=' . $this->sid);
+ $this->assert_checkbox_is_checked($crawler, 'notification.type.post_notification.method.email');
+ $this->assert_checkbox_is_checked($crawler, 'notification.type.topic_notification.method.email');
+ }
+}
diff --git a/tests/functional/report_post_captcha_test.php b/tests/functional/report_post_captcha_test.php
index 8283465041..93a03bd931 100644
--- a/tests/functional/report_post_captcha_test.php
+++ b/tests/functional/report_post_captcha_test.php
@@ -1,11 +1,15 @@
<?php
/**
- *
- * @package testing
- * @copyright (c) 2013 phpBB Group
- * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
- *
- */
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
/**
* @group functional
diff --git a/tests/functional/search/base.php b/tests/functional/search/base.php
new file mode 100644
index 0000000000..f1e9b517d4
--- /dev/null
+++ b/tests/functional/search/base.php
@@ -0,0 +1,108 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+/**
+* @group functional
+*/
+abstract class phpbb_functional_search_base extends phpbb_functional_test_case
+{
+ protected function assert_search_found($keywords, $posts_found, $words_highlighted)
+ {
+ $crawler = self::request('GET', 'search.php?keywords=' . $keywords);
+ $this->assertEquals($posts_found, $crawler->filter('.postbody')->count());
+ $this->assertEquals($words_highlighted, $crawler->filter('.posthilit')->count());
+ }
+
+ protected function assert_search_not_found($keywords)
+ {
+ $crawler = self::request('GET', 'search.php?keywords=' . $keywords);
+ $this->assertEquals(0, $crawler->filter('.postbody')->count());
+ $split_keywords_string = str_replace(array('+', '-'), ' ', $keywords);
+ $this->assertEquals($split_keywords_string, $crawler->filter('#keywords')->attr('value'));
+ }
+
+ public function test_search_backend()
+ {
+ $this->login();
+ $this->admin_login();
+
+ $post = $this->create_topic(2, 'Test Topic 1 foosubject', 'This is a test topic posted by the barsearch testing framework.');
+
+ $crawler = self::request('GET', 'adm/index.php?i=acp_search&mode=settings&sid=' . $this->sid);
+ $form = $crawler->selectButton('Submit')->form();
+ $values = $form->getValues();
+
+ if ($values["config[search_type]"] != $this->search_backend)
+ {
+ $values["config[search_type]"] = $this->search_backend;
+ $form->setValues($values);
+ $crawler = self::submit($form);
+
+ $form = $crawler->selectButton('Yes')->form();
+ $values = $form->getValues();
+ $crawler = self::submit($form);
+
+ // check if search backend is not supported
+ if ($crawler->filter('.errorbox')->count() > 0)
+ {
+ $this->delete_topic($post['topic_id']);
+ $this->markTestSkipped("Search backend is not supported/running");
+ }
+ $this->create_search_index();
+ }
+
+ $this->logout();
+ $this->assert_search_found('phpbb3+installation', 1, 3);
+ $this->assert_search_found('foosubject+barsearch', 1, 2);
+ $this->assert_search_not_found('loremipsumdedo');
+
+ $this->login();
+ $this->admin_login();
+ $this->delete_search_index();
+ $this->delete_topic($post['topic_id']);
+ }
+
+ protected function create_search_index()
+ {
+ $this->add_lang('acp/search');
+ $crawler = self::request('GET', 'adm/index.php?i=acp_search&mode=index&sid=' . $this->sid);
+ $form = $crawler->selectButton('Create index')->form();
+ $form_values = $form->getValues();
+ $form_values = array_merge($form_values,
+ array(
+ 'search_type' => $this->search_backend,
+ 'action' => 'create',
+ )
+ );
+ $form->setValues($form_values);
+ $crawler = self::submit($form);
+ $this->assertContainsLang('SEARCH_INDEX_CREATED', $crawler->text());
+ }
+
+ protected function delete_search_index()
+ {
+ $this->add_lang('acp/search');
+ $crawler = self::request('GET', 'adm/index.php?i=acp_search&mode=index&sid=' . $this->sid);
+ $form = $crawler->selectButton('Delete index')->form();
+ $form_values = $form->getValues();
+ $form_values = array_merge($form_values,
+ array(
+ 'search_type' => $this->search_backend,
+ 'action' => 'delete',
+ )
+ );
+ $form->setValues($form_values);
+ $crawler = self::submit($form);
+ $this->assertContainsLang('SEARCH_INDEX_REMOVED', $crawler->text());
+ }
+}
diff --git a/tests/functional/search/mysql_test.php b/tests/functional/search/mysql_test.php
new file mode 100644
index 0000000000..a97b12e905
--- /dev/null
+++ b/tests/functional/search/mysql_test.php
@@ -0,0 +1,23 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+require_once dirname(__FILE__) . '/base.php';
+
+/**
+* @group functional
+*/
+class phpbb_functional_search_mysql_test extends phpbb_functional_search_base
+{
+ protected $search_backend = '\phpbb\search\fulltext_mysql';
+
+}
diff --git a/tests/functional/search/native_test.php b/tests/functional/search/native_test.php
new file mode 100644
index 0000000000..9908b9cdaa
--- /dev/null
+++ b/tests/functional/search/native_test.php
@@ -0,0 +1,22 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+require_once dirname(__FILE__) . '/base.php';
+
+/**
+* @group functional
+*/
+class phpbb_functional_search_native_test extends phpbb_functional_search_base
+{
+ protected $search_backend = '\phpbb\search\fulltext_native';
+}
diff --git a/tests/functional/search/postgres_test.php b/tests/functional/search/postgres_test.php
new file mode 100644
index 0000000000..a76cc13493
--- /dev/null
+++ b/tests/functional/search/postgres_test.php
@@ -0,0 +1,23 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+require_once dirname(__FILE__) . '/base.php';
+
+/**
+* @group functional
+*/
+class phpbb_functional_search_postgres_test extends phpbb_functional_search_base
+{
+ protected $search_backend = '\phpbb\search\fulltext_postgres';
+
+}
diff --git a/tests/functional/search/sphinx_test.php b/tests/functional/search/sphinx_test.php
new file mode 100644
index 0000000000..4bf1ab0e16
--- /dev/null
+++ b/tests/functional/search/sphinx_test.php
@@ -0,0 +1,27 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+require_once dirname(__FILE__) . '/base.php';
+
+/**
+* @group functional
+*/
+class phpbb_functional_search_sphinx_test extends phpbb_functional_search_base
+{
+ protected $search_backend = '\phpbb\search\fulltext_sphinx';
+
+ public function test_search_backend()
+ {
+ $this->markTestIncomplete('Sphinx Tests are not supported');
+ }
+}
diff --git a/tests/functional/ucp_allow_pm_test.php b/tests/functional/ucp_allow_pm_test.php
new file mode 100644
index 0000000000..2d41296ddf
--- /dev/null
+++ b/tests/functional/ucp_allow_pm_test.php
@@ -0,0 +1,74 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+/**
+* @group functional
+*/
+class phpbb_functional_ucp_allow_pm_test extends phpbb_functional_test_case
+{
+ static protected $data = array();
+
+ public function __construct()
+ {
+ parent::__construct();
+
+ $this->backupStaticAttributesBlacklist += array(
+ 'phpbb_functional_ucp_allow_pm_test' => array('data'),
+ );
+ }
+
+ // user A sends a PM to user B where B accepts PM
+ public function test_enabled_pm_user_to_user()
+ {
+ // setup
+ $this->create_user('test_ucp_allow_pm_sender');
+ $this->login('test_ucp_allow_pm_sender');
+ self::$data['recipient_id'] = $this->create_user('test_ucp_allow_pm_recipient');
+ self::$data['pm_url'] = "ucp.php?i=pm&mode=compose&u=" . (int) self::$data['recipient_id'] . "&sid={$this->sid}";
+
+ // the actual test
+ $this->set_user_allow_pm(self::$data['recipient_id'], 1);
+ $crawler = self::request('GET', self::$data['pm_url']);
+ $this->assertNotContainsLang('PM_USERS_REMOVED_NO_PM', $crawler->filter('html')->text());
+ }
+
+ // user A sends a PM to user B where B does not accept PM
+ public function test_disabled_pm_user_to_user()
+ {
+ $this->login('test_ucp_allow_pm_sender');
+ $this->set_user_allow_pm(self::$data['recipient_id'], 0);
+ $crawler = self::request('GET', self::$data['pm_url']);
+ $this->assertContainsLang('PM_USERS_REMOVED_NO_PM', $crawler->filter('.error')->text());
+ }
+
+
+ // An admin sends a PM to user B where B does not accept PM, but cannot
+ // ignore a PM from an admin
+ public function test_disabled_pm_admin_to_user()
+ {
+ $this->login();
+ $crawler = self::request('GET', self::$data['pm_url']);
+ $this->assertNotContainsLang('PM_USERS_REMOVED_NO_PM', $crawler->filter('html')->text());
+ }
+
+ // enable or disable PM for a user, like from ucp
+ protected function set_user_allow_pm($user_id, $allow)
+ {
+ $db = $this->get_db();
+ $sql = 'UPDATE ' . USERS_TABLE . "
+ SET user_allow_pm = " . $allow . "
+ WHERE user_id = " . $user_id;
+ $result = $db->sql_query($sql);
+ $db->sql_freeresult($result);
+ }
+}
diff --git a/tests/functional/ucp_groups_test.php b/tests/functional/ucp_groups_test.php
index 9c6b1edc5e..cd18a0fcae 100644
--- a/tests/functional/ucp_groups_test.php
+++ b/tests/functional/ucp_groups_test.php
@@ -1,21 +1,57 @@
<?php
/**
*
-* @package testing
-* @copyright (c) 2013 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
-require_once dirname(__FILE__) . '/common_groups_test.php';
+require_once dirname(__FILE__) . '/common_groups_test_case.php';
/**
* @group functional
*/
-class phpbb_functional_ucp_groups_test extends phpbb_functional_common_groups_test
+class phpbb_functional_ucp_groups_test extends phpbb_functional_common_groups_test_case
{
+ protected $db;
+
protected function get_url()
{
return 'ucp.php?i=groups&mode=manage&action=edit';
}
+
+ protected function get_teampage_settings()
+ {
+ if (!isset($this->db))
+ {
+ $this->db = $this->get_db();
+ }
+ $sql = 'SELECT g.group_legend AS group_legend, t.teampage_position AS group_teampage
+ FROM ' . GROUPS_TABLE . ' g
+ LEFT JOIN ' . TEAMPAGE_TABLE . ' t
+ ON (t.group_id = g.group_id)
+ WHERE g.group_id = 5';
+ $result = $this->db->sql_query($sql);
+ $group_row = $this->db->sql_fetchrow($result);
+ $this->db->sql_freeresult($result);
+ return $group_row;
+ }
+
+ public function test_ucp_groups_teampage()
+ {
+ $this->group_manage_login();
+
+ // Test if group_legend or group_teampage are modified while
+ // submitting the ucp_group_manage page
+ $form = $this->get_group_manage_form();
+ $teampage_settings = $this->get_teampage_settings();
+ $crawler = self::submit($form);
+ $this->assertContains($this->lang('GROUP_UPDATED'), $crawler->text());
+ $this->assertEquals($teampage_settings, $this->get_teampage_settings());
+ }
}
diff --git a/tests/functional/ucp_pm_test.php b/tests/functional/ucp_pm_test.php
new file mode 100644
index 0000000000..ddd5c8d791
--- /dev/null
+++ b/tests/functional/ucp_pm_test.php
@@ -0,0 +1,52 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+/**
+* @group functional
+*/
+class phpbb_functional_ucp_pm_test extends phpbb_functional_test_case
+{
+ public function setUp()
+ {
+ parent::setUp();
+ $this->login();
+ $this->admin_login();
+ }
+
+ public function test_pm_enabled()
+ {
+ $crawler = self::request('GET', 'ucp.php');
+ $this->assertContainsLang('PRIVATE_MESSAGES', $crawler->filter('html')->text());
+ }
+
+ public function test_pm_disabled()
+ {
+ $this->set_allow_pm(0);
+ $crawler = self::request('GET', 'ucp.php');
+ $this->assertNotContainsLang('PRIVATE_MESSAGES', $crawler->filter('html')->text());
+ $this->set_allow_pm(1);
+ }
+
+ protected function set_allow_pm($enable_pm)
+ {
+ $crawler = self::request('GET', 'adm/index.php?sid=' . $this->sid . '&i=acp_board&mode=message');
+
+ $form = $crawler->selectButton('Submit')->form();
+ $values = $form->getValues();
+
+ $values["config[allow_privmsg]"] = $enable_pm;
+ $form->setValues($values);
+ $crawler = self::submit($form);
+ $this->assertGreaterThan(0, $crawler->filter('.successbox')->count());
+ }
+}
diff --git a/tests/functional/ucp_preferences_test.php b/tests/functional/ucp_preferences_test.php
new file mode 100644
index 0000000000..7ef325dc4b
--- /dev/null
+++ b/tests/functional/ucp_preferences_test.php
@@ -0,0 +1,85 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+/**
+* @group functional
+*/
+class phpbb_functional_ucp_preferences_test extends phpbb_functional_test_case
+{
+ public function test_submitting_preferences_view()
+ {
+ $this->add_lang('ucp');
+ $this->login();
+
+ $crawler = self::request('GET', 'ucp.php?i=ucp_prefs&mode=view');
+ $this->assertContainsLang('UCP_PREFS_VIEW', $crawler->filter('#cp-main h2')->text());
+
+ $form = $crawler->selectButton('Submit')->form(array(
+ 'topic_sk' => 'a',
+ 'topic_sd' => 'a',
+ 'topic_st' => '1',
+ 'post_sk' => 'a',
+ 'post_sd' => 'a',
+ 'post_st' => '1',
+ ));
+
+ $crawler = self::submit($form);
+ $this->assertContainsLang('PREFERENCES_UPDATED', $crawler->filter('#message')->text());
+ }
+
+ public function test_submitting_invalid_preferences_view()
+ {
+ $this->add_lang('ucp');
+ $this->login();
+
+ $crawler = self::request('GET', 'ucp.php?i=ucp_prefs&mode=view');
+ $this->assertContainsLang('UCP_PREFS_VIEW', $crawler->filter('#cp-main h2')->text());
+ $form = $crawler->selectButton('Submit')->form();
+
+ if (!method_exists($form, 'disableValidation'))
+ {
+ $this->markTestIncomplete('The crawler cannot select invalid values, until Symfony 2.4!');
+ }
+
+ $form = $form->disableValidation();
+ $form['topic_sk']->select('z');
+ $form['topic_sd']->select('z');
+ $form['topic_st']->select('test');
+ $form['post_sk']->select('z');
+ $form['post_sd']->select('z');
+ $form['post_st']->select('test');
+
+ $crawler = self::submit($form);
+ $this->assertContainsLang('WRONG_DATA_POST_SD', $crawler->filter('#cp-main')->text());
+ $this->assertContainsLang('WRONG_DATA_POST_SK', $crawler->filter('#cp-main')->text());
+ $this->assertContainsLang('WRONG_DATA_TOPIC_SD', $crawler->filter('#cp-main')->text());
+ $this->assertContainsLang('WRONG_DATA_TOPIC_SK', $crawler->filter('#cp-main')->text());
+ }
+
+ public function test_read_preferences_view()
+ {
+ $this->add_lang('ucp');
+ $this->login();
+
+ $crawler = self::request('GET', 'ucp.php?i=ucp_prefs&mode=view');
+ $this->assertContainsLang('UCP_PREFS_VIEW', $crawler->filter('#cp-main h2')->text());
+ $form = $crawler->selectButton('Submit')->form();
+
+ $this->assertEquals('a', $form->get('topic_sk')->getValue());
+ $this->assertEquals('a', $form->get('topic_sd')->getValue());
+ $this->assertEquals('1', $form->get('topic_st')->getValue());
+ $this->assertEquals('a', $form->get('post_sk')->getValue());
+ $this->assertEquals('a', $form->get('post_sd')->getValue());
+ $this->assertEquals('1', $form->get('post_st')->getValue());
+ }
+}
diff --git a/tests/functional/ucp_profile_test.php b/tests/functional/ucp_profile_test.php
new file mode 100644
index 0000000000..e7abba9255
--- /dev/null
+++ b/tests/functional/ucp_profile_test.php
@@ -0,0 +1,49 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+/**
+* @group functional
+*/
+class phpbb_functional_ucp_profile_test extends phpbb_functional_test_case
+{
+ public function test_submitting_profile_info()
+ {
+ $this->add_lang('ucp');
+ $this->login();
+
+ $crawler = self::request('GET', 'ucp.php?i=ucp_profile&mode=profile_info');
+ $this->assertContainsLang('UCP_PROFILE_PROFILE_INFO', $crawler->filter('#cp-main h2')->text());
+
+ $form = $crawler->selectButton('Submit')->form(array(
+ 'pf_phpbb_facebook' => 'phpbb',
+ 'pf_phpbb_googleplus' => 'phpbb',
+ 'pf_phpbb_location' => 'Bertie´s Empire',
+ 'pf_phpbb_skype' => 'phpbb.skype.account',
+ 'pf_phpbb_twitter' => 'phpbb_twitter',
+ 'pf_phpbb_youtube' => 'phpbb.youtube',
+ ));
+
+ $crawler = self::submit($form);
+ $this->assertContainsLang('PROFILE_UPDATED', $crawler->filter('#message')->text());
+
+ $crawler = self::request('GET', 'ucp.php?i=ucp_profile&mode=profile_info');
+ $form = $crawler->selectButton('Submit')->form();
+
+ $this->assertEquals('phpbb', $form->get('pf_phpbb_facebook')->getValue());
+ $this->assertEquals('phpbb', $form->get('pf_phpbb_googleplus')->getValue());
+ $this->assertEquals('Bertie´s Empire', $form->get('pf_phpbb_location')->getValue());
+ $this->assertEquals('phpbb.skype.account', $form->get('pf_phpbb_skype')->getValue());
+ $this->assertEquals('phpbb_twitter', $form->get('pf_phpbb_twitter')->getValue());
+ $this->assertEquals('phpbb.youtube', $form->get('pf_phpbb_youtube')->getValue());
+ }
+}
diff --git a/tests/functional/user_password_reset_test.php b/tests/functional/user_password_reset_test.php
new file mode 100644
index 0000000000..3da78407cf
--- /dev/null
+++ b/tests/functional/user_password_reset_test.php
@@ -0,0 +1,169 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+/**
+* @group functional
+*/
+class phpbb_functional_user_password_reset_test extends phpbb_functional_test_case
+{
+ protected $user_data;
+
+ public function test_password_reset()
+ {
+ $this->add_lang('ucp');
+ $user_id = $this->create_user('reset-password-test-user');
+
+ $crawler = self::request('GET', "ucp.php?mode=sendpassword&sid={$this->sid}");
+ $form = $crawler->selectButton('submit')->form(array(
+ 'username' => 'reset-password-test-user',
+ ));
+ $crawler = self::submit($form);
+ $this->assertContainsLang('NO_EMAIL_USER', $crawler->text());
+
+ $crawler = self::request('GET', "ucp.php?mode=sendpassword&sid={$this->sid}");
+ $form = $crawler->selectButton('submit')->form(array(
+ 'username' => 'reset-password-test-user',
+ 'email' => 'nobody@example.com',
+ ));
+ $crawler = self::submit($form);
+ $this->assertContainsLang('PASSWORD_UPDATED', $crawler->text());
+
+ // Check if columns in database were updated for password reset
+ $this->get_user_data();
+ $this->assertNotNull($this->user_data['user_actkey']);
+ $this->assertNotNull($this->user_data['user_newpasswd']);
+
+ // Make sure we know the password
+ $db = $this->get_db();
+ $this->passwords_manager = $this->get_passwords_manager();
+ $sql = 'UPDATE ' . USERS_TABLE . "
+ SET user_newpasswd = '" . $db->sql_escape($this->passwords_manager->hash('reset-password-test-user')) . "'
+ WHERE user_id = " . $user_id;
+ $db->sql_query($sql);
+ }
+
+ public function test_login_after_reset()
+ {
+ $this->login('reset-password-test-user');
+ }
+
+ public function data_activate_new_password()
+ {
+ return array(
+ array('WRONG_ACTIVATION', false, 'FOOBAR'),
+ array('ALREADY_ACTIVATED', 2, 'FOOBAR'),
+ array('PASSWORD_ACTIVATED', false, false),
+ array('ALREADY_ACTIVATED', false, false),
+ );
+ }
+
+ /**
+ * @dataProvider data_activate_new_password
+ */
+ public function test_activate_new_password($expected, $user_id, $act_key)
+ {
+ $this->add_lang('ucp');
+ $this->get_user_data();
+ $user_id = (!$user_id) ? $this->user_data['user_id'] : $user_id;
+ $act_key = (!$act_key) ? $this->user_data['user_actkey'] : $act_key;
+
+ $crawler = self::request('GET', "ucp.php?mode=activate&u=$user_id&k=$act_key&sid={$this->sid}");
+ $this->assertContainsLang($expected, $crawler->text());
+ }
+
+ public function test_login()
+ {
+ $this->add_lang('ucp');
+ $crawler = self::request('GET', 'ucp.php');
+ $this->assertContains($this->lang('LOGIN_EXPLAIN_UCP'), $crawler->filter('html')->text());
+
+ $form = $crawler->selectButton($this->lang('LOGIN'))->form();
+ $crawler = self::submit($form, array('username' => 'reset-password-test-user', 'password' => 'reset-password-test-user'));
+ $this->assertNotContains($this->lang('LOGIN'), $crawler->filter('.navbar')->text());
+
+ $cookies = self::$cookieJar->all();
+
+ // The session id is stored in a cookie that ends with _sid - we assume there is only one such cookie
+ foreach ($cookies as $cookie);
+ {
+ if (substr($cookie->getName(), -4) == '_sid')
+ {
+ $this->sid = $cookie->getValue();
+ }
+ }
+
+ $this->logout();
+
+ $crawler = self::request('GET', 'ucp.php');
+ $this->assertContains($this->lang('LOGIN_EXPLAIN_UCP'), $crawler->filter('html')->text());
+
+ $form = $crawler->selectButton($this->lang('LOGIN'))->form();
+ // Try logging in with the old password
+ $crawler = self::submit($form, array('username' => 'reset-password-test-user', 'password' => 'reset-password-test-userreset-password-test-user'));
+ $this->assertContains($this->lang('LOGIN_ERROR_PASSWORD', '', ''), $crawler->filter('html')->text());
+ }
+
+ /**
+ * @depends test_login
+ */
+ public function test_acivateAfterDeactivate()
+ {
+ // User is active, actkey should not exist
+ $this->get_user_data();
+ $this->assertEmpty($this->user_data['user_actkey']);
+
+ $this->login();
+ $this->admin_login();
+ $this->add_lang('acp/users');
+
+ // Go to user account page
+ $crawler = self::request('GET', 'adm/index.php?i=acp_users&mode=overview&sid=' . $this->sid);
+ $this->assertContainsLang('FIND_USERNAME', $crawler->filter('html')->text());
+
+ $form = $crawler->selectButton('Submit')->form();
+ $crawler = self::submit($form, array('username' => 'reset-password-test-user'));
+
+ // Deactivate account and go back to overview of current user
+ $this->assertContainsLang('USER_TOOLS', $crawler->filter('html')->text());
+ $form = $crawler->filter('input[name=update]')->selectButton('Submit')->form();
+ $crawler = self::submit($form, array('action' => 'active'));
+
+ $this->assertContainsLang('USER_ADMIN_DEACTIVED', $crawler->filter('html')->text());
+ $link = $crawler->selectLink('Back to previous page')->link();
+ $crawler = self::request('GET', preg_replace('#(.+)(adm/index.php.+)#', '$2', $link->getUri()));
+
+ // Ensure again that actkey is empty after deactivation
+ $this->get_user_data();
+ $this->assertEmpty($this->user_data['user_actkey']);
+
+ // Force reactivation of account and check that act key is not empty anymore
+ $this->assertContainsLang('USER_TOOLS', $crawler->filter('html')->text());
+ $form = $crawler->filter('input[name=update]')->selectButton('Submit')->form();
+ $crawler = self::submit($form, array('action' => 'reactivate'));
+ $this->assertContainsLang('FORCE_REACTIVATION_SUCCESS', $crawler->filter('html')->text());
+
+ $this->get_user_data();
+ $this->assertNotEmpty($this->user_data['user_actkey']);
+ }
+
+ protected function get_user_data()
+ {
+ $db = $this->get_db();
+ $sql = 'SELECT user_id, username, user_type, user_email, user_newpasswd, user_lang, user_notify_type, user_actkey, user_inactive_reason
+ FROM ' . USERS_TABLE . "
+ WHERE username = 'reset-password-test-user'";
+ $result = $db->sql_query($sql);
+ $this->user_data = $db->sql_fetchrow($result);
+ $db->sql_freeresult($result);
+ }
+}
diff --git a/tests/functional/viewforum_paging_test.php b/tests/functional/viewforum_paging_test.php
new file mode 100644
index 0000000000..4a574bebbb
--- /dev/null
+++ b/tests/functional/viewforum_paging_test.php
@@ -0,0 +1,256 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+/**
+* @group functional
+*/
+class viewforum_paging_test extends phpbb_functional_test_case
+{
+ protected $data = array();
+
+ public function test_setup_forums()
+ {
+ $this->login();
+ $this->admin_login();
+
+ $crawler = self::request('GET', "adm/index.php?i=acp_forums&mode=manage&sid={$this->sid}");
+ $form = $crawler->selectButton('addforum')->form(array(
+ 'forum_name' => 'Viewforum Pagination Test #1',
+ ));
+ $crawler = self::submit($form);
+ $form = $crawler->selectButton('update')->form(array(
+ 'forum_perm_from' => 2,
+ ));
+ self::submit($form);
+
+ $crawler = self::request('GET', "adm/index.php?i=acp_forums&mode=manage&sid={$this->sid}");
+ $form = $crawler->selectButton('addforum')->form(array(
+ 'forum_name' => 'Viewforum Pagination Test #2',
+ ));
+ $crawler = self::submit($form);
+ $form = $crawler->selectButton('update')->form(array(
+ 'forum_perm_from' => 2,
+ ));
+ self::submit($form);
+
+ $this->set_post_settings(array(
+ 'flood_interval' => 0,
+ 'topics_per_page' => 3,
+ ));
+ }
+
+ public function test_create_posts()
+ {
+ $this->login();
+ $this->load_ids(array(
+ 'forums' => array(
+ 'Viewforum Pagination Test #1',
+ 'Viewforum Pagination Test #2',
+ ),
+ ));
+
+ $this->assert_forum_details($this->data['forums']['Viewforum Pagination Test #1'], array(
+ 'forum_posts_approved' => 0,
+ 'forum_posts_unapproved' => 0,
+ 'forum_posts_softdeleted' => 0,
+ 'forum_topics_approved' => 0,
+ 'forum_topics_unapproved' => 0,
+ 'forum_topics_softdeleted' => 0,
+ 'forum_last_post_id' => 0,
+ ), 'initial comparison');
+
+ for ($topic_id = 1; $topic_id <= 6; $topic_id++)
+ {
+ $this->create_topic($this->data['forums']['Viewforum Pagination Test #1'], 'Viewforum Pagination TestTopic #' . $topic_id, 'This is a test topic posted by the testing framework.');
+ }
+
+ $this->create_topic($this->data['forums']['Viewforum Pagination Test #2'], 'Viewforum Pagination TestTopic #GA1', 'This is a test topic posted by the testing framework.', array(
+ 'topic_type' => POST_GLOBAL,
+ ));
+
+ $this->assert_forum_details($this->data['forums']['Viewforum Pagination Test #1'], array(
+ 'forum_posts_approved' => 6,
+ 'forum_posts_unapproved' => 0,
+ 'forum_posts_softdeleted' => 0,
+ 'forum_topics_approved' => 6,
+ 'forum_topics_unapproved' => 0,
+ 'forum_topics_softdeleted' => 0,
+ ), 'after creating topics');
+
+ $this->assert_forum_details($this->data['forums']['Viewforum Pagination Test #2'], array(
+ 'forum_posts_approved' => 1,
+ 'forum_posts_unapproved' => 0,
+ 'forum_posts_softdeleted' => 0,
+ 'forum_topics_approved' => 1,
+ 'forum_topics_unapproved' => 0,
+ 'forum_topics_softdeleted' => 0,
+ ), 'after creating GA');
+
+ // Set flood interval back to 15
+ $this->admin_login();
+ $this->set_post_settings(array(
+ 'flood_interval' => 15,
+ ));
+ }
+
+ public function test_viewforum_first_page()
+ {
+ $this->load_ids(array(
+ 'forums' => array(
+ 'Viewforum Pagination Test #1',
+ 'Viewforum Pagination Test #2',
+ ),
+ ));
+ $crawler = self::request('GET', 'viewforum.php?f=' . $this->data['forums']['Viewforum Pagination Test #1']);
+
+ // Test the topics that are displayed
+ $topiclists = $crawler->filter('.forumbg .topics');
+ $this->assertEquals(2, $topiclists->count());
+ $topiclist = $topiclists->eq(0)->filter('li');
+ $this->assertStringEndsWith('TestTopic #GA1', $topiclist->eq(0)->filter('.topictitle')->text());
+ $topiclist = $topiclists->eq(1)->filter('li');
+ $this->assertStringEndsWith('TestTopic #6', $topiclist->eq(0)->filter('.topictitle')->text());
+ $this->assertStringEndsWith('TestTopic #5', $topiclist->eq(1)->filter('.topictitle')->text());
+ $this->assertStringEndsWith('TestTopic #4', $topiclist->eq(2)->filter('.topictitle')->text());
+
+ // Test the pagination, should only have: 1 - 2 - Next
+ $this->assertEquals(2, $crawler->filter('div.pagination')->count());
+ $top_pagination = $crawler->filter('div.pagination')->eq(0);
+ $this->assertEquals(3, $top_pagination->filter('li')->count(), 'Number of pagination items on page 1 does not match');
+ $this->assertContains('1', $top_pagination->filter('li')->eq(0)->text());
+ $this->assertContains('2', $top_pagination->filter('li')->eq(1)->text());
+ $this->assertContainsLang('NEXT', $top_pagination->filter('li')->eq(2)->text());
+ }
+
+ public function test_viewforum_second_page()
+ {
+ $this->load_ids(array(
+ 'forums' => array(
+ 'Viewforum Pagination Test #1',
+ 'Viewforum Pagination Test #2',
+ ),
+ ));
+ $crawler = self::request('GET', 'viewforum.php?f=' . $this->data['forums']['Viewforum Pagination Test #1'] . '&start=3');
+
+ // Test the topics that are displayed
+ $topiclists = $crawler->filter('.forumbg .topics');
+ $this->assertEquals(2, $topiclists->count());
+ $topiclist = $topiclists->eq(0)->filter('li');
+ $this->assertStringEndsWith('TestTopic #GA1', $topiclist->eq(0)->filter('.topictitle')->text());
+ $topiclist = $topiclists->eq(1)->filter('li');
+ $this->assertStringEndsWith('TestTopic #3', $topiclist->eq(0)->filter('.topictitle')->text());
+ $this->assertStringEndsWith('TestTopic #2', $topiclist->eq(1)->filter('.topictitle')->text());
+ $this->assertStringEndsWith('TestTopic #1', $topiclist->eq(2)->filter('.topictitle')->text());
+
+ // Test the pagination, should only have: Previous - 1 - 2
+ $this->assertEquals(2, $crawler->filter('div.pagination')->count());
+ $top_pagination = $crawler->filter('div.pagination')->eq(0);
+ $this->assertEquals(3, $top_pagination->filter('li')->count(), 'Number of pagination items on page 2 does not match');
+ $this->assertContainsLang('PREVIOUS', $top_pagination->filter('li')->eq(0)->text());
+ $this->assertContains('1', $top_pagination->filter('li')->eq(1)->text());
+ $this->assertContains('2', $top_pagination->filter('li')->eq(2)->text());
+ }
+
+ protected function assert_forum_details($forum_id, $details, $additional_error_message = '')
+ {
+ $this->db = $this->get_db();
+
+ $sql = 'SELECT ' . implode(', ', array_keys($details)) . '
+ FROM phpbb_forums
+ WHERE forum_id = ' . (int) $forum_id;
+ $result = $this->db->sql_query($sql);
+ $data = $this->db->sql_fetchrow($result);
+ $this->db->sql_freeresult($result);
+
+ $this->assertEquals($details, $data, "Forum {$forum_id} does not match expected {$additional_error_message}");
+ }
+
+ /**
+ * Sets the post setting via the ACP page
+ *
+ * @param array $settings
+ */
+ protected function set_post_settings($settings)
+ {
+ $crawler = self::request('GET', 'adm/index.php?sid=' . $this->sid . '&i=acp_board&mode=post');
+
+ $form = $crawler->selectButton('Submit')->form();
+ $values = $form->getValues();
+
+ foreach ($settings as $setting => $value)
+ {
+ $values["config[{$setting}]"] = $value;
+ }
+ $form->setValues($values);
+ $crawler = self::submit($form);
+ $this->assertGreaterThan(0, $crawler->filter('.successbox')->count());
+ }
+
+ /**
+ * Loads forum, topic and post IDs
+ *
+ * @param array $data
+ */
+ protected function load_ids($data)
+ {
+ $this->db = $this->get_db();
+
+ if (!empty($data['forums']))
+ {
+ $sql = 'SELECT *
+ FROM phpbb_forums
+ WHERE ' . $this->db->sql_in_set('forum_name', $data['forums']);
+ $result = $this->db->sql_query($sql);
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ if (in_array($row['forum_name'], $data['forums']))
+ {
+ $this->data['forums'][$row['forum_name']] = (int) $row['forum_id'];
+ }
+ }
+ $this->db->sql_freeresult($result);
+ }
+
+ if (!empty($data['topics']))
+ {
+ $sql = 'SELECT *
+ FROM phpbb_topics
+ WHERE ' . $this->db->sql_in_set('topic_title', $data['topics']);
+ $result = $this->db->sql_query($sql);
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ if (in_array($row['topic_title'], $data['topics']))
+ {
+ $this->data['topics'][$row['topic_title']] = (int) $row['topic_id'];
+ }
+ }
+ $this->db->sql_freeresult($result);
+ }
+
+ if (!empty($data['posts']))
+ {
+ $sql = 'SELECT *
+ FROM phpbb_posts
+ WHERE ' . $this->db->sql_in_set('post_subject', $data['posts']);
+ $result = $this->db->sql_query($sql);
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ if (in_array($row['post_subject'], $data['posts']))
+ {
+ $this->data['posts'][$row['post_subject']] = (int) $row['post_id'];
+ }
+ }
+ $this->db->sql_freeresult($result);
+ }
+ }
+}
diff --git a/tests/functional/visibility_disapprove_test.php b/tests/functional/visibility_disapprove_test.php
new file mode 100644
index 0000000000..6f6edba422
--- /dev/null
+++ b/tests/functional/visibility_disapprove_test.php
@@ -0,0 +1,323 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+/**
+* @group functional
+*/
+class phpbb_functional_visibility_disapprove_test extends phpbb_functional_test_case
+{
+ protected $data = array();
+
+ public function test_setup_forums()
+ {
+ $this->login();
+ $this->admin_login();
+
+ $crawler = self::request('GET', "adm/index.php?i=acp_forums&mode=manage&sid={$this->sid}");
+ $form = $crawler->selectButton('addforum')->form(array(
+ 'forum_name' => 'Disapprove Test #1',
+ ));
+ $crawler = self::submit($form);
+ $form = $crawler->selectButton('update')->form(array(
+ 'forum_perm_from' => 2,
+ ));
+ $crawler = self::submit($form);
+
+ // Set flood interval to 0
+ $this->set_flood_interval(0);
+ }
+
+ public function test_create_posts()
+ {
+ $this->login();
+ $this->load_ids(array(
+ 'forums' => array(
+ 'Disapprove Test #1',
+ ),
+ ));
+
+ $this->assert_forum_details($this->data['forums']['Disapprove Test #1'], array(
+ 'forum_posts_approved' => 0,
+ 'forum_posts_unapproved' => 0,
+ 'forum_posts_softdeleted' => 0,
+ 'forum_topics_approved' => 0,
+ 'forum_topics_unapproved' => 0,
+ 'forum_topics_softdeleted' => 0,
+ 'forum_last_post_id' => 0,
+ ), 'initial comparison');
+
+ // Test creating topic #1
+ $post = $this->create_topic($this->data['forums']['Disapprove Test #1'], 'Disapprove Test Topic #1', 'This is a test topic posted by the testing framework.');
+ $crawler = self::request('GET', "viewtopic.php?t={$post['topic_id']}&sid={$this->sid}");
+
+ $this->assertContains('Disapprove Test Topic #1', $crawler->filter('html')->text());
+ $this->data['topics']['Disapprove Test Topic #1'] = (int) $post['topic_id'];
+ $this->data['posts']['Disapprove Test Topic #1'] = (int) $this->get_parameter_from_link($crawler->filter('.post')->selectLink($this->lang('POST', '', ''))->link()->getUri(), 'p');
+
+ $this->assert_forum_details($this->data['forums']['Disapprove Test #1'], array(
+ 'forum_posts_approved' => 1,
+ 'forum_posts_unapproved' => 0,
+ 'forum_posts_softdeleted' => 0,
+ 'forum_topics_approved' => 1,
+ 'forum_topics_unapproved' => 0,
+ 'forum_topics_softdeleted' => 0,
+ 'forum_last_post_id' => $this->data['posts']['Disapprove Test Topic #1'],
+ ), 'after creating topic #1');
+
+ $this->logout();
+ $this->create_user('disapprove_testuser');
+ $this->add_user_group('NEWLY_REGISTERED', array('disapprove_testuser'));
+ $this->login('disapprove_testuser');
+
+ // Test creating a reply
+ $post2 = $this->create_post($this->data['forums']['Disapprove Test #1'], $post['topic_id'], 'Re: Disapprove Test Topic #1-#2', 'This is a test post posted by the testing framework.', array(), 'POST_STORED_MOD');
+
+ $crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Disapprove Test Topic #1']}&sid={$this->sid}");
+ $this->assertNotContains('Re: Disapprove Test Topic #1-#2', $crawler->filter('html')->text());
+
+ $this->assert_forum_details($this->data['forums']['Disapprove Test #1'], array(
+ 'forum_posts_approved' => 1,
+ 'forum_posts_unapproved' => 1,
+ 'forum_posts_softdeleted' => 0,
+ 'forum_topics_approved' => 1,
+ 'forum_topics_unapproved' => 0,
+ 'forum_topics_softdeleted' => 0,
+ 'forum_last_post_id' => $this->data['posts']['Disapprove Test Topic #1'],
+ ), 'after replying');
+
+ // Test creating topic #2
+ $post = $this->create_topic($this->data['forums']['Disapprove Test #1'], 'Disapprove Test Topic #2', 'This is a test topic posted by the testing framework.', array(), 'POST_STORED_MOD');
+ $crawler = self::request('GET', "viewforum.php?f={$this->data['forums']['Disapprove Test #1']}&sid={$this->sid}");
+
+ $this->assertNotContains('Disapprove Test Topic #2', $crawler->filter('html')->text());
+
+ $this->assert_forum_details($this->data['forums']['Disapprove Test #1'], array(
+ 'forum_posts_approved' => 1,
+ 'forum_posts_unapproved' => 2,
+ 'forum_posts_softdeleted' => 0,
+ 'forum_topics_approved' => 1,
+ 'forum_topics_unapproved' => 1,
+ 'forum_topics_softdeleted' => 0,
+ 'forum_last_post_id' => $this->data['posts']['Disapprove Test Topic #1'],
+ ), 'after creating topic #2');
+
+ $this->logout();
+ }
+
+ public function test_reset_flood_interval()
+ {
+ $this->login();
+ $this->admin_login();
+
+ // Set flood interval back to 15
+ $this->set_flood_interval(15);
+ }
+
+ public function test_disapprove_post()
+ {
+ $this->login();
+ $this->load_ids(array(
+ 'forums' => array(
+ 'Disapprove Test #1',
+ ),
+ 'topics' => array(
+ 'Disapprove Test Topic #1',
+ 'Disapprove Test Topic #2',
+ ),
+ 'posts' => array(
+ 'Disapprove Test Topic #1',
+ 'Re: Disapprove Test Topic #1-#2',
+ 'Disapprove Test Topic #2',
+ ),
+ ));
+
+ $this->assert_forum_details($this->data['forums']['Disapprove Test #1'], array(
+ 'forum_posts_approved' => 1,
+ 'forum_posts_unapproved' => 2,
+ 'forum_posts_softdeleted' => 0,
+ 'forum_topics_approved' => 1,
+ 'forum_topics_unapproved' => 1,
+ 'forum_topics_softdeleted' => 0,
+ 'forum_last_post_id' => $this->data['posts']['Disapprove Test Topic #1'],
+ ), 'before disapproving post');
+
+ $this->add_lang('posting');
+ $this->add_lang('viewtopic');
+ $this->add_lang('mcp');
+ $crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Disapprove Test Topic #1']}&sid={$this->sid}");
+ $this->assertContains('Disapprove Test Topic #1', $crawler->filter('html')->text());
+ $this->assertContains('Re: Disapprove Test Topic #1-#2', $crawler->filter('html')->text());
+
+ $form = $crawler->selectButton($this->lang('DISAPPROVE'))->form();
+ $crawler = self::submit($form);
+ $form = $crawler->selectButton($this->lang('YES'))->form();
+ $crawler = self::submit($form);
+ $this->assertContainsLang('POST_DISAPPROVED_SUCCESS', $crawler->text());
+
+ $this->assert_forum_details($this->data['forums']['Disapprove Test #1'], array(
+ 'forum_posts_approved' => 1,
+ 'forum_posts_unapproved' => 1,
+ 'forum_posts_softdeleted' => 0,
+ 'forum_topics_approved' => 1,
+ 'forum_topics_unapproved' => 1,
+ 'forum_topics_softdeleted' => 0,
+ 'forum_last_post_id' => $this->data['posts']['Disapprove Test Topic #1'],
+ ), 'after disapproving post');
+
+ $link = $crawler->selectLink($this->lang('RETURN_PAGE', '', ''))->link();
+ $link_url = $link->getUri();
+ $this->assertContains('viewtopic.php?f=' . $this->data['forums']['Disapprove Test #1'] . '&t=' . $this->data['topics']['Disapprove Test Topic #1'], $link_url);
+
+ $crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Disapprove Test Topic #1']}&sid={$this->sid}");
+ $this->assertContains('Disapprove Test Topic #1', $crawler->filter('html')->text());
+ $this->assertNotContains('Re: Disapprove Test Topic #1-#2', $crawler->filter('html')->text());
+ }
+
+ public function test_disapprove_topic()
+ {
+ $this->login();
+ $this->load_ids(array(
+ 'forums' => array(
+ 'Disapprove Test #1',
+ ),
+ 'topics' => array(
+ 'Disapprove Test Topic #1',
+ 'Disapprove Test Topic #2',
+ ),
+ 'posts' => array(
+ 'Disapprove Test Topic #1',
+ 'Disapprove Test Topic #2',
+ ),
+ ));
+
+ $this->assert_forum_details($this->data['forums']['Disapprove Test #1'], array(
+ 'forum_posts_approved' => 1,
+ 'forum_posts_unapproved' => 1,
+ 'forum_posts_softdeleted' => 0,
+ 'forum_topics_approved' => 1,
+ 'forum_topics_unapproved' => 1,
+ 'forum_topics_softdeleted' => 0,
+ 'forum_last_post_id' => $this->data['posts']['Disapprove Test Topic #1'],
+ ), 'before disapproving topic');
+
+ $this->add_lang('posting');
+ $this->add_lang('viewtopic');
+ $this->add_lang('mcp');
+ $crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Disapprove Test Topic #2']}&sid={$this->sid}");
+ $this->assertContains('Disapprove Test Topic #2', $crawler->filter('html')->text());
+
+ $form = $crawler->selectButton($this->lang('DISAPPROVE'))->form();
+ $crawler = self::submit($form);
+ $form = $crawler->selectButton($this->lang('YES'))->form();
+ $crawler = self::submit($form);
+ $this->assertContainsLang('TOPIC_DISAPPROVED_SUCCESS', $crawler->text());
+
+ $this->assert_forum_details($this->data['forums']['Disapprove Test #1'], array(
+ 'forum_posts_approved' => 1,
+ 'forum_posts_unapproved' => 0,
+ 'forum_posts_softdeleted' => 0,
+ 'forum_topics_approved' => 1,
+ 'forum_topics_unapproved' => 0,
+ 'forum_topics_softdeleted' => 0,
+ 'forum_last_post_id' => $this->data['posts']['Disapprove Test Topic #1'],
+ ), 'after disapproving topic');
+
+ $link = $crawler->selectLink($this->lang('RETURN_PAGE', '', ''))->link();
+ $link_url = $link->getUri();
+ $this->assertContains('viewforum.php?f=' . $this->data['forums']['Disapprove Test #1'], $link_url);
+
+ $crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Disapprove Test Topic #2']}&sid={$this->sid}", array(), false);
+ self::assert_response_html(404);
+ $this->assertNotContains('Disapprove Test Topic #2', $crawler->filter('html')->text());
+ }
+
+ protected function assert_forum_details($forum_id, $details, $additional_error_message = '')
+ {
+ $this->db = $this->get_db();
+
+ $sql = 'SELECT ' . implode(', ', array_keys($details)) . '
+ FROM phpbb_forums
+ WHERE forum_id = ' . (int) $forum_id;
+ $result = $this->db->sql_query($sql);
+ $data = $this->db->sql_fetchrow($result);
+ $this->db->sql_freeresult($result);
+
+ $this->assertEquals($details, $data, "Forum {$forum_id} does not match expected {$additional_error_message}");
+ }
+
+ protected function set_flood_interval($flood_interval)
+ {
+ $crawler = self::request('GET', 'adm/index.php?sid=' . $this->sid . '&i=acp_board&mode=post');
+
+ $form = $crawler->selectButton('Submit')->form();
+ $values = $form->getValues();
+
+ $values["config[flood_interval]"] = $flood_interval;
+ $form->setValues($values);
+ $crawler = self::submit($form);
+ $this->assertGreaterThan(0, $crawler->filter('.successbox')->count());
+ }
+
+ protected function load_ids($data)
+ {
+ $this->db = $this->get_db();
+
+ if (!empty($data['forums']))
+ {
+ $sql = 'SELECT *
+ FROM phpbb_forums
+ WHERE ' . $this->db->sql_in_set('forum_name', $data['forums']);
+ $result = $this->db->sql_query($sql);
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ if (in_array($row['forum_name'], $data['forums']))
+ {
+ $this->data['forums'][$row['forum_name']] = (int) $row['forum_id'];
+ }
+ }
+ $this->db->sql_freeresult($result);
+ }
+
+ if (!empty($data['topics']))
+ {
+ $sql = 'SELECT *
+ FROM phpbb_topics
+ WHERE ' . $this->db->sql_in_set('topic_title', $data['topics']);
+ $result = $this->db->sql_query($sql);
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ if (in_array($row['topic_title'], $data['topics']))
+ {
+ $this->data['topics'][$row['topic_title']] = (int) $row['topic_id'];
+ }
+ }
+ $this->db->sql_freeresult($result);
+ }
+
+ if (!empty($data['posts']))
+ {
+ $sql = 'SELECT *
+ FROM phpbb_posts
+ WHERE ' . $this->db->sql_in_set('post_subject', $data['posts']);
+ $result = $this->db->sql_query($sql);
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ if (in_array($row['post_subject'], $data['posts']))
+ {
+ $this->data['posts'][$row['post_subject']] = (int) $row['post_id'];
+ }
+ }
+ $this->db->sql_freeresult($result);
+ }
+ }
+}
diff --git a/tests/functional/visibility_reapprove_test.php b/tests/functional/visibility_reapprove_test.php
new file mode 100644
index 0000000000..5af2ddafa4
--- /dev/null
+++ b/tests/functional/visibility_reapprove_test.php
@@ -0,0 +1,419 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+/**
+* @group functional
+*/
+class phpbb_functional_visibility_reapprove_test extends phpbb_functional_test_case
+{
+ protected $data = array();
+
+ public function test_setup_forums()
+ {
+ $this->login();
+ $this->admin_login();
+
+ $crawler = self::request('GET', "adm/index.php?i=acp_forums&mode=manage&sid={$this->sid}");
+ $form = $crawler->selectButton('addforum')->form(array(
+ 'forum_name' => 'Reapprove Test #1',
+ ));
+ $crawler = self::submit($form);
+ $form = $crawler->selectButton('update')->form(array(
+ 'forum_perm_from' => 2,
+ ));
+ $crawler = self::submit($form);
+
+ // Set flood interval to 0
+ $this->set_flood_interval(0);
+ }
+
+ public function test_create_posts()
+ {
+ $this->login();
+ $this->load_ids(array(
+ 'forums' => array(
+ 'Reapprove Test #1',
+ ),
+ ));
+
+ $this->assert_forum_details($this->data['forums']['Reapprove Test #1'], array(
+ 'forum_posts_approved' => 0,
+ 'forum_posts_unapproved' => 0,
+ 'forum_posts_softdeleted' => 0,
+ 'forum_topics_approved' => 0,
+ 'forum_topics_unapproved' => 0,
+ 'forum_topics_softdeleted' => 0,
+ 'forum_last_post_id' => 0,
+ ), 'initial comparison');
+
+ // Test creating topic #1
+ $post = $this->create_topic($this->data['forums']['Reapprove Test #1'], 'Reapprove Test Topic #1', 'This is a test topic posted by the testing framework.');
+ $crawler = self::request('GET', "viewtopic.php?t={$post['topic_id']}&sid={$this->sid}");
+
+ $this->assertContains('Reapprove Test Topic #1', $crawler->filter('h2')->text());
+ $this->data['topics']['Reapprove Test Topic #1'] = (int) $post['topic_id'];
+ $this->data['posts']['Reapprove Test Topic #1'] = (int) $this->get_parameter_from_link($crawler->filter('.post')->selectLink($this->lang('POST', '', ''))->link()->getUri(), 'p');
+
+ $this->assert_forum_details($this->data['forums']['Reapprove Test #1'], array(
+ 'forum_posts_approved' => 1,
+ 'forum_posts_unapproved' => 0,
+ 'forum_posts_softdeleted' => 0,
+ 'forum_topics_approved' => 1,
+ 'forum_topics_unapproved' => 0,
+ 'forum_topics_softdeleted' => 0,
+ 'forum_last_post_id' => $this->data['posts']['Reapprove Test Topic #1'],
+ ), 'after creating topic #1');
+
+ $this->logout();
+ $this->create_user('reapprove_testuser');
+ $this->add_user_group('NEWLY_REGISTERED', array('reapprove_testuser'));
+ $this->login('reapprove_testuser');
+
+ // Test creating a reply
+ $post2 = $this->create_post($this->data['forums']['Reapprove Test #1'], $post['topic_id'], 'Re: Reapprove Test Topic #1-#2', 'This is a test post posted by the testing framework.', array(), 'POST_STORED_MOD');
+
+ $crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Reapprove Test Topic #1']}&sid={$this->sid}");
+ $this->assertNotContains('Re: Reapprove Test Topic #1-#2', $crawler->filter('#page-body')->text());
+
+ $this->assert_forum_details($this->data['forums']['Reapprove Test #1'], array(
+ 'forum_posts_approved' => 1,
+ 'forum_posts_unapproved' => 1,
+ 'forum_posts_softdeleted' => 0,
+ 'forum_topics_approved' => 1,
+ 'forum_topics_unapproved' => 0,
+ 'forum_topics_softdeleted' => 0,
+ 'forum_last_post_id' => $this->data['posts']['Reapprove Test Topic #1'],
+ ), 'after replying');
+
+ // Test creating topic #2
+ $post = $this->create_topic($this->data['forums']['Reapprove Test #1'], 'Reapprove Test Topic #2', 'This is a test topic posted by the testing framework.', array(), 'POST_STORED_MOD');
+ $crawler = self::request('GET', "viewforum.php?f={$this->data['forums']['Reapprove Test #1']}&sid={$this->sid}");
+
+ $this->assertNotContains('Reapprove Test Topic #2', $crawler->filter('html')->text());
+
+ $this->assert_forum_details($this->data['forums']['Reapprove Test #1'], array(
+ 'forum_posts_approved' => 1,
+ 'forum_posts_unapproved' => 2,
+ 'forum_posts_softdeleted' => 0,
+ 'forum_topics_approved' => 1,
+ 'forum_topics_unapproved' => 1,
+ 'forum_topics_softdeleted' => 0,
+ 'forum_last_post_id' => $this->data['posts']['Reapprove Test Topic #1'],
+ ), 'after creating topic #2');
+
+ $this->logout();
+ }
+
+ public function test_approve_post()
+ {
+ $this->login();
+ $this->load_ids(array(
+ 'forums' => array(
+ 'Reapprove Test #1',
+ ),
+ 'topics' => array(
+ 'Reapprove Test Topic #1',
+ 'Reapprove Test Topic #2',
+ ),
+ 'posts' => array(
+ 'Reapprove Test Topic #1',
+ 'Re: Reapprove Test Topic #1-#2',
+ 'Reapprove Test Topic #2',
+ ),
+ ));
+
+ $this->assert_forum_details($this->data['forums']['Reapprove Test #1'], array(
+ 'forum_posts_approved' => 1,
+ 'forum_posts_unapproved' => 2,
+ 'forum_posts_softdeleted' => 0,
+ 'forum_topics_approved' => 1,
+ 'forum_topics_unapproved' => 1,
+ 'forum_topics_softdeleted' => 0,
+ 'forum_last_post_id' => $this->data['posts']['Reapprove Test Topic #1'],
+ ), 'before approving post');
+
+ $this->add_lang('posting');
+ $this->add_lang('viewtopic');
+ $this->add_lang('mcp');
+ $crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Reapprove Test Topic #1']}&sid={$this->sid}");
+ $this->assertContains('Reapprove Test Topic #1', $crawler->filter('h2')->text());
+ $this->assertContains('Re: Reapprove Test Topic #1-#2', $crawler->filter('#page-body')->text());
+
+ $form = $crawler->selectButton($this->lang('APPROVE'))->form();
+ $crawler = self::submit($form);
+ $form = $crawler->selectButton($this->lang('YES'))->form();
+ $crawler = self::submit($form);
+ $this->assertContainsLang('POST_APPROVED_SUCCESS', $crawler->text());
+
+ $this->assert_forum_details($this->data['forums']['Reapprove Test #1'], array(
+ 'forum_posts_approved' => 2,
+ 'forum_posts_unapproved' => 1,
+ 'forum_posts_softdeleted' => 0,
+ 'forum_topics_approved' => 1,
+ 'forum_topics_unapproved' => 1,
+ 'forum_topics_softdeleted' => 0,
+ 'forum_last_post_id' => $this->data['posts']['Re: Reapprove Test Topic #1-#2'],
+ ), 'after approving post');
+
+ $link = $crawler->selectLink($this->lang('RETURN_PAGE', '', ''))->link();
+ $link_url = $link->getUri();
+ $this->assertContains('viewtopic.php?f=' . $this->data['forums']['Reapprove Test #1'] . '&t=' . $this->data['topics']['Reapprove Test Topic #1'], $link_url);
+
+ $crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Reapprove Test Topic #1']}&sid={$this->sid}");
+ $this->assertContains('Reapprove Test Topic #1', $crawler->filter('h2')->text());
+ $this->assertContains('Re: Reapprove Test Topic #1-#2', $crawler->filter('#page-body')->text());
+ }
+
+ public function test_approve_topic()
+ {
+ $this->login();
+ $this->load_ids(array(
+ 'forums' => array(
+ 'Reapprove Test #1',
+ ),
+ 'topics' => array(
+ 'Reapprove Test Topic #1',
+ 'Reapprove Test Topic #2',
+ ),
+ 'posts' => array(
+ 'Reapprove Test Topic #1',
+ 'Re: Reapprove Test Topic #1-#2',
+ 'Reapprove Test Topic #2',
+ ),
+ ));
+
+ $this->assert_forum_details($this->data['forums']['Reapprove Test #1'], array(
+ 'forum_posts_approved' => 2,
+ 'forum_posts_unapproved' => 1,
+ 'forum_posts_softdeleted' => 0,
+ 'forum_topics_approved' => 1,
+ 'forum_topics_unapproved' => 1,
+ 'forum_topics_softdeleted' => 0,
+ 'forum_last_post_id' => $this->data['posts']['Re: Reapprove Test Topic #1-#2'],
+ ), 'before approving topic');
+
+ $this->add_lang('posting');
+ $this->add_lang('viewtopic');
+ $this->add_lang('mcp');
+ $crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Reapprove Test Topic #2']}&sid={$this->sid}");
+ $this->assertContains('Reapprove Test Topic #2', $crawler->filter('h2')->text());
+
+ $form = $crawler->selectButton($this->lang('APPROVE'))->form();
+ $crawler = self::submit($form);
+ $form = $crawler->selectButton($this->lang('YES'))->form();
+ $crawler = self::submit($form);
+ $this->assertContainsLang('TOPIC_APPROVED_SUCCESS', $crawler->text());
+
+ $this->assert_forum_details($this->data['forums']['Reapprove Test #1'], array(
+ 'forum_posts_approved' => 3,
+ 'forum_posts_unapproved' => 0,
+ 'forum_posts_softdeleted' => 0,
+ 'forum_topics_approved' => 2,
+ 'forum_topics_unapproved' => 0,
+ 'forum_topics_softdeleted' => 0,
+ 'forum_last_post_id' => $this->data['posts']['Reapprove Test Topic #2'],
+ ), 'after approving topic');
+
+ $link = $crawler->selectLink($this->lang('RETURN_PAGE', '', ''))->link();
+ $link_url = $link->getUri();
+ $this->assertContains('viewtopic.php?f=' . $this->data['topic']['Reapprove Test Topic #2'], $link_url);
+
+ $crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Reapprove Test Topic #2']}&sid={$this->sid}");
+ $this->assertContains('Reapprove Test Topic #2', $crawler->filter('h2')->text());
+ }
+
+ public function test_edit_posts()
+ {
+ $this->load_ids(array(
+ 'forums' => array(
+ 'Reapprove Test #1',
+ ),
+ 'topics' => array(
+ 'Reapprove Test Topic #1',
+ 'Reapprove Test Topic #2',
+ ),
+ 'posts' => array(
+ 'Reapprove Test Topic #1',
+ 'Re: Reapprove Test Topic #1-#2',
+ 'Reapprove Test Topic #2',
+ ),
+ ));
+ $this->add_lang('posting');
+
+ $this->assert_forum_details($this->data['forums']['Reapprove Test #1'], array(
+ 'forum_posts_approved' => 3,
+ 'forum_posts_unapproved' => 0,
+ 'forum_posts_softdeleted' => 0,
+ 'forum_topics_approved' => 2,
+ 'forum_topics_unapproved' => 0,
+ 'forum_topics_softdeleted' => 0,
+ 'forum_last_post_id' => $this->data['posts']['Reapprove Test Topic #2'],
+ ), 'before editing post');
+
+ $this->login('reapprove_testuser');
+ $this->add_user_group('NEWLY_REGISTERED', array('reapprove_testuser'));
+
+ // Test editing a post
+ $posting_url = "posting.php?mode=edit&f={$this->data['forums']['Reapprove Test #1']}&p={$this->data['posts']['Re: Reapprove Test Topic #1-#2']}&sid={$this->sid}";
+ $form_data = array(
+ 'message' => 'Post edited by testing framework',
+ 'subject' => 'Re: Reapprove Test Topic #1-#2',
+ 'post' => true,
+ );
+ $this->submit_post($posting_url, 'EDIT_POST', $form_data, 'POST_EDITED_MOD');
+
+ $crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Reapprove Test Topic #1']}&sid={$this->sid}");
+ $this->assertNotContains('Re: Reapprove Test Topic #1-#2', $crawler->filter('#page-body')->text());
+ $this->assertNotContains('Post edited by testing framework', $crawler->filter('#page-body')->text());
+
+ $this->assert_forum_details($this->data['forums']['Reapprove Test #1'], array(
+ 'forum_posts_approved' => 2,
+ 'forum_posts_unapproved' => 1,
+ 'forum_posts_softdeleted' => 0,
+ 'forum_topics_approved' => 2,
+ 'forum_topics_unapproved' => 0,
+ 'forum_topics_softdeleted' => 0,
+ 'forum_last_post_id' => $this->data['posts']['Reapprove Test Topic #2'],
+ ), 'after editing post');
+
+ // Test editing a topic
+ $posting_url = "posting.php?mode=edit&f={$this->data['forums']['Reapprove Test #1']}&p={$this->data['posts']['Reapprove Test Topic #2']}&sid={$this->sid}";
+ $form_data = array(
+ 'message' => 'Post edited by testing framework',
+ 'subject' => 'Reapprove Test Topic #2',
+ 'post' => true,
+ );
+ $this->submit_post($posting_url, 'EDIT_POST', $form_data, 'POST_EDITED_MOD');
+
+ $crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Reapprove Test Topic #2']}&sid={$this->sid}", array(), false);
+ self::assert_response_html(404);
+ $this->assertNotContains('Reapprove Test Topic #2', $crawler->filter('#page-body')->text());
+ $this->assertNotContains('Post edited by testing framework', $crawler->filter('#page-body')->text());
+
+ $this->assert_forum_details($this->data['forums']['Reapprove Test #1'], array(
+ 'forum_posts_approved' => 1,
+ 'forum_posts_unapproved' => 2,
+ 'forum_posts_softdeleted' => 0,
+ 'forum_topics_approved' => 1,
+ 'forum_topics_unapproved' => 1,
+ 'forum_topics_softdeleted' => 0,
+ 'forum_last_post_id' => $this->data['posts']['Reapprove Test Topic #1'],
+ ), 'after editing topic');
+
+ $this->logout();
+ $this->login();
+
+ $crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Reapprove Test Topic #1']}&sid={$this->sid}");
+ $this->assertContains('Re: Reapprove Test Topic #1-#2', $crawler->filter('#page-body')->text());
+ $this->assertContains('Post edited by testing framework', $crawler->filter('#page-body')->text());
+ }
+
+ public function test_approve_post_again()
+ {
+ $this->test_approve_post();
+ }
+
+ public function test_approve_topic_again()
+ {
+ $this->test_approve_topic();
+ }
+
+ public function test_reset_flood_interval()
+ {
+ $this->login();
+ $this->admin_login();
+
+ // Set flood interval back to 15
+ $this->set_flood_interval(15);
+ }
+
+ protected function assert_forum_details($forum_id, $details, $additional_error_message = '')
+ {
+ $this->db = $this->get_db();
+
+ $sql = 'SELECT ' . implode(', ', array_keys($details)) . '
+ FROM phpbb_forums
+ WHERE forum_id = ' . (int) $forum_id;
+ $result = $this->db->sql_query($sql);
+ $data = $this->db->sql_fetchrow($result);
+ $this->db->sql_freeresult($result);
+
+ $this->assertEquals($details, $data, "Forum {$forum_id} does not match expected {$additional_error_message}");
+ }
+
+ protected function set_flood_interval($flood_interval)
+ {
+ $crawler = self::request('GET', 'adm/index.php?sid=' . $this->sid . '&i=acp_board&mode=post');
+
+ $form = $crawler->selectButton('Submit')->form();
+ $values = $form->getValues();
+
+ $values["config[flood_interval]"] = $flood_interval;
+ $form->setValues($values);
+ $crawler = self::submit($form);
+ $this->assertGreaterThan(0, $crawler->filter('.successbox')->count());
+ }
+
+ protected function load_ids($data)
+ {
+ $this->db = $this->get_db();
+
+ if (!empty($data['forums']))
+ {
+ $sql = 'SELECT *
+ FROM phpbb_forums
+ WHERE ' . $this->db->sql_in_set('forum_name', $data['forums']);
+ $result = $this->db->sql_query($sql);
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ if (in_array($row['forum_name'], $data['forums']))
+ {
+ $this->data['forums'][$row['forum_name']] = (int) $row['forum_id'];
+ }
+ }
+ $this->db->sql_freeresult($result);
+ }
+
+ if (!empty($data['topics']))
+ {
+ $sql = 'SELECT *
+ FROM phpbb_topics
+ WHERE ' . $this->db->sql_in_set('topic_title', $data['topics']);
+ $result = $this->db->sql_query($sql);
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ if (in_array($row['topic_title'], $data['topics']))
+ {
+ $this->data['topics'][$row['topic_title']] = (int) $row['topic_id'];
+ }
+ }
+ $this->db->sql_freeresult($result);
+ }
+
+ if (!empty($data['posts']))
+ {
+ $sql = 'SELECT *
+ FROM phpbb_posts
+ WHERE ' . $this->db->sql_in_set('post_subject', $data['posts']);
+ $result = $this->db->sql_query($sql);
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ if (in_array($row['post_subject'], $data['posts']))
+ {
+ $this->data['posts'][$row['post_subject']] = (int) $row['post_id'];
+ }
+ }
+ $this->db->sql_freeresult($result);
+ }
+ }
+}
diff --git a/tests/functional/visibility_softdelete_test.php b/tests/functional/visibility_softdelete_test.php
new file mode 100644
index 0000000000..6450c00c1e
--- /dev/null
+++ b/tests/functional/visibility_softdelete_test.php
@@ -0,0 +1,841 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+/**
+* @group functional
+*/
+class phpbb_functional_visibility_softdelete_test extends phpbb_functional_test_case
+{
+ protected $data = array();
+
+ public function test_setup_forums()
+ {
+ $this->login();
+ $this->admin_login();
+
+ $crawler = self::request('GET', "adm/index.php?i=acp_forums&mode=manage&sid={$this->sid}");
+ $form = $crawler->selectButton('addforum')->form(array(
+ 'forum_name' => 'Soft Delete #1',
+ ));
+ $crawler = self::submit($form);
+ $form = $crawler->selectButton('update')->form(array(
+ 'forum_perm_from' => 2,
+ ));
+ $crawler = self::submit($form);
+
+ $crawler = self::request('GET', "adm/index.php?i=acp_forums&mode=manage&sid={$this->sid}");
+ $form = $crawler->selectButton('addforum')->form(array(
+ 'forum_name' => 'Soft Delete #2',
+ ));
+ $crawler = self::submit($form);
+ $form = $crawler->selectButton('update')->form(array(
+ 'forum_perm_from' => 2,
+ ));
+ $crawler = self::submit($form);
+
+ // Create second user which does not have m_delete permission
+ $this->add_lang('acp/permissions');
+
+ $second_user = $this->create_user('no m_delete moderator');
+ $this->add_user_group("GLOBAL_MODERATORS", 'no m_delete moderator', true);
+
+ // Set m_delete to never
+ $crawler = self::request('GET', "adm/index.php?i=acp_permissions&icat=16&mode=setting_user_global&user_id[0]=$second_user&type=m_&sid={$this->sid}");
+ $form = $crawler->selectButton($this->lang('APPLY_PERMISSIONS'))->form();
+ $data = array("setting[$second_user][0][m_delete]" => ACL_NEVER);
+ $form->setValues($data);
+ $crawler = self::submit($form);
+ }
+
+ public function test_create_post()
+ {
+ $this->login();
+ $this->load_ids(array(
+ 'forums' => array(
+ 'Soft Delete #1',
+ 'Soft Delete #2',
+ ),
+ ));
+
+ $this->assert_forum_details($this->data['forums']['Soft Delete #1'], array(
+ 'forum_posts_approved' => 0,
+ 'forum_posts_unapproved' => 0,
+ 'forum_posts_softdeleted' => 0,
+ 'forum_topics_approved' => 0,
+ 'forum_topics_unapproved' => 0,
+ 'forum_topics_softdeleted' => 0,
+ 'forum_last_post_id' => 0,
+ ), 'initial comparison');
+
+ // Test creating topic
+ $post = $this->create_topic($this->data['forums']['Soft Delete #1'], 'Soft Delete Topic #1', 'This is a test topic posted by the testing framework.');
+ $crawler = self::request('GET', "viewtopic.php?t={$post['topic_id']}&sid={$this->sid}");
+
+ $this->assertContains('Soft Delete Topic #1', $crawler->filter('html')->text());
+ $this->data['topics']['Soft Delete Topic #1'] = (int) $post['topic_id'];
+ $this->data['posts']['Soft Delete Topic #1'] = (int) $this->get_parameter_from_link($crawler->filter('.post')->selectLink($this->lang('POST', '', ''))->link()->getUri(), 'p');
+
+ $this->assert_forum_details($this->data['forums']['Soft Delete #1'], array(
+ 'forum_posts_approved' => 1,
+ 'forum_posts_unapproved' => 0,
+ 'forum_posts_softdeleted' => 0,
+ 'forum_topics_approved' => 1,
+ 'forum_topics_unapproved' => 0,
+ 'forum_topics_softdeleted' => 0,
+ 'forum_last_post_id' => $this->data['posts']['Soft Delete Topic #1'],
+ ), 'after creating topic #1');
+
+ // Test creating a reply
+ $post2 = $this->create_post($this->data['forums']['Soft Delete #1'], $post['topic_id'], 'Re: Soft Delete Topic #1-#2', 'This is a test post posted by the testing framework.');
+ $crawler = self::request('GET', "viewtopic.php?t={$post2['topic_id']}&sid={$this->sid}");
+
+ $this->assertContains('Re: Soft Delete Topic #1-#2', $crawler->filter('html')->text());
+ $this->data['posts']['Re: Soft Delete Topic #1-#2'] = (int) $post2['post_id'];
+
+ $this->assert_forum_details($this->data['forums']['Soft Delete #1'], array(
+ 'forum_posts_approved' => 2,
+ 'forum_posts_unapproved' => 0,
+ 'forum_posts_softdeleted' => 0,
+ 'forum_topics_approved' => 1,
+ 'forum_topics_unapproved' => 0,
+ 'forum_topics_softdeleted' => 0,
+ 'forum_last_post_id' => $this->data['posts']['Re: Soft Delete Topic #1-#2'],
+ ), 'after replying');
+
+ // Test creating another reply
+ $post3 = $this->create_post($this->data['forums']['Soft Delete #1'], $post['topic_id'], 'Re: Soft Delete Topic #1-#3', 'This is another test post posted by the testing framework.');
+ $crawler = self::request('GET', "viewtopic.php?t={$post3['topic_id']}&sid={$this->sid}");
+
+ $this->assertContains('Re: Soft Delete Topic #1-#3', $crawler->filter('html')->text());
+ $this->data['posts']['Re: Soft Delete Topic #1-#3'] = (int) $post3['post_id'];
+
+ $this->assert_forum_details($this->data['forums']['Soft Delete #1'], array(
+ 'forum_posts_approved' => 3,
+ 'forum_posts_unapproved' => 0,
+ 'forum_posts_softdeleted' => 0,
+ 'forum_topics_approved' => 1,
+ 'forum_topics_unapproved' => 0,
+ 'forum_topics_softdeleted' => 0,
+ 'forum_last_post_id' => $this->data['posts']['Re: Soft Delete Topic #1-#3'],
+ ), 'after replying a second time');
+ }
+
+ public function test_softdelete_post()
+ {
+ $this->login();
+ $this->load_ids(array(
+ 'forums' => array(
+ 'Soft Delete #1',
+ 'Soft Delete #2',
+ ),
+ 'topics' => array(
+ 'Soft Delete Topic #1',
+ ),
+ 'posts' => array(
+ 'Soft Delete Topic #1',
+ 'Re: Soft Delete Topic #1-#2',
+ 'Re: Soft Delete Topic #1-#3',
+ ),
+ ));
+
+ $this->assert_forum_details($this->data['forums']['Soft Delete #1'], array(
+ 'forum_posts_approved' => 3,
+ 'forum_posts_unapproved' => 0,
+ 'forum_posts_softdeleted' => 0,
+ 'forum_topics_approved' => 1,
+ 'forum_topics_unapproved' => 0,
+ 'forum_topics_softdeleted' => 0,
+ 'forum_last_post_id' => $this->data['posts']['Re: Soft Delete Topic #1-#3'],
+ ), 'before softdelete');
+
+ $this->add_lang('posting');
+ $crawler = self::request('GET', "posting.php?mode=delete&f={$this->data['forums']['Soft Delete #1']}&p={$this->data['posts']['Re: Soft Delete Topic #1-#3']}&sid={$this->sid}");
+ $this->assertContainsLang('DELETE_PERMANENTLY', $crawler->text());
+
+ $form = $crawler->selectButton('Yes')->form();
+ $crawler = self::submit($form);
+ $this->assertContainsLang('POST_DELETED', $crawler->text());
+
+ $this->assert_forum_details($this->data['forums']['Soft Delete #1'], array(
+ 'forum_posts_approved' => 2,
+ 'forum_posts_unapproved' => 0,
+ 'forum_posts_softdeleted' => 1,
+ 'forum_topics_approved' => 1,
+ 'forum_topics_unapproved' => 0,
+ 'forum_topics_softdeleted' => 0,
+ 'forum_last_post_id' => $this->data['posts']['Re: Soft Delete Topic #1-#2'],
+ ), 'after softdelete');
+
+ $crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Soft Delete Topic #1']}&sid={$this->sid}");
+ $this->assertContains($this->lang('POST_DISPLAY', '', ''), $crawler->text());
+ }
+
+ public function test_softdelete_post_no_m_delete()
+ {
+ $this->login('no m_delete moderator');
+ $this->load_ids(array(
+ 'forums' => array(
+ 'Soft Delete #1',
+ 'Soft Delete #2',
+ ),
+ 'topics' => array(
+ 'Soft Delete Topic #1',
+ ),
+ 'posts' => array(
+ 'Soft Delete Topic #1',
+ 'Re: Soft Delete Topic #1-#2',
+ 'Re: Soft Delete Topic #1-#3',
+ ),
+ ));
+
+ $this->assert_forum_details($this->data['forums']['Soft Delete #1'], array(
+ 'forum_posts_approved' => 2,
+ 'forum_posts_unapproved' => 0,
+ 'forum_posts_softdeleted' => 1,
+ 'forum_topics_approved' => 1,
+ 'forum_topics_unapproved' => 0,
+ 'forum_topics_softdeleted' => 0,
+ 'forum_last_post_id' => $this->data['posts']['Re: Soft Delete Topic #1-#2'],
+ ), 'before softdelete without m_delete');
+
+ $this->add_lang('posting');
+ $crawler = self::request('GET', "posting.php?mode=delete&f={$this->data['forums']['Soft Delete #1']}&p={$this->data['posts']['Re: Soft Delete Topic #1-#2']}&sid={$this->sid}");
+ $this->assertNotContainsLang('DELETE_PERMANENTLY', $crawler->text());
+
+ $form = $crawler->selectButton('Yes')->form();
+ $crawler = self::submit($form);
+ $this->assertContainsLang('POST_DELETED', $crawler->text());
+
+ $this->assert_forum_details($this->data['forums']['Soft Delete #1'], array(
+ 'forum_posts_approved' => 1,
+ 'forum_posts_unapproved' => 0,
+ 'forum_posts_softdeleted' => 2,
+ 'forum_topics_approved' => 1,
+ 'forum_topics_unapproved' => 0,
+ 'forum_topics_softdeleted' => 0,
+ 'forum_last_post_id' => $this->data['posts']['Soft Delete Topic #1'],
+ ), 'after softdelete without m_delete');
+
+ $crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Soft Delete Topic #1']}&sid={$this->sid}");
+ $this->assertContains($this->lang('POST_DISPLAY', '', ''), $crawler->text());
+ }
+
+ public function test_move_softdeleted_post()
+ {
+ $this->login();
+ $this->load_ids(array(
+ 'forums' => array(
+ 'Soft Delete #1',
+ 'Soft Delete #2',
+ ),
+ 'topics' => array(
+ 'Soft Delete Topic #1',
+ ),
+ 'posts' => array(
+ 'Soft Delete Topic #1',
+ 'Re: Soft Delete Topic #1-#2',
+ 'Re: Soft Delete Topic #1-#3',
+ ),
+ ));
+
+ $this->assert_forum_details($this->data['forums']['Soft Delete #1'], array(
+ 'forum_posts_approved' => 1,
+ 'forum_posts_unapproved' => 0,
+ 'forum_posts_softdeleted' => 2,
+ 'forum_topics_approved' => 1,
+ 'forum_topics_unapproved' => 0,
+ 'forum_topics_softdeleted' => 0,
+ 'forum_last_post_id' => $this->data['posts']['Soft Delete Topic #1'],
+ ), 'before moving #1');
+
+ $this->assert_forum_details($this->data['forums']['Soft Delete #2'], array(
+ 'forum_posts_approved' => 0,
+ 'forum_posts_unapproved' => 0,
+ 'forum_posts_softdeleted' => 0,
+ 'forum_topics_approved' => 0,
+ 'forum_topics_unapproved' => 0,
+ 'forum_topics_softdeleted' => 0,
+ 'forum_last_post_id' => 0,
+ ), 'before moving #2');
+
+ $crawler = $this->get_quickmod_page($this->data['topics']['Soft Delete Topic #1'], 'MOVE_TOPIC');
+ $this->assertContainsLang('SELECT_DESTINATION_FORUM', $crawler->text());
+
+ $this->add_lang('mcp');
+ $form = $crawler->selectButton('Yes')->form();
+ $form['to_forum_id']->select($this->data['forums']['Soft Delete #2']);
+ $crawler = self::submit($form);
+ $this->assertContainsLang('TOPIC_MOVED_SUCCESS', $crawler->text());
+
+ $crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Soft Delete Topic #1']}&sid={$this->sid}");
+ $this->assertContains('Soft Delete #2', $crawler->filter('.navlinks')->text());
+ $this->assertContains('Soft Delete Topic #1', $crawler->filter('h2')->text());
+
+ $this->assert_forum_details($this->data['forums']['Soft Delete #1'], array(
+ 'forum_posts_approved' => 0,
+ 'forum_posts_unapproved' => 0,
+ 'forum_posts_softdeleted' => 0,
+ 'forum_topics_approved' => 0,
+ 'forum_topics_unapproved' => 0,
+ 'forum_topics_softdeleted' => 0,
+ 'forum_last_post_id' => 0,
+ ), 'after moving #1');
+
+ $this->assert_forum_details($this->data['forums']['Soft Delete #2'], array(
+ 'forum_posts_approved' => 1,
+ 'forum_posts_unapproved' => 0,
+ 'forum_posts_softdeleted' => 2,
+ 'forum_topics_approved' => 1,
+ 'forum_topics_unapproved' => 0,
+ 'forum_topics_softdeleted' => 0,
+ 'forum_last_post_id' => $this->data['posts']['Soft Delete Topic #1'],
+ ), 'after moving #2');
+ }
+
+ public function test_softdelete_topic()
+ {
+ $this->login();
+ $this->load_ids(array(
+ 'forums' => array(
+ 'Soft Delete #1',
+ 'Soft Delete #2',
+ ),
+ 'topics' => array(
+ 'Soft Delete Topic #1',
+ ),
+ 'posts' => array(
+ 'Soft Delete Topic #1',
+ 'Re: Soft Delete Topic #1-#2',
+ 'Re: Soft Delete Topic #1-#3'
+ ),
+ ));
+
+ $this->assert_forum_details($this->data['forums']['Soft Delete #1'], array(
+ 'forum_posts_approved' => 0,
+ 'forum_posts_unapproved' => 0,
+ 'forum_posts_softdeleted' => 0,
+ 'forum_topics_approved' => 0,
+ 'forum_topics_unapproved' => 0,
+ 'forum_topics_softdeleted' => 0,
+ 'forum_last_post_id' => 0,
+ ), 'before softdeleting #1');
+
+ $this->assert_forum_details($this->data['forums']['Soft Delete #2'], array(
+ 'forum_posts_approved' => 1,
+ 'forum_posts_unapproved' => 0,
+ 'forum_posts_softdeleted' => 2,
+ 'forum_topics_approved' => 1,
+ 'forum_topics_unapproved' => 0,
+ 'forum_topics_softdeleted' => 0,
+ 'forum_last_post_id' => $this->data['posts']['Soft Delete Topic #1'],
+ ), 'before softdeleting #2');
+
+ $this->add_lang('posting');
+ $crawler = $this->get_quickmod_page($this->data['topics']['Soft Delete Topic #1'], 'DELETE_TOPIC');
+ $this->assertContainsLang('DELETE_PERMANENTLY', $crawler->text());
+
+ $this->add_lang('mcp');
+ $form = $crawler->selectButton('Yes')->form();
+ $crawler = self::submit($form);
+ $this->assertContainsLang('TOPIC_DELETED_SUCCESS', $crawler->text());
+
+ $crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Soft Delete Topic #1']}&sid={$this->sid}");
+ $this->assertContains('Soft Delete #2', $crawler->filter('.navlinks')->text());
+ $this->assertContains('Soft Delete Topic #1', $crawler->filter('h2')->text());
+
+ $this->assert_forum_details($this->data['forums']['Soft Delete #1'], array(
+ 'forum_posts_approved' => 0,
+ 'forum_posts_unapproved' => 0,
+ 'forum_posts_softdeleted' => 0,
+ 'forum_topics_approved' => 0,
+ 'forum_topics_unapproved' => 0,
+ 'forum_topics_softdeleted' => 0,
+ 'forum_last_post_id' => 0,
+ ), 'after moving #1');
+
+ $this->assert_forum_details($this->data['forums']['Soft Delete #2'], array(
+ 'forum_posts_approved' => 0,
+ 'forum_posts_unapproved' => 0,
+ 'forum_posts_softdeleted' => 3,
+ 'forum_topics_approved' => 0,
+ 'forum_topics_unapproved' => 0,
+ 'forum_topics_softdeleted' => 1,
+ 'forum_last_post_id' => 0,
+ ), 'after moving #2');
+ }
+
+ public function test_move_softdeleted_topic()
+ {
+ $this->login();
+ $this->load_ids(array(
+ 'forums' => array(
+ 'Soft Delete #1',
+ 'Soft Delete #2',
+ ),
+ 'topics' => array(
+ 'Soft Delete Topic #1',
+ ),
+ 'posts' => array(
+ 'Soft Delete Topic #1',
+ 'Re: Soft Delete Topic #1-#2',
+ 'Re: Soft Delete Topic #1-#3'
+ ),
+ ));
+
+ $this->assert_forum_details($this->data['forums']['Soft Delete #1'], array(
+ 'forum_posts_approved' => 0,
+ 'forum_posts_unapproved' => 0,
+ 'forum_posts_softdeleted' => 0,
+ 'forum_topics_approved' => 0,
+ 'forum_topics_unapproved' => 0,
+ 'forum_topics_softdeleted' => 0,
+ 'forum_last_post_id' => 0,
+ ), 'before moving #1');
+
+ $this->assert_forum_details($this->data['forums']['Soft Delete #2'], array(
+ 'forum_posts_approved' => 0,
+ 'forum_posts_unapproved' => 0,
+ 'forum_posts_softdeleted' => 3,
+ 'forum_topics_approved' => 0,
+ 'forum_topics_unapproved' => 0,
+ 'forum_topics_softdeleted' => 1,
+ 'forum_last_post_id' => 0,
+ ), 'before moving #2');
+
+ $crawler = $this->get_quickmod_page($this->data['topics']['Soft Delete Topic #1'], 'MOVE_TOPIC');
+ $this->assertContainsLang('SELECT_DESTINATION_FORUM', $crawler->text());
+
+ $this->add_lang('mcp');
+ $form = $crawler->selectButton('Yes')->form();
+ $form['to_forum_id']->select($this->data['forums']['Soft Delete #1']);
+ $crawler = self::submit($form);
+ $this->assertContainsLang('TOPIC_MOVED_SUCCESS', $crawler->text());
+
+ $crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Soft Delete Topic #1']}&sid={$this->sid}");
+ $this->assertContains('Soft Delete #1', $crawler->filter('.navlinks')->text());
+ $this->assertContains('Soft Delete Topic #1', $crawler->filter('h2')->text());
+
+ $this->assert_forum_details($this->data['forums']['Soft Delete #1'], array(
+ 'forum_posts_approved' => 0,
+ 'forum_posts_unapproved' => 0,
+ 'forum_posts_softdeleted' => 3,
+ 'forum_topics_approved' => 0,
+ 'forum_topics_unapproved' => 0,
+ 'forum_topics_softdeleted' => 1,
+ 'forum_last_post_id' => 0,
+ ), 'after moving #1');
+
+ $this->assert_forum_details($this->data['forums']['Soft Delete #2'], array(
+ 'forum_posts_approved' => 0,
+ 'forum_posts_unapproved' => 0,
+ 'forum_posts_softdeleted' => 0,
+ 'forum_topics_approved' => 0,
+ 'forum_topics_unapproved' => 0,
+ 'forum_topics_softdeleted' => 0,
+ 'forum_last_post_id' => 0,
+ ), 'after moving #2');
+ }
+
+ public function test_restore_post()
+ {
+ $this->login();
+ $this->load_ids(array(
+ 'forums' => array(
+ 'Soft Delete #1',
+ 'Soft Delete #2',
+ ),
+ 'topics' => array(
+ 'Soft Delete Topic #1',
+ ),
+ 'posts' => array(
+ 'Soft Delete Topic #1',
+ 'Re: Soft Delete Topic #1-#2',
+ 'Re: Soft Delete Topic #1-#3'
+ ),
+ ));
+
+ $this->assert_forum_details($this->data['forums']['Soft Delete #1'], array(
+ 'forum_posts_approved' => 0,
+ 'forum_posts_unapproved' => 0,
+ 'forum_posts_softdeleted' => 3,
+ 'forum_topics_approved' => 0,
+ 'forum_topics_unapproved' => 0,
+ 'forum_topics_softdeleted' => 1,
+ 'forum_last_post_id' => 0,
+ ), 'before restoring #1');
+
+ $this->assert_forum_details($this->data['forums']['Soft Delete #2'], array(
+ 'forum_posts_approved' => 0,
+ 'forum_posts_unapproved' => 0,
+ 'forum_posts_softdeleted' => 0,
+ 'forum_topics_approved' => 0,
+ 'forum_topics_unapproved' => 0,
+ 'forum_topics_softdeleted' => 0,
+ 'forum_last_post_id' => 0,
+ ), 'before restoring #2');
+
+ $crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Soft Delete Topic #1']}&sid={$this->sid}");
+
+ $this->add_lang('mcp');
+ $form = $crawler->filter('#p' . $this->data['posts']['Soft Delete Topic #1'])->selectButton($this->lang('RESTORE'))->form();
+ $crawler = self::submit($form);
+ $this->assertContainsLang('RESTORE_POST', $crawler->text());
+
+ $form = $crawler->selectButton('Yes')->form();
+ $crawler = self::submit($form);
+ $this->assertContainsLang('POST_RESTORED_SUCCESS', $crawler->text());
+
+ $crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Soft Delete Topic #1']}&sid={$this->sid}");
+ $this->assertContains('Soft Delete #1', $crawler->filter('.navlinks')->text());
+ $this->assertContains('Soft Delete Topic #1', $crawler->filter('h2')->text());
+
+ $this->assert_forum_details($this->data['forums']['Soft Delete #1'], array(
+ 'forum_posts_approved' => 1,
+ 'forum_posts_unapproved' => 0,
+ 'forum_posts_softdeleted' => 2,
+ 'forum_topics_approved' => 1,
+ 'forum_topics_unapproved' => 0,
+ 'forum_topics_softdeleted' => 0,
+ 'forum_last_post_id' => $this->data['posts']['Soft Delete Topic #1'],
+ ), 'after restoring #1');
+
+ $this->assert_forum_details($this->data['forums']['Soft Delete #2'], array(
+ 'forum_posts_approved' => 0,
+ 'forum_posts_unapproved' => 0,
+ 'forum_posts_softdeleted' => 0,
+ 'forum_topics_approved' => 0,
+ 'forum_topics_unapproved' => 0,
+ 'forum_topics_softdeleted' => 0,
+ 'forum_last_post_id' => 0,
+ ), 'after restoring #2');
+ }
+
+ public function test_split_topic()
+ {
+ $this->login();
+ $this->load_ids(array(
+ 'forums' => array(
+ 'Soft Delete #1',
+ 'Soft Delete #2',
+ ),
+ 'topics' => array(
+ 'Soft Delete Topic #1',
+ ),
+ 'posts' => array(
+ 'Soft Delete Topic #1',
+ 'Re: Soft Delete Topic #1-#2',
+ 'Re: Soft Delete Topic #1-#3'
+ ),
+ ));
+
+ $this->assert_forum_details($this->data['forums']['Soft Delete #1'], array(
+ 'forum_posts_approved' => 1,
+ 'forum_posts_unapproved' => 0,
+ 'forum_posts_softdeleted' => 2,
+ 'forum_topics_approved' => 1,
+ 'forum_topics_unapproved' => 0,
+ 'forum_topics_softdeleted' => 0,
+ 'forum_last_post_id' => $this->data['posts']['Soft Delete Topic #1'],
+ ), 'before splitting #1');
+
+ $this->assert_forum_details($this->data['forums']['Soft Delete #2'], array(
+ 'forum_posts_approved' => 0,
+ 'forum_posts_unapproved' => 0,
+ 'forum_posts_softdeleted' => 0,
+ 'forum_topics_approved' => 0,
+ 'forum_topics_unapproved' => 0,
+ 'forum_topics_softdeleted' => 0,
+ 'forum_last_post_id' => 0,
+ ), 'before splitting #2');
+
+ $crawler = $this->get_quickmod_page($this->data['topics']['Soft Delete Topic #1'], 'SPLIT_TOPIC');
+
+ $this->add_lang('mcp');
+ $this->assertContainsLang('SPLIT_TOPIC_EXPLAIN', $crawler->text());
+
+ $form = $crawler->selectButton('Submit')->form(array(
+ 'subject' => 'Soft Delete Topic #2 with bang',
+ ));
+ $form['to_forum_id']->select($this->data['forums']['Soft Delete #2']);
+ $form['post_id_list'][1]->tick();
+ $crawler = self::submit($form);
+
+ $form = $crawler->selectButton('Yes')->form();
+ $crawler = self::submit($form);
+ $this->assertContainsLang('TOPIC_SPLIT_SUCCESS', $crawler->text());
+
+ $crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Soft Delete Topic #1']}&sid={$this->sid}");
+ $this->assertContains('Soft Delete Topic #1', $crawler->filter('h2')->text());
+ $this->assertNotContains('Re: Soft Delete Topic #1-#2', $crawler->text());
+
+ $this->assert_forum_details($this->data['forums']['Soft Delete #1'], array(
+ 'forum_posts_approved' => 1,
+ 'forum_posts_unapproved' => 0,
+ 'forum_posts_softdeleted' => 1,
+ 'forum_topics_approved' => 1,
+ 'forum_topics_unapproved' => 0,
+ 'forum_topics_softdeleted' => 0,
+ 'forum_last_post_id' => $this->data['posts']['Soft Delete Topic #1'],
+ ), 'after restoring #1');
+
+ $this->assert_forum_details($this->data['forums']['Soft Delete #2'], array(
+ 'forum_posts_approved' => 0,
+ 'forum_posts_unapproved' => 0,
+ 'forum_posts_softdeleted' => 1,
+ 'forum_topics_approved' => 0,
+ 'forum_topics_unapproved' => 0,
+ 'forum_topics_softdeleted' => 1,
+ 'forum_last_post_id' => 0,
+ ), 'after restoring #2');
+
+ // Assert new topic title is indexed as well
+ $this->add_lang('search');
+ self::request('GET', "search.php?keywords=bang&sid={$this->sid}");
+ $this->assertContains(sprintf($this->lang['FOUND_SEARCH_MATCHES'][1], 1), self::get_content());
+ }
+
+ public function test_move_topic_back()
+ {
+ $this->login();
+ $this->load_ids(array(
+ 'forums' => array(
+ 'Soft Delete #1',
+ 'Soft Delete #2',
+ ),
+ 'topics' => array(
+ 'Soft Delete Topic #1',
+ 'Soft Delete Topic #2 with bang',
+ ),
+ 'posts' => array(
+ 'Soft Delete Topic #1',
+ 'Re: Soft Delete Topic #1-#2',
+ 'Re: Soft Delete Topic #1-#3'
+ ),
+ ));
+
+ $crawler = $this->get_quickmod_page($this->data['topics']['Soft Delete Topic #2 with bang'], 'MOVE_TOPIC');
+ $form = $crawler->selectButton('Yes')->form();
+ $form['to_forum_id']->select($this->data['forums']['Soft Delete #1']);
+ $crawler = self::submit($form);
+
+ $this->assert_forum_details($this->data['forums']['Soft Delete #1'], array(
+ 'forum_posts_approved' => 1,
+ 'forum_posts_unapproved' => 0,
+ 'forum_posts_softdeleted' => 2,
+ 'forum_topics_approved' => 1,
+ 'forum_topics_unapproved' => 0,
+ 'forum_topics_softdeleted' => 1,
+ 'forum_last_post_id' => $this->data['posts']['Soft Delete Topic #1'],
+ ), 'after moving back');
+ }
+
+ public function test_merge_topics()
+ {
+ $this->login();
+ $this->load_ids(array(
+ 'forums' => array(
+ 'Soft Delete #1',
+ 'Soft Delete #2',
+ ),
+ 'topics' => array(
+ 'Soft Delete Topic #1',
+ 'Soft Delete Topic #2 with bang',
+ ),
+ 'posts' => array(
+ 'Soft Delete Topic #1',
+ 'Re: Soft Delete Topic #1-#2',
+ 'Re: Soft Delete Topic #1-#3'
+ ),
+ ));
+
+ $this->assert_forum_details($this->data['forums']['Soft Delete #1'], array(
+ 'forum_posts_approved' => 1,
+ 'forum_posts_unapproved' => 0,
+ 'forum_posts_softdeleted' => 2,
+ 'forum_topics_approved' => 1,
+ 'forum_topics_unapproved' => 0,
+ 'forum_topics_softdeleted' => 1,
+ 'forum_last_post_id' => $this->data['posts']['Soft Delete Topic #1'],
+ ), 'before merging #1');
+
+ $this->add_lang('viewtopic');
+ $crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Soft Delete Topic #2 with bang']}&sid={$this->sid}");
+
+ $bookmark_tag = $crawler->filter('a.bookmark-link');
+ $this->assertContainsLang('BOOKMARK_TOPIC', $bookmark_tag->text());
+ $bookmark_link = $bookmark_tag->attr('href');
+ $crawler_bookmark = self::request('GET', $bookmark_link);
+ $this->assertContainsLang('BOOKMARK_ADDED', $crawler_bookmark->text());
+
+ $this->add_lang('mcp');
+ $crawler = $this->get_quickmod_page($this->data['topics']['Soft Delete Topic #2 with bang'], 'MERGE_TOPIC', $crawler);
+ $this->assertContainsLang('SELECT_MERGE', $crawler->text());
+
+ $crawler = self::request('GET', "mcp.php?f={$this->data['forums']['Soft Delete #1']}&t={$this->data['topics']['Soft Delete Topic #2 with bang']}&i=main&mode=forum_view&action=merge_topic&to_topic_id={$this->data['topics']['Soft Delete Topic #1']}");
+ $this->assertContainsLang('MERGE_TOPICS_CONFIRM', $crawler->text());
+
+ $form = $crawler->selectButton('Yes')->form();
+ $crawler = self::submit($form);
+ $this->assertContainsLang('POSTS_MERGED_SUCCESS', $crawler->text());
+
+ $crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Soft Delete Topic #1']}&sid={$this->sid}");
+ $this->assertContains('Soft Delete Topic #1', $crawler->filter('h2')->text());
+ $this->assertContainsLang('POST_DELETED_ACTION', $crawler->filter('body')->text());
+ $this->assertContainsLang('BOOKMARK_TOPIC_REMOVE', $crawler->filter('body')->text());
+
+ $this->assert_forum_details($this->data['forums']['Soft Delete #1'], array(
+ 'forum_posts_approved' => 1,
+ 'forum_posts_unapproved' => 0,
+ 'forum_posts_softdeleted' => 2,
+ 'forum_topics_approved' => 1,
+ 'forum_topics_unapproved' => 0,
+ 'forum_topics_softdeleted' => 0,
+ 'forum_last_post_id' => $this->data['posts']['Soft Delete Topic #1'],
+ ), 'after merging #1');
+ }
+
+ public function test_fork_topic()
+ {
+ $this->login();
+ $this->load_ids(array(
+ 'forums' => array(
+ 'Soft Delete #1',
+ 'Soft Delete #2',
+ ),
+ 'topics' => array(
+ 'Soft Delete Topic #1',
+ ),
+ 'posts' => array(
+ 'Soft Delete Topic #1',
+ 'Re: Soft Delete Topic #1-#2',
+ 'Re: Soft Delete Topic #1-#3'
+ ),
+ ));
+
+ $this->assert_forum_details($this->data['forums']['Soft Delete #1'], array(
+ 'forum_posts_approved' => 1,
+ 'forum_posts_unapproved' => 0,
+ 'forum_posts_softdeleted' => 2,
+ 'forum_topics_approved' => 1,
+ 'forum_topics_unapproved' => 0,
+ 'forum_topics_softdeleted' => 0,
+ 'forum_last_post_id' => $this->data['posts']['Soft Delete Topic #1'],
+ ), 'before forking #1');
+
+ $this->assert_forum_details($this->data['forums']['Soft Delete #2'], array(
+ 'forum_posts_approved' => 0,
+ 'forum_posts_unapproved' => 0,
+ 'forum_posts_softdeleted' => 0,
+ 'forum_topics_approved' => 0,
+ 'forum_topics_unapproved' => 0,
+ 'forum_topics_softdeleted' => 0,
+ 'forum_last_post_id' => 0,
+ ), 'before forking #2');
+
+ $this->add_lang('mcp');
+ $crawler = $this->get_quickmod_page($this->data['topics']['Soft Delete Topic #1'], 'FORK_TOPIC');
+ $this->assertContainsLang('FORK_TOPIC', $crawler->text());
+
+ $form = $crawler->selectButton('Yes')->form();
+ $form['to_forum_id']->select($this->data['forums']['Soft Delete #2']);
+ $crawler = self::submit($form);
+ $this->assertContainsLang('TOPIC_FORKED_SUCCESS', $crawler->text());
+
+ $this->assert_forum_details($this->data['forums']['Soft Delete #1'], array(
+ 'forum_posts_approved' => 1,
+ 'forum_posts_unapproved' => 0,
+ 'forum_posts_softdeleted' => 2,
+ 'forum_topics_approved' => 1,
+ 'forum_topics_unapproved' => 0,
+ 'forum_topics_softdeleted' => 0,
+ 'forum_last_post_id' => $this->data['posts']['Soft Delete Topic #1'],
+ ), 'after forking #1');
+
+ $this->assert_forum_details($this->data['forums']['Soft Delete #2'], array(
+ 'forum_posts_approved' => 1,
+ 'forum_posts_unapproved' => 0,
+ 'forum_posts_softdeleted' => 2,
+ 'forum_topics_approved' => 1,
+ 'forum_topics_unapproved' => 0,
+ 'forum_topics_softdeleted' => 0,
+ 'forum_last_post_id' => $this->data['posts']['Soft Delete Topic #1'] + 3,
+ ), 'after forking #2');
+ }
+
+ public function assert_forum_details($forum_id, $details, $additional_error_message = '')
+ {
+ $this->db = $this->get_db();
+
+ $sql = 'SELECT ' . implode(', ', array_keys($details)) . '
+ FROM phpbb_forums
+ WHERE forum_id = ' . (int) $forum_id;
+ $result = $this->db->sql_query($sql);
+ $data = $this->db->sql_fetchrow($result);
+ $this->db->sql_freeresult($result);
+
+ $this->assertEquals($details, $data, "Forum {$forum_id} does not match expected {$additional_error_message}");
+ }
+
+ public function load_ids($data)
+ {
+ $this->db = $this->get_db();
+
+ if (!empty($data['forums']))
+ {
+ $sql = 'SELECT *
+ FROM phpbb_forums
+ WHERE ' . $this->db->sql_in_set('forum_name', $data['forums']);
+ $result = $this->db->sql_query($sql);
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ if (in_array($row['forum_name'], $data['forums']))
+ {
+ $this->data['forums'][$row['forum_name']] = (int) $row['forum_id'];
+ }
+ }
+ $this->db->sql_freeresult($result);
+ }
+
+ if (!empty($data['topics']))
+ {
+ $sql = 'SELECT *
+ FROM phpbb_topics
+ WHERE ' . $this->db->sql_in_set('topic_title', $data['topics']);
+ $result = $this->db->sql_query($sql);
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ if (in_array($row['topic_title'], $data['topics']))
+ {
+ $this->data['topics'][$row['topic_title']] = (int) $row['topic_id'];
+ }
+ }
+ $this->db->sql_freeresult($result);
+ }
+
+ if (!empty($data['posts']))
+ {
+ $sql = 'SELECT *
+ FROM phpbb_posts
+ WHERE ' . $this->db->sql_in_set('post_subject', $data['posts']);
+ $result = $this->db->sql_query($sql);
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ if (in_array($row['post_subject'], $data['posts']))
+ {
+ $this->data['posts'][$row['post_subject']] = (int) $row['post_id'];
+ }
+ }
+ $this->db->sql_freeresult($result);
+ }
+ }
+}
diff --git a/tests/functions/build_hidden_fields_for_query_params_test.php b/tests/functions/build_hidden_fields_for_query_params_test.php
new file mode 100644
index 0000000000..14cb4b9a94
--- /dev/null
+++ b/tests/functions/build_hidden_fields_for_query_params_test.php
@@ -0,0 +1,75 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
+
+class phpbb_build_hidden_fields_for_query_params_test extends phpbb_test_case
+{
+ public function build_hidden_fields_for_query_params_test_data()
+ {
+ return array(
+ // get
+ // post
+ // exclude
+ // expected
+ array(
+ array('foo' => 'bar'),
+ array(),
+ array(),
+ "<input type='hidden' name=\"foo\" value=\"bar\" />",
+ ),
+ array(
+ array('foo' => 'bar', 'a' => 'b'),
+ array(),
+ array(),
+ "<input type='hidden' name=\"foo\" value=\"bar\" /><input type='hidden' name=\"a\" value=\"b\" />",
+ ),
+ array(
+ array('a' => 'quote"', 'b' => '<less>'),
+ array(),
+ array(),
+ "<input type='hidden' name=\"a\" value='quote\"' /><input type='hidden' name=\"b\" value=\"&lt;less&gt;\" />",
+ ),
+ array(
+ array('a' => "quotes'\""),
+ array(),
+ array(),
+ "<input type='hidden' name=\"a\" value=\"quotes'&quot;\" />",
+ ),
+ array(
+ array('foo' => 'bar', 'a' => 'b'),
+ array('a' => 'c'),
+ array(),
+ "<input type='hidden' name=\"foo\" value=\"bar\" />",
+ ),
+ // strict equality check
+ array(
+ array('foo' => 'bar', 'a' => '0'),
+ array('a' => ''),
+ array(),
+ "<input type='hidden' name=\"foo\" value=\"bar\" />",
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider build_hidden_fields_for_query_params_test_data
+ */
+ public function test_build_hidden_fields_for_query_params($get, $post, $exclude, $expected)
+ {
+ $request = new phpbb_mock_request($get, $post);
+ $result = phpbb_build_hidden_fields_for_query_params($request, $exclude);
+
+ $this->assertEquals($expected, $result);
+ }
+}
diff --git a/tests/functions/build_url_test.php b/tests/functions/build_url_test.php
new file mode 100644
index 0000000000..a59b94c744
--- /dev/null
+++ b/tests/functions/build_url_test.php
@@ -0,0 +1,92 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
+
+class phpbb_build_url_test extends phpbb_test_case
+{
+ protected function setUp()
+ {
+ global $user, $phpbb_dispatcher, $phpbb_container, $phpbb_root_path, $phpbb_path_helper;
+
+ parent::setUp();
+
+ $phpbb_container = new phpbb_mock_container_builder();
+ $user = new phpbb_mock_user();
+ $phpbb_dispatcher = new phpbb_mock_event_dispatcher();
+
+ $phpbb_path_helper = new \phpbb\path_helper(
+ new \phpbb\symfony_request(
+ new phpbb_mock_request()
+ ),
+ new \phpbb\filesystem(),
+ $this->getMock('\phpbb\request\request'),
+ $phpbb_root_path,
+ 'php'
+ );
+ $phpbb_container->set('path_helper', $phpbb_path_helper);
+ }
+ public function build_url_test_data()
+ {
+ return array(
+ array(
+ 'index.php',
+ false,
+ 'phpBB/index.php?',
+ ),
+ array(
+ 'index.php',
+ 't',
+ 'phpBB/index.php?',
+ ),
+ array(
+ 'viewtopic.php?t=5&f=4',
+ false,
+ 'phpBB/viewtopic.php?t=5&amp;f=4',
+ ),
+ array(
+ 'viewtopic.php?f=2&style=1&t=6',
+ 'f',
+ 'phpBB/viewtopic.php?style=1&amp;t=6',
+ ),
+ array(
+ 'viewtopic.php?f=2&style=1&t=6',
+ array('f', 'style', 't'),
+ 'phpBB/viewtopic.php?',
+ ),
+ array(
+ 'http://test.phpbb.com/viewtopic.php?f=2&style=1&t=6',
+ array('f', 'style', 't'),
+ 'http://test.phpbb.com/viewtopic.php?',
+ ),
+ array(
+ 'posting.php?f=2&mode=delete&p=20%22%3Cscript%3Ealert%281%29%3B%3C%2Fscript%3E',
+ false,
+ 'phpBB/posting.php?f=2&amp;mode=delete&amp;p=20%22%3Cscript%3Ealert%281%29%3B%3C%2Fscript%3E',
+ )
+ );
+ }
+
+ /**
+ * @dataProvider build_url_test_data
+ */
+ public function test_build_url($page, $strip_vars, $expected)
+ {
+ global $user, $phpbb_root_path;
+
+ $user->page['page'] = $page;
+ $output = build_url($strip_vars);
+
+ $this->assertEquals($expected, $output);
+ }
+}
diff --git a/tests/functions/clean_path_test.php b/tests/functions/clean_path_test.php
deleted file mode 100644
index bcbe9838d9..0000000000
--- a/tests/functions/clean_path_test.php
+++ /dev/null
@@ -1,44 +0,0 @@
-<?php
-/**
-*
-* @package testing
-* @copyright (c) 2012 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
-*
-*/
-
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
-
-class phpbb_clean_path_test extends phpbb_test_case
-{
- public function clean_path_test_data()
- {
- return array(
- array('foo', 'foo'),
- array('foo/bar', 'foo/bar'),
- array('foo/bar/', 'foo/bar/'),
- array('foo/./bar', 'foo/bar'),
- array('foo/./././bar', 'foo/bar'),
- array('foo/bar/.', 'foo/bar'),
- array('./foo/bar', './foo/bar'),
- array('../foo/bar', '../foo/bar'),
- array('one/two/three', 'one/two/three'),
- array('one/two/../three', 'one/three'),
- array('one/../two/three', 'two/three'),
- array('one/two/..', 'one'),
- array('one/two/../', 'one/'),
- array('one/two/../three/../four', 'one/four'),
- array('one/two/three/../../four', 'one/four'),
- );
- }
-
- /**
- * @dataProvider clean_path_test_data
- */
- public function test_clean_path($input, $expected)
- {
- $output = phpbb_clean_path($input);
-
- $this->assertEquals($expected, $output);
- }
-}
diff --git a/tests/functions/convert_30_dbms_to_31_test.php b/tests/functions/convert_30_dbms_to_31_test.php
new file mode 100644
index 0000000000..729c0a82f0
--- /dev/null
+++ b/tests/functions/convert_30_dbms_to_31_test.php
@@ -0,0 +1,44 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
+
+class phpbb_convert_30_dbms_to_31_test extends phpbb_test_case
+{
+ public function convert_30_dbms_to_31_data()
+ {
+ return array(
+ array('mssql'),
+ array('mssql_odbc'),
+ array('mssqlnative'),
+ array('mysql'),
+ array('mysqli'),
+ array('oracle'),
+ array('postgres'),
+ array('sqlite'),
+ );
+ }
+
+ /**
+ * @dataProvider convert_30_dbms_to_31_data
+ */
+ public function test_convert_30_dbms_to_31($input)
+ {
+ $expected = "phpbb\\db\\driver\\$input";
+
+ $config_php_file = new \phpbb\config_php_file('', '');
+ $output = $config_php_file->convert_30_dbms_to_31($input);
+
+ $this->assertEquals($expected, $output);
+ }
+}
diff --git a/tests/functions/fixtures/banned_users.xml b/tests/functions/fixtures/banned_users.xml
new file mode 100644
index 0000000000..cec3f4e51f
--- /dev/null
+++ b/tests/functions/fixtures/banned_users.xml
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<dataset>
+ <table name="phpbb_banlist">
+ <column>ban_userid</column>
+ <column>ban_exclude</column>
+ <column>ban_end</column>
+ <row>
+ <value>1</value>
+ <value>1</value>
+ <value>0</value>
+ </row>
+ <row>
+ <value>2</value>
+ <value>0</value>
+ <value>0</value>
+ </row>
+ <row>
+ <value>3</value>
+ <value>0</value>
+ <value>0</value>
+ </row>
+ <row>
+ <value>4</value>
+ <value>0</value>
+ <value>2</value>
+ </row>
+ <row>
+ <value>5</value>
+ <value>0</value>
+ <value>999999999999999999999</value>
+ </row>
+ <row>
+ <value>6</value>
+ <value>0</value>
+ <value>3</value>
+ </row>
+ </table>
+</dataset>
diff --git a/tests/functions/fixtures/obtain_online.xml b/tests/functions/fixtures/obtain_online.xml
index 05bbe6a05e..14621a3287 100644
--- a/tests/functions/fixtures/obtain_online.xml
+++ b/tests/functions/fixtures/obtain_online.xml
@@ -15,8 +15,6 @@
<column>user_allow_viewonline</column>
<column>user_permissions</column>
<column>user_sig</column>
- <column>user_occ</column>
- <column>user_interests</column>
<row>
<value>1</value>
<value>anonymous</value>
@@ -24,8 +22,6 @@
<value>1</value>
<value></value>
<value></value>
- <value></value>
- <value></value>
</row>
<row>
<value>2</value>
@@ -34,8 +30,6 @@
<value>1</value>
<value></value>
<value></value>
- <value></value>
- <value></value>
</row>
<row>
<value>3</value>
@@ -44,8 +38,6 @@
<value>1</value>
<value></value>
<value></value>
- <value></value>
- <value></value>
</row>
<row>
<value>4</value>
@@ -54,8 +46,6 @@
<value>1</value>
<value></value>
<value></value>
- <value></value>
- <value></value>
</row>
<row>
<value>5</value>
@@ -64,8 +54,6 @@
<value>1</value>
<value></value>
<value></value>
- <value></value>
- <value></value>
</row>
<row>
<value>6</value>
@@ -74,8 +62,6 @@
<value>0</value>
<value></value>
<value></value>
- <value></value>
- <value></value>
</row>
<row>
<value>7</value>
@@ -84,8 +70,6 @@
<value>0</value>
<value></value>
<value></value>
- <value></value>
- <value></value>
</row>
<row>
<value>8</value>
@@ -94,8 +78,6 @@
<value>0</value>
<value></value>
<value></value>
- <value></value>
- <value></value>
</row>
<row>
<value>9</value>
@@ -104,8 +86,6 @@
<value>0</value>
<value></value>
<value></value>
- <value></value>
- <value></value>
</row>
<row>
<value>10</value>
@@ -114,8 +94,6 @@
<value>0</value>
<value></value>
<value></value>
- <value></value>
- <value></value>
</row>
</table>
</dataset>
diff --git a/tests/functions/fixtures/style_select.xml b/tests/functions/fixtures/style_select.xml
index 12d6392ab5..ca95f94461 100644
--- a/tests/functions/fixtures/style_select.xml
+++ b/tests/functions/fixtures/style_select.xml
@@ -4,20 +4,24 @@
<column>style_id</column>
<column>style_name</column>
<column>style_active</column>
+ <column>style_parent_tree</column>
<row>
<value>1</value>
<value>prosilver</value>
<value>1</value>
+ <value></value>
</row>
<row>
<value>2</value>
<value>subsilver2</value>
<value>1</value>
+ <value></value>
</row>
<row>
<value>3</value>
<value>zoo</value>
<value>0</value>
+ <value></value>
</row>
</table>
</dataset>
diff --git a/tests/functions/fixtures/user_delete.xml b/tests/functions/fixtures/user_delete.xml
new file mode 100644
index 0000000000..4c4479d29b
--- /dev/null
+++ b/tests/functions/fixtures/user_delete.xml
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<dataset>
+ <table name="phpbb_users">
+ <column>user_id</column>
+ <column>username_clean</column>
+ <column>username</column>
+ <column>user_permissions</column>
+ <column>user_sig</column>
+ <row>
+ <value>1</value>
+ <value>anonymous</value>
+ <value>anonymous</value>
+ <value></value>
+ <value></value>
+ </row>
+ <row>
+ <value>2</value>
+ <value>2</value>
+ <value>2</value>
+ <value></value>
+ <value></value>
+ </row>
+ </table>
+ <table name="phpbb_oauth_accounts">
+ <column>user_id</column>
+ <column>provider</column>
+ <column>oauth_provider_id</column>
+ <row>
+ <value>2</value>
+ <value>google</value>
+ <value>1234567890123456789</value>
+ </row>
+ </table>
+ <table name="phpbb_oauth_tokens">
+ <column>user_id</column>
+ <column>session_id</column>
+ <column>provider</column>
+ <column>oauth_token</column>
+ <row>
+ <value>2</value>
+ <value>897a897b797c8789997d7979879</value>
+ <value>auth.provider.oauth.service.google</value>
+ <value>{"accessToken":"ya29.YPHwCWVkrvwu1kgbYKiDNYaQ451ZuHy9OEQAGVME8if-WBzR-v7a9ftxbx41kaL)5VLEXB-6qJEvri","endOfLife":1429959670,"extraParams":{"token_type":"Bearer","id_token":"eyJhbGciOiJSUzI1NiIsImupZCI6IjE0YuRjNzc2MDQwYjUyNDZmNTI5OWFkZDVlMmQ1NWNOPTdjMDdlZTAifQ.eyJpc3MiOiJhY2NvdW90cy5nb78nbGUuY29tIiwic3ViIjoiMTExMDMwNwerNjM4MTM5NTQwMTM1IiwiYXpwIjoiOTk3MzUwMTY0NzE0LWhwOXJrYjZpcjM4MW80YjV1NjRpaGtmM29zMnRvbWxhLmFwcHMuZ29vZ2xldXNlcmNvbnRlbnQuY29tIiwiZW1haWwiOiJtYXJjLmFsZXhhbmRlci4zN0BnbWFpbC5jb20iLCJhdF9oYXNoIjoiWHk2b1JabnVZUWRfRTZDeDV0RkItdyIsImVtYWlsX3ZlcmlmaWVkIjp0cnVlLCJhdWQiOiI5OTczNTAxNjQ3MTQtaHA5cmtiNmlyMzgxbzRiNXU2NGloa2Yzb3MydG9tbGEuYXBwcy5nb29nbGV1c2VyY29udGVudC5jb20iLCJpYXQiOjE0Mjk5NTYwNzEsImV4cCI6MTQyOTk1OTY3MX0.C5gfSzjqwlRRvVMuTP6jfWIuEHMXn55oYHsSA3eh97n2BZL0TZHhUm4K206Fgucd6ufAphan4l0J7y6tMAHLZPr-kk6KDINxWnPG-up99reblGutay0lRYjMCcrhJAOql8EI1bi84GyliZFYHL67pE0ZtSf-CMb1CeH18TFe-Fk"},"refreshToken":null,"token_class":"OAuth\\\\OAuth2\\\\Token\\\\StdOAuth2Token"}</value>
+ </row>
+ </table>
+</dataset>
diff --git a/tests/functions/fixtures/validate_email.xml b/tests/functions/fixtures/validate_email.xml
index de7fce8a08..eb4fd90217 100644
--- a/tests/functions/fixtures/validate_email.xml
+++ b/tests/functions/fixtures/validate_email.xml
@@ -6,8 +6,6 @@
<column>username_clean</column>
<column>user_permissions</column>
<column>user_sig</column>
- <column>user_occ</column>
- <column>user_interests</column>
<column>user_email_hash</column>
<row>
<value>1</value>
@@ -15,8 +13,6 @@
<value>admin</value>
<value></value>
<value></value>
- <value></value>
- <value></value>
<value>143317126117</value>
</row>
</table>
diff --git a/tests/functions/fixtures/validate_username.xml b/tests/functions/fixtures/validate_username.xml
index fbe398469c..1b85a2f06d 100644
--- a/tests/functions/fixtures/validate_username.xml
+++ b/tests/functions/fixtures/validate_username.xml
@@ -14,16 +14,12 @@
<column>username_clean</column>
<column>user_permissions</column>
<column>user_sig</column>
- <column>user_occ</column>
- <column>user_interests</column>
<row>
<value>1</value>
<value>admin</value>
<value>admin</value>
<value></value>
<value></value>
- <value></value>
- <value></value>
</row>
<row>
<value>2</value>
@@ -31,8 +27,6 @@
<value>moderator</value>
<value></value>
<value></value>
- <value></value>
- <value></value>
</row>
</table>
</dataset>
diff --git a/tests/functions/generate_string_list.php b/tests/functions/generate_string_list.php
new file mode 100644
index 0000000000..cd1e37618a
--- /dev/null
+++ b/tests/functions/generate_string_list.php
@@ -0,0 +1,64 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions_content.php';
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
+
+class phpbb_generate_string_list_test extends phpbb_test_case
+{
+ public $user;
+
+ public function setUp()
+ {
+ parent::setUp();
+
+ $this->user = new \phpbb\user('\phpbb\datetime');
+ $this->user->data = array('user_lang' => 'en');
+ $this->user->add_lang('common');
+ }
+
+ public function generate_string_list_data()
+ {
+ return array(
+ array(
+ array(),
+ '',
+ ),
+ array(
+ array('A'),
+ 'A',
+ ),
+ array(
+ array(2 => 'A', 3 => 'B'),
+ 'A and B',
+ ),
+ array(
+ array('A' => 'A', 'B' => 'B', 'C' => 'C'),
+ 'A, B, and C',
+ ),
+ array(
+ array('A', 'B', 'C', 'D'),
+ 'A, B, C, and D',
+ )
+ );
+ }
+
+ /**
+ * @dataProvider generate_string_list_data
+ */
+ public function test_generate_string_list($items, $expected_result)
+ {
+ $result = phpbb_generate_string_list($items, $this->user);
+ $this->assertEquals($expected_result, $result);
+ }
+}
diff --git a/tests/functions/get_formatted_filesize_test.php b/tests/functions/get_formatted_filesize_test.php
index 96ea2be132..635753d737 100644
--- a/tests/functions/get_formatted_filesize_test.php
+++ b/tests/functions/get_formatted_filesize_test.php
@@ -1,9 +1,13 @@
<?php
/**
*
-* @package testing
-* @copyright (c) 2012 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
diff --git a/tests/functions/get_preg_expression_test.php b/tests/functions/get_preg_expression_test.php
new file mode 100644
index 0000000000..e74017d315
--- /dev/null
+++ b/tests/functions/get_preg_expression_test.php
@@ -0,0 +1,40 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
+
+class phpbb_functions_get_preg_expression_test extends phpbb_test_case
+{
+ public function data_path_remove_dot_trailing_slash()
+ {
+ return array(
+ array('./../', '$2', '/..'),
+ array('/../', '$2', '/..'),
+ array('', '$2', ''),
+ array('./', '$2', ''),
+ array('/', '$2', ''),
+ array('./../../', '$2', '/../..'),
+ array('/../../', '$2', '/../..'),
+ array('./dir/', '$2', '/dir'),
+ array('./../dir/', '$2', '/../dir'),
+ );
+ }
+
+ /**
+ * @dataProvider data_path_remove_dot_trailing_slash
+ */
+ public function test_path_remove_dot_trailing_slash($input, $replace, $expected)
+ {
+ $this->assertSame($expected, preg_replace(get_preg_expression('path_remove_dot_trailing_slash'), $replace, $input));
+ }
+}
diff --git a/tests/functions/get_remote_file_test.php b/tests/functions/get_remote_file_test.php
index 4032ca5b58..612d82273e 100644
--- a/tests/functions/get_remote_file_test.php
+++ b/tests/functions/get_remote_file_test.php
@@ -1,9 +1,13 @@
<?php
/**
*
-* @package testing
-* @copyright (c) 2013 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -17,6 +21,10 @@ class phpbb_functions_get_remote_file extends phpbb_test_case
{
public function test_version_phpbb_com()
{
+ global $phpbb_container;
+ $phpbb_container = new phpbb_mock_container_builder();
+ $phpbb_container->set('file_downloader', new \phpbb\file_downloader());
+
$hostname = 'version.phpbb.com';
if (!phpbb_checkdnsrr($hostname, 'A'))
diff --git a/tests/functions/is_absolute_test.php b/tests/functions/is_absolute_test.php
index 7630b7c58c..afa4b9b59f 100644
--- a/tests/functions/is_absolute_test.php
+++ b/tests/functions/is_absolute_test.php
@@ -1,9 +1,13 @@
<?php
/**
*
-* @package testing
-* @copyright (c) 2013 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -51,6 +55,6 @@ class phpbb_functions_is_absolute_test extends phpbb_test_case
*/
public function test_is_absolute($path, $expected)
{
- $this->assertEquals($expected, is_absolute($path));
+ $this->assertEquals($expected, phpbb_is_absolute($path));
}
}
diff --git a/tests/functions/language_select_test.php b/tests/functions/language_select_test.php
index 3341e2a256..6762ead5a1 100644
--- a/tests/functions/language_select_test.php
+++ b/tests/functions/language_select_test.php
@@ -1,9 +1,13 @@
<?php
/**
*
-* @package testing
-* @copyright (c) 2013 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
diff --git a/tests/functions/make_clickable_email_test.php b/tests/functions/make_clickable_email_test.php
new file mode 100644
index 0000000000..4c802d0487
--- /dev/null
+++ b/tests/functions/make_clickable_email_test.php
@@ -0,0 +1,222 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions_content.php';
+
+class phpbb_functions_make_clickable_email_test extends phpbb_test_case
+{
+ protected function setUp()
+ {
+ parent::setUp();
+
+ global $config, $user, $request;
+ $user = new phpbb_mock_user();
+ $request = new phpbb_mock_request();
+ }
+
+ /**
+ * 'e' tag for email addresses html
+ **/
+ public function data_test_make_clickable_email_positive()
+ {
+ return array(
+ array(
+ 'nobody@phpbb.com',
+ '<!-- e --><a href="mailto:nobody@phpbb.com">nobody@phpbb.com</a><!-- e -->'
+ ),
+ array(
+ 'Nobody@sub.phpbb.com',
+ '<!-- e --><a href="mailto:Nobody@sub.phpbb.com">Nobody@sub.phpbb.com</a><!-- e -->'
+ ),
+ array(
+ 'alice.bob@foo.phpbb.com',
+ '<!-- e --><a href="mailto:alice.bob@foo.phpbb.com">alice.bob@foo.phpbb.com</a><!-- e -->'
+ ),
+ array(
+ 'alice-foo@bar.phpbb.com',
+ '<!-- e --><a href="mailto:alice-foo@bar.phpbb.com">alice-foo@bar.phpbb.com</a><!-- e -->'
+ ),
+ array(
+ 'alice_foo@bar.phpbb.com',
+ '<!-- e --><a href="mailto:alice_foo@bar.phpbb.com">alice_foo@bar.phpbb.com</a><!-- e -->'
+ ),
+ array(
+ 'alice+tag@foo.phpbb.com',
+ '<!-- e --><a href="mailto:alice+tag@foo.phpbb.com">alice+tag@foo.phpbb.com</a><!-- e -->'
+ ),
+ array(
+ 'alice&amp;tag@foo.phpbb.com',
+ '<!-- e --><a href="mailto:alice&amp;tag@foo.phpbb.com">alice&amp;tag@foo.phpbb.com</a><!-- e -->'
+ ),
+ array(
+ 'alice@phpbb.australia',
+ '<!-- e --><a href="mailto:alice@phpbb.australia">alice@phpbb.australia</a><!-- e -->'
+ ),
+
+ // Test shortened text for email > 55 characters long
+ // Email text should be turned into: first 39 chars + ' ... ' + last 10 chars
+ array(
+ 'alice@phpbb.topZlevelZdomainZnamesZcanZbeZupZtoZsixtyZthreeZcharactersZlong',
+ '<!-- e --><a href="mailto:alice@phpbb.topZlevelZdomainZnamesZcanZbeZupZtoZsixtyZthreeZcharactersZlong">alice@phpbb.topZlevelZdomainZnamesZcanZ ... ctersZlong</a><!-- e -->'
+ ),
+ array(
+ 'l3tt3rsAndNumb3rs@domain.com',
+ '<!-- e --><a href="mailto:l3tt3rsAndNumb3rs@domain.com">l3tt3rsAndNumb3rs@domain.com</a><!-- e -->'
+ ),
+ array(
+ 'has-dash@domain.com',
+ '<!-- e --><a href="mailto:has-dash@domain.com">has-dash@domain.com</a><!-- e -->'
+ ),
+ array(
+ 'hasApostrophe.o\'leary@domain.org',
+ '<!-- e --><a href="mailto:hasApostrophe.o\'leary@domain.org">hasApostrophe.o\'leary@domain.org</a><!-- e -->'
+ ),
+ array(
+ 'uncommonTLD@domain.museum',
+ '<!-- e --><a href="mailto:uncommonTLD@domain.museum">uncommonTLD@domain.museum</a><!-- e -->'
+ ),
+ array(
+ 'uncommonTLD@domain.travel',
+ '<!-- e --><a href="mailto:uncommonTLD@domain.travel">uncommonTLD@domain.travel</a><!-- e -->'
+ ),
+ array(
+ 'uncommonTLD@domain.mobi',
+ '<!-- e --><a href="mailto:uncommonTLD@domain.mobi">uncommonTLD@domain.mobi</a><!-- e -->'
+ ),
+ array(
+ 'countryCodeTLD@domain.uk',
+ '<!-- e --><a href="mailto:countryCodeTLD@domain.uk">countryCodeTLD@domain.uk</a><!-- e -->'
+ ),
+ array(
+ 'countryCodeTLD@domain.rw',
+ '<!-- e --><a href="mailto:countryCodeTLD@domain.rw">countryCodeTLD@domain.rw</a><!-- e -->'
+ ),
+ array(
+ 'numbersInDomain@911.com',
+ '<!-- e --><a href="mailto:numbersInDomain@911.com">numbersInDomain@911.com</a><!-- e -->'
+ ),
+ array(
+ 'underscore_inLocal@domain.net',
+ '<!-- e --><a href="mailto:underscore_inLocal@domain.net">underscore_inLocal@domain.net</a><!-- e -->'
+ ),
+ array(
+ 'IPInsteadOfDomain@127.0.0.1',
+ '<!-- e --><a href="mailto:IPInsteadOfDomain@127.0.0.1">IPInsteadOfDomain@127.0.0.1</a><!-- e -->'
+ ),
+ array(
+ 'IPAndPort@127.0.0.1:25',
+ '<!-- e --><a href="mailto:IPAndPort@127.0.0.1:25">IPAndPort@127.0.0.1:25</a><!-- e -->'
+ ),
+ array(
+ 'subdomain@sub.domain.com',
+ '<!-- e --><a href="mailto:subdomain@sub.domain.com">subdomain@sub.domain.com</a><!-- e -->'
+ ),
+ array(
+ 'local@dash-inDomain.com',
+ '<!-- e --><a href="mailto:local@dash-inDomain.com">local@dash-inDomain.com</a><!-- e -->'
+ ),
+ array(
+ 'dot.inLocal@foo.com',
+ '<!-- e --><a href="mailto:dot.inLocal@foo.com">dot.inLocal@foo.com</a><!-- e -->'
+ ),
+ array(
+ 'a@singleLetterLocal.org',
+ '<!-- e --><a href="mailto:a@singleLetterLocal.org">a@singleLetterLocal.org</a><!-- e -->'
+ ),
+ array(
+ 'singleLetterDomain@x.org',
+ '<!-- e --><a href="mailto:singleLetterDomain@x.org">singleLetterDomain@x.org</a><!-- e -->'
+ ),
+ array(
+ '&amp;*=?^+{}\'~@validCharsInLocal.net',
+ '<!-- e --><a href="mailto:&amp;*=?^+{}\'~@validCharsInLocal.net">&amp;*=?^+{}\'~@validCharsInLocal.net</a><!-- e -->'
+ ),
+ array(
+ 'foor@bar.newTLD',
+ '<!-- e --><a href="mailto:foor@bar.newTLD">foor@bar.newTLD</a><!-- e -->'
+ ),
+ );
+ }
+
+ public function data_test_make_clickable_email_negative()
+ {
+ return array(
+ array('foo.example.com'), // @ is missing
+ array('.foo.example.com'), // . as first character
+ array('Foo.@example.com'), // . is last in local part
+ array('foo..123@example.com'), // . doubled
+ array('a@b@c@example.com'), // @ doubled
+
+ // Emails with invalid characters
+ // (only 'valid' pieces having localparts prepended with one of the \n \t ( > chars should parsed if any)
+ array('()[]\;:,<>@example.com'), // invalid characters
+ array('abc(def@example.com', 'abc(<!-- e --><a href="mailto:def@example.com">def@example.com</a><!-- e -->'), // invalid character (
+ array('abc)def@example.com'), // invalid character )
+ array('abc[def@example.com'), // invalid character [
+ array('abc]def@example.com'), // invalid character ]
+ array('abc\def@example.com'), // invalid character \
+ array('abc;def@example.com'), // invalid character ;
+ array('abc:def@example.com'), // invalid character :
+ array('abc,def@example.com'), // invalid character ,
+ array('abc<def@example.com'), // invalid character <
+ array('abc>def@example.com', 'abc><!-- e --><a href="mailto:def@example.com">def@example.com</a><!-- e -->'), // invalid character >
+
+ // http://fightingforalostcause.net/misc/2006/compare-email-regex.php
+ array('missingDomain@.com'),
+ array('@missingLocal.org'),
+ array('missingatSign.net'),
+ array('missingDot@com'),
+ array('two@@signs.com'),
+ // Trailing colon is ignored
+ array('colonButNoPort@127.0.0.1:', '<!-- e --><a href="mailto:colonButNoPort@127.0.0.1">colonButNoPort@127.0.0.1</a><!-- e -->:'),
+
+ array(''),
+ // Trailing part after the 3rd dot is ignored
+ array('someone-else@127.0.0.1.26', '<!-- e --><a href="mailto:someone-else@127.0.0.1">someone-else@127.0.0.1</a><!-- e -->.26'),
+
+ array('.localStartsWithDot@domain.com'),
+ array('localEndsWithDot.@domain.com'),
+ array('two..consecutiveDots@domain.com'),
+ array('domainStartsWithDash@-domain.com'),
+ array('domainEndsWithDash@domain-.com'),
+ array('numbersInTLD@domain.c0m'),
+ array('missingTLD@domain.'),
+ array('! "#$%(),/;<>[]`|@invalidCharsInLocal.org'),
+ array('invalidCharsInDomain@! "#$%(),/;<>_[]`|.org'),
+ array('local@SecondLevelDomainNamesAreInvalidIfTheyAreLongerThan64Charactersss.org'),
+ // The domain zone name part after the 63rd char is ignored
+ array(
+ 'alice@phpbb.topZlevelZdomainZnamesZcanZbeZupZtoZsixtyZthreeZcharactersZlongZ',
+ '<!-- e --><a href="mailto:alice@phpbb.topZlevelZdomainZnamesZcanZbeZupZtoZsixtyZthreeZcharactersZlong">alice@phpbb.topZlevelZdomainZnamesZcanZ ... ctersZlong</a><!-- e -->Z'
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider data_test_make_clickable_email_positive
+ */
+ public function test_email_matching_positive($email, $expected)
+ {
+ $this->assertSame($expected, make_clickable($email));
+ }
+
+ /**
+ * @dataProvider data_test_make_clickable_email_negative
+ */
+ public function test_email_matching_negative($email, $expected = null)
+ {
+ $expected = ($expected) ?: $email;
+ $this->assertSame($expected, make_clickable($email));
+ }
+}
diff --git a/tests/functions/make_clickable_test.php b/tests/functions/make_clickable_test.php
new file mode 100644
index 0000000000..63beeb06b2
--- /dev/null
+++ b/tests/functions/make_clickable_test.php
@@ -0,0 +1,180 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions_content.php';
+
+class phpbb_functions_make_clickable_test extends phpbb_test_case
+{
+ /**
+ * Tags:
+ * 'm' - full URL like xxxx://aaaaa.bbb.cccc.
+ * 'l' - local relative board URL like http://domain.tld/path/to/board/index.php
+ * 'w' - URL without http/https protocol like www.xxxx.yyyy[/zzzz] aka 'lazy' URLs
+ * 'e' - email@domain type address
+ *
+ * Classes:
+ * "postlink-local" for 'l' URLs
+ * "postlink" for the rest of URLs
+ * empty for email addresses
+ **/
+ public function data_test_make_clickable_url_positive()
+ {
+ return array(
+ array(
+ 'http://www.phpbb.com/community/',
+ '<!-- m --><a class="postlink" href="http://www.phpbb.com/community/">http://www.phpbb.com/community/</a><!-- m -->'
+ ),
+ array(
+ 'http://www.phpbb.com/path/file.ext#section',
+ '<!-- m --><a class="postlink" href="http://www.phpbb.com/path/file.ext#section">http://www.phpbb.com/path/file.ext#section</a><!-- m -->'
+ ),
+ array(
+ 'ftp://ftp.phpbb.com/',
+ '<!-- m --><a class="postlink" href="ftp://ftp.phpbb.com/">ftp://ftp.phpbb.com/</a><!-- m -->'
+ ),
+ array(
+ 'sip://bantu@phpbb.com',
+ '<!-- m --><a class="postlink" href="sip://bantu@phpbb.com">sip://bantu@phpbb.com</a><!-- m -->'
+ ),
+ array(
+ 'www.phpbb.com/community/',
+ '<!-- w --><a class="postlink" href="http://www.phpbb.com/community/">www.phpbb.com/community/</a><!-- w -->'
+ ),
+ array(
+ 'http://testhost/viewtopic.php?t=1',
+ '<!-- l --><a class="postlink-local" href="http://testhost/viewtopic.php?t=1">viewtopic.php?t=1</a><!-- l -->'
+ ),
+ array(
+ 'email@domain.com',
+ '<!-- e --><a href="mailto:email@domain.com">email@domain.com</a><!-- e -->'
+ ),
+ // Test appending punctuation mark to the URL
+ array(
+ 'http://testhost/viewtopic.php?t=1!',
+ '<!-- l --><a class="postlink-local" href="http://testhost/viewtopic.php?t=1">viewtopic.php?t=1</a><!-- l -->!'
+ ),
+ array(
+ 'www.phpbb.com/community/?',
+ '<!-- w --><a class="postlink" href="http://www.phpbb.com/community/">www.phpbb.com/community/</a><!-- w -->?'
+ ),
+ // Test shortened text for URL > 55 characters long
+ // URL text should be turned into: first 39 chars + ' ... ' + last 10 chars
+ array(
+ 'http://www.phpbb.com/community/path/to/long/url/file.ext#section',
+ '<!-- m --><a class="postlink" href="http://www.phpbb.com/community/path/to/long/url/file.ext#section">http://www.phpbb.com/community/path/to/ ... xt#section</a><!-- m -->'
+ ),
+ );
+ }
+
+ public function data_test_make_clickable_url_idn()
+ {
+ return array(
+ array(
+ 'http://www.täst.de/community/',
+ '<!-- m --><a class="postlink" href="http://www.täst.de/community/">http://www.täst.de/community/</a><!-- m -->'
+ ),
+ array(
+ 'http://www.täst.de/path/file.ext#section',
+ '<!-- m --><a class="postlink" href="http://www.täst.de/path/file.ext#section">http://www.täst.de/path/file.ext#section</a><!-- m -->'
+ ),
+ array(
+ 'ftp://ftp.täst.de/',
+ '<!-- m --><a class="postlink" href="ftp://ftp.täst.de/">ftp://ftp.täst.de/</a><!-- m -->'
+ ),
+ array(
+ 'sip://bantu@täst.de',
+ '<!-- m --><a class="postlink" href="sip://bantu@täst.de">sip://bantu@täst.de</a><!-- m -->'
+ ),
+ array(
+ 'www.täst.de/community/',
+ '<!-- w --><a class="postlink" href="http://www.täst.de/community/">www.täst.de/community/</a><!-- w -->'
+ ),
+ // Test appending punctuation mark to the URL
+ array(
+ 'http://домен.рф/viewtopic.php?t=1!',
+ '<!-- m --><a class="postlink" href="http://домен.рф/viewtopic.php?t=1">http://домен.рф/viewtopic.php?t=1</a><!-- m -->!'
+ ),
+ array(
+ 'www.домен.рф/сообщество/?',
+ '<!-- w --><a class="postlink" href="http://www.домен.рф/сообщество/">www.домен.рф/сообщество/</a><!-- w -->?'
+ ),
+ // Test shortened text for URL > 55 characters long
+ // URL text should be turned into: first 39 chars + ' ... ' + last 10 chars
+ array(
+ 'http://www.домен.рф/сообщество/путь/по/длинной/ссылке/file.ext#section',
+ '<!-- m --><a class="postlink" href="http://www.домен.рф/сообщество/путь/по/длинной/ссылке/file.ext#section">http://www.домен.рф/сообщество/путь/по/ ... xt#section</a><!-- m -->'
+ ),
+
+ // IDN with invalid characters shouldn't be parsed correctly (only 'valid' part)
+ array(
+ 'http://www.täst╫.de',
+ '<!-- m --><a class="postlink" href="http://www.täst">http://www.täst</a><!-- m -->╫.de'
+ ),
+ // IDN in emails is unsupported yet
+ array('почта@домен.рф', 'почта@домен.рф'),
+ );
+ }
+
+ public function data_test_make_clickable_local_url_idn()
+ {
+ return array(
+ array(
+ 'http://www.домен.рф/viewtopic.php?t=1',
+ '<!-- l --><a class="postlink-local" href="http://www.домен.рф/viewtopic.php?t=1">viewtopic.php?t=1</a><!-- l -->'
+ ),
+ // Test appending punctuation mark to the URL
+ array(
+ 'http://www.домен.рф/viewtopic.php?t=1!',
+ '<!-- l --><a class="postlink-local" href="http://www.домен.рф/viewtopic.php?t=1">viewtopic.php?t=1</a><!-- l -->!'
+ ),
+ array(
+ 'http://www.домен.рф/сообщество/?',
+ '<!-- l --><a class="postlink-local" href="http://www.домен.рф/сообщество/">сообщество/</a><!-- l -->?'
+ ),
+ );
+ }
+
+ protected function setUp()
+ {
+ parent::setUp();
+
+ global $config, $user, $request;
+ $user = new phpbb_mock_user();
+ $request = new phpbb_mock_request();
+ }
+
+ /**
+ * @dataProvider data_test_make_clickable_url_positive
+ */
+ public function test_urls_matching_positive($url, $expected)
+ {
+ $this->assertSame($expected, make_clickable($url));
+ }
+
+ /**
+ * @dataProvider data_test_make_clickable_url_idn
+ */
+ public function test_urls_matching_idn($url, $expected)
+ {
+ $this->assertSame($expected, make_clickable($url));
+ }
+
+ /**
+ * @dataProvider data_test_make_clickable_local_url_idn
+ */
+ public function test_local_urls_matching_idn($url, $expected)
+ {
+ $this->assertSame($expected, make_clickable($url, "http://www.домен.рф"));
+ }
+}
diff --git a/tests/functions/obtain_online_test.php b/tests/functions/obtain_online_test.php
index de6451a0db..e793a4eb82 100644
--- a/tests/functions/obtain_online_test.php
+++ b/tests/functions/obtain_online_test.php
@@ -1,15 +1,18 @@
<?php
/**
*
-* @package testing
-* @copyright (c) 2013 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
require_once dirname(__FILE__) . '/../../phpBB/includes/functions_content.php';
-require_once dirname(__FILE__) . '/../../phpBB/includes/auth.php';
class phpbb_functions_obtain_online_test extends phpbb_database_test_case
{
@@ -125,28 +128,28 @@ class phpbb_functions_obtain_online_test extends phpbb_database_test_case
{
return array(
array(0, false, array(
- 'online_userlist' => 'REGISTERED_USERS 2, 3',
- 'l_online_users' => 'ONLINE_USERS_TOTAL 5REG_USERS_TOTAL_AND 2HIDDEN_USERS_TOTAL 3',
+ 'online_userlist' => 'REGISTERED_USERS <span class="username">2</span>, <span class="username">3</span>',
+ 'l_online_users' => 'ONLINE_USERS_TOTAL 5 REG_USERS_TOTAL 2 HIDDEN_USERS_TOTAL 3',
)),
array(0, true, array(
- 'online_userlist' => 'REGISTERED_USERS 2, 3',
- 'l_online_users' => 'ONLINE_USERS_TOTAL 7REG_USERS_TOTAL 2HIDDEN_USERS_TOTAL_AND 3GUEST_USERS_TOTAL 2',
+ 'online_userlist' => 'REGISTERED_USERS <span class="username">2</span>, <span class="username">3</span>',
+ 'l_online_users' => 'ONLINE_USERS_TOTAL_GUESTS 7 REG_USERS_TOTAL 2 HIDDEN_USERS_TOTAL 3 GUEST_USERS_TOTAL 2',
)),
array(1, false, array(
- 'online_userlist' => 'BROWSING_FORUM 3',
- 'l_online_users' => 'ONLINE_USERS_TOTAL 2REG_USER_TOTAL_AND 1HIDDEN_USER_TOTAL 1',
+ 'online_userlist' => 'BROWSING_FORUM <span class="username">3</span>',
+ 'l_online_users' => 'ONLINE_USERS_TOTAL 2 REG_USERS_TOTAL 1 HIDDEN_USERS_TOTAL 1',
)),
array(1, true, array(
- 'online_userlist' => 'BROWSING_FORUM_GUEST 3 1',
- 'l_online_users' => 'ONLINE_USERS_TOTAL 3REG_USER_TOTAL 1HIDDEN_USER_TOTAL_AND 1GUEST_USER_TOTAL 1',
+ 'online_userlist' => 'BROWSING_FORUM_GUESTS 1 <span class="username">3</span>',
+ 'l_online_users' => 'ONLINE_USERS_TOTAL_GUESTS 3 REG_USERS_TOTAL 1 HIDDEN_USERS_TOTAL 1 GUEST_USERS_TOTAL 1',
)),
array(2, false, array(
'online_userlist' => 'BROWSING_FORUM NO_ONLINE_USERS',
- 'l_online_users' => 'ONLINE_USERS_ZERO_TOTAL 0REG_USERS_ZERO_TOTAL_AND 0HIDDEN_USERS_ZERO_TOTAL 0',
+ 'l_online_users' => 'ONLINE_USERS_TOTAL 0 REG_USERS_TOTAL 0 HIDDEN_USERS_TOTAL 0',
)),
array(2, true, array(
- 'online_userlist' => 'BROWSING_FORUM_GUESTS NO_ONLINE_USERS 0',
- 'l_online_users' => 'ONLINE_USERS_ZERO_TOTAL 0REG_USERS_ZERO_TOTAL 0HIDDEN_USERS_ZERO_TOTAL_AND 0GUEST_USERS_ZERO_TOTAL 0',
+ 'online_userlist' => 'BROWSING_FORUM_GUESTS 0 NO_ONLINE_USERS',
+ 'l_online_users' => 'ONLINE_USERS_TOTAL_GUESTS 0 REG_USERS_TOTAL 0 HIDDEN_USERS_TOTAL 0 GUEST_USERS_TOTAL 0',
)),
);
}
@@ -158,18 +161,21 @@ class phpbb_functions_obtain_online_test extends phpbb_database_test_case
{
$this->db->sql_query('DELETE FROM phpbb_sessions');
- global $config, $user, $auth;
+ global $config, $user, $auth, $phpbb_dispatcher;
$config['load_online_guests'] = $display_guests;
+ $user = new phpbb_mock_lang();
$user->lang = $this->load_language();
- $auth = $this->getMock('auth');
+ $auth = $this->getMock('\phpbb\auth\auth');
$acl_get_map = array(
array('u_viewonline', true),
+ array('u_viewprofile', true),
);
$auth->expects($this->any())
->method('acl_get')
->with($this->stringContains('_'),
$this->anything())
->will($this->returnValueMap($acl_get_map));
+ $phpbb_dispatcher = new phpbb_mock_event_dispatcher();
$time = time();
$this->create_guest_sessions($time);
@@ -215,25 +221,12 @@ class phpbb_functions_obtain_online_test extends phpbb_database_test_case
protected function load_language()
{
- $lang = array(
+ return array(
'NO_ONLINE_USERS' => 'NO_ONLINE_USERS',
'REGISTERED_USERS' => 'REGISTERED_USERS',
'BROWSING_FORUM' => 'BROWSING_FORUM %s',
'BROWSING_FORUM_GUEST' => 'BROWSING_FORUM_GUEST %s %d',
'BROWSING_FORUM_GUESTS' => 'BROWSING_FORUM_GUESTS %s %d',
);
- $vars_online = array('ONLINE', 'REG', 'HIDDEN', 'GUEST');
- foreach ($vars_online as $online)
- {
- $lang = array_merge($lang, array(
- $online . '_USERS_ZERO_TOTAL' => $online . '_USERS_ZERO_TOTAL %d',
- $online . '_USER_TOTAL' => $online . '_USER_TOTAL %d',
- $online . '_USERS_TOTAL' => $online . '_USERS_TOTAL %d',
- $online . '_USERS_ZERO_TOTAL_AND' => $online . '_USERS_ZERO_TOTAL_AND %d',
- $online . '_USER_TOTAL_AND' => $online . '_USER_TOTAL_AND %d',
- $online . '_USERS_TOTAL_AND' => $online . '_USERS_TOTAL_AND %d',
- ));
- }
- return $lang;
}
}
diff --git a/tests/functions/parse_cfg_file_test.php b/tests/functions/parse_cfg_file_test.php
index 69000ddf72..b47e25fbc1 100644
--- a/tests/functions/parse_cfg_file_test.php
+++ b/tests/functions/parse_cfg_file_test.php
@@ -1,9 +1,13 @@
<?php
/**
*
-* @package testing
-* @copyright (c) 2014 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -19,10 +23,13 @@ class phpbb_functions_parse_cfg_file extends phpbb_test_case
'#',
'# phpBB Style Configuration File',
'#',
- '# @package phpBB3',
- '# @copyright (c) 2005 phpBB Group',
- '# @license http://opensource.org/licenses/gpl-license.php GNU Public License',
+ '# This file is part of the phpBB Forum Software package.',
+ '#',
+ '# @copyright (c) phpBB Limited <https://www.phpbb.com>',
+ '# @license GNU General Public License, version 2 (GPL-2.0)',
'#',
+ '# For full copyright and license information, please see',
+ '# the docs/CREDITS.txt file.',
'#',
'# At the left is the name, please do not change this',
'# At the right the value is entered',
@@ -35,24 +42,24 @@ class phpbb_functions_parse_cfg_file extends phpbb_test_case
'',
'# General Information about this style',
'name = prosilver',
- 'copyright = © phpBB Group, 2007',
+ 'copyright = © phpBB Limited, 2007',
'version = 3.0.12',
),
array(
'name' => 'prosilver',
- 'copyright' => '© phpBB Group, 2007',
+ 'copyright' => '© phpBB Limited, 2007',
'version' => '3.0.12',
),
),
array(
array(
'name = subsilver2',
- 'copyright = © 2005 phpBB Group',
+ 'copyright = © 2005 phpBB Limited',
'version = 3.0.12',
),
array(
'name' => 'subsilver2',
- 'copyright' => '© 2005 phpBB Group',
+ 'copyright' => '© 2005 phpBB Limited',
'version' => '3.0.12',
),
),
diff --git a/tests/functions/phpbb_get_banned_user_ids.php b/tests/functions/phpbb_get_banned_user_ids.php
new file mode 100644
index 0000000000..6f7607132e
--- /dev/null
+++ b/tests/functions/phpbb_get_banned_user_ids.php
@@ -0,0 +1,62 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions_user.php';
+
+class phpbb_get_banned_user_ids_test extends phpbb_database_test_case
+{
+ public function getDataSet()
+ {
+ return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/banned_users.xml');
+ }
+
+ public function phpbb_get_banned_user_ids_data()
+ {
+ return array(
+ // Input to phpbb_get_banned_user_ids (user_id list, ban_end)
+ // Expected output
+ array(
+ // True to get users currently banned
+ array(array(1, 2, 4, 5, 6), true),
+ array(2 => 2, 5 => 5),
+ ),
+ array(
+ // False to only get permanently banned users
+ array(array(1, 2, 4, 5, 6), false),
+ array(2 => 2),
+ ),
+ array(
+ // Unix timestamp to get users banned until that time
+ array(array(1, 2, 4, 5, 6), 2),
+ array(2 => 2, 5 => 5, 6 => 6),
+ ),
+ );
+ }
+
+ public function setUp()
+ {
+ global $db;
+
+ $db = $this->new_dbal();
+
+ return parent::setUp();
+ }
+
+ /**
+ * @dataProvider phpbb_get_banned_user_ids_data
+ */
+ public function test_phpbb_get_banned_user_ids($input, $expected)
+ {
+ $this->assertEquals($expected, call_user_func_array('phpbb_get_banned_user_ids', $input));
+ }
+}
diff --git a/tests/functions/quoteattr_test.php b/tests/functions/quoteattr_test.php
new file mode 100644
index 0000000000..6e191f9610
--- /dev/null
+++ b/tests/functions/quoteattr_test.php
@@ -0,0 +1,48 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
+
+class phpbb_quoteattr_test extends phpbb_test_case
+{
+ public function quoteattr_test_data()
+ {
+ return array(
+ array('foo', null, '"foo"'),
+ array('', null, '""'),
+ array(' ', null, '" "'),
+ array('<a>', null, '"&lt;a&gt;"'),
+ array('&amp;', null, '"&amp;amp;"'),
+ array('"hello"', null, "'\"hello\"'"),
+ array("'hello'", null, "\"'hello'\""),
+ array("\"'", null, "\"&quot;'\""),
+ array("a\nb", null, '"a&#10;b"'),
+ array("a\r\nb", null, '"a&#13;&#10;b"'),
+ array("a\tb", null, '"a&#9;b"'),
+ array('a b', null, '"a b"'),
+ array('"a<b"', null, "'\"a&lt;b\"'"),
+ array('foo', array('f' => 'z'), '"zoo"'),
+ array('<a>', array('a' => '&amp;'), '"&lt;&amp;&gt;"'),
+ );
+ }
+
+ /**
+ * @dataProvider quoteattr_test_data
+ */
+ public function test_quoteattr($input, $entities, $expected)
+ {
+ $output = phpbb_quoteattr($input, $entities);
+
+ $this->assertEquals($expected, $output);
+ }
+}
diff --git a/tests/functions/style_select_test.php b/tests/functions/style_select_test.php
index 1e44f3c2cb..a918f83155 100644
--- a/tests/functions/style_select_test.php
+++ b/tests/functions/style_select_test.php
@@ -1,9 +1,13 @@
<?php
/**
*
-* @package testing
-* @copyright (c) 2013 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
diff --git a/tests/functions/user_delete_test.php b/tests/functions/user_delete_test.php
new file mode 100644
index 0000000000..c224323273
--- /dev/null
+++ b/tests/functions/user_delete_test.php
@@ -0,0 +1,113 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions_user.php';
+
+class phpbb_functions_user_delete_test extends phpbb_database_test_case
+{
+ /** @var \phpbb\db\driver\driver_interface */
+ protected $db;
+
+ public function getDataSet()
+ {
+ return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/user_delete.xml');
+ }
+
+ protected function setUp()
+ {
+ parent::setUp();
+
+ global $cache, $config, $db, $phpbb_container, $phpbb_dispatcher, $user;
+
+ $this->db = $db = $this->new_dbal();
+ $user = new \phpbb\user('\phpbb\datetime');
+ $phpbb_dispatcher = new phpbb_mock_event_dispatcher();
+ $phpbb_container = new phpbb_mock_container_builder();
+ $config = new \phpbb\config\config(array(
+ 'auth_method' => 'oauth',
+ 'auth_oauth_google_key' => 'foo',
+ 'auth_oauth_google_secret' => 'bar',
+ ));
+ set_config_count('foobar', 0, false, $config);
+ $cache = new \phpbb\cache\driver\null();
+ $request = new phpbb_mock_request();
+ $notification_manager = new phpbb_mock_notification_manager();
+ $provider_collection = new \phpbb\auth\provider_collection($phpbb_container, $config);
+ $oauth_provider_google = new \phpbb\auth\provider\oauth\service\google($config, $request);
+ $oauth_provider_collection = new \phpbb\di\service_collection($phpbb_container);
+ $oauth_provider_collection->offsetSet('auth.provider.oauth.service.google', $oauth_provider_google);
+
+ $driver_helper = new \phpbb\passwords\driver\helper($config);
+ $passwords_drivers = array(
+ 'passwords.driver.bcrypt_2y' => new \phpbb\passwords\driver\bcrypt_2y($config, $driver_helper),
+ 'passwords.driver.bcrypt' => new \phpbb\passwords\driver\bcrypt($config, $driver_helper),
+ 'passwords.driver.salted_md5' => new \phpbb\passwords\driver\salted_md5($config, $driver_helper),
+ 'passwords.driver.phpass' => new \phpbb\passwords\driver\phpass($config, $driver_helper),
+ );
+
+ $passwords_helper = new \phpbb\passwords\helper;
+ // Set up passwords manager
+ $passwords_manager = new \phpbb\passwords\manager($config, $passwords_drivers, $passwords_helper, array_keys($passwords_drivers));
+
+ $oauth_provider = new \phpbb\auth\provider\oauth\oauth(
+ $db,
+ $config,
+ $passwords_manager,
+ $request,
+ $user,
+ 'phpbb_oauth_tokens',
+ 'phpbb_oauth_accounts',
+ $oauth_provider_collection,
+ 'phpbb_users',
+ $phpbb_container,
+ $phpbb_dispatcher,
+ $this->phpbb_root_path,
+ $this->php_ext
+ );
+ $provider_collection->offsetSet('auth.provider.oauth', $oauth_provider);
+
+ $phpbb_container->set('auth.provider.oauth', $oauth_provider);
+ $phpbb_container->set('auth.provider.oauth.service.google', $oauth_provider_google);
+ $phpbb_container->set('auth.provider_collection', $provider_collection);
+ $phpbb_container->set('notification_manager', $notification_manager);
+ }
+
+ public function test_user_delete()
+ {
+ // Check that user is linked
+ $sql = 'SELECT ot.user_id AS user_id
+ FROM phpbb_oauth_accounts oa, phpbb_oauth_tokens ot
+ WHERE oa.user_id = 2
+ AND ot.user_id = oa.user_id';
+ $result = $this->db->sql_query($sql);
+ $row = $this->db->sql_fetchrow($result);
+ $this->db->sql_freeresult($result);
+
+ $this->assertEquals(array('user_id' => '2'), $row);
+
+ // user_delete() should return false
+ $this->assertFalse(user_delete('remove', array(2)));
+
+ // Make sure user link was removed
+ $sql = 'SELECT ot.user_id AS user_id
+ FROM phpbb_oauth_accounts oa, phpbb_oauth_tokens ot
+ WHERE oa.user_id = 2
+ AND ot.user_id = oa.user_id';
+ $result = $this->db->sql_query($sql);
+ $row = $this->db->sql_fetchrow($result);
+ $this->db->sql_freeresult($result);
+
+ $this->assertEmpty($row);
+ }
+}
diff --git a/tests/functions/validate_data_helper.php b/tests/functions/validate_data_helper.php
index b92a3aa5eb..448d029d3f 100644
--- a/tests/functions/validate_data_helper.php
+++ b/tests/functions/validate_data_helper.php
@@ -1,9 +1,13 @@
<?php
/**
*
-* @package testing
-* @copyright (c) 2013 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
diff --git a/tests/functions/validate_date_test.php b/tests/functions/validate_date_test.php
index 1dcd1361a2..9dc0db46d6 100644
--- a/tests/functions/validate_date_test.php
+++ b/tests/functions/validate_date_test.php
@@ -1,9 +1,13 @@
<?php
/**
*
-* @package testing
-* @copyright (c) 2013 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
diff --git a/tests/functions/validate_email_test.php b/tests/functions/validate_email_test.php
index 9a6ce39251..b46509fda7 100644
--- a/tests/functions/validate_email_test.php
+++ b/tests/functions/validate_email_test.php
@@ -2,7 +2,7 @@
/**
*
* @package testing
-* @copyright (c) 2013 phpBB Group
+* @copyright (c) 2014 phpBB Group
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
@@ -47,60 +47,54 @@ class phpbb_functions_validate_email_test extends phpbb_database_test_case
$user->optionset('banned_users', array('banned@example.com'));
}
- public function test_validate_email()
+ public static function validate_email_data()
+ {
+ return array(
+ array('empty', array('EMAIL_INVALID'), ''), // email does not allow empty
+ array('allowed', array(), 'foobar@example.com'),
+ array('valid_complex', array(), "'%$~test@example.com"),
+ array('invalid', array('EMAIL_INVALID'), 'fööbar@example.com'),
+ array('taken', array(), 'admin@example.com'), // email does not check taken, should use user_email instead
+ array('banned', array(), 'banned@example.com'), // email does not check ban, should use user_email instead
+ );
+ }
+
+ /**
+ * @dataProvider validate_email_data
+ */
+ public function test_validate_email($case, $errors, $email)
{
$this->set_validation_prerequisites(false);
$this->helper->assert_valid_data(array(
- 'empty' => array(
- array(),
- '',
- array('email'),
- ),
- 'allowed' => array(
- array(),
- 'foobar@example.com',
- array('email', 'foobar@example.com'),
- ),
- 'invalid' => array(
- array('EMAIL_INVALID'),
- 'fööbar@example.com',
- array('email'),
- ),
- 'valid_complex' => array(
- array(),
- "'%$~test@example.com",
- array('email'),
- ),
- 'taken' => array(
- array('EMAIL_TAKEN'),
- 'admin@example.com',
- array('email'),
- ),
- 'banned' => array(
- array('EMAIL_BANNED'),
- 'banned@example.com',
+ $case => array(
+ $errors,
+ $email,
array('email'),
),
));
}
+ public static function validate_email_mx_data()
+ {
+ return array(
+ array('valid', array(), 'foobar@phpbb.com'),
+ array('no_mx', array('DOMAIN_NO_MX_RECORD'), 'test@does-not-exist.phpbb.com'),
+ );
+ }
+
/**
+ * @dataProvider validate_email_mx_data
* @group slow
*/
- public function test_validate_email_mx()
+ public function test_validate_email_mx($case, $errors, $email)
{
$this->set_validation_prerequisites(true);
$this->helper->assert_valid_data(array(
- 'valid' => array(
- array(),
- 'foobar@phpbb.com',
- array('email'),
- ),
- 'no_mx' => array(
- array('DOMAIN_NO_MX_RECORD'),
- 'test@does-not-exist.phpbb.com',
+ $case => array(
+ $errors,
+ $email,
array('email'),
),
));
diff --git a/tests/functions/validate_hex_colour_test.php b/tests/functions/validate_hex_colour_test.php
index 812ebe5eeb..b2c4862458 100644
--- a/tests/functions/validate_hex_colour_test.php
+++ b/tests/functions/validate_hex_colour_test.php
@@ -1,9 +1,13 @@
<?php
/**
*
-* @package testing
-* @copyright (c) 2013 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
diff --git a/tests/functions/validate_jabber_test.php b/tests/functions/validate_jabber_test.php
index 5a53c963bd..23811a94c0 100644
--- a/tests/functions/validate_jabber_test.php
+++ b/tests/functions/validate_jabber_test.php
@@ -1,9 +1,13 @@
<?php
/**
*
-* @package testing
-* @copyright (c) 2013 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
diff --git a/tests/functions/validate_lang_iso_test.php b/tests/functions/validate_lang_iso_test.php
index c8a5b71021..81b56055e6 100644
--- a/tests/functions/validate_lang_iso_test.php
+++ b/tests/functions/validate_lang_iso_test.php
@@ -1,9 +1,13 @@
<?php
/**
*
-* @package testing
-* @copyright (c) 2013 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
diff --git a/tests/functions/validate_match_test.php b/tests/functions/validate_match_test.php
index 73a363e003..811bed3e33 100644
--- a/tests/functions/validate_match_test.php
+++ b/tests/functions/validate_match_test.php
@@ -1,9 +1,13 @@
<?php
/**
*
-* @package testing
-* @copyright (c) 2013 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
diff --git a/tests/functions/validate_num_test.php b/tests/functions/validate_num_test.php
index 4deac02ebc..798468759c 100644
--- a/tests/functions/validate_num_test.php
+++ b/tests/functions/validate_num_test.php
@@ -1,9 +1,13 @@
<?php
/**
*
-* @package testing
-* @copyright (c) 2013 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
diff --git a/tests/functions/validate_password_test.php b/tests/functions/validate_password_test.php
index 4639f6cc89..c5942e79bf 100644
--- a/tests/functions/validate_password_test.php
+++ b/tests/functions/validate_password_test.php
@@ -1,12 +1,17 @@
<?php
/**
*
-* @package testing
-* @copyright (c) 2013 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
require_once dirname(__FILE__) . '/../../phpBB/includes/functions_user.php';
require_once dirname(__FILE__) . '/validate_data_helper.php';
diff --git a/tests/functions/validate_string_test.php b/tests/functions/validate_string_test.php
index ab44c28541..24026e4c9f 100644
--- a/tests/functions/validate_string_test.php
+++ b/tests/functions/validate_string_test.php
@@ -1,9 +1,13 @@
<?php
/**
*
-* @package testing
-* @copyright (c) 2013 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
diff --git a/tests/functions/validate_user_email_test.php b/tests/functions/validate_user_email_test.php
new file mode 100644
index 0000000000..951d5794e6
--- /dev/null
+++ b/tests/functions/validate_user_email_test.php
@@ -0,0 +1,106 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions_user.php';
+require_once dirname(__FILE__) . '/../mock/user.php';
+require_once dirname(__FILE__) . '/validate_data_helper.php';
+
+class phpbb_functions_validate_user_email_test extends phpbb_database_test_case
+{
+ protected $db;
+ protected $user;
+ protected $helper;
+
+ public function getDataSet()
+ {
+ return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/validate_email.xml');
+ }
+
+ protected function setUp()
+ {
+ parent::setUp();
+
+ $this->db = $this->new_dbal();
+ $this->user = new phpbb_mock_user;
+ $this->helper = new phpbb_functions_validate_data_helper($this);
+ }
+
+ /**
+ * Get validation prerequesites
+ *
+ * @param bool $check_mx Whether mx records should be checked
+ */
+ protected function set_validation_prerequisites($check_mx)
+ {
+ global $config, $db, $user;
+
+ $config['email_check_mx'] = $check_mx;
+ $db = $this->db;
+ $user = $this->user;
+ $user->optionset('banned_users', array('banned@example.com'));
+ }
+
+ public static function validate_user_email_data()
+ {
+ return array(
+ array('empty', array(), ''),
+ array('allowed', array(), 'foobar@example.com'),
+ array('valid_complex', array(), "'%$~test@example.com"),
+ array('invalid', array('EMAIL_INVALID'), 'fööbar@example.com'),
+ array('taken', array('EMAIL_TAKEN'), 'admin@example.com'),
+ array('banned', array('EMAIL_BANNED'), 'banned@example.com'),
+ );
+ }
+
+ /**
+ * @dataProvider validate_user_email_data
+ */
+ public function test_validate_user_email($case, $errors, $email)
+ {
+ $this->set_validation_prerequisites(false);
+
+ $this->helper->assert_valid_data(array(
+ $case => array(
+ $errors,
+ $email,
+ array('user_email'),
+ ),
+ ));
+ }
+
+ public static function validate_user_email_mx_data()
+ {
+ return array(
+ array('valid', array(), 'foobar@phpbb.com'),
+ array('no_mx', array('DOMAIN_NO_MX_RECORD'), 'test@does-not-exist.phpbb.com'),
+ );
+ }
+
+ /**
+ * @dataProvider validate_user_email_mx_data
+ * @group slow
+ */
+ public function test_validate_user_email_mx($case, $errors, $email)
+ {
+ $this->set_validation_prerequisites(true);
+
+ $this->helper->assert_valid_data(array(
+ $case => array(
+ $errors,
+ $email,
+ array('user_email'),
+ ),
+ ));
+ }
+}
diff --git a/tests/functions/validate_username_test.php b/tests/functions/validate_username_test.php
index 0819974e54..4fa5af7ff3 100644
--- a/tests/functions/validate_username_test.php
+++ b/tests/functions/validate_username_test.php
@@ -1,12 +1,17 @@
<?php
/**
*
-* @package testing
-* @copyright (c) 2013 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
require_once dirname(__FILE__) . '/../../phpBB/includes/functions_user.php';
require_once dirname(__FILE__) . '/../../phpBB/includes/utf/utf_tools.php';
require_once dirname(__FILE__) . '/../mock/cache.php';
diff --git a/tests/functions/validate_with_method_test.php b/tests/functions/validate_with_method_test.php
new file mode 100644
index 0000000000..37e05d412a
--- /dev/null
+++ b/tests/functions/validate_with_method_test.php
@@ -0,0 +1,43 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions_user.php';
+require_once dirname(__FILE__) . '/validate_data_helper.php';
+
+class phpbb_functions_validate_with_method_test extends phpbb_test_case
+{
+ protected $helper;
+
+ protected function setUp()
+ {
+ parent::setUp();
+
+ $this->helper = new phpbb_functions_validate_data_helper($this);
+ }
+
+ public function test_validate_date()
+ {
+ $this->helper->assert_valid_data(array(
+ 'method_call' => array(
+ array(),
+ true,
+ array(array(array($this, 'with_method'), false)),
+ ),
+ ));
+ }
+
+ public function validate_with_method($bool, $optional = false)
+ {
+ return ! $bool;
+ }
+}
diff --git a/tests/functions_acp/build_cfg_template_test.php b/tests/functions_acp/build_cfg_template_test.php
new file mode 100644
index 0000000000..2e3a8adac7
--- /dev/null
+++ b/tests/functions_acp/build_cfg_template_test.php
@@ -0,0 +1,291 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions_acp.php';
+
+class phpbb_functions_acp_build_cfg_template_test extends phpbb_test_case
+{
+ public function build_cfg_template_text_data()
+ {
+ return array(
+ array(
+ array('text', 20, 255),
+ 'key_name',
+ array('config_key_name' => '1'),
+ 'config_key_name',
+ array(),
+ '<input id="key_name" type="text" size="20" maxlength="255" name="config[config_key_name]" value="1" />',
+ ),
+ array(
+ array('password', 20, 128),
+ 'key_name',
+ array('config_key_name' => '2'),
+ 'config_key_name',
+ array(),
+ '<input id="key_name" type="password" size="20" maxlength="128" name="config[config_key_name]" value="********" autocomplete="off" />',
+ ),
+ array(
+ array('text', 0, 255),
+ 'key_name',
+ array('config_key_name' => '3'),
+ 'config_key_name',
+ array(),
+ '<input id="key_name" type="text" maxlength="255" name="config[config_key_name]" value="3" />',
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider build_cfg_template_text_data
+ */
+ public function test_build_cfg_template_text($tpl_type, $key, $new, $config_key, $vars, $expected)
+ {
+ global $user, $phpbb_dispatcher;
+
+ $phpbb_dispatcher = new phpbb_mock_event_dispatcher();
+ $user = new phpbb_mock_user();
+ $user->lang = new phpbb_mock_lang();
+
+ $this->assertEquals($expected, build_cfg_template($tpl_type, $key, $new, $config_key, $vars));
+ }
+
+ public function build_cfg_template_dimension_data()
+ {
+ return array(
+ array(
+ array('dimension', 5, 15),
+ 'number_key_name',
+ array('config_key_name_width' => 10, 'config_key_name_height' => 20),
+ 'config_key_name',
+ array(),
+ '<input id="number_key_name" type="number" min="5" max="15" name="config[config_key_name_width]" value="10" /> x <input type="number" min="5" max="15" name="config[config_key_name_height]" value="20" />',
+ ),
+ array(
+ array('dimension', 0, 15),
+ 'number_key_name',
+ array('config_key_name_width' => 10, 'config_key_name_height' => 20),
+ 'config_key_name',
+ array(),
+ '<input id="number_key_name" type="number" min="0" max="15" name="config[config_key_name_width]" value="10" /> x <input type="number" min="0" max="15" name="config[config_key_name_height]" value="20" />',
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider build_cfg_template_dimension_data
+ */
+ public function test_build_cfg_template_dimension($tpl_type, $key, $new, $config_key, $vars, $expected)
+ {
+ global $user, $phpbb_dispatcher;
+
+ $phpbb_dispatcher = new phpbb_mock_event_dispatcher();
+ $user = new phpbb_mock_user();
+ $user->lang = new phpbb_mock_lang();
+
+ $this->assertEquals($expected, build_cfg_template($tpl_type, $key, $new, $config_key, $vars));
+ }
+
+ public function build_cfg_template_number_data()
+ {
+ return array(
+ array(
+ array('number', 5, 15),
+ 'number_key_name',
+ array('config_key_name' => 10),
+ 'config_key_name',
+ array(),
+ '<input id="number_key_name" type="number" min="5" max="15" name="config[config_key_name]" value="10" />',
+ ),
+ array(
+ array('number', -1, 9999),
+ 'number_key_name',
+ array('config_key_name' => 10),
+ 'config_key_name',
+ array(),
+ '<input id="number_key_name" type="number" min="-1" max="9999" name="config[config_key_name]" value="10" />',
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider build_cfg_template_number_data
+ */
+ public function test_build_cfg_template_number($tpl_type, $key, $new, $config_key, $vars, $expected)
+ {
+ global $user, $phpbb_dispatcher;
+
+ $phpbb_dispatcher = new phpbb_mock_event_dispatcher();
+ $user = new phpbb_mock_user();
+ $user->lang = new phpbb_mock_lang();
+
+ $this->assertEquals($expected, build_cfg_template($tpl_type, $key, $new, $config_key, $vars));
+ }
+
+ public function build_cfg_template_textarea_data()
+ {
+ return array(
+ array(
+ array('textarea', 5, 30),
+ 'key_name',
+ array('config_key_name' => 'phpBB'),
+ 'config_key_name',
+ array(),
+ '<textarea id="key_name" name="config[config_key_name]" rows="5" cols="30">phpBB</textarea>',
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider build_cfg_template_textarea_data
+ */
+ public function test_build_cfg_template_textarea($tpl_type, $key, $new, $config_key, $vars, $expected)
+ {
+ global $user, $phpbb_dispatcher;
+
+ $phpbb_dispatcher = new phpbb_mock_event_dispatcher();
+ $user = new phpbb_mock_user();
+ $user->lang = new phpbb_mock_lang();
+
+ $this->assertEquals($expected, build_cfg_template($tpl_type, $key, $new, $config_key, $vars));
+ }
+
+ public function build_cfg_template_radio_data()
+ {
+ return array(
+ array(
+ array('radio', 'enabled_disabled'),
+ 'key_name',
+ array('config_key_name' => '0'),
+ 'config_key_name',
+ array(),
+ '<label><input type="radio" id="key_name" name="config[config_key_name]" value="1" class="radio" /> ENABLED</label><label><input type="radio" name="config[config_key_name]" value="0" checked="checked" class="radio" /> DISABLED</label>',
+ ),
+ array(
+ array('radio', 'enabled_disabled'),
+ 'key_name',
+ array('config_key_name' => '1'),
+ 'config_key_name',
+ array(),
+ '<label><input type="radio" id="key_name" name="config[config_key_name]" value="1" checked="checked" class="radio" /> ENABLED</label><label><input type="radio" name="config[config_key_name]" value="0" class="radio" /> DISABLED</label>',
+ ),
+ array(
+ array('radio', 'yes_no'),
+ 'key_name',
+ array('config_key_name' => '0'),
+ 'config_key_name',
+ array(),
+ '<label><input type="radio" id="key_name" name="config[config_key_name]" value="1" class="radio" /> YES</label><label><input type="radio" name="config[config_key_name]" value="0" checked="checked" class="radio" /> NO</label>',
+ ),
+ array(
+ array('radio', 'yes_no'),
+ 'key_name',
+ array('config_key_name' => '1'),
+ 'config_key_name',
+ array(),
+ '<label><input type="radio" id="key_name" name="config[config_key_name]" value="1" checked="checked" class="radio" /> YES</label><label><input type="radio" name="config[config_key_name]" value="0" class="radio" /> NO</label>',
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider build_cfg_template_radio_data
+ */
+ public function test_build_cfg_template_radio($tpl_type, $key, $new, $config_key, $vars, $expected)
+ {
+ global $user, $phpbb_dispatcher;
+
+ $phpbb_dispatcher = new phpbb_mock_event_dispatcher();
+ $user = new phpbb_mock_user();
+ $user->lang = new phpbb_mock_lang();
+
+ $this->assertEquals($expected, build_cfg_template($tpl_type, $key, $new, $config_key, $vars));
+ }
+
+ public function build_cfg_template_append_data()
+ {
+ return array(
+ array(
+ array('textarea', 5, 30),
+ 'key_name',
+ array('config_key_name' => 'phpBB'),
+ 'config_key_name',
+ array('append' => 'Bertie is cool!'),
+ '<textarea id="key_name" name="config[config_key_name]" rows="5" cols="30">phpBB</textarea>Bertie is cool!',
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider build_cfg_template_append_data
+ */
+ public function test_build_cfg_template_append($tpl_type, $key, $new, $config_key, $vars, $expected)
+ {
+ global $user, $phpbb_dispatcher;
+
+ $phpbb_dispatcher = new phpbb_mock_event_dispatcher();
+ $user = new phpbb_mock_user();
+ $user->lang = new phpbb_mock_lang();
+
+ $this->assertEquals($expected, build_cfg_template($tpl_type, $key, $new, $config_key, $vars));
+ }
+
+ public function build_cfg_template_select_data()
+ {
+ return array(
+ array(
+ array('select'),
+ 'key_name',
+ array('config_key_name' => '0'),
+ 'config_key_name',
+ array('method' => 'select_helper'),
+ '<select id="key_name" name="config[config_key_name]"><option value="1">First_Option</option><option value="2" selected="selected">Second_Option</option><option value="3">Third_Option</option></select>',
+ ),
+ array(
+ array('select', 8),
+ 'key_name',
+ array('config_key_name' => '1'),
+ 'config_key_name',
+ array('method' => 'select_helper'),
+ '<select id="key_name" name="config[config_key_name]" size="8"><option value="1">First_Option</option><option value="2" selected="selected">Second_Option</option><option value="3">Third_Option</option></select>',
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider build_cfg_template_select_data
+ */
+ public function test_build_cfg_template_select($tpl_type, $key, $new, $config_key, $vars, $expected)
+ {
+ global $module, $user, $phpbb_dispatcher;
+
+ $phpbb_dispatcher = new phpbb_mock_event_dispatcher();
+ $user = new phpbb_mock_user();
+ $user->lang = new phpbb_mock_lang();
+ $user->module = $this;
+ $module = $user;
+
+ $this->assertEquals($expected, build_cfg_template($tpl_type, $key, $new, $config_key, $vars));
+ }
+
+ public function select_helper()
+ {
+ return build_select(
+ array(
+ '1' => 'First_Option',
+ '2' => 'Second_Option',
+ '3' => 'Third_Option',
+ ),
+ '2'
+ );
+ }
+}
diff --git a/tests/functions_acp/build_select_test.php b/tests/functions_acp/build_select_test.php
new file mode 100644
index 0000000000..ebdc58fd64
--- /dev/null
+++ b/tests/functions_acp/build_select_test.php
@@ -0,0 +1,65 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions_acp.php';
+
+class phpbb_functions_acp_built_select_test extends phpbb_test_case
+{
+ protected function setUp()
+ {
+ parent::setUp();
+
+ global $user;
+
+ $user = new phpbb_mock_user();
+ $user->lang = new phpbb_mock_lang();
+ }
+
+ public function build_select_data()
+ {
+ return array(
+ array(
+ array(
+ 'test' => 'TEST',
+ 'second' => 'SEC_OPTION',
+ ),
+ false,
+ '<option value="test">TEST</option><option value="second">SEC_OPTION</option>',
+ ),
+ array(
+ array(
+ 'test' => 'TEST',
+ 'second' => 'SEC_OPTION',
+ ),
+ 'test',
+ '<option value="test" selected="selected">TEST</option><option value="second">SEC_OPTION</option>',
+ ),
+ array(
+ array(
+ 'test' => 'TEST',
+ 'second' => 'SEC_OPTION',
+ ),
+ 'second',
+ '<option value="test">TEST</option><option value="second" selected="selected">SEC_OPTION</option>',
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider build_select_data
+ */
+ public function test_build_select($option_ary, $option_default, $expected)
+ {
+ $this->assertEquals($expected, build_select($option_ary, $option_default));
+ }
+}
diff --git a/tests/functions_acp/h_radio_test.php b/tests/functions_acp/h_radio_test.php
new file mode 100644
index 0000000000..5ae4e91ea2
--- /dev/null
+++ b/tests/functions_acp/h_radio_test.php
@@ -0,0 +1,130 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions_acp.php';
+
+class phpbb_functions_acp_h_radio_test extends phpbb_test_case
+{
+ protected function setUp()
+ {
+ parent::setUp();
+
+ global $user;
+
+ $user = new phpbb_mock_user();
+ $user->lang = new phpbb_mock_lang();
+ }
+
+ public function h_radio_data()
+ {
+ return array(
+ array(
+ 'test_name',
+ array(
+ 'test' => 'TEST',
+ 'second' => 'SEC_OPTION',
+ ),
+ false,
+ false,
+ false,
+ '<label><input type="radio" name="test_name" value="test" class="radio" /> TEST</label><label><input type="radio" name="test_name" value="second" class="radio" /> SEC_OPTION</label>',
+ ),
+ array(
+ 'test_name',
+ array(
+ 'test' => 'TEST',
+ 'second' => 'SEC_OPTION',
+ ),
+ 'test',
+ false,
+ false,
+ '<label><input type="radio" name="test_name" value="test" checked="checked" class="radio" /> TEST</label><label><input type="radio" name="test_name" value="second" class="radio" /> SEC_OPTION</label>',
+ ),
+ array(
+ 'test_name',
+ array(
+ 'test' => 'TEST',
+ 'second' => 'SEC_OPTION',
+ ),
+ false,
+ 'test_id',
+ false,
+ '<label><input type="radio" name="test_name" id="test_id" value="test" class="radio" /> TEST</label><label><input type="radio" name="test_name" value="second" class="radio" /> SEC_OPTION</label>',
+ ),
+ array(
+ 'test_name',
+ array(
+ 'test' => 'TEST',
+ 'second' => 'SEC_OPTION',
+ ),
+ 'test',
+ 'test_id',
+ false,
+ '<label><input type="radio" name="test_name" id="test_id" value="test" checked="checked" class="radio" /> TEST</label><label><input type="radio" name="test_name" value="second" class="radio" /> SEC_OPTION</label>',
+ ),
+
+ array(
+ 'test_name',
+ array(
+ 'test' => 'TEST',
+ 'second' => 'SEC_OPTION',
+ ),
+ false,
+ false,
+ 'k',
+ '<label><input type="radio" name="test_name" value="test" accesskey="k" class="radio" /> TEST</label><label><input type="radio" name="test_name" value="second" accesskey="k" class="radio" /> SEC_OPTION</label>',
+ ),
+ array(
+ 'test_name',
+ array(
+ 'test' => 'TEST',
+ 'second' => 'SEC_OPTION',
+ ),
+ 'test',
+ false,
+ 'k',
+ '<label><input type="radio" name="test_name" value="test" checked="checked" accesskey="k" class="radio" /> TEST</label><label><input type="radio" name="test_name" value="second" accesskey="k" class="radio" /> SEC_OPTION</label>',
+ ),
+ array(
+ 'test_name',
+ array(
+ 'test' => 'TEST',
+ 'second' => 'SEC_OPTION',
+ ),
+ false,
+ 'test_id',
+ 'k',
+ '<label><input type="radio" name="test_name" id="test_id" value="test" accesskey="k" class="radio" /> TEST</label><label><input type="radio" name="test_name" value="second" accesskey="k" class="radio" /> SEC_OPTION</label>',
+ ),
+ array(
+ 'test_name',
+ array(
+ 'test' => 'TEST',
+ 'second' => 'SEC_OPTION',
+ ),
+ 'test',
+ 'test_id',
+ 'k',
+ '<label><input type="radio" name="test_name" id="test_id" value="test" checked="checked" accesskey="k" class="radio" /> TEST</label><label><input type="radio" name="test_name" value="second" accesskey="k" class="radio" /> SEC_OPTION</label>',
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider h_radio_data
+ */
+ public function test_h_radio($name, $input_ary, $input_default, $id, $key, $expected)
+ {
+ $this->assertEquals($expected, h_radio($name, $input_ary, $input_default, $id, $key));
+ }
+}
diff --git a/tests/functions_acp/insert_config_array_test.php b/tests/functions_acp/insert_config_array_test.php
new file mode 100644
index 0000000000..1264b35bf4
--- /dev/null
+++ b/tests/functions_acp/insert_config_array_test.php
@@ -0,0 +1,144 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions_acp.php';
+
+class phpbb_functions_insert_config_array_test extends phpbb_test_case
+{
+ public function config_display_vars()
+ {
+ return array(
+ 'legend1' => '',
+ 'acp_config_1' => array(),
+ 'acp_config_2' => array(),
+ 'acp_config_3' => array(),
+ 'acp_config_4' => array(),
+ 'acp_config_5' => array(),
+ );
+ }
+
+ public function insert_config_array_data()
+ {
+ return array(
+ array( // Add a new config after 1st array item
+ array('new_config_1' => array()),
+ array('after' => 'legend1'),
+ array(
+ 'legend1' => '',
+ 'new_config_1' => array(),
+ 'acp_config_1' => array(),
+ 'acp_config_2' => array(),
+ 'acp_config_3' => array(),
+ 'acp_config_4' => array(),
+ 'acp_config_5' => array(),
+ ),
+ ),
+ array( // Add a new config after last array item
+ array('new_config_1' => array()),
+ array('after' => 'acp_config_5'),
+ array(
+ 'legend1' => '',
+ 'acp_config_1' => array(),
+ 'acp_config_2' => array(),
+ 'acp_config_3' => array(),
+ 'acp_config_4' => array(),
+ 'acp_config_5' => array(),
+ 'new_config_1' => array(),
+ ),
+ ),
+ array( // Add a new config before 2nd array item
+ array('new_config_1' => array()),
+ array('before' => 'acp_config_1'),
+ array(
+ 'legend1' => '',
+ 'new_config_1' => array(),
+ 'acp_config_1' => array(),
+ 'acp_config_2' => array(),
+ 'acp_config_3' => array(),
+ 'acp_config_4' => array(),
+ 'acp_config_5' => array(),
+ ),
+ ),
+ array( // Add a new config before last config item
+ array('new_config_1' => array()),
+ array('before' => 'acp_config_5'),
+ array(
+ 'legend1' => '',
+ 'acp_config_1' => array(),
+ 'acp_config_2' => array(),
+ 'acp_config_3' => array(),
+ 'acp_config_4' => array(),
+ 'new_config_1' => array(),
+ 'acp_config_5' => array(),
+ ),
+ ),
+ array( // When an array key does not exist
+ array('new_config_1' => array()),
+ array('after' => 'foobar'),
+ array(
+ 'legend1' => '',
+ 'acp_config_1' => array(),
+ 'acp_config_2' => array(),
+ 'acp_config_3' => array(),
+ 'acp_config_4' => array(),
+ 'acp_config_5' => array(),
+ ),
+ ),
+ array( // When after|before is not used correctly (defaults to after)
+ array('new_config_1' => array()),
+ array('foobar' => 'acp_config_1'),
+ array(
+ 'legend1' => '',
+ 'acp_config_1' => array(),
+ 'new_config_1' => array(),
+ 'acp_config_2' => array(),
+ 'acp_config_3' => array(),
+ 'acp_config_4' => array(),
+ 'acp_config_5' => array(),
+ ),
+ ),
+ array( // Add a new config set after the last array item
+ array(
+ 'legend2' => array(),
+ 'new_config_1' => array(),
+ 'new_config_2' => array(),
+ 'new_config_3' => array(),
+ ),
+ array('after' => 'acp_config_5'),
+ array(
+ 'legend1' => '',
+ 'acp_config_1' => array(),
+ 'acp_config_2' => array(),
+ 'acp_config_3' => array(),
+ 'acp_config_4' => array(),
+ 'acp_config_5' => array(),
+ 'legend2' => array(),
+ 'new_config_1' => array(),
+ 'new_config_2' => array(),
+ 'new_config_3' => array(),
+ ),
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider insert_config_array_data
+ */
+ public function test_insert_config_array($new_config, $position, $expected)
+ {
+ $config_array = $this->config_display_vars();
+ $new_config_array = phpbb_insert_config_array($config_array, $new_config, $position);
+
+ $this->assertSame($expected, $new_config_array);
+ }
+}
diff --git a/tests/functions_acp/validate_config_vars_test.php b/tests/functions_acp/validate_config_vars_test.php
new file mode 100644
index 0000000000..32738e4351
--- /dev/null
+++ b/tests/functions_acp/validate_config_vars_test.php
@@ -0,0 +1,261 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions_acp.php';
+require_once dirname(__FILE__) . '/../../phpBB/includes/utf/utf_tools.php';
+
+class phpbb_functions_acp_validate_config_vars_test extends phpbb_test_case
+{
+ protected function setUp()
+ {
+ parent::setUp();
+
+ global $user;
+
+ $user = new phpbb_mock_user();
+ $user->lang = new phpbb_mock_lang();
+ }
+
+ /**
+ * Data sets that don't throw an error.
+ */
+ public function validate_config_vars_fit_data()
+ {
+ return array(
+ array(
+ array(
+ 'test_bool' => array('lang' => 'TEST_BOOL', 'validate' => 'bool'),
+ 'test_string' => array('lang' => 'TEST_STRING', 'validate' => 'string'),
+ 'test_string' => array('lang' => 'TEST_STRING', 'validate' => 'string'),
+ 'test_string_128' => array('lang' => 'TEST_STRING_128', 'validate' => 'string:128'),
+ 'test_string_128' => array('lang' => 'TEST_STRING_128', 'validate' => 'string:128'),
+ 'test_string_32_64' => array('lang' => 'TEST_STRING_32_64', 'validate' => 'string:32:64'),
+ 'test_string_32_64' => array('lang' => 'TEST_STRING_32_64', 'validate' => 'string:32:64'),
+ 'test_int' => array('lang' => 'TEST_INT', 'validate' => 'int'),
+ 'test_int_32' => array('lang' => 'TEST_INT', 'validate' => 'int:32'),
+ 'test_int_32_64' => array('lang' => 'TEST_INT', 'validate' => 'int:32:64'),
+ 'test_lang' => array('lang' => 'TEST_LANG', 'validate' => 'lang'),
+ /*
+ 'test_sp' => array('lang' => 'TEST_SP', 'validate' => 'script_path'),
+ 'test_rpath' => array('lang' => 'TEST_RPATH', 'validate' => 'rpath'),
+ 'test_rwpath' => array('lang' => 'TEST_RWPATH', 'validate' => 'rwpath'),
+ 'test_path' => array('lang' => 'TEST_PATH', 'validate' => 'path'),
+ 'test_wpath' => array('lang' => 'TEST_WPATH', 'validate' => 'wpath'),
+ */
+ ),
+ array(
+ 'test_bool' => true,
+ 'test_string' => str_repeat('a', 255),
+ 'test_string' => str_repeat("\xC3\x84", 255),
+ 'test_string_128' => str_repeat('a', 128),
+ 'test_string_128' => str_repeat("\xC3\x84", 128),
+ 'test_string_32_64' => str_repeat('a', 48),
+ 'test_string_32_64' => str_repeat("\xC3\x84", 48),
+ 'test_int' => 128,
+ 'test_int_32' => 32,
+ 'test_int_32_64' => 48,
+ 'test_lang' => 'en',
+ ),
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider validate_config_vars_fit_data
+ */
+ public function test_validate_config_vars_fit($test_data, $cfg_array)
+ {
+ $phpbb_error = array();
+ validate_config_vars($test_data, $cfg_array, $phpbb_error);
+
+ $this->assertEquals(array(), $phpbb_error);
+ }
+
+ /**
+ * Data sets that throw the error.
+ */
+ public function validate_config_vars_error_data()
+ {
+ return array(
+ array(
+ array('test_string_32_64' => array('lang' => 'TEST_STRING_32_64', 'validate' => 'string:32:64')),
+ array('test_string_32_64' => str_repeat('a', 20)),
+ array('SETTING_TOO_SHORT'),
+ ),
+ array(
+ array('test_string_32_64' => array('lang' => 'TEST_STRING_32_64', 'validate' => 'string:32:64')),
+ array('test_string_32_64' => str_repeat("\xC3\x84", 20)),
+ array('SETTING_TOO_SHORT'),
+ ),
+ array(
+ array('test_string' => array('lang' => 'TEST_STRING', 'validate' => 'string')),
+ array('test_string' => str_repeat('a', 256)),
+ array('SETTING_TOO_LONG'),
+ ),
+ array(
+ array('test_string' => array('lang' => 'TEST_STRING', 'validate' => 'string')),
+ array('test_string' => str_repeat("\xC3\x84", 256)),
+ array('SETTING_TOO_LONG'),
+ ),
+ array(
+ array('test_string_32_64' => array('lang' => 'TEST_STRING_32_64', 'validate' => 'string:32:64')),
+ array('test_string_32_64' => str_repeat('a', 65)),
+ array('SETTING_TOO_LONG'),
+ ),
+ array(
+ array('test_string_32_64' => array('lang' => 'TEST_STRING_32_64', 'validate' => 'string:32:64')),
+ array('test_string_32_64' => str_repeat("\xC3\x84", 65)),
+ array('SETTING_TOO_LONG'),
+ ),
+
+ array(
+ array('test_int_32' => array('lang' => 'TEST_INT', 'validate' => 'int:32')),
+ array('test_int_32' => 31),
+ array('SETTING_TOO_LOW'),
+ ),
+ array(
+ array('test_int_32_64' => array('lang' => 'TEST_INT', 'validate' => 'int:32:64')),
+ array('test_int_32_64' => 31),
+ array('SETTING_TOO_LOW'),
+ ),
+ array(
+ array('test_int_32_64' => array('lang' => 'TEST_INT', 'validate' => 'int:32:64')),
+ array('test_int_32_64' => 65),
+ array('SETTING_TOO_BIG'),
+ ),
+ array(
+ array(
+ 'test_int_min' => array('lang' => 'TEST_INT_MIN', 'validate' => 'int:32:64'),
+ 'test_int_max' => array('lang' => 'TEST_INT_MAX', 'validate' => 'int:32:64'),
+ ),
+ array(
+ 'test_int_min' => 52,
+ 'test_int_max' => 48,
+ ),
+ array('SETTING_TOO_LOW'),
+ ),
+ array(
+ array('test_lang' => array('lang' => 'TEST_LANG', 'validate' => 'lang')),
+ array('test_lang' => 'this_is_no_language'),
+ array('WRONG_DATA_LANG'),
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider validate_config_vars_error_data
+ */
+ public function test_validate_config_vars_error($test_data, $cfg_array, $expected)
+ {
+ $phpbb_error = array();
+ validate_config_vars($test_data, $cfg_array, $phpbb_error);
+
+ $this->assertEquals($expected, $phpbb_error);
+ }
+
+ public function data_validate_path_linux()
+ {
+ return array(
+ array('/usr/bin', 'absolute_path', true),
+ array('/usr/bin/', 'absolute_path:50:200', true),
+ array('/usr/bin/which', 'absolute_path', 'DIRECTORY_NOT_DIR'),
+ array('/foo/bar', 'absolute_path', 'DIRECTORY_DOES_NOT_EXIST'),
+ array('C:\Windows', 'absolute_path', 'DIRECTORY_DOES_NOT_EXIST'),
+ array('.', 'absolute_path', true),
+ array('', 'absolute_path', true),
+ array('mkdir /foo/bar', 'absolute_path', 'DIRECTORY_DOES_NOT_EXIST'),
+ // Make sure above command didn't do anything
+ array('/foo/bar', 'absolute_path', 'DIRECTORY_DOES_NOT_EXIST'),
+ );
+ }
+
+ /**
+ * @dataProvider data_validate_path_linux
+ */
+ public function test_validate_path_linux($path, $validation_type, $expected)
+ {
+ if (strtolower(substr(PHP_OS, 0, 5)) !== 'linux')
+ {
+ $this->markTestSkipped('Unable to test linux specific paths on other OS.');
+ }
+
+ $error = array();
+ $config_ary = array(
+ 'path' => $path,
+ );
+
+ validate_config_vars(array(
+ 'path' => array('lang' => 'FOOBAR', 'validate' => $validation_type),
+ ),
+ $config_ary,
+ $error
+ );
+
+ if ($expected === true)
+ {
+ $this->assertEmpty($error);
+ }
+ else
+ {
+ $this->assertEquals(array($expected), $error);
+ }
+ }
+
+ public function data_validate_path_windows()
+ {
+ return array(
+ array('C:\Windows', 'absolute_path', true),
+ array('C:\Windows\\', 'absolute_path:50:200', true),
+ array('C:\Windows\explorer.exe', 'absolute_path', 'DIRECTORY_NOT_DIR'),
+ array('C:\foobar', 'absolute_path', 'DIRECTORY_DOES_NOT_EXIST'),
+ array('/usr/bin', 'absolute_path', 'DIRECTORY_DOES_NOT_EXIST'),
+ array('.', 'absolute_path', true),
+ array('', 'absolute_path', true),
+ array('mkdir C:\Windows\foobar', 'absolute_path', 'DIRECTORY_DOES_NOT_EXIST'),
+ // Make sure above command didn't do anything
+ array('C:\Windows\foobar', 'absolute_path', 'DIRECTORY_DOES_NOT_EXIST'),
+ );
+ }
+
+ /**
+ * @dataProvider data_validate_path_windows
+ */
+ public function test_validate_path_windows($path, $validation_type, $expected)
+ {
+ if (strtolower(substr(PHP_OS, 0, 3)) !== 'win')
+ {
+ $this->markTestSkipped('Unable to test windows specific paths on other OS.');
+ }
+
+ $error = array();
+ $config_ary = array(
+ 'path' => $path,
+ );
+
+ validate_config_vars(array(
+ 'path' => array('lang' => 'FOOBAR', 'validate' => $validation_type),
+ ),
+ $config_ary,
+ $error
+ );
+
+ if ($expected === true)
+ {
+ $this->assertEmpty($error);
+ }
+ else
+ {
+ $this->assertEquals(array($expected), $error);
+ }
+ }
+}
diff --git a/tests/functions_acp/validate_range_test.php b/tests/functions_acp/validate_range_test.php
new file mode 100644
index 0000000000..6408e29a26
--- /dev/null
+++ b/tests/functions_acp/validate_range_test.php
@@ -0,0 +1,168 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+require_once dirname(__FILE__) . '/../../phpBB/includes/utf/utf_tools.php';
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions_acp.php';
+
+class phpbb_functions_acp_validate_range_test extends phpbb_test_case
+{
+ protected function setUp()
+ {
+ parent::setUp();
+
+ global $user;
+
+ $user = new phpbb_mock_user();
+ $user->lang = new phpbb_mock_lang();
+ }
+
+ /**
+ * Data sets that don't throw an error.
+ */
+ public function validate_range_data_fit()
+ {
+ return array(
+ array(array(array('column_type' => 'BOOL', 'lang' => 'TEST', 'value' => 0))),
+ array(array(array('column_type' => 'BOOL', 'lang' => 'TEST', 'value' => 1))),
+
+ array(array(array('column_type' => 'USINT', 'lang' => 'TEST', 'value' => 0))),
+ array(array(array('column_type' => 'USINT', 'lang' => 'TEST', 'value' => 65535))),
+ array(array(array('column_type' => 'USINT:32:128', 'lang' => 'TEST', 'value' => 35))),
+
+ array(array(array('column_type' => 'UINT', 'lang' => 'TEST', 'value' => 0))),
+ array(array(array('column_type' => 'UINT', 'lang' => 'TEST', 'value' => (int) 0x7fffffff))),
+ array(array(array('column_type' => 'UINT:32:128', 'lang' => 'TEST', 'value' => 35))),
+
+ array(array(array('column_type' => 'INT', 'lang' => 'TEST', 'value' => (int) -2147483648))),
+ array(array(array('column_type' => 'INT', 'lang' => 'TEST', 'value' => (int) 0x7fffffff))),
+ array(array(array('column_type' => 'INT:-32:128', 'lang' => 'TEST', 'value' => -28))),
+ array(array(array('column_type' => 'INT:-32:128', 'lang' => 'TEST', 'value' => 35))),
+
+ array(array(array('column_type' => 'TINT', 'lang' => 'TEST', 'value' => -128))),
+ array(array(array('column_type' => 'TINT', 'lang' => 'TEST', 'value' => 127))),
+ array(array(array('column_type' => 'TINT:-32:64', 'lang' => 'TEST', 'value' => -16))),
+ array(array(array('column_type' => 'TINT:-32:64', 'lang' => 'TEST', 'value' => 16))),
+
+ array(array(array('column_type' => 'VCHAR', 'lang' => 'TEST', 'value' => ''))),
+ array(array(array('column_type' => 'VCHAR', 'lang' => 'TEST', 'value' => str_repeat('a', 255)))),
+ array(array(array('column_type' => 'VCHAR', 'lang' => 'TEST', 'value' => str_repeat("\xC3\x84", 255)))),
+ array(array(array('column_type' => 'VCHAR:128', 'lang' => 'TEST', 'value' => str_repeat('a', 128)))),
+ array(array(array('column_type' => 'VCHAR:128', 'lang' => 'TEST', 'value' => str_repeat("\xC3\x84", 128)))),
+ );
+ }
+
+ /**
+ * @dataProvider validate_range_data_fit
+ */
+ public function test_validate_range_fit($test_data)
+ {
+ $phpbb_error = array();
+ validate_range($test_data, $phpbb_error);
+
+ $this->assertEquals(array(), $phpbb_error);
+ }
+
+ /**
+ * Data sets that throw the SETTING_TOO_LOW-error.
+ */
+ public function validate_range_data_too_low()
+ {
+ return array(
+ array(array(array('column_type' => 'BOOL', 'lang' => 'TEST', 'value' => -1))),
+
+ array(array(array('column_type' => 'USINT', 'lang' => 'TEST', 'value' => -1))),
+ array(array(array('column_type' => 'USINT:32:128', 'lang' => 'TEST', 'value' => 31))),
+
+ array(array(array('column_type' => 'UINT', 'lang' => 'TEST', 'value' => -1))),
+ array(array(array('column_type' => 'UINT:32:128', 'lang' => 'TEST', 'value' => 31))),
+
+ array(array(array('column_type' => 'INT', 'lang' => 'TEST', 'value' => ((int) -2147483648) - 1))),
+ array(array(array('column_type' => 'INT:32:128', 'lang' => 'TEST', 'value' => 31))),
+ array(array(array('column_type' => 'INT:-32:128', 'lang' => 'TEST', 'value' => -33))),
+
+ array(array(array('column_type' => 'TINT', 'lang' => 'TEST', 'value' => -129))),
+ array(array(array('column_type' => 'TINT:32:64', 'lang' => 'TEST', 'value' => 31))),
+ array(array(array('column_type' => 'TINT:-32:64', 'lang' => 'TEST', 'value' => -33))),
+ );
+ }
+
+ /**
+ * @dataProvider validate_range_data_too_low
+ */
+ public function test_validate_range_too_low($test_data)
+ {
+ $phpbb_error = array();
+ validate_range($test_data, $phpbb_error);
+
+ $this->assertEquals(array('SETTING_TOO_LOW'), $phpbb_error);
+ }
+
+ /**
+ * Data sets that throw the SETTING_TOO_BIG-error.
+ */
+ public function validate_range_data_too_big()
+ {
+ return array(
+ array(array(array('column_type' => 'BOOL', 'lang' => 'TEST', 'value' => 2))),
+
+ array(array(array('column_type' => 'USINT', 'lang' => 'TEST', 'value' => 65536))),
+ array(array(array('column_type' => 'USINT:32:128', 'lang' => 'TEST', 'value' => 129))),
+
+ array(array(array('column_type' => 'UINT', 'lang' => 'TEST', 'value' => ((int) 0x7fffffff) + 1))),
+ array(array(array('column_type' => 'UINT:32:128', 'lang' => 'TEST', 'value' => 129))),
+
+ array(array(array('column_type' => 'INT', 'lang' => 'TEST', 'value' => ((int) 0x7fffffff) + 1))),
+ array(array(array('column_type' => 'INT:-32:-16', 'lang' => 'TEST', 'value' => -15))),
+ array(array(array('column_type' => 'INT:-32:128', 'lang' => 'TEST', 'value' => 129))),
+
+ array(array(array('column_type' => 'TINT', 'lang' => 'TEST', 'value' => 128))),
+ array(array(array('column_type' => 'TINT:-32:-16', 'lang' => 'TEST', 'value' => -15))),
+ array(array(array('column_type' => 'TINT:-32:64', 'lang' => 'TEST', 'value' => 65))),
+ );
+ }
+
+ /**
+ * @dataProvider validate_range_data_too_big
+ */
+ public function test_validate_range_too_big($test_data)
+ {
+ $phpbb_error = array();
+ validate_range($test_data, $phpbb_error);
+
+ $this->assertEquals(array('SETTING_TOO_BIG'), $phpbb_error);
+ }
+
+ /**
+ * Data sets that throw the SETTING_TOO_LONG-error.
+ */
+ public function validate_range_data_too_long()
+ {
+ return array(
+ array(array(array('column_type' => 'VCHAR', 'lang' => 'TEST', 'value' => str_repeat('a', 256)))),
+ array(array(array('column_type' => 'VCHAR', 'lang' => 'TEST', 'value' => str_repeat("\xC3\x84", 256)))),
+ array(array(array('column_type' => 'VCHAR:128', 'lang' => 'TEST', 'value' => str_repeat('a', 129)))),
+ array(array(array('column_type' => 'VCHAR:128', 'lang' => 'TEST', 'value' => str_repeat("\xC3\x84", 129)))),
+ );
+ }
+
+ /**
+ * @dataProvider validate_range_data_too_long
+ */
+ public function test_validate_range_too_long($test_data)
+ {
+ $phpbb_error = array();
+ validate_range($test_data, $phpbb_error);
+
+ $this->assertEquals(array('SETTING_TOO_LONG'), $phpbb_error);
+ }
+}
diff --git a/tests/functions_content/get_username_string_test.php b/tests/functions_content/get_username_string_test.php
index 48e8936cc1..01ec97f6a4 100644
--- a/tests/functions_content/get_username_string_test.php
+++ b/tests/functions_content/get_username_string_test.php
@@ -1,9 +1,13 @@
<?php
/**
*
-* @package testing
-* @copyright (c) 2014 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -16,14 +20,15 @@ class phpbb_functions_content_get_username_string_test extends phpbb_test_case
{
parent::setUp();
- global $auth, $user;
- $auth = $this->getMock('auth');
+ global $auth, $phpbb_dispatcher, $user;
+ $auth = $this->getMock('\phpbb\auth\auth');
$auth->expects($this->any())
->method('acl_get')
->with($this->stringContains('_'), $this->anything())
->will($this->returnValueMap(array(
array('u_viewprofile', true),
)));
+ $phpbb_dispatcher = new phpbb_mock_event_dispatcher;
$user->data['user_id'] = ANONYMOUS;
$user->lang['GUEST'] = 'Guest';
}
@@ -89,11 +94,11 @@ class phpbb_functions_content_get_username_string_test extends phpbb_test_case
global $phpbb_root_path, $phpEx;
return array(
- array(0, '', '', false, false, 'Guest'),
- array(ANONYMOUS, 'Anonymous', '', false, false, 'Anonymous'),
+ array(0, '', '', false, false, '<span class="username">Guest</span>'),
+ array(ANONYMOUS, 'Anonymous', '', false, false, '<span class="username">Anonymous</span>'),
array(2, 'Administrator', 'FF0000', false, false, '<a href="' . $phpbb_root_path . 'memberlist.' . $phpEx . '?mode=viewprofile&amp;u=2" style="color: #FF0000;" class="username-coloured">Administrator</a>'),
- array(5, 'User5', '', false, 'http://www.example.org/user.php?mode=show', '<a href="http://www.example.org/user.php?mode=show&amp;u=5">User5</a>'),
- array(8, 'Eight', '', false, false, '<a href="' . $phpbb_root_path . 'memberlist.php?mode=viewprofile&amp;u=8">Eight</a>'),
+ array(5, 'User5', '', false, 'http://www.example.org/user.php?mode=show', '<a href="http://www.example.org/user.php?mode=show&amp;u=5" class="username">User5</a>'),
+ array(8, 'Eight', '', false, false, '<a href="' . $phpbb_root_path . 'memberlist.php?mode=viewprofile&amp;u=8" class="username">Eight</a>'),
);
}
@@ -108,10 +113,10 @@ class phpbb_functions_content_get_username_string_test extends phpbb_test_case
public function get_username_string_no_profile_data()
{
return array(
- array(ANONYMOUS, 'Anonymous', '', false, false, 'Anonymous'),
- array(ANONYMOUS, 'Anonymous', '', '', false, 'Guest'),
+ array(ANONYMOUS, 'Anonymous', '', false, false, '<span class="username">Anonymous</span>'),
+ array(ANONYMOUS, 'Anonymous', '', '', false, '<span class="username">Guest</span>'),
array(2, 'Administrator', 'FF0000', false, false, '<span style="color: #FF0000;" class="username-coloured">Administrator</span>'),
- array(8, 'Eight', '', false, false, 'Eight'),
+ array(8, 'Eight', '', false, false, '<span class="username">Eight</span>'),
);
}
diff --git a/tests/functions_content/phpbb_clean_search_string_test.php b/tests/functions_content/phpbb_clean_search_string_test.php
index de642c9040..abd107097c 100644
--- a/tests/functions_content/phpbb_clean_search_string_test.php
+++ b/tests/functions_content/phpbb_clean_search_string_test.php
@@ -1,9 +1,13 @@
<?php
/**
*
-* @package testing
-* @copyright (c) 2014 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
diff --git a/tests/functions_database_helper/update_rows_avoiding_duplicates_notify_status_test.php b/tests/functions_database_helper/update_rows_avoiding_duplicates_notify_status_test.php
index d4881daf7e..150b091ceb 100644
--- a/tests/functions_database_helper/update_rows_avoiding_duplicates_notify_status_test.php
+++ b/tests/functions_database_helper/update_rows_avoiding_duplicates_notify_status_test.php
@@ -1,9 +1,13 @@
<?php
/**
*
-* @package testing
-* @copyright (c) 2012 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
diff --git a/tests/functions_database_helper/update_rows_avoiding_duplicates_test.php b/tests/functions_database_helper/update_rows_avoiding_duplicates_test.php
index 2f01d29d15..0e27f129de 100644
--- a/tests/functions_database_helper/update_rows_avoiding_duplicates_test.php
+++ b/tests/functions_database_helper/update_rows_avoiding_duplicates_test.php
@@ -1,9 +1,13 @@
<?php
/**
*
-* @package testing
-* @copyright (c) 2012 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
diff --git a/tests/functions_install/ignore_new_file_on_update_test.php b/tests/functions_install/ignore_new_file_on_update_test.php
new file mode 100644
index 0000000000..822c5e6789
--- /dev/null
+++ b/tests/functions_install/ignore_new_file_on_update_test.php
@@ -0,0 +1,45 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions_install.php';
+
+class phpbb_functions_install_ignore_new_file_on_update_test extends phpbb_test_case
+{
+ static public function ignore_new_file_on_update_data()
+ {
+ return array(
+ array('willneverexist.php', false),
+ array('includes/dirwillneverexist/newfile.php', false),
+
+ array('language/en/email/short/bookmark.txt', false),
+ array('language/languagewillneverexist/email/short/bookmark.txt', true),
+
+ array('styles/prosilver/template/bbcode.html', false),
+ array('styles/stylewillneverexist/template/bbcode.html', true),
+
+ array('styles/prosilver/theme/en/icon_user_online.gif', false),
+ array('styles/prosilver/theme/languagewillneverexist/icon_user_online.gif', true),
+
+ array('styles/prosilver/theme/imageset.css', false),
+ );
+ }
+
+ /**
+ * @dataProvider ignore_new_file_on_update_data
+ */
+ public function test_ignore_new_file_on_update($file, $expected)
+ {
+ global $phpbb_root_path;
+ $this->assertEquals($expected, phpbb_ignore_new_file_on_update($phpbb_root_path, $file));
+ }
+}
diff --git a/tests/functions_user/delete_user_test.php b/tests/functions_user/delete_user_test.php
index 9a7805a819..7db69e332c 100644
--- a/tests/functions_user/delete_user_test.php
+++ b/tests/functions_user/delete_user_test.php
@@ -10,30 +10,44 @@
require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
require_once dirname(__FILE__) . '/../../phpBB/includes/functions_user.php';
require_once dirname(__FILE__) . '/../../phpBB/includes/utf/utf_tools.php';
-require_once dirname(__FILE__) . '/../mock/null_cache.php';
class phpbb_functions_user_delete_user_test extends phpbb_database_test_case
{
- /** @var \dbal */
+ /** @var \phpbb\db\driver\driver_interface */
protected $db;
public function getDataSet()
{
- return $this->createXMLDataSet(dirname(__FILE__).'/fixtures/delete_user.xml');
+ return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/delete_user.xml');
}
protected function setUp()
{
parent::setUp();
- global $cache, $config, $db;
+ global $cache, $config, $db, $phpbb_dispatcher, $phpbb_container;
$db = $this->db = $this->new_dbal();
- $config = array(
+ $config = new \phpbb\config\config(array(
'load_online_time' => 5,
- 'search_type' => 'fulltext_mysql',
- );
+ 'search_type' => '\phpbb\search\fulltext_mysql',
+ ));
+ set_config(false, false, false, $config);
+ set_config_count(false, false, false, $config);
$cache = new phpbb_mock_null_cache();
+ $phpbb_dispatcher = new phpbb_mock_event_dispatcher();
+ $phpbb_container = new phpbb_mock_container_builder();
+ $phpbb_container->set('notification_manager', new phpbb_mock_notification_manager());
+ $phpbb_container->set(
+ 'auth.provider.db',
+ new phpbb_mock_auth_provider()
+ );
+ $provider_collection = new \phpbb\auth\provider_collection($phpbb_container, $config);
+ $provider_collection->add('auth.provider.db');
+ $phpbb_container->set(
+ 'auth.provider_collection',
+ $provider_collection
+ );
}
public function first_last_post_data()
@@ -102,18 +116,18 @@ class phpbb_functions_user_delete_user_test extends phpbb_database_test_case
),
),
array(
- 'retain', 'Bertie',
+ 'retain', true,
array(
- array('post_id' => 1, 'poster_id' => ANONYMOUS, 'post_username' => 'Bertie'),
+ array('post_id' => 1, 'poster_id' => ANONYMOUS, 'post_username' => 'Foobar'),
array('post_id' => 2, 'poster_id' => ANONYMOUS, 'post_username' => 'Other'),
- array('post_id' => 3, 'poster_id' => ANONYMOUS, 'post_username' => 'Bertie'),
+ array('post_id' => 3, 'poster_id' => ANONYMOUS, 'post_username' => 'Foobar'),
array('post_id' => 4, 'poster_id' => ANONYMOUS, 'post_username' => 'Other'),
),
array(
array(
'topic_id' => 1,
- 'topic_poster' => ANONYMOUS, 'topic_first_poster_name' => 'Bertie', 'topic_first_poster_colour' => '',
- 'topic_last_poster_id' => ANONYMOUS, 'topic_last_poster_name' => 'Bertie', 'topic_last_poster_colour' => '',
+ 'topic_poster' => ANONYMOUS, 'topic_first_poster_name' => 'Foobar', 'topic_first_poster_colour' => '',
+ 'topic_last_poster_id' => ANONYMOUS, 'topic_last_poster_name' => 'Foobar', 'topic_last_poster_colour' => '',
),
array(
'topic_id' => 2,
@@ -122,8 +136,8 @@ class phpbb_functions_user_delete_user_test extends phpbb_database_test_case
),
array(
'topic_id' => 3,
- 'topic_poster' => ANONYMOUS, 'topic_first_poster_name' => 'Bertie', 'topic_first_poster_colour' => '',
- 'topic_last_poster_id' => ANONYMOUS, 'topic_last_poster_name' => 'Bertie', 'topic_last_poster_colour' => '',
+ 'topic_poster' => ANONYMOUS, 'topic_first_poster_name' => 'Foobar', 'topic_first_poster_colour' => '',
+ 'topic_last_poster_id' => ANONYMOUS, 'topic_last_poster_name' => 'Foobar', 'topic_last_poster_colour' => '',
),
array(
'topic_id' => 4,
@@ -132,14 +146,14 @@ class phpbb_functions_user_delete_user_test extends phpbb_database_test_case
),
),
array(
- array('forum_id' => 1, 'forum_last_poster_id' => ANONYMOUS, 'forum_last_poster_name' => 'Bertie', 'forum_last_poster_colour' => ''),
+ array('forum_id' => 1, 'forum_last_poster_id' => ANONYMOUS, 'forum_last_poster_name' => 'Foobar', 'forum_last_poster_colour' => ''),
array('forum_id' => 2, 'forum_last_poster_id' => ANONYMOUS, 'forum_last_poster_name' => 'Other', 'forum_last_poster_colour' => ''),
- array('forum_id' => 3, 'forum_last_poster_id' => ANONYMOUS, 'forum_last_poster_name' => 'Bertie', 'forum_last_poster_colour' => ''),
+ array('forum_id' => 3, 'forum_last_poster_id' => ANONYMOUS, 'forum_last_poster_name' => 'Foobar', 'forum_last_poster_colour' => ''),
array('forum_id' => 4, 'forum_last_poster_id' => ANONYMOUS, 'forum_last_poster_name' => 'Other', 'forum_last_poster_colour' => ''),
),
),
array(
- 'remove', 'Bertie',
+ 'remove', true,
array(
array('post_id' => 2, 'poster_id' => ANONYMOUS, 'post_username' => 'Other'),
array('post_id' => 4, 'poster_id' => ANONYMOUS, 'post_username' => 'Other'),
@@ -169,9 +183,9 @@ class phpbb_functions_user_delete_user_test extends phpbb_database_test_case
/**
* @dataProvider first_last_post_data
*/
- public function test_first_last_post_info($mode, $post_username, $expected_posts, $expected_topics, $expected_forums)
+ public function test_first_last_post_info($mode, $retain_username, $expected_posts, $expected_topics, $expected_forums)
{
- $this->assertFalse(user_delete($mode, 2, $post_username));
+ $this->assertFalse(user_delete($mode, 2, $retain_username));
$sql = 'SELECT post_id, poster_id, post_username
FROM ' . POSTS_TABLE . '
@@ -201,20 +215,20 @@ class phpbb_functions_user_delete_user_test extends phpbb_database_test_case
array(
'retain',
array(
- array('post_id' => 1, 'post_reported' => 1, 'post_edit_user' => 1),
- array('post_id' => 2, 'post_reported' => 1, 'post_edit_user' => 1),
- array('post_id' => 3, 'post_reported' => 0, 'post_edit_user' => 1),
- array('post_id' => 4, 'post_reported' => 0, 'post_edit_user' => 1),
+ array('post_id' => 1, 'post_reported' => 1, 'post_edit_user' => 1, 'post_delete_user' => 1),
+ array('post_id' => 2, 'post_reported' => 1, 'post_edit_user' => 1, 'post_delete_user' => 1),
+ array('post_id' => 3, 'post_reported' => 0, 'post_edit_user' => 1, 'post_delete_user' => 1),
+ array('post_id' => 4, 'post_reported' => 0, 'post_edit_user' => 1, 'post_delete_user' => 1),
),
array(
array('report_id' => 1, 'post_id' => 1, 'user_id' => 1),
array('report_id' => 3, 'post_id' => 2, 'user_id' => 1),
),
array(
- array('topic_id' => 1, 'topic_reported' => 1),
- array('topic_id' => 2, 'topic_reported' => 1),
- array('topic_id' => 3, 'topic_reported' => 0),
- array('topic_id' => 4, 'topic_reported' => 0),
+ array('topic_id' => 1, 'topic_reported' => 1, 'topic_delete_user' => 1),
+ array('topic_id' => 2, 'topic_reported' => 1, 'topic_delete_user' => 1),
+ array('topic_id' => 3, 'topic_reported' => 0, 'topic_delete_user' => 1),
+ array('topic_id' => 4, 'topic_reported' => 0, 'topic_delete_user' => 1),
),
array(
array('attach_id' => 1, 'post_msg_id' => 1, 'poster_id' => 1),
@@ -225,15 +239,15 @@ class phpbb_functions_user_delete_user_test extends phpbb_database_test_case
array(
'remove',
array(
- array('post_id' => 2, 'post_reported' => 1, 'post_edit_user' => 1),
- array('post_id' => 4, 'post_reported' => 0, 'post_edit_user' => 1),
+ array('post_id' => 2, 'post_reported' => 1, 'post_edit_user' => 1, 'post_delete_user' => 1),
+ array('post_id' => 4, 'post_reported' => 0, 'post_edit_user' => 1, 'post_delete_user' => 1),
),
array(
array('report_id' => 3, 'post_id' => 2, 'user_id' => 1),
),
array(
- array('topic_id' => 2, 'topic_reported' => 1),
- array('topic_id' => 4, 'topic_reported' => 0),
+ array('topic_id' => 2, 'topic_reported' => 1, 'topic_delete_user' => 1),
+ array('topic_id' => 4, 'topic_reported' => 0, 'topic_delete_user' => 1),
),
array(
array('attach_id' => 2, 'post_msg_id' => 2, 'poster_id' => 1),
@@ -250,7 +264,7 @@ class phpbb_functions_user_delete_user_test extends phpbb_database_test_case
{
$this->assertFalse(user_delete($mode, 2));
- $sql = 'SELECT post_id, post_reported, post_edit_user
+ $sql = 'SELECT post_id, post_reported, post_edit_user, post_delete_user
FROM ' . POSTS_TABLE . '
ORDER BY post_id ASC';
$result = $this->db->sql_query($sql);
@@ -264,7 +278,7 @@ class phpbb_functions_user_delete_user_test extends phpbb_database_test_case
$this->assertEquals($expected_reports, $this->db->sql_fetchrowset($result), 'Report table content is mismatching after deleting a user.');
$this->db->sql_freeresult($result);
- $sql = 'SELECT topic_id, topic_reported
+ $sql = 'SELECT topic_id, topic_reported, topic_delete_user
FROM ' . TOPICS_TABLE . '
ORDER BY topic_id ASC';
$result = $this->db->sql_query($sql);
diff --git a/tests/functions_user/fixtures/delete_user.xml b/tests/functions_user/fixtures/delete_user.xml
index 07591389d2..56014b35d1 100644
--- a/tests/functions_user/fixtures/delete_user.xml
+++ b/tests/functions_user/fixtures/delete_user.xml
@@ -148,10 +148,11 @@
<column>post_id</column>
<column>poster_id</column>
<column>post_edit_user</column>
+ <column>post_delete_user</column>
<column>post_username</column>
<column>topic_id</column>
<column>forum_id</column>
- <column>post_approved</column>
+ <column>post_visibility</column>
<column>post_time</column>
<column>post_text</column>
<column>post_reported</column>
@@ -159,6 +160,7 @@
<value>1</value>
<value>2</value>
<value>2</value>
+ <value>2</value>
<value></value>
<value>1</value>
<value>1</value>
@@ -171,6 +173,7 @@
<value>2</value>
<value>1</value>
<value>1</value>
+ <value>1</value>
<value>Other</value>
<value>2</value>
<value>2</value>
@@ -183,6 +186,7 @@
<value>3</value>
<value>2</value>
<value>2</value>
+ <value>2</value>
<value></value>
<value>3</value>
<value>3</value>
@@ -195,6 +199,7 @@
<value>4</value>
<value>1</value>
<value>1</value>
+ <value>1</value>
<value>Other</value>
<value>4</value>
<value>4</value>
@@ -258,29 +263,34 @@
<column>post_id</column>
<column>user_id</column>
<column>report_text</column>
+ <column>reported_post_text</column>
<row>
<value>1</value>
<value>1</value>
<value>1</value>
<value>Post Removed?</value>
+ <value></value>
</row>
<row>
<value>2</value>
<value>3</value>
<value>2</value>
<value>Post Removed?</value>
+ <value></value>
</row>
<row>
<value>3</value>
<value>2</value>
<value>1</value>
<value>Keep</value>
+ <value></value>
</row>
<row>
<value>4</value>
<value>4</value>
<value>2</value>
<value>Remove Report</value>
+ <value></value>
</row>
</table>
<table name="phpbb_sessions">
@@ -303,6 +313,7 @@
<column>forum_id</column>
<column>topic_reported</column>
<column>topic_poster</column>
+ <column>topic_delete_user</column>
<column>topic_first_poster_name</column>
<column>topic_first_poster_colour</column>
<column>topic_last_poster_id</column>
@@ -313,6 +324,7 @@
<value>1</value>
<value>1</value>
<value>2</value>
+ <value>2</value>
<value></value>
<value>00AA00</value>
<value>2</value>
@@ -324,6 +336,7 @@
<value>2</value>
<value>1</value>
<value>1</value>
+ <value>1</value>
<value>Other</value>
<value></value>
<value>1</value>
@@ -335,6 +348,7 @@
<value>3</value>
<value>1</value>
<value>2</value>
+ <value>2</value>
<value></value>
<value>00AA00</value>
<value>2</value>
@@ -346,6 +360,7 @@
<value>4</value>
<value>1</value>
<value>1</value>
+ <value>1</value>
<value>Other</value>
<value></value>
<value>1</value>
@@ -355,17 +370,15 @@
</table>
<table name="phpbb_users">
<column>user_id</column>
+ <column>username</column>
<column>username_clean</column>
<column>user_permissions</column>
<column>user_sig</column>
- <column>user_occ</column>
- <column>user_interests</column>
<column>user_posts</column>
<row>
<value>1</value>
<value>Anonymous</value>
- <value></value>
- <value></value>
+ <value>anonymous</value>
<value></value>
<value></value>
<value>2</value>
@@ -373,8 +386,7 @@
<row>
<value>2</value>
<value>Foobar</value>
- <value></value>
- <value></value>
+ <value>foobar</value>
<value></value>
<value></value>
<value>2</value>
@@ -461,11 +473,17 @@
</table>
<table name="phpbb_profile_fields_data">
<column>user_id</column>
+ <column>pf_phpbb_interests</column>
+ <column>pf_phpbb_occupation</column>
<row>
<value>2</value>
+ <value></value>
+ <value></value>
</row>
<row>
<value>3</value>
+ <value></value>
+ <value></value>
</row>
</table>
<table name="phpbb_moderator_cache">
diff --git a/tests/functions_user/fixtures/group_user_attributes.xml b/tests/functions_user/fixtures/group_user_attributes.xml
new file mode 100644
index 0000000000..9b1f1f504b
--- /dev/null
+++ b/tests/functions_user/fixtures/group_user_attributes.xml
@@ -0,0 +1,113 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<dataset>
+ <table name="phpbb_groups">
+ <column>group_id</column>
+ <column>group_avatar</column>
+ <column>group_rank</column>
+ <column>group_desc</column>
+ <row>
+ <value>1</value>
+ <value>default</value>
+ <value>1</value>
+ <value></value>
+ </row>
+ <row>
+ <value>2</value>
+ <value></value>
+ <value>0</value>
+ <value></value>
+ </row>
+ <row>
+ <value>3</value>
+ <value>default2</value>
+ <value>3</value>
+ <value></value>
+ </row>
+ </table>
+ <table name="phpbb_users">
+ <column>user_id</column>
+ <column>group_id</column>
+ <column>user_avatar</column>
+ <column>user_rank</column>
+ <column>username_clean</column>
+ <column>user_permissions</column>
+ <column>user_sig</column>
+ <row>
+ <value>1</value>
+ <value>1</value>
+ <value></value>
+ <value>0</value>
+ <value>barfoo</value>
+ <value></value>
+ <value></value>
+ </row>
+ <row>
+ <value>2</value>
+ <value>1</value>
+ <value>default</value>
+ <value>1</value>
+ <value>foobar</value>
+ <value></value>
+ <value></value>
+ </row>
+ <row>
+ <value>3</value>
+ <value>1</value>
+ <value>custom</value>
+ <value>2</value>
+ <value>bertie</value>
+ <value></value>
+ <value></value>
+ </row>
+ </table>
+ <table name="phpbb_user_group">
+ <column>user_id</column>
+ <column>group_id</column>
+ <column>user_pending</column>
+ <row>
+ <value>1</value>
+ <value>1</value>
+ <value>0</value>
+ </row>
+ <row>
+ <value>1</value>
+ <value>2</value>
+ <value>0</value>
+ </row>
+ <row>
+ <value>1</value>
+ <value>3</value>
+ <value>0</value>
+ </row>
+ <row>
+ <value>2</value>
+ <value>1</value>
+ <value>0</value>
+ </row>
+ <row>
+ <value>2</value>
+ <value>2</value>
+ <value>0</value>
+ </row>
+ <row>
+ <value>2</value>
+ <value>3</value>
+ <value>0</value>
+ </row>
+ <row>
+ <value>3</value>
+ <value>1</value>
+ <value>0</value>
+ </row>
+ <row>
+ <value>3</value>
+ <value>2</value>
+ <value>0</value>
+ </row>
+ <row>
+ <value>3</value>
+ <value>3</value>
+ <value>0</value>
+ </row>
+ </table>
+</dataset>
diff --git a/tests/functions_user/group_user_attributes_test.php b/tests/functions_user/group_user_attributes_test.php
new file mode 100644
index 0000000000..99a15b32bf
--- /dev/null
+++ b/tests/functions_user/group_user_attributes_test.php
@@ -0,0 +1,162 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions_user.php';
+require_once dirname(__FILE__) . '/../../phpBB/includes/utf/utf_tools.php';
+
+class phpbb_functions_user_group_user_attributes_test extends phpbb_database_test_case
+{
+ public function getDataSet()
+ {
+ return $this->createXMLDataSet(dirname(__FILE__).'/fixtures/group_user_attributes.xml');
+ }
+
+ public function group_user_attributes_data()
+ {
+ return array(
+ array(
+ 'Setting new default group without settings for user with no settings - no change',
+ 1,
+ 2,
+ array(
+ 'group_avatar' => '',
+ 'group_avatar_type' => '',
+ 'group_avatar_height' => 0,
+ 'group_avatar_width' => 0,
+ 'group_rank' => 0,
+ ),
+ array(
+ 'user_avatar' => '',
+ 'user_rank' => 0,
+ ),
+ ),
+ array(
+ 'Setting new default group without settings for user with default settings - user settings overwritten',
+ 2,
+ 2,
+ array(
+ 'group_avatar' => '',
+ 'group_avatar_type' => '',
+ 'group_avatar_height' => 0,
+ 'group_avatar_width' => 0,
+ 'group_rank' => 0,
+ ),
+ array(
+ 'user_avatar' => '',
+ 'user_rank' => 0,
+ ),
+ ),
+ array(
+ 'Setting new default group without settings for user with custom settings - no change',
+ 3,
+ 2,
+ array(
+ 'group_avatar' => '',
+ 'group_avatar_type' => '',
+ 'group_avatar_height' => 0,
+ 'group_avatar_width' => 0,
+ 'group_rank' => 0,
+ ),
+ array(
+ 'user_avatar' => 'custom',
+ 'user_rank' => 2,
+ ),
+ ),
+ array(
+ 'Setting new default group with settings for user with no settings - user settings overwritten',
+ 1,
+ 3,
+ array(
+ 'group_avatar' => 'default2',
+ 'group_avatar_type' => 'avatar.driver.upload',
+ 'group_avatar_height' => 1,
+ 'group_avatar_width' => 1,
+ 'group_rank' => 3,
+ ),
+ array(
+ 'user_avatar' => 'default2',
+ 'user_rank' => 3,
+ ),
+ ),
+ array(
+ 'Setting new default group with settings for user with default settings - user settings overwritten',
+ 2,
+ 3,
+ array(
+ 'group_avatar' => 'default2',
+ 'group_avatar_type' => 'avatar.driver.upload',
+ 'group_avatar_height' => 1,
+ 'group_avatar_width' => 1,
+ 'group_rank' => 3,
+ ),
+ array(
+ 'user_avatar' => 'default2',
+ 'user_rank' => 3,
+ ),
+ ),
+ array(
+ 'Setting new default group with settings for user with custom settings - no change',
+ 3,
+ 3,
+ array(
+ 'group_avatar' => 'default2',
+ 'group_avatar_type' => 'avatar.driver.upload',
+ 'group_avatar_height' => 1,
+ 'group_avatar_width' => 1,
+ 'group_rank' => 3,
+ ),
+ array(
+ 'user_avatar' => 'custom',
+ 'user_rank' => 2,
+ ),
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider group_user_attributes_data
+ */
+ public function test_group_user_attributes($description, $user_id, $group_id, $group_row, $expected)
+ {
+ global $auth, $cache, $db, $phpbb_dispatcher, $user, $phpbb_container, $phpbb_log, $phpbb_root_path, $phpEx;
+
+ $user = new phpbb_mock_user;
+ $user->ip = '';
+ $cache = new phpbb_mock_cache;
+ $db = $this->new_dbal();
+ $phpbb_dispatcher = new phpbb_mock_event_dispatcher();
+ $auth = $this->getMock('\phpbb\auth\auth');
+ $auth->expects($this->any())
+ ->method('acl_clear_prefetch');
+ $cache_driver = new \phpbb\cache\driver\null();
+ $phpbb_container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface');
+ $phpbb_container
+ ->expects($this->any())
+ ->method('get')
+ ->with('cache.driver')
+ ->will($this->returnValue($cache_driver));
+ $phpbb_log = new \phpbb\log\log($db, $user, $auth, $phpbb_dispatcher, $phpbb_root_path, 'adm/', $phpEx, LOG_TABLE);
+
+ group_user_attributes('default', $group_id, array($user_id), false, 'group_name', $group_row);
+
+ $sql = 'SELECT user_avatar, user_rank
+ FROM ' . USERS_TABLE . '
+ WHERE user_id = ' . $user_id;
+ $result = $db->sql_query($sql);
+
+ $this->assertEquals(array($expected), $db->sql_fetchrowset($result));
+
+ $db->sql_freeresult($result);
+ }
+}
diff --git a/tests/groupposition/fixtures/legend.xml b/tests/groupposition/fixtures/legend.xml
new file mode 100644
index 0000000000..a9209309bd
--- /dev/null
+++ b/tests/groupposition/fixtures/legend.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<dataset>
+ <table name="phpbb_groups">
+ <column>group_id</column>
+ <column>group_legend</column>
+ <column>group_desc</column>
+ <row>
+ <value>1</value>
+ <value>0</value>
+ <value></value>
+ </row>
+ <row>
+ <value>2</value>
+ <value>1</value>
+ <value></value>
+ </row>
+ <row>
+ <value>3</value>
+ <value>2</value>
+ <value></value>
+ </row>
+ </table>
+</dataset>
diff --git a/tests/groupposition/fixtures/teampage.xml b/tests/groupposition/fixtures/teampage.xml
new file mode 100644
index 0000000000..b6c39045e3
--- /dev/null
+++ b/tests/groupposition/fixtures/teampage.xml
@@ -0,0 +1,102 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<dataset>
+ <table name="phpbb_groups">
+ <column>group_id</column>
+ <column>group_desc</column>
+ <row>
+ <value>1</value>
+ <value></value>
+ </row>
+ <row>
+ <value>2</value>
+ <value></value>
+ </row>
+ <row>
+ <value>3</value>
+ <value></value>
+ </row>
+ <row>
+ <value>4</value>
+ <value></value>
+ </row>
+ <row>
+ <value>5</value>
+ <value></value>
+ </row>
+ <row>
+ <value>6</value>
+ <value></value>
+ </row>
+ <row>
+ <value>7</value>
+ <value></value>
+ </row>
+ <row>
+ <value>8</value>
+ <value></value>
+ </row>
+ </table>
+ <table name="phpbb_teampage">
+ <column>teampage_id</column>
+ <column>group_id</column>
+ <column>teampage_name</column>
+ <column>teampage_position</column>
+ <column>teampage_parent</column>
+ <row>
+ <value>1</value>
+ <value>1</value>
+ <value></value>
+ <value>1</value>
+ <value>0</value>
+ </row>
+ <row>
+ <value>2</value>
+ <value>0</value>
+ <value>category - 2 children</value>
+ <value>2</value>
+ <value>0</value>
+ </row>
+ <row>
+ <value>3</value>
+ <value>2</value>
+ <value></value>
+ <value>3</value>
+ <value>2</value>
+ </row>
+ <row>
+ <value>4</value>
+ <value>3</value>
+ <value></value>
+ <value>4</value>
+ <value>2</value>
+ </row>
+ <row>
+ <value>5</value>
+ <value>0</value>
+ <value>category2 - 2 children</value>
+ <value>5</value>
+ <value>0</value>
+ </row>
+ <row>
+ <value>6</value>
+ <value>4</value>
+ <value></value>
+ <value>6</value>
+ <value>5</value>
+ </row>
+ <row>
+ <value>7</value>
+ <value>5</value>
+ <value></value>
+ <value>7</value>
+ <value>5</value>
+ </row>
+ <row>
+ <value>8</value>
+ <value>6</value>
+ <value></value>
+ <value>8</value>
+ <value>0</value>
+ </row>
+ </table>
+</dataset>
diff --git a/tests/groupposition/legend_test.php b/tests/groupposition/legend_test.php
new file mode 100644
index 0000000000..fe003e93a7
--- /dev/null
+++ b/tests/groupposition/legend_test.php
@@ -0,0 +1,407 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+
+class phpbb_groupposition_legend_test extends phpbb_database_test_case
+{
+ public function getDataSet()
+ {
+ return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/legend.xml');
+ }
+
+ public function get_group_value_data()
+ {
+ return array(
+ array(1, 0, ''),
+ array(3, 2, ''),
+ array(4, 0, '\phpbb\groupposition\exception'),
+ );
+ }
+
+ /**
+ * @dataProvider get_group_value_data
+ */
+ public function test_get_group_value($group_id, $expected, $throws_exception)
+ {
+ global $cache;
+
+ $cache = new phpbb_mock_cache;
+ $db = $this->new_dbal();
+ $user = new \phpbb\user('\phpbb\datetime');
+ $user->lang = array();
+
+ if ($throws_exception)
+ {
+ $this->setExpectedException($throws_exception);
+ }
+
+ $test_class = new \phpbb\groupposition\legend($db, $user);
+ $this->assertEquals($expected, $test_class->get_group_value($group_id));
+ }
+
+ public function test_get_group_count()
+ {
+ global $cache;
+
+ $cache = new phpbb_mock_cache;
+ $db = $this->new_dbal();
+ $user = new \phpbb\user('\phpbb\datetime');
+ $user->lang = array();
+
+ $test_class = new \phpbb\groupposition\legend($db, $user);
+ $this->assertEquals(2, $test_class->get_group_count());
+ }
+
+ public function add_group_data()
+ {
+ return array(
+ array(
+ 1,
+ true,
+ array(
+ array('group_id' => 1, 'group_legend' => 3),
+ array('group_id' => 2, 'group_legend' => 1),
+ array('group_id' => 3, 'group_legend' => 2),
+ ),
+ ),
+ array(
+ 2,
+ false,
+ array(
+ array('group_id' => 1, 'group_legend' => 0),
+ array('group_id' => 2, 'group_legend' => 1),
+ array('group_id' => 3, 'group_legend' => 2),
+ ),
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider add_group_data
+ */
+ public function test_add_group($group_id, $expected_added, $expected)
+ {
+ global $cache;
+
+ $cache = new phpbb_mock_cache;
+ $db = $this->new_dbal();
+ $user = new \phpbb\user('\phpbb\datetime');
+ $user->lang = array();
+
+ $test_class = new \phpbb\groupposition\legend($db, $user);
+ $this->assertEquals($expected_added, $test_class->add_group($group_id));
+
+ $result = $db->sql_query('SELECT group_id, group_legend
+ FROM ' . GROUPS_TABLE . '
+ ORDER BY group_id ASC');
+
+ $this->assertEquals($expected, $db->sql_fetchrowset($result));
+ }
+
+ public function delete_group_data()
+ {
+ return array(
+ array(
+ 1,
+ false,
+ false,
+ array(
+ array('group_id' => 1, 'group_legend' => 0),
+ array('group_id' => 2, 'group_legend' => 1),
+ array('group_id' => 3, 'group_legend' => 2),
+ ),
+ ),
+ array(
+ 2,
+ false,
+ true,
+ array(
+ array('group_id' => 1, 'group_legend' => 0),
+ array('group_id' => 2, 'group_legend' => 0),
+ array('group_id' => 3, 'group_legend' => 1),
+ ),
+ ),
+ array(
+ 3,
+ false,
+ true,
+ array(
+ array('group_id' => 1, 'group_legend' => 0),
+ array('group_id' => 2, 'group_legend' => 1),
+ array('group_id' => 3, 'group_legend' => 0),
+ ),
+ ),
+ array(
+ 1,
+ true,
+ false,
+ array(
+ array('group_id' => 1, 'group_legend' => 0),
+ array('group_id' => 2, 'group_legend' => 1),
+ array('group_id' => 3, 'group_legend' => 2),
+ ),
+ ),
+ array(
+ 2,
+ true,
+ true,
+ array(
+ array('group_id' => 1, 'group_legend' => 0),
+ array('group_id' => 2, 'group_legend' => 1),
+ array('group_id' => 3, 'group_legend' => 1),
+ ),
+ ),
+ array(
+ 3,
+ true,
+ true,
+ array(
+ array('group_id' => 1, 'group_legend' => 0),
+ array('group_id' => 2, 'group_legend' => 1),
+ array('group_id' => 3, 'group_legend' => 2),
+ ),
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider delete_group_data
+ */
+ public function test_delete_group($group_id, $skip_group, $expected_deleted, $expected)
+ {
+ global $cache;
+
+ $cache = new phpbb_mock_cache;
+ $db = $this->new_dbal();
+ $user = new \phpbb\user('\phpbb\datetime');
+ $user->lang = array();
+
+ $test_class = new \phpbb\groupposition\legend($db, $user);
+ $this->assertEquals($expected_deleted, $test_class->delete_group($group_id, $skip_group));
+
+ $result = $db->sql_query('SELECT group_id, group_legend
+ FROM ' . GROUPS_TABLE . '
+ ORDER BY group_id ASC');
+
+ $this->assertEquals($expected, $db->sql_fetchrowset($result));
+ }
+
+ public function move_up_data()
+ {
+ return array(
+ array(
+ 1,
+ false,
+ array(
+ array('group_id' => 1, 'group_legend' => 0),
+ array('group_id' => 2, 'group_legend' => 1),
+ array('group_id' => 3, 'group_legend' => 2),
+ ),
+ ),
+ array(
+ 2,
+ false,
+ array(
+ array('group_id' => 1, 'group_legend' => 0),
+ array('group_id' => 2, 'group_legend' => 1),
+ array('group_id' => 3, 'group_legend' => 2),
+ ),
+ ),
+ array(
+ 3,
+ true,
+ array(
+ array('group_id' => 1, 'group_legend' => 0),
+ array('group_id' => 2, 'group_legend' => 2),
+ array('group_id' => 3, 'group_legend' => 1),
+ ),
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider move_up_data
+ */
+ public function test_move_up($group_id, $excepted_moved, $expected)
+ {
+ global $cache;
+
+ $cache = new phpbb_mock_cache;
+ $db = $this->new_dbal();
+ $user = new \phpbb\user('\phpbb\datetime');
+ $user->lang = array();
+
+ $test_class = new \phpbb\groupposition\legend($db, $user);
+ $this->assertEquals($excepted_moved, $test_class->move_up($group_id));
+
+ $result = $db->sql_query('SELECT group_id, group_legend
+ FROM ' . GROUPS_TABLE . '
+ ORDER BY group_id ASC');
+
+ $this->assertEquals($expected, $db->sql_fetchrowset($result));
+ }
+
+ public function move_down_data()
+ {
+ return array(
+ array(
+ 1,
+ false,
+ array(
+ array('group_id' => 1, 'group_legend' => 0),
+ array('group_id' => 2, 'group_legend' => 1),
+ array('group_id' => 3, 'group_legend' => 2),
+ ),
+ ),
+ array(
+ 2,
+ true,
+ array(
+ array('group_id' => 1, 'group_legend' => 0),
+ array('group_id' => 2, 'group_legend' => 2),
+ array('group_id' => 3, 'group_legend' => 1),
+ ),
+ ),
+ array(
+ 3,
+ false,
+ array(
+ array('group_id' => 1, 'group_legend' => 0),
+ array('group_id' => 2, 'group_legend' => 1),
+ array('group_id' => 3, 'group_legend' => 2),
+ ),
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider move_down_data
+ */
+ public function test_move_down($group_id, $excepted_moved, $expected)
+ {
+ global $cache;
+
+ $cache = new phpbb_mock_cache;
+ $db = $this->new_dbal();
+ $user = new \phpbb\user('\phpbb\datetime');
+ $user->lang = array();
+
+ $test_class = new \phpbb\groupposition\legend($db, $user);
+ $this->assertEquals($excepted_moved, $test_class->move_down($group_id));
+
+ $result = $db->sql_query('SELECT group_id, group_legend
+ FROM ' . GROUPS_TABLE . '
+ ORDER BY group_id ASC');
+
+ $this->assertEquals($expected, $db->sql_fetchrowset($result));
+ }
+
+ public function move_data()
+ {
+ return array(
+ array(
+ 1,
+ 1,
+ false,
+ array(
+ array('group_id' => 1, 'group_legend' => 0),
+ array('group_id' => 2, 'group_legend' => 1),
+ array('group_id' => 3, 'group_legend' => 2),
+ ),
+ ),
+ array(
+ 1,
+ -1,
+ false,
+ array(
+ array('group_id' => 1, 'group_legend' => 0),
+ array('group_id' => 2, 'group_legend' => 1),
+ array('group_id' => 3, 'group_legend' => 2),
+ ),
+ ),
+ array(
+ 3,
+ 3,
+ true,
+ array(
+ array('group_id' => 1, 'group_legend' => 0),
+ array('group_id' => 2, 'group_legend' => 2),
+ array('group_id' => 3, 'group_legend' => 1),
+ ),
+ ),
+ array(
+ 2,
+ 0,
+ false,
+ array(
+ array('group_id' => 1, 'group_legend' => 0),
+ array('group_id' => 2, 'group_legend' => 1),
+ array('group_id' => 3, 'group_legend' => 2),
+ ),
+ ),
+ array(
+ 2,
+ -1,
+ true,
+ array(
+ array('group_id' => 1, 'group_legend' => 0),
+ array('group_id' => 2, 'group_legend' => 2),
+ array('group_id' => 3, 'group_legend' => 1),
+ ),
+ ),
+ array(
+ 2,
+ -3,
+ true,
+ array(
+ array('group_id' => 1, 'group_legend' => 0),
+ array('group_id' => 2, 'group_legend' => 2),
+ array('group_id' => 3, 'group_legend' => 1),
+ ),
+ ),
+ array(
+ 3,
+ -1,
+ false,
+ array(
+ array('group_id' => 1, 'group_legend' => 0),
+ array('group_id' => 2, 'group_legend' => 1),
+ array('group_id' => 3, 'group_legend' => 2),
+ ),
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider move_data
+ */
+ public function test_move($group_id, $increment, $excepted_moved, $expected)
+ {
+ global $cache;
+
+ $cache = new phpbb_mock_cache;
+ $db = $this->new_dbal();
+ $user = new \phpbb\user('\phpbb\datetime');
+ $user->lang = array();
+
+ $test_class = new \phpbb\groupposition\legend($db, $user);
+ $this->assertEquals($excepted_moved, $test_class->move($group_id, $increment));
+
+ $result = $db->sql_query('SELECT group_id, group_legend
+ FROM ' . GROUPS_TABLE . '
+ ORDER BY group_id ASC');
+
+ $this->assertEquals($expected, $db->sql_fetchrowset($result));
+ }
+}
+
diff --git a/tests/groupposition/teampage_test.php b/tests/groupposition/teampage_test.php
new file mode 100644
index 0000000000..1e61e3ebfb
--- /dev/null
+++ b/tests/groupposition/teampage_test.php
@@ -0,0 +1,645 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+require_once dirname(__FILE__) . '/../../phpBB/includes/utf/utf_tools.php';
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions_content.php';
+
+class phpbb_groupposition_teampage_test extends phpbb_database_test_case
+{
+ public function getDataSet()
+ {
+ return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/teampage.xml');
+ }
+
+ public function get_group_value_data()
+ {
+ return array(
+ array(2, 3, ''),
+ array(6, 8, ''),
+ array(10, 0, '\phpbb\groupposition\exception'),
+ );
+ }
+
+ /**
+ * @dataProvider get_group_value_data
+ */
+ public function test_get_group_value($group_id, $expected, $throws_exception)
+ {
+ global $cache;
+
+ $cache = new phpbb_mock_cache;
+ $db = $this->new_dbal();
+ $user = new \phpbb\user('\phpbb\datetime');
+ $user->lang = array();
+
+ if ($throws_exception)
+ {
+ $this->setExpectedException($throws_exception);
+ }
+
+ $test_class = new \phpbb\groupposition\teampage($db, $user, $cache);
+ $this->assertEquals($expected, $test_class->get_group_value($group_id));
+ }
+
+ public function test_get_group_count()
+ {
+ global $cache;
+
+ $cache = new phpbb_mock_cache;
+ $db = $this->new_dbal();
+ $user = new \phpbb\user('\phpbb\datetime');
+ $user->lang = array();
+
+ $test_class = new \phpbb\groupposition\teampage($db, $user, $cache);
+ $this->assertEquals(8, $test_class->get_group_count());
+ }
+
+ public function add_group_teampage_data()
+ {
+ return array(
+ array(
+ 1,
+ 2,
+ false,
+ array(
+ array('teampage_position' => 1, 'group_id' => 1, 'teampage_parent' => 0, 'teampage_name' => ''),
+ array('teampage_position' => 2, 'group_id' => 0, 'teampage_parent' => 0, 'teampage_name' => 'category - 2 children'),
+ array('teampage_position' => 3, 'group_id' => 2, 'teampage_parent' => 2, 'teampage_name' => ''),
+ array('teampage_position' => 4, 'group_id' => 3, 'teampage_parent' => 2, 'teampage_name' => ''),
+ array('teampage_position' => 5, 'group_id' => 0, 'teampage_parent' => 0, 'teampage_name' => 'category2 - 2 children'),
+ array('teampage_position' => 6, 'group_id' => 4, 'teampage_parent' => 5, 'teampage_name' => ''),
+ array('teampage_position' => 7, 'group_id' => 5, 'teampage_parent' => 5, 'teampage_name' => ''),
+ array('teampage_position' => 8, 'group_id' => 6, 'teampage_parent' => 0, 'teampage_name' => ''),
+ ),
+ ),
+ array(
+ 6,
+ 2,
+ false,
+ array(
+ array('teampage_position' => 1, 'group_id' => 1, 'teampage_parent' => 0, 'teampage_name' => ''),
+ array('teampage_position' => 2, 'group_id' => 0, 'teampage_parent' => 0, 'teampage_name' => 'category - 2 children'),
+ array('teampage_position' => 3, 'group_id' => 2, 'teampage_parent' => 2, 'teampage_name' => ''),
+ array('teampage_position' => 4, 'group_id' => 3, 'teampage_parent' => 2, 'teampage_name' => ''),
+ array('teampage_position' => 5, 'group_id' => 0, 'teampage_parent' => 0, 'teampage_name' => 'category2 - 2 children'),
+ array('teampage_position' => 6, 'group_id' => 4, 'teampage_parent' => 5, 'teampage_name' => ''),
+ array('teampage_position' => 7, 'group_id' => 5, 'teampage_parent' => 5, 'teampage_name' => ''),
+ array('teampage_position' => 8, 'group_id' => 6, 'teampage_parent' => 0, 'teampage_name' => ''),
+ ),
+ ),
+ array(
+ 7,
+ 2,
+ true,
+ array(
+ array('teampage_position' => 1, 'group_id' => 1, 'teampage_parent' => 0, 'teampage_name' => ''),
+ array('teampage_position' => 2, 'group_id' => 0, 'teampage_parent' => 0, 'teampage_name' => 'category - 2 children'),
+ array('teampage_position' => 3, 'group_id' => 2, 'teampage_parent' => 2, 'teampage_name' => ''),
+ array('teampage_position' => 4, 'group_id' => 3, 'teampage_parent' => 2, 'teampage_name' => ''),
+ array('teampage_position' => 5, 'group_id' => 7, 'teampage_parent' => 2, 'teampage_name' => ''),
+ array('teampage_position' => 6, 'group_id' => 0, 'teampage_parent' => 0, 'teampage_name' => 'category2 - 2 children'),
+ array('teampage_position' => 7, 'group_id' => 4, 'teampage_parent' => 5, 'teampage_name' => ''),
+ array('teampage_position' => 8, 'group_id' => 5, 'teampage_parent' => 5, 'teampage_name' => ''),
+ array('teampage_position' => 9, 'group_id' => 6, 'teampage_parent' => 0, 'teampage_name' => ''),
+ ),
+ ),
+ array(
+ 7,
+ 0,
+ true,
+ array(
+ array('teampage_position' => 1, 'group_id' => 1, 'teampage_parent' => 0, 'teampage_name' => ''),
+ array('teampage_position' => 2, 'group_id' => 0, 'teampage_parent' => 0, 'teampage_name' => 'category - 2 children'),
+ array('teampage_position' => 3, 'group_id' => 2, 'teampage_parent' => 2, 'teampage_name' => ''),
+ array('teampage_position' => 4, 'group_id' => 3, 'teampage_parent' => 2, 'teampage_name' => ''),
+ array('teampage_position' => 5, 'group_id' => 0, 'teampage_parent' => 0, 'teampage_name' => 'category2 - 2 children'),
+ array('teampage_position' => 6, 'group_id' => 4, 'teampage_parent' => 5, 'teampage_name' => ''),
+ array('teampage_position' => 7, 'group_id' => 5, 'teampage_parent' => 5, 'teampage_name' => ''),
+ array('teampage_position' => 8, 'group_id' => 6, 'teampage_parent' => 0, 'teampage_name' => ''),
+ array('teampage_position' => 9, 'group_id' => 7, 'teampage_parent' => 0, 'teampage_name' => ''),
+ ),
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider add_group_teampage_data
+ */
+ public function test_add_group_teampage($group_id, $parent_id, $expected_added, $expected)
+ {
+ global $cache;
+
+ $cache = new phpbb_mock_cache;
+ $db = $this->new_dbal();
+ $user = new \phpbb\user('\phpbb\datetime');
+ $user->lang = array();
+
+ $test_class = new \phpbb\groupposition\teampage($db, $user, $cache);
+ $this->assertEquals($expected_added, $test_class->add_group_teampage($group_id, $parent_id));
+
+ $result = $db->sql_query('SELECT teampage_position, group_id, teampage_parent, teampage_name
+ FROM ' . TEAMPAGE_TABLE . '
+ ORDER BY teampage_position ASC');
+
+ $this->assertEquals($expected, $db->sql_fetchrowset($result));
+ }
+
+ public function add_category_teampage_data()
+ {
+ return array(
+ array(
+ 'new',
+ true,
+ array(
+ array('teampage_position' => 1, 'group_id' => 1, 'teampage_parent' => 0, 'teampage_name' => ''),
+ array('teampage_position' => 2, 'group_id' => 0, 'teampage_parent' => 0, 'teampage_name' => 'category - 2 children'),
+ array('teampage_position' => 3, 'group_id' => 2, 'teampage_parent' => 2, 'teampage_name' => ''),
+ array('teampage_position' => 4, 'group_id' => 3, 'teampage_parent' => 2, 'teampage_name' => ''),
+ array('teampage_position' => 5, 'group_id' => 0, 'teampage_parent' => 0, 'teampage_name' => 'category2 - 2 children'),
+ array('teampage_position' => 6, 'group_id' => 4, 'teampage_parent' => 5, 'teampage_name' => ''),
+ array('teampage_position' => 7, 'group_id' => 5, 'teampage_parent' => 5, 'teampage_name' => ''),
+ array('teampage_position' => 8, 'group_id' => 6, 'teampage_parent' => 0, 'teampage_name' => ''),
+ array('teampage_position' => 9, 'group_id' => 0, 'teampage_parent' => 0, 'teampage_name' => 'new'),
+ ),
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider add_category_teampage_data
+ */
+ public function test_add_category_teampage($group_name, $expected_added, $expected)
+ {
+ global $cache;
+
+ $cache = new phpbb_mock_cache;
+ $db = $this->new_dbal();
+ $user = new \phpbb\user('\phpbb\datetime');
+ $user->lang = array();
+
+ $test_class = new \phpbb\groupposition\teampage($db, $user, $cache);
+ $this->assertEquals($expected_added, $test_class->add_category_teampage($group_name));
+
+ $result = $db->sql_query('SELECT teampage_position, group_id, teampage_parent, teampage_name
+ FROM ' . TEAMPAGE_TABLE . '
+ ORDER BY teampage_position ASC');
+
+ $this->assertEquals($expected, $db->sql_fetchrowset($result));
+ }
+
+ public function delete_group_data()
+ {
+ return array(
+ array(
+ 1,
+ true,
+ array(
+ array('teampage_position' => 1, 'group_id' => 0, 'teampage_parent' => 0, 'teampage_name' => 'category - 2 children'),
+ array('teampage_position' => 2, 'group_id' => 2, 'teampage_parent' => 2, 'teampage_name' => ''),
+ array('teampage_position' => 3, 'group_id' => 3, 'teampage_parent' => 2, 'teampage_name' => ''),
+ array('teampage_position' => 4, 'group_id' => 0, 'teampage_parent' => 0, 'teampage_name' => 'category2 - 2 children'),
+ array('teampage_position' => 5, 'group_id' => 4, 'teampage_parent' => 5, 'teampage_name' => ''),
+ array('teampage_position' => 6, 'group_id' => 5, 'teampage_parent' => 5, 'teampage_name' => ''),
+ array('teampage_position' => 7, 'group_id' => 6, 'teampage_parent' => 0, 'teampage_name' => ''),
+ ),
+ ),
+ array(
+ 2,
+ true,
+ array(
+ array('teampage_position' => 1, 'group_id' => 1, 'teampage_parent' => 0, 'teampage_name' => ''),
+ array('teampage_position' => 2, 'group_id' => 0, 'teampage_parent' => 0, 'teampage_name' => 'category - 2 children'),
+ array('teampage_position' => 3, 'group_id' => 3, 'teampage_parent' => 2, 'teampage_name' => ''),
+ array('teampage_position' => 4, 'group_id' => 0, 'teampage_parent' => 0, 'teampage_name' => 'category2 - 2 children'),
+ array('teampage_position' => 5, 'group_id' => 4, 'teampage_parent' => 5, 'teampage_name' => ''),
+ array('teampage_position' => 6, 'group_id' => 5, 'teampage_parent' => 5, 'teampage_name' => ''),
+ array('teampage_position' => 7, 'group_id' => 6, 'teampage_parent' => 0, 'teampage_name' => ''),
+ ),
+ ),
+ array(
+ 6,
+ true,
+ array(
+ array('teampage_position' => 1, 'group_id' => 1, 'teampage_parent' => 0, 'teampage_name' => ''),
+ array('teampage_position' => 2, 'group_id' => 0, 'teampage_parent' => 0, 'teampage_name' => 'category - 2 children'),
+ array('teampage_position' => 3, 'group_id' => 2, 'teampage_parent' => 2, 'teampage_name' => ''),
+ array('teampage_position' => 4, 'group_id' => 3, 'teampage_parent' => 2, 'teampage_name' => ''),
+ array('teampage_position' => 5, 'group_id' => 0, 'teampage_parent' => 0, 'teampage_name' => 'category2 - 2 children'),
+ array('teampage_position' => 6, 'group_id' => 4, 'teampage_parent' => 5, 'teampage_name' => ''),
+ array('teampage_position' => 7, 'group_id' => 5, 'teampage_parent' => 5, 'teampage_name' => ''),
+ ),
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider delete_group_data
+ */
+ public function test_delete_group($group_id, $expected_deleted, $expected)
+ {
+ global $cache;
+
+ $cache = new phpbb_mock_cache;
+ $db = $this->new_dbal();
+ $user = new \phpbb\user('\phpbb\datetime');
+ $user->lang = array();
+
+ $test_class = new \phpbb\groupposition\teampage($db, $user, $cache);
+ $this->assertEquals($expected_deleted, $test_class->delete_group($group_id, false));
+
+ $result = $db->sql_query('SELECT teampage_position, group_id, teampage_parent, teampage_name
+ FROM ' . TEAMPAGE_TABLE . '
+ ORDER BY teampage_position ASC');
+
+ $this->assertEquals($expected, $db->sql_fetchrowset($result));
+ }
+
+ public function delete_teampage_data()
+ {
+ return array(
+ array(
+ 1,
+ true,
+ array(
+ array('teampage_position' => 1, 'group_id' => 0, 'teampage_parent' => 0, 'teampage_name' => 'category - 2 children'),
+ array('teampage_position' => 2, 'group_id' => 2, 'teampage_parent' => 2, 'teampage_name' => ''),
+ array('teampage_position' => 3, 'group_id' => 3, 'teampage_parent' => 2, 'teampage_name' => ''),
+ array('teampage_position' => 4, 'group_id' => 0, 'teampage_parent' => 0, 'teampage_name' => 'category2 - 2 children'),
+ array('teampage_position' => 5, 'group_id' => 4, 'teampage_parent' => 5, 'teampage_name' => ''),
+ array('teampage_position' => 6, 'group_id' => 5, 'teampage_parent' => 5, 'teampage_name' => ''),
+ array('teampage_position' => 7, 'group_id' => 6, 'teampage_parent' => 0, 'teampage_name' => ''),
+ ),
+ ),
+ array(
+ 2,
+ true,
+ array(
+ array('teampage_position' => 1, 'group_id' => 1, 'teampage_parent' => 0, 'teampage_name' => ''),
+ array('teampage_position' => 2, 'group_id' => 0, 'teampage_parent' => 0, 'teampage_name' => 'category2 - 2 children'),
+ array('teampage_position' => 3, 'group_id' => 4, 'teampage_parent' => 5, 'teampage_name' => ''),
+ array('teampage_position' => 4, 'group_id' => 5, 'teampage_parent' => 5, 'teampage_name' => ''),
+ array('teampage_position' => 5, 'group_id' => 6, 'teampage_parent' => 0, 'teampage_name' => ''),
+ ),
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider delete_teampage_data
+ */
+ public function test_delete_teampage($teampage_id, $expected_deleted, $expected)
+ {
+ global $cache;
+
+ $cache = new phpbb_mock_cache;
+ $db = $this->new_dbal();
+ $user = new \phpbb\user('\phpbb\datetime');
+ $user->lang = array();
+
+ $test_class = new \phpbb\groupposition\teampage($db, $user, $cache);
+ $this->assertEquals($expected_deleted, $test_class->delete_teampage($teampage_id, false));
+
+ $result = $db->sql_query('SELECT teampage_position, group_id, teampage_parent, teampage_name
+ FROM ' . TEAMPAGE_TABLE . '
+ ORDER BY teampage_position ASC');
+
+ $this->assertEquals($expected, $db->sql_fetchrowset($result));
+ }
+
+ public function move_data()
+ {
+ return array(
+ array(
+ 1,
+ 1,
+ false,
+ array(
+ array('teampage_position' => 1, 'group_id' => 1, 'teampage_parent' => 0, 'teampage_name' => ''),
+ array('teampage_position' => 2, 'group_id' => 0, 'teampage_parent' => 0, 'teampage_name' => 'category - 2 children'),
+ array('teampage_position' => 3, 'group_id' => 2, 'teampage_parent' => 2, 'teampage_name' => ''),
+ array('teampage_position' => 4, 'group_id' => 3, 'teampage_parent' => 2, 'teampage_name' => ''),
+ array('teampage_position' => 5, 'group_id' => 0, 'teampage_parent' => 0, 'teampage_name' => 'category2 - 2 children'),
+ array('teampage_position' => 6, 'group_id' => 4, 'teampage_parent' => 5, 'teampage_name' => ''),
+ array('teampage_position' => 7, 'group_id' => 5, 'teampage_parent' => 5, 'teampage_name' => ''),
+ array('teampage_position' => 8, 'group_id' => 6, 'teampage_parent' => 0, 'teampage_name' => ''),
+ ),
+ ),
+ array(
+ 2,
+ 1,
+ false,
+ array(
+ array('teampage_position' => 1, 'group_id' => 1, 'teampage_parent' => 0, 'teampage_name' => ''),
+ array('teampage_position' => 2, 'group_id' => 0, 'teampage_parent' => 0, 'teampage_name' => 'category - 2 children'),
+ array('teampage_position' => 3, 'group_id' => 2, 'teampage_parent' => 2, 'teampage_name' => ''),
+ array('teampage_position' => 4, 'group_id' => 3, 'teampage_parent' => 2, 'teampage_name' => ''),
+ array('teampage_position' => 5, 'group_id' => 0, 'teampage_parent' => 0, 'teampage_name' => 'category2 - 2 children'),
+ array('teampage_position' => 6, 'group_id' => 4, 'teampage_parent' => 5, 'teampage_name' => ''),
+ array('teampage_position' => 7, 'group_id' => 5, 'teampage_parent' => 5, 'teampage_name' => ''),
+ array('teampage_position' => 8, 'group_id' => 6, 'teampage_parent' => 0, 'teampage_name' => ''),
+ ),
+ ),
+ array(
+ 5,
+ 1,
+ true,
+ array(
+ array('teampage_position' => 1, 'group_id' => 1, 'teampage_parent' => 0, 'teampage_name' => ''),
+ array('teampage_position' => 2, 'group_id' => 0, 'teampage_parent' => 0, 'teampage_name' => 'category - 2 children'),
+ array('teampage_position' => 3, 'group_id' => 2, 'teampage_parent' => 2, 'teampage_name' => ''),
+ array('teampage_position' => 4, 'group_id' => 3, 'teampage_parent' => 2, 'teampage_name' => ''),
+ array('teampage_position' => 5, 'group_id' => 0, 'teampage_parent' => 0, 'teampage_name' => 'category2 - 2 children'),
+ array('teampage_position' => 6, 'group_id' => 5, 'teampage_parent' => 5, 'teampage_name' => ''),
+ array('teampage_position' => 7, 'group_id' => 4, 'teampage_parent' => 5, 'teampage_name' => ''),
+ array('teampage_position' => 8, 'group_id' => 6, 'teampage_parent' => 0, 'teampage_name' => ''),
+ ),
+ ),
+ array(
+ 6,
+ 1,
+ true,
+ array(
+ array('teampage_position' => 1, 'group_id' => 1, 'teampage_parent' => 0, 'teampage_name' => ''),
+ array('teampage_position' => 2, 'group_id' => 0, 'teampage_parent' => 0, 'teampage_name' => 'category - 2 children'),
+ array('teampage_position' => 3, 'group_id' => 2, 'teampage_parent' => 2, 'teampage_name' => ''),
+ array('teampage_position' => 4, 'group_id' => 3, 'teampage_parent' => 2, 'teampage_name' => ''),
+ array('teampage_position' => 5, 'group_id' => 6, 'teampage_parent' => 0, 'teampage_name' => ''),
+ array('teampage_position' => 6, 'group_id' => 0, 'teampage_parent' => 0, 'teampage_name' => 'category2 - 2 children'),
+ array('teampage_position' => 7, 'group_id' => 4, 'teampage_parent' => 5, 'teampage_name' => ''),
+ array('teampage_position' => 8, 'group_id' => 5, 'teampage_parent' => 5, 'teampage_name' => ''),
+ ),
+ ),
+ array(
+ 1,
+ -1,
+ true,
+ array(
+ array('teampage_position' => 1, 'group_id' => 0, 'teampage_parent' => 0, 'teampage_name' => 'category - 2 children'),
+ array('teampage_position' => 2, 'group_id' => 2, 'teampage_parent' => 2, 'teampage_name' => ''),
+ array('teampage_position' => 3, 'group_id' => 3, 'teampage_parent' => 2, 'teampage_name' => ''),
+ array('teampage_position' => 4, 'group_id' => 1, 'teampage_parent' => 0, 'teampage_name' => ''),
+ array('teampage_position' => 5, 'group_id' => 0, 'teampage_parent' => 0, 'teampage_name' => 'category2 - 2 children'),
+ array('teampage_position' => 6, 'group_id' => 4, 'teampage_parent' => 5, 'teampage_name' => ''),
+ array('teampage_position' => 7, 'group_id' => 5, 'teampage_parent' => 5, 'teampage_name' => ''),
+ array('teampage_position' => 8, 'group_id' => 6, 'teampage_parent' => 0, 'teampage_name' => ''),
+ ),
+ ),
+ array(
+ 2,
+ -1,
+ true,
+ array(
+ array('teampage_position' => 1, 'group_id' => 1, 'teampage_parent' => 0, 'teampage_name' => ''),
+ array('teampage_position' => 2, 'group_id' => 0, 'teampage_parent' => 0, 'teampage_name' => 'category - 2 children'),
+ array('teampage_position' => 3, 'group_id' => 3, 'teampage_parent' => 2, 'teampage_name' => ''),
+ array('teampage_position' => 4, 'group_id' => 2, 'teampage_parent' => 2, 'teampage_name' => ''),
+ array('teampage_position' => 5, 'group_id' => 0, 'teampage_parent' => 0, 'teampage_name' => 'category2 - 2 children'),
+ array('teampage_position' => 6, 'group_id' => 4, 'teampage_parent' => 5, 'teampage_name' => ''),
+ array('teampage_position' => 7, 'group_id' => 5, 'teampage_parent' => 5, 'teampage_name' => ''),
+ array('teampage_position' => 8, 'group_id' => 6, 'teampage_parent' => 0, 'teampage_name' => ''),
+ ),
+ ),
+ array(
+ 5,
+ -1,
+ false,
+ array(
+ array('teampage_position' => 1, 'group_id' => 1, 'teampage_parent' => 0, 'teampage_name' => ''),
+ array('teampage_position' => 2, 'group_id' => 0, 'teampage_parent' => 0, 'teampage_name' => 'category - 2 children'),
+ array('teampage_position' => 3, 'group_id' => 2, 'teampage_parent' => 2, 'teampage_name' => ''),
+ array('teampage_position' => 4, 'group_id' => 3, 'teampage_parent' => 2, 'teampage_name' => ''),
+ array('teampage_position' => 5, 'group_id' => 0, 'teampage_parent' => 0, 'teampage_name' => 'category2 - 2 children'),
+ array('teampage_position' => 6, 'group_id' => 4, 'teampage_parent' => 5, 'teampage_name' => ''),
+ array('teampage_position' => 7, 'group_id' => 5, 'teampage_parent' => 5, 'teampage_name' => ''),
+ array('teampage_position' => 8, 'group_id' => 6, 'teampage_parent' => 0, 'teampage_name' => ''),
+ ),
+ ),
+ array(
+ 6,
+ -1,
+ false,
+ array(
+ array('teampage_position' => 1, 'group_id' => 1, 'teampage_parent' => 0, 'teampage_name' => ''),
+ array('teampage_position' => 2, 'group_id' => 0, 'teampage_parent' => 0, 'teampage_name' => 'category - 2 children'),
+ array('teampage_position' => 3, 'group_id' => 2, 'teampage_parent' => 2, 'teampage_name' => ''),
+ array('teampage_position' => 4, 'group_id' => 3, 'teampage_parent' => 2, 'teampage_name' => ''),
+ array('teampage_position' => 5, 'group_id' => 0, 'teampage_parent' => 0, 'teampage_name' => 'category2 - 2 children'),
+ array('teampage_position' => 6, 'group_id' => 4, 'teampage_parent' => 5, 'teampage_name' => ''),
+ array('teampage_position' => 7, 'group_id' => 5, 'teampage_parent' => 5, 'teampage_name' => ''),
+ array('teampage_position' => 8, 'group_id' => 6, 'teampage_parent' => 0, 'teampage_name' => ''),
+ ),
+ ),
+ array(
+ 6,
+ 3,
+ true,
+ array(
+ array('teampage_position' => 1, 'group_id' => 6, 'teampage_parent' => 0, 'teampage_name' => ''),
+ array('teampage_position' => 2, 'group_id' => 1, 'teampage_parent' => 0, 'teampage_name' => ''),
+ array('teampage_position' => 3, 'group_id' => 0, 'teampage_parent' => 0, 'teampage_name' => 'category - 2 children'),
+ array('teampage_position' => 4, 'group_id' => 2, 'teampage_parent' => 2, 'teampage_name' => ''),
+ array('teampage_position' => 5, 'group_id' => 3, 'teampage_parent' => 2, 'teampage_name' => ''),
+ array('teampage_position' => 6, 'group_id' => 0, 'teampage_parent' => 0, 'teampage_name' => 'category2 - 2 children'),
+ array('teampage_position' => 7, 'group_id' => 4, 'teampage_parent' => 5, 'teampage_name' => ''),
+ array('teampage_position' => 8, 'group_id' => 5, 'teampage_parent' => 5, 'teampage_name' => ''),
+ ),
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider move_data
+ */
+ public function test_move($group_id, $move_delta, $excepted_moved, $expected)
+ {
+ global $cache;
+
+ $cache = new phpbb_mock_cache;
+ $db = $this->new_dbal();
+ $user = new \phpbb\user('\phpbb\datetime');
+ $user->lang = array();
+
+ $test_class = new \phpbb\groupposition\teampage($db, $user, $cache);
+ $this->assertEquals($excepted_moved, $test_class->move($group_id, $move_delta));
+
+ $result = $db->sql_query('SELECT teampage_position, group_id, teampage_parent, teampage_name
+ FROM ' . TEAMPAGE_TABLE . '
+ ORDER BY teampage_position ASC');
+
+ $this->assertEquals($expected, $db->sql_fetchrowset($result));
+ }
+
+ public function move_teampage_data()
+ {
+ return array(
+ array(
+ 1,
+ 1,
+ false,
+ array(
+ array('teampage_position' => 1, 'group_id' => 1, 'teampage_parent' => 0, 'teampage_name' => ''),
+ array('teampage_position' => 2, 'group_id' => 0, 'teampage_parent' => 0, 'teampage_name' => 'category - 2 children'),
+ array('teampage_position' => 3, 'group_id' => 2, 'teampage_parent' => 2, 'teampage_name' => ''),
+ array('teampage_position' => 4, 'group_id' => 3, 'teampage_parent' => 2, 'teampage_name' => ''),
+ array('teampage_position' => 5, 'group_id' => 0, 'teampage_parent' => 0, 'teampage_name' => 'category2 - 2 children'),
+ array('teampage_position' => 6, 'group_id' => 4, 'teampage_parent' => 5, 'teampage_name' => ''),
+ array('teampage_position' => 7, 'group_id' => 5, 'teampage_parent' => 5, 'teampage_name' => ''),
+ array('teampage_position' => 8, 'group_id' => 6, 'teampage_parent' => 0, 'teampage_name' => ''),
+ ),
+ ),
+ array(
+ 2,
+ 1,
+ true,
+ array(
+ array('teampage_position' => 1, 'group_id' => 0, 'teampage_parent' => 0, 'teampage_name' => 'category - 2 children'),
+ array('teampage_position' => 2, 'group_id' => 2, 'teampage_parent' => 2, 'teampage_name' => ''),
+ array('teampage_position' => 3, 'group_id' => 3, 'teampage_parent' => 2, 'teampage_name' => ''),
+ array('teampage_position' => 4, 'group_id' => 1, 'teampage_parent' => 0, 'teampage_name' => ''),
+ array('teampage_position' => 5, 'group_id' => 0, 'teampage_parent' => 0, 'teampage_name' => 'category2 - 2 children'),
+ array('teampage_position' => 6, 'group_id' => 4, 'teampage_parent' => 5, 'teampage_name' => ''),
+ array('teampage_position' => 7, 'group_id' => 5, 'teampage_parent' => 5, 'teampage_name' => ''),
+ array('teampage_position' => 8, 'group_id' => 6, 'teampage_parent' => 0, 'teampage_name' => ''),
+ ),
+ ),
+ array(
+ 5,
+ 1,
+ true,
+ array(
+ array('teampage_position' => 1, 'group_id' => 1, 'teampage_parent' => 0, 'teampage_name' => ''),
+ array('teampage_position' => 2, 'group_id' => 0, 'teampage_parent' => 0, 'teampage_name' => 'category2 - 2 children'),
+ array('teampage_position' => 3, 'group_id' => 4, 'teampage_parent' => 5, 'teampage_name' => ''),
+ array('teampage_position' => 4, 'group_id' => 5, 'teampage_parent' => 5, 'teampage_name' => ''),
+ array('teampage_position' => 5, 'group_id' => 0, 'teampage_parent' => 0, 'teampage_name' => 'category - 2 children'),
+ array('teampage_position' => 6, 'group_id' => 2, 'teampage_parent' => 2, 'teampage_name' => ''),
+ array('teampage_position' => 7, 'group_id' => 3, 'teampage_parent' => 2, 'teampage_name' => ''),
+ array('teampage_position' => 8, 'group_id' => 6, 'teampage_parent' => 0, 'teampage_name' => ''),
+ ),
+ ),
+ array(
+ 6,
+ 1,
+ false,
+ array(
+ array('teampage_position' => 1, 'group_id' => 1, 'teampage_parent' => 0, 'teampage_name' => ''),
+ array('teampage_position' => 2, 'group_id' => 0, 'teampage_parent' => 0, 'teampage_name' => 'category - 2 children'),
+ array('teampage_position' => 3, 'group_id' => 2, 'teampage_parent' => 2, 'teampage_name' => ''),
+ array('teampage_position' => 4, 'group_id' => 3, 'teampage_parent' => 2, 'teampage_name' => ''),
+ array('teampage_position' => 5, 'group_id' => 0, 'teampage_parent' => 0, 'teampage_name' => 'category2 - 2 children'),
+ array('teampage_position' => 6, 'group_id' => 4, 'teampage_parent' => 5, 'teampage_name' => ''),
+ array('teampage_position' => 7, 'group_id' => 5, 'teampage_parent' => 5, 'teampage_name' => ''),
+ array('teampage_position' => 8, 'group_id' => 6, 'teampage_parent' => 0, 'teampage_name' => ''),
+ ),
+ ),
+ array(
+ 1,
+ -1,
+ true,
+ array(
+ array('teampage_position' => 1, 'group_id' => 0, 'teampage_parent' => 0, 'teampage_name' => 'category - 2 children'),
+ array('teampage_position' => 2, 'group_id' => 2, 'teampage_parent' => 2, 'teampage_name' => ''),
+ array('teampage_position' => 3, 'group_id' => 3, 'teampage_parent' => 2, 'teampage_name' => ''),
+ array('teampage_position' => 4, 'group_id' => 1, 'teampage_parent' => 0, 'teampage_name' => ''),
+ array('teampage_position' => 5, 'group_id' => 0, 'teampage_parent' => 0, 'teampage_name' => 'category2 - 2 children'),
+ array('teampage_position' => 6, 'group_id' => 4, 'teampage_parent' => 5, 'teampage_name' => ''),
+ array('teampage_position' => 7, 'group_id' => 5, 'teampage_parent' => 5, 'teampage_name' => ''),
+ array('teampage_position' => 8, 'group_id' => 6, 'teampage_parent' => 0, 'teampage_name' => ''),
+ ),
+ ),
+ array(
+ 2,
+ -1,
+ true,
+ array(
+ array('teampage_position' => 1, 'group_id' => 1, 'teampage_parent' => 0, 'teampage_name' => ''),
+ array('teampage_position' => 2, 'group_id' => 0, 'teampage_parent' => 0, 'teampage_name' => 'category2 - 2 children'),
+ array('teampage_position' => 3, 'group_id' => 4, 'teampage_parent' => 5, 'teampage_name' => ''),
+ array('teampage_position' => 4, 'group_id' => 5, 'teampage_parent' => 5, 'teampage_name' => ''),
+ array('teampage_position' => 5, 'group_id' => 0, 'teampage_parent' => 0, 'teampage_name' => 'category - 2 children'),
+ array('teampage_position' => 6, 'group_id' => 2, 'teampage_parent' => 2, 'teampage_name' => ''),
+ array('teampage_position' => 7, 'group_id' => 3, 'teampage_parent' => 2, 'teampage_name' => ''),
+ array('teampage_position' => 8, 'group_id' => 6, 'teampage_parent' => 0, 'teampage_name' => ''),
+ ),
+ ),
+ array(
+ 5,
+ -1,
+ true,
+ array(
+ array('teampage_position' => 1, 'group_id' => 1, 'teampage_parent' => 0, 'teampage_name' => ''),
+ array('teampage_position' => 2, 'group_id' => 0, 'teampage_parent' => 0, 'teampage_name' => 'category - 2 children'),
+ array('teampage_position' => 3, 'group_id' => 2, 'teampage_parent' => 2, 'teampage_name' => ''),
+ array('teampage_position' => 4, 'group_id' => 3, 'teampage_parent' => 2, 'teampage_name' => ''),
+ array('teampage_position' => 5, 'group_id' => 6, 'teampage_parent' => 0, 'teampage_name' => ''),
+ array('teampage_position' => 6, 'group_id' => 0, 'teampage_parent' => 0, 'teampage_name' => 'category2 - 2 children'),
+ array('teampage_position' => 7, 'group_id' => 4, 'teampage_parent' => 5, 'teampage_name' => ''),
+ array('teampage_position' => 8, 'group_id' => 5, 'teampage_parent' => 5, 'teampage_name' => ''),
+ ),
+ ),
+ array(
+ 6,
+ -1,
+ true,
+ array(
+ array('teampage_position' => 1, 'group_id' => 1, 'teampage_parent' => 0, 'teampage_name' => ''),
+ array('teampage_position' => 2, 'group_id' => 0, 'teampage_parent' => 0, 'teampage_name' => 'category - 2 children'),
+ array('teampage_position' => 3, 'group_id' => 2, 'teampage_parent' => 2, 'teampage_name' => ''),
+ array('teampage_position' => 4, 'group_id' => 3, 'teampage_parent' => 2, 'teampage_name' => ''),
+ array('teampage_position' => 5, 'group_id' => 0, 'teampage_parent' => 0, 'teampage_name' => 'category2 - 2 children'),
+ array('teampage_position' => 6, 'group_id' => 5, 'teampage_parent' => 5, 'teampage_name' => ''),
+ array('teampage_position' => 7, 'group_id' => 4, 'teampage_parent' => 5, 'teampage_name' => ''),
+ array('teampage_position' => 8, 'group_id' => 6, 'teampage_parent' => 0, 'teampage_name' => ''),
+ ),
+ ),
+ array(
+ 8,
+ 3,
+ true,
+ array(
+ array('teampage_position' => 1, 'group_id' => 6, 'teampage_parent' => 0, 'teampage_name' => ''),
+ array('teampage_position' => 2, 'group_id' => 1, 'teampage_parent' => 0, 'teampage_name' => ''),
+ array('teampage_position' => 3, 'group_id' => 0, 'teampage_parent' => 0, 'teampage_name' => 'category - 2 children'),
+ array('teampage_position' => 4, 'group_id' => 2, 'teampage_parent' => 2, 'teampage_name' => ''),
+ array('teampage_position' => 5, 'group_id' => 3, 'teampage_parent' => 2, 'teampage_name' => ''),
+ array('teampage_position' => 6, 'group_id' => 0, 'teampage_parent' => 0, 'teampage_name' => 'category2 - 2 children'),
+ array('teampage_position' => 7, 'group_id' => 4, 'teampage_parent' => 5, 'teampage_name' => ''),
+ array('teampage_position' => 8, 'group_id' => 5, 'teampage_parent' => 5, 'teampage_name' => ''),
+ ),
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider move_teampage_data
+ */
+ public function test_move_teampage($teampage_id, $move_delta, $excepted_moved, $expected)
+ {
+ global $cache;
+
+ $cache = new phpbb_mock_cache;
+ $db = $this->new_dbal();
+ $user = new \phpbb\user('\phpbb\datetime');
+ $user->lang = array();
+
+ $test_class = new \phpbb\groupposition\teampage($db, $user, $cache);
+ $this->assertEquals($excepted_moved, $test_class->move_teampage($teampage_id, $move_delta));
+
+ $result = $db->sql_query('SELECT teampage_position, group_id, teampage_parent, teampage_name
+ FROM ' . TEAMPAGE_TABLE . '
+ ORDER BY teampage_position ASC');
+
+ $this->assertEquals($expected, $db->sql_fetchrowset($result));
+ }
+}
+
diff --git a/tests/lint_test.php b/tests/lint_test.php
index b0149063bd..70046bdfd2 100644
--- a/tests/lint_test.php
+++ b/tests/lint_test.php
@@ -1,9 +1,13 @@
<?php
/**
*
-* @package testing
-* @copyright (c) 2012 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -34,31 +38,34 @@ class phpbb_lint_test extends phpbb_test_case
self::markTestSkipped(sprintf('Could not run PHP_BINARY %s. Output: %s', self::$php_binary, $output));
}
}
-
- self::$exclude = array(
- dirname(__FILE__) . '/../.git',
- dirname(__FILE__) . '/../build/new_version',
- dirname(__FILE__) . '/../build/old_versions',
- dirname(__FILE__) . '/../phpBB/cache',
- // PHP Fatal error: Cannot declare class Container because the name is already in use in /var/www/projects/phpbb3/tests/../phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services1-1.php on line 20
- // https://gist.github.com/e003913ffd493da63cbc
- dirname(__FILE__) . '/../phpBB/vendor',
- );
}
- public function test_lint()
+ /**
+ * @dataProvider lint_data
+ */
+ public function test_lint($path)
{
if (version_compare(PHP_VERSION, '5.3.0', '<'))
{
$this->markTestSkipped('phpBB uses PHP 5.3 syntax in some files, linting on PHP < 5.3 will fail');
}
- $root = dirname(__FILE__) . '/..';
- $this->check($root);
+ $cmd = sprintf('(%s -l %s) 2>&1', self::$php_binary, escapeshellarg($path));
+ $output = array();
+ $status = 1;
+ exec($cmd, $output, $status);
+ $output = implode("\n", $output);
+ $this->assertEquals(0, $status, "PHP lint failed for $path:\n$output");
+ }
+
+ public function lint_data()
+ {
+ return $this->check(dirname(__FILE__) . '/..');
}
protected function check($root)
{
+ $files = array();
$dh = opendir($root);
while (($filename = readdir($dh)) !== false)
{
@@ -72,19 +79,25 @@ class phpbb_lint_test extends phpbb_test_case
{
continue;
}
- if (is_dir($path) && !in_array($path, self::$exclude))
+ if (is_dir($path) && !in_array($path, array(
+ dirname(__FILE__) . '/../.git',
+ dirname(__FILE__) . '/../build/new_version',
+ dirname(__FILE__) . '/../build/old_versions',
+ dirname(__FILE__) . '/../phpBB/cache',
+ dirname(__FILE__) . '/../phpBB/ext',
+ dirname(__FILE__) . '/../phpBB/store',
+ // PHP Fatal error: Cannot declare class Container because the name is already in use in /var/www/projects/phpbb3/tests/../phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services1-1.php on line 20
+ // https://gist.github.com/e003913ffd493da63cbc
+ dirname(__FILE__) . '/../phpBB/vendor',
+ )))
{
- $this->check($path);
+ $files = array_merge($files, $this->check($path));
}
else if (substr($filename, strlen($filename)-4) == '.php')
{
- $cmd = sprintf('(%s -l %s) 2>&1', self::$php_binary, escapeshellarg($path));
- $output = array();
- $status = 1;
- exec($cmd, $output, $status);
- $output = implode("\n", $output);
- $this->assertEquals(0, $status, "PHP lint failed for $path:\n$output");
+ $files[] = array($path);
}
}
+ return $files;
}
}
diff --git a/tests/lock/db_test.php b/tests/lock/db_test.php
new file mode 100644
index 0000000000..6fc813cb38
--- /dev/null
+++ b/tests/lock/db_test.php
@@ -0,0 +1,101 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
+
+class phpbb_lock_db_test extends phpbb_database_test_case
+{
+ private $db;
+ private $config;
+ private $lock;
+
+ public function getDataSet()
+ {
+ return $this->createXMLDataSet(dirname(__FILE__).'/fixtures/config.xml');
+ }
+
+ public function setUp()
+ {
+ global $db, $config;
+
+ $db = $this->db = $this->new_dbal();
+ $config = $this->config = new \phpbb\config\config(array('rand_seed' => '', 'rand_seed_last_update' => '0'));
+ set_config(null, null, null, $this->config);
+ $this->lock = new \phpbb\lock\db('test_lock', $this->config, $this->db);
+ }
+
+ public function test_new_lock()
+ {
+ $this->assertFalse($this->lock->owns_lock());
+
+ $this->assertTrue($this->lock->acquire());
+ $this->assertTrue($this->lock->owns_lock());
+ $this->assertTrue(isset($this->config['test_lock']), 'Lock was created');
+
+ $lock2 = new \phpbb\lock\db('test_lock', $this->config, $this->db);
+ $this->assertFalse($lock2->acquire());
+ $this->assertFalse($lock2->owns_lock());
+
+ $this->lock->release();
+ $this->assertFalse($this->lock->owns_lock());
+ $this->assertEquals('0', $this->config['test_lock'], 'Lock was released');
+ }
+
+ public function test_expire_lock()
+ {
+ $lock = new \phpbb\lock\db('foo_lock', $this->config, $this->db);
+ $this->assertTrue($lock->acquire());
+ }
+
+ public function test_double_lock()
+ {
+ $this->assertFalse($this->lock->owns_lock());
+
+ $this->assertTrue($this->lock->acquire());
+ $this->assertTrue($this->lock->owns_lock());
+ $this->assertTrue(isset($this->config['test_lock']), 'Lock was created');
+
+ $value = $this->config['test_lock'];
+
+ $this->assertFalse($this->lock->acquire());
+ $this->assertTrue($this->lock->owns_lock());
+ $this->assertEquals($value, $this->config['test_lock'], 'Second lock failed');
+
+ $this->lock->release();
+ $this->assertFalse($this->lock->owns_lock());
+ $this->assertEquals('0', $this->config['test_lock'], 'Lock was released');
+ }
+
+ public function test_double_unlock()
+ {
+ $this->assertTrue($this->lock->acquire());
+ $this->assertTrue($this->lock->owns_lock());
+ $this->assertFalse(empty($this->config['test_lock']), 'First lock is acquired');
+
+ $this->lock->release();
+ $this->assertFalse($this->lock->owns_lock());
+ $this->assertEquals('0', $this->config['test_lock'], 'First lock is released');
+
+ $lock2 = new \phpbb\lock\db('test_lock', $this->config, $this->db);
+ $this->assertTrue($lock2->acquire());
+ $this->assertTrue($lock2->owns_lock());
+ $this->assertFalse(empty($this->config['test_lock']), 'Second lock is acquired');
+
+ $this->lock->release();
+ $this->assertTrue($lock2->owns_lock());
+ $this->assertFalse(empty($this->config['test_lock']), 'Double release of first lock is ignored');
+
+ $lock2->release();
+ $this->assertEquals('0', $this->config['test_lock'], 'Second lock is released');
+ }
+}
diff --git a/tests/lock/fixtures/config.xml b/tests/lock/fixtures/config.xml
new file mode 100644
index 0000000000..f36c8b929a
--- /dev/null
+++ b/tests/lock/fixtures/config.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<dataset>
+ <table name="phpbb_config">
+ <column>config_name</column>
+ <column>config_value</column>
+ <column>is_dynamic</column>
+ <row>
+ <value>foo_lock</value>
+ <value>1 abcd</value>
+ <value>1</value>
+ </row>
+ </table>
+</dataset>
diff --git a/tests/lock/flock_test.php b/tests/lock/flock_test.php
new file mode 100644
index 0000000000..554b7e57f4
--- /dev/null
+++ b/tests/lock/flock_test.php
@@ -0,0 +1,124 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+class phpbb_lock_flock_test extends phpbb_test_case
+{
+ public function test_lock()
+ {
+ $path = __DIR__ . '/../tmp/precious';
+
+ $lock = new \phpbb\lock\flock($path);
+ $ok = $lock->acquire();
+ $this->assertTrue($ok);
+ $lock->release();
+ }
+
+ public function test_consecutive_locking()
+ {
+ $path = __DIR__ . '/../tmp/precious';
+
+ $lock = new \phpbb\lock\flock($path);
+ $ok = $lock->acquire();
+ $this->assertTrue($ok);
+ $this->assertTrue($lock->owns_lock());
+ $lock->release();
+ $this->assertFalse($lock->owns_lock());
+
+ $ok = $lock->acquire();
+ $this->assertTrue($ok);
+ $this->assertTrue($lock->owns_lock());
+ $lock->release();
+ $this->assertFalse($lock->owns_lock());
+
+ $ok = $lock->acquire();
+ $this->assertTrue($ok);
+ $this->assertTrue($lock->owns_lock());
+ $lock->release();
+ $this->assertFalse($lock->owns_lock());
+ }
+
+ /* This hangs the process.
+ public function test_concurrent_locking_fail()
+ {
+ $path = __DIR__ . '/../tmp/precious';
+
+ $lock1 = new \phpbb\lock\flock($path);
+ $ok = $lock1->acquire();
+ $this->assertTrue($ok);
+
+ $lock2 = new \phpbb\lock\flock($path);
+ $ok = $lock2->acquire();
+ $this->assertFalse($ok);
+
+ $lock->release();
+ $ok = $lock2->acquire();
+ $this->assertTrue($ok);
+ }
+ */
+
+ public function test_concurrent_locking()
+ {
+ if (!function_exists('pcntl_fork'))
+ {
+ $this->markTestSkipped('pcntl extension and pcntl_fork are required for this test');
+ }
+
+ $path = __DIR__ . '/../tmp/precious';
+
+ $pid = pcntl_fork();
+ if ($pid)
+ {
+ // parent
+ // wait 0.5 s, acquire the lock, note how long it took
+ sleep(1);
+
+ $lock = new \phpbb\lock\flock($path);
+ $start = microtime(true);
+ $ok = $lock->acquire();
+ $delta = microtime(true) - $start;
+ $this->assertTrue($ok);
+ $this->assertTrue($lock->owns_lock());
+ $this->assertGreaterThan(0.5, $delta, 'First lock acquired too soon');
+
+ $lock->release();
+ $this->assertFalse($lock->owns_lock());
+
+ // acquire again, this should be instantaneous
+ $start = microtime(true);
+ $ok = $lock->acquire();
+ $delta = microtime(true) - $start;
+ $this->assertTrue($ok);
+ $this->assertTrue($lock->owns_lock());
+ $this->assertLessThan(0.1, $delta, 'Second lock not acquired instantaneously');
+
+ // reap the child
+ $status = null;
+ pcntl_waitpid($pid, $status);
+ }
+ else
+ {
+ // child
+ // immediately acquire the lock and sleep for 2 s
+ $lock = new \phpbb\lock\flock($path);
+ $ok = $lock->acquire();
+ $this->assertTrue($ok);
+ $this->assertTrue($lock->owns_lock());
+ sleep(2);
+ $lock->release();
+ $this->assertFalse($lock->owns_lock());
+
+ // and go away silently
+ pcntl_exec('/usr/bin/env', array('true'));
+ }
+ }
+}
diff --git a/tests/log/add_test.php b/tests/log/add_test.php
new file mode 100644
index 0000000000..29d3adaeb6
--- /dev/null
+++ b/tests/log/add_test.php
@@ -0,0 +1,101 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
+
+class phpbb_log_add_test extends phpbb_database_test_case
+{
+ public function getDataSet()
+ {
+ return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/empty_log.xml');
+ }
+
+ public function test_log_enabled()
+ {
+ global $phpbb_root_path, $phpEx, $db, $phpbb_dispatcher;
+
+ $db = $this->new_dbal();
+ $cache = new phpbb_mock_cache;
+ $phpbb_dispatcher = new phpbb_mock_event_dispatcher();
+ $user = new \phpbb\user('\phpbb\datetime');
+ $auth = $this->getMock('\phpbb\auth\auth');
+
+ $log = new \phpbb\log\log($db, $user, $auth, $phpbb_dispatcher, $phpbb_root_path, 'adm/', $phpEx, LOG_TABLE);
+
+ $this->assertTrue($log->is_enabled(), 'Initialise failed');
+
+ $log->disable();
+ $this->assertFalse($log->is_enabled(), 'Disable all failed');
+
+ $log->enable();
+ $this->assertTrue($log->is_enabled(), 'Enable all failed');
+
+ $log->disable('admin');
+ $this->assertFalse($log->is_enabled('admin'), 'Disable admin failed');
+ $this->assertTrue($log->is_enabled('user'), 'User should be enabled, is disabled');
+ $this->assertTrue($log->is_enabled(), 'Disable admin disabled all');
+
+ $log->enable('admin');
+ $this->assertTrue($log->is_enabled('admin'), 'Enable admin failed');
+ }
+
+ public function test_log_add()
+ {
+ global $phpbb_root_path, $phpEx, $db, $phpbb_dispatcher;
+
+ $db = $this->new_dbal();
+ $cache = new phpbb_mock_cache;
+ $phpbb_dispatcher = new phpbb_mock_event_dispatcher();
+ $user = new \phpbb\user('\phpbb\datetime');
+ $auth = $this->getMock('\phpbb\auth\auth');
+
+ $log = new \phpbb\log\log($db, $user, $auth, $phpbb_dispatcher, $phpbb_root_path, 'adm/', $phpEx, LOG_TABLE);
+
+ $mode = 'critical';
+ $user_id = ANONYMOUS;
+ $log_ip = 'user_ip';
+ $log_time = time();
+ $log_operation = 'LOG_OPERATION';
+ $additional_data = array();
+
+ // Add an entry successful
+ $this->assertEquals(1, $log->add($mode, $user_id, $log_ip, $log_operation, $log_time));
+
+ // Disable logging for all types
+ $log->disable();
+ $this->assertFalse($log->add($mode, $user_id, $log_ip, $log_operation, $log_time), 'Disable for all types failed');
+ $log->enable();
+
+ // Disable logging for same type
+ $log->disable('critical');
+ $this->assertFalse($log->add($mode, $user_id, $log_ip, $log_operation, $log_time), 'Disable for same type failed');
+ $log->enable();
+
+ // Disable logging for different type
+ $log->disable('admin');
+ $this->assertEquals(2, $log->add($mode, $user_id, $log_ip, $log_operation, $log_time), 'Disable for different types failed');
+ $log->enable();
+
+ // Invalid mode specified
+ $this->assertFalse($log->add('mode_does_not_exist', $user_id, $log_ip, $log_operation, $log_time));
+
+ // null user and null ip given
+ $this->assertEquals(3, $log->add($mode, null, null, $log_operation, $log_time), 'Adding log with null user_id and null user_ip failed');
+ $sql = 'SELECT user_id, log_ip FROM ' . LOG_TABLE . ' WHERE log_id = 3';
+ $result = $db->sql_query($sql);
+ $row = $db->sql_fetchrow($result);
+ $db->sql_freeresult($result);
+ $this->assertEquals(ANONYMOUS, $row['user_id'], 'Adding log with null user_id failed');
+ $this->assertEquals('', $row['log_ip'], 'Adding log with null user_ip failed');
+ }
+}
diff --git a/tests/log/delete_test.php b/tests/log/delete_test.php
new file mode 100644
index 0000000000..ec43182a0c
--- /dev/null
+++ b/tests/log/delete_test.php
@@ -0,0 +1,157 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions_content.php';
+require_once dirname(__FILE__) . '/../../phpBB/includes/utf/utf_tools.php';
+
+class phpbb_log_delete_test extends phpbb_database_test_case
+{
+ protected $log;
+
+ public function getDataSet()
+ {
+ return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/delete_log.xml');
+ }
+
+ protected function setUp()
+ {
+ global $phpbb_root_path, $phpEx, $db, $phpbb_dispatcher, $auth;
+
+ $db = $this->new_dbal();
+ $phpbb_dispatcher = new phpbb_mock_event_dispatcher();
+ $user = new \phpbb\user('\phpbb\datetime');
+ $user->data['user_id'] = 1;
+ $auth = $this->getMock('\phpbb\auth\auth');
+
+ $this->log = new \phpbb\log\log($db, $user, $auth, $phpbb_dispatcher, $phpbb_root_path, 'adm/', $phpEx, LOG_TABLE);
+
+ parent::setUp();
+ }
+
+ public function log_delete_data()
+ {
+ return array(
+ array(
+ array(1, 2),
+ array(16),
+ array(),
+ 'admin',
+ false,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 'l.log_id ASC',
+ '',
+ ),
+ array(
+ array(11),
+ array(),
+ array('keywords' => 'guest'),
+ 'mod',
+ false,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 'l.log_id ASC',
+ 'guest',
+ ),
+ array(
+ array(4, 5, 7),
+ array(),
+ array('forum_id' => 12, 'user_id' => 1),
+ 'mod',
+ false,
+ 0,
+ 0,
+ 12,
+ 0,
+ 1,
+ 0,
+ 'l.log_id ASC',
+ '',
+ ),
+ array(
+ array(12, 13),
+ array(),
+ array('forum_id' => array('IN' => array(14, 13))),
+ 'mod',
+ false,
+ 0,
+ 0,
+ array(13, 14),
+ 0,
+ 0,
+ 0,
+ 'l.log_id ASC',
+ '',
+ ),
+ array(
+ array(3, 14, 15),
+ array(3),
+ array('user_id' => array('>', 1)),
+ 'critical',
+ false,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 'l.log_id ASC',
+ '',
+ ),
+ array(
+ array(3, 14, 15),
+ array(),
+ array('keywords' => ''),
+ 'critical',
+ false,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 'l.log_id ASC',
+ '',
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider log_delete_data
+ */
+ public function test_log_delete($expected_before, $expected_after, $delete_conditions, $mode, $count_logs, $limit, $offset, $forum_id, $topic_id, $user_id, $log_time, $sort_by, $keywords)
+ {
+ $this->assertSame($expected_before, $this->get_ids($this->log->get_logs($mode, $count_logs, $limit, $offset, $forum_id, $topic_id, $user_id, $log_time, $sort_by, $keywords)), 'before');
+ $this->log->delete($mode, $delete_conditions);
+ $this->assertSame($expected_after, $this->get_ids($this->log->get_logs($mode, $count_logs, $limit, $offset, $forum_id, $topic_id, $user_id, $log_time, $sort_by, $keywords)), 'after');
+ }
+
+ public function get_ids($logs)
+ {
+ $ids = array();
+ foreach ($logs as $log_entry)
+ {
+ $ids[] = (int) $log_entry['id'];
+ }
+ return $ids;
+ }
+}
diff --git a/tests/log/fixtures/delete_log.xml b/tests/log/fixtures/delete_log.xml
new file mode 100644
index 0000000000..4b2402102e
--- /dev/null
+++ b/tests/log/fixtures/delete_log.xml
@@ -0,0 +1,232 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<dataset>
+ <table name="phpbb_log">
+ <column>log_id</column>
+ <column>log_type</column>
+ <column>user_id</column>
+ <column>forum_id</column>
+ <column>topic_id</column>
+ <column>reportee_id</column>
+ <column>log_ip</column>
+ <column>log_time</column>
+ <column>log_operation</column>
+ <column>log_data</column>
+ <row>
+ <value>1</value>
+ <value>0</value>
+ <value>1</value>
+ <value>0</value>
+ <value>0</value>
+ <value>0</value>
+ <value>127.0.0.1</value>
+ <value>1</value>
+ <value>LOG_INSTALL_INSTALLED</value>
+ <value>a:1:{i:0;s:9:"3.1.0-dev";}</value>
+ </row>
+ <row>
+ <value>2</value>
+ <value>0</value>
+ <value>1</value>
+ <value>0</value>
+ <value>0</value>
+ <value>0</value>
+ <value>127.0.0.1</value>
+ <value>1</value>
+ <value>LOG_KEY_NOT_EXISTS</value>
+ <value>a:1:{i:0;s:15:"additional_data";}</value>
+ </row>
+ <row>
+ <value>3</value>
+ <value>2</value>
+ <value>1</value>
+ <value>0</value>
+ <value>0</value>
+ <value>0</value>
+ <value>127.0.0.1</value>
+ <value>1</value>
+ <value>LOG_CRITICAL</value>
+ <value>a:1:{i:0;s:13:"critical data";}</value>
+ </row>
+ <row>
+ <value>4</value>
+ <value>1</value>
+ <value>1</value>
+ <value>12</value>
+ <value>34</value>
+ <value>0</value>
+ <value>127.0.0.1</value>
+ <value>1</value>
+ <value>LOG_MOD</value>
+ <value></value>
+ </row>
+ <row>
+ <value>5</value>
+ <value>1</value>
+ <value>1</value>
+ <value>12</value>
+ <value>45</value>
+ <value>0</value>
+ <value>127.0.0.1</value>
+ <value>1</value>
+ <value>LOG_MOD</value>
+ <value></value>
+ </row>
+ <row>
+ <value>6</value>
+ <value>1</value>
+ <value>1</value>
+ <value>23</value>
+ <value>56</value>
+ <value>0</value>
+ <value>127.0.0.1</value>
+ <value>1</value>
+ <value>LOG_MOD</value>
+ <value></value>
+ </row>
+ <row>
+ <value>7</value>
+ <value>1</value>
+ <value>1</value>
+ <value>12</value>
+ <value>45</value>
+ <value>0</value>
+ <value>127.0.0.1</value>
+ <value>1</value>
+ <value>LOG_MOD2</value>
+ <value></value>
+ </row>
+ <row>
+ <value>8</value>
+ <value>3</value>
+ <value>1</value>
+ <value>0</value>
+ <value>0</value>
+ <value>2</value>
+ <value>127.0.0.1</value>
+ <value>1</value>
+ <value>LOG_USER</value>
+ <value>a:1:{i:0;s:5:"admin";}</value>
+ </row>
+ <row>
+ <value>9</value>
+ <value>3</value>
+ <value>1</value>
+ <value>0</value>
+ <value>0</value>
+ <value>1</value>
+ <value>127.0.0.1</value>
+ <value>1</value>
+ <value>LOG_USER</value>
+ <value>a:1:{i:0;s:5:"guest";}</value>
+ </row>
+ <row>
+ <value>10</value>
+ <value>3</value>
+ <value>1</value>
+ <value>0</value>
+ <value>0</value>
+ <value>0</value>
+ <value>127.0.0.1</value>
+ <value>1</value>
+ <value>LOG_SINGULAR_PLURAL</value>
+ <value>a:1:{i:0;i:2;}</value>
+ </row>
+ <row>
+ <value>11</value>
+ <value>1</value>
+ <value>1</value>
+ <value>15</value>
+ <value>3</value>
+ <value>0</value>
+ <value>127.0.0.1</value>
+ <value>1</value>
+ <value>LOG_MOD3</value>
+ <value>a:1:{i:0;s:5:"guest";}</value>
+ </row>
+ <row>
+ <value>12</value>
+ <value>1</value>
+ <value>1</value>
+ <value>13</value>
+ <value>0</value>
+ <value>0</value>
+ <value>127.0.0.1</value>
+ <value>1</value>
+ <value></value>
+ <value></value>
+ </row>
+ <row>
+ <value>13</value>
+ <value>1</value>
+ <value>1</value>
+ <value>14</value>
+ <value>0</value>
+ <value>0</value>
+ <value>127.0.0.1</value>
+ <value>1</value>
+ <value></value>
+ <value></value>
+ </row>
+ <row>
+ <value>14</value>
+ <value>2</value>
+ <value>2</value>
+ <value>0</value>
+ <value>0</value>
+ <value>0</value>
+ <value>127.0.0.1</value>
+ <value>1</value>
+ <value></value>
+ <value></value>
+ </row>
+ <row>
+ <value>15</value>
+ <value>2</value>
+ <value>2</value>
+ <value>0</value>
+ <value>0</value>
+ <value>0</value>
+ <value>127.0.0.1</value>
+ <value>1</value>
+ <value></value>
+ <value></value>
+ </row>
+ </table>
+ <table name="phpbb_users">
+ <column>user_id</column>
+ <column>username</column>
+ <column>username_clean</column>
+ <column>user_permissions</column>
+ <column>user_sig</column>
+ <row>
+ <value>1</value>
+ <value>Anonymous</value>
+ <value>Anonymous</value>
+ <value></value>
+ <value></value>
+ </row>
+ <row>
+ <value>2</value>
+ <value>admin</value>
+ <value>admin</value>
+ <value></value>
+ <value></value>
+ </row>
+ </table>
+ <table name="phpbb_topics">
+ <column>topic_id</column>
+ <column>forum_id</column>
+ <row>
+ <value>34</value>
+ <value>12</value>
+ </row>
+ <row>
+ <value>45</value>
+ <value>12</value>
+ </row>
+ <row>
+ <value>56</value>
+ <value>23</value>
+ </row>
+ </table>
+</dataset>
diff --git a/tests/log/fixtures/empty_log.xml b/tests/log/fixtures/empty_log.xml
new file mode 100644
index 0000000000..261b6a622a
--- /dev/null
+++ b/tests/log/fixtures/empty_log.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<dataset>
+ <table name="phpbb_log">
+ <column>log_id</column>
+ <column>log_type</column>
+ <column>user_id</column>
+ <column>forum_id</column>
+ <column>topic_id</column>
+ <column>reportee_id</column>
+ <column>log_ip</column>
+ <column>log_time</column>
+ <column>log_operation</column>
+ <column>log_data</column>
+ </table>
+</dataset>
diff --git a/tests/log/fixtures/full_log.xml b/tests/log/fixtures/full_log.xml
new file mode 100644
index 0000000000..ef35884444
--- /dev/null
+++ b/tests/log/fixtures/full_log.xml
@@ -0,0 +1,184 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<dataset>
+ <table name="phpbb_log">
+ <column>log_id</column>
+ <column>log_type</column>
+ <column>user_id</column>
+ <column>forum_id</column>
+ <column>topic_id</column>
+ <column>reportee_id</column>
+ <column>log_ip</column>
+ <column>log_time</column>
+ <column>log_operation</column>
+ <column>log_data</column>
+ <row>
+ <value>1</value>
+ <value>0</value>
+ <value>1</value>
+ <value>0</value>
+ <value>0</value>
+ <value>0</value>
+ <value>127.0.0.1</value>
+ <value>1</value>
+ <value>LOG_INSTALL_INSTALLED</value>
+ <value>a:1:{i:0;s:9:"3.1.0-dev";}</value>
+ </row>
+ <row>
+ <value>2</value>
+ <value>0</value>
+ <value>1</value>
+ <value>0</value>
+ <value>0</value>
+ <value>0</value>
+ <value>127.0.0.1</value>
+ <value>1</value>
+ <value>LOG_KEY_NOT_EXISTS</value>
+ <value>a:1:{i:0;s:15:"additional_data";}</value>
+ </row>
+ <row>
+ <value>3</value>
+ <value>2</value>
+ <value>1</value>
+ <value>0</value>
+ <value>0</value>
+ <value>0</value>
+ <value>127.0.0.1</value>
+ <value>1</value>
+ <value>LOG_CRITICAL</value>
+ <value>a:1:{i:0;s:13:"critical data";}</value>
+ </row>
+ <row>
+ <value>4</value>
+ <value>1</value>
+ <value>1</value>
+ <value>12</value>
+ <value>34</value>
+ <value>0</value>
+ <value>127.0.0.1</value>
+ <value>1</value>
+ <value>LOG_MOD</value>
+ <value></value>
+ </row>
+ <row>
+ <value>5</value>
+ <value>1</value>
+ <value>1</value>
+ <value>12</value>
+ <value>45</value>
+ <value>0</value>
+ <value>127.0.0.1</value>
+ <value>1</value>
+ <value>LOG_MOD</value>
+ <value></value>
+ </row>
+ <row>
+ <value>6</value>
+ <value>1</value>
+ <value>1</value>
+ <value>23</value>
+ <value>56</value>
+ <value>0</value>
+ <value>127.0.0.1</value>
+ <value>1</value>
+ <value>LOG_MOD</value>
+ <value></value>
+ </row>
+ <row>
+ <value>7</value>
+ <value>1</value>
+ <value>1</value>
+ <value>12</value>
+ <value>45</value>
+ <value>0</value>
+ <value>127.0.0.1</value>
+ <value>1</value>
+ <value>LOG_MOD2</value>
+ <value></value>
+ </row>
+ <row>
+ <value>8</value>
+ <value>3</value>
+ <value>1</value>
+ <value>0</value>
+ <value>0</value>
+ <value>2</value>
+ <value>127.0.0.1</value>
+ <value>1</value>
+ <value>LOG_USER</value>
+ <value>a:1:{i:0;s:5:"admin";}</value>
+ </row>
+ <row>
+ <value>9</value>
+ <value>3</value>
+ <value>1</value>
+ <value>0</value>
+ <value>0</value>
+ <value>1</value>
+ <value>127.0.0.1</value>
+ <value>1</value>
+ <value>LOG_USER</value>
+ <value>a:1:{i:0;s:5:"guest";}</value>
+ </row>
+ <row>
+ <value>10</value>
+ <value>3</value>
+ <value>1</value>
+ <value>0</value>
+ <value>0</value>
+ <value>0</value>
+ <value>127.0.0.1</value>
+ <value>1</value>
+ <value>LOG_SINGULAR_PLURAL</value>
+ <value>a:1:{i:0;i:2;}</value>
+ </row>
+ <row>
+ <value>11</value>
+ <value>1</value>
+ <value>1</value>
+ <value>15</value>
+ <value>3</value>
+ <value>0</value>
+ <value>127.0.0.1</value>
+ <value>1</value>
+ <value>LOG_MOD3</value>
+ <value>a:1:{i:0;s:5:"guest";}</value>
+ </row>
+ </table>
+ <table name="phpbb_users">
+ <column>user_id</column>
+ <column>username</column>
+ <column>username_clean</column>
+ <column>user_permissions</column>
+ <column>user_sig</column>
+ <row>
+ <value>1</value>
+ <value>Anonymous</value>
+ <value>Anonymous</value>
+ <value></value>
+ <value></value>
+ </row>
+ <row>
+ <value>2</value>
+ <value>admin</value>
+ <value>admin</value>
+ <value></value>
+ <value></value>
+ </row>
+ </table>
+ <table name="phpbb_topics">
+ <column>topic_id</column>
+ <column>forum_id</column>
+ <row>
+ <value>34</value>
+ <value>12</value>
+ </row>
+ <row>
+ <value>45</value>
+ <value>12</value>
+ </row>
+ <row>
+ <value>56</value>
+ <value>23</value>
+ </row>
+ </table>
+</dataset>
diff --git a/tests/log/function_add_log_test.php b/tests/log/function_add_log_test.php
new file mode 100644
index 0000000000..63e468498e
--- /dev/null
+++ b/tests/log/function_add_log_test.php
@@ -0,0 +1,197 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
+
+class phpbb_log_function_add_log_test extends phpbb_database_test_case
+{
+ public function getDataSet()
+ {
+ return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/empty_log.xml');
+ }
+
+ public static function add_log_function_data()
+ {
+ return array(
+ /**
+ * Case documentation
+ array(
+ // Row that is in the database afterwards
+ array(
+ 'user_id' => ANONYMOUS,
+ 'log_type' => LOG_MOD,
+ 'log_operation' => 'LOG_MOD_ADDITIONAL',
+ // log_data will be serialized
+ 'log_data' => array(
+ 'argument3',
+ ),
+ 'reportee_id' => 0,
+ 'forum_id' => 56,
+ 'topic_id' => 78,
+ ),
+ // user_id Can also be false, then ANONYMOUS is used
+ false,
+ // log_mode Used to determine the log_type
+ 'mod',
+ // Followed by some additional arguments
+ // forum_id, topic_id and reportee_id are specified before log_operation
+ // The rest is specified afterwards.
+ 56,
+ 78,
+ 'LOG_MOD_ADDITIONAL', // log_operation
+ 'argument3',
+ ),
+ */
+ array(
+ array(
+ 'user_id' => 2,
+ 'log_type' => LOG_CRITICAL,
+ 'log_operation' => 'LOG_NO_ADDITIONAL',
+ 'log_data' => '',
+ 'reportee_id' => 0,
+ 'forum_id' => 0,
+ 'topic_id' => 0,
+ ),
+ 2, 'critical', 'LOG_NO_ADDITIONAL',
+ ),
+ array(
+ array(
+ 'user_id' => 2,
+ 'log_type' => LOG_CRITICAL,
+ 'log_operation' => 'LOG_ONE_ADDITIONAL',
+ 'log_data' => array(
+ 'argument1',
+ ),
+ 'reportee_id' => 0,
+ 'forum_id' => 0,
+ 'topic_id' => 0,
+ ),
+ 2, 'critical', 'LOG_ONE_ADDITIONAL', 'argument1',
+ ),
+ array(
+ array(
+ 'user_id' => ANONYMOUS,
+ 'log_type' => LOG_ADMIN,
+ 'log_operation' => 'LOG_TWO_ADDITIONAL',
+ 'log_data' => array(
+ 'argument1',
+ 'argument2',
+ ),
+ 'reportee_id' => 0,
+ 'forum_id' => 0,
+ 'topic_id' => 0,
+ ),
+ false, 'admin', 'LOG_TWO_ADDITIONAL', 'argument1', 'argument2',
+ ),
+ array(
+ array(
+ 'user_id' => ANONYMOUS,
+ 'log_type' => LOG_USERS,
+ 'log_operation' => 'LOG_USERS_ADDITIONAL',
+ 'log_data' => array(
+ 'argument2',
+ ),
+ 'reportee_id' => 2,
+ 'forum_id' => 0,
+ 'topic_id' => 0,
+ ),
+ false, 'user', 2, 'LOG_USERS_ADDITIONAL', 'argument2',
+ ),
+ array(
+ array(
+ 'user_id' => ANONYMOUS,
+ 'log_type' => LOG_MOD,
+ 'log_operation' => 'LOG_MOD_TOPIC_AND_FORUM',
+ 'log_data' => '',
+ 'reportee_id' => 0,
+ 'forum_id' => 12,
+ 'topic_id' => 34,
+ ),
+ false, 'mod', 12, 34, 'LOG_MOD_TOPIC_AND_FORUM',
+ ),
+ array(
+ array(
+ 'user_id' => ANONYMOUS,
+ 'log_type' => LOG_MOD,
+ 'log_operation' => 'LOG_MOD_ADDITIONAL',
+ 'log_data' => array(
+ 'argument3',
+ ),
+ 'reportee_id' => 0,
+ 'forum_id' => 56,
+ 'topic_id' => 78,
+ ),
+ false, 'mod', 56, 78, 'LOG_MOD_ADDITIONAL', 'argument3',
+ ),
+ array(
+ array(
+ ),
+ false, 'mode_does_not_exist', 'LOG_MOD_ADDITIONAL', 'argument1',
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider add_log_function_data
+ */
+ public function test_add_log_function($expected, $user_id, $mode, $required1, $additional1 = null, $additional2 = null, $additional3 = null)
+ {
+ global $db, $cache, $user, $phpbb_log, $phpbb_dispatcher, $phpbb_root_path, $phpEx;
+
+ if ($expected)
+ {
+ // Serialize the log data if we have some
+ if (is_array($expected['log_data']))
+ {
+ $expected['log_data'] = serialize($expected['log_data']);
+ }
+ $expected = array($expected);
+ }
+
+ $db = $this->new_dbal();
+ $cache = new phpbb_mock_cache;
+ $phpbb_dispatcher = new phpbb_mock_event_dispatcher();
+ $user = $this->getMock('\phpbb\user', array(), array('\phpbb\datetime'));
+ $auth = $this->getMock('\phpbb\auth\auth');
+
+ $phpbb_log = new \phpbb\log\log($db, $user, $auth, $phpbb_dispatcher, $phpbb_root_path, 'adm/', $phpEx, LOG_TABLE);
+
+ $user->ip = 'user_ip';
+ if ($user_id)
+ {
+ $user->data['user_id'] = $user_id;
+ }
+
+ if ($additional3 != null)
+ {
+ add_log($mode, $required1, $additional1, $additional2, $additional3);
+ }
+ else if ($additional2 != null)
+ {
+ add_log($mode, $required1, $additional1, $additional2);
+ }
+ else if ($additional1 != null)
+ {
+ add_log($mode, $required1, $additional1);
+ }
+ else
+ {
+ add_log($mode, $required1);
+ }
+
+ $result = $db->sql_query('SELECT user_id, log_type, log_operation, log_data, reportee_id, forum_id, topic_id
+ FROM ' . LOG_TABLE);
+
+ $this->assertEquals($expected, $db->sql_fetchrowset($result));
+ }
+}
diff --git a/tests/log/function_view_log_test.php b/tests/log/function_view_log_test.php
new file mode 100644
index 0000000000..02e0b3912f
--- /dev/null
+++ b/tests/log/function_view_log_test.php
@@ -0,0 +1,409 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions_admin.php';
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions_content.php';
+require_once dirname(__FILE__) . '/../../phpBB/includes/utf/utf_tools.php';
+require_once dirname(__FILE__) . '/../mock/user.php';
+require_once dirname(__FILE__) . '/../mock/cache.php';
+
+class phpbb_log_function_view_log_test extends phpbb_database_test_case
+{
+ public function getDataSet()
+ {
+ return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/full_log.xml');
+ }
+
+ public static function view_log_function_data()
+ {
+ global $phpEx, $phpbb_dispatcher;
+ $phpbb_dispatcher = new phpbb_mock_event_dispatcher();
+
+ $expected_data_sets = array(
+ 1 => array(
+ 'id' => 1,
+
+ 'reportee_id' => 0,
+ 'reportee_username' => '',
+ 'reportee_username_full'=> '',
+
+ 'user_id' => 1,
+ 'username' => 'Anonymous',
+ 'username_full' => '<span class="username">Anonymous</span>',
+
+ 'ip' => '127.0.0.1',
+ 'time' => 1,
+ 'forum_id' => 0,
+ 'topic_id' => 0,
+
+ 'viewforum' => '',
+ 'action' => 'LOG_INSTALL_INSTALLED 3.1.0-dev',
+ ),
+ 2 => array(
+ 'id' => 2,
+
+ 'reportee_id' => 0,
+ 'reportee_username' => '',
+ 'reportee_username_full'=> '',
+
+ 'user_id' => 1,
+ 'username' => 'Anonymous',
+ 'username_full' => '<span class="username">Anonymous</span>',
+
+ 'ip' => '127.0.0.1',
+ 'time' => 1,
+ 'forum_id' => 0,
+ 'topic_id' => 0,
+
+ 'viewforum' => '',
+ 'action' => '{LOG KEY NOT EXISTS}<br />additional_data',
+ ),
+ 3 => array(
+ 'id' => 3,
+
+ 'reportee_id' => 0,
+ 'reportee_username' => '',
+ 'reportee_username_full'=> '',
+
+ 'user_id' => 1,
+ 'username' => 'Anonymous',
+ 'username_full' => '<span class="username">Anonymous</span>',
+
+ 'ip' => '127.0.0.1',
+ 'time' => 1,
+ 'forum_id' => 0,
+ 'topic_id' => 0,
+
+ 'viewforum' => '',
+ 'action' => '{LOG CRITICAL}<br />critical data',
+ ),
+ 4 => array(
+ 'id' => 4,
+
+ 'reportee_id' => 0,
+ 'reportee_username' => '',
+ 'reportee_username_full'=> '',
+
+ 'user_id' => 1,
+ 'username' => 'Anonymous',
+ 'username_full' => '<span class="username">Anonymous</span>',
+
+ 'ip' => '127.0.0.1',
+ 'time' => 1,
+ 'forum_id' => 12,
+ 'topic_id' => 34,
+
+ 'viewforum' => '',
+ 'action' => '{LOG MOD}',
+ 'viewtopic' => '',
+ 'viewlogs' => '',
+ ),
+ 5 => array(
+ 'id' => 5,
+
+ 'reportee_id' => 0,
+ 'reportee_username' => '',
+ 'reportee_username_full'=> '',
+
+ 'user_id' => 1,
+ 'username' => 'Anonymous',
+ 'username_full' => '<span class="username">Anonymous</span>',
+
+ 'ip' => '127.0.0.1',
+ 'time' => 1,
+ 'forum_id' => 12,
+ 'topic_id' => 45,
+
+ 'viewforum' => '',
+ 'action' => '{LOG MOD}',
+ 'viewtopic' => '',
+ 'viewlogs' => '',
+ ),
+ 6 => array(
+ 'id' => 6,
+
+ 'reportee_id' => 0,
+ 'reportee_username' => '',
+ 'reportee_username_full'=> '',
+
+ 'user_id' => 1,
+ 'username' => 'Anonymous',
+ 'username_full' => '<span class="username">Anonymous</span>',
+
+ 'ip' => '127.0.0.1',
+ 'time' => 1,
+ 'forum_id' => 23,
+ 'topic_id' => 56,
+
+ 'viewforum' => append_sid("phpBB/viewforum.$phpEx", 'f=23'),
+ 'action' => '{LOG MOD}',
+ 'viewtopic' => append_sid("phpBB/viewtopic.$phpEx", 'f=23&amp;t=56'),
+ 'viewlogs' => append_sid("phpBB/mcp.$phpEx", 'i=logs&amp;mode=topic_logs&amp;t=56'),
+ ),
+ 7 => array(
+ 'id' => 7,
+
+ 'reportee_id' => 0,
+ 'reportee_username' => '',
+ 'reportee_username_full'=> '',
+
+ 'user_id' => 1,
+ 'username' => 'Anonymous',
+ 'username_full' => '<span class="username">Anonymous</span>',
+
+ 'ip' => '127.0.0.1',
+ 'time' => 1,
+ 'forum_id' => 12,
+ 'topic_id' => 45,
+
+ 'viewforum' => '',
+ 'action' => 'LOG_MOD2',
+ 'viewtopic' => '',
+ 'viewlogs' => '',
+ ),
+ 8 => array(
+ 'id' => 8,
+
+ 'reportee_id' => 2,
+ 'reportee_username' => 'admin',
+ 'reportee_username_full'=> '<span class="username">admin</span>',
+
+ 'user_id' => 1,
+ 'username' => 'Anonymous',
+ 'username_full' => '<span class="username">Anonymous</span>',
+
+ 'ip' => '127.0.0.1',
+ 'time' => 1,
+ 'forum_id' => 0,
+ 'topic_id' => 0,
+
+ 'viewforum' => '',
+ 'action' => 'LOG_USER admin',
+ ),
+ 9 => array(
+ 'id' => 9,
+
+ 'reportee_id' => 1,
+ 'reportee_username' => 'Anonymous',
+ 'reportee_username_full'=> '<span class="username">Anonymous</span>',
+
+ 'user_id' => 1,
+ 'username' => 'Anonymous',
+ 'username_full' => '<span class="username">Anonymous</span>',
+
+ 'ip' => '127.0.0.1',
+ 'time' => 1,
+ 'forum_id' => 0,
+ 'topic_id' => 0,
+
+ 'viewforum' => '',
+ 'action' => 'LOG_USER guest',
+ ),
+ 10 => array(
+ 'id' => 10,
+
+ 'reportee_id' => 0,
+ 'reportee_username' => '',
+ 'reportee_username_full'=> '',
+
+ 'user_id' => 1,
+ 'username' => 'Anonymous',
+ 'username_full' => '<span class="username">Anonymous</span>',
+
+ 'ip' => '127.0.0.1',
+ 'time' => 1,
+ 'forum_id' => 0,
+ 'topic_id' => 0,
+
+ 'viewforum' => '',
+ 'action' => 'LOG_SINGULAR_PLURAL 2',
+ ),
+ 11 => array(
+ 'id' => 11,
+
+ 'reportee_id' => 0,
+ 'reportee_username' => '',
+ 'reportee_username_full'=> '',
+
+ 'user_id' => 1,
+ 'username' => 'Anonymous',
+ 'username_full' => '<span class="username">Anonymous</span>',
+
+ 'ip' => '127.0.0.1',
+ 'time' => 1,
+ 'forum_id' => 15,
+ 'topic_id' => 3,
+
+ 'viewforum' => '',
+ 'action' => 'LOG_MOD3 guest ',
+ 'viewtopic' => '',
+ 'viewlogs' => '',
+ ),
+ );
+
+ $test_cases = array(
+ /**
+ * Case documentation
+ array(
+ // Array of datasets that should be in $log after running the function
+ 'expected' => array(5, 7),
+ // Offset that will be returned from the function
+ 'expected_returned' => 0,
+ // view_log parameters (see includes/functions_admin.php for docblock)
+ // $log is ommited!
+ 'mod', 5, 0, 12, 45,
+ ),
+ */
+ array(
+ 'expected' => array(1, 2),
+ 'expected_returned' => 0,
+ 'admin', false,
+ ),
+ array(
+ 'expected' => array(1),
+ 'expected_returned' => 0,
+ 'admin', false, 1,
+ ),
+ array(
+ 'expected' => array(2),
+ 'expected_returned' => 1,
+ 'admin', false, 1, 1,
+ ),
+ array(
+ 'expected' => array(2),
+ 'expected_returned' => 1,
+ 'admin', 0, 1, 1,
+ ),
+ array(
+ 'expected' => array(2),
+ 'expected_returned' => 1,
+ 'admin', 0, 1, 5,
+ ),
+ array(
+ 'expected' => array(3),
+ 'expected_returned' => 0,
+ 'critical', false,
+ ),
+ array(
+ 'expected' => array(),
+ 'expected_returned' => null,
+ 'mode_does_not_exist', false,
+ ),
+ array(
+ 'expected' => array(4, 5, 7),
+ 'expected_returned' => 0,
+ 'mod', 0, 5, 0, 12,
+ ),
+ array(
+ 'expected' => array(5, 7),
+ 'expected_returned' => 0,
+ 'mod', 0, 5, 0, 12, 45,
+ ),
+ array(
+ 'expected' => array(6),
+ 'expected_returned' => 0,
+ 'mod', 0, 5, 0, 23,
+ ),
+ array(
+ 'expected' => array(8),
+ 'expected_returned' => 0,
+ 'user', 0, 5, 0, 0, 0, 2,
+ ),
+ array(
+ 'expected' => array(8, 9, 10),
+ 'expected_returned' => 0,
+ 'users', 0,
+ ),
+ array(
+ 'expected' => array(1),
+ 'expected_returned' => 0,
+ 'admin', false, 5, 0, 0, 0, 0, 0, 'l.log_id ASC', 'install',
+ ),
+ array(
+ 'expected' => array(10),
+ 'expected_returned' => 0,
+ 'user', false, 5, 0, 0, 0, 0, 0, 'l.log_id ASC', 'plural',
+ ),
+ array(
+ 'expected' => array(11),
+ 'expected_returned' => 0,
+ 'mod', 0, 5, 0, 15, 3,
+ ),
+ );
+
+ foreach ($test_cases as $case => $case_data)
+ {
+ foreach ($case_data['expected'] as $data_set => $expected)
+ {
+ $test_cases[$case]['expected'][$data_set] = $expected_data_sets[$expected];
+ }
+ }
+
+ return $test_cases;
+ }
+
+ /**
+ * @dataProvider view_log_function_data
+ */
+ public function test_view_log_function($expected, $expected_returned, $mode, $log_count, $limit = 5, $offset = 0, $forum_id = 0, $topic_id = 0, $user_id = 0, $limit_days = 0, $sort_by = 'l.log_id ASC', $keywords = '')
+ {
+ global $cache, $db, $user, $auth, $phpbb_log, $phpbb_dispatcher, $phpbb_root_path, $phpEx;
+
+ $db = $this->new_dbal();
+ $cache = new phpbb_mock_cache;
+ $phpbb_dispatcher = new phpbb_mock_event_dispatcher();
+
+ // Create auth mock
+ $auth = $this->getMock('\phpbb\auth\auth');
+ $acl_get_map = array(
+ array('f_read', 23, true),
+ array('m_', 23, true),
+ );
+ $acl_gets_map = array(
+ array('a_', 'm_', 23, true),
+ );
+
+ $auth->expects($this->any())
+ ->method('acl_get')
+ ->with($this->stringContains('_'),
+ $this->anything())
+ ->will($this->returnValueMap($acl_get_map));
+ $auth->expects($this->any())
+ ->method('acl_gets')
+ ->with($this->stringContains('_'),
+ $this->anything())
+ ->will($this->returnValueMap($acl_gets_map));
+
+ $user = new phpbb_mock_user;
+ $user->optionset('viewcensors', false);
+ // Test sprintf() of the data into the action
+ $user->lang = array(
+ 'LOG_INSTALL_INSTALLED' => 'installed: %s',
+ 'LOG_USER' => 'User<br /> %s',
+ 'LOG_MOD2' => 'Mod2',
+ 'LOG_MOD3' => 'Mod3: %1$s, %2$s',
+ 'LOG_SINGULAR_PLURAL' => array(
+ 1 => 'singular',
+ 2 => 'plural (%d)',
+ ),
+ );
+
+ $phpbb_log = new \phpbb\log\log($db, $user, $auth, $phpbb_dispatcher, $phpbb_root_path, 'adm/', $phpEx, LOG_TABLE);
+
+ $log = array();
+ $this->assertEquals($expected_returned, view_log($mode, $log, $log_count, $limit, $offset, $forum_id, $topic_id, $user_id, $limit_days, $sort_by, $keywords));
+
+ $this->assertEquals($expected, $log);
+ }
+}
diff --git a/tests/mcp/fixtures/post_ip.xml b/tests/mcp/fixtures/post_ip.xml
new file mode 100644
index 0000000000..fad2193396
--- /dev/null
+++ b/tests/mcp/fixtures/post_ip.xml
@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<dataset>
+ <table name="phpbb_posts">
+ <column>post_id</column>
+ <column>poster_id</column>
+ <column>post_edit_user</column>
+ <column>post_delete_user</column>
+ <column>post_username</column>
+ <column>topic_id</column>
+ <column>forum_id</column>
+ <column>post_visibility</column>
+ <column>post_time</column>
+ <column>post_text</column>
+ <column>post_reported</column>
+ <column>poster_ip</column>
+ <row>
+ <value>1</value>
+ <value>2</value>
+ <value>2</value>
+ <value>2</value>
+ <value></value>
+ <value>1</value>
+ <value>1</value>
+ <value>1</value>
+ <value>1</value>
+ <value></value>
+ <value>1</value>
+ <value>127.0.0.1</value>
+ </row>
+ <row>
+ <value>2</value>
+ <value>1</value>
+ <value>1</value>
+ <value>1</value>
+ <value>Other</value>
+ <value>2</value>
+ <value>2</value>
+ <value>1</value>
+ <value>1</value>
+ <value></value>
+ <value>1</value>
+ <value>127.0.0.2</value>
+ </row>
+ <row>
+ <value>3</value>
+ <value>2</value>
+ <value>2</value>
+ <value>2</value>
+ <value></value>
+ <value>3</value>
+ <value>3</value>
+ <value>1</value>
+ <value>1</value>
+ <value></value>
+ <value>1</value>
+ <value>127.0.0.3</value>
+ </row>
+ <row>
+ <value>4</value>
+ <value>1</value>
+ <value>1</value>
+ <value>1</value>
+ <value>Other</value>
+ <value>4</value>
+ <value>4</value>
+ <value>1</value>
+ <value>1</value>
+ <value></value>
+ <value>1</value>
+ <value>127.0.0.1</value>
+ </row>
+ </table>
+</dataset>
diff --git a/tests/mcp/post_ip_test.php b/tests/mcp/post_ip_test.php
new file mode 100644
index 0000000000..72a9f62774
--- /dev/null
+++ b/tests/mcp/post_ip_test.php
@@ -0,0 +1,67 @@
+<?php
+/**
+ *
+ * This file is part of the phpBB Forum Software package.
+ *
+ * @copyright (c) phpBB Limited <https://www.phpbb.com>
+ * @license GNU General Public License, version 2 (GPL-2.0)
+ *
+ * For full copyright and license information, please see
+ * the docs/CREDITS.txt file.
+ *
+ */
+
+require_once dirname(__FILE__) . '/../../phpBB/includes/mcp/mcp_post.php';
+
+class phpbb_mcp_post_ip_test extends phpbb_database_test_case
+{
+ /** @var \phpbb\db\driver\driver_interface */
+ protected $db;
+
+ public function getDataSet()
+ {
+ return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/post_ip.xml');
+ }
+
+ protected function setUp()
+ {
+ parent::setUp();
+
+ $this->db = $this->new_dbal();
+ }
+
+ public function data_get_num_ips()
+ {
+ return array(
+ array(2, 1),
+ array(2, 2),
+ array(0, 3),
+ );
+ }
+
+ /**
+ * @dataProvider data_get_num_ips
+ */
+ public function test_get_num_ips($expected, $poster_id)
+ {
+ $this->assertSame($expected, phpbb_get_num_ips_for_poster($this->db, $poster_id));
+ }
+
+ public function data_get_num_posters()
+ {
+ return array(
+ array(2, '127.0.0.1'),
+ array(1, '127.0.0.2'),
+ array(1, '127.0.0.3'),
+ array(0, '127.0.0.4'),
+ );
+ }
+
+ /**
+ * @dataProvider data_get_num_posters
+ */
+ public function test_get_num_posters($expected, $ip)
+ {
+ $this->assertSame($expected, phpbb_get_num_posters_for_ip($this->db, $ip));
+ }
+}
diff --git a/tests/migrator/convert_timezones_test.php b/tests/migrator/convert_timezones_test.php
new file mode 100644
index 0000000000..7501ed2ed0
--- /dev/null
+++ b/tests/migrator/convert_timezones_test.php
@@ -0,0 +1,98 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+class phpbb_migrator_convert_timezones_test extends phpbb_database_test_case
+{
+ protected $notifications, $db, $container, $user, $config, $auth, $cache;
+
+ public function getDataSet()
+ {
+ $this->db = $this->new_dbal();
+ $db_tools = new \phpbb\db\tools($this->db);
+
+ // user_dst doesn't exist anymore, must re-add it to test this
+ $db_tools->sql_column_add('phpbb_users', 'user_dst', array('BOOL', 1));
+
+ return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/convert_timezones.xml');
+ }
+
+ public function revert_schema()
+ {
+ return array(
+ 'drop_columns' => array(
+ $this->table_prefix . 'users' => array(
+ 'user_dst',
+ ),
+ ),
+ );
+ }
+
+ public function update_schema()
+ {
+ return array(
+ 'add_columns' => array(
+ $this->table_prefix . 'users' => array(
+ 'user_dst' => array('BOOL', 0),
+ ),
+ ),
+ );
+ }
+
+ protected function setUp()
+ {
+ parent::setUp();
+
+ global $phpbb_root_path, $phpEx;
+
+ $this->db = $this->new_dbal();
+
+ $this->migration = new \phpbb\db\migration\data\v310\timezone(
+ new \phpbb\config\config(array()),
+ $this->db,
+ new \phpbb\db\tools($this->db),
+ $phpbb_root_path,
+ $phpEx,
+ 'phpbb_'
+ );
+ }
+
+ protected $expected_results = array(
+ //user_id => user_timezone
+ 1 => 'Etc/GMT+12',
+ 2 => 'Etc/GMT+11',
+ 3 => 'Etc/GMT-3',
+ 4 => 'Etc/GMT-4',
+ 5 => 'America/St_Johns',
+ 6 => 'Australia/Eucla',
+ );
+
+ public function test_convert()
+ {
+ $this->migration->update_timezones(0);
+
+ $sql = 'SELECT user_id, user_timezone
+ FROM phpbb_users
+ ORDER BY user_id ASC';
+ $result = $this->db->sql_query($sql);
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $this->assertEquals($this->expected_results[$row['user_id']], $row['user_timezone']);
+ }
+ $this->db->sql_freeresult($result);
+
+ $db_tools = new \phpbb\db\tools($this->db);
+
+ // Remove the user_dst field again
+ $db_tools->sql_column_remove('phpbb_users', 'user_dst');
+ }
+}
diff --git a/tests/migrator/fixtures/convert_timezones.xml b/tests/migrator/fixtures/convert_timezones.xml
new file mode 100644
index 0000000000..b02cf8393c
--- /dev/null
+++ b/tests/migrator/fixtures/convert_timezones.xml
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<dataset>
+ <table name="phpbb_users">
+ <column>user_id</column>
+ <column>username</column>
+ <column>username_clean</column>
+ <column>user_permissions</column>
+ <column>user_sig</column>
+ <column>user_timezone</column>
+ <column>user_dst</column>
+ <row>
+ <value>1</value>
+ <value>1</value>
+ <value>1</value>
+ <value></value>
+ <value></value>
+ <value>-12</value>
+ <value>0</value>
+ </row>
+ <row>
+ <value>2</value>
+ <value>2</value>
+ <value>2</value>
+ <value></value>
+ <value></value>
+ <value>-12</value>
+ <value>1</value>
+ </row>
+ <row>
+ <value>3</value>
+ <value>3</value>
+ <value>3</value>
+ <value></value>
+ <value></value>
+ <value>3</value>
+ <value>0</value>
+ </row>
+ <row>
+ <value>4</value>
+ <value>4</value>
+ <value>4</value>
+ <value></value>
+ <value></value>
+ <value>3</value>
+ <value>1</value>
+ </row>
+ <row>
+ <value>5</value>
+ <value>5</value>
+ <value>5</value>
+ <value></value>
+ <value></value>
+ <value>-3.5</value>
+ <value>0</value>
+ </row>
+ <row>
+ <value>6</value>
+ <value>6</value>
+ <value>6</value>
+ <value></value>
+ <value></value>
+ <value>8.75</value>
+ <value>0</value>
+ </row>
+ </table>
+</dataset>
diff --git a/tests/migrator/get_schema_steps_test.php b/tests/migrator/get_schema_steps_test.php
new file mode 100644
index 0000000000..3d15d2b200
--- /dev/null
+++ b/tests/migrator/get_schema_steps_test.php
@@ -0,0 +1,204 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+class get_schema_steps_test extends phpbb_test_case
+{
+ public function setUp()
+ {
+ parent::setUp();
+
+ $this->helper = new \phpbb\db\migration\helper();
+ }
+
+ public function schema_provider()
+ {
+ return array(
+ array(
+ array(
+ 'add_tables' => array(
+ 'foo' => array(
+ 'COLUMNS' => array(
+ 'foobar' => array('BOOL', 0),
+ 'foobar2' => array('BOOL', 0),
+ ),
+ 'PRIMARY_KEY' => array('foobar'),
+ ),
+ 'bar' => array(
+ 'COLUMNS' => array(
+ 'barfoo' => array('BOOL', 0),
+ 'barfoor2' => array('BOOL', 0),
+ ),
+ 'PRIMARY_KEY' => array('barfoo'),
+ ),
+ ),
+ 'drop_tables' => array('table1', 'table2', 'table3'),
+ 'add_index' => array(
+ 'table1' => array(
+ 'index1' => 'column1',
+ 'index2' => 'column2',
+ ),
+ 'table2' => array(
+ 'index1' => 'column1',
+ 'index2' => 'column2',
+ ),
+ ),
+ 'add_columns' => array(
+ 'table1' => array(
+ 'column1' => array('foo'),
+ 'column2' => array('bar'),
+ ),
+ ),
+ 'change_columns' => array(
+ 'table1' => array(
+ 'column1' => array('foo'),
+ 'column2' => array('bar'),
+ ),
+ ),
+ 'drop_columns' => array(
+ 'table1' => array(
+ 'column1',
+ 'column2',
+ ),
+ ),
+ 'add_unique_index' => array(
+ 'table1' => array(
+ 'index1' => 'column1',
+ 'index2' => 'column2',
+ ),
+ ),
+ 'drop_keys' => array(
+ 'table1' => array(
+ 'column1',
+ 'column2',
+ ),
+ ),
+ 'add_primary_keys' => array(
+ 'table1' => array('foo'),
+ 'table2' => array('bar'),
+ 'table3' => array('foobar'),
+ ),
+ ),
+ array(
+ array('dbtools.perform_schema_changes', array(array('drop_tables' => array('table1')))),
+ array('dbtools.perform_schema_changes', array(array('drop_tables' => array('table2')))),
+ array('dbtools.perform_schema_changes', array(array('drop_tables' => array('table3')))),
+ array('dbtools.perform_schema_changes', array(array('add_tables' => array(
+ 'foo' => array(
+ 'COLUMNS' => array(
+ 'foobar' => array('BOOL', 0),
+ 'foobar2' => array('BOOL', 0),
+ ),
+ 'PRIMARY_KEY' => array('foobar'),
+ ),
+ )))),
+ array('dbtools.perform_schema_changes', array(array('add_tables' => array(
+ 'bar' => array(
+ 'COLUMNS' => array(
+ 'barfoo' => array('BOOL', 0),
+ 'barfoor2' => array('BOOL', 0),
+ ),
+ 'PRIMARY_KEY' => array('barfoo'),
+ ),
+ )))),
+ array('dbtools.perform_schema_changes', array(array('change_columns' => array(
+ 'table1' => array(
+ 'column1' => array('foo'),
+ ),
+ )))),
+ array('dbtools.perform_schema_changes', array(array('change_columns' => array(
+ 'table1' => array(
+ 'column2' => array('bar'),
+ ),
+ )))),
+ array('dbtools.perform_schema_changes', array(array('add_columns' => array(
+ 'table1' => array(
+ 'column1' => array('foo'),
+ ),
+ )))),
+ array('dbtools.perform_schema_changes', array(array('add_columns' => array(
+ 'table1' => array(
+ 'column2' => array('bar'),
+ ),
+ )))),
+ array('dbtools.perform_schema_changes', array(array('drop_keys' => array(
+ 'table1' => array(
+ 0 => 'column1',
+ ),
+ )))),
+ array('dbtools.perform_schema_changes', array(array('drop_keys' => array(
+ 'table1' => array(
+ 1 => 'column2',
+ ),
+ )))),
+ array('dbtools.perform_schema_changes', array(array('drop_columns' => array(
+ 'table1' => array(
+ 0 => 'column1',
+ ),
+ )))),
+ array('dbtools.perform_schema_changes', array(array('drop_columns' => array(
+ 'table1' => array(
+ 1 => 'column2',
+ ),
+ )))),
+ array('dbtools.perform_schema_changes', array(array('add_primary_keys' => array(
+ 'table1' => array('foo'),
+ )))),
+ array('dbtools.perform_schema_changes', array(array('add_primary_keys' => array(
+ 'table2' => array('bar'),
+ )))),
+ array('dbtools.perform_schema_changes', array(array('add_primary_keys' => array(
+ 'table3' => array('foobar'),
+ )))),
+ array('dbtools.perform_schema_changes', array(array('add_unique_index' => array(
+ 'table1' => array(
+ 'index1' => 'column1',
+ ),
+ )))),
+ array('dbtools.perform_schema_changes', array(array('add_unique_index' => array(
+ 'table1' => array(
+ 'index2' => 'column2',
+ ),
+ )))),
+ array('dbtools.perform_schema_changes', array(array('add_index' => array(
+ 'table1' => array(
+ 'index1' => 'column1',
+ ),
+ )))),
+ array('dbtools.perform_schema_changes', array(array('add_index' => array(
+ 'table1' => array(
+ 'index2' => 'column2',
+ ),
+ )))),
+ array('dbtools.perform_schema_changes', array(array('add_index' => array(
+ 'table2' => array(
+ 'index1' => 'column1',
+ ),
+ )))),
+ array('dbtools.perform_schema_changes', array(array('add_index' => array(
+ 'table2' => array(
+ 'index2' => 'column2',
+ ),
+ )))),
+ ),
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider schema_provider
+ */
+ public function test_get_schema_steps($schema_changes, $expected)
+ {
+ $this->assertEquals($expected, $this->helper->get_schema_steps($schema_changes));
+ }
+}
diff --git a/tests/migrator/reverse_update_data_test.php b/tests/migrator/reverse_update_data_test.php
new file mode 100644
index 0000000000..b85e48c64c
--- /dev/null
+++ b/tests/migrator/reverse_update_data_test.php
@@ -0,0 +1,56 @@
+<?php
+/**
+ *
+ * This file is part of the phpBB Forum Software package.
+ *
+ * @copyright (c) phpBB Limited <https://www.phpbb.com>
+ * @license GNU General Public License, version 2 (GPL-2.0)
+ *
+ * For full copyright and license information, please see
+ * the docs/CREDITS.txt file.
+ *
+ */
+
+class reverse_update_data_test extends phpbb_test_case
+{
+ /** @var \phpbb\db\migration\helper */
+ protected $helper;
+
+ public function setUp()
+ {
+ parent::setUp();
+
+ $this->helper = new \phpbb\db\migration\helper();
+ }
+
+ public function update_data_provider()
+ {
+ return array(
+ array(
+ array(
+ array('config.add', array('foobar', 1)),
+ array('if', array(
+ (false === true),
+ array('permission.add', array('some_data')),
+ )),
+ array('config.remove', array('foobar')),
+ array('custom', array(array($this, 'foo_bar'))),
+ array('tool.method', array('test_data')),
+ ),
+ array(
+ array('tool.reverse', array('method', 'test_data')),
+ array('config.reverse', array('remove', 'foobar')),
+ array('config.reverse', array('add', 'foobar', 1)),
+ ),
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider update_data_provider
+ */
+ public function test_get_schema_steps($data_changes, $expected)
+ {
+ $this->assertEquals($expected, $this->helper->reverse_update_data($data_changes));
+ }
+}
diff --git a/tests/migrator/schema_generator_test.php b/tests/migrator/schema_generator_test.php
new file mode 100644
index 0000000000..9adf518a5d
--- /dev/null
+++ b/tests/migrator/schema_generator_test.php
@@ -0,0 +1,138 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+require_once __DIR__ . '/../dbal/migration/dummy_order.php';
+require_once __DIR__ . '/../dbal/migration/dummy_order_0.php';
+require_once __DIR__ . '/../dbal/migration/dummy_order_1.php';
+require_once __DIR__ . '/../dbal/migration/dummy_order_2.php';
+require_once __DIR__ . '/../dbal/migration/dummy_order_3.php';
+require_once __DIR__ . '/../dbal/migration/dummy_order_4.php';
+require_once __DIR__ . '/../dbal/migration/dummy_order_5.php';
+
+class schema_generator_test extends phpbb_test_case
+{
+ /** @var \phpbb\db\migration\schema_generator */
+ protected $generator;
+
+ public function setUp()
+ {
+ parent::setUp();
+
+ $this->config = new \phpbb\config\config(array());
+ $this->db = new \phpbb\db\driver\sqlite();
+ $this->db_tools = new \phpbb\db\tools($this->db);
+ $this->table_prefix = 'phpbb_';
+ }
+
+ protected function get_schema_generator(array $class_names)
+ {
+ $this->generator = new \phpbb\db\migration\schema_generator($class_names, $this->config, $this->db, $this->db_tools, $this->phpbb_root_path, $this->php_ext, $this->table_prefix);
+
+ return $this->generator;
+ }
+
+ /**
+ * @expectedException \UnexpectedValueException
+ */
+ public function test_check_dependencies_fail()
+ {
+ $this->get_schema_generator(array('\phpbb\db\migration\data\v310\forgot_password'));
+
+ $this->generator->get_schema();
+ }
+
+ public function test_get_schema_success()
+ {
+ $this->get_schema_generator(array(
+ '\phpbb\db\migration\data\v30x\release_3_0_1_rc1',
+ '\phpbb\db\migration\data\v30x\release_3_0_0',
+ '\phpbb\db\migration\data\v310\boardindex'
+ ));
+
+ $this->assertArrayHasKey('phpbb_users', $this->generator->get_schema());
+ }
+
+ public function column_add_after_data()
+ {
+ return array(
+ array(
+ 'phpbb_dbal_migration_dummy_order_0',
+ array(
+ 'foobar1',
+ 'foobar2',
+ 'foobar3',
+ ),
+ ),
+ array(
+ 'phpbb_dbal_migration_dummy_order_1',
+ array(
+ 'foobar1',
+ 'foobar3',
+ 'foobar4',
+ ),
+ ),
+ array(
+ 'phpbb_dbal_migration_dummy_order_2',
+ array(
+ 'foobar1',
+ 'foobar3',
+ 'foobar5',
+ ),
+ ),
+ array(
+ 'phpbb_dbal_migration_dummy_order_3',
+ array(
+ 'foobar1',
+ 'foobar3',
+ 'foobar6',
+ ),
+ ),
+ array(
+ 'phpbb_dbal_migration_dummy_order_4',
+ array(
+ 'foobar1',
+ 'foobar3',
+ 'foobar7',
+ ),
+ ),
+ array(
+ 'phpbb_dbal_migration_dummy_order_5',
+ array(
+ 'foobar1',
+ 'foobar3',
+ 'foobar9',
+ 'foobar8',
+ ),
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider column_add_after_data
+ */
+ public function test_column_add_after($migration, $expected)
+ {
+ $this->get_schema_generator(array(
+ 'phpbb_dbal_migration_dummy_order',
+ $migration,
+ ));
+
+ $tables = $this->generator->get_schema();
+
+ $this->assertEquals(
+ $expected,
+ array_keys($tables[$this->table_prefix . 'column_order_test1']['COLUMNS']),
+ 'The schema generator could not position the column correctly, using the "after" option in the migration script.'
+ );
+ }
+}
diff --git a/tests/mimetype/fixtures/jpg b/tests/mimetype/fixtures/jpg
new file mode 100644
index 0000000000..3cd5038e38
--- /dev/null
+++ b/tests/mimetype/fixtures/jpg
Binary files differ
diff --git a/tests/mimetype/guesser_test.php b/tests/mimetype/guesser_test.php
new file mode 100644
index 0000000000..fa53e6c8c4
--- /dev/null
+++ b/tests/mimetype/guesser_test.php
@@ -0,0 +1,230 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\mimetype;
+
+require_once dirname(__FILE__) . '/null_guesser.php';
+require_once dirname(__FILE__) . '/incorrect_guesser.php';
+
+function function_exists($name)
+{
+ return guesser_test::$function_exists;
+}
+
+class guesser_test extends \phpbb_test_case
+{
+ public static $function_exists = false;
+
+ protected $fileinfo_supported = false;
+
+ public function setUp()
+ {
+ global $phpbb_root_path;
+
+ $guessers = array(
+ new \Symfony\Component\HttpFoundation\File\MimeType\FileinfoMimeTypeGuesser(),
+ new \Symfony\Component\HttpFoundation\File\MimeType\FileBinaryMimeTypeGuesser(),
+ new \phpbb\mimetype\extension_guesser,
+ new \phpbb\mimetype\content_guesser,
+ );
+
+ // Check if any guesser except the extension_guesser is available
+ $this->fileinfo_supported = $guessers[0]->isSupported() | $guessers[1]->isSupported() | $guessers[3]->is_supported();
+
+ // Also create a guesser that emulates not having fileinfo available
+ $this->guesser_no_fileinfo = new \phpbb\mimetype\guesser(array($guessers[2]));
+
+ $this->guesser = new \phpbb\mimetype\guesser($guessers);
+ $this->path = dirname(__FILE__);
+ $this->jpg_file = $this->path . '/fixtures/jpg';
+ $this->phpbb_root_path = $phpbb_root_path;
+ }
+
+ public function data_guess_files()
+ {
+ return array(
+ array('image/gif', 'gif'),
+ array('image/png', 'png'),
+ array('image/jpeg', 'jpg'),
+ array('image/tiff', 'tif'),
+ array('text/html', 'txt'),
+ array(false, 'foobar'),
+ );
+ }
+
+ /**
+ * @dataProvider data_guess_files
+ */
+ public function test_guess_files($expected, $file)
+ {
+ // We will always get application/octet-stream as mimetype if only the
+ // extension guesser is supported
+ if (!$this->fileinfo_supported)
+ {
+ $this->markTestSkipped('Unable to run tests depending on fileinfo if it is not available');
+ }
+ $this->assertEquals($expected, $this->guesser->guess($this->path . '/../upload/fixture/' . $file));
+ }
+
+ public function data_guess_files_no_fileinfo()
+ {
+ return array(
+ array('application/octet-stream', 'gif'),
+ array('application/octet-stream', 'txt'),
+ array(false, 'foobar'),
+ );
+ }
+
+ /**
+ * @dataProvider data_guess_files_no_fileinfo
+ */
+ public function test_guess_files_no_fileinfo($expected, $file)
+ {
+ $this->assertEquals($expected, $this->guesser_no_fileinfo->guess($this->path . '/../upload/fixture/' . $file));
+ }
+
+ public function test_file_not_readable()
+ {
+ @chmod($this->jpg_file, 0000);
+ if (is_readable($this->jpg_file))
+ {
+ @chmod($this->jpg_file, 0644);
+ $this->markTestSkipped('is_readable always returns true if user is superuser or chmod does not work');
+ }
+ $this->assertEquals(false, $this->guesser->guess($this->jpg_file));
+ @chmod($this->jpg_file, 0644);
+ $this->assertEquals('image/jpeg', $this->guesser->guess($this->jpg_file));
+ }
+
+ public function test_null_guess()
+ {
+ $guesser = new \phpbb\mimetype\guesser(array(new \phpbb\mimetype\null_guesser));
+ $this->assertEquals('application/octet-stream', $guesser->guess($this->jpg_file));
+ }
+
+ public function data_incorrect_guessers()
+ {
+ return array(
+ array(array(new \phpbb\mimetype\incorrect_guesser)),
+ array(array(new \phpbb\mimetype\null_guesser(false))),
+ array(array()),
+ );
+ }
+
+ /**
+ * @dataProvider data_incorrect_guessers
+ *
+ * @expectedException \LogicException
+ */
+ public function test_incorrect_guesser($guessers)
+ {
+ $guesser = new \phpbb\mimetype\guesser($guessers);
+ }
+
+ public function data_content_guesser()
+ {
+ return array(
+ array(
+ array(
+ 'image/jpeg',
+ 'image/jpeg',
+ ),
+ array(new \phpbb\mimetype\content_guesser),
+ false,
+ ),
+ array(
+ array(
+ 'application/octet-stream',
+ 'application/octet-stream',
+ ),
+ array(new \phpbb\mimetype\content_guesser),
+ true,
+ ),
+ array(
+ array(
+ 'application/octet-stream',
+ 'image/jpeg',
+ ),
+ array(new \phpbb\mimetype\extension_guesser),
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider data_content_guesser
+ */
+ public function test_content_guesser($expected, $guessers, $overload = false)
+ {
+ $supported = false;
+ self::$function_exists = !$overload;
+
+ if (!\function_exists('mime_content_type'))
+ {
+ $this->markTestSkipped('Emulating supported mime_content_type() when it is not supported will cause a fatal error');
+ }
+
+ // Cover possible LogicExceptions
+ foreach ($guessers as $cur_guesser)
+ {
+ $supported += $cur_guesser->is_supported();
+ }
+
+ if (!$supported)
+ {
+ $this->setExpectedException('\LogicException');
+ }
+
+ $guesser = new \phpbb\mimetype\guesser($guessers);
+ $this->assertEquals($expected[0], $guesser->guess($this->jpg_file));
+ $this->assertEquals($expected[1], $guesser->guess($this->jpg_file, $this->jpg_file . '.jpg'));
+ @copy($this->jpg_file, $this->jpg_file . '.jpg');
+ $this->assertEquals($expected[1], $guesser->guess($this->jpg_file . '.jpg'));
+ @unlink($this->jpg_file . '.jpg');
+ }
+
+ public function test_sort_priority()
+ {
+ $guessers = array(
+ 'FileinfoMimeTypeGuesser' => new \Symfony\Component\HttpFoundation\File\MimeType\FileinfoMimeTypeGuesser,
+ 'extension_guesser' => new \phpbb\mimetype\extension_guesser,
+ 'FileBinaryMimeTypeGuesser' => new \Symfony\Component\HttpFoundation\File\MimeType\FileBinaryMimeTypeGuesser,
+ 'content_guesser' => new \phpbb\mimetype\content_guesser,
+ );
+ $guessers['content_guesser']->set_priority(5);
+ $guessers['extension_guesser']->set_priority(-5);
+ usort($guessers, array($this->guesser, 'sort_priority'));
+ $this->assertInstanceOf('\phpbb\mimetype\content_guesser', $guessers[0]);
+ $this->assertInstanceOf('\phpbb\mimetype\extension_guesser', $guessers[3]);
+ }
+
+ public function data_choose_mime_type()
+ {
+ return array(
+ array('application/octet-stream', 'application/octet-stream', null),
+ array('application/octet-stream', 'application/octet-stream', 'application/octet-stream'),
+ array('binary', 'application/octet-stream', 'binary'),
+ array('image/jpeg', 'application/octet-stream', 'image/jpeg'),
+ array('image/jpeg', 'binary', 'image/jpeg'),
+ array('image/jpeg', 'image/jpg', 'image/jpeg'),
+ array('image/jpeg', 'image/jpeg', 'binary'),
+ );
+ }
+
+ /**
+ * @dataProvider data_choose_mime_type
+ */
+ public function test_choose_mime_type($expected, $mime_type, $guess)
+ {
+ $this->assertSame($expected, $this->guesser->choose_mime_type($mime_type, $guess));
+ }
+}
diff --git a/tests/mimetype/incorrect_guesser.php b/tests/mimetype/incorrect_guesser.php
new file mode 100644
index 0000000000..f74617b7a7
--- /dev/null
+++ b/tests/mimetype/incorrect_guesser.php
@@ -0,0 +1,22 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\mimetype;
+
+class incorrect_guesser
+{
+ public function guess($file)
+ {
+ return 'image/jpeg';
+ }
+}
diff --git a/tests/mimetype/null_guesser.php b/tests/mimetype/null_guesser.php
new file mode 100644
index 0000000000..836ff4196a
--- /dev/null
+++ b/tests/mimetype/null_guesser.php
@@ -0,0 +1,34 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\mimetype;
+
+class null_guesser
+{
+ protected $is_supported;
+
+ public function __construct($is_supported = true)
+ {
+ $this->is_supported = $is_supported;
+ }
+
+ public function is_supported()
+ {
+ return $this->is_supported;
+ }
+
+ public function guess($file)
+ {
+ return null;
+ }
+}
diff --git a/tests/mock/auth_provider.php b/tests/mock/auth_provider.php
new file mode 100644
index 0000000000..abf0e4fdfb
--- /dev/null
+++ b/tests/mock/auth_provider.php
@@ -0,0 +1,27 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+/**
+ * Mock auth provider class with basic functions to help test sessions.
+ */
+class phpbb_mock_auth_provider extends \phpbb\auth\provider\base
+{
+ public function login($username, $password)
+ {
+ return array(
+ 'status' => "",
+ 'error_msg' => "",
+ 'user_row' => "",
+ );
+ }
+}
diff --git a/tests/mock/cache.php b/tests/mock/cache.php
index acf4288319..5fa3d28147 100644
--- a/tests/mock/cache.php
+++ b/tests/mock/cache.php
@@ -1,22 +1,23 @@
<?php
/**
*
-* @package testing
-* @copyright (c) 2008 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
-class phpbb_mock_cache
+class phpbb_mock_cache implements \phpbb\cache\driver\driver_interface
{
+ protected $data;
+
public function __construct($data = array())
{
$this->data = $data;
-
- if (!isset($this->data['_bots']))
- {
- $this->data['_bots'] = array();
- }
}
public function get($var_name)
@@ -34,24 +35,6 @@ class phpbb_mock_cache
$this->data[$var_name] = $var;
}
- public function destroy($var_name, $table = '')
- {
- if ($table)
- {
- throw new Exception('Destroying tables is not implemented yet');
- }
-
- unset($this->data[$var_name]);
- }
-
- /**
- * Obtain active bots
- */
- public function obtain_bots()
- {
- return $this->data['_bots'];
- }
-
/**
* Obtain list of word censors. We don't need to parse them here,
* that is tested elsewhere.
@@ -89,17 +72,32 @@ class phpbb_mock_cache
}
}
- public function set_bots($bots)
+ public function checkVar(PHPUnit_Framework_Assert $test, $var_name, $data)
{
- $this->data['_bots'] = $bots;
+ $test->assertTrue(isset($this->data[$var_name]));
+ $test->assertEquals($data, $this->data[$var_name]);
}
- public function checkVar(PHPUnit_Framework_Assert $test, $var_name, $data)
+ public function checkAssociativeVar(PHPUnit_Framework_Assert $test, $var_name, $data, $sort = true)
{
$test->assertTrue(isset($this->data[$var_name]));
+
+ if ($sort)
+ {
+ foreach ($this->data[$var_name] as &$content)
+ {
+ sort($content);
+ }
+ }
+
$test->assertEquals($data, $this->data[$var_name]);
}
+ public function checkVarUnset(PHPUnit_Framework_Assert $test, $var_name)
+ {
+ $test->assertFalse(isset($this->data[$var_name]));
+ }
+
public function check(PHPUnit_Framework_Assert $test, $data, $ignore_db_info = true)
{
$cache_data = $this->data;
@@ -116,5 +114,58 @@ class phpbb_mock_cache
$test->assertEquals($data, $cache_data);
}
-}
+ function load()
+ {
+ }
+ function unload()
+ {
+ }
+ function save()
+ {
+ }
+ function tidy()
+ {
+ }
+ function purge()
+ {
+ }
+ function destroy($var_name, $table = '')
+ {
+ unset($this->data[$var_name]);
+ }
+ public function _exists($var_name)
+ {
+ }
+ public function sql_load($query)
+ {
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function sql_save(\phpbb\db\driver\driver_interface $db, $query, $query_result, $ttl)
+ {
+ return $query_result;
+ }
+ public function sql_exists($query_id)
+ {
+ }
+ public function sql_fetchrow($query_id)
+ {
+ }
+ public function sql_fetchfield($query_id, $field)
+ {
+ }
+ public function sql_rowseek($rownum, $query_id)
+ {
+ }
+ public function sql_freeresult($query_id)
+ {
+ }
+
+ public function obtain_bots()
+ {
+ return isset($this->data['_bots']) ? $this->data['_bots'] : array();
+ }
+}
diff --git a/tests/mock/container_builder.php b/tests/mock/container_builder.php
new file mode 100644
index 0000000000..297e3a65e6
--- /dev/null
+++ b/tests/mock/container_builder.php
@@ -0,0 +1,183 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+use Symfony\Component\DependencyInjection\ContainerInterface;
+use Symfony\Component\DependencyInjection\ScopeInterface;
+
+class phpbb_mock_container_builder implements ContainerInterface
+{
+ protected $services = array();
+ protected $parameters = array();
+
+ /**
+ * Sets a service.
+ *
+ * @param string $id The service identifier
+ * @param object $service The service instance
+ * @param string $scope The scope of the service
+ *
+ * @api
+ */
+ public function set($id, $service, $scope = self::SCOPE_CONTAINER)
+ {
+ $this->services[$id] = $service;
+ }
+
+ /**
+ * Gets a service.
+ *
+ * @param string $id The service identifier
+ * @param int $invalidBehavior The behavior when the service does not exist
+ *
+ * @return object The associated service
+ *
+ * @throws InvalidArgumentException if the service is not defined
+ * @throws ServiceCircularReferenceException When a circular reference is detected
+ * @throws ServiceNotFoundException When the service is not defined
+ *
+ * @see Reference
+ *
+ * @api
+ */
+ public function get($id, $invalidBehavior = self::EXCEPTION_ON_INVALID_REFERENCE)
+ {
+ if ($this->has($id))
+ {
+ return $this->services[$id];
+ }
+
+ throw new Exception('Could not find service: ' . $id);
+ }
+
+ /**
+ * Returns true if the given service is defined.
+ *
+ * @param string $id The service identifier
+ *
+ * @return Boolean true if the service is defined, false otherwise
+ *
+ * @api
+ */
+ public function has($id)
+ {
+ return isset($this->services[$id]);
+ }
+
+ /**
+ * Gets a parameter.
+ *
+ * @param string $name The parameter name
+ *
+ * @return mixed The parameter value
+ *
+ * @throws InvalidArgumentException if the parameter is not defined
+ *
+ * @api
+ */
+ public function getParameter($name)
+ {
+ if ($this->hasParameter($name))
+ {
+ return $this->parameters[$name];
+ }
+
+ throw new Exception('Could not find parameter: ' . $name);
+ }
+
+ /**
+ * Checks if a parameter exists.
+ *
+ * @param string $name The parameter name
+ *
+ * @return Boolean The presence of parameter in container
+ *
+ * @api
+ */
+ public function hasParameter($name)
+ {
+ return isset($this->parameters[$name]);
+ }
+
+ /**
+ * Sets a parameter.
+ *
+ * @param string $name The parameter name
+ * @param mixed $value The parameter value
+ *
+ * @api
+ */
+ public function setParameter($name, $value)
+ {
+ $this->parameters[$name] = $value;
+ }
+
+ /**
+ * Enters the given scope
+ *
+ * @param string $name
+ *
+ * @api
+ */
+ public function enterScope($name)
+ {
+ }
+
+ /**
+ * Leaves the current scope, and re-enters the parent scope
+ *
+ * @param string $name
+ *
+ * @api
+ */
+ public function leaveScope($name)
+ {
+ }
+
+ /**
+ * Adds a scope to the container
+ *
+ * @param ScopeInterface $scope
+ *
+ * @api
+ */
+ public function addScope(ScopeInterface $scope)
+ {
+ }
+
+ /**
+ * Whether this container has the given scope
+ *
+ * @param string $name
+ *
+ * @return Boolean
+ *
+ * @api
+ */
+ public function hasScope($name)
+ {
+ }
+
+ /**
+ * Determines whether the given scope is currently active.
+ *
+ * It does however not check if the scope actually exists.
+ *
+ * @param string $name
+ *
+ * @return Boolean
+ *
+ * @api
+ */
+ public function isScopeActive($name)
+ {
+ }
+}
diff --git a/tests/mock/controller_helper.php b/tests/mock/controller_helper.php
new file mode 100644
index 0000000000..ae3e7bf432
--- /dev/null
+++ b/tests/mock/controller_helper.php
@@ -0,0 +1,34 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+class phpbb_mock_controller_helper extends \phpbb\controller\helper
+{
+ public function __construct(\phpbb\template\template $template, \phpbb\user $user, \phpbb\config\config $config, \phpbb\controller\provider $provider, \phpbb\extension\manager $manager, \phpbb\symfony_request $symfony_request, \phpbb\request\request_interface $request, \phpbb\filesystem $filesystem, $phpbb_root_path, $php_ext, $phpbb_root_path_ext)
+ {
+ $this->template = $template;
+ $this->user = $user;
+ $this->config = $config;
+ $this->symfony_request = $symfony_request;
+ $this->request = $request;
+ $this->filesystem = $filesystem;
+ $this->phpbb_root_path = $phpbb_root_path;
+ $this->php_ext = $php_ext;
+ $provider->find_routing_files($manager->get_finder());
+ $this->route_collection = $provider->find($phpbb_root_path_ext)->get_routes();
+ }
+
+ public function get_current_url()
+ {
+ return '';
+ }
+}
diff --git a/tests/mock/event_dispatcher.php b/tests/mock/event_dispatcher.php
new file mode 100644
index 0000000000..fa8b4a1036
--- /dev/null
+++ b/tests/mock/event_dispatcher.php
@@ -0,0 +1,29 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+class phpbb_mock_event_dispatcher extends \phpbb\event\dispatcher
+{
+ /**
+ * Constructor.
+ *
+ * Overwrite the constructor to get rid of ContainerInterface param instance
+ */
+ public function __construct()
+ {
+ }
+
+ public function trigger_event($eventName, $data = array())
+ {
+ return array();
+ }
+}
diff --git a/tests/mock/extension_manager.php b/tests/mock/extension_manager.php
new file mode 100644
index 0000000000..94268159a8
--- /dev/null
+++ b/tests/mock/extension_manager.php
@@ -0,0 +1,26 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+class phpbb_mock_extension_manager extends \phpbb\extension\manager
+{
+ public function __construct($phpbb_root_path, $extensions = array(), $container = null)
+ {
+ $this->phpbb_root_path = $phpbb_root_path;
+ $this->php_ext = 'php';
+ $this->extensions = $extensions;
+ $this->filesystem = new \phpbb\filesystem();
+ $this->container = $container;
+ $this->config = new \phpbb\config\config(array());
+ $this->user = new \phpbb\user('\phpbb\datetime');
+ }
+}
diff --git a/tests/mock/file_downloader.php b/tests/mock/file_downloader.php
new file mode 100644
index 0000000000..d8951cebf6
--- /dev/null
+++ b/tests/mock/file_downloader.php
@@ -0,0 +1,27 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+class phpbb_mock_file_downloader extends \phpbb\file_downloader
+{
+ public $data;
+
+ public function set($data)
+ {
+ $this->data = $data;
+ }
+
+ public function get($host, $directory, $filename, $port = 80, $timeout = 6)
+ {
+ return $this->data;
+ }
+}
diff --git a/tests/mock/filespec.php b/tests/mock/filespec.php
new file mode 100644
index 0000000000..7ea750afbe
--- /dev/null
+++ b/tests/mock/filespec.php
@@ -0,0 +1,36 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+/**
+ * Mock filespec class with some basic values to help with testing the
+ * fileupload class
+ */
+class phpbb_mock_filespec
+{
+ public $filesize;
+ public $realname;
+ public $extension;
+ public $width;
+ public $height;
+ public $error = array();
+
+ public function check_content($disallowed_content)
+ {
+ return true;
+ }
+
+ public function get($property)
+ {
+ return $this->$property;
+ }
+}
diff --git a/tests/mock/filesystem_extension_manager.php b/tests/mock/filesystem_extension_manager.php
new file mode 100644
index 0000000000..fa1b1c06bc
--- /dev/null
+++ b/tests/mock/filesystem_extension_manager.php
@@ -0,0 +1,36 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+class phpbb_mock_filesystem_extension_manager extends phpbb_mock_extension_manager
+{
+ public function __construct($phpbb_root_path)
+ {
+ $extensions = array();
+ $iterator = new DirectoryIterator($phpbb_root_path . 'ext/');
+ foreach ($iterator as $fileinfo)
+ {
+ if ($fileinfo->isDir() && substr($fileinfo->getFilename(), 0, 1) != '.')
+ {
+ $name = $fileinfo->getFilename();
+ $extension = array(
+ 'ext_name' => $name,
+ 'ext_active' => true,
+ 'ext_path' => 'ext/' . $name . '/',
+ );
+ $extensions[$name] = $extension;
+ }
+ }
+ ksort($extensions);
+ parent::__construct($phpbb_root_path, $extensions);
+ }
+}
diff --git a/tests/mock/fileupload.php b/tests/mock/fileupload.php
new file mode 100644
index 0000000000..8cc4d77ea1
--- /dev/null
+++ b/tests/mock/fileupload.php
@@ -0,0 +1,27 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+/**
+ * Mock fileupload class with some basic values to help with testing the
+ * filespec class
+ */
+class phpbb_mock_fileupload
+{
+ public $max_filesize = 100;
+ public $error_prefix = '';
+
+ public function valid_dimensions($filespec)
+ {
+ return true;
+ }
+}
diff --git a/tests/mock/lang.php b/tests/mock/lang.php
new file mode 100644
index 0000000000..bebbe5a29b
--- /dev/null
+++ b/tests/mock/lang.php
@@ -0,0 +1,42 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+/**
+* phpbb_mock_lang
+* mock a user with some language-keys specified
+*/
+class phpbb_mock_lang implements ArrayAccess
+{
+ public function offsetExists($offset)
+ {
+ return true;
+ }
+
+ public function offsetGet($offset)
+ {
+ return $offset;
+ }
+
+ public function offsetSet($offset, $value)
+ {
+ }
+
+ public function offsetUnset($offset)
+ {
+ }
+
+ public function lang()
+ {
+ return implode(' ', func_get_args());
+ }
+}
diff --git a/tests/mock/metadata_manager.php b/tests/mock/metadata_manager.php
new file mode 100644
index 0000000000..2443fad560
--- /dev/null
+++ b/tests/mock/metadata_manager.php
@@ -0,0 +1,27 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+class phpbb_mock_metadata_manager extends \phpbb\extension\metadata_manager
+{
+ public function set_metadata($metadata)
+ {
+ array_walk_recursive($metadata, array($this, 'sanitize_json'));
+ $this->metadata = $metadata;
+ }
+
+ public function merge_metadata($metadata)
+ {
+ array_walk_recursive($metadata, array($this, 'sanitize_json'));
+ $this->metadata = array_merge($this->metadata, $metadata);
+ }
+}
diff --git a/tests/mock/migrator.php b/tests/mock/migrator.php
new file mode 100644
index 0000000000..293f115335
--- /dev/null
+++ b/tests/mock/migrator.php
@@ -0,0 +1,55 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+class phpbb_mock_migrator extends \phpbb\db\migrator
+{
+ public function __construct()
+ {
+ }
+
+ public function load_migration_state()
+ {
+ }
+
+ public function set_migrations($class_names)
+ {
+ }
+
+ public function update()
+ {
+ }
+
+ public function revert($migration)
+ {
+ }
+
+ public function unfulfillable($name)
+ {
+ }
+
+ public function finished()
+ {
+ }
+
+ public function migration_state($migration)
+ {
+ }
+
+ public function populate_migrations($migrations)
+ {
+ }
+
+ public function create_migrations_table()
+ {
+ }
+}
diff --git a/tests/mock/notification_manager.php b/tests/mock/notification_manager.php
new file mode 100644
index 0000000000..6a590bc0ca
--- /dev/null
+++ b/tests/mock/notification_manager.php
@@ -0,0 +1,97 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+/**
+* @ignore
+*/
+if (!defined('IN_PHPBB'))
+{
+ exit;
+}
+
+/**
+* Notifications service class
+*/
+class phpbb_mock_notification_manager
+{
+ public function load_notifications()
+ {
+ return array(
+ 'notifications' => array(),
+ 'unread_count' => 0,
+ );
+ }
+
+ public function mark_notifications_read()
+ {
+ }
+
+ public function mark_notifications_read_by_parent()
+ {
+ }
+
+ public function mark_notifications_read_by_id()
+ {
+ }
+
+
+ public function add_notifications()
+ {
+ return array();
+ }
+
+ public function add_notifications_for_users()
+ {
+ }
+
+ public function update_notifications()
+ {
+ }
+
+ public function delete_notifications()
+ {
+ }
+
+ public function get_subscription_types()
+ {
+ return array();
+ }
+
+ public function get_subscription_methods()
+ {
+ return array();
+ }
+
+
+ public function get_global_subscriptions()
+ {
+ return array();
+ }
+
+ public function add_subscription()
+ {
+ }
+
+ public function delete_subscription()
+ {
+ }
+
+ public function load_users()
+ {
+ }
+
+ public function get_user()
+ {
+ return null;
+ }
+}
diff --git a/tests/mock/notification_type_post.php b/tests/mock/notification_type_post.php
new file mode 100644
index 0000000000..6d8f6dc504
--- /dev/null
+++ b/tests/mock/notification_type_post.php
@@ -0,0 +1,40 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+/**
+* @ignore
+*/
+if (!defined('IN_PHPBB'))
+{
+ exit;
+}
+
+class phpbb_mock_notification_type_post extends \phpbb\notification\type\post
+{
+ public function __construct($user_loader, $db, $cache, $user, $auth, $config, $phpbb_root_path, $php_ext, $notification_types_table, $notifications_table, $user_notifications_table)
+ {
+ $this->user_loader = $user_loader;
+ $this->db = $db;
+ $this->cache = $cache;
+ $this->user = $user;
+ $this->auth = $auth;
+ $this->config = $config;
+
+ $this->phpbb_root_path = $phpbb_root_path;
+ $this->php_ext = $php_ext;
+
+ $this->notification_types_table = $notification_types_table;
+ $this->notifications_table = $notifications_table;
+ $this->user_notifications_table = $user_notifications_table;
+ }
+}
diff --git a/tests/mock/notifications_auth.php b/tests/mock/notifications_auth.php
new file mode 100644
index 0000000000..1106c3004f
--- /dev/null
+++ b/tests/mock/notifications_auth.php
@@ -0,0 +1,44 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+class phpbb_mock_notifications_auth extends \phpbb\auth\auth
+{
+ function acl_get_list($user_id = false, $opts = false, $forum_id = false)
+ {
+ $user_id = (!is_array($user_id)) ? array($user_id) : $user_id;
+ $opts = (!is_array($opts)) ? array($opts) : $opts;
+ $forum_id = (!is_array($forum_id)) ? array($forum_id) : $forum_id;
+
+ $auth_list = array();
+
+ foreach ($forum_id as $fid)
+ {
+ foreach ($opts as $opt)
+ {
+ $auth_list[$fid][$opt] = array();
+
+ foreach ($user_id as $uid)
+ {
+ $auth_list[$fid][$opt][] = $uid;
+ }
+ }
+ }
+
+ return $auth_list;
+ }
+
+ function acl_get($opt, $f = 0)
+ {
+ return true;
+ }
+}
diff --git a/tests/mock/null_cache.php b/tests/mock/null_cache.php
index aca20ca77b..5b801adf11 100644
--- a/tests/mock/null_cache.php
+++ b/tests/mock/null_cache.php
@@ -1,9 +1,13 @@
<?php
/**
*
-* @package testing
-* @copyright (c) 2012 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -39,4 +43,9 @@ class phpbb_mock_null_cache
public function set_bots($bots)
{
}
+
+ public function sql_exists($query_id)
+ {
+ return false;
+ }
}
diff --git a/tests/mock/phpbb_di_container_builder.php b/tests/mock/phpbb_di_container_builder.php
new file mode 100644
index 0000000000..59cdf0bb2b
--- /dev/null
+++ b/tests/mock/phpbb_di_container_builder.php
@@ -0,0 +1,20 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+class phpbb_mock_phpbb_di_container_builder extends \phpbb\di\container_builder
+{
+ protected function get_container_filename()
+ {
+ return $this->phpbb_root_path . '../../tmp/container.' . $this->php_ext;
+ }
+}
diff --git a/tests/mock/request.php b/tests/mock/request.php
new file mode 100644
index 0000000000..e7217a94a9
--- /dev/null
+++ b/tests/mock/request.php
@@ -0,0 +1,138 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+class phpbb_mock_request implements \phpbb\request\request_interface
+{
+ protected $data;
+
+ protected $super_globals_disabled = false;
+
+ public function __construct($get = array(), $post = array(), $cookie = array(), $server = array(), $request = false, $files = array())
+ {
+ $this->data[\phpbb\request\request_interface::GET] = $get;
+ $this->data[\phpbb\request\request_interface::POST] = $post;
+ $this->data[\phpbb\request\request_interface::COOKIE] = $cookie;
+ $this->data[\phpbb\request\request_interface::REQUEST] = ($request === false) ? $post + $get : $request;
+ $this->data[\phpbb\request\request_interface::SERVER] = $server;
+ $this->data[\phpbb\request\request_interface::FILES] = $files;
+
+ $this->disable_super_globals();
+ }
+
+ public function overwrite($var_name, $value, $super_global = \phpbb\request\request_interface::REQUEST)
+ {
+ $this->data[$super_global][$var_name] = $value;
+ }
+
+ public function variable($var_name, $default, $multibyte = false, $super_global = \phpbb\request\request_interface::REQUEST)
+ {
+ return isset($this->data[$super_global][$var_name]) ? $this->data[$super_global][$var_name] : $default;
+ }
+
+ public function server($var_name, $default = '')
+ {
+ $super_global = \phpbb\request\request_interface::SERVER;
+ return isset($this->data[$super_global][$var_name]) ? $this->data[$super_global][$var_name] : $default;
+ }
+
+ public function header($header_name, $default = '')
+ {
+ $var_name = 'HTTP_' . str_replace('-', '_', strtoupper($header_name));
+ return $this->server($var_name, $default);
+ }
+
+ public function file($form_name)
+ {
+ $super_global = \phpbb\request\request_interface::FILES;
+ return isset($this->data[$super_global][$form_name]) ? $this->data[$super_global][$form_name] : array();
+ }
+
+ public function is_set_post($name)
+ {
+ return $this->is_set($name, \phpbb\request\request_interface::POST);
+ }
+
+ public function is_set($var, $super_global = \phpbb\request\request_interface::REQUEST)
+ {
+ return isset($this->data[$super_global][$var]);
+ }
+
+ public function is_ajax()
+ {
+ return false;
+ }
+
+ public function is_secure()
+ {
+ return false;
+ }
+
+ public function variable_names($super_global = \phpbb\request\request_interface::REQUEST)
+ {
+ return array_keys($this->data[$super_global]);
+ }
+
+ public function get_super_global($super_global = \phpbb\request\request_interface::REQUEST)
+ {
+ return $this->data[$super_global];
+ }
+
+ public function super_globals_disabled()
+ {
+ return $this->super_globals_disabled;
+ }
+
+ public function disable_super_globals()
+ {
+ $this->super_globals_disabled = true;
+ }
+
+ public function enable_super_globals()
+ {
+ $this->super_globals_disabled = false;
+ }
+
+ /* custom methods */
+
+ public function set_header($header_name, $value)
+ {
+ $var_name = 'HTTP_' . str_replace('-', '_', strtoupper($header_name));
+ $this->data[\phpbb\request\request_interface::SERVER][$var_name] = $value;
+ }
+
+ public function merge($super_global = \phpbb\request\request_interface::REQUEST, $values)
+ {
+ $this->data[$super_global] = array_merge($this->data[$super_global], $values);
+ }
+
+ public function escape($var, $multibyte)
+ {
+ $type_cast_helper = new \phpbb\request\type_cast_helper();
+ if (is_array($var))
+ {
+ $result = array();
+ foreach ($var as $key => $value)
+ {
+ $type_cast_helper->set_var($key, $key, gettype($key), $multibyte);
+ $result[$key] = $this->escape($value, $multibyte);
+ }
+ $var = $result;
+ }
+ else
+ {
+ $type_cast_helper->set_var($var, $var, 'string', $multibyte);
+ }
+
+ return $var;
+ }
+}
diff --git a/tests/mock/search.php b/tests/mock/search.php
new file mode 100644
index 0000000000..f30876b4da
--- /dev/null
+++ b/tests/mock/search.php
@@ -0,0 +1,27 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+/**
+*/
+class phpbb_mock_search
+{
+
+ public function __construct($error, $phpbb_root_path, $phpEx, $auth, $config, $db, $user)
+ {
+ }
+
+ public function index_remove($post_ids, $poster_ids, $forum_ids)
+ {
+ }
+}
+
diff --git a/tests/mock/session_testable.php b/tests/mock/session_testable.php
index 70a58fb6cc..29dd2a5bff 100644
--- a/tests/mock/session_testable.php
+++ b/tests/mock/session_testable.php
@@ -1,14 +1,17 @@
<?php
/**
*
-* @package testing
-* @copyright (c) 2008 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
-require_once dirname(__FILE__) . '/../../phpBB/includes/session.php';
/**
* Extends the session class to overwrite the setting of cookies.
@@ -17,11 +20,11 @@ require_once dirname(__FILE__) . '/../../phpBB/includes/session.php';
* test it without warnings about sent headers. This class only stores cookie
* data for later verification.
*/
-class phpbb_mock_session_testable extends session
+class phpbb_mock_session_testable extends \phpbb\session
{
private $_cookies = array();
- public function set_cookie($name, $data, $time)
+ public function set_cookie($name, $data, $time, $httponly = true)
{
$this->_cookies[$name] = array($data, $time);
}
@@ -59,5 +62,9 @@ class phpbb_mock_session_testable extends session
}
}
}
+
+ public function setup()
+ {
+ }
}
diff --git a/tests/mock/sql_insert_buffer.php b/tests/mock/sql_insert_buffer.php
new file mode 100644
index 0000000000..c751764d45
--- /dev/null
+++ b/tests/mock/sql_insert_buffer.php
@@ -0,0 +1,25 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+class phpbb_mock_sql_insert_buffer extends \phpbb\db\sql_insert_buffer
+{
+ public function flush()
+ {
+ return (sizeof($this->buffer)) ? true : false;
+ }
+
+ public function get_buffer()
+ {
+ return $this->buffer;
+ }
+}
diff --git a/tests/mock/user.php b/tests/mock/user.php
index bd547b3973..9888337a9e 100644
--- a/tests/mock/user.php
+++ b/tests/mock/user.php
@@ -1,9 +1,13 @@
<?php
/**
*
-* @package testing
-* @copyright (c) 2011 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -46,4 +50,9 @@ class phpbb_mock_user
}
return false;
}
+
+ public function lang()
+ {
+ return implode(' ', func_get_args());
+ }
}
diff --git a/tests/network/checkdnsrr_test.php b/tests/network/checkdnsrr_test.php
index 1942a50f06..a3852b2656 100644
--- a/tests/network/checkdnsrr_test.php
+++ b/tests/network/checkdnsrr_test.php
@@ -1,9 +1,13 @@
<?php
/**
*
-* @package testing
-* @copyright (c) 2010 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
diff --git a/tests/network/ftp_fsock_pasv_epsv_test.php b/tests/network/ftp_fsock_pasv_epsv_test.php
index 22f17785b8..6ed9d61dc0 100644
--- a/tests/network/ftp_fsock_pasv_epsv_test.php
+++ b/tests/network/ftp_fsock_pasv_epsv_test.php
@@ -1,9 +1,13 @@
<?php
/**
*
-* @package testing
-* @copyright (c) 2011 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
diff --git a/tests/network/inet_ntop_pton_test.php b/tests/network/inet_ntop_pton_test.php
new file mode 100644
index 0000000000..fae40ad74e
--- /dev/null
+++ b/tests/network/inet_ntop_pton_test.php
@@ -0,0 +1,58 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
+
+class phpbb_network_inet_ntop_pton_test extends phpbb_test_case
+{
+ public function data_provider()
+ {
+ return array(
+ array('127.0.0.1', '7f000001'),
+ array('192.232.131.223', 'c0e883df'),
+ array('13.1.68.3', '0d014403'),
+ array('129.144.52.38', '81903426'),
+
+ array('2001:280:0:10::5', '20010280000000100000000000000005'),
+ array('fe80::200:4cff:fefe:172f', 'fe8000000000000002004cfffefe172f'),
+
+ array('::', '00000000000000000000000000000000'),
+ array('::1', '00000000000000000000000000000001'),
+ array('1::', '00010000000000000000000000000000'),
+
+ array('1:1:0:0:1::', '00010001000000000001000000000000'),
+
+ array('0:2:3:4:5:6:7:8', '00000002000300040005000600070008'),
+ array('1:2:0:4:5:6:7:8', '00010002000000040005000600070008'),
+ array('1:2:3:4:5:6:7:0', '00010002000300040005000600070000'),
+
+ array('2001:0:0:1::1', '20010000000000010000000000000001'),
+ );
+ }
+
+ /**
+ * @dataProvider data_provider
+ */
+ public function test_inet_ntop($address, $hex)
+ {
+ $this->assertEquals($address, phpbb_inet_ntop(pack('H*', $hex)));
+ }
+
+ /**
+ * @dataProvider data_provider
+ */
+ public function test_inet_pton($address, $hex)
+ {
+ $this->assertEquals($hex, bin2hex(phpbb_inet_pton($address)));
+ }
+}
diff --git a/tests/network/ip_normalise_test.php b/tests/network/ip_normalise_test.php
new file mode 100644
index 0000000000..1acfd4521d
--- /dev/null
+++ b/tests/network/ip_normalise_test.php
@@ -0,0 +1,68 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
+
+class phpbb_network_ip_normalise_test extends phpbb_test_case
+{
+ public function data_provider()
+ {
+ return array(
+ // From: A Recommendation for IPv6 Address Text Representation
+ // http://tools.ietf.org/html/draft-ietf-6man-text-addr-representation-07
+
+ // Section 4: A Recommendation for IPv6 Text Representation
+ // Section 4.1: Handling Leading Zeros in a 16 Bit Field
+ array('2001:0db8::0001', '2001:db8::1'),
+
+ // Section 4.2: "::" Usage
+ // Section 4.2.1: Shorten As Much As Possible
+ array('2001:db8::0:1', '2001:db8::1'),
+
+ // Section 4.2.2: Handling One 16 Bit 0 Field
+ array('2001:db8::1:1:1:1:1', '2001:db8:0:1:1:1:1:1'),
+
+ // Section 4.2.3: Choice in Placement of "::"
+ array('2001:db8:0:0:1:0:0:1', '2001:db8::1:0:0:1'),
+
+ // Section 4.3: Lower Case
+ array('2001:DB8::1', '2001:db8::1'),
+
+ // Section 5: Text Representation of Special Addresses
+ // We want to show IPv4-mapped addresses as plain IPv4 addresses, though.
+ array('::ffff:192.168.0.1', '192.168.0.1'),
+ array('0000::0000:ffff:c000:0280', '192.0.2.128'),
+
+ // IPv6 addresses with the last 32-bit written in dotted-quad notation
+ // should be converted to hex-only IPv6 addresses.
+ array('2001:db8::192.0.2.128', '2001:db8::c000:280'),
+
+ // Any string not passing the IPv4 or IPv6 regular expression
+ // is supposed to result in false being returned.
+ // Valid and invalid IP addresses are tested in
+ // tests/regex/ipv4.php and tests/regex/ipv6.php.
+ array('', false),
+ array('192.168.1.256', false),
+ array('::ffff:192.168.255.256', false),
+ array('::1111:2222:3333:4444:5555:6666::', false),
+ );
+ }
+
+ /**
+ * @dataProvider data_provider
+ */
+ public function test_ip_normalise($ip_address, $expected)
+ {
+ $this->assertEquals($expected, phpbb_ip_normalise($ip_address));
+ }
+}
diff --git a/tests/notification/base.php b/tests/notification/base.php
new file mode 100644
index 0000000000..162feae557
--- /dev/null
+++ b/tests/notification/base.php
@@ -0,0 +1,140 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+require_once dirname(__FILE__) . '/manager_helper.php';
+
+abstract class phpbb_tests_notification_base extends phpbb_database_test_case
+{
+ protected $notifications, $db, $container, $user, $config, $auth, $cache;
+
+ protected function get_notification_types()
+ {
+ return array(
+ 'test',
+ 'notification.type.approve_post',
+ 'notification.type.approve_topic',
+ 'notification.type.bookmark',
+ 'notification.type.disapprove_post',
+ 'notification.type.disapprove_topic',
+ 'notification.type.pm',
+ 'notification.type.post',
+ 'notification.type.post_in_queue',
+ 'notification.type.quote',
+ 'notification.type.report_pm',
+ 'notification.type.report_pm_closed',
+ 'notification.type.report_post',
+ 'notification.type.report_post_closed',
+ 'notification.type.topic',
+ 'notification.type.topic_in_queue',
+ );
+ }
+
+ protected function setUp()
+ {
+ parent::setUp();
+
+ global $phpbb_root_path, $phpEx;
+
+ include_once(__DIR__ . '/ext/test/notification/type/test.' . $phpEx);
+
+ global $db, $config, $user, $auth, $cache, $phpbb_container;
+
+ $db = $this->db = $this->new_dbal();
+ $config = $this->config = new \phpbb\config\config(array(
+ 'allow_privmsg' => true,
+ 'allow_bookmarks' => true,
+ 'allow_topic_notify' => true,
+ 'allow_forum_notify' => true,
+ ));
+ $user = $this->user = new \phpbb\user('\phpbb\datetime');
+ $this->user_loader = new \phpbb\user_loader($this->db, $phpbb_root_path, $phpEx, 'phpbb_users');
+ $auth = $this->auth = new phpbb_mock_notifications_auth();
+ $cache = $this->cache = new \phpbb\cache\service(
+ new \phpbb\cache\driver\null(),
+ $this->config,
+ $this->db,
+ $phpbb_root_path,
+ $phpEx
+ );
+
+ $this->phpbb_dispatcher = new phpbb_mock_event_dispatcher();
+
+ $phpbb_container = $this->container = new phpbb_mock_container_builder();
+
+ $this->notifications = new phpbb_notification_manager_helper(
+ array(),
+ array(),
+ $this->container,
+ $this->user_loader,
+ $this->config,
+ $this->phpbb_dispatcher,
+ $this->db,
+ $this->cache,
+ $this->user,
+ $phpbb_root_path,
+ $phpEx,
+ 'phpbb_notification_types',
+ 'phpbb_notifications',
+ 'phpbb_user_notifications'
+ );
+
+ $phpbb_container->set('notification_manager', $this->notifications);
+
+ $this->notifications->setDependencies($this->auth, $this->config);
+
+ $types = array();
+ foreach ($this->get_notification_types() as $type)
+ {
+ $type_parts = explode('.', $type);
+ $class = $this->build_type('phpbb\notification\type\\' . array_pop($type_parts));
+
+ $types[$type] = $class;
+ $this->container->set($type, $class);
+ }
+
+ $this->notifications->set_var('notification_types', $types);
+
+ $this->db->sql_query('DELETE FROM phpbb_notification_types');
+ $this->db->sql_query('DELETE FROM phpbb_notifications');
+ $this->db->sql_query('DELETE FROM phpbb_user_notifications');
+ }
+
+ protected function build_type($type)
+ {
+ global $phpbb_root_path, $phpEx;
+
+ return new $type($this->user_loader, $this->db, $this->cache->get_driver(), $this->user, $this->auth, $this->config, $phpbb_root_path, $phpEx, 'phpbb_notification_types', 'phpbb_notifications', 'phpbb_user_notifications');
+ }
+
+ protected function assert_notifications($expected, $options = array())
+ {
+ $notifications = $this->notifications->load_notifications(array_merge(array(
+ 'count_unread' => true,
+ 'order_by' => 'notification_time',
+ 'order_dir' => 'ASC',
+ ), $options));
+
+ $this->assertEquals(sizeof($expected), $notifications['unread_count']);
+
+ $i = 0;
+ foreach ($notifications['notifications'] as $notification)
+ {
+ foreach ($expected[$i] as $key => $value)
+ {
+ $this->assertEquals($value, $notification->$key, $i . ' ' . $key);
+ }
+
+ $i++;
+ }
+ }
+}
diff --git a/tests/notification/convert_test.php b/tests/notification/convert_test.php
new file mode 100644
index 0000000000..32ab34c9bc
--- /dev/null
+++ b/tests/notification/convert_test.php
@@ -0,0 +1,112 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+require_once dirname(__FILE__) . '/../mock/sql_insert_buffer.php';
+
+class phpbb_notification_convert_test extends phpbb_database_test_case
+{
+ protected $notifications, $db, $container, $user, $config, $auth, $cache;
+
+ public function getDataSet()
+ {
+ return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/convert.xml');
+ }
+
+ protected function setUp()
+ {
+ parent::setUp();
+
+ global $phpbb_root_path, $phpEx;
+
+ $this->db = $this->new_dbal();
+
+ $this->migration = new \phpbb\db\migration\data\v310\notification_options_reconvert(
+ new \phpbb\config\config(array()),
+ $this->db,
+ new \phpbb\db\tools($this->db),
+ $phpbb_root_path,
+ $phpEx,
+ 'phpbb_'
+ );
+ }
+
+ public function test_convert()
+ {
+ $buffer = new phpbb_mock_sql_insert_buffer($this->db, 'phpbb_user_notifications');
+ $this->migration->perform_conversion($buffer, 0);
+
+ $expected = array_merge(
+ $this->create_expected('post', 1, 'email'),
+ $this->create_expected('topic', 1, 'email'),
+
+ $this->create_expected('post', 2, 'email'),
+ $this->create_expected('topic', 2, 'email'),
+ $this->create_expected('pm', 2, 'email'),
+
+ $this->create_expected('post', 3, 'jabber'),
+ $this->create_expected('topic', 3, 'jabber'),
+
+ $this->create_expected('post', 4, 'jabber'),
+ $this->create_expected('topic', 4, 'jabber'),
+ $this->create_expected('pm', 4, 'jabber'),
+
+ $this->create_expected('post', 5, 'both'),
+ $this->create_expected('topic', 5, 'both'),
+
+ $this->create_expected('post', 6, 'both'),
+ $this->create_expected('topic', 6, 'both'),
+ $this->create_expected('pm', 6, 'both')
+ );
+
+ $this->assertEquals($expected, $buffer->get_buffer());
+ }
+
+ protected function create_expected($type, $user_id, $method = '')
+ {
+ $return = array();
+
+ if ($method !== '')
+ {
+ $return[] = array(
+ 'item_type' => $type,
+ 'item_id' => 0,
+ 'user_id' => $user_id,
+ 'method' => '',
+ 'notify' => 1,
+ );
+ }
+
+ if ($method === 'email' || $method === 'both')
+ {
+ $return[] = array(
+ 'item_type' => $type,
+ 'item_id' => 0,
+ 'user_id' => $user_id,
+ 'method' => 'email',
+ 'notify' => 1,
+ );
+ }
+
+ if ($method === 'jabber' || $method === 'both')
+ {
+ $return[] = array(
+ 'item_type' => $type,
+ 'item_id' => 0,
+ 'user_id' => $user_id,
+ 'method' => 'jabber',
+ 'notify' => 1,
+ );
+ }
+
+ return $return;
+ }
+}
diff --git a/tests/notification/ext/test/notification/type/test.php b/tests/notification/ext/test/notification/type/test.php
new file mode 100644
index 0000000000..b02a563f06
--- /dev/null
+++ b/tests/notification/ext/test/notification/type/test.php
@@ -0,0 +1,91 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\notification\type;
+
+/**
+* @ignore
+*/
+if (!defined('IN_PHPBB'))
+{
+ exit;
+}
+
+class test extends \phpbb\notification\type\base
+{
+ public function get_type()
+ {
+ return 'test';
+ }
+
+ public static function get_item_id($post)
+ {
+ return (int) $post['post_id'];
+ }
+
+ public static function get_item_parent_id($post)
+ {
+ return (int) $post['topic_id'];
+ }
+
+ public function find_users_for_notification($post, $options = array())
+ {
+ return $this->check_user_notification_options(array(0), $options);
+ }
+
+ public function create_insert_array($post, $pre_create_data = array())
+ {
+ $this->notification_time = $post['post_time'];
+
+ return parent::create_insert_array($post, $pre_create_data);
+ }
+
+ public function create_update_array($type_data)
+ {
+ $data = $this->create_insert_array($type_data);
+
+ // Unset data unique to each row
+ unset(
+ $data['notification_id'],
+ $data['notification_read'],
+ $data['user_id']
+ );
+
+ return $data;
+ }
+
+ public function get_title()
+ {
+ return 'test title';
+ }
+
+ public function users_to_query()
+ {
+ return array();
+ }
+
+ public function get_url()
+ {
+ return '';
+ }
+
+ public function get_email_template()
+ {
+ return false;
+ }
+
+ public function get_email_template_variables()
+ {
+ return array();
+ }
+}
diff --git a/tests/notification/fixtures/convert.xml b/tests/notification/fixtures/convert.xml
new file mode 100644
index 0000000000..c9d8fafa97
--- /dev/null
+++ b/tests/notification/fixtures/convert.xml
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<dataset>
+ <table name="phpbb_users">
+ <column>user_id</column>
+ <column>username</column>
+ <column>username_clean</column>
+ <column>user_notify_type</column>
+ <column>user_notify_pm</column>
+ <column>user_permissions</column>
+ <column>user_sig</column>
+ <row>
+ <value>1</value>
+ <value>1</value>
+ <value>1</value>
+ <value>0</value>
+ <value>0</value>
+ <value></value>
+ <value></value>
+ </row>
+ <row>
+ <value>2</value>
+ <value>2</value>
+ <value>2</value>
+ <value>0</value>
+ <value>1</value>
+ <value></value>
+ <value></value>
+ </row>
+ <row>
+ <value>3</value>
+ <value>3</value>
+ <value>3</value>
+ <value>1</value>
+ <value>0</value>
+ <value></value>
+ <value></value>
+ </row>
+ <row>
+ <value>4</value>
+ <value>4</value>
+ <value>4</value>
+ <value>1</value>
+ <value>1</value>
+ <value></value>
+ <value></value>
+ </row>
+ <row>
+ <value>5</value>
+ <value>5</value>
+ <value>5</value>
+ <value>2</value>
+ <value>0</value>
+ <value></value>
+ <value></value>
+ </row>
+ <row>
+ <value>6</value>
+ <value>6</value>
+ <value>6</value>
+ <value>2</value>
+ <value>1</value>
+ <value></value>
+ <value></value>
+ </row>
+ </table>
+</dataset>
diff --git a/tests/notification/fixtures/group_request.xml b/tests/notification/fixtures/group_request.xml
new file mode 100644
index 0000000000..fbaee0a326
--- /dev/null
+++ b/tests/notification/fixtures/group_request.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<dataset>
+ <table name="phpbb_users">
+ <column>user_id</column>
+ <column>username</column>
+ <column>username_clean</column>
+ <column>user_permissions</column>
+ <column>user_sig</column>
+ <row>
+ <value>2</value>
+ <value>2</value>
+ <value>2</value>
+ <value></value>
+ <value></value>
+ </row>
+ <row>
+ <value>3</value>
+ <value>3</value>
+ <value>3</value>
+ <value></value>
+ <value></value>
+ </row>
+ </table>
+</dataset>
diff --git a/tests/notification/fixtures/notification.xml b/tests/notification/fixtures/notification.xml
new file mode 100644
index 0000000000..c7b2d03ff1
--- /dev/null
+++ b/tests/notification/fixtures/notification.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<dataset>
+ <table name="phpbb_bookmarks">
+ </table>
+ <table name="phpbb_notifications">
+ </table>
+ <table name="phpbb_notification_types">
+ </table>
+ <table name="phpbb_topics_watch">
+ </table>
+ <table name="phpbb_user_notifications">
+ </table>
+</dataset>
diff --git a/tests/notification/fixtures/submit_post_notification.type.bookmark.xml b/tests/notification/fixtures/submit_post_notification.type.bookmark.xml
new file mode 100644
index 0000000000..a1413e2cf8
--- /dev/null
+++ b/tests/notification/fixtures/submit_post_notification.type.bookmark.xml
@@ -0,0 +1,161 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<dataset>
+ <table name="phpbb_bookmarks">
+ <column>topic_id</column>
+ <column>user_id</column>
+ <row>
+ <value>1</value>
+ <value>2</value>
+ </row>
+ <row>
+ <value>1</value>
+ <value>3</value>
+ </row>
+ <row>
+ <value>1</value>
+ <value>4</value>
+ </row>
+ <row>
+ <value>1</value>
+ <value>5</value>
+ </row>
+ <row>
+ <value>1</value>
+ <value>6</value>
+ </row>
+ <row>
+ <value>1</value>
+ <value>7</value>
+ </row>
+ </table>
+ <table name="phpbb_notifications">
+ <column>notification_type_id</column>
+ <column>user_id</column>
+ <column>item_id</column>
+ <column>item_parent_id</column>
+ <column>notification_read</column>
+ <column>notification_data</column>
+ <row>
+ <value>1</value>
+ <value>5</value>
+ <value>1</value>
+ <value>1</value>
+ <value>0</value>
+ <value></value>
+ </row>
+ </table>
+ <table name="phpbb_notification_types">
+ <column>notification_type_id</column>
+ <column>notification_type_name</column>
+ <column>notification_type_enabled</column>
+ <row>
+ <value>1</value>
+ <value>notification.type.bookmark</value>
+ <value>1</value>
+ </row>
+ </table>
+ <table name="phpbb_posts">
+ <column>post_id</column>
+ <column>topic_id</column>
+ <column>forum_id</column>
+ <column>post_text</column>
+ <row>
+ <value>1</value>
+ <value>1</value>
+ <value>1</value>
+ <value></value>
+ </row>
+ </table>
+ <table name="phpbb_topics">
+ <column>topic_id</column>
+ <column>forum_id</column>
+ <row>
+ <value>1</value>
+ <value>1</value>
+ </row>
+ </table>
+ <table name="phpbb_users">
+ <column>user_id</column>
+ <column>username_clean</column>
+ <column>user_permissions</column>
+ <column>user_sig</column>
+ <row>
+ <value>2</value>
+ <value>poster</value>
+ <value></value>
+ <value></value>
+ </row>
+ <row>
+ <value>3</value>
+ <value>test</value>
+ <value></value>
+ <value></value>
+ </row>
+ <row>
+ <value>4</value>
+ <value>unauthorized</value>
+ <value></value>
+ <value></value>
+ </row>
+ <row>
+ <value>5</value>
+ <value>notified</value>
+ <value></value>
+ <value></value>
+ </row>
+ <row>
+ <value>6</value>
+ <value>disabled</value>
+ <value></value>
+ <value></value>
+ </row>
+ <row>
+ <value>7</value>
+ <value>default</value>
+ <value></value>
+ <value></value>
+ </row>
+ </table>
+ <table name="phpbb_user_notifications">
+ <column>item_type</column>
+ <column>item_id</column>
+ <column>user_id</column>
+ <column>method</column>
+ <column>notify</column>
+ <row>
+ <value>notification.type.bookmark</value>
+ <value>0</value>
+ <value>2</value>
+ <value></value>
+ <value>1</value>
+ </row>
+ <row>
+ <value>notification.type.bookmark</value>
+ <value>0</value>
+ <value>3</value>
+ <value></value>
+ <value>1</value>
+ </row>
+ <row>
+ <value>notification.type.bookmark</value>
+ <value>0</value>
+ <value>4</value>
+ <value></value>
+ <value>1</value>
+ </row>
+ <row>
+ <value>notification.type.bookmark</value>
+ <value>0</value>
+ <value>5</value>
+ <value></value>
+ <value>1</value>
+ </row>
+ <row>
+ <value>notification.type.bookmark</value>
+ <value>0</value>
+ <value>6</value>
+ <value></value>
+ <value>0</value>
+ </row>
+ </table>
+</dataset>
diff --git a/tests/notification/fixtures/submit_post_notification.type.post.xml b/tests/notification/fixtures/submit_post_notification.type.post.xml
new file mode 100644
index 0000000000..ed75787c70
--- /dev/null
+++ b/tests/notification/fixtures/submit_post_notification.type.post.xml
@@ -0,0 +1,205 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<dataset>
+ <table name="phpbb_forums_watch">
+ <column>forum_id</column>
+ <column>user_id</column>
+ <column>notify_status</column>
+ <row>
+ <value>1</value>
+ <value>6</value>
+ <value>0</value>
+ </row>
+ <row>
+ <value>1</value>
+ <value>7</value>
+ <value>0</value>
+ </row>
+ <row>
+ <value>1</value>
+ <value>8</value>
+ <value>0</value>
+ </row>
+ </table>
+ <table name="phpbb_notifications">
+ <column>notification_type_id</column>
+ <column>user_id</column>
+ <column>item_id</column>
+ <column>item_parent_id</column>
+ <column>notification_read</column>
+ <column>notification_data</column>
+ <row>
+ <value>1</value>
+ <value>5</value>
+ <value>1</value>
+ <value>1</value>
+ <value>0</value>
+ <value></value>
+ </row>
+ <row>
+ <value>1</value>
+ <value>8</value>
+ <value>1</value>
+ <value>1</value>
+ <value>0</value>
+ <value></value>
+ </row>
+ </table>
+ <table name="phpbb_notification_types">
+ <column>notification_type_id</column>
+ <column>notification_type_name</column>
+ <column>notification_type_enabled</column>
+ <row>
+ <value>1</value>
+ <value>notification.type.post</value>
+ <value>1</value>
+ </row>
+ </table>
+ <table name="phpbb_posts">
+ <column>post_id</column>
+ <column>topic_id</column>
+ <column>forum_id</column>
+ <column>post_text</column>
+ <row>
+ <value>1</value>
+ <value>1</value>
+ <value>1</value>
+ <value></value>
+ </row>
+ </table>
+ <table name="phpbb_topics">
+ <column>topic_id</column>
+ <column>forum_id</column>
+ <row>
+ <value>1</value>
+ <value>1</value>
+ </row>
+ </table>
+ <table name="phpbb_topics_watch">
+ <column>topic_id</column>
+ <column>user_id</column>
+ <column>notify_status</column>
+ <row>
+ <value>1</value>
+ <value>2</value>
+ <value>0</value>
+ </row>
+ <row>
+ <value>1</value>
+ <value>3</value>
+ <value>0</value>
+ </row>
+ <row>
+ <value>1</value>
+ <value>4</value>
+ <value>0</value>
+ </row>
+ <row>
+ <value>1</value>
+ <value>5</value>
+ <value>0</value>
+ </row>
+ <row>
+ <value>1</value>
+ <value>6</value>
+ <value>0</value>
+ </row>
+ </table>
+ <table name="phpbb_users">
+ <column>user_id</column>
+ <column>username_clean</column>
+ <column>user_permissions</column>
+ <column>user_sig</column>
+ <row>
+ <value>2</value>
+ <value>poster</value>
+ <value></value>
+ <value></value>
+ </row>
+ <row>
+ <value>3</value>
+ <value>test</value>
+ <value></value>
+ <value></value>
+ </row>
+ <row>
+ <value>4</value>
+ <value>unauthorized</value>
+ <value></value>
+ <value></value>
+ </row>
+ <row>
+ <value>5</value>
+ <value>notified</value>
+ <value></value>
+ <value></value>
+ </row>
+ <row>
+ <value>6</value>
+ <value>disabled</value>
+ <value></value>
+ <value></value>
+ </row>
+ <row>
+ <value>7</value>
+ <value>default</value>
+ <value></value>
+ <value></value>
+ </row>
+ </table>
+ <table name="phpbb_user_notifications">
+ <column>item_type</column>
+ <column>item_id</column>
+ <column>user_id</column>
+ <column>method</column>
+ <column>notify</column>
+ <row>
+ <value>notification.type.post</value>
+ <value>0</value>
+ <value>2</value>
+ <value></value>
+ <value>1</value>
+ </row>
+ <row>
+ <value>notification.type.post</value>
+ <value>0</value>
+ <value>3</value>
+ <value></value>
+ <value>1</value>
+ </row>
+ <row>
+ <value>notification.type.post</value>
+ <value>0</value>
+ <value>4</value>
+ <value></value>
+ <value>1</value>
+ </row>
+ <row>
+ <value>notification.type.post</value>
+ <value>0</value>
+ <value>5</value>
+ <value></value>
+ <value>1</value>
+ </row>
+ <row>
+ <value>notification.type.post</value>
+ <value>0</value>
+ <value>6</value>
+ <value></value>
+ <value>1</value>
+ </row>
+ <row>
+ <value>notification.type.post</value>
+ <value>0</value>
+ <value>7</value>
+ <value></value>
+ <value>1</value>
+ </row>
+ <row>
+ <value>notification.type.post</value>
+ <value>0</value>
+ <value>8</value>
+ <value></value>
+ <value>1</value>
+ </row>
+ </table>
+</dataset>
diff --git a/tests/notification/fixtures/submit_post_notification.type.post_in_queue.xml b/tests/notification/fixtures/submit_post_notification.type.post_in_queue.xml
new file mode 100644
index 0000000000..2dea8e34dd
--- /dev/null
+++ b/tests/notification/fixtures/submit_post_notification.type.post_in_queue.xml
@@ -0,0 +1,159 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<dataset>
+ <table name="phpbb_notifications">
+ <column>notification_type_id</column>
+ <column>user_id</column>
+ <column>item_id</column>
+ <column>item_parent_id</column>
+ <column>notification_read</column>
+ <column>notification_data</column>
+ <row>
+ <value>1</value>
+ <value>6</value>
+ <value>1</value>
+ <value>1</value>
+ <value>0</value>
+ <value></value>
+ </row>
+ </table>
+ <table name="phpbb_notification_types">
+ <column>notification_type_id</column>
+ <column>notification_type_name</column>
+ <column>notification_type_enabled</column>
+ <row>
+ <value>1</value>
+ <value>notification.type.post_in_queue</value>
+ <value>1</value>
+ </row>
+ </table>
+ <table name="phpbb_posts">
+ <column>post_id</column>
+ <column>topic_id</column>
+ <column>forum_id</column>
+ <column>post_text</column>
+ <row>
+ <value>1</value>
+ <value>1</value>
+ <value>1</value>
+ <value></value>
+ </row>
+ </table>
+ <table name="phpbb_topics">
+ <column>topic_id</column>
+ <column>forum_id</column>
+ <row>
+ <value>1</value>
+ <value>1</value>
+ </row>
+ </table>
+ <table name="phpbb_users">
+ <column>user_id</column>
+ <column>username_clean</column>
+ <column>user_permissions</column>
+ <column>user_sig</column>
+ <row>
+ <value>2</value>
+ <value>poster</value>
+ <value></value>
+ <value></value>
+ </row>
+ <row>
+ <value>3</value>
+ <value>test</value>
+ <value></value>
+ <value></value>
+ </row>
+ <row>
+ <value>4</value>
+ <value>unauthorized-mod</value>
+ <value></value>
+ <value></value>
+ </row>
+ <row>
+ <value>5</value>
+ <value>unauthorized-read</value>
+ <value></value>
+ <value></value>
+ </row>
+ <row>
+ <value>6</value>
+ <value>notified</value>
+ <value></value>
+ <value></value>
+ </row>
+ <row>
+ <value>7</value>
+ <value>disabled</value>
+ <value></value>
+ <value></value>
+ </row>
+ <row>
+ <value>8</value>
+ <value>default</value>
+ <value></value>
+ <value></value>
+ </row>
+ <row>
+ <value>9</value>
+ <value>test glboal-permissions</value>
+ <value></value>
+ <value></value>
+ </row>
+ </table>
+ <table name="phpbb_user_notifications">
+ <column>item_type</column>
+ <column>item_id</column>
+ <column>user_id</column>
+ <column>method</column>
+ <column>notify</column>
+ <row>
+ <value>notification.type.needs_approval</value>
+ <value>0</value>
+ <value>2</value>
+ <value></value>
+ <value>1</value>
+ </row>
+ <row>
+ <value>notification.type.needs_approval</value>
+ <value>0</value>
+ <value>3</value>
+ <value></value>
+ <value>1</value>
+ </row>
+ <row>
+ <value>notification.type.needs_approval</value>
+ <value>0</value>
+ <value>4</value>
+ <value></value>
+ <value>1</value>
+ </row>
+ <row>
+ <value>notification.type.needs_approval</value>
+ <value>0</value>
+ <value>5</value>
+ <value></value>
+ <value>1</value>
+ </row>
+ <row>
+ <value>notification.type.needs_approval</value>
+ <value>0</value>
+ <value>6</value>
+ <value></value>
+ <value>1</value>
+ </row>
+ <row>
+ <value>notification.type.needs_approval</value>
+ <value>0</value>
+ <value>7</value>
+ <value></value>
+ <value>0</value>
+ </row>
+ <row>
+ <value>notification.type.needs_approval</value>
+ <value>0</value>
+ <value>9</value>
+ <value></value>
+ <value>1</value>
+ </row>
+ </table>
+</dataset>
diff --git a/tests/notification/fixtures/submit_post_notification.type.quote.xml b/tests/notification/fixtures/submit_post_notification.type.quote.xml
new file mode 100644
index 0000000000..dd5bc620cd
--- /dev/null
+++ b/tests/notification/fixtures/submit_post_notification.type.quote.xml
@@ -0,0 +1,133 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<dataset>
+ <table name="phpbb_notifications">
+ <column>notification_type_id</column>
+ <column>user_id</column>
+ <column>item_id</column>
+ <column>item_parent_id</column>
+ <column>notification_read</column>
+ <column>notification_data</column>
+ <row>
+ <value>1</value>
+ <value>5</value>
+ <value>1</value>
+ <value>1</value>
+ <value>0</value>
+ <value></value>
+ </row>
+ </table>
+ <table name="phpbb_notification_types">
+ <column>notification_type_id</column>
+ <column>notification_type_name</column>
+ <column>notification_type_enabled</column>
+ <row>
+ <value>1</value>
+ <value>notification.type.quote</value>
+ <value>1</value>
+ </row>
+ </table>
+ <table name="phpbb_posts">
+ <column>post_id</column>
+ <column>topic_id</column>
+ <column>forum_id</column>
+ <column>post_text</column>
+ <row>
+ <value>1</value>
+ <value>1</value>
+ <value>1</value>
+ <value></value>
+ </row>
+ </table>
+ <table name="phpbb_topics">
+ <column>topic_id</column>
+ <column>forum_id</column>
+ <row>
+ <value>1</value>
+ <value>1</value>
+ </row>
+ </table>
+ <table name="phpbb_users">
+ <column>user_id</column>
+ <column>username_clean</column>
+ <column>user_permissions</column>
+ <column>user_sig</column>
+ <row>
+ <value>2</value>
+ <value>poster</value>
+ <value></value>
+ <value></value>
+ </row>
+ <row>
+ <value>3</value>
+ <value>test</value>
+ <value></value>
+ <value></value>
+ </row>
+ <row>
+ <value>4</value>
+ <value>unauthorized</value>
+ <value></value>
+ <value></value>
+ </row>
+ <row>
+ <value>5</value>
+ <value>notified</value>
+ <value></value>
+ <value></value>
+ </row>
+ <row>
+ <value>6</value>
+ <value>disabled</value>
+ <value></value>
+ <value></value>
+ </row>
+ <row>
+ <value>7</value>
+ <value>default</value>
+ <value></value>
+ <value></value>
+ </row>
+ </table>
+ <table name="phpbb_user_notifications">
+ <column>item_type</column>
+ <column>item_id</column>
+ <column>user_id</column>
+ <column>method</column>
+ <column>notify</column>
+ <row>
+ <value>notification.type.quote</value>
+ <value>0</value>
+ <value>2</value>
+ <value></value>
+ <value>1</value>
+ </row>
+ <row>
+ <value>notification.type.quote</value>
+ <value>0</value>
+ <value>3</value>
+ <value></value>
+ <value>1</value>
+ </row>
+ <row>
+ <value>notification.type.quote</value>
+ <value>0</value>
+ <value>4</value>
+ <value></value>
+ <value>1</value>
+ </row>
+ <row>
+ <value>notification.type.quote</value>
+ <value>0</value>
+ <value>5</value>
+ <value></value>
+ <value>1</value>
+ </row>
+ <row>
+ <value>notification.type.quote</value>
+ <value>0</value>
+ <value>6</value>
+ <value></value>
+ <value>0</value>
+ </row>
+ </table>
+</dataset>
diff --git a/tests/notification/fixtures/submit_post_notification.type.topic.xml b/tests/notification/fixtures/submit_post_notification.type.topic.xml
new file mode 100644
index 0000000000..1ba8d05699
--- /dev/null
+++ b/tests/notification/fixtures/submit_post_notification.type.topic.xml
@@ -0,0 +1,134 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<dataset>
+ <table name="phpbb_forums_watch">
+ <column>forum_id</column>
+ <column>user_id</column>
+ <column>notify_status</column>
+ <row>
+ <value>1</value>
+ <value>6</value>
+ <value>0</value>
+ </row>
+ <row>
+ <value>1</value>
+ <value>7</value>
+ <value>0</value>
+ </row>
+ <row>
+ <value>1</value>
+ <value>8</value>
+ <value>0</value>
+ </row>
+ </table>
+ <table name="phpbb_notifications">
+ <column>notification_type_id</column>
+ <column>user_id</column>
+ <column>item_id</column>
+ <column>item_parent_id</column>
+ <column>notification_read</column>
+ <column>notification_data</column>
+ <row>
+ <value>1</value>
+ <value>8</value>
+ <value>1</value>
+ <value>1</value>
+ <value>0</value>
+ <value></value>
+ </row>
+ </table>
+ <table name="phpbb_notification_types">
+ <column>notification_type_id</column>
+ <column>notification_type_name</column>
+ <column>notification_type_enabled</column>
+ <row>
+ <value>1</value>
+ <value>notification.type.topic</value>
+ <value>1</value>
+ </row>
+ </table>
+ <table name="phpbb_posts">
+ <column>post_id</column>
+ <column>topic_id</column>
+ <column>forum_id</column>
+ <column>post_text</column>
+ <row>
+ <value>1</value>
+ <value>1</value>
+ <value>1</value>
+ <value></value>
+ </row>
+ </table>
+ <table name="phpbb_topics">
+ <column>topic_id</column>
+ <column>forum_id</column>
+ <row>
+ <value>1</value>
+ <value>1</value>
+ </row>
+ </table>
+ <table name="phpbb_users">
+ <column>user_id</column>
+ <column>username_clean</column>
+ <column>user_permissions</column>
+ <column>user_sig</column>
+ <row>
+ <value>2</value>
+ <value>poster</value>
+ <value></value>
+ <value></value>
+ </row>
+ <row>
+ <value>6</value>
+ <value>noauth</value>
+ <value></value>
+ <value></value>
+ </row>
+ <row>
+ <value>7</value>
+ <value>default</value>
+ <value></value>
+ <value></value>
+ </row>
+ <row>
+ <value>8</value>
+ <value>notified</value>
+ <value></value>
+ <value></value>
+ </row>
+ </table>
+ <table name="phpbb_user_notifications">
+ <column>item_type</column>
+ <column>item_id</column>
+ <column>user_id</column>
+ <column>method</column>
+ <column>notify</column>
+ <row>
+ <value>notification.type.topic</value>
+ <value>0</value>
+ <value>2</value>
+ <value></value>
+ <value>1</value>
+ </row>
+ <row>
+ <value>notification.type.topic</value>
+ <value>0</value>
+ <value>6</value>
+ <value></value>
+ <value>1</value>
+ </row>
+ <row>
+ <value>notification.type.topic</value>
+ <value>0</value>
+ <value>7</value>
+ <value></value>
+ <value>1</value>
+ </row>
+ <row>
+ <value>notification.type.topic</value>
+ <value>0</value>
+ <value>8</value>
+ <value></value>
+ <value>1</value>
+ </row>
+ </table>
+</dataset>
diff --git a/tests/notification/fixtures/user_list_trim.xml b/tests/notification/fixtures/user_list_trim.xml
new file mode 100644
index 0000000000..4f708714da
--- /dev/null
+++ b/tests/notification/fixtures/user_list_trim.xml
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<dataset>
+ <table name="phpbb_users">
+ <column>user_id</column>
+ <column>username</column>
+ <column>username_clean</column>
+ <column>user_colour</column>
+ <column>user_permissions</column>
+ <column>user_sig</column>
+ <row>
+ <value>2</value>
+ <value>A</value>
+ <value>a</value>
+ <value></value>
+ <value></value>
+ <value></value>
+ </row>
+ <row>
+ <value>3</value>
+ <value>B</value>
+ <value>b</value>
+ <value></value>
+ <value></value>
+ <value></value>
+ </row>
+ <row>
+ <value>4</value>
+ <value>C</value>
+ <value>c</value>
+ <value></value>
+ <value></value>
+ <value></value>
+ </row>
+ <row>
+ <value>5</value>
+ <value>D</value>
+ <value>d</value>
+ <value></value>
+ <value></value>
+ <value></value>
+ </row>
+ <row>
+ <value>6</value>
+ <value>E</value>
+ <value>e</value>
+ <value></value>
+ <value></value>
+ <value></value>
+ </row>
+ </table>
+</dataset>
diff --git a/tests/notification/group_request_test.php b/tests/notification/group_request_test.php
new file mode 100644
index 0000000000..0d1bda95ce
--- /dev/null
+++ b/tests/notification/group_request_test.php
@@ -0,0 +1,114 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+require_once dirname(__FILE__) . '/base.php';
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
+
+class phpbb_notification_group_request_test extends phpbb_tests_notification_base
+{
+ public function getDataSet()
+ {
+ return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/group_request.xml');
+ }
+
+ protected function get_notification_types()
+ {
+ return array_merge(
+ parent::get_notification_types(),
+ array(
+ 'notification.type.group_request',
+ 'notification.type.group_request_approved',
+ )
+ );
+ }
+
+ public function test_notifications()
+ {
+ global $phpbb_root_path, $phpEx, $phpbb_dispatcher, $phpbb_log;
+
+ include_once($phpbb_root_path . 'includes/utf/utf_tools.' . $phpEx);
+ include_once($phpbb_root_path . 'includes/functions_user.' . $phpEx);
+ include_once($phpbb_root_path . 'includes/functions_content.' . $phpEx);
+
+ set_config(false, false, false, $this->config);
+
+ $this->container->set('groupposition.legend', new \phpbb\groupposition\legend(
+ $this->db,
+ $this->user
+ ));
+ $this->container->set('groupposition.teampage', new \phpbb\groupposition\teampage(
+ $this->db,
+ $this->user,
+ $this->cache->get_driver()
+ ));
+ $phpbb_dispatcher = new phpbb_mock_event_dispatcher;
+ $phpbb_log = new \phpbb\log\null();
+
+ // Now on to the actual test
+
+ $group_id = false;
+ group_create($group_id, GROUP_OPEN, 'test', 'test group', array());
+
+ // Add user 2 as group leader
+ group_user_add($group_id, 2, false, false, false, true, false);
+
+ // Add user 3 as pending
+ group_user_add($group_id, 3, false, false, false, false, true);
+
+ $this->assert_notifications(
+ array(
+ // user 3 pending notification
+ array(
+ 'item_id' => 3, // user_id of requesting join
+ 'item_parent_id' => $group_id,
+ 'user_id' => 2,
+ 'notification_read' => 0,
+ 'notification_data' => array(
+ 'group_name' => 'test',
+ ),
+ ),
+ ),
+ array(
+ 'user_id' => 2,
+ )
+ );
+
+ // Approve user 3 joining the group
+ group_user_attributes('approve', $group_id, array(3));
+
+ // user 3 pending notification should have been deleted
+ $this->assert_notifications(
+ array(),
+ array(
+ 'user_id' => 2,
+ )
+ );
+
+ $this->assert_notifications(
+ array(
+ // user 3 approved notification
+ array(
+ 'item_id' => $group_id, // user_id of requesting join
+ 'user_id' => 3,
+ 'notification_read' => 0,
+ 'notification_data' => array(
+ 'group_name' => 'test',
+ ),
+ ),
+ ),
+ array(
+ 'user_id' => 3,
+ )
+ );
+ }
+}
diff --git a/tests/notification/manager_helper.php b/tests/notification/manager_helper.php
new file mode 100644
index 0000000000..75b7275d3a
--- /dev/null
+++ b/tests/notification/manager_helper.php
@@ -0,0 +1,71 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+/**
+* @ignore
+*/
+if (!defined('IN_PHPBB'))
+{
+ exit;
+}
+
+/**
+* Notifications service class
+*/
+class phpbb_notification_manager_helper extends \phpbb\notification\manager
+{
+ public function set_var($name, $value)
+ {
+ $this->$name = $value;
+ }
+
+ // Extra dependencies for get_*_class functions
+ protected $auth = null;
+ protected $config = null;
+ public function setDependencies($auth, $config)
+ {
+ $this->auth = $auth;
+ $this->config = $config;
+ }
+
+ /**
+ * Helper to get the notifications item type class and set it up
+ */
+ public function get_item_type_class($item_type, $data = array())
+ {
+ $item_parts = explode('.', $item_type);
+ $item_type = 'phpbb\notification\type\\' . array_pop($item_parts);
+
+ $item = new $item_type($this->user_loader, $this->db, $this->cache->get_driver(), $this->user, $this->auth, $this->config, $this->phpbb_root_path, $this->php_ext, $this->notification_types_table, $this->notifications_table, $this->user_notifications_table);
+
+ $item->set_notification_manager($this);
+
+ $item->set_initial_data($data);
+
+ return $item;
+ }
+
+ /**
+ * Helper to get the notifications method class and set it up
+ */
+ public function get_method_class($method_name)
+ {
+ $method_name = 'phpbb\notification\method\\' . $method_name;
+
+ $method = new $method_name($this->user_loader, $this->db, $this->cache->get_driver(), $this->user, $this->auth, $this->config, $this->phpbb_root_path, $this->php_ext, $this->notification_types_table, $this->notifications_table, $this->user_notifications_table);
+
+ $method->set_notification_manager($this);
+
+ return $method;
+ }
+}
diff --git a/tests/notification/notification_test.php b/tests/notification/notification_test.php
new file mode 100644
index 0000000000..79fa5338c4
--- /dev/null
+++ b/tests/notification/notification_test.php
@@ -0,0 +1,330 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+require_once dirname(__FILE__) . '/base.php';
+
+class phpbb_notification_test extends phpbb_tests_notification_base
+{
+ protected $notifications, $db, $container, $user, $config, $auth, $cache;
+
+ public function getDataSet()
+ {
+ return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/notification.xml');
+ }
+
+ public function test_get_notification_type_id()
+ {
+ // They should be inserted the first time
+ $post_type_id = $this->notifications->get_notification_type_id('notification.type.post');
+ $quote_type_id = $this->notifications->get_notification_type_id('notification.type.quote');
+ $test_type_id = $this->notifications->get_notification_type_id('test');
+
+ $this->assertEquals(array(
+ 'test' => $test_type_id,
+ 'notification.type.quote' => $quote_type_id,
+ 'notification.type.post' => $post_type_id,
+ ),
+ $this->notifications->get_notification_type_ids(array(
+ 'test',
+ 'notification.type.quote',
+ 'notification.type.post',
+ )
+ ));
+ $this->assertEquals($quote_type_id, $this->notifications->get_notification_type_id('notification.type.quote'));
+
+ try
+ {
+ $this->assertEquals(false, $this->notifications->get_notification_type_id('fail'));
+
+ $this->fail('Non-existent type should throw an exception');
+ }
+ catch (Exception $e) {}
+ }
+
+ public function test_get_subscription_types()
+ {
+ $subscription_types = $this->notifications->get_subscription_types();
+
+ $this->assertArrayHasKey('NOTIFICATION_GROUP_MISCELLANEOUS', $subscription_types);
+ $this->assertArrayHasKey('NOTIFICATION_GROUP_POSTING', $subscription_types);
+
+ $this->assertArrayHasKey('notification.type.bookmark', $subscription_types['NOTIFICATION_GROUP_POSTING']);
+ $this->assertArrayHasKey('notification.type.post', $subscription_types['NOTIFICATION_GROUP_POSTING']);
+ $this->assertArrayHasKey('notification.type.quote', $subscription_types['NOTIFICATION_GROUP_POSTING']);
+ $this->assertArrayHasKey('notification.type.topic', $subscription_types['NOTIFICATION_GROUP_POSTING']);
+
+ $this->assertArrayHasKey('notification.type.pm', $subscription_types['NOTIFICATION_GROUP_MISCELLANEOUS']);
+
+ //get_subscription_types
+ //get_subscription_methods
+ }
+
+ public function test_subscriptions()
+ {
+ $expected_subscriptions = array(
+ 'notification.type.post' => array(''),
+ 'notification.type.topic' => array(''),
+ 'notification.type.quote' => array(''),
+ 'notification.type.bookmark' => array(''),
+ 'test' => array(''),
+ 'notification.type.pm' => array(''),
+ );
+
+ $subscriptions = $this->notifications->get_global_subscriptions(2);
+
+ foreach ($expected_subscriptions as $item_type => $methods)
+ {
+ $this->assert_array_content_equals($methods, $subscriptions[$item_type]);
+ }
+
+ foreach ($subscriptions as $item_type => $methods)
+ {
+ $this->assert_array_content_equals($methods, $expected_subscriptions[$item_type]);
+ }
+
+ $this->notifications->delete_subscription('notification.type.post', 0, '', 2);
+
+ $this->assertArrayNotHasKey('notification.type.post', $this->notifications->get_global_subscriptions(2));
+
+ $this->notifications->add_subscription('notification.type.post', 0, '', 2);
+
+ $this->assertArrayHasKey('notification.type.post', $this->notifications->get_global_subscriptions(2));
+ }
+
+ public function test_notifications()
+ {
+ $this->db->sql_query('DELETE FROM phpbb_notification_types');
+
+ $types = array('notification.type.quote', 'notification.type.bookmark', 'notification.type.post', 'test');
+ foreach ($types as $id => $type)
+ {
+ $this->db->sql_query('INSERT INTO phpbb_notification_types ' .
+ $this->db->sql_build_array('INSERT', array(
+ 'notification_type_id' => ($id + 1),
+ 'notification_type_name' => $type,
+ 'notification_type_enabled' => 1,
+ ))
+ );
+ }
+
+ // Used to test post notifications later
+ $this->db->sql_query('INSERT INTO ' . TOPICS_WATCH_TABLE . ' ' . $this->db->sql_build_array('INSERT', array(
+ 'topic_id' => 2,
+ 'notify_status' => NOTIFY_YES,
+ 'user_id' => 0,
+ )));
+
+ $this->assertEquals(array(
+ 'notifications' => array(),
+ 'unread_count' => 0,
+ 'total_count' => 0,
+ ), $this->notifications->load_notifications(array(
+ 'count_unread' => true,
+ )));
+
+ $this->notifications->add_notifications('test', array(
+ 'post_id' => '1',
+ 'topic_id' => '1',
+ 'post_time' => 1349413321,
+ ));
+
+ $this->notifications->add_notifications('test', array(
+ 'post_id' => '2',
+ 'topic_id' => '2',
+ 'post_time' => 1349413322,
+ ));
+
+ $this->notifications->add_notifications('test', array(
+ 'post_id' => '3',
+ 'topic_id' => '2',
+ 'post_time' => 1349413323,
+ ));
+
+ $this->notifications->add_notifications(array('notification.type.quote', 'notification.type.bookmark', 'notification.type.post', 'test'), array(
+ 'post_id' => '4',
+ 'topic_id' => '2',
+ 'post_time' => 1349413324,
+ 'poster_id' => 2,
+ 'topic_title' => 'test-title',
+ 'post_subject' => 'Re: test-title',
+ 'forum_id' => 2,
+ 'forum_name' => 'Your first forum',
+ ));
+
+ $this->db->sql_query('INSERT INTO ' . BOOKMARKS_TABLE . ' ' . $this->db->sql_build_array('INSERT', array(
+ 'topic_id' => 2,
+ 'user_id' => 0,
+ )));
+
+ $this->notifications->add_notifications(array('notification.type.quote', 'notification.type.bookmark', 'notification.type.post', 'test'), array(
+ 'post_id' => '5',
+ 'topic_id' => '2',
+ 'post_time' => 1349413325,
+ 'poster_id' => 2,
+ 'topic_title' => 'test-title',
+ 'post_subject' => 'Re: test-title',
+ 'forum_id' => 2,
+ 'forum_name' => 'Your first forum',
+ ));
+
+ $this->notifications->delete_subscription('test');
+
+ $this->notifications->add_notifications('test', array(
+ 'post_id' => '6',
+ 'topic_id' => '2',
+ 'post_time' => 1349413326,
+ ));
+
+ $this->assert_notifications(
+ array(
+ array(
+ 'item_id' => 1,
+ 'item_parent_id' => 1,
+ 'user_id' => 0,
+ 'notification_read' => 0,
+ 'notification_time' => 1349413321,
+ 'notification_data' => array(),
+ ),
+ array(
+ 'item_id' => 2,
+ 'item_parent_id' => 2,
+ 'user_id' => 0,
+ 'notification_read' => 0,
+ 'notification_time' => 1349413322,
+ 'notification_data' => array(),
+ ),
+ array(
+ 'item_id' => 3,
+ 'item_parent_id' => 2,
+ 'user_id' => 0,
+ 'notification_read' => 0,
+ 'notification_time' => 1349413323,
+ 'notification_data' => array(),
+ ),
+ array(
+ 'item_id' => 4,
+ 'item_parent_id' => 2,
+ 'user_id' => 0,
+ 'notification_read' => 0,
+ 'notification_time' => 1349413324,
+ 'notification_data' => array(
+ 'poster_id' => 2,
+ 'topic_title' => 'test-title',
+ 'post_subject' => 'Re: test-title',
+ 'post_username' => '',
+ 'forum_id' => 2,
+ 'forum_name' => 'Your first forum',
+ ),
+ ),
+ array(
+ 'item_id' => 5,
+ 'item_parent_id' => 2,
+ 'user_id' => 0,
+ 'notification_read' => 0,
+ 'notification_time' => 1349413325,
+ 'notification_data' => array(
+ 'poster_id' => 2,
+ 'topic_title' => 'test-title',
+ 'post_subject' => 'Re: test-title',
+ 'post_username' => '',
+ 'forum_id' => 2,
+ 'forum_name' => 'Your first forum',
+ ),
+ ),
+ )
+ );
+
+ // Now test updating -------------------------------
+
+ $this->notifications->update_notifications('test', array(
+ 'post_id' => '1',
+ 'topic_id' => '2', // change parent_id
+ 'post_time' => 1349413321,
+ ));
+
+ $this->notifications->update_notifications('test', array(
+ 'post_id' => '3',
+ 'topic_id' => '2',
+ 'post_time' => 1234, // change time
+ ));
+
+ $this->notifications->update_notifications(array('notification.type.quote', 'notification.type.bookmark', 'notification.type.post', 'test'), array(
+ 'post_id' => '5',
+ 'topic_id' => '2',
+ 'poster_id' => 2,
+ 'topic_title' => 'test-title2', // change topic_title
+ 'post_subject' => 'Re: test-title2', // change post_subject
+ 'forum_id' => 3, // change forum_id
+ 'forum_name' => 'Your second forum', // change forum_name
+ ));
+
+ $this->assert_notifications(
+ array(
+ array(
+ 'item_id' => 3,
+ 'item_parent_id' => 2,
+ 'user_id' => 0,
+ 'notification_read' => 0,
+ 'notification_time' => 1234,
+ 'notification_data' => array(),
+ ),
+ array(
+ 'item_id' => 1,
+ 'item_parent_id' => 2,
+ 'user_id' => 0,
+ 'notification_read' => 0,
+ 'notification_time' => 1349413321,
+ 'notification_data' => array(),
+ ),
+ array(
+ 'item_id' => 2,
+ 'item_parent_id' => 2,
+ 'user_id' => 0,
+ 'notification_read' => 0,
+ 'notification_time' => 1349413322,
+ 'notification_data' => array(),
+ ),
+ array(
+ 'item_id' => 4,
+ 'item_parent_id' => 2,
+ 'user_id' => 0,
+ 'notification_read' => 0,
+ 'notification_time' => 1349413324,
+ 'notification_data' => array(
+ 'poster_id' => 2,
+ 'topic_title' => 'test-title',
+ 'post_subject' => 'Re: test-title',
+ 'post_username' => '',
+ 'forum_id' => 2,
+ 'forum_name' => 'Your first forum',
+ ),
+ ),
+ array(
+ 'item_id' => 5,
+ 'item_parent_id' => 2,
+ 'user_id' => 0,
+ 'notification_read' => 0,
+ 'notification_time' => 1349413325,
+ 'notification_data' => array(
+ 'poster_id' => 2,
+ 'topic_title' => 'test-title2',
+ 'post_subject' => 'Re: test-title2',
+ 'post_username' => '',
+ 'forum_id' => 3,
+ 'forum_name' => 'Your second forum',
+ ),
+ ),
+ )
+ );
+ }
+}
diff --git a/tests/notification/submit_post_base.php b/tests/notification/submit_post_base.php
new file mode 100644
index 0000000000..5e770f71c9
--- /dev/null
+++ b/tests/notification/submit_post_base.php
@@ -0,0 +1,154 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions_content.php';
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions_posting.php';
+require_once dirname(__FILE__) . '/../../phpBB/includes/utf/utf_tools.php';
+
+abstract class phpbb_notification_submit_post_base extends phpbb_database_test_case
+{
+ protected $notifications, $db, $container, $user, $config, $auth, $cache;
+
+ protected $item_type = '';
+
+ protected $poll_data = array();
+ protected $post_data = array(
+ 'forum_id' => 1,
+ 'topic_id' => 1,
+ 'topic_title' => 'topic_title',
+ 'icon_id' => 0,
+ 'enable_bbcode' => 0,
+ 'enable_smilies' => 0,
+ 'enable_urls' => 0,
+ 'enable_sig' => 0,
+ 'message' => '',
+ 'message_md5' => '',
+ 'attachment_data' => array(),
+ 'bbcode_bitfield' => '',
+ 'bbcode_uid' => '',
+ 'post_edit_locked' => false,
+ //'force_approved_state' => 1,
+ );
+
+ public function getDataSet()
+ {
+ return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/submit_post_' . $this->item_type . '.xml');
+ }
+
+ public function setUp()
+ {
+ parent::setUp();
+
+ global $auth, $cache, $config, $db, $phpbb_container, $phpbb_dispatcher, $user, $request, $phpEx, $phpbb_root_path;
+
+ // Database
+ $this->db = $this->new_dbal();
+ $db = $this->db;
+
+ // Auth
+ $auth = $this->getMock('\phpbb\auth\auth');
+ $auth->expects($this->any())
+ ->method('acl_get')
+ ->with($this->stringContains('_'),
+ $this->anything())
+ ->will($this->returnValueMap(array(
+ array('f_noapprove', 1, true),
+ array('f_postcount', 1, true),
+ array('m_edit', 1, false),
+ )));
+
+ // Config
+ $config = new \phpbb\config\config(array('num_topics' => 1,'num_posts' => 1,));
+ set_config(null, null, null, $config);
+ set_config_count(null, null, null, $config);
+
+ $cache = new \phpbb\cache\service(
+ new \phpbb\cache\driver\null(),
+ $config,
+ $db,
+ $phpbb_root_path,
+ $phpEx
+ );
+
+ // Event dispatcher
+ $phpbb_dispatcher = new phpbb_mock_event_dispatcher();
+
+ // User
+ $user = $this->getMock('\phpbb\user', array(), array('\phpbb\datetime'));
+ $user->ip = '';
+ $user->data = array(
+ 'user_id' => 2,
+ 'username' => 'user-name',
+ 'is_registered' => true,
+ 'user_colour' => '',
+ );
+
+ // Request
+ $type_cast_helper = $this->getMock('\phpbb\request\type_cast_helper_interface');
+ $request = $this->getMock('\phpbb\request\request');
+
+ // Container
+ $phpbb_container = new phpbb_mock_container_builder();
+ $phpbb_dispatcher = new phpbb_mock_event_dispatcher();
+ $phpbb_container->set('content.visibility', new \phpbb\content_visibility($auth, $config, $phpbb_dispatcher, $db, $user, $phpbb_root_path, $phpEx, FORUMS_TABLE, POSTS_TABLE, TOPICS_TABLE, USERS_TABLE));
+
+ $user_loader = new \phpbb\user_loader($db, $phpbb_root_path, $phpEx, USERS_TABLE);
+
+ // Notification Types
+ $notification_types = array('quote', 'bookmark', 'post', 'post_in_queue', 'topic', 'topic_in_queue', 'approve_topic', 'approve_post');
+ $notification_types_array = array();
+ foreach ($notification_types as $type)
+ {
+ $class_name = '\phpbb\notification\type\\' . $type;
+ $class = new $class_name(
+ $user_loader, $db, $cache->get_driver(), $user, $auth, $config,
+ $phpbb_root_path, $phpEx,
+ NOTIFICATION_TYPES_TABLE, NOTIFICATIONS_TABLE, USER_NOTIFICATIONS_TABLE);
+
+ $phpbb_container->set('notification.type.' . $type, $class);
+
+ $notification_types_array['notification.type.' . $type] = $class;
+ }
+
+ // Notification Manager
+ $phpbb_notifications = new \phpbb\notification\manager($notification_types_array, array(),
+ $phpbb_container, $user_loader, $config, $phpbb_dispatcher, $db, $cache, $user,
+ $phpbb_root_path, $phpEx,
+ NOTIFICATION_TYPES_TABLE, NOTIFICATIONS_TABLE, USER_NOTIFICATIONS_TABLE);
+ $phpbb_container->set('notification_manager', $phpbb_notifications);
+ }
+
+ /**
+ * @dataProvider submit_post_data
+ */
+ public function test_submit_post($additional_post_data, $expected_before, $expected_after)
+ {
+ $sql = 'SELECT user_id, item_id, item_parent_id
+ FROM ' . NOTIFICATIONS_TABLE . ' n, ' . NOTIFICATION_TYPES_TABLE . " nt
+ WHERE nt.notification_type_name = '" . $this->item_type . "'
+ AND n.notification_type_id = nt.notification_type_id
+ ORDER BY user_id ASC, item_id ASC";
+ $result = $this->db->sql_query($sql);
+ $this->assertEquals($expected_before, $this->db->sql_fetchrowset($result));
+ $this->db->sql_freeresult($result);
+
+ $poll_data = $this->poll_data;
+ $post_data = array_merge($this->post_data, $additional_post_data);
+ submit_post('reply', '', 'poster-name', POST_NORMAL, $poll_data, $post_data, false, false);
+
+ $result = $this->db->sql_query($sql);
+ $this->assertEquals($expected_after, $this->db->sql_fetchrowset($result));
+ $this->db->sql_freeresult($result);
+ }
+}
diff --git a/tests/notification/submit_post_type_bookmark_test.php b/tests/notification/submit_post_type_bookmark_test.php
new file mode 100644
index 0000000000..7c3b9f938f
--- /dev/null
+++ b/tests/notification/submit_post_type_bookmark_test.php
@@ -0,0 +1,94 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+require_once dirname(__FILE__) . '/submit_post_base.php';
+
+class phpbb_notification_submit_post_type_bookmark_test extends phpbb_notification_submit_post_base
+{
+ protected $item_type = 'notification.type.bookmark';
+
+ public function setUp()
+ {
+ parent::setUp();
+
+ global $auth;
+
+ // Add additional permissions
+ $auth->expects($this->any())
+ ->method('acl_get_list')
+ ->with($this->anything(),
+ $this->stringContains('_'),
+ $this->greaterThan(0))
+ ->will($this->returnValueMap(array(
+ array(
+ array(3, 4, 5, 6, 7),
+ 'f_read',
+ 1,
+ array(
+ 1 => array(
+ 'f_read' => array(3, 5, 6, 7),
+ ),
+ ),
+ ),
+ )));
+ }
+
+ /**
+ * submit_post() Notifications test
+ *
+ * submit_post() $mode = 'reply'
+ * Notification item_type = 'bookmark'
+ */
+ public function submit_post_data()
+ {
+ return array(
+ /**
+ * Normal post
+ *
+ * User => State description
+ * 2 => Poster, should NOT receive a notification
+ * 3 => Bookmarked, should receive a notification
+ * 4 => Bookmarked, but unauthed to read, should NOT receive a notification
+ * 5 => Bookmarked, but already notified, should NOT receive a new notification
+ * 6 => Bookmarked, but option disabled, should NOT receive a notification
+ * 7 => Bookmarked, option set to default, should receive a notification
+ */
+ array(
+ array(),
+ array(
+ array('user_id' => 5, 'item_id' => 1, 'item_parent_id' => 1),
+ ),
+ array(
+ array('user_id' => 3, 'item_id' => 2, 'item_parent_id' => 1),
+ array('user_id' => 5, 'item_id' => 1, 'item_parent_id' => 1),
+ array('user_id' => 7, 'item_id' => 2, 'item_parent_id' => 1),
+ ),
+ ),
+
+ /**
+ * Unapproved post
+ *
+ * No new notifications
+ */
+ array(
+ array('force_approved_state' => false),
+ array(
+ array('user_id' => 5, 'item_id' => 1, 'item_parent_id' => 1),
+ ),
+ array(
+ array('user_id' => 5, 'item_id' => 1, 'item_parent_id' => 1),
+ ),
+ ),
+ );
+ }
+}
diff --git a/tests/notification/submit_post_type_post_in_queue_test.php b/tests/notification/submit_post_type_post_in_queue_test.php
new file mode 100644
index 0000000000..1390e92d96
--- /dev/null
+++ b/tests/notification/submit_post_type_post_in_queue_test.php
@@ -0,0 +1,111 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+require_once dirname(__FILE__) . '/submit_post_base.php';
+
+class phpbb_notification_submit_post_type_post_in_queue_test extends phpbb_notification_submit_post_base
+{
+ protected $item_type = 'notification.type.post_in_queue';
+
+ public function setUp()
+ {
+ parent::setUp();
+
+ global $auth;
+
+ // Add additional permissions
+ $auth->expects($this->any())
+ ->method('acl_get_list')
+ ->with($this->anything(),
+ $this->stringContains('_'),
+ $this->greaterThan(0))
+ ->will($this->returnValueMap(array(
+ array(
+ false,
+ 'm_approve',
+ array(1, 0),
+ array(
+ 0 => array(
+ 'm_approve' => array(9),
+ ),
+ 1 => array(
+ 'm_approve' => array(3, 4, 6, 7, 8),
+ ),
+ ),
+ ),
+ array(
+ array(3, 4, 6, 7, 8, 9),
+ 'f_read',
+ 1,
+ array(
+ 1 => array(
+ 'f_read' => array(3, 6, 7, 8, 9),
+ ),
+ ),
+ ),
+ )));
+ }
+
+ /**
+ * submit_post() Notifications test
+ *
+ * submit_post() $mode = 'reply'
+ * Notification item_type = 'post_in_queue'
+ */
+ public function submit_post_data()
+ {
+ return array(
+ /**
+ * Normal post
+ *
+ * No new notifications
+ */
+ array(
+ array(),
+ array(
+ array('user_id' => 6, 'item_id' => 1, 'item_parent_id' => 1),
+ ),
+ array(
+ array('user_id' => 6, 'item_id' => 1, 'item_parent_id' => 1),
+ ),
+ ),
+
+ /**
+ * Unapproved post
+ *
+ * User => State description
+ * 2 => Poster, should NOT receive a notification
+ * 3 => Moderator, should receive a notification
+ * 4 => Moderator, but unauthed to read, should NOT receive a notification
+ * 5 => Moderator, but unauthed to approve, should NOT receive a notification
+ * 6 => Moderator, but already notified, should STILL receive a new notification
+ * 7 => Moderator, but option disabled, should NOT receive a notification
+ * 8 => Moderator, option set to default, should receive a notification
+ * 9 => Moderator, has only global mod permissions, should receive a notification
+ */
+ array(
+ array('force_approved_state' => false),
+ array(
+ array('user_id' => 6, 'item_id' => 1, 'item_parent_id' => 1),
+ ),
+ array(
+ array('user_id' => 3, 'item_id' => 2, 'item_parent_id' => 1),
+ array('user_id' => 6, 'item_id' => 1, 'item_parent_id' => 1),
+ array('user_id' => 6, 'item_id' => 2, 'item_parent_id' => 1),
+ array('user_id' => 8, 'item_id' => 2, 'item_parent_id' => 1),
+ array('user_id' => 9, 'item_id' => 2, 'item_parent_id' => 1),
+ ),
+ ),
+ );
+ }
+}
diff --git a/tests/notification/submit_post_type_post_test.php b/tests/notification/submit_post_type_post_test.php
new file mode 100644
index 0000000000..037c326bc0
--- /dev/null
+++ b/tests/notification/submit_post_type_post_test.php
@@ -0,0 +1,100 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+require_once dirname(__FILE__) . '/submit_post_base.php';
+
+class phpbb_notification_submit_post_type_post_test extends phpbb_notification_submit_post_base
+{
+ protected $item_type = 'notification.type.post';
+
+ public function setUp()
+ {
+ parent::setUp();
+
+ global $auth;
+
+ // Add additional permissions
+ $auth->expects($this->any())
+ ->method('acl_get_list')
+ ->with($this->anything(),
+ $this->stringContains('_'),
+ $this->greaterThan(0))
+ ->will($this->returnValueMap(array(
+ array(
+ array(3, 4, 5, 6, 7, 8),
+ 'f_read',
+ 1,
+ array(
+ 1 => array(
+ 'f_read' => array(3, 5, 6, 7, 8),
+ ),
+ ),
+ ),
+ )));
+ }
+
+ /**
+ * submit_post() Notifications test
+ *
+ * submit_post() $mode = 'reply'
+ * Notification item_type = 'post'
+ */
+ public function submit_post_data()
+ {
+ return array(
+ /**
+ * Normal post
+ *
+ * User => State description
+ * 2 => Poster, should NOT receive a notification
+ * 3 => Topic subscribed, should receive a notification
+ * 4 => Topic subscribed, but unauthed to read, should NOT receive a notification
+ * 5 => Topic subscribed, but already notified, should NOT receive a new notification
+ * 6 => Topic and forum subscribed, should receive ONE notification
+ * 7 => Forum subscribed, should receive a notification
+ * 8 => Forum subscribed, but already notified, should NOT receive a new notification
+ */
+ array(
+ array(),
+ array(
+ array('user_id' => 5, 'item_id' => 1, 'item_parent_id' => 1),
+ array('user_id' => 8, 'item_id' => 1, 'item_parent_id' => 1),
+ ),
+ array(
+ array('user_id' => 3, 'item_id' => 2, 'item_parent_id' => 1),
+ array('user_id' => 5, 'item_id' => 1, 'item_parent_id' => 1),
+ array('user_id' => 6, 'item_id' => 2, 'item_parent_id' => 1),
+ array('user_id' => 7, 'item_id' => 2, 'item_parent_id' => 1),
+ array('user_id' => 8, 'item_id' => 1, 'item_parent_id' => 1),
+ ),
+ ),
+
+ /**
+ * Unapproved post
+ *
+ * No new notifications
+ */
+ array(
+ array('force_approved_state' => false),
+ array(
+ array('user_id' => 5, 'item_id' => 1, 'item_parent_id' => 1),
+ array('user_id' => 8, 'item_id' => 1, 'item_parent_id' => 1),
+ ),
+ array(
+ array('user_id' => 5, 'item_id' => 1, 'item_parent_id' => 1),
+ array('user_id' => 8, 'item_id' => 1, 'item_parent_id' => 1),
+ ),
+ ),
+ );
+ }
+}
diff --git a/tests/notification/submit_post_type_quote_test.php b/tests/notification/submit_post_type_quote_test.php
new file mode 100644
index 0000000000..61e3840773
--- /dev/null
+++ b/tests/notification/submit_post_type_quote_test.php
@@ -0,0 +1,118 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+require_once dirname(__FILE__) . '/submit_post_base.php';
+
+class phpbb_notification_submit_post_type_quote_test extends phpbb_notification_submit_post_base
+{
+ protected $item_type = 'notification.type.quote';
+
+ public function setUp()
+ {
+ parent::setUp();
+
+ global $auth;
+
+ // Add additional permissions
+ $auth->expects($this->any())
+ ->method('acl_get_list')
+ ->with($this->anything(),
+ $this->stringContains('_'),
+ $this->greaterThan(0))
+ ->will($this->returnValueMap(array(
+ array(
+ array(3, 4, 5, 6, 7),
+ 'f_read',
+ 1,
+ array(
+ 1 => array(
+ 'f_read' => array(3, 5, 6, 7),
+ ),
+ ),
+ ),
+ )));
+ }
+
+ /**
+ * submit_post() Notifications test
+ *
+ * submit_post() $mode = 'reply'
+ * Notification item_type = 'quote'
+ */
+ public function submit_post_data()
+ {
+ return array(
+ /**
+ * Normal post
+ *
+ * User => State description
+ * 2 => Poster, should NOT receive a notification
+ * 3 => Quoted, should receive a notification
+ * 4 => Quoted, but unauthed to read, should NOT receive a notification
+ * 5 => Quoted, but already notified, should STILL receive a new notification
+ * 6 => Quoted, but option disabled, should NOT receive a notification
+ * 7 => Quoted, option set to default, should receive a notification
+ */
+ array(
+ array(
+ 'message' => implode(' ', array(
+ '[quote=&quot;poster&quot;:uid]poster should not be notified[/quote:uid]',
+ '[quote=&quot;test&quot;:uid]test should be notified[/quote:uid]',
+ '[quote=&quot;unauthorized&quot;:uid]unauthorized to read, should not receive a notification[/quote:uid]',
+ '[quote=&quot;notified&quot;:uid]already notified, should not receive a new notification[/quote:uid]',
+ '[quote=&quot;disabled&quot;:uid]option disabled, should not receive a notification[/quote:uid]',
+ '[quote=&quot;default&quot;:uid]option set to default, should receive a notification[/quote:uid]',
+ '[quote=&quot;doesn\'t exist&quot;:uid]user does not exist, should not receive a notification[/quote:uid]',
+ )),
+ 'bbcode_uid' => 'uid',
+ ),
+ array(
+ array('user_id' => 5, 'item_id' => 1, 'item_parent_id' => 1),
+ ),
+ array(
+ array('user_id' => 3, 'item_id' => 2, 'item_parent_id' => 1),
+ array('user_id' => 5, 'item_id' => 1, 'item_parent_id' => 1),
+ array('user_id' => 5, 'item_id' => 2, 'item_parent_id' => 1),
+ array('user_id' => 7, 'item_id' => 2, 'item_parent_id' => 1),
+ ),
+ ),
+
+ /**
+ * Unapproved post
+ *
+ * No new notifications
+ */
+ array(
+ array(
+ 'message' => implode(' ', array(
+ '[quote=&quot;poster&quot;:uid]poster should not be notified[/quote:uid]',
+ '[quote=&quot;test&quot;:uid]test should be notified[/quote:uid]',
+ '[quote=&quot;unauthorized&quot;:uid]unauthorized to read, should not receive a notification[/quote:uid]',
+ '[quote=&quot;notified&quot;:uid]already notified, should not receive a new notification[/quote:uid]',
+ '[quote=&quot;disabled&quot;:uid]option disabled, should not receive a notification[/quote:uid]',
+ '[quote=&quot;default&quot;:uid]option set to default, should receive a notification[/quote:uid]',
+ '[quote=&quot;doesn\'t exist&quot;:uid]user does not exist, should not receive a notification[/quote:uid]',
+ )),
+ 'bbcode_uid' => 'uid',
+ 'force_approved_state' => false,
+ ),
+ array(
+ array('user_id' => 5, 'item_id' => 1, 'item_parent_id' => 1),
+ ),
+ array(
+ array('user_id' => 5, 'item_id' => 1, 'item_parent_id' => 1),
+ ),
+ ),
+ );
+ }
+}
diff --git a/tests/notification/submit_post_type_topic_test.php b/tests/notification/submit_post_type_topic_test.php
new file mode 100644
index 0000000000..c095fbc4ba
--- /dev/null
+++ b/tests/notification/submit_post_type_topic_test.php
@@ -0,0 +1,153 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+require_once dirname(__FILE__) . '/submit_post_base.php';
+
+class phpbb_notification_submit_post_type_topic_test extends phpbb_notification_submit_post_base
+{
+ protected $item_type = 'notification.type.topic';
+
+ public function setUp()
+ {
+ parent::setUp();
+
+ global $auth, $phpbb_log;
+
+ // Add additional permissions
+ $auth->expects($this->any())
+ ->method('acl_get_list')
+ ->with($this->anything(),
+ $this->stringContains('_'),
+ $this->greaterThan(0))
+ ->will($this->returnValueMap(array(
+ array(
+ array(6, 7, 8),
+ 'f_read',
+ 1,
+ array(
+ 1 => array(
+ 'f_read' => array(7, 8),
+ ),
+ ),
+ ),
+ )));
+
+ $phpbb_log = $this->getMock('\phpbb\log\null');
+ }
+
+ /**
+ * submit_post() Notifications test
+ *
+ * submit_post() $mode = 'post'
+ * Notification item_type = 'topic'
+ */
+ public function submit_post_data()
+ {
+ return array(
+ /**
+ * Normal post
+ *
+ * User => State description
+ * 2 => Poster, should NOT receive a notification
+ * 6 => Forum subscribed, but no-auth reading, should NOT receive a notification
+ * 7 => Forum subscribed, should receive a notification
+ * 8 => Forum subscribed, but already notified, should NOT receive a new notification
+ */
+ array(
+ array(),
+ array(
+ array('user_id' => 8, 'item_id' => 1, 'item_parent_id' => 1),
+ ),
+ array(
+ array('user_id' => 7, 'item_id' => 2, 'item_parent_id' => 1),
+ array('user_id' => 8, 'item_id' => 1, 'item_parent_id' => 1),
+ array('user_id' => 8, 'item_id' => 2, 'item_parent_id' => 1),
+ ),
+ ),
+
+ /**
+ * Unapproved post
+ *
+ * No new notifications
+ */
+ array(
+ array('force_approved_state' => false),
+ array(
+ array('user_id' => 8, 'item_id' => 1, 'item_parent_id' => 1),
+ ),
+ array(
+ array('user_id' => 8, 'item_id' => 1, 'item_parent_id' => 1),
+ ),
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider submit_post_data
+ */
+ public function test_submit_post($additional_post_data, $expected_before, $expected_after)
+ {
+ $sql = 'SELECT user_id, item_id, item_parent_id
+ FROM ' . NOTIFICATIONS_TABLE . ' n, ' . NOTIFICATION_TYPES_TABLE . " nt
+ WHERE nt.notification_type_name = '" . $this->item_type . "'
+ AND n.notification_type_id = nt.notification_type_id
+ ORDER BY user_id ASC, item_id ASC";
+ $result = $this->db->sql_query($sql);
+ $this->assertEquals($expected_before, $this->db->sql_fetchrowset($result));
+ $this->db->sql_freeresult($result);
+
+ $poll_data = array();
+ $post_data = array_merge($this->post_data, $additional_post_data);
+ submit_post('post', '', 'poster-name', POST_NORMAL, $poll_data, $post_data, false, false);
+
+ // Check whether the notifications got added successfully
+ $result = $this->db->sql_query($sql);
+ $this->assertEquals($expected_after, $this->db->sql_fetchrowset($result),
+ 'Check whether the notifications got added successfully');
+ $this->db->sql_freeresult($result);
+
+ if (isset($additional_post_data['force_approved_state']) && $additional_post_data['force_approved_state'] === false)
+ {
+ return;
+ }
+
+ $reply_data = array_merge($this->post_data, array(
+ 'topic_id' => 2,
+ ));
+ $url = submit_post('reply', '', 'poster-name', POST_NORMAL, $poll_data, $reply_data, false, false);
+ $reply_id = 3;
+ $this->assertStringEndsWith('p' . $reply_id, $url, 'Post ID of reply is not ' . $reply_id);
+
+ // Check whether the notifications are still correct after a reply has been added
+ $result = $this->db->sql_query($sql);
+ $this->assertEquals($expected_after, $this->db->sql_fetchrowset($result),
+ 'Check whether the notifications are still correct after a reply has been added');
+ $this->db->sql_freeresult($result);
+
+ $result = $this->db->sql_query(
+ 'SELECT *
+ FROM ' . POSTS_TABLE . '
+ WHERE post_id = ' . $reply_id);
+ $reply_edit_data = array_merge($this->post_data, $this->db->sql_fetchrow($result), array(
+ 'force_approved_state' => false,
+ 'post_edit_reason' => 'PHPBB3-12370',
+ ));
+ submit_post('edit', '', 'poster-name', POST_NORMAL, $poll_data, $reply_edit_data, false, false);
+
+ // Check whether the notifications are still correct after the reply has been edit
+ $result = $this->db->sql_query($sql);
+ $this->assertEquals($expected_after, $this->db->sql_fetchrowset($result),
+ 'Check whether the notifications are still correct after the reply has been edit');
+ $this->db->sql_freeresult($result);
+ }
+}
diff --git a/tests/notification/user_list_trim_test.php b/tests/notification/user_list_trim_test.php
new file mode 100644
index 0000000000..c43eff729c
--- /dev/null
+++ b/tests/notification/user_list_trim_test.php
@@ -0,0 +1,143 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions_content.php';
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
+
+class phpbb_notification_user_list_trim_test extends phpbb_database_test_case
+{
+ protected $notification;
+
+ public function getDataSet()
+ {
+ return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/user_list_trim.xml');
+ }
+
+ public function setUp()
+ {
+ global $phpbb_root_path, $phpEx, $phpbb_dispatcher, $user, $cache, $auth;
+
+ parent::setUp();
+
+ $phpbb_dispatcher = new phpbb_mock_event_dispatcher();
+ $db = $this->new_dbal();
+
+ $config = new \phpbb\config\config(array());
+ set_config(null, null, null, $config);
+ set_config_count(null, null, null, $config);
+
+ $cache = new \phpbb\cache\service(
+ new \phpbb\cache\driver\null(),
+ $config,
+ $db,
+ $phpbb_root_path,
+ $phpEx
+ );
+
+ $auth = $this->getMock('\phpbb\auth\auth');
+ $auth->expects($this->any())
+ ->method('acl_get')
+ ->with($this->stringContains('_'),
+ $this->anything())
+ ->will($this->returnValueMap(array(
+ array('u_viewprofile', 1, false),
+ )));
+
+ $user = new \phpbb\user('\phpbb\datetime');
+ $user->data = array('user_lang' => 'en');
+ $user->add_lang('common');
+
+ $user_loader = new phpbb\user_loader($db, $phpbb_root_path, $phpEx, USERS_TABLE);
+ $user_loader->load_users(array(2, 3, 4, 5, 6));
+
+ $this->notification = new phpbb_mock_notification_type_post(
+ $user_loader, null, null, $user, null, null, $phpbb_root_path, $phpEx, null, null, null
+ );
+ }
+
+ public function user_list_trim_data()
+ {
+ return array(
+ array(
+ array(
+ 'topic_title' => 'Test',
+ 'poster_id' => 2,
+ 'post_username' => 'A',
+ 'responders' => null,
+ ),
+ '<strong>Reply</strong> from A in topic:',
+ ),
+ array(
+ array(
+ 'topic_title' => 'Test',
+ 'poster_id' => 2,
+ 'post_username' => 'A',
+ 'responders' => array(
+ array('username' => '', 'poster_id' => 3),
+ ),
+ ),
+ '<strong>Reply</strong> from A and <span class="username">B</span> in topic:',
+ ),
+ array(
+ array(
+ 'topic_title' => 'Test',
+ 'poster_id' => 2,
+ 'post_username' => 'A',
+ 'responders' => array(
+ array('username' => '', 'poster_id' => 3),
+ array('username' => '', 'poster_id' => 4),
+ ),
+ ),
+ '<strong>Reply</strong> from A, <span class="username">B</span>, and <span class="username">C</span> in topic:',
+ ),
+ array(
+ array(
+ 'topic_title' => 'Test',
+ 'poster_id' => 2,
+ 'post_username' => 'A',
+ 'responders' => array(
+ array('username' => '', 'poster_id' => 3),
+ array('username' => '', 'poster_id' => 4),
+ array('username' => '', 'poster_id' => 5),
+ ),
+ ),
+ '<strong>Reply</strong> from A, <span class="username">B</span>, <span class="username">C</span>, and <span class="username">D</span> in topic:',
+ ),
+ array(
+ array(
+ 'topic_title' => 'Test',
+ 'poster_id' => 2,
+ 'post_username' => 'A',
+ 'responders' => array(
+ array('username' => '', 'poster_id' => 3),
+ array('username' => '', 'poster_id' => 4),
+ array('username' => '', 'poster_id' => 5),
+ array('username' => '', 'poster_id' => 6),
+ ),
+ ),
+ '<strong>Reply</strong> from A, <span class="username">B</span>, <span class="username">C</span>, and 2 others in topic:',
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider user_list_trim_data
+ */
+ public function test_user_list_trim($data, $expected_result)
+ {
+ $data = array('notification_data' => serialize($data));
+ $this->notification->set_initial_data($data);
+
+ $this->assertEquals($expected_result, $this->notification->get_title());
+ }
+}
diff --git a/tests/pagination/config/routing.yml b/tests/pagination/config/routing.yml
new file mode 100644
index 0000000000..2ce082c9d1
--- /dev/null
+++ b/tests/pagination/config/routing.yml
@@ -0,0 +1,6 @@
+core_controller:
+ path: /test
+ defaults: { _controller: core_foo.controller:bar, page: 1}
+core_page_controller:
+ path: /test/page/{page}
+ defaults: { _controller: core_foo.controller:bar}
diff --git a/tests/pagination/pagination_test.php b/tests/pagination/pagination_test.php
new file mode 100644
index 0000000000..ea6dd999c3
--- /dev/null
+++ b/tests/pagination/pagination_test.php
@@ -0,0 +1,331 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+require_once dirname(__FILE__) . '/../template/template_test_case.php';
+
+class phpbb_pagination_pagination_test extends phpbb_template_template_test_case
+{
+ protected $test_path = 'tests/pagination';
+
+ public function return_callback_implode()
+ {
+ return implode('-', func_get_args());
+ }
+
+ public function setUp()
+ {
+ parent::setUp();
+
+ global $phpbb_dispatcher;
+
+ $phpbb_dispatcher = new phpbb_mock_event_dispatcher();
+ $this->user = $this->getMock('\phpbb\user', array(), array('\phpbb\datetime'));
+ $this->user->expects($this->any())
+ ->method('lang')
+ ->will($this->returnCallback(array($this, 'return_callback_implode')));
+
+ $filesystem = new \phpbb\filesystem();
+ $manager = new phpbb_mock_extension_manager(dirname(__FILE__) . '/', array());
+ $finder = new \phpbb\finder(
+ $filesystem,
+ dirname(__FILE__) . '/',
+ new phpbb_mock_cache()
+ );
+ $finder->set_extensions(array_keys($manager->all_enabled()));
+
+ $this->config = new \phpbb\config\config(array('enable_mod_rewrite' => '1'));
+ $provider = new \phpbb\controller\provider();
+ $provider->find_routing_files($finder);
+ $provider->find(dirname(__FILE__) . '/');
+
+ $request = new phpbb_mock_request();
+ $request->overwrite('SCRIPT_NAME', '/app.php', \phpbb\request\request_interface::SERVER);
+ $request->overwrite('SCRIPT_FILENAME', 'app.php', \phpbb\request\request_interface::SERVER);
+ $request->overwrite('REQUEST_URI', '/app.php', \phpbb\request\request_interface::SERVER);
+
+ $symfony_request = new \phpbb\symfony_request(
+ $request
+ );
+
+ $this->helper = new phpbb_mock_controller_helper($this->template, $this->user, $this->config, $provider, $manager, $symfony_request, $request, $filesystem, '', 'php', dirname(__FILE__) . '/');
+ $this->pagination = new \phpbb\pagination($this->template, $this->user, $this->helper, $phpbb_dispatcher);
+ }
+
+ public function generate_template_pagination_data()
+ {
+ return array(
+ array(
+ 'page.php',
+ 'start',
+ 95,
+ 10,
+ 10,
+ 'pagination
+ :per_page:10
+ :current_page:2
+ :base_url:page.php
+ :previous::page.php
+ :else:1:page.php
+ :current:2:page.php?start=10
+ :else:3:page.php?start=20
+ :else:4:page.php?start=30
+ :else:5:page.php?start=40
+ :ellipsis:9:page.php?start=80
+ :else:10:page.php?start=90
+ :next::page.php?start=20
+ :u_prev:page.php
+ :u_next:page.php?start=20',
+ ),
+ array(
+ 'page.php',
+ 'start',
+ 95,
+ 10,
+ 20,
+ 'pagination
+ :per_page:10
+ :current_page:3
+ :base_url:page.php
+ :previous::page.php?start=10
+ :else:1:page.php
+ :else:2:page.php?start=10
+ :current:3:page.php?start=20
+ :else:4:page.php?start=30
+ :else:5:page.php?start=40
+ :ellipsis:9:page.php?start=80
+ :else:10:page.php?start=90
+ :next::page.php?start=30
+ :u_prev:page.php?start=10
+ :u_next:page.php?start=30',
+ ),
+ array(
+ array('routes' => array(
+ 'core_controller',
+ 'core_page_controller',
+ )),
+ 'page',
+ 95,
+ 10,
+ 10,
+ 'pagination
+ :per_page:10
+ :current_page:2
+ :base_url:
+ :previous::/test
+ :else:1:/test
+ :current:2:/test/page/2
+ :else:3:/test/page/3
+ :else:4:/test/page/4
+ :else:5:/test/page/5
+ :ellipsis:9:/test/page/9
+ :else:10:/test/page/10
+ :next::/test/page/3
+ :u_prev:/test
+ :u_next:/test/page/3',
+ ),
+ array(
+ array('routes' => array(
+ 'core_controller',
+ 'core_page_controller',
+ )),
+ 'page',
+ 95,
+ 10,
+ 20,
+ 'pagination
+ :per_page:10
+ :current_page:3
+ :base_url:
+ :previous::/test/page/2
+ :else:1:/test
+ :else:2:/test/page/2
+ :current:3:/test/page/3
+ :else:4:/test/page/4
+ :else:5:/test/page/5
+ :ellipsis:9:/test/page/9
+ :else:10:/test/page/10
+ :next::/test/page/4
+ :u_prev:/test/page/2
+ :u_next:/test/page/4',
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider generate_template_pagination_data
+ */
+ public function test_generate_template_pagination($base_url, $start_name, $num_items, $per_page, $start_item, $expect)
+ {
+ $this->pagination->generate_template_pagination($base_url, 'pagination', $start_name, $num_items, $per_page, $start_item);
+ $this->template->set_filenames(array('test' => 'pagination.html'));
+
+ $this->assertEquals(str_replace("\t", '', $expect), $this->display('test'));
+ }
+
+ /**
+ * @dataProvider generate_template_pagination_data
+ */
+ public function test_generate_template_pagination_sub($base_url, $start_name, $num_items, $per_page, $start_item, $expect)
+ {
+ // Block needs to be assigned before pagination
+ $this->template->assign_block_vars('sub', array(
+ 'FOO' => 'bar',
+ ));
+
+ $this->pagination->generate_template_pagination($base_url, 'sub.pagination', $start_name, $num_items, $per_page, $start_item);
+ $this->template->set_filenames(array('test' => 'pagination_sub.html'));
+
+ $this->assertEquals(str_replace("\t", '', $expect), $this->display('test'));
+ }
+
+ /**
+ * @dataProvider generate_template_pagination_data
+ */
+ public function test_generate_template_pagination_double_nested($base_url, $start_name, $num_items, $per_page, $start_item, $expect)
+ {
+ // Block needs to be assigned before pagination
+ $this->template->assign_block_vars('sub', array(
+ 'FOO' => 'bar',
+ ));
+
+ $this->template->assign_block_vars('sub.level2', array(
+ 'BAR' => 'foo',
+ ));
+
+ $this->pagination->generate_template_pagination($base_url, 'sub.level2.pagination', $start_name, $num_items, $per_page, $start_item);
+ $this->template->set_filenames(array('test' => 'pagination_double_nested.html'));
+
+ $this->assertEquals(str_replace("\t", '', $expect), $this->display('test'));
+ }
+
+ public function on_page_data()
+ {
+ return array(
+ array(
+ 10,
+ 10,
+ 0,
+ 'PAGE_OF-1-1',
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider on_page_data
+ */
+ public function test_on_page($num_items, $per_page, $start_item, $expect_return)
+ {
+ $this->assertEquals($expect_return, $this->pagination->on_page($num_items, $per_page, $start_item));
+ }
+
+ public function validate_start_data()
+ {
+ return array(
+ array(
+ 0,
+ 0,
+ 0,
+ ),
+ array(
+ -1,
+ 20,
+ 0,
+ ),
+ array(
+ 20,
+ -30,
+ 0,
+ ),
+ array(
+ 0,
+ 20,
+ 0,
+ ),
+ array(
+ 10,
+ 20,
+ 10,
+ ),
+ array(
+ 20,
+ 20,
+ 10,
+ ),
+ array(
+ 30,
+ 20,
+ 10,
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider validate_start_data
+ */
+ public function test_validate_start($start, $num_items, $expect)
+ {
+ $this->assertEquals($expect, $this->pagination->validate_start($start, 10, $num_items));
+ }
+
+ public function reverse_start_data()
+ {
+ return array(
+ array(
+ 10,
+ 5,
+ 15,
+ 0,
+ ),
+ array(
+ 10,
+ 10,
+ 25,
+ 5,
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider reverse_start_data
+ */
+ public function test_reverse_start($start, $limit, $num_items, $expect)
+ {
+ $this->assertEquals($expect, $this->pagination->reverse_start($start, $limit, $num_items));
+ }
+
+ public function reverse_limit_data()
+ {
+ return array(
+ array(
+ 10,
+ 10,
+ 15,
+ 5,
+ ),
+ array(
+ 20,
+ 10,
+ 15,
+ 1,
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider reverse_limit_data
+ */
+ public function test_reverse_limit($start, $per_page, $num_items, $expect)
+ {
+ $this->assertEquals($expect, $this->pagination->reverse_limit($start, $per_page, $num_items));
+ }
+}
diff --git a/tests/pagination/templates/pagination.html b/tests/pagination/templates/pagination.html
new file mode 100644
index 0000000000..db63258585
--- /dev/null
+++ b/tests/pagination/templates/pagination.html
@@ -0,0 +1,15 @@
+pagination
+:per_page:{PER_PAGE}
+:current_page:{CURRENT_PAGE}
+:base_url:{BASE_URL}
+<!-- BEGIN pagination -->
+<!-- IF pagination.S_IS_PREV -->:previous:{pagination.PAGE_NUMBER}:{pagination.PAGE_URL}
+<!-- ELSEIF pagination.S_IS_CURRENT -->:current:{pagination.PAGE_NUMBER}:{pagination.PAGE_URL}
+<!-- ELSEIF pagination.S_IS_ELLIPSIS -->:ellipsis:{pagination.PAGE_NUMBER}:{pagination.PAGE_URL}
+<!-- ELSEIF pagination.S_IS_NEXT -->:next:{pagination.PAGE_NUMBER}:{pagination.PAGE_URL}
+<!-- ELSE -->:else:{pagination.PAGE_NUMBER}:{pagination.PAGE_URL}
+<!-- ENDIF -->
+<!-- END pagination -->
+<!-- IF U_PREVIOUS_PAGE -->:u_prev:{U_PREVIOUS_PAGE}<!-- ENDIF -->
+
+<!-- IF U_NEXT_PAGE -->:u_next:{U_NEXT_PAGE}<!-- ENDIF -->
diff --git a/tests/pagination/templates/pagination_double_nested.html b/tests/pagination/templates/pagination_double_nested.html
new file mode 100644
index 0000000000..c179248233
--- /dev/null
+++ b/tests/pagination/templates/pagination_double_nested.html
@@ -0,0 +1,19 @@
+pagination
+<!-- BEGIN sub -->
+<!-- BEGIN level2 -->
+:per_page:{sub.level2.PER_PAGE}
+:current_page:{sub.level2.CURRENT_PAGE}
+:base_url:{sub.level2.BASE_URL}
+<!-- BEGIN pagination -->
+<!-- IF sub.level2.pagination.S_IS_PREV -->:previous:{sub.level2.pagination.PAGE_NUMBER}:{sub.level2.pagination.PAGE_URL}
+<!-- ELSEIF sub.level2.pagination.S_IS_CURRENT -->:current:{sub.level2.pagination.PAGE_NUMBER}:{sub.level2.pagination.PAGE_URL}
+<!-- ELSEIF sub.level2.pagination.S_IS_ELLIPSIS -->:ellipsis:{sub.level2.pagination.PAGE_NUMBER}:{sub.level2.pagination.PAGE_URL}
+<!-- ELSEIF sub.level2.pagination.S_IS_NEXT -->:next:{sub.level2.pagination.PAGE_NUMBER}:{sub.level2.pagination.PAGE_URL}
+<!-- ELSE -->:else:{sub.level2.pagination.PAGE_NUMBER}:{sub.level2.pagination.PAGE_URL}
+<!-- ENDIF -->
+<!-- END pagination -->
+<!-- IF sub.level2.U_PREVIOUS_PAGE -->:u_prev:{sub.level2.U_PREVIOUS_PAGE}<!-- ENDIF -->
+
+<!-- IF sub.level2.U_NEXT_PAGE -->:u_next:{sub.level2.U_NEXT_PAGE}<!-- ENDIF -->
+<!-- END level2 -->
+<!-- END sub -->
diff --git a/tests/pagination/templates/pagination_sub.html b/tests/pagination/templates/pagination_sub.html
new file mode 100644
index 0000000000..4ec14039e0
--- /dev/null
+++ b/tests/pagination/templates/pagination_sub.html
@@ -0,0 +1,17 @@
+pagination
+<!-- BEGIN sub -->
+:per_page:{sub.PER_PAGE}
+:current_page:{sub.CURRENT_PAGE}
+:base_url:{sub.BASE_URL}
+<!-- BEGIN pagination -->
+<!-- IF sub.pagination.S_IS_PREV -->:previous:{sub.pagination.PAGE_NUMBER}:{sub.pagination.PAGE_URL}
+<!-- ELSEIF sub.pagination.S_IS_CURRENT -->:current:{sub.pagination.PAGE_NUMBER}:{sub.pagination.PAGE_URL}
+<!-- ELSEIF sub.pagination.S_IS_ELLIPSIS -->:ellipsis:{sub.pagination.PAGE_NUMBER}:{sub.pagination.PAGE_URL}
+<!-- ELSEIF sub.pagination.S_IS_NEXT -->:next:{sub.pagination.PAGE_NUMBER}:{sub.pagination.PAGE_URL}
+<!-- ELSE -->:else:{sub.pagination.PAGE_NUMBER}:{sub.pagination.PAGE_URL}
+<!-- ENDIF -->
+<!-- END pagination -->
+<!-- IF sub.U_PREVIOUS_PAGE -->:u_prev:{sub.U_PREVIOUS_PAGE}<!-- ENDIF -->
+
+<!-- IF sub.U_NEXT_PAGE -->:u_next:{sub.U_NEXT_PAGE}<!-- ENDIF -->
+<!-- END sub -->
diff --git a/tests/passwords/drivers_test.php b/tests/passwords/drivers_test.php
new file mode 100644
index 0000000000..5f9fd523c9
--- /dev/null
+++ b/tests/passwords/drivers_test.php
@@ -0,0 +1,416 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+class phpbb_passwords_helper_test extends \phpbb_test_case
+{
+ public function setUp()
+ {
+ // Prepare dependencies for drivers
+ $config = new \phpbb\config\config(array());
+ $request = new phpbb_mock_request(array(), array(), array(), array(), array('password' => 'fööbar'));
+ $this->driver_helper = new \phpbb\passwords\driver\helper($config);
+ $phpbb_root_path = dirname(__FILE__) . '/../../phpBB/';
+ $php_ext = 'php';
+
+ $this->passwords_drivers = array(
+ 'passwords.driver.bcrypt_2y' => new \phpbb\passwords\driver\bcrypt_2y($config, $this->driver_helper),
+ 'passwords.driver.bcrypt' => new \phpbb\passwords\driver\bcrypt($config, $this->driver_helper),
+ 'passwords.driver.salted_md5' => new \phpbb\passwords\driver\salted_md5($config, $this->driver_helper),
+ 'passwords.driver.phpass' => new \phpbb\passwords\driver\phpass($config, $this->driver_helper),
+ 'passwords.driver.sha1_smf' => new \phpbb\passwords\driver\sha1_smf($config, $this->driver_helper),
+ 'passwords.driver.sha1_wcf1' => new \phpbb\passwords\driver\sha1_wcf1($config, $this->driver_helper),
+ 'passwords.driver.convert_password'=> new \phpbb\passwords\driver\convert_password($config, $this->driver_helper),
+ 'passwords.driver.sha1' => new \phpbb\passwords\driver\sha1($config, $this->driver_helper),
+ 'passwords.driver.md5_mybb' => new \phpbb\passwords\driver\md5_mybb($config, $this->driver_helper),
+ 'passwords.driver.md5_vb' => new \phpbb\passwords\driver\md5_vb($config, $this->driver_helper),
+ 'passwords.driver.sha_xf1' => new \phpbb\passwords\driver\sha_xf1($config, $this->driver_helper),
+ );
+ $this->passwords_drivers['passwords.driver.md5_phpbb2'] = new \phpbb\passwords\driver\md5_phpbb2($request, $this->passwords_drivers['passwords.driver.salted_md5'], $this->driver_helper, $phpbb_root_path, $php_ext);
+ $this->passwords_drivers['passwords.driver.bcrypt_wcf2'] = new \phpbb\passwords\driver\bcrypt_wcf2($this->passwords_drivers['passwords.driver.bcrypt'], $this->driver_helper);
+ }
+
+ public function data_helper_encode64()
+ {
+ return array(
+ array('foobar', 6, 'axqPW3aQ'),
+ array('foobar', 7, 'axqPW3aQ..'),
+ array('foobar', 5, 'axqPW34'),
+ );
+ }
+
+ /**
+ * @dataProvider data_helper_encode64
+ */
+ public function test_helper_encode64($input, $length, $output)
+ {
+ $return = $this->driver_helper->hash_encode64($input, $length);
+ $this->assertSame($output, $return);
+ }
+
+ public function data_get_random_salt()
+ {
+ return array(
+ array(24, false),
+ array(24, '/dev/foobar'),
+ );
+ }
+
+ /**
+ * @dataProvider data_get_random_salt
+ */
+ public function test_get_random_salt($length, $rand_seed)
+ {
+ $rand_string = (empty($rand_seed)) ? $this->driver_helper->get_random_salt($length) : $this->driver_helper->get_random_salt($length, $rand_seed);
+ $start = microtime(true);
+
+ // Run each test for max. 1 second
+ while ((microtime(true) - $start) < 1)
+ {
+ $urandom_string = (empty($rand_seed)) ? $this->driver_helper->get_random_salt($length) : $this->driver_helper->get_random_salt($length, $rand_seed);
+ $this->assertSame($length, strlen($urandom_string));
+ $this->assertNotSame($rand_string, $urandom_string);
+ }
+ }
+
+ public function test_get_hash_settings_salted_md5()
+ {
+ $settings = $this->passwords_drivers['passwords.driver.salted_md5']->get_hash_settings('$H$9isfrtKXWqrz8PvztXlL3.daw4U0zI1');
+ $this->assertEquals(array(
+ 'count' => pow(2, 11),
+ 'salt' => 'isfrtKXW',
+ 'full' => '$H$9isfrtKXW',
+ ),
+ $settings
+ );
+ $this->assertEquals(false, $this->passwords_drivers['passwords.driver.salted_md5']->get_hash_settings(false));
+ }
+
+ public function data_hash_sha1_smf()
+ {
+ return array(
+ array(false, 'test', array()),
+ array(false, 'test', ''),
+ array('6f9e2a1899e1f15708fd2e554103480eb53e8b57', 'foobar', array('login_name' => 'test')),
+ );
+ }
+
+ /**
+ * @dataProvider data_hash_sha1_smf
+ */
+ public function test_hash_sha1_smf($expected, $password, $user_row)
+ {
+ $this->assertSame($expected, $this->passwords_drivers['passwords.driver.sha1_smf']->hash($password, $user_row));
+ }
+
+ public function data_get_settings()
+ {
+ return array(
+ array(false, '6f9e2a1899e1f15708fd2e554103480eb53e8b57', 'passwords.driver.sha1_smf'),
+ );
+ }
+
+ /**
+ * @dataProvider data_get_settings
+ */
+ public function test_get_settings_only($expected, $hash, $driver)
+ {
+ $this->assertSame($expected, $this->passwords_drivers[$driver]->get_settings_only($hash));
+ }
+
+ public function data_md5_phpbb2_check()
+ {
+ return array(
+ array(false, 'foobar', 'ae2fc75e20ee25d4520766788fbc96ae'),
+ array(false, 'foobar', 'ae2fc75e20ee25d4520766788fbc96aeddsf'),
+ array(false, 'fööbar', 'ae2fc75e20ee25d4520766788fbc96ae'),
+ array(true, 'fööbar', 'ae2fc75e20ee25d4520766788fbc96ae', utf8_decode('fööbar')),
+ array(true, 'fööbar', '$H$966CepJh9RC3hFIm7aKywR6jEn0kpA0', utf8_decode('fööbar')),
+ array(true, 'fööbar', '$H$9rNjgwETtmc8befO8JL1xFMrrMw8MC.', $this->utf8_to_cp1252(utf8_decode('fööbar'))),
+ array(true, 'fööbar', '$H$9rNjgwETtmc8befO8JL1xFMrrMw8MC.', $this->utf8_to_cp1252('fööbar')),
+ );
+ }
+
+ /**
+ * @dataProvider data_md5_phpbb2_check
+ */
+ public function test_md5_phpbb2_check($expected, $password, $hash, $request_password = false)
+ {
+ if (!$request_password)
+ {
+ unset($_REQUEST['password']);
+ }
+ else
+ {
+ $_REQUEST['password'] = $request_password;
+ }
+ $this->assertSame($expected, $this->passwords_drivers['passwords.driver.md5_phpbb2']->check($password, $hash));
+ }
+
+ public function test_md5_phpbb2_hash()
+ {
+ $this->assertSame(false, $this->passwords_drivers['passwords.driver.md5_phpbb2']->hash('foobar'));
+ }
+
+ public function test_convert_password_driver()
+ {
+ $this->assertSame(false, $this->passwords_drivers['passwords.driver.convert_password']->hash('foobar'));
+ }
+
+ public function test_sha1_driver()
+ {
+ $this->assertSame(false, $this->passwords_drivers['passwords.driver.sha1']->hash('foobar'));
+ }
+
+ public function data_md5_mybb_check()
+ {
+ return array(
+ array(false, 'foobar', '083d11daea8675b1b4b502c7e55f8dbd'),
+ array(false, 'foobar', '083d11daea8675b1b4b502c7e55f8dbd', array('user_passwd_salt' => 'ae2fc75e')),
+ array(true, 'foobar', 'b86ee7e24008bfd2890dcfab1ed31333', array('user_passwd_salt' => 'yeOtfFO6')),
+ );
+ }
+
+ /**
+ * @dataProvider data_md5_mybb_check
+ */
+ public function test_md5_mybb_check($expected, $password, $hash, $user_row = array())
+ {
+ $this->assertSame($expected, $this->passwords_drivers['passwords.driver.md5_mybb']->check($password, $hash, $user_row));
+ }
+
+ public function test_md5_mybb_driver()
+ {
+ $this->assertSame(false, $this->passwords_drivers['passwords.driver.md5_mybb']->hash('foobar'));
+ }
+
+ public function data_md5_vb_check()
+ {
+ return array(
+ array(false, 'foobar', '083d11daea8675b1b4b502c7e55f8dbd'),
+ array(false, 'foobar', 'b86ee7e24008bfd2890dcfab1ed31333', array('user_passwd_salt' => 'yeOtfFO6')),
+ array(true, 'foobar', 'b452c54c44c588fc095d2d000935c470', array('user_passwd_salt' => '9^F')),
+ array(true, 'foobar', 'f23a8241bd115d270c703213e3ef7f52', array('user_passwd_salt' => 'iaU*U%`CBl;/e~>D%do2m@Xf/,KZB0')),
+ array(false, 'nope', 'f23a8241bd115d270c703213e3ef7f52', array('user_passwd_salt' => 'iaU*U%`CBl;/e~>D%do2m@Xf/,KZB0')),
+ );
+ }
+
+ /**
+ * @dataProvider data_md5_vb_check
+ */
+ public function test_md5_vb_check($expected, $password, $hash, $user_row = array())
+ {
+ $this->assertSame($expected, $this->passwords_drivers['passwords.driver.md5_vb']->check($password, $hash, $user_row));
+ }
+
+ public function test_md5_vb_driver()
+ {
+ $this->assertSame(false, $this->passwords_drivers['passwords.driver.md5_vb']->hash('foobar'));
+ }
+
+ public function data_sha1_wcf1_check()
+ {
+ return array(
+ array(false, 'foobar', 'fc46b9d9386167ce365ea3b891bf5dc31ddcd3ff'),
+ array(false, 'foobar', 'fc46b9d9386167ce365ea3b891bf5dc31ddcd3ff', array('user_passwd_salt' => 'yeOtfFO6')),
+ array(true, 'foobar', 'fc46b9d9386167ce365ea3b891bf5dc31ddcd3ff', array('user_passwd_salt' => '1a783e478d63f6422783a868db667aed3a857840')),
+ );
+ }
+
+ /**
+ * @dataProvider data_sha1_wcf1_check
+ */
+ public function test_sha1_wcf1_check($expected, $password, $hash, $user_row = array())
+ {
+ $this->assertSame($expected, $this->passwords_drivers['passwords.driver.sha1_wcf1']->check($password, $hash, $user_row));
+ }
+
+ public function test_sha1_wcf1_driver()
+ {
+ $this->assertSame(false, $this->passwords_drivers['passwords.driver.sha1_wcf1']->hash('foobar'));
+ }
+
+ public function data_bcrypt_wcf2_check()
+ {
+ return array(
+ array(false, 'foobar', 'fc46b9d9386167ce365ea3b891bf5dc31ddcd3ff'),
+ array(true, 'foobar', '$2a$08$p8h14U0jsEiVb1Luy.s8oOTXSQ0hVWUXpcNGBoCezeYNXrQyCKHfi'),
+ array(false, 'foobar', ''),
+ );
+ }
+
+ /**
+ * @dataProvider data_bcrypt_wcf2_check
+ */
+ public function test_bcrypt_wcf2_check($expected, $password, $hash)
+ {
+ $this->assertSame($expected, $this->passwords_drivers['passwords.driver.bcrypt_wcf2']->check($password, $hash));
+ }
+
+ public function test_bcrypt_wcf2_driver()
+ {
+ $this->assertSame(false, $this->passwords_drivers['passwords.driver.bcrypt_wcf2']->hash('foobar'));
+ }
+
+ public function data_sha_xf1_check()
+ {
+ return array(
+ array(false, 'foobar', 'fc46b9d9386167ce365ea3b891bf5dc31ddcd3ff'),
+ array(false, 'foobar', 'fc46b9d9386167ce365ea3b891bf5dc31ddcd3ff', array('user_passwd_salt' => 'yeOtfFO6')),
+ array(true, 'foobar', '7f65d2fa8a826d232f8134772252f8b1aaef8594b1edcabd9ab65e5b0f236ff0', array('user_passwd_salt' => '15b6c02cedbd727f563dcca607a89b085287b448966f19c0cc78cae263b1e38c')),
+ array(true, 'foobar', '69962ae2079420573a3948cc4dedbabd35680051', array('user_passwd_salt' => '15b6c02cedbd727f563dcca607a89b085287b448966f19c0cc78cae263b1e38c')),
+ );
+ }
+
+ /**
+ * @dataProvider data_sha_xf1_check
+ */
+ public function test_sha_xf1_check($expected, $password, $hash, $user_row = array())
+ {
+ $this->assertSame($expected, $this->passwords_drivers['passwords.driver.sha_xf1']->check($password, $hash, $user_row));
+ }
+
+ public function test_sha_xf1_driver()
+ {
+ $this->assertSame(false, $this->passwords_drivers['passwords.driver.sha_xf1']->hash('foobar'));
+ }
+
+ protected function utf8_to_cp1252($string)
+ {
+ static $transform = array(
+ "\xE2\x82\xAC" => "\x80",
+ "\xE2\x80\x9A" => "\x82",
+ "\xC6\x92" => "\x83",
+ "\xE2\x80\x9E" => "\x84",
+ "\xE2\x80\xA6" => "\x85",
+ "\xE2\x80\xA0" => "\x86",
+ "\xE2\x80\xA1" => "\x87",
+ "\xCB\x86" => "\x88",
+ "\xE2\x80\xB0" => "\x89",
+ "\xC5\xA0" => "\x8A",
+ "\xE2\x80\xB9" => "\x8B",
+ "\xC5\x92" => "\x8C",
+ "\xC5\xBD" => "\x8E",
+ "\xE2\x80\x98" => "\x91",
+ "\xE2\x80\x99" => "\x92",
+ "\xE2\x80\x9C" => "\x93",
+ "\xE2\x80\x9D" => "\x94",
+ "\xE2\x80\xA2" => "\x95",
+ "\xE2\x80\x93" => "\x96",
+ "\xE2\x80\x94" => "\x97",
+ "\xCB\x9C" => "\x98",
+ "\xE2\x84\xA2" => "\x99",
+ "\xC5\xA1" => "\x9A",
+ "\xE2\x80\xBA" => "\x9B",
+ "\xC5\x93" => "\x9C",
+ "\xC5\xBE" => "\x9E",
+ "\xC5\xB8" => "\x9F",
+ "\xC2\xA0" => "\xA0",
+ "\xC2\xA1" => "\xA1",
+ "\xC2\xA2" => "\xA2",
+ "\xC2\xA3" => "\xA3",
+ "\xC2\xA4" => "\xA4",
+ "\xC2\xA5" => "\xA5",
+ "\xC2\xA6" => "\xA6",
+ "\xC2\xA7" => "\xA7",
+ "\xC2\xA8" => "\xA8",
+ "\xC2\xA9" => "\xA9",
+ "\xC2\xAA" => "\xAA",
+ "\xC2\xAB" => "\xAB",
+ "\xC2\xAC" => "\xAC",
+ "\xC2\xAD" => "\xAD",
+ "\xC2\xAE" => "\xAE",
+ "\xC2\xAF" => "\xAF",
+ "\xC2\xB0" => "\xB0",
+ "\xC2\xB1" => "\xB1",
+ "\xC2\xB2" => "\xB2",
+ "\xC2\xB3" => "\xB3",
+ "\xC2\xB4" => "\xB4",
+ "\xC2\xB5" => "\xB5",
+ "\xC2\xB6" => "\xB6",
+ "\xC2\xB7" => "\xB7",
+ "\xC2\xB8" => "\xB8",
+ "\xC2\xB9" => "\xB9",
+ "\xC2\xBA" => "\xBA",
+ "\xC2\xBB" => "\xBB",
+ "\xC2\xBC" => "\xBC",
+ "\xC2\xBD" => "\xBD",
+ "\xC2\xBE" => "\xBE",
+ "\xC2\xBF" => "\xBF",
+ "\xC3\x80" => "\xC0",
+ "\xC3\x81" => "\xC1",
+ "\xC3\x82" => "\xC2",
+ "\xC3\x83" => "\xC3",
+ "\xC3\x84" => "\xC4",
+ "\xC3\x85" => "\xC5",
+ "\xC3\x86" => "\xC6",
+ "\xC3\x87" => "\xC7",
+ "\xC3\x88" => "\xC8",
+ "\xC3\x89" => "\xC9",
+ "\xC3\x8A" => "\xCA",
+ "\xC3\x8B" => "\xCB",
+ "\xC3\x8C" => "\xCC",
+ "\xC3\x8D" => "\xCD",
+ "\xC3\x8E" => "\xCE",
+ "\xC3\x8F" => "\xCF",
+ "\xC3\x90" => "\xD0",
+ "\xC3\x91" => "\xD1",
+ "\xC3\x92" => "\xD2",
+ "\xC3\x93" => "\xD3",
+ "\xC3\x94" => "\xD4",
+ "\xC3\x95" => "\xD5",
+ "\xC3\x96" => "\xD6",
+ "\xC3\x97" => "\xD7",
+ "\xC3\x98" => "\xD8",
+ "\xC3\x99" => "\xD9",
+ "\xC3\x9A" => "\xDA",
+ "\xC3\x9B" => "\xDB",
+ "\xC3\x9C" => "\xDC",
+ "\xC3\x9D" => "\xDD",
+ "\xC3\x9E" => "\xDE",
+ "\xC3\x9F" => "\xDF",
+ "\xC3\xA0" => "\xE0",
+ "\xC3\xA1" => "\xE1",
+ "\xC3\xA2" => "\xE2",
+ "\xC3\xA3" => "\xE3",
+ "\xC3\xA4" => "\xE4",
+ "\xC3\xA5" => "\xE5",
+ "\xC3\xA6" => "\xE6",
+ "\xC3\xA7" => "\xE7",
+ "\xC3\xA8" => "\xE8",
+ "\xC3\xA9" => "\xE9",
+ "\xC3\xAA" => "\xEA",
+ "\xC3\xAB" => "\xEB",
+ "\xC3\xAC" => "\xEC",
+ "\xC3\xAD" => "\xED",
+ "\xC3\xAE" => "\xEE",
+ "\xC3\xAF" => "\xEF",
+ "\xC3\xB0" => "\xF0",
+ "\xC3\xB1" => "\xF1",
+ "\xC3\xB2" => "\xF2",
+ "\xC3\xB3" => "\xF3",
+ "\xC3\xB4" => "\xF4",
+ "\xC3\xB5" => "\xF5",
+ "\xC3\xB6" => "\xF6",
+ "\xC3\xB7" => "\xF7",
+ "\xC3\xB8" => "\xF8",
+ "\xC3\xB9" => "\xF9",
+ "\xC3\xBA" => "\xFA",
+ "\xC3\xBB" => "\xFB",
+ "\xC3\xBC" => "\xFC",
+ "\xC3\xBD" => "\xFD",
+ "\xC3\xBE" => "\xFE",
+ "\xC3\xBF" => "\xFF"
+ );
+ return strtr($string, $transform);
+ }
+}
diff --git a/tests/passwords/manager_test.php b/tests/passwords/manager_test.php
new file mode 100644
index 0000000000..333834ee07
--- /dev/null
+++ b/tests/passwords/manager_test.php
@@ -0,0 +1,347 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+class phpbb_passwords_manager_test extends \phpbb_test_case
+{
+ protected $passwords_drivers;
+
+ protected $pw_characters = '0123456789abcdefghijklmnopqrstuvwyzABCDEFGHIJKLMNOPQRSTUVXYZ.,_!?/\\';
+
+ protected $default_pw = 'foobar';
+
+ public function setUp()
+ {
+ // Prepare dependencies for manager and driver
+ $config = new \phpbb\config\config(array());
+ $this->driver_helper = new \phpbb\passwords\driver\helper($config);
+ $request = new phpbb_mock_request(array(), array(), array(), array(), array('password' => 'töst'));
+ $phpbb_root_path = dirname(__FILE__) . '/../../phpBB/';
+ $php_ext = 'php';
+
+ $this->passwords_drivers = array(
+ 'passwords.driver.bcrypt_2y' => new \phpbb\passwords\driver\bcrypt_2y($config, $this->driver_helper),
+ 'passwords.driver.bcrypt' => new \phpbb\passwords\driver\bcrypt($config, $this->driver_helper),
+ 'passwords.driver.salted_md5' => new \phpbb\passwords\driver\salted_md5($config, $this->driver_helper),
+ 'passwords.driver.phpass' => new \phpbb\passwords\driver\phpass($config, $this->driver_helper),
+ 'passwords.driver.convert_password' => new \phpbb\passwords\driver\convert_password($config, $this->driver_helper),
+ 'passwords.driver.sha1_smf' => new \phpbb\passwords\driver\sha1_smf($config, $this->driver_helper),
+ 'passwords.driver.sha1' => new \phpbb\passwords\driver\sha1($config, $this->driver_helper),
+ 'passwords.driver.sha1_wcf1' => new \phpbb\passwords\driver\sha1_wcf1($config, $this->driver_helper),
+ 'passwords.driver.md5_mybb' => new \phpbb\passwords\driver\md5_mybb($config, $this->driver_helper),
+ 'passwords.driver.md5_vb' => new \phpbb\passwords\driver\md5_vb($config, $this->driver_helper),
+ 'passwords.driver.sha_xf1' => new \phpbb\passwords\driver\sha_xf1($config, $this->driver_helper),
+ );
+ $this->passwords_drivers['passwords.driver.md5_phpbb2'] = new \phpbb\passwords\driver\md5_phpbb2($request, $this->passwords_drivers['passwords.driver.salted_md5'], $this->driver_helper, $phpbb_root_path, $php_ext);
+ $this->passwords_drivers['passwords.driver.bcrypt_wcf2'] = new \phpbb\passwords\driver\bcrypt_wcf2($this->passwords_drivers['passwords.driver.bcrypt'], $this->driver_helper);
+
+ $this->helper = new \phpbb\passwords\helper;
+ // Set up passwords manager
+ $this->manager = new \phpbb\passwords\manager($config, $this->passwords_drivers, $this->helper, array_keys($this->passwords_drivers));
+ }
+
+ public function hash_password_data()
+ {
+ if (version_compare(PHP_VERSION, '5.3.7', '<'))
+ {
+ return array(
+ array('', '2a', 60),
+ array('passwords.driver.bcrypt_2y', '2a', 60),
+ array('passwords.driver.bcrypt', '2a', 60),
+ array('passwords.driver.salted_md5', 'H', 34),
+ array('passwords.driver.foobar', '', false),
+ );
+ }
+ else
+ {
+ return array(
+ array('', '2y', 60),
+ array('passwords.driver.bcrypt_2y', '2y', 60),
+ array('passwords.driver.bcrypt', '2a', 60),
+ array('passwords.driver.salted_md5', 'H', 34),
+ array('passwords.driver.foobar', '', false),
+ );
+ }
+ }
+
+ /**
+ * @dataProvider hash_password_data
+ */
+ public function test_hash_password($type, $prefix, $length)
+ {
+ $password = $this->default_pw;
+
+ if (!$length)
+ {
+ $this->assertEquals(false, $hash = $this->manager->hash($password, $type));
+ return;
+ }
+ $time = microtime(true);
+
+ // Limit each test to 1 second
+ while ((microtime(true) - $time) < 1)
+ {
+ $hash = $this->manager->hash($password, $type);
+ preg_match('#^\$([a-zA-Z0-9\\\]*?)\$#', $hash, $match);
+ $this->assertEquals($prefix, $match[1]);
+ $this->assertEquals($length, strlen($hash));
+ $password .= $this->pw_characters[mt_rand(0, 66)];
+ }
+ }
+
+ public function check_password_data()
+ {
+ if (version_compare(PHP_VERSION, '5.3.7', '<'))
+ {
+ return array(
+ array('passwords.driver.bcrypt'),
+ array('passwords.driver.salted_md5'),
+ array('passwords.driver.phpass'),
+ );
+ }
+ else
+ {
+ return array(
+ array('passwords.driver.bcrypt_2y'),
+ array('passwords.driver.bcrypt'),
+ array('passwords.driver.salted_md5'),
+ array('passwords.driver.phpass'),
+ );
+ }
+ }
+
+ /**
+ * @dataProvider check_password_data
+ */
+ public function test_check_password($hash_type)
+ {
+ $password = $this->default_pw;
+ $time = microtime(true);
+ // Limit each test to 1 second
+ while ((microtime(true) - $time) < 1)
+ {
+ $hash = $this->manager->hash($password, $hash_type);
+ $this->assertEquals(true, $this->manager->check($password, $hash));
+ $password .= $this->pw_characters[mt_rand(0, 66)];
+ $this->assertEquals(false, $this->manager->check($password, $hash));
+ }
+
+ // Check if convert_flag is correctly set
+ $default_type = (version_compare(PHP_VERSION, '5.3.7', '<')) ? 'passwords.driver.bcrypt' : 'passwords.driver.bcrypt_2y';
+ $this->assertEquals(($hash_type !== $default_type), $this->manager->convert_flag);
+ }
+
+
+ public function check_hash_exceptions_data()
+ {
+ return array(
+ array('3858f62230ac3c915f300c664312c63f', true),
+ array('$CP$3858f62230ac3c915f300c664312c63f', true), // md5_phpbb2
+ array('$CP$3858f62230ac3c915f300c', false),
+ array('$S$b57a939fa4f2c04413a4eea9734a0903647b7adb93181295', false),
+ array('$2a\S$kkkkaakdkdiej39023903204j2k3490234jk234j02349', false),
+ array('$H$kklk938d023k//k3023', false),
+ array('$H$3PtYMgXb39lrIWkgoxYLWtRkZtY3AY/', false),
+ array('$2a$kwiweorurlaeirw', false),
+ array('6f9e2a1899e1f15708fd2e554103480eb53e8b57', false),
+ array('6f9e2a1899e1f15708fd2e554103480eb53e8b57', false, 'foobar', array('login_name' => 'test')),
+ array('$CP$6f9e2a1899e1f15708fd2e554103480eb53e8b57', true, 'foobar', array('login_name' => 'test')), // sha1_smf
+ array('6f9e2a1899', false, 'foobar', array('login_name' => 'test')),
+ array('ae2fc75e20ee25d4520766788fbc96ae', false, 'fööbar'),
+ array('$CP$ae2fc75e20ee25d4520766788fbc96ae', false, 'fööbar'),
+ array('$CP$ae2fc75e20ee25d4520766788fbc96ae', true, utf8_decode('fööbar')), // md5_phpbb2
+ array('b86ee7e24008bfd2890dcfab1ed31333', false, 'foobar', array('user_passwd_salt' => 'yeOtfFO6')),
+ array('$CP$b86ee7e24008bfd2890dcfab1ed31333', true, 'foobar', array('user_passwd_salt' => 'yeOtfFO6')), // md5_mybb
+ array('$CP$b452c54c44c588fc095d2d000935c470', true, 'foobar', array('user_passwd_salt' => '9^F')), // md5_vb
+ array('$CP$f23a8241bd115d270c703213e3ef7f52', true, 'foobar', array('user_passwd_salt' => 'iaU*U%`CBl;/e~>D%do2m@Xf/,KZB0')), // md5_vb
+ array('$CP$fc46b9d9386167ce365ea3b891bf5dc31ddcd3ff', true, 'foobar', array('user_passwd_salt' => '1a783e478d63f6422783a868db667aed3a857840')), // sha_wcf1
+ array('$2a$08$p8h14U0jsEiVb1Luy.s8oOTXSQ0hVWUXpcNGBoCezeYNXrQyCKHfi', false),
+ array('$CP$$2a$08$p8h14U0jsEiVb1Luy.s8oOTXSQ0hVWUXpcNGBoCezeYNXrQyCKHfi', true), // bcrypt_wcf2
+ array('$CP$7f65d2fa8a826d232f8134772252f8b1aaef8594b1edcabd9ab65e5b0f236ff0', true, 'foobar', array('user_passwd_salt' => '15b6c02cedbd727f563dcca607a89b085287b448966f19c0cc78cae263b1e38c')), // sha_xf1
+ array('$CP$69962ae2079420573a3948cc4dedbabd35680051', true, 'foobar', array('user_passwd_salt' => '15b6c02cedbd727f563dcca607a89b085287b448966f19c0cc78cae263b1e38c')), // sha_xf1
+ );
+ }
+
+ /**
+ * @dataProvider check_hash_exceptions_data
+ */
+ public function test_check_hash_exceptions($hash, $expected, $password = 'foobar', $user_row = array())
+ {
+ $this->assertEquals($expected, $this->manager->check($password, $hash, $user_row));
+ }
+
+ public function data_hash_password_length()
+ {
+ return array(
+ array('passwords.driver.bcrypt', false),
+ array('passwords.driver.bcrypt_2y', false),
+ array('passwords.driver.salted_md5', '3858f62230ac3c915f300c664312c63f'),
+ array('passwords.driver.phpass', '3858f62230ac3c915f300c664312c63f'),
+ );
+ }
+
+ /**
+ * @dataProvider data_hash_password_length
+ */
+ public function test_hash_password_length($driver, $expected)
+ {
+ $this->assertEquals($expected, $this->passwords_drivers[$driver]->hash('foobar', 'foobar'));
+ }
+
+ public function test_hash_password_8bit_bcrypt()
+ {
+ $this->assertEquals(false, $this->manager->hash('foobar𝄞', 'passwords.driver.bcrypt'));
+ if (version_compare(PHP_VERSION, '5.3.7', '<'))
+ {
+ $this->assertEquals(false, $this->manager->hash('foobar𝄞', 'passwords.driver.bcrypt_2y'));
+ }
+ else
+ {
+ $this->assertNotEquals(false, $this->manager->hash('foobar𝄞', 'passwords.driver.bcrypt_2y'));
+ }
+ }
+
+ public function combined_hash_data()
+ {
+ if (version_compare(PHP_VERSION, '5.3.7', '<'))
+ {
+ return array(
+ array(
+ 'passwords.driver.salted_md5',
+ array('passwords.driver.bcrypt'),
+ ),
+ array(
+ 'passwords.driver.phpass',
+ array('passwords.driver.salted_md5'),
+ ),
+ array(
+ 'passwords.driver.salted_md5',
+ array('passwords.driver.phpass', 'passwords.driver.bcrypt'),
+ ),
+ array(
+ 'passwords.driver.salted_md5',
+ array('passwords.driver.salted_md5'),
+ false,
+ ),
+ array(
+ '$H$',
+ array('$2a$'),
+ ),
+ );
+ }
+ else
+ {
+ return array(
+ array(
+ 'passwords.driver.salted_md5',
+ array('passwords.driver.bcrypt_2y'),
+ ),
+ array(
+ 'passwords.driver.salted_md5',
+ array('passwords.driver.bcrypt'),
+ ),
+ array(
+ 'passwords.driver.phpass',
+ array('passwords.driver.salted_md5'),
+ ),
+ array(
+ 'passwords.driver.salted_md5',
+ array('passwords.driver.bcrypt_2y', 'passwords.driver.bcrypt'),
+ ),
+ array(
+ 'passwords.driver.salted_md5',
+ array('passwords.driver.salted_md5'),
+ false,
+ ),
+ array(
+ 'passwords.driver.bcrypt_2y',
+ array('passwords.driver.salted_md4'),
+ false,
+ ),
+ array(
+ '$H$',
+ array('$2y$'),
+ ),
+ );
+ }
+ }
+
+ /**
+ * @dataProvider combined_hash_data
+ */
+ public function test_combined_hash_password($first_type, $second_type, $expected = true)
+ {
+ $password = $this->default_pw;
+ $time = microtime(true);
+ // Limit each test to 1 second
+ while ((microtime(true) - $time) < 1)
+ {
+ $hash = $this->manager->hash($password, $first_type);
+ $combined_hash = $this->manager->hash($hash, $second_type);
+ $this->assertEquals($expected, $this->manager->check($password, $combined_hash));
+ $password .= $this->pw_characters[mt_rand(0, 66)];
+ $this->assertEquals(false, $this->manager->check($password, $combined_hash));
+
+ // If we are expecting the check to fail then there is
+ // no need to run this more than once
+ if (!$expected)
+ {
+ break;
+ }
+ }
+ }
+
+ public function test_unique_id()
+ {
+ $time = microtime(true);
+ $first_id = $this->driver_helper->unique_id();
+ // Limit test to 1 second
+ while ((microtime(true) - $time) < 1)
+ {
+ $this->assertNotSame($first_id, $this->driver_helper->unique_id());
+ }
+ }
+
+ public function test_check_hash_with_large_input()
+ {
+ // 16 MB password, should be rejected quite fast
+ $start_time = time();
+ $this->assertFalse($this->manager->check(str_repeat('a', 1024 * 1024 * 16), '$H$9isfrtKXWqrz8PvztXlL3.daw4U0zI1'));
+ $this->assertLessThanOrEqual(5, time() - $start_time);
+ }
+
+ public function test_hash_password_with_large_input()
+ {
+ // 16 MB password, should be rejected quite fast
+ $start_time = time();
+ $this->assertFalse($this->manager->hash(str_repeat('a', 1024 * 1024 * 16)));
+ $this->assertLessThanOrEqual(5, time() - $start_time);
+ }
+
+ public function data_test_string_compare()
+ {
+ return array(
+ array('foo', 'bar', false),
+ array(1, '1', false),
+ array('one', 'one', true),
+ array('foobar', 'foobaf', false),
+ );
+ }
+
+ /**
+ * @dataProvider data_test_string_compare
+ */
+ public function test_string_compare($a, $b, $expected)
+ {
+ $this->assertSame($expected, $this->driver_helper->string_compare($a, $b));
+ }
+}
diff --git a/tests/path_helper/path_helper_test.php b/tests/path_helper/path_helper_test.php
new file mode 100644
index 0000000000..73f0e6bafc
--- /dev/null
+++ b/tests/path_helper/path_helper_test.php
@@ -0,0 +1,464 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+class phpbb_path_helper_test extends phpbb_test_case
+{
+ /** @var \phpbb\path_helper */
+ protected $path_helper;
+ protected $phpbb_root_path = '';
+
+ public function setUp()
+ {
+ parent::setUp();
+
+ $filesystem = new \phpbb\filesystem();
+ $this->set_phpbb_root_path($filesystem);
+
+ $this->path_helper = new \phpbb\path_helper(
+ new \phpbb\symfony_request(
+ new phpbb_mock_request()
+ ),
+ new \phpbb\filesystem(),
+ $this->getMock('\phpbb\request\request'),
+ $this->phpbb_root_path,
+ 'php'
+ );
+ }
+
+ /**
+ * Set the phpbb_root_path
+ *
+ * This is necessary because dataProvider functions are called
+ * before setUp or setUpBeforeClass; so we must set the path
+ * any time we wish to use it in one of these functions (and
+ * also in general for everything else)
+ */
+ public function set_phpbb_root_path($filesystem)
+ {
+ $this->phpbb_root_path = $filesystem->clean_path(dirname(__FILE__) . '/../../phpBB/');
+ }
+
+ public function test_get_web_root_path()
+ {
+ // Symfony Request = null, so always should return phpbb_root_path
+ $this->assertEquals($this->phpbb_root_path, $this->path_helper->get_web_root_path());
+ }
+
+ public function basic_update_web_root_path_data()
+ {
+ $filesystem = new \phpbb\filesystem();
+ $this->set_phpbb_root_path($filesystem);
+
+ return array(
+ array(
+ 'http://www.test.com/test.php',
+ 'http://www.test.com/test.php',
+ '/',
+ ),
+ array(
+ $this->phpbb_root_path . 'test.php',
+ $this->phpbb_root_path . 'test.php',
+ ),
+ array(
+ 'test.php',
+ 'test.php',
+ ),
+ array(
+ $this->phpbb_root_path . $this->phpbb_root_path . 'test.php',
+ $filesystem->clean_path($this->phpbb_root_path . $this->phpbb_root_path . 'test.php'),
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider basic_update_web_root_path_data
+ */
+ public function test_basic_update_web_root_path($input, $expected)
+ {
+ $this->assertEquals($expected, $this->path_helper->update_web_root_path($input));
+ }
+
+ public function update_web_root_path_data()
+ {
+ $this->set_phpbb_root_path(new \phpbb\filesystem());
+
+ return array(
+ array(
+ $this->phpbb_root_path . 'test.php',
+ '/',
+ null,
+ null,
+ '',
+ ),
+ array(
+ $this->phpbb_root_path . 'test.php',
+ '//',
+ null,
+ null,
+ './../',
+ ),
+ array(
+ $this->phpbb_root_path . 'test.php',
+ '//',
+ 'foo/bar.php',
+ 'bar.php',
+ './../',
+ ),
+ array(
+ $this->phpbb_root_path . 'test.php',
+ '/foo/template',
+ '/phpbb3-fork/phpBB/app.php/foo/template',
+ '/phpbb3-fork/phpBB/app.php',
+ './../../',
+ ),
+ array(
+ $this->phpbb_root_path . 'test.php',
+ '/foo/template',
+ '/phpbb3-fork/phpBB/foo/template',
+ '/phpbb3-fork/phpBB/app.php',
+ './../',
+ ),
+ array(
+ $this->phpbb_root_path . 'test.php',
+ '/',
+ '/phpbb3-fork/phpBB/app.php/',
+ '/phpbb3-fork/phpBB/app.php',
+ './../',
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider update_web_root_path_data
+ */
+ public function test_update_web_root_path($input, $getPathInfo, $getRequestUri, $getScriptName, $correction)
+ {
+ $symfony_request = $this->getMock('\phpbb\symfony_request', array(), array(
+ new phpbb_mock_request(),
+ ));
+ $symfony_request->expects($this->any())
+ ->method('getPathInfo')
+ ->will($this->returnValue($getPathInfo));
+ $symfony_request->expects($this->any())
+ ->method('getRequestUri')
+ ->will($this->returnValue($getRequestUri));
+ $symfony_request->expects($this->any())
+ ->method('getScriptName')
+ ->will($this->returnValue($getScriptName));
+
+ $path_helper = new \phpbb\path_helper(
+ $symfony_request,
+ new \phpbb\filesystem(),
+ $this->getMock('\phpbb\request\request'),
+ $this->phpbb_root_path,
+ 'php'
+ );
+
+ $this->assertEquals($correction . $input, $path_helper->update_web_root_path($input, $symfony_request));
+ }
+
+ public function clean_url_data()
+ {
+ return array(
+ array('', ''),
+ array('://', '://'),
+ array('http://', 'http://'),
+ array('http://one/two/three', 'http://one/two/three'),
+ array('http://../one/two', 'http://../one/two'),
+ array('http://one/../two/three', 'http://two/three'),
+ array('http://one/two/../three', 'http://one/three'),
+ array('http://one/two/../../three', 'http://three'),
+ array('http://one/two/../../../three', 'http://../three'),
+ );
+ }
+
+ /**
+ * @dataProvider clean_url_data
+ */
+ public function test_clean_url($input, $expected)
+ {
+ $this->assertEquals($expected, $this->path_helper->clean_url($input));
+ }
+
+ public function glue_url_params_data()
+ {
+ return array(
+ array(
+ array(),
+ '',
+ ),
+ array(
+ array('test' => 'xyz'),
+ 'test=xyz',
+ ),
+ array(
+ array('test' => 'xyz', 'var' => 'value'),
+ 'test=xyz&amp;var=value',
+ ),
+ array(
+ array('test' => null),
+ 'test',
+ ),
+ array(
+ array('test' => null, 'var' => null),
+ 'test&amp;var',
+ ),
+ array(
+ array('test' => 'xyz', 'var' => null, 'bar' => 'value'),
+ 'test=xyz&amp;var&amp;bar=value',
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider glue_url_params_data
+ */
+ public function test_glue_url_params($params, $expected)
+ {
+ $this->assertEquals($expected, $this->path_helper->glue_url_params($params));
+ }
+
+ public function get_url_parts_data()
+ {
+ return array(
+ array(
+ 'viewtopic.php',
+ true,
+ array('base' => 'viewtopic.php', 'params' => array()),
+ ),
+ array(
+ './viewtopic.php?t=5&amp;f=6',
+ true,
+ array('base' => './viewtopic.php', 'params' => array('t' => '5', 'f' => '6')),
+ ),
+ array(
+ 'viewtopic.php?t=5&f=6',
+ false,
+ array('base' => 'viewtopic.php', 'params' => array('t' => '5', 'f' => '6')),
+ ),
+ array(
+ 'https://phpbb.com/community/viewtopic.php?t=5&amp;f=6',
+ true,
+ array('base' => 'https://phpbb.com/community/viewtopic.php', 'params' => array('t' => '5', 'f' => '6')),
+ ),
+ array(
+ 'test.php?topic=post=5&amp;f=3',
+ true,
+ array('base' => 'test.php', 'params' => array('topic' => 'post=5', 'f' => '3')),
+ ),
+ array(
+ 'mcp.php?&amp;t=4&amp;f=3',
+ true,
+ array('base' => 'mcp.php', 'params' => array('t' => '4', 'f' => '3')),
+ ),
+ array(
+ 'mcp.php?=4&amp;f=3',
+ true,
+ array('base' => 'mcp.php', 'params' => array('f' => '3')),
+ ),
+ array(
+ 'index.php?ready',
+ false,
+ array('base' => 'index.php', 'params' => array('ready' => null)),
+ ),
+ array(
+ 'index.php?i=1&amp;ready',
+ true,
+ array('base' => 'index.php', 'params' => array('i' => '1', 'ready' => null)),
+ ),
+ array(
+ 'index.php?ready&i=1',
+ false,
+ array('base' => 'index.php', 'params' => array('ready' => null, 'i' => '1')),
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider get_url_parts_data
+ */
+ public function test_get_url_parts($url, $is_amp, $expected)
+ {
+ $this->assertEquals($expected, $this->path_helper->get_url_parts($url, $is_amp));
+ }
+
+ public function strip_url_params_data()
+ {
+ return array(
+ array(
+ 'viewtopic.php',
+ 'sid',
+ false,
+ 'viewtopic.php',
+ ),
+ array(
+ './viewtopic.php?t=5&amp;f=6',
+ 'f',
+ true,
+ './viewtopic.php?t=5',
+ ),
+ array(
+ 'viewtopic.php?t=5&f=6&sid=19adc288814103cbb4625e74e77455aa',
+ array('t'),
+ false,
+ 'viewtopic.php?f=6&amp;sid=19adc288814103cbb4625e74e77455aa',
+ ),
+ array(
+ 'https://phpbb.com/community/viewtopic.php?t=5&amp;f=6',
+ array('t', 'f'),
+ true,
+ 'https://phpbb.com/community/viewtopic.php',
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider strip_url_params_data
+ */
+ public function test_strip_url_params($url, $strip, $is_amp, $expected)
+ {
+ $this->assertEquals($expected, $this->path_helper->strip_url_params($url, $strip, $is_amp));
+ }
+
+ public function append_url_params_data()
+ {
+ return array(
+ array(
+ 'viewtopic.php',
+ array(),
+ false,
+ 'viewtopic.php',
+ ),
+ array(
+ './viewtopic.php?t=5&amp;f=6',
+ array('t' => '7'),
+ true,
+ './viewtopic.php?t=7&amp;f=6',
+ ),
+ array(
+ 'viewtopic.php?t=5&f=6&sid=19adc288814103cbb4625e74e77455aa',
+ array('p' => '5'),
+ false,
+ 'viewtopic.php?t=5&amp;f=6&amp;p=5&amp;sid=19adc288814103cbb4625e74e77455aa',
+ ),
+ array(
+ 'https://phpbb.com/community/viewtopic.php',
+ array('t' => '7', 'f' => '8'),
+ true,
+ 'https://phpbb.com/community/viewtopic.php?t=7&amp;f=8',
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider append_url_params_data
+ */
+ public function test_append_url_params($url, $params, $is_amp, $expected)
+ {
+ $this->assertEquals($expected, $this->path_helper->append_url_params($url, $params, $is_amp));
+ }
+
+ public function get_web_root_path_from_ajax_referer_data()
+ {
+ return array(
+ array(
+ 'http://www.phpbb.com/community/route1/route2/',
+ 'http://www.phpbb.com/community',
+ '../../',
+ ),
+ array(
+ 'http://www.phpbb.com/community/route1/route2',
+ 'http://www.phpbb.com/community',
+ '../',
+ ),
+ array(
+ 'http://www.phpbb.com/community/route1',
+ 'http://www.phpbb.com/community',
+ '',
+ ),
+ array(
+ 'http://www.phpbb.com/community/',
+ 'http://www.phpbb.com/community',
+ '',
+ ),
+ array(
+ 'http://www.phpbb.com/notcommunity/route1/route2/',
+ 'http://www.phpbb.com/community',
+ '../../../community/',
+ ),
+ array(
+ 'http://www.phpbb.com/notcommunity/route1/route2',
+ 'http://www.phpbb.com/community',
+ '../../community/',
+ ),
+ array(
+ 'http://www.phpbb.com/notcommunity/route1',
+ 'http://www.phpbb.com/community',
+ '../community/',
+ ),
+ array(
+ 'http://www.phpbb.com/notcommunity/',
+ 'http://www.phpbb.com/community',
+ '../community/',
+ ),
+ array(
+ 'http://www.phpbb.com/foobar',
+ 'http://www.phpbb.com',
+ '',
+ ),
+ array(
+ 'http://www.foobar.com',
+ 'http://www.phpbb.com',
+ '/www.phpbb.com/',
+ ),
+ array(
+ 'foobar',
+ 'http://www.phpbb.com/community',
+ '',
+ )
+ );
+ }
+
+ /**
+ * @dataProvider get_web_root_path_from_ajax_referer_data
+ */
+ public function test_get_web_root_path_from_ajax_referer($referer_url, $board_url, $expected)
+ {
+ $this->assertEquals($this->phpbb_root_path . $expected, $this->path_helper->get_web_root_path_from_ajax_referer($referer_url, $board_url));
+ }
+
+ public function data_get_valid_page()
+ {
+ return array(
+ // array( current page , mod_rewrite setting , expected output )
+ array('index', true, 'index'),
+ array('index', false, 'index'),
+ array('foo/index', true, 'foo/index'),
+ array('foo/index', false, 'foo/index'),
+ array('app.php/foo', true, 'foo'),
+ array('app.php/foo', false, 'app.php/foo'),
+ array('/../app.php/foo', true, '../foo'),
+ array('/../app.php/foo', false, '../app.php/foo'),
+ array('/../example/app.php/foo/bar', true, '../example/foo/bar'),
+ array('/../example/app.php/foo/bar', false, '../example/app.php/foo/bar'),
+ );
+ }
+
+ /**
+ * @dataProvider data_get_valid_page
+ */
+ public function test_get_valid_page($page, $mod_rewrite, $expected)
+ {
+ $this->assertEquals($this->phpbb_root_path . $expected, $this->path_helper->get_valid_page($page, $mod_rewrite));
+ }
+}
diff --git a/tests/plupload/plupload_test.php b/tests/plupload/plupload_test.php
new file mode 100644
index 0000000000..c3fa2b9bad
--- /dev/null
+++ b/tests/plupload/plupload_test.php
@@ -0,0 +1,53 @@
+<?php
+/**
+ *
+ * This file is part of the phpBB Forum Software package.
+ *
+ * @copyright (c) phpBB Limited <https://www.phpbb.com>
+ * @license GNU General Public License, version 2 (GPL-2.0)
+ *
+ * For full copyright and license information, please see
+ * the docs/CREDITS.txt file.
+ *
+ */
+
+class phpbb_plupload_test extends phpbb_test_case
+{
+ public function generate_resize_string_data()
+ {
+ return array(
+ array(
+ 0,
+ 0,
+ '',
+ ),
+ array(
+ 130,
+ 150,
+ 'resize: {width: 130, height: 150, quality: 85},'
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider generate_resize_string_data
+ */
+ public function test_generate_resize_string($config_width, $config_height, $expected)
+ {
+ $config = new \phpbb\config\config(array(
+ 'img_max_width' => $config_width,
+ 'img_max_height' => $config_height,
+ 'upload_path' => 'files',
+ ));
+ $plupload = new \phpbb\plupload\plupload(
+ '',
+ $config,
+ new phpbb_mock_request,
+ new \phpbb\user('\phpbb\datetime'),
+ new \phpbb\php\ini,
+ new \phpbb\mimetype\guesser(array(new \phpbb\mimetype\extension_guesser))
+ );
+
+ $this->assertEquals($expected, $plupload->generate_resize_string());
+ }
+}
diff --git a/tests/privmsgs/delete_user_pms_test.php b/tests/privmsgs/delete_user_pms_test.php
index f705825262..0f061e9784 100644
--- a/tests/privmsgs/delete_user_pms_test.php
+++ b/tests/privmsgs/delete_user_pms_test.php
@@ -1,9 +1,13 @@
<?php
/**
*
-* @package testing
-* @copyright (c) 2011 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -81,10 +85,13 @@ class phpbb_privmsgs_delete_user_pms_test extends phpbb_database_test_case
*/
public function test_delete_user_pms($delete_user, $remaining_privmsgs, $remaining_privmsgs_to)
{
- global $db;
+ global $db, $phpbb_container;
$db = $this->new_dbal();
+ $phpbb_container = new phpbb_mock_container_builder();
+ $phpbb_container->set('notification_manager', new phpbb_mock_notification_manager());
+
phpbb_delete_user_pms($delete_user);
$sql = 'SELECT msg_id
diff --git a/tests/privmsgs/fixtures/delete_user_pms.xml b/tests/privmsgs/fixtures/delete_user_pms.xml
index 9a86501b7a..5f705c9fd2 100644
--- a/tests/privmsgs/fixtures/delete_user_pms.xml
+++ b/tests/privmsgs/fixtures/delete_user_pms.xml
@@ -8,8 +8,6 @@
<column>user_unread_privmsg</column>
<column>user_permissions</column>
<column>user_sig</column>
- <column>user_occ</column>
- <column>user_interests</column>
<row>
<value>2</value>
<value>sender</value>
@@ -18,8 +16,6 @@
<value>0</value>
<value></value>
<value></value>
- <value></value>
- <value></value>
</row>
<row>
<value>3</value>
@@ -29,8 +25,6 @@
<value>0</value>
<value></value>
<value></value>
- <value></value>
- <value></value>
</row>
<row>
<value>4</value>
@@ -40,8 +34,6 @@
<value>2</value>
<value></value>
<value></value>
- <value></value>
- <value></value>
</row>
<row>
<value>5</value>
@@ -51,8 +43,6 @@
<value>0</value>
<value></value>
<value></value>
- <value></value>
- <value></value>
</row>
</table>
<table name="phpbb_privmsgs">
diff --git a/tests/profile/custom_test.php b/tests/profile/custom_test.php
deleted file mode 100644
index 1f33b45ba9..0000000000
--- a/tests/profile/custom_test.php
+++ /dev/null
@@ -1,55 +0,0 @@
-<?php
-/**
-*
-* @package testing
-* @copyright (c) 2011 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
-*
-*/
-
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions_profile_fields.php';
-
-class phpbb_profile_custom_test extends phpbb_database_test_case
-{
- public function getDataSet()
- {
- return $this->createXMLDataSet(dirname(__FILE__).'/fixtures/profile_fields.xml');
- }
-
- static public function dropdownFields()
- {
- return array(
- // note, there is an offset of 1 between option_id (0-indexed)
- // in the database and values (1-indexed) to avoid problems with
- // transmitting 0 in an HTML form
- // required, value, expected
- array(1, '0', 'FIELD_INVALID_VALUE', 'Required field should throw error for out-of-range value'),
- array(1, '1', 'FIELD_REQUIRED', 'Required field should throw error for default value'),
- array(1, '2', false, 'Required field should accept non-default value'),
- array(0, '0', 'FIELD_INVALID_VALUE', 'Optional field should throw error for out-of-range value'),
- array(0, '1', false, 'Optional field should accept default value'),
- array(0, '2', false, 'Optional field should accept non-default value'),
- );
- }
-
- /**
- * @dataProvider dropdownFields
- */
- public function test_dropdown_validate($field_required, $field_value, $expected, $description)
- {
- global $db;
- $db = $this->new_dbal();
-
- $field_data = array(
- 'field_id' => 1,
- 'lang_id' => 1,
- 'field_novalue' => 1,
- 'field_required' => $field_required,
- );
-
- $cp = new custom_profile;
- $result = $cp->validate_profile_field(FIELD_DROPDOWN, $field_value, $field_data);
-
- $this->assertEquals($expected, $result, $description);
- }
-}
diff --git a/tests/profile/fixtures/profile_fields.xml b/tests/profile/fixtures/profile_fields.xml
deleted file mode 100644
index 0b2929f625..0000000000
--- a/tests/profile/fixtures/profile_fields.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<dataset>
- <table name="phpbb_profile_fields_lang">
- <column>field_id</column>
- <column>lang_id</column>
- <column>option_id</column>
- <column>field_type</column>
- <column>lang_value</column>
- <row>
- <value>1</value>
- <value>1</value>
- <value>0</value>
- <value>5</value>
- <value>Default Option</value>
- </row>
- <row>
- <value>1</value>
- <value>1</value>
- <value>1</value>
- <value>5</value>
- <value>First Alternative</value>
- </row>
- <row>
- <value>1</value>
- <value>1</value>
- <value>2</value>
- <value>5</value>
- <value>Third Alternative</value>
- </row>
- </table>
-</dataset>
diff --git a/tests/profile/get_profile_value_test.php b/tests/profile/get_profile_value_test.php
deleted file mode 100644
index a5f37a85ce..0000000000
--- a/tests/profile/get_profile_value_test.php
+++ /dev/null
@@ -1,42 +0,0 @@
-<?php
-/**
-*
-* @package testing
-* @copyright (c) 2014 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
-*
-*/
-
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions_profile_fields.php';
-
-class phpbb_profile_get_profile_value_test extends phpbb_test_case
-{
- static public function get_profile_value_int_data()
- {
- return array(
- array(FIELD_INT, '10', true, 10),
- array(FIELD_INT, '0', true, 0),
- array(FIELD_INT, '', true, 0),
- array(FIELD_INT, null, true, 0),
- array(FIELD_INT, '10', false, 10),
- array(FIELD_INT, '0', false, 0),
- array(FIELD_INT, '', false, null),
- array(FIELD_INT, null, false, null),
- );
- }
-
- /**
- * @dataProvider get_profile_value_int_data
- */
- public function test_get_profile_value_int($type, $value, $show_novalue, $expected)
- {
- $cp = new custom_profile;
- $this->assertSame($expected, $cp->get_profile_value(array(
- 'value' => $value,
- 'data' => array(
- 'field_type' => $type,
- 'field_show_novalue' => $show_novalue,
- ),
- )));
- }
-}
diff --git a/tests/profilefields/type_bool_test.php b/tests/profilefields/type_bool_test.php
new file mode 100644
index 0000000000..41c40ddb4b
--- /dev/null
+++ b/tests/profilefields/type_bool_test.php
@@ -0,0 +1,195 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+class phpbb_profilefield_type_bool_test extends phpbb_test_case
+{
+ protected $cp;
+ protected $field_options = array();
+ protected $options = array();
+
+ /**
+ * Sets up basic test objects
+ *
+ * @access public
+ * @return void
+ */
+ public function setUp()
+ {
+ $user = $this->getMock('\phpbb\user', array(), array('\phpbb\datetime'));
+ $user->expects($this->any())
+ ->method('lang')
+ ->will($this->returnCallback(array($this, 'return_callback_implode')));
+
+ $lang = $this->getMock('\phpbb\profilefields\lang_helper', array(), array(null, null));
+
+ $lang->expects($this->any())
+ ->method('get_options_lang');
+
+ $lang->expects($this->any())
+ ->method('is_set')
+ ->will($this->returnCallback(array($this, 'is_set_callback')));
+
+ $lang->expects($this->any())
+ ->method('get')
+ ->will($this->returnCallback(array($this, 'get')));
+
+ $request = $this->getMock('\phpbb\request\request');
+ $template = $this->getMock('\phpbb\template\template');
+
+ $this->cp = new \phpbb\profilefields\type\type_bool(
+ $lang,
+ $request,
+ $template,
+ $user
+ );
+
+ $this->field_options = array(
+ 'field_type' => '\phpbb\profilefields\type\type_bool',
+ 'field_name' => 'field',
+ 'field_id' => 1,
+ 'lang_id' => 1,
+ 'lang_name' => 'field',
+ 'field_required' => false,
+ 'field_default_value' => 1,
+ 'field_length' => 1,
+ );
+
+ $this->options = array(
+ 0 => 'Yes',
+ 1 => 'No',
+ );
+ }
+
+ public function validate_profile_field_data()
+ {
+ return array(
+ array(
+ false,
+ array('field_required' => true),
+ 'FIELD_REQUIRED-field',
+ 'Field should not accept empty values for required fields',
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider validate_profile_field_data
+ */
+ public function test_validate_profile_field($value, $field_options, $expected, $description)
+ {
+ $field_options = array_merge($this->field_options, $field_options);
+
+ $result = $this->cp->validate_profile_field($value, $field_options);
+
+ $this->assertSame($expected, $result, $description);
+ }
+
+ public function profile_value_data()
+ {
+ return array(
+ array(
+ false,
+ array('field_show_novalue' => true),
+ 'No',
+ 'Field should output the default value',
+ ),
+ array(
+ false,
+ array('field_show_novalue' => false, 'field_length' => 2),
+ null,
+ 'Field should not show anything for empty value',
+ ),
+ array(
+ 0,
+ array(),
+ 'Yes',
+ 'Field should show the set value',
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider profile_value_data
+ */
+ public function test_get_profile_value($value, $field_options, $expected, $description)
+ {
+ $field_options = array_merge($this->field_options, $field_options);
+
+ $result = $this->cp->get_profile_value($value, $field_options);
+
+ $this->assertSame($expected, $result, $description);
+ }
+
+ public function profile_value_raw_data()
+ {
+ return array(
+ array(
+ '4',
+ array('field_show_novalue' => true),
+ '4',
+ 'Field should return the correct raw value',
+ ),
+ array(
+ '',
+ array('field_show_novalue' => false),
+ null,
+ 'Field should return correct raw value',
+ ),
+ array(
+ '',
+ array('field_show_novalue' => true),
+ null,
+ 'Field should return correct raw value',
+ ),
+ array(
+ null,
+ array('field_show_novalue' => false),
+ null,
+ 'Field should return correct raw value',
+ ),
+ array(
+ null,
+ array('field_show_novalue' => true),
+ null,
+ 'Field should return correct raw value',
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider profile_value_raw_data
+ */
+ public function test_get_profile_value_raw($value, $field_options, $expected, $description)
+ {
+ $field_options = array_merge($this->field_options, $field_options);
+
+ $result = $this->cp->get_profile_value_raw($value, $field_options);
+
+ $this->assertSame($expected, $result, $description);
+ }
+
+ public function is_set_callback($field_id, $lang_id, $field_value)
+ {
+ return isset($this->options[$field_value]);
+ }
+
+ public function get($field_id, $lang_id, $field_value)
+ {
+ return $this->options[$field_value];
+ }
+
+ public function return_callback_implode()
+ {
+ return implode('-', func_get_args());
+ }
+}
diff --git a/tests/profilefields/type_date_test.php b/tests/profilefields/type_date_test.php
new file mode 100644
index 0000000000..123955198e
--- /dev/null
+++ b/tests/profilefields/type_date_test.php
@@ -0,0 +1,228 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+class phpbb_profilefield_type_date_test extends phpbb_test_case
+{
+ protected $cp;
+ protected $field_options;
+ protected $user;
+
+ /**
+ * Sets up basic test objects
+ *
+ * @access public
+ * @return null
+ */
+ public function setUp()
+ {
+ $this->user = $this->getMock('\phpbb\user', array(), array('\phpbb\datetime'));
+ $this->user->expects($this->any())
+ ->method('lang')
+ ->will($this->returnCallback(array($this, 'return_callback_implode')));
+
+ $this->user->expects($this->any())
+ ->method('create_datetime')
+ ->will($this->returnCallback(array($this, 'create_datetime_callback')));
+
+ $this->user->timezone = new DateTimeZone('UTC');
+ $this->user->lang = array(
+ 'datetime' => array(),
+ 'DATE_FORMAT' => 'm/d/Y',
+ );
+
+ $request = $this->getMock('\phpbb\request\request');
+ $template = $this->getMock('\phpbb\template\template');
+
+ $this->cp = new \phpbb\profilefields\type\type_date(
+ $request,
+ $template,
+ $this->user
+ );
+
+ $this->field_options = array(
+ 'field_type' => '\phpbb\profilefields\type\type_date',
+ 'field_name' => 'field',
+ 'field_id' => 1,
+ 'lang_id' => 1,
+ 'lang_name' => 'field',
+ 'field_required' => false,
+ );
+ }
+
+ public function profile_value_data()
+ {
+ return array(
+ array(
+ '01-01-2009',
+ array('field_show_novalue' => true),
+ '01/01/2009',
+ 'Field should output the correctly formatted date',
+ ),
+ array(
+ null,
+ array('field_show_novalue' => false),
+ null,
+ 'Field should leave empty value as is',
+ ),
+ array(
+ 'None',
+ array('field_show_novalue' => true),
+ 'None',
+ 'Field should leave invalid value as is',
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider profile_value_data
+ */
+ public function test_get_profile_value($value, $field_options, $expected, $description)
+ {
+ $field_options = array_merge($this->field_options, $field_options);
+
+ $result = $this->cp->get_profile_value($value, $field_options);
+
+ $this->assertSame($expected, $result, $description);
+ }
+
+ public function validate_profile_field_data()
+ {
+ return array(
+ array(
+ '',
+ array('field_required' => true),
+ 'FIELD_REQUIRED-field',
+ 'Field should reject value for being empty',
+ ),
+ array(
+ '0125',
+ array('field_required' => true),
+ 'FIELD_REQUIRED-field',
+ 'Field should reject value for being invalid',
+ ),
+ array(
+ '01-01-2012',
+ array(),
+ false,
+ 'Field should accept a valid value',
+ ),
+ array(
+ '40-05-2009',
+ array(),
+ 'FIELD_INVALID_DATE-field',
+ 'Field should reject value for being invalid',
+ ),
+ array(
+ '12-30-2012',
+ array(),
+ 'FIELD_INVALID_DATE-field',
+ 'Field should reject value for being invalid',
+ ),
+ array(
+ 'string',
+ array(),
+ false,
+ 'Field should reject value for being invalid',
+ ),
+ array(
+ 'string',
+ array('field_required' => true),
+ 'FIELD_REQUIRED-field',
+ 'Field should reject value for being invalid',
+ ),
+ array(
+ 100,
+ array(),
+ false,
+ 'Field should reject value for being invalid',
+ ),
+ array(
+ 100,
+ array('field_required' => true),
+ 'FIELD_REQUIRED-field',
+ 'Field should reject value for being invalid',
+ ),
+ array(
+ null,
+ array('field_required' => true),
+ 'FIELD_REQUIRED-field',
+ 'Field should reject value for being empty',
+ ),
+ array(
+ true,
+ array('field_required' => true),
+ 'FIELD_REQUIRED-field',
+ 'Field should reject value for being empty',
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider validate_profile_field_data
+ */
+ public function test_validate_profile_field($value, $field_options, $expected, $description)
+ {
+ $field_options = array_merge($this->field_options, $field_options);
+
+ $result = $this->cp->validate_profile_field($value, $field_options);
+
+ $this->assertSame($expected, $result, $description);
+ }
+
+ public function profile_value_raw_data()
+ {
+ return array(
+ array(
+ '',
+ array('field_show_novalue' => false),
+ null,
+ 'Field should return the correct raw value',
+ ),
+ array(
+ '',
+ array('field_show_novalue' => true),
+ '',
+ 'Field should return correct raw value',
+ ),
+ array(
+ '12/06/2014',
+ array('field_show_novalue' => true),
+ '12/06/2014',
+ 'Field should return correct raw value',
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider profile_value_raw_data
+ */
+ public function test_get_profile_value_raw($value, $field_options, $expected, $description)
+ {
+ $field_options = array_merge($this->field_options, $field_options);
+
+ $result = $this->cp->get_profile_value_raw($value, $field_options);
+
+ $this->assertSame($expected, $result, $description);
+ }
+
+ public function return_callback_implode()
+ {
+ return implode('-', func_get_args());
+ }
+
+ public function create_datetime_callback($time = 'now', \DateTimeZone $timezone = null)
+ {
+ $timezone = $timezone ?: $this->user->timezone;
+ return new \phpbb\datetime($this->user, $time, $timezone);
+ }
+}
diff --git a/tests/profilefields/type_dropdown_test.php b/tests/profilefields/type_dropdown_test.php
new file mode 100644
index 0000000000..3845a8e96b
--- /dev/null
+++ b/tests/profilefields/type_dropdown_test.php
@@ -0,0 +1,235 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+class phpbb_profilefield_type_dropdown_test extends phpbb_test_case
+{
+ protected $cp;
+ protected $field_options = array();
+ protected $dropdown_options = array();
+
+ /**
+ * Sets up basic test objects
+ *
+ * @access public
+ * @return null
+ */
+ public function setUp()
+ {
+ $user = $this->getMock('\phpbb\user', array(), array('\phpbb\datetime'));
+ $user->expects($this->any())
+ ->method('lang')
+ ->will($this->returnCallback(array($this, 'return_callback_implode')));
+
+ $request = $this->getMock('\phpbb\request\request');
+ $template = $this->getMock('\phpbb\template\template');
+
+ $lang = $this->getMock('\phpbb\profilefields\lang_helper', array(), array(null, null));
+
+ $lang->expects($this->any())
+ ->method('get_options_lang');
+
+ $lang->expects($this->any())
+ ->method('is_set')
+ ->will($this->returnCallback(array($this, 'is_set_callback')));
+
+ $lang->expects($this->any())
+ ->method('get')
+ ->will($this->returnCallback(array($this, 'get')));
+
+ $this->cp = new \phpbb\profilefields\type\type_dropdown(
+ $lang,
+ $request,
+ $template,
+ $user
+ );
+
+ $this->field_options = array(
+ 'field_type' => '\phpbb\profilefields\type\type_dropdown',
+ 'field_name' => 'field',
+ 'field_id' => 1,
+ 'lang_id' => 1,
+ 'lang_name' => 'field',
+ 'field_required' => false,
+ 'field_validation' => '.*',
+ 'field_novalue' => 0,
+ );
+
+ $this->dropdown_options = array(
+ 0 => '<No Value>',
+ 1 => 'Option 1',
+ 2 => 'Option 2',
+ 3 => 'Option 3',
+ 4 => 'Option 4',
+ );
+ }
+
+ public function validate_profile_field_data()
+ {
+ return array(
+ array(
+ 7,
+ array(),
+ 'FIELD_INVALID_VALUE-field',
+ 'Invalid value should throw error',
+ ),
+ array(
+ true,
+ array('field_required' => true),
+ false,
+ 'Boolean would evaluate to 1 and hence correct value',
+ ),
+ array(
+ 'string',
+ array('field_required' => true),
+ 'FIELD_REQUIRED-field',
+ 'String should be rejected for value',
+ ),
+ array(
+ 2,
+ array(),
+ false,
+ 'Valid value should not throw error'
+ ),
+ array(
+ 0,
+ array(),
+ false,
+ 'Empty value should be acceptible',
+ ),
+ array(
+ 0,
+ array('field_required' => true),
+ 'FIELD_REQUIRED-field',
+ 'Required field should not accept empty value',
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider validate_profile_field_data
+ */
+ public function test_validate_profile_field($value, $field_options, $expected, $description)
+ {
+ $field_options = array_merge($this->field_options, $field_options);
+
+ $result = $this->cp->validate_profile_field($value, $field_options);
+
+ $this->assertSame($expected, $result, $description);
+ }
+
+ public function profile_value_data()
+ {
+ return array(
+ array(
+ 1,
+ array('field_show_novalue' => true),
+ 'Option 1',
+ 'Field should output the given value',
+ ),
+ array(
+ 4,
+ array('field_show_novalue' => false),
+ 'Option 4',
+ 'Field should output the given value',
+ ),
+ array(
+ '',
+ array('field_show_novalue' => true),
+ '<No Value>',
+ 'Field should output nothing for empty value',
+ ),
+ array(
+ '',
+ array('field_show_novalue' => false),
+ null,
+ 'Field should simply output null for empty value',
+ ),
+ );
+ }
+
+
+ /**
+ * @dataProvider profile_value_data
+ */
+ public function test_get_profile_value($value, $field_options, $expected, $description)
+ {
+ $field_options = array_merge($this->field_options, $field_options);
+
+ $result = $this->cp->get_profile_value($value, $field_options);
+
+ $this->assertSame($expected, $result, $description);
+ }
+
+ public function profile_value_raw_data()
+ {
+ return array(
+ array(
+ '4',
+ array('field_show_novalue' => true),
+ '4',
+ 'Field should return the correct raw value',
+ ),
+ array(
+ '',
+ array('field_show_novalue' => false),
+ null,
+ 'Field should null for empty value without show_novalue',
+ ),
+ array(
+ '',
+ array('field_show_novalue' => true),
+ 0,
+ 'Field should return 0 for empty value with show_novalue',
+ ),
+ array(
+ null,
+ array('field_show_novalue' => false),
+ null,
+ 'Field should return correct raw value',
+ ),
+ array(
+ null,
+ array('field_show_novalue' => true),
+ 0,
+ 'Field should return 0 for empty value with show_novalue',
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider profile_value_raw_data
+ */
+ public function test_get_profile_value_raw($value, $field_options, $expected, $description)
+ {
+ $field_options = array_merge($this->field_options, $field_options);
+
+ $result = $this->cp->get_profile_value_raw($value, $field_options);
+
+ $this->assertSame($expected, $result, $description);
+ }
+
+ public function is_set_callback($field_id, $lang_id, $field_value)
+ {
+ return isset($this->dropdown_options[$field_value]);
+ }
+
+ public function get($field_id, $lang_id, $field_value)
+ {
+ return $this->dropdown_options[$field_value];
+ }
+
+ public function return_callback_implode()
+ {
+ return implode('-', func_get_args());
+ }
+}
diff --git a/tests/profilefields/type_googleplus_test.php b/tests/profilefields/type_googleplus_test.php
new file mode 100644
index 0000000000..f3db6ef01f
--- /dev/null
+++ b/tests/profilefields/type_googleplus_test.php
@@ -0,0 +1,94 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+require_once __DIR__ . '/../../phpBB/includes/utf/utf_tools.php';
+
+class phpbb_profilefield_type_googleplus_test extends phpbb_test_case
+{
+ protected $field;
+
+ public function setUp()
+ {
+ parent::setUp();
+
+ $user = new \phpbb\user('\phpbb\datetime');
+ $user->add_lang('ucp');
+ $request = $this->getMock('\phpbb\request\request');
+ $template = $this->getMock('\phpbb\template\template');
+
+ $this->field = new \phpbb\profilefields\type\type_googleplus(
+ $request,
+ $template,
+ $user
+ );
+ }
+ public function get_profile_contact_value_data()
+ {
+ return array(
+ array(
+ '112010191010100',
+ array(),
+ '112010191010100',
+ 'Field should return a numerical Google+ ID as is',
+ ),
+ array(
+ 'TestUsername',
+ array(),
+ '+TestUsername',
+ 'Field should return a string Google+ ID with a + prefixed',
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider get_profile_contact_value_data
+ */
+ public function test_get_profile_contact_value($value, $field_options, $expected, $description)
+ {
+ $default_field_options = array(
+ 'field_type' => '\phpbb\profilefields\type\type_googleplus',
+ 'field_name' => 'field',
+ 'field_id' => 1,
+ 'lang_id' => 1,
+ 'lang_name' => 'field',
+ 'field_required' => false,
+ 'field_validation' => '[\w]+',
+ );
+ $field_options = array_merge($default_field_options, $field_options);
+
+ $this->assertSame($expected, $this->field->get_profile_contact_value($value, $field_options), $description);
+ }
+
+ public function data_validate_googleplus()
+ {
+ return array(
+ array('foobar', false),
+ array('2342340929304', false),
+ array('foo<bar', 'The field “googleplus” has invalid characters.'),
+ array('klkd.klkl', false),
+ array('kl+', 'The field “googleplus” has invalid characters.'),
+ array('foo=bar', 'The field “googleplus” has invalid characters.'),
+ array('..foo', 'The field “googleplus” has invalid characters.'),
+ array('foo..bar', 'The field “googleplus” has invalid characters.'),
+ );
+ }
+
+ /**
+ * @dataProvider data_validate_googleplus
+ */
+ public function test_validate_googleplus($input, $expected)
+ {
+ $field_data = array_merge(array('lang_name' => 'googleplus'), $this->field->get_default_option_values());
+ $this->assertSame($expected, $this->field->validate_string_profile_field('string', $input, $field_data));
+ }
+}
diff --git a/tests/profilefields/type_int_test.php b/tests/profilefields/type_int_test.php
new file mode 100644
index 0000000000..07b22525e2
--- /dev/null
+++ b/tests/profilefields/type_int_test.php
@@ -0,0 +1,236 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+class phpbb_profilefield_type_int_test extends phpbb_test_case
+{
+ protected $cp;
+ protected $field_options;
+
+ /**
+ * Sets up basic test objects
+ *
+ * @access public
+ * @return null
+ */
+ public function setUp()
+ {
+ $user = $this->getMock('\phpbb\user', array(), array('\phpbb\datetime'));
+ $user->expects($this->any())
+ ->method('lang')
+ ->will($this->returnCallback(array($this, 'return_callback_implode')));
+
+ $request = $this->getMock('\phpbb\request\request');
+ $template = $this->getMock('\phpbb\template\template');
+
+ $this->cp = new \phpbb\profilefields\type\type_int(
+ $request,
+ $template,
+ $user
+ );
+
+ $this->field_options = array(
+ 'field_type' => '\phpbb\profilefields\type\type_int',
+ 'field_name' => 'field',
+ 'field_id' => 1,
+ 'lang_id' => 1,
+ 'lang_name' => 'field',
+ 'field_required' => false,
+ );
+ }
+
+ public function profile_value_data()
+ {
+ return array(
+ array(
+ '10',
+ array('field_show_novalue' => true),
+ 10,
+ 'Field should output integer value of given input',
+ ),
+ array(
+ '0',
+ array('field_show_novalue' => true),
+ 0,
+ 'Field should output integer value of given input',
+ ),
+ array(
+ '',
+ array('field_show_novalue' => true),
+ 0,
+ 'Field should translate empty value to 0 as integer',
+ false,
+ ),
+ array(
+ null,
+ array('field_show_novalue' => true),
+ 0,
+ 'Field should translate null value to 0 as integer',
+ ),
+ array(
+ '10',
+ array('field_show_novalue' => false),
+ 10,
+ 'Field should output integer value of given input',
+ ),
+ array(
+ '0',
+ array('field_show_novalue' => false),
+ 0,
+ 'Field should output integer value of given input',
+ ),
+ array(
+ '',
+ array('field_show_novalue' => false),
+ null,
+ 'Field should leave empty value as is',
+ ),
+ array(
+ null,
+ array('field_show_novalue' => false),
+ null,
+ 'Field should leave empty value as is',
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider profile_value_data
+ */
+ public function test_get_profile_value($value, $field_options, $expected, $description)
+ {
+ $field_options = array_merge($this->field_options, $field_options);
+
+ $result = $this->cp->get_profile_value($value, $field_options);
+
+ $this->assertSame($expected, $result, $description);
+ }
+
+ public function validate_profile_field_data()
+ {
+ return array(
+ array(
+ '15',
+ array('field_minlen' => 10, 'field_maxlen' => 20, 'field_required' => true),
+ false,
+ 'Field should accept input of correct boundaries',
+ ),
+ array(
+ '556476',
+ array('field_maxlen' => 50000, 'field_required' => true),
+ 'FIELD_TOO_LARGE-50000-field',
+ 'Field should reject value of greater value than max',
+ ),
+ array(
+ '9',
+ array('field_minlen' => 10, 'field_required' => true),
+ 'FIELD_TOO_SMALL-10-field',
+ 'Field should reject value which is less than defined minimum',
+ ),
+ array(
+ true,
+ array('field_maxlen' => 20),
+ false,
+ 'Field should accept correct boolean value',
+ ),
+ array(
+ 'string',
+ array('field_maxlen' => 10, 'field_required' => true),
+ false,
+ 'Field should accept correct string value',
+ ),
+ array(
+ null,
+ array('field_minlen' => 1, 'field_maxlen' => 10, 'field_required' => true),
+ 'FIELD_TOO_SMALL-1-field',
+ 'Field should not accept an empty value',
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider validate_profile_field_data
+ */
+ public function test_validate_profile_field($value, $field_options, $expected, $description)
+ {
+ $field_options = array_merge($this->field_options, $field_options);
+
+ $result = $this->cp->validate_profile_field($value, $field_options);
+
+ $this->assertSame($expected, $result, $description);
+ }
+
+ public function profile_value_raw_data()
+ {
+ return array(
+ array(
+ '10',
+ array('field_show_novalue' => true),
+ 10,
+ 'Field should return the correct raw value',
+ ),
+ array(
+ '0',
+ array('field_show_novalue' => true),
+ 0,
+ 'Field should return correct raw value',
+ ),
+ array(
+ '',
+ array('field_show_novalue' => true),
+ 0,
+ 'Field should return correct raw value',
+ ),
+ array(
+ '10',
+ array('field_show_novalue' => false),
+ 10,
+ 'Field should return the correct raw value',
+ ),
+ array(
+ '0',
+ array('field_show_novalue' => false),
+ 0,
+ 'Field should return correct raw value',
+ ),
+ array(
+ '',
+ array('field_show_novalue' => false),
+ null,
+ 'Field should return correct raw value',
+ ),
+ array(
+ 'string',
+ array('field_show_novalue' => false),
+ 0,
+ 'Field should return int cast of passed string'
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider profile_value_raw_data
+ */
+ public function test_get_profile_value_raw($value, $field_options, $expected, $description)
+ {
+ $field_options = array_merge($this->field_options, $field_options);
+
+ $result = $this->cp->get_profile_value_raw($value, $field_options);
+
+ $this->assertSame($expected, $result, $description);
+ }
+
+ public function return_callback_implode()
+ {
+ return implode('-', func_get_args());
+ }
+}
diff --git a/tests/profilefields/type_string_test.php b/tests/profilefields/type_string_test.php
new file mode 100644
index 0000000000..0417afbfab
--- /dev/null
+++ b/tests/profilefields/type_string_test.php
@@ -0,0 +1,353 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions_content.php';
+require_once dirname(__FILE__) . '/../../phpBB/includes/utf/utf_tools.php';
+
+class phpbb_profilefield_type_string_test extends phpbb_test_case
+{
+ protected $cp;
+ protected $field_options;
+
+ /**
+ * Sets up basic test objects
+ *
+ * @access public
+ * @return null
+ */
+ public function setUp()
+ {
+ global $request, $user, $cache;
+
+ $user = $this->getMock('\phpbb\user', array(), array('\phpbb\datetime'));
+ $cache = new phpbb_mock_cache;
+ $user->expects($this->any())
+ ->method('lang')
+ ->will($this->returnCallback(array($this, 'return_callback_implode')));
+
+ $request = $this->getMock('\phpbb\request\request');
+ $template = $this->getMock('\phpbb\template\template');
+
+ $this->cp = new \phpbb\profilefields\type\type_string(
+ $request,
+ $template,
+ $user
+ );
+
+ $this->field_options = array(
+ 'field_type' => '\phpbb\profilefields\type\type_string',
+ 'field_name' => 'field',
+ 'field_id' => 1,
+ 'lang_id' => 1,
+ 'lang_name' => 'field',
+ 'field_required' => false,
+ 'field_validation' => '.*',
+ );
+ }
+
+ public function validate_profile_field_data()
+ {
+ return array(
+ array(
+ '',
+ array('field_required' => true),
+ 'FIELD_REQUIRED-field',
+ 'Field should not accept empty values for required fields',
+ ),
+ array(
+ null,
+ array('field_required' => true),
+ 'FIELD_REQUIRED-field',
+ 'Field should not accept empty values for required field',
+ ),
+ array(
+ 0,
+ array('field_required' => true),
+ false,
+ 'Field should accept a non-empty input',
+ ),
+ array(
+ 'false',
+ array('field_required' => true),
+ false,
+ 'Field should accept a non-empty input',
+ ),
+ array(
+ 10,
+ array('field_required' => true),
+ false,
+ 'Field should accept a non-empty input',
+ ),
+ array(
+ 'tas',
+ array('field_minlen' => 2, 'field_maxlen' => 5),
+ false,
+ 'Field should accept value of correct length',
+ ),
+ array(
+ 't',
+ array('field_minlen' => 2, 'field_maxlen' => 5),
+ 'FIELD_TOO_SHORT-2-field',
+ 'Field should reject value of incorrect length',
+ ),
+ array(
+ 'this is a long string',
+ array('field_minlen' => 2, 'field_maxlen' => 5),
+ 'FIELD_TOO_LONG-5-field',
+ 'Field should reject value of incorrect length',
+ ),
+ array(
+ 'H3110',
+ array('field_validation' => '[0-9]+'),
+ 'FIELD_INVALID_CHARS_NUMBERS_ONLY-field',
+ 'Required field should reject characters in a numbers-only field',
+ ),
+ array(
+ '&lt;&gt;&quot;&amp;%&amp;&gt;&lt;&gt;',
+ array('field_maxlen' => 10, 'field_minlen' => 2),
+ false,
+ 'Optional field should accept html entities',
+ ),
+ array(
+ 'ö ä ü ß',
+ array(),
+ false,
+ 'Required field should accept UTF-8 string',
+ ),
+ array(
+ 'This ö ä string has to b',
+ array('field_maxlen' => 10),
+ 'FIELD_TOO_LONG-10-field',
+ 'Required field should reject an UTF-8 string which is too long',
+ ),
+ array(
+ 'ö äö äö ä',
+ array('field_validation' => '[a-zA-Z0-9]+'),
+ 'FIELD_INVALID_CHARS_ALPHA_ONLY-field',
+ 'Required field should reject UTF-8 in alpha only field',
+ ),
+ array(
+ 'a_abc',
+ array('field_validation' => '[a-zA-Z0-9]+'),
+ 'FIELD_INVALID_CHARS_ALPHA_ONLY-field',
+ 'Required field should reject underscore in alpha only field',
+ ),
+ array(
+ 'Hello',
+ array('field_validation' => '[a-zA-Z0-9]+'),
+ false,
+ 'Required field should accept a characters only field',
+ ),
+ array(
+ 'Valid.Username123',
+ array('field_validation' => '[a-zA-Z0-9.]+'),
+ false,
+ 'Required field should accept a alphanumeric field with dots',
+ ),
+ array(
+ 'Invalid.,username123',
+ array('field_validation' => '[a-zA-Z0-9.]+'),
+ 'FIELD_INVALID_CHARS_ALPHA_DOTS-field',
+ 'Required field should reject field with comma',
+ ),
+ array(
+ 'Invalid._username123',
+ array('field_validation' => '[a-zA-Z0-9.]+'),
+ 'FIELD_INVALID_CHARS_ALPHA_DOTS-field',
+ 'Required field should reject field with underscore',
+ ),
+ array(
+ 'skype.test.name,_this',
+ array('field_validation' => '[a-zA-Z][\w\.,\-]+'),
+ false,
+ 'Required field should accept alphanumeric field with punctuations',
+ ),
+ array(
+ '1skype.this.should.faila',
+ array('field_validation' => '[a-zA-Z][\w\.,\-]+'),
+ 'FIELD_INVALID_CHARS_ALPHA_PUNCTUATION-field',
+ 'Required field should reject field having invalid input for the given validation',
+ ),
+ // UTF-8 string tests
+ array(
+ 'ö äö äö ä',
+ array('field_validation' => '[\p{Lu}\p{Ll}0-9]+'),
+ 'FIELD_INVALID_CHARS_LETTER_NUM_ONLY-field',
+ 'Required field should reject spaces in UTF-8 letternumeric only field',
+ ),
+ array(
+ 'Имя123',
+ array('field_validation' => '[\p{Lu}\p{Ll}0-9]+'),
+ false,
+ 'Required field should accept UTF-8 letternumeric only field',
+ ),
+ array(
+ 'Ö äö äö- ä+',
+ array('field_validation' => '[\p{Lu}\p{Ll}0-9_]+'),
+ 'FIELD_INVALID_CHARS_LETTER_NUM_UNDERSCORE-field',
+ 'Required field should reject spacers in UTF-8 letternumeric with underscore field',
+ ),
+ array(
+ 'Правильное.Имя123',
+ array('field_validation' => '[\p{Lu}\p{Ll}0-9.]+'),
+ false,
+ 'Required field should accept UTF-8 letternumeric field with dots',
+ ),
+ array(
+ 'Неправильное.,имя123',
+ array('field_validation' => '[\p{Lu}\p{Ll}0-9.]+'),
+ 'FIELD_INVALID_CHARS_LETTER_NUM_DOTS-field',
+ 'Required field should reject comma in UTF-8 letternumeric field with dots',
+ ),
+ array(
+ 'Ö äö äö- ä+',
+ array('field_validation' => '[\p{Lu}\p{Ll}0-9\x20_+\-\[\]]+'),
+ false,
+ 'Required field should accept spacers in UTF-8 letternumeric with spacers field',
+ ),
+ array(
+ 'skype.test.name,_this',
+ array('field_validation' => '[\p{Lu}\p{Ll}][\p{Lu}\p{Ll}0-9.,\-_]+'),
+ false,
+ 'Required field should accept alphanumeric value for UTF-8 letternumeric field with punctuations',
+ ),
+ array(
+ '1skype.this.should.fail',
+ array('field_validation' => '[\p{Lu}\p{Ll}][\p{Lu}\p{Ll}0-9.,\-_]+'),
+ 'FIELD_INVALID_CHARS_LETTER_NUM_PUNCTUATION-field',
+ 'Required field should reject field having leading numeric for UTF-8 letternumeric field with punctuations',
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider validate_profile_field_data
+ */
+ public function test_validate_profile_field($value, $field_options, $expected, $description)
+ {
+ $field_options = array_merge($this->field_options, $field_options);
+
+ $result = $this->cp->validate_profile_field($value, $field_options);
+
+ $this->assertSame($expected, $result, $description);
+ }
+
+ public function profile_value_data()
+ {
+ return array(
+ array(
+ 'test',
+ array('field_show_novalue' => true),
+ 'test',
+ 'Field should output the given value',
+ ),
+ array(
+ 'test',
+ array('field_show_novalue' => false),
+ 'test',
+ 'Field should output the given value',
+ ),
+ array(
+ '',
+ array('field_show_novalue' => true),
+ '',
+ 'Field should output nothing for empty value',
+ ),
+ array(
+ '',
+ array('field_show_novalue' => false),
+ null,
+ 'Field should simply output null for empty vlaue',
+ ),
+ );
+ }
+
+
+ /**
+ * @dataProvider profile_value_data
+ */
+ public function test_get_profile_value($value, $field_options, $expected, $description)
+ {
+ $field_options = array_merge($this->field_options, $field_options);
+
+ $result = $this->cp->get_profile_value($value, $field_options);
+
+ $this->assertSame($expected, $result, $description);
+ }
+
+ public function profile_value_raw_data()
+ {
+ return array(
+ array(
+ '[b]bbcode test[/b]',
+ array('field_show_novalue' => true),
+ '[b]bbcode test[/b]',
+ 'Field should return the correct raw value',
+ ),
+ array(
+ '[b]bbcode test[/b]',
+ array('field_show_novalue' => false),
+ '[b]bbcode test[/b]',
+ 'Field should return correct raw value',
+ ),
+ array(
+ 125,
+ array('field_show_novalue' => false),
+ 125,
+ 'Field should return value of integer as is',
+ ),
+ array(
+ 0,
+ array('field_show_novalue' => false),
+ 0,
+ 'Field should return value of integer 0 without show_novalue',
+ ),
+ array(
+ '0',
+ array('field_show_novalue' => false),
+ '0',
+ 'Field should return string 0',
+ ),
+ array(
+ 0,
+ array('field_show_novalue' => true),
+ 0,
+ 'Field should return 0 for empty integer with show_novalue',
+ ),
+ array(
+ null,
+ array('field_show_novalue' => true),
+ null,
+ 'field should return null value as is',
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider profile_value_raw_data
+ */
+ public function test_get_profile_value_raw($value, $field_options, $expected, $description)
+ {
+ $field_options = array_merge($this->field_options, $field_options);
+
+ $result = $this->cp->get_profile_value_raw($value, $field_options);
+
+ $this->assertSame($expected, $result, $description);
+ }
+
+ public function return_callback_implode()
+ {
+ return implode('-', func_get_args());
+ }
+}
diff --git a/tests/profilefields/type_url_test.php b/tests/profilefields/type_url_test.php
new file mode 100644
index 0000000000..cc37f04f30
--- /dev/null
+++ b/tests/profilefields/type_url_test.php
@@ -0,0 +1,181 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
+
+class phpbb_profilefield_type_url_test extends phpbb_test_case
+{
+ protected $cp;
+ protected $field_options;
+
+ /**
+ * Sets up basic test objects
+ *
+ * @access public
+ * @return null
+ */
+ public function setUp()
+ {
+ $user = $this->getMock('\phpbb\user', array(), array('\phpbb\datetime'));
+ $user->expects($this->any())
+ ->method('lang')
+ ->will($this->returnCallback(array($this, 'return_callback_implode')));
+
+ $request = $this->getMock('\phpbb\request\request');
+ $template = $this->getMock('\phpbb\template\template');
+
+ $this->cp = new \phpbb\profilefields\type\type_url(
+ $request,
+ $template,
+ $user
+ );
+
+ $this->field_options = array(
+ 'field_type' => '\phpbb\profilefields\type\type_url',
+ 'field_name' => 'field',
+ 'field_id' => 1,
+ 'lang_id' => 1,
+ 'lang_name' => 'field',
+ 'field_required' => false,
+ );
+ }
+
+ public function validate_profile_field_data()
+ {
+ return array(
+ array(
+ '',
+ array('field_required' => true),
+ 'FIELD_INVALID_URL-field',
+ 'Field should reject empty field that is required',
+ ),
+ array(
+ 'invalidURL',
+ array(),
+ 'FIELD_INVALID_URL-field',
+ 'Field should reject invalid input',
+ ),
+ array(
+ 'http://onetwothree.example.io',
+ array(),
+ false,
+ 'Field should accept valid URL',
+ ),
+ array(
+ 'http://example.com/index.html?param1=test&param2=awesome',
+ array(),
+ false,
+ 'Field should accept valid URL',
+ ),
+ array(
+ 'http://example.com/index.html/test/path?document=get',
+ array(),
+ false,
+ 'Field should accept valid URL',
+ ),
+ array(
+ 'http://example.com/index.html/test/path?document[]=DocType%20test&document[]=AnotherDoc',
+ array(),
+ 'FIELD_INVALID_URL-field',
+ 'Field should reject invalid URL having multi value parameters',
+ ),
+
+ // IDN url type profilefields
+ array(
+ 'http://www.täst.de',
+ array(),
+ false,
+ 'Field should accept valid IDN',
+ ),
+ array(
+ 'http://täst.de/index.html?param1=test&param2=awesome',
+ array(),
+ false,
+ 'Field should accept valid IDN URL with params',
+ ),
+ array(
+ 'http://домен.рф/index.html/тест/path?document=get',
+ array(),
+ false,
+ 'Field should accept valid IDN URL',
+ ),
+ array(
+ 'http://домен.рф/index.html/тест/path?document[]=DocType%20test&document[]=AnotherDoc',
+ array(),
+ 'FIELD_INVALID_URL-field',
+ 'Field should reject invalid IDN URL having multi value parameters',
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider validate_profile_field_data
+ */
+ public function test_validate_profile_field($value, $field_options, $expected, $description)
+ {
+ $field_options = array_merge($this->field_options, $field_options);
+
+ $result = $this->cp->validate_profile_field($value, $field_options);
+
+ $this->assertSame($expected, $result, $description);
+ }
+
+ public function profile_value_raw_data()
+ {
+ return array(
+ array(
+ 'http://example.com',
+ array('field_show_novalue' => true),
+ 'http://example.com',
+ 'Field should return the correct raw value',
+ ),
+ array(
+ 'http://example.com',
+ array('field_show_novalue' => false),
+ 'http://example.com',
+ 'Field should return correct raw value',
+ ),
+
+ // IDN tests
+ array(
+ 'http://täst.de',
+ array('field_show_novalue' => true),
+ 'http://täst.de',
+ 'Field should return the correct raw value',
+ ),
+ array(
+ 'http://домен.рф',
+ array('field_show_novalue' => false),
+ 'http://домен.рф',
+ 'Field should return correct raw value',
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider profile_value_raw_data
+ */
+ public function test_get_profile_value_raw($value, $field_options, $expected, $description)
+ {
+ $field_options = array_merge($this->field_options, $field_options);
+
+ $result = $this->cp->get_profile_value_raw($value, $field_options);
+
+ $this->assertSame($expected, $result, $description);
+ }
+
+ public function return_callback_implode()
+ {
+ return implode('-', func_get_args());
+ }
+}
diff --git a/tests/random/gen_rand_string_test.php b/tests/random/gen_rand_string_test.php
index 3317c78ed9..1d12d0622c 100644
--- a/tests/random/gen_rand_string_test.php
+++ b/tests/random/gen_rand_string_test.php
@@ -1,9 +1,13 @@
<?php
/**
*
-* @package testing
-* @copyright (c) 2010 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
diff --git a/tests/regex/censor_test.php b/tests/regex/censor_test.php
index 5929092e07..50c6778c8c 100644
--- a/tests/regex/censor_test.php
+++ b/tests/regex/censor_test.php
@@ -1,9 +1,13 @@
<?php
/**
*
-* @package testing
-* @copyright (c) 2010 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
diff --git a/tests/regex/email_test.php b/tests/regex/email_test.php
index b4ea5b23aa..ede35c49bc 100644
--- a/tests/regex/email_test.php
+++ b/tests/regex/email_test.php
@@ -1,9 +1,13 @@
<?php
/**
*
-* @package testing
-* @copyright (c) 2010 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
diff --git a/tests/regex/ipv4_test.php b/tests/regex/ipv4_test.php
index 38a3aa4a8e..62c2567517 100644
--- a/tests/regex/ipv4_test.php
+++ b/tests/regex/ipv4_test.php
@@ -1,9 +1,13 @@
<?php
/**
*
-* @package testing
-* @copyright (c) 2010 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
diff --git a/tests/regex/ipv6_test.php b/tests/regex/ipv6_test.php
index d24217b346..41039c819d 100644
--- a/tests/regex/ipv6_test.php
+++ b/tests/regex/ipv6_test.php
@@ -1,9 +1,13 @@
<?php
/**
*
-* @package testing
-* @copyright (c) 2010 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
diff --git a/tests/regex/password_complexity_test.php b/tests/regex/password_complexity_test.php
index 07453555ee..8a1a9edd41 100644
--- a/tests/regex/password_complexity_test.php
+++ b/tests/regex/password_complexity_test.php
@@ -1,12 +1,17 @@
<?php
/**
*
-* @package testing
-* @copyright (c) 2010 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
require_once dirname(__FILE__) . '/../../phpBB/includes/functions_user.php';
class phpbb_password_complexity_test extends phpbb_test_case
diff --git a/tests/regex/table_prefix_test.php b/tests/regex/table_prefix_test.php
index 33bdd4ae2d..c593085b25 100644
--- a/tests/regex/table_prefix_test.php
+++ b/tests/regex/table_prefix_test.php
@@ -1,9 +1,13 @@
<?php
/**
*
-* @package testing
-* @copyright (c) 2011 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
diff --git a/tests/regex/url_test.php b/tests/regex/url_test.php
index b395f5cae2..e5d7c3256a 100644
--- a/tests/regex/url_test.php
+++ b/tests/regex/url_test.php
@@ -1,9 +1,13 @@
<?php
/**
*
-* @package testing
-* @copyright (c) 2010 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -28,6 +32,6 @@ class phpbb_regex_url_test extends phpbb_test_case
*/
public function test_url($url, $expected)
{
- $this->assertEquals($expected, preg_match('#^' . get_preg_expression('url') . '$#i', $url));
+ $this->assertEquals($expected, preg_match('#^' . get_preg_expression('url') . '$#iu', $url));
}
}
diff --git a/tests/request/deactivated_super_global_test.php b/tests/request/deactivated_super_global_test.php
new file mode 100644
index 0000000000..d45f9ca666
--- /dev/null
+++ b/tests/request/deactivated_super_global_test.php
@@ -0,0 +1,25 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+class phpbb_deactivated_super_global_test extends phpbb_test_case
+{
+ /**
+ * Checks that on write access the correct error is thrown
+ */
+ public function test_write_triggers_error()
+ {
+ $this->setExpectedTriggerError(E_USER_ERROR);
+ $obj = new \phpbb\request\deactivated_super_global($this->getMock('\phpbb\request\request_interface'), 'obj', \phpbb\request\request_interface::POST);
+ $obj->offsetSet(0, 0);
+ }
+}
diff --git a/tests/request/request_test.php b/tests/request/request_test.php
new file mode 100644
index 0000000000..ebaea1f9ef
--- /dev/null
+++ b/tests/request/request_test.php
@@ -0,0 +1,271 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+class phpbb_request_test extends phpbb_test_case
+{
+ /** @var \phpbb\request\type_cast_helper_interface */
+ private $type_cast_helper;
+
+ /** @var \phpbb\request\request */
+ private $request;
+
+ protected function setUp()
+ {
+ // populate super globals
+ $_POST['test'] = 1;
+ $_GET['test'] = 2;
+ $_COOKIE['test'] = 3;
+ $_REQUEST['test'] = 3;
+ $_GET['unset'] = '';
+ $_FILES['test'] = array(
+ 'name' => 'file',
+ 'tmp_name' => 'tmp',
+ 'size' => 256,
+ 'type' => 'application/octet-stream',
+ 'error' => UPLOAD_ERR_OK,
+ );
+
+ $_SERVER['HTTP_HOST'] = 'example.com';
+ $_SERVER['HTTP_ACCEPT'] = 'application/json';
+ $_SERVER['HTTP_SOMEVAR'] = '<value>';
+
+ $this->type_cast_helper = $this->getMock('\phpbb\request\type_cast_helper_interface');
+ $this->request = new \phpbb\request\request($this->type_cast_helper);
+ }
+
+ public function test_toggle_super_globals()
+ {
+ $this->assertTrue($this->request->super_globals_disabled(), 'Superglobals were not disabled');
+
+ $this->request->enable_super_globals();
+
+ $this->assertFalse($this->request->super_globals_disabled(), 'Superglobals were not enabled');
+
+ $this->assertEquals(1, $_POST['test'], 'Checking $_POST after enable_super_globals');
+ $this->assertEquals(2, $_GET['test'], 'Checking $_GET after enable_super_globals');
+ $this->assertEquals(3, $_COOKIE['test'], 'Checking $_COOKIE after enable_super_globals');
+ $this->assertEquals(3, $_REQUEST['test'], 'Checking $_REQUEST after enable_super_globals');
+ $this->assertEquals(256, $_FILES['test']['size']);
+
+ $_POST['x'] = 2;
+ $this->assertEquals($_POST, $GLOBALS['_POST'], 'Checking whether $_POST can still be accessed via $GLOBALS[\'_POST\']');
+ }
+
+ public function test_server()
+ {
+ $this->assertEquals('example.com', $this->request->server('HTTP_HOST'));
+ }
+
+ public function test_server_escaping()
+ {
+ $this->type_cast_helper
+ ->expects($this->once())
+ ->method('recursive_set_var')
+ ->with(
+ $this->anything(),
+ '',
+ true
+ );
+
+ $this->request->server('HTTP_SOMEVAR');
+ }
+
+ public function test_header()
+ {
+ $this->assertEquals('application/json', $this->request->header('Accept'));
+ }
+
+ public function test_header_escaping()
+ {
+ $this->type_cast_helper
+ ->expects($this->once())
+ ->method('recursive_set_var')
+ ->with(
+ $this->anything(),
+ '',
+ true
+ );
+
+ $this->request->header('SOMEVAR');
+ }
+
+ public function test_file()
+ {
+ $file = $this->request->file('test');
+ $this->assertEquals('file', $file['name']);
+ $this->assertEquals('tmp', $file['tmp_name']);
+ $this->assertEquals(256, $file['size']);
+ $this->assertEquals('application/octet-stream', $file['type']);
+ $this->assertEquals(UPLOAD_ERR_OK, $file['error']);
+ }
+
+ public function test_file_not_exists()
+ {
+ $file = $this->request->file('404');
+ $this->assertTrue(is_array($file));
+ $this->assertTrue(empty($file));
+ }
+
+ /**
+ * Checks that directly accessing $_POST will trigger
+ * an error.
+ */
+ public function test_disable_post_super_global()
+ {
+ $this->setExpectedTriggerError(E_USER_ERROR);
+ $_POST['test'] = 3;
+ }
+
+ public function test_is_set_post()
+ {
+ $this->assertTrue($this->request->is_set_post('test'));
+ $this->assertFalse($this->request->is_set_post('unset'));
+ }
+
+ public function test_is_ajax_without_ajax()
+ {
+ $this->assertFalse($this->request->is_ajax());
+ }
+
+ public function test_is_ajax_with_ajax()
+ {
+ $this->request->enable_super_globals();
+ $_SERVER['HTTP_X_REQUESTED_WITH'] = 'XMLHttpRequest';
+ $this->request = new \phpbb\request\request($this->type_cast_helper);
+
+ $this->assertTrue($this->request->is_ajax());
+ }
+
+ public function data_is_secure()
+ {
+ return array(
+ array(
+ array(
+ 'HTTPS' => 'on',
+ ),
+ true,
+ ),
+ array(
+ array(
+ 'HTTPS' => '1',
+ ),
+ true,
+ ),
+ array(
+ array(
+ 'HTTPS' => 'yes',
+ ),
+ true,
+ ),
+ array(
+ array(
+ 'HTTPS' => 1,
+ ),
+ true,
+ ),
+ array(
+ array(
+ 'HTTPS' => 'off',
+ ),
+ false,
+ ),
+ array(
+ array(
+ 'HTTPS' => '0',
+ ),
+ false,
+ ),
+ array(
+ array(
+ 'HTTPS' => 0,
+ ),
+ false,
+ ),
+ array(
+ array(
+ 'HTTPS' => '',
+ ),
+ false,
+ ),
+ array(
+ array(
+ 'HTTPS' => 'off',
+ 'HTTP_X_FORWARDED_PROTO' => 'https',
+ ),
+ true,
+ ),
+ array(
+ array(
+ 'HTTPS' => 'on',
+ 'HTTP_X_FORWARDED_PROTO' => 'http',
+ ),
+ true,
+ ),
+ array(
+ array(
+ 'HTTPS' => 'off',
+ 'HTTP_X_FORWARDED_PROTO' => 'http',
+ ),
+ false,
+ ),
+ array(
+ array(
+ 'HTTP_X_FORWARDED_PROTO' => 'http',
+ ),
+ false,
+ ),
+ array(
+ array(
+ 'HTTP_X_FORWARDED_PROTO' => 'https',
+ ),
+ true,
+ ),
+ array(
+ array(
+ 'HTTPS' => 'on',
+ 'HTTP_X_FORWARDED_PROTO' => 'http',
+ ),
+ true,
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider data_is_secure
+ */
+ public function test_is_secure($server_data, $expected)
+ {
+ $this->assertFalse($this->request->is_secure());
+
+ $this->request->enable_super_globals();
+ $_SERVER = $server_data;
+ $this->request = new \phpbb\request\request($this->type_cast_helper);
+
+ $this->assertSame($expected, $this->request->is_secure());
+ }
+
+ public function test_variable_names()
+ {
+ $expected = array('test', 'unset');
+ $result = $this->request->variable_names();
+ $this->assertEquals($expected, $result);
+ }
+
+ /**
+ * Makes sure super globals work properly after these tests
+ */
+ protected function tearDown()
+ {
+ $this->request->enable_super_globals();
+ }
+}
diff --git a/tests/request/request_var_test.php b/tests/request/request_var_test.php
index 0c07fe11a3..67712eb6c8 100644
--- a/tests/request/request_var_test.php
+++ b/tests/request/request_var_test.php
@@ -1,18 +1,31 @@
<?php
/**
*
-* @package testing
-* @copyright (c) 2008 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
require_once dirname(__FILE__) . '/../../phpBB/includes/utf/utf_tools.php';
-class phpbb_request_request_var_test extends phpbb_test_case
+class phpbb_request_var_test extends phpbb_test_case
{
/**
+ * Makes sure request_var has its standard behaviour.
+ */
+ protected function setUp()
+ {
+ parent::setUp();
+ request_var(false, false, false, false, false);
+ }
+
+ /**
* @dataProvider request_variables
*/
public function test_post($variable_value, $default, $multibyte, $expected)
@@ -73,7 +86,48 @@ class phpbb_request_request_var_test extends phpbb_test_case
unset($_GET[$var], $_POST[$var], $_REQUEST[$var], $_COOKIE[$var]);
}
- static public function request_variables()
+ /**
+ * @dataProvider deep_access
+ * Only possible with 3.1.x (later)
+ */
+ public function test_deep_multi_dim_array_access($path, $default, $expected)
+ {
+ $this->unset_variables('var');
+
+ // cannot set $_REQUEST directly because in \phpbb\request\request implementation
+ // $_REQUEST = $_POST + $_GET
+ $_POST['var'] = array(
+ 0 => array(
+ 'b' => array(
+ true => array(
+ 5 => 'c',
+ 6 => 'd',
+ ),
+ ),
+ ),
+ 2 => array(
+ 3 => array(
+ false => 5,
+ ),
+ ),
+ );
+
+ $result = request_var($path, $default);
+ $this->assertEquals($expected, $result, 'Testing deep access to multidimensional input arrays: ' . $path);
+ }
+
+ public function deep_access()
+ {
+ return array(
+ // array(path, default, expected result)
+ array(array('var', 0, 'b', true, 5), '', 'c'),
+ array(array('var', 0, 'b', true, 6), '', 'd'),
+ array(array('var', 2, 3, false), 0, 5),
+ array(array('var', 0, 'b', true), array(0 => ''), array(5 => 'c', 6 => 'd')),
+ );
+ }
+
+ public function request_variables()
{
return array(
// strings
@@ -173,6 +227,50 @@ class phpbb_request_request_var_test extends phpbb_test_case
'abc' => array()
)
),
+ array(
+ // input:
+ array(
+ 0 => array(0 => array(3, '4', 'ab'), 1 => array()),
+ 1 => array(array(3, 4)),
+ ),
+ // default:
+ array(0 => array(0 => array(0))),
+ false,
+ // expected:
+ array(
+ 0 => array(0 => array(3, 4, 0), 1 => array()),
+ 1 => array(array(3, 4))
+ )
+ ),
+ array(
+ // input:
+ array(
+ 'ü' => array(array('c' => 'd')),
+ 'ä' => array(4 => array('a' => 2, 'ö' => 3)),
+ ),
+ // default:
+ array('' => array(0 => array('' => 0))),
+ false,
+ // expected:
+ array(
+ '??' => array(4 => array('a' => 2, '??' => 3)),
+ )
+ ),
+ array(
+ // input:
+ array(
+ 'ü' => array(array('c' => 'd')),
+ 'ä' => array(4 => array('a' => 2, 'ö' => 3)),
+ ),
+ // default:
+ array('' => array(0 => array('' => 0))),
+ true,
+ // expected:
+ array(
+ 'ü' => array(array('c' => 0)),
+ 'ä' => array(4 => array('a' => 2, 'ö' => 3)),
+ )
+ ),
);
}
diff --git a/tests/request/type_cast_helper_test.php b/tests/request/type_cast_helper_test.php
new file mode 100644
index 0000000000..d6ee1dc728
--- /dev/null
+++ b/tests/request/type_cast_helper_test.php
@@ -0,0 +1,74 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+require_once dirname(__FILE__) . '/../../phpBB/includes/utf/utf_tools.php';
+
+class phpbb_type_cast_helper_test extends phpbb_test_case
+{
+ private $type_cast_helper;
+
+ protected function setUp()
+ {
+ $this->type_cast_helper = new \phpbb\request\type_cast_helper();
+ }
+
+ public function test_addslashes_recursively()
+ {
+ $data = array('some"string' => array('that"' => 'really"', 'needs"' => '"escaping'));
+ $expected = array('some\\"string' => array('that\\"' => 'really\\"', 'needs\\"' => '\\"escaping'));
+
+ $this->type_cast_helper->addslashes_recursively($data);
+
+ $this->assertEquals($expected, $data);
+ }
+
+ public function test_simple_recursive_set_var()
+ {
+ $data = 'eviL<3';
+ $expected = 'eviL&lt;3';
+
+ $this->type_cast_helper->recursive_set_var($data, '', true);
+
+ $this->assertEquals($expected, $data);
+ }
+
+ public function test_nested_recursive_set_var()
+ {
+ $data = array('eviL<3');
+ $expected = array('eviL&lt;3');
+
+ $this->type_cast_helper->recursive_set_var($data, array(0 => ''), true);
+
+ $this->assertEquals($expected, $data);
+ }
+
+ public function test_simple_untrimmed_recursive_set_var()
+ {
+ $data = " eviL<3\t\t";
+ $expected = " eviL&lt;3\t\t";
+
+ $this->type_cast_helper->recursive_set_var($data, '', true, false);
+
+ $this->assertEquals($expected, $data);
+ }
+
+ public function test_nested_untrimmed_recursive_set_var()
+ {
+ $data = array(" eviL<3\t\t");
+ $expected = array(" eviL&lt;3\t\t");
+
+ $this->type_cast_helper->recursive_set_var($data, array(0 => ''), true, false);
+
+ $this->assertEquals($expected, $data);
+ }
+}
diff --git a/tests/search/common_test_case.php b/tests/search/common_test_case.php
new file mode 100644
index 0000000000..0bb4549832
--- /dev/null
+++ b/tests/search/common_test_case.php
@@ -0,0 +1,208 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+require_once dirname(__FILE__) . '/../test_framework/phpbb_search_test_case.php';
+
+abstract class phpbb_search_common_test_case extends phpbb_search_test_case
+{
+ public function keywords()
+ {
+ return array(
+ // keywords
+ // terms
+ // ok
+ // split words
+ // common words
+ array(
+ 'fooo',
+ 'all',
+ true,
+ array('fooo'),
+ array(),
+ ),
+ array(
+ 'fooo baar',
+ 'all',
+ true,
+ array('fooo', 'baar'),
+ array(),
+ ),
+ // leading, trailing and multiple spaces
+ array(
+ ' fooo baar ',
+ 'all',
+ true,
+ array('fooo', 'baar'),
+ array(),
+ ),
+ // words too short
+ array(
+ 'f',
+ 'all',
+ false,
+ null,
+ // short words count as "common" words
+ array('f'),
+ ),
+ array(
+ 'f o o',
+ 'all',
+ false,
+ null,
+ array('f', 'o', 'o'),
+ ),
+ array(
+ 'f -o -o',
+ 'all',
+ false,
+ null,
+ array('f', '-o', '-o'),
+ ),
+ array(
+ 'fooo -baar',
+ 'all',
+ true,
+ array('-baar', 'fooo'),
+ array(),
+ ),
+ // all negative
+ array(
+ '-fooo',
+ 'all',
+ true,
+ array('-fooo'),
+ array(),
+ ),
+ array(
+ '-fooo -baar',
+ 'all',
+ true,
+ array('-fooo', '-baar'),
+ array(),
+ ),
+ array(
+ 'fooo -fooo',
+ 'all',
+ true,
+ array('fooo', '-fooo'),
+ array(),
+ ),
+ array(
+ 'fooo fooo-',
+ 'all',
+ true,
+ array('fooo', 'fooo'),
+ array(),
+ ),
+ array(
+ '-fooo fooo',
+ 'all',
+ true,
+ array('-fooo', 'fooo'),
+ array(),
+ ),
+ array(
+ 'fooo- fooo',
+ 'all',
+ true,
+ array('fooo', 'fooo'),
+ array(),
+ ),
+ array(
+ 'fooo-baar fooo',
+ 'all',
+ true,
+ array('fooo', 'baar', 'fooo'),
+ array(),
+ ),
+ array(
+ 'fooo-baar -fooo',
+ 'all',
+ true,
+ array('fooo', 'baar', '-fooo'),
+ array(),
+ ),
+ array(
+ 'fooo-baar fooo-',
+ 'all',
+ true,
+ array('fooo', 'baar', 'fooo'),
+ array(),
+ ),
+ array(
+ 'fooo-baar baar',
+ 'all',
+ true,
+ array('fooo', 'baar', 'baar'),
+ array(),
+ ),
+ array(
+ 'fooo-baar -baar',
+ 'all',
+ true,
+ array('fooo', 'baar', '-baar'),
+ array(),
+ ),
+ array(
+ 'fooo-baar baar-',
+ 'all',
+ true,
+ array('fooo', 'baar', 'baar'),
+ array(),
+ ),
+ array(
+ 'fooo-baar fooo-baar',
+ 'all',
+ true,
+ array('fooo', 'baar', 'fooo', 'baar'),
+ array(),
+ ),
+ array(
+ 'fooo-baar -fooo-baar',
+ 'all',
+ true,
+ array('fooo', 'baar', '-fooo', 'baar'),
+ array(),
+ ),
+ array(
+ 'fooo-baar fooo-baar-',
+ 'all',
+ true,
+ array('fooo', 'baar', 'fooo', 'baar'),
+ array(),
+ ),
+ array(
+ 'fooo-baar-baaz',
+ 'all',
+ true,
+ array('fooo', 'baar', 'baaz'),
+ array(),
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider keywords
+ */
+ public function test_split_keywords($keywords, $terms, $ok, $split_words, $common)
+ {
+ $rv = $this->search->split_keywords($keywords, $terms);
+ $this->assertEquals($ok, $rv);
+ if ($ok)
+ {
+ // only check criteria if the search is going to be performed
+ $this->assert_array_content_equals($split_words, $this->search->get_split_words());
+ }
+ $this->assert_array_content_equals($common, $this->search->get_common_words());
+ }
+}
diff --git a/tests/search/fixtures/posts.xml b/tests/search/fixtures/posts.xml
new file mode 100644
index 0000000000..16232b8f39
--- /dev/null
+++ b/tests/search/fixtures/posts.xml
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<dataset>
+ <table name="phpbb_posts">
+ <column>post_username</column>
+ <column>post_subject</column>
+ <column>post_text</column>
+ <row>
+ <value>foo</value>
+ <value>foo</value>
+ <value>foo</value>
+ </row>
+ <row>
+ <value>bar</value>
+ <value>bar</value>
+ <value>bar</value>
+ </row>
+ <row>
+ <value>commonword</value>
+ <value>commonword</value>
+ <value>commonword</value>
+ </row>
+ <row>
+ <value>baaz</value>
+ <value>baaz</value>
+ <value>baaz</value>
+ </row>
+ </table>
+ <table name="phpbb_search_wordlist">
+ <column>word_id</column>
+ <column>word_text</column>
+ <column>word_common</column>
+ <row>
+ <value>1</value>
+ <value>foo</value>
+ <value>0</value>
+ </row>
+ <row>
+ <value>2</value>
+ <value>bar</value>
+ <value>0</value>
+ </row>
+ <row>
+ <value>3</value>
+ <value>commonword</value>
+ <value>1</value>
+ </row>
+ <row>
+ <value>4</value>
+ <value>baaz</value>
+ <value>0</value>
+ </row>
+ </table>
+</dataset>
diff --git a/tests/search/mysql_test.php b/tests/search/mysql_test.php
new file mode 100644
index 0000000000..3a791f5e81
--- /dev/null
+++ b/tests/search/mysql_test.php
@@ -0,0 +1,45 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+require_once dirname(__FILE__) . '/common_test_case.php';
+
+class phpbb_search_mysql_test extends phpbb_search_common_test_case
+{
+ protected $db;
+ protected $search;
+
+ public function getDataSet()
+ {
+ return $this->createXMLDataSet(dirname(__FILE__) . '/../fixtures/empty.xml');
+ }
+
+ protected function setUp()
+ {
+ global $phpbb_root_path, $phpEx, $config, $user, $cache;
+
+ parent::setUp();
+
+ // dbal uses cache
+ $cache = new phpbb_mock_cache();
+
+ // set config values
+ $config['fulltext_mysql_min_word_len'] = 4;
+ $config['fulltext_mysql_max_word_len'] = 254;
+
+ $this->db = $this->new_dbal();
+ $phpbb_dispatcher = new phpbb_mock_event_dispatcher();
+ $error = null;
+ $class = self::get_search_wrapper('\phpbb\search\fulltext_mysql');
+ $this->search = new $class($error, $phpbb_root_path, $phpEx, null, $config, $this->db, $user, $phpbb_dispatcher);
+ }
+}
diff --git a/tests/search/native_test.php b/tests/search/native_test.php
new file mode 100644
index 0000000000..29d0d0a8d3
--- /dev/null
+++ b/tests/search/native_test.php
@@ -0,0 +1,262 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+require_once dirname(__FILE__) . '/../test_framework/phpbb_search_test_case.php';
+
+class phpbb_search_native_test extends phpbb_search_test_case
+{
+ protected $db;
+ protected $search;
+
+ public function getDataSet()
+ {
+ return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/posts.xml');
+ }
+
+ protected function setUp()
+ {
+ global $phpbb_root_path, $phpEx, $config, $user, $cache;
+
+ parent::setUp();
+
+ // dbal uses cache
+ $cache = new phpbb_mock_cache();
+
+ $this->db = $this->new_dbal();
+ $phpbb_dispatcher = new phpbb_mock_event_dispatcher();
+ $error = null;
+ $class = self::get_search_wrapper('\phpbb\search\fulltext_native');
+ $config['fulltext_native_min_chars'] = 2;
+ $config['fulltext_native_max_chars'] = 14;
+ $this->search = new $class($error, $phpbb_root_path, $phpEx, null, $config, $this->db, $user, $phpbb_dispatcher);
+ }
+
+ public function keywords()
+ {
+ return array(
+ // keywords
+ // terms
+ // ok
+ // must contain ids
+ // must not contain ids
+ // common words
+ array(
+ 'foo',
+ 'all',
+ true,
+ array(1),
+ array(),
+ array(),
+ ),
+ array(
+ 'baaz*',
+ 'all',
+ true,
+ array('\'baaz%\''),
+ array(),
+ array(),
+ ),
+ array(
+ 'ba*az',
+ 'all',
+ true,
+ array('\'ba%az\''),
+ array(),
+ array(),
+ ),
+ array(
+ 'ba*z',
+ 'all',
+ true,
+ array('\'ba%z\''),
+ array(),
+ array(),
+ ),
+ array(
+ 'baa* baaz*',
+ 'all',
+ true,
+ array('\'baa%\'', '\'baaz%\''),
+ array(),
+ array(),
+ ),
+ array(
+ 'ba*z baa*',
+ 'all',
+ true,
+ array('\'ba%z\'', '\'baa%\''),
+ array(),
+ array(),
+ ),
+ array(
+ 'baaz* commonword',
+ 'all',
+ true,
+ array('\'baaz%\''),
+ array(),
+ array('commonword'),
+ ),
+ array(
+ 'foo bar',
+ 'all',
+ true,
+ array(1, 2),
+ array(),
+ array(),
+ ),
+ // leading, trailing and multiple spaces
+ array(
+ ' foo bar ',
+ 'all',
+ true,
+ array(1, 2),
+ array(),
+ array(),
+ ),
+ // words too short
+ array(
+ 'f',
+ 'all',
+ false,
+ null,
+ null,
+ // short words count as "common" words
+ array('f'),
+ ),
+ array(
+ 'f o o',
+ 'all',
+ false,
+ null,
+ null,
+ array('f', 'o', 'o'),
+ ),
+ array(
+ 'f -o -o',
+ 'all',
+ false,
+ null,
+ null,
+ array('f', 'o', 'o'),
+ ),
+ array(
+ 'foo -bar',
+ 'all',
+ true,
+ array(1),
+ array(2),
+ array(),
+ ),
+ // all negative
+ array(
+ '-foo',
+ 'all',
+ true,
+ array(),
+ array(1),
+ array(),
+ ),
+ array(
+ '-foo -bar',
+ 'all',
+ true,
+ array(),
+ array(1, 2),
+ array(),
+ ),
+ array(
+ 'foo -foo',
+ 'all',
+ true,
+ array(1),
+ array(1),
+ array(),
+ ),
+ array(
+ '-foo foo',
+ 'all',
+ true,
+ array(1),
+ array(1),
+ array(),
+ ),
+ // some creative edge cases
+ array(
+ 'foo foo-',
+ 'all',
+ true,
+ array(1),
+ array(),
+ array(),
+ ),
+ array(
+ 'foo- foo',
+ 'all',
+ true,
+ array(1),
+ array(),
+ array(),
+ ),
+ array(
+ 'foo-bar',
+ 'all',
+ true,
+ array(1, 2),
+ array(),
+ array(),
+ ),
+ array(
+ 'foo-bar-foo',
+ 'all',
+ true,
+ array(1, 2),
+ array(),
+ array(),
+ ),
+ // all common
+ array(
+ 'commonword',
+ 'all',
+ false,
+ null,
+ null,
+ array('commonword'),
+ ),
+ // some common
+ array(
+ 'commonword foo',
+ 'all',
+ true,
+ array(1),
+ array(),
+ array('commonword'),
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider keywords
+ */
+ public function test_split_keywords($keywords, $terms, $ok, $must_contain, $must_not_contain, $common)
+ {
+ $rv = $this->search->split_keywords($keywords, $terms);
+ $this->assertEquals($ok, $rv);
+ if ($ok)
+ {
+ // only check criteria if the search is going to be performed
+ $this->assert_array_content_equals($must_contain, $this->search->get_must_contain_ids());
+ $this->assert_array_content_equals($must_not_contain, $this->search->get_must_not_contain_ids());
+ }
+ $this->assert_array_content_equals($common, $this->search->get_common_words());
+ }
+}
diff --git a/tests/search/postgres_test.php b/tests/search/postgres_test.php
new file mode 100644
index 0000000000..97cca0e70c
--- /dev/null
+++ b/tests/search/postgres_test.php
@@ -0,0 +1,45 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+require_once dirname(__FILE__) . '/common_test_case.php';
+
+class phpbb_search_postgres_test extends phpbb_search_common_test_case
+{
+ protected $db;
+ protected $search;
+
+ public function getDataSet()
+ {
+ return $this->createXMLDataSet(dirname(__FILE__) . '/../fixtures/empty.xml');
+ }
+
+ protected function setUp()
+ {
+ global $phpbb_root_path, $phpEx, $config, $user, $cache;
+
+ parent::setUp();
+
+ // dbal uses cache
+ $cache = new phpbb_mock_cache();
+
+ // set config values
+ $config['fulltext_postgres_min_word_len'] = 4;
+ $config['fulltext_postgres_max_word_len'] = 254;
+
+ $this->db = $this->new_dbal();
+ $phpbb_dispatcher = new phpbb_mock_event_dispatcher();
+ $error = null;
+ $class = self::get_search_wrapper('\phpbb\search\fulltext_postgres');
+ $this->search = new $class($error, $phpbb_root_path, $phpEx, null, $config, $this->db, $user, $phpbb_dispatcher);
+ }
+}
diff --git a/tests/security/base.php b/tests/security/base.php
index 2658798237..330408b448 100644
--- a/tests/security/base.php
+++ b/tests/security/base.php
@@ -1,33 +1,40 @@
<?php
/**
*
-* @package testing
-* @copyright (c) 2008 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
abstract class phpbb_security_test_base extends phpbb_test_case
{
+ protected $server = array();
+
/**
* Set up the required user object and server variables for the suites
*/
protected function setUp()
{
- global $user, $phpbb_root_path;
+ global $user, $phpbb_root_path, $phpEx, $request, $symfony_request, $phpbb_filesystem;
// Put this into a global function being run by every test to init a proper user session
- $_SERVER['HTTP_HOST'] = 'localhost';
- $_SERVER['SERVER_NAME'] = 'localhost';
- $_SERVER['SERVER_ADDR'] = '127.0.0.1';
- $_SERVER['SERVER_PORT'] = 80;
- $_SERVER['REMOTE_ADDR'] = '127.0.0.1';
- $_SERVER['QUERY_STRING'] = '';
- $_SERVER['REQUEST_URI'] = '/tests/';
- $_SERVER['SCRIPT_NAME'] = '/tests/index.php';
- $_SERVER['PHP_SELF'] = '/tests/index.php';
- $_SERVER['HTTP_USER_AGENT'] = 'Mozilla/5.0 (Windows; U; Windows NT 6.0; de; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14';
- $_SERVER['HTTP_ACCEPT_LANGUAGE'] = 'de-de,de;q=0.8,en-us;q=0.5,en;q=0.3';
+ $this->server['HTTP_HOST'] = 'localhost';
+ $this->server['SERVER_NAME'] = 'localhost';
+ $this->server['SERVER_ADDR'] = '127.0.0.1';
+ $this->server['SERVER_PORT'] = 80;
+ $this->server['REMOTE_ADDR'] = '127.0.0.1';
+ $this->server['QUERY_STRING'] = '';
+ $this->server['REQUEST_URI'] = '/tests/';
+ $this->server['SCRIPT_NAME'] = '/tests/index.php';
+ $this->server['SCRIPT_FILENAME'] = '/var/www/tests/index.php';
+ $this->server['PHP_SELF'] = '/tests/index.php';
+ $this->server['HTTP_USER_AGENT'] = 'Mozilla/5.0 (Windows; U; Windows NT 6.0; de; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14';
+ $this->server['HTTP_ACCEPT_LANGUAGE'] = 'de-de,de;q=0.8,en-us;q=0.5,en;q=0.3';
/*
[HTTP_ACCEPT_ENCODING] => gzip,deflate
@@ -36,14 +43,19 @@ abstract class phpbb_security_test_base extends phpbb_test_case
[SCRIPT_FILENAME] => /var/www/tests/index.php
*/
+ $request = new phpbb_mock_request(array(), array(), array(), $this->server);
+ $symfony_request = new \phpbb\symfony_request($request);
+
+ $phpbb_filesystem = new \phpbb\filesystem();
+
// Set no user and trick a bit to circumvent errors
- $user = new user();
+ $user = new \phpbb\user('\phpbb\datetime');
$user->lang = true;
- $user->browser = (!empty($_SERVER['HTTP_USER_AGENT'])) ? htmlspecialchars((string) $_SERVER['HTTP_USER_AGENT']) : '';
- $user->referer = (!empty($_SERVER['HTTP_REFERER'])) ? htmlspecialchars((string) $_SERVER['HTTP_REFERER']) : '';
- $user->forwarded_for = (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) ? (string) $_SERVER['HTTP_X_FORWARDED_FOR'] : '';
- $user->host = (!empty($_SERVER['HTTP_HOST'])) ? (string) strtolower($_SERVER['HTTP_HOST']) : ((!empty($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : getenv('SERVER_NAME'));
- $user->page = session::extract_current_page($phpbb_root_path);
+ $user->browser = $this->server['HTTP_USER_AGENT'];
+ $user->referer = '';
+ $user->forwarded_for = '';
+ $user->host = $this->server['HTTP_HOST'];
+ $user->page = \phpbb\session::extract_current_page($phpbb_root_path);
}
protected function tearDown()
diff --git a/tests/security/extract_current_page_test.php b/tests/security/extract_current_page_test.php
index 0f5128884b..767b901a43 100644
--- a/tests/security/extract_current_page_test.php
+++ b/tests/security/extract_current_page_test.php
@@ -1,36 +1,45 @@
<?php
/**
*
-* @package testing
-* @copyright (c) 2008 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
require_once dirname(__FILE__) . '/base.php';
require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
-require_once dirname(__FILE__) . '/../../phpBB/includes/session.php';
class phpbb_security_extract_current_page_test extends phpbb_security_test_base
{
- static public function security_variables()
+ public function security_variables()
{
return array(
- array('http://localhost/phpBB/index.php', 'mark=forums&x="><script>alert(/XSS/);</script>', 'mark=forums&x=%22%3E%3Cscript%3Ealert(/XSS/);%3C/script%3E'),
- array('http://localhost/phpBB/index.php', 'mark=forums&x=%22%3E%3Cscript%3Ealert(/XSS/);%3C/script%3E', 'mark=forums&x=%22%3E%3Cscript%3Ealert(/XSS/);%3C/script%3E'),
+ array('mark=forums&x="><script>alert(/XSS/);</script>', 'mark=forums&x=%22%3E%3Cscript%3Ealert%28%2FXSS%2F%29%3B%3C%2Fscript%3E'),
+ array('mark=forums&x=%22%3E%3Cscript%3Ealert(/XSS/);%3C/script%3E', 'mark=forums&x=%22%3E%3Cscript%3Ealert%28%2FXSS%2F%29%3B%3C%2Fscript%3E'),
+ array('mark=forums&x=%22%3E%3Cscript%3Ealert%28%2FXSS%2F%29%3B%3C%2Fscript%3E', 'mark=forums&x=%22%3E%3Cscript%3Ealert%28%2FXSS%2F%29%3B%3C%2Fscript%3E'),
);
}
/**
* @dataProvider security_variables
*/
- public function test_query_string_php_self($url, $query_string, $expected)
+ public function test_query_string_php_self($query_string, $expected)
{
- $_SERVER['PHP_SELF'] = $url;
- $_SERVER['QUERY_STRING'] = $query_string;
+ global $symfony_request, $request;
+
+ $this->server['REQUEST_URI'] = '';
+ $this->server['QUERY_STRING'] = $query_string;
+
+ $request = new phpbb_mock_request(array(), array(), array(), $this->server);
+ $symfony_request = new \phpbb\symfony_request($request);
- $result = session::extract_current_page('./');
+ $result = \phpbb\session::extract_current_page('./');
$label = 'Running extract_current_page on ' . $query_string . ' with PHP_SELF filled.';
$this->assertEquals($expected, $result['query_string'], $label);
@@ -39,15 +48,18 @@ class phpbb_security_extract_current_page_test extends phpbb_security_test_base
/**
* @dataProvider security_variables
*/
- public function test_query_string_request_uri($url, $query_string, $expected)
+ public function test_query_string_request_uri($query_string, $expected)
{
- $_SERVER['REQUEST_URI'] = $url . '?' . $query_string;
- $_SERVER['QUERY_STRING'] = $query_string;
+ global $symfony_request, $request;
- $result = session::extract_current_page('./');
+ $this->server['QUERY_STRING'] = $query_string;
+
+ $request = new phpbb_mock_request(array(), array(), array(), $this->server);
+ $symfony_request = new \phpbb\symfony_request($request);
+
+ $result = \phpbb\session::extract_current_page('./');
$label = 'Running extract_current_page on ' . $query_string . ' with REQUEST_URI filled.';
$this->assertEquals($expected, $result['query_string'], $label);
}
}
-
diff --git a/tests/security/hash_test.php b/tests/security/hash_test.php
index e226365ef3..0494c55c6d 100644
--- a/tests/security/hash_test.php
+++ b/tests/security/hash_test.php
@@ -1,16 +1,45 @@
<?php
/**
*
-* @package testing
-* @copyright (c) 2011 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions_compatibility.php';
class phpbb_security_hash_test extends phpbb_test_case
{
+ public function setUp()
+ {
+ global $phpbb_container;
+
+ $config = new \phpbb\config\config(array());
+ $phpbb_container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface');
+ $driver_helper = new \phpbb\passwords\driver\helper($config);
+ $passwords_drivers = array(
+ 'passwords.driver.bcrypt_2y' => new \phpbb\passwords\driver\bcrypt_2y($config, $driver_helper),
+ 'passwords.driver.bcrypt' => new \phpbb\passwords\driver\bcrypt($config, $driver_helper),
+ 'passwords.driver.salted_md5' => new \phpbb\passwords\driver\salted_md5($config, $driver_helper),
+ 'passwords.driver.phpass' => new \phpbb\passwords\driver\phpass($config, $driver_helper),
+ );
+
+ $passwords_helper = new \phpbb\passwords\helper;
+ // Set up passwords manager
+ $passwords_manager = new \phpbb\passwords\manager($config, $passwords_drivers, $passwords_helper, array_keys($passwords_drivers));
+
+ $phpbb_container
+ ->expects($this->any())
+ ->method('get')
+ ->with('passwords.manager')
+ ->will($this->returnValue($passwords_manager));
+ }
+
public function test_check_hash_with_phpass()
{
$this->assertTrue(phpbb_check_hash('test', '$H$9isfrtKXWqrz8PvztXlL3.daw4U0zI1'));
diff --git a/tests/security/redirect_test.php b/tests/security/redirect_test.php
index 9a24ba5d65..a88fc63858 100644
--- a/tests/security/redirect_test.php
+++ b/tests/security/redirect_test.php
@@ -1,65 +1,126 @@
<?php
/**
*
-* @package testing
-* @copyright (c) 2008 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
require_once dirname(__FILE__) . '/base.php';
require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
-require_once dirname(__FILE__) . '/../../phpBB/includes/session.php';
class phpbb_security_redirect_test extends phpbb_security_test_base
{
- static public function provider()
+ protected $path_helper;
+
+ public function provider()
{
// array(Input -> redirect(), expected triggered error (else false), expected returned result url (else false))
return array(
- array('data://x', 'Tried to redirect to potentially insecure url.', false),
- array('bad://localhost/phpBB/index.php', 'Tried to redirect to potentially insecure url.', false),
- array('http://www.otherdomain.com/somescript.php', 'Tried to redirect to potentially insecure url.', false),
- array("http://localhost/phpBB/memberlist.php\n\rConnection: close", 'Tried to redirect to potentially insecure url.', false),
- array('javascript:test', false, 'http://localhost/phpBB/../javascript:test'),
- array('http://localhost/phpBB/index.php;url=', 'Tried to redirect to potentially insecure url.', false),
- array('https://foobar.com\@http://localhost/phpBB', 'Tried to redirect to potentially insecure url.', false),
- array('https://foobar.com\@localhost/troll/http://localhost/', 'Tried to redirect to potentially insecure url.', false),
- array('http://localhost.foobar.com\@localhost/troll/http://localhost/', 'Tried to redirect to potentially insecure url.', false),
- array('http://localhost/phpBB', false, 'http://localhost/phpBB'),
- array('http://localhost/phpBB/', false, 'http://localhost/phpBB/'),
+ array('data://x', false, 'INSECURE_REDIRECT', false),
+ array('bad://localhost/phpBB/index.php', false, 'INSECURE_REDIRECT', false),
+ array('http://www.otherdomain.com/somescript.php', false, 'INSECURE_REDIRECT', false),
+ array("http://localhost/phpBB/memberlist.php\n\rConnection: close", false, 'INSECURE_REDIRECT', false),
+ array('javascript:test', false, false, 'http://localhost/phpBB/javascript:test'),
+ array('http://localhost/phpBB/index.php;url=', false, 'INSECURE_REDIRECT', false),
+ array('http://localhost/phpBB/app.php/foobar', false, false, 'http://localhost/phpBB/app.php/foobar'),
+ array('./app.php/foobar', false, false, 'http://localhost/phpBB/app.php/foobar'),
+ array('app.php/foobar', false, false, 'http://localhost/phpBB/app.php/foobar'),
+ array('./../app.php/foobar', false, false, 'http://localhost/app.php/foobar'),
+ array('./../app.php/foobar', true, false, 'http://localhost/app.php/foobar'),
+ array('./../app.php/foo/bar', false, false, 'http://localhost/app.php/foo/bar'),
+ array('./../app.php/foo/bar', true, false, 'http://localhost/app.php/foo/bar'),
+ array('./../foo/bar', false, false, 'http://localhost/foo/bar'),
+ array('./../foo/bar', true, false, 'http://localhost/foo/bar'),
+ array('app.php/', false, false, 'http://localhost/phpBB/app.php/'),
+ array('app.php/a', false, false, 'http://localhost/phpBB/app.php/a'),
+ array('app.php/a/b', false, false, 'http://localhost/phpBB/app.php/a/b'),
+ array('./app.php/', false, false, 'http://localhost/phpBB/app.php/'),
+ array('foobar', false, false, 'http://localhost/phpBB/foobar'),
+ array('./foobar', false, false, 'http://localhost/phpBB/foobar'),
+ array('foo/bar', false, false, 'http://localhost/phpBB/foo/bar'),
+ array('./foo/bar', false, false, 'http://localhost/phpBB/foo/bar'),
+ array('./../index.php', false, false, 'http://localhost/index.php'),
+ array('./../index.php', true, false, 'http://localhost/index.php'),
+ array('../index.php', false, false, 'http://localhost/index.php'),
+ array('../index.php', true, false, 'http://localhost/index.php'),
+ array('./index.php', false, false, 'http://localhost/phpBB/index.php'),
+ array('https://foobar.com\@http://localhost/phpBB', false, 'INSECURE_REDIRECT', false),
+ array('https://foobar.com\@localhost/troll/http://localhost/', false, 'INSECURE_REDIRECT', false),
+ array('http://localhost.foobar.com\@localhost/troll/http://localhost/', false, 'INSECURE_REDIRECT', false),
+ array('http://localhost/phpBB', false, false, 'http://localhost/phpBB'),
+ array('http://localhost/phpBB/', false, false, 'http://localhost/phpBB/'),
);
}
+ protected function get_path_helper()
+ {
+ if (!($this->path_helper instanceof \phpbb\path_helper))
+ {
+ $this->path_helper = new \phpbb\path_helper(
+ new \phpbb\symfony_request(
+ new phpbb_mock_request()
+ ),
+ new \phpbb\filesystem(),
+ $this->getMock('\phpbb\request\request'),
+ $this->phpbb_root_path,
+ 'php'
+ );
+ }
+ return $this->path_helper;
+ }
+
protected function setUp()
{
+ global $phpbb_dispatcher;
+
parent::setUp();
-
+
$GLOBALS['config'] = array(
'force_server_vars' => '0',
);
+
+ $this->path_helper = $this->get_path_helper();
+
+ $phpbb_dispatcher = new phpbb_mock_event_dispatcher();
}
/**
* @dataProvider provider
*/
- public function test_redirect($test, $expected_error, $expected_result)
+ public function test_redirect($test, $disable_cd_check, $expected_error, $expected_result)
{
- global $user;
+ global $user, $phpbb_root_path, $phpbb_path_helper;
+
+ $phpbb_path_helper = $this->path_helper;
+
+ $temp_phpbb_root_path = $phpbb_root_path;
+ $temp_page_dir = $user->page['page_dir'];
+ // We need to hack phpbb_root_path and the user's page_dir here
+ // so it matches the actual fileinfo of the testing script.
+ // Otherwise the paths are returned incorrectly.
+ $phpbb_root_path = '';
+ $user->page['page_dir'] = '';
if ($expected_error !== false)
{
- $this->setExpectedTriggerError(E_USER_ERROR, $expected_error);
+ $this->setExpectedTriggerError(E_USER_ERROR, $user->lang[$expected_error]);
}
- $result = redirect($test, true);
+ $result = redirect($test, true, $disable_cd_check);
// only verify result if we did not expect an error
if ($expected_error === false)
{
$this->assertEquals($expected_result, $result);
}
+ $phpbb_root_path = $temp_phpbb_root_path;
+ $user->page['page_dir'] = $temp_page_dir;
}
}
-
diff --git a/tests/security/trailing_path_test.php b/tests/security/trailing_path_test.php
deleted file mode 100644
index 9d586e74ef..0000000000
--- a/tests/security/trailing_path_test.php
+++ /dev/null
@@ -1,60 +0,0 @@
-<?php
-/**
- *
- * @package testing
- * @copyright (c) 2011 phpBB Group
- * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
- *
- */
-
-require_once dirname(__FILE__) . '/../../phpBB/includes/startup.php';
-
-class phpbb_security_trailing_path_test extends phpbb_test_case
-{
- public function data_has_trailing_path()
- {
- return array(
- array(false, '', '', ''),
- array(true, '/', '', ''),
- array(true, '/foo', '', ''),
- array(true, '', '/foo', ''),
- array(true, '/foo', '/foo', ''),
- array(false, '', '', '/'),
- array(false, '', '', '/?/x.php/'),
- array(false, '', '', '/index.php'),
- array(false, '', '', '/dir.phpisfunny/foo.php'),
- array(true, '', '', '/index.php/foo.php'),
- array(false, '', '', '/phpBB/viewtopic.php?f=3&amp;t=5'),
- array(false, '', '', '/phpBB/viewtopic.php?f=3&amp;t=5/'),
- array(false, '', '', '/phpBB/viewtopic.php?f=3&amp;t=5/foo'),
- array(true, '/foo', '/foo', '/phpBB/viewtopic.php?f=3&amp;t=5/foo'),
- array(false, '', '', '/projects/php.bb/phpBB/viewtopic.php?f=3&amp;t=5/'),
- array(false, '', '', '/projects/php.bb/phpBB/viewtopic.php?f=3&amp;t=5'),
- array(false, '', '', '/projects/php.bb/phpBB/viewtopic.php?f=3&amp;t=5/foo.php/'),
- array(false, '', '', '/projects/php.bb/phpBB/index.php'),
- array(true, '', '', '/projects/php.bb/phpBB/index.php/'),
- array(true, '', '', '/phpBB/index.php/?foo/a'),
- array(true, '', '', '/projects/php.bb/phpBB/index.php/?a=5'),
- array(false, '', '', '/projects/php.bb/phpBB/index.php?/a=5'),
- array(false, '', '/phpBB/index.php', '/phpBB/index.php', '/phpBB/index.php'),
- array(true, '', '/phpBB/index.php', '/phpBB/index.php'),
- array(true, '', '/phpBB/index.php/', '/phpBB/index.php/', '/phpBB/index.php'),
- array(true, '', '/phpBB/index.php/', '/phpBB/index.php/'),
- );
- }
-
- /**
- * @dataProvider data_has_trailing_path
- */
- public function test_has_trailing_path($expected, $path_info, $orig_path_info, $request_uri, $script_name = '')
- {
- global $phpEx;
-
- $_SERVER['PATH_INFO'] = $path_info;
- $_SERVER['ORIG_PATH_INFO'] = $orig_path_info;
- $_SERVER['REQUEST_URI'] = $request_uri;
- $_SERVER['SCRIPT_NAME'] = $script_name;
-
- $this->assertSame($expected, phpbb_has_trailing_path($phpEx));
- }
-}
diff --git a/tests/session/append_sid_test.php b/tests/session/append_sid_test.php
index ce7bf71215..2a1d94514f 100644
--- a/tests/session/append_sid_test.php
+++ b/tests/session/append_sid_test.php
@@ -1,9 +1,13 @@
<?php
/**
*
-* @package testing
-* @copyright (c) 2011 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -45,6 +49,10 @@ class phpbb_session_append_sid_test extends phpbb_test_case
*/
public function test_append_sid($url, $params, $is_amp, $session_id, $expected, $description)
{
+ global $phpbb_dispatcher;
+
+ $phpbb_dispatcher = new phpbb_mock_event_dispatcher;
$this->assertEquals($expected, append_sid($url, $params, $is_amp, $session_id));
}
}
+
diff --git a/tests/session/check_ban_test.php b/tests/session/check_ban_test.php
new file mode 100644
index 0000000000..561b7faf49
--- /dev/null
+++ b/tests/session/check_ban_test.php
@@ -0,0 +1,82 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+require_once dirname(__FILE__) . '/../test_framework/phpbb_session_test_case.php';
+
+class phpbb_session_check_ban_test extends phpbb_session_test_case
+{
+ protected $user_id = 4;
+ protected $key_id = 4;
+ protected $session;
+ protected $backup_cache;
+
+ public function getDataSet()
+ {
+ return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/sessions_banlist.xml');
+ }
+
+ static function check_banned_data()
+ {
+ return array(
+ array('All false values, should not be banned',
+ false, false, false, false, /* should be banned? -> */ false),
+ array('Matching values in the database, should be banned',
+ 4, '127.0.0.1', 'bar@example.org', true, /* should be banned? -> */ true),
+ array('IP Banned, should be banned',
+ false, '127.1.1.1', false, false, /* should be banned? -> */ true),
+ );
+ }
+
+ public function setUp()
+ {
+ parent::setUp();
+ // Get session here so that config is mocked correctly
+ $this->session = $this->session_factory->get_session($this->db);
+ global $cache, $config, $phpbb_root_path, $phpEx;
+ $this->backup_cache = $cache;
+ // Change the global cache object for this test because
+ // the mock cache object does not hit the database as is needed
+ // for this test.
+ $cache = new \phpbb\cache\service(
+ new \phpbb\cache\driver\file(),
+ $config,
+ $this->db,
+ $phpbb_root_path,
+ $phpEx
+ );
+ }
+
+ public function tearDown()
+ {
+ parent::tearDown();
+ // Set cache back to what it was before the test changed it
+ global $cache;
+ $cache = $this->backup_cache;
+ }
+
+ /** @dataProvider check_banned_data */
+ public function test_check_is_banned($test_msg, $user_id, $user_ips, $user_email, $return, $should_be_banned)
+ {
+ try
+ {
+ $is_banned = $this->session->check_ban($user_id, $user_ips, $user_email, $return);
+ }
+ catch (PHPUnit_Framework_Error_Notice $e)
+ {
+ // User error was triggered, user must have been banned
+ $is_banned = true;
+ }
+
+ $this->assertEquals($should_be_banned, $is_banned, $test_msg);
+ }
+}
diff --git a/tests/session/check_isvalid_test.php b/tests/session/check_isvalid_test.php
new file mode 100644
index 0000000000..90554bfe5f
--- /dev/null
+++ b/tests/session/check_isvalid_test.php
@@ -0,0 +1,65 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+require_once dirname(__FILE__) . '/../test_framework/phpbb_session_test_case.php';
+
+class phpbb_session_check_isvalid_test extends phpbb_session_test_case
+{
+ public function getDataSet()
+ {
+ return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/sessions_full.xml');
+ }
+
+ protected function access_with($session_id, $user_id, $user_agent, $ip)
+ {
+ $this->session_factory->merge_test_data($session_id, $user_id, $user_agent, $ip);
+
+ $session = $this->session_factory->get_session($this->db);
+ $session->page = array('page' => 'page', 'forum' => 0);
+
+ $session->session_begin();
+ $this->session_factory->check($this);
+ return $session;
+ }
+
+ public function test_session_valid_session_exists()
+ {
+ $session = $this->access_with('bar_session000000000000000000000', '4', 'user agent', '127.0.0.1');
+ $session->check_cookies($this, array());
+
+ $this->check_sessions_equals(array(
+ array('session_id' => 'anon_session00000000000000000000', 'session_user_id' => 1),
+ array('session_id' => 'bar_session000000000000000000000', 'session_user_id' => 4),
+ ),
+ 'If a request comes with a valid session id with matching user agent and IP, no new session should be created.'
+ );
+ }
+
+ public function test_session_invalid_make_new_annon_session()
+ {
+ $session = $this->access_with('anon_session00000000000000000000', '4', 'user agent', '127.0.0.1');
+ $session->check_cookies($this, array(
+ 'u' => array('1', null),
+ 'k' => array(null, null),
+ 'sid' => array($session->session_id, null),
+ ));
+
+ $this->check_sessions_equals(array(
+ array('session_id' => $session->session_id, 'session_user_id' => 1), // use generated SID
+ array('session_id' => 'bar_session000000000000000000000', 'session_user_id' => 4),
+ ),
+ 'If a request comes with a valid session id and IP but different user id and user agent,
+ a new anonymous session is created and the session matching the supplied session id is deleted.'
+ );
+ }
+}
diff --git a/tests/session/continue_test.php b/tests/session/continue_test.php
deleted file mode 100644
index c4f7f8d75b..0000000000
--- a/tests/session/continue_test.php
+++ /dev/null
@@ -1,121 +0,0 @@
-<?php
-/**
-*
-* @package testing
-* @copyright (c) 2011 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
-*
-*/
-
-require_once dirname(__FILE__) . '/../mock/cache.php';
-require_once dirname(__FILE__) . '/testable_factory.php';
-
-class phpbb_session_continue_test extends phpbb_database_test_case
-{
- public function getDataSet()
- {
- return $this->createXMLDataSet(dirname(__FILE__).'/fixtures/sessions_full.xml');
- }
-
- static public function session_begin_attempts()
- {
- // The session_id field is defined as CHAR(32) in the database schema.
- // Thus the data we put in session_id fields has to have a length of 32 characters on stricter DBMSes.
- // Thus we fill those strings up with zeroes until they have a string length of 32.
-
- return array(
- array(
- 'bar_session000000000000000000000', '4', 'user agent', '127.0.0.1',
- array(
- array('session_id' => 'anon_session00000000000000000000', 'session_user_id' => 1),
- array('session_id' => 'bar_session000000000000000000000', 'session_user_id' => 4),
- ),
- array(),
- 'If a request comes with a valid session id with matching user agent and IP, no new session should be created.',
- ),
- array(
- 'anon_session00000000000000000000', '4', 'user agent', '127.0.0.1',
- array(
- array('session_id' => '__new_session_id__', 'session_user_id' => 1), // use generated SID
- array('session_id' => 'bar_session000000000000000000000', 'session_user_id' => 4),
- ),
- array(
- 'u' => array('1', null),
- 'k' => array(null, null),
- 'sid' => array('__new_session_id__', null),
- ),
- 'If a request comes with a valid session id and IP but different user id and user agent, a new anonymous session is created and the session matching the supplied session id is deleted.',
- ),
- );
- }
-
- /**
- * @dataProvider session_begin_attempts
- */
- public function test_session_begin_valid_session($session_id, $user_id, $user_agent, $ip, $expected_sessions, $expected_cookies, $message)
- {
- $db = $this->new_dbal();
- $session_factory = new phpbb_session_testable_factory;
- $session_factory->set_cookies(array(
- '_sid' => $session_id,
- '_u' => $user_id,
- ));
- $session_factory->merge_config_data(array(
- 'session_length' => time(), // need to do this to allow sessions started at time 0
- ));
- $session_factory->merge_server_data(array(
- 'HTTP_USER_AGENT' => $user_agent,
- 'REMOTE_ADDR' => $ip,
- ));
-
- $session = $session_factory->get_session($db);
- $session->page = array('page' => 'page', 'forum' => 0);
-
- $session->session_begin();
-
- $sql = 'SELECT session_id, session_user_id
- FROM phpbb_sessions
- ORDER BY session_user_id';
-
- $expected_sessions = $this->replace_session($expected_sessions, $session->session_id);
- $expected_cookies = $this->replace_session($expected_cookies, $session->session_id);
-
- $this->assertSqlResultEquals(
- $expected_sessions,
- $sql,
- $message
- );
-
- $session->check_cookies($this, $expected_cookies);
-
- $session_factory->check($this);
- }
-
- /**
- * Replaces recursively the value __new_session_id__ with the given session
- * id.
- *
- * @param array $array An array of data
- * @param string $session_id The new session id to use instead of the
- * placeholder.
- * @return array The input array with all occurances of __new_session_id__
- * replaced.
- */
- public function replace_session($array, $session_id)
- {
- foreach ($array as $key => &$value)
- {
- if ($value === '__new_session_id__')
- {
- $value = $session_id;
- }
-
- if (is_array($value))
- {
- $value = $this->replace_session($value, $session_id);
- }
- }
-
- return $array;
- }
-}
diff --git a/tests/session/create_test.php b/tests/session/create_test.php
new file mode 100644
index 0000000000..105c76eb7f
--- /dev/null
+++ b/tests/session/create_test.php
@@ -0,0 +1,47 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+require_once dirname(__FILE__) . '/../test_framework/phpbb_session_test_case.php';
+
+class phpbb_session_create_test extends phpbb_session_test_case
+{
+ public function getDataSet()
+ {
+ return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/sessions_full.xml');
+ }
+
+ static function bot($bot_agent, $user_id, $bot_ip)
+ {
+ return array(array(
+ 'bot_agent' => $bot_agent,
+ 'user_id' => $user_id,
+ 'bot_ip' => $bot_ip,
+ ));
+ }
+
+ function test_bot_session()
+ {
+ $output = $this->session_facade->session_create(
+ false,
+ false,
+ false,
+ false,
+ array(),
+ 'user agent',
+ '127.0.0.1',
+ self::bot('user agent', 13, '127.0.0.1'),
+ ''
+ );
+ $this->assertEquals(true, $output->data['is_bot'], 'should be a bot');
+ }
+}
diff --git a/tests/session/creation_test.php b/tests/session/creation_test.php
deleted file mode 100644
index bef52c6554..0000000000
--- a/tests/session/creation_test.php
+++ /dev/null
@@ -1,57 +0,0 @@
-<?php
-/**
-*
-* @package testing
-* @copyright (c) 2011 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
-*
-*/
-
-require_once dirname(__FILE__) . '/../mock/cache.php';
-require_once dirname(__FILE__) . '/testable_factory.php';
-
-class phpbb_session_creation_test extends phpbb_database_test_case
-{
- public function getDataSet()
- {
- return $this->createXMLDataSet(dirname(__FILE__).'/fixtures/sessions_empty.xml');
- }
-
- // also see security/extract_current_page.php
-
- public function test_login_session_create()
- {
- $db = $this->new_dbal();
- $session_factory = new phpbb_session_testable_factory;
-
- $session = $session_factory->get_session($db);
- $session->page = array('page' => 'page', 'forum' => 0);
-
- $session->session_create(3);
-
- $sql = 'SELECT session_user_id
- FROM phpbb_sessions';
-
- $this->assertSqlResultEquals(
- array(array('session_user_id' => 3)),
- $sql,
- 'Check if exactly one session for user id 3 was created'
- );
-
- $one_year_in_seconds = 365 * 24 * 60 * 60;
- $cookie_expire = $session->time_now + $one_year_in_seconds;
-
- $session->check_cookies($this, array(
- 'u' => array(null, $cookie_expire),
- 'k' => array(null, $cookie_expire),
- 'sid' => array($session->session_id, $cookie_expire),
- ));
-
- global $SID, $_SID;
- $this->assertEquals($session->session_id, $_SID);
- $this->assertEquals('?sid=' . $session->session_id, $SID);
-
- $session_factory->check($this);
- }
-}
-
diff --git a/tests/session/extract_hostname_test.php b/tests/session/extract_hostname_test.php
new file mode 100644
index 0000000000..3a9d498007
--- /dev/null
+++ b/tests/session/extract_hostname_test.php
@@ -0,0 +1,55 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+require_once dirname(__FILE__) . '/../test_framework/phpbb_session_test_case.php';
+
+class phpbb_session_extract_hostname_test extends phpbb_session_test_case
+{
+ public function getDataSet()
+ {
+ return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/sessions_empty.xml');
+ }
+
+ static public function extract_current_hostname_data()
+ {
+ return array (
+ // [Input] $host, $server_name_config, $cookie_domain_config, [Expected] $output
+ // If host is ip use that
+ // ipv4
+ array('127.0.0.1', 'skipped.org', 'skipped.org', '127.0.0.1'),
+ // ipv6
+ array('::1', 'skipped.org', 'skipped.org', ':'),
+ array('2002::3235:51f9', 'skipped.org', 'skipped.org', '2002::3235'),
+ // If no host but server name matches cookie_domain use that
+ array('', 'example.org', 'example.org', 'example.org'),
+ // If there is a host uri use that
+ array('example.org', false, false, 'example.org'),
+ // 'best approach' guessing
+ array('', 'example.org', false, 'example.org'),
+ array('', false, '127.0.0.1', '127.0.0.1'),
+ array('', false, false, php_uname('n')),
+ );
+ }
+
+ /** @dataProvider extract_current_hostname_data */
+ function test_extract_current_hostname($host, $server_name_config, $cookie_domain_config, $expected)
+ {
+ $output = $this->session_facade->extract_current_hostname(
+ $host,
+ $server_name_config,
+ $cookie_domain_config
+ );
+
+ $this->assertEquals($expected, $output);
+ }
+}
diff --git a/tests/session/extract_page_test.php b/tests/session/extract_page_test.php
new file mode 100644
index 0000000000..f0d1cdb60e
--- /dev/null
+++ b/tests/session/extract_page_test.php
@@ -0,0 +1,172 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+require_once dirname(__FILE__) . '/../test_framework/phpbb_session_test_case.php';
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
+
+class phpbb_session_extract_page_test extends phpbb_session_test_case
+{
+ public function getDataSet()
+ {
+ return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/sessions_empty.xml');
+ }
+
+ static public function extract_current_page_data()
+ {
+ return array(
+ array(
+ './',
+ '/phpBB/index.php',
+ '',
+ '/phpBB/',
+ '/',
+ array(
+ 'page_name' => 'index.php',
+ 'page_dir' => '',
+ 'query_string' => '',
+ 'script_path' => '/phpBB/',
+ 'root_script_path' => '/phpBB/',
+ 'page' => 'index.php',
+ 'forum' => 0,
+ ),
+ ),
+ array(
+ './',
+ '/phpBB/ucp.php',
+ 'mode=login',
+ '/phpBB/',
+ '/',
+ array(
+ 'page_name' => 'ucp.php',
+ 'page_dir' => '',
+ 'query_string' => 'mode=login',
+ 'script_path' => '/phpBB/',
+ 'root_script_path' => '/phpBB/',
+ 'page' => 'ucp.php?mode=login',
+ 'forum' => 0,
+ ),
+ ),
+ array(
+ './',
+ '/phpBB/ucp.php',
+ 'mode=register',
+ '/phpBB/',
+ '/',
+ array(
+ 'page_name' => 'ucp.php',
+ 'page_dir' => '',
+ 'query_string' => 'mode=register',
+ 'script_path' => '/phpBB/',
+ 'root_script_path' => '/phpBB/',
+ 'page' => 'ucp.php?mode=register',
+ 'forum' => 0,
+ ),
+ ),
+ array(
+ './',
+ '/phpBB/ucp.php',
+ 'mode=register',
+ '/phpBB/',
+ '/',
+ array(
+ 'page_name' => 'ucp.php',
+ 'page_dir' => '',
+ 'query_string' => 'mode=register',
+ 'script_path' => '/phpBB/',
+ 'root_script_path' => '/phpBB/',
+ 'page' => 'ucp.php?mode=register',
+ 'forum' => 0,
+ ),
+ ),
+ array(
+ './../',
+ '/phpBB/adm/index.php',
+ 'sid=e7215d958cdd41a6fc13509bebe53e42',
+ '/phpBB/adm/',
+ '/',
+ array(
+ 'page_name' => 'index.php',
+ //'page_dir' => 'adm',
+ // ^-- Ignored because .. returns different directory in live vs testing
+ 'query_string' => '',
+ 'script_path' => '/phpBB/adm/',
+ //'root_script_path' => '/phpBB/adm/',
+ //'page' => 'adm/index.php',
+ 'forum' => 0,
+ ),
+ ),
+ array(
+ './',
+ '/phpBB/adm/app.php',
+ 'page=1&test=2',
+ '/phpBB/adm/',
+ '/foo/bar',
+ array(
+ 'page_name' => 'app.php/foo/bar',
+ //'page_dir' => '',
+ 'query_string' => 'page=1&test=2',
+ 'script_path' => '/phpBB/adm/',
+ //'root_script_path' => '/phpBB/adm/',
+ //'page' => 'app.php/foo/bar?page=1&test=2',
+ 'forum' => 0,
+ ),
+ ),
+ array(
+ './../phpBB/',
+ '/test/test.php',
+ 'page=1&test=2',
+ '/test/',
+ '',
+ array(
+ 'page_name' => 'test.php',
+ //'page_dir' => '',
+ 'query_string' => 'page=1&test=2',
+ 'script_path' => '/test/',
+ //'root_script_path' => '../phpBB/',
+ //'page' => '../test/test.php/foo/bar?page=1&test=2',
+ 'forum' => 0,
+ ),
+ ),
+ );
+ }
+
+ /** @dataProvider extract_current_page_data */
+ function test_extract_current_page($root_path, $getScriptName, $getQueryString, $getBasePath, $getPathInfo, $expected)
+ {
+ global $symfony_request, $request, $phpbb_filesystem;
+
+ $phpbb_filesystem = new \phpbb\filesystem();
+
+ $server['HTTP_HOST'] = 'localhost';
+ $server['SERVER_NAME'] = 'localhost';
+ $server['SERVER_ADDR'] = '127.0.0.1';
+ $server['SERVER_PORT'] = 80;
+ $server['REMOTE_ADDR'] = '127.0.0.1';
+ $server['QUERY_STRING'] = $getQueryString;
+ $server['REQUEST_URI'] = $getScriptName . $getPathInfo . ($getQueryString === '' ? '' : '?' . $getQueryString);
+ $server['SCRIPT_NAME'] = $getScriptName;
+ $server['SCRIPT_FILENAME'] = '/var/www/' . $getScriptName;
+ $server['PHP_SELF'] = $getScriptName;
+ $server['HTTP_USER_AGENT'] = 'Mozilla/5.0 (Windows; U; Windows NT 6.0; de; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14';
+ $server['HTTP_ACCEPT_LANGUAGE'] = 'de-de,de;q=0.8,en-us;q=0.5,en;q=0.3';
+
+ $request = new phpbb_mock_request(array(), array(), array(), $server);
+ $symfony_request = new \phpbb\symfony_request($request);
+
+ $output = \phpbb\session::extract_current_page($root_path);
+
+ // This compares the result of the output.
+ // Any keys that are not in the expected array are overwritten by the output (aka not checked).
+ $this->assert_array_content_equals(array_merge($output, $expected), $output);
+ }
+}
diff --git a/tests/session/fixtures/sessions_banlist.xml b/tests/session/fixtures/sessions_banlist.xml
new file mode 100644
index 0000000000..e720e35f0a
--- /dev/null
+++ b/tests/session/fixtures/sessions_banlist.xml
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<dataset>
+ <table name="phpbb_users">
+ <column>user_id</column>
+ <column>username_clean</column>
+ <column>user_permissions</column>
+ <column>user_sig</column>
+ <row>
+ <value>1</value>
+ <value>anonymous</value>
+ <value></value>
+ <value></value>
+ </row>
+ </table>
+ <table name="phpbb_sessions">
+ <column>session_id</column>
+ <column>session_user_id</column>
+ <column>session_ip</column>
+ <column>session_browser</column>
+ <column>session_admin</column>
+ <row>
+ <value>bar_session000000000000000000000</value>
+ <value>4</value>
+ <value>127.0.0.1</value>
+ <value>user agent</value>
+ <value>1</value>
+ </row>
+ </table>
+ <table name="phpbb_banlist">
+ <column>ban_id</column>
+ <column>ban_userid</column>
+ <column>ban_ip</column>
+ <column>ban_email</column>
+ <column>ban_start</column>
+ <column>ban_end</column>
+ <column>ban_exclude</column>
+ <column>ban_reason</column>
+ <column>ban_give_reason</column>
+ <row>
+ <value>2</value>
+ <value>4</value>
+ <value>127.0.0.1</value>
+ <value>bar@example.org</value>
+ <value>1111</value>
+ <value>0</value>
+ <value>0</value>
+ <value>HAHAHA</value>
+ <value>1</value>
+ </row>
+ <row>
+ <value>3</value>
+ <value>0</value>
+ <value>127.1.1.1</value>
+ <value></value>
+ <value>1111</value>
+ <value>0</value>
+ <value>0</value>
+ <value>HAHAHA</value>
+ <value>1</value>
+ </row>
+ </table>
+</dataset>
diff --git a/tests/session/fixtures/sessions_empty.xml b/tests/session/fixtures/sessions_empty.xml
index c592e0a6c8..068951dc4c 100644
--- a/tests/session/fixtures/sessions_empty.xml
+++ b/tests/session/fixtures/sessions_empty.xml
@@ -5,31 +5,23 @@
<column>username_clean</column>
<column>user_permissions</column>
<column>user_sig</column>
- <column>user_occ</column>
- <column>user_interests</column>
<row>
<value>1</value>
<value>anonymous</value>
<value></value>
<value></value>
- <value></value>
- <value></value>
</row>
<row>
<value>3</value>
<value>foo</value>
<value></value>
<value></value>
- <value></value>
- <value></value>
</row>
<row>
<value>4</value>
<value>bar</value>
<value></value>
<value></value>
- <value></value>
- <value></value>
</row>
</table>
<table name="phpbb_sessions">
diff --git a/tests/session/fixtures/sessions_full.xml b/tests/session/fixtures/sessions_full.xml
index 509687f4d2..4fb6b9dfd4 100644
--- a/tests/session/fixtures/sessions_full.xml
+++ b/tests/session/fixtures/sessions_full.xml
@@ -5,31 +5,23 @@
<column>username_clean</column>
<column>user_permissions</column>
<column>user_sig</column>
- <column>user_occ</column>
- <column>user_interests</column>
<row>
<value>1</value>
<value>anonymous</value>
<value></value>
<value></value>
- <value></value>
- <value></value>
</row>
<row>
<value>3</value>
<value>foo</value>
<value></value>
<value></value>
- <value></value>
- <value></value>
</row>
<row>
<value>4</value>
<value>bar</value>
<value></value>
<value></value>
- <value></value>
- <value></value>
</row>
</table>
<table name="phpbb_sessions">
@@ -37,17 +29,20 @@
<column>session_user_id</column>
<column>session_ip</column>
<column>session_browser</column>
+ <column>session_admin</column>
<row>
<value>anon_session00000000000000000000</value>
<value>1</value>
<value>127.0.0.1</value>
<value>anonymous user agent</value>
+ <value>0</value>
</row>
<row>
<value>bar_session000000000000000000000</value>
<value>4</value>
<value>127.0.0.1</value>
<value>user agent</value>
+ <value>1</value>
</row>
</table>
</dataset>
diff --git a/tests/session/fixtures/sessions_garbage.xml b/tests/session/fixtures/sessions_garbage.xml
new file mode 100644
index 0000000000..5eace839d0
--- /dev/null
+++ b/tests/session/fixtures/sessions_garbage.xml
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<dataset>
+ <table name="phpbb_users">
+ <column>user_id</column>
+ <column>username_clean</column>
+ <column>user_permissions</column>
+ <column>user_sig</column>
+ <row>
+ <value>4</value>
+ <value>bar</value>
+ <value></value>
+ <value></value>
+ </row>
+ </table>
+ <table name="phpbb_sessions">
+ <column>session_id</column>
+ <column>session_user_id</column>
+ <column>session_ip</column>
+ <column>session_browser</column>
+ <column>session_admin</column>
+ <row>
+ <value>anon_session00000000000000000000</value>
+ <value>1</value>
+ <value>127.0.0.1</value>
+ <value>anonymous user agent</value>
+ <value>0</value>
+ </row>
+ <row>
+ <value>bar_session000000000000000000000</value>
+ <value>4</value>
+ <value>127.0.0.1</value>
+ <value>user agent</value>
+ <value>1</value>
+ </row>
+ </table>
+ <table name="phpbb_login_attempts">
+ <column>attempt_ip</column>
+ <column>attempt_browser</column>
+ <column>attempt_forwarded_for</column>
+ <column>attempt_time</column>
+ <column>user_id</column>
+ <column>username</column>
+ <column>username_clean</column>
+ <row>
+ <value>127.0.0.1</value>
+ <value>browser</value>
+ <value></value>
+ <value>0001</value>
+ <value>4</value>
+ <value>bar</value>
+ <value>bar</value>
+ </row>
+ </table>
+</dataset>
diff --git a/tests/session/fixtures/sessions_key.xml b/tests/session/fixtures/sessions_key.xml
new file mode 100644
index 0000000000..245f89a604
--- /dev/null
+++ b/tests/session/fixtures/sessions_key.xml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<dataset>
+ <table name="phpbb_sessions_keys">
+ <column>key_id</column>
+ <column>user_id</column>
+ <column>last_ip</column>
+ <column>last_login</column>
+ <row>
+ <value>a87ff679a2f3e71d9181a67b7542122c</value>
+ <value>4</value>
+ <value>127.0.0.1</value>
+ <value>0</value>
+ </row>
+ </table>
+ <table name="phpbb_sessions">
+ <column>session_id</column>
+ <column>session_user_id</column>
+ <column>session_ip</column>
+ <column>session_browser</column>
+ <row>
+ <value>bar_session000000000000000000000</value>
+ <value>4</value>
+ <value>127.0.0.1</value>
+ <value>user agent</value>
+ </row>
+ </table>
+ <table name="phpbb_users">
+ <column>user_id</column>
+ <column>username_clean</column>
+ <column>user_permissions</column>
+ <column>user_sig</column>
+ <row>
+ <value>4</value>
+ <value>bar</value>
+ <value></value>
+ <value></value>
+ </row>
+ </table>
+</dataset>
diff --git a/tests/session/garbage_collection_test.php b/tests/session/garbage_collection_test.php
new file mode 100644
index 0000000000..3fad81c68b
--- /dev/null
+++ b/tests/session/garbage_collection_test.php
@@ -0,0 +1,71 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+require_once dirname(__FILE__) . '/../test_framework/phpbb_session_test_case.php';
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
+
+class phpbb_session_garbage_collection_test extends phpbb_session_test_case
+{
+ public $session;
+
+ public function getDataSet()
+ {
+ return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/sessions_garbage.xml');
+ }
+
+ public function setUp()
+ {
+ parent::setUp();
+ $this->session = $this->session_factory->get_session($this->db);
+
+ global $phpbb_container;
+
+ $plugins = new \phpbb\di\service_collection($phpbb_container);
+ $plugins->add('core.captcha.plugins.nogd');
+ $phpbb_container->set(
+ 'captcha.factory',
+ new \phpbb\captcha\factory($phpbb_container, $plugins)
+ );
+ $phpbb_container->set(
+ 'core.captcha.plugins.nogd',
+ new \phpbb\captcha\plugins\nogd()
+ );
+ }
+
+ public function test_cleanup_all()
+ {
+ $this->check_sessions_equals(
+ array(
+ array(
+ 'session_id' => 'anon_session00000000000000000000',
+ 'session_user_id' => 1,
+ ),
+ array(
+ 'session_id' => 'bar_session000000000000000000000',
+ 'session_user_id' => 4,
+ ),
+ ),
+ 'Before test, should have some sessions.'
+ );
+ // Set session length so it clears all
+ global $config;
+ $config['session_length'] = 0;
+ // There is an error unless the captcha plugin is set
+ $config['captcha_plugin'] = 'core.captcha.plugins.nogd';
+ $this->session->session_gc();
+ $this->check_sessions_equals(
+ array(),
+ 'After setting session time to 0, should remove all.'
+ );
+ }
+}
diff --git a/tests/session/session_key_test.php b/tests/session/session_key_test.php
new file mode 100644
index 0000000000..bf3dfcaa3c
--- /dev/null
+++ b/tests/session/session_key_test.php
@@ -0,0 +1,62 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
+require_once dirname(__FILE__) . '/../test_framework/phpbb_session_test_case.php';
+
+class phpbb_session_login_keys_test extends phpbb_session_test_case
+{
+ protected $user_id = 4;
+ protected $key_id = 4;
+
+ public function getDataSet()
+ {
+ return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/sessions_key.xml');
+ }
+
+ public function test_set_key_manually()
+ {
+ // With AutoLogin setup
+ $this->session_factory->merge_config_data(array('allow_autologin' => true));
+ $session = $this->session_factory->get_session($this->db);
+
+ // Using a user_id and key that is already in the database
+ $session->cookie_data['u'] = $this->user_id;
+ $session->cookie_data['k'] = $this->key_id;
+
+ // Try to access session with the session key
+ $session->session_create(false, false, false);
+ $this->assertEquals($this->user_id, $session->data['user_id'], 'User should be logged in by the session key');
+ }
+
+ public function test_reset_keys()
+ {
+ // With AutoLogin setup
+ $this->session_factory->merge_config_data(array('allow_autologin' => true));
+ $session = $this->session_factory->get_session($this->db);
+
+ // Reset of the keys for this user
+ $session->reset_login_keys($this->user_id);
+
+ // Using a user_id and key that was in the database (before reset)
+ $session->cookie_data['u'] = $this->user_id;
+ $session->cookie_data['k'] = $this->key_id;
+
+ // Try to access session with the session key
+ $session->session_create(false, false, $this->user_id);
+ $this->assertNotEquals($this->user_id, $session->data['user_id'], 'User is not logged in because the session key is invalid');
+
+ $session->session_create($this->user_id, false, false);
+ $this->assertEquals($this->user_id, $session->data['user_id'], 'User should be logged in because we create a new session');
+ }
+}
diff --git a/tests/session/testable_facade.php b/tests/session/testable_facade.php
new file mode 100644
index 0000000000..05858c8a63
--- /dev/null
+++ b/tests/session/testable_facade.php
@@ -0,0 +1,130 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+require_once dirname(__FILE__) . '/testable_factory.php';
+require_once dirname(__FILE__) . '/../../phpBB/phpbb/session.php';
+
+/**
+ * This class exists to expose session.php's functions in a more testable way.
+ *
+ * Since many functions in session.php have global variables inside the function,
+ * this exposes those functions through a testable facade that uses
+ * testable_factory's mock global variables to modify global variables used in
+ * the functions.
+ *
+ * This is using the facade pattern to provide a testable "front" to the
+ * functions in sessions.php.
+ *
+ */
+class phpbb_session_testable_facade
+{
+ protected $db;
+ protected $session_factory;
+
+ function __construct($db, $session_factory)
+ {
+ $this->db = $db;
+ $this->session_factory = $session_factory;
+ }
+
+ function extract_current_hostname(
+ $host,
+ $server_name_config,
+ $cookie_domain_config
+ )
+ {
+ $session = $this->session_factory->get_session($this->db);
+ global $config, $request;
+ $config['server_name'] = $server_name_config;
+ $config['cookie_domain'] = $cookie_domain_config;
+ $request->overwrite('SERVER_NAME', $host, \phpbb\request\request_interface::SERVER);
+ $request->overwrite('Host', $host, \phpbb\request\request_interface::SERVER);
+ // Note: There is a php_uname function used as a fallthrough
+ // that this function doesn't override
+ return $session->extract_current_hostname();
+ }
+
+ /**
+ *
+ * This function has a lot of dependencies, so instead of naming them all,
+ * just ask for overrides
+ *
+ * @param update_session_page Boolean of whether to set page of the session
+ * @param config_overrides An array of overrides for the global config object
+ * @param request_overrides An array of overrides for the global request object
+ * @return boolean False if the user is identified, otherwise true.
+ */
+ function session_begin(
+ $update_session_page = true,
+ $config_overrides = array(),
+ $request_overrides = array(),
+ $cookies_overrides = array()
+ )
+ {
+ $this->session_factory->merge_config_data($config_overrides);
+ $this->session_factory->merge_server_data($request_overrides);
+ $this->session_factory->set_cookies($cookies_overrides);
+ $session = $this->session_factory->get_session($this->db);
+ $session->session_begin($update_session_page);
+ return $session;
+ }
+
+ function session_create(
+ $user_id = false,
+ $set_admin = false,
+ $persist_login = false,
+ $viewonline = true,
+ array $config_overrides = array(),
+ $user_agent = 'user agent',
+ $ip_address = '127.0.0.1',
+ array $bot_overrides = array(),
+ $uri_sid = ""
+ )
+ {
+ $this->session_factory->merge_config_data($config_overrides);
+ // Bots
+ $this->session_factory->merge_cache_data(array('_bots' => $bot_overrides));
+ global $request;
+ $session = $this->session_factory->get_session($this->db);
+ $session->browser = $user_agent;
+ $session->ip = $ip_address;
+ // Uri sid
+ if ($uri_sid)
+ {
+ $_GET['sid'] = $uri_sid;
+ }
+ $session->session_create($user_id, $set_admin, $persist_login, $viewonline);
+ return $session;
+ }
+
+ function validate_referer(
+ $check_script_path,
+ $referer,
+ $host,
+ $force_server_vars,
+ $server_port,
+ $server_name,
+ $root_script_path
+ )
+ {
+ $session = $this->session_factory->get_session($this->db);
+ global $config, $request;
+ $session->referer = $referer;
+ $session->page['root_script_path'] = $root_script_path;
+ $session->host = $host;
+ $config['force_server_vars'] = $force_server_vars;
+ $config['server_name'] = $server_name;
+ $request->overwrite('SERVER_PORT', $server_port, \phpbb\request\request_interface::SERVER);
+ return $session->validate_referer($check_script_path);
+ }
+}
diff --git a/tests/session/testable_factory.php b/tests/session/testable_factory.php
index 00f79738ef..3e25286480 100644
--- a/tests/session/testable_factory.php
+++ b/tests/session/testable_factory.php
@@ -1,13 +1,18 @@
<?php
/**
*
-* @package testing
-* @copyright (c) 2011 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
-require_once dirname(__FILE__) . '/../mock/session_testable.php';
+require_once dirname(__FILE__) . '/../mock/container_builder.php';
+require_once dirname(__FILE__) . '/../mock/auth_provider.php';
/**
* This class exists to setup an instance of phpbb's session class for testing.
@@ -18,12 +23,14 @@ require_once dirname(__FILE__) . '/../mock/session_testable.php';
*/
class phpbb_session_testable_factory
{
+ protected $container;
protected $config_data;
protected $cache_data;
protected $cookies;
protected $config;
protected $cache;
+ protected $request;
/**
* Initialises the factory with a set of default config and cache values.
@@ -60,22 +67,41 @@ class phpbb_session_testable_factory
/**
* Retrieve the configured session class instance
*
- * @param dbal $dbal The database connection to use for session data
+ * @param \phpbb\db\driver\driver_interface $dbal The database connection to use for session data
* @return phpbb_mock_session_testable A session instance
*/
- public function get_session(dbal $dbal)
+ public function get_session(\phpbb\db\driver\driver_interface $dbal)
{
// set up all the global variables used by session
- global $SID, $_SID, $db, $config, $cache;
+ global $SID, $_SID, $db, $config, $cache, $request, $phpbb_container;
+
+ $request = $this->request = new phpbb_mock_request(
+ array(),
+ array(),
+ $this->cookies,
+ $this->server_data
+ );
+ request_var(null, null, null, null, $request);
+
+ $config = $this->config = new \phpbb\config\config($this->get_config_data());
+ set_config(null, null, null, $config);
- $config = $this->config = $this->get_config_data();
$db = $dbal;
$cache = $this->cache = new phpbb_mock_cache($this->get_cache_data());
$SID = $_SID = null;
- $_COOKIE = $this->cookies;
- $_SERVER = $this->server_data;
+ $phpbb_container = $this->container = new phpbb_mock_container_builder();
+ $phpbb_container->set(
+ 'auth.provider.db',
+ new phpbb_mock_auth_provider()
+ );
+ $provider_collection = new \phpbb\auth\provider_collection($phpbb_container, $config);
+ $provider_collection->add('auth.provider.db');
+ $phpbb_container->set(
+ 'auth.provider_collection',
+ $provider_collection
+ );
$session = new phpbb_mock_session_testable;
return $session;
@@ -159,6 +185,32 @@ class phpbb_session_testable_factory
}
/**
+ * Set cookies, merge config and server data in one step.
+ *
+ * New values overwrite old ones.
+ *
+ * @param $session_id
+ * @param $user_id
+ * @param $user_agent
+ * @param $ip
+ * @param int $time
+ */
+ public function merge_test_data($session_id, $user_id, $user_agent, $ip, $time = 0)
+ {
+ $this->set_cookies(array(
+ '_sid' => $session_id,
+ '_u' => $user_id,
+ ));
+ $this->merge_config_data(array(
+ 'session_length' => time() + $time, // need to do this to allow sessions started at time 0
+ ));
+ $this->merge_server_data(array(
+ 'HTTP_USER_AGENT' => $user_agent,
+ 'REMOTE_ADDR' => $ip,
+ ));
+ }
+
+ /**
* Retrieve all server variables to be passed to the session.
*
* @return array Server variables
diff --git a/tests/session/unset_admin_test.php b/tests/session/unset_admin_test.php
new file mode 100644
index 0000000000..9633d77be6
--- /dev/null
+++ b/tests/session/unset_admin_test.php
@@ -0,0 +1,52 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+require_once dirname(__FILE__) . '/../test_framework/phpbb_session_test_case.php';
+
+class phpbb_session_unset_admin_test extends phpbb_session_test_case
+{
+ public function getDataSet()
+ {
+ return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/sessions_full.xml');
+ }
+
+ function get_test_session()
+ {
+ return $this->session_facade->session_begin(
+ true,
+ // Config
+ array(
+ 'session_length' => time(), // need to do this to allow sessions started at time 0
+ ),
+ // Server
+ array(
+ 'HTTP_USER_AGENT' => "user agent",
+ 'REMOTE_ADDR' => "127.0.0.1",
+ ),
+ // Cookies
+ array(
+ '_sid' => 'bar_session000000000000000000000',
+ '_u' => 4,
+ )
+ );
+ }
+
+ public function test_unset_admin()
+ {
+ $session = $this->get_test_session();
+ $this->assertEquals(1, $session->data['session_admin'], 'should be an admin before test starts');
+ $session->unset_admin();
+ $session = $this->get_test_session();
+ $this->assertEquals(0, $session->data['session_admin'], 'should be not be an admin after unset_admin');
+ }
+}
diff --git a/tests/session/validate_referrer_test.php b/tests/session/validate_referrer_test.php
new file mode 100644
index 0000000000..7690a89018
--- /dev/null
+++ b/tests/session/validate_referrer_test.php
@@ -0,0 +1,74 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+require_once dirname(__FILE__) . '/../test_framework/phpbb_session_test_case.php';
+
+class phpbb_session_validate_referrer_test extends phpbb_session_test_case
+{
+ public function getDataSet()
+ {
+ return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/sessions_empty.xml');
+ }
+
+ static function referrer_inputs()
+ {
+ $ex = "example.org";
+ $alt = "example.com";
+ return array(
+ // checkpath referrer host forcevars port servername rootpath pass?
+ // 0 Referrer or host wasn't collected, therefore should validate
+ array(false, '', $ex, false, 80, $ex, '', true),
+ array(false, $ex, '', false, 80, $ex, '', true),
+ // 2 Referrer doesn't match host or server_name
+ array(false, $alt, $ex, false, 80, $ex, '', false),
+ // 3 Everything should check out
+ array(false, $ex, $ex, false, 80, $ex, '', true),
+ // 4 Check Script Path
+ array(true, $ex, $ex, false, 80, $ex, '', true),
+ array(true, "$ex/foo", $ex, false, 80, $ex, "/foo", true),
+ array(true, "$ex/bar", $ex, false, 80, $ex, "/foo", false),
+ // 7 Port (This is not checked unless path is checked)
+ array(true, "$ex:80/foo", "$ex:80", false, 80, "$ex:80", "/foo", true),
+ array(true, "$ex:80/bar", "$ex:80", false, 80, "$ex:80", "/foo", false),
+ array(true, "$ex:79/foo", "$ex:81", false, 81, "$ex:81", "/foo", false),
+ );
+ }
+
+ /** @dataProvider referrer_inputs */
+ function test_referrer_inputs(
+ $check_script_path,
+ $referrer,
+ $host,
+ $force_server_vars,
+ $server_port,
+ $server_name,
+ $root_script_path,
+ $pass_or_fail
+ )
+ {
+ // Referrer needs http:// because it's going to get stripped in function.
+ $referrer = $referrer ? 'http://' . $referrer : '';
+ $this->assertEquals(
+ $pass_or_fail,
+ $this->session_facade->validate_referer(
+ $check_script_path,
+ $referrer,
+ $host,
+ $force_server_vars,
+ $server_port,
+ $server_name,
+ $root_script_path
+ ),
+ "referrer should" . ($pass_or_fail ? '' : "n't") . " be validated");
+ }
+}
diff --git a/tests/template/datasets/event_inheritance/ext/kappa/styles/all/template/event/test.html b/tests/template/datasets/event_inheritance/ext/kappa/styles/all/template/event/test.html
new file mode 100644
index 0000000000..3eb906a09e
--- /dev/null
+++ b/tests/template/datasets/event_inheritance/ext/kappa/styles/all/template/event/test.html
@@ -0,0 +1 @@
+Kappa test event in all
diff --git a/tests/template/datasets/event_inheritance/ext/kappa/styles/silver/template/event/test.html b/tests/template/datasets/event_inheritance/ext/kappa/styles/silver/template/event/test.html
new file mode 100644
index 0000000000..3b65d80a6d
--- /dev/null
+++ b/tests/template/datasets/event_inheritance/ext/kappa/styles/silver/template/event/test.html
@@ -0,0 +1 @@
+Kappa test event in silver
diff --git a/tests/template/datasets/event_inheritance/ext/kappa/styles/silver_inherit/template/event/test.html b/tests/template/datasets/event_inheritance/ext/kappa/styles/silver_inherit/template/event/test.html
new file mode 100644
index 0000000000..26826d59e3
--- /dev/null
+++ b/tests/template/datasets/event_inheritance/ext/kappa/styles/silver_inherit/template/event/test.html
@@ -0,0 +1 @@
+Kappa test event in silver_inherit
diff --git a/tests/template/datasets/event_inheritance/ext/omega/styles/all/template/event/test.html b/tests/template/datasets/event_inheritance/ext/omega/styles/all/template/event/test.html
new file mode 100644
index 0000000000..003d193dc3
--- /dev/null
+++ b/tests/template/datasets/event_inheritance/ext/omega/styles/all/template/event/test.html
@@ -0,0 +1 @@
+Omega test event in all
diff --git a/tests/template/datasets/event_inheritance/ext/omega/styles/silver/template/event/test.html b/tests/template/datasets/event_inheritance/ext/omega/styles/silver/template/event/test.html
new file mode 100644
index 0000000000..6bf06f5457
--- /dev/null
+++ b/tests/template/datasets/event_inheritance/ext/omega/styles/silver/template/event/test.html
@@ -0,0 +1 @@
+Omega test event in silver
diff --git a/tests/template/datasets/event_inheritance/ext/omega/styles/silver/template/event/two.html b/tests/template/datasets/event_inheritance/ext/omega/styles/silver/template/event/two.html
new file mode 100644
index 0000000000..7f8058f4e4
--- /dev/null
+++ b/tests/template/datasets/event_inheritance/ext/omega/styles/silver/template/event/two.html
@@ -0,0 +1 @@
+two in silver in omega
diff --git a/tests/template/datasets/event_inheritance/ext/zeta/styles/all/template/event/test.html b/tests/template/datasets/event_inheritance/ext/zeta/styles/all/template/event/test.html
new file mode 100644
index 0000000000..5fc7e5ac12
--- /dev/null
+++ b/tests/template/datasets/event_inheritance/ext/zeta/styles/all/template/event/test.html
@@ -0,0 +1 @@
+Zeta test event in all
diff --git a/tests/template/datasets/event_inheritance/styles/silver/template/event_test.html b/tests/template/datasets/event_inheritance/styles/silver/template/event_test.html
new file mode 100644
index 0000000000..4d78dddb12
--- /dev/null
+++ b/tests/template/datasets/event_inheritance/styles/silver/template/event_test.html
@@ -0,0 +1 @@
+<!-- EVENT test -->
diff --git a/tests/template/datasets/event_inheritance/styles/silver/template/event_two.html b/tests/template/datasets/event_inheritance/styles/silver/template/event_two.html
new file mode 100644
index 0000000000..fe46be3782
--- /dev/null
+++ b/tests/template/datasets/event_inheritance/styles/silver/template/event_two.html
@@ -0,0 +1 @@
+<!-- EVENT two -->
diff --git a/tests/template/datasets/event_inheritance/styles/silver_inherit/template/event_test.html b/tests/template/datasets/event_inheritance/styles/silver_inherit/template/event_test.html
new file mode 100644
index 0000000000..4d78dddb12
--- /dev/null
+++ b/tests/template/datasets/event_inheritance/styles/silver_inherit/template/event_test.html
@@ -0,0 +1 @@
+<!-- EVENT test -->
diff --git a/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/event_variable_spacing.html b/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/event_variable_spacing.html
new file mode 100644
index 0000000000..028f8aa0d1
--- /dev/null
+++ b/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/event_variable_spacing.html
@@ -0,0 +1,6 @@
+|{VARIABLE}|
+{VARIABLE}|{VARIABLE}|
+
+|{VARIABLE}
+
+<div class="{VARIABLE}">test</div>
diff --git a/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/test_event_loop.html b/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/test_event_loop.html
new file mode 100644
index 0000000000..235e129f85
--- /dev/null
+++ b/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/test_event_loop.html
@@ -0,0 +1 @@
+{event_loop.S_ROW_COUNT}<!-- IF not event_loop.S_LAST_ROW -->|<!-- ENDIF -->
diff --git a/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/test_event_subloop.html b/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/test_event_subloop.html
new file mode 100644
index 0000000000..98fa1770ba
--- /dev/null
+++ b/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/test_event_subloop.html
@@ -0,0 +1,2 @@
+[{event_loop.S_ROW_COUNT}<!-- BEGIN event_loop.subloop -->[subloop:{event_loop.subloop.S_ROW_COUNT}]
+<!-- END event_loop.subloop -->]
diff --git a/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/universal.html b/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/universal.html
new file mode 100644
index 0000000000..f2c5762ade
--- /dev/null
+++ b/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/universal.html
@@ -0,0 +1 @@
+Universal in trivial extension.
diff --git a/tests/template/datasets/ext_trivial/ext/trivial/styles/silver/template/event/simple.html b/tests/template/datasets/ext_trivial/ext/trivial/styles/silver/template/event/simple.html
new file mode 100644
index 0000000000..fe32a1ed3f
--- /dev/null
+++ b/tests/template/datasets/ext_trivial/ext/trivial/styles/silver/template/event/simple.html
@@ -0,0 +1 @@
+Simple in trivial extension.
diff --git a/tests/template/datasets/ext_trivial/styles/silver/template/event_loop.html b/tests/template/datasets/ext_trivial/styles/silver/template/event_loop.html
new file mode 100644
index 0000000000..c70d8f86d7
--- /dev/null
+++ b/tests/template/datasets/ext_trivial/styles/silver/template/event_loop.html
@@ -0,0 +1,3 @@
+<!-- BEGIN event_loop -->
+event_loop<!-- EVENT test_event_loop -->
+<!-- END event_loop -->
diff --git a/tests/template/datasets/ext_trivial/styles/silver/template/event_simple.html b/tests/template/datasets/ext_trivial/styles/silver/template/event_simple.html
new file mode 100644
index 0000000000..604c1acdce
--- /dev/null
+++ b/tests/template/datasets/ext_trivial/styles/silver/template/event_simple.html
@@ -0,0 +1 @@
+<!-- EVENT simple -->
diff --git a/tests/template/datasets/ext_trivial/styles/silver/template/event_subloop.html b/tests/template/datasets/ext_trivial/styles/silver/template/event_subloop.html
new file mode 100644
index 0000000000..233b32a4c7
--- /dev/null
+++ b/tests/template/datasets/ext_trivial/styles/silver/template/event_subloop.html
@@ -0,0 +1,3 @@
+<!-- BEGIN event_loop -->
+event_loop<!-- EVENT test_event_subloop -->
+<!-- END event_loop -->
diff --git a/tests/template/datasets/ext_trivial/styles/silver/template/event_universal.html b/tests/template/datasets/ext_trivial/styles/silver/template/event_universal.html
new file mode 100644
index 0000000000..15425cacc3
--- /dev/null
+++ b/tests/template/datasets/ext_trivial/styles/silver/template/event_universal.html
@@ -0,0 +1 @@
+<!-- EVENT universal -->
diff --git a/tests/template/datasets/ext_trivial/styles/silver/template/variable_spacing.html b/tests/template/datasets/ext_trivial/styles/silver/template/variable_spacing.html
new file mode 100644
index 0000000000..49d8a6b873
--- /dev/null
+++ b/tests/template/datasets/ext_trivial/styles/silver/template/variable_spacing.html
@@ -0,0 +1 @@
+<!-- EVENT event_variable_spacing -->
diff --git a/tests/template/ext/include/css/styles/all/theme/child_only.css b/tests/template/ext/include/css/styles/all/theme/child_only.css
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/template/ext/include/css/styles/all/theme/child_only.css
diff --git a/tests/template/ext/include/css/styles/all/theme/test.css b/tests/template/ext/include/css/styles/all/theme/test.css
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/template/ext/include/css/styles/all/theme/test.css
diff --git a/tests/template/includephp_test.php b/tests/template/includephp_test.php
new file mode 100644
index 0000000000..fdddbef4f2
--- /dev/null
+++ b/tests/template/includephp_test.php
@@ -0,0 +1,60 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+require_once dirname(__FILE__) . '/template_test_case.php';
+
+class phpbb_template_includephp_test extends phpbb_template_template_test_case
+{
+ public function test_includephp_relative()
+ {
+ $this->setup_engine(array('tpl_allow_php' => true));
+
+ $this->run_template('includephp_relative.html', array(), array(), array(), "Path is relative to board root.\ntesting included php");
+
+ $this->template->set_filenames(array('test' => 'includephp_relative.html'));
+ $this->assertEquals("Path is relative to board root.\ntesting included php", $this->display('test'), "Testing INCLUDEPHP");
+ }
+
+ public function test_includephp_variables()
+ {
+ $this->setup_engine(array('tpl_allow_php' => true));
+
+ $this->run_template('includephp_variables.html', array('TEMPLATES' => 'templates'), array(), array(), "Path includes variables.\ntesting included php");
+
+ $this->template->set_filenames(array('test' => 'includephp_variables.html'));
+ $this->assertEquals("Path includes variables.\ntesting included php", $this->display('test'), "Testing INCLUDEPHP");
+ }
+
+ public function test_includephp_absolute()
+ {
+ global $phpbb_root_path;
+
+ $path_to_php = str_replace('\\', '/', dirname(__FILE__)) . '/templates/_dummy_include.php.inc';
+ $this->assertTrue(phpbb_is_absolute($path_to_php));
+ $template_text = "Path is absolute.\n<!-- INCLUDEPHP $path_to_php -->";
+
+ $cache_dir = $phpbb_root_path . 'cache/';
+ $fp = fopen($cache_dir . 'includephp_absolute.html', 'w');
+ fputs($fp, $template_text);
+ fclose($fp);
+
+ $this->setup_engine(array('tpl_allow_php' => true));
+
+ $this->template->set_custom_style('tests', $cache_dir);
+
+ $this->run_template('includephp_absolute.html', array(), array(), array(), "Path is absolute.\ntesting included php");
+
+ $this->template->set_filenames(array('test' => 'includephp_absolute.html'));
+ $this->assertEquals("Path is absolute.\ntesting included php", $this->display('test'), "Testing INCLUDEPHP");
+ }
+}
diff --git a/tests/template/parent_templates/parent_and_child.html b/tests/template/parent_templates/parent_and_child.html
new file mode 100644
index 0000000000..71984b48ad
--- /dev/null
+++ b/tests/template/parent_templates/parent_and_child.html
@@ -0,0 +1 @@
+Parent template.
diff --git a/tests/template/parent_templates/parent_and_child.js b/tests/template/parent_templates/parent_and_child.js
new file mode 100644
index 0000000000..6d9bb163bf
--- /dev/null
+++ b/tests/template/parent_templates/parent_and_child.js
@@ -0,0 +1 @@
+// JavaScript file in a parent style.
diff --git a/tests/template/parent_templates/parent_only.css b/tests/template/parent_templates/parent_only.css
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/template/parent_templates/parent_only.css
diff --git a/tests/template/parent_templates/parent_only.html b/tests/template/parent_templates/parent_only.html
new file mode 100644
index 0000000000..8cfb90eca2
--- /dev/null
+++ b/tests/template/parent_templates/parent_only.html
@@ -0,0 +1 @@
+Only in parent.
diff --git a/tests/template/parent_templates/parent_only.js b/tests/template/parent_templates/parent_only.js
new file mode 100644
index 0000000000..9c3007d83f
--- /dev/null
+++ b/tests/template/parent_templates/parent_only.js
@@ -0,0 +1 @@
+// JavaScript file only in parent style.
diff --git a/tests/template/subdir/includephp_from_subdir_test.php b/tests/template/subdir/includephp_from_subdir_test.php
new file mode 100644
index 0000000000..08ffb0f7dc
--- /dev/null
+++ b/tests/template/subdir/includephp_from_subdir_test.php
@@ -0,0 +1,31 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+require_once dirname(__FILE__) . '/../template_test_case.php';
+
+class phpbb_template_subdir_includephp_from_subdir_test extends phpbb_template_template_test_case
+{
+ // Exact copy of test_includephp_relatve from ../includephp_test.php.
+ // Verifies that relative php inclusion works when including script
+ // (and thus current working directory) is in a subdirectory of
+ // board root.
+ public function test_includephp_relative()
+ {
+ $this->setup_engine(array('tpl_allow_php' => true));
+
+ $this->run_template('includephp_relative.html', array(), array(), array(), "Path is relative to board root.\ntesting included php");
+
+ $this->template->set_filenames(array('test' => 'includephp_relative.html'));
+ $this->assertEquals("Path is relative to board root.\ntesting included php", $this->display('test'), "Testing INCLUDEPHP");
+ }
+}
diff --git a/tests/template/template_allfolder_test.php b/tests/template/template_allfolder_test.php
new file mode 100644
index 0000000000..b4ad84e9c3
--- /dev/null
+++ b/tests/template/template_allfolder_test.php
@@ -0,0 +1,59 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+require_once dirname(__FILE__) . '/template_test_case.php';
+
+class phpbb_template_allfolder_test extends phpbb_template_template_test_case
+{
+ public function test_allfolder()
+ {
+ $this->setup_engine_for_allfolder();
+
+ $this->run_template('foobar_body.html', array(), array(), array(), "All folder");
+ }
+
+ protected function setup_engine_for_allfolder(array $new_config = array())
+ {
+ global $phpbb_root_path, $phpEx;
+
+ $defaults = $this->config_defaults();
+ $config = new \phpbb\config\config(array_merge($defaults, $new_config));
+ $this->user = new \phpbb\user('\phpbb\datetime');
+
+ $path_helper = new \phpbb\path_helper(
+ new \phpbb\symfony_request(
+ new phpbb_mock_request()
+ ),
+ new \phpbb\filesystem(),
+ $this->getMock('\phpbb\request\request'),
+ $phpbb_root_path,
+ $phpEx
+ );
+
+ $this->extension_manager = new phpbb_mock_extension_manager(
+ dirname(__FILE__) . '/',
+ array(
+ 'vendor4/bar' => array(
+ 'ext_name' => 'vendor4/bar',
+ 'ext_active' => '1',
+ 'ext_path' => 'ext/vendor4/bar/',
+ ),
+ )
+ );
+
+ $this->template_path = $this->test_path . '/templates';
+ $this->ext_template_path = 'tests/extension/ext/vendor4/bar/styles/all/template';
+ $this->template = new \phpbb\template\twig\twig($path_helper, $config, $this->user, new \phpbb\template\context(), $this->extension_manager);
+ $this->template->set_custom_style('all', array($this->template_path, $this->ext_template_path));
+ }
+}
diff --git a/tests/template/template_events_test.php b/tests/template/template_events_test.php
new file mode 100644
index 0000000000..c415c969fe
--- /dev/null
+++ b/tests/template/template_events_test.php
@@ -0,0 +1,153 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+require_once dirname(__FILE__) . '/template_test_case.php';
+
+class phpbb_template_template_events_test extends phpbb_template_template_test_case
+{
+ public function template_data()
+ {
+ return array(
+ /*
+ array(
+ '', // Description
+ '', // dataset
+ array(), // style names
+ '', // file
+ array(), // vars
+ array(), // block vars
+ array(), // destroy
+ '', // expected result
+ ),
+ */
+ array(
+ 'Simple template event',
+ 'ext_trivial',
+ array(),
+ 'event_simple.html',
+ array(),
+ array(),
+ array(),
+ "Simple in trivial extension.",
+ ),
+ array(
+ 'Universal template event ("all" style)',
+ 'ext_trivial',
+ array(),
+ 'event_universal.html',
+ array(),
+ array(),
+ array(),
+ "Universal in trivial extension.",
+ ),
+ array(
+ 'Template event with inheritance - parent',
+ 'event_inheritance',
+ array('silver'),
+ 'event_test.html',
+ array(),
+ array(),
+ array(),
+'Kappa test event in silver
+Omega test event in silver
+Zeta test event in all',
+ ),
+ array(
+ 'Template event with inheritance - child',
+ 'event_inheritance',
+ array('silver_inherit', 'silver'),
+ 'event_test.html',
+ array(),
+ array(),
+ array(),
+'Kappa test event in silver_inherit
+Omega test event in silver
+Zeta test event in all',
+ ),
+ array(
+ 'Definition in parent style',
+ 'event_inheritance',
+ array('silver_inherit', 'silver'),
+ 'event_two.html',
+ array(),
+ array(),
+ array(),
+'two in silver in omega',
+ ),
+ array(
+ 'EVENT in loop',
+ 'ext_trivial',
+ array('silver'),
+ 'event_loop.html',
+ array(),
+ array('event_loop' => array(array(), array(), array())),
+ array(),
+ 'event_loop0|event_loop1|event_loop2',
+ ),
+ array(
+ 'EVENT with subloop in loop',
+ 'ext_trivial',
+ array('silver'),
+ 'event_subloop.html',
+ array(),
+ array(
+ 'event_loop' => array(array()),
+ 'event_loop.subloop' => array(array()),
+ ),
+ array(),
+ 'event_loop[0[subloop:0]]',
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider template_data
+ */
+ public function test_event($desc, $dataset, $style_names, $file, array $vars, array $block_vars, array $destroy, $expected, $incomplete_message = '')
+ {
+ if ($incomplete_message)
+ {
+ $this->markTestIncomplete($incomplete_message);
+ }
+
+ // Reset the engine state
+ $this->setup_engine_for_events($dataset, $style_names);
+
+ // Run test
+ $this->run_template($file, $vars, $block_vars, $destroy, $expected);
+ }
+
+ protected function setup_engine_for_events($dataset, $style_names, array $new_config = array())
+ {
+ global $phpbb_root_path, $phpEx, $user;
+
+ $defaults = $this->config_defaults();
+ $config = new \phpbb\config\config(array_merge($defaults, $new_config));
+
+ $this->template_path = dirname(__FILE__) . "/datasets/$dataset/styles/silver/template";
+ $this->extension_manager = new phpbb_mock_filesystem_extension_manager(
+ dirname(__FILE__) . "/datasets/$dataset/"
+ );
+ $path_helper = new \phpbb\path_helper(
+ new \phpbb\symfony_request(
+ new phpbb_mock_request()
+ ),
+ new \phpbb\filesystem(),
+ $this->getMock('\phpbb\request\request'),
+ $phpbb_root_path,
+ $phpEx
+ );
+ $this->template = new \phpbb\template\twig\twig($path_helper, $config, $user, new \phpbb\template\context, $this->extension_manager);
+ $this->template->set_custom_style(((!empty($style_names)) ? $style_names : 'silver'), array($this->template_path));
+ }
+}
diff --git a/tests/template/template_includecss_test.php b/tests/template/template_includecss_test.php
new file mode 100644
index 0000000000..b025cd21d5
--- /dev/null
+++ b/tests/template/template_includecss_test.php
@@ -0,0 +1,97 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+require_once dirname(__FILE__) . '/template_test_case_with_tree.php';
+
+class phpbb_template_template_includecss_test extends phpbb_template_template_test_case_with_tree
+{
+ protected function setup_engine(array $new_config = array())
+ {
+ global $phpbb_root_path, $phpEx, $user;
+
+ $defaults = $this->config_defaults();
+ $config = new \phpbb\config\config(array_merge($defaults, $new_config));
+
+ $this->phpbb_path_helper = new \phpbb\path_helper(
+ new \phpbb\symfony_request(
+ new phpbb_mock_request()
+ ),
+ new \phpbb\filesystem(),
+ $this->getMock('\phpbb\request\request'),
+ $phpbb_root_path,
+ $phpEx
+ );
+
+ $this->template_path = $this->test_path . '/templates';
+ $this->parent_template_path = $this->test_path . '/parent_templates';
+ $this->template = new phpbb\template\twig\twig(
+ $this->phpbb_path_helper,
+ $config,
+ $user,
+ new phpbb\template\context(),
+ new phpbb_mock_extension_manager(
+ dirname(__FILE__) . '/',
+ array(
+ 'include/css' => array(
+ 'ext_name' => 'include/css',
+ 'ext_active' => '1',
+ 'ext_path' => 'ext/include/css/',
+ ),
+ )
+ )
+ );
+ $this->template->set_custom_style('tests', array($this->template_path, $this->parent_template_path));
+ }
+
+ public function template_data()
+ {
+ return array(
+ /*
+ array(
+ // vars
+ // expected
+ ),
+ */
+ array(
+ array('TEST' => 1),
+ '<link href="tests/template/templates/child_only.css?assets_version=1" rel="stylesheet" type="text/css" media="screen" />',
+ ),
+ array(
+ array('TEST' => 2),
+ '<link href="tests/template/parent_templates/parent_only.css?assets_version=1" rel="stylesheet" type="text/css" media="screen" />',
+ ),
+ array(
+ array('TEST' => 3),
+ '<link href="tests/template/ext/include/css/styles/all/theme/test.css?assets_version=1" rel="stylesheet" type="text/css" media="screen" />',
+ ),
+ array(
+ array('TEST' => 4),
+ '<link href="tests/template/ext/include/css/styles/all/theme/child_only.css?assets_version=1" rel="stylesheet" type="text/css" media="screen" />',
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider template_data
+ */
+ public function test_includecss_compilation($vars, $expected)
+ {
+ // Reset the engine state
+ $this->setup_engine(array('assets_version' => 1));
+
+ $this->template->assign_vars($vars);
+
+ // Run test
+ $this->run_template('includecss.html', array(), array(), array(), $expected);
+ }
+}
diff --git a/tests/template/template_includejs_test.php b/tests/template/template_includejs_test.php
new file mode 100644
index 0000000000..232f551b4a
--- /dev/null
+++ b/tests/template/template_includejs_test.php
@@ -0,0 +1,109 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+require_once dirname(__FILE__) . '/template_test_case_with_tree.php';
+
+class phpbb_template_template_includejs_test extends phpbb_template_template_test_case_with_tree
+{
+ public function template_data()
+ {
+ $this->setup_engine();
+
+ return array(
+ /*
+ array(
+ // vars
+ // expected
+ ),
+ */
+ array(
+ array('TEST' => 1),
+ '<script type="text/javascript" src="tests/template/templates/parent_and_child.js?assets_version=1"></script>',
+ ),
+ array(
+ array('TEST' => 2),
+ '<script type="text/javascript" src="tests/template/templates/parent_and_child.js?assets_version=0"></script>',
+ ),
+ array(
+ array('TEST' => 3),
+ '<script type="text/javascript" src="tests/template/templates/parent_and_child.js?test=1&assets_version=0"></script>',
+ ),
+ array(
+ array('TEST' => 4),
+ '<script type="text/javascript" src="tests/template/templates/parent_and_child.js?test=1&amp;assets_version=0"></script>',
+ ),
+ array(
+ array('TEST' => 6),
+ '<script type="text/javascript" src="tests/template/parent_templates/parent_only.js?assets_version=1"></script>',
+ ),
+ array(
+ array('TEST' => 7),
+ '<script type="text/javascript" src="tests/template/templates/child_only.js?assets_version=1"></script>',
+ ),
+ array(
+ array('TEST' => 8),
+ '<script type="text/javascript" src="tests/template/templates/subdir/parent_only.js?assets_version=1"></script>',
+ ),
+ array(
+ array('TEST' => 9),
+ '<script type="text/javascript" src="tests/template/templates/subdir/subsubdir/parent_only.js?assets_version=1"></script>',
+ ),
+ array(
+ array('TEST' => 10),
+ '<script type="text/javascript" src="tests/template/templates/subdir/parent_only.js?assets_version=1"></script>',
+ ),
+ array(
+ array('TEST' => 11),
+ '<script type="text/javascript" src="tests/template/templates/child_only.js?test1=1&amp;test2=2&amp;assets_version=1#test3"></script>',
+ ),
+ array(
+ array('TEST' => 12),
+ '<script type="text/javascript" src="tests/template/parent_templates/parent_only.js?test1=1&amp;test2=2&amp;assets_version=1#test3"></script>',
+ ),
+ array(
+ array('TEST' => 14),
+ '<script type="text/javascript" src="tests/template/parent_templates/parent_only.js?test1=&quot;&amp;assets_version=1#test3"></script>',
+ ),
+ array(
+ array('TEST' => 15),
+ '<script type="text/javascript" src="http://phpbb.com/b.js?c=d#f"></script>',
+ ),
+ array(
+ array('TEST' => 16),
+ '<script type="text/javascript" src="http://phpbb.com/b.js?c=d&assets_version=2#f"></script>',
+ ),
+ array(
+ array('TEST' => 17),
+ '<script type="text/javascript" src="//phpbb.com/b.js"></script>',
+ ),
+ array(
+ array('TEST' => 18),
+ '<script type="text/javascript" src="tests/template/templates/parent_and_child.js?test=1&test2=0&amp;assets_version=1"></script>',
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider template_data
+ */
+ public function test_includejs_compilation($vars, $expected)
+ {
+ // Reset the engine state
+ $this->setup_engine(array('assets_version' => 1));
+
+ $this->template->assign_vars($vars);
+
+ // Run test
+ $this->run_template('includejs.html', array_merge(array('PARENT' => 'parent_only.js', 'SUBDIR' => 'subdir', 'EXT' => 'js'), $vars), array(), array(), $expected);
+ }
+}
diff --git a/tests/template/template_inheritance_test.php b/tests/template/template_inheritance_test.php
new file mode 100644
index 0000000000..4d918b3167
--- /dev/null
+++ b/tests/template/template_inheritance_test.php
@@ -0,0 +1,59 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+require_once dirname(__FILE__) . '/template_test_case_with_tree.php';
+
+class phpbb_template_template_inheritance_test extends phpbb_template_template_test_case_with_tree
+{
+ /**
+ * @todo put test data into templates/xyz.test
+ */
+ public function template_data()
+ {
+ return array(
+ // First element of the array is test name - keep them distinct
+ array(
+ 'simple inheritance - only parent template exists',
+ 'parent_only.html',
+ array(),
+ array(),
+ array(),
+ "Only in parent.",
+ ),
+ array(
+ 'simple inheritance - only child template exists',
+ 'child_only.html',
+ array(),
+ array(),
+ array(),
+ "Only in child.",
+ ),
+ array(
+ 'simple inheritance - both parent and child templates exist',
+ 'parent_and_child.html',
+ array(),
+ array(),
+ array(),
+ "Child template.",
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider template_data
+ */
+ public function test_template($name, $file, array $vars, array $block_vars, array $destroy, $expected)
+ {
+ $this->run_template($file, $vars, $block_vars, $destroy, $expected);
+ }
+}
diff --git a/tests/template/template_parser_test.php b/tests/template/template_parser_test.php
new file mode 100644
index 0000000000..d32fe78391
--- /dev/null
+++ b/tests/template/template_parser_test.php
@@ -0,0 +1,33 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
+require_once dirname(__FILE__) . '/template_test_case.php';
+
+class phpbb_template_template_parser_test extends phpbb_template_template_test_case
+{
+ public function test_set_filenames()
+ {
+ $this->template->set_filenames(array(
+ 'basic' => 'basic.html',
+ ));
+
+ $this->assertEquals("passpasspass<!-- DUMMY var -->", str_replace(array("\n", "\r", "\t"), '', $this->template->assign_display('basic')));
+
+ $this->template->set_filenames(array(
+ 'basic' => 'if.html',
+ ));
+
+ $this->assertEquals("03!false", str_replace(array("\n", "\r", "\t"), '', $this->template->assign_display('basic')));
+ }
+}
diff --git a/tests/template/template_test.php b/tests/template/template_test.php
index 94ec2ab8a7..69546cc227 100644
--- a/tests/template/template_test.php
+++ b/tests/template/template_test.php
@@ -1,111 +1,25 @@
<?php
/**
*
-* @package testing
-* @copyright (c) 2008 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
-require_once dirname(__FILE__) . '/../../phpBB/includes/template.php';
+require_once dirname(__FILE__) . '/template_test_case.php';
-class phpbb_template_template_test extends phpbb_test_case
+class phpbb_template_template_test extends phpbb_template_template_test_case
{
- private $template;
- private $template_path;
-
- // Keep the contents of the cache for debugging?
- const PRESERVE_CACHE = true;
-
- private function display($handle)
- {
- // allow the templates to throw notices
- $error_level = error_reporting();
- error_reporting($error_level & ~E_NOTICE);
-
- ob_start();
-
- try
- {
- $this->assertTrue($this->template->display($handle, false));
- }
- catch (Exception $exception)
- {
- // reset the error level even when an error occurred
- // PHPUnit turns trigger_error into exceptions as well
- error_reporting($error_level);
- ob_end_clean();
- throw $exception;
- }
-
- $result = self::trim_template_result(ob_get_clean());
-
- // reset error level
- error_reporting($error_level);
- return $result;
- }
-
- private static function trim_template_result($result)
- {
- return str_replace("\n\n", "\n", implode("\n", array_map('trim', explode("\n", trim($result)))));
- }
-
- private function setup_engine()
- {
- $this->template_path = dirname(__FILE__) . '/templates';
- $this->template = new template();
- $this->template->set_custom_template($this->template_path, 'tests');
- }
-
- protected function setUp()
- {
- // Test the engine can be used
- $this->setup_engine();
-
- $template_cache_dir = dirname($this->template->cachepath);
- if (!is_writable($template_cache_dir))
- {
- $this->markTestSkipped("Template cache directory ({$template_cache_dir}) is not writable.");
- }
-
- $file_array = scandir($template_cache_dir);
- $file_prefix = basename($this->template->cachepath);
- foreach ($file_array as $file)
- {
- if (strpos($file, $file_prefix) === 0)
- {
- unlink($template_cache_dir . '/' . $file);
- }
- }
-
- $GLOBALS['config'] = array(
- 'load_tplcompile' => true,
- 'tpl_allow_php' => false,
- );
- }
-
- protected function tearDown()
- {
- if (is_object($this->template))
- {
- $template_cache_dir = dirname($this->template->cachepath);
- $file_array = scandir($template_cache_dir);
- $file_prefix = basename($this->template->cachepath);
- foreach ($file_array as $file)
- {
- if (strpos($file, $file_prefix) === 0)
- {
- unlink($template_cache_dir . '/' . $file);
- }
- }
- }
- }
-
/**
* @todo put test data into templates/xyz.test
*/
- static public function template_data()
+ public function template_data()
{
return array(
/*
@@ -122,7 +36,7 @@ class phpbb_template_template_test extends phpbb_test_case
array(),
array(),
array(),
- "pass\npass\n<!-- DUMMY var -->",
+ "pass\npass\npass\n<!-- DUMMY var -->",
),
array(
'variable.html',
@@ -136,28 +50,56 @@ class phpbb_template_template_test extends phpbb_test_case
array(),
array(),
array(),
- '0',
+ '03!false',
),
array(
'if.html',
array('S_VALUE' => true),
array(),
array(),
- "1\n0",
+ '1!false',
),
array(
'if.html',
array('S_VALUE' => true, 'S_OTHER_VALUE' => true),
array(),
array(),
- '1',
+ '1!false',
+ ),
+ array(
+ 'if.html',
+ array('S_OTHER_OTHER_VALUE' => true),
+ array(),
+ array(),
+ '|S_OTHER_OTHER_VALUE|!false',
),
array(
'if.html',
array('S_VALUE' => false, 'S_OTHER_VALUE' => true),
array(),
array(),
- '2',
+ '2!false',
+ ),
+ array(
+ 'if.html',
+ array('S_TEST' => false),
+ array(),
+ array(),
+ '03false',
+ ),
+ array(
+ 'if.html',
+ array('S_TEST' => 0),
+ array(),
+ array(),
+ '03!false',
+ ),
+ array(
+ 'if.html',
+ array('VALUE_TEST' => 'value'),
+ array(),
+ array(),
+ '03!falsevalue',
),
array(
'loop.html',
@@ -169,65 +111,88 @@ class phpbb_template_template_test extends phpbb_test_case
array(
'loop.html',
array(),
- array('loop' => array(array())),
+ array('test_loop' => array(array())),
array(),
"loop\nloop",
),
array(
'loop.html',
array(),
- array('loop' => array(array(), array()), 'loop.block' => array(array())),
+ array('test_loop' => array(array(), array()), 'test_loop.block' => array(array())),
array(),
"loop\nloop\nloop\nloop",
),
array(
'loop.html',
array(),
- array('loop' => array(array(), array()), 'loop.block' => array(array()), 'block' => array(array(), array())),
+ array('test_loop' => array(array(), array()), 'test_loop.block' => array(array()), 'block' => array(array(), array())),
array(),
"loop\nloop\nloop\nloop\nloop#0-block#0\nloop#0-block#1\nloop#1-block#0\nloop#1-block#1",
),
array(
'loop_vars.html',
array(),
- array('loop' => array(array('VARIABLE' => 'x'))),
+ array('test_loop' => array(array('VARIABLE' => 'x'))),
array(),
- "first\n0\nx\nset\nlast",
- ),/* no nested top level loops
+ "first\n0 - a\nx - b\nset\nlast",
+ ),
array(
'loop_vars.html',
array(),
- array('loop' => array(array('VARIABLE' => 'x'), array('VARIABLE' => 'y'))),
+ array('test_loop' => array(array('VARIABLE' => 'x'), array('VARIABLE' => 'y'))),
array(),
- "first\n0\n0\n2\nx\nset\n1\n1\n2\ny\nset\nlast",
+ "first\n0 - a\nx - b\nset\n1 - a\ny - b\nset\nlast",
),
array(
'loop_vars.html',
array(),
- array('loop' => array(array('VARIABLE' => 'x'), array('VARIABLE' => 'y')), 'loop.inner' => array(array(), array())),
+ array('test_loop' => array(array('VARIABLE' => 'x'), array('VARIABLE' => 'y')), 'test_loop.inner' => array(array(), array())),
array(),
- "first\n0\n0\n2\nx\nset\n1\n1\n2\ny\nset\nlast\n0\n\n1\nlast inner\ninner loop",
- ),*/
+ "first\n0 - a\nx - b\nset\n1 - a\ny - b\nset\nlast\n0 - c\n1 - c\nlast inner",
+ ),
array(
'loop_advanced.html',
array(),
- array('loop' => array(array(), array(), array(), array(), array(), array(), array())),
+ array('test_loop' => array(array(), array(), array(), array(), array(), array(), array())),
array(),
"101234561\nx\n101234561\nx\n101234561\nx\n1234561\nx\n1\nx\n101\nx\n234\nx\n10\nx\n561\nx\n561",
),
array(
+ 'loop_nested2.html',
+ array(),
+ array('outer' => array(array(), array()), 'outer.middle' => array(array(), array())),
+ array(),
+ "o0o1m01m11",
+ ),
+ array(
'define.html',
array(),
- array('loop' => array(array(), array(), array(), array(), array(), array(), array()), 'test' => array(array()), 'test.deep' => array(array()), 'test.deep.defines' => array(array())),
+ array('test_loop' => array(array(), array(), array(), array(), array(), array(), array()), 'test' => array(array()), 'test.deep' => array(array()), 'test.deep.defines' => array(array())),
array(),
- "xyz\nabc",
+ "xyz\nabc\n\$VALUE == 'abc'\n(\$VALUE == 'abc')\n((\$VALUE == 'abc'))\n!\$DOESNT_EXIST\n(!\$DOESNT_EXIST)\nabc\nbar\nbar\nabc\ntest!@#$%^&*()_-=+{}[]:;\",<.>/?[]|foobar|false",
+ ),
+ array(
+ 'define_advanced.html',
+ array(),
+ array('test_loop' => array(array(), array(), array(), array(), array(), array(), array()), 'test' => array(array()), 'test.deep' => array(array()), 'test.deep.defines' => array(array())),
+ array(),
+ "abc\nzxc\ncde\nbcd",
),
array(
'expressions.html',
array(),
array(),
array(),
- trim(str_repeat("pass", 39)),
+ trim(str_repeat("pass\n", 10) . "\n"
+ . str_repeat("pass\n", 4) . "\n"
+ . str_repeat("pass\n", 2) . "\n"
+ . str_repeat("pass\n", 6) . "\n"
+ . str_repeat("pass\n", 2) . "\n"
+ . str_repeat("pass\n", 6) . "\n"
+ . str_repeat("pass\n", 2) . "\n"
+ . str_repeat("pass\n", 2) . "\n"
+ . str_repeat("pass\n", 3) . "\n"
+ . str_repeat("pass\n", 2) . "\n"),
),
array(
'php.html',
@@ -251,10 +216,31 @@ class phpbb_template_template_test extends phpbb_test_case
'value',
),
array(
+ 'include_loop.html',
+ array(),
+ array('test_loop' => array(array('NESTED_FILE' => 'include_loop1.html')), 'test_loop.inner' => array(array('NESTED_FILE' => 'include_loop1.html'), array('NESTED_FILE' => 'include_loop2.html'), array('NESTED_FILE' => 'include_loop3.html'))),
+ array(),
+ "1\n_1\n_02\n_3",
+ ),
+ array(
+ 'include_variable.html',
+ array('FILE' => 'variable.html', 'VARIABLE' => 'value'),
+ array(),
+ array(),
+ 'value',
+ ),
+ array(
+ 'include_variables.html',
+ array('SUBDIR' => 'subdir', 'VARIABLE' => 'value'),
+ array(),
+ array(),
+ 'value',
+ ),
+ array(
'loop_vars.html',
array(),
- array('loop' => array(array('VARIABLE' => 'x'), array('VARIABLE' => 'y')), 'loop.inner' => array(array(), array())),
- array('loop'),
+ array('test_loop' => array(array('VARIABLE' => 'x'), array('VARIABLE' => 'y')), 'test_loop.inner' => array(array(), array())),
+ array('test_loop'),
'',
),
array(
@@ -262,12 +248,12 @@ class phpbb_template_template_test extends phpbb_test_case
array('VARIABLE' => 'variable.html'),
array(),
array(),
- 'variable.html',
+ "variable.html\nvariable.html\nvariable.html",
),
array(
'include_loop_define.html',
array('VARIABLE' => 'value'),
- array('loop' => array(array('NESTED_FILE' => 'variable.html'))),
+ array('test_loop' => array(array('NESTED_FILE' => 'variable.html'))),
array(),
'value',
),
@@ -275,30 +261,103 @@ class phpbb_template_template_test extends phpbb_test_case
array(
'loop_vars.html',
array(),
- array('loop' => array(array('VARIABLE' => 'x'), array('VARIABLE' => 'y')), 'loop.inner' => array(array(), array())),
- array('loop.inner'),
+ array('test_loop' => array(array('VARIABLE' => 'x'), array('VARIABLE' => 'y')), 'test_loop.inner' => array(array(), array())),
+ array('test_loop.inner'),
"first\n0\n0\n2\nx\nset\n1\n1\n2\ny\nset\nlast",
),*/
array(
- 'lang.html',
+ // Just like a regular loop but the name begins
+ // with an underscore
+ 'loop_underscore.html',
array(),
array(),
array(),
- "{ VARIABLE }\n{ VARIABLE }",
+ "noloop\nnoloop",
),
array(
'lang.html',
- array('L_VARIABLE' => "Value'"),
array(),
array(),
- "Value'\nValue\'",
+ array(),
+ "VARIABLE\n1_VARIABLE\nVARIABLE\n1_VARIABLE",
),
array(
'lang.html',
- array('LA_VARIABLE' => "Value'"),
array(),
array(),
- "{ VARIABLE }\nValue'",
+ array(),
+ "Value'\n1 O'Clock\nValue\'\n1 O\'Clock",
+ array('VARIABLE' => "Value'", '1_VARIABLE' => "1 O'Clock"),
+ ),
+ array(
+ 'loop_nested_multilevel_ref.html',
+ array(),
+ array(),
+ array(),
+ "top-level content",
+ ),
+ array(
+ 'loop_nested_multilevel_ref.html',
+ array(),
+ array('outer' => array(array('VARIABLE' => 'x'), array('VARIABLE' => 'y')), 'outer.inner' => array(array('VARIABLE' => 'z'), array('VARIABLE' => 'zz'))),
+ array(),
+ "top-level content\nouter x\nouter y\ninner z\nfirst row\n\ninner zz",
+ ),
+ array(
+ 'loop_nested_deep_multilevel_ref.html',
+ array(),
+ array('outer' => array(array()), 'outer.middle' => array(array()), 'outer.middle.inner' => array(array('VARIABLE' => 'z'), array('VARIABLE' => 'zz'))),
+ array(),
+ "top-level content\nouter\nmiddle\ninner z\nfirst row of 2 in inner\n\ninner zz",
+ ),
+ array(
+ 'loop_size.html',
+ array(),
+ array('test_loop' => array(array()), 'empty_loop' => array()),
+ array(),
+ "nonexistent = 0\n! nonexistent\n\nempty = 0\n! empty\nloop\n\nin loop",
+ ),
+ array(
+ 'loop_include.html',
+ array(),
+ array('test_loop' => array(array('foo' => 'bar'), array('foo' => 'bar1'))),
+ array(),
+ "barbarbar1bar1",
+ ),
+ array(
+ 'loop_nested_include.html',
+ array(),
+ array(
+ 'test_loop' => array(array('foo' => 'bar'), array('foo' => 'bar1')),
+ 'test_loop.inner' => array(array('myinner' => 'works')),
+ ),
+ array(),
+ "[bar|[bar|]][bar1|[bar1|[bar1|works]]]",
+ array(),
+ ),
+ /* Does not pass with the current implementation.
+ array(
+ 'loop_reuse.html',
+ array(),
+ array('one' => array(array('VAR' => 'a'), array('VAR' => 'b')), 'one.one' => array(array('VAR' => 'c'), array('VAR' => 'd'))),
+ array(),
+ // Not entirely sure what should be outputted but the current output of "a" is most certainly wrong
+ "a\nb\nc\nd",
+ ),
+ */
+ array(
+ 'twig.html',
+ array('VARIABLE' => 'FOObar',),
+ array(),
+ array(),
+ "13FOOBAR|foobar",
+ ),
+ array(
+ 'if_nested_tags.html',
+ array('S_VALUE' => true,),
+ array(),
+ array(),
+ 'inner_value',
),
);
}
@@ -310,149 +369,101 @@ class phpbb_template_template_test extends phpbb_test_case
$this->template->set_filenames(array('test' => $filename));
$this->assertFileNotExists($this->template_path . '/' . $filename, 'Testing missing file, file cannot exist');
- $expecting = sprintf('template->_tpl_load_file(): File %s does not exist or is empty', realpath($this->template_path . '/../') . '/templates/' . $filename);
- $this->setExpectedTriggerError(E_USER_ERROR, $expecting);
+ $this->setExpectedException('Twig_Error_Loader');
$this->display('test');
}
- public function test_empty_file()
- {
- $expecting = 'template->set_filenames: Empty filename specified for test';
-
- $this->setExpectedTriggerError(E_USER_ERROR, $expecting);
- $this->template->set_filenames(array('test' => ''));
- }
public function test_invalid_handle()
{
- $expecting = 'template->_tpl_load(): No file specified for handle test';
- $this->setExpectedTriggerError(E_USER_ERROR, $expecting);
+ $this->setExpectedException('Twig_Error_Loader');
$this->display('test');
}
- private function run_template($file, array $vars, array $block_vars, array $destroy, $expected, $cache_file)
+ /**
+ * @dataProvider template_data
+ */
+ public function test_template($file, array $vars, array $block_vars, array $destroy, $expected, $lang_vars = array(), $incomplete_message = '')
{
- $this->template->set_filenames(array('test' => $file));
- $this->template->assign_vars($vars);
-
- foreach ($block_vars as $block => $loops)
+ if ($incomplete_message)
{
- foreach ($loops as $_vars)
- {
- $this->template->assign_block_vars($block, $_vars);
- }
+ $this->markTestIncomplete($incomplete_message);
}
- foreach ($destroy as $block)
- {
- $this->template->destroy_block_vars($block);
- }
-
- try
- {
- $this->assertEquals($expected, $this->display('test'), "Testing $file");
- $this->assertFileExists($cache_file);
- }
- catch (ErrorException $e)
- {
- if (file_exists($cache_file))
- {
- copy($cache_file, str_replace('ctpl_', 'tests_ctpl_', $cache_file));
- }
-
- throw $e;
- }
-
- // For debugging
- if (self::PRESERVE_CACHE)
- {
- copy($cache_file, str_replace('ctpl_', 'tests_ctpl_', $cache_file));
- }
+ $this->run_template($file, $vars, $block_vars, $destroy, $expected, $lang_vars);
}
- /**
- * @dataProvider template_data
- */
- public function test_template($file, array $vars, array $block_vars, array $destroy, $expected)
+ public function test_assign_display()
{
- $cache_file = $this->template->cachepath . str_replace('/', '.', $file) . '.php';
-
- $this->assertFileNotExists($cache_file);
+ $this->run_template('basic.html', array(), array(), array(), "pass\npass\npass\n<!-- DUMMY var -->");
- $this->run_template($file, $vars, $block_vars, $destroy, $expected, $cache_file);
+ $this->template->set_filenames(array(
+ 'test' => 'basic.html',
+ 'container' => 'variable.html',
+ ));
- // Reset the engine state
- $this->setup_engine();
+ $this->template->assign_display('test', 'VARIABLE', false);
- $this->run_template($file, $vars, $block_vars, $destroy, $expected, $cache_file);
+ $this->assertEquals("pass\npass\npass\n<!-- DUMMY var -->", $this->display('container'), "Testing assign_display($file)");
}
- /**
- * @dataProvider template_data
- */
- public function test_assign_display($file, array $vars, array $block_vars, array $destroy, $expected)
+ public function test_append_var_without_assign_var()
{
$this->template->set_filenames(array(
- 'test' => $file,
- 'container' => 'variable.html',
+ 'append_var' => 'variable.html'
));
- $this->template->assign_vars($vars);
- foreach ($block_vars as $block => $loops)
- {
- foreach ($loops as $_vars)
- {
- $this->template->assign_block_vars($block, $_vars);
- }
- }
+ $items = array('This ', 'is ', 'a ', 'test');
+ $expecting = implode('', $items);
- foreach ($destroy as $block)
+ foreach ($items as $word)
{
- $this->template->destroy_block_vars($block);
+ $this->template->append_var('VARIABLE', $word);
}
- $error_level = error_reporting();
- error_reporting($error_level & ~E_NOTICE);
-
- $this->assertEquals($expected, self::trim_template_result($this->template->assign_display('test')), "Testing assign_display($file)");
-
- $this->template->assign_display('test', 'VARIABLE', false);
-
- error_reporting($error_level);
-
- $this->assertEquals($expected, $this->display('container'), "Testing assign_display($file)");
+ $this->assertEquals($expecting, $this->display('append_var'));
}
- public function test_php()
+ public function test_append_var_with_assign_var()
{
- $GLOBALS['config']['tpl_allow_php'] = true;
-
- $cache_file = $this->template->cachepath . 'php.html.php';
+ $this->template->set_filenames(array(
+ 'append_var' => 'variable.html'
+ ));
- $this->assertFileNotExists($cache_file);
+ $start = 'This ';
+ $items = array('is ', 'a ', 'test');
+ $expecting = $start . implode('', $items);
- $this->run_template('php.html', array(), array(), array(), 'test', $cache_file);
+ $this->template->assign_var('VARIABLE', $start);
+ foreach ($items as $word)
+ {
+ $this->template->append_var('VARIABLE', $word);
+ }
- $GLOBALS['config']['tpl_allow_php'] = false;
+ $this->assertEquals($expecting, $this->display('append_var'));
}
- public function test_includephp()
+ public function test_php()
{
- $GLOBALS['config']['tpl_allow_php'] = true;
+ global $phpbb_root_path;
+
+ $template_text = '<!-- PHP -->echo "test";<!-- ENDPHP -->';
- $cache_file = $this->template->cachepath . 'includephp.html.php';
+ $cache_dir = $phpbb_root_path . 'cache/';
+ $fp = fopen($cache_dir . 'php.html', 'w');
+ fputs($fp, $template_text);
+ fclose($fp);
- $this->run_template('includephp.html', array(), array(), array(), 'testing included php', $cache_file);
+ $this->setup_engine(array('tpl_allow_php' => true));
- $this->template->set_filenames(array('test' => 'includephp.html'));
- $this->assertEquals('testing included php', $this->display('test'), "Testing INCLUDEPHP");
+ $this->template->set_custom_style('tests', $cache_dir);
- $GLOBALS['config']['tpl_allow_php'] = false;
+ $this->run_template('php.html', array(), array(), array(), 'test');
}
- static public function alter_block_array_data()
+ public function alter_block_array_data()
{
return array(
array(
@@ -517,22 +528,139 @@ EOT
),
array(
'outer',
+ array('VARIABLE' => 'changed'),
+ 0,
+ 'change',
+ <<<EOT
+outer - 0 - changed
+middle - 0
+middle - 1
+outer - 1
+middle - 0
+middle - 1
+outer - 2
+middle - 0
+middle - 1
+EOT
+,
+ 'Test changing at 0 on top level block',
+ ),
+ array(
+ 'outer',
+ array('VARIABLE' => 'changed'),
+ array('S_ROW_NUM' => 2),
+ 'change',
+ <<<EOT
+outer - 0
+middle - 0
+middle - 1
+outer - 1
+middle - 0
+middle - 1
+outer - 2 - changed
+middle - 0
+middle - 1
+EOT
+,
+ 'Test changing at KEY on top level block',
+ ),
+ array(
+ 'outer.middle',
+ array('VARIABLE' => 'before'),
+ false,
+ 'insert',
+ <<<EOT
+outer - 0
+middle - 0
+middle - 1
+outer - 1
+middle - 0
+middle - 1
+outer - 2
+middle - 0 - before
+middle - 1
+middle - 2
+EOT
+,
+ 'Test inserting before on middle level block',
+ ),
+ array(
+ 'outer.middle',
+ array('VARIABLE' => 'after'),
+ true,
+ 'insert',
+ <<<EOT
+outer - 0
+middle - 0
+middle - 1
+outer - 1
+middle - 0
+middle - 1
+outer - 2
+middle - 0
+middle - 1
+middle - 2 - after
+EOT
+,
+ 'Test inserting after on middle level block',
+ ),
+ array(
+ 'outer[1].middle',
array('VARIABLE' => 'pos #1'),
+ 1,
+ 'insert',
+ <<<EOT
+outer - 0
+middle - 0
+middle - 1
+outer - 1
+middle - 0
+middle - 1 - pos #1
+middle - 2
+outer - 2
+middle - 0
+middle - 1
+EOT
+,
+ 'Test inserting at 1 on middle level block',
+ ),
+ array(
+ 'outer[].middle',
+ array('VARIABLE' => 'changed'),
0,
'change',
<<<EOT
-outer - 0 - pos #1
+outer - 0
middle - 0
middle - 1
outer - 1
middle - 0
middle - 1
outer - 2
+middle - 0 - changed
+middle - 1
+EOT
+,
+ 'Test changing at beginning of last top level block',
+ ),
+ array(
+ 'outer.middle',
+ array('VARIABLE' => 'changed'),
+ array('S_ROW_NUM' => 1),
+ 'change',
+ <<<EOT
+outer - 0
middle - 0
middle - 1
+outer - 1
+middle - 0
+middle - 1
+outer - 2
+middle - 0
+middle - 1 - changed
EOT
,
- 'Test inserting at 1 on top level block',
+ 'Test changing at beginning of last top level block',
),
);
}
@@ -555,10 +683,129 @@ EOT
$this->template->assign_block_vars('outer.middle', array());
$this->template->assign_block_vars('outer.middle', array());
- $this->assertEquals("outer - 0\nmiddle - 0\nmiddle - 1\nouter - 1\nmiddle - 0\nmiddle - 1\nouter - 2\nmiddle - 0\nmiddle - 1", $this->display('test'), 'Ensuring template is built correctly before modification');
+ $this->assertEquals("outer - 0middle - 0middle - 1outer - 1middle - 0middle - 1outer - 2middle - 0middle - 1", $this->display('test'), 'Ensuring template is built correctly before modification');
$this->template->alter_block_array($alter_block, $vararray, $key, $mode);
- $this->assertEquals($expect, $this->display('test'), $description);
+ $this->assertEquals(str_replace(array("\n", "\r", "\t"), '', $expect), str_replace(array("\n", "\r", "\t"), '', $this->display('test')), $description);
}
-}
+ public function test_more_alter_block_array()
+ {
+ $this->template->set_filenames(array('test' => 'loop_nested.html'));
+
+ $this->template->assign_var('TEST_MORE', true);
+
+ // @todo Change this
+ $this->template->assign_block_vars('outer', array());
+ $this->template->assign_block_vars('outer.middle', array());
+ $this->template->assign_block_vars('outer', array());
+ $this->template->assign_block_vars('outer.middle', array());
+ $this->template->assign_block_vars('outer.middle', array());
+ $this->template->assign_block_vars('outer', array());
+ $this->template->assign_block_vars('outer.middle', array());
+ $this->template->assign_block_vars('outer.middle', array());
+ $this->template->assign_block_vars('outer.middle', array());
+
+ $expect = 'outer - 0[outer|3]middle - 0[middle|1]outer - 1[outer|3]middle - 0[middle|2]middle - 1[middle|2]outer - 2[outer|3]middle - 0[middle|3]middle - 1[middle|3]middle - 2[middle|3]';
+ $this->assertEquals($expect, str_replace(array("\n", "\r", "\t"), '', $this->display('test')), 'Ensuring template is built correctly before modification');
+
+ $this->template->alter_block_array('outer', array());
+
+ $expect = 'outer - 0[outer|4]outer - 1[outer|4]middle - 0[middle|1]outer - 2[outer|4]middle - 0[middle|2]middle - 1[middle|2]outer - 3[outer|4]middle - 0[middle|3]middle - 1[middle|3]middle - 2[middle|3]';
+ $this->assertEquals($expect, str_replace(array("\n", "\r", "\t"), '', $this->display('test')), 'Ensuring S_NUM_ROWS is correct after insertion');
+
+ $this->template->alter_block_array('outer', array('VARIABLE' => 'test'), 2, 'change');
+
+ $expect = 'outer - 0[outer|4]outer - 1[outer|4]middle - 0[middle|1]outer - 2 - test[outer|4]middle - 0[middle|2]middle - 1[middle|2]outer - 3[outer|4]middle - 0[middle|3]middle - 1[middle|3]middle - 2[middle|3]';
+ $this->assertEquals($expect, str_replace(array("\n", "\r", "\t"), '', $this->display('test')), 'Ensuring S_NUM_ROWS is correct after modification');
+
+ $this->template->alter_block_array('outer.middle', array());
+
+ $expect = 'outer - 0[outer|4]outer - 1[outer|4]middle - 0[middle|1]outer - 2 - test[outer|4]middle - 0[middle|2]middle - 1[middle|2]outer - 3[outer|4]middle - 0[middle|4]middle - 1[middle|4]middle - 2[middle|4]middle - 3[middle|4]';
+ $this->assertEquals($expect, str_replace(array("\n", "\r", "\t"), '', $this->display('test')), 'Ensuring S_NUM_ROWS is correct after insertion at middle level');
+
+ $this->template->alter_block_array('outer.middle', array('VARIABLE' => 'test'), 2, 'change');
+
+ $expect = 'outer - 0[outer|4]outer - 1[outer|4]middle - 0[middle|1]outer - 2 - test[outer|4]middle - 0[middle|2]middle - 1[middle|2]outer - 3[outer|4]middle - 0[middle|4]middle - 1[middle|4]middle - 2 - test[middle|4]middle - 3[middle|4]';
+ $this->assertEquals($expect, str_replace(array("\n", "\r", "\t"), '', $this->display('test')), 'Ensuring S_NUM_ROWS is correct after modification at middle level');
+ }
+
+ public function test_find_key_index()
+ {
+ $this->template->set_filenames(array('test' => 'loop_nested.html'));
+
+ $this->template->assign_var('TEST_MORE', true);
+
+ // @todo Change this
+ $this->template->assign_block_vars('outer', array('VARIABLE' => 'zero'));
+ $this->template->assign_block_vars('outer', array('VARIABLE' => 'one'));
+ $this->template->assign_block_vars('outer.middle', array('VARIABLE' => '1A'));
+ $this->template->assign_block_vars('outer', array('VARIABLE' => 'two'));
+ $this->template->assign_block_vars('outer.middle', array('VARIABLE' => '2A'));
+ $this->template->assign_block_vars('outer.middle', array('VARIABLE' => '2B'));
+ $this->template->assign_block_vars('outer', array('VARIABLE' => 'three'));
+ $this->template->assign_block_vars('outer.middle', array('VARIABLE' => '3A'));
+ $this->template->assign_block_vars('outer.middle', array('VARIABLE' => '3B'));
+ $this->template->assign_block_vars('outer.middle', array('VARIABLE' => '3C'));
+
+ $expect = 'outer - 0 - zero[outer|4]outer - 1 - one[outer|4]middle - 0 - 1A[middle|1]outer - 2 - two[outer|4]middle - 0 - 2A[middle|2]middle - 1 - 2B[middle|2]outer - 3 - three[outer|4]middle - 0 - 3A[middle|3]middle - 1 - 3B[middle|3]middle - 2 - 3C[middle|3]';
+ $this->assertEquals($expect, str_replace(array("\n", "\r", "\t"), '', $this->display('test')), 'Ensuring template is built correctly before modification');
+
+ $this->template->find_key_index('outer', false);
+
+ $this->assertEquals(0, $this->template->find_key_index('outer', false), 'Find index at the beginning of outer loop');
+ $this->assertEquals(1, $this->template->find_key_index('outer', 1), 'Find index by index in outer loop');
+ $this->assertEquals(2, $this->template->find_key_index('outer', array('VARIABLE' => 'two')), 'Find index by key in outer loop');
+ $this->assertEquals(3, $this->template->find_key_index('outer', true), 'Find index at the end of outer loop');
+ $this->assertEquals(false, $this->template->find_key_index('outer', 7), 'Find index out of bounds of outer loop');
+
+ $this->assertEquals(false, $this->template->find_key_index('outer[0].middle', false), 'Find index at the beginning of middle loop, no middle block');
+ $this->assertEquals(false, $this->template->find_key_index('outer[1].middle', 1), 'Find index by index in inner loop, out of bounds');
+ $this->assertEquals(1, $this->template->find_key_index('outer[2].middle', array('VARIABLE' => '2B')), 'Find index by key in middle loop');
+ $this->assertEquals(2, $this->template->find_key_index('outer.middle', true), 'Find index at the end of middle loop');
+
+ $this->assertEquals(false, $this->template->find_key_index('outer.wrong', true), 'Wrong middle block name');
+ $this->assertEquals(false, $this->template->find_key_index('wrong.middle', false), 'Wrong outer block name');
+ }
+ public function assign_block_vars_array_data()
+ {
+ return array(
+ array(
+ array(
+ 'outer' => array(
+ array('VARIABLE' => 'Test assigning block vars array loop 0:'),
+ array('VARIABLE' => 'Test assigning block vars array loop 1:'),
+ ),
+ 'outer.middle' => array(
+ array('VARIABLE' => '1st iteration',),
+ array('VARIABLE' => '2nd iteration',),
+ array('VARIABLE' => '3rd iteration',),
+ ),
+ )
+ )
+ );
+ }
+
+ /**
+ * @dataProvider assign_block_vars_array_data
+ */
+ public function test_assign_block_vars_array($block_data)
+ {
+ $this->template->set_filenames(array('test' => 'loop_nested.html'));
+
+ foreach ($block_data as $blockname => $block_vars_array)
+ {
+ $this->template->assign_block_vars_array($blockname, $block_vars_array);
+ }
+
+ $this->assertEquals("outer - 0 - Test assigning block vars array loop 0:outer - 1 - Test assigning block vars array loop 1:middle - 0 - 1st iterationmiddle - 1 - 2nd iterationmiddle - 2 - 3rd iteration", $this->display('test'), 'Ensuring assigning block vars array to template is working correctly');
+ }
+
+ /**
+ * @expectedException Twig_Error_Syntax
+ */
+ public function test_define_error()
+ {
+ $this->run_template('define_error.html', array(), array(), array(), '');
+ }
+}
diff --git a/tests/template/template_test_case.php b/tests/template/template_test_case.php
new file mode 100644
index 0000000000..1250397401
--- /dev/null
+++ b/tests/template/template_test_case.php
@@ -0,0 +1,132 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
+
+class phpbb_template_template_test_case extends phpbb_test_case
+{
+ protected $template;
+ protected $template_path;
+ protected $user;
+
+ protected $test_path = 'tests/template';
+
+ // Keep the contents of the cache for debugging?
+ const PRESERVE_CACHE = true;
+
+ protected function display($handle)
+ {
+ ob_start();
+
+ try
+ {
+ $this->template->display($handle, false);
+ }
+ catch (Exception $exception)
+ {
+ // reset output buffering even when an error occurred
+ // PHPUnit turns trigger_error into exceptions as well
+ ob_end_clean();
+ throw $exception;
+ }
+
+ $result = self::trim_template_result(ob_get_clean());
+
+ return $result;
+ }
+
+ protected static function trim_template_result($result)
+ {
+ return str_replace("\n\n", "\n", implode("\n", array_map('trim', explode("\n", trim($result)))));
+ }
+
+ protected function config_defaults()
+ {
+ $defaults = array(
+ 'load_tplcompile' => true,
+ 'tpl_allow_php' => false,
+ );
+ return $defaults;
+ }
+
+ protected function setup_engine(array $new_config = array())
+ {
+ global $phpbb_root_path, $phpEx;
+
+ $defaults = $this->config_defaults();
+ $config = new \phpbb\config\config(array_merge($defaults, $new_config));
+ $this->user = new \phpbb\user('\phpbb\datetime');
+
+ $path_helper = new \phpbb\path_helper(
+ new \phpbb\symfony_request(
+ new phpbb_mock_request()
+ ),
+ new \phpbb\filesystem(),
+ $this->getMock('\phpbb\request\request'),
+ $phpbb_root_path,
+ $phpEx
+ );
+
+ $this->template_path = $this->test_path . '/templates';
+ $this->template = new \phpbb\template\twig\twig($path_helper, $config, $this->user, new \phpbb\template\context());
+ $this->template->set_custom_style('tests', $this->template_path);
+ }
+
+ protected function setUp()
+ {
+ // Test the engine can be used
+ $this->setup_engine();
+
+ $this->template->clear_cache();
+ }
+
+ protected function tearDown()
+ {
+ if ($this->template)
+ {
+ $this->template->clear_cache();
+ }
+ }
+
+ protected function run_template($file, array $vars, array $block_vars, array $destroy, $expected, $lang_vars = array())
+ {
+ $this->template->set_filenames(array('test' => $file));
+ $this->template->assign_vars($vars);
+
+ foreach ($block_vars as $block => $loops)
+ {
+ foreach ($loops as $_vars)
+ {
+ $this->template->assign_block_vars($block, $_vars);
+ }
+ }
+
+ foreach ($destroy as $block)
+ {
+ $this->template->destroy_block_vars($block);
+ }
+
+ // Previous functionality was $cachefile (string), which was removed, check to prevent errors
+ if (is_array($lang_vars))
+ {
+ foreach ($lang_vars as $name => $value)
+ {
+ $this->user->lang[$name] = $value;
+ }
+ }
+
+ $expected = str_replace(array("\n", "\r", "\t"), '', $expected);
+ $output = str_replace(array("\n", "\r", "\t"), '', $this->display('test'));
+ $this->assertEquals($expected, $output, "Testing $file");
+ }
+}
diff --git a/tests/template/template_test_case_with_tree.php b/tests/template/template_test_case_with_tree.php
new file mode 100644
index 0000000000..68ecc4b706
--- /dev/null
+++ b/tests/template/template_test_case_with_tree.php
@@ -0,0 +1,40 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+require_once dirname(__FILE__) . '/template_test_case.php';
+
+class phpbb_template_template_test_case_with_tree extends phpbb_template_template_test_case
+{
+ protected function setup_engine(array $new_config = array())
+ {
+ global $phpbb_root_path, $phpEx, $user;
+
+ $defaults = $this->config_defaults();
+ $config = new \phpbb\config\config(array_merge($defaults, $new_config));
+
+ $this->phpbb_path_helper = new \phpbb\path_helper(
+ new \phpbb\symfony_request(
+ new phpbb_mock_request()
+ ),
+ new \phpbb\filesystem(),
+ $this->getMock('\phpbb\request\request'),
+ $phpbb_root_path,
+ $phpEx
+ );
+
+ $this->template_path = $this->test_path . '/templates';
+ $this->parent_template_path = $this->test_path . '/parent_templates';
+ $this->template = new phpbb\template\twig\twig($this->phpbb_path_helper, $config, $user, new phpbb\template\context());
+ $this->template->set_custom_style('tests', array($this->template_path, $this->parent_template_path));
+ }
+}
diff --git a/tests/template/templates/basic.html b/tests/template/templates/basic.html
index c1dd690260..e5c6f280fb 100644
--- a/tests/template/templates/basic.html
+++ b/tests/template/templates/basic.html
@@ -16,5 +16,8 @@ fail
<!-- BEGINELSE -->
pass
<!-- END empty -->
+<!-- IF not S_EMPTY -->
+pass
+<!-- ENDIF -->
<!-- DUMMY var -->
diff --git a/tests/template/templates/child_only.css b/tests/template/templates/child_only.css
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/template/templates/child_only.css
diff --git a/tests/template/templates/child_only.html b/tests/template/templates/child_only.html
new file mode 100644
index 0000000000..6121fef5c5
--- /dev/null
+++ b/tests/template/templates/child_only.html
@@ -0,0 +1 @@
+Only in child.
diff --git a/tests/template/templates/child_only.js b/tests/template/templates/child_only.js
new file mode 100644
index 0000000000..542b26526c
--- /dev/null
+++ b/tests/template/templates/child_only.js
@@ -0,0 +1 @@
+// JavaScript file only in a child style.
diff --git a/tests/template/templates/define.html b/tests/template/templates/define.html
index 82237d21a3..276d2ebb99 100644
--- a/tests/template/templates/define.html
+++ b/tests/template/templates/define.html
@@ -2,7 +2,36 @@
{$VALUE}
<!-- DEFINE $VALUE = 'abc' -->
{$VALUE}
+<!-- IF $VALUE != 'abc' -->
+$VALUE != 'abc'
+<!-- ELSEIF $VALUE == 'abc' -->
+$VALUE == 'abc'
+<!-- ENDIF -->
+<!-- IF ($VALUE == 'abc') -->
+($VALUE == 'abc')
+<!-- ENDIF -->
+<!-- IF (($VALUE == 'abc')) -->
+(($VALUE == 'abc'))
+<!-- ENDIF -->
+<!-- IF !$DOESNT_EXIST -->
+!$DOESNT_EXIST
+<!-- ENDIF -->
+<!-- IF (!$DOESNT_EXIST) -->
+(!$DOESNT_EXIST)
+<!-- ENDIF -->
+<!-- INCLUDE define_include.html -->
+{$INCLUDED_VALUE}
+{$VALUE}
<!-- UNDEFINE $VALUE -->
{$VALUE}
-<!-- DEFINE $VALUE -->
-
+<!-- DEFINE $VALUE = 'test!@#$%^&*()_-=+{}[]:;",<.>/?' -->
+{$VALUE}
+<!-- DEFINE $VALUE = '' -->
+[{$VALUE}]
+<!-- DEFINE $TEST -->foobar<!-- ENDDEFINE -->|{$TEST}|
+<!-- DEFINE $VAR = false -->
+<!-- IF $VAR -->
+true
+<!-- ELSE -->
+false
+<!-- ENDIF -->
diff --git a/tests/template/templates/define_advanced.html b/tests/template/templates/define_advanced.html
new file mode 100644
index 0000000000..83467a5b4b
--- /dev/null
+++ b/tests/template/templates/define_advanced.html
@@ -0,0 +1,12 @@
+<!-- DEFINE $VALUE -->
+abc
+<!-- ENDDEFINE -->
+{$VALUE}
+<!-- DEFINE $VALUE1 -->
+bcd
+<!-- ENDDEFINE -->
+<!-- DEFINE $VALUE2 -->
+cde
+<!-- ENDDEFINE -->
+<!-- INCLUDE define_include2.html -->
+{$INCLUDED_VALUE3}
diff --git a/tests/template/templates/define_error.html b/tests/template/templates/define_error.html
new file mode 100644
index 0000000000..72ab1ba033
--- /dev/null
+++ b/tests/template/templates/define_error.html
@@ -0,0 +1,2 @@
+<!-- DEFINE $VAR = foo -->
+{$VAR}
diff --git a/tests/template/templates/define_include.html b/tests/template/templates/define_include.html
new file mode 100644
index 0000000000..9c470c296a
--- /dev/null
+++ b/tests/template/templates/define_include.html
@@ -0,0 +1,3 @@
+{$VALUE}
+<!-- DEFINE $INCLUDED_VALUE = 'bar' -->
+{$INCLUDED_VALUE}
diff --git a/tests/template/templates/define_include2.html b/tests/template/templates/define_include2.html
new file mode 100644
index 0000000000..874f3e1852
--- /dev/null
+++ b/tests/template/templates/define_include2.html
@@ -0,0 +1,11 @@
+<!-- DEFINE $INCLUDED_VALUE1 -->
+zxc
+<!-- ENDDEFINE -->
+<!-- DEFINE $INCLUDED_VALUE2 -->
+qwe
+<!-- ENDDEFINE -->
+{$INCLUDED_VALUE1}
+<!-- DEFINE $INCLUDED_VALUE3 -->
+{$VALUE2}
+{$VALUE1}
+<!-- ENDDEFINE -->
diff --git a/tests/template/templates/events.html b/tests/template/templates/events.html
new file mode 100644
index 0000000000..c44a7469e7
--- /dev/null
+++ b/tests/template/templates/events.html
@@ -0,0 +1,4 @@
+<!-- EVENT child_only -->
+<!-- EVENT parent_only -->
+<!-- EVENT parent_and_child -->
+<!-- EVENT random_event -->
diff --git a/tests/template/templates/expressions.html b/tests/template/templates/expressions.html
index c40d967dab..e1283f165f 100644
--- a/tests/template/templates/expressions.html
+++ b/tests/template/templates/expressions.html
@@ -1,86 +1,57 @@
<!-- IF 10 is even -->pass<!-- ELSE -->fail<!-- ENDIF -->
-
<!-- IF 9 is even -->fail<!-- ELSE -->pass<!-- ENDIF -->
-
<!-- IF not 390 is even -->fail<!-- ELSE -->pass<!-- ENDIF -->
-
<!-- IF 9 is odd -->pass<!-- ELSE -->fail<!-- ENDIF -->
-
<!-- IF 32 is odd -->fail<!-- ELSE -->pass<!-- ENDIF -->
-
<!-- IF 32 is div by 16 -->pass<!-- ELSE -->fail<!-- ENDIF -->
-
<!-- IF 10 is not even -->fail<!-- ELSE -->pass<!-- ENDIF -->
-
<!-- IF 24 == 24 -->pass<!-- ELSE -->fail<!-- ENDIF -->
-
<!-- IF 24 eq 24 -->pass<!-- ELSE -->fail<!-- ENDIF -->
-
<!-- IF ((((((24 == 24)))))) -->pass<!-- ELSE -->fail<!-- ENDIF -->
<!-- IF 24 != 20 -->pass<!-- ELSE -->fail<!-- ENDIF -->
-
<!-- IF 24 <> 20 -->pass<!-- ELSE -->fail<!-- ENDIF -->
-
<!-- IF 24 ne 20 -->pass<!-- ELSE -->fail<!-- ENDIF -->
-
<!-- IF 24 neq 20 -->pass<!-- ELSE -->fail<!-- ENDIF -->
<!-- IF 10 lt 20 -->pass<!-- ELSE -->fail<!-- ENDIF -->
-
<!-- IF 10 < 20 -->pass<!-- ELSE -->fail<!-- ENDIF -->
<!-- IF 10 le 20 -->pass<!-- ELSE -->fail<!-- ENDIF -->
-
<!-- IF 10 lte 20 -->pass<!-- ELSE -->fail<!-- ENDIF -->
-
<!-- IF 10 <= 20 -->pass<!-- ELSE -->fail<!-- ENDIF -->
-
<!-- IF 20 le 20 -->pass<!-- ELSE -->fail<!-- ENDIF -->
-
<!-- IF 20 lte 20 -->pass<!-- ELSE -->fail<!-- ENDIF -->
-
<!-- IF 20 <= 20 -->pass<!-- ELSE -->fail<!-- ENDIF -->
<!-- IF 9 gt 1 -->pass<!-- ELSE -->fail<!-- ENDIF -->
-
<!-- IF 9 > 1 -->pass<!-- ELSE -->fail<!-- ENDIF -->
<!-- IF 9 >= 1 -->pass<!-- ELSE -->fail<!-- ENDIF -->
-
<!-- IF 9 gte 1 -->pass<!-- ELSE -->fail<!-- ENDIF -->
-
<!-- IF 9 ge 1 -->pass<!-- ELSE -->fail<!-- ENDIF -->
-
<!-- IF 9 >= 9 -->pass<!-- ELSE -->fail<!-- ENDIF -->
-
<!-- IF 9 gte 9 -->pass<!-- ELSE -->fail<!-- ENDIF -->
-
<!-- IF 9 ge 9 -->pass<!-- ELSE -->fail<!-- ENDIF -->
<!-- IF true && (10 > 4) -->pass<!-- ELSE -->fail<!-- ENDIF -->
-
<!-- IF true and (10 > 4) -->pass<!-- ELSE -->fail<!-- ENDIF -->
<!-- IF false || true -->pass<!-- ELSE -->fail<!-- ENDIF -->
-
<!-- IF false or true -->pass<!-- ELSE -->fail<!-- ENDIF -->
<!-- IF !false -->pass<!-- ELSE -->fail<!-- ENDIF -->
-
<!-- IF not false -->pass<!-- ELSE -->fail<!-- ENDIF -->
-
<!-- IF not not not false -->pass<!-- ELSE -->fail<!-- ENDIF -->
<!-- IF 6 % 4 == 2 -->pass<!-- ELSE -->fail<!-- ENDIF -->
-
<!-- IF 24 mod 12 == 0 -->pass<!-- ELSE -->fail<!-- ENDIF -->
diff --git a/tests/template/templates/if.html b/tests/template/templates/if.html
index c502e52f51..71312f994c 100644
--- a/tests/template/templates/if.html
+++ b/tests/template/templates/if.html
@@ -2,10 +2,24 @@
1
<!-- ELSEIF S_OTHER_VALUE -->
2
+<!-- ELSE IF S_OTHER_OTHER_VALUE -->
+|S_OTHER_OTHER_VALUE|
<!-- ELSE -->
-0
+03
<!-- ENDIF -->
-<!-- IF (S_VALUE > S_OTHER_VALUE) -->
-0
+<!-- IF S_VALUE and S_OTHER_VALUE and (S_VALUE > S_OTHER_VALUE) -->
+04
+<!-- ENDIF -->
+
+<!-- IF S_TEST === false -->
+false
+<!-- ENDIF -->
+
+<!-- IF S_TEST !== false -->
+!false
+<!-- ENDIF -->
+
+<!-- IF VALUE_TEST is defined -->
+{VALUE_TEST}
<!-- ENDIF -->
diff --git a/tests/template/templates/if_nested_tags.html b/tests/template/templates/if_nested_tags.html
new file mode 100644
index 0000000000..0348a31a8d
--- /dev/null
+++ b/tests/template/templates/if_nested_tags.html
@@ -0,0 +1 @@
+<!-- IF S_VALUE --><!-- DEFINE $INNER_VALUE = 'inner_value' --><!-- ENDIF -->{$INNER_VALUE}
diff --git a/tests/template/templates/include_define_variable.html b/tests/template/templates/include_define_variable.html
index aff9b574c2..6052657c97 100644
--- a/tests/template/templates/include_define_variable.html
+++ b/tests/template/templates/include_define_variable.html
@@ -1,2 +1,8 @@
<!-- DEFINE $DEF = '{VARIABLE}' -->
<!-- INCLUDE {$DEF} -->
+
+<!-- DEFINE $DEF_WITH_UNDERSCORES = '{VARIABLE}' -->
+<!-- INCLUDE {$DEF_WITH_UNDERSCORES} -->
+
+<!-- DEFINE $DEF123 = '{VARIABLE}' -->
+<!-- INCLUDE {$DEF123} -->
diff --git a/tests/template/templates/include_loop.html b/tests/template/templates/include_loop.html
new file mode 100644
index 0000000000..5cad34b363
--- /dev/null
+++ b/tests/template/templates/include_loop.html
@@ -0,0 +1,4 @@
+<!-- BEGIN test_loop -->
+<!-- INCLUDE {test_loop.NESTED_FILE} -->
+<!-- BEGIN inner -->_<!-- INCLUDE {test_loop.inner.NESTED_FILE} --><!-- END inner -->
+<!-- END test_loop -->
diff --git a/tests/template/templates/include_loop1.html b/tests/template/templates/include_loop1.html
new file mode 100644
index 0000000000..d00491fd7e
--- /dev/null
+++ b/tests/template/templates/include_loop1.html
@@ -0,0 +1 @@
+1
diff --git a/tests/template/templates/include_loop2.html b/tests/template/templates/include_loop2.html
new file mode 100644
index 0000000000..9e22bcb8e3
--- /dev/null
+++ b/tests/template/templates/include_loop2.html
@@ -0,0 +1 @@
+02
diff --git a/tests/template/templates/include_loop3.html b/tests/template/templates/include_loop3.html
new file mode 100644
index 0000000000..00750edc07
--- /dev/null
+++ b/tests/template/templates/include_loop3.html
@@ -0,0 +1 @@
+3
diff --git a/tests/template/templates/include_loop_define.html b/tests/template/templates/include_loop_define.html
index f539b21396..4bab09422e 100644
--- a/tests/template/templates/include_loop_define.html
+++ b/tests/template/templates/include_loop_define.html
@@ -1,4 +1,4 @@
-<!-- BEGIN loop -->
-<!-- DEFINE $DEF = '{loop.NESTED_FILE}' -->
+<!-- BEGIN test_loop -->
+<!-- DEFINE $DEF = '{test_loop.NESTED_FILE}' -->
<!-- INCLUDE {$DEF} -->
-<!-- END loop -->
+<!-- END test_loop -->
diff --git a/tests/template/templates/include_variable.html b/tests/template/templates/include_variable.html
new file mode 100644
index 0000000000..b907e0b44f
--- /dev/null
+++ b/tests/template/templates/include_variable.html
@@ -0,0 +1 @@
+<!-- INCLUDE {FILE} -->
diff --git a/tests/template/templates/include_variables.html b/tests/template/templates/include_variables.html
new file mode 100644
index 0000000000..8371a061b5
--- /dev/null
+++ b/tests/template/templates/include_variables.html
@@ -0,0 +1 @@
+<!-- INCLUDE {SUBDIR}/variable.html -->
diff --git a/tests/template/templates/includecss.html b/tests/template/templates/includecss.html
new file mode 100644
index 0000000000..23e3c426d7
--- /dev/null
+++ b/tests/template/templates/includecss.html
@@ -0,0 +1,10 @@
+<!-- IF TEST === 1 -->
+ <!-- INCLUDECSS child_only.css -->
+<!-- ELSEIF TEST === 2 -->
+ <!-- INCLUDECSS parent_only.css -->
+<!-- ELSEIF TEST === 3 -->
+ <!-- INCLUDECSS @include_css/test.css -->
+<!-- ELSEIF TEST === 4 -->
+ <!-- INCLUDECSS @include_css/child_only.css -->
+<!-- ENDIF -->
+{$STYLESHEETS}
diff --git a/tests/template/templates/includejs.html b/tests/template/templates/includejs.html
new file mode 100644
index 0000000000..0bcdf1a815
--- /dev/null
+++ b/tests/template/templates/includejs.html
@@ -0,0 +1,36 @@
+<!-- IF TEST === 1 -->
+ <!-- INCLUDEJS parent_and_child.js -->
+<!-- ELSEIF TEST === 2 -->
+ <!-- INCLUDEJS parent_and_child.js?assets_version=0 -->
+<!-- ELSEIF TEST === 3 -->
+ <!-- INCLUDEJS parent_and_child.js?test=1&assets_version=0 -->
+<!-- ELSEIF TEST === 4 -->
+ <!-- INCLUDEJS parent_and_child.js?test=1&amp;assets_version=0 -->
+<!-- ELSEIF TEST === 6 -->
+ <!-- INCLUDEJS {PARENT} -->
+<!-- ELSEIF TEST === 7 -->
+ <!-- DEFINE $TEST = 'child_only.js' -->
+ <!-- INCLUDEJS {$TEST} -->
+<!-- ELSEIF TEST === 8 -->
+ <!-- INCLUDEJS subdir/{PARENT} -->
+<!-- ELSEIF TEST === 9 -->
+ <!-- INCLUDEJS {SUBDIR}/subsubdir/{PARENT} -->
+<!-- ELSEIF TEST === 10 -->
+ <!-- INCLUDEJS {SUBDIR}/parent_only.{EXT} -->
+<!-- ELSEIF TEST === 11 -->
+ <!-- DEFINE $TEST = 'child_only.js?test1=1&amp;test2=2#test3' -->
+ <!-- INCLUDEJS {$TEST} -->
+<!-- ELSEIF TEST === 12 -->
+ <!-- INCLUDEJS parent_only.js?test1=1&amp;test2=2#test3 -->
+<!-- ELSEIF TEST === 14 -->
+ <!-- INCLUDEJS parent_only.js?test1=&quot;#test3 -->
+<!-- ELSEIF TEST === 15 -->
+ <!-- INCLUDEJS http://phpbb.com/b.js?c=d#f -->
+<!-- ELSEIF TEST === 16 -->
+ <!-- INCLUDEJS http://phpbb.com/b.js?c=d&assets_version=2#f -->
+<!-- ELSEIF TEST === 17 -->
+ <!-- INCLUDEJS //phpbb.com/b.js -->
+<!-- ELSEIF TEST === 18 -->
+ <!-- INCLUDEJS parent_and_child.js?test=1&test2=0 -->
+<!-- ENDIF -->
+{$SCRIPTS}
diff --git a/tests/template/templates/includephp.html b/tests/template/templates/includephp.html
deleted file mode 100644
index 70ebdac0d0..0000000000
--- a/tests/template/templates/includephp.html
+++ /dev/null
@@ -1 +0,0 @@
-<!-- INCLUDEPHP ../tests/template/templates/_dummy_include.php.inc -->
diff --git a/tests/template/templates/includephp_relative.html b/tests/template/templates/includephp_relative.html
new file mode 100644
index 0000000000..297c9efcb0
--- /dev/null
+++ b/tests/template/templates/includephp_relative.html
@@ -0,0 +1,2 @@
+Path is relative to board root.
+<!-- INCLUDEPHP ../tests/template/templates/_dummy_include.php.inc -->
diff --git a/tests/template/templates/includephp_variables.html b/tests/template/templates/includephp_variables.html
new file mode 100644
index 0000000000..6106efc86a
--- /dev/null
+++ b/tests/template/templates/includephp_variables.html
@@ -0,0 +1,2 @@
+Path includes variables.
+<!-- INCLUDEPHP ../tests/template/{TEMPLATES}/_dummy_include.php.inc -->
diff --git a/tests/template/templates/invalid/endif_without_if.html b/tests/template/templates/invalid/endif_without_if.html
new file mode 100644
index 0000000000..e371ffd150
--- /dev/null
+++ b/tests/template/templates/invalid/endif_without_if.html
@@ -0,0 +1 @@
+<!-- ENDIF -->
diff --git a/tests/template/templates/invalid/output/endif_without_if.html b/tests/template/templates/invalid/output/endif_without_if.html
new file mode 100644
index 0000000000..5f2239c964
--- /dev/null
+++ b/tests/template/templates/invalid/output/endif_without_if.html
@@ -0,0 +1 @@
+Parse error (fatal, destroys php runtime).
diff --git a/tests/template/templates/invalid/output/include_nonexistent_file.html b/tests/template/templates/invalid/output/include_nonexistent_file.html
new file mode 100644
index 0000000000..8a118d2713
--- /dev/null
+++ b/tests/template/templates/invalid/output/include_nonexistent_file.html
@@ -0,0 +1 @@
+style resource locator: File for handle nonexistent.html does not exist. Could not find:
diff --git a/tests/template/templates/invalid/output/unknown_tag.html b/tests/template/templates/invalid/output/unknown_tag.html
new file mode 100644
index 0000000000..1489e5e31a
--- /dev/null
+++ b/tests/template/templates/invalid/output/unknown_tag.html
@@ -0,0 +1 @@
+<!-- UNKNOWNTAG variable.html -->
diff --git a/tests/template/templates/lang.html b/tests/template/templates/lang.html
index 2b5ea1cafe..3eecc298cb 100644
--- a/tests/template/templates/lang.html
+++ b/tests/template/templates/lang.html
@@ -1,3 +1,5 @@
{L_VARIABLE}
+{L_1_VARIABLE}
{LA_VARIABLE}
+{LA_1_VARIABLE}
diff --git a/tests/template/templates/loop.html b/tests/template/templates/loop.html
index de1a10004d..f541e934df 100644
--- a/tests/template/templates/loop.html
+++ b/tests/template/templates/loop.html
@@ -1,21 +1,21 @@
-<!-- BEGIN loop -->
+<!-- BEGIN test_loop -->
loop
<!-- BEGINELSE -->
noloop
-<!-- END loop -->
+<!-- END test_loop -->
-<!-- IF .loop -->
+<!-- IF .test_loop -->
loop
<!-- ELSE -->
noloop
<!-- ENDIF -->
-<!-- IF .loop == 2 -->
+<!-- IF .test_loop == 2 -->
loop
<!-- ENDIF -->
-<!-- BEGIN loop -->
+<!-- BEGIN test_loop -->
<!-- BEGIN !block -->
-loop#{loop.S_ROW_COUNT}-block#{block.S_ROW_COUNT}
+loop#{test_loop.S_ROW_COUNT}-block#{block.S_ROW_COUNT}
<!-- END !block -->
-<!-- END loop -->
+<!-- END test_loop -->
diff --git a/tests/template/templates/loop_advanced.html b/tests/template/templates/loop_advanced.html
index c75fe55f03..1f56686eaa 100644
--- a/tests/template/templates/loop_advanced.html
+++ b/tests/template/templates/loop_advanced.html
@@ -1,19 +1,19 @@
-<!-- BEGIN loop -->{loop.S_FIRST_ROW}{loop.S_ROW_COUNT}{loop.S_LAST_ROW}<!-- END loop -->
+<!-- BEGIN test_loop -->{test_loop.S_FIRST_ROW}{test_loop.S_ROW_COUNT}{test_loop.S_LAST_ROW}<!-- END test_loop -->
x
-<!-- BEGIN loop(0) -->{loop.S_FIRST_ROW}{loop.S_ROW_COUNT}{loop.S_LAST_ROW}<!-- END loop -->
+<!-- BEGIN test_loop(0) -->{test_loop.S_FIRST_ROW}{test_loop.S_ROW_COUNT}{test_loop.S_LAST_ROW}<!-- END test_loop -->
x
-<!-- BEGIN loop(0,-1) -->{loop.S_FIRST_ROW}{loop.S_ROW_COUNT}{loop.S_LAST_ROW}<!-- END loop -->
+<!-- BEGIN test_loop(0,-1) -->{test_loop.S_FIRST_ROW}{test_loop.S_ROW_COUNT}{test_loop.S_LAST_ROW}<!-- END test_loop -->
x
-<!-- BEGIN loop(1) -->{loop.S_FIRST_ROW}{loop.S_ROW_COUNT}{loop.S_LAST_ROW}<!-- END loop -->
+<!-- BEGIN test_loop(1) -->{test_loop.S_FIRST_ROW}{test_loop.S_ROW_COUNT}{test_loop.S_LAST_ROW}<!-- END test_loop -->
x
-<!-- BEGIN loop(1,1) -->{loop.S_FIRST_ROW}{loop.S_ROW_COUNT}{loop.S_LAST_ROW}<!-- END loop -->
+<!-- BEGIN test_loop(1,1) -->{test_loop.S_FIRST_ROW}{test_loop.S_ROW_COUNT}{test_loop.S_LAST_ROW}<!-- END test_loop -->
x
-<!-- BEGIN loop(0,1) -->{loop.S_FIRST_ROW}{loop.S_ROW_COUNT}{loop.S_LAST_ROW}<!-- END loop -->
+<!-- BEGIN test_loop(0,1) -->{test_loop.S_FIRST_ROW}{test_loop.S_ROW_COUNT}{test_loop.S_LAST_ROW}<!-- END test_loop -->
x
-<!-- BEGIN loop(2,4) -->{loop.S_FIRST_ROW}{loop.S_ROW_COUNT}{loop.S_LAST_ROW}<!-- END loop -->
+<!-- BEGIN test_loop(2,4) -->{test_loop.S_FIRST_ROW}{test_loop.S_ROW_COUNT}{test_loop.S_LAST_ROW}<!-- END test_loop -->
x
-<!-- BEGIN loop(0,-7) -->{loop.S_FIRST_ROW}{loop.S_ROW_COUNT}{loop.S_LAST_ROW}<!-- END loop -->
+<!-- BEGIN test_loop(0,-7) -->{test_loop.S_FIRST_ROW}{test_loop.S_ROW_COUNT}{test_loop.S_LAST_ROW}<!-- END test_loop -->
x
-<!-- BEGIN loop(-2,6) -->{loop.S_FIRST_ROW}{loop.S_ROW_COUNT}{loop.S_LAST_ROW}<!-- END loop -->
+<!-- BEGIN test_loop(-2,6) -->{test_loop.S_FIRST_ROW}{test_loop.S_ROW_COUNT}{test_loop.S_LAST_ROW}<!-- END test_loop -->
x
-<!-- BEGIN loop(-2,-1) -->{loop.S_FIRST_ROW}{loop.S_ROW_COUNT}{loop.S_LAST_ROW}<!-- END loop -->
+<!-- BEGIN test_loop(-2,-1) -->{test_loop.S_FIRST_ROW}{test_loop.S_ROW_COUNT}{test_loop.S_LAST_ROW}<!-- END test_loop -->
diff --git a/tests/template/templates/loop_expressions.html b/tests/template/templates/loop_expressions.html
new file mode 100644
index 0000000000..6bff53f388
--- /dev/null
+++ b/tests/template/templates/loop_expressions.html
@@ -0,0 +1,11 @@
+<!-- BEGIN loop -->
+
+<!-- IF loop.S_ROW_NUM is even by 4 -->on<!-- ELSE -->off<!-- ENDIF -->
+
+<!-- END loop -->
+
+<!-- BEGIN loop -->
+
+<!-- IF loop.S_ROW_NUM is odd by 3 -->on<!-- ELSE -->off<!-- ENDIF -->
+
+<!-- END loop -->
diff --git a/tests/template/templates/loop_include.html b/tests/template/templates/loop_include.html
new file mode 100644
index 0000000000..7bbdfc4248
--- /dev/null
+++ b/tests/template/templates/loop_include.html
@@ -0,0 +1,4 @@
+<!-- BEGIN test_loop -->
+{test_loop.foo}
+ <!-- INCLUDE loop_include1.html -->
+<!-- END test_loop -->
diff --git a/tests/template/templates/loop_include1.html b/tests/template/templates/loop_include1.html
new file mode 100644
index 0000000000..851f6e6e75
--- /dev/null
+++ b/tests/template/templates/loop_include1.html
@@ -0,0 +1 @@
+{test_loop.foo}
diff --git a/tests/template/templates/loop_nested.html b/tests/template/templates/loop_nested.html
index 9b251cd453..cf099ecc15 100644
--- a/tests/template/templates/loop_nested.html
+++ b/tests/template/templates/loop_nested.html
@@ -1,8 +1,6 @@
<!-- BEGIN outer -->
- outer - {outer.S_ROW_COUNT}<!-- IF outer.VARIABLE --> - {outer.VARIABLE}<!-- ENDIF -->
-
- <!-- BEGIN middle -->
- middle - {middle.S_ROW_COUNT}<!-- IF middle.VARIABLE --> - {middle.VARIABLE}<!-- ENDIF -->
-
- <!-- END middle -->
+outer - {outer.S_ROW_COUNT}<!-- IF outer.VARIABLE --> - {outer.VARIABLE}<!-- ENDIF --><!-- IF TEST_MORE -->[{outer.S_BLOCK_NAME}|{outer.S_NUM_ROWS}]<!-- ENDIF -->
+<!-- BEGIN middle -->
+middle - {outer.middle.S_ROW_COUNT}<!-- IF outer.middle.VARIABLE --> - {outer.middle.VARIABLE}<!-- ENDIF --><!-- IF TEST_MORE -->[{outer.middle.S_BLOCK_NAME}|{outer.middle.S_NUM_ROWS}]<!-- ENDIF -->
+<!-- END middle -->
<!-- END outer -->
diff --git a/tests/template/templates/loop_nested2.html b/tests/template/templates/loop_nested2.html
new file mode 100644
index 0000000000..3eeeb5e36a
--- /dev/null
+++ b/tests/template/templates/loop_nested2.html
@@ -0,0 +1,6 @@
+<!-- BEGIN outer -->
+o{outer.S_ROW_COUNT}
+<!-- BEGIN middle -->
+m{outer.middle.S_ROW_COUNT}{outer.S_ROW_COUNT}
+<!-- END middle -->
+<!-- END outer -->
diff --git a/tests/template/templates/loop_nested_deep_multilevel_ref.html b/tests/template/templates/loop_nested_deep_multilevel_ref.html
new file mode 100644
index 0000000000..bcc2a7c07b
--- /dev/null
+++ b/tests/template/templates/loop_nested_deep_multilevel_ref.html
@@ -0,0 +1,13 @@
+top-level content
+<!-- BEGIN outer -->
+ outer
+ <!-- BEGIN middle -->
+ {outer.middle.S_BLOCK_NAME}
+ <!-- BEGIN inner -->
+ inner {inner.VARIABLE}
+ <!-- IF outer.middle.inner.S_FIRST_ROW -->
+ first row of {outer.middle.inner.S_NUM_ROWS} in {middle.inner.S_BLOCK_NAME}
+ <!-- ENDIF -->
+ <!-- END inner -->
+ <!-- END middle -->
+<!-- END outer -->
diff --git a/tests/template/templates/loop_nested_include.html b/tests/template/templates/loop_nested_include.html
new file mode 100644
index 0000000000..eaad46cc5b
--- /dev/null
+++ b/tests/template/templates/loop_nested_include.html
@@ -0,0 +1,4 @@
+<!-- BEGIN test_loop -->
+[{test_loop.foo}
+ |<!-- INCLUDE loop_nested_include1.html -->]
+<!-- END test_loop -->
diff --git a/tests/template/templates/loop_nested_include1.html b/tests/template/templates/loop_nested_include1.html
new file mode 100644
index 0000000000..88efffc99c
--- /dev/null
+++ b/tests/template/templates/loop_nested_include1.html
@@ -0,0 +1,5 @@
+[{test_loop.foo}|
+<!-- BEGIN test_loop.inner -->
+[{test_loop.foo}|
+{test_loop.inner.myinner}]
+<!-- END test_loop.inner -->]
diff --git a/tests/template/templates/loop_nested_multilevel_ref.html b/tests/template/templates/loop_nested_multilevel_ref.html
new file mode 100644
index 0000000000..f2f1c746ed
--- /dev/null
+++ b/tests/template/templates/loop_nested_multilevel_ref.html
@@ -0,0 +1,10 @@
+top-level content
+<!-- BEGIN outer -->
+ outer {outer.VARIABLE}
+ <!-- BEGIN inner -->
+ inner {inner.VARIABLE}
+ <!-- IF outer.inner.S_FIRST_ROW -->
+ first row
+ <!-- ENDIF -->
+ <!-- END inner -->
+<!-- END outer -->
diff --git a/tests/template/templates/loop_reuse.html b/tests/template/templates/loop_reuse.html
new file mode 100644
index 0000000000..bd0354ae6f
--- /dev/null
+++ b/tests/template/templates/loop_reuse.html
@@ -0,0 +1,6 @@
+<!-- BEGIN one -->
+ {one.VAR}
+ <!-- BEGIN one -->
+ {one.one.VAR}
+ <!-- END one -->
+<!-- END one -->
diff --git a/tests/template/templates/loop_size.html b/tests/template/templates/loop_size.html
new file mode 100644
index 0000000000..2b1fcd2dd4
--- /dev/null
+++ b/tests/template/templates/loop_size.html
@@ -0,0 +1,39 @@
+<!-- IF .nonexistent_loop -->
+ nonexistent
+<!-- ENDIF -->
+
+<!-- IF .nonexistent_loop == 0 -->
+ nonexistent = 0
+<!-- ENDIF -->
+
+<!-- IF ! .nonexistent_loop -->
+ ! nonexistent
+<!-- ENDIF -->
+
+<!-- IF .empty_loop -->
+ empty
+<!-- ENDIF -->
+
+<!-- IF .empty_loop == 0 -->
+ empty = 0
+<!-- ENDIF -->
+
+<!-- IF ! .empty_loop -->
+ ! empty
+<!-- ENDIF -->
+
+<!-- IF .test_loop -->
+ loop
+<!-- ENDIF -->
+
+<!-- IF .test_loop == 0 -->
+ loop = 0
+<!-- ENDIF -->
+
+<!-- IF ! .test_loop -->
+ ! loop
+<!-- ENDIF -->
+
+<!-- BEGIN test_loop -->
+ in loop
+<!-- END test_loop -->
diff --git a/tests/template/templates/loop_underscore.html b/tests/template/templates/loop_underscore.html
new file mode 100644
index 0000000000..4001007868
--- /dev/null
+++ b/tests/template/templates/loop_underscore.html
@@ -0,0 +1,21 @@
+<!-- BEGIN _underscore_loop -->
+loop
+<!-- BEGINELSE -->
+noloop
+<!-- END _underscore_loop -->
+
+<!-- IF ._underscore_loop -->
+loop
+<!-- ELSE -->
+noloop
+<!-- ENDIF -->
+
+<!-- IF ._underscore_loop == 2 -->
+loop
+<!-- ENDIF -->
+
+<!-- BEGIN _underscore_loop -->
+<!-- BEGIN !block -->
+loop#{loop.S_ROW_COUNT}-block#{block.S_ROW_COUNT}
+<!-- END !block -->
+<!-- END _underscore_loop -->
diff --git a/tests/template/templates/loop_vars.html b/tests/template/templates/loop_vars.html
index 4f02fd2e6c..70a3eb2cec 100644
--- a/tests/template/templates/loop_vars.html
+++ b/tests/template/templates/loop_vars.html
@@ -1,21 +1,13 @@
-<!-- BEGIN loop -->
-<!-- IF loop.S_FIRST_ROW -->first<!-- ENDIF -->
-
-{loop.S_ROW_COUNT}
-
-{loop.VARIABLE}
-
-<!-- IF loop.VARIABLE -->set<!-- ENDIF -->
-
-<!-- IF loop.S_LAST_ROW -->
+<!-- BEGIN test_loop -->
+<!-- IF test_loop.S_FIRST_ROW -->first<!-- ENDIF -->
+{test_loop.S_ROW_NUM} - a
+{test_loop.VARIABLE} - b
+<!-- IF test_loop.VARIABLE -->set<!-- ENDIF -->
+<!-- IF test_loop.S_LAST_ROW -->
last
<!-- ENDIF -->
<!-- BEGIN inner -->
-
-{inner.S_ROW_COUNT}
-
-<!-- IF inner.S_LAST_ROW and inner.S_ROW_COUNT and inner.S_NUM_ROWS -->last inner<!-- ENDIF -->
-
+{test_loop.inner.S_ROW_NUM} - c
+<!-- IF test_loop.inner.S_LAST_ROW and test_loop.inner.S_ROW_COUNT and test_loop.inner.S_NUM_ROWS -->last inner<!-- ENDIF -->
<!-- END inner -->
-<!-- END loop -->
-<!-- IF .loop.inner -->inner loop<!-- ENDIF -->
+<!-- END test_loop -->
diff --git a/tests/template/templates/parent_and_child.html b/tests/template/templates/parent_and_child.html
new file mode 100644
index 0000000000..16223d91e7
--- /dev/null
+++ b/tests/template/templates/parent_and_child.html
@@ -0,0 +1 @@
+Child template.
diff --git a/tests/template/templates/parent_and_child.js b/tests/template/templates/parent_and_child.js
new file mode 100644
index 0000000000..d544d94d83
--- /dev/null
+++ b/tests/template/templates/parent_and_child.js
@@ -0,0 +1 @@
+// JavaScript file in a child style.
diff --git a/tests/template/templates/subdir/parent_only.js b/tests/template/templates/subdir/parent_only.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/template/templates/subdir/parent_only.js
diff --git a/tests/template/templates/subdir/subsubdir/parent_only.js b/tests/template/templates/subdir/subsubdir/parent_only.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/template/templates/subdir/subsubdir/parent_only.js
diff --git a/tests/template/templates/subdir/variable.html b/tests/template/templates/subdir/variable.html
new file mode 100644
index 0000000000..f68f91597c
--- /dev/null
+++ b/tests/template/templates/subdir/variable.html
@@ -0,0 +1 @@
+{VARIABLE}
diff --git a/tests/template/templates/trivial.html b/tests/template/templates/trivial.html
new file mode 100644
index 0000000000..3a1c1c5324
--- /dev/null
+++ b/tests/template/templates/trivial.html
@@ -0,0 +1 @@
+This is a trivial template.
diff --git a/tests/template/templates/twig.html b/tests/template/templates/twig.html
new file mode 100644
index 0000000000..17b94ad8d4
--- /dev/null
+++ b/tests/template/templates/twig.html
@@ -0,0 +1,6 @@
+<!-- EXTENDS "twig_parent.html" -->
+
+<!-- BLOCK overwritten -->
+3{VARIABLE|upper}|{VARIABLE|lower}
+<!-- ENDBLOCK -->
+
diff --git a/tests/template/templates/twig_parent.html b/tests/template/templates/twig_parent.html
new file mode 100644
index 0000000000..e9863221e1
--- /dev/null
+++ b/tests/template/templates/twig_parent.html
@@ -0,0 +1,7 @@
+<!-- BLOCK notoverwritten -->
+1
+<!-- ENDBLOCK -->
+
+<!-- BLOCK overwritten -->
+2
+<!-- ENDBLOCK -->
diff --git a/tests/template/templates/variable_spacing.html b/tests/template/templates/variable_spacing.html
new file mode 100644
index 0000000000..028f8aa0d1
--- /dev/null
+++ b/tests/template/templates/variable_spacing.html
@@ -0,0 +1,6 @@
+|{VARIABLE}|
+{VARIABLE}|{VARIABLE}|
+
+|{VARIABLE}
+
+<div class="{VARIABLE}">test</div>
diff --git a/tests/test_framework/phpbb_database_connection_odbc_pdo_wrapper.php b/tests/test_framework/phpbb_database_connection_odbc_pdo_wrapper.php
index ec59fa3886..db31edc984 100644
--- a/tests/test_framework/phpbb_database_connection_odbc_pdo_wrapper.php
+++ b/tests/test_framework/phpbb_database_connection_odbc_pdo_wrapper.php
@@ -1,9 +1,13 @@
<?php
/**
*
-* @package testing
-* @copyright (c) 2011 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -21,7 +25,7 @@ if (!class_exists('PDO'))
*/
class phpbb_database_connection_odbc_pdo_wrapper extends PDO
{
- // Name of the driver being used (i.e. mssql, firebird)
+ // Name of the driver being used (i.e. mssql)
public $driver = '';
// Version number of driver since PDO::getAttribute(PDO::ATTR_CLIENT_VERSION) is pretty useless for this
diff --git a/tests/test_framework/phpbb_database_test_case.php b/tests/test_framework/phpbb_database_test_case.php
index 28d3a716f0..fc1a3632f4 100644
--- a/tests/test_framework/phpbb_database_test_case.php
+++ b/tests/test_framework/phpbb_database_test_case.php
@@ -1,9 +1,13 @@
<?php
/**
*
-* @package testing
-* @copyright (c) 2008 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -17,6 +21,12 @@ abstract class phpbb_database_test_case extends PHPUnit_Extensions_Database_Test
protected $fixture_xml_data;
+ static protected $schema_file;
+
+ static protected $phpbb_schema_copy;
+
+ static protected $install_schema_file;
+
public function __construct($name = NULL, array $data = array(), $dataName = '')
{
parent::__construct($name, $data, $dataName);
@@ -34,6 +44,58 @@ abstract class phpbb_database_test_case extends PHPUnit_Extensions_Database_Test
$this->db_connections = array();
}
+ /**
+ * @return array List of extensions that should be set up
+ */
+ static protected function setup_extensions()
+ {
+ return array();
+ }
+
+ static public function setUpBeforeClass()
+ {
+ global $phpbb_root_path, $phpEx;
+
+ $setup_extensions = static::setup_extensions();
+
+ $finder = new \phpbb\finder(new \phpbb\filesystem(), $phpbb_root_path, null, $phpEx);
+ $finder->core_path('phpbb/db/migration/data/');
+ if (!empty($setup_extensions))
+ {
+ $finder->set_extensions($setup_extensions)
+ ->extension_directory('/migrations');
+ }
+ $classes = $finder->get_classes();
+
+ $schema_sha1 = sha1(serialize($classes));
+ self::$schema_file = __DIR__ . '/../tmp/' . $schema_sha1 . '.json';
+ self::$install_schema_file = __DIR__ . '/../../phpBB/install/schemas/schema.json';
+
+ if (!file_exists(self::$schema_file))
+ {
+
+ global $table_prefix;
+
+ $db = new \phpbb\db\driver\sqlite();
+ $schema_generator = new \phpbb\db\migration\schema_generator($classes, new \phpbb\config\config(array()), $db, new \phpbb\db\tools($db, true), $phpbb_root_path, $phpEx, $table_prefix);
+ file_put_contents(self::$schema_file, json_encode($schema_generator->get_schema()));
+ }
+
+ copy(self::$schema_file, self::$install_schema_file);
+
+ parent::setUpBeforeClass();
+ }
+
+ static public function tearDownAfterClass()
+ {
+ if (file_exists(self::$install_schema_file))
+ {
+ unlink(self::$install_schema_file);
+ }
+
+ parent::tearDownAfterClass();
+ }
+
protected function tearDown()
{
parent::tearDown();
@@ -79,25 +141,7 @@ abstract class phpbb_database_test_case extends PHPUnit_Extensions_Database_Test
public function createXMLDataSet($path)
{
- $db_config = $this->get_database_config();
-
- // Firebird requires table and column names to be uppercase
- if ($db_config['dbms'] == 'firebird')
- {
- $xml_data = file_get_contents($path);
- $xml_data = preg_replace_callback('/(?:(<table name="))([a-z_]+)(?:(">))/', 'phpbb_database_test_case::to_upper', $xml_data);
- $xml_data = preg_replace_callback('/(?:(<column>))([a-z_]+)(?:(<\/column>))/', 'phpbb_database_test_case::to_upper', $xml_data);
-
- $new_fixture = tmpfile();
- fwrite($new_fixture, $xml_data);
- fseek($new_fixture, 0);
-
- $meta_data = stream_get_meta_data($new_fixture);
- $path = $meta_data['uri'];
- }
-
$this->fixture_xml_data = parent::createXMLDataSet($path);
-
return $this->fixture_xml_data;
}
@@ -138,7 +182,7 @@ abstract class phpbb_database_test_case extends PHPUnit_Extensions_Database_Test
if (!self::$already_connected)
{
- $manager->load_schema();
+ $manager->load_schema($this->new_dbal());
self::$already_connected = true;
}
@@ -147,13 +191,9 @@ abstract class phpbb_database_test_case extends PHPUnit_Extensions_Database_Test
public function new_dbal()
{
- global $phpbb_root_path, $phpEx;
-
$config = $this->get_database_config();
- require_once dirname(__FILE__) . '/../../phpBB/includes/db/' . $config['dbms'] . '.php';
- $dbal = 'dbal_' . $config['dbms'];
- $db = new $dbal();
+ $db = new $config['dbms']();
$db->sql_connect($config['dbhost'], $config['dbuser'], $config['dbpasswd'], $config['dbname'], $config['dbport']);
$this->db_connections[] = $db;
@@ -182,16 +222,19 @@ abstract class phpbb_database_test_case extends PHPUnit_Extensions_Database_Test
return new phpbb_database_test_connection_manager($config);
}
- /**
- * Converts a match in the middle of a string to uppercase.
- * This is necessary for transforming the fixture information for Firebird tests
- *
- * @param $matches The array of matches from a regular expression
- *
- * @return string The string with the specified match converted to uppercase
- */
- static public function to_upper($matches)
+ public function assert_array_content_equals($one, $two)
{
- return $matches[1] . strtoupper($matches[2]) . $matches[3];
+ // http://stackoverflow.com/questions/3838288/phpunit-assert-two-arrays-are-equal-but-order-of-elements-not-important
+ // but one array_diff is not enough!
+ if (sizeof(array_diff($one, $two)) || sizeof(array_diff($two, $one)))
+ {
+ // get a nice error message
+ $this->assertEquals($one, $two);
+ }
+ else
+ {
+ // increase assertion count
+ $this->assertTrue(true);
+ }
}
}
diff --git a/tests/test_framework/phpbb_database_test_connection_manager.php b/tests/test_framework/phpbb_database_test_connection_manager.php
index 30f1fa6589..3b5bab749e 100644
--- a/tests/test_framework/phpbb_database_test_connection_manager.php
+++ b/tests/test_framework/phpbb_database_test_connection_manager.php
@@ -1,9 +1,13 @@
<?php
/**
*
-* @package testing
-* @copyright (c) 2011 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -12,8 +16,11 @@ require_once dirname(__FILE__) . '/phpbb_database_connection_odbc_pdo_wrapper.ph
class phpbb_database_test_connection_manager
{
+ /** @var array */
private $config;
+ /** @var array */
private $dbms;
+ /** @var \PDO */
private $pdo;
/**
@@ -50,6 +57,7 @@ class phpbb_database_test_connection_manager
switch ($this->dbms['PDO'])
{
case 'sqlite2':
+ case 'sqlite': // SQLite3 driver
$dsn .= $this->config['dbhost'];
break;
@@ -77,11 +85,18 @@ class phpbb_database_test_connection_manager
break;
default:
- $dsn .= 'host=' . $this->config['dbhost'];
-
- if ($this->config['dbport'])
+ if (!empty($this->config['dbport']) && !is_numeric($this->config['dbport']) && $this->dbms['PDO'] != 'pgsql')
{
- $dsn .= ';port=' . $this->config['dbport'];
+ $dsn .= 'unix_socket=' . $this->config['dbport'];
+ }
+ else
+ {
+ $dsn .= 'host=' . $this->config['dbhost'];
+
+ if ($this->config['dbport'])
+ {
+ $dsn .= ';port=' . $this->config['dbport'];
+ }
}
if ($use_db)
@@ -108,7 +123,7 @@ class phpbb_database_test_connection_manager
// These require different connection strings on the phpBB side than they do in PDO
// so you must provide a DSN string for ODBC separately
- if (!empty($this->config['custom_dsn']) && ($this->config['dbms'] == 'mssql' || $this->config['dbms'] == 'firebird'))
+ if (!empty($this->config['custom_dsn']) && $this->config['dbms'] == 'phpbb\db\driver\mssql')
{
$dsn = 'odbc:' . $this->config['custom_dsn'];
}
@@ -117,19 +132,11 @@ class phpbb_database_test_connection_manager
{
switch ($this->config['dbms'])
{
- case 'mssql':
- case 'mssql_odbc':
+ case 'phpbb\db\driver\mssql':
+ case 'phpbb\db\driver\mssql_odbc':
$this->pdo = new phpbb_database_connection_odbc_pdo_wrapper('mssql', 0, $dsn, $this->config['dbuser'], $this->config['dbpasswd']);
break;
- case 'firebird':
- if (!empty($this->config['custom_dsn']))
- {
- $this->pdo = new phpbb_database_connection_odbc_pdo_wrapper('firebird', 0, $dsn, $this->config['dbuser'], $this->config['dbpasswd']);
- break;
- }
- // Fall through if they're using the firebird PDO driver and not the generic ODBC driver
-
default:
$this->pdo = new PDO($dsn, $this->config['dbuser'], $this->config['dbpasswd']);
break;
@@ -138,15 +145,15 @@ class phpbb_database_test_connection_manager
catch (PDOException $e)
{
$cleaned_dsn = str_replace($this->config['dbpasswd'], '*password*', $dsn);
- throw new Exception("Unable do connect to $cleaned_dsn using PDO with error: {$e->getMessage()}");
+ throw new Exception("Unable to connect to $cleaned_dsn using PDO with error: {$e->getMessage()}");
}
$this->pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
switch ($this->config['dbms'])
{
- case 'mysql':
- case 'mysqli':
+ case 'phpbb\db\driver\mysql':
+ case 'phpbb\db\driver\mysqli':
$this->pdo->exec('SET NAMES utf8');
/*
@@ -169,12 +176,12 @@ class phpbb_database_test_connection_manager
/**
* Load the phpBB database schema into the database
*/
- public function load_schema()
+ public function load_schema($db)
{
$this->ensure_connected(__METHOD__);
$directory = dirname(__FILE__) . '/../../phpBB/install/schemas/';
- $this->load_schema_from_file($directory);
+ $this->load_schema_from_file($directory, $db);
}
/**
@@ -187,8 +194,8 @@ class phpbb_database_test_connection_manager
{
switch ($this->config['dbms'])
{
- case 'sqlite':
- case 'firebird':
+ case 'phpbb\db\driver\sqlite':
+ case 'phpbb\db\driver\sqlite3':
$this->connect();
// Drop all of the tables
foreach ($this->get_tables() as $table)
@@ -198,7 +205,7 @@ class phpbb_database_test_connection_manager
$this->purge_extras();
break;
- case 'oracle':
+ case 'phpbb\db\driver\oracle':
$this->connect();
// Drop all of the tables
foreach ($this->get_tables() as $table)
@@ -208,7 +215,7 @@ class phpbb_database_test_connection_manager
$this->purge_extras();
break;
- case 'postgres':
+ case 'phpbb\db\driver\postgres':
$this->connect();
// Drop all of the tables
foreach ($this->get_tables() as $table)
@@ -258,39 +265,38 @@ class phpbb_database_test_connection_manager
switch ($this->config['dbms'])
{
- case 'mysql':
- case 'mysql4':
- case 'mysqli':
+ case 'phpbb\db\driver\mysql':
+ case 'phpbb\db\driver\mysqli':
$sql = 'SHOW TABLES';
break;
- case 'sqlite':
+ case 'phpbb\db\driver\sqlite':
$sql = 'SELECT name
FROM sqlite_master
WHERE type = "table"';
break;
- case 'mssql':
- case 'mssql_odbc':
- case 'mssqlnative':
+ case 'phpbb\db\driver\sqlite3':
+ $sql = 'SELECT name
+ FROM sqlite_master
+ WHERE type = "table"
+ AND name <> "sqlite_sequence"';
+ break;
+
+ case 'phpbb\db\driver\mssql':
+ case 'phpbb\db\driver\mssql_odbc':
+ case 'phpbb\db\driver\mssqlnative':
$sql = "SELECT name
FROM sysobjects
WHERE type='U'";
break;
- case 'postgres':
+ case 'phpbb\db\driver\postgres':
$sql = 'SELECT relname
FROM pg_stat_user_tables';
break;
- case 'firebird':
- $sql = 'SELECT rdb$relation_name
- FROM rdb$relations
- WHERE rdb$view_source is null
- AND rdb$system_flag = 0';
- break;
-
- case 'oracle':
+ case 'phpbb\db\driver\oracle':
$sql = 'SELECT table_name
FROM USER_TABLES';
break;
@@ -322,11 +328,11 @@ class phpbb_database_test_connection_manager
* Compile the correct schema filename (as per create_schema_files) and
* load it into the database.
*/
- protected function load_schema_from_file($directory)
+ protected function load_schema_from_file($directory, \phpbb\db\driver\driver_interface $db)
{
$schema = $this->dbms['SCHEMA'];
- if ($this->config['dbms'] == 'mysql')
+ if ($this->config['dbms'] == 'phpbb\db\driver\mysql')
{
$sth = $this->pdo->query('SELECT VERSION() AS version');
$row = $sth->fetch(PDO::FETCH_ASSOC);
@@ -343,14 +349,61 @@ class phpbb_database_test_connection_manager
$filename = $directory . $schema . '_schema.sql';
- $queries = file_get_contents($filename);
- $sql = phpbb_remove_comments($queries);
+ if (file_exists($filename))
+ {
+ $queries = file_get_contents($filename);
+ $sql = phpbb_remove_comments($queries);
+
+ $sql = split_sql_file($sql, $this->dbms['DELIM']);
- $sql = split_sql_file($sql, $this->dbms['DELIM']);
+ foreach ($sql as $query)
+ {
+ $this->pdo->exec($query);
+ }
+ }
- foreach ($sql as $query)
+ // Ok we have the db info go ahead and work on building the table
+ if (file_exists($directory . 'schema.json'))
{
- $this->pdo->exec($query);
+ $db_table_schema = file_get_contents($directory . 'schema.json');
+ $db_table_schema = json_decode($db_table_schema, true);
+ }
+ else
+ {
+ global $phpbb_root_path, $phpEx, $table_prefix;
+
+ $finder = new \phpbb\finder(new \phpbb\filesystem(), $phpbb_root_path, null, $phpEx);
+ $classes = $finder->core_path('phpbb/db/migration/data/')
+ ->get_classes();
+
+ $db = new \phpbb\db\driver\sqlite();
+ $schema_generator = new \phpbb\db\migration\schema_generator($classes, new \phpbb\config\config(array()), $db, new \phpbb\db\tools($db, true), $phpbb_root_path, $phpEx, $table_prefix);
+ $db_table_schema = $schema_generator->get_schema();
+ }
+
+ $db_tools = new \phpbb\db\tools($db, true);
+ foreach ($db_table_schema as $table_name => $table_data)
+ {
+ $queries = $db_tools->sql_create_table(
+ $table_name,
+ $table_data
+ );
+
+ foreach ($queries as $query)
+ {
+ if ($query === 'begin')
+ {
+ $this->pdo->beginTransaction();
+ }
+ else if ($query === 'commit')
+ {
+ $this->pdo->commit();
+ }
+ else
+ {
+ $this->pdo->exec($query);
+ }
+ }
}
}
@@ -360,51 +413,51 @@ class phpbb_database_test_connection_manager
protected function get_dbms_data($dbms)
{
$available_dbms = array(
- 'firebird' => array(
- 'SCHEMA' => 'firebird',
- 'DELIM' => ';;',
- 'PDO' => 'firebird',
- ),
- 'mysqli' => array(
+ 'phpbb\db\driver\mysqli' => array(
'SCHEMA' => 'mysql_41',
'DELIM' => ';',
'PDO' => 'mysql',
),
- 'mysql' => array(
+ 'phpbb\db\driver\mysql' => array(
'SCHEMA' => 'mysql',
'DELIM' => ';',
'PDO' => 'mysql',
),
- 'mssql' => array(
+ 'phpbb\db\driver\mssql' => array(
'SCHEMA' => 'mssql',
'DELIM' => 'GO',
'PDO' => 'odbc',
),
- 'mssql_odbc'=> array(
+ 'phpbb\db\driver\mssql_odbc'=> array(
'SCHEMA' => 'mssql',
'DELIM' => 'GO',
'PDO' => 'odbc',
),
- 'mssqlnative' => array(
+ 'phpbb\db\driver\mssqlnative' => array(
'SCHEMA' => 'mssql',
'DELIM' => 'GO',
'PDO' => 'sqlsrv',
),
- 'oracle' => array(
+ 'phpbb\db\driver\oracle' => array(
'SCHEMA' => 'oracle',
'DELIM' => '/',
'PDO' => 'oci',
),
- 'postgres' => array(
+ 'phpbb\db\driver\postgres' => array(
'SCHEMA' => 'postgres',
'DELIM' => ';',
'PDO' => 'pgsql',
),
- 'sqlite' => array(
+ 'phpbb\db\driver\sqlite' => array(
'SCHEMA' => 'sqlite',
'DELIM' => ';',
'PDO' => 'sqlite2',
),
+ 'phpbb\db\driver\sqlite3' => array(
+ 'SCHEMA' => 'sqlite',
+ 'DELIM' => ';',
+ 'PDO' => 'sqlite',
+ ),
);
if (isset($available_dbms[$dbms]))
@@ -429,19 +482,7 @@ class phpbb_database_test_connection_manager
switch ($this->config['dbms'])
{
- case 'firebird':
- $sql = 'SELECT RDB$GENERATOR_NAME
- FROM RDB$GENERATORS
- WHERE RDB$SYSTEM_FLAG = 0';
- $result = $this->pdo->query($sql);
-
- while ($row = $result->fetch(PDO::FETCH_NUM))
- {
- $queries[] = 'DROP GENERATOR ' . current($row);
- }
- break;
-
- case 'oracle':
+ case 'phpbb\db\driver\oracle':
$sql = 'SELECT sequence_name
FROM USER_SEQUENCES';
$result = $this->pdo->query($sql);
@@ -452,7 +493,7 @@ class phpbb_database_test_connection_manager
}
break;
- case 'postgres':
+ case 'phpbb\db\driver\postgres':
$sql = 'SELECT sequence_name
FROM information_schema.sequences';
$result = $this->pdo->query($sql);
@@ -510,7 +551,7 @@ class phpbb_database_test_connection_manager
switch ($this->config['dbms'])
{
- case 'oracle':
+ case 'phpbb\db\driver\oracle':
// Get all of the information about the sequences
$sql = "SELECT t.table_name, tc.column_name, d.referenced_name as sequence_name, s.increment_by, s.min_value
FROM USER_TRIGGERS t
@@ -545,14 +586,14 @@ class phpbb_database_test_connection_manager
* Since we have no objects attached to our sequencers (triggers aren't attached), this works fine.
*/
$queries[] = 'DROP SEQUENCE ' . $row['SEQUENCE_NAME'];
- $queries[] = "CREATE SEQUENCE {$row['SEQUENCE_NAME']}
- MINVALUE {$row['MIN_VALUE']}
- INCREMENT BY {$row['INCREMENT_BY']}
+ $queries[] = "CREATE SEQUENCE {$row['SEQUENCE_NAME']}
+ MINVALUE {$row['MIN_VALUE']}
+ INCREMENT BY {$row['INCREMENT_BY']}
START WITH $max_val";
}
break;
- case 'postgres':
+ case 'phpbb\db\driver\postgres':
// Get the sequences attached to the tables
$sql = 'SELECT column_name, table_name FROM information_schema.columns
WHERE table_name IN (' . implode(', ', $table_names) . ")
@@ -592,6 +633,14 @@ class phpbb_database_test_connection_manager
$queries[] = 'SELECT ' . implode(', ', $setval_queries);
}
break;
+
+ case 'phpbb\db\driver\sqlite3':
+ /**
+ * Just delete all of the sequences. When an insertion occurs, the sequence will be automatically
+ * re-created from the key with the AUTOINCREMENT attribute
+ */
+ $queries[] = 'DELETE FROM sqlite_sequence';
+ break;
}
foreach ($queries as $query)
diff --git a/tests/test_framework/phpbb_functional_test_case.php b/tests/test_framework/phpbb_functional_test_case.php
index 9b64600c7d..8107e45dc7 100644
--- a/tests/test_framework/phpbb_functional_test_case.php
+++ b/tests/test_framework/phpbb_functional_test_case.php
@@ -1,16 +1,18 @@
<?php
/**
*
-* @package testing
-* @copyright (c) 2011 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
use Symfony\Component\BrowserKit\CookieJar;
require_once __DIR__ . '/../../phpBB/includes/functions_install.php';
-require_once __DIR__ . '/../../phpBB/includes/acm/acm_file.php';
-require_once __DIR__ . '/../../phpBB/includes/cache.php';
class phpbb_functional_test_case extends phpbb_test_case
{
@@ -20,6 +22,7 @@ class phpbb_functional_test_case extends phpbb_test_case
protected $cache = null;
protected $db = null;
+ protected $extension_manager = null;
/**
* Session ID for current test's session (each test makes its own)
@@ -35,6 +38,7 @@ class phpbb_functional_test_case extends phpbb_test_case
static protected $config = array();
static protected $already_installed = false;
+ static protected $last_post_timestamp = 0;
static public function setUpBeforeClass()
{
@@ -43,6 +47,12 @@ class phpbb_functional_test_case extends phpbb_test_case
self::$config = phpbb_test_case_helpers::get_test_config();
self::$root_url = self::$config['phpbb_functional_url'];
+ // Important: this is used both for installation and by
+ // test cases for querying the tables.
+ // Therefore table prefix must be set before a board is
+ // installed, and also before each test case is run.
+ self::$config['table_prefix'] = 'phpbb_';
+
if (!isset(self::$config['phpbb_functional_url']))
{
self::markTestSkipped('phpbb_functional_url was not set in test_config and wasn\'t set as PHPBB_FUNCTIONAL_URL environment variable either.');
@@ -55,6 +65,14 @@ class phpbb_functional_test_case extends phpbb_test_case
}
}
+ /**
+ * @return array List of extensions that should be set up
+ */
+ static protected function setup_extensions()
+ {
+ return array();
+ }
+
public function setUp()
{
parent::setUp();
@@ -71,7 +89,36 @@ class phpbb_functional_test_case extends phpbb_test_case
// that were added in other tests are gone
$this->lang = array();
$this->add_lang('common');
- $this->purge_cache();
+
+ $db = $this->get_db();
+
+ foreach (static::setup_extensions() as $extension)
+ {
+ $this->purge_cache();
+
+ $sql = 'SELECT ext_active
+ FROM ' . EXT_TABLE . "
+ WHERE ext_name = '" . $db->sql_escape($extension). "'";
+ $result = $db->sql_query($sql);
+ $status = (bool) $db->sql_fetchfield('ext_active');
+ $db->sql_freeresult($result);
+
+ if (!$status)
+ {
+ $this->install_ext($extension);
+ }
+ }
+ }
+
+ protected function tearDown()
+ {
+ parent::tearDown();
+
+ if ($this->db instanceof \phpbb\db\driver\driver_interface)
+ {
+ // Close the database connections again this test
+ $this->db->sql_close();
+ }
}
/**
@@ -132,18 +179,23 @@ class phpbb_functional_test_case extends phpbb_test_case
{
}
+ public function __construct($name = NULL, array $data = array(), $dataName = '')
+ {
+ parent::__construct($name, $data, $dataName);
+
+ $this->backupStaticAttributesBlacklist += array(
+ 'phpbb_functional_test_case' => array('config', 'already_installed'),
+ );
+ }
+
protected function get_db()
{
global $phpbb_root_path, $phpEx;
// so we don't reopen an open connection
- if (!($this->db instanceof dbal))
+ if (!($this->db instanceof \phpbb\db\driver\driver_interface))
{
- if (!class_exists('dbal_' . self::$config['dbms']))
- {
- include($phpbb_root_path . 'includes/db/' . self::$config['dbms'] . ".$phpEx");
- }
- $sql_db = 'dbal_' . self::$config['dbms'];
- $this->db = new $sql_db();
+ $dbms = self::$config['dbms'];
+ $this->db = new $dbms();
$this->db->sql_connect(self::$config['dbhost'], self::$config['dbuser'], self::$config['dbpasswd'], self::$config['dbname'], self::$config['dbport']);
}
return $this->db;
@@ -153,7 +205,7 @@ class phpbb_functional_test_case extends phpbb_test_case
{
if (!$this->cache)
{
- $this->cache = new cache();
+ $this->cache = new \phpbb\cache\driver\file;
}
return $this->cache;
@@ -168,20 +220,50 @@ class phpbb_functional_test_case extends phpbb_test_case
$cache->load();
}
- public function __construct($name = NULL, array $data = array(), $dataName = '')
+ protected function get_extension_manager()
{
- parent::__construct($name, $data, $dataName);
+ global $phpbb_root_path, $phpEx;
- $this->backupStaticAttributesBlacklist += array(
- 'phpbb_functional_test_case' => array('config', 'already_installed'),
+ $config = new \phpbb\config\config(array());
+ $db = $this->get_db();
+ $db_tools = new \phpbb\db\tools($db);
+
+ $container = new phpbb_mock_container_builder();
+ $migrator = new \phpbb\db\migrator(
+ $container,
+ $config,
+ $db,
+ $db_tools,
+ self::$config['table_prefix'] . 'migrations',
+ $phpbb_root_path,
+ $phpEx,
+ self::$config['table_prefix'],
+ array(),
+ new \phpbb\db\migration\helper()
);
+ $container->set('migrator', $migrator);
+ $container->set('dispatcher', new phpbb_mock_event_dispatcher());
+ $user = new \phpbb\user('\phpbb\datetime');
+
+ $extension_manager = new \phpbb\extension\manager(
+ $container,
+ $db,
+ $config,
+ new phpbb\filesystem(),
+ $user,
+ self::$config['table_prefix'] . 'ext',
+ dirname(__FILE__) . '/',
+ $phpEx,
+ $this->get_cache_driver()
+ );
+
+ return $extension_manager;
}
static protected function install_board()
{
global $phpbb_root_path, $phpEx;
- self::$config['table_prefix'] = 'phpbb_';
self::recreate_database(self::$config);
$config_file = $phpbb_root_path . "config.$phpEx";
@@ -216,7 +298,7 @@ class phpbb_functional_test_case extends phpbb_test_case
$parseURL = parse_url(self::$config['phpbb_functional_url']);
- $crawler = self::request('GET', 'install/index.php?mode=install');
+ $crawler = self::request('GET', 'install/index.php?mode=install&language=en');
self::assertContains('Welcome to Installation', $crawler->filter('#main')->text());
$form = $crawler->selectButton('submit')->form();
@@ -230,7 +312,7 @@ class phpbb_functional_test_case extends phpbb_test_case
self::assertContains('Database configuration', $crawler->filter('#main')->text());
$form = $crawler->selectButton('submit')->form(array(
// Installer uses 3.0-style dbms name
- 'dbms' => str_replace('phpbb_db_driver_', '', self::$config['dbms']),
+ 'dbms' => str_replace('phpbb\db\driver\\', '', self::$config['dbms']),
'dbhost' => self::$config['dbhost'],
'dbport' => self::$config['dbport'],
'dbname' => self::$config['dbname'],
@@ -252,8 +334,7 @@ class phpbb_functional_test_case extends phpbb_test_case
'admin_name' => 'admin',
'admin_pass1' => 'adminadmin',
'admin_pass2' => 'adminadmin',
- 'board_email1' => 'nobody@example.com',
- 'board_email2' => 'nobody@example.com',
+ 'board_email' => 'nobody@example.com',
));
// install/index.php?mode=install&sub=administrator
@@ -265,7 +346,7 @@ class phpbb_functional_test_case extends phpbb_test_case
// because that step will create a config.php file if phpBB has the
// permission to do so. We have to create the config file on our own
// in order to get the DEBUG constants defined.
- $config_php_data = phpbb_create_config_file_data(self::$config, self::$config['dbms'], array(), true, true);
+ $config_php_data = phpbb_create_config_file_data(self::$config, self::$config['dbms'], true, false, true);
$config_created = file_put_contents($config_file, $config_php_data) !== false;
if (!$config_created)
{
@@ -317,6 +398,36 @@ class phpbb_functional_test_case extends phpbb_test_case
copy($config_file, $config_file_test);
}
+ public function install_ext($extension)
+ {
+ $this->login();
+ $this->admin_login();
+
+ $ext_path = str_replace('/', '%2F', $extension);
+
+ $crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=enable_pre&ext_name=' . $ext_path . '&sid=' . $this->sid);
+ $this->assertGreaterThan(0, $crawler->filter('.submit-buttons')->count());
+
+ $form = $crawler->selectButton('Enable')->form();
+ $crawler = self::submit($form);
+ $this->add_lang('acp/extensions');
+
+ $meta_refresh = $crawler->filter('meta[http-equiv="refresh"]');
+
+ // Wait for extension to be fully enabled
+ while (sizeof($meta_refresh))
+ {
+ preg_match('#url=.+/(adm+.+)#', $meta_refresh->attr('content'), $match);
+ $url = $match[1];
+ $crawler = self::request('POST', $url);
+ $meta_refresh = $crawler->filter('meta[http-equiv="refresh"]');
+ }
+
+ $this->assertContainsLang('EXTENSION_ENABLE_SUCCESS', $crawler->filter('div.successbox')->text());
+
+ $this->logout();
+ }
+
static private function recreate_database($config)
{
$db_conn_mgr = new phpbb_database_test_connection_manager($config);
@@ -336,51 +447,67 @@ class phpbb_functional_test_case extends phpbb_test_case
global $phpbb_root_path;
$db = $this->get_db();
- $sql = 'INSERT INTO ' . STYLES_TABLE . ' ' . $db->sql_build_array('INSERT', array(
- 'style_id' => $style_id,
- 'style_name' => $style_path,
- 'style_copyright' => '',
- 'style_active' => 1,
- 'template_id' => $style_id,
- 'theme_id' => $style_id,
- 'imageset_id' => $style_id,
- ));
- $db->sql_query($sql);
-
- $sql = 'INSERT INTO ' . STYLES_IMAGESET_TABLE . ' ' . $db->sql_build_array('INSERT', array(
- 'imageset_id' => $style_id,
- 'imageset_name' => $style_path,
- 'imageset_copyright' => '',
- 'imageset_path' => $style_path,
- ));
- $db->sql_query($sql);
-
- $sql = 'INSERT INTO ' . STYLES_TEMPLATE_TABLE . ' ' . $db->sql_build_array('INSERT', array(
- 'template_id' => $style_id,
- 'template_name' => $style_path,
- 'template_copyright' => '',
- 'template_path' => $style_path,
- 'bbcode_bitfield' => 'kNg=',
- 'template_inherits_id' => $parent_style_id,
- 'template_inherit_path' => $parent_style_path,
- ));
- $db->sql_query($sql);
-
- $sql = 'INSERT INTO ' . STYLES_THEME_TABLE . ' ' . $db->sql_build_array('INSERT', array(
- 'theme_id' => $style_id,
- 'theme_name' => $style_path,
- 'theme_copyright' => '',
- 'theme_path' => $style_path,
- 'theme_storedb' => 0,
- 'theme_mtime' => 0,
- 'theme_data' => '',
- ));
- $db->sql_query($sql);
-
- if ($style_path != 'prosilver' && $style_path != 'subsilver2')
+ if (version_compare(PHPBB_VERSION, '3.1.0-dev', '<'))
+ {
+ $sql = 'INSERT INTO ' . STYLES_TABLE . ' ' . $db->sql_build_array('INSERT', array(
+ 'style_id' => $style_id,
+ 'style_name' => $style_path,
+ 'style_copyright' => '',
+ 'style_active' => 1,
+ 'template_id' => $style_id,
+ 'theme_id' => $style_id,
+ 'imageset_id' => $style_id,
+ ));
+ $db->sql_query($sql);
+
+ $sql = 'INSERT INTO ' . STYLES_IMAGESET_TABLE . ' ' . $db->sql_build_array('INSERT', array(
+ 'imageset_id' => $style_id,
+ 'imageset_name' => $style_path,
+ 'imageset_copyright' => '',
+ 'imageset_path' => $style_path,
+ ));
+ $db->sql_query($sql);
+
+ $sql = 'INSERT INTO ' . STYLES_TEMPLATE_TABLE . ' ' . $db->sql_build_array('INSERT', array(
+ 'template_id' => $style_id,
+ 'template_name' => $style_path,
+ 'template_copyright' => '',
+ 'template_path' => $style_path,
+ 'bbcode_bitfield' => 'kNg=',
+ 'template_inherits_id' => $parent_style_id,
+ 'template_inherit_path' => $parent_style_path,
+ ));
+ $db->sql_query($sql);
+
+ $sql = 'INSERT INTO ' . STYLES_THEME_TABLE . ' ' . $db->sql_build_array('INSERT', array(
+ 'theme_id' => $style_id,
+ 'theme_name' => $style_path,
+ 'theme_copyright' => '',
+ 'theme_path' => $style_path,
+ 'theme_storedb' => 0,
+ 'theme_mtime' => 0,
+ 'theme_data' => '',
+ ));
+ $db->sql_query($sql);
+
+ if ($style_path != 'prosilver' && $style_path != 'subsilver2')
+ {
+ @mkdir($phpbb_root_path . 'styles/' . $style_path, 0777);
+ @mkdir($phpbb_root_path . 'styles/' . $style_path . '/template', 0777);
+ }
+ }
+ else
{
- @mkdir($phpbb_root_path . 'styles/' . $style_path, 0777);
- @mkdir($phpbb_root_path . 'styles/' . $style_path . '/template', 0777);
+ $db->sql_multi_insert(STYLES_TABLE, array(array(
+ 'style_id' => $style_id,
+ 'style_name' => $style_path,
+ 'style_copyright' => '',
+ 'style_active' => 1,
+ 'style_path' => $style_path,
+ 'bbcode_bitfield' => 'kNg=',
+ 'style_parent_id' => $parent_style_id,
+ 'style_parent_tree' => $parent_style_path,
+ )));
}
}
@@ -396,14 +523,17 @@ class phpbb_functional_test_case extends phpbb_test_case
$db = $this->get_db();
$db->sql_query('DELETE FROM ' . STYLES_TABLE . ' WHERE style_id = ' . $style_id);
- $db->sql_query('DELETE FROM ' . STYLES_IMAGESET_TABLE . ' WHERE imageset_id = ' . $style_id);
- $db->sql_query('DELETE FROM ' . STYLES_TEMPLATE_TABLE . ' WHERE template_id = ' . $style_id);
- $db->sql_query('DELETE FROM ' . STYLES_THEME_TABLE . ' WHERE theme_id = ' . $style_id);
-
- if ($style_path != 'prosilver' && $style_path != 'subsilver2')
+ if (version_compare(PHPBB_VERSION, '3.1.0-dev', '<'))
{
- @rmdir($phpbb_root_path . 'styles/' . $style_path . '/template');
- @rmdir($phpbb_root_path . 'styles/' . $style_path);
+ $db->sql_query('DELETE FROM ' . STYLES_IMAGESET_TABLE . ' WHERE imageset_id = ' . $style_id);
+ $db->sql_query('DELETE FROM ' . STYLES_TEMPLATE_TABLE . ' WHERE template_id = ' . $style_id);
+ $db->sql_query('DELETE FROM ' . STYLES_THEME_TABLE . ' WHERE theme_id = ' . $style_id);
+
+ if ($style_path != 'prosilver' && $style_path != 'subsilver2')
+ {
+ @rmdir($phpbb_root_path . 'styles/' . $style_path . '/template');
+ @rmdir($phpbb_root_path . 'styles/' . $style_path);
+ }
}
}
@@ -418,10 +548,7 @@ class phpbb_functional_test_case extends phpbb_test_case
// Required by unique_id
global $config;
- if (!is_array($config))
- {
- $config = array();
- }
+ $config = new \phpbb\config\config(array());
/*
* Add required config entries to the config array to prevent
@@ -436,7 +563,7 @@ class phpbb_functional_test_case extends phpbb_test_case
$config['rand_seed_last_update'] = time() + 600;
// Required by user_add
- global $db, $cache;
+ global $db, $cache, $phpbb_dispatcher, $phpbb_container;
$db = $this->get_db();
if (!function_exists('phpbb_mock_null_cache'))
{
@@ -444,6 +571,12 @@ class phpbb_functional_test_case extends phpbb_test_case
}
$cache = new phpbb_mock_null_cache;
+ $cache_driver = new \phpbb\cache\driver\null();
+ $phpbb_container = new phpbb_mock_container_builder();
+ $phpbb_container->set('cache.driver', $cache_driver);
+ $phpbb_notifications = new phpbb_mock_notification_manager();
+ $phpbb_container->set('notification_manager', $phpbb_notifications);
+
if (!function_exists('utf_clean_string'))
{
require_once(__DIR__ . '/../../phpBB/includes/utf/utf_tools.php');
@@ -452,6 +585,10 @@ class phpbb_functional_test_case extends phpbb_test_case
{
require_once(__DIR__ . '/../../phpBB/includes/functions_user.php');
}
+ set_config(null, null, null, $config);
+ set_config_count(null, null, null, $config);
+ $phpbb_dispatcher = new phpbb_mock_event_dispatcher();
+ $passwords_manager = $this->get_passwords_manager();
$user_row = array(
'username' => $username,
@@ -459,13 +596,94 @@ class phpbb_functional_test_case extends phpbb_test_case
'user_email' => 'nobody@example.com',
'user_type' => 0,
'user_lang' => 'en',
- 'user_timezone' => 0,
- 'user_dateformat' => '',
- 'user_password' => phpbb_hash($username . $username),
+ 'user_timezone' => 'UTC',
+ 'user_dateformat' => 'r',
+ 'user_password' => $passwords_manager->hash($username . $username),
);
return user_add($user_row);
}
+ protected function remove_user_group($group_name, $usernames)
+ {
+ global $db, $cache, $auth, $config, $phpbb_dispatcher, $phpbb_log, $phpbb_container, $phpbb_root_path, $phpEx;
+
+ $config = new \phpbb\config\config(array());
+ $config['coppa_enable'] = 0;
+
+ $db = $this->get_db();
+ $phpbb_dispatcher = new phpbb_mock_event_dispatcher();
+ $user = $this->getMock('\phpbb\user', array(), array('\phpbb\datetime'));
+ $auth = $this->getMock('\phpbb\auth\auth');
+
+ $phpbb_log = new \phpbb\log\log($db, $user, $auth, $phpbb_dispatcher, $phpbb_root_path, 'adm/', $phpEx, LOG_TABLE);
+ $cache = new phpbb_mock_null_cache;
+
+ $cache_driver = new \phpbb\cache\driver\null();
+ $phpbb_container = new phpbb_mock_container_builder();
+ $phpbb_container->set('cache.driver', $cache_driver);
+ $phpbb_container->set('notification_manager', new phpbb_mock_notification_manager());
+
+ if (!function_exists('utf_clean_string'))
+ {
+ require_once(__DIR__ . '/../../phpBB/includes/utf/utf_tools.php');
+ }
+ if (!function_exists('group_user_del'))
+ {
+ require_once(__DIR__ . '/../../phpBB/includes/functions_user.php');
+ }
+
+ $sql = 'SELECT group_id
+ FROM ' . GROUPS_TABLE . "
+ WHERE group_name = '" . $db->sql_escape($group_name) . "'";
+ $result = $db->sql_query($sql);
+ $group_id = (int) $db->sql_fetchfield('group_id');
+ $db->sql_freeresult($result);
+
+ return group_user_del($group_id, false, $usernames, $group_name);
+ }
+
+ protected function add_user_group($group_name, $usernames, $default = false, $leader = false)
+ {
+ global $db, $cache, $auth, $config, $phpbb_dispatcher, $phpbb_log, $phpbb_container, $phpbb_root_path, $phpEx;
+
+ $config = new \phpbb\config\config(array());
+ $config['coppa_enable'] = 0;
+
+ $db = $this->get_db();
+ $phpbb_dispatcher = new phpbb_mock_event_dispatcher();
+ $user = $this->getMock('\phpbb\user', array(), array('\phpbb\datetime'));
+ $auth = $this->getMock('\phpbb\auth\auth');
+
+ $phpbb_log = new \phpbb\log\log($db, $user, $auth, $phpbb_dispatcher, $phpbb_root_path, 'adm/', $phpEx, LOG_TABLE);
+ $cache = new phpbb_mock_null_cache;
+
+ $cache_driver = new \phpbb\cache\driver\null();
+ $phpbb_container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface');
+ $phpbb_container
+ ->expects($this->any())
+ ->method('get')
+ ->with('cache.driver')
+ ->will($this->returnValue($cache_driver));
+
+ if (!function_exists('utf_clean_string'))
+ {
+ require_once(__DIR__ . '/../../phpBB/includes/utf/utf_tools.php');
+ }
+ if (!function_exists('group_user_del'))
+ {
+ require_once(__DIR__ . '/../../phpBB/includes/functions_user.php');
+ }
+
+ $sql = 'SELECT group_id
+ FROM ' . GROUPS_TABLE . "
+ WHERE group_name = '" . $db->sql_escape($group_name) . "'";
+ $result = $db->sql_query($sql);
+ $group_id = (int) $db->sql_fetchfield('group_id');
+ $db->sql_freeresult($result);
+
+ return group_user_add($group_id, false, $usernames, $group_name, $default, $leader);
+ }
+
protected function login($username = 'admin')
{
$this->add_lang('ucp');
@@ -475,7 +693,7 @@ class phpbb_functional_test_case extends phpbb_test_case
$form = $crawler->selectButton($this->lang('LOGIN'))->form();
$crawler = self::submit($form, array('username' => $username, 'password' => $username . $username));
- $this->assertContains($this->lang('LOGIN_REDIRECT'), $crawler->filter('html')->text());
+ $this->assertNotContains($this->lang('LOGIN'), $crawler->filter('.navbar')->text());
$cookies = self::$cookieJar->all();
@@ -489,6 +707,16 @@ class phpbb_functional_test_case extends phpbb_test_case
}
}
+ protected function logout()
+ {
+ $this->add_lang('ucp');
+
+ $crawler = self::request('GET', 'ucp.php?sid=' . $this->sid . '&mode=logout');
+ $this->assertContains($this->lang('REGISTER'), $crawler->filter('.navbar')->text());
+ unset($this->sid);
+
+ }
+
/**
* Login to the ACP
* You must run login() before calling this.
@@ -514,7 +742,7 @@ class phpbb_functional_test_case extends phpbb_test_case
if (strpos($field, 'password_') === 0)
{
$crawler = self::submit($form, array('username' => $username, $field => $username . $username));
- $this->assertContains($this->lang('LOGIN_ADMIN_SUCCESS'), $crawler->filter('html')->text());
+ $this->assertContains($this->lang('ADMIN_PANEL'), $crawler->filter('h1')->text());
$cookies = self::$cookieJar->all();
@@ -554,6 +782,30 @@ class phpbb_functional_test_case extends phpbb_test_case
$this->lang = array_merge($this->lang, $lang);
}
+ protected function add_lang_ext($ext_name, $lang_file)
+ {
+ if (is_array($lang_file))
+ {
+ foreach ($lang_file as $file)
+ {
+ $this->add_lang_ext($ext_name, $file);
+ }
+
+ return;
+ }
+
+ $lang_path = __DIR__ . "/../../phpBB/ext/{$ext_name}/language/en/$lang_file.php";
+
+ $lang = array();
+
+ if (file_exists($lang_path))
+ {
+ include($lang_path);
+ }
+
+ $this->lang = array_merge($this->lang, $lang);
+ }
+
protected function lang()
{
$args = func_get_args();
@@ -570,6 +822,30 @@ class phpbb_functional_test_case extends phpbb_test_case
}
/**
+ * assertContains for language strings
+ *
+ * @param string $needle Search string
+ * @param string $haystack Search this
+ * @param string $message Optional failure message
+ */
+ public function assertContainsLang($needle, $haystack, $message = null)
+ {
+ $this->assertContains(html_entity_decode($this->lang($needle), ENT_QUOTES), $haystack, $message);
+ }
+
+ /**
+ * assertNotContains for language strings
+ *
+ * @param string $needle Search string
+ * @param string $haystack Search this
+ * @param string $message Optional failure message
+ */
+ public function assertNotContainsLang($needle, $haystack, $message = null)
+ {
+ $this->assertNotContains(html_entity_decode($this->lang($needle), ENT_QUOTES), $haystack, $message);
+ }
+
+ /*
* Perform some basic assertions for the page
*
* Checks for debug/error output before the actual page content and the status code
@@ -579,15 +855,36 @@ class phpbb_functional_test_case extends phpbb_test_case
*/
static public function assert_response_html($status_code = 200)
{
+ // Any output before the doc type means there was an error
+ $content = self::$client->getResponse()->getContent();
+ self::assertNotContains('[phpBB Debug]', $content);
+ self::assertStringStartsWith('<!DOCTYPE', trim($content), 'Output found before DOCTYPE specification.');
+
if ($status_code !== false)
{
self::assert_response_status_code($status_code);
}
+ }
- // Any output before the doc type means there was an error
+ /*
+ * Perform some basic assertions for an xml page
+ *
+ * Checks for debug/error output before the actual page content and the status code
+ *
+ * @param mixed $status_code Expected status code, false to disable check
+ * @return null
+ */
+ static public function assert_response_xml($status_code = 200)
+ {
+ // Any output before the xml opening means there was an error
$content = self::$client->getResponse()->getContent();
self::assertNotContains('[phpBB Debug]', $content);
- self::assertStringStartsWith('<!DOCTYPE', trim($content), 'Output found before DOCTYPE specification.');
+ self::assertStringStartsWith('<?xml', trim($content), 'Output found before XML specification.');
+
+ if ($status_code !== false)
+ {
+ self::assert_response_status_code($status_code);
+ }
}
/**
@@ -604,6 +901,86 @@ class phpbb_functional_test_case extends phpbb_test_case
self::assertEquals($status_code, self::$client->getResponse()->getStatus(), 'HTTP status code does not match');
}
+ public function assert_filter($crawler, $expr, $msg = null)
+ {
+ $nodes = $crawler->filter($expr);
+ if ($msg)
+ {
+ $msg .= "\n";
+ }
+ else
+ {
+ $msg = '';
+ }
+ $msg .= "`$expr` not found in DOM.";
+ $this->assertGreaterThan(0, count($nodes), $msg);
+ return $nodes;
+ }
+
+ /**
+ * Asserts that exactly one checkbox with name $name exists within the scope
+ * of $crawler and that the checkbox is checked.
+ *
+ * @param Symfony\Component\DomCrawler\Crawler $crawler
+ * @param string $name
+ * @param string $message
+ *
+ * @return null
+ */
+ public function assert_checkbox_is_checked($crawler, $name, $message = '')
+ {
+ $this->assertSame(
+ 'checked',
+ $this->assert_find_one_checkbox($crawler, $name)->attr('checked'),
+ $message ?: "Failed asserting that checkbox $name is checked."
+ );
+ }
+
+ /**
+ * Asserts that exactly one checkbox with name $name exists within the scope
+ * of $crawler and that the checkbox is unchecked.
+ *
+ * @param Symfony\Component\DomCrawler\Crawler $crawler
+ * @param string $name
+ * @param string $message
+ *
+ * @return null
+ */
+ public function assert_checkbox_is_unchecked($crawler, $name, $message = '')
+ {
+ $this->assertSame(
+ '',
+ $this->assert_find_one_checkbox($crawler, $name)->attr('checked'),
+ $message ?: "Failed asserting that checkbox $name is unchecked."
+ );
+ }
+
+ /**
+ * Searches for an input element of type checkbox with the name $name using
+ * $crawler. Contains an assertion that only one such checkbox exists within
+ * the scope of $crawler.
+ *
+ * @param Symfony\Component\DomCrawler\Crawler $crawler
+ * @param string $name
+ * @param string $message
+ *
+ * @return Symfony\Component\DomCrawler\Crawler
+ */
+ public function assert_find_one_checkbox($crawler, $name, $message = '')
+ {
+ $query = sprintf('//input[@type="checkbox" and @name="%s"]', $name);
+ $result = $crawler->filterXPath($query);
+
+ $this->assertEquals(
+ 1,
+ sizeof($result),
+ $message ?: 'Failed asserting that exactly one checkbox with name' .
+ " $name exists in crawler scope."
+ );
+
+ return $result;
+ }
+
/**
* Creates a topic
*
@@ -613,9 +990,10 @@ class phpbb_functional_test_case extends phpbb_test_case
* @param string $subject
* @param string $message
* @param array $additional_form_data Any additional form data to be sent in the request
- * @return array post_id, topic_id
+ * @param string $expected Lang var of expected message after posting
+ * @return array|null post_id, topic_id if message is empty
*/
- public function create_topic($forum_id, $subject, $message, $additional_form_data = array())
+ public function create_topic($forum_id, $subject, $message, $additional_form_data = array(), $expected = '')
{
$posting_url = "posting.php?mode=post&f={$forum_id}&sid={$this->sid}";
@@ -625,7 +1003,7 @@ class phpbb_functional_test_case extends phpbb_test_case
'post' => true,
), $additional_form_data);
- return self::submit_post($posting_url, 'POST_TOPIC', $form_data);
+ return self::submit_post($posting_url, 'POST_TOPIC', $form_data, $expected);
}
/**
@@ -638,9 +1016,10 @@ class phpbb_functional_test_case extends phpbb_test_case
* @param string $subject
* @param string $message
* @param array $additional_form_data Any additional form data to be sent in the request
- * @return array post_id, topic_id
+ * @param string $expected Lang var of expected message after posting
+ * @return array|null post_id, topic_id if message is empty
*/
- public function create_post($forum_id, $topic_id, $subject, $message, $additional_form_data = array())
+ public function create_post($forum_id, $topic_id, $subject, $message, $additional_form_data = array(), $expected = '')
{
$posting_url = "posting.php?mode=reply&f={$forum_id}&t={$topic_id}&sid={$this->sid}";
@@ -650,7 +1029,7 @@ class phpbb_functional_test_case extends phpbb_test_case
'post' => true,
), $additional_form_data);
- return self::submit_post($posting_url, 'POST_REPLY', $form_data);
+ return self::submit_post($posting_url, 'POST_REPLY', $form_data, $expected);
}
/**
@@ -659,16 +1038,29 @@ class phpbb_functional_test_case extends phpbb_test_case
* @param string $posting_url
* @param string $posting_contains
* @param array $form_data
- * @return array post_id, topic_id
+ * @param string $expected Lang var of expected message after posting
+ * @return array|null post_id, topic_id if message is empty
*/
- protected function submit_post($posting_url, $posting_contains, $form_data)
+ protected function submit_post($posting_url, $posting_contains, $form_data, $expected = '')
{
$this->add_lang('posting');
$crawler = $this->submit_message($posting_url, $posting_contains, $form_data);
- $this->assertContains($this->lang('POST_STORED'), $crawler->filter('html')->text());
- $url = $crawler->selectLink($this->lang('VIEW_MESSAGE', '', ''))->link()->getUri();
+ if ($expected !== '')
+ {
+ if (isset($this->lang[$expected]))
+ {
+ $this->assertContainsLang($expected, $crawler->filter('html')->text());
+ }
+ else
+ {
+ $this->assertContains($expected, $crawler->filter('html')->text());
+ }
+ return null;
+ }
+
+ $url = $crawler->selectLink($form_data['subject'])->link()->getUri();
return array(
'topic_id' => $this->get_parameter_from_link($url, 't'),
@@ -722,10 +1114,33 @@ class phpbb_functional_test_case extends phpbb_test_case
*/
protected function submit_message($posting_url, $posting_contains, $form_data)
{
+ if (time() == self::$last_post_timestamp)
+ {
+ // Travis is too fast, so we have to wait to not mix up the post/topic order
+ sleep(1);
+ }
+ self::$last_post_timestamp = time();
$crawler = self::request('GET', $posting_url);
$this->assertContains($this->lang($posting_contains), $crawler->filter('html')->text());
+ if (!empty($form_data['upload_files']))
+ {
+ for ($i = 0; $i < $form_data['upload_files']; $i++)
+ {
+ $file = array(
+ 'tmp_name' => __DIR__ . '/../functional/fixtures/files/valid.jpg',
+ 'name' => 'valid.jpg',
+ 'type' => 'image/jpeg',
+ 'size' => filesize(__DIR__ . '/../functional/fixtures/files/valid.jpg'),
+ 'error' => UPLOAD_ERR_OK,
+ );
+
+ $crawler = self::$client->request('POST', $posting_url, array('add_file' => $this->lang('ADD_FILE')), array('fileupload' => $file));
+ }
+ unset($form_data['upload_files']);
+ }
+
$hidden_fields = array(
$crawler->filter('[type="hidden"]')->each(function ($node, $i) {
return array('name' => $node->attr('name'), 'value' => $node->attr('value'));
@@ -751,6 +1166,48 @@ class phpbb_functional_test_case extends phpbb_test_case
}
/**
+ * Deletes a topic
+ *
+ * Be sure to login before creating
+ *
+ * @param int $topic_id
+ * @return null
+ */
+ public function delete_topic($topic_id)
+ {
+ $this->add_lang('posting');
+ $crawler = $this->get_quickmod_page($topic_id, 'DELETE_TOPIC');
+ $this->assertContainsLang('DELETE_PERMANENTLY', $crawler->text());
+
+ $this->add_lang('mcp');
+ $form = $crawler->selectButton('Yes')->form();
+ $form['delete_permanent'] = 1;
+ $crawler = self::submit($form);
+ $this->assertContainsLang('TOPIC_DELETED_SUCCESS', $crawler->text());
+ }
+
+ /**
+ * Deletes a post
+ *
+ * Be sure to login before creating
+ *
+ * @param int $forum_id
+ * @param int $topic_id
+ * @return null
+ */
+ public function delete_post($forum_id, $post_id)
+ {
+ $this->add_lang('posting');
+ $crawler = self::request('GET', "posting.php?mode=delete&f={$forum_id}&p={$post_id}&sid={$this->sid}");
+ $this->assertContainsLang('DELETE_PERMANENTLY', $crawler->text());
+
+ $form = $crawler->selectButton('Yes')->form();
+ $form['delete_permanent'] = 1;
+ $crawler = self::submit($form);
+ $this->assertContainsLang('POST_DELETED', $crawler->text());
+ }
+
+ /**
* Returns the requested parameter from a URL
*
* @param string $url
@@ -785,4 +1242,50 @@ class phpbb_functional_test_case extends phpbb_test_case
}
return null;
}
+
+ /**
+ * Return a passwords manager instance
+ *
+ * @return phpbb\passwords\manager
+ */
+ public function get_passwords_manager()
+ {
+ // Prepare dependencies for manager and driver
+ $config = new \phpbb\config\config(array());
+ $driver_helper = new \phpbb\passwords\driver\helper($config);
+
+ $passwords_drivers = array(
+ 'passwords.driver.bcrypt_2y' => new \phpbb\passwords\driver\bcrypt_2y($config, $driver_helper),
+ 'passwords.driver.bcrypt' => new \phpbb\passwords\driver\bcrypt($config, $driver_helper),
+ 'passwords.driver.salted_md5' => new \phpbb\passwords\driver\salted_md5($config, $driver_helper),
+ 'passwords.driver.phpass' => new \phpbb\passwords\driver\phpass($config, $driver_helper),
+ );
+
+ $passwords_helper = new \phpbb\passwords\helper;
+ // Set up passwords manager
+ $manager = new \phpbb\passwords\manager($config, $passwords_drivers, $passwords_helper, array_keys($passwords_drivers));
+
+ return $manager;
+ }
+
+ /**
+ * Get quickmod page
+ *
+ * @param int $topic_id
+ * @param string $action Language key for the quickmod action
+ * @param Symfony\Component\DomCrawler\Crawler Optional crawler object to use instead of creating new one.
+ * @return Symfony\Component\DomCrawler\Crawler
+ */
+ public function get_quickmod_page($topic_id, $action, $crawler = false)
+ {
+ $this->add_lang('viewtopic');
+
+ if ($crawler === false)
+ {
+ $crawler = self::request('GET', "viewtopic.php?t={$topic_id}&sid={$this->sid}");
+ }
+ $link = $crawler->filter('#quickmod')->selectLink($this->lang($action))->link()->getUri();
+
+ return self::request('GET', substr($link, strpos($link, 'mcp.')));
+ }
}
diff --git a/tests/test_framework/phpbb_search_test_case.php b/tests/test_framework/phpbb_search_test_case.php
new file mode 100644
index 0000000000..b37ed1d039
--- /dev/null
+++ b/tests/test_framework/phpbb_search_test_case.php
@@ -0,0 +1,33 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+abstract class phpbb_search_test_case extends phpbb_database_test_case
+{
+ static protected function get_search_wrapper($class)
+ {
+ $wrapped = str_replace('\\', '_', $class) . '_wrapper';
+ if (!class_exists($wrapped))
+ {
+ $code = "
+class $wrapped extends $class
+{
+ public function get_must_contain_ids() { return \$this->must_contain_ids; }
+ public function get_must_not_contain_ids() { return \$this->must_not_contain_ids; }
+ public function get_split_words() { return \$this->split_words; }
+}
+ ";
+ eval($code);
+ }
+ return $wrapped;
+ }
+}
diff --git a/tests/test_framework/phpbb_session_test_case.php b/tests/test_framework/phpbb_session_test_case.php
new file mode 100644
index 0000000000..1bf0277fe0
--- /dev/null
+++ b/tests/test_framework/phpbb_session_test_case.php
@@ -0,0 +1,60 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
+require_once dirname(__FILE__) . '/../session/testable_factory.php';
+require_once dirname(__FILE__) . '/../session/testable_facade.php';
+
+abstract class phpbb_session_test_case extends phpbb_database_test_case
+{
+ /** @var phpbb_session_testable_factory */
+ protected $session_factory;
+
+ /** @var phpbb_session_testable_facade */
+ protected $session_facade;
+
+ /** @var \phpbb\db\driver\driver_interface */
+ protected $db;
+
+ function setUp()
+ {
+ parent::setUp();
+
+ global $symfony_request, $phpbb_filesystem, $phpbb_path_helper, $request, $phpbb_root_path, $phpEx;
+ $symfony_request = new \phpbb\symfony_request(
+ new phpbb_mock_request()
+ );
+ $phpbb_filesystem = new \phpbb\filesystem();
+ $phpbb_path_helper = new \phpbb\path_helper(
+ $symfony_request,
+ $phpbb_filesystem,
+ $this->getMock('\phpbb\request\request'),
+ $phpbb_root_path,
+ $phpEx
+ );
+
+ $this->session_factory = new phpbb_session_testable_factory;
+ $this->db = $this->new_dbal();
+ $this->session_facade =
+ new phpbb_session_testable_facade($this->db, $this->session_factory);
+ }
+
+ protected function check_sessions_equals($expected_sessions, $message)
+ {
+ $sql = 'SELECT session_id, session_user_id
+ FROM phpbb_sessions
+ ORDER BY session_user_id';
+
+ $this->assertSqlResultEquals($expected_sessions, $sql, $message);
+ }
+}
diff --git a/tests/test_framework/phpbb_test_case.php b/tests/test_framework/phpbb_test_case.php
index 8b16f02638..01d26fb67d 100644
--- a/tests/test_framework/phpbb_test_case.php
+++ b/tests/test_framework/phpbb_test_case.php
@@ -1,9 +1,13 @@
<?php
/**
*
-* @package testing
-* @copyright (c) 2008 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -22,7 +26,7 @@ class phpbb_test_case extends PHPUnit_Framework_TestCase
'PHP_Token_Stream' => array('customTokens'),
'PHP_Token_Stream_CachingFactory' => array('cache'),
- 'phpbb_database_test_case' => array('already_connected'),
+ 'phpbb_database_test_case' => array('already_connected', 'last_post_timestamp'),
);
}
diff --git a/tests/test_framework/phpbb_test_case_helpers.php b/tests/test_framework/phpbb_test_case_helpers.php
index 29adfc6817..dee70ad016 100644
--- a/tests/test_framework/phpbb_test_case_helpers.php
+++ b/tests/test_framework/phpbb_test_case_helpers.php
@@ -1,9 +1,13 @@
<?php
/**
*
-* @package testing
-* @copyright (c) 2008 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -18,6 +22,56 @@ class phpbb_test_case_helpers
$this->test_case = $test_case;
}
+ /**
+ * This should only be called once before the tests are run.
+ * This is used to copy the fixtures to the phpBB install
+ */
+ public function copy_ext_fixtures($fixtures_dir, $fixtures)
+ {
+ global $phpbb_root_path;
+
+ if (file_exists($phpbb_root_path . 'ext/'))
+ {
+ // First, move any extensions setup on the board to a temp directory
+ $this->copy_dir($phpbb_root_path . 'ext/', $phpbb_root_path . 'store/temp_ext/');
+
+ // Then empty the ext/ directory on the board (for accurate test cases)
+ $this->empty_dir($phpbb_root_path . 'ext/');
+ }
+
+ // Copy our ext/ files from the test case to the board
+ foreach ($fixtures as $fixture)
+ {
+ $this->copy_dir($fixtures_dir . $fixture, $phpbb_root_path . 'ext/' . $fixture);
+ }
+ }
+
+ /**
+ * This should only be called once after the tests are run.
+ * This is used to remove the fixtures from the phpBB install
+ */
+ public function restore_original_ext_dir()
+ {
+ global $phpbb_root_path;
+
+ // Remove all of the files we copied from test ext -> board ext
+ $this->empty_dir($phpbb_root_path . 'ext/');
+
+ // Copy back the board installed extensions from the temp directory
+ if (file_exists($phpbb_root_path . 'store/temp_ext/'))
+ {
+ $this->copy_dir($phpbb_root_path . 'store/temp_ext/', $phpbb_root_path . 'ext/');
+
+ // Remove all of the files we copied from board ext -> temp_ext
+ $this->empty_dir($phpbb_root_path . 'store/temp_ext/');
+ }
+
+ if (file_exists($phpbb_root_path . 'store/temp_ext/'))
+ {
+ $this->empty_dir($phpbb_root_path . 'store/temp_ext/');
+ }
+ }
+
public function setExpectedTriggerError($errno, $message = '')
{
$exceptionName = '';
@@ -42,14 +96,34 @@ class phpbb_test_case_helpers
$this->test_case->setExpectedException($exceptionName, (string) $message, $errno);
}
+ public function makedirs($path)
+ {
+ // PHP bug #55124 (fixed in 5.4.0)
+ $path = str_replace('/./', '/', $path);
+
+ mkdir($path, 0777, true);
+ }
+
static public function get_test_config()
{
$config = array();
- if (extension_loaded('sqlite') && version_compare(PHPUnit_Runner_Version::id(), '3.4.15', '>='))
+
+ if (extension_loaded('sqlite3'))
{
$config = array_merge($config, array(
- 'dbms' => 'sqlite',
+ 'dbms' => 'phpbb\db\driver\sqlite3',
+ 'dbhost' => dirname(__FILE__) . '/../phpbb_unit_tests.sqlite3', // filename
+ 'dbport' => '',
+ 'dbname' => '',
+ 'dbuser' => '',
+ 'dbpasswd' => '',
+ ));
+ }
+ else if (extension_loaded('sqlite'))
+ {
+ $config = array_merge($config, array(
+ 'dbms' => 'phpbb\db\driver\sqlite',
'dbhost' => dirname(__FILE__) . '/../phpbb_unit_tests.sqlite2', // filename
'dbport' => '',
'dbname' => '',
@@ -68,12 +142,15 @@ class phpbb_test_case_helpers
$test_config = dirname(__FILE__) . '/../test_config.php';
}
+ $config_php_file = new \phpbb\config_php_file('', '');
+
if (file_exists($test_config))
{
- include($test_config);
+ $config_php_file->set_config_file($test_config);
+ extract($config_php_file->get_all());
$config = array_merge($config, array(
- 'dbms' => $dbms,
+ 'dbms' => $config_php_file->convert_30_dbms_to_31($dbms),
'dbhost' => $dbhost,
'dbport' => $dbport,
'dbname' => $dbname,
@@ -86,12 +163,26 @@ class phpbb_test_case_helpers
{
$config['phpbb_functional_url'] = $phpbb_functional_url;
}
+
+ if (isset($phpbb_redis_host))
+ {
+ $config['redis_host'] = $phpbb_redis_host;
+ }
+ if (isset($phpbb_redis_port))
+ {
+ $config['redis_port'] = $phpbb_redis_port;
+ }
+
+ if (isset($fulltext_sphinx_id))
+ {
+ $config['fulltext_sphinx_id'] = $fulltext_sphinx_id;
+ }
}
if (isset($_SERVER['PHPBB_TEST_DBMS']))
{
$config = array_merge($config, array(
- 'dbms' => isset($_SERVER['PHPBB_TEST_DBMS']) ? $_SERVER['PHPBB_TEST_DBMS'] : '',
+ 'dbms' => isset($_SERVER['PHPBB_TEST_DBMS']) ? $config_php_file->convert_30_dbms_to_31($_SERVER['PHPBB_TEST_DBMS']) : '',
'dbhost' => isset($_SERVER['PHPBB_TEST_DBHOST']) ? $_SERVER['PHPBB_TEST_DBHOST'] : '',
'dbport' => isset($_SERVER['PHPBB_TEST_DBPORT']) ? $_SERVER['PHPBB_TEST_DBPORT'] : '',
'dbname' => isset($_SERVER['PHPBB_TEST_DBNAME']) ? $_SERVER['PHPBB_TEST_DBNAME'] : '',
@@ -108,6 +199,103 @@ class phpbb_test_case_helpers
));
}
+ if (isset($_SERVER['PHPBB_TEST_REDIS_HOST']))
+ {
+ $config['redis_host'] = $_SERVER['PHPBB_TEST_REDIS_HOST'];
+ }
+
+ if (isset($_SERVER['PHPBB_TEST_REDIS_PORT']))
+ {
+ $config['redis_port'] = $_SERVER['PHPBB_TEST_REDIS_PORT'];
+ }
+
return $config;
}
+
+ /**
+ * Recursive directory copying function
+ *
+ * @param string $source
+ * @param string $dest
+ * @return array list of files copied
+ */
+ public function copy_dir($source, $dest)
+ {
+ $source = (substr($source, -1) == '/') ? $source : $source . '/';
+ $dest = (substr($dest, -1) == '/') ? $dest : $dest . '/';
+
+ $copied_files = array();
+
+ if (!is_dir($dest))
+ {
+ $this->makedirs($dest);
+ }
+
+ $files = scandir($source);
+ foreach ($files as $file)
+ {
+ if ($file == '.' || $file == '..')
+ {
+ continue;
+ }
+
+ if (is_dir($source . $file))
+ {
+ $created_dir = false;
+ if (!is_dir($dest . $file))
+ {
+ $created_dir = true;
+ $this->makedirs($dest . $file);
+ }
+
+ $copied_files = array_merge($copied_files, self::copy_dir($source . $file, $dest . $file));
+
+ if ($created_dir)
+ {
+ $copied_files[] = $dest . $file;
+ }
+ }
+ else
+ {
+ if (!file_exists($dest . $file))
+ {
+ copy($source . $file, $dest . $file);
+
+ $copied_files[] = $dest . $file;
+ }
+ }
+ }
+
+ return $copied_files;
+ }
+
+ /**
+ * Empty directory (remove any subdirectories/files below)
+ *
+ * @param array $file_list
+ */
+ public function empty_dir($path)
+ {
+ $path = (substr($path, -1) == '/') ? $path : $path . '/';
+
+ $files = scandir($path);
+ foreach ($files as $file)
+ {
+ if ($file == '.' || $file == '..')
+ {
+ continue;
+ }
+
+ if (is_dir($path . $file))
+ {
+ $this->empty_dir($path . $file);
+
+ rmdir($path . $file);
+ }
+ else
+ {
+ unlink($path . $file);
+ }
+ }
+ }
}
diff --git a/tests/test_framework/phpbb_ui_test_case.php b/tests/test_framework/phpbb_ui_test_case.php
new file mode 100644
index 0000000000..e8b230ecbe
--- /dev/null
+++ b/tests/test_framework/phpbb_ui_test_case.php
@@ -0,0 +1,571 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+use Facebook\WebDriver\WebDriverBy;
+use Facebook\WebDriver\Exception\WebDriverCurlException;
+use Facebook\WebDriver\Remote\RemoteWebDriver;
+use Facebook\WebDriver\Remote\DesiredCapabilities;
+
+require_once __DIR__ . '/../../phpBB/includes/functions_install.php';
+
+class phpbb_ui_test_case extends phpbb_test_case
+{
+ static protected $host = '127.0.0.1';
+ static protected $port = 8910;
+
+ /**
+ * @var RemoteWebDriver
+ */
+ static protected $webDriver;
+
+ static protected $config;
+ static protected $root_url;
+ static protected $already_installed = false;
+ static protected $install_success = false;
+
+ protected $cache = null;
+ protected $db = null;
+ protected $extension_manager = null;
+
+ /**
+ * Session ID for current test's session (each test makes its own)
+ * @var string
+ */
+ protected $sid;
+
+ /**
+ * Language array used by phpBB
+ * @var array
+ */
+ protected $lang = array();
+
+ static public function setUpBeforeClass()
+ {
+ parent::setUpBeforeClass();
+
+ if (version_compare(PHP_VERSION, '5.3.19', '<'))
+ {
+ self::markTestSkipped('UI test case requires at least PHP 5.3.19.');
+ }
+ else if (!class_exists('\Facebook\WebDriver\Remote\RemoteWebDriver'))
+ {
+ self::markTestSkipped(
+ 'Could not find RemoteWebDriver class. ' .
+ 'Run "php ../composer.phar install" from the tests folder.'
+ );
+ }
+
+ self::$config = phpbb_test_case_helpers::get_test_config();
+ self::$root_url = self::$config['phpbb_functional_url'];
+
+ // Important: this is used both for installation and by
+ // test cases for querying the tables.
+ // Therefore table prefix must be set before a board is
+ // installed, and also before each test case is run.
+ self::$config['table_prefix'] = 'phpbb_';
+
+ if (!isset(self::$config['phpbb_functional_url']))
+ {
+ self::markTestSkipped('phpbb_functional_url was not set in test_config and wasn\'t set as PHPBB_FUNCTIONAL_URL environment variable either.');
+ }
+
+ if (!self::$webDriver)
+ {
+ try {
+ $capabilities = DesiredCapabilities::firefox();
+ self::$webDriver = RemoteWebDriver::create(self::$host . ':' . self::$port, $capabilities);
+ } catch (WebDriverCurlException $e) {
+ self::markTestSkipped('PhantomJS webserver is not running.');
+ }
+ }
+
+ if (!self::$already_installed)
+ {
+ self::install_board();
+ self::$already_installed = true;
+ }
+ }
+
+ /**
+ * @return array List of extensions that should be set up
+ */
+ static protected function setup_extensions()
+ {
+ return array();
+ }
+
+ public function setUp()
+ {
+ if (!self::$install_success)
+ {
+ $this->fail('Installing phpBB has failed.');
+ }
+
+ // Clear the language array so that things
+ // that were added in other tests are gone
+ $this->lang = array();
+ $this->add_lang('common');
+
+ $db = $this->get_db();
+
+ foreach (static::setup_extensions() as $extension)
+ {
+ $this->purge_cache();
+
+ $sql = 'SELECT ext_active
+ FROM ' . EXT_TABLE . "
+ WHERE ext_name = '" . $db->sql_escape($extension). "'";
+ $result = $db->sql_query($sql);
+ $status = (bool) $db->sql_fetchfield('ext_active');
+ $db->sql_freeresult($result);
+
+ if (!$status)
+ {
+ $this->install_ext($extension);
+ }
+ }
+ }
+
+ protected function tearDown()
+ {
+ parent::tearDown();
+
+ if ($this->db instanceof \phpbb\db\driver\driver_interface)
+ {
+ // Close the database connections again this test
+ $this->db->sql_close();
+ }
+ }
+
+ static public function visit($path)
+ {
+ self::$webDriver->get(self::$root_url . $path);
+ }
+
+ static protected function recreate_database($config)
+ {
+ $db_conn_mgr = new phpbb_database_test_connection_manager($config);
+ $db_conn_mgr->recreate_db();
+ }
+
+ static public function find_element($type, $value)
+ {
+ return self::$webDriver->findElement(WebDriverBy::$type($value));
+ }
+
+ static public function submit($type = 'id', $value = 'submit')
+ {
+ $element = self::find_element($type, $value);
+ $element->click();
+ }
+
+ static protected function install_board()
+ {
+ global $phpbb_root_path, $phpEx, $db;
+
+ self::recreate_database(self::$config);
+
+ $config_file = $phpbb_root_path . "config.$phpEx";
+ $config_file_dev = $phpbb_root_path . "config_dev.$phpEx";
+ $config_file_test = $phpbb_root_path . "config_test.$phpEx";
+
+ if (file_exists($config_file))
+ {
+ if (!file_exists($config_file_dev))
+ {
+ rename($config_file, $config_file_dev);
+ }
+ else
+ {
+ unlink($config_file);
+ }
+ }
+
+ $parseURL = parse_url(self::$config['phpbb_functional_url']);
+
+ self::visit('install/index.php?mode=install&language=en');
+ self::assertContains('Welcome to Installation', self::find_element('id', 'main')->getText());
+
+ // install/index.php?mode=install&sub=requirements
+ self::submit();
+ self::assertContains('Installation compatibility', self::find_element('id', 'main')->getText());
+
+ // install/index.php?mode=install&sub=database
+ self::submit();
+ self::assertContains('Database configuration', self::find_element('id', 'main')->getText());
+
+ self::find_element('id','dbms')->sendKeys(str_replace('phpbb\db\driver\\', '', self::$config['dbms']));
+ self::find_element('id','dbhost')->sendKeys(self::$config['dbhost']);
+ self::find_element('id','dbport')->sendKeys(self::$config['dbport']);
+ self::find_element('id','dbname')->sendKeys(self::$config['dbname']);
+ self::find_element('id','dbuser')->sendKeys(self::$config['dbuser']);
+ self::find_element('id','dbpasswd')->sendKeys(self::$config['dbpasswd']);
+
+ // Need to clear default phpbb_ prefix
+ self::find_element('id','table_prefix')->clear();
+ self::find_element('id','table_prefix')->sendKeys(self::$config['table_prefix']);
+
+ // install/index.php?mode=install&sub=database
+ self::submit();
+ self::assertContains('Successful connection', self::find_element('id','main')->getText());
+
+ // install/index.php?mode=install&sub=administrator
+ self::submit();
+ self::assertContains('Administrator configuration', self::find_element('id','main')->getText());
+
+ self::find_element('id','admin_name')->sendKeys('admin');
+ self::find_element('id','admin_pass1')->sendKeys('adminadmin');
+ self::find_element('id','admin_pass2')->sendKeys('adminadmin');
+ self::find_element('id','board_email')->sendKeys('nobody@example.com');
+
+ // install/index.php?mode=install&sub=administrator
+ self::submit();
+ self::assertContains('Tests passed', self::find_element('id','main')->getText());
+
+ // install/index.php?mode=install&sub=config_file
+ self::submit();
+
+ // Installer has created a config.php file, we will overwrite it with a
+ // config file of our own in order to get the DEBUG constants defined
+ $config_php_data = phpbb_create_config_file_data(self::$config, self::$config['dbms'], true, false, true);
+ $config_created = file_put_contents($config_file, $config_php_data) !== false;
+ if (!$config_created)
+ {
+ self::markTestSkipped("Could not write $config_file file.");
+ }
+
+ if (strpos(self::find_element('id','main')->getText(), 'The configuration file has been written') === false)
+ {
+ self::submit('id', 'dldone');
+ }
+ self::assertContains('The configuration file has been written', self::find_element('id','main')->getText());
+
+ // install/index.php?mode=install&sub=advanced
+ self::submit();
+ self::assertContains('The settings on this page are only necessary to set if you know that you require something different from the default.', self::find_element('id','main')->getText());
+
+ self::find_element('id','smtp_delivery')->sendKeys('1');
+ self::find_element('id','smtp_host')->sendKeys('nxdomain.phpbb.com');
+ self::find_element('id','smtp_user')->sendKeys('nxuser');
+ self::find_element('id','smtp_pass')->sendKeys('nxpass');
+ self::find_element('id','server_protocol')->sendKeys($parseURL['scheme'] . '://');
+ self::find_element('id','server_name')->sendKeys('localhost');
+ self::find_element('id','server_port')->sendKeys(isset($parseURL['port']) ? $parseURL['port'] : 80);
+ self::find_element('id','script_path')->sendKeys($parseURL['path']);
+
+ // install/index.php?mode=install&sub=create_table
+ self::submit();
+ self::assertContains('The database tables used by phpBB', self::find_element('id','main')->getText());
+ self::assertContains('have been created and populated with some initial data.', self::find_element('id','main')->getText());
+
+ // install/index.php?mode=install&sub=final
+ self::submit();
+ self::assertContains('You have successfully installed', self::find_element('id', 'main')->getText());
+
+ copy($config_file, $config_file_test);
+
+ self::$install_success = true;
+ }
+
+ public function install_ext($extension)
+ {
+ $this->login();
+ $this->admin_login();
+
+ $ext_path = str_replace('/', '%2F', $extension);
+
+ $this->visit('adm/index.php?i=acp_extensions&mode=main&action=enable_pre&ext_name=' . $ext_path . '&sid=' . $this->sid);
+ $this->assertNotEmpty(count(self::find_element('cssSelector', '.submit-buttons')));
+
+ self::find_element('cssSelector', "input[value='Enable']")->submit();
+ $this->add_lang('acp/extensions');
+
+ try
+ {
+ $meta_refresh = self::find_element('cssSelector', 'meta[http-equiv="refresh"]');
+
+ // Wait for extension to be fully enabled
+ while (sizeof($meta_refresh))
+ {
+ preg_match('#url=.+/(adm+.+)#', $meta_refresh->getAttribute('content'), $match);
+ self::$webDriver->execute(array('method' => 'post', 'url' => $match[1]));
+ $meta_refresh = self::find_element('cssSelector', 'meta[http-equiv="refresh"]');
+ }
+ }
+ catch (\Facebook\WebDriver\Exception\NoSuchElementException $e)
+ {
+ // Probably no refresh triggered
+ }
+
+ $this->assertContainsLang('EXTENSION_ENABLE_SUCCESS', self::find_element('cssSelector', 'div.successbox')->getText());
+
+ $this->logout();
+ }
+
+ protected function get_cache_driver()
+ {
+ if (!$this->cache)
+ {
+ $this->cache = new \phpbb\cache\driver\file;
+ }
+
+ return $this->cache;
+ }
+
+ protected function purge_cache()
+ {
+ $cache = $this->get_cache_driver();
+
+ $cache->purge();
+ $cache->unload();
+ $cache->load();
+ }
+
+ protected function get_extension_manager()
+ {
+ global $phpbb_root_path, $phpEx;
+
+ $config = new \phpbb\config\config(array());
+ $db = $this->get_db();
+ $db_tools = new \phpbb\db\tools($db);
+
+ $container = new phpbb_mock_container_builder();
+ $migrator = new \phpbb\db\migrator(
+ $container,
+ $config,
+ $db,
+ $db_tools,
+ self::$config['table_prefix'] . 'migrations',
+ $phpbb_root_path,
+ $phpEx,
+ self::$config['table_prefix'],
+ array(),
+ new \phpbb\db\migration\helper()
+ );
+ $container->set('migrator', $migrator);
+ $container->set('dispatcher', new phpbb_mock_event_dispatcher());
+ $user = new \phpbb\user('\phpbb\datetime');
+
+ $extension_manager = new \phpbb\extension\manager(
+ $container,
+ $db,
+ $config,
+ new phpbb\filesystem(),
+ $user,
+ self::$config['table_prefix'] . 'ext',
+ dirname(__FILE__) . '/',
+ $phpEx,
+ $this->get_cache_driver()
+ );
+
+ return $extension_manager;
+ }
+
+ protected function get_db()
+ {
+ // so we don't reopen an open connection
+ if (!($this->db instanceof \phpbb\db\driver\driver_interface))
+ {
+ $dbms = self::$config['dbms'];
+ /** @var \phpbb\db\driver\driver_interface $db */
+ $db = new $dbms();
+ $db->sql_connect(self::$config['dbhost'], self::$config['dbuser'], self::$config['dbpasswd'], self::$config['dbname'], self::$config['dbport']);
+ $this->db = $db;
+ }
+ return $this->db;
+ }
+
+ protected function logout()
+ {
+ $this->add_lang('ucp');
+
+ if (empty($this->sid))
+ {
+ return;
+ }
+
+ $this->visit('ucp.php?sid=' . $this->sid . '&mode=logout');
+ $this->assertContains($this->lang('REGISTER'), self::$webDriver->getPageSource());
+ unset($this->sid);
+
+ }
+
+ /**
+ * Login to the ACP
+ * You must run login() before calling this.
+ */
+ protected function admin_login($username = 'admin')
+ {
+ $this->add_lang('acp/common');
+
+ // Requires login first!
+ if (empty($this->sid))
+ {
+ $this->fail('$this->sid is empty. Make sure you call login() before admin_login()');
+ return;
+ }
+
+ self::$webDriver->manage()->deleteAllCookies();
+
+ $this->visit('adm/index.php?sid=' . $this->sid);
+ $this->assertContains($this->lang('LOGIN_ADMIN_CONFIRM'), self::$webDriver->getPageSource());
+
+ self::find_element('cssSelector', 'input[name=username]')->clear()->sendKeys($username);
+ self::find_element('cssSelector', 'input[type=password]')->sendKeys($username . $username);
+ self::find_element('cssSelector', 'input[name=login]')->click();
+ $this->assertContains($this->lang('ADMIN_PANEL'), $this->find_element('cssSelector', 'h1')->getText());
+
+ $cookies = self::$webDriver->manage()->getCookies();
+
+ // The session id is stored in a cookie that ends with _sid - we assume there is only one such cookie
+ foreach ($cookies as $cookie)
+ {
+ if (substr($cookie['name'], -4) == '_sid')
+ {
+ $this->sid = $cookie['value'];
+
+ break;
+ }
+ }
+
+ $this->assertNotEmpty($this->sid);
+ }
+
+ protected function add_lang($lang_file)
+ {
+ if (is_array($lang_file))
+ {
+ foreach ($lang_file as $file)
+ {
+ $this->add_lang($file);
+ }
+ }
+
+ $lang_path = __DIR__ . "/../../phpBB/language/en/$lang_file.php";
+
+ $lang = array();
+
+ if (file_exists($lang_path))
+ {
+ include($lang_path);
+ }
+
+ $this->lang = array_merge($this->lang, $lang);
+ }
+
+ protected function add_lang_ext($ext_name, $lang_file)
+ {
+ if (is_array($lang_file))
+ {
+ foreach ($lang_file as $file)
+ {
+ $this->add_lang_ext($ext_name, $file);
+ }
+
+ return;
+ }
+
+ $lang_path = __DIR__ . "/../../phpBB/ext/{$ext_name}/language/en/$lang_file.php";
+
+ $lang = array();
+
+ if (file_exists($lang_path))
+ {
+ include($lang_path);
+ }
+
+ $this->lang = array_merge($this->lang, $lang);
+ }
+
+ protected function lang()
+ {
+ $args = func_get_args();
+ $key = $args[0];
+
+ if (empty($this->lang[$key]))
+ {
+ throw new RuntimeException('Language key "' . $key . '" could not be found.');
+ }
+
+ $args[0] = $this->lang[$key];
+
+ return call_user_func_array('sprintf', $args);
+ }
+
+ /**
+ * assertContains for language strings
+ *
+ * @param string $needle Search string
+ * @param string $haystack Search this
+ * @param string $message Optional failure message
+ */
+ public function assertContainsLang($needle, $haystack, $message = null)
+ {
+ $this->assertContains(html_entity_decode($this->lang($needle), ENT_QUOTES), $haystack, $message);
+ }
+
+ /**
+ * assertNotContains for language strings
+ *
+ * @param string $needle Search string
+ * @param string $haystack Search this
+ * @param string $message Optional failure message
+ */
+ public function assertNotContainsLang($needle, $haystack, $message = null)
+ {
+ $this->assertNotContains(html_entity_decode($this->lang($needle), ENT_QUOTES), $haystack, $message);
+ }
+
+ protected function login($username = 'admin')
+ {
+ $this->add_lang('ucp');
+
+ self::$webDriver->manage()->deleteAllCookies();
+
+ $this->visit('ucp.php');
+ $this->assertContains($this->lang('LOGIN_EXPLAIN_UCP'), self::$webDriver->getPageSource());
+
+ self::$webDriver->manage()->deleteAllCookies();
+
+ self::find_element('cssSelector', 'input[name=username]')->sendKeys($username);
+ self::find_element('cssSelector', 'input[name=password]')->sendKeys($username . $username);
+ self::find_element('cssSelector', 'input[name=login]')->click();
+ $this->assertNotContains($this->lang('LOGIN'), $this->find_element('className', 'navbar')->getText());
+
+ $cookies = self::$webDriver->manage()->getCookies();
+
+ // The session id is stored in a cookie that ends with _sid - we assume there is only one such cookie
+ foreach ($cookies as $cookie)
+ {
+ if (substr($cookie['name'], -4) == '_sid')
+ {
+ $this->sid = $cookie['value'];
+ }
+ }
+
+ $this->assertNotEmpty($this->sid);
+ }
+
+ /**
+ * Take screenshot. Can be used for debug purposes.
+ *
+ * @throws Exception When screenshot can't be created
+ */
+ public function take_screenshot()
+ {
+ // Change the Path to your own settings
+ $screenshot = time() . ".png";
+
+ self::$webDriver->takeScreenshot($screenshot);
+ }
+}
diff --git a/tests/text_processing/censor_text_test.php b/tests/text_processing/censor_text_test.php
index f0e13638a5..983a5ba2d3 100644
--- a/tests/text_processing/censor_text_test.php
+++ b/tests/text_processing/censor_text_test.php
@@ -1,16 +1,18 @@
<?php
/**
*
-* @package testing
-* @copyright (c) 2011 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
require_once dirname(__FILE__) . '/../../phpBB/includes/functions_content.php';
-require_once dirname(__FILE__) . '/../mock/user.php';
-require_once dirname(__FILE__) . '/../mock/cache.php';
class phpbb_text_processing_censor_text_test extends phpbb_test_case
{
@@ -19,7 +21,7 @@ class phpbb_text_processing_censor_text_test extends phpbb_test_case
global $cache, $user;
$cache = new phpbb_mock_cache;
$user = new phpbb_mock_user;
-
+
$user->optionset('viewcensors', false);
return array(
@@ -61,7 +63,7 @@ class phpbb_text_processing_censor_text_test extends phpbb_test_case
array('badword1 badword2 badword3 badword4', 'replacement1 replacement2 replacement3 replacement4'),
array('badword1 badword2 badword3 badword4d', 'replacement1 replacement2 replacement3 badword4d'),
array('abadword1 badword2 badword3 badword4', 'replacement1 replacement2 replacement3 replacement4'),
-
+
array("new\nline\ntest", "new\nline\ntest"),
array("tab\ttest\t", "tab\ttest\t"),
array('öäü', 'öäü'),
diff --git a/tests/text_processing/generate_text_for_display_test.php b/tests/text_processing/generate_text_for_display_test.php
index a157fe7d9a..057416da33 100644
--- a/tests/text_processing/generate_text_for_display_test.php
+++ b/tests/text_processing/generate_text_for_display_test.php
@@ -1,9 +1,13 @@
<?php
/**
*
-* @package testing
-* @copyright (c) 2013 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -16,7 +20,7 @@ class phpbb_text_processing_generate_text_for_display_test extends phpbb_test_ca
{
public function setUp()
{
- global $cache, $user;
+ global $cache, $user, $phpbb_dispatcher;
parent::setUp();
@@ -24,6 +28,8 @@ class phpbb_text_processing_generate_text_for_display_test extends phpbb_test_ca
$user = new phpbb_mock_user;
$user->optionset('viewcensors', false);
+
+ $phpbb_dispatcher = new phpbb_mock_event_dispatcher();
}
public function test_empty_string()
diff --git a/tests/text_processing/make_clickable_test.php b/tests/text_processing/make_clickable_test.php
index db0812319d..95e304dd97 100644
--- a/tests/text_processing/make_clickable_test.php
+++ b/tests/text_processing/make_clickable_test.php
@@ -1,9 +1,13 @@
<?php
/**
*
-* @package testing
-* @copyright (c) 2008 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -12,7 +16,7 @@ require_once dirname(__FILE__) . '/../../phpBB/includes/functions_content.php';
class phpbb_text_processing_make_clickable_test extends phpbb_test_case
{
- static public function make_clickable_data()
+ public function make_clickable_data()
{
// value => whether it should work
$prefix_texts = array(
@@ -100,5 +104,50 @@ class phpbb_text_processing_make_clickable_test extends phpbb_test_case
$this->assertEquals($expected, $result, $label);
}
+ public function make_clickable_mixed_serverurl_data()
+ {
+ $urls = array(
+ 'http://thisdomain.org' => array('tag' => 'm', 'url' => false, 'text' => false),
+ 'http://thisdomain.org/' => array('tag' => 'm', 'url' => false, 'text' => false),
+ 'http://thisdomain.org/1' => array('tag' => 'm', 'url' => false, 'text' => false),
+ 'http://thisdomain.org/path/some?query=abc#test' => array('tag' => 'm', 'url' => false, 'text' => false),
+
+ 'https://www.phpbb.com' => array('tag' => 'm', 'url' => false, 'text' => false),
+ 'https://www.phpbb.com/' => array('tag' => 'm', 'url' => false, 'text' => false),
+ 'https://www.phpbb.com/1' => array('tag' => 'l', 'url' => false, 'text' => '1'),
+ 'https://www.phpbb.com/path/some?query=abc#test' => array('tag' => 'l', 'url' => false, 'text' => 'path/some?query=abc#test'),
+ );
+
+ $test_data = array();
+
+ // run the test for each combination
+ foreach ($urls as $url => $url_type)
+ {
+ // false means it's the same as the url, less typing
+ $url_type['url'] = ($url_type['url']) ? $url_type['url'] : $url;
+ $url_type['text'] = ($url_type['text']) ? $url_type['text'] : $url;
+
+ $class = ($url_type['tag'] === 'l') ? 'postlink-local' : 'postlink';
+
+ // replace the url with the desired output format
+ $output = '<!-- ' . $url_type['tag'] . ' --><a class="' . $class . '" href="' . $url_type['url'] . '">' . $url_type['text'] . '</a><!-- ' . $url_type['tag'] . ' -->';
+
+ $test_data[] = array($url, $output);
+ }
+
+ return $test_data;
+ }
+
+ /**
+ * @dataProvider make_clickable_mixed_serverurl_data
+ */
+ public function test_make_clickable_mixed_serverurl($input, $expected)
+ {
+ $result = make_clickable($input, 'https://www.phpbb.com');
+
+ $label = 'Making text clickable: ' . $input;
+ $this->assertEquals($expected, $result, $label);
+ }
+
}
diff --git a/tests/tree/fixtures/phpbb_forums.xml b/tests/tree/fixtures/phpbb_forums.xml
new file mode 100644
index 0000000000..8f133078a9
--- /dev/null
+++ b/tests/tree/fixtures/phpbb_forums.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<dataset>
+ <table name="phpbb_forums">
+ <column>forum_id</column>
+ <column>parent_id</column>
+ <column>left_id</column>
+ <column>right_id</column>
+ <column>forum_parents</column>
+ <column>forum_name</column>
+ <column>forum_desc</column>
+ <column>forum_rules</column>
+ </table>
+</dataset>
diff --git a/tests/tree/nestedset_forum_base.php b/tests/tree/nestedset_forum_base.php
new file mode 100644
index 0000000000..c56be1f81e
--- /dev/null
+++ b/tests/tree/nestedset_forum_base.php
@@ -0,0 +1,121 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
+
+class phpbb_tests_tree_nestedset_forum_base extends phpbb_database_test_case
+{
+ public function getDataSet()
+ {
+ return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/phpbb_forums.xml');
+ }
+
+ protected $forum_data = array(
+ // \__/
+ 1 => array('forum_id' => 1, 'parent_id' => 0, 'user_id' => 0, 'left_id' => 1, 'right_id' => 6, 'forum_parents' => 'a:0:{}'),
+ 2 => array('forum_id' => 2, 'parent_id' => 1, 'user_id' => 0, 'left_id' => 2, 'right_id' => 3, 'forum_parents' => 'a:0:{}'),
+ 3 => array('forum_id' => 3, 'parent_id' => 1, 'user_id' => 0, 'left_id' => 4, 'right_id' => 5, 'forum_parents' => 'a:0:{}'),
+
+ // \ /
+ // \/
+ 4 => array('forum_id' => 4, 'parent_id' => 0, 'user_id' => 0, 'left_id' => 7, 'right_id' => 12, 'forum_parents' => 'a:0:{}'),
+ 5 => array('forum_id' => 5, 'parent_id' => 4, 'user_id' => 0, 'left_id' => 8, 'right_id' => 11, 'forum_parents' => 'a:0:{}'),
+ 6 => array('forum_id' => 6, 'parent_id' => 5, 'user_id' => 0, 'left_id' => 9, 'right_id' => 10, 'forum_parents' => 'a:0:{}'),
+
+ // \_ _/
+ // \/
+ 7 => array('forum_id' => 7, 'parent_id' => 0, 'user_id' => 0, 'left_id' => 13, 'right_id' => 22, 'forum_parents' => 'a:0:{}'),
+ 8 => array('forum_id' => 8, 'parent_id' => 7, 'user_id' => 0, 'left_id' => 14, 'right_id' => 15, 'forum_parents' => 'a:0:{}'),
+ 9 => array('forum_id' => 9, 'parent_id' => 7, 'user_id' => 0, 'left_id' => 16, 'right_id' => 19, 'forum_parents' => 'a:0:{}'),
+ 10 => array('forum_id' => 10, 'parent_id' => 9, 'user_id' => 0, 'left_id' => 17, 'right_id' => 18, 'forum_parents' => 'a:0:{}'),
+ 11 => array('forum_id' => 11, 'parent_id' => 7, 'user_id' => 0, 'left_id' => 20, 'right_id' => 21, 'forum_parents' => 'a:0:{}'),
+
+ // Non-existent forums
+ 0 => array('forum_id' => 0, 'parent_id' => 0, 'user_id' => 0, 'left_id' => 0, 'right_id' => 0, 'forum_parents' => 'a:0:{}'),
+ 200 => array('forum_id' => 200, 'parent_id' => 0, 'user_id' => 0, 'left_id' => 0, 'right_id' => 0, 'forum_parents' => 'a:0:{}'),
+ );
+
+ protected $set,
+ $config,
+ $lock,
+ $db;
+
+ public function setUp()
+ {
+ parent::setUp();
+
+ $this->db = $this->new_dbal();
+
+ global $config;
+
+ $config = $this->config = new \phpbb\config\config(array('nestedset_forum_lock' => 0));
+ set_config(null, null, null, $this->config);
+
+ $this->lock = new \phpbb\lock\db('nestedset_forum_lock', $this->config, $this->db);
+ $this->set = new \phpbb\tree\nestedset_forum($this->db, $this->lock, 'phpbb_forums');
+
+ $this->set_up_forums();
+ }
+
+ protected function set_up_forums()
+ {
+ static $forums;
+
+ if (empty($forums))
+ {
+ $this->create_forum('Parent with two flat children');
+ $this->create_forum('Flat child #1', 1);
+ $this->create_forum('Flat child #2', 1);
+
+ $this->create_forum('Parent with two nested children');
+ $this->create_forum('Nested child #1', 4);
+ $this->create_forum('Nested child #2', 5);
+
+ $this->create_forum('Parent with flat and nested children');
+ $this->create_forum('Mixed child #1', 7);
+ $this->create_forum('Mixed child #2', 7);
+ $this->create_forum('Nested child #1 of Mixed child #2', 9);
+ $this->create_forum('Mixed child #3', 7);
+
+ // Updating forum_parents column here so it's not empty
+ // This is required, so we can see whether the methods
+ // correctly clear the values.
+ $sql = "UPDATE phpbb_forums
+ SET forum_parents = 'a:0:{}'";
+ $this->db->sql_query($sql);
+
+ // Copy the forums into a static array, so we can reuse the list later
+ $sql = 'SELECT *
+ FROM phpbb_forums';
+ $result = $this->db->sql_query($sql);
+ $forums = $this->db->sql_fetchrowset($result);
+ $this->db->sql_freeresult($result);
+ }
+ else
+ {
+ $buffer = new \phpbb\db\sql_insert_buffer($this->db, 'phpbb_forums');
+ $buffer->insert_all($forums);
+ $buffer->flush();
+
+ $this->database_synchronisation(array(
+ 'phpbb_forums' => array('forum_id'),
+ ));
+ }
+ }
+
+ protected function create_forum($name, $parent_id = 0)
+ {
+ $forum = $this->set->insert(array('forum_name' => $name, 'forum_desc' => '', 'forum_rules' => ''));
+ $this->set->change_parent($forum['forum_id'], $parent_id);
+ }
+}
diff --git a/tests/tree/nestedset_forum_get_data_test.php b/tests/tree/nestedset_forum_get_data_test.php
new file mode 100644
index 0000000000..48fbabdb8c
--- /dev/null
+++ b/tests/tree/nestedset_forum_get_data_test.php
@@ -0,0 +1,139 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+require_once dirname(__FILE__) . '/nestedset_forum_base.php';
+
+class phpbb_tests_tree_nestedset_forum_get_data_test extends phpbb_tests_tree_nestedset_forum_base
+{
+ public function get_path_and_subtree_data_data()
+ {
+ return array(
+ array(1, true, true, array(1, 2, 3)),
+ array(1, true, false, array(2, 3)),
+ array(1, false, true, array(3, 2, 1)),
+ array(1, false, false, array(3, 2)),
+
+ array(2, true, true, array(1, 2)),
+ array(2, true, false, array(1)),
+ array(2, false, true, array(2, 1)),
+ array(2, false, false, array(1)),
+
+ array(5, true, true, array(4, 5, 6)),
+ array(5, true, false, array(4, 6)),
+ array(5, false, true, array(6, 5, 4)),
+ array(5, false, false, array(6, 4)),
+ );
+ }
+
+ /**
+ * @dataProvider get_path_and_subtree_data_data
+ */
+ public function test_get_path_and_subtree_data($forum_id, $order_asc, $include_item, $expected)
+ {
+ $this->assertEquals($expected, array_keys($this->set->get_path_and_subtree_data($forum_id, $order_asc, $include_item)));
+ }
+
+ public function get_path_data_data()
+ {
+ return array(
+ array(1, true, true, array(1)),
+ array(1, true, false, array()),
+ array(1, false, true, array(1)),
+ array(1, false, false, array()),
+
+ array(2, true, true, array(1, 2)),
+ array(2, true, false, array(1)),
+ array(2, false, true, array(2, 1)),
+ array(2, false, false, array(1)),
+
+ array(5, true, true, array(4, 5)),
+ array(5, true, false, array(4)),
+ array(5, false, true, array(5, 4)),
+ array(5, false, false, array(4)),
+ );
+ }
+
+ /**
+ * @dataProvider get_path_data_data
+ */
+ public function test_get_path_data($forum_id, $order_asc, $include_item, $expected)
+ {
+ $this->assertEquals($expected, array_keys($this->set->get_path_data($forum_id, $order_asc, $include_item)));
+ }
+
+ public function get_subtree_data_data()
+ {
+ return array(
+ array(1, true, true, array(1, 2, 3)),
+ array(1, true, false, array(2, 3)),
+ array(1, false, true, array(3, 2, 1)),
+ array(1, false, false, array(3, 2)),
+
+ array(2, true, true, array(2)),
+ array(2, true, false, array()),
+ array(2, false, true, array(2)),
+ array(2, false, false, array()),
+
+ array(5, true, true, array(5, 6)),
+ array(5, true, false, array(6)),
+ array(5, false, true, array(6, 5)),
+ array(5, false, false, array(6)),
+ );
+ }
+
+ /**
+ * @dataProvider get_subtree_data_data
+ */
+ public function test_get_subtree_data($forum_id, $order_asc, $include_item, $expected)
+ {
+ $this->assertEquals($expected, array_keys($this->set->get_subtree_data($forum_id, $order_asc, $include_item)));
+ }
+
+ public function get_path_basic_data_data()
+ {
+ return array(
+ array(1, '', array()),
+ array(1, serialize(array()), array()),
+ array(2, '', array(1)),
+ array(2, serialize(array(1 => array())), array(1)),
+ array(10, '', array(7, 9)),
+ array(10, serialize(array(7 => array(), 9 => array())), array(7, 9)),
+ );
+ }
+
+ /**
+ * @dataProvider get_path_basic_data_data
+ */
+ public function test_get_path_basic_data($forum_id, $forum_parents, $expected)
+ {
+ $forum_data = $this->forum_data[$forum_id];
+ $forum_data['forum_parents'] = $forum_parents;
+ $this->assertEquals($expected, array_keys($this->set->get_path_basic_data($forum_data)));
+ }
+
+ public function get_all_tree_data_data()
+ {
+ return array(
+ array(true, array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11)),
+ array(false, array(11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1)),
+ );
+ }
+
+ /**
+ * @dataProvider get_all_tree_data_data
+ */
+ public function test_get_all_tree_data($order_asc, $expected)
+ {
+ $this->assertEquals($expected, array_keys($this->set->get_all_tree_data($order_asc)));
+ }
+}
diff --git a/tests/tree/nestedset_forum_insert_delete_test.php b/tests/tree/nestedset_forum_insert_delete_test.php
new file mode 100644
index 0000000000..6393752010
--- /dev/null
+++ b/tests/tree/nestedset_forum_insert_delete_test.php
@@ -0,0 +1,124 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+require_once dirname(__FILE__) . '/nestedset_forum_base.php';
+
+class phpbb_tests_tree_nestedset_forum_add_remove_test extends phpbb_tests_tree_nestedset_forum_base
+{
+ public function delete_data()
+ {
+ return array(
+ array(1, array(1, 2, 3), array(
+ array('forum_id' => 4, 'parent_id' => 0, 'left_id' => 1, 'right_id' => 6),
+ array('forum_id' => 5, 'parent_id' => 4, 'left_id' => 2, 'right_id' => 5),
+ array('forum_id' => 6, 'parent_id' => 5, 'left_id' => 3, 'right_id' => 4),
+ array('forum_id' => 7, 'parent_id' => 0, 'left_id' => 7, 'right_id' => 16),
+ array('forum_id' => 8, 'parent_id' => 7, 'left_id' => 8, 'right_id' => 9),
+ array('forum_id' => 9, 'parent_id' => 7, 'left_id' => 10, 'right_id' => 13),
+ array('forum_id' => 10, 'parent_id' => 9, 'left_id' => 11, 'right_id' => 12),
+ array('forum_id' => 11, 'parent_id' => 7, 'left_id' => 14, 'right_id' => 15),
+ )),
+ array(2, array(2), array(
+ array('forum_id' => 1, 'parent_id' => 0, 'left_id' => 1, 'right_id' => 4),
+ array('forum_id' => 3, 'parent_id' => 1, 'left_id' => 2, 'right_id' => 3),
+ array('forum_id' => 4, 'parent_id' => 0, 'left_id' => 5, 'right_id' => 10),
+ array('forum_id' => 5, 'parent_id' => 4, 'left_id' => 6, 'right_id' => 9),
+ array('forum_id' => 6, 'parent_id' => 5, 'left_id' => 7, 'right_id' => 8),
+ array('forum_id' => 7, 'parent_id' => 0, 'left_id' => 11, 'right_id' => 20),
+ array('forum_id' => 8, 'parent_id' => 7, 'left_id' => 12, 'right_id' => 13),
+ array('forum_id' => 9, 'parent_id' => 7, 'left_id' => 14, 'right_id' => 17),
+ array('forum_id' => 10, 'parent_id' => 9, 'left_id' => 15, 'right_id' => 16),
+ array('forum_id' => 11, 'parent_id' => 7, 'left_id' => 18, 'right_id' => 19),
+ )),
+ );
+ }
+
+ /**
+ * @dataProvider delete_data
+ */
+ public function test_delete($forum_id, $expected_deleted, $expected)
+ {
+ $this->assertEquals($expected_deleted, $this->set->delete($forum_id));
+
+ $result = $this->db->sql_query("SELECT forum_id, parent_id, left_id, right_id
+ FROM phpbb_forums
+ ORDER BY left_id, forum_id ASC");
+ $this->assertEquals($expected, $this->db->sql_fetchrowset($result));
+ }
+
+ public function delete_throws_data()
+ {
+ return array(
+ array('Not an item', 0),
+ array('Item does not exist', 200),
+ );
+ }
+
+ /**
+ * @dataProvider delete_throws_data
+ *
+ * @expectedException OutOfBoundsException
+ * @expectedExceptionMessage FORUM_NESTEDSET_INVALID_ITEM
+ */
+ public function test_delete_throws($explain, $forum_id)
+ {
+ $this->set->delete($forum_id);
+ }
+
+ public function insert_data()
+ {
+ return array(
+ array(array(
+ 'forum_desc' => '',
+ 'forum_rules' => '',
+ 'forum_id' => 12,
+ 'parent_id' => 0,
+ 'left_id' => 23,
+ 'right_id' => 24,
+ 'forum_parents' => '',
+ ), array(
+ array('forum_id' => 1, 'parent_id' => 0, 'left_id' => 1, 'right_id' => 6),
+ array('forum_id' => 2, 'parent_id' => 1, 'left_id' => 2, 'right_id' => 3),
+ array('forum_id' => 3, 'parent_id' => 1, 'left_id' => 4, 'right_id' => 5),
+
+ array('forum_id' => 4, 'parent_id' => 0, 'left_id' => 7, 'right_id' => 12),
+ array('forum_id' => 5, 'parent_id' => 4, 'left_id' => 8, 'right_id' => 11),
+ array('forum_id' => 6, 'parent_id' => 5, 'left_id' => 9, 'right_id' => 10),
+
+ array('forum_id' => 7, 'parent_id' => 0, 'left_id' => 13, 'right_id' => 22),
+ array('forum_id' => 8, 'parent_id' => 7, 'left_id' => 14, 'right_id' => 15),
+ array('forum_id' => 9, 'parent_id' => 7, 'left_id' => 16, 'right_id' => 19),
+ array('forum_id' => 10, 'parent_id' => 9, 'left_id' => 17, 'right_id' => 18),
+ array('forum_id' => 11, 'parent_id' => 7, 'left_id' => 20, 'right_id' => 21),
+
+ array('forum_id' => 12, 'parent_id' => 0, 'left_id' => 23, 'right_id' => 24),
+ )),
+ );
+ }
+
+ /**
+ * @dataProvider insert_data
+ */
+ public function test_insert($expected_data, $expected)
+ {
+ $this->assertEquals($expected_data, $this->set->insert(array(
+ 'forum_desc' => '',
+ 'forum_rules' => '',
+ )));
+
+ $result = $this->db->sql_query('SELECT forum_id, parent_id, left_id, right_id
+ FROM phpbb_forums
+ ORDER BY left_id, forum_id ASC');
+ $this->assertEquals($expected, $this->db->sql_fetchrowset($result));
+ }
+}
diff --git a/tests/tree/nestedset_forum_move_test.php b/tests/tree/nestedset_forum_move_test.php
new file mode 100644
index 0000000000..108faf5b71
--- /dev/null
+++ b/tests/tree/nestedset_forum_move_test.php
@@ -0,0 +1,573 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+require_once dirname(__FILE__) . '/nestedset_forum_base.php';
+
+class phpbb_tests_tree_nestedset_forum_move_test extends phpbb_tests_tree_nestedset_forum_base
+{
+ public function move_data()
+ {
+ return array(
+ array('Move first item up',
+ 1, 1, false, array(
+ array('forum_id' => 1, 'parent_id' => 0, 'left_id' => 1, 'right_id' => 6),
+ array('forum_id' => 2, 'parent_id' => 1, 'left_id' => 2, 'right_id' => 3),
+ array('forum_id' => 3, 'parent_id' => 1, 'left_id' => 4, 'right_id' => 5),
+ array('forum_id' => 4, 'parent_id' => 0, 'left_id' => 7, 'right_id' => 12),
+ array('forum_id' => 5, 'parent_id' => 4, 'left_id' => 8, 'right_id' => 11),
+ array('forum_id' => 6, 'parent_id' => 5, 'left_id' => 9, 'right_id' => 10),
+ array('forum_id' => 7, 'parent_id' => 0, 'left_id' => 13, 'right_id' => 22),
+ array('forum_id' => 8, 'parent_id' => 7, 'left_id' => 14, 'right_id' => 15),
+ array('forum_id' => 9, 'parent_id' => 7, 'left_id' => 16, 'right_id' => 19),
+ array('forum_id' => 10, 'parent_id' => 9, 'left_id' => 17, 'right_id' => 18),
+ array('forum_id' => 11, 'parent_id' => 7, 'left_id' => 20, 'right_id' => 21),
+ )),
+ array('Move last item down',
+ 7, -1, false, array(
+ array('forum_id' => 1, 'parent_id' => 0, 'left_id' => 1, 'right_id' => 6),
+ array('forum_id' => 2, 'parent_id' => 1, 'left_id' => 2, 'right_id' => 3),
+ array('forum_id' => 3, 'parent_id' => 1, 'left_id' => 4, 'right_id' => 5),
+ array('forum_id' => 4, 'parent_id' => 0, 'left_id' => 7, 'right_id' => 12),
+ array('forum_id' => 5, 'parent_id' => 4, 'left_id' => 8, 'right_id' => 11),
+ array('forum_id' => 6, 'parent_id' => 5, 'left_id' => 9, 'right_id' => 10),
+ array('forum_id' => 7, 'parent_id' => 0, 'left_id' => 13, 'right_id' => 22),
+ array('forum_id' => 8, 'parent_id' => 7, 'left_id' => 14, 'right_id' => 15),
+ array('forum_id' => 9, 'parent_id' => 7, 'left_id' => 16, 'right_id' => 19),
+ array('forum_id' => 10, 'parent_id' => 9, 'left_id' => 17, 'right_id' => 18),
+ array('forum_id' => 11, 'parent_id' => 7, 'left_id' => 20, 'right_id' => 21),
+ )),
+ array('Move first item down',
+ 1, -1, true, array(
+ array('forum_id' => 4, 'parent_id' => 0, 'left_id' => 1, 'right_id' => 6),
+ array('forum_id' => 5, 'parent_id' => 4, 'left_id' => 2, 'right_id' => 5),
+ array('forum_id' => 6, 'parent_id' => 5, 'left_id' => 3, 'right_id' => 4),
+ array('forum_id' => 1, 'parent_id' => 0, 'left_id' => 7, 'right_id' => 12),
+ array('forum_id' => 2, 'parent_id' => 1, 'left_id' => 8, 'right_id' => 9),
+ array('forum_id' => 3, 'parent_id' => 1, 'left_id' => 10, 'right_id' => 11),
+ array('forum_id' => 7, 'parent_id' => 0, 'left_id' => 13, 'right_id' => 22),
+ array('forum_id' => 8, 'parent_id' => 7, 'left_id' => 14, 'right_id' => 15),
+ array('forum_id' => 9, 'parent_id' => 7, 'left_id' => 16, 'right_id' => 19),
+ array('forum_id' => 10, 'parent_id' => 9, 'left_id' => 17, 'right_id' => 18),
+ array('forum_id' => 11, 'parent_id' => 7, 'left_id' => 20, 'right_id' => 21),
+ )),
+ array('Move second item up',
+ 4, 1, true, array(
+ array('forum_id' => 4, 'parent_id' => 0, 'left_id' => 1, 'right_id' => 6),
+ array('forum_id' => 5, 'parent_id' => 4, 'left_id' => 2, 'right_id' => 5),
+ array('forum_id' => 6, 'parent_id' => 5, 'left_id' => 3, 'right_id' => 4),
+ array('forum_id' => 1, 'parent_id' => 0, 'left_id' => 7, 'right_id' => 12),
+ array('forum_id' => 2, 'parent_id' => 1, 'left_id' => 8, 'right_id' => 9),
+ array('forum_id' => 3, 'parent_id' => 1, 'left_id' => 10, 'right_id' => 11),
+ array('forum_id' => 7, 'parent_id' => 0, 'left_id' => 13, 'right_id' => 22),
+ array('forum_id' => 8, 'parent_id' => 7, 'left_id' => 14, 'right_id' => 15),
+ array('forum_id' => 9, 'parent_id' => 7, 'left_id' => 16, 'right_id' => 19),
+ array('forum_id' => 10, 'parent_id' => 9, 'left_id' => 17, 'right_id' => 18),
+ array('forum_id' => 11, 'parent_id' => 7, 'left_id' => 20, 'right_id' => 21),
+ )),
+ array('Move last item up',
+ 7, 1, true, array(
+ array('forum_id' => 1, 'parent_id' => 0, 'left_id' => 1, 'right_id' => 6),
+ array('forum_id' => 2, 'parent_id' => 1, 'left_id' => 2, 'right_id' => 3),
+ array('forum_id' => 3, 'parent_id' => 1, 'left_id' => 4, 'right_id' => 5),
+ array('forum_id' => 7, 'parent_id' => 0, 'left_id' => 7, 'right_id' => 16),
+ array('forum_id' => 8, 'parent_id' => 7, 'left_id' => 8, 'right_id' => 9),
+ array('forum_id' => 9, 'parent_id' => 7, 'left_id' => 10, 'right_id' => 13),
+ array('forum_id' => 10, 'parent_id' => 9, 'left_id' => 11, 'right_id' => 12),
+ array('forum_id' => 11, 'parent_id' => 7, 'left_id' => 14, 'right_id' => 15),
+ array('forum_id' => 4, 'parent_id' => 0, 'left_id' => 17, 'right_id' => 22),
+ array('forum_id' => 5, 'parent_id' => 4, 'left_id' => 18, 'right_id' => 21),
+ array('forum_id' => 6, 'parent_id' => 5, 'left_id' => 19, 'right_id' => 20),
+ )),
+ array('Move last item up by 2',
+ 7, 2, true, array(
+ array('forum_id' => 7, 'parent_id' => 0, 'left_id' => 1, 'right_id' => 10),
+ array('forum_id' => 8, 'parent_id' => 7, 'left_id' => 2, 'right_id' => 3),
+ array('forum_id' => 9, 'parent_id' => 7, 'left_id' => 4, 'right_id' => 7),
+ array('forum_id' => 10, 'parent_id' => 9, 'left_id' => 5, 'right_id' => 6),
+ array('forum_id' => 11, 'parent_id' => 7, 'left_id' => 8, 'right_id' => 9),
+ array('forum_id' => 1, 'parent_id' => 0, 'left_id' => 11, 'right_id' => 16),
+ array('forum_id' => 2, 'parent_id' => 1, 'left_id' => 12, 'right_id' => 13),
+ array('forum_id' => 3, 'parent_id' => 1, 'left_id' => 14, 'right_id' => 15),
+ array('forum_id' => 4, 'parent_id' => 0, 'left_id' => 17, 'right_id' => 22),
+ array('forum_id' => 5, 'parent_id' => 4, 'left_id' => 18, 'right_id' => 21),
+ array('forum_id' => 6, 'parent_id' => 5, 'left_id' => 19, 'right_id' => 20),
+ )),
+ array('Move last item up by 100',
+ 7, 100, true, array(
+ array('forum_id' => 7, 'parent_id' => 0, 'left_id' => 1, 'right_id' => 10),
+ array('forum_id' => 8, 'parent_id' => 7, 'left_id' => 2, 'right_id' => 3),
+ array('forum_id' => 9, 'parent_id' => 7, 'left_id' => 4, 'right_id' => 7),
+ array('forum_id' => 10, 'parent_id' => 9, 'left_id' => 5, 'right_id' => 6),
+ array('forum_id' => 11, 'parent_id' => 7, 'left_id' => 8, 'right_id' => 9),
+ array('forum_id' => 1, 'parent_id' => 0, 'left_id' => 11, 'right_id' => 16),
+ array('forum_id' => 2, 'parent_id' => 1, 'left_id' => 12, 'right_id' => 13),
+ array('forum_id' => 3, 'parent_id' => 1, 'left_id' => 14, 'right_id' => 15),
+ array('forum_id' => 4, 'parent_id' => 0, 'left_id' => 17, 'right_id' => 22),
+ array('forum_id' => 5, 'parent_id' => 4, 'left_id' => 18, 'right_id' => 21),
+ array('forum_id' => 6, 'parent_id' => 5, 'left_id' => 19, 'right_id' => 20),
+ )),
+ );
+ }
+
+ /**
+ * @dataProvider move_data
+ */
+ public function test_move($explain, $forum_id, $delta, $expected_moved, $expected)
+ {
+ $this->assertEquals($expected_moved, $this->set->move($forum_id, $delta));
+
+ $result = $this->db->sql_query("SELECT forum_id, parent_id, left_id, right_id
+ FROM phpbb_forums
+ ORDER BY left_id, forum_id ASC");
+ $this->assertEquals($expected, $this->db->sql_fetchrowset($result));
+ }
+
+ public function move_down_data()
+ {
+ return array(
+ array('Move last item down',
+ 7, false, array(
+ array('forum_id' => 1, 'parent_id' => 0, 'left_id' => 1, 'right_id' => 6),
+ array('forum_id' => 2, 'parent_id' => 1, 'left_id' => 2, 'right_id' => 3),
+ array('forum_id' => 3, 'parent_id' => 1, 'left_id' => 4, 'right_id' => 5),
+ array('forum_id' => 4, 'parent_id' => 0, 'left_id' => 7, 'right_id' => 12),
+ array('forum_id' => 5, 'parent_id' => 4, 'left_id' => 8, 'right_id' => 11),
+ array('forum_id' => 6, 'parent_id' => 5, 'left_id' => 9, 'right_id' => 10),
+ array('forum_id' => 7, 'parent_id' => 0, 'left_id' => 13, 'right_id' => 22),
+ array('forum_id' => 8, 'parent_id' => 7, 'left_id' => 14, 'right_id' => 15),
+ array('forum_id' => 9, 'parent_id' => 7, 'left_id' => 16, 'right_id' => 19),
+ array('forum_id' => 10, 'parent_id' => 9, 'left_id' => 17, 'right_id' => 18),
+ array('forum_id' => 11, 'parent_id' => 7, 'left_id' => 20, 'right_id' => 21),
+ )),
+ array('Move first item down',
+ 1, true, array(
+ array('forum_id' => 4, 'parent_id' => 0, 'left_id' => 1, 'right_id' => 6),
+ array('forum_id' => 5, 'parent_id' => 4, 'left_id' => 2, 'right_id' => 5),
+ array('forum_id' => 6, 'parent_id' => 5, 'left_id' => 3, 'right_id' => 4),
+ array('forum_id' => 1, 'parent_id' => 0, 'left_id' => 7, 'right_id' => 12),
+ array('forum_id' => 2, 'parent_id' => 1, 'left_id' => 8, 'right_id' => 9),
+ array('forum_id' => 3, 'parent_id' => 1, 'left_id' => 10, 'right_id' => 11),
+ array('forum_id' => 7, 'parent_id' => 0, 'left_id' => 13, 'right_id' => 22),
+ array('forum_id' => 8, 'parent_id' => 7, 'left_id' => 14, 'right_id' => 15),
+ array('forum_id' => 9, 'parent_id' => 7, 'left_id' => 16, 'right_id' => 19),
+ array('forum_id' => 10, 'parent_id' => 9, 'left_id' => 17, 'right_id' => 18),
+ array('forum_id' => 11, 'parent_id' => 7, 'left_id' => 20, 'right_id' => 21),
+ )),
+ );
+ }
+
+ /**
+ * @dataProvider move_down_data
+ */
+ public function test_move_down($explain, $forum_id, $expected_moved, $expected)
+ {
+ $this->assertEquals($expected_moved, $this->set->move_down($forum_id));
+
+ $result = $this->db->sql_query("SELECT forum_id, parent_id, left_id, right_id
+ FROM phpbb_forums
+ ORDER BY left_id, forum_id ASC");
+ $this->assertEquals($expected, $this->db->sql_fetchrowset($result));
+ }
+
+ public function move_up_data()
+ {
+ return array(
+ array('Move first item up',
+ 1, false, array(
+ array('forum_id' => 1, 'parent_id' => 0, 'left_id' => 1, 'right_id' => 6),
+ array('forum_id' => 2, 'parent_id' => 1, 'left_id' => 2, 'right_id' => 3),
+ array('forum_id' => 3, 'parent_id' => 1, 'left_id' => 4, 'right_id' => 5),
+ array('forum_id' => 4, 'parent_id' => 0, 'left_id' => 7, 'right_id' => 12),
+ array('forum_id' => 5, 'parent_id' => 4, 'left_id' => 8, 'right_id' => 11),
+ array('forum_id' => 6, 'parent_id' => 5, 'left_id' => 9, 'right_id' => 10),
+ array('forum_id' => 7, 'parent_id' => 0, 'left_id' => 13, 'right_id' => 22),
+ array('forum_id' => 8, 'parent_id' => 7, 'left_id' => 14, 'right_id' => 15),
+ array('forum_id' => 9, 'parent_id' => 7, 'left_id' => 16, 'right_id' => 19),
+ array('forum_id' => 10, 'parent_id' => 9, 'left_id' => 17, 'right_id' => 18),
+ array('forum_id' => 11, 'parent_id' => 7, 'left_id' => 20, 'right_id' => 21),
+ )),
+ array('Move second item up',
+ 4, true, array(
+ array('forum_id' => 4, 'parent_id' => 0, 'left_id' => 1, 'right_id' => 6),
+ array('forum_id' => 5, 'parent_id' => 4, 'left_id' => 2, 'right_id' => 5),
+ array('forum_id' => 6, 'parent_id' => 5, 'left_id' => 3, 'right_id' => 4),
+ array('forum_id' => 1, 'parent_id' => 0, 'left_id' => 7, 'right_id' => 12),
+ array('forum_id' => 2, 'parent_id' => 1, 'left_id' => 8, 'right_id' => 9),
+ array('forum_id' => 3, 'parent_id' => 1, 'left_id' => 10, 'right_id' => 11),
+ array('forum_id' => 7, 'parent_id' => 0, 'left_id' => 13, 'right_id' => 22),
+ array('forum_id' => 8, 'parent_id' => 7, 'left_id' => 14, 'right_id' => 15),
+ array('forum_id' => 9, 'parent_id' => 7, 'left_id' => 16, 'right_id' => 19),
+ array('forum_id' => 10, 'parent_id' => 9, 'left_id' => 17, 'right_id' => 18),
+ array('forum_id' => 11, 'parent_id' => 7, 'left_id' => 20, 'right_id' => 21),
+ )),
+ );
+ }
+
+ /**
+ * @dataProvider move_up_data
+ */
+ public function test_move_up($explain, $forum_id, $expected_moved, $expected)
+ {
+ $this->assertEquals($expected_moved, $this->set->move_up($forum_id));
+
+ $result = $this->db->sql_query("SELECT forum_id, parent_id, left_id, right_id
+ FROM phpbb_forums
+ ORDER BY left_id, forum_id ASC");
+ $this->assertEquals($expected, $this->db->sql_fetchrowset($result));
+ }
+
+ public function move_children_data()
+ {
+ return array(
+ array('Item has no children',
+ 2, 1, false, array(
+ array('forum_id' => 1, 'parent_id' => 0, 'left_id' => 1, 'right_id' => 6, 'forum_parents' => 'a:0:{}'),
+ array('forum_id' => 2, 'parent_id' => 1, 'left_id' => 2, 'right_id' => 3, 'forum_parents' => 'a:0:{}'),
+ array('forum_id' => 3, 'parent_id' => 1, 'left_id' => 4, 'right_id' => 5, 'forum_parents' => 'a:0:{}'),
+
+ array('forum_id' => 4, 'parent_id' => 0, 'left_id' => 7, 'right_id' => 12, 'forum_parents' => 'a:0:{}'),
+ array('forum_id' => 5, 'parent_id' => 4, 'left_id' => 8, 'right_id' => 11, 'forum_parents' => 'a:0:{}'),
+ array('forum_id' => 6, 'parent_id' => 5, 'left_id' => 9, 'right_id' => 10, 'forum_parents' => 'a:0:{}'),
+
+ array('forum_id' => 7, 'parent_id' => 0, 'left_id' => 13, 'right_id' => 22, 'forum_parents' => 'a:0:{}'),
+ array('forum_id' => 8, 'parent_id' => 7, 'left_id' => 14, 'right_id' => 15, 'forum_parents' => 'a:0:{}'),
+ array('forum_id' => 9, 'parent_id' => 7, 'left_id' => 16, 'right_id' => 19, 'forum_parents' => 'a:0:{}'),
+ array('forum_id' => 10, 'parent_id' => 9, 'left_id' => 17, 'right_id' => 18, 'forum_parents' => 'a:0:{}'),
+ array('forum_id' => 11, 'parent_id' => 7, 'left_id' => 20, 'right_id' => 21, 'forum_parents' => 'a:0:{}'),
+ )),
+ array('Move to same parent',
+ 4, 4, false, array(
+ array('forum_id' => 1, 'parent_id' => 0, 'left_id' => 1, 'right_id' => 6, 'forum_parents' => 'a:0:{}'),
+ array('forum_id' => 2, 'parent_id' => 1, 'left_id' => 2, 'right_id' => 3, 'forum_parents' => 'a:0:{}'),
+ array('forum_id' => 3, 'parent_id' => 1, 'left_id' => 4, 'right_id' => 5, 'forum_parents' => 'a:0:{}'),
+
+ array('forum_id' => 4, 'parent_id' => 0, 'left_id' => 7, 'right_id' => 12, 'forum_parents' => 'a:0:{}'),
+ array('forum_id' => 5, 'parent_id' => 4, 'left_id' => 8, 'right_id' => 11, 'forum_parents' => 'a:0:{}'),
+ array('forum_id' => 6, 'parent_id' => 5, 'left_id' => 9, 'right_id' => 10, 'forum_parents' => 'a:0:{}'),
+
+ array('forum_id' => 7, 'parent_id' => 0, 'left_id' => 13, 'right_id' => 22, 'forum_parents' => 'a:0:{}'),
+ array('forum_id' => 8, 'parent_id' => 7, 'left_id' => 14, 'right_id' => 15, 'forum_parents' => 'a:0:{}'),
+ array('forum_id' => 9, 'parent_id' => 7, 'left_id' => 16, 'right_id' => 19, 'forum_parents' => 'a:0:{}'),
+ array('forum_id' => 10, 'parent_id' => 9, 'left_id' => 17, 'right_id' => 18, 'forum_parents' => 'a:0:{}'),
+ array('forum_id' => 11, 'parent_id' => 7, 'left_id' => 20, 'right_id' => 21, 'forum_parents' => 'a:0:{}'),
+ )),
+ array('Move single child up',
+ 5, 1, true, array(
+ array('forum_id' => 1, 'parent_id' => 0, 'left_id' => 1, 'right_id' => 8, 'forum_parents' => 'a:0:{}'),
+ array('forum_id' => 2, 'parent_id' => 1, 'left_id' => 2, 'right_id' => 3, 'forum_parents' => 'a:0:{}'),
+ array('forum_id' => 3, 'parent_id' => 1, 'left_id' => 4, 'right_id' => 5, 'forum_parents' => 'a:0:{}'),
+ array('forum_id' => 6, 'parent_id' => 1, 'left_id' => 6, 'right_id' => 7, 'forum_parents' => ''),
+
+ array('forum_id' => 4, 'parent_id' => 0, 'left_id' => 9, 'right_id' => 12, 'forum_parents' => 'a:0:{}'),
+ array('forum_id' => 5, 'parent_id' => 4, 'left_id' => 10, 'right_id' => 11, 'forum_parents' => 'a:0:{}'),
+
+ array('forum_id' => 7, 'parent_id' => 0, 'left_id' => 13, 'right_id' => 22, 'forum_parents' => 'a:0:{}'),
+ array('forum_id' => 8, 'parent_id' => 7, 'left_id' => 14, 'right_id' => 15, 'forum_parents' => 'a:0:{}'),
+ array('forum_id' => 9, 'parent_id' => 7, 'left_id' => 16, 'right_id' => 19, 'forum_parents' => 'a:0:{}'),
+ array('forum_id' => 10, 'parent_id' => 9, 'left_id' => 17, 'right_id' => 18, 'forum_parents' => 'a:0:{}'),
+ array('forum_id' => 11, 'parent_id' => 7, 'left_id' => 20, 'right_id' => 21, 'forum_parents' => 'a:0:{}'),
+ )),
+ array('Move nested children up',
+ 4, 1, true, array(
+ array('forum_id' => 1, 'parent_id' => 0, 'left_id' => 1, 'right_id' => 10, 'forum_parents' => 'a:0:{}'),
+ array('forum_id' => 2, 'parent_id' => 1, 'left_id' => 2, 'right_id' => 3, 'forum_parents' => 'a:0:{}'),
+ array('forum_id' => 3, 'parent_id' => 1, 'left_id' => 4, 'right_id' => 5, 'forum_parents' => 'a:0:{}'),
+ array('forum_id' => 5, 'parent_id' => 1, 'left_id' => 6, 'right_id' => 9, 'forum_parents' => ''),
+ array('forum_id' => 6, 'parent_id' => 5, 'left_id' => 7, 'right_id' => 8, 'forum_parents' => ''),
+
+ array('forum_id' => 4, 'parent_id' => 0, 'left_id' => 11, 'right_id' => 12, 'forum_parents' => 'a:0:{}'),
+
+ array('forum_id' => 7, 'parent_id' => 0, 'left_id' => 13, 'right_id' => 22, 'forum_parents' => 'a:0:{}'),
+ array('forum_id' => 8, 'parent_id' => 7, 'left_id' => 14, 'right_id' => 15, 'forum_parents' => 'a:0:{}'),
+ array('forum_id' => 9, 'parent_id' => 7, 'left_id' => 16, 'right_id' => 19, 'forum_parents' => 'a:0:{}'),
+ array('forum_id' => 10, 'parent_id' => 9, 'left_id' => 17, 'right_id' => 18, 'forum_parents' => 'a:0:{}'),
+ array('forum_id' => 11, 'parent_id' => 7, 'left_id' => 20, 'right_id' => 21, 'forum_parents' => 'a:0:{}'),
+ )),
+ array('Move single child down',
+ 5, 7, true, array(
+ array('forum_id' => 1, 'parent_id' => 0, 'left_id' => 1, 'right_id' => 6, 'forum_parents' => 'a:0:{}'),
+ array('forum_id' => 2, 'parent_id' => 1, 'left_id' => 2, 'right_id' => 3, 'forum_parents' => 'a:0:{}'),
+ array('forum_id' => 3, 'parent_id' => 1, 'left_id' => 4, 'right_id' => 5, 'forum_parents' => 'a:0:{}'),
+
+ array('forum_id' => 4, 'parent_id' => 0, 'left_id' => 7, 'right_id' => 10, 'forum_parents' => 'a:0:{}'),
+ array('forum_id' => 5, 'parent_id' => 4, 'left_id' => 8, 'right_id' => 9, 'forum_parents' => 'a:0:{}'),
+
+ array('forum_id' => 7, 'parent_id' => 0, 'left_id' => 11, 'right_id' => 22, 'forum_parents' => 'a:0:{}'),
+ array('forum_id' => 8, 'parent_id' => 7, 'left_id' => 12, 'right_id' => 13, 'forum_parents' => 'a:0:{}'),
+ array('forum_id' => 9, 'parent_id' => 7, 'left_id' => 14, 'right_id' => 17, 'forum_parents' => 'a:0:{}'),
+ array('forum_id' => 10, 'parent_id' => 9, 'left_id' => 15, 'right_id' => 16, 'forum_parents' => 'a:0:{}'),
+ array('forum_id' => 11, 'parent_id' => 7, 'left_id' => 18, 'right_id' => 19, 'forum_parents' => 'a:0:{}'),
+ array('forum_id' => 6, 'parent_id' => 7, 'left_id' => 20, 'right_id' => 21, 'forum_parents' => ''),
+
+ )),
+ array('Move nested children down',
+ 4, 7, true, array(
+ array('forum_id' => 1, 'parent_id' => 0, 'left_id' => 1, 'right_id' => 6, 'forum_parents' => 'a:0:{}'),
+ array('forum_id' => 2, 'parent_id' => 1, 'left_id' => 2, 'right_id' => 3, 'forum_parents' => 'a:0:{}'),
+ array('forum_id' => 3, 'parent_id' => 1, 'left_id' => 4, 'right_id' => 5, 'forum_parents' => 'a:0:{}'),
+
+ array('forum_id' => 4, 'parent_id' => 0, 'left_id' => 7, 'right_id' => 8, 'forum_parents' => 'a:0:{}'),
+
+ array('forum_id' => 7, 'parent_id' => 0, 'left_id' => 9, 'right_id' => 22, 'forum_parents' => 'a:0:{}'),
+ array('forum_id' => 8, 'parent_id' => 7, 'left_id' => 10, 'right_id' => 11, 'forum_parents' => 'a:0:{}'),
+ array('forum_id' => 9, 'parent_id' => 7, 'left_id' => 12, 'right_id' => 15, 'forum_parents' => 'a:0:{}'),
+ array('forum_id' => 10, 'parent_id' => 9, 'left_id' => 13, 'right_id' => 14, 'forum_parents' => 'a:0:{}'),
+ array('forum_id' => 11, 'parent_id' => 7, 'left_id' => 16, 'right_id' => 17, 'forum_parents' => 'a:0:{}'),
+ array('forum_id' => 5, 'parent_id' => 7, 'left_id' => 18, 'right_id' => 21, 'forum_parents' => ''),
+ array('forum_id' => 6, 'parent_id' => 5, 'left_id' => 19, 'right_id' => 20, 'forum_parents' => ''),
+ )),
+ array('Move single child to parent 0',
+ 5, 0, true, array(
+ array('forum_id' => 1, 'parent_id' => 0, 'left_id' => 1, 'right_id' => 6, 'forum_parents' => 'a:0:{}'),
+ array('forum_id' => 2, 'parent_id' => 1, 'left_id' => 2, 'right_id' => 3, 'forum_parents' => 'a:0:{}'),
+ array('forum_id' => 3, 'parent_id' => 1, 'left_id' => 4, 'right_id' => 5, 'forum_parents' => 'a:0:{}'),
+
+ array('forum_id' => 4, 'parent_id' => 0, 'left_id' => 7, 'right_id' => 10, 'forum_parents' => 'a:0:{}'),
+ array('forum_id' => 5, 'parent_id' => 4, 'left_id' => 8, 'right_id' => 9, 'forum_parents' => 'a:0:{}'),
+
+ array('forum_id' => 7, 'parent_id' => 0, 'left_id' => 11, 'right_id' => 20, 'forum_parents' => 'a:0:{}'),
+ array('forum_id' => 8, 'parent_id' => 7, 'left_id' => 12, 'right_id' => 13, 'forum_parents' => 'a:0:{}'),
+ array('forum_id' => 9, 'parent_id' => 7, 'left_id' => 14, 'right_id' => 17, 'forum_parents' => 'a:0:{}'),
+ array('forum_id' => 10, 'parent_id' => 9, 'left_id' => 15, 'right_id' => 16, 'forum_parents' => 'a:0:{}'),
+ array('forum_id' => 11, 'parent_id' => 7, 'left_id' => 18, 'right_id' => 19, 'forum_parents' => 'a:0:{}'),
+
+ array('forum_id' => 6, 'parent_id' => 0, 'left_id' => 21, 'right_id' => 22, 'forum_parents' => ''),
+ )),
+ array('Move nested children to parent 0',
+ 4, 0, true, array(
+ array('forum_id' => 1, 'parent_id' => 0, 'left_id' => 1, 'right_id' => 6, 'forum_parents' => 'a:0:{}'),
+ array('forum_id' => 2, 'parent_id' => 1, 'left_id' => 2, 'right_id' => 3, 'forum_parents' => 'a:0:{}'),
+ array('forum_id' => 3, 'parent_id' => 1, 'left_id' => 4, 'right_id' => 5, 'forum_parents' => 'a:0:{}'),
+
+ array('forum_id' => 4, 'parent_id' => 0, 'left_id' => 7, 'right_id' => 8, 'forum_parents' => 'a:0:{}'),
+
+ array('forum_id' => 7, 'parent_id' => 0, 'left_id' => 9, 'right_id' => 18, 'forum_parents' => 'a:0:{}'),
+ array('forum_id' => 8, 'parent_id' => 7, 'left_id' => 10, 'right_id' => 11, 'forum_parents' => 'a:0:{}'),
+ array('forum_id' => 9, 'parent_id' => 7, 'left_id' => 12, 'right_id' => 15, 'forum_parents' => 'a:0:{}'),
+ array('forum_id' => 10, 'parent_id' => 9, 'left_id' => 13, 'right_id' => 14, 'forum_parents' => 'a:0:{}'),
+ array('forum_id' => 11, 'parent_id' => 7, 'left_id' => 16, 'right_id' => 17, 'forum_parents' => 'a:0:{}'),
+
+ array('forum_id' => 5, 'parent_id' => 0, 'left_id' => 19, 'right_id' => 22, 'forum_parents' => ''),
+ array('forum_id' => 6, 'parent_id' => 5, 'left_id' => 20, 'right_id' => 21, 'forum_parents' => ''),
+ )),
+ );
+ }
+
+ /**
+ * @dataProvider move_children_data
+ */
+ public function test_move_children($explain, $forum_id, $target_id, $expected_moved, $expected)
+ {
+ $this->assertEquals($expected_moved, $this->set->move_children($forum_id, $target_id));
+
+ $result = $this->db->sql_query("SELECT forum_id, parent_id, left_id, right_id, forum_parents
+ FROM phpbb_forums
+ ORDER BY left_id, forum_id ASC");
+ $this->assertEquals($expected, $this->db->sql_fetchrowset($result));
+ }
+
+ public function move_children_throws_item_data()
+ {
+ return array(
+ array('Item 0 does not exist', 0, 5),
+ array('Item does not exist', 200, 5),
+ );
+ }
+
+ /**
+ * @dataProvider move_children_throws_item_data
+ *
+ * @expectedException OutOfBoundsException
+ * @expectedExceptionMessage FORUM_NESTEDSET_INVALID_ITEM
+ */
+ public function test_move_children_throws_item($explain, $forum_id, $target_id)
+ {
+ $this->set->move_children($forum_id, $target_id);
+ }
+
+ public function move_children_throws_parent_data()
+ {
+ return array(
+ array('New parent is child', 4, 5),
+ array('New parent is child 2', 7, 9),
+ array('New parent does not exist', 1, 200),
+ );
+ }
+
+ /**
+ * @dataProvider move_children_throws_parent_data
+ *
+ * @expectedException OutOfBoundsException
+ * @expectedExceptionMessage FORUM_NESTEDSET_INVALID_PARENT
+ */
+ public function test_move_children_throws_parent($explain, $forum_id, $target_id)
+ {
+ $this->set->move_children($forum_id, $target_id);
+ }
+
+ public function change_parent_data()
+ {
+ return array(
+ array('Move single child up',
+ 6, 1, true, array(
+ array('forum_id' => 1, 'parent_id' => 0, 'left_id' => 1, 'right_id' => 8, 'forum_parents' => 'a:0:{}'),
+ array('forum_id' => 2, 'parent_id' => 1, 'left_id' => 2, 'right_id' => 3, 'forum_parents' => 'a:0:{}'),
+ array('forum_id' => 3, 'parent_id' => 1, 'left_id' => 4, 'right_id' => 5, 'forum_parents' => 'a:0:{}'),
+ array('forum_id' => 6, 'parent_id' => 1, 'left_id' => 6, 'right_id' => 7, 'forum_parents' => ''),
+
+ array('forum_id' => 4, 'parent_id' => 0, 'left_id' => 9, 'right_id' => 12, 'forum_parents' => 'a:0:{}'),
+ array('forum_id' => 5, 'parent_id' => 4, 'left_id' => 10, 'right_id' => 11, 'forum_parents' => 'a:0:{}'),
+
+ array('forum_id' => 7, 'parent_id' => 0, 'left_id' => 13, 'right_id' => 22, 'forum_parents' => 'a:0:{}'),
+ array('forum_id' => 8, 'parent_id' => 7, 'left_id' => 14, 'right_id' => 15, 'forum_parents' => 'a:0:{}'),
+ array('forum_id' => 9, 'parent_id' => 7, 'left_id' => 16, 'right_id' => 19, 'forum_parents' => 'a:0:{}'),
+ array('forum_id' => 10, 'parent_id' => 9, 'left_id' => 17, 'right_id' => 18, 'forum_parents' => 'a:0:{}'),
+ array('forum_id' => 11, 'parent_id' => 7, 'left_id' => 20, 'right_id' => 21, 'forum_parents' => 'a:0:{}'),
+ )),
+ array('Move nested children up',
+ 5, 1, true, array(
+ array('forum_id' => 1, 'parent_id' => 0, 'left_id' => 1, 'right_id' => 10, 'forum_parents' => 'a:0:{}'),
+ array('forum_id' => 2, 'parent_id' => 1, 'left_id' => 2, 'right_id' => 3, 'forum_parents' => 'a:0:{}'),
+ array('forum_id' => 3, 'parent_id' => 1, 'left_id' => 4, 'right_id' => 5, 'forum_parents' => 'a:0:{}'),
+ array('forum_id' => 5, 'parent_id' => 1, 'left_id' => 6, 'right_id' => 9, 'forum_parents' => ''),
+ array('forum_id' => 6, 'parent_id' => 5, 'left_id' => 7, 'right_id' => 8, 'forum_parents' => ''),
+
+ array('forum_id' => 4, 'parent_id' => 0, 'left_id' => 11, 'right_id' => 12, 'forum_parents' => 'a:0:{}'),
+
+ array('forum_id' => 7, 'parent_id' => 0, 'left_id' => 13, 'right_id' => 22, 'forum_parents' => 'a:0:{}'),
+ array('forum_id' => 8, 'parent_id' => 7, 'left_id' => 14, 'right_id' => 15, 'forum_parents' => 'a:0:{}'),
+ array('forum_id' => 9, 'parent_id' => 7, 'left_id' => 16, 'right_id' => 19, 'forum_parents' => 'a:0:{}'),
+ array('forum_id' => 10, 'parent_id' => 9, 'left_id' => 17, 'right_id' => 18, 'forum_parents' => 'a:0:{}'),
+ array('forum_id' => 11, 'parent_id' => 7, 'left_id' => 20, 'right_id' => 21, 'forum_parents' => 'a:0:{}'),
+ )),
+ array('Move single child down',
+ 6, 7, true, array(
+ array('forum_id' => 1, 'parent_id' => 0, 'left_id' => 1, 'right_id' => 6, 'forum_parents' => 'a:0:{}'),
+ array('forum_id' => 2, 'parent_id' => 1, 'left_id' => 2, 'right_id' => 3, 'forum_parents' => 'a:0:{}'),
+ array('forum_id' => 3, 'parent_id' => 1, 'left_id' => 4, 'right_id' => 5, 'forum_parents' => 'a:0:{}'),
+
+ array('forum_id' => 4, 'parent_id' => 0, 'left_id' => 7, 'right_id' => 10, 'forum_parents' => 'a:0:{}'),
+ array('forum_id' => 5, 'parent_id' => 4, 'left_id' => 8, 'right_id' => 9, 'forum_parents' => 'a:0:{}'),
+
+ array('forum_id' => 7, 'parent_id' => 0, 'left_id' => 11, 'right_id' => 22, 'forum_parents' => 'a:0:{}'),
+ array('forum_id' => 8, 'parent_id' => 7, 'left_id' => 12, 'right_id' => 13, 'forum_parents' => 'a:0:{}'),
+ array('forum_id' => 9, 'parent_id' => 7, 'left_id' => 14, 'right_id' => 17, 'forum_parents' => 'a:0:{}'),
+ array('forum_id' => 10, 'parent_id' => 9, 'left_id' => 15, 'right_id' => 16, 'forum_parents' => 'a:0:{}'),
+ array('forum_id' => 11, 'parent_id' => 7, 'left_id' => 18, 'right_id' => 19, 'forum_parents' => 'a:0:{}'),
+ array('forum_id' => 6, 'parent_id' => 7, 'left_id' => 20, 'right_id' => 21, 'forum_parents' => ''),
+ )),
+ array('Move nested children down',
+ 5, 7, true, array(
+ array('forum_id' => 1, 'parent_id' => 0, 'left_id' => 1, 'right_id' => 6, 'forum_parents' => 'a:0:{}'),
+ array('forum_id' => 2, 'parent_id' => 1, 'left_id' => 2, 'right_id' => 3, 'forum_parents' => 'a:0:{}'),
+ array('forum_id' => 3, 'parent_id' => 1, 'left_id' => 4, 'right_id' => 5, 'forum_parents' => 'a:0:{}'),
+
+ array('forum_id' => 4, 'parent_id' => 0, 'left_id' => 7, 'right_id' => 8, 'forum_parents' => 'a:0:{}'),
+
+ array('forum_id' => 7, 'parent_id' => 0, 'left_id' => 9, 'right_id' => 22, 'forum_parents' => 'a:0:{}'),
+ array('forum_id' => 8, 'parent_id' => 7, 'left_id' => 10, 'right_id' => 11, 'forum_parents' => 'a:0:{}'),
+ array('forum_id' => 9, 'parent_id' => 7, 'left_id' => 12, 'right_id' => 15, 'forum_parents' => 'a:0:{}'),
+ array('forum_id' => 10, 'parent_id' => 9, 'left_id' => 13, 'right_id' => 14, 'forum_parents' => 'a:0:{}'),
+ array('forum_id' => 11, 'parent_id' => 7, 'left_id' => 16, 'right_id' => 17, 'forum_parents' => 'a:0:{}'),
+ array('forum_id' => 5, 'parent_id' => 7, 'left_id' => 18, 'right_id' => 21, 'forum_parents' => ''),
+ array('forum_id' => 6, 'parent_id' => 5, 'left_id' => 19, 'right_id' => 20, 'forum_parents' => ''),
+ )),
+ array('Move single child to parent 0',
+ 6, 0, true, array(
+ array('forum_id' => 1, 'parent_id' => 0, 'left_id' => 1, 'right_id' => 6, 'forum_parents' => 'a:0:{}'),
+ array('forum_id' => 2, 'parent_id' => 1, 'left_id' => 2, 'right_id' => 3, 'forum_parents' => 'a:0:{}'),
+ array('forum_id' => 3, 'parent_id' => 1, 'left_id' => 4, 'right_id' => 5, 'forum_parents' => 'a:0:{}'),
+
+ array('forum_id' => 4, 'parent_id' => 0, 'left_id' => 7, 'right_id' => 10, 'forum_parents' => 'a:0:{}'),
+ array('forum_id' => 5, 'parent_id' => 4, 'left_id' => 8, 'right_id' => 9, 'forum_parents' => 'a:0:{}'),
+
+ array('forum_id' => 7, 'parent_id' => 0, 'left_id' => 11, 'right_id' => 20, 'forum_parents' => 'a:0:{}'),
+ array('forum_id' => 8, 'parent_id' => 7, 'left_id' => 12, 'right_id' => 13, 'forum_parents' => 'a:0:{}'),
+ array('forum_id' => 9, 'parent_id' => 7, 'left_id' => 14, 'right_id' => 17, 'forum_parents' => 'a:0:{}'),
+ array('forum_id' => 10, 'parent_id' => 9, 'left_id' => 15, 'right_id' => 16, 'forum_parents' => 'a:0:{}'),
+ array('forum_id' => 11, 'parent_id' => 7, 'left_id' => 18, 'right_id' => 19, 'forum_parents' => 'a:0:{}'),
+
+ array('forum_id' => 6, 'parent_id' => 0, 'left_id' => 21, 'right_id' => 22, 'forum_parents' => ''),
+ )),
+ array('Move nested children to parent 0',
+ 5, 0, true, array(
+ array('forum_id' => 1, 'parent_id' => 0, 'left_id' => 1, 'right_id' => 6, 'forum_parents' => 'a:0:{}'),
+ array('forum_id' => 2, 'parent_id' => 1, 'left_id' => 2, 'right_id' => 3, 'forum_parents' => 'a:0:{}'),
+ array('forum_id' => 3, 'parent_id' => 1, 'left_id' => 4, 'right_id' => 5, 'forum_parents' => 'a:0:{}'),
+
+ array('forum_id' => 4, 'parent_id' => 0, 'left_id' => 7, 'right_id' => 8, 'forum_parents' => 'a:0:{}'),
+
+ array('forum_id' => 7, 'parent_id' => 0, 'left_id' => 9, 'right_id' => 18, 'forum_parents' => 'a:0:{}'),
+ array('forum_id' => 8, 'parent_id' => 7, 'left_id' => 10, 'right_id' => 11, 'forum_parents' => 'a:0:{}'),
+ array('forum_id' => 9, 'parent_id' => 7, 'left_id' => 12, 'right_id' => 15, 'forum_parents' => 'a:0:{}'),
+ array('forum_id' => 10, 'parent_id' => 9, 'left_id' => 13, 'right_id' => 14, 'forum_parents' => 'a:0:{}'),
+ array('forum_id' => 11, 'parent_id' => 7, 'left_id' => 16, 'right_id' => 17, 'forum_parents' => 'a:0:{}'),
+
+ array('forum_id' => 5, 'parent_id' => 0, 'left_id' => 19, 'right_id' => 22, 'forum_parents' => ''),
+ array('forum_id' => 6, 'parent_id' => 5, 'left_id' => 20, 'right_id' => 21, 'forum_parents' => ''),
+ )),
+ );
+ }
+
+ /**
+ * @dataProvider change_parent_data
+ */
+ public function test_change_parent($explain, $forum_id, $target_id, $expected_moved, $expected)
+ {
+ $this->assertEquals($expected_moved, $this->set->change_parent($forum_id, $target_id));
+
+ $result = $this->db->sql_query("SELECT forum_id, parent_id, left_id, right_id, forum_parents
+ FROM phpbb_forums
+ ORDER BY left_id, forum_id ASC");
+ $this->assertEquals($expected, $this->db->sql_fetchrowset($result));
+ }
+
+ public function change_parent_throws_item_data()
+ {
+ return array(
+ array('Item 0 does not exist', 0, 5),
+ array('Item does not exist', 200, 5),
+ );
+ }
+
+ /**
+ * @dataProvider change_parent_throws_item_data
+ *
+ * @expectedException OutOfBoundsException
+ * @expectedExceptionMessage FORUM_NESTEDSET_INVALID_ITEM
+ */
+ public function test_change_parent_throws_item($explain, $forum_id, $target_id)
+ {
+ $this->set->change_parent($forum_id, $target_id);
+ }
+
+ public function change_parent_throws_parent_data()
+ {
+ return array(
+ array('New parent is child', 4, 5),
+ array('New parent is child 2', 7, 9),
+ array('New parent does not exist', 1, 200),
+ );
+ }
+
+ /**
+ * @dataProvider change_parent_throws_parent_data
+ *
+ * @expectedException OutOfBoundsException
+ * @expectedExceptionMessage FORUM_NESTEDSET_INVALID_PARENT
+ */
+ public function test_change_parent_throws_parent($explain, $forum_id, $target_id)
+ {
+ $this->set->change_parent($forum_id, $target_id);
+ }
+}
diff --git a/tests/tree/nestedset_forum_regenerate_test.php b/tests/tree/nestedset_forum_regenerate_test.php
new file mode 100644
index 0000000000..914cc5f749
--- /dev/null
+++ b/tests/tree/nestedset_forum_regenerate_test.php
@@ -0,0 +1,76 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+require_once dirname(__FILE__) . '/nestedset_forum_base.php';
+
+class phpbb_tests_tree_nestedset_forum_regenerate_test extends phpbb_tests_tree_nestedset_forum_base
+{
+ protected $fixed_set = array(
+ array('forum_id' => 1, 'parent_id' => 0, 'left_id' => 1, 'right_id' => 6, 'forum_parents' => ''),
+ array('forum_id' => 2, 'parent_id' => 1, 'left_id' => 2, 'right_id' => 3, 'forum_parents' => ''),
+ array('forum_id' => 3, 'parent_id' => 1, 'left_id' => 4, 'right_id' => 5, 'forum_parents' => ''),
+
+ array('forum_id' => 4, 'parent_id' => 0, 'left_id' => 7, 'right_id' => 12, 'forum_parents' => ''),
+ array('forum_id' => 5, 'parent_id' => 4, 'left_id' => 8, 'right_id' => 11, 'forum_parents' => ''),
+ array('forum_id' => 6, 'parent_id' => 5, 'left_id' => 9, 'right_id' => 10, 'forum_parents' => ''),
+
+ array('forum_id' => 7, 'parent_id' => 0, 'left_id' => 13, 'right_id' => 22, 'forum_parents' => ''),
+ array('forum_id' => 8, 'parent_id' => 7, 'left_id' => 14, 'right_id' => 15, 'forum_parents' => ''),
+ array('forum_id' => 9, 'parent_id' => 7, 'left_id' => 16, 'right_id' => 19, 'forum_parents' => ''),
+ array('forum_id' => 10, 'parent_id' => 9, 'left_id' => 17, 'right_id' => 18, 'forum_parents' => ''),
+ array('forum_id' => 11, 'parent_id' => 7, 'left_id' => 20, 'right_id' => 21, 'forum_parents' => ''),
+ );
+
+ public function regenerate_left_right_ids_data()
+ {
+ return array(
+ array('UPDATE phpbb_forums
+ SET left_id = 0,
+ right_id = 0', false),
+ array('UPDATE phpbb_forums
+ SET left_id = 28,
+ right_id = 28
+ WHERE left_id > 12', false),
+ array('UPDATE phpbb_forums
+ SET left_id = left_id * 2,
+ right_id = right_id * 2', false),
+ array('UPDATE phpbb_forums
+ SET left_id = left_id * 2,
+ right_id = right_id * 2
+ WHERE left_id > 12', false),
+ array('UPDATE phpbb_forums
+ SET left_id = left_id - 4,
+ right_id = right_id * 4
+ WHERE left_id > 4', false),
+ array('UPDATE phpbb_forums
+ SET left_id = 0,
+ right_id = 0
+ WHERE left_id > 12', true),
+ );
+ }
+
+ /**
+ * @dataProvider regenerate_left_right_ids_data
+ */
+ public function test_regenerate_left_right_ids($breaking_query, $reset_ids)
+ {
+ $result = $this->db->sql_query($breaking_query);
+
+ $this->assertEquals(23, $this->set->regenerate_left_right_ids(1, 0, $reset_ids));
+
+ $result = $this->db->sql_query('SELECT forum_id, parent_id, left_id, right_id, forum_parents
+ FROM phpbb_forums
+ ORDER BY left_id, forum_id ASC');
+ $this->assertEquals($this->fixed_set, $this->db->sql_fetchrowset($result));
+ }
+}
diff --git a/tests/tree/nestedset_forum_test.php b/tests/tree/nestedset_forum_test.php
new file mode 100644
index 0000000000..7ccdc0a9b5
--- /dev/null
+++ b/tests/tree/nestedset_forum_test.php
@@ -0,0 +1,120 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+require_once dirname(__FILE__) . '/nestedset_forum_base.php';
+
+class pphpbb_tests_tree_nestedset_forum_test extends phpbb_tests_tree_nestedset_forum_base
+{
+ public function forum_constructor_data()
+ {
+ return array(
+ array(array(
+ array('forum_id' => 1, 'parent_id' => 0, 'left_id' => 1, 'right_id' => 6),
+ array('forum_id' => 2, 'parent_id' => 1, 'left_id' => 2, 'right_id' => 3),
+ array('forum_id' => 3, 'parent_id' => 1, 'left_id' => 4, 'right_id' => 5),
+
+ array('forum_id' => 4, 'parent_id' => 0, 'left_id' => 7, 'right_id' => 12),
+ array('forum_id' => 5, 'parent_id' => 4, 'left_id' => 8, 'right_id' => 11),
+ array('forum_id' => 6, 'parent_id' => 5, 'left_id' => 9, 'right_id' => 10),
+
+ array('forum_id' => 7, 'parent_id' => 0, 'left_id' => 13, 'right_id' => 22),
+ array('forum_id' => 8, 'parent_id' => 7, 'left_id' => 14, 'right_id' => 15),
+ array('forum_id' => 9, 'parent_id' => 7, 'left_id' => 16, 'right_id' => 19),
+ array('forum_id' => 10, 'parent_id' => 9, 'left_id' => 17, 'right_id' => 18),
+ array('forum_id' => 11, 'parent_id' => 7, 'left_id' => 20, 'right_id' => 21),
+ )),
+ );
+ }
+
+ /**
+ * @dataProvider forum_constructor_data
+ */
+ public function test_forum_constructor($expected)
+ {
+ $result = $this->db->sql_query('SELECT forum_id, parent_id, left_id, right_id
+ FROM phpbb_forums
+ ORDER BY left_id, forum_id ASC');
+ $this->assertEquals($expected, $this->db->sql_fetchrowset($result));
+ }
+
+ public function get_sql_where_data()
+ {
+ return array(
+ array('SELECT forum_id
+ FROM phpbb_forums
+ %s
+ ORDER BY forum_id ASC',
+ 'WHERE', '', array(
+ array('forum_id' => 1),
+ array('forum_id' => 2),
+ array('forum_id' => 3),
+
+ array('forum_id' => 4),
+ array('forum_id' => 5),
+ array('forum_id' => 6),
+
+ array('forum_id' => 7),
+ array('forum_id' => 8),
+ array('forum_id' => 9),
+ array('forum_id' => 10),
+ array('forum_id' => 11),
+ )),
+ array('SELECT f.forum_id
+ FROM phpbb_forums f
+ %s
+ ORDER BY f.forum_id ASC',
+ 'WHERE', 'f.', array(
+ array('forum_id' => 1),
+ array('forum_id' => 2),
+ array('forum_id' => 3),
+
+ array('forum_id' => 4),
+ array('forum_id' => 5),
+ array('forum_id' => 6),
+
+ array('forum_id' => 7),
+ array('forum_id' => 8),
+ array('forum_id' => 9),
+ array('forum_id' => 10),
+ array('forum_id' => 11),
+ )),
+ array('SELECT forum_id
+ FROM phpbb_forums
+ WHERE forum_id < 4 %s
+ ORDER BY forum_id ASC',
+ 'AND', '', array(
+ array('forum_id' => 1),
+ array('forum_id' => 2),
+ array('forum_id' => 3),
+ )),
+ array('SELECT f.forum_id
+ FROM phpbb_forums f
+ WHERE f.forum_id < 4 %s
+ ORDER BY f.forum_id ASC',
+ 'AND', 'f.', array(
+ array('forum_id' => 1),
+ array('forum_id' => 2),
+ array('forum_id' => 3),
+ )),
+ );
+ }
+
+ /**
+ * @dataProvider get_sql_where_data
+ */
+ public function test_get_sql_where($sql_query, $operator, $column_prefix, $expected)
+ {
+ $result = $this->db->sql_query(sprintf($sql_query, $this->set->get_sql_where($operator, $column_prefix)));
+ $this->assertEquals($expected, $this->db->sql_fetchrowset($result));
+ }
+}
diff --git a/tests/ui/quick_links_test.php b/tests/ui/quick_links_test.php
new file mode 100644
index 0000000000..5bddb44a8b
--- /dev/null
+++ b/tests/ui/quick_links_test.php
@@ -0,0 +1,27 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+/**
+* @group ui
+*/
+class quick_links_test extends phpbb_ui_test_case
+{
+
+ public function test_quick_links()
+ {
+ $this->visit('index.php');
+ $this->assertEmpty(self::find_element('className', 'dropdown')->getText());
+ self::find_element('className', 'dropdown-toggle')->click();
+ $this->assertNotNull(self::find_element('className', 'dropdown')->getText());
+ }
+}
diff --git a/tests/upload/filespec_test.php b/tests/upload/filespec_test.php
new file mode 100644
index 0000000000..ed28bcb38f
--- /dev/null
+++ b/tests/upload/filespec_test.php
@@ -0,0 +1,338 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+require_once __DIR__ . '/../../phpBB/includes/functions.php';
+require_once __DIR__ . '/../../phpBB/includes/utf/utf_tools.php';
+require_once __DIR__ . '/../../phpBB/includes/functions_upload.php';
+
+class phpbb_filespec_test extends phpbb_test_case
+{
+ const TEST_COUNT = 100;
+ const PREFIX = 'phpbb_';
+ const MAX_STR_LEN = 50;
+ const UPLOAD_MAX_FILESIZE = 1000;
+
+ private $config;
+ public $path;
+
+ protected function setUp()
+ {
+ // Global $config required by unique_id
+ // Global $user required by filespec::additional_checks and
+ // filespec::move_file
+ global $config, $user;
+
+ if (!is_array($config))
+ {
+ $config = array();
+ }
+
+ $config['rand_seed'] = '';
+ $config['rand_seed_last_update'] = time() + 600;
+ // This config value is normally pulled from the database which is set
+ // to this value at install time.
+ // See: phpBB/install/schemas/schema_data.sql
+ $config['mime_triggers'] = 'body|head|html|img|plaintext|a href|pre|script|table|title';
+
+ $user = new phpbb_mock_user();
+ $user->lang = new phpbb_mock_lang();
+
+ $this->config = &$config;
+ $this->path = __DIR__ . '/fixture/';
+
+ // Create copies of the files for use in testing move_file
+ $iterator = new DirectoryIterator($this->path);
+ foreach ($iterator as $fileinfo)
+ {
+ if ($fileinfo->isDot() || $fileinfo->isDir())
+ {
+ continue;
+ }
+
+ copy($fileinfo->getPathname(), $this->path . 'copies/' . $fileinfo->getFilename() . '_copy');
+ if ($fileinfo->getFilename() === 'txt')
+ {
+ copy($fileinfo->getPathname(), $this->path . 'copies/' . $fileinfo->getFilename() . '_copy_2');
+ }
+ }
+
+ $guessers = array(
+ new \Symfony\Component\HttpFoundation\File\MimeType\FileinfoMimeTypeGuesser(),
+ new \Symfony\Component\HttpFoundation\File\MimeType\FileBinaryMimeTypeGuesser(),
+ new \phpbb\mimetype\content_guesser(),
+ new \phpbb\mimetype\extension_guesser(),
+ );
+ $guessers[2]->set_priority(-2);
+ $guessers[3]->set_priority(-2);
+ $this->mimetype_guesser = new \phpbb\mimetype\guesser($guessers);
+ }
+
+ private function get_filespec($override = array())
+ {
+ // Initialise a blank filespec object for use with trivial methods
+ $upload_ary = array(
+ 'name' => '',
+ 'type' => '',
+ 'size' => '',
+ 'tmp_name' => '',
+ 'error' => '',
+ );
+
+ return new filespec(array_merge($upload_ary, $override), null, $this->mimetype_guesser);
+ }
+
+ protected function tearDown()
+ {
+ global $user;
+ $this->config = array();
+ $user = null;
+
+ $iterator = new DirectoryIterator($this->path . 'copies');
+ foreach ($iterator as $fileinfo)
+ {
+ $name = $fileinfo->getFilename();
+ if ($name[0] !== '.')
+ {
+ unlink($fileinfo->getPathname());
+ }
+ }
+ }
+
+ public function additional_checks_variables()
+ {
+ // False here just indicates the file is too large and fails the
+ // filespec::additional_checks method because of it. All other code
+ // paths in that method are covered elsewhere.
+ return array(
+ array('gif', true),
+ array('jpg', false),
+ array('png', true),
+ array('tif', false),
+ array('txt', false),
+ );
+ }
+
+ /**
+ * @dataProvider additional_checks_variables
+ */
+ public function test_additional_checks($filename, $expected)
+ {
+ $upload = new phpbb_mock_fileupload();
+ $filespec = $this->get_filespec();
+ $filespec->upload = $upload;
+ $filespec->file_moved = true;
+ $filespec->filesize = $filespec->get_filesize($this->path . $filename);
+
+ $this->assertEquals($expected, $filespec->additional_checks());
+ }
+
+ public function check_content_variables()
+ {
+ // False here indicates that a file is non-binary and contains
+ // disallowed content that makes IE report the mimetype incorrectly.
+ return array(
+ array('gif', true),
+ array('jpg', true),
+ array('png', true),
+ array('tif', true),
+ array('txt', false),
+ );
+ }
+
+ /**
+ * @dataProvider check_content_variables
+ */
+ public function test_check_content($filename, $expected)
+ {
+ $disallowed_content = explode('|', $this->config['mime_triggers']);
+ $filespec = $this->get_filespec(array('tmp_name' => $this->path . $filename));
+ $this->assertEquals($expected, $filespec->check_content($disallowed_content));
+ // All files should pass if $disallowed_content is empty
+ $this->assertEquals(true, $filespec->check_content(array()));
+ }
+
+ public function clean_filename_variables()
+ {
+ $chunks = str_split('abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\'\\" /:*?<>|[];(){},#+=-_`', 8);
+ return array(
+ array($chunks[0] . $chunks[7]),
+ array($chunks[1] . $chunks[8]),
+ array($chunks[2] . $chunks[9]),
+ array($chunks[3] . $chunks[4]),
+ array($chunks[5] . $chunks[6]),
+ );
+ }
+
+ /**
+ * @dataProvider clean_filename_variables
+ */
+ public function test_clean_filename_real($filename)
+ {
+ $bad_chars = array("'", "\\", ' ', '/', ':', '*', '?', '"', '<', '>', '|');
+ $filespec = $this->get_filespec(array('name' => $filename));
+ $filespec->clean_filename('real', self::PREFIX);
+ $name = $filespec->realname;
+
+ $this->assertEquals(0, preg_match('/%(\w{2})/', $name));
+ foreach ($bad_chars as $char)
+ {
+ $this->assertFalse(strpos($name, $char));
+ }
+ }
+
+ public function test_clean_filename_unique()
+ {
+ $filenames = array();
+ for ($tests = 0; $tests < self::TEST_COUNT; $tests++)
+ {
+ $filespec = $this->get_filespec();
+ $filespec->clean_filename('unique', self::PREFIX);
+ $name = $filespec->realname;
+
+ $this->assertEquals(strlen($name), 32 + strlen(self::PREFIX));
+ $this->assertRegExp('#^[A-Za-z0-9]+$#', substr($name, strlen(self::PREFIX)));
+ $this->assertFalse(isset($filenames[$name]));
+ $filenames[$name] = true;
+ }
+ }
+
+ public function get_extension_variables()
+ {
+ return array(
+ array('file.png', 'png'),
+ array('file.phpbb.gif', 'gif'),
+ array('file..', ''),
+ array('.file..jpg.webp', 'webp'),
+ array('/test.com/file', ''),
+ array('/test.com/file.gif', 'gif'),
+ );
+ }
+
+ /**
+ * @dataProvider get_extension_variables
+ */
+ public function test_get_extension($filename, $expected)
+ {
+ $this->assertEquals($expected, filespec::get_extension($filename));
+ }
+
+ public function is_image_variables()
+ {
+ return array(
+ array('gif', 'image/gif', true),
+ array('jpg', 'image/jpg', true),
+ array('png', 'image/png', true),
+ array('tif', 'image/tif', true),
+ array('txt', 'text/plain', false),
+ array('jpg', 'application/octet-stream', false),
+ array('gif', 'application/octetstream', false),
+ array('png', 'application/mime', false),
+ );
+ }
+
+ /**
+ * @dataProvider is_image_variables
+ */
+ public function test_is_image($filename, $mimetype, $expected)
+ {
+ $filespec = $this->get_filespec(array('tmp_name' => $this->path . $filename, 'type' => $mimetype));
+ $this->assertEquals($expected, $filespec->is_image());
+ }
+
+ public function is_image_get_mimetype()
+ {
+ return array(
+ array('gif', 'image/gif', true),
+ array('jpg', 'image/jpg', true),
+ array('png', 'image/png', true),
+ array('tif', 'image/tif', true),
+ array('txt', 'text/plain', false),
+ array('jpg', 'application/octet-stream', true),
+ array('gif', 'application/octetstream', true),
+ array('png', 'application/mime', true),
+ );
+ }
+
+ /**
+ * @dataProvider is_image_get_mimetype
+ */
+ public function test_is_image_get_mimetype($filename, $mimetype, $expected)
+ {
+ if (!class_exists('finfo') && strtolower(substr(PHP_OS, 0, 3)) === 'win')
+ {
+ $this->markTestSkipped('Unable to test mimetype guessing without fileinfo support on Windows');
+ }
+
+ $filespec = $this->get_filespec(array('tmp_name' => $this->path . $filename, 'type' => $mimetype));
+ $filespec->get_mimetype($this->path . $filename);
+ $this->assertEquals($expected, $filespec->is_image());
+ }
+
+ public function move_file_variables()
+ {
+ return array(
+ array('gif_copy', 'gif_moved', 'image/gif', 'gif', false, true),
+ array('non_existant', 'still_non_existant', 'text/plain', 'txt', 'GENERAL_UPLOAD_ERROR', false),
+ array('txt_copy', 'txt_as_img', 'image/jpg', 'txt', false, true),
+ array('txt_copy_2', 'txt_moved', 'text/plain', 'txt', false, true),
+ array('jpg_copy', 'jpg_moved', 'image/png', 'jpg', false, true),
+ array('png_copy', 'png_moved', 'image/png', 'jpg', 'IMAGE_FILETYPE_MISMATCH', true),
+ );
+ }
+
+ /**
+ * @dataProvider move_file_variables
+ */
+ public function test_move_file($tmp_name, $realname, $mime_type, $extension, $error, $expected)
+ {
+ // Global $phpbb_root_path and $phpEx are required by phpbb_chmod
+ global $phpbb_root_path, $phpEx;
+ $phpbb_root_path = '';
+ $phpEx = 'php';
+
+ $upload = new phpbb_mock_fileupload();
+ $upload->max_filesize = self::UPLOAD_MAX_FILESIZE;
+
+ $filespec = $this->get_filespec(array(
+ 'tmp_name' => $this->path . 'copies/' . $tmp_name,
+ 'name' => $realname,
+ 'type' => $mime_type,
+ ));
+ $filespec->extension = $extension;
+ $filespec->upload = $upload;
+ $filespec->local = true;
+
+ $this->assertEquals($expected, $filespec->move_file($this->path . 'copies'));
+ $this->assertEquals($filespec->file_moved, file_exists($this->path . 'copies/' . $realname));
+ if ($error)
+ {
+ $this->assertEquals($error, $filespec->error[0]);
+ }
+
+ $phpEx = '';
+ }
+
+ /**
+ * @dataProvider clean_filename_variables
+ */
+ public function test_uploadname($filename)
+ {
+ $type_cast_helper = new \phpbb\request\type_cast_helper();
+
+ $upload_name = '';
+ $type_cast_helper->set_var($upload_name, $filename, 'string', true, true);
+ $filespec = $this->get_filespec(array('name'=> $upload_name));
+
+ $this->assertSame(trim(utf8_basename(htmlspecialchars($filename))), $filespec->uploadname);
+ }
+}
diff --git a/tests/upload/fileupload_test.php b/tests/upload/fileupload_test.php
new file mode 100644
index 0000000000..fcfb84125d
--- /dev/null
+++ b/tests/upload/fileupload_test.php
@@ -0,0 +1,149 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+require_once __DIR__ . '/../../phpBB/includes/functions.php';
+require_once __DIR__ . '/../../phpBB/includes/utf/utf_tools.php';
+require_once __DIR__ . '/../../phpBB/includes/functions_upload.php';
+require_once __DIR__ . '/../mock/filespec.php';
+
+class phpbb_fileupload_test extends phpbb_test_case
+{
+ private $path;
+
+ protected function setUp()
+ {
+ // Global $config required by unique_id
+ // Global $user required by several functions dealing with translations
+ // Global $request required by form_upload, local_upload and is_valid
+ global $config, $user, $request;
+
+ if (!is_array($config))
+ {
+ $config = array();
+ }
+
+ $config['rand_seed'] = '';
+ $config['rand_seed_last_update'] = time() + 600;
+
+ $user = new phpbb_mock_user();
+ $user->lang = new phpbb_mock_lang();
+
+ $request = new phpbb_mock_request();
+
+ $this->path = __DIR__ . '/fixture/';
+ }
+
+ private function gen_valid_filespec()
+ {
+ $filespec = new phpbb_mock_filespec();
+ $filespec->filesize = 1;
+ $filespec->extension = 'jpg';
+ $filespec->realname = 'valid';
+ $filespec->width = 2;
+ $filespec->height = 2;
+
+ return $filespec;
+ }
+
+ protected function tearDown()
+ {
+ // Clear globals
+ global $config, $user;
+ $config = array();
+ $user = null;
+ }
+
+ public function test_common_checks_invalid_extension()
+ {
+ $upload = new fileupload('', array('png'), 100);
+ $file = $this->gen_valid_filespec();
+ $upload->common_checks($file);
+ $this->assertEquals('DISALLOWED_EXTENSION', $file->error[0]);
+ }
+
+ public function test_common_checks_invalid_filename()
+ {
+ $upload = new fileupload('', array('jpg'), 100);
+ $file = $this->gen_valid_filespec();
+ $file->realname = 'invalid?';
+ $upload->common_checks($file);
+ $this->assertEquals('INVALID_FILENAME', $file->error[0]);
+ }
+
+ public function test_common_checks_too_large()
+ {
+ $upload = new fileupload('', array('jpg'), 100);
+ $file = $this->gen_valid_filespec();
+ $file->filesize = 1000;
+ $upload->common_checks($file);
+ $this->assertEquals('WRONG_FILESIZE', $file->error[0]);
+ }
+
+ public function test_common_checks_valid_file()
+ {
+ $upload = new fileupload('', array('jpg'), 1000);
+ $file = $this->gen_valid_filespec();
+ $upload->common_checks($file);
+ $this->assertEquals(0, sizeof($file->error));
+ }
+
+ public function test_local_upload()
+ {
+ $upload = new fileupload('', array('jpg'), 1000);
+
+ copy($this->path . 'jpg', $this->path . 'jpg.jpg');
+ $file = $upload->local_upload($this->path . 'jpg.jpg');
+ $this->assertEquals(0, sizeof($file->error));
+ unlink($this->path . 'jpg.jpg');
+ }
+
+ public function test_move_existent_file()
+ {
+ $upload = new fileupload('', array('jpg'), 1000);
+
+ copy($this->path . 'jpg', $this->path . 'jpg.jpg');
+ $file = $upload->local_upload($this->path . 'jpg.jpg');
+ $this->assertEquals(0, sizeof($file->error));
+ $this->assertFalse($file->move_file('../tests/upload/fixture'));
+ $this->assertFalse($file->file_moved);
+ $this->assertEquals(1, sizeof($file->error));
+ }
+
+ public function test_move_existent_file_overwrite()
+ {
+ $upload = new fileupload('', array('jpg'), 1000);
+
+ copy($this->path . 'jpg', $this->path . 'jpg.jpg');
+ copy($this->path . 'jpg', $this->path . 'copies/jpg.jpg');
+ $file = $upload->local_upload($this->path . 'jpg.jpg');
+ $this->assertEquals(0, sizeof($file->error));
+ $file->move_file('../tests/upload/fixture/copies', true);
+ $this->assertEquals(0, sizeof($file->error));
+ unlink($this->path . 'copies/jpg.jpg');
+ }
+
+ public function test_valid_dimensions()
+ {
+ $upload = new fileupload('', false, false, 1, 1, 100, 100);
+
+ $file1 = $this->gen_valid_filespec();
+ $file2 = $this->gen_valid_filespec();
+ $file2->height = 101;
+ $file3 = $this->gen_valid_filespec();
+ $file3->width = 0;
+
+ $this->assertTrue($upload->valid_dimensions($file1));
+ $this->assertFalse($upload->valid_dimensions($file2));
+ $this->assertFalse($upload->valid_dimensions($file3));
+ }
+}
diff --git a/tests/upload/fixture/copies/.gitkeep b/tests/upload/fixture/copies/.gitkeep
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/upload/fixture/copies/.gitkeep
diff --git a/tests/upload/fixture/gif b/tests/upload/fixture/gif
new file mode 100644
index 0000000000..b636f4b8df
--- /dev/null
+++ b/tests/upload/fixture/gif
Binary files differ
diff --git a/tests/upload/fixture/jpg b/tests/upload/fixture/jpg
new file mode 100644
index 0000000000..3cd5038e38
--- /dev/null
+++ b/tests/upload/fixture/jpg
Binary files differ
diff --git a/tests/upload/fixture/png b/tests/upload/fixture/png
new file mode 100644
index 0000000000..5514ad40e9
--- /dev/null
+++ b/tests/upload/fixture/png
Binary files differ
diff --git a/tests/upload/fixture/tif b/tests/upload/fixture/tif
new file mode 100644
index 0000000000..248b50f9cb
--- /dev/null
+++ b/tests/upload/fixture/tif
Binary files differ
diff --git a/tests/upload/fixture/txt b/tests/upload/fixture/txt
new file mode 100644
index 0000000000..a78c858f5c
--- /dev/null
+++ b/tests/upload/fixture/txt
@@ -0,0 +1,2 @@
+<HTML>mime trigger</HTML>
+The HTML tags should remain uppercase so that case-insensitivity can be checked.
diff --git a/tests/user/fixtures/user_loader.xml b/tests/user/fixtures/user_loader.xml
new file mode 100644
index 0000000000..f676f468a6
--- /dev/null
+++ b/tests/user/fixtures/user_loader.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<dataset>
+ <table name="phpbb_users">
+ <column>user_id</column>
+ <column>user_permissions</column>
+ <column>username</column>
+ <column>username_clean</column>
+ <column>user_sig</column>
+ <row>
+ <value>1</value>
+ <value></value>
+ <value>Guest</value>
+ <value>guest</value>
+ <value></value>
+ </row>
+ <row>
+ <value>2</value>
+ <value></value>
+ <value>Admin</value>
+ <value>admin</value>
+ <value></value>
+ </row>
+ <row>
+ <value>3</value>
+ <value></value>
+ <value>Test</value>
+ <value>test</value>
+ <value></value>
+ </row>
+ </table>
+</dataset>
diff --git a/tests/user/lang_test.php b/tests/user/lang_test.php
index d33f430955..bb11bb63cb 100644
--- a/tests/user/lang_test.php
+++ b/tests/user/lang_test.php
@@ -1,19 +1,23 @@
<?php
/**
*
-* @package testing
-* @copyright (c) 2011 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/session.php';
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
class phpbb_user_lang_test extends phpbb_test_case
{
public function test_user_lang_sprintf()
{
- $user = new user;
+ $user = new \phpbb\user('\phpbb\datetime');
$user->lang = array(
'FOO' => 'BAR',
'BARZ' => 'PENG',
@@ -26,6 +30,26 @@ class phpbb_user_lang_test extends phpbb_test_case
1 => '1 post', // 1
2 => '%d posts', // 2+
),
+ 'ARRY_NO_ZERO' => array(
+ 1 => '1 post', // 1
+ 2 => '%d posts', // 0, 2+
+ ),
+ 'ARRY_MISSING' => array(
+ 1 => '%d post', // 1
+ //Missing second plural
+ ),
+ 'ARRY_FLOAT' => array(
+ 1 => '1 post', // 1.x
+ 2 => '%1$.1f posts', // 0.x, 2+.x
+ ),
+ 'ARRY_EMPTY' => array(
+ ),
+ 'dateformat' => array(
+ 'AGO' => array(
+ 1 => '%d second',
+ 2 => '%d seconds',
+ ),
+ ),
);
// No param
@@ -51,8 +75,45 @@ class phpbb_user_lang_test extends phpbb_test_case
$this->assertEquals($user->lang('ARRY', 2), '2 posts');
$this->assertEquals($user->lang('ARRY', 123), '123 posts');
- // Bug PHPBB3-9949
+ // Empty array returns the language key
+ $this->assertEquals($user->lang('ARRY_EMPTY', 123), 'ARRY_EMPTY');
+
+ // No 0 key defined
+ $this->assertEquals($user->lang('ARRY_NO_ZERO', 0), '0 posts');
+ $this->assertEquals($user->lang('ARRY_NO_ZERO', 1), '1 post');
+ $this->assertEquals($user->lang('ARRY_NO_ZERO', 2), '2 posts');
+
+ // Array with missing keys
+ $this->assertEquals($user->lang('ARRY_MISSING', 2), '2 post');
+
+ // Floats as array key
+ $this->assertEquals($user->lang('ARRY_FLOAT', 1.3), '1 post');
+ $this->assertEquals($user->lang('ARRY_FLOAT', 2.0), '2.0 posts');
+ $this->assertEquals($user->lang('ARRY_FLOAT', 2.51), '2.5 posts');
+
+ // Use sub key, if first paramenter is an array
+ $this->assertEquals($user->lang(array('dateformat', 'AGO'), 2), '2 seconds');
+
+ // ticket PHPBB3-9949 - use first int to determinate the plural-form to use
$this->assertEquals($user->lang('ARRY', 1, 2), '1 post');
$this->assertEquals($user->lang('ARRY', 1, 's', 2), '1 post');
+
+ // ticket PHPBB3-10345 - different plural rules, not just 0/1/2+
+ $user = new \phpbb\user('\phpbb\datetime');
+ $user->lang = array(
+ 'PLURAL_RULE' => 13,
+ 'ARRY' => array(
+ 0 => '%d is 0', // 0
+ 1 => '%d is 1', // 1
+ 2 => '%d ends with 01-10', // ending with 01-10
+ 3 => '%d ends with 11-19', // ending with 11-19
+ 4 => '%d is part of the last rule', // everything else
+ ),
+ );
+ $this->assertEquals($user->lang('ARRY', 0), '0 is 0');
+ $this->assertEquals($user->lang('ARRY', 1), '1 is 1');
+ $this->assertEquals($user->lang('ARRY', 103), '103 ends with 01-10');
+ $this->assertEquals($user->lang('ARRY', 15), '15 ends with 11-19');
+ $this->assertEquals($user->lang('ARRY', 300), '300 is part of the last rule');
}
}
diff --git a/tests/user/user_loader_test.php b/tests/user/user_loader_test.php
new file mode 100644
index 0000000000..8d1f43707b
--- /dev/null
+++ b/tests/user/user_loader_test.php
@@ -0,0 +1,67 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+include_once(__DIR__ . '/../../phpBB/includes/utf/utf_tools.php');
+
+class phpbb_user_loader_test extends phpbb_database_test_case
+{
+ protected $db;
+ protected $user_loader;
+
+ public function getDataSet()
+ {
+ return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/user_loader.xml');
+ }
+
+ public function setUp()
+ {
+ parent::setUp();
+
+ $this->db = $this->new_dbal();
+ $this->user_loader = new \phpbb\user_loader($this->db, __DIR__ . '/../../phpBB/', 'php', 'phpbb_users');
+ }
+
+ public function test_load_get()
+ {
+ $this->user_loader->load_users(array(2));
+
+ $user = $this->user_loader->get_user(1);
+ $this->assertEquals(1, $user['user_id']);
+ $this->assertEquals('Guest', $user['username']);
+
+ $user = $this->user_loader->get_user(2);
+ $this->assertEquals(2, $user['user_id']);
+ $this->assertEquals('Admin', $user['username']);
+ }
+
+ public function test_load_get_unloaded()
+ {
+ $this->user_loader->load_users(array(2));
+
+ $user = $this->user_loader->get_user(3);
+ $this->assertEquals(1, $user['user_id']);
+ $this->assertEquals('Guest', $user['username']);
+
+ $user = $this->user_loader->get_user(3, true);
+ $this->assertEquals(3, $user['user_id']);
+ $this->assertEquals('Test', $user['username']);
+ }
+
+ public function test_load_user_by_username()
+ {
+ $user_id = $this->user_loader->load_user_by_username('Test');
+ $user = $this->user_loader->get_user($user_id);
+ $this->assertEquals(3, $user['user_id']);
+ $this->assertEquals('Test', $user['username']);
+ }
+}
diff --git a/tests/utf/normalizer_test.php b/tests/utf/normalizer_test.php
index 92230cfcc9..50eafda859 100644
--- a/tests/utf/normalizer_test.php
+++ b/tests/utf/normalizer_test.php
@@ -1,9 +1,13 @@
<?php
/**
*
-* @package testing
-* @copyright (c) 2011 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
diff --git a/tests/utf/utf8_clean_string_test.php b/tests/utf/utf8_clean_string_test.php
index 5ebf6409af..2bb65387e0 100644
--- a/tests/utf/utf8_clean_string_test.php
+++ b/tests/utf/utf8_clean_string_test.php
@@ -1,9 +1,13 @@
<?php
/**
*
-* @package testing
-* @copyright (c) 2008 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -11,7 +15,7 @@ require_once dirname(__FILE__) . '/../../phpBB/includes/utf/utf_tools.php';
class phpbb_utf_utf8_clean_string_test extends phpbb_test_case
{
- static public function cleanable_strings()
+ public function cleanable_strings()
{
return array(
array('MiXed CaSe', 'mixed case', 'Checking case folding'),
diff --git a/tests/utf/utf8_wordwrap_test.php b/tests/utf/utf8_wordwrap_test.php
index 39fdf73308..ab053e2911 100644
--- a/tests/utf/utf8_wordwrap_test.php
+++ b/tests/utf/utf8_wordwrap_test.php
@@ -1,9 +1,13 @@
<?php
/**
*
-* @package testing
-* @copyright (c) 2008 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
diff --git a/tests/version/version_fetch_test.php b/tests/version/version_fetch_test.php
new file mode 100644
index 0000000000..cfc87183cf
--- /dev/null
+++ b/tests/version/version_fetch_test.php
@@ -0,0 +1,63 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+/*
+* @group slow
+*/
+class phpbb_version_helper_fetch_test extends phpbb_test_case
+{
+ public function setUp()
+ {
+ parent::setUp();
+
+ global $phpbb_root_path, $phpEx;
+
+ include_once($phpbb_root_path . 'includes/functions.' . $phpEx);
+
+ $this->cache = $this->getMockBuilder('\phpbb\cache\service')
+ ->disableOriginalConstructor()
+ ->getMock();
+
+ $this->version_helper = new \phpbb\version_helper(
+ $this->cache,
+ new \phpbb\config\config(array(
+ 'version' => '3.1.0',
+ )),
+ new \phpbb\file_downloader(),
+ new \phpbb\user('\phpbb\datetime')
+ );
+ }
+
+ public function test_version_phpbb_com()
+ {
+ global $phpbb_root_path, $phpEx;
+ include_once($phpbb_root_path . 'includes/functions.' . $phpEx);
+
+ if (!phpbb_checkdnsrr('version.phpbb.com', 'A'))
+ {
+ $this->markTestSkipped(sprintf(
+ 'Could not find a DNS record for hostname %s. ' .
+ 'Assuming network is down.',
+ 'version.phpbb.com'
+ ));
+ }
+
+ $this->version_helper->get_versions();
+
+ // get_versions checks to make sure we got a valid versions file or
+ // throws an exception if we did not. We don't need to test anything
+ // here, but adding an assertion so we do not get a warning about no
+ // assertions in this test
+ $this->assertSame(true, true);
+ }
+}
diff --git a/tests/version/version_helper_remote_test.php b/tests/version/version_helper_remote_test.php
new file mode 100644
index 0000000000..b2d497b72a
--- /dev/null
+++ b/tests/version/version_helper_remote_test.php
@@ -0,0 +1,216 @@
+<?php
+/**
+ *
+ * This file is part of the phpBB Forum Software package.
+ *
+ * @copyright (c) phpBB Limited <https://www.phpbb.com>
+ * @license GNU General Public License, version 2 (GPL-2.0)
+ *
+ * For full copyright and license information, please see
+ * the docs/CREDITS.txt file.
+ *
+ */
+
+class version_helper_remote_test extends \phpbb_test_case
+{
+ protected $file_downloader;
+ protected $cache;
+ protected $version_helper;
+
+ public function setUp()
+ {
+ parent::setUp();
+
+ global $phpbb_root_path, $phpEx;
+
+ include_once($phpbb_root_path . 'includes/functions.' . $phpEx);
+
+ $config = new \phpbb\config\config(array(
+ 'version' => '3.1.0',
+ ));
+ $container = new \phpbb_mock_container_builder();
+ $db = new \phpbb\db\driver\factory($container);
+ $this->cache = $this->getMock('\phpbb\cache\service', array('get'), array(new \phpbb\cache\driver\null(), $config, $db, '../../', 'php'));
+ $this->cache->expects($this->any())
+ ->method('get')
+ ->with($this->anything())
+ ->will($this->returnValue(false));
+ $this->file_downloader = new phpbb_mock_file_downloader();
+
+ $this->user = new \phpbb\user('\phpbb\datetime');
+ $this->user->add_lang('acp/common');
+ $this->version_helper = new \phpbb\version_helper(
+ $this->cache,
+ $config,
+ $this->file_downloader,
+ $this->user
+ );
+ }
+
+ public function provider_get_versions()
+ {
+ return array(
+ array('', false, '', 'VERSIONCHECK_FAIL'),
+ array('foobar', false, '', 'VERSIONCHECK_FAIL'),
+ array('{
+ "stable": {
+ "1.0": {
+ "current": "1.0.1",
+ "download": "https://www.phpbb.com/customise/db/download/104136",
+ "announcement": "https://www.phpbb.com/customise/db/extension/boardrules/",
+ "eol": null,
+ "security": false
+ }
+ }
+}', true, array (
+ 'stable' => array (
+ '1.0' => array (
+ 'current' => '1.0.1',
+ 'download' => 'https://www.phpbb.com/customise/db/download/104136',
+ 'announcement' => 'https://www.phpbb.com/customise/db/extension/boardrules/',
+ 'eol' => NULL,
+ 'security' => false,
+ ),
+ ),
+ 'unstable' => array (
+ '1.0' => array (
+ 'current' => '1.0.1',
+ 'download' => 'https://www.phpbb.com/customise/db/download/104136',
+ 'announcement' => 'https://www.phpbb.com/customise/db/extension/boardrules/',
+ 'eol' => NULL,
+ 'security' => false,
+ ),
+ ),
+ )),
+ array('{
+ "foobar": {
+ "1.0": {
+ "current": "1.0.1",
+ "download": "https://www.phpbb.com/customise/db/download/104136",
+ "announcement": "https://www.phpbb.com/customise/db/extension/boardrules/",
+ "eol": null,
+ "security": false
+ }
+ }
+}', false, '', 'VERSIONCHECK_FAIL'),
+ array('{
+ "stable": {
+ "1.0": {
+ "current": "1.0.1<script>alert(\'foo\');</script>",
+ "download": "https://www.phpbb.com/customise/db/download/104136<script>alert(\'foo\');</script>",
+ "announcement": "https://www.phpbb.com/customise/db/extension/boardrules/<script>alert(\'foo\');</script>",
+ "eol": "<script>alert(\'foo\');</script>",
+ "security": "<script>alert(\'foo\');</script>"
+ }
+ }
+}', false, null, 'VERSIONCHECK_INVALID_VERSION'),
+ array('{
+ "unstable": {
+ "1.0": {
+ "current": "1.0.1<script>alert(\'foo\');</script>",
+ "download": "https://www.phpbb.com/customise/db/download/104136<script>alert(\'foo\');</script>",
+ "announcement": "https://www.phpbb.com/customise/db/extension/boardrules/<script>alert(\'foo\');</script>",
+ "eol": "<script>alert(\'foo\');</script>",
+ "security": "<script>alert(\'foo\');</script>"
+ }
+ }
+}', false, null, 'VERSIONCHECK_INVALID_VERSION'),
+ array('{
+ "unstable": {
+ "1.0<script>alert(\'foo\');</script>": {
+ "current": "1.0.1",
+ "download": "https://www.phpbb.com/customise/db/download/104136",
+ "announcement": "https://www.phpbb.com/customise/db/extension/boardrules/",
+ "eol": "",
+ "security": ""
+ }
+ }
+}', false, array('stable' => array(), 'unstable' => array()), 'VERSIONCHECK_INVALID_VERSION'),
+ array('{
+ "\"\n<script>alert(\'foo\');</script>\n": "test",
+ "stable": {
+ "1.0": {
+ "current": "1.0.1",
+ "download": "https://www.phpbb.com/customise/db/download/104136",
+ "announcement": "https://www.phpbb.com/customise/db/extension/boardrules/",
+ "eol": null,
+ "security": false
+ }
+ }
+}', true, array (
+ 'stable' => array (
+ '1.0' => array (
+ 'current' => '1.0.1',
+ 'download' => 'https://www.phpbb.com/customise/db/download/104136',
+ 'announcement' => 'https://www.phpbb.com/customise/db/extension/boardrules/',
+ 'eol' => NULL,
+ 'security' => false,
+ ),
+ ),
+ 'unstable' => array (
+ '1.0' => array (
+ 'current' => '1.0.1',
+ 'download' => 'https://www.phpbb.com/customise/db/download/104136',
+ 'announcement' => 'https://www.phpbb.com/customise/db/extension/boardrules/',
+ 'eol' => NULL,
+ 'security' => false,
+ ),
+ ),
+ )),
+ array('{
+ "unstable": {
+ "1.0": {
+ "current": "1.0.1",
+ "download": "https://www.phpbb.com/customise/db/download/104136",
+ "announcement": "https://www.phpbb.com/customise/db/extension/boardrules/",
+ "eol": null,
+ "security": false,
+ "foobar": "<script>alert(\'test\');<script>"
+ }
+ }
+}', true, array('stable' => array(), 'unstable' => array('1.0' => array(
+ 'current' => '1.0.1',
+ 'download' => 'https://www.phpbb.com/customise/db/download/104136',
+ 'announcement' => 'https://www.phpbb.com/customise/db/extension/boardrules/',
+ 'security' => false,
+ ))), 'VERSIONCHECK_INVALID_ENTRY'),
+ array('{
+ "unstable": {
+ "1.0": {
+ "current<script>alert(\'foo\');</script>": "1.0.1",
+ "download2": "https://www.phpbb.com/customise/db/download/104136",
+ "bannouncement": "https://www.phpbb.com/customise/db/extension/boardrules/",
+ "eol": null,
+ "security": false,
+ "foobar": "<script>alert(\'test\');<script>"
+ }
+ }
+}', true, array('stable' => array(), 'unstable' => array('1.0' => array(
+ 'security' => false,
+ ))), 'VERSIONCHECK_INVALID_ENTRY'),
+ );
+ }
+
+ /**
+ * @dataProvider provider_get_versions
+ */
+ public function test_get_versions($input, $valid_data, $expected_return = '', $expected_exception = '')
+ {
+ $this->file_downloader->set($input);
+
+ if (!$valid_data)
+ {
+ try {
+ $return = $this->version_helper->get_versions();
+ } catch (\RuntimeException $e) {
+ $this->assertEquals((string)$e->getMessage(), $this->user->lang($expected_exception));
+ }
+ }
+ else
+ {
+ $return = $this->version_helper->get_versions();
+ }
+
+ $this->assertEquals($expected_return, $return);
+ }
+}
diff --git a/tests/version/version_test.php b/tests/version/version_test.php
new file mode 100644
index 0000000000..0ed0fcb589
--- /dev/null
+++ b/tests/version/version_test.php
@@ -0,0 +1,827 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+class phpbb_version_helper_test extends phpbb_test_case
+{
+ public function setUp()
+ {
+ parent::setUp();
+
+ global $phpbb_root_path, $phpEx;
+
+ include_once($phpbb_root_path . 'includes/functions.' . $phpEx);
+
+ $this->cache = $this->getMockBuilder('\phpbb\cache\service')
+ ->disableOriginalConstructor()
+ ->getMock();
+
+ $this->version_helper = new \phpbb\version_helper(
+ $this->cache,
+ new \phpbb\config\config(array(
+ 'version' => '3.1.0',
+ )),
+ new \phpbb\file_downloader(),
+ new \phpbb\user('\phpbb\datetime')
+ );
+ }
+
+ public function is_stable_data()
+ {
+ return array(
+ array(
+ '3.0.0-a1',
+ false,
+ ),
+ array(
+ '3.0.0-b1',
+ false,
+ ),
+ array(
+ '3.0.0-rc1',
+ false,
+ ),
+ array(
+ '3.0.0-RC1',
+ false,
+ ),
+ array(
+ '3.0.0',
+ true,
+ ),
+ array(
+ '3.0.0-pl1',
+ true,
+ ),
+ array(
+ '3.0.0.1-pl1',
+ true,
+ ),
+ array(
+ '3.1-dev',
+ false,
+ ),
+ array(
+ 'foobar',
+ false,
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider is_stable_data
+ */
+ public function test_is_stable($version, $expected)
+ {
+ $this->assertSame($expected, $this->version_helper->is_stable($version));
+ }
+
+ public function get_suggested_updates_data()
+ {
+ return array(
+ array(
+ '1.0.0',
+ array(
+ '1.0' => array(
+ 'current' => '1.0.1',
+ ),
+ '1.1' => array(
+ 'current' => '1.1.1',
+ ),
+ ),
+ array(
+ '1.0' => array(
+ 'current' => '1.0.1',
+ ),
+ '1.1' => array(
+ 'current' => '1.1.1',
+ ),
+ ),
+ ),
+ array(
+ '1.0.1',
+ array(
+ '1.0' => array(
+ 'current' => '1.0.1',
+ ),
+ '1.1' => array(
+ 'current' => '1.1.1',
+ ),
+ ),
+ array(
+ '1.1' => array(
+ 'current' => '1.1.1',
+ ),
+ ),
+ ),
+ array(
+ '1.0.1-a1',
+ array(
+ '1.0' => array(
+ 'current' => '1.0.1-a2',
+ ),
+ '1.1' => array(
+ 'current' => '1.1.0',
+ ),
+ ),
+ array(
+ '1.0' => array(
+ 'current' => '1.0.1-a2',
+ ),
+ '1.1' => array(
+ 'current' => '1.1.0',
+ ),
+ ),
+ ),
+ array(
+ '1.1.0',
+ array(
+ '1.0' => array(
+ 'current' => '1.0.1',
+ ),
+ '1.1' => array(
+ 'current' => '1.1.1',
+ ),
+ ),
+ array(
+ '1.1' => array(
+ 'current' => '1.1.1',
+ ),
+ ),
+ ),
+ array(
+ '1.1.1',
+ array(
+ '1.0' => array(
+ 'current' => '1.0.1',
+ ),
+ '1.1' => array(
+ 'current' => '1.1.1',
+ ),
+ ),
+ array(),
+ ),
+ array(
+ '1.1.0-a1',
+ array(
+ '1.0' => array(
+ 'current' => '1.0.1',
+ ),
+ '1.1' => array(
+ 'current' => '1.1.0-a2',
+ ),
+ ),
+ array(
+ '1.1' => array(
+ 'current' => '1.1.0-a2',
+ ),
+ ),
+ ),
+ array(
+ '1.1.0',
+ array(),
+ array(),
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider get_suggested_updates_data
+ */
+ public function test_get_suggested_updates($current_version, $versions, $expected)
+ {
+ $version_helper = $this
+ ->getMockBuilder('\phpbb\version_helper')
+ ->setMethods(array(
+ 'get_versions_matching_stability',
+ ))
+ ->setConstructorArgs(array(
+ $this->cache,
+ new \phpbb\config\config(array(
+ 'version' => $current_version,
+ )),
+ new \phpbb\file_downloader(),
+ new \phpbb\user('\phpbb\datetime'),
+ ))
+ ->getMock()
+ ;
+
+ $version_helper->expects($this->any())
+ ->method('get_versions_matching_stability')
+ ->will($this->returnValue($versions));
+
+ $this->assertSame($expected, $version_helper->get_suggested_updates());
+ }
+
+ public function get_latest_on_current_branch_data()
+ {
+ return array(
+ array(
+ '1.0.0',
+ array(
+ '1.0' => array(
+ 'current' => '1.0.1',
+ ),
+ '1.1' => array(
+ 'current' => '1.1.1',
+ ),
+ ),
+ '1.0.1',
+ ),
+ array(
+ '1.0.1',
+ array(
+ '1.0' => array(
+ 'current' => '1.0.1',
+ ),
+ '1.1' => array(
+ 'current' => '1.1.1',
+ ),
+ ),
+ '1.0.1',
+ ),
+ array(
+ '1.0.1-a1',
+ array(
+ '1.0' => array(
+ 'current' => '1.0.1-a2',
+ ),
+ '1.1' => array(
+ 'current' => '1.1.0',
+ ),
+ ),
+ '1.0.1-a2',
+ ),
+ array(
+ '1.1.0',
+ array(
+ '1.0' => array(
+ 'current' => '1.0.1',
+ ),
+ '1.1' => array(
+ 'current' => '1.1.1',
+ ),
+ ),
+ '1.1.1',
+ ),
+ array(
+ '1.1.1',
+ array(
+ '1.0' => array(
+ 'current' => '1.0.1',
+ ),
+ '1.1' => array(
+ 'current' => '1.1.1',
+ ),
+ ),
+ '1.1.1',
+ ),
+ array(
+ '1.1.0-a1',
+ array(
+ '1.0' => array(
+ 'current' => '1.0.1',
+ ),
+ '1.1' => array(
+ 'current' => '1.1.0-a2',
+ ),
+ ),
+ '1.1.0-a2',
+ ),
+ array(
+ '1.1.0',
+ array(),
+ null,
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider get_latest_on_current_branch_data
+ */
+ public function test_get_latest_on_current_branch($current_version, $versions, $expected)
+ {
+ $version_helper = $this
+ ->getMockBuilder('\phpbb\version_helper')
+ ->setMethods(array(
+ 'get_versions_matching_stability',
+ ))
+ ->setConstructorArgs(array(
+ $this->cache,
+ new \phpbb\config\config(array(
+ 'version' => $current_version,
+ )),
+ new \phpbb\file_downloader(),
+ new \phpbb\user('\phpbb\datetime'),
+ ))
+ ->getMock()
+ ;
+
+ $version_helper->expects($this->any())
+ ->method('get_versions_matching_stability')
+ ->will($this->returnValue($versions));
+
+ $this->assertSame($expected, $version_helper->get_latest_on_current_branch());
+ }
+
+ public function get_update_on_branch_data()
+ {
+ return array(
+ array(
+ '1.0.0',
+ array(
+ '1.0' => array(
+ 'current' => '1.0.1',
+ ),
+ '1.1' => array(
+ 'current' => '1.1.1',
+ ),
+ ),
+ array(
+ 'current' => '1.0.1',
+ ),
+ ),
+ array(
+ '1.0.1',
+ array(
+ '1.0' => array(
+ 'current' => '1.0.1',
+ ),
+ '1.1' => array(
+ 'current' => '1.1.1',
+ ),
+ ),
+ array(),
+ ),
+ array(
+ '1.0.1-a1',
+ array(
+ '1.0' => array(
+ 'current' => '1.0.1-a2',
+ ),
+ '1.1' => array(
+ 'current' => '1.1.0',
+ ),
+ ),
+ array(
+ 'current' => '1.0.1-a2',
+ ),
+ ),
+ array(
+ '1.1.0',
+ array(
+ '1.0' => array(
+ 'current' => '1.0.1',
+ ),
+ '1.1' => array(
+ 'current' => '1.1.1',
+ ),
+ ),
+ array(
+ 'current' => '1.1.1',
+ ),
+ ),
+ array(
+ '1.1.1',
+ array(
+ '1.0' => array(
+ 'current' => '1.0.1',
+ ),
+ '1.1' => array(
+ 'current' => '1.1.1',
+ ),
+ ),
+ array(),
+ ),
+ array(
+ '1.1.0-a1',
+ array(
+ '1.0' => array(
+ 'current' => '1.0.1',
+ ),
+ '1.1' => array(
+ 'current' => '1.1.0-a2',
+ ),
+ ),
+ array(
+ 'current' => '1.1.0-a2',
+ ),
+ ),
+ array(
+ '1.1.0',
+ array(),
+ array(),
+ ),
+ // Latest safe release is 1.0.1
+ array(
+ '1.0.0',
+ array(
+ '1.0' => array(
+ 'current' => '1.0.1',
+ 'security' => '1.0.1',
+ ),
+ '1.1' => array(
+ 'current' => '1.1.1',
+ ),
+ ),
+ array(
+ 'current' => '1.0.1',
+ 'security' => '1.0.1',
+ ),
+ ),
+ // Latest safe release is 1.0.0
+ array(
+ '1.0.0',
+ array(
+ '1.0' => array(
+ 'current' => '1.0.1',
+ 'security' => '1.0.0',
+ ),
+ '1.1' => array(
+ 'current' => '1.1.1',
+ ),
+ ),
+ array(
+ 'current' => '1.0.1',
+ 'security' => '1.0.0',
+ ),
+ ),
+ // Latest safe release is 1.1.0
+ array(
+ '1.0.0',
+ array(
+ '1.0' => array(
+ 'current' => '1.0.1',
+ 'security' => '1.1.0',
+ ),
+ '1.1' => array(
+ 'current' => '1.1.1',
+ ),
+ ),
+ array(
+ 'current' => '1.1.1',
+ ),
+ ),
+ // Latest 1.0 release is EOL
+ array(
+ '1.0.0',
+ array(
+ '1.0' => array(
+ 'current' => '1.0.1',
+ 'eol' => true,
+ ),
+ '1.1' => array(
+ 'current' => '1.1.1',
+ ),
+ ),
+ array(
+ 'current' => '1.1.1',
+ ),
+ ),
+ // All are EOL -- somewhat undefined behavior
+ array(
+ '1.0.0',
+ array(
+ '1.0' => array(
+ 'current' => '1.0.1',
+ 'eol' => true,
+ ),
+ '1.1' => array(
+ 'current' => '1.1.1',
+ 'eol' => true,
+ ),
+ ),
+ array(),
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider get_update_on_branch_data
+ */
+ public function test_get_update_on_branch($current_version, $versions, $expected)
+ {
+ $version_helper = $this
+ ->getMockBuilder('\phpbb\version_helper')
+ ->setMethods(array(
+ 'get_versions_matching_stability',
+ ))
+ ->setConstructorArgs(array(
+ $this->cache,
+ new \phpbb\config\config(array(
+ 'version' => $current_version,
+ )),
+ new \phpbb\file_downloader(),
+ new \phpbb\user('\phpbb\datetime'),
+ ))
+ ->getMock()
+ ;
+
+ $version_helper->expects($this->any())
+ ->method('get_versions_matching_stability')
+ ->will($this->returnValue($versions));
+
+ $this->assertSame($expected, $version_helper->get_update_on_branch());
+ }
+
+ public function get_ext_update_on_branch_data()
+ {
+ return array(
+ // Single branch, check version for current branch
+ array(
+ '3.1.0',
+ '1.0.0',
+ array(
+ '3.1' => array(
+ 'current' => '1.0.1',
+ ),
+ ),
+ array(
+ 'current' => '1.0.1',
+ ),
+ ),
+ array(
+ '3.1.0',
+ '1.0.1',
+ array(
+ '3.1' => array(
+ 'current' => '1.0.1',
+ ),
+ ),
+ array(),
+ ),
+ array(
+ '3.2.0',
+ '1.0.0',
+ array(
+ '3.2' => array(
+ 'current' => '1.1.1',
+ ),
+ ),
+ array(
+ 'current' => '1.1.1',
+ ),
+ ),
+ array(
+ '3.2.0',
+ '1.1.1',
+ array(
+ '3.2' => array(
+ 'current' => '1.1.1',
+ ),
+ ),
+ array(),
+ ),
+ // Single branch, check for newest version when branches don't match up
+ array(
+ '3.1.0',
+ '1.0.0',
+ array(
+ '3.2' => array(
+ 'current' => '1.1.1',
+ ),
+ ),
+ array(
+ 'current' => '1.1.1',
+ ),
+ ),
+ array(
+ '3.1.0',
+ '1.1.1',
+ array(
+ '3.2' => array(
+ 'current' => '1.1.1',
+ ),
+ ),
+ array(),
+ ),
+ array(
+ '3.2.0',
+ '1.0.0',
+ array(
+ '3.1' => array(
+ 'current' => '1.0.1',
+ ),
+ ),
+ array(
+ 'current' => '1.0.1',
+ ),
+ ),
+ array(
+ '3.2.0',
+ '1.0.1',
+ array(
+ '3.1' => array(
+ 'current' => '1.0.1',
+ ),
+ ),
+ array(),
+ ),
+ array(
+ '3.3.0',
+ '1.0.0',
+ array(
+ '3.2' => array(
+ 'current' => '1.1.1',
+ ),
+ ),
+ array(
+ 'current' => '1.1.1',
+ ),
+ ),
+ array(
+ '3.3.0',
+ '1.1.1',
+ array(
+ '3.2' => array(
+ 'current' => '1.1.1',
+ ),
+ ),
+ array(),
+ ),
+ // Multiple branches, check version for current branch
+ array(
+ '3.1.0',
+ '1.0.0',
+ array(
+ '3.1' => array(
+ 'current' => '1.0.1',
+ ),
+ '3.2' => array(
+ 'current' => '1.1.1',
+ ),
+ ),
+ array(
+ 'current' => '1.0.1',
+ ),
+ ),
+ array(
+ '3.1.0',
+ '1.0.1',
+ array(
+ '3.1' => array(
+ 'current' => '1.0.1',
+ ),
+ '3.2' => array(
+ 'current' => '1.1.1',
+ ),
+ ),
+ array(),
+ ),
+ array(
+ '3.1.0',
+ '1.1.1',
+ array(
+ '3.1' => array(
+ 'current' => '1.0.1',
+ ),
+ '3.2' => array(
+ 'current' => '1.1.1',
+ ),
+ ),
+ array(),
+ ),
+ array(
+ '3.2.0',
+ '1.0.0',
+ array(
+ '3.1' => array(
+ 'current' => '1.0.1',
+ ),
+ '3.2' => array(
+ 'current' => '1.1.1',
+ ),
+ ),
+ array(
+ 'current' => '1.1.1',
+ ),
+ ),
+ array(
+ '3.2.0',
+ '1.0.1',
+ array(
+ '3.1' => array(
+ 'current' => '1.0.1',
+ ),
+ '3.2' => array(
+ 'current' => '1.1.1',
+ ),
+ ),
+ array(
+ 'current' => '1.1.1',
+ ),
+ ),
+ array(
+ '3.2.0',
+ '1.1.1',
+ array(
+ '3.1' => array(
+ 'current' => '1.0.1',
+ ),
+ '3.2' => array(
+ 'current' => '1.1.1',
+ ),
+ ),
+ array(),
+ ),
+ // Multiple branches, check for newest version when branches don't match up
+ array(
+ '3.3.0',
+ '1.0.0',
+ array(
+ '3.1' => array(
+ 'current' => '1.0.1',
+ ),
+ '3.2' => array(
+ 'current' => '1.1.1',
+ ),
+ ),
+ array(
+ 'current' => '1.1.1',
+ ),
+ ),
+ array(
+ '3.3.0',
+ '1.0.1',
+ array(
+ '3.1' => array(
+ 'current' => '1.0.1',
+ ),
+ '3.2' => array(
+ 'current' => '1.1.1',
+ ),
+ ),
+ array(
+ 'current' => '1.1.1',
+ ),
+ ),
+ array(
+ '3.3.0',
+ '1.1.0',
+ array(
+ '3.1' => array(
+ 'current' => '1.0.1',
+ ),
+ '3.2' => array(
+ 'current' => '1.1.1',
+ ),
+ ),
+ array(
+ 'current' => '1.1.1',
+ ),
+ ),
+ array(
+ '3.3.0',
+ '1.1.1',
+ array(
+ '3.1' => array(
+ 'current' => '1.0.1',
+ ),
+ '3.2' => array(
+ 'current' => '1.1.1',
+ ),
+ ),
+ array(),
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider get_ext_update_on_branch_data
+ */
+ public function test_get_ext_update_on_branch($phpbb_version, $ext_version, $versions, $expected)
+ {
+ $version_helper = $this
+ ->getMockBuilder('\phpbb\version_helper')
+ ->setMethods(array(
+ 'get_versions_matching_stability',
+ ))
+ ->setConstructorArgs(array(
+ $this->cache,
+ new \phpbb\config\config(array(
+ 'version' => $phpbb_version,
+ )),
+ new \phpbb\file_downloader(),
+ new \phpbb\user('\phpbb\datetime'),
+ ))
+ ->getMock()
+ ;
+
+ $version_helper->expects($this->any())
+ ->method('get_versions_matching_stability')
+ ->will($this->returnValue($versions));
+
+ $version_helper->set_current_version($ext_version);
+
+ $this->assertSame($expected, $version_helper->get_ext_update_on_branch());
+ }
+}
diff --git a/tests/viewonline/helper_test.php b/tests/viewonline/helper_test.php
new file mode 100644
index 0000000000..bbbed59de7
--- /dev/null
+++ b/tests/viewonline/helper_test.php
@@ -0,0 +1,46 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+class phpbb_viewonline_helper_test extends phpbb_test_case
+{
+ public function setUp()
+ {
+ parent::setUp();
+
+ $this->viewonline_helper = new \phpbb\viewonline_helper(new \phpbb\filesystem());
+ }
+
+ public function session_pages_data()
+ {
+ return array(
+ array('index.php', 'index'),
+ array('foobar/test.php', 'foobar/test'),
+ array('', ''),
+ array('./../../index.php', '../../index'),
+ array('../subdir/index.php', '../subdir/index'),
+ array('../index.php', '../index'),
+ array('././index.php', 'index'),
+ array('./index.php', 'index'),
+ );
+ }
+
+ /**
+ * @dataProvider session_pages_data
+ */
+ public function test_get_user_page($session_page, $expected)
+ {
+ $on_page = $this->viewonline_helper->get_user_page($session_page);
+ $this->assertArrayHasKey(1, $on_page);
+ $this->assertSame($expected, $on_page[1]);
+ }
+}
diff --git a/tests/wrapper/gmgetdate_test.php b/tests/wrapper/gmgetdate_test.php
index a838cfdba9..2e55a78d21 100644
--- a/tests/wrapper/gmgetdate_test.php
+++ b/tests/wrapper/gmgetdate_test.php
@@ -1,9 +1,13 @@
<?php
/**
*
-* @package testing
-* @copyright (c) 2011 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -11,26 +15,28 @@ require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
class phpbb_wrapper_gmgetdate_test extends phpbb_test_case
{
- public function test_gmgetdate()
+ public static function phpbb_gmgetdate_data()
{
- $this->run_gmgetdate_assertion();
- $this->run_test_with_timezone('UTC');
- $this->run_test_with_timezone('Europe/Berlin');
- $this->run_test_with_timezone('America/Los_Angeles');
- $this->run_test_with_timezone('Antarctica/South_Pole');
+ return array(
+ array(''),
+ array('UTC'),
+ array('Europe/Berlin'),
+ array('America/Los_Angeles'),
+ array('Antarctica/South_Pole'),
+ );
}
- protected function run_test_with_timezone($timezone_identifier)
+ /**
+ * @dataProvider phpbb_gmgetdate_data
+ */
+ public function test_phpbb_gmgetdate($timezone_identifier)
{
- $current_timezone = date_default_timezone_get();
-
- date_default_timezone_set($timezone_identifier);
- $this->run_gmgetdate_assertion();
- date_default_timezone_set($current_timezone);
- }
+ if ($timezone_identifier)
+ {
+ $current_timezone = date_default_timezone_get();
+ date_default_timezone_set($timezone_identifier);
+ }
- protected function run_gmgetdate_assertion()
- {
$expected = time();
$date_array = phpbb_gmgetdate($expected);
@@ -44,6 +50,22 @@ class phpbb_wrapper_gmgetdate_test extends phpbb_test_case
$date_array['year']
);
- $this->assertEquals($expected, $actual);
+ // Calling second-granularity time functions twice isn't guaranteed to
+ // give the same results. As long as they're in the right order, allow
+ // a 1 second difference.
+ $this->assertGreaterThanOrEqual(
+ $expected, $actual,
+ 'Expected second time to be after (or equal to) the previous one'
+ );
+ $this->assertLessThanOrEqual(
+ 1,
+ abs($actual - $expected),
+ "Expected $actual to be within 1 second of $expected."
+ );
+
+ if (isset($current_timezone))
+ {
+ date_default_timezone_set($current_timezone);
+ }
}
}
diff --git a/tests/wrapper/mt_rand_test.php b/tests/wrapper/mt_rand_test.php
index eba0bf2faa..d190182286 100644
--- a/tests/wrapper/mt_rand_test.php
+++ b/tests/wrapper/mt_rand_test.php
@@ -1,9 +1,13 @@
<?php
/**
*
-* @package testing
-* @copyright (c) 2011 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
diff --git a/tests/wrapper/phpbb_php_ini_fake.php b/tests/wrapper/phpbb_php_ini_fake.php
new file mode 100644
index 0000000000..f218ff6d03
--- /dev/null
+++ b/tests/wrapper/phpbb_php_ini_fake.php
@@ -0,0 +1,20 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+class phpbb_php_ini_fake extends \phpbb\php\ini
+{
+ function get($varname)
+ {
+ return $varname;
+ }
+}
diff --git a/tests/wrapper/phpbb_php_ini_test.php b/tests/wrapper/phpbb_php_ini_test.php
new file mode 100644
index 0000000000..27c2487f0a
--- /dev/null
+++ b/tests/wrapper/phpbb_php_ini_test.php
@@ -0,0 +1,90 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+require_once dirname(__FILE__) . '/phpbb_php_ini_fake.php';
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
+
+class phpbb_wrapper_phpbb_php_ini_test extends phpbb_test_case
+{
+ protected $php_ini;
+
+ public function setUp()
+ {
+ $this->php_ini = new phpbb_php_ini_fake;
+ }
+
+ public function test_get_string()
+ {
+ $this->assertSame(false, $this->php_ini->get_string(false));
+ $this->assertSame('phpbb', $this->php_ini->get_string(' phpbb '));
+ }
+
+ public function test_get_bool()
+ {
+ $this->assertSame(true, $this->php_ini->get_bool('ON'));
+ $this->assertSame(true, $this->php_ini->get_bool('on'));
+ $this->assertSame(true, $this->php_ini->get_bool('1'));
+
+ $this->assertSame(false, $this->php_ini->get_bool('OFF'));
+ $this->assertSame(false, $this->php_ini->get_bool('off'));
+ $this->assertSame(false, $this->php_ini->get_bool('0'));
+ $this->assertSame(false, $this->php_ini->get_bool(''));
+ }
+
+ public function test_get_int()
+ {
+ $this->assertSame(1234, $this->php_ini->get_int('1234'));
+ $this->assertSame(-12345, $this->php_ini->get_int('-12345'));
+ $this->assertSame(false, $this->php_ini->get_int('phpBB'));
+ }
+
+ public function test_get_float()
+ {
+ $this->assertSame(1234.0, $this->php_ini->get_float('1234'));
+ $this->assertSame(-12345.0, $this->php_ini->get_float('-12345'));
+ $this->assertSame(false, $this->php_ini->get_float('phpBB'));
+ }
+
+ public function test_get_bytes_invalid()
+ {
+ $this->assertSame(false, $this->php_ini->get_bytes(false));
+ $this->assertSame(false, $this->php_ini->get_bytes('phpBB'));
+ $this->assertSame(false, $this->php_ini->get_bytes('k'));
+ $this->assertSame(false, $this->php_ini->get_bytes('-k'));
+ $this->assertSame(false, $this->php_ini->get_bytes('M'));
+ $this->assertSame(false, $this->php_ini->get_bytes('-M'));
+ }
+
+ /**
+ * @dataProvider get_bytes_data
+ */
+ public function test_get_bytes($expected, $value)
+ {
+ $actual = $this->php_ini->get_bytes($value);
+
+ $this->assertTrue(is_float($actual) || is_int($actual));
+ $this->assertEquals($expected, $actual);
+ }
+
+ static public function get_bytes_data()
+ {
+ return array(
+ array(32 * pow(2, 20), '32m'),
+ array(- 32 * pow(2, 20), '-32m'),
+ array(8 * pow(2, 30), '8G'),
+ array(- 8 * pow(2, 30), '-8G'),
+ array(1234, '1234'),
+ array(-12345, '-12345'),
+ );
+ }
+}
diff --git a/tests/wrapper/version_compare_test.php b/tests/wrapper/version_compare_test.php
index 8b42eb4bee..93d9e0117d 100644
--- a/tests/wrapper/version_compare_test.php
+++ b/tests/wrapper/version_compare_test.php
@@ -1,9 +1,13 @@
<?php
/**
*
-* @package testing
-* @copyright (c) 2011 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
diff --git a/travis/check-executable-files.sh b/travis/check-executable-files.sh
new file mode 100755
index 0000000000..4d420add1c
--- /dev/null
+++ b/travis/check-executable-files.sh
@@ -0,0 +1,68 @@
+#!/bin/bash
+#
+# This file is part of the phpBB Forum Software package.
+#
+# @copyright (c) phpBB Limited <https://www.phpbb.com>
+# @license GNU General Public License, version 2 (GPL-2.0)
+#
+# For full copyright and license information, please see
+# the docs/CREDITS.txt file.
+#
+set -e
+
+DB=$1
+TRAVIS_PHP_VERSION=$2
+root="$3"
+path="${root}phpBB/"
+
+if [ "$TRAVIS_PHP_VERSION" == "5.3.3" -a "$DB" == "mysqli" ]
+then
+ # Check the permissions of the files
+
+ # The following variables MUST NOT contain any wildcard
+ # Directories to skip
+ directories_skipped="-path ${path}develop -o -path ${path}vendor"
+
+ # Files to skip
+ files_skipped="-false"
+
+ # Files which have to be executable
+ executable_files="-path ${path}bin/*"
+
+ incorrect_files=$( \
+ find ${path} \
+ '(' \
+ '(' \
+ ${directories_skipped} \
+ ')' \
+ -a -type d -prune -a -type f \
+ ')' -o \
+ '(' \
+ -type f -a \
+ -not '(' \
+ ${files_skipped} \
+ ')' -a \
+ '(' \
+ '(' \
+ '(' \
+ ${executable_files} \
+ ')' -a \
+ -not -perm +100 \
+ ')' -o \
+ '(' \
+ -not '(' \
+ ${executable_files} \
+ ')' -a \
+ -perm +111 \
+ ')' \
+ ')' \
+ ')' \
+ )
+
+ if [ "${incorrect_files}" != '' ]
+ then
+ echo "The following files do not have proper permissions:";
+ ls -la ${incorrect_files}
+ exit 1;
+ fi
+fi
diff --git a/travis/check-image-icc-profiles.sh b/travis/check-image-icc-profiles.sh
new file mode 100755
index 0000000000..5926962d40
--- /dev/null
+++ b/travis/check-image-icc-profiles.sh
@@ -0,0 +1,20 @@
+#!/bin/bash
+#
+# This file is part of the phpBB Forum Software package.
+#
+# @copyright (c) phpBB Limited <https://www.phpbb.com>
+# @license GNU General Public License, version 2 (GPL-2.0)
+#
+# For full copyright and license information, please see
+# the docs/CREDITS.txt file.
+#
+set -e
+
+DB=$1
+TRAVIS_PHP_VERSION=$2
+
+if [ "$TRAVIS_PHP_VERSION" == "5.3.3" -a "$DB" == "mysqli" ]
+then
+ find . -type f -a -iregex '.*\.\(gif\|jpg\|jpeg\|png\)$' -a -not -wholename '*vendor/*' | \
+ parallel --gnu --keep-order 'phpBB/develop/strip_icc_profiles.sh {}'
+fi
diff --git a/travis/check-sami-parse-errors.sh b/travis/check-sami-parse-errors.sh
new file mode 100755
index 0000000000..c3338e34db
--- /dev/null
+++ b/travis/check-sami-parse-errors.sh
@@ -0,0 +1,33 @@
+#!/bin/bash
+#
+# This file is part of the phpBB Forum Software package.
+#
+# @copyright (c) phpBB Limited <https://www.phpbb.com>
+# @license GNU General Public License, version 2 (GPL-2.0)
+#
+# For full copyright and license information, please see
+# the docs/CREDITS.txt file.
+#
+set -e
+
+DB=$1
+TRAVIS_PHP_VERSION=$2
+
+if [ "$TRAVIS_PHP_VERSION" == "5.3.3" -a "$DB" == "mysqli" ]
+then
+ # Workarounds for
+ # https://github.com/fabpot/Sami/issues/116
+ # and
+ # https://github.com/fabpot/Sami/issues/117
+ errors=$(
+ unbuffer phpBB/vendor/bin/sami.php parse build/sami-checkout.conf.php -v | \
+ sed "s,\x1B\[[0-9;]*[a-zA-Z],,g" | \
+ grep "ERROR: " | \
+ tee /dev/tty | \
+ wc -l
+ )
+ if [ "$errors" != "0" ]
+ then
+ exit 1
+ fi
+fi
diff --git a/travis/ext-sniff.sh b/travis/ext-sniff.sh
new file mode 100755
index 0000000000..4e557a41c1
--- /dev/null
+++ b/travis/ext-sniff.sh
@@ -0,0 +1,27 @@
+#!/bin/bash
+#
+# This file is part of the phpBB Forum Software package.
+#
+# @copyright (c) phpBB Limited <https://www.phpbb.com>
+# @license GNU General Public License, version 2 (GPL-2.0)
+#
+# For full copyright and license information, please see
+# the docs/CREDITS.txt file.
+#
+set -e
+set -x
+
+DB=$1
+TRAVIS_PHP_VERSION=$2
+EXTNAME=$3
+
+if [ "$TRAVIS_PHP_VERSION" == "5.5" -a "$DB" == "mysqli" ]
+then
+ phpBB/vendor/bin/phpcs \
+ -s \
+ --extensions=php \
+ --standard=build/code_sniffer/ruleset-php-extensions.xml \
+ "--ignore=phpBB/ext/$EXTNAME/tests/*" \
+ "--ignore=phpBB/ext/$EXTNAME/vendor/*" \
+ "phpBB/ext/$EXTNAME"
+fi
diff --git a/travis/install-phpbb-test-dependencies.sh b/travis/install-phpbb-test-dependencies.sh
new file mode 100755
index 0000000000..25743ff2b1
--- /dev/null
+++ b/travis/install-phpbb-test-dependencies.sh
@@ -0,0 +1,16 @@
+#!/bin/bash
+#
+# This file is part of the phpBB Forum Software package.
+#
+# @copyright (c) phpBB Limited <https://www.phpbb.com>
+# @license GNU General Public License, version 2 (GPL-2.0)
+#
+# For full copyright and license information, please see
+# the docs/CREDITS.txt file.
+#
+set -e
+set -x
+
+cd tests
+php ../composer.phar install --dev --no-interaction --prefer-source
+cd ..
diff --git a/travis/phing-sniff.sh b/travis/phing-sniff.sh
new file mode 100755
index 0000000000..660d1764c2
--- /dev/null
+++ b/travis/phing-sniff.sh
@@ -0,0 +1,22 @@
+#!/bin/bash
+#
+# This file is part of the phpBB Forum Software package.
+#
+# @copyright (c) phpBB Limited <https://www.phpbb.com>
+# @license GNU General Public License, version 2 (GPL-2.0)
+#
+# For full copyright and license information, please see
+# the docs/CREDITS.txt file.
+#
+set -e
+set -x
+
+DB=$1
+TRAVIS_PHP_VERSION=$2
+
+if [ "$TRAVIS_PHP_VERSION" == "5.5" -a "$DB" == "mysqli" ]
+then
+ cd build
+ ../phpBB/vendor/bin/phing sniff
+ cd ..
+fi
diff --git a/travis/phpunit-mariadb-travis.xml b/travis/phpunit-mariadb-travis.xml
index aa245a8224..53a206b9b0 100644
--- a/travis/phpunit-mariadb-travis.xml
+++ b/travis/phpunit-mariadb-travis.xml
@@ -16,10 +16,14 @@
<directory suffix="_test.php">../tests</directory>
<exclude>../tests/functional</exclude>
<exclude>../tests/lint_test.php</exclude>
+ <exclude>../tests/ui</exclude>
</testsuite>
<testsuite name="phpBB Functional Tests">
<directory suffix="_test.php" phpVersion="5.3.19" phpVersionOperator=">=">../tests/functional</directory>
</testsuite>
+ <testsuite name="phpBB UI Tests">
+ <directory suffix="_test.php" phpVersion="5.3.19" phpVersionOperator=">=">../tests/ui</directory>
+ </testsuite>
</testsuites>
<groups>
diff --git a/travis/phpunit-mysql-travis.xml b/travis/phpunit-mysql-travis.xml
index 3ad59747ff..d0d3e3c0c0 100644
--- a/travis/phpunit-mysql-travis.xml
+++ b/travis/phpunit-mysql-travis.xml
@@ -16,13 +16,14 @@
<directory suffix="_test.php">../tests</directory>
<exclude>../tests/functional</exclude>
<exclude>../tests/lint_test.php</exclude>
- </testsuite>
- <testsuite name="phpBB Lint Test">
- <file>../tests/lint_test.php</file>
+ <exclude>../tests/ui</exclude>
</testsuite>
<testsuite name="phpBB Functional Tests">
<directory suffix="_test.php" phpVersion="5.3.19" phpVersionOperator=">=">../tests/functional</directory>
</testsuite>
+ <testsuite name="phpBB UI Tests">
+ <directory suffix="_test.php" phpVersion="5.3.19" phpVersionOperator=">=">../tests/ui</directory>
+ </testsuite>
</testsuites>
<groups>
@@ -32,12 +33,13 @@
</groups>
<php>
- <server name="PHPBB_TEST_DBMS" value="mysqli" />
+ <server name="PHPBB_TEST_DBMS" value="phpbb\db\driver\mysql" />
<server name="PHPBB_TEST_DBHOST" value="0.0.0.0" />
<server name="PHPBB_TEST_DBPORT" value="3306" />
<server name="PHPBB_TEST_DBNAME" value="phpbb_tests" />
<server name="PHPBB_TEST_DBUSER" value="root" />
<server name="PHPBB_TEST_DBPASSWD" value="" />
+ <server name="PHPBB_TEST_REDIS_HOST" value="localhost" />
<server name="PHPBB_TEST_TABLE_PREFIX" value="phpbb_"/>
<server name="PHPBB_FUNCTIONAL_URL" value="http://localhost/" />
</php>
diff --git a/travis/phpunit-mysqli-travis.xml b/travis/phpunit-mysqli-travis.xml
new file mode 100644
index 0000000000..b12ae6fe8b
--- /dev/null
+++ b/travis/phpunit-mysqli-travis.xml
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<phpunit backupGlobals="true"
+ backupStaticAttributes="true"
+ colors="true"
+ convertErrorsToExceptions="true"
+ convertNoticesToExceptions="true"
+ convertWarningsToExceptions="true"
+ processIsolation="false"
+ stopOnFailure="false"
+ syntaxCheck="true"
+ strict="true"
+ verbose="true"
+ bootstrap="../tests/bootstrap.php">
+ <testsuites>
+ <testsuite name="phpBB Test Suite">
+ <directory suffix="_test.php">../tests</directory>
+ <exclude>../tests/functional</exclude>
+ <exclude>../tests/lint_test.php</exclude>
+ <exclude>../tests/ui</exclude>
+ </testsuite>
+ <testsuite name="phpBB Functional Tests">
+ <directory suffix="_test.php" phpVersion="5.3.19" phpVersionOperator=">=">../tests/functional</directory>
+ </testsuite>
+ <testsuite name="phpBB UI Tests">
+ <directory suffix="_test.php" phpVersion="5.3.19" phpVersionOperator=">=">../tests/ui</directory>
+ </testsuite>
+ </testsuites>
+
+ <groups>
+ <exclude>
+ <group>slow</group>
+ </exclude>
+ </groups>
+
+ <php>
+ <server name="PHPBB_TEST_DBMS" value="phpbb\db\driver\mysqli" />
+ <server name="PHPBB_TEST_DBHOST" value="0.0.0.0" />
+ <server name="PHPBB_TEST_DBPORT" value="3306" />
+ <server name="PHPBB_TEST_DBNAME" value="phpbb_tests" />
+ <server name="PHPBB_TEST_DBUSER" value="root" />
+ <server name="PHPBB_TEST_DBPASSWD" value="" />
+ <server name="PHPBB_TEST_REDIS_HOST" value="localhost" />
+ <server name="PHPBB_TEST_TABLE_PREFIX" value="phpbb_"/>
+ <server name="PHPBB_FUNCTIONAL_URL" value="http://localhost/" />
+ </php>
+</phpunit>
diff --git a/travis/phpunit-postgres-travis.xml b/travis/phpunit-postgres-travis.xml
index b4af7c5765..fa497a1264 100644
--- a/travis/phpunit-postgres-travis.xml
+++ b/travis/phpunit-postgres-travis.xml
@@ -16,10 +16,14 @@
<directory suffix="_test.php">../tests</directory>
<exclude>../tests/functional</exclude>
<exclude>../tests/lint_test.php</exclude>
+ <exclude>../tests/ui</exclude>
</testsuite>
<testsuite name="phpBB Functional Tests">
<directory suffix="_test.php" phpVersion="5.3.19" phpVersionOperator=">=">../tests/functional</directory>
</testsuite>
+ <testsuite name="phpBB UI Tests">
+ <directory suffix="_test.php" phpVersion="5.3.19" phpVersionOperator=">=">../tests/ui</directory>
+ </testsuite>
</testsuites>
<groups>
@@ -29,14 +33,13 @@
</groups>
<php>
- <!-- "Real" test database -->
- <!-- uncomment, otherwise sqlite memory runs -->
- <server name="PHPBB_TEST_DBMS" value="postgres"/>
+ <server name="PHPBB_TEST_DBMS" value="phpbb\db\driver\postgres"/>
<server name="PHPBB_TEST_DBHOST" value="localhost" />
<server name="PHPBB_TEST_DBPORT" value="5432" />
<server name="PHPBB_TEST_DBNAME" value="phpbb_tests" />
<server name="PHPBB_TEST_DBUSER" value="postgres" />
<server name="PHPBB_TEST_DBPASSWD" value="" />
+ <server name="PHPBB_TEST_REDIS_HOST" value="localhost" />
<server name="PHPBB_TEST_TABLE_PREFIX" value="phpbb_"/>
<server name="PHPBB_FUNCTIONAL_URL" value="http://localhost/" />
</php>
diff --git a/travis/phpunit-sqlite3-travis.xml b/travis/phpunit-sqlite3-travis.xml
new file mode 100644
index 0000000000..5baab791e0
--- /dev/null
+++ b/travis/phpunit-sqlite3-travis.xml
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<phpunit backupGlobals="true"
+ backupStaticAttributes="true"
+ colors="true"
+ convertErrorsToExceptions="true"
+ convertNoticesToExceptions="true"
+ convertWarningsToExceptions="true"
+ processIsolation="false"
+ stopOnFailure="false"
+ syntaxCheck="true"
+ strict="true"
+ verbose="true"
+ bootstrap="../tests/bootstrap.php">
+ <testsuites>
+ <testsuite name="phpBB Test Suite">
+ <directory suffix="_test.php">../tests</directory>
+ <exclude>../tests/functional</exclude>
+ <exclude>../tests/lint_test.php</exclude>
+ <exclude>../tests/ui</exclude>
+ </testsuite>
+ <testsuite name="phpBB Functional Tests">
+ <directory suffix="_test.php" phpVersion="5.3.19" phpVersionOperator=">=">../tests/functional</directory>
+ </testsuite>
+ <testsuite name="phpBB UI Tests">
+ <directory suffix="_test.php" phpVersion="5.3.19" phpVersionOperator=">=">../tests/ui</directory>
+ </testsuite>
+ </testsuites>
+
+ <groups>
+ <exclude>
+ <group>slow</group>
+ </exclude>
+ </groups>
+
+ <php>
+ <!--server name="PHPBB_TEST_DBMS" value="phpbb\db\driver\sqlite3" /-->
+ <!--server name="PHPBB_TEST_DBHOST" value="../phpbb_unit_tests.sqlite3" /-->
+ <!--server name="PHPBB_TEST_DBPORT" value="" /-->
+ <!--server name="PHPBB_TEST_DBNAME" value="" /-->
+ <!--server name="PHPBB_TEST_DBUSER" value="" /-->
+ <!--server name="PHPBB_TEST_DBPASSWD" value="" /-->
+ <server name="PHPBB_TEST_REDIS_HOST" value="localhost" />
+ <server name="PHPBB_TEST_TABLE_PREFIX" value="phpbb_"/>
+ <server name="PHPBB_FUNCTIONAL_URL" value="http://localhost/" />
+ </php>
+</phpunit>
diff --git a/travis/prepare-extension.sh b/travis/prepare-extension.sh
new file mode 100755
index 0000000000..4518f935f8
--- /dev/null
+++ b/travis/prepare-extension.sh
@@ -0,0 +1,22 @@
+#!/bin/bash
+#
+# This file is part of the phpBB Forum Software package.
+#
+# @copyright (c) phpBB Limited <https://www.phpbb.com>
+# @license GNU General Public License, version 2 (GPL-2.0)
+#
+# For full copyright and license information, please see
+# the docs/CREDITS.txt file.
+#
+set -e
+set -x
+
+EXTNAME=$1
+BRANCH=$2
+
+# Move the extension in place
+mkdir --parents phpBB/ext/$EXTNAME
+cp -R ../tmp/* phpBB/ext/$EXTNAME
+
+# Move the extensions travis/phpunit-*-travis.xml files in place
+cp -R travis/* phpBB/ext/$EXTNAME/travis
diff --git a/travis/setup-database.sh b/travis/setup-database.sh
new file mode 100755
index 0000000000..4ba9157d9d
--- /dev/null
+++ b/travis/setup-database.sh
@@ -0,0 +1,31 @@
+#!/bin/bash
+#
+# This file is part of the phpBB Forum Software package.
+#
+# @copyright (c) phpBB Limited <https://www.phpbb.com>
+# @license GNU General Public License, version 2 (GPL-2.0)
+#
+# For full copyright and license information, please see
+# the docs/CREDITS.txt file.
+#
+set -e
+set -x
+
+DB=$1
+TRAVIS_PHP_VERSION=$2
+
+if [ "$DB" == "postgres" ]
+then
+ psql -c 'DROP DATABASE IF EXISTS phpbb_tests;' -U postgres
+ psql -c 'create database phpbb_tests;' -U postgres
+fi
+
+if [ "$TRAVIS_PHP_VERSION" == "5.3" -a "$DB" == "mysqli" ]
+then
+ mysql -e 'SET GLOBAL storage_engine=MyISAM;'
+fi
+
+if [ "$DB" == "mysql" -o "$DB" == "mysqli" -o "$DB" == "mariadb" ]
+then
+ mysql -e 'create database IF NOT EXISTS phpbb_tests;'
+fi
diff --git a/travis/setup-exiftool.sh b/travis/setup-exiftool.sh
new file mode 100755
index 0000000000..04999b8600
--- /dev/null
+++ b/travis/setup-exiftool.sh
@@ -0,0 +1,14 @@
+#!/bin/sh
+#
+# This file is part of the phpBB Forum Software package.
+#
+# @copyright (c) phpBB Limited <https://www.phpbb.com>
+# @license GNU General Public License, version 2 (GPL-2.0)
+#
+# For full copyright and license information, please see
+# the docs/CREDITS.txt file.
+#
+set -e
+
+sudo apt-get update
+sudo apt-get install -y parallel libimage-exiftool-perl
diff --git a/travis/setup-mariadb.sh b/travis/setup-mariadb.sh
index aceb6af7ee..9bc487915d 100755
--- a/travis/setup-mariadb.sh
+++ b/travis/setup-mariadb.sh
@@ -1,7 +1,12 @@
#!/bin/bash
#
-# @copyright (c) 2013 phpBB Group
-# @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+# This file is part of the phpBB Forum Software package.
+#
+# @copyright (c) phpBB Limited <https://www.phpbb.com>
+# @license GNU General Public License, version 2 (GPL-2.0)
+#
+# For full copyright and license information, please see
+# the docs/CREDITS.txt file.
#
set -e
set -x
diff --git a/travis/setup-php-extensions.sh b/travis/setup-php-extensions.sh
new file mode 100755
index 0000000000..d9544858b7
--- /dev/null
+++ b/travis/setup-php-extensions.sh
@@ -0,0 +1,59 @@
+#!/bin/bash
+#
+# This file is part of the phpBB Forum Software package.
+#
+# @copyright (c) phpBB Limited <https://www.phpbb.com>
+# @license GNU General Public License, version 2 (GPL-2.0)
+#
+# For full copyright and license information, please see
+# the docs/CREDITS.txt file.
+#
+set -e
+set -x
+
+function find_php_ini
+{
+ echo $(php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||")
+}
+
+# $1 - PHP extension name
+# $2 - PHP ini file path
+function register_php_extension
+{
+ echo "extension=$1.so" >> "$2"
+}
+
+# $1 - PHP extension name
+# $2 - PHP ini file path
+function install_php_extension
+{
+ echo "Installing $1 PHP extension"
+
+ # See http://www.php.net/manual/en/install.pecl.phpize.php
+ cd "$1"
+ phpize
+ ./configure
+ make
+ make install
+ cd ..
+
+ register_php_extension "$1" "$2"
+}
+
+php_ini_file=$(find_php_ini)
+
+# apc
+if [ `php -r "echo (int) version_compare(PHP_VERSION, '5.5.0-dev', '<');"` == "1" ]
+then
+ echo 'Enabling APC PHP extension'
+ register_php_extension 'apc' "$php_ini_file"
+ echo 'apc.enable_cli=1' >> "$php_ini_file"
+else
+ echo 'Disabling Opcache'
+ echo 'opcache.enable=0' >> "$php_ini_file"
+fi
+
+# redis
+# Disabled redis for now as it causes travis to fail
+# git clone git://github.com/nicolasff/phpredis.git redis
+# install_php_extension 'redis' "$php_ini_file"
diff --git a/travis/setup-phpbb.sh b/travis/setup-phpbb.sh
new file mode 100755
index 0000000000..4daa754481
--- /dev/null
+++ b/travis/setup-phpbb.sh
@@ -0,0 +1,46 @@
+#!/bin/bash
+#
+# This file is part of the phpBB Forum Software package.
+#
+# @copyright (c) phpBB Limited <https://www.phpbb.com>
+# @license GNU General Public License, version 2 (GPL-2.0)
+#
+# For full copyright and license information, please see
+# the docs/CREDITS.txt file.
+#
+set -e
+set -x
+
+DB=$1
+TRAVIS_PHP_VERSION=$2
+
+if [ "$TRAVIS_PHP_VERSION" == "5.3.3" -a "$DB" == "mysqli" ]
+then
+ travis/setup-exiftool.sh
+ travis/setup-unbuffer.sh
+fi
+
+if [ "$DB" == "mariadb" ]
+then
+ travis/setup-mariadb.sh
+fi
+
+if [ "$TRAVIS_PHP_VERSION" != "hhvm" ]
+then
+ travis/setup-php-extensions.sh
+fi
+
+if [ `php -r "echo (int) version_compare(PHP_VERSION, '5.3.19', '>=');"` == "1" ]
+then
+ travis/setup-webserver.sh
+ travis/install-phpbb-test-dependencies.sh
+fi
+
+cd phpBB
+if [ `php -r "echo (int) version_compare(PHP_VERSION, '5.3.4', '<');"` == "1" ]
+then
+ php ../composer.phar config disable-tls true
+fi
+php ../composer.phar install --dev --no-interaction
+
+cd ..
diff --git a/travis/setup-unbuffer.sh b/travis/setup-unbuffer.sh
new file mode 100755
index 0000000000..4423d1b8b6
--- /dev/null
+++ b/travis/setup-unbuffer.sh
@@ -0,0 +1,14 @@
+#!/bin/sh
+#
+# This file is part of the phpBB Forum Software package.
+#
+# @copyright (c) phpBB Limited <https://www.phpbb.com>
+# @license GNU General Public License, version 2 (GPL-2.0)
+#
+# For full copyright and license information, please see
+# the docs/CREDITS.txt file.
+#
+set -e
+
+sudo apt-get update
+sudo apt-get install -y expect-dev
diff --git a/travis/setup-webserver.sh b/travis/setup-webserver.sh
index a6086bb9f9..911ba12f3c 100755
--- a/travis/setup-webserver.sh
+++ b/travis/setup-webserver.sh
@@ -1,17 +1,16 @@
#!/bin/bash
#
-# @copyright (c) 2014 phpBB Group
-# @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+# This file is part of the phpBB Forum Software package.
+#
+# @copyright (c) phpBB Limited <https://www.phpbb.com>
+# @license GNU General Public License, version 2 (GPL-2.0)
+#
+# For full copyright and license information, please see
+# the docs/CREDITS.txt file.
#
set -e
set -x
-if [ "$TRAVIS_PHP_VERSION" = 'hhvm' ]
-then
- # Add PPA providing dependencies for recent HHVM on Ubuntu 12.04.
- sudo add-apt-repository -y ppa:mapnik/boost
-fi
-
sudo apt-get update
sudo apt-get install -y nginx realpath
@@ -25,11 +24,9 @@ APP_SOCK=$(realpath "$DIR")/php-app.sock
if [ "$TRAVIS_PHP_VERSION" = 'hhvm' ]
then
- # Upgrade to a recent stable version of HHVM
- sudo apt-get -o Dpkg::Options::="--force-confnew" install -y hhvm-nightly
-
HHVM_LOG=$(realpath "$DIR")/hhvm.log
+ sudo service hhvm stop
sudo hhvm \
--mode daemon \
--user "$USER" \
@@ -67,8 +64,11 @@ echo "
index index.php index.html;
location ~ \.php {
- fastcgi_pass unix:$APP_SOCK;
- include fastcgi_params;
+ include fastcgi_params;
+ fastcgi_split_path_info ^(.+\.php)(/.*)$;
+ fastcgi_param PATH_INFO \$fastcgi_path_info;
+ fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;
+ fastcgi_pass unix:$APP_SOCK;
}
}
" | sudo tee $NGINX_CONF > /dev/null